Built motion from commit 659b5db5.|2.5.34
authorAndrea Bianco <andrea.bianco@xcally.com>
Sat, 28 Aug 2021 20:26:39 +0000 (22:26 +0200)
committerAndrea Bianco <andrea.bianco@xcally.com>
Sat, 28 Aug 2021 20:26:39 +0000 (22:26 +0200)
1147 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/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/realtime/index.js
server/api/realtime/realtime.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/teamVoiceQueue/index.js
server/api/teamVoiceQueue/teamVoiceQueue.attributes.js
server/api/teamVoiceQueue/teamVoiceQueue.model.js
server/api/teamVoiceQueue/teamVoiceQueue.rpc.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/userNotification/index.js
server/api/userNotification/userNotification.attributes.js
server/api/userNotification/userNotification.controller.js
server/api/userNotification/userNotification.events.js
server/api/userNotification/userNotification.model.js
server/api/userNotification/userNotification.rpc.js
server/api/userNotification/userNotification.socket.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/schedule/whatsapp.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/setting.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/rpc/setting.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/dialogflowV2.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 8f28f1d..8423e89 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-08-28T11:47:33.992Z",
+    "time": "2021-08-28T20:08:55.546Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 347c685..f774686 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-08-28T11:47:33.992Z",
+    "time": "2021-08-28T20:08:55.546Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index 547e2d6..092e9f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x235e=['exports','getDataValue','STRING','contactManager','integration','motionbar','jscripty','browser','bot','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]','TEXT','sequelize'];(function(_0x32c274,_0x109c6a){var _0x57021d=function(_0x13627d){while(--_0x13627d){_0x32c274['push'](_0x32c274['shift']());}};_0x57021d(++_0x109c6a);}(_0x235e,0x68));var _0xe235=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x235e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe235('0x0'));module[_0xe235('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5362fb){return this[_0xe235('0x2')]('action');}},'action':{'type':Sequelize[_0xe235('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xe235('0x4'),_0xe235('0x5'),_0xe235('0x6'),_0xe235('0x7'),'urlForward',_0xe235('0x8'),_0xe235('0x9'),_0xe235('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xe235('0xb')},'data1':{'type':Sequelize[_0xe235('0x3')](0x1000),'comment':_0xe235('0xc')},'data2':{'type':Sequelize[_0xe235('0x3')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0xe235('0x3')](0x1000),'comment':_0xe235('0xd')},'data4':{'type':Sequelize[_0xe235('0x3')](0x1000)},'data5':{'type':Sequelize[_0xe235('0x3')](0x1000)},'data6':{'type':Sequelize[_0xe235('0x3')]},'data7':{'type':Sequelize[_0xe235('0xe')]}};
\ No newline at end of file
+var _0x97d5=['browser','bot','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]','TEXT','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty'];(function(_0x56825b,_0x172b8d){var _0x69ce77=function(_0x348a1c){while(--_0x348a1c){_0x56825b['push'](_0x56825b['shift']());}};_0x69ce77(++_0x172b8d);}(_0x97d5,0x67));var _0x597d=function(_0x5810cf,_0xcffeda){_0x5810cf=_0x5810cf-0x0;var _0x3b76dc=_0x97d5[_0x5810cf];return _0x3b76dc;};'use strict';var Sequelize=require(_0x597d('0x0'));module['exports']={'name':{'type':Sequelize[_0x597d('0x1')],'get':function(_0x397bf2){return this[_0x597d('0x2')](_0x597d('0x3'));}},'action':{'type':Sequelize[_0x597d('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x597d('0x5'),_0x597d('0x6'),_0x597d('0x7'),_0x597d('0x8'),'urlForward',_0x597d('0x9'),_0x597d('0xa'),_0x597d('0xb')]],'msg':_0x597d('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x597d('0x4')](0x1000),'comment':_0x597d('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x597d('0x4')](0x1000),'comment':_0x597d('0xe')},'data4':{'type':Sequelize[_0x597d('0x4')](0x1000)},'data5':{'type':Sequelize[_0x597d('0x4')](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x597d('0xf')]}};
\ No newline at end of file
index c688ebf..6e6ed71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb90d=['desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','body','Action','find','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x1c207b,_0x27c1d8){var _0x1f9acf=function(_0x3931c2){while(--_0x3931c2){_0x1c207b['push'](_0x1c207b['shift']());}};_0x1f9acf(++_0x27c1d8);}(_0xb90d,0xdd));var _0xdb90=function(_0x4f96b4,_0x22cc57){_0x4f96b4=_0x4f96b4-0x0;var _0x67821b=_0xb90d[_0x4f96b4];return _0x67821b;};'use strict';var emlformat=require(_0xdb90('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb90('0x1'));var jsonpatch=require(_0xdb90('0x2'));var rp=require(_0xdb90('0x3'));var moment=require(_0xdb90('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdb90('0x5'));var util=require('util');var path=require(_0xdb90('0x6'));var sox=require(_0xdb90('0x7'));var csv=require(_0xdb90('0x8'));var ejs=require(_0xdb90('0x9'));var fs=require('fs');var fs_extra=require(_0xdb90('0xa'));var _=require('lodash');var squel=require(_0xdb90('0xb'));var crypto=require(_0xdb90('0xc'));var jsforce=require(_0xdb90('0xd'));var deskjs=require(_0xdb90('0xe'));var toCsv=require(_0xdb90('0x8'));var querystring=require('querystring');var Papa=require(_0xdb90('0xf'));var Redis=require(_0xdb90('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdb90('0x11'));var hardwareService=require(_0xdb90('0x12'));var logger=require(_0xdb90('0x13'))(_0xdb90('0x14'));var utils=require(_0xdb90('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xdb90('0x16'));var db=require(_0xdb90('0x17'))['db'];function respondWithStatusCode(_0xe9da1c,_0xe5e957){_0xe5e957=_0xe5e957||0xcc;return function(_0x13c68c){if(_0x13c68c){return _0xe9da1c['sendStatus'](_0xe5e957);}return _0xe9da1c[_0xdb90('0x18')](_0xe5e957)['end']();};}function respondWithResult(_0x5187c1,_0x1f42e4){_0x1f42e4=_0x1f42e4||0xc8;return function(_0x3b6b4b){if(_0x3b6b4b){return _0x5187c1[_0xdb90('0x18')](_0x1f42e4)[_0xdb90('0x19')](_0x3b6b4b);}};}function respondWithFilteredResult(_0x547f3a,_0x5a48e4){return function(_0x175059){if(_0x175059){var _0x99875e=typeof _0x5a48e4[_0xdb90('0x1a')]===_0xdb90('0x1b')&&typeof _0x5a48e4['limit']==='undefined';var _0x31ddec=_0x175059[_0xdb90('0x1c')];var _0x53e8bc=_0x99875e?0x0:_0x5a48e4['offset'];var _0x1c5b05=_0x99875e?_0x175059['count']:_0x5a48e4['offset']+_0x5a48e4[_0xdb90('0x1d')];var _0x7a0e39;if(_0x1c5b05>=_0x31ddec){_0x1c5b05=_0x31ddec;_0x7a0e39=0xc8;}else{_0x7a0e39=0xce;}_0x547f3a[_0xdb90('0x18')](_0x7a0e39);return _0x547f3a[_0xdb90('0x1e')](_0xdb90('0x1f'),_0x53e8bc+'-'+_0x1c5b05+'/'+_0x31ddec)['json'](_0x175059);}return null;};}function patchUpdates(_0x21e7ef){return function(_0x589b78){try{jsonpatch['apply'](_0x589b78,_0x21e7ef,!![]);}catch(_0x1c4812){return BPromise[_0xdb90('0x20')](_0x1c4812);}return _0x589b78[_0xdb90('0x21')]();};}function saveUpdates(_0x24c402,_0x5c6e19){return function(_0x2eefd1){if(_0x2eefd1){return _0x2eefd1[_0xdb90('0x22')](_0x24c402)[_0xdb90('0x23')](function(_0x2ed361){return _0x2ed361;});}return null;};}function removeEntity(_0x4f11d0,_0x249a01){return function(_0x3adf18){if(_0x3adf18){return _0x3adf18[_0xdb90('0x24')]()[_0xdb90('0x23')](function(){_0x4f11d0[_0xdb90('0x18')](0xcc)[_0xdb90('0x25')]();});}};}function handleEntityNotFound(_0x4d5e9d,_0x5e4068){return function(_0x16e519){if(!_0x16e519){_0x4d5e9d[_0xdb90('0x26')](0x194);}return _0x16e519;};}function handleError(_0x200eb4,_0x376a1b){_0x376a1b=_0x376a1b||0x1f4;return function(_0x397824){logger[_0xdb90('0x27')](_0x397824[_0xdb90('0x28')]);if(_0x397824[_0xdb90('0x29')]){delete _0x397824[_0xdb90('0x29')];}_0x200eb4[_0xdb90('0x18')](_0x376a1b)['send'](_0x397824);};}exports[_0xdb90('0x22')]=function(_0x444ea3,_0x24b85d){if(_0x444ea3[_0xdb90('0x2a')]['id']){delete _0x444ea3[_0xdb90('0x2a')]['id'];}return db[_0xdb90('0x2b')][_0xdb90('0x2c')]({'where':{'id':_0x444ea3[_0xdb90('0x2d')]['id']}})[_0xdb90('0x23')](handleEntityNotFound(_0x24b85d,null))[_0xdb90('0x23')](saveUpdates(_0x444ea3[_0xdb90('0x2a')],null))[_0xdb90('0x23')](respondWithResult(_0x24b85d,null))[_0xdb90('0x2e')](handleError(_0x24b85d,null));};exports[_0xdb90('0x24')]=function(_0xf053b4,_0xabcc8b){return db[_0xdb90('0x2b')][_0xdb90('0x2c')]({'where':{'id':_0xf053b4[_0xdb90('0x2d')]['id']}})['then'](handleEntityNotFound(_0xabcc8b,null))[_0xdb90('0x23')](removeEntity(_0xabcc8b,null))['catch'](handleError(_0xabcc8b,null));};
\ No newline at end of file
+var _0x4e6e=['ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','then','error','stack','name','send','update','body','Action','params','catch','destroy','find','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse'];(function(_0xd55fa0,_0x4132ec){var _0xb428ea=function(_0x44ab55){while(--_0x44ab55){_0xd55fa0['push'](_0xd55fa0['shift']());}};_0xb428ea(++_0x4132ec);}(_0x4e6e,0x76));var _0xe4e6=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4e6e[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xe4e6('0x0'));var rimraf=require(_0xe4e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4e6('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe4e6('0x3'));var Mustache=require(_0xe4e6('0x4'));var util=require(_0xe4e6('0x5'));var path=require('path');var sox=require(_0xe4e6('0x6'));var csv=require(_0xe4e6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe4e6('0x8'));var squel=require(_0xe4e6('0x9'));var crypto=require(_0xe4e6('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe4e6('0xb'));var toCsv=require(_0xe4e6('0x7'));var querystring=require(_0xe4e6('0xc'));var Papa=require(_0xe4e6('0xd'));var Redis=require(_0xe4e6('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe4e6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e6('0x10'));var logger=require(_0xe4e6('0x11'))('api');var utils=require(_0xe4e6('0x12'));var config=require(_0xe4e6('0x13'));var licenseUtil=require(_0xe4e6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61c38a,_0x5462fa){_0x5462fa=_0x5462fa||0xcc;return function(_0xf60862){if(_0xf60862){return _0x61c38a[_0xe4e6('0x15')](_0x5462fa);}return _0x61c38a[_0xe4e6('0x16')](_0x5462fa)[_0xe4e6('0x17')]();};}function respondWithResult(_0x272e76,_0x5b508c){_0x5b508c=_0x5b508c||0xc8;return function(_0x5de6ea){if(_0x5de6ea){return _0x272e76['status'](_0x5b508c)['json'](_0x5de6ea);}};}function respondWithFilteredResult(_0xb6e9eb,_0x1276ac){return function(_0x14c8fa){if(_0x14c8fa){var _0x24a963=typeof _0x1276ac[_0xe4e6('0x18')]===_0xe4e6('0x19')&&typeof _0x1276ac[_0xe4e6('0x1a')]===_0xe4e6('0x19');var _0x17550e=_0x14c8fa[_0xe4e6('0x1b')];var _0x47a03a=_0x24a963?0x0:_0x1276ac[_0xe4e6('0x18')];var _0x5546bd=_0x24a963?_0x14c8fa[_0xe4e6('0x1b')]:_0x1276ac[_0xe4e6('0x18')]+_0x1276ac['limit'];var _0x1e587e;if(_0x5546bd>=_0x17550e){_0x5546bd=_0x17550e;_0x1e587e=0xc8;}else{_0x1e587e=0xce;}_0xb6e9eb[_0xe4e6('0x16')](_0x1e587e);return _0xb6e9eb[_0xe4e6('0x1c')]('Content-Range',_0x47a03a+'-'+_0x5546bd+'/'+_0x17550e)[_0xe4e6('0x1d')](_0x14c8fa);}return null;};}function patchUpdates(_0x16c2cf){return function(_0x1d0032){try{jsonpatch[_0xe4e6('0x1e')](_0x1d0032,_0x16c2cf,!![]);}catch(_0x399db2){return BPromise[_0xe4e6('0x1f')](_0x399db2);}return _0x1d0032['save']();};}function saveUpdates(_0x43de2f,_0x244755){return function(_0x2a4ff5){if(_0x2a4ff5){return _0x2a4ff5['update'](_0x43de2f)[_0xe4e6('0x20')](function(_0x2c0c2d){return _0x2c0c2d;});}return null;};}function removeEntity(_0x5edb77,_0x245593){return function(_0x251623){if(_0x251623){return _0x251623['destroy']()[_0xe4e6('0x20')](function(){_0x5edb77[_0xe4e6('0x16')](0xcc)[_0xe4e6('0x17')]();});}};}function handleEntityNotFound(_0x3dcded,_0x2368aa){return function(_0xf2fd67){if(!_0xf2fd67){_0x3dcded[_0xe4e6('0x15')](0x194);}return _0xf2fd67;};}function handleError(_0x54fecd,_0x3a5fd0){_0x3a5fd0=_0x3a5fd0||0x1f4;return function(_0x2a19cc){logger[_0xe4e6('0x21')](_0x2a19cc[_0xe4e6('0x22')]);if(_0x2a19cc['name']){delete _0x2a19cc[_0xe4e6('0x23')];}_0x54fecd[_0xe4e6('0x16')](_0x3a5fd0)[_0xe4e6('0x24')](_0x2a19cc);};}exports[_0xe4e6('0x25')]=function(_0x2164c4,_0x1a45e4){if(_0x2164c4[_0xe4e6('0x26')]['id']){delete _0x2164c4[_0xe4e6('0x26')]['id'];}return db[_0xe4e6('0x27')]['find']({'where':{'id':_0x2164c4[_0xe4e6('0x28')]['id']}})[_0xe4e6('0x20')](handleEntityNotFound(_0x1a45e4,null))[_0xe4e6('0x20')](saveUpdates(_0x2164c4['body'],null))['then'](respondWithResult(_0x1a45e4,null))[_0xe4e6('0x29')](handleError(_0x1a45e4,null));};exports[_0xe4e6('0x2a')]=function(_0x2316e6,_0x16208a){return db[_0xe4e6('0x27')][_0xe4e6('0x2b')]({'where':{'id':_0x2316e6[_0xe4e6('0x28')]['id']}})[_0xe4e6('0x20')](handleEntityNotFound(_0x16208a,null))['then'](removeEntity(_0x16208a,null))[_0xe4e6('0x29')](handleError(_0x16208a,null));};
\ No newline at end of file
index a3c9adc..3e047e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2700=['path','../../config/environment','define','Action','tools_actions','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x2700,0xc0));var _0x0270=function(_0x373b46,_0x3eebe1){_0x373b46=_0x373b46-0x0;var _0xe580cb=_0x2700[_0x373b46];return _0xe580cb;};'use strict';var _=require(_0x0270('0x0'));var util=require(_0x0270('0x1'));var logger=require('../../config/logger')(_0x0270('0x2'));var moment=require(_0x0270('0x3'));var BPromise=require(_0x0270('0x4'));var rp=require(_0x0270('0x5'));var fs=require('fs');var path=require(_0x0270('0x6'));var rimraf=require('rimraf');var config=require(_0x0270('0x7'));var attributes=require('./action.attributes');module['exports']=function(_0x4bbd1d,_0x3404cf){return _0x4bbd1d[_0x0270('0x8')](_0x0270('0x9'),attributes,{'tableName':_0x0270('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4255=['tools_actions','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','define','Action'];(function(_0x21f457,_0x236b16){var _0x179f47=function(_0xec2a19){while(--_0xec2a19){_0x21f457['push'](_0x21f457['shift']());}};_0x179f47(++_0x236b16);}(_0x4255,0x1bb));var _0x5425=function(_0x178856,_0x41f045){_0x178856=_0x178856-0x0;var _0x3c7fe7=_0x4255[_0x178856];return _0x3c7fe7;};'use strict';var _=require(_0x5425('0x0'));var util=require('util');var logger=require(_0x5425('0x1'))(_0x5425('0x2'));var moment=require(_0x5425('0x3'));var BPromise=require(_0x5425('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5425('0x5'));var rimraf=require(_0x5425('0x6'));var config=require(_0x5425('0x7'));var attributes=require(_0x5425('0x8'));module[_0x5425('0x9')]=function(_0x439f1b,_0xb9e88c){return _0x439f1b[_0x5425('0xa')](_0x5425('0xb'),attributes,{'tableName':_0x5425('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d844b6f..2b60d9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x154ce0,_0x12ae3c){var _0x4e8570=function(_0xee5964){while(--_0xee5964){_0x154ce0['push'](_0x154ce0['shift']());}};_0x4e8570(++_0x12ae3c);}(_0xe14b,0x93));var _0xbe14=function(_0x5912c9,_0x3686ed){_0x5912c9=_0x5912c9-0x0;var _0x462017=_0xe14b[_0x5912c9];return _0x462017;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+var _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x9faff7,_0x59a564){var _0x4f8043=function(_0x5f060d){while(--_0x5f060d){_0x9faff7['push'](_0x9faff7['shift']());}};_0x4f8043(++_0x59a564);}(_0x5fab,0x177));var _0xb5fa=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x5fab[_0x3ec333];return _0x15ccb8;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
index 926399c..65d6918 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3075=['../../components/interaction/service','./action.controller','isAuthenticated','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1a6824,_0xd3d44){var _0x4ce73f=function(_0x4cb4c7){while(--_0x4cb4c7){_0x1a6824['push'](_0x1a6824['shift']());}};_0x4ce73f(++_0xd3d44);}(_0x3075,0x19c));var _0x5307=function(_0x505507,_0x43ef96){_0x505507=_0x505507-0x0;var _0x4cf336=_0x3075[_0x505507];return _0x4cf336;};'use strict';var multer=require(_0x5307('0x0'));var util=require(_0x5307('0x1'));var path=require(_0x5307('0x2'));var timeout=require(_0x5307('0x3'));var express=require(_0x5307('0x4'));var router=express[_0x5307('0x5')]();var fs_extra=require(_0x5307('0x6'));var auth=require(_0x5307('0x7'));var interaction=require(_0x5307('0x8'));var config=require('../../config/environment');var controller=require(_0x5307('0x9'));router['put']('/:id',auth[_0x5307('0xa')](),controller['update']);router[_0x5307('0xb')](_0x5307('0xc'),auth[_0x5307('0xa')](),controller['destroy']);module[_0x5307('0xd')]=router;
\ No newline at end of file
+var _0x6aec=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x4d1d20,_0x2dead1){var _0x547c54=function(_0x510aae){while(--_0x510aae){_0x4d1d20['push'](_0x4d1d20['shift']());}};_0x547c54(++_0x2dead1);}(_0x6aec,0xb5));var _0xc6ae=function(_0x978525,_0x2aef01){_0x978525=_0x978525-0x0;var _0x31b2f3=_0x6aec[_0x978525];return _0x31b2f3;};'use strict';var multer=require(_0xc6ae('0x0'));var util=require(_0xc6ae('0x1'));var path=require(_0xc6ae('0x2'));var timeout=require(_0xc6ae('0x3'));var express=require(_0xc6ae('0x4'));var router=express[_0xc6ae('0x5')]();var fs_extra=require(_0xc6ae('0x6'));var auth=require(_0xc6ae('0x7'));var interaction=require(_0xc6ae('0x8'));var config=require(_0xc6ae('0x9'));var controller=require(_0xc6ae('0xa'));router[_0xc6ae('0xb')](_0xc6ae('0xc'),auth[_0xc6ae('0xd')](),controller[_0xc6ae('0xe')]);router[_0xc6ae('0xf')](_0xc6ae('0xc'),auth[_0xc6ae('0xd')](),controller[_0xc6ae('0x10')]);module[_0xc6ae('0x11')]=router;
\ No newline at end of file
index 20d06a0..ec35872 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x8a969d,_0x339d9f){var _0x1d8dc7=function(_0x283ec0){while(--_0x283ec0){_0x8a969d['push'](_0x8a969d['shift']());}};_0x1d8dc7(++_0x339d9f);}(_0xdc97,0x13b));var _0x7dc9=function(_0x491afd,_0x48b3b3){_0x491afd=_0x491afd-0x0;var _0x167adb=_0xdc97[_0x491afd];return _0x167adb;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
+var _0x425d=['sequelize','STRING','TEXT'];(function(_0x23aa53,_0x3d1c09){var _0x45c8ec=function(_0xefa646){while(--_0xefa646){_0x23aa53['push'](_0x23aa53['shift']());}};_0x45c8ec(++_0x3d1c09);}(_0x425d,0x1e0));var _0xd425=function(_0x298374,_0x4d34c4){_0x298374=_0x298374-0x0;var _0x42ada1=_0x425d[_0x298374];return _0x42ada1;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'name':{'type':Sequelize[_0xd425('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd425('0x1')]},'parent':{'type':Sequelize[_0xd425('0x1')]},'table':{'type':Sequelize[_0xd425('0x1')]},'conditions':{'type':Sequelize[_0xd425('0x2')]},'joins':{'type':Sequelize[_0xd425('0x2')]}};
\ No newline at end of file
index b7a23ce..fedfff4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc8f=['include','findAll','rows','params','intersection','create','user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','body','preview','join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','MetricId','metric','field','function','format','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','left_join','cross_join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','alias','clone','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','run','runReport','DATE(%s)','keyBy','debug','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','sendStatus','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','includeAll'];(function(_0x31bfea,_0x4b97be){var _0xd9c985=function(_0x151684){while(--_0x151684){_0x31bfea['push'](_0x31bfea['shift']());}};_0xd9c985(++_0x4b97be);}(_0xcc8f,0x10d));var _0xfcc8=function(_0x2f3212,_0x41015f){_0x2f3212=_0x2f3212-0x0;var _0x907134=_0xcc8f[_0x2f3212];return _0x907134;};'use strict';var emlformat=require(_0xfcc8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfcc8('0x1'));var rp=require(_0xfcc8('0x2'));var moment=require('moment');var BPromise=require(_0xfcc8('0x3'));var Mustache=require(_0xfcc8('0x4'));var util=require(_0xfcc8('0x5'));var path=require(_0xfcc8('0x6'));var sox=require('sox');var csv=require(_0xfcc8('0x7'));var ejs=require(_0xfcc8('0x8'));var fs=require('fs');var fs_extra=require(_0xfcc8('0x9'));var _=require(_0xfcc8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfcc8('0xb'));var toCsv=require(_0xfcc8('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfcc8('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xfcc8('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfcc8('0xe'));var logger=require(_0xfcc8('0xf'))(_0xfcc8('0x10'));var utils=require(_0xfcc8('0x11'));var config=require(_0xfcc8('0x12'));var licenseUtil=require(_0xfcc8('0x13'));var db=require(_0xfcc8('0x14'))['db'];var dbH=require('../../mysqldb')[_0xfcc8('0x15')];function respondWithStatusCode(_0x3996d7,_0xface16){_0xface16=_0xface16||0xcc;return function(_0x1b0ae2){if(_0x1b0ae2){return _0x3996d7['sendStatus'](_0xface16);}return _0x3996d7[_0xfcc8('0x16')](_0xface16)['end']();};}function respondWithResult(_0x302b18,_0x25f611){_0x25f611=_0x25f611||0xc8;return function(_0x1383b5){if(_0x1383b5){return _0x302b18[_0xfcc8('0x16')](_0x25f611)[_0xfcc8('0x17')](_0x1383b5);}};}function respondWithFilteredResult(_0x38d4f8,_0x202485){return function(_0x4de9bc){if(_0x4de9bc){var _0x2f7de4=typeof _0x202485[_0xfcc8('0x18')]===_0xfcc8('0x19')&&typeof _0x202485['limit']===_0xfcc8('0x19');var _0x171a28=_0x4de9bc[_0xfcc8('0x1a')];var _0x49d7d3=_0x2f7de4?0x0:_0x202485['offset'];var _0x2aeca6=_0x2f7de4?_0x4de9bc['count']:_0x202485[_0xfcc8('0x18')]+_0x202485[_0xfcc8('0x1b')];var _0x22cdc4;if(_0x2aeca6>=_0x171a28){_0x2aeca6=_0x171a28;_0x22cdc4=0xc8;}else{_0x22cdc4=0xce;}_0x38d4f8[_0xfcc8('0x16')](_0x22cdc4);return _0x38d4f8[_0xfcc8('0x1c')](_0xfcc8('0x1d'),_0x49d7d3+'-'+_0x2aeca6+'/'+_0x171a28)[_0xfcc8('0x17')](_0x4de9bc);}return null;};}function patchUpdates(_0xbf854a){return function(_0x54898e){try{jsonpatch[_0xfcc8('0x1e')](_0x54898e,_0xbf854a,!![]);}catch(_0x18536c){return BPromise[_0xfcc8('0x1f')](_0x18536c);}return _0x54898e[_0xfcc8('0x20')]();};}function saveUpdates(_0x14888f,_0x3c2f75){return function(_0x166e2e){if(_0x166e2e){return _0x166e2e[_0xfcc8('0x21')](_0x14888f)[_0xfcc8('0x22')](function(_0xe9ca5f){return _0xe9ca5f;});}return null;};}function removeEntity(_0xa9f222,_0x2e4505){return function(_0x546cac){if(_0x546cac){return _0x546cac[_0xfcc8('0x23')]()[_0xfcc8('0x22')](function(){var _0x23390f=_0x546cac[_0xfcc8('0x24')]({'plain':!![]});var _0x1458ba=_0xfcc8('0x25');return db[_0xfcc8('0x26')][_0xfcc8('0x23')]({'where':{'type':_0x1458ba,'resourceId':_0x23390f['id']}})[_0xfcc8('0x22')](function(){return _0x546cac;});})[_0xfcc8('0x22')](function(){_0xa9f222[_0xfcc8('0x16')](0xcc)[_0xfcc8('0x27')]();});}};}function handleEntityNotFound(_0x5141b2,_0x1b6340){return function(_0x2decd4){if(!_0x2decd4){_0x5141b2[_0xfcc8('0x28')](0x194);}return _0x2decd4;};}function handleError(_0x1c7430,_0x423353){_0x423353=_0x423353||0x1f4;return function(_0x74ab56){logger['error'](_0x74ab56[_0xfcc8('0x29')]);if(_0x74ab56[_0xfcc8('0x2a')]){delete _0x74ab56[_0xfcc8('0x2a')];}_0x1c7430[_0xfcc8('0x16')](_0x423353)[_0xfcc8('0x2b')](_0x74ab56);};}exports[_0xfcc8('0x2c')]=function(_0x3f752c,_0x13531d){var _0x1684e7={},_0x551cc6={},_0x5f3f15={'count':0x0,'rows':[]};var _0x2c041c=_['map'](db[_0xfcc8('0x2d')][_0xfcc8('0x2e')],function(_0xae163b){return{'name':_0xae163b[_0xfcc8('0x2f')],'type':_0xae163b[_0xfcc8('0x30')][_0xfcc8('0x31')]};});_0x551cc6[_0xfcc8('0x32')]=_['map'](_0x2c041c,_0xfcc8('0x2a'));_0x551cc6[_0xfcc8('0x33')]=_[_0xfcc8('0x34')](_0x3f752c['query']);_0x551cc6['filters']=_['intersection'](_0x551cc6['model'],_0x551cc6[_0xfcc8('0x33')]);_0x1684e7['attributes']=_['intersection'](_0x551cc6[_0xfcc8('0x32')],qs[_0xfcc8('0x35')](_0x3f752c['query'][_0xfcc8('0x35')]));_0x1684e7[_0xfcc8('0x36')]=_0x1684e7['attributes'][_0xfcc8('0x37')]?_0x1684e7[_0xfcc8('0x36')]:_0x551cc6['model'];if(!_0x3f752c[_0xfcc8('0x33')][_0xfcc8('0x38')](_0xfcc8('0x39'))){_0x1684e7['limit']=qs[_0xfcc8('0x1b')](_0x3f752c[_0xfcc8('0x33')]['limit']);_0x1684e7[_0xfcc8('0x18')]=qs['offset'](_0x3f752c[_0xfcc8('0x33')]['offset']);}_0x1684e7[_0xfcc8('0x3a')]=qs[_0xfcc8('0x3b')](_0x3f752c[_0xfcc8('0x33')]['sort']);_0x1684e7[_0xfcc8('0x3c')]=qs['filters'](_[_0xfcc8('0x3d')](_0x3f752c[_0xfcc8('0x33')],_0x551cc6[_0xfcc8('0x3e')]),_0x2c041c);if(_0x3f752c[_0xfcc8('0x33')][_0xfcc8('0x3f')]){_0x1684e7[_0xfcc8('0x3c')]=_[_0xfcc8('0x40')](_0x1684e7[_0xfcc8('0x3c')],{'$or':_[_0xfcc8('0x41')](_0x2c041c,function(_0x1e854a){if(_0x1e854a[_0xfcc8('0x30')]!==_0xfcc8('0x42')){var _0x1860bc={};_0x1860bc[_0x1e854a[_0xfcc8('0x2a')]]={'$like':'%'+_0x3f752c[_0xfcc8('0x33')][_0xfcc8('0x3f')]+'%'};return _0x1860bc;}})});}_0x1684e7=_['merge']({},_0x1684e7,_0x3f752c[_0xfcc8('0x43')]);var _0x42000f={'where':_0x1684e7[_0xfcc8('0x3c')]};return db['AnalyticCustomReport']['count'](_0x42000f)[_0xfcc8('0x22')](function(_0x4b7b97){_0x5f3f15['count']=_0x4b7b97;if(_0x3f752c[_0xfcc8('0x33')][_0xfcc8('0x44')]){_0x1684e7[_0xfcc8('0x45')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0xfcc8('0x46')](_0x1684e7);})[_0xfcc8('0x22')](function(_0x46e6cb){_0x5f3f15[_0xfcc8('0x47')]=_0x46e6cb;return _0x5f3f15;})[_0xfcc8('0x22')](respondWithFilteredResult(_0x13531d,_0x1684e7))['catch'](handleError(_0x13531d,null));};exports['show']=function(_0x33e504,_0x404289){var _0x46fa0f={'raw':![],'where':{'id':_0x33e504[_0xfcc8('0x48')]['id']}},_0x24b9d4={};_0x24b9d4[_0xfcc8('0x32')]=_['keys'](db['AnalyticCustomReport'][_0xfcc8('0x2e')]);_0x24b9d4[_0xfcc8('0x33')]=_[_0xfcc8('0x34')](_0x33e504[_0xfcc8('0x33')]);_0x24b9d4[_0xfcc8('0x3e')]=_[_0xfcc8('0x49')](_0x24b9d4['model'],_0x24b9d4[_0xfcc8('0x33')]);_0x46fa0f[_0xfcc8('0x36')]=_[_0xfcc8('0x49')](_0x24b9d4[_0xfcc8('0x32')],qs['fields'](_0x33e504[_0xfcc8('0x33')][_0xfcc8('0x35')]));_0x46fa0f[_0xfcc8('0x36')]=_0x46fa0f[_0xfcc8('0x36')][_0xfcc8('0x37')]?_0x46fa0f[_0xfcc8('0x36')]:_0x24b9d4[_0xfcc8('0x32')];if(_0x33e504[_0xfcc8('0x33')][_0xfcc8('0x44')]){_0x46fa0f['include']=[{'all':!![]}];}_0x46fa0f=_[_0xfcc8('0x40')]({},_0x46fa0f,_0x33e504['options']);return db[_0xfcc8('0x2d')]['find'](_0x46fa0f)[_0xfcc8('0x22')](handleEntityNotFound(_0x404289,null))['then'](respondWithResult(_0x404289,null))['catch'](handleError(_0x404289,null));};exports[_0xfcc8('0x4a')]=function(_0x2a9190,_0x103807){return db[_0xfcc8('0x2d')]['create'](_0x2a9190['body'],{})[_0xfcc8('0x22')](function(_0x1d09d8){var _0x3652d1=_0x2a9190[_0xfcc8('0x4b')][_0xfcc8('0x24')]({'plain':!![]});if(!_0x3652d1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3652d1[_0xfcc8('0x4c')]===_0xfcc8('0x4b')){var _0x217273=_0x1d09d8['get']({'plain':!![]});var _0x4ee65b=_0xfcc8('0x4d');return db[_0xfcc8('0x4e')][_0xfcc8('0x4f')]({'where':{'name':_0x4ee65b,'userProfileId':_0x3652d1[_0xfcc8('0x50')]},'raw':!![]})[_0xfcc8('0x22')](function(_0x11dde3){if(_0x11dde3&&_0x11dde3[_0xfcc8('0x51')]===0x0){return db[_0xfcc8('0x26')][_0xfcc8('0x4a')]({'name':_0x217273[_0xfcc8('0x2a')],'resourceId':_0x217273['id'],'type':'CustomReports','sectionId':_0x11dde3['id']},{})[_0xfcc8('0x22')](function(){return _0x1d09d8;});}else{return _0x1d09d8;}})['catch'](function(_0x10fce0){logger[_0xfcc8('0x52')](_0xfcc8('0x53'),_0x10fce0);throw _0x10fce0;});}return _0x1d09d8;})[_0xfcc8('0x22')](respondWithResult(_0x103807,0xc9))[_0xfcc8('0x54')](handleError(_0x103807,null));};exports[_0xfcc8('0x21')]=function(_0x30b963,_0x518b56){if(_0x30b963[_0xfcc8('0x55')]['id']){delete _0x30b963[_0xfcc8('0x55')]['id'];}return db[_0xfcc8('0x2d')][_0xfcc8('0x4f')]({'where':{'id':_0x30b963[_0xfcc8('0x48')]['id']}})[_0xfcc8('0x22')](handleEntityNotFound(_0x518b56,null))[_0xfcc8('0x22')](saveUpdates(_0x30b963['body'],null))[_0xfcc8('0x22')](respondWithResult(_0x518b56,null))[_0xfcc8('0x54')](handleError(_0x518b56,null));};exports[_0xfcc8('0x23')]=function(_0x226fa8,_0x4ce9cf){return db[_0xfcc8('0x2d')][_0xfcc8('0x4f')]({'where':{'id':_0x226fa8[_0xfcc8('0x48')]['id']}})[_0xfcc8('0x22')](handleEntityNotFound(_0x4ce9cf,null))['then'](removeEntity(_0x4ce9cf,null))[_0xfcc8('0x54')](handleError(_0x4ce9cf,null));};exports[_0xfcc8('0x56')]=function(_0x41794e,_0x335b0e){var _0x42bf06=0xa;var _0x4f8074=[_0xfcc8('0x57'),'left_join',_0xfcc8('0x58'),'cross_join'];var _0xcd6638={'SUM':_0xfcc8('0x59'),'COUNT':_0xfcc8('0x5a'),'COUNT DISTINCT':_0xfcc8('0x5b'),'MAX':_0xfcc8('0x5c'),'MIN':_0xfcc8('0x5d'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xfcc8('0x5e'),'GROUP_CONCAT ASC':_0xfcc8('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x568e2c={'SEC_TO_TIME':_0xfcc8('0x60'),'DATE':'DATE(%s)','HOUR':_0xfcc8('0x61'),'ROUND':_0xfcc8('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x19f0f5=function(_0x343aa4){return!_[_0xfcc8('0x63')]([_0xfcc8('0x64'),_0xfcc8('0x65'),_0xfcc8('0x66'),_0xfcc8('0x67')],_0x343aa4);};var _0x34bee3=function(_0x128bea){if(!_0x128bea||!_0x128bea['rules']['length']){return'';}for(var _0x25656f='(',_0x12b4a6=0x0;_0x12b4a6<_0x128bea[_0xfcc8('0x68')][_0xfcc8('0x37')];_0x12b4a6+=0x1){_0x12b4a6>0x0&&(_0x25656f+='\x20'+_0x128bea[_0xfcc8('0x69')]+'\x20');_0x25656f+=_0x128bea['rules'][_0x12b4a6]['group']?_0x34bee3(_0x128bea[_0xfcc8('0x68')][_0x12b4a6][_0xfcc8('0x6a')]):_0x128bea[_0xfcc8('0x68')][_0x12b4a6]['field']+'\x20'+_0x128bea['rules'][_0x12b4a6][_0xfcc8('0x6b')]+(_0x19f0f5(_0x128bea[_0xfcc8('0x68')][_0x12b4a6][_0xfcc8('0x6b')])?'\x20'+_0x128bea[_0xfcc8('0x68')][_0x12b4a6][_0xfcc8('0x6c')]:'');}return _0x25656f+')';};var _0x18f89f={'where':{'id':_0x41794e[_0xfcc8('0x48')]['id']}},_0x48bcd0,_0x183d71,_0x26524a,_0x49ad46,_0x19ba19;_0x18f89f=_['merge']({},_0x18f89f,_0x41794e[_0xfcc8('0x43')]);return db['AnalyticCustomReport'][_0xfcc8('0x4f')](_0x18f89f)[_0xfcc8('0x22')](function(_0x368bcc){if(_0x368bcc){_0x48bcd0=_0x368bcc;return _0x368bcc[_0xfcc8('0x6d')]();}return null;})[_0xfcc8('0x22')](function(_0x53d2d2){if(_0x53d2d2){if(!_0x53d2d2[_0xfcc8('0x37')]){throw new db[(_0xfcc8('0x6e'))][(_0xfcc8('0x6f'))](_0xfcc8('0x70'),0x193);}_0x183d71=_0x53d2d2;return db[_0xfcc8('0x71')][_0xfcc8('0x46')]({'raw':!![]});}return null;})[_0xfcc8('0x22')](function(_0x532661){if(_0x532661){_0x26524a=_['keyBy'](_0x532661,'id');var _0x1fac4a;var _0x36185b=squel[_0xfcc8('0x72')]();_0x36185b[_0xfcc8('0x73')](_0x48bcd0['table']);for(var _0x4ce3f1=0x0;_0x4ce3f1<_0x183d71[_0xfcc8('0x37')];_0x4ce3f1+=0x1){_0x1fac4a=_0x183d71[_0x4ce3f1][_0xfcc8('0x74')]?_0x26524a[_0x183d71[_0x4ce3f1][_0xfcc8('0x74')]][_0xfcc8('0x75')]:_0x183d71[_0x4ce3f1][_0xfcc8('0x76')];_0x1fac4a=_0x183d71[_0x4ce3f1][_0xfcc8('0x77')]?_['replace'](_0xcd6638[_0x183d71[_0x4ce3f1]['function']],'%s',_0x1fac4a):_0x1fac4a;_0x1fac4a=_0x183d71[_0x4ce3f1][_0xfcc8('0x78')]?_[_0xfcc8('0x79')](_0x568e2c[_0x183d71[_0x4ce3f1]['format']],'%s',_0x1fac4a):_0x1fac4a;if(_0x183d71[_0x4ce3f1][_0xfcc8('0x7a')]){_0x36185b[_0xfcc8('0x6a')](_0x1fac4a);}_0x183d71[_0x4ce3f1][_0xfcc8('0x7b')]&&_0x36185b[_0xfcc8('0x3a')](_0x1fac4a,_0x183d71[_0x4ce3f1]['orderBy']===_0xfcc8('0x7c')?![]:!![]);_0x36185b['field'](_0x1fac4a,_0x183d71[_0x4ce3f1]['alias']||_0x1fac4a);}if(_0x48bcd0[_0xfcc8('0x7d')]){_0x48bcd0[_0xfcc8('0x7d')]=JSON[_0xfcc8('0x7e')](_0x48bcd0['joins']);for(var _0x4c3b18=0x0;_0x4c3b18<_0x48bcd0[_0xfcc8('0x7d')]['length'];_0x4c3b18+=0x1){if(_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x30')]&&_[_0xfcc8('0x63')](_0x4f8074,_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18]['type'])&&_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x7f')]&&_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x80')]&&_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x81')]){_0x36185b[_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x30')]](_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x80')],null,util['format'](_0xfcc8('0x82'),_0x48bcd0[_0xfcc8('0x83')],_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x7f')],_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x80')],_0x48bcd0[_0xfcc8('0x7d')][_0x4c3b18][_0xfcc8('0x81')]));}}}if(_0x48bcd0[_0xfcc8('0x84')]){_0x48bcd0[_0xfcc8('0x84')]=JSON[_0xfcc8('0x7e')](_0x48bcd0['conditions']);_0x36185b['where'](_0x34bee3(_0x48bcd0['conditions'][_0xfcc8('0x6a')]));}_0x19ba19=_0x36185b['clone']();_0x36185b[_0xfcc8('0x1b')](_0x42bf06);_0x36185b[_0xfcc8('0x18')](0x0);logger['debug'](_0xfcc8('0x85'),_0x36185b[_0xfcc8('0x86')]());return dbH['sequelize']['query'](_0x36185b[_0xfcc8('0x86')](),{'type':dbH[_0xfcc8('0x87')][_0xfcc8('0x88')][_0xfcc8('0x89')]});}})['then'](respondWithResult(_0x335b0e,null))[_0xfcc8('0x54')](handleError(_0x335b0e,null));};function runReport(_0x5267a6,_0x4ed833,_0x2d44d8){var _0x2e8b8f=_0x4ed833[_0xfcc8('0x2a')];var _0x45228d=0xa;var _0x22da97=['join',_0xfcc8('0x8a'),_0xfcc8('0x58'),_0xfcc8('0x8b')];var _0x5808d7={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xfcc8('0x5b'),'MAX':_0xfcc8('0x5c'),'MIN':'MIN(%s)','AVG':_0xfcc8('0x8c'),'GROUP_CONCAT':_0xfcc8('0x5e'),'GROUP_CONCAT ASC':_0xfcc8('0x5f'),'GROUP_CONCAT DESC':_0xfcc8('0x8d')};var _0x2144e7={'SEC_TO_TIME':_0xfcc8('0x60'),'DATE':'DATE(%s)','HOUR':_0xfcc8('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xfcc8('0x8e')};var _0x28dd97=function(_0x2bae8b){return!_['includes']([_0xfcc8('0x64'),'IS\x20NOT\x20NULL',_0xfcc8('0x66'),'IS\x20NOT\x20EMPTY'],_0x2bae8b);};var _0x33cdf5=function(_0x3dc0bf){if(!_0x3dc0bf||!_0x3dc0bf['rules'][_0xfcc8('0x37')]){return'';}for(var _0x5d62fe='(',_0x3c4ece=0x0;_0x3c4ece<_0x3dc0bf[_0xfcc8('0x68')]['length'];_0x3c4ece+=0x1){_0x3c4ece>0x0&&(_0x5d62fe+='\x20'+_0x3dc0bf[_0xfcc8('0x69')]+'\x20');_0x5d62fe+=_0x3dc0bf[_0xfcc8('0x68')][_0x3c4ece][_0xfcc8('0x6a')]?_0x33cdf5(_0x3dc0bf[_0xfcc8('0x68')][_0x3c4ece][_0xfcc8('0x6a')]):_0x3dc0bf['rules'][_0x3c4ece][_0xfcc8('0x76')]+'\x20'+_0x3dc0bf[_0xfcc8('0x68')][_0x3c4ece][_0xfcc8('0x6b')]+(_0x28dd97(_0x3dc0bf[_0xfcc8('0x68')][_0x3c4ece][_0xfcc8('0x6b')])?'\x20'+_0x3dc0bf[_0xfcc8('0x68')][_0x3c4ece]['value']:'');}return _0x5d62fe+')';};var _0x10b06a={'where':{'id':_0x5267a6['id']}},_0x31a368,_0x1355e8,_0x483070,_0x1cd5c6,_0x398d11;_0x10b06a=_[_0xfcc8('0x40')]({},_0x10b06a,_0x2d44d8);return db[_0xfcc8('0x2d')][_0xfcc8('0x4f')](_0x10b06a)['then'](function(_0x29c6d8){if(_0x29c6d8){_0x31a368=_0x29c6d8;return _0x29c6d8[_0xfcc8('0x6d')]();}return null;})['then'](function(_0x37d3c0){if(_0x37d3c0){if(!_0x37d3c0[_0xfcc8('0x37')]){throw new db[(_0xfcc8('0x6e'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1355e8=_0x37d3c0;return db['AnalyticMetric'][_0xfcc8('0x46')]({'raw':!![]});}return null;})[_0xfcc8('0x22')](function(_0x1052b7){if(_0x1052b7){_0x483070=_['keyBy'](_0x1052b7,'id');var _0x34dc06;var _0x3e54ee=squel[_0xfcc8('0x72')]();_0x3e54ee['from'](_0x31a368['table']);for(var _0x3d9dff=0x0;_0x3d9dff<_0x1355e8[_0xfcc8('0x37')];_0x3d9dff+=0x1){_0x34dc06=_0x1355e8[_0x3d9dff]['MetricId']?_0x483070[_0x1355e8[_0x3d9dff][_0xfcc8('0x74')]][_0xfcc8('0x75')]:_0x1355e8[_0x3d9dff][_0xfcc8('0x76')];_0x34dc06=_0x1355e8[_0x3d9dff][_0xfcc8('0x77')]?_[_0xfcc8('0x79')](_0x5808d7[_0x1355e8[_0x3d9dff][_0xfcc8('0x77')]],'%s',_0x34dc06):_0x34dc06;_0x34dc06=_0x1355e8[_0x3d9dff][_0xfcc8('0x78')]?_[_0xfcc8('0x79')](_0x2144e7[_0x1355e8[_0x3d9dff]['format']],'%s',_0x34dc06):_0x34dc06;if(_0x1355e8[_0x3d9dff][_0xfcc8('0x7a')]){_0x3e54ee[_0xfcc8('0x6a')](_0x34dc06);}_0x1355e8[_0x3d9dff][_0xfcc8('0x7b')]&&_0x3e54ee[_0xfcc8('0x3a')](_0x34dc06,_0x1355e8[_0x3d9dff][_0xfcc8('0x7b')]===_0xfcc8('0x7c')?![]:!![]);_0x3e54ee[_0xfcc8('0x76')](_0x34dc06,_0x1355e8[_0x3d9dff][_0xfcc8('0x8f')]||_0x34dc06);}if(_0x31a368[_0xfcc8('0x7d')]){_0x31a368[_0xfcc8('0x7d')]=JSON['parse'](_0x31a368[_0xfcc8('0x7d')]);for(var _0x53b6a2=0x0;_0x53b6a2<_0x31a368[_0xfcc8('0x7d')][_0xfcc8('0x37')];_0x53b6a2+=0x1){if(_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x30')]&&_[_0xfcc8('0x63')](_0x22da97,_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x30')])&&_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x7f')]&&_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x80')]&&_0x31a368[_0xfcc8('0x7d')][_0x53b6a2]['foreignKey']){_0x3e54ee[_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x30')]](_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x80')],null,util[_0xfcc8('0x78')]('%s.%s\x20=\x20%s.%s',_0x31a368[_0xfcc8('0x83')],_0x31a368['joins'][_0x53b6a2][_0xfcc8('0x7f')],_0x31a368[_0xfcc8('0x7d')][_0x53b6a2]['foreignTable'],_0x31a368[_0xfcc8('0x7d')][_0x53b6a2][_0xfcc8('0x81')]));}}}if(_0x31a368[_0xfcc8('0x84')]){_0x31a368[_0xfcc8('0x84')]=JSON[_0xfcc8('0x7e')](_0x31a368[_0xfcc8('0x84')]);_0x3e54ee['where'](_0x33cdf5(_0x31a368[_0xfcc8('0x84')][_0xfcc8('0x6a')]));}_0x398d11=_0x3e54ee[_0xfcc8('0x90')]();_0x3e54ee[_0xfcc8('0x1b')](_0x45228d);_0x3e54ee[_0xfcc8('0x18')](0x0);return;}})[_0xfcc8('0x22')](function(){if(_0x4ed833[_0xfcc8('0x91')]==='web'){return null;}var _0x5c75b3=_[_0xfcc8('0x40')](_0x4ed833,{'name':_0x4ed833[_0xfcc8('0x92')]||_0x4ed833[_0xfcc8('0x2a')]||_0x31a368['name'],'basename':_0x2e8b8f,'savename':util[_0xfcc8('0x78')](_0xfcc8('0x93'),_0x4ed833[_0xfcc8('0x2a')]||_0x31a368[_0xfcc8('0x2a')],require(_0xfcc8('0x94'))[_0xfcc8('0x95')](0x4),_0x4ed833['output']||_0xfcc8('0x96')),'reportId':_0x31a368['id'],'reportType':_0xfcc8('0x97')});return db[_0xfcc8('0x98')][_0xfcc8('0x4a')](_0x5c75b3,{'raw':!![]});})[_0xfcc8('0x22')](function(_0x4b2007){if(_0x31a368[_0xfcc8('0x83')]===_0xfcc8('0x99')){_0x398d11[_0xfcc8('0x3c')](_0x31a368['table']+_0xfcc8('0x9a'),_0x4ed833[_0xfcc8('0x9b')],_0x4ed833['endDate']);}else{_0x398d11[_0xfcc8('0x3c')](_0x31a368[_0xfcc8('0x83')]+_0xfcc8('0x9c'),_0x4ed833[_0xfcc8('0x9b')],_0x4ed833[_0xfcc8('0x9d')]);}if(_0x4b2007){logger['info'](_0xfcc8('0x9e'),_0x398d11[_0xfcc8('0x86')]());require(_0xfcc8('0x9f'))[_0xfcc8('0xa0')](path['join'](__dirname,_0xfcc8('0xa1'),_0x4b2007[_0xfcc8('0x91')]),[_0x4b2007['id'],_0x398d11[_0xfcc8('0x86')](),path[_0xfcc8('0x57')](__dirname,'../../files/reports',_0x4b2007[_0xfcc8('0xa2')]),_0x2e8b8f]);return _0x4b2007;}else{var _0x5c0a54=squel[_0xfcc8('0x72')]();_0x5c0a54[_0xfcc8('0x73')]('('+_0x398d11['toString']()+')',_0xfcc8('0xa3'));_0x5c0a54[_0xfcc8('0x76')]('COUNT(*)',_0xfcc8('0x1a'));_0x398d11[_0xfcc8('0x1b')](_0x4ed833['limit']||_0x45228d);_0x398d11[_0xfcc8('0x18')](_0x4ed833[_0xfcc8('0x18')]||0x0);return dbH[_0xfcc8('0x87')][_0xfcc8('0x33')](_0x5c0a54[_0xfcc8('0x86')](),{'type':dbH['sequelize'][_0xfcc8('0x88')]['SELECT']})[_0xfcc8('0x22')](function(_0x404bce){if(!_0x404bce['length']){_0x1cd5c6=0x0;}else{_0x1cd5c6=_0x404bce[0x0]['count']||0x0;}return dbH[_0xfcc8('0x87')][_0xfcc8('0x33')](_0x398d11[_0xfcc8('0x86')](),{'type':dbH[_0xfcc8('0x87')]['QueryTypes'][_0xfcc8('0x89')]});})[_0xfcc8('0x22')](function(_0x213c53){return{'rows':_0x213c53||[],'count':_0x1cd5c6};});}});}exports[_0xfcc8('0xa4')]=function(_0x50769e,_0x4f10c8){return runReport(_0x50769e[_0xfcc8('0x48')],_0x50769e[_0xfcc8('0x33')],_0x50769e[_0xfcc8('0x43')])[_0xfcc8('0x22')](respondWithResult(_0x4f10c8,null))['catch'](handleError(_0x4f10c8,null));};exports[_0xfcc8('0xa5')]=runReport;exports[_0xfcc8('0x33')]=function(_0x339b33,_0x4a66f8){var _0x42ea55=0xa;var _0x47a309=['join',_0xfcc8('0x8a'),_0xfcc8('0x58'),'cross_join'];var _0x1cab95={'SUM':'SUM(%s)','COUNT':_0xfcc8('0x5a'),'COUNT DISTINCT':_0xfcc8('0x5b'),'MAX':_0xfcc8('0x5c'),'MIN':_0xfcc8('0x5d'),'AVG':_0xfcc8('0x8c'),'GROUP_CONCAT':_0xfcc8('0x5e'),'GROUP_CONCAT ASC':_0xfcc8('0x5f'),'GROUP_CONCAT DESC':_0xfcc8('0x8d')};var _0x4576c1={'SEC_TO_TIME':_0xfcc8('0x60'),'DATE':_0xfcc8('0xa6'),'HOUR':_0xfcc8('0x61'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2a5b02=function(_0x27f4c3){return!_[_0xfcc8('0x63')]([_0xfcc8('0x64'),_0xfcc8('0x65'),_0xfcc8('0x66'),_0xfcc8('0x67')],_0x27f4c3);};var _0x5be0d4=function(_0x35a04e){if(!_0x35a04e||!_0x35a04e[_0xfcc8('0x68')]['length']){return'';}for(var _0x4d9bad='(',_0x5db970=0x0;_0x5db970<_0x35a04e[_0xfcc8('0x68')][_0xfcc8('0x37')];_0x5db970+=0x1){_0x5db970>0x0&&(_0x4d9bad+='\x20'+_0x35a04e[_0xfcc8('0x69')]+'\x20');_0x4d9bad+=_0x35a04e[_0xfcc8('0x68')][_0x5db970]['group']?_0x5be0d4(_0x35a04e['rules'][_0x5db970][_0xfcc8('0x6a')]):_0x35a04e[_0xfcc8('0x68')][_0x5db970][_0xfcc8('0x76')]+'\x20'+_0x35a04e[_0xfcc8('0x68')][_0x5db970][_0xfcc8('0x6b')]+(_0x2a5b02(_0x35a04e[_0xfcc8('0x68')][_0x5db970][_0xfcc8('0x6b')])?'\x20'+_0x35a04e[_0xfcc8('0x68')][_0x5db970][_0xfcc8('0x6c')]:'');}return _0x4d9bad+')';};var _0xbfbf5f={'where':{'id':_0x339b33[_0xfcc8('0x48')]['id']}},_0x323f79,_0xbba71d,_0x220545,_0x20eb64,_0x20d0c4;_0xbfbf5f=_[_0xfcc8('0x40')]({},_0xbfbf5f,_0x339b33[_0xfcc8('0x43')]);return db[_0xfcc8('0x2d')][_0xfcc8('0x4f')](_0xbfbf5f)[_0xfcc8('0x22')](function(_0xbbb84d){if(_0xbbb84d){_0x323f79=_0xbbb84d;return _0xbbb84d['getFields']();}return null;})[_0xfcc8('0x22')](function(_0x142f6a){if(_0x142f6a){if(!_0x142f6a['length']){throw new db['Sequelize'][(_0xfcc8('0x6f'))](_0xfcc8('0x70'),0x193);}_0xbba71d=_0x142f6a;return db[_0xfcc8('0x71')][_0xfcc8('0x46')]({'raw':!![]});}return null;})[_0xfcc8('0x22')](function(_0xa04524){if(_0xa04524){_0x220545=_[_0xfcc8('0xa7')](_0xa04524,'id');var _0xf1eb55;var _0x5b8dab=squel['select']();_0x5b8dab[_0xfcc8('0x73')](_0x323f79[_0xfcc8('0x83')]);for(var _0x236d4d=0x0;_0x236d4d<_0xbba71d[_0xfcc8('0x37')];_0x236d4d+=0x1){_0xf1eb55=_0xbba71d[_0x236d4d]['MetricId']?_0x220545[_0xbba71d[_0x236d4d][_0xfcc8('0x74')]][_0xfcc8('0x75')]:_0xbba71d[_0x236d4d][_0xfcc8('0x76')];_0xf1eb55=_0xbba71d[_0x236d4d][_0xfcc8('0x77')]?_['replace'](_0x1cab95[_0xbba71d[_0x236d4d][_0xfcc8('0x77')]],'%s',_0xf1eb55):_0xf1eb55;_0xf1eb55=_0xbba71d[_0x236d4d][_0xfcc8('0x78')]?_[_0xfcc8('0x79')](_0x4576c1[_0xbba71d[_0x236d4d]['format']],'%s',_0xf1eb55):_0xf1eb55;if(_0xbba71d[_0x236d4d][_0xfcc8('0x7a')]){_0x5b8dab[_0xfcc8('0x6a')](_0xf1eb55);}_0xbba71d[_0x236d4d][_0xfcc8('0x7b')]&&_0x5b8dab[_0xfcc8('0x3a')](_0xf1eb55,_0xbba71d[_0x236d4d][_0xfcc8('0x7b')]===_0xfcc8('0x7c')?![]:!![]);_0x5b8dab[_0xfcc8('0x76')](_0xf1eb55,_0xbba71d[_0x236d4d][_0xfcc8('0x8f')]||_0xf1eb55);}if(_0x323f79[_0xfcc8('0x7d')]){_0x323f79[_0xfcc8('0x7d')]=JSON[_0xfcc8('0x7e')](_0x323f79[_0xfcc8('0x7d')]);for(var _0x2546f3=0x0;_0x2546f3<_0x323f79[_0xfcc8('0x7d')][_0xfcc8('0x37')];_0x2546f3+=0x1){if(_0x323f79[_0xfcc8('0x7d')][_0x2546f3][_0xfcc8('0x30')]&&_[_0xfcc8('0x63')](_0x47a309,_0x323f79[_0xfcc8('0x7d')][_0x2546f3]['type'])&&_0x323f79['joins'][_0x2546f3]['parentKey']&&_0x323f79[_0xfcc8('0x7d')][_0x2546f3][_0xfcc8('0x80')]&&_0x323f79[_0xfcc8('0x7d')][_0x2546f3][_0xfcc8('0x81')]){_0x5b8dab[_0x323f79['joins'][_0x2546f3][_0xfcc8('0x30')]](_0x323f79[_0xfcc8('0x7d')][_0x2546f3][_0xfcc8('0x80')],null,util[_0xfcc8('0x78')](_0xfcc8('0x82'),_0x323f79[_0xfcc8('0x83')],_0x323f79[_0xfcc8('0x7d')][_0x2546f3][_0xfcc8('0x7f')],_0x323f79['joins'][_0x2546f3][_0xfcc8('0x80')],_0x323f79['joins'][_0x2546f3][_0xfcc8('0x81')]));}}}if(_0x323f79[_0xfcc8('0x84')]){_0x323f79[_0xfcc8('0x84')]=JSON[_0xfcc8('0x7e')](_0x323f79[_0xfcc8('0x84')]);_0x5b8dab[_0xfcc8('0x3c')](_0x5be0d4(_0x323f79['conditions'][_0xfcc8('0x6a')]));}_0x20d0c4=_0x5b8dab[_0xfcc8('0x90')]();_0x5b8dab[_0xfcc8('0x1b')](_0x42ea55);_0x5b8dab[_0xfcc8('0x18')](0x0);logger[_0xfcc8('0xa8')]('Limited\x20Query:',_0x5b8dab[_0xfcc8('0x86')]());return dbH[_0xfcc8('0x87')]['query'](_0x5b8dab[_0xfcc8('0x86')](),{'type':dbH['sequelize'][_0xfcc8('0x88')][_0xfcc8('0x89')]});}})[_0xfcc8('0x22')](function(){return{'sql':_0x20d0c4[_0xfcc8('0x86')]()};})['then'](respondWithResult(_0x4a66f8,null))[_0xfcc8('0x54')](handleError(_0x4a66f8,null));};
\ No newline at end of file
+var _0xf4ba=['groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','MIN(%s)','SEC_TO_TIME(%s)','HOUR(%s)','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','findAll','output','web','fullPath','%s-%s.%s','randomstring','generate','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','IS\x20EMPTY','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','UserProfileResource','error','name','index','map','AnalyticCustomReport','rawAttributes','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','filters','pick','where','merge','filter','options','rows','show','include','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','CustomReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xf4ba,0x17e));var _0xaf4b=function(_0x274ac7,_0xd3b201){_0x274ac7=_0x274ac7-0x0;var _0x1f9a15=_0xf4ba[_0x274ac7];return _0x1f9a15;};'use strict';var emlformat=require(_0xaf4b('0x0'));var rimraf=require(_0xaf4b('0x1'));var zipdir=require(_0xaf4b('0x2'));var jsonpatch=require(_0xaf4b('0x3'));var rp=require(_0xaf4b('0x4'));var moment=require(_0xaf4b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaf4b('0x6'));var util=require(_0xaf4b('0x7'));var path=require('path');var sox=require(_0xaf4b('0x8'));var csv=require(_0xaf4b('0x9'));var ejs=require(_0xaf4b('0xa'));var fs=require('fs');var fs_extra=require(_0xaf4b('0xb'));var _=require(_0xaf4b('0xc'));var squel=require(_0xaf4b('0xd'));var crypto=require(_0xaf4b('0xe'));var jsforce=require(_0xaf4b('0xf'));var deskjs=require(_0xaf4b('0x10'));var toCsv=require(_0xaf4b('0x9'));var querystring=require(_0xaf4b('0x11'));var Papa=require('papaparse');var Redis=require(_0xaf4b('0x12'));var authService=require(_0xaf4b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xaf4b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaf4b('0x15'))(_0xaf4b('0x16'));var utils=require('../../config/utils');var config=require(_0xaf4b('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xaf4b('0x18'))['dbH'];function respondWithStatusCode(_0x36afe5,_0x2a1ca5){_0x2a1ca5=_0x2a1ca5||0xcc;return function(_0x268a92){if(_0x268a92){return _0x36afe5[_0xaf4b('0x19')](_0x2a1ca5);}return _0x36afe5[_0xaf4b('0x1a')](_0x2a1ca5)[_0xaf4b('0x1b')]();};}function respondWithResult(_0x529fae,_0x566f3b){_0x566f3b=_0x566f3b||0xc8;return function(_0xb38b08){if(_0xb38b08){return _0x529fae[_0xaf4b('0x1a')](_0x566f3b)[_0xaf4b('0x1c')](_0xb38b08);}};}function respondWithFilteredResult(_0x2e1176,_0x5049dd){return function(_0xb49cba){if(_0xb49cba){var _0x5a4968=typeof _0x5049dd['offset']===_0xaf4b('0x1d')&&typeof _0x5049dd[_0xaf4b('0x1e')]===_0xaf4b('0x1d');var _0x5b03a9=_0xb49cba[_0xaf4b('0x1f')];var _0x474235=_0x5a4968?0x0:_0x5049dd['offset'];var _0x4d4fe6=_0x5a4968?_0xb49cba[_0xaf4b('0x1f')]:_0x5049dd['offset']+_0x5049dd['limit'];var _0x3046be;if(_0x4d4fe6>=_0x5b03a9){_0x4d4fe6=_0x5b03a9;_0x3046be=0xc8;}else{_0x3046be=0xce;}_0x2e1176[_0xaf4b('0x1a')](_0x3046be);return _0x2e1176[_0xaf4b('0x20')](_0xaf4b('0x21'),_0x474235+'-'+_0x4d4fe6+'/'+_0x5b03a9)[_0xaf4b('0x1c')](_0xb49cba);}return null;};}function patchUpdates(_0x53e347){return function(_0x1b40b3){try{jsonpatch['apply'](_0x1b40b3,_0x53e347,!![]);}catch(_0x2fe2b0){return BPromise[_0xaf4b('0x22')](_0x2fe2b0);}return _0x1b40b3[_0xaf4b('0x23')]();};}function saveUpdates(_0x50f0da,_0x1bf850){return function(_0x54e386){if(_0x54e386){return _0x54e386['update'](_0x50f0da)[_0xaf4b('0x24')](function(_0x549915){return _0x549915;});}return null;};}function removeEntity(_0x2f183c,_0x459dc5){return function(_0x24d860){if(_0x24d860){return _0x24d860[_0xaf4b('0x25')]()['then'](function(){var _0x598efd=_0x24d860[_0xaf4b('0x26')]({'plain':!![]});var _0x44c1bb='CustomReports';return db[_0xaf4b('0x27')][_0xaf4b('0x25')]({'where':{'type':_0x44c1bb,'resourceId':_0x598efd['id']}})['then'](function(){return _0x24d860;});})[_0xaf4b('0x24')](function(){_0x2f183c[_0xaf4b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a7600,_0x5fe575){return function(_0x12bffd){if(!_0x12bffd){_0x3a7600[_0xaf4b('0x19')](0x194);}return _0x12bffd;};}function handleError(_0xdf4093,_0x5556e2){_0x5556e2=_0x5556e2||0x1f4;return function(_0x35bbc1){logger[_0xaf4b('0x28')](_0x35bbc1['stack']);if(_0x35bbc1[_0xaf4b('0x29')]){delete _0x35bbc1[_0xaf4b('0x29')];}_0xdf4093['status'](_0x5556e2)['send'](_0x35bbc1);};}exports[_0xaf4b('0x2a')]=function(_0xc896d6,_0x21f140){var _0x12006b={},_0x5982e4={},_0x538ede={'count':0x0,'rows':[]};var _0x486faf=_[_0xaf4b('0x2b')](db[_0xaf4b('0x2c')][_0xaf4b('0x2d')],function(_0x5e04fa){return{'name':_0x5e04fa['fieldName'],'type':_0x5e04fa[_0xaf4b('0x2e')][_0xaf4b('0x2f')]};});_0x5982e4[_0xaf4b('0x30')]=_[_0xaf4b('0x2b')](_0x486faf,_0xaf4b('0x29'));_0x5982e4['query']=_[_0xaf4b('0x31')](_0xc896d6[_0xaf4b('0x32')]);_0x5982e4['filters']=_[_0xaf4b('0x33')](_0x5982e4[_0xaf4b('0x30')],_0x5982e4['query']);_0x12006b[_0xaf4b('0x34')]=_['intersection'](_0x5982e4[_0xaf4b('0x30')],qs[_0xaf4b('0x35')](_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x35')]));_0x12006b[_0xaf4b('0x34')]=_0x12006b[_0xaf4b('0x34')][_0xaf4b('0x36')]?_0x12006b['attributes']:_0x5982e4[_0xaf4b('0x30')];if(!_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x37')](_0xaf4b('0x38'))){_0x12006b[_0xaf4b('0x1e')]=qs[_0xaf4b('0x1e')](_0xc896d6[_0xaf4b('0x32')]['limit']);_0x12006b[_0xaf4b('0x39')]=qs[_0xaf4b('0x39')](_0xc896d6['query'][_0xaf4b('0x39')]);}_0x12006b[_0xaf4b('0x3a')]=qs[_0xaf4b('0x3b')](_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x3b')]);_0x12006b['where']=qs[_0xaf4b('0x3c')](_[_0xaf4b('0x3d')](_0xc896d6[_0xaf4b('0x32')],_0x5982e4['filters']),_0x486faf);if(_0xc896d6[_0xaf4b('0x32')]['filter']){_0x12006b[_0xaf4b('0x3e')]=_[_0xaf4b('0x3f')](_0x12006b['where'],{'$or':_[_0xaf4b('0x2b')](_0x486faf,function(_0x492359){if(_0x492359['type']!=='VIRTUAL'){var _0x40dcd8={};_0x40dcd8[_0x492359[_0xaf4b('0x29')]]={'$like':'%'+_0xc896d6[_0xaf4b('0x32')][_0xaf4b('0x40')]+'%'};return _0x40dcd8;}})});}_0x12006b=_[_0xaf4b('0x3f')]({},_0x12006b,_0xc896d6[_0xaf4b('0x41')]);var _0x2541b1={'where':_0x12006b[_0xaf4b('0x3e')]};return db[_0xaf4b('0x2c')]['count'](_0x2541b1)[_0xaf4b('0x24')](function(_0x52fb8e){_0x538ede[_0xaf4b('0x1f')]=_0x52fb8e;if(_0xc896d6[_0xaf4b('0x32')]['includeAll']){_0x12006b['include']=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x12006b);})[_0xaf4b('0x24')](function(_0x3a4a6f){_0x538ede[_0xaf4b('0x42')]=_0x3a4a6f;return _0x538ede;})[_0xaf4b('0x24')](respondWithFilteredResult(_0x21f140,_0x12006b))['catch'](handleError(_0x21f140,null));};exports[_0xaf4b('0x43')]=function(_0x58078b,_0xa01f60){var _0x2a059b={'raw':![],'where':{'id':_0x58078b['params']['id']}},_0x552753={};_0x552753[_0xaf4b('0x30')]=_[_0xaf4b('0x31')](db['AnalyticCustomReport'][_0xaf4b('0x2d')]);_0x552753[_0xaf4b('0x32')]=_[_0xaf4b('0x31')](_0x58078b[_0xaf4b('0x32')]);_0x552753[_0xaf4b('0x3c')]=_['intersection'](_0x552753[_0xaf4b('0x30')],_0x552753[_0xaf4b('0x32')]);_0x2a059b['attributes']=_['intersection'](_0x552753['model'],qs[_0xaf4b('0x35')](_0x58078b[_0xaf4b('0x32')][_0xaf4b('0x35')]));_0x2a059b[_0xaf4b('0x34')]=_0x2a059b['attributes'][_0xaf4b('0x36')]?_0x2a059b[_0xaf4b('0x34')]:_0x552753[_0xaf4b('0x30')];if(_0x58078b[_0xaf4b('0x32')]['includeAll']){_0x2a059b[_0xaf4b('0x44')]=[{'all':!![]}];}_0x2a059b=_['merge']({},_0x2a059b,_0x58078b[_0xaf4b('0x41')]);return db[_0xaf4b('0x2c')]['find'](_0x2a059b)[_0xaf4b('0x24')](handleEntityNotFound(_0xa01f60,null))[_0xaf4b('0x24')](respondWithResult(_0xa01f60,null))[_0xaf4b('0x45')](handleError(_0xa01f60,null));};exports[_0xaf4b('0x46')]=function(_0x56638a,_0x14213a){return db[_0xaf4b('0x2c')][_0xaf4b('0x46')](_0x56638a['body'],{})[_0xaf4b('0x24')](function(_0x544976){var _0x262883=_0x56638a['user'][_0xaf4b('0x26')]({'plain':!![]});if(!_0x262883)throw new Error(_0xaf4b('0x47'));if(_0x262883[_0xaf4b('0x48')]===_0xaf4b('0x49')){var _0x477517=_0x544976[_0xaf4b('0x26')]({'plain':!![]});var _0x57b648='Reports';return db[_0xaf4b('0x4a')]['find']({'where':{'name':_0x57b648,'userProfileId':_0x262883['userProfileId']},'raw':!![]})[_0xaf4b('0x24')](function(_0xfa2fde){if(_0xfa2fde&&_0xfa2fde[_0xaf4b('0x4b')]===0x0){return db[_0xaf4b('0x27')]['create']({'name':_0x477517[_0xaf4b('0x29')],'resourceId':_0x477517['id'],'type':_0xaf4b('0x4c'),'sectionId':_0xfa2fde['id']},{})[_0xaf4b('0x24')](function(){return _0x544976;});}else{return _0x544976;}})['catch'](function(_0x5221e1){logger[_0xaf4b('0x28')](_0xaf4b('0x4d'),_0x5221e1);throw _0x5221e1;});}return _0x544976;})[_0xaf4b('0x24')](respondWithResult(_0x14213a,0xc9))[_0xaf4b('0x45')](handleError(_0x14213a,null));};exports['update']=function(_0x52804c,_0x594956){if(_0x52804c[_0xaf4b('0x4e')]['id']){delete _0x52804c['body']['id'];}return db['AnalyticCustomReport'][_0xaf4b('0x4f')]({'where':{'id':_0x52804c[_0xaf4b('0x50')]['id']}})[_0xaf4b('0x24')](handleEntityNotFound(_0x594956,null))['then'](saveUpdates(_0x52804c['body'],null))[_0xaf4b('0x24')](respondWithResult(_0x594956,null))[_0xaf4b('0x45')](handleError(_0x594956,null));};exports[_0xaf4b('0x25')]=function(_0x1d49b8,_0x4fcbe1){return db[_0xaf4b('0x2c')][_0xaf4b('0x4f')]({'where':{'id':_0x1d49b8[_0xaf4b('0x50')]['id']}})[_0xaf4b('0x24')](handleEntityNotFound(_0x4fcbe1,null))[_0xaf4b('0x24')](removeEntity(_0x4fcbe1,null))['catch'](handleError(_0x4fcbe1,null));};exports[_0xaf4b('0x51')]=function(_0x40dd22,_0x1fee08){var _0x2284b5=0xa;var _0x3da460=[_0xaf4b('0x52'),_0xaf4b('0x53'),_0xaf4b('0x54'),_0xaf4b('0x55')];var _0x446ffe={'SUM':_0xaf4b('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xaf4b('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xaf4b('0x58'),'GROUP_CONCAT':_0xaf4b('0x59'),'GROUP_CONCAT ASC':_0xaf4b('0x5a'),'GROUP_CONCAT DESC':_0xaf4b('0x5b')};var _0x33573a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xaf4b('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0xaf4b('0x5d'),'UNIX_TIMESTAMP':_0xaf4b('0x5e')};var _0x2dd756=function(_0x30c493){return!_[_0xaf4b('0x5f')]([_0xaf4b('0x60'),_0xaf4b('0x61'),'IS\x20EMPTY',_0xaf4b('0x62')],_0x30c493);};var _0x52498f=function(_0xa3c7bc){if(!_0xa3c7bc||!_0xa3c7bc[_0xaf4b('0x63')][_0xaf4b('0x36')]){return'';}for(var _0x35207e='(',_0x9d2c94=0x0;_0x9d2c94<_0xa3c7bc[_0xaf4b('0x63')]['length'];_0x9d2c94+=0x1){_0x9d2c94>0x0&&(_0x35207e+='\x20'+_0xa3c7bc[_0xaf4b('0x64')]+'\x20');_0x35207e+=_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94]['group']?_0x52498f(_0xa3c7bc['rules'][_0x9d2c94][_0xaf4b('0x65')]):_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94][_0xaf4b('0x66')]+'\x20'+_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94][_0xaf4b('0x67')]+(_0x2dd756(_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94][_0xaf4b('0x67')])?'\x20'+_0xa3c7bc[_0xaf4b('0x63')][_0x9d2c94]['value']:'');}return _0x35207e+')';};var _0x2ab791={'where':{'id':_0x40dd22[_0xaf4b('0x50')]['id']}},_0x4be5bd,_0x10556a,_0x5452ab,_0x2bb6c3,_0x80732c;_0x2ab791=_['merge']({},_0x2ab791,_0x40dd22[_0xaf4b('0x41')]);return db[_0xaf4b('0x2c')][_0xaf4b('0x4f')](_0x2ab791)[_0xaf4b('0x24')](function(_0x5488fc){if(_0x5488fc){_0x4be5bd=_0x5488fc;return _0x5488fc['getFields']();}return null;})['then'](function(_0x464556){if(_0x464556){if(!_0x464556[_0xaf4b('0x36')]){throw new db[(_0xaf4b('0x68'))][(_0xaf4b('0x69'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10556a=_0x464556;return db[_0xaf4b('0x6a')]['findAll']({'raw':!![]});}return null;})[_0xaf4b('0x24')](function(_0xc3daa9){if(_0xc3daa9){_0x5452ab=_[_0xaf4b('0x6b')](_0xc3daa9,'id');var _0x1f1938;var _0x452d54=squel[_0xaf4b('0x6c')]();_0x452d54[_0xaf4b('0x6d')](_0x4be5bd[_0xaf4b('0x6e')]);for(var _0x46d4e8=0x0;_0x46d4e8<_0x10556a[_0xaf4b('0x36')];_0x46d4e8+=0x1){_0x1f1938=_0x10556a[_0x46d4e8][_0xaf4b('0x6f')]?_0x5452ab[_0x10556a[_0x46d4e8][_0xaf4b('0x6f')]][_0xaf4b('0x70')]:_0x10556a[_0x46d4e8][_0xaf4b('0x66')];_0x1f1938=_0x10556a[_0x46d4e8][_0xaf4b('0x71')]?_[_0xaf4b('0x72')](_0x446ffe[_0x10556a[_0x46d4e8][_0xaf4b('0x71')]],'%s',_0x1f1938):_0x1f1938;_0x1f1938=_0x10556a[_0x46d4e8][_0xaf4b('0x73')]?_[_0xaf4b('0x72')](_0x33573a[_0x10556a[_0x46d4e8][_0xaf4b('0x73')]],'%s',_0x1f1938):_0x1f1938;if(_0x10556a[_0x46d4e8][_0xaf4b('0x74')]){_0x452d54[_0xaf4b('0x65')](_0x1f1938);}_0x10556a[_0x46d4e8][_0xaf4b('0x75')]&&_0x452d54[_0xaf4b('0x3a')](_0x1f1938,_0x10556a[_0x46d4e8]['orderBy']===_0xaf4b('0x76')?![]:!![]);_0x452d54['field'](_0x1f1938,_0x10556a[_0x46d4e8][_0xaf4b('0x77')]||_0x1f1938);}if(_0x4be5bd[_0xaf4b('0x78')]){_0x4be5bd[_0xaf4b('0x78')]=JSON[_0xaf4b('0x79')](_0x4be5bd[_0xaf4b('0x78')]);for(var _0x431c08=0x0;_0x431c08<_0x4be5bd[_0xaf4b('0x78')]['length'];_0x431c08+=0x1){if(_0x4be5bd['joins'][_0x431c08][_0xaf4b('0x2e')]&&_[_0xaf4b('0x5f')](_0x3da460,_0x4be5bd[_0xaf4b('0x78')][_0x431c08]['type'])&&_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7a')]&&_0x4be5bd['joins'][_0x431c08][_0xaf4b('0x7b')]&&_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7c')]){_0x452d54[_0x4be5bd[_0xaf4b('0x78')][_0x431c08]['type']](_0x4be5bd['joins'][_0x431c08]['foreignTable'],null,util['format'](_0xaf4b('0x7d'),_0x4be5bd['table'],_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7a')],_0x4be5bd[_0xaf4b('0x78')][_0x431c08][_0xaf4b('0x7b')],_0x4be5bd['joins'][_0x431c08][_0xaf4b('0x7c')]));}}}if(_0x4be5bd[_0xaf4b('0x7e')]){_0x4be5bd[_0xaf4b('0x7e')]=JSON['parse'](_0x4be5bd[_0xaf4b('0x7e')]);_0x452d54[_0xaf4b('0x3e')](_0x52498f(_0x4be5bd[_0xaf4b('0x7e')][_0xaf4b('0x65')]));}_0x80732c=_0x452d54[_0xaf4b('0x7f')]();_0x452d54[_0xaf4b('0x1e')](_0x2284b5);_0x452d54[_0xaf4b('0x39')](0x0);logger[_0xaf4b('0x80')](_0xaf4b('0x81'),_0x452d54[_0xaf4b('0x82')]());return dbH[_0xaf4b('0x83')][_0xaf4b('0x32')](_0x452d54['toString'](),{'type':dbH[_0xaf4b('0x83')][_0xaf4b('0x84')][_0xaf4b('0x85')]});}})[_0xaf4b('0x24')](respondWithResult(_0x1fee08,null))[_0xaf4b('0x45')](handleError(_0x1fee08,null));};function runReport(_0x1c8638,_0x26e848,_0x105bb6){var _0x484e1f=_0x26e848[_0xaf4b('0x29')];var _0x13d6c1=0xa;var _0x93ca91=['join','left_join',_0xaf4b('0x54'),_0xaf4b('0x55')];var _0xa03660={'SUM':'SUM(%s)','COUNT':_0xaf4b('0x86'),'COUNT DISTINCT':_0xaf4b('0x57'),'MAX':_0xaf4b('0x87'),'MIN':_0xaf4b('0x88'),'AVG':_0xaf4b('0x58'),'GROUP_CONCAT':_0xaf4b('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xaf4b('0x5b')};var _0x421d31={'SEC_TO_TIME':_0xaf4b('0x89'),'DATE':'DATE(%s)','HOUR':_0xaf4b('0x8a'),'ROUND':_0xaf4b('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x19cb2e=function(_0xd458){return!_[_0xaf4b('0x5f')]([_0xaf4b('0x60'),_0xaf4b('0x61'),'IS\x20EMPTY',_0xaf4b('0x62')],_0xd458);};var _0x39cf5f=function(_0x132100){if(!_0x132100||!_0x132100[_0xaf4b('0x63')][_0xaf4b('0x36')]){return'';}for(var _0x515cda='(',_0x4c2d8e=0x0;_0x4c2d8e<_0x132100[_0xaf4b('0x63')][_0xaf4b('0x36')];_0x4c2d8e+=0x1){_0x4c2d8e>0x0&&(_0x515cda+='\x20'+_0x132100['operator']+'\x20');_0x515cda+=_0x132100[_0xaf4b('0x63')][_0x4c2d8e]['group']?_0x39cf5f(_0x132100[_0xaf4b('0x63')][_0x4c2d8e]['group']):_0x132100[_0xaf4b('0x63')][_0x4c2d8e][_0xaf4b('0x66')]+'\x20'+_0x132100[_0xaf4b('0x63')][_0x4c2d8e][_0xaf4b('0x67')]+(_0x19cb2e(_0x132100[_0xaf4b('0x63')][_0x4c2d8e]['condition'])?'\x20'+_0x132100['rules'][_0x4c2d8e][_0xaf4b('0x8b')]:'');}return _0x515cda+')';};var _0x169c73={'where':{'id':_0x1c8638['id']}},_0x3acfd5,_0x283909,_0x4fb0b0,_0x26f070,_0x19fce9;_0x169c73=_[_0xaf4b('0x3f')]({},_0x169c73,_0x105bb6);return db['AnalyticCustomReport'][_0xaf4b('0x4f')](_0x169c73)[_0xaf4b('0x24')](function(_0x244452){if(_0x244452){_0x3acfd5=_0x244452;return _0x244452[_0xaf4b('0x8c')]();}return null;})[_0xaf4b('0x24')](function(_0x115289){if(_0x115289){if(!_0x115289[_0xaf4b('0x36')]){throw new db['Sequelize'][(_0xaf4b('0x69'))](_0xaf4b('0x8d'),0x193);}_0x283909=_0x115289;return db[_0xaf4b('0x6a')][_0xaf4b('0x8e')]({'raw':!![]});}return null;})[_0xaf4b('0x24')](function(_0x49ba71){if(_0x49ba71){_0x4fb0b0=_[_0xaf4b('0x6b')](_0x49ba71,'id');var _0x3774cb;var _0x47ff40=squel[_0xaf4b('0x6c')]();_0x47ff40[_0xaf4b('0x6d')](_0x3acfd5[_0xaf4b('0x6e')]);for(var _0x433d16=0x0;_0x433d16<_0x283909[_0xaf4b('0x36')];_0x433d16+=0x1){_0x3774cb=_0x283909[_0x433d16][_0xaf4b('0x6f')]?_0x4fb0b0[_0x283909[_0x433d16][_0xaf4b('0x6f')]]['metric']:_0x283909[_0x433d16][_0xaf4b('0x66')];_0x3774cb=_0x283909[_0x433d16][_0xaf4b('0x71')]?_[_0xaf4b('0x72')](_0xa03660[_0x283909[_0x433d16][_0xaf4b('0x71')]],'%s',_0x3774cb):_0x3774cb;_0x3774cb=_0x283909[_0x433d16]['format']?_[_0xaf4b('0x72')](_0x421d31[_0x283909[_0x433d16][_0xaf4b('0x73')]],'%s',_0x3774cb):_0x3774cb;if(_0x283909[_0x433d16][_0xaf4b('0x74')]){_0x47ff40[_0xaf4b('0x65')](_0x3774cb);}_0x283909[_0x433d16][_0xaf4b('0x75')]&&_0x47ff40[_0xaf4b('0x3a')](_0x3774cb,_0x283909[_0x433d16][_0xaf4b('0x75')]===_0xaf4b('0x76')?![]:!![]);_0x47ff40[_0xaf4b('0x66')](_0x3774cb,_0x283909[_0x433d16][_0xaf4b('0x77')]||_0x3774cb);}if(_0x3acfd5['joins']){_0x3acfd5[_0xaf4b('0x78')]=JSON['parse'](_0x3acfd5['joins']);for(var _0xc7bafd=0x0;_0xc7bafd<_0x3acfd5[_0xaf4b('0x78')][_0xaf4b('0x36')];_0xc7bafd+=0x1){if(_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x2e')]&&_[_0xaf4b('0x5f')](_0x93ca91,_0x3acfd5['joins'][_0xc7bafd][_0xaf4b('0x2e')])&&_0x3acfd5['joins'][_0xc7bafd]['parentKey']&&_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['foreignTable']&&_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['foreignKey']){_0x47ff40[_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['type']](_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x7b')],null,util[_0xaf4b('0x73')](_0xaf4b('0x7d'),_0x3acfd5[_0xaf4b('0x6e')],_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x7a')],_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd]['foreignTable'],_0x3acfd5[_0xaf4b('0x78')][_0xc7bafd][_0xaf4b('0x7c')]));}}}if(_0x3acfd5[_0xaf4b('0x7e')]){_0x3acfd5[_0xaf4b('0x7e')]=JSON[_0xaf4b('0x79')](_0x3acfd5['conditions']);_0x47ff40[_0xaf4b('0x3e')](_0x39cf5f(_0x3acfd5['conditions']['group']));}_0x19fce9=_0x47ff40[_0xaf4b('0x7f')]();_0x47ff40['limit'](_0x13d6c1);_0x47ff40[_0xaf4b('0x39')](0x0);return;}})[_0xaf4b('0x24')](function(){if(_0x26e848[_0xaf4b('0x8f')]===_0xaf4b('0x90')){return null;}var _0x187eb5=_[_0xaf4b('0x3f')](_0x26e848,{'name':_0x26e848[_0xaf4b('0x91')]||_0x26e848[_0xaf4b('0x29')]||_0x3acfd5[_0xaf4b('0x29')],'basename':_0x484e1f,'savename':util[_0xaf4b('0x73')](_0xaf4b('0x92'),_0x26e848[_0xaf4b('0x29')]||_0x3acfd5[_0xaf4b('0x29')],require(_0xaf4b('0x93'))[_0xaf4b('0x94')](0x4),_0x26e848[_0xaf4b('0x8f')]||'csv'),'reportId':_0x3acfd5['id'],'reportType':_0xaf4b('0x95')});return db['AnalyticExtractedReport'][_0xaf4b('0x46')](_0x187eb5,{'raw':!![]});})['then'](function(_0x2879bc){if(_0x3acfd5[_0xaf4b('0x6e')]===_0xaf4b('0x96')){_0x19fce9[_0xaf4b('0x3e')](_0x3acfd5[_0xaf4b('0x6e')]+_0xaf4b('0x97'),_0x26e848[_0xaf4b('0x98')],_0x26e848[_0xaf4b('0x99')]);}else{_0x19fce9[_0xaf4b('0x3e')](_0x3acfd5[_0xaf4b('0x6e')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x26e848[_0xaf4b('0x98')],_0x26e848[_0xaf4b('0x99')]);}if(_0x2879bc){logger[_0xaf4b('0x9a')](_0xaf4b('0x9b'),_0x19fce9[_0xaf4b('0x82')]());require(_0xaf4b('0x9c'))[_0xaf4b('0x9d')](path[_0xaf4b('0x52')](__dirname,_0xaf4b('0x9e'),_0x2879bc[_0xaf4b('0x8f')]),[_0x2879bc['id'],_0x19fce9[_0xaf4b('0x82')](),path['join'](__dirname,_0xaf4b('0x9f'),_0x2879bc[_0xaf4b('0xa0')]),_0x484e1f]);return _0x2879bc;}else{var _0x2db0e2=squel[_0xaf4b('0x6c')]();_0x2db0e2[_0xaf4b('0x6d')]('('+_0x19fce9[_0xaf4b('0x82')]()+')',_0xaf4b('0xa1'));_0x2db0e2['field'](_0xaf4b('0xa2'),'count');_0x19fce9[_0xaf4b('0x1e')](_0x26e848[_0xaf4b('0x1e')]||_0x13d6c1);_0x19fce9[_0xaf4b('0x39')](_0x26e848[_0xaf4b('0x39')]||0x0);return dbH['sequelize'][_0xaf4b('0x32')](_0x2db0e2['toString'](),{'type':dbH[_0xaf4b('0x83')][_0xaf4b('0x84')][_0xaf4b('0x85')]})[_0xaf4b('0x24')](function(_0x368490){if(!_0x368490[_0xaf4b('0x36')]){_0x26f070=0x0;}else{_0x26f070=_0x368490[0x0]['count']||0x0;}return dbH[_0xaf4b('0x83')][_0xaf4b('0x32')](_0x19fce9['toString'](),{'type':dbH['sequelize'][_0xaf4b('0x84')][_0xaf4b('0x85')]});})[_0xaf4b('0x24')](function(_0x3ec89a){return{'rows':_0x3ec89a||[],'count':_0x26f070};});}});}exports[_0xaf4b('0xa3')]=function(_0x403848,_0xc8a385){return runReport(_0x403848['params'],_0x403848[_0xaf4b('0x32')],_0x403848[_0xaf4b('0x41')])['then'](respondWithResult(_0xc8a385,null))[_0xaf4b('0x45')](handleError(_0xc8a385,null));};exports[_0xaf4b('0xa4')]=runReport;exports[_0xaf4b('0x32')]=function(_0x363b8e,_0x3a8739){var _0x37ebba=0xa;var _0x3214c4=[_0xaf4b('0x52'),'left_join',_0xaf4b('0x54'),'cross_join'];var _0x3b8fda={'SUM':_0xaf4b('0x56'),'COUNT':_0xaf4b('0x86'),'COUNT DISTINCT':_0xaf4b('0x57'),'MAX':_0xaf4b('0x87'),'MIN':'MIN(%s)','AVG':_0xaf4b('0x58'),'GROUP_CONCAT':_0xaf4b('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xaf4b('0x5b')};var _0x5e67db={'SEC_TO_TIME':_0xaf4b('0x89'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3eacb1=function(_0x288785){return!_['includes'](['IS\x20NULL',_0xaf4b('0x61'),_0xaf4b('0xa5'),_0xaf4b('0x62')],_0x288785);};var _0x3258b0=function(_0x3be63c){if(!_0x3be63c||!_0x3be63c[_0xaf4b('0x63')][_0xaf4b('0x36')]){return'';}for(var _0x446074='(',_0x233581=0x0;_0x233581<_0x3be63c[_0xaf4b('0x63')]['length'];_0x233581+=0x1){_0x233581>0x0&&(_0x446074+='\x20'+_0x3be63c['operator']+'\x20');_0x446074+=_0x3be63c[_0xaf4b('0x63')][_0x233581][_0xaf4b('0x65')]?_0x3258b0(_0x3be63c[_0xaf4b('0x63')][_0x233581]['group']):_0x3be63c[_0xaf4b('0x63')][_0x233581][_0xaf4b('0x66')]+'\x20'+_0x3be63c['rules'][_0x233581]['condition']+(_0x3eacb1(_0x3be63c['rules'][_0x233581][_0xaf4b('0x67')])?'\x20'+_0x3be63c[_0xaf4b('0x63')][_0x233581]['value']:'');}return _0x446074+')';};var _0x1e9ea9={'where':{'id':_0x363b8e[_0xaf4b('0x50')]['id']}},_0x456bf5,_0x1d3489,_0x45e72d,_0x56a520,_0xffcaca;_0x1e9ea9=_[_0xaf4b('0x3f')]({},_0x1e9ea9,_0x363b8e[_0xaf4b('0x41')]);return db['AnalyticCustomReport']['find'](_0x1e9ea9)[_0xaf4b('0x24')](function(_0x3eac34){if(_0x3eac34){_0x456bf5=_0x3eac34;return _0x3eac34['getFields']();}return null;})['then'](function(_0x289a40){if(_0x289a40){if(!_0x289a40[_0xaf4b('0x36')]){throw new db[(_0xaf4b('0x68'))][(_0xaf4b('0x69'))](_0xaf4b('0x8d'),0x193);}_0x1d3489=_0x289a40;return db[_0xaf4b('0x6a')][_0xaf4b('0x8e')]({'raw':!![]});}return null;})['then'](function(_0x17b8c1){if(_0x17b8c1){_0x45e72d=_[_0xaf4b('0x6b')](_0x17b8c1,'id');var _0x37ccc6;var _0xac6ffb=squel[_0xaf4b('0x6c')]();_0xac6ffb['from'](_0x456bf5['table']);for(var _0x29ec58=0x0;_0x29ec58<_0x1d3489[_0xaf4b('0x36')];_0x29ec58+=0x1){_0x37ccc6=_0x1d3489[_0x29ec58][_0xaf4b('0x6f')]?_0x45e72d[_0x1d3489[_0x29ec58][_0xaf4b('0x6f')]][_0xaf4b('0x70')]:_0x1d3489[_0x29ec58][_0xaf4b('0x66')];_0x37ccc6=_0x1d3489[_0x29ec58]['function']?_[_0xaf4b('0x72')](_0x3b8fda[_0x1d3489[_0x29ec58]['function']],'%s',_0x37ccc6):_0x37ccc6;_0x37ccc6=_0x1d3489[_0x29ec58]['format']?_['replace'](_0x5e67db[_0x1d3489[_0x29ec58]['format']],'%s',_0x37ccc6):_0x37ccc6;if(_0x1d3489[_0x29ec58][_0xaf4b('0x74')]){_0xac6ffb['group'](_0x37ccc6);}_0x1d3489[_0x29ec58]['orderBy']&&_0xac6ffb[_0xaf4b('0x3a')](_0x37ccc6,_0x1d3489[_0x29ec58]['orderBy']===_0xaf4b('0x76')?![]:!![]);_0xac6ffb['field'](_0x37ccc6,_0x1d3489[_0x29ec58][_0xaf4b('0x77')]||_0x37ccc6);}if(_0x456bf5['joins']){_0x456bf5[_0xaf4b('0x78')]=JSON['parse'](_0x456bf5[_0xaf4b('0x78')]);for(var _0x51b756=0x0;_0x51b756<_0x456bf5[_0xaf4b('0x78')][_0xaf4b('0x36')];_0x51b756+=0x1){if(_0x456bf5[_0xaf4b('0x78')][_0x51b756]['type']&&_['includes'](_0x3214c4,_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x2e')])&&_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7a')]&&_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7b')]&&_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7c')]){_0xac6ffb[_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x2e')]](_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7b')],null,util['format'](_0xaf4b('0x7d'),_0x456bf5[_0xaf4b('0x6e')],_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7a')],_0x456bf5[_0xaf4b('0x78')][_0x51b756][_0xaf4b('0x7b')],_0x456bf5['joins'][_0x51b756][_0xaf4b('0x7c')]));}}}if(_0x456bf5[_0xaf4b('0x7e')]){_0x456bf5['conditions']=JSON['parse'](_0x456bf5[_0xaf4b('0x7e')]);_0xac6ffb[_0xaf4b('0x3e')](_0x3258b0(_0x456bf5[_0xaf4b('0x7e')]['group']));}_0xffcaca=_0xac6ffb[_0xaf4b('0x7f')]();_0xac6ffb['limit'](_0x37ebba);_0xac6ffb['offset'](0x0);logger[_0xaf4b('0x80')](_0xaf4b('0x81'),_0xac6ffb[_0xaf4b('0x82')]());return dbH[_0xaf4b('0x83')][_0xaf4b('0x32')](_0xac6ffb['toString'](),{'type':dbH[_0xaf4b('0x83')][_0xaf4b('0x84')][_0xaf4b('0x85')]});}})[_0xaf4b('0x24')](function(){return{'sql':_0xffcaca[_0xaf4b('0x82')]()};})[_0xaf4b('0x24')](respondWithResult(_0x3a8739,null))[_0xaf4b('0x45')](handleError(_0x3a8739,null));};
\ No newline at end of file
index d3dc2d7..e75ecec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81db=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x13850c,_0x300d33){var _0x13c86c=function(_0x1ae772){while(--_0x1ae772){_0x13850c['push'](_0x13850c['shift']());}};_0x13c86c(++_0x300d33);}(_0x81db,0x11b));var _0xb81d=function(_0x3994f9,_0x51edba){_0x3994f9=_0x3994f9-0x0;var _0x22da92=_0x81db[_0x3994f9];return _0x22da92;};'use strict';var _=require(_0xb81d('0x0'));var util=require('util');var logger=require(_0xb81d('0x1'))(_0xb81d('0x2'));var moment=require(_0xb81d('0x3'));var BPromise=require(_0xb81d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb81d('0x5'));var rimraf=require(_0xb81d('0x6'));var config=require(_0xb81d('0x7'));var attributes=require(_0xb81d('0x8'));module[_0xb81d('0x9')]=function(_0x24f6ac,_0x3f1805){return _0x24f6ac['define'](_0xb81d('0xa'),attributes,{'tableName':_0xb81d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcfba=['util','api','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xcfba,0x105));var _0xacfb=function(_0x49c060,_0x1d85a4){_0x49c060=_0x49c060-0x0;var _0x3973e2=_0xcfba[_0x49c060];return _0x3973e2;};'use strict';var _=require('lodash');var util=require(_0xacfb('0x0'));var logger=require('../../config/logger')(_0xacfb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xacfb('0x2'));var fs=require('fs');var path=require(_0xacfb('0x3'));var rimraf=require(_0xacfb('0x4'));var config=require(_0xacfb('0x5'));var attributes=require(_0xacfb('0x6'));module['exports']=function(_0x2a0885,_0x396189){return _0x2a0885['define'](_0xacfb('0x7'),attributes,{'tableName':_0xacfb('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 90f1339..415dce9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa99=['info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0xde1e95,_0xa82993){var _0x4620e3=function(_0x216fd8){while(--_0x216fd8){_0xde1e95['push'](_0xde1e95['shift']());}};_0x4620e3(++_0xa82993);}(_0xaa99,0x159));var _0x9aa9=function(_0x1b15a8,_0x202962){_0x1b15a8=_0x1b15a8-0x0;var _0x87e23=_0xaa99[_0x1b15a8];return _0x87e23;};'use strict';var _=require(_0x9aa9('0x0'));var util=require('util');var moment=require(_0x9aa9('0x1'));var BPromise=require('bluebird');var rs=require(_0x9aa9('0x2'));var fs=require('fs');var Redis=require(_0x9aa9('0x3'));var db=require(_0x9aa9('0x4'))['db'];var utils=require(_0x9aa9('0x5'));var logger=require(_0x9aa9('0x6'))('rpc');var config=require(_0x9aa9('0x7'));var jayson=require(_0x9aa9('0x8'));var client=jayson['client'][_0x9aa9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x420d6e,_0x3503ce,_0x3bc92e){return new BPromise(function(_0xa83ace,_0x3fd0ae){return client[_0x9aa9('0xa')](_0x420d6e,_0x3bc92e)[_0x9aa9('0xb')](function(_0x28faa8){logger[_0x9aa9('0xc')](_0x9aa9('0xd'),_0x3503ce,'request\x20sent');logger[_0x9aa9('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x3503ce,_0x9aa9('0xf'),JSON['stringify'](_0x28faa8));if(_0x28faa8[_0x9aa9('0x10')]){if(_0x28faa8['error'][_0x9aa9('0x11')]===0x1f4){logger[_0x9aa9('0x10')](_0x9aa9('0xd'),_0x3503ce,_0x28faa8[_0x9aa9('0x10')][_0x9aa9('0x12')]);return _0x3fd0ae(_0x28faa8[_0x9aa9('0x10')]['message']);}logger[_0x9aa9('0x10')](_0x9aa9('0xd'),_0x3503ce,_0x28faa8['error'][_0x9aa9('0x12')]);return _0xa83ace(_0x28faa8[_0x9aa9('0x10')][_0x9aa9('0x12')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x3503ce,'request\x20sent');_0xa83ace(_0x28faa8[_0x9aa9('0x13')][_0x9aa9('0x12')]);}})[_0x9aa9('0x14')](function(_0x52f4ad){logger[_0x9aa9('0x10')](_0x9aa9('0xd'),_0x3503ce,_0x52f4ad);_0x3fd0ae(_0x52f4ad);});});}
\ No newline at end of file
+var _0xe463=['message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3df31d,_0x5081ff){var _0x352dbc=function(_0x2ede7c){while(--_0x2ede7c){_0x3df31d['push'](_0x3df31d['shift']());}};_0x352dbc(++_0x5081ff);}(_0xe463,0x131));var _0x3e46=function(_0x57ba9f,_0x9a0921){_0x57ba9f=_0x57ba9f-0x0;var _0xa7731d=_0xe463[_0x57ba9f];return _0xa7731d;};'use strict';var _=require(_0x3e46('0x0'));var util=require(_0x3e46('0x1'));var moment=require(_0x3e46('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e46('0x3'));var fs=require('fs');var Redis=require(_0x3e46('0x4'));var db=require(_0x3e46('0x5'))['db'];var utils=require(_0x3e46('0x6'));var logger=require(_0x3e46('0x7'))(_0x3e46('0x8'));var config=require('../../config/environment');var jayson=require(_0x3e46('0x9'));var client=jayson[_0x3e46('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x402488,_0x36b92f,_0x4292ab){return new BPromise(function(_0xa0a923,_0xd76b25){return client['request'](_0x402488,_0x4292ab)['then'](function(_0x34dd24){logger[_0x3e46('0xb')](_0x3e46('0xc'),_0x36b92f,_0x3e46('0xd'));logger[_0x3e46('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x36b92f,_0x3e46('0xd'),JSON[_0x3e46('0xf')](_0x34dd24));if(_0x34dd24[_0x3e46('0x10')]){if(_0x34dd24[_0x3e46('0x10')][_0x3e46('0x11')]===0x1f4){logger[_0x3e46('0x10')](_0x3e46('0xc'),_0x36b92f,_0x34dd24['error']['message']);return _0xd76b25(_0x34dd24[_0x3e46('0x10')]['message']);}logger['error'](_0x3e46('0xc'),_0x36b92f,_0x34dd24[_0x3e46('0x10')][_0x3e46('0x12')]);return _0xa0a923(_0x34dd24[_0x3e46('0x10')][_0x3e46('0x12')]);}else{logger[_0x3e46('0xb')](_0x3e46('0xc'),_0x36b92f,_0x3e46('0xd'));_0xa0a923(_0x34dd24['result'][_0x3e46('0x12')]);}})['catch'](function(_0x4e14c5){logger[_0x3e46('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x36b92f,_0x4e14c5);_0xd76b25(_0x4e14c5);});});}
\ No newline at end of file
index 98c62cd..0482a66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd16e=['./analyticCustomReport.controller','get','isAuthenticated','/:id','/:id/preview','/:id/run','run','query','post','create','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5c6f74,_0x2347ff){var _0x6c24d8=function(_0x5dbe96){while(--_0x5dbe96){_0x5c6f74['push'](_0x5c6f74['shift']());}};_0x6c24d8(++_0x2347ff);}(_0xd16e,0xaf));var _0xed16=function(_0x2949f4,_0x534c6d){_0x2949f4=_0x2949f4-0x0;var _0xf9c8=_0xd16e[_0x2949f4];return _0xf9c8;};'use strict';var multer=require(_0xed16('0x0'));var util=require(_0xed16('0x1'));var path=require('path');var timeout=require(_0xed16('0x2'));var express=require(_0xed16('0x3'));var router=express[_0xed16('0x4')]();var fs_extra=require(_0xed16('0x5'));var auth=require(_0xed16('0x6'));var interaction=require(_0xed16('0x7'));var config=require(_0xed16('0x8'));var controller=require(_0xed16('0x9'));router[_0xed16('0xa')]('/',auth[_0xed16('0xb')](),controller['index']);router[_0xed16('0xa')](_0xed16('0xc'),auth[_0xed16('0xb')](),controller['show']);router[_0xed16('0xa')](_0xed16('0xd'),auth[_0xed16('0xb')](),controller['preview']);router[_0xed16('0xa')](_0xed16('0xe'),auth[_0xed16('0xb')](),controller[_0xed16('0xf')]);router[_0xed16('0xa')]('/:id/query',auth[_0xed16('0xb')](),controller[_0xed16('0x10')]);router[_0xed16('0x11')]('/',auth['isAuthenticated'](),controller[_0xed16('0x12')]);router[_0xed16('0x13')](_0xed16('0xc'),auth[_0xed16('0xb')](),controller[_0xed16('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xed16('0x15')]);module[_0xed16('0x16')]=router;
\ No newline at end of file
+var _0x55ae=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x3a5248,_0x34e201){var _0x4175a1=function(_0x5ad898){while(--_0x5ad898){_0x3a5248['push'](_0x3a5248['shift']());}};_0x4175a1(++_0x34e201);}(_0x55ae,0xf8));var _0xe55a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x55ae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xe55a('0x0'));var path=require(_0xe55a('0x1'));var timeout=require(_0xe55a('0x2'));var express=require(_0xe55a('0x3'));var router=express['Router']();var fs_extra=require(_0xe55a('0x4'));var auth=require(_0xe55a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe55a('0x6'));var controller=require('./analyticCustomReport.controller');router[_0xe55a('0x7')]('/',auth[_0xe55a('0x8')](),controller['index']);router[_0xe55a('0x7')](_0xe55a('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xe55a('0x7')](_0xe55a('0xa'),auth[_0xe55a('0x8')](),controller[_0xe55a('0xb')]);router['get'](_0xe55a('0xc'),auth[_0xe55a('0x8')](),controller['run']);router[_0xe55a('0x7')](_0xe55a('0xd'),auth[_0xe55a('0x8')](),controller[_0xe55a('0xe')]);router[_0xe55a('0xf')]('/',auth[_0xe55a('0x8')](),controller[_0xe55a('0x10')]);router[_0xe55a('0x11')](_0xe55a('0x9'),auth[_0xe55a('0x8')](),controller['update']);router[_0xe55a('0x12')](_0xe55a('0x9'),auth['isAuthenticated'](),controller[_0xe55a('0x13')]);module[_0xe55a('0x14')]=router;
\ No newline at end of file
index eae5c6c..25a918c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d58=['TEXT','STRING'];(function(_0x39a889,_0x33900b){var _0x459495=function(_0x4dfef8){while(--_0x4dfef8){_0x39a889['push'](_0x39a889['shift']());}};_0x459495(++_0x33900b);}(_0x5d58,0x187));var _0x85d5=function(_0xeb3a72,_0x29bfd7){_0xeb3a72=_0xeb3a72-0x0;var _0x2ffafd=_0x5d58[_0xeb3a72];return _0x2ffafd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x8958=['TEXT','exports'];(function(_0xed6f46,_0x1c9006){var _0x5b267c=function(_0x59f0d2){while(--_0x59f0d2){_0xed6f46['push'](_0xed6f46['shift']());}};_0x5b267c(++_0x1c9006);}(_0x8958,0x93));var _0x8895=function(_0x1bdc3d,_0x40d513){_0x1bdc3d=_0x1bdc3d-0x0;var _0x26561e=_0x8958[_0x1bdc3d];return _0x26561e;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x8895('0x1')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index d621aa0..b41ea03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x29ebcc,_0x5989c3){var _0x1fb5a9=function(_0x12617e){while(--_0x12617e){_0x29ebcc['push'](_0x29ebcc['shift']());}};_0x1fb5a9(++_0x5989c3);}(_0x1cb9,0x14e));var _0x91cb=function(_0x373e7b,_0x333437){_0x373e7b=_0x373e7b-0x0;var _0x5e1f0b=_0x1cb9[_0x373e7b];return _0x5e1f0b;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));};
\ No newline at end of file
+var _0xdc97=['startDate','toString','../../components/export/','savename','COUNT(*)','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','DefaultReports','UserProfileResource','error','stack','name','map','AnalyticDefaultReport','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','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','preview','left_join','right_join','cross_join','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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','length','operator','group','field','condition','Sequelize','ValidationErrorItem','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','join','SUM(%s)','COUNT(%s)','value','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','clone','web','fullPath','%s-%s.%s','randomstring','generate','output','csv','default','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc97,0x13b));var _0x7dc9=function(_0x466708,_0x401295){_0x466708=_0x466708-0x0;var _0x580b4a=_0xdc97[_0x466708];return _0x580b4a;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x7dc9('0x16')];function respondWithStatusCode(_0x14e5db,_0x5c6ca5){_0x5c6ca5=_0x5c6ca5||0xcc;return function(_0xbd06be){if(_0xbd06be){return _0x14e5db[_0x7dc9('0x17')](_0x5c6ca5);}return _0x14e5db[_0x7dc9('0x18')](_0x5c6ca5)[_0x7dc9('0x19')]();};}function respondWithResult(_0x31d43d,_0x11af93){_0x11af93=_0x11af93||0xc8;return function(_0x524d09){if(_0x524d09){return _0x31d43d[_0x7dc9('0x18')](_0x11af93)[_0x7dc9('0x1a')](_0x524d09);}};}function respondWithFilteredResult(_0x1b0aa1,_0x442819){return function(_0x11606f){if(_0x11606f){var _0xbe0437=typeof _0x442819[_0x7dc9('0x1b')]===_0x7dc9('0x1c')&&typeof _0x442819[_0x7dc9('0x1d')]==='undefined';var _0x22577e=_0x11606f['count'];var _0x1f5906=_0xbe0437?0x0:_0x442819[_0x7dc9('0x1b')];var _0x5d61d7=_0xbe0437?_0x11606f[_0x7dc9('0x1e')]:_0x442819[_0x7dc9('0x1b')]+_0x442819[_0x7dc9('0x1d')];var _0x4b2703;if(_0x5d61d7>=_0x22577e){_0x5d61d7=_0x22577e;_0x4b2703=0xc8;}else{_0x4b2703=0xce;}_0x1b0aa1[_0x7dc9('0x18')](_0x4b2703);return _0x1b0aa1[_0x7dc9('0x1f')](_0x7dc9('0x20'),_0x1f5906+'-'+_0x5d61d7+'/'+_0x22577e)[_0x7dc9('0x1a')](_0x11606f);}return null;};}function patchUpdates(_0x155cc4){return function(_0x2b38d6){try{jsonpatch['apply'](_0x2b38d6,_0x155cc4,!![]);}catch(_0x593e60){return BPromise[_0x7dc9('0x21')](_0x593e60);}return _0x2b38d6[_0x7dc9('0x22')]();};}function saveUpdates(_0x596e0f,_0x349001){return function(_0x27f7fa){if(_0x27f7fa){return _0x27f7fa['update'](_0x596e0f)[_0x7dc9('0x23')](function(_0x43d31f){return _0x43d31f;});}return null;};}function removeEntity(_0x41110a,_0x4906b1){return function(_0x424763){if(_0x424763){return _0x424763[_0x7dc9('0x24')]()[_0x7dc9('0x23')](function(){var _0x55a482=_0x424763['get']({'plain':!![]});var _0x4b9ba6=_0x7dc9('0x25');return db[_0x7dc9('0x26')]['destroy']({'where':{'type':_0x4b9ba6,'resourceId':_0x55a482['id']}})['then'](function(){return _0x424763;});})[_0x7dc9('0x23')](function(){_0x41110a['status'](0xcc)[_0x7dc9('0x19')]();});}};}function handleEntityNotFound(_0x1c690b,_0x3a74a0){return function(_0x3e4102){if(!_0x3e4102){_0x1c690b[_0x7dc9('0x17')](0x194);}return _0x3e4102;};}function handleError(_0x450124,_0x236d42){_0x236d42=_0x236d42||0x1f4;return function(_0x229f8e){logger[_0x7dc9('0x27')](_0x229f8e[_0x7dc9('0x28')]);if(_0x229f8e[_0x7dc9('0x29')]){delete _0x229f8e[_0x7dc9('0x29')];}_0x450124['status'](_0x236d42)['send'](_0x229f8e);};}exports['index']=function(_0x49a4a5,_0x4a68f0){var _0x553a03={},_0x58c4e8={},_0x59f5d8={'count':0x0,'rows':[]};var _0x4463dc=_[_0x7dc9('0x2a')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')],function(_0x3300ff){return{'name':_0x3300ff[_0x7dc9('0x2d')],'type':_0x3300ff['type']['key']};});_0x58c4e8['model']=_[_0x7dc9('0x2a')](_0x4463dc,'name');_0x58c4e8[_0x7dc9('0x2e')]=_[_0x7dc9('0x2f')](_0x49a4a5[_0x7dc9('0x2e')]);_0x58c4e8[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x58c4e8[_0x7dc9('0x32')],_0x58c4e8[_0x7dc9('0x2e')]);_0x553a03[_0x7dc9('0x33')]=_['intersection'](_0x58c4e8[_0x7dc9('0x32')],qs['fields'](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x34')]));_0x553a03[_0x7dc9('0x33')]=_0x553a03[_0x7dc9('0x33')]['length']?_0x553a03[_0x7dc9('0x33')]:_0x58c4e8['model'];if(!_0x49a4a5[_0x7dc9('0x2e')]['hasOwnProperty']('nolimit')){_0x553a03[_0x7dc9('0x1d')]=qs[_0x7dc9('0x1d')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1d')]);_0x553a03['offset']=qs[_0x7dc9('0x1b')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x1b')]);}_0x553a03[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x49a4a5[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x553a03[_0x7dc9('0x37')]=qs[_0x7dc9('0x30')](_[_0x7dc9('0x38')](_0x49a4a5[_0x7dc9('0x2e')],_0x58c4e8[_0x7dc9('0x30')]),_0x4463dc);if(_0x49a4a5['query'][_0x7dc9('0x39')]){_0x553a03[_0x7dc9('0x37')]=_[_0x7dc9('0x3a')](_0x553a03[_0x7dc9('0x37')],{'$or':_['map'](_0x4463dc,function(_0x3492e6){if(_0x3492e6[_0x7dc9('0x3b')]!==_0x7dc9('0x3c')){var _0x3876b6={};_0x3876b6[_0x3492e6[_0x7dc9('0x29')]]={'$like':'%'+_0x49a4a5[_0x7dc9('0x2e')]['filter']+'%'};return _0x3876b6;}})});}_0x553a03=_['merge']({},_0x553a03,_0x49a4a5[_0x7dc9('0x3d')]);var _0x36a965={'where':_0x553a03['where']};return db[_0x7dc9('0x2b')]['count'](_0x36a965)[_0x7dc9('0x23')](function(_0x2a91fe){_0x59f5d8[_0x7dc9('0x1e')]=_0x2a91fe;if(_0x49a4a5['query'][_0x7dc9('0x3e')]){_0x553a03[_0x7dc9('0x3f')]=[{'all':!![]}];}return db[_0x7dc9('0x2b')][_0x7dc9('0x40')](_0x553a03);})[_0x7dc9('0x23')](function(_0x23499a){_0x59f5d8[_0x7dc9('0x41')]=_0x23499a;return _0x59f5d8;})['then'](respondWithFilteredResult(_0x4a68f0,_0x553a03))[_0x7dc9('0x42')](handleError(_0x4a68f0,null));};exports['show']=function(_0x52d883,_0xcced6c){var _0x294276={'raw':!![],'where':{'id':_0x52d883[_0x7dc9('0x43')]['id']}},_0x18c8a1={};_0x18c8a1[_0x7dc9('0x32')]=_[_0x7dc9('0x2f')](db[_0x7dc9('0x2b')][_0x7dc9('0x2c')]);_0x18c8a1[_0x7dc9('0x2e')]=_['keys'](_0x52d883[_0x7dc9('0x2e')]);_0x18c8a1[_0x7dc9('0x30')]=_[_0x7dc9('0x31')](_0x18c8a1[_0x7dc9('0x32')],_0x18c8a1[_0x7dc9('0x2e')]);_0x294276[_0x7dc9('0x33')]=_['intersection'](_0x18c8a1[_0x7dc9('0x32')],qs[_0x7dc9('0x34')](_0x52d883['query'][_0x7dc9('0x34')]));_0x294276[_0x7dc9('0x33')]=_0x294276[_0x7dc9('0x33')]['length']?_0x294276[_0x7dc9('0x33')]:_0x18c8a1['model'];if(_0x52d883['query'][_0x7dc9('0x3e')]){_0x294276[_0x7dc9('0x3f')]=[{'all':!![]}];}_0x294276=_[_0x7dc9('0x3a')]({},_0x294276,_0x52d883['options']);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x294276)['then'](handleEntityNotFound(_0xcced6c,null))[_0x7dc9('0x23')](respondWithResult(_0xcced6c,null))[_0x7dc9('0x42')](handleError(_0xcced6c,null));};exports['create']=function(_0x24ccce,_0x1d6c0a){return db[_0x7dc9('0x2b')][_0x7dc9('0x45')](_0x24ccce[_0x7dc9('0x46')],{})[_0x7dc9('0x23')](function(_0x86739f){var _0x3a1102=_0x24ccce[_0x7dc9('0x47')][_0x7dc9('0x48')]({'plain':!![]});if(!_0x3a1102)throw new Error(_0x7dc9('0x49'));if(_0x3a1102[_0x7dc9('0x4a')]===_0x7dc9('0x47')){var _0x59be9b=_0x86739f[_0x7dc9('0x48')]({'plain':!![]});var _0x4fcfd5='Reports';return db[_0x7dc9('0x4b')][_0x7dc9('0x44')]({'where':{'name':_0x4fcfd5,'userProfileId':_0x3a1102[_0x7dc9('0x4c')]},'raw':!![]})[_0x7dc9('0x23')](function(_0x346d27){if(_0x346d27&&_0x346d27['autoAssociation']===0x0){return db[_0x7dc9('0x26')][_0x7dc9('0x45')]({'name':_0x59be9b[_0x7dc9('0x29')],'resourceId':_0x59be9b['id'],'type':'DefaultReports','sectionId':_0x346d27['id']},{})[_0x7dc9('0x23')](function(){return _0x86739f;});}else{return _0x86739f;}})[_0x7dc9('0x42')](function(_0x2cf133){logger[_0x7dc9('0x27')](_0x7dc9('0x4d'),_0x2cf133);throw _0x2cf133;});}return _0x86739f;})[_0x7dc9('0x23')](respondWithResult(_0x1d6c0a,0xc9))['catch'](handleError(_0x1d6c0a,null));};exports[_0x7dc9('0x4e')]=function(_0x2ecc80,_0x2b0941){if(_0x2ecc80[_0x7dc9('0x46')]['id']){delete _0x2ecc80[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x2ecc80[_0x7dc9('0x43')]['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x2b0941,null))[_0x7dc9('0x23')](saveUpdates(_0x2ecc80[_0x7dc9('0x46')],null))[_0x7dc9('0x23')](respondWithResult(_0x2b0941,null))['catch'](handleError(_0x2b0941,null));};exports[_0x7dc9('0x24')]=function(_0x39be46,_0x38df9a){return db[_0x7dc9('0x2b')][_0x7dc9('0x44')]({'where':{'id':_0x39be46['params']['id']}})[_0x7dc9('0x23')](handleEntityNotFound(_0x38df9a,null))[_0x7dc9('0x23')](removeEntity(_0x38df9a,null))[_0x7dc9('0x42')](handleError(_0x38df9a,null));};exports[_0x7dc9('0x4f')]=function(_0x2a1db8,_0x2f01a0){var _0x495a06=0xa;var _0x547caa=['join',_0x7dc9('0x50'),_0x7dc9('0x51'),_0x7dc9('0x52')];var _0x2afefc={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x4905f6={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x4bbf8b=function(_0x175858){return!_[_0x7dc9('0x5f')]([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x175858);};var _0x286ac5=function(_0x2a02ed){if(!_0x2a02ed||!_0x2a02ed[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x19c209='(',_0xf3ae59=0x0;_0xf3ae59<_0x2a02ed[_0x7dc9('0x64')]['length'];_0xf3ae59+=0x1){_0xf3ae59>0x0&&(_0x19c209+='\x20'+_0x2a02ed[_0x7dc9('0x66')]+'\x20');_0x19c209+=_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x67')]?_0x286ac5(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59]['group']):_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x68')]+'\x20'+_0x2a02ed['rules'][_0xf3ae59][_0x7dc9('0x69')]+(_0x4bbf8b(_0x2a02ed[_0x7dc9('0x64')][_0xf3ae59][_0x7dc9('0x69')])?'\x20'+_0x2a02ed['rules'][_0xf3ae59]['value']:'');}return _0x19c209+')';};var _0x205d01={'where':{'id':_0x2a1db8[_0x7dc9('0x43')]['id']}},_0x366d4d,_0x4ed60e,_0x3aba59,_0x15d02f,_0x2bbf61;_0x205d01=_[_0x7dc9('0x3a')]({},_0x205d01,_0x2a1db8[_0x7dc9('0x3d')]);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x205d01)[_0x7dc9('0x23')](function(_0x3f81dd){if(_0x3f81dd){_0x366d4d=_0x3f81dd;return _0x3f81dd['getFields']();}return null;})['then'](function(_0x1b2369){if(_0x1b2369){if(!_0x1b2369[_0x7dc9('0x65')]){throw new db[(_0x7dc9('0x6a'))][(_0x7dc9('0x6b'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4ed60e=_0x1b2369;return db['AnalyticMetric'][_0x7dc9('0x40')]({'raw':!![]});}return null;})[_0x7dc9('0x23')](function(_0x25f8b3){if(_0x25f8b3){_0x3aba59=_[_0x7dc9('0x6c')](_0x25f8b3,'id');var _0x5d211b;var _0xea1728=squel[_0x7dc9('0x6d')]();_0xea1728[_0x7dc9('0x6e')](_0x366d4d[_0x7dc9('0x6f')]);for(var _0x19e0b1=0x0;_0x19e0b1<_0x4ed60e[_0x7dc9('0x65')];_0x19e0b1+=0x1){_0x5d211b=_0x4ed60e[_0x19e0b1][_0x7dc9('0x70')]?_0x3aba59[_0x4ed60e[_0x19e0b1]['MetricId']][_0x7dc9('0x71')]:_0x4ed60e[_0x19e0b1][_0x7dc9('0x68')];_0x5d211b=_0x4ed60e[_0x19e0b1]['function']?_['replace'](_0x2afefc[_0x4ed60e[_0x19e0b1][_0x7dc9('0x72')]],'%s',_0x5d211b):_0x5d211b;_0x5d211b=_0x4ed60e[_0x19e0b1]['format']?_[_0x7dc9('0x73')](_0x4905f6[_0x4ed60e[_0x19e0b1][_0x7dc9('0x74')]],'%s',_0x5d211b):_0x5d211b;if(_0x4ed60e[_0x19e0b1][_0x7dc9('0x75')]){_0xea1728[_0x7dc9('0x67')](_0x5d211b);}_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]&&_0xea1728[_0x7dc9('0x35')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0xea1728[_0x7dc9('0x68')](_0x5d211b,_0x4ed60e[_0x19e0b1][_0x7dc9('0x78')]||_0x5d211b);}if(_0x366d4d['joins']){_0x366d4d[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x79')]);for(var _0x499393=0x0;_0x499393<_0x366d4d[_0x7dc9('0x79')]['length'];_0x499393+=0x1){if(_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]&&_[_0x7dc9('0x5f')](_0x547caa,_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')])&&_0x366d4d['joins'][_0x499393]['parentKey']&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')]&&_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7c')]){_0xea1728[_0x366d4d['joins'][_0x499393][_0x7dc9('0x3b')]](_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x366d4d[_0x7dc9('0x6f')],_0x366d4d[_0x7dc9('0x79')][_0x499393][_0x7dc9('0x7e')],_0x366d4d['joins'][_0x499393]['foreignTable'],_0x366d4d[_0x7dc9('0x79')][_0x499393]['foreignKey']));}}}if(_0x366d4d[_0x7dc9('0x7f')]){_0x366d4d[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x366d4d[_0x7dc9('0x7f')]);_0xea1728['where'](_0x286ac5(_0x366d4d[_0x7dc9('0x7f')][_0x7dc9('0x67')]));}_0x2bbf61=_0xea1728['clone']();_0xea1728[_0x7dc9('0x1d')](_0x495a06);_0xea1728[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0xea1728['toString']());return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xea1728['toString'](),{'type':dbH['sequelize'][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})['then'](respondWithResult(_0x2f01a0,null))[_0x7dc9('0x42')](handleError(_0x2f01a0,null));};function runReport(_0x5f08f6,_0x2e7296,_0x1d0722){var _0x1acdba=_0x2e7296['name'];var _0x33d68c=0xa;var _0x3c7daf=[_0x7dc9('0x85'),'left_join',_0x7dc9('0x51'),'cross_join'];var _0x5761cb={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':_0x7dc9('0x53'),'MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':_0x7dc9('0x59')};var _0x2dc92e={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':'DATE(%s)','HOUR':_0x7dc9('0x5c'),'ROUND':_0x7dc9('0x5d'),'UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x200df7=function(_0x53c992){return!_[_0x7dc9('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x7dc9('0x62'),'IS\x20NOT\x20EMPTY'],_0x53c992);};var _0x21da79=function(_0x476a24){if(!_0x476a24||!_0x476a24[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x38dccc='(',_0xc716c3=0x0;_0xc716c3<_0x476a24['rules'][_0x7dc9('0x65')];_0xc716c3+=0x1){_0xc716c3>0x0&&(_0x38dccc+='\x20'+_0x476a24[_0x7dc9('0x66')]+'\x20');_0x38dccc+=_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x67')]?_0x21da79(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['group']):_0x476a24[_0x7dc9('0x64')][_0xc716c3]['field']+'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x69')]+(_0x200df7(_0x476a24[_0x7dc9('0x64')][_0xc716c3]['condition'])?'\x20'+_0x476a24[_0x7dc9('0x64')][_0xc716c3][_0x7dc9('0x88')]:'');}return _0x38dccc+')';};var _0x5e8806={'where':{'id':_0x5f08f6['id']}},_0x1a9c7e,_0x3f8839,_0xf74b6,_0x2b3d46,_0x5c466d;_0x5e8806=_[_0x7dc9('0x3a')]({},_0x5e8806,_0x1d0722);return db['AnalyticDefaultReport'][_0x7dc9('0x44')](_0x5e8806)[_0x7dc9('0x23')](function(_0x3e06b3){if(_0x3e06b3){_0x1a9c7e=_0x3e06b3;return _0x3e06b3['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x4588a7){if(_0x4588a7){if(!_0x4588a7[_0x7dc9('0x65')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x3f8839=_0x4588a7;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0xb0c228){if(_0xb0c228){_0xf74b6=_[_0x7dc9('0x6c')](_0xb0c228,'id');var _0x5f3487;var _0x29c228=squel['select']();_0x29c228[_0x7dc9('0x6e')](_0x1a9c7e[_0x7dc9('0x6f')]);for(var _0x235473=0x0;_0x235473<_0x3f8839[_0x7dc9('0x65')];_0x235473+=0x1){_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x70')]?_0xf74b6[_0x3f8839[_0x235473][_0x7dc9('0x70')]]['metric']:_0x3f8839[_0x235473][_0x7dc9('0x68')];_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x5761cb[_0x3f8839[_0x235473][_0x7dc9('0x72')]],'%s',_0x5f3487):_0x5f3487;_0x5f3487=_0x3f8839[_0x235473][_0x7dc9('0x74')]?_['replace'](_0x2dc92e[_0x3f8839[_0x235473][_0x7dc9('0x74')]],'%s',_0x5f3487):_0x5f3487;if(_0x3f8839[_0x235473][_0x7dc9('0x75')]){_0x29c228[_0x7dc9('0x67')](_0x5f3487);}_0x3f8839[_0x235473][_0x7dc9('0x76')]&&_0x29c228['order'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x29c228['field'](_0x5f3487,_0x3f8839[_0x235473][_0x7dc9('0x78')]||_0x5f3487);}if(_0x1a9c7e['joins']){_0x1a9c7e[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x79')]);for(var _0x4173c2=0x0;_0x4173c2<_0x1a9c7e[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x4173c2+=0x1){if(_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]&&_['includes'](_0x3c7daf,_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')])&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')]&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2]['foreignTable']&&_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]){_0x29c228[_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x3b')]](_0x1a9c7e['joins'][_0x4173c2][_0x7dc9('0x7b')],null,util['format'](_0x7dc9('0x7d'),_0x1a9c7e['table'],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7e')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7b')],_0x1a9c7e[_0x7dc9('0x79')][_0x4173c2][_0x7dc9('0x7c')]));}}}if(_0x1a9c7e[_0x7dc9('0x7f')]){_0x1a9c7e[_0x7dc9('0x7f')]=JSON[_0x7dc9('0x7a')](_0x1a9c7e[_0x7dc9('0x7f')]);_0x29c228[_0x7dc9('0x37')](_0x21da79(_0x1a9c7e[_0x7dc9('0x7f')]['group']));}_0x5c466d=_0x29c228[_0x7dc9('0x8b')]();_0x29c228[_0x7dc9('0x1d')](_0x33d68c);_0x29c228[_0x7dc9('0x1b')](0x0);return;}})[_0x7dc9('0x23')](function(){if(_0x2e7296['output']===_0x7dc9('0x8c')){return null;}var _0x35e061=_[_0x7dc9('0x3a')](_0x2e7296,{'name':_0x2e7296[_0x7dc9('0x8d')]||_0x2e7296['name']||_0x1a9c7e[_0x7dc9('0x29')],'basename':_0x1acdba,'savename':util[_0x7dc9('0x74')](_0x7dc9('0x8e'),_0x2e7296['name']||_0x1a9c7e['name'],require(_0x7dc9('0x8f'))[_0x7dc9('0x90')](0x4),_0x2e7296[_0x7dc9('0x91')]||_0x7dc9('0x92')),'reportId':_0x1a9c7e['id'],'reportType':_0x7dc9('0x93')});return db['AnalyticExtractedReport'][_0x7dc9('0x45')](_0x35e061,{'raw':!![]});})[_0x7dc9('0x23')](function(_0x648bf9){if(_0x1a9c7e[_0x7dc9('0x6f')]==='cdr'){_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e['table']+_0x7dc9('0x94'),_0x2e7296['startDate'],_0x2e7296[_0x7dc9('0x95')]);}else{_0x5c466d[_0x7dc9('0x37')](_0x1a9c7e[_0x7dc9('0x6f')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e7296[_0x7dc9('0x96')],_0x2e7296[_0x7dc9('0x95')]);}if(_0x648bf9){logger['info']('Run\x20Query:',_0x5c466d[_0x7dc9('0x97')]());require('child_process')['fork'](path[_0x7dc9('0x85')](__dirname,_0x7dc9('0x98'),_0x648bf9[_0x7dc9('0x91')]),[_0x648bf9['id'],_0x5c466d['toString'](),path['join'](__dirname,'../../files/reports',_0x648bf9[_0x7dc9('0x99')]),_0x1acdba]);return _0x648bf9;}else{var _0xb825f3=squel[_0x7dc9('0x6d')]();_0xb825f3[_0x7dc9('0x6e')]('('+_0x5c466d['toString']()+')','countTable');_0xb825f3[_0x7dc9('0x68')](_0x7dc9('0x9a'),_0x7dc9('0x1e'));_0x5c466d['limit'](_0x2e7296['limit']||_0x33d68c);_0x5c466d[_0x7dc9('0x1b')](_0x2e7296['offset']||0x0);return dbH[_0x7dc9('0x82')][_0x7dc9('0x2e')](_0xb825f3['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]})[_0x7dc9('0x23')](function(_0x14cbd9){if(!_0x14cbd9[_0x7dc9('0x65')]){_0x2b3d46=0x0;}else{_0x2b3d46=_0x14cbd9[0x0][_0x7dc9('0x1e')]||0x0;}return dbH[_0x7dc9('0x82')]['query'](_0x5c466d[_0x7dc9('0x97')](),{'type':dbH['sequelize'][_0x7dc9('0x83')]['SELECT']});})[_0x7dc9('0x23')](function(_0x20f245){return{'rows':_0x20f245||[],'count':_0x2b3d46};});}});}exports['run']=function(_0x67d933,_0x1b2b88){return runReport(_0x67d933[_0x7dc9('0x43')],_0x67d933[_0x7dc9('0x2e')],_0x67d933[_0x7dc9('0x3d')])['then'](respondWithResult(_0x1b2b88,null))[_0x7dc9('0x42')](handleError(_0x1b2b88,null));};exports['runReport']=runReport;exports[_0x7dc9('0x2e')]=function(_0x313b41,_0x275675){var _0x299c23=0xa;var _0x4c1c43=[_0x7dc9('0x85'),_0x7dc9('0x50'),'right_join',_0x7dc9('0x52')];var _0x1fbaea={'SUM':_0x7dc9('0x86'),'COUNT':_0x7dc9('0x87'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7dc9('0x54'),'MIN':_0x7dc9('0x55'),'AVG':_0x7dc9('0x56'),'GROUP_CONCAT':_0x7dc9('0x57'),'GROUP_CONCAT ASC':_0x7dc9('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6c7fdc={'SEC_TO_TIME':_0x7dc9('0x5a'),'DATE':_0x7dc9('0x5b'),'HOUR':_0x7dc9('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x7dc9('0x5e')};var _0x5c9d64=function(_0x59710c){return!_['includes']([_0x7dc9('0x60'),_0x7dc9('0x61'),_0x7dc9('0x62'),_0x7dc9('0x63')],_0x59710c);};var _0x24a1e2=function(_0x45bcf4){if(!_0x45bcf4||!_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')]){return'';}for(var _0x4b18e1='(',_0x28e50e=0x0;_0x28e50e<_0x45bcf4[_0x7dc9('0x64')][_0x7dc9('0x65')];_0x28e50e+=0x1){_0x28e50e>0x0&&(_0x4b18e1+='\x20'+_0x45bcf4['operator']+'\x20');_0x4b18e1+=_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]?_0x24a1e2(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x67')]):_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x68')]+'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')]+(_0x5c9d64(_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x69')])?'\x20'+_0x45bcf4[_0x7dc9('0x64')][_0x28e50e][_0x7dc9('0x88')]:'');}return _0x4b18e1+')';};var _0x1dc474={'where':{'id':_0x313b41[_0x7dc9('0x43')]['id']}},_0x31121a,_0x454b3a,_0x409a9f,_0x187f17,_0x809ae5;_0x1dc474=_[_0x7dc9('0x3a')]({},_0x1dc474,_0x313b41['options']);return db[_0x7dc9('0x2b')]['find'](_0x1dc474)[_0x7dc9('0x23')](function(_0x56e1ba){if(_0x56e1ba){_0x31121a=_0x56e1ba;return _0x56e1ba['getFields']();}return null;})[_0x7dc9('0x23')](function(_0x342b95){if(_0x342b95){if(!_0x342b95['length']){throw new db[(_0x7dc9('0x6a'))]['ValidationErrorItem'](_0x7dc9('0x89'),0x193);}_0x454b3a=_0x342b95;return db[_0x7dc9('0x8a')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x338c78){if(_0x338c78){_0x409a9f=_[_0x7dc9('0x6c')](_0x338c78,'id');var _0x8ee4f4;var _0x8f887e=squel['select']();_0x8f887e[_0x7dc9('0x6e')](_0x31121a[_0x7dc9('0x6f')]);for(var _0x4e2edf=0x0;_0x4e2edf<_0x454b3a[_0x7dc9('0x65')];_0x4e2edf+=0x1){_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x70')]?_0x409a9f[_0x454b3a[_0x4e2edf]['MetricId']]['metric']:_0x454b3a[_0x4e2edf][_0x7dc9('0x68')];_0x8ee4f4=_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]?_[_0x7dc9('0x73')](_0x1fbaea[_0x454b3a[_0x4e2edf][_0x7dc9('0x72')]],'%s',_0x8ee4f4):_0x8ee4f4;_0x8ee4f4=_0x454b3a[_0x4e2edf]['format']?_[_0x7dc9('0x73')](_0x6c7fdc[_0x454b3a[_0x4e2edf]['format']],'%s',_0x8ee4f4):_0x8ee4f4;if(_0x454b3a[_0x4e2edf]['groupBy']){_0x8f887e[_0x7dc9('0x67')](_0x8ee4f4);}_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]&&_0x8f887e[_0x7dc9('0x35')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x76')]===_0x7dc9('0x77')?![]:!![]);_0x8f887e[_0x7dc9('0x68')](_0x8ee4f4,_0x454b3a[_0x4e2edf][_0x7dc9('0x78')]||_0x8ee4f4);}if(_0x31121a['joins']){_0x31121a[_0x7dc9('0x79')]=JSON[_0x7dc9('0x7a')](_0x31121a[_0x7dc9('0x79')]);for(var _0x283f96=0x0;_0x283f96<_0x31121a[_0x7dc9('0x79')][_0x7dc9('0x65')];_0x283f96+=0x1){if(_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']&&_[_0x7dc9('0x5f')](_0x4c1c43,_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x3b')])&&_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7e')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7b')]&&_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]){_0x8f887e[_0x31121a[_0x7dc9('0x79')][_0x283f96]['type']](_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],null,util[_0x7dc9('0x74')](_0x7dc9('0x7d'),_0x31121a[_0x7dc9('0x6f')],_0x31121a[_0x7dc9('0x79')][_0x283f96]['parentKey'],_0x31121a[_0x7dc9('0x79')][_0x283f96][_0x7dc9('0x7b')],_0x31121a['joins'][_0x283f96][_0x7dc9('0x7c')]));}}}if(_0x31121a[_0x7dc9('0x7f')]){_0x31121a['conditions']=JSON['parse'](_0x31121a[_0x7dc9('0x7f')]);_0x8f887e[_0x7dc9('0x37')](_0x24a1e2(_0x31121a[_0x7dc9('0x7f')]['group']));}_0x809ae5=_0x8f887e[_0x7dc9('0x8b')]();_0x8f887e['limit'](_0x299c23);_0x8f887e[_0x7dc9('0x1b')](0x0);logger[_0x7dc9('0x80')](_0x7dc9('0x81'),_0x8f887e['toString']());return dbH[_0x7dc9('0x82')]['query'](_0x8f887e['toString'](),{'type':dbH[_0x7dc9('0x82')][_0x7dc9('0x83')][_0x7dc9('0x84')]});}})[_0x7dc9('0x23')](function(){return{'sql':_0x809ae5[_0x7dc9('0x97')]()};})['then'](respondWithResult(_0x275675,null))['catch'](handleError(_0x275675,null));};
\ No newline at end of file
index d0c0c70..f9bd5ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac25=['define','analytics_default_reports','lodash','util','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x560620,_0x308b4d){var _0x4bc7c0=function(_0x5eec71){while(--_0x5eec71){_0x560620['push'](_0x560620['shift']());}};_0x4bc7c0(++_0x308b4d);}(_0xac25,0x92));var _0x5ac2=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xac25[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x5ac2('0x0'));var util=require(_0x5ac2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5ac2('0x2'));var BPromise=require(_0x5ac2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5ac2('0x4'));var config=require(_0x5ac2('0x5'));var attributes=require('./analyticDefaultReport.attributes');module[_0x5ac2('0x6')]=function(_0x12e7fc,_0x4020c6){return _0x12e7fc[_0x5ac2('0x7')]('AnalyticDefaultReport',attributes,{'tableName':_0x5ac2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3add=['bluebird','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment'];(function(_0x53c3e7,_0x454629){var _0x51ad5d=function(_0x24173d){while(--_0x24173d){_0x53c3e7['push'](_0x53c3e7['shift']());}};_0x51ad5d(++_0x454629);}(_0x3add,0x1b5));var _0xd3ad=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0x3add[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xd3ad('0x0'));var util=require(_0xd3ad('0x1'));var logger=require(_0xd3ad('0x2'))(_0xd3ad('0x3'));var moment=require(_0xd3ad('0x4'));var BPromise=require(_0xd3ad('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd3ad('0x6'));var rimraf=require(_0xd3ad('0x7'));var config=require(_0xd3ad('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0xd3ad('0x9')]=function(_0x347ea5,_0x2f2556){return _0x347ea5[_0xd3ad('0xa')](_0xd3ad('0xb'),attributes,{'tableName':_0xd3ad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 15ffebc..9b6129d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa39b=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash'];(function(_0x21c73d,_0x44476e){var _0x43cffd=function(_0x48697e){while(--_0x48697e){_0x21c73d['push'](_0x21c73d['shift']());}};_0x43cffd(++_0x44476e);}(_0xa39b,0x1c7));var _0xba39=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa39b[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0xba39('0x0'));var util=require('util');var moment=require(_0xba39('0x1'));var BPromise=require(_0xba39('0x2'));var rs=require(_0xba39('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba39('0x4'))['db'];var utils=require(_0xba39('0x5'));var logger=require('../../config/logger')(_0xba39('0x6'));var config=require(_0xba39('0x7'));var jayson=require(_0xba39('0x8'));var client=jayson[_0xba39('0x9')][_0xba39('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e2d01,_0x1e2044,_0xa86108){return new BPromise(function(_0x628e00,_0x56ab24){return client[_0xba39('0xb')](_0x5e2d01,_0xa86108)[_0xba39('0xc')](function(_0x2fd27a){logger['info'](_0xba39('0xd'),_0x1e2044,_0xba39('0xe'));logger[_0xba39('0xf')](_0xba39('0x10'),_0x1e2044,_0xba39('0xe'),JSON[_0xba39('0x11')](_0x2fd27a));if(_0x2fd27a['error']){if(_0x2fd27a['error'][_0xba39('0x12')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x1e2044,_0x2fd27a[_0xba39('0x13')]['message']);return _0x56ab24(_0x2fd27a[_0xba39('0x13')][_0xba39('0x14')]);}logger[_0xba39('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1e2044,_0x2fd27a[_0xba39('0x13')]['message']);return _0x628e00(_0x2fd27a[_0xba39('0x13')][_0xba39('0x14')]);}else{logger[_0xba39('0x15')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1e2044,_0xba39('0xe'));_0x628e00(_0x2fd27a[_0xba39('0x16')][_0xba39('0x14')]);}})[_0xba39('0x17')](function(_0xed0a90){logger['error'](_0xba39('0xd'),_0x1e2044,_0xed0a90);_0x56ab24(_0xed0a90);});});}
\ No newline at end of file
+var _0x9466=['debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x2fd69d,_0xeb1037){var _0x5d5ef3=function(_0xa9ea9e){while(--_0xa9ea9e){_0x2fd69d['push'](_0x2fd69d['shift']());}};_0x5d5ef3(++_0xeb1037);}(_0x9466,0x110));var _0x6946=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9466[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x6946('0x0'));var util=require(_0x6946('0x1'));var moment=require(_0x6946('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6946('0x3'));var db=require(_0x6946('0x4'))['db'];var utils=require(_0x6946('0x5'));var logger=require(_0x6946('0x6'))(_0x6946('0x7'));var config=require(_0x6946('0x8'));var jayson=require(_0x6946('0x9'));var client=jayson[_0x6946('0xa')][_0x6946('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d17ed,_0xc51407,_0x35b30c){return new BPromise(function(_0x43b1a6,_0x405995){return client[_0x6946('0xc')](_0x4d17ed,_0x35b30c)[_0x6946('0xd')](function(_0x4de0fb){logger[_0x6946('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xc51407,_0x6946('0xf'));logger[_0x6946('0x10')](_0x6946('0x11'),_0xc51407,'request\x20sent',JSON[_0x6946('0x12')](_0x4de0fb));if(_0x4de0fb[_0x6946('0x13')]){if(_0x4de0fb[_0x6946('0x13')][_0x6946('0x14')]===0x1f4){logger[_0x6946('0x13')](_0x6946('0x15'),_0xc51407,_0x4de0fb['error'][_0x6946('0x16')]);return _0x405995(_0x4de0fb[_0x6946('0x13')][_0x6946('0x16')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0xc51407,_0x4de0fb['error'][_0x6946('0x16')]);return _0x43b1a6(_0x4de0fb['error'][_0x6946('0x16')]);}else{logger[_0x6946('0xe')](_0x6946('0x15'),_0xc51407,'request\x20sent');_0x43b1a6(_0x4de0fb[_0x6946('0x17')][_0x6946('0x16')]);}})['catch'](function(_0x52f083){logger[_0x6946('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xc51407,_0x52f083);_0x405995(_0x52f083);});});}
\ No newline at end of file
index e65dcb8..d93f96c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4365=['/:id','show','/:id/preview','preview','run','/:id/query','query','post','create','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x47c452,_0x197227){var _0x8bcfe3=function(_0x3f1fb3){while(--_0x3f1fb3){_0x47c452['push'](_0x47c452['shift']());}};_0x8bcfe3(++_0x197227);}(_0x4365,0x143));var _0x5436=function(_0x205e6a,_0xfa8d0d){_0x205e6a=_0x205e6a-0x0;var _0x330d5c=_0x4365[_0x205e6a];return _0x330d5c;};'use strict';var multer=require(_0x5436('0x0'));var util=require(_0x5436('0x1'));var path=require('path');var timeout=require(_0x5436('0x2'));var express=require(_0x5436('0x3'));var router=express[_0x5436('0x4')]();var fs_extra=require(_0x5436('0x5'));var auth=require(_0x5436('0x6'));var interaction=require(_0x5436('0x7'));var config=require(_0x5436('0x8'));var controller=require(_0x5436('0x9'));router[_0x5436('0xa')]('/',auth[_0x5436('0xb')](),controller[_0x5436('0xc')]);router[_0x5436('0xa')](_0x5436('0xd'),auth['isAuthenticated'](),controller[_0x5436('0xe')]);router[_0x5436('0xa')](_0x5436('0xf'),auth[_0x5436('0xb')](),controller[_0x5436('0x10')]);router[_0x5436('0xa')]('/:id/run',auth['isAuthenticated'](),controller[_0x5436('0x11')]);router[_0x5436('0xa')](_0x5436('0x12'),auth[_0x5436('0xb')](),controller[_0x5436('0x13')]);router[_0x5436('0x14')]('/',auth[_0x5436('0xb')](),controller[_0x5436('0x15')]);router['put'](_0x5436('0xd'),auth[_0x5436('0xb')](),controller['update']);router[_0x5436('0x16')](_0x5436('0xd'),auth[_0x5436('0xb')](),controller[_0x5436('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x3958=['../../components/interaction/service','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2544e1,_0x239612){var _0x33f958=function(_0x39ce75){while(--_0x39ce75){_0x2544e1['push'](_0x2544e1['shift']());}};_0x33f958(++_0x239612);}(_0x3958,0x7b));var _0x8395=function(_0x5a9527,_0x57a3d4){_0x5a9527=_0x5a9527-0x0;var _0x24c159=_0x3958[_0x5a9527];return _0x24c159;};'use strict';var multer=require('multer');var util=require(_0x8395('0x0'));var path=require(_0x8395('0x1'));var timeout=require(_0x8395('0x2'));var express=require(_0x8395('0x3'));var router=express[_0x8395('0x4')]();var fs_extra=require(_0x8395('0x5'));var auth=require(_0x8395('0x6'));var interaction=require(_0x8395('0x7'));var config=require('../../config/environment');var controller=require(_0x8395('0x8'));router[_0x8395('0x9')]('/',auth['isAuthenticated'](),controller[_0x8395('0xa')]);router['get'](_0x8395('0xb'),auth[_0x8395('0xc')](),controller[_0x8395('0xd')]);router['get'](_0x8395('0xe'),auth[_0x8395('0xc')](),controller[_0x8395('0xf')]);router['get'](_0x8395('0x10'),auth['isAuthenticated'](),controller[_0x8395('0x11')]);router[_0x8395('0x9')](_0x8395('0x12'),auth['isAuthenticated'](),controller[_0x8395('0x13')]);router[_0x8395('0x14')]('/',auth['isAuthenticated'](),controller[_0x8395('0x15')]);router[_0x8395('0x16')](_0x8395('0xb'),auth[_0x8395('0xc')](),controller[_0x8395('0x17')]);router[_0x8395('0x18')]('/:id',auth[_0x8395('0xc')](),controller['destroy']);module[_0x8395('0x19')]=router;
\ No newline at end of file
index 58d3da7..d311f79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bc6=['xlsx','DATE','ENUM','manual','INTEGER','UNSIGNED','sequelize','exports','STRING','csv','pdf'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x3bc6,0x10e));var _0x63bc=function(_0x516c22,_0x11bc59){_0x516c22=_0x516c22-0x0;var _0x52217f=_0x3bc6[_0x516c22];return _0x52217f;};'use strict';var Sequelize=require(_0x63bc('0x0'));var moment=require('moment');module[_0x63bc('0x1')]={'name':{'type':Sequelize[_0x63bc('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x63bc('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x63bc('0x3'),_0x63bc('0x4'),_0x63bc('0x5')),'allowNull':![],'defaultValue':_0x63bc('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x63bc('0x6')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x63bc('0x7')](_0x63bc('0x8'),'scheduled'),'allowNull':![],'defaultValue':_0x63bc('0x8')},'reportId':{'type':Sequelize[_0x63bc('0x9')](0xb)[_0x63bc('0xa')]},'reportType':{'type':Sequelize[_0x63bc('0x2')]}};
\ No newline at end of file
+var _0xde82=['DATE','manual','scheduled','INTEGER','sequelize','moment','exports','STRING','csv','pdf'];(function(_0x4a881e,_0x534433){var _0x26929f=function(_0xe746c4){while(--_0xe746c4){_0x4a881e['push'](_0x4a881e['shift']());}};_0x26929f(++_0x534433);}(_0xde82,0x176));var _0x2de8=function(_0x396670,_0x23fed3){_0x396670=_0x396670-0x0;var _0x2a28f3=_0xde82[_0x396670];return _0x2a28f3;};'use strict';var Sequelize=require(_0x2de8('0x0'));var moment=require(_0x2de8('0x1'));module[_0x2de8('0x2')]={'name':{'type':Sequelize[_0x2de8('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x2de8('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x2de8('0x4'),_0x2de8('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x2de8('0x4')},'savename':{'type':Sequelize[_0x2de8('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2de8('0x6')]},'endDate':{'type':Sequelize[_0x2de8('0x6')]},'status':{'type':Sequelize[_0x2de8('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x2de8('0x7'),_0x2de8('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x2de8('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x2de8('0x3')]}};
\ No newline at end of file
index d10e524..963265f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe703=['output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','%s.%s','toLowerCase','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','options','AnalyticExtractedReport','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','user','role','ExtractedReports','UserProfileSection','autoAssociation','download','basename','savename'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe703,0x6c));var _0x3e70=function(_0x206ca8,_0x34739a){_0x206ca8=_0x206ca8-0x0;var _0x508d10=_0xe703[_0x206ca8];return _0x508d10;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3e70('0x0'));var jsonpatch=require(_0x3e70('0x1'));var rp=require(_0x3e70('0x2'));var moment=require(_0x3e70('0x3'));var BPromise=require(_0x3e70('0x4'));var Mustache=require(_0x3e70('0x5'));var util=require(_0x3e70('0x6'));var path=require(_0x3e70('0x7'));var sox=require(_0x3e70('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3e70('0x9'));var _=require(_0x3e70('0xa'));var squel=require(_0x3e70('0xb'));var crypto=require(_0x3e70('0xc'));var jsforce=require(_0x3e70('0xd'));var deskjs=require(_0x3e70('0xe'));var toCsv=require(_0x3e70('0xf'));var querystring=require(_0x3e70('0x10'));var Papa=require(_0x3e70('0x11'));var Redis=require('ioredis');var authService=require(_0x3e70('0x12'));var qs=require(_0x3e70('0x13'));var as=require(_0x3e70('0x14'));var hardwareService=require(_0x3e70('0x15'));var logger=require(_0x3e70('0x16'))(_0x3e70('0x17'));var utils=require('../../config/utils');var config=require(_0x3e70('0x18'));var licenseUtil=require(_0x3e70('0x19'));var db=require(_0x3e70('0x1a'))['db'];function respondWithStatusCode(_0x506b85,_0x403a1a){_0x403a1a=_0x403a1a||0xcc;return function(_0x329ec3){if(_0x329ec3){return _0x506b85[_0x3e70('0x1b')](_0x403a1a);}return _0x506b85[_0x3e70('0x1c')](_0x403a1a)[_0x3e70('0x1d')]();};}function respondWithResult(_0x5e350a,_0x156e46){_0x156e46=_0x156e46||0xc8;return function(_0x3adfbe){if(_0x3adfbe){return _0x5e350a[_0x3e70('0x1c')](_0x156e46)[_0x3e70('0x1e')](_0x3adfbe);}};}function respondWithFilteredResult(_0x544d9e,_0x1dd1c9){return function(_0x13f2d8){if(_0x13f2d8){var _0x3658a2=typeof _0x1dd1c9[_0x3e70('0x1f')]===_0x3e70('0x20')&&typeof _0x1dd1c9[_0x3e70('0x21')]==='undefined';var _0x11b081=_0x13f2d8[_0x3e70('0x22')];var _0x502b06=_0x3658a2?0x0:_0x1dd1c9[_0x3e70('0x1f')];var _0x198d19=_0x3658a2?_0x13f2d8[_0x3e70('0x22')]:_0x1dd1c9[_0x3e70('0x1f')]+_0x1dd1c9[_0x3e70('0x21')];var _0x39b191;if(_0x198d19>=_0x11b081){_0x198d19=_0x11b081;_0x39b191=0xc8;}else{_0x39b191=0xce;}_0x544d9e['status'](_0x39b191);return _0x544d9e[_0x3e70('0x23')](_0x3e70('0x24'),_0x502b06+'-'+_0x198d19+'/'+_0x11b081)[_0x3e70('0x1e')](_0x13f2d8);}return null;};}function patchUpdates(_0xdefaeb){return function(_0x35f662){try{jsonpatch[_0x3e70('0x25')](_0x35f662,_0xdefaeb,!![]);}catch(_0x4f2610){return BPromise[_0x3e70('0x26')](_0x4f2610);}return _0x35f662[_0x3e70('0x27')]();};}function saveUpdates(_0x337716,_0x42313f){return function(_0x528592){if(_0x528592){return _0x528592[_0x3e70('0x28')](_0x337716)[_0x3e70('0x29')](function(_0x20c073){return _0x20c073;});}return null;};}function removeEntity(_0x4a423b,_0x2ea56f){return function(_0xffab03){if(_0xffab03){return _0xffab03[_0x3e70('0x2a')]()[_0x3e70('0x29')](function(){var _0x224eb6=_0xffab03[_0x3e70('0x2b')]({'plain':!![]});var _0xc00145='ExtractedReports';return db[_0x3e70('0x2c')][_0x3e70('0x2a')]({'where':{'type':_0xc00145,'resourceId':_0x224eb6['id']}})['then'](function(){return _0xffab03;});})[_0x3e70('0x29')](function(){_0x4a423b[_0x3e70('0x1c')](0xcc)[_0x3e70('0x1d')]();});}};}function handleEntityNotFound(_0x34a183,_0x4195c7){return function(_0x275978){if(!_0x275978){_0x34a183[_0x3e70('0x1b')](0x194);}return _0x275978;};}function handleError(_0x469e21,_0x39a138){_0x39a138=_0x39a138||0x1f4;return function(_0x25df1b){logger[_0x3e70('0x2d')](_0x25df1b[_0x3e70('0x2e')]);if(_0x25df1b[_0x3e70('0x2f')]){delete _0x25df1b['name'];}_0x469e21[_0x3e70('0x1c')](_0x39a138)[_0x3e70('0x30')](_0x25df1b);};}exports['index']=function(_0x4383cc,_0x1810bf){var _0x347a8a={},_0xb9968e={},_0x2596a6={'count':0x0,'rows':[]};var _0x32de42=_[_0x3e70('0x31')](db['AnalyticExtractedReport'][_0x3e70('0x32')],function(_0x326d8f){return{'name':_0x326d8f[_0x3e70('0x33')],'type':_0x326d8f[_0x3e70('0x34')][_0x3e70('0x35')]};});_0xb9968e[_0x3e70('0x36')]=_[_0x3e70('0x31')](_0x32de42,_0x3e70('0x2f'));_0xb9968e[_0x3e70('0x37')]=_[_0x3e70('0x38')](_0x4383cc[_0x3e70('0x37')]);_0xb9968e[_0x3e70('0x39')]=_[_0x3e70('0x3a')](_0xb9968e['model'],_0xb9968e[_0x3e70('0x37')]);_0x347a8a[_0x3e70('0x3b')]=_[_0x3e70('0x3a')](_0xb9968e[_0x3e70('0x36')],qs[_0x3e70('0x3c')](_0x4383cc['query'][_0x3e70('0x3c')]));_0x347a8a['attributes']=_0x347a8a[_0x3e70('0x3b')][_0x3e70('0x3d')]?_0x347a8a['attributes']:_0xb9968e[_0x3e70('0x36')];if(!_0x4383cc['query'][_0x3e70('0x3e')](_0x3e70('0x3f'))){_0x347a8a[_0x3e70('0x21')]=qs[_0x3e70('0x21')](_0x4383cc['query']['limit']);_0x347a8a['offset']=qs[_0x3e70('0x1f')](_0x4383cc[_0x3e70('0x37')][_0x3e70('0x1f')]);}_0x347a8a[_0x3e70('0x40')]=qs[_0x3e70('0x41')](_0x4383cc[_0x3e70('0x37')][_0x3e70('0x41')]);_0x347a8a[_0x3e70('0x42')]=qs[_0x3e70('0x39')](_['pick'](_0x4383cc[_0x3e70('0x37')],_0xb9968e[_0x3e70('0x39')]),_0x32de42);if(_0x4383cc['query']['filter']){_0x347a8a[_0x3e70('0x42')]=_['merge'](_0x347a8a['where'],{'$or':_[_0x3e70('0x31')](_0x32de42,function(_0xc57ec){if(_0xc57ec[_0x3e70('0x34')]!==_0x3e70('0x43')){var _0x1a639d={};_0x1a639d[_0xc57ec[_0x3e70('0x2f')]]={'$like':'%'+_0x4383cc[_0x3e70('0x37')][_0x3e70('0x44')]+'%'};return _0x1a639d;}})});}_0x347a8a=_['merge']({},_0x347a8a,_0x4383cc[_0x3e70('0x45')]);var _0x585b53={'where':_0x347a8a[_0x3e70('0x42')]};return db[_0x3e70('0x46')][_0x3e70('0x22')](_0x585b53)[_0x3e70('0x29')](function(_0x8efe1e){_0x2596a6[_0x3e70('0x22')]=_0x8efe1e;if(_0x4383cc[_0x3e70('0x37')][_0x3e70('0x47')]){_0x347a8a[_0x3e70('0x48')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x3e70('0x49')](_0x347a8a);})[_0x3e70('0x29')](function(_0x26dbe6){_0x2596a6[_0x3e70('0x4a')]=_0x26dbe6;return _0x2596a6;})[_0x3e70('0x29')](respondWithFilteredResult(_0x1810bf,_0x347a8a))[_0x3e70('0x4b')](handleError(_0x1810bf,null));};exports[_0x3e70('0x4c')]=function(_0x5c2fa3,_0x3491a6){var _0x5247d4={'raw':!![],'where':{'id':_0x5c2fa3[_0x3e70('0x4d')]['id']}},_0xe8fde1={};_0xe8fde1[_0x3e70('0x36')]=_[_0x3e70('0x38')](db[_0x3e70('0x46')][_0x3e70('0x32')]);_0xe8fde1[_0x3e70('0x37')]=_[_0x3e70('0x38')](_0x5c2fa3[_0x3e70('0x37')]);_0xe8fde1[_0x3e70('0x39')]=_['intersection'](_0xe8fde1[_0x3e70('0x36')],_0xe8fde1[_0x3e70('0x37')]);_0x5247d4[_0x3e70('0x3b')]=_['intersection'](_0xe8fde1[_0x3e70('0x36')],qs[_0x3e70('0x3c')](_0x5c2fa3[_0x3e70('0x37')][_0x3e70('0x3c')]));_0x5247d4[_0x3e70('0x3b')]=_0x5247d4[_0x3e70('0x3b')][_0x3e70('0x3d')]?_0x5247d4[_0x3e70('0x3b')]:_0xe8fde1[_0x3e70('0x36')];if(_0x5c2fa3[_0x3e70('0x37')][_0x3e70('0x47')]){_0x5247d4[_0x3e70('0x48')]=[{'all':!![]}];}_0x5247d4=_[_0x3e70('0x4e')]({},_0x5247d4,_0x5c2fa3['options']);return db[_0x3e70('0x46')][_0x3e70('0x4f')](_0x5247d4)[_0x3e70('0x29')](handleEntityNotFound(_0x3491a6,null))['then'](respondWithResult(_0x3491a6,null))[_0x3e70('0x4b')](handleError(_0x3491a6,null));};exports['create']=function(_0x4e60fb,_0x5a5db7){return db[_0x3e70('0x46')][_0x3e70('0x50')](_0x4e60fb[_0x3e70('0x51')],{})[_0x3e70('0x29')](function(_0x2436f5){var _0x364843=_0x4e60fb[_0x3e70('0x52')][_0x3e70('0x2b')]({'plain':!![]});if(!_0x364843)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x364843[_0x3e70('0x53')]===_0x3e70('0x52')){var _0x13aa7b=_0x2436f5[_0x3e70('0x2b')]({'plain':!![]});var _0x36ae53=_0x3e70('0x54');return db[_0x3e70('0x55')][_0x3e70('0x4f')]({'where':{'name':_0x36ae53,'userProfileId':_0x364843['userProfileId']},'raw':!![]})[_0x3e70('0x29')](function(_0x435766){if(_0x435766&&_0x435766[_0x3e70('0x56')]===0x0){return db[_0x3e70('0x2c')][_0x3e70('0x50')]({'name':_0x13aa7b[_0x3e70('0x2f')],'resourceId':_0x13aa7b['id'],'type':_0x435766['name'],'sectionId':_0x435766['id']},{})[_0x3e70('0x29')](function(){return _0x2436f5;});}else{return _0x2436f5;}})[_0x3e70('0x4b')](function(_0x754bca){logger[_0x3e70('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x754bca);throw _0x754bca;});}return _0x2436f5;})[_0x3e70('0x29')](respondWithResult(_0x5a5db7,0xc9))['catch'](handleError(_0x5a5db7,null));};exports['update']=function(_0x224d07,_0x5dd86c){if(_0x224d07[_0x3e70('0x51')]['id']){delete _0x224d07[_0x3e70('0x51')]['id'];}return db[_0x3e70('0x46')][_0x3e70('0x4f')]({'where':{'id':_0x224d07[_0x3e70('0x4d')]['id']}})[_0x3e70('0x29')](handleEntityNotFound(_0x5dd86c,null))[_0x3e70('0x29')](saveUpdates(_0x224d07[_0x3e70('0x51')],null))[_0x3e70('0x29')](respondWithResult(_0x5dd86c,null))[_0x3e70('0x4b')](handleError(_0x5dd86c,null));};exports[_0x3e70('0x2a')]=function(_0x258c1d,_0x1f80d2){return db[_0x3e70('0x46')][_0x3e70('0x4f')]({'where':{'id':_0x258c1d['params']['id']}})[_0x3e70('0x29')](handleEntityNotFound(_0x1f80d2,null))['then'](removeEntity(_0x1f80d2,null))[_0x3e70('0x4b')](handleError(_0x1f80d2,null));};exports[_0x3e70('0x57')]=function(_0x53aa38,_0x5bbbde,_0x3aedf0){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x53aa38['params']['id']},'attributes':[_0x3e70('0x2f'),_0x3e70('0x58'),_0x3e70('0x59'),_0x3e70('0x5a')],'raw':!![]})[_0x3e70('0x29')](handleEntityNotFound(_0x5bbbde,null))[_0x3e70('0x29')](function(_0x3114d1){if(_0x3114d1){if(!fs['existsSync'](path[_0x3e70('0x5b')](config[_0x3e70('0x5c')],_0x3e70('0x5d'),_0x3114d1[_0x3e70('0x59')]))){throw new db[(_0x3e70('0x5e'))][(_0x3e70('0x5f'))](_0x3e70('0x60'));}if(_0x53aa38[_0x3e70('0x37')]['exists']){return _0x5bbbde[_0x3e70('0x1b')](0xc8);}return _0x5bbbde[_0x3e70('0x57')](path[_0x3e70('0x5b')](config['root'],_0x3e70('0x5d'),_0x3114d1[_0x3e70('0x59')]),util['format'](_0x3e70('0x61'),_0x3114d1['basename']||_0x3114d1[_0x3e70('0x2f')],_0x3114d1[_0x3e70('0x5a')][_0x3e70('0x62')]()));}})[_0x3e70('0x4b')](handleError(_0x5bbbde,null));};
\ No newline at end of file
+var _0xf61f=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','toLowerCase','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x2df821,_0x12c725){var _0x487ea1=function(_0x2bf649){while(--_0x2bf649){_0x2df821['push'](_0x2df821['shift']());}};_0x487ea1(++_0x12c725);}(_0xf61f,0x103));var _0xff61=function(_0x391df0,_0x51b2dc){_0x391df0=_0x391df0-0x0;var _0x30bec6=_0xf61f[_0x391df0];return _0x30bec6;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xff61('0x0'));var jsonpatch=require(_0xff61('0x1'));var rp=require('request-promise');var moment=require(_0xff61('0x2'));var BPromise=require(_0xff61('0x3'));var Mustache=require(_0xff61('0x4'));var util=require(_0xff61('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xff61('0x6'));var ejs=require(_0xff61('0x7'));var fs=require('fs');var fs_extra=require(_0xff61('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xff61('0x9'));var jsforce=require(_0xff61('0xa'));var deskjs=require(_0xff61('0xb'));var toCsv=require(_0xff61('0x6'));var querystring=require(_0xff61('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xff61('0xd'));var qs=require(_0xff61('0xe'));var as=require(_0xff61('0xf'));var hardwareService=require(_0xff61('0x10'));var logger=require(_0xff61('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xff61('0x12'));var db=require(_0xff61('0x13'))['db'];function respondWithStatusCode(_0x3d2ade,_0x2e0db7){_0x2e0db7=_0x2e0db7||0xcc;return function(_0x59f565){if(_0x59f565){return _0x3d2ade[_0xff61('0x14')](_0x2e0db7);}return _0x3d2ade[_0xff61('0x15')](_0x2e0db7)[_0xff61('0x16')]();};}function respondWithResult(_0x250020,_0x423e47){_0x423e47=_0x423e47||0xc8;return function(_0x412724){if(_0x412724){return _0x250020['status'](_0x423e47)[_0xff61('0x17')](_0x412724);}};}function respondWithFilteredResult(_0x27f6f6,_0x3cab09){return function(_0x17c3de){if(_0x17c3de){var _0x213cb8=typeof _0x3cab09[_0xff61('0x18')]===_0xff61('0x19')&&typeof _0x3cab09[_0xff61('0x1a')]==='undefined';var _0x26362a=_0x17c3de[_0xff61('0x1b')];var _0x3dda91=_0x213cb8?0x0:_0x3cab09[_0xff61('0x18')];var _0x545f61=_0x213cb8?_0x17c3de[_0xff61('0x1b')]:_0x3cab09[_0xff61('0x18')]+_0x3cab09['limit'];var _0x17e8f0;if(_0x545f61>=_0x26362a){_0x545f61=_0x26362a;_0x17e8f0=0xc8;}else{_0x17e8f0=0xce;}_0x27f6f6[_0xff61('0x15')](_0x17e8f0);return _0x27f6f6[_0xff61('0x1c')]('Content-Range',_0x3dda91+'-'+_0x545f61+'/'+_0x26362a)[_0xff61('0x17')](_0x17c3de);}return null;};}function patchUpdates(_0x492480){return function(_0x386577){try{jsonpatch[_0xff61('0x1d')](_0x386577,_0x492480,!![]);}catch(_0x40175e){return BPromise[_0xff61('0x1e')](_0x40175e);}return _0x386577['save']();};}function saveUpdates(_0x28099b,_0x2c06a6){return function(_0x2f1ae5){if(_0x2f1ae5){return _0x2f1ae5[_0xff61('0x1f')](_0x28099b)[_0xff61('0x20')](function(_0x5b2704){return _0x5b2704;});}return null;};}function removeEntity(_0x3c2209,_0x3c9240){return function(_0x2ab736){if(_0x2ab736){return _0x2ab736['destroy']()[_0xff61('0x20')](function(){var _0x3605f2=_0x2ab736['get']({'plain':!![]});var _0x143a83=_0xff61('0x21');return db[_0xff61('0x22')][_0xff61('0x23')]({'where':{'type':_0x143a83,'resourceId':_0x3605f2['id']}})['then'](function(){return _0x2ab736;});})['then'](function(){_0x3c2209[_0xff61('0x15')](0xcc)[_0xff61('0x16')]();});}};}function handleEntityNotFound(_0x1fc581,_0xa6dba6){return function(_0x161eeb){if(!_0x161eeb){_0x1fc581[_0xff61('0x14')](0x194);}return _0x161eeb;};}function handleError(_0x2579ba,_0x1fd8af){_0x1fd8af=_0x1fd8af||0x1f4;return function(_0x2aed73){logger['error'](_0x2aed73[_0xff61('0x24')]);if(_0x2aed73[_0xff61('0x25')]){delete _0x2aed73['name'];}_0x2579ba[_0xff61('0x15')](_0x1fd8af)[_0xff61('0x26')](_0x2aed73);};}exports[_0xff61('0x27')]=function(_0x210961,_0x35b5da){var _0x4a75a2={},_0x5c35e0={},_0x206e4d={'count':0x0,'rows':[]};var _0x12ee4e=_[_0xff61('0x28')](db[_0xff61('0x29')][_0xff61('0x2a')],function(_0x196023){return{'name':_0x196023[_0xff61('0x2b')],'type':_0x196023[_0xff61('0x2c')][_0xff61('0x2d')]};});_0x5c35e0[_0xff61('0x2e')]=_[_0xff61('0x28')](_0x12ee4e,_0xff61('0x25'));_0x5c35e0[_0xff61('0x2f')]=_[_0xff61('0x30')](_0x210961[_0xff61('0x2f')]);_0x5c35e0[_0xff61('0x31')]=_[_0xff61('0x32')](_0x5c35e0[_0xff61('0x2e')],_0x5c35e0['query']);_0x4a75a2[_0xff61('0x33')]=_[_0xff61('0x32')](_0x5c35e0[_0xff61('0x2e')],qs['fields'](_0x210961[_0xff61('0x2f')][_0xff61('0x34')]));_0x4a75a2[_0xff61('0x33')]=_0x4a75a2['attributes'][_0xff61('0x35')]?_0x4a75a2[_0xff61('0x33')]:_0x5c35e0[_0xff61('0x2e')];if(!_0x210961[_0xff61('0x2f')][_0xff61('0x36')]('nolimit')){_0x4a75a2[_0xff61('0x1a')]=qs['limit'](_0x210961[_0xff61('0x2f')][_0xff61('0x1a')]);_0x4a75a2['offset']=qs[_0xff61('0x18')](_0x210961[_0xff61('0x2f')]['offset']);}_0x4a75a2[_0xff61('0x37')]=qs[_0xff61('0x38')](_0x210961[_0xff61('0x2f')][_0xff61('0x38')]);_0x4a75a2[_0xff61('0x39')]=qs[_0xff61('0x31')](_[_0xff61('0x3a')](_0x210961[_0xff61('0x2f')],_0x5c35e0['filters']),_0x12ee4e);if(_0x210961['query'][_0xff61('0x3b')]){_0x4a75a2[_0xff61('0x39')]=_[_0xff61('0x3c')](_0x4a75a2[_0xff61('0x39')],{'$or':_[_0xff61('0x28')](_0x12ee4e,function(_0xace7f0){if(_0xace7f0[_0xff61('0x2c')]!=='VIRTUAL'){var _0x383221={};_0x383221[_0xace7f0['name']]={'$like':'%'+_0x210961[_0xff61('0x2f')][_0xff61('0x3b')]+'%'};return _0x383221;}})});}_0x4a75a2=_[_0xff61('0x3c')]({},_0x4a75a2,_0x210961['options']);var _0x39bebd={'where':_0x4a75a2[_0xff61('0x39')]};return db[_0xff61('0x29')]['count'](_0x39bebd)['then'](function(_0x9a92be){_0x206e4d[_0xff61('0x1b')]=_0x9a92be;if(_0x210961[_0xff61('0x2f')][_0xff61('0x3d')]){_0x4a75a2[_0xff61('0x3e')]=[{'all':!![]}];}return db[_0xff61('0x29')][_0xff61('0x3f')](_0x4a75a2);})[_0xff61('0x20')](function(_0x4652b4){_0x206e4d[_0xff61('0x40')]=_0x4652b4;return _0x206e4d;})[_0xff61('0x20')](respondWithFilteredResult(_0x35b5da,_0x4a75a2))[_0xff61('0x41')](handleError(_0x35b5da,null));};exports[_0xff61('0x42')]=function(_0x35e2e9,_0xecc5ec){var _0x13ed72={'raw':!![],'where':{'id':_0x35e2e9[_0xff61('0x43')]['id']}},_0x2768f0={};_0x2768f0['model']=_['keys'](db[_0xff61('0x29')][_0xff61('0x2a')]);_0x2768f0['query']=_[_0xff61('0x30')](_0x35e2e9[_0xff61('0x2f')]);_0x2768f0[_0xff61('0x31')]=_[_0xff61('0x32')](_0x2768f0[_0xff61('0x2e')],_0x2768f0[_0xff61('0x2f')]);_0x13ed72['attributes']=_[_0xff61('0x32')](_0x2768f0[_0xff61('0x2e')],qs[_0xff61('0x34')](_0x35e2e9[_0xff61('0x2f')]['fields']));_0x13ed72['attributes']=_0x13ed72[_0xff61('0x33')][_0xff61('0x35')]?_0x13ed72['attributes']:_0x2768f0[_0xff61('0x2e')];if(_0x35e2e9[_0xff61('0x2f')][_0xff61('0x3d')]){_0x13ed72[_0xff61('0x3e')]=[{'all':!![]}];}_0x13ed72=_[_0xff61('0x3c')]({},_0x13ed72,_0x35e2e9[_0xff61('0x44')]);return db[_0xff61('0x29')]['find'](_0x13ed72)[_0xff61('0x20')](handleEntityNotFound(_0xecc5ec,null))['then'](respondWithResult(_0xecc5ec,null))['catch'](handleError(_0xecc5ec,null));};exports[_0xff61('0x45')]=function(_0x4058ab,_0x4c4d55){return db['AnalyticExtractedReport'][_0xff61('0x45')](_0x4058ab['body'],{})['then'](function(_0x43ce2e){var _0x5b4cc3=_0x4058ab[_0xff61('0x46')][_0xff61('0x47')]({'plain':!![]});if(!_0x5b4cc3)throw new Error(_0xff61('0x48'));if(_0x5b4cc3[_0xff61('0x49')]==='user'){var _0x2a1120=_0x43ce2e[_0xff61('0x47')]({'plain':!![]});var _0x42c430='ExtractedReports';return db[_0xff61('0x4a')][_0xff61('0x4b')]({'where':{'name':_0x42c430,'userProfileId':_0x5b4cc3['userProfileId']},'raw':!![]})[_0xff61('0x20')](function(_0x4e09fd){if(_0x4e09fd&&_0x4e09fd['autoAssociation']===0x0){return db[_0xff61('0x22')]['create']({'name':_0x2a1120[_0xff61('0x25')],'resourceId':_0x2a1120['id'],'type':_0x4e09fd[_0xff61('0x25')],'sectionId':_0x4e09fd['id']},{})[_0xff61('0x20')](function(){return _0x43ce2e;});}else{return _0x43ce2e;}})[_0xff61('0x41')](function(_0x453ef4){logger[_0xff61('0x4c')](_0xff61('0x4d'),_0x453ef4);throw _0x453ef4;});}return _0x43ce2e;})[_0xff61('0x20')](respondWithResult(_0x4c4d55,0xc9))[_0xff61('0x41')](handleError(_0x4c4d55,null));};exports[_0xff61('0x1f')]=function(_0x5f34e7,_0x1a9d48){if(_0x5f34e7[_0xff61('0x4e')]['id']){delete _0x5f34e7[_0xff61('0x4e')]['id'];}return db[_0xff61('0x29')]['find']({'where':{'id':_0x5f34e7[_0xff61('0x43')]['id']}})[_0xff61('0x20')](handleEntityNotFound(_0x1a9d48,null))[_0xff61('0x20')](saveUpdates(_0x5f34e7[_0xff61('0x4e')],null))[_0xff61('0x20')](respondWithResult(_0x1a9d48,null))[_0xff61('0x41')](handleError(_0x1a9d48,null));};exports[_0xff61('0x23')]=function(_0x4b7ef8,_0x1d99f4){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x4b7ef8['params']['id']}})['then'](handleEntityNotFound(_0x1d99f4,null))[_0xff61('0x20')](removeEntity(_0x1d99f4,null))[_0xff61('0x41')](handleError(_0x1d99f4,null));};exports[_0xff61('0x4f')]=function(_0x1b5c53,_0x5cf4f6,_0x101752){return db[_0xff61('0x29')][_0xff61('0x4b')]({'where':{'id':_0x1b5c53[_0xff61('0x43')]['id']},'attributes':[_0xff61('0x25'),_0xff61('0x50'),_0xff61('0x51'),_0xff61('0x52')],'raw':!![]})[_0xff61('0x20')](handleEntityNotFound(_0x5cf4f6,null))[_0xff61('0x20')](function(_0x15d501){if(_0x15d501){if(!fs['existsSync'](path[_0xff61('0x53')](config[_0xff61('0x54')],_0xff61('0x55'),_0x15d501[_0xff61('0x51')]))){throw new db[(_0xff61('0x56'))][(_0xff61('0x57'))](_0xff61('0x58'));}if(_0x1b5c53[_0xff61('0x2f')]['exists']){return _0x5cf4f6[_0xff61('0x14')](0xc8);}return _0x5cf4f6[_0xff61('0x4f')](path[_0xff61('0x53')](config['root'],'server/files/reports',_0x15d501[_0xff61('0x51')]),util[_0xff61('0x59')]('%s.%s',_0x15d501[_0xff61('0x50')]||_0x15d501['name'],_0x15d501[_0xff61('0x52')][_0xff61('0x5a')]()));}})[_0xff61('0x41')](handleError(_0x5cf4f6,null));};
\ No newline at end of file
index 9220f85..ce8e675 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78f1=['util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash'];(function(_0xf2e71c,_0x265309){var _0xf0f8cc=function(_0x285ef5){while(--_0x285ef5){_0xf2e71c['push'](_0xf2e71c['shift']());}};_0xf0f8cc(++_0x265309);}(_0x78f1,0x17f));var _0x178f=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x78f1[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x178f('0x0'));var util=require(_0x178f('0x1'));var logger=require(_0x178f('0x2'))(_0x178f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x178f('0x4'));var fs=require('fs');var path=require(_0x178f('0x5'));var rimraf=require(_0x178f('0x6'));var config=require(_0x178f('0x7'));var attributes=require(_0x178f('0x8'));module[_0x178f('0x9')]=function(_0x44f34f,_0x2f8563){return _0x44f34f[_0x178f('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x178f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa763=['moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x233f29,_0x34d890){var _0x5768ce=function(_0x2a116e){while(--_0x2a116e){_0x233f29['push'](_0x233f29['shift']());}};_0x5768ce(++_0x34d890);}(_0xa763,0x134));var _0x3a76=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xa763[_0x15c421];return _0x5e5ed5;};'use strict';var _=require(_0x3a76('0x0'));var util=require(_0x3a76('0x1'));var logger=require(_0x3a76('0x2'))(_0x3a76('0x3'));var moment=require(_0x3a76('0x4'));var BPromise=require(_0x3a76('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3a76('0x6'));var rimraf=require('rimraf');var config=require(_0x3a76('0x7'));var attributes=require(_0x3a76('0x8'));module[_0x3a76('0x9')]=function(_0x1dcff9,_0x5eb47d){return _0x1dcff9[_0x3a76('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x3a76('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index af2d9d7..d273911 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x390a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x487ab4,_0x1e24e8){var _0x3bef77=function(_0x5ce664){while(--_0x5ce664){_0x487ab4['push'](_0x487ab4['shift']());}};_0x3bef77(++_0x1e24e8);}(_0x390a,0xbe));var _0xa390=function(_0xcc708,_0x3673b5){_0xcc708=_0xcc708-0x0;var _0x1999bc=_0x390a[_0xcc708];return _0x1999bc;};'use strict';var _=require(_0xa390('0x0'));var util=require(_0xa390('0x1'));var moment=require(_0xa390('0x2'));var BPromise=require(_0xa390('0x3'));var rs=require(_0xa390('0x4'));var fs=require('fs');var Redis=require(_0xa390('0x5'));var db=require(_0xa390('0x6'))['db'];var utils=require(_0xa390('0x7'));var logger=require(_0xa390('0x8'))(_0xa390('0x9'));var config=require(_0xa390('0xa'));var jayson=require(_0xa390('0xb'));var client=jayson[_0xa390('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x212916,_0x940df7,_0x55a074){return new BPromise(function(_0x3783bf,_0x4d6ed7){return client['request'](_0x212916,_0x55a074)[_0xa390('0xd')](function(_0x21e05b){logger[_0xa390('0xe')](_0xa390('0xf'),_0x940df7,_0xa390('0x10'));logger['debug'](_0xa390('0x11'),_0x940df7,_0xa390('0x10'),JSON['stringify'](_0x21e05b));if(_0x21e05b[_0xa390('0x12')]){if(_0x21e05b[_0xa390('0x12')][_0xa390('0x13')]===0x1f4){logger[_0xa390('0x12')](_0xa390('0xf'),_0x940df7,_0x21e05b[_0xa390('0x12')]['message']);return _0x4d6ed7(_0x21e05b[_0xa390('0x12')][_0xa390('0x14')]);}logger[_0xa390('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x940df7,_0x21e05b['error'][_0xa390('0x14')]);return _0x3783bf(_0x21e05b['error'][_0xa390('0x14')]);}else{logger[_0xa390('0xe')](_0xa390('0xf'),_0x940df7,_0xa390('0x10'));_0x3783bf(_0x21e05b[_0xa390('0x15')]['message']);}})['catch'](function(_0x5b1998){logger[_0xa390('0x12')](_0xa390('0xf'),_0x940df7,_0x5b1998);_0x4d6ed7(_0x5b1998);});});}
\ No newline at end of file
+var _0xebf5=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x1551ed,_0x5cc3ce){var _0x499928=function(_0x41b8d5){while(--_0x41b8d5){_0x1551ed['push'](_0x1551ed['shift']());}};_0x499928(++_0x5cc3ce);}(_0xebf5,0x1ab));var _0x5ebf=function(_0x4f4b55,_0x31cbd6){_0x4f4b55=_0x4f4b55-0x0;var _0x36fbf9=_0xebf5[_0x4f4b55];return _0x36fbf9;};'use strict';var _=require(_0x5ebf('0x0'));var util=require(_0x5ebf('0x1'));var moment=require(_0x5ebf('0x2'));var BPromise=require(_0x5ebf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5ebf('0x4'))['db'];var utils=require(_0x5ebf('0x5'));var logger=require(_0x5ebf('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5ebf('0x7'));var client=jayson[_0x5ebf('0x8')][_0x5ebf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x199a95,_0x19b334,_0x5b7dbd){return new BPromise(function(_0xc63519,_0x2b6691){return client[_0x5ebf('0xa')](_0x199a95,_0x5b7dbd)[_0x5ebf('0xb')](function(_0x1dbb55){logger[_0x5ebf('0xc')](_0x5ebf('0xd'),_0x19b334,_0x5ebf('0xe'));logger['debug'](_0x5ebf('0xf'),_0x19b334,'request\x20sent',JSON[_0x5ebf('0x10')](_0x1dbb55));if(_0x1dbb55[_0x5ebf('0x11')]){if(_0x1dbb55[_0x5ebf('0x11')][_0x5ebf('0x12')]===0x1f4){logger[_0x5ebf('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x19b334,_0x1dbb55[_0x5ebf('0x11')][_0x5ebf('0x13')]);return _0x2b6691(_0x1dbb55['error']['message']);}logger[_0x5ebf('0x11')](_0x5ebf('0xd'),_0x19b334,_0x1dbb55['error'][_0x5ebf('0x13')]);return _0xc63519(_0x1dbb55[_0x5ebf('0x11')][_0x5ebf('0x13')]);}else{logger[_0x5ebf('0xc')](_0x5ebf('0xd'),_0x19b334,'request\x20sent');_0xc63519(_0x1dbb55[_0x5ebf('0x14')][_0x5ebf('0x13')]);}})[_0x5ebf('0x15')](function(_0x394a13){logger[_0x5ebf('0x11')](_0x5ebf('0xd'),_0x19b334,_0x394a13);_0x2b6691(_0x394a13);});});}
\ No newline at end of file
index f7b52cb..b8e509c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0c6=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update'];(function(_0x3a02d4,_0x26435a){var _0x43df59=function(_0x1ec9d2){while(--_0x1ec9d2){_0x3a02d4['push'](_0x3a02d4['shift']());}};_0x43df59(++_0x26435a);}(_0xb0c6,0x1b9));var _0x6b0c=function(_0xac88a1,_0x186ed9){_0xac88a1=_0xac88a1-0x0;var _0xa4db68=_0xb0c6[_0xac88a1];return _0xa4db68;};'use strict';var multer=require(_0x6b0c('0x0'));var util=require(_0x6b0c('0x1'));var path=require(_0x6b0c('0x2'));var timeout=require(_0x6b0c('0x3'));var express=require('express');var router=express[_0x6b0c('0x4')]();var fs_extra=require(_0x6b0c('0x5'));var auth=require(_0x6b0c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b0c('0x7'));var controller=require(_0x6b0c('0x8'));router[_0x6b0c('0x9')]('/',auth[_0x6b0c('0xa')](),controller['index']);router[_0x6b0c('0x9')](_0x6b0c('0xb'),auth['isAuthenticated'](),controller[_0x6b0c('0xc')]);router[_0x6b0c('0x9')](_0x6b0c('0xd'),auth['isAuthenticated'](),controller[_0x6b0c('0xe')]);router[_0x6b0c('0xf')]('/',auth[_0x6b0c('0xa')](),controller[_0x6b0c('0x10')]);router[_0x6b0c('0x11')](_0x6b0c('0xb'),auth[_0x6b0c('0xa')](),controller[_0x6b0c('0x12')]);router['delete']('/:id',auth[_0x6b0c('0xa')](),controller[_0x6b0c('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x8f15=['util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','create','put','update','delete','destroy','exports'];(function(_0x43daa8,_0x2b964e){var _0x42a182=function(_0x16a94b){while(--_0x16a94b){_0x43daa8['push'](_0x43daa8['shift']());}};_0x42a182(++_0x2b964e);}(_0x8f15,0x1c2));var _0x58f1=function(_0x42cdc8,_0x3be788){_0x42cdc8=_0x42cdc8-0x0;var _0x50310e=_0x8f15[_0x42cdc8];return _0x50310e;};'use strict';var multer=require('multer');var util=require(_0x58f1('0x0'));var path=require(_0x58f1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x58f1('0x2'));var interaction=require(_0x58f1('0x3'));var config=require(_0x58f1('0x4'));var controller=require(_0x58f1('0x5'));router[_0x58f1('0x6')]('/',auth[_0x58f1('0x7')](),controller[_0x58f1('0x8')]);router[_0x58f1('0x6')](_0x58f1('0x9'),auth[_0x58f1('0x7')](),controller[_0x58f1('0xa')]);router[_0x58f1('0x6')](_0x58f1('0xb'),auth[_0x58f1('0x7')](),controller['download']);router['post']('/',auth[_0x58f1('0x7')](),controller[_0x58f1('0xc')]);router[_0x58f1('0xd')](_0x58f1('0x9'),auth[_0x58f1('0x7')](),controller[_0x58f1('0xe')]);router[_0x58f1('0xf')](_0x58f1('0x9'),auth[_0x58f1('0x7')](),controller[_0x58f1('0x10')]);module[_0x58f1('0x11')]=router;
\ No newline at end of file
index 612aebd..087adda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x242b=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x242b,0x15d));var _0xb242=function(_0xefa2d1,_0x4d98ad){_0xefa2d1=_0xefa2d1-0x0;var _0x23cf7f=_0x242b[_0xefa2d1];return _0x23cf7f;};'use strict';var Sequelize=require(_0xb242('0x0'));module[_0xb242('0x1')]={'field':{'type':Sequelize[_0xb242('0x2')]},'alias':{'type':Sequelize[_0xb242('0x3')]},'function':{'type':Sequelize[_0xb242('0x3')]},'format':{'type':Sequelize[_0xb242('0x3')]},'groupBy':{'type':Sequelize[_0xb242('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xb242('0x3')]},'custom':{'type':Sequelize[_0xb242('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb7bd=['exports','STRING','BOOLEAN','sequelize'];(function(_0x28d019,_0x55d2c5){var _0x25d7f1=function(_0x2e4fd4){while(--_0x2e4fd4){_0x28d019['push'](_0x28d019['shift']());}};_0x25d7f1(++_0x55d2c5);}(_0xb7bd,0x7f));var _0xdb7b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb7bd[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xdb7b('0x0'));module[_0xdb7b('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0xdb7b('0x2')]},'function':{'type':Sequelize[_0xdb7b('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xdb7b('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xdb7b('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 6192ab9..0314cec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa859=['index','AnalyticFieldReport','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','catch','show','params','rawAttributes','create','bulkCreate','body','find','ids','AnalyticCustomReport','sequelize','transaction','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','error','name'];(function(_0x2b78ea,_0x1d4fab){var _0x58b952=function(_0x19ad21){while(--_0x19ad21){_0x2b78ea['push'](_0x2b78ea['shift']());}};_0x58b952(++_0x1d4fab);}(_0xa859,0x77));var _0x9a85=function(_0x4e6afa,_0x1ca110){_0x4e6afa=_0x4e6afa-0x0;var _0x2f6837=_0xa859[_0x4e6afa];return _0x2f6837;};'use strict';var emlformat=require(_0x9a85('0x0'));var rimraf=require(_0x9a85('0x1'));var zipdir=require(_0x9a85('0x2'));var jsonpatch=require(_0x9a85('0x3'));var rp=require(_0x9a85('0x4'));var moment=require('moment');var BPromise=require(_0x9a85('0x5'));var Mustache=require('mustache');var util=require(_0x9a85('0x6'));var path=require(_0x9a85('0x7'));var sox=require(_0x9a85('0x8'));var csv=require(_0x9a85('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9a85('0xa'));var crypto=require('crypto');var jsforce=require(_0x9a85('0xb'));var deskjs=require(_0x9a85('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9a85('0xd'));var Papa=require(_0x9a85('0xe'));var Redis=require(_0x9a85('0xf'));var authService=require(_0x9a85('0x10'));var qs=require(_0x9a85('0x11'));var as=require(_0x9a85('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9a85('0x13'))(_0x9a85('0x14'));var utils=require(_0x9a85('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9a85('0x16'));var db=require(_0x9a85('0x17'))['db'];function respondWithStatusCode(_0x48a7c2,_0x5dded1){_0x5dded1=_0x5dded1||0xcc;return function(_0x262b0b){if(_0x262b0b){return _0x48a7c2[_0x9a85('0x18')](_0x5dded1);}return _0x48a7c2['status'](_0x5dded1)[_0x9a85('0x19')]();};}function respondWithResult(_0x188880,_0x2f5251){_0x2f5251=_0x2f5251||0xc8;return function(_0x303051){if(_0x303051){return _0x188880[_0x9a85('0x1a')](_0x2f5251)[_0x9a85('0x1b')](_0x303051);}};}function respondWithFilteredResult(_0x17c1ce,_0x56f554){return function(_0x178628){if(_0x178628){var _0x594a36=typeof _0x56f554['offset']===_0x9a85('0x1c')&&typeof _0x56f554[_0x9a85('0x1d')]===_0x9a85('0x1c');var _0x5b4a46=_0x178628['count'];var _0x772fdc=_0x594a36?0x0:_0x56f554[_0x9a85('0x1e')];var _0x46bc1d=_0x594a36?_0x178628[_0x9a85('0x1f')]:_0x56f554['offset']+_0x56f554[_0x9a85('0x1d')];var _0x359e3a;if(_0x46bc1d>=_0x5b4a46){_0x46bc1d=_0x5b4a46;_0x359e3a=0xc8;}else{_0x359e3a=0xce;}_0x17c1ce[_0x9a85('0x1a')](_0x359e3a);return _0x17c1ce[_0x9a85('0x20')](_0x9a85('0x21'),_0x772fdc+'-'+_0x46bc1d+'/'+_0x5b4a46)[_0x9a85('0x1b')](_0x178628);}return null;};}function patchUpdates(_0x505b25){return function(_0x11d763){try{jsonpatch['apply'](_0x11d763,_0x505b25,!![]);}catch(_0x18e337){return BPromise[_0x9a85('0x22')](_0x18e337);}return _0x11d763[_0x9a85('0x23')]();};}function saveUpdates(_0x3cadd1,_0x4150ac){return function(_0x2c521f){if(_0x2c521f){return _0x2c521f[_0x9a85('0x24')](_0x3cadd1)[_0x9a85('0x25')](function(_0x33e08b){return _0x33e08b;});}return null;};}function removeEntity(_0x4b3a89,_0x1b7ba2){return function(_0x267ae5){if(_0x267ae5){return _0x267ae5[_0x9a85('0x26')]()[_0x9a85('0x25')](function(){_0x4b3a89['status'](0xcc)[_0x9a85('0x19')]();});}};}function handleEntityNotFound(_0x3c99f0,_0x43fe3){return function(_0x56e900){if(!_0x56e900){_0x3c99f0[_0x9a85('0x18')](0x194);}return _0x56e900;};}function handleError(_0x3596ad,_0x3fd83b){_0x3fd83b=_0x3fd83b||0x1f4;return function(_0x536997){logger[_0x9a85('0x27')](_0x536997['stack']);if(_0x536997[_0x9a85('0x28')]){delete _0x536997[_0x9a85('0x28')];}_0x3596ad[_0x9a85('0x1a')](_0x3fd83b)['send'](_0x536997);};}exports[_0x9a85('0x29')]=function(_0x55a581,_0x3dd876){var _0x5308fb={},_0x990da4={},_0x27a538={'count':0x0,'rows':[]};var _0x5ba6fe=_['map'](db[_0x9a85('0x2a')]['rawAttributes'],function(_0x572c35){return{'name':_0x572c35[_0x9a85('0x2b')],'type':_0x572c35[_0x9a85('0x2c')][_0x9a85('0x2d')]};});_0x990da4['model']=_[_0x9a85('0x2e')](_0x5ba6fe,_0x9a85('0x28'));_0x990da4[_0x9a85('0x2f')]=_[_0x9a85('0x30')](_0x55a581['query']);_0x990da4[_0x9a85('0x31')]=_[_0x9a85('0x32')](_0x990da4[_0x9a85('0x33')],_0x990da4['query']);_0x5308fb[_0x9a85('0x34')]=_[_0x9a85('0x32')](_0x990da4[_0x9a85('0x33')],qs[_0x9a85('0x35')](_0x55a581[_0x9a85('0x2f')]['fields']));_0x5308fb[_0x9a85('0x34')]=_0x5308fb[_0x9a85('0x34')][_0x9a85('0x36')]?_0x5308fb[_0x9a85('0x34')]:_0x990da4[_0x9a85('0x33')];if(!_0x55a581['query'][_0x9a85('0x37')](_0x9a85('0x38'))){_0x5308fb['limit']=qs[_0x9a85('0x1d')](_0x55a581['query']['limit']);_0x5308fb[_0x9a85('0x1e')]=qs[_0x9a85('0x1e')](_0x55a581[_0x9a85('0x2f')][_0x9a85('0x1e')]);}_0x5308fb[_0x9a85('0x39')]=qs[_0x9a85('0x3a')](_0x55a581[_0x9a85('0x2f')][_0x9a85('0x3a')]);_0x5308fb['where']=qs[_0x9a85('0x31')](_[_0x9a85('0x3b')](_0x55a581[_0x9a85('0x2f')],_0x990da4[_0x9a85('0x31')]),_0x5ba6fe);if(_0x55a581['query'][_0x9a85('0x3c')]){_0x5308fb[_0x9a85('0x3d')]=_[_0x9a85('0x3e')](_0x5308fb[_0x9a85('0x3d')],{'$or':_['map'](_0x5ba6fe,function(_0x3c1089){if(_0x3c1089[_0x9a85('0x2c')]!==_0x9a85('0x3f')){var _0x17db8d={};_0x17db8d[_0x3c1089[_0x9a85('0x28')]]={'$like':'%'+_0x55a581['query'][_0x9a85('0x3c')]+'%'};return _0x17db8d;}})});}_0x5308fb=_[_0x9a85('0x3e')]({},_0x5308fb,_0x55a581['options']);var _0x16012f={'where':_0x5308fb[_0x9a85('0x3d')]};return db[_0x9a85('0x2a')]['count'](_0x16012f)[_0x9a85('0x25')](function(_0x5e2478){_0x27a538['count']=_0x5e2478;if(_0x55a581[_0x9a85('0x2f')][_0x9a85('0x40')]){_0x5308fb[_0x9a85('0x41')]=[{'all':!![]}];}return db[_0x9a85('0x2a')]['findAll'](_0x5308fb);})[_0x9a85('0x25')](function(_0x4a0bd1){_0x27a538['rows']=_0x4a0bd1;return _0x27a538;})[_0x9a85('0x25')](respondWithFilteredResult(_0x3dd876,_0x5308fb))[_0x9a85('0x42')](handleError(_0x3dd876,null));};exports[_0x9a85('0x43')]=function(_0x176fa7,_0xe492a5){var _0x356502={'raw':![],'where':{'id':_0x176fa7[_0x9a85('0x44')]['id']}},_0x28aa32={};_0x28aa32[_0x9a85('0x33')]=_[_0x9a85('0x30')](db[_0x9a85('0x2a')][_0x9a85('0x45')]);_0x28aa32[_0x9a85('0x2f')]=_[_0x9a85('0x30')](_0x176fa7['query']);_0x28aa32[_0x9a85('0x31')]=_[_0x9a85('0x32')](_0x28aa32[_0x9a85('0x33')],_0x28aa32['query']);_0x356502['attributes']=_[_0x9a85('0x32')](_0x28aa32[_0x9a85('0x33')],qs[_0x9a85('0x35')](_0x176fa7['query'][_0x9a85('0x35')]));_0x356502[_0x9a85('0x34')]=_0x356502[_0x9a85('0x34')][_0x9a85('0x36')]?_0x356502[_0x9a85('0x34')]:_0x28aa32['model'];if(_0x176fa7[_0x9a85('0x2f')][_0x9a85('0x40')]){_0x356502[_0x9a85('0x41')]=[{'all':!![]}];}_0x356502=_['merge']({},_0x356502,_0x176fa7['options']);return db[_0x9a85('0x2a')]['find'](_0x356502)[_0x9a85('0x25')](handleEntityNotFound(_0xe492a5,null))[_0x9a85('0x25')](respondWithResult(_0xe492a5,null))[_0x9a85('0x42')](handleError(_0xe492a5,null));};exports[_0x9a85('0x46')]=function(_0x30a31c,_0x469e3f){return db['AnalyticFieldReport']['create'](_0x30a31c['body'],{})['then'](respondWithResult(_0x469e3f,0xc9))[_0x9a85('0x42')](handleError(_0x469e3f,null));};exports[_0x9a85('0x47')]=function(_0xdc72ba,_0x217032){return db[_0x9a85('0x2a')][_0x9a85('0x47')](_0xdc72ba[_0x9a85('0x48')],{'raw':![],'individualHooks':!![]})[_0x9a85('0x25')](respondWithResult(_0x217032,0xc9))[_0x9a85('0x42')](handleError(_0x217032,null));};exports[_0x9a85('0x24')]=function(_0xefeb87,_0x9c357f){if(_0xefeb87['body']['id']){delete _0xefeb87['body']['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0xefeb87[_0x9a85('0x44')]['id']}})['then'](handleEntityNotFound(_0x9c357f,null))['then'](saveUpdates(_0xefeb87['body'],null))['then'](respondWithResult(_0x9c357f,null))[_0x9a85('0x42')](handleError(_0x9c357f,null));};exports['destroy']=function(_0x542e5d,_0x20a0b0){return db[_0x9a85('0x2a')][_0x9a85('0x49')]({'where':{'id':_0x542e5d[_0x9a85('0x44')]['id']}})['then'](handleEntityNotFound(_0x20a0b0,null))['then'](removeEntity(_0x20a0b0,null))[_0x9a85('0x42')](handleError(_0x20a0b0,null));};exports['bulkDestroy']=function(_0x3cdbfe,_0x33fbda){return db[_0x9a85('0x2a')][_0x9a85('0x26')]({'where':{'id':_0x3cdbfe[_0x9a85('0x2f')][_0x9a85('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x33fbda,0xcc))[_0x9a85('0x42')](handleError(_0x33fbda,null));};exports['addFields']=function(_0x1fc01d,_0x5dd369,_0x5d3441){return db[_0x9a85('0x4b')]['findOne']({'where':{'id':_0x1fc01d['params']['id']}})['then'](handleEntityNotFound(_0x5dd369,null))[_0x9a85('0x25')](function(_0x3c5038){if(_0x3c5038){return db[_0x9a85('0x4c')][_0x9a85('0x4d')](function(_0x28358a){return db[_0x9a85('0x2a')][_0x9a85('0x26')]({'where':{'CustomReportId':_0x1fc01d[_0x9a85('0x44')]['id']},'transaction':_0x28358a})['then'](function(_0x1db3f3){var _0x53e809=_[_0x9a85('0x2e')](_0x1fc01d[_0x9a85('0x48')],function(_0x52dfca){delete _0x52dfca['id'];_0x52dfca[_0x9a85('0x4e')]=_0x1fc01d[_0x9a85('0x44')]['id'];return _0x52dfca;});return db[_0x9a85('0x2a')]['bulkCreate'](_0x53e809,{'transaction':_0x28358a});});})[_0x9a85('0x25')](function(){return db['AnalyticFieldReport'][_0x9a85('0x4f')]({'where':{'CustomReportId':_0x1fc01d[_0x9a85('0x44')]['id']}});});}})[_0x9a85('0x25')](respondWithResult(_0x5dd369,null))[_0x9a85('0x42')](handleError(_0x5dd369,null));};
\ No newline at end of file
+var _0x948c=['attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filters','where','filter','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','merge','find','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','save','update','destroy','then','error','name','index','map','AnalyticFieldReport','type','key','model','query','keys'];(function(_0x1629b5,_0x5737cd){var _0x1b1b66=function(_0x4962fd){while(--_0x4962fd){_0x1629b5['push'](_0x1629b5['shift']());}};_0x1b1b66(++_0x5737cd);}(_0x948c,0x1b3));var _0xc948=function(_0x1d38e0,_0x23dcaf){_0x1d38e0=_0x1d38e0-0x0;var _0x26e31b=_0x948c[_0x1d38e0];return _0x26e31b;};'use strict';var emlformat=require(_0xc948('0x0'));var rimraf=require(_0xc948('0x1'));var zipdir=require(_0xc948('0x2'));var jsonpatch=require(_0xc948('0x3'));var rp=require('request-promise');var moment=require(_0xc948('0x4'));var BPromise=require(_0xc948('0x5'));var Mustache=require('mustache');var util=require(_0xc948('0x6'));var path=require(_0xc948('0x7'));var sox=require(_0xc948('0x8'));var csv=require(_0xc948('0x9'));var ejs=require(_0xc948('0xa'));var fs=require('fs');var fs_extra=require(_0xc948('0xb'));var _=require(_0xc948('0xc'));var squel=require(_0xc948('0xd'));var crypto=require(_0xc948('0xe'));var jsforce=require(_0xc948('0xf'));var deskjs=require(_0xc948('0x10'));var toCsv=require(_0xc948('0x9'));var querystring=require(_0xc948('0x11'));var Papa=require(_0xc948('0x12'));var Redis=require(_0xc948('0x13'));var authService=require(_0xc948('0x14'));var qs=require(_0xc948('0x15'));var as=require(_0xc948('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc948('0x17'))(_0xc948('0x18'));var utils=require(_0xc948('0x19'));var config=require(_0xc948('0x1a'));var licenseUtil=require(_0xc948('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfc3aa6,_0x2335fb){_0x2335fb=_0x2335fb||0xcc;return function(_0x2c8b73){if(_0x2c8b73){return _0xfc3aa6[_0xc948('0x1c')](_0x2335fb);}return _0xfc3aa6[_0xc948('0x1d')](_0x2335fb)[_0xc948('0x1e')]();};}function respondWithResult(_0x480469,_0x3246de){_0x3246de=_0x3246de||0xc8;return function(_0x597264){if(_0x597264){return _0x480469['status'](_0x3246de)[_0xc948('0x1f')](_0x597264);}};}function respondWithFilteredResult(_0x923d3f,_0x3a2042){return function(_0x1efbe5){if(_0x1efbe5){var _0x4a1060=typeof _0x3a2042['offset']===_0xc948('0x20')&&typeof _0x3a2042['limit']===_0xc948('0x20');var _0xbd0e21=_0x1efbe5[_0xc948('0x21')];var _0x5c35fb=_0x4a1060?0x0:_0x3a2042[_0xc948('0x22')];var _0x327ddc=_0x4a1060?_0x1efbe5['count']:_0x3a2042[_0xc948('0x22')]+_0x3a2042['limit'];var _0x599524;if(_0x327ddc>=_0xbd0e21){_0x327ddc=_0xbd0e21;_0x599524=0xc8;}else{_0x599524=0xce;}_0x923d3f[_0xc948('0x1d')](_0x599524);return _0x923d3f['set'](_0xc948('0x23'),_0x5c35fb+'-'+_0x327ddc+'/'+_0xbd0e21)['json'](_0x1efbe5);}return null;};}function patchUpdates(_0x535ec2){return function(_0x1f462d){try{jsonpatch[_0xc948('0x24')](_0x1f462d,_0x535ec2,!![]);}catch(_0x5ce436){return BPromise['reject'](_0x5ce436);}return _0x1f462d[_0xc948('0x25')]();};}function saveUpdates(_0x3849f1,_0x392c79){return function(_0x1c19e4){if(_0x1c19e4){return _0x1c19e4[_0xc948('0x26')](_0x3849f1)['then'](function(_0x594908){return _0x594908;});}return null;};}function removeEntity(_0x57720f,_0x56a849){return function(_0x129a7f){if(_0x129a7f){return _0x129a7f[_0xc948('0x27')]()[_0xc948('0x28')](function(){_0x57720f[_0xc948('0x1d')](0xcc)[_0xc948('0x1e')]();});}};}function handleEntityNotFound(_0x24d798,_0x16d3cd){return function(_0x1f043f){if(!_0x1f043f){_0x24d798[_0xc948('0x1c')](0x194);}return _0x1f043f;};}function handleError(_0x2c4b34,_0x13147b){_0x13147b=_0x13147b||0x1f4;return function(_0x2b9371){logger[_0xc948('0x29')](_0x2b9371['stack']);if(_0x2b9371['name']){delete _0x2b9371[_0xc948('0x2a')];}_0x2c4b34[_0xc948('0x1d')](_0x13147b)['send'](_0x2b9371);};}exports[_0xc948('0x2b')]=function(_0x402b3a,_0x4861be){var _0x177046={},_0x1f095f={},_0x28721a={'count':0x0,'rows':[]};var _0x57b06c=_[_0xc948('0x2c')](db[_0xc948('0x2d')]['rawAttributes'],function(_0x46e31c){return{'name':_0x46e31c['fieldName'],'type':_0x46e31c[_0xc948('0x2e')][_0xc948('0x2f')]};});_0x1f095f[_0xc948('0x30')]=_['map'](_0x57b06c,_0xc948('0x2a'));_0x1f095f[_0xc948('0x31')]=_[_0xc948('0x32')](_0x402b3a[_0xc948('0x31')]);_0x1f095f['filters']=_['intersection'](_0x1f095f['model'],_0x1f095f[_0xc948('0x31')]);_0x177046[_0xc948('0x33')]=_['intersection'](_0x1f095f[_0xc948('0x30')],qs[_0xc948('0x34')](_0x402b3a['query'][_0xc948('0x34')]));_0x177046[_0xc948('0x33')]=_0x177046[_0xc948('0x33')][_0xc948('0x35')]?_0x177046[_0xc948('0x33')]:_0x1f095f[_0xc948('0x30')];if(!_0x402b3a[_0xc948('0x31')][_0xc948('0x36')](_0xc948('0x37'))){_0x177046[_0xc948('0x38')]=qs[_0xc948('0x38')](_0x402b3a[_0xc948('0x31')]['limit']);_0x177046[_0xc948('0x22')]=qs[_0xc948('0x22')](_0x402b3a[_0xc948('0x31')][_0xc948('0x22')]);}_0x177046['order']=qs[_0xc948('0x39')](_0x402b3a[_0xc948('0x31')]['sort']);_0x177046['where']=qs['filters'](_[_0xc948('0x3a')](_0x402b3a[_0xc948('0x31')],_0x1f095f[_0xc948('0x3b')]),_0x57b06c);if(_0x402b3a[_0xc948('0x31')]['filter']){_0x177046[_0xc948('0x3c')]=_['merge'](_0x177046[_0xc948('0x3c')],{'$or':_['map'](_0x57b06c,function(_0x1bdca1){if(_0x1bdca1[_0xc948('0x2e')]!=='VIRTUAL'){var _0x476630={};_0x476630[_0x1bdca1[_0xc948('0x2a')]]={'$like':'%'+_0x402b3a['query'][_0xc948('0x3d')]+'%'};return _0x476630;}})});}_0x177046=_['merge']({},_0x177046,_0x402b3a['options']);var _0x38c532={'where':_0x177046['where']};return db[_0xc948('0x2d')][_0xc948('0x21')](_0x38c532)[_0xc948('0x28')](function(_0x54f3bb){_0x28721a[_0xc948('0x21')]=_0x54f3bb;if(_0x402b3a[_0xc948('0x31')][_0xc948('0x3e')]){_0x177046[_0xc948('0x3f')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xc948('0x40')](_0x177046);})[_0xc948('0x28')](function(_0x9f68d){_0x28721a[_0xc948('0x41')]=_0x9f68d;return _0x28721a;})['then'](respondWithFilteredResult(_0x4861be,_0x177046))[_0xc948('0x42')](handleError(_0x4861be,null));};exports['show']=function(_0x2954ac,_0x3641c2){var _0x3fedeb={'raw':![],'where':{'id':_0x2954ac[_0xc948('0x43')]['id']}},_0x269a09={};_0x269a09['model']=_['keys'](db[_0xc948('0x2d')][_0xc948('0x44')]);_0x269a09['query']=_[_0xc948('0x32')](_0x2954ac[_0xc948('0x31')]);_0x269a09[_0xc948('0x3b')]=_[_0xc948('0x45')](_0x269a09['model'],_0x269a09['query']);_0x3fedeb[_0xc948('0x33')]=_[_0xc948('0x45')](_0x269a09[_0xc948('0x30')],qs[_0xc948('0x34')](_0x2954ac['query']['fields']));_0x3fedeb[_0xc948('0x33')]=_0x3fedeb[_0xc948('0x33')][_0xc948('0x35')]?_0x3fedeb['attributes']:_0x269a09[_0xc948('0x30')];if(_0x2954ac[_0xc948('0x31')][_0xc948('0x3e')]){_0x3fedeb['include']=[{'all':!![]}];}_0x3fedeb=_[_0xc948('0x46')]({},_0x3fedeb,_0x2954ac['options']);return db[_0xc948('0x2d')][_0xc948('0x47')](_0x3fedeb)[_0xc948('0x28')](handleEntityNotFound(_0x3641c2,null))['then'](respondWithResult(_0x3641c2,null))[_0xc948('0x42')](handleError(_0x3641c2,null));};exports[_0xc948('0x48')]=function(_0x546066,_0x50ebd2){return db[_0xc948('0x2d')][_0xc948('0x48')](_0x546066['body'],{})[_0xc948('0x28')](respondWithResult(_0x50ebd2,0xc9))['catch'](handleError(_0x50ebd2,null));};exports[_0xc948('0x49')]=function(_0x1fc483,_0x2f8c8f){return db[_0xc948('0x2d')][_0xc948('0x49')](_0x1fc483[_0xc948('0x4a')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2f8c8f,0xc9))[_0xc948('0x42')](handleError(_0x2f8c8f,null));};exports[_0xc948('0x26')]=function(_0x50e45c,_0x291c89){if(_0x50e45c[_0xc948('0x4a')]['id']){delete _0x50e45c[_0xc948('0x4a')]['id'];}return db[_0xc948('0x2d')]['find']({'where':{'id':_0x50e45c[_0xc948('0x43')]['id']}})[_0xc948('0x28')](handleEntityNotFound(_0x291c89,null))[_0xc948('0x28')](saveUpdates(_0x50e45c[_0xc948('0x4a')],null))[_0xc948('0x28')](respondWithResult(_0x291c89,null))[_0xc948('0x42')](handleError(_0x291c89,null));};exports['destroy']=function(_0x279e8c,_0x5c8d81){return db['AnalyticFieldReport'][_0xc948('0x47')]({'where':{'id':_0x279e8c['params']['id']}})[_0xc948('0x28')](handleEntityNotFound(_0x5c8d81,null))[_0xc948('0x28')](removeEntity(_0x5c8d81,null))[_0xc948('0x42')](handleError(_0x5c8d81,null));};exports[_0xc948('0x4b')]=function(_0x4157f7,_0x12249e){return db[_0xc948('0x2d')][_0xc948('0x27')]({'where':{'id':_0x4157f7[_0xc948('0x31')][_0xc948('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xc948('0x28')](respondWithResult(_0x12249e,0xcc))[_0xc948('0x42')](handleError(_0x12249e,null));};exports[_0xc948('0x4d')]=function(_0x22ee9d,_0x525be8,_0x4c12b3){return db[_0xc948('0x4e')]['findOne']({'where':{'id':_0x22ee9d[_0xc948('0x43')]['id']}})[_0xc948('0x28')](handleEntityNotFound(_0x525be8,null))[_0xc948('0x28')](function(_0x3ec21d){if(_0x3ec21d){return db['sequelize'][_0xc948('0x4f')](function(_0x15d7d7){return db[_0xc948('0x2d')][_0xc948('0x27')]({'where':{'CustomReportId':_0x22ee9d[_0xc948('0x43')]['id']},'transaction':_0x15d7d7})[_0xc948('0x28')](function(_0x40dd19){var _0x450bc0=_[_0xc948('0x2c')](_0x22ee9d[_0xc948('0x4a')],function(_0x4bfe41){delete _0x4bfe41['id'];_0x4bfe41[_0xc948('0x50')]=_0x22ee9d[_0xc948('0x43')]['id'];return _0x4bfe41;});return db[_0xc948('0x2d')][_0xc948('0x49')](_0x450bc0,{'transaction':_0x15d7d7});});})[_0xc948('0x28')](function(){return db[_0xc948('0x2d')][_0xc948('0x40')]({'where':{'CustomReportId':_0x22ee9d[_0xc948('0x43')]['id']}});});}})['then'](respondWithResult(_0x525be8,null))[_0xc948('0x42')](handleError(_0x525be8,null));};
\ No newline at end of file
index 601363c..f7a02d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a3f=['request-promise','rimraf','./analyticFieldReport.attributes','define','analytics_report_fields','util','../../config/logger','api','bluebird'];(function(_0x50e7e0,_0x5affce){var _0x1a0307=function(_0x32d343){while(--_0x32d343){_0x50e7e0['push'](_0x50e7e0['shift']());}};_0x1a0307(++_0x5affce);}(_0x4a3f,0xb9));var _0xf4a3=function(_0x324f55,_0x2e6ca4){_0x324f55=_0x324f55-0x0;var _0x284952=_0x4a3f[_0x324f55];return _0x284952;};'use strict';var _=require('lodash');var util=require(_0xf4a3('0x0'));var logger=require(_0xf4a3('0x1'))(_0xf4a3('0x2'));var moment=require('moment');var BPromise=require(_0xf4a3('0x3'));var rp=require(_0xf4a3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf4a3('0x5'));var config=require('../../config/environment');var attributes=require(_0xf4a3('0x6'));module['exports']=function(_0x32f3ea,_0x5beba2){return _0x32f3ea[_0xf4a3('0x7')]('AnalyticFieldReport',attributes,{'tableName':_0xf4a3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x27d2=['path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a50a6,_0x400207){var _0x9cd101=function(_0x4abe53){while(--_0x4abe53){_0x1a50a6['push'](_0x1a50a6['shift']());}};_0x9cd101(++_0x400207);}(_0x27d2,0x1f1));var _0x227d=function(_0x5a89ae,_0x5e0327){_0x5a89ae=_0x5a89ae-0x0;var _0x59b56e=_0x27d2[_0x5a89ae];return _0x59b56e;};'use strict';var _=require(_0x227d('0x0'));var util=require(_0x227d('0x1'));var logger=require(_0x227d('0x2'))(_0x227d('0x3'));var moment=require(_0x227d('0x4'));var BPromise=require(_0x227d('0x5'));var rp=require(_0x227d('0x6'));var fs=require('fs');var path=require(_0x227d('0x7'));var rimraf=require(_0x227d('0x8'));var config=require(_0x227d('0x9'));var attributes=require(_0x227d('0xa'));module[_0x227d('0xb')]=function(_0x1aa534,_0x2eb807){return _0x1aa534[_0x227d('0xc')]('AnalyticFieldReport',attributes,{'tableName':_0x227d('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index bb6637f..b72860b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd64=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x22e47a,_0x4ea10c){var _0x15a12a=function(_0x4a097f){while(--_0x4a097f){_0x22e47a['push'](_0x22e47a['shift']());}};_0x15a12a(++_0x4ea10c);}(_0xcd64,0x1d5));var _0x4cd6=function(_0xd8437c,_0x19cbe7){_0xd8437c=_0xd8437c-0x0;var _0x4f6cf9=_0xcd64[_0xd8437c];return _0x4f6cf9;};'use strict';var _=require(_0x4cd6('0x0'));var util=require(_0x4cd6('0x1'));var moment=require(_0x4cd6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4cd6('0x3'));var logger=require(_0x4cd6('0x4'))(_0x4cd6('0x5'));var config=require(_0x4cd6('0x6'));var jayson=require(_0x4cd6('0x7'));var client=jayson[_0x4cd6('0x8')][_0x4cd6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1694ee,_0x1e8c5c,_0x3bc5a5){return new BPromise(function(_0x39670e,_0x26dd3b){return client[_0x4cd6('0xa')](_0x1694ee,_0x3bc5a5)[_0x4cd6('0xb')](function(_0x482175){logger[_0x4cd6('0xc')](_0x4cd6('0xd'),_0x1e8c5c,_0x4cd6('0xe'));logger[_0x4cd6('0xf')](_0x4cd6('0x10'),_0x1e8c5c,_0x4cd6('0xe'),JSON[_0x4cd6('0x11')](_0x482175));if(_0x482175[_0x4cd6('0x12')]){if(_0x482175['error'][_0x4cd6('0x13')]===0x1f4){logger[_0x4cd6('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e8c5c,_0x482175[_0x4cd6('0x12')][_0x4cd6('0x14')]);return _0x26dd3b(_0x482175[_0x4cd6('0x12')][_0x4cd6('0x14')]);}logger[_0x4cd6('0x12')](_0x4cd6('0xd'),_0x1e8c5c,_0x482175[_0x4cd6('0x12')][_0x4cd6('0x14')]);return _0x39670e(_0x482175[_0x4cd6('0x12')][_0x4cd6('0x14')]);}else{logger['info'](_0x4cd6('0xd'),_0x1e8c5c,_0x4cd6('0xe'));_0x39670e(_0x482175['result'][_0x4cd6('0x14')]);}})[_0x4cd6('0x15')](function(_0x1db9fb){logger[_0x4cd6('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e8c5c,_0x1db9fb);_0x26dd3b(_0x1db9fb);});});}
\ No newline at end of file
+var _0x0c2f=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x5bb113,_0x3d681b){var _0x2018b7=function(_0x33d10d){while(--_0x33d10d){_0x5bb113['push'](_0x5bb113['shift']());}};_0x2018b7(++_0x3d681b);}(_0x0c2f,0x74));var _0xf0c2=function(_0x4c315a,_0x187fc3){_0x4c315a=_0x4c315a-0x0;var _0x2310d8=_0x0c2f[_0x4c315a];return _0x2310d8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf0c2('0x0'));var BPromise=require(_0xf0c2('0x1'));var rs=require(_0xf0c2('0x2'));var fs=require('fs');var Redis=require(_0xf0c2('0x3'));var db=require(_0xf0c2('0x4'))['db'];var utils=require(_0xf0c2('0x5'));var logger=require(_0xf0c2('0x6'))(_0xf0c2('0x7'));var config=require(_0xf0c2('0x8'));var jayson=require(_0xf0c2('0x9'));var client=jayson[_0xf0c2('0xa')][_0xf0c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x424f1e,_0x14e981,_0x4f8658){return new BPromise(function(_0x272269,_0x46f966){return client[_0xf0c2('0xc')](_0x424f1e,_0x4f8658)[_0xf0c2('0xd')](function(_0x5d36eb){logger[_0xf0c2('0xe')](_0xf0c2('0xf'),_0x14e981,_0xf0c2('0x10'));logger['debug'](_0xf0c2('0x11'),_0x14e981,_0xf0c2('0x10'),JSON[_0xf0c2('0x12')](_0x5d36eb));if(_0x5d36eb['error']){if(_0x5d36eb[_0xf0c2('0x13')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x14e981,_0x5d36eb[_0xf0c2('0x13')][_0xf0c2('0x14')]);return _0x46f966(_0x5d36eb[_0xf0c2('0x13')][_0xf0c2('0x14')]);}logger[_0xf0c2('0x13')](_0xf0c2('0xf'),_0x14e981,_0x5d36eb[_0xf0c2('0x13')][_0xf0c2('0x14')]);return _0x272269(_0x5d36eb[_0xf0c2('0x13')]['message']);}else{logger[_0xf0c2('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x14e981,_0xf0c2('0x10'));_0x272269(_0x5d36eb[_0xf0c2('0x15')][_0xf0c2('0x14')]);}})[_0xf0c2('0x16')](function(_0x4f8e9b){logger[_0xf0c2('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x14e981,_0x4f8e9b);_0x46f966(_0x4f8e9b);});});}
\ No newline at end of file
index 66aff1f..0bbcef9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x2031ad,_0x3d1279){var _0x372bea=function(_0x176038){while(--_0x176038){_0x2031ad['push'](_0x2031ad['shift']());}};_0x372bea(++_0x3d1279);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x48dc48,_0xc7cd6d){var _0x30238b=function(_0x5d9dda){while(--_0x5d9dda){_0x48dc48['push'](_0x48dc48['shift']());}};_0x30238b(++_0xc7cd6d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
index 9904722..aa56205 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd957=['exports','name','STRING','sequelize'];(function(_0x1a137e,_0x2b6ef7){var _0x340dee=function(_0x242bb9){while(--_0x242bb9){_0x1a137e['push'](_0x1a137e['shift']());}};_0x340dee(++_0x2b6ef7);}(_0xd957,0x153));var _0x7d95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd957[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x7d95('0x0'));module[_0x7d95('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x7d95('0x2')},'table':{'type':Sequelize[_0x7d95('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d95('0x3')]}};
\ No newline at end of file
+var _0xc584=['exports','STRING','TEXT'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc584,0xa8));var _0x4c58=function(_0xee37f1,_0x189f43){_0xee37f1=_0xee37f1-0x0;var _0x37fd54=_0xc584[_0xee37f1];return _0x37fd54;};'use strict';var Sequelize=require('sequelize');module[_0x4c58('0x0')]={'name':{'type':Sequelize[_0x4c58('0x1')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x4c58('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f52c103..699cb00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x53bdde,_0x1630a6){var _0x580e87=function(_0x23793e){while(--_0x23793e){_0x53bdde['push'](_0x53bdde['shift']());}};_0x580e87(++_0x1630a6);}(_0xabce,0x103));var _0xeabc=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xabce[_0x2bf141];return _0x48277b;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');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 licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));};
\ No newline at end of file
+var _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0xccfade,_0x38a817){var _0x5f2832=function(_0x292639){while(--_0x292639){_0xccfade['push'](_0xccfade['shift']());}};_0x5f2832(++_0x38a817);}(_0x98a8,0x12c));var _0x898a=function(_0x47e206,_0x4fece5){_0x47e206=_0x47e206-0x0;var _0x277770=_0x98a8[_0x47e206];return _0x277770;};'use strict';var emlformat=require(_0x898a('0x0'));var rimraf=require(_0x898a('0x1'));var zipdir=require(_0x898a('0x2'));var jsonpatch=require(_0x898a('0x3'));var rp=require(_0x898a('0x4'));var moment=require(_0x898a('0x5'));var BPromise=require(_0x898a('0x6'));var Mustache=require('mustache');var util=require(_0x898a('0x7'));var path=require(_0x898a('0x8'));var sox=require(_0x898a('0x9'));var csv=require(_0x898a('0xa'));var ejs=require(_0x898a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x898a('0xc'));var squel=require('squel');var crypto=require(_0x898a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x898a('0xe'));var toCsv=require(_0x898a('0xa'));var querystring=require(_0x898a('0xf'));var Papa=require(_0x898a('0x10'));var Redis=require(_0x898a('0x11'));var authService=require(_0x898a('0x12'));var qs=require(_0x898a('0x13'));var as=require(_0x898a('0x14'));var hardwareService=require(_0x898a('0x15'));var logger=require('../../config/logger')(_0x898a('0x16'));var utils=require('../../config/utils');var config=require(_0x898a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x898a('0x18'))['db'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));};
\ No newline at end of file
index 6108939..dc8caae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x714c=['define','util','../../config/logger','api','moment','bluebird','path','rimraf','exports'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x714c,0x18d));var _0xc714=function(_0x499210,_0x325b29){_0x499210=_0x499210-0x0;var _0x2e153d=_0x714c[_0x499210];return _0x2e153d;};'use strict';var _=require('lodash');var util=require(_0xc714('0x0'));var logger=require(_0xc714('0x1'))(_0xc714('0x2'));var moment=require(_0xc714('0x3'));var BPromise=require(_0xc714('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc714('0x5'));var rimraf=require(_0xc714('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module[_0xc714('0x7')]=function(_0xf624fc,_0x1c4a3b){return _0xf624fc[_0xc714('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7c09=['rimraf','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x9438cf,_0x19c958){var _0x3d8373=function(_0x17b7f0){while(--_0x17b7f0){_0x9438cf['push'](_0x9438cf['shift']());}};_0x3d8373(++_0x19c958);}(_0x7c09,0x102));var _0x97c0=function(_0x4df9f2,_0x20ee4e){_0x4df9f2=_0x4df9f2-0x0;var _0x5bb427=_0x7c09[_0x4df9f2];return _0x5bb427;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 710de8b..1263483 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8573=['error','AnalyticMetric,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3160dd,_0x1a9d52){var _0x4f9783=function(_0x4a5781){while(--_0x4a5781){_0x3160dd['push'](_0x3160dd['shift']());}};_0x4f9783(++_0x1a9d52);}(_0x8573,0x9f));var _0x3857=function(_0x1592a4,_0x3608cc){_0x1592a4=_0x1592a4-0x0;var _0x3c2c13=_0x8573[_0x1592a4];return _0x3c2c13;};'use strict';var _=require(_0x3857('0x0'));var util=require(_0x3857('0x1'));var moment=require('moment');var BPromise=require(_0x3857('0x2'));var rs=require(_0x3857('0x3'));var fs=require('fs');var Redis=require(_0x3857('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3857('0x5'))(_0x3857('0x6'));var config=require(_0x3857('0x7'));var jayson=require(_0x3857('0x8'));var client=jayson['client'][_0x3857('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b5e52,_0x6f220f,_0x25a10c){return new BPromise(function(_0x354dc2,_0x1d2e93){return client[_0x3857('0xa')](_0x2b5e52,_0x25a10c)[_0x3857('0xb')](function(_0x30e3fa){logger[_0x3857('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x6f220f,_0x3857('0xd'));logger[_0x3857('0xe')](_0x3857('0xf'),_0x6f220f,'request\x20sent',JSON[_0x3857('0x10')](_0x30e3fa));if(_0x30e3fa[_0x3857('0x11')]){if(_0x30e3fa[_0x3857('0x11')]['code']===0x1f4){logger[_0x3857('0x11')](_0x3857('0x12'),_0x6f220f,_0x30e3fa[_0x3857('0x11')]['message']);return _0x1d2e93(_0x30e3fa[_0x3857('0x11')]['message']);}logger['error'](_0x3857('0x12'),_0x6f220f,_0x30e3fa[_0x3857('0x11')][_0x3857('0x13')]);return _0x354dc2(_0x30e3fa[_0x3857('0x11')][_0x3857('0x13')]);}else{logger[_0x3857('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x6f220f,_0x3857('0xd'));_0x354dc2(_0x30e3fa[_0x3857('0x14')][_0x3857('0x13')]);}})[_0x3857('0x15')](function(_0x349a62){logger[_0x3857('0x11')](_0x3857('0x12'),_0x6f220f,_0x349a62);_0x1d2e93(_0x349a62);});});}
\ No newline at end of file
+var _0x84a1=['info','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then'];(function(_0x14540b,_0x85d32d){var _0x394822=function(_0x2e9b0e){while(--_0x2e9b0e){_0x14540b['push'](_0x14540b['shift']());}};_0x394822(++_0x85d32d);}(_0x84a1,0x172));var _0x184a=function(_0x1606ff,_0x4e7eaa){_0x1606ff=_0x1606ff-0x0;var _0x1d82a8=_0x84a1[_0x1606ff];return _0x1d82a8;};'use strict';var _=require('lodash');var util=require(_0x184a('0x0'));var moment=require('moment');var BPromise=require(_0x184a('0x1'));var rs=require(_0x184a('0x2'));var fs=require('fs');var Redis=require(_0x184a('0x3'));var db=require(_0x184a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x184a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x184a('0x6')][_0x184a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ae569,_0x3b770a,_0x4ff3fc){return new BPromise(function(_0x44b664,_0x52bcc2){return client[_0x184a('0x8')](_0x2ae569,_0x4ff3fc)[_0x184a('0x9')](function(_0x7b7f72){logger[_0x184a('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x3b770a,_0x184a('0xb'));logger[_0x184a('0xc')](_0x184a('0xd'),_0x3b770a,_0x184a('0xb'),JSON[_0x184a('0xe')](_0x7b7f72));if(_0x7b7f72[_0x184a('0xf')]){if(_0x7b7f72[_0x184a('0xf')][_0x184a('0x10')]===0x1f4){logger[_0x184a('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x3b770a,_0x7b7f72[_0x184a('0xf')]['message']);return _0x52bcc2(_0x7b7f72[_0x184a('0xf')]['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x3b770a,_0x7b7f72[_0x184a('0xf')]['message']);return _0x44b664(_0x7b7f72[_0x184a('0xf')]['message']);}else{logger['info'](_0x184a('0x11'),_0x3b770a,'request\x20sent');_0x44b664(_0x7b7f72['result'][_0x184a('0x12')]);}})[_0x184a('0x13')](function(_0x396e0f){logger[_0x184a('0xf')](_0x184a('0x11'),_0x3b770a,_0x396e0f);_0x52bcc2(_0x396e0f);});});}
\ No newline at end of file
index 9004575..d25d1ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35d0=['update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x52cdc1,_0x1bc117){var _0x16e9d9=function(_0x5b39ca){while(--_0x5b39ca){_0x52cdc1['push'](_0x52cdc1['shift']());}};_0x16e9d9(++_0x1bc117);}(_0x35d0,0xf9));var _0x035d=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0x35d0[_0x52e363];return _0x3fc2b5;};'use strict';var multer=require(_0x035d('0x0'));var util=require(_0x035d('0x1'));var path=require('path');var timeout=require(_0x035d('0x2'));var express=require(_0x035d('0x3'));var router=express[_0x035d('0x4')]();var fs_extra=require(_0x035d('0x5'));var auth=require(_0x035d('0x6'));var interaction=require(_0x035d('0x7'));var config=require('../../config/environment');var controller=require(_0x035d('0x8'));router[_0x035d('0x9')]('/',auth[_0x035d('0xa')](),controller[_0x035d('0xb')]);router['get'](_0x035d('0xc'),auth[_0x035d('0xa')](),controller[_0x035d('0xd')]);router[_0x035d('0xe')]('/',auth[_0x035d('0xa')](),controller[_0x035d('0xf')]);router[_0x035d('0x10')](_0x035d('0xc'),auth[_0x035d('0xa')](),controller[_0x035d('0x11')]);router['delete'](_0x035d('0xc'),auth['isAuthenticated'](),controller[_0x035d('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x7c09=['create','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','/:id','isAuthenticated','show','post'];(function(_0x4512a5,_0x471f20){var _0x540afa=function(_0x1fc82c){while(--_0x1fc82c){_0x4512a5['push'](_0x4512a5['shift']());}};_0x540afa(++_0x471f20);}(_0x7c09,0x102));var _0x97c0=function(_0x492ae5,_0xcd1348){_0x492ae5=_0x492ae5-0x0;var _0x11cbef=_0x7c09[_0x492ae5];return _0x11cbef;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var fs_extra=require(_0x97c0('0x4'));var auth=require(_0x97c0('0x5'));var interaction=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var controller=require(_0x97c0('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x97c0('0x9')](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xc')]);router[_0x97c0('0xd')]('/',auth['isAuthenticated'](),controller[_0x97c0('0xe')]);router['put'](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller['update']);router['delete'](_0x97c0('0xa'),auth[_0x97c0('0xb')](),controller[_0x97c0('0xf')]);module[_0x97c0('0x10')]=router;
\ No newline at end of file
index c756c7a..ec12f04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55f2=['sequelize','exports','TEXT'];(function(_0x1e9f07,_0x495773){var _0x1145c5=function(_0x2168b6){while(--_0x2168b6){_0x1e9f07['push'](_0x1e9f07['shift']());}};_0x1145c5(++_0x495773);}(_0x55f2,0x117));var _0x255f=function(_0x19788e,_0x45353d){_0x19788e=_0x19788e-0x0;var _0x105204=_0x55f2[_0x19788e];return _0x105204;};'use strict';var Sequelize=require(_0x255f('0x0'));module[_0x255f('0x1')]={'tree':{'type':Sequelize[_0x255f('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa67c=['exports','TEXT','sequelize'];(function(_0x22663e,_0x25b0ce){var _0x38b63c=function(_0x3bd864){while(--_0x3bd864){_0x22663e['push'](_0x22663e['shift']());}};_0x38b63c(++_0x25b0ce);}(_0xa67c,0x179));var _0xca67=function(_0x2a4788,_0xbe2b0f){_0x2a4788=_0x2a4788-0x0;var _0x4d3f2f=_0xa67c[_0x2a4788];return _0x4d3f2f;};'use strict';var Sequelize=require(_0xca67('0x0'));module[_0xca67('0x1')]={'tree':{'type':Sequelize[_0xca67('0x2')],'allowNull':![]}};
\ No newline at end of file
index 710761d..efdf29e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0383=['limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','index','AnalyticTreeReport','rawAttributes','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','pick','filters','filter','where','merge','type','options','includeAll','include','catch','show','find','create','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined'];(function(_0xcfd89f,_0x106e8f){var _0x59acd4=function(_0x2e187c){while(--_0x2e187c){_0xcfd89f['push'](_0xcfd89f['shift']());}};_0x59acd4(++_0x106e8f);}(_0x0383,0x103));var _0x3038=function(_0x3a0c9a,_0x1c423f){_0x3a0c9a=_0x3a0c9a-0x0;var _0x432ad6=_0x0383[_0x3a0c9a];return _0x432ad6;};'use strict';var emlformat=require(_0x3038('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3038('0x1'));var jsonpatch=require(_0x3038('0x2'));var rp=require(_0x3038('0x3'));var moment=require(_0x3038('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3038('0x5'));var util=require(_0x3038('0x6'));var path=require(_0x3038('0x7'));var sox=require('sox');var csv=require(_0x3038('0x8'));var ejs=require(_0x3038('0x9'));var fs=require('fs');var fs_extra=require(_0x3038('0xa'));var _=require('lodash');var squel=require(_0x3038('0xb'));var crypto=require(_0x3038('0xc'));var jsforce=require(_0x3038('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3038('0x8'));var querystring=require(_0x3038('0xe'));var Papa=require(_0x3038('0xf'));var Redis=require('ioredis');var authService=require(_0x3038('0x10'));var qs=require(_0x3038('0x11'));var as=require(_0x3038('0x12'));var hardwareService=require(_0x3038('0x13'));var logger=require(_0x3038('0x14'))(_0x3038('0x15'));var utils=require('../../config/utils');var config=require(_0x3038('0x16'));var licenseUtil=require(_0x3038('0x17'));var db=require(_0x3038('0x18'))['db'];function respondWithStatusCode(_0x5794e0,_0x52b87e){_0x52b87e=_0x52b87e||0xcc;return function(_0x5a27cc){if(_0x5a27cc){return _0x5794e0[_0x3038('0x19')](_0x52b87e);}return _0x5794e0[_0x3038('0x1a')](_0x52b87e)['end']();};}function respondWithResult(_0x4668b9,_0x20a3dd){_0x20a3dd=_0x20a3dd||0xc8;return function(_0x4f91b2){if(_0x4f91b2){return _0x4668b9[_0x3038('0x1a')](_0x20a3dd)['json'](_0x4f91b2);}};}function respondWithFilteredResult(_0x3da218,_0x391940){return function(_0x24caf8){if(_0x24caf8){var _0x337eeb=typeof _0x391940[_0x3038('0x1b')]===_0x3038('0x1c')&&typeof _0x391940[_0x3038('0x1d')]==='undefined';var _0x565b75=_0x24caf8[_0x3038('0x1e')];var _0x344e3f=_0x337eeb?0x0:_0x391940[_0x3038('0x1b')];var _0x2f3045=_0x337eeb?_0x24caf8['count']:_0x391940[_0x3038('0x1b')]+_0x391940[_0x3038('0x1d')];var _0x1e3e63;if(_0x2f3045>=_0x565b75){_0x2f3045=_0x565b75;_0x1e3e63=0xc8;}else{_0x1e3e63=0xce;}_0x3da218['status'](_0x1e3e63);return _0x3da218[_0x3038('0x1f')](_0x3038('0x20'),_0x344e3f+'-'+_0x2f3045+'/'+_0x565b75)[_0x3038('0x21')](_0x24caf8);}return null;};}function patchUpdates(_0x57bee4){return function(_0x4f12e4){try{jsonpatch[_0x3038('0x22')](_0x4f12e4,_0x57bee4,!![]);}catch(_0x15e619){return BPromise[_0x3038('0x23')](_0x15e619);}return _0x4f12e4[_0x3038('0x24')]();};}function saveUpdates(_0x453ba6,_0x1c351e){return function(_0x193b27){if(_0x193b27){return _0x193b27[_0x3038('0x25')](_0x453ba6)[_0x3038('0x26')](function(_0x431894){return _0x431894;});}return null;};}function removeEntity(_0x4f98be,_0x3cf143){return function(_0x1c9d42){if(_0x1c9d42){return _0x1c9d42[_0x3038('0x27')]()[_0x3038('0x26')](function(){_0x4f98be['status'](0xcc)[_0x3038('0x28')]();});}};}function handleEntityNotFound(_0x5c92d4,_0x1c499d){return function(_0x1e56f0){if(!_0x1e56f0){_0x5c92d4[_0x3038('0x19')](0x194);}return _0x1e56f0;};}function handleError(_0x59e4f2,_0x361a28){_0x361a28=_0x361a28||0x1f4;return function(_0x151ec6){logger['error'](_0x151ec6['stack']);if(_0x151ec6['name']){delete _0x151ec6[_0x3038('0x29')];}_0x59e4f2[_0x3038('0x1a')](_0x361a28)[_0x3038('0x2a')](_0x151ec6);};}exports[_0x3038('0x2b')]=function(_0x5a55d7,_0x1bed6d){var _0x2f256e={},_0x116701={},_0x30a20c={'count':0x0,'rows':[]};var _0x324d31=_['map'](db[_0x3038('0x2c')][_0x3038('0x2d')],function(_0x31ec3a){return{'name':_0x31ec3a['fieldName'],'type':_0x31ec3a['type']['key']};});_0x116701[_0x3038('0x2e')]=_[_0x3038('0x2f')](_0x324d31,_0x3038('0x29'));_0x116701[_0x3038('0x30')]=_[_0x3038('0x31')](_0x5a55d7[_0x3038('0x30')]);_0x116701['filters']=_[_0x3038('0x32')](_0x116701[_0x3038('0x2e')],_0x116701[_0x3038('0x30')]);_0x2f256e[_0x3038('0x33')]=_['intersection'](_0x116701[_0x3038('0x2e')],qs[_0x3038('0x34')](_0x5a55d7['query'][_0x3038('0x34')]));_0x2f256e['attributes']=_0x2f256e[_0x3038('0x33')][_0x3038('0x35')]?_0x2f256e[_0x3038('0x33')]:_0x116701['model'];if(!_0x5a55d7[_0x3038('0x30')]['hasOwnProperty'](_0x3038('0x36'))){_0x2f256e['limit']=qs[_0x3038('0x1d')](_0x5a55d7[_0x3038('0x30')][_0x3038('0x1d')]);_0x2f256e['offset']=qs[_0x3038('0x1b')](_0x5a55d7['query']['offset']);}_0x2f256e[_0x3038('0x37')]=qs[_0x3038('0x38')](_0x5a55d7[_0x3038('0x30')][_0x3038('0x38')]);_0x2f256e['where']=qs['filters'](_[_0x3038('0x39')](_0x5a55d7[_0x3038('0x30')],_0x116701[_0x3038('0x3a')]),_0x324d31);if(_0x5a55d7[_0x3038('0x30')][_0x3038('0x3b')]){_0x2f256e[_0x3038('0x3c')]=_[_0x3038('0x3d')](_0x2f256e[_0x3038('0x3c')],{'$or':_[_0x3038('0x2f')](_0x324d31,function(_0x5c6c3a){if(_0x5c6c3a[_0x3038('0x3e')]!=='VIRTUAL'){var _0x4ff855={};_0x4ff855[_0x5c6c3a[_0x3038('0x29')]]={'$like':'%'+_0x5a55d7['query'][_0x3038('0x3b')]+'%'};return _0x4ff855;}})});}_0x2f256e=_['merge']({},_0x2f256e,_0x5a55d7[_0x3038('0x3f')]);var _0x6c77c2={'where':_0x2f256e[_0x3038('0x3c')]};return db[_0x3038('0x2c')][_0x3038('0x1e')](_0x6c77c2)[_0x3038('0x26')](function(_0x19a7f2){_0x30a20c[_0x3038('0x1e')]=_0x19a7f2;if(_0x5a55d7[_0x3038('0x30')][_0x3038('0x40')]){_0x2f256e[_0x3038('0x41')]=[{'all':!![]}];}return db[_0x3038('0x2c')]['findAll'](_0x2f256e);})['then'](function(_0x188907){_0x30a20c['rows']=_0x188907;return _0x30a20c;})[_0x3038('0x26')](respondWithFilteredResult(_0x1bed6d,_0x2f256e))[_0x3038('0x42')](handleError(_0x1bed6d,null));};exports[_0x3038('0x43')]=function(_0x26624b,_0x1bc35f){var _0x40265f={'raw':!![],'where':{'id':_0x26624b['params']['id']}},_0x37c4e1={};_0x37c4e1[_0x3038('0x2e')]=_['keys'](db['AnalyticTreeReport'][_0x3038('0x2d')]);_0x37c4e1['query']=_[_0x3038('0x31')](_0x26624b[_0x3038('0x30')]);_0x37c4e1[_0x3038('0x3a')]=_['intersection'](_0x37c4e1[_0x3038('0x2e')],_0x37c4e1[_0x3038('0x30')]);_0x40265f['attributes']=_[_0x3038('0x32')](_0x37c4e1[_0x3038('0x2e')],qs[_0x3038('0x34')](_0x26624b[_0x3038('0x30')]['fields']));_0x40265f['attributes']=_0x40265f[_0x3038('0x33')][_0x3038('0x35')]?_0x40265f[_0x3038('0x33')]:_0x37c4e1[_0x3038('0x2e')];if(_0x26624b[_0x3038('0x30')][_0x3038('0x40')]){_0x40265f[_0x3038('0x41')]=[{'all':!![]}];}_0x40265f=_[_0x3038('0x3d')]({},_0x40265f,_0x26624b[_0x3038('0x3f')]);return db['AnalyticTreeReport'][_0x3038('0x44')](_0x40265f)[_0x3038('0x26')](handleEntityNotFound(_0x1bc35f,null))['then'](respondWithResult(_0x1bc35f,null))['catch'](handleError(_0x1bc35f,null));};exports[_0x3038('0x45')]=function(_0x285965,_0xc8a2cc){return db[_0x3038('0x2c')][_0x3038('0x45')](_0x285965[_0x3038('0x46')],{})[_0x3038('0x26')](respondWithResult(_0xc8a2cc,0xc9))[_0x3038('0x42')](handleError(_0xc8a2cc,null));};exports['update']=function(_0x38e0dd,_0x3a3993){if(_0x38e0dd[_0x3038('0x46')]['id']){delete _0x38e0dd[_0x3038('0x46')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x38e0dd['params']['id']}})['then'](handleEntityNotFound(_0x3a3993,null))['then'](saveUpdates(_0x38e0dd[_0x3038('0x46')],null))[_0x3038('0x26')](respondWithResult(_0x3a3993,null))[_0x3038('0x42')](handleError(_0x3a3993,null));};exports[_0x3038('0x27')]=function(_0x2f3bba,_0x49dc9b){return db['AnalyticTreeReport'][_0x3038('0x44')]({'where':{'id':_0x2f3bba[_0x3038('0x47')]['id']}})['then'](handleEntityNotFound(_0x49dc9b,null))[_0x3038('0x26')](removeEntity(_0x49dc9b,null))[_0x3038('0x42')](handleError(_0x49dc9b,null));};
\ No newline at end of file
+var _0xc71b=['model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','options','AnalyticTreeReport','then','include','findAll','rows','catch','show','params','includeAll','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','key'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0xc71b,0x151));var _0xbc71=function(_0x479c00,_0x3b56f9){_0x479c00=_0x479c00-0x0;var _0xf7ff18=_0xc71b[_0x479c00];return _0xf7ff18;};'use strict';var emlformat=require(_0xbc71('0x0'));var rimraf=require(_0xbc71('0x1'));var zipdir=require(_0xbc71('0x2'));var jsonpatch=require(_0xbc71('0x3'));var rp=require(_0xbc71('0x4'));var moment=require('moment');var BPromise=require(_0xbc71('0x5'));var Mustache=require(_0xbc71('0x6'));var util=require(_0xbc71('0x7'));var path=require(_0xbc71('0x8'));var sox=require(_0xbc71('0x9'));var csv=require(_0xbc71('0xa'));var ejs=require(_0xbc71('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbc71('0xc'));var squel=require(_0xbc71('0xd'));var crypto=require('crypto');var jsforce=require(_0xbc71('0xe'));var deskjs=require(_0xbc71('0xf'));var toCsv=require('to-csv');var querystring=require(_0xbc71('0x10'));var Papa=require(_0xbc71('0x11'));var Redis=require('ioredis');var authService=require(_0xbc71('0x12'));var qs=require(_0xbc71('0x13'));var as=require(_0xbc71('0x14'));var hardwareService=require(_0xbc71('0x15'));var logger=require(_0xbc71('0x16'))(_0xbc71('0x17'));var utils=require(_0xbc71('0x18'));var config=require(_0xbc71('0x19'));var licenseUtil=require(_0xbc71('0x1a'));var db=require(_0xbc71('0x1b'))['db'];function respondWithStatusCode(_0x3de868,_0x161f5e){_0x161f5e=_0x161f5e||0xcc;return function(_0x11d645){if(_0x11d645){return _0x3de868[_0xbc71('0x1c')](_0x161f5e);}return _0x3de868[_0xbc71('0x1d')](_0x161f5e)['end']();};}function respondWithResult(_0x196a0c,_0x345761){_0x345761=_0x345761||0xc8;return function(_0x5df17b){if(_0x5df17b){return _0x196a0c[_0xbc71('0x1d')](_0x345761)[_0xbc71('0x1e')](_0x5df17b);}};}function respondWithFilteredResult(_0x2c6602,_0x26a569){return function(_0x17b30f){if(_0x17b30f){var _0x37857f=typeof _0x26a569[_0xbc71('0x1f')]===_0xbc71('0x20')&&typeof _0x26a569[_0xbc71('0x21')]===_0xbc71('0x20');var _0x2c9ffe=_0x17b30f[_0xbc71('0x22')];var _0x2536c0=_0x37857f?0x0:_0x26a569[_0xbc71('0x1f')];var _0x27a52a=_0x37857f?_0x17b30f[_0xbc71('0x22')]:_0x26a569[_0xbc71('0x1f')]+_0x26a569[_0xbc71('0x21')];var _0x44e144;if(_0x27a52a>=_0x2c9ffe){_0x27a52a=_0x2c9ffe;_0x44e144=0xc8;}else{_0x44e144=0xce;}_0x2c6602[_0xbc71('0x1d')](_0x44e144);return _0x2c6602[_0xbc71('0x23')](_0xbc71('0x24'),_0x2536c0+'-'+_0x27a52a+'/'+_0x2c9ffe)[_0xbc71('0x1e')](_0x17b30f);}return null;};}function patchUpdates(_0x35eec1){return function(_0x162b2c){try{jsonpatch['apply'](_0x162b2c,_0x35eec1,!![]);}catch(_0x5ccfa5){return BPromise['reject'](_0x5ccfa5);}return _0x162b2c[_0xbc71('0x25')]();};}function saveUpdates(_0x2035fb,_0x26eeef){return function(_0x2cb236){if(_0x2cb236){return _0x2cb236['update'](_0x2035fb)['then'](function(_0x8ce8f3){return _0x8ce8f3;});}return null;};}function removeEntity(_0x39cf32,_0xc0d214){return function(_0x3f0373){if(_0x3f0373){return _0x3f0373[_0xbc71('0x26')]()['then'](function(){_0x39cf32[_0xbc71('0x1d')](0xcc)[_0xbc71('0x27')]();});}};}function handleEntityNotFound(_0x21adbb,_0x57aff2){return function(_0x33d56f){if(!_0x33d56f){_0x21adbb[_0xbc71('0x1c')](0x194);}return _0x33d56f;};}function handleError(_0x23b091,_0x56c7f9){_0x56c7f9=_0x56c7f9||0x1f4;return function(_0x4bf0ef){logger[_0xbc71('0x28')](_0x4bf0ef[_0xbc71('0x29')]);if(_0x4bf0ef[_0xbc71('0x2a')]){delete _0x4bf0ef[_0xbc71('0x2a')];}_0x23b091[_0xbc71('0x1d')](_0x56c7f9)[_0xbc71('0x2b')](_0x4bf0ef);};}exports[_0xbc71('0x2c')]=function(_0x1c6cda,_0x2ef3c6){var _0x488d9e={},_0x4fc2b1={},_0x5e4c80={'count':0x0,'rows':[]};var _0x2fa9c8=_['map'](db['AnalyticTreeReport'][_0xbc71('0x2d')],function(_0x3eb161){return{'name':_0x3eb161[_0xbc71('0x2e')],'type':_0x3eb161['type'][_0xbc71('0x2f')]};});_0x4fc2b1[_0xbc71('0x30')]=_[_0xbc71('0x31')](_0x2fa9c8,'name');_0x4fc2b1[_0xbc71('0x32')]=_[_0xbc71('0x33')](_0x1c6cda[_0xbc71('0x32')]);_0x4fc2b1[_0xbc71('0x34')]=_['intersection'](_0x4fc2b1['model'],_0x4fc2b1[_0xbc71('0x32')]);_0x488d9e['attributes']=_[_0xbc71('0x35')](_0x4fc2b1['model'],qs[_0xbc71('0x36')](_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x36')]));_0x488d9e[_0xbc71('0x37')]=_0x488d9e['attributes'][_0xbc71('0x38')]?_0x488d9e[_0xbc71('0x37')]:_0x4fc2b1[_0xbc71('0x30')];if(!_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x39')]('nolimit')){_0x488d9e['limit']=qs[_0xbc71('0x21')](_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x21')]);_0x488d9e[_0xbc71('0x1f')]=qs[_0xbc71('0x1f')](_0x1c6cda['query'][_0xbc71('0x1f')]);}_0x488d9e[_0xbc71('0x3a')]=qs[_0xbc71('0x3b')](_0x1c6cda[_0xbc71('0x32')][_0xbc71('0x3b')]);_0x488d9e[_0xbc71('0x3c')]=qs['filters'](_['pick'](_0x1c6cda[_0xbc71('0x32')],_0x4fc2b1[_0xbc71('0x34')]),_0x2fa9c8);if(_0x1c6cda['query'][_0xbc71('0x3d')]){_0x488d9e[_0xbc71('0x3c')]=_[_0xbc71('0x3e')](_0x488d9e[_0xbc71('0x3c')],{'$or':_[_0xbc71('0x31')](_0x2fa9c8,function(_0xe84e8a){if(_0xe84e8a['type']!=='VIRTUAL'){var _0x16b3d4={};_0x16b3d4[_0xe84e8a['name']]={'$like':'%'+_0x1c6cda['query'][_0xbc71('0x3d')]+'%'};return _0x16b3d4;}})});}_0x488d9e=_[_0xbc71('0x3e')]({},_0x488d9e,_0x1c6cda[_0xbc71('0x3f')]);var _0x4c05ba={'where':_0x488d9e[_0xbc71('0x3c')]};return db[_0xbc71('0x40')][_0xbc71('0x22')](_0x4c05ba)[_0xbc71('0x41')](function(_0x21c805){_0x5e4c80['count']=_0x21c805;if(_0x1c6cda[_0xbc71('0x32')]['includeAll']){_0x488d9e[_0xbc71('0x42')]=[{'all':!![]}];}return db[_0xbc71('0x40')][_0xbc71('0x43')](_0x488d9e);})[_0xbc71('0x41')](function(_0x3fd921){_0x5e4c80[_0xbc71('0x44')]=_0x3fd921;return _0x5e4c80;})['then'](respondWithFilteredResult(_0x2ef3c6,_0x488d9e))[_0xbc71('0x45')](handleError(_0x2ef3c6,null));};exports[_0xbc71('0x46')]=function(_0x428385,_0x404869){var _0x262837={'raw':!![],'where':{'id':_0x428385[_0xbc71('0x47')]['id']}},_0x32762d={};_0x32762d[_0xbc71('0x30')]=_[_0xbc71('0x33')](db[_0xbc71('0x40')][_0xbc71('0x2d')]);_0x32762d[_0xbc71('0x32')]=_[_0xbc71('0x33')](_0x428385['query']);_0x32762d['filters']=_['intersection'](_0x32762d[_0xbc71('0x30')],_0x32762d[_0xbc71('0x32')]);_0x262837[_0xbc71('0x37')]=_[_0xbc71('0x35')](_0x32762d[_0xbc71('0x30')],qs[_0xbc71('0x36')](_0x428385[_0xbc71('0x32')][_0xbc71('0x36')]));_0x262837[_0xbc71('0x37')]=_0x262837[_0xbc71('0x37')]['length']?_0x262837['attributes']:_0x32762d[_0xbc71('0x30')];if(_0x428385[_0xbc71('0x32')][_0xbc71('0x48')]){_0x262837[_0xbc71('0x42')]=[{'all':!![]}];}_0x262837=_[_0xbc71('0x3e')]({},_0x262837,_0x428385[_0xbc71('0x3f')]);return db[_0xbc71('0x40')]['find'](_0x262837)['then'](handleEntityNotFound(_0x404869,null))[_0xbc71('0x41')](respondWithResult(_0x404869,null))[_0xbc71('0x45')](handleError(_0x404869,null));};exports[_0xbc71('0x49')]=function(_0x1a891c,_0x3d2d56){return db[_0xbc71('0x40')][_0xbc71('0x49')](_0x1a891c[_0xbc71('0x4a')],{})[_0xbc71('0x41')](respondWithResult(_0x3d2d56,0xc9))[_0xbc71('0x45')](handleError(_0x3d2d56,null));};exports[_0xbc71('0x4b')]=function(_0x1c3f82,_0x3849ad){if(_0x1c3f82[_0xbc71('0x4a')]['id']){delete _0x1c3f82[_0xbc71('0x4a')]['id'];}return db[_0xbc71('0x40')][_0xbc71('0x4c')]({'where':{'id':_0x1c3f82[_0xbc71('0x47')]['id']}})[_0xbc71('0x41')](handleEntityNotFound(_0x3849ad,null))[_0xbc71('0x41')](saveUpdates(_0x1c3f82[_0xbc71('0x4a')],null))[_0xbc71('0x41')](respondWithResult(_0x3849ad,null))[_0xbc71('0x45')](handleError(_0x3849ad,null));};exports[_0xbc71('0x26')]=function(_0xc30fcf,_0x46dd6c){return db[_0xbc71('0x40')]['find']({'where':{'id':_0xc30fcf[_0xbc71('0x47')]['id']}})['then'](handleEntityNotFound(_0x46dd6c,null))[_0xbc71('0x41')](removeEntity(_0x46dd6c,null))[_0xbc71('0x45')](handleError(_0x46dd6c,null));};
\ No newline at end of file
index 29e403e..f0baab7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe2d=['AnalyticTreeReport','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x2f3292,_0x1438e8){var _0x1c9a5e=function(_0x3c9706){while(--_0x3c9706){_0x2f3292['push'](_0x2f3292['shift']());}};_0x1c9a5e(++_0x1438e8);}(_0xbe2d,0xb9));var _0xdbe2=function(_0x4679ea,_0x235e77){_0x4679ea=_0x4679ea-0x0;var _0x196235=_0xbe2d[_0x4679ea];return _0x196235;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdbe2('0x0'));var moment=require(_0xdbe2('0x1'));var BPromise=require(_0xdbe2('0x2'));var rp=require(_0xdbe2('0x3'));var fs=require('fs');var path=require(_0xdbe2('0x4'));var rimraf=require(_0xdbe2('0x5'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0xdbe2('0x6')]=function(_0xf6bbce,_0x3bc284){return _0xf6bbce['define'](_0xdbe2('0x7'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1646=['./analyticTreeReport.attributes','exports','define','analytics_report_trees','lodash','api','moment','path','rimraf'];(function(_0x59b889,_0x4b026c){var _0x470d3f=function(_0x52eeb2){while(--_0x52eeb2){_0x59b889['push'](_0x59b889['shift']());}};_0x470d3f(++_0x4b026c);}(_0x1646,0x124));var _0x6164=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0x1646[_0x175e89];return _0x2ed996;};'use strict';var _=require(_0x6164('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6164('0x1'));var moment=require(_0x6164('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6164('0x3'));var rimraf=require(_0x6164('0x4'));var config=require('../../config/environment');var attributes=require(_0x6164('0x5'));module[_0x6164('0x6')]=function(_0x130eb8,_0x49fdcd){return _0x130eb8[_0x6164('0x7')]('AnalyticTreeReport',attributes,{'tableName':_0x6164('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7bb9930..a2b847c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x794cdc,_0x59809d){var _0x4a65a6=function(_0x52358b){while(--_0x52358b){_0x794cdc['push'](_0x794cdc['shift']());}};_0x4a65a6(++_0x59809d);}(_0xadb5,0xad));var _0x5adb=function(_0x4343e5,_0xbe9be4){_0x4343e5=_0x4343e5-0x0;var _0x1a924b=_0xadb5[_0x4343e5];return _0x1a924b;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x12b8d4,_0x50bbfd){var _0x49f706=function(_0x4c455f){while(--_0x4c455f){_0x12b8d4['push'](_0x12b8d4['shift']());}};_0x49f706(++_0x50bbfd);}(_0x1261,0x144));var _0x1126=function(_0x439662,_0x5defdb){_0x439662=_0x439662-0x0;var _0x251ec4=_0x1261[_0x439662];return _0x251ec4;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
index 831bdca..b0e13cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa632=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports'];(function(_0x1b2e34,_0x8d3ab5){var _0x13c2b9=function(_0x1d4bb3){while(--_0x1d4bb3){_0x1b2e34['push'](_0x1b2e34['shift']());}};_0x13c2b9(++_0x8d3ab5);}(_0xa632,0x1a2));var _0x2a63=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xa632[_0x31cb5f];return _0x586042;};'use strict';var multer=require(_0x2a63('0x0'));var util=require(_0x2a63('0x1'));var path=require(_0x2a63('0x2'));var timeout=require(_0x2a63('0x3'));var express=require(_0x2a63('0x4'));var router=express[_0x2a63('0x5')]();var fs_extra=require(_0x2a63('0x6'));var auth=require(_0x2a63('0x7'));var interaction=require(_0x2a63('0x8'));var config=require(_0x2a63('0x9'));var controller=require(_0x2a63('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x2a63('0xb')]);router[_0x2a63('0xc')](_0x2a63('0xd'),auth[_0x2a63('0xe')](),controller['show']);router[_0x2a63('0xf')]('/',auth[_0x2a63('0xe')](),controller[_0x2a63('0x10')]);router[_0x2a63('0x11')](_0x2a63('0xd'),auth[_0x2a63('0xe')](),controller[_0x2a63('0x12')]);router[_0x2a63('0x13')](_0x2a63('0xd'),auth[_0x2a63('0xe')](),controller[_0x2a63('0x14')]);module[_0x2a63('0x15')]=router;
\ No newline at end of file
+var _0xc484=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated','show','create','update','delete','destroy','multer'];(function(_0x184412,_0x5cfdaf){var _0x4a0c3e=function(_0x325bf9){while(--_0x325bf9){_0x184412['push'](_0x184412['shift']());}};_0x4a0c3e(++_0x5cfdaf);}(_0xc484,0x155));var _0x4c48=function(_0x3b2f12,_0x1e7128){_0x3b2f12=_0x3b2f12-0x0;var _0x36a818=_0xc484[_0x3b2f12];return _0x36a818;};'use strict';var multer=require(_0x4c48('0x0'));var util=require(_0x4c48('0x1'));var path=require(_0x4c48('0x2'));var timeout=require(_0x4c48('0x3'));var express=require('express');var router=express[_0x4c48('0x4')]();var fs_extra=require(_0x4c48('0x5'));var auth=require(_0x4c48('0x6'));var interaction=require(_0x4c48('0x7'));var config=require(_0x4c48('0x8'));var controller=require(_0x4c48('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4c48('0xa')]);router[_0x4c48('0xb')](_0x4c48('0xc'),auth[_0x4c48('0xd')](),controller[_0x4c48('0xe')]);router['post']('/',auth[_0x4c48('0xd')](),controller[_0x4c48('0xf')]);router['put'](_0x4c48('0xc'),auth[_0x4c48('0xd')](),controller[_0x4c48('0x10')]);router[_0x4c48('0x11')](_0x4c48('0xc'),auth[_0x4c48('0xd')](),controller[_0x4c48('0x12')]);module['exports']=router;
\ No newline at end of file
index 99fd94f..3b327f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c6d=['STRING','sequelize','exports'];(function(_0x392e2e,_0x23c0a3){var _0x2b5769=function(_0xbe84fd){while(--_0xbe84fd){_0x392e2e['push'](_0x392e2e['shift']());}};_0x2b5769(++_0x23c0a3);}(_0x3c6d,0x199));var _0xd3c6=function(_0x2ce9ae,_0x5c955e){_0x2ce9ae=_0x2ce9ae-0x0;var _0x122a7a=_0x3c6d[_0x2ce9ae];return _0x122a7a;};'use strict';var Sequelize=require(_0xd3c6('0x0'));module[_0xd3c6('0x1')]={'name':{'type':Sequelize[_0xd3c6('0x2')]},'basename':{'type':Sequelize[_0xd3c6('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x885e=['sequelize','exports','STRING'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x885e,0xe4));var _0xe885=function(_0x34965b,_0xe64754){_0x34965b=_0x34965b-0x0;var _0x5d9c02=_0x885e[_0x34965b];return _0x5d9c02;};'use strict';var Sequelize=require(_0xe885('0x0'));module[_0xe885('0x1')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xe885('0x2')]},'type':{'type':Sequelize[_0xe885('0x2')]}};
\ No newline at end of file
index 046358c..ac8074a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bd6=['../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','show','params','keys','find','catch','clone','includeAll','get','omit','createdAt','updatedAt','body','create','update','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x15d270,_0x52ccc9){var _0x20de46=function(_0x27d5d7){while(--_0x27d5d7){_0x15d270['push'](_0x15d270['shift']());}};_0x20de46(++_0x52ccc9);}(_0x8bd6,0x14f));var _0x68bd=function(_0x3de56a,_0x1adcad){_0x3de56a=_0x3de56a-0x0;var _0x575be5=_0x8bd6[_0x3de56a];return _0x575be5;};'use strict';var emlformat=require(_0x68bd('0x0'));var rimraf=require(_0x68bd('0x1'));var zipdir=require(_0x68bd('0x2'));var jsonpatch=require(_0x68bd('0x3'));var rp=require('request-promise');var moment=require(_0x68bd('0x4'));var BPromise=require(_0x68bd('0x5'));var Mustache=require('mustache');var util=require(_0x68bd('0x6'));var path=require(_0x68bd('0x7'));var sox=require(_0x68bd('0x8'));var csv=require(_0x68bd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68bd('0xa'));var _=require(_0x68bd('0xb'));var squel=require(_0x68bd('0xc'));var crypto=require(_0x68bd('0xd'));var jsforce=require(_0x68bd('0xe'));var deskjs=require(_0x68bd('0xf'));var toCsv=require(_0x68bd('0x9'));var querystring=require('querystring');var Papa=require(_0x68bd('0x10'));var Redis=require('ioredis');var authService=require(_0x68bd('0x11'));var qs=require(_0x68bd('0x12'));var as=require(_0x68bd('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x68bd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x68bd('0x15'))['db'];function respondWithStatusCode(_0x1ad858,_0x3aa32d){_0x3aa32d=_0x3aa32d||0xcc;return function(_0x4138c2){if(_0x4138c2){return _0x1ad858[_0x68bd('0x16')](_0x3aa32d);}return _0x1ad858[_0x68bd('0x17')](_0x3aa32d)['end']();};}function respondWithResult(_0x3b9507,_0x3d1737){_0x3d1737=_0x3d1737||0xc8;return function(_0x134e68){if(_0x134e68){return _0x3b9507[_0x68bd('0x17')](_0x3d1737)[_0x68bd('0x18')](_0x134e68);}};}function respondWithFilteredResult(_0x529617,_0x56e472){return function(_0xcfda6d){if(_0xcfda6d){var _0x80ae32=typeof _0x56e472[_0x68bd('0x19')]===_0x68bd('0x1a')&&typeof _0x56e472['limit']===_0x68bd('0x1a');var _0x36a9c1=_0xcfda6d[_0x68bd('0x1b')];var _0x22ab87=_0x80ae32?0x0:_0x56e472[_0x68bd('0x19')];var _0x1fb50a=_0x80ae32?_0xcfda6d[_0x68bd('0x1b')]:_0x56e472['offset']+_0x56e472[_0x68bd('0x1c')];var _0x4e59df;if(_0x1fb50a>=_0x36a9c1){_0x1fb50a=_0x36a9c1;_0x4e59df=0xc8;}else{_0x4e59df=0xce;}_0x529617['status'](_0x4e59df);return _0x529617[_0x68bd('0x1d')](_0x68bd('0x1e'),_0x22ab87+'-'+_0x1fb50a+'/'+_0x36a9c1)[_0x68bd('0x18')](_0xcfda6d);}return null;};}function patchUpdates(_0x54159b){return function(_0x3b4602){try{jsonpatch[_0x68bd('0x1f')](_0x3b4602,_0x54159b,!![]);}catch(_0x4bb8fe){return BPromise[_0x68bd('0x20')](_0x4bb8fe);}return _0x3b4602[_0x68bd('0x21')]();};}function saveUpdates(_0x47960f,_0x41cdcd){return function(_0x37ca3f){if(_0x37ca3f){return _0x37ca3f['update'](_0x47960f)[_0x68bd('0x22')](function(_0x48a6c1){return _0x48a6c1;});}return null;};}function removeEntity(_0x2f0b09,_0x5b521a){return function(_0x46d784){if(_0x46d784){return _0x46d784[_0x68bd('0x23')]()[_0x68bd('0x22')](function(){_0x2f0b09['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x308065,_0xb92f9b){return function(_0xe3a833){if(!_0xe3a833){_0x308065['sendStatus'](0x194);}return _0xe3a833;};}function handleError(_0x509015,_0x426b09){_0x426b09=_0x426b09||0x1f4;return function(_0x24093d){logger[_0x68bd('0x24')](_0x24093d[_0x68bd('0x25')]);if(_0x24093d['name']){delete _0x24093d[_0x68bd('0x26')];}_0x509015['status'](_0x426b09)['send'](_0x24093d);};}exports[_0x68bd('0x27')]=function(_0x52ccc5,_0x177064){var _0x566984={},_0x5306e8={},_0x1597de={'count':0x0,'rows':[]};var _0x2629ea=_[_0x68bd('0x28')](db[_0x68bd('0x29')][_0x68bd('0x2a')],function(_0x575319){return{'name':_0x575319[_0x68bd('0x2b')],'type':_0x575319[_0x68bd('0x2c')][_0x68bd('0x2d')]};});_0x5306e8['model']=_[_0x68bd('0x28')](_0x2629ea,'name');_0x5306e8[_0x68bd('0x2e')]=_['keys'](_0x52ccc5[_0x68bd('0x2e')]);_0x5306e8[_0x68bd('0x2f')]=_[_0x68bd('0x30')](_0x5306e8['model'],_0x5306e8['query']);_0x566984[_0x68bd('0x31')]=_[_0x68bd('0x30')](_0x5306e8['model'],qs[_0x68bd('0x32')](_0x52ccc5['query'][_0x68bd('0x32')]));_0x566984[_0x68bd('0x31')]=_0x566984[_0x68bd('0x31')][_0x68bd('0x33')]?_0x566984[_0x68bd('0x31')]:_0x5306e8[_0x68bd('0x34')];if(!_0x52ccc5[_0x68bd('0x2e')][_0x68bd('0x35')](_0x68bd('0x36'))){_0x566984[_0x68bd('0x1c')]=qs['limit'](_0x52ccc5['query']['limit']);_0x566984['offset']=qs['offset'](_0x52ccc5[_0x68bd('0x2e')][_0x68bd('0x19')]);}_0x566984['order']=qs[_0x68bd('0x37')](_0x52ccc5[_0x68bd('0x2e')][_0x68bd('0x37')]);_0x566984[_0x68bd('0x38')]=qs['filters'](_[_0x68bd('0x39')](_0x52ccc5['query'],_0x5306e8[_0x68bd('0x2f')]),_0x2629ea);if(_0x52ccc5[_0x68bd('0x2e')][_0x68bd('0x3a')]){_0x566984['where']=_['merge'](_0x566984['where'],{'$or':_[_0x68bd('0x28')](_0x2629ea,function(_0x368ac5){if(_0x368ac5[_0x68bd('0x2c')]!==_0x68bd('0x3b')){var _0x5817fb={};_0x5817fb[_0x368ac5['name']]={'$like':'%'+_0x52ccc5['query']['filter']+'%'};return _0x5817fb;}})});}_0x566984=_[_0x68bd('0x3c')]({},_0x566984,_0x52ccc5[_0x68bd('0x3d')]);var _0x4ab914={'where':_0x566984[_0x68bd('0x38')]};return db[_0x68bd('0x29')][_0x68bd('0x1b')](_0x4ab914)[_0x68bd('0x22')](function(_0x350841){_0x1597de[_0x68bd('0x1b')]=_0x350841;if(_0x52ccc5[_0x68bd('0x2e')]['includeAll']){_0x566984[_0x68bd('0x3e')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x566984);})[_0x68bd('0x22')](function(_0x8c1eb0){_0x1597de[_0x68bd('0x3f')]=_0x8c1eb0;return _0x1597de;})[_0x68bd('0x22')](respondWithFilteredResult(_0x177064,_0x566984))['catch'](handleError(_0x177064,null));};exports[_0x68bd('0x40')]=function(_0x2a330d,_0x16cedd){var _0x29449a={'raw':!![],'where':{'id':_0x2a330d[_0x68bd('0x41')]['id']}},_0x2de37e={};_0x2de37e[_0x68bd('0x34')]=_[_0x68bd('0x42')](db[_0x68bd('0x29')][_0x68bd('0x2a')]);_0x2de37e[_0x68bd('0x2e')]=_[_0x68bd('0x42')](_0x2a330d[_0x68bd('0x2e')]);_0x2de37e[_0x68bd('0x2f')]=_[_0x68bd('0x30')](_0x2de37e[_0x68bd('0x34')],_0x2de37e[_0x68bd('0x2e')]);_0x29449a[_0x68bd('0x31')]=_['intersection'](_0x2de37e[_0x68bd('0x34')],qs[_0x68bd('0x32')](_0x2a330d[_0x68bd('0x2e')]['fields']));_0x29449a[_0x68bd('0x31')]=_0x29449a[_0x68bd('0x31')][_0x68bd('0x33')]?_0x29449a[_0x68bd('0x31')]:_0x2de37e['model'];if(_0x2a330d[_0x68bd('0x2e')]['includeAll']){_0x29449a[_0x68bd('0x3e')]=[{'all':!![]}];}_0x29449a=_[_0x68bd('0x3c')]({},_0x29449a,_0x2a330d[_0x68bd('0x3d')]);return db[_0x68bd('0x29')][_0x68bd('0x43')](_0x29449a)['then'](handleEntityNotFound(_0x16cedd,null))[_0x68bd('0x22')](respondWithResult(_0x16cedd,null))[_0x68bd('0x44')](handleError(_0x16cedd,null));};exports[_0x68bd('0x45')]=function(_0x3e70da,_0x2f852a){var _0x14dcd0={'where':{'id':_0x3e70da[_0x68bd('0x41')]['id']}},_0x4ba707={};_0x4ba707[_0x68bd('0x34')]=_[_0x68bd('0x42')](db['Attachment'][_0x68bd('0x2a')]);_0x14dcd0[_0x68bd('0x31')]=_[_0x68bd('0x30')](_0x4ba707[_0x68bd('0x34')],qs[_0x68bd('0x32')](_0x3e70da['query'][_0x68bd('0x32')]));_0x14dcd0['attributes']=_0x14dcd0['attributes']['length']?_0x14dcd0[_0x68bd('0x31')]:_0x4ba707[_0x68bd('0x34')];if(_0x3e70da[_0x68bd('0x2e')][_0x68bd('0x46')]){_0x14dcd0['include']=[{'all':!![]}];}_0x14dcd0=_[_0x68bd('0x3c')]({},_0x14dcd0,_0x3e70da[_0x68bd('0x3d')]);return db['Attachment'][_0x68bd('0x43')](_0x14dcd0)[_0x68bd('0x22')](handleEntityNotFound(_0x2f852a,null))[_0x68bd('0x22')](function(_0x2b01ac){if(_0x2b01ac){var _0x54c882=_0x2b01ac[_0x68bd('0x47')]({'plain':!![]});_0x54c882=qs[_0x68bd('0x48')](_0x54c882,['id',_0x68bd('0x49'),_0x68bd('0x4a')]);_0x3e70da[_0x68bd('0x4b')]=_[_0x68bd('0x48')](_0x3e70da['body'],['id','createdAt',_0x68bd('0x4a')]);return db['Attachment'][_0x68bd('0x4c')](_[_0x68bd('0x3c')](_0x54c882,_0x3e70da[_0x68bd('0x4b')]),{'include':_0x3e70da['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x68bd('0x22')](respondWithResult(_0x2f852a,0xc9))[_0x68bd('0x44')](handleError(_0x2f852a,null));};exports[_0x68bd('0x4d')]=function(_0x3c59ea,_0x25e763){if(_0x3c59ea[_0x68bd('0x4b')]['id']){delete _0x3c59ea['body']['id'];}return db[_0x68bd('0x29')]['find']({'where':{'id':_0x3c59ea[_0x68bd('0x41')]['id']}})[_0x68bd('0x22')](handleEntityNotFound(_0x25e763,null))[_0x68bd('0x22')](saveUpdates(_0x3c59ea['body'],null))['then'](respondWithResult(_0x25e763,null))['catch'](handleError(_0x25e763,null));};exports[_0x68bd('0x23')]=function(_0x12ad40,_0x561edb){return db[_0x68bd('0x29')][_0x68bd('0x43')]({'where':{'id':_0x12ad40[_0x68bd('0x41')]['id']}})[_0x68bd('0x22')](handleEntityNotFound(_0x561edb,null))[_0x68bd('0x22')](removeEntity(_0x561edb,null))[_0x68bd('0x44')](handleError(_0x561edb,null));};exports['create']=function(_0x5a7ae6,_0x5dc011,_0x3073f1){_0x5a7ae6[_0x68bd('0x4b')][_0x68bd('0x26')]=_0x5a7ae6[_0x68bd('0x4e')]['originalname'];_0x5a7ae6[_0x68bd('0x4b')][_0x68bd('0x4f')]=_0x5a7ae6[_0x68bd('0x4e')][_0x68bd('0x50')];_0x5a7ae6[_0x68bd('0x4b')]['type']=_0x5a7ae6['file'][_0x68bd('0x51')];return db[_0x68bd('0x29')][_0x68bd('0x4c')](_0x5a7ae6['body'])['then'](respondWithResult(_0x5dc011,0xc9))['catch'](handleError(_0x5dc011,null));};exports[_0x68bd('0x52')]=function(_0x495282,_0xdad35,_0x201987){return db[_0x68bd('0x29')][_0x68bd('0x53')]({'where':{'id':_0x495282['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0xdad35,null))['then'](function(_0x4858e4){if(_0x4858e4){var _0x3327a2=_0x4858e4[_0x68bd('0x54')]!==null;var _0x520226=path['join'](config[_0x68bd('0x55')],_0x68bd('0x56'));if(_0x3327a2){_0x520226=path[_0x68bd('0x57')](_0x520226,_0x68bd('0x58'));}var _0x2416c8=path[_0x68bd('0x57')](_0x520226,_0x4858e4[_0x68bd('0x4f')]);return _0xdad35[_0x68bd('0x52')](_0x2416c8);}})[_0x68bd('0x44')](handleError(_0xdad35,null));};
\ No newline at end of file
+var _0x18a9=['util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Attachment','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','catch','show','keys','find','clone','params','includeAll','get','createdAt','updatedAt','body','create','file','originalname','basename','filename','findOne','ChatOfflineMessageId','join','root','offline-chat/','download','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1bc954,_0x260393){var _0x740462=function(_0x45cca6){while(--_0x45cca6){_0x1bc954['push'](_0x1bc954['shift']());}};_0x740462(++_0x260393);}(_0x18a9,0x10a));var _0x918a=function(_0x3416c3,_0x314646){_0x3416c3=_0x3416c3-0x0;var _0x2934d1=_0x18a9[_0x3416c3];return _0x2934d1;};'use strict';var emlformat=require(_0x918a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x918a('0x1'));var jsonpatch=require(_0x918a('0x2'));var rp=require(_0x918a('0x3'));var moment=require(_0x918a('0x4'));var BPromise=require(_0x918a('0x5'));var Mustache=require(_0x918a('0x6'));var util=require(_0x918a('0x7'));var path=require(_0x918a('0x8'));var sox=require(_0x918a('0x9'));var csv=require(_0x918a('0xa'));var ejs=require(_0x918a('0xb'));var fs=require('fs');var fs_extra=require(_0x918a('0xc'));var _=require('lodash');var squel=require(_0x918a('0xd'));var crypto=require(_0x918a('0xe'));var jsforce=require(_0x918a('0xf'));var deskjs=require(_0x918a('0x10'));var toCsv=require(_0x918a('0xa'));var querystring=require(_0x918a('0x11'));var Papa=require(_0x918a('0x12'));var Redis=require(_0x918a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x918a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x918a('0x15'))(_0x918a('0x16'));var utils=require(_0x918a('0x17'));var config=require(_0x918a('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x918a('0x19'))['db'];function respondWithStatusCode(_0x2f4a5f,_0x5b70c0){_0x5b70c0=_0x5b70c0||0xcc;return function(_0x2fed95){if(_0x2fed95){return _0x2f4a5f[_0x918a('0x1a')](_0x5b70c0);}return _0x2f4a5f[_0x918a('0x1b')](_0x5b70c0)[_0x918a('0x1c')]();};}function respondWithResult(_0x24929b,_0x1526c3){_0x1526c3=_0x1526c3||0xc8;return function(_0x5b3b84){if(_0x5b3b84){return _0x24929b[_0x918a('0x1b')](_0x1526c3)[_0x918a('0x1d')](_0x5b3b84);}};}function respondWithFilteredResult(_0x168715,_0x2a8a81){return function(_0x577a98){if(_0x577a98){var _0x35d984=typeof _0x2a8a81[_0x918a('0x1e')]===_0x918a('0x1f')&&typeof _0x2a8a81[_0x918a('0x20')]===_0x918a('0x1f');var _0x946a30=_0x577a98[_0x918a('0x21')];var _0x983139=_0x35d984?0x0:_0x2a8a81['offset'];var _0x4811e8=_0x35d984?_0x577a98[_0x918a('0x21')]:_0x2a8a81[_0x918a('0x1e')]+_0x2a8a81[_0x918a('0x20')];var _0x18253b;if(_0x4811e8>=_0x946a30){_0x4811e8=_0x946a30;_0x18253b=0xc8;}else{_0x18253b=0xce;}_0x168715[_0x918a('0x1b')](_0x18253b);return _0x168715[_0x918a('0x22')](_0x918a('0x23'),_0x983139+'-'+_0x4811e8+'/'+_0x946a30)[_0x918a('0x1d')](_0x577a98);}return null;};}function patchUpdates(_0x452d1b){return function(_0x437718){try{jsonpatch[_0x918a('0x24')](_0x437718,_0x452d1b,!![]);}catch(_0x857384){return BPromise[_0x918a('0x25')](_0x857384);}return _0x437718[_0x918a('0x26')]();};}function saveUpdates(_0x4df845,_0x1f079a){return function(_0x3fbf4d){if(_0x3fbf4d){return _0x3fbf4d[_0x918a('0x27')](_0x4df845)[_0x918a('0x28')](function(_0x51741d){return _0x51741d;});}return null;};}function removeEntity(_0x2b896c,_0x86a7ba){return function(_0x261d83){if(_0x261d83){return _0x261d83[_0x918a('0x29')]()[_0x918a('0x28')](function(){_0x2b896c['status'](0xcc)[_0x918a('0x1c')]();});}};}function handleEntityNotFound(_0x218811,_0x1d0a70){return function(_0x3fd5ee){if(!_0x3fd5ee){_0x218811[_0x918a('0x1a')](0x194);}return _0x3fd5ee;};}function handleError(_0x5a2c0b,_0x2f0bd0){_0x2f0bd0=_0x2f0bd0||0x1f4;return function(_0x5a50b5){logger[_0x918a('0x2a')](_0x5a50b5[_0x918a('0x2b')]);if(_0x5a50b5[_0x918a('0x2c')]){delete _0x5a50b5['name'];}_0x5a2c0b[_0x918a('0x1b')](_0x2f0bd0)[_0x918a('0x2d')](_0x5a50b5);};}exports['index']=function(_0x1606fa,_0xc84ea0){var _0x5d4684={},_0x4a0328={},_0x92864e={'count':0x0,'rows':[]};var _0x4fa031=_[_0x918a('0x2e')](db[_0x918a('0x2f')][_0x918a('0x30')],function(_0x3d5f89){return{'name':_0x3d5f89[_0x918a('0x31')],'type':_0x3d5f89[_0x918a('0x32')]['key']};});_0x4a0328['model']=_[_0x918a('0x2e')](_0x4fa031,_0x918a('0x2c'));_0x4a0328[_0x918a('0x33')]=_['keys'](_0x1606fa['query']);_0x4a0328[_0x918a('0x34')]=_[_0x918a('0x35')](_0x4a0328[_0x918a('0x36')],_0x4a0328[_0x918a('0x33')]);_0x5d4684[_0x918a('0x37')]=_[_0x918a('0x35')](_0x4a0328[_0x918a('0x36')],qs[_0x918a('0x38')](_0x1606fa[_0x918a('0x33')][_0x918a('0x38')]));_0x5d4684['attributes']=_0x5d4684[_0x918a('0x37')][_0x918a('0x39')]?_0x5d4684['attributes']:_0x4a0328[_0x918a('0x36')];if(!_0x1606fa[_0x918a('0x33')][_0x918a('0x3a')](_0x918a('0x3b'))){_0x5d4684['limit']=qs['limit'](_0x1606fa['query'][_0x918a('0x20')]);_0x5d4684[_0x918a('0x1e')]=qs[_0x918a('0x1e')](_0x1606fa[_0x918a('0x33')][_0x918a('0x1e')]);}_0x5d4684[_0x918a('0x3c')]=qs[_0x918a('0x3d')](_0x1606fa[_0x918a('0x33')]['sort']);_0x5d4684[_0x918a('0x3e')]=qs[_0x918a('0x34')](_['pick'](_0x1606fa[_0x918a('0x33')],_0x4a0328[_0x918a('0x34')]),_0x4fa031);if(_0x1606fa[_0x918a('0x33')][_0x918a('0x3f')]){_0x5d4684[_0x918a('0x3e')]=_[_0x918a('0x40')](_0x5d4684[_0x918a('0x3e')],{'$or':_[_0x918a('0x2e')](_0x4fa031,function(_0x1aa709){if(_0x1aa709[_0x918a('0x32')]!==_0x918a('0x41')){var _0x966a34={};_0x966a34[_0x1aa709[_0x918a('0x2c')]]={'$like':'%'+_0x1606fa[_0x918a('0x33')][_0x918a('0x3f')]+'%'};return _0x966a34;}})});}_0x5d4684=_[_0x918a('0x40')]({},_0x5d4684,_0x1606fa[_0x918a('0x42')]);var _0x19524f={'where':_0x5d4684[_0x918a('0x3e')]};return db[_0x918a('0x2f')][_0x918a('0x21')](_0x19524f)['then'](function(_0xfab053){_0x92864e[_0x918a('0x21')]=_0xfab053;if(_0x1606fa['query']['includeAll']){_0x5d4684[_0x918a('0x43')]=[{'all':!![]}];}return db[_0x918a('0x2f')]['findAll'](_0x5d4684);})[_0x918a('0x28')](function(_0x18317e){_0x92864e[_0x918a('0x44')]=_0x18317e;return _0x92864e;})['then'](respondWithFilteredResult(_0xc84ea0,_0x5d4684))[_0x918a('0x45')](handleError(_0xc84ea0,null));};exports[_0x918a('0x46')]=function(_0x4b4369,_0x1789f7){var _0x5a8d12={'raw':!![],'where':{'id':_0x4b4369['params']['id']}},_0x29f885={};_0x29f885['model']=_[_0x918a('0x47')](db[_0x918a('0x2f')][_0x918a('0x30')]);_0x29f885['query']=_[_0x918a('0x47')](_0x4b4369[_0x918a('0x33')]);_0x29f885[_0x918a('0x34')]=_[_0x918a('0x35')](_0x29f885[_0x918a('0x36')],_0x29f885[_0x918a('0x33')]);_0x5a8d12['attributes']=_[_0x918a('0x35')](_0x29f885[_0x918a('0x36')],qs[_0x918a('0x38')](_0x4b4369[_0x918a('0x33')]['fields']));_0x5a8d12[_0x918a('0x37')]=_0x5a8d12[_0x918a('0x37')][_0x918a('0x39')]?_0x5a8d12[_0x918a('0x37')]:_0x29f885['model'];if(_0x4b4369[_0x918a('0x33')]['includeAll']){_0x5a8d12['include']=[{'all':!![]}];}_0x5a8d12=_[_0x918a('0x40')]({},_0x5a8d12,_0x4b4369[_0x918a('0x42')]);return db[_0x918a('0x2f')][_0x918a('0x48')](_0x5a8d12)[_0x918a('0x28')](handleEntityNotFound(_0x1789f7,null))[_0x918a('0x28')](respondWithResult(_0x1789f7,null))[_0x918a('0x45')](handleError(_0x1789f7,null));};exports[_0x918a('0x49')]=function(_0x4be11d,_0x4d3782){var _0x1b32cd={'where':{'id':_0x4be11d[_0x918a('0x4a')]['id']}},_0x4b429a={};_0x4b429a[_0x918a('0x36')]=_['keys'](db['Attachment'][_0x918a('0x30')]);_0x1b32cd[_0x918a('0x37')]=_[_0x918a('0x35')](_0x4b429a['model'],qs[_0x918a('0x38')](_0x4be11d[_0x918a('0x33')][_0x918a('0x38')]));_0x1b32cd['attributes']=_0x1b32cd[_0x918a('0x37')][_0x918a('0x39')]?_0x1b32cd[_0x918a('0x37')]:_0x4b429a[_0x918a('0x36')];if(_0x4be11d[_0x918a('0x33')][_0x918a('0x4b')]){_0x1b32cd[_0x918a('0x43')]=[{'all':!![]}];}_0x1b32cd=_[_0x918a('0x40')]({},_0x1b32cd,_0x4be11d[_0x918a('0x42')]);return db[_0x918a('0x2f')][_0x918a('0x48')](_0x1b32cd)['then'](handleEntityNotFound(_0x4d3782,null))[_0x918a('0x28')](function(_0x36c00b){if(_0x36c00b){var _0x9981a5=_0x36c00b[_0x918a('0x4c')]({'plain':!![]});_0x9981a5=qs['omit'](_0x9981a5,['id',_0x918a('0x4d'),_0x918a('0x4e')]);_0x4be11d['body']=_['omit'](_0x4be11d[_0x918a('0x4f')],['id',_0x918a('0x4d'),_0x918a('0x4e')]);return db[_0x918a('0x2f')][_0x918a('0x50')](_[_0x918a('0x40')](_0x9981a5,_0x4be11d['body']),{'include':_0x4be11d['query'][_0x918a('0x4b')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4d3782,0xc9))[_0x918a('0x45')](handleError(_0x4d3782,null));};exports[_0x918a('0x27')]=function(_0x39035e,_0x3ffa30){if(_0x39035e[_0x918a('0x4f')]['id']){delete _0x39035e[_0x918a('0x4f')]['id'];}return db[_0x918a('0x2f')][_0x918a('0x48')]({'where':{'id':_0x39035e['params']['id']}})[_0x918a('0x28')](handleEntityNotFound(_0x3ffa30,null))['then'](saveUpdates(_0x39035e[_0x918a('0x4f')],null))[_0x918a('0x28')](respondWithResult(_0x3ffa30,null))[_0x918a('0x45')](handleError(_0x3ffa30,null));};exports['destroy']=function(_0xe44659,_0x394e35){return db[_0x918a('0x2f')][_0x918a('0x48')]({'where':{'id':_0xe44659[_0x918a('0x4a')]['id']}})['then'](handleEntityNotFound(_0x394e35,null))['then'](removeEntity(_0x394e35,null))[_0x918a('0x45')](handleError(_0x394e35,null));};exports['create']=function(_0x21d759,_0x3f0d87,_0x18280a){_0x21d759[_0x918a('0x4f')][_0x918a('0x2c')]=_0x21d759[_0x918a('0x51')][_0x918a('0x52')];_0x21d759['body'][_0x918a('0x53')]=_0x21d759[_0x918a('0x51')][_0x918a('0x54')];_0x21d759[_0x918a('0x4f')][_0x918a('0x32')]=_0x21d759['file']['mimetype'];return db[_0x918a('0x2f')][_0x918a('0x50')](_0x21d759['body'])['then'](respondWithResult(_0x3f0d87,0xc9))[_0x918a('0x45')](handleError(_0x3f0d87,null));};exports['download']=function(_0x3c8ce2,_0x1f0705,_0x282f46){return db[_0x918a('0x2f')][_0x918a('0x55')]({'where':{'id':_0x3c8ce2[_0x918a('0x4a')]['id']},'raw':!![]})[_0x918a('0x28')](handleEntityNotFound(_0x1f0705,null))[_0x918a('0x28')](function(_0x240bdc){if(_0x240bdc){var _0x320a86=_0x240bdc[_0x918a('0x56')]!==null;var _0x40efa0=path[_0x918a('0x57')](config[_0x918a('0x58')],'server/files/attachments/');if(_0x320a86){_0x40efa0=path['join'](_0x40efa0,_0x918a('0x59'));}var _0x88259=path[_0x918a('0x57')](_0x40efa0,_0x240bdc[_0x918a('0x53')]);return _0x1f0705[_0x918a('0x5a')](_0x88259);}})[_0x918a('0x45')](handleError(_0x1f0705,null));};
\ No newline at end of file
index 8e9bc9b..7252243 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb46a=['attachments','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./attachment.attributes','exports','define','Attachment'];(function(_0x2d3a13,_0x19e6cc){var _0x135fa2=function(_0x2da2ac){while(--_0x2da2ac){_0x2d3a13['push'](_0x2d3a13['shift']());}};_0x135fa2(++_0x19e6cc);}(_0xb46a,0x1d5));var _0xab46=function(_0x5e5cb6,_0x2feed4){_0x5e5cb6=_0x5e5cb6-0x0;var _0x119d54=_0xb46a[_0x5e5cb6];return _0x119d54;};'use strict';var _=require(_0xab46('0x0'));var util=require(_0xab46('0x1'));var logger=require(_0xab46('0x2'))('api');var moment=require(_0xab46('0x3'));var BPromise=require(_0xab46('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab46('0x5'));var rimraf=require(_0xab46('0x6'));var config=require('../../config/environment');var attributes=require(_0xab46('0x7'));module[_0xab46('0x8')]=function(_0x11aca4,_0x4510f8){return _0x11aca4[_0xab46('0x9')](_0xab46('0xa'),attributes,{'tableName':_0xab46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x86f2=['exports','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./attachment.attributes'];(function(_0x21e886,_0x20dcd2){var _0x5c5b67=function(_0x33cf7b){while(--_0x33cf7b){_0x21e886['push'](_0x21e886['shift']());}};_0x5c5b67(++_0x20dcd2);}(_0x86f2,0x1eb));var _0x286f=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x86f2[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x286f('0x0'));var util=require(_0x286f('0x1'));var logger=require(_0x286f('0x2'))(_0x286f('0x3'));var moment=require(_0x286f('0x4'));var BPromise=require('bluebird');var rp=require(_0x286f('0x5'));var fs=require('fs');var path=require(_0x286f('0x6'));var rimraf=require('rimraf');var config=require(_0x286f('0x7'));var attributes=require(_0x286f('0x8'));module[_0x286f('0x9')]=function(_0x48d05e,_0x52257d){return _0x48d05e['define']('Attachment',attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4c28d5d..7d83eab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x136c=['message','catch','CreateAttachment','Attachment','body','options','raw','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x35629e,_0x28e7f5){var _0x220fbf=function(_0x198761){while(--_0x198761){_0x35629e['push'](_0x35629e['shift']());}};_0x220fbf(++_0x28e7f5);}(_0x136c,0x1d2));var _0xc136=function(_0x30188f,_0x2bc726){_0x30188f=_0x30188f-0x0;var _0x14afa4=_0x136c[_0x30188f];return _0x14afa4;};'use strict';var _=require(_0xc136('0x0'));var util=require(_0xc136('0x1'));var moment=require('moment');var BPromise=require(_0xc136('0x2'));var rs=require(_0xc136('0x3'));var fs=require('fs');var Redis=require(_0xc136('0x4'));var db=require(_0xc136('0x5'))['db'];var utils=require(_0xc136('0x6'));var logger=require(_0xc136('0x7'))(_0xc136('0x8'));var config=require(_0xc136('0x9'));var jayson=require(_0xc136('0xa'));var client=jayson['client'][_0xc136('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x594112,_0x361a52,_0x3993f2){return new BPromise(function(_0x1804c1,_0x500376){return client[_0xc136('0xc')](_0x594112,_0x3993f2)['then'](function(_0x1ea07d){logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,_0xc136('0xf'));logger[_0xc136('0x10')](_0xc136('0x11'),_0x361a52,_0xc136('0xf'),JSON[_0xc136('0x12')](_0x1ea07d));if(_0x1ea07d[_0xc136('0x13')]){if(_0x1ea07d['error']['code']===0x1f4){logger[_0xc136('0x13')]('Attachment,\x20%s,\x20%s',_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x500376(_0x1ea07d[_0xc136('0x13')]['message']);}logger['error'](_0xc136('0xe'),_0x361a52,_0x1ea07d[_0xc136('0x13')][_0xc136('0x14')]);return _0x1804c1(_0x1ea07d['error']['message']);}else{logger[_0xc136('0xd')](_0xc136('0xe'),_0x361a52,'request\x20sent');_0x1804c1(_0x1ea07d['result']['message']);}})[_0xc136('0x15')](function(_0x3daf55){logger[_0xc136('0x13')](_0xc136('0xe'),_0x361a52,_0x3daf55);_0x500376(_0x3daf55);});});}exports[_0xc136('0x16')]=function(_0x1ccf5f){var _0x59503b=this;return new Promise(function(_0x5df9b7,_0x4d56cb){return db[_0xc136('0x17')]['create'](_0x1ccf5f[_0xc136('0x18')],{'raw':_0x1ccf5f[_0xc136('0x19')]?_0x1ccf5f[_0xc136('0x19')][_0xc136('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2b8527){logger[_0xc136('0xd')]('CreateAttachment',_0x1ccf5f);logger[_0xc136('0x10')]('CreateAttachment',_0x1ccf5f,JSON['stringify'](_0x2b8527));_0x5df9b7(_0x2b8527);})[_0xc136('0x15')](function(_0x1a350a){logger['error'](_0xc136('0x16'),_0x1a350a[_0xc136('0x14')],_0x1ccf5f);_0x4d56cb(_0x59503b[_0xc136('0x13')](0x1f4,_0x1a350a[_0xc136('0x14')]));});});};
\ No newline at end of file
+var _0x2750=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Attachment,\x20%s,\x20%s','debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','Attachment','body','options','CreateAttachment','lodash','moment','bluebird','randomstring'];(function(_0x274de9,_0x2d40ef){var _0x442761=function(_0x3cd3d7){while(--_0x3cd3d7){_0x274de9['push'](_0x274de9['shift']());}};_0x442761(++_0x2d40ef);}(_0x2750,0x13b));var _0x0275=function(_0x5f08a8,_0x4b8709){_0x5f08a8=_0x5f08a8-0x0;var _0x1cbf0d=_0x2750[_0x5f08a8];return _0x1cbf0d;};'use strict';var _=require(_0x0275('0x0'));var util=require('util');var moment=require(_0x0275('0x1'));var BPromise=require(_0x0275('0x2'));var rs=require(_0x0275('0x3'));var fs=require('fs');var Redis=require(_0x0275('0x4'));var db=require(_0x0275('0x5'))['db'];var utils=require(_0x0275('0x6'));var logger=require(_0x0275('0x7'))(_0x0275('0x8'));var config=require(_0x0275('0x9'));var jayson=require(_0x0275('0xa'));var client=jayson['client'][_0x0275('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2421fd,_0x2fa0eb,_0x2e4b5c){return new BPromise(function(_0x4dffd1,_0x1f7c4a){return client[_0x0275('0xc')](_0x2421fd,_0x2e4b5c)[_0x0275('0xd')](function(_0x5e0e4a){logger['info'](_0x0275('0xe'),_0x2fa0eb,'request\x20sent');logger[_0x0275('0xf')](_0x0275('0x10'),_0x2fa0eb,_0x0275('0x11'),JSON[_0x0275('0x12')](_0x5e0e4a));if(_0x5e0e4a[_0x0275('0x13')]){if(_0x5e0e4a['error'][_0x0275('0x14')]===0x1f4){logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a['error']['message']);return _0x1f7c4a(_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);}logger[_0x0275('0x13')](_0x0275('0xe'),_0x2fa0eb,_0x5e0e4a[_0x0275('0x13')][_0x0275('0x15')]);return _0x4dffd1(_0x5e0e4a['error'][_0x0275('0x15')]);}else{logger[_0x0275('0x16')]('Attachment,\x20%s,\x20%s',_0x2fa0eb,_0x0275('0x11'));_0x4dffd1(_0x5e0e4a[_0x0275('0x17')]['message']);}})[_0x0275('0x18')](function(_0x31c76b){logger['error']('Attachment,\x20%s,\x20%s',_0x2fa0eb,_0x31c76b);_0x1f7c4a(_0x31c76b);});});}exports['CreateAttachment']=function(_0x591d27){var _0x5b8746=this;return new Promise(function(_0x566ad6,_0x44f7b0){return db[_0x0275('0x19')]['create'](_0x591d27[_0x0275('0x1a')],{'raw':_0x591d27[_0x0275('0x1b')]?_0x591d27[_0x0275('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x0275('0xd')](function(_0x402f0d){logger['info']('CreateAttachment',_0x591d27);logger[_0x0275('0xf')](_0x0275('0x1c'),_0x591d27,JSON[_0x0275('0x12')](_0x402f0d));_0x566ad6(_0x402f0d);})['catch'](function(_0xf3b68e){logger['error'](_0x0275('0x1c'),_0xf3b68e['message'],_0x591d27);_0x44f7b0(_0x5b8746[_0x0275('0x13')](0x1f4,_0xf3b68e[_0x0275('0x15')]));});});};
\ No newline at end of file
index 5bf87db..5a568f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2e0ffa,_0x451f12){_0x2e0ffa=_0x2e0ffa-0x0;var _0x24d627=_0x0b0e[_0x2e0ffa];return _0x24d627;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x5c5148,_0x49acc7){var _0x2ec4ed=function(_0x2144b1){while(--_0x2144b1){_0x5c5148['push'](_0x5c5148['shift']());}};_0x2ec4ed(++_0x49acc7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x31f79b,_0xa6f57){_0x31f79b=_0x31f79b-0x0;var _0x521729=_0x5f2f[_0x31f79b];return _0x521729;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
index dea14e9..1add881 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3286=['profile','email','callback','/login','use','clientID','clientSecret','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','emails','value','admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','getLicense','catch','passport-google-oauth20','Strategy','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google'];(function(_0x2d97ce,_0x23a807){var _0xcefa01=function(_0x232ede){while(--_0x232ede){_0x2d97ce['push'](_0x2d97ce['shift']());}};_0xcefa01(++_0x23a807);}(_0x3286,0xc4));var _0x6328=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3286[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0x6328('0x0'))[_0x6328('0x1')];var moment=require('moment');var db=require('../../mysqldb')['db'];var config=require(_0x6328('0x2'));var signToken=require(_0x6328('0x3'))[_0x6328('0x4')];var utils=require(_0x6328('0x5'));exports['login']=passport[_0x6328('0x6')](_0x6328('0x7'),{'failureRedirect':'/login','scope':[_0x6328('0x8'),_0x6328('0x9')],'session':![]});exports[_0x6328('0xa')]=passport['authenticate'](_0x6328('0x7'),{'failureRedirect':_0x6328('0xb'),'session':![]});passport[_0x6328('0xc')](new GoogleStrategy({'clientID':config[_0x6328('0x7')]?config[_0x6328('0x7')][_0x6328('0xd')]:'id','clientSecret':config['google']?config['google'][_0x6328('0xe')]:'secret','callbackURL':config['google']?config['google']['callbackURL']:''},function(_0xc8caa1,_0x4c3694,_0x379071,_0x19c833){var _0x39e83f,_0x56cfc5;return db['Setting'][_0x6328('0xf')]({'where':{'id':0x1},'attributes':[_0x6328('0x10'),_0x6328('0x11')],'raw':!![]})[_0x6328('0x12')](function(_0x4dd61f){_0x39e83f=_0x4dd61f;return db[_0x6328('0x13')][_0x6328('0x14')]({'where':{'email':_[_0x6328('0x15')](_0x379071[_0x6328('0x16')],_0x6328('0x17')),'role':{'$or':[_0x6328('0x18'),'user',_0x6328('0x19')]}}});})[_0x6328('0x12')](function(_0x3c523f){_0x56cfc5=_0x3c523f;if(_0x56cfc5){if(_0x56cfc5[_0x6328('0x1a')]){return _0x19c833(_0x6328('0x1b'));}else if(_0x39e83f[_0x6328('0x11')]>0x0){if(_0x56cfc5[_0x6328('0x1c')]){if(moment(_0x56cfc5[_0x6328('0x1d')])[_0x6328('0x1e')](_0x39e83f[_0x6328('0x11')],_0x6328('0x1f'))>moment()){return _0x19c833(_0x6328('0x1b'));}else{return utils['clearBlockUser'](_0x56cfc5,0x0,![],null)['then'](function(){return utils[_0x6328('0x20')](_0x56cfc5);})['then'](function(){return _0x19c833(null,_0x56cfc5);});}}else{return utils[_0x6328('0x20')](_0x56cfc5)[_0x6328('0x12')](function(){return _0x19c833(null,_0x56cfc5);});}}else{return utils['getLicense'](_0x56cfc5)[_0x6328('0x12')](function(){return _0x19c833(null,_0x56cfc5);});}}return _0x19c833('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x6328('0x21')](function(_0x396acd){_0x19c833(_0x396acd);});}));
\ No newline at end of file
+var _0xecca=['email','callback','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','authenticate','google','/login','profile'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0xecca,0x138));var _0xaecc=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xecca[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0xaecc('0x0'));var passport=require('passport');var GoogleStrategy=require(_0xaecc('0x1'))['Strategy'];var moment=require(_0xaecc('0x2'));var db=require(_0xaecc('0x3'))['db'];var config=require(_0xaecc('0x4'));var signToken=require(_0xaecc('0x5'))[_0xaecc('0x6')];var utils=require(_0xaecc('0x7'));exports['login']=passport[_0xaecc('0x8')](_0xaecc('0x9'),{'failureRedirect':_0xaecc('0xa'),'scope':[_0xaecc('0xb'),_0xaecc('0xc')],'session':![]});exports[_0xaecc('0xd')]=passport[_0xaecc('0x8')](_0xaecc('0x9'),{'failureRedirect':_0xaecc('0xa'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xaecc('0x9')]?config['google'][_0xaecc('0xe')]:'id','clientSecret':config['google']?config['google'][_0xaecc('0xf')]:'secret','callbackURL':config[_0xaecc('0x9')]?config[_0xaecc('0x9')][_0xaecc('0x10')]:''},function(_0x260cde,_0x547230,_0x48bdf3,_0x2411e3){var _0x387684,_0x12b1af;return db[_0xaecc('0x11')][_0xaecc('0x12')]({'where':{'id':0x1},'attributes':[_0xaecc('0x13'),_0xaecc('0x14')],'raw':!![]})[_0xaecc('0x15')](function(_0xe07e16){_0x387684=_0xe07e16;return db[_0xaecc('0x16')][_0xaecc('0x17')]({'where':{'email':_['map'](_0x48bdf3['emails'],_0xaecc('0x18')),'role':{'$or':[_0xaecc('0x19'),_0xaecc('0x1a'),_0xaecc('0x1b')]}}});})[_0xaecc('0x15')](function(_0x2ac78f){_0x12b1af=_0x2ac78f;if(_0x12b1af){if(_0x12b1af['disabled']){return _0x2411e3(_0xaecc('0x1c'));}else if(_0x387684['blockDuration']>0x0){if(_0x12b1af[_0xaecc('0x1d')]){if(moment(_0x12b1af[_0xaecc('0x1e')])[_0xaecc('0x1f')](_0x387684[_0xaecc('0x14')],_0xaecc('0x20'))>moment()){return _0x2411e3(_0xaecc('0x1c'));}else{return utils[_0xaecc('0x21')](_0x12b1af,0x0,![],null)[_0xaecc('0x15')](function(){return utils[_0xaecc('0x22')](_0x12b1af);})[_0xaecc('0x15')](function(){return _0x2411e3(null,_0x12b1af);});}}else{return utils[_0xaecc('0x22')](_0x12b1af)[_0xaecc('0x15')](function(){return _0x2411e3(null,_0x12b1af);});}}else{return utils[_0xaecc('0x22')](_0x12b1af)[_0xaecc('0x15')](function(){return _0x2411e3(null,_0x12b1af);});}}return _0x2411e3('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0xaecc('0x23')](function(_0xddfca1){_0x2411e3(_0xddfca1);});}));
\ No newline at end of file
index 6a685b2..751759d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb4d=['/callback','callback','isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller','../../components/auth/service','get'];(function(_0x28abb4,_0x350833){var _0x5ed3da=function(_0x1d4357){while(--_0x1d4357){_0x28abb4['push'](_0x28abb4['shift']());}};_0x5ed3da(++_0x350833);}(_0xcb4d,0x68));var _0xdcb4=function(_0x20d2e9,_0x49664e){_0x20d2e9=_0x20d2e9-0x0;var _0x56d870=_0xcb4d[_0x20d2e9];return _0x56d870;};'use strict';var express=require(_0xdcb4('0x0'));var passport=require(_0xdcb4('0x1'));var router=express[_0xdcb4('0x2')]();var controller=require(_0xdcb4('0x3'));var userController=require('../user/user.controller.js');var authService=require(_0xdcb4('0x4'));router['get']('/',controller['login']);router[_0xdcb4('0x5')](_0xdcb4('0x6'),controller[_0xdcb4('0x7')],authService[_0xdcb4('0x8')],userController['login'],authService[_0xdcb4('0x9')]);module['exports']=router;
\ No newline at end of file
+var _0xf69b=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','isMiddleware','login','setTokenCookie','passport','Router'];(function(_0x5ee3d3,_0x537c30){var _0x4b272f=function(_0x3dc277){while(--_0x3dc277){_0x5ee3d3['push'](_0x5ee3d3['shift']());}};_0x4b272f(++_0x537c30);}(_0xf69b,0x1e8));var _0xbf69=function(_0x5417ba,_0x1f52df){_0x5417ba=_0x5417ba-0x0;var _0x42660f=_0xf69b[_0x5417ba];return _0x42660f;};'use strict';var express=require('express');var passport=require(_0xbf69('0x0'));var router=express[_0xbf69('0x1')]();var controller=require(_0xbf69('0x2'));var userController=require(_0xbf69('0x3'));var authService=require(_0xbf69('0x4'));router[_0xbf69('0x5')]('/',controller['login']);router[_0xbf69('0x5')](_0xbf69('0x6'),controller['callback'],authService[_0xbf69('0x7')],userController[_0xbf69('0x8')],authService[_0xbf69('0x9')]);module['exports']=router;
\ No newline at end of file
index 446f461..e067190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8318=['now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','findOne','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','validatePasswordHistory','previousPasswords','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../config/utils','client','http','Setting','blockDuration','then','name','salt','disabled','blocked','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','loginAttempts','allowedLoginAttempts','add','minutes','clearBlockUser','getLicense','catch','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','email','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','reset','params','token'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0x8318,0x6a));var _0x8831=function(_0x520ce8,_0x445e56){_0x520ce8=_0x520ce8-0x0;var _0x64369e=_0x8318[_0x520ce8];return _0x64369e;};'use strict';var util=require(_0x8831('0x0'));var passport=require(_0x8831('0x1'));var LocalStrategy=require(_0x8831('0x2'))[_0x8831('0x3')];var jayson=require(_0x8831('0x4'));var _=require(_0x8831('0x5'));var rs=require(_0x8831('0x6'));var moment=require('moment');var db=require(_0x8831('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0x8831('0x8'));var client=jayson[_0x8831('0x9')][_0x8831('0xa')]({'port':0x232b});function localAuthenticate(_0x1781d7,_0x28d1a3,_0x528526,_0xc6e9a){var _0x52054c,_0x13628f;return db[_0x8831('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x8831('0xc')],'raw':!![]})[_0x8831('0xd')](function(_0x22c096){_0x52054c=_0x22c096;return _0x1781d7['findOne']({'attributes':['id',_0x8831('0xe'),'password',_0x8831('0xf'),'role',_0x8831('0x10'),_0x8831('0x11'),_0x8831('0x12'),'loginAttempts'],'where':{'name':_0x28d1a3,'role':{'$or':[_0x8831('0x13'),_0x8831('0x14'),_0x8831('0x15')]}}});})[_0x8831('0xd')](function(_0x6bf66e){if(!_0x6bf66e||_0x6bf66e&&_0x6bf66e['name']!==_0x28d1a3){throw new Error(_0x8831('0x16'));}else{_0x13628f=_0x6bf66e;return _0x13628f;}})['then'](function(){_0x13628f['authenticate'](_0x528526,function(_0x3f3129,_0x55bdbe){var _0x1343bc=_0x13628f[_0x8831('0x17')]+0x1;if(_0x3f3129){return _0xc6e9a(_0x3f3129);}else if(!_0x55bdbe){if(_0x13628f['disabled']){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}else if(_0x52054c[_0x8831('0x18')]>0x0){if(_0x13628f[_0x8831('0x11')]){if(_0x52054c[_0x8831('0xc')]>0x0){if(moment(_0x13628f[_0x8831('0x12')])[_0x8831('0x19')](_0x52054c[_0x8831('0xc')],_0x8831('0x1a'))>moment()){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}else{return utils['clearBlockUser'](_0x13628f,_0x1343bc,![],null)['then'](function(){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});});}}else{return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}}else{if(_0x1343bc>=_0x52054c['allowedLoginAttempts']){return utils[_0x8831('0x1b')](_0x13628f,0x0,!![],moment())['then'](function(){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});});}else{return utils[_0x8831('0x1b')](_0x13628f,_0x1343bc,![],null)[_0x8831('0xd')](function(){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});});}}}else{return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}}else{if(_0x13628f['disabled']){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}else if(_0x52054c[_0x8831('0x18')]>0x0){if(_0x13628f['blocked']){if(_0x52054c['blockDuration']>0x0){if(moment(_0x13628f[_0x8831('0x12')])[_0x8831('0x19')](_0x52054c['blockDuration'],_0x8831('0x1a'))>moment()){return _0xc6e9a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x13628f,0x0,![],null)[_0x8831('0xd')](function(){return utils[_0x8831('0x1c')](_0x13628f);})[_0x8831('0xd')](function(){return _0xc6e9a(null,_0x13628f);});}}else{return _0xc6e9a(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x8831('0x1b')](_0x13628f,0x0,![],null)[_0x8831('0xd')](function(){return utils['getLicense'](_0x13628f);})['then'](function(){return _0xc6e9a(null,_0x13628f);})['catch'](function(_0x18d34e){return _0xc6e9a(null,![],_0x18d34e);});}}else{if(_0x13628f['blocked']){return _0xc6e9a(null,![],{'message':_0x8831('0x16')});}else{return utils['getLicense'](_0x13628f)['then'](function(){return _0xc6e9a(null,_0x13628f);});}}}});})[_0x8831('0x1d')](function(_0x193542){return _0xc6e9a(null,![],_0x193542);});}function sendServiceMail(_0x33d18a){return db[_0x8831('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0x8831('0xe'),'email'],'include':[{'model':db[_0x8831('0x1f')],'as':'Smtp'}]})[_0x8831('0xd')](function(_0x39be90){if(!_0x39be90){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x5700ac={'tls':{'rejectUnauthorized':![]}};if(_0x39be90[_0x8831('0x20')][_0x8831('0x21')]){_0x5700ac['service']=_0x39be90[_0x8831('0x20')][_0x8831('0x21')];}else{_0x5700ac[_0x8831('0x22')]=_0x39be90['Smtp'][_0x8831('0x22')];_0x5700ac[_0x8831('0x23')]=_0x39be90[_0x8831('0x20')][_0x8831('0x23')];_0x5700ac[_0x8831('0x24')]=_0x39be90['Smtp'][_0x8831('0x24')];}if(_0x39be90[_0x8831('0x20')][_0x8831('0x25')]){_0x5700ac[_0x8831('0x26')]={'user':_0x39be90[_0x8831('0x20')][_0x8831('0x14')],'pass':_0x39be90['Smtp'][_0x8831('0x27')]};}var _0x152278={'account':_0x5700ac,'message':_[_0x8831('0x28')]({'from':util[_0x8831('0x29')](_0x8831('0x2a'),_0x39be90['name'],_0x39be90['email']||_0x39be90[_0x8831('0x20')][_0x8831('0x14')])},_0x33d18a)};return client[_0x8831('0x2b')](_0x8831('0x2c'),_0x152278);})[_0x8831('0xd')](function(_0x362ce2){if(_0x362ce2[_0x8831('0x2d')]){throw new Error(util['format'](_0x8831('0x2e'),_0x362ce2[_0x8831('0x2d')][_0x8831('0x2f')]||JSON[_0x8831('0x30')](_0x362ce2['error'])));}return!![];});}function handleError(_0x385748,_0x30341f,_0x4f7396){return _0x385748['status'](_0x30341f||0x1f4)[_0x8831('0x31')]({'message':_0x4f7396?_0x4f7396[_0x8831('0x2f')]||_0x4f7396:''});}exports[_0x8831('0x32')]=function(_0x3b4b8e,_0x1e5b6f,_0x417466){passport[_0x8831('0x33')](_0x8831('0x34'),function(_0xcf4d97,_0x59ccc2,_0x242a09){var _0x5d23fd=_0xcf4d97||_0x242a09;if(_0x5d23fd){return handleError(_0x1e5b6f,0x191,_0x5d23fd);}if(!_0x59ccc2){return handleError(_0x1e5b6f,0x194,{'message':_0x8831('0x35')});}else{var _0x422f19={'payload':{'id':_0x59ccc2['id'],'role':_0x59ccc2[_0x8831('0x36')]},'options':{'expiresIn':0x15180}};return authService[_0x8831('0x37')](_0x422f19)[_0x8831('0xd')](function(_0x1b36ec){_0x1e5b6f[_0x8831('0x38')]({'id':_0x59ccc2['id'],'token':_0x1b36ec,'statusCall':'','isAlreadyLogged':_0x59ccc2[_0x8831('0x39')]});});}})(_0x3b4b8e,_0x1e5b6f,_0x417466);};exports[_0x8831('0x3a')]=function(_0x8099a3,_0x4065a2,_0x103513){if(!_0x8099a3['body'][_0x8831('0x3b')]){return handleError(_0x4065a2,0x1f4,{'message':_0x8831('0x3c')});}var _0x275272=rs[_0x8831('0x3d')]();_0x8099a3[_0x8831('0x3e')][_0x8831('0x3b')]=_0x8099a3['body']['email'][_0x8831('0x3f')]()[_0x8831('0x40')]();var _0x4c9b51;return db[_0x8831('0xb')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x8831('0xc')],'raw':!![]})[_0x8831('0xd')](function(_0x4017a5){_0x4c9b51=_0x4017a5;return db[_0x8831('0x41')][_0x8831('0x42')]({'where':{'email':_0x8099a3[_0x8831('0x3e')]['email']}});})[_0x8831('0xd')](function(_0x398534){if(!_0x398534){throw new Error(_0x8831('0x43'));}if(_0x398534[_0x8831('0x10')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x398534['blocked']){if(moment(_0x398534[_0x8831('0x12')])['add'](_0x4c9b51[_0x8831('0xc')],'minutes')>moment()){throw new Error(_0x8831('0x44'));}else{_0x398534[_0x8831('0x11')]=![];_0x398534['blockedAt']=null;}}_0x398534[_0x8831('0x45')]=_0x275272;_0x398534[_0x8831('0x46')]=Date['now']()+0x36ee80;return _0x398534[_0x8831('0x47')]();})['then'](function(){return sendServiceMail({'to':_0x8099a3['body'][_0x8831('0x3b')],'subject':_0x8831('0x48'),'text':_0x8831('0x49')+_0x8831('0x4a')+_0x8831('0x4b')+_0x8099a3[_0x8831('0x4c')][_0x8831('0x22')]+'/reset/'+_0x275272+'\x0a\x0a'+_0x8831('0x4d')});})['then'](function(){_0x4065a2[_0x8831('0x4e')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x8831('0x1d')](function(_0x1b1600){return handleError(_0x4065a2,0x1f4,_0x1b1600);});};exports[_0x8831('0x4f')]=function(_0x59620e,_0x4daadb,_0x12d905){return db['User'][_0x8831('0x42')]({'where':{'resetPasswordToken':_0x59620e[_0x8831('0x50')][_0x8831('0x51')],'resetPasswordExpires':{'$gt':Date[_0x8831('0x52')]()}}})[_0x8831('0xd')](function(_0x5688ce){if(!_0x5688ce){throw new Error(_0x8831('0x53'));}return db['Setting'][_0x8831('0x54')]({'attributes':['id',_0x8831('0x55'),_0x8831('0x56'),_0x8831('0x57')]})[_0x8831('0xd')](function(_0x48a536){if(_0x48a536[_0x8831('0x55')])authService[_0x8831('0x58')](_0x59620e[_0x8831('0x3e')][_0x8831('0x59')]);if(!_0x48a536[_0x8831('0x56')]||!_0x5688ce['previousPasswords'])return _0x5688ce;authService[_0x8831('0x5a')](_0x59620e[_0x8831('0x3e')][_0x8831('0x59')],_0x5688ce[_0x8831('0x5b')],_0x48a536['passwordHistoryLimit']);return _0x5688ce;})[_0x8831('0xd')](function(){_0x5688ce[_0x8831('0x59')]=_0x59620e[_0x8831('0x3e')][_0x8831('0x59')];_0x5688ce[_0x8831('0x45')]=null;_0x5688ce[_0x8831('0x46')]=null;return _0x5688ce[_0x8831('0x47')]();});})[_0x8831('0xd')](function(){_0x4daadb['status'](0xc8)['send']({'message':_0x8831('0x5c')});})['catch'](function(_0x2b7bb3){return handleError(_0x4daadb,0x1f4,_0x2b7bb3);});};passport[_0x8831('0x5d')](new LocalStrategy({'usernameField':_0x8831('0xe'),'passwordField':_0x8831('0x59')},function(_0x34be5a,_0x7adf19,_0x5d6d9c){return localAuthenticate(db['User'],_0x34be5a,_0x7adf19,_0x5d6d9c);}));
\ No newline at end of file
+var _0x2d4d=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense','catch','MailAccount','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','body','generate','trim','toLowerCase','User','find','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent'];(function(_0x4fa66f,_0x4d618a){var _0x41b38c=function(_0x55a4c4){while(--_0x55a4c4){_0x4fa66f['push'](_0x4fa66f['shift']());}};_0x41b38c(++_0x4d618a);}(_0x2d4d,0x94));var _0xd2d4=function(_0x431275,_0xc22027){_0x431275=_0x431275-0x0;var _0x497f80=_0x2d4d[_0x431275];return _0x497f80;};'use strict';var util=require(_0xd2d4('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')['Strategy'];var jayson=require(_0xd2d4('0x1'));var _=require(_0xd2d4('0x2'));var rs=require(_0xd2d4('0x3'));var moment=require(_0xd2d4('0x4'));var db=require(_0xd2d4('0x5'))['db'];var authService=require(_0xd2d4('0x6'));var utils=require(_0xd2d4('0x7'));var client=jayson[_0xd2d4('0x8')][_0xd2d4('0x9')]({'port':0x232b});function localAuthenticate(_0x471003,_0x56d1e3,_0x23e700,_0x57bae4){var _0x45176e,_0x89452c;return db[_0xd2d4('0xa')][_0xd2d4('0xb')]({'where':{'id':0x1},'attributes':[_0xd2d4('0xc'),_0xd2d4('0xd')],'raw':!![]})[_0xd2d4('0xe')](function(_0x32fc91){_0x45176e=_0x32fc91;return _0x471003[_0xd2d4('0xb')]({'attributes':['id',_0xd2d4('0xf'),_0xd2d4('0x10'),_0xd2d4('0x11'),_0xd2d4('0x12'),_0xd2d4('0x13'),_0xd2d4('0x14'),_0xd2d4('0x15'),_0xd2d4('0x16')],'where':{'name':_0x56d1e3,'role':{'$or':[_0xd2d4('0x17'),_0xd2d4('0x18'),_0xd2d4('0x19')]}}});})[_0xd2d4('0xe')](function(_0x3dc00c){if(!_0x3dc00c||_0x3dc00c&&_0x3dc00c[_0xd2d4('0xf')]!==_0x56d1e3){throw new Error(_0xd2d4('0x1a'));}else{_0x89452c=_0x3dc00c;return _0x89452c;}})[_0xd2d4('0xe')](function(){_0x89452c[_0xd2d4('0x1b')](_0x23e700,function(_0x457c02,_0x390d55){var _0x295041=_0x89452c['loginAttempts']+0x1;if(_0x457c02){return _0x57bae4(_0x457c02);}else if(!_0x390d55){if(_0x89452c[_0xd2d4('0x13')]){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else if(_0x45176e[_0xd2d4('0xc')]>0x0){if(_0x89452c[_0xd2d4('0x14')]){if(_0x45176e['blockDuration']>0x0){if(moment(_0x89452c[_0xd2d4('0x15')])[_0xd2d4('0x1c')](_0x45176e['blockDuration'],_0xd2d4('0x1d'))>moment()){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else{return utils[_0xd2d4('0x1e')](_0x89452c,_0x295041,![],null)[_0xd2d4('0xe')](function(){return _0x57bae4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x57bae4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x295041>=_0x45176e[_0xd2d4('0xc')]){return utils[_0xd2d4('0x1e')](_0x89452c,0x0,!![],moment())[_0xd2d4('0xe')](function(){return _0x57bae4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xd2d4('0x1e')](_0x89452c,_0x295041,![],null)[_0xd2d4('0xe')](function(){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});});}}}else{return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}}else{if(_0x89452c[_0xd2d4('0x13')]){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else if(_0x45176e['allowedLoginAttempts']>0x0){if(_0x89452c[_0xd2d4('0x14')]){if(_0x45176e[_0xd2d4('0xd')]>0x0){if(moment(_0x89452c[_0xd2d4('0x15')])[_0xd2d4('0x1c')](_0x45176e[_0xd2d4('0xd')],_0xd2d4('0x1d'))>moment()){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else{return utils[_0xd2d4('0x1e')](_0x89452c,0x0,![],null)[_0xd2d4('0xe')](function(){return utils[_0xd2d4('0x1f')](_0x89452c);})[_0xd2d4('0xe')](function(){return _0x57bae4(null,_0x89452c);});}}else{return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}}else{return utils['clearBlockUser'](_0x89452c,0x0,![],null)[_0xd2d4('0xe')](function(){return utils[_0xd2d4('0x1f')](_0x89452c);})['then'](function(){return _0x57bae4(null,_0x89452c);})[_0xd2d4('0x20')](function(_0x45ab5d){return _0x57bae4(null,![],_0x45ab5d);});}}else{if(_0x89452c['blocked']){return _0x57bae4(null,![],{'message':_0xd2d4('0x1a')});}else{return utils[_0xd2d4('0x1f')](_0x89452c)[_0xd2d4('0xe')](function(){return _0x57bae4(null,_0x89452c);});}}}});})['catch'](function(_0x292d16){return _0x57bae4(null,![],_0x292d16);});}function sendServiceMail(_0x3aeffe){return db[_0xd2d4('0x21')]['find']({'where':{'service':!![]},'attributes':['id',_0xd2d4('0xf'),_0xd2d4('0x22')],'include':[{'model':db[_0xd2d4('0x23')],'as':'Smtp'}]})['then'](function(_0x4bc51e){if(!_0x4bc51e){throw new Error(_0xd2d4('0x24'));}var _0x259dc6={'tls':{'rejectUnauthorized':![]}};if(_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x26')]){_0x259dc6[_0xd2d4('0x26')]=_0x4bc51e[_0xd2d4('0x25')]['service'];}else{_0x259dc6['host']=_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x27')];_0x259dc6['port']=_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x28')];_0x259dc6['secure']=_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x29')];}if(_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x2a')]){_0x259dc6[_0xd2d4('0x2b')]={'user':_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x18')],'pass':_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x2c')]};}var _0x14ab8f={'account':_0x259dc6,'message':_['merge']({'from':util[_0xd2d4('0x2d')](_0xd2d4('0x2e'),_0x4bc51e[_0xd2d4('0xf')],_0x4bc51e['email']||_0x4bc51e[_0xd2d4('0x25')][_0xd2d4('0x18')])},_0x3aeffe)};return client['request']('SendMail',_0x14ab8f);})[_0xd2d4('0xe')](function(_0x530d7d){if(_0x530d7d['error']){throw new Error(util[_0xd2d4('0x2d')](_0xd2d4('0x2f'),_0x530d7d[_0xd2d4('0x30')][_0xd2d4('0x31')]||JSON[_0xd2d4('0x32')](_0x530d7d[_0xd2d4('0x30')])));}return!![];});}function handleError(_0x22bb30,_0xd88d68,_0x39af3d){return _0x22bb30[_0xd2d4('0x33')](_0xd88d68||0x1f4)[_0xd2d4('0x34')]({'message':_0x39af3d?_0x39af3d[_0xd2d4('0x31')]||_0x39af3d:''});}exports[_0xd2d4('0x35')]=function(_0x3dbe4c,_0x321cd6,_0x56278f){passport[_0xd2d4('0x1b')]('local',function(_0x34b204,_0x9a3410,_0x126e40){var _0x4d1ef7=_0x34b204||_0x126e40;if(_0x4d1ef7){return handleError(_0x321cd6,0x191,_0x4d1ef7);}if(!_0x9a3410){return handleError(_0x321cd6,0x194,{'message':_0xd2d4('0x36')});}else{var _0x19aa39={'payload':{'id':_0x9a3410['id'],'role':_0x9a3410['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x19aa39)[_0xd2d4('0xe')](function(_0x45544f){_0x321cd6['json']({'id':_0x9a3410['id'],'token':_0x45544f,'statusCall':'','isAlreadyLogged':_0x9a3410[_0xd2d4('0x37')]});});}})(_0x3dbe4c,_0x321cd6,_0x56278f);};exports[_0xd2d4('0x38')]=function(_0x5a7e0c,_0x3170d6,_0x10a882){if(!_0x5a7e0c[_0xd2d4('0x39')]['email']){return handleError(_0x3170d6,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x10af94=rs[_0xd2d4('0x3a')]();_0x5a7e0c[_0xd2d4('0x39')][_0xd2d4('0x22')]=_0x5a7e0c[_0xd2d4('0x39')]['email'][_0xd2d4('0x3b')]()[_0xd2d4('0x3c')]();var _0x4cd61f;return db['Setting'][_0xd2d4('0xb')]({'where':{'id':0x1},'attributes':[_0xd2d4('0xc'),'blockDuration'],'raw':!![]})[_0xd2d4('0xe')](function(_0x332be1){_0x4cd61f=_0x332be1;return db[_0xd2d4('0x3d')][_0xd2d4('0x3e')]({'where':{'email':_0x5a7e0c[_0xd2d4('0x39')]['email']}});})[_0xd2d4('0xe')](function(_0xeca5d4){if(!_0xeca5d4){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0xeca5d4[_0xd2d4('0x13')]){throw new Error(_0xd2d4('0x3f'));}if(_0xeca5d4['blocked']){if(moment(_0xeca5d4[_0xd2d4('0x15')])[_0xd2d4('0x1c')](_0x4cd61f[_0xd2d4('0xd')],_0xd2d4('0x1d'))>moment()){throw new Error(_0xd2d4('0x40'));}else{_0xeca5d4['blocked']=![];_0xeca5d4['blockedAt']=null;}}_0xeca5d4[_0xd2d4('0x41')]=_0x10af94;_0xeca5d4['resetPasswordExpires']=Date['now']()+0x36ee80;return _0xeca5d4[_0xd2d4('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x5a7e0c['body'][_0xd2d4('0x22')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xd2d4('0x43')+_0xd2d4('0x44')+_0xd2d4('0x45')+_0x5a7e0c[_0xd2d4('0x46')][_0xd2d4('0x27')]+_0xd2d4('0x47')+_0x10af94+'\x0a\x0a'+_0xd2d4('0x48')});})[_0xd2d4('0xe')](function(){_0x3170d6[_0xd2d4('0x33')](0xc8)[_0xd2d4('0x34')]({'message':_0xd2d4('0x49')});})['catch'](function(_0x53bbe0){return handleError(_0x3170d6,0x1f4,_0x53bbe0);});};exports[_0xd2d4('0x4a')]=function(_0x19a558,_0x1e5b2c,_0x1cce3e){return db[_0xd2d4('0x3d')][_0xd2d4('0x3e')]({'where':{'resetPasswordToken':_0x19a558[_0xd2d4('0x4b')][_0xd2d4('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xd2d4('0x4d')]()}}})[_0xd2d4('0xe')](function(_0x3f6570){if(!_0x3f6570){throw new Error(_0xd2d4('0x4e'));}return db[_0xd2d4('0xa')][_0xd2d4('0xb')]({'attributes':['id','securePassword',_0xd2d4('0x4f'),_0xd2d4('0x50')]})[_0xd2d4('0xe')](function(_0x562188){if(_0x562188[_0xd2d4('0x51')])authService[_0xd2d4('0x52')](_0x19a558[_0xd2d4('0x39')]['password']);if(!_0x562188[_0xd2d4('0x4f')]||!_0x3f6570[_0xd2d4('0x53')])return _0x3f6570;authService[_0xd2d4('0x54')](_0x19a558['body'][_0xd2d4('0x10')],_0x3f6570[_0xd2d4('0x53')],_0x562188['passwordHistoryLimit']);return _0x3f6570;})[_0xd2d4('0xe')](function(){_0x3f6570[_0xd2d4('0x10')]=_0x19a558[_0xd2d4('0x39')][_0xd2d4('0x10')];_0x3f6570[_0xd2d4('0x41')]=null;_0x3f6570['resetPasswordExpires']=null;return _0x3f6570['save']();});})[_0xd2d4('0xe')](function(){_0x1e5b2c[_0xd2d4('0x33')](0xc8)[_0xd2d4('0x34')]({'message':_0xd2d4('0x55')});})[_0xd2d4('0x20')](function(_0x579280){return handleError(_0x1e5b2c,0x1f4,_0x579280);});};passport[_0xd2d4('0x56')](new LocalStrategy({'usernameField':_0xd2d4('0xf'),'passwordField':_0xd2d4('0x10')},function(_0x31e192,_0x25355d,_0x3effc0){return localAuthenticate(db['User'],_0x31e192,_0x25355d,_0x3effc0);}));
\ No newline at end of file
index 23582c7..1ba98bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5737=['./authLocal.controller','login','/forgot','forgot','post','/reset/:token','reset','exports','express','Router'];(function(_0x194717,_0x440304){var _0x4ae32c=function(_0x9b57be){while(--_0x9b57be){_0x194717['push'](_0x194717['shift']());}};_0x4ae32c(++_0x440304);}(_0x5737,0x1c0));var _0x7573=function(_0x4f3207,_0x264c78){_0x4f3207=_0x4f3207-0x0;var _0x87adb6=_0x5737[_0x4f3207];return _0x87adb6;};'use strict';var express=require(_0x7573('0x0'));var router=express[_0x7573('0x1')]();var controller=require(_0x7573('0x2'));router['post']('/',controller[_0x7573('0x3')]);router['post'](_0x7573('0x4'),controller[_0x7573('0x5')]);router[_0x7573('0x6')](_0x7573('0x7'),controller[_0x7573('0x8')]);module[_0x7573('0x9')]=router;
\ No newline at end of file
+var _0x368e=['express','Router','./authLocal.controller','post','login','/forgot','forgot','/reset/:token','reset','exports'];(function(_0x3ab4fa,_0xfb4d70){var _0x489ea3=function(_0x42dc4d){while(--_0x42dc4d){_0x3ab4fa['push'](_0x3ab4fa['shift']());}};_0x489ea3(++_0xfb4d70);}(_0x368e,0xfa));var _0xe368=function(_0x2093f0,_0x1f903c){_0x2093f0=_0x2093f0-0x0;var _0x37829f=_0x368e[_0x2093f0];return _0x37829f;};'use strict';var express=require(_0xe368('0x0'));var router=express[_0xe368('0x1')]();var controller=require(_0xe368('0x2'));router[_0xe368('0x3')]('/',controller[_0xe368('0x4')]);router[_0xe368('0x3')](_0xe368('0x5'),controller[_0xe368('0x6')]);router[_0xe368('0x3')](_0xe368('0x7'),controller[_0xe368('0x8')]);module[_0xe368('0x9')]=router;
\ No newline at end of file
index ae20f33..8d7eac9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc73=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x17f686,_0x5a06c0){var _0x42455a=function(_0x755a69){while(--_0x755a69){_0x17f686['push'](_0x17f686['shift']());}};_0x42455a(++_0x5a06c0);}(_0xbc73,0xe7));var _0x3bc7=function(_0x236c89,_0xd76ba9){_0x236c89=_0x236c89-0x0;var _0x3b2a15=_0xbc73[_0x236c89];return _0x3b2a15;};'use strict';var Sequelize=require(_0x3bc7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x3bc7('0x1')]},'description':{'type':Sequelize[_0x3bc7('0x1')]},'status':{'type':Sequelize[_0x3bc7('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x3bc7('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5dc6=['exports','STRING','INTEGER','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5dc6,0x157));var _0x65dc=function(_0x47ace1,_0x1e7b27){_0x47ace1=_0x47ace1-0x0;var _0xce8451=_0x5dc6[_0x47ace1];return _0xce8451;};'use strict';var Sequelize=require(_0x65dc('0x0'));module[_0x65dc('0x1')]={'name':{'type':Sequelize[_0x65dc('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x65dc('0x2')]},'description':{'type':Sequelize[_0x65dc('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x65dc('0x3')],'defaultValue':0xa}};
\ No newline at end of file
index 30383d2..54936bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fd2=['util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','addConditions','Condition','ids','getConditions','findOne','length','order','addActions','Action','omit','getActions','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache'];(function(_0x21ab88,_0x505c6c){var _0xe178fa=function(_0x2a49eb){while(--_0x2a49eb){_0x21ab88['push'](_0x21ab88['shift']());}};_0xe178fa(++_0x505c6c);}(_0x9fd2,0xac));var _0x29fd=function(_0x2bee5d,_0x5ce342){_0x2bee5d=_0x2bee5d-0x0;var _0x2fba8c=_0x9fd2[_0x2bee5d];return _0x2fba8c;};'use strict';var emlformat=require(_0x29fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x29fd('0x1'));var jsonpatch=require(_0x29fd('0x2'));var rp=require(_0x29fd('0x3'));var moment=require('moment');var BPromise=require(_0x29fd('0x4'));var Mustache=require(_0x29fd('0x5'));var util=require(_0x29fd('0x6'));var path=require(_0x29fd('0x7'));var sox=require(_0x29fd('0x8'));var csv=require(_0x29fd('0x9'));var ejs=require(_0x29fd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x29fd('0xb'));var jsforce=require(_0x29fd('0xc'));var deskjs=require(_0x29fd('0xd'));var toCsv=require('to-csv');var querystring=require(_0x29fd('0xe'));var Papa=require(_0x29fd('0xf'));var Redis=require(_0x29fd('0x10'));var authService=require(_0x29fd('0x11'));var qs=require(_0x29fd('0x12'));var as=require(_0x29fd('0x13'));var hardwareService=require(_0x29fd('0x14'));var logger=require(_0x29fd('0x15'))(_0x29fd('0x16'));var utils=require(_0x29fd('0x17'));var config=require(_0x29fd('0x18'));var licenseUtil=require(_0x29fd('0x19'));var db=require(_0x29fd('0x1a'))['db'];function respondWithStatusCode(_0x4c0c1c,_0xf06c90){_0xf06c90=_0xf06c90||0xcc;return function(_0x40194c){if(_0x40194c){return _0x4c0c1c[_0x29fd('0x1b')](_0xf06c90);}return _0x4c0c1c[_0x29fd('0x1c')](_0xf06c90)[_0x29fd('0x1d')]();};}function respondWithResult(_0x130cda,_0x1643e9){_0x1643e9=_0x1643e9||0xc8;return function(_0x57f344){if(_0x57f344){return _0x130cda[_0x29fd('0x1c')](_0x1643e9)['json'](_0x57f344);}};}function respondWithFilteredResult(_0x455981,_0xba5265){return function(_0x387bc1){if(_0x387bc1){var _0x1402e5=typeof _0xba5265[_0x29fd('0x1e')]===_0x29fd('0x1f')&&typeof _0xba5265[_0x29fd('0x20')]==='undefined';var _0x3c9759=_0x387bc1[_0x29fd('0x21')];var _0x515e99=_0x1402e5?0x0:_0xba5265['offset'];var _0xe589ff=_0x1402e5?_0x387bc1['count']:_0xba5265[_0x29fd('0x1e')]+_0xba5265[_0x29fd('0x20')];var _0x2a35b4;if(_0xe589ff>=_0x3c9759){_0xe589ff=_0x3c9759;_0x2a35b4=0xc8;}else{_0x2a35b4=0xce;}_0x455981[_0x29fd('0x1c')](_0x2a35b4);return _0x455981[_0x29fd('0x22')](_0x29fd('0x23'),_0x515e99+'-'+_0xe589ff+'/'+_0x3c9759)[_0x29fd('0x24')](_0x387bc1);}return null;};}function patchUpdates(_0x28b6c4){return function(_0x160ba5){try{jsonpatch['apply'](_0x160ba5,_0x28b6c4,!![]);}catch(_0x302d96){return BPromise[_0x29fd('0x25')](_0x302d96);}return _0x160ba5[_0x29fd('0x26')]();};}function saveUpdates(_0x425a10,_0x34f056){return function(_0x2bad9e){if(_0x2bad9e){return _0x2bad9e[_0x29fd('0x27')](_0x425a10)[_0x29fd('0x28')](function(_0x5c95ef){return _0x5c95ef;});}return null;};}function removeEntity(_0x548618,_0x456493){return function(_0x31660b){if(_0x31660b){return _0x31660b[_0x29fd('0x29')]()[_0x29fd('0x28')](function(){_0x548618['status'](0xcc)[_0x29fd('0x1d')]();});}};}function handleEntityNotFound(_0x552a96,_0x4c90e0){return function(_0x3776eb){if(!_0x3776eb){_0x552a96[_0x29fd('0x1b')](0x194);}return _0x3776eb;};}function handleError(_0x3fb16f,_0x14854b){_0x14854b=_0x14854b||0x1f4;return function(_0x3ff2d3){logger[_0x29fd('0x2a')](_0x3ff2d3[_0x29fd('0x2b')]);if(_0x3ff2d3[_0x29fd('0x2c')]){delete _0x3ff2d3[_0x29fd('0x2c')];}_0x3fb16f[_0x29fd('0x1c')](_0x14854b)[_0x29fd('0x2d')](_0x3ff2d3);};}exports[_0x29fd('0x2e')]=function(_0x13bb40,_0x338eea){var _0x2e6b5c={},_0x40f633={},_0x295df5={'count':0x0,'rows':[]};var _0x20abc3=_[_0x29fd('0x2f')](db[_0x29fd('0x30')][_0x29fd('0x31')],function(_0x5f3361){return{'name':_0x5f3361['fieldName'],'type':_0x5f3361[_0x29fd('0x32')][_0x29fd('0x33')]};});_0x40f633[_0x29fd('0x34')]=_['map'](_0x20abc3,'name');_0x40f633[_0x29fd('0x35')]=_[_0x29fd('0x36')](_0x13bb40['query']);_0x40f633[_0x29fd('0x37')]=_[_0x29fd('0x38')](_0x40f633[_0x29fd('0x34')],_0x40f633['query']);_0x2e6b5c[_0x29fd('0x39')]=_['intersection'](_0x40f633[_0x29fd('0x34')],qs[_0x29fd('0x3a')](_0x13bb40[_0x29fd('0x35')][_0x29fd('0x3a')]));_0x2e6b5c[_0x29fd('0x39')]=_0x2e6b5c[_0x29fd('0x39')]['length']?_0x2e6b5c[_0x29fd('0x39')]:_0x40f633['model'];if(!_0x13bb40['query']['hasOwnProperty'](_0x29fd('0x3b'))){_0x2e6b5c[_0x29fd('0x20')]=qs[_0x29fd('0x20')](_0x13bb40[_0x29fd('0x35')]['limit']);_0x2e6b5c['offset']=qs['offset'](_0x13bb40[_0x29fd('0x35')][_0x29fd('0x1e')]);}_0x2e6b5c['order']=qs[_0x29fd('0x3c')](_0x13bb40['query'][_0x29fd('0x3c')]);_0x2e6b5c[_0x29fd('0x3d')]=qs['filters'](_[_0x29fd('0x3e')](_0x13bb40['query'],_0x40f633[_0x29fd('0x37')]),_0x20abc3);if(_0x13bb40['query'][_0x29fd('0x3f')]){_0x2e6b5c['where']=_[_0x29fd('0x40')](_0x2e6b5c[_0x29fd('0x3d')],{'$or':_[_0x29fd('0x2f')](_0x20abc3,function(_0x3b307d){if(_0x3b307d[_0x29fd('0x32')]!==_0x29fd('0x41')){var _0x1dd00d={};_0x1dd00d[_0x3b307d[_0x29fd('0x2c')]]={'$like':'%'+_0x13bb40[_0x29fd('0x35')][_0x29fd('0x3f')]+'%'};return _0x1dd00d;}})});}_0x2e6b5c=_['merge']({},_0x2e6b5c,_0x13bb40[_0x29fd('0x42')]);var _0x2c91be={'where':_0x2e6b5c[_0x29fd('0x3d')]};return db[_0x29fd('0x30')][_0x29fd('0x21')](_0x2c91be)[_0x29fd('0x28')](function(_0x347098){_0x295df5[_0x29fd('0x21')]=_0x347098;if(_0x13bb40['query'][_0x29fd('0x43')]){_0x2e6b5c[_0x29fd('0x44')]=[{'all':!![]}];}return db[_0x29fd('0x30')][_0x29fd('0x45')](_0x2e6b5c);})['then'](function(_0x3a74f8){_0x295df5[_0x29fd('0x46')]=_0x3a74f8;return _0x295df5;})['then'](respondWithFilteredResult(_0x338eea,_0x2e6b5c))[_0x29fd('0x47')](handleError(_0x338eea,null));};exports[_0x29fd('0x48')]=function(_0x1be0be,_0x14ada4){var _0x250ebb={'raw':![],'where':{'id':_0x1be0be[_0x29fd('0x49')]['id']}},_0xab3b8d={};_0xab3b8d[_0x29fd('0x34')]=_[_0x29fd('0x36')](db['Automation'][_0x29fd('0x31')]);_0xab3b8d['query']=_[_0x29fd('0x36')](_0x1be0be[_0x29fd('0x35')]);_0xab3b8d[_0x29fd('0x37')]=_[_0x29fd('0x38')](_0xab3b8d[_0x29fd('0x34')],_0xab3b8d[_0x29fd('0x35')]);_0x250ebb['attributes']=_[_0x29fd('0x38')](_0xab3b8d[_0x29fd('0x34')],qs[_0x29fd('0x3a')](_0x1be0be['query'][_0x29fd('0x3a')]));_0x250ebb['attributes']=_0x250ebb[_0x29fd('0x39')]['length']?_0x250ebb[_0x29fd('0x39')]:_0xab3b8d[_0x29fd('0x34')];if(_0x1be0be['query'][_0x29fd('0x43')]){_0x250ebb[_0x29fd('0x44')]=[{'all':!![]}];}_0x250ebb=_[_0x29fd('0x40')]({},_0x250ebb,_0x1be0be[_0x29fd('0x42')]);return db['Automation'][_0x29fd('0x4a')](_0x250ebb)[_0x29fd('0x28')](handleEntityNotFound(_0x14ada4,null))[_0x29fd('0x28')](respondWithResult(_0x14ada4,null))['catch'](handleError(_0x14ada4,null));};exports[_0x29fd('0x4b')]=function(_0x37751e,_0x53c986){return db[_0x29fd('0x30')]['create'](_0x37751e[_0x29fd('0x4c')],{})[_0x29fd('0x28')](respondWithResult(_0x53c986,0xc9))[_0x29fd('0x47')](handleError(_0x53c986,null));};exports[_0x29fd('0x27')]=function(_0x211a49,_0x387be9){if(_0x211a49['body']['id']){delete _0x211a49[_0x29fd('0x4c')]['id'];}return db[_0x29fd('0x30')][_0x29fd('0x4a')]({'where':{'id':_0x211a49[_0x29fd('0x49')]['id']}})[_0x29fd('0x28')](handleEntityNotFound(_0x387be9,null))['then'](saveUpdates(_0x211a49[_0x29fd('0x4c')],null))[_0x29fd('0x28')](respondWithResult(_0x387be9,null))['catch'](handleError(_0x387be9,null));};exports[_0x29fd('0x29')]=function(_0xc4e9f6,_0x5df38c){return db[_0x29fd('0x30')]['find']({'where':{'id':_0xc4e9f6[_0x29fd('0x49')]['id']}})['then'](handleEntityNotFound(_0x5df38c,null))['then'](removeEntity(_0x5df38c,null))[_0x29fd('0x47')](handleError(_0x5df38c,null));};exports[_0x29fd('0x4d')]=function(_0x5c3be1,_0x3e9548,_0x2f2005){return db[_0x29fd('0x4e')][_0x29fd('0x4a')]({'where':{'id':_0x5c3be1[_0x29fd('0x49')]['id']}})[_0x29fd('0x28')](handleEntityNotFound(_0x3e9548,null))[_0x29fd('0x28')](function(_0x10ff00){if(_0x10ff00){return _0x10ff00['addConditions'](_0x5c3be1[_0x29fd('0x4c')][_0x29fd('0x4f')],_['omit'](_0x5c3be1['body'],[_0x29fd('0x4f'),'id'])||{});}})[_0x29fd('0x28')](respondWithResult(_0x3e9548,null))[_0x29fd('0x47')](handleError(_0x3e9548,null));};exports[_0x29fd('0x50')]=function(_0x4eb408,_0x15e22f,_0x13264e){var _0xa0695a={};var _0xbb4d3a={};var _0x58c025;var _0x143c3e;return db[_0x29fd('0x30')][_0x29fd('0x51')]({'where':{'id':_0x4eb408[_0x29fd('0x49')]['id']}})['then'](handleEntityNotFound(_0x15e22f,null))[_0x29fd('0x28')](function(_0x356e34){if(_0x356e34){_0x58c025=_0x356e34;_0xbb4d3a['model']=_[_0x29fd('0x36')](db[_0x29fd('0x4e')]['rawAttributes']);_0xbb4d3a[_0x29fd('0x35')]=_[_0x29fd('0x36')](_0x4eb408[_0x29fd('0x35')]);_0xbb4d3a[_0x29fd('0x37')]=_[_0x29fd('0x38')](_0xbb4d3a[_0x29fd('0x34')],_0xbb4d3a[_0x29fd('0x35')]);_0xa0695a[_0x29fd('0x39')]=_[_0x29fd('0x38')](_0xbb4d3a[_0x29fd('0x34')],qs[_0x29fd('0x3a')](_0x4eb408[_0x29fd('0x35')][_0x29fd('0x3a')]));_0xa0695a['attributes']=_0xa0695a[_0x29fd('0x39')][_0x29fd('0x52')]?_0xa0695a[_0x29fd('0x39')]:_0xbb4d3a[_0x29fd('0x34')];_0xa0695a[_0x29fd('0x53')]=qs[_0x29fd('0x3c')](_0x4eb408['query']['sort']);_0xa0695a['where']=qs[_0x29fd('0x37')](_[_0x29fd('0x3e')](_0x4eb408[_0x29fd('0x35')],_0xbb4d3a[_0x29fd('0x37')]));if(_0x4eb408[_0x29fd('0x35')][_0x29fd('0x3f')]){_0xa0695a[_0x29fd('0x3d')]=_[_0x29fd('0x40')](_0xa0695a[_0x29fd('0x3d')],{'$or':_[_0x29fd('0x2f')](_0xa0695a[_0x29fd('0x39')],function(_0x29013d){var _0x4e2a1d={};_0x4e2a1d[_0x29013d]={'$like':'%'+_0x4eb408[_0x29fd('0x35')][_0x29fd('0x3f')]+'%'};return _0x4e2a1d;})});}_0xa0695a=_['merge']({},_0xa0695a,_0x4eb408['options']);return _0x58c025['getConditions'](_0xa0695a);}})['then'](function(_0x5014f8){if(_0x5014f8){_0x143c3e=_0x5014f8[_0x29fd('0x52')];if(!_0x4eb408[_0x29fd('0x35')]['hasOwnProperty']('nolimit')){_0xa0695a[_0x29fd('0x20')]=qs[_0x29fd('0x20')](_0x4eb408['query'][_0x29fd('0x20')]);_0xa0695a[_0x29fd('0x1e')]=qs[_0x29fd('0x1e')](_0x4eb408[_0x29fd('0x35')][_0x29fd('0x1e')]);}return _0x58c025[_0x29fd('0x50')](_0xa0695a);}})[_0x29fd('0x28')](function(_0x36b113){if(_0x36b113){return _0x36b113?{'count':_0x143c3e,'rows':_0x36b113}:null;}})[_0x29fd('0x28')](respondWithResult(_0x15e22f,null))[_0x29fd('0x47')](handleError(_0x15e22f,null));};exports[_0x29fd('0x54')]=function(_0x51b512,_0x4c6a43,_0x1eaae2){return db[_0x29fd('0x55')]['find']({'where':{'id':_0x51b512[_0x29fd('0x49')]['id']}})[_0x29fd('0x28')](handleEntityNotFound(_0x4c6a43,null))[_0x29fd('0x28')](function(_0x244189){if(_0x244189){return _0x244189['addActions'](_0x51b512[_0x29fd('0x4c')][_0x29fd('0x4f')],_[_0x29fd('0x56')](_0x51b512[_0x29fd('0x4c')],[_0x29fd('0x4f'),'id'])||{});}})[_0x29fd('0x28')](respondWithResult(_0x4c6a43,null))[_0x29fd('0x47')](handleError(_0x4c6a43,null));};exports[_0x29fd('0x57')]=function(_0x5d87dd,_0x316cef,_0x53a483){var _0x27909a={};var _0x4cca7d={};var _0x518ea9;var _0x2e90dc;return db['Automation'][_0x29fd('0x51')]({'where':{'id':_0x5d87dd[_0x29fd('0x49')]['id']}})['then'](handleEntityNotFound(_0x316cef,null))[_0x29fd('0x28')](function(_0x2442ce){if(_0x2442ce){_0x518ea9=_0x2442ce;_0x4cca7d['model']=_[_0x29fd('0x36')](db[_0x29fd('0x55')][_0x29fd('0x31')]);_0x4cca7d[_0x29fd('0x35')]=_[_0x29fd('0x36')](_0x5d87dd['query']);_0x4cca7d[_0x29fd('0x37')]=_[_0x29fd('0x38')](_0x4cca7d[_0x29fd('0x34')],_0x4cca7d[_0x29fd('0x35')]);_0x27909a['attributes']=_[_0x29fd('0x38')](_0x4cca7d['model'],qs[_0x29fd('0x3a')](_0x5d87dd[_0x29fd('0x35')][_0x29fd('0x3a')]));_0x27909a[_0x29fd('0x39')]=_0x27909a['attributes']['length']?_0x27909a[_0x29fd('0x39')]:_0x4cca7d[_0x29fd('0x34')];_0x27909a[_0x29fd('0x53')]=qs[_0x29fd('0x3c')](_0x5d87dd['query']['sort']);_0x27909a[_0x29fd('0x3d')]=qs[_0x29fd('0x37')](_[_0x29fd('0x3e')](_0x5d87dd[_0x29fd('0x35')],_0x4cca7d['filters']));if(_0x5d87dd[_0x29fd('0x35')][_0x29fd('0x3f')]){_0x27909a[_0x29fd('0x3d')]=_['merge'](_0x27909a[_0x29fd('0x3d')],{'$or':_[_0x29fd('0x2f')](_0x27909a[_0x29fd('0x39')],function(_0x1d52eb){var _0x4690bb={};_0x4690bb[_0x1d52eb]={'$like':'%'+_0x5d87dd[_0x29fd('0x35')]['filter']+'%'};return _0x4690bb;})});}_0x27909a=_['merge']({},_0x27909a,_0x5d87dd['options']);return _0x518ea9['getActions'](_0x27909a);}})[_0x29fd('0x28')](function(_0x2d3e7b){if(_0x2d3e7b){_0x2e90dc=_0x2d3e7b[_0x29fd('0x52')];if(!_0x5d87dd['query'][_0x29fd('0x58')](_0x29fd('0x3b'))){_0x27909a['limit']=qs[_0x29fd('0x20')](_0x5d87dd[_0x29fd('0x35')][_0x29fd('0x20')]);_0x27909a[_0x29fd('0x1e')]=qs[_0x29fd('0x1e')](_0x5d87dd[_0x29fd('0x35')][_0x29fd('0x1e')]);}return _0x518ea9[_0x29fd('0x57')](_0x27909a);}})['then'](function(_0x34d80b){if(_0x34d80b){return _0x34d80b?{'count':_0x2e90dc,'rows':_0x34d80b}:null;}})[_0x29fd('0x28')](respondWithResult(_0x316cef,null))[_0x29fd('0x47')](handleError(_0x316cef,null));};
\ No newline at end of file
+var _0x6c19=['mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','then','error','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','options','Automation','includeAll','include','findAll','rows','catch','params','length','find','create','update','body','addConditions','omit','ids','getConditions','nolimit','Action','addActions','getActions','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x1917cd,_0x15a27f){var _0x423333=function(_0x55791e){while(--_0x55791e){_0x1917cd['push'](_0x1917cd['shift']());}};_0x423333(++_0x15a27f);}(_0x6c19,0xa0));var _0x96c1=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0x6c19[_0x3a73bc];return _0x32891b;};'use strict';var emlformat=require(_0x96c1('0x0'));var rimraf=require(_0x96c1('0x1'));var zipdir=require(_0x96c1('0x2'));var jsonpatch=require(_0x96c1('0x3'));var rp=require(_0x96c1('0x4'));var moment=require('moment');var BPromise=require(_0x96c1('0x5'));var Mustache=require(_0x96c1('0x6'));var util=require(_0x96c1('0x7'));var path=require(_0x96c1('0x8'));var sox=require(_0x96c1('0x9'));var csv=require(_0x96c1('0xa'));var ejs=require(_0x96c1('0xb'));var fs=require('fs');var fs_extra=require(_0x96c1('0xc'));var _=require(_0x96c1('0xd'));var squel=require(_0x96c1('0xe'));var crypto=require(_0x96c1('0xf'));var jsforce=require(_0x96c1('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x96c1('0x11'));var Papa=require('papaparse');var Redis=require(_0x96c1('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x96c1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96c1('0x14'));var logger=require(_0x96c1('0x15'))('api');var utils=require(_0x96c1('0x16'));var config=require(_0x96c1('0x17'));var licenseUtil=require(_0x96c1('0x18'));var db=require(_0x96c1('0x19'))['db'];function respondWithStatusCode(_0x2bf790,_0x3f9c62){_0x3f9c62=_0x3f9c62||0xcc;return function(_0x265f98){if(_0x265f98){return _0x2bf790[_0x96c1('0x1a')](_0x3f9c62);}return _0x2bf790[_0x96c1('0x1b')](_0x3f9c62)[_0x96c1('0x1c')]();};}function respondWithResult(_0x536d05,_0x3cf014){_0x3cf014=_0x3cf014||0xc8;return function(_0x40d0d7){if(_0x40d0d7){return _0x536d05[_0x96c1('0x1b')](_0x3cf014)[_0x96c1('0x1d')](_0x40d0d7);}};}function respondWithFilteredResult(_0x154f0a,_0x3e8a57){return function(_0x173489){if(_0x173489){var _0x359d7f=typeof _0x3e8a57[_0x96c1('0x1e')]==='undefined'&&typeof _0x3e8a57['limit']==='undefined';var _0x48dd65=_0x173489[_0x96c1('0x1f')];var _0x549a2c=_0x359d7f?0x0:_0x3e8a57[_0x96c1('0x1e')];var _0x3b0d30=_0x359d7f?_0x173489['count']:_0x3e8a57[_0x96c1('0x1e')]+_0x3e8a57[_0x96c1('0x20')];var _0x422ede;if(_0x3b0d30>=_0x48dd65){_0x3b0d30=_0x48dd65;_0x422ede=0xc8;}else{_0x422ede=0xce;}_0x154f0a['status'](_0x422ede);return _0x154f0a[_0x96c1('0x21')](_0x96c1('0x22'),_0x549a2c+'-'+_0x3b0d30+'/'+_0x48dd65)[_0x96c1('0x1d')](_0x173489);}return null;};}function patchUpdates(_0x518917){return function(_0x53e36b){try{jsonpatch[_0x96c1('0x23')](_0x53e36b,_0x518917,!![]);}catch(_0x43a0b0){return BPromise[_0x96c1('0x24')](_0x43a0b0);}return _0x53e36b[_0x96c1('0x25')]();};}function saveUpdates(_0x28d302,_0x34337c){return function(_0x215462){if(_0x215462){return _0x215462['update'](_0x28d302)[_0x96c1('0x26')](function(_0x223c69){return _0x223c69;});}return null;};}function removeEntity(_0x1f336c,_0x101359){return function(_0x776c70){if(_0x776c70){return _0x776c70['destroy']()[_0x96c1('0x26')](function(){_0x1f336c[_0x96c1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x139f84,_0x47602d){return function(_0x16b69f){if(!_0x16b69f){_0x139f84[_0x96c1('0x1a')](0x194);}return _0x16b69f;};}function handleError(_0x165f72,_0x38d90c){_0x38d90c=_0x38d90c||0x1f4;return function(_0x4848e3){logger[_0x96c1('0x27')](_0x4848e3['stack']);if(_0x4848e3[_0x96c1('0x28')]){delete _0x4848e3[_0x96c1('0x28')];}_0x165f72['status'](_0x38d90c)['send'](_0x4848e3);};}exports[_0x96c1('0x29')]=function(_0x4a5855,_0x3be430){var _0x294d6a={},_0x1de30a={},_0x974fb3={'count':0x0,'rows':[]};var _0x2b99a5=_[_0x96c1('0x2a')](db['Automation'][_0x96c1('0x2b')],function(_0x58d7a2){return{'name':_0x58d7a2[_0x96c1('0x2c')],'type':_0x58d7a2[_0x96c1('0x2d')][_0x96c1('0x2e')]};});_0x1de30a[_0x96c1('0x2f')]=_['map'](_0x2b99a5,'name');_0x1de30a[_0x96c1('0x30')]=_[_0x96c1('0x31')](_0x4a5855['query']);_0x1de30a[_0x96c1('0x32')]=_[_0x96c1('0x33')](_0x1de30a[_0x96c1('0x2f')],_0x1de30a[_0x96c1('0x30')]);_0x294d6a[_0x96c1('0x34')]=_[_0x96c1('0x33')](_0x1de30a[_0x96c1('0x2f')],qs[_0x96c1('0x35')](_0x4a5855[_0x96c1('0x30')][_0x96c1('0x35')]));_0x294d6a[_0x96c1('0x34')]=_0x294d6a[_0x96c1('0x34')]['length']?_0x294d6a['attributes']:_0x1de30a[_0x96c1('0x2f')];if(!_0x4a5855[_0x96c1('0x30')][_0x96c1('0x36')]('nolimit')){_0x294d6a[_0x96c1('0x20')]=qs[_0x96c1('0x20')](_0x4a5855[_0x96c1('0x30')]['limit']);_0x294d6a[_0x96c1('0x1e')]=qs['offset'](_0x4a5855[_0x96c1('0x30')][_0x96c1('0x1e')]);}_0x294d6a[_0x96c1('0x37')]=qs['sort'](_0x4a5855['query'][_0x96c1('0x38')]);_0x294d6a['where']=qs['filters'](_[_0x96c1('0x39')](_0x4a5855['query'],_0x1de30a[_0x96c1('0x32')]),_0x2b99a5);if(_0x4a5855[_0x96c1('0x30')][_0x96c1('0x3a')]){_0x294d6a[_0x96c1('0x3b')]=_[_0x96c1('0x3c')](_0x294d6a[_0x96c1('0x3b')],{'$or':_[_0x96c1('0x2a')](_0x2b99a5,function(_0x3a534){if(_0x3a534[_0x96c1('0x2d')]!=='VIRTUAL'){var _0x53846a={};_0x53846a[_0x3a534[_0x96c1('0x28')]]={'$like':'%'+_0x4a5855[_0x96c1('0x30')][_0x96c1('0x3a')]+'%'};return _0x53846a;}})});}_0x294d6a=_[_0x96c1('0x3c')]({},_0x294d6a,_0x4a5855[_0x96c1('0x3d')]);var _0x47803b={'where':_0x294d6a[_0x96c1('0x3b')]};return db[_0x96c1('0x3e')][_0x96c1('0x1f')](_0x47803b)[_0x96c1('0x26')](function(_0x10625c){_0x974fb3['count']=_0x10625c;if(_0x4a5855[_0x96c1('0x30')][_0x96c1('0x3f')]){_0x294d6a[_0x96c1('0x40')]=[{'all':!![]}];}return db[_0x96c1('0x3e')][_0x96c1('0x41')](_0x294d6a);})[_0x96c1('0x26')](function(_0x505d3c){_0x974fb3[_0x96c1('0x42')]=_0x505d3c;return _0x974fb3;})['then'](respondWithFilteredResult(_0x3be430,_0x294d6a))[_0x96c1('0x43')](handleError(_0x3be430,null));};exports['show']=function(_0x2817c5,_0x70727d){var _0x4f9e86={'raw':![],'where':{'id':_0x2817c5[_0x96c1('0x44')]['id']}},_0x1f86f3={};_0x1f86f3[_0x96c1('0x2f')]=_[_0x96c1('0x31')](db[_0x96c1('0x3e')][_0x96c1('0x2b')]);_0x1f86f3[_0x96c1('0x30')]=_['keys'](_0x2817c5[_0x96c1('0x30')]);_0x1f86f3[_0x96c1('0x32')]=_['intersection'](_0x1f86f3['model'],_0x1f86f3[_0x96c1('0x30')]);_0x4f9e86[_0x96c1('0x34')]=_[_0x96c1('0x33')](_0x1f86f3['model'],qs['fields'](_0x2817c5['query'][_0x96c1('0x35')]));_0x4f9e86[_0x96c1('0x34')]=_0x4f9e86['attributes'][_0x96c1('0x45')]?_0x4f9e86[_0x96c1('0x34')]:_0x1f86f3[_0x96c1('0x2f')];if(_0x2817c5[_0x96c1('0x30')][_0x96c1('0x3f')]){_0x4f9e86[_0x96c1('0x40')]=[{'all':!![]}];}_0x4f9e86=_[_0x96c1('0x3c')]({},_0x4f9e86,_0x2817c5[_0x96c1('0x3d')]);return db[_0x96c1('0x3e')][_0x96c1('0x46')](_0x4f9e86)[_0x96c1('0x26')](handleEntityNotFound(_0x70727d,null))['then'](respondWithResult(_0x70727d,null))[_0x96c1('0x43')](handleError(_0x70727d,null));};exports['create']=function(_0x42803f,_0x5c99a1){return db[_0x96c1('0x3e')][_0x96c1('0x47')](_0x42803f['body'],{})[_0x96c1('0x26')](respondWithResult(_0x5c99a1,0xc9))[_0x96c1('0x43')](handleError(_0x5c99a1,null));};exports[_0x96c1('0x48')]=function(_0x33007a,_0x4b73eb){if(_0x33007a[_0x96c1('0x49')]['id']){delete _0x33007a['body']['id'];}return db[_0x96c1('0x3e')]['find']({'where':{'id':_0x33007a['params']['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x4b73eb,null))[_0x96c1('0x26')](saveUpdates(_0x33007a[_0x96c1('0x49')],null))[_0x96c1('0x26')](respondWithResult(_0x4b73eb,null))[_0x96c1('0x43')](handleError(_0x4b73eb,null));};exports['destroy']=function(_0x4fd64a,_0x180a8d){return db['Automation']['find']({'where':{'id':_0x4fd64a['params']['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x180a8d,null))['then'](removeEntity(_0x180a8d,null))['catch'](handleError(_0x180a8d,null));};exports[_0x96c1('0x4a')]=function(_0x4bf756,_0x50a53e,_0x574440){return db['Condition'][_0x96c1('0x46')]({'where':{'id':_0x4bf756[_0x96c1('0x44')]['id']}})['then'](handleEntityNotFound(_0x50a53e,null))['then'](function(_0x270b39){if(_0x270b39){return _0x270b39[_0x96c1('0x4a')](_0x4bf756[_0x96c1('0x49')]['ids'],_[_0x96c1('0x4b')](_0x4bf756[_0x96c1('0x49')],[_0x96c1('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x50a53e,null))[_0x96c1('0x43')](handleError(_0x50a53e,null));};exports['getConditions']=function(_0x441dcc,_0x1ae8f1,_0x1ea1d6){var _0x2c8415={};var _0x36bc7d={};var _0x5345fb;var _0x8723b;return db[_0x96c1('0x3e')]['findOne']({'where':{'id':_0x441dcc[_0x96c1('0x44')]['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x1ae8f1,null))['then'](function(_0x93fa1){if(_0x93fa1){_0x5345fb=_0x93fa1;_0x36bc7d[_0x96c1('0x2f')]=_[_0x96c1('0x31')](db['Condition'][_0x96c1('0x2b')]);_0x36bc7d[_0x96c1('0x30')]=_['keys'](_0x441dcc[_0x96c1('0x30')]);_0x36bc7d[_0x96c1('0x32')]=_[_0x96c1('0x33')](_0x36bc7d[_0x96c1('0x2f')],_0x36bc7d[_0x96c1('0x30')]);_0x2c8415['attributes']=_[_0x96c1('0x33')](_0x36bc7d[_0x96c1('0x2f')],qs['fields'](_0x441dcc[_0x96c1('0x30')][_0x96c1('0x35')]));_0x2c8415[_0x96c1('0x34')]=_0x2c8415[_0x96c1('0x34')]['length']?_0x2c8415[_0x96c1('0x34')]:_0x36bc7d[_0x96c1('0x2f')];_0x2c8415[_0x96c1('0x37')]=qs[_0x96c1('0x38')](_0x441dcc[_0x96c1('0x30')][_0x96c1('0x38')]);_0x2c8415[_0x96c1('0x3b')]=qs[_0x96c1('0x32')](_[_0x96c1('0x39')](_0x441dcc[_0x96c1('0x30')],_0x36bc7d[_0x96c1('0x32')]));if(_0x441dcc[_0x96c1('0x30')][_0x96c1('0x3a')]){_0x2c8415[_0x96c1('0x3b')]=_['merge'](_0x2c8415['where'],{'$or':_['map'](_0x2c8415[_0x96c1('0x34')],function(_0x3ae174){var _0x5e2808={};_0x5e2808[_0x3ae174]={'$like':'%'+_0x441dcc['query']['filter']+'%'};return _0x5e2808;})});}_0x2c8415=_[_0x96c1('0x3c')]({},_0x2c8415,_0x441dcc[_0x96c1('0x3d')]);return _0x5345fb[_0x96c1('0x4d')](_0x2c8415);}})[_0x96c1('0x26')](function(_0x2f00a0){if(_0x2f00a0){_0x8723b=_0x2f00a0[_0x96c1('0x45')];if(!_0x441dcc[_0x96c1('0x30')][_0x96c1('0x36')](_0x96c1('0x4e'))){_0x2c8415[_0x96c1('0x20')]=qs['limit'](_0x441dcc[_0x96c1('0x30')][_0x96c1('0x20')]);_0x2c8415['offset']=qs['offset'](_0x441dcc[_0x96c1('0x30')]['offset']);}return _0x5345fb['getConditions'](_0x2c8415);}})[_0x96c1('0x26')](function(_0x22828d){if(_0x22828d){return _0x22828d?{'count':_0x8723b,'rows':_0x22828d}:null;}})[_0x96c1('0x26')](respondWithResult(_0x1ae8f1,null))[_0x96c1('0x43')](handleError(_0x1ae8f1,null));};exports['addActions']=function(_0x530be5,_0x3e104f,_0x16b755){return db[_0x96c1('0x4f')][_0x96c1('0x46')]({'where':{'id':_0x530be5[_0x96c1('0x44')]['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x3e104f,null))[_0x96c1('0x26')](function(_0x45577d){if(_0x45577d){return _0x45577d[_0x96c1('0x50')](_0x530be5[_0x96c1('0x49')]['ids'],_[_0x96c1('0x4b')](_0x530be5[_0x96c1('0x49')],[_0x96c1('0x4c'),'id'])||{});}})[_0x96c1('0x26')](respondWithResult(_0x3e104f,null))['catch'](handleError(_0x3e104f,null));};exports[_0x96c1('0x51')]=function(_0x1bc90a,_0x342e00,_0x1beec1){var _0x583f90={};var _0x5e5ea3={};var _0x4f6b66;var _0x821f1a;return db['Automation'][_0x96c1('0x52')]({'where':{'id':_0x1bc90a[_0x96c1('0x44')]['id']}})[_0x96c1('0x26')](handleEntityNotFound(_0x342e00,null))[_0x96c1('0x26')](function(_0x2bb636){if(_0x2bb636){_0x4f6b66=_0x2bb636;_0x5e5ea3[_0x96c1('0x2f')]=_[_0x96c1('0x31')](db[_0x96c1('0x4f')][_0x96c1('0x2b')]);_0x5e5ea3[_0x96c1('0x30')]=_[_0x96c1('0x31')](_0x1bc90a[_0x96c1('0x30')]);_0x5e5ea3['filters']=_['intersection'](_0x5e5ea3['model'],_0x5e5ea3[_0x96c1('0x30')]);_0x583f90[_0x96c1('0x34')]=_[_0x96c1('0x33')](_0x5e5ea3[_0x96c1('0x2f')],qs[_0x96c1('0x35')](_0x1bc90a[_0x96c1('0x30')]['fields']));_0x583f90['attributes']=_0x583f90[_0x96c1('0x34')][_0x96c1('0x45')]?_0x583f90[_0x96c1('0x34')]:_0x5e5ea3['model'];_0x583f90['order']=qs['sort'](_0x1bc90a['query'][_0x96c1('0x38')]);_0x583f90['where']=qs['filters'](_['pick'](_0x1bc90a['query'],_0x5e5ea3[_0x96c1('0x32')]));if(_0x1bc90a[_0x96c1('0x30')][_0x96c1('0x3a')]){_0x583f90[_0x96c1('0x3b')]=_['merge'](_0x583f90[_0x96c1('0x3b')],{'$or':_['map'](_0x583f90[_0x96c1('0x34')],function(_0x508776){var _0x52b6c9={};_0x52b6c9[_0x508776]={'$like':'%'+_0x1bc90a[_0x96c1('0x30')][_0x96c1('0x3a')]+'%'};return _0x52b6c9;})});}_0x583f90=_[_0x96c1('0x3c')]({},_0x583f90,_0x1bc90a[_0x96c1('0x3d')]);return _0x4f6b66[_0x96c1('0x51')](_0x583f90);}})[_0x96c1('0x26')](function(_0x2a7b78){if(_0x2a7b78){_0x821f1a=_0x2a7b78['length'];if(!_0x1bc90a[_0x96c1('0x30')]['hasOwnProperty']('nolimit')){_0x583f90['limit']=qs[_0x96c1('0x20')](_0x1bc90a[_0x96c1('0x30')][_0x96c1('0x20')]);_0x583f90[_0x96c1('0x1e')]=qs[_0x96c1('0x1e')](_0x1bc90a['query'][_0x96c1('0x1e')]);}return _0x4f6b66[_0x96c1('0x51')](_0x583f90);}})['then'](function(_0x12a455){if(_0x12a455){return _0x12a455?{'count':_0x821f1a,'rows':_0x12a455}:null;}})[_0x96c1('0x26')](respondWithResult(_0x342e00,null))[_0x96c1('0x43')](handleError(_0x342e00,null));};
\ No newline at end of file
index 2cbd54b..16d16b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb729=['./automation.attributes','exports','tools_automations','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb729,0x71));var _0x9b72=function(_0x744178,_0x33cef5){_0x744178=_0x744178-0x0;var _0x30b7d2=_0xb729[_0x744178];return _0x30b7d2;};'use strict';var _=require('lodash');var util=require(_0x9b72('0x0'));var logger=require(_0x9b72('0x1'))('api');var moment=require(_0x9b72('0x2'));var BPromise=require(_0x9b72('0x3'));var rp=require(_0x9b72('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b72('0x5'));var config=require(_0x9b72('0x6'));var attributes=require(_0x9b72('0x7'));module[_0x9b72('0x8')]=function(_0x2690cd,_0x4ed9f3){return _0x2690cd['define']('Automation',attributes,{'tableName':_0x9b72('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf021=['api','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger'];(function(_0x384943,_0xd57919){var _0x5b0735=function(_0x4e493e){while(--_0x4e493e){_0x384943['push'](_0x384943['shift']());}};_0x5b0735(++_0xd57919);}(_0xf021,0x1cb));var _0x1f02=function(_0x137fdc,_0x350ef5){_0x137fdc=_0x137fdc-0x0;var _0x4594b8=_0xf021[_0x137fdc];return _0x4594b8;};'use strict';var _=require(_0x1f02('0x0'));var util=require(_0x1f02('0x1'));var logger=require(_0x1f02('0x2'))(_0x1f02('0x3'));var moment=require('moment');var BPromise=require(_0x1f02('0x4'));var rp=require(_0x1f02('0x5'));var fs=require('fs');var path=require(_0x1f02('0x6'));var rimraf=require(_0x1f02('0x7'));var config=require(_0x1f02('0x8'));var attributes=require(_0x1f02('0x9'));module[_0x1f02('0xa')]=function(_0x40cec8,_0x580664){return _0x40cec8[_0x1f02('0xb')](_0x1f02('0xc'),attributes,{'tableName':_0x1f02('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a7c91d2..188b0f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e2=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb7e2,0x103));var _0x2b7e=function(_0x2827cc,_0x51f941){_0x2827cc=_0x2827cc-0x0;var _0x526a77=_0xb7e2[_0x2827cc];return _0x526a77;};'use strict';var _=require(_0x2b7e('0x0'));var util=require('util');var moment=require(_0x2b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x2b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2b7e('0x4'))(_0x2b7e('0x5'));var config=require(_0x2b7e('0x6'));var jayson=require(_0x2b7e('0x7'));var client=jayson[_0x2b7e('0x8')][_0x2b7e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d7a0b,_0xc23ec4,_0x45dc9f){return new BPromise(function(_0x10a31d,_0x49491c){return client[_0x2b7e('0xa')](_0x4d7a0b,_0x45dc9f)[_0x2b7e('0xb')](function(_0x2f5991){logger[_0x2b7e('0xc')](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');logger['debug'](_0x2b7e('0xe'),_0xc23ec4,_0x2b7e('0xf'),JSON[_0x2b7e('0x10')](_0x2f5991));if(_0x2f5991[_0x2b7e('0x11')]){if(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x12')]===0x1f4){logger[_0x2b7e('0x11')]('Automation,\x20%s,\x20%s',_0xc23ec4,_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);return _0x49491c(_0x2f5991[_0x2b7e('0x11')][_0x2b7e('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0xc23ec4,_0x2f5991['error'][_0x2b7e('0x13')]);return _0x10a31d(_0x2f5991['error'][_0x2b7e('0x13')]);}else{logger['info'](_0x2b7e('0xd'),_0xc23ec4,'request\x20sent');_0x10a31d(_0x2f5991[_0x2b7e('0x14')][_0x2b7e('0x13')]);}})[_0x2b7e('0x15')](function(_0x4d85c3){logger[_0x2b7e('0x11')](_0x2b7e('0xd'),_0xc23ec4,_0x4d85c3);_0x49491c(_0x4d85c3);});});}
\ No newline at end of file
+var _0x70e3=['then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1beaec,_0x47c1dd){var _0xb46d86=function(_0x1ee9c3){while(--_0x1ee9c3){_0x1beaec['push'](_0x1beaec['shift']());}};_0xb46d86(++_0x47c1dd);}(_0x70e3,0x9d));var _0x370e=function(_0x480bc8,_0x1fac40){_0x480bc8=_0x480bc8-0x0;var _0x28c245=_0x70e3[_0x480bc8];return _0x28c245;};'use strict';var _=require(_0x370e('0x0'));var util=require(_0x370e('0x1'));var moment=require(_0x370e('0x2'));var BPromise=require(_0x370e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x370e('0x4'));var db=require(_0x370e('0x5'))['db'];var utils=require(_0x370e('0x6'));var logger=require('../../config/logger')(_0x370e('0x7'));var config=require(_0x370e('0x8'));var jayson=require(_0x370e('0x9'));var client=jayson[_0x370e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a2aaf,_0x5f57ea,_0x4a6884){return new BPromise(function(_0x5e5c79,_0x4086c4){return client['request'](_0x3a2aaf,_0x4a6884)[_0x370e('0xb')](function(_0x52d611){logger[_0x370e('0xc')](_0x370e('0xd'),_0x5f57ea,'request\x20sent');logger['debug'](_0x370e('0xe'),_0x5f57ea,_0x370e('0xf'),JSON[_0x370e('0x10')](_0x52d611));if(_0x52d611[_0x370e('0x11')]){if(_0x52d611[_0x370e('0x11')]['code']===0x1f4){logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x4086c4(_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);}logger[_0x370e('0x11')](_0x370e('0xd'),_0x5f57ea,_0x52d611[_0x370e('0x11')][_0x370e('0x12')]);return _0x5e5c79(_0x52d611[_0x370e('0x11')]['message']);}else{logger['info']('Automation,\x20%s,\x20%s',_0x5f57ea,_0x370e('0xf'));_0x5e5c79(_0x52d611[_0x370e('0x13')][_0x370e('0x12')]);}})[_0x370e('0x14')](function(_0xb8381f){logger[_0x370e('0x11')]('Automation,\x20%s,\x20%s',_0x5f57ea,_0xb8381f);_0x4086c4(_0xb8381f);});});}
\ No newline at end of file
index b4180c3..19834e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe011=['show','/:id/conditions','/:id/actions','getActions','addConditions','post','addActions','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id'];(function(_0x1d046a,_0x30db41){var _0x2c0b0c=function(_0x30a3c5){while(--_0x30a3c5){_0x1d046a['push'](_0x1d046a['shift']());}};_0x2c0b0c(++_0x30db41);}(_0xe011,0x14c));var _0x1e01=function(_0x561771,_0x554760){_0x561771=_0x561771-0x0;var _0x54d16e=_0xe011[_0x561771];return _0x54d16e;};'use strict';var multer=require(_0x1e01('0x0'));var util=require(_0x1e01('0x1'));var path=require(_0x1e01('0x2'));var timeout=require(_0x1e01('0x3'));var express=require(_0x1e01('0x4'));var router=express['Router']();var fs_extra=require(_0x1e01('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1e01('0x6'));var config=require(_0x1e01('0x7'));var controller=require(_0x1e01('0x8'));router[_0x1e01('0x9')]('/',auth[_0x1e01('0xa')](),controller[_0x1e01('0xb')]);router[_0x1e01('0x9')](_0x1e01('0xc'),auth[_0x1e01('0xa')](),controller[_0x1e01('0xd')]);router[_0x1e01('0x9')](_0x1e01('0xe'),auth[_0x1e01('0xa')](),controller['getConditions']);router[_0x1e01('0x9')](_0x1e01('0xf'),auth[_0x1e01('0xa')](),controller[_0x1e01('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x1e01('0xe'),auth[_0x1e01('0xa')](),controller[_0x1e01('0x11')]);router[_0x1e01('0x12')]('/:id/actions',auth[_0x1e01('0xa')](),controller[_0x1e01('0x13')]);router[_0x1e01('0x14')](_0x1e01('0xc'),auth['isAuthenticated'](),controller[_0x1e01('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x1e01('0x16')]=router;
\ No newline at end of file
+var _0x98d5=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','get','show','getConditions','/:id/actions','getActions','create','post','/:id/conditions','addConditions','addActions','put','/:id','delete','destroy'];(function(_0x38e2eb,_0x215eaa){var _0x230647=function(_0x170de4){while(--_0x170de4){_0x38e2eb['push'](_0x38e2eb['shift']());}};_0x230647(++_0x215eaa);}(_0x98d5,0xfb));var _0x598d=function(_0x1fd086,_0x388ded){_0x1fd086=_0x1fd086-0x0;var _0x5a962d=_0x98d5[_0x1fd086];return _0x5a962d;};'use strict';var multer=require(_0x598d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x598d('0x1'));var express=require(_0x598d('0x2'));var router=express[_0x598d('0x3')]();var fs_extra=require(_0x598d('0x4'));var auth=require(_0x598d('0x5'));var interaction=require(_0x598d('0x6'));var config=require(_0x598d('0x7'));var controller=require(_0x598d('0x8'));router['get']('/',auth[_0x598d('0x9')](),controller['index']);router[_0x598d('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x598d('0xb')]);router[_0x598d('0xa')]('/:id/conditions',auth[_0x598d('0x9')](),controller[_0x598d('0xc')]);router[_0x598d('0xa')](_0x598d('0xd'),auth[_0x598d('0x9')](),controller[_0x598d('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x598d('0xf')]);router[_0x598d('0x10')](_0x598d('0x11'),auth[_0x598d('0x9')](),controller[_0x598d('0x12')]);router[_0x598d('0x10')](_0x598d('0xd'),auth[_0x598d('0x9')](),controller[_0x598d('0x13')]);router[_0x598d('0x14')](_0x598d('0x15'),auth[_0x598d('0x9')](),controller['update']);router[_0x598d('0x16')]('/:id',auth[_0x598d('0x9')](),controller[_0x598d('0x17')]);module[_0x598d('0x18')]=router;
\ No newline at end of file
index 9685fd0..87f8146 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73f2=['name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','ENUM','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','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)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING'];(function(_0x589aee,_0x140a03){var _0x2f5ed4=function(_0x3d224f){while(--_0x3d224f){_0x589aee['push'](_0x589aee['shift']());}};_0x2f5ed4(++_0x140a03);}(_0x73f2,0xc5));var _0x273f=function(_0x546a74,_0x413d8c){_0x546a74=_0x546a74-0x0;var _0x3a3430=_0x73f2[_0x546a74];return _0x3a3430;};'use strict';var Sequelize=require(_0x273f('0x0'));module[_0x273f('0x1')]={'name':{'type':Sequelize[_0x273f('0x2')],'unique':_0x273f('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM']('ivr'),'allowNull':![],'defaultValue':_0x273f('0x4')},'description':{'type':Sequelize[_0x273f('0x2')]},'active':{'type':Sequelize[_0x273f('0x5')],'defaultValue':0x0,'comment':_0x273f('0x6')},'limitCalls':{'type':Sequelize[_0x273f('0x7')](0x4)[_0x273f('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x273f('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x273f('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x273f('0x7')](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x273f('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x273f('0x7')](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x273f('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x3,'comment':_0x273f('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x273f('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x273f('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x273f('0x2')],'defaultValue':_0x273f('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x273f('0x12')](_0x273f('0x13'),'never','onlyIfOpen'),'defaultValue':_0x273f('0x13')},'dialAMDActive':{'type':Sequelize[_0x273f('0x5')],'defaultValue':0x0,'comment':_0x273f('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x273f('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x273f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x273f('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x273f('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x273f('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x273f('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x273f('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x273f('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x273f('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x273f('0x7')](0x9)[_0x273f('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x273f('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize[_0x273f('0x12')](_0x273f('0x1d'),_0x273f('0x1e')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x273f('0x1f')},'dialCutDigit':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x273f('0x20')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x273f('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x273f('0x22')},'dialDropMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0x23')},'dialDropRetryFrequency':{'type':Sequelize[_0x273f('0x7')](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x273f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x273f('0x7')](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0x25')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x273f('0x7')](0x3)[_0x273f('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x273f('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x273f('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x273f('0x27')}};
\ No newline at end of file
+var _0x6b5f=['#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','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)','#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','name','ENUM','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','#AMD\x20Initial\x20Silence','#AMD\x20Greeting'];(function(_0x17dcff,_0x546d31){var _0x27618b=function(_0x17030e){while(--_0x17030e){_0x17dcff['push'](_0x17dcff['shift']());}};_0x27618b(++_0x546d31);}(_0x6b5f,0x119));var _0xf6b5=function(_0xedc9e1,_0x458222){_0xedc9e1=_0xedc9e1-0x0;var _0x2aed13=_0x6b5f[_0xedc9e1];return _0x2aed13;};'use strict';var Sequelize=require(_0xf6b5('0x0'));module[_0xf6b5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf6b5('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xf6b5('0x3')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0xf6b5('0x4')]},'active':{'type':Sequelize[_0xf6b5('0x5')],'defaultValue':0x0,'comment':_0xf6b5('0x6')},'limitCalls':{'type':Sequelize[_0xf6b5('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf6b5('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf6b5('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf6b5('0x4')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xf6b5('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0xb')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xf6b5('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf6b5('0x10')},'dialTimezone':{'type':Sequelize[_0xf6b5('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf6b5('0x4')],'defaultValue':_0xf6b5('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xf6b5('0x3')]('always',_0xf6b5('0x12'),_0xf6b5('0x13')),'defaultValue':_0xf6b5('0x14')},'dialAMDActive':{'type':Sequelize[_0xf6b5('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf6b5('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf6b5('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf6b5('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xf6b5('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf6b5('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf6b5('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xf6b5('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf6b5('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf6b5('0x7')](0x9)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf6b5('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xf6b5('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0xf6b5('0x1b')},'dialPrefix':{'type':Sequelize[_0xf6b5('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf6b5('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf6b5('0x1c')},'dialCutDigit':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf6b5('0x7')](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x22')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf6b5('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf6b5('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf6b5('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf6b5('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf6b5('0x7')](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
index 89f1406..cb4f7d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7e3=['merge','VIRTUAL','options','findAll','params','includeAll','include','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','user','IvrCampaigns','findOne','CmHopper','nolimit','order','getHopperHistories','CmHopperHistory','hasOwnProperty','CampaignId','getHopperFinals','CmHopperFinal','pick','getHopperBlacks','CmHopperBlack','rows','getLists','addLists','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','push','sequelize','all','removeLists','ids','CmList','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','json','apply','save','update','then','get','destroy','error','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','filter','where'];(function(_0x5d1722,_0x437c1b){var _0x446bc2=function(_0x5c5fa4){while(--_0x5c5fa4){_0x5d1722['push'](_0x5d1722['shift']());}};_0x446bc2(++_0x437c1b);}(_0xd7e3,0x1e1));var _0x3d7e=function(_0xd47873,_0x3c84c3){_0xd47873=_0xd47873-0x0;var _0x31b714=_0xd7e3[_0xd47873];return _0x31b714;};'use strict';var emlformat=require(_0x3d7e('0x0'));var rimraf=require(_0x3d7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3d7e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d7e('0x3'));var Mustache=require(_0x3d7e('0x4'));var util=require(_0x3d7e('0x5'));var path=require('path');var sox=require(_0x3d7e('0x6'));var csv=require(_0x3d7e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d7e('0x8'));var _=require(_0x3d7e('0x9'));var squel=require(_0x3d7e('0xa'));var crypto=require(_0x3d7e('0xb'));var jsforce=require(_0x3d7e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3d7e('0x7'));var querystring=require(_0x3d7e('0xd'));var Papa=require(_0x3d7e('0xe'));var Redis=require(_0x3d7e('0xf'));var authService=require(_0x3d7e('0x10'));var qs=require(_0x3d7e('0x11'));var as=require(_0x3d7e('0x12'));var hardwareService=require(_0x3d7e('0x13'));var logger=require(_0x3d7e('0x14'))(_0x3d7e('0x15'));var utils=require(_0x3d7e('0x16'));var config=require(_0x3d7e('0x17'));var licenseUtil=require(_0x3d7e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24cb63,_0x276c70){_0x276c70=_0x276c70||0xcc;return function(_0x49a55b){if(_0x49a55b){return _0x24cb63[_0x3d7e('0x19')](_0x276c70);}return _0x24cb63['status'](_0x276c70)['end']();};}function respondWithResult(_0x24664e,_0x1f81e4){_0x1f81e4=_0x1f81e4||0xc8;return function(_0x464dc6){if(_0x464dc6){return _0x24664e[_0x3d7e('0x1a')](_0x1f81e4)['json'](_0x464dc6);}};}function respondWithFilteredResult(_0x538e83,_0x4bc159){return function(_0x34c568){if(_0x34c568){var _0x1d2e70=typeof _0x4bc159[_0x3d7e('0x1b')]===_0x3d7e('0x1c')&&typeof _0x4bc159[_0x3d7e('0x1d')]==='undefined';var _0x2c19fa=_0x34c568[_0x3d7e('0x1e')];var _0x426f9b=_0x1d2e70?0x0:_0x4bc159[_0x3d7e('0x1b')];var _0xf9de45=_0x1d2e70?_0x34c568[_0x3d7e('0x1e')]:_0x4bc159[_0x3d7e('0x1b')]+_0x4bc159['limit'];var _0x52ef44;if(_0xf9de45>=_0x2c19fa){_0xf9de45=_0x2c19fa;_0x52ef44=0xc8;}else{_0x52ef44=0xce;}_0x538e83[_0x3d7e('0x1a')](_0x52ef44);return _0x538e83['set']('Content-Range',_0x426f9b+'-'+_0xf9de45+'/'+_0x2c19fa)[_0x3d7e('0x1f')](_0x34c568);}return null;};}function patchUpdates(_0x11f98a){return function(_0x197aeb){try{jsonpatch[_0x3d7e('0x20')](_0x197aeb,_0x11f98a,!![]);}catch(_0x98b429){return BPromise['reject'](_0x98b429);}return _0x197aeb[_0x3d7e('0x21')]();};}function saveUpdates(_0x51c50b,_0x102394){return function(_0x383c9a){if(_0x383c9a){return _0x383c9a[_0x3d7e('0x22')](_0x51c50b)[_0x3d7e('0x23')](function(_0x5942a2){return _0x5942a2;});}return null;};}function removeEntity(_0x11b90d,_0x3ace06){return function(_0x696f30){if(_0x696f30){return _0x696f30['destroy']()[_0x3d7e('0x23')](function(){var _0xaf316e=_0x696f30[_0x3d7e('0x24')]({'plain':!![]});var _0x5b54a5='IvrCampaigns';return db['UserProfileResource'][_0x3d7e('0x25')]({'where':{'type':_0x5b54a5,'resourceId':_0xaf316e['id']}})[_0x3d7e('0x23')](function(){return _0x696f30;});})[_0x3d7e('0x23')](function(){_0x11b90d[_0x3d7e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x314298,_0x2dac7f){return function(_0x5ce1f8){if(!_0x5ce1f8){_0x314298[_0x3d7e('0x19')](0x194);}return _0x5ce1f8;};}function handleError(_0x5cc56a,_0x25ad3b){_0x25ad3b=_0x25ad3b||0x1f4;return function(_0x2035e2){logger[_0x3d7e('0x26')](_0x2035e2['stack']);if(_0x2035e2[_0x3d7e('0x27')]){delete _0x2035e2['name'];}_0x5cc56a[_0x3d7e('0x1a')](_0x25ad3b)[_0x3d7e('0x28')](_0x2035e2);};}exports[_0x3d7e('0x29')]=function(_0x58ea44,_0x4763de){var _0x3bec2f={},_0x89ae48={},_0x46b4e4={'count':0x0,'rows':[]};var _0xa26b7f=_[_0x3d7e('0x2a')](db[_0x3d7e('0x2b')][_0x3d7e('0x2c')],function(_0x18722d){return{'name':_0x18722d[_0x3d7e('0x2d')],'type':_0x18722d[_0x3d7e('0x2e')][_0x3d7e('0x2f')]};});_0x89ae48[_0x3d7e('0x30')]=_[_0x3d7e('0x2a')](_0xa26b7f,_0x3d7e('0x27'));_0x89ae48[_0x3d7e('0x31')]=_[_0x3d7e('0x32')](_0x58ea44[_0x3d7e('0x31')]);_0x89ae48[_0x3d7e('0x33')]=_[_0x3d7e('0x34')](_0x89ae48[_0x3d7e('0x30')],_0x89ae48[_0x3d7e('0x31')]);_0x3bec2f[_0x3d7e('0x35')]=_[_0x3d7e('0x34')](_0x89ae48[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0x58ea44[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x3bec2f['attributes']=_0x3bec2f['attributes'][_0x3d7e('0x37')]?_0x3bec2f['attributes']:_0x89ae48['model'];if(!_0x58ea44[_0x3d7e('0x31')]['hasOwnProperty']('nolimit')){_0x3bec2f[_0x3d7e('0x1d')]=qs['limit'](_0x58ea44[_0x3d7e('0x31')][_0x3d7e('0x1d')]);_0x3bec2f[_0x3d7e('0x1b')]=qs['offset'](_0x58ea44[_0x3d7e('0x31')][_0x3d7e('0x1b')]);}_0x3bec2f['order']=qs[_0x3d7e('0x38')](_0x58ea44['query'][_0x3d7e('0x38')]);_0x3bec2f['where']=qs['filters'](_['pick'](_0x58ea44['query'],_0x89ae48[_0x3d7e('0x33')]),_0xa26b7f);if(_0x58ea44[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x3bec2f[_0x3d7e('0x3a')]=_[_0x3d7e('0x3b')](_0x3bec2f['where'],{'$or':_[_0x3d7e('0x2a')](_0xa26b7f,function(_0x5ba565){if(_0x5ba565[_0x3d7e('0x2e')]!==_0x3d7e('0x3c')){var _0x9759a5={};_0x9759a5[_0x5ba565[_0x3d7e('0x27')]]={'$like':'%'+_0x58ea44[_0x3d7e('0x31')]['filter']+'%'};return _0x9759a5;}})});}_0x3bec2f=_['merge']({},_0x3bec2f,_0x58ea44[_0x3d7e('0x3d')]);var _0x51171c={'where':_0x3bec2f[_0x3d7e('0x3a')]};return db['Campaign'][_0x3d7e('0x1e')](_0x51171c)[_0x3d7e('0x23')](function(_0x398e20){_0x46b4e4[_0x3d7e('0x1e')]=_0x398e20;if(_0x58ea44['query']['includeAll']){_0x3bec2f['include']=[{'all':!![]}];}return db[_0x3d7e('0x2b')][_0x3d7e('0x3e')](_0x3bec2f);})[_0x3d7e('0x23')](function(_0x5b4516){_0x46b4e4['rows']=_0x5b4516;return _0x46b4e4;})[_0x3d7e('0x23')](respondWithFilteredResult(_0x4763de,_0x3bec2f))['catch'](handleError(_0x4763de,null));};exports['show']=function(_0x13bc5b,_0x473f45){var _0x515b6c={'raw':![],'where':{'id':_0x13bc5b[_0x3d7e('0x3f')]['id']}},_0x1ef1db={};_0x1ef1db[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db['Campaign'][_0x3d7e('0x2c')]);_0x1ef1db[_0x3d7e('0x31')]=_['keys'](_0x13bc5b['query']);_0x1ef1db[_0x3d7e('0x33')]=_[_0x3d7e('0x34')](_0x1ef1db[_0x3d7e('0x30')],_0x1ef1db[_0x3d7e('0x31')]);_0x515b6c[_0x3d7e('0x35')]=_[_0x3d7e('0x34')](_0x1ef1db[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0x13bc5b[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x515b6c[_0x3d7e('0x35')]=_0x515b6c[_0x3d7e('0x35')]['length']?_0x515b6c[_0x3d7e('0x35')]:_0x1ef1db['model'];if(_0x13bc5b[_0x3d7e('0x31')][_0x3d7e('0x40')]){_0x515b6c[_0x3d7e('0x41')]=[{'all':!![]}];}_0x515b6c=_['merge']({},_0x515b6c,_0x13bc5b['options']);return db['Campaign'][_0x3d7e('0x42')](_0x515b6c)['then'](handleEntityNotFound(_0x473f45,null))['then'](respondWithResult(_0x473f45,null))[_0x3d7e('0x43')](handleError(_0x473f45,null));};exports[_0x3d7e('0x44')]=function(_0x165717,_0x5a532a){return db[_0x3d7e('0x2b')][_0x3d7e('0x44')](_0x165717['body'],{})[_0x3d7e('0x23')](function(_0x43877e){var _0x1c3cb9=_0x165717['user'][_0x3d7e('0x24')]({'plain':!![]});if(!_0x1c3cb9)throw new Error(_0x3d7e('0x45'));if(_0x1c3cb9[_0x3d7e('0x46')]==='user'){var _0x127912=_0x43877e[_0x3d7e('0x24')]({'plain':!![]});var _0x308a64='IvrCampaigns';return db[_0x3d7e('0x47')][_0x3d7e('0x42')]({'where':{'name':_0x308a64,'userProfileId':_0x1c3cb9[_0x3d7e('0x48')]},'raw':!![]})[_0x3d7e('0x23')](function(_0x426105){if(_0x426105&&_0x426105[_0x3d7e('0x49')]===0x0){return db[_0x3d7e('0x4a')]['create']({'name':_0x127912[_0x3d7e('0x27')],'resourceId':_0x127912['id'],'type':_0x426105[_0x3d7e('0x27')],'sectionId':_0x426105['id']},{})[_0x3d7e('0x23')](function(){return _0x43877e;});}else{return _0x43877e;}})[_0x3d7e('0x43')](function(_0x5afc5e){logger['error'](_0x3d7e('0x4b'),_0x5afc5e);throw _0x5afc5e;});}return _0x43877e;})['then'](respondWithResult(_0x5a532a,0xc9))[_0x3d7e('0x43')](handleError(_0x5a532a,null));};exports[_0x3d7e('0x4c')]=function(_0x5c4e65,_0x45bef1){var _0xdb15c8={'where':{'id':_0x5c4e65[_0x3d7e('0x3f')]['id']}},_0x534ad6={};_0x534ad6[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db[_0x3d7e('0x2b')][_0x3d7e('0x2c')]);_0xdb15c8[_0x3d7e('0x35')]=_['intersection'](_0x534ad6[_0x3d7e('0x30')],qs['fields'](_0x5c4e65[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0xdb15c8[_0x3d7e('0x35')]=_0xdb15c8[_0x3d7e('0x35')]['length']?_0xdb15c8[_0x3d7e('0x35')]:_0x534ad6[_0x3d7e('0x30')];if(_0x5c4e65[_0x3d7e('0x31')][_0x3d7e('0x40')]){_0xdb15c8['include']=[{'all':!![]}];}_0xdb15c8=_[_0x3d7e('0x3b')]({},_0xdb15c8,_0x5c4e65[_0x3d7e('0x3d')]);return db['Campaign'][_0x3d7e('0x42')](_0xdb15c8)[_0x3d7e('0x23')](handleEntityNotFound(_0x45bef1,null))[_0x3d7e('0x23')](function(_0x1faace){if(_0x1faace){var _0xc6b3fa=_0x1faace[_0x3d7e('0x24')]({'plain':!![]});_0xc6b3fa=qs[_0x3d7e('0x4d')](_0xc6b3fa,['id',_0x3d7e('0x4e'),_0x3d7e('0x4f')]);_0x5c4e65[_0x3d7e('0x50')]=_[_0x3d7e('0x4d')](_0x5c4e65['body'],['id',_0x3d7e('0x4e'),_0x3d7e('0x4f')]);return db[_0x3d7e('0x2b')][_0x3d7e('0x44')](_['merge'](_0xc6b3fa,_0x5c4e65[_0x3d7e('0x50')]),{'include':_0x5c4e65['query'][_0x3d7e('0x40')]?[{'all':!![]}]:undefined})[_0x3d7e('0x23')](function(_0x31ab22){var _0x2c47b6=_0x5c4e65[_0x3d7e('0x51')][_0x3d7e('0x24')]({'plain':!![]});if(!_0x2c47b6)throw new Error(_0x3d7e('0x45'));if(_0x2c47b6[_0x3d7e('0x46')]===_0x3d7e('0x51')){var _0xd01b9a=_0x31ab22['get']({'plain':!![]});var _0x5921a0=_0x3d7e('0x52');return db['UserProfileSection'][_0x3d7e('0x42')]({'where':{'name':_0x5921a0,'userProfileId':_0x2c47b6[_0x3d7e('0x48')]},'raw':!![]})[_0x3d7e('0x23')](function(_0x1d65d0){if(_0x1d65d0&&_0x1d65d0[_0x3d7e('0x49')]===0x0){return db[_0x3d7e('0x4a')]['create']({'name':_0xd01b9a[_0x3d7e('0x27')],'resourceId':_0xd01b9a['id'],'type':_0x1d65d0[_0x3d7e('0x27')],'sectionId':_0x1d65d0['id']},{})['then'](function(){return _0x31ab22;});}else{return _0x31ab22;}})[_0x3d7e('0x43')](function(_0x19c1f2){logger[_0x3d7e('0x26')](_0x3d7e('0x4b'),_0x19c1f2);throw _0x19c1f2;});}return _0x31ab22;});}})[_0x3d7e('0x23')](respondWithResult(_0x45bef1,0xc9))[_0x3d7e('0x43')](handleError(_0x45bef1,null));};exports[_0x3d7e('0x22')]=function(_0x184311,_0x1036a7){if(_0x184311[_0x3d7e('0x50')]['id']){delete _0x184311[_0x3d7e('0x50')]['id'];}return db[_0x3d7e('0x2b')][_0x3d7e('0x42')]({'where':{'id':_0x184311[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x1036a7,null))[_0x3d7e('0x23')](saveUpdates(_0x184311['body'],null))[_0x3d7e('0x23')](respondWithResult(_0x1036a7,null))['catch'](handleError(_0x1036a7,null));};exports[_0x3d7e('0x25')]=function(_0xd75a81,_0x25fcbd){return db['Campaign']['find']({'where':{'id':_0xd75a81['params']['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x25fcbd,null))[_0x3d7e('0x23')](removeEntity(_0x25fcbd,null))['catch'](handleError(_0x25fcbd,null));};exports['getHoppers']=function(_0xe56775,_0x28f16b,_0x558344){var _0x403e83={'raw':!![],'where':{}};var _0x4ab858={};var _0x11c059={'count':0x0,'rows':[]};return db['Campaign'][_0x3d7e('0x53')]({'where':{'id':_0xe56775['params']['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x28f16b,null))['then'](function(_0x742910){if(_0x742910){_0x4ab858[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db[_0x3d7e('0x54')][_0x3d7e('0x2c')]);_0x4ab858[_0x3d7e('0x31')]=_[_0x3d7e('0x32')](_0xe56775[_0x3d7e('0x31')]);_0x4ab858['filters']=_['intersection'](_0x4ab858['model'],_0x4ab858[_0x3d7e('0x31')]);_0x403e83[_0x3d7e('0x35')]=_['intersection'](_0x4ab858[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0xe56775[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x403e83[_0x3d7e('0x35')]=_0x403e83['attributes']['length']?_0x403e83[_0x3d7e('0x35')]:_0x4ab858['model'];if(!_0xe56775[_0x3d7e('0x31')]['hasOwnProperty'](_0x3d7e('0x55'))){_0x403e83[_0x3d7e('0x1d')]=qs['limit'](_0xe56775['query'][_0x3d7e('0x1d')]);_0x403e83['offset']=qs[_0x3d7e('0x1b')](_0xe56775[_0x3d7e('0x31')][_0x3d7e('0x1b')]);}_0x403e83[_0x3d7e('0x56')]=qs[_0x3d7e('0x38')](_0xe56775[_0x3d7e('0x31')][_0x3d7e('0x38')]);_0x403e83[_0x3d7e('0x3a')]=qs[_0x3d7e('0x33')](_['pick'](_0xe56775['query'],_0x4ab858['filters']));_0x403e83[_0x3d7e('0x3a')]['CampaignId']=_0x742910['id'];if(_0xe56775[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x403e83['where']=_[_0x3d7e('0x3b')](_0x403e83['where'],{'$or':_[_0x3d7e('0x2a')](_0x403e83['attributes'],function(_0x3118eb){var _0x4f33b2={};_0x4f33b2[_0x3118eb]={'$like':'%'+_0xe56775['query'][_0x3d7e('0x39')]+'%'};return _0x4f33b2;})});}_0x403e83=_['merge']({},_0x403e83,_0xe56775[_0x3d7e('0x3d')]);return db['CmHopper'][_0x3d7e('0x1e')]({'where':_0x403e83[_0x3d7e('0x3a')]})[_0x3d7e('0x23')](function(_0xa45d7d){_0x11c059[_0x3d7e('0x1e')]=_0xa45d7d;if(_0xe56775[_0x3d7e('0x31')][_0x3d7e('0x40')]){_0x403e83['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x403e83);})[_0x3d7e('0x23')](function(_0x34b61a){_0x11c059['rows']=_0x34b61a;return _0x11c059;});}})['then'](respondWithFilteredResult(_0x28f16b,_0x403e83))[_0x3d7e('0x43')](handleError(_0x28f16b,null));};exports[_0x3d7e('0x57')]=function(_0x2e0ea9,_0x46bdca,_0x21dacb){var _0x56541a={'raw':!![],'where':{}};var _0x291908={};var _0x36626d={'count':0x0,'rows':[]};return db[_0x3d7e('0x2b')][_0x3d7e('0x53')]({'where':{'id':_0x2e0ea9[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x46bdca,null))['then'](function(_0x309adf){if(_0x309adf){_0x291908[_0x3d7e('0x30')]=_['keys'](db[_0x3d7e('0x58')]['rawAttributes']);_0x291908[_0x3d7e('0x31')]=_[_0x3d7e('0x32')](_0x2e0ea9[_0x3d7e('0x31')]);_0x291908[_0x3d7e('0x33')]=_[_0x3d7e('0x34')](_0x291908[_0x3d7e('0x30')],_0x291908['query']);_0x56541a[_0x3d7e('0x35')]=_[_0x3d7e('0x34')](_0x291908[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0x2e0ea9[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x56541a[_0x3d7e('0x35')]=_0x56541a[_0x3d7e('0x35')][_0x3d7e('0x37')]?_0x56541a[_0x3d7e('0x35')]:_0x291908[_0x3d7e('0x30')];if(!_0x2e0ea9[_0x3d7e('0x31')][_0x3d7e('0x59')](_0x3d7e('0x55'))){_0x56541a[_0x3d7e('0x1d')]=qs[_0x3d7e('0x1d')](_0x2e0ea9[_0x3d7e('0x31')][_0x3d7e('0x1d')]);_0x56541a['offset']=qs[_0x3d7e('0x1b')](_0x2e0ea9['query'][_0x3d7e('0x1b')]);}_0x56541a['order']=qs[_0x3d7e('0x38')](_0x2e0ea9[_0x3d7e('0x31')][_0x3d7e('0x38')]);_0x56541a['where']=qs[_0x3d7e('0x33')](_['pick'](_0x2e0ea9['query'],_0x291908[_0x3d7e('0x33')]));_0x56541a[_0x3d7e('0x3a')][_0x3d7e('0x5a')]=_0x309adf['id'];if(_0x2e0ea9[_0x3d7e('0x31')]['filter']){_0x56541a['where']=_[_0x3d7e('0x3b')](_0x56541a[_0x3d7e('0x3a')],{'$or':_[_0x3d7e('0x2a')](_0x56541a['attributes'],function(_0x2b41e9){var _0x28b233={};_0x28b233[_0x2b41e9]={'$like':'%'+_0x2e0ea9[_0x3d7e('0x31')][_0x3d7e('0x39')]+'%'};return _0x28b233;})});}_0x56541a=_['merge']({},_0x56541a,_0x2e0ea9[_0x3d7e('0x3d')]);return db[_0x3d7e('0x58')][_0x3d7e('0x1e')]({'where':_0x56541a['where']})[_0x3d7e('0x23')](function(_0xa0d38a){_0x36626d[_0x3d7e('0x1e')]=_0xa0d38a;if(_0x2e0ea9['query'][_0x3d7e('0x40')]){_0x56541a[_0x3d7e('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3d7e('0x3e')](_0x56541a);})[_0x3d7e('0x23')](function(_0x13f3e7){_0x36626d['rows']=_0x13f3e7;return _0x36626d;});}})[_0x3d7e('0x23')](respondWithFilteredResult(_0x46bdca,_0x56541a))[_0x3d7e('0x43')](handleError(_0x46bdca,null));};exports[_0x3d7e('0x5b')]=function(_0x47ff3e,_0x4b0cd3,_0xb688da){var _0x4b9a80={'raw':!![],'where':{}};var _0x3e7374={};var _0x29f5d2={'count':0x0,'rows':[]};return db[_0x3d7e('0x2b')]['findOne']({'where':{'id':_0x47ff3e[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x4b0cd3,null))[_0x3d7e('0x23')](function(_0x3469e1){if(_0x3469e1){_0x3e7374[_0x3d7e('0x30')]=_['keys'](db[_0x3d7e('0x5c')][_0x3d7e('0x2c')]);_0x3e7374['query']=_[_0x3d7e('0x32')](_0x47ff3e['query']);_0x3e7374[_0x3d7e('0x33')]=_[_0x3d7e('0x34')](_0x3e7374[_0x3d7e('0x30')],_0x3e7374[_0x3d7e('0x31')]);_0x4b9a80['attributes']=_[_0x3d7e('0x34')](_0x3e7374[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0x47ff3e['query'][_0x3d7e('0x36')]));_0x4b9a80[_0x3d7e('0x35')]=_0x4b9a80['attributes'][_0x3d7e('0x37')]?_0x4b9a80[_0x3d7e('0x35')]:_0x3e7374[_0x3d7e('0x30')];if(!_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x59')](_0x3d7e('0x55'))){_0x4b9a80[_0x3d7e('0x1d')]=qs[_0x3d7e('0x1d')](_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x1d')]);_0x4b9a80[_0x3d7e('0x1b')]=qs[_0x3d7e('0x1b')](_0x47ff3e[_0x3d7e('0x31')]['offset']);}_0x4b9a80[_0x3d7e('0x56')]=qs[_0x3d7e('0x38')](_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x38')]);_0x4b9a80[_0x3d7e('0x3a')]=qs[_0x3d7e('0x33')](_[_0x3d7e('0x5d')](_0x47ff3e[_0x3d7e('0x31')],_0x3e7374[_0x3d7e('0x33')]));_0x4b9a80[_0x3d7e('0x3a')][_0x3d7e('0x5a')]=_0x3469e1['id'];if(_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x4b9a80[_0x3d7e('0x3a')]=_[_0x3d7e('0x3b')](_0x4b9a80[_0x3d7e('0x3a')],{'$or':_[_0x3d7e('0x2a')](_0x4b9a80[_0x3d7e('0x35')],function(_0x3497ff){var _0x2ed049={};_0x2ed049[_0x3497ff]={'$like':'%'+_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x39')]+'%'};return _0x2ed049;})});}_0x4b9a80=_[_0x3d7e('0x3b')]({},_0x4b9a80,_0x47ff3e[_0x3d7e('0x3d')]);return db[_0x3d7e('0x5c')][_0x3d7e('0x1e')]({'where':_0x4b9a80[_0x3d7e('0x3a')]})[_0x3d7e('0x23')](function(_0x18d346){_0x29f5d2[_0x3d7e('0x1e')]=_0x18d346;if(_0x47ff3e[_0x3d7e('0x31')][_0x3d7e('0x40')]){_0x4b9a80[_0x3d7e('0x41')]=[{'all':!![]}];}return db[_0x3d7e('0x5c')][_0x3d7e('0x3e')](_0x4b9a80);})['then'](function(_0x2692da){_0x29f5d2['rows']=_0x2692da;return _0x29f5d2;});}})[_0x3d7e('0x23')](respondWithFilteredResult(_0x4b0cd3,_0x4b9a80))[_0x3d7e('0x43')](handleError(_0x4b0cd3,null));};exports[_0x3d7e('0x5e')]=function(_0x45b8d7,_0x37f0f5,_0x23b7c9){var _0x555f13={'raw':!![],'where':{}};var _0x1eea80={};var _0x255712={'count':0x0,'rows':[]};return db[_0x3d7e('0x2b')][_0x3d7e('0x53')]({'where':{'id':_0x45b8d7[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x37f0f5,null))[_0x3d7e('0x23')](function(_0x505f59){if(_0x505f59){_0x1eea80[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db[_0x3d7e('0x5f')][_0x3d7e('0x2c')]);_0x1eea80['query']=_[_0x3d7e('0x32')](_0x45b8d7[_0x3d7e('0x31')]);_0x1eea80[_0x3d7e('0x33')]=_['intersection'](_0x1eea80[_0x3d7e('0x30')],_0x1eea80[_0x3d7e('0x31')]);_0x555f13[_0x3d7e('0x35')]=_['intersection'](_0x1eea80[_0x3d7e('0x30')],qs[_0x3d7e('0x36')](_0x45b8d7[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x555f13[_0x3d7e('0x35')]=_0x555f13[_0x3d7e('0x35')][_0x3d7e('0x37')]?_0x555f13[_0x3d7e('0x35')]:_0x1eea80[_0x3d7e('0x30')];if(!_0x45b8d7['query'][_0x3d7e('0x59')]('nolimit')){_0x555f13[_0x3d7e('0x1d')]=qs[_0x3d7e('0x1d')](_0x45b8d7[_0x3d7e('0x31')]['limit']);_0x555f13[_0x3d7e('0x1b')]=qs[_0x3d7e('0x1b')](_0x45b8d7['query'][_0x3d7e('0x1b')]);}_0x555f13[_0x3d7e('0x56')]=qs[_0x3d7e('0x38')](_0x45b8d7[_0x3d7e('0x31')][_0x3d7e('0x38')]);_0x555f13[_0x3d7e('0x3a')]=qs[_0x3d7e('0x33')](_[_0x3d7e('0x5d')](_0x45b8d7[_0x3d7e('0x31')],_0x1eea80['filters']));_0x555f13[_0x3d7e('0x3a')][_0x3d7e('0x5a')]=_0x505f59['id'];if(_0x45b8d7[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x555f13[_0x3d7e('0x3a')]=_[_0x3d7e('0x3b')](_0x555f13[_0x3d7e('0x3a')],{'$or':_[_0x3d7e('0x2a')](_0x555f13[_0x3d7e('0x35')],function(_0xcf1df7){var _0x1663f1={};_0x1663f1[_0xcf1df7]={'$like':'%'+_0x45b8d7['query'][_0x3d7e('0x39')]+'%'};return _0x1663f1;})});}_0x555f13=_[_0x3d7e('0x3b')]({},_0x555f13,_0x45b8d7['options']);return db[_0x3d7e('0x5f')]['count']({'where':_0x555f13[_0x3d7e('0x3a')]})[_0x3d7e('0x23')](function(_0x3027fa){_0x255712[_0x3d7e('0x1e')]=_0x3027fa;if(_0x45b8d7[_0x3d7e('0x31')][_0x3d7e('0x40')]){_0x555f13[_0x3d7e('0x41')]=[{'all':!![]}];}return db[_0x3d7e('0x5f')][_0x3d7e('0x3e')](_0x555f13);})['then'](function(_0x461df2){_0x255712[_0x3d7e('0x60')]=_0x461df2;return _0x255712;});}})[_0x3d7e('0x23')](respondWithFilteredResult(_0x37f0f5,_0x555f13))[_0x3d7e('0x43')](handleError(_0x37f0f5,null));};exports[_0x3d7e('0x61')]=function(_0x1e2745,_0x402e74,_0x57a5aa){var _0x251605={};var _0x3ae8ac={};var _0x263e0f;var _0x3f2b04;return db[_0x3d7e('0x2b')]['findOne']({'where':{'id':_0x1e2745['params']['id']}})['then'](handleEntityNotFound(_0x402e74,null))['then'](function(_0x56844d){if(_0x56844d){_0x263e0f=_0x56844d;_0x3ae8ac[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db['CmList'][_0x3d7e('0x2c')]);_0x3ae8ac[_0x3d7e('0x31')]=_[_0x3d7e('0x32')](_0x1e2745[_0x3d7e('0x31')]);_0x3ae8ac[_0x3d7e('0x33')]=_['intersection'](_0x3ae8ac[_0x3d7e('0x30')],_0x3ae8ac[_0x3d7e('0x31')]);_0x251605[_0x3d7e('0x35')]=_[_0x3d7e('0x34')](_0x3ae8ac[_0x3d7e('0x30')],qs['fields'](_0x1e2745[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x251605[_0x3d7e('0x35')]=_0x251605[_0x3d7e('0x35')][_0x3d7e('0x37')]?_0x251605['attributes']:_0x3ae8ac['model'];_0x251605[_0x3d7e('0x56')]=qs[_0x3d7e('0x38')](_0x1e2745[_0x3d7e('0x31')][_0x3d7e('0x38')]);_0x251605[_0x3d7e('0x3a')]=qs[_0x3d7e('0x33')](_[_0x3d7e('0x5d')](_0x1e2745[_0x3d7e('0x31')],_0x3ae8ac[_0x3d7e('0x33')]));if(_0x1e2745[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x251605[_0x3d7e('0x3a')]=_[_0x3d7e('0x3b')](_0x251605['where'],{'$or':_['map'](_0x251605[_0x3d7e('0x35')],function(_0xd2a9e0){var _0xd021f9={};_0xd021f9[_0xd2a9e0]={'$like':'%'+_0x1e2745[_0x3d7e('0x31')][_0x3d7e('0x39')]+'%'};return _0xd021f9;})});}_0x251605=_[_0x3d7e('0x3b')]({},_0x251605,_0x1e2745[_0x3d7e('0x3d')]);return _0x263e0f['getLists'](_0x251605);}})[_0x3d7e('0x23')](function(_0x42bb65){if(_0x42bb65){_0x3f2b04=_0x42bb65[_0x3d7e('0x37')];if(!_0x1e2745[_0x3d7e('0x31')]['hasOwnProperty'](_0x3d7e('0x55'))){_0x251605['limit']=qs[_0x3d7e('0x1d')](_0x1e2745['query'][_0x3d7e('0x1d')]);_0x251605[_0x3d7e('0x1b')]=qs[_0x3d7e('0x1b')](_0x1e2745['query'][_0x3d7e('0x1b')]);}return _0x263e0f[_0x3d7e('0x61')](_0x251605);}})[_0x3d7e('0x23')](function(_0x2078a5){if(_0x2078a5){return _0x2078a5?{'count':_0x3f2b04,'rows':_0x2078a5}:null;}})[_0x3d7e('0x23')](respondWithResult(_0x402e74,null))['catch'](handleError(_0x402e74,null));};exports[_0x3d7e('0x62')]=function(_0x5e7453,_0x3dc0b6,_0x3cba99){var _0x1a115d,_0x59c2a8;return db[_0x3d7e('0x2b')][_0x3d7e('0x42')]({'where':{'id':_0x5e7453[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x3dc0b6,null))[_0x3d7e('0x23')](function(_0x13df06){if(_0x13df06){_0x59c2a8=_0x13df06;return _0x13df06[_0x3d7e('0x62')](_0x5e7453[_0x3d7e('0x50')]['ids'],_[_0x3d7e('0x4d')](_0x5e7453[_0x3d7e('0x50')],['ids','id'])||{});}return null;})[_0x3d7e('0x63')](function(_0x3b40cf){var _0x38bd70;_0x1a115d=_0x3b40cf||[];var _0x733794=[];if(_0x3b40cf){for(var _0x2a8023=0x0;_0x2a8023<_0x3b40cf['length'];_0x2a8023+=0x1){var _0xc2727=_0x3b40cf[_0x2a8023][_0x3d7e('0x24')]({'plain':!![]});_0x59c2a8['dialCheckDuplicateType']=_0x5e7453[_0x3d7e('0x50')][_0x3d7e('0x64')]?_0x5e7453[_0x3d7e('0x50')]['dialCheckDuplicateType']:_0x59c2a8[_0x3d7e('0x64')];switch(_0x59c2a8['dialCheckDuplicateType']){case _0x3d7e('0x65'):_0x38bd70=squel[_0x3d7e('0x66')]()[_0x3d7e('0x67')]('cm_hopper')[_0x3d7e('0x68')]([_0x3d7e('0x69'),_0x3d7e('0x6a'),_0x3d7e('0x6b'),_0x3d7e('0x6c'),_0x3d7e('0x5a'),_0x3d7e('0x4e'),_0x3d7e('0x4f')],squel[_0x3d7e('0x6d')]()[_0x3d7e('0x6e')](_0x3d7e('0x69'),_0x3d7e('0x69'))['field'](_0x3d7e('0x6f'),_0x3d7e('0x6a'))['field']('id',_0x3d7e('0x6b'))[_0x3d7e('0x6e')](_0xc2727[_0x3d7e('0x70')][_0x3d7e('0x71')](),_0x3d7e('0x6c'))[_0x3d7e('0x6e')](_0x5e7453[_0x3d7e('0x3f')]['id'][_0x3d7e('0x71')](),_0x3d7e('0x5a'))[_0x3d7e('0x6e')](_0x3d7e('0x6f'),_0x3d7e('0x4e'))['field'](_0x3d7e('0x6f'),_0x3d7e('0x4f'))[_0x3d7e('0x72')](_0x3d7e('0x73'))['where']('deletedAt\x20IS\x20NULL')[_0x3d7e('0x3a')](_0x3d7e('0x74'),_0xc2727['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x3d7e('0x3a')](_0x3d7e('0x75'),squel['select']()[_0x3d7e('0x6e')](_0x3d7e('0x76'))[_0x3d7e('0x72')](_0x3d7e('0x77'))[_0x3d7e('0x3a')]('CampaignId\x20=\x20?',_0x5e7453[_0x3d7e('0x3f')]['id'][_0x3d7e('0x71')]()))[_0x3d7e('0x3a')](_0x3d7e('0x75'),squel[_0x3d7e('0x6d')]()[_0x3d7e('0x6e')](_0x3d7e('0x78'))[_0x3d7e('0x72')](_0x3d7e('0x79'))[_0x3d7e('0x3a')](_0x3d7e('0x7a'),_0x5e7453[_0x3d7e('0x3f')]['id'][_0x3d7e('0x71')]())))['toString']();break;case _0x3d7e('0x7b'):_0x38bd70=squel['insert']()[_0x3d7e('0x67')]('cm_hopper')[_0x3d7e('0x68')]([_0x3d7e('0x69'),'scheduledAt',_0x3d7e('0x6b'),_0x3d7e('0x6c'),_0x3d7e('0x5a'),_0x3d7e('0x4e'),_0x3d7e('0x4f')],squel['select']()[_0x3d7e('0x6e')]('phone',_0x3d7e('0x69'))[_0x3d7e('0x6e')](_0x3d7e('0x6f'),'scheduledAt')['field']('id','ContactId')[_0x3d7e('0x6e')](_0xc2727[_0x3d7e('0x70')]['toString'](),'ListId')[_0x3d7e('0x6e')](_0x5e7453[_0x3d7e('0x3f')]['id'][_0x3d7e('0x71')](),_0x3d7e('0x5a'))[_0x3d7e('0x6e')](_0x3d7e('0x6f'),'createdAt')[_0x3d7e('0x6e')]('NOW()',_0x3d7e('0x4f'))['from'](_0x3d7e('0x73'))[_0x3d7e('0x3a')](_0x3d7e('0x7c'))[_0x3d7e('0x3a')](_0x3d7e('0x74'),_0xc2727[_0x3d7e('0x70')][_0x3d7e('0x71')]())[_0x3d7e('0x3a')](_0x3d7e('0x7d'))[_0x3d7e('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3d7e('0x6d')]()[_0x3d7e('0x6e')](_0x3d7e('0x78'))[_0x3d7e('0x72')](_0x3d7e('0x79'))['where'](_0x3d7e('0x7a'),_0x5e7453['params']['id'][_0x3d7e('0x71')]())))['toString']();break;default:_0x38bd70=squel[_0x3d7e('0x66')]()['into']('cm_hopper')[_0x3d7e('0x68')]([_0x3d7e('0x69'),_0x3d7e('0x6a'),_0x3d7e('0x6b'),_0x3d7e('0x6c'),_0x3d7e('0x5a'),_0x3d7e('0x4e'),_0x3d7e('0x4f')],squel['select']()[_0x3d7e('0x6e')](_0x3d7e('0x69'),_0x3d7e('0x69'))[_0x3d7e('0x6e')](_0x3d7e('0x6f'),'scheduledAt')['field']('id',_0x3d7e('0x6b'))[_0x3d7e('0x6e')](_0xc2727['CmListId']['toString'](),_0x3d7e('0x6c'))[_0x3d7e('0x6e')](_0x5e7453[_0x3d7e('0x3f')]['id'][_0x3d7e('0x71')](),_0x3d7e('0x5a'))[_0x3d7e('0x6e')](_0x3d7e('0x6f'),_0x3d7e('0x4e'))[_0x3d7e('0x6e')]('NOW()',_0x3d7e('0x4f'))[_0x3d7e('0x72')](_0x3d7e('0x73'))['where'](_0x3d7e('0x7c'))[_0x3d7e('0x3a')]('ListId\x20=\x20?',_0xc2727[_0x3d7e('0x70')][_0x3d7e('0x71')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x3d7e('0x71')]();}_0x733794[_0x3d7e('0x7e')](db[_0x3d7e('0x7f')][_0x3d7e('0x31')](_0x38bd70));}return BPromise[_0x3d7e('0x80')](_0x733794);}})[_0x3d7e('0x23')](function(){return _0x1a115d;})[_0x3d7e('0x23')](respondWithResult(_0x3dc0b6,null))[_0x3d7e('0x43')](handleError(_0x3dc0b6,null));};exports[_0x3d7e('0x81')]=function(_0x130371,_0x267021,_0x193b2d){return db[_0x3d7e('0x2b')][_0x3d7e('0x42')]({'where':{'id':_0x130371[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x267021,null))[_0x3d7e('0x23')](function(_0xc388c9){if(_0xc388c9){return _0xc388c9[_0x3d7e('0x81')](_0x130371[_0x3d7e('0x31')][_0x3d7e('0x82')]);}})['then'](function(_0x22df4f){if(_0x22df4f){return db[_0x3d7e('0x54')][_0x3d7e('0x25')]({'where':{'ListId':_0x130371['query']['ids'],'CampaignId':_0x130371[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](function(){return _0x22df4f;});}})[_0x3d7e('0x23')](respondWithStatusCode(_0x267021,null))[_0x3d7e('0x43')](handleError(_0x267021,null));};exports['getBlackLists']=function(_0x46a5df,_0x4b8062,_0x44513f){var _0x104a2b={};var _0x3dc3d0={};var _0x49fd49;var _0x26e293;return db[_0x3d7e('0x2b')]['findOne']({'where':{'id':_0x46a5df[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x4b8062,null))['then'](function(_0x513805){if(_0x513805){_0x49fd49=_0x513805;_0x3dc3d0[_0x3d7e('0x30')]=_[_0x3d7e('0x32')](db[_0x3d7e('0x83')][_0x3d7e('0x2c')]);_0x3dc3d0['query']=_['keys'](_0x46a5df['query']);_0x3dc3d0[_0x3d7e('0x33')]=_[_0x3d7e('0x34')](_0x3dc3d0['model'],_0x3dc3d0[_0x3d7e('0x31')]);_0x104a2b[_0x3d7e('0x35')]=_[_0x3d7e('0x34')](_0x3dc3d0[_0x3d7e('0x30')],qs['fields'](_0x46a5df[_0x3d7e('0x31')][_0x3d7e('0x36')]));_0x104a2b['attributes']=_0x104a2b[_0x3d7e('0x35')][_0x3d7e('0x37')]?_0x104a2b[_0x3d7e('0x35')]:_0x3dc3d0[_0x3d7e('0x30')];_0x104a2b['order']=qs[_0x3d7e('0x38')](_0x46a5df['query']['sort']);_0x104a2b[_0x3d7e('0x3a')]=qs[_0x3d7e('0x33')](_['pick'](_0x46a5df[_0x3d7e('0x31')],_0x3dc3d0[_0x3d7e('0x33')]));if(_0x46a5df[_0x3d7e('0x31')][_0x3d7e('0x39')]){_0x104a2b['where']=_[_0x3d7e('0x3b')](_0x104a2b[_0x3d7e('0x3a')],{'$or':_[_0x3d7e('0x2a')](_0x104a2b['attributes'],function(_0x45340a){var _0x398d72={};_0x398d72[_0x45340a]={'$like':'%'+_0x46a5df['query'][_0x3d7e('0x39')]+'%'};return _0x398d72;})});}_0x104a2b=_['merge']({},_0x104a2b,_0x46a5df[_0x3d7e('0x3d')]);return _0x49fd49[_0x3d7e('0x84')](_0x104a2b);}})[_0x3d7e('0x23')](function(_0x1185e3){if(_0x1185e3){_0x26e293=_0x1185e3[_0x3d7e('0x37')];if(!_0x46a5df['query']['hasOwnProperty'](_0x3d7e('0x55'))){_0x104a2b['limit']=qs[_0x3d7e('0x1d')](_0x46a5df[_0x3d7e('0x31')][_0x3d7e('0x1d')]);_0x104a2b[_0x3d7e('0x1b')]=qs['offset'](_0x46a5df[_0x3d7e('0x31')][_0x3d7e('0x1b')]);}return _0x49fd49['getBlackLists'](_0x104a2b);}})[_0x3d7e('0x23')](function(_0x1f0614){if(_0x1f0614){return _0x1f0614?{'count':_0x26e293,'rows':_0x1f0614}:null;}})['then'](respondWithResult(_0x4b8062,null))[_0x3d7e('0x43')](handleError(_0x4b8062,null));};exports['addBlackLists']=function(_0x1a1ece,_0x4f5060,_0xc90fc0){var _0x100707,_0x36c9d9;return db[_0x3d7e('0x2b')][_0x3d7e('0x42')]({'where':{'id':_0x1a1ece[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x4f5060,null))[_0x3d7e('0x23')](function(_0x4b9e8c){if(_0x4b9e8c){_0x36c9d9=_0x4b9e8c;return _0x4b9e8c['addBlackLists'](_0x1a1ece[_0x3d7e('0x50')][_0x3d7e('0x82')],_[_0x3d7e('0x4d')](_0x1a1ece[_0x3d7e('0x50')],[_0x3d7e('0x82'),'id'])||{});}return null;})[_0x3d7e('0x63')](function(_0x6d8d82){var _0xf34c7c;_0x100707=_0x6d8d82||[];var _0xc9b2ab=[];if(_0x6d8d82){for(var _0x17bf0f=0x0;_0x17bf0f<_0x6d8d82[_0x3d7e('0x37')];_0x17bf0f+=0x1){var _0x479f7b=_0x6d8d82[_0x17bf0f][_0x3d7e('0x24')]({'plain':!![]});_0xf34c7c=squel[_0x3d7e('0x66')]()[_0x3d7e('0x67')](_0x3d7e('0x85'))['fromQuery']([_0x3d7e('0x69'),_0x3d7e('0x6b'),_0x3d7e('0x6c'),_0x3d7e('0x5a'),'createdAt',_0x3d7e('0x4f')],squel[_0x3d7e('0x6d')]()[_0x3d7e('0x6e')](_0x3d7e('0x69'),_0x3d7e('0x69'))[_0x3d7e('0x6e')]('id',_0x3d7e('0x6b'))[_0x3d7e('0x6e')](_0x479f7b[_0x3d7e('0x70')][_0x3d7e('0x71')](),'ListId')['field'](_0x1a1ece['params']['id'][_0x3d7e('0x71')](),_0x3d7e('0x5a'))['field'](_0x3d7e('0x6f'),_0x3d7e('0x4e'))[_0x3d7e('0x6e')]('NOW()',_0x3d7e('0x4f'))['from']('cm_contacts')[_0x3d7e('0x3a')]('deletedAt\x20IS\x20NULL')['where'](_0x3d7e('0x74'),_0x479f7b['CmListId']['toString']())[_0x3d7e('0x3a')](_0x3d7e('0x7d')))[_0x3d7e('0x71')]();_0xc9b2ab[_0x3d7e('0x7e')](db[_0x3d7e('0x7f')][_0x3d7e('0x31')](_0xf34c7c));}return BPromise[_0x3d7e('0x80')](_0xc9b2ab);}})[_0x3d7e('0x23')](function(){return _0x100707;})[_0x3d7e('0x23')](respondWithResult(_0x4f5060,null))['catch'](handleError(_0x4f5060,null));};exports[_0x3d7e('0x86')]=function(_0x4d0c81,_0x12cdb7,_0x5b1526){return db[_0x3d7e('0x2b')][_0x3d7e('0x42')]({'where':{'id':_0x4d0c81[_0x3d7e('0x3f')]['id']}})[_0x3d7e('0x23')](handleEntityNotFound(_0x12cdb7,null))[_0x3d7e('0x23')](function(_0x5aae34){if(_0x5aae34){return _0x5aae34[_0x3d7e('0x86')](_0x4d0c81[_0x3d7e('0x31')][_0x3d7e('0x82')]);}})[_0x3d7e('0x23')](function(_0x5375e0){if(_0x5375e0){return db[_0x3d7e('0x5f')][_0x3d7e('0x25')]({'where':{'ListId':_0x4d0c81[_0x3d7e('0x31')][_0x3d7e('0x82')],'CampaignId':_0x4d0c81['params']['id']}})['then'](function(){return _0x5375e0;});}})[_0x3d7e('0x23')](respondWithStatusCode(_0x12cdb7,null))[_0x3d7e('0x43')](handleError(_0x12cdb7,null));};
\ No newline at end of file
+var _0x85c2=['nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','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','clone','omit','updatedAt','createdAt','getHoppers','findOne','CmHopper','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','ListId','select','field','NOW()','scheduledAt','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','push','sequelize','all','removeLists','ids','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','get','IvrCampaigns','destroy','sendStatus','error','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x85c2,0xe2));var _0x285c=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x85c2[_0x58dc25];return _0x21b0a7;};'use strict';var emlformat=require(_0x285c('0x0'));var rimraf=require(_0x285c('0x1'));var zipdir=require(_0x285c('0x2'));var jsonpatch=require(_0x285c('0x3'));var rp=require(_0x285c('0x4'));var moment=require(_0x285c('0x5'));var BPromise=require(_0x285c('0x6'));var Mustache=require(_0x285c('0x7'));var util=require(_0x285c('0x8'));var path=require(_0x285c('0x9'));var sox=require(_0x285c('0xa'));var csv=require('to-csv');var ejs=require(_0x285c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x285c('0xc'));var crypto=require(_0x285c('0xd'));var jsforce=require(_0x285c('0xe'));var deskjs=require(_0x285c('0xf'));var toCsv=require(_0x285c('0x10'));var querystring=require(_0x285c('0x11'));var Papa=require(_0x285c('0x12'));var Redis=require(_0x285c('0x13'));var authService=require(_0x285c('0x14'));var qs=require(_0x285c('0x15'));var as=require(_0x285c('0x16'));var hardwareService=require(_0x285c('0x17'));var logger=require(_0x285c('0x18'))(_0x285c('0x19'));var utils=require(_0x285c('0x1a'));var config=require(_0x285c('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x285c('0x1c'))['db'];function respondWithStatusCode(_0x5f4663,_0x20956d){_0x20956d=_0x20956d||0xcc;return function(_0x1b9d25){if(_0x1b9d25){return _0x5f4663['sendStatus'](_0x20956d);}return _0x5f4663[_0x285c('0x1d')](_0x20956d)[_0x285c('0x1e')]();};}function respondWithResult(_0x118d9b,_0x2a70a7){_0x2a70a7=_0x2a70a7||0xc8;return function(_0x501b98){if(_0x501b98){return _0x118d9b[_0x285c('0x1d')](_0x2a70a7)['json'](_0x501b98);}};}function respondWithFilteredResult(_0x49b16e,_0x4e0c92){return function(_0xc60564){if(_0xc60564){var _0x432c2e=typeof _0x4e0c92[_0x285c('0x1f')]===_0x285c('0x20')&&typeof _0x4e0c92[_0x285c('0x21')]==='undefined';var _0x8d26b3=_0xc60564['count'];var _0x21e5fb=_0x432c2e?0x0:_0x4e0c92[_0x285c('0x1f')];var _0x360e9d=_0x432c2e?_0xc60564[_0x285c('0x22')]:_0x4e0c92['offset']+_0x4e0c92['limit'];var _0x437d18;if(_0x360e9d>=_0x8d26b3){_0x360e9d=_0x8d26b3;_0x437d18=0xc8;}else{_0x437d18=0xce;}_0x49b16e[_0x285c('0x1d')](_0x437d18);return _0x49b16e['set'](_0x285c('0x23'),_0x21e5fb+'-'+_0x360e9d+'/'+_0x8d26b3)[_0x285c('0x24')](_0xc60564);}return null;};}function patchUpdates(_0x3eba2c){return function(_0x41ef29){try{jsonpatch[_0x285c('0x25')](_0x41ef29,_0x3eba2c,!![]);}catch(_0x8097cc){return BPromise[_0x285c('0x26')](_0x8097cc);}return _0x41ef29[_0x285c('0x27')]();};}function saveUpdates(_0x3f579a,_0x5f10cd){return function(_0x47110e){if(_0x47110e){return _0x47110e[_0x285c('0x28')](_0x3f579a)[_0x285c('0x29')](function(_0x47dc02){return _0x47dc02;});}return null;};}function removeEntity(_0x4b35c7,_0x24b07d){return function(_0xc5d1d8){if(_0xc5d1d8){return _0xc5d1d8['destroy']()[_0x285c('0x29')](function(){var _0x333e0d=_0xc5d1d8[_0x285c('0x2a')]({'plain':!![]});var _0x36c44b=_0x285c('0x2b');return db['UserProfileResource'][_0x285c('0x2c')]({'where':{'type':_0x36c44b,'resourceId':_0x333e0d['id']}})[_0x285c('0x29')](function(){return _0xc5d1d8;});})[_0x285c('0x29')](function(){_0x4b35c7[_0x285c('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d1dd0,_0x2619c7){return function(_0x35f1cc){if(!_0x35f1cc){_0x5d1dd0[_0x285c('0x2d')](0x194);}return _0x35f1cc;};}function handleError(_0x428d27,_0x2369d1){_0x2369d1=_0x2369d1||0x1f4;return function(_0x3fdd49){logger[_0x285c('0x2e')](_0x3fdd49[_0x285c('0x2f')]);if(_0x3fdd49[_0x285c('0x30')]){delete _0x3fdd49['name'];}_0x428d27[_0x285c('0x1d')](_0x2369d1)[_0x285c('0x31')](_0x3fdd49);};}exports[_0x285c('0x32')]=function(_0x13d356,_0x52a88a){var _0x400db1={},_0x169bb8={},_0x2c62c4={'count':0x0,'rows':[]};var _0x4d2b9e=_['map'](db[_0x285c('0x33')][_0x285c('0x34')],function(_0x25c2d2){return{'name':_0x25c2d2[_0x285c('0x35')],'type':_0x25c2d2[_0x285c('0x36')][_0x285c('0x37')]};});_0x169bb8[_0x285c('0x38')]=_['map'](_0x4d2b9e,_0x285c('0x30'));_0x169bb8[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x13d356[_0x285c('0x39')]);_0x169bb8[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x169bb8[_0x285c('0x38')],_0x169bb8['query']);_0x400db1[_0x285c('0x3d')]=_['intersection'](_0x169bb8['model'],qs[_0x285c('0x3e')](_0x13d356[_0x285c('0x39')][_0x285c('0x3e')]));_0x400db1[_0x285c('0x3d')]=_0x400db1[_0x285c('0x3d')]['length']?_0x400db1['attributes']:_0x169bb8[_0x285c('0x38')];if(!_0x13d356[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x400db1[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x13d356['query'][_0x285c('0x21')]);_0x400db1[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x13d356[_0x285c('0x39')][_0x285c('0x1f')]);}_0x400db1[_0x285c('0x41')]=qs[_0x285c('0x42')](_0x13d356['query'][_0x285c('0x42')]);_0x400db1[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x13d356[_0x285c('0x39')],_0x169bb8[_0x285c('0x3b')]),_0x4d2b9e);if(_0x13d356[_0x285c('0x39')][_0x285c('0x45')]){_0x400db1[_0x285c('0x43')]=_[_0x285c('0x46')](_0x400db1['where'],{'$or':_[_0x285c('0x47')](_0x4d2b9e,function(_0x93affb){if(_0x93affb[_0x285c('0x36')]!==_0x285c('0x48')){var _0x46d882={};_0x46d882[_0x93affb['name']]={'$like':'%'+_0x13d356[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x46d882;}})});}_0x400db1=_[_0x285c('0x46')]({},_0x400db1,_0x13d356[_0x285c('0x49')]);var _0x367f77={'where':_0x400db1[_0x285c('0x43')]};return db['Campaign'][_0x285c('0x22')](_0x367f77)['then'](function(_0x56cac9){_0x2c62c4['count']=_0x56cac9;if(_0x13d356[_0x285c('0x39')]['includeAll']){_0x400db1[_0x285c('0x4a')]=[{'all':!![]}];}return db[_0x285c('0x33')][_0x285c('0x4b')](_0x400db1);})[_0x285c('0x29')](function(_0x5db789){_0x2c62c4['rows']=_0x5db789;return _0x2c62c4;})[_0x285c('0x29')](respondWithFilteredResult(_0x52a88a,_0x400db1))[_0x285c('0x4c')](handleError(_0x52a88a,null));};exports[_0x285c('0x4d')]=function(_0x3e9f0f,_0x3b93ce){var _0xfaf48e={'raw':![],'where':{'id':_0x3e9f0f[_0x285c('0x4e')]['id']}},_0x5eae9a={};_0x5eae9a['model']=_['keys'](db['Campaign'][_0x285c('0x34')]);_0x5eae9a[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x3e9f0f['query']);_0x5eae9a[_0x285c('0x3b')]=_['intersection'](_0x5eae9a['model'],_0x5eae9a[_0x285c('0x39')]);_0xfaf48e[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x5eae9a[_0x285c('0x38')],qs['fields'](_0x3e9f0f[_0x285c('0x39')][_0x285c('0x3e')]));_0xfaf48e[_0x285c('0x3d')]=_0xfaf48e['attributes'][_0x285c('0x4f')]?_0xfaf48e[_0x285c('0x3d')]:_0x5eae9a[_0x285c('0x38')];if(_0x3e9f0f[_0x285c('0x39')][_0x285c('0x50')]){_0xfaf48e[_0x285c('0x4a')]=[{'all':!![]}];}_0xfaf48e=_[_0x285c('0x46')]({},_0xfaf48e,_0x3e9f0f[_0x285c('0x49')]);return db[_0x285c('0x33')][_0x285c('0x51')](_0xfaf48e)[_0x285c('0x29')](handleEntityNotFound(_0x3b93ce,null))['then'](respondWithResult(_0x3b93ce,null))[_0x285c('0x4c')](handleError(_0x3b93ce,null));};exports[_0x285c('0x52')]=function(_0x437d26,_0x4d9a47){return db[_0x285c('0x33')][_0x285c('0x52')](_0x437d26[_0x285c('0x53')],{})[_0x285c('0x29')](function(_0x2cbc52){var _0x2f4071=_0x437d26[_0x285c('0x54')][_0x285c('0x2a')]({'plain':!![]});if(!_0x2f4071)throw new Error(_0x285c('0x55'));if(_0x2f4071[_0x285c('0x56')]==='user'){var _0x2cb29b=_0x2cbc52[_0x285c('0x2a')]({'plain':!![]});var _0x1db5ea='IvrCampaigns';return db[_0x285c('0x57')]['find']({'where':{'name':_0x1db5ea,'userProfileId':_0x2f4071[_0x285c('0x58')]},'raw':!![]})[_0x285c('0x29')](function(_0x2e05b3){if(_0x2e05b3&&_0x2e05b3[_0x285c('0x59')]===0x0){return db[_0x285c('0x5a')][_0x285c('0x52')]({'name':_0x2cb29b[_0x285c('0x30')],'resourceId':_0x2cb29b['id'],'type':_0x2e05b3[_0x285c('0x30')],'sectionId':_0x2e05b3['id']},{})[_0x285c('0x29')](function(){return _0x2cbc52;});}else{return _0x2cbc52;}})[_0x285c('0x4c')](function(_0x1b71c9){logger['error'](_0x285c('0x5b'),_0x1b71c9);throw _0x1b71c9;});}return _0x2cbc52;})['then'](respondWithResult(_0x4d9a47,0xc9))[_0x285c('0x4c')](handleError(_0x4d9a47,null));};exports[_0x285c('0x5c')]=function(_0x4cfe14,_0x45f114){var _0x53b325={'where':{'id':_0x4cfe14['params']['id']}},_0x5b0e73={};_0x5b0e73[_0x285c('0x38')]=_[_0x285c('0x3a')](db[_0x285c('0x33')][_0x285c('0x34')]);_0x53b325[_0x285c('0x3d')]=_['intersection'](_0x5b0e73[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x4cfe14[_0x285c('0x39')][_0x285c('0x3e')]));_0x53b325[_0x285c('0x3d')]=_0x53b325[_0x285c('0x3d')][_0x285c('0x4f')]?_0x53b325['attributes']:_0x5b0e73[_0x285c('0x38')];if(_0x4cfe14[_0x285c('0x39')][_0x285c('0x50')]){_0x53b325[_0x285c('0x4a')]=[{'all':!![]}];}_0x53b325=_[_0x285c('0x46')]({},_0x53b325,_0x4cfe14['options']);return db[_0x285c('0x33')]['find'](_0x53b325)['then'](handleEntityNotFound(_0x45f114,null))[_0x285c('0x29')](function(_0x8d96e8){if(_0x8d96e8){var _0x296ba9=_0x8d96e8[_0x285c('0x2a')]({'plain':!![]});_0x296ba9=qs[_0x285c('0x5d')](_0x296ba9,['id','createdAt',_0x285c('0x5e')]);_0x4cfe14['body']=_[_0x285c('0x5d')](_0x4cfe14['body'],['id',_0x285c('0x5f'),_0x285c('0x5e')]);return db[_0x285c('0x33')][_0x285c('0x52')](_[_0x285c('0x46')](_0x296ba9,_0x4cfe14[_0x285c('0x53')]),{'include':_0x4cfe14['query']['includeAll']?[{'all':!![]}]:undefined})[_0x285c('0x29')](function(_0x37b701){var _0x1a2cd2=_0x4cfe14['user']['get']({'plain':!![]});if(!_0x1a2cd2)throw new Error(_0x285c('0x55'));if(_0x1a2cd2[_0x285c('0x56')]===_0x285c('0x54')){var _0x2c50d0=_0x37b701[_0x285c('0x2a')]({'plain':!![]});var _0x4b5217='IvrCampaigns';return db[_0x285c('0x57')]['find']({'where':{'name':_0x4b5217,'userProfileId':_0x1a2cd2[_0x285c('0x58')]},'raw':!![]})[_0x285c('0x29')](function(_0x240bf8){if(_0x240bf8&&_0x240bf8[_0x285c('0x59')]===0x0){return db[_0x285c('0x5a')][_0x285c('0x52')]({'name':_0x2c50d0[_0x285c('0x30')],'resourceId':_0x2c50d0['id'],'type':_0x240bf8['name'],'sectionId':_0x240bf8['id']},{})['then'](function(){return _0x37b701;});}else{return _0x37b701;}})[_0x285c('0x4c')](function(_0x211ea6){logger['error'](_0x285c('0x5b'),_0x211ea6);throw _0x211ea6;});}return _0x37b701;});}})['then'](respondWithResult(_0x45f114,0xc9))[_0x285c('0x4c')](handleError(_0x45f114,null));};exports[_0x285c('0x28')]=function(_0x3853ae,_0x4415ae){if(_0x3853ae[_0x285c('0x53')]['id']){delete _0x3853ae[_0x285c('0x53')]['id'];}return db['Campaign']['find']({'where':{'id':_0x3853ae[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x4415ae,null))[_0x285c('0x29')](saveUpdates(_0x3853ae['body'],null))[_0x285c('0x29')](respondWithResult(_0x4415ae,null))[_0x285c('0x4c')](handleError(_0x4415ae,null));};exports[_0x285c('0x2c')]=function(_0xb8cb5a,_0x156bea){return db[_0x285c('0x33')]['find']({'where':{'id':_0xb8cb5a[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x156bea,null))['then'](removeEntity(_0x156bea,null))[_0x285c('0x4c')](handleError(_0x156bea,null));};exports[_0x285c('0x60')]=function(_0xff4837,_0x52a2db,_0x185359){var _0x563d7a={'raw':!![],'where':{}};var _0x28b0d0={};var _0x2c7fbf={'count':0x0,'rows':[]};return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0xff4837[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x52a2db,null))['then'](function(_0x4573e7){if(_0x4573e7){_0x28b0d0[_0x285c('0x38')]=_['keys'](db[_0x285c('0x62')][_0x285c('0x34')]);_0x28b0d0[_0x285c('0x39')]=_['keys'](_0xff4837[_0x285c('0x39')]);_0x28b0d0[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x28b0d0[_0x285c('0x38')],_0x28b0d0['query']);_0x563d7a[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x28b0d0[_0x285c('0x38')],qs[_0x285c('0x3e')](_0xff4837[_0x285c('0x39')]['fields']));_0x563d7a[_0x285c('0x3d')]=_0x563d7a[_0x285c('0x3d')][_0x285c('0x4f')]?_0x563d7a[_0x285c('0x3d')]:_0x28b0d0[_0x285c('0x38')];if(!_0xff4837['query'][_0x285c('0x3f')](_0x285c('0x40'))){_0x563d7a['limit']=qs[_0x285c('0x21')](_0xff4837[_0x285c('0x39')][_0x285c('0x21')]);_0x563d7a[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0xff4837[_0x285c('0x39')][_0x285c('0x1f')]);}_0x563d7a[_0x285c('0x41')]=qs[_0x285c('0x42')](_0xff4837[_0x285c('0x39')]['sort']);_0x563d7a['where']=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0xff4837[_0x285c('0x39')],_0x28b0d0['filters']));_0x563d7a['where'][_0x285c('0x63')]=_0x4573e7['id'];if(_0xff4837[_0x285c('0x39')][_0x285c('0x45')]){_0x563d7a[_0x285c('0x43')]=_[_0x285c('0x46')](_0x563d7a['where'],{'$or':_[_0x285c('0x47')](_0x563d7a[_0x285c('0x3d')],function(_0x3413ac){var _0x89aab6={};_0x89aab6[_0x3413ac]={'$like':'%'+_0xff4837[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x89aab6;})});}_0x563d7a=_[_0x285c('0x46')]({},_0x563d7a,_0xff4837[_0x285c('0x49')]);return db[_0x285c('0x62')][_0x285c('0x22')]({'where':_0x563d7a[_0x285c('0x43')]})['then'](function(_0x40a879){_0x2c7fbf[_0x285c('0x22')]=_0x40a879;if(_0xff4837[_0x285c('0x39')][_0x285c('0x50')]){_0x563d7a[_0x285c('0x4a')]=[{'all':!![]}];}return db['CmHopper'][_0x285c('0x4b')](_0x563d7a);})['then'](function(_0x232a2d){_0x2c7fbf[_0x285c('0x64')]=_0x232a2d;return _0x2c7fbf;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x52a2db,_0x563d7a))[_0x285c('0x4c')](handleError(_0x52a2db,null));};exports[_0x285c('0x65')]=function(_0x4fb177,_0x4b63cc,_0x27137b){var _0x16b78f={'raw':!![],'where':{}};var _0x58748f={};var _0x5b731c={'count':0x0,'rows':[]};return db['Campaign'][_0x285c('0x61')]({'where':{'id':_0x4fb177[_0x285c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4b63cc,null))['then'](function(_0x555583){if(_0x555583){_0x58748f[_0x285c('0x38')]=_[_0x285c('0x3a')](db[_0x285c('0x66')][_0x285c('0x34')]);_0x58748f[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x4fb177['query']);_0x58748f[_0x285c('0x3b')]=_['intersection'](_0x58748f[_0x285c('0x38')],_0x58748f[_0x285c('0x39')]);_0x16b78f[_0x285c('0x3d')]=_['intersection'](_0x58748f[_0x285c('0x38')],qs['fields'](_0x4fb177[_0x285c('0x39')][_0x285c('0x3e')]));_0x16b78f['attributes']=_0x16b78f[_0x285c('0x3d')][_0x285c('0x4f')]?_0x16b78f[_0x285c('0x3d')]:_0x58748f[_0x285c('0x38')];if(!_0x4fb177[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x16b78f[_0x285c('0x21')]=qs['limit'](_0x4fb177[_0x285c('0x39')][_0x285c('0x21')]);_0x16b78f[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x4fb177[_0x285c('0x39')]['offset']);}_0x16b78f[_0x285c('0x41')]=qs['sort'](_0x4fb177['query'][_0x285c('0x42')]);_0x16b78f[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x4fb177['query'],_0x58748f[_0x285c('0x3b')]));_0x16b78f[_0x285c('0x43')][_0x285c('0x63')]=_0x555583['id'];if(_0x4fb177[_0x285c('0x39')][_0x285c('0x45')]){_0x16b78f[_0x285c('0x43')]=_[_0x285c('0x46')](_0x16b78f[_0x285c('0x43')],{'$or':_[_0x285c('0x47')](_0x16b78f['attributes'],function(_0x5209d0){var _0x21b953={};_0x21b953[_0x5209d0]={'$like':'%'+_0x4fb177[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x21b953;})});}_0x16b78f=_[_0x285c('0x46')]({},_0x16b78f,_0x4fb177[_0x285c('0x49')]);return db['CmHopperHistory']['count']({'where':_0x16b78f[_0x285c('0x43')]})[_0x285c('0x29')](function(_0x48c932){_0x5b731c[_0x285c('0x22')]=_0x48c932;if(_0x4fb177[_0x285c('0x39')]['includeAll']){_0x16b78f[_0x285c('0x4a')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x285c('0x4b')](_0x16b78f);})[_0x285c('0x29')](function(_0x38a5bc){_0x5b731c[_0x285c('0x64')]=_0x38a5bc;return _0x5b731c;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x4b63cc,_0x16b78f))['catch'](handleError(_0x4b63cc,null));};exports[_0x285c('0x67')]=function(_0x56f154,_0x22923c,_0x417b0c){var _0x4bf953={'raw':!![],'where':{}};var _0x1e107f={};var _0x2bc05d={'count':0x0,'rows':[]};return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0x56f154[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x22923c,null))[_0x285c('0x29')](function(_0x21054a){if(_0x21054a){_0x1e107f[_0x285c('0x38')]=_[_0x285c('0x3a')](db[_0x285c('0x68')]['rawAttributes']);_0x1e107f[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x56f154[_0x285c('0x39')]);_0x1e107f[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x1e107f['model'],_0x1e107f[_0x285c('0x39')]);_0x4bf953[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x1e107f[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x56f154[_0x285c('0x39')]['fields']));_0x4bf953[_0x285c('0x3d')]=_0x4bf953[_0x285c('0x3d')][_0x285c('0x4f')]?_0x4bf953[_0x285c('0x3d')]:_0x1e107f[_0x285c('0x38')];if(!_0x56f154[_0x285c('0x39')][_0x285c('0x3f')]('nolimit')){_0x4bf953[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x56f154[_0x285c('0x39')][_0x285c('0x21')]);_0x4bf953[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x56f154[_0x285c('0x39')][_0x285c('0x1f')]);}_0x4bf953[_0x285c('0x41')]=qs[_0x285c('0x42')](_0x56f154[_0x285c('0x39')][_0x285c('0x42')]);_0x4bf953[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x56f154[_0x285c('0x39')],_0x1e107f[_0x285c('0x3b')]));_0x4bf953[_0x285c('0x43')][_0x285c('0x63')]=_0x21054a['id'];if(_0x56f154[_0x285c('0x39')][_0x285c('0x45')]){_0x4bf953[_0x285c('0x43')]=_[_0x285c('0x46')](_0x4bf953[_0x285c('0x43')],{'$or':_['map'](_0x4bf953[_0x285c('0x3d')],function(_0xf32a0c){var _0x2a5c94={};_0x2a5c94[_0xf32a0c]={'$like':'%'+_0x56f154[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x2a5c94;})});}_0x4bf953=_[_0x285c('0x46')]({},_0x4bf953,_0x56f154['options']);return db[_0x285c('0x68')][_0x285c('0x22')]({'where':_0x4bf953[_0x285c('0x43')]})[_0x285c('0x29')](function(_0x2c6ed6){_0x2bc05d[_0x285c('0x22')]=_0x2c6ed6;if(_0x56f154[_0x285c('0x39')][_0x285c('0x50')]){_0x4bf953['include']=[{'all':!![]}];}return db[_0x285c('0x68')][_0x285c('0x4b')](_0x4bf953);})[_0x285c('0x29')](function(_0x3f979d){_0x2bc05d[_0x285c('0x64')]=_0x3f979d;return _0x2bc05d;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x22923c,_0x4bf953))[_0x285c('0x4c')](handleError(_0x22923c,null));};exports['getHopperBlacks']=function(_0x510c45,_0x304607,_0x213da9){var _0x3defd4={'raw':!![],'where':{}};var _0x1e9e9b={};var _0x2fc6d0={'count':0x0,'rows':[]};return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0x510c45[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x304607,null))[_0x285c('0x29')](function(_0x5c9015){if(_0x5c9015){_0x1e9e9b[_0x285c('0x38')]=_['keys'](db['CmHopperBlack'][_0x285c('0x34')]);_0x1e9e9b[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x510c45[_0x285c('0x39')]);_0x1e9e9b[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x1e9e9b[_0x285c('0x38')],_0x1e9e9b[_0x285c('0x39')]);_0x3defd4[_0x285c('0x3d')]=_[_0x285c('0x3c')](_0x1e9e9b[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x510c45['query'][_0x285c('0x3e')]));_0x3defd4[_0x285c('0x3d')]=_0x3defd4[_0x285c('0x3d')]['length']?_0x3defd4[_0x285c('0x3d')]:_0x1e9e9b[_0x285c('0x38')];if(!_0x510c45[_0x285c('0x39')]['hasOwnProperty'](_0x285c('0x40'))){_0x3defd4[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x510c45[_0x285c('0x39')][_0x285c('0x21')]);_0x3defd4[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x510c45['query']['offset']);}_0x3defd4['order']=qs[_0x285c('0x42')](_0x510c45[_0x285c('0x39')][_0x285c('0x42')]);_0x3defd4[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x510c45['query'],_0x1e9e9b[_0x285c('0x3b')]));_0x3defd4[_0x285c('0x43')][_0x285c('0x63')]=_0x5c9015['id'];if(_0x510c45[_0x285c('0x39')][_0x285c('0x45')]){_0x3defd4[_0x285c('0x43')]=_['merge'](_0x3defd4['where'],{'$or':_[_0x285c('0x47')](_0x3defd4['attributes'],function(_0x54fda4){var _0x165d8b={};_0x165d8b[_0x54fda4]={'$like':'%'+_0x510c45[_0x285c('0x39')]['filter']+'%'};return _0x165d8b;})});}_0x3defd4=_[_0x285c('0x46')]({},_0x3defd4,_0x510c45[_0x285c('0x49')]);return db[_0x285c('0x69')]['count']({'where':_0x3defd4[_0x285c('0x43')]})['then'](function(_0x737cec){_0x2fc6d0['count']=_0x737cec;if(_0x510c45['query'][_0x285c('0x50')]){_0x3defd4['include']=[{'all':!![]}];}return db[_0x285c('0x69')][_0x285c('0x4b')](_0x3defd4);})[_0x285c('0x29')](function(_0x2396bb){_0x2fc6d0[_0x285c('0x64')]=_0x2396bb;return _0x2fc6d0;});}})[_0x285c('0x29')](respondWithFilteredResult(_0x304607,_0x3defd4))[_0x285c('0x4c')](handleError(_0x304607,null));};exports[_0x285c('0x6a')]=function(_0x2bd425,_0x7e35ef,_0x3919e1){var _0x5a8a14={};var _0x352186={};var _0x35be70;var _0x141f33;return db[_0x285c('0x33')]['findOne']({'where':{'id':_0x2bd425[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x7e35ef,null))[_0x285c('0x29')](function(_0x423b2d){if(_0x423b2d){_0x35be70=_0x423b2d;_0x352186['model']=_[_0x285c('0x3a')](db['CmList'][_0x285c('0x34')]);_0x352186[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x2bd425['query']);_0x352186[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x352186[_0x285c('0x38')],_0x352186[_0x285c('0x39')]);_0x5a8a14['attributes']=_[_0x285c('0x3c')](_0x352186[_0x285c('0x38')],qs[_0x285c('0x3e')](_0x2bd425[_0x285c('0x39')][_0x285c('0x3e')]));_0x5a8a14[_0x285c('0x3d')]=_0x5a8a14[_0x285c('0x3d')][_0x285c('0x4f')]?_0x5a8a14['attributes']:_0x352186['model'];_0x5a8a14[_0x285c('0x41')]=qs[_0x285c('0x42')](_0x2bd425[_0x285c('0x39')][_0x285c('0x42')]);_0x5a8a14[_0x285c('0x43')]=qs[_0x285c('0x3b')](_[_0x285c('0x44')](_0x2bd425[_0x285c('0x39')],_0x352186[_0x285c('0x3b')]));if(_0x2bd425[_0x285c('0x39')][_0x285c('0x45')]){_0x5a8a14['where']=_[_0x285c('0x46')](_0x5a8a14['where'],{'$or':_[_0x285c('0x47')](_0x5a8a14[_0x285c('0x3d')],function(_0x18f0ff){var _0x848896={};_0x848896[_0x18f0ff]={'$like':'%'+_0x2bd425[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x848896;})});}_0x5a8a14=_[_0x285c('0x46')]({},_0x5a8a14,_0x2bd425[_0x285c('0x49')]);return _0x35be70[_0x285c('0x6a')](_0x5a8a14);}})['then'](function(_0x447da5){if(_0x447da5){_0x141f33=_0x447da5[_0x285c('0x4f')];if(!_0x2bd425[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x5a8a14[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x2bd425['query'][_0x285c('0x21')]);_0x5a8a14[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x2bd425[_0x285c('0x39')]['offset']);}return _0x35be70['getLists'](_0x5a8a14);}})[_0x285c('0x29')](function(_0x568d0c){if(_0x568d0c){return _0x568d0c?{'count':_0x141f33,'rows':_0x568d0c}:null;}})[_0x285c('0x29')](respondWithResult(_0x7e35ef,null))[_0x285c('0x4c')](handleError(_0x7e35ef,null));};exports[_0x285c('0x6b')]=function(_0x3ed7bb,_0x540cd3,_0xec4a8d){var _0x29f013,_0x214f1f;return db[_0x285c('0x33')][_0x285c('0x51')]({'where':{'id':_0x3ed7bb[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x540cd3,null))['then'](function(_0x5e9e38){if(_0x5e9e38){_0x214f1f=_0x5e9e38;return _0x5e9e38[_0x285c('0x6b')](_0x3ed7bb['body']['ids'],_[_0x285c('0x5d')](_0x3ed7bb[_0x285c('0x53')],['ids','id'])||{});}return null;})[_0x285c('0x6c')](function(_0x3fb8e2){var _0x2ac706;_0x29f013=_0x3fb8e2||[];var _0x490e57=[];if(_0x3fb8e2){for(var _0x51768b=0x0;_0x51768b<_0x3fb8e2[_0x285c('0x4f')];_0x51768b+=0x1){var _0x1ced9d=_0x3fb8e2[_0x51768b][_0x285c('0x2a')]({'plain':!![]});_0x214f1f['dialCheckDuplicateType']=_0x3ed7bb[_0x285c('0x53')]['dialCheckDuplicateType']?_0x3ed7bb['body']['dialCheckDuplicateType']:_0x214f1f['dialCheckDuplicateType'];switch(_0x214f1f[_0x285c('0x6d')]){case _0x285c('0x6e'):_0x2ac706=squel[_0x285c('0x6f')]()['into'](_0x285c('0x70'))[_0x285c('0x71')]([_0x285c('0x72'),'scheduledAt','ContactId',_0x285c('0x73'),_0x285c('0x63'),_0x285c('0x5f'),_0x285c('0x5e')],squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x72'),_0x285c('0x72'))['field'](_0x285c('0x76'),_0x285c('0x77'))[_0x285c('0x75')]('id',_0x285c('0x78'))['field'](_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')](),_0x285c('0x73'))['field'](_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')](),_0x285c('0x63'))[_0x285c('0x75')](_0x285c('0x76'),_0x285c('0x5f'))[_0x285c('0x75')]('NOW()',_0x285c('0x5e'))[_0x285c('0x7b')](_0x285c('0x7c'))[_0x285c('0x43')](_0x285c('0x7d'))['where'](_0x285c('0x7e'),_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')](_0x285c('0x7f'))[_0x285c('0x43')](_0x285c('0x80'),squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x81'))['from'](_0x285c('0x82'))[_0x285c('0x43')](_0x285c('0x83'),_0x3ed7bb[_0x285c('0x4e')]['id']['toString']()))[_0x285c('0x43')](_0x285c('0x80'),squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x84'))[_0x285c('0x7b')](_0x285c('0x70'))[_0x285c('0x43')](_0x285c('0x83'),_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')]())))[_0x285c('0x7a')]();break;case _0x285c('0x85'):_0x2ac706=squel[_0x285c('0x6f')]()[_0x285c('0x86')](_0x285c('0x70'))[_0x285c('0x71')]([_0x285c('0x72'),_0x285c('0x77'),_0x285c('0x78'),_0x285c('0x73'),_0x285c('0x63'),_0x285c('0x5f'),'updatedAt'],squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x72'),_0x285c('0x72'))['field'](_0x285c('0x76'),_0x285c('0x77'))['field']('id','ContactId')[_0x285c('0x75')](_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')](),_0x285c('0x73'))[_0x285c('0x75')](_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')](),_0x285c('0x63'))['field'](_0x285c('0x76'),_0x285c('0x5f'))[_0x285c('0x75')](_0x285c('0x76'),_0x285c('0x5e'))[_0x285c('0x7b')](_0x285c('0x7c'))[_0x285c('0x43')](_0x285c('0x7d'))[_0x285c('0x43')]('ListId\x20=\x20?',_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')](_0x285c('0x7f'))[_0x285c('0x43')](_0x285c('0x80'),squel[_0x285c('0x74')]()[_0x285c('0x75')](_0x285c('0x84'))[_0x285c('0x7b')](_0x285c('0x70'))[_0x285c('0x43')](_0x285c('0x83'),_0x3ed7bb[_0x285c('0x4e')]['id']['toString']())))[_0x285c('0x7a')]();break;default:_0x2ac706=squel[_0x285c('0x6f')]()[_0x285c('0x86')](_0x285c('0x70'))[_0x285c('0x71')]([_0x285c('0x72'),_0x285c('0x77'),_0x285c('0x78'),_0x285c('0x73'),'CampaignId',_0x285c('0x5f'),_0x285c('0x5e')],squel[_0x285c('0x74')]()[_0x285c('0x75')]('phone',_0x285c('0x72'))[_0x285c('0x75')]('NOW()',_0x285c('0x77'))[_0x285c('0x75')]('id',_0x285c('0x78'))['field'](_0x1ced9d['CmListId'][_0x285c('0x7a')](),_0x285c('0x73'))['field'](_0x3ed7bb[_0x285c('0x4e')]['id'][_0x285c('0x7a')](),_0x285c('0x63'))[_0x285c('0x75')](_0x285c('0x76'),_0x285c('0x5f'))['field'](_0x285c('0x76'),_0x285c('0x5e'))[_0x285c('0x7b')]('cm_contacts')['where'](_0x285c('0x7d'))[_0x285c('0x43')](_0x285c('0x7e'),_0x1ced9d[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')](_0x285c('0x7f')))[_0x285c('0x7a')]();}_0x490e57[_0x285c('0x87')](db[_0x285c('0x88')][_0x285c('0x39')](_0x2ac706));}return BPromise[_0x285c('0x89')](_0x490e57);}})[_0x285c('0x29')](function(){return _0x29f013;})['then'](respondWithResult(_0x540cd3,null))[_0x285c('0x4c')](handleError(_0x540cd3,null));};exports[_0x285c('0x8a')]=function(_0x551f7d,_0x495dc8,_0xb17d40){return db['Campaign'][_0x285c('0x51')]({'where':{'id':_0x551f7d['params']['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x495dc8,null))[_0x285c('0x29')](function(_0x41c8df){if(_0x41c8df){return _0x41c8df[_0x285c('0x8a')](_0x551f7d['query'][_0x285c('0x8b')]);}})[_0x285c('0x29')](function(_0x3fcc98){if(_0x3fcc98){return db[_0x285c('0x62')][_0x285c('0x2c')]({'where':{'ListId':_0x551f7d[_0x285c('0x39')][_0x285c('0x8b')],'CampaignId':_0x551f7d[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](function(){return _0x3fcc98;});}})['then'](respondWithStatusCode(_0x495dc8,null))[_0x285c('0x4c')](handleError(_0x495dc8,null));};exports['getBlackLists']=function(_0x10ea64,_0x4f5ee7,_0x3aa966){var _0x23f054={};var _0x5d0cd1={};var _0x536daa;var _0x528b16;return db[_0x285c('0x33')][_0x285c('0x61')]({'where':{'id':_0x10ea64[_0x285c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f5ee7,null))[_0x285c('0x29')](function(_0x1034a4){if(_0x1034a4){_0x536daa=_0x1034a4;_0x5d0cd1['model']=_[_0x285c('0x3a')](db[_0x285c('0x8c')][_0x285c('0x34')]);_0x5d0cd1[_0x285c('0x39')]=_[_0x285c('0x3a')](_0x10ea64['query']);_0x5d0cd1[_0x285c('0x3b')]=_[_0x285c('0x3c')](_0x5d0cd1['model'],_0x5d0cd1[_0x285c('0x39')]);_0x23f054['attributes']=_['intersection'](_0x5d0cd1[_0x285c('0x38')],qs['fields'](_0x10ea64[_0x285c('0x39')]['fields']));_0x23f054[_0x285c('0x3d')]=_0x23f054['attributes'][_0x285c('0x4f')]?_0x23f054[_0x285c('0x3d')]:_0x5d0cd1[_0x285c('0x38')];_0x23f054['order']=qs[_0x285c('0x42')](_0x10ea64[_0x285c('0x39')][_0x285c('0x42')]);_0x23f054['where']=qs['filters'](_[_0x285c('0x44')](_0x10ea64[_0x285c('0x39')],_0x5d0cd1[_0x285c('0x3b')]));if(_0x10ea64['query']['filter']){_0x23f054[_0x285c('0x43')]=_[_0x285c('0x46')](_0x23f054[_0x285c('0x43')],{'$or':_[_0x285c('0x47')](_0x23f054[_0x285c('0x3d')],function(_0x2f4dae){var _0x3a76e0={};_0x3a76e0[_0x2f4dae]={'$like':'%'+_0x10ea64[_0x285c('0x39')][_0x285c('0x45')]+'%'};return _0x3a76e0;})});}_0x23f054=_[_0x285c('0x46')]({},_0x23f054,_0x10ea64[_0x285c('0x49')]);return _0x536daa[_0x285c('0x8d')](_0x23f054);}})['then'](function(_0x434516){if(_0x434516){_0x528b16=_0x434516[_0x285c('0x4f')];if(!_0x10ea64[_0x285c('0x39')][_0x285c('0x3f')](_0x285c('0x40'))){_0x23f054[_0x285c('0x21')]=qs[_0x285c('0x21')](_0x10ea64['query'][_0x285c('0x21')]);_0x23f054[_0x285c('0x1f')]=qs[_0x285c('0x1f')](_0x10ea64[_0x285c('0x39')]['offset']);}return _0x536daa[_0x285c('0x8d')](_0x23f054);}})[_0x285c('0x29')](function(_0x19845a){if(_0x19845a){return _0x19845a?{'count':_0x528b16,'rows':_0x19845a}:null;}})[_0x285c('0x29')](respondWithResult(_0x4f5ee7,null))['catch'](handleError(_0x4f5ee7,null));};exports[_0x285c('0x8e')]=function(_0x20c0ef,_0x4f633e,_0x271f4b){var _0xc084a6,_0x5b292a;return db[_0x285c('0x33')][_0x285c('0x51')]({'where':{'id':_0x20c0ef[_0x285c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f633e,null))[_0x285c('0x29')](function(_0x11d527){if(_0x11d527){_0x5b292a=_0x11d527;return _0x11d527['addBlackLists'](_0x20c0ef[_0x285c('0x53')][_0x285c('0x8b')],_[_0x285c('0x5d')](_0x20c0ef['body'],['ids','id'])||{});}return null;})[_0x285c('0x6c')](function(_0x7304a2){var _0x216656;_0xc084a6=_0x7304a2||[];var _0x4f1f14=[];if(_0x7304a2){for(var _0x4629a0=0x0;_0x4629a0<_0x7304a2['length'];_0x4629a0+=0x1){var _0x585dc5=_0x7304a2[_0x4629a0][_0x285c('0x2a')]({'plain':!![]});_0x216656=squel[_0x285c('0x6f')]()[_0x285c('0x86')](_0x285c('0x8f'))[_0x285c('0x71')]([_0x285c('0x72'),_0x285c('0x78'),_0x285c('0x73'),_0x285c('0x63'),'createdAt','updatedAt'],squel['select']()[_0x285c('0x75')]('phone',_0x285c('0x72'))[_0x285c('0x75')]('id',_0x285c('0x78'))[_0x285c('0x75')](_0x585dc5[_0x285c('0x79')][_0x285c('0x7a')](),'ListId')[_0x285c('0x75')](_0x20c0ef['params']['id']['toString'](),_0x285c('0x63'))[_0x285c('0x75')](_0x285c('0x76'),'createdAt')['field'](_0x285c('0x76'),'updatedAt')['from'](_0x285c('0x7c'))[_0x285c('0x43')]('deletedAt\x20IS\x20NULL')[_0x285c('0x43')](_0x285c('0x7e'),_0x585dc5[_0x285c('0x79')][_0x285c('0x7a')]())[_0x285c('0x43')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x4f1f14[_0x285c('0x87')](db['sequelize']['query'](_0x216656));}return BPromise[_0x285c('0x89')](_0x4f1f14);}})[_0x285c('0x29')](function(){return _0xc084a6;})[_0x285c('0x29')](respondWithResult(_0x4f633e,null))[_0x285c('0x4c')](handleError(_0x4f633e,null));};exports[_0x285c('0x90')]=function(_0xb90e95,_0x360e98,_0x1d34d2){return db[_0x285c('0x33')][_0x285c('0x51')]({'where':{'id':_0xb90e95['params']['id']}})[_0x285c('0x29')](handleEntityNotFound(_0x360e98,null))[_0x285c('0x29')](function(_0x23e822){if(_0x23e822){return _0x23e822['removeBlackLists'](_0xb90e95[_0x285c('0x39')][_0x285c('0x8b')]);}})[_0x285c('0x29')](function(_0x1fef68){if(_0x1fef68){return db['CmHopperBlack'][_0x285c('0x2c')]({'where':{'ListId':_0xb90e95[_0x285c('0x39')][_0x285c('0x8b')],'CampaignId':_0xb90e95[_0x285c('0x4e')]['id']}})[_0x285c('0x29')](function(){return _0x1fef68;});}})[_0x285c('0x29')](respondWithStatusCode(_0x360e98,null))[_0x285c('0x4c')](handleError(_0x360e98,null));};
\ No newline at end of file
index 582446d..024fa1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x13ffab,_0x449a1c){var _0x11cfda=function(_0x2cd296){while(--_0x2cd296){_0x13ffab['push'](_0x13ffab['shift']());}};_0x11cfda(++_0x449a1c);}(_0x7a54,0x106));var _0x47a5=function(_0xfe70b9,_0x35a9d9){_0xfe70b9=_0xfe70b9-0x0;var _0x3609c0=_0x7a54[_0xfe70b9];return _0x3609c0;};'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':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5147b49..9b86cb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf874=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','Campaign','findAll','options','raw','where','include','model','attributes','map','GetCampaign','moment'];(function(_0x11aa40,_0x26774d){var _0x3f24a5=function(_0x55ae10){while(--_0x55ae10){_0x11aa40['push'](_0x11aa40['shift']());}};_0x3f24a5(++_0x26774d);}(_0xf874,0xed));var _0x4f87=function(_0x42c6f2,_0x204756){_0x42c6f2=_0x42c6f2-0x0;var _0x5bcdff=_0xf874[_0x42c6f2];return _0x5bcdff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4f87('0x0'));var BPromise=require(_0x4f87('0x1'));var rs=require(_0x4f87('0x2'));var fs=require('fs');var Redis=require(_0x4f87('0x3'));var db=require(_0x4f87('0x4'))['db'];var utils=require(_0x4f87('0x5'));var logger=require('../../config/logger')(_0x4f87('0x6'));var config=require(_0x4f87('0x7'));var jayson=require(_0x4f87('0x8'));var client=jayson[_0x4f87('0x9')][_0x4f87('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44fea6,_0x4a0662,_0x3a89e3){return new BPromise(function(_0x194853,_0x592008){return client[_0x4f87('0xb')](_0x44fea6,_0x3a89e3)[_0x4f87('0xc')](function(_0x4d8354){logger[_0x4f87('0xd')](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));logger[_0x4f87('0x10')](_0x4f87('0x11'),_0x4a0662,_0x4f87('0xf'),JSON[_0x4f87('0x12')](_0x4d8354));if(_0x4d8354['error']){if(_0x4d8354['error'][_0x4f87('0x13')]===0x1f4){logger[_0x4f87('0x14')](_0x4f87('0xe'),_0x4a0662,_0x4d8354['error']['message']);return _0x592008(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}logger[_0x4f87('0x14')]('Campaign,\x20%s,\x20%s',_0x4a0662,_0x4d8354[_0x4f87('0x14')]['message']);return _0x194853(_0x4d8354[_0x4f87('0x14')][_0x4f87('0x15')]);}else{logger['info'](_0x4f87('0xe'),_0x4a0662,_0x4f87('0xf'));_0x194853(_0x4d8354[_0x4f87('0x16')][_0x4f87('0x15')]);}})[_0x4f87('0x17')](function(_0x3bd90f){logger['error'](_0x4f87('0xe'),_0x4a0662,_0x3bd90f);_0x592008(_0x3bd90f);});});}exports['GetCampaign']=function(_0x10551e){var _0x6a3017=this;return new Promise(function(_0x46492d,_0x42c399){return db[_0x4f87('0x18')][_0x4f87('0x19')]({'raw':_0x10551e[_0x4f87('0x1a')]?_0x10551e[_0x4f87('0x1a')][_0x4f87('0x1b')]===undefined?!![]:![]:!![],'where':_0x10551e[_0x4f87('0x1a')]?_0x10551e[_0x4f87('0x1a')][_0x4f87('0x1c')]||null:null,'attributes':_0x10551e[_0x4f87('0x1a')]?_0x10551e['options']['attributes']||null:null,'limit':_0x10551e[_0x4f87('0x1a')]?_0x10551e[_0x4f87('0x1a')]['limit']||null:null,'include':_0x10551e['options']?_0x10551e[_0x4f87('0x1a')]['include']?_['map'](_0x10551e[_0x4f87('0x1a')][_0x4f87('0x1d')],function(_0x2a382c){return{'model':db[_0x2a382c[_0x4f87('0x1e')]],'as':_0x2a382c['as'],'attributes':_0x2a382c[_0x4f87('0x1f')],'include':_0x2a382c[_0x4f87('0x1d')]?_[_0x4f87('0x20')](_0x2a382c['include'],function(_0x234106){return{'model':db[_0x234106[_0x4f87('0x1e')]],'as':_0x234106['as'],'attributes':_0x234106[_0x4f87('0x1f')],'include':_0x234106['include']?_[_0x4f87('0x20')](_0x234106[_0x4f87('0x1d')],function(_0x51b8dd){return{'model':db[_0x51b8dd[_0x4f87('0x1e')]],'as':_0x51b8dd['as'],'attributes':_0x51b8dd[_0x4f87('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4f87('0xc')](function(_0x41e940){logger['info']('GetCampaign',_0x10551e);logger[_0x4f87('0x10')](_0x4f87('0x21'),_0x10551e,JSON[_0x4f87('0x12')](_0x41e940));_0x46492d(_0x41e940);})[_0x4f87('0x17')](function(_0x38e102){logger['error'](_0x4f87('0x21'),_0x38e102['message'],_0x10551e);_0x42c399(_0x6a3017[_0x4f87('0x14')](0x1f4,_0x38e102[_0x4f87('0x15')]));});});};
\ No newline at end of file
+var _0xee11=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Campaign,\x20%s,\x20%s','result','GetCampaign','Campaign','options','where','limit','include','map','attributes','model','debug','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x3cb882,_0x12f180){var _0x5d0bdb=function(_0x41780c){while(--_0x41780c){_0x3cb882['push'](_0x3cb882['shift']());}};_0x5d0bdb(++_0x12f180);}(_0xee11,0x146));var _0x1ee1=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0xee11[_0x269ee8];return _0x4d98bd;};'use strict';var _=require(_0x1ee1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1ee1('0x1'));var rs=require(_0x1ee1('0x2'));var fs=require('fs');var Redis=require(_0x1ee1('0x3'));var db=require(_0x1ee1('0x4'))['db'];var utils=require(_0x1ee1('0x5'));var logger=require(_0x1ee1('0x6'))(_0x1ee1('0x7'));var config=require(_0x1ee1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1ee1('0x9')][_0x1ee1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3fdb3b,_0x289d4c,_0x356919){return new BPromise(function(_0x47f984,_0x48af4c){return client[_0x1ee1('0xb')](_0x3fdb3b,_0x356919)[_0x1ee1('0xc')](function(_0x5899ca){logger[_0x1ee1('0xd')]('Campaign,\x20%s,\x20%s',_0x289d4c,_0x1ee1('0xe'));logger['debug'](_0x1ee1('0xf'),_0x289d4c,_0x1ee1('0xe'),JSON[_0x1ee1('0x10')](_0x5899ca));if(_0x5899ca[_0x1ee1('0x11')]){if(_0x5899ca['error'][_0x1ee1('0x12')]===0x1f4){logger[_0x1ee1('0x11')]('Campaign,\x20%s,\x20%s',_0x289d4c,_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);return _0x48af4c(_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);}logger[_0x1ee1('0x11')](_0x1ee1('0x14'),_0x289d4c,_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);return _0x47f984(_0x5899ca[_0x1ee1('0x11')][_0x1ee1('0x13')]);}else{logger[_0x1ee1('0xd')](_0x1ee1('0x14'),_0x289d4c,_0x1ee1('0xe'));_0x47f984(_0x5899ca[_0x1ee1('0x15')]['message']);}})['catch'](function(_0x7ff856){logger[_0x1ee1('0x11')](_0x1ee1('0x14'),_0x289d4c,_0x7ff856);_0x48af4c(_0x7ff856);});});}exports[_0x1ee1('0x16')]=function(_0x1e18b9){var _0xff3d76=this;return new Promise(function(_0x55abff,_0x39229e){return db[_0x1ee1('0x17')]['findAll']({'raw':_0x1e18b9[_0x1ee1('0x18')]?_0x1e18b9[_0x1ee1('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1e18b9['options']?_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x19')]||null:null,'attributes':_0x1e18b9[_0x1ee1('0x18')]?_0x1e18b9[_0x1ee1('0x18')]['attributes']||null:null,'limit':_0x1e18b9[_0x1ee1('0x18')]?_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x1a')]||null:null,'include':_0x1e18b9['options']?_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x1b')]?_[_0x1ee1('0x1c')](_0x1e18b9[_0x1ee1('0x18')][_0x1ee1('0x1b')],function(_0x353542){return{'model':db[_0x353542['model']],'as':_0x353542['as'],'attributes':_0x353542[_0x1ee1('0x1d')],'include':_0x353542['include']?_['map'](_0x353542[_0x1ee1('0x1b')],function(_0x306aac){return{'model':db[_0x306aac['model']],'as':_0x306aac['as'],'attributes':_0x306aac[_0x1ee1('0x1d')],'include':_0x306aac[_0x1ee1('0x1b')]?_[_0x1ee1('0x1c')](_0x306aac[_0x1ee1('0x1b')],function(_0x129232){return{'model':db[_0x129232[_0x1ee1('0x1e')]],'as':_0x129232['as'],'attributes':_0x129232['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ee1('0xc')](function(_0x8a95d8){logger[_0x1ee1('0xd')](_0x1ee1('0x16'),_0x1e18b9);logger[_0x1ee1('0x1f')](_0x1ee1('0x16'),_0x1e18b9,JSON['stringify'](_0x8a95d8));_0x55abff(_0x8a95d8);})[_0x1ee1('0x20')](function(_0x576bf4){logger[_0x1ee1('0x11')](_0x1ee1('0x16'),_0x576bf4['message'],_0x1e18b9);_0x39229e(_0xff3d76['error'](0x1f4,_0x576bf4[_0x1ee1('0x13')]));});});};
\ No newline at end of file
index 4d9caee..e0917ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed26=['getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','put','update','delete','/:id','destroy','removeLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories'];(function(_0x47fee3,_0x1d1878){var _0x1b8554=function(_0x5aeafb){while(--_0x5aeafb){_0x47fee3['push'](_0x47fee3['shift']());}};_0x1b8554(++_0x1d1878);}(_0xed26,0xf8));var _0x6ed2=function(_0x58214c,_0x24be4c){_0x58214c=_0x58214c-0x0;var _0x1ef67a=_0xed26[_0x58214c];return _0x1ef67a;};'use strict';var multer=require(_0x6ed2('0x0'));var util=require(_0x6ed2('0x1'));var path=require(_0x6ed2('0x2'));var timeout=require(_0x6ed2('0x3'));var express=require(_0x6ed2('0x4'));var router=express[_0x6ed2('0x5')]();var fs_extra=require(_0x6ed2('0x6'));var auth=require(_0x6ed2('0x7'));var interaction=require(_0x6ed2('0x8'));var config=require(_0x6ed2('0x9'));var controller=require(_0x6ed2('0xa'));router[_0x6ed2('0xb')]('/',auth[_0x6ed2('0xc')](),controller[_0x6ed2('0xd')]);router[_0x6ed2('0xb')]('/:id',auth[_0x6ed2('0xc')](),controller[_0x6ed2('0xe')]);router[_0x6ed2('0xb')](_0x6ed2('0xf'),auth['isAuthenticated'](),controller[_0x6ed2('0x10')]);router['get'](_0x6ed2('0x11'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x12')]);router[_0x6ed2('0xb')](_0x6ed2('0x13'),auth[_0x6ed2('0xc')](),controller['getHopperFinals']);router[_0x6ed2('0xb')](_0x6ed2('0x14'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x15')]);router[_0x6ed2('0xb')](_0x6ed2('0x16'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x17')]);router[_0x6ed2('0xb')](_0x6ed2('0x18'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x19')]);router[_0x6ed2('0x1a')]('/',auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x1b')]);router[_0x6ed2('0x1a')](_0x6ed2('0x1c'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x1d')]);router[_0x6ed2('0x1a')](_0x6ed2('0x16'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x1e')]);router[_0x6ed2('0x1a')](_0x6ed2('0x18'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0x6ed2('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x6ed2('0x20')]);router[_0x6ed2('0x21')](_0x6ed2('0x22'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x23')]);router[_0x6ed2('0x21')](_0x6ed2('0x16'),auth[_0x6ed2('0xc')](),controller[_0x6ed2('0x24')]);router[_0x6ed2('0x21')]('/:id/blacklists',auth[_0x6ed2('0xc')](),controller['removeBlackLists']);module[_0x6ed2('0x25')]=router;
\ No newline at end of file
+var _0x0047=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x5638f6,_0x6d4277){var _0x13ea4c=function(_0x5698b7){while(--_0x5698b7){_0x5638f6['push'](_0x5638f6['shift']());}};_0x13ea4c(++_0x6d4277);}(_0x0047,0x69));var _0x7004=function(_0x9dfc10,_0x19c2d5){_0x9dfc10=_0x9dfc10-0x0;var _0x4f938a=_0x0047[_0x9dfc10];return _0x4f938a;};'use strict';var multer=require(_0x7004('0x0'));var util=require(_0x7004('0x1'));var path=require('path');var timeout=require(_0x7004('0x2'));var express=require('express');var router=express[_0x7004('0x3')]();var fs_extra=require(_0x7004('0x4'));var auth=require(_0x7004('0x5'));var interaction=require(_0x7004('0x6'));var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0x7004('0x7')]('/',auth[_0x7004('0x8')](),controller[_0x7004('0x9')]);router[_0x7004('0x7')](_0x7004('0xa'),auth[_0x7004('0x8')](),controller[_0x7004('0xb')]);router[_0x7004('0x7')](_0x7004('0xc'),auth[_0x7004('0x8')](),controller[_0x7004('0xd')]);router[_0x7004('0x7')](_0x7004('0xe'),auth[_0x7004('0x8')](),controller[_0x7004('0xf')]);router[_0x7004('0x7')](_0x7004('0x10'),auth[_0x7004('0x8')](),controller[_0x7004('0x11')]);router[_0x7004('0x7')](_0x7004('0x12'),auth['isAuthenticated'](),controller[_0x7004('0x13')]);router[_0x7004('0x7')](_0x7004('0x14'),auth[_0x7004('0x8')](),controller[_0x7004('0x15')]);router['get'](_0x7004('0x16'),auth[_0x7004('0x8')](),controller['getBlackLists']);router[_0x7004('0x17')]('/',auth[_0x7004('0x8')](),controller[_0x7004('0x18')]);router['post'](_0x7004('0x19'),auth['isAuthenticated'](),controller[_0x7004('0x1a')]);router[_0x7004('0x17')](_0x7004('0x14'),auth[_0x7004('0x8')](),controller[_0x7004('0x1b')]);router['post'](_0x7004('0x16'),auth[_0x7004('0x8')](),controller[_0x7004('0x1c')]);router[_0x7004('0x1d')](_0x7004('0xa'),auth[_0x7004('0x8')](),controller['update']);router[_0x7004('0x1e')](_0x7004('0xa'),auth[_0x7004('0x8')](),controller[_0x7004('0x1f')]);router[_0x7004('0x1e')](_0x7004('0x14'),auth[_0x7004('0x8')](),controller[_0x7004('0x20')]);router[_0x7004('0x1e')](_0x7004('0x16'),auth[_0x7004('0x8')](),controller[_0x7004('0x21')]);module[_0x7004('0x22')]=router;
\ No newline at end of file
index f2e5fee..0ea522f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb55=['STRING','TEXT','VIRTUAL','getDataValue'];(function(_0x58b93f,_0x461181){var _0x4b38ab=function(_0x272e38){while(--_0x272e38){_0x58b93f['push'](_0x58b93f['shift']());}};_0x4b38ab(++_0x461181);}(_0xdb55,0x1b0));var _0x5db5=function(_0xa03e76,_0xaee3a6){_0xa03e76=_0xa03e76-0x0;var _0x4132be=_0xdb55[_0xa03e76];return _0x4132be;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x5db5('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x5db5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5db5('0x0')]},'name':{'type':Sequelize[_0x5db5('0x2')],'get':function(){return this[_0x5db5('0x3')]('key');}}};
\ No newline at end of file
+var _0x574c=['VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x4a850a,_0x43ed12){var _0x1126ec=function(_0x27a594){while(--_0x27a594){_0x4a850a['push'](_0x4a850a['shift']());}};_0x1126ec(++_0x43ed12);}(_0x574c,0xf3));var _0xc574=function(_0x519828,_0x51ff66){_0x519828=_0x519828-0x0;var _0x25857b=_0x574c[_0x519828];return _0x25857b;};'use strict';var Sequelize=require(_0xc574('0x0'));module[_0xc574('0x1')]={'key':{'type':Sequelize[_0xc574('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xc574('0x2')]},'name':{'type':Sequelize[_0xc574('0x3')],'get':function(){return this[_0xc574('0x4')](_0xc574('0x5'));}}};
\ No newline at end of file
index 894b09a..5dec0f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86a8=['mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','CannedAnswer','includeAll','include','findAll','rows','catch','show','params','find','body','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','eml-format','rimraf','zip-dir','request-promise','moment','bluebird'];(function(_0x1f902e,_0x3f0dff){var _0x781015=function(_0x2b2322){while(--_0x2b2322){_0x1f902e['push'](_0x1f902e['shift']());}};_0x781015(++_0x3f0dff);}(_0x86a8,0x15e));var _0x886a=function(_0x23e50d,_0x4a7c5c){_0x23e50d=_0x23e50d-0x0;var _0x1dd4a2=_0x86a8[_0x23e50d];return _0x1dd4a2;};'use strict';var emlformat=require(_0x886a('0x0'));var rimraf=require(_0x886a('0x1'));var zipdir=require(_0x886a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x886a('0x3'));var moment=require(_0x886a('0x4'));var BPromise=require(_0x886a('0x5'));var Mustache=require(_0x886a('0x6'));var util=require('util');var path=require('path');var sox=require(_0x886a('0x7'));var csv=require(_0x886a('0x8'));var ejs=require(_0x886a('0x9'));var fs=require('fs');var fs_extra=require(_0x886a('0xa'));var _=require(_0x886a('0xb'));var squel=require(_0x886a('0xc'));var crypto=require(_0x886a('0xd'));var jsforce=require(_0x886a('0xe'));var deskjs=require(_0x886a('0xf'));var toCsv=require(_0x886a('0x8'));var querystring=require(_0x886a('0x10'));var Papa=require(_0x886a('0x11'));var Redis=require(_0x886a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x886a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x886a('0x14'))(_0x886a('0x15'));var utils=require(_0x886a('0x16'));var config=require(_0x886a('0x17'));var licenseUtil=require(_0x886a('0x18'));var db=require(_0x886a('0x19'))['db'];function respondWithStatusCode(_0x4d153e,_0x5b1101){_0x5b1101=_0x5b1101||0xcc;return function(_0x18a3e2){if(_0x18a3e2){return _0x4d153e[_0x886a('0x1a')](_0x5b1101);}return _0x4d153e[_0x886a('0x1b')](_0x5b1101)['end']();};}function respondWithResult(_0x3ed48d,_0x46601c){_0x46601c=_0x46601c||0xc8;return function(_0x4e08c3){if(_0x4e08c3){return _0x3ed48d[_0x886a('0x1b')](_0x46601c)[_0x886a('0x1c')](_0x4e08c3);}};}function respondWithFilteredResult(_0x214934,_0x1c46b5){return function(_0x9b853a){if(_0x9b853a){var _0x583236=typeof _0x1c46b5['offset']===_0x886a('0x1d')&&typeof _0x1c46b5[_0x886a('0x1e')]==='undefined';var _0x4e5d84=_0x9b853a[_0x886a('0x1f')];var _0x576aaa=_0x583236?0x0:_0x1c46b5[_0x886a('0x20')];var _0x2a98a7=_0x583236?_0x9b853a['count']:_0x1c46b5[_0x886a('0x20')]+_0x1c46b5[_0x886a('0x1e')];var _0x4dd934;if(_0x2a98a7>=_0x4e5d84){_0x2a98a7=_0x4e5d84;_0x4dd934=0xc8;}else{_0x4dd934=0xce;}_0x214934[_0x886a('0x1b')](_0x4dd934);return _0x214934[_0x886a('0x21')](_0x886a('0x22'),_0x576aaa+'-'+_0x2a98a7+'/'+_0x4e5d84)[_0x886a('0x1c')](_0x9b853a);}return null;};}function patchUpdates(_0x19924f){return function(_0x11f274){try{jsonpatch[_0x886a('0x23')](_0x11f274,_0x19924f,!![]);}catch(_0x2cd722){return BPromise['reject'](_0x2cd722);}return _0x11f274[_0x886a('0x24')]();};}function saveUpdates(_0x3093d8,_0x492f84){return function(_0x2184ad){if(_0x2184ad){return _0x2184ad[_0x886a('0x25')](_0x3093d8)[_0x886a('0x26')](function(_0x29b80f){return _0x29b80f;});}return null;};}function removeEntity(_0x43fbf8,_0x476d69){return function(_0x4a317e){if(_0x4a317e){return _0x4a317e[_0x886a('0x27')]()[_0x886a('0x26')](function(){var _0x45d2f0=_0x4a317e[_0x886a('0x28')]({'plain':!![]});var _0x474622=_0x886a('0x29');return db[_0x886a('0x2a')][_0x886a('0x27')]({'where':{'type':_0x474622,'resourceId':_0x45d2f0['id']}})[_0x886a('0x26')](function(){return _0x4a317e;});})[_0x886a('0x26')](function(){_0x43fbf8[_0x886a('0x1b')](0xcc)[_0x886a('0x2b')]();});}};}function handleEntityNotFound(_0x355a6b,_0x293190){return function(_0x17a93c){if(!_0x17a93c){_0x355a6b[_0x886a('0x1a')](0x194);}return _0x17a93c;};}function handleError(_0x1cbcbf,_0xa8107d){_0xa8107d=_0xa8107d||0x1f4;return function(_0x3f1c0f){logger[_0x886a('0x2c')](_0x3f1c0f['stack']);if(_0x3f1c0f['name']){delete _0x3f1c0f[_0x886a('0x2d')];}_0x1cbcbf[_0x886a('0x1b')](_0xa8107d)[_0x886a('0x2e')](_0x3f1c0f);};}exports[_0x886a('0x2f')]=function(_0x317bd5,_0x3fae08){var _0x38b3b8={},_0x2d2abb={},_0x2db8f0={'count':0x0,'rows':[]};var _0x31a8e0=_[_0x886a('0x30')](db['CannedAnswer'][_0x886a('0x31')],function(_0x91058b){return{'name':_0x91058b['fieldName'],'type':_0x91058b['type'][_0x886a('0x32')]};});_0x2d2abb[_0x886a('0x33')]=_[_0x886a('0x30')](_0x31a8e0,_0x886a('0x2d'));_0x2d2abb['query']=_[_0x886a('0x34')](_0x317bd5[_0x886a('0x35')]);_0x2d2abb[_0x886a('0x36')]=_[_0x886a('0x37')](_0x2d2abb[_0x886a('0x33')],_0x2d2abb['query']);_0x38b3b8[_0x886a('0x38')]=_['intersection'](_0x2d2abb[_0x886a('0x33')],qs[_0x886a('0x39')](_0x317bd5[_0x886a('0x35')][_0x886a('0x39')]));_0x38b3b8[_0x886a('0x38')]=_0x38b3b8['attributes'][_0x886a('0x3a')]?_0x38b3b8['attributes']:_0x2d2abb['model'];if(!_0x317bd5[_0x886a('0x35')][_0x886a('0x3b')](_0x886a('0x3c'))){_0x38b3b8[_0x886a('0x1e')]=qs[_0x886a('0x1e')](_0x317bd5[_0x886a('0x35')][_0x886a('0x1e')]);_0x38b3b8[_0x886a('0x20')]=qs[_0x886a('0x20')](_0x317bd5['query'][_0x886a('0x20')]);}_0x38b3b8[_0x886a('0x3d')]=qs[_0x886a('0x3e')](_0x317bd5[_0x886a('0x35')][_0x886a('0x3e')]);_0x38b3b8[_0x886a('0x3f')]=qs[_0x886a('0x36')](_[_0x886a('0x40')](_0x317bd5[_0x886a('0x35')],_0x2d2abb[_0x886a('0x36')]),_0x31a8e0);if(_0x317bd5[_0x886a('0x35')]['filter']){_0x38b3b8[_0x886a('0x3f')]=_[_0x886a('0x41')](_0x38b3b8[_0x886a('0x3f')],{'$or':[{'key':{'$like':'%'+_0x317bd5[_0x886a('0x35')][_0x886a('0x42')]+'%'}},{'value':{'$like':'%'+_0x317bd5[_0x886a('0x35')][_0x886a('0x42')]+'%'}}]});}_0x38b3b8=_[_0x886a('0x41')]({},_0x38b3b8,_0x317bd5[_0x886a('0x43')]);var _0x14bbca={'where':_0x38b3b8[_0x886a('0x3f')]};return db[_0x886a('0x44')][_0x886a('0x1f')](_0x14bbca)['then'](function(_0x5c7edc){_0x2db8f0['count']=_0x5c7edc;if(_0x317bd5[_0x886a('0x35')][_0x886a('0x45')]){_0x38b3b8[_0x886a('0x46')]=[{'all':!![]}];}return db[_0x886a('0x44')][_0x886a('0x47')](_0x38b3b8);})[_0x886a('0x26')](function(_0x2202f9){_0x2db8f0[_0x886a('0x48')]=_0x2202f9;return _0x2db8f0;})[_0x886a('0x26')](respondWithFilteredResult(_0x3fae08,_0x38b3b8))[_0x886a('0x49')](handleError(_0x3fae08,null));};exports[_0x886a('0x4a')]=function(_0x181de4,_0x45b6d2){var _0x4b7024={'raw':!![],'where':{'id':_0x181de4[_0x886a('0x4b')]['id']}},_0x21aa60={};_0x21aa60['model']=_[_0x886a('0x34')](db['CannedAnswer']['rawAttributes']);_0x21aa60[_0x886a('0x35')]=_[_0x886a('0x34')](_0x181de4[_0x886a('0x35')]);_0x21aa60[_0x886a('0x36')]=_['intersection'](_0x21aa60['model'],_0x21aa60[_0x886a('0x35')]);_0x4b7024[_0x886a('0x38')]=_[_0x886a('0x37')](_0x21aa60['model'],qs[_0x886a('0x39')](_0x181de4['query'][_0x886a('0x39')]));_0x4b7024[_0x886a('0x38')]=_0x4b7024[_0x886a('0x38')][_0x886a('0x3a')]?_0x4b7024[_0x886a('0x38')]:_0x21aa60[_0x886a('0x33')];if(_0x181de4['query'][_0x886a('0x45')]){_0x4b7024[_0x886a('0x46')]=[{'all':!![]}];}_0x4b7024=_[_0x886a('0x41')]({},_0x4b7024,_0x181de4[_0x886a('0x43')]);return db[_0x886a('0x44')][_0x886a('0x4c')](_0x4b7024)['then'](handleEntityNotFound(_0x45b6d2,null))[_0x886a('0x26')](respondWithResult(_0x45b6d2,null))['catch'](handleError(_0x45b6d2,null));};exports[_0x886a('0x25')]=function(_0x4654a9,_0x1634ef){if(_0x4654a9[_0x886a('0x4d')]['id']){delete _0x4654a9[_0x886a('0x4d')]['id'];}return db[_0x886a('0x44')]['find']({'where':{'id':_0x4654a9[_0x886a('0x4b')]['id']}})[_0x886a('0x26')](handleEntityNotFound(_0x1634ef,null))[_0x886a('0x26')](saveUpdates(_0x4654a9['body'],null))[_0x886a('0x26')](respondWithResult(_0x1634ef,null))[_0x886a('0x49')](handleError(_0x1634ef,null));};exports[_0x886a('0x27')]=function(_0x2da45a,_0x2286b1){return db[_0x886a('0x44')]['find']({'where':{'id':_0x2da45a[_0x886a('0x4b')]['id']}})[_0x886a('0x26')](handleEntityNotFound(_0x2286b1,null))[_0x886a('0x26')](removeEntity(_0x2286b1,null))[_0x886a('0x49')](handleError(_0x2286b1,null));};exports['create']=function(_0x4dc22a,_0x2c1884){var _0x61c0dc={'key':_0x4dc22a[_0x886a('0x4d')][_0x886a('0x32')]};if(_0x4dc22a[_0x886a('0x4d')]['MailAccountId']){_0x61c0dc[_0x886a('0x4e')]=_0x4dc22a[_0x886a('0x4d')][_0x886a('0x4e')];}else if(_0x4dc22a[_0x886a('0x4d')][_0x886a('0x4f')]){_0x61c0dc[_0x886a('0x4f')]=_0x4dc22a[_0x886a('0x4d')][_0x886a('0x4f')];}else if(_0x4dc22a[_0x886a('0x4d')][_0x886a('0x50')]){_0x61c0dc['OpenchannelAccountId']=_0x4dc22a[_0x886a('0x4d')]['OpenchannelAccountId'];}else if(_0x4dc22a[_0x886a('0x4d')][_0x886a('0x51')]){_0x61c0dc['ChatWebsiteId']=_0x4dc22a['body']['ChatWebsiteId'];}return db[_0x886a('0x44')]['find']({'where':_0x61c0dc})[_0x886a('0x26')](function(_0x43a1dd){if(_0x43a1dd){throw new db[(_0x886a('0x52'))][(_0x886a('0x53'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x886a('0x44')][_0x886a('0x54')](_0x4dc22a[_0x886a('0x4d')]);})[_0x886a('0x26')](function(_0x4b3f1c){var _0xb050ce=_0x4dc22a[_0x886a('0x55')]['get']({'plain':!![]});if(!_0xb050ce)throw new Error(_0x886a('0x56'));if(_0xb050ce['role']==='user'){var _0x387a32=_0x4b3f1c[_0x886a('0x28')]({'plain':!![]});return db[_0x886a('0x57')][_0x886a('0x4c')]({'where':{'name':_0x886a('0x29'),'userProfileId':_0xb050ce[_0x886a('0x58')]},'raw':!![]})['then'](function(_0x4da8cc){if(_0x4da8cc&&_0x4da8cc['autoAssociation']===0x0){return db[_0x886a('0x2a')][_0x886a('0x54')]({'name':_0x387a32[_0x886a('0x2d')],'resourceId':_0x387a32['id'],'type':_0x4da8cc['name'],'sectionId':_0x4da8cc['id']},{})['then'](function(){return _0x4b3f1c;});}else{return _0x4b3f1c;}})['catch'](function(_0x46dd24){logger[_0x886a('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46dd24);throw _0x46dd24;});}return _0x4b3f1c;})['then'](respondWithResult(_0x2c1884,0xc9))['catch'](handleError(_0x2c1884,null));};
\ No newline at end of file
+var _0xef9f=['create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','show','params','catch','body','find'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xef9f,0x122));var _0xfef9=function(_0x3893cd,_0x5b133e){_0x3893cd=_0x3893cd-0x0;var _0x818ea5=_0xef9f[_0x3893cd];return _0x818ea5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfef9('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfef9('0x1'));var moment=require(_0xfef9('0x2'));var BPromise=require(_0xfef9('0x3'));var Mustache=require(_0xfef9('0x4'));var util=require(_0xfef9('0x5'));var path=require(_0xfef9('0x6'));var sox=require('sox');var csv=require(_0xfef9('0x7'));var ejs=require(_0xfef9('0x8'));var fs=require('fs');var fs_extra=require(_0xfef9('0x9'));var _=require(_0xfef9('0xa'));var squel=require(_0xfef9('0xb'));var crypto=require(_0xfef9('0xc'));var jsforce=require(_0xfef9('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfef9('0xe'));var Papa=require(_0xfef9('0xf'));var Redis=require(_0xfef9('0x10'));var authService=require(_0xfef9('0x11'));var qs=require(_0xfef9('0x12'));var as=require(_0xfef9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfef9('0x14'))('api');var utils=require(_0xfef9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfef9('0x16'));var db=require(_0xfef9('0x17'))['db'];function respondWithStatusCode(_0x3df20b,_0x20c90e){_0x20c90e=_0x20c90e||0xcc;return function(_0x350a31){if(_0x350a31){return _0x3df20b[_0xfef9('0x18')](_0x20c90e);}return _0x3df20b['status'](_0x20c90e)['end']();};}function respondWithResult(_0x2e3c95,_0x3eab72){_0x3eab72=_0x3eab72||0xc8;return function(_0x41064e){if(_0x41064e){return _0x2e3c95[_0xfef9('0x19')](_0x3eab72)['json'](_0x41064e);}};}function respondWithFilteredResult(_0x44646e,_0xa32f1){return function(_0x263386){if(_0x263386){var _0x4c6683=typeof _0xa32f1[_0xfef9('0x1a')]===_0xfef9('0x1b')&&typeof _0xa32f1['limit']===_0xfef9('0x1b');var _0x1d2277=_0x263386[_0xfef9('0x1c')];var _0xeaa514=_0x4c6683?0x0:_0xa32f1[_0xfef9('0x1a')];var _0x108a6b=_0x4c6683?_0x263386[_0xfef9('0x1c')]:_0xa32f1[_0xfef9('0x1a')]+_0xa32f1['limit'];var _0x36df58;if(_0x108a6b>=_0x1d2277){_0x108a6b=_0x1d2277;_0x36df58=0xc8;}else{_0x36df58=0xce;}_0x44646e[_0xfef9('0x19')](_0x36df58);return _0x44646e['set'](_0xfef9('0x1d'),_0xeaa514+'-'+_0x108a6b+'/'+_0x1d2277)[_0xfef9('0x1e')](_0x263386);}return null;};}function patchUpdates(_0x5e3cf9){return function(_0x381237){try{jsonpatch[_0xfef9('0x1f')](_0x381237,_0x5e3cf9,!![]);}catch(_0x57266d){return BPromise[_0xfef9('0x20')](_0x57266d);}return _0x381237['save']();};}function saveUpdates(_0x107cc1,_0x1ce2d8){return function(_0x3801fc){if(_0x3801fc){return _0x3801fc[_0xfef9('0x21')](_0x107cc1)[_0xfef9('0x22')](function(_0x20a8d3){return _0x20a8d3;});}return null;};}function removeEntity(_0x86ed5d,_0x376ca7){return function(_0x23b3d2){if(_0x23b3d2){return _0x23b3d2[_0xfef9('0x23')]()[_0xfef9('0x22')](function(){var _0x573740=_0x23b3d2[_0xfef9('0x24')]({'plain':!![]});var _0x32c213=_0xfef9('0x25');return db[_0xfef9('0x26')][_0xfef9('0x23')]({'where':{'type':_0x32c213,'resourceId':_0x573740['id']}})[_0xfef9('0x22')](function(){return _0x23b3d2;});})[_0xfef9('0x22')](function(){_0x86ed5d[_0xfef9('0x19')](0xcc)[_0xfef9('0x27')]();});}};}function handleEntityNotFound(_0x528c02,_0x566642){return function(_0x2af7d2){if(!_0x2af7d2){_0x528c02[_0xfef9('0x18')](0x194);}return _0x2af7d2;};}function handleError(_0x28dfc5,_0x5aaa9f){_0x5aaa9f=_0x5aaa9f||0x1f4;return function(_0x1f74ef){logger[_0xfef9('0x28')](_0x1f74ef[_0xfef9('0x29')]);if(_0x1f74ef[_0xfef9('0x2a')]){delete _0x1f74ef[_0xfef9('0x2a')];}_0x28dfc5[_0xfef9('0x19')](_0x5aaa9f)[_0xfef9('0x2b')](_0x1f74ef);};}exports[_0xfef9('0x2c')]=function(_0x6a2edc,_0x1ef741){var _0x345661={},_0x46da4d={},_0x245958={'count':0x0,'rows':[]};var _0x6955b2=_[_0xfef9('0x2d')](db['CannedAnswer'][_0xfef9('0x2e')],function(_0x1c0ab9){return{'name':_0x1c0ab9[_0xfef9('0x2f')],'type':_0x1c0ab9[_0xfef9('0x30')][_0xfef9('0x31')]};});_0x46da4d[_0xfef9('0x32')]=_[_0xfef9('0x2d')](_0x6955b2,_0xfef9('0x2a'));_0x46da4d[_0xfef9('0x33')]=_[_0xfef9('0x34')](_0x6a2edc['query']);_0x46da4d[_0xfef9('0x35')]=_['intersection'](_0x46da4d['model'],_0x46da4d[_0xfef9('0x33')]);_0x345661['attributes']=_[_0xfef9('0x36')](_0x46da4d[_0xfef9('0x32')],qs['fields'](_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x37')]));_0x345661[_0xfef9('0x38')]=_0x345661[_0xfef9('0x38')][_0xfef9('0x39')]?_0x345661[_0xfef9('0x38')]:_0x46da4d[_0xfef9('0x32')];if(!_0x6a2edc['query'][_0xfef9('0x3a')](_0xfef9('0x3b'))){_0x345661[_0xfef9('0x3c')]=qs[_0xfef9('0x3c')](_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x3c')]);_0x345661[_0xfef9('0x1a')]=qs['offset'](_0x6a2edc['query'][_0xfef9('0x1a')]);}_0x345661[_0xfef9('0x3d')]=qs[_0xfef9('0x3e')](_0x6a2edc['query']['sort']);_0x345661[_0xfef9('0x3f')]=qs[_0xfef9('0x35')](_[_0xfef9('0x40')](_0x6a2edc['query'],_0x46da4d['filters']),_0x6955b2);if(_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x41')]){_0x345661[_0xfef9('0x3f')]=_[_0xfef9('0x42')](_0x345661[_0xfef9('0x3f')],{'$or':[{'key':{'$like':'%'+_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x41')]+'%'}},{'value':{'$like':'%'+_0x6a2edc['query']['filter']+'%'}}]});}_0x345661=_[_0xfef9('0x42')]({},_0x345661,_0x6a2edc[_0xfef9('0x43')]);var _0xf64f63={'where':_0x345661['where']};return db[_0xfef9('0x44')]['count'](_0xf64f63)[_0xfef9('0x22')](function(_0x1008eb){_0x245958[_0xfef9('0x1c')]=_0x1008eb;if(_0x6a2edc[_0xfef9('0x33')][_0xfef9('0x45')]){_0x345661[_0xfef9('0x46')]=[{'all':!![]}];}return db[_0xfef9('0x44')][_0xfef9('0x47')](_0x345661);})[_0xfef9('0x22')](function(_0xf13127){_0x245958[_0xfef9('0x48')]=_0xf13127;return _0x245958;})[_0xfef9('0x22')](respondWithFilteredResult(_0x1ef741,_0x345661))['catch'](handleError(_0x1ef741,null));};exports[_0xfef9('0x49')]=function(_0x4d411b,_0x45a701){var _0x4b29fb={'raw':!![],'where':{'id':_0x4d411b[_0xfef9('0x4a')]['id']}},_0x4fc3ad={};_0x4fc3ad['model']=_[_0xfef9('0x34')](db[_0xfef9('0x44')][_0xfef9('0x2e')]);_0x4fc3ad['query']=_[_0xfef9('0x34')](_0x4d411b['query']);_0x4fc3ad[_0xfef9('0x35')]=_['intersection'](_0x4fc3ad[_0xfef9('0x32')],_0x4fc3ad[_0xfef9('0x33')]);_0x4b29fb[_0xfef9('0x38')]=_['intersection'](_0x4fc3ad[_0xfef9('0x32')],qs[_0xfef9('0x37')](_0x4d411b[_0xfef9('0x33')]['fields']));_0x4b29fb[_0xfef9('0x38')]=_0x4b29fb[_0xfef9('0x38')][_0xfef9('0x39')]?_0x4b29fb['attributes']:_0x4fc3ad[_0xfef9('0x32')];if(_0x4d411b['query'][_0xfef9('0x45')]){_0x4b29fb[_0xfef9('0x46')]=[{'all':!![]}];}_0x4b29fb=_[_0xfef9('0x42')]({},_0x4b29fb,_0x4d411b['options']);return db['CannedAnswer']['find'](_0x4b29fb)[_0xfef9('0x22')](handleEntityNotFound(_0x45a701,null))[_0xfef9('0x22')](respondWithResult(_0x45a701,null))[_0xfef9('0x4b')](handleError(_0x45a701,null));};exports[_0xfef9('0x21')]=function(_0x135882,_0x7bd636){if(_0x135882[_0xfef9('0x4c')]['id']){delete _0x135882[_0xfef9('0x4c')]['id'];}return db[_0xfef9('0x44')]['find']({'where':{'id':_0x135882['params']['id']}})[_0xfef9('0x22')](handleEntityNotFound(_0x7bd636,null))[_0xfef9('0x22')](saveUpdates(_0x135882['body'],null))[_0xfef9('0x22')](respondWithResult(_0x7bd636,null))[_0xfef9('0x4b')](handleError(_0x7bd636,null));};exports['destroy']=function(_0x134f65,_0x370239){return db[_0xfef9('0x44')][_0xfef9('0x4d')]({'where':{'id':_0x134f65[_0xfef9('0x4a')]['id']}})[_0xfef9('0x22')](handleEntityNotFound(_0x370239,null))[_0xfef9('0x22')](removeEntity(_0x370239,null))['catch'](handleError(_0x370239,null));};exports[_0xfef9('0x4e')]=function(_0x59368d,_0x12f547){var _0x2566a7={'key':_0x59368d[_0xfef9('0x4c')][_0xfef9('0x31')]};if(_0x59368d[_0xfef9('0x4c')][_0xfef9('0x4f')]){_0x2566a7[_0xfef9('0x4f')]=_0x59368d[_0xfef9('0x4c')][_0xfef9('0x4f')];}else if(_0x59368d['body'][_0xfef9('0x50')]){_0x2566a7[_0xfef9('0x50')]=_0x59368d['body'][_0xfef9('0x50')];}else if(_0x59368d[_0xfef9('0x4c')]['OpenchannelAccountId']){_0x2566a7[_0xfef9('0x51')]=_0x59368d[_0xfef9('0x4c')][_0xfef9('0x51')];}else if(_0x59368d[_0xfef9('0x4c')]['ChatWebsiteId']){_0x2566a7['ChatWebsiteId']=_0x59368d[_0xfef9('0x4c')][_0xfef9('0x52')];}return db['CannedAnswer'][_0xfef9('0x4d')]({'where':_0x2566a7})[_0xfef9('0x22')](function(_0x3765a5){if(_0x3765a5){throw new db[(_0xfef9('0x53'))][(_0xfef9('0x54'))](_0xfef9('0x55'));}return db['CannedAnswer'][_0xfef9('0x4e')](_0x59368d[_0xfef9('0x4c')]);})[_0xfef9('0x22')](function(_0x1c4db4){var _0x56a64c=_0x59368d[_0xfef9('0x56')][_0xfef9('0x24')]({'plain':!![]});if(!_0x56a64c)throw new Error(_0xfef9('0x57'));if(_0x56a64c['role']===_0xfef9('0x56')){var _0x5c3c7a=_0x1c4db4[_0xfef9('0x24')]({'plain':!![]});return db[_0xfef9('0x58')][_0xfef9('0x4d')]({'where':{'name':_0xfef9('0x25'),'userProfileId':_0x56a64c[_0xfef9('0x59')]},'raw':!![]})['then'](function(_0x1115a5){if(_0x1115a5&&_0x1115a5[_0xfef9('0x5a')]===0x0){return db[_0xfef9('0x26')][_0xfef9('0x4e')]({'name':_0x5c3c7a[_0xfef9('0x2a')],'resourceId':_0x5c3c7a['id'],'type':_0x1115a5[_0xfef9('0x2a')],'sectionId':_0x1115a5['id']},{})['then'](function(){return _0x1c4db4;});}else{return _0x1c4db4;}})[_0xfef9('0x4b')](function(_0x4efd85){logger[_0xfef9('0x28')](_0xfef9('0x5b'),_0x4efd85);throw _0x4efd85;});}return _0x1c4db4;})[_0xfef9('0x22')](respondWithResult(_0x12f547,0xc9))[_0xfef9('0x4b')](handleError(_0x12f547,null));};
\ No newline at end of file
index 9156d2d..b0e1841 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81f6=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer'];(function(_0x1e7be4,_0x18ed8a){var _0x3bc4ff=function(_0x2b5a94){while(--_0x2b5a94){_0x1e7be4['push'](_0x1e7be4['shift']());}};_0x3bc4ff(++_0x18ed8a);}(_0x81f6,0x107));var _0x681f=function(_0x299ecc,_0x4a5760){_0x299ecc=_0x299ecc-0x0;var _0x5c6ab=_0x81f6[_0x299ecc];return _0x5c6ab;};'use strict';var _=require(_0x681f('0x0'));var util=require('util');var logger=require(_0x681f('0x1'))('api');var moment=require(_0x681f('0x2'));var BPromise=require(_0x681f('0x3'));var rp=require(_0x681f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x681f('0x5'));var config=require(_0x681f('0x6'));var attributes=require(_0x681f('0x7'));module['exports']=function(_0x8ae55a,_0x51edd9){return _0x8ae55a[_0x681f('0x8')](_0x681f('0x9'),attributes,{'tableName':_0x681f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x681f('0xb'),'collate':_0x681f('0xc')});};
\ No newline at end of file
+var _0xbf2b=['define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports'];(function(_0x20ac07,_0x55002e){var _0x25d350=function(_0x51910c){while(--_0x51910c){_0x20ac07['push'](_0x20ac07['shift']());}};_0x25d350(++_0x55002e);}(_0xbf2b,0x12f));var _0xbbf2=function(_0xccd88b,_0x18f330){_0xccd88b=_0xccd88b-0x0;var _0x1ea528=_0xbf2b[_0xccd88b];return _0x1ea528;};'use strict';var _=require(_0xbbf2('0x0'));var util=require(_0xbbf2('0x1'));var logger=require(_0xbbf2('0x2'))(_0xbbf2('0x3'));var moment=require(_0xbbf2('0x4'));var BPromise=require(_0xbbf2('0x5'));var rp=require(_0xbbf2('0x6'));var fs=require('fs');var path=require(_0xbbf2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cannedAnswer.attributes');module[_0xbbf2('0x8')]=function(_0x3c887f,_0x420df3){return _0x3c887f[_0xbbf2('0x9')](_0xbbf2('0xa'),attributes,{'tableName':_0xbbf2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbbf2('0xc')});};
\ No newline at end of file
index bc9dcab..cb45144 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x53f248,_0x3682ed){var _0x13332c=function(_0xd6a851){while(--_0xd6a851){_0x53f248['push'](_0x53f248['shift']());}};_0x13332c(++_0x3682ed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x286977,_0x4ffc3b){var _0x48da52=function(_0x3bf836){while(--_0x3bf836){_0x286977['push'](_0x286977['shift']());}};_0x48da52(++_0x4ffc3b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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 ed61248..baa9c9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1af2=['create','put','update','delete','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post'];(function(_0x1a30ea,_0x22bf39){var _0x36b8f2=function(_0x32fbbb){while(--_0x32fbbb){_0x1a30ea['push'](_0x1a30ea['shift']());}};_0x36b8f2(++_0x22bf39);}(_0x1af2,0x7c));var _0x21af=function(_0x45b4d9,_0x6228b9){_0x45b4d9=_0x45b4d9-0x0;var _0x54ae0e=_0x1af2[_0x45b4d9];return _0x54ae0e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x21af('0x0'));var timeout=require(_0x21af('0x1'));var express=require('express');var router=express[_0x21af('0x2')]();var fs_extra=require(_0x21af('0x3'));var auth=require(_0x21af('0x4'));var interaction=require(_0x21af('0x5'));var config=require('../../config/environment');var controller=require(_0x21af('0x6'));router[_0x21af('0x7')]('/',auth[_0x21af('0x8')](),controller[_0x21af('0x9')]);router[_0x21af('0x7')](_0x21af('0xa'),auth[_0x21af('0x8')](),controller['show']);router[_0x21af('0xb')]('/',auth[_0x21af('0x8')](),controller[_0x21af('0xc')]);router[_0x21af('0xd')]('/:id',auth[_0x21af('0x8')](),controller[_0x21af('0xe')]);router[_0x21af('0xf')](_0x21af('0xa'),auth[_0x21af('0x8')](),controller['destroy']);module[_0x21af('0x10')]=router;
\ No newline at end of file
+var _0xeb12=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x122b35,_0x140c1){var _0xc54eb4=function(_0x2a0fdf){while(--_0x2a0fdf){_0x122b35['push'](_0x122b35['shift']());}};_0xc54eb4(++_0x140c1);}(_0xeb12,0x1f2));var _0x2eb1=function(_0x565569,_0x5c0375){_0x565569=_0x565569-0x0;var _0x1ac5da=_0xeb12[_0x565569];return _0x1ac5da;};'use strict';var multer=require(_0x2eb1('0x0'));var util=require(_0x2eb1('0x1'));var path=require('path');var timeout=require(_0x2eb1('0x2'));var express=require(_0x2eb1('0x3'));var router=express['Router']();var fs_extra=require(_0x2eb1('0x4'));var auth=require(_0x2eb1('0x5'));var interaction=require(_0x2eb1('0x6'));var config=require(_0x2eb1('0x7'));var controller=require(_0x2eb1('0x8'));router[_0x2eb1('0x9')]('/',auth[_0x2eb1('0xa')](),controller[_0x2eb1('0xb')]);router[_0x2eb1('0x9')](_0x2eb1('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x2eb1('0xa')](),controller[_0x2eb1('0xd')]);router[_0x2eb1('0xe')](_0x2eb1('0xc'),auth['isAuthenticated'](),controller[_0x2eb1('0xf')]);router['delete'](_0x2eb1('0xc'),auth[_0x2eb1('0xa')](),controller[_0x2eb1('0x10')]);module[_0x2eb1('0x11')]=router;
\ No newline at end of file
index 048601d..60fcb46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3657=['STRING','INTEGER','sequelize','exports','DATE'];(function(_0x3f8743,_0x33973f){var _0x1f844c=function(_0x568841){while(--_0x568841){_0x3f8743['push'](_0x3f8743['shift']());}};_0x1f844c(++_0x33973f);}(_0x3657,0x183));var _0x7365=function(_0x5397f4,_0x3f2c05){_0x5397f4=_0x5397f4-0x0;var _0x4cba07=_0x3657[_0x5397f4];return _0x4cba07;};'use strict';var Sequelize=require(_0x7365('0x0'));module[_0x7365('0x1')]={'calldate':{'type':Sequelize[_0x7365('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x7365('0x3')]},'src':{'type':Sequelize[_0x7365('0x3')]},'dst':{'type':Sequelize[_0x7365('0x3')]},'dcontext':{'type':Sequelize[_0x7365('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x7365('0x3')]},'lastapp':{'type':Sequelize[_0x7365('0x3')]},'lastdata':{'type':Sequelize[_0x7365('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x7365('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x7365('0x3')]},'amaflags':{'type':Sequelize[_0x7365('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x7365('0x3')]},'uniqueid':{'type':Sequelize[_0x7365('0x3')]},'linkedid':{'type':Sequelize[_0x7365('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x7365('0x3')]},'type':{'type':Sequelize[_0x7365('0x3')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc423=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x94b9d4,_0x1d58d8){var _0x4dfe17=function(_0x3f9aa4){while(--_0x3f9aa4){_0x94b9d4['push'](_0x94b9d4['shift']());}};_0x4dfe17(++_0x1d58d8);}(_0xc423,0x159));var _0x3c42=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc423[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x3c42('0x0'));module[_0x3c42('0x1')]={'calldate':{'type':Sequelize[_0x3c42('0x2')],'allowNull':![],'defaultValue':_0x3c42('0x3')},'clid':{'type':Sequelize[_0x3c42('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x3c42('0x4')]},'dcontext':{'type':Sequelize[_0x3c42('0x4')]},'channel':{'type':Sequelize[_0x3c42('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x3c42('0x4')]},'lastdata':{'type':Sequelize[_0x3c42('0x4')]},'duration':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x3c42('0x4')]},'amaflags':{'type':Sequelize[_0x3c42('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x3c42('0x4')]},'userfield':{'type':Sequelize[_0x3c42('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3c42('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x3c42('0x4')]},'tag':{'type':Sequelize[_0x3c42('0x4')]}};
\ No newline at end of file
index 5b28a42..47e724a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5162=['undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','intersection','find','create','body','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5162,0x103));var _0x2516=function(_0x501695,_0xda9d02){_0x501695=_0x501695-0x0;var _0xca4b6c=_0x5162[_0x501695];return _0xca4b6c;};'use strict';var emlformat=require(_0x2516('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2516('0x1'));var BPromise=require(_0x2516('0x2'));var Mustache=require(_0x2516('0x3'));var util=require(_0x2516('0x4'));var path=require(_0x2516('0x5'));var sox=require(_0x2516('0x6'));var csv=require(_0x2516('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2516('0x8'));var crypto=require(_0x2516('0x9'));var jsforce=require(_0x2516('0xa'));var deskjs=require(_0x2516('0xb'));var toCsv=require(_0x2516('0x7'));var querystring=require(_0x2516('0xc'));var Papa=require(_0x2516('0xd'));var Redis=require('ioredis');var authService=require(_0x2516('0xe'));var qs=require(_0x2516('0xf'));var as=require(_0x2516('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x2516('0x11'));var licenseUtil=require(_0x2516('0x12'));var db=require(_0x2516('0x13'))['db'];function respondWithStatusCode(_0x3ef6ff,_0x56c69c){_0x56c69c=_0x56c69c||0xcc;return function(_0x33496b){if(_0x33496b){return _0x3ef6ff[_0x2516('0x14')](_0x56c69c);}return _0x3ef6ff[_0x2516('0x15')](_0x56c69c)[_0x2516('0x16')]();};}function respondWithResult(_0x42c771,_0x558d20){_0x558d20=_0x558d20||0xc8;return function(_0x3e5e0f){if(_0x3e5e0f){return _0x42c771[_0x2516('0x15')](_0x558d20)[_0x2516('0x17')](_0x3e5e0f);}};}function respondWithFilteredResult(_0x181a28,_0x2637e8){return function(_0x2ec31f){if(_0x2ec31f){var _0x19aacb=typeof _0x2637e8[_0x2516('0x18')]===_0x2516('0x19')&&typeof _0x2637e8['limit']===_0x2516('0x19');var _0x1ced29=_0x2ec31f[_0x2516('0x1a')];var _0x564d05=_0x19aacb?0x0:_0x2637e8[_0x2516('0x18')];var _0x5e96c7=_0x19aacb?_0x2ec31f['count']:_0x2637e8[_0x2516('0x18')]+_0x2637e8[_0x2516('0x1b')];var _0x151168;if(_0x5e96c7>=_0x1ced29){_0x5e96c7=_0x1ced29;_0x151168=0xc8;}else{_0x151168=0xce;}_0x181a28[_0x2516('0x15')](_0x151168);return _0x181a28[_0x2516('0x1c')](_0x2516('0x1d'),_0x564d05+'-'+_0x5e96c7+'/'+_0x1ced29)[_0x2516('0x17')](_0x2ec31f);}return null;};}function patchUpdates(_0x113616){return function(_0x248c5a){try{jsonpatch[_0x2516('0x1e')](_0x248c5a,_0x113616,!![]);}catch(_0x39ba5b){return BPromise[_0x2516('0x1f')](_0x39ba5b);}return _0x248c5a[_0x2516('0x20')]();};}function saveUpdates(_0x4fb7d9,_0x559a3e){return function(_0x12db4d){if(_0x12db4d){return _0x12db4d[_0x2516('0x21')](_0x4fb7d9)[_0x2516('0x22')](function(_0x2d5b1b){return _0x2d5b1b;});}return null;};}function removeEntity(_0x3ffb6d,_0x32de7a){return function(_0x3d906d){if(_0x3d906d){return _0x3d906d[_0x2516('0x23')]()['then'](function(){_0x3ffb6d[_0x2516('0x15')](0xcc)[_0x2516('0x16')]();});}};}function handleEntityNotFound(_0x774b60,_0x434d54){return function(_0x47f4fb){if(!_0x47f4fb){_0x774b60[_0x2516('0x14')](0x194);}return _0x47f4fb;};}function handleError(_0x30eeb9,_0x1f722c){_0x1f722c=_0x1f722c||0x1f4;return function(_0x3d728a){logger[_0x2516('0x24')](_0x3d728a['stack']);if(_0x3d728a[_0x2516('0x25')]){delete _0x3d728a[_0x2516('0x25')];}_0x30eeb9[_0x2516('0x15')](_0x1f722c)[_0x2516('0x26')](_0x3d728a);};}exports[_0x2516('0x27')]=function(_0x285e67,_0x556f01){var _0x136893={},_0x20dc9f={},_0x493a3e={'count':0x0,'rows':[]};var _0x19d90d=_[_0x2516('0x28')](db[_0x2516('0x29')][_0x2516('0x2a')],function(_0x539704){return{'name':_0x539704[_0x2516('0x2b')],'type':_0x539704[_0x2516('0x2c')][_0x2516('0x2d')]};});_0x20dc9f[_0x2516('0x2e')]=_[_0x2516('0x28')](_0x19d90d,_0x2516('0x25'));_0x20dc9f[_0x2516('0x2f')]=_[_0x2516('0x30')](_0x285e67[_0x2516('0x2f')]);_0x20dc9f[_0x2516('0x31')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],_0x20dc9f['query']);_0x136893[_0x2516('0x32')]=_['intersection'](_0x20dc9f[_0x2516('0x2e')],qs['fields'](_0x285e67[_0x2516('0x2f')][_0x2516('0x33')]));_0x136893[_0x2516('0x32')]=_0x136893[_0x2516('0x32')][_0x2516('0x34')]?_0x136893[_0x2516('0x32')]:_0x20dc9f[_0x2516('0x2e')];if(!_0x285e67[_0x2516('0x2f')][_0x2516('0x35')]('nolimit')){_0x136893[_0x2516('0x1b')]=qs[_0x2516('0x1b')](_0x285e67[_0x2516('0x2f')][_0x2516('0x1b')]);_0x136893['offset']=qs['offset'](_0x285e67[_0x2516('0x2f')][_0x2516('0x18')]);}_0x136893[_0x2516('0x36')]=qs[_0x2516('0x37')](_0x285e67[_0x2516('0x2f')][_0x2516('0x37')]);_0x136893[_0x2516('0x38')]=qs[_0x2516('0x31')](_[_0x2516('0x39')](_0x285e67[_0x2516('0x2f')],_0x20dc9f['filters']),_0x19d90d);if(_0x285e67['query'][_0x2516('0x3a')]){_0x136893[_0x2516('0x38')]=_['merge'](_0x136893['where'],{'$or':_[_0x2516('0x28')](_0x19d90d,function(_0x3b310f){if(_0x3b310f['type']!==_0x2516('0x3b')){var _0x52ef6b={};_0x52ef6b[_0x3b310f[_0x2516('0x25')]]={'$like':'%'+_0x285e67[_0x2516('0x2f')]['filter']+'%'};return _0x52ef6b;}})});}_0x136893=_[_0x2516('0x3c')]({},_0x136893,_0x285e67[_0x2516('0x3d')]);var _0x155cf7={'where':_0x136893[_0x2516('0x38')]};return db[_0x2516('0x29')][_0x2516('0x1a')](_0x155cf7)[_0x2516('0x22')](function(_0x2371a8){_0x493a3e[_0x2516('0x1a')]=_0x2371a8;if(_0x285e67[_0x2516('0x2f')][_0x2516('0x3e')]){_0x136893[_0x2516('0x3f')]=[{'all':!![]}];}return db[_0x2516('0x29')]['findAll'](_0x136893);})[_0x2516('0x22')](function(_0x1bc0e){_0x493a3e['rows']=_0x1bc0e;return _0x493a3e;})[_0x2516('0x22')](respondWithFilteredResult(_0x556f01,_0x136893))[_0x2516('0x40')](handleError(_0x556f01,null));};exports[_0x2516('0x41')]=function(_0x1afefb,_0x421c58){var _0x582cb6={'raw':!![],'where':{'id':_0x1afefb[_0x2516('0x42')]['id']}},_0x1a8d2d={};_0x1a8d2d[_0x2516('0x2e')]=_[_0x2516('0x30')](db[_0x2516('0x29')][_0x2516('0x2a')]);_0x1a8d2d['query']=_[_0x2516('0x30')](_0x1afefb[_0x2516('0x2f')]);_0x1a8d2d[_0x2516('0x31')]=_[_0x2516('0x43')](_0x1a8d2d[_0x2516('0x2e')],_0x1a8d2d[_0x2516('0x2f')]);_0x582cb6[_0x2516('0x32')]=_['intersection'](_0x1a8d2d[_0x2516('0x2e')],qs['fields'](_0x1afefb[_0x2516('0x2f')]['fields']));_0x582cb6[_0x2516('0x32')]=_0x582cb6[_0x2516('0x32')][_0x2516('0x34')]?_0x582cb6['attributes']:_0x1a8d2d['model'];if(_0x1afefb[_0x2516('0x2f')][_0x2516('0x3e')]){_0x582cb6['include']=[{'all':!![]}];}_0x582cb6=_['merge']({},_0x582cb6,_0x1afefb[_0x2516('0x3d')]);return db[_0x2516('0x29')][_0x2516('0x44')](_0x582cb6)['then'](handleEntityNotFound(_0x421c58,null))[_0x2516('0x22')](respondWithResult(_0x421c58,null))['catch'](handleError(_0x421c58,null));};exports[_0x2516('0x45')]=function(_0x39fd32,_0x318128){return db[_0x2516('0x29')]['create'](_0x39fd32[_0x2516('0x46')],{})[_0x2516('0x22')](respondWithResult(_0x318128,0xc9))[_0x2516('0x40')](handleError(_0x318128,null));};exports[_0x2516('0x21')]=function(_0x43874c,_0x482883){if(_0x43874c[_0x2516('0x46')]['id']){delete _0x43874c[_0x2516('0x46')]['id'];}return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x43874c['params']['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x482883,null))[_0x2516('0x22')](saveUpdates(_0x43874c[_0x2516('0x46')],null))[_0x2516('0x22')](respondWithResult(_0x482883,null))[_0x2516('0x40')](handleError(_0x482883,null));};exports['destroy']=function(_0x1c4be3,_0x1aa854){return db[_0x2516('0x29')][_0x2516('0x44')]({'where':{'id':_0x1c4be3[_0x2516('0x42')]['id']}})[_0x2516('0x22')](handleEntityNotFound(_0x1aa854,null))['then'](removeEntity(_0x1aa854,null))['catch'](handleError(_0x1aa854,null));};exports['describe']=function(_0x323590,_0x4f7eb4){return db['Cdr']['describe']()[_0x2516('0x22')](respondWithResult(_0x4f7eb4,null))[_0x2516('0x40')](handleError(_0x4f7eb4,null));};
\ No newline at end of file
+var _0xae30=['offset','apply','reject','end','sendStatus','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','findAll','then','rows','catch','show','params','includeAll','include','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','json','undefined','limit','count'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0xae30,0x10a));var _0x0ae3=function(_0x239786,_0x471f27){_0x239786=_0x239786-0x0;var _0x3f15e2=_0xae30[_0x239786];return _0x3f15e2;};'use strict';var emlformat=require(_0x0ae3('0x0'));var rimraf=require(_0x0ae3('0x1'));var zipdir=require(_0x0ae3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ae3('0x3'));var moment=require(_0x0ae3('0x4'));var BPromise=require(_0x0ae3('0x5'));var Mustache=require(_0x0ae3('0x6'));var util=require('util');var path=require(_0x0ae3('0x7'));var sox=require(_0x0ae3('0x8'));var csv=require(_0x0ae3('0x9'));var ejs=require(_0x0ae3('0xa'));var fs=require('fs');var fs_extra=require(_0x0ae3('0xb'));var _=require(_0x0ae3('0xc'));var squel=require(_0x0ae3('0xd'));var crypto=require(_0x0ae3('0xe'));var jsforce=require(_0x0ae3('0xf'));var deskjs=require(_0x0ae3('0x10'));var toCsv=require(_0x0ae3('0x9'));var querystring=require(_0x0ae3('0x11'));var Papa=require(_0x0ae3('0x12'));var Redis=require('ioredis');var authService=require(_0x0ae3('0x13'));var qs=require(_0x0ae3('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ae3('0x15'))(_0x0ae3('0x16'));var utils=require(_0x0ae3('0x17'));var config=require(_0x0ae3('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x245ac0,_0x45242d){_0x45242d=_0x45242d||0xcc;return function(_0x50cee6){if(_0x50cee6){return _0x245ac0['sendStatus'](_0x45242d);}return _0x245ac0[_0x0ae3('0x19')](_0x45242d)['end']();};}function respondWithResult(_0x1b1e46,_0x450000){_0x450000=_0x450000||0xc8;return function(_0x1a6c69){if(_0x1a6c69){return _0x1b1e46[_0x0ae3('0x19')](_0x450000)[_0x0ae3('0x1a')](_0x1a6c69);}};}function respondWithFilteredResult(_0x1600bc,_0x28b547){return function(_0x5af348){if(_0x5af348){var _0x17f280=typeof _0x28b547['offset']===_0x0ae3('0x1b')&&typeof _0x28b547[_0x0ae3('0x1c')]===_0x0ae3('0x1b');var _0x59d0de=_0x5af348[_0x0ae3('0x1d')];var _0x40edc6=_0x17f280?0x0:_0x28b547[_0x0ae3('0x1e')];var _0x1bf406=_0x17f280?_0x5af348[_0x0ae3('0x1d')]:_0x28b547['offset']+_0x28b547[_0x0ae3('0x1c')];var _0x4b8949;if(_0x1bf406>=_0x59d0de){_0x1bf406=_0x59d0de;_0x4b8949=0xc8;}else{_0x4b8949=0xce;}_0x1600bc['status'](_0x4b8949);return _0x1600bc['set']('Content-Range',_0x40edc6+'-'+_0x1bf406+'/'+_0x59d0de)['json'](_0x5af348);}return null;};}function patchUpdates(_0x4e8135){return function(_0x4d1385){try{jsonpatch[_0x0ae3('0x1f')](_0x4d1385,_0x4e8135,!![]);}catch(_0x1fd946){return BPromise[_0x0ae3('0x20')](_0x1fd946);}return _0x4d1385['save']();};}function saveUpdates(_0x1cdd85,_0x5ecc45){return function(_0xfcf4a8){if(_0xfcf4a8){return _0xfcf4a8['update'](_0x1cdd85)['then'](function(_0x5ab18d){return _0x5ab18d;});}return null;};}function removeEntity(_0x281adf,_0x3b49a0){return function(_0x51e7d1){if(_0x51e7d1){return _0x51e7d1['destroy']()['then'](function(){_0x281adf[_0x0ae3('0x19')](0xcc)[_0x0ae3('0x21')]();});}};}function handleEntityNotFound(_0x5a76e5,_0x36ce4e){return function(_0x1613c3){if(!_0x1613c3){_0x5a76e5[_0x0ae3('0x22')](0x194);}return _0x1613c3;};}function handleError(_0x5b0117,_0x2f8134){_0x2f8134=_0x2f8134||0x1f4;return function(_0x1f9cde){logger[_0x0ae3('0x23')](_0x1f9cde['stack']);if(_0x1f9cde[_0x0ae3('0x24')]){delete _0x1f9cde[_0x0ae3('0x24')];}_0x5b0117[_0x0ae3('0x19')](_0x2f8134)['send'](_0x1f9cde);};}exports[_0x0ae3('0x25')]=function(_0x247623,_0xf0e310){var _0x152876={},_0x1f8f61={},_0x10a7bd={'count':0x0,'rows':[]};var _0x5e8979=_[_0x0ae3('0x26')](db[_0x0ae3('0x27')][_0x0ae3('0x28')],function(_0x4032f4){return{'name':_0x4032f4[_0x0ae3('0x29')],'type':_0x4032f4[_0x0ae3('0x2a')][_0x0ae3('0x2b')]};});_0x1f8f61[_0x0ae3('0x2c')]=_['map'](_0x5e8979,_0x0ae3('0x24'));_0x1f8f61[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x247623[_0x0ae3('0x2d')]);_0x1f8f61['filters']=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],_0x1f8f61[_0x0ae3('0x2d')]);_0x152876[_0x0ae3('0x30')]=_[_0x0ae3('0x2f')](_0x1f8f61[_0x0ae3('0x2c')],qs['fields'](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x31')]));_0x152876[_0x0ae3('0x30')]=_0x152876[_0x0ae3('0x30')][_0x0ae3('0x32')]?_0x152876[_0x0ae3('0x30')]:_0x1f8f61[_0x0ae3('0x2c')];if(!_0x247623['query']['hasOwnProperty'](_0x0ae3('0x33'))){_0x152876[_0x0ae3('0x1c')]=qs[_0x0ae3('0x1c')](_0x247623['query']['limit']);_0x152876[_0x0ae3('0x1e')]=qs[_0x0ae3('0x1e')](_0x247623[_0x0ae3('0x2d')][_0x0ae3('0x1e')]);}_0x152876[_0x0ae3('0x34')]=qs[_0x0ae3('0x35')](_0x247623[_0x0ae3('0x2d')]['sort']);_0x152876[_0x0ae3('0x36')]=qs[_0x0ae3('0x37')](_[_0x0ae3('0x38')](_0x247623['query'],_0x1f8f61['filters']),_0x5e8979);if(_0x247623['query'][_0x0ae3('0x39')]){_0x152876[_0x0ae3('0x36')]=_['merge'](_0x152876[_0x0ae3('0x36')],{'$or':_[_0x0ae3('0x26')](_0x5e8979,function(_0x3ee862){if(_0x3ee862['type']!==_0x0ae3('0x3a')){var _0x5dd8d7={};_0x5dd8d7[_0x3ee862[_0x0ae3('0x24')]]={'$like':'%'+_0x247623[_0x0ae3('0x2d')]['filter']+'%'};return _0x5dd8d7;}})});}_0x152876=_[_0x0ae3('0x3b')]({},_0x152876,_0x247623[_0x0ae3('0x3c')]);var _0xfa6c7f={'where':_0x152876[_0x0ae3('0x36')]};return db[_0x0ae3('0x27')]['count'](_0xfa6c7f)['then'](function(_0x2e95e5){_0x10a7bd[_0x0ae3('0x1d')]=_0x2e95e5;if(_0x247623['query']['includeAll']){_0x152876['include']=[{'all':!![]}];}return db['Cdr'][_0x0ae3('0x3d')](_0x152876);})[_0x0ae3('0x3e')](function(_0x325153){_0x10a7bd[_0x0ae3('0x3f')]=_0x325153;return _0x10a7bd;})[_0x0ae3('0x3e')](respondWithFilteredResult(_0xf0e310,_0x152876))[_0x0ae3('0x40')](handleError(_0xf0e310,null));};exports[_0x0ae3('0x41')]=function(_0x3166af,_0x2cfc16){var _0x1230c9={'raw':!![],'where':{'id':_0x3166af[_0x0ae3('0x42')]['id']}},_0x5a0e74={};_0x5a0e74[_0x0ae3('0x2c')]=_['keys'](db[_0x0ae3('0x27')][_0x0ae3('0x28')]);_0x5a0e74[_0x0ae3('0x2d')]=_[_0x0ae3('0x2e')](_0x3166af[_0x0ae3('0x2d')]);_0x5a0e74['filters']=_[_0x0ae3('0x2f')](_0x5a0e74[_0x0ae3('0x2c')],_0x5a0e74[_0x0ae3('0x2d')]);_0x1230c9[_0x0ae3('0x30')]=_['intersection'](_0x5a0e74[_0x0ae3('0x2c')],qs[_0x0ae3('0x31')](_0x3166af['query'][_0x0ae3('0x31')]));_0x1230c9[_0x0ae3('0x30')]=_0x1230c9['attributes']['length']?_0x1230c9[_0x0ae3('0x30')]:_0x5a0e74[_0x0ae3('0x2c')];if(_0x3166af[_0x0ae3('0x2d')][_0x0ae3('0x43')]){_0x1230c9[_0x0ae3('0x44')]=[{'all':!![]}];}_0x1230c9=_['merge']({},_0x1230c9,_0x3166af['options']);return db[_0x0ae3('0x27')]['find'](_0x1230c9)[_0x0ae3('0x3e')](handleEntityNotFound(_0x2cfc16,null))[_0x0ae3('0x3e')](respondWithResult(_0x2cfc16,null))['catch'](handleError(_0x2cfc16,null));};exports[_0x0ae3('0x45')]=function(_0x3e4bfb,_0x53e018){return db[_0x0ae3('0x27')][_0x0ae3('0x45')](_0x3e4bfb[_0x0ae3('0x46')],{})[_0x0ae3('0x3e')](respondWithResult(_0x53e018,0xc9))[_0x0ae3('0x40')](handleError(_0x53e018,null));};exports['update']=function(_0x3ad6b3,_0x53393b){if(_0x3ad6b3[_0x0ae3('0x46')]['id']){delete _0x3ad6b3[_0x0ae3('0x46')]['id'];}return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x3ad6b3[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x53393b,null))[_0x0ae3('0x3e')](saveUpdates(_0x3ad6b3[_0x0ae3('0x46')],null))['then'](respondWithResult(_0x53393b,null))[_0x0ae3('0x40')](handleError(_0x53393b,null));};exports[_0x0ae3('0x48')]=function(_0x29479f,_0x12ea03){return db[_0x0ae3('0x27')][_0x0ae3('0x47')]({'where':{'id':_0x29479f[_0x0ae3('0x42')]['id']}})[_0x0ae3('0x3e')](handleEntityNotFound(_0x12ea03,null))[_0x0ae3('0x3e')](removeEntity(_0x12ea03,null))[_0x0ae3('0x40')](handleError(_0x12ea03,null));};exports[_0x0ae3('0x49')]=function(_0x572166,_0x256dc5){return db['Cdr'][_0x0ae3('0x49')]()[_0x0ae3('0x3e')](respondWithResult(_0x256dc5,null))[_0x0ae3('0x40')](handleError(_0x256dc5,null));};
\ No newline at end of file
index 665b58b..283d202 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x16dd42,_0x39ba8a){var _0x9a6b31=function(_0x25ebc1){while(--_0x25ebc1){_0x16dd42['push'](_0x16dd42['shift']());}};_0x9a6b31(++_0x39ba8a);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x3b59c4,_0x3e1816){var _0x497ad2=function(_0x3288f8){while(--_0x3288f8){_0x3b59c4['push'](_0x3b59c4['shift']());}};_0x497ad2(++_0x3e1816);}(_0x7a54,0x106));var _0x47a5=function(_0x323229,_0xff09){_0x323229=_0x323229-0x0;var _0x488de3=_0x7a54[_0x323229];return _0x488de3;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
index 48eeef5..512889d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bd5=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Cdr,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc'];(function(_0x20a86a,_0x41e382){var _0x16354e=function(_0x5e32b8){while(--_0x5e32b8){_0x20a86a['push'](_0x20a86a['shift']());}};_0x16354e(++_0x41e382);}(_0x1bd5,0x7e));var _0x51bd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1bd5[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x51bd('0x0'));var moment=require(_0x51bd('0x1'));var BPromise=require(_0x51bd('0x2'));var rs=require(_0x51bd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x51bd('0x5'));var config=require(_0x51bd('0x6'));var jayson=require(_0x51bd('0x7'));var client=jayson[_0x51bd('0x8')][_0x51bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x543b3d,_0x34af3e,_0x57a6e1){return new BPromise(function(_0x5e372f,_0x356700){return client[_0x51bd('0xa')](_0x543b3d,_0x57a6e1)[_0x51bd('0xb')](function(_0x57279e){logger[_0x51bd('0xc')]('Cdr,\x20%s,\x20%s',_0x34af3e,_0x51bd('0xd'));logger[_0x51bd('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x34af3e,'request\x20sent',JSON[_0x51bd('0xf')](_0x57279e));if(_0x57279e['error']){if(_0x57279e[_0x51bd('0x10')][_0x51bd('0x11')]===0x1f4){logger[_0x51bd('0x10')](_0x51bd('0x12'),_0x34af3e,_0x57279e[_0x51bd('0x10')][_0x51bd('0x13')]);return _0x356700(_0x57279e[_0x51bd('0x10')][_0x51bd('0x13')]);}logger[_0x51bd('0x10')](_0x51bd('0x12'),_0x34af3e,_0x57279e[_0x51bd('0x10')][_0x51bd('0x13')]);return _0x5e372f(_0x57279e[_0x51bd('0x10')][_0x51bd('0x13')]);}else{logger[_0x51bd('0xc')](_0x51bd('0x12'),_0x34af3e,_0x51bd('0xd'));_0x5e372f(_0x57279e[_0x51bd('0x14')][_0x51bd('0x13')]);}})[_0x51bd('0x15')](function(_0x1aaee4){logger[_0x51bd('0x10')](_0x51bd('0x12'),_0x34af3e,_0x1aaee4);_0x356700(_0x1aaee4);});});}
\ No newline at end of file
+var _0x77b7=['stringify','error','message','request\x20sent','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x77b7,0x180));var _0x777b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x77b7[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x777b('0x0'));var util=require(_0x777b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x777b('0x2'));var fs=require('fs');var Redis=require(_0x777b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x777b('0x4'));var logger=require(_0x777b('0x5'))(_0x777b('0x6'));var config=require('../../config/environment');var jayson=require(_0x777b('0x7'));var client=jayson[_0x777b('0x8')][_0x777b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe2ff9c,_0x549de1,_0x649df0){return new BPromise(function(_0x5595ff,_0x2f4c0f){return client[_0x777b('0xa')](_0xe2ff9c,_0x649df0)[_0x777b('0xb')](function(_0x5f3567){logger[_0x777b('0xc')](_0x777b('0xd'),_0x549de1,'request\x20sent');logger['debug'](_0x777b('0xe'),_0x549de1,'request\x20sent',JSON[_0x777b('0xf')](_0x5f3567));if(_0x5f3567[_0x777b('0x10')]){if(_0x5f3567['error']['code']===0x1f4){logger[_0x777b('0x10')](_0x777b('0xd'),_0x549de1,_0x5f3567[_0x777b('0x10')]['message']);return _0x2f4c0f(_0x5f3567[_0x777b('0x10')][_0x777b('0x11')]);}logger[_0x777b('0x10')]('Cdr,\x20%s,\x20%s',_0x549de1,_0x5f3567[_0x777b('0x10')][_0x777b('0x11')]);return _0x5595ff(_0x5f3567[_0x777b('0x10')][_0x777b('0x11')]);}else{logger[_0x777b('0xc')](_0x777b('0xd'),_0x549de1,_0x777b('0x12'));_0x5595ff(_0x5f3567[_0x777b('0x13')][_0x777b('0x11')]);}})[_0x777b('0x14')](function(_0x3e4a02){logger[_0x777b('0x10')](_0x777b('0xd'),_0x549de1,_0x3e4a02);_0x2f4c0f(_0x3e4a02);});});}
\ No newline at end of file
index 910dc27..67cde74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2a1892,_0x3ccd75){var _0x22e545=function(_0x1b5b78){while(--_0x1b5b78){_0x2a1892['push'](_0x2a1892['shift']());}};_0x22e545(++_0x3ccd75);}(_0xb10b,0x12a));var _0xbb10=function(_0x2b6124,_0x4d25f2){_0x2b6124=_0x2b6124-0x0;var _0x44c3f4=_0xb10b[_0x2b6124];return _0x44c3f4;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
index 45d48d9..fde4ae1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6202=['INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x4b7b9b,_0xa4aff9){var _0x3be710=function(_0x5b64fa){while(--_0x5b64fa){_0x4b7b9b['push'](_0x4b7b9b['shift']());}};_0x3be710(++_0xa4aff9);}(_0x6202,0x1bd));var _0x2620=function(_0x131585,_0x1abd33){_0x131585=_0x131585-0x0;var _0x1fcca2=_0x6202[_0x131585];return _0x1fcca2;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2620('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2620('0x1')},'appdata':{'type':Sequelize[_0x2620('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2620('0x3')],'defaultValue':_0x2620('0x4')}};
\ No newline at end of file
+var _0x251e=['sequelize','exports','INTEGER','noop','*,*,*,*'];(function(_0x1c86cf,_0xd758df){var _0x22c104=function(_0x330796){while(--_0x330796){_0x1c86cf['push'](_0x1c86cf['shift']());}};_0x22c104(++_0xd758df);}(_0x251e,0x195));var _0xe251=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x251e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe251('0x0'));module[_0xe251('0x1')]={'priority':{'type':Sequelize[_0xe251('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe251('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xe251('0x4')}};
\ No newline at end of file
index 74f7ef2..fb2489a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c2c=['params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','fields','length','includeAll','options','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','show'];(function(_0x3cb41d,_0x2d7f6d){var _0x4dc372=function(_0x2e7351){while(--_0x2e7351){_0x3cb41d['push'](_0x3cb41d['shift']());}};_0x4dc372(++_0x2d7f6d);}(_0x3c2c,0x160));var _0xc3c2=function(_0x36184e,_0x53281e){_0x36184e=_0x36184e-0x0;var _0xd317ab=_0x3c2c[_0x36184e];return _0xd317ab;};'use strict';var emlformat=require(_0xc3c2('0x0'));var rimraf=require(_0xc3c2('0x1'));var zipdir=require(_0xc3c2('0x2'));var jsonpatch=require(_0xc3c2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc3c2('0x4'));var Mustache=require(_0xc3c2('0x5'));var util=require(_0xc3c2('0x6'));var path=require(_0xc3c2('0x7'));var sox=require('sox');var csv=require(_0xc3c2('0x8'));var ejs=require(_0xc3c2('0x9'));var fs=require('fs');var fs_extra=require(_0xc3c2('0xa'));var _=require(_0xc3c2('0xb'));var squel=require(_0xc3c2('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c2('0x8'));var querystring=require(_0xc3c2('0xd'));var Papa=require('papaparse');var Redis=require(_0xc3c2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc3c2('0xf'));var hardwareService=require(_0xc3c2('0x10'));var logger=require(_0xc3c2('0x11'))('api');var utils=require(_0xc3c2('0x12'));var config=require(_0xc3c2('0x13'));var licenseUtil=require(_0xc3c2('0x14'));var db=require(_0xc3c2('0x15'))['db'];function respondWithStatusCode(_0x578ac4,_0x3920e7){_0x3920e7=_0x3920e7||0xcc;return function(_0x1befad){if(_0x1befad){return _0x578ac4['sendStatus'](_0x3920e7);}return _0x578ac4[_0xc3c2('0x16')](_0x3920e7)['end']();};}function respondWithResult(_0x25b091,_0x4d7d11){_0x4d7d11=_0x4d7d11||0xc8;return function(_0x154071){if(_0x154071){return _0x25b091['status'](_0x4d7d11)[_0xc3c2('0x17')](_0x154071);}};}function respondWithFilteredResult(_0xf5d9a,_0x56bc61){return function(_0x1c2987){if(_0x1c2987){var _0x36f10f=typeof _0x56bc61[_0xc3c2('0x18')]===_0xc3c2('0x19')&&typeof _0x56bc61[_0xc3c2('0x1a')]===_0xc3c2('0x19');var _0x57b7b3=_0x1c2987['count'];var _0x4c0f2d=_0x36f10f?0x0:_0x56bc61[_0xc3c2('0x18')];var _0x3e26e1=_0x36f10f?_0x1c2987[_0xc3c2('0x1b')]:_0x56bc61[_0xc3c2('0x18')]+_0x56bc61[_0xc3c2('0x1a')];var _0x5c9d2c;if(_0x3e26e1>=_0x57b7b3){_0x3e26e1=_0x57b7b3;_0x5c9d2c=0xc8;}else{_0x5c9d2c=0xce;}_0xf5d9a['status'](_0x5c9d2c);return _0xf5d9a[_0xc3c2('0x1c')](_0xc3c2('0x1d'),_0x4c0f2d+'-'+_0x3e26e1+'/'+_0x57b7b3)[_0xc3c2('0x17')](_0x1c2987);}return null;};}function patchUpdates(_0x5e925e){return function(_0x42feba){try{jsonpatch['apply'](_0x42feba,_0x5e925e,!![]);}catch(_0x2e9c78){return BPromise[_0xc3c2('0x1e')](_0x2e9c78);}return _0x42feba[_0xc3c2('0x1f')]();};}function saveUpdates(_0x57458a,_0x2ca609){return function(_0x340c75){if(_0x340c75){return _0x340c75[_0xc3c2('0x20')](_0x57458a)['then'](function(_0x3db978){return _0x3db978;});}return null;};}function removeEntity(_0x3287a3,_0x6ad7af){return function(_0x5d7789){if(_0x5d7789){return _0x5d7789[_0xc3c2('0x21')]()['then'](function(){_0x3287a3[_0xc3c2('0x16')](0xcc)[_0xc3c2('0x22')]();});}};}function handleEntityNotFound(_0x26aacc,_0x38d0b9){return function(_0x15f5f9){if(!_0x15f5f9){_0x26aacc[_0xc3c2('0x23')](0x194);}return _0x15f5f9;};}function handleError(_0x978056,_0x4b6504){_0x4b6504=_0x4b6504||0x1f4;return function(_0x48fa15){logger['error'](_0x48fa15[_0xc3c2('0x24')]);if(_0x48fa15[_0xc3c2('0x25')]){delete _0x48fa15[_0xc3c2('0x25')];}_0x978056['status'](_0x4b6504)[_0xc3c2('0x26')](_0x48fa15);};}exports[_0xc3c2('0x27')]=function(_0x2dc9ec,_0x2bc3b7){var _0x7686ac={'raw':!![],'where':{'id':_0x2dc9ec[_0xc3c2('0x28')]['id']}},_0x166f8e={};_0x166f8e[_0xc3c2('0x29')]=_['keys'](db[_0xc3c2('0x2a')][_0xc3c2('0x2b')]);_0x166f8e[_0xc3c2('0x2c')]=_[_0xc3c2('0x2d')](_0x2dc9ec[_0xc3c2('0x2c')]);_0x166f8e[_0xc3c2('0x2e')]=_['intersection'](_0x166f8e['model'],_0x166f8e[_0xc3c2('0x2c')]);_0x7686ac['attributes']=_[_0xc3c2('0x2f')](_0x166f8e[_0xc3c2('0x29')],qs[_0xc3c2('0x30')](_0x2dc9ec['query']['fields']));_0x7686ac['attributes']=_0x7686ac['attributes'][_0xc3c2('0x31')]?_0x7686ac['attributes']:_0x166f8e[_0xc3c2('0x29')];if(_0x2dc9ec['query'][_0xc3c2('0x32')]){_0x7686ac['include']=[{'all':!![]}];}_0x7686ac=_['merge']({},_0x7686ac,_0x2dc9ec[_0xc3c2('0x33')]);return db[_0xc3c2('0x2a')][_0xc3c2('0x34')](_0x7686ac)[_0xc3c2('0x35')](handleEntityNotFound(_0x2bc3b7,null))[_0xc3c2('0x35')](respondWithResult(_0x2bc3b7,null))[_0xc3c2('0x36')](handleError(_0x2bc3b7,null));};exports[_0xc3c2('0x20')]=function(_0x434430,_0x3ee2ee){if(_0x434430['body']['id']){delete _0x434430['body']['id'];}return db[_0xc3c2('0x2a')][_0xc3c2('0x34')]({'where':{'id':_0x434430[_0xc3c2('0x28')]['id']}})[_0xc3c2('0x35')](handleEntityNotFound(_0x3ee2ee,null))[_0xc3c2('0x35')](saveUpdates(_0x434430[_0xc3c2('0x37')],null))['then'](respondWithResult(_0x3ee2ee,null))[_0xc3c2('0x36')](handleError(_0x3ee2ee,null));};exports['destroy']=function(_0x2278fa,_0x227dfb){return db['ChatApplication'][_0xc3c2('0x34')]({'where':{'id':_0x2278fa[_0xc3c2('0x28')]['id']}})['then'](handleEntityNotFound(_0x227dfb,null))[_0xc3c2('0x35')](removeEntity(_0x227dfb,null))[_0xc3c2('0x36')](handleError(_0x227dfb,null));};
\ No newline at end of file
+var _0xc041=['../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','show','params','model','query','filters','intersection','attributes','length','includeAll','include','merge','ChatApplication','find','body','catch','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc041,0x1ea));var _0x1c04=function(_0xaf33a2,_0x3038e1){_0xaf33a2=_0xaf33a2-0x0;var _0x37d5a3=_0xc041[_0xaf33a2];return _0x37d5a3;};'use strict';var emlformat=require(_0x1c04('0x0'));var rimraf=require(_0x1c04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c04('0x2'));var rp=require('request-promise');var moment=require(_0x1c04('0x3'));var BPromise=require(_0x1c04('0x4'));var Mustache=require(_0x1c04('0x5'));var util=require(_0x1c04('0x6'));var path=require(_0x1c04('0x7'));var sox=require(_0x1c04('0x8'));var csv=require('to-csv');var ejs=require(_0x1c04('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1c04('0xa'));var crypto=require(_0x1c04('0xb'));var jsforce=require(_0x1c04('0xc'));var deskjs=require(_0x1c04('0xd'));var toCsv=require(_0x1c04('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1c04('0xf'));var authService=require(_0x1c04('0x10'));var qs=require(_0x1c04('0x11'));var as=require(_0x1c04('0x12'));var hardwareService=require(_0x1c04('0x13'));var logger=require(_0x1c04('0x14'))(_0x1c04('0x15'));var utils=require(_0x1c04('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1c04('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x178900,_0x167bd5){_0x167bd5=_0x167bd5||0xcc;return function(_0x48e69f){if(_0x48e69f){return _0x178900[_0x1c04('0x18')](_0x167bd5);}return _0x178900[_0x1c04('0x19')](_0x167bd5)[_0x1c04('0x1a')]();};}function respondWithResult(_0x199782,_0x3c7bb3){_0x3c7bb3=_0x3c7bb3||0xc8;return function(_0x30b019){if(_0x30b019){return _0x199782[_0x1c04('0x19')](_0x3c7bb3)['json'](_0x30b019);}};}function respondWithFilteredResult(_0x28d516,_0x2dbf09){return function(_0x408e4c){if(_0x408e4c){var _0x5a0ff4=typeof _0x2dbf09[_0x1c04('0x1b')]==='undefined'&&typeof _0x2dbf09[_0x1c04('0x1c')]===_0x1c04('0x1d');var _0x2ed73c=_0x408e4c[_0x1c04('0x1e')];var _0x2b3a8b=_0x5a0ff4?0x0:_0x2dbf09[_0x1c04('0x1b')];var _0x3e2bd9=_0x5a0ff4?_0x408e4c[_0x1c04('0x1e')]:_0x2dbf09['offset']+_0x2dbf09['limit'];var _0x51dad0;if(_0x3e2bd9>=_0x2ed73c){_0x3e2bd9=_0x2ed73c;_0x51dad0=0xc8;}else{_0x51dad0=0xce;}_0x28d516[_0x1c04('0x19')](_0x51dad0);return _0x28d516[_0x1c04('0x1f')](_0x1c04('0x20'),_0x2b3a8b+'-'+_0x3e2bd9+'/'+_0x2ed73c)[_0x1c04('0x21')](_0x408e4c);}return null;};}function patchUpdates(_0x1724a4){return function(_0x21c320){try{jsonpatch[_0x1c04('0x22')](_0x21c320,_0x1724a4,!![]);}catch(_0xf9255d){return BPromise[_0x1c04('0x23')](_0xf9255d);}return _0x21c320[_0x1c04('0x24')]();};}function saveUpdates(_0x290375,_0x460dd1){return function(_0x22a4cc){if(_0x22a4cc){return _0x22a4cc[_0x1c04('0x25')](_0x290375)['then'](function(_0x2ee6b2){return _0x2ee6b2;});}return null;};}function removeEntity(_0x5bb5bc,_0x247116){return function(_0x3c81b0){if(_0x3c81b0){return _0x3c81b0[_0x1c04('0x26')]()[_0x1c04('0x27')](function(){_0x5bb5bc[_0x1c04('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5101e2,_0x29293c){return function(_0x2c9f84){if(!_0x2c9f84){_0x5101e2[_0x1c04('0x18')](0x194);}return _0x2c9f84;};}function handleError(_0x43c4a8,_0x252fbe){_0x252fbe=_0x252fbe||0x1f4;return function(_0x1e2daa){logger[_0x1c04('0x28')](_0x1e2daa[_0x1c04('0x29')]);if(_0x1e2daa['name']){delete _0x1e2daa['name'];}_0x43c4a8[_0x1c04('0x19')](_0x252fbe)['send'](_0x1e2daa);};}exports[_0x1c04('0x2a')]=function(_0x228e4,_0x29d273){var _0x220cdc={'raw':!![],'where':{'id':_0x228e4[_0x1c04('0x2b')]['id']}},_0x3bf4fd={};_0x3bf4fd[_0x1c04('0x2c')]=_['keys'](db['ChatApplication']['rawAttributes']);_0x3bf4fd[_0x1c04('0x2d')]=_['keys'](_0x228e4[_0x1c04('0x2d')]);_0x3bf4fd[_0x1c04('0x2e')]=_[_0x1c04('0x2f')](_0x3bf4fd[_0x1c04('0x2c')],_0x3bf4fd[_0x1c04('0x2d')]);_0x220cdc[_0x1c04('0x30')]=_[_0x1c04('0x2f')](_0x3bf4fd[_0x1c04('0x2c')],qs['fields'](_0x228e4[_0x1c04('0x2d')]['fields']));_0x220cdc['attributes']=_0x220cdc['attributes'][_0x1c04('0x31')]?_0x220cdc[_0x1c04('0x30')]:_0x3bf4fd[_0x1c04('0x2c')];if(_0x228e4[_0x1c04('0x2d')][_0x1c04('0x32')]){_0x220cdc[_0x1c04('0x33')]=[{'all':!![]}];}_0x220cdc=_[_0x1c04('0x34')]({},_0x220cdc,_0x228e4['options']);return db[_0x1c04('0x35')][_0x1c04('0x36')](_0x220cdc)[_0x1c04('0x27')](handleEntityNotFound(_0x29d273,null))[_0x1c04('0x27')](respondWithResult(_0x29d273,null))['catch'](handleError(_0x29d273,null));};exports['update']=function(_0x1e5586,_0x236b7f){if(_0x1e5586[_0x1c04('0x37')]['id']){delete _0x1e5586[_0x1c04('0x37')]['id'];}return db[_0x1c04('0x35')]['find']({'where':{'id':_0x1e5586[_0x1c04('0x2b')]['id']}})[_0x1c04('0x27')](handleEntityNotFound(_0x236b7f,null))['then'](saveUpdates(_0x1e5586[_0x1c04('0x37')],null))[_0x1c04('0x27')](respondWithResult(_0x236b7f,null))[_0x1c04('0x38')](handleError(_0x236b7f,null));};exports[_0x1c04('0x26')]=function(_0x587b09,_0x220c64){return db['ChatApplication'][_0x1c04('0x36')]({'where':{'id':_0x587b09[_0x1c04('0x2b')]['id']}})[_0x1c04('0x27')](handleEntityNotFound(_0x220c64,null))[_0x1c04('0x27')](removeEntity(_0x220c64,null))[_0x1c04('0x38')](handleError(_0x220c64,null));};
\ No newline at end of file
index 5b0fad3..03e3f89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaba8=['moment','request-promise','path','rimraf','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xaba8,0x1af));var _0x8aba=function(_0x3632fa,_0x30c819){_0x3632fa=_0x3632fa-0x0;var _0x35c4cf=_0xaba8[_0x3632fa];return _0x35c4cf;};'use strict';var _=require(_0x8aba('0x0'));var util=require('util');var logger=require(_0x8aba('0x1'))(_0x8aba('0x2'));var moment=require(_0x8aba('0x3'));var BPromise=require('bluebird');var rp=require(_0x8aba('0x4'));var fs=require('fs');var path=require(_0x8aba('0x5'));var rimraf=require(_0x8aba('0x6'));var config=require('../../config/environment');var attributes=require(_0x8aba('0x7'));module[_0x8aba('0x8')]=function(_0x421cbf,_0x896c12){return _0x421cbf[_0x8aba('0x9')](_0x8aba('0xa'),attributes,{'tableName':_0x8aba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8aba('0xc'),'collate':_0x8aba('0xd')});};
\ No newline at end of file
+var _0x655d=['rimraf','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x655d,0x13b));var _0xd655=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x655d[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xd655('0x0'));var util=require(_0xd655('0x1'));var logger=require(_0xd655('0x2'))(_0xd655('0x3'));var moment=require(_0xd655('0x4'));var BPromise=require(_0xd655('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd655('0x6'));var rimraf=require(_0xd655('0x7'));var config=require('../../config/environment');var attributes=require(_0xd655('0x8'));module['exports']=function(_0x1a2ecb,_0x1c3f69){return _0x1a2ecb[_0xd655('0x9')](_0xd655('0xa'),attributes,{'tableName':_0xd655('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd655('0xc'),'collate':_0xd655('0xd')});};
\ No newline at end of file
index af46f81..5420fa0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x164d=['request','then','info','debug','ChatApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xea6c20,_0x5a0de8){var _0x458655=function(_0x4afe96){while(--_0x4afe96){_0xea6c20['push'](_0xea6c20['shift']());}};_0x458655(++_0x5a0de8);}(_0x164d,0x12a));var _0xd164=function(_0x284609,_0x386b54){_0x284609=_0x284609-0x0;var _0x55116b=_0x164d[_0x284609];return _0x55116b;};'use strict';var _=require(_0xd164('0x0'));var util=require('util');var moment=require(_0xd164('0x1'));var BPromise=require('bluebird');var rs=require(_0xd164('0x2'));var fs=require('fs');var Redis=require(_0xd164('0x3'));var db=require(_0xd164('0x4'))['db'];var utils=require(_0xd164('0x5'));var logger=require(_0xd164('0x6'))(_0xd164('0x7'));var config=require(_0xd164('0x8'));var jayson=require(_0xd164('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b204c,_0xf41798,_0x3e60a6){return new BPromise(function(_0x26b5db,_0x303a6f){return client[_0xd164('0xa')](_0x4b204c,_0x3e60a6)[_0xd164('0xb')](function(_0x5a93cc){logger[_0xd164('0xc')]('ChatApplication,\x20%s,\x20%s',_0xf41798,'request\x20sent');logger[_0xd164('0xd')](_0xd164('0xe'),_0xf41798,_0xd164('0xf'),JSON['stringify'](_0x5a93cc));if(_0x5a93cc[_0xd164('0x10')]){if(_0x5a93cc[_0xd164('0x10')][_0xd164('0x11')]===0x1f4){logger['error'](_0xd164('0x12'),_0xf41798,_0x5a93cc[_0xd164('0x10')][_0xd164('0x13')]);return _0x303a6f(_0x5a93cc[_0xd164('0x10')][_0xd164('0x13')]);}logger[_0xd164('0x10')](_0xd164('0x12'),_0xf41798,_0x5a93cc[_0xd164('0x10')]['message']);return _0x26b5db(_0x5a93cc[_0xd164('0x10')][_0xd164('0x13')]);}else{logger[_0xd164('0xc')](_0xd164('0x12'),_0xf41798,_0xd164('0xf'));_0x26b5db(_0x5a93cc[_0xd164('0x14')]['message']);}})[_0xd164('0x15')](function(_0x37cba5){logger[_0xd164('0x10')](_0xd164('0x12'),_0xf41798,_0x37cba5);_0x303a6f(_0x37cba5);});});}
\ No newline at end of file
+var _0x17e9=['../../config/utils','rpc','../../config/environment','jayson/promise','client','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x50045a,_0x1e1fb4){var _0x41eba7=function(_0x4c44fe){while(--_0x4c44fe){_0x50045a['push'](_0x50045a['shift']());}};_0x41eba7(++_0x1e1fb4);}(_0x17e9,0x1db));var _0x917e=function(_0x5ce4db,_0x313a2b){_0x5ce4db=_0x5ce4db-0x0;var _0x918b0a=_0x17e9[_0x5ce4db];return _0x918b0a;};'use strict';var _=require(_0x917e('0x0'));var util=require(_0x917e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x917e('0x2'));var fs=require('fs');var Redis=require(_0x917e('0x3'));var db=require(_0x917e('0x4'))['db'];var utils=require(_0x917e('0x5'));var logger=require('../../config/logger')(_0x917e('0x6'));var config=require(_0x917e('0x7'));var jayson=require(_0x917e('0x8'));var client=jayson[_0x917e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c7103,_0x311df1,_0x24c370){return new BPromise(function(_0x24f190,_0x34be88){return client['request'](_0x4c7103,_0x24c370)['then'](function(_0x383a07){logger['info'](_0x917e('0xa'),_0x311df1,_0x917e('0xb'));logger[_0x917e('0xc')](_0x917e('0xd'),_0x311df1,_0x917e('0xb'),JSON[_0x917e('0xe')](_0x383a07));if(_0x383a07[_0x917e('0xf')]){if(_0x383a07[_0x917e('0xf')][_0x917e('0x10')]===0x1f4){logger[_0x917e('0xf')](_0x917e('0xa'),_0x311df1,_0x383a07[_0x917e('0xf')][_0x917e('0x11')]);return _0x34be88(_0x383a07[_0x917e('0xf')]['message']);}logger[_0x917e('0xf')]('ChatApplication,\x20%s,\x20%s',_0x311df1,_0x383a07[_0x917e('0xf')]['message']);return _0x24f190(_0x383a07[_0x917e('0xf')][_0x917e('0x11')]);}else{logger[_0x917e('0x12')](_0x917e('0xa'),_0x311df1,'request\x20sent');_0x24f190(_0x383a07['result'][_0x917e('0x11')]);}})[_0x917e('0x13')](function(_0x327fb3){logger[_0x917e('0xf')](_0x917e('0xa'),_0x311df1,_0x327fb3);_0x34be88(_0x327fb3);});});}
\ No newline at end of file
index 0df145f..68aa577 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f2c=['isAuthenticated','show','put','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id'];(function(_0x5c76ec,_0x97b402){var _0x2e2a20=function(_0x3d637f){while(--_0x3d637f){_0x5c76ec['push'](_0x5c76ec['shift']());}};_0x2e2a20(++_0x97b402);}(_0x9f2c,0xd9));var _0xc9f2=function(_0xff5df6,_0x514e73){_0xff5df6=_0xff5df6-0x0;var _0x2634bb=_0x9f2c[_0xff5df6];return _0x2634bb;};'use strict';var multer=require('multer');var util=require(_0xc9f2('0x0'));var path=require(_0xc9f2('0x1'));var timeout=require('connect-timeout');var express=require(_0xc9f2('0x2'));var router=express['Router']();var fs_extra=require(_0xc9f2('0x3'));var auth=require(_0xc9f2('0x4'));var interaction=require(_0xc9f2('0x5'));var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xc9f2('0x6')](_0xc9f2('0x7'),auth[_0xc9f2('0x8')](),controller[_0xc9f2('0x9')]);router[_0xc9f2('0xa')](_0xc9f2('0x7'),auth[_0xc9f2('0x8')](),controller[_0xc9f2('0xb')]);router[_0xc9f2('0xc')]('/:id',auth[_0xc9f2('0x8')](),controller[_0xc9f2('0xd')]);module[_0xc9f2('0xe')]=router;
\ No newline at end of file
+var _0x1add=['put','/:id','destroy','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','show'];(function(_0x32acd1,_0x434e8a){var _0x446047=function(_0x17ce14){while(--_0x17ce14){_0x32acd1['push'](_0x32acd1['shift']());}};_0x446047(++_0x434e8a);}(_0x1add,0x14d));var _0xd1ad=function(_0x44174f,_0x5b0087){_0x44174f=_0x44174f-0x0;var _0x4f0d66=_0x1add[_0x44174f];return _0x4f0d66;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd1ad('0x0'));var timeout=require(_0xd1ad('0x1'));var express=require('express');var router=express[_0xd1ad('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd1ad('0x3'));var config=require(_0xd1ad('0x4'));var controller=require(_0xd1ad('0x5'));router[_0xd1ad('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xd1ad('0x7')]);router[_0xd1ad('0x8')](_0xd1ad('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xd1ad('0x9'),auth['isAuthenticated'](),controller[_0xd1ad('0xa')]);module['exports']=router;
\ No newline at end of file
index d63acb5..6e704d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1488=['BOOLEAN','sequelize','STRING'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x1488,0x88));var _0x8148=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x1488[_0x46361e];return _0x14e302;};'use strict';var Sequelize=require(_0x8148('0x0'));module['exports']={'name':{'type':Sequelize[_0x8148('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x8148('0x1')]},'write':{'type':Sequelize[_0x8148('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xce62=['exports','STRING','BOOLEAN','sequelize'];(function(_0x367f71,_0x539921){var _0x123610=function(_0x5b9a32){while(--_0x5b9a32){_0x367f71['push'](_0x367f71['shift']());}};_0x123610(++_0x539921);}(_0xce62,0x83));var _0x2ce6=function(_0xf081c9,_0x90f843){_0xf081c9=_0xf081c9-0x0;var _0x1e3b8f=_0xce62[_0xf081c9];return _0x1e3b8f;};'use strict';var Sequelize=require(_0x2ce6('0x0'));module[_0x2ce6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x2ce6('0x2')]},'write':{'type':Sequelize[_0x2ce6('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index bd10579..55a9886 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x404d=['eml-format','rimraf','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','name','send','ChatGroup','rawAttributes','fieldName','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','destroy','describe','getUnread','ChatInternalMessage','toInteger','addMembers','ids','getMembers','User','pick','removeMembers','addMessage','ChatGroupId','getMessages','findOne','order','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x404d,0xb4));var _0xd404=function(_0x3d7355,_0x47d074){_0x3d7355=_0x3d7355-0x0;var _0x33f055=_0x404d[_0x3d7355];return _0x33f055;};'use strict';var emlformat=require(_0xd404('0x0'));var rimraf=require(_0xd404('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd404('0x2'));var moment=require('moment');var BPromise=require(_0xd404('0x3'));var Mustache=require(_0xd404('0x4'));var util=require('util');var path=require(_0xd404('0x5'));var sox=require(_0xd404('0x6'));var csv=require('to-csv');var ejs=require(_0xd404('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd404('0x8'));var squel=require(_0xd404('0x9'));var crypto=require(_0xd404('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd404('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd404('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0xd404('0xd'));var hardwareService=require(_0xd404('0xe'));var logger=require(_0xd404('0xf'))(_0xd404('0x10'));var utils=require(_0xd404('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xd404('0x12'));var db=require(_0xd404('0x13'))['db'];config[_0xd404('0x14')]=_[_0xd404('0x15')](config['redis'],{'host':_0xd404('0x16'),'port':0x18eb});var socket=require(_0xd404('0x17'))(new Redis(config['redis']));require(_0xd404('0x18'))[_0xd404('0x19')](socket);function respondWithStatusCode(_0x9060ad,_0x673fee){_0x673fee=_0x673fee||0xcc;return function(_0x2671cd){if(_0x2671cd){return _0x9060ad[_0xd404('0x1a')](_0x673fee);}return _0x9060ad[_0xd404('0x1b')](_0x673fee)['end']();};}function respondWithResult(_0x37e941,_0x44a3ff){_0x44a3ff=_0x44a3ff||0xc8;return function(_0x58b8b6){if(_0x58b8b6){return _0x37e941[_0xd404('0x1b')](_0x44a3ff)[_0xd404('0x1c')](_0x58b8b6);}};}function respondWithFilteredResult(_0x58c0bb,_0x2966e7){return function(_0xb646ac){if(_0xb646ac){var _0x366688=typeof _0x2966e7[_0xd404('0x1d')]==='undefined'&&typeof _0x2966e7['limit']===_0xd404('0x1e');var _0x32abb3=_0xb646ac[_0xd404('0x1f')];var _0x15cf3b=_0x366688?0x0:_0x2966e7['offset'];var _0x40be61=_0x366688?_0xb646ac[_0xd404('0x1f')]:_0x2966e7['offset']+_0x2966e7[_0xd404('0x20')];var _0x5c333d;if(_0x40be61>=_0x32abb3){_0x40be61=_0x32abb3;_0x5c333d=0xc8;}else{_0x5c333d=0xce;}_0x58c0bb['status'](_0x5c333d);return _0x58c0bb[_0xd404('0x21')]('Content-Range',_0x15cf3b+'-'+_0x40be61+'/'+_0x32abb3)[_0xd404('0x1c')](_0xb646ac);}return null;};}function patchUpdates(_0x38f61c){return function(_0x26cb24){try{jsonpatch[_0xd404('0x22')](_0x26cb24,_0x38f61c,!![]);}catch(_0x522770){return BPromise[_0xd404('0x23')](_0x522770);}return _0x26cb24[_0xd404('0x24')]();};}function saveUpdates(_0xb6edb8,_0x27e6ae){return function(_0x409b42){if(_0x409b42){return _0x409b42[_0xd404('0x25')](_0xb6edb8)[_0xd404('0x26')](function(_0x20ac73){return _0x20ac73;});}return null;};}function removeEntity(_0x597c2d,_0x3aa91b){return function(_0x238f8f){if(_0x238f8f){return _0x238f8f['destroy']()['then'](function(){_0x597c2d[_0xd404('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7369,_0x2169a2){return function(_0x23ef2e){if(!_0x23ef2e){_0x5d7369[_0xd404('0x1a')](0x194);}return _0x23ef2e;};}function handleError(_0x1c1822,_0x28cea3){_0x28cea3=_0x28cea3||0x1f4;return function(_0x19f2c6){logger[_0xd404('0x27')](_0x19f2c6['stack']);if(_0x19f2c6['name']){delete _0x19f2c6[_0xd404('0x28')];}_0x1c1822[_0xd404('0x1b')](_0x28cea3)[_0xd404('0x29')](_0x19f2c6);};}exports['index']=function(_0x45e377,_0xa9d10b){var _0x2994f7={},_0xdaeffa={},_0x10f99f={'count':0x0,'rows':[]};var _0x5c7280=_['map'](db[_0xd404('0x2a')][_0xd404('0x2b')],function(_0x560fff){return{'name':_0x560fff[_0xd404('0x2c')],'type':_0x560fff['type']['key']};});_0xdaeffa[_0xd404('0x2d')]=_[_0xd404('0x2e')](_0x5c7280,_0xd404('0x28'));_0xdaeffa['query']=_[_0xd404('0x2f')](_0x45e377[_0xd404('0x30')]);_0xdaeffa['filters']=_['intersection'](_0xdaeffa[_0xd404('0x2d')],_0xdaeffa[_0xd404('0x30')]);_0x2994f7[_0xd404('0x31')]=_[_0xd404('0x32')](_0xdaeffa['model'],qs[_0xd404('0x33')](_0x45e377[_0xd404('0x30')][_0xd404('0x33')]));_0x2994f7[_0xd404('0x31')]=_0x2994f7['attributes'][_0xd404('0x34')]?_0x2994f7['attributes']:_0xdaeffa[_0xd404('0x2d')];if(!_0x45e377['query'][_0xd404('0x35')](_0xd404('0x36'))){_0x2994f7[_0xd404('0x20')]=qs[_0xd404('0x20')](_0x45e377[_0xd404('0x30')][_0xd404('0x20')]);_0x2994f7[_0xd404('0x1d')]=qs[_0xd404('0x1d')](_0x45e377['query'][_0xd404('0x1d')]);}_0x2994f7['order']=qs[_0xd404('0x37')](_0x45e377[_0xd404('0x30')]['sort']);_0x2994f7['where']=qs['filters'](_['pick'](_0x45e377[_0xd404('0x30')],_0xdaeffa[_0xd404('0x38')]),_0x5c7280);if(_0x45e377['query'][_0xd404('0x39')]){_0x2994f7[_0xd404('0x3a')]=_[_0xd404('0x3b')](_0x2994f7['where'],{'$or':_[_0xd404('0x2e')](_0x5c7280,function(_0x14c53d){if(_0x14c53d['type']!==_0xd404('0x3c')){var _0x365e6d={};_0x365e6d[_0x14c53d[_0xd404('0x28')]]={'$like':'%'+_0x45e377[_0xd404('0x30')][_0xd404('0x39')]+'%'};return _0x365e6d;}})});}_0x2994f7=_[_0xd404('0x3b')]({},_0x2994f7,_0x45e377[_0xd404('0x3d')]);var _0x41cd75={'where':_0x2994f7['where']};return db[_0xd404('0x2a')][_0xd404('0x1f')](_0x41cd75)['then'](function(_0x57a675){_0x10f99f['count']=_0x57a675;if(_0x45e377[_0xd404('0x30')][_0xd404('0x3e')]){_0x2994f7[_0xd404('0x3f')]=[{'all':!![]}];}return db['ChatGroup'][_0xd404('0x40')](_0x2994f7);})[_0xd404('0x26')](function(_0x51e5ad){_0x10f99f['rows']=_0x51e5ad;return _0x10f99f;})[_0xd404('0x26')](respondWithFilteredResult(_0xa9d10b,_0x2994f7))['catch'](handleError(_0xa9d10b,null));};exports['show']=function(_0x2fcbb4,_0x48da7b){var _0x17decc={'raw':!![],'where':{'id':_0x2fcbb4[_0xd404('0x41')]['id']}},_0x2f95da={};_0x2f95da[_0xd404('0x2d')]=_[_0xd404('0x2f')](db[_0xd404('0x2a')]['rawAttributes']);_0x2f95da[_0xd404('0x30')]=_[_0xd404('0x2f')](_0x2fcbb4['query']);_0x2f95da[_0xd404('0x38')]=_[_0xd404('0x32')](_0x2f95da[_0xd404('0x2d')],_0x2f95da[_0xd404('0x30')]);_0x17decc['attributes']=_[_0xd404('0x32')](_0x2f95da[_0xd404('0x2d')],qs[_0xd404('0x33')](_0x2fcbb4[_0xd404('0x30')]['fields']));_0x17decc[_0xd404('0x31')]=_0x17decc[_0xd404('0x31')][_0xd404('0x34')]?_0x17decc['attributes']:_0x2f95da[_0xd404('0x2d')];if(_0x2fcbb4[_0xd404('0x30')][_0xd404('0x3e')]){_0x17decc[_0xd404('0x3f')]=[{'all':!![]}];}_0x17decc=_[_0xd404('0x3b')]({},_0x17decc,_0x2fcbb4[_0xd404('0x3d')]);return db[_0xd404('0x2a')][_0xd404('0x42')](_0x17decc)['then'](handleEntityNotFound(_0x48da7b,null))[_0xd404('0x26')](respondWithResult(_0x48da7b,null))[_0xd404('0x43')](handleError(_0x48da7b,null));};exports['create']=function(_0x186b85,_0x2aa030){return db[_0xd404('0x2a')][_0xd404('0x44')](_0x186b85['body'],{})[_0xd404('0x26')](respondWithResult(_0x2aa030,0xc9))[_0xd404('0x43')](handleError(_0x2aa030,null));};exports[_0xd404('0x25')]=function(_0x5983f7,_0x3f7446){if(_0x5983f7[_0xd404('0x45')]['id']){delete _0x5983f7[_0xd404('0x45')]['id'];}return db[_0xd404('0x2a')][_0xd404('0x42')]({'where':{'id':_0x5983f7[_0xd404('0x41')]['id']}})[_0xd404('0x26')](handleEntityNotFound(_0x3f7446,null))['then'](saveUpdates(_0x5983f7[_0xd404('0x45')],null))[_0xd404('0x26')](respondWithResult(_0x3f7446,null))['catch'](handleError(_0x3f7446,null));};exports[_0xd404('0x46')]=function(_0x23222f,_0x586234){return db[_0xd404('0x2a')][_0xd404('0x42')]({'where':{'id':_0x23222f['params']['id']}})[_0xd404('0x26')](handleEntityNotFound(_0x586234,null))['then'](removeEntity(_0x586234,null))['catch'](handleError(_0x586234,null));};exports[_0xd404('0x47')]=function(_0x3a1b39,_0x422b21){return db[_0xd404('0x2a')][_0xd404('0x47')]()[_0xd404('0x26')](respondWithResult(_0x422b21,null))[_0xd404('0x43')](handleError(_0x422b21,null));};exports[_0xd404('0x48')]=function(_0x1d18c6,_0x12fe10,_0x276671){return db[_0xd404('0x49')]['count']({'where':{'ChatGroupId':_0x1d18c6[_0xd404('0x41')]['id'],'ToId':_0x1d18c6['user']['id'],'read':![]}})[_0xd404('0x26')](function(_0x325206){return{'id':_[_0xd404('0x4a')](_0x1d18c6[_0xd404('0x41')]['id']),'count':_0x325206};})[_0xd404('0x26')](respondWithResult(_0x12fe10,null))['catch'](handleError(_0x12fe10,null));};exports[_0xd404('0x4b')]=function(_0x3f2314,_0x5a80a4,_0x2718f2){return db['ChatGroup'][_0xd404('0x42')]({'where':{'id':_0x3f2314[_0xd404('0x41')]['id']}})[_0xd404('0x26')](handleEntityNotFound(_0x5a80a4,null))['then'](function(_0x466240){if(_0x466240){return _0x466240[_0xd404('0x4b')](_0x3f2314['body'][_0xd404('0x4c')],_['omit'](_0x3f2314[_0xd404('0x45')],['ids','id'])||{});}})[_0xd404('0x26')](respondWithResult(_0x5a80a4,null))[_0xd404('0x43')](handleError(_0x5a80a4,null));};exports[_0xd404('0x4d')]=function(_0x478fd3,_0x16b592,_0xc0bab8){var _0x1ede7e={};var _0x4f9cf5={};var _0x388953;var _0x27fb93;return db[_0xd404('0x2a')]['findOne']({'where':{'id':_0x478fd3[_0xd404('0x41')]['id']}})[_0xd404('0x26')](handleEntityNotFound(_0x16b592,null))['then'](function(_0x435c42){if(_0x435c42){_0x388953=_0x435c42;_0x4f9cf5[_0xd404('0x2d')]=_['keys'](db[_0xd404('0x4e')][_0xd404('0x2b')]);_0x4f9cf5[_0xd404('0x30')]=_[_0xd404('0x2f')](_0x478fd3['query']);_0x4f9cf5[_0xd404('0x38')]=_[_0xd404('0x32')](_0x4f9cf5[_0xd404('0x2d')],_0x4f9cf5[_0xd404('0x30')]);_0x1ede7e['attributes']=_[_0xd404('0x32')](_0x4f9cf5['model'],qs[_0xd404('0x33')](_0x478fd3[_0xd404('0x30')][_0xd404('0x33')]));_0x1ede7e[_0xd404('0x31')]=_0x1ede7e[_0xd404('0x31')][_0xd404('0x34')]?_0x1ede7e[_0xd404('0x31')]:_0x4f9cf5['model'];_0x1ede7e['order']=qs[_0xd404('0x37')](_0x478fd3[_0xd404('0x30')][_0xd404('0x37')]);_0x1ede7e['where']=qs[_0xd404('0x38')](_[_0xd404('0x4f')](_0x478fd3['query'],_0x4f9cf5[_0xd404('0x38')]));if(_0x478fd3[_0xd404('0x30')][_0xd404('0x39')]){_0x1ede7e['where']=_['merge'](_0x1ede7e['where'],{'$or':_[_0xd404('0x2e')](_0x1ede7e['attributes'],function(_0x64f7d3){var _0x23e611={};_0x23e611[_0x64f7d3]={'$like':'%'+_0x478fd3[_0xd404('0x30')][_0xd404('0x39')]+'%'};return _0x23e611;})});}_0x1ede7e=_[_0xd404('0x3b')]({},_0x1ede7e,_0x478fd3['options']);return _0x388953[_0xd404('0x4d')](_0x1ede7e);}})[_0xd404('0x26')](function(_0x3c84b0){if(_0x3c84b0){_0x27fb93=_0x3c84b0[_0xd404('0x34')];if(!_0x478fd3[_0xd404('0x30')][_0xd404('0x35')](_0xd404('0x36'))){_0x1ede7e[_0xd404('0x20')]=qs['limit'](_0x478fd3[_0xd404('0x30')]['limit']);_0x1ede7e[_0xd404('0x1d')]=qs[_0xd404('0x1d')](_0x478fd3[_0xd404('0x30')]['offset']);}return _0x388953['getMembers'](_0x1ede7e);}})[_0xd404('0x26')](function(_0x5ab715){if(_0x5ab715){return _0x5ab715?{'count':_0x27fb93,'rows':_0x5ab715}:null;}})['then'](respondWithResult(_0x16b592,null))['catch'](handleError(_0x16b592,null));};exports['removeMembers']=function(_0x5aef9f,_0x4ba0c3,_0x451f9d){return db[_0xd404('0x2a')][_0xd404('0x42')]({'where':{'id':_0x5aef9f[_0xd404('0x41')]['id']}})['then'](handleEntityNotFound(_0x4ba0c3,null))['then'](function(_0xf677be){if(_0xf677be){return _0xf677be[_0xd404('0x50')](_0x5aef9f[_0xd404('0x30')]['ids']);}})['then'](respondWithStatusCode(_0x4ba0c3,null))[_0xd404('0x43')](handleError(_0x4ba0c3,null));};exports[_0xd404('0x51')]=function(_0x5e9999,_0x1af587,_0x4edfab){if(_0x5e9999[_0xd404('0x45')]['id']){delete _0x5e9999[_0xd404('0x45')]['id'];}return db[_0xd404('0x2a')]['find']({'where':{'id':_0x5e9999['params']['id']}})[_0xd404('0x26')](handleEntityNotFound(_0x1af587,null))[_0xd404('0x26')](function(_0x555ae5){if(_0x555ae5){_0x5e9999[_0xd404('0x45')][_0xd404('0x52')]=_0x555ae5['id'];return db[_0xd404('0x49')][_0xd404('0x44')](_0x5e9999['body']);}})['then'](respondWithResult(_0x1af587,null))['catch'](handleError(_0x1af587,null));};exports[_0xd404('0x53')]=function(_0x2cbe8a,_0x2edac9,_0x1884fb){var _0x42c753={};var _0x576422={};var _0x420cc3;var _0x56c9af;return db[_0xd404('0x2a')][_0xd404('0x54')]({'where':{'id':_0x2cbe8a[_0xd404('0x41')]['id']}})['then'](handleEntityNotFound(_0x2edac9,null))[_0xd404('0x26')](function(_0x1996d0){if(_0x1996d0){_0x420cc3=_0x1996d0;_0x576422['model']=_[_0xd404('0x2f')](db[_0xd404('0x49')][_0xd404('0x2b')]);_0x576422[_0xd404('0x30')]=_[_0xd404('0x2f')](_0x2cbe8a[_0xd404('0x30')]);_0x576422['filters']=_['intersection'](_0x576422[_0xd404('0x2d')],_0x576422[_0xd404('0x30')]);_0x42c753[_0xd404('0x31')]=_[_0xd404('0x32')](_0x576422[_0xd404('0x2d')],qs[_0xd404('0x33')](_0x2cbe8a[_0xd404('0x30')][_0xd404('0x33')]));_0x42c753[_0xd404('0x31')]=_0x42c753[_0xd404('0x31')]['length']?_0x42c753[_0xd404('0x31')]:_0x576422[_0xd404('0x2d')];_0x42c753[_0xd404('0x55')]=qs[_0xd404('0x37')](_0x2cbe8a[_0xd404('0x30')][_0xd404('0x37')]);_0x42c753[_0xd404('0x3a')]=qs['filters'](_[_0xd404('0x4f')](_0x2cbe8a['query'],_0x576422[_0xd404('0x38')]));if(_0x2cbe8a['query'][_0xd404('0x39')]){_0x42c753[_0xd404('0x3a')]=_[_0xd404('0x3b')](_0x42c753['where'],{'$or':_['map'](_0x42c753[_0xd404('0x31')],function(_0x1e4ffb){var _0x84400f={};_0x84400f[_0x1e4ffb]={'$like':'%'+_0x2cbe8a[_0xd404('0x30')]['filter']+'%'};return _0x84400f;})});}if(_0x2cbe8a[_0xd404('0x30')][_0xd404('0x56')]){var _0xf4e48=_0x2cbe8a[_0xd404('0x30')][_0xd404('0x56')][_0xd404('0x57')](',');var _0x48cd4d={};_0x48cd4d[_0xf4e48[0x0]]={'$gte':moment(_0xf4e48[0x1])[_0xd404('0x58')](_0xd404('0x59'))};_0x42c753['where']=_[_0xd404('0x3b')](_0x42c753['where'],_0x48cd4d);}_0x42c753=_['merge']({},_0x42c753,_0x2cbe8a[_0xd404('0x3d')]);return _0x420cc3['getMessages'](_0x42c753);}})[_0xd404('0x26')](function(_0xcb832){if(_0xcb832){_0x56c9af=_0xcb832[_0xd404('0x34')];if(!_0x2cbe8a['query']['hasOwnProperty']('nolimit')){_0x42c753[_0xd404('0x20')]=qs[_0xd404('0x20')](_0x2cbe8a[_0xd404('0x30')][_0xd404('0x20')]);_0x42c753['offset']=qs['offset'](_0x2cbe8a['query'][_0xd404('0x1d')]);}return _0x420cc3[_0xd404('0x53')](_0x42c753);}})[_0xd404('0x26')](function(_0x539265){if(_0x539265){return _0x539265?{'count':_0x56c9af,'rows':_0x539265}:null;}})[_0xd404('0x26')](respondWithResult(_0x2edac9,null))[_0xd404('0x43')](handleError(_0x2edac9,null));};
\ No newline at end of file
+var _0xb140=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','ChatGroup','fieldName','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','merge','find','create','body','describe','getUnread','ChatInternalMessage','addMembers','ids','omit','getMembers','findOne','options','length','removeMembers','ChatGroupId','getMessages','$gte','split','format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x53adf9,_0x381ee9){var _0x41b41f=function(_0x226bb8){while(--_0x226bb8){_0x53adf9['push'](_0x53adf9['shift']());}};_0x41b41f(++_0x381ee9);}(_0xb140,0x10f));var _0x0b14=function(_0xb66f92,_0x301f99){_0xb66f92=_0xb66f92-0x0;var _0x344d2d=_0xb140[_0xb66f92];return _0x344d2d;};'use strict';var emlformat=require(_0x0b14('0x0'));var rimraf=require(_0x0b14('0x1'));var zipdir=require(_0x0b14('0x2'));var jsonpatch=require(_0x0b14('0x3'));var rp=require(_0x0b14('0x4'));var moment=require(_0x0b14('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0b14('0x6'));var util=require(_0x0b14('0x7'));var path=require('path');var sox=require(_0x0b14('0x8'));var csv=require(_0x0b14('0x9'));var ejs=require(_0x0b14('0xa'));var fs=require('fs');var fs_extra=require(_0x0b14('0xb'));var _=require('lodash');var squel=require(_0x0b14('0xc'));var crypto=require('crypto');var jsforce=require(_0x0b14('0xd'));var deskjs=require(_0x0b14('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0b14('0xf'));var Redis=require('ioredis');var authService=require(_0x0b14('0x10'));var qs=require(_0x0b14('0x11'));var as=require(_0x0b14('0x12'));var hardwareService=require(_0x0b14('0x13'));var logger=require(_0x0b14('0x14'))(_0x0b14('0x15'));var utils=require(_0x0b14('0x16'));var config=require(_0x0b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0b14('0x18'))['db'];config[_0x0b14('0x19')]=_[_0x0b14('0x1a')](config[_0x0b14('0x19')],{'host':_0x0b14('0x1b'),'port':0x18eb});var socket=require(_0x0b14('0x1c'))(new Redis(config['redis']));require(_0x0b14('0x1d'))[_0x0b14('0x1e')](socket);function respondWithStatusCode(_0x242c3c,_0x8a9a80){_0x8a9a80=_0x8a9a80||0xcc;return function(_0x10c64a){if(_0x10c64a){return _0x242c3c['sendStatus'](_0x8a9a80);}return _0x242c3c[_0x0b14('0x1f')](_0x8a9a80)[_0x0b14('0x20')]();};}function respondWithResult(_0x3a5673,_0x4694a5){_0x4694a5=_0x4694a5||0xc8;return function(_0x2e3c7b){if(_0x2e3c7b){return _0x3a5673[_0x0b14('0x1f')](_0x4694a5)[_0x0b14('0x21')](_0x2e3c7b);}};}function respondWithFilteredResult(_0x4febd9,_0x15867a){return function(_0x1a5538){if(_0x1a5538){var _0xfc6704=typeof _0x15867a['offset']===_0x0b14('0x22')&&typeof _0x15867a[_0x0b14('0x23')]===_0x0b14('0x22');var _0x47be90=_0x1a5538[_0x0b14('0x24')];var _0x46a35d=_0xfc6704?0x0:_0x15867a[_0x0b14('0x25')];var _0x334e55=_0xfc6704?_0x1a5538[_0x0b14('0x24')]:_0x15867a[_0x0b14('0x25')]+_0x15867a[_0x0b14('0x23')];var _0x45f407;if(_0x334e55>=_0x47be90){_0x334e55=_0x47be90;_0x45f407=0xc8;}else{_0x45f407=0xce;}_0x4febd9['status'](_0x45f407);return _0x4febd9[_0x0b14('0x26')](_0x0b14('0x27'),_0x46a35d+'-'+_0x334e55+'/'+_0x47be90)[_0x0b14('0x21')](_0x1a5538);}return null;};}function patchUpdates(_0x2ee5dc){return function(_0x5b5e83){try{jsonpatch[_0x0b14('0x28')](_0x5b5e83,_0x2ee5dc,!![]);}catch(_0x4bd933){return BPromise[_0x0b14('0x29')](_0x4bd933);}return _0x5b5e83['save']();};}function saveUpdates(_0x494a0c,_0x862b28){return function(_0x224d5c){if(_0x224d5c){return _0x224d5c[_0x0b14('0x2a')](_0x494a0c)[_0x0b14('0x2b')](function(_0xd4e75f){return _0xd4e75f;});}return null;};}function removeEntity(_0x3b2b2e,_0x260103){return function(_0x36dcf2){if(_0x36dcf2){return _0x36dcf2['destroy']()[_0x0b14('0x2b')](function(){_0x3b2b2e[_0x0b14('0x1f')](0xcc)[_0x0b14('0x20')]();});}};}function handleEntityNotFound(_0x2a331d,_0x53d06d){return function(_0xdd7286){if(!_0xdd7286){_0x2a331d[_0x0b14('0x2c')](0x194);}return _0xdd7286;};}function handleError(_0x91107f,_0x3160e0){_0x3160e0=_0x3160e0||0x1f4;return function(_0x27c8c7){logger[_0x0b14('0x2d')](_0x27c8c7[_0x0b14('0x2e')]);if(_0x27c8c7[_0x0b14('0x2f')]){delete _0x27c8c7['name'];}_0x91107f[_0x0b14('0x1f')](_0x3160e0)[_0x0b14('0x30')](_0x27c8c7);};}exports[_0x0b14('0x31')]=function(_0x26a245,_0x29c48e){var _0x1f6b99={},_0x1c65a1={},_0xe00c55={'count':0x0,'rows':[]};var _0x2083e9=_[_0x0b14('0x32')](db[_0x0b14('0x33')]['rawAttributes'],function(_0x70d87){return{'name':_0x70d87[_0x0b14('0x34')],'type':_0x70d87['type']['key']};});_0x1c65a1['model']=_[_0x0b14('0x32')](_0x2083e9,_0x0b14('0x2f'));_0x1c65a1[_0x0b14('0x35')]=_['keys'](_0x26a245[_0x0b14('0x35')]);_0x1c65a1[_0x0b14('0x36')]=_['intersection'](_0x1c65a1[_0x0b14('0x37')],_0x1c65a1[_0x0b14('0x35')]);_0x1f6b99[_0x0b14('0x38')]=_[_0x0b14('0x39')](_0x1c65a1[_0x0b14('0x37')],qs[_0x0b14('0x3a')](_0x26a245[_0x0b14('0x35')]['fields']));_0x1f6b99[_0x0b14('0x38')]=_0x1f6b99[_0x0b14('0x38')]['length']?_0x1f6b99[_0x0b14('0x38')]:_0x1c65a1[_0x0b14('0x37')];if(!_0x26a245[_0x0b14('0x35')][_0x0b14('0x3b')](_0x0b14('0x3c'))){_0x1f6b99[_0x0b14('0x23')]=qs[_0x0b14('0x23')](_0x26a245[_0x0b14('0x35')][_0x0b14('0x23')]);_0x1f6b99[_0x0b14('0x25')]=qs[_0x0b14('0x25')](_0x26a245[_0x0b14('0x35')]['offset']);}_0x1f6b99[_0x0b14('0x3d')]=qs[_0x0b14('0x3e')](_0x26a245[_0x0b14('0x35')][_0x0b14('0x3e')]);_0x1f6b99[_0x0b14('0x3f')]=qs[_0x0b14('0x36')](_[_0x0b14('0x40')](_0x26a245[_0x0b14('0x35')],_0x1c65a1['filters']),_0x2083e9);if(_0x26a245[_0x0b14('0x35')][_0x0b14('0x41')]){_0x1f6b99['where']=_['merge'](_0x1f6b99[_0x0b14('0x3f')],{'$or':_[_0x0b14('0x32')](_0x2083e9,function(_0xd21c31){if(_0xd21c31[_0x0b14('0x42')]!==_0x0b14('0x43')){var _0x29f8cb={};_0x29f8cb[_0xd21c31[_0x0b14('0x2f')]]={'$like':'%'+_0x26a245[_0x0b14('0x35')]['filter']+'%'};return _0x29f8cb;}})});}_0x1f6b99=_['merge']({},_0x1f6b99,_0x26a245['options']);var _0x366bea={'where':_0x1f6b99[_0x0b14('0x3f')]};return db[_0x0b14('0x33')]['count'](_0x366bea)[_0x0b14('0x2b')](function(_0x4b0a7c){_0xe00c55[_0x0b14('0x24')]=_0x4b0a7c;if(_0x26a245[_0x0b14('0x35')]['includeAll']){_0x1f6b99[_0x0b14('0x44')]=[{'all':!![]}];}return db[_0x0b14('0x33')][_0x0b14('0x45')](_0x1f6b99);})[_0x0b14('0x2b')](function(_0x12a091){_0xe00c55[_0x0b14('0x46')]=_0x12a091;return _0xe00c55;})[_0x0b14('0x2b')](respondWithFilteredResult(_0x29c48e,_0x1f6b99))[_0x0b14('0x47')](handleError(_0x29c48e,null));};exports[_0x0b14('0x48')]=function(_0x5a8f5b,_0x10d903){var _0x205ca9={'raw':!![],'where':{'id':_0x5a8f5b[_0x0b14('0x49')]['id']}},_0x4aba3e={};_0x4aba3e['model']=_[_0x0b14('0x4a')](db[_0x0b14('0x33')][_0x0b14('0x4b')]);_0x4aba3e[_0x0b14('0x35')]=_[_0x0b14('0x4a')](_0x5a8f5b['query']);_0x4aba3e['filters']=_[_0x0b14('0x39')](_0x4aba3e[_0x0b14('0x37')],_0x4aba3e[_0x0b14('0x35')]);_0x205ca9[_0x0b14('0x38')]=_[_0x0b14('0x39')](_0x4aba3e[_0x0b14('0x37')],qs[_0x0b14('0x3a')](_0x5a8f5b[_0x0b14('0x35')]['fields']));_0x205ca9[_0x0b14('0x38')]=_0x205ca9[_0x0b14('0x38')]['length']?_0x205ca9['attributes']:_0x4aba3e[_0x0b14('0x37')];if(_0x5a8f5b['query'][_0x0b14('0x4c')]){_0x205ca9[_0x0b14('0x44')]=[{'all':!![]}];}_0x205ca9=_[_0x0b14('0x4d')]({},_0x205ca9,_0x5a8f5b['options']);return db[_0x0b14('0x33')][_0x0b14('0x4e')](_0x205ca9)[_0x0b14('0x2b')](handleEntityNotFound(_0x10d903,null))[_0x0b14('0x2b')](respondWithResult(_0x10d903,null))['catch'](handleError(_0x10d903,null));};exports[_0x0b14('0x4f')]=function(_0x517b7a,_0x110d7d){return db[_0x0b14('0x33')][_0x0b14('0x4f')](_0x517b7a[_0x0b14('0x50')],{})[_0x0b14('0x2b')](respondWithResult(_0x110d7d,0xc9))['catch'](handleError(_0x110d7d,null));};exports[_0x0b14('0x2a')]=function(_0x5ede4e,_0x496ff7){if(_0x5ede4e[_0x0b14('0x50')]['id']){delete _0x5ede4e['body']['id'];}return db[_0x0b14('0x33')]['find']({'where':{'id':_0x5ede4e[_0x0b14('0x49')]['id']}})['then'](handleEntityNotFound(_0x496ff7,null))[_0x0b14('0x2b')](saveUpdates(_0x5ede4e['body'],null))['then'](respondWithResult(_0x496ff7,null))['catch'](handleError(_0x496ff7,null));};exports['destroy']=function(_0x398300,_0x111d7e){return db[_0x0b14('0x33')]['find']({'where':{'id':_0x398300[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x111d7e,null))[_0x0b14('0x2b')](removeEntity(_0x111d7e,null))['catch'](handleError(_0x111d7e,null));};exports['describe']=function(_0x48cf1b,_0x3f612a){return db[_0x0b14('0x33')][_0x0b14('0x51')]()[_0x0b14('0x2b')](respondWithResult(_0x3f612a,null))[_0x0b14('0x47')](handleError(_0x3f612a,null));};exports[_0x0b14('0x52')]=function(_0x56b8c0,_0x391c6f,_0x2dbda2){return db[_0x0b14('0x53')][_0x0b14('0x24')]({'where':{'ChatGroupId':_0x56b8c0[_0x0b14('0x49')]['id'],'ToId':_0x56b8c0['user']['id'],'read':![]}})['then'](function(_0x4cd541){return{'id':_['toInteger'](_0x56b8c0[_0x0b14('0x49')]['id']),'count':_0x4cd541};})[_0x0b14('0x2b')](respondWithResult(_0x391c6f,null))['catch'](handleError(_0x391c6f,null));};exports[_0x0b14('0x54')]=function(_0x305ccc,_0x2d77e9,_0x1e2edc){return db[_0x0b14('0x33')]['find']({'where':{'id':_0x305ccc[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x2d77e9,null))[_0x0b14('0x2b')](function(_0x55e8de){if(_0x55e8de){return _0x55e8de[_0x0b14('0x54')](_0x305ccc['body'][_0x0b14('0x55')],_[_0x0b14('0x56')](_0x305ccc[_0x0b14('0x50')],[_0x0b14('0x55'),'id'])||{});}})[_0x0b14('0x2b')](respondWithResult(_0x2d77e9,null))[_0x0b14('0x47')](handleError(_0x2d77e9,null));};exports[_0x0b14('0x57')]=function(_0x33b4b3,_0x1fb474,_0x5bb6df){var _0x4b90df={};var _0x189f7d={};var _0x160ad6;var _0x56696f;return db['ChatGroup'][_0x0b14('0x58')]({'where':{'id':_0x33b4b3[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x1fb474,null))[_0x0b14('0x2b')](function(_0x4ec94e){if(_0x4ec94e){_0x160ad6=_0x4ec94e;_0x189f7d[_0x0b14('0x37')]=_[_0x0b14('0x4a')](db['User'][_0x0b14('0x4b')]);_0x189f7d[_0x0b14('0x35')]=_['keys'](_0x33b4b3[_0x0b14('0x35')]);_0x189f7d['filters']=_[_0x0b14('0x39')](_0x189f7d[_0x0b14('0x37')],_0x189f7d[_0x0b14('0x35')]);_0x4b90df[_0x0b14('0x38')]=_['intersection'](_0x189f7d[_0x0b14('0x37')],qs['fields'](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x3a')]));_0x4b90df['attributes']=_0x4b90df[_0x0b14('0x38')]['length']?_0x4b90df[_0x0b14('0x38')]:_0x189f7d[_0x0b14('0x37')];_0x4b90df['order']=qs[_0x0b14('0x3e')](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x3e')]);_0x4b90df[_0x0b14('0x3f')]=qs['filters'](_[_0x0b14('0x40')](_0x33b4b3[_0x0b14('0x35')],_0x189f7d[_0x0b14('0x36')]));if(_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x41')]){_0x4b90df[_0x0b14('0x3f')]=_['merge'](_0x4b90df[_0x0b14('0x3f')],{'$or':_[_0x0b14('0x32')](_0x4b90df['attributes'],function(_0x178c2e){var _0x52f829={};_0x52f829[_0x178c2e]={'$like':'%'+_0x33b4b3['query'][_0x0b14('0x41')]+'%'};return _0x52f829;})});}_0x4b90df=_[_0x0b14('0x4d')]({},_0x4b90df,_0x33b4b3[_0x0b14('0x59')]);return _0x160ad6['getMembers'](_0x4b90df);}})[_0x0b14('0x2b')](function(_0x7a04bb){if(_0x7a04bb){_0x56696f=_0x7a04bb[_0x0b14('0x5a')];if(!_0x33b4b3[_0x0b14('0x35')]['hasOwnProperty'](_0x0b14('0x3c'))){_0x4b90df[_0x0b14('0x23')]=qs[_0x0b14('0x23')](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x23')]);_0x4b90df[_0x0b14('0x25')]=qs[_0x0b14('0x25')](_0x33b4b3[_0x0b14('0x35')][_0x0b14('0x25')]);}return _0x160ad6[_0x0b14('0x57')](_0x4b90df);}})[_0x0b14('0x2b')](function(_0x54823c){if(_0x54823c){return _0x54823c?{'count':_0x56696f,'rows':_0x54823c}:null;}})[_0x0b14('0x2b')](respondWithResult(_0x1fb474,null))[_0x0b14('0x47')](handleError(_0x1fb474,null));};exports[_0x0b14('0x5b')]=function(_0x57b7f2,_0x111fcb,_0x557545){return db[_0x0b14('0x33')][_0x0b14('0x4e')]({'where':{'id':_0x57b7f2[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x111fcb,null))[_0x0b14('0x2b')](function(_0x1479e4){if(_0x1479e4){return _0x1479e4[_0x0b14('0x5b')](_0x57b7f2[_0x0b14('0x35')][_0x0b14('0x55')]);}})[_0x0b14('0x2b')](respondWithStatusCode(_0x111fcb,null))[_0x0b14('0x47')](handleError(_0x111fcb,null));};exports['addMessage']=function(_0x185264,_0x5ce9d5,_0x119fa7){if(_0x185264[_0x0b14('0x50')]['id']){delete _0x185264['body']['id'];}return db[_0x0b14('0x33')][_0x0b14('0x4e')]({'where':{'id':_0x185264[_0x0b14('0x49')]['id']}})[_0x0b14('0x2b')](handleEntityNotFound(_0x5ce9d5,null))[_0x0b14('0x2b')](function(_0x494688){if(_0x494688){_0x185264['body'][_0x0b14('0x5c')]=_0x494688['id'];return db[_0x0b14('0x53')][_0x0b14('0x4f')](_0x185264['body']);}})[_0x0b14('0x2b')](respondWithResult(_0x5ce9d5,null))['catch'](handleError(_0x5ce9d5,null));};exports[_0x0b14('0x5d')]=function(_0x3fb96c,_0x4d1eb5,_0x310c83){var _0x3bffaf={};var _0x44a103={};var _0x26eb2a;var _0x3b5a7a;return db[_0x0b14('0x33')][_0x0b14('0x58')]({'where':{'id':_0x3fb96c[_0x0b14('0x49')]['id']}})['then'](handleEntityNotFound(_0x4d1eb5,null))[_0x0b14('0x2b')](function(_0x4f28fd){if(_0x4f28fd){_0x26eb2a=_0x4f28fd;_0x44a103['model']=_[_0x0b14('0x4a')](db['ChatInternalMessage']['rawAttributes']);_0x44a103[_0x0b14('0x35')]=_[_0x0b14('0x4a')](_0x3fb96c[_0x0b14('0x35')]);_0x44a103[_0x0b14('0x36')]=_[_0x0b14('0x39')](_0x44a103[_0x0b14('0x37')],_0x44a103[_0x0b14('0x35')]);_0x3bffaf[_0x0b14('0x38')]=_[_0x0b14('0x39')](_0x44a103[_0x0b14('0x37')],qs[_0x0b14('0x3a')](_0x3fb96c[_0x0b14('0x35')]['fields']));_0x3bffaf[_0x0b14('0x38')]=_0x3bffaf['attributes'][_0x0b14('0x5a')]?_0x3bffaf['attributes']:_0x44a103[_0x0b14('0x37')];_0x3bffaf[_0x0b14('0x3d')]=qs[_0x0b14('0x3e')](_0x3fb96c[_0x0b14('0x35')][_0x0b14('0x3e')]);_0x3bffaf[_0x0b14('0x3f')]=qs[_0x0b14('0x36')](_[_0x0b14('0x40')](_0x3fb96c[_0x0b14('0x35')],_0x44a103['filters']));if(_0x3fb96c[_0x0b14('0x35')][_0x0b14('0x41')]){_0x3bffaf[_0x0b14('0x3f')]=_[_0x0b14('0x4d')](_0x3bffaf[_0x0b14('0x3f')],{'$or':_[_0x0b14('0x32')](_0x3bffaf[_0x0b14('0x38')],function(_0x4edc0a){var _0x444023={};_0x444023[_0x4edc0a]={'$like':'%'+_0x3fb96c['query'][_0x0b14('0x41')]+'%'};return _0x444023;})});}if(_0x3fb96c[_0x0b14('0x35')]['$gte']){var _0x50bff7=_0x3fb96c[_0x0b14('0x35')][_0x0b14('0x5e')][_0x0b14('0x5f')](',');var _0x150454={};_0x150454[_0x50bff7[0x0]]={'$gte':moment(_0x50bff7[0x1])[_0x0b14('0x60')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3bffaf['where']=_[_0x0b14('0x4d')](_0x3bffaf[_0x0b14('0x3f')],_0x150454);}_0x3bffaf=_['merge']({},_0x3bffaf,_0x3fb96c['options']);return _0x26eb2a['getMessages'](_0x3bffaf);}})[_0x0b14('0x2b')](function(_0x513f75){if(_0x513f75){_0x3b5a7a=_0x513f75[_0x0b14('0x5a')];if(!_0x3fb96c['query'][_0x0b14('0x3b')]('nolimit')){_0x3bffaf[_0x0b14('0x23')]=qs[_0x0b14('0x23')](_0x3fb96c[_0x0b14('0x35')]['limit']);_0x3bffaf[_0x0b14('0x25')]=qs[_0x0b14('0x25')](_0x3fb96c['query']['offset']);}return _0x26eb2a['getMessages'](_0x3bffaf);}})[_0x0b14('0x2b')](function(_0x3e013b){if(_0x3e013b){return _0x3e013b?{'count':_0x3b5a7a,'rows':_0x3e013b}:null;}})[_0x0b14('0x2b')](respondWithResult(_0x4d1eb5,null))[_0x0b14('0x47')](handleError(_0x4d1eb5,null));};
\ No newline at end of file
index e772693..224a880 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf470=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit'];(function(_0x3e8c0f,_0x3637c1){var _0x5a3f90=function(_0x59933d){while(--_0x59933d){_0x3e8c0f['push'](_0x3e8c0f['shift']());}};_0x5a3f90(++_0x3637c1);}(_0xf470,0xfd));var _0x0f47=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xf470[_0x2fc012];return _0x2891f9;};'use strict';var EventEmitter=require(_0x0f47('0x0'));var ChatGroup=require(_0x0f47('0x1'))['db'][_0x0f47('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x0f47('0x3')](0x0);var events={'afterCreate':_0x0f47('0x4'),'afterUpdate':_0x0f47('0x5'),'afterDestroy':'remove'};function emitEvent(_0x8fd765){return function(_0x3e20a3,_0x493828,_0x1b6cfc){ChatGroupEvents[_0x0f47('0x6')](_0x8fd765+':'+_0x3e20a3['id'],_0x3e20a3);ChatGroupEvents[_0x0f47('0x6')](_0x8fd765,_0x3e20a3);_0x1b6cfc(null);};}for(var e in events){if(events[_0x0f47('0x7')](e)){var event=events[e];ChatGroup[_0x0f47('0x8')](e,emitEvent(event));}}module[_0x0f47('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0x9790=['exports','events','../../mysqldb','save','update','remove','emit','hook'];(function(_0x12f934,_0x2bc2ec){var _0x3a0eb4=function(_0x382da6){while(--_0x382da6){_0x12f934['push'](_0x12f934['shift']());}};_0x3a0eb4(++_0x2bc2ec);}(_0x9790,0xc1));var _0x0979=function(_0x1d36d5,_0x261e4d){_0x1d36d5=_0x1d36d5-0x0;var _0x1c583c=_0x9790[_0x1d36d5];return _0x1c583c;};'use strict';var EventEmitter=require(_0x0979('0x0'));var ChatGroup=require(_0x0979('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0979('0x2'),'afterUpdate':_0x0979('0x3'),'afterDestroy':_0x0979('0x4')};function emitEvent(_0x4c512a){return function(_0x4316f1,_0x4f2e67,_0x16f7b8){ChatGroupEvents[_0x0979('0x5')](_0x4c512a+':'+_0x4316f1['id'],_0x4316f1);ChatGroupEvents[_0x0979('0x5')](_0x4c512a,_0x4316f1);_0x16f7b8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x0979('0x6')](e,emitEvent(event));}}module[_0x0979('0x7')]=ChatGroupEvents;
\ No newline at end of file
index 25633ac..3a82011 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x295c=['path','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x295c,0x1da));var _0xc295=function(_0x42a6ec,_0x49d1dd){_0x42a6ec=_0x42a6ec-0x0;var _0x18bd7f=_0x295c[_0x42a6ec];return _0x18bd7f;};'use strict';var _=require(_0xc295('0x0'));var util=require(_0xc295('0x1'));var logger=require(_0xc295('0x2'))(_0xc295('0x3'));var moment=require('moment');var BPromise=require(_0xc295('0x4'));var rp=require(_0xc295('0x5'));var fs=require('fs');var path=require(_0xc295('0x6'));var rimraf=require('rimraf');var config=require(_0xc295('0x7'));var attributes=require(_0xc295('0x8'));module[_0xc295('0x9')]=function(_0x48d89c,_0x56b0b6){return _0x48d89c[_0xc295('0xa')]('ChatGroup',attributes,{'tableName':_0xc295('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1dfa=['../../config/logger','moment','bluebird','path','../../config/environment','./chatGroup.attributes','exports','define','lodash'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1dfa,0xb3));var _0xa1df=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0x1dfa[_0x5037ab];return _0x512adb;};'use strict';var _=require(_0xa1df('0x0'));var util=require('util');var logger=require(_0xa1df('0x1'))('api');var moment=require(_0xa1df('0x2'));var BPromise=require(_0xa1df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1df('0x4'));var rimraf=require('rimraf');var config=require(_0xa1df('0x5'));var attributes=require(_0xa1df('0x6'));module[_0xa1df('0x7')]=function(_0xb6a3e,_0x4f55d1){return _0xb6a3e[_0xa1df('0x8')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a73d517..7868ec2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcc7=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x3ab136,_0x5d1e7e){var _0xb015df=function(_0x511901){while(--_0x511901){_0x3ab136['push'](_0x3ab136['shift']());}};_0xb015df(++_0x5d1e7e);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x131598,_0x332e0d){_0x131598=_0x131598-0x0;var _0x36d7df=_0xbcc7[_0x131598];return _0x36d7df;};'use strict';var _=require(_0x7bcc('0x0'));var util=require(_0x7bcc('0x1'));var moment=require('moment');var BPromise=require(_0x7bcc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7bcc('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7bcc('0x4'))(_0x7bcc('0x5'));var config=require('../../config/environment');var jayson=require(_0x7bcc('0x6'));var client=jayson[_0x7bcc('0x7')][_0x7bcc('0x8')]({'port':0x232a});config[_0x7bcc('0x9')]=_[_0x7bcc('0xa')](config[_0x7bcc('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7bcc('0xb'))(new Redis(config['redis']));require(_0x7bcc('0xc'))[_0x7bcc('0xd')](socket);function respondWithRpcPromise(_0x4c38fa,_0x225f39,_0x54fa3d){return new BPromise(function(_0x58e035,_0x5c4a28){return client[_0x7bcc('0xe')](_0x4c38fa,_0x54fa3d)[_0x7bcc('0xf')](function(_0xb3207){logger[_0x7bcc('0x10')](_0x7bcc('0x11'),_0x225f39,_0x7bcc('0x12'));logger[_0x7bcc('0x13')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x225f39,_0x7bcc('0x12'),JSON[_0x7bcc('0x14')](_0xb3207));if(_0xb3207[_0x7bcc('0x15')]){if(_0xb3207[_0x7bcc('0x15')][_0x7bcc('0x16')]===0x1f4){logger[_0x7bcc('0x15')]('ChatGroup,\x20%s,\x20%s',_0x225f39,_0xb3207[_0x7bcc('0x15')][_0x7bcc('0x17')]);return _0x5c4a28(_0xb3207[_0x7bcc('0x15')][_0x7bcc('0x17')]);}logger[_0x7bcc('0x15')](_0x7bcc('0x11'),_0x225f39,_0xb3207[_0x7bcc('0x15')]['message']);return _0x58e035(_0xb3207[_0x7bcc('0x15')]['message']);}else{logger[_0x7bcc('0x10')](_0x7bcc('0x11'),_0x225f39,_0x7bcc('0x12'));_0x58e035(_0xb3207[_0x7bcc('0x18')]['message']);}})['catch'](function(_0xbab5b6){logger[_0x7bcc('0x15')](_0x7bcc('0x11'),_0x225f39,_0xbab5b6);_0x5c4a28(_0xbab5b6);});});}
\ No newline at end of file
+var _0x548b=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x348c09,_0x539458){var _0x22d339=function(_0x3be039){while(--_0x3be039){_0x348c09['push'](_0x348c09['shift']());}};_0x22d339(++_0x539458);}(_0x548b,0x14f));var _0xb548=function(_0xb8d5b6,_0x22ab4b){_0xb8d5b6=_0xb8d5b6-0x0;var _0x4f0b2f=_0x548b[_0xb8d5b6];return _0x4f0b2f;};'use strict';var _=require(_0xb548('0x0'));var util=require('util');var moment=require(_0xb548('0x1'));var BPromise=require(_0xb548('0x2'));var rs=require(_0xb548('0x3'));var fs=require('fs');var Redis=require(_0xb548('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb548('0x5'))(_0xb548('0x6'));var config=require(_0xb548('0x7'));var jayson=require(_0xb548('0x8'));var client=jayson[_0xb548('0x9')][_0xb548('0xa')]({'port':0x232a});config[_0xb548('0xb')]=_[_0xb548('0xc')](config[_0xb548('0xb')],{'host':_0xb548('0xd'),'port':0x18eb});var socket=require(_0xb548('0xe'))(new Redis(config['redis']));require(_0xb548('0xf'))[_0xb548('0x10')](socket);function respondWithRpcPromise(_0x14d205,_0x4afd2e,_0x29c118){return new BPromise(function(_0x3d03d6,_0x4fec63){return client['request'](_0x14d205,_0x29c118)['then'](function(_0x260ecf){logger[_0xb548('0x11')](_0xb548('0x12'),_0x4afd2e,'request\x20sent');logger[_0xb548('0x13')](_0xb548('0x14'),_0x4afd2e,'request\x20sent',JSON[_0xb548('0x15')](_0x260ecf));if(_0x260ecf[_0xb548('0x16')]){if(_0x260ecf[_0xb548('0x16')]['code']===0x1f4){logger[_0xb548('0x16')](_0xb548('0x12'),_0x4afd2e,_0x260ecf[_0xb548('0x16')][_0xb548('0x17')]);return _0x4fec63(_0x260ecf[_0xb548('0x16')]['message']);}logger['error'](_0xb548('0x12'),_0x4afd2e,_0x260ecf['error']['message']);return _0x3d03d6(_0x260ecf['error'][_0xb548('0x17')]);}else{logger['info'](_0xb548('0x12'),_0x4afd2e,'request\x20sent');_0x3d03d6(_0x260ecf[_0xb548('0x18')][_0xb548('0x17')]);}})[_0xb548('0x19')](function(_0x521a3c){logger[_0xb548('0x16')](_0xb548('0x12'),_0x4afd2e,_0x521a3c);_0x4fec63(_0x521a3c);});});}
\ No newline at end of file
index 0e67a16..a1afcec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08d3=['./chatGroup.events','save','remove','update','register','length'];(function(_0xc971a4,_0x5b381c){var _0x4ebd6b=function(_0x371149){while(--_0x371149){_0xc971a4['push'](_0xc971a4['shift']());}};_0x4ebd6b(++_0x5b381c);}(_0x08d3,0xf0));var _0x308d=function(_0x55644a,_0x227184){_0x55644a=_0x55644a-0x0;var _0x2b0918=_0x08d3[_0x55644a];return _0x2b0918;};'use strict';var ChatGroupEvents=require(_0x308d('0x0'));var events=[_0x308d('0x1'),_0x308d('0x2'),_0x308d('0x3')];function createListener(_0x24ac3a,_0x4bb560){return function(_0x1f48b9){_0x4bb560['emit'](_0x24ac3a,_0x1f48b9);};}function removeListener(_0x68a43e,_0x39b31d){return function(){ChatGroupEvents['removeListener'](_0x68a43e,_0x39b31d);};}exports[_0x308d('0x4')]=function(_0x3ea655){for(var _0x35e860=0x0,_0x3f040e=events[_0x308d('0x5')];_0x35e860<_0x3f040e;_0x35e860++){var _0x534eab=events[_0x35e860];var _0x489abf=createListener('chatGroup:'+_0x534eab,_0x3ea655);ChatGroupEvents['on'](_0x534eab,_0x489abf);}};
\ No newline at end of file
+var _0x63bf=['chatGroup:','./chatGroup.events','remove','update','emit','removeListener','register','length'];(function(_0x464470,_0x3439e7){var _0xae7c25=function(_0x44e58e){while(--_0x44e58e){_0x464470['push'](_0x464470['shift']());}};_0xae7c25(++_0x3439e7);}(_0x63bf,0x199));var _0xf63b=function(_0x2f0b27,_0x3e7ee2){_0x2f0b27=_0x2f0b27-0x0;var _0x2acf69=_0x63bf[_0x2f0b27];return _0x2acf69;};'use strict';var ChatGroupEvents=require(_0xf63b('0x0'));var events=['save',_0xf63b('0x1'),_0xf63b('0x2')];function createListener(_0x56f8eb,_0x29b7f8){return function(_0x22a5db){_0x29b7f8[_0xf63b('0x3')](_0x56f8eb,_0x22a5db);};}function removeListener(_0x9dfee8,_0x12912e){return function(){ChatGroupEvents[_0xf63b('0x4')](_0x9dfee8,_0x12912e);};}exports[_0xf63b('0x5')]=function(_0x14fd2e){for(var _0x333aa7=0x0,_0x5f1bb0=events[_0xf63b('0x6')];_0x333aa7<_0x5f1bb0;_0x333aa7++){var _0x51c09b=events[_0x333aa7];var _0x5421f1=createListener(_0xf63b('0x7')+_0x51c09b,_0x14fd2e);ChatGroupEvents['on'](_0x51c09b,_0x5421f1);}};
\ No newline at end of file
index 8f1bbc9..1b12dcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6847=['isAuthenticated','describe','/:id','show','/:id/unread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','delete','removeMembers','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/describe'];(function(_0x2bb59b,_0x55cdbd){var _0x347c20=function(_0x1ab038){while(--_0x1ab038){_0x2bb59b['push'](_0x2bb59b['shift']());}};_0x347c20(++_0x55cdbd);}(_0x6847,0x12f));var _0x7684=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0x6847[_0x166d93];return _0xba708;};'use strict';var multer=require(_0x7684('0x0'));var util=require(_0x7684('0x1'));var path=require('path');var timeout=require(_0x7684('0x2'));var express=require('express');var router=express[_0x7684('0x3')]();var fs_extra=require(_0x7684('0x4'));var auth=require(_0x7684('0x5'));var interaction=require(_0x7684('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x7684('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7684('0x7')](_0x7684('0x8'),auth[_0x7684('0x9')](),controller[_0x7684('0xa')]);router[_0x7684('0x7')](_0x7684('0xb'),auth[_0x7684('0x9')](),controller[_0x7684('0xc')]);router[_0x7684('0x7')](_0x7684('0xd'),auth[_0x7684('0x9')](),controller['getUnread']);router[_0x7684('0x7')](_0x7684('0xe'),auth[_0x7684('0x9')](),controller[_0x7684('0xf')]);router[_0x7684('0x7')](_0x7684('0x10'),auth[_0x7684('0x9')](),controller[_0x7684('0x11')]);router[_0x7684('0x12')]('/',auth[_0x7684('0x9')](),controller[_0x7684('0x13')]);router['post'](_0x7684('0xe'),auth[_0x7684('0x9')](),controller[_0x7684('0x14')]);router[_0x7684('0x12')](_0x7684('0x10'),auth[_0x7684('0x9')](),controller[_0x7684('0x15')]);router[_0x7684('0x16')](_0x7684('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x7684('0x17')](_0x7684('0xb'),auth[_0x7684('0x9')](),controller['destroy']);router[_0x7684('0x17')](_0x7684('0xe'),auth['isAuthenticated'](),controller[_0x7684('0x18')]);module[_0x7684('0x19')]=router;
\ No newline at end of file
+var _0x2a44=['/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','delete','removeMembers','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/unread','getUnread'];(function(_0x203d1e,_0x2166de){var _0x4b086d=function(_0x5c1bd0){while(--_0x5c1bd0){_0x203d1e['push'](_0x203d1e['shift']());}};_0x4b086d(++_0x2166de);}(_0x2a44,0xbe));var _0x42a4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2a44[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x42a4('0x0'));var util=require(_0x42a4('0x1'));var path=require(_0x42a4('0x2'));var timeout=require(_0x42a4('0x3'));var express=require(_0x42a4('0x4'));var router=express[_0x42a4('0x5')]();var fs_extra=require(_0x42a4('0x6'));var auth=require(_0x42a4('0x7'));var interaction=require(_0x42a4('0x8'));var config=require(_0x42a4('0x9'));var controller=require(_0x42a4('0xa'));router[_0x42a4('0xb')]('/',auth['isAuthenticated'](),controller[_0x42a4('0xc')]);router[_0x42a4('0xb')](_0x42a4('0xd'),auth['isAuthenticated'](),controller[_0x42a4('0xe')]);router[_0x42a4('0xb')](_0x42a4('0xf'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x11')]);router[_0x42a4('0xb')](_0x42a4('0x12'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x13')]);router[_0x42a4('0xb')](_0x42a4('0x14'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x15')]);router[_0x42a4('0xb')](_0x42a4('0x16'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x17')]);router[_0x42a4('0x18')]('/',auth['isAuthenticated'](),controller[_0x42a4('0x19')]);router[_0x42a4('0x18')](_0x42a4('0x14'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x1a')]);router['post'](_0x42a4('0x16'),auth[_0x42a4('0x10')](),controller[_0x42a4('0x1b')]);router['put'](_0x42a4('0xf'),auth[_0x42a4('0x10')](),controller['update']);router[_0x42a4('0x1c')]('/:id',auth[_0x42a4('0x10')](),controller['destroy']);router['delete'](_0x42a4('0x14'),auth['isAuthenticated'](),controller[_0x42a4('0x1d')]);module['exports']=router;
\ No newline at end of file
index fefa09c..502fa93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4899=['star','TEXT','STRING','long','DATE','out','sequelize','BOOLEAN','ENUM','thumb'];(function(_0x287a0c,_0xa5cbc5){var _0x1233eb=function(_0x3f3c0c){while(--_0x3f3c0c){_0x287a0c['push'](_0x287a0c['shift']());}};_0x1233eb(++_0xa5cbc5);}(_0x4899,0x74));var _0x9489=function(_0x3258ca,_0x28e8f2){_0x3258ca=_0x3258ca-0x0;var _0xc3f176=_0x4899[_0x3258ca];return _0xc3f176;};'use strict';var Sequelize=require(_0x9489('0x0'));module['exports']={'closed':{'type':Sequelize[_0x9489('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x9489('0x2')]('star',_0x9489('0x3')),'defaultValue':_0x9489('0x4')},'ratingMessage':{'type':Sequelize[_0x9489('0x5')]},'pathTranscript':{'type':Sequelize[_0x9489('0x5')]},'mailTranscript':{'type':Sequelize[_0x9489('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9489('0x6')]},'secondDisposition':{'type':Sequelize[_0x9489('0x6')]},'thirdDisposition':{'type':Sequelize[_0x9489('0x6')]},'note':{'type':Sequelize[_0x9489('0x6')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x9489('0x6')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x9489('0x6')]},'deviceVendor':{'type':Sequelize[_0x9489('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x9489('0x5')]},'customerIp':{'type':Sequelize[_0x9489('0x6')]},'formData':{'type':Sequelize[_0x9489('0x5')](_0x9489('0x7'))},'read1stAt':{'type':Sequelize[_0x9489('0x8')]},'lastMsgAt':{'type':Sequelize[_0x9489('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x9489('0x2')]('in',_0x9489('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x9489('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x9489('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x9489('0x1')],'defaultValue':![]}};
\ No newline at end of file
+var _0x1619=['DATE','BOOLEAN','ENUM','star','thumb','TEXT','STRING','long'];(function(_0x42fac1,_0x38fa53){var _0x286b82=function(_0x5938e8){while(--_0x5938e8){_0x42fac1['push'](_0x42fac1['shift']());}};_0x286b82(++_0x38fa53);}(_0x1619,0x189));var _0x9161=function(_0x1e29cc,_0x4b668a){_0x1e29cc=_0x1e29cc-0x0;var _0x25fabb=_0x1619[_0x1e29cc];return _0x25fabb;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x9161('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x9161('0x1')](_0x9161('0x2'),_0x9161('0x3')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x9161('0x4')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x9161('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9161('0x5')]},'thirdDisposition':{'type':Sequelize[_0x9161('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x9161('0x5')]},'browserVersion':{'type':Sequelize[_0x9161('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x9161('0x5')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x9161('0x5')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x9161('0x4')]},'customerIp':{'type':Sequelize[_0x9161('0x5')]},'formData':{'type':Sequelize[_0x9161('0x4')](_0x9161('0x6'))},'read1stAt':{'type':Sequelize[_0x9161('0x7')]},'lastMsgAt':{'type':Sequelize[_0x9161('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x9161('0x1')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x9161('0x0')],'defaultValue':![]}};
\ No newline at end of file
index ef28100..028cf6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['querystring','papaparse','ioredis','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','update','stack','name','send','body','contact','interaction','account','Users','map','fullname','TagIds','Tags','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_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','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','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','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?','find','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','buildExpression','some','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','isEmpty','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','catch','show','params','keys','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooNote','email','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','isNull','follow','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','file','filename','mimetype','attachmentDownload','closed','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','basename','close','mailTranscript','root','now','Messages','format','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','omit','getMessages','split','YYYY-MM-DD\x20HH:mm:ss','includeAgent','alias','findAll','setTags','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','Account','Owner','get','mkdirSync','Chat','N.A.','disposition','osName','referer','customerPort','tail','existsSync','pipe','createWriteStream','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x27dc8d,_0x1f0639){var _0x3f7fd4=function(_0x3ca25d){while(--_0x3ca25d){_0x27dc8d['push'](_0x27dc8d['shift']());}};_0x3f7fd4(++_0x1f0639);}(_0xb10b,0x12a));var _0xbb10=function(_0x21ecd6,_0x53e0a6){_0x21ecd6=_0x21ecd6-0x0;var _0x5b2b5a=_0xb10b[_0x21ecd6];return _0x5b2b5a;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));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('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xbb10('0x13'));var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))('api');var utils=require(_0xbb10('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb10('0x17'));var db=require(_0xbb10('0x18'))['db'];config[_0xbb10('0x19')]=_[_0xbb10('0x1a')](config[_0xbb10('0x19')],{'host':_0xbb10('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb10('0x19')]));require(_0xbb10('0x1c'))[_0xbb10('0x1d')](socket);var jayson=require(_0xbb10('0x1e'));var client=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232b});var client9004=jayson[_0xbb10('0x1f')][_0xbb10('0x20')]({'port':0x232c});function respondWithRpcPromise(_0x3e26f4,_0x2b184e,_0x4a2bfc,_0x2eca0f){return new BPromise(function(_0x1145f1,_0x133ac2){var _0x42db98=_0x2eca0f||client;return _0x42db98[_0xbb10('0x21')](_0x3e26f4,_0x4a2bfc)[_0xbb10('0x22')](function(_0x575cca){logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x2b184e,_0xbb10('0x25'));logger['debug'](_0xbb10('0x26'),_0x2b184e,_0xbb10('0x25'),JSON[_0xbb10('0x27')](_0x575cca));if(_0x575cca[_0xbb10('0x28')]){if(_0x575cca[_0xbb10('0x28')][_0xbb10('0x29')]===0x1f4){logger['error'](_0xbb10('0x24'),_0x2b184e,_0x575cca[_0xbb10('0x28')]['message']);return _0x133ac2(_0x575cca['error'][_0xbb10('0x2a')]);}logger[_0xbb10('0x28')](_0xbb10('0x24'),_0x2b184e,_0x575cca[_0xbb10('0x28')][_0xbb10('0x2a')]);return _0x1145f1(_0x575cca[_0xbb10('0x28')][_0xbb10('0x2a')]);}else{logger[_0xbb10('0x23')](_0xbb10('0x24'),_0x2b184e,_0xbb10('0x25'));_0x1145f1(_0x575cca[_0xbb10('0x2b')][_0xbb10('0x2a')]);}})['catch'](function(_0x4fedac){logger['error'](_0xbb10('0x24'),_0x2b184e,_0x4fedac);_0x133ac2(_0x4fedac);});});}function respondWithStatusCode(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0xcc;return function(_0x4e25ff){if(_0x4e25ff){return _0x3c5ae7[_0xbb10('0x2c')](_0x2c89b9);}return _0x3c5ae7[_0xbb10('0x2d')](_0x2c89b9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xc8;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9)['json'](_0x20d946);}};}function respondWithFilteredResult(_0x3796c7,_0x21ac54){return function(_0xfc3595){if(_0xfc3595){var _0x2e0249=typeof _0x21ac54[_0xbb10('0x2f')]===_0xbb10('0x30')&&typeof _0x21ac54['limit']===_0xbb10('0x30');var _0x4ee02e=_0xfc3595[_0xbb10('0x31')];var _0x56f2da=_0x2e0249?0x0:_0x21ac54[_0xbb10('0x2f')];var _0x1dcc9c=_0x2e0249?_0xfc3595[_0xbb10('0x31')]:_0x21ac54['offset']+_0x21ac54['limit'];var _0x4c3744;if(_0x1dcc9c>=_0x4ee02e){_0x1dcc9c=_0x4ee02e;_0x4c3744=0xc8;}else{_0x4c3744=0xce;}_0x3796c7[_0xbb10('0x2d')](_0x4c3744);return _0x3796c7['set'](_0xbb10('0x32'),_0x56f2da+'-'+_0x1dcc9c+'/'+_0x4ee02e)[_0xbb10('0x33')](_0xfc3595);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x22')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x22')](function(){_0x188cbd[_0xbb10('0x2d')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x28')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}function getMustacheRender(_0x25d72f,_0x52de31){return Mustache['render'](_0x25d72f,_['merge'](_0x52de31[_0xbb10('0x3a')],{'contact':_0x52de31[_0xbb10('0x3b')],'message':_0x52de31[_0xbb10('0x2a')],'agent':_0x52de31['agent'],'interaction':_0x52de31[_0xbb10('0x3c')],'account':_0x52de31[_0xbb10('0x3d')]}))||'';}function getInteractionUsers(_0x4345f3,_0x4d1a83){return new BPromise(function(_0x17b6c5,_0x12238a){try{if(_0x4d1a83[_0x4345f3['id']]){_0x4345f3[_0xbb10('0x3e')]=_[_0xbb10('0x3f')](_0x4d1a83[_0x4345f3['id']],function(_0x4f1cdd){return{'id':_0x4f1cdd['id'],'fullname':_0x4f1cdd[_0xbb10('0x40')]};});}}catch(_0x110eb5){_0x12238a(_0x110eb5);}_0x17b6c5(_0x4345f3);});}function getInteractionTags(_0x5835fd,_0xe2040f){return new BPromise(function(_0x2e3214,_0x44d6ae){try{if(_0x5835fd[_0xbb10('0x41')]){_0x5835fd[_0xbb10('0x42')]=[];_0x5835fd[_0xbb10('0x41')]['split'](',')[_0xbb10('0x43')](function(_0x1c7fae){_0x5835fd[_0xbb10('0x42')][_0xbb10('0x44')](_0xe2040f[_0x1c7fae]);});}delete _0x5835fd['TagIds'];}catch(_0x3fff6c){_0x44d6ae(_0x3fff6c);}_0x2e3214(_0x5835fd);});}function updateChatInteraction(_0x331751,_0x23dc18,_0x403beb){return new BPromise(function(_0x5e2cfa,_0x351484){return getInteractionUsers(_0x331751,_0x403beb)[_0xbb10('0x22')](function(_0x54ac18){return getInteractionTags(_0x54ac18,_0x23dc18);})['then'](function(_0x38d78f){_0x5e2cfa(_0x38d78f);})['catch'](function(_0x318984){_0x351484(_0x318984);});});}exports[_0xbb10('0x45')]=function(_0x4c66d8,_0x366608){var _0x1d82bf={},_0x474e99={},_0x5cf4f8={'count':0x0,'rows':[]};var _0x2dd02b=_[_0xbb10('0x3f')](db[_0xbb10('0x46')][_0xbb10('0x47')],function(_0x36e1fa){return{'name':_0x36e1fa[_0xbb10('0x48')],'type':_0x36e1fa[_0xbb10('0x49')][_0xbb10('0x4a')]};});_0x474e99[_0xbb10('0x4b')]=_[_0xbb10('0x3f')](_0x2dd02b,_0xbb10('0x38'));_0x474e99[_0xbb10('0x4c')]=_['keys'](_0x4c66d8[_0xbb10('0x4c')]);_0x474e99[_0xbb10('0x4d')]=_['intersection'](_0x474e99[_0xbb10('0x4b')],_0x474e99[_0xbb10('0x4c')]);_0x1d82bf[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x474e99[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x4c66d8[_0xbb10('0x4c')]['fields']));_0x1d82bf['attributes']=_0x1d82bf[_0xbb10('0x4e')][_0xbb10('0x51')]?_0x1d82bf[_0xbb10('0x4e')]:_0x474e99['model'];if(!_0x4c66d8['query'][_0xbb10('0x52')](_0xbb10('0x53'))){_0x1d82bf[_0xbb10('0x54')]=qs[_0xbb10('0x54')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x54')]);_0x1d82bf[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x2f')]);}_0x1d82bf['order']=qs['sort'](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x1d82bf[_0xbb10('0x56')]=qs[_0xbb10('0x4d')](_[_0xbb10('0x57')](_0x4c66d8[_0xbb10('0x4c')],_0x474e99[_0xbb10('0x4d')]),_0x2dd02b);var _0x445870=[];var _0x1c0d8f=squel[_0xbb10('0x58')]()[_0xbb10('0x59')]('id')[_0xbb10('0x59')](_0xbb10('0x38'))[_0xbb10('0x59')](_0xbb10('0x5a'))['from'](_0xbb10('0x5b'));var _0x5bd44d=squel[_0xbb10('0x58')]()[_0xbb10('0x59')](_0xbb10('0x5c'))[_0xbb10('0x59')](_0xbb10('0x5d'))[_0xbb10('0x59')](_0xbb10('0x5e'))[_0xbb10('0x5f')](_0xbb10('0x60'),'ui')[_0xbb10('0x61')](_0xbb10('0x62'),'u',_0xbb10('0x63'));var _0x1d49e1=squel[_0xbb10('0x58')]()[_0xbb10('0x5f')]('chat_interactions','i')[_0xbb10('0x61')](_0xbb10('0x64'),'c',_0xbb10('0x65'))[_0xbb10('0x61')](_0xbb10('0x62'),'o',_0xbb10('0x66'))['left_join'](_0xbb10('0x67'),'a',_0xbb10('0x68'))[_0xbb10('0x61')](_0xbb10('0x69'),'me',_0xbb10('0x6a'))[_0xbb10('0x61')](_0xbb10('0x6b'),'it',_0xbb10('0x6c'))[_0xbb10('0x61')](_0xbb10('0x5b'),'t',_0xbb10('0x6d'));var _0x2a1ce1=squel[_0xbb10('0x6e')]();var _0x4e7fac=[];var _0x4ea1a6=squel[_0xbb10('0x6e')]();var _0x3e6338;if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x6f')]){_0x3e6338=as['parseSearch'](_0x4c66d8['query'][_0xbb10('0x6f')]);var _0xaf2cc3=_0x3e6338[_0xbb10('0x70')];for(var _0x2dd150=0x0;_0x2dd150<_0x3e6338[_0xbb10('0x71')][_0xbb10('0x51')];_0x2dd150++){var _0x45c0dc=_0x3e6338['conditions'][_0x2dd150];var _0x117e84='i';var _0x216cff=_['find'](_0x2dd02b,['name',_0x45c0dc['field']]);if(!_0x216cff){switch(_0x45c0dc[_0xbb10('0x59')]){case _0xbb10('0x72'):if(_0x45c0dc[_0xbb10('0x73')]==0x1){_0x1d49e1['having']('`'+_0x45c0dc['field']+'`\x20=\x200');}else{_0x1d49e1[_0xbb10('0x74')]('`'+_0x45c0dc[_0xbb10('0x59')]+_0xbb10('0x75'));}break;case'Contact':if(_0x45c0dc[_0xbb10('0x76')]===_0xbb10('0x77')){if(_0x45c0dc['value']['split']('\x20')[_0xbb10('0x51')]>0x1){_0x2a1ce1[_0xaf2cc3](_0xbb10('0x78'),qs[_0xbb10('0x79')](_0x45c0dc[_0xbb10('0x73')]),null);}else{var _0x54b7c5='%'+_0x45c0dc[_0xbb10('0x73')]+'%';_0x2a1ce1[_0xaf2cc3](_0xbb10('0x7a'),_0x54b7c5,_0x54b7c5,_0x54b7c5);}}else{_0x216cff=_[_0xbb10('0x7b')](_0x2dd02b,['name',_0xbb10('0x7c')]);_0x45c0dc[_0xbb10('0x59')]=_0xbb10('0x7c');_0x329da7=as['buildExpression'](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}break;case _0xbb10('0x7f'):var _0x108e5b=_0x45c0dc[_0xbb10('0x73')]['split'](',')[_0xbb10('0x3f')](function(_0x277fe7){return Number(_0x277fe7);});_0x108e5b[_0xbb10('0x43')](function(_0x2ceb3e){_0x4ea1a6['or'](_0xbb10('0x80'),'%,'+_0x2ceb3e+',%');});_0x4e7fac=_[_0xbb10('0x81')](_0x4e7fac,_0x108e5b);break;case _0xbb10('0x82'):if(_0x45c0dc['operator']==='$substring'){_0x2a1ce1[_0xaf2cc3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x45c0dc[_0xbb10('0x73')]+'%',null);}else{_0x216cff=_[_0xbb10('0x7b')](_0x2dd02b,[_0xbb10('0x38'),'UserId']);_0x45c0dc['field']=_0xbb10('0x83');_0x329da7=as[_0xbb10('0x84')](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}break;case _0xbb10('0x3a'):_0x329da7=as[_0xbb10('0x84')]('me',null,_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')]['start'],_0x329da7['value']['end']);break;}}else{var _0x329da7=as[_0xbb10('0x84')](_0x117e84,_0x216cff[_0xbb10('0x49')],_0x45c0dc);_0x2a1ce1[_0xaf2cc3](_0x329da7[_0xbb10('0x7d')],_0x329da7[_0xbb10('0x73')][_0xbb10('0x7e')],_0x329da7['value'][_0xbb10('0x2e')]);}}}else{var _0x4bc316=_(_0x4c66d8['query'])['keys']()[_0xbb10('0x3f')](function(_0x13040d){return _[_0xbb10('0x85')](_0x2dd02b,[_0xbb10('0x38'),_0x13040d])?_0x13040d:undefined;})['compact']()[_0xbb10('0x73')]();if(!_['isEmpty'](_0x4bc316)){_0x4bc316['forEach'](function(_0x165fe9){if(_0x165fe9===_0xbb10('0x86')){_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x87'),[][_0xbb10('0x88')](_0x4c66d8['query'][_0x165fe9]));}else if(_0x165fe9===_0xbb10('0x89')){var _0x19fcec=JSON[_0xbb10('0x8a')](_0x4c66d8[_0xbb10('0x4c')][_0x165fe9])[_0xbb10('0x8b')];var _0x27f42f=JSON[_0xbb10('0x8a')](_0x4c66d8['query'][_0x165fe9])[_0xbb10('0x8c')];_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x8d'),_0x19fcec,_0x27f42f);}else{if(_0x4c66d8[_0xbb10('0x4c')][_0x165fe9]===_0xbb10('0x8e')){_0x1d49e1[_0xbb10('0x56')]('i.'+_0x165fe9+_0xbb10('0x8f'));}else{_0x1d49e1[_0xbb10('0x56')]('i.'+_0x165fe9+'\x20=\x20?',_0x4c66d8[_0xbb10('0x4c')][_0x165fe9]);}}});}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x90')]){if(_0x4c66d8['query']['read']==0x1){_0x1d49e1['having'](_0xbb10('0x91'));}else{_0x1d49e1['having']('`unreadMessages`\x20>\x200');}}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]){_0x4e7fac=_[_0xbb10('0x93')](_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')])?_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]:new Array(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x92')]);_0x4e7fac['forEach'](function(_0x318a14){_0x4ea1a6['or'](_0xbb10('0x80'),'%,'+_0x318a14+',%');});}if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x94')]){var _0x5c8eb8=_0x4c66d8['query'][_0xbb10('0x94')][_0xbb10('0x95')]('\x5c','\x5c\x5c')[_0xbb10('0x95')](/'/g,'\x27\x27');if(qs[_0xbb10('0x96')](_0x5c8eb8)){_0x2a1ce1['or']('i.id\x20LIKE\x20?',_0x5c8eb8+'%');}else{_0x2a1ce1['or'](_0xbb10('0x97'),qs[_0xbb10('0x79')](_0x5c8eb8))['or'](_0xbb10('0x98'),_0x5c8eb8+'%');}}}_0x1d49e1[_0xbb10('0x56')](_0x2a1ce1);_0x1d49e1[_0xbb10('0x99')]('i.id');var _0x5f0691={'type':db[_0xbb10('0x9a')][_0xbb10('0x9b')][_0xbb10('0x9c')],'raw':!![]};var _0x5239da=_0x1d49e1[_0xbb10('0x9d')]();_0x5239da[_0xbb10('0x59')]('i.id');_0x5239da['field'](_0xbb10('0x9e'),_0xbb10('0x72'));if(_0x1d82bf[_0xbb10('0x9f')]){_0x1d82bf['order'][_0xbb10('0x43')](function(_0x3a17fc){var _0xfbb365=_0x3a17fc[0x0]===_0xbb10('0xa0')?_0x3a17fc[0x0]:'i.'+_0x3a17fc[0x0];_0x1d49e1[_0xbb10('0x9f')](_0xfbb365,_0x3a17fc[0x1]===_0xbb10('0xa1')?![]:!![]);});}if(!_[_0xbb10('0xa2')](_0x4e7fac)){_0x1d49e1[_0xbb10('0x74')](_0x4ea1a6);_0x5239da[_0xbb10('0x56')]('t.id\x20IN\x20?',_0x4e7fac);}BPromise[_0xbb10('0xa3')]()[_0xbb10('0x22')](function(){if(!_0x3e6338){if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x86')])return;_0x5239da[_0xbb10('0x56')](_0xbb10('0xa4'));_0x1d49e1[_0xbb10('0x56')](_0xbb10('0xa4'));return;}if(_0x4c66d8[_0xbb10('0xa5')][_0xbb10('0xa6')]!==_0xbb10('0xa7'))return;return _0x4c66d8[_0xbb10('0xa5')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0xe1fc51){if(_[_0xbb10('0xa2')](_0xe1fc51)){_0x5239da[_0xbb10('0x56')](_0xbb10('0xa8'));_0x1d49e1[_0xbb10('0x56')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x5239da[_0xbb10('0x56')](_0xbb10('0x87'),_[_0xbb10('0x3f')](_0xe1fc51,'id'));_0x1d49e1[_0xbb10('0x56')](_0xbb10('0x87'),_[_0xbb10('0x3f')](_0xe1fc51,'id'));}});})['then'](function(){if(_0x4c66d8[_0xbb10('0xa5')][_0xbb10('0xa6')]==='agent'&&!_0x3e6338&&!_0x4c66d8[_0xbb10('0x4c')]['ChatWebsiteId'])return[];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x5239da[_0xbb10('0xaa')](),_0x5f0691);})[_0xbb10('0x22')](function(_0x3a4a6e){_0x5cf4f8['count']=_0x3a4a6e[_0xbb10('0x51')];if(_0x5cf4f8['count']===0x0)return[];return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x1c0d8f['toString'](),_0x5f0691)['then'](function(_0x415407){_0x445870=_[_0xbb10('0xab')](_0x415407,'id');_0x5f0691=_[_0xbb10('0xac')](_0x5f0691,{'model':db[_0xbb10('0x46')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c66d8[_0xbb10('0x4c')][_0xbb10('0x50')]){_0x1d82bf[_0xbb10('0x4e')][_0xbb10('0x43')](function(_0x252ab8){_0x1d49e1[_0xbb10('0x59')]('i.'+_0x252ab8);});}else{_0x1d49e1[_0xbb10('0x59')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xbb10('0x72'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xad'),_0xbb10('0xae'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xaf'),_0xbb10('0xb0'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb1'),_0xbb10('0xa0'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb2'));_0x1d49e1['field'](_0xbb10('0xb3'),'Contact.firstName');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb4'),_0xbb10('0xb5'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb6'),'Contact.email');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb7'),_0xbb10('0xb8'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xb9'),_0xbb10('0xba'));_0x1d49e1['field']('c.fax',_0xbb10('0xbb'));_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbc'),'Owner.fullname');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbd'),'Owner.internal');_0x1d49e1[_0xbb10('0x59')](_0xbb10('0xbe'),'TagIds');}if(_0x1d82bf[_0xbb10('0x54')])_0x1d49e1['limit'](_0x1d82bf[_0xbb10('0x54')]);if(_0x1d82bf[_0xbb10('0x2f')])_0x1d49e1['offset'](_0x1d82bf[_0xbb10('0x2f')]);return db[_0xbb10('0xa9')]['query'](_0x1d49e1['toString'](),_0x5f0691);})[_0xbb10('0x22')](function(_0x13ae83){if(_0x13ae83[_0xbb10('0x51')]>0x0)_0x5bd44d[_0xbb10('0x56')](_0xbb10('0xbf'),_['map'](_0x13ae83,'id'));return db[_0xbb10('0xa9')][_0xbb10('0x4c')](_0x5bd44d[_0xbb10('0xaa')](),_0x5f0691)['then'](function(_0xd68afa){var _0x4f90e6=_[_0xbb10('0xc0')](_0xd68afa,_0xbb10('0xc1'));var _0x44a3e1=[];_0x13ae83[_0xbb10('0x43')](function(_0x1f55d3){_0x44a3e1[_0xbb10('0x44')](updateChatInteraction(_0x1f55d3,_0x445870,_0x4f90e6));});return BPromise[_0xbb10('0xc2')](_0x44a3e1);});});})['then'](function(_0x4fc544){_0x5cf4f8[_0xbb10('0xc3')]=_0x4fc544;return _0x5cf4f8;})[_0xbb10('0x22')](respondWithFilteredResult(_0x366608,_0x1d82bf))[_0xbb10('0xc4')](handleError(_0x366608,null));};exports[_0xbb10('0xc5')]=function(_0x20b585,_0x363b81){var _0x1cccec={'raw':![],'where':{'id':_0x20b585[_0xbb10('0xc6')]['id']}},_0x1674f7={};_0x1674f7[_0xbb10('0x4b')]=_[_0xbb10('0xc7')](db[_0xbb10('0x46')][_0xbb10('0x47')]);_0x1674f7['query']=_[_0xbb10('0xc7')](_0x20b585[_0xbb10('0x4c')]);_0x1674f7[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x1674f7[_0xbb10('0x4b')],_0x1674f7[_0xbb10('0x4c')]);_0x1cccec[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x1674f7[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x20b585[_0xbb10('0x4c')]['fields']));_0x1cccec[_0xbb10('0x4e')]=_0x1cccec['attributes'][_0xbb10('0x51')]?_0x1cccec[_0xbb10('0x4e')]:_0x1674f7[_0xbb10('0x4b')];if(_0x20b585[_0xbb10('0x4c')][_0xbb10('0xc8')]){_0x1cccec[_0xbb10('0xc9')]=[{'all':!![]}];}_0x1cccec=_['merge']({},_0x1cccec,_0x20b585[_0xbb10('0xca')]);return db['ChatInteraction'][_0xbb10('0x7b')](_0x1cccec)[_0xbb10('0x22')](handleEntityNotFound(_0x363b81,null))[_0xbb10('0x22')](respondWithResult(_0x363b81,null))[_0xbb10('0xc4')](handleError(_0x363b81,null));};exports[_0xbb10('0xcb')]=function(_0x31907e,_0x4f06c){return db[_0xbb10('0x46')][_0xbb10('0xcb')](_0x31907e[_0xbb10('0x3a')],{})[_0xbb10('0x22')](respondWithResult(_0x4f06c,0xc9))[_0xbb10('0xc4')](handleError(_0x4f06c,null));};exports['update']=function(_0x3696b3,_0x516520){if(_0x3696b3[_0xbb10('0x3a')]['id']){delete _0x3696b3[_0xbb10('0x3a')]['id'];}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x3696b3[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x516520,null))[_0xbb10('0x22')](saveUpdates(_0x3696b3['body'],null))[_0xbb10('0x22')](respondWithResult(_0x516520,null))['catch'](handleError(_0x516520,null));};exports['destroy']=function(_0x1513e0,_0x35cbb9){return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x1513e0[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x35cbb9,null))['then'](removeEntity(_0x35cbb9,null))[_0xbb10('0xc4')](handleError(_0x35cbb9,null));};exports[_0xbb10('0xcc')]=function(_0x39aa9e,_0xb1b7c8){return db[_0xbb10('0x46')][_0xbb10('0xcc')]()['then'](respondWithResult(_0xb1b7c8,null))[_0xbb10('0xc4')](handleError(_0xb1b7c8,null));};exports[_0xbb10('0xcd')]=function(_0xb7c454,_0xa8b7c3){var _0x31718f=_0xb7c454[_0xbb10('0xc6')]['id'];var _0x2764e1;var _0x5e405b;var _0x33a43e;return db['ChatInteraction'][_0xbb10('0xce')]({'where':{'id':_0x31718f}})['then'](function(_0x4c8b68){_0x2764e1=_0x4c8b68;return db[_0xbb10('0xcf')][_0xbb10('0xce')]({'where':{'id':_0x4c8b68[_0xbb10('0x86')]},'attributes':['id',_0xbb10('0xd0'),_0xbb10('0xd1'),'vidaooTopic',_0xbb10('0xd2'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x4dd138){if(_0x4dd138&&_0x4dd138[_0xbb10('0xd0')]&&_0x4dd138[_0xbb10('0xd1')]){_0x5e405b=_0x4dd138;var _0x1b9012={'interaction':{'id':_0x31718f},'agent':{'id':_0xb7c454[_0xbb10('0xa5')]['id'],'name':_0xb7c454[_0xbb10('0xa5')]['name'],'fullname':_0xb7c454[_0xbb10('0xa5')][_0xbb10('0x40')],'email':_0xb7c454[_0xbb10('0xa5')][_0xbb10('0xd3')]},'contact':_0xb7c454[_0xbb10('0x3a')][_0xbb10('0x3b')],'account':_0xb7c454[_0xbb10('0x3a')]['account']};var _0x4c95c2={'rejectUnauthorized':![],'method':'POST','url':_0xbb10('0xd4'),'headers':{'X-APIKEY':_0x4dd138[_0xbb10('0xd0')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0xb7c454[_0xbb10('0xa5')][_0xbb10('0xd3')]],'buttons':null,'topic':_0x5e405b[_0xbb10('0xd5')],'note':_[_0xbb10('0xd6')](_0x5e405b[_0xbb10('0xd2')])?null:getMustacheRender(_0x5e405b[_0xbb10('0xd2')],_0x1b9012),'metadata':null},'redirect':_0xbb10('0xd7'),'json':!![]};try{if(!_[_0xbb10('0xd6')](_0x5e405b['vidaooMetadata'])){var _0x58295f=getMustacheRender(_0x5e405b['vidaooMetadata'],_0x1b9012);var _0x3d4b89=JSON[_0xbb10('0x8a')](_0x58295f);_0x4c95c2[_0xbb10('0x3a')]['metadata']=_0x3d4b89;}}catch(_0x2bfa8e){throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xd9'));}return rp(_0x4c95c2);}else{throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x356660){_0x33a43e=_0x356660;if(_0x33a43e['id']){var _0x48889b={'body':_0x33a43e[_0xbb10('0xda')],'ChatWebsiteId':_0x5e405b['id'],'ChatInteractionId':_0x2764e1['id'],'direction':_0xbb10('0xdb'),'UserId':_0xb7c454[_0xbb10('0xa5')]['id']};return db[_0xbb10('0xdc')][_0xbb10('0xcb')](_0x48889b,{});}else{throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xdd'));}})[_0xbb10('0x22')](function(){return _0x2764e1[_0xbb10('0xde')]({'vidaooSessionId':_0x33a43e['id']});})['then'](respondWithResult(_0xa8b7c3,null))[_0xbb10('0xc4')](handleError(_0xa8b7c3,null));};exports['customUpdate']=function(_0x27bed2,_0x5547fa){if(_0x27bed2[_0xbb10('0x3a')]['id']){delete _0x27bed2[_0xbb10('0x3a')]['id'];}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0x27bed2['params']['id']},'include':[{'model':db[_0xbb10('0xdf')],'as':'Contact'}]})[_0xbb10('0x22')](handleEntityNotFound(_0x5547fa,null))[_0xbb10('0x22')](saveUpdates(_0x27bed2[_0xbb10('0x3a')],null))['then'](respondWithResult(_0x5547fa,null))[_0xbb10('0xc4')](handleError(_0x5547fa,null));};exports[_0xbb10('0xe0')]=function(_0x140173,_0x18a44f,_0x11d31b){if(_0x140173[_0xbb10('0x3a')]['id']){delete _0x140173['body']['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x140173[_0xbb10('0xc6')]['id']}})['then'](function(_0x318908){if(!_0x318908){logger['error'](_0xbb10('0xe1'),_0xbb10('0xe0'),0x194,_0xbb10('0xe2'));_0x18a44f['sendStatus'](0x194);}else{if(_0x318908['UserId']){throw new db[(_0xbb10('0x9a'))][(_0xbb10('0xd8'))](_0xbb10('0xe3'));}}return _0x318908;})['then'](function(_0x440108){if(_0x440108){return _0x440108[_0xbb10('0x36')]({'closed':_0x140173[_0xbb10('0x3a')]['closed'],'disposition':_0x140173['body']['disposition']})[_0xbb10('0x22')](function(_0x55aa03){return _0x55aa03;});}})[_0xbb10('0x22')](function(_0x1c2c95){return respondWithRpcPromise(_0xbb10('0xe4'),_0xbb10('0xe0'),_0x140173[_0xbb10('0x3a')],client9004);})[_0xbb10('0x22')](respondWithResult(_0x18a44f,null))[_0xbb10('0xc4')](handleError(_0x18a44f,null));};exports[_0xbb10('0xe5')]=function(_0x2746eb,_0x431792,_0x2e2710){_0x2746eb['body'][_0xbb10('0x38')]=_0x2746eb[_0xbb10('0xe6')]['originalname'];_0x2746eb[_0xbb10('0x3a')]['basename']=_0x2746eb['file'][_0xbb10('0xe7')];_0x2746eb[_0xbb10('0x3a')][_0xbb10('0x49')]=_0x2746eb[_0xbb10('0xe6')][_0xbb10('0xe8')];return db['Attachment'][_0xbb10('0xcb')](_0x2746eb[_0xbb10('0x3a')])['then'](respondWithResult(_0x431792,0xc9))[_0xbb10('0xc4')](handleError(_0x431792,null));};exports[_0xbb10('0xe9')]=function(_0x5a82e7,_0x424c96,_0x4c769b){return db[_0xbb10('0x46')][_0xbb10('0xce')]({'where':{'id':_0x5a82e7[_0xbb10('0xc6')]['id']},'raw':!![]})[_0xbb10('0x22')](handleEntityNotFound(_0x424c96,null))[_0xbb10('0x22')](function(_0x20b312){if(_0x20b312){if(_0x20b312[_0xbb10('0xea')]){return _0x424c96['status'](0x193)[_0xbb10('0x33')]({'status':0x193,'message':_0xbb10('0xeb')});}return db[_0xbb10('0xec')][_0xbb10('0xce')]({'where':{'id':_0x5a82e7[_0xbb10('0x4c')][_0xbb10('0xed')]},'raw':!![]})['then'](handleEntityNotFound(_0x424c96,null));}})['then'](function(_0x5a40e8){if(_0x5a40e8){var _0x23849e=_0x5a40e8[_0xbb10('0xee')]!==null;var _0x3e1a86=path[_0xbb10('0xef')](config['root'],_0xbb10('0xf0'));if(_0x23849e){_0x3e1a86=path[_0xbb10('0xef')](_0x3e1a86,_0xbb10('0xf1'));}var _0x577d27=path['join'](_0x3e1a86,_0x5a40e8[_0xbb10('0xf2')]);return _0x424c96['download'](_0x577d27);}})[_0xbb10('0xc4')](handleError(_0x424c96,null));};exports[_0xbb10('0xf3')]=function(_0xb9bc5a,_0x42276f){var _0x425505=null;var _0xcb61bb=null;var _0x1fe250=null;var _0x57933f=null;if(_0xb9bc5a[_0xbb10('0x3a')]['id']){delete _0xb9bc5a[_0xbb10('0x3a')]['id'];}if(_0xb9bc5a['body'][_0xbb10('0xf4')]){_0x57933f=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],'server/files/chat/upload/',util['format']('transcript-%s.txt',Date[_0xbb10('0xf6')]()));_0xb9bc5a[_0xbb10('0x3a')]['pathTranscript']=_0x57933f;}return db[_0xbb10('0x46')][_0xbb10('0x7b')]({'where':{'id':_0xb9bc5a[_0xbb10('0xc6')]['id']},'include':[{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xf7'),'include':[{'model':db[_0xbb10('0x82')],'as':_0xbb10('0x82')}]}]})['then'](handleEntityNotFound(_0x42276f,null))[_0xbb10('0x22')](saveUpdates(_0xb9bc5a['body'],null))['then'](function(_0x4aa0d7){if(_0x4aa0d7){_0x425505=_0x4aa0d7;return db[_0xbb10('0xcf')][_0xbb10('0x7b')]({'where':{'id':_0x425505['ChatWebsiteId']}});}})[_0xbb10('0x22')](function(_0x49f324){if(_0x49f324){_0x1fe250=_0x49f324;return db[_0xbb10('0xdf')][_0xbb10('0x7b')]({'where':{'id':_0x425505[_0xbb10('0x7c')]}});}})['then'](function(_0x4d10ea){if(_0x4d10ea){_0xcb61bb=_0x4d10ea;if(_0x57933f){var _0x447c0d=null;for(var _0x502e73=0x1;_0x502e73<_0x425505[_0xbb10('0xf7')][_0xbb10('0x51')];++_0x502e73){_0x447c0d=_0x425505['Messages'][_0x502e73];var _0x50cd00=_0x447c0d[_0xbb10('0x83')]?util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0x1fe250['agentAlias'],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');var _0x22f153=_0xb9bc5a['body'][_0xbb10('0xfb')]||util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0xbb10('0xfc'),_0x447c0d[_0xbb10('0x7c')]);switch(_0x1fe250[_0xbb10('0xfd')]){case _0xbb10('0xfe'):_0x50cd00=_0x447c0d[_0xbb10('0x83')]?util[_0xbb10('0xf8')](_0xbb10('0xf9'),_0x1fe250[_0xbb10('0xff')],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');break;case'agent_alias':_0x50cd00=_0x447c0d['UserId']?_0x447c0d[_0xbb10('0x82')]['alias']||_0x447c0d[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa');break;case'agent_fullname':_0x50cd00=_0x447c0d[_0xbb10('0x83')]?_0x447c0d[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa');break;default:_0x50cd00=_0x447c0d[_0xbb10('0x83')]?util['format'](_0xbb10('0xf9'),_0x1fe250[_0xbb10('0xff')],_0x447c0d[_0xbb10('0x83')]):_0xbb10('0xfa');}var _0x150d4c=util[_0xbb10('0xf8')]('[%s]\x20%s:\x20%s\x0a',moment(_0x447c0d[_0xbb10('0x89')])[_0xbb10('0xf8')]('MM/DD/YYYY\x20HH:mm:ss'),_0x447c0d[_0xbb10('0x100')]==='in'?_0x22f153:_0x50cd00,_0x447c0d[_0xbb10('0x3a')]);if(!_0x447c0d[_0xbb10('0x101')]){fs[_0xbb10('0x102')](_0x57933f,_0x150d4c);}}return db[_0xbb10('0x103')][_0xbb10('0xce')]({'where':{'service':!![]},'include':[{'model':db[_0xbb10('0x104')],'as':_0xbb10('0x105'),'raw':!![]}]});}}})[_0xbb10('0x22')](function(_0x33d1b7){if(_0x33d1b7&&_0x33d1b7[_0xbb10('0x105')]&&_0xb9bc5a[_0xbb10('0x3a')]){var _0x1db646={'tls':{'rejectUnauthorized':![]}};if(_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x106')]){_0x1db646['service']=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x106')];}else{_0x1db646['host']=_0x33d1b7['Smtp'][_0xbb10('0x107')];_0x1db646[_0xbb10('0x108')]=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x108')];_0x1db646[_0xbb10('0x109')]=_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x109')];}if(_0x33d1b7[_0xbb10('0x105')][_0xbb10('0x10a')]){_0x1db646['auth']={'user':_0x33d1b7['Smtp']['user'],'pass':_0x33d1b7['Smtp']['pass']};}return respondWithRpcPromise('SendMail',_0xbb10('0x10b'),{'account':_0x1db646,'message':{'from':util[_0xbb10('0xf8')](_0xbb10('0x10c'),_0x33d1b7[_0xbb10('0x38')],_0x33d1b7['email']||_0x33d1b7[_0xbb10('0x105')][_0xbb10('0xa5')]),'to':_0xb9bc5a[_0xbb10('0x3a')][_0xbb10('0xf4')],'subject':'Mail\x20Transcript','text':util['format'](_0xbb10('0x10d'),_0xb9bc5a[_0xbb10('0x3a')]['mailTranscript']),'attachments':[{'path':_0x57933f}]}})['then'](function(){return _0x425505;})[_0xbb10('0xc4')](function(_0xf1371a){console[_0xbb10('0x28')](_0xf1371a);});}else{return _0x425505;}})[_0xbb10('0x22')](respondWithStatusCode(_0x42276f,0xc8))[_0xbb10('0xc4')](handleError(_0x42276f,null));};exports['addMessage']=function(_0x4744f4,_0x5382e9,_0x4c97b9){return db[_0xbb10('0xdc')][_0xbb10('0x7b')]({'where':{'id':_0x4744f4[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5382e9,null))[_0xbb10('0x22')](function(_0x21c0fd){if(_0x21c0fd){return _0x21c0fd['addMessage'](_0x4744f4[_0xbb10('0x3a')][_0xbb10('0x10e')],_[_0xbb10('0x10f')](_0x4744f4[_0xbb10('0x3a')],[_0xbb10('0x10e'),'id'])||{});}})[_0xbb10('0x22')](respondWithResult(_0x5382e9,null))[_0xbb10('0xc4')](handleError(_0x5382e9,null));};exports[_0xbb10('0x110')]=function(_0x233d5e,_0x16f3ce,_0xbae19c){var _0x26f4b0={'raw':![],'where':{}};var _0x1dbf7b={};var _0x117e95={'count':0x0,'rows':[]};return db[_0xbb10('0x46')][_0xbb10('0xce')]({'where':{'id':_0x233d5e[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x16f3ce,null))[_0xbb10('0x22')](function(_0x43a203){if(_0x43a203){_0x1dbf7b[_0xbb10('0x4b')]=_[_0xbb10('0xc7')](db['ChatMessage'][_0xbb10('0x47')]);_0x1dbf7b['query']=_[_0xbb10('0xc7')](_0x233d5e[_0xbb10('0x4c')]);_0x1dbf7b[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x1dbf7b[_0xbb10('0x4b')],_0x1dbf7b['query']);_0x26f4b0['attributes']=_['intersection'](_0x1dbf7b[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x233d5e['query'][_0xbb10('0x50')]));_0x26f4b0[_0xbb10('0x4e')]=_0x26f4b0[_0xbb10('0x4e')]['length']?_0x26f4b0[_0xbb10('0x4e')]:_0x1dbf7b[_0xbb10('0x4b')];if(!_0x233d5e[_0xbb10('0x4c')]['hasOwnProperty'](_0xbb10('0x53'))){_0x26f4b0['limit']=qs[_0xbb10('0x54')](_0x233d5e['query']['limit']);_0x26f4b0['offset']=qs['offset'](_0x233d5e['query']['offset']);}_0x26f4b0[_0xbb10('0x9f')]=qs[_0xbb10('0x55')](_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x26f4b0['where']=qs[_0xbb10('0x4d')](_[_0xbb10('0x57')](_0x233d5e[_0xbb10('0x4c')],_0x1dbf7b[_0xbb10('0x4d')]));_0x26f4b0[_0xbb10('0x56')][_0xbb10('0xc1')]=_0x43a203['id'];if(_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x94')]){_0x26f4b0[_0xbb10('0x56')]=_[_0xbb10('0xac')](_0x26f4b0['where'],{'$or':_[_0xbb10('0x3f')](_0x26f4b0[_0xbb10('0x4e')],function(_0x288ccc){var _0x5c5ecc={};_0x5c5ecc[_0x288ccc]={'$like':'%'+_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x94')]+'%'};return _0x5c5ecc;})});}if(_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x8b')]){var _0x5b2292=_0x233d5e[_0xbb10('0x4c')][_0xbb10('0x8b')][_0xbb10('0x111')](',');var _0x22ec50={};_0x22ec50[_0x5b2292[0x0]]={'$gte':moment(_0x5b2292[0x1])[_0xbb10('0xf8')](_0xbb10('0x112'))};_0x26f4b0[_0xbb10('0x56')]=_[_0xbb10('0xac')](_0x26f4b0[_0xbb10('0x56')],_0x22ec50);}_0x26f4b0=_[_0xbb10('0xac')]({},_0x26f4b0,_0x233d5e[_0xbb10('0xca')]);return db['ChatMessage'][_0xbb10('0x31')]({'where':_0x26f4b0[_0xbb10('0x56')]})['then'](function(_0x5eb1fb){_0x117e95[_0xbb10('0x31')]=_0x5eb1fb;if(_0x233d5e[_0xbb10('0x4c')]['includeAll']){_0x26f4b0[_0xbb10('0xc9')]=[{'all':!![]}];}return db[_0xbb10('0xdc')]['findAll'](_0x26f4b0);})[_0xbb10('0x22')](function(_0x42441e){_0x117e95[_0xbb10('0xc3')]=_0x42441e;return _0x117e95;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x16f3ce,_0x26f4b0))[_0xbb10('0xc4')](handleError(_0x16f3ce,null));};exports['getMyMessages']=function(_0x4fc260,_0x5a502c,_0xaeaa51){var _0x4db9ad={'where':{}},_0x43deea={},_0x53e73e={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbb10('0xce')]({'where':{'id':_0x4fc260[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x5a502c,null))[_0xbb10('0x22')](function(_0x2527f4){if(_0x2527f4){_0x43deea[_0xbb10('0x4b')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x43deea[_0xbb10('0x4c')]=_[_0xbb10('0xc7')](_0x4fc260[_0xbb10('0x4c')]);_0x43deea[_0xbb10('0x4d')]=_[_0xbb10('0x4f')](_0x43deea[_0xbb10('0x4b')],_0x43deea[_0xbb10('0x4c')]);_0x4db9ad['attributes']=_[_0xbb10('0x4f')](_0x43deea[_0xbb10('0x4b')],qs[_0xbb10('0x50')](_0x4fc260[_0xbb10('0x4c')]['fields']));_0x4db9ad[_0xbb10('0x4e')]=_0x4db9ad['attributes']['length']?_0x4db9ad[_0xbb10('0x4e')]:_0x43deea[_0xbb10('0x4b')];if(!_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x52')](_0xbb10('0x53'))){_0x4db9ad[_0xbb10('0x54')]=qs['limit'](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x54')]);_0x4db9ad[_0xbb10('0x2f')]=qs[_0xbb10('0x2f')](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x2f')]);}_0x4db9ad[_0xbb10('0x9f')]=qs['sort'](_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x55')]);_0x4db9ad[_0xbb10('0x56')]=qs['filters'](_['pick'](_0x4fc260[_0xbb10('0x4c')],_0x43deea[_0xbb10('0x4d')]));_0x4db9ad[_0xbb10('0x56')][_0xbb10('0xc1')]=_0x2527f4['id'];if(_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x94')]){_0x4db9ad[_0xbb10('0x56')]=_['merge'](_0x4db9ad[_0xbb10('0x56')],{'$or':_[_0xbb10('0x3f')](_0x4db9ad[_0xbb10('0x4e')],function(_0x55ba78){var _0x5e195a={};_0x5e195a[_0x55ba78]={'$like':'%'+_0x4fc260['query']['filter']+'%'};return _0x5e195a;})});}_0x4db9ad[_0xbb10('0x56')][_0xbb10('0x101')]=![];if(_0x4fc260[_0xbb10('0x4c')]['id']){_0x4db9ad[_0xbb10('0x56')]['id']={'$gt':_0x4fc260['query']['id']};}_0x4db9ad=_[_0xbb10('0xac')]({},_0x4db9ad,_0x4fc260['options']);return db[_0xbb10('0xdc')][_0xbb10('0x31')]({'where':_0x4db9ad[_0xbb10('0x56')]})[_0xbb10('0x22')](function(_0xa16287){_0x53e73e[_0xbb10('0x31')]=_0xa16287;_0x4db9ad[_0xbb10('0xc9')]=[];if(_0x4fc260[_0xbb10('0x4c')][_0xbb10('0x113')]){_0x4db9ad[_0xbb10('0xc9')][_0xbb10('0x44')]({'model':db[_0xbb10('0x82')],'as':'User','attributes':['id',_0xbb10('0x40'),_0xbb10('0x114')]});}if(_0x4fc260[_0xbb10('0x4c')]['includeAll']){_0x4db9ad[_0xbb10('0xc9')]=[{'all':!![]}];}return db['ChatMessage'][_0xbb10('0x115')](_0x4db9ad);})[_0xbb10('0x22')](function(_0x280119){_0x53e73e[_0xbb10('0xc3')]=_0x280119;return _0x53e73e;});}})[_0xbb10('0x22')](respondWithFilteredResult(_0x5a502c,_0x4db9ad))['catch'](handleError(_0x5a502c,null));};exports['addTags']=function(_0x842d94,_0x4cf5cc,_0x553bb8){return db[_0xbb10('0x46')]['find']({'where':{'id':_0x842d94[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4cf5cc,null))[_0xbb10('0x22')](function(_0x4469c4){if(_0x4469c4){return _0x4469c4[_0xbb10('0x116')](_0x842d94[_0xbb10('0x3a')][_0xbb10('0x10e')],_[_0xbb10('0x10f')](_0x842d94['body'],[_0xbb10('0x10e'),'id'])||{})['spread'](function(){return db[_0xbb10('0x7f')]['findAll']({'attributes':['id',_0xbb10('0x38'),_0xbb10('0x5a')],'where':{'id':_0x842d94['body'][_0xbb10('0x10e')]}});})[_0xbb10('0x22')](function(_0x1bb072){socket['emit'](_0xbb10('0x117'),{'id':Number(_0x842d94[_0xbb10('0xc6')]['id']),'tags':_0x1bb072||[]});return{'id':Number(_0x842d94[_0xbb10('0xc6')]['id']),'tags':_0x1bb072||[]};});}})['then'](respondWithResult(_0x4cf5cc,null))[_0xbb10('0xc4')](handleError(_0x4cf5cc,null));};exports[_0xbb10('0x118')]=function(_0x46df90,_0x4b781e,_0x3e6756){return db['ChatInteraction'][_0xbb10('0x7b')]({'where':{'id':_0x46df90[_0xbb10('0xc6')]['id']}})[_0xbb10('0x22')](handleEntityNotFound(_0x4b781e,null))[_0xbb10('0x22')](function(_0x583a3e){if(_0x583a3e){return _0x583a3e[_0xbb10('0x118')](_0x46df90[_0xbb10('0x4c')][_0xbb10('0x10e')]);}})[_0xbb10('0x22')](respondWithStatusCode(_0x4b781e,null))[_0xbb10('0xc4')](handleError(_0x4b781e,null));};exports['download']=function(_0x4b10ed,_0x40b5da){var _0x4739a6=moment()[_0xbb10('0x119')]()['toString']();var _0x3d5870=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],_0xbb10('0x11a'),_0xbb10('0x11b'),_0xbb10('0x11c'));var _0x81d970=path[_0xbb10('0xef')](config[_0xbb10('0xf5')],'server',_0xbb10('0x11b'),_0xbb10('0x11d'));var _0x4102af=path[_0xbb10('0xef')](_0x3d5870,_0x4739a6);var _0x4d49a7=util[_0xbb10('0xf8')](_0xbb10('0x11e'),_0x4b10ed[_0xbb10('0xc6')]['id'],_0x4739a6);var _0x59fef2=path['join'](_0x3d5870,_0x4d49a7);var _0x3b45c4=[];_0x3b45c4['push']({'model':db[_0xbb10('0x82')],'as':'User','attributes':['id',_0xbb10('0x40')],'raw':!![]});_0x3b45c4[_0xbb10('0x44')]({'model':db[_0xbb10('0xdf')],'as':_0xbb10('0x11f'),'attributes':['id',_0xbb10('0x120'),_0xbb10('0x121')],'raw':!![]});if(_0x4b10ed[_0xbb10('0x4c')]['attachments']){_0x3b45c4[_0xbb10('0x44')]({'model':db[_0xbb10('0xec')],'as':_0xbb10('0xec'),'raw':!![]});}var _0x2807d2=[{'model':db[_0xbb10('0xdc')],'as':_0xbb10('0xf7'),'attributes':['id','body',_0xbb10('0x89'),_0xbb10('0x100'),_0xbb10('0x101'),_0xbb10('0x90')],'include':_0x3b45c4}];_0x2807d2[_0xbb10('0x44')]({'model':db[_0xbb10('0xcf')],'as':_0xbb10('0x122'),'attributes':['id','name']});_0x2807d2[_0xbb10('0x44')]({'model':db[_0xbb10('0x82')],'as':_0xbb10('0x123'),'attributes':['id','fullname']});return db[_0xbb10('0x46')]['find']({'where':{'id':_0x4b10ed[_0xbb10('0xc6')]['id']},'include':_0x2807d2})[_0xbb10('0x22')](handleEntityNotFound(_0x40b5da,null))[_0xbb10('0x22')](function(_0x58a447){if(_0x58a447){var _0x50fa4e=_0x58a447[_0xbb10('0x124')]({'plain':!![]});fs[_0xbb10('0x125')](_0x4102af);var _0xbb410e={'channel':_0xbb10('0x126'),'account':_0x50fa4e[_0xbb10('0x122')][_0xbb10('0x38')],'agent':_0x50fa4e[_0xbb10('0x123')]?_0x50fa4e[_0xbb10('0x123')][_0xbb10('0x40')]:_0xbb10('0x127'),'createdAt':moment(_0x50fa4e[_0xbb10('0x89')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xbb10('0xaa')](),'closedAt':_0x50fa4e[_0xbb10('0xea')]?moment(_0x50fa4e['closedAt'])['format'](_0xbb10('0x112'))[_0xbb10('0xaa')]():'','disposition':_0x50fa4e[_0xbb10('0x128')],'chatInfo':{'browser':_0x50fa4e['browserName'],'os':_0x50fa4e[_0xbb10('0x129')],'referer':_0x50fa4e[_0xbb10('0x12a')],'customerIp':_0x50fa4e['customerIp'],'customerPort':_0x50fa4e[_0xbb10('0x12b')]?_0x50fa4e[_0xbb10('0x12b')]:'N.A.'},'messages':_(_0x50fa4e['Messages'])[_0xbb10('0x12c')]()[_0xbb10('0x94')]({'secret':![]})[_0xbb10('0x3f')](function(_0x5cab64){if(_0x5cab64['Attachment']){var _0x58ee41=path[_0xbb10('0xef')](_0x81d970,_0x5cab64['Attachment'][_0xbb10('0xf2')]);if(fs[_0xbb10('0x12d')](_0x58ee41)){fs['createReadStream'](_0x58ee41)[_0xbb10('0x12e')](fs[_0xbb10('0x12f')](path[_0xbb10('0xef')](_0x4102af,_0x5cab64[_0xbb10('0xec')]['basename'])));}}return{'date':moment(_0x5cab64[_0xbb10('0x89')])['format'](_0xbb10('0x112'))[_0xbb10('0xaa')](),'sender':_0x5cab64[_0xbb10('0x100')]===_0xbb10('0xdb')?_0x5cab64[_0xbb10('0x82')]?_0x5cab64[_0xbb10('0x82')][_0xbb10('0x40')]:_0xbb10('0xfa'):_0x5cab64['Contact'][_0xbb10('0x120')]+(_0x5cab64[_0xbb10('0x11f')][_0xbb10('0x121')]?'\x20'+_0x5cab64[_0xbb10('0x11f')]['lastName']:''),'body':_0x5cab64['Attachment']?_0x5cab64[_0xbb10('0xec')][_0xbb10('0xf2')]:_0x5cab64[_0xbb10('0x3a')],'direction':_0x5cab64[_0xbb10('0x100')]==='out'?'A':'C','secret':_0x5cab64[_0xbb10('0x101')],'read':_0x5cab64[_0xbb10('0x90')],'attachment':_0x5cab64['Attachment']};})[_0xbb10('0x73')]()};return ejs['renderFile'](path['join'](config[_0xbb10('0xf5')],_0xbb10('0x11a'),_0xbb10('0x130'),_0xbb10('0x131')),{'interaction':_0xbb410e})[_0xbb10('0x22')](function(_0x4aa76a){var _0x38403e=path[_0xbb10('0xef')](_0x4102af,_0xbb10('0x132')+_0x50fa4e['id']+'-'+_0x4739a6+_0xbb10('0x133'));var _0x1b7274={'path':_0x38403e,'channel':_0xbb10('0x126'),'interactionId':_0x50fa4e['id']};return pdf[_0xbb10('0x134')](_0x4aa76a,_0x1b7274);})[_0xbb10('0x22')](function(){return new BPromise(function(_0x34f4d6,_0x254b6e){zipdir(_0x4102af,{'saveTo':_0x59fef2},function(_0x368adb,_0xef4ccf){if(_0x368adb)return _0x254b6e(_0x368adb);return _0x34f4d6(_0xef4ccf);});})[_0xbb10('0x22')](function(){return new BPromise(function(_0x9fcc26,_0x111fd4){rimraf(_0x4102af,function(_0x256ce9){if(_0x256ce9)_0x111fd4(_0x256ce9);return _0x9fcc26();});});})[_0xbb10('0x22')](function(){return _0x40b5da[_0xbb10('0x135')](_0x59fef2,_0x4d49a7,function(_0x27e0c5){if(_0x27e0c5){console[_0xbb10('0x136')](_0xbb10('0x137'),_0x27e0c5);}else{fs[_0xbb10('0x138')](_0x59fef2);}});});});}else{return _0x40b5da[_0xbb10('0x2c')](0xc8);}})[_0xbb10('0xc4')](handleError(_0x40b5da,null));};
\ No newline at end of file
+var _0xef0f=['alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','mailTranscript','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','hasOwnProperty','includeAgent','addTags','setTags','omit','emit','removeTags','download','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','mkdirSync','Chat','Owner','N.A.','browserName','osName','existsSync','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','offset','undefined','limit','set','Content-Range','save','update','destroy','end','stack','name','send','render','body','contact','interaction','account','Users','TagIds','Tags','split','forEach','push','index','ChatInteraction','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','select','field','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','length','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','type','text','start','Tag','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`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','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','agent','getChatWebsites','ChatWebsiteId','sequelize','toString','count','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','contactName','Contact.firstName','Contact.lastName','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','keys','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooEscalation','vidaooTopic','vidaooMetadata','vidaooApiKey','email','isNull','vidaooNote','follow','metadata','ValidationError','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','originalname','basename','file','filename','mimetype','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','server/files/chat/upload/','format','now','Messages','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias'];(function(_0x483dba,_0x1a3942){var _0x15b8c7=function(_0x514902){while(--_0x514902){_0x483dba['push'](_0x483dba['shift']());}};_0x15b8c7(++_0x1a3942);}(_0xef0f,0x168));var _0xfef0=function(_0x15beb5,_0x206a03){_0x15beb5=_0x15beb5-0x0;var _0x213c61=_0xef0f[_0x15beb5];return _0x213c61;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var pdf=require(_0xfef0('0x14'));var hardwareService=require(_0xfef0('0x15'));var logger=require(_0xfef0('0x16'))(_0xfef0('0x17'));var utils=require(_0xfef0('0x18'));var config=require(_0xfef0('0x19'));var licenseUtil=require(_0xfef0('0x1a'));var db=require('../../mysqldb')['db'];config[_0xfef0('0x1b')]=_[_0xfef0('0x1c')](config[_0xfef0('0x1b')],{'host':_0xfef0('0x1d'),'port':0x18eb});var socket=require(_0xfef0('0x1e'))(new Redis(config[_0xfef0('0x1b')]));require(_0xfef0('0x1f'))['register'](socket);var jayson=require(_0xfef0('0x20'));var client=jayson['client']['http']({'port':0x232b});var client9004=jayson['client'][_0xfef0('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x284b6d,_0x3510a7,_0x1bce2f,_0x2a96d9){return new BPromise(function(_0x3f9a6c,_0x155833){var _0x2887e6=_0x2a96d9||client;return _0x2887e6['request'](_0x284b6d,_0x1bce2f)[_0xfef0('0x22')](function(_0x1642cd){logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));logger['debug'](_0xfef0('0x26'),_0x3510a7,'request\x20sent',JSON[_0xfef0('0x27')](_0x1642cd));if(_0x1642cd[_0xfef0('0x28')]){if(_0x1642cd[_0xfef0('0x28')]['code']===0x1f4){logger[_0xfef0('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x3510a7,_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);return _0x155833(_0x1642cd['error']['message']);}logger['error'](_0xfef0('0x24'),_0x3510a7,_0x1642cd['error'][_0xfef0('0x29')]);return _0x3f9a6c(_0x1642cd[_0xfef0('0x28')][_0xfef0('0x29')]);}else{logger[_0xfef0('0x23')](_0xfef0('0x24'),_0x3510a7,_0xfef0('0x25'));_0x3f9a6c(_0x1642cd['result']['message']);}})[_0xfef0('0x2a')](function(_0x1ffaa4){logger[_0xfef0('0x28')](_0xfef0('0x24'),_0x3510a7,_0x1ffaa4);_0x155833(_0x1ffaa4);});});}function respondWithStatusCode(_0xab231c,_0xf60f2){_0xf60f2=_0xf60f2||0xcc;return function(_0x5df04f){if(_0x5df04f){return _0xab231c[_0xfef0('0x2b')](_0xf60f2);}return _0xab231c[_0xfef0('0x2c')](_0xf60f2)['end']();};}function respondWithResult(_0x1a6758,_0x394bad){_0x394bad=_0x394bad||0xc8;return function(_0xca0cce){if(_0xca0cce){return _0x1a6758[_0xfef0('0x2c')](_0x394bad)[_0xfef0('0x2d')](_0xca0cce);}};}function respondWithFilteredResult(_0x1ac4a3,_0x3e3c4c){return function(_0x3e026a){if(_0x3e026a){var _0x26cb9a=typeof _0x3e3c4c[_0xfef0('0x2e')]===_0xfef0('0x2f')&&typeof _0x3e3c4c[_0xfef0('0x30')]==='undefined';var _0x445625=_0x3e026a['count'];var _0x4eaf74=_0x26cb9a?0x0:_0x3e3c4c[_0xfef0('0x2e')];var _0x2ae54a=_0x26cb9a?_0x3e026a['count']:_0x3e3c4c['offset']+_0x3e3c4c['limit'];var _0x4f65cd;if(_0x2ae54a>=_0x445625){_0x2ae54a=_0x445625;_0x4f65cd=0xc8;}else{_0x4f65cd=0xce;}_0x1ac4a3['status'](_0x4f65cd);return _0x1ac4a3[_0xfef0('0x31')](_0xfef0('0x32'),_0x4eaf74+'-'+_0x2ae54a+'/'+_0x445625)[_0xfef0('0x2d')](_0x3e026a);}return null;};}function patchUpdates(_0x5cda6b){return function(_0x4d0778){try{jsonpatch['apply'](_0x4d0778,_0x5cda6b,!![]);}catch(_0x1f8110){return BPromise['reject'](_0x1f8110);}return _0x4d0778[_0xfef0('0x33')]();};}function saveUpdates(_0x3783f9,_0x1b9f39){return function(_0x4a2773){if(_0x4a2773){return _0x4a2773[_0xfef0('0x34')](_0x3783f9)['then'](function(_0x4234e4){return _0x4234e4;});}return null;};}function removeEntity(_0x1f21b7,_0x234d49){return function(_0xe5188e){if(_0xe5188e){return _0xe5188e[_0xfef0('0x35')]()[_0xfef0('0x22')](function(){_0x1f21b7[_0xfef0('0x2c')](0xcc)[_0xfef0('0x36')]();});}};}function handleEntityNotFound(_0x590e37,_0x24ea7c){return function(_0xea09ec){if(!_0xea09ec){_0x590e37[_0xfef0('0x2b')](0x194);}return _0xea09ec;};}function handleError(_0x36b2d1,_0xae697){_0xae697=_0xae697||0x1f4;return function(_0x262341){logger[_0xfef0('0x28')](_0x262341[_0xfef0('0x37')]);if(_0x262341[_0xfef0('0x38')]){delete _0x262341[_0xfef0('0x38')];}_0x36b2d1[_0xfef0('0x2c')](_0xae697)[_0xfef0('0x39')](_0x262341);};}function getMustacheRender(_0x366667,_0x4a8af4){return Mustache[_0xfef0('0x3a')](_0x366667,_['merge'](_0x4a8af4[_0xfef0('0x3b')],{'contact':_0x4a8af4[_0xfef0('0x3c')],'message':_0x4a8af4[_0xfef0('0x29')],'agent':_0x4a8af4['agent'],'interaction':_0x4a8af4[_0xfef0('0x3d')],'account':_0x4a8af4[_0xfef0('0x3e')]}))||'';}function getInteractionUsers(_0x3f2753,_0x5537c8){return new BPromise(function(_0x8613a0,_0x3abcc5){try{if(_0x5537c8[_0x3f2753['id']]){_0x3f2753[_0xfef0('0x3f')]=_['map'](_0x5537c8[_0x3f2753['id']],function(_0x3a6667){return{'id':_0x3a6667['id'],'fullname':_0x3a6667['fullname']};});}}catch(_0x49ed48){_0x3abcc5(_0x49ed48);}_0x8613a0(_0x3f2753);});}function getInteractionTags(_0xf30aff,_0x547a5d){return new BPromise(function(_0x5c3305,_0xbf6ddd){try{if(_0xf30aff[_0xfef0('0x40')]){_0xf30aff[_0xfef0('0x41')]=[];_0xf30aff[_0xfef0('0x40')][_0xfef0('0x42')](',')[_0xfef0('0x43')](function(_0x4dd8f8){_0xf30aff[_0xfef0('0x41')][_0xfef0('0x44')](_0x547a5d[_0x4dd8f8]);});}delete _0xf30aff['TagIds'];}catch(_0x54d5cb){_0xbf6ddd(_0x54d5cb);}_0x5c3305(_0xf30aff);});}function updateChatInteraction(_0x1d554e,_0x5dc824,_0x1fc518){return new BPromise(function(_0x22c940,_0x3c100c){return getInteractionUsers(_0x1d554e,_0x1fc518)[_0xfef0('0x22')](function(_0x199c57){return getInteractionTags(_0x199c57,_0x5dc824);})[_0xfef0('0x22')](function(_0x166a7b){_0x22c940(_0x166a7b);})[_0xfef0('0x2a')](function(_0x4e63f3){_0x3c100c(_0x4e63f3);});});}exports[_0xfef0('0x45')]=function(_0x50e372,_0x4b6da1){var _0x18c656={},_0x17d7f2={},_0x5bf416={'count':0x0,'rows':[]};var _0x2af79f=_['map'](db[_0xfef0('0x46')][_0xfef0('0x47')],function(_0x1f252e){return{'name':_0x1f252e[_0xfef0('0x48')],'type':_0x1f252e['type'][_0xfef0('0x49')]};});_0x17d7f2[_0xfef0('0x4a')]=_['map'](_0x2af79f,'name');_0x17d7f2[_0xfef0('0x4b')]=_['keys'](_0x50e372[_0xfef0('0x4b')]);_0x17d7f2[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x17d7f2[_0xfef0('0x4a')],_0x17d7f2[_0xfef0('0x4b')]);_0x18c656[_0xfef0('0x4e')]=_['intersection'](_0x17d7f2[_0xfef0('0x4a')],qs['fields'](_0x50e372['query'][_0xfef0('0x4f')]));_0x18c656[_0xfef0('0x4e')]=_0x18c656[_0xfef0('0x4e')]['length']?_0x18c656[_0xfef0('0x4e')]:_0x17d7f2['model'];if(!_0x50e372['query']['hasOwnProperty'](_0xfef0('0x50'))){_0x18c656[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x18c656[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x18c656['order']=qs['sort'](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x18c656[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x50e372[_0xfef0('0x4b')],_0x17d7f2[_0xfef0('0x4c')]),_0x2af79f);var _0x20b647=[];var _0x5e989f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')]('id')[_0xfef0('0x55')](_0xfef0('0x38'))[_0xfef0('0x55')]('color')['from']('tools_tags');var _0x445f3f=squel[_0xfef0('0x54')]()[_0xfef0('0x55')](_0xfef0('0x56'))['field'](_0xfef0('0x57'))[_0xfef0('0x55')](_0xfef0('0x58'))[_0xfef0('0x59')](_0xfef0('0x5a'),'ui')[_0xfef0('0x5b')](_0xfef0('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x3458b0=squel[_0xfef0('0x54')]()['from'](_0xfef0('0x5d'),'i')['left_join'](_0xfef0('0x5e'),'c',_0xfef0('0x5f'))['left_join'](_0xfef0('0x5c'),'o','o.id\x20=\x20i.UserId')['left_join']('chat_websites','a',_0xfef0('0x60'))[_0xfef0('0x5b')](_0xfef0('0x61'),'me',_0xfef0('0x62'))[_0xfef0('0x5b')](_0xfef0('0x63'),'it','it.ChatInteractionId\x20=\x20i.id')[_0xfef0('0x5b')](_0xfef0('0x64'),'t',_0xfef0('0x65'));var _0x45abb3=squel[_0xfef0('0x66')]();var _0x58d95e=[];var _0x59d1b6=squel['expr']();var _0x135653;if(_0x50e372['query'][_0xfef0('0x67')]){_0x135653=as[_0xfef0('0x68')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x67')]);var _0xd0255c=_0x135653['sqlOperator'];for(var _0x2abdb7=0x0;_0x2abdb7<_0x135653['conditions'][_0xfef0('0x69')];_0x2abdb7++){var _0x4a1316=_0x135653['conditions'][_0x2abdb7];var _0x3a12c5='i';var _0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0x4a1316[_0xfef0('0x55')]]);if(!_0x3c5640){switch(_0x4a1316[_0xfef0('0x55')]){case _0xfef0('0x6b'):if(_0x4a1316[_0xfef0('0x6c')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316[_0xfef0('0x55')]+_0xfef0('0x6e'));}else{_0x3458b0[_0xfef0('0x6d')]('`'+_0x4a1316['field']+_0xfef0('0x6f'));}break;case _0xfef0('0x70'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){if(_0x4a1316[_0xfef0('0x6c')]['split']('\x20')[_0xfef0('0x69')]>0x1){_0x45abb3[_0xd0255c](_0xfef0('0x73'),qs[_0xfef0('0x74')](_0x4a1316[_0xfef0('0x6c')]),null);}else{var _0x176fc7='%'+_0x4a1316[_0xfef0('0x6c')]+'%';_0x45abb3[_0xd0255c](_0xfef0('0x75'),_0x176fc7,_0x176fc7,_0x176fc7);}}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x76')]);_0x4a1316['field']=_0xfef0('0x76');_0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640[_0xfef0('0x77')],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf['value'][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);}break;case _0xfef0('0x7a'):var _0x1e0ad5=_0x4a1316['value'][_0xfef0('0x42')](',')[_0xfef0('0x7b')](function(_0x2ccb33){return Number(_0x2ccb33);});_0x1e0ad5['forEach'](function(_0x117b74){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x117b74+',%');});_0x58d95e=_[_0xfef0('0x7d')](_0x58d95e,_0x1e0ad5);break;case _0xfef0('0x7e'):if(_0x4a1316[_0xfef0('0x71')]===_0xfef0('0x72')){_0x45abb3[_0xd0255c](_0xfef0('0x7f'),'%'+_0x4a1316['value']+'%',null);}else{_0x3c5640=_[_0xfef0('0x6a')](_0x2af79f,[_0xfef0('0x38'),_0xfef0('0x80')]);_0x4a1316[_0xfef0('0x55')]=_0xfef0('0x80');_0x1d7caf=as[_0xfef0('0x81')](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf[_0xfef0('0x78')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}break;case _0xfef0('0x3b'):_0x1d7caf=as[_0xfef0('0x81')]('me',null,_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x36')]);break;}}else{var _0x1d7caf=as['buildExpression'](_0x3a12c5,_0x3c5640['type'],_0x4a1316);_0x45abb3[_0xd0255c](_0x1d7caf['text'],_0x1d7caf[_0xfef0('0x6c')][_0xfef0('0x79')],_0x1d7caf[_0xfef0('0x6c')]['end']);}}}else{var _0x24229e=_(_0x50e372['query'])['keys']()['map'](function(_0x2a92de){return _[_0xfef0('0x82')](_0x2af79f,['name',_0x2a92de])?_0x2a92de:undefined;})[_0xfef0('0x83')]()[_0xfef0('0x6c')]();if(!_[_0xfef0('0x84')](_0x24229e)){_0x24229e['forEach'](function(_0x3f2b55){if(_0x3f2b55==='ChatWebsiteId'){_0x3458b0['where'](_0xfef0('0x85'),[][_0xfef0('0x86')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55]));}else if(_0x3f2b55===_0xfef0('0x87')){var _0x4df63b=JSON['parse'](_0x50e372['query'][_0x3f2b55])[_0xfef0('0x88')];var _0x546455=JSON[_0xfef0('0x89')](_0x50e372[_0xfef0('0x4b')][_0x3f2b55])[_0xfef0('0x8a')];_0x3458b0[_0xfef0('0x52')](_0xfef0('0x8b'),_0x4df63b,_0x546455);}else{if(_0x50e372['query'][_0x3f2b55]===_0xfef0('0x8c')){_0x3458b0['where']('i.'+_0x3f2b55+'\x20IS\x20NULL');}else{_0x3458b0[_0xfef0('0x52')]('i.'+_0x3f2b55+_0xfef0('0x8d'),_0x50e372[_0xfef0('0x4b')][_0x3f2b55]);}}});}if(_0x50e372[_0xfef0('0x4b')]['read']){if(_0x50e372['query'][_0xfef0('0x8e')]==0x1){_0x3458b0[_0xfef0('0x6d')]('`unreadMessages`\x20=\x200');}else{_0x3458b0[_0xfef0('0x6d')](_0xfef0('0x8f'));}}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]){_0x58d95e=_[_0xfef0('0x91')](_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')])?_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]:new Array(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x90')]);_0x58d95e[_0xfef0('0x43')](function(_0x3c1136){_0x59d1b6['or'](_0xfef0('0x7c'),'%,'+_0x3c1136+',%');});}if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x92')]){var _0x1a61e4=_0x50e372['query'][_0xfef0('0x92')][_0xfef0('0x93')]('\x5c','\x5c\x5c')[_0xfef0('0x93')](/'/g,'\x27\x27');if(qs[_0xfef0('0x94')](_0x1a61e4)){_0x45abb3['or'](_0xfef0('0x95'),_0x1a61e4+'%');}else{_0x45abb3['or'](_0xfef0('0x96'),qs[_0xfef0('0x74')](_0x1a61e4))['or'](_0xfef0('0x97'),_0x1a61e4+'%');}}}_0x3458b0[_0xfef0('0x52')](_0x45abb3);_0x3458b0[_0xfef0('0x98')](_0xfef0('0x99'));var _0x17c350={'type':db[_0xfef0('0x9a')]['QueryTypes'][_0xfef0('0x9b')],'raw':!![]};var _0x56af65=_0x3458b0['clone']();_0x56af65[_0xfef0('0x55')](_0xfef0('0x99'));_0x56af65['field'](_0xfef0('0x9c'),'unreadMessages');if(_0x18c656['order']){_0x18c656[_0xfef0('0x9d')][_0xfef0('0x43')](function(_0x4ebcf){var _0x437cb2=_0x4ebcf[0x0]==='contactName'?_0x4ebcf[0x0]:'i.'+_0x4ebcf[0x0];_0x3458b0[_0xfef0('0x9d')](_0x437cb2,_0x4ebcf[0x1]===_0xfef0('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x58d95e)){_0x3458b0[_0xfef0('0x6d')](_0x59d1b6);_0x56af65[_0xfef0('0x52')](_0xfef0('0x9f'),_0x58d95e);}BPromise['resolve']()['then'](function(){if(!_0x135653){if(_0x50e372[_0xfef0('0x4b')]['ChatWebsiteId'])return;_0x56af65['where'](_0xfef0('0xa0'));_0x3458b0['where'](_0xfef0('0xa0'));return;}if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]!==_0xfef0('0xa3'))return;return _0x50e372[_0xfef0('0xa1')][_0xfef0('0xa4')]({'attributes':['id'],'raw':!![]})[_0xfef0('0x22')](function(_0x28cc77){if(_[_0xfef0('0x84')](_0x28cc77)){_0x56af65[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');_0x3458b0[_0xfef0('0x52')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x56af65['where'](_0xfef0('0x85'),_['map'](_0x28cc77,'id'));_0x3458b0[_0xfef0('0x52')](_0xfef0('0x85'),_[_0xfef0('0x7b')](_0x28cc77,'id'));}});})[_0xfef0('0x22')](function(){if(_0x50e372[_0xfef0('0xa1')][_0xfef0('0xa2')]==='agent'&&!_0x135653&&!_0x50e372[_0xfef0('0x4b')][_0xfef0('0xa5')])return[];return db[_0xfef0('0xa6')][_0xfef0('0x4b')](_0x56af65[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x3cc27e){_0x5bf416[_0xfef0('0xa8')]=_0x3cc27e['length'];if(_0x5bf416[_0xfef0('0xa8')]===0x0)return[];return db[_0xfef0('0xa6')]['query'](_0x5e989f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x221b17){_0x20b647=_['keyBy'](_0x221b17,'id');_0x17c350=_[_0xfef0('0xa9')](_0x17c350,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x50e372[_0xfef0('0x4b')][_0xfef0('0x4f')]){_0x18c656['attributes'][_0xfef0('0x43')](function(_0x51f79b){_0x3458b0[_0xfef0('0x55')]('i.'+_0x51f79b);});}else{_0x3458b0[_0xfef0('0x55')](_0xfef0('0x9c'),_0xfef0('0x6b'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xaa'),_0xfef0('0xab'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xac'),_0xfef0('0xad'));_0x3458b0[_0xfef0('0x55')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xfef0('0xae'));_0x3458b0['field']('i.*');_0x3458b0[_0xfef0('0x55')]('c.firstName',_0xfef0('0xaf'));_0x3458b0['field']('c.lastName',_0xfef0('0xb0'));_0x3458b0['field']('c.email','Contact.email');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb1'),_0xfef0('0xb2'));_0x3458b0[_0xfef0('0x55')]('c.mobile',_0xfef0('0xb3'));_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb4'),_0xfef0('0xb5'));_0x3458b0[_0xfef0('0x55')]('o.fullname','Owner.fullname');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb6'),'Owner.internal');_0x3458b0[_0xfef0('0x55')](_0xfef0('0xb7'),_0xfef0('0x40'));}if(_0x18c656[_0xfef0('0x30')])_0x3458b0[_0xfef0('0x30')](_0x18c656[_0xfef0('0x30')]);if(_0x18c656[_0xfef0('0x2e')])_0x3458b0[_0xfef0('0x2e')](_0x18c656['offset']);return db['sequelize'][_0xfef0('0x4b')](_0x3458b0[_0xfef0('0xa7')](),_0x17c350);})[_0xfef0('0x22')](function(_0x475eb7){if(_0x475eb7[_0xfef0('0x69')]>0x0)_0x445f3f[_0xfef0('0x52')](_0xfef0('0xb8'),_[_0xfef0('0x7b')](_0x475eb7,'id'));return db['sequelize']['query'](_0x445f3f[_0xfef0('0xa7')](),_0x17c350)[_0xfef0('0x22')](function(_0x374877){var _0xd780bb=_[_0xfef0('0xb9')](_0x374877,_0xfef0('0xba'));var _0x5ac2df=[];_0x475eb7[_0xfef0('0x43')](function(_0x1060c2){_0x5ac2df['push'](updateChatInteraction(_0x1060c2,_0x20b647,_0xd780bb));});return BPromise[_0xfef0('0xbb')](_0x5ac2df);});});})[_0xfef0('0x22')](function(_0x36873f){_0x5bf416[_0xfef0('0xbc')]=_0x36873f;return _0x5bf416;})[_0xfef0('0x22')](respondWithFilteredResult(_0x4b6da1,_0x18c656))[_0xfef0('0x2a')](handleError(_0x4b6da1,null));};exports['show']=function(_0x4dd6e8,_0x1084b9){var _0xd7c5b={'raw':![],'where':{'id':_0x4dd6e8[_0xfef0('0xbd')]['id']}},_0xd2c0be={};_0xd2c0be[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatInteraction'][_0xfef0('0x47')]);_0xd2c0be['query']=_[_0xfef0('0xbe')](_0x4dd6e8['query']);_0xd2c0be[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],_0xd2c0be[_0xfef0('0x4b')]);_0xd7c5b[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0xd2c0be['model'],qs['fields'](_0x4dd6e8['query'][_0xfef0('0x4f')]));_0xd7c5b['attributes']=_0xd7c5b[_0xfef0('0x4e')][_0xfef0('0x69')]?_0xd7c5b['attributes']:_0xd2c0be[_0xfef0('0x4a')];if(_0x4dd6e8['query'][_0xfef0('0xbf')]){_0xd7c5b[_0xfef0('0xc0')]=[{'all':!![]}];}_0xd7c5b=_[_0xfef0('0xa9')]({},_0xd7c5b,_0x4dd6e8[_0xfef0('0xc1')]);return db[_0xfef0('0x46')][_0xfef0('0x6a')](_0xd7c5b)[_0xfef0('0x22')](handleEntityNotFound(_0x1084b9,null))['then'](respondWithResult(_0x1084b9,null))[_0xfef0('0x2a')](handleError(_0x1084b9,null));};exports[_0xfef0('0xc2')]=function(_0x38f96f,_0x1bdf18){return db[_0xfef0('0x46')][_0xfef0('0xc2')](_0x38f96f[_0xfef0('0x3b')],{})[_0xfef0('0x22')](respondWithResult(_0x1bdf18,0xc9))[_0xfef0('0x2a')](handleError(_0x1bdf18,null));};exports[_0xfef0('0x34')]=function(_0x2a25cb,_0x34f1db){if(_0x2a25cb[_0xfef0('0x3b')]['id']){delete _0x2a25cb[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a25cb[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x34f1db,null))[_0xfef0('0x22')](saveUpdates(_0x2a25cb[_0xfef0('0x3b')],null))[_0xfef0('0x22')](respondWithResult(_0x34f1db,null))[_0xfef0('0x2a')](handleError(_0x34f1db,null));};exports[_0xfef0('0x35')]=function(_0x191072,_0x5b5a15){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x191072['params']['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x5b5a15,null))[_0xfef0('0x22')](removeEntity(_0x5b5a15,null))[_0xfef0('0x2a')](handleError(_0x5b5a15,null));};exports[_0xfef0('0xc3')]=function(_0xd9c290,_0x365938){return db[_0xfef0('0x46')][_0xfef0('0xc3')]()[_0xfef0('0x22')](respondWithResult(_0x365938,null))[_0xfef0('0x2a')](handleError(_0x365938,null));};exports[_0xfef0('0xc4')]=function(_0x4c6ddd,_0x17ac08){var _0x40afcb=_0x4c6ddd['params']['id'];var _0xaa5902;var _0x189964;var _0x524db7;return db[_0xfef0('0x46')]['findOne']({'where':{'id':_0x40afcb}})[_0xfef0('0x22')](function(_0x41aadf){_0xaa5902=_0x41aadf;return db[_0xfef0('0xc5')][_0xfef0('0xc6')]({'where':{'id':_0x41aadf[_0xfef0('0xa5')]},'attributes':['id','vidaooApiKey',_0xfef0('0xc7'),_0xfef0('0xc8'),'vidaooNote',_0xfef0('0xc9')],'raw':!![]});})['then'](function(_0x3a180e){if(_0x3a180e&&_0x3a180e[_0xfef0('0xca')]&&_0x3a180e[_0xfef0('0xc7')]){_0x189964=_0x3a180e;var _0x52fb8b={'interaction':{'id':_0x40afcb},'agent':{'id':_0x4c6ddd[_0xfef0('0xa1')]['id'],'name':_0x4c6ddd['user']['name'],'fullname':_0x4c6ddd[_0xfef0('0xa1')]['fullname'],'email':_0x4c6ddd[_0xfef0('0xa1')][_0xfef0('0xcb')]},'contact':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3c')],'account':_0x4c6ddd[_0xfef0('0x3b')][_0xfef0('0x3e')]};var _0x7f9b61={'rejectUnauthorized':![],'method':'POST','url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x3a180e[_0xfef0('0xca')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4c6ddd['user'][_0xfef0('0xcb')]],'buttons':null,'topic':_0x189964[_0xfef0('0xc8')],'note':_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xcd')])?null:getMustacheRender(_0x189964[_0xfef0('0xcd')],_0x52fb8b),'metadata':null},'redirect':_0xfef0('0xce'),'json':!![]};try{if(!_[_0xfef0('0xcc')](_0x189964[_0xfef0('0xc9')])){var _0x4a3b68=getMustacheRender(_0x189964['vidaooMetadata'],_0x52fb8b);var _0x3c5471=JSON[_0xfef0('0x89')](_0x4a3b68);_0x7f9b61[_0xfef0('0x3b')][_0xfef0('0xcf')]=_0x3c5471;}}catch(_0xdbd7f2){throw new db['Sequelize']['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x7f9b61);}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xfef0('0x22')](function(_0x4f171b){_0x524db7=_0x4f171b;if(_0x524db7['id']){var _0x236523={'body':_0x524db7[_0xfef0('0xd1')],'ChatWebsiteId':_0x189964['id'],'ChatInteractionId':_0xaa5902['id'],'direction':_0xfef0('0xd2'),'UserId':_0x4c6ddd[_0xfef0('0xa1')]['id']};return db[_0xfef0('0xd3')][_0xfef0('0xc2')](_0x236523,{});}else{throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd4'));}})[_0xfef0('0x22')](function(){return _0xaa5902[_0xfef0('0xd5')]({'vidaooSessionId':_0x524db7['id']});})['then'](respondWithResult(_0x17ac08,null))[_0xfef0('0x2a')](handleError(_0x17ac08,null));};exports['customUpdate']=function(_0xf763b1,_0x1fc6a0){if(_0xf763b1[_0xfef0('0x3b')]['id']){delete _0xf763b1[_0xfef0('0x3b')]['id'];}return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0xf763b1[_0xfef0('0xbd')]['id']},'include':[{'model':db[_0xfef0('0xd6')],'as':_0xfef0('0x70')}]})['then'](handleEntityNotFound(_0x1fc6a0,null))['then'](saveUpdates(_0xf763b1[_0xfef0('0x3b')],null))['then'](respondWithResult(_0x1fc6a0,null))[_0xfef0('0x2a')](handleError(_0x1fc6a0,null));};exports[_0xfef0('0xd7')]=function(_0x45049d,_0x238112,_0x3a7c93){if(_0x45049d['body']['id']){delete _0x45049d[_0xfef0('0x3b')]['id'];}return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x45049d[_0xfef0('0xbd')]['id']}})['then'](function(_0x34bcc3){if(!_0x34bcc3){logger['error'](_0xfef0('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x238112[_0xfef0('0x2b')](0x194);}else{if(_0x34bcc3['UserId']){throw new db[(_0xfef0('0x9a'))][(_0xfef0('0xd0'))](_0xfef0('0xd9'));}}return _0x34bcc3;})['then'](function(_0x5c7b35){if(_0x5c7b35){return _0x5c7b35[_0xfef0('0x34')]({'closed':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xda')],'disposition':_0x45049d[_0xfef0('0x3b')][_0xfef0('0xdb')]})[_0xfef0('0x22')](function(_0x3107e2){return _0x3107e2;});}})[_0xfef0('0x22')](function(_0x325d36){return respondWithRpcPromise('AbandonInteraction',_0xfef0('0xd7'),_0x45049d[_0xfef0('0x3b')],client9004);})[_0xfef0('0x22')](respondWithResult(_0x238112,null))[_0xfef0('0x2a')](handleError(_0x238112,null));};exports[_0xfef0('0xdc')]=function(_0xb1df6f,_0x42604b,_0x5969d2){_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0x38')]=_0xb1df6f['file'][_0xfef0('0xdd')];_0xb1df6f[_0xfef0('0x3b')][_0xfef0('0xde')]=_0xb1df6f[_0xfef0('0xdf')][_0xfef0('0xe0')];_0xb1df6f['body'][_0xfef0('0x77')]=_0xb1df6f['file'][_0xfef0('0xe1')];return db['Attachment']['create'](_0xb1df6f['body'])[_0xfef0('0x22')](respondWithResult(_0x42604b,0xc9))['catch'](handleError(_0x42604b,null));};exports['attachmentDownload']=function(_0x25fed0,_0x43453b,_0x4da5b0){return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0[_0xfef0('0xbd')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x43453b,null))['then'](function(_0x39a2a7){if(_0x39a2a7){if(_0x39a2a7[_0xfef0('0xda')]){return _0x43453b[_0xfef0('0x2c')](0x193)[_0xfef0('0x2d')]({'status':0x193,'message':_0xfef0('0xe2')});}return db[_0xfef0('0xe3')][_0xfef0('0xc6')]({'where':{'id':_0x25fed0['query'][_0xfef0('0xe4')]},'raw':!![]})[_0xfef0('0x22')](handleEntityNotFound(_0x43453b,null));}})[_0xfef0('0x22')](function(_0x4544fe){if(_0x4544fe){var _0x5c0f32=_0x4544fe['ChatOfflineMessageId']!==null;var _0x461c91=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe7'));if(_0x5c0f32){_0x461c91=path[_0xfef0('0xe5')](_0x461c91,_0xfef0('0xe8'));}var _0xe24c2d=path['join'](_0x461c91,_0x4544fe['basename']);return _0x43453b['download'](_0xe24c2d);}})[_0xfef0('0x2a')](handleError(_0x43453b,null));};exports['close']=function(_0x38ac84,_0x4a1406){var _0x2daf2a=null;var _0x4f703e=null;var _0x20cf67=null;var _0x235122=null;if(_0x38ac84[_0xfef0('0x3b')]['id']){delete _0x38ac84[_0xfef0('0x3b')]['id'];}if(_0x38ac84[_0xfef0('0x3b')]['mailTranscript']){_0x235122=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0xe9'),util[_0xfef0('0xea')]('transcript-%s.txt',Date[_0xfef0('0xeb')]()));_0x38ac84['body']['pathTranscript']=_0x235122;}return db[_0xfef0('0x46')]['find']({'where':{'id':_0x38ac84['params']['id']},'include':[{'model':db[_0xfef0('0xd3')],'as':'Messages','include':[{'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e')}]}]})[_0xfef0('0x22')](handleEntityNotFound(_0x4a1406,null))[_0xfef0('0x22')](saveUpdates(_0x38ac84[_0xfef0('0x3b')],null))[_0xfef0('0x22')](function(_0x4f6c50){if(_0x4f6c50){_0x2daf2a=_0x4f6c50;return db[_0xfef0('0xc5')][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0xa5')]}});}})['then'](function(_0x3ac462){if(_0x3ac462){_0x20cf67=_0x3ac462;return db['CmContact'][_0xfef0('0x6a')]({'where':{'id':_0x2daf2a[_0xfef0('0x76')]}});}})[_0xfef0('0x22')](function(_0x5ef687){if(_0x5ef687){_0x4f703e=_0x5ef687;if(_0x235122){var _0x906e55=null;for(var _0x4cec7d=0x1;_0x4cec7d<_0x2daf2a['Messages'][_0xfef0('0x69')];++_0x4cec7d){_0x906e55=_0x2daf2a[_0xfef0('0xec')][_0x4cec7d];var _0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');var _0x484cc3=_0x38ac84[_0xfef0('0x3b')][_0xfef0('0xf0')]||util[_0xfef0('0xea')](_0xfef0('0xed'),_0xfef0('0xf1'),_0x906e55[_0xfef0('0x76')]);switch(_0x20cf67[_0xfef0('0xf2')]){case _0xfef0('0xf3'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util['format'](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');break;case'agent_alias':_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf4')]||_0x906e55[_0xfef0('0x7e')][_0xfef0('0xf5')]:'System';break;case _0xfef0('0xf6'):_0x58a4ef=_0x906e55[_0xfef0('0x80')]?_0x906e55[_0xfef0('0x7e')]['fullname']:'System';break;default:_0x58a4ef=_0x906e55[_0xfef0('0x80')]?util[_0xfef0('0xea')](_0xfef0('0xed'),_0x20cf67[_0xfef0('0xee')],_0x906e55['UserId']):_0xfef0('0xef');}var _0x4b4986=util[_0xfef0('0xea')](_0xfef0('0xf7'),moment(_0x906e55[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0xf8')),_0x906e55['direction']==='in'?_0x484cc3:_0x58a4ef,_0x906e55[_0xfef0('0x3b')]);if(!_0x906e55[_0xfef0('0xf9')]){fs[_0xfef0('0xfa')](_0x235122,_0x4b4986);}}return db[_0xfef0('0xfb')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xfef0('0xfc')],'as':'Smtp','raw':!![]}]});}}})[_0xfef0('0x22')](function(_0x402c7d){if(_0x402c7d&&_0x402c7d[_0xfef0('0xfd')]&&_0x38ac84[_0xfef0('0x3b')]){var _0x5315eb={'tls':{'rejectUnauthorized':![]}};if(_0x402c7d['Smtp'][_0xfef0('0xfe')]){_0x5315eb[_0xfef0('0xfe')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xfe')];}else{_0x5315eb[_0xfef0('0xff')]=_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xff')];_0x5315eb['port']=_0x402c7d['Smtp'][_0xfef0('0x100')];_0x5315eb[_0xfef0('0x101')]=_0x402c7d['Smtp'][_0xfef0('0x101')];}if(_0x402c7d['Smtp']['authentication']){_0x5315eb[_0xfef0('0x102')]={'user':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0xa1')],'pass':_0x402c7d[_0xfef0('0xfd')][_0xfef0('0x103')]};}return respondWithRpcPromise('SendMail',_0xfef0('0x104'),{'account':_0x5315eb,'message':{'from':util[_0xfef0('0xea')](_0xfef0('0x105'),_0x402c7d[_0xfef0('0x38')],_0x402c7d['email']||_0x402c7d['Smtp']['user']),'to':_0x38ac84[_0xfef0('0x3b')]['mailTranscript'],'subject':_0xfef0('0x106'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x38ac84['body'][_0xfef0('0x107')]),'attachments':[{'path':_0x235122}]}})[_0xfef0('0x22')](function(){return _0x2daf2a;})['catch'](function(_0x411870){console['error'](_0x411870);});}else{return _0x2daf2a;}})[_0xfef0('0x22')](respondWithStatusCode(_0x4a1406,0xc8))[_0xfef0('0x2a')](handleError(_0x4a1406,null));};exports[_0xfef0('0x108')]=function(_0x9b2969,_0x1f842f,_0x36c978){return db[_0xfef0('0xd3')][_0xfef0('0x6a')]({'where':{'id':_0x9b2969[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1f842f,null))['then'](function(_0x1d342a){if(_0x1d342a){return _0x1d342a[_0xfef0('0x108')](_0x9b2969['body'][_0xfef0('0x109')],_['omit'](_0x9b2969[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{});}})[_0xfef0('0x22')](respondWithResult(_0x1f842f,null))[_0xfef0('0x2a')](handleError(_0x1f842f,null));};exports[_0xfef0('0x10a')]=function(_0x422af1,_0xcb9eb8,_0x38e829){var _0x287403={'raw':![],'where':{}};var _0x2ebd8d={};var _0x115454={'count':0x0,'rows':[]};return db[_0xfef0('0x46')][_0xfef0('0xc6')]({'where':{'id':_0x422af1[_0xfef0('0xbd')]['id']}})['then'](handleEntityNotFound(_0xcb9eb8,null))[_0xfef0('0x22')](function(_0x5593de){if(_0x5593de){_0x2ebd8d['model']=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2ebd8d[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x422af1['query']);_0x2ebd8d[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],_0x2ebd8d[_0xfef0('0x4b')]);_0x287403[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2ebd8d[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x287403[_0xfef0('0x4e')]=_0x287403[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x287403[_0xfef0('0x4e')]:_0x2ebd8d['model'];if(!_0x422af1[_0xfef0('0x4b')]['hasOwnProperty'](_0xfef0('0x50'))){_0x287403['limit']=qs[_0xfef0('0x30')](_0x422af1[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x287403[_0xfef0('0x2e')]=qs[_0xfef0('0x2e')](_0x422af1['query']['offset']);}_0x287403[_0xfef0('0x9d')]=qs[_0xfef0('0x51')](_0x422af1['query'][_0xfef0('0x51')]);_0x287403[_0xfef0('0x52')]=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x422af1[_0xfef0('0x4b')],_0x2ebd8d[_0xfef0('0x4c')]));_0x287403[_0xfef0('0x52')][_0xfef0('0xba')]=_0x5593de['id'];if(_0x422af1['query'][_0xfef0('0x92')]){_0x287403[_0xfef0('0x52')]=_['merge'](_0x287403[_0xfef0('0x52')],{'$or':_['map'](_0x287403[_0xfef0('0x4e')],function(_0x41790c){var _0x189965={};_0x189965[_0x41790c]={'$like':'%'+_0x422af1[_0xfef0('0x4b')][_0xfef0('0x92')]+'%'};return _0x189965;})});}if(_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]){var _0x5b1b34=_0x422af1[_0xfef0('0x4b')][_0xfef0('0x88')]['split'](',');var _0xfa83e1={};_0xfa83e1[_0x5b1b34[0x0]]={'$gte':moment(_0x5b1b34[0x1])[_0xfef0('0xea')](_0xfef0('0x10b'))};_0x287403['where']=_[_0xfef0('0xa9')](_0x287403[_0xfef0('0x52')],_0xfa83e1);}_0x287403=_[_0xfef0('0xa9')]({},_0x287403,_0x422af1[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')][_0xfef0('0xa8')]({'where':_0x287403[_0xfef0('0x52')]})[_0xfef0('0x22')](function(_0x464d00){_0x115454[_0xfef0('0xa8')]=_0x464d00;if(_0x422af1['query'][_0xfef0('0xbf')]){_0x287403[_0xfef0('0xc0')]=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x287403);})[_0xfef0('0x22')](function(_0x1b23f0){_0x115454['rows']=_0x1b23f0;return _0x115454;});}})['then'](respondWithFilteredResult(_0xcb9eb8,_0x287403))[_0xfef0('0x2a')](handleError(_0xcb9eb8,null));};exports['getMyMessages']=function(_0x30f7d5,_0x1a53fa,_0x14a37e){var _0x303128={'where':{}},_0x2b3263={},_0x43e758={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xfef0('0xc6')]({'where':{'id':_0x30f7d5[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x1a53fa,null))[_0xfef0('0x22')](function(_0x273e8b){if(_0x273e8b){_0x2b3263[_0xfef0('0x4a')]=_[_0xfef0('0xbe')](db['ChatMessage'][_0xfef0('0x47')]);_0x2b3263[_0xfef0('0x4b')]=_[_0xfef0('0xbe')](_0x30f7d5[_0xfef0('0x4b')]);_0x2b3263[_0xfef0('0x4c')]=_[_0xfef0('0x4d')](_0x2b3263['model'],_0x2b3263['query']);_0x303128[_0xfef0('0x4e')]=_[_0xfef0('0x4d')](_0x2b3263[_0xfef0('0x4a')],qs[_0xfef0('0x4f')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x4f')]));_0x303128[_0xfef0('0x4e')]=_0x303128[_0xfef0('0x4e')][_0xfef0('0x69')]?_0x303128[_0xfef0('0x4e')]:_0x2b3263[_0xfef0('0x4a')];if(!_0x30f7d5['query'][_0xfef0('0x10d')](_0xfef0('0x50'))){_0x303128[_0xfef0('0x30')]=qs[_0xfef0('0x30')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x30')]);_0x303128['offset']=qs[_0xfef0('0x2e')](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x2e')]);}_0x303128[_0xfef0('0x9d')]=qs['sort'](_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x51')]);_0x303128['where']=qs[_0xfef0('0x4c')](_[_0xfef0('0x53')](_0x30f7d5[_0xfef0('0x4b')],_0x2b3263[_0xfef0('0x4c')]));_0x303128[_0xfef0('0x52')][_0xfef0('0xba')]=_0x273e8b['id'];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x92')]){_0x303128['where']=_[_0xfef0('0xa9')](_0x303128[_0xfef0('0x52')],{'$or':_['map'](_0x303128['attributes'],function(_0x3081e){var _0xd34b68={};_0xd34b68[_0x3081e]={'$like':'%'+_0x30f7d5[_0xfef0('0x4b')]['filter']+'%'};return _0xd34b68;})});}_0x303128[_0xfef0('0x52')][_0xfef0('0xf9')]=![];if(_0x30f7d5['query']['id']){_0x303128[_0xfef0('0x52')]['id']={'$gt':_0x30f7d5[_0xfef0('0x4b')]['id']};}_0x303128=_[_0xfef0('0xa9')]({},_0x303128,_0x30f7d5[_0xfef0('0xc1')]);return db[_0xfef0('0xd3')]['count']({'where':_0x303128[_0xfef0('0x52')]})['then'](function(_0x63bcae){_0x43e758['count']=_0x63bcae;_0x303128[_0xfef0('0xc0')]=[];if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0x10e')]){_0x303128['include'][_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':'User','attributes':['id','fullname',_0xfef0('0xf4')]});}if(_0x30f7d5[_0xfef0('0x4b')][_0xfef0('0xbf')]){_0x303128['include']=[{'all':!![]}];}return db[_0xfef0('0xd3')][_0xfef0('0x10c')](_0x303128);})['then'](function(_0x527d0d){_0x43e758[_0xfef0('0xbc')]=_0x527d0d;return _0x43e758;});}})[_0xfef0('0x22')](respondWithFilteredResult(_0x1a53fa,_0x303128))['catch'](handleError(_0x1a53fa,null));};exports[_0xfef0('0x10f')]=function(_0x3f68ed,_0x45a5e8,_0x33cecb){return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x3f68ed[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0x45a5e8,null))[_0xfef0('0x22')](function(_0x53ce05){if(_0x53ce05){return _0x53ce05[_0xfef0('0x110')](_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')],_[_0xfef0('0x111')](_0x3f68ed[_0xfef0('0x3b')],[_0xfef0('0x109'),'id'])||{})['spread'](function(){return db[_0xfef0('0x7a')][_0xfef0('0x10c')]({'attributes':['id','name','color'],'where':{'id':_0x3f68ed[_0xfef0('0x3b')][_0xfef0('0x109')]}});})[_0xfef0('0x22')](function(_0x4697ee){socket[_0xfef0('0x112')]('chatInteractionTags:save',{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]});return{'id':Number(_0x3f68ed[_0xfef0('0xbd')]['id']),'tags':_0x4697ee||[]};});}})[_0xfef0('0x22')](respondWithResult(_0x45a5e8,null))['catch'](handleError(_0x45a5e8,null));};exports[_0xfef0('0x113')]=function(_0x2a229b,_0xcb6d50,_0x53ed7e){return db['ChatInteraction'][_0xfef0('0x6a')]({'where':{'id':_0x2a229b[_0xfef0('0xbd')]['id']}})[_0xfef0('0x22')](handleEntityNotFound(_0xcb6d50,null))['then'](function(_0x241763){if(_0x241763){return _0x241763[_0xfef0('0x113')](_0x2a229b['query'][_0xfef0('0x109')]);}})[_0xfef0('0x22')](respondWithStatusCode(_0xcb6d50,null))['catch'](handleError(_0xcb6d50,null));};exports[_0xfef0('0x114')]=function(_0x57e2d8,_0x3fdeae){var _0x30b0a9=moment()[_0xfef0('0x115')]()['toString']();var _0x416d36=path[_0xfef0('0xe5')](config['root'],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x118'));var _0x50b3d7=path[_0xfef0('0xe5')](config[_0xfef0('0xe6')],_0xfef0('0x116'),_0xfef0('0x117'),_0xfef0('0x119'));var _0x2a9a1e=path[_0xfef0('0xe5')](_0x416d36,_0x30b0a9);var _0x584c9b=util[_0xfef0('0xea')](_0xfef0('0x11a'),_0x57e2d8[_0xfef0('0xbd')]['id'],_0x30b0a9);var _0x4f4c4e=path[_0xfef0('0xe5')](_0x416d36,_0x584c9b);var _0x1c6ab9=[];_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0x7e')],'as':_0xfef0('0x7e'),'attributes':['id',_0xfef0('0xf5')],'raw':!![]});_0x1c6ab9['push']({'model':db[_0xfef0('0xd6')],'as':'Contact','attributes':['id',_0xfef0('0x11b'),_0xfef0('0x11c')],'raw':!![]});if(_0x57e2d8[_0xfef0('0x4b')][_0xfef0('0x119')]){_0x1c6ab9[_0xfef0('0x44')]({'model':db[_0xfef0('0xe3')],'as':'Attachment','raw':!![]});}var _0x937d8e=[{'model':db[_0xfef0('0xd3')],'as':_0xfef0('0xec'),'attributes':['id',_0xfef0('0x3b'),'createdAt',_0xfef0('0x11d'),_0xfef0('0xf9'),'read'],'include':_0x1c6ab9}];_0x937d8e['push']({'model':db[_0xfef0('0xc5')],'as':_0xfef0('0x11e'),'attributes':['id',_0xfef0('0x38')]});_0x937d8e[_0xfef0('0x44')]({'model':db['User'],'as':'Owner','attributes':['id',_0xfef0('0xf5')]});return db[_0xfef0('0x46')][_0xfef0('0x6a')]({'where':{'id':_0x57e2d8[_0xfef0('0xbd')]['id']},'include':_0x937d8e})[_0xfef0('0x22')](handleEntityNotFound(_0x3fdeae,null))['then'](function(_0x2978cc){if(_0x2978cc){var _0x81bcee=_0x2978cc['get']({'plain':!![]});fs[_0xfef0('0x11f')](_0x2a9a1e);var _0xc8d0ca={'channel':_0xfef0('0x120'),'account':_0x81bcee[_0xfef0('0x11e')][_0xfef0('0x38')],'agent':_0x81bcee[_0xfef0('0x121')]?_0x81bcee['Owner']['fullname']:_0xfef0('0x122'),'createdAt':moment(_0x81bcee[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))['toString'](),'closedAt':_0x81bcee['closed']?moment(_0x81bcee['closedAt'])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')]():'','disposition':_0x81bcee[_0xfef0('0xdb')],'chatInfo':{'browser':_0x81bcee[_0xfef0('0x123')],'os':_0x81bcee[_0xfef0('0x124')],'referer':_0x81bcee['referer'],'customerIp':_0x81bcee['customerIp'],'customerPort':_0x81bcee['customerPort']?_0x81bcee['customerPort']:'N.A.'},'messages':_(_0x81bcee[_0xfef0('0xec')])['tail']()[_0xfef0('0x92')]({'secret':![]})[_0xfef0('0x7b')](function(_0x46ab62){if(_0x46ab62[_0xfef0('0xe3')]){var _0x3507a8=path['join'](_0x50b3d7,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')]);if(fs[_0xfef0('0x125')](_0x3507a8)){fs['createReadStream'](_0x3507a8)[_0xfef0('0x126')](fs[_0xfef0('0x127')](path[_0xfef0('0xe5')](_0x2a9a1e,_0x46ab62[_0xfef0('0xe3')][_0xfef0('0xde')])));}}return{'date':moment(_0x46ab62[_0xfef0('0x87')])[_0xfef0('0xea')](_0xfef0('0x10b'))[_0xfef0('0xa7')](),'sender':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?_0x46ab62[_0xfef0('0x7e')]?_0x46ab62[_0xfef0('0x7e')][_0xfef0('0xf5')]:_0xfef0('0xef'):_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11b')]+(_0x46ab62[_0xfef0('0x70')][_0xfef0('0x11c')]?'\x20'+_0x46ab62[_0xfef0('0x70')]['lastName']:''),'body':_0x46ab62['Attachment']?_0x46ab62['Attachment']['basename']:_0x46ab62[_0xfef0('0x3b')],'direction':_0x46ab62[_0xfef0('0x11d')]===_0xfef0('0xd2')?'A':'C','secret':_0x46ab62['secret'],'read':_0x46ab62[_0xfef0('0x8e')],'attachment':_0x46ab62[_0xfef0('0xe3')]};})[_0xfef0('0x6c')]()};return ejs[_0xfef0('0x128')](path['join'](config['root'],'server',_0xfef0('0x129'),_0xfef0('0x12a')),{'interaction':_0xc8d0ca})[_0xfef0('0x22')](function(_0x2b1f64){var _0x55ecff=path[_0xfef0('0xe5')](_0x2a9a1e,_0xfef0('0x12b')+_0x81bcee['id']+'-'+_0x30b0a9+'.pdf');var _0x409147={'path':_0x55ecff,'channel':_0xfef0('0x120'),'interactionId':_0x81bcee['id']};return pdf[_0xfef0('0x12c')](_0x2b1f64,_0x409147);})[_0xfef0('0x22')](function(){return new BPromise(function(_0x27856d,_0x44081d){zipdir(_0x2a9a1e,{'saveTo':_0x4f4c4e},function(_0x177c9b,_0x322672){if(_0x177c9b)return _0x44081d(_0x177c9b);return _0x27856d(_0x322672);});})[_0xfef0('0x22')](function(){return new BPromise(function(_0x102b4e,_0x2a206b){rimraf(_0x2a9a1e,function(_0x279f5b){if(_0x279f5b)_0x2a206b(_0x279f5b);return _0x102b4e();});});})[_0xfef0('0x22')](function(){return _0x3fdeae[_0xfef0('0x114')](_0x4f4c4e,_0x584c9b,function(_0x44603e){if(_0x44603e){console['log'](_0xfef0('0x12d'),_0x44603e);}else{fs['unlinkSync'](_0x4f4c4e);}});});});}else{return _0x3fdeae[_0xfef0('0x2b')](0xc8);}})['catch'](handleError(_0x3fdeae,null));};
\ No newline at end of file
index 08f5b28..c5e7a2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf70d=['remove','getUsers','then','Users','map','length','emit','catch','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','setMaxListeners','save','update'];(function(_0x19148e,_0x4b771d){var _0x73539a=function(_0x390d98){while(--_0x390d98){_0x19148e['push'](_0x19148e['shift']());}};_0x73539a(++_0x4b771d);}(_0xf70d,0x192));var _0xdf70=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xf70d[_0x13ce0c];return _0x4388fb;};'use strict';var EventEmitter=require(_0xdf70('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xdf70('0x1')];var ChatMessage=require(_0xdf70('0x2'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdf70('0x3')](0x0);var events={'afterCreate':_0xdf70('0x4'),'afterUpdate':_0xdf70('0x5'),'afterDestroy':_0xdf70('0x6')};function emitEvent(_0x3b51d6){return function(_0x492c81,_0x57d1a7,_0x3ee28a){_0x492c81[_0xdf70('0x7')]({'attributes':['id'],'raw':!![]})[_0xdf70('0x8')](function(_0x47d6c9){_0x492c81['setDataValue'](_0xdf70('0x9'),_0x47d6c9[_0xdf70('0xa')](function(_0xaaa3ec){return{'id':_0xaaa3ec['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x492c81['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdf70('0x8')](function(_0x2036b3){_0x492c81['setDataValue']('unreadMessages',_0x2036b3[_0xdf70('0xb')]);ChatInteractionEvents[_0xdf70('0xc')](_0x3b51d6+':'+_0x492c81['id'],_0x492c81);ChatInteractionEvents[_0xdf70('0xc')](_0x3b51d6,_0x492c81);_0x3ee28a(null);})[_0xdf70('0xd')](_0x3ee28a(null));};}for(var e in events){if(events[_0xdf70('0xe')](e)){var event=events[e];ChatInteraction[_0xdf70('0xf')](e,emitEvent(event));}}module[_0xdf70('0x10')]=ChatInteractionEvents;
\ No newline at end of file
+var _0xc5ab=['catch','hasOwnProperty','hook','../../mysqldb','save','update','remove','then','setDataValue','Users','findAll','unreadMessages','length','emit'];(function(_0x35d2d6,_0x14e944){var _0x1637d5=function(_0x327b04){while(--_0x327b04){_0x35d2d6['push'](_0x35d2d6['shift']());}};_0x1637d5(++_0x14e944);}(_0xc5ab,0x73));var _0xbc5a=function(_0x3566b7,_0x408f7c){_0x3566b7=_0x3566b7-0x0;var _0x10fdc1=_0xc5ab[_0x3566b7];return _0x10fdc1;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xbc5a('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xbc5a('0x0'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbc5a('0x1'),'afterUpdate':_0xbc5a('0x2'),'afterDestroy':_0xbc5a('0x3')};function emitEvent(_0x1d8791){return function(_0x28b068,_0x296403,_0x2ab4a0){_0x28b068['getUsers']({'attributes':['id'],'raw':!![]})[_0xbc5a('0x4')](function(_0x54f751){_0x28b068[_0xbc5a('0x5')](_0xbc5a('0x6'),_0x54f751['map'](function(_0x21ad58){return{'id':_0x21ad58['id']};}));return ChatMessage[_0xbc5a('0x7')]({'where':{'ChatInteractionId':_0x28b068['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbc5a('0x4')](function(_0x13ac20){_0x28b068[_0xbc5a('0x5')](_0xbc5a('0x8'),_0x13ac20[_0xbc5a('0x9')]);ChatInteractionEvents['emit'](_0x1d8791+':'+_0x28b068['id'],_0x28b068);ChatInteractionEvents[_0xbc5a('0xa')](_0x1d8791,_0x28b068);_0x2ab4a0(null);})[_0xbc5a('0xb')](_0x2ab4a0(null));};}for(var e in events){if(events[_0xbc5a('0xc')](e)){var event=events[e];ChatInteraction[_0xbc5a('0xd')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
index 0be0383..6223ac2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa99=['request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa99,0x1b0));var _0x9aa9=function(_0x494ea5,_0x234211){_0x494ea5=_0x494ea5-0x0;var _0x3e6800=_0xaa99[_0x494ea5];return _0x3e6800;};'use strict';var _=require(_0x9aa9('0x0'));var util=require(_0x9aa9('0x1'));var logger=require('../../config/logger')(_0x9aa9('0x2'));var moment=require(_0x9aa9('0x3'));var BPromise=require(_0x9aa9('0x4'));var rp=require(_0x9aa9('0x5'));var fs=require('fs');var path=require(_0x9aa9('0x6'));var rimraf=require(_0x9aa9('0x7'));var config=require(_0x9aa9('0x8'));var attributes=require(_0x9aa9('0x9'));module['exports']=function(_0x55aea9,_0x2029d1){return _0x55aea9[_0x9aa9('0xa')](_0x9aa9('0xb'),attributes,{'tableName':_0x9aa9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20b0b4,_0x4ee185,_0x1af795){if(_0x20b0b4[_0x9aa9('0xd')](_0x9aa9('0xe'))){_0x20b0b4[_0x9aa9('0xf')]=moment()[_0x9aa9('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1af795(null,_0x20b0b4);}},'charset':_0x9aa9('0x11'),'collate':_0x9aa9('0x12')});};
\ No newline at end of file
+var _0xafa1=['define','ChatInteraction','chat_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatInteraction.attributes','exports'];(function(_0x40b2ed,_0x2b1765){var _0x18397d=function(_0xc6a86f){while(--_0xc6a86f){_0x40b2ed['push'](_0x40b2ed['shift']());}};_0x18397d(++_0x2b1765);}(_0xafa1,0x1a6));var _0x1afa=function(_0x5b862e,_0x3bc15f){_0x5b862e=_0x5b862e-0x0;var _0x4d2295=_0xafa1[_0x5b862e];return _0x4d2295;};'use strict';var _=require('lodash');var util=require(_0x1afa('0x0'));var logger=require(_0x1afa('0x1'))(_0x1afa('0x2'));var moment=require(_0x1afa('0x3'));var BPromise=require(_0x1afa('0x4'));var rp=require(_0x1afa('0x5'));var fs=require('fs');var path=require(_0x1afa('0x6'));var rimraf=require('rimraf');var config=require(_0x1afa('0x7'));var attributes=require(_0x1afa('0x8'));module[_0x1afa('0x9')]=function(_0x12282a,_0x2e6a0e){return _0x12282a[_0x1afa('0xa')](_0x1afa('0xb'),attributes,{'tableName':_0x1afa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1267b8,_0x5d3dab,_0x327c03){if(_0x1267b8['changed'](_0x1afa('0xd'))){_0x1267b8['closedAt']=moment()[_0x1afa('0xe')](_0x1afa('0xf'));}_0x327c03(null,_0x1267b8);}},'charset':_0x1afa('0x10'),'collate':_0x1afa('0x11')});};
\ No newline at end of file
index b3d409a..9fbc4f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54b6=['localhost','redis','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','ChatInteraction','update','options','limit','UpdateChatInteraction','stringify','AddTagsToChatInteraction','where','addTags','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x5f4c1c,_0x4f50b9){var _0x1d5999=function(_0x55400b){while(--_0x55400b){_0x5f4c1c['push'](_0x5f4c1c['shift']());}};_0x1d5999(++_0x4f50b9);}(_0x54b6,0x1ca));var _0x654b=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x54b6[_0x39d544];return _0x5a5ff2;};'use strict';var _=require('lodash');var util=require(_0x654b('0x0'));var moment=require(_0x654b('0x1'));var BPromise=require(_0x654b('0x2'));var rs=require(_0x654b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x654b('0x4'))['db'];var utils=require(_0x654b('0x5'));var logger=require(_0x654b('0x6'))(_0x654b('0x7'));var config=require(_0x654b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x654b('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x654b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x654b('0xb')]));require(_0x654b('0xc'))[_0x654b('0xd')](socket);function respondWithRpcPromise(_0x56a735,_0x232c17,_0xcc5e43){return new BPromise(function(_0x4f5031,_0x55a335){return client[_0x654b('0xe')](_0x56a735,_0xcc5e43)[_0x654b('0xf')](function(_0x38a898){logger['info'](_0x654b('0x10'),_0x232c17,_0x654b('0x11'));logger[_0x654b('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x232c17,_0x654b('0x11'),JSON['stringify'](_0x38a898));if(_0x38a898['error']){if(_0x38a898[_0x654b('0x13')][_0x654b('0x14')]===0x1f4){logger[_0x654b('0x13')](_0x654b('0x10'),_0x232c17,_0x38a898[_0x654b('0x13')][_0x654b('0x15')]);return _0x55a335(_0x38a898['error'][_0x654b('0x15')]);}logger[_0x654b('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x232c17,_0x38a898[_0x654b('0x13')][_0x654b('0x15')]);return _0x4f5031(_0x38a898[_0x654b('0x13')]['message']);}else{logger[_0x654b('0x16')](_0x654b('0x10'),_0x232c17,_0x654b('0x11'));_0x4f5031(_0x38a898[_0x654b('0x17')][_0x654b('0x15')]);}})[_0x654b('0x18')](function(_0x8eb8f7){logger[_0x654b('0x13')](_0x654b('0x10'),_0x232c17,_0x8eb8f7);_0x55a335(_0x8eb8f7);});});}exports['UpdateChatInteraction']=function(_0x5de6e6){var _0x480582=this;return new Promise(function(_0x1226de,_0x820b5){return db[_0x654b('0x19')][_0x654b('0x1a')](_0x5de6e6['body'],{'raw':_0x5de6e6[_0x654b('0x1b')]?_0x5de6e6[_0x654b('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5de6e6[_0x654b('0x1b')]?_0x5de6e6[_0x654b('0x1b')]['where']||null:null,'attributes':_0x5de6e6[_0x654b('0x1b')]?_0x5de6e6[_0x654b('0x1b')]['attributes']||null:null,'limit':_0x5de6e6[_0x654b('0x1b')]?_0x5de6e6[_0x654b('0x1b')][_0x654b('0x1c')]||null:null})[_0x654b('0xf')](function(_0x1174da){logger[_0x654b('0x16')](_0x654b('0x1d'),_0x5de6e6);logger[_0x654b('0x12')]('UpdateChatInteraction',_0x5de6e6,JSON[_0x654b('0x1e')](_0x1174da));_0x1226de(_0x1174da);})[_0x654b('0x18')](function(_0x1663a5){logger[_0x654b('0x13')](_0x654b('0x1d'),_0x1663a5[_0x654b('0x15')],_0x5de6e6);_0x820b5(_0x480582[_0x654b('0x13')](0x1f4,_0x1663a5[_0x654b('0x15')]));});});};exports[_0x654b('0x1f')]=function(_0x4a1c0d){return new Promise(function(_0x27a2b9,_0x2d4a02){return db[_0x654b('0x19')]['find']({'where':_0x4a1c0d[_0x654b('0x1b')]?_0x4a1c0d['options'][_0x654b('0x20')]||null:null})['then'](function(_0x12e50b){if(_0x12e50b){return _0x12e50b[_0x654b('0x21')](_0x4a1c0d[_0x654b('0x22')][_0x654b('0x23')],_[_0x654b('0x24')](_0x4a1c0d[_0x654b('0x22')],[_0x654b('0x23'),'id'])||{});}})[_0x654b('0x25')](function(_0x3fdf4e){logger[_0x654b('0x16')](_0x654b('0x26'),_0x4a1c0d);logger[_0x654b('0x12')](_0x654b('0x26'),_0x4a1c0d,JSON[_0x654b('0x1e')](_0x3fdf4e));_0x27a2b9(_0x3fdf4e);})['catch'](function(_0x3d9294){logger[_0x654b('0x13')](_0x654b('0x26'),_0x3d9294[_0x654b('0x15')],_0x4a1c0d);_0x2d4a02(_this['error'](0x1f4,_0x3d9294[_0x654b('0x15')]));});});};
\ No newline at end of file
+var _0x5adc=['error','code','message','request\x20sent','result','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','then','catch','AddTagsToChatInteraction','find','omit','spread','AddTags','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x13ac10,_0x46e79e){var _0x28eda2=function(_0x169ef0){while(--_0x169ef0){_0x13ac10['push'](_0x13ac10['shift']());}};_0x28eda2(++_0x46e79e);}(_0x5adc,0x10b));var _0xc5ad=function(_0x39fa33,_0xb1c5f7){_0x39fa33=_0x39fa33-0x0;var _0xcab27d=_0x5adc[_0x39fa33];return _0xcab27d;};'use strict';var _=require('lodash');var util=require(_0xc5ad('0x0'));var moment=require(_0xc5ad('0x1'));var BPromise=require('bluebird');var rs=require(_0xc5ad('0x2'));var fs=require('fs');var Redis=require(_0xc5ad('0x3'));var db=require(_0xc5ad('0x4'))['db'];var utils=require(_0xc5ad('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc5ad('0x6'));var jayson=require(_0xc5ad('0x7'));var client=jayson[_0xc5ad('0x8')][_0xc5ad('0x9')]({'port':0x232a});config[_0xc5ad('0xa')]=_[_0xc5ad('0xb')](config[_0xc5ad('0xa')],{'host':_0xc5ad('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc5ad('0xa')]));require(_0xc5ad('0xd'))[_0xc5ad('0xe')](socket);function respondWithRpcPromise(_0x5f4e10,_0x4d0e7e,_0x4f8ee2){return new BPromise(function(_0x3b36a1,_0x404e88){return client[_0xc5ad('0xf')](_0x5f4e10,_0x4f8ee2)['then'](function(_0x174bed){logger[_0xc5ad('0x10')](_0xc5ad('0x11'),_0x4d0e7e,'request\x20sent');logger[_0xc5ad('0x12')](_0xc5ad('0x13'),_0x4d0e7e,'request\x20sent',JSON['stringify'](_0x174bed));if(_0x174bed['error']){if(_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x15')]===0x1f4){logger[_0xc5ad('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x4d0e7e,_0x174bed[_0xc5ad('0x14')]['message']);return _0x404e88(_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x16')]);}logger[_0xc5ad('0x14')](_0xc5ad('0x11'),_0x4d0e7e,_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x16')]);return _0x3b36a1(_0x174bed[_0xc5ad('0x14')][_0xc5ad('0x16')]);}else{logger[_0xc5ad('0x10')](_0xc5ad('0x11'),_0x4d0e7e,_0xc5ad('0x17'));_0x3b36a1(_0x174bed[_0xc5ad('0x18')][_0xc5ad('0x16')]);}})['catch'](function(_0x5db34c){logger['error'](_0xc5ad('0x11'),_0x4d0e7e,_0x5db34c);_0x404e88(_0x5db34c);});});}exports[_0xc5ad('0x19')]=function(_0x292288){var _0x18e1dd=this;return new Promise(function(_0x59224d,_0x4f08ed){return db[_0xc5ad('0x1a')][_0xc5ad('0x1b')](_0x292288[_0xc5ad('0x1c')],{'raw':_0x292288['options']?_0x292288['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x292288[_0xc5ad('0x1d')]?_0x292288[_0xc5ad('0x1d')][_0xc5ad('0x1e')]||null:null,'attributes':_0x292288['options']?_0x292288[_0xc5ad('0x1d')][_0xc5ad('0x1f')]||null:null,'limit':_0x292288[_0xc5ad('0x1d')]?_0x292288['options'][_0xc5ad('0x20')]||null:null})[_0xc5ad('0x21')](function(_0x2475c2){logger[_0xc5ad('0x10')](_0xc5ad('0x19'),_0x292288);logger[_0xc5ad('0x12')]('UpdateChatInteraction',_0x292288,JSON['stringify'](_0x2475c2));_0x59224d(_0x2475c2);})[_0xc5ad('0x22')](function(_0x2a73cd){logger[_0xc5ad('0x14')]('UpdateChatInteraction',_0x2a73cd[_0xc5ad('0x16')],_0x292288);_0x4f08ed(_0x18e1dd['error'](0x1f4,_0x2a73cd[_0xc5ad('0x16')]));});});};exports[_0xc5ad('0x23')]=function(_0x13bbba){return new Promise(function(_0x9e48d7,_0x4b95a9){return db['ChatInteraction'][_0xc5ad('0x24')]({'where':_0x13bbba['options']?_0x13bbba[_0xc5ad('0x1d')][_0xc5ad('0x1e')]||null:null})[_0xc5ad('0x21')](function(_0x3aa706){if(_0x3aa706){return _0x3aa706['addTags'](_0x13bbba['body']['ids'],_[_0xc5ad('0x25')](_0x13bbba[_0xc5ad('0x1c')],['ids','id'])||{});}})[_0xc5ad('0x26')](function(_0xe900c5){logger[_0xc5ad('0x10')](_0xc5ad('0x27'),_0x13bbba);logger['debug']('AddTags',_0x13bbba,JSON[_0xc5ad('0x28')](_0xe900c5));_0x9e48d7(_0xe900c5);})['catch'](function(_0x591763){logger['error']('AddTags',_0x591763[_0xc5ad('0x16')],_0x13bbba);_0x4b95a9(_this['error'](0x1f4,_0x591763[_0xc5ad('0x16')]));});});};
\ No newline at end of file
index 34f6a60..a63c3bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f80=['save','remove','emit','register','chatInteraction:','./chatInteraction.events'];(function(_0x1dae94,_0x239003){var _0x36ce2d=function(_0x295f18){while(--_0x295f18){_0x1dae94['push'](_0x1dae94['shift']());}};_0x36ce2d(++_0x239003);}(_0x4f80,0xcb));var _0x04f8=function(_0x234ce7,_0x3e909c){_0x234ce7=_0x234ce7-0x0;var _0x57c561=_0x4f80[_0x234ce7];return _0x57c561;};'use strict';var ChatInteractionEvents=require(_0x04f8('0x0'));var events=[_0x04f8('0x1'),_0x04f8('0x2'),'update'];function createListener(_0x3e61d0,_0xaccb55){return function(_0x252ef1){_0xaccb55[_0x04f8('0x3')](_0x3e61d0,_0x252ef1);};}function removeListener(_0x3a4eab,_0x37dd7c){return function(){ChatInteractionEvents['removeListener'](_0x3a4eab,_0x37dd7c);};}exports[_0x04f8('0x4')]=function(_0x520bd8){for(var _0x56b3ad=0x0,_0x255cd0=events['length'];_0x56b3ad<_0x255cd0;_0x56b3ad++){var _0x201be1=events[_0x56b3ad];var _0x3a77d6=createListener(_0x04f8('0x5')+_0x201be1,_0x520bd8);ChatInteractionEvents['on'](_0x201be1,_0x3a77d6);}};
\ No newline at end of file
+var _0x9d89=['register','length','chatInteraction:','remove','emit','removeListener'];(function(_0x5851c0,_0x3f4287){var _0x408a1c=function(_0x3f8794){while(--_0x3f8794){_0x5851c0['push'](_0x5851c0['shift']());}};_0x408a1c(++_0x3f4287);}(_0x9d89,0xd5));var _0x99d8=function(_0x191ee1,_0x43e84c){_0x191ee1=_0x191ee1-0x0;var _0x5e0942=_0x9d89[_0x191ee1];return _0x5e0942;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x99d8('0x0'),'update'];function createListener(_0x421c7f,_0x3f00cb){return function(_0x712a3e){_0x3f00cb[_0x99d8('0x1')](_0x421c7f,_0x712a3e);};}function removeListener(_0x25fd10,_0x1428de){return function(){ChatInteractionEvents[_0x99d8('0x2')](_0x25fd10,_0x1428de);};}exports[_0x99d8('0x3')]=function(_0xe8b79b){for(var _0x1c814a=0x0,_0x34f4d4=events[_0x99d8('0x4')];_0x1c814a<_0x34f4d4;_0x1c814a++){var _0x18e11b=events[_0x1c814a];var _0x336de3=createListener(_0x99d8('0x5')+_0x18e11b,_0xe8b79b);ChatInteractionEvents['on'](_0x18e11b,_0x336de3);}};
\ No newline at end of file
index c839059..080fc5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3737=['download','create','post','/:id/vidaoo','createVidaooSession','join','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/download'];(function(_0x849cf9,_0x2f0f0b){var _0x35b75c=function(_0x15f19f){while(--_0x15f19f){_0x849cf9['push'](_0x849cf9['shift']());}};_0x35b75c(++_0x2f0f0b);}(_0x3737,0x120));var _0x7373=function(_0x483456,_0x4fb1f4){_0x483456=_0x483456-0x0;var _0x2bf147=_0x3737[_0x483456];return _0x2bf147;};'use strict';var multer=require('multer');var util=require(_0x7373('0x0'));var path=require(_0x7373('0x1'));var timeout=require(_0x7373('0x2'));var express=require('express');var router=express[_0x7373('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7373('0x4'));var interaction=require(_0x7373('0x5'));var config=require(_0x7373('0x6'));var controller=require(_0x7373('0x7'));router[_0x7373('0x8')]('/',auth[_0x7373('0x9')](),controller[_0x7373('0xa')]);router[_0x7373('0x8')]('/describe',auth[_0x7373('0x9')](),controller['describe']);router['get'](_0x7373('0xb'),auth[_0x7373('0xc')](),controller[_0x7373('0xd')]);router[_0x7373('0x8')](_0x7373('0xe'),auth[_0x7373('0xc')](),controller['attachmentDownload']);router[_0x7373('0x8')](_0x7373('0xf'),auth[_0x7373('0x9')](),controller[_0x7373('0x10')]);router[_0x7373('0x8')]('/:id/my_messages',auth[_0x7373('0xc')](),controller['getMyMessages']);router[_0x7373('0x8')](_0x7373('0x11'),auth[_0x7373('0x9')](),controller[_0x7373('0x12')]);router['post']('/',auth[_0x7373('0x9')](),controller[_0x7373('0x13')]);router[_0x7373('0x14')](_0x7373('0x15'),auth[_0x7373('0x9')](),controller[_0x7373('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc4e0db,_0x4c33b8,_0x1c974b){_0x1c974b(null,path[_0x7373('0x17')](config[_0x7373('0x18')],'server/files/attachments/'));},'filename':function(_0x2fa775,_0xe05a32,_0x91c8e9){_0x91c8e9(null,util[_0x7373('0x19')](_0x7373('0x1a'),Date[_0x7373('0x1b')](),_0xe05a32[_0x7373('0x1c')][_0x7373('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x7373('0x14')](_0x7373('0x1e'),upload[_0x7373('0x1f')]('file'),controller[_0x7373('0x20')]);router[_0x7373('0x14')](_0x7373('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x7373('0x21')]);router[_0x7373('0x14')](_0x7373('0x22'),auth[_0x7373('0x9')](),interaction[_0x7373('0x23')](_0x7373('0x24'),_0x7373('0x25')),controller[_0x7373('0x26')]);router[_0x7373('0x27')](_0x7373('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0x7373('0x24'),_0x7373('0x28')),controller[_0x7373('0x29')]);router[_0x7373('0x27')](_0x7373('0x2a'),controller[_0x7373('0x2b')]);router[_0x7373('0x27')](_0x7373('0x2c'),auth[_0x7373('0xc')](),controller['abandon']);router['put'](_0x7373('0x2d'),controller[_0x7373('0x2e')]);router[_0x7373('0x2f')]('/:id',auth[_0x7373('0x9')](),interaction[_0x7373('0x23')](_0x7373('0x24'),_0x7373('0x30')),controller[_0x7373('0x31')]);router[_0x7373('0x2f')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7373('0x32')]);module['exports']=router;
\ No newline at end of file
+var _0x97f4=['isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/','format','%s-%s','now','originalname','single','file','attachmentUpload','chatinteraction:addtags','addTags','put','tracked','chat','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','chatinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','/describe'];(function(_0xbac7a6,_0x1cc55f){var _0x41e7e9=function(_0x2d4b01){while(--_0x2d4b01){_0xbac7a6['push'](_0xbac7a6['shift']());}};_0x41e7e9(++_0x1cc55f);}(_0x97f4,0x94));var _0x497f=function(_0x53dc2f,_0x433560){_0x53dc2f=_0x53dc2f-0x0;var _0x275565=_0x97f4[_0x53dc2f];return _0x275565;};'use strict';var multer=require(_0x497f('0x0'));var util=require(_0x497f('0x1'));var path=require(_0x497f('0x2'));var timeout=require('connect-timeout');var express=require(_0x497f('0x3'));var router=express[_0x497f('0x4')]();var fs_extra=require(_0x497f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x497f('0x6'));var config=require(_0x497f('0x7'));var controller=require(_0x497f('0x8'));router[_0x497f('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x497f('0x9')](_0x497f('0xa'),auth[_0x497f('0xb')](),controller[_0x497f('0xc')]);router['get'](_0x497f('0xd'),auth[_0x497f('0xe')](),controller[_0x497f('0xf')]);router[_0x497f('0x9')](_0x497f('0x10'),auth[_0x497f('0xe')](),controller[_0x497f('0x11')]);router['get'](_0x497f('0x12'),auth[_0x497f('0xb')](),controller[_0x497f('0x13')]);router['get'](_0x497f('0x14'),auth[_0x497f('0xe')](),controller[_0x497f('0x15')]);router[_0x497f('0x9')]('/:id/download',auth[_0x497f('0xb')](),controller[_0x497f('0x16')]);router[_0x497f('0x17')]('/',auth[_0x497f('0xb')](),controller[_0x497f('0x18')]);router['post'](_0x497f('0x19'),auth['isAuthenticated'](),controller[_0x497f('0x1a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c8e00,_0x15ddb5,_0x17d051){_0x17d051(null,path[_0x497f('0x1b')](config[_0x497f('0x1c')],_0x497f('0x1d')));},'filename':function(_0x1d5889,_0x687595,_0x1f61dd){_0x1f61dd(null,util[_0x497f('0x1e')](_0x497f('0x1f'),Date[_0x497f('0x20')](),_0x687595[_0x497f('0x21')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x497f('0x22')](_0x497f('0x23')),controller[_0x497f('0x24')]);router[_0x497f('0x17')](_0x497f('0x12'),auth[_0x497f('0xe')](),controller['addMessage']);router[_0x497f('0x17')]('/:id/tags',auth['isAuthenticated'](),interaction['tracked']('chat',_0x497f('0x25')),controller[_0x497f('0x26')]);router[_0x497f('0x27')](_0x497f('0xd'),auth[_0x497f('0xb')](),interaction[_0x497f('0x28')](_0x497f('0x29'),'chatinteraction:update'),controller[_0x497f('0x2a')]);router[_0x497f('0x27')](_0x497f('0x2b'),controller[_0x497f('0x2c')]);router['put'](_0x497f('0x2d'),auth[_0x497f('0xe')](),controller['abandon']);router[_0x497f('0x27')](_0x497f('0x2e'),controller[_0x497f('0x2f')]);router['delete'](_0x497f('0xd'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x497f('0x30')),controller[_0x497f('0x31')]);router['delete'](_0x497f('0x32'),auth[_0x497f('0xb')](),controller[_0x497f('0x33')]);module[_0x497f('0x34')]=router;
\ No newline at end of file
index 3a8ee26..2d53375 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef5a=['TEXT','medium','BOOLEAN','INTEGER','exports'];(function(_0x3cb316,_0x350f2a){var _0x356dca=function(_0xae24b5){while(--_0xae24b5){_0x3cb316['push'](_0x3cb316['shift']());}};_0x356dca(++_0x350f2a);}(_0xef5a,0xe0));var _0xaef5=function(_0x312a0b,_0x2d71ba){_0x312a0b=_0x312a0b-0x0;var _0x501292=_0xef5a[_0x312a0b];return _0x501292;};'use strict';var Sequelize=require('sequelize');module[_0xaef5('0x0')]={'body':{'type':Sequelize[_0xaef5('0x1')](_0xaef5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xaef5('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xaef5('0x4')]}};
\ No newline at end of file
+var _0x3e94=['medium','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x406ae7,_0x12181b){var _0x5a5b9d=function(_0x3f20c2){while(--_0x3f20c2){_0x406ae7['push'](_0x406ae7['shift']());}};_0x5a5b9d(++_0x12181b);}(_0x3e94,0x1e3));var _0x43e9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3e94[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x43e9('0x0'));module[_0x43e9('0x1')]={'body':{'type':Sequelize['TEXT'](_0x43e9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x43e9('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x43e9('0x4')]}};
\ No newline at end of file
index 0eb2d11..8052889 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebfb=['format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','UserProfileResource','resourceId','push','messages','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','ChatInternalMessage','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','get','lastMessageAt','createdAt','lastMessage'];(function(_0x51aaaf,_0x133068){var _0x34399f=function(_0x43eb01){while(--_0x43eb01){_0x51aaaf['push'](_0x51aaaf['shift']());}};_0x34399f(++_0x133068);}(_0xebfb,0x91));var _0xbebf=function(_0x1c208e,_0x2a0a5b){_0x1c208e=_0x1c208e-0x0;var _0x5104ff=_0xebfb[_0x1c208e];return _0x5104ff;};'use strict';var emlformat=require(_0xbebf('0x0'));var rimraf=require(_0xbebf('0x1'));var zipdir=require(_0xbebf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbebf('0x3'));var moment=require(_0xbebf('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbebf('0x5'));var path=require(_0xbebf('0x6'));var sox=require(_0xbebf('0x7'));var csv=require(_0xbebf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbebf('0x9'));var _=require('lodash');var squel=require(_0xbebf('0xa'));var crypto=require('crypto');var jsforce=require(_0xbebf('0xb'));var deskjs=require(_0xbebf('0xc'));var toCsv=require(_0xbebf('0x8'));var querystring=require(_0xbebf('0xd'));var Papa=require(_0xbebf('0xe'));var Redis=require(_0xbebf('0xf'));var authService=require(_0xbebf('0x10'));var qs=require(_0xbebf('0x11'));var as=require(_0xbebf('0x12'));var hardwareService=require(_0xbebf('0x13'));var logger=require(_0xbebf('0x14'))(_0xbebf('0x15'));var utils=require('../../config/utils');var config=require(_0xbebf('0x16'));var licenseUtil=require(_0xbebf('0x17'));var db=require(_0xbebf('0x18'))['db'];config['redis']=_[_0xbebf('0x19')](config[_0xbebf('0x1a')],{'host':_0xbebf('0x1b'),'port':0x18eb});var socket=require(_0xbebf('0x1c'))(new Redis(config[_0xbebf('0x1a')]));require(_0xbebf('0x1d'))['register'](socket);function respondWithStatusCode(_0x52e90d,_0x4d1870){_0x4d1870=_0x4d1870||0xcc;return function(_0x9eb052){if(_0x9eb052){return _0x52e90d[_0xbebf('0x1e')](_0x4d1870);}return _0x52e90d[_0xbebf('0x1f')](_0x4d1870)[_0xbebf('0x20')]();};}function respondWithResult(_0x3f8bc2,_0x1e90f2){_0x1e90f2=_0x1e90f2||0xc8;return function(_0x56940c){if(_0x56940c){return _0x3f8bc2['status'](_0x1e90f2)[_0xbebf('0x21')](_0x56940c);}};}function respondWithFilteredResult(_0x1bc99f,_0x1cee9b){return function(_0x57a330){if(_0x57a330){var _0x45d1bd=typeof _0x1cee9b[_0xbebf('0x22')]==='undefined'&&typeof _0x1cee9b[_0xbebf('0x23')]==='undefined';var _0x1815e0=_0x57a330[_0xbebf('0x24')];var _0x46efa6=_0x45d1bd?0x0:_0x1cee9b[_0xbebf('0x22')];var _0x5b152a=_0x45d1bd?_0x57a330[_0xbebf('0x24')]:_0x1cee9b['offset']+_0x1cee9b[_0xbebf('0x23')];var _0x295e44;if(_0x5b152a>=_0x1815e0){_0x5b152a=_0x1815e0;_0x295e44=0xc8;}else{_0x295e44=0xce;}_0x1bc99f[_0xbebf('0x1f')](_0x295e44);return _0x1bc99f[_0xbebf('0x25')](_0xbebf('0x26'),_0x46efa6+'-'+_0x5b152a+'/'+_0x1815e0)[_0xbebf('0x21')](_0x57a330);}return null;};}function patchUpdates(_0x1f5236){return function(_0x2b120c){try{jsonpatch[_0xbebf('0x27')](_0x2b120c,_0x1f5236,!![]);}catch(_0x57bdae){return BPromise[_0xbebf('0x28')](_0x57bdae);}return _0x2b120c[_0xbebf('0x29')]();};}function saveUpdates(_0x21dd7f,_0x2c3efd){return function(_0x4e13c1){if(_0x4e13c1){return _0x4e13c1['update'](_0x21dd7f)[_0xbebf('0x2a')](function(_0x101eff){return _0x101eff;});}return null;};}function removeEntity(_0x12a05f,_0x4ca429){return function(_0x1d51ac){if(_0x1d51ac){return _0x1d51ac[_0xbebf('0x2b')]()[_0xbebf('0x2a')](function(){_0x12a05f[_0xbebf('0x1f')](0xcc)[_0xbebf('0x20')]();});}};}function handleEntityNotFound(_0x2a3016,_0x45d769){return function(_0x1743dd){if(!_0x1743dd){_0x2a3016[_0xbebf('0x1e')](0x194);}return _0x1743dd;};}function handleError(_0x312565,_0x4015b2){_0x4015b2=_0x4015b2||0x1f4;return function(_0x2cf79f){logger['error'](_0x2cf79f['stack']);if(_0x2cf79f[_0xbebf('0x2c')]){delete _0x2cf79f[_0xbebf('0x2c')];}_0x312565[_0xbebf('0x1f')](_0x4015b2)[_0xbebf('0x2d')](_0x2cf79f);};}exports[_0xbebf('0x2e')]=function(_0x1d5165,_0x3b8db6){var _0x44a943={},_0xcbf2bf={},_0x29bf4f={'count':0x0,'rows':[]};var _0x431734=_[_0xbebf('0x2f')](db[_0xbebf('0x30')][_0xbebf('0x31')],function(_0x917f9c){return{'name':_0x917f9c['fieldName'],'type':_0x917f9c['type'][_0xbebf('0x32')]};});_0xcbf2bf[_0xbebf('0x33')]=_[_0xbebf('0x2f')](_0x431734,_0xbebf('0x2c'));_0xcbf2bf['query']=_[_0xbebf('0x34')](_0x1d5165[_0xbebf('0x35')]);_0xcbf2bf[_0xbebf('0x36')]=_[_0xbebf('0x37')](_0xcbf2bf[_0xbebf('0x33')],_0xcbf2bf[_0xbebf('0x35')]);_0x44a943[_0xbebf('0x38')]=_['intersection'](_0xcbf2bf[_0xbebf('0x33')],qs[_0xbebf('0x39')](_0x1d5165[_0xbebf('0x35')]['fields']));_0x44a943[_0xbebf('0x38')]=_0x44a943[_0xbebf('0x38')][_0xbebf('0x3a')]?_0x44a943['attributes']:_0xcbf2bf[_0xbebf('0x33')];if(!_0x1d5165[_0xbebf('0x35')][_0xbebf('0x3b')](_0xbebf('0x3c'))){_0x44a943[_0xbebf('0x23')]=qs[_0xbebf('0x23')](_0x1d5165[_0xbebf('0x35')][_0xbebf('0x23')]);_0x44a943['offset']=qs[_0xbebf('0x22')](_0x1d5165['query'][_0xbebf('0x22')]);}_0x44a943['order']=qs[_0xbebf('0x3d')](_0x1d5165[_0xbebf('0x35')][_0xbebf('0x3d')]);_0x44a943[_0xbebf('0x3e')]=qs['filters'](_[_0xbebf('0x3f')](_0x1d5165[_0xbebf('0x35')],_0xcbf2bf['filters']),_0x431734);if(_0x1d5165[_0xbebf('0x35')][_0xbebf('0x40')]){_0x44a943[_0xbebf('0x3e')]=_[_0xbebf('0x41')](_0x44a943[_0xbebf('0x3e')],{'$or':_[_0xbebf('0x2f')](_0x431734,function(_0x15e14d){if(_0x15e14d[_0xbebf('0x42')]!==_0xbebf('0x43')){var _0x307db9={};_0x307db9[_0x15e14d[_0xbebf('0x2c')]]={'$like':'%'+_0x1d5165[_0xbebf('0x35')][_0xbebf('0x40')]+'%'};return _0x307db9;}})});}_0x44a943=_[_0xbebf('0x41')]({},_0x44a943,_0x1d5165[_0xbebf('0x44')]);var _0x51e27a={'where':_0x44a943['where']};return db[_0xbebf('0x30')][_0xbebf('0x24')](_0x51e27a)[_0xbebf('0x2a')](function(_0x41abfd){_0x29bf4f['count']=_0x41abfd;if(_0x1d5165['query'][_0xbebf('0x45')]){_0x44a943[_0xbebf('0x46')]=[{'all':!![]}];}return db[_0xbebf('0x30')][_0xbebf('0x47')](_0x44a943);})[_0xbebf('0x2a')](function(_0x3667bf){_0x29bf4f[_0xbebf('0x48')]=_0x3667bf;return _0x29bf4f;})[_0xbebf('0x2a')](respondWithFilteredResult(_0x3b8db6,_0x44a943))[_0xbebf('0x49')](handleError(_0x3b8db6,null));};exports[_0xbebf('0x4a')]=function(_0x10665a,_0x56d008){var _0xa33689={'raw':!![],'where':{'id':_0x10665a[_0xbebf('0x4b')]['id']}},_0x5717c9={};_0x5717c9['model']=_['keys'](db['ChatInternalMessage'][_0xbebf('0x31')]);_0x5717c9[_0xbebf('0x35')]=_[_0xbebf('0x34')](_0x10665a[_0xbebf('0x35')]);_0x5717c9[_0xbebf('0x36')]=_[_0xbebf('0x37')](_0x5717c9[_0xbebf('0x33')],_0x5717c9['query']);_0xa33689[_0xbebf('0x38')]=_[_0xbebf('0x37')](_0x5717c9['model'],qs[_0xbebf('0x39')](_0x10665a[_0xbebf('0x35')][_0xbebf('0x39')]));_0xa33689[_0xbebf('0x38')]=_0xa33689[_0xbebf('0x38')]['length']?_0xa33689[_0xbebf('0x38')]:_0x5717c9[_0xbebf('0x33')];if(_0x10665a[_0xbebf('0x35')]['includeAll']){_0xa33689[_0xbebf('0x46')]=[{'all':!![]}];}_0xa33689=_[_0xbebf('0x41')]({},_0xa33689,_0x10665a['options']);return db['ChatInternalMessage'][_0xbebf('0x4c')](_0xa33689)[_0xbebf('0x2a')](handleEntityNotFound(_0x56d008,null))[_0xbebf('0x2a')](respondWithResult(_0x56d008,null))[_0xbebf('0x49')](handleError(_0x56d008,null));};exports[_0xbebf('0x4d')]=function(_0x53b46f,_0x4833f7){return db['ChatInternalMessage'][_0xbebf('0x4d')](_0x53b46f[_0xbebf('0x4e')],{})['then'](respondWithResult(_0x4833f7,0xc9))['catch'](handleError(_0x4833f7,null));};exports[_0xbebf('0x4f')]=function(_0x5dcad6,_0x32f82b){if(_0x5dcad6[_0xbebf('0x4e')]['id']){delete _0x5dcad6[_0xbebf('0x4e')]['id'];}return db['ChatInternalMessage']['find']({'where':{'id':_0x5dcad6[_0xbebf('0x4b')]['id']}})[_0xbebf('0x2a')](handleEntityNotFound(_0x32f82b,null))[_0xbebf('0x2a')](saveUpdates(_0x5dcad6[_0xbebf('0x4e')],null))['then'](respondWithResult(_0x32f82b,null))[_0xbebf('0x49')](handleError(_0x32f82b,null));};exports[_0xbebf('0x2b')]=function(_0x238708,_0x37b227){return db[_0xbebf('0x30')][_0xbebf('0x4c')]({'where':{'id':_0x238708[_0xbebf('0x4b')]['id']}})['then'](handleEntityNotFound(_0x37b227,null))[_0xbebf('0x2a')](removeEntity(_0x37b227,null))['catch'](handleError(_0x37b227,null));};exports['describe']=function(_0x3b7f2f,_0x420b94){return db[_0xbebf('0x30')][_0xbebf('0x50')]()[_0xbebf('0x2a')](respondWithResult(_0x420b94,null))['catch'](handleError(_0x420b94,null));};function wrapUser(_0x4cd13d){return function(_0x5476cd){var _0x1e5be9=_0x4cd13d[_0xbebf('0x51')]({'plain':!![]});_0x1e5be9['messages']=[];if(_0x5476cd){_0x1e5be9[_0xbebf('0x52')]=_0x5476cd[_0xbebf('0x53')];_0x1e5be9[_0xbebf('0x54')]=_0x5476cd;}else{_0x1e5be9['lastMessageAt']=moment(0x0)[_0xbebf('0x55')](_0xbebf('0x56'));_0x1e5be9[_0xbebf('0x54')]={};}return _0x1e5be9;};}exports[_0xbebf('0x57')]=function(_0x25246e,_0x50e6be,_0x3aea07){var _0x387d3f=[];return db[_0xbebf('0x58')][_0xbebf('0x47')]({'where':{'role':[_0xbebf('0x59'),_0xbebf('0x5a'),_0xbebf('0x5b')]},'attributes':['id',_0xbebf('0x5c'),'name',_0xbebf('0x5d'),_0xbebf('0x5e'),_0xbebf('0x5f'),_0xbebf('0x60'),'lastLoginAt',_0xbebf('0x61'),_0xbebf('0x62')],'order':qs[_0xbebf('0x3d')](_0xbebf('0x63')),'include':[{'model':db[_0xbebf('0x64')],'as':_0xbebf('0x65'),'attributes':['id','name',_0xbebf('0x42')],'through':{'attributes':[]}}]})[_0xbebf('0x2a')](function(_0x2b831e){if(_0x2b831e){var _0x5a251c=_0x25246e['user']['get']({'plain':!![]});if(!_0x5a251c)throw new Error(_0xbebf('0x66'));if(_0x5a251c[_0xbebf('0x5d')]===_0xbebf('0x5b')){return db[_0xbebf('0x67')][_0xbebf('0x4c')]({'where':{'name':_0xbebf('0x68'),'userProfileId':_0x5a251c[_0xbebf('0x69')]},'raw':!![]})[_0xbebf('0x2a')](function(_0x55d259){if(_0x55d259){if(_0x55d259['autoAssociation']===0x0){return db[_0xbebf('0x6a')][_0xbebf('0x47')]({'where':{'sectionId':_0x55d259['id']},'raw':!![]})[_0xbebf('0x2a')](function(_0xa120df){var _0x30af6c=[];if(_['isEmpty'](_0xa120df)){_0x30af6c=_[_0xbebf('0x40')](_0x2b831e,function(_0xd5f1d0){if(_0xd5f1d0[_0xbebf('0x5d')]!==_0xbebf('0x59')){return _0xd5f1d0;}});return _0x30af6c;}else{for(var _0x2a45dc=0x0;_0x2a45dc<_0x2b831e[_0xbebf('0x3a')];_0x2a45dc++){var _0x38cca6=_0x2b831e[_0x2a45dc];if(_0x38cca6[_0xbebf('0x5d')]==='agent'){var _0x38b335=_[_0xbebf('0x4c')](_0xa120df,function(_0xe692f7){return _0xe692f7[_0xbebf('0x6b')]===_0x38cca6['id'];});if(_0x38b335)_0x30af6c[_0xbebf('0x6c')](_0x38cca6);}else{_0x30af6c[_0xbebf('0x6c')](_0x38cca6);}}return _0x30af6c;}});}else{return _0x2b831e;}}else{var _0x51ef5d=_[_0xbebf('0x40')](_0x2b831e,function(_0x554d00){if(_0x554d00[_0xbebf('0x5d')]!=='agent'){return _0x554d00;}});return _0x51ef5d;}});}else{return _0x2b831e;}}})[_0xbebf('0x2a')](function(_0x19cb37){var _0x252517=[];if(_0x19cb37){_0x387d3f=_0x19cb37;for(var _0x33aa1c=0x0;_0x33aa1c<_0x19cb37[_0xbebf('0x3a')];_0x33aa1c+=0x1){_0x387d3f[_0x33aa1c][_0xbebf('0x6d')]=[];_0x252517['push'](db[_0xbebf('0x30')][_0xbebf('0x4c')]({'where':{'FromId':[_0x25246e['user']['id'],_0x19cb37[_0x33aa1c]['id']],'ToId':[_0x25246e[_0xbebf('0x5b')]['id'],_0x19cb37[_0x33aa1c]['id']],'ChatGroupId':null},'attributes':['id',_0xbebf('0x53'),_0xbebf('0x6e'),_0xbebf('0x6f'),_0xbebf('0x70'),_0xbebf('0x4e')],'order':qs[_0xbebf('0x3d')](_0xbebf('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x19cb37[_0x33aa1c])));}return BPromise[_0xbebf('0x72')](_0x252517);}return[];})[_0xbebf('0x2a')](function(_0x4b9fde){return{'rows':_0x4b9fde,'count':_0x4b9fde[_0xbebf('0x3a')]};})[_0xbebf('0x2a')](respondWithResult(_0x50e6be,null))[_0xbebf('0x49')](handleError(_0x50e6be,null));};
\ No newline at end of file
+var _0x56a7=['userProfileId','autoAssociation','UserProfileResource','isEmpty','role','resourceId','messages','push','ToId','read','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','create','body','find','describe','lastMessageAt','createdAt','lastMessage','format','getUsers','User','agent','user','fullname','userpic','internal','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection'];(function(_0x1e98f6,_0x454ce1){var _0x54e601=function(_0x148ac3){while(--_0x148ac3){_0x1e98f6['push'](_0x1e98f6['shift']());}};_0x54e601(++_0x454ce1);}(_0x56a7,0x77));var _0x756a=function(_0x2ef8f1,_0x1280a3){_0x2ef8f1=_0x2ef8f1-0x0;var _0x17498d=_0x56a7[_0x2ef8f1];return _0x17498d;};'use strict';var emlformat=require(_0x756a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x756a('0x1'));var jsonpatch=require(_0x756a('0x2'));var rp=require(_0x756a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x756a('0x4'));var util=require(_0x756a('0x5'));var path=require(_0x756a('0x6'));var sox=require('sox');var csv=require(_0x756a('0x7'));var ejs=require(_0x756a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x756a('0x9'));var squel=require(_0x756a('0xa'));var crypto=require(_0x756a('0xb'));var jsforce=require(_0x756a('0xc'));var deskjs=require(_0x756a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x756a('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x756a('0xf'));var qs=require(_0x756a('0x10'));var as=require(_0x756a('0x11'));var hardwareService=require(_0x756a('0x12'));var logger=require('../../config/logger')(_0x756a('0x13'));var utils=require(_0x756a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x756a('0x15'));var db=require('../../mysqldb')['db'];config[_0x756a('0x16')]=_[_0x756a('0x17')](config['redis'],{'host':_0x756a('0x18'),'port':0x18eb});var socket=require(_0x756a('0x19'))(new Redis(config[_0x756a('0x16')]));require('./chatInternalMessage.socket')[_0x756a('0x1a')](socket);function respondWithStatusCode(_0x6e2cd8,_0x1e2b03){_0x1e2b03=_0x1e2b03||0xcc;return function(_0x2c0fd7){if(_0x2c0fd7){return _0x6e2cd8['sendStatus'](_0x1e2b03);}return _0x6e2cd8['status'](_0x1e2b03)['end']();};}function respondWithResult(_0x401140,_0x6487de){_0x6487de=_0x6487de||0xc8;return function(_0x3a8d9d){if(_0x3a8d9d){return _0x401140['status'](_0x6487de)[_0x756a('0x1b')](_0x3a8d9d);}};}function respondWithFilteredResult(_0x36c858,_0x29d0c7){return function(_0x1f552d){if(_0x1f552d){var _0x32773a=typeof _0x29d0c7[_0x756a('0x1c')]===_0x756a('0x1d')&&typeof _0x29d0c7[_0x756a('0x1e')]===_0x756a('0x1d');var _0x143757=_0x1f552d[_0x756a('0x1f')];var _0x27b367=_0x32773a?0x0:_0x29d0c7[_0x756a('0x1c')];var _0x3c58c3=_0x32773a?_0x1f552d[_0x756a('0x1f')]:_0x29d0c7['offset']+_0x29d0c7[_0x756a('0x1e')];var _0x3fc115;if(_0x3c58c3>=_0x143757){_0x3c58c3=_0x143757;_0x3fc115=0xc8;}else{_0x3fc115=0xce;}_0x36c858[_0x756a('0x20')](_0x3fc115);return _0x36c858['set'](_0x756a('0x21'),_0x27b367+'-'+_0x3c58c3+'/'+_0x143757)[_0x756a('0x1b')](_0x1f552d);}return null;};}function patchUpdates(_0x30c626){return function(_0x55fd84){try{jsonpatch[_0x756a('0x22')](_0x55fd84,_0x30c626,!![]);}catch(_0x3423ff){return BPromise[_0x756a('0x23')](_0x3423ff);}return _0x55fd84[_0x756a('0x24')]();};}function saveUpdates(_0x5b28f7,_0x5d5db6){return function(_0x98f872){if(_0x98f872){return _0x98f872[_0x756a('0x25')](_0x5b28f7)['then'](function(_0x59d914){return _0x59d914;});}return null;};}function removeEntity(_0x1be1d7,_0x44cd1f){return function(_0x5290ab){if(_0x5290ab){return _0x5290ab[_0x756a('0x26')]()[_0x756a('0x27')](function(){_0x1be1d7[_0x756a('0x20')](0xcc)[_0x756a('0x28')]();});}};}function handleEntityNotFound(_0x192785,_0x416693){return function(_0x5e762e){if(!_0x5e762e){_0x192785[_0x756a('0x29')](0x194);}return _0x5e762e;};}function handleError(_0x46c147,_0x157dcc){_0x157dcc=_0x157dcc||0x1f4;return function(_0x38fcc3){logger[_0x756a('0x2a')](_0x38fcc3[_0x756a('0x2b')]);if(_0x38fcc3[_0x756a('0x2c')]){delete _0x38fcc3[_0x756a('0x2c')];}_0x46c147['status'](_0x157dcc)[_0x756a('0x2d')](_0x38fcc3);};}exports[_0x756a('0x2e')]=function(_0x2060ff,_0x155585){var _0x45b997={},_0x5a65e7={},_0x297553={'count':0x0,'rows':[]};var _0x323fe0=_[_0x756a('0x2f')](db[_0x756a('0x30')][_0x756a('0x31')],function(_0x2d6c81){return{'name':_0x2d6c81[_0x756a('0x32')],'type':_0x2d6c81[_0x756a('0x33')][_0x756a('0x34')]};});_0x5a65e7[_0x756a('0x35')]=_[_0x756a('0x2f')](_0x323fe0,_0x756a('0x2c'));_0x5a65e7[_0x756a('0x36')]=_[_0x756a('0x37')](_0x2060ff['query']);_0x5a65e7[_0x756a('0x38')]=_['intersection'](_0x5a65e7[_0x756a('0x35')],_0x5a65e7[_0x756a('0x36')]);_0x45b997[_0x756a('0x39')]=_[_0x756a('0x3a')](_0x5a65e7['model'],qs['fields'](_0x2060ff[_0x756a('0x36')][_0x756a('0x3b')]));_0x45b997[_0x756a('0x39')]=_0x45b997[_0x756a('0x39')][_0x756a('0x3c')]?_0x45b997[_0x756a('0x39')]:_0x5a65e7[_0x756a('0x35')];if(!_0x2060ff[_0x756a('0x36')][_0x756a('0x3d')](_0x756a('0x3e'))){_0x45b997[_0x756a('0x1e')]=qs[_0x756a('0x1e')](_0x2060ff['query']['limit']);_0x45b997[_0x756a('0x1c')]=qs[_0x756a('0x1c')](_0x2060ff[_0x756a('0x36')]['offset']);}_0x45b997['order']=qs[_0x756a('0x3f')](_0x2060ff['query'][_0x756a('0x3f')]);_0x45b997['where']=qs[_0x756a('0x38')](_[_0x756a('0x40')](_0x2060ff[_0x756a('0x36')],_0x5a65e7['filters']),_0x323fe0);if(_0x2060ff[_0x756a('0x36')][_0x756a('0x41')]){_0x45b997[_0x756a('0x42')]=_['merge'](_0x45b997['where'],{'$or':_[_0x756a('0x2f')](_0x323fe0,function(_0x314a7d){if(_0x314a7d['type']!==_0x756a('0x43')){var _0x2d97e7={};_0x2d97e7[_0x314a7d[_0x756a('0x2c')]]={'$like':'%'+_0x2060ff[_0x756a('0x36')]['filter']+'%'};return _0x2d97e7;}})});}_0x45b997=_[_0x756a('0x44')]({},_0x45b997,_0x2060ff[_0x756a('0x45')]);var _0x270a7d={'where':_0x45b997[_0x756a('0x42')]};return db[_0x756a('0x30')][_0x756a('0x1f')](_0x270a7d)[_0x756a('0x27')](function(_0x5cde78){_0x297553[_0x756a('0x1f')]=_0x5cde78;if(_0x2060ff['query']['includeAll']){_0x45b997[_0x756a('0x46')]=[{'all':!![]}];}return db[_0x756a('0x30')][_0x756a('0x47')](_0x45b997);})[_0x756a('0x27')](function(_0x129f5){_0x297553[_0x756a('0x48')]=_0x129f5;return _0x297553;})['then'](respondWithFilteredResult(_0x155585,_0x45b997))[_0x756a('0x49')](handleError(_0x155585,null));};exports[_0x756a('0x4a')]=function(_0x5d8d45,_0x3f80be){var _0x5d44ec={'raw':!![],'where':{'id':_0x5d8d45[_0x756a('0x4b')]['id']}},_0x14851a={};_0x14851a[_0x756a('0x35')]=_[_0x756a('0x37')](db[_0x756a('0x30')][_0x756a('0x31')]);_0x14851a['query']=_[_0x756a('0x37')](_0x5d8d45[_0x756a('0x36')]);_0x14851a['filters']=_['intersection'](_0x14851a[_0x756a('0x35')],_0x14851a[_0x756a('0x36')]);_0x5d44ec[_0x756a('0x39')]=_[_0x756a('0x3a')](_0x14851a['model'],qs[_0x756a('0x3b')](_0x5d8d45[_0x756a('0x36')][_0x756a('0x3b')]));_0x5d44ec[_0x756a('0x39')]=_0x5d44ec['attributes'][_0x756a('0x3c')]?_0x5d44ec[_0x756a('0x39')]:_0x14851a[_0x756a('0x35')];if(_0x5d8d45[_0x756a('0x36')]['includeAll']){_0x5d44ec[_0x756a('0x46')]=[{'all':!![]}];}_0x5d44ec=_[_0x756a('0x44')]({},_0x5d44ec,_0x5d8d45[_0x756a('0x45')]);return db[_0x756a('0x30')]['find'](_0x5d44ec)[_0x756a('0x27')](handleEntityNotFound(_0x3f80be,null))[_0x756a('0x27')](respondWithResult(_0x3f80be,null))[_0x756a('0x49')](handleError(_0x3f80be,null));};exports['create']=function(_0x46ae43,_0x32dfb8){return db[_0x756a('0x30')][_0x756a('0x4c')](_0x46ae43[_0x756a('0x4d')],{})['then'](respondWithResult(_0x32dfb8,0xc9))[_0x756a('0x49')](handleError(_0x32dfb8,null));};exports[_0x756a('0x25')]=function(_0x31efdf,_0x18da84){if(_0x31efdf[_0x756a('0x4d')]['id']){delete _0x31efdf['body']['id'];}return db[_0x756a('0x30')][_0x756a('0x4e')]({'where':{'id':_0x31efdf[_0x756a('0x4b')]['id']}})[_0x756a('0x27')](handleEntityNotFound(_0x18da84,null))[_0x756a('0x27')](saveUpdates(_0x31efdf[_0x756a('0x4d')],null))[_0x756a('0x27')](respondWithResult(_0x18da84,null))[_0x756a('0x49')](handleError(_0x18da84,null));};exports[_0x756a('0x26')]=function(_0x24d3eb,_0x4ce710){return db[_0x756a('0x30')][_0x756a('0x4e')]({'where':{'id':_0x24d3eb['params']['id']}})[_0x756a('0x27')](handleEntityNotFound(_0x4ce710,null))[_0x756a('0x27')](removeEntity(_0x4ce710,null))[_0x756a('0x49')](handleError(_0x4ce710,null));};exports[_0x756a('0x4f')]=function(_0x341810,_0x364349){return db['ChatInternalMessage']['describe']()[_0x756a('0x27')](respondWithResult(_0x364349,null))[_0x756a('0x49')](handleError(_0x364349,null));};function wrapUser(_0x63fa63){return function(_0x4e783e){var _0x434542=_0x63fa63['get']({'plain':!![]});_0x434542['messages']=[];if(_0x4e783e){_0x434542[_0x756a('0x50')]=_0x4e783e[_0x756a('0x51')];_0x434542[_0x756a('0x52')]=_0x4e783e;}else{_0x434542[_0x756a('0x50')]=moment(0x0)[_0x756a('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x434542[_0x756a('0x52')]={};}return _0x434542;};}exports[_0x756a('0x54')]=function(_0x29dc28,_0x1df751,_0x13c484){var _0x7b003f=[];return db[_0x756a('0x55')][_0x756a('0x47')]({'where':{'role':[_0x756a('0x56'),'admin',_0x756a('0x57')]},'attributes':['id',_0x756a('0x58'),_0x756a('0x2c'),'role',_0x756a('0x59'),_0x756a('0x5a'),'online',_0x756a('0x5b'),_0x756a('0x5c'),_0x756a('0x5d')],'order':qs[_0x756a('0x3f')](_0x756a('0x5e')),'include':[{'model':db['VoiceQueue'],'as':_0x756a('0x5f'),'attributes':['id',_0x756a('0x2c'),_0x756a('0x33')],'through':{'attributes':[]}}]})[_0x756a('0x27')](function(_0xf4aeeb){if(_0xf4aeeb){var _0x3b98fd=_0x29dc28['user'][_0x756a('0x60')]({'plain':!![]});if(!_0x3b98fd)throw new Error(_0x756a('0x61'));if(_0x3b98fd['role']===_0x756a('0x57')){return db[_0x756a('0x62')]['find']({'where':{'name':'Agents','userProfileId':_0x3b98fd[_0x756a('0x63')]},'raw':!![]})[_0x756a('0x27')](function(_0x99ad21){if(_0x99ad21){if(_0x99ad21[_0x756a('0x64')]===0x0){return db[_0x756a('0x65')][_0x756a('0x47')]({'where':{'sectionId':_0x99ad21['id']},'raw':!![]})[_0x756a('0x27')](function(_0x4b3dcf){var _0x47a842=[];if(_[_0x756a('0x66')](_0x4b3dcf)){_0x47a842=_[_0x756a('0x41')](_0xf4aeeb,function(_0x70f717){if(_0x70f717['role']!==_0x756a('0x56')){return _0x70f717;}});return _0x47a842;}else{for(var _0x5ef4b2=0x0;_0x5ef4b2<_0xf4aeeb[_0x756a('0x3c')];_0x5ef4b2++){var _0x1192a4=_0xf4aeeb[_0x5ef4b2];if(_0x1192a4[_0x756a('0x67')]===_0x756a('0x56')){var _0x2206ab=_[_0x756a('0x4e')](_0x4b3dcf,function(_0x31d5d9){return _0x31d5d9[_0x756a('0x68')]===_0x1192a4['id'];});if(_0x2206ab)_0x47a842['push'](_0x1192a4);}else{_0x47a842['push'](_0x1192a4);}}return _0x47a842;}});}else{return _0xf4aeeb;}}else{var _0x14e457=_[_0x756a('0x41')](_0xf4aeeb,function(_0xcfdfc5){if(_0xcfdfc5[_0x756a('0x67')]!==_0x756a('0x56')){return _0xcfdfc5;}});return _0x14e457;}});}else{return _0xf4aeeb;}}})['then'](function(_0x550e3c){var _0x50ba78=[];if(_0x550e3c){_0x7b003f=_0x550e3c;for(var _0x280fe5=0x0;_0x280fe5<_0x550e3c['length'];_0x280fe5+=0x1){_0x7b003f[_0x280fe5][_0x756a('0x69')]=[];_0x50ba78[_0x756a('0x6a')](db[_0x756a('0x30')][_0x756a('0x4e')]({'where':{'FromId':[_0x29dc28[_0x756a('0x57')]['id'],_0x550e3c[_0x280fe5]['id']],'ToId':[_0x29dc28[_0x756a('0x57')]['id'],_0x550e3c[_0x280fe5]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x756a('0x6b'),_0x756a('0x6c'),_0x756a('0x4d')],'order':qs[_0x756a('0x3f')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x756a('0x27')](wrapUser(_0x550e3c[_0x280fe5])));}return BPromise['all'](_0x50ba78);}return[];})[_0x756a('0x27')](function(_0x5bf72e){return{'rows':_0x5bf72e,'count':_0x5bf72e[_0x756a('0x3c')]};})[_0x756a('0x27')](respondWithResult(_0x1df751,null))[_0x756a('0x49')](handleError(_0x1df751,null));};
\ No newline at end of file
index 51650a4..511a211 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf19d=['ChatInternalMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x463852,_0x47f96b){var _0x5deab2=function(_0xab39e2){while(--_0xab39e2){_0x463852['push'](_0x463852['shift']());}};_0x5deab2(++_0x47f96b);}(_0xf19d,0x1b7));var _0xdf19=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xf19d[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0xdf19('0x0'));var ChatInternalMessage=require(_0xdf19('0x1'))['db'][_0xdf19('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xdf19('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xdf19('0x4'),'afterDestroy':'remove'};function emitEvent(_0x725908){return function(_0x2db030,_0x34c25b,_0x4bd11f){ChatInternalMessageEvents[_0xdf19('0x5')](_0x725908+':'+_0x2db030['id'],_0x2db030);ChatInternalMessageEvents[_0xdf19('0x5')](_0x725908,_0x2db030);_0x4bd11f(null);};}for(var e in events){if(events[_0xdf19('0x6')](e)){var event=events[e];ChatInternalMessage[_0xdf19('0x7')](e,emitEvent(event));}}module[_0xdf19('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x1a80=['save','remove','emit','hasOwnProperty','hook','events','ChatInternalMessage'];(function(_0x355d8c,_0x2de949){var _0xd527fa=function(_0x49ca82){while(--_0x49ca82){_0x355d8c['push'](_0x355d8c['shift']());}};_0xd527fa(++_0x2de949);}(_0x1a80,0x1e1));var _0x01a8=function(_0x2b063d,_0x57b7c2){_0x2b063d=_0x2b063d-0x0;var _0x17bceb=_0x1a80[_0x2b063d];return _0x17bceb;};'use strict';var EventEmitter=require(_0x01a8('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0x01a8('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x01a8('0x2'),'afterUpdate':'update','afterDestroy':_0x01a8('0x3')};function emitEvent(_0x2b5c85){return function(_0xb926,_0x2872f4,_0xb25951){ChatInternalMessageEvents[_0x01a8('0x4')](_0x2b5c85+':'+_0xb926['id'],_0xb926);ChatInternalMessageEvents['emit'](_0x2b5c85,_0xb926);_0xb25951(null);};}for(var e in events){if(events[_0x01a8('0x5')](e)){var event=events[e];ChatInternalMessage[_0x01a8('0x6')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents;
\ No newline at end of file
index bcc77ca..513b04a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b63=['request-promise','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages','lodash','util','api','bluebird'];(function(_0x3509b8,_0x38f51c){var _0x24239c=function(_0x1f3f40){while(--_0x1f3f40){_0x3509b8['push'](_0x3509b8['shift']());}};_0x24239c(++_0x38f51c);}(_0x8b63,0x10a));var _0x38b6=function(_0x55b8f9,_0x26f376){_0x55b8f9=_0x55b8f9-0x0;var _0x21ef2e=_0x8b63[_0x55b8f9];return _0x21ef2e;};'use strict';var _=require(_0x38b6('0x0'));var util=require(_0x38b6('0x1'));var logger=require('../../config/logger')(_0x38b6('0x2'));var moment=require('moment');var BPromise=require(_0x38b6('0x3'));var rp=require(_0x38b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x38b6('0x5'));var attributes=require(_0x38b6('0x6'));module['exports']=function(_0x59081a,_0x22be3a){return _0x59081a[_0x38b6('0x7')](_0x38b6('0x8'),attributes,{'tableName':_0x38b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0f25=['rimraf','../../config/environment','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x0f25,0x18e));var _0x50f2=function(_0x301cd8,_0x2eceb8){_0x301cd8=_0x301cd8-0x0;var _0x52a8ad=_0x0f25[_0x301cd8];return _0x52a8ad;};'use strict';var _=require(_0x50f2('0x0'));var util=require(_0x50f2('0x1'));var logger=require(_0x50f2('0x2'))(_0x50f2('0x3'));var moment=require(_0x50f2('0x4'));var BPromise=require(_0x50f2('0x5'));var rp=require(_0x50f2('0x6'));var fs=require('fs');var path=require(_0x50f2('0x7'));var rimraf=require(_0x50f2('0x8'));var config=require(_0x50f2('0x9'));var attributes=require('./chatInternalMessage.attributes');module[_0x50f2('0xa')]=function(_0x3428b7,_0x4dd7b1){return _0x3428b7[_0x50f2('0xb')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x50f2('0xc'),'collate':_0x50f2('0xd')});};
\ No newline at end of file
index 877db7f..d211dab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11a5=['../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x44c29e,_0x1d5eb8){var _0x4d50f4=function(_0x4d913f){while(--_0x4d913f){_0x44c29e['push'](_0x44c29e['shift']());}};_0x4d50f4(++_0x1d5eb8);}(_0x11a5,0x88));var _0x511a=function(_0x23c217,_0x3aee12){_0x23c217=_0x23c217-0x0;var _0x53fcf8=_0x11a5[_0x23c217];return _0x53fcf8;};'use strict';var _=require(_0x511a('0x0'));var util=require(_0x511a('0x1'));var moment=require(_0x511a('0x2'));var BPromise=require('bluebird');var rs=require(_0x511a('0x3'));var fs=require('fs');var Redis=require(_0x511a('0x4'));var db=require(_0x511a('0x5'))['db'];var utils=require(_0x511a('0x6'));var logger=require(_0x511a('0x7'))(_0x511a('0x8'));var config=require(_0x511a('0x9'));var jayson=require(_0x511a('0xa'));var client=jayson[_0x511a('0xb')][_0x511a('0xc')]({'port':0x232a});config[_0x511a('0xd')]=_[_0x511a('0xe')](config[_0x511a('0xd')],{'host':_0x511a('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x511a('0xd')]));require(_0x511a('0x10'))[_0x511a('0x11')](socket);function respondWithRpcPromise(_0x461805,_0x11b1d7,_0x3d7fba){return new BPromise(function(_0x316391,_0x5b6bc6){return client[_0x511a('0x12')](_0x461805,_0x3d7fba)['then'](function(_0x571ef0){logger[_0x511a('0x13')](_0x511a('0x14'),_0x11b1d7,_0x511a('0x15'));logger['debug'](_0x511a('0x16'),_0x11b1d7,_0x511a('0x15'),JSON[_0x511a('0x17')](_0x571ef0));if(_0x571ef0[_0x511a('0x18')]){if(_0x571ef0[_0x511a('0x18')][_0x511a('0x19')]===0x1f4){logger[_0x511a('0x18')](_0x511a('0x14'),_0x11b1d7,_0x571ef0[_0x511a('0x18')]['message']);return _0x5b6bc6(_0x571ef0[_0x511a('0x18')][_0x511a('0x1a')]);}logger[_0x511a('0x18')](_0x511a('0x14'),_0x11b1d7,_0x571ef0['error']['message']);return _0x316391(_0x571ef0['error']['message']);}else{logger[_0x511a('0x13')](_0x511a('0x14'),_0x11b1d7,'request\x20sent');_0x316391(_0x571ef0[_0x511a('0x1b')]['message']);}})[_0x511a('0x1c')](function(_0x2a25ab){logger[_0x511a('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x11b1d7,_0x2a25ab);_0x5b6bc6(_0x2a25ab);});});}
\ No newline at end of file
+var _0x0e28=['http','redis','localhost','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1781f9,_0x5c36a3){var _0x4bd468=function(_0x3d3efb){while(--_0x3d3efb){_0x1781f9['push'](_0x1781f9['shift']());}};_0x4bd468(++_0x5c36a3);}(_0x0e28,0x12d));var _0x80e2=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0e28[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x80e2('0x0'));var moment=require(_0x80e2('0x1'));var BPromise=require(_0x80e2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80e2('0x3'));var db=require(_0x80e2('0x4'))['db'];var utils=require(_0x80e2('0x5'));var logger=require(_0x80e2('0x6'))(_0x80e2('0x7'));var config=require(_0x80e2('0x8'));var jayson=require(_0x80e2('0x9'));var client=jayson[_0x80e2('0xa')][_0x80e2('0xb')]({'port':0x232a});config[_0x80e2('0xc')]=_['defaults'](config[_0x80e2('0xc')],{'host':_0x80e2('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x80e2('0xc')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x23f3b4,_0x1e997e,_0x4cde86){return new BPromise(function(_0x15771a,_0x349d3c){return client[_0x80e2('0xe')](_0x23f3b4,_0x4cde86)['then'](function(_0x3ffeb9){logger[_0x80e2('0xf')](_0x80e2('0x10'),_0x1e997e,_0x80e2('0x11'));logger[_0x80e2('0x12')](_0x80e2('0x13'),_0x1e997e,_0x80e2('0x11'),JSON[_0x80e2('0x14')](_0x3ffeb9));if(_0x3ffeb9['error']){if(_0x3ffeb9['error'][_0x80e2('0x15')]===0x1f4){logger[_0x80e2('0x16')](_0x80e2('0x10'),_0x1e997e,_0x3ffeb9[_0x80e2('0x16')][_0x80e2('0x17')]);return _0x349d3c(_0x3ffeb9[_0x80e2('0x16')][_0x80e2('0x17')]);}logger['error'](_0x80e2('0x10'),_0x1e997e,_0x3ffeb9[_0x80e2('0x16')][_0x80e2('0x17')]);return _0x15771a(_0x3ffeb9['error'][_0x80e2('0x17')]);}else{logger[_0x80e2('0xf')](_0x80e2('0x10'),_0x1e997e,_0x80e2('0x11'));_0x15771a(_0x3ffeb9[_0x80e2('0x18')][_0x80e2('0x17')]);}})[_0x80e2('0x19')](function(_0x267e15){logger[_0x80e2('0x16')](_0x80e2('0x10'),_0x1e997e,_0x267e15);_0x349d3c(_0x267e15);});});}
\ No newline at end of file
index be41b0e..d51869c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda03=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit'];(function(_0xb41e07,_0x96401e){var _0x267ffe=function(_0x4c433f){while(--_0x4c433f){_0xb41e07['push'](_0xb41e07['shift']());}};_0x267ffe(++_0x96401e);}(_0xda03,0x1ac));var _0x3da0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xda03[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0x3da0('0x0'));var events=[_0x3da0('0x1'),'remove',_0x3da0('0x2')];function createListener(_0x13d9af,_0x50f58f){return function(_0x34511f){_0x50f58f[_0x3da0('0x3')](_0x13d9af,_0x34511f);};}function removeListener(_0x2c57a7,_0x227d0d){return function(){ChatInternalMessageEvents[_0x3da0('0x4')](_0x2c57a7,_0x227d0d);};}exports[_0x3da0('0x5')]=function(_0x2c6561){for(var _0x3759cf=0x0,_0x1d1b51=events[_0x3da0('0x6')];_0x3759cf<_0x1d1b51;_0x3759cf++){var _0x309b48=events[_0x3759cf];var _0x1ddc16=createListener(_0x3da0('0x7')+_0x309b48,_0x2c6561);ChatInternalMessageEvents['on'](_0x309b48,_0x1ddc16);}};
\ No newline at end of file
+var _0xe60f=['register','length','chatInternalMessage:','save','remove'];(function(_0x30e53b,_0xac1400){var _0x5a5c36=function(_0x1c1507){while(--_0x1c1507){_0x30e53b['push'](_0x30e53b['shift']());}};_0x5a5c36(++_0xac1400);}(_0xe60f,0x1f2));var _0xfe60=function(_0x99a3df,_0x45aafc){_0x99a3df=_0x99a3df-0x0;var _0x3f6369=_0xe60f[_0x99a3df];return _0x3f6369;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xfe60('0x0'),_0xfe60('0x1'),'update'];function createListener(_0x1873ce,_0x21787f){return function(_0xa99cc1){_0x21787f['emit'](_0x1873ce,_0xa99cc1);};}function removeListener(_0x2b14fa,_0x4de8d6){return function(){ChatInternalMessageEvents['removeListener'](_0x2b14fa,_0x4de8d6);};}exports[_0xfe60('0x2')]=function(_0xa589cd){for(var _0x41b372=0x0,_0x64e9ae=events[_0xfe60('0x3')];_0x41b372<_0x64e9ae;_0x41b372++){var _0x5230ec=events[_0x41b372];var _0x168dbf=createListener(_0xfe60('0x4')+_0x5230ec,_0xa589cd);ChatInternalMessageEvents['on'](_0x5230ec,_0x168dbf);}};
\ No newline at end of file
index 5383e19..a77eb5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa978=['get','isAuthenticated','/describe','/users','/:id','show','create','put','update','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa978,0x185));var _0x8a97=function(_0x59e7f0,_0x44d4c8){_0x59e7f0=_0x59e7f0-0x0;var _0x20ea60=_0xa978[_0x59e7f0];return _0x20ea60;};'use strict';var multer=require(_0x8a97('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8a97('0x1'));var express=require(_0x8a97('0x2'));var router=express[_0x8a97('0x3')]();var fs_extra=require(_0x8a97('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8a97('0x5'));var config=require(_0x8a97('0x6'));var controller=require('./chatInternalMessage.controller');router[_0x8a97('0x7')]('/',auth[_0x8a97('0x8')](),controller['index']);router[_0x8a97('0x7')](_0x8a97('0x9'),auth[_0x8a97('0x8')](),controller['describe']);router[_0x8a97('0x7')](_0x8a97('0xa'),auth[_0x8a97('0x8')](),controller['getUsers']);router[_0x8a97('0x7')](_0x8a97('0xb'),auth[_0x8a97('0x8')](),controller[_0x8a97('0xc')]);router['post']('/',auth[_0x8a97('0x8')](),controller[_0x8a97('0xd')]);router[_0x8a97('0xe')](_0x8a97('0xb'),controller[_0x8a97('0xf')]);router[_0x8a97('0x10')](_0x8a97('0xb'),auth[_0x8a97('0x8')](),controller['destroy']);module[_0x8a97('0x11')]=router;
\ No newline at end of file
+var _0x5026=['../../components/interaction/service','./chatInternalMessage.controller','get','index','/describe','isAuthenticated','/users','getUsers','/:id','create','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4ca1b8,_0x9faad5){var _0x49b9e4=function(_0x360bcd){while(--_0x360bcd){_0x4ca1b8['push'](_0x4ca1b8['shift']());}};_0x49b9e4(++_0x9faad5);}(_0x5026,0xac));var _0x6502=function(_0x5be840,_0x4e11ec){_0x5be840=_0x5be840-0x0;var _0x576dd5=_0x5026[_0x5be840];return _0x576dd5;};'use strict';var multer=require(_0x6502('0x0'));var util=require(_0x6502('0x1'));var path=require(_0x6502('0x2'));var timeout=require(_0x6502('0x3'));var express=require(_0x6502('0x4'));var router=express[_0x6502('0x5')]();var fs_extra=require(_0x6502('0x6'));var auth=require(_0x6502('0x7'));var interaction=require(_0x6502('0x8'));var config=require('../../config/environment');var controller=require(_0x6502('0x9'));router[_0x6502('0xa')]('/',auth['isAuthenticated'](),controller[_0x6502('0xb')]);router['get'](_0x6502('0xc'),auth[_0x6502('0xd')](),controller['describe']);router['get'](_0x6502('0xe'),auth['isAuthenticated'](),controller[_0x6502('0xf')]);router[_0x6502('0xa')](_0x6502('0x10'),auth[_0x6502('0xd')](),controller['show']);router['post']('/',auth[_0x6502('0xd')](),controller[_0x6502('0x11')]);router['put'](_0x6502('0x10'),controller[_0x6502('0x12')]);router['delete'](_0x6502('0x10'),auth[_0x6502('0xd')](),controller[_0x6502('0x13')]);module['exports']=router;
\ No newline at end of file
index deed161..2005ea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb91a=['medium','BOOLEAN','ENUM','out','DATE','exports','TEXT'];(function(_0x1b3ddb,_0x190f99){var _0x3b952d=function(_0x590bd0){while(--_0x590bd0){_0x1b3ddb['push'](_0x1b3ddb['shift']());}};_0x3b952d(++_0x190f99);}(_0xb91a,0xe5));var _0xab91=function(_0x5d87b0,_0x3135a5){_0x5d87b0=_0x5d87b0-0x0;var _0x5872fc=_0xb91a[_0x5d87b0];return _0x5872fc;};'use strict';var Sequelize=require('sequelize');module[_0xab91('0x0')]={'body':{'type':Sequelize[_0xab91('0x1')](_0xab91('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xab91('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xab91('0x4')]('in',_0xab91('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xab91('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7033=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x7033,0x19e));var _0x3703=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7033[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x3703('0x0'));module[_0x3703('0x1')]={'body':{'type':Sequelize[_0x3703('0x2')](_0x3703('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3703('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3703('0x5')]('in',_0x3703('0x6')),'defaultValue':_0x3703('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3703('0x7')]},'providerName':{'type':Sequelize[_0x3703('0x8')]},'providerResponse':{'type':Sequelize[_0x3703('0x2')]}};
\ No newline at end of file
index da554ea..f3c0251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x7484a8,_0x55a315){var _0x1f0527=function(_0x5d6476){while(--_0x5d6476){_0x7484a8['push'](_0x7484a8['shift']());}};_0x1f0527(++_0x55a315);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];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);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
+var _0xa9e0=['interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','chat-interactions','chat','ChatInteraction','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','fullname','rejectmessage','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','map','ChatMessage','fieldName','type','keys','query','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','body','find','describe','../../config/logger','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteractionId','isNil','read1stAt','format'];(function(_0x2da02c,_0x293473){var _0x1b6fe9=function(_0x2cdfa4){while(--_0x2cdfa4){_0x2da02c['push'](_0x2da02c['shift']());}};_0x1b6fe9(++_0x293473);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];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);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x0a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5d0880,_0x1985b6,_0x519dfd,_0x16033c){return new BPromise(function(_0x12066b,_0x48f32d){var _0x225616=_0x16033c||client;return _0x225616['request'](_0x5d0880,_0x519dfd)[_0x0a9e('0x1d')](function(_0x478723){logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));logger[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x1985b6,_0x0a9e('0x20'),JSON[_0x0a9e('0x23')](_0x478723));if(_0x478723[_0x0a9e('0x24')]){if(_0x478723[_0x0a9e('0x24')][_0x0a9e('0x25')]===0x1f4){logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')]['message']);return _0x48f32d(_0x478723[_0x0a9e('0x24')]['message']);}logger['error'](_0x0a9e('0x1f'),_0x1985b6,_0x478723[_0x0a9e('0x24')][_0x0a9e('0x26')]);return _0x12066b(_0x478723[_0x0a9e('0x24')]['message']);}else{logger[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x1985b6,_0x0a9e('0x20'));_0x12066b(_0x478723[_0x0a9e('0x27')][_0x0a9e('0x26')]);}})[_0x0a9e('0x28')](function(_0x16b1ca){logger['error']('ChatMessage,\x20%s,\x20%s',_0x1985b6,_0x16b1ca);_0x48f32d(_0x16b1ca);});});}function respondWithStatusCode(_0x197ec0,_0x3a8e58){_0x3a8e58=_0x3a8e58||0xcc;return function(_0x40c424){if(_0x40c424){return _0x197ec0[_0x0a9e('0x29')](_0x3a8e58);}return _0x197ec0['status'](_0x3a8e58)[_0x0a9e('0x2a')]();};}function respondWithResult(_0x479bc4,_0x45a1e7){_0x45a1e7=_0x45a1e7||0xc8;return function(_0x5bfb33){if(_0x5bfb33){return _0x479bc4[_0x0a9e('0x2b')](_0x45a1e7)[_0x0a9e('0x2c')](_0x5bfb33);}};}function respondWithFilteredResult(_0x25fba9,_0x14433c){return function(_0x140511){if(_0x140511){var _0x1538a4=typeof _0x14433c[_0x0a9e('0x2d')]===_0x0a9e('0x2e')&&typeof _0x14433c['limit']===_0x0a9e('0x2e');var _0x468813=_0x140511[_0x0a9e('0x2f')];var _0x2ec755=_0x1538a4?0x0:_0x14433c['offset'];var _0x15b200=_0x1538a4?_0x140511[_0x0a9e('0x2f')]:_0x14433c[_0x0a9e('0x2d')]+_0x14433c[_0x0a9e('0x30')];var _0x58b06f;if(_0x15b200>=_0x468813){_0x15b200=_0x468813;_0x58b06f=0xc8;}else{_0x58b06f=0xce;}_0x25fba9[_0x0a9e('0x2b')](_0x58b06f);return _0x25fba9[_0x0a9e('0x31')](_0x0a9e('0x32'),_0x2ec755+'-'+_0x15b200+'/'+_0x468813)[_0x0a9e('0x2c')](_0x140511);}return null;};}function patchUpdates(_0x540530){return function(_0x426950){try{jsonpatch['apply'](_0x426950,_0x540530,!![]);}catch(_0x2407f9){return BPromise[_0x0a9e('0x33')](_0x2407f9);}return _0x426950[_0x0a9e('0x34')]();};}function saveUpdates(_0x33bdb7,_0x25ce3a){return function(_0x5180f1){if(_0x5180f1){return _0x5180f1[_0x0a9e('0x35')](_0x33bdb7)[_0x0a9e('0x1d')](function(_0x40cb85){return _0x40cb85;});}return null;};}function removeEntity(_0x2da5c0,_0x2b45ea){return function(_0x409319){if(_0x409319){return _0x409319[_0x0a9e('0x36')]()[_0x0a9e('0x1d')](function(){_0x2da5c0['status'](0xcc)[_0x0a9e('0x2a')]();});}};}function handleEntityNotFound(_0x5e7238,_0x2cc7a0){return function(_0x14b13f){if(!_0x14b13f){_0x5e7238[_0x0a9e('0x29')](0x194);}return _0x14b13f;};}function handleError(_0x3f3d41,_0x567193){_0x567193=_0x567193||0x1f4;return function(_0x191e91){logger[_0x0a9e('0x24')](_0x191e91[_0x0a9e('0x37')]);if(_0x191e91[_0x0a9e('0x38')]){delete _0x191e91['name'];}_0x3f3d41['status'](_0x567193)[_0x0a9e('0x39')](_0x191e91);};}exports['index']=function(_0x24936a,_0x3d9717){var _0x381c37={},_0x1ef87a={},_0x4f41ae={'count':0x0,'rows':[]};var _0x31916f=_[_0x0a9e('0x3a')](db[_0x0a9e('0x3b')]['rawAttributes'],function(_0x1dbf74){return{'name':_0x1dbf74[_0x0a9e('0x3c')],'type':_0x1dbf74[_0x0a9e('0x3d')]['key']};});_0x1ef87a['model']=_[_0x0a9e('0x3a')](_0x31916f,_0x0a9e('0x38'));_0x1ef87a['query']=_[_0x0a9e('0x3e')](_0x24936a[_0x0a9e('0x3f')]);_0x1ef87a[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],_0x1ef87a['query']);_0x381c37[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x1ef87a['model'],qs[_0x0a9e('0x43')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x43')]));_0x381c37['attributes']=_0x381c37[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x381c37[_0x0a9e('0x42')]:_0x1ef87a[_0x0a9e('0x45')];if(!_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x46')](_0x0a9e('0x47'))){_0x381c37[_0x0a9e('0x30')]=qs[_0x0a9e('0x30')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x30')]);_0x381c37[_0x0a9e('0x2d')]=qs[_0x0a9e('0x2d')](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x2d')]);}_0x381c37['order']=qs['sort'](_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x48')]);_0x381c37[_0x0a9e('0x49')]=qs[_0x0a9e('0x40')](_[_0x0a9e('0x4a')](_0x24936a[_0x0a9e('0x3f')],_0x1ef87a[_0x0a9e('0x40')]),_0x31916f);if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]){_0x381c37[_0x0a9e('0x49')]=_[_0x0a9e('0x4c')](_0x381c37[_0x0a9e('0x49')],{'$or':_['map'](_0x31916f,function(_0x117c99){if(_0x117c99[_0x0a9e('0x3d')]!==_0x0a9e('0x4d')){var _0xfbd5ad={};_0xfbd5ad[_0x117c99[_0x0a9e('0x38')]]={'$like':'%'+_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4b')]+'%'};return _0xfbd5ad;}})});}_0x381c37=_[_0x0a9e('0x4c')]({},_0x381c37,_0x24936a['options']);var _0x2e9d90={'where':_0x381c37['where']};return db[_0x0a9e('0x3b')][_0x0a9e('0x2f')](_0x2e9d90)[_0x0a9e('0x1d')](function(_0x562fb4){_0x4f41ae[_0x0a9e('0x2f')]=_0x562fb4;if(_0x24936a[_0x0a9e('0x3f')][_0x0a9e('0x4e')]){_0x381c37[_0x0a9e('0x4f')]=[{'all':!![]}];}return db[_0x0a9e('0x3b')][_0x0a9e('0x50')](_0x381c37);})[_0x0a9e('0x1d')](function(_0x5bbcde){_0x4f41ae[_0x0a9e('0x51')]=_0x5bbcde;return _0x4f41ae;})[_0x0a9e('0x1d')](respondWithFilteredResult(_0x3d9717,_0x381c37))[_0x0a9e('0x28')](handleError(_0x3d9717,null));};exports[_0x0a9e('0x52')]=function(_0x409789,_0x992c77){var _0x6054ee={'raw':!![],'where':{'id':_0x409789[_0x0a9e('0x53')]['id']}},_0x19383e={};_0x19383e['model']=_[_0x0a9e('0x3e')](db[_0x0a9e('0x3b')]['rawAttributes']);_0x19383e['query']=_['keys'](_0x409789[_0x0a9e('0x3f')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],_0x19383e[_0x0a9e('0x3f')]);_0x6054ee[_0x0a9e('0x42')]=_[_0x0a9e('0x41')](_0x19383e[_0x0a9e('0x45')],qs['fields'](_0x409789['query']['fields']));_0x6054ee[_0x0a9e('0x42')]=_0x6054ee[_0x0a9e('0x42')][_0x0a9e('0x44')]?_0x6054ee['attributes']:_0x19383e[_0x0a9e('0x45')];if(_0x409789[_0x0a9e('0x3f')]['includeAll']){_0x6054ee['include']=[{'all':!![]}];}_0x6054ee=_[_0x0a9e('0x4c')]({},_0x6054ee,_0x409789['options']);return db[_0x0a9e('0x3b')]['find'](_0x6054ee)[_0x0a9e('0x1d')](handleEntityNotFound(_0x992c77,null))[_0x0a9e('0x1d')](respondWithResult(_0x992c77,null))[_0x0a9e('0x28')](handleError(_0x992c77,null));};exports['create']=function(_0x2f82da,_0x1bf38a){return db['ChatMessage']['create'](_0x2f82da[_0x0a9e('0x54')],{})[_0x0a9e('0x1d')](respondWithResult(_0x1bf38a,0xc9))['catch'](handleError(_0x1bf38a,null));};exports[_0x0a9e('0x35')]=function(_0x5ce9ac,_0x211ef9){if(_0x5ce9ac['body']['id']){delete _0x5ce9ac[_0x0a9e('0x54')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x5ce9ac['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x211ef9,null))['then'](saveUpdates(_0x5ce9ac[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](respondWithResult(_0x211ef9,null))[_0x0a9e('0x28')](handleError(_0x211ef9,null));};exports[_0x0a9e('0x36')]=function(_0x232830,_0x272738){return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x232830['params']['id']}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x272738,null))[_0x0a9e('0x1d')](removeEntity(_0x272738,null))[_0x0a9e('0x28')](handleError(_0x272738,null));};exports[_0x0a9e('0x56')]=function(_0xb83dfd,_0x156662){return db['ChatMessage'][_0x0a9e('0x56')]()[_0x0a9e('0x1d')](respondWithResult(_0x156662,null))['catch'](handleError(_0x156662,null));};var interaction_log=require(_0x0a9e('0x57'))('chat-interactions');exports[_0x0a9e('0x58')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee){var _0x273cb5={'agent':{},'channel':'chat'};if(_0x5ba1f9[_0x0a9e('0x54')]['id']){delete _0x5ba1f9[_0x0a9e('0x54')]['id'];}_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x59')]=!![];_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5a')]=moment()['format'](_0x0a9e('0x5b'));_0x5ba1f9['body'][_0x0a9e('0x5c')]=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')]||_0x5ba1f9['user']['id'];_0x273cb5[_0x0a9e('0x5d')]['id']=_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')];return db[_0x0a9e('0x3b')]['find']({'where':{'id':_0x5ba1f9[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](saveUpdates(_0x5ba1f9[_0x0a9e('0x54')],null))[_0x0a9e('0x1d')](function(_0x88dcbf){if(_0x88dcbf){_0x273cb5[_0x0a9e('0x26')]=_0x88dcbf[_0x0a9e('0x5e')]({'plain':!![]});return db['ChatInteraction'][_0x0a9e('0x55')]({'where':{'id':_0x88dcbf[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x4b3c1a,null))['then'](function(_0x3528b7){if(_0x3528b7){return _0x3528b7['update']({'UserId':_0x5ba1f9['body'][_0x0a9e('0x5c')],'read1stAt':_[_0x0a9e('0x60')](_0x3528b7[_0x0a9e('0x61')])?moment()[_0x0a9e('0x62')](_0x0a9e('0x5b')):undefined});}return null;})[_0x0a9e('0x1d')](function(_0x387489){if(_0x387489){_0x273cb5[_0x0a9e('0x63')]=_0x387489[_0x0a9e('0x5e')]({'plain':!![]});interaction_log[_0x0a9e('0x1e')](_0x0a9e('0x64'),_0x5ba1f9[_0x0a9e('0x65')]['id'],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x66')],_0x273cb5[_0x0a9e('0x63')]['id'],_0x5ba1f9[_0x0a9e('0x54')]?JSON['stringify'](_0x5ba1f9[_0x0a9e('0x54')]):_0x0a9e('0x67'));return respondWithRpcPromise(_0x0a9e('0x68'),'acceptMessage',_0x273cb5);}return null;})[_0x0a9e('0x1d')](function(_0x30944e){var _0x4b341d=_0x0a9e('0x69')+_0x30944e[_0x0a9e('0x26')][_0x0a9e('0x6a')];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0x4b341d,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x0a9e('0x1d')](function(_0x18bf5d){return _0x18bf5d;});})[_0x0a9e('0x1d')](function(_0x23a7d3){if(_0x23a7d3){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x23a7d3[0x0];if(!_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),'fullname',_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})['then'](function(_0x2ed01e){if(!_0x2ed01e)return null;_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x2ed01e;return _0x273cb5;})[_0x0a9e('0x1d')](function(_0x542ece){if(_0x542ece){if(_0x5ba1f9[_0x0a9e('0x54')][_0x0a9e('0x6f')]){_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x70')]=util['format'](_0x0a9e('0x71'),_0x5ba1f9[_0x0a9e('0x65')][_0x0a9e('0x38')]);_0x273cb5[_0x0a9e('0x26')]['channel']=_0x273cb5[_0x0a9e('0x72')];_0x273cb5[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x58');return respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x75'),'message':_[_0x0a9e('0x4c')](_0x273cb5[_0x0a9e('0x26')],JSON[_0x0a9e('0x76')](_0x273cb5[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002)[_0x0a9e('0x1d')](function(){return _0x273cb5;});}return _0x273cb5;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x4b3c1a,null))['catch'](handleError(_0x4b3c1a,null));};var interaction_log=require(_0x0a9e('0x57'))(_0x0a9e('0x78'));exports[_0x0a9e('0x33')]=function(_0x563627,_0x3736e0,_0x33dda0){var _0x8cea96={'agent':{},'channel':_0x0a9e('0x79')};if(_0x563627['body']['id']){delete _0x563627['body']['id'];}_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')]=_0x563627['body'][_0x0a9e('0x5c')]||_0x563627['user']['id'];_0x8cea96[_0x0a9e('0x5d')]['id']=_0x563627[_0x0a9e('0x54')]['UserId'];return db[_0x0a9e('0x3b')][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x53')]['id'],'UserId':null}})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))[_0x0a9e('0x1d')](function(_0x1f42a0){if(_0x1f42a0){_0x8cea96[_0x0a9e('0x26')]=_0x1f42a0['get']({'plain':!![]});return db[_0x0a9e('0x7a')][_0x0a9e('0x55')]({'where':{'id':_0x1f42a0[_0x0a9e('0x5f')]}});}return null;})[_0x0a9e('0x1d')](handleEntityNotFound(_0x3736e0,null))['then'](function(_0xf51744){if(_0xf51744){_0x8cea96[_0x0a9e('0x63')]=_0xf51744['get']({'plain':!![]});interaction_log[_0x0a9e('0x1e')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x563627[_0x0a9e('0x65')]['id'],_0x563627[_0x0a9e('0x65')][_0x0a9e('0x38')],_0x563627[_0x0a9e('0x65')]['role'],_0x8cea96['interaction']['id'],_0x563627[_0x0a9e('0x54')]?JSON[_0x0a9e('0x23')](_0x563627[_0x0a9e('0x54')]):'null');return respondWithRpcPromise(_0x0a9e('0x7b'),_0x0a9e('0x7c'),_0x8cea96);}return null;})['then'](function(_0x4e46b2){var _0xf0a802='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x4e46b2['message']['ContactId'];return db[_0x0a9e('0x6b')][_0x0a9e('0x3f')](_0xf0a802,{'type':db[_0x0a9e('0x7d')][_0x0a9e('0x7e')][_0x0a9e('0x7f')],'raw':!![]})[_0x0a9e('0x1d')](function(_0x5a8854){return _0x5a8854;});})[_0x0a9e('0x1d')](function(_0x5955f1){if(_0x5955f1){_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x6c')]=_0x5955f1[0x0];if(!_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')])return;return db['User'][_0x0a9e('0x55')]({'where':{'id':_0x563627[_0x0a9e('0x54')][_0x0a9e('0x5c')],'role':'agent'},'attributes':['id',_0x0a9e('0x38'),_0x0a9e('0x80'),_0x0a9e('0x6d'),_0x0a9e('0x6e')],'raw':!![]});}return null;})[_0x0a9e('0x1d')](function(_0x1910bf){if(!_0x1910bf)return null;_0x8cea96[_0x0a9e('0x26')][_0x0a9e('0x5d')]=_0x1910bf;return _0x8cea96;})['then'](function(_0x2645d6){if(_0x2645d6){_0x2645d6[_0x0a9e('0x26')]['interface']=util[_0x0a9e('0x62')](_0x0a9e('0x71'),_0x563627[_0x0a9e('0x65')]['name']);_0x2645d6[_0x0a9e('0x26')]['channel']=_0x8cea96[_0x0a9e('0x72')];_0x2645d6[_0x0a9e('0x26')][_0x0a9e('0x73')]=_0x0a9e('0x33');respondWithRpcPromise(_0x0a9e('0x74'),_0x0a9e('0x74'),{'event':_0x0a9e('0x81'),'message':_[_0x0a9e('0x4c')](_0x8cea96['message'],JSON[_0x0a9e('0x76')](_0x8cea96[_0x0a9e('0x63')][_0x0a9e('0x77')]))},client9002);return _0x8cea96;}return null;})[_0x0a9e('0x1d')](respondWithResult(_0x3736e0,null))[_0x0a9e('0x28')](handleError(_0x3736e0,null));};
\ No newline at end of file
index c51612b..6a8c762 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc5=['ChatMessage','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x1cc5,0x1e6));var _0x51cc=function(_0x5d07e1,_0x418799){_0x5d07e1=_0x5d07e1-0x0;var _0x21617f=_0x1cc5[_0x5d07e1];return _0x21617f;};'use strict';var EventEmitter=require(_0x51cc('0x0'));var ChatMessage=require(_0x51cc('0x1'))['db'][_0x51cc('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x51cc('0x3'),'afterDestroy':_0x51cc('0x4')};function emitEvent(_0x5f71a7){return function(_0x1cdcc0,_0x47ef69,_0x5487a7){ChatMessageEvents[_0x51cc('0x5')](_0x5f71a7+':'+_0x1cdcc0['id'],_0x1cdcc0);ChatMessageEvents[_0x51cc('0x5')](_0x5f71a7,_0x1cdcc0);_0x5487a7(null);};}for(var e in events){if(events[_0x51cc('0x6')](e)){var event=events[e];ChatMessage[_0x51cc('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xe1a1=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0xe1a1,0x183));var _0x1e1a=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xe1a1[_0x4a53d];return _0x27410e;};'use strict';var EventEmitter=require(_0x1e1a('0x0'));var ChatMessage=require(_0x1e1a('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x1e1a('0x2')](0x0);var events={'afterCreate':_0x1e1a('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x79cc45){return function(_0x264e8c,_0x5b1261,_0x2d389f){ChatMessageEvents[_0x1e1a('0x4')](_0x79cc45+':'+_0x264e8c['id'],_0x264e8c);ChatMessageEvents[_0x1e1a('0x4')](_0x79cc45,_0x264e8c);_0x2d389f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x1e1a('0x5')](e,emitEvent(event));}}module[_0x1e1a('0x6')]=ChatMessageEvents;
\ No newline at end of file
index bc2c983..0b3615d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6a3=['bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','toLowerCase','out','secret','UserId','findOne','ChatInteractionId','then','update','direction','error','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x20620f,_0x37c815){var _0x593a2f=function(_0x25479a){while(--_0x25479a){_0x20620f['push'](_0x20620f['shift']());}};_0x593a2f(++_0x37c815);}(_0xb6a3,0x1d8));var _0x3b6a=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb6a3[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x3b6a('0x0'));var util=require(_0x3b6a('0x1'));var logger=require(_0x3b6a('0x2'))(_0x3b6a('0x3'));var moment=require('moment');var BPromise=require(_0x3b6a('0x4'));var rp=require(_0x3b6a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b6a('0x6'));var config=require(_0x3b6a('0x7'));var attributes=require(_0x3b6a('0x8'));module[_0x3b6a('0x9')]=function(_0x1b52a9,_0x2ca1ba){return _0x1b52a9[_0x3b6a('0xa')](_0x3b6a('0xb'),attributes,{'tableName':_0x3b6a('0xc'),'paranoid':![],'indexes':[{'name':_0x3b6a('0xd'),'fields':[_0x3b6a('0xe')],'type':_0x3b6a('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e48ca,_0xc2655b,_0x5ccd9d){var _0x24e34d=_0x1b52a9[_0x3b6a('0x10')];var _0x4d8b8b=_0x5e48ca['get']({'plain':!![]});if(_0x4d8b8b['direction'][_0x3b6a('0x11')]()==='in'||_0x4d8b8b['direction']['toLowerCase']()===_0x3b6a('0x12')&&!_0x4d8b8b[_0x3b6a('0x13')]&&!_['isNil'](_0x4d8b8b[_0x3b6a('0x14')])){_0x24e34d['ChatInteraction'][_0x3b6a('0x15')]({'where':{'id':_0x4d8b8b[_0x3b6a('0x16')]}})[_0x3b6a('0x17')](function(_0x5313cf){if(_0x5313cf){_0x5313cf[_0x3b6a('0x18')]({'lastMsgAt':_0x4d8b8b['createdAt'],'lastMsgDirection':_0x4d8b8b[_0x3b6a('0x19')][_0x3b6a('0x11')]()});}})['catch'](function(_0x285d4a){console[_0x3b6a('0x1a')](_0x285d4a);});}_0x5ccd9d();}},'charset':_0x3b6a('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xacd4=['bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','models','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x9815f2,_0x1bf69d){var _0x4dd2d4=function(_0x28e750){while(--_0x28e750){_0x9815f2['push'](_0x9815f2['shift']());}};_0x4dd2d4(++_0x1bf69d);}(_0xacd4,0xe6));var _0x4acd=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xacd4[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x4acd('0x0'));var util=require('util');var logger=require(_0x4acd('0x1'))(_0x4acd('0x2'));var moment=require(_0x4acd('0x3'));var BPromise=require(_0x4acd('0x4'));var rp=require(_0x4acd('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4acd('0x6'));var config=require(_0x4acd('0x7'));var attributes=require(_0x4acd('0x8'));module[_0x4acd('0x9')]=function(_0x2bf7b5,_0x100fb9){return _0x2bf7b5['define'](_0x4acd('0xa'),attributes,{'tableName':_0x4acd('0xb'),'paranoid':![],'indexes':[{'name':_0x4acd('0xc'),'fields':[_0x4acd('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x308a93,_0x365427,_0x218078){var _0xe9a34d=_0x2bf7b5[_0x4acd('0xe')];var _0x248e08=_0x308a93['get']({'plain':!![]});if(_0x248e08[_0x4acd('0xf')][_0x4acd('0x10')]()==='in'||_0x248e08[_0x4acd('0xf')]['toLowerCase']()===_0x4acd('0x11')&&!_0x248e08['secret']&&!_[_0x4acd('0x12')](_0x248e08[_0x4acd('0x13')])){_0xe9a34d[_0x4acd('0x14')][_0x4acd('0x15')]({'where':{'id':_0x248e08[_0x4acd('0x16')]}})['then'](function(_0x44bedf){if(_0x44bedf){_0x44bedf['update']({'lastMsgAt':_0x248e08[_0x4acd('0x17')],'lastMsgDirection':_0x248e08[_0x4acd('0xf')][_0x4acd('0x10')]()});}})[_0x4acd('0x18')](function(_0x13697a){console['error'](_0x13697a);});}_0x218078();}},'charset':'utf8mb4','collate':_0x4acd('0x19')});};
\ No newline at end of file
index 8ae2598..3945e6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcfa=['debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','body','raw','CreateChatMessage','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent'];(function(_0x4dc2a5,_0x2fed9a){var _0x3279a8=function(_0x3c0d91){while(--_0x3c0d91){_0x4dc2a5['push'](_0x4dc2a5['shift']());}};_0x3279a8(++_0x2fed9a);}(_0xfcfa,0x14b));var _0xafcf=function(_0x49d9bd,_0xc72fd3){_0x49d9bd=_0x49d9bd-0x0;var _0xf7561e=_0xfcfa[_0x49d9bd];return _0xf7561e;};'use strict';var _=require(_0xafcf('0x0'));var util=require(_0xafcf('0x1'));var moment=require(_0xafcf('0x2'));var BPromise=require(_0xafcf('0x3'));var rs=require(_0xafcf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xafcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xafcf('0x6'))('rpc');var config=require(_0xafcf('0x7'));var jayson=require(_0xafcf('0x8'));var client=jayson['client'][_0xafcf('0x9')]({'port':0x232a});config['redis']=_[_0xafcf('0xa')](config['redis'],{'host':_0xafcf('0xb'),'port':0x18eb});var socket=require(_0xafcf('0xc'))(new Redis(config[_0xafcf('0xd')]));require(_0xafcf('0xe'))[_0xafcf('0xf')](socket);function respondWithRpcPromise(_0x55eadc,_0x91d958,_0x48c935){return new BPromise(function(_0x533a04,_0x19bd2f){return client[_0xafcf('0x10')](_0x55eadc,_0x48c935)[_0xafcf('0x11')](function(_0x1b2ad4){logger[_0xafcf('0x12')](_0xafcf('0x13'),_0x91d958,_0xafcf('0x14'));logger[_0xafcf('0x15')](_0xafcf('0x16'),_0x91d958,_0xafcf('0x14'),JSON[_0xafcf('0x17')](_0x1b2ad4));if(_0x1b2ad4[_0xafcf('0x18')]){if(_0x1b2ad4[_0xafcf('0x18')][_0xafcf('0x19')]===0x1f4){logger['error'](_0xafcf('0x13'),_0x91d958,_0x1b2ad4[_0xafcf('0x18')][_0xafcf('0x1a')]);return _0x19bd2f(_0x1b2ad4[_0xafcf('0x18')][_0xafcf('0x1a')]);}logger[_0xafcf('0x18')](_0xafcf('0x13'),_0x91d958,_0x1b2ad4[_0xafcf('0x18')]['message']);return _0x533a04(_0x1b2ad4[_0xafcf('0x18')]['message']);}else{logger[_0xafcf('0x12')]('ChatMessage,\x20%s,\x20%s',_0x91d958,_0xafcf('0x14'));_0x533a04(_0x1b2ad4[_0xafcf('0x1b')][_0xafcf('0x1a')]);}})['catch'](function(_0x15ddfe){logger[_0xafcf('0x18')]('ChatMessage,\x20%s,\x20%s',_0x91d958,_0x15ddfe);_0x19bd2f(_0x15ddfe);});});}exports['CreateChatMessage']=function(_0x532e58){var _0x130714=this;return new Promise(function(_0x3fb518,_0x519912){return db['ChatMessage']['create'](_0x532e58[_0xafcf('0x1c')],{'raw':_0x532e58['options']?_0x532e58['options'][_0xafcf('0x1d')]===undefined?!![]:![]:!![]})[_0xafcf('0x11')](function(_0x29ba2c){logger['info'](_0xafcf('0x1e'),_0x532e58);logger['debug']('CreateChatMessage',_0x532e58,JSON[_0xafcf('0x17')](_0x29ba2c));_0x3fb518(_0x29ba2c);})[_0xafcf('0x1f')](function(_0x5b1308){logger['error'](_0xafcf('0x1e'),_0x5b1308[_0xafcf('0x1a')],_0x532e58);_0x519912(_0x130714[_0xafcf('0x18')](0x1f4,_0x5b1308[_0xafcf('0x1a')]));});});};
\ No newline at end of file
+var _0x56cd=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','raw','lodash','util','bluebird','randomstring','ioredis'];(function(_0x4754b3,_0x135d7f){var _0x39a6fe=function(_0x5b4827){while(--_0x5b4827){_0x4754b3['push'](_0x4754b3['shift']());}};_0x39a6fe(++_0x135d7f);}(_0x56cd,0x77));var _0xd56c=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x56cd[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0xd56c('0x0'));var util=require(_0xd56c('0x1'));var moment=require('moment');var BPromise=require(_0xd56c('0x2'));var rs=require(_0xd56c('0x3'));var fs=require('fs');var Redis=require(_0xd56c('0x4'));var db=require(_0xd56c('0x5'))['db'];var utils=require(_0xd56c('0x6'));var logger=require(_0xd56c('0x7'))(_0xd56c('0x8'));var config=require('../../config/environment');var jayson=require(_0xd56c('0x9'));var client=jayson[_0xd56c('0xa')][_0xd56c('0xb')]({'port':0x232a});config[_0xd56c('0xc')]=_[_0xd56c('0xd')](config[_0xd56c('0xc')],{'host':_0xd56c('0xe'),'port':0x18eb});var socket=require(_0xd56c('0xf'))(new Redis(config[_0xd56c('0xc')]));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x363b24,_0x8bce44,_0x3e6da4){return new BPromise(function(_0x517cc3,_0x594fd7){return client['request'](_0x363b24,_0x3e6da4)['then'](function(_0x416f59){logger[_0xd56c('0x10')](_0xd56c('0x11'),_0x8bce44,_0xd56c('0x12'));logger[_0xd56c('0x13')](_0xd56c('0x14'),_0x8bce44,_0xd56c('0x12'),JSON[_0xd56c('0x15')](_0x416f59));if(_0x416f59[_0xd56c('0x16')]){if(_0x416f59[_0xd56c('0x16')]['code']===0x1f4){logger['error'](_0xd56c('0x11'),_0x8bce44,_0x416f59[_0xd56c('0x16')]['message']);return _0x594fd7(_0x416f59['error'][_0xd56c('0x17')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x8bce44,_0x416f59['error']['message']);return _0x517cc3(_0x416f59[_0xd56c('0x16')][_0xd56c('0x17')]);}else{logger[_0xd56c('0x10')](_0xd56c('0x11'),_0x8bce44,'request\x20sent');_0x517cc3(_0x416f59[_0xd56c('0x18')][_0xd56c('0x17')]);}})[_0xd56c('0x19')](function(_0x3dbe59){logger[_0xd56c('0x16')](_0xd56c('0x11'),_0x8bce44,_0x3dbe59);_0x594fd7(_0x3dbe59);});});}exports[_0xd56c('0x1a')]=function(_0x23cafc){var _0x4ce500=this;return new Promise(function(_0x503c32,_0x1e1c68){return db[_0xd56c('0x1b')][_0xd56c('0x1c')](_0x23cafc[_0xd56c('0x1d')],{'raw':_0x23cafc['options']?_0x23cafc['options'][_0xd56c('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x37934d){logger['info'](_0xd56c('0x1a'),_0x23cafc);logger['debug'](_0xd56c('0x1a'),_0x23cafc,JSON[_0xd56c('0x15')](_0x37934d));_0x503c32(_0x37934d);})[_0xd56c('0x19')](function(_0x470f9f){logger[_0xd56c('0x16')](_0xd56c('0x1a'),_0x470f9f['message'],_0x23cafc);_0x1e1c68(_0x4ce500['error'](0x1f4,_0x470f9f['message']));});});};
\ No newline at end of file
index 7867420..e510f08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x826a=['update','emit','removeListener','register','length','chatMessage:','save'];(function(_0x84a5b6,_0x280deb){var _0x59014f=function(_0x59f5ca){while(--_0x59f5ca){_0x84a5b6['push'](_0x84a5b6['shift']());}};_0x59014f(++_0x280deb);}(_0x826a,0x1aa));var _0xa826=function(_0x263dbf,_0x4f18ad){_0x263dbf=_0x263dbf-0x0;var _0x1c39a7=_0x826a[_0x263dbf];return _0x1c39a7;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xa826('0x0'),'remove',_0xa826('0x1')];function createListener(_0x50c70e,_0x376d53){return function(_0x19ba11){_0x376d53[_0xa826('0x2')](_0x50c70e,_0x19ba11);};}function removeListener(_0x34e1ad,_0x5372ab){return function(){ChatMessageEvents[_0xa826('0x3')](_0x34e1ad,_0x5372ab);};}exports[_0xa826('0x4')]=function(_0x3929d4){for(var _0x34327b=0x0,_0x45154f=events[_0xa826('0x5')];_0x34327b<_0x45154f;_0x34327b++){var _0x4339f9=events[_0x34327b];var _0x14c2ba=createListener(_0xa826('0x6')+_0x4339f9,_0x3929d4);ChatMessageEvents['on'](_0x4339f9,_0x14c2ba);}};
\ No newline at end of file
+var _0x06f4=['register','chatMessage:','./chatMessage.events','save','update','emit','removeListener'];(function(_0x4e8618,_0x1a4c6d){var _0x50e0ed=function(_0x7c28ec){while(--_0x7c28ec){_0x4e8618['push'](_0x4e8618['shift']());}};_0x50e0ed(++_0x1a4c6d);}(_0x06f4,0x136));var _0x406f=function(_0x2904eb,_0x5906a4){_0x2904eb=_0x2904eb-0x0;var _0x2dbbd7=_0x06f4[_0x2904eb];return _0x2dbbd7;};'use strict';var ChatMessageEvents=require(_0x406f('0x0'));var events=[_0x406f('0x1'),'remove',_0x406f('0x2')];function createListener(_0x276a15,_0x58cd7d){return function(_0x5cab5e){_0x58cd7d[_0x406f('0x3')](_0x276a15,_0x5cab5e);};}function removeListener(_0x5ed32f,_0x32abfd){return function(){ChatMessageEvents[_0x406f('0x4')](_0x5ed32f,_0x32abfd);};}exports[_0x406f('0x5')]=function(_0x32b2bd){for(var _0x59821c=0x0,_0x1d2886=events['length'];_0x59821c<_0x1d2886;_0x59821c++){var _0x1afec4=events[_0x59821c];var _0x1c39ce=createListener(_0x406f('0x6')+_0x1afec4,_0x32b2bd);ChatMessageEvents['on'](_0x1afec4,_0x1c39ce);}};
\ No newline at end of file
index 0350ee6..43eb1f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4433=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','tracked','chat','chatmessage:create','put','/:id','update','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout'];(function(_0x27bcf5,_0x236765){var _0x4ce4cf=function(_0x4864ea){while(--_0x4864ea){_0x27bcf5['push'](_0x27bcf5['shift']());}};_0x4ce4cf(++_0x236765);}(_0x4433,0x176));var _0x3443=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4433[_0x122ef9];return _0x42fba0;};'use strict';var multer=require('multer');var util=require(_0x3443('0x0'));var path=require(_0x3443('0x1'));var timeout=require(_0x3443('0x2'));var express=require(_0x3443('0x3'));var router=express[_0x3443('0x4')]();var fs_extra=require(_0x3443('0x5'));var auth=require(_0x3443('0x6'));var interaction=require(_0x3443('0x7'));var config=require(_0x3443('0x8'));var controller=require(_0x3443('0x9'));router['get']('/',auth[_0x3443('0xa')](),controller[_0x3443('0xb')]);router[_0x3443('0xc')](_0x3443('0xd'),auth[_0x3443('0xa')](),controller[_0x3443('0xe')]);router['get']('/:id',auth[_0x3443('0xa')](),controller[_0x3443('0xf')]);router[_0x3443('0x10')]('/',auth[_0x3443('0xa')](),interaction[_0x3443('0x11')](_0x3443('0x12'),_0x3443('0x13')),controller['create']);router[_0x3443('0x14')](_0x3443('0x15'),controller[_0x3443('0x16')]);router[_0x3443('0x14')]('/:id/accept',auth[_0x3443('0xa')](),controller[_0x3443('0x17')]);router[_0x3443('0x14')](_0x3443('0x18'),auth[_0x3443('0xa')](),controller[_0x3443('0x19')]);router[_0x3443('0x1a')](_0x3443('0x15'),auth['isAuthenticated'](),controller[_0x3443('0x1b')]);module[_0x3443('0x1c')]=router;
\ No newline at end of file
+var _0x8f5f=['update','accept','reject','delete','/:id','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','post','tracked','chat','chatmessage:create','put'];(function(_0x489d50,_0x16d213){var _0x10d007=function(_0x143ae3){while(--_0x143ae3){_0x489d50['push'](_0x489d50['shift']());}};_0x10d007(++_0x16d213);}(_0x8f5f,0x133));var _0xf8f5=function(_0x556634,_0x520958){_0x556634=_0x556634-0x0;var _0x4429fd=_0x8f5f[_0x556634];return _0x4429fd;};'use strict';var multer=require('multer');var util=require(_0xf8f5('0x0'));var path=require(_0xf8f5('0x1'));var timeout=require(_0xf8f5('0x2'));var express=require(_0xf8f5('0x3'));var router=express['Router']();var fs_extra=require(_0xf8f5('0x4'));var auth=require(_0xf8f5('0x5'));var interaction=require(_0xf8f5('0x6'));var config=require('../../config/environment');var controller=require(_0xf8f5('0x7'));router[_0xf8f5('0x8')]('/',auth[_0xf8f5('0x9')](),controller[_0xf8f5('0xa')]);router[_0xf8f5('0x8')](_0xf8f5('0xb'),auth['isAuthenticated'](),controller[_0xf8f5('0xc')]);router[_0xf8f5('0x8')]('/:id',auth[_0xf8f5('0x9')](),controller['show']);router[_0xf8f5('0xd')]('/',auth[_0xf8f5('0x9')](),interaction[_0xf8f5('0xe')](_0xf8f5('0xf'),_0xf8f5('0x10')),controller['create']);router[_0xf8f5('0x11')]('/:id',controller[_0xf8f5('0x12')]);router[_0xf8f5('0x11')]('/:id/accept',auth[_0xf8f5('0x9')](),controller[_0xf8f5('0x13')]);router[_0xf8f5('0x11')]('/:id/reject',auth[_0xf8f5('0x9')](),controller[_0xf8f5('0x14')]);router[_0xf8f5('0x15')](_0xf8f5('0x16'),auth['isAuthenticated'](),controller[_0xf8f5('0x17')]);module[_0xf8f5('0x18')]=router;
\ No newline at end of file
index 2f44a77..4f7d5b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55bc=['exports','TEXT','medium','sequelize'];(function(_0x5515ba,_0x4ad978){var _0x1f7b06=function(_0x1efa7f){while(--_0x1efa7f){_0x5515ba['push'](_0x5515ba['shift']());}};_0x1f7b06(++_0x4ad978);}(_0x55bc,0x18b));var _0xc55b=function(_0x43a65c,_0x34f170){_0x43a65c=_0x43a65c-0x0;var _0x22d44b=_0x55bc[_0x43a65c];return _0x22d44b;};'use strict';var Sequelize=require(_0xc55b('0x0'));module[_0xc55b('0x1')]={'body':{'type':Sequelize[_0xc55b('0x2')](_0xc55b('0x3')),'allowNull':![]}};
\ No newline at end of file
+var _0x896d=['sequelize','medium'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x896d,0x1dc));var _0xd896=function(_0x3c056a,_0x34c1ce){_0x3c056a=_0x3c056a-0x0;var _0x1bff8f=_0x896d[_0x3c056a];return _0x1bff8f;};'use strict';var Sequelize=require(_0xd896('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xd896('0x1')),'allowNull':![]}};
\ No newline at end of file
index 01353a7..364cf4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x7a54,0x106));var _0x47a5=function(_0x35f7a7,_0x971f7b){_0x35f7a7=_0x35f7a7-0x0;var _0x452cde=_0x7a54[_0x35f7a7];return _0x452cde;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4201a8,_0x5685a9){var _0x36899e=function(_0x39ae87){while(--_0x39ae87){_0x4201a8['push'](_0x4201a8['shift']());}};_0x36899e(++_0x5685a9);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
index ad3e7ac..43dcf11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0456=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','chat_offline_messages'];(function(_0x4e0026,_0x2b52b6){var _0x3f8ee7=function(_0x31d891){while(--_0x31d891){_0x4e0026['push'](_0x4e0026['shift']());}};_0x3f8ee7(++_0x2b52b6);}(_0x0456,0x1a6));var _0x6045=function(_0x308981,_0x28a394){_0x308981=_0x308981-0x0;var _0x1370df=_0x0456[_0x308981];return _0x1370df;};'use strict';var _=require(_0x6045('0x0'));var util=require(_0x6045('0x1'));var logger=require(_0x6045('0x2'))(_0x6045('0x3'));var moment=require(_0x6045('0x4'));var BPromise=require(_0x6045('0x5'));var rp=require(_0x6045('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6045('0x7'));var config=require(_0x6045('0x8'));var attributes=require(_0x6045('0x9'));module[_0x6045('0xa')]=function(_0x323047,_0x5e0bd5){return _0x323047[_0x6045('0xb')]('ChatOfflineMessage',attributes,{'tableName':_0x6045('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6045('0xd'),'collate':_0x6045('0xe')});};
\ No newline at end of file
+var _0x0243=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x31ba88,_0x4430b7){var _0x412113=function(_0x3a0dc9){while(--_0x3a0dc9){_0x31ba88['push'](_0x31ba88['shift']());}};_0x412113(++_0x4430b7);}(_0x0243,0x191));var _0x3024=function(_0x70a176,_0x3f2e3f){_0x70a176=_0x70a176-0x0;var _0x1ad0b4=_0x0243[_0x70a176];return _0x1ad0b4;};'use strict';var _=require('lodash');var util=require(_0x3024('0x0'));var logger=require(_0x3024('0x1'))(_0x3024('0x2'));var moment=require(_0x3024('0x3'));var BPromise=require(_0x3024('0x4'));var rp=require(_0x3024('0x5'));var fs=require('fs');var path=require(_0x3024('0x6'));var rimraf=require(_0x3024('0x7'));var config=require(_0x3024('0x8'));var attributes=require(_0x3024('0x9'));module[_0x3024('0xa')]=function(_0xd1404e,_0x19f3e8){return _0xd1404e[_0x3024('0xb')](_0x3024('0xc'),attributes,{'tableName':_0x3024('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3024('0xe'),'collate':_0x3024('0xf')});};
\ No newline at end of file
index de6e03e..185c291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2aca=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util'];(function(_0x4c7194,_0x369feb){var _0x2f7b2c=function(_0x97427a){while(--_0x97427a){_0x4c7194['push'](_0x4c7194['shift']());}};_0x2f7b2c(++_0x369feb);}(_0x2aca,0x166));var _0xa2ac=function(_0x2982f9,_0x3b5402){_0x2982f9=_0x2982f9-0x0;var _0x3be8d0=_0x2aca[_0x2982f9];return _0x3be8d0;};'use strict';var _=require(_0xa2ac('0x0'));var util=require(_0xa2ac('0x1'));var moment=require(_0xa2ac('0x2'));var BPromise=require(_0xa2ac('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2ac('0x4'));var db=require(_0xa2ac('0x5'))['db'];var utils=require(_0xa2ac('0x6'));var logger=require(_0xa2ac('0x7'))(_0xa2ac('0x8'));var config=require(_0xa2ac('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa2ac('0xa')][_0xa2ac('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x125160,_0x1d5d73,_0x1045a5){return new BPromise(function(_0x214ba7,_0x998a97){return client[_0xa2ac('0xc')](_0x125160,_0x1045a5)[_0xa2ac('0xd')](function(_0x314e77){logger[_0xa2ac('0xe')](_0xa2ac('0xf'),_0x1d5d73,_0xa2ac('0x10'));logger[_0xa2ac('0x11')](_0xa2ac('0x12'),_0x1d5d73,'request\x20sent',JSON['stringify'](_0x314e77));if(_0x314e77[_0xa2ac('0x13')]){if(_0x314e77[_0xa2ac('0x13')][_0xa2ac('0x14')]===0x1f4){logger[_0xa2ac('0x13')](_0xa2ac('0xf'),_0x1d5d73,_0x314e77[_0xa2ac('0x13')][_0xa2ac('0x15')]);return _0x998a97(_0x314e77[_0xa2ac('0x13')]['message']);}logger['error'](_0xa2ac('0xf'),_0x1d5d73,_0x314e77['error'][_0xa2ac('0x15')]);return _0x214ba7(_0x314e77[_0xa2ac('0x13')][_0xa2ac('0x15')]);}else{logger[_0xa2ac('0xe')](_0xa2ac('0xf'),_0x1d5d73,'request\x20sent');_0x214ba7(_0x314e77[_0xa2ac('0x16')][_0xa2ac('0x15')]);}})[_0xa2ac('0x17')](function(_0x266167){logger[_0xa2ac('0x13')](_0xa2ac('0xf'),_0x1d5d73,_0x266167);_0x998a97(_0x266167);});});}
\ No newline at end of file
+var _0x33ba=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x459bcb,_0x1c02aa){var _0x308a6b=function(_0x3224ab){while(--_0x3224ab){_0x459bcb['push'](_0x459bcb['shift']());}};_0x308a6b(++_0x1c02aa);}(_0x33ba,0x1f0));var _0xa33b=function(_0x320210,_0x11dfb7){_0x320210=_0x320210-0x0;var _0x5be217=_0x33ba[_0x320210];return _0x5be217;};'use strict';var _=require(_0xa33b('0x0'));var util=require(_0xa33b('0x1'));var moment=require('moment');var BPromise=require(_0xa33b('0x2'));var rs=require(_0xa33b('0x3'));var fs=require('fs');var Redis=require(_0xa33b('0x4'));var db=require(_0xa33b('0x5'))['db'];var utils=require(_0xa33b('0x6'));var logger=require(_0xa33b('0x7'))(_0xa33b('0x8'));var config=require(_0xa33b('0x9'));var jayson=require(_0xa33b('0xa'));var client=jayson[_0xa33b('0xb')][_0xa33b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x371668,_0x1723e9,_0xc09188){return new BPromise(function(_0x387c2c,_0x4b49e2){return client[_0xa33b('0xd')](_0x371668,_0xc09188)[_0xa33b('0xe')](function(_0x333220){logger[_0xa33b('0xf')](_0xa33b('0x10'),_0x1723e9,_0xa33b('0x11'));logger[_0xa33b('0x12')](_0xa33b('0x13'),_0x1723e9,_0xa33b('0x11'),JSON[_0xa33b('0x14')](_0x333220));if(_0x333220[_0xa33b('0x15')]){if(_0x333220[_0xa33b('0x15')][_0xa33b('0x16')]===0x1f4){logger[_0xa33b('0x15')](_0xa33b('0x10'),_0x1723e9,_0x333220[_0xa33b('0x15')][_0xa33b('0x17')]);return _0x4b49e2(_0x333220[_0xa33b('0x15')][_0xa33b('0x17')]);}logger[_0xa33b('0x15')](_0xa33b('0x10'),_0x1723e9,_0x333220[_0xa33b('0x15')]['message']);return _0x387c2c(_0x333220['error'][_0xa33b('0x17')]);}else{logger[_0xa33b('0xf')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1723e9,'request\x20sent');_0x387c2c(_0x333220['result'][_0xa33b('0x17')]);}})[_0xa33b('0x18')](function(_0x53200a){logger['error'](_0xa33b('0x10'),_0x1723e9,_0x53200a);_0x4b49e2(_0x53200a);});});}
\ No newline at end of file
index 31fb8a1..6476fed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x293f=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0x293f,0x1da));var _0xf293=function(_0x4b2e88,_0xcd5187){_0x4b2e88=_0x4b2e88-0x0;var _0x5a02c6=_0x293f[_0x4b2e88];return _0x5a02c6;};'use strict';var multer=require('multer');var util=require(_0xf293('0x0'));var path=require(_0xf293('0x1'));var timeout=require('connect-timeout');var express=require(_0xf293('0x2'));var router=express[_0xf293('0x3')]();var fs_extra=require(_0xf293('0x4'));var auth=require(_0xf293('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf293('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0xf293('0x7')]('/',auth[_0xf293('0x8')](),controller['index']);router[_0xf293('0x7')](_0xf293('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xf293('0x7')](_0xf293('0xa'),auth[_0xf293('0x8')](),controller[_0xf293('0xb')]);router[_0xf293('0xc')]('/',auth[_0xf293('0x8')](),controller[_0xf293('0xd')]);router[_0xf293('0xe')](_0xf293('0xa'),auth[_0xf293('0x8')](),controller[_0xf293('0xf')]);router[_0xf293('0x10')](_0xf293('0xa'),auth[_0xf293('0x8')](),controller[_0xf293('0x11')]);module[_0xf293('0x12')]=router;
\ No newline at end of file
+var _0x54fe=['show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x57b236,_0x30614e){var _0x4feb29=function(_0x26d3e6){while(--_0x26d3e6){_0x57b236['push'](_0x57b236['shift']());}};_0x4feb29(++_0x30614e);}(_0x54fe,0x9a));var _0xe54f=function(_0x426d1d,_0x5f364d){_0x426d1d=_0x426d1d-0x0;var _0x18366a=_0x54fe[_0x426d1d];return _0x18366a;};'use strict';var multer=require(_0xe54f('0x0'));var util=require('util');var path=require(_0xe54f('0x1'));var timeout=require(_0xe54f('0x2'));var express=require(_0xe54f('0x3'));var router=express[_0xe54f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe54f('0x5'));var interaction=require(_0xe54f('0x6'));var config=require(_0xe54f('0x7'));var controller=require(_0xe54f('0x8'));router[_0xe54f('0x9')]('/',auth['isAuthenticated'](),controller[_0xe54f('0xa')]);router[_0xe54f('0x9')](_0xe54f('0xb'),auth[_0xe54f('0xc')](),controller['describe']);router[_0xe54f('0x9')](_0xe54f('0xd'),auth['isAuthenticated'](),controller[_0xe54f('0xe')]);router['post']('/',auth[_0xe54f('0xc')](),controller[_0xe54f('0xf')]);router[_0xe54f('0x10')](_0xe54f('0xd'),auth[_0xe54f('0xc')](),controller[_0xe54f('0x11')]);router[_0xe54f('0x12')]('/:id',auth[_0xe54f('0xc')](),controller[_0xe54f('0x13')]);module[_0xe54f('0x14')]=router;
\ No newline at end of file
index 738ce3b..70fc06d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9ba=['exports','STRING','mouseOver','INTEGER'];(function(_0x1bd85d,_0xdc683f){var _0xd40669=function(_0x318648){while(--_0x318648){_0x1bd85d['push'](_0x1bd85d['shift']());}};_0xd40669(++_0xdc683f);}(_0xd9ba,0x15c));var _0xad9b=function(_0x5b2768,_0x4d6c05){_0x5b2768=_0x5b2768-0x0;var _0x11114e=_0xd9ba[_0x5b2768];return _0x11114e;};'use strict';var Sequelize=require('sequelize');module[_0xad9b('0x0')]={'name':{'type':Sequelize[_0xad9b('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0xad9b('0x2')},'selector':{'type':Sequelize[_0xad9b('0x1')]},'timeout':{'type':Sequelize[_0xad9b('0x3')]}};
\ No newline at end of file
+var _0x2014=['sequelize','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x17ef88,_0x581af4){var _0x1dc0fc=function(_0x390176){while(--_0x390176){_0x17ef88['push'](_0x17ef88['shift']());}};_0x1dc0fc(++_0x581af4);}(_0x2014,0x16e));var _0x4201=function(_0x48f399,_0xfff5d1){_0x48f399=_0x48f399-0x0;var _0x176413=_0x2014[_0x48f399];return _0x176413;};'use strict';var Sequelize=require(_0x4201('0x0'));module['exports']={'name':{'type':Sequelize[_0x4201('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4201('0x2')](_0x4201('0x3'),_0x4201('0x4')),'defaultValue':_0x4201('0x3')},'selector':{'type':Sequelize[_0x4201('0x1')]},'timeout':{'type':Sequelize[_0x4201('0x5')]}};
\ No newline at end of file
index f8b98d7..00bc532 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f5d=['then','destroy','sendStatus','stack','name','show','params','model','keys','ChatProactiveAction','filters','intersection','query','fields','attributes','length','includeAll','include','merge','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','Content-Range','apply','save','update'];(function(_0x5a1371,_0x3c14e6){var _0x46f9a7=function(_0x4867da){while(--_0x4867da){_0x5a1371['push'](_0x5a1371['shift']());}};_0x46f9a7(++_0x3c14e6);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x4f5d[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0xd4f5('0x0'));var rimraf=require(_0xd4f5('0x1'));var zipdir=require(_0xd4f5('0x2'));var jsonpatch=require(_0xd4f5('0x3'));var rp=require(_0xd4f5('0x4'));var moment=require(_0xd4f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd4f5('0x6'));var util=require(_0xd4f5('0x7'));var path=require(_0xd4f5('0x8'));var sox=require(_0xd4f5('0x9'));var csv=require(_0xd4f5('0xa'));var ejs=require(_0xd4f5('0xb'));var fs=require('fs');var fs_extra=require(_0xd4f5('0xc'));var _=require(_0xd4f5('0xd'));var squel=require(_0xd4f5('0xe'));var crypto=require(_0xd4f5('0xf'));var jsforce=require(_0xd4f5('0x10'));var deskjs=require(_0xd4f5('0x11'));var toCsv=require(_0xd4f5('0xa'));var querystring=require('querystring');var Papa=require(_0xd4f5('0x12'));var Redis=require(_0xd4f5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd4f5('0x14'));var as=require(_0xd4f5('0x15'));var hardwareService=require(_0xd4f5('0x16'));var logger=require(_0xd4f5('0x17'))(_0xd4f5('0x18'));var utils=require(_0xd4f5('0x19'));var config=require(_0xd4f5('0x1a'));var licenseUtil=require(_0xd4f5('0x1b'));var db=require(_0xd4f5('0x1c'))['db'];function respondWithStatusCode(_0x5d5554,_0x445072){_0x445072=_0x445072||0xcc;return function(_0x21b2a2){if(_0x21b2a2){return _0x5d5554['sendStatus'](_0x445072);}return _0x5d5554[_0xd4f5('0x1d')](_0x445072)[_0xd4f5('0x1e')]();};}function respondWithResult(_0x28e1cf,_0x511fcf){_0x511fcf=_0x511fcf||0xc8;return function(_0x166d4d){if(_0x166d4d){return _0x28e1cf[_0xd4f5('0x1d')](_0x511fcf)[_0xd4f5('0x1f')](_0x166d4d);}};}function respondWithFilteredResult(_0x1a158f,_0x33f6dc){return function(_0x32f4b7){if(_0x32f4b7){var _0x23780a=typeof _0x33f6dc[_0xd4f5('0x20')]==='undefined'&&typeof _0x33f6dc[_0xd4f5('0x21')]==='undefined';var _0x45d043=_0x32f4b7['count'];var _0x220707=_0x23780a?0x0:_0x33f6dc[_0xd4f5('0x20')];var _0x271f53=_0x23780a?_0x32f4b7[_0xd4f5('0x22')]:_0x33f6dc[_0xd4f5('0x20')]+_0x33f6dc[_0xd4f5('0x21')];var _0x8c7e05;if(_0x271f53>=_0x45d043){_0x271f53=_0x45d043;_0x8c7e05=0xc8;}else{_0x8c7e05=0xce;}_0x1a158f[_0xd4f5('0x1d')](_0x8c7e05);return _0x1a158f['set'](_0xd4f5('0x23'),_0x220707+'-'+_0x271f53+'/'+_0x45d043)[_0xd4f5('0x1f')](_0x32f4b7);}return null;};}function patchUpdates(_0x57a16b){return function(_0x1aae04){try{jsonpatch[_0xd4f5('0x24')](_0x1aae04,_0x57a16b,!![]);}catch(_0x47f101){return BPromise['reject'](_0x47f101);}return _0x1aae04[_0xd4f5('0x25')]();};}function saveUpdates(_0x161443,_0x3cbe7b){return function(_0x3ae7af){if(_0x3ae7af){return _0x3ae7af[_0xd4f5('0x26')](_0x161443)[_0xd4f5('0x27')](function(_0x378af6){return _0x378af6;});}return null;};}function removeEntity(_0x527dd4,_0x578071){return function(_0x5ccc63){if(_0x5ccc63){return _0x5ccc63[_0xd4f5('0x28')]()[_0xd4f5('0x27')](function(){_0x527dd4[_0xd4f5('0x1d')](0xcc)[_0xd4f5('0x1e')]();});}};}function handleEntityNotFound(_0x5f3a5d,_0xb7ea1){return function(_0x49ad32){if(!_0x49ad32){_0x5f3a5d[_0xd4f5('0x29')](0x194);}return _0x49ad32;};}function handleError(_0x2fbee8,_0x5b519e){_0x5b519e=_0x5b519e||0x1f4;return function(_0x5ba979){logger['error'](_0x5ba979[_0xd4f5('0x2a')]);if(_0x5ba979[_0xd4f5('0x2b')]){delete _0x5ba979['name'];}_0x2fbee8[_0xd4f5('0x1d')](_0x5b519e)['send'](_0x5ba979);};}exports[_0xd4f5('0x2c')]=function(_0xb5dd60,_0x2134f2){var _0x2130e4={'raw':!![],'where':{'id':_0xb5dd60[_0xd4f5('0x2d')]['id']}},_0x32d067={};_0x32d067[_0xd4f5('0x2e')]=_[_0xd4f5('0x2f')](db[_0xd4f5('0x30')]['rawAttributes']);_0x32d067['query']=_['keys'](_0xb5dd60['query']);_0x32d067[_0xd4f5('0x31')]=_[_0xd4f5('0x32')](_0x32d067[_0xd4f5('0x2e')],_0x32d067[_0xd4f5('0x33')]);_0x2130e4['attributes']=_[_0xd4f5('0x32')](_0x32d067[_0xd4f5('0x2e')],qs[_0xd4f5('0x34')](_0xb5dd60[_0xd4f5('0x33')][_0xd4f5('0x34')]));_0x2130e4[_0xd4f5('0x35')]=_0x2130e4[_0xd4f5('0x35')][_0xd4f5('0x36')]?_0x2130e4[_0xd4f5('0x35')]:_0x32d067['model'];if(_0xb5dd60['query'][_0xd4f5('0x37')]){_0x2130e4[_0xd4f5('0x38')]=[{'all':!![]}];}_0x2130e4=_[_0xd4f5('0x39')]({},_0x2130e4,_0xb5dd60[_0xd4f5('0x3a')]);return db[_0xd4f5('0x30')]['find'](_0x2130e4)[_0xd4f5('0x27')](handleEntityNotFound(_0x2134f2,null))[_0xd4f5('0x27')](respondWithResult(_0x2134f2,null))[_0xd4f5('0x3b')](handleError(_0x2134f2,null));};exports['create']=function(_0x23b0af,_0x31b9e6){return db[_0xd4f5('0x30')][_0xd4f5('0x3c')](_0x23b0af[_0xd4f5('0x3d')],{})[_0xd4f5('0x27')](respondWithResult(_0x31b9e6,0xc9))['catch'](handleError(_0x31b9e6,null));};exports['update']=function(_0x5555b8,_0x29f348){if(_0x5555b8[_0xd4f5('0x3d')]['id']){delete _0x5555b8['body']['id'];}return db[_0xd4f5('0x30')][_0xd4f5('0x3e')]({'where':{'id':_0x5555b8['params']['id']}})[_0xd4f5('0x27')](handleEntityNotFound(_0x29f348,null))[_0xd4f5('0x27')](saveUpdates(_0x5555b8['body'],null))['then'](respondWithResult(_0x29f348,null))[_0xd4f5('0x3b')](handleError(_0x29f348,null));};exports['destroy']=function(_0x172294,_0x3070bb){return db[_0xd4f5('0x30')][_0xd4f5('0x3e')]({'where':{'id':_0x172294[_0xd4f5('0x2d')]['id']}})[_0xd4f5('0x27')](handleEntityNotFound(_0x3070bb,null))[_0xd4f5('0x27')](removeEntity(_0x3070bb,null))[_0xd4f5('0x3b')](handleError(_0x3070bb,null));};
\ No newline at end of file
+var _0x3cd8=['destroy','error','name','send','show','params','model','ChatProactiveAction','rawAttributes','keys','query','attributes','fields','length','includeAll','merge','options','find','create','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','update','then'];(function(_0x4f3479,_0x146014){var _0x594fe3=function(_0x219022){while(--_0x219022){_0x4f3479['push'](_0x4f3479['shift']());}};_0x594fe3(++_0x146014);}(_0x3cd8,0x150));var _0x83cd=function(_0x21929f,_0xb96182){_0x21929f=_0x21929f-0x0;var _0x1a6077=_0x3cd8[_0x21929f];return _0x1a6077;};'use strict';var emlformat=require(_0x83cd('0x0'));var rimraf=require(_0x83cd('0x1'));var zipdir=require(_0x83cd('0x2'));var jsonpatch=require(_0x83cd('0x3'));var rp=require(_0x83cd('0x4'));var moment=require(_0x83cd('0x5'));var BPromise=require(_0x83cd('0x6'));var Mustache=require(_0x83cd('0x7'));var util=require('util');var path=require(_0x83cd('0x8'));var sox=require(_0x83cd('0x9'));var csv=require(_0x83cd('0xa'));var ejs=require(_0x83cd('0xb'));var fs=require('fs');var fs_extra=require(_0x83cd('0xc'));var _=require(_0x83cd('0xd'));var squel=require(_0x83cd('0xe'));var crypto=require(_0x83cd('0xf'));var jsforce=require(_0x83cd('0x10'));var deskjs=require(_0x83cd('0x11'));var toCsv=require(_0x83cd('0xa'));var querystring=require(_0x83cd('0x12'));var Papa=require(_0x83cd('0x13'));var Redis=require(_0x83cd('0x14'));var authService=require(_0x83cd('0x15'));var qs=require(_0x83cd('0x16'));var as=require(_0x83cd('0x17'));var hardwareService=require(_0x83cd('0x18'));var logger=require(_0x83cd('0x19'))(_0x83cd('0x1a'));var utils=require('../../config/utils');var config=require(_0x83cd('0x1b'));var licenseUtil=require(_0x83cd('0x1c'));var db=require(_0x83cd('0x1d'))['db'];function respondWithStatusCode(_0x44ab88,_0x3e2fd6){_0x3e2fd6=_0x3e2fd6||0xcc;return function(_0x1d4114){if(_0x1d4114){return _0x44ab88[_0x83cd('0x1e')](_0x3e2fd6);}return _0x44ab88[_0x83cd('0x1f')](_0x3e2fd6)['end']();};}function respondWithResult(_0x53e70f,_0x6c51e2){_0x6c51e2=_0x6c51e2||0xc8;return function(_0x2d330d){if(_0x2d330d){return _0x53e70f[_0x83cd('0x1f')](_0x6c51e2)[_0x83cd('0x20')](_0x2d330d);}};}function respondWithFilteredResult(_0x385166,_0x501688){return function(_0x4df635){if(_0x4df635){var _0x268f58=typeof _0x501688[_0x83cd('0x21')]===_0x83cd('0x22')&&typeof _0x501688[_0x83cd('0x23')]===_0x83cd('0x22');var _0x3d6303=_0x4df635[_0x83cd('0x24')];var _0x1e136e=_0x268f58?0x0:_0x501688['offset'];var _0x1df488=_0x268f58?_0x4df635['count']:_0x501688[_0x83cd('0x21')]+_0x501688[_0x83cd('0x23')];var _0x23d9e4;if(_0x1df488>=_0x3d6303){_0x1df488=_0x3d6303;_0x23d9e4=0xc8;}else{_0x23d9e4=0xce;}_0x385166['status'](_0x23d9e4);return _0x385166['set'](_0x83cd('0x25'),_0x1e136e+'-'+_0x1df488+'/'+_0x3d6303)['json'](_0x4df635);}return null;};}function patchUpdates(_0x2748ba){return function(_0x6bb0f4){try{jsonpatch['apply'](_0x6bb0f4,_0x2748ba,!![]);}catch(_0x327f7e){return BPromise[_0x83cd('0x26')](_0x327f7e);}return _0x6bb0f4[_0x83cd('0x27')]();};}function saveUpdates(_0x648d88,_0x7a81d7){return function(_0x3f6c85){if(_0x3f6c85){return _0x3f6c85[_0x83cd('0x28')](_0x648d88)[_0x83cd('0x29')](function(_0x507f7e){return _0x507f7e;});}return null;};}function removeEntity(_0x55821c,_0x10c4ef){return function(_0x56c424){if(_0x56c424){return _0x56c424[_0x83cd('0x2a')]()[_0x83cd('0x29')](function(){_0x55821c[_0x83cd('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30c29e,_0x33bb16){return function(_0x3558fa){if(!_0x3558fa){_0x30c29e[_0x83cd('0x1e')](0x194);}return _0x3558fa;};}function handleError(_0x124ce0,_0x1c4fed){_0x1c4fed=_0x1c4fed||0x1f4;return function(_0x14ab2e){logger[_0x83cd('0x2b')](_0x14ab2e['stack']);if(_0x14ab2e[_0x83cd('0x2c')]){delete _0x14ab2e[_0x83cd('0x2c')];}_0x124ce0[_0x83cd('0x1f')](_0x1c4fed)[_0x83cd('0x2d')](_0x14ab2e);};}exports[_0x83cd('0x2e')]=function(_0x9dbb16,_0x317546){var _0x1df0ef={'raw':!![],'where':{'id':_0x9dbb16[_0x83cd('0x2f')]['id']}},_0x3eb69c={};_0x3eb69c[_0x83cd('0x30')]=_['keys'](db[_0x83cd('0x31')][_0x83cd('0x32')]);_0x3eb69c['query']=_[_0x83cd('0x33')](_0x9dbb16[_0x83cd('0x34')]);_0x3eb69c['filters']=_['intersection'](_0x3eb69c['model'],_0x3eb69c[_0x83cd('0x34')]);_0x1df0ef[_0x83cd('0x35')]=_['intersection'](_0x3eb69c[_0x83cd('0x30')],qs[_0x83cd('0x36')](_0x9dbb16[_0x83cd('0x34')][_0x83cd('0x36')]));_0x1df0ef[_0x83cd('0x35')]=_0x1df0ef[_0x83cd('0x35')][_0x83cd('0x37')]?_0x1df0ef[_0x83cd('0x35')]:_0x3eb69c[_0x83cd('0x30')];if(_0x9dbb16[_0x83cd('0x34')][_0x83cd('0x38')]){_0x1df0ef['include']=[{'all':!![]}];}_0x1df0ef=_[_0x83cd('0x39')]({},_0x1df0ef,_0x9dbb16[_0x83cd('0x3a')]);return db[_0x83cd('0x31')][_0x83cd('0x3b')](_0x1df0ef)['then'](handleEntityNotFound(_0x317546,null))['then'](respondWithResult(_0x317546,null))['catch'](handleError(_0x317546,null));};exports[_0x83cd('0x3c')]=function(_0x51930b,_0x5867ad){return db['ChatProactiveAction'][_0x83cd('0x3c')](_0x51930b[_0x83cd('0x3d')],{})[_0x83cd('0x29')](respondWithResult(_0x5867ad,0xc9))[_0x83cd('0x3e')](handleError(_0x5867ad,null));};exports[_0x83cd('0x28')]=function(_0x2c87aa,_0x58a782){if(_0x2c87aa[_0x83cd('0x3d')]['id']){delete _0x2c87aa[_0x83cd('0x3d')]['id'];}return db[_0x83cd('0x31')]['find']({'where':{'id':_0x2c87aa[_0x83cd('0x2f')]['id']}})[_0x83cd('0x29')](handleEntityNotFound(_0x58a782,null))[_0x83cd('0x29')](saveUpdates(_0x2c87aa['body'],null))['then'](respondWithResult(_0x58a782,null))[_0x83cd('0x3e')](handleError(_0x58a782,null));};exports[_0x83cd('0x2a')]=function(_0x4bd47c,_0xac795e){return db[_0x83cd('0x31')][_0x83cd('0x3b')]({'where':{'id':_0x4bd47c[_0x83cd('0x2f')]['id']}})[_0x83cd('0x29')](handleEntityNotFound(_0xac795e,null))['then'](removeEntity(_0xac795e,null))[_0x83cd('0x3e')](handleError(_0xac795e,null));};
\ No newline at end of file
index 80e1513..1bc4525 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb6a=['ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define'];(function(_0x47041d,_0x42153f){var _0x5022bd=function(_0x1dbb9a){while(--_0x1dbb9a){_0x47041d['push'](_0x47041d['shift']());}};_0x5022bd(++_0x42153f);}(_0xdb6a,0xd2));var _0xadb6=function(_0x4cde90,_0x537324){_0x4cde90=_0x4cde90-0x0;var _0x443fdd=_0xdb6a[_0x4cde90];return _0x443fdd;};'use strict';var _=require(_0xadb6('0x0'));var util=require(_0xadb6('0x1'));var logger=require(_0xadb6('0x2'))('api');var moment=require(_0xadb6('0x3'));var BPromise=require(_0xadb6('0x4'));var rp=require(_0xadb6('0x5'));var fs=require('fs');var path=require(_0xadb6('0x6'));var rimraf=require(_0xadb6('0x7'));var config=require(_0xadb6('0x8'));var attributes=require(_0xadb6('0x9'));module['exports']=function(_0x2d14cb,_0x279511){return _0x2d14cb[_0xadb6('0xa')](_0xadb6('0xb'),attributes,{'tableName':_0xadb6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe465=['lodash','util','../../config/logger','api','moment','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x3b0a54,_0xbe0c37){var _0x5fffbf=function(_0x111940){while(--_0x111940){_0x3b0a54['push'](_0x3b0a54['shift']());}};_0x5fffbf(++_0xbe0c37);}(_0xe465,0xc0));var _0x5e46=function(_0xd949b3,_0x2f38d5){_0xd949b3=_0xd949b3-0x0;var _0xdc1707=_0xe465[_0xd949b3];return _0xdc1707;};'use strict';var _=require(_0x5e46('0x0'));var util=require(_0x5e46('0x1'));var logger=require(_0x5e46('0x2'))(_0x5e46('0x3'));var moment=require(_0x5e46('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5e46('0x5'));var rimraf=require(_0x5e46('0x6'));var config=require('../../config/environment');var attributes=require(_0x5e46('0x7'));module[_0x5e46('0x8')]=function(_0x5979fb,_0x241e43){return _0x5979fb[_0x5e46('0x9')](_0x5e46('0xa'),attributes,{'tableName':_0x5e46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e7cca0b..8a6c679 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a5c=['moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','lodash','util'];(function(_0x331dc8,_0xb89dcc){var _0x565cbd=function(_0x2cbbcd){while(--_0x2cbbcd){_0x331dc8['push'](_0x331dc8['shift']());}};_0x565cbd(++_0xb89dcc);}(_0x6a5c,0x163));var _0xc6a5=function(_0x4c9d58,_0x1c83f0){_0x4c9d58=_0x4c9d58-0x0;var _0x3ad22d=_0x6a5c[_0x4c9d58];return _0x3ad22d;};'use strict';var _=require(_0xc6a5('0x0'));var util=require(_0xc6a5('0x1'));var moment=require(_0xc6a5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc6a5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc6a5('0x4'));var logger=require(_0xc6a5('0x5'))('rpc');var config=require(_0xc6a5('0x6'));var jayson=require(_0xc6a5('0x7'));var client=jayson['client'][_0xc6a5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x13f8a9,_0x46caeb,_0x457234){return new BPromise(function(_0x2cce98,_0x448640){return client[_0xc6a5('0x9')](_0x13f8a9,_0x457234)[_0xc6a5('0xa')](function(_0x30f095){logger[_0xc6a5('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x46caeb,_0xc6a5('0xc'));logger[_0xc6a5('0xd')](_0xc6a5('0xe'),_0x46caeb,_0xc6a5('0xc'),JSON[_0xc6a5('0xf')](_0x30f095));if(_0x30f095['error']){if(_0x30f095[_0xc6a5('0x10')][_0xc6a5('0x11')]===0x1f4){logger[_0xc6a5('0x10')](_0xc6a5('0x12'),_0x46caeb,_0x30f095['error'][_0xc6a5('0x13')]);return _0x448640(_0x30f095[_0xc6a5('0x10')][_0xc6a5('0x13')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x46caeb,_0x30f095[_0xc6a5('0x10')][_0xc6a5('0x13')]);return _0x2cce98(_0x30f095['error'][_0xc6a5('0x13')]);}else{logger[_0xc6a5('0xb')](_0xc6a5('0x12'),_0x46caeb,_0xc6a5('0xc'));_0x2cce98(_0x30f095[_0xc6a5('0x14')][_0xc6a5('0x13')]);}})['catch'](function(_0x421d92){logger[_0xc6a5('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x46caeb,_0x421d92);_0x448640(_0x421d92);});});}
\ No newline at end of file
+var _0xb7ef=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','randomstring'];(function(_0x26ef09,_0x595cd9){var _0xba8683=function(_0x4a2f18){while(--_0x4a2f18){_0x26ef09['push'](_0x26ef09['shift']());}};_0xba8683(++_0x595cd9);}(_0xb7ef,0x154));var _0xfb7e=function(_0x3046bf,_0x90194e){_0x3046bf=_0x3046bf-0x0;var _0x246932=_0xb7ef[_0x3046bf];return _0x246932;};'use strict';var _=require(_0xfb7e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xfb7e('0x1'));var fs=require('fs');var Redis=require(_0xfb7e('0x2'));var db=require(_0xfb7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb7e('0x4'))(_0xfb7e('0x5'));var config=require(_0xfb7e('0x6'));var jayson=require(_0xfb7e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b6339,_0x204ae6,_0x13f96c){return new BPromise(function(_0x1daae8,_0x4cbc51){return client[_0xfb7e('0x8')](_0x4b6339,_0x13f96c)[_0xfb7e('0x9')](function(_0x244662){logger['info'](_0xfb7e('0xa'),_0x204ae6,_0xfb7e('0xb'));logger[_0xfb7e('0xc')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x204ae6,_0xfb7e('0xb'),JSON[_0xfb7e('0xd')](_0x244662));if(_0x244662[_0xfb7e('0xe')]){if(_0x244662[_0xfb7e('0xe')][_0xfb7e('0xf')]===0x1f4){logger['error'](_0xfb7e('0xa'),_0x204ae6,_0x244662[_0xfb7e('0xe')][_0xfb7e('0x10')]);return _0x4cbc51(_0x244662[_0xfb7e('0xe')][_0xfb7e('0x10')]);}logger[_0xfb7e('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x204ae6,_0x244662[_0xfb7e('0xe')][_0xfb7e('0x10')]);return _0x1daae8(_0x244662['error'][_0xfb7e('0x10')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x204ae6,_0xfb7e('0xb'));_0x1daae8(_0x244662[_0xfb7e('0x11')][_0xfb7e('0x10')]);}})[_0xfb7e('0x12')](function(_0x23a841){logger[_0xfb7e('0xe')](_0xfb7e('0xa'),_0x204ae6,_0x23a841);_0x4cbc51(_0x23a841);});});}
\ No newline at end of file
index c1c9318..649f42e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x38ae50,_0x2f2c0b){var _0x2267e0=function(_0x47eb0e){while(--_0x47eb0e){_0x38ae50['push'](_0x38ae50['shift']());}};_0x2267e0(++_0x2f2c0b);}(_0xa630,0xbe));var _0x0a63=function(_0x566ed7,_0x1e279f){_0x566ed7=_0x566ed7-0x0;var _0x5333e9=_0xa630[_0x566ed7];return _0x5333e9;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router;
\ No newline at end of file
+var _0x98a8=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','show','isAuthenticated','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x389832,_0x10a4a9){var _0x59429e=function(_0x5f3562){while(--_0x5f3562){_0x389832['push'](_0x389832['shift']());}};_0x59429e(++_0x10a4a9);}(_0x98a8,0x12c));var _0x898a=function(_0x11d6d8,_0x14de42){_0x11d6d8=_0x11d6d8-0x0;var _0x599188=_0x98a8[_0x11d6d8];return _0x599188;};'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 fs_extra=require(_0x898a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x898a('0x7'));var config=require(_0x898a('0x8'));var controller=require(_0x898a('0x9'));router[_0x898a('0xa')](_0x898a('0xb'),auth['isAuthenticated'](),controller[_0x898a('0xc')]);router['post']('/',auth[_0x898a('0xd')](),controller['create']);router[_0x898a('0xe')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xb'),auth[_0x898a('0xd')](),controller[_0x898a('0x11')]);module[_0x898a('0x12')]=router;
\ No newline at end of file
index 506e94e..fcb8b64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fac=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x1906f8,_0x5a695f){var _0x2f7f6d=function(_0x2071b1){while(--_0x2071b1){_0x1906f8['push'](_0x1906f8['shift']());}};_0x2f7f6d(++_0x5a695f);}(_0x5fac,0xec));var _0xc5fa=function(_0x18941b,_0x5c72bd){_0x18941b=_0x18941b-0x0;var _0x1585fc=_0x5fac[_0x18941b];return _0x1585fc;};'use strict';var Sequelize=require(_0xc5fa('0x0'));module[_0xc5fa('0x1')]={'name':{'type':Sequelize[_0xc5fa('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc5fa('0x2')]},'timeout':{'type':Sequelize[_0xc5fa('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc5fa('0x4'),_0xc5fa('0x5'),_0xc5fa('0x6'))}};
\ No newline at end of file
+var _0xd1c5=['rrmemory','beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x467c05,_0x2cbb49){var _0x192eee=function(_0x258750){while(--_0x258750){_0x467c05['push'](_0x467c05['shift']());}};_0x192eee(++_0x2cbb49);}(_0xd1c5,0x96));var _0x5d1c=function(_0x30d9ac,_0x462f03){_0x30d9ac=_0x30d9ac-0x0;var _0x2f1283=_0xd1c5[_0x30d9ac];return _0x2f1283;};'use strict';var Sequelize=require('sequelize');module[_0x5d1c('0x0')]={'name':{'type':Sequelize[_0x5d1c('0x1')],'unique':_0x5d1c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x5d1c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5d1c('0x4'),_0x5d1c('0x5'),_0x5d1c('0x6'))}};
\ No newline at end of file
index 256e29d..983968f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d87=['TeamId','all','union','compact','value','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','ChatQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','stack','name','index','ChatQueue','type','key','model','map','query','filters','intersection','fields','attributes','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserChatQueue','hasOwnProperty','pick','User','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','Team','options','getTeams','addTeams','ids','Agents','online','voicePause','flatMap','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every'];(function(_0x26fc81,_0x57fc19){var _0x9feece=function(_0x4344c3){while(--_0x4344c3){_0x26fc81['push'](_0x26fc81['shift']());}};_0x9feece(++_0x57fc19);}(_0x2d87,0x1b6));var _0x72d8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2d87[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x72d8('0x0'));var zipdir=require(_0x72d8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x72d8('0x2'));var BPromise=require(_0x72d8('0x3'));var Mustache=require(_0x72d8('0x4'));var util=require('util');var path=require(_0x72d8('0x5'));var sox=require('sox');var csv=require(_0x72d8('0x6'));var ejs=require(_0x72d8('0x7'));var fs=require('fs');var fs_extra=require(_0x72d8('0x8'));var _=require('lodash');var squel=require(_0x72d8('0x9'));var crypto=require(_0x72d8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x72d8('0xb'));var toCsv=require(_0x72d8('0x6'));var querystring=require(_0x72d8('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x72d8('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x72d8('0xe'));var hardwareService=require(_0x72d8('0xf'));var logger=require('../../config/logger')(_0x72d8('0x10'));var utils=require(_0x72d8('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x72d8('0x12'))['db'];config[_0x72d8('0x13')]=_['defaults'](config[_0x72d8('0x13')],{'host':_0x72d8('0x14'),'port':0x18eb});var socket=require(_0x72d8('0x15'))(new Redis(config[_0x72d8('0x13')]));require('./chatQueue.socket')[_0x72d8('0x16')](socket);var jayson=require(_0x72d8('0x17'));var client=jayson[_0x72d8('0x18')][_0x72d8('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x529fe7,_0x5445b0,_0x37f300,_0x3ef487){return new BPromise(function(_0x1202f2,_0x386c5b){var _0x3954c1=_0x3ef487||client;return _0x3954c1['request'](_0x529fe7,_0x37f300)[_0x72d8('0x1a')](function(_0x2d3ce5){logger['info'](_0x72d8('0x1b'),_0x5445b0,'request\x20sent');logger[_0x72d8('0x1c')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5445b0,_0x72d8('0x1d'),JSON[_0x72d8('0x1e')](_0x2d3ce5));if(_0x2d3ce5[_0x72d8('0x1f')]){if(_0x2d3ce5['error'][_0x72d8('0x20')]===0x1f4){logger[_0x72d8('0x1f')](_0x72d8('0x1b'),_0x5445b0,_0x2d3ce5[_0x72d8('0x1f')]['message']);return _0x386c5b(_0x2d3ce5[_0x72d8('0x1f')][_0x72d8('0x21')]);}logger[_0x72d8('0x1f')](_0x72d8('0x1b'),_0x5445b0,_0x2d3ce5[_0x72d8('0x1f')][_0x72d8('0x21')]);return _0x1202f2(_0x2d3ce5[_0x72d8('0x1f')][_0x72d8('0x21')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5445b0,_0x72d8('0x1d'));_0x1202f2(_0x2d3ce5[_0x72d8('0x22')]['message']);}})['catch'](function(_0x5ed822){logger[_0x72d8('0x1f')](_0x72d8('0x1b'),_0x5445b0,_0x5ed822);_0x386c5b(_0x5ed822);});});}function respondWithStatusCode(_0x315b25,_0x5cdf94){_0x5cdf94=_0x5cdf94||0xcc;return function(_0x21c773){if(_0x21c773){return _0x315b25[_0x72d8('0x23')](_0x5cdf94);}return _0x315b25['status'](_0x5cdf94)[_0x72d8('0x24')]();};}function respondWithResult(_0x326b7c,_0x4debc0){_0x4debc0=_0x4debc0||0xc8;return function(_0x596f6c){if(_0x596f6c){return _0x326b7c['status'](_0x4debc0)[_0x72d8('0x25')](_0x596f6c);}};}function respondWithFilteredResult(_0x63f54c,_0x3e58bf){return function(_0x3c4e80){if(_0x3c4e80){var _0x3415dd=typeof _0x3e58bf[_0x72d8('0x26')]===_0x72d8('0x27')&&typeof _0x3e58bf['limit']===_0x72d8('0x27');var _0xbcf72f=_0x3c4e80['count'];var _0x1818b9=_0x3415dd?0x0:_0x3e58bf[_0x72d8('0x26')];var _0x2328f4=_0x3415dd?_0x3c4e80[_0x72d8('0x28')]:_0x3e58bf['offset']+_0x3e58bf[_0x72d8('0x29')];var _0xca6358;if(_0x2328f4>=_0xbcf72f){_0x2328f4=_0xbcf72f;_0xca6358=0xc8;}else{_0xca6358=0xce;}_0x63f54c[_0x72d8('0x2a')](_0xca6358);return _0x63f54c[_0x72d8('0x2b')](_0x72d8('0x2c'),_0x1818b9+'-'+_0x2328f4+'/'+_0xbcf72f)['json'](_0x3c4e80);}return null;};}function patchUpdates(_0x3f7745){return function(_0x1de91e){try{jsonpatch[_0x72d8('0x2d')](_0x1de91e,_0x3f7745,!![]);}catch(_0x7f8e02){return BPromise['reject'](_0x7f8e02);}return _0x1de91e[_0x72d8('0x2e')]();};}function saveUpdates(_0x5e018c,_0x69ac29){return function(_0x3bfecc){if(_0x3bfecc){return _0x3bfecc[_0x72d8('0x2f')](_0x5e018c)[_0x72d8('0x1a')](function(_0x121a5c){return _0x121a5c;});}return null;};}function removeEntity(_0x68d79d,_0x1a3e93){return function(_0x495b58){if(_0x495b58){return _0x495b58[_0x72d8('0x30')]()[_0x72d8('0x1a')](function(){var _0x3a04c4=_0x495b58[_0x72d8('0x31')]({'plain':!![]});var _0x56e377='ChatQueues';return db[_0x72d8('0x32')][_0x72d8('0x30')]({'where':{'type':_0x56e377,'resourceId':_0x3a04c4['id']}})[_0x72d8('0x1a')](function(){return _0x495b58;});})[_0x72d8('0x1a')](function(){_0x68d79d[_0x72d8('0x2a')](0xcc)[_0x72d8('0x24')]();});}};}function handleEntityNotFound(_0x405fd6,_0x57819e){return function(_0x319327){if(!_0x319327){_0x405fd6[_0x72d8('0x23')](0x194);}return _0x319327;};}function handleError(_0x22cdf3,_0x21182e){_0x21182e=_0x21182e||0x1f4;return function(_0x3e53c9){logger[_0x72d8('0x1f')](_0x3e53c9[_0x72d8('0x33')]);if(_0x3e53c9[_0x72d8('0x34')]){delete _0x3e53c9[_0x72d8('0x34')];}_0x22cdf3[_0x72d8('0x2a')](_0x21182e)['send'](_0x3e53c9);};}exports[_0x72d8('0x35')]=function(_0x4722c2,_0x5f0ddc){var _0x3f695a={},_0x1f9471={},_0xc3e989={'count':0x0,'rows':[]};var _0x3cdd2f=_['map'](db[_0x72d8('0x36')]['rawAttributes'],function(_0xf39469){return{'name':_0xf39469['fieldName'],'type':_0xf39469[_0x72d8('0x37')][_0x72d8('0x38')]};});_0x1f9471[_0x72d8('0x39')]=_[_0x72d8('0x3a')](_0x3cdd2f,_0x72d8('0x34'));_0x1f9471[_0x72d8('0x3b')]=_['keys'](_0x4722c2[_0x72d8('0x3b')]);_0x1f9471[_0x72d8('0x3c')]=_[_0x72d8('0x3d')](_0x1f9471[_0x72d8('0x39')],_0x1f9471[_0x72d8('0x3b')]);_0x3f695a['attributes']=_[_0x72d8('0x3d')](_0x1f9471[_0x72d8('0x39')],qs[_0x72d8('0x3e')](_0x4722c2[_0x72d8('0x3b')][_0x72d8('0x3e')]));_0x3f695a[_0x72d8('0x3f')]=_0x3f695a['attributes']['length']?_0x3f695a['attributes']:_0x1f9471['model'];if(!_0x4722c2['query']['hasOwnProperty'](_0x72d8('0x40'))){_0x3f695a['limit']=qs['limit'](_0x4722c2['query'][_0x72d8('0x29')]);_0x3f695a[_0x72d8('0x26')]=qs[_0x72d8('0x26')](_0x4722c2['query'][_0x72d8('0x26')]);}_0x3f695a[_0x72d8('0x41')]=qs[_0x72d8('0x42')](_0x4722c2['query'][_0x72d8('0x42')]);_0x3f695a[_0x72d8('0x43')]=qs[_0x72d8('0x3c')](_['pick'](_0x4722c2[_0x72d8('0x3b')],_0x1f9471[_0x72d8('0x3c')]),_0x3cdd2f);if(_0x4722c2[_0x72d8('0x3b')][_0x72d8('0x44')]){_0x3f695a[_0x72d8('0x43')]=_[_0x72d8('0x45')](_0x3f695a[_0x72d8('0x43')],{'$or':_['map'](_0x3cdd2f,function(_0xc45de2){if(_0xc45de2['type']!=='VIRTUAL'){var _0xd05cf3={};_0xd05cf3[_0xc45de2[_0x72d8('0x34')]]={'$like':'%'+_0x4722c2[_0x72d8('0x3b')][_0x72d8('0x44')]+'%'};return _0xd05cf3;}})});}_0x3f695a=_['merge']({},_0x3f695a,_0x4722c2['options']);var _0x4c52b3={'where':_0x3f695a[_0x72d8('0x43')]};return db['ChatQueue'][_0x72d8('0x28')](_0x4c52b3)[_0x72d8('0x1a')](function(_0x46bb65){_0xc3e989[_0x72d8('0x28')]=_0x46bb65;if(_0x4722c2['query'][_0x72d8('0x46')]){_0x3f695a[_0x72d8('0x47')]=[{'all':!![]}];}return db['ChatQueue'][_0x72d8('0x48')](_0x3f695a);})[_0x72d8('0x1a')](function(_0x2cf3eb){_0xc3e989[_0x72d8('0x49')]=_0x2cf3eb;return _0xc3e989;})[_0x72d8('0x1a')](respondWithFilteredResult(_0x5f0ddc,_0x3f695a))[_0x72d8('0x4a')](handleError(_0x5f0ddc,null));};exports['show']=function(_0x5302ce,_0x34231c){var _0x23eb39={'raw':!![],'where':{'id':_0x5302ce[_0x72d8('0x4b')]['id']}},_0x2fc00d={};_0x2fc00d[_0x72d8('0x39')]=_[_0x72d8('0x4c')](db[_0x72d8('0x36')][_0x72d8('0x4d')]);_0x2fc00d['query']=_[_0x72d8('0x4c')](_0x5302ce[_0x72d8('0x3b')]);_0x2fc00d['filters']=_[_0x72d8('0x3d')](_0x2fc00d[_0x72d8('0x39')],_0x2fc00d[_0x72d8('0x3b')]);_0x23eb39['attributes']=_[_0x72d8('0x3d')](_0x2fc00d[_0x72d8('0x39')],qs[_0x72d8('0x3e')](_0x5302ce[_0x72d8('0x3b')][_0x72d8('0x3e')]));_0x23eb39[_0x72d8('0x3f')]=_0x23eb39[_0x72d8('0x3f')][_0x72d8('0x4e')]?_0x23eb39[_0x72d8('0x3f')]:_0x2fc00d[_0x72d8('0x39')];if(_0x5302ce[_0x72d8('0x3b')][_0x72d8('0x46')]){_0x23eb39[_0x72d8('0x47')]=[{'all':!![]}];}_0x23eb39=_[_0x72d8('0x45')]({},_0x23eb39,_0x5302ce['options']);return db[_0x72d8('0x36')][_0x72d8('0x4f')](_0x23eb39)[_0x72d8('0x1a')](handleEntityNotFound(_0x34231c,null))['then'](respondWithResult(_0x34231c,null))[_0x72d8('0x4a')](handleError(_0x34231c,null));};exports[_0x72d8('0x50')]=function(_0x4b3d76,_0x1149bc){return db[_0x72d8('0x36')]['create'](_0x4b3d76[_0x72d8('0x51')],{})[_0x72d8('0x1a')](function(_0x5d86cf){var _0x53b2a9=_0x4b3d76['user']['get']({'plain':!![]});if(!_0x53b2a9)throw new Error(_0x72d8('0x52'));if(_0x53b2a9['role']===_0x72d8('0x53')){var _0x40b14c=_0x5d86cf[_0x72d8('0x31')]({'plain':!![]});var _0x303587=_0x72d8('0x54');return db[_0x72d8('0x55')]['find']({'where':{'name':_0x303587,'userProfileId':_0x53b2a9[_0x72d8('0x56')]},'raw':!![]})[_0x72d8('0x1a')](function(_0x53bbe9){if(_0x53bbe9&&_0x53bbe9[_0x72d8('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x40b14c[_0x72d8('0x34')],'resourceId':_0x40b14c['id'],'type':_0x53bbe9[_0x72d8('0x34')],'sectionId':_0x53bbe9['id']},{})[_0x72d8('0x1a')](function(){return _0x5d86cf;});}else{return _0x5d86cf;}})[_0x72d8('0x4a')](function(_0x37ce8a){logger[_0x72d8('0x1f')](_0x72d8('0x58'),_0x37ce8a);throw _0x37ce8a;});}return _0x5d86cf;})[_0x72d8('0x1a')](respondWithResult(_0x1149bc,0xc9))[_0x72d8('0x4a')](handleError(_0x1149bc,null));};exports[_0x72d8('0x2f')]=function(_0xfab644,_0x4e3798){if(_0xfab644[_0x72d8('0x51')]['id']){delete _0xfab644[_0x72d8('0x51')]['id'];}return db[_0x72d8('0x36')][_0x72d8('0x4f')]({'where':{'id':_0xfab644['params']['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x4e3798,null))[_0x72d8('0x1a')](saveUpdates(_0xfab644[_0x72d8('0x51')],null))[_0x72d8('0x1a')](respondWithResult(_0x4e3798,null))[_0x72d8('0x4a')](handleError(_0x4e3798,null));};exports['destroy']=function(_0x38211d,_0x2402c9){return db[_0x72d8('0x36')][_0x72d8('0x4f')]({'where':{'id':_0x38211d[_0x72d8('0x4b')]['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x2402c9,null))[_0x72d8('0x1a')](removeEntity(_0x2402c9,null))[_0x72d8('0x4a')](handleError(_0x2402c9,null));};exports[_0x72d8('0x59')]=function(_0xe8dd8,_0x3f9b51){return db[_0x72d8('0x36')][_0x72d8('0x59')]()['then'](respondWithResult(_0x3f9b51,null))[_0x72d8('0x4a')](handleError(_0x3f9b51,null));};exports['getMembers']=function(_0x44ae74,_0x4c3b0f,_0x5047b1){var _0x370a3d={'raw':!![],'where':{}},_0x5db58e={},_0x45b3aa;return db[_0x72d8('0x36')][_0x72d8('0x5a')]({'where':{'id':_0x44ae74['params']['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x4c3b0f,null))[_0x72d8('0x1a')](function(_0x2a2bb7){if(_0x2a2bb7){_0x45b3aa=_0x2a2bb7['get']({'plain':!![]});_0x5db58e[_0x72d8('0x39')]=_[_0x72d8('0x4c')](db[_0x72d8('0x5b')][_0x72d8('0x4d')]);_0x5db58e[_0x72d8('0x3b')]=_[_0x72d8('0x4c')](_0x44ae74['query']);_0x5db58e[_0x72d8('0x3c')]=_['intersection'](_0x5db58e[_0x72d8('0x39')],_0x5db58e['query']);_0x370a3d[_0x72d8('0x3f')]=_[_0x72d8('0x3d')](_0x5db58e[_0x72d8('0x39')],qs[_0x72d8('0x3e')](_0x44ae74['query'][_0x72d8('0x3e')]));_0x370a3d[_0x72d8('0x3f')]=_0x370a3d['attributes'][_0x72d8('0x4e')]?_0x370a3d['attributes']:_0x5db58e['model'];if(!_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x5c')](_0x72d8('0x40'))){_0x370a3d['limit']=qs[_0x72d8('0x29')](_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x29')]);_0x370a3d[_0x72d8('0x26')]=qs[_0x72d8('0x26')](_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x26')]);}_0x370a3d[_0x72d8('0x41')]=qs[_0x72d8('0x42')](_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x42')]);_0x370a3d[_0x72d8('0x43')]=qs[_0x72d8('0x3c')](_[_0x72d8('0x5d')](_0x44ae74['query'],_0x5db58e[_0x72d8('0x3c')]));_0x370a3d[_0x72d8('0x43')]['ChatQueueId']=_0x2a2bb7['id'];if(_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x44')]){_0x370a3d[_0x72d8('0x43')]=_['merge'](_0x370a3d[_0x72d8('0x43')],{'$or':_[_0x72d8('0x3a')](_0x370a3d['attributes'],function(_0x479133){var _0x54da9d={};_0x54da9d[_0x479133]={'$like':'%'+_0x44ae74[_0x72d8('0x3b')][_0x72d8('0x44')]+'%'};return _0x54da9d;})});}_0x370a3d=_['merge']({},_0x370a3d,_0x44ae74['options']);return db[_0x72d8('0x5b')]['findAll'](_0x370a3d);}})[_0x72d8('0x1a')](function(_0x3cd9e0){if(_0x3cd9e0){return db[_0x72d8('0x5e')]['findAndCountAll']({'where':{'id':_[_0x72d8('0x3a')](_0x3cd9e0,'UserId'),'role':_0x72d8('0x5f')},'attributes':['id',_0x72d8('0x34'),_0x72d8('0x60'),_0x72d8('0x61'),_0x72d8('0x62')]});}})['then'](function(_0x2e3b4e){if(_0x2e3b4e){return{'count':_0x2e3b4e[_0x72d8('0x28')],'rows':_[_0x72d8('0x3a')](_0x2e3b4e['rows'],function(_0x4d6468){return{'membername':_0x4d6468['name'],'UserId':_0x4d6468['id'],'queue_name':_0x45b3aa[_0x72d8('0x34')],'ChatQueueId':_0x45b3aa['id'],'interface':util[_0x72d8('0x63')](_0x72d8('0x64'),_0x72d8('0x65'),_0x4d6468['name']),'penalty':0x0,'paused':_0x4d6468['chatPause'],'createdAt':_0x4d6468[_0x72d8('0x62')],'updatedAt':_0x4d6468[_0x72d8('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x72d8('0x1a')](respondWithFilteredResult(_0x4c3b0f,_0x370a3d))[_0x72d8('0x4a')](handleError(_0x4c3b0f,null));};exports['getTeams']=function(_0x4a3a93,_0x3091a9,_0x97eaa){var _0x1c4b51={};var _0x4a455f={};var _0x319497;var _0x507ad6;return db[_0x72d8('0x36')]['findOne']({'where':{'id':_0x4a3a93[_0x72d8('0x4b')]['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x3091a9,null))[_0x72d8('0x1a')](function(_0x465faa){if(_0x465faa){_0x319497=_0x465faa;_0x4a455f[_0x72d8('0x39')]=_['keys'](db[_0x72d8('0x66')][_0x72d8('0x4d')]);_0x4a455f[_0x72d8('0x3b')]=_['keys'](_0x4a3a93['query']);_0x4a455f[_0x72d8('0x3c')]=_[_0x72d8('0x3d')](_0x4a455f[_0x72d8('0x39')],_0x4a455f[_0x72d8('0x3b')]);_0x1c4b51['attributes']=_[_0x72d8('0x3d')](_0x4a455f[_0x72d8('0x39')],qs[_0x72d8('0x3e')](_0x4a3a93[_0x72d8('0x3b')][_0x72d8('0x3e')]));_0x1c4b51['attributes']=_0x1c4b51['attributes'][_0x72d8('0x4e')]?_0x1c4b51[_0x72d8('0x3f')]:_0x4a455f[_0x72d8('0x39')];_0x1c4b51[_0x72d8('0x41')]=qs[_0x72d8('0x42')](_0x4a3a93[_0x72d8('0x3b')][_0x72d8('0x42')]);_0x1c4b51['where']=qs['filters'](_[_0x72d8('0x5d')](_0x4a3a93[_0x72d8('0x3b')],_0x4a455f[_0x72d8('0x3c')]));if(_0x4a3a93['query'][_0x72d8('0x44')]){_0x1c4b51[_0x72d8('0x43')]=_[_0x72d8('0x45')](_0x1c4b51['where'],{'$or':_[_0x72d8('0x3a')](_0x1c4b51['attributes'],function(_0x181f67){var _0x21da6b={};_0x21da6b[_0x181f67]={'$like':'%'+_0x4a3a93['query'][_0x72d8('0x44')]+'%'};return _0x21da6b;})});}_0x1c4b51=_[_0x72d8('0x45')]({},_0x1c4b51,_0x4a3a93[_0x72d8('0x67')]);return _0x319497['getTeams'](_0x1c4b51);}})['then'](function(_0xbc468e){if(_0xbc468e){_0x507ad6=_0xbc468e[_0x72d8('0x4e')];if(!_0x4a3a93[_0x72d8('0x3b')][_0x72d8('0x5c')](_0x72d8('0x40'))){_0x1c4b51[_0x72d8('0x29')]=qs['limit'](_0x4a3a93[_0x72d8('0x3b')][_0x72d8('0x29')]);_0x1c4b51[_0x72d8('0x26')]=qs['offset'](_0x4a3a93['query'][_0x72d8('0x26')]);}return _0x319497[_0x72d8('0x68')](_0x1c4b51);}})[_0x72d8('0x1a')](function(_0x469856){if(_0x469856){return _0x469856?{'count':_0x507ad6,'rows':_0x469856}:null;}})[_0x72d8('0x1a')](respondWithResult(_0x3091a9,null))[_0x72d8('0x4a')](handleError(_0x3091a9,null));};exports[_0x72d8('0x69')]=function(_0x2eed4c,_0x525ca3,_0xfc9920){var _0x466b26=_0x2eed4c['body'][_0x72d8('0x6a')];return db[_0x72d8('0x66')][_0x72d8('0x48')]({'where':{'id':_0x466b26},'attributes':['id'],'include':[{'model':db[_0x72d8('0x5e')],'as':_0x72d8('0x6b'),'attributes':['id',_0x72d8('0x34'),_0x72d8('0x6c'),_0x72d8('0x6d'),'interface'],'raw':!![]}]})[_0x72d8('0x1a')](function(_0x2e5801){if(_0x2e5801){var _0x1e6664=_[_0x72d8('0x6e')](_0x2e5801,function(_0x434191){var _0xf7a0d0=_0x434191[_0x72d8('0x31')]({'plain':!![]});return _0xf7a0d0['Agents'];});return db[_0x72d8('0x36')]['find']({'where':{'id':_0x2eed4c[_0x72d8('0x4b')]['id']}})[_0x72d8('0x1a')](function(_0x3efc29){return db['sequelize'][_0x72d8('0x6f')](function(_0x59eefb){return _0x3efc29[_0x72d8('0x69')](_0x466b26,{'transaction':_0x59eefb})[_0x72d8('0x1a')](function(){return BPromise[_0x72d8('0x70')](_0x1e6664,function(_0x596b87){return db['UserChatQueue'][_0x72d8('0x71')]({'where':{'UserId':_0x596b87['id'],'ChatQueueId':_0x2eed4c['params']['id']},'transaction':_0x59eefb});});})[_0x72d8('0x1a')](function(){_0x1e6664[_0x72d8('0x72')](function(_0x24dde7){socket[_0x72d8('0x73')](_0x72d8('0x74'),{'UserId':_0x24dde7['id'],'ChatQueueId':_0x3efc29['id']});});});});});}})['then'](respondWithStatusCode(_0x525ca3,null))[_0x72d8('0x4a')](handleError(_0x525ca3,null));};exports['removeTeams']=function(_0x889dfc,_0xdc10cd,_0x3b5d08){return db['Team'][_0x72d8('0x48')]({'where':{'id':_0x889dfc[_0x72d8('0x3b')][_0x72d8('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x72d8('0x5e')],'as':_0x72d8('0x6b'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0xdc10cd,null))[_0x72d8('0x1a')](function(_0x14739d){var _0x3caf60=_[_0x72d8('0x3a')](_0x14739d,'id');var _0x571075=[];var _0x4c0cb8=[];var _0x2e9fd9=squel[_0x72d8('0x75')]();_0x2e9fd9[_0x72d8('0x76')]('tq.TeamId')['from'](_0x72d8('0x77'),'tq')[_0x72d8('0x78')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x72d8('0x43')](_0x72d8('0x79'),_0x889dfc[_0x72d8('0x4b')]['id']);for(var _0x89a813=0x0;_0x89a813<_0x14739d[_0x72d8('0x4e')];_0x89a813+=0x1){let _0x58b7a4=_0x14739d[_0x89a813];for(var _0x53eb79=0x0;_0x53eb79<_0x58b7a4[_0x72d8('0x6b')][_0x72d8('0x4e')];_0x53eb79+=0x1){let _0x4593fb=_0x58b7a4['Agents'][_0x53eb79];var _0x5d4912=_0x2e9fd9[_0x72d8('0x7a')]();_0x5d4912[_0x72d8('0x43')](_0x72d8('0x7b'),_0x4593fb['id']);_0x4c0cb8[_0x72d8('0x7c')](db[_0x72d8('0x7d')][_0x72d8('0x3b')](_0x5d4912[_0x72d8('0x7e')](),{'type':db[_0x72d8('0x7d')][_0x72d8('0x7f')][_0x72d8('0x80')]})['then'](function(_0x48bddd){if(_0x48bddd['length']===0x1){return _0x4593fb['id'];}else{var _0x59b9b8=_[_0x72d8('0x81')](_['map'](_0x48bddd,_0x72d8('0x82')),function(_0x5a3c37){return _['includes'](_0x3caf60,_0x5a3c37);});if(_0x59b9b8){return _0x4593fb['id'];}}}));}}return BPromise[_0x72d8('0x83')](_0x4c0cb8)['then'](function(_0x399eed){_0x571075=_(_0x571075)[_0x72d8('0x84')](_0x399eed)[_0x72d8('0x85')]()[_0x72d8('0x86')]();return db[_0x72d8('0x36')]['find']({'where':{'id':_0x889dfc[_0x72d8('0x4b')]['id']}})[_0x72d8('0x1a')](function(_0x34c5bf){return db[_0x72d8('0x7d')][_0x72d8('0x6f')](function(_0x43b7dc){return _0x34c5bf['removeTeams'](_0x889dfc['query'][_0x72d8('0x6a')],{'transaction':_0x43b7dc})[_0x72d8('0x1a')](function(){if(!_['isEmpty'](_0x571075)){return _0x34c5bf[_0x72d8('0x87')](_0x571075,{'transaction':_0x43b7dc});}})['then'](function(){_0x571075[_0x72d8('0x72')](function(_0xce5739){socket['emit']('userChatQueue:remove',{'UserId':_0xce5739,'ChatQueueId':_0x34c5bf['id']});});});});});});})[_0x72d8('0x1a')](respondWithStatusCode(_0xdc10cd,null))['catch'](handleError(_0xdc10cd,null));};exports[_0x72d8('0x88')]=function(_0x1927fc,_0x2af689,_0x3fb8a3){return db[_0x72d8('0x36')]['find']({'where':{'id':_0x1927fc[_0x72d8('0x4b')]['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x2af689,null))[_0x72d8('0x1a')](function(_0x2a62a7){if(_0x2a62a7){return _0x2a62a7[_0x72d8('0x88')](_0x1927fc[_0x72d8('0x51')]['ids'],_[_0x72d8('0x89')](_0x1927fc[_0x72d8('0x51')],['ids','id'])||{})[_0x72d8('0x8a')](function(_0x2f2458){for(var _0x4e270b=0x0;_0x4e270b<_0x1927fc[_0x72d8('0x51')]['ids']['length'];_0x4e270b+=0x1){socket[_0x72d8('0x73')](_0x72d8('0x74'),{'UserId':Number(_0x1927fc[_0x72d8('0x51')][_0x72d8('0x6a')][_0x4e270b]),'ChatQueueId':Number(_0x1927fc[_0x72d8('0x4b')]['id'])});}return _0x2f2458;});}})[_0x72d8('0x1a')](respondWithResult(_0x2af689,null))['catch'](handleError(_0x2af689,null));};exports['removeAgents']=function(_0x3e6ed0,_0x2a25a5,_0x2d29cc){return db[_0x72d8('0x36')][_0x72d8('0x4f')]({'where':{'id':_0x3e6ed0['params']['id']}})['then'](handleEntityNotFound(_0x2a25a5,null))[_0x72d8('0x1a')](function(_0x45263f){if(_0x45263f){return _0x45263f[_0x72d8('0x87')](_0x3e6ed0[_0x72d8('0x3b')][_0x72d8('0x6a')])['then'](function(){if(_[_0x72d8('0x8b')](_0x3e6ed0[_0x72d8('0x3b')][_0x72d8('0x6a')])){for(var _0xf084c8=0x0;_0xf084c8<_0x3e6ed0[_0x72d8('0x3b')][_0x72d8('0x6a')][_0x72d8('0x4e')];_0xf084c8+=0x1){socket[_0x72d8('0x73')](_0x72d8('0x8c'),{'UserId':Number(_0x3e6ed0[_0x72d8('0x3b')]['ids'][_0xf084c8]),'ChatQueueId':Number(_0x3e6ed0['params']['id'])});}}else{socket['emit'](_0x72d8('0x8c'),{'UserId':Number(_0x3e6ed0[_0x72d8('0x3b')]['ids']),'ChatQueueId':Number(_0x3e6ed0[_0x72d8('0x4b')]['id'])});}});}})[_0x72d8('0x1a')](respondWithStatusCode(_0x2a25a5,null))[_0x72d8('0x4a')](handleError(_0x2a25a5,null));};exports[_0x72d8('0x8d')]=function(_0x2d03ac,_0x238d25,_0x46da04){var _0x499637={};var _0x134f20={};var _0x4c182b;var _0xec1abb;return db[_0x72d8('0x36')][_0x72d8('0x5a')]({'where':{'id':_0x2d03ac['params']['id']}})[_0x72d8('0x1a')](handleEntityNotFound(_0x238d25,null))['then'](function(_0x46b47c){if(_0x46b47c){_0x4c182b=_0x46b47c;_0x134f20[_0x72d8('0x39')]=_[_0x72d8('0x4c')](db[_0x72d8('0x5e')][_0x72d8('0x4d')]);_0x134f20[_0x72d8('0x3b')]=_[_0x72d8('0x4c')](_0x2d03ac['query']);_0x134f20['filters']=_[_0x72d8('0x3d')](_0x134f20[_0x72d8('0x39')],_0x134f20[_0x72d8('0x3b')]);_0x499637[_0x72d8('0x3f')]=_['intersection'](_0x134f20[_0x72d8('0x39')],qs[_0x72d8('0x3e')](_0x2d03ac['query'][_0x72d8('0x3e')]));_0x499637[_0x72d8('0x3f')]=_0x499637[_0x72d8('0x3f')][_0x72d8('0x4e')]?_0x499637[_0x72d8('0x3f')]:_0x134f20[_0x72d8('0x39')];_0x499637[_0x72d8('0x41')]=qs[_0x72d8('0x42')](_0x2d03ac[_0x72d8('0x3b')]['sort']);_0x499637[_0x72d8('0x43')]=qs[_0x72d8('0x3c')](_[_0x72d8('0x5d')](_0x2d03ac[_0x72d8('0x3b')],_0x134f20[_0x72d8('0x3c')]));if(_0x2d03ac[_0x72d8('0x3b')]['filter']){_0x499637[_0x72d8('0x43')]=_[_0x72d8('0x45')](_0x499637['where'],{'$or':_[_0x72d8('0x3a')](_0x499637[_0x72d8('0x3f')],function(_0x17dfe4){var _0x694d8={};_0x694d8[_0x17dfe4]={'$like':'%'+_0x2d03ac[_0x72d8('0x3b')]['filter']+'%'};return _0x694d8;})});}_0x499637=_['merge']({},_0x499637,_0x2d03ac['options']);return _0x4c182b[_0x72d8('0x8d')](_0x499637);}})[_0x72d8('0x1a')](function(_0x4c745c){if(_0x4c745c){_0xec1abb=_0x4c745c['length'];if(!_0x2d03ac['query'][_0x72d8('0x5c')](_0x72d8('0x40'))){_0x499637['limit']=qs[_0x72d8('0x29')](_0x2d03ac[_0x72d8('0x3b')][_0x72d8('0x29')]);_0x499637[_0x72d8('0x26')]=qs[_0x72d8('0x26')](_0x2d03ac[_0x72d8('0x3b')][_0x72d8('0x26')]);}return _0x4c182b['getAgents'](_0x499637);}})[_0x72d8('0x1a')](function(_0x451b94){if(_0x451b94){return _0x451b94?{'count':_0xec1abb,'rows':_0x451b94}:null;}})[_0x72d8('0x1a')](respondWithResult(_0x238d25,null))[_0x72d8('0x4a')](handleError(_0x238d25,null));};
\ No newline at end of file
+var _0x8d5e=['get','ChatQueues','UserProfileResource','name','send','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','ChatQueue','rows','catch','show','params','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','describe','getMembers','findOne','UserChatQueue','order','findAll','User','findAndCountAll','UserId','agent','chatPause','format','SIP','createdAt','updatedAt','getTeams','addTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','ids','field','tq.TeamId','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','every','TeamId','includes','all','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','request','then','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','sendStatus','status','end','json','undefined','offset','count','Content-Range','apply','update','destroy'];(function(_0x3074f3,_0x4f2c03){var _0x53f112=function(_0x4a17af){while(--_0x4a17af){_0x3074f3['push'](_0x3074f3['shift']());}};_0x53f112(++_0x4f2c03);}(_0x8d5e,0xf0));var _0xe8d5=function(_0x4b2863,_0x494899){_0x4b2863=_0x4b2863-0x0;var _0x567d67=_0x8d5e[_0x4b2863];return _0x567d67;};'use strict';var emlformat=require(_0xe8d5('0x0'));var rimraf=require(_0xe8d5('0x1'));var zipdir=require(_0xe8d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe8d5('0x3'));var moment=require('moment');var BPromise=require(_0xe8d5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe8d5('0x5'));var sox=require(_0xe8d5('0x6'));var csv=require(_0xe8d5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d5('0x8'));var _=require(_0xe8d5('0x9'));var squel=require(_0xe8d5('0xa'));var crypto=require(_0xe8d5('0xb'));var jsforce=require(_0xe8d5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe8d5('0x7'));var querystring=require('querystring');var Papa=require(_0xe8d5('0xd'));var Redis=require('ioredis');var authService=require(_0xe8d5('0xe'));var qs=require(_0xe8d5('0xf'));var as=require(_0xe8d5('0x10'));var hardwareService=require(_0xe8d5('0x11'));var logger=require(_0xe8d5('0x12'))(_0xe8d5('0x13'));var utils=require(_0xe8d5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xe8d5('0x15'));var db=require(_0xe8d5('0x16'))['db'];config[_0xe8d5('0x17')]=_[_0xe8d5('0x18')](config[_0xe8d5('0x17')],{'host':_0xe8d5('0x19'),'port':0x18eb});var socket=require(_0xe8d5('0x1a'))(new Redis(config['redis']));require(_0xe8d5('0x1b'))[_0xe8d5('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xe8d5('0x1d')][_0xe8d5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x465eb3,_0x40d2cc,_0x13cf11,_0x3ad494){return new BPromise(function(_0x228204,_0x46633e){var _0x4baf98=_0x3ad494||client;return _0x4baf98[_0xe8d5('0x1f')](_0x465eb3,_0x13cf11)[_0xe8d5('0x20')](function(_0x529ede){logger['info'](_0xe8d5('0x21'),_0x40d2cc,'request\x20sent');logger[_0xe8d5('0x22')](_0xe8d5('0x23'),_0x40d2cc,_0xe8d5('0x24'),JSON[_0xe8d5('0x25')](_0x529ede));if(_0x529ede[_0xe8d5('0x26')]){if(_0x529ede[_0xe8d5('0x26')][_0xe8d5('0x27')]===0x1f4){logger[_0xe8d5('0x26')](_0xe8d5('0x21'),_0x40d2cc,_0x529ede[_0xe8d5('0x26')]['message']);return _0x46633e(_0x529ede[_0xe8d5('0x26')][_0xe8d5('0x28')]);}logger[_0xe8d5('0x26')](_0xe8d5('0x21'),_0x40d2cc,_0x529ede[_0xe8d5('0x26')]['message']);return _0x228204(_0x529ede[_0xe8d5('0x26')][_0xe8d5('0x28')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x40d2cc,'request\x20sent');_0x228204(_0x529ede['result'][_0xe8d5('0x28')]);}})['catch'](function(_0x279e31){logger[_0xe8d5('0x26')](_0xe8d5('0x21'),_0x40d2cc,_0x279e31);_0x46633e(_0x279e31);});});}function respondWithStatusCode(_0x583cfd,_0x29c1f0){_0x29c1f0=_0x29c1f0||0xcc;return function(_0x4b9bd2){if(_0x4b9bd2){return _0x583cfd[_0xe8d5('0x29')](_0x29c1f0);}return _0x583cfd[_0xe8d5('0x2a')](_0x29c1f0)[_0xe8d5('0x2b')]();};}function respondWithResult(_0x535411,_0x1bf451){_0x1bf451=_0x1bf451||0xc8;return function(_0x14d095){if(_0x14d095){return _0x535411[_0xe8d5('0x2a')](_0x1bf451)[_0xe8d5('0x2c')](_0x14d095);}};}function respondWithFilteredResult(_0x3f5af9,_0x1a9b2d){return function(_0x426009){if(_0x426009){var _0x798fdd=typeof _0x1a9b2d['offset']===_0xe8d5('0x2d')&&typeof _0x1a9b2d['limit']===_0xe8d5('0x2d');var _0x19b7e3=_0x426009['count'];var _0x4a2e31=_0x798fdd?0x0:_0x1a9b2d[_0xe8d5('0x2e')];var _0x181e94=_0x798fdd?_0x426009[_0xe8d5('0x2f')]:_0x1a9b2d[_0xe8d5('0x2e')]+_0x1a9b2d['limit'];var _0x464dd3;if(_0x181e94>=_0x19b7e3){_0x181e94=_0x19b7e3;_0x464dd3=0xc8;}else{_0x464dd3=0xce;}_0x3f5af9[_0xe8d5('0x2a')](_0x464dd3);return _0x3f5af9['set'](_0xe8d5('0x30'),_0x4a2e31+'-'+_0x181e94+'/'+_0x19b7e3)['json'](_0x426009);}return null;};}function patchUpdates(_0x5a7968){return function(_0x4bcdfd){try{jsonpatch[_0xe8d5('0x31')](_0x4bcdfd,_0x5a7968,!![]);}catch(_0x26f6da){return BPromise['reject'](_0x26f6da);}return _0x4bcdfd['save']();};}function saveUpdates(_0x473e52,_0x28f904){return function(_0x4ad8f6){if(_0x4ad8f6){return _0x4ad8f6[_0xe8d5('0x32')](_0x473e52)[_0xe8d5('0x20')](function(_0x31e058){return _0x31e058;});}return null;};}function removeEntity(_0x3f6a5f,_0x564ad4){return function(_0x1775f5){if(_0x1775f5){return _0x1775f5[_0xe8d5('0x33')]()[_0xe8d5('0x20')](function(){var _0x351a5e=_0x1775f5[_0xe8d5('0x34')]({'plain':!![]});var _0x5eb714=_0xe8d5('0x35');return db[_0xe8d5('0x36')]['destroy']({'where':{'type':_0x5eb714,'resourceId':_0x351a5e['id']}})[_0xe8d5('0x20')](function(){return _0x1775f5;});})[_0xe8d5('0x20')](function(){_0x3f6a5f[_0xe8d5('0x2a')](0xcc)[_0xe8d5('0x2b')]();});}};}function handleEntityNotFound(_0x254fff,_0x59f1ae){return function(_0x5c710c){if(!_0x5c710c){_0x254fff[_0xe8d5('0x29')](0x194);}return _0x5c710c;};}function handleError(_0x17f720,_0x527e65){_0x527e65=_0x527e65||0x1f4;return function(_0xa11dec){logger[_0xe8d5('0x26')](_0xa11dec['stack']);if(_0xa11dec[_0xe8d5('0x37')]){delete _0xa11dec[_0xe8d5('0x37')];}_0x17f720['status'](_0x527e65)[_0xe8d5('0x38')](_0xa11dec);};}exports['index']=function(_0x1e8cff,_0x13a02d){var _0x5230bf={},_0x242c2e={},_0x242b4e={'count':0x0,'rows':[]};var _0x41868e=_['map'](db['ChatQueue'][_0xe8d5('0x39')],function(_0x2401c2){return{'name':_0x2401c2['fieldName'],'type':_0x2401c2[_0xe8d5('0x3a')][_0xe8d5('0x3b')]};});_0x242c2e[_0xe8d5('0x3c')]=_[_0xe8d5('0x3d')](_0x41868e,_0xe8d5('0x37'));_0x242c2e[_0xe8d5('0x3e')]=_[_0xe8d5('0x3f')](_0x1e8cff[_0xe8d5('0x3e')]);_0x242c2e[_0xe8d5('0x40')]=_[_0xe8d5('0x41')](_0x242c2e[_0xe8d5('0x3c')],_0x242c2e[_0xe8d5('0x3e')]);_0x5230bf[_0xe8d5('0x42')]=_[_0xe8d5('0x41')](_0x242c2e[_0xe8d5('0x3c')],qs['fields'](_0x1e8cff['query'][_0xe8d5('0x43')]));_0x5230bf['attributes']=_0x5230bf[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x5230bf['attributes']:_0x242c2e['model'];if(!_0x1e8cff[_0xe8d5('0x3e')][_0xe8d5('0x45')](_0xe8d5('0x46'))){_0x5230bf['limit']=qs[_0xe8d5('0x47')](_0x1e8cff[_0xe8d5('0x3e')]['limit']);_0x5230bf[_0xe8d5('0x2e')]=qs[_0xe8d5('0x2e')](_0x1e8cff[_0xe8d5('0x3e')][_0xe8d5('0x2e')]);}_0x5230bf['order']=qs['sort'](_0x1e8cff['query'][_0xe8d5('0x48')]);_0x5230bf[_0xe8d5('0x49')]=qs['filters'](_[_0xe8d5('0x4a')](_0x1e8cff[_0xe8d5('0x3e')],_0x242c2e[_0xe8d5('0x40')]),_0x41868e);if(_0x1e8cff['query'][_0xe8d5('0x4b')]){_0x5230bf[_0xe8d5('0x49')]=_[_0xe8d5('0x4c')](_0x5230bf[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x41868e,function(_0x304883){if(_0x304883[_0xe8d5('0x3a')]!==_0xe8d5('0x4d')){var _0x5aea19={};_0x5aea19[_0x304883[_0xe8d5('0x37')]]={'$like':'%'+_0x1e8cff[_0xe8d5('0x3e')]['filter']+'%'};return _0x5aea19;}})});}_0x5230bf=_[_0xe8d5('0x4c')]({},_0x5230bf,_0x1e8cff[_0xe8d5('0x4e')]);var _0x277c28={'where':_0x5230bf[_0xe8d5('0x49')]};return db[_0xe8d5('0x4f')][_0xe8d5('0x2f')](_0x277c28)[_0xe8d5('0x20')](function(_0x312edc){_0x242b4e[_0xe8d5('0x2f')]=_0x312edc;if(_0x1e8cff[_0xe8d5('0x3e')]['includeAll']){_0x5230bf['include']=[{'all':!![]}];}return db[_0xe8d5('0x4f')]['findAll'](_0x5230bf);})[_0xe8d5('0x20')](function(_0xa9b920){_0x242b4e[_0xe8d5('0x50')]=_0xa9b920;return _0x242b4e;})['then'](respondWithFilteredResult(_0x13a02d,_0x5230bf))[_0xe8d5('0x51')](handleError(_0x13a02d,null));};exports[_0xe8d5('0x52')]=function(_0x1abc1e,_0x3ab11e){var _0x3474ad={'raw':!![],'where':{'id':_0x1abc1e[_0xe8d5('0x53')]['id']}},_0x36485d={};_0x36485d[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db[_0xe8d5('0x4f')][_0xe8d5('0x39')]);_0x36485d['query']=_[_0xe8d5('0x3f')](_0x1abc1e[_0xe8d5('0x3e')]);_0x36485d[_0xe8d5('0x40')]=_[_0xe8d5('0x41')](_0x36485d['model'],_0x36485d[_0xe8d5('0x3e')]);_0x3474ad[_0xe8d5('0x42')]=_['intersection'](_0x36485d[_0xe8d5('0x3c')],qs[_0xe8d5('0x43')](_0x1abc1e[_0xe8d5('0x3e')][_0xe8d5('0x43')]));_0x3474ad[_0xe8d5('0x42')]=_0x3474ad[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x3474ad[_0xe8d5('0x42')]:_0x36485d[_0xe8d5('0x3c')];if(_0x1abc1e['query'][_0xe8d5('0x54')]){_0x3474ad[_0xe8d5('0x55')]=[{'all':!![]}];}_0x3474ad=_['merge']({},_0x3474ad,_0x1abc1e['options']);return db[_0xe8d5('0x4f')]['find'](_0x3474ad)[_0xe8d5('0x20')](handleEntityNotFound(_0x3ab11e,null))['then'](respondWithResult(_0x3ab11e,null))['catch'](handleError(_0x3ab11e,null));};exports['create']=function(_0x3448e9,_0x43efa9){return db[_0xe8d5('0x4f')][_0xe8d5('0x56')](_0x3448e9[_0xe8d5('0x57')],{})[_0xe8d5('0x20')](function(_0x2c282b){var _0x2c558c=_0x3448e9[_0xe8d5('0x58')][_0xe8d5('0x34')]({'plain':!![]});if(!_0x2c558c)throw new Error(_0xe8d5('0x59'));if(_0x2c558c[_0xe8d5('0x5a')]===_0xe8d5('0x58')){var _0x315b67=_0x2c282b[_0xe8d5('0x34')]({'plain':!![]});var _0x53ff36='ChatQueues';return db[_0xe8d5('0x5b')][_0xe8d5('0x5c')]({'where':{'name':_0x53ff36,'userProfileId':_0x2c558c['userProfileId']},'raw':!![]})[_0xe8d5('0x20')](function(_0x565440){if(_0x565440&&_0x565440[_0xe8d5('0x5d')]===0x0){return db[_0xe8d5('0x36')]['create']({'name':_0x315b67[_0xe8d5('0x37')],'resourceId':_0x315b67['id'],'type':_0x565440[_0xe8d5('0x37')],'sectionId':_0x565440['id']},{})[_0xe8d5('0x20')](function(){return _0x2c282b;});}else{return _0x2c282b;}})['catch'](function(_0x400f9a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x400f9a);throw _0x400f9a;});}return _0x2c282b;})['then'](respondWithResult(_0x43efa9,0xc9))[_0xe8d5('0x51')](handleError(_0x43efa9,null));};exports[_0xe8d5('0x32')]=function(_0x320f4a,_0x5f1641){if(_0x320f4a[_0xe8d5('0x57')]['id']){delete _0x320f4a[_0xe8d5('0x57')]['id'];}return db[_0xe8d5('0x4f')][_0xe8d5('0x5c')]({'where':{'id':_0x320f4a[_0xe8d5('0x53')]['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x5f1641,null))['then'](saveUpdates(_0x320f4a[_0xe8d5('0x57')],null))[_0xe8d5('0x20')](respondWithResult(_0x5f1641,null))['catch'](handleError(_0x5f1641,null));};exports['destroy']=function(_0x3fc435,_0x504afb){return db[_0xe8d5('0x4f')]['find']({'where':{'id':_0x3fc435['params']['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x504afb,null))[_0xe8d5('0x20')](removeEntity(_0x504afb,null))[_0xe8d5('0x51')](handleError(_0x504afb,null));};exports[_0xe8d5('0x5e')]=function(_0x50120e,_0x468b30){return db[_0xe8d5('0x4f')][_0xe8d5('0x5e')]()[_0xe8d5('0x20')](respondWithResult(_0x468b30,null))[_0xe8d5('0x51')](handleError(_0x468b30,null));};exports[_0xe8d5('0x5f')]=function(_0x5b9fc0,_0xaee930,_0x17ada6){var _0x369967={'raw':!![],'where':{}},_0x1305e2={},_0x36a046;return db['ChatQueue'][_0xe8d5('0x60')]({'where':{'id':_0x5b9fc0['params']['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0xaee930,null))[_0xe8d5('0x20')](function(_0x1f55d0){if(_0x1f55d0){_0x36a046=_0x1f55d0['get']({'plain':!![]});_0x1305e2[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db[_0xe8d5('0x61')]['rawAttributes']);_0x1305e2['query']=_[_0xe8d5('0x3f')](_0x5b9fc0[_0xe8d5('0x3e')]);_0x1305e2['filters']=_[_0xe8d5('0x41')](_0x1305e2[_0xe8d5('0x3c')],_0x1305e2[_0xe8d5('0x3e')]);_0x369967[_0xe8d5('0x42')]=_['intersection'](_0x1305e2[_0xe8d5('0x3c')],qs['fields'](_0x5b9fc0[_0xe8d5('0x3e')][_0xe8d5('0x43')]));_0x369967[_0xe8d5('0x42')]=_0x369967[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x369967[_0xe8d5('0x42')]:_0x1305e2['model'];if(!_0x5b9fc0['query'][_0xe8d5('0x45')](_0xe8d5('0x46'))){_0x369967[_0xe8d5('0x47')]=qs['limit'](_0x5b9fc0[_0xe8d5('0x3e')][_0xe8d5('0x47')]);_0x369967[_0xe8d5('0x2e')]=qs[_0xe8d5('0x2e')](_0x5b9fc0['query'][_0xe8d5('0x2e')]);}_0x369967[_0xe8d5('0x62')]=qs[_0xe8d5('0x48')](_0x5b9fc0[_0xe8d5('0x3e')][_0xe8d5('0x48')]);_0x369967[_0xe8d5('0x49')]=qs['filters'](_[_0xe8d5('0x4a')](_0x5b9fc0['query'],_0x1305e2[_0xe8d5('0x40')]));_0x369967[_0xe8d5('0x49')]['ChatQueueId']=_0x1f55d0['id'];if(_0x5b9fc0['query'][_0xe8d5('0x4b')]){_0x369967[_0xe8d5('0x49')]=_[_0xe8d5('0x4c')](_0x369967[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x369967[_0xe8d5('0x42')],function(_0x149cd7){var _0x218b5c={};_0x218b5c[_0x149cd7]={'$like':'%'+_0x5b9fc0['query'][_0xe8d5('0x4b')]+'%'};return _0x218b5c;})});}_0x369967=_[_0xe8d5('0x4c')]({},_0x369967,_0x5b9fc0[_0xe8d5('0x4e')]);return db['UserChatQueue'][_0xe8d5('0x63')](_0x369967);}})[_0xe8d5('0x20')](function(_0x750ba2){if(_0x750ba2){return db[_0xe8d5('0x64')][_0xe8d5('0x65')]({'where':{'id':_[_0xe8d5('0x3d')](_0x750ba2,_0xe8d5('0x66')),'role':_0xe8d5('0x67')},'attributes':['id',_0xe8d5('0x37'),_0xe8d5('0x68'),'updatedAt','createdAt']});}})[_0xe8d5('0x20')](function(_0x1204f9){if(_0x1204f9){return{'count':_0x1204f9[_0xe8d5('0x2f')],'rows':_[_0xe8d5('0x3d')](_0x1204f9[_0xe8d5('0x50')],function(_0x4179d8){return{'membername':_0x4179d8[_0xe8d5('0x37')],'UserId':_0x4179d8['id'],'queue_name':_0x36a046['name'],'ChatQueueId':_0x36a046['id'],'interface':util[_0xe8d5('0x69')]('%s/%s',_0xe8d5('0x6a'),_0x4179d8[_0xe8d5('0x37')]),'penalty':0x0,'paused':_0x4179d8['chatPause'],'createdAt':_0x4179d8[_0xe8d5('0x6b')],'updatedAt':_0x4179d8[_0xe8d5('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xaee930,_0x369967))[_0xe8d5('0x51')](handleError(_0xaee930,null));};exports[_0xe8d5('0x6d')]=function(_0x1edddf,_0x466725,_0x37a803){var _0x38e631={};var _0x1afc73={};var _0x5b6d8f;var _0x3ab933;return db[_0xe8d5('0x4f')][_0xe8d5('0x60')]({'where':{'id':_0x1edddf[_0xe8d5('0x53')]['id']}})['then'](handleEntityNotFound(_0x466725,null))[_0xe8d5('0x20')](function(_0x605a6){if(_0x605a6){_0x5b6d8f=_0x605a6;_0x1afc73[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db['Team'][_0xe8d5('0x39')]);_0x1afc73[_0xe8d5('0x3e')]=_[_0xe8d5('0x3f')](_0x1edddf[_0xe8d5('0x3e')]);_0x1afc73[_0xe8d5('0x40')]=_['intersection'](_0x1afc73['model'],_0x1afc73[_0xe8d5('0x3e')]);_0x38e631[_0xe8d5('0x42')]=_[_0xe8d5('0x41')](_0x1afc73[_0xe8d5('0x3c')],qs[_0xe8d5('0x43')](_0x1edddf[_0xe8d5('0x3e')]['fields']));_0x38e631['attributes']=_0x38e631[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x38e631[_0xe8d5('0x42')]:_0x1afc73[_0xe8d5('0x3c')];_0x38e631[_0xe8d5('0x62')]=qs[_0xe8d5('0x48')](_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x48')]);_0x38e631[_0xe8d5('0x49')]=qs['filters'](_['pick'](_0x1edddf['query'],_0x1afc73[_0xe8d5('0x40')]));if(_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x4b')]){_0x38e631['where']=_[_0xe8d5('0x4c')](_0x38e631[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x38e631[_0xe8d5('0x42')],function(_0x535669){var _0x5294d8={};_0x5294d8[_0x535669]={'$like':'%'+_0x1edddf[_0xe8d5('0x3e')]['filter']+'%'};return _0x5294d8;})});}_0x38e631=_[_0xe8d5('0x4c')]({},_0x38e631,_0x1edddf[_0xe8d5('0x4e')]);return _0x5b6d8f[_0xe8d5('0x6d')](_0x38e631);}})[_0xe8d5('0x20')](function(_0x27ed12){if(_0x27ed12){_0x3ab933=_0x27ed12[_0xe8d5('0x44')];if(!_0x1edddf[_0xe8d5('0x3e')]['hasOwnProperty'](_0xe8d5('0x46'))){_0x38e631[_0xe8d5('0x47')]=qs[_0xe8d5('0x47')](_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x47')]);_0x38e631[_0xe8d5('0x2e')]=qs['offset'](_0x1edddf[_0xe8d5('0x3e')][_0xe8d5('0x2e')]);}return _0x5b6d8f[_0xe8d5('0x6d')](_0x38e631);}})[_0xe8d5('0x20')](function(_0x3c5398){if(_0x3c5398){return _0x3c5398?{'count':_0x3ab933,'rows':_0x3c5398}:null;}})['then'](respondWithResult(_0x466725,null))['catch'](handleError(_0x466725,null));};exports[_0xe8d5('0x6e')]=function(_0x403bc2,_0x5ea83c,_0x3f87dd){var _0x4ce309=_0x403bc2[_0xe8d5('0x57')]['ids'];return db[_0xe8d5('0x6f')]['findAll']({'where':{'id':_0x4ce309},'attributes':['id'],'include':[{'model':db[_0xe8d5('0x64')],'as':_0xe8d5('0x70'),'attributes':['id',_0xe8d5('0x37'),_0xe8d5('0x71'),_0xe8d5('0x72'),_0xe8d5('0x73')],'raw':!![]}]})[_0xe8d5('0x20')](function(_0x321a55){if(_0x321a55){var _0x3b4518=_[_0xe8d5('0x74')](_0x321a55,function(_0x4f4be8){var _0x5f42ec=_0x4f4be8[_0xe8d5('0x34')]({'plain':!![]});return _0x5f42ec[_0xe8d5('0x70')];});return db['ChatQueue'][_0xe8d5('0x5c')]({'where':{'id':_0x403bc2[_0xe8d5('0x53')]['id']}})['then'](function(_0x3cd784){return db[_0xe8d5('0x75')][_0xe8d5('0x76')](function(_0x481993){return _0x3cd784[_0xe8d5('0x6e')](_0x4ce309,{'transaction':_0x481993})[_0xe8d5('0x20')](function(){return BPromise[_0xe8d5('0x77')](_0x3b4518,function(_0x1f5167){return db['UserChatQueue'][_0xe8d5('0x78')]({'where':{'UserId':_0x1f5167['id'],'ChatQueueId':_0x403bc2[_0xe8d5('0x53')]['id']},'transaction':_0x481993});});})[_0xe8d5('0x20')](function(){_0x3b4518[_0xe8d5('0x79')](function(_0x1d01e8){socket[_0xe8d5('0x7a')]('userChatQueue:save',{'UserId':_0x1d01e8['id'],'ChatQueueId':_0x3cd784['id']});});});});});}})[_0xe8d5('0x20')](respondWithStatusCode(_0x5ea83c,null))[_0xe8d5('0x51')](handleError(_0x5ea83c,null));};exports[_0xe8d5('0x7b')]=function(_0xc63745,_0x46c761,_0x47d3bb){return db[_0xe8d5('0x6f')][_0xe8d5('0x63')]({'where':{'id':_0xc63745[_0xe8d5('0x3e')][_0xe8d5('0x7c')]},'attributes':['id'],'include':[{'model':db[_0xe8d5('0x64')],'as':_0xe8d5('0x70'),'attributes':['id'],'raw':!![]}]})[_0xe8d5('0x20')](handleEntityNotFound(_0x46c761,null))[_0xe8d5('0x20')](function(_0x72c52){var _0xe83183=_[_0xe8d5('0x3d')](_0x72c52,'id');var _0x45e675=[];var _0x2eacc8=[];var _0x3c302e=squel['select']();_0x3c302e[_0xe8d5('0x7d')](_0xe8d5('0x7e'))['from'](_0xe8d5('0x7f'),'tq')['join'](_0xe8d5('0x80'),'ut',_0xe8d5('0x81'))[_0xe8d5('0x49')]('ChatQueueId\x20=\x20?',_0xc63745[_0xe8d5('0x53')]['id']);for(var _0xf9980a=0x0;_0xf9980a<_0x72c52[_0xe8d5('0x44')];_0xf9980a+=0x1){let _0x434048=_0x72c52[_0xf9980a];for(var _0x577048=0x0;_0x577048<_0x434048['Agents'][_0xe8d5('0x44')];_0x577048+=0x1){let _0x39f399=_0x434048[_0xe8d5('0x70')][_0x577048];var _0x38a8d9=_0x3c302e[_0xe8d5('0x82')]();_0x38a8d9[_0xe8d5('0x49')](_0xe8d5('0x83'),_0x39f399['id']);_0x2eacc8['push'](db[_0xe8d5('0x75')][_0xe8d5('0x3e')](_0x38a8d9['toString'](),{'type':db['sequelize'][_0xe8d5('0x84')]['SELECT']})[_0xe8d5('0x20')](function(_0x7b8495){if(_0x7b8495[_0xe8d5('0x44')]===0x1){return _0x39f399['id'];}else{var _0x3b9ded=_[_0xe8d5('0x85')](_[_0xe8d5('0x3d')](_0x7b8495,_0xe8d5('0x86')),function(_0x388c67){return _[_0xe8d5('0x87')](_0xe83183,_0x388c67);});if(_0x3b9ded){return _0x39f399['id'];}}}));}}return BPromise[_0xe8d5('0x88')](_0x2eacc8)[_0xe8d5('0x20')](function(_0x135ab4){_0x45e675=_(_0x45e675)['union'](_0x135ab4)[_0xe8d5('0x89')]()['value']();return db[_0xe8d5('0x4f')][_0xe8d5('0x5c')]({'where':{'id':_0xc63745[_0xe8d5('0x53')]['id']}})['then'](function(_0x5c3a3a){return db['sequelize'][_0xe8d5('0x76')](function(_0x26502a){return _0x5c3a3a[_0xe8d5('0x7b')](_0xc63745[_0xe8d5('0x3e')]['ids'],{'transaction':_0x26502a})[_0xe8d5('0x20')](function(){if(!_[_0xe8d5('0x8a')](_0x45e675)){return _0x5c3a3a[_0xe8d5('0x8b')](_0x45e675,{'transaction':_0x26502a});}})[_0xe8d5('0x20')](function(){_0x45e675[_0xe8d5('0x79')](function(_0x5ae2b8){socket[_0xe8d5('0x7a')](_0xe8d5('0x8c'),{'UserId':_0x5ae2b8,'ChatQueueId':_0x5c3a3a['id']});});});});});});})['then'](respondWithStatusCode(_0x46c761,null))[_0xe8d5('0x51')](handleError(_0x46c761,null));};exports[_0xe8d5('0x8d')]=function(_0x5a8348,_0x158f79,_0x552b75){return db[_0xe8d5('0x4f')]['find']({'where':{'id':_0x5a8348[_0xe8d5('0x53')]['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x158f79,null))[_0xe8d5('0x20')](function(_0x1db074){if(_0x1db074){return _0x1db074[_0xe8d5('0x8d')](_0x5a8348[_0xe8d5('0x57')]['ids'],_[_0xe8d5('0x8e')](_0x5a8348[_0xe8d5('0x57')],[_0xe8d5('0x7c'),'id'])||{})[_0xe8d5('0x8f')](function(_0x417425){for(var _0x1c1ea8=0x0;_0x1c1ea8<_0x5a8348[_0xe8d5('0x57')][_0xe8d5('0x7c')][_0xe8d5('0x44')];_0x1c1ea8+=0x1){socket[_0xe8d5('0x7a')]('userChatQueue:save',{'UserId':Number(_0x5a8348[_0xe8d5('0x57')][_0xe8d5('0x7c')][_0x1c1ea8]),'ChatQueueId':Number(_0x5a8348[_0xe8d5('0x53')]['id'])});}return _0x417425;});}})[_0xe8d5('0x20')](respondWithResult(_0x158f79,null))[_0xe8d5('0x51')](handleError(_0x158f79,null));};exports['removeAgents']=function(_0x497a57,_0x21c492,_0x2fd3ef){return db[_0xe8d5('0x4f')][_0xe8d5('0x5c')]({'where':{'id':_0x497a57['params']['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x21c492,null))[_0xe8d5('0x20')](function(_0x108f38){if(_0x108f38){return _0x108f38[_0xe8d5('0x8b')](_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')])[_0xe8d5('0x20')](function(){if(_[_0xe8d5('0x90')](_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')])){for(var _0x2c2a65=0x0;_0x2c2a65<_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')][_0xe8d5('0x44')];_0x2c2a65+=0x1){socket[_0xe8d5('0x7a')]('userChatQueue:remove',{'UserId':Number(_0x497a57[_0xe8d5('0x3e')]['ids'][_0x2c2a65]),'ChatQueueId':Number(_0x497a57['params']['id'])});}}else{socket[_0xe8d5('0x7a')](_0xe8d5('0x8c'),{'UserId':Number(_0x497a57[_0xe8d5('0x3e')][_0xe8d5('0x7c')]),'ChatQueueId':Number(_0x497a57['params']['id'])});}});}})['then'](respondWithStatusCode(_0x21c492,null))['catch'](handleError(_0x21c492,null));};exports[_0xe8d5('0x91')]=function(_0x20e913,_0x4d5c1c,_0x161f80){var _0x3646c7={};var _0x3a994a={};var _0x412200;var _0x41c7a4;return db[_0xe8d5('0x4f')][_0xe8d5('0x60')]({'where':{'id':_0x20e913[_0xe8d5('0x53')]['id']}})[_0xe8d5('0x20')](handleEntityNotFound(_0x4d5c1c,null))['then'](function(_0x312b0d){if(_0x312b0d){_0x412200=_0x312b0d;_0x3a994a[_0xe8d5('0x3c')]=_[_0xe8d5('0x3f')](db[_0xe8d5('0x64')][_0xe8d5('0x39')]);_0x3a994a[_0xe8d5('0x3e')]=_[_0xe8d5('0x3f')](_0x20e913[_0xe8d5('0x3e')]);_0x3a994a[_0xe8d5('0x40')]=_[_0xe8d5('0x41')](_0x3a994a[_0xe8d5('0x3c')],_0x3a994a['query']);_0x3646c7['attributes']=_['intersection'](_0x3a994a[_0xe8d5('0x3c')],qs['fields'](_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x43')]));_0x3646c7['attributes']=_0x3646c7[_0xe8d5('0x42')][_0xe8d5('0x44')]?_0x3646c7[_0xe8d5('0x42')]:_0x3a994a['model'];_0x3646c7[_0xe8d5('0x62')]=qs[_0xe8d5('0x48')](_0x20e913['query'][_0xe8d5('0x48')]);_0x3646c7[_0xe8d5('0x49')]=qs['filters'](_[_0xe8d5('0x4a')](_0x20e913[_0xe8d5('0x3e')],_0x3a994a[_0xe8d5('0x40')]));if(_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x4b')]){_0x3646c7[_0xe8d5('0x49')]=_['merge'](_0x3646c7[_0xe8d5('0x49')],{'$or':_[_0xe8d5('0x3d')](_0x3646c7['attributes'],function(_0x3cd770){var _0x5b6997={};_0x5b6997[_0x3cd770]={'$like':'%'+_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x4b')]+'%'};return _0x5b6997;})});}_0x3646c7=_['merge']({},_0x3646c7,_0x20e913['options']);return _0x412200[_0xe8d5('0x91')](_0x3646c7);}})[_0xe8d5('0x20')](function(_0x308959){if(_0x308959){_0x41c7a4=_0x308959[_0xe8d5('0x44')];if(!_0x20e913['query'][_0xe8d5('0x45')](_0xe8d5('0x46'))){_0x3646c7[_0xe8d5('0x47')]=qs[_0xe8d5('0x47')](_0x20e913[_0xe8d5('0x3e')][_0xe8d5('0x47')]);_0x3646c7[_0xe8d5('0x2e')]=qs[_0xe8d5('0x2e')](_0x20e913['query'][_0xe8d5('0x2e')]);}return _0x412200[_0xe8d5('0x91')](_0x3646c7);}})[_0xe8d5('0x20')](function(_0x283629){if(_0x283629){return _0x283629?{'count':_0x41c7a4,'rows':_0x283629}:null;}})['then'](respondWithResult(_0x4d5c1c,null))[_0xe8d5('0x51')](handleError(_0x4d5c1c,null));};
\ No newline at end of file
index affb89e..f2626c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a22=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners'];(function(_0x528112,_0x51eec7){var _0xd902ad=function(_0x4ef4cb){while(--_0x4ef4cb){_0x528112['push'](_0x528112['shift']());}};_0xd902ad(++_0x51eec7);}(_0x1a22,0xcc));var _0x21a2=function(_0xb04cb1,_0x13b8e3){_0xb04cb1=_0xb04cb1-0x0;var _0x309445=_0x1a22[_0xb04cb1];return _0x309445;};'use strict';var EventEmitter=require(_0x21a2('0x0'));var ChatQueue=require(_0x21a2('0x1'))['db'][_0x21a2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x21a2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x331edd){return function(_0x1b6efc,_0x6533ac,_0x42091d){ChatQueueEvents[_0x21a2('0x4')](_0x331edd+':'+_0x1b6efc['id'],_0x1b6efc);ChatQueueEvents[_0x21a2('0x4')](_0x331edd,_0x1b6efc);_0x42091d(null);};}for(var e in events){if(events[_0x21a2('0x5')](e)){var event=events[e];ChatQueue[_0x21a2('0x6')](e,emitEvent(event));}}module[_0x21a2('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0x15e1=['exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x579ae3,_0x303b07){var _0x19aef2=function(_0x9fdfcb){while(--_0x9fdfcb){_0x579ae3['push'](_0x579ae3['shift']());}};_0x19aef2(++_0x303b07);}(_0x15e1,0x1c1));var _0x115e=function(_0x3cd944,_0x2f134b){_0x3cd944=_0x3cd944-0x0;var _0xad852c=_0x15e1[_0x3cd944];return _0xad852c;};'use strict';var EventEmitter=require(_0x115e('0x0'));var ChatQueue=require(_0x115e('0x1'))['db'][_0x115e('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x115e('0x3')](0x0);var events={'afterCreate':_0x115e('0x4'),'afterUpdate':'update','afterDestroy':_0x115e('0x5')};function emitEvent(_0x189f43){return function(_0x1e25d5,_0x362a21,_0x29b35a){ChatQueueEvents[_0x115e('0x6')](_0x189f43+':'+_0x1e25d5['id'],_0x1e25d5);ChatQueueEvents[_0x115e('0x6')](_0x189f43,_0x1e25d5);_0x29b35a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x115e('0x7')]=ChatQueueEvents;
\ No newline at end of file
index 321dc2f..5bc01f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed41=['path','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','api','bluebird','request-promise'];(function(_0x208256,_0x366b10){var _0x3c1733=function(_0x36394e){while(--_0x36394e){_0x208256['push'](_0x208256['shift']());}};_0x3c1733(++_0x366b10);}(_0xed41,0xec));var _0x1ed4=function(_0x51d319,_0x1edbb4){_0x51d319=_0x51d319-0x0;var _0x407ec9=_0xed41[_0x51d319];return _0x407ec9;};'use strict';var _=require(_0x1ed4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1ed4('0x1'));var moment=require('moment');var BPromise=require(_0x1ed4('0x2'));var rp=require(_0x1ed4('0x3'));var fs=require('fs');var path=require(_0x1ed4('0x4'));var rimraf=require('rimraf');var config=require(_0x1ed4('0x5'));var attributes=require('./chatQueue.attributes');module[_0x1ed4('0x6')]=function(_0x590f15,_0xa94660){return _0x590f15[_0x1ed4('0x7')](_0x1ed4('0x8'),attributes,{'tableName':_0x1ed4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf37b=['bluebird','path','../../config/environment','define','ChatQueue','lodash','../../config/logger','api'];(function(_0x3a7767,_0x3ada12){var _0x3e2724=function(_0x36e8c5){while(--_0x36e8c5){_0x3a7767['push'](_0x3a7767['shift']());}};_0x3e2724(++_0x3ada12);}(_0xf37b,0x1ad));var _0xbf37=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0xf37b[_0x47e549];return _0x251374;};'use strict';var _=require(_0xbf37('0x0'));var util=require('util');var logger=require(_0xbf37('0x1'))(_0xbf37('0x2'));var moment=require('moment');var BPromise=require(_0xbf37('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf37('0x4'));var rimraf=require('rimraf');var config=require(_0xbf37('0x5'));var attributes=require('./chatQueue.attributes');module['exports']=function(_0x713a32,_0xf6195a){return _0x713a32[_0xbf37('0x6')](_0xbf37('0x7'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e49e376..df3b7af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a5c=['ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','include','model','ShowChatQueue','find','map','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','debug'];(function(_0x36426d,_0x4d62fe){var _0x40bd33=function(_0x278d94){while(--_0x278d94){_0x36426d['push'](_0x36426d['shift']());}};_0x40bd33(++_0x4d62fe);}(_0x2a5c,0x1f3));var _0xc2a5=function(_0x258b31,_0x1aa3d1){_0x258b31=_0x258b31-0x0;var _0x47838b=_0x2a5c[_0x258b31];return _0x47838b;};'use strict';var _=require(_0xc2a5('0x0'));var util=require(_0xc2a5('0x1'));var moment=require(_0xc2a5('0x2'));var BPromise=require(_0xc2a5('0x3'));var rs=require(_0xc2a5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc2a5('0x5'))['db'];var utils=require(_0xc2a5('0x6'));var logger=require(_0xc2a5('0x7'))(_0xc2a5('0x8'));var config=require('../../config/environment');var jayson=require(_0xc2a5('0x9'));var client=jayson['client'][_0xc2a5('0xa')]({'port':0x232a});config[_0xc2a5('0xb')]=_['defaults'](config['redis'],{'host':_0xc2a5('0xc'),'port':0x18eb});var socket=require(_0xc2a5('0xd'))(new Redis(config['redis']));require(_0xc2a5('0xe'))[_0xc2a5('0xf')](socket);function respondWithRpcPromise(_0xa5e68d,_0x3d0e4d,_0x51ac92){return new BPromise(function(_0x1c096a,_0x253b3a){return client[_0xc2a5('0x10')](_0xa5e68d,_0x51ac92)[_0xc2a5('0x11')](function(_0x18e60c){logger[_0xc2a5('0x12')]('ChatQueue,\x20%s,\x20%s',_0x3d0e4d,_0xc2a5('0x13'));logger[_0xc2a5('0x14')](_0xc2a5('0x15'),_0x3d0e4d,_0xc2a5('0x13'),JSON[_0xc2a5('0x16')](_0x18e60c));if(_0x18e60c[_0xc2a5('0x17')]){if(_0x18e60c['error']['code']===0x1f4){logger[_0xc2a5('0x17')](_0xc2a5('0x18'),_0x3d0e4d,_0x18e60c['error'][_0xc2a5('0x19')]);return _0x253b3a(_0x18e60c['error'][_0xc2a5('0x19')]);}logger[_0xc2a5('0x17')](_0xc2a5('0x18'),_0x3d0e4d,_0x18e60c[_0xc2a5('0x17')]['message']);return _0x1c096a(_0x18e60c[_0xc2a5('0x17')][_0xc2a5('0x19')]);}else{logger[_0xc2a5('0x12')](_0xc2a5('0x18'),_0x3d0e4d,_0xc2a5('0x13'));_0x1c096a(_0x18e60c[_0xc2a5('0x1a')][_0xc2a5('0x19')]);}})[_0xc2a5('0x1b')](function(_0x3d0b24){logger[_0xc2a5('0x17')]('ChatQueue,\x20%s,\x20%s',_0x3d0e4d,_0x3d0b24);_0x253b3a(_0x3d0b24);});});}exports[_0xc2a5('0x1c')]=function(_0x35be64){var _0x2f3753=this;return new Promise(function(_0x1e6aee,_0x3d29d7){return db[_0xc2a5('0x1d')][_0xc2a5('0x1e')]({'raw':_0x35be64[_0xc2a5('0x1f')]?_0x35be64[_0xc2a5('0x1f')][_0xc2a5('0x20')]===undefined?!![]:![]:!![],'where':_0x35be64[_0xc2a5('0x1f')]?_0x35be64['options'][_0xc2a5('0x21')]||null:null,'attributes':_0x35be64['options']?_0x35be64[_0xc2a5('0x1f')][_0xc2a5('0x22')]||null:null,'limit':_0x35be64[_0xc2a5('0x1f')]?_0x35be64[_0xc2a5('0x1f')]['limit']||null:null,'include':_0x35be64[_0xc2a5('0x1f')]?_0x35be64['options'][_0xc2a5('0x23')]?_['map'](_0x35be64[_0xc2a5('0x1f')][_0xc2a5('0x23')],function(_0x206a95){return{'model':db[_0x206a95[_0xc2a5('0x24')]],'as':_0x206a95['as'],'attributes':_0x206a95[_0xc2a5('0x22')],'include':_0x206a95['include']?_['map'](_0x206a95['include'],function(_0x5bc41d){return{'model':db[_0x5bc41d['model']],'as':_0x5bc41d['as'],'attributes':_0x5bc41d['attributes'],'include':_0x5bc41d[_0xc2a5('0x23')]?_['map'](_0x5bc41d[_0xc2a5('0x23')],function(_0x2012f2){return{'model':db[_0x2012f2[_0xc2a5('0x24')]],'as':_0x2012f2['as'],'attributes':_0x2012f2[_0xc2a5('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc2a5('0x11')](function(_0x1ed507){logger[_0xc2a5('0x12')](_0xc2a5('0x1c'),_0x35be64);logger['debug']('GetChatQueue',_0x35be64,JSON[_0xc2a5('0x16')](_0x1ed507));_0x1e6aee(_0x1ed507);})[_0xc2a5('0x1b')](function(_0x3e2836){logger[_0xc2a5('0x17')](_0xc2a5('0x1c'),_0x3e2836[_0xc2a5('0x19')],_0x35be64);_0x3d29d7(_0x2f3753['error'](0x1f4,_0x3e2836['message']));});});};exports[_0xc2a5('0x25')]=function(_0x2037d5){var _0x5310b6=this;return new Promise(function(_0x2ee0c2,_0x347e54){return db[_0xc2a5('0x1d')][_0xc2a5('0x26')]({'raw':_0x2037d5[_0xc2a5('0x1f')]?_0x2037d5[_0xc2a5('0x1f')][_0xc2a5('0x20')]===undefined?!![]:![]:!![],'where':_0x2037d5[_0xc2a5('0x1f')]?_0x2037d5['options'][_0xc2a5('0x21')]||null:null,'attributes':_0x2037d5[_0xc2a5('0x1f')]?_0x2037d5[_0xc2a5('0x1f')][_0xc2a5('0x22')]||null:null,'include':_0x2037d5['options']?_0x2037d5[_0xc2a5('0x1f')]['include']?_['map'](_0x2037d5[_0xc2a5('0x1f')][_0xc2a5('0x23')],function(_0x1fec30){return{'model':db[_0x1fec30[_0xc2a5('0x24')]],'as':_0x1fec30['as'],'attributes':_0x1fec30['attributes'],'include':_0x1fec30[_0xc2a5('0x23')]?_[_0xc2a5('0x27')](_0x1fec30[_0xc2a5('0x23')],function(_0x3f2f06){return{'model':db[_0x3f2f06['model']],'as':_0x3f2f06['as'],'attributes':_0x3f2f06[_0xc2a5('0x22')],'include':_0x3f2f06[_0xc2a5('0x23')]?_[_0xc2a5('0x27')](_0x3f2f06[_0xc2a5('0x23')],function(_0x1c296f){return{'model':db[_0x1c296f[_0xc2a5('0x24')]],'as':_0x1c296f['as'],'attributes':_0x1c296f[_0xc2a5('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x377c49){logger['info'](_0xc2a5('0x25'),_0x2037d5);logger['debug'](_0xc2a5('0x25'),_0x2037d5,JSON['stringify'](_0x377c49));_0x2ee0c2(_0x377c49);})['catch'](function(_0x15f5e2){logger[_0xc2a5('0x17')](_0xc2a5('0x25'),_0x15f5e2['message'],_0x2037d5);_0x347e54(_0x5310b6['error'](0x1f4,_0x15f5e2[_0xc2a5('0x19')]));});});};
\ No newline at end of file
+var _0x8cce=['jayson/promise','client','redis','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','options','where','attributes','limit','include','map','model','debug','stringify','catch','ShowChatQueue','find','raw','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4191af,_0x5783da){var _0x27bebf=function(_0x355be7){while(--_0x355be7){_0x4191af['push'](_0x4191af['shift']());}};_0x27bebf(++_0x5783da);}(_0x8cce,0xd6));var _0xe8cc=function(_0x413af4,_0x34f2f1){_0x413af4=_0x413af4-0x0;var _0x20f98b=_0x8cce[_0x413af4];return _0x20f98b;};'use strict';var _=require('lodash');var util=require(_0xe8cc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe8cc('0x1'));var fs=require('fs');var Redis=require(_0xe8cc('0x2'));var db=require(_0xe8cc('0x3'))['db'];var utils=require(_0xe8cc('0x4'));var logger=require(_0xe8cc('0x5'))(_0xe8cc('0x6'));var config=require(_0xe8cc('0x7'));var jayson=require(_0xe8cc('0x8'));var client=jayson[_0xe8cc('0x9')]['http']({'port':0x232a});config[_0xe8cc('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe8cc('0xb'))(new Redis(config[_0xe8cc('0xa')]));require('./chatQueue.socket')[_0xe8cc('0xc')](socket);function respondWithRpcPromise(_0x4c211b,_0x22ca98,_0x401515){return new BPromise(function(_0xcbf3ec,_0x826385){return client[_0xe8cc('0xd')](_0x4c211b,_0x401515)[_0xe8cc('0xe')](function(_0x4d499c){logger[_0xe8cc('0xf')](_0xe8cc('0x10'),_0x22ca98,'request\x20sent');logger['debug'](_0xe8cc('0x11'),_0x22ca98,'request\x20sent',JSON['stringify'](_0x4d499c));if(_0x4d499c[_0xe8cc('0x12')]){if(_0x4d499c['error'][_0xe8cc('0x13')]===0x1f4){logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x4d499c['error'][_0xe8cc('0x14')]);return _0x826385(_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);}logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);return _0xcbf3ec(_0x4d499c[_0xe8cc('0x12')][_0xe8cc('0x14')]);}else{logger[_0xe8cc('0xf')]('ChatQueue,\x20%s,\x20%s',_0x22ca98,'request\x20sent');_0xcbf3ec(_0x4d499c[_0xe8cc('0x15')][_0xe8cc('0x14')]);}})['catch'](function(_0x53014b){logger[_0xe8cc('0x12')](_0xe8cc('0x10'),_0x22ca98,_0x53014b);_0x826385(_0x53014b);});});}exports[_0xe8cc('0x16')]=function(_0x403f91){var _0xbafd99=this;return new Promise(function(_0x21e933,_0x445f4f){return db[_0xe8cc('0x17')]['findAll']({'raw':_0x403f91['options']?_0x403f91[_0xe8cc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x403f91['options']?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x19')]||null:null,'attributes':_0x403f91[_0xe8cc('0x18')]?_0x403f91['options'][_0xe8cc('0x1a')]||null:null,'limit':_0x403f91[_0xe8cc('0x18')]?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x1b')]||null:null,'include':_0x403f91[_0xe8cc('0x18')]?_0x403f91[_0xe8cc('0x18')][_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x403f91['options'][_0xe8cc('0x1c')],function(_0x34d6e0){return{'model':db[_0x34d6e0[_0xe8cc('0x1e')]],'as':_0x34d6e0['as'],'attributes':_0x34d6e0[_0xe8cc('0x1a')],'include':_0x34d6e0[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x34d6e0[_0xe8cc('0x1c')],function(_0x2c5fb2){return{'model':db[_0x2c5fb2[_0xe8cc('0x1e')]],'as':_0x2c5fb2['as'],'attributes':_0x2c5fb2[_0xe8cc('0x1a')],'include':_0x2c5fb2[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x2c5fb2[_0xe8cc('0x1c')],function(_0x35029c){return{'model':db[_0x35029c['model']],'as':_0x35029c['as'],'attributes':_0x35029c[_0xe8cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe8cc('0xe')](function(_0x4bed04){logger[_0xe8cc('0xf')](_0xe8cc('0x16'),_0x403f91);logger[_0xe8cc('0x1f')](_0xe8cc('0x16'),_0x403f91,JSON[_0xe8cc('0x20')](_0x4bed04));_0x21e933(_0x4bed04);})[_0xe8cc('0x21')](function(_0xdc9b1b){logger[_0xe8cc('0x12')](_0xe8cc('0x16'),_0xdc9b1b['message'],_0x403f91);_0x445f4f(_0xbafd99[_0xe8cc('0x12')](0x1f4,_0xdc9b1b[_0xe8cc('0x14')]));});});};exports[_0xe8cc('0x22')]=function(_0x5f6a3c){var _0x1518ce=this;return new Promise(function(_0x5048a7,_0x17405d){return db[_0xe8cc('0x17')][_0xe8cc('0x23')]({'raw':_0x5f6a3c[_0xe8cc('0x18')]?_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x24')]===undefined?!![]:![]:!![],'where':_0x5f6a3c['options']?_0x5f6a3c['options']['where']||null:null,'attributes':_0x5f6a3c['options']?_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x1a')]||null:null,'include':_0x5f6a3c[_0xe8cc('0x18')]?_0x5f6a3c['options'][_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x5f6a3c[_0xe8cc('0x18')][_0xe8cc('0x1c')],function(_0x550d9a){return{'model':db[_0x550d9a[_0xe8cc('0x1e')]],'as':_0x550d9a['as'],'attributes':_0x550d9a['attributes'],'include':_0x550d9a[_0xe8cc('0x1c')]?_[_0xe8cc('0x1d')](_0x550d9a['include'],function(_0x1dcf5b){return{'model':db[_0x1dcf5b[_0xe8cc('0x1e')]],'as':_0x1dcf5b['as'],'attributes':_0x1dcf5b[_0xe8cc('0x1a')],'include':_0x1dcf5b['include']?_[_0xe8cc('0x1d')](_0x1dcf5b[_0xe8cc('0x1c')],function(_0x531555){return{'model':db[_0x531555[_0xe8cc('0x1e')]],'as':_0x531555['as'],'attributes':_0x531555[_0xe8cc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xe8cc('0xe')](function(_0x286685){logger[_0xe8cc('0xf')](_0xe8cc('0x22'),_0x5f6a3c);logger[_0xe8cc('0x1f')](_0xe8cc('0x22'),_0x5f6a3c,JSON[_0xe8cc('0x20')](_0x286685));_0x5048a7(_0x286685);})[_0xe8cc('0x21')](function(_0x2e6e13){logger[_0xe8cc('0x12')](_0xe8cc('0x22'),_0x2e6e13[_0xe8cc('0x14')],_0x5f6a3c);_0x17405d(_0x1518ce[_0xe8cc('0x12')](0x1f4,_0x2e6e13['message']));});});};
\ No newline at end of file
index 8d4642e..cb4e338 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dae=['remove','update','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x3b00b0,_0x3555d5){var _0x4c0bc5=function(_0x48c7dc){while(--_0x48c7dc){_0x3b00b0['push'](_0x3b00b0['shift']());}};_0x4c0bc5(++_0x3555d5);}(_0x2dae,0xc3));var _0xe2da=function(_0x1ebeea,_0x2f54f4){_0x1ebeea=_0x1ebeea-0x0;var _0x576465=_0x2dae[_0x1ebeea];return _0x576465;};'use strict';var ChatQueueEvents=require(_0xe2da('0x0'));var events=['save',_0xe2da('0x1'),_0xe2da('0x2')];function createListener(_0xcd0055,_0x167432){return function(_0x99b46f){_0x167432['emit'](_0xcd0055,_0x99b46f);};}function removeListener(_0x25b9f2,_0x439b5d){return function(){ChatQueueEvents[_0xe2da('0x3')](_0x25b9f2,_0x439b5d);};}exports[_0xe2da('0x4')]=function(_0x523c60){for(var _0x3e3e25=0x0,_0x89c70b=events[_0xe2da('0x5')];_0x3e3e25<_0x89c70b;_0x3e3e25++){var _0x2efbd8=events[_0x3e3e25];var _0x238da3=createListener(_0xe2da('0x6')+_0x2efbd8,_0x523c60);ChatQueueEvents['on'](_0x2efbd8,_0x238da3);}};
\ No newline at end of file
+var _0xf72b=['removeListener','register','length','chatQueue:','./chatQueue.events','remove','emit'];(function(_0x1af3db,_0x369209){var _0x5da06a=function(_0x3eb995){while(--_0x3eb995){_0x1af3db['push'](_0x1af3db['shift']());}};_0x5da06a(++_0x369209);}(_0xf72b,0x1d9));var _0xbf72=function(_0x21d88d,_0x3df29e){_0x21d88d=_0x21d88d-0x0;var _0xc044bd=_0xf72b[_0x21d88d];return _0xc044bd;};'use strict';var ChatQueueEvents=require(_0xbf72('0x0'));var events=['save',_0xbf72('0x1'),'update'];function createListener(_0xd09dd2,_0x1880d0){return function(_0x5a9feb){_0x1880d0[_0xbf72('0x2')](_0xd09dd2,_0x5a9feb);};}function removeListener(_0x550a9e,_0x37afc8){return function(){ChatQueueEvents[_0xbf72('0x3')](_0x550a9e,_0x37afc8);};}exports[_0xbf72('0x4')]=function(_0x2b8440){for(var _0x5ee060=0x0,_0x41c11d=events[_0xbf72('0x5')];_0x5ee060<_0x41c11d;_0x5ee060++){var _0x119807=events[_0x5ee060];var _0xd0402c=createListener(_0xbf72('0x6')+_0x119807,_0x2b8440);ChatQueueEvents['on'](_0x119807,_0xd0402c);}};
\ No newline at end of file
index 8a9ec9f..941eeec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x3e74,0x175));var _0x43e7=function(_0x4ece86,_0x23aacb){_0x4ece86=_0x4ece86-0x0;var _0x157e8e=_0x3e74[_0x4ece86];return _0x157e8e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
+var _0xe14b=['/describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer','util','express','Router','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','index'];(function(_0x95eba9,_0x41c502){var _0x4cec3f=function(_0x42e18c){while(--_0x42e18c){_0x95eba9['push'](_0x95eba9['shift']());}};_0x4cec3f(++_0x41c502);}(_0xe14b,0x93));var _0xbe14=function(_0x2b76e6,_0x11f93c){_0x2b76e6=_0x2b76e6-0x0;var _0x36fd04=_0xe14b[_0x2b76e6];return _0x36fd04;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x8')]);router[_0xbe14('0x6')](_0xbe14('0x9'),auth[_0xbe14('0x7')](),controller['describe']);router['get']('/:id',auth[_0xbe14('0x7')](),controller[_0xbe14('0xa')]);router[_0xbe14('0x6')](_0xbe14('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe14('0x6')](_0xbe14('0xc'),auth['isAuthenticated'](),controller[_0xbe14('0xd')]);router[_0xbe14('0x6')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0xf')]);router[_0xbe14('0x10')]('/',auth[_0xbe14('0x7')](),controller[_0xbe14('0x11')]);router[_0xbe14('0x10')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x12')]);router[_0xbe14('0x10')]('/:id/users',auth['isAuthenticated'](),controller[_0xbe14('0x13')]);router[_0xbe14('0x14')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller['update']);router[_0xbe14('0x16')](_0xbe14('0x15'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x17')]);router[_0xbe14('0x16')](_0xbe14('0xc'),auth[_0xbe14('0x7')](),controller['removeTeams']);router[_0xbe14('0x16')](_0xbe14('0xe'),auth[_0xbe14('0x7')](),controller[_0xbe14('0x18')]);module[_0xbe14('0x19')]=router;
\ No newline at end of file
index 819b0d3..9331309 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb69=['STRING','DATE','moment','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xeb69,0xf7));var _0x9eb6=function(_0x37f7d5,_0x5222e7){_0x37f7d5=_0x37f7d5-0x0;var _0x4aa6d8=_0xeb69[_0x37f7d5];return _0x4aa6d8;};'use strict';var moment=require(_0x9eb6('0x0'));var Sequelize=require(_0x9eb6('0x1'));module[_0x9eb6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x9eb6('0x3')]},'joinAt':{'type':Sequelize[_0x9eb6('0x4')]},'leaveAt':{'type':Sequelize[_0x9eb6('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9eb6('0x4')]},'reason':{'type':Sequelize[_0x9eb6('0x3')]}};
\ No newline at end of file
+var _0x8143=['sequelize','exports','STRING','DATE'];(function(_0x4ee9cd,_0xd375b0){var _0x328a5b=function(_0x3ad1f4){while(--_0x3ad1f4){_0x4ee9cd['push'](_0x4ee9cd['shift']());}};_0x328a5b(++_0xd375b0);}(_0x8143,0x74));var _0x3814=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8143[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require('moment');var Sequelize=require(_0x3814('0x0'));module[_0x3814('0x1')]={'uniqueid':{'type':Sequelize[_0x3814('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x3814('0x2')]},'joinAt':{'type':Sequelize[_0x3814('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x3814('0x3')]},'exitAt':{'type':Sequelize[_0x3814('0x3')]},'reason':{'type':Sequelize[_0x3814('0x2')]}};
\ No newline at end of file
index b122614..8207d3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd47f=['nolimit','order','sort','pick','where','type','merge','options','includeAll','ChatQueueReport','findAll','rows','catch','show','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject','update','destroy','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x3333bd,_0x23cf4c){var _0x5edb96=function(_0x53f786){while(--_0x53f786){_0x3333bd['push'](_0x3333bd['shift']());}};_0x5edb96(++_0x23cf4c);}(_0xd47f,0x1bd));var _0xfd47=function(_0x5a5a98,_0x74f555){_0x5a5a98=_0x5a5a98-0x0;var _0x7d43ef=_0xd47f[_0x5a5a98];return _0x7d43ef;};'use strict';var emlformat=require(_0xfd47('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfd47('0x1'));var jsonpatch=require(_0xfd47('0x2'));var rp=require(_0xfd47('0x3'));var moment=require(_0xfd47('0x4'));var BPromise=require(_0xfd47('0x5'));var Mustache=require(_0xfd47('0x6'));var util=require(_0xfd47('0x7'));var path=require(_0xfd47('0x8'));var sox=require(_0xfd47('0x9'));var csv=require(_0xfd47('0xa'));var ejs=require(_0xfd47('0xb'));var fs=require('fs');var fs_extra=require(_0xfd47('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfd47('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfd47('0xe'));var Papa=require(_0xfd47('0xf'));var Redis=require(_0xfd47('0x10'));var authService=require(_0xfd47('0x11'));var qs=require(_0xfd47('0x12'));var as=require(_0xfd47('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfd47('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfd47('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b01ce,_0x4a1e0c){_0x4a1e0c=_0x4a1e0c||0xcc;return function(_0x1bf3ab){if(_0x1bf3ab){return _0x4b01ce['sendStatus'](_0x4a1e0c);}return _0x4b01ce[_0xfd47('0x16')](_0x4a1e0c)[_0xfd47('0x17')]();};}function respondWithResult(_0x3ada2a,_0x49c00a){_0x49c00a=_0x49c00a||0xc8;return function(_0x1cd77f){if(_0x1cd77f){return _0x3ada2a[_0xfd47('0x16')](_0x49c00a)[_0xfd47('0x18')](_0x1cd77f);}};}function respondWithFilteredResult(_0x24873a,_0x584fe1){return function(_0x791937){if(_0x791937){var _0x1011a3=typeof _0x584fe1[_0xfd47('0x19')]==='undefined'&&typeof _0x584fe1['limit']===_0xfd47('0x1a');var _0xf8e74b=_0x791937[_0xfd47('0x1b')];var _0xf1bbb=_0x1011a3?0x0:_0x584fe1[_0xfd47('0x19')];var _0x4d2d27=_0x1011a3?_0x791937[_0xfd47('0x1b')]:_0x584fe1[_0xfd47('0x19')]+_0x584fe1[_0xfd47('0x1c')];var _0x231106;if(_0x4d2d27>=_0xf8e74b){_0x4d2d27=_0xf8e74b;_0x231106=0xc8;}else{_0x231106=0xce;}_0x24873a[_0xfd47('0x16')](_0x231106);return _0x24873a[_0xfd47('0x1d')]('Content-Range',_0xf1bbb+'-'+_0x4d2d27+'/'+_0xf8e74b)[_0xfd47('0x18')](_0x791937);}return null;};}function patchUpdates(_0x59239c){return function(_0x411680){try{jsonpatch[_0xfd47('0x1e')](_0x411680,_0x59239c,!![]);}catch(_0x4153f6){return BPromise[_0xfd47('0x1f')](_0x4153f6);}return _0x411680['save']();};}function saveUpdates(_0x45e681,_0x29a2dd){return function(_0x943c8a){if(_0x943c8a){return _0x943c8a[_0xfd47('0x20')](_0x45e681)['then'](function(_0x511dbd){return _0x511dbd;});}return null;};}function removeEntity(_0x285f2a,_0xc06999){return function(_0x4395ba){if(_0x4395ba){return _0x4395ba[_0xfd47('0x21')]()[_0xfd47('0x22')](function(){_0x285f2a['status'](0xcc)[_0xfd47('0x17')]();});}};}function handleEntityNotFound(_0x5ca823,_0x48ec3a){return function(_0x26e5fa){if(!_0x26e5fa){_0x5ca823[_0xfd47('0x23')](0x194);}return _0x26e5fa;};}function handleError(_0x2d319a,_0x1905df){_0x1905df=_0x1905df||0x1f4;return function(_0xcce2e3){logger[_0xfd47('0x24')](_0xcce2e3['stack']);if(_0xcce2e3[_0xfd47('0x25')]){delete _0xcce2e3[_0xfd47('0x25')];}_0x2d319a[_0xfd47('0x16')](_0x1905df)[_0xfd47('0x26')](_0xcce2e3);};}exports[_0xfd47('0x27')]=function(_0x4c9a78,_0x120c38){var _0x46c3f8={},_0x3dfd47={},_0x332f6f={'count':0x0,'rows':[]};var _0x1500e9=_[_0xfd47('0x28')](db['ChatQueueReport'][_0xfd47('0x29')],function(_0x3d415b){return{'name':_0x3d415b[_0xfd47('0x2a')],'type':_0x3d415b['type'][_0xfd47('0x2b')]};});_0x3dfd47['model']=_[_0xfd47('0x28')](_0x1500e9,'name');_0x3dfd47[_0xfd47('0x2c')]=_[_0xfd47('0x2d')](_0x4c9a78['query']);_0x3dfd47[_0xfd47('0x2e')]=_[_0xfd47('0x2f')](_0x3dfd47[_0xfd47('0x30')],_0x3dfd47[_0xfd47('0x2c')]);_0x46c3f8[_0xfd47('0x31')]=_[_0xfd47('0x2f')](_0x3dfd47[_0xfd47('0x30')],qs['fields'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x32')]));_0x46c3f8['attributes']=_0x46c3f8[_0xfd47('0x31')][_0xfd47('0x33')]?_0x46c3f8[_0xfd47('0x31')]:_0x3dfd47['model'];if(!_0x4c9a78[_0xfd47('0x2c')]['hasOwnProperty'](_0xfd47('0x34'))){_0x46c3f8[_0xfd47('0x1c')]=qs['limit'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x1c')]);_0x46c3f8[_0xfd47('0x19')]=qs['offset'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x19')]);}_0x46c3f8[_0xfd47('0x35')]=qs['sort'](_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x36')]);_0x46c3f8['where']=qs[_0xfd47('0x2e')](_[_0xfd47('0x37')](_0x4c9a78['query'],_0x3dfd47['filters']),_0x1500e9);if(_0x4c9a78[_0xfd47('0x2c')]['filter']){_0x46c3f8[_0xfd47('0x38')]=_['merge'](_0x46c3f8[_0xfd47('0x38')],{'$or':_[_0xfd47('0x28')](_0x1500e9,function(_0x4b81ab){if(_0x4b81ab[_0xfd47('0x39')]!=='VIRTUAL'){var _0x5db418={};_0x5db418[_0x4b81ab['name']]={'$like':'%'+_0x4c9a78[_0xfd47('0x2c')]['filter']+'%'};return _0x5db418;}})});}_0x46c3f8=_[_0xfd47('0x3a')]({},_0x46c3f8,_0x4c9a78[_0xfd47('0x3b')]);var _0x2c70a8={'where':_0x46c3f8['where']};return db['ChatQueueReport']['count'](_0x2c70a8)[_0xfd47('0x22')](function(_0x420ce0){_0x332f6f[_0xfd47('0x1b')]=_0x420ce0;if(_0x4c9a78[_0xfd47('0x2c')][_0xfd47('0x3c')]){_0x46c3f8['include']=[{'all':!![]}];}return db[_0xfd47('0x3d')][_0xfd47('0x3e')](_0x46c3f8);})[_0xfd47('0x22')](function(_0x22d967){_0x332f6f[_0xfd47('0x3f')]=_0x22d967;return _0x332f6f;})[_0xfd47('0x22')](respondWithFilteredResult(_0x120c38,_0x46c3f8))[_0xfd47('0x40')](handleError(_0x120c38,null));};exports[_0xfd47('0x41')]=function(_0x3aff8f,_0x4158dc){var _0x3c4b7c={'raw':!![],'where':{'id':_0x3aff8f['params']['id']}},_0x11e823={};_0x11e823[_0xfd47('0x30')]=_[_0xfd47('0x2d')](db[_0xfd47('0x3d')][_0xfd47('0x29')]);_0x11e823[_0xfd47('0x2c')]=_[_0xfd47('0x2d')](_0x3aff8f['query']);_0x11e823[_0xfd47('0x2e')]=_[_0xfd47('0x2f')](_0x11e823[_0xfd47('0x30')],_0x11e823['query']);_0x3c4b7c[_0xfd47('0x31')]=_[_0xfd47('0x2f')](_0x11e823[_0xfd47('0x30')],qs[_0xfd47('0x32')](_0x3aff8f[_0xfd47('0x2c')][_0xfd47('0x32')]));_0x3c4b7c[_0xfd47('0x31')]=_0x3c4b7c['attributes'][_0xfd47('0x33')]?_0x3c4b7c[_0xfd47('0x31')]:_0x11e823[_0xfd47('0x30')];if(_0x3aff8f['query'][_0xfd47('0x3c')]){_0x3c4b7c['include']=[{'all':!![]}];}_0x3c4b7c=_[_0xfd47('0x3a')]({},_0x3c4b7c,_0x3aff8f[_0xfd47('0x3b')]);return db['ChatQueueReport'][_0xfd47('0x42')](_0x3c4b7c)[_0xfd47('0x22')](handleEntityNotFound(_0x4158dc,null))[_0xfd47('0x22')](respondWithResult(_0x4158dc,null))[_0xfd47('0x40')](handleError(_0x4158dc,null));};exports['create']=function(_0x9adf23,_0x50e41a){return db['ChatQueueReport'][_0xfd47('0x43')](_0x9adf23[_0xfd47('0x44')],{})['then'](respondWithResult(_0x50e41a,0xc9))[_0xfd47('0x40')](handleError(_0x50e41a,null));};exports[_0xfd47('0x20')]=function(_0x48a995,_0x45ed3f){if(_0x48a995[_0xfd47('0x44')]['id']){delete _0x48a995[_0xfd47('0x44')]['id'];}return db[_0xfd47('0x3d')][_0xfd47('0x42')]({'where':{'id':_0x48a995['params']['id']}})[_0xfd47('0x22')](handleEntityNotFound(_0x45ed3f,null))[_0xfd47('0x22')](saveUpdates(_0x48a995[_0xfd47('0x44')],null))['then'](respondWithResult(_0x45ed3f,null))['catch'](handleError(_0x45ed3f,null));};exports[_0xfd47('0x21')]=function(_0x44df07,_0x56fa32){return db[_0xfd47('0x3d')][_0xfd47('0x42')]({'where':{'id':_0x44df07[_0xfd47('0x45')]['id']}})[_0xfd47('0x22')](handleEntityNotFound(_0x56fa32,null))['then'](removeEntity(_0x56fa32,null))[_0xfd47('0x40')](handleError(_0x56fa32,null));};exports[_0xfd47('0x46')]=function(_0x1bd4ba,_0x5c9bd0){return db[_0xfd47('0x3d')][_0xfd47('0x46')]()['then'](respondWithResult(_0x5c9bd0,null))[_0xfd47('0x40')](handleError(_0x5c9bd0,null));};
\ No newline at end of file
+var _0x0f9f=['then','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','options'];(function(_0x49a15e,_0x1fba32){var _0x19e9b5=function(_0x147e4d){while(--_0x147e4d){_0x49a15e['push'](_0x49a15e['shift']());}};_0x19e9b5(++_0x1fba32);}(_0x0f9f,0xae));var _0xf0f9=function(_0x2ef60e,_0x35c32c){_0x2ef60e=_0x2ef60e-0x0;var _0x3be207=_0x0f9f[_0x2ef60e];return _0x3be207;};'use strict';var emlformat=require(_0xf0f9('0x0'));var rimraf=require(_0xf0f9('0x1'));var zipdir=require(_0xf0f9('0x2'));var jsonpatch=require(_0xf0f9('0x3'));var rp=require(_0xf0f9('0x4'));var moment=require(_0xf0f9('0x5'));var BPromise=require(_0xf0f9('0x6'));var Mustache=require(_0xf0f9('0x7'));var util=require(_0xf0f9('0x8'));var path=require(_0xf0f9('0x9'));var sox=require(_0xf0f9('0xa'));var csv=require('to-csv');var ejs=require(_0xf0f9('0xb'));var fs=require('fs');var fs_extra=require(_0xf0f9('0xc'));var _=require('lodash');var squel=require(_0xf0f9('0xd'));var crypto=require(_0xf0f9('0xe'));var jsforce=require(_0xf0f9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf0f9('0x10'));var querystring=require(_0xf0f9('0x11'));var Papa=require('papaparse');var Redis=require(_0xf0f9('0x12'));var authService=require(_0xf0f9('0x13'));var qs=require(_0xf0f9('0x14'));var as=require(_0xf0f9('0x15'));var hardwareService=require(_0xf0f9('0x16'));var logger=require(_0xf0f9('0x17'))(_0xf0f9('0x18'));var utils=require(_0xf0f9('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xf0f9('0x1a'));var db=require(_0xf0f9('0x1b'))['db'];function respondWithStatusCode(_0xc23039,_0x458e1c){_0x458e1c=_0x458e1c||0xcc;return function(_0x5b0fa7){if(_0x5b0fa7){return _0xc23039[_0xf0f9('0x1c')](_0x458e1c);}return _0xc23039[_0xf0f9('0x1d')](_0x458e1c)['end']();};}function respondWithResult(_0x334c39,_0x519adf){_0x519adf=_0x519adf||0xc8;return function(_0x538864){if(_0x538864){return _0x334c39[_0xf0f9('0x1d')](_0x519adf)['json'](_0x538864);}};}function respondWithFilteredResult(_0x3e1587,_0x516717){return function(_0x3c23ec){if(_0x3c23ec){var _0x336483=typeof _0x516717[_0xf0f9('0x1e')]===_0xf0f9('0x1f')&&typeof _0x516717[_0xf0f9('0x20')]===_0xf0f9('0x1f');var _0x10dae6=_0x3c23ec['count'];var _0x44d248=_0x336483?0x0:_0x516717[_0xf0f9('0x1e')];var _0x43de16=_0x336483?_0x3c23ec[_0xf0f9('0x21')]:_0x516717[_0xf0f9('0x1e')]+_0x516717[_0xf0f9('0x20')];var _0x1765ad;if(_0x43de16>=_0x10dae6){_0x43de16=_0x10dae6;_0x1765ad=0xc8;}else{_0x1765ad=0xce;}_0x3e1587[_0xf0f9('0x1d')](_0x1765ad);return _0x3e1587['set'](_0xf0f9('0x22'),_0x44d248+'-'+_0x43de16+'/'+_0x10dae6)['json'](_0x3c23ec);}return null;};}function patchUpdates(_0x3664ff){return function(_0x510119){try{jsonpatch[_0xf0f9('0x23')](_0x510119,_0x3664ff,!![]);}catch(_0x1d5965){return BPromise[_0xf0f9('0x24')](_0x1d5965);}return _0x510119[_0xf0f9('0x25')]();};}function saveUpdates(_0xaff53c,_0x1b9740){return function(_0x49bddc){if(_0x49bddc){return _0x49bddc[_0xf0f9('0x26')](_0xaff53c)['then'](function(_0x2cb8f8){return _0x2cb8f8;});}return null;};}function removeEntity(_0x21dd05,_0x55ba89){return function(_0x217a15){if(_0x217a15){return _0x217a15[_0xf0f9('0x27')]()['then'](function(){_0x21dd05[_0xf0f9('0x1d')](0xcc)[_0xf0f9('0x28')]();});}};}function handleEntityNotFound(_0xa0b46e,_0x27defc){return function(_0x3ce34a){if(!_0x3ce34a){_0xa0b46e[_0xf0f9('0x1c')](0x194);}return _0x3ce34a;};}function handleError(_0x4c7c7c,_0x1849f0){_0x1849f0=_0x1849f0||0x1f4;return function(_0x4c31f2){logger[_0xf0f9('0x29')](_0x4c31f2[_0xf0f9('0x2a')]);if(_0x4c31f2[_0xf0f9('0x2b')]){delete _0x4c31f2[_0xf0f9('0x2b')];}_0x4c7c7c['status'](_0x1849f0)[_0xf0f9('0x2c')](_0x4c31f2);};}exports[_0xf0f9('0x2d')]=function(_0x477eb0,_0x5a435d){var _0x3bcd66={},_0x1cafc0={},_0x5957b1={'count':0x0,'rows':[]};var _0xfd5593=_['map'](db[_0xf0f9('0x2e')][_0xf0f9('0x2f')],function(_0x280681){return{'name':_0x280681[_0xf0f9('0x30')],'type':_0x280681[_0xf0f9('0x31')][_0xf0f9('0x32')]};});_0x1cafc0[_0xf0f9('0x33')]=_[_0xf0f9('0x34')](_0xfd5593,_0xf0f9('0x2b'));_0x1cafc0[_0xf0f9('0x35')]=_['keys'](_0x477eb0[_0xf0f9('0x35')]);_0x1cafc0[_0xf0f9('0x36')]=_['intersection'](_0x1cafc0['model'],_0x1cafc0[_0xf0f9('0x35')]);_0x3bcd66[_0xf0f9('0x37')]=_[_0xf0f9('0x38')](_0x1cafc0[_0xf0f9('0x33')],qs[_0xf0f9('0x39')](_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x39')]));_0x3bcd66['attributes']=_0x3bcd66[_0xf0f9('0x37')]['length']?_0x3bcd66[_0xf0f9('0x37')]:_0x1cafc0[_0xf0f9('0x33')];if(!_0x477eb0[_0xf0f9('0x35')]['hasOwnProperty'](_0xf0f9('0x3a'))){_0x3bcd66['limit']=qs[_0xf0f9('0x20')](_0x477eb0['query']['limit']);_0x3bcd66[_0xf0f9('0x1e')]=qs[_0xf0f9('0x1e')](_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x1e')]);}_0x3bcd66[_0xf0f9('0x3b')]=qs[_0xf0f9('0x3c')](_0x477eb0['query']['sort']);_0x3bcd66[_0xf0f9('0x3d')]=qs[_0xf0f9('0x36')](_[_0xf0f9('0x3e')](_0x477eb0['query'],_0x1cafc0['filters']),_0xfd5593);if(_0x477eb0[_0xf0f9('0x35')]['filter']){_0x3bcd66[_0xf0f9('0x3d')]=_[_0xf0f9('0x3f')](_0x3bcd66[_0xf0f9('0x3d')],{'$or':_[_0xf0f9('0x34')](_0xfd5593,function(_0x5b19b2){if(_0x5b19b2[_0xf0f9('0x31')]!==_0xf0f9('0x40')){var _0x11ea8f={};_0x11ea8f[_0x5b19b2[_0xf0f9('0x2b')]]={'$like':'%'+_0x477eb0['query']['filter']+'%'};return _0x11ea8f;}})});}_0x3bcd66=_['merge']({},_0x3bcd66,_0x477eb0[_0xf0f9('0x41')]);var _0x458810={'where':_0x3bcd66[_0xf0f9('0x3d')]};return db[_0xf0f9('0x2e')][_0xf0f9('0x21')](_0x458810)[_0xf0f9('0x42')](function(_0xcf598f){_0x5957b1['count']=_0xcf598f;if(_0x477eb0[_0xf0f9('0x35')][_0xf0f9('0x43')]){_0x3bcd66[_0xf0f9('0x44')]=[{'all':!![]}];}return db[_0xf0f9('0x2e')][_0xf0f9('0x45')](_0x3bcd66);})[_0xf0f9('0x42')](function(_0x4eb772){_0x5957b1[_0xf0f9('0x46')]=_0x4eb772;return _0x5957b1;})['then'](respondWithFilteredResult(_0x5a435d,_0x3bcd66))[_0xf0f9('0x47')](handleError(_0x5a435d,null));};exports[_0xf0f9('0x48')]=function(_0x290849,_0x181ed0){var _0x294e57={'raw':!![],'where':{'id':_0x290849[_0xf0f9('0x49')]['id']}},_0x574364={};_0x574364['model']=_[_0xf0f9('0x4a')](db[_0xf0f9('0x2e')][_0xf0f9('0x2f')]);_0x574364[_0xf0f9('0x35')]=_[_0xf0f9('0x4a')](_0x290849[_0xf0f9('0x35')]);_0x574364['filters']=_[_0xf0f9('0x38')](_0x574364[_0xf0f9('0x33')],_0x574364[_0xf0f9('0x35')]);_0x294e57['attributes']=_[_0xf0f9('0x38')](_0x574364['model'],qs[_0xf0f9('0x39')](_0x290849['query']['fields']));_0x294e57['attributes']=_0x294e57['attributes'][_0xf0f9('0x4b')]?_0x294e57['attributes']:_0x574364[_0xf0f9('0x33')];if(_0x290849[_0xf0f9('0x35')]['includeAll']){_0x294e57[_0xf0f9('0x44')]=[{'all':!![]}];}_0x294e57=_[_0xf0f9('0x3f')]({},_0x294e57,_0x290849[_0xf0f9('0x41')]);return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')](_0x294e57)['then'](handleEntityNotFound(_0x181ed0,null))[_0xf0f9('0x42')](respondWithResult(_0x181ed0,null))[_0xf0f9('0x47')](handleError(_0x181ed0,null));};exports[_0xf0f9('0x4d')]=function(_0x3512d5,_0x5601ca){return db[_0xf0f9('0x2e')][_0xf0f9('0x4d')](_0x3512d5[_0xf0f9('0x4e')],{})[_0xf0f9('0x42')](respondWithResult(_0x5601ca,0xc9))[_0xf0f9('0x47')](handleError(_0x5601ca,null));};exports[_0xf0f9('0x26')]=function(_0x3dd389,_0x299cec){if(_0x3dd389[_0xf0f9('0x4e')]['id']){delete _0x3dd389[_0xf0f9('0x4e')]['id'];}return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')]({'where':{'id':_0x3dd389['params']['id']}})[_0xf0f9('0x42')](handleEntityNotFound(_0x299cec,null))[_0xf0f9('0x42')](saveUpdates(_0x3dd389[_0xf0f9('0x4e')],null))['then'](respondWithResult(_0x299cec,null))[_0xf0f9('0x47')](handleError(_0x299cec,null));};exports[_0xf0f9('0x27')]=function(_0xa003e7,_0x1fe3b7){return db[_0xf0f9('0x2e')][_0xf0f9('0x4c')]({'where':{'id':_0xa003e7[_0xf0f9('0x49')]['id']}})[_0xf0f9('0x42')](handleEntityNotFound(_0x1fe3b7,null))['then'](removeEntity(_0x1fe3b7,null))[_0xf0f9('0x47')](handleError(_0x1fe3b7,null));};exports[_0xf0f9('0x4f')]=function(_0x5d3756,_0x56c5e8){return db[_0xf0f9('0x2e')][_0xf0f9('0x4f')]()[_0xf0f9('0x42')](respondWithResult(_0x56c5e8,null))['catch'](handleError(_0x56c5e8,null));};
\ No newline at end of file
index fbfbdfb..2af0748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x15d032,_0x14f9f2){var _0x36cff2=function(_0x1411e1){while(--_0x1411e1){_0x15d032['push'](_0x15d032['shift']());}};_0x36cff2(++_0x14f9f2);}(_0xb7e7,0x121));var _0x7b7e=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xb7e7[_0x342700];return _0x53406f;};'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':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x49beea,_0x47add1){var _0x27693a=function(_0x192ed8){while(--_0x192ed8){_0x49beea['push'](_0x49beea['shift']());}};_0x27693a(++_0x47add1);}(_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':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index b202a2e..b51faa5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d78=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateChatQueueReport','create','body','options','then','stringify','catch','UpdateChatQueueReport','ChatQueueReport','where','limit','util','bluebird','randomstring','ioredis'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0x3d78,0x19c));var _0x83d7=function(_0xabfca,_0x57d1d2){_0xabfca=_0xabfca-0x0;var _0x2a77e6=_0x3d78[_0xabfca];return _0x2a77e6;};'use strict';var _=require('lodash');var util=require(_0x83d7('0x0'));var moment=require('moment');var BPromise=require(_0x83d7('0x1'));var rs=require(_0x83d7('0x2'));var fs=require('fs');var Redis=require(_0x83d7('0x3'));var db=require(_0x83d7('0x4'))['db'];var utils=require(_0x83d7('0x5'));var logger=require(_0x83d7('0x6'))(_0x83d7('0x7'));var config=require(_0x83d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x83d7('0x9')][_0x83d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26838e,_0x3e49ac,_0x41b681){return new BPromise(function(_0x302012,_0x5ce2e0){return client[_0x83d7('0xb')](_0x26838e,_0x41b681)['then'](function(_0x1c49cc){logger[_0x83d7('0xc')](_0x83d7('0xd'),_0x3e49ac,_0x83d7('0xe'));logger[_0x83d7('0xf')](_0x83d7('0x10'),_0x3e49ac,_0x83d7('0xe'),JSON['stringify'](_0x1c49cc));if(_0x1c49cc[_0x83d7('0x11')]){if(_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x12')]===0x1f4){logger['error'](_0x83d7('0xd'),_0x3e49ac,_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);return _0x5ce2e0(_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);}logger[_0x83d7('0x11')](_0x83d7('0xd'),_0x3e49ac,_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);return _0x302012(_0x1c49cc[_0x83d7('0x11')][_0x83d7('0x13')]);}else{logger[_0x83d7('0xc')](_0x83d7('0xd'),_0x3e49ac,_0x83d7('0xe'));_0x302012(_0x1c49cc[_0x83d7('0x14')][_0x83d7('0x13')]);}})['catch'](function(_0x4152f3){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3e49ac,_0x4152f3);_0x5ce2e0(_0x4152f3);});});}exports[_0x83d7('0x15')]=function(_0x2b2b92){var _0x573b4c=this;return new Promise(function(_0x15b6e1,_0x5e415a){return db['ChatQueueReport'][_0x83d7('0x16')](_0x2b2b92[_0x83d7('0x17')],{'raw':_0x2b2b92[_0x83d7('0x18')]?_0x2b2b92[_0x83d7('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x83d7('0x19')](function(_0x5b35b2){logger['info'](_0x83d7('0x15'),_0x2b2b92);logger[_0x83d7('0xf')]('CreateChatQueueReport',_0x2b2b92,JSON[_0x83d7('0x1a')](_0x5b35b2));_0x15b6e1(_0x5b35b2);})[_0x83d7('0x1b')](function(_0x3ba37f){logger[_0x83d7('0x11')](_0x83d7('0x15'),_0x3ba37f['message'],_0x2b2b92);_0x5e415a(_0x573b4c[_0x83d7('0x11')](0x1f4,_0x3ba37f[_0x83d7('0x13')]));});});};exports[_0x83d7('0x1c')]=function(_0x450f74){var _0x20d80b=this;return new Promise(function(_0x203eec,_0x1a6bac){return db[_0x83d7('0x1d')]['update'](_0x450f74['body'],{'raw':_0x450f74[_0x83d7('0x18')]?_0x450f74['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x450f74[_0x83d7('0x18')]?_0x450f74[_0x83d7('0x18')][_0x83d7('0x1e')]||null:null,'attributes':_0x450f74[_0x83d7('0x18')]?_0x450f74[_0x83d7('0x18')]['attributes']||null:null,'limit':_0x450f74['options']?_0x450f74[_0x83d7('0x18')][_0x83d7('0x1f')]||null:null})[_0x83d7('0x19')](function(_0x3bc202){logger[_0x83d7('0xc')](_0x83d7('0x1c'),_0x450f74);logger['debug']('UpdateChatQueueReport',_0x450f74,JSON[_0x83d7('0x1a')](_0x3bc202));_0x203eec(_0x3bc202);})['catch'](function(_0x399f3d){logger[_0x83d7('0x11')](_0x83d7('0x1c'),_0x399f3d[_0x83d7('0x13')],_0x450f74);_0x1a6bac(_0x20d80b['error'](0x1f4,_0x399f3d[_0x83d7('0x13')]));});});};
\ No newline at end of file
+var _0x813c=['attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','body','options','raw','debug','UpdateChatQueueReport','update','where'];(function(_0x23db19,_0x4ac567){var _0x3becef=function(_0x14a37b){while(--_0x14a37b){_0x23db19['push'](_0x23db19['shift']());}};_0x3becef(++_0x4ac567);}(_0x813c,0x169));var _0xc813=function(_0x20ab23,_0x516530){_0x20ab23=_0x20ab23-0x0;var _0x44dc5a=_0x813c[_0x20ab23];return _0x44dc5a;};'use strict';var _=require('lodash');var util=require(_0xc813('0x0'));var moment=require(_0xc813('0x1'));var BPromise=require(_0xc813('0x2'));var rs=require(_0xc813('0x3'));var fs=require('fs');var Redis=require(_0xc813('0x4'));var db=require(_0xc813('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc813('0x6'))(_0xc813('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc813('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26833c,_0x362188,_0x1e5706){return new BPromise(function(_0x327468,_0x352385){return client[_0xc813('0x9')](_0x26833c,_0x1e5706)[_0xc813('0xa')](function(_0x4cd271){logger[_0xc813('0xb')](_0xc813('0xc'),_0x362188,_0xc813('0xd'));logger['debug'](_0xc813('0xe'),_0x362188,_0xc813('0xd'),JSON[_0xc813('0xf')](_0x4cd271));if(_0x4cd271[_0xc813('0x10')]){if(_0x4cd271[_0xc813('0x10')][_0xc813('0x11')]===0x1f4){logger['error'](_0xc813('0xc'),_0x362188,_0x4cd271[_0xc813('0x10')]['message']);return _0x352385(_0x4cd271[_0xc813('0x10')]['message']);}logger[_0xc813('0x10')](_0xc813('0xc'),_0x362188,_0x4cd271[_0xc813('0x10')][_0xc813('0x12')]);return _0x327468(_0x4cd271[_0xc813('0x10')]['message']);}else{logger[_0xc813('0xb')](_0xc813('0xc'),_0x362188,'request\x20sent');_0x327468(_0x4cd271[_0xc813('0x13')][_0xc813('0x12')]);}})[_0xc813('0x14')](function(_0x21282c){logger[_0xc813('0x10')]('ChatQueueReport,\x20%s,\x20%s',_0x362188,_0x21282c);_0x352385(_0x21282c);});});}exports[_0xc813('0x15')]=function(_0x1fc7ce){var _0xdb8fdf=this;return new Promise(function(_0x255296,_0x376c84){return db['ChatQueueReport']['create'](_0x1fc7ce[_0xc813('0x16')],{'raw':_0x1fc7ce[_0xc813('0x17')]?_0x1fc7ce[_0xc813('0x17')][_0xc813('0x18')]===undefined?!![]:![]:!![]})[_0xc813('0xa')](function(_0x2ecc79){logger[_0xc813('0xb')]('CreateChatQueueReport',_0x1fc7ce);logger[_0xc813('0x19')](_0xc813('0x15'),_0x1fc7ce,JSON[_0xc813('0xf')](_0x2ecc79));_0x255296(_0x2ecc79);})['catch'](function(_0x1f8d81){logger[_0xc813('0x10')](_0xc813('0x15'),_0x1f8d81[_0xc813('0x12')],_0x1fc7ce);_0x376c84(_0xdb8fdf[_0xc813('0x10')](0x1f4,_0x1f8d81['message']));});});};exports[_0xc813('0x1a')]=function(_0x14d351){var _0x18fbad=this;return new Promise(function(_0x1b3596,_0x49be2e){return db['ChatQueueReport'][_0xc813('0x1b')](_0x14d351['body'],{'raw':_0x14d351[_0xc813('0x17')]?_0x14d351[_0xc813('0x17')][_0xc813('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14d351['options']?_0x14d351[_0xc813('0x17')][_0xc813('0x1c')]||null:null,'attributes':_0x14d351['options']?_0x14d351[_0xc813('0x17')][_0xc813('0x1d')]||null:null,'limit':_0x14d351[_0xc813('0x17')]?_0x14d351['options']['limit']||null:null})[_0xc813('0xa')](function(_0x3a7798){logger[_0xc813('0xb')](_0xc813('0x1a'),_0x14d351);logger[_0xc813('0x19')](_0xc813('0x1a'),_0x14d351,JSON['stringify'](_0x3a7798));_0x1b3596(_0x3a7798);})[_0xc813('0x14')](function(_0x137f57){logger[_0xc813('0x10')](_0xc813('0x1a'),_0x137f57[_0xc813('0x12')],_0x14d351);_0x49be2e(_0x18fbad[_0xc813('0x10')](0x1f4,_0x137f57[_0xc813('0x12')]));});});};
\ No newline at end of file
index 1b75a3e..1878428 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ad9=['/describe','describe','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x3ad9,0xc2));var _0x93ad=function(_0x585d09,_0x1274bc){_0x585d09=_0x585d09-0x0;var _0x7d9a14=_0x3ad9[_0x585d09];return _0x7d9a14;};'use strict';var multer=require(_0x93ad('0x0'));var util=require('util');var path=require(_0x93ad('0x1'));var timeout=require(_0x93ad('0x2'));var express=require(_0x93ad('0x3'));var router=express[_0x93ad('0x4')]();var fs_extra=require(_0x93ad('0x5'));var auth=require(_0x93ad('0x6'));var interaction=require(_0x93ad('0x7'));var config=require(_0x93ad('0x8'));var controller=require(_0x93ad('0x9'));router[_0x93ad('0xa')]('/',auth[_0x93ad('0xb')](),controller[_0x93ad('0xc')]);router[_0x93ad('0xa')](_0x93ad('0xd'),auth[_0x93ad('0xb')](),controller[_0x93ad('0xe')]);router[_0x93ad('0xa')](_0x93ad('0xf'),auth[_0x93ad('0xb')](),controller[_0x93ad('0x10')]);router[_0x93ad('0x11')]('/',auth[_0x93ad('0xb')](),controller[_0x93ad('0x12')]);router[_0x93ad('0x13')]('/:id',auth[_0x93ad('0xb')](),controller[_0x93ad('0x14')]);router[_0x93ad('0x15')](_0x93ad('0xf'),auth[_0x93ad('0xb')](),controller['destroy']);module[_0x93ad('0x16')]=router;
\ No newline at end of file
+var _0xf974=['exports','path','Router','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3e2c1e,_0x1e8d40){var _0x1c6666=function(_0x190b73){while(--_0x190b73){_0x3e2c1e['push'](_0x3e2c1e['shift']());}};_0x1c6666(++_0x1e8d40);}(_0xf974,0xab));var _0x4f97=function(_0x464b63,_0x3b71a4){_0x464b63=_0x464b63-0x0;var _0xdb1776=_0xf974[_0x464b63];return _0xdb1776;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4f97('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4f97('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4f97('0x2'));var config=require('../../config/environment');var controller=require(_0x4f97('0x3'));router[_0x4f97('0x4')]('/',auth[_0x4f97('0x5')](),controller[_0x4f97('0x6')]);router[_0x4f97('0x4')](_0x4f97('0x7'),auth[_0x4f97('0x5')](),controller['describe']);router[_0x4f97('0x4')](_0x4f97('0x8'),auth[_0x4f97('0x5')](),controller[_0x4f97('0x9')]);router[_0x4f97('0xa')]('/',auth[_0x4f97('0x5')](),controller[_0x4f97('0xb')]);router[_0x4f97('0xc')](_0x4f97('0x8'),auth['isAuthenticated'](),controller[_0x4f97('0xd')]);router[_0x4f97('0xe')](_0x4f97('0x8'),auth[_0x4f97('0x5')](),controller[_0x4f97('0xf')]);module[_0x4f97('0x10')]=router;
\ No newline at end of file
index 35ec973..a294b23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x1bbd88,_0x54005f){var _0x1fd440=function(_0x356391){while(--_0x356391){_0x1bbd88['push'](_0x1bbd88['shift']());}};_0x1fd440(++_0x54005f);}(_0x70e0,0x17b));var _0x070e=function(_0x35213f,_0x1a4a25){_0x35213f=_0x35213f-0x0;var _0xfedb93=_0x70e0[_0x35213f];return _0xfedb93;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x468d16,_0x17ece7){var _0x55850a=function(_0x4326e2){while(--_0x4326e2){_0x468d16['push'](_0x468d16['shift']());}};_0x55850a(++_0x17ece7);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0xf3cd[_0x49e584];return _0x58b1be;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index bb7db05..86c889c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f76=['count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','ChatTransferReport','findAll','rows','show','params','intersection','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x3c977c,_0x301239){var _0x3a257b=function(_0x46c33c){while(--_0x46c33c){_0x3c977c['push'](_0x3c977c['shift']());}};_0x3a257b(++_0x301239);}(_0x7f76,0x1e0));var _0x67f7=function(_0x3c4919,_0x3c3201){_0x3c4919=_0x3c4919-0x0;var _0x29b5f6=_0x7f76[_0x3c4919];return _0x29b5f6;};'use strict';var emlformat=require(_0x67f7('0x0'));var rimraf=require(_0x67f7('0x1'));var zipdir=require(_0x67f7('0x2'));var jsonpatch=require(_0x67f7('0x3'));var rp=require(_0x67f7('0x4'));var moment=require(_0x67f7('0x5'));var BPromise=require(_0x67f7('0x6'));var Mustache=require(_0x67f7('0x7'));var util=require('util');var path=require(_0x67f7('0x8'));var sox=require(_0x67f7('0x9'));var csv=require('to-csv');var ejs=require(_0x67f7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x67f7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x67f7('0xc'));var deskjs=require(_0x67f7('0xd'));var toCsv=require(_0x67f7('0xe'));var querystring=require(_0x67f7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x67f7('0x10'));var as=require(_0x67f7('0x11'));var hardwareService=require(_0x67f7('0x12'));var logger=require(_0x67f7('0x13'))(_0x67f7('0x14'));var utils=require(_0x67f7('0x15'));var config=require(_0x67f7('0x16'));var licenseUtil=require(_0x67f7('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x371fd2,_0x2af5c8){_0x2af5c8=_0x2af5c8||0xcc;return function(_0x355f3e){if(_0x355f3e){return _0x371fd2[_0x67f7('0x18')](_0x2af5c8);}return _0x371fd2[_0x67f7('0x19')](_0x2af5c8)[_0x67f7('0x1a')]();};}function respondWithResult(_0x510504,_0x478170){_0x478170=_0x478170||0xc8;return function(_0x43887b){if(_0x43887b){return _0x510504['status'](_0x478170)[_0x67f7('0x1b')](_0x43887b);}};}function respondWithFilteredResult(_0x2a26f5,_0x4bf7b5){return function(_0x12328c){if(_0x12328c){var _0xd5274a=typeof _0x4bf7b5[_0x67f7('0x1c')]==='undefined'&&typeof _0x4bf7b5[_0x67f7('0x1d')]===_0x67f7('0x1e');var _0xcc8a99=_0x12328c[_0x67f7('0x1f')];var _0x5d909b=_0xd5274a?0x0:_0x4bf7b5[_0x67f7('0x1c')];var _0x1c6ea4=_0xd5274a?_0x12328c[_0x67f7('0x1f')]:_0x4bf7b5['offset']+_0x4bf7b5['limit'];var _0x2dd817;if(_0x1c6ea4>=_0xcc8a99){_0x1c6ea4=_0xcc8a99;_0x2dd817=0xc8;}else{_0x2dd817=0xce;}_0x2a26f5[_0x67f7('0x19')](_0x2dd817);return _0x2a26f5[_0x67f7('0x20')](_0x67f7('0x21'),_0x5d909b+'-'+_0x1c6ea4+'/'+_0xcc8a99)[_0x67f7('0x1b')](_0x12328c);}return null;};}function patchUpdates(_0x320fea){return function(_0x5290e5){try{jsonpatch[_0x67f7('0x22')](_0x5290e5,_0x320fea,!![]);}catch(_0x26ffba){return BPromise[_0x67f7('0x23')](_0x26ffba);}return _0x5290e5[_0x67f7('0x24')]();};}function saveUpdates(_0x503004,_0x2233b5){return function(_0x2bf951){if(_0x2bf951){return _0x2bf951[_0x67f7('0x25')](_0x503004)[_0x67f7('0x26')](function(_0x10f6ab){return _0x10f6ab;});}return null;};}function removeEntity(_0x3e961c,_0x1e8a33){return function(_0x43271e){if(_0x43271e){return _0x43271e[_0x67f7('0x27')]()['then'](function(){_0x3e961c[_0x67f7('0x19')](0xcc)[_0x67f7('0x1a')]();});}};}function handleEntityNotFound(_0x1ee876,_0xe99d22){return function(_0x127bbc){if(!_0x127bbc){_0x1ee876[_0x67f7('0x18')](0x194);}return _0x127bbc;};}function handleError(_0x2a95bc,_0x1da853){_0x1da853=_0x1da853||0x1f4;return function(_0x19d955){logger['error'](_0x19d955['stack']);if(_0x19d955[_0x67f7('0x28')]){delete _0x19d955[_0x67f7('0x28')];}_0x2a95bc[_0x67f7('0x19')](_0x1da853)[_0x67f7('0x29')](_0x19d955);};}exports[_0x67f7('0x2a')]=function(_0x177294,_0xe27fbf){var _0x1617e6={},_0x5835a5={},_0x3c12d9={'count':0x0,'rows':[]};var _0x55d511=_[_0x67f7('0x2b')](db['ChatTransferReport'][_0x67f7('0x2c')],function(_0x5a9b9c){return{'name':_0x5a9b9c[_0x67f7('0x2d')],'type':_0x5a9b9c[_0x67f7('0x2e')]['key']};});_0x5835a5[_0x67f7('0x2f')]=_['map'](_0x55d511,'name');_0x5835a5[_0x67f7('0x30')]=_[_0x67f7('0x31')](_0x177294[_0x67f7('0x30')]);_0x5835a5['filters']=_['intersection'](_0x5835a5['model'],_0x5835a5[_0x67f7('0x30')]);_0x1617e6[_0x67f7('0x32')]=_['intersection'](_0x5835a5[_0x67f7('0x2f')],qs[_0x67f7('0x33')](_0x177294['query'][_0x67f7('0x33')]));_0x1617e6[_0x67f7('0x32')]=_0x1617e6[_0x67f7('0x32')][_0x67f7('0x34')]?_0x1617e6[_0x67f7('0x32')]:_0x5835a5[_0x67f7('0x2f')];if(!_0x177294['query'][_0x67f7('0x35')](_0x67f7('0x36'))){_0x1617e6[_0x67f7('0x1d')]=qs[_0x67f7('0x1d')](_0x177294[_0x67f7('0x30')][_0x67f7('0x1d')]);_0x1617e6[_0x67f7('0x1c')]=qs[_0x67f7('0x1c')](_0x177294[_0x67f7('0x30')]['offset']);}_0x1617e6[_0x67f7('0x37')]=qs[_0x67f7('0x38')](_0x177294[_0x67f7('0x30')][_0x67f7('0x38')]);_0x1617e6[_0x67f7('0x39')]=qs['filters'](_[_0x67f7('0x3a')](_0x177294['query'],_0x5835a5[_0x67f7('0x3b')]),_0x55d511);if(_0x177294['query']['filter']){_0x1617e6['where']=_[_0x67f7('0x3c')](_0x1617e6['where'],{'$or':_['map'](_0x55d511,function(_0x97f7a1){if(_0x97f7a1[_0x67f7('0x2e')]!=='VIRTUAL'){var _0x48758f={};_0x48758f[_0x97f7a1[_0x67f7('0x28')]]={'$like':'%'+_0x177294['query']['filter']+'%'};return _0x48758f;}})});}_0x1617e6=_[_0x67f7('0x3c')]({},_0x1617e6,_0x177294['options']);var _0x557b37={'where':_0x1617e6[_0x67f7('0x39')]};return db[_0x67f7('0x3d')]['count'](_0x557b37)[_0x67f7('0x26')](function(_0x40d22f){_0x3c12d9[_0x67f7('0x1f')]=_0x40d22f;if(_0x177294[_0x67f7('0x30')]['includeAll']){_0x1617e6['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0x67f7('0x3e')](_0x1617e6);})[_0x67f7('0x26')](function(_0x30f8c0){_0x3c12d9[_0x67f7('0x3f')]=_0x30f8c0;return _0x3c12d9;})[_0x67f7('0x26')](respondWithFilteredResult(_0xe27fbf,_0x1617e6))['catch'](handleError(_0xe27fbf,null));};exports[_0x67f7('0x40')]=function(_0x2491bd,_0x502c43){var _0x2fb9c8={'raw':!![],'where':{'id':_0x2491bd[_0x67f7('0x41')]['id']}},_0x2260b3={};_0x2260b3[_0x67f7('0x2f')]=_[_0x67f7('0x31')](db[_0x67f7('0x3d')][_0x67f7('0x2c')]);_0x2260b3['query']=_[_0x67f7('0x31')](_0x2491bd[_0x67f7('0x30')]);_0x2260b3[_0x67f7('0x3b')]=_[_0x67f7('0x42')](_0x2260b3['model'],_0x2260b3[_0x67f7('0x30')]);_0x2fb9c8[_0x67f7('0x32')]=_['intersection'](_0x2260b3[_0x67f7('0x2f')],qs['fields'](_0x2491bd[_0x67f7('0x30')][_0x67f7('0x33')]));_0x2fb9c8[_0x67f7('0x32')]=_0x2fb9c8[_0x67f7('0x32')][_0x67f7('0x34')]?_0x2fb9c8[_0x67f7('0x32')]:_0x2260b3[_0x67f7('0x2f')];if(_0x2491bd[_0x67f7('0x30')]['includeAll']){_0x2fb9c8[_0x67f7('0x43')]=[{'all':!![]}];}_0x2fb9c8=_[_0x67f7('0x3c')]({},_0x2fb9c8,_0x2491bd['options']);return db['ChatTransferReport'][_0x67f7('0x44')](_0x2fb9c8)['then'](handleEntityNotFound(_0x502c43,null))[_0x67f7('0x26')](respondWithResult(_0x502c43,null))[_0x67f7('0x45')](handleError(_0x502c43,null));};exports[_0x67f7('0x46')]=function(_0xcdde4f,_0x462bfb){return db[_0x67f7('0x3d')][_0x67f7('0x46')](_0xcdde4f[_0x67f7('0x47')],{})['then'](respondWithResult(_0x462bfb,0xc9))[_0x67f7('0x45')](handleError(_0x462bfb,null));};exports['update']=function(_0x1ae6b8,_0xe843a1){if(_0x1ae6b8[_0x67f7('0x47')]['id']){delete _0x1ae6b8[_0x67f7('0x47')]['id'];}return db['ChatTransferReport'][_0x67f7('0x44')]({'where':{'id':_0x1ae6b8[_0x67f7('0x41')]['id']}})['then'](handleEntityNotFound(_0xe843a1,null))[_0x67f7('0x26')](saveUpdates(_0x1ae6b8['body'],null))[_0x67f7('0x26')](respondWithResult(_0xe843a1,null))[_0x67f7('0x45')](handleError(_0xe843a1,null));};exports[_0x67f7('0x27')]=function(_0xaa1cfd,_0x56fe29){return db[_0x67f7('0x3d')][_0x67f7('0x44')]({'where':{'id':_0xaa1cfd['params']['id']}})[_0x67f7('0x26')](handleEntityNotFound(_0x56fe29,null))['then'](removeEntity(_0x56fe29,null))[_0x67f7('0x45')](handleError(_0x56fe29,null));};exports[_0x67f7('0x48')]=function(_0x386763,_0x5f0a41){return db[_0x67f7('0x3d')][_0x67f7('0x48')]()['then'](respondWithResult(_0x5f0a41,null))[_0x67f7('0x45')](handleError(_0x5f0a41,null));};
\ No newline at end of file
+var _0x672e=['pick','where','findAll','show','params','keys','length','includeAll','include','merge','catch','create','body','find','describe','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','ChatTransferReport','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x5ed068,_0x470a7c){var _0x141d2d=function(_0x32ce1a){while(--_0x32ce1a){_0x5ed068['push'](_0x5ed068['shift']());}};_0x141d2d(++_0x470a7c);}(_0x672e,0x9b));var _0xe672=function(_0x39bab8,_0x23d6c2){_0x39bab8=_0x39bab8-0x0;var _0x14ade4=_0x672e[_0x39bab8];return _0x14ade4;};'use strict';var emlformat=require(_0xe672('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe672('0x1'));var moment=require('moment');var BPromise=require(_0xe672('0x2'));var Mustache=require(_0xe672('0x3'));var util=require(_0xe672('0x4'));var path=require(_0xe672('0x5'));var sox=require(_0xe672('0x6'));var csv=require(_0xe672('0x7'));var ejs=require(_0xe672('0x8'));var fs=require('fs');var fs_extra=require(_0xe672('0x9'));var _=require(_0xe672('0xa'));var squel=require(_0xe672('0xb'));var crypto=require(_0xe672('0xc'));var jsforce=require(_0xe672('0xd'));var deskjs=require(_0xe672('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe672('0xf'));var Papa=require(_0xe672('0x10'));var Redis=require(_0xe672('0x11'));var authService=require(_0xe672('0x12'));var qs=require(_0xe672('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe672('0x14'));var logger=require(_0xe672('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x262924,_0x4fec67){_0x4fec67=_0x4fec67||0xcc;return function(_0x19f156){if(_0x19f156){return _0x262924[_0xe672('0x16')](_0x4fec67);}return _0x262924[_0xe672('0x17')](_0x4fec67)[_0xe672('0x18')]();};}function respondWithResult(_0x453b01,_0x30d7d5){_0x30d7d5=_0x30d7d5||0xc8;return function(_0x38f394){if(_0x38f394){return _0x453b01[_0xe672('0x17')](_0x30d7d5)['json'](_0x38f394);}};}function respondWithFilteredResult(_0x5df333,_0x716626){return function(_0x7bdb4d){if(_0x7bdb4d){var _0x5c60fd=typeof _0x716626[_0xe672('0x19')]===_0xe672('0x1a')&&typeof _0x716626[_0xe672('0x1b')]==='undefined';var _0x369578=_0x7bdb4d[_0xe672('0x1c')];var _0x584433=_0x5c60fd?0x0:_0x716626[_0xe672('0x19')];var _0x1883da=_0x5c60fd?_0x7bdb4d['count']:_0x716626[_0xe672('0x19')]+_0x716626[_0xe672('0x1b')];var _0x400a01;if(_0x1883da>=_0x369578){_0x1883da=_0x369578;_0x400a01=0xc8;}else{_0x400a01=0xce;}_0x5df333['status'](_0x400a01);return _0x5df333[_0xe672('0x1d')](_0xe672('0x1e'),_0x584433+'-'+_0x1883da+'/'+_0x369578)[_0xe672('0x1f')](_0x7bdb4d);}return null;};}function patchUpdates(_0x18380c){return function(_0x500cdf){try{jsonpatch[_0xe672('0x20')](_0x500cdf,_0x18380c,!![]);}catch(_0x459a16){return BPromise['reject'](_0x459a16);}return _0x500cdf[_0xe672('0x21')]();};}function saveUpdates(_0x11afff,_0x589628){return function(_0xfe1057){if(_0xfe1057){return _0xfe1057['update'](_0x11afff)[_0xe672('0x22')](function(_0x15db50){return _0x15db50;});}return null;};}function removeEntity(_0x41f14a,_0x17f439){return function(_0xade1c1){if(_0xade1c1){return _0xade1c1[_0xe672('0x23')]()[_0xe672('0x22')](function(){_0x41f14a['status'](0xcc)[_0xe672('0x18')]();});}};}function handleEntityNotFound(_0x3cd974,_0x414e5e){return function(_0x5a93f7){if(!_0x5a93f7){_0x3cd974[_0xe672('0x16')](0x194);}return _0x5a93f7;};}function handleError(_0x36df39,_0x45e3c5){_0x45e3c5=_0x45e3c5||0x1f4;return function(_0xd03513){logger[_0xe672('0x24')](_0xd03513[_0xe672('0x25')]);if(_0xd03513[_0xe672('0x26')]){delete _0xd03513['name'];}_0x36df39['status'](_0x45e3c5)[_0xe672('0x27')](_0xd03513);};}exports[_0xe672('0x28')]=function(_0x36f1b4,_0x2ea55b){var _0x52af5b={},_0x4b8595={},_0x5f2f83={'count':0x0,'rows':[]};var _0x47190d=_[_0xe672('0x29')](db[_0xe672('0x2a')]['rawAttributes'],function(_0x214133){return{'name':_0x214133[_0xe672('0x2b')],'type':_0x214133[_0xe672('0x2c')]['key']};});_0x4b8595[_0xe672('0x2d')]=_[_0xe672('0x29')](_0x47190d,'name');_0x4b8595[_0xe672('0x2e')]=_['keys'](_0x36f1b4[_0xe672('0x2e')]);_0x4b8595[_0xe672('0x2f')]=_[_0xe672('0x30')](_0x4b8595[_0xe672('0x2d')],_0x4b8595[_0xe672('0x2e')]);_0x52af5b[_0xe672('0x31')]=_[_0xe672('0x30')](_0x4b8595[_0xe672('0x2d')],qs[_0xe672('0x32')](_0x36f1b4[_0xe672('0x2e')]['fields']));_0x52af5b[_0xe672('0x31')]=_0x52af5b[_0xe672('0x31')]['length']?_0x52af5b[_0xe672('0x31')]:_0x4b8595['model'];if(!_0x36f1b4['query'][_0xe672('0x33')](_0xe672('0x34'))){_0x52af5b[_0xe672('0x1b')]=qs[_0xe672('0x1b')](_0x36f1b4['query'][_0xe672('0x1b')]);_0x52af5b[_0xe672('0x19')]=qs['offset'](_0x36f1b4[_0xe672('0x2e')]['offset']);}_0x52af5b[_0xe672('0x35')]=qs[_0xe672('0x36')](_0x36f1b4['query'][_0xe672('0x36')]);_0x52af5b['where']=qs[_0xe672('0x2f')](_[_0xe672('0x37')](_0x36f1b4[_0xe672('0x2e')],_0x4b8595['filters']),_0x47190d);if(_0x36f1b4[_0xe672('0x2e')]['filter']){_0x52af5b[_0xe672('0x38')]=_['merge'](_0x52af5b[_0xe672('0x38')],{'$or':_[_0xe672('0x29')](_0x47190d,function(_0x52b0cd){if(_0x52b0cd[_0xe672('0x2c')]!=='VIRTUAL'){var _0x593b2e={};_0x593b2e[_0x52b0cd['name']]={'$like':'%'+_0x36f1b4[_0xe672('0x2e')]['filter']+'%'};return _0x593b2e;}})});}_0x52af5b=_['merge']({},_0x52af5b,_0x36f1b4['options']);var _0x5e5967={'where':_0x52af5b[_0xe672('0x38')]};return db[_0xe672('0x2a')][_0xe672('0x1c')](_0x5e5967)[_0xe672('0x22')](function(_0xdfa0f6){_0x5f2f83[_0xe672('0x1c')]=_0xdfa0f6;if(_0x36f1b4[_0xe672('0x2e')]['includeAll']){_0x52af5b['include']=[{'all':!![]}];}return db[_0xe672('0x2a')][_0xe672('0x39')](_0x52af5b);})[_0xe672('0x22')](function(_0x4c5346){_0x5f2f83['rows']=_0x4c5346;return _0x5f2f83;})[_0xe672('0x22')](respondWithFilteredResult(_0x2ea55b,_0x52af5b))['catch'](handleError(_0x2ea55b,null));};exports[_0xe672('0x3a')]=function(_0x2ad1e5,_0x30d2a5){var _0x44d69c={'raw':!![],'where':{'id':_0x2ad1e5[_0xe672('0x3b')]['id']}},_0x4f3bf3={};_0x4f3bf3[_0xe672('0x2d')]=_[_0xe672('0x3c')](db['ChatTransferReport']['rawAttributes']);_0x4f3bf3[_0xe672('0x2e')]=_['keys'](_0x2ad1e5[_0xe672('0x2e')]);_0x4f3bf3[_0xe672('0x2f')]=_['intersection'](_0x4f3bf3['model'],_0x4f3bf3[_0xe672('0x2e')]);_0x44d69c[_0xe672('0x31')]=_[_0xe672('0x30')](_0x4f3bf3[_0xe672('0x2d')],qs[_0xe672('0x32')](_0x2ad1e5[_0xe672('0x2e')]['fields']));_0x44d69c[_0xe672('0x31')]=_0x44d69c[_0xe672('0x31')][_0xe672('0x3d')]?_0x44d69c[_0xe672('0x31')]:_0x4f3bf3[_0xe672('0x2d')];if(_0x2ad1e5[_0xe672('0x2e')][_0xe672('0x3e')]){_0x44d69c[_0xe672('0x3f')]=[{'all':!![]}];}_0x44d69c=_[_0xe672('0x40')]({},_0x44d69c,_0x2ad1e5['options']);return db[_0xe672('0x2a')]['find'](_0x44d69c)[_0xe672('0x22')](handleEntityNotFound(_0x30d2a5,null))['then'](respondWithResult(_0x30d2a5,null))[_0xe672('0x41')](handleError(_0x30d2a5,null));};exports[_0xe672('0x42')]=function(_0x15af09,_0x17cb60){return db['ChatTransferReport']['create'](_0x15af09[_0xe672('0x43')],{})[_0xe672('0x22')](respondWithResult(_0x17cb60,0xc9))[_0xe672('0x41')](handleError(_0x17cb60,null));};exports['update']=function(_0x5ac8e0,_0x2b9b13){if(_0x5ac8e0['body']['id']){delete _0x5ac8e0['body']['id'];}return db['ChatTransferReport'][_0xe672('0x44')]({'where':{'id':_0x5ac8e0['params']['id']}})[_0xe672('0x22')](handleEntityNotFound(_0x2b9b13,null))['then'](saveUpdates(_0x5ac8e0[_0xe672('0x43')],null))['then'](respondWithResult(_0x2b9b13,null))[_0xe672('0x41')](handleError(_0x2b9b13,null));};exports[_0xe672('0x23')]=function(_0x3eb924,_0x5886dd){return db[_0xe672('0x2a')][_0xe672('0x44')]({'where':{'id':_0x3eb924[_0xe672('0x3b')]['id']}})[_0xe672('0x22')](handleEntityNotFound(_0x5886dd,null))[_0xe672('0x22')](removeEntity(_0x5886dd,null))[_0xe672('0x41')](handleError(_0x5886dd,null));};exports[_0xe672('0x45')]=function(_0x41c3f9,_0x5266fb){return db['ChatTransferReport'][_0xe672('0x45')]()['then'](respondWithResult(_0x5266fb,null))[_0xe672('0x41')](handleError(_0x5266fb,null));};
\ No newline at end of file
index b5ad9cc..af7b134 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x429f=['util','api','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','uniqueid','lodash'];(function(_0x35fa08,_0x28a465){var _0x57c9a8=function(_0x367eb9){while(--_0x367eb9){_0x35fa08['push'](_0x35fa08['shift']());}};_0x57c9a8(++_0x28a465);}(_0x429f,0x1df));var _0xf429=function(_0x5cdc79,_0x24beb1){_0x5cdc79=_0x5cdc79-0x0;var _0x22ddcf=_0x429f[_0x5cdc79];return _0x22ddcf;};'use strict';var _=require(_0xf429('0x0'));var util=require(_0xf429('0x1'));var logger=require('../../config/logger')(_0xf429('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf429('0x3'));var fs=require('fs');var path=require(_0xf429('0x4'));var rimraf=require(_0xf429('0x5'));var config=require(_0xf429('0x6'));var attributes=require(_0xf429('0x7'));module[_0xf429('0x8')]=function(_0x1c4e14,_0x39f486){return _0x1c4e14[_0xf429('0x9')](_0xf429('0xa'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf429('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1646=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid'];(function(_0x34daaf,_0x11df92){var _0x3d49d1=function(_0x1671b2){while(--_0x1671b2){_0x34daaf['push'](_0x34daaf['shift']());}};_0x3d49d1(++_0x11df92);}(_0x1646,0x11e));var _0x6164=function(_0x15b399,_0x59db1a){_0x15b399=_0x15b399-0x0;var _0x199f2d=_0x1646[_0x15b399];return _0x199f2d;};'use strict';var _=require(_0x6164('0x0'));var util=require(_0x6164('0x1'));var logger=require(_0x6164('0x2'))(_0x6164('0x3'));var moment=require('moment');var BPromise=require(_0x6164('0x4'));var rp=require(_0x6164('0x5'));var fs=require('fs');var path=require(_0x6164('0x6'));var rimraf=require(_0x6164('0x7'));var config=require(_0x6164('0x8'));var attributes=require(_0x6164('0x9'));module['exports']=function(_0x262f1b,_0x26d669){return _0x262f1b[_0x6164('0xa')](_0x6164('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x6164('0xc'),'fields':[_0x6164('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 4a75f55..11c1423 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2618=['jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x169cab,_0x444117){var _0x1be1bc=function(_0x38876a){while(--_0x38876a){_0x169cab['push'](_0x169cab['shift']());}};_0x1be1bc(++_0x444117);}(_0x2618,0x16d));var _0x8261=function(_0x8310d7,_0x1bd680){_0x8310d7=_0x8310d7-0x0;var _0x368af3=_0x2618[_0x8310d7];return _0x368af3;};'use strict';var _=require('lodash');var util=require(_0x8261('0x0'));var moment=require(_0x8261('0x1'));var BPromise=require(_0x8261('0x2'));var rs=require(_0x8261('0x3'));var fs=require('fs');var Redis=require(_0x8261('0x4'));var db=require(_0x8261('0x5'))['db'];var utils=require(_0x8261('0x6'));var logger=require(_0x8261('0x7'))(_0x8261('0x8'));var config=require(_0x8261('0x9'));var jayson=require(_0x8261('0xa'));var client=jayson[_0x8261('0xb')][_0x8261('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5d59ea,_0x2f40db,_0x1ff0a1){return new BPromise(function(_0x563b6c,_0x589447){return client[_0x8261('0xd')](_0x5d59ea,_0x1ff0a1)[_0x8261('0xe')](function(_0x4212e5){logger[_0x8261('0xf')](_0x8261('0x10'),_0x2f40db,'request\x20sent');logger[_0x8261('0x11')](_0x8261('0x12'),_0x2f40db,'request\x20sent',JSON[_0x8261('0x13')](_0x4212e5));if(_0x4212e5[_0x8261('0x14')]){if(_0x4212e5[_0x8261('0x14')][_0x8261('0x15')]===0x1f4){logger['error'](_0x8261('0x10'),_0x2f40db,_0x4212e5[_0x8261('0x14')][_0x8261('0x16')]);return _0x589447(_0x4212e5['error']['message']);}logger[_0x8261('0x14')](_0x8261('0x10'),_0x2f40db,_0x4212e5[_0x8261('0x14')][_0x8261('0x16')]);return _0x563b6c(_0x4212e5[_0x8261('0x14')][_0x8261('0x16')]);}else{logger['info'](_0x8261('0x10'),_0x2f40db,_0x8261('0x17'));_0x563b6c(_0x4212e5[_0x8261('0x18')][_0x8261('0x16')]);}})['catch'](function(_0x1cd748){logger['error'](_0x8261('0x10'),_0x2f40db,_0x1cd748);_0x589447(_0x1cd748);});});}
\ No newline at end of file
+var _0xad9e=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x4c9734,_0x559b03){var _0x308459=function(_0x5093a3){while(--_0x5093a3){_0x4c9734['push'](_0x4c9734['shift']());}};_0x308459(++_0x559b03);}(_0xad9e,0xe4));var _0xead9=function(_0x28c3d6,_0x4fd2ca){_0x28c3d6=_0x28c3d6-0x0;var _0x13f769=_0xad9e[_0x28c3d6];return _0x13f769;};'use strict';var _=require(_0xead9('0x0'));var util=require(_0xead9('0x1'));var moment=require(_0xead9('0x2'));var BPromise=require('bluebird');var rs=require(_0xead9('0x3'));var fs=require('fs');var Redis=require(_0xead9('0x4'));var db=require(_0xead9('0x5'))['db'];var utils=require(_0xead9('0x6'));var logger=require(_0xead9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xead9('0x8'));var client=jayson[_0xead9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d42d6,_0x31961d,_0x24e951){return new BPromise(function(_0x429288,_0x5a1c81){return client[_0xead9('0xa')](_0x5d42d6,_0x24e951)['then'](function(_0x1f0d50){logger[_0xead9('0xb')](_0xead9('0xc'),_0x31961d,_0xead9('0xd'));logger['debug'](_0xead9('0xe'),_0x31961d,_0xead9('0xd'),JSON[_0xead9('0xf')](_0x1f0d50));if(_0x1f0d50[_0xead9('0x10')]){if(_0x1f0d50['error']['code']===0x1f4){logger[_0xead9('0x10')](_0xead9('0xc'),_0x31961d,_0x1f0d50[_0xead9('0x10')][_0xead9('0x11')]);return _0x5a1c81(_0x1f0d50[_0xead9('0x10')][_0xead9('0x11')]);}logger[_0xead9('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x31961d,_0x1f0d50['error'][_0xead9('0x11')]);return _0x429288(_0x1f0d50['error'][_0xead9('0x11')]);}else{logger[_0xead9('0xb')](_0xead9('0xc'),_0x31961d,_0xead9('0xd'));_0x429288(_0x1f0d50['result'][_0xead9('0x11')]);}})[_0xead9('0x12')](function(_0x1092f6){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x31961d,_0x1092f6);_0x5a1c81(_0x1092f6);});});}
\ No newline at end of file
index 384dd3d..9971165 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0fd=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated'];(function(_0x47b017,_0x52942d){var _0x485638=function(_0x3af023){while(--_0x3af023){_0x47b017['push'](_0x47b017['shift']());}};_0x485638(++_0x52942d);}(_0xb0fd,0x14c));var _0xdb0f=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0xb0fd[_0x5027b1];return _0x4a46cf;};'use strict';var multer=require(_0xdb0f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdb0f('0x1'));var express=require('express');var router=express[_0xdb0f('0x2')]();var fs_extra=require(_0xdb0f('0x3'));var auth=require(_0xdb0f('0x4'));var interaction=require(_0xdb0f('0x5'));var config=require(_0xdb0f('0x6'));var controller=require(_0xdb0f('0x7'));router[_0xdb0f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xdb0f('0x8')]('/describe',auth[_0xdb0f('0x9')](),controller[_0xdb0f('0xa')]);router[_0xdb0f('0x8')](_0xdb0f('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xdb0f('0xc')]('/',auth[_0xdb0f('0x9')](),controller[_0xdb0f('0xd')]);router[_0xdb0f('0xe')]('/:id',auth[_0xdb0f('0x9')](),controller[_0xdb0f('0xf')]);router[_0xdb0f('0x10')](_0xdb0f('0xb'),auth[_0xdb0f('0x9')](),controller[_0xdb0f('0x11')]);module[_0xdb0f('0x12')]=router;
\ No newline at end of file
+var _0x9cae=['create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x3605e1,_0x15c574){var _0x9f0586=function(_0x4422c4){while(--_0x4422c4){_0x3605e1['push'](_0x3605e1['shift']());}};_0x9f0586(++_0x15c574);}(_0x9cae,0xb9));var _0xe9ca=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9cae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0xe9ca('0x0'));var path=require('path');var timeout=require(_0xe9ca('0x1'));var express=require(_0xe9ca('0x2'));var router=express[_0xe9ca('0x3')]();var fs_extra=require(_0xe9ca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe9ca('0x5'));var config=require(_0xe9ca('0x6'));var controller=require(_0xe9ca('0x7'));router[_0xe9ca('0x8')]('/',auth[_0xe9ca('0x9')](),controller['index']);router[_0xe9ca('0x8')](_0xe9ca('0xa'),auth[_0xe9ca('0x9')](),controller[_0xe9ca('0xb')]);router[_0xe9ca('0x8')](_0xe9ca('0xc'),auth[_0xe9ca('0x9')](),controller[_0xe9ca('0xd')]);router[_0xe9ca('0xe')]('/',auth['isAuthenticated'](),controller[_0xe9ca('0xf')]);router[_0xe9ca('0x10')](_0xe9ca('0xc'),auth[_0xe9ca('0x9')](),controller['update']);router[_0xe9ca('0x11')]('/:id',auth[_0xe9ca('0x9')](),controller[_0xe9ca('0x12')]);module[_0xe9ca('0x13')]=router;
\ No newline at end of file
index 2f96570..d5da5a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x400d=['STRING','address','email','#ffffff','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback','star','INTEGER','stringify','input','name','text','parse','getDataValue','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize'];(function(_0x2b7ae8,_0x28947c){var _0x48d4b4=function(_0x2579d3){while(--_0x2579d3){_0x2b7ae8['push'](_0x2b7ae8['shift']());}};_0x48d4b4(++_0x28947c);}(_0x400d,0x95));var _0xd400=function(_0x1c270a,_0x378796){_0x1c270a=_0x1c270a-0x0;var _0x2607b8=_0x400d[_0x1c270a];return _0x2607b8;};'use strict';var Sequelize=require(_0xd400('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xd400('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'unique':_0xd400('0x2')},'description':{'type':Sequelize[_0xd400('0x1')]},'mapKey':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x3')},'mapKeyOffline':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'defaultValue':_0xd400('0x4'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0xd400('0x1')]},'animation':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd400('0x6')](_0xd400('0x7'),_0xd400('0x8')),'defaultValue':_0xd400('0x7')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd400('0x9')},'start_chat_button':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0xa')},'offline_chat_button':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd400('0xb')},'defaultWhiteLabel':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd400('0xc')]},'closingQuestion':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0xd')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd400('0xe')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0xf')},'closingMessageButton':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x10')},'skipMessageButton':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x11')},'conditionAgreement':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd400('0x12')},'ratingType':{'type':Sequelize[_0xd400('0x6')](_0xd400('0x13'),'thumb'),'defaultValue':_0xd400('0x13')},'ratingStarsNumber':{'type':Sequelize[_0xd400('0x14')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd400('0xc')],'defaultValue':function(){return JSON[_0xd400('0x15')]({'items':[{'type':_0xd400('0x16'),'variable':null,'config':{'placeholder':_0xd400('0x17'),'type':_0xd400('0x18'),'required':!![]},'props':{'title':_0xd400('0x17'),'helpText':''}},{'type':_0xd400('0x16'),'props':{'title':_0xd400('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0xd400('0x19')](this[_0xd400('0x1a')](_0xd400('0x1b'))):{};},'set':function(_0x5cb3ec){return this[_0xd400('0x1c')]('onlineForm',JSON[_0xd400('0x15')](_0x5cb3ec));}},'offlineForm':{'type':Sequelize[_0xd400('0xc')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xd400('0x16'),'props':{'title':_0xd400('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0xd400('0x3'),'type':'email'},'variable':null},{'type':_0xd400('0x1d'),'config':{'placeholder':'Comments'},'props':{'title':_0xd400('0x1e'),'helpText':_0xd400('0x1f')}}],'fromKey':0x0});},'get':function(){return this[_0xd400('0x1a')]('offlineForm')?JSON['parse'](this[_0xd400('0x1a')](_0xd400('0x20'))):{};},'set':function(_0x37f5b2){return this[_0xd400('0x1c')](_0xd400('0x20'),JSON[_0xd400('0x15')](_0x37f5b2));}},'token':{'type':Sequelize[_0xd400('0x1')],'defaultValue':function(){return rs[_0xd400('0x21')]();}},'autoclose':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd400('0x1')]},'forwardOffline':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd400('0x1')]},'waitingTitle':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x22')},'waitingMessage':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x23')},'offlineMessageSubject':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x24')},'offlineMessageBody':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x26')},'skipUnmanaged':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x11')},'sendUnmanaged':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x10')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd400('0xc')]},'showAgentAvatar':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xd400('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd400('0x27');}},'notificationSound':{'type':Sequelize[_0xd400('0x5')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd400('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x29')},'verticalAlignment':{'type':Sequelize[_0xd400('0x14')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xd400('0x1')],'defaultValue':_0xd400('0x2a')},'defaultTitle':{'type':Sequelize[_0xd400('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'defaultValue':_0xd400('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd400('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd400('0x14')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd400('0x1')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xd400('0xc')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd400('0x14')],'comment':_0xd400('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![],'comment':_0xd400('0x2d'),'set':function(_0x3a3b39){if(!_0x3a3b39)this[_0xd400('0x1c')](_0xd400('0x2e'),null);this['setDataValue'](_0xd400('0x2f'),_0x3a3b39);}},'vidaooEscalation':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xd400('0x1')],'allowNull':![],'defaultValue':_0xd400('0x30')},'vidaooNote':{'type':Sequelize[_0xd400('0x1')],'defaultValue':function(){return _0xd400('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd400('0x5')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd400('0xc')]}};
\ No newline at end of file
+var _0xe412=['Skip','BOOLEAN','Feedback','thumb','star','stringify','name','text','input','getDataValue','onlineForm','parse','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','ENUM','squared','rounded','We\x20are\x20here!','Send','Contact\x20us','TEXT','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!'];(function(_0xdb4417,_0x2b9887){var _0x1af27e=function(_0x3337d2){while(--_0x3337d2){_0xdb4417['push'](_0xdb4417['shift']());}};_0x1af27e(++_0x2b9887);}(_0xe412,0x150));var _0x2e41=function(_0x475cf3,_0x3dbba6){_0x475cf3=_0x475cf3-0x0;var _0x482982=_0xe412[_0x475cf3];return _0x482982;};'use strict';var Sequelize=require(_0x2e41('0x0'));var rs=require(_0x2e41('0x1'));module[_0x2e41('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x2e41('0x3')],'allowNull':![],'unique':_0x2e41('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x5')},'mapKeyOffline':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2e41('0x3')],'allowNull':![],'defaultValue':_0x2e41('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x2e41('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e41('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x2e41('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2e41('0xa')]('rounded',_0x2e41('0xb')),'defaultValue':_0x2e41('0xc')},'header_online':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xd')},'start_chat_button':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xe')},'header_offline':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2e41('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x12')},'placeholderMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x13')},'closingMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x14')},'closingMessageButton':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xe')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x2e41('0x15')},'conditionAgreement':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x17')},'ratingType':{'type':Sequelize[_0x2e41('0xa')]('star',_0x2e41('0x18')),'defaultValue':_0x2e41('0x19')},'ratingStarsNumber':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':function(){return JSON[_0x2e41('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x2e41('0x1b'),'type':_0x2e41('0x1c'),'required':!![]},'props':{'title':_0x2e41('0x1b'),'helpText':''}},{'type':_0x2e41('0x1d'),'props':{'title':_0x2e41('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x2e41('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x2e41('0x1e')](_0x2e41('0x1f'))?JSON[_0x2e41('0x20')](this[_0x2e41('0x1e')](_0x2e41('0x1f'))):{};},'set':function(_0x350132){return this[_0x2e41('0x21')](_0x2e41('0x1f'),JSON[_0x2e41('0x1a')](_0x350132));}},'offlineForm':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':function(){return JSON[_0x2e41('0x1a')]({'items':[{'type':_0x2e41('0x1d'),'props':{'title':_0x2e41('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x2e41('0x5'),'type':_0x2e41('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x2e41('0x22')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x2e41('0x1e')](_0x2e41('0x23'))?JSON[_0x2e41('0x20')](this['getDataValue']('offlineForm')):{};},'set':function(_0x12676a){return this[_0x2e41('0x21')](_0x2e41('0x23'),JSON[_0x2e41('0x1a')](_0x12676a));}},'token':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':function(){return rs[_0x2e41('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2e41('0x3')]},'forwardOffline':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x25')},'waitingMessage':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'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[_0x2e41('0x16')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2e41('0x26')},'skipUnmanaged':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x15')},'sendUnmanaged':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':function(){return _0x2e41('0x27');}},'notificationSound':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x28')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x29')},'verticalAlignment':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x2e41('0x2a')},'defaultTitle':{'type':Sequelize[_0x2e41('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2e41('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e41('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2e41('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':_0x2e41('0x2c')},'systemAvatar':{'type':Sequelize[_0x2e41('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2e41('0x9')],'comment':_0x2e41('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![],'comment':_0x2e41('0x2e'),'set':function(_0x3c3353){if(!_0x3c3353)this[_0x2e41('0x21')](_0x2e41('0x2f'),null);this[_0x2e41('0x21')](_0x2e41('0x30'),_0x3c3353);}},'vidaooEscalation':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2e41('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2e41('0x31')},'vidaooNote':{'type':Sequelize[_0x2e41('0x3')],'defaultValue':function(){return _0x2e41('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x2e41('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2e41('0x16')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2e41('0x10')]}};
\ No newline at end of file
index f2e7e4e..7a4face 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d2c=['auth','pass','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','email','Chat','NotifyMailAccount','notifyMail','server','attachments','remove','addInteraction','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','virtual','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','textColor','backgroundColor','ChatApplication','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','map','ChatWebsite','rawAttributes','key','query','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','include','ids','addAnswer','CannedAnswer','getAnswers','options','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','root','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','isNil','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','difference','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Applications','account','applications','list','orderBy','priority','asc','Contacts','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','files','mapKeyOffline','includes','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','port','secure'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2d2c,0x17f));var _0xc2d2=function(_0x1ccb95,_0x1b3be8){_0x1ccb95=_0x1ccb95-0x0;var _0x1a9725=_0x2d2c[_0x1ccb95];return _0x1a9725;};'use strict';var emlformat=require(_0xc2d2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc2d2('0x1'));var BPromise=require(_0xc2d2('0x2'));var Mustache=require(_0xc2d2('0x3'));var util=require(_0xc2d2('0x4'));var path=require(_0xc2d2('0x5'));var sox=require(_0xc2d2('0x6'));var csv=require(_0xc2d2('0x7'));var ejs=require(_0xc2d2('0x8'));var fs=require('fs');var fs_extra=require(_0xc2d2('0x9'));var _=require(_0xc2d2('0xa'));var squel=require(_0xc2d2('0xb'));var crypto=require('crypto');var jsforce=require(_0xc2d2('0xc'));var deskjs=require(_0xc2d2('0xd'));var toCsv=require(_0xc2d2('0x7'));var querystring=require(_0xc2d2('0xe'));var Papa=require(_0xc2d2('0xf'));var Redis=require(_0xc2d2('0x10'));var authService=require(_0xc2d2('0x11'));var qs=require(_0xc2d2('0x12'));var as=require(_0xc2d2('0x13'));var hardwareService=require(_0xc2d2('0x14'));var logger=require(_0xc2d2('0x15'))('api');var utils=require(_0xc2d2('0x16'));var config=require(_0xc2d2('0x17'));var licenseUtil=require(_0xc2d2('0x18'));var db=require('../../mysqldb')['db'];config[_0xc2d2('0x19')]=_[_0xc2d2('0x1a')](config[_0xc2d2('0x19')],{'host':_0xc2d2('0x1b'),'port':0x18eb});var socket=require(_0xc2d2('0x1c'))(new Redis(config[_0xc2d2('0x19')]));require('./chatWebsite.socket')[_0xc2d2('0x1d')](socket);var jayson=require(_0xc2d2('0x1e'));var client=jayson[_0xc2d2('0x1f')][_0xc2d2('0x20')]({'port':0x232c});var client9002=jayson['client'][_0xc2d2('0x20')]({'port':0x232a});var client9003=jayson[_0xc2d2('0x1f')][_0xc2d2('0x20')]({'port':0x232b});var client9001=jayson[_0xc2d2('0x1f')][_0xc2d2('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x5009a8,_0x544fcf,_0x37977e,_0x16efc7){return new BPromise(function(_0xcdbd4c,_0x253e3d){var _0x53adfa=_0x16efc7||client;return _0x53adfa['request'](_0x5009a8,_0x37977e)[_0xc2d2('0x21')](function(_0x2d209){logger[_0xc2d2('0x22')](_0xc2d2('0x23'),_0x544fcf,_0xc2d2('0x24'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x544fcf,_0xc2d2('0x24'),JSON[_0xc2d2('0x25')](_0x2d209));if(_0x2d209[_0xc2d2('0x26')]){if(_0x2d209[_0xc2d2('0x26')]['code']===0x1f4){logger[_0xc2d2('0x26')]('ChatWebsite,\x20%s,\x20%s',_0x544fcf,_0x2d209[_0xc2d2('0x26')][_0xc2d2('0x27')]);return _0x253e3d(_0x2d209[_0xc2d2('0x26')][_0xc2d2('0x27')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x544fcf,_0x2d209[_0xc2d2('0x26')][_0xc2d2('0x27')]);return _0xcdbd4c(_0x2d209[_0xc2d2('0x26')]['message']);}else{logger[_0xc2d2('0x22')](_0xc2d2('0x23'),_0x544fcf,_0xc2d2('0x24'));_0xcdbd4c(_0x2d209[_0xc2d2('0x28')][_0xc2d2('0x27')]);}})['catch'](function(_0x498bdd){logger['error'](_0xc2d2('0x23'),_0x544fcf,_0x498bdd);_0x253e3d(_0x498bdd);});});}function respondWithStatusCode(_0x16871e,_0x182c88){_0x182c88=_0x182c88||0xcc;return function(_0x1c1c1b){if(_0x1c1c1b){return _0x16871e[_0xc2d2('0x29')](_0x182c88);}return _0x16871e[_0xc2d2('0x2a')](_0x182c88)[_0xc2d2('0x2b')]();};}function respondWithResult(_0x15b064,_0x30132f){_0x30132f=_0x30132f||0xc8;return function(_0x469373){if(_0x469373){return _0x15b064['status'](_0x30132f)[_0xc2d2('0x2c')](_0x469373);}};}function respondWithFilteredResult(_0x3e5125,_0x2d637e){return function(_0x2d6f5b){if(_0x2d6f5b){var _0x105a0d=typeof _0x2d637e[_0xc2d2('0x2d')]===_0xc2d2('0x2e')&&typeof _0x2d637e['limit']===_0xc2d2('0x2e');var _0x361395=_0x2d6f5b['count'];var _0x2d96a2=_0x105a0d?0x0:_0x2d637e[_0xc2d2('0x2d')];var _0x2f7430=_0x105a0d?_0x2d6f5b[_0xc2d2('0x2f')]:_0x2d637e[_0xc2d2('0x2d')]+_0x2d637e[_0xc2d2('0x30')];var _0x51195f;if(_0x2f7430>=_0x361395){_0x2f7430=_0x361395;_0x51195f=0xc8;}else{_0x51195f=0xce;}_0x3e5125[_0xc2d2('0x2a')](_0x51195f);return _0x3e5125[_0xc2d2('0x31')](_0xc2d2('0x32'),_0x2d96a2+'-'+_0x2f7430+'/'+_0x361395)[_0xc2d2('0x2c')](_0x2d6f5b);}return null;};}function patchUpdates(_0x3b353c){return function(_0x420662){try{jsonpatch[_0xc2d2('0x33')](_0x420662,_0x3b353c,!![]);}catch(_0x3d2695){return BPromise[_0xc2d2('0x34')](_0x3d2695);}return _0x420662[_0xc2d2('0x35')]();};}function saveUpdates(_0xb3f0ca,_0x4d6b97){return function(_0x14fc07){if(_0x14fc07){return _0x14fc07[_0xc2d2('0x36')](_0xb3f0ca)[_0xc2d2('0x21')](function(_0x50326a){return _0x50326a;});}return null;};}function removeEntity(_0x556e35,_0x2e677e){return function(_0x21e6f1){if(_0x21e6f1){return _0x21e6f1[_0xc2d2('0x37')]()[_0xc2d2('0x21')](function(){var _0x525e1a=_0x21e6f1[_0xc2d2('0x38')]({'plain':!![]});var _0x19be88=_0xc2d2('0x39');return db[_0xc2d2('0x3a')][_0xc2d2('0x37')]({'where':{'type':_0x19be88,'resourceId':_0x525e1a['id']}})['then'](function(){return _0x21e6f1;});})[_0xc2d2('0x21')](function(){_0x556e35[_0xc2d2('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44c8c6,_0x235b19){return function(_0x5b861b){if(!_0x5b861b){_0x44c8c6[_0xc2d2('0x29')](0x194);}return _0x5b861b;};}function handleError(_0x11b9df,_0xc3feca){_0xc3feca=_0xc3feca||0x1f4;return function(_0x5026cd){logger[_0xc2d2('0x26')](_0x5026cd[_0xc2d2('0x3b')]);if(_0x5026cd['name']){delete _0x5026cd[_0xc2d2('0x3c')];}_0x11b9df[_0xc2d2('0x2a')](_0xc3feca)[_0xc2d2('0x3d')](_0x5026cd);};}exports[_0xc2d2('0x3e')]=function(_0xbe528a,_0x5e30c2){var _0x3998db={'include':[{'model':db[_0xc2d2('0x3f')],'as':'mandatoryDispositionPause'}]},_0x1882ec={},_0x4f146c={'count':0x0,'rows':[]};var _0x40061f=_[_0xc2d2('0x40')](db[_0xc2d2('0x41')][_0xc2d2('0x42')],function(_0x2f3faf){return{'name':_0x2f3faf['fieldName'],'type':_0x2f3faf['type'][_0xc2d2('0x43')]};});_0x1882ec['model']=_['map'](_0x40061f,_0xc2d2('0x3c'));_0x1882ec[_0xc2d2('0x44')]=_['keys'](_0xbe528a[_0xc2d2('0x44')]);_0x1882ec['filters']=_['intersection'](_0x1882ec['model'],_0x1882ec[_0xc2d2('0x44')]);_0x3998db['attributes']=_['intersection'](_0x1882ec['model'],qs[_0xc2d2('0x45')](_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x45')]));_0x3998db[_0xc2d2('0x46')]=_0x3998db[_0xc2d2('0x46')][_0xc2d2('0x47')]?_0x3998db['attributes']:_0x1882ec[_0xc2d2('0x48')];if(!_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0x3998db[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x30')]);_0x3998db[_0xc2d2('0x2d')]=qs[_0xc2d2('0x2d')](_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}_0x3998db[_0xc2d2('0x4b')]=qs[_0xc2d2('0x4c')](_0xbe528a[_0xc2d2('0x44')]['sort']);_0x3998db[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_[_0xc2d2('0x4f')](_0xbe528a[_0xc2d2('0x44')],_0x1882ec[_0xc2d2('0x4e')]),_0x40061f);if(_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x50')]){_0x3998db[_0xc2d2('0x4d')]=_[_0xc2d2('0x51')](_0x3998db[_0xc2d2('0x4d')],{'$or':_[_0xc2d2('0x40')](_0x40061f,function(_0x1de7a3){if(_0x1de7a3['type']!==_0xc2d2('0x52')){var _0x4bc543={};_0x4bc543[_0x1de7a3[_0xc2d2('0x3c')]]={'$like':'%'+_0xbe528a['query'][_0xc2d2('0x50')]+'%'};return _0x4bc543;}})});}_0x3998db=_[_0xc2d2('0x51')]({},_0x3998db,_0xbe528a['options']);var _0x2264b5={'where':_0x3998db[_0xc2d2('0x4d')]};return db[_0xc2d2('0x41')][_0xc2d2('0x2f')](_0x2264b5)[_0xc2d2('0x21')](function(_0x321ee3){_0x4f146c['count']=_0x321ee3;if(_0xbe528a[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0x3998db['include']=[{'all':!![]}];}return db[_0xc2d2('0x41')][_0xc2d2('0x54')](_0x3998db);})['then'](function(_0x4d2961){_0x4f146c[_0xc2d2('0x55')]=_0x4d2961;return _0x4f146c;})[_0xc2d2('0x21')](respondWithFilteredResult(_0x5e30c2,_0x3998db))[_0xc2d2('0x56')](handleError(_0x5e30c2,null));};exports[_0xc2d2('0x57')]=function(_0x2080e6,_0x46a3bb){var _0x406fcc={'raw':![],'where':{'id':_0x2080e6[_0xc2d2('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1f36ea={};_0x1f36ea[_0xc2d2('0x48')]=_['keys'](db[_0xc2d2('0x41')][_0xc2d2('0x42')]);_0x1f36ea[_0xc2d2('0x44')]=_[_0xc2d2('0x59')](_0x2080e6['query']);_0x1f36ea['filters']=_[_0xc2d2('0x5a')](_0x1f36ea[_0xc2d2('0x48')],_0x1f36ea['query']);_0x406fcc[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x1f36ea[_0xc2d2('0x48')],qs[_0xc2d2('0x45')](_0x2080e6[_0xc2d2('0x44')]['fields']));_0x406fcc[_0xc2d2('0x46')]=_0x406fcc[_0xc2d2('0x46')][_0xc2d2('0x47')]?_0x406fcc[_0xc2d2('0x46')]:_0x1f36ea[_0xc2d2('0x48')];if(_0x2080e6[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0x406fcc['include']=[{'all':!![]}];}_0x406fcc=_[_0xc2d2('0x51')]({},_0x406fcc,_0x2080e6['options']);return db['ChatWebsite'][_0xc2d2('0x5b')](_0x406fcc)['then'](handleEntityNotFound(_0x46a3bb,null))[_0xc2d2('0x21')](respondWithResult(_0x46a3bb,null))['catch'](handleError(_0x46a3bb,null));};exports[_0xc2d2('0x5c')]=function(_0x2a73b8,_0x2cde52){return db[_0xc2d2('0x41')][_0xc2d2('0x5c')](_0x2a73b8[_0xc2d2('0x5d')],{})['then'](function(_0x251314){var _0xfe1ba6=_0x2a73b8[_0xc2d2('0x5e')][_0xc2d2('0x38')]({'plain':!![]});if(!_0xfe1ba6)throw new Error(_0xc2d2('0x5f'));if(_0xfe1ba6[_0xc2d2('0x60')]===_0xc2d2('0x5e')){var _0x26aea0=_0x251314['get']({'plain':!![]});var _0x530b44='ChatWebsites';return db['UserProfileSection'][_0xc2d2('0x5b')]({'where':{'name':_0x530b44,'userProfileId':_0xfe1ba6[_0xc2d2('0x61')]},'raw':!![]})[_0xc2d2('0x21')](function(_0x591f07){if(_0x591f07&&_0x591f07[_0xc2d2('0x62')]===0x0){return db['UserProfileResource'][_0xc2d2('0x5c')]({'name':_0x26aea0['name'],'resourceId':_0x26aea0['id'],'type':_0x591f07[_0xc2d2('0x3c')],'sectionId':_0x591f07['id']},{})[_0xc2d2('0x21')](function(){return _0x251314;});}else{return _0x251314;}})['catch'](function(_0x1314b7){logger[_0xc2d2('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1314b7);throw _0x1314b7;});}return _0x251314;})[_0xc2d2('0x21')](respondWithResult(_0x2cde52,0xc9))['catch'](handleError(_0x2cde52,null));};exports[_0xc2d2('0x36')]=function(_0x29a8a2,_0xcecbb8){if(_0x29a8a2[_0xc2d2('0x5d')]['id']){delete _0x29a8a2[_0xc2d2('0x5d')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x29a8a2[_0xc2d2('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xc2d2('0x63')}]})[_0xc2d2('0x21')](handleEntityNotFound(_0xcecbb8,null))['then'](saveUpdates(_0x29a8a2['body'],null))[_0xc2d2('0x21')](respondWithResult(_0xcecbb8,null))[_0xc2d2('0x56')](handleError(_0xcecbb8,null));};exports[_0xc2d2('0x37')]=function(_0x1b5b9b,_0xcd2416){return db[_0xc2d2('0x41')]['find']({'where':{'id':_0x1b5b9b[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0xcd2416,null))[_0xc2d2('0x21')](removeEntity(_0xcd2416,null))[_0xc2d2('0x56')](handleError(_0xcd2416,null));};exports['describe']=function(_0x588f84,_0x1c1e07){return db[_0xc2d2('0x41')][_0xc2d2('0x64')]()[_0xc2d2('0x21')](respondWithResult(_0x1c1e07,null))[_0xc2d2('0x56')](handleError(_0x1c1e07,null));};exports[_0xc2d2('0x65')]=function(_0x348d1a,_0x171906,_0x22a9d0){if(_0x348d1a[_0xc2d2('0x5d')]['id']){delete _0x348d1a[_0xc2d2('0x5d')]['id'];}return db['ChatWebsite'][_0xc2d2('0x5b')]({'where':{'id':_0x348d1a[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x171906,null))['then'](function(_0x115649){if(_0x115649){_0x348d1a[_0xc2d2('0x5d')][_0xc2d2('0x66')]=_0x115649['id'];return db['Disposition']['create'](_0x348d1a[_0xc2d2('0x5d')]);}})[_0xc2d2('0x21')](respondWithResult(_0x171906,null))[_0xc2d2('0x56')](handleError(_0x171906,null));};exports[_0xc2d2('0x67')]=function(_0x2c564a,_0xfc7790,_0x1084d2){var _0x5774f8={'raw':![],'where':{}};var _0x4cb861={};var _0x48dc5e={'count':0x0,'rows':[]};return db[_0xc2d2('0x41')][_0xc2d2('0x68')]({'where':{'id':_0x2c564a[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0xfc7790,null))[_0xc2d2('0x21')](function(_0x27444e){if(_0x27444e){_0x4cb861['model']=_[_0xc2d2('0x59')](db[_0xc2d2('0x69')]['rawAttributes']);_0x4cb861[_0xc2d2('0x44')]=_[_0xc2d2('0x59')](_0x2c564a[_0xc2d2('0x44')]);_0x4cb861[_0xc2d2('0x4e')]=_[_0xc2d2('0x5a')](_0x4cb861[_0xc2d2('0x48')],_0x4cb861['query']);_0x5774f8[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x4cb861['model'],qs['fields'](_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x45')]));_0x5774f8[_0xc2d2('0x46')]=_0x5774f8[_0xc2d2('0x46')][_0xc2d2('0x47')]?_0x5774f8['attributes']:_0x4cb861[_0xc2d2('0x48')];if(!_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0x5774f8[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x30')]);_0x5774f8[_0xc2d2('0x2d')]=qs[_0xc2d2('0x2d')](_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}_0x5774f8[_0xc2d2('0x4b')]=qs[_0xc2d2('0x4c')](_0x2c564a[_0xc2d2('0x44')]['sort']);_0x5774f8[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_['pick'](_0x2c564a[_0xc2d2('0x44')],_0x4cb861[_0xc2d2('0x4e')]));_0x5774f8[_0xc2d2('0x4d')][_0xc2d2('0x66')]=_0x27444e['id'];if(_0x2c564a['query']['filter']){_0x5774f8[_0xc2d2('0x4d')]=_[_0xc2d2('0x51')](_0x5774f8['where'],{'$or':_['map'](_0x5774f8['attributes'],function(_0x35d180){var _0x29edf3={};_0x29edf3[_0x35d180]={'$like':'%'+_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x50')]+'%'};return _0x29edf3;})});}_0x5774f8=_[_0xc2d2('0x51')]({},_0x5774f8,_0x2c564a['options']);return db[_0xc2d2('0x69')][_0xc2d2('0x2f')]({'where':_0x5774f8['where']})[_0xc2d2('0x21')](function(_0x44782c){_0x48dc5e[_0xc2d2('0x2f')]=_0x44782c;if(_0x2c564a[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0x5774f8[_0xc2d2('0x6a')]=[{'all':!![]}];}return db[_0xc2d2('0x69')][_0xc2d2('0x54')](_0x5774f8);})[_0xc2d2('0x21')](function(_0x1d3178){_0x48dc5e[_0xc2d2('0x55')]=_0x1d3178;return _0x48dc5e;});}})[_0xc2d2('0x21')](respondWithFilteredResult(_0xfc7790,_0x5774f8))['catch'](handleError(_0xfc7790,null));};exports['removeDispositions']=function(_0x50fd31,_0x2b5648,_0x438dc9){return db['ChatWebsite'][_0xc2d2('0x5b')]({'where':{'id':_0x50fd31[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x2b5648,null))[_0xc2d2('0x21')](function(_0x58dad7){if(_0x58dad7){return _0x58dad7['removeDispositions'](_0x50fd31[_0xc2d2('0x44')][_0xc2d2('0x6b')]);}})[_0xc2d2('0x21')](respondWithStatusCode(_0x2b5648,null))['catch'](handleError(_0x2b5648,null));};exports[_0xc2d2('0x6c')]=function(_0x5e87fa,_0x4a87d2,_0x304d15){if(_0x5e87fa['body']['id']){delete _0x5e87fa[_0xc2d2('0x5d')]['id'];}return db['ChatWebsite'][_0xc2d2('0x5b')]({'where':{'id':_0x5e87fa[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x4a87d2,null))['then'](function(_0x1caba5){if(_0x1caba5){_0x5e87fa['body']['ChatWebsiteId']=_0x1caba5['id'];return db[_0xc2d2('0x6d')]['create'](_0x5e87fa[_0xc2d2('0x5d')]);}})[_0xc2d2('0x21')](respondWithResult(_0x4a87d2,null))['catch'](handleError(_0x4a87d2,null));};exports[_0xc2d2('0x6e')]=function(_0x185093,_0x2abd82,_0xdfc06d){var _0x3e956a={'raw':![],'where':{}};var _0x32f9d5={};var _0x1a50be={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc2d2('0x68')]({'where':{'id':_0x185093[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x2abd82,null))[_0xc2d2('0x21')](function(_0x9fd09b){if(_0x9fd09b){_0x32f9d5[_0xc2d2('0x48')]=_[_0xc2d2('0x59')](db['CannedAnswer'][_0xc2d2('0x42')]);_0x32f9d5[_0xc2d2('0x44')]=_[_0xc2d2('0x59')](_0x185093[_0xc2d2('0x44')]);_0x32f9d5[_0xc2d2('0x4e')]=_[_0xc2d2('0x5a')](_0x32f9d5[_0xc2d2('0x48')],_0x32f9d5['query']);_0x3e956a[_0xc2d2('0x46')]=_['intersection'](_0x32f9d5['model'],qs[_0xc2d2('0x45')](_0x185093[_0xc2d2('0x44')][_0xc2d2('0x45')]));_0x3e956a[_0xc2d2('0x46')]=_0x3e956a['attributes'][_0xc2d2('0x47')]?_0x3e956a[_0xc2d2('0x46')]:_0x32f9d5[_0xc2d2('0x48')];if(!_0x185093[_0xc2d2('0x44')]['hasOwnProperty'](_0xc2d2('0x4a'))){_0x3e956a[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0x185093[_0xc2d2('0x44')]['limit']);_0x3e956a[_0xc2d2('0x2d')]=qs[_0xc2d2('0x2d')](_0x185093[_0xc2d2('0x44')]['offset']);}_0x3e956a[_0xc2d2('0x4b')]=qs[_0xc2d2('0x4c')](_0x185093['query'][_0xc2d2('0x4c')]);_0x3e956a[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_[_0xc2d2('0x4f')](_0x185093[_0xc2d2('0x44')],_0x32f9d5['filters']));_0x3e956a[_0xc2d2('0x4d')][_0xc2d2('0x66')]=_0x9fd09b['id'];if(_0x185093[_0xc2d2('0x44')][_0xc2d2('0x50')]){_0x3e956a[_0xc2d2('0x4d')]=_[_0xc2d2('0x51')](_0x3e956a[_0xc2d2('0x4d')],{'$or':_[_0xc2d2('0x40')](_0x3e956a['attributes'],function(_0x35dcd2){var _0x27f98c={};_0x27f98c[_0x35dcd2]={'$like':'%'+_0x185093[_0xc2d2('0x44')][_0xc2d2('0x50')]+'%'};return _0x27f98c;})});}_0x3e956a=_[_0xc2d2('0x51')]({},_0x3e956a,_0x185093[_0xc2d2('0x6f')]);return db[_0xc2d2('0x6d')][_0xc2d2('0x2f')]({'where':_0x3e956a[_0xc2d2('0x4d')]})[_0xc2d2('0x21')](function(_0x281b6e){_0x1a50be[_0xc2d2('0x2f')]=_0x281b6e;if(_0x185093[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0x3e956a[_0xc2d2('0x6a')]=[{'all':!![]}];}return db[_0xc2d2('0x6d')][_0xc2d2('0x54')](_0x3e956a);})[_0xc2d2('0x21')](function(_0x322f01){_0x1a50be[_0xc2d2('0x55')]=_0x322f01;return _0x1a50be;});}})[_0xc2d2('0x21')](respondWithFilteredResult(_0x2abd82,_0x3e956a))[_0xc2d2('0x56')](handleError(_0x2abd82,null));};exports['removeAnswers']=function(_0x48bf74,_0x193004,_0x453692){return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x48bf74[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x193004,null))[_0xc2d2('0x21')](function(_0x48a713){if(_0x48a713){return _0x48a713['removeAnswers'](_0x48bf74[_0xc2d2('0x44')]['ids']);}})[_0xc2d2('0x21')](respondWithStatusCode(_0x193004,null))[_0xc2d2('0x56')](handleError(_0x193004,null));};exports[_0xc2d2('0x70')]=function(_0x344d2f,_0x59e755,_0x459054){_0x344d2f[_0xc2d2('0x5d')][_0xc2d2('0x71')]=_0x344d2f[_0xc2d2('0x72')][_0xc2d2('0x73')];return db['ChatWebsite']['find']({'where':{'id':_0x344d2f[_0xc2d2('0x58')]['id']}})['then'](handleEntityNotFound(_0x59e755,null))[_0xc2d2('0x21')](saveUpdates(_0x344d2f[_0xc2d2('0x5d')],null))['then'](respondWithResult(_0x59e755,null))[_0xc2d2('0x56')](handleError(_0x59e755,null));};exports[_0xc2d2('0x74')]=function(_0x13b561,_0x1aa230,_0x4938e9){_0x13b561[_0xc2d2('0x5d')][_0xc2d2('0x75')]=_0x13b561[_0xc2d2('0x72')][_0xc2d2('0x73')];return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x13b561['params']['id']}})['then'](handleEntityNotFound(_0x1aa230,null))[_0xc2d2('0x21')](saveUpdates(_0x13b561[_0xc2d2('0x5d')],null))[_0xc2d2('0x21')](respondWithResult(_0x1aa230,null))['catch'](handleError(_0x1aa230,null));};exports[_0xc2d2('0x76')]=function(_0x4eb6ce,_0x1bde6a,_0x396724){_0x4eb6ce[_0xc2d2('0x5d')]['customerAvatar']=_0x4eb6ce['file'][_0xc2d2('0x73')];return db['ChatWebsite']['find']({'where':{'id':_0x4eb6ce[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x1bde6a,null))['then'](saveUpdates(_0x4eb6ce['body'],null))['then'](respondWithResult(_0x1bde6a,null))[_0xc2d2('0x56')](handleError(_0x1bde6a,null));};exports[_0xc2d2('0x77')]=function(_0x732ea7,_0x1b43d3,_0x15e38f){_0x732ea7[_0xc2d2('0x5d')][_0xc2d2('0x78')]=_0x732ea7[_0xc2d2('0x72')][_0xc2d2('0x73')];return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x732ea7['params']['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x1b43d3,null))['then'](saveUpdates(_0x732ea7[_0xc2d2('0x5d')],null))[_0xc2d2('0x21')](respondWithResult(_0x1b43d3,null))[_0xc2d2('0x56')](handleError(_0x1b43d3,null));};exports[_0xc2d2('0x79')]=function(_0x348218,_0x1fdadb,_0x58184c){var _0x327e4c=path['join'](config[_0xc2d2('0x7a')],'server/files/images/logos/default_logo.svg');var _0x4e1b47={'where':{'id':_0x348218[_0xc2d2('0x58')]['id']},'attributes':['id',_0xc2d2('0x71')],'raw':!![]};var _0x590150=![];return require('../../config/license/util')[_0xc2d2('0x7b')]()[_0xc2d2('0x21')](function(_0x25cd40){if(_0x25cd40){_0x590150=_0x25cd40[_0xc2d2('0x7c')];}})[_0xc2d2('0x21')](function(){return db[_0xc2d2('0x41')][_0xc2d2('0x5b')](_0x4e1b47);})[_0xc2d2('0x21')](handleEntityNotFound(_0x1fdadb,null))['then'](function(_0x73e71d){if(_0x73e71d){if(!_['isNil'](_0x73e71d[_0xc2d2('0x71')])){if(fs[_0xc2d2('0x7d')](path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x7f'),_0x73e71d[_0xc2d2('0x71')]))&&_0x590150){_0x327e4c=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x7f'),_0x73e71d['sitepic']);}}return _0x1fdadb[_0xc2d2('0x80')](_0x327e4c);}})['catch'](handleError(_0x1fdadb,null));};exports[_0xc2d2('0x81')]=function(_0x66f336,_0x87889,_0x27f11b){var _0x2c1318=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x82'));var _0x275123={'where':{'id':_0x66f336['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xc2d2('0x41')][_0xc2d2('0x5b')](_0x275123)[_0xc2d2('0x21')](handleEntityNotFound(_0x87889,null))[_0xc2d2('0x21')](function(_0x538a85){if(_0x538a85){if(!_['isNil'](_0x538a85['agentAvatar'])){if(fs['existsSync'](path[_0xc2d2('0x7e')](config['root'],_0xc2d2('0x83'),_0x538a85[_0xc2d2('0x75')]))){_0x2c1318=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x83'),_0x538a85['agentAvatar']);}}return _0x87889[_0xc2d2('0x80')](_0x2c1318);}})[_0xc2d2('0x56')](handleError(_0x87889,null));};exports['getCustomerAvatar']=function(_0x18c298,_0x3fedfc,_0x5c6273){var _0x352b1b=path[_0xc2d2('0x7e')](config['root'],_0xc2d2('0x84'));var _0x6804bc={'where':{'id':_0x18c298['params']['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xc2d2('0x41')]['find'](_0x6804bc)[_0xc2d2('0x21')](handleEntityNotFound(_0x3fedfc,null))['then'](function(_0xdffbeb){if(_0xdffbeb){if(!_[_0xc2d2('0x85')](_0xdffbeb[_0xc2d2('0x86')])){if(fs[_0xc2d2('0x7d')](path['join'](config[_0xc2d2('0x7a')],'server/files/images/avatars/',_0xdffbeb[_0xc2d2('0x86')]))&&_0xdffbeb['showCustomerAvatar']){_0x352b1b=path[_0xc2d2('0x7e')](config['root'],'server/files/images/avatars/',_0xdffbeb[_0xc2d2('0x86')]);}}return _0x3fedfc[_0xc2d2('0x80')](_0x352b1b);}})['catch'](handleError(_0x3fedfc,null));};exports[_0xc2d2('0x87')]=function(_0x5a7f3a,_0x24c434,_0xca75b0){var _0x1b5ec8=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x88'));var _0x5e67c4={'where':{'id':_0x5a7f3a['params']['id']},'attributes':['id',_0xc2d2('0x78')],'raw':!![]};return db[_0xc2d2('0x41')][_0xc2d2('0x5b')](_0x5e67c4)[_0xc2d2('0x21')](handleEntityNotFound(_0x24c434,null))[_0xc2d2('0x21')](function(_0x382e6e){if(_0x382e6e){if(!_[_0xc2d2('0x85')](_0x382e6e[_0xc2d2('0x78')])){if(fs['existsSync'](path['join'](config[_0xc2d2('0x7a')],_0xc2d2('0x83'),_0x382e6e['systemAvatar']))){_0x1b5ec8=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0x83'),_0x382e6e[_0xc2d2('0x78')]);}}return _0x24c434[_0xc2d2('0x80')](_0x1b5ec8);}})['catch'](handleError(_0x24c434,null));};exports[_0xc2d2('0x89')]=function(_0x170808,_0x526a98,_0x591609){var _0x358fc5=require(_0xc2d2('0x8a'));var _0x4469cb=new _0x358fc5();var _0x4edeed=_0x4469cb['setUA'](_0x170808[_0xc2d2('0x8b')][_0xc2d2('0x8c')])[_0xc2d2('0x8d')]();var _0x20dad5={'body':_0x170808[_0xc2d2('0x5d')],'channel':_0xc2d2('0x8e')};var _0x34a77f=[];var _0x59dce8=[];var _0x25776c={};var _0x203aac=![];return db['CmContact'][_0xc2d2('0x64')]()[_0xc2d2('0x21')](function(_0xedc4f4){if(!_0xedc4f4){throw new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x91'));}_0x34a77f=_['difference'](_[_0xc2d2('0x59')](_0xedc4f4),[_0xc2d2('0x92'),'updatedAt']);_0x59dce8=_[_0xc2d2('0x93')](_[_0xc2d2('0x59')](_0xedc4f4),[_0xc2d2('0x92'),_0xc2d2('0x94'),_0xc2d2('0x95'),_0xc2d2('0x96')]);if(_0x170808[_0xc2d2('0x5d')]['id']){delete _0x170808['body']['id'];}if(_[_0xc2d2('0x85')](_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x97')])){throw new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x98'));}if(_[_0xc2d2('0x85')](_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x5d')])||_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x5d')]===''){throw new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x99'));}if(_[_0xc2d2('0x85')](_0x170808[_0xc2d2('0x5d')]['mapKey'])){throw new db[(_0xc2d2('0x8f'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x59dce8);}if(!_['includes'](_0x59dce8,_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x9a')])){throw new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x9b')+_0x59dce8);}_0x25776c[_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x9a')]]=_0x170808['body']['from'];})[_0xc2d2('0x21')](function(){return db[_0xc2d2('0x41')]['find']({'where':{'id':_0x170808['params']['id']},'include':[{'model':db[_0xc2d2('0x9c')],'as':_0xc2d2('0x9d'),'include':[{'model':db[_0xc2d2('0x9e')],'as':'Contacts','where':_0x25776c,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['ChatApplication'],'as':_0xc2d2('0x9f')}]});})[_0xc2d2('0x21')](handleEntityNotFound(_0x526a98,null))[_0xc2d2('0x21')](function(_0x11bc85){if(_0x11bc85&&_0x11bc85[_0xc2d2('0x9d')]){_0x20dad5[_0xc2d2('0xa0')]=_0x11bc85;_0x20dad5[_0xc2d2('0xa1')]=_0x11bc85[_0xc2d2('0x9f')];_0x20dad5[_0xc2d2('0xa2')]=_0x11bc85['List'];_0x20dad5[_0xc2d2('0xa1')]=_[_0xc2d2('0xa3')](_0x20dad5['applications'],[_0xc2d2('0xa4')],[_0xc2d2('0xa5')]);if(_0x20dad5[_0xc2d2('0xa0')][_0xc2d2('0x9f')]){delete _0x20dad5[_0xc2d2('0xa0')][_0xc2d2('0x9f')];}if(_0x20dad5['account'][_0xc2d2('0x9d')]&&_0x20dad5['account']['List'][_0xc2d2('0xa6')][_0xc2d2('0x47')]){return _0x20dad5[_0xc2d2('0xa0')][_0xc2d2('0x9d')][_0xc2d2('0xa6')][0x0];}var _0x3b414c=_[_0xc2d2('0x1a')](_0x170808[_0xc2d2('0x5d')],{'firstName':_0x170808['body'][_0xc2d2('0x97')],'ListId':_0x11bc85['ListId']});_0x3b414c[_0x170808['body']['mapKey']]=_0x170808[_0xc2d2('0x5d')][_0xc2d2('0x97')];return db[_0xc2d2('0x9e')]['create'](_0x3b414c,{'fields':_0x34a77f,'raw':!![]});}})[_0xc2d2('0x21')](handleEntityNotFound(_0x526a98,null))[_0xc2d2('0x21')](function(_0x336763){_0x20dad5[_0xc2d2('0xa7')]=_0x336763;var _0x3c7601=_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xa8')];if(_0x170808[_0xc2d2('0x8b')][_0xc2d2('0xa9')]){_0x3c7601=_0x170808[_0xc2d2('0x8b')][_0xc2d2('0xa9')];}else if(_0x170808[_0xc2d2('0x8b')]['x-forwarded-for']){_0x3c7601=_[_0xc2d2('0xaa')](_0x170808['headers'][_0xc2d2('0xab')]['split'](','));}if(_0x336763){var _0x3373d7={'ContactId':_0x336763['id'],'ChatWebsiteId':_0x170808[_0xc2d2('0x58')]['id'],'from':(_0x336763[_0xc2d2('0xac')]||'')+'\x20'+(_0x336763[_0xc2d2('0xad')]||''),'customerIp':_0x3c7601,'customerPort':_0x170808[_0xc2d2('0x8b')][_0xc2d2('0xae')]?_0x170808[_0xc2d2('0x8b')]['x-real-port']:null,'referer':_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xaf')],'browserName':_0x4edeed[_0xc2d2('0xb0')][_0xc2d2('0x3c')]&&_0x4edeed[_0xc2d2('0xb0')][_0xc2d2('0xb1')]?util[_0xc2d2('0xb2')](_0xc2d2('0xb3'),_0x4edeed[_0xc2d2('0xb0')]['name'],_0x4edeed[_0xc2d2('0xb0')][_0xc2d2('0xb1')]):_0xc2d2('0xb4'),'browserVersion':_0x4edeed[_0xc2d2('0xb0')][_0xc2d2('0xb1')]||_0xc2d2('0xb4'),'osName':util['format'](_0xc2d2('0xb3'),_0x4edeed['os'][_0xc2d2('0x3c')],_0x4edeed['os']['version']),'osVersion':_0x4edeed['os'][_0xc2d2('0xb1')],'deviceModel':_0x4edeed[_0xc2d2('0xb5')][_0xc2d2('0x48')]&&_0x4edeed['device']['vendor']?util[_0xc2d2('0xb2')](_0xc2d2('0xb6'),_0x4edeed[_0xc2d2('0xb5')][_0xc2d2('0x48')],_0x4edeed[_0xc2d2('0xb5')][_0xc2d2('0xb7')],_0x4edeed[_0xc2d2('0xb5')]['type']):null,'deviceVendor':_0x4edeed['device'][_0xc2d2('0xb7')],'deviceType':_0x4edeed[_0xc2d2('0xb5')]['type'],'formData':JSON[_0xc2d2('0x25')](_0x170808[_0xc2d2('0x5d')])};var _0x2a03f6={'ChatWebsiteId':_0x170808['params']['id'],'closed':![]};if(_0x170808['body'][_0xc2d2('0xb8')]){_0x2a03f6[_0xc2d2('0xb8')]=_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xb8')];return db[_0xc2d2('0xb9')][_0xc2d2('0x5b')]({'where':_0x2a03f6})[_0xc2d2('0x21')](function(_0xd916ec){if(_0xd916ec){return[_0xd916ec,![]];}_0x3373d7[_0xc2d2('0xb8')]=_0x170808['body']['threadId'];_0x3373d7[_0xc2d2('0xba')]=_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xba')];return db[_0xc2d2('0xb9')][_0xc2d2('0x5c')](_0x3373d7)[_0xc2d2('0x21')](function(_0x3d8380){return[_0x3d8380,!![]];});});}_0x2a03f6[_0xc2d2('0xbb')]=_0x336763['id'];if(_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xbc')]&&_0x170808['body'][_0xc2d2('0xbc')]['id']){_0x2a03f6['id']=_0x170808['body']['interaction']['id'];return db['ChatInteraction'][_0xc2d2('0x5b')]({'where':_0x2a03f6})[_0xc2d2('0x21')](function(_0x5b4a26){if(_0x5b4a26){return[_0x5b4a26,![]];}return db['ChatInteraction']['create'](_0x3373d7)[_0xc2d2('0x21')](function(_0x2f3ec0){return[_0x2f3ec0,!![]];});});}return db[_0xc2d2('0xb9')][_0xc2d2('0x5c')](_0x3373d7)[_0xc2d2('0x21')](function(_0x2e729a){return[_0x2e729a,!![]];});}})[_0xc2d2('0xbd')](function(_0x4d875e,_0x2fa727){if(_0x4d875e){_0x203aac=_0x2fa727;if(!_0x2fa727){var _0xd1c839={'from':(_0x20dad5[_0xc2d2('0xa7')][_0xc2d2('0xac')]||'')+'\x20'+(_0x20dad5[_0xc2d2('0xa7')]['lastName']||'')};if(_0x170808['body'][_0xc2d2('0xb8')]&&_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xbe')]&&_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xb8')]!=_0x170808[_0xc2d2('0x5d')]['messageId']){_0xd1c839[_0xc2d2('0xb8')]=_0x170808[_0xc2d2('0x5d')][_0xc2d2('0xbe')];}return _0x4d875e[_0xc2d2('0x36')](_0xd1c839);}else{return _0x4d875e;}}})[_0xc2d2('0x21')](function(_0x5e0fe4){_0x20dad5['interaction']=_0x5e0fe4[_0xc2d2('0x38')]({'plain':!![]});_0x20dad5['interaction']['created']=_0x203aac;if(_0x20dad5[_0xc2d2('0xbc')][_0xc2d2('0xbf')]){if(_0x20dad5[_0xc2d2('0xa0')]['autoclose']){_0x20dad5[_0xc2d2('0xa1')][_0xc2d2('0xc0')]({'id':0x0,'priority':_0x20dad5['applications']['length']+0x1,'app':_0xc2d2('0xc1'),'appdata':_0xc2d2('0xc2'),'interval':_0xc2d2('0xc3')});}}return db[_0xc2d2('0xc4')][_0xc2d2('0x5c')]({'body':_0x170808[_0xc2d2('0x5d')]['body'],'ChatWebsiteId':_0x170808[_0xc2d2('0x58')]['id'],'ChatInteractionId':_0x5e0fe4['id'],'direction':'in','ContactId':_0x20dad5[_0xc2d2('0xa7')]['id'],'AttachmentId':_0x170808['body'][_0xc2d2('0xc5')]});})['then'](function(_0x41eab8){_0x20dad5['message']=_0x41eab8;if(_0x20dad5[_0xc2d2('0xbc')][_0xc2d2('0xc6')]){return db[_0xc2d2('0xc7')]['find']({'attributes':['id',_0xc2d2('0x3c')],'where':{'id':_0x20dad5[_0xc2d2('0xbc')][_0xc2d2('0xc6')]}})['then'](function(_0x22e031){if(_0x22e031){_0x20dad5[_0xc2d2('0xa1')][_0xc2d2('0xc8')]({'id':0x0,'priority':0x0,'app':_0xc2d2('0xc9'),'appdata':_0x22e031[_0xc2d2('0x3c')]+','+(_0x20dad5[_0xc2d2('0xa0')][_0xc2d2('0xca')]||0xa),'interval':_0xc2d2('0xc3')});_0x20dad5[_0xc2d2('0xcb')]=!![];}return respondWithRpcPromise('Start',_0xc2d2('0xcc'),_0x20dad5);});}return respondWithRpcPromise(_0xc2d2('0xcd'),'startRouting',_0x20dad5);})[_0xc2d2('0x21')](function(_0x527cfc){respondWithRpcPromise(_0xc2d2('0xce'),_0xc2d2('0xce'),{'event':_0xc2d2('0x89'),'message':_0x527cfc},client9002);return _0x527cfc;})[_0xc2d2('0x21')](respondWithResult(_0x526a98,null))[_0xc2d2('0x56')](handleError(_0x526a98,null));};exports['offline']=function(_0x5ea697,_0x445f86,_0x10b168){var _0x27d804,_0x4e6243,_0x15bf22;var _0x5214fb=[];var _0x5a575d=[];var _0x1c913d={};var _0x377141=_0x5ea697[_0xc2d2('0xcf')]||[];var _0x2be476=[];var _0x735f99;return db[_0xc2d2('0x9e')][_0xc2d2('0x64')]()[_0xc2d2('0x21')](function(_0x13799c){if(!_0x13799c){throw new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x91'));}_0x5a575d=_[_0xc2d2('0x93')](_[_0xc2d2('0x59')](_0x13799c),['createdAt','updatedAt']);_0x5214fb=_[_0xc2d2('0x93')](_[_0xc2d2('0x59')](_0x13799c),['createdAt','updatedAt',_0xc2d2('0x95'),_0xc2d2('0x96')]);if(_0x5ea697[_0xc2d2('0x5d')]['id']){delete _0x5ea697[_0xc2d2('0x5d')]['id'];}if(_[_0xc2d2('0x85')](_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x97')])){throw _0x445f86[_0xc2d2('0x2a')](0x1f4)[_0xc2d2('0x3d')](new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))](_0xc2d2('0x98')));}if(_[_0xc2d2('0x85')](_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x5d')])||_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x5d')]===''){throw _0x445f86[_0xc2d2('0x2a')](0x1f4)[_0xc2d2('0x3d')](new db['Sequelize'][(_0xc2d2('0x90'))](_0xc2d2('0x99')));}if(_[_0xc2d2('0x85')](_0x5ea697['body'][_0xc2d2('0xd0')])){throw _0x445f86[_0xc2d2('0x2a')](0x1f4)[_0xc2d2('0x3d')](new db['Sequelize'][(_0xc2d2('0x90'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5214fb));}if(!_[_0xc2d2('0xd1')](_0x5214fb,_0x5ea697[_0xc2d2('0x5d')]['mapKeyOffline'])){throw _0x445f86[_0xc2d2('0x2a')](0x1f4)[_0xc2d2('0x3d')](new db[(_0xc2d2('0x8f'))][(_0xc2d2('0x90'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5214fb));}_0x1c913d[_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0xd0')]]=_0x5ea697['body'][_0xc2d2('0x97')];})[_0xc2d2('0x21')](function(){return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x5ea697[_0xc2d2('0x58')]['id']},'include':[{'model':db['CmList'],'as':_0xc2d2('0x9d')},{'model':db[_0xc2d2('0xd2')],'as':_0xc2d2('0xd2')}]});})[_0xc2d2('0x21')](handleEntityNotFound(_0x445f86,null))[_0xc2d2('0x21')](function(_0x35ce86){if(_0x35ce86&&_0x35ce86[_0xc2d2('0x9d')]){_0x4e6243=_0x35ce86;var _0x52e04f=_[_0xc2d2('0x1a')](_0x5ea697[_0xc2d2('0x5d')],{'firstName':_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x97')],'phone':_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x97')],'ListId':_0x35ce86[_0xc2d2('0x96')]});_0x52e04f[_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0xd0')]]=_0x5ea697[_0xc2d2('0x5d')][_0xc2d2('0x97')];return db[_0xc2d2('0x9e')][_0xc2d2('0xd3')]({'where':_0x1c913d,'defaults':_0x52e04f});}})[_0xc2d2('0xbd')](function(_0x3c8bb2){if(_0x3c8bb2){_0x15bf22=_0x3c8bb2;var _0x3823cb=fs[_0xc2d2('0xd4')](path[_0xc2d2('0x7e')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0xc2d2('0xd5'));var _0x28c2e9=ejs[_0xc2d2('0xd6')](_0x3823cb,{'body':_[_0xc2d2('0xd7')](_0x5ea697['body'][_0xc2d2('0x5d')]),'bodyTitle':_0x4e6243[_0xc2d2('0xd8')]});return db[_0xc2d2('0xd9')][_0xc2d2('0x5c')]({'body':_0x28c2e9,'ContactId':_0x3c8bb2['id'],'ChatWebsiteId':_0x4e6243['id']});}})[_0xc2d2('0x21')](function(_0x59f841){_0x735f99=_0x59f841;if(_0x377141[_0xc2d2('0x47')]){var _0x1b696d=_0x377141[_0xc2d2('0x40')](function(_0x433cfd){return{'name':_0x433cfd['originalname'],'basename':_0x433cfd[_0xc2d2('0x73')],'type':_0x433cfd[_0xc2d2('0xda')],'ChatOfflineMessageId':_0x59f841['id']};});_0x2be476=_0x1b696d[_0xc2d2('0x40')](_0x34d1d1=>{var _0x54b1b8={'filename':_0x34d1d1[_0xc2d2('0x3c')],'path':path['join'](config[_0xc2d2('0x7a')],'server','files','attachments',_0xc2d2('0xdb'),_0x34d1d1[_0xc2d2('0xdc')])};return _0x54b1b8;});if(!_0x4e6243[_0xc2d2('0xdd')]){return db[_0xc2d2('0xde')][_0xc2d2('0xdf')](function(_0x418a08){return db[_0xc2d2('0xe0')][_0xc2d2('0xe1')](_0x1b696d,{'transaction':_0x418a08});});}}})[_0xc2d2('0x21')](function(){if(_0x735f99){_0x27d804=_0x735f99;return db[_0xc2d2('0xd2')][_0xc2d2('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0xc2d2('0xe2')],'as':_0xc2d2('0xe3'),'raw':!![]}]});}})[_0xc2d2('0x21')](function(_0x6738f6){if(_0x6738f6&&_0x6738f6[_0xc2d2('0xe3')]&&_0x4e6243[_0xc2d2('0xe4')]&&_0x4e6243[_0xc2d2('0xe5')]){var _0x1b1b05={'tls':{'rejectUnauthorized':![]}};if(_0x6738f6[_0xc2d2('0xe3')]['service']){_0x1b1b05[_0xc2d2('0xe6')]=_0x6738f6[_0xc2d2('0xe3')][_0xc2d2('0xe6')];}else{_0x1b1b05['host']=_0x6738f6['Smtp']['host'];_0x1b1b05[_0xc2d2('0xe7')]=_0x6738f6[_0xc2d2('0xe3')][_0xc2d2('0xe7')];_0x1b1b05['secure']=_0x6738f6[_0xc2d2('0xe3')][_0xc2d2('0xe8')];}if(_0x6738f6['Smtp']['authentication']){_0x1b1b05[_0xc2d2('0xe9')]={'user':_0x6738f6[_0xc2d2('0xe3')][_0xc2d2('0x5e')],'pass':_0x6738f6[_0xc2d2('0xe3')][_0xc2d2('0xea')]};}return respondWithRpcPromise('SendMail',_0xc2d2('0xeb'),{'account':_0x1b1b05,'message':{'from':util[_0xc2d2('0xb2')](_0xc2d2('0xec'),_0x6738f6[_0xc2d2('0x3c')],_0x6738f6['email']||_0x6738f6['Smtp'][_0xc2d2('0x5e')]),'to':_0x4e6243[_0xc2d2('0xe5')],'subject':_0x4e6243[_0xc2d2('0xed')],'html':_0x27d804['body'],'attachments':_0x2be476}},client9003)[_0xc2d2('0x21')](function(){return _0x27d804;})[_0xc2d2('0x56')](function(_0x2fe58d){console[_0xc2d2('0x26')](_0x2fe58d);});}})[_0xc2d2('0x21')](function(){if(_0x4e6243&&_0x4e6243[_0xc2d2('0xdd')]&&_0x4e6243[_0xc2d2('0xee')]){var _0x32279f=[];if(_0x377141[_0xc2d2('0x47')]){_0x32279f=_0x377141[_0xc2d2('0x40')](function(_0x37df83){return{'name':_0x37df83[_0xc2d2('0xef')],'basename':_0x37df83[_0xc2d2('0x73')],'type':_0x37df83['mimetype'],'ChatOfflineMessageId':_0x735f99['id']};});}var _0x13b903;if(!_['isNil'](_0x4e6243[_0xc2d2('0xf0')])){var _0x30accc=_[_0xc2d2('0x40')](_0x5ea697[_0xc2d2('0x5d')],function(_0x310012){return _0x310012;});var _0x128165=_[_0xc2d2('0xf1')](_0x30accc)[0x0];var _0x4f3325=_[_0xc2d2('0xf2')](_0x128165,function(_0x3e70bd){return _0x3e70bd;});_0x13b903=_0x4f3325[0x1][_0x4e6243[_0xc2d2('0xf0')]];}var _0x4ea027={'from':_0x15bf22[_0xc2d2('0xf3')],'firstName':_0x15bf22[_0xc2d2('0xac')],'lastName':_0x15bf22[_0xc2d2('0xad')],'mapKey':_0xc2d2('0xf3'),'message':{'from':_0x15bf22[_0xc2d2('0xf3')],'to':_0x4e6243['MailAccount'][_0xc2d2('0xf3')],'cc':'','subject':_[_0xc2d2('0x85')](_0x13b903)?_0x4e6243[_0xc2d2('0xed')]:_0x13b903,'messageId':'','sentAt':new Date(),'attach':_0x32279f[_0xc2d2('0x47')],'attachments':_0x32279f,'originChannel':_0xc2d2('0xf4'),'ChatWebsiteId':_0x4e6243['id'],'ChatOfflineMessageId':_0x27d804['id'],'originTo':_0x4e6243[_0xc2d2('0xd2')][_0xc2d2('0xf3')]},'body':_0x27d804[_0xc2d2('0x5d')]};var _0x4bbb82={'account':{'id':_0x4e6243[_0xc2d2('0xee')]},'body':_0x4ea027,'log':_0xc2d2('0xf5')};return respondWithRpcPromise(_0xc2d2('0xf5'),_0xc2d2('0xf6'),_0x4bbb82,client9001)[_0xc2d2('0x21')](function(){return _0x27d804;})[_0xc2d2('0x56')](function(_0x3cd944){console[_0xc2d2('0x26')](_0x3cd944);});}return;})[_0xc2d2('0x21')](function(){if(_0x27d804){return _0x27d804;}})[_0xc2d2('0x21')](respondWithResult(_0x445f86,null))['catch'](function(_0x28e4b9){console[_0xc2d2('0x26')]('catch',_0x28e4b9);for(var _0x595e76 of _0x377141){var _0x46a60b=path[_0xc2d2('0x7e')](config[_0xc2d2('0x7a')],_0xc2d2('0xf7'),_0xc2d2('0xcf'),_0xc2d2('0xf8'),_0xc2d2('0xdb'),_0x595e76[_0xc2d2('0x73')]);fs_extra[_0xc2d2('0xf9')](_0x46a60b)[_0xc2d2('0x56')](function(_0x54d34b){console[_0xc2d2('0x26')]('Could\x20not\x20remove\x20attachment\x20file',_0x46a60b,_0x54d34b);});}});};exports[_0xc2d2('0xfa')]=function(_0x20de97,_0x5b40ac,_0x105621){return db[_0xc2d2('0xb9')][_0xc2d2('0x5b')]({'where':{'id':_0x20de97['params']['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x5b40ac,null))[_0xc2d2('0x21')](function(_0x5ae770){if(_0x5ae770){return _0x5ae770[_0xc2d2('0xfa')](_0x20de97[_0xc2d2('0x5d')][_0xc2d2('0x6b')],_['omit'](_0x20de97['body'],[_0xc2d2('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x5b40ac,null))['catch'](handleError(_0x5b40ac,null));};exports[_0xc2d2('0xfb')]=function(_0x588df2,_0x205bc6,_0x16cc9d){var _0xedb9e6={'raw':![],'where':{}};var _0x46197f={};var _0x24e77f={'count':0x0,'rows':[]};return db[_0xc2d2('0x41')][_0xc2d2('0x68')]({'where':{'id':_0x588df2['params']['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x205bc6,null))['then'](function(_0x412752){if(_0x412752){_0x46197f[_0xc2d2('0x48')]=_[_0xc2d2('0x59')](db['ChatInteraction']['rawAttributes']);_0x46197f[_0xc2d2('0x44')]=_[_0xc2d2('0x59')](_0x588df2[_0xc2d2('0x44')]);_0x46197f['filters']=_['intersection'](_0x46197f['model'],_0x46197f[_0xc2d2('0x44')]);_0xedb9e6[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x46197f[_0xc2d2('0x48')],qs[_0xc2d2('0x45')](_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x45')]));_0xedb9e6[_0xc2d2('0x46')]=_0xedb9e6[_0xc2d2('0x46')][_0xc2d2('0x47')]?_0xedb9e6['attributes']:_0x46197f[_0xc2d2('0x48')];if(!_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0xedb9e6['limit']=qs[_0xc2d2('0x30')](_0x588df2['query'][_0xc2d2('0x30')]);_0xedb9e6[_0xc2d2('0x2d')]=qs[_0xc2d2('0x2d')](_0x588df2['query'][_0xc2d2('0x2d')]);}_0xedb9e6[_0xc2d2('0x4b')]=qs['sort'](_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x4c')]);_0xedb9e6[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_[_0xc2d2('0x4f')](_0x588df2[_0xc2d2('0x44')],_0x46197f['filters']));_0xedb9e6[_0xc2d2('0x4d')][_0xc2d2('0x66')]=_0x412752['id'];if(_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x50')]){_0xedb9e6[_0xc2d2('0x4d')]=_['merge'](_0xedb9e6[_0xc2d2('0x4d')],{'$or':_[_0xc2d2('0x40')](_0xedb9e6[_0xc2d2('0x46')],function(_0x2b7bb4){var _0x5692de={};_0x5692de[_0x2b7bb4]={'$like':'%'+_0x588df2[_0xc2d2('0x44')]['filter']+'%'};return _0x5692de;})});}_0xedb9e6=_[_0xc2d2('0x51')]({},_0xedb9e6,_0x588df2[_0xc2d2('0x6f')]);return db[_0xc2d2('0xb9')][_0xc2d2('0x2f')]({'where':_0xedb9e6[_0xc2d2('0x4d')]})['then'](function(_0x1dde1f){_0x24e77f[_0xc2d2('0x2f')]=_0x1dde1f;if(_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0xedb9e6[_0xc2d2('0x6a')]=[{'model':db[_0xc2d2('0x9e')],'as':_0xc2d2('0xfc'),'required':![]},{'model':db[_0xc2d2('0xc7')],'as':_0xc2d2('0xfd'),'attributes':[_0xc2d2('0x3c'),'fullname',_0xc2d2('0xfe')],'required':![]},{'model':db[_0xc2d2('0xff')],'as':_0xc2d2('0x100'),'attributes':['id',_0xc2d2('0x3c'),_0xc2d2('0x101')],'where':_0x588df2['query'][_0xc2d2('0x102')]?{'id':_0x588df2[_0xc2d2('0x44')]['tag']}:undefined,'required':_0x588df2[_0xc2d2('0x44')][_0xc2d2('0x102')]?!![]:![]}];}return db[_0xc2d2('0xb9')][_0xc2d2('0x54')](_0xedb9e6);})[_0xc2d2('0x21')](function(_0x140618){_0x24e77f[_0xc2d2('0x55')]=_0x140618;return _0x24e77f;});}})[_0xc2d2('0x21')](respondWithFilteredResult(_0x205bc6,_0xedb9e6))['catch'](handleError(_0x205bc6,null));};function iftimePromise(_0x4c21a1,_0x2b851f){return respondWithRpcPromise(_0xc2d2('0x103'),_0xc2d2('0x104'),{'command':_0x2b851f[_0xc2d2('0x105')]?util['format'](_0xc2d2('0x106'),_0x4c21a1[_0xc2d2('0x107')],_0x2b851f[_0xc2d2('0x105')]):util[_0xc2d2('0xb2')]('iftime\x20%s',_0x4c21a1[_0xc2d2('0x107')])},client9002)[_0xc2d2('0x21')](function(_0x186dda){var _0x596f12=_0x186dda&&_0x186dda['indexOf'](_0xc2d2('0x108'))>=0x0?!![]:![];logger['info'](_0xc2d2('0x109'),_0x2b851f['id'],_0x4c21a1['id'],_0x4c21a1['interval'],_0x596f12?_0xc2d2('0x10a'):_0xc2d2('0x10b'),_0x2b851f[_0xc2d2('0x105')]?_0x2b851f[_0xc2d2('0x105')]:_0xc2d2('0x10c'));return _0x596f12;})[_0xc2d2('0x56')](function(_0x54871d){logger[_0xc2d2('0x26')](_0xc2d2('0x109'),_0x2b851f['id'],_0x4c21a1['id'],_0x4c21a1[_0xc2d2('0x107')],util['inspect'](_0x54871d,{'showHidden':![],'depth':null}),_0x2b851f[_0xc2d2('0x105')]?_0x2b851f[_0xc2d2('0x105')]:_0xc2d2('0x10c'));return![];});}exports[_0xc2d2('0x104')]=function(_0x56735f,_0x16ce7,_0x47697f){var _0x47a7e0=0x0;var _0x1a4a7e=0x0;var _0x5c5629=![];var _0x448890;var _0x2e718e;return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x56735f[_0xc2d2('0x58')]['id']},'include':[{'model':db[_0xc2d2('0x10d')],'as':'Interval','include':[{'model':db[_0xc2d2('0x10d')],'as':_0xc2d2('0x10e'),'attributes':['id',_0xc2d2('0x107')],'raw':!![]}]}]})[_0xc2d2('0x21')](handleEntityNotFound(_0x16ce7,null))['then'](function(_0x236d11){if(_0x236d11){_0x448890=_0x236d11;return _0x236d11[_0xc2d2('0x10f')]({'raw':!![]});}})['then'](function(_0x3ffa3e){if(_0x448890){if(_0x3ffa3e){_0x2e718e=_0x3ffa3e;}}return require(_0xc2d2('0x18'))['getLicense']();})[_0xc2d2('0x21')](function(_0x55dfae){if(_0x55dfae){_0x1a4a7e=_0x55dfae[_0xc2d2('0x110')];_0x5c5629=_0x55dfae[_0xc2d2('0x7c')];}})[_0xc2d2('0x21')](function(){return db['ChatInteraction'][_0xc2d2('0x2f')]({'where':{'closed':![]}});})[_0xc2d2('0x21')](function(_0x185db9){_0x47a7e0=_0x185db9;if(_0x1a4a7e&&_0x185db9>_0x1a4a7e){return db['License'][_0xc2d2('0x68')]({'where':{'id':0x1}})[_0xc2d2('0x21')](function(_0x3af522){if(_0x3af522){_0x3af522[_0xc2d2('0x111')](_0xc2d2('0x112'));}});}})[_0xc2d2('0x21')](function(){if(_0x448890[_0xc2d2('0x10d')]&&_0x448890['Interval'][_0xc2d2('0x10e')]){var _0x2813c3=[];for(var _0x151c59=0x0;_0x151c59<_0x448890['Interval']['Intervals'][_0xc2d2('0x47')];_0x151c59++){var _0x457424=_0x448890['Interval'][_0xc2d2('0x10e')][_0x151c59][_0xc2d2('0x38')]({'plain':!![]});_0x2813c3['push'](iftimePromise(_0x457424,_0x448890));}return BPromise[_0xc2d2('0x113')](_0x2813c3)[_0xc2d2('0x21')](function(_0xbbed4c){return _[_0xc2d2('0x114')](_0xbbed4c);});}else{return!![];}})[_0xc2d2('0x21')](function(_0x35bb5f){var _0x4a07eb=fs['readFileSync'](path[_0xc2d2('0x7e')](config['root'],_0xc2d2('0x115')),_0xc2d2('0xd5'));var _0x48a935={'remote':_0x448890[_0xc2d2('0x116')],'query':querystring[_0xc2d2('0x25')](_[_0xc2d2('0x51')](_0x448890['get']({'plain':!![]}),{'customerIp':_0x56735f['headers']['x-forwarded-for']||_0x56735f[_0xc2d2('0x8b')][_0xc2d2('0x117')]||_0x56735f[_0xc2d2('0x118')][_0xc2d2('0x119')]||_0x56735f['ip'],'referer':_0x56735f[_0xc2d2('0x8b')]['referer'],'openedInteractions':_0x47a7e0,'maxInteractions':_0x1a4a7e,'virtual':_0x5c5629[_0xc2d2('0x110')],'online':_0x35bb5f,'custom':_0x5c5629}))[_0xc2d2('0x11a')](/'/g,'\x5c\x27')};_0x16ce7['send'](ejs[_0xc2d2('0xd6')](Mustache[_0xc2d2('0xd6')](_0x4a07eb,_0x48a935),{'proactiveActions':_0x2e718e,'alignment':_0x448890[_0xc2d2('0x11b')],'verticalAlignment':_0x448890[_0xc2d2('0x11c')],'div_color':_0x448890[_0xc2d2('0x101')],'text_color':_0x448890[_0xc2d2('0x11d')],'button_color':_0x448890['color_button'],'background_color':_0x448890[_0xc2d2('0x11e')]}));})[_0xc2d2('0x56')](handleError(_0x16ce7,null));};exports['addApplications']=function(_0x22b120,_0x58b622,_0x2354c1){return db['ChatWebsite'][_0xc2d2('0x68')]({'where':{'id':_0x22b120[_0xc2d2('0x58')]['id']}})['then'](handleEntityNotFound(_0x58b622,null))[_0xc2d2('0x21')](function(_0x351f0d){if(_0x351f0d){return db[_0xc2d2('0xde')][_0xc2d2('0xdf')](function(_0x2434e6){return db[_0xc2d2('0x11f')][_0xc2d2('0x37')]({'where':{'ChatWebsiteId':_0x22b120[_0xc2d2('0x58')]['id']},'transaction':_0x2434e6})[_0xc2d2('0x21')](function(_0x422b24){var _0x64cbdf=_['map'](_0x22b120[_0xc2d2('0x5d')],function(_0x19d01a){_0x19d01a[_0xc2d2('0x66')]=_0x22b120['params']['id'];return _0x19d01a;});return db[_0xc2d2('0x11f')]['bulkCreate'](_0x64cbdf,{'transaction':_0x2434e6});});})['then'](function(){return db[_0xc2d2('0x11f')][_0xc2d2('0x120')]({'where':{'ChatWebsiteId':_0x22b120[_0xc2d2('0x58')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x58b622,null))[_0xc2d2('0x56')](handleError(_0x58b622,null));};exports[_0xc2d2('0x121')]=function(_0x419113,_0xd59e02,_0x5f73d3){var _0x3dd029={};var _0x4e750e={};var _0x4a39f5;var _0x11ebb1;return db['ChatWebsite']['findOne']({'where':{'id':_0x419113[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0xd59e02,null))[_0xc2d2('0x21')](function(_0x4af8ab){if(_0x4af8ab){_0x4a39f5=_0x4af8ab;_0x4e750e[_0xc2d2('0x48')]=_[_0xc2d2('0x59')](db['ChatApplication'][_0xc2d2('0x42')]);_0x4e750e[_0xc2d2('0x44')]=_['keys'](_0x419113[_0xc2d2('0x44')]);_0x4e750e['filters']=_[_0xc2d2('0x5a')](_0x4e750e[_0xc2d2('0x48')],_0x4e750e['query']);_0x3dd029[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x4e750e[_0xc2d2('0x48')],qs['fields'](_0x419113[_0xc2d2('0x44')]['fields']));_0x3dd029['attributes']=_0x3dd029[_0xc2d2('0x46')][_0xc2d2('0x47')]?_0x3dd029['attributes']:_0x4e750e[_0xc2d2('0x48')];_0x3dd029['order']=qs[_0xc2d2('0x4c')](_0x419113[_0xc2d2('0x44')][_0xc2d2('0x4c')]);_0x3dd029[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_[_0xc2d2('0x4f')](_0x419113[_0xc2d2('0x44')],_0x4e750e[_0xc2d2('0x4e')]));if(_0x419113['query'][_0xc2d2('0x50')]){_0x3dd029[_0xc2d2('0x4d')]=_[_0xc2d2('0x51')](_0x3dd029[_0xc2d2('0x4d')],{'$or':_[_0xc2d2('0x40')](_0x3dd029[_0xc2d2('0x46')],function(_0x59fca7){var _0x25d492={};_0x25d492[_0x59fca7]={'$like':'%'+_0x419113[_0xc2d2('0x44')][_0xc2d2('0x50')]+'%'};return _0x25d492;})});}_0x3dd029=_[_0xc2d2('0x51')]({},_0x3dd029,_0x419113[_0xc2d2('0x6f')]);return _0x4a39f5['getApplications'](_0x3dd029);}})['then'](function(_0x51a579){if(_0x51a579){_0x11ebb1=_0x51a579['length'];if(!_0x419113['query']['hasOwnProperty'](_0xc2d2('0x4a'))){_0x3dd029[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0x419113[_0xc2d2('0x44')]['limit']);_0x3dd029['offset']=qs[_0xc2d2('0x2d')](_0x419113[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}return _0x4a39f5[_0xc2d2('0x121')](_0x3dd029);}})[_0xc2d2('0x21')](function(_0x500e22){if(_0x500e22){return _0x500e22?{'count':_0x11ebb1,'rows':_0x500e22}:null;}})['then'](respondWithResult(_0xd59e02,null))[_0xc2d2('0x56')](handleError(_0xd59e02,null));};exports['addProactiveActions']=function(_0x397d1a,_0x139bc3,_0x4e2f3f){return db[_0xc2d2('0x122')]['find']({'where':{'id':_0x397d1a['params']['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x139bc3,null))['then'](function(_0x419812){if(_0x419812){return _0x419812[_0xc2d2('0x123')](_0x397d1a[_0xc2d2('0x5d')][_0xc2d2('0x6b')],_['omit'](_0x397d1a[_0xc2d2('0x5d')],[_0xc2d2('0x6b'),'id'])||{});}})[_0xc2d2('0x21')](respondWithResult(_0x139bc3,null))[_0xc2d2('0x56')](handleError(_0x139bc3,null));};exports[_0xc2d2('0x10f')]=function(_0x1ed860,_0x1086f5,_0x19a063){var _0x931c7f={};var _0x5cbd6d={};var _0x32a842;var _0x193539;return db[_0xc2d2('0x41')]['findOne']({'where':{'id':_0x1ed860[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x1086f5,null))[_0xc2d2('0x21')](function(_0x16b67e){if(_0x16b67e){_0x32a842=_0x16b67e;_0x5cbd6d[_0xc2d2('0x48')]=_[_0xc2d2('0x59')](db[_0xc2d2('0x124')][_0xc2d2('0x42')]);_0x5cbd6d['query']=_[_0xc2d2('0x59')](_0x1ed860[_0xc2d2('0x44')]);_0x5cbd6d[_0xc2d2('0x4e')]=_[_0xc2d2('0x5a')](_0x5cbd6d[_0xc2d2('0x48')],_0x5cbd6d[_0xc2d2('0x44')]);_0x931c7f[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x5cbd6d[_0xc2d2('0x48')],qs['fields'](_0x1ed860['query'][_0xc2d2('0x45')]));_0x931c7f[_0xc2d2('0x46')]=_0x931c7f['attributes'][_0xc2d2('0x47')]?_0x931c7f['attributes']:_0x5cbd6d[_0xc2d2('0x48')];_0x931c7f[_0xc2d2('0x4b')]=qs['sort'](_0x1ed860[_0xc2d2('0x44')][_0xc2d2('0x4c')]);_0x931c7f[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_[_0xc2d2('0x4f')](_0x1ed860['query'],_0x5cbd6d['filters']));if(_0x1ed860[_0xc2d2('0x44')][_0xc2d2('0x50')]){_0x931c7f['where']=_['merge'](_0x931c7f['where'],{'$or':_[_0xc2d2('0x40')](_0x931c7f[_0xc2d2('0x46')],function(_0x38e1ad){var _0x1e38ab={};_0x1e38ab[_0x38e1ad]={'$like':'%'+_0x1ed860['query'][_0xc2d2('0x50')]+'%'};return _0x1e38ab;})});}_0x931c7f=_[_0xc2d2('0x51')]({},_0x931c7f,_0x1ed860['options']);return _0x32a842[_0xc2d2('0x10f')](_0x931c7f);}})[_0xc2d2('0x21')](function(_0x365c10){if(_0x365c10){_0x193539=_0x365c10[_0xc2d2('0x47')];if(!_0x1ed860[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0x931c7f[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0x1ed860[_0xc2d2('0x44')][_0xc2d2('0x30')]);_0x931c7f['offset']=qs[_0xc2d2('0x2d')](_0x1ed860[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}return _0x32a842['getProactiveActions'](_0x931c7f);}})[_0xc2d2('0x21')](function(_0x526ce2){if(_0x526ce2){return _0x526ce2?{'count':_0x193539,'rows':_0x526ce2}:null;}})['then'](respondWithResult(_0x1086f5,null))[_0xc2d2('0x56')](handleError(_0x1086f5,null));};exports[_0xc2d2('0x125')]=function(_0x31aa1f,_0x11e350,_0x467c35){var _0x25a2e4=_0x31aa1f[_0xc2d2('0x44')][_0xc2d2('0x126')]===_0xc2d2('0x127')?_0xc2d2('0x128'):'onlineForm';return db['ChatWebsite'][_0xc2d2('0x5b')]({'attributes':['id',_0x25a2e4],'where':{'id':_0x31aa1f[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x11e350,null))[_0xc2d2('0x21')](function(_0x4ca46f){if(_0x4ca46f){var _0x3ec395=_0x4ca46f[_0x25a2e4];var _0x51d102=_0x3ec395&&_0x3ec395[_0xc2d2('0x129')]?_0x3ec395[_0xc2d2('0x129')]:[];_0x11e350[_0xc2d2('0x3d')]({'fromKey':_[_0xc2d2('0x85')](_0x3ec395[_0xc2d2('0x12a')])?undefined:_0x3ec395[_0xc2d2('0x12a')],'count':_0x51d102[_0xc2d2('0x47')],'rows':_0x51d102});}})[_0xc2d2('0x56')](handleError(_0x11e350,null));};exports[_0xc2d2('0x12b')]=function(_0x11b8c2,_0x2507a7,_0x1eb875){var _0x5a5ea6={'raw':![],'where':{}};var _0x429262={};var _0x47f6ad={'count':0x0,'rows':[]};return db[_0xc2d2('0x41')]['findOne']({'where':{'id':_0x11b8c2[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x2507a7,null))[_0xc2d2('0x21')](function(_0xcbe640){if(_0xcbe640){_0x429262['model']=_[_0xc2d2('0x59')](db[_0xc2d2('0xd9')]['rawAttributes']);_0x429262[_0xc2d2('0x44')]=_[_0xc2d2('0x59')](_0x11b8c2['query']);_0x429262[_0xc2d2('0x4e')]=_['intersection'](_0x429262['model'],_0x429262[_0xc2d2('0x44')]);_0x5a5ea6[_0xc2d2('0x46')]=_[_0xc2d2('0x5a')](_0x429262[_0xc2d2('0x48')],qs[_0xc2d2('0x45')](_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x45')]));_0x5a5ea6[_0xc2d2('0x46')]=_0x5a5ea6['attributes'][_0xc2d2('0x47')]?_0x5a5ea6['attributes']:_0x429262[_0xc2d2('0x48')];if(!_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0x5a5ea6['limit']=qs['limit'](_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x30')]);_0x5a5ea6['offset']=qs[_0xc2d2('0x2d')](_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}_0x5a5ea6[_0xc2d2('0x4b')]=qs['sort'](_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x4c')]);_0x5a5ea6[_0xc2d2('0x4d')]=qs[_0xc2d2('0x4e')](_['pick'](_0x11b8c2[_0xc2d2('0x44')],_0x429262[_0xc2d2('0x4e')]));_0x5a5ea6['where'][_0xc2d2('0x66')]=_0xcbe640['id'];if(_0x11b8c2[_0xc2d2('0x44')]['filter']){_0x5a5ea6['where']=_[_0xc2d2('0x51')](_0x5a5ea6['where'],{'$or':_[_0xc2d2('0x40')](_0x5a5ea6[_0xc2d2('0x46')],function(_0x4c1244){var _0x33e917={};_0x33e917[_0x4c1244]={'$like':'%'+_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x50')]+'%'};return _0x33e917;})});}_0x5a5ea6=_[_0xc2d2('0x51')]({},_0x5a5ea6,_0x11b8c2['options']);return db[_0xc2d2('0xd9')][_0xc2d2('0x2f')]({'where':_0x5a5ea6[_0xc2d2('0x4d')]})[_0xc2d2('0x21')](function(_0x38a82e){_0x47f6ad[_0xc2d2('0x2f')]=_0x38a82e;if(_0x11b8c2[_0xc2d2('0x44')][_0xc2d2('0x53')]){_0x5a5ea6[_0xc2d2('0x6a')]=[{'all':!![]}];}else{_0x5a5ea6[_0xc2d2('0x6a')]=[{'model':db[_0xc2d2('0x9e')],'as':_0xc2d2('0xfc'),'required':![]},{'model':db['Attachment'],'as':_0xc2d2('0x12c'),'required':![]}];}return db['ChatOfflineMessage']['findAll'](_0x5a5ea6);})[_0xc2d2('0x21')](function(_0x8c563){_0x47f6ad[_0xc2d2('0x55')]=_0x8c563;return _0x47f6ad;});}})[_0xc2d2('0x21')](respondWithFilteredResult(_0x2507a7,_0x5a5ea6))[_0xc2d2('0x56')](handleError(_0x2507a7,null));};exports[_0xc2d2('0x12d')]=function(_0x51b22e,_0x414b12,_0x22b386){return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x51b22e[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x414b12,null))[_0xc2d2('0x21')](function(_0x4a3aa6){if(_0x4a3aa6){return _0x4a3aa6['addAgents'](_0x51b22e[_0xc2d2('0x5d')]['ids'],_['omit'](_0x51b22e[_0xc2d2('0x5d')],[_0xc2d2('0x6b'),'id'])||{})['spread'](function(_0x57701e){for(var _0x479db3=0x0;_0x479db3<_0x51b22e[_0xc2d2('0x5d')]['ids'][_0xc2d2('0x47')];_0x479db3+=0x1){socket[_0xc2d2('0x12e')](_0xc2d2('0x12f'),{'UserId':Number(_0x51b22e['body'][_0xc2d2('0x6b')][_0x479db3]),'ChatWebsiteId':Number(_0x51b22e[_0xc2d2('0x58')]['id'])});}return _0x57701e;});}})[_0xc2d2('0x21')](respondWithResult(_0x414b12,null))['catch'](handleError(_0x414b12,null));};exports[_0xc2d2('0x130')]=function(_0x21dc33,_0x9a92d1,_0x3cc2ce){return db[_0xc2d2('0x41')][_0xc2d2('0x5b')]({'where':{'id':_0x21dc33[_0xc2d2('0x58')]['id']}})[_0xc2d2('0x21')](handleEntityNotFound(_0x9a92d1,null))['then'](function(_0x4b2c56){if(_0x4b2c56){return _0x4b2c56[_0xc2d2('0x130')](_0x21dc33[_0xc2d2('0x44')][_0xc2d2('0x6b')])[_0xc2d2('0x21')](function(){if(_[_0xc2d2('0x131')](_0x21dc33[_0xc2d2('0x44')][_0xc2d2('0x6b')])){for(var _0xf5eb86=0x0;_0xf5eb86<_0x21dc33[_0xc2d2('0x44')][_0xc2d2('0x6b')]['length'];_0xf5eb86+=0x1){socket['emit'](_0xc2d2('0x132'),{'UserId':Number(_0x21dc33[_0xc2d2('0x44')][_0xc2d2('0x6b')][_0xf5eb86]),'ChatWebsiteId':Number(_0x21dc33['params']['id'])});}}else{socket[_0xc2d2('0x12e')](_0xc2d2('0x132'),{'UserId':Number(_0x21dc33[_0xc2d2('0x44')][_0xc2d2('0x6b')]),'ChatWebsiteId':Number(_0x21dc33['params']['id'])});}});}})['then'](respondWithStatusCode(_0x9a92d1,null))['catch'](handleError(_0x9a92d1,null));};exports[_0xc2d2('0x133')]=function(_0x4e6c85,_0x3c5914,_0x56d5c5){var _0xea6f62={};var _0x37b7d6={};var _0x5e3813;var _0x4caaf8;return db[_0xc2d2('0x41')][_0xc2d2('0x68')]({'where':{'id':_0x4e6c85[_0xc2d2('0x58')]['id']}})['then'](handleEntityNotFound(_0x3c5914,null))[_0xc2d2('0x21')](function(_0x504afb){if(_0x504afb){_0x5e3813=_0x504afb;_0x37b7d6['model']=_['keys'](db[_0xc2d2('0xc7')][_0xc2d2('0x42')]);_0x37b7d6['query']=_[_0xc2d2('0x59')](_0x4e6c85[_0xc2d2('0x44')]);_0x37b7d6[_0xc2d2('0x4e')]=_[_0xc2d2('0x5a')](_0x37b7d6[_0xc2d2('0x48')],_0x37b7d6[_0xc2d2('0x44')]);_0xea6f62[_0xc2d2('0x46')]=_['intersection'](_0x37b7d6[_0xc2d2('0x48')],qs[_0xc2d2('0x45')](_0x4e6c85['query']['fields']));_0xea6f62[_0xc2d2('0x46')]=_0xea6f62['attributes'][_0xc2d2('0x47')]?_0xea6f62[_0xc2d2('0x46')]:_0x37b7d6[_0xc2d2('0x48')];_0xea6f62[_0xc2d2('0x4b')]=qs[_0xc2d2('0x4c')](_0x4e6c85[_0xc2d2('0x44')][_0xc2d2('0x4c')]);_0xea6f62[_0xc2d2('0x4d')]=qs['filters'](_['pick'](_0x4e6c85[_0xc2d2('0x44')],_0x37b7d6[_0xc2d2('0x4e')]));if(_0x4e6c85[_0xc2d2('0x44')][_0xc2d2('0x50')]){_0xea6f62[_0xc2d2('0x4d')]=_[_0xc2d2('0x51')](_0xea6f62['where'],{'$or':_['map'](_0xea6f62['attributes'],function(_0x2a523d){var _0x436547={};_0x436547[_0x2a523d]={'$like':'%'+_0x4e6c85[_0xc2d2('0x44')][_0xc2d2('0x50')]+'%'};return _0x436547;})});}_0xea6f62=_[_0xc2d2('0x51')]({},_0xea6f62,_0x4e6c85[_0xc2d2('0x6f')]);return _0x5e3813[_0xc2d2('0x133')](_0xea6f62);}})[_0xc2d2('0x21')](function(_0x59c1ad){if(_0x59c1ad){_0x4caaf8=_0x59c1ad['length'];if(!_0x4e6c85[_0xc2d2('0x44')][_0xc2d2('0x49')](_0xc2d2('0x4a'))){_0xea6f62[_0xc2d2('0x30')]=qs[_0xc2d2('0x30')](_0x4e6c85[_0xc2d2('0x44')]['limit']);_0xea6f62[_0xc2d2('0x2d')]=qs['offset'](_0x4e6c85[_0xc2d2('0x44')][_0xc2d2('0x2d')]);}return _0x5e3813['getAgents'](_0xea6f62);}})[_0xc2d2('0x21')](function(_0x3a5c65){if(_0x3a5c65){return _0x3a5c65?{'count':_0x4caaf8,'rows':_0x3a5c65}:null;}})['then'](respondWithResult(_0x3c5914,null))[_0xc2d2('0x56')](handleError(_0x3c5914,null));};
\ No newline at end of file
+var _0x9388=['defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','end','json','offset','limit','undefined','set','Content-Range','apply','save','update','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','filter','options','include','findAll','rows','show','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','body','describe','ChatWebsiteId','Disposition','getDispositions','findOne','order','count','removeDispositions','CannedAnswer','getAnswers','includeAll','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','getLogo','join','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','user-agent','getResult','chat','ValidationError','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','List','CmContact','Contacts','DESC','account','applications','Applications','list','orderBy','contact','headers','first','x-forwarded-for','split','firstName','lastName','x-real-port','browser','format','%s\x20%s','unknown','version','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','interaction','spread','messageId','created','autoclose','push','close','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','Attachment','MailAccount','Smtp','service','host','port','secure','pass','SendMail','sendMail','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','ids','getInteractions','Contact','Owner','internal','Tag','color','tag','Command','timezone','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','Interval','Intervals','getProactiveActions','License','all','some','server/files/chat/iframe.ejs','remote','stringify','x-real-ip','referer','virtual','replace','render','alignment','textColor','color_button','addApplications','sequelize','ChatApplication','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','offlineForm','items','fromKey','getOfflineMessages','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x9388,0x10f));var _0x8938=function(_0x2cc555,_0x44123b){_0x2cc555=_0x2cc555-0x0;var _0xb43253=_0x9388[_0x2cc555];return _0xb43253;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8938('0x0'));var zipdir=require(_0x8938('0x1'));var jsonpatch=require(_0x8938('0x2'));var rp=require(_0x8938('0x3'));var moment=require(_0x8938('0x4'));var BPromise=require(_0x8938('0x5'));var Mustache=require(_0x8938('0x6'));var util=require(_0x8938('0x7'));var path=require(_0x8938('0x8'));var sox=require('sox');var csv=require(_0x8938('0x9'));var ejs=require(_0x8938('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8938('0xb'));var crypto=require(_0x8938('0xc'));var jsforce=require(_0x8938('0xd'));var deskjs=require(_0x8938('0xe'));var toCsv=require(_0x8938('0x9'));var querystring=require(_0x8938('0xf'));var Papa=require('papaparse');var Redis=require(_0x8938('0x10'));var authService=require(_0x8938('0x11'));var qs=require(_0x8938('0x12'));var as=require(_0x8938('0x13'));var hardwareService=require(_0x8938('0x14'));var logger=require(_0x8938('0x15'))(_0x8938('0x16'));var utils=require(_0x8938('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8938('0x18'));var db=require('../../mysqldb')['db'];config[_0x8938('0x19')]=_[_0x8938('0x1a')](config[_0x8938('0x19')],{'host':_0x8938('0x1b'),'port':0x18eb});var socket=require(_0x8938('0x1c'))(new Redis(config[_0x8938('0x19')]));require(_0x8938('0x1d'))[_0x8938('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8938('0x1f')][_0x8938('0x20')]({'port':0x232c});var client9002=jayson[_0x8938('0x1f')]['http']({'port':0x232a});var client9003=jayson[_0x8938('0x1f')][_0x8938('0x20')]({'port':0x232b});var client9001=jayson[_0x8938('0x1f')][_0x8938('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x570fed,_0x60346,_0x12689f,_0x4af5ee){return new BPromise(function(_0x5c9bcf,_0x2d9a3f){var _0x45bfa6=_0x4af5ee||client;return _0x45bfa6[_0x8938('0x21')](_0x570fed,_0x12689f)[_0x8938('0x22')](function(_0x61e6ea){logger['info'](_0x8938('0x23'),_0x60346,_0x8938('0x24'));logger[_0x8938('0x25')](_0x8938('0x26'),_0x60346,'request\x20sent',JSON['stringify'](_0x61e6ea));if(_0x61e6ea[_0x8938('0x27')]){if(_0x61e6ea[_0x8938('0x27')]['code']===0x1f4){logger['error'](_0x8938('0x23'),_0x60346,_0x61e6ea[_0x8938('0x27')][_0x8938('0x28')]);return _0x2d9a3f(_0x61e6ea[_0x8938('0x27')]['message']);}logger[_0x8938('0x27')](_0x8938('0x23'),_0x60346,_0x61e6ea[_0x8938('0x27')][_0x8938('0x28')]);return _0x5c9bcf(_0x61e6ea[_0x8938('0x27')]['message']);}else{logger[_0x8938('0x29')](_0x8938('0x23'),_0x60346,_0x8938('0x24'));_0x5c9bcf(_0x61e6ea[_0x8938('0x2a')][_0x8938('0x28')]);}})[_0x8938('0x2b')](function(_0x5c91a0){logger['error'](_0x8938('0x23'),_0x60346,_0x5c91a0);_0x2d9a3f(_0x5c91a0);});});}function respondWithStatusCode(_0xd26d0d,_0x2a15e0){_0x2a15e0=_0x2a15e0||0xcc;return function(_0x216d52){if(_0x216d52){return _0xd26d0d['sendStatus'](_0x2a15e0);}return _0xd26d0d[_0x8938('0x2c')](_0x2a15e0)[_0x8938('0x2d')]();};}function respondWithResult(_0x1ce863,_0x5ba877){_0x5ba877=_0x5ba877||0xc8;return function(_0x7ba87a){if(_0x7ba87a){return _0x1ce863[_0x8938('0x2c')](_0x5ba877)[_0x8938('0x2e')](_0x7ba87a);}};}function respondWithFilteredResult(_0xa1b664,_0x4da873){return function(_0x46881b){if(_0x46881b){var _0x12d72a=typeof _0x4da873[_0x8938('0x2f')]==='undefined'&&typeof _0x4da873[_0x8938('0x30')]===_0x8938('0x31');var _0x304415=_0x46881b['count'];var _0x3bede0=_0x12d72a?0x0:_0x4da873[_0x8938('0x2f')];var _0x16af18=_0x12d72a?_0x46881b['count']:_0x4da873['offset']+_0x4da873[_0x8938('0x30')];var _0x29b02b;if(_0x16af18>=_0x304415){_0x16af18=_0x304415;_0x29b02b=0xc8;}else{_0x29b02b=0xce;}_0xa1b664[_0x8938('0x2c')](_0x29b02b);return _0xa1b664[_0x8938('0x32')](_0x8938('0x33'),_0x3bede0+'-'+_0x16af18+'/'+_0x304415)[_0x8938('0x2e')](_0x46881b);}return null;};}function patchUpdates(_0x4cb898){return function(_0x22ef84){try{jsonpatch[_0x8938('0x34')](_0x22ef84,_0x4cb898,!![]);}catch(_0x9bdb9){return BPromise['reject'](_0x9bdb9);}return _0x22ef84[_0x8938('0x35')]();};}function saveUpdates(_0x36c91c,_0x4942f2){return function(_0x5d5d44){if(_0x5d5d44){return _0x5d5d44[_0x8938('0x36')](_0x36c91c)[_0x8938('0x22')](function(_0x1753ce){return _0x1753ce;});}return null;};}function removeEntity(_0x135910,_0x4d83f9){return function(_0x1d3a36){if(_0x1d3a36){return _0x1d3a36['destroy']()['then'](function(){var _0x27d80b=_0x1d3a36[_0x8938('0x37')]({'plain':!![]});var _0x12a93b=_0x8938('0x38');return db[_0x8938('0x39')][_0x8938('0x3a')]({'where':{'type':_0x12a93b,'resourceId':_0x27d80b['id']}})[_0x8938('0x22')](function(){return _0x1d3a36;});})[_0x8938('0x22')](function(){_0x135910['status'](0xcc)[_0x8938('0x2d')]();});}};}function handleEntityNotFound(_0xe4fe40,_0xeb5724){return function(_0xd3df2){if(!_0xd3df2){_0xe4fe40[_0x8938('0x3b')](0x194);}return _0xd3df2;};}function handleError(_0x46171c,_0x16c359){_0x16c359=_0x16c359||0x1f4;return function(_0x8807c3){logger['error'](_0x8807c3[_0x8938('0x3c')]);if(_0x8807c3[_0x8938('0x3d')]){delete _0x8807c3[_0x8938('0x3d')];}_0x46171c[_0x8938('0x2c')](_0x16c359)[_0x8938('0x3e')](_0x8807c3);};}exports['index']=function(_0x3fdaba,_0x2f1e96){var _0x19dc86={'include':[{'model':db[_0x8938('0x3f')],'as':_0x8938('0x40')}]},_0x42a386={},_0x649414={'count':0x0,'rows':[]};var _0x1289df=_[_0x8938('0x41')](db[_0x8938('0x42')][_0x8938('0x43')],function(_0x30c942){return{'name':_0x30c942[_0x8938('0x44')],'type':_0x30c942[_0x8938('0x45')][_0x8938('0x46')]};});_0x42a386[_0x8938('0x47')]=_['map'](_0x1289df,_0x8938('0x3d'));_0x42a386['query']=_['keys'](_0x3fdaba[_0x8938('0x48')]);_0x42a386['filters']=_[_0x8938('0x49')](_0x42a386[_0x8938('0x47')],_0x42a386[_0x8938('0x48')]);_0x19dc86['attributes']=_[_0x8938('0x49')](_0x42a386['model'],qs['fields'](_0x3fdaba[_0x8938('0x48')][_0x8938('0x4a')]));_0x19dc86[_0x8938('0x4b')]=_0x19dc86[_0x8938('0x4b')][_0x8938('0x4c')]?_0x19dc86[_0x8938('0x4b')]:_0x42a386[_0x8938('0x47')];if(!_0x3fdaba[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x19dc86['limit']=qs[_0x8938('0x30')](_0x3fdaba['query']['limit']);_0x19dc86[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x3fdaba[_0x8938('0x48')]['offset']);}_0x19dc86['order']=qs[_0x8938('0x4f')](_0x3fdaba['query'][_0x8938('0x4f')]);_0x19dc86[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x3fdaba[_0x8938('0x48')],_0x42a386[_0x8938('0x51')]),_0x1289df);if(_0x3fdaba[_0x8938('0x48')]['filter']){_0x19dc86[_0x8938('0x50')]=_[_0x8938('0x53')](_0x19dc86[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x1289df,function(_0x2b9bea){if(_0x2b9bea[_0x8938('0x45')]!=='VIRTUAL'){var _0x57cd6e={};_0x57cd6e[_0x2b9bea[_0x8938('0x3d')]]={'$like':'%'+_0x3fdaba[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x57cd6e;}})});}_0x19dc86=_[_0x8938('0x53')]({},_0x19dc86,_0x3fdaba[_0x8938('0x55')]);var _0x2ec187={'where':_0x19dc86[_0x8938('0x50')]};return db[_0x8938('0x42')]['count'](_0x2ec187)['then'](function(_0x44793a){_0x649414['count']=_0x44793a;if(_0x3fdaba[_0x8938('0x48')]['includeAll']){_0x19dc86[_0x8938('0x56')]=[{'all':!![]}];}return db[_0x8938('0x42')][_0x8938('0x57')](_0x19dc86);})[_0x8938('0x22')](function(_0x2848f2){_0x649414[_0x8938('0x58')]=_0x2848f2;return _0x649414;})[_0x8938('0x22')](respondWithFilteredResult(_0x2f1e96,_0x19dc86))[_0x8938('0x2b')](handleError(_0x2f1e96,null));};exports[_0x8938('0x59')]=function(_0x2beeb5,_0x394f03){var _0x34ae55={'raw':![],'where':{'id':_0x2beeb5[_0x8938('0x5a')]['id']},'include':[{'model':db[_0x8938('0x3f')],'as':_0x8938('0x40')}]},_0x33bef5={};_0x33bef5[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0x42')][_0x8938('0x43')]);_0x33bef5[_0x8938('0x48')]=_[_0x8938('0x5b')](_0x2beeb5[_0x8938('0x48')]);_0x33bef5['filters']=_[_0x8938('0x49')](_0x33bef5[_0x8938('0x47')],_0x33bef5[_0x8938('0x48')]);_0x34ae55[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x33bef5[_0x8938('0x47')],qs['fields'](_0x2beeb5['query'][_0x8938('0x4a')]));_0x34ae55[_0x8938('0x4b')]=_0x34ae55['attributes'][_0x8938('0x4c')]?_0x34ae55[_0x8938('0x4b')]:_0x33bef5[_0x8938('0x47')];if(_0x2beeb5[_0x8938('0x48')]['includeAll']){_0x34ae55[_0x8938('0x56')]=[{'all':!![]}];}_0x34ae55=_[_0x8938('0x53')]({},_0x34ae55,_0x2beeb5[_0x8938('0x55')]);return db['ChatWebsite'][_0x8938('0x5c')](_0x34ae55)[_0x8938('0x22')](handleEntityNotFound(_0x394f03,null))[_0x8938('0x22')](respondWithResult(_0x394f03,null))[_0x8938('0x2b')](handleError(_0x394f03,null));};exports[_0x8938('0x5d')]=function(_0x470287,_0x49f60e){return db[_0x8938('0x42')][_0x8938('0x5d')](_0x470287['body'],{})[_0x8938('0x22')](function(_0x117e89){var _0x4add37=_0x470287[_0x8938('0x5e')][_0x8938('0x37')]({'plain':!![]});if(!_0x4add37)throw new Error(_0x8938('0x5f'));if(_0x4add37['role']==='user'){var _0x3114af=_0x117e89[_0x8938('0x37')]({'plain':!![]});var _0x2be453=_0x8938('0x38');return db['UserProfileSection'][_0x8938('0x5c')]({'where':{'name':_0x2be453,'userProfileId':_0x4add37['userProfileId']},'raw':!![]})[_0x8938('0x22')](function(_0x53fb3c){if(_0x53fb3c&&_0x53fb3c[_0x8938('0x60')]===0x0){return db[_0x8938('0x39')]['create']({'name':_0x3114af[_0x8938('0x3d')],'resourceId':_0x3114af['id'],'type':_0x53fb3c['name'],'sectionId':_0x53fb3c['id']},{})[_0x8938('0x22')](function(){return _0x117e89;});}else{return _0x117e89;}})[_0x8938('0x2b')](function(_0x2ba94a){logger[_0x8938('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ba94a);throw _0x2ba94a;});}return _0x117e89;})[_0x8938('0x22')](respondWithResult(_0x49f60e,0xc9))[_0x8938('0x2b')](handleError(_0x49f60e,null));};exports[_0x8938('0x36')]=function(_0x598386,_0x78cd39){if(_0x598386[_0x8938('0x61')]['id']){delete _0x598386[_0x8938('0x61')]['id'];}return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x598386[_0x8938('0x5a')]['id']},'include':[{'model':db[_0x8938('0x3f')],'as':_0x8938('0x40')}]})['then'](handleEntityNotFound(_0x78cd39,null))[_0x8938('0x22')](saveUpdates(_0x598386[_0x8938('0x61')],null))[_0x8938('0x22')](respondWithResult(_0x78cd39,null))['catch'](handleError(_0x78cd39,null));};exports[_0x8938('0x3a')]=function(_0x513907,_0x3b3779){return db[_0x8938('0x42')]['find']({'where':{'id':_0x513907[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3b3779,null))[_0x8938('0x22')](removeEntity(_0x3b3779,null))[_0x8938('0x2b')](handleError(_0x3b3779,null));};exports[_0x8938('0x62')]=function(_0x54e8e1,_0x4544f0){return db[_0x8938('0x42')][_0x8938('0x62')]()[_0x8938('0x22')](respondWithResult(_0x4544f0,null))['catch'](handleError(_0x4544f0,null));};exports['addDisposition']=function(_0x1a29f7,_0x42588c,_0x836e56){if(_0x1a29f7[_0x8938('0x61')]['id']){delete _0x1a29f7[_0x8938('0x61')]['id'];}return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x1a29f7[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x42588c,null))[_0x8938('0x22')](function(_0x210c1d){if(_0x210c1d){_0x1a29f7[_0x8938('0x61')][_0x8938('0x63')]=_0x210c1d['id'];return db[_0x8938('0x64')][_0x8938('0x5d')](_0x1a29f7['body']);}})[_0x8938('0x22')](respondWithResult(_0x42588c,null))[_0x8938('0x2b')](handleError(_0x42588c,null));};exports[_0x8938('0x65')]=function(_0x3a33b4,_0x4f8d78,_0x5be9ad){var _0x4ae9f4={'raw':![],'where':{}};var _0x45fb3c={};var _0x5d50fa={'count':0x0,'rows':[]};return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x3a33b4[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x4f8d78,null))[_0x8938('0x22')](function(_0x13edd2){if(_0x13edd2){_0x45fb3c[_0x8938('0x47')]=_[_0x8938('0x5b')](db['Disposition'][_0x8938('0x43')]);_0x45fb3c[_0x8938('0x48')]=_['keys'](_0x3a33b4[_0x8938('0x48')]);_0x45fb3c[_0x8938('0x51')]=_['intersection'](_0x45fb3c['model'],_0x45fb3c[_0x8938('0x48')]);_0x4ae9f4[_0x8938('0x4b')]=_['intersection'](_0x45fb3c['model'],qs['fields'](_0x3a33b4[_0x8938('0x48')][_0x8938('0x4a')]));_0x4ae9f4[_0x8938('0x4b')]=_0x4ae9f4[_0x8938('0x4b')][_0x8938('0x4c')]?_0x4ae9f4[_0x8938('0x4b')]:_0x45fb3c['model'];if(!_0x3a33b4[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x4ae9f4[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x3a33b4[_0x8938('0x48')][_0x8938('0x30')]);_0x4ae9f4[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x3a33b4[_0x8938('0x48')]['offset']);}_0x4ae9f4[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x3a33b4[_0x8938('0x48')][_0x8938('0x4f')]);_0x4ae9f4['where']=qs['filters'](_['pick'](_0x3a33b4[_0x8938('0x48')],_0x45fb3c[_0x8938('0x51')]));_0x4ae9f4['where'][_0x8938('0x63')]=_0x13edd2['id'];if(_0x3a33b4[_0x8938('0x48')][_0x8938('0x54')]){_0x4ae9f4[_0x8938('0x50')]=_[_0x8938('0x53')](_0x4ae9f4[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x4ae9f4[_0x8938('0x4b')],function(_0x4f2f86){var _0x1da87f={};_0x1da87f[_0x4f2f86]={'$like':'%'+_0x3a33b4[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x1da87f;})});}_0x4ae9f4=_[_0x8938('0x53')]({},_0x4ae9f4,_0x3a33b4[_0x8938('0x55')]);return db[_0x8938('0x64')][_0x8938('0x68')]({'where':_0x4ae9f4[_0x8938('0x50')]})['then'](function(_0x4d4211){_0x5d50fa[_0x8938('0x68')]=_0x4d4211;if(_0x3a33b4[_0x8938('0x48')]['includeAll']){_0x4ae9f4['include']=[{'all':!![]}];}return db[_0x8938('0x64')][_0x8938('0x57')](_0x4ae9f4);})[_0x8938('0x22')](function(_0x32d353){_0x5d50fa[_0x8938('0x58')]=_0x32d353;return _0x5d50fa;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x4f8d78,_0x4ae9f4))['catch'](handleError(_0x4f8d78,null));};exports[_0x8938('0x69')]=function(_0x27618b,_0x429873,_0x35887a){return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x27618b['params']['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x429873,null))[_0x8938('0x22')](function(_0x4c4be2){if(_0x4c4be2){return _0x4c4be2['removeDispositions'](_0x27618b['query']['ids']);}})['then'](respondWithStatusCode(_0x429873,null))[_0x8938('0x2b')](handleError(_0x429873,null));};exports['addAnswer']=function(_0x36215b,_0x5be8f3,_0x5a461a){if(_0x36215b[_0x8938('0x61')]['id']){delete _0x36215b[_0x8938('0x61')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x36215b[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x5be8f3,null))[_0x8938('0x22')](function(_0x16de85){if(_0x16de85){_0x36215b['body']['ChatWebsiteId']=_0x16de85['id'];return db[_0x8938('0x6a')]['create'](_0x36215b[_0x8938('0x61')]);}})['then'](respondWithResult(_0x5be8f3,null))['catch'](handleError(_0x5be8f3,null));};exports[_0x8938('0x6b')]=function(_0x54eac4,_0x1e2782,_0x353b96){var _0x4e6102={'raw':![],'where':{}};var _0x4ea1cd={};var _0x521029={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8938('0x66')]({'where':{'id':_0x54eac4[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1e2782,null))[_0x8938('0x22')](function(_0x5704be){if(_0x5704be){_0x4ea1cd['model']=_['keys'](db['CannedAnswer'][_0x8938('0x43')]);_0x4ea1cd[_0x8938('0x48')]=_[_0x8938('0x5b')](_0x54eac4[_0x8938('0x48')]);_0x4ea1cd[_0x8938('0x51')]=_[_0x8938('0x49')](_0x4ea1cd[_0x8938('0x47')],_0x4ea1cd[_0x8938('0x48')]);_0x4e6102[_0x8938('0x4b')]=_['intersection'](_0x4ea1cd[_0x8938('0x47')],qs[_0x8938('0x4a')](_0x54eac4[_0x8938('0x48')][_0x8938('0x4a')]));_0x4e6102[_0x8938('0x4b')]=_0x4e6102['attributes'][_0x8938('0x4c')]?_0x4e6102[_0x8938('0x4b')]:_0x4ea1cd[_0x8938('0x47')];if(!_0x54eac4['query'][_0x8938('0x4d')](_0x8938('0x4e'))){_0x4e6102[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x54eac4[_0x8938('0x48')][_0x8938('0x30')]);_0x4e6102['offset']=qs['offset'](_0x54eac4['query'][_0x8938('0x2f')]);}_0x4e6102['order']=qs[_0x8938('0x4f')](_0x54eac4[_0x8938('0x48')]['sort']);_0x4e6102[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x54eac4[_0x8938('0x48')],_0x4ea1cd[_0x8938('0x51')]));_0x4e6102['where'][_0x8938('0x63')]=_0x5704be['id'];if(_0x54eac4[_0x8938('0x48')][_0x8938('0x54')]){_0x4e6102[_0x8938('0x50')]=_['merge'](_0x4e6102[_0x8938('0x50')],{'$or':_['map'](_0x4e6102[_0x8938('0x4b')],function(_0x9f6e64){var _0xf898de={};_0xf898de[_0x9f6e64]={'$like':'%'+_0x54eac4[_0x8938('0x48')]['filter']+'%'};return _0xf898de;})});}_0x4e6102=_[_0x8938('0x53')]({},_0x4e6102,_0x54eac4[_0x8938('0x55')]);return db['CannedAnswer'][_0x8938('0x68')]({'where':_0x4e6102[_0x8938('0x50')]})['then'](function(_0x122393){_0x521029[_0x8938('0x68')]=_0x122393;if(_0x54eac4[_0x8938('0x48')][_0x8938('0x6c')]){_0x4e6102[_0x8938('0x56')]=[{'all':!![]}];}return db[_0x8938('0x6a')]['findAll'](_0x4e6102);})['then'](function(_0xb7a065){_0x521029[_0x8938('0x58')]=_0xb7a065;return _0x521029;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x1e2782,_0x4e6102))[_0x8938('0x2b')](handleError(_0x1e2782,null));};exports[_0x8938('0x6d')]=function(_0xe0c93c,_0x2c599e,_0x37327b){return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0xe0c93c[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2c599e,null))[_0x8938('0x22')](function(_0x31431b){if(_0x31431b){return _0x31431b['removeAnswers'](_0xe0c93c['query']['ids']);}})[_0x8938('0x22')](respondWithStatusCode(_0x2c599e,null))['catch'](handleError(_0x2c599e,null));};exports[_0x8938('0x6e')]=function(_0x51ab83,_0x582664,_0x1b0443){_0x51ab83['body'][_0x8938('0x6f')]=_0x51ab83[_0x8938('0x70')]['filename'];return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0x51ab83[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x582664,null))[_0x8938('0x22')](saveUpdates(_0x51ab83[_0x8938('0x61')],null))['then'](respondWithResult(_0x582664,null))[_0x8938('0x2b')](handleError(_0x582664,null));};exports[_0x8938('0x71')]=function(_0x108654,_0x3382c7,_0x2beb91){_0x108654['body'][_0x8938('0x72')]=_0x108654['file']['filename'];return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x108654[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x3382c7,null))[_0x8938('0x22')](saveUpdates(_0x108654['body'],null))[_0x8938('0x22')](respondWithResult(_0x3382c7,null))[_0x8938('0x2b')](handleError(_0x3382c7,null));};exports[_0x8938('0x73')]=function(_0x27d0e8,_0x47fa47,_0x3e2a99){_0x27d0e8[_0x8938('0x61')][_0x8938('0x74')]=_0x27d0e8['file'][_0x8938('0x75')];return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x27d0e8[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x47fa47,null))[_0x8938('0x22')](saveUpdates(_0x27d0e8[_0x8938('0x61')],null))['then'](respondWithResult(_0x47fa47,null))[_0x8938('0x2b')](handleError(_0x47fa47,null));};exports[_0x8938('0x76')]=function(_0x384557,_0x24e30f,_0x57b2db){_0x384557['body'][_0x8938('0x77')]=_0x384557[_0x8938('0x70')]['filename'];return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x384557[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x24e30f,null))[_0x8938('0x22')](saveUpdates(_0x384557[_0x8938('0x61')],null))['then'](respondWithResult(_0x24e30f,null))[_0x8938('0x2b')](handleError(_0x24e30f,null));};exports[_0x8938('0x78')]=function(_0x4f1699,_0x383b8d,_0x40a570){var _0x216e59=path[_0x8938('0x79')](config['root'],'server/files/images/logos/default_logo.svg');var _0x56c1e3={'where':{'id':_0x4f1699[_0x8938('0x5a')]['id']},'attributes':['id',_0x8938('0x6f')],'raw':!![]};var _0x36d889=![];return require(_0x8938('0x18'))[_0x8938('0x7a')]()[_0x8938('0x22')](function(_0x320974){if(_0x320974){_0x36d889=_0x320974[_0x8938('0x7b')];}})[_0x8938('0x22')](function(){return db[_0x8938('0x42')][_0x8938('0x5c')](_0x56c1e3);})[_0x8938('0x22')](handleEntityNotFound(_0x383b8d,null))[_0x8938('0x22')](function(_0x1dbe5e){if(_0x1dbe5e){if(!_[_0x8938('0x7c')](_0x1dbe5e[_0x8938('0x6f')])){if(fs[_0x8938('0x7d')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x7f'),_0x1dbe5e['sitepic']))&&_0x36d889){_0x216e59=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x7f'),_0x1dbe5e['sitepic']);}}return _0x383b8d[_0x8938('0x80')](_0x216e59);}})['catch'](handleError(_0x383b8d,null));};exports['getAvatar']=function(_0x595312,_0x276daf,_0x2872b6){var _0x1398bd=path['join'](config['root'],_0x8938('0x81'));var _0xdfddff={'where':{'id':_0x595312[_0x8938('0x5a')]['id']},'attributes':['id',_0x8938('0x72')],'raw':!![]};return db[_0x8938('0x42')][_0x8938('0x5c')](_0xdfddff)[_0x8938('0x22')](handleEntityNotFound(_0x276daf,null))[_0x8938('0x22')](function(_0x40b822){if(_0x40b822){if(!_[_0x8938('0x7c')](_0x40b822[_0x8938('0x72')])){if(fs[_0x8938('0x7d')](path['join'](config[_0x8938('0x7e')],_0x8938('0x82'),_0x40b822[_0x8938('0x72')]))){_0x1398bd=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x82'),_0x40b822['agentAvatar']);}}return _0x276daf[_0x8938('0x80')](_0x1398bd);}})[_0x8938('0x2b')](handleError(_0x276daf,null));};exports[_0x8938('0x83')]=function(_0x5e979e,_0x413581,_0x168966){var _0x2c4b57=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x84'));var _0x168634={'where':{'id':_0x5e979e['params']['id']},'attributes':['id',_0x8938('0x74'),'showCustomerAvatar'],'raw':!![]};return db[_0x8938('0x42')][_0x8938('0x5c')](_0x168634)[_0x8938('0x22')](handleEntityNotFound(_0x413581,null))[_0x8938('0x22')](function(_0x15d749){if(_0x15d749){if(!_[_0x8938('0x7c')](_0x15d749[_0x8938('0x74')])){if(fs[_0x8938('0x7d')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x82'),_0x15d749[_0x8938('0x74')]))&&_0x15d749['showCustomerAvatar']){_0x2c4b57=path['join'](config['root'],_0x8938('0x82'),_0x15d749[_0x8938('0x74')]);}}return _0x413581[_0x8938('0x80')](_0x2c4b57);}})[_0x8938('0x2b')](handleError(_0x413581,null));};exports['getSystemAvatar']=function(_0x3ee2bb,_0x176850,_0x113d58){var _0x289fa3=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x85'));var _0x42efcf={'where':{'id':_0x3ee2bb['params']['id']},'attributes':['id',_0x8938('0x77')],'raw':!![]};return db['ChatWebsite'][_0x8938('0x5c')](_0x42efcf)['then'](handleEntityNotFound(_0x176850,null))[_0x8938('0x22')](function(_0x1dfe4c){if(_0x1dfe4c){if(!_['isNil'](_0x1dfe4c[_0x8938('0x77')])){if(fs['existsSync'](path['join'](config['root'],_0x8938('0x82'),_0x1dfe4c[_0x8938('0x77')]))){_0x289fa3=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x82'),_0x1dfe4c['systemAvatar']);}}return _0x176850['download'](_0x289fa3);}})['catch'](handleError(_0x176850,null));};exports[_0x8938('0x86')]=function(_0x1f8e4c,_0x5f12d1,_0x58f475){var _0x1dd486=require(_0x8938('0x87'));var _0x43b39b=new _0x1dd486();var _0x10e840=_0x43b39b[_0x8938('0x88')](_0x1f8e4c['headers'][_0x8938('0x89')])[_0x8938('0x8a')]();var _0x3ac59b={'body':_0x1f8e4c[_0x8938('0x61')],'channel':_0x8938('0x8b')};var _0x36f9ed=[];var _0x16199e=[];var _0x463890={};var _0x443d21=![];return db['CmContact'][_0x8938('0x62')]()[_0x8938('0x22')](function(_0x11e339){if(!_0x11e339){throw new db['Sequelize'][(_0x8938('0x8c'))](_0x8938('0x8d'));}_0x36f9ed=_['difference'](_[_0x8938('0x5b')](_0x11e339),['createdAt',_0x8938('0x8e')]);_0x16199e=_[_0x8938('0x8f')](_[_0x8938('0x5b')](_0x11e339),[_0x8938('0x90'),'updatedAt',_0x8938('0x91'),_0x8938('0x92')]);if(_0x1f8e4c[_0x8938('0x61')]['id']){delete _0x1f8e4c[_0x8938('0x61')]['id'];}if(_[_0x8938('0x7c')](_0x1f8e4c[_0x8938('0x61')][_0x8938('0x93')])){throw new db['Sequelize'][(_0x8938('0x8c'))](_0x8938('0x94'));}if(_[_0x8938('0x7c')](_0x1f8e4c[_0x8938('0x61')][_0x8938('0x61')])||_0x1f8e4c[_0x8938('0x61')][_0x8938('0x61')]===''){throw new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0x96'));}if(_[_0x8938('0x7c')](_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')])){throw new db[(_0x8938('0x95'))][(_0x8938('0x8c'))](_0x8938('0x98')+_0x16199e);}if(!_[_0x8938('0x99')](_0x16199e,_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')])){throw new db['Sequelize'][(_0x8938('0x8c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x16199e);}_0x463890[_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')]]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0x93')];})[_0x8938('0x22')](function(){return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x1f8e4c['params']['id']},'include':[{'model':db['CmList'],'as':_0x8938('0x9a'),'include':[{'model':db[_0x8938('0x9b')],'as':_0x8938('0x9c'),'where':_0x463890,'limit':0x1,'order':[[_0x8938('0x8e'),_0x8938('0x9d')]]}]},{'model':db['ChatApplication'],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x5f12d1,null))[_0x8938('0x22')](function(_0xfd3cd6){if(_0xfd3cd6&&_0xfd3cd6['List']){_0x3ac59b[_0x8938('0x9e')]=_0xfd3cd6;_0x3ac59b[_0x8938('0x9f')]=_0xfd3cd6[_0x8938('0xa0')];_0x3ac59b[_0x8938('0xa1')]=_0xfd3cd6[_0x8938('0x9a')];_0x3ac59b[_0x8938('0x9f')]=_[_0x8938('0xa2')](_0x3ac59b['applications'],['priority'],['asc']);if(_0x3ac59b[_0x8938('0x9e')][_0x8938('0xa0')]){delete _0x3ac59b['account']['Applications'];}if(_0x3ac59b[_0x8938('0x9e')][_0x8938('0x9a')]&&_0x3ac59b[_0x8938('0x9e')]['List'][_0x8938('0x9c')][_0x8938('0x4c')]){return _0x3ac59b[_0x8938('0x9e')]['List'][_0x8938('0x9c')][0x0];}var _0x4ab18b=_[_0x8938('0x1a')](_0x1f8e4c[_0x8938('0x61')],{'firstName':_0x1f8e4c['body'][_0x8938('0x93')],'ListId':_0xfd3cd6[_0x8938('0x92')]});_0x4ab18b[_0x1f8e4c[_0x8938('0x61')][_0x8938('0x97')]]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0x93')];return db[_0x8938('0x9b')][_0x8938('0x5d')](_0x4ab18b,{'fields':_0x36f9ed,'raw':!![]});}})['then'](handleEntityNotFound(_0x5f12d1,null))['then'](function(_0xb8135d){_0x3ac59b[_0x8938('0xa3')]=_0xb8135d;var _0x3e39dc=_0x1f8e4c[_0x8938('0x61')]['customerIp'];if(_0x1f8e4c[_0x8938('0xa4')]['cf-connecting-ip']){_0x3e39dc=_0x1f8e4c[_0x8938('0xa4')]['cf-connecting-ip'];}else if(_0x1f8e4c['headers']['x-forwarded-for']){_0x3e39dc=_[_0x8938('0xa5')](_0x1f8e4c[_0x8938('0xa4')][_0x8938('0xa6')][_0x8938('0xa7')](','));}if(_0xb8135d){var _0x31cd58={'ContactId':_0xb8135d['id'],'ChatWebsiteId':_0x1f8e4c['params']['id'],'from':(_0xb8135d[_0x8938('0xa8')]||'')+'\x20'+(_0xb8135d[_0x8938('0xa9')]||''),'customerIp':_0x3e39dc,'customerPort':_0x1f8e4c[_0x8938('0xa4')]['x-real-port']?_0x1f8e4c[_0x8938('0xa4')][_0x8938('0xaa')]:null,'referer':_0x1f8e4c[_0x8938('0x61')]['referer'],'browserName':_0x10e840[_0x8938('0xab')][_0x8938('0x3d')]&&_0x10e840[_0x8938('0xab')]['version']?util[_0x8938('0xac')](_0x8938('0xad'),_0x10e840['browser'][_0x8938('0x3d')],_0x10e840['browser']['version']):_0x8938('0xae'),'browserVersion':_0x10e840[_0x8938('0xab')][_0x8938('0xaf')]||'unknown','osName':util['format']('%s\x20%s',_0x10e840['os']['name'],_0x10e840['os'][_0x8938('0xaf')]),'osVersion':_0x10e840['os'][_0x8938('0xaf')],'deviceModel':_0x10e840['device'][_0x8938('0x47')]&&_0x10e840[_0x8938('0xb0')][_0x8938('0xb1')]?util[_0x8938('0xac')](_0x8938('0xb2'),_0x10e840[_0x8938('0xb0')][_0x8938('0x47')],_0x10e840['device'][_0x8938('0xb1')],_0x10e840['device']['type']):null,'deviceVendor':_0x10e840['device'][_0x8938('0xb1')],'deviceType':_0x10e840[_0x8938('0xb0')][_0x8938('0x45')],'formData':JSON['stringify'](_0x1f8e4c[_0x8938('0x61')])};var _0xd6b136={'ChatWebsiteId':_0x1f8e4c['params']['id'],'closed':![]};if(_0x1f8e4c['body'][_0x8938('0xb3')]){_0xd6b136[_0x8938('0xb3')]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb3')];return db[_0x8938('0xb4')][_0x8938('0x5c')]({'where':_0xd6b136})[_0x8938('0x22')](function(_0x5abae8){if(_0x5abae8){return[_0x5abae8,![]];}_0x31cd58[_0x8938('0xb3')]=_0x1f8e4c[_0x8938('0x61')]['threadId'];_0x31cd58[_0x8938('0xb5')]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb5')];return db[_0x8938('0xb4')][_0x8938('0x5d')](_0x31cd58)[_0x8938('0x22')](function(_0x2d5214){return[_0x2d5214,!![]];});});}_0xd6b136['ContactId']=_0xb8135d['id'];if(_0x1f8e4c['body'][_0x8938('0xb6')]&&_0x1f8e4c['body'][_0x8938('0xb6')]['id']){_0xd6b136['id']=_0x1f8e4c['body'][_0x8938('0xb6')]['id'];return db[_0x8938('0xb4')]['find']({'where':_0xd6b136})[_0x8938('0x22')](function(_0xef474f){if(_0xef474f){return[_0xef474f,![]];}return db[_0x8938('0xb4')][_0x8938('0x5d')](_0x31cd58)[_0x8938('0x22')](function(_0x3c975e){return[_0x3c975e,!![]];});});}return db[_0x8938('0xb4')]['create'](_0x31cd58)[_0x8938('0x22')](function(_0x547096){return[_0x547096,!![]];});}})[_0x8938('0xb7')](function(_0x1ee506,_0x5e30a9){if(_0x1ee506){_0x443d21=_0x5e30a9;if(!_0x5e30a9){var _0x3ff221={'from':(_0x3ac59b['contact']['firstName']||'')+'\x20'+(_0x3ac59b[_0x8938('0xa3')][_0x8938('0xa9')]||'')};if(_0x1f8e4c[_0x8938('0x61')]['threadId']&&_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb8')]&&_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb3')]!=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb8')]){_0x3ff221[_0x8938('0xb3')]=_0x1f8e4c[_0x8938('0x61')][_0x8938('0xb8')];}return _0x1ee506[_0x8938('0x36')](_0x3ff221);}else{return _0x1ee506;}}})['then'](function(_0xc676fb){_0x3ac59b[_0x8938('0xb6')]=_0xc676fb[_0x8938('0x37')]({'plain':!![]});_0x3ac59b[_0x8938('0xb6')][_0x8938('0xb9')]=_0x443d21;if(_0x3ac59b[_0x8938('0xb6')]['created']){if(_0x3ac59b[_0x8938('0x9e')][_0x8938('0xba')]){_0x3ac59b[_0x8938('0x9f')][_0x8938('0xbb')]({'id':0x0,'priority':_0x3ac59b[_0x8938('0x9f')][_0x8938('0x4c')]+0x1,'app':_0x8938('0xbc'),'appdata':'unmanaged','interval':'*,*,*,*'});}}return db['ChatMessage'][_0x8938('0x5d')]({'body':_0x1f8e4c[_0x8938('0x61')][_0x8938('0x61')],'ChatWebsiteId':_0x1f8e4c['params']['id'],'ChatInteractionId':_0xc676fb['id'],'direction':'in','ContactId':_0x3ac59b['contact']['id'],'AttachmentId':_0x1f8e4c[_0x8938('0x61')][_0x8938('0xbd')]});})[_0x8938('0x22')](function(_0x2e6b6c){_0x3ac59b[_0x8938('0x28')]=_0x2e6b6c;if(_0x3ac59b['interaction'][_0x8938('0xbe')]){return db[_0x8938('0xbf')][_0x8938('0x5c')]({'attributes':['id',_0x8938('0x3d')],'where':{'id':_0x3ac59b[_0x8938('0xb6')]['UserId']}})['then'](function(_0x991f43){if(_0x991f43){_0x3ac59b[_0x8938('0x9f')][_0x8938('0xc0')]({'id':0x0,'priority':0x0,'app':_0x8938('0xc1'),'appdata':_0x991f43[_0x8938('0x3d')]+','+(_0x3ac59b[_0x8938('0x9e')][_0x8938('0xc2')]||0xa),'interval':_0x8938('0xc3')});_0x3ac59b[_0x8938('0xc4')]=!![];}return respondWithRpcPromise('Start','startRouting',_0x3ac59b);});}return respondWithRpcPromise(_0x8938('0xc5'),_0x8938('0xc6'),_0x3ac59b);})['then'](function(_0x53d6f6){respondWithRpcPromise(_0x8938('0xc7'),'EventManager',{'event':_0x8938('0x86'),'message':_0x53d6f6},client9002);return _0x53d6f6;})[_0x8938('0x22')](respondWithResult(_0x5f12d1,null))['catch'](handleError(_0x5f12d1,null));};exports['offline']=function(_0x3f5b64,_0x252102,_0x1b25a7){var _0x1adcc6,_0x2c7981,_0x3b11fb;var _0x580b6e=[];var _0x5df022=[];var _0x5b4483={};var _0x320885=_0x3f5b64[_0x8938('0xc8')]||[];var _0x29ec6c=[];var _0x5482ec;return db[_0x8938('0x9b')]['describe']()[_0x8938('0x22')](function(_0x59a637){if(!_0x59a637){throw new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0x8d'));}_0x5df022=_[_0x8938('0x8f')](_['keys'](_0x59a637),[_0x8938('0x90'),_0x8938('0x8e')]);_0x580b6e=_['difference'](_[_0x8938('0x5b')](_0x59a637),[_0x8938('0x90'),_0x8938('0x8e'),'CompanyId',_0x8938('0x92')]);if(_0x3f5b64['body']['id']){delete _0x3f5b64['body']['id'];}if(_['isNil'](_0x3f5b64[_0x8938('0x61')][_0x8938('0x93')])){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0x94')));}if(_[_0x8938('0x7c')](_0x3f5b64[_0x8938('0x61')][_0x8938('0x61')])||_0x3f5b64['body'][_0x8938('0x61')]===''){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db['Sequelize'][(_0x8938('0x8c'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x8938('0x7c')](_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')])){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db['Sequelize'][(_0x8938('0x8c'))](_0x8938('0xca')+_0x580b6e));}if(!_[_0x8938('0x99')](_0x580b6e,_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')])){throw _0x252102[_0x8938('0x2c')](0x1f4)[_0x8938('0x3e')](new db[(_0x8938('0x95'))]['ValidationError'](_0x8938('0xcb')+_0x580b6e));}_0x5b4483[_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')]]=_0x3f5b64['body'][_0x8938('0x93')];})[_0x8938('0x22')](function(){return db[_0x8938('0x42')][_0x8938('0x5c')]({'where':{'id':_0x3f5b64[_0x8938('0x5a')]['id']},'include':[{'model':db[_0x8938('0xcc')],'as':_0x8938('0x9a')},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x8938('0x22')](handleEntityNotFound(_0x252102,null))[_0x8938('0x22')](function(_0x2d5cb3){if(_0x2d5cb3&&_0x2d5cb3[_0x8938('0x9a')]){_0x2c7981=_0x2d5cb3;var _0x4b174e=_[_0x8938('0x1a')](_0x3f5b64[_0x8938('0x61')],{'firstName':_0x3f5b64[_0x8938('0x61')][_0x8938('0x93')],'phone':_0x3f5b64[_0x8938('0x61')]['from'],'ListId':_0x2d5cb3['ListId']});_0x4b174e[_0x3f5b64[_0x8938('0x61')][_0x8938('0xc9')]]=_0x3f5b64['body'][_0x8938('0x93')];return db[_0x8938('0x9b')][_0x8938('0xcd')]({'where':_0x5b4483,'defaults':_0x4b174e});}})[_0x8938('0xb7')](function(_0x316d24){if(_0x316d24){_0x3b11fb=_0x316d24;var _0x208dce=fs[_0x8938('0xce')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0xcf')),_0x8938('0xd0'));var _0xd2853d=ejs['render'](_0x208dce,{'body':_[_0x8938('0xd1')](_0x3f5b64[_0x8938('0x61')][_0x8938('0x61')]),'bodyTitle':_0x2c7981[_0x8938('0xd2')]});return db[_0x8938('0xd3')][_0x8938('0x5d')]({'body':_0xd2853d,'ContactId':_0x316d24['id'],'ChatWebsiteId':_0x2c7981['id']});}})[_0x8938('0x22')](function(_0x2e3aa1){_0x5482ec=_0x2e3aa1;if(_0x320885[_0x8938('0x4c')]){var _0x155d0b=_0x320885[_0x8938('0x41')](function(_0x519d02){return{'name':_0x519d02[_0x8938('0xd4')],'basename':_0x519d02[_0x8938('0x75')],'type':_0x519d02[_0x8938('0xd5')],'ChatOfflineMessageId':_0x2e3aa1['id']};});_0x29ec6c=_0x155d0b[_0x8938('0x41')](_0x4bd3a5=>{var _0x4e212b={'filename':_0x4bd3a5[_0x8938('0x3d')],'path':path['join'](config[_0x8938('0x7e')],_0x8938('0xd6'),'files',_0x8938('0xd7'),_0x8938('0xd8'),_0x4bd3a5[_0x8938('0xd9')])};return _0x4e212b;});if(!_0x2c7981[_0x8938('0xda')]){return db['sequelize'][_0x8938('0xdb')](function(_0x12ce01){return db[_0x8938('0xdc')]['bulkCreate'](_0x155d0b,{'transaction':_0x12ce01});});}}})[_0x8938('0x22')](function(){if(_0x5482ec){_0x1adcc6=_0x5482ec;return db[_0x8938('0xdd')][_0x8938('0x66')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8938('0xde'),'raw':!![]}]});}})[_0x8938('0x22')](function(_0x343197){if(_0x343197&&_0x343197['Smtp']&&_0x2c7981['forwardOffline']&&_0x2c7981['forwardOfflineAddress']){var _0x3af5ea={'tls':{'rejectUnauthorized':![]}};if(_0x343197['Smtp'][_0x8938('0xdf')]){_0x3af5ea['service']=_0x343197[_0x8938('0xde')][_0x8938('0xdf')];}else{_0x3af5ea[_0x8938('0xe0')]=_0x343197[_0x8938('0xde')][_0x8938('0xe0')];_0x3af5ea[_0x8938('0xe1')]=_0x343197[_0x8938('0xde')][_0x8938('0xe1')];_0x3af5ea['secure']=_0x343197[_0x8938('0xde')][_0x8938('0xe2')];}if(_0x343197[_0x8938('0xde')]['authentication']){_0x3af5ea['auth']={'user':_0x343197['Smtp'][_0x8938('0x5e')],'pass':_0x343197[_0x8938('0xde')][_0x8938('0xe3')]};}return respondWithRpcPromise(_0x8938('0xe4'),_0x8938('0xe5'),{'account':_0x3af5ea,'message':{'from':util[_0x8938('0xac')]('\x22%s\x22\x20<%s>',_0x343197[_0x8938('0x3d')],_0x343197[_0x8938('0xe6')]||_0x343197[_0x8938('0xde')][_0x8938('0x5e')]),'to':_0x2c7981['forwardOfflineAddress'],'subject':_0x2c7981[_0x8938('0xe7')],'html':_0x1adcc6[_0x8938('0x61')],'attachments':_0x29ec6c}},client9003)[_0x8938('0x22')](function(){return _0x1adcc6;})[_0x8938('0x2b')](function(_0x58b6c5){console[_0x8938('0x27')](_0x58b6c5);});}})[_0x8938('0x22')](function(){if(_0x2c7981&&_0x2c7981[_0x8938('0xda')]&&_0x2c7981['MailAccountId']){var _0x1bf54a=[];if(_0x320885[_0x8938('0x4c')]){_0x1bf54a=_0x320885[_0x8938('0x41')](function(_0x269ad8){return{'name':_0x269ad8[_0x8938('0xd4')],'basename':_0x269ad8[_0x8938('0x75')],'type':_0x269ad8[_0x8938('0xd5')],'ChatOfflineMessageId':_0x5482ec['id']};});}var _0x456540;if(!_[_0x8938('0x7c')](_0x2c7981[_0x8938('0xe8')])){var _0x6d1852=_[_0x8938('0x41')](_0x3f5b64['body'],function(_0x5f4948){return _0x5f4948;});var _0x426ba8=_[_0x8938('0xe9')](_0x6d1852)[0x0];var _0x41031b=_[_0x8938('0xea')](_0x426ba8,function(_0x2834b0){return _0x2834b0;});_0x456540=_0x41031b[0x1][_0x2c7981[_0x8938('0xe8')]];}var _0x1cf17d={'from':_0x3b11fb[_0x8938('0xe6')],'firstName':_0x3b11fb[_0x8938('0xa8')],'lastName':_0x3b11fb['lastName'],'mapKey':_0x8938('0xe6'),'message':{'from':_0x3b11fb['email'],'to':_0x2c7981['MailAccount']['email'],'cc':'','subject':_[_0x8938('0x7c')](_0x456540)?_0x2c7981[_0x8938('0xe7')]:_0x456540,'messageId':'','sentAt':new Date(),'attach':_0x1bf54a[_0x8938('0x4c')],'attachments':_0x1bf54a,'originChannel':_0x8938('0xeb'),'ChatWebsiteId':_0x2c7981['id'],'ChatOfflineMessageId':_0x1adcc6['id'],'originTo':_0x2c7981[_0x8938('0xdd')]['email']},'body':_0x1adcc6[_0x8938('0x61')]};var _0x8f78d0={'account':{'id':_0x2c7981[_0x8938('0xec')]},'body':_0x1cf17d,'log':_0x8938('0xed')};return respondWithRpcPromise(_0x8938('0xed'),'notifyMail',_0x8f78d0,client9001)[_0x8938('0x22')](function(){return _0x1adcc6;})[_0x8938('0x2b')](function(_0x1256d1){console[_0x8938('0x27')](_0x1256d1);});}return;})[_0x8938('0x22')](function(){if(_0x1adcc6){return _0x1adcc6;}})[_0x8938('0x22')](respondWithResult(_0x252102,null))['catch'](function(_0xdedfa3){console[_0x8938('0x27')](_0x8938('0x2b'),_0xdedfa3);for(var _0x1a97bd of _0x320885){var _0x444e9e=path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0xd6'),'files',_0x8938('0xd7'),_0x8938('0xd8'),_0x1a97bd[_0x8938('0x75')]);fs_extra[_0x8938('0xee')](_0x444e9e)['catch'](function(_0x29d40e){console['error'](_0x8938('0xef'),_0x444e9e,_0x29d40e);});}});};exports[_0x8938('0xf0')]=function(_0x3b2443,_0x2090e5,_0x5da7d6){return db[_0x8938('0xb4')][_0x8938('0x5c')]({'where':{'id':_0x3b2443['params']['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x2090e5,null))[_0x8938('0x22')](function(_0x45d459){if(_0x45d459){return _0x45d459[_0x8938('0xf0')](_0x3b2443[_0x8938('0x61')]['ids'],_[_0x8938('0xf1')](_0x3b2443[_0x8938('0x61')],[_0x8938('0xf2'),'id'])||{});}})[_0x8938('0x22')](respondWithResult(_0x2090e5,null))[_0x8938('0x2b')](handleError(_0x2090e5,null));};exports[_0x8938('0xf3')]=function(_0x8f67c9,_0x2f5398,_0x3aca12){var _0x22fd55={'raw':![],'where':{}};var _0x3d630f={};var _0x1ffa5e={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x8938('0x66')]({'where':{'id':_0x8f67c9[_0x8938('0x5a')]['id']}})['then'](handleEntityNotFound(_0x2f5398,null))[_0x8938('0x22')](function(_0x16d438){if(_0x16d438){_0x3d630f['model']=_[_0x8938('0x5b')](db[_0x8938('0xb4')][_0x8938('0x43')]);_0x3d630f[_0x8938('0x48')]=_['keys'](_0x8f67c9[_0x8938('0x48')]);_0x3d630f[_0x8938('0x51')]=_[_0x8938('0x49')](_0x3d630f[_0x8938('0x47')],_0x3d630f[_0x8938('0x48')]);_0x22fd55[_0x8938('0x4b')]=_['intersection'](_0x3d630f[_0x8938('0x47')],qs[_0x8938('0x4a')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x4a')]));_0x22fd55['attributes']=_0x22fd55[_0x8938('0x4b')][_0x8938('0x4c')]?_0x22fd55[_0x8938('0x4b')]:_0x3d630f[_0x8938('0x47')];if(!_0x8f67c9[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x22fd55[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x30')]);_0x22fd55[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x2f')]);}_0x22fd55[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x8f67c9[_0x8938('0x48')][_0x8938('0x4f')]);_0x22fd55[_0x8938('0x50')]=qs[_0x8938('0x51')](_['pick'](_0x8f67c9[_0x8938('0x48')],_0x3d630f[_0x8938('0x51')]));_0x22fd55[_0x8938('0x50')]['ChatWebsiteId']=_0x16d438['id'];if(_0x8f67c9[_0x8938('0x48')][_0x8938('0x54')]){_0x22fd55[_0x8938('0x50')]=_[_0x8938('0x53')](_0x22fd55[_0x8938('0x50')],{'$or':_['map'](_0x22fd55[_0x8938('0x4b')],function(_0xd29739){var _0x3f18cd={};_0x3f18cd[_0xd29739]={'$like':'%'+_0x8f67c9[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x3f18cd;})});}_0x22fd55=_[_0x8938('0x53')]({},_0x22fd55,_0x8f67c9[_0x8938('0x55')]);return db[_0x8938('0xb4')][_0x8938('0x68')]({'where':_0x22fd55[_0x8938('0x50')]})[_0x8938('0x22')](function(_0x396249){_0x1ffa5e['count']=_0x396249;if(_0x8f67c9['query']['includeAll']){_0x22fd55[_0x8938('0x56')]=[{'model':db[_0x8938('0x9b')],'as':_0x8938('0xf4'),'required':![]},{'model':db[_0x8938('0xbf')],'as':_0x8938('0xf5'),'attributes':[_0x8938('0x3d'),'fullname',_0x8938('0xf6')],'required':![]},{'model':db[_0x8938('0xf7')],'as':'Tags','attributes':['id',_0x8938('0x3d'),_0x8938('0xf8')],'where':_0x8f67c9[_0x8938('0x48')][_0x8938('0xf9')]?{'id':_0x8f67c9[_0x8938('0x48')][_0x8938('0xf9')]}:undefined,'required':_0x8f67c9[_0x8938('0x48')][_0x8938('0xf9')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x22fd55);})[_0x8938('0x22')](function(_0x4f58b5){_0x1ffa5e['rows']=_0x4f58b5;return _0x1ffa5e;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x2f5398,_0x22fd55))[_0x8938('0x2b')](handleError(_0x2f5398,null));};function iftimePromise(_0x123992,_0x1bb43e){return respondWithRpcPromise(_0x8938('0xfa'),'getSnippet',{'command':_0x1bb43e[_0x8938('0xfb')]?util[_0x8938('0xac')]('iftime\x20%s,%s',_0x123992[_0x8938('0xfc')],_0x1bb43e[_0x8938('0xfb')]):util[_0x8938('0xac')](_0x8938('0xfd'),_0x123992[_0x8938('0xfc')])},client9002)[_0x8938('0x22')](function(_0x3bbb45){var _0x57d9c0=_0x3bbb45&&_0x3bbb45[_0x8938('0xfe')](_0x8938('0xff'))>=0x0?!![]:![];logger[_0x8938('0x29')](_0x8938('0x100'),_0x1bb43e['id'],_0x123992['id'],_0x123992['interval'],_0x57d9c0?'ONLINE':_0x8938('0x101'),_0x1bb43e[_0x8938('0xfb')]?_0x1bb43e['timezone']:_0x8938('0x102'));return _0x57d9c0;})['catch'](function(_0x1fcdfe){logger[_0x8938('0x27')](_0x8938('0x100'),_0x1bb43e['id'],_0x123992['id'],_0x123992[_0x8938('0xfc')],util['inspect'](_0x1fcdfe,{'showHidden':![],'depth':null}),_0x1bb43e[_0x8938('0xfb')]?_0x1bb43e[_0x8938('0xfb')]:_0x8938('0x102'));return![];});}exports['getSnippet']=function(_0x157065,_0x1d90d8,_0x579a43){var _0x5df8ab=0x0;var _0x33ef92=0x0;var _0x227091=![];var _0x1490ce;var _0xea28c8;return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0x157065['params']['id']},'include':[{'model':db[_0x8938('0x103')],'as':'Interval','include':[{'model':db[_0x8938('0x103')],'as':_0x8938('0x104'),'attributes':['id',_0x8938('0xfc')],'raw':!![]}]}]})[_0x8938('0x22')](handleEntityNotFound(_0x1d90d8,null))[_0x8938('0x22')](function(_0xdbf039){if(_0xdbf039){_0x1490ce=_0xdbf039;return _0xdbf039[_0x8938('0x105')]({'raw':!![]});}})[_0x8938('0x22')](function(_0x5271d2){if(_0x1490ce){if(_0x5271d2){_0xea28c8=_0x5271d2;}}return require('../../config/license/util')[_0x8938('0x7a')]();})[_0x8938('0x22')](function(_0x33ac97){if(_0x33ac97){_0x33ef92=_0x33ac97['virtual'];_0x227091=_0x33ac97[_0x8938('0x7b')];}})[_0x8938('0x22')](function(){return db[_0x8938('0xb4')][_0x8938('0x68')]({'where':{'closed':![]}});})[_0x8938('0x22')](function(_0x26e063){_0x5df8ab=_0x26e063;if(_0x33ef92&&_0x26e063>_0x33ef92){return db[_0x8938('0x106')][_0x8938('0x66')]({'where':{'id':0x1}})[_0x8938('0x22')](function(_0xf08597){if(_0xf08597){_0xf08597['increment']('chatLicenseExceeded');}});}})[_0x8938('0x22')](function(){if(_0x1490ce[_0x8938('0x103')]&&_0x1490ce[_0x8938('0x103')]['Intervals']){var _0x4f14cf=[];for(var _0x158d97=0x0;_0x158d97<_0x1490ce[_0x8938('0x103')][_0x8938('0x104')]['length'];_0x158d97++){var _0x551ba5=_0x1490ce['Interval'][_0x8938('0x104')][_0x158d97][_0x8938('0x37')]({'plain':!![]});_0x4f14cf[_0x8938('0xbb')](iftimePromise(_0x551ba5,_0x1490ce));}return BPromise[_0x8938('0x107')](_0x4f14cf)[_0x8938('0x22')](function(_0x4e570e){return _[_0x8938('0x108')](_0x4e570e);});}else{return!![];}})[_0x8938('0x22')](function(_0x84c45){var _0x101938=fs[_0x8938('0xce')](path[_0x8938('0x79')](config[_0x8938('0x7e')],_0x8938('0x109')),_0x8938('0xd0'));var _0x183d6a={'remote':_0x1490ce[_0x8938('0x10a')],'query':querystring[_0x8938('0x10b')](_[_0x8938('0x53')](_0x1490ce[_0x8938('0x37')]({'plain':!![]}),{'customerIp':_0x157065['headers'][_0x8938('0xa6')]||_0x157065['headers'][_0x8938('0x10c')]||_0x157065['connection']['remoteAddress']||_0x157065['ip'],'referer':_0x157065[_0x8938('0xa4')][_0x8938('0x10d')],'openedInteractions':_0x5df8ab,'maxInteractions':_0x33ef92,'virtual':_0x227091[_0x8938('0x10e')],'online':_0x84c45,'custom':_0x227091}))[_0x8938('0x10f')](/'/g,'\x5c\x27')};_0x1d90d8[_0x8938('0x3e')](ejs[_0x8938('0x110')](Mustache[_0x8938('0x110')](_0x101938,_0x183d6a),{'proactiveActions':_0xea28c8,'alignment':_0x1490ce[_0x8938('0x111')],'verticalAlignment':_0x1490ce['verticalAlignment'],'div_color':_0x1490ce[_0x8938('0xf8')],'text_color':_0x1490ce[_0x8938('0x112')],'button_color':_0x1490ce[_0x8938('0x113')],'background_color':_0x1490ce['backgroundColor']}));})[_0x8938('0x2b')](handleError(_0x1d90d8,null));};exports[_0x8938('0x114')]=function(_0x4b1702,_0x478a56,_0x38a8af){return db[_0x8938('0x42')]['findOne']({'where':{'id':_0x4b1702['params']['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x478a56,null))[_0x8938('0x22')](function(_0x3a7a80){if(_0x3a7a80){return db[_0x8938('0x115')][_0x8938('0xdb')](function(_0x147752){return db['ChatApplication'][_0x8938('0x3a')]({'where':{'ChatWebsiteId':_0x4b1702[_0x8938('0x5a')]['id']},'transaction':_0x147752})[_0x8938('0x22')](function(_0x12abf6){var _0x391819=_[_0x8938('0x41')](_0x4b1702['body'],function(_0x35153a){_0x35153a[_0x8938('0x63')]=_0x4b1702[_0x8938('0x5a')]['id'];return _0x35153a;});return db[_0x8938('0x116')]['bulkCreate'](_0x391819,{'transaction':_0x147752});});})[_0x8938('0x22')](function(){return db[_0x8938('0x116')][_0x8938('0x117')]({'where':{'ChatWebsiteId':_0x4b1702[_0x8938('0x5a')]['id']},'order':_0x8938('0x118')});});}})[_0x8938('0x22')](respondWithResult(_0x478a56,null))[_0x8938('0x2b')](handleError(_0x478a56,null));};exports[_0x8938('0x119')]=function(_0x262217,_0x3585d1,_0x4602b6){var _0x51293c={};var _0x440102={};var _0x16fdb1;var _0x1e3850;return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x262217[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x3585d1,null))['then'](function(_0x7f6422){if(_0x7f6422){_0x16fdb1=_0x7f6422;_0x440102[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0x116')]['rawAttributes']);_0x440102['query']=_[_0x8938('0x5b')](_0x262217[_0x8938('0x48')]);_0x440102['filters']=_['intersection'](_0x440102[_0x8938('0x47')],_0x440102[_0x8938('0x48')]);_0x51293c[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x440102[_0x8938('0x47')],qs['fields'](_0x262217['query'][_0x8938('0x4a')]));_0x51293c[_0x8938('0x4b')]=_0x51293c[_0x8938('0x4b')]['length']?_0x51293c[_0x8938('0x4b')]:_0x440102[_0x8938('0x47')];_0x51293c[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x262217[_0x8938('0x48')][_0x8938('0x4f')]);_0x51293c[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x262217[_0x8938('0x48')],_0x440102['filters']));if(_0x262217[_0x8938('0x48')][_0x8938('0x54')]){_0x51293c['where']=_[_0x8938('0x53')](_0x51293c['where'],{'$or':_[_0x8938('0x41')](_0x51293c[_0x8938('0x4b')],function(_0x41deda){var _0x345ba7={};_0x345ba7[_0x41deda]={'$like':'%'+_0x262217[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x345ba7;})});}_0x51293c=_[_0x8938('0x53')]({},_0x51293c,_0x262217[_0x8938('0x55')]);return _0x16fdb1[_0x8938('0x119')](_0x51293c);}})[_0x8938('0x22')](function(_0x38a2ce){if(_0x38a2ce){_0x1e3850=_0x38a2ce['length'];if(!_0x262217[_0x8938('0x48')][_0x8938('0x4d')]('nolimit')){_0x51293c[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x262217[_0x8938('0x48')][_0x8938('0x30')]);_0x51293c[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x262217[_0x8938('0x48')][_0x8938('0x2f')]);}return _0x16fdb1['getApplications'](_0x51293c);}})[_0x8938('0x22')](function(_0x24a6ef){if(_0x24a6ef){return _0x24a6ef?{'count':_0x1e3850,'rows':_0x24a6ef}:null;}})['then'](respondWithResult(_0x3585d1,null))[_0x8938('0x2b')](handleError(_0x3585d1,null));};exports[_0x8938('0x11a')]=function(_0x398d2c,_0x3c257a,_0x3a1445){return db[_0x8938('0x11b')][_0x8938('0x5c')]({'where':{'id':_0x398d2c[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x3c257a,null))['then'](function(_0x184964){if(_0x184964){return _0x184964[_0x8938('0x11a')](_0x398d2c[_0x8938('0x61')]['ids'],_[_0x8938('0xf1')](_0x398d2c[_0x8938('0x61')],[_0x8938('0xf2'),'id'])||{});}})[_0x8938('0x22')](respondWithResult(_0x3c257a,null))[_0x8938('0x2b')](handleError(_0x3c257a,null));};exports['getProactiveActions']=function(_0x5cf80b,_0xc83460,_0x4696b4){var _0x14cf98={};var _0x49986d={};var _0x359c96;var _0x72a7f3;return db['ChatWebsite'][_0x8938('0x66')]({'where':{'id':_0x5cf80b[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0xc83460,null))[_0x8938('0x22')](function(_0x4cb2b6){if(_0x4cb2b6){_0x359c96=_0x4cb2b6;_0x49986d['model']=_[_0x8938('0x5b')](db[_0x8938('0x11c')][_0x8938('0x43')]);_0x49986d['query']=_[_0x8938('0x5b')](_0x5cf80b['query']);_0x49986d['filters']=_['intersection'](_0x49986d[_0x8938('0x47')],_0x49986d[_0x8938('0x48')]);_0x14cf98[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x49986d[_0x8938('0x47')],qs['fields'](_0x5cf80b[_0x8938('0x48')][_0x8938('0x4a')]));_0x14cf98['attributes']=_0x14cf98[_0x8938('0x4b')]['length']?_0x14cf98[_0x8938('0x4b')]:_0x49986d[_0x8938('0x47')];_0x14cf98[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x5cf80b[_0x8938('0x48')]['sort']);_0x14cf98[_0x8938('0x50')]=qs[_0x8938('0x51')](_['pick'](_0x5cf80b[_0x8938('0x48')],_0x49986d[_0x8938('0x51')]));if(_0x5cf80b[_0x8938('0x48')][_0x8938('0x54')]){_0x14cf98[_0x8938('0x50')]=_[_0x8938('0x53')](_0x14cf98[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x14cf98[_0x8938('0x4b')],function(_0x2d4899){var _0x43e945={};_0x43e945[_0x2d4899]={'$like':'%'+_0x5cf80b[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x43e945;})});}_0x14cf98=_['merge']({},_0x14cf98,_0x5cf80b[_0x8938('0x55')]);return _0x359c96[_0x8938('0x105')](_0x14cf98);}})[_0x8938('0x22')](function(_0x357742){if(_0x357742){_0x72a7f3=_0x357742[_0x8938('0x4c')];if(!_0x5cf80b[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x14cf98[_0x8938('0x30')]=qs[_0x8938('0x30')](_0x5cf80b[_0x8938('0x48')][_0x8938('0x30')]);_0x14cf98[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x5cf80b[_0x8938('0x48')][_0x8938('0x2f')]);}return _0x359c96['getProactiveActions'](_0x14cf98);}})[_0x8938('0x22')](function(_0x1a19dd){if(_0x1a19dd){return _0x1a19dd?{'count':_0x72a7f3,'rows':_0x1a19dd}:null;}})[_0x8938('0x22')](respondWithResult(_0xc83460,null))[_0x8938('0x2b')](handleError(_0xc83460,null));};exports[_0x8938('0x11d')]=function(_0x3aa8d0,_0xd17e87,_0x44c3f3){var _0x23afdc=_0x3aa8d0[_0x8938('0x48')][_0x8938('0x11e')]==='false'?_0x8938('0x11f'):'onlineForm';return db['ChatWebsite'][_0x8938('0x5c')]({'attributes':['id',_0x23afdc],'where':{'id':_0x3aa8d0[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0xd17e87,null))[_0x8938('0x22')](function(_0x65c864){if(_0x65c864){var _0x2760ed=_0x65c864[_0x23afdc];var _0x374975=_0x2760ed&&_0x2760ed[_0x8938('0x120')]?_0x2760ed[_0x8938('0x120')]:[];_0xd17e87['send']({'fromKey':_[_0x8938('0x7c')](_0x2760ed[_0x8938('0x121')])?undefined:_0x2760ed[_0x8938('0x121')],'count':_0x374975[_0x8938('0x4c')],'rows':_0x374975});}})[_0x8938('0x2b')](handleError(_0xd17e87,null));};exports[_0x8938('0x122')]=function(_0x412ed5,_0x2c6b17,_0x526867){var _0x28c4c0={'raw':![],'where':{}};var _0x17f499={};var _0x504a3e={'count':0x0,'rows':[]};return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x412ed5['params']['id']}})['then'](handleEntityNotFound(_0x2c6b17,null))[_0x8938('0x22')](function(_0x4a1be5){if(_0x4a1be5){_0x17f499[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0xd3')]['rawAttributes']);_0x17f499['query']=_['keys'](_0x412ed5[_0x8938('0x48')]);_0x17f499[_0x8938('0x51')]=_[_0x8938('0x49')](_0x17f499['model'],_0x17f499[_0x8938('0x48')]);_0x28c4c0['attributes']=_[_0x8938('0x49')](_0x17f499[_0x8938('0x47')],qs['fields'](_0x412ed5[_0x8938('0x48')][_0x8938('0x4a')]));_0x28c4c0[_0x8938('0x4b')]=_0x28c4c0[_0x8938('0x4b')][_0x8938('0x4c')]?_0x28c4c0[_0x8938('0x4b')]:_0x17f499[_0x8938('0x47')];if(!_0x412ed5['query'][_0x8938('0x4d')](_0x8938('0x4e'))){_0x28c4c0['limit']=qs[_0x8938('0x30')](_0x412ed5[_0x8938('0x48')][_0x8938('0x30')]);_0x28c4c0[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x412ed5[_0x8938('0x48')][_0x8938('0x2f')]);}_0x28c4c0[_0x8938('0x67')]=qs[_0x8938('0x4f')](_0x412ed5[_0x8938('0x48')][_0x8938('0x4f')]);_0x28c4c0['where']=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x412ed5[_0x8938('0x48')],_0x17f499['filters']));_0x28c4c0[_0x8938('0x50')][_0x8938('0x63')]=_0x4a1be5['id'];if(_0x412ed5[_0x8938('0x48')][_0x8938('0x54')]){_0x28c4c0[_0x8938('0x50')]=_[_0x8938('0x53')](_0x28c4c0[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x28c4c0['attributes'],function(_0x486a82){var _0x2b13df={};_0x2b13df[_0x486a82]={'$like':'%'+_0x412ed5[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x2b13df;})});}_0x28c4c0=_[_0x8938('0x53')]({},_0x28c4c0,_0x412ed5['options']);return db[_0x8938('0xd3')]['count']({'where':_0x28c4c0['where']})[_0x8938('0x22')](function(_0x2d7264){_0x504a3e[_0x8938('0x68')]=_0x2d7264;if(_0x412ed5['query'][_0x8938('0x6c')]){_0x28c4c0[_0x8938('0x56')]=[{'all':!![]}];}else{_0x28c4c0[_0x8938('0x56')]=[{'model':db[_0x8938('0x9b')],'as':_0x8938('0xf4'),'required':![]},{'model':db[_0x8938('0xdc')],'as':'Attachments','required':![]}];}return db[_0x8938('0xd3')][_0x8938('0x57')](_0x28c4c0);})[_0x8938('0x22')](function(_0x2c472c){_0x504a3e[_0x8938('0x58')]=_0x2c472c;return _0x504a3e;});}})[_0x8938('0x22')](respondWithFilteredResult(_0x2c6b17,_0x28c4c0))[_0x8938('0x2b')](handleError(_0x2c6b17,null));};exports['addAgents']=function(_0x2d15ff,_0x44190c,_0x4c407f){return db[_0x8938('0x42')]['find']({'where':{'id':_0x2d15ff[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x44190c,null))[_0x8938('0x22')](function(_0x348870){if(_0x348870){return _0x348870['addAgents'](_0x2d15ff['body'][_0x8938('0xf2')],_['omit'](_0x2d15ff[_0x8938('0x61')],[_0x8938('0xf2'),'id'])||{})['spread'](function(_0x516ba3){for(var _0x51ddd5=0x0;_0x51ddd5<_0x2d15ff[_0x8938('0x61')][_0x8938('0xf2')][_0x8938('0x4c')];_0x51ddd5+=0x1){socket['emit'](_0x8938('0x123'),{'UserId':Number(_0x2d15ff[_0x8938('0x61')][_0x8938('0xf2')][_0x51ddd5]),'ChatWebsiteId':Number(_0x2d15ff[_0x8938('0x5a')]['id'])});}return _0x516ba3;});}})['then'](respondWithResult(_0x44190c,null))[_0x8938('0x2b')](handleError(_0x44190c,null));};exports['removeAgents']=function(_0x4af9d9,_0x12be0a,_0x1ec88a){return db['ChatWebsite'][_0x8938('0x5c')]({'where':{'id':_0x4af9d9[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x12be0a,null))['then'](function(_0x59bdec){if(_0x59bdec){return _0x59bdec[_0x8938('0x124')](_0x4af9d9['query'][_0x8938('0xf2')])[_0x8938('0x22')](function(){if(_[_0x8938('0x125')](_0x4af9d9[_0x8938('0x48')][_0x8938('0xf2')])){for(var _0x486e23=0x0;_0x486e23<_0x4af9d9[_0x8938('0x48')]['ids'][_0x8938('0x4c')];_0x486e23+=0x1){socket[_0x8938('0x126')](_0x8938('0x127'),{'UserId':Number(_0x4af9d9[_0x8938('0x48')][_0x8938('0xf2')][_0x486e23]),'ChatWebsiteId':Number(_0x4af9d9[_0x8938('0x5a')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x4af9d9['query'][_0x8938('0xf2')]),'ChatWebsiteId':Number(_0x4af9d9['params']['id'])});}});}})[_0x8938('0x22')](respondWithStatusCode(_0x12be0a,null))[_0x8938('0x2b')](handleError(_0x12be0a,null));};exports[_0x8938('0x128')]=function(_0x388dbb,_0x897f5c,_0x373607){var _0x27e10f={};var _0x12e2b2={};var _0x1a532b;var _0x2469f6;return db[_0x8938('0x42')][_0x8938('0x66')]({'where':{'id':_0x388dbb[_0x8938('0x5a')]['id']}})[_0x8938('0x22')](handleEntityNotFound(_0x897f5c,null))[_0x8938('0x22')](function(_0x326b6e){if(_0x326b6e){_0x1a532b=_0x326b6e;_0x12e2b2[_0x8938('0x47')]=_[_0x8938('0x5b')](db[_0x8938('0xbf')][_0x8938('0x43')]);_0x12e2b2[_0x8938('0x48')]=_['keys'](_0x388dbb[_0x8938('0x48')]);_0x12e2b2[_0x8938('0x51')]=_[_0x8938('0x49')](_0x12e2b2[_0x8938('0x47')],_0x12e2b2[_0x8938('0x48')]);_0x27e10f[_0x8938('0x4b')]=_[_0x8938('0x49')](_0x12e2b2[_0x8938('0x47')],qs['fields'](_0x388dbb[_0x8938('0x48')][_0x8938('0x4a')]));_0x27e10f[_0x8938('0x4b')]=_0x27e10f[_0x8938('0x4b')]['length']?_0x27e10f[_0x8938('0x4b')]:_0x12e2b2[_0x8938('0x47')];_0x27e10f['order']=qs[_0x8938('0x4f')](_0x388dbb[_0x8938('0x48')]['sort']);_0x27e10f[_0x8938('0x50')]=qs[_0x8938('0x51')](_[_0x8938('0x52')](_0x388dbb['query'],_0x12e2b2['filters']));if(_0x388dbb[_0x8938('0x48')][_0x8938('0x54')]){_0x27e10f['where']=_[_0x8938('0x53')](_0x27e10f[_0x8938('0x50')],{'$or':_[_0x8938('0x41')](_0x27e10f[_0x8938('0x4b')],function(_0x74e8f2){var _0x59e7fb={};_0x59e7fb[_0x74e8f2]={'$like':'%'+_0x388dbb[_0x8938('0x48')][_0x8938('0x54')]+'%'};return _0x59e7fb;})});}_0x27e10f=_[_0x8938('0x53')]({},_0x27e10f,_0x388dbb['options']);return _0x1a532b['getAgents'](_0x27e10f);}})[_0x8938('0x22')](function(_0x1151e9){if(_0x1151e9){_0x2469f6=_0x1151e9['length'];if(!_0x388dbb[_0x8938('0x48')][_0x8938('0x4d')](_0x8938('0x4e'))){_0x27e10f[_0x8938('0x30')]=qs['limit'](_0x388dbb['query'][_0x8938('0x30')]);_0x27e10f[_0x8938('0x2f')]=qs[_0x8938('0x2f')](_0x388dbb[_0x8938('0x48')][_0x8938('0x2f')]);}return _0x1a532b[_0x8938('0x128')](_0x27e10f);}})[_0x8938('0x22')](function(_0x3bdb20){if(_0x3bdb20){return _0x3bdb20?{'count':_0x2469f6,'rows':_0x3bdb20}:null;}})[_0x8938('0x22')](respondWithResult(_0x897f5c,null))['catch'](handleError(_0x897f5c,null));};
\ No newline at end of file
index 18b582d..780d79a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd246=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x258ac4,_0x50432d){var _0x3b4c31=function(_0x5f4857){while(--_0x5f4857){_0x258ac4['push'](_0x258ac4['shift']());}};_0x3b4c31(++_0x50432d);}(_0xd246,0xf5));var _0x6d24=function(_0x562faf,_0x102bcc){_0x562faf=_0x562faf-0x0;var _0x22c1f6=_0xd246[_0x562faf];return _0x22c1f6;};'use strict';var EventEmitter=require(_0x6d24('0x0'));var ChatWebsite=require(_0x6d24('0x1'))['db'][_0x6d24('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x6d24('0x3')](0x0);var events={'afterCreate':_0x6d24('0x4'),'afterUpdate':_0x6d24('0x5'),'afterDestroy':_0x6d24('0x6')};function emitEvent(_0x51c18f){return function(_0x4e76e1,_0xfa68f3,_0x58e7fc){ChatWebsiteEvents[_0x6d24('0x7')](_0x51c18f+':'+_0x4e76e1['id'],_0x4e76e1);ChatWebsiteEvents['emit'](_0x51c18f,_0x4e76e1);_0x58e7fc(null);};}for(var e in events){if(events[_0x6d24('0x8')](e)){var event=events[e];ChatWebsite[_0x6d24('0x9')](e,emitEvent(event));}}module[_0x6d24('0xa')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xc9b9=['hasOwnProperty','hook','exports','ChatWebsite','setMaxListeners','save'];(function(_0x23239b,_0x4a22c8){var _0xaae286=function(_0x5dbd44){while(--_0x5dbd44){_0x23239b['push'](_0x23239b['shift']());}};_0xaae286(++_0x4a22c8);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x1655bb,_0x5a82ae){_0x1655bb=_0x1655bb-0x0;var _0x5e2020=_0xc9b9[_0x1655bb];return _0x5e2020;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x9c9b('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9c9b('0x1')](0x0);var events={'afterCreate':_0x9c9b('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x48231c){return function(_0x497d53,_0x38a64b,_0x4be6dc){ChatWebsiteEvents['emit'](_0x48231c+':'+_0x497d53['id'],_0x497d53);ChatWebsiteEvents['emit'](_0x48231c,_0x497d53);_0x4be6dc(null);};}for(var e in events){if(events[_0x9c9b('0x3')](e)){var event=events[e];ChatWebsite[_0x9c9b('0x4')](e,emitEvent(event));}}module[_0x9c9b('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
index cbf5e48..7feb8b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4140=['request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','../../config/logger','api','moment'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x4140,0xa4));var _0x0414=function(_0x4cdf87,_0x200caf){_0x4cdf87=_0x4cdf87-0x0;var _0x14d49d=_0x4140[_0x4cdf87];return _0x14d49d;};'use strict';var _=require(_0x0414('0x0'));var util=require(_0x0414('0x1'));var logger=require(_0x0414('0x2'))(_0x0414('0x3'));var moment=require(_0x0414('0x4'));var BPromise=require('bluebird');var rp=require(_0x0414('0x5'));var fs=require('fs');var path=require(_0x0414('0x6'));var rimraf=require(_0x0414('0x7'));var config=require(_0x0414('0x8'));var attributes=require(_0x0414('0x9'));module[_0x0414('0xa')]=function(_0x2b089c,_0xd45ef4){return _0x2b089c[_0x0414('0xb')]('ChatWebsite',attributes,{'tableName':_0x0414('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x77f8=['moment','request-promise','path','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','util','../../config/logger','api'];(function(_0x1fb55b,_0x473495){var _0x30ec9a=function(_0x94638){while(--_0x94638){_0x1fb55b['push'](_0x1fb55b['shift']());}};_0x30ec9a(++_0x473495);}(_0x77f8,0xd5));var _0x877f=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0x77f8[_0x5a3cf0];return _0x5a64ee;};'use strict';var _=require('lodash');var util=require(_0x877f('0x0'));var logger=require(_0x877f('0x1'))(_0x877f('0x2'));var moment=require(_0x877f('0x3'));var BPromise=require('bluebird');var rp=require(_0x877f('0x4'));var fs=require('fs');var path=require(_0x877f('0x5'));var rimraf=require('rimraf');var config=require(_0x877f('0x6'));var attributes=require(_0x877f('0x7'));module[_0x877f('0x8')]=function(_0x455c99,_0x1ac165){return _0x455c99[_0x877f('0x9')](_0x877f('0xa'),attributes,{'tableName':_0x877f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1a00303..1b93e85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25f2=['http','redis','localhost','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client'];(function(_0x336ca2,_0x1a813a){var _0xda59a6=function(_0x47caa6){while(--_0x47caa6){_0x336ca2['push'](_0x336ca2['shift']());}};_0xda59a6(++_0x1a813a);}(_0x25f2,0x8b));var _0x225f=function(_0x45e987,_0x3f95d8){_0x45e987=_0x45e987-0x0;var _0x3cc3e0=_0x25f2[_0x45e987];return _0x3cc3e0;};'use strict';var _=require(_0x225f('0x0'));var util=require(_0x225f('0x1'));var moment=require(_0x225f('0x2'));var BPromise=require(_0x225f('0x3'));var rs=require(_0x225f('0x4'));var fs=require('fs');var Redis=require(_0x225f('0x5'));var db=require(_0x225f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x225f('0x7'))(_0x225f('0x8'));var config=require(_0x225f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x225f('0xa')][_0x225f('0xb')]({'port':0x232a});config[_0x225f('0xc')]=_['defaults'](config[_0x225f('0xc')],{'host':_0x225f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x225f('0xc')]));require('./chatWebsite.socket')[_0x225f('0xe')](socket);function respondWithRpcPromise(_0x555642,_0x2390c0,_0x4e9a0e){return new BPromise(function(_0x304d4b,_0x1f7008){return client[_0x225f('0xf')](_0x555642,_0x4e9a0e)[_0x225f('0x10')](function(_0x4399f0){logger[_0x225f('0x11')](_0x225f('0x12'),_0x2390c0,_0x225f('0x13'));logger['debug'](_0x225f('0x14'),_0x2390c0,_0x225f('0x13'),JSON[_0x225f('0x15')](_0x4399f0));if(_0x4399f0[_0x225f('0x16')]){if(_0x4399f0[_0x225f('0x16')][_0x225f('0x17')]===0x1f4){logger[_0x225f('0x16')](_0x225f('0x12'),_0x2390c0,_0x4399f0[_0x225f('0x16')][_0x225f('0x18')]);return _0x1f7008(_0x4399f0['error'][_0x225f('0x18')]);}logger[_0x225f('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2390c0,_0x4399f0[_0x225f('0x16')][_0x225f('0x18')]);return _0x304d4b(_0x4399f0['error'][_0x225f('0x18')]);}else{logger['info'](_0x225f('0x12'),_0x2390c0,'request\x20sent');_0x304d4b(_0x4399f0['result'][_0x225f('0x18')]);}})['catch'](function(_0x8bd13a){logger[_0x225f('0x16')](_0x225f('0x12'),_0x2390c0,_0x8bd13a);_0x1f7008(_0x8bd13a);});});}
\ No newline at end of file
+var _0x8d7c=['localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','defaults','redis'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8d7c,0xdf));var _0xc8d7=function(_0x57611e,_0x4482c8){_0x57611e=_0x57611e-0x0;var _0x36cacc=_0x8d7c[_0x57611e];return _0x36cacc;};'use strict';var _=require(_0xc8d7('0x0'));var util=require(_0xc8d7('0x1'));var moment=require(_0xc8d7('0x2'));var BPromise=require(_0xc8d7('0x3'));var rs=require(_0xc8d7('0x4'));var fs=require('fs');var Redis=require(_0xc8d7('0x5'));var db=require(_0xc8d7('0x6'))['db'];var utils=require(_0xc8d7('0x7'));var logger=require('../../config/logger')(_0xc8d7('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xc8d7('0x9')](config[_0xc8d7('0xa')],{'host':_0xc8d7('0xb'),'port':0x18eb});var socket=require(_0xc8d7('0xc'))(new Redis(config['redis']));require(_0xc8d7('0xd'))[_0xc8d7('0xe')](socket);function respondWithRpcPromise(_0x1c5978,_0x3c85a,_0x323a13){return new BPromise(function(_0x4acc08,_0x338bd1){return client['request'](_0x1c5978,_0x323a13)[_0xc8d7('0xf')](function(_0x15ead5){logger[_0xc8d7('0x10')](_0xc8d7('0x11'),_0x3c85a,_0xc8d7('0x12'));logger[_0xc8d7('0x13')](_0xc8d7('0x14'),_0x3c85a,_0xc8d7('0x12'),JSON[_0xc8d7('0x15')](_0x15ead5));if(_0x15ead5[_0xc8d7('0x16')]){if(_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x17')]===0x1f4){logger[_0xc8d7('0x16')](_0xc8d7('0x11'),_0x3c85a,_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);return _0x338bd1(_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);}logger[_0xc8d7('0x16')](_0xc8d7('0x11'),_0x3c85a,_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);return _0x4acc08(_0x15ead5[_0xc8d7('0x16')][_0xc8d7('0x18')]);}else{logger['info'](_0xc8d7('0x11'),_0x3c85a,_0xc8d7('0x12'));_0x4acc08(_0x15ead5['result'][_0xc8d7('0x18')]);}})[_0xc8d7('0x19')](function(_0x5042b9){logger[_0xc8d7('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x3c85a,_0x5042b9);_0x338bd1(_0x5042b9);});});}
\ No newline at end of file
index 56b4b51..5528ed6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6645=['chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2b1112,_0x51d6bd){var _0x1776e9=function(_0x264015){while(--_0x264015){_0x2b1112['push'](_0x2b1112['shift']());}};_0x1776e9(++_0x51d6bd);}(_0x6645,0x118));var _0x5664=function(_0x5f2301,_0x5b012d){_0x5f2301=_0x5f2301-0x0;var _0x4a0d33=_0x6645[_0x5f2301];return _0x4a0d33;};'use strict';var ChatWebsiteEvents=require(_0x5664('0x0'));var events=[_0x5664('0x1'),_0x5664('0x2'),_0x5664('0x3')];function createListener(_0x547df4,_0x1cd19d){return function(_0x5992c4){_0x1cd19d[_0x5664('0x4')](_0x547df4,_0x5992c4);};}function removeListener(_0xc7866f,_0x1c4c64){return function(){ChatWebsiteEvents[_0x5664('0x5')](_0xc7866f,_0x1c4c64);};}exports[_0x5664('0x6')]=function(_0x38bf1e){for(var _0x48aaaf=0x0,_0x5ed9f1=events[_0x5664('0x7')];_0x48aaaf<_0x5ed9f1;_0x48aaaf++){var _0x1f3189=events[_0x48aaaf];var _0xa0773e=createListener(_0x5664('0x8')+_0x1f3189,_0x38bf1e);ChatWebsiteEvents['on'](_0x1f3189,_0xa0773e);}};
\ No newline at end of file
+var _0x98bf=['length','chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x576292,_0x23b1a2){var _0x3aa65b=function(_0x2eac91){while(--_0x2eac91){_0x576292['push'](_0x576292['shift']());}};_0x3aa65b(++_0x23b1a2);}(_0x98bf,0xb6));var _0xf98b=function(_0xd60ec9,_0x4c62fd){_0xd60ec9=_0xd60ec9-0x0;var _0x4a6c4b=_0x98bf[_0xd60ec9];return _0x4a6c4b;};'use strict';var ChatWebsiteEvents=require(_0xf98b('0x0'));var events=[_0xf98b('0x1'),_0xf98b('0x2'),_0xf98b('0x3')];function createListener(_0x9ed68,_0x2b2a4e){return function(_0x226a00){_0x2b2a4e[_0xf98b('0x4')](_0x9ed68,_0x226a00);};}function removeListener(_0x528232,_0xeda2ce){return function(){ChatWebsiteEvents[_0xf98b('0x5')](_0x528232,_0xeda2ce);};}exports[_0xf98b('0x6')]=function(_0x35d2cd){for(var _0x40d437=0x0,_0x3cc5ab=events[_0xf98b('0x7')];_0x40d437<_0x3cc5ab;_0x40d437++){var _0x209326=events[_0x40d437];var _0x57874e=createListener(_0xf98b('0x8')+_0x209326,_0x35d2cd);ChatWebsiteEvents['on'](_0x209326,_0x57874e);}};
\ No newline at end of file
index 04e284f..32ee1c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe493=['util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','getFields','getOfflineMessages','post','create','addAnswer','root','format','%s-%s','originalname','file','addLogo','diskStorage','join','server/files/images/avatars/','now','addAvatar','single','notify','server/files','attachments','offline-chat','extname','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','multer'];(function(_0x4dd4fe,_0x200d4a){var _0x20b374=function(_0x589039){while(--_0x589039){_0x4dd4fe['push'](_0x4dd4fe['shift']());}};_0x20b374(++_0x200d4a);}(_0xe493,0x8d));var _0x3e49=function(_0x6f1bdd,_0x10be27){_0x6f1bdd=_0x6f1bdd-0x0;var _0x44a67e=_0xe493[_0x6f1bdd];return _0x44a67e;};'use strict';var multer=require(_0x3e49('0x0'));var util=require(_0x3e49('0x1'));var path=require('path');var timeout=require(_0x3e49('0x2'));var express=require(_0x3e49('0x3'));var router=express['Router']();var fs_extra=require(_0x3e49('0x4'));var auth=require(_0x3e49('0x5'));var interaction=require(_0x3e49('0x6'));var config=require(_0x3e49('0x7'));var controller=require(_0x3e49('0x8'));router[_0x3e49('0x9')]('/',auth[_0x3e49('0xa')](),controller[_0x3e49('0xb')]);router[_0x3e49('0x9')](_0x3e49('0xc'),auth[_0x3e49('0xa')](),controller[_0x3e49('0xd')]);router['get'](_0x3e49('0xe'),auth[_0x3e49('0xa')](),controller[_0x3e49('0xf')]);router[_0x3e49('0x9')](_0x3e49('0x10'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x11')]);router[_0x3e49('0x9')](_0x3e49('0x12'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x13')]);router[_0x3e49('0x9')](_0x3e49('0x14'),controller[_0x3e49('0x15')]);router[_0x3e49('0x9')](_0x3e49('0x16'),controller[_0x3e49('0x17')]);router[_0x3e49('0x9')](_0x3e49('0x18'),controller[_0x3e49('0x19')]);router[_0x3e49('0x9')](_0x3e49('0x1a'),controller[_0x3e49('0x1b')]);router[_0x3e49('0x9')](_0x3e49('0x1c'),auth['isAuthenticated'](),controller[_0x3e49('0x1d')]);router['get'](_0x3e49('0x1e'),controller[_0x3e49('0x1f')]);router[_0x3e49('0x9')](_0x3e49('0x20'),auth['isAuthenticated'](),controller[_0x3e49('0x21')]);router['get'](_0x3e49('0x22'),auth[_0x3e49('0xa')](),controller['getProactiveActions']);router['get'](_0x3e49('0x23'),controller[_0x3e49('0x24')]);router['get']('/:id/offline_messages',auth[_0x3e49('0xa')](),controller[_0x3e49('0x25')]);router[_0x3e49('0x9')]('/:id/users',auth[_0x3e49('0xa')](),controller['getAgents']);router[_0x3e49('0x26')]('/',auth[_0x3e49('0xa')](),controller[_0x3e49('0x27')]);router[_0x3e49('0x26')](_0x3e49('0x10'),auth[_0x3e49('0xa')](),controller['addDisposition']);router[_0x3e49('0x26')](_0x3e49('0x12'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a5d74,_0x27322a,_0x437b62){_0x437b62(null,path['join'](config[_0x3e49('0x29')],'server/files/images/logos/'));},'filename':function(_0xb0a4d3,_0x50a310,_0x39d544){_0x39d544(null,util[_0x3e49('0x2a')](_0x3e49('0x2b'),Date['now'](),_0x50a310[_0x3e49('0x2c')]));}})});router[_0x3e49('0x26')]('/:id/logo',upload['single'](_0x3e49('0x2d')),controller[_0x3e49('0x2e')]);var upload=multer({'storage':multer[_0x3e49('0x2f')]({'destination':function(_0x3defb5,_0x5e485c,_0x2901cd){_0x2901cd(null,path[_0x3e49('0x30')](config['root'],_0x3e49('0x31')));},'filename':function(_0x332301,_0x49a95a,_0x13e547){_0x13e547(null,util[_0x3e49('0x2a')](_0x3e49('0x2b'),Date[_0x3e49('0x32')](),_0x49a95a[_0x3e49('0x2c')]));}})});router[_0x3e49('0x26')]('/:id/avatar',upload['single'](_0x3e49('0x2d')),controller[_0x3e49('0x33')]);var upload=multer({'storage':multer[_0x3e49('0x2f')]({'destination':function(_0x3cc346,_0x23bd16,_0x393a86){_0x393a86(null,path[_0x3e49('0x30')](config[_0x3e49('0x29')],_0x3e49('0x31')));},'filename':function(_0x37f2e4,_0xe29359,_0xaebb73){_0xaebb73(null,util[_0x3e49('0x2a')](_0x3e49('0x2b'),Date['now'](),_0xe29359[_0x3e49('0x2c')]));}})});router[_0x3e49('0x26')](_0x3e49('0x18'),upload[_0x3e49('0x34')](_0x3e49('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x3e49('0x2f')]({'destination':function(_0x1af537,_0x5350cb,_0x35c583){_0x35c583(null,path[_0x3e49('0x30')](config['root'],_0x3e49('0x31')));},'filename':function(_0x2a70d6,_0x1f87f8,_0x2e2a4d){_0x2e2a4d(null,util['format']('%s-%s',Date[_0x3e49('0x32')](),_0x1f87f8[_0x3e49('0x2c')]));}})});router['post']('/:id/system_avatar',upload[_0x3e49('0x34')](_0x3e49('0x2d')),controller['addSystemAvatar']);router[_0x3e49('0x26')]('/:id/notify',controller[_0x3e49('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x3e49('0x2f')]({'destination':function(_0x4d81da,_0x411ed4,_0x4f053c){const _0x5574b2=path[_0x3e49('0x30')](config['root'],_0x3e49('0x36'),_0x3e49('0x37'),_0x3e49('0x38'));fs_extra['ensureDir'](_0x5574b2,function(){_0x4f053c(null,_0x5574b2);});},'filename':function(_0x55958e,_0x524b0e,_0x369fc8){const _0x42b25b=_0x524b0e[_0x3e49('0x2c')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x8297c2=path[_0x3e49('0x39')](_0x42b25b);const _0x535441=Date['now']()+'-'+_0x42b25b['replace'](_0x8297c2,'')+_0x8297c2;_0x369fc8(null,_0x535441);}})});router[_0x3e49('0x26')]('/:id/offline',offlineUploadMulter[_0x3e49('0x3a')](),controller[_0x3e49('0x3b')]);router[_0x3e49('0x26')]('/:id/interactions',auth[_0x3e49('0xa')](),controller[_0x3e49('0x3c')]);router[_0x3e49('0x26')](_0x3e49('0x20'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x3d')]);router['post'](_0x3e49('0x22'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x3e')]);router[_0x3e49('0x26')](_0x3e49('0x3f'),auth['isAuthenticated'](),controller[_0x3e49('0x40')]);router['put'](_0x3e49('0xe'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x41')]);router[_0x3e49('0x42')](_0x3e49('0xe'),auth[_0x3e49('0xa')](),controller[_0x3e49('0x43')]);router['delete']('/:id/dispositions',auth[_0x3e49('0xa')](),controller[_0x3e49('0x44')]);router['delete'](_0x3e49('0x12'),auth[_0x3e49('0xa')](),controller['removeAnswers']);router[_0x3e49('0x42')]('/:id/users',auth[_0x3e49('0xa')](),controller[_0x3e49('0x45')]);module[_0x3e49('0x46')]=router;
\ No newline at end of file
+var _0x908f=['./chatWebsite.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/customer_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','diskStorage','join','format','%s-%s','now','originalname','single','addLogo','root','file','addAvatar','addCustomerAvatar','server/files/images/avatars/','/:id/system_avatar','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x1a920f,_0x547b1b){var _0x390e05=function(_0xa37692){while(--_0xa37692){_0x1a920f['push'](_0x1a920f['shift']());}};_0x390e05(++_0x547b1b);}(_0x908f,0x1a5));var _0xf908=function(_0x26868d,_0x471272){_0x26868d=_0x26868d-0x0;var _0x4d24ad=_0x908f[_0x26868d];return _0x4d24ad;};'use strict';var multer=require(_0xf908('0x0'));var util=require('util');var path=require(_0xf908('0x1'));var timeout=require(_0xf908('0x2'));var express=require('express');var router=express[_0xf908('0x3')]();var fs_extra=require(_0xf908('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf908('0x5'));var config=require('../../config/environment');var controller=require(_0xf908('0x6'));router[_0xf908('0x7')]('/',auth[_0xf908('0x8')](),controller[_0xf908('0x9')]);router[_0xf908('0x7')](_0xf908('0xa'),auth[_0xf908('0x8')](),controller[_0xf908('0xb')]);router[_0xf908('0x7')](_0xf908('0xc'),auth['isAuthenticated'](),controller[_0xf908('0xd')]);router[_0xf908('0x7')](_0xf908('0xe'),auth[_0xf908('0x8')](),controller[_0xf908('0xf')]);router[_0xf908('0x7')](_0xf908('0x10'),auth[_0xf908('0x8')](),controller['getAnswers']);router[_0xf908('0x7')](_0xf908('0x11'),controller[_0xf908('0x12')]);router[_0xf908('0x7')]('/:id/avatar',controller['getAvatar']);router[_0xf908('0x7')](_0xf908('0x13'),controller['getCustomerAvatar']);router[_0xf908('0x7')]('/:id/system_avatar',controller[_0xf908('0x14')]);router[_0xf908('0x7')](_0xf908('0x15'),auth[_0xf908('0x8')](),controller['getInteractions']);router[_0xf908('0x7')](_0xf908('0x16'),controller['getSnippet']);router['get'](_0xf908('0x17'),auth[_0xf908('0x8')](),controller['getApplications']);router['get'](_0xf908('0x18'),auth[_0xf908('0x8')](),controller[_0xf908('0x19')]);router[_0xf908('0x7')](_0xf908('0x1a'),controller[_0xf908('0x1b')]);router[_0xf908('0x7')]('/:id/offline_messages',auth[_0xf908('0x8')](),controller[_0xf908('0x1c')]);router[_0xf908('0x7')](_0xf908('0x1d'),auth[_0xf908('0x8')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf908('0x1e')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xf908('0x1e')](_0xf908('0x10'),auth[_0xf908('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x91d1c8,_0x158fb2,_0x4d2436){_0x4d2436(null,path[_0xf908('0x20')](config['root'],'server/files/images/logos/'));},'filename':function(_0x3024ae,_0x6bcae5,_0x2c9d5c){_0x2c9d5c(null,util[_0xf908('0x21')](_0xf908('0x22'),Date[_0xf908('0x23')](),_0x6bcae5[_0xf908('0x24')]));}})});router[_0xf908('0x1e')](_0xf908('0x11'),upload[_0xf908('0x25')]('file'),controller[_0xf908('0x26')]);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x438ac4,_0x597bd6,_0x637d93){_0x637d93(null,path['join'](config[_0xf908('0x27')],'server/files/images/avatars/'));},'filename':function(_0x145fe4,_0x3cebfa,_0x284ecd){_0x284ecd(null,util[_0xf908('0x21')]('%s-%s',Date[_0xf908('0x23')](),_0x3cebfa[_0xf908('0x24')]));}})});router['post']('/:id/avatar',upload[_0xf908('0x25')](_0xf908('0x28')),controller[_0xf908('0x29')]);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x34139e,_0x10f981,_0x107fd8){_0x107fd8(null,path[_0xf908('0x20')](config[_0xf908('0x27')],'server/files/images/avatars/'));},'filename':function(_0xc87017,_0x200681,_0x51a343){_0x51a343(null,util[_0xf908('0x21')]('%s-%s',Date['now'](),_0x200681['originalname']));}})});router[_0xf908('0x1e')](_0xf908('0x13'),upload[_0xf908('0x25')](_0xf908('0x28')),controller[_0xf908('0x2a')]);var upload=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x22d8fa,_0xbd5a0d,_0x2cec0c){_0x2cec0c(null,path[_0xf908('0x20')](config[_0xf908('0x27')],_0xf908('0x2b')));},'filename':function(_0x57eee0,_0xa1c29b,_0x56c329){_0x56c329(null,util['format']('%s-%s',Date[_0xf908('0x23')](),_0xa1c29b[_0xf908('0x24')]));}})});router[_0xf908('0x1e')](_0xf908('0x2c'),upload[_0xf908('0x25')](_0xf908('0x28')),controller['addSystemAvatar']);router[_0xf908('0x1e')]('/:id/notify',controller[_0xf908('0x2d')]);const offlineUploadMulter=multer({'storage':multer[_0xf908('0x1f')]({'destination':function(_0x2d11c4,_0x230443,_0x5f4d1b){const _0x717e9c=path[_0xf908('0x20')](config['root'],_0xf908('0x2e'),'attachments',_0xf908('0x2f'));fs_extra[_0xf908('0x30')](_0x717e9c,function(){_0x5f4d1b(null,_0x717e9c);});},'filename':function(_0x545a82,_0x5cf982,_0x2bb762){const _0x29412e=_0x5cf982[_0xf908('0x24')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3c7e5b=path['extname'](_0x29412e);const _0x4c30c6=Date[_0xf908('0x23')]()+'-'+_0x29412e[_0xf908('0x31')](_0x3c7e5b,'')+_0x3c7e5b;_0x2bb762(null,_0x4c30c6);}})});router['post'](_0xf908('0x32'),offlineUploadMulter[_0xf908('0x33')](),controller[_0xf908('0x34')]);router[_0xf908('0x1e')](_0xf908('0x15'),auth[_0xf908('0x8')](),controller[_0xf908('0x35')]);router[_0xf908('0x1e')](_0xf908('0x17'),auth[_0xf908('0x8')](),controller['addApplications']);router[_0xf908('0x1e')]('/:id/proactive_actions',auth[_0xf908('0x8')](),controller[_0xf908('0x36')]);router[_0xf908('0x1e')](_0xf908('0x1d'),auth[_0xf908('0x8')](),controller[_0xf908('0x37')]);router[_0xf908('0x38')]('/:id',auth[_0xf908('0x8')](),controller[_0xf908('0x39')]);router[_0xf908('0x3a')](_0xf908('0xc'),auth['isAuthenticated'](),controller[_0xf908('0x3b')]);router['delete']('/:id/dispositions',auth[_0xf908('0x8')](),controller['removeDispositions']);router[_0xf908('0x3a')](_0xf908('0x10'),auth[_0xf908('0x8')](),controller[_0xf908('0x3c')]);router[_0xf908('0x3a')](_0xf908('0x1d'),auth[_0xf908('0x8')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index e810319..33e0149 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8958=['STRING','exports'];(function(_0x1e3c02,_0x5c07a2){var _0x4d26d7=function(_0x367ed9){while(--_0x367ed9){_0x1e3c02['push'](_0x1e3c02['shift']());}};_0x4d26d7(++_0x5c07a2);}(_0x8958,0x93));var _0x8895=function(_0x234e48,_0x28cd01){_0x234e48=_0x234e48-0x0;var _0x599086=_0x8958[_0x234e48];return _0x599086;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS','Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x8895('0x1')]},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x624c=['STRING','ENUM','AmazonAWS','Google','exports'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0x624c,0x1ee));var _0xc624=function(_0x42235f,_0x5dabfd){_0x42235f=_0x42235f-0x0;var _0x3f5fab=_0x624c[_0x42235f];return _0x3f5fab;};'use strict';var Sequelize=require('sequelize');module[_0xc624('0x0')]={'name':{'type':Sequelize[_0xc624('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xc624('0x2')](_0xc624('0x3'),_0xc624('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xc624('0x1')]}};
\ No newline at end of file
index b91e040..ef2bfcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xadb5,0xad));var _0x5adb=function(_0x2a79f2,_0x260252){_0x2a79f2=_0x2a79f2-0x0;var _0x5c0e5f=_0xadb5[_0x2a79f2];return _0x5c0e5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
+var _0xadb5=['model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','CloudProvider','fieldName','type','key'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xadb5,0xad));var _0x5adb=function(_0x5e45ca,_0x4853ca){_0x5e45ca=_0x5e45ca-0x0;var _0x1fab16=_0xadb5[_0x5e45ca];return _0x1fab16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['CloudProvider']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'all':!![]}];}return db[_0x5adb('0x2a')][_0x5adb('0x40')](_0x5d457e);})['then'](function(_0x53f2c6){_0x1eac55[_0x5adb('0x41')]=_0x53f2c6;return _0x1eac55;})['then'](respondWithFilteredResult(_0x49992e,_0x5d457e))[_0x5adb('0x42')](handleError(_0x49992e,null));};exports[_0x5adb('0x43')]=function(_0x299746,_0x121714){var _0xdfecfd={'raw':!![],'where':{'id':_0x299746[_0x5adb('0x44')]['id']}},_0x522ee5={};_0x522ee5[_0x5adb('0x2e')]=_['keys'](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x522ee5['query']=_[_0x5adb('0x30')](_0x299746[_0x5adb('0x2f')]);_0x522ee5[_0x5adb('0x39')]=_[_0x5adb('0x31')](_0x522ee5[_0x5adb('0x2e')],_0x522ee5[_0x5adb('0x2f')]);_0xdfecfd[_0x5adb('0x32')]=_['intersection'](_0x522ee5['model'],qs[_0x5adb('0x33')](_0x299746[_0x5adb('0x2f')][_0x5adb('0x33')]));_0xdfecfd[_0x5adb('0x32')]=_0xdfecfd['attributes']['length']?_0xdfecfd[_0x5adb('0x32')]:_0x522ee5[_0x5adb('0x2e')];if(_0x299746[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0xdfecfd[_0x5adb('0x3f')]=[{'all':!![]}];}_0xdfecfd=_['merge']({},_0xdfecfd,_0x299746[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')]['find'](_0xdfecfd)[_0x5adb('0x22')](handleEntityNotFound(_0x121714,null))[_0x5adb('0x22')](respondWithResult(_0x121714,null))[_0x5adb('0x42')](handleError(_0x121714,null));};exports[_0x5adb('0x46')]=function(_0x186bd2,_0x3a5409){return db[_0x5adb('0x2a')][_0x5adb('0x46')](_0x186bd2['body'],{})[_0x5adb('0x22')](respondWithResult(_0x3a5409,0xc9))['catch'](handleError(_0x3a5409,null));};exports['update']=function(_0x5015ee,_0x3cd211){if(_0x5015ee[_0x5adb('0x47')]['id']){delete _0x5015ee[_0x5adb('0x47')]['id'];}return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x5015ee['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x3cd211,null))[_0x5adb('0x22')](saveUpdates(_0x5015ee[_0x5adb('0x47')],null))['then'](respondWithResult(_0x3cd211,null))[_0x5adb('0x42')](handleError(_0x3cd211,null));};exports['destroy']=function(_0x22fa54,_0x6dc067){return db['CloudProvider'][_0x5adb('0x48')]({'where':{'id':_0x22fa54[_0x5adb('0x44')]['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x6dc067,null))[_0x5adb('0x22')](removeEntity(_0x6dc067,null))[_0x5adb('0x42')](handleError(_0x6dc067,null));};
\ No newline at end of file
index a354523..82bef70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x331c=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider','lodash'];(function(_0x2ba52e,_0x30f462){var _0x5165c0=function(_0x26db06){while(--_0x26db06){_0x2ba52e['push'](_0x2ba52e['shift']());}};_0x5165c0(++_0x30f462);}(_0x331c,0xc5));var _0xc331=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x331c[_0x3054be];return _0x3df150;};'use strict';var _=require(_0xc331('0x0'));var util=require(_0xc331('0x1'));var logger=require(_0xc331('0x2'))(_0xc331('0x3'));var moment=require(_0xc331('0x4'));var BPromise=require('bluebird');var rp=require(_0xc331('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc331('0x6'));var config=require(_0xc331('0x7'));var attributes=require(_0xc331('0x8'));module[_0xc331('0x9')]=function(_0x1133d1,_0x39ce2d){return _0x1133d1['define'](_0xc331('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2494=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x202962,_0x4baf03){var _0x4896a0=function(_0x10c05b){while(--_0x10c05b){_0x202962['push'](_0x202962['shift']());}};_0x4896a0(++_0x4baf03);}(_0x2494,0xf5));var _0x4249=function(_0x3cf5ec,_0x250439){_0x3cf5ec=_0x3cf5ec-0x0;var _0x986eec=_0x2494[_0x3cf5ec];return _0x986eec;};'use strict';var _=require(_0x4249('0x0'));var util=require(_0x4249('0x1'));var logger=require(_0x4249('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4249('0x3'));var rp=require(_0x4249('0x4'));var fs=require('fs');var path=require(_0x4249('0x5'));var rimraf=require(_0x4249('0x6'));var config=require('../../config/environment');var attributes=require(_0x4249('0x7'));module[_0x4249('0x8')]=function(_0x473708,_0x2ceed7){return _0x473708[_0x4249('0x9')](_0x4249('0xa'),attributes,{'tableName':_0x4249('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c5829f0..01f376b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1219=['http','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x306d00,_0x3b0d22){var _0x12020d=function(_0x1f66fa){while(--_0x1f66fa){_0x306d00['push'](_0x306d00['shift']());}};_0x12020d(++_0x3b0d22);}(_0x1219,0x17c));var _0x9121=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1219[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9121('0x0'));var util=require(_0x9121('0x1'));var moment=require(_0x9121('0x2'));var BPromise=require(_0x9121('0x3'));var rs=require(_0x9121('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9121('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9121('0x6'))(_0x9121('0x7'));var config=require(_0x9121('0x8'));var jayson=require(_0x9121('0x9'));var client=jayson[_0x9121('0xa')][_0x9121('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x437bac,_0x1387b7,_0x262520){return new BPromise(function(_0x409a74,_0x2c55eb){return client['request'](_0x437bac,_0x262520)[_0x9121('0xc')](function(_0x2bf1d6){logger[_0x9121('0xd')](_0x9121('0xe'),_0x1387b7,'request\x20sent');logger[_0x9121('0xf')](_0x9121('0x10'),_0x1387b7,_0x9121('0x11'),JSON[_0x9121('0x12')](_0x2bf1d6));if(_0x2bf1d6[_0x9121('0x13')]){if(_0x2bf1d6[_0x9121('0x13')][_0x9121('0x14')]===0x1f4){logger[_0x9121('0x13')](_0x9121('0xe'),_0x1387b7,_0x2bf1d6[_0x9121('0x13')][_0x9121('0x15')]);return _0x2c55eb(_0x2bf1d6[_0x9121('0x13')][_0x9121('0x15')]);}logger[_0x9121('0x13')](_0x9121('0xe'),_0x1387b7,_0x2bf1d6['error'][_0x9121('0x15')]);return _0x409a74(_0x2bf1d6[_0x9121('0x13')][_0x9121('0x15')]);}else{logger[_0x9121('0xd')](_0x9121('0xe'),_0x1387b7,_0x9121('0x11'));_0x409a74(_0x2bf1d6['result']['message']);}})[_0x9121('0x16')](function(_0x200a28){logger[_0x9121('0x13')](_0x9121('0xe'),_0x1387b7,_0x200a28);_0x2c55eb(_0x200a28);});});}
\ No newline at end of file
+var _0xc177=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb'];(function(_0x280ddd,_0xdd88f3){var _0x1ae8bd=function(_0xfe3652){while(--_0xfe3652){_0x280ddd['push'](_0x280ddd['shift']());}};_0x1ae8bd(++_0xdd88f3);}(_0xc177,0x1b2));var _0x7c17=function(_0x53cb6d,_0x1826c3){_0x53cb6d=_0x53cb6d-0x0;var _0x245e70=_0xc177[_0x53cb6d];return _0x245e70;};'use strict';var _=require(_0x7c17('0x0'));var util=require(_0x7c17('0x1'));var moment=require(_0x7c17('0x2'));var BPromise=require(_0x7c17('0x3'));var rs=require(_0x7c17('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7c17('0x5'))['db'];var utils=require(_0x7c17('0x6'));var logger=require(_0x7c17('0x7'))(_0x7c17('0x8'));var config=require('../../config/environment');var jayson=require(_0x7c17('0x9'));var client=jayson[_0x7c17('0xa')][_0x7c17('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4810b7,_0x3ab87c,_0x3aa79e){return new BPromise(function(_0x33dd1e,_0x3854dd){return client[_0x7c17('0xc')](_0x4810b7,_0x3aa79e)[_0x7c17('0xd')](function(_0x44e782){logger[_0x7c17('0xe')](_0x7c17('0xf'),_0x3ab87c,_0x7c17('0x10'));logger['debug']('CloudProvider,\x20%s,\x20%s,\x20%s',_0x3ab87c,'request\x20sent',JSON[_0x7c17('0x11')](_0x44e782));if(_0x44e782[_0x7c17('0x12')]){if(_0x44e782[_0x7c17('0x12')]['code']===0x1f4){logger[_0x7c17('0x12')](_0x7c17('0xf'),_0x3ab87c,_0x44e782[_0x7c17('0x12')]['message']);return _0x3854dd(_0x44e782['error'][_0x7c17('0x13')]);}logger[_0x7c17('0x12')]('CloudProvider,\x20%s,\x20%s',_0x3ab87c,_0x44e782[_0x7c17('0x12')]['message']);return _0x33dd1e(_0x44e782[_0x7c17('0x12')]['message']);}else{logger[_0x7c17('0xe')](_0x7c17('0xf'),_0x3ab87c,_0x7c17('0x10'));_0x33dd1e(_0x44e782[_0x7c17('0x14')][_0x7c17('0x13')]);}})[_0x7c17('0x15')](function(_0x87715a){logger[_0x7c17('0x12')](_0x7c17('0xf'),_0x3ab87c,_0x87715a);_0x3854dd(_0x87715a);});});}
\ No newline at end of file
index f62f538..22ccb20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25d3=['delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put','update'];(function(_0x32fdea,_0x2cc54e){var _0x39e620=function(_0x1e6a5e){while(--_0x1e6a5e){_0x32fdea['push'](_0x32fdea['shift']());}};_0x39e620(++_0x2cc54e);}(_0x25d3,0x1b7));var _0x325d=function(_0x3d16bc,_0x475667){_0x3d16bc=_0x3d16bc-0x0;var _0x5e03ea=_0x25d3[_0x3d16bc];return _0x5e03ea;};'use strict';var multer=require(_0x325d('0x0'));var util=require(_0x325d('0x1'));var path=require(_0x325d('0x2'));var timeout=require(_0x325d('0x3'));var express=require('express');var router=express[_0x325d('0x4')]();var fs_extra=require(_0x325d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x325d('0x6'));var config=require(_0x325d('0x7'));var controller=require('./cloudProvider.controller');router['get']('/',auth[_0x325d('0x8')](),controller[_0x325d('0x9')]);router[_0x325d('0xa')](_0x325d('0xb'),auth[_0x325d('0x8')](),controller[_0x325d('0xc')]);router[_0x325d('0xd')]('/',auth[_0x325d('0x8')](),controller[_0x325d('0xe')]);router[_0x325d('0xf')](_0x325d('0xb'),auth['isAuthenticated'](),controller[_0x325d('0x10')]);router[_0x325d('0x11')](_0x325d('0xb'),auth[_0x325d('0x8')](),controller['destroy']);module[_0x325d('0x12')]=router;
\ No newline at end of file
+var _0x97dd=['get','index','/:id','show','post','isAuthenticated','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cloudProvider.controller'];(function(_0x58ee54,_0x4e92ec){var _0x4d89d0=function(_0x4ab5c1){while(--_0x4ab5c1){_0x58ee54['push'](_0x58ee54['shift']());}};_0x4d89d0(++_0x4e92ec);}(_0x97dd,0xef));var _0xd97d=function(_0x2c98af,_0x3f5a43){_0x2c98af=_0x2c98af-0x0;var _0x372dba=_0x97dd[_0x2c98af];return _0x372dba;};'use strict';var multer=require(_0xd97d('0x0'));var util=require(_0xd97d('0x1'));var path=require('path');var timeout=require(_0xd97d('0x2'));var express=require(_0xd97d('0x3'));var router=express[_0xd97d('0x4')]();var fs_extra=require(_0xd97d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd97d('0x6'));var config=require('../../config/environment');var controller=require(_0xd97d('0x7'));router[_0xd97d('0x8')]('/',auth['isAuthenticated'](),controller[_0xd97d('0x9')]);router[_0xd97d('0x8')](_0xd97d('0xa'),auth['isAuthenticated'](),controller[_0xd97d('0xb')]);router[_0xd97d('0xc')]('/',auth[_0xd97d('0xd')](),controller['create']);router[_0xd97d('0xe')](_0xd97d('0xa'),auth[_0xd97d('0xd')](),controller[_0xd97d('0xf')]);router[_0xd97d('0x10')]('/:id',auth[_0xd97d('0xd')](),controller[_0xd97d('0x11')]);module[_0xd97d('0x12')]=router;
\ No newline at end of file
index d185e85..a8d1e96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a21=['exports','name','STRING'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x0a21,0x9f));var _0x10a2=function(_0x56fc55,_0x1cd50e){_0x56fc55=_0x56fc55-0x0;var _0x2de620=_0x0a21[_0x56fc55];return _0x2de620;};'use strict';var Sequelize=require('sequelize');module[_0x10a2('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x10a2('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x10a2('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x10a2('0x2')]},'phone':{'type':Sequelize[_0x10a2('0x2')]},'fax':{'type':Sequelize[_0x10a2('0x2')]},'type':{'type':Sequelize[_0x10a2('0x2')]},'street':{'type':Sequelize[_0x10a2('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x10a2('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x10a2('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x10a2('0x2')]},'sPostalCode':{'type':Sequelize[_0x10a2('0x2')]},'sCity':{'type':Sequelize[_0x10a2('0x2')]},'sCountry':{'type':Sequelize[_0x10a2('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc7b1=['STRING','sequelize','name'];(function(_0x1f4b18,_0x4e777c){var _0xde3957=function(_0x1dcbbc){while(--_0x1dcbbc){_0x1f4b18['push'](_0x1f4b18['shift']());}};_0xde3957(++_0x4e777c);}(_0xc7b1,0xe5));var _0x1c7b=function(_0x2300f2,_0x315c5f){_0x2300f2=_0x2300f2-0x0;var _0x6bd508=_0xc7b1[_0x2300f2];return _0x6bd508;};'use strict';var Sequelize=require(_0x1c7b('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x1c7b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1c7b('0x2')]},'companyId':{'type':Sequelize[_0x1c7b('0x2')]},'website':{'type':Sequelize[_0x1c7b('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1c7b('0x2')]},'type':{'type':Sequelize[_0x1c7b('0x2')]},'street':{'type':Sequelize[_0x1c7b('0x2')]},'postalCode':{'type':Sequelize[_0x1c7b('0x2')]},'city':{'type':Sequelize[_0x1c7b('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x1c7b('0x2')]},'sStreet':{'type':Sequelize[_0x1c7b('0x2')]},'sPostalCode':{'type':Sequelize[_0x1c7b('0x2')]},'sCity':{'type':Sequelize[_0x1c7b('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1c7b('0x2')]}};
\ No newline at end of file
index b97b6d5..6ca7c1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20ba=['ejs','fs-extra','lodash','squel','jsforce','papaparse','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','describe','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','CmCompany','include','findAll','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Companies','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','findOne','rawAttributes','map','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x57a483,_0x92e96c){var _0x35f7ac=function(_0x3a7d39){while(--_0x3a7d39){_0x57a483['push'](_0x57a483['shift']());}};_0x35f7ac(++_0x92e96c);}(_0x20ba,0x1e6));var _0xa20b=function(_0x440917,_0x20ea7b){_0x440917=_0x440917-0x0;var _0x5e906b=_0x20ba[_0x440917];return _0x5e906b;};'use strict';var emlformat=require(_0xa20b('0x0'));var rimraf=require(_0xa20b('0x1'));var zipdir=require(_0xa20b('0x2'));var jsonpatch=require(_0xa20b('0x3'));var rp=require(_0xa20b('0x4'));var moment=require(_0xa20b('0x5'));var BPromise=require(_0xa20b('0x6'));var Mustache=require(_0xa20b('0x7'));var util=require(_0xa20b('0x8'));var path=require(_0xa20b('0x9'));var sox=require(_0xa20b('0xa'));var csv=require(_0xa20b('0xb'));var ejs=require(_0xa20b('0xc'));var fs=require('fs');var fs_extra=require(_0xa20b('0xd'));var _=require(_0xa20b('0xe'));var squel=require(_0xa20b('0xf'));var crypto=require('crypto');var jsforce=require(_0xa20b('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa20b('0xb'));var querystring=require('querystring');var Papa=require(_0xa20b('0x11'));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(_0xa20b('0x12'))(_0xa20b('0x13'));var utils=require(_0xa20b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xa20b('0x15'));var db=require(_0xa20b('0x16'))['db'];function respondWithStatusCode(_0x5e200a,_0x4d9ef1){_0x4d9ef1=_0x4d9ef1||0xcc;return function(_0x338a70){if(_0x338a70){return _0x5e200a['sendStatus'](_0x4d9ef1);}return _0x5e200a[_0xa20b('0x17')](_0x4d9ef1)[_0xa20b('0x18')]();};}function respondWithResult(_0x1b445f,_0x230c62){_0x230c62=_0x230c62||0xc8;return function(_0x11ea21){if(_0x11ea21){return _0x1b445f[_0xa20b('0x17')](_0x230c62)[_0xa20b('0x19')](_0x11ea21);}};}function respondWithFilteredResult(_0x35c24c,_0x53860a){return function(_0x49e06c){if(_0x49e06c){var _0x5563e0=typeof _0x53860a[_0xa20b('0x1a')]===_0xa20b('0x1b')&&typeof _0x53860a[_0xa20b('0x1c')]===_0xa20b('0x1b');var _0x1f02e2=_0x49e06c[_0xa20b('0x1d')];var _0x32920c=_0x5563e0?0x0:_0x53860a[_0xa20b('0x1a')];var _0x2eafb6=_0x5563e0?_0x49e06c[_0xa20b('0x1d')]:_0x53860a[_0xa20b('0x1a')]+_0x53860a[_0xa20b('0x1c')];var _0x54caab;if(_0x2eafb6>=_0x1f02e2){_0x2eafb6=_0x1f02e2;_0x54caab=0xc8;}else{_0x54caab=0xce;}_0x35c24c[_0xa20b('0x17')](_0x54caab);return _0x35c24c[_0xa20b('0x1e')](_0xa20b('0x1f'),_0x32920c+'-'+_0x2eafb6+'/'+_0x1f02e2)[_0xa20b('0x19')](_0x49e06c);}return null;};}function patchUpdates(_0x1bc992){return function(_0x5bccf9){try{jsonpatch[_0xa20b('0x20')](_0x5bccf9,_0x1bc992,!![]);}catch(_0x17fbdd){return BPromise[_0xa20b('0x21')](_0x17fbdd);}return _0x5bccf9[_0xa20b('0x22')]();};}function saveUpdates(_0x46f77d,_0x3503a5){return function(_0x3641a3){if(_0x3641a3){return _0x3641a3[_0xa20b('0x23')](_0x46f77d)[_0xa20b('0x24')](function(_0x441fe6){return _0x441fe6;});}return null;};}function removeEntity(_0x312e45,_0x5ada15){return function(_0x474bec){if(_0x474bec){return _0x474bec[_0xa20b('0x25')]()[_0xa20b('0x24')](function(){var _0x459f23=_0x474bec['get']({'plain':!![]});var _0x2a24fc='Companies';return db['UserProfileResource'][_0xa20b('0x25')]({'where':{'type':_0x2a24fc,'resourceId':_0x459f23['id']}})[_0xa20b('0x24')](function(){return _0x474bec;});})[_0xa20b('0x24')](function(){_0x312e45[_0xa20b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35bc2b,_0xd5af6c){return function(_0x4b7497){if(!_0x4b7497){_0x35bc2b[_0xa20b('0x26')](0x194);}return _0x4b7497;};}function handleError(_0x657e5c,_0x27e752){_0x27e752=_0x27e752||0x1f4;return function(_0x2e3bff){logger['error'](_0x2e3bff[_0xa20b('0x27')]);if(_0x2e3bff[_0xa20b('0x28')]){delete _0x2e3bff[_0xa20b('0x28')];}_0x657e5c['status'](_0x27e752)['send'](_0x2e3bff);};}exports['index']=function(_0x178993,_0x3bb3a6){var _0x4a8f48={},_0x499865={},_0xc910f1={'count':0x0,'rows':[]};return db['CmCompany'][_0xa20b('0x29')]()[_0xa20b('0x24')](function(_0x5552f0){_0x499865[_0xa20b('0x2a')]=_[_0xa20b('0x2b')](_0x5552f0);_0x499865[_0xa20b('0x2c')]=_[_0xa20b('0x2b')](_0x178993[_0xa20b('0x2c')]);_0x499865[_0xa20b('0x2d')]=_['intersection'](_0x499865[_0xa20b('0x2a')],_0x499865[_0xa20b('0x2c')]);_0x4a8f48[_0xa20b('0x2e')]=_[_0xa20b('0x2f')](_0x499865[_0xa20b('0x2a')],qs['fields'](_0x178993[_0xa20b('0x2c')][_0xa20b('0x30')]));_0x4a8f48[_0xa20b('0x2e')]=_0x4a8f48[_0xa20b('0x2e')][_0xa20b('0x31')]?_0x4a8f48[_0xa20b('0x2e')]:_0x499865[_0xa20b('0x2a')];if(!_0x178993[_0xa20b('0x2c')][_0xa20b('0x32')]('nolimit')){_0x4a8f48['limit']=qs[_0xa20b('0x1c')](_0x178993[_0xa20b('0x2c')]['limit']);_0x4a8f48[_0xa20b('0x1a')]=qs[_0xa20b('0x1a')](_0x178993['query'][_0xa20b('0x1a')]);}_0x4a8f48[_0xa20b('0x33')]=qs[_0xa20b('0x34')](_0x178993[_0xa20b('0x2c')][_0xa20b('0x34')]);_0x4a8f48['where']=qs[_0xa20b('0x2d')](_[_0xa20b('0x35')](_0x178993[_0xa20b('0x2c')],_0x499865['filters']),_0x5552f0);if(_0x178993['query'][_0xa20b('0x36')]){_0x4a8f48[_0xa20b('0x37')]=_[_0xa20b('0x38')](_0x4a8f48[_0xa20b('0x37')],{'$or':_['map'](_0x4a8f48['attributes'],function(_0x519c33){var _0x179225={};_0x179225[_0x519c33]={'$like':'%'+_0x178993['query']['filter']+'%'};return _0x179225;})});}_0x4a8f48=_[_0xa20b('0x38')]({},_0x4a8f48,_0x178993[_0xa20b('0x39')]);var _0x524e46={'where':_0x4a8f48[_0xa20b('0x37')]};return db[_0xa20b('0x3a')][_0xa20b('0x1d')](_0x524e46)[_0xa20b('0x24')](function(_0xa9b8f3){_0xc910f1[_0xa20b('0x1d')]=_0xa9b8f3;if(_0x178993[_0xa20b('0x2c')]['includeAll']){_0x4a8f48[_0xa20b('0x3b')]=[{'all':!![]}];}return db[_0xa20b('0x3a')][_0xa20b('0x3c')](_0x4a8f48);})[_0xa20b('0x24')](function(_0x1b21aa){_0xc910f1['rows']=_0x1b21aa;return _0xc910f1;})[_0xa20b('0x24')](respondWithFilteredResult(_0x3bb3a6,_0x4a8f48))[_0xa20b('0x3d')](handleError(_0x3bb3a6,null));})[_0xa20b('0x3d')](handleError(_0x3bb3a6,null));};exports['show']=function(_0x2b11d7,_0x3efb5f){var _0x3b4ea5={'raw':![],'where':{'id':_0x2b11d7[_0xa20b('0x3e')]['id']}},_0x4e402b={};_0x4e402b[_0xa20b('0x2a')]=_[_0xa20b('0x2b')](db[_0xa20b('0x3a')]['rawAttributes']);_0x4e402b[_0xa20b('0x2c')]=_['keys'](_0x2b11d7[_0xa20b('0x2c')]);_0x4e402b['filters']=_['intersection'](_0x4e402b[_0xa20b('0x2a')],_0x4e402b[_0xa20b('0x2c')]);_0x3b4ea5[_0xa20b('0x2e')]=_['intersection'](_0x4e402b[_0xa20b('0x2a')],qs[_0xa20b('0x30')](_0x2b11d7[_0xa20b('0x2c')][_0xa20b('0x30')]));_0x3b4ea5['attributes']=_0x3b4ea5['attributes'][_0xa20b('0x31')]?_0x3b4ea5[_0xa20b('0x2e')]:_0x4e402b[_0xa20b('0x2a')];if(_0x2b11d7[_0xa20b('0x2c')]['includeAll']){_0x3b4ea5['include']=[{'all':!![]}];}_0x3b4ea5=_[_0xa20b('0x38')]({},_0x3b4ea5,_0x2b11d7['options']);return db[_0xa20b('0x3a')]['find'](_0x3b4ea5)['then'](handleEntityNotFound(_0x3efb5f,null))[_0xa20b('0x24')](respondWithResult(_0x3efb5f,null))[_0xa20b('0x3d')](handleError(_0x3efb5f,null));};exports[_0xa20b('0x3f')]=function(_0x37ac35,_0x253c62){return db['CmCompany'][_0xa20b('0x3f')](_0x37ac35[_0xa20b('0x40')],{})[_0xa20b('0x24')](function(_0x318956){var _0x30d98d=_0x37ac35[_0xa20b('0x41')]['get']({'plain':!![]});if(!_0x30d98d)throw new Error(_0xa20b('0x42'));if(_0x30d98d[_0xa20b('0x43')]===_0xa20b('0x41')){var _0x6826b5=_0x318956[_0xa20b('0x44')]({'plain':!![]});var _0x516cc9=_0xa20b('0x45');return db['UserProfileSection'][_0xa20b('0x46')]({'where':{'name':_0x516cc9,'userProfileId':_0x30d98d['userProfileId']},'raw':!![]})[_0xa20b('0x24')](function(_0x2365e4){if(_0x2365e4&&_0x2365e4[_0xa20b('0x47')]===0x0){return db[_0xa20b('0x48')][_0xa20b('0x3f')]({'name':_0x6826b5['name'],'resourceId':_0x6826b5['id'],'type':_0x2365e4[_0xa20b('0x28')],'sectionId':_0x2365e4['id']},{})[_0xa20b('0x24')](function(){return _0x318956;});}else{return _0x318956;}})['catch'](function(_0x2cb49a){logger[_0xa20b('0x49')](_0xa20b('0x4a'),_0x2cb49a);throw _0x2cb49a;});}return _0x318956;})['then'](respondWithResult(_0x253c62,0xc9))['catch'](handleError(_0x253c62,null));};exports['update']=function(_0x2f16cf,_0x5961eb){if(_0x2f16cf[_0xa20b('0x40')]['id']){delete _0x2f16cf['body']['id'];}return db[_0xa20b('0x3a')][_0xa20b('0x46')]({'where':{'id':_0x2f16cf[_0xa20b('0x3e')]['id']}})[_0xa20b('0x24')](handleEntityNotFound(_0x5961eb,null))[_0xa20b('0x24')](saveUpdates(_0x2f16cf['body'],null))[_0xa20b('0x24')](respondWithResult(_0x5961eb,null))['catch'](handleError(_0x5961eb,null));};exports[_0xa20b('0x25')]=function(_0x56f0ed,_0x477d60){return db[_0xa20b('0x3a')][_0xa20b('0x46')]({'where':{'id':_0x56f0ed[_0xa20b('0x3e')]['id']}})['then'](handleEntityNotFound(_0x477d60,null))[_0xa20b('0x24')](removeEntity(_0x477d60,null))['catch'](handleError(_0x477d60,null));};exports[_0xa20b('0x29')]=function(_0x1ae9f8,_0x1c065c){return db[_0xa20b('0x3a')][_0xa20b('0x29')]()[_0xa20b('0x24')](respondWithResult(_0x1c065c,null))[_0xa20b('0x3d')](handleError(_0x1c065c,null));};exports[_0xa20b('0x4b')]=function(_0x62c92d,_0xc91c8b,_0x355bc6){return db[_0xa20b('0x4c')][_0xa20b('0x46')]({'where':{'id':_0x62c92d[_0xa20b('0x3e')]['id']}})['then'](handleEntityNotFound(_0xc91c8b,null))[_0xa20b('0x24')](function(_0x41f6bc){if(_0x41f6bc){return _0x41f6bc[_0xa20b('0x4b')](_0x62c92d[_0xa20b('0x40')][_0xa20b('0x4d')],_['omit'](_0x62c92d[_0xa20b('0x40')],[_0xa20b('0x4d'),'id'])||{});}})[_0xa20b('0x24')](respondWithResult(_0xc91c8b,null))[_0xa20b('0x3d')](handleError(_0xc91c8b,null));};exports[_0xa20b('0x4e')]=function(_0x46a908,_0xa5340f,_0x31db5e){var _0x4915e5={};var _0x278903={};var _0x22d8e7;var _0x216f27;return db[_0xa20b('0x3a')][_0xa20b('0x4f')]({'where':{'id':_0x46a908[_0xa20b('0x3e')]['id']}})[_0xa20b('0x24')](handleEntityNotFound(_0xa5340f,null))[_0xa20b('0x24')](function(_0x476954){if(_0x476954){_0x22d8e7=_0x476954;_0x278903[_0xa20b('0x2a')]=_[_0xa20b('0x2b')](db[_0xa20b('0x4c')][_0xa20b('0x50')]);_0x278903[_0xa20b('0x2c')]=_[_0xa20b('0x2b')](_0x46a908[_0xa20b('0x2c')]);_0x278903['filters']=_['intersection'](_0x278903['model'],_0x278903[_0xa20b('0x2c')]);_0x4915e5[_0xa20b('0x2e')]=_[_0xa20b('0x2f')](_0x278903[_0xa20b('0x2a')],qs['fields'](_0x46a908[_0xa20b('0x2c')][_0xa20b('0x30')]));_0x4915e5[_0xa20b('0x2e')]=_0x4915e5['attributes']['length']?_0x4915e5[_0xa20b('0x2e')]:_0x278903[_0xa20b('0x2a')];_0x4915e5[_0xa20b('0x33')]=qs[_0xa20b('0x34')](_0x46a908[_0xa20b('0x2c')][_0xa20b('0x34')]);_0x4915e5['where']=qs[_0xa20b('0x2d')](_[_0xa20b('0x35')](_0x46a908[_0xa20b('0x2c')],_0x278903[_0xa20b('0x2d')]));if(_0x46a908[_0xa20b('0x2c')][_0xa20b('0x36')]){_0x4915e5['where']=_[_0xa20b('0x38')](_0x4915e5[_0xa20b('0x37')],{'$or':_[_0xa20b('0x51')](_0x4915e5[_0xa20b('0x2e')],function(_0x595689){var _0x3a5a50={};_0x3a5a50[_0x595689]={'$like':'%'+_0x46a908[_0xa20b('0x2c')]['filter']+'%'};return _0x3a5a50;})});}_0x4915e5=_['merge']({},_0x4915e5,_0x46a908[_0xa20b('0x39')]);return _0x22d8e7['getContacts'](_0x4915e5);}})['then'](function(_0x5b21e4){if(_0x5b21e4){_0x216f27=_0x5b21e4[_0xa20b('0x31')];if(!_0x46a908[_0xa20b('0x2c')]['hasOwnProperty'](_0xa20b('0x52'))){_0x4915e5[_0xa20b('0x1c')]=qs[_0xa20b('0x1c')](_0x46a908[_0xa20b('0x2c')][_0xa20b('0x1c')]);_0x4915e5[_0xa20b('0x1a')]=qs['offset'](_0x46a908['query'][_0xa20b('0x1a')]);}return _0x22d8e7[_0xa20b('0x4e')](_0x4915e5);}})[_0xa20b('0x24')](function(_0x3c5e04){if(_0x3c5e04){return _0x3c5e04?{'count':_0x216f27,'rows':_0x3c5e04}:null;}})[_0xa20b('0x24')](respondWithResult(_0xa5340f,null))['catch'](handleError(_0xa5340f,null));};
\ No newline at end of file
+var _0xe2de=['update','then','destroy','get','UserProfileResource','end','error','stack','name','index','CmCompany','describe','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','merge','options','rows','catch','show','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','addContacts','CmContact','omit','getContacts','findOne','rawAttributes','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3acee8,_0x5f3924){var _0x5046cc=function(_0x338def){while(--_0x338def){_0x3acee8['push'](_0x3acee8['shift']());}};_0x5046cc(++_0x5f3924);}(_0xe2de,0x132));var _0xee2d=function(_0x5cc1ed,_0x6a43c1){_0x5cc1ed=_0x5cc1ed-0x0;var _0x3c6695=_0xe2de[_0x5cc1ed];return _0x3c6695;};'use strict';var emlformat=require(_0xee2d('0x0'));var rimraf=require(_0xee2d('0x1'));var zipdir=require(_0xee2d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xee2d('0x3'));var Mustache=require(_0xee2d('0x4'));var util=require(_0xee2d('0x5'));var path=require(_0xee2d('0x6'));var sox=require(_0xee2d('0x7'));var csv=require(_0xee2d('0x8'));var ejs=require(_0xee2d('0x9'));var fs=require('fs');var fs_extra=require(_0xee2d('0xa'));var _=require(_0xee2d('0xb'));var squel=require(_0xee2d('0xc'));var crypto=require(_0xee2d('0xd'));var jsforce=require(_0xee2d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xee2d('0x8'));var querystring=require('querystring');var Papa=require(_0xee2d('0xf'));var Redis=require('ioredis');var authService=require(_0xee2d('0x10'));var qs=require(_0xee2d('0x11'));var as=require(_0xee2d('0x12'));var hardwareService=require(_0xee2d('0x13'));var logger=require(_0xee2d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xee2d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x839df4,_0x2d53f9){_0x2d53f9=_0x2d53f9||0xcc;return function(_0x5e2a30){if(_0x5e2a30){return _0x839df4[_0xee2d('0x16')](_0x2d53f9);}return _0x839df4[_0xee2d('0x17')](_0x2d53f9)['end']();};}function respondWithResult(_0x231a3b,_0x340f35){_0x340f35=_0x340f35||0xc8;return function(_0x72f5e2){if(_0x72f5e2){return _0x231a3b[_0xee2d('0x17')](_0x340f35)[_0xee2d('0x18')](_0x72f5e2);}};}function respondWithFilteredResult(_0x3d8371,_0x46fb8f){return function(_0x4a237e){if(_0x4a237e){var _0x226f81=typeof _0x46fb8f[_0xee2d('0x19')]===_0xee2d('0x1a')&&typeof _0x46fb8f[_0xee2d('0x1b')]==='undefined';var _0x4519ec=_0x4a237e['count'];var _0x2b94ad=_0x226f81?0x0:_0x46fb8f[_0xee2d('0x19')];var _0x1e9bba=_0x226f81?_0x4a237e[_0xee2d('0x1c')]:_0x46fb8f[_0xee2d('0x19')]+_0x46fb8f[_0xee2d('0x1b')];var _0x2bfbf7;if(_0x1e9bba>=_0x4519ec){_0x1e9bba=_0x4519ec;_0x2bfbf7=0xc8;}else{_0x2bfbf7=0xce;}_0x3d8371[_0xee2d('0x17')](_0x2bfbf7);return _0x3d8371[_0xee2d('0x1d')](_0xee2d('0x1e'),_0x2b94ad+'-'+_0x1e9bba+'/'+_0x4519ec)[_0xee2d('0x18')](_0x4a237e);}return null;};}function patchUpdates(_0x5493f5){return function(_0x2a93c6){try{jsonpatch[_0xee2d('0x1f')](_0x2a93c6,_0x5493f5,!![]);}catch(_0x5beaed){return BPromise[_0xee2d('0x20')](_0x5beaed);}return _0x2a93c6[_0xee2d('0x21')]();};}function saveUpdates(_0x51ed04,_0x3bf523){return function(_0x20c8be){if(_0x20c8be){return _0x20c8be[_0xee2d('0x22')](_0x51ed04)[_0xee2d('0x23')](function(_0x36df42){return _0x36df42;});}return null;};}function removeEntity(_0x28ef76,_0x17712c){return function(_0x2eda40){if(_0x2eda40){return _0x2eda40[_0xee2d('0x24')]()[_0xee2d('0x23')](function(){var _0x334e20=_0x2eda40[_0xee2d('0x25')]({'plain':!![]});var _0x1a66da='Companies';return db[_0xee2d('0x26')][_0xee2d('0x24')]({'where':{'type':_0x1a66da,'resourceId':_0x334e20['id']}})[_0xee2d('0x23')](function(){return _0x2eda40;});})[_0xee2d('0x23')](function(){_0x28ef76[_0xee2d('0x17')](0xcc)[_0xee2d('0x27')]();});}};}function handleEntityNotFound(_0xf8787f,_0x1b87fb){return function(_0x2bf33b){if(!_0x2bf33b){_0xf8787f[_0xee2d('0x16')](0x194);}return _0x2bf33b;};}function handleError(_0x27082a,_0x2a6983){_0x2a6983=_0x2a6983||0x1f4;return function(_0x9a9f46){logger[_0xee2d('0x28')](_0x9a9f46[_0xee2d('0x29')]);if(_0x9a9f46[_0xee2d('0x2a')]){delete _0x9a9f46[_0xee2d('0x2a')];}_0x27082a[_0xee2d('0x17')](_0x2a6983)['send'](_0x9a9f46);};}exports[_0xee2d('0x2b')]=function(_0x23d9bd,_0x39cca0){var _0x252a1a={},_0x65dbb8={},_0x374498={'count':0x0,'rows':[]};return db[_0xee2d('0x2c')][_0xee2d('0x2d')]()[_0xee2d('0x23')](function(_0xa7979f){_0x65dbb8[_0xee2d('0x2e')]=_[_0xee2d('0x2f')](_0xa7979f);_0x65dbb8[_0xee2d('0x30')]=_[_0xee2d('0x2f')](_0x23d9bd[_0xee2d('0x30')]);_0x65dbb8['filters']=_['intersection'](_0x65dbb8[_0xee2d('0x2e')],_0x65dbb8[_0xee2d('0x30')]);_0x252a1a[_0xee2d('0x31')]=_[_0xee2d('0x32')](_0x65dbb8[_0xee2d('0x2e')],qs[_0xee2d('0x33')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x33')]));_0x252a1a[_0xee2d('0x31')]=_0x252a1a[_0xee2d('0x31')][_0xee2d('0x34')]?_0x252a1a['attributes']:_0x65dbb8[_0xee2d('0x2e')];if(!_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x35')](_0xee2d('0x36'))){_0x252a1a[_0xee2d('0x1b')]=qs[_0xee2d('0x1b')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x1b')]);_0x252a1a[_0xee2d('0x19')]=qs[_0xee2d('0x19')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x19')]);}_0x252a1a[_0xee2d('0x37')]=qs[_0xee2d('0x38')](_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x38')]);_0x252a1a['where']=qs[_0xee2d('0x39')](_[_0xee2d('0x3a')](_0x23d9bd[_0xee2d('0x30')],_0x65dbb8['filters']),_0xa7979f);if(_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x3b')]){_0x252a1a[_0xee2d('0x3c')]=_['merge'](_0x252a1a[_0xee2d('0x3c')],{'$or':_[_0xee2d('0x3d')](_0x252a1a[_0xee2d('0x31')],function(_0x16022f){var _0x679600={};_0x679600[_0x16022f]={'$like':'%'+_0x23d9bd[_0xee2d('0x30')][_0xee2d('0x3b')]+'%'};return _0x679600;})});}_0x252a1a=_[_0xee2d('0x3e')]({},_0x252a1a,_0x23d9bd[_0xee2d('0x3f')]);var _0x3896a2={'where':_0x252a1a[_0xee2d('0x3c')]};return db[_0xee2d('0x2c')][_0xee2d('0x1c')](_0x3896a2)[_0xee2d('0x23')](function(_0x65c7d0){_0x374498[_0xee2d('0x1c')]=_0x65c7d0;if(_0x23d9bd['query']['includeAll']){_0x252a1a['include']=[{'all':!![]}];}return db[_0xee2d('0x2c')]['findAll'](_0x252a1a);})['then'](function(_0x5db388){_0x374498[_0xee2d('0x40')]=_0x5db388;return _0x374498;})[_0xee2d('0x23')](respondWithFilteredResult(_0x39cca0,_0x252a1a))[_0xee2d('0x41')](handleError(_0x39cca0,null));})[_0xee2d('0x41')](handleError(_0x39cca0,null));};exports[_0xee2d('0x42')]=function(_0x2f8b27,_0x482f66){var _0x3d1438={'raw':![],'where':{'id':_0x2f8b27['params']['id']}},_0x1cb718={};_0x1cb718[_0xee2d('0x2e')]=_[_0xee2d('0x2f')](db['CmCompany']['rawAttributes']);_0x1cb718[_0xee2d('0x30')]=_[_0xee2d('0x2f')](_0x2f8b27['query']);_0x1cb718[_0xee2d('0x39')]=_[_0xee2d('0x32')](_0x1cb718[_0xee2d('0x2e')],_0x1cb718['query']);_0x3d1438[_0xee2d('0x31')]=_['intersection'](_0x1cb718[_0xee2d('0x2e')],qs[_0xee2d('0x33')](_0x2f8b27[_0xee2d('0x30')][_0xee2d('0x33')]));_0x3d1438[_0xee2d('0x31')]=_0x3d1438['attributes']['length']?_0x3d1438['attributes']:_0x1cb718[_0xee2d('0x2e')];if(_0x2f8b27[_0xee2d('0x30')][_0xee2d('0x43')]){_0x3d1438[_0xee2d('0x44')]=[{'all':!![]}];}_0x3d1438=_['merge']({},_0x3d1438,_0x2f8b27[_0xee2d('0x3f')]);return db['CmCompany'][_0xee2d('0x45')](_0x3d1438)[_0xee2d('0x23')](handleEntityNotFound(_0x482f66,null))[_0xee2d('0x23')](respondWithResult(_0x482f66,null))['catch'](handleError(_0x482f66,null));};exports[_0xee2d('0x46')]=function(_0xed71a7,_0x31ee29){return db[_0xee2d('0x2c')][_0xee2d('0x46')](_0xed71a7['body'],{})[_0xee2d('0x23')](function(_0x434c7e){var _0x52e65c=_0xed71a7[_0xee2d('0x47')]['get']({'plain':!![]});if(!_0x52e65c)throw new Error(_0xee2d('0x48'));if(_0x52e65c['role']===_0xee2d('0x47')){var _0x51dff8=_0x434c7e[_0xee2d('0x25')]({'plain':!![]});var _0x4b72f0='Companies';return db[_0xee2d('0x49')][_0xee2d('0x45')]({'where':{'name':_0x4b72f0,'userProfileId':_0x52e65c[_0xee2d('0x4a')]},'raw':!![]})[_0xee2d('0x23')](function(_0x3c3b29){if(_0x3c3b29&&_0x3c3b29[_0xee2d('0x4b')]===0x0){return db[_0xee2d('0x26')][_0xee2d('0x46')]({'name':_0x51dff8[_0xee2d('0x2a')],'resourceId':_0x51dff8['id'],'type':_0x3c3b29['name'],'sectionId':_0x3c3b29['id']},{})[_0xee2d('0x23')](function(){return _0x434c7e;});}else{return _0x434c7e;}})[_0xee2d('0x41')](function(_0x33b2bd){logger[_0xee2d('0x28')](_0xee2d('0x4c'),_0x33b2bd);throw _0x33b2bd;});}return _0x434c7e;})[_0xee2d('0x23')](respondWithResult(_0x31ee29,0xc9))['catch'](handleError(_0x31ee29,null));};exports['update']=function(_0x271df2,_0x427c30){if(_0x271df2[_0xee2d('0x4d')]['id']){delete _0x271df2['body']['id'];}return db['CmCompany'][_0xee2d('0x45')]({'where':{'id':_0x271df2['params']['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x427c30,null))[_0xee2d('0x23')](saveUpdates(_0x271df2[_0xee2d('0x4d')],null))[_0xee2d('0x23')](respondWithResult(_0x427c30,null))[_0xee2d('0x41')](handleError(_0x427c30,null));};exports[_0xee2d('0x24')]=function(_0x5c98eb,_0x3924ee){return db['CmCompany']['find']({'where':{'id':_0x5c98eb[_0xee2d('0x4e')]['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x3924ee,null))['then'](removeEntity(_0x3924ee,null))[_0xee2d('0x41')](handleError(_0x3924ee,null));};exports[_0xee2d('0x2d')]=function(_0x41d64f,_0x45b082){return db[_0xee2d('0x2c')][_0xee2d('0x2d')]()[_0xee2d('0x23')](respondWithResult(_0x45b082,null))[_0xee2d('0x41')](handleError(_0x45b082,null));};exports[_0xee2d('0x4f')]=function(_0x3e22b0,_0x3e8223,_0x22f930){return db[_0xee2d('0x50')][_0xee2d('0x45')]({'where':{'id':_0x3e22b0[_0xee2d('0x4e')]['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x3e8223,null))[_0xee2d('0x23')](function(_0x3e5d5d){if(_0x3e5d5d){return _0x3e5d5d[_0xee2d('0x4f')](_0x3e22b0[_0xee2d('0x4d')]['ids'],_[_0xee2d('0x51')](_0x3e22b0[_0xee2d('0x4d')],['ids','id'])||{});}})[_0xee2d('0x23')](respondWithResult(_0x3e8223,null))[_0xee2d('0x41')](handleError(_0x3e8223,null));};exports[_0xee2d('0x52')]=function(_0x10de76,_0x276e7e,_0x4dae13){var _0x46e094={};var _0x57f421={};var _0x4e1695;var _0x13b04c;return db[_0xee2d('0x2c')][_0xee2d('0x53')]({'where':{'id':_0x10de76[_0xee2d('0x4e')]['id']}})[_0xee2d('0x23')](handleEntityNotFound(_0x276e7e,null))[_0xee2d('0x23')](function(_0xee0e8d){if(_0xee0e8d){_0x4e1695=_0xee0e8d;_0x57f421[_0xee2d('0x2e')]=_['keys'](db['CmContact'][_0xee2d('0x54')]);_0x57f421[_0xee2d('0x30')]=_[_0xee2d('0x2f')](_0x10de76['query']);_0x57f421['filters']=_['intersection'](_0x57f421['model'],_0x57f421[_0xee2d('0x30')]);_0x46e094[_0xee2d('0x31')]=_['intersection'](_0x57f421[_0xee2d('0x2e')],qs[_0xee2d('0x33')](_0x10de76['query'][_0xee2d('0x33')]));_0x46e094[_0xee2d('0x31')]=_0x46e094[_0xee2d('0x31')][_0xee2d('0x34')]?_0x46e094['attributes']:_0x57f421[_0xee2d('0x2e')];_0x46e094[_0xee2d('0x37')]=qs[_0xee2d('0x38')](_0x10de76['query'][_0xee2d('0x38')]);_0x46e094[_0xee2d('0x3c')]=qs[_0xee2d('0x39')](_[_0xee2d('0x3a')](_0x10de76['query'],_0x57f421[_0xee2d('0x39')]));if(_0x10de76[_0xee2d('0x30')]['filter']){_0x46e094[_0xee2d('0x3c')]=_[_0xee2d('0x3e')](_0x46e094[_0xee2d('0x3c')],{'$or':_['map'](_0x46e094[_0xee2d('0x31')],function(_0x54b18e){var _0x1b7846={};_0x1b7846[_0x54b18e]={'$like':'%'+_0x10de76[_0xee2d('0x30')][_0xee2d('0x3b')]+'%'};return _0x1b7846;})});}_0x46e094=_[_0xee2d('0x3e')]({},_0x46e094,_0x10de76[_0xee2d('0x3f')]);return _0x4e1695[_0xee2d('0x52')](_0x46e094);}})['then'](function(_0xb3b0a3){if(_0xb3b0a3){_0x13b04c=_0xb3b0a3[_0xee2d('0x34')];if(!_0x10de76[_0xee2d('0x30')][_0xee2d('0x35')](_0xee2d('0x36'))){_0x46e094[_0xee2d('0x1b')]=qs[_0xee2d('0x1b')](_0x10de76['query'][_0xee2d('0x1b')]);_0x46e094[_0xee2d('0x19')]=qs['offset'](_0x10de76[_0xee2d('0x30')]['offset']);}return _0x4e1695['getContacts'](_0x46e094);}})[_0xee2d('0x23')](function(_0x2b9e87){if(_0x2b9e87){return _0x2b9e87?{'count':_0x13b04c,'rows':_0x2b9e87}:null;}})[_0xee2d('0x23')](respondWithResult(_0x276e7e,null))[_0xee2d('0x41')](handleError(_0x276e7e,null));};
\ No newline at end of file
index d21e16c..a50d625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5005=['path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x202eeb,_0x453857){var _0x24b967=function(_0x1f2f4f){while(--_0x1f2f4f){_0x202eeb['push'](_0x202eeb['shift']());}};_0x24b967(++_0x453857);}(_0x5005,0x149));var _0x5500=function(_0xd63e3a,_0x1bd6eb){_0xd63e3a=_0xd63e3a-0x0;var _0x19c178=_0x5005[_0xd63e3a];return _0x19c178;};'use strict';var _=require(_0x5500('0x0'));var util=require(_0x5500('0x1'));var logger=require(_0x5500('0x2'))(_0x5500('0x3'));var moment=require(_0x5500('0x4'));var BPromise=require(_0x5500('0x5'));var rp=require(_0x5500('0x6'));var fs=require('fs');var path=require(_0x5500('0x7'));var rimraf=require(_0x5500('0x8'));var config=require(_0x5500('0x9'));var attributes=require(_0x5500('0xa'));module[_0x5500('0xb')]=function(_0x5eaca7,_0x31231e){return _0x5eaca7[_0x5500('0xc')]('CmCompany',attributes,{'tableName':_0x5500('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6349=['./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x17499b,_0x1b2ffd){var _0x5d2b45=function(_0x55f4e2){while(--_0x55f4e2){_0x17499b['push'](_0x17499b['shift']());}};_0x5d2b45(++_0x1b2ffd);}(_0x6349,0x101));var _0x9634=function(_0x1a4a85,_0x2af844){_0x1a4a85=_0x1a4a85-0x0;var _0x185e02=_0x6349[_0x1a4a85];return _0x185e02;};'use strict';var _=require('lodash');var util=require(_0x9634('0x0'));var logger=require(_0x9634('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9634('0x2'));var rp=require(_0x9634('0x3'));var fs=require('fs');var path=require(_0x9634('0x4'));var rimraf=require(_0x9634('0x5'));var config=require(_0x9634('0x6'));var attributes=require(_0x9634('0x7'));module[_0x9634('0x8')]=function(_0x43a8a0,_0x57a3b3){return _0x43a8a0[_0x9634('0x9')](_0x9634('0xa'),attributes,{'tableName':_0x9634('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dce421e..a2379c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0327=['CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','util','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','then','CmCompany,\x20%s,\x20%s','debug'];(function(_0x52442b,_0x5356c3){var _0xd96937=function(_0x4e3ebe){while(--_0x4e3ebe){_0x52442b['push'](_0x52442b['shift']());}};_0xd96937(++_0x5356c3);}(_0x0327,0x76));var _0x7032=function(_0x1f703a,_0x3031b7){_0x1f703a=_0x1f703a-0x0;var _0xd7b7e1=_0x0327[_0x1f703a];return _0xd7b7e1;};'use strict';var _=require('lodash');var util=require(_0x7032('0x0'));var moment=require(_0x7032('0x1'));var BPromise=require('bluebird');var rs=require(_0x7032('0x2'));var fs=require('fs');var Redis=require(_0x7032('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7032('0x4'))('rpc');var config=require(_0x7032('0x5'));var jayson=require(_0x7032('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d91b7,_0x2ce411,_0x24c2de){return new BPromise(function(_0xcc8f2f,_0x246cff){return client['request'](_0x4d91b7,_0x24c2de)[_0x7032('0x7')](function(_0x3579ac){logger['info'](_0x7032('0x8'),_0x2ce411,'request\x20sent');logger[_0x7032('0x9')](_0x7032('0xa'),_0x2ce411,_0x7032('0xb'),JSON['stringify'](_0x3579ac));if(_0x3579ac['error']){if(_0x3579ac[_0x7032('0xc')][_0x7032('0xd')]===0x1f4){logger['error'](_0x7032('0x8'),_0x2ce411,_0x3579ac['error']['message']);return _0x246cff(_0x3579ac[_0x7032('0xc')][_0x7032('0xe')]);}logger[_0x7032('0xc')](_0x7032('0x8'),_0x2ce411,_0x3579ac[_0x7032('0xc')]['message']);return _0xcc8f2f(_0x3579ac['error'][_0x7032('0xe')]);}else{logger['info'](_0x7032('0x8'),_0x2ce411,_0x7032('0xb'));_0xcc8f2f(_0x3579ac[_0x7032('0xf')]['message']);}})['catch'](function(_0x320714){logger[_0x7032('0xc')]('CmCompany,\x20%s,\x20%s',_0x2ce411,_0x320714);_0x246cff(_0x320714);});});}
\ No newline at end of file
+var _0x1fb0=['request\x20sent','debug','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmCompany,\x20%s,\x20%s'];(function(_0x3c4dad,_0x25ffd5){var _0x1a4f49=function(_0x6fe6c){while(--_0x6fe6c){_0x3c4dad['push'](_0x3c4dad['shift']());}};_0x1a4f49(++_0x25ffd5);}(_0x1fb0,0x15b));var _0x01fb=function(_0x47a5f8,_0x1b4545){_0x47a5f8=_0x47a5f8-0x0;var _0x554bbf=_0x1fb0[_0x47a5f8];return _0x554bbf;};'use strict';var _=require('lodash');var util=require(_0x01fb('0x0'));var moment=require(_0x01fb('0x1'));var BPromise=require('bluebird');var rs=require(_0x01fb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01fb('0x3'))['db'];var utils=require(_0x01fb('0x4'));var logger=require(_0x01fb('0x5'))(_0x01fb('0x6'));var config=require(_0x01fb('0x7'));var jayson=require(_0x01fb('0x8'));var client=jayson['client'][_0x01fb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ab1ce,_0x21c6cd,_0x492b2e){return new BPromise(function(_0x3d4d6c,_0x3eb8ba){return client[_0x01fb('0xa')](_0x4ab1ce,_0x492b2e)[_0x01fb('0xb')](function(_0x25b6e3){logger['info'](_0x01fb('0xc'),_0x21c6cd,_0x01fb('0xd'));logger[_0x01fb('0xe')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x21c6cd,_0x01fb('0xd'),JSON['stringify'](_0x25b6e3));if(_0x25b6e3[_0x01fb('0xf')]){if(_0x25b6e3['error'][_0x01fb('0x10')]===0x1f4){logger[_0x01fb('0xf')](_0x01fb('0xc'),_0x21c6cd,_0x25b6e3[_0x01fb('0xf')][_0x01fb('0x11')]);return _0x3eb8ba(_0x25b6e3['error'][_0x01fb('0x11')]);}logger['error'](_0x01fb('0xc'),_0x21c6cd,_0x25b6e3[_0x01fb('0xf')][_0x01fb('0x11')]);return _0x3d4d6c(_0x25b6e3[_0x01fb('0xf')][_0x01fb('0x11')]);}else{logger['info'](_0x01fb('0xc'),_0x21c6cd,_0x01fb('0xd'));_0x3d4d6c(_0x25b6e3[_0x01fb('0x12')]['message']);}})[_0x01fb('0x13')](function(_0x5c7218){logger['error'](_0x01fb('0xc'),_0x21c6cd,_0x5c7218);_0x3eb8ba(_0x5c7218);});});}
\ No newline at end of file
index bf33166..0b90850 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4adc=['connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','describe','get','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','path'];(function(_0x2dc4be,_0x3dbc7e){var _0x2ce4fe=function(_0x3a7744){while(--_0x3a7744){_0x2dc4be['push'](_0x2dc4be['shift']());}};_0x2ce4fe(++_0x3dbc7e);}(_0x4adc,0x14e));var _0xc4ad=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x4adc[_0x50a0c2];return _0x5ebadd;};'use strict';var multer=require(_0xc4ad('0x0'));var util=require('util');var path=require(_0xc4ad('0x1'));var timeout=require(_0xc4ad('0x2'));var express=require('express');var router=express[_0xc4ad('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc4ad('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc4ad('0x5'));var controller=require('./cmCompany.controller');router['get']('/',auth[_0xc4ad('0x6')](),controller[_0xc4ad('0x7')]);router['get']('/describe',auth[_0xc4ad('0x6')](),controller[_0xc4ad('0x8')]);router[_0xc4ad('0x9')](_0xc4ad('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xc4ad('0x9')](_0xc4ad('0xb'),auth[_0xc4ad('0x6')](),controller[_0xc4ad('0xc')]);router[_0xc4ad('0xd')]('/',auth[_0xc4ad('0x6')](),controller[_0xc4ad('0xe')]);router[_0xc4ad('0xd')](_0xc4ad('0xb'),auth['isAuthenticated'](),controller[_0xc4ad('0xf')]);router[_0xc4ad('0x10')]('/:id',auth[_0xc4ad('0x6')](),controller[_0xc4ad('0x11')]);router[_0xc4ad('0x12')](_0xc4ad('0xa'),auth['isAuthenticated'](),controller[_0xc4ad('0x13')]);module[_0xc4ad('0x14')]=router;
\ No newline at end of file
+var _0x8b0a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','destroy','exports','multer','util','path','express'];(function(_0x585b20,_0xed7dd){var _0x43aaa0=function(_0xf54695){while(--_0xf54695){_0x585b20['push'](_0x585b20['shift']());}};_0x43aaa0(++_0xed7dd);}(_0x8b0a,0xac));var _0xa8b0=function(_0x2acd35,_0x2b21df){_0x2acd35=_0x2acd35-0x0;var _0x272693=_0x8b0a[_0x2acd35];return _0x272693;};'use strict';var multer=require(_0xa8b0('0x0'));var util=require(_0xa8b0('0x1'));var path=require(_0xa8b0('0x2'));var timeout=require('connect-timeout');var express=require(_0xa8b0('0x3'));var router=express[_0xa8b0('0x4')]();var fs_extra=require(_0xa8b0('0x5'));var auth=require(_0xa8b0('0x6'));var interaction=require(_0xa8b0('0x7'));var config=require(_0xa8b0('0x8'));var controller=require(_0xa8b0('0x9'));router[_0xa8b0('0xa')]('/',auth[_0xa8b0('0xb')](),controller[_0xa8b0('0xc')]);router['get'](_0xa8b0('0xd'),auth[_0xa8b0('0xb')](),controller[_0xa8b0('0xe')]);router[_0xa8b0('0xa')](_0xa8b0('0xf'),auth[_0xa8b0('0xb')](),controller[_0xa8b0('0x10')]);router[_0xa8b0('0xa')](_0xa8b0('0x11'),auth[_0xa8b0('0xb')](),controller[_0xa8b0('0x12')]);router['post']('/',auth[_0xa8b0('0xb')](),controller['create']);router[_0xa8b0('0x13')](_0xa8b0('0x11'),auth['isAuthenticated'](),controller['addContacts']);router['put'](_0xa8b0('0xf'),auth[_0xa8b0('0xb')](),controller['update']);router['delete'](_0xa8b0('0xf'),auth['isAuthenticated'](),controller[_0xa8b0('0x14')]);module[_0xa8b0('0x15')]=router;
\ No newline at end of file
index 33328ae..801e0dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58c7=['lodash','exports','STRING','INTEGER','UNSIGNED','NOW'];(function(_0x50c5a9,_0x355ab2){var _0x24438d=function(_0xfebd8c){while(--_0xfebd8c){_0x50c5a9['push'](_0x50c5a9['shift']());}};_0x24438d(++_0x355ab2);}(_0x58c7,0xf0));var _0x758c=function(_0x36faf6,_0x3976b3){_0x36faf6=_0x36faf6-0x0;var _0x180e16=_0x58c7[_0x36faf6];return _0x180e16;};'use strict';var _=require(_0x758c('0x0'));var Sequelize=require('sequelize');module[_0x758c('0x1')]={'firstName':{'type':Sequelize[_0x758c('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x758c('0x2')]},'street':{'type':Sequelize[_0x758c('0x2')]},'postalCode':{'type':Sequelize[_0x758c('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x758c('0x2')]},'dateOfBirth':{'type':Sequelize[_0x758c('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x758c('0x2')]},'mobile':{'type':Sequelize[_0x758c('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x758c('0x2')]},'url':{'type':Sequelize[_0x758c('0x2')]},'facebook':{'type':Sequelize[_0x758c('0x2')]},'fb_data':{'type':Sequelize[_0x758c('0x2')]},'twitter':{'type':Sequelize[_0x758c('0x2')]},'skype':{'type':Sequelize[_0x758c('0x2')]},'teams':{'type':Sequelize[_0x758c('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x758c('0x2')]},'wechat':{'type':Sequelize[_0x758c('0x2')]},'telegram':{'type':Sequelize[_0x758c('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x758c('0x3')](0x2)[_0x758c('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x758c('0x5')]}};
\ No newline at end of file
+var _0x2c13=['STRING','TEXT','INTEGER','UNSIGNED','NOW','lodash','sequelize','exports'];(function(_0x19b2ff,_0x4e04c5){var _0x31bc90=function(_0x56e881){while(--_0x56e881){_0x19b2ff['push'](_0x19b2ff['shift']());}};_0x31bc90(++_0x4e04c5);}(_0x2c13,0x1cd));var _0x32c1=function(_0x1f7d8f,_0x43e1ed){_0x1f7d8f=_0x1f7d8f-0x0;var _0x41bd00=_0x2c13[_0x1f7d8f];return _0x41bd00;};'use strict';var _=require(_0x32c1('0x0'));var Sequelize=require(_0x32c1('0x1'));module[_0x32c1('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x32c1('0x3')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x32c1('0x3')]},'city':{'type':Sequelize[_0x32c1('0x3')]},'country':{'type':Sequelize[_0x32c1('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x32c1('0x4')]},'phone':{'type':Sequelize[_0x32c1('0x3')]},'mobile':{'type':Sequelize[_0x32c1('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x32c1('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x32c1('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x32c1('0x3')]},'viber':{'type':Sequelize[_0x32c1('0x3')]},'line':{'type':Sequelize[_0x32c1('0x3')]},'wechat':{'type':Sequelize[_0x32c1('0x3')]},'telegram':{'type':Sequelize[_0x32c1('0x3')]},'UserId':{'type':Sequelize[_0x32c1('0x5')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x32c1('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x32c1('0x7')]}};
\ No newline at end of file
index 5765ebf..2f9c78e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf81a=['order','sort','where','pick','select','field','color','from','tools_tags','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','sqlOperator','conditions','find','value','split','forEach','union','User','and','fieldType','datetime','castTo','DATE','buildExpression','text','start','map','filter','isNil','Contact','isEmpty','ListId','concat','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','clone','having','t.id\x20IN\x20?','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','merge','c.firstName','c.phone','c.mobile','c.ListId','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','destroy','params','describe','tags','startsWith','columnName','displayName','CmCustomField','findAll','alias','custom','body','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','update','ChatMessage','MailInteraction','MailMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','bulkCreate','each','duplicates','$or','spread','show','Tag','omit','cf_%d','$and','format','table','setFields','toParam','values','phone','rawAttributes','options','nolimit','getTags','setTags','ContactId','include','includeAll','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','upload','meta','import','binding','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','getJourney','mail','fax','voice','-createdAt','includes','channel','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','uniqueid','destination','callerid','endtime','duration','note','userDisposition','userSecondDisposition','UserId','DESC','createdAt','findAndCountAll','fullname','startCase','chat','Website','Account','closed','closedAt','thirdDisposition','key','Owner','browserName','customerIp','customerPort','osName','ratingType','referer','subject','substatus','openchannel','flatten','sortBy','reverse','slice','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./cmContact.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','apply','reject','save','then','error','stack','name','send','index','CmContact','keys','cf_','push','findOne','trimStart','all','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3b0988,_0x167e03){var _0x5bac55=function(_0x5b920f){while(--_0x5b920f){_0x3b0988['push'](_0x3b0988['shift']());}};_0x5bac55(++_0x167e03);}(_0xf81a,0xdb));var _0xaf81=function(_0xe1cf16,_0x2ada6b){_0xe1cf16=_0xe1cf16-0x0;var _0x1b6838=_0xf81a[_0xe1cf16];return _0x1b6838;};'use strict';var emlformat=require(_0xaf81('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaf81('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf81('0x2'));var moment=require(_0xaf81('0x3'));var BPromise=require(_0xaf81('0x4'));var Mustache=require(_0xaf81('0x5'));var util=require(_0xaf81('0x6'));var path=require(_0xaf81('0x7'));var sox=require(_0xaf81('0x8'));var csv=require(_0xaf81('0x9'));var ejs=require(_0xaf81('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xaf81('0xb'));var crypto=require('crypto');var jsforce=require(_0xaf81('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xaf81('0x9'));var querystring=require(_0xaf81('0xd'));var Papa=require(_0xaf81('0xe'));var Redis=require('ioredis');var authService=require(_0xaf81('0xf'));var qs=require(_0xaf81('0x10'));var as=require(_0xaf81('0x11'));var hardwareService=require(_0xaf81('0x12'));var logger=require('../../config/logger')(_0xaf81('0x13'));var utils=require(_0xaf81('0x14'));var config=require(_0xaf81('0x15'));var licenseUtil=require(_0xaf81('0x16'));var db=require('../../mysqldb')['db'];config[_0xaf81('0x17')]=_[_0xaf81('0x18')](config[_0xaf81('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xaf81('0x19'))(new Redis(config[_0xaf81('0x17')]));require(_0xaf81('0x1a'))[_0xaf81('0x1b')](socket);function respondWithStatusCode(_0x15f9a5,_0x219d95){_0x219d95=_0x219d95||0xcc;return function(_0x2a12ab){if(_0x2a12ab){return _0x15f9a5[_0xaf81('0x1c')](_0x219d95);}return _0x15f9a5['status'](_0x219d95)[_0xaf81('0x1d')]();};}function respondWithResult(_0x454ae6,_0x336aa3){_0x336aa3=_0x336aa3||0xc8;return function(_0x34de98){if(_0x34de98){return _0x454ae6[_0xaf81('0x1e')](_0x336aa3)[_0xaf81('0x1f')](_0x34de98);}};}function respondWithFilteredResult(_0x5af934,_0xb7d964){return function(_0x2e385f){if(_0x2e385f){var _0x29cff2=typeof _0xb7d964[_0xaf81('0x20')]==='undefined'&&typeof _0xb7d964[_0xaf81('0x21')]===_0xaf81('0x22');var _0x3aec0e=_0x2e385f[_0xaf81('0x23')];var _0x45309b=_0x29cff2?0x0:_0xb7d964[_0xaf81('0x20')];var _0x2c250d=_0x29cff2?_0x2e385f[_0xaf81('0x23')]:_0xb7d964[_0xaf81('0x20')]+_0xb7d964['limit'];var _0x506a99;if(_0x2c250d>=_0x3aec0e){_0x2c250d=_0x3aec0e;_0x506a99=0xc8;}else{_0x506a99=0xce;}_0x5af934[_0xaf81('0x1e')](_0x506a99);return _0x5af934['set']('Content-Range',_0x45309b+'-'+_0x2c250d+'/'+_0x3aec0e)[_0xaf81('0x1f')](_0x2e385f);}return null;};}function patchUpdates(_0x3cf20b){return function(_0x30494d){try{jsonpatch[_0xaf81('0x24')](_0x30494d,_0x3cf20b,!![]);}catch(_0x2af7d8){return BPromise[_0xaf81('0x25')](_0x2af7d8);}return _0x30494d[_0xaf81('0x26')]();};}function saveUpdates(_0x371c5a,_0x4f586a){return function(_0x205b60){if(_0x205b60){return _0x205b60['update'](_0x371c5a)[_0xaf81('0x27')](function(_0x33eca4){return _0x33eca4;});}return null;};}function removeEntity(_0x20df74,_0x1ab68c){return function(_0x1ba279){if(_0x1ba279){return _0x1ba279['destroy']()[_0xaf81('0x27')](function(){_0x20df74[_0xaf81('0x1e')](0xcc)[_0xaf81('0x1d')]();});}};}function handleEntityNotFound(_0x5b91e8,_0x1d8941){return function(_0x2d4678){if(!_0x2d4678){_0x5b91e8['sendStatus'](0x194);}return _0x2d4678;};}function handleError(_0x45d325,_0x2a63e5){_0x2a63e5=_0x2a63e5||0x1f4;return function(_0x131869){logger[_0xaf81('0x28')](_0x131869[_0xaf81('0x29')]);if(_0x131869[_0xaf81('0x2a')]){delete _0x131869[_0xaf81('0x2a')];}_0x45d325[_0xaf81('0x1e')](_0x2a63e5)[_0xaf81('0x2b')](_0x131869);};}exports[_0xaf81('0x2c')]=function(_0x3e5224,_0x4e60ba){var _0x26cdf5={},_0x575be1={},_0x1c44d4={'count':0x0,'rows':[]};return db[_0xaf81('0x2d')]['describe']()[_0xaf81('0x27')](function(_0x4e947c){var _0x160796=[];for(var _0x2df4ae=0x0;_0x2df4ae<Object[_0xaf81('0x2e')](_0x4e947c)['length'];_0x2df4ae++){var _0x48c09f=Object[_0xaf81('0x2e')](_0x4e947c)[_0x2df4ae];if(_['startsWith'](_0x48c09f,_0xaf81('0x2f'))){_0x160796[_0xaf81('0x30')](db['CmCustomField'][_0xaf81('0x31')]({'where':{'id':_[_0xaf81('0x32')](_0x48c09f,_0xaf81('0x2f'))},'raw':!![]}));}}return BPromise[_0xaf81('0x33')](_0x160796)[_0xaf81('0x27')](function(_0x19a70d){for(var _0x16c3d3=0x0;_0x16c3d3<_0x19a70d['length'];_0x16c3d3++){if(_0x19a70d[_0x16c3d3]){var _0x280d65='cf_'+_0x19a70d[_0x16c3d3]['id'];var _0x1aa116=_0x4e947c[_0x280d65];_0x1aa116['fieldType']=_0x19a70d[_0x16c3d3][_0xaf81('0x34')];}}return _0x4e947c;});})[_0xaf81('0x27')](function(_0x463e4b){_0x575be1[_0xaf81('0x35')]=_['keys'](_0x463e4b);_0x575be1[_0xaf81('0x36')]=_[_0xaf81('0x2e')](_0x3e5224[_0xaf81('0x36')]);_0x575be1[_0xaf81('0x37')]=_[_0xaf81('0x38')](_0x575be1[_0xaf81('0x35')],_0x575be1[_0xaf81('0x36')]);_0x26cdf5[_0xaf81('0x39')]=_[_0xaf81('0x38')](_0x575be1[_0xaf81('0x35')],qs[_0xaf81('0x3a')](_0x3e5224[_0xaf81('0x36')][_0xaf81('0x3a')]));_0x26cdf5['attributes']=_0x26cdf5[_0xaf81('0x39')][_0xaf81('0x3b')]?_0x26cdf5[_0xaf81('0x39')]:_0x575be1[_0xaf81('0x35')];if(!_0x3e5224[_0xaf81('0x36')][_0xaf81('0x3c')]('nolimit')){_0x26cdf5[_0xaf81('0x21')]=qs['limit'](_0x3e5224[_0xaf81('0x36')][_0xaf81('0x21')]);_0x26cdf5[_0xaf81('0x20')]=qs['offset'](_0x3e5224['query'][_0xaf81('0x20')]);}_0x26cdf5[_0xaf81('0x3d')]=qs[_0xaf81('0x3e')](_0x3e5224[_0xaf81('0x36')][_0xaf81('0x3e')]);_0x26cdf5[_0xaf81('0x3f')]=qs[_0xaf81('0x37')](_[_0xaf81('0x40')](_0x3e5224['query'],_0x575be1[_0xaf81('0x37')]),_0x463e4b);var _0x2b6dd2=[];var _0x4ce720=squel[_0xaf81('0x41')]()[_0xaf81('0x42')]('id')[_0xaf81('0x42')]('name')[_0xaf81('0x42')](_0xaf81('0x43'))[_0xaf81('0x44')](_0xaf81('0x45'));var _0x4e48d1=squel[_0xaf81('0x41')]()[_0xaf81('0x44')]('cm_contacts','c')[_0xaf81('0x46')]('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20c.id')[_0xaf81('0x46')](_0xaf81('0x47'),'ct',_0xaf81('0x48'))[_0xaf81('0x46')](_0xaf81('0x45'),'t',_0xaf81('0x49'))[_0xaf81('0x3f')](_0xaf81('0x4a'));var _0x199e65=squel[_0xaf81('0x4b')]();var _0x110467=[];var _0x1f9f4f=squel[_0xaf81('0x4b')]();var _0x20d679;if(_0x3e5224[_0xaf81('0x36')]['search']){_0x20d679=as[_0xaf81('0x4c')](_0x3e5224[_0xaf81('0x36')]['search']);var _0x77d66b=_0x20d679[_0xaf81('0x4d')];for(var _0x388c89=0x0;_0x388c89<_0x20d679['conditions'][_0xaf81('0x3b')];_0x388c89++){var _0x233659=_0x20d679[_0xaf81('0x4e')][_0x388c89];var _0x1dc671='c';var _0x8e271b=_(_0x463e4b)[_0xaf81('0x2e')]()[_0xaf81('0x4f')](function(_0x3252d7){return _0x3252d7===_0x233659[_0xaf81('0x42')];});if(_0x8e271b)_0x8e271b=_0x463e4b[_0x233659['field']];if(!_0x8e271b){if(_0x233659[_0xaf81('0x42')]==='Tag'){var _0x144e98=_0x233659[_0xaf81('0x50')][_0xaf81('0x51')](',')['map'](function(_0x5598a0){return Number(_0x5598a0);});_0x144e98[_0xaf81('0x52')](function(_0x56b914){_0x1f9f4f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x56b914+',%');});_0x110467=_[_0xaf81('0x53')](_0x110467,_0x144e98);}else if(_0x233659[_0xaf81('0x42')]===_0xaf81('0x54')){_0x199e65[_0xaf81('0x55')]('uc.UserId\x20=\x20?',_0x233659['value']);}}else{if(_0x233659['field']==='dateOfBirth'||_0x8e271b[_0xaf81('0x56')]===_0xaf81('0x57'))_0x233659[_0xaf81('0x58')]=_0xaf81('0x59');var _0x3a4660=as[_0xaf81('0x5a')](_0x1dc671,_0x8e271b[_0xaf81('0x34')],_0x233659);_0x199e65[_0x77d66b](_0x3a4660[_0xaf81('0x5b')],_0x3a4660[_0xaf81('0x50')][_0xaf81('0x5c')],_0x3a4660[_0xaf81('0x50')][_0xaf81('0x1d')]);}}}else{var _0xbcf3bc=_(Object[_0xaf81('0x2e')](_0x3e5224[_0xaf81('0x36')]))[_0xaf81('0x5d')](function(_0x57036d){return _0x463e4b['hasOwnProperty'](_0x57036d)?_0x57036d:undefined;})[_0xaf81('0x5e')](function(_0xa6ea77){return!_[_0xaf81('0x5f')](_0xa6ea77);})['value']();if(_0x3e5224[_0xaf81('0x36')][_0xaf81('0x60')])_0xbcf3bc['push'](_0xaf81('0x60'));if(!_[_0xaf81('0x61')](_0xbcf3bc)){_0xbcf3bc[_0xaf81('0x52')](function(_0x422722){if(_0x422722===_0xaf81('0x62')){_0x4e48d1[_0xaf81('0x3f')]('c.ListId\x20IN\x20?',[][_0xaf81('0x63')](_0x3e5224[_0xaf81('0x36')][_0x422722]));}else if(_0x422722===_0xaf81('0x60')){var _0x131e51='%'+_0x3e5224[_0xaf81('0x36')][_0x422722]+'%';_0x4e48d1['where']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x131e51);}else{_0x4e48d1['where']('c.'+_0x422722+'\x20=\x20?',_0x3e5224[_0xaf81('0x36')][_0x422722]);}});}if(_0x3e5224[_0xaf81('0x36')][_0xaf81('0x64')]){_0x110467=_['isArray'](_0x3e5224[_0xaf81('0x36')]['tag'])?_0x3e5224['query'][_0xaf81('0x64')]:new Array(_0x3e5224['query'][_0xaf81('0x64')]);_0x110467[_0xaf81('0x52')](function(_0x4b93d3){_0x1f9f4f['or'](_0xaf81('0x65'),'%,'+_0x4b93d3+',%');});}if(_0x3e5224['query']['filter']){var _0x3f7903=_0x3e5224['query']['filter']['replace']('\x5c','\x5c\x5c')[_0xaf81('0x66')](/'/g,'\x27\x27');if(_0x3f7903['split']('\x20')[_0xaf81('0x3b')]>0x1){_0x199e65['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xaf81('0x67')](_0x3f7903),null);}else{if(qs[_0xaf81('0x68')](_0x3f7903)){_0x199e65['or'](_0xaf81('0x69'),_0x3f7903+'%');_0x199e65['or'](_0xaf81('0x6a'),_0x3f7903+'%');_0x199e65['or']('c.mobile\x20LIKE\x20?',_0x3f7903+'%');_0x199e65['or'](_0xaf81('0x6b'),_0x3f7903+'%');}else if(qs['isEmail'](_0x3f7903)){_0x199e65['or'](_0xaf81('0x6c'),_0x3f7903+'%');}else{_0x199e65['or'](_0xaf81('0x6d'),'%'+_0x3f7903+'%');_0x199e65['or'](_0xaf81('0x6e'),'%'+_0x3f7903+'%');_0x199e65['or']('c.email\x20LIKE\x20?','%'+_0x3f7903+'%');}}}}_0x4e48d1[_0xaf81('0x3f')](_0x199e65);_0x4e48d1[_0xaf81('0x6f')](_0xaf81('0x70'));var _0x4212b4={'type':db[_0xaf81('0x71')][_0xaf81('0x72')]['SELECT'],'raw':!![]};var _0x42e4b9=_0x4e48d1[_0xaf81('0x73')]()['field']('c.id');if(_0x26cdf5['order']){_0x26cdf5[_0xaf81('0x3d')][_0xaf81('0x52')](function(_0x544ae6){_0x4e48d1[_0xaf81('0x3d')]('c.'+_0x544ae6[0x0],_0x544ae6[0x1]==='DESC'?![]:!![]);});}if(!_[_0xaf81('0x61')](_0x110467)){_0x4e48d1[_0xaf81('0x74')](_0x1f9f4f);_0x42e4b9[_0xaf81('0x3f')](_0xaf81('0x75'),_0x110467);}BPromise['resolve']()[_0xaf81('0x27')](function(){if(!_0x20d679)return;if(_0x3e5224['user'][_0xaf81('0x76')]!==_0xaf81('0x77'))return;if(!_[_0xaf81('0x78')](_0x20d679[_0xaf81('0x4e')],[_0xaf81('0x42'),_0xaf81('0x54')])){return _0x3e5224[_0xaf81('0x79')][_0xaf81('0x7a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x524025){if(_[_0xaf81('0x61')](_0x524025)){_0x42e4b9[_0xaf81('0x3f')](_0xaf81('0x7b'));_0x4e48d1[_0xaf81('0x3f')]('c.ListId\x20IS\x20NULL');}else{_0x42e4b9[_0xaf81('0x3f')](_0xaf81('0x7c'),_['map'](_0x524025,'id'));_0x4e48d1[_0xaf81('0x3f')](_0xaf81('0x7c'),_[_0xaf81('0x5d')](_0x524025,'id'));}});}})[_0xaf81('0x27')](function(){if(_0x3e5224[_0xaf81('0x79')][_0xaf81('0x76')]==='agent'&&!_0x20d679&&!_0x3e5224[_0xaf81('0x36')][_0xaf81('0x62')])return[];return db[_0xaf81('0x7d')][_0xaf81('0x36')](_0x42e4b9['toString'](),_0x4212b4);})['then'](function(_0x32bada){_0x1c44d4[_0xaf81('0x23')]=_0x32bada[_0xaf81('0x3b')];if(_0x1c44d4['count']===0x0)return[];return db[_0xaf81('0x7d')][_0xaf81('0x36')](_0x4ce720[_0xaf81('0x7e')](),_0x4212b4)[_0xaf81('0x27')](function(_0x523aa6){_0x2b6dd2=_[_0xaf81('0x7f')](_0x523aa6,'id');_0x4212b4=_[_0xaf81('0x80')](_0x4212b4,{'model':db[_0xaf81('0x2d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3e5224[_0xaf81('0x36')][_0xaf81('0x3a')]){_0x26cdf5[_0xaf81('0x39')]['forEach'](function(_0x358696){_0x4e48d1[_0xaf81('0x42')]('c.'+_0x358696);});}else{_0x4e48d1['field'](_0xaf81('0x70'));_0x4e48d1[_0xaf81('0x42')](_0xaf81('0x81'));_0x4e48d1[_0xaf81('0x42')]('c.lastName');_0x4e48d1['field'](_0xaf81('0x82'));_0x4e48d1[_0xaf81('0x42')](_0xaf81('0x83'));_0x4e48d1['field']('c.fax');_0x4e48d1[_0xaf81('0x42')]('c.email');_0x4e48d1[_0xaf81('0x42')](_0xaf81('0x84'));_0x4e48d1[_0xaf81('0x42')]('c.createdAt');_0x4e48d1[_0xaf81('0x42')]('c.deletedAt');_0x4e48d1[_0xaf81('0x42')](_0xaf81('0x85'));_0x4e48d1[_0xaf81('0x42')](_0xaf81('0x86'),_0xaf81('0x87'));}if(_0x26cdf5['limit'])_0x4e48d1['limit'](_0x26cdf5[_0xaf81('0x21')]);if(_0x26cdf5[_0xaf81('0x20')])_0x4e48d1[_0xaf81('0x20')](_0x26cdf5[_0xaf81('0x20')]);return db[_0xaf81('0x7d')]['query'](_0x4e48d1['toString'](),_0x4212b4);});})[_0xaf81('0x27')](function(_0xbd3f1){_0xbd3f1[_0xaf81('0x52')](function(_0x4b2894){if(_0x4b2894[_0xaf81('0x87')]){_0x4b2894[_0xaf81('0x88')]=[];_0x4b2894[_0xaf81('0x87')]['split'](',')[_0xaf81('0x52')](function(_0x49ea7a){_0x4b2894[_0xaf81('0x88')][_0xaf81('0x30')](_0x2b6dd2[_0x49ea7a]);});}delete _0x4b2894['TagIds'];});_0x1c44d4[_0xaf81('0x89')]=_0xbd3f1;return _0x1c44d4;})[_0xaf81('0x27')](respondWithFilteredResult(_0x4e60ba,_0x26cdf5));})[_0xaf81('0x8a')](handleError(_0x4e60ba,null));};exports[_0xaf81('0x8b')]=function(_0x214431,_0x25a695){return db[_0xaf81('0x2d')][_0xaf81('0x4f')]({'where':{'id':_0x214431[_0xaf81('0x8c')]['id']}})[_0xaf81('0x27')](handleEntityNotFound(_0x25a695,null))['then'](removeEntity(_0x25a695,null))[_0xaf81('0x8a')](handleError(_0x25a695,null));};exports[_0xaf81('0x8d')]=function(_0x2ab7af,_0x27e190){return db[_0xaf81('0x2d')][_0xaf81('0x8d')]()[_0xaf81('0x27')](function(_0xcfe8c1){delete _0xcfe8c1[_0xaf81('0x8e')];for(var _0x439881=0x0;_0x439881<Object[_0xaf81('0x2e')](_0xcfe8c1)[_0xaf81('0x3b')];_0x439881++){var _0x39bd25=Object[_0xaf81('0x2e')](_0xcfe8c1)[_0x439881];if(!_[_0xaf81('0x8f')](_0x39bd25,_0xaf81('0x2f'))){_0xcfe8c1[_0x39bd25][_0xaf81('0x90')]=_0x39bd25;_0xcfe8c1[_0x39bd25][_0xaf81('0x91')]=_0x39bd25;}}return _0xcfe8c1;})[_0xaf81('0x27')](function(_0x5d7d18){var _0x2d2542={'where':{'$or':[{'ListId':_0x2ab7af['query']['id']},{'ListId':null}]},'raw':!![]};return db[_0xaf81('0x92')][_0xaf81('0x93')](_0x2d2542)[_0xaf81('0x27')](function(_0x441a3b){for(var _0x43dd2c=0x0;_0x43dd2c<_0x441a3b['length'];_0x43dd2c++){var _0x4f7b9e=_0xaf81('0x2f')+_0x441a3b[_0x43dd2c]['id'];_0x5d7d18[_0x4f7b9e][_0xaf81('0x90')]=_0x4f7b9e;_0x5d7d18[_0x4f7b9e][_0xaf81('0x91')]=_0x441a3b[_0x43dd2c][_0xaf81('0x94')];_0x5d7d18[_0x4f7b9e][_0xaf81('0x95')]={'type':_0x441a3b[_0x43dd2c][_0xaf81('0x34')],'values':_0x441a3b[_0x43dd2c]['values']};}Object[_0xaf81('0x2e')](_0x5d7d18)[_0xaf81('0x52')](function(_0x9a7686){if(!_0x5d7d18[_0x9a7686][_0xaf81('0x3c')](_0xaf81('0x90'))){delete _0x5d7d18[_0x9a7686];}});return _0x5d7d18;});})[_0xaf81('0x27')](respondWithResult(_0x27e190,null))['catch'](handleError(_0x27e190,null));};exports[_0xaf81('0x80')]=function(_0x31817b,_0x7168d1){var _0x445a07;var _0x406cc9;var _0x167a06;if(_0x31817b['body']['id']){delete _0x31817b[_0xaf81('0x96')]['id'];}return db['CmContact'][_0xaf81('0x93')]({'where':{'id':[_0x31817b[_0xaf81('0x96')]['to'],_0x31817b[_0xaf81('0x96')][_0xaf81('0x44')]]}})[_0xaf81('0x27')](function(_0x4a3553){if(_0x4a3553){if(_0x4a3553[_0xaf81('0x3b')]!==0x2){return null;}_0x4a3553[0x0]=_0x4a3553[0x0][_0xaf81('0x97')]({'plain':!![]});_0x4a3553[0x1]=_0x4a3553[0x1][_0xaf81('0x97')]({'plain':!![]});delete _0x4a3553[0x0]['id'];delete _0x4a3553[0x1]['id'];return _[_0xaf81('0x98')](_0x4a3553[0x0],_0x4a3553[0x1],function(_0xa9fd7a,_0x22a378){if(Array['isArray'](_0x22a378)&&!_0x22a378[_0xaf81('0x3b')]){return _0xa9fd7a;}else if(!_0x22a378){return _0xa9fd7a;}});}})[_0xaf81('0x27')](handleEntityNotFound(_0x7168d1,null))['then'](function(_0x5db71c){if(_0x5db71c){if(_0x5db71c[_0xaf81('0x8e')]&&_[_0xaf81('0x99')](_0x5db71c['tags'])){_0x5db71c[_0xaf81('0x8e')]=_0x5db71c['tags'][_0xaf81('0x9a')]();}logger[_0xaf81('0x9b')](_0xaf81('0x9c'),_0x31817b['body']['to'],_0x31817b[_0xaf81('0x96')][_0xaf81('0x44')]);return db[_0xaf81('0x9d')][_0xaf81('0x8b')]({'where':{'ContactId':[_0x31817b[_0xaf81('0x96')]['to'],_0x31817b['body'][_0xaf81('0x44')]]}})[_0xaf81('0x27')](function(_0x39b5fe){logger[_0xaf81('0x9b')](_0xaf81('0x9e'),_0x39b5fe);return db[_0xaf81('0x9f')]['destroy']({'where':{'ContactId':[_0x31817b[_0xaf81('0x96')]['to'],_0x31817b[_0xaf81('0x96')][_0xaf81('0x44')]]}})['then'](function(_0x425c2a){logger[_0xaf81('0x9b')](_0xaf81('0xa0'),_0x425c2a);return db[_0xaf81('0x2d')]['create'](_0x5db71c);});});}})[_0xaf81('0x27')](function(_0x2d88c7){if(_0x2d88c7){_0x445a07=_0x2d88c7;_0x406cc9={'ContactId':_0x445a07['id']};_0x167a06={'where':{'ContactId':[_0x31817b[_0xaf81('0x96')]['to'],_0x31817b[_0xaf81('0x96')][_0xaf81('0x44')]]}};return db[_0xaf81('0xa1')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})['then'](function(){if(_0x445a07){return db[_0xaf81('0xa3')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db['ChatOfflineMessage']['update'](_0x406cc9,_0x167a06);}})['then'](function(){if(_0x445a07){return db[_0xaf81('0xa4')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db[_0xaf81('0xa5')]['update'](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db['MailInteraction'][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})['then'](function(){if(_0x445a07){return db['MailMessage'][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db['SmsInteraction'][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db['SmsMessage'][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})['then'](function(){if(_0x445a07){return db['FaxInteraction'][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db[_0xaf81('0xa6')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db[_0xaf81('0xa7')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db[_0xaf81('0xa8')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db[_0xaf81('0xa9')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db[_0xaf81('0xaa')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db['ReportAgentPreview'][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db[_0xaf81('0xab')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db['ChatQueueReport'][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})['then'](function(){if(_0x445a07){return db['FaxQueueReport'][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})['then'](function(){if(_0x445a07){return db[_0xaf81('0xac')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db['OpenchannelQueueReport'][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})['then'](function(){if(_0x445a07){return db[_0xaf81('0xad')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})['then'](function(){if(_0x445a07){return db[_0xaf81('0xae')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})['then'](function(){if(_0x445a07){return db[_0xaf81('0xaf')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db[_0xaf81('0xb0')]['update'](_0x406cc9,_0x167a06);}})['then'](function(){if(_0x445a07){return db[_0xaf81('0xb1')][_0xaf81('0xa2')](_0x406cc9,_0x167a06);}})[_0xaf81('0x27')](function(){if(_0x445a07){return db[_0xaf81('0x2d')]['destroy']({'where':{'id':[_0x31817b['body']['to'],_0x31817b[_0xaf81('0x96')][_0xaf81('0x44')]]}});}})['then'](function(){if(_0x445a07){return _0x445a07;}})[_0xaf81('0x27')](respondWithResult(_0x7168d1,null))[_0xaf81('0x8a')](handleError(_0x7168d1,null));};exports[_0xaf81('0xb2')]=function(_0x3d98d0,_0x4d832e){return db[_0xaf81('0x2d')][_0xaf81('0x8d')]()[_0xaf81('0x27')](function(_0x32b2f2){if(_0x3d98d0[_0xaf81('0x96')]['tags']&&_[_0xaf81('0x99')](_0x3d98d0['body'][_0xaf81('0x8e')])){if(_0x3d98d0['body'][_0xaf81('0x8e')]['length']){_0x3d98d0[_0xaf81('0x96')][_0xaf81('0x8e')]=_0x3d98d0[_0xaf81('0x96')][_0xaf81('0x8e')]['join'](';')+';';}else{_0x3d98d0[_0xaf81('0x96')][_0xaf81('0x8e')]=null;}}else{_0x3d98d0[_0xaf81('0x96')]['tags']=null;}return db[_0xaf81('0x2d')][_0xaf81('0xb2')](_0x3d98d0[_0xaf81('0x96')],{'fields':_['keys'](_0x32b2f2),'raw':!![]});})[_0xaf81('0x27')](respondWithResult(_0x4d832e,0xc9))['catch'](handleError(_0x4d832e,null));};exports[_0xaf81('0xb3')]=function(_0x502fbd,_0x2aaffd){var _0x2a55ab=[];var _0x1fa84c=0x0;var _0x5ee6a8=0x0;var _0x1f38e7=0x0;return db[_0xaf81('0x2d')][_0xaf81('0x8d')]()[_0xaf81('0x27')](function(_0x14fe2f){return BPromise[_0xaf81('0xb4')](_0x502fbd[_0xaf81('0x96')],function(_0x193ca1){var _0xee69fe={'where':{'$or':[]},'defaults':_0x193ca1,'fields':_[_0xaf81('0x2e')](_0x14fe2f),'raw':!![]};if(_0x193ca1[_0xaf81('0xb5')]){for(var _0x56c5ce=0x0;_0x56c5ce<_0x193ca1[_0xaf81('0xb5')]['length'];_0x56c5ce++){var _0x8205a9={};_0x8205a9[_0x193ca1[_0xaf81('0xb5')][_0x56c5ce]]=_0x193ca1[_0x193ca1['duplicates'][_0x56c5ce]];_0xee69fe[_0xaf81('0x3f')][_0xaf81('0xb6')][_0xaf81('0x30')](_0x8205a9);}_0xee69fe['where'][_0xaf81('0x62')]=_0x193ca1[_0xaf81('0x62')];}return db[_0xaf81('0x2d')]['findOrCreate'](_0xee69fe)[_0xaf81('0xb7')](function(_0x4378e,_0x3999c3){if(_0x3999c3){_0x1fa84c++;}else{_0x1f38e7++;}})[_0xaf81('0x8a')](function(_0x23c4cf){console['error'](_0x23c4cf);_0x5ee6a8++;});});})[_0xaf81('0x27')](function(_0x45108e){if(_0x45108e){return{'success':_0x1fa84c,'failure':_0x5ee6a8,'duplicates':_0x1f38e7};}})['then'](respondWithResult(_0x2aaffd,0xc9))[_0xaf81('0x8a')](handleError(_0x2aaffd,null));};exports[_0xaf81('0xb8')]=function(_0x3cc64d,_0x54d442,_0x4ac882){var _0xc48356;return db[_0xaf81('0x2d')][_0xaf81('0x8d')]()['then'](function(_0x5d032a){return db['CmContact'][_0xaf81('0x4f')]({'where':{'id':_0x3cc64d[_0xaf81('0x8c')]['id']},'include':[{'model':db[_0xaf81('0xb9')],'as':_0xaf81('0x88'),'attributes':['id',_0xaf81('0x2a'),_0xaf81('0x43')],'required':_0x3cc64d[_0xaf81('0x36')][_0xaf81('0x64')]?!![]:![]}],'attributes':_[_0xaf81('0x2e')](_0x5d032a)});})[_0xaf81('0x27')](function(_0x179401){_0xc48356=_0x179401[_0xaf81('0x97')]({'plain':!![]});var _0x2563c6={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x179401&&_0x179401['ListId']){if(_0x179401[_0xaf81('0x62')]){_0x2563c6[_0xaf81('0x3f')]['$and'][_0xaf81('0x30')]({'ListId':{'$ne':_0x179401['ListId']}});}}return db[_0xaf81('0x92')][_0xaf81('0x93')](_0x2563c6);})[_0xaf81('0x27')](function(_0x363e70){return _[_0xaf81('0xba')](_0xc48356,_[_0xaf81('0x5d')](_0x363e70,function(_0x28e13e){return util['format'](_0xaf81('0xbb'),_0x28e13e['id']);}));})[_0xaf81('0x27')](handleEntityNotFound(_0x54d442,null))[_0xaf81('0x27')](respondWithResult(_0x54d442,null))[_0xaf81('0x8a')](handleError(_0x54d442,null));};exports[_0xaf81('0xa2')]=function(_0x224188,_0xfe782e){var _0x311066;if(_0x224188[_0xaf81('0x96')]['id']){delete _0x224188['body']['id'];}return db[_0xaf81('0x2d')]['find']({'where':{'id':_0x224188['params']['id']}})[_0xaf81('0x27')](handleEntityNotFound(_0xfe782e,null))[_0xaf81('0x27')](saveUpdates(_0x224188['body'],null))['then'](function(_0x3963df){_0x311066=_0x3963df;var _0x32f265={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3963df&&_0x3963df[_0xaf81('0x62')]){if(_0x3963df[_0xaf81('0x62')]){_0x32f265[_0xaf81('0x3f')][_0xaf81('0xbc')][_0xaf81('0x30')]({'ListId':{'$ne':_0x3963df[_0xaf81('0x62')]}});}}return db[_0xaf81('0x92')][_0xaf81('0x93')](_0x32f265);})['then'](function(_0x2516de){if(_0x2516de){return _['omit'](_['pickBy'](_0x224188[_0xaf81('0x96')],function(_0x23bda7,_0x2ba438){return _[_0xaf81('0x8f')](_0x2ba438,_0xaf81('0x2f'));}),_[_0xaf81('0x5d')](_0x2516de,function(_0x573c87){return util[_0xaf81('0xbd')](_0xaf81('0xbb'),_0x573c87['id']);}));}})['then'](function(_0x35bdc1){if(_0x35bdc1&&!_[_0xaf81('0x61')](_0x35bdc1)){var _0x4615e5=squel[_0xaf81('0xa2')]()[_0xaf81('0xbe')]('cm_contacts')[_0xaf81('0xbf')](_0x35bdc1)[_0xaf81('0x3f')]('id\x20=\x20?',_0x224188[_0xaf81('0x8c')]['id'])[_0xaf81('0xc0')]();return db[_0xaf81('0x7d')][_0xaf81('0x36')](_0x4615e5['text'],{'replacements':_0x4615e5[_0xaf81('0xc1')]});}})[_0xaf81('0x27')](function(){if(_0x224188['body'][_0xaf81('0xc2')]&&_0x311066){return db[_0xaf81('0x9d')][_0xaf81('0xa2')]({'phone':_0x224188[_0xaf81('0x96')][_0xaf81('0xc2')]},{'where':{'ContactId':_0x311066['id']}});}})['then'](function(){return _0x311066;})['then'](respondWithResult(_0xfe782e,null))['catch'](handleError(_0xfe782e,null));};exports['getTags']=function(_0x2d10b9,_0x1922ac,_0x34a012){var _0x3caa60={};var _0x5b0382={};var _0x2c3a87;var _0x3aaaca;return db[_0xaf81('0x2d')]['findOne']({'where':{'id':_0x2d10b9[_0xaf81('0x8c')]['id']}})[_0xaf81('0x27')](handleEntityNotFound(_0x1922ac,null))['then'](function(_0x3538b6){if(_0x3538b6){_0x2c3a87=_0x3538b6;_0x5b0382['model']=_[_0xaf81('0x2e')](db[_0xaf81('0xb9')][_0xaf81('0xc3')]);_0x5b0382['query']=_['keys'](_0x2d10b9[_0xaf81('0x36')]);_0x5b0382['filters']=_[_0xaf81('0x38')](_0x5b0382[_0xaf81('0x35')],_0x5b0382[_0xaf81('0x36')]);_0x3caa60[_0xaf81('0x39')]=_[_0xaf81('0x38')](_0x5b0382[_0xaf81('0x35')],qs['fields'](_0x2d10b9[_0xaf81('0x36')][_0xaf81('0x3a')]));_0x3caa60[_0xaf81('0x39')]=_0x3caa60[_0xaf81('0x39')][_0xaf81('0x3b')]?_0x3caa60['attributes']:_0x5b0382[_0xaf81('0x35')];_0x3caa60[_0xaf81('0x3d')]=qs[_0xaf81('0x3e')](_0x2d10b9[_0xaf81('0x36')][_0xaf81('0x3e')]);_0x3caa60['where']=qs['filters'](_[_0xaf81('0x40')](_0x2d10b9['query'],_0x5b0382['filters']));if(_0x2d10b9['query'][_0xaf81('0x5e')]){_0x3caa60['where']=_['merge'](_0x3caa60[_0xaf81('0x3f')],{'$or':_[_0xaf81('0x5d')](_0x3caa60[_0xaf81('0x39')],function(_0x473a93){var _0xea0762={};_0xea0762[_0x473a93]={'$like':'%'+_0x2d10b9[_0xaf81('0x36')][_0xaf81('0x5e')]+'%'};return _0xea0762;})});}_0x3caa60=_['merge']({},_0x3caa60,_0x2d10b9[_0xaf81('0xc4')]);return _0x2c3a87['getTags'](_0x3caa60);}})[_0xaf81('0x27')](function(_0x2d6ed7){if(_0x2d6ed7){_0x3aaaca=_0x2d6ed7[_0xaf81('0x3b')];if(!_0x2d10b9['query'][_0xaf81('0x3c')](_0xaf81('0xc5'))){_0x3caa60[_0xaf81('0x21')]=qs[_0xaf81('0x21')](_0x2d10b9[_0xaf81('0x36')][_0xaf81('0x21')]);_0x3caa60[_0xaf81('0x20')]=qs[_0xaf81('0x20')](_0x2d10b9[_0xaf81('0x36')][_0xaf81('0x20')]);}return _0x2c3a87[_0xaf81('0xc6')](_0x3caa60);}})[_0xaf81('0x27')](function(_0x4e8fc5){if(_0x4e8fc5){return _0x4e8fc5?{'count':_0x3aaaca,'rows':_0x4e8fc5}:null;}})['then'](respondWithResult(_0x1922ac,null))[_0xaf81('0x8a')](handleError(_0x1922ac,null));};exports[_0xaf81('0xc7')]=function(_0xc07ac9,_0x2eb564,_0x261fdf){if(_0xc07ac9['body']['id']){delete _0xc07ac9['body']['id'];}return db[_0xaf81('0x2d')][_0xaf81('0x31')]({'where':{'id':_0xc07ac9[_0xaf81('0x8c')]['id']}})['then'](handleEntityNotFound(_0x2eb564,null))[_0xaf81('0x27')](function(_0x4a15d2){if(_0x4a15d2){return _0x4a15d2[_0xaf81('0xc7')](_0xc07ac9['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x2eb564,null))[_0xaf81('0x8a')](handleError(_0x2eb564,null));};exports['getHoppers']=function(_0x2957f1,_0x5ab65b,_0x3c03a8){var _0x20907c={'raw':![],'where':{}};var _0x37dd86={};var _0x135fcc={'count':0x0,'rows':[]};return db[_0xaf81('0x2d')][_0xaf81('0x31')]({'where':{'id':_0x2957f1[_0xaf81('0x8c')]['id']}})[_0xaf81('0x27')](handleEntityNotFound(_0x5ab65b,null))[_0xaf81('0x27')](function(_0x3282e1){if(_0x3282e1){_0x37dd86[_0xaf81('0x35')]=_['keys'](db['CmHopper']['rawAttributes']);_0x37dd86[_0xaf81('0x36')]=_[_0xaf81('0x2e')](_0x2957f1['query']);_0x37dd86[_0xaf81('0x37')]=_[_0xaf81('0x38')](_0x37dd86[_0xaf81('0x35')],_0x37dd86['query']);_0x20907c[_0xaf81('0x39')]=_['intersection'](_0x37dd86[_0xaf81('0x35')],qs[_0xaf81('0x3a')](_0x2957f1['query']['fields']));_0x20907c[_0xaf81('0x39')]=_0x20907c[_0xaf81('0x39')][_0xaf81('0x3b')]?_0x20907c[_0xaf81('0x39')]:_0x37dd86[_0xaf81('0x35')];if(!_0x2957f1['query'][_0xaf81('0x3c')](_0xaf81('0xc5'))){_0x20907c[_0xaf81('0x21')]=qs['limit'](_0x2957f1[_0xaf81('0x36')][_0xaf81('0x21')]);_0x20907c[_0xaf81('0x20')]=qs['offset'](_0x2957f1[_0xaf81('0x36')][_0xaf81('0x20')]);}_0x20907c[_0xaf81('0x3d')]=qs[_0xaf81('0x3e')](_0x2957f1[_0xaf81('0x36')]['sort']);_0x20907c['where']=qs['filters'](_['pick'](_0x2957f1[_0xaf81('0x36')],_0x37dd86[_0xaf81('0x37')]));_0x20907c[_0xaf81('0x3f')][_0xaf81('0xc8')]=_0x3282e1['id'];if(_0x2957f1[_0xaf81('0x36')][_0xaf81('0x5e')]){_0x20907c['where']=_[_0xaf81('0x80')](_0x20907c[_0xaf81('0x3f')],{'$or':_[_0xaf81('0x5d')](_0x20907c[_0xaf81('0x39')],function(_0x4512eb){var _0x2a516e={};_0x2a516e[_0x4512eb]={'$like':'%'+_0x2957f1[_0xaf81('0x36')][_0xaf81('0x5e')]+'%'};return _0x2a516e;})});}_0x20907c=_[_0xaf81('0x80')]({},_0x20907c,_0x2957f1[_0xaf81('0xc4')]);return db[_0xaf81('0x9d')][_0xaf81('0x23')]({'where':_0x20907c[_0xaf81('0x3f')]})[_0xaf81('0x27')](function(_0x2888b3){_0x135fcc[_0xaf81('0x23')]=_0x2888b3;if(_0x2957f1['query']['includeAll']){_0x20907c[_0xaf81('0xc9')]=[{'all':!![]}];}return db[_0xaf81('0x9d')][_0xaf81('0x93')](_0x20907c);})[_0xaf81('0x27')](function(_0x302878){_0x135fcc['rows']=_0x302878;return _0x135fcc;});}})[_0xaf81('0x27')](respondWithFilteredResult(_0x5ab65b,_0x20907c))[_0xaf81('0x8a')](handleError(_0x5ab65b,null));};exports['getHopperHistories']=function(_0x2e01ae,_0x1f1243,_0x430a67){var _0x533c03={'raw':!![],'where':{}};var _0x267dfd={};var _0x261f1b={'count':0x0,'rows':[]};return db[_0xaf81('0x2d')][_0xaf81('0x31')]({'where':{'id':_0x2e01ae['params']['id']}})[_0xaf81('0x27')](handleEntityNotFound(_0x1f1243,null))['then'](function(_0x1f0fc5){if(_0x1f0fc5){_0x267dfd['model']=_[_0xaf81('0x2e')](db['CmHopperHistory']['rawAttributes']);_0x267dfd[_0xaf81('0x36')]=_['keys'](_0x2e01ae['query']);_0x267dfd[_0xaf81('0x37')]=_[_0xaf81('0x38')](_0x267dfd[_0xaf81('0x35')],_0x267dfd[_0xaf81('0x36')]);_0x533c03[_0xaf81('0x39')]=_[_0xaf81('0x38')](_0x267dfd[_0xaf81('0x35')],qs[_0xaf81('0x3a')](_0x2e01ae['query'][_0xaf81('0x3a')]));_0x533c03[_0xaf81('0x39')]=_0x533c03[_0xaf81('0x39')][_0xaf81('0x3b')]?_0x533c03['attributes']:_0x267dfd[_0xaf81('0x35')];if(!_0x2e01ae[_0xaf81('0x36')]['hasOwnProperty'](_0xaf81('0xc5'))){_0x533c03[_0xaf81('0x21')]=qs['limit'](_0x2e01ae['query'][_0xaf81('0x21')]);_0x533c03['offset']=qs[_0xaf81('0x20')](_0x2e01ae[_0xaf81('0x36')][_0xaf81('0x20')]);}_0x533c03[_0xaf81('0x3d')]=qs[_0xaf81('0x3e')](_0x2e01ae[_0xaf81('0x36')][_0xaf81('0x3e')]);_0x533c03[_0xaf81('0x3f')]=qs[_0xaf81('0x37')](_['pick'](_0x2e01ae[_0xaf81('0x36')],_0x267dfd[_0xaf81('0x37')]));_0x533c03[_0xaf81('0x3f')][_0xaf81('0xc8')]=_0x1f0fc5['id'];if(_0x2e01ae[_0xaf81('0x36')]['filter']){_0x533c03[_0xaf81('0x3f')]=_[_0xaf81('0x80')](_0x533c03[_0xaf81('0x3f')],{'$or':_['map'](_0x533c03[_0xaf81('0x39')],function(_0x442d6b){var _0x5b2ebc={};_0x5b2ebc[_0x442d6b]={'$like':'%'+_0x2e01ae[_0xaf81('0x36')]['filter']+'%'};return _0x5b2ebc;})});}_0x533c03=_['merge']({},_0x533c03,_0x2e01ae[_0xaf81('0xc4')]);return db['CmHopperHistory']['count']({'where':_0x533c03[_0xaf81('0x3f')]})[_0xaf81('0x27')](function(_0x16d86a){_0x261f1b[_0xaf81('0x23')]=_0x16d86a;if(_0x2e01ae['query'][_0xaf81('0xca')]){_0x533c03[_0xaf81('0xc9')]=[{'all':!![]}];}return db[_0xaf81('0xaa')]['findAll'](_0x533c03);})[_0xaf81('0x27')](function(_0x557fb9){_0x261f1b['rows']=_0x557fb9;return _0x261f1b;});}})['then'](respondWithFilteredResult(_0x1f1243,_0x533c03))[_0xaf81('0x8a')](handleError(_0x1f1243,null));};exports[_0xaf81('0xcb')]=function(_0x3bb452,_0x5792d1,_0x18136b){var _0x262252={'raw':!![],'where':{}};var _0x5c4937={};var _0x305646={'count':0x0,'rows':[]};return db[_0xaf81('0x2d')]['findOne']({'where':{'id':_0x3bb452[_0xaf81('0x8c')]['id']}})[_0xaf81('0x27')](handleEntityNotFound(_0x5792d1,null))[_0xaf81('0x27')](function(_0x5710f5){if(_0x5710f5){_0x5c4937['model']=_[_0xaf81('0x2e')](db['CmHopperFinal'][_0xaf81('0xc3')]);_0x5c4937['query']=_['keys'](_0x3bb452[_0xaf81('0x36')]);_0x5c4937[_0xaf81('0x37')]=_['intersection'](_0x5c4937['model'],_0x5c4937[_0xaf81('0x36')]);_0x262252['attributes']=_['intersection'](_0x5c4937[_0xaf81('0x35')],qs[_0xaf81('0x3a')](_0x3bb452[_0xaf81('0x36')][_0xaf81('0x3a')]));_0x262252['attributes']=_0x262252[_0xaf81('0x39')]['length']?_0x262252[_0xaf81('0x39')]:_0x5c4937[_0xaf81('0x35')];if(!_0x3bb452[_0xaf81('0x36')]['hasOwnProperty'](_0xaf81('0xc5'))){_0x262252[_0xaf81('0x21')]=qs['limit'](_0x3bb452['query']['limit']);_0x262252['offset']=qs['offset'](_0x3bb452['query']['offset']);}_0x262252[_0xaf81('0x3d')]=qs[_0xaf81('0x3e')](_0x3bb452['query']['sort']);_0x262252['where']=qs[_0xaf81('0x37')](_['pick'](_0x3bb452[_0xaf81('0x36')],_0x5c4937[_0xaf81('0x37')]));_0x262252['where']['ContactId']=_0x5710f5['id'];if(_0x3bb452[_0xaf81('0x36')][_0xaf81('0x5e')]){_0x262252[_0xaf81('0x3f')]=_[_0xaf81('0x80')](_0x262252['where'],{'$or':_[_0xaf81('0x5d')](_0x262252[_0xaf81('0x39')],function(_0x51b04a){var _0x2a752b={};_0x2a752b[_0x51b04a]={'$like':'%'+_0x3bb452[_0xaf81('0x36')][_0xaf81('0x5e')]+'%'};return _0x2a752b;})});}_0x262252=_[_0xaf81('0x80')]({},_0x262252,_0x3bb452[_0xaf81('0xc4')]);return db[_0xaf81('0xa9')][_0xaf81('0x23')]({'where':_0x262252[_0xaf81('0x3f')]})[_0xaf81('0x27')](function(_0x19a5d4){_0x305646[_0xaf81('0x23')]=_0x19a5d4;if(_0x3bb452['query']['includeAll']){_0x262252[_0xaf81('0xc9')]=[{'all':!![]}];}return db[_0xaf81('0xa9')][_0xaf81('0x93')](_0x262252);})[_0xaf81('0x27')](function(_0x3863d9){_0x305646['rows']=_0x3863d9;return _0x305646;});}})[_0xaf81('0x27')](respondWithFilteredResult(_0x5792d1,_0x262252))[_0xaf81('0x8a')](handleError(_0x5792d1,null));};exports[_0xaf81('0xcc')]=function(_0x3b4441,_0x5d39d6,_0x19a066){var _0x1aac3f={'raw':!![],'where':{}};var _0x2fb8f4={};var _0x4dfc4d={'count':0x0,'rows':[]};return db[_0xaf81('0x2d')]['findOne']({'where':{'id':_0x3b4441['params']['id']}})['then'](handleEntityNotFound(_0x5d39d6,null))[_0xaf81('0x27')](function(_0x2e084e){if(_0x2e084e){_0x2fb8f4['model']=_['keys'](db[_0xaf81('0xae')][_0xaf81('0xc3')]);_0x2fb8f4['query']=_[_0xaf81('0x2e')](_0x3b4441[_0xaf81('0x36')]);_0x2fb8f4[_0xaf81('0x37')]=_[_0xaf81('0x38')](_0x2fb8f4[_0xaf81('0x35')],_0x2fb8f4['query']);_0x1aac3f[_0xaf81('0x39')]=_[_0xaf81('0x38')](_0x2fb8f4[_0xaf81('0x35')],qs['fields'](_0x3b4441[_0xaf81('0x36')][_0xaf81('0x3a')]));_0x1aac3f[_0xaf81('0x39')]=_0x1aac3f[_0xaf81('0x39')][_0xaf81('0x3b')]?_0x1aac3f[_0xaf81('0x39')]:_0x2fb8f4[_0xaf81('0x35')];if(!_0x3b4441[_0xaf81('0x36')]['hasOwnProperty']('nolimit')){_0x1aac3f['limit']=qs[_0xaf81('0x21')](_0x3b4441[_0xaf81('0x36')][_0xaf81('0x21')]);_0x1aac3f[_0xaf81('0x20')]=qs[_0xaf81('0x20')](_0x3b4441[_0xaf81('0x36')][_0xaf81('0x20')]);}_0x1aac3f[_0xaf81('0x3d')]=qs[_0xaf81('0x3e')](_0x3b4441['query'][_0xaf81('0x3e')]);_0x1aac3f['where']=qs['filters'](_[_0xaf81('0x40')](_0x3b4441['query'],_0x2fb8f4[_0xaf81('0x37')]));_0x1aac3f[_0xaf81('0x3f')]['ContactId']=_0x2e084e['id'];if(_0x3b4441[_0xaf81('0x36')][_0xaf81('0x5e')]){_0x1aac3f['where']=_[_0xaf81('0x80')](_0x1aac3f[_0xaf81('0x3f')],{'$or':_[_0xaf81('0x5d')](_0x1aac3f[_0xaf81('0x39')],function(_0x2dc904){var _0x35a458={};_0x35a458[_0x2dc904]={'$like':'%'+_0x3b4441[_0xaf81('0x36')][_0xaf81('0x5e')]+'%'};return _0x35a458;})});}_0x1aac3f=_[_0xaf81('0x80')]({},_0x1aac3f,_0x3b4441[_0xaf81('0xc4')]);return db['JscriptySessionReport'][_0xaf81('0x23')]({'where':_0x1aac3f['where']})[_0xaf81('0x27')](function(_0x2147f3){_0x4dfc4d[_0xaf81('0x23')]=_0x2147f3;if(_0x3b4441[_0xaf81('0x36')][_0xaf81('0xca')]){_0x1aac3f[_0xaf81('0xc9')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xaf81('0x93')](_0x1aac3f);})[_0xaf81('0x27')](function(_0x201a9c){_0x4dfc4d[_0xaf81('0x89')]=_0x201a9c;return _0x4dfc4d;});}})['then'](respondWithFilteredResult(_0x5d39d6,_0x1aac3f))['catch'](handleError(_0x5d39d6,null));};exports[_0xaf81('0xcd')]=function(_0x2a8d32,_0x56bed2,_0x1c7f4b){try{if(!_0x2a8d32[_0xaf81('0x96')]['ListId']){throw new Error(_0xaf81('0xce'));}if(!_0x2a8d32['body'][_0xaf81('0xcf')]){throw new Error(_0xaf81('0xd0'));}if(!_0x2a8d32[_0xaf81('0x96')][_0xaf81('0xd1')]){throw new Error(_0xaf81('0xd2'));}if(!_0x2a8d32[_0xaf81('0x96')][_0xaf81('0xd3')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x5339ac=_0x2a8d32[_0xaf81('0x96')][_0xaf81('0xcf')][_0xaf81('0x51')](',');var _0x39501e=_0x2a8d32['body'][_0xaf81('0xd1')][_0xaf81('0x51')](',');if(!_0x5339ac[_0xaf81('0x3b')]||!_0x39501e[_0xaf81('0x3b')]||_0x5339ac['length']!==_0x39501e[_0xaf81('0x3b')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x2a8d32[_0xaf81('0x96')][_0xaf81('0x3a')]=_[_0xaf81('0xd4')](_0x5339ac,_0x39501e);if(!_0x2a8d32['body'][_0xaf81('0x3a')][_0xaf81('0xc2')]){throw new Error(_0xaf81('0xd5'));}if(!_0x2a8d32[_0xaf81('0x96')][_0xaf81('0x3a')][_0xaf81('0xd6')]){throw new Error(_0xaf81('0xd7'));}var _0x5a925a=path[_0xaf81('0x9a')](config[_0xaf81('0xd8')],_0xaf81('0xd9'),_0x2a8d32[_0xaf81('0xda')]['filename']);fs['chmodSync'](_0x5a925a,parseInt('0777',0x8));var _0xef74e9=require(_0xaf81('0xdb'))[_0xaf81('0xdc')](path[_0xaf81('0x9a')](__dirname,_0xaf81('0xdd')),[_0x5a925a,_0x2a8d32[_0xaf81('0x96')]['binding_keys'],_0x2a8d32[_0xaf81('0x96')][_0xaf81('0xd1')],_0x2a8d32['body'][_0xaf81('0x62')],_0x2a8d32['body']['CompanyId'],_0x2a8d32['body'][_0xaf81('0xb5')],_0x2a8d32['body']['socket_timestamp']]);return _0x56bed2[_0xaf81('0x1e')](0xc8)[_0xaf81('0x1f')]({'message':_0xaf81('0xde'),'pid':_0xef74e9['pid']});}catch(_0x153f6b){return _0x56bed2[_0xaf81('0x1e')](0x1f4)[_0xaf81('0x2b')](_0x153f6b);}};exports[_0xaf81('0xdf')]=function(_0x902024,_0x47da04,_0x406896){var _0x62617c=fs['createReadStream'](_0x902024['file'][_0xaf81('0x7')]);Papa['parse'](_0x62617c,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x23d42c){return _0x47da04[_0xaf81('0x1e')](0xc8)[_0xaf81('0x1f')]({'file':_0x902024[_0xaf81('0xda')],'fields':_0x23d42c[_0xaf81('0xe0')][_0xaf81('0x3a')]});}});};exports[_0xaf81('0xe1')]=function(_0x24807f,_0x5e444b,_0x1b5254){return db[_0xaf81('0x54')][_0xaf81('0x93')]({'raw':!![],'attributes':['id'],'where':{'role':_0xaf81('0x77')}})[_0xaf81('0x27')](function(_0x48fccb){var _0x1e2641=![];if(!_0x24807f[_0xaf81('0x96')][_0xaf81('0x62')]){throw new Error(_0xaf81('0xce'));}if(!_0x24807f[_0xaf81('0x96')][_0xaf81('0xe2')]['phone']){throw new Error(_0xaf81('0xd5'));}if(!_0x24807f[_0xaf81('0x96')][_0xaf81('0xe2')][_0xaf81('0xd6')]){throw new Error(_0xaf81('0xd7'));}if(!_0x24807f[_0xaf81('0x96')][_0xaf81('0xd3')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x349554=require(_0xaf81('0xdb'))['fork'](path[_0xaf81('0x9a')](__dirname,'../../components/import/cm/csv2'),[_0x24807f[_0xaf81('0x8c')]['id'],JSON['stringify'](_0x24807f['body']),JSON[_0xaf81('0xe3')](_0x48fccb)]);_0x349554['on']('message',function(_0x43707e){_0x1e2641=!![];return _0x5e444b['status'](0xc8)[_0xaf81('0x1f')]({'message':_0xaf81('0xe4'),'pid':_0x349554[_0xaf81('0xe5')]});});_0x349554['on'](_0xaf81('0xe6'),function(_0x818679){if(_0x818679&&!_0x1e2641){return _0x5e444b[_0xaf81('0x1e')](0x1f4)['json']({'message':_0xaf81('0xe7'),'pid':_0x349554['pid']});}});})['catch'](handleError(_0x5e444b,null));};exports[_0xaf81('0xe8')]=function(_0x3c3b7a,_0x344902){var _0x521f2c=[_0xaf81('0xe9'),'chat','sms','openchannel',_0xaf81('0xea'),'whatsapp',_0xaf81('0xeb')];var _0x2ba9b6={'offset':0x0,'order':qs[_0xaf81('0x3e')](_0xaf81('0xec'))},_0x18ec12={'count':0x0,'rows':[]};Promise['resolve']()[_0xaf81('0x27')](function(){if(_0x3c3b7a['query']['channel']){if(!_[_0xaf81('0xed')](_0x521f2c,_0x3c3b7a[_0xaf81('0x36')][_0xaf81('0xee')][_0xaf81('0xef')]())){throw new Error(_0xaf81('0xf0'));}_0x521f2c=[_0x3c3b7a[_0xaf81('0x36')][_0xaf81('0xee')][_0xaf81('0xef')]()];}if(_0x3c3b7a[_0xaf81('0x36')][_0xaf81('0xf1')]){try{var _0x1db11d=JSON[_0xaf81('0xf2')](_0x3c3b7a[_0xaf81('0x36')]['range']);if(!moment(_0x1db11d['from'])[_0xaf81('0xf3')]()){throw new Error(_0xaf81('0xf4'));}if(!moment(_0x1db11d['to'])[_0xaf81('0xf3')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x4c18d4){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x3c3b7a[_0xaf81('0x36')][_0xaf81('0x3c')](_0xaf81('0xc5'))){_0x2ba9b6[_0xaf81('0x21')]=qs[_0xaf81('0x21')](_0x3c3b7a[_0xaf81('0x36')][_0xaf81('0x21')]||0xa);_0x2ba9b6[_0xaf81('0x20')]=qs[_0xaf81('0x20')](_0x3c3b7a[_0xaf81('0x36')][_0xaf81('0x20')]);}var _0x4120e6=_0x521f2c[_0xaf81('0x5d')](function(_0x469a0f){if(_0x469a0f==='voice'){var _0x657dcb={'attributes':['id',_0xaf81('0xf5'),_0xaf81('0x34'),'source',_0xaf81('0xf6'),_0xaf81('0xf7'),'starttime',_0xaf81('0xf8'),_0xaf81('0xf9'),_0xaf81('0xfa'),'createdAt',_0xaf81('0xfb'),_0xaf81('0xfc'),'userThirdDisposition',_0xaf81('0xfd')],'where':{'ContactId':_0x3c3b7a['params']['id']},'include':[{'model':db['User'],'as':_0xaf81('0x54'),'attributes':['id',_0xaf81('0x2a'),'fullname','alias']}],'order':[['createdAt',_0xaf81('0xfe')]]};if(_0x3c3b7a[_0xaf81('0x36')][_0xaf81('0xf1')]){_0x657dcb[_0xaf81('0x3f')][_0xaf81('0xff')]={'$gte':_0x1db11d['from'],'$lte':_0x1db11d['to']};}return db[_0xaf81('0xab')][_0xaf81('0x100')](_0x657dcb)[_0xaf81('0x27')](function(_0x2d2995){_0x18ec12[_0xaf81('0x23')]+=_0x2d2995[_0xaf81('0x23')];return _[_0xaf81('0x5d')](_0x2d2995['rows'],function(_0x18d37d){var _0x13f0b7=_0x18d37d[_0xaf81('0x97')]({'plain':!![]});_0x13f0b7[_0xaf81('0xee')]=_0x469a0f;if(_0x13f0b7['User']){_0x13f0b7[_0xaf81('0x54')]={'id':_0x13f0b7['User']['id'],'name':_0x13f0b7[_0xaf81('0x54')][_0xaf81('0x2a')],'fullname':_0x13f0b7[_0xaf81('0x54')][_0xaf81('0x101')],'alias':_0x13f0b7['User'][_0xaf81('0x94')]};}return _0x13f0b7;});});}else{var _0x1a3cbb=_[_0xaf81('0x102')](_0x469a0f)+(_0x469a0f===_0xaf81('0x103')?_0xaf81('0x104'):_0xaf81('0x105'));var _0x4a6b2f={'attributes':['id',_0xaf81('0x106'),_0xaf81('0x107'),_0xaf81('0xff'),_0xaf81('0xfa'),'disposition','secondDisposition',_0xaf81('0x108'),_0xaf81('0xfd'),_0x1a3cbb+'Id'],'where':{'ContactId':_0x3c3b7a[_0xaf81('0x8c')]['id']},'include':[{'model':db[_0x1a3cbb],'as':_0xaf81('0x105'),'attributes':['id',_0xaf81('0x2a'),_0xaf81('0x109')]},{'model':db[_0xaf81('0x54')],'as':_0xaf81('0x10a'),'attributes':['id',_0xaf81('0x2a'),_0xaf81('0x101')]},{'model':db[_0xaf81('0xb9')],'as':_0xaf81('0x88'),'attributes':['id',_0xaf81('0x2a'),'color'],'through':{'attributes':[]}}],'order':[[_0xaf81('0xff'),'DESC']]};if(_0x3c3b7a[_0xaf81('0x36')]['range']){_0x4a6b2f['where']['createdAt']={'$gte':_0x1db11d['from'],'$lte':_0x1db11d['to']};}switch(_0x469a0f){case _0xaf81('0x103'):_0x4a6b2f[_0xaf81('0x39')][_0xaf81('0x30')](_0xaf81('0x10b'),_0xaf81('0x10c'),_0xaf81('0x10d'),'deviceModel',_0xaf81('0x10e'),'ratingMessage',_0xaf81('0x10f'),'ratingValue',_0xaf81('0x110'));break;case _0xaf81('0xe9'):_0x4a6b2f[_0xaf81('0x39')]['push'](_0xaf81('0x111'),_0xaf81('0x112'));break;case _0xaf81('0x113'):_0x4a6b2f[_0xaf81('0x39')][_0xaf81('0x30')]('externalUrl','threadId');break;}return db[_['startCase'](_0x469a0f)+'Interaction']['findAndCountAll'](_0x4a6b2f)[_0xaf81('0x27')](function(_0x5e64ee){_0x18ec12[_0xaf81('0x23')]+=_0x5e64ee[_0xaf81('0x23')];return _[_0xaf81('0x5d')](_0x5e64ee[_0xaf81('0x89')],function(_0x329cd1){var _0x87f34a=_0x329cd1[_0xaf81('0x97')]({'plain':!![]});_0x87f34a[_0xaf81('0xee')]=_0x469a0f;if(_0x87f34a['Owner']){_0x87f34a[_0xaf81('0x10a')]={'id':_0x87f34a[_0xaf81('0x10a')]['id'],'name':_0x87f34a['Owner']['name'],'fullname':_0x87f34a['Owner'][_0xaf81('0x101')]};}return _0x87f34a;});});}});return Promise['all'](_0x4120e6);})[_0xaf81('0x27')](function(_0x3ce365){return _(_0x3ce365)[_0xaf81('0x114')]()[_0xaf81('0x115')]('createdAt')[_0xaf81('0x116')]()[_0xaf81('0x50')]();})[_0xaf81('0x27')](function(_0x5386a8){_0x18ec12[_0xaf81('0x89')]=_0x2ba9b6[_0xaf81('0x21')]?_0x5386a8[_0xaf81('0x117')](_0x2ba9b6['offset'],_0x2ba9b6[_0xaf81('0x20')]+_0x2ba9b6[_0xaf81('0x21')]):_0x5386a8;return _0x18ec12;})['then'](respondWithFilteredResult(_0x344902,_0x2ba9b6))[_0xaf81('0x8a')](handleError(_0x344902,null));};
\ No newline at end of file
+var _0xc9f1=['FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','each','duplicates','$or','push','findOrCreate','spread','error','show','find','$and','omit','format','startsWith','table','setFields','id\x20=\x20?','toParam','text','phone','findOne','rawAttributes','pick','options','getTags','setTags','ids','include','ContactId','includeAll','getHopperFinals','CmHopperFinal','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','server/files/tmp','file','filename','chmodSync','0777','child_process','fork','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','import','binding','No\x20firstName\x20column\x20specified','stringify','message','start\x20child\x20process\x20correctly!','getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','duration','createdAt','userSecondDisposition','UserId','fullname','DESC','findAndCountAll','startCase','Website','Account','closed','closedAt','note','disposition','secondDisposition','key','Owner','browserName','customerIp','osName','ratingMessage','ratingType','ratingValue','referer','mail','substatus','externalUrl','Interaction','flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','describe','keys','length','cf_','CmCustomField','trimStart','all','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','select','field','color','from','tools_tags','cm_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','left_join','t.id\x20=\x20ct.TagId','expr','search','sqlOperator','conditions','Tag','value','split','forEach','and','uc.UserId\x20=\x20?','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','map','isNil','Contact','ListId','concat','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','clone','isEmpty','having','t.id\x20IN\x20?','resolve','user','User','getLists','c.ListId\x20IS\x20NULL','role','agent','sequelize','toString','keyBy','merge','CmContact','c.firstName','c.phone','c.mobile','c.email','c.ListId','c.createdAt','c.CompanyId','TagIds','Tags','rows','catch','params','tags','columnName','displayName','findAll','alias','values','body','get','mergeWith','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage'];(function(_0x6da29c,_0x4951a0){var _0xed78dc=function(_0x1bbb8a){while(--_0x1bbb8a){_0x6da29c['push'](_0x6da29c['shift']());}};_0xed78dc(++_0x4951a0);}(_0xc9f1,0x79));var _0x1c9f=function(_0x2e02ec,_0x16cb09){_0x2e02ec=_0x2e02ec-0x0;var _0x4fd6bb=_0xc9f1[_0x2e02ec];return _0x4fd6bb;};'use strict';var emlformat=require(_0x1c9f('0x0'));var rimraf=require(_0x1c9f('0x1'));var zipdir=require(_0x1c9f('0x2'));var jsonpatch=require(_0x1c9f('0x3'));var rp=require('request-promise');var moment=require(_0x1c9f('0x4'));var BPromise=require(_0x1c9f('0x5'));var Mustache=require('mustache');var util=require(_0x1c9f('0x6'));var path=require(_0x1c9f('0x7'));var sox=require(_0x1c9f('0x8'));var csv=require('to-csv');var ejs=require(_0x1c9f('0x9'));var fs=require('fs');var fs_extra=require(_0x1c9f('0xa'));var _=require(_0x1c9f('0xb'));var squel=require('squel');var crypto=require(_0x1c9f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1c9f('0xd'));var querystring=require(_0x1c9f('0xe'));var Papa=require(_0x1c9f('0xf'));var Redis=require(_0x1c9f('0x10'));var authService=require(_0x1c9f('0x11'));var qs=require(_0x1c9f('0x12'));var as=require(_0x1c9f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1c9f('0x14'));var utils=require(_0x1c9f('0x15'));var config=require(_0x1c9f('0x16'));var licenseUtil=require(_0x1c9f('0x17'));var db=require(_0x1c9f('0x18'))['db'];config[_0x1c9f('0x19')]=_[_0x1c9f('0x1a')](config[_0x1c9f('0x19')],{'host':_0x1c9f('0x1b'),'port':0x18eb});var socket=require(_0x1c9f('0x1c'))(new Redis(config[_0x1c9f('0x19')]));require(_0x1c9f('0x1d'))[_0x1c9f('0x1e')](socket);function respondWithStatusCode(_0x245692,_0x136af8){_0x136af8=_0x136af8||0xcc;return function(_0x41b9f9){if(_0x41b9f9){return _0x245692[_0x1c9f('0x1f')](_0x136af8);}return _0x245692[_0x1c9f('0x20')](_0x136af8)[_0x1c9f('0x21')]();};}function respondWithResult(_0x351606,_0x2781f2){_0x2781f2=_0x2781f2||0xc8;return function(_0x356916){if(_0x356916){return _0x351606['status'](_0x2781f2)[_0x1c9f('0x22')](_0x356916);}};}function respondWithFilteredResult(_0x4c9cb3,_0x4b2046){return function(_0x448962){if(_0x448962){var _0x2cce82=typeof _0x4b2046[_0x1c9f('0x23')]==='undefined'&&typeof _0x4b2046['limit']===_0x1c9f('0x24');var _0x476c5d=_0x448962['count'];var _0xb2adc0=_0x2cce82?0x0:_0x4b2046[_0x1c9f('0x23')];var _0x58760e=_0x2cce82?_0x448962[_0x1c9f('0x25')]:_0x4b2046[_0x1c9f('0x23')]+_0x4b2046[_0x1c9f('0x26')];var _0x21a9f4;if(_0x58760e>=_0x476c5d){_0x58760e=_0x476c5d;_0x21a9f4=0xc8;}else{_0x21a9f4=0xce;}_0x4c9cb3[_0x1c9f('0x20')](_0x21a9f4);return _0x4c9cb3[_0x1c9f('0x27')](_0x1c9f('0x28'),_0xb2adc0+'-'+_0x58760e+'/'+_0x476c5d)[_0x1c9f('0x22')](_0x448962);}return null;};}function patchUpdates(_0x2be303){return function(_0x17d4b7){try{jsonpatch[_0x1c9f('0x29')](_0x17d4b7,_0x2be303,!![]);}catch(_0x27a131){return BPromise[_0x1c9f('0x2a')](_0x27a131);}return _0x17d4b7['save']();};}function saveUpdates(_0x54920c,_0x2e2420){return function(_0x24ea54){if(_0x24ea54){return _0x24ea54[_0x1c9f('0x2b')](_0x54920c)[_0x1c9f('0x2c')](function(_0x220744){return _0x220744;});}return null;};}function removeEntity(_0x39d79d,_0xbd93e9){return function(_0x5d7b88){if(_0x5d7b88){return _0x5d7b88[_0x1c9f('0x2d')]()[_0x1c9f('0x2c')](function(){_0x39d79d[_0x1c9f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37bafc,_0x4d4205){return function(_0xa08f62){if(!_0xa08f62){_0x37bafc[_0x1c9f('0x1f')](0x194);}return _0xa08f62;};}function handleError(_0x4ad3aa,_0x118bdf){_0x118bdf=_0x118bdf||0x1f4;return function(_0x79b0b){logger['error'](_0x79b0b[_0x1c9f('0x2e')]);if(_0x79b0b[_0x1c9f('0x2f')]){delete _0x79b0b[_0x1c9f('0x2f')];}_0x4ad3aa[_0x1c9f('0x20')](_0x118bdf)[_0x1c9f('0x30')](_0x79b0b);};}exports[_0x1c9f('0x31')]=function(_0x4fff97,_0x1ac87d){var _0x266804={},_0x899926={},_0xd00d83={'count':0x0,'rows':[]};return db['CmContact'][_0x1c9f('0x32')]()['then'](function(_0x21e00d){var _0x131de0=[];for(var _0x3093d5=0x0;_0x3093d5<Object[_0x1c9f('0x33')](_0x21e00d)[_0x1c9f('0x34')];_0x3093d5++){var _0x329bcb=Object[_0x1c9f('0x33')](_0x21e00d)[_0x3093d5];if(_['startsWith'](_0x329bcb,_0x1c9f('0x35'))){_0x131de0['push'](db[_0x1c9f('0x36')]['findOne']({'where':{'id':_[_0x1c9f('0x37')](_0x329bcb,'cf_')},'raw':!![]}));}}return BPromise[_0x1c9f('0x38')](_0x131de0)[_0x1c9f('0x2c')](function(_0x5dd789){for(var _0x94bc8f=0x0;_0x94bc8f<_0x5dd789[_0x1c9f('0x34')];_0x94bc8f++){if(_0x5dd789[_0x94bc8f]){var _0x484cd9=_0x1c9f('0x35')+_0x5dd789[_0x94bc8f]['id'];var _0xf93384=_0x21e00d[_0x484cd9];_0xf93384['fieldType']=_0x5dd789[_0x94bc8f]['type'];}}return _0x21e00d;});})['then'](function(_0xde894){_0x899926[_0x1c9f('0x39')]=_[_0x1c9f('0x33')](_0xde894);_0x899926[_0x1c9f('0x3a')]=_[_0x1c9f('0x33')](_0x4fff97['query']);_0x899926[_0x1c9f('0x3b')]=_['intersection'](_0x899926[_0x1c9f('0x39')],_0x899926[_0x1c9f('0x3a')]);_0x266804[_0x1c9f('0x3c')]=_[_0x1c9f('0x3d')](_0x899926[_0x1c9f('0x39')],qs[_0x1c9f('0x3e')](_0x4fff97['query'][_0x1c9f('0x3e')]));_0x266804[_0x1c9f('0x3c')]=_0x266804['attributes']['length']?_0x266804[_0x1c9f('0x3c')]:_0x899926[_0x1c9f('0x39')];if(!_0x4fff97[_0x1c9f('0x3a')][_0x1c9f('0x3f')](_0x1c9f('0x40'))){_0x266804[_0x1c9f('0x26')]=qs[_0x1c9f('0x26')](_0x4fff97['query']['limit']);_0x266804[_0x1c9f('0x23')]=qs['offset'](_0x4fff97[_0x1c9f('0x3a')][_0x1c9f('0x23')]);}_0x266804[_0x1c9f('0x41')]=qs[_0x1c9f('0x42')](_0x4fff97[_0x1c9f('0x3a')]['sort']);_0x266804[_0x1c9f('0x43')]=qs['filters'](_['pick'](_0x4fff97[_0x1c9f('0x3a')],_0x899926['filters']),_0xde894);var _0x4cec27=[];var _0x474fec=squel[_0x1c9f('0x44')]()[_0x1c9f('0x45')]('id')[_0x1c9f('0x45')]('name')[_0x1c9f('0x45')](_0x1c9f('0x46'))[_0x1c9f('0x47')](_0x1c9f('0x48'));var _0x4734ba=squel[_0x1c9f('0x44')]()[_0x1c9f('0x47')](_0x1c9f('0x49'),'c')['left_join']('cm_user_has_contacts','uc',_0x1c9f('0x4a'))['left_join'](_0x1c9f('0x4b'),'ct',_0x1c9f('0x4c'))[_0x1c9f('0x4d')](_0x1c9f('0x48'),'t',_0x1c9f('0x4e'))[_0x1c9f('0x43')]('c.deletedAt\x20IS\x20NULL');var _0x52cb69=squel[_0x1c9f('0x4f')]();var _0x28e87f=[];var _0x17b90a=squel[_0x1c9f('0x4f')]();var _0x372429;if(_0x4fff97['query']['search']){_0x372429=as['parseSearch'](_0x4fff97[_0x1c9f('0x3a')][_0x1c9f('0x50')]);var _0x5ac71c=_0x372429[_0x1c9f('0x51')];for(var _0x42e136=0x0;_0x42e136<_0x372429[_0x1c9f('0x52')]['length'];_0x42e136++){var _0x3d8a15=_0x372429[_0x1c9f('0x52')][_0x42e136];var _0x2a7142='c';var _0x29c233=_(_0xde894)['keys']()['find'](function(_0x192e5f){return _0x192e5f===_0x3d8a15[_0x1c9f('0x45')];});if(_0x29c233)_0x29c233=_0xde894[_0x3d8a15[_0x1c9f('0x45')]];if(!_0x29c233){if(_0x3d8a15[_0x1c9f('0x45')]===_0x1c9f('0x53')){var _0x5cf36b=_0x3d8a15[_0x1c9f('0x54')][_0x1c9f('0x55')](',')['map'](function(_0x342460){return Number(_0x342460);});_0x5cf36b[_0x1c9f('0x56')](function(_0x238fad){_0x17b90a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x238fad+',%');});_0x28e87f=_['union'](_0x28e87f,_0x5cf36b);}else if(_0x3d8a15[_0x1c9f('0x45')]==='User'){_0x52cb69[_0x1c9f('0x57')](_0x1c9f('0x58'),_0x3d8a15[_0x1c9f('0x54')]);}}else{if(_0x3d8a15[_0x1c9f('0x45')]===_0x1c9f('0x59')||_0x29c233[_0x1c9f('0x5a')]===_0x1c9f('0x5b'))_0x3d8a15[_0x1c9f('0x5c')]=_0x1c9f('0x5d');var _0x5f310e=as[_0x1c9f('0x5e')](_0x2a7142,_0x29c233[_0x1c9f('0x5f')],_0x3d8a15);_0x52cb69[_0x5ac71c](_0x5f310e['text'],_0x5f310e[_0x1c9f('0x54')]['start'],_0x5f310e[_0x1c9f('0x54')][_0x1c9f('0x21')]);}}}else{var _0xc1d5e1=_(Object[_0x1c9f('0x33')](_0x4fff97[_0x1c9f('0x3a')]))[_0x1c9f('0x60')](function(_0x32b252){return _0xde894[_0x1c9f('0x3f')](_0x32b252)?_0x32b252:undefined;})['filter'](function(_0x48b5ba){return!_[_0x1c9f('0x61')](_0x48b5ba);})[_0x1c9f('0x54')]();if(_0x4fff97[_0x1c9f('0x3a')][_0x1c9f('0x62')])_0xc1d5e1['push'](_0x1c9f('0x62'));if(!_['isEmpty'](_0xc1d5e1)){_0xc1d5e1[_0x1c9f('0x56')](function(_0x6458ee){if(_0x6458ee===_0x1c9f('0x63')){_0x4734ba['where']('c.ListId\x20IN\x20?',[][_0x1c9f('0x64')](_0x4fff97[_0x1c9f('0x3a')][_0x6458ee]));}else if(_0x6458ee==='Contact'){var _0x53f82d='%'+_0x4fff97[_0x1c9f('0x3a')][_0x6458ee]+'%';_0x4734ba[_0x1c9f('0x43')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x53f82d);}else{_0x4734ba['where']('c.'+_0x6458ee+'\x20=\x20?',_0x4fff97[_0x1c9f('0x3a')][_0x6458ee]);}});}if(_0x4fff97['query']['tag']){_0x28e87f=_[_0x1c9f('0x65')](_0x4fff97[_0x1c9f('0x3a')][_0x1c9f('0x66')])?_0x4fff97[_0x1c9f('0x3a')][_0x1c9f('0x66')]:new Array(_0x4fff97[_0x1c9f('0x3a')]['tag']);_0x28e87f[_0x1c9f('0x56')](function(_0x4dcd34){_0x17b90a['or'](_0x1c9f('0x67'),'%,'+_0x4dcd34+',%');});}if(_0x4fff97[_0x1c9f('0x3a')][_0x1c9f('0x68')]){var _0x2581cf=_0x4fff97[_0x1c9f('0x3a')][_0x1c9f('0x68')]['replace']('\x5c','\x5c\x5c')[_0x1c9f('0x69')](/'/g,'\x27\x27');if(_0x2581cf[_0x1c9f('0x55')]('\x20')[_0x1c9f('0x34')]>0x1){_0x52cb69['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1c9f('0x6a')](_0x2581cf),null);}else{if(qs[_0x1c9f('0x6b')](_0x2581cf)){_0x52cb69['or'](_0x1c9f('0x6c'),_0x2581cf+'%');_0x52cb69['or']('c.phone\x20LIKE\x20?',_0x2581cf+'%');_0x52cb69['or'](_0x1c9f('0x6d'),_0x2581cf+'%');_0x52cb69['or'](_0x1c9f('0x6e'),_0x2581cf+'%');}else if(qs[_0x1c9f('0x6f')](_0x2581cf)){_0x52cb69['or'](_0x1c9f('0x70'),_0x2581cf+'%');}else{_0x52cb69['or']('c.firstName\x20LIKE\x20?','%'+_0x2581cf+'%');_0x52cb69['or'](_0x1c9f('0x71'),'%'+_0x2581cf+'%');_0x52cb69['or'](_0x1c9f('0x70'),'%'+_0x2581cf+'%');}}}}_0x4734ba['where'](_0x52cb69);_0x4734ba['group'](_0x1c9f('0x72'));var _0x1c63e9={'type':db[_0x1c9f('0x73')][_0x1c9f('0x74')]['SELECT'],'raw':!![]};var _0x14a68f=_0x4734ba[_0x1c9f('0x75')]()[_0x1c9f('0x45')](_0x1c9f('0x72'));if(_0x266804[_0x1c9f('0x41')]){_0x266804[_0x1c9f('0x41')]['forEach'](function(_0x37ceda){_0x4734ba[_0x1c9f('0x41')]('c.'+_0x37ceda[0x0],_0x37ceda[0x1]==='DESC'?![]:!![]);});}if(!_[_0x1c9f('0x76')](_0x28e87f)){_0x4734ba[_0x1c9f('0x77')](_0x17b90a);_0x14a68f[_0x1c9f('0x43')](_0x1c9f('0x78'),_0x28e87f);}BPromise[_0x1c9f('0x79')]()['then'](function(){if(!_0x372429)return;if(_0x4fff97[_0x1c9f('0x7a')]['role']!=='agent')return;if(!_['some'](_0x372429['conditions'],[_0x1c9f('0x45'),_0x1c9f('0x7b')])){return _0x4fff97['user'][_0x1c9f('0x7c')]({'attributes':['id'],'raw':!![]})['then'](function(_0x36137f){if(_[_0x1c9f('0x76')](_0x36137f)){_0x14a68f[_0x1c9f('0x43')](_0x1c9f('0x7d'));_0x4734ba[_0x1c9f('0x43')](_0x1c9f('0x7d'));}else{_0x14a68f[_0x1c9f('0x43')]('c.ListId\x20IN\x20?',_['map'](_0x36137f,'id'));_0x4734ba[_0x1c9f('0x43')]('c.ListId\x20IN\x20?',_[_0x1c9f('0x60')](_0x36137f,'id'));}});}})['then'](function(){if(_0x4fff97['user'][_0x1c9f('0x7e')]===_0x1c9f('0x7f')&&!_0x372429&&!_0x4fff97['query'][_0x1c9f('0x63')])return[];return db[_0x1c9f('0x80')][_0x1c9f('0x3a')](_0x14a68f['toString'](),_0x1c63e9);})[_0x1c9f('0x2c')](function(_0x5c0fd6){_0xd00d83[_0x1c9f('0x25')]=_0x5c0fd6[_0x1c9f('0x34')];if(_0xd00d83[_0x1c9f('0x25')]===0x0)return[];return db['sequelize']['query'](_0x474fec[_0x1c9f('0x81')](),_0x1c63e9)[_0x1c9f('0x2c')](function(_0x565546){_0x4cec27=_[_0x1c9f('0x82')](_0x565546,'id');_0x1c63e9=_[_0x1c9f('0x83')](_0x1c63e9,{'model':db[_0x1c9f('0x84')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4fff97[_0x1c9f('0x3a')][_0x1c9f('0x3e')]){_0x266804[_0x1c9f('0x3c')][_0x1c9f('0x56')](function(_0x3604ad){_0x4734ba['field']('c.'+_0x3604ad);});}else{_0x4734ba[_0x1c9f('0x45')]('c.id');_0x4734ba[_0x1c9f('0x45')](_0x1c9f('0x85'));_0x4734ba[_0x1c9f('0x45')]('c.lastName');_0x4734ba['field'](_0x1c9f('0x86'));_0x4734ba[_0x1c9f('0x45')](_0x1c9f('0x87'));_0x4734ba[_0x1c9f('0x45')]('c.fax');_0x4734ba['field'](_0x1c9f('0x88'));_0x4734ba[_0x1c9f('0x45')](_0x1c9f('0x89'));_0x4734ba['field'](_0x1c9f('0x8a'));_0x4734ba[_0x1c9f('0x45')]('c.deletedAt');_0x4734ba[_0x1c9f('0x45')](_0x1c9f('0x8b'));_0x4734ba[_0x1c9f('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x266804['limit'])_0x4734ba['limit'](_0x266804[_0x1c9f('0x26')]);if(_0x266804[_0x1c9f('0x23')])_0x4734ba['offset'](_0x266804['offset']);return db[_0x1c9f('0x80')][_0x1c9f('0x3a')](_0x4734ba['toString'](),_0x1c63e9);});})[_0x1c9f('0x2c')](function(_0x3b7994){_0x3b7994[_0x1c9f('0x56')](function(_0x39de02){if(_0x39de02[_0x1c9f('0x8c')]){_0x39de02[_0x1c9f('0x8d')]=[];_0x39de02['TagIds']['split'](',')[_0x1c9f('0x56')](function(_0x51bf80){_0x39de02[_0x1c9f('0x8d')]['push'](_0x4cec27[_0x51bf80]);});}delete _0x39de02[_0x1c9f('0x8c')];});_0xd00d83[_0x1c9f('0x8e')]=_0x3b7994;return _0xd00d83;})[_0x1c9f('0x2c')](respondWithFilteredResult(_0x1ac87d,_0x266804));})[_0x1c9f('0x8f')](handleError(_0x1ac87d,null));};exports[_0x1c9f('0x2d')]=function(_0xdc2a43,_0x5f079d){return db[_0x1c9f('0x84')]['find']({'where':{'id':_0xdc2a43[_0x1c9f('0x90')]['id']}})[_0x1c9f('0x2c')](handleEntityNotFound(_0x5f079d,null))[_0x1c9f('0x2c')](removeEntity(_0x5f079d,null))[_0x1c9f('0x8f')](handleError(_0x5f079d,null));};exports['describe']=function(_0x446169,_0x100f30){return db[_0x1c9f('0x84')]['describe']()[_0x1c9f('0x2c')](function(_0x1dac12){delete _0x1dac12[_0x1c9f('0x91')];for(var _0x4bc3b1=0x0;_0x4bc3b1<Object[_0x1c9f('0x33')](_0x1dac12)['length'];_0x4bc3b1++){var _0x4b631b=Object[_0x1c9f('0x33')](_0x1dac12)[_0x4bc3b1];if(!_['startsWith'](_0x4b631b,_0x1c9f('0x35'))){_0x1dac12[_0x4b631b][_0x1c9f('0x92')]=_0x4b631b;_0x1dac12[_0x4b631b][_0x1c9f('0x93')]=_0x4b631b;}}return _0x1dac12;})[_0x1c9f('0x2c')](function(_0x130727){var _0x3bf522={'where':{'$or':[{'ListId':_0x446169[_0x1c9f('0x3a')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x1c9f('0x36')][_0x1c9f('0x94')](_0x3bf522)['then'](function(_0x38e2ec){for(var _0x15b661=0x0;_0x15b661<_0x38e2ec[_0x1c9f('0x34')];_0x15b661++){var _0x1d9379='cf_'+_0x38e2ec[_0x15b661]['id'];_0x130727[_0x1d9379][_0x1c9f('0x92')]=_0x1d9379;_0x130727[_0x1d9379]['displayName']=_0x38e2ec[_0x15b661][_0x1c9f('0x95')];_0x130727[_0x1d9379]['custom']={'type':_0x38e2ec[_0x15b661][_0x1c9f('0x5f')],'values':_0x38e2ec[_0x15b661][_0x1c9f('0x96')]};}Object[_0x1c9f('0x33')](_0x130727)[_0x1c9f('0x56')](function(_0xa0d2a3){if(!_0x130727[_0xa0d2a3]['hasOwnProperty']('columnName')){delete _0x130727[_0xa0d2a3];}});return _0x130727;});})[_0x1c9f('0x2c')](respondWithResult(_0x100f30,null))['catch'](handleError(_0x100f30,null));};exports[_0x1c9f('0x83')]=function(_0x1a0291,_0x238066){var _0x206c71;var _0x9cc53f;var _0x1637a6;if(_0x1a0291[_0x1c9f('0x97')]['id']){delete _0x1a0291[_0x1c9f('0x97')]['id'];}return db[_0x1c9f('0x84')]['findAll']({'where':{'id':[_0x1a0291[_0x1c9f('0x97')]['to'],_0x1a0291[_0x1c9f('0x97')]['from']]}})[_0x1c9f('0x2c')](function(_0x1db4fa){if(_0x1db4fa){if(_0x1db4fa[_0x1c9f('0x34')]!==0x2){return null;}_0x1db4fa[0x0]=_0x1db4fa[0x0][_0x1c9f('0x98')]({'plain':!![]});_0x1db4fa[0x1]=_0x1db4fa[0x1]['get']({'plain':!![]});delete _0x1db4fa[0x0]['id'];delete _0x1db4fa[0x1]['id'];return _[_0x1c9f('0x99')](_0x1db4fa[0x0],_0x1db4fa[0x1],function(_0xf70103,_0x208394){if(Array[_0x1c9f('0x65')](_0x208394)&&!_0x208394[_0x1c9f('0x34')]){return _0xf70103;}else if(!_0x208394){return _0xf70103;}});}})[_0x1c9f('0x2c')](handleEntityNotFound(_0x238066,null))['then'](function(_0x3234ac){if(_0x3234ac){if(_0x3234ac['tags']&&_['isArray'](_0x3234ac[_0x1c9f('0x91')])){_0x3234ac[_0x1c9f('0x91')]=_0x3234ac[_0x1c9f('0x91')][_0x1c9f('0x9a')]();}logger['info'](_0x1c9f('0x9b'),_0x1a0291[_0x1c9f('0x97')]['to'],_0x1a0291[_0x1c9f('0x97')][_0x1c9f('0x47')]);return db[_0x1c9f('0x9c')]['destroy']({'where':{'ContactId':[_0x1a0291[_0x1c9f('0x97')]['to'],_0x1a0291['body'][_0x1c9f('0x47')]]}})['then'](function(_0x201162){logger[_0x1c9f('0x9d')]('[CmContact][merge][destroy][CmHopper],\x20%s',_0x201162);return db[_0x1c9f('0x9e')][_0x1c9f('0x2d')]({'where':{'ContactId':[_0x1a0291['body']['to'],_0x1a0291[_0x1c9f('0x97')][_0x1c9f('0x47')]]}})[_0x1c9f('0x2c')](function(_0x3974ab){logger['info'](_0x1c9f('0x9f'),_0x3974ab);return db[_0x1c9f('0x84')][_0x1c9f('0xa0')](_0x3234ac);});});}})[_0x1c9f('0x2c')](function(_0x48ac05){if(_0x48ac05){_0x206c71=_0x48ac05;_0x9cc53f={'ContactId':_0x206c71['id']};_0x1637a6={'where':{'ContactId':[_0x1a0291[_0x1c9f('0x97')]['to'],_0x1a0291[_0x1c9f('0x97')]['from']]}};return db['ChatInteraction'][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})['then'](function(){if(_0x206c71){return db['ChatMessage']['update'](_0x9cc53f,_0x1637a6);}})['then'](function(){if(_0x206c71){return db[_0x1c9f('0xa1')]['update'](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db['MailInteraction'][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})['then'](function(){if(_0x206c71){return db[_0x1c9f('0xa2')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xa3')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xa2')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xa4')]['update'](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xa5')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})['then'](function(){if(_0x206c71){return db[_0x1c9f('0xa6')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db['FaxMessage'][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})['then'](function(){if(_0x206c71){return db[_0x1c9f('0xa7')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xa8')]['update'](_0x9cc53f,_0x1637a6);}})['then'](function(){if(_0x206c71){return db['CmHopperFinal']['update'](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xa9')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xaa')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})['then'](function(){if(_0x206c71){return db[_0x1c9f('0xab')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xac')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xad')]['update'](_0x9cc53f,_0x1637a6);}})['then'](function(){if(_0x206c71){return db[_0x1c9f('0xae')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})['then'](function(){if(_0x206c71){return db['OpenchannelQueueReport'][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xaf')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})['then'](function(){if(_0x206c71){return db[_0x1c9f('0xb0')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xb1')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xb2')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0xb3')][_0x1c9f('0x2b')](_0x9cc53f,_0x1637a6);}})[_0x1c9f('0x2c')](function(){if(_0x206c71){return db[_0x1c9f('0x84')]['destroy']({'where':{'id':[_0x1a0291[_0x1c9f('0x97')]['to'],_0x1a0291[_0x1c9f('0x97')][_0x1c9f('0x47')]]}});}})['then'](function(){if(_0x206c71){return _0x206c71;}})[_0x1c9f('0x2c')](respondWithResult(_0x238066,null))[_0x1c9f('0x8f')](handleError(_0x238066,null));};exports[_0x1c9f('0xa0')]=function(_0x21d625,_0x2a425c){return db['CmContact'][_0x1c9f('0x32')]()['then'](function(_0x14e0de){if(_0x21d625[_0x1c9f('0x97')][_0x1c9f('0x91')]&&_['isArray'](_0x21d625[_0x1c9f('0x97')][_0x1c9f('0x91')])){if(_0x21d625[_0x1c9f('0x97')][_0x1c9f('0x91')][_0x1c9f('0x34')]){_0x21d625[_0x1c9f('0x97')][_0x1c9f('0x91')]=_0x21d625[_0x1c9f('0x97')][_0x1c9f('0x91')][_0x1c9f('0x9a')](';')+';';}else{_0x21d625[_0x1c9f('0x97')][_0x1c9f('0x91')]=null;}}else{_0x21d625['body'][_0x1c9f('0x91')]=null;}return db[_0x1c9f('0x84')][_0x1c9f('0xa0')](_0x21d625[_0x1c9f('0x97')],{'fields':_[_0x1c9f('0x33')](_0x14e0de),'raw':!![]});})[_0x1c9f('0x2c')](respondWithResult(_0x2a425c,0xc9))[_0x1c9f('0x8f')](handleError(_0x2a425c,null));};exports['bulkCreate']=function(_0x16f435,_0x358141){var _0x3d8889=[];var _0x6c11ea=0x0;var _0x1e00ee=0x0;var _0x375b81=0x0;return db[_0x1c9f('0x84')]['describe']()[_0x1c9f('0x2c')](function(_0x438cd8){return BPromise[_0x1c9f('0xb4')](_0x16f435[_0x1c9f('0x97')],function(_0x2be4d5){var _0x54c820={'where':{'$or':[]},'defaults':_0x2be4d5,'fields':_[_0x1c9f('0x33')](_0x438cd8),'raw':!![]};if(_0x2be4d5['duplicates']){for(var _0x17cf8c=0x0;_0x17cf8c<_0x2be4d5[_0x1c9f('0xb5')]['length'];_0x17cf8c++){var _0x19d06c={};_0x19d06c[_0x2be4d5[_0x1c9f('0xb5')][_0x17cf8c]]=_0x2be4d5[_0x2be4d5[_0x1c9f('0xb5')][_0x17cf8c]];_0x54c820[_0x1c9f('0x43')][_0x1c9f('0xb6')][_0x1c9f('0xb7')](_0x19d06c);}_0x54c820[_0x1c9f('0x43')]['ListId']=_0x2be4d5[_0x1c9f('0x63')];}return db[_0x1c9f('0x84')][_0x1c9f('0xb8')](_0x54c820)[_0x1c9f('0xb9')](function(_0x3c2019,_0x38ff23){if(_0x38ff23){_0x6c11ea++;}else{_0x375b81++;}})[_0x1c9f('0x8f')](function(_0x2e0f5e){console[_0x1c9f('0xba')](_0x2e0f5e);_0x1e00ee++;});});})[_0x1c9f('0x2c')](function(_0x153f73){if(_0x153f73){return{'success':_0x6c11ea,'failure':_0x1e00ee,'duplicates':_0x375b81};}})['then'](respondWithResult(_0x358141,0xc9))[_0x1c9f('0x8f')](handleError(_0x358141,null));};exports[_0x1c9f('0xbb')]=function(_0x362950,_0x2be994,_0x59a2fa){var _0x2c3e6e;return db['CmContact'][_0x1c9f('0x32')]()['then'](function(_0x4a702e){return db['CmContact'][_0x1c9f('0xbc')]({'where':{'id':_0x362950[_0x1c9f('0x90')]['id']},'include':[{'model':db['Tag'],'as':'Tags','attributes':['id',_0x1c9f('0x2f'),_0x1c9f('0x46')],'required':_0x362950[_0x1c9f('0x3a')][_0x1c9f('0x66')]?!![]:![]}],'attributes':_[_0x1c9f('0x33')](_0x4a702e)});})[_0x1c9f('0x2c')](function(_0x12a967){_0x2c3e6e=_0x12a967['get']({'plain':!![]});var _0x367baa={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x12a967&&_0x12a967[_0x1c9f('0x63')]){if(_0x12a967[_0x1c9f('0x63')]){_0x367baa[_0x1c9f('0x43')][_0x1c9f('0xbd')]['push']({'ListId':{'$ne':_0x12a967[_0x1c9f('0x63')]}});}}return db[_0x1c9f('0x36')][_0x1c9f('0x94')](_0x367baa);})[_0x1c9f('0x2c')](function(_0x4995ac){return _[_0x1c9f('0xbe')](_0x2c3e6e,_[_0x1c9f('0x60')](_0x4995ac,function(_0xa69808){return util[_0x1c9f('0xbf')]('cf_%d',_0xa69808['id']);}));})[_0x1c9f('0x2c')](handleEntityNotFound(_0x2be994,null))[_0x1c9f('0x2c')](respondWithResult(_0x2be994,null))[_0x1c9f('0x8f')](handleError(_0x2be994,null));};exports[_0x1c9f('0x2b')]=function(_0x3f660f,_0x39225f){var _0x37bafe;if(_0x3f660f[_0x1c9f('0x97')]['id']){delete _0x3f660f[_0x1c9f('0x97')]['id'];}return db[_0x1c9f('0x84')][_0x1c9f('0xbc')]({'where':{'id':_0x3f660f[_0x1c9f('0x90')]['id']}})['then'](handleEntityNotFound(_0x39225f,null))[_0x1c9f('0x2c')](saveUpdates(_0x3f660f[_0x1c9f('0x97')],null))[_0x1c9f('0x2c')](function(_0x383302){_0x37bafe=_0x383302;var _0x104f52={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x383302&&_0x383302[_0x1c9f('0x63')]){if(_0x383302[_0x1c9f('0x63')]){_0x104f52[_0x1c9f('0x43')][_0x1c9f('0xbd')]['push']({'ListId':{'$ne':_0x383302[_0x1c9f('0x63')]}});}}return db[_0x1c9f('0x36')][_0x1c9f('0x94')](_0x104f52);})[_0x1c9f('0x2c')](function(_0x19797f){if(_0x19797f){return _[_0x1c9f('0xbe')](_['pickBy'](_0x3f660f['body'],function(_0x5e5b85,_0x28b998){return _[_0x1c9f('0xc0')](_0x28b998,_0x1c9f('0x35'));}),_[_0x1c9f('0x60')](_0x19797f,function(_0x38dba0){return util[_0x1c9f('0xbf')]('cf_%d',_0x38dba0['id']);}));}})['then'](function(_0x19504a){if(_0x19504a&&!_[_0x1c9f('0x76')](_0x19504a)){var _0x24519b=squel[_0x1c9f('0x2b')]()[_0x1c9f('0xc1')](_0x1c9f('0x49'))[_0x1c9f('0xc2')](_0x19504a)[_0x1c9f('0x43')](_0x1c9f('0xc3'),_0x3f660f[_0x1c9f('0x90')]['id'])[_0x1c9f('0xc4')]();return db['sequelize'][_0x1c9f('0x3a')](_0x24519b[_0x1c9f('0xc5')],{'replacements':_0x24519b['values']});}})['then'](function(){if(_0x3f660f[_0x1c9f('0x97')][_0x1c9f('0xc6')]&&_0x37bafe){return db[_0x1c9f('0x9c')][_0x1c9f('0x2b')]({'phone':_0x3f660f['body'][_0x1c9f('0xc6')]},{'where':{'ContactId':_0x37bafe['id']}});}})[_0x1c9f('0x2c')](function(){return _0x37bafe;})[_0x1c9f('0x2c')](respondWithResult(_0x39225f,null))[_0x1c9f('0x8f')](handleError(_0x39225f,null));};exports['getTags']=function(_0x26e5a3,_0xc2924c,_0x2193f4){var _0x4699d1={};var _0x12d76d={};var _0x4b555c;var _0x337278;return db[_0x1c9f('0x84')][_0x1c9f('0xc7')]({'where':{'id':_0x26e5a3[_0x1c9f('0x90')]['id']}})[_0x1c9f('0x2c')](handleEntityNotFound(_0xc2924c,null))['then'](function(_0x4270){if(_0x4270){_0x4b555c=_0x4270;_0x12d76d[_0x1c9f('0x39')]=_[_0x1c9f('0x33')](db[_0x1c9f('0x53')][_0x1c9f('0xc8')]);_0x12d76d['query']=_[_0x1c9f('0x33')](_0x26e5a3[_0x1c9f('0x3a')]);_0x12d76d[_0x1c9f('0x3b')]=_[_0x1c9f('0x3d')](_0x12d76d[_0x1c9f('0x39')],_0x12d76d[_0x1c9f('0x3a')]);_0x4699d1[_0x1c9f('0x3c')]=_[_0x1c9f('0x3d')](_0x12d76d[_0x1c9f('0x39')],qs[_0x1c9f('0x3e')](_0x26e5a3[_0x1c9f('0x3a')]['fields']));_0x4699d1['attributes']=_0x4699d1['attributes']['length']?_0x4699d1['attributes']:_0x12d76d['model'];_0x4699d1[_0x1c9f('0x41')]=qs[_0x1c9f('0x42')](_0x26e5a3[_0x1c9f('0x3a')][_0x1c9f('0x42')]);_0x4699d1[_0x1c9f('0x43')]=qs[_0x1c9f('0x3b')](_[_0x1c9f('0xc9')](_0x26e5a3[_0x1c9f('0x3a')],_0x12d76d['filters']));if(_0x26e5a3[_0x1c9f('0x3a')][_0x1c9f('0x68')]){_0x4699d1[_0x1c9f('0x43')]=_[_0x1c9f('0x83')](_0x4699d1[_0x1c9f('0x43')],{'$or':_[_0x1c9f('0x60')](_0x4699d1['attributes'],function(_0x2466b1){var _0x2350d8={};_0x2350d8[_0x2466b1]={'$like':'%'+_0x26e5a3[_0x1c9f('0x3a')][_0x1c9f('0x68')]+'%'};return _0x2350d8;})});}_0x4699d1=_[_0x1c9f('0x83')]({},_0x4699d1,_0x26e5a3[_0x1c9f('0xca')]);return _0x4b555c[_0x1c9f('0xcb')](_0x4699d1);}})[_0x1c9f('0x2c')](function(_0x11c756){if(_0x11c756){_0x337278=_0x11c756[_0x1c9f('0x34')];if(!_0x26e5a3[_0x1c9f('0x3a')][_0x1c9f('0x3f')](_0x1c9f('0x40'))){_0x4699d1[_0x1c9f('0x26')]=qs[_0x1c9f('0x26')](_0x26e5a3[_0x1c9f('0x3a')][_0x1c9f('0x26')]);_0x4699d1[_0x1c9f('0x23')]=qs[_0x1c9f('0x23')](_0x26e5a3[_0x1c9f('0x3a')][_0x1c9f('0x23')]);}return _0x4b555c[_0x1c9f('0xcb')](_0x4699d1);}})[_0x1c9f('0x2c')](function(_0x255e25){if(_0x255e25){return _0x255e25?{'count':_0x337278,'rows':_0x255e25}:null;}})[_0x1c9f('0x2c')](respondWithResult(_0xc2924c,null))[_0x1c9f('0x8f')](handleError(_0xc2924c,null));};exports[_0x1c9f('0xcc')]=function(_0x533f9e,_0x447649,_0x485237){if(_0x533f9e[_0x1c9f('0x97')]['id']){delete _0x533f9e[_0x1c9f('0x97')]['id'];}return db['CmContact'][_0x1c9f('0xc7')]({'where':{'id':_0x533f9e[_0x1c9f('0x90')]['id']}})['then'](handleEntityNotFound(_0x447649,null))[_0x1c9f('0x2c')](function(_0x2a5082){if(_0x2a5082){return _0x2a5082['setTags'](_0x533f9e[_0x1c9f('0x97')][_0x1c9f('0xcd')]||[]);}return null;})[_0x1c9f('0x2c')](respondWithResult(_0x447649,null))[_0x1c9f('0x8f')](handleError(_0x447649,null));};exports['getHoppers']=function(_0x17b6a8,_0x24dac9,_0x46d930){var _0x1ad694={'raw':![],'where':{}};var _0x317ceb={};var _0x2506d0={'count':0x0,'rows':[]};return db[_0x1c9f('0x84')][_0x1c9f('0xc7')]({'where':{'id':_0x17b6a8[_0x1c9f('0x90')]['id']}})[_0x1c9f('0x2c')](handleEntityNotFound(_0x24dac9,null))[_0x1c9f('0x2c')](function(_0x3b7088){if(_0x3b7088){_0x317ceb[_0x1c9f('0x39')]=_[_0x1c9f('0x33')](db[_0x1c9f('0x9c')][_0x1c9f('0xc8')]);_0x317ceb[_0x1c9f('0x3a')]=_['keys'](_0x17b6a8[_0x1c9f('0x3a')]);_0x317ceb[_0x1c9f('0x3b')]=_[_0x1c9f('0x3d')](_0x317ceb[_0x1c9f('0x39')],_0x317ceb[_0x1c9f('0x3a')]);_0x1ad694[_0x1c9f('0x3c')]=_[_0x1c9f('0x3d')](_0x317ceb[_0x1c9f('0x39')],qs[_0x1c9f('0x3e')](_0x17b6a8[_0x1c9f('0x3a')][_0x1c9f('0x3e')]));_0x1ad694[_0x1c9f('0x3c')]=_0x1ad694[_0x1c9f('0x3c')][_0x1c9f('0x34')]?_0x1ad694[_0x1c9f('0x3c')]:_0x317ceb[_0x1c9f('0x39')];if(!_0x17b6a8['query'][_0x1c9f('0x3f')](_0x1c9f('0x40'))){_0x1ad694[_0x1c9f('0x26')]=qs['limit'](_0x17b6a8[_0x1c9f('0x3a')][_0x1c9f('0x26')]);_0x1ad694[_0x1c9f('0x23')]=qs[_0x1c9f('0x23')](_0x17b6a8[_0x1c9f('0x3a')][_0x1c9f('0x23')]);}_0x1ad694[_0x1c9f('0x41')]=qs[_0x1c9f('0x42')](_0x17b6a8[_0x1c9f('0x3a')]['sort']);_0x1ad694[_0x1c9f('0x43')]=qs[_0x1c9f('0x3b')](_['pick'](_0x17b6a8['query'],_0x317ceb[_0x1c9f('0x3b')]));_0x1ad694[_0x1c9f('0x43')]['ContactId']=_0x3b7088['id'];if(_0x17b6a8[_0x1c9f('0x3a')][_0x1c9f('0x68')]){_0x1ad694['where']=_['merge'](_0x1ad694[_0x1c9f('0x43')],{'$or':_[_0x1c9f('0x60')](_0x1ad694[_0x1c9f('0x3c')],function(_0x553186){var _0x350414={};_0x350414[_0x553186]={'$like':'%'+_0x17b6a8[_0x1c9f('0x3a')][_0x1c9f('0x68')]+'%'};return _0x350414;})});}_0x1ad694=_['merge']({},_0x1ad694,_0x17b6a8['options']);return db[_0x1c9f('0x9c')]['count']({'where':_0x1ad694[_0x1c9f('0x43')]})[_0x1c9f('0x2c')](function(_0xbc424a){_0x2506d0[_0x1c9f('0x25')]=_0xbc424a;if(_0x17b6a8[_0x1c9f('0x3a')]['includeAll']){_0x1ad694[_0x1c9f('0xce')]=[{'all':!![]}];}return db[_0x1c9f('0x9c')]['findAll'](_0x1ad694);})[_0x1c9f('0x2c')](function(_0x3bead9){_0x2506d0['rows']=_0x3bead9;return _0x2506d0;});}})[_0x1c9f('0x2c')](respondWithFilteredResult(_0x24dac9,_0x1ad694))[_0x1c9f('0x8f')](handleError(_0x24dac9,null));};exports['getHopperHistories']=function(_0x5545ee,_0x3ab981,_0x505fa7){var _0xd773d8={'raw':!![],'where':{}};var _0x5aadcb={};var _0x69e00b={'count':0x0,'rows':[]};return db['CmContact'][_0x1c9f('0xc7')]({'where':{'id':_0x5545ee[_0x1c9f('0x90')]['id']}})['then'](handleEntityNotFound(_0x3ab981,null))['then'](function(_0x3b33f8){if(_0x3b33f8){_0x5aadcb['model']=_[_0x1c9f('0x33')](db[_0x1c9f('0xa9')][_0x1c9f('0xc8')]);_0x5aadcb[_0x1c9f('0x3a')]=_[_0x1c9f('0x33')](_0x5545ee['query']);_0x5aadcb[_0x1c9f('0x3b')]=_[_0x1c9f('0x3d')](_0x5aadcb[_0x1c9f('0x39')],_0x5aadcb[_0x1c9f('0x3a')]);_0xd773d8['attributes']=_[_0x1c9f('0x3d')](_0x5aadcb[_0x1c9f('0x39')],qs[_0x1c9f('0x3e')](_0x5545ee['query'][_0x1c9f('0x3e')]));_0xd773d8[_0x1c9f('0x3c')]=_0xd773d8[_0x1c9f('0x3c')][_0x1c9f('0x34')]?_0xd773d8[_0x1c9f('0x3c')]:_0x5aadcb[_0x1c9f('0x39')];if(!_0x5545ee[_0x1c9f('0x3a')][_0x1c9f('0x3f')](_0x1c9f('0x40'))){_0xd773d8[_0x1c9f('0x26')]=qs['limit'](_0x5545ee[_0x1c9f('0x3a')][_0x1c9f('0x26')]);_0xd773d8[_0x1c9f('0x23')]=qs[_0x1c9f('0x23')](_0x5545ee[_0x1c9f('0x3a')][_0x1c9f('0x23')]);}_0xd773d8[_0x1c9f('0x41')]=qs['sort'](_0x5545ee[_0x1c9f('0x3a')][_0x1c9f('0x42')]);_0xd773d8[_0x1c9f('0x43')]=qs[_0x1c9f('0x3b')](_[_0x1c9f('0xc9')](_0x5545ee[_0x1c9f('0x3a')],_0x5aadcb[_0x1c9f('0x3b')]));_0xd773d8[_0x1c9f('0x43')][_0x1c9f('0xcf')]=_0x3b33f8['id'];if(_0x5545ee[_0x1c9f('0x3a')][_0x1c9f('0x68')]){_0xd773d8[_0x1c9f('0x43')]=_[_0x1c9f('0x83')](_0xd773d8[_0x1c9f('0x43')],{'$or':_[_0x1c9f('0x60')](_0xd773d8[_0x1c9f('0x3c')],function(_0x2a3542){var _0x90be5c={};_0x90be5c[_0x2a3542]={'$like':'%'+_0x5545ee[_0x1c9f('0x3a')][_0x1c9f('0x68')]+'%'};return _0x90be5c;})});}_0xd773d8=_[_0x1c9f('0x83')]({},_0xd773d8,_0x5545ee['options']);return db[_0x1c9f('0xa9')][_0x1c9f('0x25')]({'where':_0xd773d8['where']})['then'](function(_0x2cdc44){_0x69e00b[_0x1c9f('0x25')]=_0x2cdc44;if(_0x5545ee[_0x1c9f('0x3a')][_0x1c9f('0xd0')]){_0xd773d8[_0x1c9f('0xce')]=[{'all':!![]}];}return db[_0x1c9f('0xa9')][_0x1c9f('0x94')](_0xd773d8);})[_0x1c9f('0x2c')](function(_0x33e805){_0x69e00b[_0x1c9f('0x8e')]=_0x33e805;return _0x69e00b;});}})[_0x1c9f('0x2c')](respondWithFilteredResult(_0x3ab981,_0xd773d8))[_0x1c9f('0x8f')](handleError(_0x3ab981,null));};exports[_0x1c9f('0xd1')]=function(_0x5398fb,_0x358c1b,_0x3f4000){var _0x47d4bf={'raw':!![],'where':{}};var _0x54cb5a={};var _0x1841d1={'count':0x0,'rows':[]};return db[_0x1c9f('0x84')]['findOne']({'where':{'id':_0x5398fb[_0x1c9f('0x90')]['id']}})[_0x1c9f('0x2c')](handleEntityNotFound(_0x358c1b,null))[_0x1c9f('0x2c')](function(_0x1d46dc){if(_0x1d46dc){_0x54cb5a[_0x1c9f('0x39')]=_[_0x1c9f('0x33')](db[_0x1c9f('0xd2')][_0x1c9f('0xc8')]);_0x54cb5a[_0x1c9f('0x3a')]=_['keys'](_0x5398fb['query']);_0x54cb5a[_0x1c9f('0x3b')]=_[_0x1c9f('0x3d')](_0x54cb5a['model'],_0x54cb5a[_0x1c9f('0x3a')]);_0x47d4bf['attributes']=_['intersection'](_0x54cb5a[_0x1c9f('0x39')],qs[_0x1c9f('0x3e')](_0x5398fb[_0x1c9f('0x3a')][_0x1c9f('0x3e')]));_0x47d4bf[_0x1c9f('0x3c')]=_0x47d4bf['attributes'][_0x1c9f('0x34')]?_0x47d4bf[_0x1c9f('0x3c')]:_0x54cb5a['model'];if(!_0x5398fb['query']['hasOwnProperty']('nolimit')){_0x47d4bf[_0x1c9f('0x26')]=qs[_0x1c9f('0x26')](_0x5398fb[_0x1c9f('0x3a')][_0x1c9f('0x26')]);_0x47d4bf[_0x1c9f('0x23')]=qs[_0x1c9f('0x23')](_0x5398fb[_0x1c9f('0x3a')][_0x1c9f('0x23')]);}_0x47d4bf[_0x1c9f('0x41')]=qs[_0x1c9f('0x42')](_0x5398fb['query']['sort']);_0x47d4bf[_0x1c9f('0x43')]=qs[_0x1c9f('0x3b')](_[_0x1c9f('0xc9')](_0x5398fb['query'],_0x54cb5a[_0x1c9f('0x3b')]));_0x47d4bf[_0x1c9f('0x43')][_0x1c9f('0xcf')]=_0x1d46dc['id'];if(_0x5398fb[_0x1c9f('0x3a')]['filter']){_0x47d4bf[_0x1c9f('0x43')]=_['merge'](_0x47d4bf[_0x1c9f('0x43')],{'$or':_[_0x1c9f('0x60')](_0x47d4bf[_0x1c9f('0x3c')],function(_0x56ad07){var _0x7fc568={};_0x7fc568[_0x56ad07]={'$like':'%'+_0x5398fb[_0x1c9f('0x3a')]['filter']+'%'};return _0x7fc568;})});}_0x47d4bf=_[_0x1c9f('0x83')]({},_0x47d4bf,_0x5398fb[_0x1c9f('0xca')]);return db['CmHopperFinal'][_0x1c9f('0x25')]({'where':_0x47d4bf[_0x1c9f('0x43')]})[_0x1c9f('0x2c')](function(_0x2068ac){_0x1841d1[_0x1c9f('0x25')]=_0x2068ac;if(_0x5398fb[_0x1c9f('0x3a')][_0x1c9f('0xd0')]){_0x47d4bf[_0x1c9f('0xce')]=[{'all':!![]}];}return db[_0x1c9f('0xd2')]['findAll'](_0x47d4bf);})['then'](function(_0x5a3c73){_0x1841d1[_0x1c9f('0x8e')]=_0x5a3c73;return _0x1841d1;});}})[_0x1c9f('0x2c')](respondWithFilteredResult(_0x358c1b,_0x47d4bf))[_0x1c9f('0x8f')](handleError(_0x358c1b,null));};exports[_0x1c9f('0xd3')]=function(_0x33ca1c,_0x2fff7d,_0x56aa68){var _0x168e5c={'raw':!![],'where':{}};var _0x3d4934={};var _0x108bd6={'count':0x0,'rows':[]};return db[_0x1c9f('0x84')][_0x1c9f('0xc7')]({'where':{'id':_0x33ca1c[_0x1c9f('0x90')]['id']}})[_0x1c9f('0x2c')](handleEntityNotFound(_0x2fff7d,null))['then'](function(_0x322753){if(_0x322753){_0x3d4934[_0x1c9f('0x39')]=_[_0x1c9f('0x33')](db[_0x1c9f('0xb0')][_0x1c9f('0xc8')]);_0x3d4934[_0x1c9f('0x3a')]=_[_0x1c9f('0x33')](_0x33ca1c['query']);_0x3d4934[_0x1c9f('0x3b')]=_['intersection'](_0x3d4934[_0x1c9f('0x39')],_0x3d4934[_0x1c9f('0x3a')]);_0x168e5c['attributes']=_[_0x1c9f('0x3d')](_0x3d4934[_0x1c9f('0x39')],qs[_0x1c9f('0x3e')](_0x33ca1c['query'][_0x1c9f('0x3e')]));_0x168e5c[_0x1c9f('0x3c')]=_0x168e5c[_0x1c9f('0x3c')]['length']?_0x168e5c[_0x1c9f('0x3c')]:_0x3d4934[_0x1c9f('0x39')];if(!_0x33ca1c['query'][_0x1c9f('0x3f')](_0x1c9f('0x40'))){_0x168e5c['limit']=qs[_0x1c9f('0x26')](_0x33ca1c[_0x1c9f('0x3a')][_0x1c9f('0x26')]);_0x168e5c[_0x1c9f('0x23')]=qs['offset'](_0x33ca1c[_0x1c9f('0x3a')][_0x1c9f('0x23')]);}_0x168e5c['order']=qs[_0x1c9f('0x42')](_0x33ca1c[_0x1c9f('0x3a')]['sort']);_0x168e5c[_0x1c9f('0x43')]=qs['filters'](_[_0x1c9f('0xc9')](_0x33ca1c[_0x1c9f('0x3a')],_0x3d4934[_0x1c9f('0x3b')]));_0x168e5c['where'][_0x1c9f('0xcf')]=_0x322753['id'];if(_0x33ca1c[_0x1c9f('0x3a')][_0x1c9f('0x68')]){_0x168e5c[_0x1c9f('0x43')]=_[_0x1c9f('0x83')](_0x168e5c['where'],{'$or':_[_0x1c9f('0x60')](_0x168e5c[_0x1c9f('0x3c')],function(_0x1cbee1){var _0x5bcf83={};_0x5bcf83[_0x1cbee1]={'$like':'%'+_0x33ca1c[_0x1c9f('0x3a')][_0x1c9f('0x68')]+'%'};return _0x5bcf83;})});}_0x168e5c=_[_0x1c9f('0x83')]({},_0x168e5c,_0x33ca1c[_0x1c9f('0xca')]);return db['JscriptySessionReport'][_0x1c9f('0x25')]({'where':_0x168e5c[_0x1c9f('0x43')]})[_0x1c9f('0x2c')](function(_0xb07da3){_0x108bd6['count']=_0xb07da3;if(_0x33ca1c[_0x1c9f('0x3a')]['includeAll']){_0x168e5c[_0x1c9f('0xce')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x168e5c);})['then'](function(_0x5bfd2a){_0x108bd6[_0x1c9f('0x8e')]=_0x5bfd2a;return _0x108bd6;});}})[_0x1c9f('0x2c')](respondWithFilteredResult(_0x2fff7d,_0x168e5c))[_0x1c9f('0x8f')](handleError(_0x2fff7d,null));};exports['uploadCsv']=function(_0x40af48,_0x83374,_0x4e18fa){try{if(!_0x40af48[_0x1c9f('0x97')][_0x1c9f('0x63')]){throw new Error(_0x1c9f('0xd4'));}if(!_0x40af48[_0x1c9f('0x97')][_0x1c9f('0xd5')]){throw new Error(_0x1c9f('0xd6'));}if(!_0x40af48['body'][_0x1c9f('0xd7')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x40af48[_0x1c9f('0x97')][_0x1c9f('0xd8')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x2601e5=_0x40af48[_0x1c9f('0x97')][_0x1c9f('0xd5')][_0x1c9f('0x55')](',');var _0x3e8ac0=_0x40af48[_0x1c9f('0x97')]['binding_values'][_0x1c9f('0x55')](',');if(!_0x2601e5['length']||!_0x3e8ac0['length']||_0x2601e5[_0x1c9f('0x34')]!==_0x3e8ac0[_0x1c9f('0x34')]){throw new Error(_0x1c9f('0xd9'));}_0x40af48['body'][_0x1c9f('0x3e')]=_[_0x1c9f('0xda')](_0x2601e5,_0x3e8ac0);if(!_0x40af48[_0x1c9f('0x97')][_0x1c9f('0x3e')]['phone']){throw new Error(_0x1c9f('0xdb'));}if(!_0x40af48[_0x1c9f('0x97')]['fields'][_0x1c9f('0xdc')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x5e209c=path[_0x1c9f('0x9a')](config['root'],_0x1c9f('0xdd'),_0x40af48[_0x1c9f('0xde')][_0x1c9f('0xdf')]);fs[_0x1c9f('0xe0')](_0x5e209c,parseInt(_0x1c9f('0xe1'),0x8));var _0x57b46a=require(_0x1c9f('0xe2'))[_0x1c9f('0xe3')](path['join'](__dirname,'../../components/import/cm/csv'),[_0x5e209c,_0x40af48[_0x1c9f('0x97')]['binding_keys'],_0x40af48[_0x1c9f('0x97')][_0x1c9f('0xd7')],_0x40af48['body']['ListId'],_0x40af48[_0x1c9f('0x97')]['CompanyId'],_0x40af48[_0x1c9f('0x97')][_0x1c9f('0xb5')],_0x40af48['body'][_0x1c9f('0xd8')]]);return _0x83374[_0x1c9f('0x20')](0xc8)['json']({'message':_0x1c9f('0xe4'),'pid':_0x57b46a[_0x1c9f('0xe5')]});}catch(_0x479459){return _0x83374['status'](0x1f4)[_0x1c9f('0x30')](_0x479459);}};exports[_0x1c9f('0xe6')]=function(_0x890d5b,_0x2e2d23,_0x29cbef){var _0x492f49=fs[_0x1c9f('0xe7')](_0x890d5b[_0x1c9f('0xde')][_0x1c9f('0x7')]);Papa[_0x1c9f('0xe8')](_0x492f49,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x59f127){return _0x2e2d23[_0x1c9f('0x20')](0xc8)['json']({'file':_0x890d5b['file'],'fields':_0x59f127[_0x1c9f('0xe9')][_0x1c9f('0x3e')]});}});};exports[_0x1c9f('0xea')]=function(_0x9a0205,_0x65062e,_0x2c988b){return db[_0x1c9f('0x7b')][_0x1c9f('0x94')]({'raw':!![],'attributes':['id'],'where':{'role':_0x1c9f('0x7f')}})['then'](function(_0x36ac4f){var _0x28f28c=![];if(!_0x9a0205[_0x1c9f('0x97')][_0x1c9f('0x63')]){throw new Error(_0x1c9f('0xd4'));}if(!_0x9a0205[_0x1c9f('0x97')]['binding'][_0x1c9f('0xc6')]){throw new Error(_0x1c9f('0xdb'));}if(!_0x9a0205['body'][_0x1c9f('0xeb')][_0x1c9f('0xdc')]){throw new Error(_0x1c9f('0xec'));}if(!_0x9a0205['body'][_0x1c9f('0xd8')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x47fa1b=require(_0x1c9f('0xe2'))[_0x1c9f('0xe3')](path[_0x1c9f('0x9a')](__dirname,'../../components/import/cm/csv2'),[_0x9a0205[_0x1c9f('0x90')]['id'],JSON['stringify'](_0x9a0205[_0x1c9f('0x97')]),JSON[_0x1c9f('0xed')](_0x36ac4f)]);_0x47fa1b['on'](_0x1c9f('0xee'),function(_0x31ab4e){_0x28f28c=!![];return _0x65062e[_0x1c9f('0x20')](0xc8)[_0x1c9f('0x22')]({'message':_0x1c9f('0xef'),'pid':_0x47fa1b['pid']});});_0x47fa1b['on']('exit',function(_0x5827f8){if(_0x5827f8&&!_0x28f28c){return _0x65062e['status'](0x1f4)[_0x1c9f('0x22')]({'message':'error\x20child\x20process','pid':_0x47fa1b[_0x1c9f('0xe5')]});}});})[_0x1c9f('0x8f')](handleError(_0x65062e,null));};exports[_0x1c9f('0xf0')]=function(_0xa7cfd7,_0x56443d){var _0x4c67ad=['mail',_0x1c9f('0xf1'),_0x1c9f('0xf2'),_0x1c9f('0xf3'),_0x1c9f('0xf4'),_0x1c9f('0xf5'),_0x1c9f('0xf6')];var _0x4a5212={'offset':0x0,'order':qs['sort'](_0x1c9f('0xf7'))},_0x21e770={'count':0x0,'rows':[]};Promise['resolve']()[_0x1c9f('0x2c')](function(){if(_0xa7cfd7[_0x1c9f('0x3a')][_0x1c9f('0xf8')]){if(!_[_0x1c9f('0xf9')](_0x4c67ad,_0xa7cfd7['query']['channel'][_0x1c9f('0xfa')]())){throw new Error(_0x1c9f('0xfb'));}_0x4c67ad=[_0xa7cfd7['query'][_0x1c9f('0xf8')][_0x1c9f('0xfa')]()];}if(_0xa7cfd7['query'][_0x1c9f('0xfc')]){try{var _0x4f9180=JSON[_0x1c9f('0xe8')](_0xa7cfd7['query']['range']);if(!moment(_0x4f9180[_0x1c9f('0x47')])[_0x1c9f('0xfd')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x4f9180['to'])[_0x1c9f('0xfd')]()){throw new Error(_0x1c9f('0xfe'));}}catch(_0x20dde3){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0xa7cfd7[_0x1c9f('0x3a')]['hasOwnProperty'](_0x1c9f('0x40'))){_0x4a5212[_0x1c9f('0x26')]=qs[_0x1c9f('0x26')](_0xa7cfd7[_0x1c9f('0x3a')][_0x1c9f('0x26')]||0xa);_0x4a5212[_0x1c9f('0x23')]=qs[_0x1c9f('0x23')](_0xa7cfd7[_0x1c9f('0x3a')][_0x1c9f('0x23')]);}var _0x317249=_0x4c67ad['map'](function(_0x241a51){if(_0x241a51===_0x1c9f('0xf6')){var _0x1b2b21={'attributes':['id','uniqueid',_0x1c9f('0x5f'),'source','destination','callerid','starttime','endtime',_0x1c9f('0xff'),'note',_0x1c9f('0x100'),'userDisposition',_0x1c9f('0x101'),'userThirdDisposition',_0x1c9f('0x102')],'where':{'ContactId':_0xa7cfd7[_0x1c9f('0x90')]['id']},'include':[{'model':db[_0x1c9f('0x7b')],'as':_0x1c9f('0x7b'),'attributes':['id',_0x1c9f('0x2f'),_0x1c9f('0x103'),_0x1c9f('0x95')]}],'order':[[_0x1c9f('0x100'),_0x1c9f('0x104')]]};if(_0xa7cfd7[_0x1c9f('0x3a')]['range']){_0x1b2b21[_0x1c9f('0x43')]['createdAt']={'$gte':_0x4f9180[_0x1c9f('0x47')],'$lte':_0x4f9180['to']};}return db['VoiceCallReport'][_0x1c9f('0x105')](_0x1b2b21)['then'](function(_0x44ab30){_0x21e770[_0x1c9f('0x25')]+=_0x44ab30['count'];return _[_0x1c9f('0x60')](_0x44ab30['rows'],function(_0x1b1eda){var _0x333426=_0x1b1eda[_0x1c9f('0x98')]({'plain':!![]});_0x333426[_0x1c9f('0xf8')]=_0x241a51;if(_0x333426[_0x1c9f('0x7b')]){_0x333426[_0x1c9f('0x7b')]={'id':_0x333426['User']['id'],'name':_0x333426[_0x1c9f('0x7b')]['name'],'fullname':_0x333426['User'][_0x1c9f('0x103')],'alias':_0x333426[_0x1c9f('0x7b')][_0x1c9f('0x95')]};}return _0x333426;});});}else{var _0x104ff4=_[_0x1c9f('0x106')](_0x241a51)+(_0x241a51===_0x1c9f('0xf1')?_0x1c9f('0x107'):_0x1c9f('0x108'));var _0x2909d5={'attributes':['id',_0x1c9f('0x109'),_0x1c9f('0x10a'),_0x1c9f('0x100'),_0x1c9f('0x10b'),_0x1c9f('0x10c'),_0x1c9f('0x10d'),'thirdDisposition','UserId',_0x104ff4+'Id'],'where':{'ContactId':_0xa7cfd7[_0x1c9f('0x90')]['id']},'include':[{'model':db[_0x104ff4],'as':_0x1c9f('0x108'),'attributes':['id',_0x1c9f('0x2f'),_0x1c9f('0x10e')]},{'model':db['User'],'as':_0x1c9f('0x10f'),'attributes':['id','name',_0x1c9f('0x103')]},{'model':db['Tag'],'as':_0x1c9f('0x8d'),'attributes':['id',_0x1c9f('0x2f'),'color'],'through':{'attributes':[]}}],'order':[[_0x1c9f('0x100'),'DESC']]};if(_0xa7cfd7[_0x1c9f('0x3a')][_0x1c9f('0xfc')]){_0x2909d5[_0x1c9f('0x43')][_0x1c9f('0x100')]={'$gte':_0x4f9180[_0x1c9f('0x47')],'$lte':_0x4f9180['to']};}switch(_0x241a51){case'chat':_0x2909d5[_0x1c9f('0x3c')][_0x1c9f('0xb7')](_0x1c9f('0x110'),_0x1c9f('0x111'),'customerPort','deviceModel',_0x1c9f('0x112'),_0x1c9f('0x113'),_0x1c9f('0x114'),_0x1c9f('0x115'),_0x1c9f('0x116'));break;case _0x1c9f('0x117'):_0x2909d5['attributes'][_0x1c9f('0xb7')]('subject',_0x1c9f('0x118'));break;case'openchannel':_0x2909d5['attributes'][_0x1c9f('0xb7')](_0x1c9f('0x119'),'threadId');break;}return db[_[_0x1c9f('0x106')](_0x241a51)+_0x1c9f('0x11a')][_0x1c9f('0x105')](_0x2909d5)[_0x1c9f('0x2c')](function(_0x43effc){_0x21e770[_0x1c9f('0x25')]+=_0x43effc[_0x1c9f('0x25')];return _[_0x1c9f('0x60')](_0x43effc[_0x1c9f('0x8e')],function(_0x1a3a97){var _0x2bbf62=_0x1a3a97[_0x1c9f('0x98')]({'plain':!![]});_0x2bbf62[_0x1c9f('0xf8')]=_0x241a51;if(_0x2bbf62[_0x1c9f('0x10f')]){_0x2bbf62[_0x1c9f('0x10f')]={'id':_0x2bbf62[_0x1c9f('0x10f')]['id'],'name':_0x2bbf62[_0x1c9f('0x10f')][_0x1c9f('0x2f')],'fullname':_0x2bbf62[_0x1c9f('0x10f')][_0x1c9f('0x103')]};}return _0x2bbf62;});});}});return Promise[_0x1c9f('0x38')](_0x317249);})[_0x1c9f('0x2c')](function(_0x2c9208){return _(_0x2c9208)[_0x1c9f('0x11b')]()[_0x1c9f('0x11c')](_0x1c9f('0x100'))[_0x1c9f('0x11d')]()[_0x1c9f('0x54')]();})[_0x1c9f('0x2c')](function(_0x4a3c70){_0x21e770['rows']=_0x4a5212['limit']?_0x4a3c70[_0x1c9f('0x11e')](_0x4a5212[_0x1c9f('0x23')],_0x4a5212[_0x1c9f('0x23')]+_0x4a5212[_0x1c9f('0x26')]):_0x4a3c70;return _0x21e770;})[_0x1c9f('0x2c')](respondWithFilteredResult(_0x56443d,_0x4a5212))[_0x1c9f('0x8f')](handleError(_0x56443d,null));};
\ No newline at end of file
index e8ebdc5..27a194e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc681=['exports','CmContact','setMaxListeners','save','update','emit','hook'];(function(_0x4d05b2,_0x38e41d){var _0x41ca32=function(_0x4f051b){while(--_0x4f051b){_0x4d05b2['push'](_0x4d05b2['shift']());}};_0x41ca32(++_0x38e41d);}(_0xc681,0x143));var _0x1c68=function(_0x14a487,_0x26c9a6){_0x14a487=_0x14a487-0x0;var _0x593f5e=_0xc681[_0x14a487];return _0x593f5e;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db'][_0x1c68('0x0')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x1c68('0x1')](0x0);var events={'afterCreate':_0x1c68('0x2'),'afterUpdate':_0x1c68('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2566f5){return function(_0xf0dcb6,_0x1c8d87,_0x21eebc){CmContactEvents[_0x1c68('0x4')](_0x2566f5+':'+_0xf0dcb6['id'],_0xf0dcb6);CmContactEvents[_0x1c68('0x4')](_0x2566f5,_0xf0dcb6);_0x21eebc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0x1c68('0x5')](e,emitEvent(event));}}module[_0x1c68('0x6')]=CmContactEvents;
\ No newline at end of file
+var _0x7cf2=['CmContact','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x7cf2,0x1d6));var _0x27cf=function(_0x378529,_0x7e6ce3){_0x378529=_0x378529-0x0;var _0x161c6b=_0x7cf2[_0x378529];return _0x161c6b;};'use strict';var EventEmitter=require(_0x27cf('0x0'));var CmContact=require(_0x27cf('0x1'))['db'][_0x27cf('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x27cf('0x3'),'afterUpdate':_0x27cf('0x4'),'afterDestroy':_0x27cf('0x5')};function emitEvent(_0x13b5ee){return function(_0x2a9931,_0x6b2371,_0xa3f3ed){CmContactEvents['emit'](_0x13b5ee+':'+_0x2a9931['id'],_0x2a9931);CmContactEvents[_0x27cf('0x6')](_0x13b5ee,_0x2a9931);_0xa3f3ed(null);};}for(var e in events){if(events[_0x27cf('0x7')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
index e3a173a..ae2c133 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13cf=['CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','scheduledat','catch','cmContact','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','length','always','onlyIfOpen','message','Campaign','Lists','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','List\x20not\x20found','isEmpty','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','mobile','email','utf8mb4','utf8mb4_unicode_ci','models','get','error','afterCreate','inspect','CmHopper','findOne','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','priority','format','callbackUniqueid','YYYY-MM-DD\x20HH:mm:ss','isNil','cmContact,\x20afterCreate\x20'];(function(_0x2e6dbf,_0x57dd06){var _0x2680e5=function(_0x4018f4){while(--_0x4018f4){_0x2e6dbf['push'](_0x2e6dbf['shift']());}};_0x2680e5(++_0x57dd06);}(_0x13cf,0x11d));var _0xf13c=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x13cf[_0xc6be3a];return _0x56a310;};'use strict';var _=require(_0xf13c('0x0'));var util=require(_0xf13c('0x1'));var logger=require(_0xf13c('0x2'))('api');var moment=require(_0xf13c('0x3'));var BPromise=require(_0xf13c('0x4'));var rp=require(_0xf13c('0x5'));var fs=require('fs');var path=require(_0xf13c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf13c('0x7'));module[_0xf13c('0x8')]=function(_0x910ac1,_0x5e61fc){return _0x910ac1[_0xf13c('0x9')](_0xf13c('0xa'),attributes,{'tableName':_0xf13c('0xb'),'paranoid':!![],'indexes':[{'name':_0xf13c('0xc'),'fields':[_0xf13c('0xc')]},{'name':_0xf13c('0xd'),'fields':[_0xf13c('0xe'),'lastName','phone',_0xf13c('0xf'),'fax',_0xf13c('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xf13c('0x11'),'collate':_0xf13c('0x12'),'hooks':{'afterCreate':function(_0xe09725,_0x2eef05,_0x229013){var _0x5f47ce=_0x910ac1[_0xf13c('0x13')];var _0x3ef99f=_0xe09725[_0xf13c('0x14')]({'plain':!![]});function _0x5e6e28(){return function(_0x28f674){logger[_0xf13c('0x15')]('cmContact',_0xf13c('0x16'),util[_0xf13c('0x17')](_0x28f674,{'showHidden':![],'depth':null}));};}var _0x13c060=function(_0x5a223b){return new BPromise(function(_0x13f08f,_0x2a3e12){_0x5f47ce[_0xf13c('0x18')][_0xf13c('0x19')]({'where':{'phone':_0x3ef99f[_0xf13c('0xc')],'VoiceQueueId':_0x5a223b['id']}})[_0xf13c('0x1a')](function(_0x469626){if(!_['isNil'](_0x469626)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3ef99f[_0xf13c('0xc')]+_0xf13c('0x1b')+_0x5a223b['id']);}return _0x5f47ce[_0xf13c('0x18')][_0xf13c('0x1c')]({'phone':_0x3ef99f['phone'],'ContactId':_0x3ef99f['id'],'ListId':_0x3ef99f['ListId'],'priority':_0x3ef99f[_0xf13c('0x1d')]?_0x3ef99f['priority']:0x2,'scheduledat':_0x3ef99f['scheduledat']?_0x3ef99f['scheduledat']:moment()[_0xf13c('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3ef99f[_0xf13c('0x1f')]?!![]:![],'callbackuniqueid':_0x3ef99f[_0xf13c('0x1f')]?_0x3ef99f[_0xf13c('0x1f')]:undefined,'callbackat':_0x3ef99f[_0xf13c('0x1f')]?moment()['format'](_0xf13c('0x20')):undefined,'VoiceQueueId':_0x5a223b['id']});})['catch'](function(_0x6d7367){_0x2a3e12(_0x6d7367);});});};var _0x5d0c75=function(_0x2f3382){return new BPromise(function(_0x17e3da,_0x2241c9){_0x5f47ce[_0xf13c('0x18')][_0xf13c('0x19')]({'where':{'phone':_0x3ef99f['phone'],'VoiceQueueId':_0x2f3382['id']}})['then'](function(_0x4cee68){if(!_[_0xf13c('0x21')](_0x4cee68)){throw new Error(_0xf13c('0x22')+_0x3ef99f[_0xf13c('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x2f3382['id']);}return _0x5f47ce[_0xf13c('0x23')][_0xf13c('0x19')]({'where':{'calleridnum':_0x3ef99f[_0xf13c('0xc')],'VoiceQueueId':_0x2f3382['id']}});})[_0xf13c('0x1a')](function(_0x310f34){if(!_[_0xf13c('0x21')](_0x310f34)){throw new Error(_0xf13c('0x24')+_0x3ef99f[_0xf13c('0xc')]+_0xf13c('0x25')+_0x2f3382['id']);}return _0x5f47ce[_0xf13c('0x18')][_0xf13c('0x1c')]({'phone':_0x3ef99f[_0xf13c('0xc')],'ContactId':_0x3ef99f['id'],'ListId':_0x3ef99f[_0xf13c('0x26')],'priority':_0x3ef99f[_0xf13c('0x1d')]?_0x3ef99f[_0xf13c('0x1d')]:0x2,'scheduledat':_0x3ef99f[_0xf13c('0x27')]?_0x3ef99f[_0xf13c('0x27')]:moment()[_0xf13c('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x3ef99f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3ef99f[_0xf13c('0x1f')]?_0x3ef99f['callbackUniqueid']:undefined,'callbackat':_0x3ef99f[_0xf13c('0x1f')]?moment()[_0xf13c('0x1e')](_0xf13c('0x20')):undefined,'VoiceQueueId':_0x2f3382['id']});})[_0xf13c('0x28')](function(_0x397ac9){_0x2241c9(_0x397ac9);});});};function _0x2ccd5b(){return function(_0x19be3a){logger[_0xf13c('0x15')](_0xf13c('0x29'),_0xf13c('0x16'),util[_0xf13c('0x17')](_0x19be3a,{'showHidden':![],'depth':null}));};}var _0x3b72f0=function(_0x111fb1){return new BPromise(function(_0x53da02,_0x1d1a3a){_0x5f47ce[_0xf13c('0x18')]['findOne']({'where':{'phone':_0x3ef99f[_0xf13c('0xc')],'CampaignId':_0x111fb1['id']}})['then'](function(_0x1f5255){if(!_['isNil'](_0x1f5255)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3ef99f['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x111fb1['id']);}return _0x5f47ce[_0xf13c('0x18')]['create']({'phone':_0x3ef99f[_0xf13c('0xc')],'ContactId':_0x3ef99f['id'],'ListId':_0x3ef99f['ListId'],'priority':_0x3ef99f['priority']?_0x3ef99f[_0xf13c('0x1d')]:0x2,'scheduledat':_0x3ef99f[_0xf13c('0x27')]?_0x3ef99f[_0xf13c('0x27')]:moment()[_0xf13c('0x1e')](_0xf13c('0x20')),'callback':_0x3ef99f[_0xf13c('0x1f')]?!![]:![],'callbackuniqueid':_0x3ef99f['callbackUniqueid']?_0x3ef99f[_0xf13c('0x1f')]:undefined,'callbackat':_0x3ef99f[_0xf13c('0x1f')]?moment()[_0xf13c('0x1e')](_0xf13c('0x20')):undefined,'CampaignId':_0x111fb1['id']});})[_0xf13c('0x28')](function(_0x33fac1){_0x1d1a3a(_0x33fac1);});});};var _0x11e8b0=function(_0x68eb27){return new BPromise(function(_0x5d5735,_0x555665){_0x5f47ce[_0xf13c('0x18')][_0xf13c('0x19')]({'where':{'phone':_0x3ef99f[_0xf13c('0xc')],'CampaignId':_0x68eb27['id']}})[_0xf13c('0x1a')](function(_0x529c57){if(!_[_0xf13c('0x21')](_0x529c57)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3ef99f[_0xf13c('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x68eb27['id']);}return _0x5f47ce[_0xf13c('0x23')][_0xf13c('0x19')]({'where':{'calleridnum':_0x3ef99f['phone'],'CampaignId':_0x68eb27['id']}});})['then'](function(_0x10ce1e){if(!_[_0xf13c('0x21')](_0x10ce1e)){throw new Error(_0xf13c('0x24')+_0x3ef99f[_0xf13c('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x68eb27['id']);}return _0x5f47ce[_0xf13c('0x18')]['create']({'phone':_0x3ef99f[_0xf13c('0xc')],'ContactId':_0x3ef99f['id'],'ListId':_0x3ef99f['ListId'],'priority':_0x3ef99f[_0xf13c('0x1d')]?_0x3ef99f[_0xf13c('0x1d')]:0x2,'scheduledat':_0x3ef99f[_0xf13c('0x27')]?_0x3ef99f[_0xf13c('0x27')]:moment()[_0xf13c('0x1e')](_0xf13c('0x20')),'callback':_0x3ef99f[_0xf13c('0x1f')]?!![]:![],'callbackuniqueid':_0x3ef99f[_0xf13c('0x1f')]?_0x3ef99f['callbackUniqueid']:undefined,'callbackat':_0x3ef99f[_0xf13c('0x1f')]?moment()[_0xf13c('0x1e')](_0xf13c('0x20')):undefined,'CampaignId':_0x68eb27['id']});})[_0xf13c('0x28')](function(_0x57fb52){_0x555665(_0x57fb52);});});};if(_0x3ef99f[_0xf13c('0x26')]){_0x5f47ce[_0xf13c('0x2a')][_0xf13c('0x2b')]({'where':{'type':_0xf13c('0x2c')},'attributes':['id',_0xf13c('0x2d')],'include':[{'model':_0x5f47ce[_0xf13c('0x2e')],'as':'Lists','where':{'id':_0x3ef99f['ListId']}}]})[_0xf13c('0x1a')](function(_0x10739b){if(_0x10739b){var _0x4dcaa7=[];for(var _0x2fc2ad=0x0,_0x31bf6c;_0x2fc2ad<_0x10739b[_0xf13c('0x2f')];_0x2fc2ad+=0x1){_0x31bf6c=_0x10739b[_0x2fc2ad][_0xf13c('0x14')]({'plain':!![]});switch(_0x31bf6c[_0xf13c('0x2d')]){case _0xf13c('0x30'):_0x5d0c75(_0x31bf6c)['catch'](_0x5e6e28());break;case _0xf13c('0x31'):_0x13c060(_0x31bf6c)['catch'](_0x5e6e28());break;default:_0x5f47ce[_0xf13c('0x18')][_0xf13c('0x1c')]({'phone':_0x3ef99f[_0xf13c('0xc')],'ContactId':_0x3ef99f['id'],'ListId':_0x3ef99f[_0xf13c('0x26')],'scheduledat':_0x3ef99f['scheduledat']?_0x3ef99f['scheduledat']:moment()[_0xf13c('0x1e')](_0xf13c('0x20')),'priority':_0x3ef99f['priority']?_0x3ef99f[_0xf13c('0x1d')]:0x2,'callback':_0x3ef99f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3ef99f[_0xf13c('0x1f')]?_0x3ef99f[_0xf13c('0x1f')]:undefined,'callbackat':_0x3ef99f[_0xf13c('0x1f')]?moment()['format'](_0xf13c('0x20')):undefined,'VoiceQueueId':_0x31bf6c['id']})[_0xf13c('0x28')](_0x5e6e28());}}}})[_0xf13c('0x1a')](function(){return _0x5f47ce[_0xf13c('0x2a')][_0xf13c('0x2b')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x5f47ce[_0xf13c('0x2e')],'as':'BlackLists','where':{'id':_0x3ef99f['ListId']}}]})[_0xf13c('0x1a')](function(_0x2f02e7){if(_0x2f02e7){var _0x40ca5a=[];for(var _0xd64309=0x0,_0x1ebe39;_0xd64309<_0x2f02e7[_0xf13c('0x2f')];_0xd64309+=0x1){_0x1ebe39=_0x2f02e7[_0xd64309][_0xf13c('0x14')]({'plain':!![]});_0x5f47ce['CmHopperBlack'][_0xf13c('0x1c')]({'phone':_0x3ef99f['phone'],'ContactId':_0x3ef99f['id'],'ListId':_0x3ef99f[_0xf13c('0x26')],'VoiceQueueId':_0x1ebe39['id']})[_0xf13c('0x28')](function(_0x2cadb4){logger[_0xf13c('0x15')]('cmContact,\x20%s,\x20%s',_0xf13c('0x16'),_0x2cadb4[_0xf13c('0x32')]);});}}});})[_0xf13c('0x1a')](function(){return _0x5f47ce[_0xf13c('0x33')][_0xf13c('0x2b')]({'attributes':['id',_0xf13c('0x2d')],'include':[{'model':_0x5f47ce[_0xf13c('0x2e')],'as':_0xf13c('0x34'),'where':{'id':_0x3ef99f[_0xf13c('0x26')]}}]})[_0xf13c('0x1a')](function(_0x300700){if(_0x300700){var _0x4ad809=[];for(var _0x16e5d3=0x0,_0x4e2d7e;_0x16e5d3<_0x300700[_0xf13c('0x2f')];_0x16e5d3+=0x1){_0x4e2d7e=_0x300700[_0x16e5d3]['get']({'plain':!![]});switch(_0x4e2d7e[_0xf13c('0x2d')]){case _0xf13c('0x30'):_0x11e8b0(_0x4e2d7e)[_0xf13c('0x28')](_0x2ccd5b());break;case _0xf13c('0x31'):_0x3b72f0(_0x4e2d7e)['catch'](_0x2ccd5b());break;default:_0x5f47ce[_0xf13c('0x18')][_0xf13c('0x1c')]({'phone':_0x3ef99f[_0xf13c('0xc')],'ContactId':_0x3ef99f['id'],'ListId':_0x3ef99f[_0xf13c('0x26')],'scheduledat':_0x3ef99f['scheduledat']?_0x3ef99f[_0xf13c('0x27')]:moment()[_0xf13c('0x1e')](_0xf13c('0x20')),'priority':_0x3ef99f[_0xf13c('0x1d')]?_0x3ef99f[_0xf13c('0x1d')]:0x2,'callback':_0x3ef99f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3ef99f[_0xf13c('0x1f')]?_0x3ef99f[_0xf13c('0x1f')]:undefined,'callbackat':_0x3ef99f[_0xf13c('0x1f')]?moment()['format'](_0xf13c('0x20')):undefined,'CampaignId':_0x4e2d7e['id']})[_0xf13c('0x28')](_0x2ccd5b());}}}});})[_0xf13c('0x1a')](function(){return _0x5f47ce['Campaign'][_0xf13c('0x2b')]({'attributes':['id'],'include':[{'model':_0x5f47ce[_0xf13c('0x2e')],'as':_0xf13c('0x35'),'where':{'id':_0x3ef99f[_0xf13c('0x26')]}}]})['then'](function(_0x3001a0){if(_0x3001a0){var _0x43b008=[];for(var _0x5bd59c=0x0,_0x26c0b8;_0x5bd59c<_0x3001a0[_0xf13c('0x2f')];_0x5bd59c+=0x1){_0x26c0b8=_0x3001a0[_0x5bd59c][_0xf13c('0x14')]({'plain':!![]});_0x5f47ce[_0xf13c('0x36')]['create']({'phone':_0x3ef99f[_0xf13c('0xc')],'ContactId':_0x3ef99f['id'],'ListId':_0x3ef99f['ListId'],'CampaignId':_0x26c0b8['id']})['catch'](function(_0x45a46f){logger[_0xf13c('0x15')](_0xf13c('0x37'),_0xf13c('0x16'),_0x45a46f[_0xf13c('0x32')]);});}}});})['then'](function(){_0x229013();})[_0xf13c('0x28')](function(_0x2683a0){logger[_0xf13c('0x15')](_0xf13c('0x37'),_0xf13c('0x16'),_0x2683a0['message']);_0x229013(_0x2683a0);});}else{_0x229013(new Error(_0xf13c('0x38')));}},'afterDestroy':function(_0x50a259,_0x1a6a05,_0xfe1545){var _0x2d19e3=_0x910ac1['models'];var _0x43cfba=_0x50a259[_0xf13c('0x14')]({'plain':!![]});return _0x2d19e3[_0xf13c('0x18')][_0xf13c('0x2b')]({'raw':!![],'where':{'ListId':_0x43cfba[_0xf13c('0x26')],'ContactId':_0x43cfba['id']}})[_0xf13c('0x1a')](function(_0xb2144){if(!_[_0xf13c('0x39')](_0xb2144)){var _0x350854=[];for(var _0x4a8876=0x0;_0x4a8876<_0xb2144[_0xf13c('0x2f')];_0x4a8876+=0x1){var _0x238ef0=_0x2d19e3[_0xf13c('0x18')]['destroy']({'where':{'ListId':_0xb2144[_0x4a8876]['ListId'],'ContactId':_0xb2144[_0x4a8876]['ContactId'],'VoiceQueueId':_0xb2144[_0x4a8876][_0xf13c('0x3a')],'CampaignId':_0xb2144[_0x4a8876][_0xf13c('0x3b')]}});_0x350854[_0xf13c('0x3c')](_0x238ef0);}return BPromise[_0xf13c('0x3d')](_0x350854);}})['then'](function(_0x3cb7aa){logger[_0xf13c('0x3e')]('[CmContact][afterDestroy][Succesfull]',util[_0xf13c('0x17')](_0x3cb7aa,{'showHidden':![],'depth':null}));_0xfe1545();})[_0xf13c('0x28')](function(_0x5c8592){logger[_0xf13c('0x15')](_0xf13c('0x3f'),util[_0xf13c('0x17')](_0x5c8592,{'showHidden':![],'depth':null}));_0xfe1545(_0x5c8592);});}}});};
\ No newline at end of file
+var _0x3620=['[CmContact][afterDestroy][Error]','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','fax','email','utf8mb4','utf8mb4_unicode_ci','models','cmContact','afterCreate','inspect','then','isNil','CmHopper','priority','format','callbackUniqueid','YYYY-MM-DD\x20HH:mm:ss','catch','findOne','cmContact,\x20afterCreate\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','create','ListId','scheduledat','error','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','length','always','BlackLists','get','CmHopperBlack','cmContact,\x20%s,\x20%s','Campaign','Lists','onlyIfOpen','message','List\x20not\x20found','destroy','VoiceQueueId','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]'];(function(_0x553e14,_0x683bd6){var _0x45cba8=function(_0x3c8ca2){while(--_0x3c8ca2){_0x553e14['push'](_0x553e14['shift']());}};_0x45cba8(++_0x683bd6);}(_0x3620,0x1c8));var _0x0362=function(_0x2778a8,_0x265288){_0x2778a8=_0x2778a8-0x0;var _0x9a0fec=_0x3620[_0x2778a8];return _0x9a0fec;};'use strict';var _=require(_0x0362('0x0'));var util=require(_0x0362('0x1'));var logger=require(_0x0362('0x2'))(_0x0362('0x3'));var moment=require(_0x0362('0x4'));var BPromise=require('bluebird');var rp=require(_0x0362('0x5'));var fs=require('fs');var path=require(_0x0362('0x6'));var rimraf=require(_0x0362('0x7'));var config=require(_0x0362('0x8'));var attributes=require(_0x0362('0x9'));module[_0x0362('0xa')]=function(_0x4d31e0,_0x32734f){return _0x4d31e0[_0x0362('0xb')](_0x0362('0xc'),attributes,{'tableName':_0x0362('0xd'),'paranoid':!![],'indexes':[{'name':_0x0362('0xe'),'fields':[_0x0362('0xe')]},{'name':_0x0362('0xf'),'fields':[_0x0362('0x10'),_0x0362('0x11'),_0x0362('0xe'),'mobile',_0x0362('0x12'),_0x0362('0x13')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x0362('0x14'),'collate':_0x0362('0x15'),'hooks':{'afterCreate':function(_0x1bf97f,_0x2a89b9,_0x80fb25){var _0xbec170=_0x4d31e0[_0x0362('0x16')];var _0x244c2b=_0x1bf97f['get']({'plain':!![]});function _0x47c1ba(){return function(_0xe2acd){logger['error'](_0x0362('0x17'),_0x0362('0x18'),util[_0x0362('0x19')](_0xe2acd,{'showHidden':![],'depth':null}));};}var _0x1cbe9d=function(_0x945667){return new BPromise(function(_0x2873e2,_0x22c1a6){_0xbec170['CmHopper']['findOne']({'where':{'phone':_0x244c2b[_0x0362('0xe')],'VoiceQueueId':_0x945667['id']}})[_0x0362('0x1a')](function(_0x4196c8){if(!_[_0x0362('0x1b')](_0x4196c8)){throw new Error('cmContact,\x20afterCreate\x20'+_0x244c2b[_0x0362('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x945667['id']);}return _0xbec170[_0x0362('0x1c')]['create']({'phone':_0x244c2b['phone'],'ContactId':_0x244c2b['id'],'ListId':_0x244c2b['ListId'],'priority':_0x244c2b[_0x0362('0x1d')]?_0x244c2b[_0x0362('0x1d')]:0x2,'scheduledat':_0x244c2b['scheduledat']?_0x244c2b['scheduledat']:moment()[_0x0362('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x244c2b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x244c2b[_0x0362('0x1f')]?_0x244c2b['callbackUniqueid']:undefined,'callbackat':_0x244c2b[_0x0362('0x1f')]?moment()['format'](_0x0362('0x20')):undefined,'VoiceQueueId':_0x945667['id']});})[_0x0362('0x21')](function(_0x238d01){_0x22c1a6(_0x238d01);});});};var _0x4c0b3a=function(_0x500ebc){return new BPromise(function(_0xb5333,_0x1fb468){_0xbec170['CmHopper'][_0x0362('0x22')]({'where':{'phone':_0x244c2b[_0x0362('0xe')],'VoiceQueueId':_0x500ebc['id']}})['then'](function(_0x57f3ba){if(!_[_0x0362('0x1b')](_0x57f3ba)){throw new Error(_0x0362('0x23')+_0x244c2b[_0x0362('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0x500ebc['id']);}return _0xbec170['CmHopperFinal'][_0x0362('0x22')]({'where':{'calleridnum':_0x244c2b[_0x0362('0xe')],'VoiceQueueId':_0x500ebc['id']}});})['then'](function(_0x1e9351){if(!_[_0x0362('0x1b')](_0x1e9351)){throw new Error(_0x0362('0x24')+_0x244c2b[_0x0362('0xe')]+_0x0362('0x25')+_0x500ebc['id']);}return _0xbec170[_0x0362('0x1c')][_0x0362('0x26')]({'phone':_0x244c2b['phone'],'ContactId':_0x244c2b['id'],'ListId':_0x244c2b[_0x0362('0x27')],'priority':_0x244c2b[_0x0362('0x1d')]?_0x244c2b['priority']:0x2,'scheduledat':_0x244c2b[_0x0362('0x28')]?_0x244c2b[_0x0362('0x28')]:moment()['format'](_0x0362('0x20')),'callback':_0x244c2b[_0x0362('0x1f')]?!![]:![],'callbackuniqueid':_0x244c2b[_0x0362('0x1f')]?_0x244c2b['callbackUniqueid']:undefined,'callbackat':_0x244c2b[_0x0362('0x1f')]?moment()[_0x0362('0x1e')](_0x0362('0x20')):undefined,'VoiceQueueId':_0x500ebc['id']});})['catch'](function(_0x5b9283){_0x1fb468(_0x5b9283);});});};function _0x151b75(){return function(_0x2097a5){logger[_0x0362('0x29')](_0x0362('0x17'),_0x0362('0x18'),util['inspect'](_0x2097a5,{'showHidden':![],'depth':null}));};}var _0x194880=function(_0x500b87){return new BPromise(function(_0x3fa7c9,_0x1362bf){_0xbec170['CmHopper'][_0x0362('0x22')]({'where':{'phone':_0x244c2b['phone'],'CampaignId':_0x500b87['id']}})[_0x0362('0x1a')](function(_0xc92b84){if(!_[_0x0362('0x1b')](_0xc92b84)){throw new Error('cmContact,\x20afterCreate\x20'+_0x244c2b['phone']+_0x0362('0x2a')+_0x500b87['id']);}return _0xbec170[_0x0362('0x1c')][_0x0362('0x26')]({'phone':_0x244c2b['phone'],'ContactId':_0x244c2b['id'],'ListId':_0x244c2b[_0x0362('0x27')],'priority':_0x244c2b['priority']?_0x244c2b[_0x0362('0x1d')]:0x2,'scheduledat':_0x244c2b[_0x0362('0x28')]?_0x244c2b['scheduledat']:moment()[_0x0362('0x1e')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x244c2b[_0x0362('0x1f')]?!![]:![],'callbackuniqueid':_0x244c2b['callbackUniqueid']?_0x244c2b[_0x0362('0x1f')]:undefined,'callbackat':_0x244c2b[_0x0362('0x1f')]?moment()[_0x0362('0x1e')](_0x0362('0x20')):undefined,'CampaignId':_0x500b87['id']});})[_0x0362('0x21')](function(_0x2da5ac){_0x1362bf(_0x2da5ac);});});};var _0xe1008=function(_0x3f5a30){return new BPromise(function(_0x1702e6,_0x358946){_0xbec170['CmHopper']['findOne']({'where':{'phone':_0x244c2b[_0x0362('0xe')],'CampaignId':_0x3f5a30['id']}})['then'](function(_0x5dc185){if(!_[_0x0362('0x1b')](_0x5dc185)){throw new Error(_0x0362('0x23')+_0x244c2b[_0x0362('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x3f5a30['id']);}return _0xbec170['CmHopperFinal'][_0x0362('0x22')]({'where':{'calleridnum':_0x244c2b['phone'],'CampaignId':_0x3f5a30['id']}});})[_0x0362('0x1a')](function(_0x55140e){if(!_['isNil'](_0x55140e)){throw new Error(_0x0362('0x24')+_0x244c2b[_0x0362('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20'+_0x3f5a30['id']);}return _0xbec170[_0x0362('0x1c')][_0x0362('0x26')]({'phone':_0x244c2b[_0x0362('0xe')],'ContactId':_0x244c2b['id'],'ListId':_0x244c2b[_0x0362('0x27')],'priority':_0x244c2b[_0x0362('0x1d')]?_0x244c2b[_0x0362('0x1d')]:0x2,'scheduledat':_0x244c2b['scheduledat']?_0x244c2b[_0x0362('0x28')]:moment()['format'](_0x0362('0x20')),'callback':_0x244c2b[_0x0362('0x1f')]?!![]:![],'callbackuniqueid':_0x244c2b[_0x0362('0x1f')]?_0x244c2b[_0x0362('0x1f')]:undefined,'callbackat':_0x244c2b[_0x0362('0x1f')]?moment()[_0x0362('0x1e')](_0x0362('0x20')):undefined,'CampaignId':_0x3f5a30['id']});})[_0x0362('0x21')](function(_0x3c3348){_0x358946(_0x3c3348);});});};if(_0x244c2b[_0x0362('0x27')]){_0xbec170['VoiceQueue'][_0x0362('0x2b')]({'where':{'type':_0x0362('0x2c')},'attributes':['id',_0x0362('0x2d')],'include':[{'model':_0xbec170[_0x0362('0x2e')],'as':'Lists','where':{'id':_0x244c2b[_0x0362('0x27')]}}]})[_0x0362('0x1a')](function(_0xa28d48){if(_0xa28d48){var _0x25801f=[];for(var _0x593270=0x0,_0x25c6aa;_0x593270<_0xa28d48[_0x0362('0x2f')];_0x593270+=0x1){_0x25c6aa=_0xa28d48[_0x593270]['get']({'plain':!![]});switch(_0x25c6aa[_0x0362('0x2d')]){case _0x0362('0x30'):_0x4c0b3a(_0x25c6aa)[_0x0362('0x21')](_0x47c1ba());break;case'onlyIfOpen':_0x1cbe9d(_0x25c6aa)['catch'](_0x47c1ba());break;default:_0xbec170['CmHopper'][_0x0362('0x26')]({'phone':_0x244c2b[_0x0362('0xe')],'ContactId':_0x244c2b['id'],'ListId':_0x244c2b[_0x0362('0x27')],'scheduledat':_0x244c2b[_0x0362('0x28')]?_0x244c2b[_0x0362('0x28')]:moment()[_0x0362('0x1e')](_0x0362('0x20')),'priority':_0x244c2b[_0x0362('0x1d')]?_0x244c2b['priority']:0x2,'callback':_0x244c2b['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x244c2b[_0x0362('0x1f')]?_0x244c2b[_0x0362('0x1f')]:undefined,'callbackat':_0x244c2b[_0x0362('0x1f')]?moment()[_0x0362('0x1e')](_0x0362('0x20')):undefined,'VoiceQueueId':_0x25c6aa['id']})[_0x0362('0x21')](_0x47c1ba());}}}})[_0x0362('0x1a')](function(){return _0xbec170['VoiceQueue'][_0x0362('0x2b')]({'where':{'type':_0x0362('0x2c')},'attributes':['id'],'include':[{'model':_0xbec170[_0x0362('0x2e')],'as':_0x0362('0x31'),'where':{'id':_0x244c2b[_0x0362('0x27')]}}]})['then'](function(_0x3220f4){if(_0x3220f4){var _0x1ca72b=[];for(var _0x503814=0x0,_0x2cfea8;_0x503814<_0x3220f4[_0x0362('0x2f')];_0x503814+=0x1){_0x2cfea8=_0x3220f4[_0x503814][_0x0362('0x32')]({'plain':!![]});_0xbec170[_0x0362('0x33')][_0x0362('0x26')]({'phone':_0x244c2b[_0x0362('0xe')],'ContactId':_0x244c2b['id'],'ListId':_0x244c2b['ListId'],'VoiceQueueId':_0x2cfea8['id']})[_0x0362('0x21')](function(_0x21331c){logger[_0x0362('0x29')](_0x0362('0x34'),_0x0362('0x18'),_0x21331c['message']);});}}});})[_0x0362('0x1a')](function(){return _0xbec170[_0x0362('0x35')][_0x0362('0x2b')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':_0xbec170[_0x0362('0x2e')],'as':_0x0362('0x36'),'where':{'id':_0x244c2b['ListId']}}]})['then'](function(_0x4ef5a7){if(_0x4ef5a7){var _0x502655=[];for(var _0x19d3ea=0x0,_0x394c54;_0x19d3ea<_0x4ef5a7[_0x0362('0x2f')];_0x19d3ea+=0x1){_0x394c54=_0x4ef5a7[_0x19d3ea][_0x0362('0x32')]({'plain':!![]});switch(_0x394c54[_0x0362('0x2d')]){case _0x0362('0x30'):_0xe1008(_0x394c54)['catch'](_0x151b75());break;case _0x0362('0x37'):_0x194880(_0x394c54)[_0x0362('0x21')](_0x151b75());break;default:_0xbec170[_0x0362('0x1c')][_0x0362('0x26')]({'phone':_0x244c2b[_0x0362('0xe')],'ContactId':_0x244c2b['id'],'ListId':_0x244c2b[_0x0362('0x27')],'scheduledat':_0x244c2b[_0x0362('0x28')]?_0x244c2b[_0x0362('0x28')]:moment()[_0x0362('0x1e')](_0x0362('0x20')),'priority':_0x244c2b[_0x0362('0x1d')]?_0x244c2b[_0x0362('0x1d')]:0x2,'callback':_0x244c2b[_0x0362('0x1f')]?!![]:![],'callbackuniqueid':_0x244c2b[_0x0362('0x1f')]?_0x244c2b[_0x0362('0x1f')]:undefined,'callbackat':_0x244c2b['callbackUniqueid']?moment()[_0x0362('0x1e')](_0x0362('0x20')):undefined,'CampaignId':_0x394c54['id']})[_0x0362('0x21')](_0x151b75());}}}});})[_0x0362('0x1a')](function(){return _0xbec170['Campaign'][_0x0362('0x2b')]({'attributes':['id'],'include':[{'model':_0xbec170['CmList'],'as':_0x0362('0x31'),'where':{'id':_0x244c2b[_0x0362('0x27')]}}]})['then'](function(_0x4c5a39){if(_0x4c5a39){var _0x31175d=[];for(var _0x289a37=0x0,_0x5930c6;_0x289a37<_0x4c5a39['length'];_0x289a37+=0x1){_0x5930c6=_0x4c5a39[_0x289a37][_0x0362('0x32')]({'plain':!![]});_0xbec170['CmHopperBlack']['create']({'phone':_0x244c2b['phone'],'ContactId':_0x244c2b['id'],'ListId':_0x244c2b['ListId'],'CampaignId':_0x5930c6['id']})['catch'](function(_0x535a7d){logger[_0x0362('0x29')](_0x0362('0x34'),'afterCreate',_0x535a7d['message']);});}}});})['then'](function(){_0x80fb25();})[_0x0362('0x21')](function(_0x2547d8){logger[_0x0362('0x29')]('cmContact,\x20%s,\x20%s',_0x0362('0x18'),_0x2547d8[_0x0362('0x38')]);_0x80fb25(_0x2547d8);});}else{_0x80fb25(new Error(_0x0362('0x39')));}},'afterDestroy':function(_0x57e5de,_0x3ec381,_0x457808){var _0x3e67dc=_0x4d31e0[_0x0362('0x16')];var _0x1271d1=_0x57e5de[_0x0362('0x32')]({'plain':!![]});return _0x3e67dc[_0x0362('0x1c')]['findAll']({'raw':!![],'where':{'ListId':_0x1271d1[_0x0362('0x27')],'ContactId':_0x1271d1['id']}})['then'](function(_0xf4e333){if(!_['isEmpty'](_0xf4e333)){var _0x2e9cb9=[];for(var _0x53b7e1=0x0;_0x53b7e1<_0xf4e333['length'];_0x53b7e1+=0x1){var _0xdf5bdb=_0x3e67dc['CmHopper'][_0x0362('0x3a')]({'where':{'ListId':_0xf4e333[_0x53b7e1]['ListId'],'ContactId':_0xf4e333[_0x53b7e1]['ContactId'],'VoiceQueueId':_0xf4e333[_0x53b7e1][_0x0362('0x3b')],'CampaignId':_0xf4e333[_0x53b7e1][_0x0362('0x3c')]}});_0x2e9cb9[_0x0362('0x3d')](_0xdf5bdb);}return BPromise['all'](_0x2e9cb9);}})[_0x0362('0x1a')](function(_0x24c8b5){logger[_0x0362('0x3e')](_0x0362('0x3f'),util[_0x0362('0x19')](_0x24c8b5,{'showHidden':![],'depth':null}));_0x457808();})[_0x0362('0x21')](function(_0x39c768){logger[_0x0362('0x29')](_0x0362('0x40'),util[_0x0362('0x19')](_0x39c768,{'showHidden':![],'depth':null}));_0x457808(_0x39c768);});}}});};
\ No newline at end of file
index 9263d79..67f53a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b76=['redis','localhost','socket.io-emitter','register','request','then','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','info','GetCmContact','CreateCmContact','CmContact','create','body','startsWith','cf_','table','cm_contacts','set','toString','sequelize','util','moment','bluebird','randomstring','squel','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x262b1a,_0x35a6e0){var _0xcdfd6e=function(_0x4336e1){while(--_0x4336e1){_0x262b1a['push'](_0x262b1a['shift']());}};_0xcdfd6e(++_0x35a6e0);}(_0x8b76,0xb9));var _0x68b7=function(_0x1162d6,_0x860ab7){_0x1162d6=_0x1162d6-0x0;var _0x41648=_0x8b76[_0x1162d6];return _0x41648;};'use strict';var _=require('lodash');var util=require(_0x68b7('0x0'));var moment=require(_0x68b7('0x1'));var BPromise=require(_0x68b7('0x2'));var rs=require(_0x68b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0x68b7('0x4'));var db=require(_0x68b7('0x5'))['db'];var utils=require(_0x68b7('0x6'));var logger=require('../../config/logger')(_0x68b7('0x7'));var config=require(_0x68b7('0x8'));var jayson=require(_0x68b7('0x9'));var client=jayson[_0x68b7('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x68b7('0xb')],{'host':_0x68b7('0xc'),'port':0x18eb});var socket=require(_0x68b7('0xd'))(new Redis(config[_0x68b7('0xb')]));require('./cmContact.socket')[_0x68b7('0xe')](socket);function respondWithRpcPromise(_0x293125,_0x3d218e,_0x1698b9){return new BPromise(function(_0x34e47b,_0x39fa75){return client[_0x68b7('0xf')](_0x293125,_0x1698b9)[_0x68b7('0x10')](function(_0x2a9e1a){logger['info'](_0x68b7('0x11'),_0x3d218e,_0x68b7('0x12'));logger[_0x68b7('0x13')](_0x68b7('0x14'),_0x3d218e,'request\x20sent',JSON[_0x68b7('0x15')](_0x2a9e1a));if(_0x2a9e1a[_0x68b7('0x16')]){if(_0x2a9e1a[_0x68b7('0x16')][_0x68b7('0x17')]===0x1f4){logger[_0x68b7('0x16')](_0x68b7('0x11'),_0x3d218e,_0x2a9e1a[_0x68b7('0x16')][_0x68b7('0x18')]);return _0x39fa75(_0x2a9e1a[_0x68b7('0x16')][_0x68b7('0x18')]);}logger[_0x68b7('0x16')](_0x68b7('0x11'),_0x3d218e,_0x2a9e1a['error'][_0x68b7('0x18')]);return _0x34e47b(_0x2a9e1a['error']['message']);}else{logger['info']('CmContact,\x20%s,\x20%s',_0x3d218e,_0x68b7('0x12'));_0x34e47b(_0x2a9e1a[_0x68b7('0x19')]['message']);}})[_0x68b7('0x1a')](function(_0x559b4d){logger[_0x68b7('0x16')](_0x68b7('0x11'),_0x3d218e,_0x559b4d);_0x39fa75(_0x559b4d);});});}exports['GetCmContact']=function(_0xbca1c4){var _0x1749f0=this;return new Promise(function(_0x5b26c9,_0x49a3b4){return db['CmContact'][_0x68b7('0x1b')]({'raw':_0xbca1c4[_0x68b7('0x1c')]?_0xbca1c4['options'][_0x68b7('0x1d')]===undefined?!![]:![]:!![],'where':_0xbca1c4[_0x68b7('0x1c')]?_0xbca1c4[_0x68b7('0x1c')][_0x68b7('0x1e')]||null:null,'attributes':_0xbca1c4['options']?_0xbca1c4[_0x68b7('0x1c')][_0x68b7('0x1f')]||null:null,'limit':_0xbca1c4[_0x68b7('0x1c')]?_0xbca1c4[_0x68b7('0x1c')][_0x68b7('0x20')]||null:null,'include':_0xbca1c4['options']?_0xbca1c4['options'][_0x68b7('0x21')]?_[_0x68b7('0x22')](_0xbca1c4[_0x68b7('0x1c')]['include'],function(_0x4304b4){return{'model':db[_0x4304b4[_0x68b7('0x23')]],'as':_0x4304b4['as'],'attributes':_0x4304b4[_0x68b7('0x1f')],'include':_0x4304b4['include']?_[_0x68b7('0x22')](_0x4304b4[_0x68b7('0x21')],function(_0x5ebe8e){return{'model':db[_0x5ebe8e[_0x68b7('0x23')]],'as':_0x5ebe8e['as'],'attributes':_0x5ebe8e[_0x68b7('0x1f')],'include':_0x5ebe8e['include']?_[_0x68b7('0x22')](_0x5ebe8e[_0x68b7('0x21')],function(_0x21ee72){return{'model':db[_0x21ee72[_0x68b7('0x23')]],'as':_0x21ee72['as'],'attributes':_0x21ee72[_0x68b7('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x471018){logger[_0x68b7('0x24')]('GetCmContact',_0xbca1c4);logger[_0x68b7('0x13')](_0x68b7('0x25'),_0xbca1c4,JSON[_0x68b7('0x15')](_0x471018));_0x5b26c9(_0x471018);})[_0x68b7('0x1a')](function(_0x29b163){logger[_0x68b7('0x16')](_0x68b7('0x25'),_0x29b163['message'],_0xbca1c4);_0x49a3b4(_0x1749f0[_0x68b7('0x16')](0x1f4,_0x29b163[_0x68b7('0x18')]));});});};exports[_0x68b7('0x26')]=function(_0x16245a){var _0x5e0dc2=this;return new Promise(function(_0x4c00c1,_0x4025b5){return db[_0x68b7('0x27')][_0x68b7('0x28')](_0x16245a['body'],{'raw':_0x16245a[_0x68b7('0x1c')]?_0x16245a[_0x68b7('0x1c')][_0x68b7('0x1d')]===undefined?!![]:![]:!![]})[_0x68b7('0x10')](function(_0x5388f5){var _0x365215;for(var _0x44e340=0x0;_0x44e340<Object['keys'](_0x16245a['body'])['length'];_0x44e340++){var _0x321e71=Object['keys'](_0x16245a[_0x68b7('0x29')])[_0x44e340];if(_0x321e71[_0x68b7('0x2a')](_0x68b7('0x2b'))){_0x365215=squel['update']()[_0x68b7('0x2c')](_0x68b7('0x2d'))[_0x68b7('0x2e')](_0x321e71,_0x16245a[_0x68b7('0x29')][_0x321e71])[_0x68b7('0x1e')]('id\x20=\x20?',_0x5388f5['id'])[_0x68b7('0x2f')]();break;}}if(!_0x365215)return _0x5388f5;return db[_0x68b7('0x30')]['query'](_0x365215)['then'](function(){return _0x5388f5;});})[_0x68b7('0x10')](function(_0x579432){logger[_0x68b7('0x24')](_0x68b7('0x26'),_0x16245a);logger[_0x68b7('0x13')](_0x68b7('0x26'),_0x16245a,JSON[_0x68b7('0x15')](_0x579432));_0x4c00c1(_0x579432);})['catch'](function(_0x46f735){logger[_0x68b7('0x16')](_0x68b7('0x26'),_0x46f735[_0x68b7('0x18')],_0x16245a);_0x4025b5(_0x5e0dc2[_0x68b7('0x16')](0x1f4,_0x46f735[_0x68b7('0x18')]));});});};
\ No newline at end of file
+var _0x14d6=['CmContact','findAll','options','where','attributes','limit','include','map','model','CreateCmContact','body','raw','keys','length','startsWith','update','table','cm_contacts','set','id\x20=\x20?','sequelize','query','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmContact'];(function(_0x4a724e,_0x9e0da0){var _0x5bc2ef=function(_0x3f7a2e){while(--_0x3f7a2e){_0x4a724e['push'](_0x4a724e['shift']());}};_0x5bc2ef(++_0x9e0da0);}(_0x14d6,0x80));var _0x614d=function(_0x27d321,_0x4acd6d){_0x27d321=_0x27d321-0x0;var _0x1afef9=_0x14d6[_0x27d321];return _0x1afef9;};'use strict';var _=require(_0x614d('0x0'));var util=require('util');var moment=require(_0x614d('0x1'));var BPromise=require(_0x614d('0x2'));var rs=require(_0x614d('0x3'));var fs=require('fs');var Redis=require(_0x614d('0x4'));var squel=require('squel');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x614d('0x5'))(_0x614d('0x6'));var config=require(_0x614d('0x7'));var jayson=require(_0x614d('0x8'));var client=jayson[_0x614d('0x9')][_0x614d('0xa')]({'port':0x232a});config[_0x614d('0xb')]=_[_0x614d('0xc')](config[_0x614d('0xb')],{'host':_0x614d('0xd'),'port':0x18eb});var socket=require(_0x614d('0xe'))(new Redis(config[_0x614d('0xb')]));require(_0x614d('0xf'))[_0x614d('0x10')](socket);function respondWithRpcPromise(_0x43861d,_0x2a3494,_0x51f360){return new BPromise(function(_0x2aadeb,_0x42b6c8){return client[_0x614d('0x11')](_0x43861d,_0x51f360)[_0x614d('0x12')](function(_0x5b6a4e){logger[_0x614d('0x13')](_0x614d('0x14'),_0x2a3494,_0x614d('0x15'));logger[_0x614d('0x16')](_0x614d('0x17'),_0x2a3494,_0x614d('0x15'),JSON[_0x614d('0x18')](_0x5b6a4e));if(_0x5b6a4e[_0x614d('0x19')]){if(_0x5b6a4e[_0x614d('0x19')][_0x614d('0x1a')]===0x1f4){logger[_0x614d('0x19')](_0x614d('0x14'),_0x2a3494,_0x5b6a4e[_0x614d('0x19')][_0x614d('0x1b')]);return _0x42b6c8(_0x5b6a4e[_0x614d('0x19')]['message']);}logger[_0x614d('0x19')](_0x614d('0x14'),_0x2a3494,_0x5b6a4e['error'][_0x614d('0x1b')]);return _0x2aadeb(_0x5b6a4e[_0x614d('0x19')][_0x614d('0x1b')]);}else{logger['info'](_0x614d('0x14'),_0x2a3494,'request\x20sent');_0x2aadeb(_0x5b6a4e[_0x614d('0x1c')][_0x614d('0x1b')]);}})[_0x614d('0x1d')](function(_0x546132){logger['error'](_0x614d('0x14'),_0x2a3494,_0x546132);_0x42b6c8(_0x546132);});});}exports[_0x614d('0x1e')]=function(_0x52a647){var _0x5601a3=this;return new Promise(function(_0x365b13,_0xe339a1){return db[_0x614d('0x1f')][_0x614d('0x20')]({'raw':_0x52a647[_0x614d('0x21')]?_0x52a647['options']['raw']===undefined?!![]:![]:!![],'where':_0x52a647[_0x614d('0x21')]?_0x52a647[_0x614d('0x21')][_0x614d('0x22')]||null:null,'attributes':_0x52a647[_0x614d('0x21')]?_0x52a647[_0x614d('0x21')][_0x614d('0x23')]||null:null,'limit':_0x52a647[_0x614d('0x21')]?_0x52a647[_0x614d('0x21')][_0x614d('0x24')]||null:null,'include':_0x52a647[_0x614d('0x21')]?_0x52a647[_0x614d('0x21')][_0x614d('0x25')]?_[_0x614d('0x26')](_0x52a647[_0x614d('0x21')][_0x614d('0x25')],function(_0x538195){return{'model':db[_0x538195[_0x614d('0x27')]],'as':_0x538195['as'],'attributes':_0x538195[_0x614d('0x23')],'include':_0x538195['include']?_[_0x614d('0x26')](_0x538195[_0x614d('0x25')],function(_0x4b67e2){return{'model':db[_0x4b67e2['model']],'as':_0x4b67e2['as'],'attributes':_0x4b67e2[_0x614d('0x23')],'include':_0x4b67e2['include']?_[_0x614d('0x26')](_0x4b67e2[_0x614d('0x25')],function(_0x3f0e86){return{'model':db[_0x3f0e86['model']],'as':_0x3f0e86['as'],'attributes':_0x3f0e86[_0x614d('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43f2c6){logger[_0x614d('0x13')](_0x614d('0x1e'),_0x52a647);logger['debug'](_0x614d('0x1e'),_0x52a647,JSON['stringify'](_0x43f2c6));_0x365b13(_0x43f2c6);})[_0x614d('0x1d')](function(_0x25c41e){logger[_0x614d('0x19')](_0x614d('0x1e'),_0x25c41e['message'],_0x52a647);_0xe339a1(_0x5601a3[_0x614d('0x19')](0x1f4,_0x25c41e[_0x614d('0x1b')]));});});};exports[_0x614d('0x28')]=function(_0x1d2ef1){var _0xcac53b=this;return new Promise(function(_0x33873d,_0x2d3b36){return db['CmContact']['create'](_0x1d2ef1[_0x614d('0x29')],{'raw':_0x1d2ef1['options']?_0x1d2ef1[_0x614d('0x21')][_0x614d('0x2a')]===undefined?!![]:![]:!![]})[_0x614d('0x12')](function(_0x381a56){var _0xff7aab;for(var _0x85e9bd=0x0;_0x85e9bd<Object[_0x614d('0x2b')](_0x1d2ef1[_0x614d('0x29')])[_0x614d('0x2c')];_0x85e9bd++){var _0x38e07f=Object[_0x614d('0x2b')](_0x1d2ef1[_0x614d('0x29')])[_0x85e9bd];if(_0x38e07f[_0x614d('0x2d')]('cf_')){_0xff7aab=squel[_0x614d('0x2e')]()[_0x614d('0x2f')](_0x614d('0x30'))[_0x614d('0x31')](_0x38e07f,_0x1d2ef1['body'][_0x38e07f])[_0x614d('0x22')](_0x614d('0x32'),_0x381a56['id'])['toString']();break;}}if(!_0xff7aab)return _0x381a56;return db[_0x614d('0x33')][_0x614d('0x34')](_0xff7aab)['then'](function(){return _0x381a56;});})[_0x614d('0x12')](function(_0x579601){logger[_0x614d('0x13')](_0x614d('0x28'),_0x1d2ef1);logger[_0x614d('0x16')](_0x614d('0x28'),_0x1d2ef1,JSON[_0x614d('0x18')](_0x579601));_0x33873d(_0x579601);})[_0x614d('0x1d')](function(_0x2b3d5d){logger[_0x614d('0x19')](_0x614d('0x28'),_0x2b3d5d[_0x614d('0x1b')],_0x1d2ef1);_0x2d3b36(_0xcac53b[_0x614d('0x19')](0x1f4,_0x2b3d5d[_0x614d('0x1b')]));});});};
\ No newline at end of file
index ea4c244..9dc025d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var CmContactEvents=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(){CmContactEvents[_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);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'use strict';var CmContactEvents=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(){CmContactEvents[_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);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 5392b2b..fd177d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d33=['fs-extra','../../components/auth/service','./cmContact.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getTags','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','/:id/journey','getJourney','post','/merge','merge','create','/create_many','bulkCreate','diskStorage','join','root','server/files/tmp','originalname','%s-%s%s','extname','now','single','file','uploadCsv','replace','basename','/upload','upload','/upload/:id','import','update','delete','destroy','exports','util','path','Router'];(function(_0x57da0a,_0x284aed){var _0x3145d5=function(_0xfe7c3b){while(--_0xfe7c3b){_0x57da0a['push'](_0x57da0a['shift']());}};_0x3145d5(++_0x284aed);}(_0x2d33,0x1dd));var _0x32d3=function(_0x639fd7,_0x2d4036){_0x639fd7=_0x639fd7-0x0;var _0x5b5c1a=_0x2d33[_0x639fd7];return _0x5b5c1a;};'use strict';var multer=require('multer');var util=require(_0x32d3('0x0'));var path=require(_0x32d3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x32d3('0x2')]();var fs_extra=require(_0x32d3('0x3'));var auth=require(_0x32d3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x32d3('0x5'));router[_0x32d3('0x6')]('/',auth[_0x32d3('0x7')](),controller[_0x32d3('0x8')]);router[_0x32d3('0x6')](_0x32d3('0x9'),auth[_0x32d3('0x7')](),controller[_0x32d3('0xa')]);router[_0x32d3('0x6')](_0x32d3('0xb'),auth['isAuthenticated'](),controller[_0x32d3('0xc')]);router[_0x32d3('0x6')]('/:id/tags',auth[_0x32d3('0x7')](),controller[_0x32d3('0xd')]);router['get']('/:id/hoppers',auth[_0x32d3('0x7')](),controller[_0x32d3('0xe')]);router[_0x32d3('0x6')](_0x32d3('0xf'),auth[_0x32d3('0x7')](),controller['getHopperHistories']);router[_0x32d3('0x6')](_0x32d3('0x10'),auth['isAuthenticated'](),controller[_0x32d3('0x11')]);router[_0x32d3('0x6')]('/:id/jscripty_sessions',auth[_0x32d3('0x7')](),controller[_0x32d3('0x12')]);router[_0x32d3('0x6')](_0x32d3('0x13'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x14')]);router[_0x32d3('0x15')](_0x32d3('0x16'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x17')]);router['post']('/',auth[_0x32d3('0x7')](),controller[_0x32d3('0x18')]);router[_0x32d3('0x15')](_0x32d3('0x19'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x1a')]);router['post']('/:id/tags',auth[_0x32d3('0x7')](),controller['setTags']);var upload=multer({'storage':multer[_0x32d3('0x1b')]({'destination':function(_0xa885cd,_0x470f97,_0x1212da){_0x1212da(null,path[_0x32d3('0x1c')](config[_0x32d3('0x1d')],_0x32d3('0x1e')));},'filename':function(_0x98d4d,_0x22065e,_0x2b6796){_0x22065e[_0x32d3('0x1f')]=_0x22065e[_0x32d3('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b6796(null,util['format'](_0x32d3('0x20'),path['basename'](_0x22065e[_0x32d3('0x1f')],path[_0x32d3('0x21')](_0x22065e[_0x32d3('0x1f')])),Date[_0x32d3('0x22')](),path[_0x32d3('0x21')](_0x22065e[_0x32d3('0x1f')])));}})});router['post']('/csv',upload[_0x32d3('0x23')](_0x32d3('0x24')),controller[_0x32d3('0x25')]);var upload=multer({'storage':multer[_0x32d3('0x1b')]({'destination':function(_0x2241d4,_0x4d4045,_0x5b1f14){_0x5b1f14(null,path[_0x32d3('0x1c')](config[_0x32d3('0x1d')],_0x32d3('0x1e')));},'filename':function(_0x1d3092,_0x2bf364,_0x1a6b86){_0x2bf364[_0x32d3('0x1f')]=_0x2bf364[_0x32d3('0x1f')][_0x32d3('0x26')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1a6b86(null,util['format']('%s-%s%s',path[_0x32d3('0x27')](_0x2bf364[_0x32d3('0x1f')],path[_0x32d3('0x21')](_0x2bf364[_0x32d3('0x1f')])),Date[_0x32d3('0x22')](),path[_0x32d3('0x21')](_0x2bf364[_0x32d3('0x1f')])));}})});router[_0x32d3('0x15')](_0x32d3('0x28'),upload[_0x32d3('0x23')](_0x32d3('0x24')),controller[_0x32d3('0x29')]);router['post'](_0x32d3('0x2a'),auth['isAuthenticated'](),controller[_0x32d3('0x2b')]);router['put'](_0x32d3('0xb'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x2c')]);router[_0x32d3('0x2d')](_0x32d3('0xb'),auth[_0x32d3('0x7')](),controller[_0x32d3('0x2e')]);module[_0x32d3('0x2f')]=router;
\ No newline at end of file
+var _0xb804=['root','server/files/tmp','originalname','replace','format','%s-%s%s','extname','now','single','uploadCsv','basename','/upload','file','/upload/:id','import','/:id','multer','util','path','connect-timeout','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','isAuthenticated','describe','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/jscripty_sessions','/:id/journey','getJourney','post','/merge','merge','create','bulkCreate','/:id/tags','setTags','diskStorage','join'];(function(_0x4f75b1,_0x4fc4f7){var _0x192e05=function(_0x3398e9){while(--_0x3398e9){_0x4f75b1['push'](_0x4f75b1['shift']());}};_0x192e05(++_0x4fc4f7);}(_0xb804,0x1ae));var _0x4b80=function(_0x537098,_0x653f67){_0x537098=_0x537098-0x0;var _0x5941a8=_0xb804[_0x537098];return _0x5941a8;};'use strict';var multer=require(_0x4b80('0x0'));var util=require(_0x4b80('0x1'));var path=require(_0x4b80('0x2'));var timeout=require(_0x4b80('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4b80('0x4'));var config=require(_0x4b80('0x5'));var controller=require(_0x4b80('0x6'));router[_0x4b80('0x7')]('/',auth['isAuthenticated'](),controller[_0x4b80('0x8')]);router[_0x4b80('0x7')]('/describe',auth[_0x4b80('0x9')](),controller[_0x4b80('0xa')]);router[_0x4b80('0x7')]('/:id',auth[_0x4b80('0x9')](),controller[_0x4b80('0xb')]);router[_0x4b80('0x7')]('/:id/tags',auth[_0x4b80('0x9')](),controller[_0x4b80('0xc')]);router[_0x4b80('0x7')](_0x4b80('0xd'),auth[_0x4b80('0x9')](),controller[_0x4b80('0xe')]);router['get'](_0x4b80('0xf'),auth[_0x4b80('0x9')](),controller[_0x4b80('0x10')]);router[_0x4b80('0x7')]('/:id/hopper_finals',auth[_0x4b80('0x9')](),controller[_0x4b80('0x11')]);router[_0x4b80('0x7')](_0x4b80('0x12'),auth[_0x4b80('0x9')](),controller['getJscriptySessions']);router[_0x4b80('0x7')](_0x4b80('0x13'),auth['isAuthenticated'](),controller[_0x4b80('0x14')]);router[_0x4b80('0x15')](_0x4b80('0x16'),auth['isAuthenticated'](),controller[_0x4b80('0x17')]);router[_0x4b80('0x15')]('/',auth['isAuthenticated'](),controller[_0x4b80('0x18')]);router[_0x4b80('0x15')]('/create_many',auth[_0x4b80('0x9')](),controller[_0x4b80('0x19')]);router[_0x4b80('0x15')](_0x4b80('0x1a'),auth['isAuthenticated'](),controller[_0x4b80('0x1b')]);var upload=multer({'storage':multer[_0x4b80('0x1c')]({'destination':function(_0x584512,_0x20e563,_0x105f09){_0x105f09(null,path[_0x4b80('0x1d')](config[_0x4b80('0x1e')],_0x4b80('0x1f')));},'filename':function(_0x336dfb,_0x39dbe8,_0x3697ff){_0x39dbe8[_0x4b80('0x20')]=_0x39dbe8['originalname'][_0x4b80('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3697ff(null,util[_0x4b80('0x22')](_0x4b80('0x23'),path['basename'](_0x39dbe8['originalname'],path[_0x4b80('0x24')](_0x39dbe8[_0x4b80('0x20')])),Date[_0x4b80('0x25')](),path[_0x4b80('0x24')](_0x39dbe8[_0x4b80('0x20')])));}})});router[_0x4b80('0x15')]('/csv',upload[_0x4b80('0x26')]('file'),controller[_0x4b80('0x27')]);var upload=multer({'storage':multer[_0x4b80('0x1c')]({'destination':function(_0x3a7227,_0x1552a0,_0x1e2f61){_0x1e2f61(null,path[_0x4b80('0x1d')](config[_0x4b80('0x1e')],_0x4b80('0x1f')));},'filename':function(_0x4a865a,_0xde309e,_0xa33104){_0xde309e['originalname']=_0xde309e['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xa33104(null,util[_0x4b80('0x22')]('%s-%s%s',path[_0x4b80('0x28')](_0xde309e[_0x4b80('0x20')],path['extname'](_0xde309e['originalname'])),Date[_0x4b80('0x25')](),path['extname'](_0xde309e[_0x4b80('0x20')])));}})});router[_0x4b80('0x15')](_0x4b80('0x29'),upload[_0x4b80('0x26')](_0x4b80('0x2a')),controller['upload']);router['post'](_0x4b80('0x2b'),auth[_0x4b80('0x9')](),controller[_0x4b80('0x2c')]);router['put'](_0x4b80('0x2d'),auth[_0x4b80('0x9')](),controller['update']);router['delete'](_0x4b80('0x2d'),auth[_0x4b80('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 25058b9..15c67af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75b9=['setDataValue','alias','name','TEXT','long','type','select','parse','values','stringify','BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','STRING'];(function(_0x431f76,_0x3d65a7){var _0x36e844=function(_0x44afc1){while(--_0x44afc1){_0x431f76['push'](_0x431f76['shift']());}};_0x36e844(++_0x3d65a7);}(_0x75b9,0x1f3));var _0x975b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x75b9[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');var _=require(_0x975b('0x0'));module[_0x975b('0x1')]={'name':{'type':Sequelize[_0x975b('0x2')],'get':function(_0x2418d8){return this[_0x975b('0x3')]('alias');}},'alias':{'type':Sequelize[_0x975b('0x4')],'allowNull':![],'set':function(_0x36842a){this[_0x975b('0x5')](_0x975b('0x6'),_0x36842a?_0x36842a:this[_0x975b('0x3')](_0x975b('0x7')));}},'type':{'type':Sequelize[_0x975b('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x975b('0x8')](_0x975b('0x9')),'get':function(){if(this[_0x975b('0x3')](_0x975b('0xa'))===_0x975b('0xb')){return JSON[_0x975b('0xc')](this[_0x975b('0x3')]('values'));}else{return this[_0x975b('0x3')](_0x975b('0xd'));}},'set':function(_0x44cdc1){if(Array['isArray'](_0x44cdc1)){this['setDataValue'](_0x975b('0xd'),JSON[_0x975b('0xe')](_0x44cdc1));}else{this[_0x975b('0x5')](_0x975b('0xd'),_0x44cdc1);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x975b('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x975b('0x10')](_0x975b('0x11'))}};
\ No newline at end of file
+var _0xd38a=['stringify','BOOLEAN','ENUM','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','getDataValue','TEXT','type','select','parse','isArray','values'];(function(_0x57bca5,_0x1fc3a4){var _0x58029d=function(_0x4df89d){while(--_0x4df89d){_0x57bca5['push'](_0x57bca5['shift']());}};_0x58029d(++_0x1fc3a4);}(_0xd38a,0xad));var _0xad38=function(_0x3b732c,_0x5bc6d4){_0x3b732c=_0x3b732c-0x0;var _0x232319=_0xd38a[_0x3b732c];return _0x232319;};'use strict';var Sequelize=require(_0xad38('0x0'));var _=require(_0xad38('0x1'));module[_0xad38('0x2')]={'name':{'type':Sequelize[_0xad38('0x3')],'get':function(_0x124320){return this['getDataValue'](_0xad38('0x4'));}},'alias':{'type':Sequelize[_0xad38('0x5')],'allowNull':![],'set':function(_0x10c584){this[_0xad38('0x6')](_0xad38('0x4'),_0x10c584?_0x10c584:this[_0xad38('0x7')]('name'));}},'type':{'type':Sequelize[_0xad38('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0xad38('0x8')]('long'),'get':function(){if(this['getDataValue'](_0xad38('0x9'))===_0xad38('0xa')){return JSON[_0xad38('0xb')](this[_0xad38('0x7')]('values'));}else{return this[_0xad38('0x7')]('values');}},'set':function(_0x3d0ace){if(Array[_0xad38('0xc')](_0x3d0ace)){this[_0xad38('0x6')](_0xad38('0xd'),JSON[_0xad38('0xe')](_0x3d0ace));}else{this[_0xad38('0x6')]('values',_0x3d0ace);}}},'required':{'type':Sequelize[_0xad38('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xad38('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xad38('0x10')]('voice')}};
\ No newline at end of file
index 8cbe2c8..447cb38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x206f=['fieldName','key','model','differenceBy','keys','query','filters','attributes','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','intersection','find','body','params','destroy','create','sequelize','transaction','text','type','Sequelize','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','CmCustomField','rawAttributes'];(function(_0x15bc2f,_0x25e563){var _0x574008=function(_0x220bee){while(--_0x220bee){_0x15bc2f['push'](_0x15bc2f['shift']());}};_0x574008(++_0x25e563);}(_0x206f,0x189));var _0xf206=function(_0x2b4154,_0x4e9cba){_0x2b4154=_0x2b4154-0x0;var _0x59768f=_0x206f[_0x2b4154];return _0x59768f;};'use strict';var emlformat=require(_0xf206('0x0'));var rimraf=require(_0xf206('0x1'));var zipdir=require(_0xf206('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf206('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf206('0x4'));var util=require(_0xf206('0x5'));var path=require('path');var sox=require(_0xf206('0x6'));var csv=require(_0xf206('0x7'));var ejs=require(_0xf206('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf206('0x9'));var squel=require(_0xf206('0xa'));var crypto=require('crypto');var jsforce=require(_0xf206('0xb'));var deskjs=require(_0xf206('0xc'));var toCsv=require(_0xf206('0x7'));var querystring=require(_0xf206('0xd'));var Papa=require('papaparse');var Redis=require(_0xf206('0xe'));var authService=require(_0xf206('0xf'));var qs=require(_0xf206('0x10'));var as=require(_0xf206('0x11'));var hardwareService=require(_0xf206('0x12'));var logger=require(_0xf206('0x13'))(_0xf206('0x14'));var utils=require(_0xf206('0x15'));var config=require(_0xf206('0x16'));var licenseUtil=require(_0xf206('0x17'));var db=require(_0xf206('0x18'))['db'];function respondWithStatusCode(_0x4d71e1,_0x369a68){_0x369a68=_0x369a68||0xcc;return function(_0x2e9941){if(_0x2e9941){return _0x4d71e1['sendStatus'](_0x369a68);}return _0x4d71e1[_0xf206('0x19')](_0x369a68)[_0xf206('0x1a')]();};}function respondWithResult(_0x5cf2cc,_0x14d598){_0x14d598=_0x14d598||0xc8;return function(_0xabc92d){if(_0xabc92d){return _0x5cf2cc[_0xf206('0x19')](_0x14d598)['json'](_0xabc92d);}};}function respondWithFilteredResult(_0x53e057,_0x15eeb7){return function(_0x46d8fe){if(_0x46d8fe){var _0x47aa7a=typeof _0x15eeb7[_0xf206('0x1b')]===_0xf206('0x1c')&&typeof _0x15eeb7[_0xf206('0x1d')]===_0xf206('0x1c');var _0xb7f45b=_0x46d8fe[_0xf206('0x1e')];var _0x565ddc=_0x47aa7a?0x0:_0x15eeb7[_0xf206('0x1b')];var _0x5b0c4b=_0x47aa7a?_0x46d8fe[_0xf206('0x1e')]:_0x15eeb7[_0xf206('0x1b')]+_0x15eeb7[_0xf206('0x1d')];var _0x4b8393;if(_0x5b0c4b>=_0xb7f45b){_0x5b0c4b=_0xb7f45b;_0x4b8393=0xc8;}else{_0x4b8393=0xce;}_0x53e057['status'](_0x4b8393);return _0x53e057[_0xf206('0x1f')](_0xf206('0x20'),_0x565ddc+'-'+_0x5b0c4b+'/'+_0xb7f45b)[_0xf206('0x21')](_0x46d8fe);}return null;};}function patchUpdates(_0x3e78b8){return function(_0xa39424){try{jsonpatch[_0xf206('0x22')](_0xa39424,_0x3e78b8,!![]);}catch(_0x4d8a07){return BPromise[_0xf206('0x23')](_0x4d8a07);}return _0xa39424[_0xf206('0x24')]();};}function saveUpdates(_0x46a7ff,_0x3be4e3){return function(_0x1b892f){if(_0x1b892f){return _0x1b892f[_0xf206('0x25')](_0x46a7ff)[_0xf206('0x26')](function(_0xddec44){return _0xddec44;});}return null;};}function removeEntity(_0x4cd511,_0x1e1887){return function(_0xa12c19){if(_0xa12c19){return _0xa12c19['destroy']()[_0xf206('0x26')](function(){_0x4cd511[_0xf206('0x19')](0xcc)[_0xf206('0x1a')]();});}};}function handleEntityNotFound(_0x1f6edb,_0x2a82e6){return function(_0x6dc567){if(!_0x6dc567){_0x1f6edb[_0xf206('0x27')](0x194);}return _0x6dc567;};}function handleError(_0x3c9b1c,_0xba6632){_0xba6632=_0xba6632||0x1f4;return function(_0x1eef81){logger[_0xf206('0x28')](_0x1eef81[_0xf206('0x29')]);if(_0x1eef81[_0xf206('0x2a')]){delete _0x1eef81[_0xf206('0x2a')];}_0x3c9b1c[_0xf206('0x19')](_0xba6632)[_0xf206('0x2b')](_0x1eef81);};}exports['index']=function(_0xe81108,_0x444468){var _0x102074={},_0x3a49e3={},_0x56bd03={'count':0x0,'rows':[]};var _0x2323d6=_[_0xf206('0x2c')](db[_0xf206('0x2d')][_0xf206('0x2e')],function(_0x5d9741){return{'name':_0x5d9741[_0xf206('0x2f')],'type':_0x5d9741['type'][_0xf206('0x30')]};});_0x3a49e3[_0xf206('0x31')]=_[_0xf206('0x32')](_[_0xf206('0x2c')](_0x2323d6,'name'),[_0xf206('0x2a')]);_0x3a49e3['query']=_[_0xf206('0x33')](_0xe81108[_0xf206('0x34')]);_0x3a49e3[_0xf206('0x35')]=_['intersection'](_0x3a49e3[_0xf206('0x31')],_0x3a49e3[_0xf206('0x34')]);_0x102074['attributes']=_['intersection'](_0x3a49e3[_0xf206('0x31')],qs['fields'](_0xe81108[_0xf206('0x34')]['fields']));_0x102074['attributes']=_0x102074[_0xf206('0x36')][_0xf206('0x37')]?_0x102074[_0xf206('0x36')]:_0x3a49e3['model'];if(!_0xe81108[_0xf206('0x34')][_0xf206('0x38')]('nolimit')){_0x102074[_0xf206('0x1d')]=qs[_0xf206('0x1d')](_0xe81108[_0xf206('0x34')][_0xf206('0x1d')]);_0x102074[_0xf206('0x1b')]=qs[_0xf206('0x1b')](_0xe81108['query'][_0xf206('0x1b')]);}_0x102074[_0xf206('0x39')]=qs[_0xf206('0x3a')](_0xe81108[_0xf206('0x34')][_0xf206('0x3a')]);_0x102074['where']=qs[_0xf206('0x35')](_['pick'](_0xe81108[_0xf206('0x34')],_0x3a49e3[_0xf206('0x35')]),_0x2323d6);if(_0xe81108[_0xf206('0x34')][_0xf206('0x3b')]){_0x102074[_0xf206('0x3c')]=_[_0xf206('0x3d')](_0x102074['where'],{'$or':_['map'](_0x2323d6,function(_0x491ac8){if(_0x491ac8['type']!==_0xf206('0x3e')){var _0xd7e917={};_0xd7e917[_0x491ac8[_0xf206('0x2a')]]={'$like':'%'+_0xe81108[_0xf206('0x34')]['filter']+'%'};return _0xd7e917;}})});}_0x102074=_['merge']({},_0x102074,_0xe81108['options']);var _0x4caa9c={'where':_0x102074[_0xf206('0x3c')]};return db[_0xf206('0x2d')][_0xf206('0x1e')](_0x4caa9c)['then'](function(_0x16af9f){_0x56bd03['count']=_0x16af9f;if(_0xe81108[_0xf206('0x34')][_0xf206('0x3f')]){_0x102074[_0xf206('0x40')]=[{'all':!![]}];}return db['CmCustomField'][_0xf206('0x41')](_0x102074);})[_0xf206('0x26')](function(_0x5690fa){_0x56bd03['rows']=_0x5690fa;return _0x56bd03;})[_0xf206('0x26')](respondWithFilteredResult(_0x444468,_0x102074))[_0xf206('0x42')](handleError(_0x444468,null));};exports[_0xf206('0x43')]=function(_0x213baf,_0x6cbe90){var _0x5e7dd0={'raw':!![],'where':{'id':_0x213baf['params']['id']}},_0x5c6531={};_0x5c6531[_0xf206('0x31')]=_['keys'](db[_0xf206('0x2d')]['rawAttributes']);_0x5c6531[_0xf206('0x34')]=_[_0xf206('0x33')](_0x213baf[_0xf206('0x34')]);_0x5c6531[_0xf206('0x35')]=_[_0xf206('0x44')](_0x5c6531[_0xf206('0x31')],_0x5c6531[_0xf206('0x34')]);_0x5e7dd0[_0xf206('0x36')]=_[_0xf206('0x44')](_0x5c6531[_0xf206('0x31')],qs['fields'](_0x213baf[_0xf206('0x34')]['fields']));_0x5e7dd0[_0xf206('0x36')]=_0x5e7dd0[_0xf206('0x36')][_0xf206('0x37')]?_0x5e7dd0[_0xf206('0x36')]:_0x5c6531[_0xf206('0x31')];if(_0x213baf[_0xf206('0x34')][_0xf206('0x3f')]){_0x5e7dd0[_0xf206('0x40')]=[{'all':!![]}];}_0x5e7dd0=_['merge']({},_0x5e7dd0,_0x213baf['options']);return db[_0xf206('0x2d')][_0xf206('0x45')](_0x5e7dd0)['then'](handleEntityNotFound(_0x6cbe90,null))[_0xf206('0x26')](respondWithResult(_0x6cbe90,null))[_0xf206('0x42')](handleError(_0x6cbe90,null));};exports[_0xf206('0x25')]=function(_0x318950,_0x3a1814){if(_0x318950[_0xf206('0x46')]['id']){delete _0x318950[_0xf206('0x46')]['id'];}return db[_0xf206('0x2d')][_0xf206('0x45')]({'where':{'id':_0x318950[_0xf206('0x47')]['id']}})['then'](handleEntityNotFound(_0x3a1814,null))[_0xf206('0x26')](saveUpdates(_0x318950[_0xf206('0x46')],null))[_0xf206('0x26')](respondWithResult(_0x3a1814,null))['catch'](handleError(_0x3a1814,null));};exports[_0xf206('0x48')]=function(_0x22bd5d,_0x39aa7c){return db[_0xf206('0x2d')][_0xf206('0x45')]({'where':{'id':_0x22bd5d[_0xf206('0x47')]['id']}})['then'](handleEntityNotFound(_0x39aa7c,null))[_0xf206('0x26')](removeEntity(_0x39aa7c,null))[_0xf206('0x42')](handleError(_0x39aa7c,null));};exports[_0xf206('0x49')]=function(_0x58ff58,_0x23713b){var _0x20e26d;return db[_0xf206('0x4a')][_0xf206('0x4b')](function(_0x202435){return db['CmCustomField'][_0xf206('0x49')](_0x58ff58[_0xf206('0x46')],{'transaction':_0x202435})['then'](function(_0x41d17e){_0x20e26d=_0x41d17e;var _0x55d60c={'type':db['Sequelize']['TEXT'],'transaction':_0x202435};switch(_0x58ff58[_0xf206('0x46')]['type']){case _0xf206('0x4c'):_0x55d60c[_0xf206('0x4d')]=db[_0xf206('0x4e')][_0xf206('0x4f')];break;case'number':_0x55d60c[_0xf206('0x4d')]=db[_0xf206('0x4e')][_0xf206('0x50')];break;case _0xf206('0x51'):_0x55d60c[_0xf206('0x4d')]=db[_0xf206('0x4e')][_0xf206('0x52')];_0x55d60c[_0xf206('0x53')]=![];break;default:}return db[_0xf206('0x4a')][_0xf206('0x54')][_0xf206('0x55')]('cm_contacts',util[_0xf206('0x56')](_0xf206('0x57'),_0x20e26d['id']),_0x55d60c);})[_0xf206('0x26')](function(){return _0x20e26d;});})[_0xf206('0x26')](respondWithResult(_0x23713b,0xc9))[_0xf206('0x42')](handleError(_0x23713b,null));};
\ No newline at end of file
+var _0xda3c=['pick','filter','merge','where','VIRTUAL','includeAll','include','findAll','then','rows','catch','show','rawAttributes','length','options','find','params','create','sequelize','Sequelize','TEXT','body','text','number','switch','BOOLEAN','defaultValue','addColumn','format','cf_%d','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','update','destroy','stack','name','index','map','CmCustomField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x59fa94,_0x41c802){var _0x3db30c=function(_0x3189db){while(--_0x3189db){_0x59fa94['push'](_0x59fa94['shift']());}};_0x3db30c(++_0x41c802);}(_0xda3c,0x1d1));var _0xcda3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xda3c[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xcda3('0x0'));var rimraf=require(_0xcda3('0x1'));var zipdir=require(_0xcda3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcda3('0x3'));var moment=require(_0xcda3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcda3('0x5'));var util=require('util');var path=require(_0xcda3('0x6'));var sox=require(_0xcda3('0x7'));var csv=require(_0xcda3('0x8'));var ejs=require(_0xcda3('0x9'));var fs=require('fs');var fs_extra=require(_0xcda3('0xa'));var _=require('lodash');var squel=require(_0xcda3('0xb'));var crypto=require(_0xcda3('0xc'));var jsforce=require(_0xcda3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcda3('0x8'));var querystring=require(_0xcda3('0xe'));var Papa=require(_0xcda3('0xf'));var Redis=require(_0xcda3('0x10'));var authService=require(_0xcda3('0x11'));var qs=require(_0xcda3('0x12'));var as=require(_0xcda3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcda3('0x14'))(_0xcda3('0x15'));var utils=require(_0xcda3('0x16'));var config=require(_0xcda3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xcda3('0x18'))['db'];function respondWithStatusCode(_0xee4bc,_0x2a3fa4){_0x2a3fa4=_0x2a3fa4||0xcc;return function(_0x3a4470){if(_0x3a4470){return _0xee4bc[_0xcda3('0x19')](_0x2a3fa4);}return _0xee4bc[_0xcda3('0x1a')](_0x2a3fa4)[_0xcda3('0x1b')]();};}function respondWithResult(_0xa62158,_0x52b3de){_0x52b3de=_0x52b3de||0xc8;return function(_0x4aa7e8){if(_0x4aa7e8){return _0xa62158[_0xcda3('0x1a')](_0x52b3de)[_0xcda3('0x1c')](_0x4aa7e8);}};}function respondWithFilteredResult(_0x589b3b,_0x420243){return function(_0x2c275e){if(_0x2c275e){var _0x47903a=typeof _0x420243['offset']==='undefined'&&typeof _0x420243[_0xcda3('0x1d')]===_0xcda3('0x1e');var _0x40cb67=_0x2c275e[_0xcda3('0x1f')];var _0x260a34=_0x47903a?0x0:_0x420243[_0xcda3('0x20')];var _0x3cfafb=_0x47903a?_0x2c275e[_0xcda3('0x1f')]:_0x420243[_0xcda3('0x20')]+_0x420243['limit'];var _0x4c6a69;if(_0x3cfafb>=_0x40cb67){_0x3cfafb=_0x40cb67;_0x4c6a69=0xc8;}else{_0x4c6a69=0xce;}_0x589b3b['status'](_0x4c6a69);return _0x589b3b[_0xcda3('0x21')](_0xcda3('0x22'),_0x260a34+'-'+_0x3cfafb+'/'+_0x40cb67)[_0xcda3('0x1c')](_0x2c275e);}return null;};}function patchUpdates(_0x491f26){return function(_0x370f20){try{jsonpatch['apply'](_0x370f20,_0x491f26,!![]);}catch(_0x11b6d9){return BPromise[_0xcda3('0x23')](_0x11b6d9);}return _0x370f20['save']();};}function saveUpdates(_0x1c2e8e,_0x5dd3f6){return function(_0x1668d5){if(_0x1668d5){return _0x1668d5[_0xcda3('0x24')](_0x1c2e8e)['then'](function(_0x5b020a){return _0x5b020a;});}return null;};}function removeEntity(_0x2ffed7,_0x377d7f){return function(_0xb621f7){if(_0xb621f7){return _0xb621f7[_0xcda3('0x25')]()['then'](function(){_0x2ffed7[_0xcda3('0x1a')](0xcc)[_0xcda3('0x1b')]();});}};}function handleEntityNotFound(_0x4b5dae,_0x356511){return function(_0x13d2a8){if(!_0x13d2a8){_0x4b5dae[_0xcda3('0x19')](0x194);}return _0x13d2a8;};}function handleError(_0x4549b6,_0x2829be){_0x2829be=_0x2829be||0x1f4;return function(_0x403e16){logger['error'](_0x403e16[_0xcda3('0x26')]);if(_0x403e16[_0xcda3('0x27')]){delete _0x403e16[_0xcda3('0x27')];}_0x4549b6['status'](_0x2829be)['send'](_0x403e16);};}exports[_0xcda3('0x28')]=function(_0x50af0b,_0x5ae0ce){var _0xd0046c={},_0x574aab={},_0x240832={'count':0x0,'rows':[]};var _0x5cfd02=_[_0xcda3('0x29')](db[_0xcda3('0x2a')]['rawAttributes'],function(_0x59fe05){return{'name':_0x59fe05[_0xcda3('0x2b')],'type':_0x59fe05[_0xcda3('0x2c')][_0xcda3('0x2d')]};});_0x574aab[_0xcda3('0x2e')]=_['differenceBy'](_[_0xcda3('0x29')](_0x5cfd02,_0xcda3('0x27')),[_0xcda3('0x27')]);_0x574aab[_0xcda3('0x2f')]=_[_0xcda3('0x30')](_0x50af0b[_0xcda3('0x2f')]);_0x574aab[_0xcda3('0x31')]=_[_0xcda3('0x32')](_0x574aab[_0xcda3('0x2e')],_0x574aab[_0xcda3('0x2f')]);_0xd0046c[_0xcda3('0x33')]=_[_0xcda3('0x32')](_0x574aab[_0xcda3('0x2e')],qs[_0xcda3('0x34')](_0x50af0b[_0xcda3('0x2f')]['fields']));_0xd0046c[_0xcda3('0x33')]=_0xd0046c['attributes']['length']?_0xd0046c['attributes']:_0x574aab['model'];if(!_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x35')](_0xcda3('0x36'))){_0xd0046c['limit']=qs[_0xcda3('0x1d')](_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x1d')]);_0xd0046c[_0xcda3('0x20')]=qs['offset'](_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x20')]);}_0xd0046c[_0xcda3('0x37')]=qs[_0xcda3('0x38')](_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x38')]);_0xd0046c['where']=qs['filters'](_[_0xcda3('0x39')](_0x50af0b['query'],_0x574aab['filters']),_0x5cfd02);if(_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x3a')]){_0xd0046c['where']=_[_0xcda3('0x3b')](_0xd0046c[_0xcda3('0x3c')],{'$or':_[_0xcda3('0x29')](_0x5cfd02,function(_0x2e4601){if(_0x2e4601[_0xcda3('0x2c')]!==_0xcda3('0x3d')){var _0x4a106c={};_0x4a106c[_0x2e4601['name']]={'$like':'%'+_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x3a')]+'%'};return _0x4a106c;}})});}_0xd0046c=_[_0xcda3('0x3b')]({},_0xd0046c,_0x50af0b['options']);var _0x3dc3db={'where':_0xd0046c['where']};return db[_0xcda3('0x2a')]['count'](_0x3dc3db)['then'](function(_0x2dc85c){_0x240832[_0xcda3('0x1f')]=_0x2dc85c;if(_0x50af0b[_0xcda3('0x2f')][_0xcda3('0x3e')]){_0xd0046c[_0xcda3('0x3f')]=[{'all':!![]}];}return db[_0xcda3('0x2a')][_0xcda3('0x40')](_0xd0046c);})[_0xcda3('0x41')](function(_0x586606){_0x240832[_0xcda3('0x42')]=_0x586606;return _0x240832;})[_0xcda3('0x41')](respondWithFilteredResult(_0x5ae0ce,_0xd0046c))[_0xcda3('0x43')](handleError(_0x5ae0ce,null));};exports[_0xcda3('0x44')]=function(_0x26cab3,_0x36d2cb){var _0x58a561={'raw':!![],'where':{'id':_0x26cab3['params']['id']}},_0x127249={};_0x127249[_0xcda3('0x2e')]=_[_0xcda3('0x30')](db[_0xcda3('0x2a')][_0xcda3('0x45')]);_0x127249['query']=_[_0xcda3('0x30')](_0x26cab3[_0xcda3('0x2f')]);_0x127249['filters']=_['intersection'](_0x127249[_0xcda3('0x2e')],_0x127249['query']);_0x58a561[_0xcda3('0x33')]=_['intersection'](_0x127249[_0xcda3('0x2e')],qs[_0xcda3('0x34')](_0x26cab3['query'][_0xcda3('0x34')]));_0x58a561[_0xcda3('0x33')]=_0x58a561['attributes'][_0xcda3('0x46')]?_0x58a561[_0xcda3('0x33')]:_0x127249[_0xcda3('0x2e')];if(_0x26cab3[_0xcda3('0x2f')][_0xcda3('0x3e')]){_0x58a561[_0xcda3('0x3f')]=[{'all':!![]}];}_0x58a561=_['merge']({},_0x58a561,_0x26cab3[_0xcda3('0x47')]);return db[_0xcda3('0x2a')][_0xcda3('0x48')](_0x58a561)[_0xcda3('0x41')](handleEntityNotFound(_0x36d2cb,null))['then'](respondWithResult(_0x36d2cb,null))[_0xcda3('0x43')](handleError(_0x36d2cb,null));};exports['update']=function(_0x43798a,_0x47249d){if(_0x43798a['body']['id']){delete _0x43798a['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x43798a['params']['id']}})[_0xcda3('0x41')](handleEntityNotFound(_0x47249d,null))[_0xcda3('0x41')](saveUpdates(_0x43798a['body'],null))[_0xcda3('0x41')](respondWithResult(_0x47249d,null))['catch'](handleError(_0x47249d,null));};exports[_0xcda3('0x25')]=function(_0x5333a1,_0x3fb19e){return db[_0xcda3('0x2a')][_0xcda3('0x48')]({'where':{'id':_0x5333a1[_0xcda3('0x49')]['id']}})[_0xcda3('0x41')](handleEntityNotFound(_0x3fb19e,null))[_0xcda3('0x41')](removeEntity(_0x3fb19e,null))['catch'](handleError(_0x3fb19e,null));};exports[_0xcda3('0x4a')]=function(_0x19715b,_0x13439e){var _0x144d16;return db[_0xcda3('0x4b')]['transaction'](function(_0x319ec0){return db['CmCustomField']['create'](_0x19715b['body'],{'transaction':_0x319ec0})[_0xcda3('0x41')](function(_0x4e19e6){_0x144d16=_0x4e19e6;var _0x27d3ba={'type':db[_0xcda3('0x4c')][_0xcda3('0x4d')],'transaction':_0x319ec0};switch(_0x19715b[_0xcda3('0x4e')][_0xcda3('0x2c')]){case _0xcda3('0x4f'):_0x27d3ba['type']=db[_0xcda3('0x4c')][_0xcda3('0x4d')];break;case _0xcda3('0x50'):_0x27d3ba['type']=db[_0xcda3('0x4c')]['INTEGER'];break;case _0xcda3('0x51'):_0x27d3ba[_0xcda3('0x2c')]=db['Sequelize'][_0xcda3('0x52')];_0x27d3ba[_0xcda3('0x53')]=![];break;default:}return db[_0xcda3('0x4b')]['queryInterface'][_0xcda3('0x54')]('cm_contacts',util[_0xcda3('0x55')](_0xcda3('0x56'),_0x144d16['id']),_0x27d3ba);})[_0xcda3('0x41')](function(){return _0x144d16;});})['then'](respondWithResult(_0x13439e,0xc9))[_0xcda3('0x43')](handleError(_0x13439e,null));};
\ No newline at end of file
index af475cc..e97c9aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c17=['./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x8c17,0x190));var _0x78c1=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x8c17[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0x78c1('0x0'));var util=require(_0x78c1('0x1'));var logger=require(_0x78c1('0x2'))('api');var moment=require(_0x78c1('0x3'));var BPromise=require(_0x78c1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78c1('0x5'));var rimraf=require('rimraf');var config=require(_0x78c1('0x6'));var attributes=require(_0x78c1('0x7'));module[_0x78c1('0x8')]=function(_0x2435a5,_0x59b72d){return _0x2435a5[_0x78c1('0x9')]('CmCustomField',attributes,{'tableName':_0x78c1('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3eaa=['moment','bluebird','request-promise','path','rimraf','exports','CmCustomField','cm_custom_fields','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3eaa,0x1dc));var _0xa3ea=function(_0x313e77,_0x4ffd44){_0x313e77=_0x313e77-0x0;var _0xf5bab0=_0x3eaa[_0x313e77];return _0xf5bab0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa3ea('0x0'))('api');var moment=require(_0xa3ea('0x1'));var BPromise=require(_0xa3ea('0x2'));var rp=require(_0xa3ea('0x3'));var fs=require('fs');var path=require(_0xa3ea('0x4'));var rimraf=require(_0xa3ea('0x5'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0xa3ea('0x6')]=function(_0x37906d,_0x3665fc){return _0x37906d['define'](_0xa3ea('0x7'),attributes,{'tableName':_0xa3ea('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e84c38d..96188f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x431c=['jayson/promise','client','http','then','info','CmCustomField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x431c,0xc9));var _0xc431=function(_0x4ccdc0,_0x1073ea){_0x4ccdc0=_0x4ccdc0-0x0;var _0x218224=_0x431c[_0x4ccdc0];return _0x218224;};'use strict';var _=require(_0xc431('0x0'));var util=require(_0xc431('0x1'));var moment=require(_0xc431('0x2'));var BPromise=require(_0xc431('0x3'));var rs=require(_0xc431('0x4'));var fs=require('fs');var Redis=require(_0xc431('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc431('0x6'))('rpc');var config=require(_0xc431('0x7'));var jayson=require(_0xc431('0x8'));var client=jayson[_0xc431('0x9')][_0xc431('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d1796,_0x1314c4,_0x2d4a42){return new BPromise(function(_0x138cfb,_0x5eba40){return client['request'](_0x5d1796,_0x2d4a42)[_0xc431('0xb')](function(_0x8094d9){logger[_0xc431('0xc')](_0xc431('0xd'),_0x1314c4,'request\x20sent');logger[_0xc431('0xe')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x1314c4,_0xc431('0xf'),JSON[_0xc431('0x10')](_0x8094d9));if(_0x8094d9['error']){if(_0x8094d9[_0xc431('0x11')]['code']===0x1f4){logger[_0xc431('0x11')](_0xc431('0xd'),_0x1314c4,_0x8094d9[_0xc431('0x11')][_0xc431('0x12')]);return _0x5eba40(_0x8094d9[_0xc431('0x11')]['message']);}logger[_0xc431('0x11')](_0xc431('0xd'),_0x1314c4,_0x8094d9[_0xc431('0x11')][_0xc431('0x12')]);return _0x138cfb(_0x8094d9['error'][_0xc431('0x12')]);}else{logger[_0xc431('0xc')]('CmCustomField,\x20%s,\x20%s',_0x1314c4,_0xc431('0xf'));_0x138cfb(_0x8094d9['result'][_0xc431('0x12')]);}})['catch'](function(_0x8915d7){logger[_0xc431('0x11')]('CmCustomField,\x20%s,\x20%s',_0x1314c4,_0x8915d7);_0x5eba40(_0x8915d7);});});}
\ No newline at end of file
+var _0xd52f=['http','request','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','CmCustomField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x137b9b,_0x160277){var _0x36df54=function(_0x3ffe97){while(--_0x3ffe97){_0x137b9b['push'](_0x137b9b['shift']());}};_0x36df54(++_0x160277);}(_0xd52f,0x131));var _0xfd52=function(_0x2a58e8,_0xea057d){_0x2a58e8=_0x2a58e8-0x0;var _0x279892=_0xd52f[_0x2a58e8];return _0x279892;};'use strict';var _=require(_0xfd52('0x0'));var util=require(_0xfd52('0x1'));var moment=require(_0xfd52('0x2'));var BPromise=require(_0xfd52('0x3'));var rs=require(_0xfd52('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfd52('0x5'));var logger=require(_0xfd52('0x6'))(_0xfd52('0x7'));var config=require(_0xfd52('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd52('0x9')][_0xfd52('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f6679,_0x20b355,_0xe8088d){return new BPromise(function(_0x525967,_0x4d5d32){return client[_0xfd52('0xb')](_0x4f6679,_0xe8088d)['then'](function(_0x2e8668){logger[_0xfd52('0xc')]('CmCustomField,\x20%s,\x20%s',_0x20b355,_0xfd52('0xd'));logger[_0xfd52('0xe')](_0xfd52('0xf'),_0x20b355,'request\x20sent',JSON[_0xfd52('0x10')](_0x2e8668));if(_0x2e8668[_0xfd52('0x11')]){if(_0x2e8668[_0xfd52('0x11')]['code']===0x1f4){logger[_0xfd52('0x11')](_0xfd52('0x12'),_0x20b355,_0x2e8668['error'][_0xfd52('0x13')]);return _0x4d5d32(_0x2e8668[_0xfd52('0x11')][_0xfd52('0x13')]);}logger[_0xfd52('0x11')](_0xfd52('0x12'),_0x20b355,_0x2e8668[_0xfd52('0x11')][_0xfd52('0x13')]);return _0x525967(_0x2e8668[_0xfd52('0x11')]['message']);}else{logger[_0xfd52('0xc')](_0xfd52('0x12'),_0x20b355,_0xfd52('0xd'));_0x525967(_0x2e8668['result'][_0xfd52('0x13')]);}})[_0xfd52('0x14')](function(_0x2ba558){logger[_0xfd52('0x11')](_0xfd52('0x12'),_0x20b355,_0x2ba558);_0x4d5d32(_0x2ba558);});});}
\ No newline at end of file
index 4c8d08b..46fa5cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x737d=['index','/:id','show','post','put','update','delete','destroy','multer','util','fs-extra','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated'];(function(_0x254076,_0x5ea16b){var _0x57b6de=function(_0x49dd90){while(--_0x49dd90){_0x254076['push'](_0x254076['shift']());}};_0x57b6de(++_0x5ea16b);}(_0x737d,0xbc));var _0xd737=function(_0xdb413a,_0x404236){_0xdb413a=_0xdb413a-0x0;var _0x22bfd5=_0x737d[_0xdb413a];return _0x22bfd5;};'use strict';var multer=require(_0xd737('0x0'));var util=require(_0xd737('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd737('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xd737('0x3'));var config=require('../../config/environment');var controller=require(_0xd737('0x4'));router[_0xd737('0x5')]('/',auth[_0xd737('0x6')](),controller[_0xd737('0x7')]);router[_0xd737('0x5')](_0xd737('0x8'),auth[_0xd737('0x6')](),controller[_0xd737('0x9')]);router[_0xd737('0xa')]('/',auth[_0xd737('0x6')](),controller['create']);router[_0xd737('0xb')](_0xd737('0x8'),auth['isAuthenticated'](),controller[_0xd737('0xc')]);router[_0xd737('0xd')]('/:id',auth[_0xd737('0x6')](),controller[_0xd737('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xe767=['connect-timeout','express','Router','fs-extra','../../config/environment','get','index','/:id','isAuthenticated','show','post','update','delete','exports','util','path'];(function(_0x10185f,_0x5c2f98){var _0x2e4f39=function(_0x21ec64){while(--_0x21ec64){_0x10185f['push'](_0x10185f['shift']());}};_0x2e4f39(++_0x5c2f98);}(_0xe767,0x11e));var _0x7e76=function(_0x5dbc14,_0x1bbbf4){_0x5dbc14=_0x5dbc14-0x0;var _0x237b78=_0xe767[_0x5dbc14];return _0x237b78;};'use strict';var multer=require('multer');var util=require(_0x7e76('0x0'));var path=require(_0x7e76('0x1'));var timeout=require(_0x7e76('0x2'));var express=require(_0x7e76('0x3'));var router=express[_0x7e76('0x4')]();var fs_extra=require(_0x7e76('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7e76('0x6'));var controller=require('./cmCustomField.controller');router[_0x7e76('0x7')]('/',auth['isAuthenticated'](),controller[_0x7e76('0x8')]);router[_0x7e76('0x7')](_0x7e76('0x9'),auth[_0x7e76('0xa')](),controller[_0x7e76('0xb')]);router[_0x7e76('0xc')]('/',auth[_0x7e76('0xa')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x7e76('0xd')]);router[_0x7e76('0xe')](_0x7e76('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x7e76('0xf')]=router;
\ No newline at end of file
index a76a8cc..69c0fde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec10=['STRING','UNSIGNED','contactListQueue','moment','sequelize','exports','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','BOOLEAN'];(function(_0x20ff3c,_0x3a16f5){var _0xd80634=function(_0x3dd2d8){while(--_0x3dd2d8){_0x20ff3c['push'](_0x20ff3c['shift']());}};_0xd80634(++_0x3a16f5);}(_0xec10,0x157));var _0x0ec1=function(_0x53785c,_0x137cd5){_0x53785c=_0x53785c-0x0;var _0x42829f=_0xec10[_0x53785c];return _0x42829f;};'use strict';var moment=require(_0x0ec1('0x0'));var Sequelize=require(_0x0ec1('0x1'));module[_0x0ec1('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x0ec1('0x3')](_0x0ec1('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0ec1('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x0ec1('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0ec1('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x0ec1('0x5')](0x2)[_0x0ec1('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x0ec1('0x6')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x0ec1('0x5')],'unique':_0x0ec1('0x9')},'ListId':{'type':Sequelize[_0x0ec1('0x5')],'unique':_0x0ec1('0x9')},'UserId':{'type':Sequelize[_0x0ec1('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x0ec1('0x5')],'unique':_0x0ec1('0x9')},'CampaignId':{'type':Sequelize[_0x0ec1('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x0ec1('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0ec1('0x5')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0ec1('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0ec1('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0ec1('0x5')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1d93=['DATE','contactListQueue','moment','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0xcd09e,_0x1f8e86){var _0x4eef75=function(_0x1adbed){while(--_0x1adbed){_0xcd09e['push'](_0xcd09e['shift']());}};_0x4eef75(++_0x1f8e86);}(_0x1d93,0x1c4));var _0x31d9=function(_0x39853d,_0x2501bf){_0x39853d=_0x39853d-0x0;var _0x5864ca=_0x1d93[_0x39853d];return _0x5864ca;};'use strict';var moment=require(_0x31d9('0x0'));var Sequelize=require('sequelize');module[_0x31d9('0x1')]={'phone':{'type':Sequelize[_0x31d9('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x31d9('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x31d9('0x4')](_0x31d9('0x5'))},'countbusyretry':{'type':Sequelize[_0x31d9('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x31d9('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x31d9('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x31d9('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x31d9('0x7')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x31d9('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x31d9('0x6')],'unique':_0x31d9('0x8')},'ListId':{'type':Sequelize[_0x31d9('0x6')],'unique':_0x31d9('0x8')},'UserId':{'type':Sequelize[_0x31d9('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x31d9('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x31d9('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x31d9('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x31d9('0x6')],'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 978c9de..6af81e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a7d=['isNumber','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','update','then','destroy','error','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$contained','$any','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','describe','CampaignId','VoiceQueueId','VoiceQueue','omit','dataValues','state','campaign','membername','deleted','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','getVoiceQueues','outbound','preview','transaction','direction','prev','isEmpty','hopperIds','scheduledAt','dialOrderByScheduledAt','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','Contact','CmCompany','Company','List','Queue','dialActive','user','format'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0x4a7d,0x93));var _0xd4a7=function(_0xde439d,_0x160f1e){_0xde439d=_0xde439d-0x0;var _0x18f5f3=_0x4a7d[_0xde439d];return _0x18f5f3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd4a7('0x0'));var rp=require('request-promise');var moment=require(_0xd4a7('0x1'));var BPromise=require('bluebird');var Mustache=require(_0xd4a7('0x2'));var util=require('util');var path=require(_0xd4a7('0x3'));var sox=require(_0xd4a7('0x4'));var csv=require(_0xd4a7('0x5'));var ejs=require(_0xd4a7('0x6'));var fs=require('fs');var fs_extra=require(_0xd4a7('0x7'));var _=require(_0xd4a7('0x8'));var squel=require(_0xd4a7('0x9'));var crypto=require(_0xd4a7('0xa'));var jsforce=require(_0xd4a7('0xb'));var deskjs=require(_0xd4a7('0xc'));var toCsv=require(_0xd4a7('0x5'));var querystring=require('querystring');var Papa=require(_0xd4a7('0xd'));var Redis=require(_0xd4a7('0xe'));var authService=require(_0xd4a7('0xf'));var qs=require(_0xd4a7('0x10'));var as=require(_0xd4a7('0x11'));var hardwareService=require(_0xd4a7('0x12'));var logger=require(_0xd4a7('0x13'))(_0xd4a7('0x14'));var utils=require(_0xd4a7('0x15'));var config=require(_0xd4a7('0x16'));var licenseUtil=require(_0xd4a7('0x17'));var db=require(_0xd4a7('0x18'))['db'];function respondWithStatusCode(_0x4c7e2b,_0x5cf406){_0x5cf406=_0x5cf406||0xcc;return function(_0x111c7f){if(_0x111c7f){return _0x4c7e2b[_0xd4a7('0x19')](_0x5cf406);}return _0x4c7e2b[_0xd4a7('0x1a')](_0x5cf406)[_0xd4a7('0x1b')]();};}function respondWithResult(_0x19f9e0,_0x38b3f){_0x38b3f=_0x38b3f||0xc8;return function(_0x3345f8){if(_0x3345f8){return _0x19f9e0[_0xd4a7('0x1a')](_0x38b3f)['json'](_0x3345f8);}};}function respondWithFilteredResult(_0x291737,_0x15ce05){return function(_0x5c6dc7){if(_0x5c6dc7){var _0x405cd6=typeof _0x15ce05['offset']===_0xd4a7('0x1c')&&typeof _0x15ce05[_0xd4a7('0x1d')]===_0xd4a7('0x1c');var _0x2b4248=_0x5c6dc7['count'];var _0x2b820e=_0x405cd6?0x0:_0x15ce05['offset'];var _0x297573=_0x405cd6?_0x5c6dc7[_0xd4a7('0x1e')]:_0x15ce05[_0xd4a7('0x1f')]+_0x15ce05[_0xd4a7('0x1d')];var _0x46ecca;if(_0x297573>=_0x2b4248){_0x297573=_0x2b4248;_0x46ecca=0xc8;}else{_0x46ecca=0xce;}_0x291737[_0xd4a7('0x1a')](_0x46ecca);return _0x291737['set'](_0xd4a7('0x20'),_0x2b820e+'-'+_0x297573+'/'+_0x2b4248)[_0xd4a7('0x21')](_0x5c6dc7);}return null;};}function patchUpdates(_0x2157ae){return function(_0x243c16){try{jsonpatch[_0xd4a7('0x22')](_0x243c16,_0x2157ae,!![]);}catch(_0x181ee3){return BPromise['reject'](_0x181ee3);}return _0x243c16['save']();};}function saveUpdates(_0x58766a,_0x334892){return function(_0x5ae333){if(_0x5ae333){return _0x5ae333[_0xd4a7('0x23')](_0x58766a)[_0xd4a7('0x24')](function(_0x3f99c6){return _0x3f99c6;});}return null;};}function removeEntity(_0x2f2126,_0x550995){return function(_0xeeb3e3){if(_0xeeb3e3){return _0xeeb3e3[_0xd4a7('0x25')]()[_0xd4a7('0x24')](function(){_0x2f2126[_0xd4a7('0x1a')](0xcc)[_0xd4a7('0x1b')]();});}};}function handleEntityNotFound(_0x3fe3f4,_0x1154fc){return function(_0x573975){if(!_0x573975){_0x3fe3f4[_0xd4a7('0x19')](0x194);}return _0x573975;};}function handleError(_0x1a1068,_0x484e83){_0x484e83=_0x484e83||0x1f4;return function(_0x178384){logger[_0xd4a7('0x26')](_0x178384['stack']);if(_0x178384[_0xd4a7('0x27')]){delete _0x178384[_0xd4a7('0x27')];}_0x1a1068['status'](_0x484e83)[_0xd4a7('0x28')](_0x178384);};}exports[_0xd4a7('0x29')]=function(_0x539ef3,_0x3154d1){var _0x2dbd65={},_0x5530d5={},_0x25e771={'count':0x0,'rows':[]};var _0x2fbd7c=_[_0xd4a7('0x2a')](db[_0xd4a7('0x2b')][_0xd4a7('0x2c')],function(_0x2a6e1d){return{'name':_0x2a6e1d[_0xd4a7('0x2d')],'type':_0x2a6e1d[_0xd4a7('0x2e')][_0xd4a7('0x2f')]};});_0x5530d5[_0xd4a7('0x30')]=_['map'](_0x2fbd7c,_0xd4a7('0x27'));_0x5530d5['query']=_[_0xd4a7('0x31')](_0x539ef3[_0xd4a7('0x32')]);_0x5530d5[_0xd4a7('0x33')]=_[_0xd4a7('0x34')](_0x5530d5[_0xd4a7('0x30')],_0x5530d5[_0xd4a7('0x32')]);_0x5530d5[_0xd4a7('0x33')]=_[_0xd4a7('0x35')](_0x5530d5['filters'],[_0xd4a7('0x36'),_0xd4a7('0x37'),_0xd4a7('0x38'),_0xd4a7('0x39'),_0xd4a7('0x3a'),_0xd4a7('0x3b'),_0xd4a7('0x3c'),_0xd4a7('0x3d'),'$not',_0xd4a7('0x3e'),_0xd4a7('0x3f'),_0xd4a7('0x40'),_0xd4a7('0x41'),_0xd4a7('0x42'),'$notLike',_0xd4a7('0x43'),_0xd4a7('0x44'),_0xd4a7('0x42'),'$overlap','$contains',_0xd4a7('0x45'),_0xd4a7('0x46')]);_0x2dbd65[_0xd4a7('0x47')]=_['intersection'](_0x5530d5[_0xd4a7('0x30')],qs['fields'](_0x539ef3[_0xd4a7('0x32')][_0xd4a7('0x48')]));_0x2dbd65[_0xd4a7('0x47')]=_0x2dbd65['attributes'][_0xd4a7('0x49')]?_0x2dbd65[_0xd4a7('0x47')]:_0x5530d5['model'];if(!_0x539ef3[_0xd4a7('0x32')][_0xd4a7('0x4a')]('nolimit')){_0x2dbd65[_0xd4a7('0x1d')]=qs[_0xd4a7('0x1d')](_0x539ef3['query']['limit']);_0x2dbd65[_0xd4a7('0x1f')]=qs['offset'](_0x539ef3[_0xd4a7('0x32')]['offset']);}_0x2dbd65[_0xd4a7('0x4b')]=qs[_0xd4a7('0x4c')](_0x539ef3['query']['sort']);_0x2dbd65[_0xd4a7('0x4d')]=qs[_0xd4a7('0x33')](_[_0xd4a7('0x4e')](_0x539ef3[_0xd4a7('0x32')],_0x5530d5[_0xd4a7('0x33')]),_0x2fbd7c);if(_0x539ef3['query'][_0xd4a7('0x4f')]){_0x2dbd65['where']=_[_0xd4a7('0x50')](_0x2dbd65[_0xd4a7('0x4d')],{'$or':_['map'](_0x2fbd7c,function(_0x3ab3a9){if(_0x3ab3a9[_0xd4a7('0x2e')]!=='VIRTUAL'){var _0x708343={};_0x708343[_0x3ab3a9[_0xd4a7('0x27')]]={'$like':'%'+_0x539ef3[_0xd4a7('0x32')][_0xd4a7('0x4f')]+'%'};return _0x708343;}})});}_0x2dbd65=_[_0xd4a7('0x50')]({},_0x2dbd65,_0x539ef3[_0xd4a7('0x51')]);var _0x1e0cd6={'where':_0x2dbd65['where']};return db[_0xd4a7('0x2b')][_0xd4a7('0x1e')](_0x1e0cd6)[_0xd4a7('0x24')](function(_0x73ef30){_0x25e771[_0xd4a7('0x1e')]=_0x73ef30;if(_0x539ef3[_0xd4a7('0x32')][_0xd4a7('0x52')]){_0x2dbd65['include']=[{'all':!![]}];}return db[_0xd4a7('0x2b')][_0xd4a7('0x53')](_0x2dbd65);})[_0xd4a7('0x24')](function(_0xb2f353){_0x25e771[_0xd4a7('0x54')]=_0xb2f353;return _0x25e771;})[_0xd4a7('0x24')](respondWithFilteredResult(_0x3154d1,_0x2dbd65))[_0xd4a7('0x55')](handleError(_0x3154d1,null));};exports[_0xd4a7('0x56')]=function(_0x51af36,_0x53b5ce){var _0x3b43c3={'raw':!![],'where':{'id':_0x51af36[_0xd4a7('0x57')]['id']}},_0x3eba61={};_0x3eba61['model']=_[_0xd4a7('0x31')](db[_0xd4a7('0x2b')]['rawAttributes']);_0x3eba61[_0xd4a7('0x32')]=_[_0xd4a7('0x31')](_0x51af36[_0xd4a7('0x32')]);_0x3eba61[_0xd4a7('0x33')]=_[_0xd4a7('0x34')](_0x3eba61['model'],_0x3eba61['query']);_0x3b43c3[_0xd4a7('0x47')]=_[_0xd4a7('0x34')](_0x3eba61[_0xd4a7('0x30')],qs[_0xd4a7('0x48')](_0x51af36[_0xd4a7('0x32')][_0xd4a7('0x48')]));_0x3b43c3[_0xd4a7('0x47')]=_0x3b43c3[_0xd4a7('0x47')]['length']?_0x3b43c3[_0xd4a7('0x47')]:_0x3eba61[_0xd4a7('0x30')];if(_0x51af36[_0xd4a7('0x32')]['includeAll']){_0x3b43c3['include']=[{'all':!![]}];}_0x3b43c3=_[_0xd4a7('0x50')]({},_0x3b43c3,_0x51af36[_0xd4a7('0x51')]);return db[_0xd4a7('0x2b')][_0xd4a7('0x58')](_0x3b43c3)[_0xd4a7('0x24')](handleEntityNotFound(_0x53b5ce,null))[_0xd4a7('0x24')](respondWithResult(_0x53b5ce,null))[_0xd4a7('0x55')](handleError(_0x53b5ce,null));};exports[_0xd4a7('0x59')]=function(_0x553324,_0xc6193a){return db[_0xd4a7('0x2b')][_0xd4a7('0x59')](_0x553324[_0xd4a7('0x5a')],{})[_0xd4a7('0x24')](respondWithResult(_0xc6193a,0xc9))[_0xd4a7('0x55')](handleError(_0xc6193a,null));};exports[_0xd4a7('0x23')]=function(_0x569ddc,_0x56d4bd){if(_0x569ddc[_0xd4a7('0x5a')]['id']){delete _0x569ddc['body']['id'];}return db[_0xd4a7('0x2b')][_0xd4a7('0x58')]({'where':{'id':_0x569ddc['params']['id']}})[_0xd4a7('0x24')](handleEntityNotFound(_0x56d4bd,null))[_0xd4a7('0x24')](saveUpdates(_0x569ddc[_0xd4a7('0x5a')],null))[_0xd4a7('0x24')](respondWithResult(_0x56d4bd,null))[_0xd4a7('0x55')](handleError(_0x56d4bd,null));};exports[_0xd4a7('0x5b')]=function(_0x420a0a,_0x41cba7){return db[_0xd4a7('0x2b')][_0xd4a7('0x5b')]()[_0xd4a7('0x24')](respondWithResult(_0x41cba7,null))[_0xd4a7('0x55')](handleError(_0x41cba7,null));};exports[_0xd4a7('0x25')]=function(_0x5cb255,_0x2a0741){var _0x49fb9d;return db[_0xd4a7('0x2b')]['find']({'where':{'id':_0x5cb255['params']['id']}})[_0xd4a7('0x24')](handleEntityNotFound(_0x2a0741,null))[_0xd4a7('0x24')](function(_0x2c2311){if(_0x2c2311){return _0x2c2311['destroy']()[_0xd4a7('0x24')](function(_0x124bee){return _0x124bee;});}})[_0xd4a7('0x24')](function(_0xf5c7d9){_0x49fb9d=_0xf5c7d9;if(_0xf5c7d9){if(_0xf5c7d9['VoiceQueueId']||_0xf5c7d9[_0xd4a7('0x5c')]){return db[_0xf5c7d9[_0xd4a7('0x5d')]?_0xd4a7('0x5e'):'Campaign'][_0xd4a7('0x58')]({'where':{'id':_0xf5c7d9[_0xd4a7('0x5d')]?_0xf5c7d9[_0xd4a7('0x5d')]:_0xf5c7d9['CampaignId']},'attributes':['id',_0xd4a7('0x27')],'raw':!![]});}}})[_0xd4a7('0x24')](function(_0x1b0144){var _0x4e6f7a={};if(_0x1b0144){_[_0xd4a7('0x50')](_0x4e6f7a,_[_0xd4a7('0x5f')](_0x49fb9d[_0xd4a7('0x60')],['createdAt','updatedAt','id']));_0x4e6f7a[_0xd4a7('0x61')]=0x15;_0x4e6f7a['statedesc']='deleted';_0x4e6f7a[_0xd4a7('0x62')]=_0x1b0144[_0xd4a7('0x27')];_0x4e6f7a[_0xd4a7('0x63')]=_0x5cb255['user'][_0xd4a7('0x27')];_0x4e6f7a['UserId']=_0x5cb255['user']['id'];_0x4e6f7a[_0xd4a7('0x64')]=!![];_0x4e6f7a['deletedat']=moment()['format'](_0xd4a7('0x65'));_0x4e6f7a['calleridnum']=_0x49fb9d[_0xd4a7('0x66')];_0x4e6f7a[_0xd4a7('0x67')]=_0x49fb9d[_0xd4a7('0x5d')]?_0xd4a7('0x68'):_0xd4a7('0x69');return db[_0xd4a7('0x6a')][_0xd4a7('0x58')]({'where':{'id':_0x4e6f7a[_0xd4a7('0x6b')]},'attributes':['firstName',_0xd4a7('0x6c')]})[_0xd4a7('0x24')](function(_0x2c58c0){if(!_['isNil'](_0x2a0741)&&!_[_0xd4a7('0x6d')](_0x2c58c0[_0xd4a7('0x6e')])){_0x4e6f7a[_0xd4a7('0x6f')]=_0x2c58c0[_0xd4a7('0x6e')];if(!_[_0xd4a7('0x6d')](_0x2c58c0[_0xd4a7('0x6c')])){_0x4e6f7a[_0xd4a7('0x6f')]+='\x20'+_0x2c58c0[_0xd4a7('0x6c')];}}})[_0xd4a7('0x70')](function(){return db[_0xd4a7('0x71')][_0xd4a7('0x59')](_0x4e6f7a);});}})[_0xd4a7('0x24')](function(){return _0x2a0741[_0xd4a7('0x1a')](0xcc)['end']();})[_0xd4a7('0x55')](handleError(_0x2a0741,null));};exports['getPreview']=function(_0x558e7b,_0x110746,_0x2224e9){var _0x2bf234=[];return db[_0xd4a7('0x6a')][_0xd4a7('0x5b')]()[_0xd4a7('0x24')](function(_0x27555c){_0x2bf234=_[_0xd4a7('0x31')](_0x27555c);return _0x558e7b['user'][_0xd4a7('0x72')]({'where':{'type':_0xd4a7('0x73'),'dialActive':!![],'dialMethod':_0xd4a7('0x74')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0xd4a7('0x24')](function(_0x64259){if(_0x64259&&_0x64259[_0xd4a7('0x49')]){return db['sequelize'][_0xd4a7('0x75')](function(_0x2814ce){var _0x46e399={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xd4a7('0x65'))},'VoiceQueueId':{'$in':_[_0xd4a7('0x2a')](_0x64259,'id')},'$or':[{'UserId':null},{'UserId':_0x558e7b['user']['id']}]};var _0x1bfcfc=[];if(_0x558e7b[_0xd4a7('0x5a')][_0xd4a7('0x76')]&&_0x558e7b['body'][_0xd4a7('0x76')]===_0xd4a7('0x77')){if(!_[_0xd4a7('0x78')](_0x558e7b[_0xd4a7('0x5a')][_0xd4a7('0x79')])){_0x46e399['id']={'$in':_0x558e7b[_0xd4a7('0x5a')]['hopperIds']};}_0x1bfcfc=[['priority','ASC'],[_0xd4a7('0x7a'),_0x64259[0x0][_0xd4a7('0x7b')]===_0xd4a7('0x7c')?_0xd4a7('0x7d'):_0xd4a7('0x7c')],db[_0xd4a7('0x7e')][_0xd4a7('0x7f')](_0xd4a7('0x80')),['id','DESC']];}else{if(!_[_0xd4a7('0x78')](_0x558e7b[_0xd4a7('0x5a')][_0xd4a7('0x79')])){_0x46e399['id']={'$notIn':_0x558e7b['body']['hopperIds']};}_0x1bfcfc=[[_0xd4a7('0x81'),_0xd4a7('0x7d')],[_0xd4a7('0x7a'),_0x64259[0x0][_0xd4a7('0x7b')]],db['sequelize'][_0xd4a7('0x7f')](_0xd4a7('0x82')),['id',_0xd4a7('0x7c')]];}return db[_0xd4a7('0x2b')]['findOne']({'attributes':['id',_0xd4a7('0x83')],'where':_0x46e399,'order':_0x1bfcfc,'transaction':_0x2814ce,'lock':_0x2814ce[_0xd4a7('0x84')]['UPDATE'],'include':[{'model':db[_0xd4a7('0x6a')],'as':_0xd4a7('0x85'),'attributes':_0x2bf234,'include':[{'model':db[_0xd4a7('0x86')],'as':_0xd4a7('0x87'),'attributes':['id',_0xd4a7('0x27')]}]},{'model':db['CmList'],'as':_0xd4a7('0x88'),'attributes':['id',_0xd4a7('0x27')]},{'model':db[_0xd4a7('0x5e')],'as':_0xd4a7('0x89'),'attributes':['id',_0xd4a7('0x27'),_0xd4a7('0x8a')]}]})[_0xd4a7('0x24')](function(_0x5280bc){if(_0x5280bc){return _0x5280bc['update']({'UserId':_0x558e7b[_0xd4a7('0x8b')]['id']},{'transaction':_0x2814ce});}});});}})[_0xd4a7('0x24')](handleEntityNotFound(_0x110746,null))[_0xd4a7('0x24')](respondWithResult(_0x110746,null))[_0xd4a7('0x55')](handleError(_0x110746,null));};exports['getOpenContacts']=function(_0x310303,_0x24d8c0,_0x25928b){return _0x310303[_0xd4a7('0x8b')]['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xd4a7('0x74')},'attributes':['id'],'raw':!![]})[_0xd4a7('0x24')](function(_0x143708){if(_0x143708&&_0x143708[_0xd4a7('0x49')]){return db[_0xd4a7('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd4a7('0x8c')](_0xd4a7('0x65'))},'VoiceQueueId':{'$in':_[_0xd4a7('0x2a')](_0x143708,'id')},'$or':[{'UserId':null},{'UserId':_0x310303[_0xd4a7('0x8b')]['id']}]}});}return 0x0;})[_0xd4a7('0x24')](function(_0x3c4114){if(!_[_0xd4a7('0x6d')](_0x3c4114)&&_[_0xd4a7('0x8d')](_0x3c4114)){return _0x24d8c0[_0xd4a7('0x1a')](0xc8)[_0xd4a7('0x21')]({'contacts':_0x3c4114});}else{logger[_0xd4a7('0x26')](_0xd4a7('0x8e'),_0xd4a7('0x8f'),0x194,'entity\x20not\x20found');_0x24d8c0[_0xd4a7('0x19')](0x194);}})[_0xd4a7('0x55')](handleError(_0x24d8c0,null));};
\ No newline at end of file
+var _0x4992=['Content-Range','reject','update','destroy','then','error','name','send','index','map','CmHopper','rawAttributes','type','key','model','query','intersection','filters','concat','$and','$or','$gte','$lt','$ne','$eq','$not','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','$any','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','VIRTUAL','filter','options','include','rows','catch','show','params','keys','includeAll','create','body','find','describe','CampaignId','VoiceQueueId','VoiceQueue','Campaign','dataValues','createdAt','updatedAt','state','statedesc','campaign','membername','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','getPreview','CmContact','user','outbound','preview','sequelize','transaction','direction','prev','isEmpty','hopperIds','ASC','dialOrderByScheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','findOne','scheduledat','UPDATE','Contact','CmCompany','Company','CmList','Queue','getOpenContacts','getVoiceQueues','isNumber','entity\x20not\x20found','rimraf','zip-dir','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','set'];(function(_0x119e6d,_0xe3377d){var _0x56b2d5=function(_0x31d728){while(--_0x31d728){_0x119e6d['push'](_0x119e6d['shift']());}};_0x56b2d5(++_0xe3377d);}(_0x4992,0x199));var _0x2499=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4992[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2499('0x0'));var zipdir=require(_0x2499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2499('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x2499('0x3'));var util=require(_0x2499('0x4'));var path=require(_0x2499('0x5'));var sox=require(_0x2499('0x6'));var csv=require('to-csv');var ejs=require(_0x2499('0x7'));var fs=require('fs');var fs_extra=require(_0x2499('0x8'));var _=require(_0x2499('0x9'));var squel=require(_0x2499('0xa'));var crypto=require(_0x2499('0xb'));var jsforce=require(_0x2499('0xc'));var deskjs=require(_0x2499('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2499('0xe'));var Papa=require(_0x2499('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2499('0x10'));var as=require(_0x2499('0x11'));var hardwareService=require(_0x2499('0x12'));var logger=require('../../config/logger')(_0x2499('0x13'));var utils=require(_0x2499('0x14'));var config=require(_0x2499('0x15'));var licenseUtil=require(_0x2499('0x16'));var db=require(_0x2499('0x17'))['db'];function respondWithStatusCode(_0x409ef9,_0x4f2977){_0x4f2977=_0x4f2977||0xcc;return function(_0x5b3ff1){if(_0x5b3ff1){return _0x409ef9[_0x2499('0x18')](_0x4f2977);}return _0x409ef9[_0x2499('0x19')](_0x4f2977)[_0x2499('0x1a')]();};}function respondWithResult(_0x2ef250,_0x32f4f8){_0x32f4f8=_0x32f4f8||0xc8;return function(_0x26ff2c){if(_0x26ff2c){return _0x2ef250[_0x2499('0x19')](_0x32f4f8)[_0x2499('0x1b')](_0x26ff2c);}};}function respondWithFilteredResult(_0x5a4768,_0x3f31b9){return function(_0x45e36d){if(_0x45e36d){var _0x32c69a=typeof _0x3f31b9['offset']===_0x2499('0x1c')&&typeof _0x3f31b9['limit']==='undefined';var _0x11db51=_0x45e36d[_0x2499('0x1d')];var _0x44581b=_0x32c69a?0x0:_0x3f31b9[_0x2499('0x1e')];var _0x4f5b47=_0x32c69a?_0x45e36d[_0x2499('0x1d')]:_0x3f31b9[_0x2499('0x1e')]+_0x3f31b9['limit'];var _0x153365;if(_0x4f5b47>=_0x11db51){_0x4f5b47=_0x11db51;_0x153365=0xc8;}else{_0x153365=0xce;}_0x5a4768[_0x2499('0x19')](_0x153365);return _0x5a4768[_0x2499('0x1f')](_0x2499('0x20'),_0x44581b+'-'+_0x4f5b47+'/'+_0x11db51)['json'](_0x45e36d);}return null;};}function patchUpdates(_0x309015){return function(_0x26cb18){try{jsonpatch['apply'](_0x26cb18,_0x309015,!![]);}catch(_0x2f5010){return BPromise[_0x2499('0x21')](_0x2f5010);}return _0x26cb18['save']();};}function saveUpdates(_0x243720,_0x4f67a0){return function(_0x20c4a3){if(_0x20c4a3){return _0x20c4a3[_0x2499('0x22')](_0x243720)['then'](function(_0x28c4ea){return _0x28c4ea;});}return null;};}function removeEntity(_0x36a10b,_0x100044){return function(_0x3f59e8){if(_0x3f59e8){return _0x3f59e8[_0x2499('0x23')]()[_0x2499('0x24')](function(){_0x36a10b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x480e3b,_0x107427){return function(_0x33fe58){if(!_0x33fe58){_0x480e3b[_0x2499('0x18')](0x194);}return _0x33fe58;};}function handleError(_0x1e7902,_0x39e153){_0x39e153=_0x39e153||0x1f4;return function(_0x1395d9){logger[_0x2499('0x25')](_0x1395d9['stack']);if(_0x1395d9[_0x2499('0x26')]){delete _0x1395d9[_0x2499('0x26')];}_0x1e7902[_0x2499('0x19')](_0x39e153)[_0x2499('0x27')](_0x1395d9);};}exports[_0x2499('0x28')]=function(_0x540d08,_0x43bc37){var _0x17d161={},_0x2fe959={},_0x363063={'count':0x0,'rows':[]};var _0x159898=_[_0x2499('0x29')](db[_0x2499('0x2a')][_0x2499('0x2b')],function(_0x717755){return{'name':_0x717755['fieldName'],'type':_0x717755[_0x2499('0x2c')][_0x2499('0x2d')]};});_0x2fe959[_0x2499('0x2e')]=_[_0x2499('0x29')](_0x159898,_0x2499('0x26'));_0x2fe959[_0x2499('0x2f')]=_['keys'](_0x540d08[_0x2499('0x2f')]);_0x2fe959['filters']=_[_0x2499('0x30')](_0x2fe959[_0x2499('0x2e')],_0x2fe959[_0x2499('0x2f')]);_0x2fe959[_0x2499('0x31')]=_[_0x2499('0x32')](_0x2fe959[_0x2499('0x31')],[_0x2499('0x33'),_0x2499('0x34'),'$gt',_0x2499('0x35'),_0x2499('0x36'),'$lte',_0x2499('0x37'),_0x2499('0x38'),_0x2499('0x39'),'$between','$notBetween','$in',_0x2499('0x3a'),_0x2499('0x3b'),_0x2499('0x3c'),_0x2499('0x3d'),_0x2499('0x3e'),_0x2499('0x3b'),_0x2499('0x3f'),_0x2499('0x40'),_0x2499('0x41'),_0x2499('0x42')]);_0x17d161['attributes']=_[_0x2499('0x30')](_0x2fe959[_0x2499('0x2e')],qs[_0x2499('0x43')](_0x540d08[_0x2499('0x2f')][_0x2499('0x43')]));_0x17d161[_0x2499('0x44')]=_0x17d161['attributes'][_0x2499('0x45')]?_0x17d161[_0x2499('0x44')]:_0x2fe959[_0x2499('0x2e')];if(!_0x540d08['query'][_0x2499('0x46')](_0x2499('0x47'))){_0x17d161[_0x2499('0x48')]=qs[_0x2499('0x48')](_0x540d08[_0x2499('0x2f')][_0x2499('0x48')]);_0x17d161[_0x2499('0x1e')]=qs['offset'](_0x540d08[_0x2499('0x2f')]['offset']);}_0x17d161['order']=qs[_0x2499('0x49')](_0x540d08[_0x2499('0x2f')][_0x2499('0x49')]);_0x17d161[_0x2499('0x4a')]=qs[_0x2499('0x31')](_[_0x2499('0x4b')](_0x540d08[_0x2499('0x2f')],_0x2fe959['filters']),_0x159898);if(_0x540d08[_0x2499('0x2f')]['filter']){_0x17d161[_0x2499('0x4a')]=_[_0x2499('0x4c')](_0x17d161['where'],{'$or':_[_0x2499('0x29')](_0x159898,function(_0x3fe6c7){if(_0x3fe6c7[_0x2499('0x2c')]!==_0x2499('0x4d')){var _0x18d592={};_0x18d592[_0x3fe6c7[_0x2499('0x26')]]={'$like':'%'+_0x540d08['query'][_0x2499('0x4e')]+'%'};return _0x18d592;}})});}_0x17d161=_['merge']({},_0x17d161,_0x540d08[_0x2499('0x4f')]);var _0x1a76c8={'where':_0x17d161[_0x2499('0x4a')]};return db[_0x2499('0x2a')]['count'](_0x1a76c8)[_0x2499('0x24')](function(_0x27aa94){_0x363063['count']=_0x27aa94;if(_0x540d08[_0x2499('0x2f')]['includeAll']){_0x17d161[_0x2499('0x50')]=[{'all':!![]}];}return db[_0x2499('0x2a')]['findAll'](_0x17d161);})['then'](function(_0x264d9f){_0x363063[_0x2499('0x51')]=_0x264d9f;return _0x363063;})[_0x2499('0x24')](respondWithFilteredResult(_0x43bc37,_0x17d161))[_0x2499('0x52')](handleError(_0x43bc37,null));};exports[_0x2499('0x53')]=function(_0x7fea90,_0x34ff82){var _0x43b8cc={'raw':!![],'where':{'id':_0x7fea90[_0x2499('0x54')]['id']}},_0x481dd7={};_0x481dd7[_0x2499('0x2e')]=_[_0x2499('0x55')](db['CmHopper']['rawAttributes']);_0x481dd7[_0x2499('0x2f')]=_[_0x2499('0x55')](_0x7fea90[_0x2499('0x2f')]);_0x481dd7['filters']=_[_0x2499('0x30')](_0x481dd7[_0x2499('0x2e')],_0x481dd7[_0x2499('0x2f')]);_0x43b8cc[_0x2499('0x44')]=_[_0x2499('0x30')](_0x481dd7[_0x2499('0x2e')],qs['fields'](_0x7fea90[_0x2499('0x2f')][_0x2499('0x43')]));_0x43b8cc[_0x2499('0x44')]=_0x43b8cc[_0x2499('0x44')][_0x2499('0x45')]?_0x43b8cc[_0x2499('0x44')]:_0x481dd7[_0x2499('0x2e')];if(_0x7fea90[_0x2499('0x2f')][_0x2499('0x56')]){_0x43b8cc[_0x2499('0x50')]=[{'all':!![]}];}_0x43b8cc=_[_0x2499('0x4c')]({},_0x43b8cc,_0x7fea90['options']);return db['CmHopper']['find'](_0x43b8cc)['then'](handleEntityNotFound(_0x34ff82,null))[_0x2499('0x24')](respondWithResult(_0x34ff82,null))[_0x2499('0x52')](handleError(_0x34ff82,null));};exports[_0x2499('0x57')]=function(_0x15975b,_0x1ae690){return db['CmHopper']['create'](_0x15975b[_0x2499('0x58')],{})['then'](respondWithResult(_0x1ae690,0xc9))[_0x2499('0x52')](handleError(_0x1ae690,null));};exports[_0x2499('0x22')]=function(_0x3e55f4,_0xc76308){if(_0x3e55f4[_0x2499('0x58')]['id']){delete _0x3e55f4[_0x2499('0x58')]['id'];}return db[_0x2499('0x2a')][_0x2499('0x59')]({'where':{'id':_0x3e55f4[_0x2499('0x54')]['id']}})[_0x2499('0x24')](handleEntityNotFound(_0xc76308,null))[_0x2499('0x24')](saveUpdates(_0x3e55f4[_0x2499('0x58')],null))[_0x2499('0x24')](respondWithResult(_0xc76308,null))['catch'](handleError(_0xc76308,null));};exports[_0x2499('0x5a')]=function(_0x2d67cb,_0x2d68d9){return db[_0x2499('0x2a')][_0x2499('0x5a')]()['then'](respondWithResult(_0x2d68d9,null))[_0x2499('0x52')](handleError(_0x2d68d9,null));};exports['destroy']=function(_0x24ac68,_0x55fd46){var _0x1a66c4;return db[_0x2499('0x2a')]['find']({'where':{'id':_0x24ac68[_0x2499('0x54')]['id']}})['then'](handleEntityNotFound(_0x55fd46,null))[_0x2499('0x24')](function(_0x17e430){if(_0x17e430){return _0x17e430['destroy']()[_0x2499('0x24')](function(_0x773ba){return _0x773ba;});}})[_0x2499('0x24')](function(_0x506adf){_0x1a66c4=_0x506adf;if(_0x506adf){if(_0x506adf['VoiceQueueId']||_0x506adf[_0x2499('0x5b')]){return db[_0x506adf[_0x2499('0x5c')]?_0x2499('0x5d'):_0x2499('0x5e')][_0x2499('0x59')]({'where':{'id':_0x506adf['VoiceQueueId']?_0x506adf['VoiceQueueId']:_0x506adf[_0x2499('0x5b')]},'attributes':['id','name'],'raw':!![]});}}})[_0x2499('0x24')](function(_0x4512bb){var _0x2329d8={};if(_0x4512bb){_[_0x2499('0x4c')](_0x2329d8,_['omit'](_0x1a66c4[_0x2499('0x5f')],[_0x2499('0x60'),_0x2499('0x61'),'id']));_0x2329d8[_0x2499('0x62')]=0x15;_0x2329d8[_0x2499('0x63')]='deleted';_0x2329d8[_0x2499('0x64')]=_0x4512bb['name'];_0x2329d8[_0x2499('0x65')]=_0x24ac68['user'][_0x2499('0x26')];_0x2329d8[_0x2499('0x66')]=_0x24ac68['user']['id'];_0x2329d8[_0x2499('0x67')]=!![];_0x2329d8[_0x2499('0x68')]=moment()[_0x2499('0x69')](_0x2499('0x6a'));_0x2329d8['calleridnum']=_0x1a66c4[_0x2499('0x6b')];_0x2329d8[_0x2499('0x6c')]=_0x1a66c4['VoiceQueueId']?_0x2499('0x6d'):_0x2499('0x6e');return db['CmContact']['find']({'where':{'id':_0x2329d8[_0x2499('0x6f')]},'attributes':[_0x2499('0x70'),_0x2499('0x71')]})['then'](function(_0x29f6ac){if(!_[_0x2499('0x72')](_0x55fd46)&&!_[_0x2499('0x72')](_0x29f6ac[_0x2499('0x70')])){_0x2329d8[_0x2499('0x73')]=_0x29f6ac[_0x2499('0x70')];if(!_[_0x2499('0x72')](_0x29f6ac[_0x2499('0x71')])){_0x2329d8['calleridname']+='\x20'+_0x29f6ac[_0x2499('0x71')];}}})[_0x2499('0x74')](function(){return db[_0x2499('0x75')][_0x2499('0x57')](_0x2329d8);});}})[_0x2499('0x24')](function(){return _0x55fd46[_0x2499('0x19')](0xcc)[_0x2499('0x1a')]();})['catch'](handleError(_0x55fd46,null));};exports[_0x2499('0x76')]=function(_0xf14fe7,_0x2ac10b,_0x4e358e){var _0x52d89a=[];return db[_0x2499('0x77')][_0x2499('0x5a')]()['then'](function(_0x158877){_0x52d89a=_['keys'](_0x158877);return _0xf14fe7[_0x2499('0x78')]['getVoiceQueues']({'where':{'type':_0x2499('0x79'),'dialActive':!![],'dialMethod':_0x2499('0x7a')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})['then'](function(_0x5856c8){if(_0x5856c8&&_0x5856c8[_0x2499('0x45')]){return db[_0x2499('0x7b')][_0x2499('0x7c')](function(_0x47910d){var _0x466cf6={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2499('0x69')](_0x2499('0x6a'))},'VoiceQueueId':{'$in':_[_0x2499('0x29')](_0x5856c8,'id')},'$or':[{'UserId':null},{'UserId':_0xf14fe7[_0x2499('0x78')]['id']}]};var _0x2f76b1=[];if(_0xf14fe7[_0x2499('0x58')][_0x2499('0x7d')]&&_0xf14fe7[_0x2499('0x58')][_0x2499('0x7d')]===_0x2499('0x7e')){if(!_[_0x2499('0x7f')](_0xf14fe7[_0x2499('0x58')][_0x2499('0x80')])){_0x466cf6['id']={'$in':_0xf14fe7[_0x2499('0x58')][_0x2499('0x80')]};}_0x2f76b1=[['priority',_0x2499('0x81')],['scheduledAt',_0x5856c8[0x0][_0x2499('0x82')]===_0x2499('0x81')?_0x2499('0x83'):_0x2499('0x81')],db['sequelize'][_0x2499('0x84')](_0x2499('0x85')),['id',_0x2499('0x83')]];}else{if(!_[_0x2499('0x7f')](_0xf14fe7[_0x2499('0x58')]['hopperIds'])){_0x466cf6['id']={'$notIn':_0xf14fe7[_0x2499('0x58')][_0x2499('0x80')]};}_0x2f76b1=[[_0x2499('0x86'),_0x2499('0x83')],['scheduledAt',_0x5856c8[0x0][_0x2499('0x82')]],db[_0x2499('0x7b')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x2499('0x81')]];}return db[_0x2499('0x2a')][_0x2499('0x87')]({'attributes':['id',_0x2499('0x88')],'where':_0x466cf6,'order':_0x2f76b1,'transaction':_0x47910d,'lock':_0x47910d['LOCK'][_0x2499('0x89')],'include':[{'model':db[_0x2499('0x77')],'as':_0x2499('0x8a'),'attributes':_0x52d89a,'include':[{'model':db[_0x2499('0x8b')],'as':_0x2499('0x8c'),'attributes':['id',_0x2499('0x26')]}]},{'model':db[_0x2499('0x8d')],'as':'List','attributes':['id',_0x2499('0x26')]},{'model':db[_0x2499('0x5d')],'as':_0x2499('0x8e'),'attributes':['id','name','dialActive']}]})[_0x2499('0x24')](function(_0x3b83ec){if(_0x3b83ec){return _0x3b83ec['update']({'UserId':_0xf14fe7[_0x2499('0x78')]['id']},{'transaction':_0x47910d});}});});}})[_0x2499('0x24')](handleEntityNotFound(_0x2ac10b,null))[_0x2499('0x24')](respondWithResult(_0x2ac10b,null))[_0x2499('0x52')](handleError(_0x2ac10b,null));};exports[_0x2499('0x8f')]=function(_0x200bd1,_0x32f8a7,_0x598771){return _0x200bd1[_0x2499('0x78')][_0x2499('0x90')]({'where':{'type':_0x2499('0x79'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})['then'](function(_0x588699){if(_0x588699&&_0x588699['length']){return db[_0x2499('0x2a')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2499('0x69')](_0x2499('0x6a'))},'VoiceQueueId':{'$in':_['map'](_0x588699,'id')},'$or':[{'UserId':null},{'UserId':_0x200bd1['user']['id']}]}});}return 0x0;})[_0x2499('0x24')](function(_0x2f6c5d){if(!_[_0x2499('0x72')](_0x2f6c5d)&&_[_0x2499('0x91')](_0x2f6c5d)){return _0x32f8a7[_0x2499('0x19')](0xc8)[_0x2499('0x1b')]({'contacts':_0x2f6c5d});}else{logger[_0x2499('0x25')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,_0x2499('0x92'));_0x32f8a7[_0x2499('0x18')](0x194);}})[_0x2499('0x52')](handleError(_0x32f8a7,null));};
\ No newline at end of file
index 178f18c..7a48f56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['moment','bluebird','request-promise','path','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','../../config/logger','api'];(function(_0x310448,_0x59f6bd){var _0xc0124b=function(_0x311d94){while(--_0x311d94){_0x310448['push'](_0x310448['shift']());}};_0xc0124b(++_0x59f6bd);}(_0x187d,0x93));var _0xd187=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x187d[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xc')]},{'name':_0xd187('0xd'),'fields':['phone']},{'name':_0xd187('0xe'),'fields':[_0xd187('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdbd=['path','rimraf','./cmHopper.attributes','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x394894,_0x3f4a95){var _0x407a0a=function(_0x3be898){while(--_0x3be898){_0x394894['push'](_0x394894['shift']());}};_0x407a0a(++_0x3f4a95);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xa76664,_0x5e32db){_0xa76664=_0xa76664-0x0;var _0x3f7743=_0xfdbd[_0xa76664];return _0x3f7743;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xdfdb('0xa'),'fields':[_0xdfdb('0xa')]},{'name':'phone','fields':[_0xdfdb('0xb')]},{'name':_0xdfdb('0xc'),'fields':[_0xdfdb('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 9c0b610..10f81f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cf7=['contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','keys','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','attributes','limit','include','map','model','ShowCmHopper','find','raw','create','body','CreateCmHopper','where','UpdateCmHopper','DestroyCmHopper','GetContactDialer','describe','transaction','order','LOCK','UPDATE','CmContact','Contact','name','voicePause','length','UserId','push','update','all','MoveContactManagedDialer','sequelize','CmHopperFinal','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null'];(function(_0x2724e5,_0x229d74){var _0x4b6621=function(_0x787046){while(--_0x787046){_0x2724e5['push'](_0x2724e5['shift']());}};_0x4b6621(++_0x229d74);}(_0x2cf7,0xd9));var _0x72cf=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x2cf7[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x72cf('0x0'));var util=require(_0x72cf('0x1'));var moment=require(_0x72cf('0x2'));var BPromise=require(_0x72cf('0x3'));var rs=require(_0x72cf('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72cf('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x72cf('0x6'));var config=require(_0x72cf('0x7'));var jayson=require(_0x72cf('0x8'));var client=jayson[_0x72cf('0x9')][_0x72cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2847ce,_0x4e1db4,_0x21352f){return new BPromise(function(_0xa607ea,_0x37e30e){return client['request'](_0x2847ce,_0x21352f)[_0x72cf('0xb')](function(_0x59844b){logger[_0x72cf('0xc')](_0x72cf('0xd'),_0x4e1db4,_0x72cf('0xe'));logger[_0x72cf('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x4e1db4,'request\x20sent',JSON[_0x72cf('0x10')](_0x59844b));if(_0x59844b[_0x72cf('0x11')]){if(_0x59844b[_0x72cf('0x11')][_0x72cf('0x12')]===0x1f4){logger[_0x72cf('0x11')](_0x72cf('0xd'),_0x4e1db4,_0x59844b[_0x72cf('0x11')]['message']);return _0x37e30e(_0x59844b[_0x72cf('0x11')]['message']);}logger['error'](_0x72cf('0xd'),_0x4e1db4,_0x59844b[_0x72cf('0x11')]['message']);return _0xa607ea(_0x59844b[_0x72cf('0x11')][_0x72cf('0x13')]);}else{logger[_0x72cf('0xc')](_0x72cf('0xd'),_0x4e1db4,_0x72cf('0xe'));_0xa607ea(_0x59844b[_0x72cf('0x14')][_0x72cf('0x13')]);}})[_0x72cf('0x15')](function(_0x3b2b51){logger[_0x72cf('0x11')](_0x72cf('0xd'),_0x4e1db4,_0x3b2b51);_0x37e30e(_0x3b2b51);});});}exports[_0x72cf('0x16')]=function(_0x3b5059){var _0x4ce0d2=this;return new Promise(function(_0xf428ef,_0x3a5767){return db[_0x72cf('0x17')][_0x72cf('0x18')]({'raw':_0x3b5059[_0x72cf('0x19')]?_0x3b5059[_0x72cf('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3b5059[_0x72cf('0x19')]?_0x3b5059['options']['where']||null:null,'attributes':_0x3b5059['options']?_0x3b5059[_0x72cf('0x19')][_0x72cf('0x1a')]||null:null,'limit':_0x3b5059[_0x72cf('0x19')]?_0x3b5059[_0x72cf('0x19')][_0x72cf('0x1b')]||null:null,'include':_0x3b5059['options']?_0x3b5059[_0x72cf('0x19')][_0x72cf('0x1c')]?_[_0x72cf('0x1d')](_0x3b5059[_0x72cf('0x19')][_0x72cf('0x1c')],function(_0x585cd2){return{'model':db[_0x585cd2[_0x72cf('0x1e')]],'as':_0x585cd2['as'],'attributes':_0x585cd2[_0x72cf('0x1a')],'include':_0x585cd2[_0x72cf('0x1c')]?_['map'](_0x585cd2[_0x72cf('0x1c')],function(_0x162772){return{'model':db[_0x162772[_0x72cf('0x1e')]],'as':_0x162772['as'],'attributes':_0x162772[_0x72cf('0x1a')],'include':_0x162772[_0x72cf('0x1c')]?_[_0x72cf('0x1d')](_0x162772[_0x72cf('0x1c')],function(_0x4ca293){return{'model':db[_0x4ca293[_0x72cf('0x1e')]],'as':_0x4ca293['as'],'attributes':_0x4ca293[_0x72cf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x72cf('0xb')](function(_0x4aa7d4){logger[_0x72cf('0xc')]('GetCmHopper',_0x3b5059);logger['debug'](_0x72cf('0x16'),_0x3b5059,JSON['stringify'](_0x4aa7d4));_0xf428ef(_0x4aa7d4);})['catch'](function(_0x1dcef7){logger['error'](_0x72cf('0x16'),_0x1dcef7['message'],_0x3b5059);_0x3a5767(_0x4ce0d2[_0x72cf('0x11')](0x1f4,_0x1dcef7[_0x72cf('0x13')]));});});};exports[_0x72cf('0x1f')]=function(_0x21fe50){var _0xc4b78=this;return new Promise(function(_0x53f32d,_0x597a8c){return db[_0x72cf('0x17')][_0x72cf('0x20')]({'raw':_0x21fe50[_0x72cf('0x19')]?_0x21fe50[_0x72cf('0x19')][_0x72cf('0x21')]===undefined?!![]:![]:!![],'where':_0x21fe50[_0x72cf('0x19')]?_0x21fe50[_0x72cf('0x19')]['where']||null:null,'attributes':_0x21fe50[_0x72cf('0x19')]?_0x21fe50[_0x72cf('0x19')][_0x72cf('0x1a')]||null:null,'include':_0x21fe50[_0x72cf('0x19')]?_0x21fe50[_0x72cf('0x19')][_0x72cf('0x1c')]?_[_0x72cf('0x1d')](_0x21fe50[_0x72cf('0x19')][_0x72cf('0x1c')],function(_0x2d4eaa){return{'model':db[_0x2d4eaa[_0x72cf('0x1e')]],'as':_0x2d4eaa['as'],'attributes':_0x2d4eaa[_0x72cf('0x1a')],'include':_0x2d4eaa[_0x72cf('0x1c')]?_[_0x72cf('0x1d')](_0x2d4eaa[_0x72cf('0x1c')],function(_0x2a613b){return{'model':db[_0x2a613b['model']],'as':_0x2a613b['as'],'attributes':_0x2a613b[_0x72cf('0x1a')],'include':_0x2a613b['include']?_['map'](_0x2a613b[_0x72cf('0x1c')],function(_0x24ccf4){return{'model':db[_0x24ccf4[_0x72cf('0x1e')]],'as':_0x24ccf4['as'],'attributes':_0x24ccf4[_0x72cf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x72cf('0xb')](function(_0x2423b7){logger[_0x72cf('0xc')](_0x72cf('0x1f'),_0x21fe50);logger[_0x72cf('0xf')](_0x72cf('0x1f'),_0x21fe50,JSON[_0x72cf('0x10')](_0x2423b7));_0x53f32d(_0x2423b7);})[_0x72cf('0x15')](function(_0x303581){logger[_0x72cf('0x11')]('ShowCmHopper',_0x303581[_0x72cf('0x13')],_0x21fe50);_0x597a8c(_0xc4b78['error'](0x1f4,_0x303581[_0x72cf('0x13')]));});});};exports['CreateCmHopper']=function(_0x442f3e){var _0x1ac149=this;return new Promise(function(_0x55dfaf,_0x5df7b3){return db[_0x72cf('0x17')][_0x72cf('0x22')](_0x442f3e[_0x72cf('0x23')],{'raw':_0x442f3e[_0x72cf('0x19')]?_0x442f3e[_0x72cf('0x19')][_0x72cf('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x4c9ad2){logger[_0x72cf('0xc')](_0x72cf('0x24'),_0x442f3e);logger[_0x72cf('0xf')](_0x72cf('0x24'),_0x442f3e,JSON[_0x72cf('0x10')](_0x4c9ad2));_0x55dfaf(_0x4c9ad2);})[_0x72cf('0x15')](function(_0x5c5985){logger[_0x72cf('0x11')](_0x72cf('0x24'),_0x5c5985[_0x72cf('0x13')],_0x442f3e);_0x5df7b3(_0x1ac149[_0x72cf('0x11')](0x1f4,_0x5c5985[_0x72cf('0x13')]));});});};exports['UpdateCmHopper']=function(_0x250b40){var _0x401a1f=this;return new Promise(function(_0x230430,_0x4dd2e2){return db[_0x72cf('0x17')]['update'](_0x250b40[_0x72cf('0x23')],{'raw':_0x250b40[_0x72cf('0x19')]?_0x250b40[_0x72cf('0x19')][_0x72cf('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x250b40[_0x72cf('0x19')]?_0x250b40[_0x72cf('0x19')][_0x72cf('0x25')]||null:null,'attributes':_0x250b40['options']?_0x250b40[_0x72cf('0x19')][_0x72cf('0x1a')]||null:null,'limit':_0x250b40[_0x72cf('0x19')]?_0x250b40[_0x72cf('0x19')][_0x72cf('0x1b')]||null:null})[_0x72cf('0xb')](function(_0x337876){logger['info'](_0x72cf('0x26'),_0x250b40);logger[_0x72cf('0xf')](_0x72cf('0x26'),_0x250b40,JSON[_0x72cf('0x10')](_0x337876));_0x230430(_0x337876);})[_0x72cf('0x15')](function(_0x453ec5){logger[_0x72cf('0x11')](_0x72cf('0x26'),_0x453ec5['message'],_0x250b40);_0x4dd2e2(_0x401a1f['error'](0x1f4,_0x453ec5[_0x72cf('0x13')]));});});};exports[_0x72cf('0x27')]=function(_0x3df6f2){var _0x35faed=this;return new Promise(function(_0x5935ce,_0x41e891){return db['CmHopper']['destroy']({'where':_0x3df6f2['options']?_0x3df6f2[_0x72cf('0x19')]['where']||null:null})['then'](function(_0x2932d9){logger[_0x72cf('0xc')](_0x72cf('0x27'),_0x3df6f2);logger[_0x72cf('0xf')](_0x72cf('0x27'),_0x3df6f2,JSON[_0x72cf('0x10')](_0x2932d9));_0x5935ce(_0x2932d9);})['catch'](function(_0x25d8a5){logger[_0x72cf('0x11')](_0x72cf('0x27'),_0x25d8a5[_0x72cf('0x13')],_0x3df6f2);_0x41e891(_0x35faed[_0x72cf('0x11')](0x1f4,_0x25d8a5[_0x72cf('0x13')]));});});};exports[_0x72cf('0x28')]=function(_0x1f70f5){var _0x697c5b=this;return new Promise(function(_0x2d934a,_0x51164e){return db['CmContact'][_0x72cf('0x29')]()['then'](function(_0x2d5340){return db['sequelize'][_0x72cf('0x2a')](function(_0x4444e4){return db[_0x72cf('0x17')][_0x72cf('0x18')]({'where':_0x1f70f5[_0x72cf('0x19')]?_0x1f70f5['options']['where']||null:null,'attributes':_0x1f70f5['options']?_0x1f70f5[_0x72cf('0x19')][_0x72cf('0x1a')]||null:null,'limit':_0x1f70f5[_0x72cf('0x19')]?_0x1f70f5['options'][_0x72cf('0x1b')]||null:null,'order':_0x1f70f5[_0x72cf('0x19')]?_0x1f70f5[_0x72cf('0x19')][_0x72cf('0x2b')]||null:null,'transaction':_0x4444e4,'lock':_0x4444e4[_0x72cf('0x2c')][_0x72cf('0x2d')],'include':[{'model':db[_0x72cf('0x2e')],'as':_0x72cf('0x2f'),'attributes':_['keys'](_0x2d5340)},{'model':db['User'],'as':'Agent','attributes':['id',_0x72cf('0x30'),_0x72cf('0x31')]}]})[_0x72cf('0xb')](function(_0x3f2ebc){var _0x5dc98e=[];var _0x4cc2be=[];for(var _0x397c98=0x0;_0x397c98<_0x3f2ebc[_0x72cf('0x32')];_0x397c98+=0x1){var _0x48ae04=_0x3f2ebc[_0x397c98][_0x72cf('0x33')];if(_0x48ae04===null){_0x5dc98e[_0x72cf('0x34')](_0x3f2ebc[_0x397c98][_0x72cf('0x35')](_0x1f70f5[_0x72cf('0x23')],{'transaction':_0x4444e4}));}else if(!_0x4cc2be['includes'](_0x48ae04)){_0x4cc2be[_0x72cf('0x34')](_0x48ae04);_0x5dc98e[_0x72cf('0x34')](_0x3f2ebc[_0x397c98][_0x72cf('0x35')](_0x1f70f5['body'],{'transaction':_0x4444e4}));}}return BPromise[_0x72cf('0x36')](_0x5dc98e);});})['then'](function(_0x4c6212){logger[_0x72cf('0xc')](_0x72cf('0x28'),_0x1f70f5);logger[_0x72cf('0xf')](_0x72cf('0x28'),_0x1f70f5,JSON['stringify'](_0x4c6212));_0x2d934a(_0x4c6212);})[_0x72cf('0x15')](function(_0x502ec5){logger[_0x72cf('0x11')]('GetContactDialer',_0x502ec5[_0x72cf('0x13')],_0x1f70f5);_0x51164e(_0x697c5b[_0x72cf('0x11')](0x1f4,_0x502ec5[_0x72cf('0x13')]));});});});};exports[_0x72cf('0x37')]=function(_0x3cafe5){var _0x3cae27=this;return new Promise(function(_0x231a7a,_0x261e3c){return db[_0x72cf('0x38')][_0x72cf('0x2a')](function(_0x3dd922){return db[_0x72cf('0x39')][_0x72cf('0x22')](_0x3cafe5[_0x72cf('0x23')],{'raw':_0x3cafe5[_0x72cf('0x19')]?_0x3cafe5[_0x72cf('0x19')][_0x72cf('0x21')]===undefined?!![]:![]:!![],'transaction':_0x3dd922})[_0x72cf('0xb')](function(){return db['CmHopper'][_0x72cf('0x3a')]({'where':_0x3cafe5[_0x72cf('0x19')]?_0x3cafe5[_0x72cf('0x19')][_0x72cf('0x25')]||null:null,'transaction':_0x3dd922});});})[_0x72cf('0xb')](function(_0x151aec){logger[_0x72cf('0xc')](_0x72cf('0x37'),_0x3cafe5);logger[_0x72cf('0xf')](_0x72cf('0x37'),_0x3cafe5,JSON[_0x72cf('0x10')](_0x151aec));_0x231a7a(_0x151aec);})[_0x72cf('0x15')](function(_0x57307d){logger[_0x72cf('0x11')](_0x72cf('0x37'),_0x57307d[_0x72cf('0x13')],_0x3cafe5);_0x261e3c(_0x3cae27[_0x72cf('0x11')](0x1f4,_0x57307d[_0x72cf('0x13')]));});});};exports[_0x72cf('0x3b')]=function(_0x2b0ae4){var _0x598911=this;return new Promise(function(_0x335ede,_0x359911){return db[_0x72cf('0x17')][_0x72cf('0x18')]({'raw':_0x2b0ae4[_0x72cf('0x19')]?_0x2b0ae4[_0x72cf('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2b0ae4[_0x72cf('0x19')]?_0x2b0ae4[_0x72cf('0x19')]['where']||null:null,'attributes':[[db[_0x72cf('0x38')]['fn'](_0x72cf('0x3c'),db['sequelize']['fn']('IF',db['sequelize'][_0x72cf('0x3d')](_0x72cf('0x3e')+util[_0x72cf('0x3f')](_0x72cf('0x40'),moment()[_0x72cf('0x3f')](_0x72cf('0x41')))+_0x72cf('0x42')))),_0x72cf('0x43')]]})['then'](function(_0x51b487){logger['info']('CountReScheduled',_0x2b0ae4);logger[_0x72cf('0xf')](_0x72cf('0x3b'),_0x2b0ae4,JSON[_0x72cf('0x10')](_0x51b487));_0x335ede(_0x51b487);})[_0x72cf('0x15')](function(_0x283414){logger[_0x72cf('0x11')](_0x72cf('0x3b'),_0x283414[_0x72cf('0x13')],_0x2b0ae4);_0x359911(_0x598911[_0x72cf('0x11')](0x1f4,_0x283414['message']));});});};exports[_0x72cf('0x44')]=function(_0x2710f2){var _0x4bb6f4=this;return new Promise(function(_0x162fd7,_0x3c2e61){return db[_0x72cf('0x2e')][_0x72cf('0x29')]()[_0x72cf('0xb')](function(_0x2a50ee){return db[_0x72cf('0x38')]['transaction'](function(_0x369f1c){return db['CmHopper']['findAll']({'where':_0x2710f2[_0x72cf('0x19')]?_0x2710f2[_0x72cf('0x19')][_0x72cf('0x25')]||null:null,'attributes':_0x2710f2[_0x72cf('0x19')]?_0x2710f2[_0x72cf('0x19')][_0x72cf('0x1a')]||null:null,'limit':0x1,'order':_0x2710f2[_0x72cf('0x19')]?_0x2710f2[_0x72cf('0x19')]['order']||null:null,'group':db[_0x72cf('0x17')][_0x72cf('0x33')],'transaction':_0x369f1c,'lock':_0x369f1c[_0x72cf('0x2c')][_0x72cf('0x2d')],'include':_0x2710f2[_0x72cf('0x19')]?_0x2710f2[_0x72cf('0x19')][_0x72cf('0x1c')]?_[_0x72cf('0x1d')](_0x2710f2[_0x72cf('0x19')][_0x72cf('0x1c')],function(_0x170174){return{'model':db[_0x170174[_0x72cf('0x1e')]],'as':_0x170174['as'],'attributes':_0x170174[_0x72cf('0x1a')],'include':_0x170174[_0x72cf('0x1c')]?_[_0x72cf('0x1d')](_0x170174[_0x72cf('0x1c')],function(_0x1c3f9e){return{'model':db[_0x1c3f9e[_0x72cf('0x1e')]],'as':_0x1c3f9e['as'],'attributes':_0x1c3f9e['attributes'],'include':_0x1c3f9e['include']?_[_0x72cf('0x1d')](_0x1c3f9e['include'],function(_0x12113e){return{'model':db[_0x12113e['model']],'as':_0x12113e['as'],'attributes':_0x12113e[_0x72cf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x72cf('0xb')](function(_0x559494){var _0x29dd43=[];for(var _0xd5e02b=0x0;_0xd5e02b<_0x559494[_0x72cf('0x32')];_0xd5e02b+=0x1){_0x29dd43[_0x72cf('0x34')](_0x559494[_0xd5e02b][_0x72cf('0x35')](_0x2710f2[_0x72cf('0x23')],{'transaction':_0x369f1c}));}return BPromise[_0x72cf('0x36')](_0x29dd43);});})['then'](function(_0x163c7b){logger[_0x72cf('0xc')]('GetContactRecallMe',_0x2710f2);logger[_0x72cf('0xf')](_0x72cf('0x44'),_0x2710f2,JSON[_0x72cf('0x10')](_0x163c7b));_0x162fd7(_0x163c7b);})[_0x72cf('0x15')](function(_0x196929){logger[_0x72cf('0x11')](_0x72cf('0x44'),_0x196929[_0x72cf('0x13')],_0x2710f2);_0x3c2e61(_0x4bb6f4['error'](0x1f4,_0x196929[_0x72cf('0x13')]));});});});};exports[_0x72cf('0x45')]=function(_0x488f52){var _0xaf1a07=this;return new Promise(function(_0x5bf00d,_0x8748e2){db[_0x72cf('0x2e')][_0x72cf('0x29')]()[_0x72cf('0xb')](function(_0x51b1d3){return db[_0x72cf('0x17')][_0x72cf('0x18')]({'raw':_0x488f52[_0x72cf('0x19')]?_0x488f52[_0x72cf('0x19')][_0x72cf('0x21')]===undefined?!![]:![]:!![],'where':_0x488f52[_0x72cf('0x19')]?_0x488f52['options'][_0x72cf('0x25')]||null:null,'attributes':_0x488f52[_0x72cf('0x19')]?_0x488f52[_0x72cf('0x19')][_0x72cf('0x1a')]||null:null,'limit':_0x488f52[_0x72cf('0x19')]?_0x488f52[_0x72cf('0x19')][_0x72cf('0x1b')]||null:null,'include':_0x488f52[_0x72cf('0x19')]?_0x488f52['options'][_0x72cf('0x1c')]?_[_0x72cf('0x1d')](_0x488f52[_0x72cf('0x19')]['include'],function(_0x527b60){return{'model':db[_0x527b60[_0x72cf('0x1e')]],'as':_0x527b60['as'],'attributes':_0x527b60['as']===_0x72cf('0x2f')?_[_0x72cf('0x46')](_0x51b1d3):_0x527b60[_0x72cf('0x1a')],'include':_0x527b60['include']?_[_0x72cf('0x1d')](_0x527b60[_0x72cf('0x1c')],function(_0x4370b2){return{'model':db[_0x4370b2[_0x72cf('0x1e')]],'as':_0x4370b2['as'],'attributes':_0x4370b2[_0x72cf('0x1a')],'include':_0x4370b2['include']?_['map'](_0x4370b2[_0x72cf('0x1c')],function(_0x58d479){return{'model':db[_0x58d479[_0x72cf('0x1e')]],'as':_0x58d479['as'],'attributes':_0x58d479[_0x72cf('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3577f8){logger[_0x72cf('0xc')](_0x72cf('0x16'),_0x488f52);logger[_0x72cf('0xf')](_0x72cf('0x16'),_0x488f52,JSON['stringify'](_0x3577f8));_0x5bf00d(_0x3577f8);})['catch'](function(_0x902b5d){logger[_0x72cf('0x11')](_0x72cf('0x16'),_0x902b5d[_0x72cf('0x13')],_0x488f52);_0x8748e2(_0xaf1a07[_0x72cf('0x11')](0x1f4,_0x902b5d[_0x72cf('0x13')]));});});});};
\ No newline at end of file
+var _0xb691=['catch','ShowCmHopper','raw','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','order','UPDATE','Contact','keys','voicePause','push','includes','transaction','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','LOCK','length','GetCmHopperPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','CmHopper,\x20%s,\x20%s','message','request\x20sent','result','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','map','model'];(function(_0x578fd4,_0x1302c7){var _0x5744fc=function(_0x36bd33){while(--_0x36bd33){_0x578fd4['push'](_0x578fd4['shift']());}};_0x5744fc(++_0x1302c7);}(_0xb691,0x13e));var _0x1b69=function(_0x4b4638,_0xe99cda){_0x4b4638=_0x4b4638-0x0;var _0x59e92b=_0xb691[_0x4b4638];return _0x59e92b;};'use strict';var _=require(_0x1b69('0x0'));var util=require(_0x1b69('0x1'));var moment=require(_0x1b69('0x2'));var BPromise=require(_0x1b69('0x3'));var rs=require(_0x1b69('0x4'));var fs=require('fs');var Redis=require(_0x1b69('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b69('0x6'))(_0x1b69('0x7'));var config=require('../../config/environment');var jayson=require(_0x1b69('0x8'));var client=jayson[_0x1b69('0x9')][_0x1b69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xab5f66,_0xc66a1a,_0x3a52d0){return new BPromise(function(_0x44f78e,_0x5393b1){return client[_0x1b69('0xb')](_0xab5f66,_0x3a52d0)[_0x1b69('0xc')](function(_0xedb5b6){logger[_0x1b69('0xd')]('CmHopper,\x20%s,\x20%s',_0xc66a1a,'request\x20sent');logger[_0x1b69('0xe')](_0x1b69('0xf'),_0xc66a1a,'request\x20sent',JSON[_0x1b69('0x10')](_0xedb5b6));if(_0xedb5b6[_0x1b69('0x11')]){if(_0xedb5b6[_0x1b69('0x11')]['code']===0x1f4){logger[_0x1b69('0x11')](_0x1b69('0x12'),_0xc66a1a,_0xedb5b6['error']['message']);return _0x5393b1(_0xedb5b6[_0x1b69('0x11')]['message']);}logger[_0x1b69('0x11')](_0x1b69('0x12'),_0xc66a1a,_0xedb5b6[_0x1b69('0x11')][_0x1b69('0x13')]);return _0x44f78e(_0xedb5b6[_0x1b69('0x11')][_0x1b69('0x13')]);}else{logger['info'](_0x1b69('0x12'),_0xc66a1a,_0x1b69('0x14'));_0x44f78e(_0xedb5b6[_0x1b69('0x15')][_0x1b69('0x13')]);}})['catch'](function(_0x13aeb7){logger[_0x1b69('0x11')](_0x1b69('0x12'),_0xc66a1a,_0x13aeb7);_0x5393b1(_0x13aeb7);});});}exports[_0x1b69('0x16')]=function(_0x13994d){var _0x594667=this;return new Promise(function(_0x48c572,_0x139a67){return db[_0x1b69('0x17')][_0x1b69('0x18')]({'raw':_0x13994d['options']?_0x13994d[_0x1b69('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x13994d[_0x1b69('0x19')]?_0x13994d[_0x1b69('0x19')][_0x1b69('0x1a')]||null:null,'attributes':_0x13994d[_0x1b69('0x19')]?_0x13994d[_0x1b69('0x19')][_0x1b69('0x1b')]||null:null,'limit':_0x13994d[_0x1b69('0x19')]?_0x13994d[_0x1b69('0x19')][_0x1b69('0x1c')]||null:null,'include':_0x13994d[_0x1b69('0x19')]?_0x13994d['options'][_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x13994d[_0x1b69('0x19')]['include'],function(_0x108ad2){return{'model':db[_0x108ad2[_0x1b69('0x1f')]],'as':_0x108ad2['as'],'attributes':_0x108ad2[_0x1b69('0x1b')],'include':_0x108ad2[_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x108ad2[_0x1b69('0x1d')],function(_0x113c5f){return{'model':db[_0x113c5f[_0x1b69('0x1f')]],'as':_0x113c5f['as'],'attributes':_0x113c5f[_0x1b69('0x1b')],'include':_0x113c5f['include']?_[_0x1b69('0x1e')](_0x113c5f[_0x1b69('0x1d')],function(_0x1cc552){return{'model':db[_0x1cc552[_0x1b69('0x1f')]],'as':_0x1cc552['as'],'attributes':_0x1cc552[_0x1b69('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1b69('0xc')](function(_0x476640){logger['info'](_0x1b69('0x16'),_0x13994d);logger[_0x1b69('0xe')](_0x1b69('0x16'),_0x13994d,JSON['stringify'](_0x476640));_0x48c572(_0x476640);})[_0x1b69('0x20')](function(_0x40943a){logger['error'](_0x1b69('0x16'),_0x40943a['message'],_0x13994d);_0x139a67(_0x594667[_0x1b69('0x11')](0x1f4,_0x40943a[_0x1b69('0x13')]));});});};exports[_0x1b69('0x21')]=function(_0x47d6c9){var _0x517be5=this;return new Promise(function(_0x1d8876,_0x73b1d3){return db['CmHopper']['find']({'raw':_0x47d6c9['options']?_0x47d6c9[_0x1b69('0x19')][_0x1b69('0x22')]===undefined?!![]:![]:!![],'where':_0x47d6c9[_0x1b69('0x19')]?_0x47d6c9[_0x1b69('0x19')]['where']||null:null,'attributes':_0x47d6c9['options']?_0x47d6c9['options'][_0x1b69('0x1b')]||null:null,'include':_0x47d6c9[_0x1b69('0x19')]?_0x47d6c9[_0x1b69('0x19')]['include']?_[_0x1b69('0x1e')](_0x47d6c9[_0x1b69('0x19')][_0x1b69('0x1d')],function(_0x54835b){return{'model':db[_0x54835b['model']],'as':_0x54835b['as'],'attributes':_0x54835b[_0x1b69('0x1b')],'include':_0x54835b[_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x54835b[_0x1b69('0x1d')],function(_0xa5835f){return{'model':db[_0xa5835f[_0x1b69('0x1f')]],'as':_0xa5835f['as'],'attributes':_0xa5835f[_0x1b69('0x1b')],'include':_0xa5835f[_0x1b69('0x1d')]?_['map'](_0xa5835f[_0x1b69('0x1d')],function(_0xef085b){return{'model':db[_0xef085b[_0x1b69('0x1f')]],'as':_0xef085b['as'],'attributes':_0xef085b['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b69('0xc')](function(_0x241262){logger['info'](_0x1b69('0x21'),_0x47d6c9);logger[_0x1b69('0xe')]('ShowCmHopper',_0x47d6c9,JSON[_0x1b69('0x10')](_0x241262));_0x1d8876(_0x241262);})[_0x1b69('0x20')](function(_0x52ad34){logger['error'](_0x1b69('0x21'),_0x52ad34[_0x1b69('0x13')],_0x47d6c9);_0x73b1d3(_0x517be5['error'](0x1f4,_0x52ad34[_0x1b69('0x13')]));});});};exports['CreateCmHopper']=function(_0x33b748){var _0x996f0f=this;return new Promise(function(_0x3fb818,_0x370213){return db['CmHopper'][_0x1b69('0x23')](_0x33b748[_0x1b69('0x24')],{'raw':_0x33b748['options']?_0x33b748[_0x1b69('0x19')][_0x1b69('0x22')]===undefined?!![]:![]:!![]})[_0x1b69('0xc')](function(_0x1062cc){logger[_0x1b69('0xd')](_0x1b69('0x25'),_0x33b748);logger[_0x1b69('0xe')](_0x1b69('0x25'),_0x33b748,JSON[_0x1b69('0x10')](_0x1062cc));_0x3fb818(_0x1062cc);})[_0x1b69('0x20')](function(_0x5a1edc){logger['error'](_0x1b69('0x25'),_0x5a1edc[_0x1b69('0x13')],_0x33b748);_0x370213(_0x996f0f['error'](0x1f4,_0x5a1edc[_0x1b69('0x13')]));});});};exports[_0x1b69('0x26')]=function(_0x4947cf){var _0xe2edf2=this;return new Promise(function(_0x539184,_0x43dd42){return db['CmHopper'][_0x1b69('0x27')](_0x4947cf[_0x1b69('0x24')],{'raw':_0x4947cf[_0x1b69('0x19')]?_0x4947cf[_0x1b69('0x19')][_0x1b69('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4947cf[_0x1b69('0x19')]?_0x4947cf[_0x1b69('0x19')]['where']||null:null,'attributes':_0x4947cf[_0x1b69('0x19')]?_0x4947cf['options']['attributes']||null:null,'limit':_0x4947cf[_0x1b69('0x19')]?_0x4947cf['options'][_0x1b69('0x1c')]||null:null})[_0x1b69('0xc')](function(_0x9b25f9){logger[_0x1b69('0xd')](_0x1b69('0x26'),_0x4947cf);logger[_0x1b69('0xe')]('UpdateCmHopper',_0x4947cf,JSON[_0x1b69('0x10')](_0x9b25f9));_0x539184(_0x9b25f9);})[_0x1b69('0x20')](function(_0x336732){logger[_0x1b69('0x11')](_0x1b69('0x26'),_0x336732[_0x1b69('0x13')],_0x4947cf);_0x43dd42(_0xe2edf2[_0x1b69('0x11')](0x1f4,_0x336732['message']));});});};exports[_0x1b69('0x28')]=function(_0x1a0d13){var _0x127a96=this;return new Promise(function(_0x10fcc4,_0x27d554){return db[_0x1b69('0x17')][_0x1b69('0x29')]({'where':_0x1a0d13[_0x1b69('0x19')]?_0x1a0d13[_0x1b69('0x19')][_0x1b69('0x1a')]||null:null})[_0x1b69('0xc')](function(_0x2146f4){logger[_0x1b69('0xd')]('DestroyCmHopper',_0x1a0d13);logger[_0x1b69('0xe')](_0x1b69('0x28'),_0x1a0d13,JSON['stringify'](_0x2146f4));_0x10fcc4(_0x2146f4);})[_0x1b69('0x20')](function(_0xe9e639){logger[_0x1b69('0x11')](_0x1b69('0x28'),_0xe9e639[_0x1b69('0x13')],_0x1a0d13);_0x27d554(_0x127a96['error'](0x1f4,_0xe9e639[_0x1b69('0x13')]));});});};exports[_0x1b69('0x2a')]=function(_0x38ddf1){var _0x3131c6=this;return new Promise(function(_0x59bd04,_0xfa1f60){return db[_0x1b69('0x2b')][_0x1b69('0x2c')]()[_0x1b69('0xc')](function(_0xfa5f58){return db[_0x1b69('0x2d')]['transaction'](function(_0x5ea383){return db[_0x1b69('0x17')]['findAll']({'where':_0x38ddf1[_0x1b69('0x19')]?_0x38ddf1['options'][_0x1b69('0x1a')]||null:null,'attributes':_0x38ddf1[_0x1b69('0x19')]?_0x38ddf1['options']['attributes']||null:null,'limit':_0x38ddf1[_0x1b69('0x19')]?_0x38ddf1[_0x1b69('0x19')]['limit']||null:null,'order':_0x38ddf1[_0x1b69('0x19')]?_0x38ddf1[_0x1b69('0x19')][_0x1b69('0x2e')]||null:null,'transaction':_0x5ea383,'lock':_0x5ea383['LOCK'][_0x1b69('0x2f')],'include':[{'model':db[_0x1b69('0x2b')],'as':_0x1b69('0x30'),'attributes':_[_0x1b69('0x31')](_0xfa5f58)},{'model':db['User'],'as':'Agent','attributes':['id','name',_0x1b69('0x32')]}]})['then'](function(_0x131eed){var _0x22d313=[];var _0x3bc109=[];for(var _0xba9be9=0x0;_0xba9be9<_0x131eed['length'];_0xba9be9+=0x1){var _0xef90e2=_0x131eed[_0xba9be9]['UserId'];if(_0xef90e2===null){_0x22d313[_0x1b69('0x33')](_0x131eed[_0xba9be9][_0x1b69('0x27')](_0x38ddf1['body'],{'transaction':_0x5ea383}));}else if(!_0x3bc109[_0x1b69('0x34')](_0xef90e2)){_0x3bc109[_0x1b69('0x33')](_0xef90e2);_0x22d313[_0x1b69('0x33')](_0x131eed[_0xba9be9][_0x1b69('0x27')](_0x38ddf1['body'],{'transaction':_0x5ea383}));}}return BPromise['all'](_0x22d313);});})['then'](function(_0x1dfcf9){logger[_0x1b69('0xd')](_0x1b69('0x2a'),_0x38ddf1);logger[_0x1b69('0xe')](_0x1b69('0x2a'),_0x38ddf1,JSON[_0x1b69('0x10')](_0x1dfcf9));_0x59bd04(_0x1dfcf9);})[_0x1b69('0x20')](function(_0x598f4e){logger[_0x1b69('0x11')](_0x1b69('0x2a'),_0x598f4e[_0x1b69('0x13')],_0x38ddf1);_0xfa1f60(_0x3131c6['error'](0x1f4,_0x598f4e[_0x1b69('0x13')]));});});});};exports['MoveContactManagedDialer']=function(_0x31e55a){var _0x586bea=this;return new Promise(function(_0x53f21e,_0x187989){return db['sequelize'][_0x1b69('0x35')](function(_0xcc8e3c){return db[_0x1b69('0x36')][_0x1b69('0x23')](_0x31e55a[_0x1b69('0x24')],{'raw':_0x31e55a['options']?_0x31e55a[_0x1b69('0x19')][_0x1b69('0x22')]===undefined?!![]:![]:!![],'transaction':_0xcc8e3c})[_0x1b69('0xc')](function(){return db[_0x1b69('0x17')][_0x1b69('0x29')]({'where':_0x31e55a[_0x1b69('0x19')]?_0x31e55a[_0x1b69('0x19')]['where']||null:null,'transaction':_0xcc8e3c});});})[_0x1b69('0xc')](function(_0x54a45d){logger['info'](_0x1b69('0x37'),_0x31e55a);logger[_0x1b69('0xe')](_0x1b69('0x37'),_0x31e55a,JSON['stringify'](_0x54a45d));_0x53f21e(_0x54a45d);})[_0x1b69('0x20')](function(_0x1b2fea){logger[_0x1b69('0x11')]('MoveContactManagedDialer',_0x1b2fea[_0x1b69('0x13')],_0x31e55a);_0x187989(_0x586bea[_0x1b69('0x11')](0x1f4,_0x1b2fea[_0x1b69('0x13')]));});});};exports[_0x1b69('0x38')]=function(_0x34414b){var _0x18cd0e=this;return new Promise(function(_0x68fb7f,_0x2d9208){return db[_0x1b69('0x17')][_0x1b69('0x18')]({'raw':_0x34414b[_0x1b69('0x19')]?_0x34414b['options'][_0x1b69('0x22')]===undefined?!![]:![]:!![],'where':_0x34414b[_0x1b69('0x19')]?_0x34414b[_0x1b69('0x19')][_0x1b69('0x1a')]||null:null,'attributes':[[db[_0x1b69('0x2d')]['fn'](_0x1b69('0x39'),db[_0x1b69('0x2d')]['fn']('IF',db[_0x1b69('0x2d')][_0x1b69('0x3a')](_0x1b69('0x3b')+util[_0x1b69('0x3c')](_0x1b69('0x3d'),moment()['format'](_0x1b69('0x3e')))+_0x1b69('0x3f')))),_0x1b69('0x40')]]})[_0x1b69('0xc')](function(_0xc55cc1){logger[_0x1b69('0xd')](_0x1b69('0x38'),_0x34414b);logger['debug']('CountReScheduled',_0x34414b,JSON[_0x1b69('0x10')](_0xc55cc1));_0x68fb7f(_0xc55cc1);})[_0x1b69('0x20')](function(_0x3d1b38){logger['error']('CountReScheduled',_0x3d1b38[_0x1b69('0x13')],_0x34414b);_0x2d9208(_0x18cd0e[_0x1b69('0x11')](0x1f4,_0x3d1b38[_0x1b69('0x13')]));});});};exports[_0x1b69('0x41')]=function(_0x24f672){var _0x91e05e=this;return new Promise(function(_0x430e35,_0x4057dc){return db[_0x1b69('0x2b')][_0x1b69('0x2c')]()['then'](function(_0x55a62a){return db[_0x1b69('0x2d')][_0x1b69('0x35')](function(_0x38658a){return db['CmHopper'][_0x1b69('0x18')]({'where':_0x24f672[_0x1b69('0x19')]?_0x24f672[_0x1b69('0x19')][_0x1b69('0x1a')]||null:null,'attributes':_0x24f672[_0x1b69('0x19')]?_0x24f672[_0x1b69('0x19')][_0x1b69('0x1b')]||null:null,'limit':0x1,'order':_0x24f672['options']?_0x24f672[_0x1b69('0x19')][_0x1b69('0x2e')]||null:null,'group':db[_0x1b69('0x17')][_0x1b69('0x42')],'transaction':_0x38658a,'lock':_0x38658a[_0x1b69('0x43')][_0x1b69('0x2f')],'include':_0x24f672[_0x1b69('0x19')]?_0x24f672['options'][_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x24f672[_0x1b69('0x19')][_0x1b69('0x1d')],function(_0x39d4de){return{'model':db[_0x39d4de[_0x1b69('0x1f')]],'as':_0x39d4de['as'],'attributes':_0x39d4de['attributes'],'include':_0x39d4de['include']?_[_0x1b69('0x1e')](_0x39d4de['include'],function(_0xca7628){return{'model':db[_0xca7628[_0x1b69('0x1f')]],'as':_0xca7628['as'],'attributes':_0xca7628[_0x1b69('0x1b')],'include':_0xca7628[_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0xca7628[_0x1b69('0x1d')],function(_0x2279ba){return{'model':db[_0x2279ba['model']],'as':_0x2279ba['as'],'attributes':_0x2279ba['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b69('0xc')](function(_0x279b3b){var _0x1b68e6=[];for(var _0x21d449=0x0;_0x21d449<_0x279b3b[_0x1b69('0x44')];_0x21d449+=0x1){_0x1b68e6[_0x1b69('0x33')](_0x279b3b[_0x21d449][_0x1b69('0x27')](_0x24f672[_0x1b69('0x24')],{'transaction':_0x38658a}));}return BPromise['all'](_0x1b68e6);});})['then'](function(_0x343b69){logger['info'](_0x1b69('0x41'),_0x24f672);logger[_0x1b69('0xe')](_0x1b69('0x41'),_0x24f672,JSON['stringify'](_0x343b69));_0x430e35(_0x343b69);})[_0x1b69('0x20')](function(_0x39a12b){logger[_0x1b69('0x11')]('GetContactRecallMe',_0x39a12b[_0x1b69('0x13')],_0x24f672);_0x4057dc(_0x91e05e[_0x1b69('0x11')](0x1f4,_0x39a12b[_0x1b69('0x13')]));});});});};exports[_0x1b69('0x45')]=function(_0x353cf5){var _0x2e75bb=this;return new Promise(function(_0x586f6b,_0x1d4c30){db['CmContact'][_0x1b69('0x2c')]()[_0x1b69('0xc')](function(_0x4cc7a5){return db['CmHopper']['findAll']({'raw':_0x353cf5[_0x1b69('0x19')]?_0x353cf5['options'][_0x1b69('0x22')]===undefined?!![]:![]:!![],'where':_0x353cf5[_0x1b69('0x19')]?_0x353cf5[_0x1b69('0x19')]['where']||null:null,'attributes':_0x353cf5[_0x1b69('0x19')]?_0x353cf5[_0x1b69('0x19')]['attributes']||null:null,'limit':_0x353cf5[_0x1b69('0x19')]?_0x353cf5[_0x1b69('0x19')][_0x1b69('0x1c')]||null:null,'include':_0x353cf5['options']?_0x353cf5['options'][_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x353cf5[_0x1b69('0x19')]['include'],function(_0x42531b){return{'model':db[_0x42531b['model']],'as':_0x42531b['as'],'attributes':_0x42531b['as']===_0x1b69('0x30')?_[_0x1b69('0x31')](_0x4cc7a5):_0x42531b['attributes'],'include':_0x42531b[_0x1b69('0x1d')]?_['map'](_0x42531b[_0x1b69('0x1d')],function(_0x3da63f){return{'model':db[_0x3da63f[_0x1b69('0x1f')]],'as':_0x3da63f['as'],'attributes':_0x3da63f[_0x1b69('0x1b')],'include':_0x3da63f[_0x1b69('0x1d')]?_[_0x1b69('0x1e')](_0x3da63f[_0x1b69('0x1d')],function(_0x24491a){return{'model':db[_0x24491a[_0x1b69('0x1f')]],'as':_0x24491a['as'],'attributes':_0x24491a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x576b06){logger[_0x1b69('0xd')](_0x1b69('0x16'),_0x353cf5);logger['debug']('GetCmHopper',_0x353cf5,JSON['stringify'](_0x576b06));_0x586f6b(_0x576b06);})[_0x1b69('0x20')](function(_0x17d837){logger[_0x1b69('0x11')]('GetCmHopper',_0x17d837[_0x1b69('0x13')],_0x353cf5);_0x1d4c30(_0x2e75bb[_0x1b69('0x11')](0x1f4,_0x17d837['message']));});});});};
\ No newline at end of file
index e68d043..16cdf97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cbd=['/opencontacts','getOpenContacts','/:id','post','getPreview','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe'];(function(_0x34771a,_0x49c9c9){var _0x13351b=function(_0x51fe81){while(--_0x51fe81){_0x34771a['push'](_0x34771a['shift']());}};_0x13351b(++_0x49c9c9);}(_0x4cbd,0xa9));var _0xd4cb=function(_0x1d29f6,_0x45f6a0){_0x1d29f6=_0x1d29f6-0x0;var _0x491093=_0x4cbd[_0x1d29f6];return _0x491093;};'use strict';var multer=require(_0xd4cb('0x0'));var util=require(_0xd4cb('0x1'));var path=require(_0xd4cb('0x2'));var timeout=require(_0xd4cb('0x3'));var express=require(_0xd4cb('0x4'));var router=express[_0xd4cb('0x5')]();var fs_extra=require(_0xd4cb('0x6'));var auth=require(_0xd4cb('0x7'));var interaction=require(_0xd4cb('0x8'));var config=require(_0xd4cb('0x9'));var controller=require('./cmHopper.controller');router[_0xd4cb('0xa')]('/',auth[_0xd4cb('0xb')](),controller[_0xd4cb('0xc')]);router[_0xd4cb('0xa')](_0xd4cb('0xd'),auth[_0xd4cb('0xb')](),controller[_0xd4cb('0xe')]);router[_0xd4cb('0xa')](_0xd4cb('0xf'),auth[_0xd4cb('0xb')](),controller[_0xd4cb('0x10')]);router[_0xd4cb('0xa')](_0xd4cb('0x11'),auth['isAuthenticated'](),controller['show']);router[_0xd4cb('0x12')]('/',auth[_0xd4cb('0xb')](),controller['create']);router[_0xd4cb('0x12')]('/preview',auth[_0xd4cb('0xb')](),controller[_0xd4cb('0x13')]);router[_0xd4cb('0x14')](_0xd4cb('0x11'),auth[_0xd4cb('0xb')](),controller[_0xd4cb('0x15')]);router[_0xd4cb('0x16')](_0xd4cb('0x11'),auth[_0xd4cb('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x5cef=['../../config/environment','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','/:id','show','post','create','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3bcc19,_0x3190e4){var _0x2570f6=function(_0x239f41){while(--_0x239f41){_0x3bcc19['push'](_0x3bcc19['shift']());}};_0x2570f6(++_0x3190e4);}(_0x5cef,0x141));var _0xf5ce=function(_0x98feb5,_0x2fa627){_0x98feb5=_0x98feb5-0x0;var _0x3c5902=_0x5cef[_0x98feb5];return _0x3c5902;};'use strict';var multer=require(_0xf5ce('0x0'));var util=require(_0xf5ce('0x1'));var path=require(_0xf5ce('0x2'));var timeout=require(_0xf5ce('0x3'));var express=require(_0xf5ce('0x4'));var router=express[_0xf5ce('0x5')]();var fs_extra=require(_0xf5ce('0x6'));var auth=require(_0xf5ce('0x7'));var interaction=require(_0xf5ce('0x8'));var config=require(_0xf5ce('0x9'));var controller=require('./cmHopper.controller');router[_0xf5ce('0xa')]('/',auth[_0xf5ce('0xb')](),controller[_0xf5ce('0xc')]);router['get'](_0xf5ce('0xd'),auth[_0xf5ce('0xb')](),controller['describe']);router[_0xf5ce('0xa')](_0xf5ce('0xe'),auth[_0xf5ce('0xb')](),controller[_0xf5ce('0xf')]);router[_0xf5ce('0xa')](_0xf5ce('0x10'),auth[_0xf5ce('0xb')](),controller[_0xf5ce('0x11')]);router[_0xf5ce('0x12')]('/',auth['isAuthenticated'](),controller[_0xf5ce('0x13')]);router[_0xf5ce('0x12')]('/preview',auth['isAuthenticated'](),controller['getPreview']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf5ce('0x14')]);router['delete']('/:id',auth[_0xf5ce('0xb')](),controller['destroy']);module[_0xf5ce('0x15')]=router;
\ No newline at end of file
index dd8befb..56746dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0eb2=['exports','STRING','INTEGER','contactListQueue','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0eb2,0x11c));var _0x20eb=function(_0x21c5e8,_0x432eec){_0x21c5e8=_0x21c5e8-0x0;var _0x1579e5=_0x0eb2[_0x21c5e8];return _0x1579e5;};'use strict';var moment=require(_0x20eb('0x0'));var Sequelize=require('sequelize');module[_0x20eb('0x1')]={'phone':{'type':Sequelize[_0x20eb('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x20eb('0x3')],'unique':_0x20eb('0x4')},'ListId':{'type':Sequelize[_0x20eb('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x20eb('0x3')],'unique':'contactListQueue'}};
\ No newline at end of file
+var _0x89b2=['STRING','INTEGER','contactListQueue','moment','exports'];(function(_0x13b2e1,_0x30a633){var _0x4afafb=function(_0x2e4dfa){while(--_0x2e4dfa){_0x13b2e1['push'](_0x13b2e1['shift']());}};_0x4afafb(++_0x30a633);}(_0x89b2,0x1de));var _0x289b=function(_0x348d83,_0x1e627e){_0x348d83=_0x348d83-0x0;var _0x405138=_0x89b2[_0x348d83];return _0x405138;};'use strict';var moment=require(_0x289b('0x0'));var Sequelize=require('sequelize');module[_0x289b('0x1')]={'phone':{'type':Sequelize[_0x289b('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x289b('0x3')],'unique':_0x289b('0x4')},'ListId':{'type':Sequelize[_0x289b('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x289b('0x3')],'unique':'contactListQueue'}};
\ No newline at end of file
index e0640ff..e9419e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x693d=['../../mysqldb','status','end','offset','undefined','count','limit','set','Content-Range','json','save','update','destroy','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','VIRTUAL','filter','options','CmHopperBlack','includeAll','include','findAll','rows','catch','show','find','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x43689f,_0x1a6f66){var _0x55b06d=function(_0x42ec13){while(--_0x42ec13){_0x43689f['push'](_0x43689f['shift']());}};_0x55b06d(++_0x1a6f66);}(_0x693d,0x15c));var _0xd693=function(_0x5535a4,_0x5bfcdd){_0x5535a4=_0x5535a4-0x0;var _0x240b82=_0x693d[_0x5535a4];return _0x240b82;};'use strict';var emlformat=require(_0xd693('0x0'));var rimraf=require(_0xd693('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd693('0x2'));var rp=require(_0xd693('0x3'));var moment=require('moment');var BPromise=require(_0xd693('0x4'));var Mustache=require('mustache');var util=require(_0xd693('0x5'));var path=require(_0xd693('0x6'));var sox=require(_0xd693('0x7'));var csv=require(_0xd693('0x8'));var ejs=require(_0xd693('0x9'));var fs=require('fs');var fs_extra=require(_0xd693('0xa'));var _=require(_0xd693('0xb'));var squel=require(_0xd693('0xc'));var crypto=require(_0xd693('0xd'));var jsforce=require(_0xd693('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd693('0x8'));var querystring=require(_0xd693('0xf'));var Papa=require('papaparse');var Redis=require(_0xd693('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd693('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd693('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xd693('0x13'));var config=require(_0xd693('0x14'));var licenseUtil=require(_0xd693('0x15'));var db=require(_0xd693('0x16'))['db'];function respondWithStatusCode(_0x1638e6,_0x3501de){_0x3501de=_0x3501de||0xcc;return function(_0x1769ab){if(_0x1769ab){return _0x1638e6['sendStatus'](_0x3501de);}return _0x1638e6[_0xd693('0x17')](_0x3501de)[_0xd693('0x18')]();};}function respondWithResult(_0x1c2699,_0x3e4add){_0x3e4add=_0x3e4add||0xc8;return function(_0x48ac9f){if(_0x48ac9f){return _0x1c2699[_0xd693('0x17')](_0x3e4add)['json'](_0x48ac9f);}};}function respondWithFilteredResult(_0x3d62d2,_0xef7811){return function(_0x470147){if(_0x470147){var _0x1bf27e=typeof _0xef7811[_0xd693('0x19')]===_0xd693('0x1a')&&typeof _0xef7811['limit']===_0xd693('0x1a');var _0xf05499=_0x470147['count'];var _0x4ba0fc=_0x1bf27e?0x0:_0xef7811['offset'];var _0x167180=_0x1bf27e?_0x470147[_0xd693('0x1b')]:_0xef7811[_0xd693('0x19')]+_0xef7811[_0xd693('0x1c')];var _0x11bc99;if(_0x167180>=_0xf05499){_0x167180=_0xf05499;_0x11bc99=0xc8;}else{_0x11bc99=0xce;}_0x3d62d2['status'](_0x11bc99);return _0x3d62d2[_0xd693('0x1d')](_0xd693('0x1e'),_0x4ba0fc+'-'+_0x167180+'/'+_0xf05499)[_0xd693('0x1f')](_0x470147);}return null;};}function patchUpdates(_0x5b5d27){return function(_0x293aba){try{jsonpatch['apply'](_0x293aba,_0x5b5d27,!![]);}catch(_0x35577b){return BPromise['reject'](_0x35577b);}return _0x293aba[_0xd693('0x20')]();};}function saveUpdates(_0x514caa,_0x1c5352){return function(_0x52672d){if(_0x52672d){return _0x52672d[_0xd693('0x21')](_0x514caa)['then'](function(_0x2e8714){return _0x2e8714;});}return null;};}function removeEntity(_0x2b13d0,_0x26866a){return function(_0x5ddc6e){if(_0x5ddc6e){return _0x5ddc6e[_0xd693('0x22')]()[_0xd693('0x23')](function(){_0x2b13d0[_0xd693('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308e19,_0x408fcf){return function(_0x157c68){if(!_0x157c68){_0x308e19['sendStatus'](0x194);}return _0x157c68;};}function handleError(_0x3c4721,_0x31fc0f){_0x31fc0f=_0x31fc0f||0x1f4;return function(_0x2ef1c2){logger[_0xd693('0x24')](_0x2ef1c2[_0xd693('0x25')]);if(_0x2ef1c2[_0xd693('0x26')]){delete _0x2ef1c2[_0xd693('0x26')];}_0x3c4721[_0xd693('0x17')](_0x31fc0f)[_0xd693('0x27')](_0x2ef1c2);};}exports[_0xd693('0x28')]=function(_0x3e3baa,_0x277ad0){var _0x2870ac={},_0x3a5143={},_0x1952f1={'count':0x0,'rows':[]};var _0x14f65a=_['map'](db['CmHopperBlack'][_0xd693('0x29')],function(_0x5be5a8){return{'name':_0x5be5a8[_0xd693('0x2a')],'type':_0x5be5a8[_0xd693('0x2b')][_0xd693('0x2c')]};});_0x3a5143[_0xd693('0x2d')]=_['map'](_0x14f65a,'name');_0x3a5143[_0xd693('0x2e')]=_[_0xd693('0x2f')](_0x3e3baa[_0xd693('0x2e')]);_0x3a5143['filters']=_[_0xd693('0x30')](_0x3a5143['model'],_0x3a5143[_0xd693('0x2e')]);_0x2870ac[_0xd693('0x31')]=_['intersection'](_0x3a5143[_0xd693('0x2d')],qs['fields'](_0x3e3baa['query'][_0xd693('0x32')]));_0x2870ac[_0xd693('0x31')]=_0x2870ac[_0xd693('0x31')][_0xd693('0x33')]?_0x2870ac[_0xd693('0x31')]:_0x3a5143[_0xd693('0x2d')];if(!_0x3e3baa['query'][_0xd693('0x34')](_0xd693('0x35'))){_0x2870ac[_0xd693('0x1c')]=qs[_0xd693('0x1c')](_0x3e3baa['query'][_0xd693('0x1c')]);_0x2870ac[_0xd693('0x19')]=qs[_0xd693('0x19')](_0x3e3baa[_0xd693('0x2e')][_0xd693('0x19')]);}_0x2870ac[_0xd693('0x36')]=qs[_0xd693('0x37')](_0x3e3baa[_0xd693('0x2e')][_0xd693('0x37')]);_0x2870ac[_0xd693('0x38')]=qs[_0xd693('0x39')](_['pick'](_0x3e3baa[_0xd693('0x2e')],_0x3a5143[_0xd693('0x39')]),_0x14f65a);if(_0x3e3baa[_0xd693('0x2e')]['filter']){_0x2870ac[_0xd693('0x38')]=_[_0xd693('0x3a')](_0x2870ac['where'],{'$or':_[_0xd693('0x3b')](_0x14f65a,function(_0x58a4f0){if(_0x58a4f0[_0xd693('0x2b')]!==_0xd693('0x3c')){var _0x309821={};_0x309821[_0x58a4f0[_0xd693('0x26')]]={'$like':'%'+_0x3e3baa[_0xd693('0x2e')][_0xd693('0x3d')]+'%'};return _0x309821;}})});}_0x2870ac=_[_0xd693('0x3a')]({},_0x2870ac,_0x3e3baa[_0xd693('0x3e')]);var _0x35a2e3={'where':_0x2870ac['where']};return db[_0xd693('0x3f')][_0xd693('0x1b')](_0x35a2e3)['then'](function(_0x891cb){_0x1952f1[_0xd693('0x1b')]=_0x891cb;if(_0x3e3baa[_0xd693('0x2e')][_0xd693('0x40')]){_0x2870ac[_0xd693('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0xd693('0x42')](_0x2870ac);})[_0xd693('0x23')](function(_0xb54f06){_0x1952f1[_0xd693('0x43')]=_0xb54f06;return _0x1952f1;})[_0xd693('0x23')](respondWithFilteredResult(_0x277ad0,_0x2870ac))[_0xd693('0x44')](handleError(_0x277ad0,null));};exports[_0xd693('0x45')]=function(_0x29f6a3,_0x1bad07){var _0x34cba3={'raw':!![],'where':{'id':_0x29f6a3['params']['id']}},_0x181438={};_0x181438[_0xd693('0x2d')]=_[_0xd693('0x2f')](db[_0xd693('0x3f')][_0xd693('0x29')]);_0x181438[_0xd693('0x2e')]=_[_0xd693('0x2f')](_0x29f6a3['query']);_0x181438[_0xd693('0x39')]=_['intersection'](_0x181438['model'],_0x181438[_0xd693('0x2e')]);_0x34cba3['attributes']=_[_0xd693('0x30')](_0x181438[_0xd693('0x2d')],qs[_0xd693('0x32')](_0x29f6a3['query'][_0xd693('0x32')]));_0x34cba3[_0xd693('0x31')]=_0x34cba3[_0xd693('0x31')][_0xd693('0x33')]?_0x34cba3[_0xd693('0x31')]:_0x181438[_0xd693('0x2d')];if(_0x29f6a3[_0xd693('0x2e')][_0xd693('0x40')]){_0x34cba3[_0xd693('0x41')]=[{'all':!![]}];}_0x34cba3=_['merge']({},_0x34cba3,_0x29f6a3[_0xd693('0x3e')]);return db['CmHopperBlack'][_0xd693('0x46')](_0x34cba3)[_0xd693('0x23')](handleEntityNotFound(_0x1bad07,null))[_0xd693('0x23')](respondWithResult(_0x1bad07,null))['catch'](handleError(_0x1bad07,null));};exports[_0xd693('0x21')]=function(_0x5f4ede,_0x400dfc){if(_0x5f4ede[_0xd693('0x47')]['id']){delete _0x5f4ede['body']['id'];}return db[_0xd693('0x3f')][_0xd693('0x46')]({'where':{'id':_0x5f4ede['params']['id']}})[_0xd693('0x23')](handleEntityNotFound(_0x400dfc,null))[_0xd693('0x23')](saveUpdates(_0x5f4ede['body'],null))[_0xd693('0x23')](respondWithResult(_0x400dfc,null))['catch'](handleError(_0x400dfc,null));};exports['destroy']=function(_0x275c95,_0x44cfef){return db[_0xd693('0x3f')]['find']({'where':{'id':_0x275c95[_0xd693('0x48')]['id']}})[_0xd693('0x23')](handleEntityNotFound(_0x44cfef,null))[_0xd693('0x23')](removeEntity(_0x44cfef,null))['catch'](handleError(_0x44cfef,null));};exports[_0xd693('0x49')]=function(_0x395c7a,_0x6f72fb){return db[_0xd693('0x3f')][_0xd693('0x49')]()[_0xd693('0x23')](respondWithResult(_0x6f72fb,null))['catch'](handleError(_0x6f72fb,null));};
\ No newline at end of file
+var _0x9785=['intersection','attributes','fields','nolimit','limit','order','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','then','show','params','keys','rawAttributes','length','find','catch','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','set','json','apply','reject','save','update','destroy','sendStatus','stack','name','send','map','CmHopperBlack','fieldName','type','model','query'];(function(_0x447c29,_0x5db822){var _0x33420d=function(_0x5a46d1){while(--_0x5a46d1){_0x447c29['push'](_0x447c29['shift']());}};_0x33420d(++_0x5db822);}(_0x9785,0x133));var _0x5978=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x9785[_0x173d7e];return _0x2220d6;};'use strict';var emlformat=require(_0x5978('0x0'));var rimraf=require(_0x5978('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5978('0x2'));var rp=require(_0x5978('0x3'));var moment=require(_0x5978('0x4'));var BPromise=require(_0x5978('0x5'));var Mustache=require(_0x5978('0x6'));var util=require(_0x5978('0x7'));var path=require('path');var sox=require(_0x5978('0x8'));var csv=require(_0x5978('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5978('0xa'));var crypto=require(_0x5978('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5978('0x9'));var querystring=require(_0x5978('0xc'));var Papa=require(_0x5978('0xd'));var Redis=require('ioredis');var authService=require(_0x5978('0xe'));var qs=require(_0x5978('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5978('0x10'));var logger=require(_0x5978('0x11'))(_0x5978('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5978('0x13'));var db=require(_0x5978('0x14'))['db'];function respondWithStatusCode(_0x4a7a20,_0xbebbd9){_0xbebbd9=_0xbebbd9||0xcc;return function(_0x49a7bb){if(_0x49a7bb){return _0x4a7a20['sendStatus'](_0xbebbd9);}return _0x4a7a20['status'](_0xbebbd9)[_0x5978('0x15')]();};}function respondWithResult(_0x3c3b3a,_0x1089ea){_0x1089ea=_0x1089ea||0xc8;return function(_0x133f79){if(_0x133f79){return _0x3c3b3a[_0x5978('0x16')](_0x1089ea)['json'](_0x133f79);}};}function respondWithFilteredResult(_0x5d820a,_0x3607be){return function(_0x6795c8){if(_0x6795c8){var _0x138c13=typeof _0x3607be[_0x5978('0x17')]==='undefined'&&typeof _0x3607be['limit']===_0x5978('0x18');var _0x1b5b8b=_0x6795c8[_0x5978('0x19')];var _0x56286c=_0x138c13?0x0:_0x3607be[_0x5978('0x17')];var _0x1cba78=_0x138c13?_0x6795c8[_0x5978('0x19')]:_0x3607be[_0x5978('0x17')]+_0x3607be['limit'];var _0x41efb0;if(_0x1cba78>=_0x1b5b8b){_0x1cba78=_0x1b5b8b;_0x41efb0=0xc8;}else{_0x41efb0=0xce;}_0x5d820a['status'](_0x41efb0);return _0x5d820a[_0x5978('0x1a')]('Content-Range',_0x56286c+'-'+_0x1cba78+'/'+_0x1b5b8b)[_0x5978('0x1b')](_0x6795c8);}return null;};}function patchUpdates(_0x5085dd){return function(_0x1b21eb){try{jsonpatch[_0x5978('0x1c')](_0x1b21eb,_0x5085dd,!![]);}catch(_0x2daf22){return BPromise[_0x5978('0x1d')](_0x2daf22);}return _0x1b21eb[_0x5978('0x1e')]();};}function saveUpdates(_0x416582,_0x50e299){return function(_0x1e2e1a){if(_0x1e2e1a){return _0x1e2e1a[_0x5978('0x1f')](_0x416582)['then'](function(_0x384cd4){return _0x384cd4;});}return null;};}function removeEntity(_0x547703,_0x4f5c76){return function(_0x5ea79c){if(_0x5ea79c){return _0x5ea79c[_0x5978('0x20')]()['then'](function(){_0x547703[_0x5978('0x16')](0xcc)[_0x5978('0x15')]();});}};}function handleEntityNotFound(_0x17f5dd,_0x459d97){return function(_0x496595){if(!_0x496595){_0x17f5dd[_0x5978('0x21')](0x194);}return _0x496595;};}function handleError(_0x366ab1,_0xf872ac){_0xf872ac=_0xf872ac||0x1f4;return function(_0xe03c41){logger['error'](_0xe03c41[_0x5978('0x22')]);if(_0xe03c41[_0x5978('0x23')]){delete _0xe03c41[_0x5978('0x23')];}_0x366ab1[_0x5978('0x16')](_0xf872ac)[_0x5978('0x24')](_0xe03c41);};}exports['index']=function(_0x90d075,_0x303f57){var _0x528126={},_0x41426f={},_0x4402c0={'count':0x0,'rows':[]};var _0x1f2847=_[_0x5978('0x25')](db[_0x5978('0x26')]['rawAttributes'],function(_0x1b29bd){return{'name':_0x1b29bd[_0x5978('0x27')],'type':_0x1b29bd[_0x5978('0x28')]['key']};});_0x41426f[_0x5978('0x29')]=_['map'](_0x1f2847,_0x5978('0x23'));_0x41426f[_0x5978('0x2a')]=_['keys'](_0x90d075[_0x5978('0x2a')]);_0x41426f['filters']=_[_0x5978('0x2b')](_0x41426f[_0x5978('0x29')],_0x41426f['query']);_0x528126[_0x5978('0x2c')]=_[_0x5978('0x2b')](_0x41426f[_0x5978('0x29')],qs[_0x5978('0x2d')](_0x90d075[_0x5978('0x2a')]['fields']));_0x528126['attributes']=_0x528126[_0x5978('0x2c')]['length']?_0x528126['attributes']:_0x41426f[_0x5978('0x29')];if(!_0x90d075['query']['hasOwnProperty'](_0x5978('0x2e'))){_0x528126[_0x5978('0x2f')]=qs[_0x5978('0x2f')](_0x90d075[_0x5978('0x2a')][_0x5978('0x2f')]);_0x528126[_0x5978('0x17')]=qs[_0x5978('0x17')](_0x90d075[_0x5978('0x2a')][_0x5978('0x17')]);}_0x528126[_0x5978('0x30')]=qs['sort'](_0x90d075[_0x5978('0x2a')]['sort']);_0x528126['where']=qs[_0x5978('0x31')](_[_0x5978('0x32')](_0x90d075['query'],_0x41426f[_0x5978('0x31')]),_0x1f2847);if(_0x90d075[_0x5978('0x2a')][_0x5978('0x33')]){_0x528126[_0x5978('0x34')]=_[_0x5978('0x35')](_0x528126[_0x5978('0x34')],{'$or':_[_0x5978('0x25')](_0x1f2847,function(_0x41f8de){if(_0x41f8de[_0x5978('0x28')]!==_0x5978('0x36')){var _0x1d3414={};_0x1d3414[_0x41f8de['name']]={'$like':'%'+_0x90d075[_0x5978('0x2a')][_0x5978('0x33')]+'%'};return _0x1d3414;}})});}_0x528126=_['merge']({},_0x528126,_0x90d075[_0x5978('0x37')]);var _0x3cf252={'where':_0x528126['where']};return db[_0x5978('0x26')][_0x5978('0x19')](_0x3cf252)['then'](function(_0x189134){_0x4402c0[_0x5978('0x19')]=_0x189134;if(_0x90d075[_0x5978('0x2a')][_0x5978('0x38')]){_0x528126[_0x5978('0x39')]=[{'all':!![]}];}return db[_0x5978('0x26')][_0x5978('0x3a')](_0x528126);})['then'](function(_0x3b2dce){_0x4402c0[_0x5978('0x3b')]=_0x3b2dce;return _0x4402c0;})[_0x5978('0x3c')](respondWithFilteredResult(_0x303f57,_0x528126))['catch'](handleError(_0x303f57,null));};exports[_0x5978('0x3d')]=function(_0x552ae1,_0x35472f){var _0x1bb298={'raw':!![],'where':{'id':_0x552ae1[_0x5978('0x3e')]['id']}},_0x36f7ee={};_0x36f7ee[_0x5978('0x29')]=_[_0x5978('0x3f')](db[_0x5978('0x26')][_0x5978('0x40')]);_0x36f7ee[_0x5978('0x2a')]=_[_0x5978('0x3f')](_0x552ae1[_0x5978('0x2a')]);_0x36f7ee[_0x5978('0x31')]=_[_0x5978('0x2b')](_0x36f7ee['model'],_0x36f7ee[_0x5978('0x2a')]);_0x1bb298['attributes']=_[_0x5978('0x2b')](_0x36f7ee['model'],qs[_0x5978('0x2d')](_0x552ae1[_0x5978('0x2a')]['fields']));_0x1bb298[_0x5978('0x2c')]=_0x1bb298[_0x5978('0x2c')][_0x5978('0x41')]?_0x1bb298[_0x5978('0x2c')]:_0x36f7ee[_0x5978('0x29')];if(_0x552ae1['query']['includeAll']){_0x1bb298[_0x5978('0x39')]=[{'all':!![]}];}_0x1bb298=_[_0x5978('0x35')]({},_0x1bb298,_0x552ae1[_0x5978('0x37')]);return db[_0x5978('0x26')][_0x5978('0x42')](_0x1bb298)[_0x5978('0x3c')](handleEntityNotFound(_0x35472f,null))[_0x5978('0x3c')](respondWithResult(_0x35472f,null))[_0x5978('0x43')](handleError(_0x35472f,null));};exports[_0x5978('0x1f')]=function(_0x278a0a,_0x297ac1){if(_0x278a0a['body']['id']){delete _0x278a0a[_0x5978('0x44')]['id'];}return db[_0x5978('0x26')]['find']({'where':{'id':_0x278a0a[_0x5978('0x3e')]['id']}})[_0x5978('0x3c')](handleEntityNotFound(_0x297ac1,null))[_0x5978('0x3c')](saveUpdates(_0x278a0a[_0x5978('0x44')],null))['then'](respondWithResult(_0x297ac1,null))['catch'](handleError(_0x297ac1,null));};exports[_0x5978('0x20')]=function(_0x210bb8,_0x2b219d){return db[_0x5978('0x26')]['find']({'where':{'id':_0x210bb8['params']['id']}})[_0x5978('0x3c')](handleEntityNotFound(_0x2b219d,null))[_0x5978('0x3c')](removeEntity(_0x2b219d,null))[_0x5978('0x43')](handleError(_0x2b219d,null));};exports[_0x5978('0x45')]=function(_0x5edd9f,_0x7deac8){return db[_0x5978('0x26')][_0x5978('0x45')]()[_0x5978('0x3c')](respondWithResult(_0x7deac8,null))[_0x5978('0x43')](handleError(_0x7deac8,null));};
\ No newline at end of file
index 2c9fb21..a96c317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbb4=['api','bluebird','../../config/environment','define','CmHopperBlack','cm_hopper_black','lodash','util'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xbbb4,0x176));var _0x4bbb=function(_0x13d06d,_0x25f1ad){_0x13d06d=_0x13d06d-0x0;var _0x154ec3=_0xbbb4[_0x13d06d];return _0x154ec3;};'use strict';var _=require(_0x4bbb('0x0'));var util=require(_0x4bbb('0x1'));var logger=require('../../config/logger')(_0x4bbb('0x2'));var moment=require('moment');var BPromise=require(_0x4bbb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4bbb('0x4'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x2dae5a,_0x45cb7e){return _0x2dae5a[_0x4bbb('0x5')](_0x4bbb('0x6'),attributes,{'tableName':_0x4bbb('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x478f=['moment','bluebird','request-promise','path','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','lodash','../../config/logger','api'];(function(_0x4a1d1c,_0x37f56d){var _0x588863=function(_0x348e50){while(--_0x348e50){_0x4a1d1c['push'](_0x4a1d1c['shift']());}};_0x588863(++_0x37f56d);}(_0x478f,0x81));var _0xf478=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0x478f[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0xf478('0x0'));var util=require('util');var logger=require(_0xf478('0x1'))(_0xf478('0x2'));var moment=require(_0xf478('0x3'));var BPromise=require(_0xf478('0x4'));var rp=require(_0xf478('0x5'));var fs=require('fs');var path=require(_0xf478('0x6'));var rimraf=require('rimraf');var config=require(_0xf478('0x7'));var attributes=require(_0xf478('0x8'));module[_0xf478('0x9')]=function(_0x846a9f,_0x198ac5){return _0x846a9f['define'](_0xf478('0xa'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 03b3b6c..76028ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5afe=['catch','GetCmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','info','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','CmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x13a7b7,_0x17a4d1){var _0x36f506=function(_0x205e9c){while(--_0x205e9c){_0x13a7b7['push'](_0x13a7b7['shift']());}};_0x36f506(++_0x17a4d1);}(_0x5afe,0x11c));var _0xe5af=function(_0x3c5a41,_0x558b2c){_0x3c5a41=_0x3c5a41-0x0;var _0x5389f5=_0x5afe[_0x3c5a41];return _0x5389f5;};'use strict';var _=require(_0xe5af('0x0'));var util=require(_0xe5af('0x1'));var moment=require(_0xe5af('0x2'));var BPromise=require('bluebird');var rs=require(_0xe5af('0x3'));var fs=require('fs');var Redis=require(_0xe5af('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5af('0x5'));var logger=require(_0xe5af('0x6'))(_0xe5af('0x7'));var config=require(_0xe5af('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe5af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x30ff7f,_0xb69ba5,_0x22a2c2){return new BPromise(function(_0x5daae9,_0x3210ed){return client[_0xe5af('0xa')](_0x30ff7f,_0x22a2c2)[_0xe5af('0xb')](function(_0x4b9c45){logger['info'](_0xe5af('0xc'),_0xb69ba5,_0xe5af('0xd'));logger[_0xe5af('0xe')](_0xe5af('0xf'),_0xb69ba5,_0xe5af('0xd'),JSON[_0xe5af('0x10')](_0x4b9c45));if(_0x4b9c45['error']){if(_0x4b9c45[_0xe5af('0x11')][_0xe5af('0x12')]===0x1f4){logger[_0xe5af('0x11')](_0xe5af('0xc'),_0xb69ba5,_0x4b9c45[_0xe5af('0x11')][_0xe5af('0x13')]);return _0x3210ed(_0x4b9c45[_0xe5af('0x11')][_0xe5af('0x13')]);}logger[_0xe5af('0x11')](_0xe5af('0xc'),_0xb69ba5,_0x4b9c45[_0xe5af('0x11')][_0xe5af('0x13')]);return _0x5daae9(_0x4b9c45[_0xe5af('0x11')][_0xe5af('0x13')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0xb69ba5,_0xe5af('0xd'));_0x5daae9(_0x4b9c45['result'][_0xe5af('0x13')]);}})[_0xe5af('0x14')](function(_0x517569){logger['error'](_0xe5af('0xc'),_0xb69ba5,_0x517569);_0x3210ed(_0x517569);});});}exports[_0xe5af('0x15')]=function(_0x3e9131){var _0x43ad2f=this;return new Promise(function(_0x478524,_0x1b7165){return db['CmHopperBlack'][_0xe5af('0x16')]({'raw':_0x3e9131['options']?_0x3e9131[_0xe5af('0x17')][_0xe5af('0x18')]===undefined?!![]:![]:!![],'where':_0x3e9131['options']?_0x3e9131['options'][_0xe5af('0x19')]||null:null,'attributes':_0x3e9131[_0xe5af('0x17')]?_0x3e9131[_0xe5af('0x17')][_0xe5af('0x1a')]||null:null,'limit':_0x3e9131['options']?_0x3e9131[_0xe5af('0x17')][_0xe5af('0x1b')]||null:null,'include':_0x3e9131[_0xe5af('0x17')]?_0x3e9131[_0xe5af('0x17')][_0xe5af('0x1c')]?_[_0xe5af('0x1d')](_0x3e9131[_0xe5af('0x17')]['include'],function(_0x41fb53){return{'model':db[_0x41fb53[_0xe5af('0x1e')]],'as':_0x41fb53['as'],'attributes':_0x41fb53['attributes'],'include':_0x41fb53[_0xe5af('0x1c')]?_[_0xe5af('0x1d')](_0x41fb53[_0xe5af('0x1c')],function(_0x58767f){return{'model':db[_0x58767f['model']],'as':_0x58767f['as'],'attributes':_0x58767f[_0xe5af('0x1a')],'include':_0x58767f[_0xe5af('0x1c')]?_[_0xe5af('0x1d')](_0x58767f[_0xe5af('0x1c')],function(_0x195ec8){return{'model':db[_0x195ec8[_0xe5af('0x1e')]],'as':_0x195ec8['as'],'attributes':_0x195ec8['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x45661f){logger[_0xe5af('0x1f')]('GetCmHopperBlack',_0x3e9131);logger[_0xe5af('0xe')]('GetCmHopperBlack',_0x3e9131,JSON['stringify'](_0x45661f));_0x478524(_0x45661f);})[_0xe5af('0x14')](function(_0x2fd4ba){logger[_0xe5af('0x11')](_0xe5af('0x15'),_0x2fd4ba['message'],_0x3e9131);_0x1b7165(_0x43ad2f[_0xe5af('0x11')](0x1f4,_0x2fd4ba[_0xe5af('0x13')]));});});};exports[_0xe5af('0x20')]=function(_0x3f19bc){var _0x2b8149=this;return new Promise(function(_0x34c1de,_0x163871){return db['CmHopperBlack'][_0xe5af('0x21')](_0x3f19bc[_0xe5af('0x22')],{'raw':_0x3f19bc[_0xe5af('0x17')]?_0x3f19bc[_0xe5af('0x17')][_0xe5af('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f19bc[_0xe5af('0x17')]?_0x3f19bc[_0xe5af('0x17')][_0xe5af('0x19')]||null:null,'attributes':_0x3f19bc[_0xe5af('0x17')]?_0x3f19bc[_0xe5af('0x17')]['attributes']||null:null,'limit':_0x3f19bc[_0xe5af('0x17')]?_0x3f19bc[_0xe5af('0x17')]['limit']||null:null})[_0xe5af('0xb')](function(_0x1e49d2){logger[_0xe5af('0x1f')](_0xe5af('0x20'),_0x3f19bc);logger['debug'](_0xe5af('0x20'),_0x3f19bc,JSON['stringify'](_0x1e49d2));_0x34c1de(_0x1e49d2);})[_0xe5af('0x14')](function(_0x22ca38){logger['error']('UpdateCmHopperBlack',_0x22ca38[_0xe5af('0x13')],_0x3f19bc);_0x163871(_0x2b8149[_0xe5af('0x11')](0x1f4,_0x22ca38[_0xe5af('0x13')]));});});};exports[_0xe5af('0x23')]=function(_0x286308){var _0x51ec1a=this;return new Promise(function(_0x10676d,_0x293e85){return db[_0xe5af('0x24')][_0xe5af('0x25')]({'where':_0x286308[_0xe5af('0x17')]?_0x286308[_0xe5af('0x17')]['where']||null:null})[_0xe5af('0xb')](function(_0x8ba3e1){logger[_0xe5af('0x1f')]('DestroyCmHopperBlack',_0x286308);logger['debug'](_0xe5af('0x23'),_0x286308,JSON[_0xe5af('0x10')](_0x8ba3e1));_0x10676d(_0x8ba3e1);})['catch'](function(_0x1953ac){logger[_0xe5af('0x11')]('DestroyCmHopperBlack',_0x1953ac['message'],_0x286308);_0x293e85(_0x51ec1a[_0xe5af('0x11')](0x1f4,_0x1953ac['message']));});});};
\ No newline at end of file
+var _0x6c66=['then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','map','model','include','UpdateCmHopperBlack','update','body','where','DestroyCmHopperBlack','destroy','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xc4edac,_0x43e311){var _0x6cc19=function(_0x554214){while(--_0x554214){_0xc4edac['push'](_0xc4edac['shift']());}};_0x6cc19(++_0x43e311);}(_0x6c66,0x94));var _0x66c6=function(_0x3c856a,_0xe05453){_0x3c856a=_0x3c856a-0x0;var _0x53f4f4=_0x6c66[_0x3c856a];return _0x53f4f4;};'use strict';var _=require(_0x66c6('0x0'));var util=require(_0x66c6('0x1'));var moment=require('moment');var BPromise=require(_0x66c6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66c6('0x3'))['db'];var utils=require(_0x66c6('0x4'));var logger=require(_0x66c6('0x5'))(_0x66c6('0x6'));var config=require(_0x66c6('0x7'));var jayson=require(_0x66c6('0x8'));var client=jayson[_0x66c6('0x9')][_0x66c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16d2ee,_0x400a4c,_0x58f691){return new BPromise(function(_0x148af2,_0x10b810){return client[_0x66c6('0xb')](_0x16d2ee,_0x58f691)[_0x66c6('0xc')](function(_0x158cbd){logger[_0x66c6('0xd')](_0x66c6('0xe'),_0x400a4c,_0x66c6('0xf'));logger[_0x66c6('0x10')](_0x66c6('0x11'),_0x400a4c,_0x66c6('0xf'),JSON[_0x66c6('0x12')](_0x158cbd));if(_0x158cbd[_0x66c6('0x13')]){if(_0x158cbd[_0x66c6('0x13')][_0x66c6('0x14')]===0x1f4){logger[_0x66c6('0x13')](_0x66c6('0xe'),_0x400a4c,_0x158cbd[_0x66c6('0x13')]['message']);return _0x10b810(_0x158cbd[_0x66c6('0x13')][_0x66c6('0x15')]);}logger['error'](_0x66c6('0xe'),_0x400a4c,_0x158cbd['error'][_0x66c6('0x15')]);return _0x148af2(_0x158cbd[_0x66c6('0x13')][_0x66c6('0x15')]);}else{logger['info'](_0x66c6('0xe'),_0x400a4c,_0x66c6('0xf'));_0x148af2(_0x158cbd[_0x66c6('0x16')][_0x66c6('0x15')]);}})[_0x66c6('0x17')](function(_0x5e3552){logger['error'](_0x66c6('0xe'),_0x400a4c,_0x5e3552);_0x10b810(_0x5e3552);});});}exports[_0x66c6('0x18')]=function(_0x1fd945){var _0x2bcdbb=this;return new Promise(function(_0x47ec8b,_0x2b1097){return db[_0x66c6('0x19')][_0x66c6('0x1a')]({'raw':_0x1fd945[_0x66c6('0x1b')]?_0x1fd945[_0x66c6('0x1b')][_0x66c6('0x1c')]===undefined?!![]:![]:!![],'where':_0x1fd945[_0x66c6('0x1b')]?_0x1fd945[_0x66c6('0x1b')]['where']||null:null,'attributes':_0x1fd945[_0x66c6('0x1b')]?_0x1fd945['options'][_0x66c6('0x1d')]||null:null,'limit':_0x1fd945['options']?_0x1fd945[_0x66c6('0x1b')][_0x66c6('0x1e')]||null:null,'include':_0x1fd945[_0x66c6('0x1b')]?_0x1fd945[_0x66c6('0x1b')]['include']?_[_0x66c6('0x1f')](_0x1fd945[_0x66c6('0x1b')]['include'],function(_0x1730b2){return{'model':db[_0x1730b2[_0x66c6('0x20')]],'as':_0x1730b2['as'],'attributes':_0x1730b2[_0x66c6('0x1d')],'include':_0x1730b2[_0x66c6('0x21')]?_[_0x66c6('0x1f')](_0x1730b2[_0x66c6('0x21')],function(_0x5a8355){return{'model':db[_0x5a8355['model']],'as':_0x5a8355['as'],'attributes':_0x5a8355['attributes'],'include':_0x5a8355[_0x66c6('0x21')]?_['map'](_0x5a8355['include'],function(_0x468fd3){return{'model':db[_0x468fd3[_0x66c6('0x20')]],'as':_0x468fd3['as'],'attributes':_0x468fd3[_0x66c6('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b622f){logger[_0x66c6('0xd')](_0x66c6('0x18'),_0x1fd945);logger[_0x66c6('0x10')](_0x66c6('0x18'),_0x1fd945,JSON[_0x66c6('0x12')](_0x1b622f));_0x47ec8b(_0x1b622f);})['catch'](function(_0xd9c67f){logger[_0x66c6('0x13')]('GetCmHopperBlack',_0xd9c67f['message'],_0x1fd945);_0x2b1097(_0x2bcdbb[_0x66c6('0x13')](0x1f4,_0xd9c67f[_0x66c6('0x15')]));});});};exports[_0x66c6('0x22')]=function(_0x431c57){var _0x50e3c0=this;return new Promise(function(_0x5a0fa5,_0x37e4b7){return db[_0x66c6('0x19')][_0x66c6('0x23')](_0x431c57[_0x66c6('0x24')],{'raw':_0x431c57['options']?_0x431c57[_0x66c6('0x1b')][_0x66c6('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x431c57[_0x66c6('0x1b')]?_0x431c57[_0x66c6('0x1b')][_0x66c6('0x25')]||null:null,'attributes':_0x431c57[_0x66c6('0x1b')]?_0x431c57[_0x66c6('0x1b')]['attributes']||null:null,'limit':_0x431c57['options']?_0x431c57[_0x66c6('0x1b')][_0x66c6('0x1e')]||null:null})[_0x66c6('0xc')](function(_0xb39e76){logger['info']('UpdateCmHopperBlack',_0x431c57);logger['debug'](_0x66c6('0x22'),_0x431c57,JSON['stringify'](_0xb39e76));_0x5a0fa5(_0xb39e76);})[_0x66c6('0x17')](function(_0x5b823b){logger['error'](_0x66c6('0x22'),_0x5b823b[_0x66c6('0x15')],_0x431c57);_0x37e4b7(_0x50e3c0[_0x66c6('0x13')](0x1f4,_0x5b823b[_0x66c6('0x15')]));});});};exports[_0x66c6('0x26')]=function(_0x2c1565){var _0x6de4af=this;return new Promise(function(_0x336091,_0x11c5aa){return db[_0x66c6('0x19')][_0x66c6('0x27')]({'where':_0x2c1565['options']?_0x2c1565['options'][_0x66c6('0x25')]||null:null})[_0x66c6('0xc')](function(_0x29cff2){logger[_0x66c6('0xd')](_0x66c6('0x26'),_0x2c1565);logger['debug'](_0x66c6('0x26'),_0x2c1565,JSON['stringify'](_0x29cff2));_0x336091(_0x29cff2);})[_0x66c6('0x17')](function(_0x367b6b){logger[_0x66c6('0x13')]('DestroyCmHopperBlack',_0x367b6b[_0x66c6('0x15')],_0x2c1565);_0x11c5aa(_0x6de4af[_0x66c6('0x13')](0x1f4,_0x367b6b[_0x66c6('0x15')]));});});};
\ No newline at end of file
index d01ac5a..6f29ade 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa46e=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','isAuthenticated','describe','/:id','update','destroy','multer','util'];(function(_0x3524ec,_0x24fb73){var _0x273ddc=function(_0x2eb9cb){while(--_0x2eb9cb){_0x3524ec['push'](_0x3524ec['shift']());}};_0x273ddc(++_0x24fb73);}(_0xa46e,0x8a));var _0xea46=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0xa46e[_0x403c20];return _0x2b271a;};'use strict';var multer=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var path=require('path');var timeout=require(_0xea46('0x2'));var express=require(_0xea46('0x3'));var router=express[_0xea46('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xea46('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xea46('0x6'));var controller=require('./cmHopperBlack.controller');router[_0xea46('0x7')]('/',auth['isAuthenticated'](),controller[_0xea46('0x8')]);router[_0xea46('0x7')]('/describe',auth[_0xea46('0x9')](),controller[_0xea46('0xa')]);router[_0xea46('0x7')](_0xea46('0xb'),auth[_0xea46('0x9')](),controller['show']);router['put']('/:id',auth[_0xea46('0x9')](),controller[_0xea46('0xc')]);router['delete'](_0xea46('0xb'),auth[_0xea46('0x9')](),controller[_0xea46('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0x4975=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x4975,0x86));var _0x5497=function(_0x587373,_0x1fa51e){_0x587373=_0x587373-0x0;var _0x244a97=_0x4975[_0x587373];return _0x244a97;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xf'),auth[_0x5497('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 8137f46..a339663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c04=['BOOLEAN','moment','exports','STRING','INTEGER','DATE','getDataValue','endtime','setDataValue','diff','seconds','dispositionat'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x8c04,0x15d));var _0x48c0=function(_0x36c719,_0x44c8ab){_0x36c719=_0x36c719-0x0;var _0x532955=_0x8c04[_0x36c719];return _0x532955;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x48c0('0x0'));module[_0x48c0('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x48c0('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x48c0('0x2')]},'originatecalleridname':{'type':Sequelize[_0x48c0('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x48c0('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x48c0('0x4')]},'answertime':{'type':Sequelize[_0x48c0('0x4')]},'droptime':{'type':Sequelize[_0x48c0('0x4')]},'endtime':{'type':Sequelize[_0x48c0('0x4')]},'ringtime':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x48c0('0x2')]},'campaign':{'type':Sequelize[_0x48c0('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x48c0('0x2')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x48c0('0x2')]},'secondDisposition':{'type':Sequelize[_0x48c0('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x24c6e7){var _0x8dca75=this[_0x48c0('0x5')](_0x48c0('0x6'));if(_0x8dca75&&_0x24c6e7){this[_0x48c0('0x7')]('followuptime',moment(_0x24c6e7)[_0x48c0('0x8')](moment(_0x8dca75),_0x48c0('0x9')));}return this[_0x48c0('0x7')](_0x48c0('0xa'),_0x24c6e7);}},'amd':{'type':Sequelize[_0x48c0('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x48c0('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x48c0('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x48c0('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x48c0('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x48c0('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x48c0('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x48c0('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xba39=['DATE','getDataValue','endtime','setDataValue','followuptime','seconds','dispositionat','BOOLEAN','sequelize','INTEGER','STRING'];(function(_0x5ace65,_0xc17a40){var _0x1738fb=function(_0x48bf90){while(--_0x48bf90){_0x5ace65['push'](_0x5ace65['shift']());}};_0x1738fb(++_0xc17a40);}(_0xba39,0x97));var _0x9ba3=function(_0x2b7466,_0x39193f){_0x2b7466=_0x2b7466-0x0;var _0x38241a=_0xba39[_0x2b7466];return _0x38241a;};'use strict';var Sequelize=require(_0x9ba3('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x9ba3('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x9ba3('0x2')]},'scheduledat':{'type':Sequelize[_0x9ba3('0x3')]},'countbusyretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9ba3('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x9ba3('0x2')]},'originatecalleridname':{'type':Sequelize[_0x9ba3('0x2')]},'calleridnum':{'type':Sequelize[_0x9ba3('0x2')]},'calleridname':{'type':Sequelize[_0x9ba3('0x2')]},'starttime':{'type':Sequelize[_0x9ba3('0x3')]},'responsetime':{'type':Sequelize[_0x9ba3('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x9ba3('0x3')]},'ringtime':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x9ba3('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9ba3('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x9ba3('0x3')],'set':function(_0x2b7f43){var _0x1489d3=this[_0x9ba3('0x4')](_0x9ba3('0x5'));if(_0x1489d3&&_0x2b7f43){this[_0x9ba3('0x6')](_0x9ba3('0x7'),moment(_0x2b7f43)['diff'](moment(_0x1489d3),_0x9ba3('0x8')));}return this['setDataValue'](_0x9ba3('0x9'),_0x2b7f43);}},'amd':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9ba3('0x3')]},'callback':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9ba3('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9ba3('0x3')]},'deleted':{'type':Sequelize[_0x9ba3('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9ba3('0x3')]},'recallme':{'type':Sequelize[_0x9ba3('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9ba3('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 917a02c..4c6fed3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(VoiceQueueId)','from','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','Campaign','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId','cm_hopper_final','CampaignId\x20=\x20?','checkContactHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','CmHopperFinal','includeAll','include','findAll','catch','params','find','describe','body','uniqueid','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','COUNT','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x814b,0x1a2));var _0xb814=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0x814b[_0x4d0df6];return _0x4e2615;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');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('0xa'));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 licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}exports[_0xb814('0x2e')]=function(_0x52ed64,_0x9008b2){var _0x37d24d={},_0x530744={},_0x499f22={'count':0x0,'rows':[]};var _0x20577b=_[_0xb814('0x2f')](db['CmHopperFinal'][_0xb814('0x30')],function(_0x526610){return{'name':_0x526610[_0xb814('0x31')],'type':_0x526610['type']['key']};});_0x530744[_0xb814('0x32')]=_['map'](_0x20577b,_0xb814('0x2c'));_0x530744[_0xb814('0x33')]=_[_0xb814('0x34')](_0x52ed64['query']);_0x530744['filters']=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],_0x530744['query']);_0x37d24d[_0xb814('0x36')]=_[_0xb814('0x35')](_0x530744[_0xb814('0x32')],qs[_0xb814('0x37')](_0x52ed64[_0xb814('0x33')][_0xb814('0x37')]));_0x37d24d[_0xb814('0x36')]=_0x37d24d['attributes'][_0xb814('0x38')]?_0x37d24d[_0xb814('0x36')]:_0x530744[_0xb814('0x32')];if(!_0x52ed64[_0xb814('0x33')][_0xb814('0x39')]('nolimit')){_0x37d24d[_0xb814('0x21')]=qs['limit'](_0x52ed64[_0xb814('0x33')][_0xb814('0x21')]);_0x37d24d[_0xb814('0x1f')]=qs['offset'](_0x52ed64[_0xb814('0x33')][_0xb814('0x1f')]);}_0x37d24d['order']=qs[_0xb814('0x3a')](_0x52ed64[_0xb814('0x33')][_0xb814('0x3a')]);_0x37d24d[_0xb814('0x3b')]=qs[_0xb814('0x3c')](_[_0xb814('0x3d')](_0x52ed64['query'],_0x530744[_0xb814('0x3c')]),_0x20577b);if(_0x52ed64['query'][_0xb814('0x3e')]){_0x37d24d['where']=_[_0xb814('0x3f')](_0x37d24d['where'],{'$or':_[_0xb814('0x2f')](_0x20577b,function(_0x26675a){if(_0x26675a['type']!=='VIRTUAL'){var _0x5dd6bc={};_0x5dd6bc[_0x26675a['name']]={'$like':'%'+_0x52ed64[_0xb814('0x33')][_0xb814('0x3e')]+'%'};return _0x5dd6bc;}})});}_0x37d24d=_[_0xb814('0x3f')]({},_0x37d24d,_0x52ed64[_0xb814('0x40')]);var _0x51cdba={'where':_0x37d24d['where']};return db[_0xb814('0x41')]['count'](_0x51cdba)[_0xb814('0x28')](function(_0x1098eb){_0x499f22[_0xb814('0x22')]=_0x1098eb;if(_0x52ed64[_0xb814('0x33')][_0xb814('0x42')]){_0x37d24d[_0xb814('0x43')]=[{'all':!![]}];}return db[_0xb814('0x41')][_0xb814('0x44')](_0x37d24d);})[_0xb814('0x28')](function(_0x4b6ff8){_0x499f22['rows']=_0x4b6ff8;return _0x499f22;})['then'](respondWithFilteredResult(_0x9008b2,_0x37d24d))[_0xb814('0x45')](handleError(_0x9008b2,null));};exports['show']=function(_0x29416a,_0x580171){var _0x411723={'raw':!![],'where':{'id':_0x29416a[_0xb814('0x46')]['id']}},_0x44ff56={};_0x44ff56[_0xb814('0x32')]=_['keys'](db[_0xb814('0x41')][_0xb814('0x30')]);_0x44ff56[_0xb814('0x33')]=_[_0xb814('0x34')](_0x29416a[_0xb814('0x33')]);_0x44ff56[_0xb814('0x3c')]=_['intersection'](_0x44ff56[_0xb814('0x32')],_0x44ff56[_0xb814('0x33')]);_0x411723[_0xb814('0x36')]=_[_0xb814('0x35')](_0x44ff56[_0xb814('0x32')],qs[_0xb814('0x37')](_0x29416a[_0xb814('0x33')]['fields']));_0x411723['attributes']=_0x411723[_0xb814('0x36')][_0xb814('0x38')]?_0x411723[_0xb814('0x36')]:_0x44ff56[_0xb814('0x32')];if(_0x29416a[_0xb814('0x33')][_0xb814('0x42')]){_0x411723[_0xb814('0x43')]=[{'all':!![]}];}_0x411723=_[_0xb814('0x3f')]({},_0x411723,_0x29416a[_0xb814('0x40')]);return db[_0xb814('0x41')][_0xb814('0x47')](_0x411723)['then'](handleEntityNotFound(_0x580171,null))[_0xb814('0x28')](respondWithResult(_0x580171,null))[_0xb814('0x45')](handleError(_0x580171,null));};exports['describe']=function(_0x338e80,_0x55234d){return db[_0xb814('0x41')][_0xb814('0x48')]()[_0xb814('0x28')](respondWithResult(_0x55234d,null))[_0xb814('0x45')](handleError(_0x55234d,null));};exports[_0xb814('0x27')]=function(_0x4096d4,_0x2cc806){if(_0x4096d4[_0xb814('0x49')][_0xb814('0x4a')]){delete _0x4096d4[_0xb814('0x49')]['uniqueid'];}return db['CmHopperFinal'][_0xb814('0x47')]({'where':{'uniqueid':_0x4096d4[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x2cc806,null))[_0xb814('0x28')](saveUpdates(_0x4096d4[_0xb814('0x49')],null))[_0xb814('0x28')](respondWithResult(_0x2cc806,null))[_0xb814('0x45')](handleError(_0x2cc806,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x26fd0b,_0x388324,_0xf27a6e){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'VoiceQueueId':_0x26fd0b['params']['id']},'attributes':[[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),_0xb814('0x4d')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x4f')))),'noAnswerContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),'busyContacts'],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x51')))),'congestionContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x53')))),_0xb814('0x54')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x55')))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x2022,\x201,\x20null'))),_0xb814('0x57')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x388324,null))[_0xb814('0x28')](respondWithResult(_0x388324,null))[_0xb814('0x45')](handleError(_0x388324,null));};exports[_0xb814('0x5a')]=function(_0x2e5f99,_0x113350,_0x46014f){return db['CmHopperFinal'][_0xb814('0x44')]({'raw':![],'where':{'CampaignId':_0x2e5f99[_0xb814('0x46')]['id']},'attributes':[[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x4c')))),'noSuchContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')]('`state`\x20=\x203,\x201,\x20null'))),_0xb814('0x5b')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x50')))),_0xb814('0x5c')],[db[_0xb814('0x4b')]['fn']('COUNT',db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x51')))),_0xb814('0x5d')],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db['sequelize'][_0xb814('0x4e')](_0xb814('0x53')))),'dropContacts'],[db[_0xb814('0x4b')]['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xb814('0x56')],[db['sequelize']['fn'](_0xb814('0x52'),db[_0xb814('0x4b')]['fn']('IF',db[_0xb814('0x4b')][_0xb814('0x4e')](_0xb814('0x5e')))),_0xb814('0x57')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb814('0x4b')]['literal'](_0xb814('0x58')))),_0xb814('0x59')]]})[_0xb814('0x28')](handleEntityNotFound(_0x113350,null))['then'](respondWithResult(_0x113350,null))[_0xb814('0x45')](handleError(_0x113350,null));};exports[_0xb814('0x5f')]=function(_0xee204,_0x5aabbe,_0x30f717){return db[_0xb814('0x60')][_0xb814('0x47')]({'where':{'id':_0xee204[_0xb814('0x46')]['id']}})['then'](handleEntityNotFound(_0x5aabbe,null))['then'](function(_0x28eaf8){var _0x295488;if(_0x28eaf8){_0x295488=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))[_0xb814('0x64')]([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),_0xb814('0x69'),_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('ANY_VALUE(calleridnum)',_0xb814('0x65'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x66'))[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))[_0xb814('0x6d')](_0xb814('0x70'),_0xb814('0x69'))[_0xb814('0x6d')]('NOW()','createdAt')[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6b'))[_0xb814('0x71')]('cm_hopper_final')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())['where']('state\x20=\x20?',_0xee204[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')]('phone')[_0xb814('0x71')]('cm_hopper')[_0xb814('0x3b')]('VoiceQueueId\x20=\x20?',_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]()))['where'](_0xb814('0x74'),squel['select']()[_0xb814('0x6d')](_0xb814('0x75'))['from']('cm_hopper_final')[_0xb814('0x3b')](_0xb814('0x76'),_0xee204[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x77')))[_0xb814('0x78')](_0xb814('0x67')))[_0xb814('0x72')]();return db[_0xb814('0x4b')]['query'](_0x295488);}return[];})['then'](respondWithResult(_0x5aabbe,null))['catch'](handleError(_0x5aabbe,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x52b6da,_0x45a202,_0x75a33){return db[_0xb814('0x79')]['find']({'where':{'id':_0x52b6da[_0xb814('0x46')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x45a202,null))[_0xb814('0x28')](function(_0x26ce5b){var _0x161658;if(_0x26ce5b){_0x161658=squel[_0xb814('0x61')]()[_0xb814('0x62')](_0xb814('0x63'))['fromQuery']([_0xb814('0x65'),_0xb814('0x66'),_0xb814('0x67'),_0xb814('0x68'),'CampaignId',_0xb814('0x6a'),_0xb814('0x6b')],squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x7a'),'phone')['field'](_0xb814('0x6e'),'scheduledAt')[_0xb814('0x6d')](_0xb814('0x6f'),'ContactId')[_0xb814('0x6d')]('ANY_VALUE(ListId)',_0xb814('0x68'))['field'](_0xb814('0x7b'),_0xb814('0x7c'))[_0xb814('0x6d')](_0xb814('0x6e'),_0xb814('0x6a'))[_0xb814('0x6d')](_0xb814('0x6e'),'updatedAt')['from'](_0xb814('0x7d'))['where']('CampaignId\x20=\x20?',_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x20?',_0x52b6da[_0xb814('0x49')]['state'][_0xb814('0x72')]())[_0xb814('0x3b')](_0xb814('0x73'))[_0xb814('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x65'))['from'](_0xb814('0x63'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da['params']['id'][_0xb814('0x72')]()))[_0xb814('0x3b')](_0xb814('0x74'),squel[_0xb814('0x6c')]()[_0xb814('0x6d')](_0xb814('0x75'))[_0xb814('0x71')](_0xb814('0x7d'))[_0xb814('0x3b')](_0xb814('0x7e'),_0x52b6da[_0xb814('0x46')]['id'][_0xb814('0x72')]())[_0xb814('0x3b')]('state\x20=\x204'))['group'](_0xb814('0x67')))['toString']();return db[_0xb814('0x4b')][_0xb814('0x33')](_0x161658);}return[];})[_0xb814('0x28')](respondWithResult(_0x45a202,null))[_0xb814('0x45')](handleError(_0x45a202,null));};exports[_0xb814('0x7f')]=function(_0x2f1674,_0xf0610f,_0x5db5d0){return db['CmHopper'][_0xb814('0x80')]({'where':{'VoiceQueueId':_0x2f1674['body'][_0xb814('0x69')],'CampaignId':_0x2f1674[_0xb814('0x49')][_0xb814('0x7c')],'ContactId':_0x2f1674['body'][_0xb814('0x67')]}})[_0xb814('0x28')](handleEntityNotFound(_0xf0610f,null))[_0xb814('0x28')](function(_0x38c6da){if(_0x38c6da){return _0x38c6da;}return null;})[_0xb814('0x28')](respondWithResult(_0xf0610f,null))['catch'](handleError(_0xf0610f,null));};
\ No newline at end of file
+var _0x187d=['state\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','select','from','cm_hopper','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','insert','into','CampaignId','CampaignId\x20=\x20?','state','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','update','destroy','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','where','filter','merge','includeAll','include','findAll','then','rows','catch','show','params','fields','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','COUNT','sequelize','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId\x20=\x20?','toString'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x187d,0x93));var _0xd187=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x187d[_0x5783f4];return _0x28e380;};'use strict';var emlformat=require(_0xd187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd187('0x1'));var jsonpatch=require(_0xd187('0x2'));var rp=require(_0xd187('0x3'));var moment=require(_0xd187('0x4'));var BPromise=require(_0xd187('0x5'));var Mustache=require(_0xd187('0x6'));var util=require('util');var path=require(_0xd187('0x7'));var sox=require(_0xd187('0x8'));var csv=require('to-csv');var ejs=require(_0xd187('0x9'));var fs=require('fs');var fs_extra=require(_0xd187('0xa'));var _=require(_0xd187('0xb'));var squel=require(_0xd187('0xc'));var crypto=require(_0xd187('0xd'));var jsforce=require(_0xd187('0xe'));var deskjs=require(_0xd187('0xf'));var toCsv=require(_0xd187('0x10'));var querystring=require('querystring');var Papa=require(_0xd187('0x11'));var Redis=require(_0xd187('0x12'));var authService=require(_0xd187('0x13'));var qs=require(_0xd187('0x14'));var as=require(_0xd187('0x15'));var hardwareService=require(_0xd187('0x16'));var logger=require('../../config/logger')(_0xd187('0x17'));var utils=require(_0xd187('0x18'));var config=require(_0xd187('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xd187('0x1a'))['db'];function respondWithStatusCode(_0x4545cf,_0x32ba07){_0x32ba07=_0x32ba07||0xcc;return function(_0x59ee4a){if(_0x59ee4a){return _0x4545cf[_0xd187('0x1b')](_0x32ba07);}return _0x4545cf[_0xd187('0x1c')](_0x32ba07)[_0xd187('0x1d')]();};}function respondWithResult(_0x126d1a,_0x517b25){_0x517b25=_0x517b25||0xc8;return function(_0x39a927){if(_0x39a927){return _0x126d1a[_0xd187('0x1c')](_0x517b25)[_0xd187('0x1e')](_0x39a927);}};}function respondWithFilteredResult(_0x188cfe,_0x4c8f68){return function(_0x245d3e){if(_0x245d3e){var _0x52a208=typeof _0x4c8f68['offset']===_0xd187('0x1f')&&typeof _0x4c8f68['limit']==='undefined';var _0x207b36=_0x245d3e[_0xd187('0x20')];var _0x374fe0=_0x52a208?0x0:_0x4c8f68[_0xd187('0x21')];var _0x21df74=_0x52a208?_0x245d3e[_0xd187('0x20')]:_0x4c8f68[_0xd187('0x21')]+_0x4c8f68[_0xd187('0x22')];var _0x4f2f88;if(_0x21df74>=_0x207b36){_0x21df74=_0x207b36;_0x4f2f88=0xc8;}else{_0x4f2f88=0xce;}_0x188cfe[_0xd187('0x1c')](_0x4f2f88);return _0x188cfe[_0xd187('0x23')](_0xd187('0x24'),_0x374fe0+'-'+_0x21df74+'/'+_0x207b36)[_0xd187('0x1e')](_0x245d3e);}return null;};}function patchUpdates(_0x5204ee){return function(_0x2f7fb3){try{jsonpatch[_0xd187('0x25')](_0x2f7fb3,_0x5204ee,!![]);}catch(_0xc5bba5){return BPromise['reject'](_0xc5bba5);}return _0x2f7fb3['save']();};}function saveUpdates(_0x57cf1d,_0x435d94){return function(_0x33741d){if(_0x33741d){return _0x33741d[_0xd187('0x26')](_0x57cf1d)['then'](function(_0x2c07c8){return _0x2c07c8;});}return null;};}function removeEntity(_0x57186b,_0x145771){return function(_0x5a7a23){if(_0x5a7a23){return _0x5a7a23[_0xd187('0x27')]()['then'](function(){_0x57186b['status'](0xcc)[_0xd187('0x1d')]();});}};}function handleEntityNotFound(_0x4d992b,_0x12da33){return function(_0x598aa4){if(!_0x598aa4){_0x4d992b['sendStatus'](0x194);}return _0x598aa4;};}function handleError(_0x4eac6a,_0x848ddd){_0x848ddd=_0x848ddd||0x1f4;return function(_0xeff822){logger[_0xd187('0x28')](_0xeff822[_0xd187('0x29')]);if(_0xeff822['name']){delete _0xeff822[_0xd187('0x2a')];}_0x4eac6a[_0xd187('0x1c')](_0x848ddd)['send'](_0xeff822);};}exports[_0xd187('0x2b')]=function(_0x1c87ee,_0x34febe){var _0x4c50a5={},_0x15e2e8={},_0x56e292={'count':0x0,'rows':[]};var _0x263e31=_[_0xd187('0x2c')](db[_0xd187('0x2d')][_0xd187('0x2e')],function(_0x489f2e){return{'name':_0x489f2e[_0xd187('0x2f')],'type':_0x489f2e[_0xd187('0x30')]['key']};});_0x15e2e8['model']=_[_0xd187('0x2c')](_0x263e31,_0xd187('0x2a'));_0x15e2e8[_0xd187('0x31')]=_[_0xd187('0x32')](_0x1c87ee[_0xd187('0x31')]);_0x15e2e8[_0xd187('0x33')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],_0x15e2e8['query']);_0x4c50a5[_0xd187('0x36')]=_[_0xd187('0x34')](_0x15e2e8[_0xd187('0x35')],qs['fields'](_0x1c87ee[_0xd187('0x31')]['fields']));_0x4c50a5[_0xd187('0x36')]=_0x4c50a5[_0xd187('0x36')][_0xd187('0x37')]?_0x4c50a5['attributes']:_0x15e2e8['model'];if(!_0x1c87ee[_0xd187('0x31')][_0xd187('0x38')]('nolimit')){_0x4c50a5[_0xd187('0x22')]=qs[_0xd187('0x22')](_0x1c87ee[_0xd187('0x31')]['limit']);_0x4c50a5['offset']=qs[_0xd187('0x21')](_0x1c87ee[_0xd187('0x31')]['offset']);}_0x4c50a5['order']=qs['sort'](_0x1c87ee[_0xd187('0x31')]['sort']);_0x4c50a5[_0xd187('0x39')]=qs[_0xd187('0x33')](_['pick'](_0x1c87ee[_0xd187('0x31')],_0x15e2e8['filters']),_0x263e31);if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]){_0x4c50a5['where']=_[_0xd187('0x3b')](_0x4c50a5[_0xd187('0x39')],{'$or':_['map'](_0x263e31,function(_0x4399a5){if(_0x4399a5['type']!=='VIRTUAL'){var _0x26b06d={};_0x26b06d[_0x4399a5[_0xd187('0x2a')]]={'$like':'%'+_0x1c87ee[_0xd187('0x31')][_0xd187('0x3a')]+'%'};return _0x26b06d;}})});}_0x4c50a5=_[_0xd187('0x3b')]({},_0x4c50a5,_0x1c87ee['options']);var _0x8860c={'where':_0x4c50a5[_0xd187('0x39')]};return db[_0xd187('0x2d')]['count'](_0x8860c)['then'](function(_0x538c05){_0x56e292['count']=_0x538c05;if(_0x1c87ee[_0xd187('0x31')][_0xd187('0x3c')]){_0x4c50a5[_0xd187('0x3d')]=[{'all':!![]}];}return db[_0xd187('0x2d')][_0xd187('0x3e')](_0x4c50a5);})[_0xd187('0x3f')](function(_0x4699e1){_0x56e292[_0xd187('0x40')]=_0x4699e1;return _0x56e292;})['then'](respondWithFilteredResult(_0x34febe,_0x4c50a5))[_0xd187('0x41')](handleError(_0x34febe,null));};exports[_0xd187('0x42')]=function(_0x31d9d2,_0x51c7fc){var _0x21cbf6={'raw':!![],'where':{'id':_0x31d9d2[_0xd187('0x43')]['id']}},_0x48c100={};_0x48c100[_0xd187('0x35')]=_[_0xd187('0x32')](db[_0xd187('0x2d')][_0xd187('0x2e')]);_0x48c100['query']=_[_0xd187('0x32')](_0x31d9d2[_0xd187('0x31')]);_0x48c100[_0xd187('0x33')]=_[_0xd187('0x34')](_0x48c100['model'],_0x48c100[_0xd187('0x31')]);_0x21cbf6[_0xd187('0x36')]=_['intersection'](_0x48c100[_0xd187('0x35')],qs[_0xd187('0x44')](_0x31d9d2['query']['fields']));_0x21cbf6[_0xd187('0x36')]=_0x21cbf6[_0xd187('0x36')]['length']?_0x21cbf6['attributes']:_0x48c100['model'];if(_0x31d9d2[_0xd187('0x31')][_0xd187('0x3c')]){_0x21cbf6[_0xd187('0x3d')]=[{'all':!![]}];}_0x21cbf6=_[_0xd187('0x3b')]({},_0x21cbf6,_0x31d9d2[_0xd187('0x45')]);return db[_0xd187('0x2d')][_0xd187('0x46')](_0x21cbf6)['then'](handleEntityNotFound(_0x51c7fc,null))[_0xd187('0x3f')](respondWithResult(_0x51c7fc,null))[_0xd187('0x41')](handleError(_0x51c7fc,null));};exports[_0xd187('0x47')]=function(_0x3ce4a1,_0x3f5def){return db[_0xd187('0x2d')][_0xd187('0x47')]()[_0xd187('0x3f')](respondWithResult(_0x3f5def,null))['catch'](handleError(_0x3f5def,null));};exports[_0xd187('0x26')]=function(_0x2657be,_0x4523c8){if(_0x2657be[_0xd187('0x48')][_0xd187('0x49')]){delete _0x2657be['body'][_0xd187('0x49')];}return db[_0xd187('0x2d')]['find']({'where':{'uniqueid':_0x2657be[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x4523c8,null))['then'](saveUpdates(_0x2657be['body'],null))['then'](respondWithResult(_0x4523c8,null))['catch'](handleError(_0x4523c8,null));};exports[_0xd187('0x4a')]=function(_0x22f432,_0x12d448,_0x1bcc3a){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x22f432[_0xd187('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0xd187('0x4e')],[db['sequelize']['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x4f')))),_0xd187('0x50')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x52')))),'congestionContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd187('0x53')],[db['sequelize']['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn']('COUNT',db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0xd187('0x56')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x12d448,null))[_0xd187('0x3f')](respondWithResult(_0x12d448,null))[_0xd187('0x41')](handleError(_0x12d448,null));};exports[_0xd187('0x59')]=function(_0x23271b,_0x288a04,_0x39934c){return db[_0xd187('0x2d')][_0xd187('0x3e')]({'raw':![],'where':{'CampaignId':_0x23271b[_0xd187('0x43')]['id']},'attributes':[[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x5a')))),_0xd187('0x4e')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x51')))),'busyContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')]['literal'](_0xd187('0x52')))),_0xd187('0x5b')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize']['literal'](_0xd187('0x5c')))),_0xd187('0x53')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db[_0xd187('0x4c')][_0xd187('0x4d')](_0xd187('0x54')))),_0xd187('0x55')],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db[_0xd187('0x4c')]['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x5d')))),'reCallContacts'],[db[_0xd187('0x4c')]['fn'](_0xd187('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0xd187('0x4d')](_0xd187('0x57')))),_0xd187('0x58')]]})[_0xd187('0x3f')](handleEntityNotFound(_0x288a04,null))['then'](respondWithResult(_0x288a04,null))[_0xd187('0x41')](handleError(_0x288a04,null));};exports[_0xd187('0x5e')]=function(_0x52e364,_0x569959,_0x3bca83){return db['VoiceQueue'][_0xd187('0x46')]({'where':{'id':_0x52e364[_0xd187('0x43')]['id']}})['then'](handleEntityNotFound(_0x569959,null))[_0xd187('0x3f')](function(_0x570c1c){var _0x317bc3;if(_0x570c1c){_0x317bc3=squel['insert']()['into']('cm_hopper')[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x64'),_0xd187('0x65'),_0xd187('0x66')],squel['select']()[_0xd187('0x67')](_0xd187('0x68'),_0xd187('0x60'))['field'](_0xd187('0x69'),_0xd187('0x61'))[_0xd187('0x67')](_0xd187('0x6a'),'ContactId')[_0xd187('0x67')](_0xd187('0x6b'),'ListId')[_0xd187('0x67')](_0xd187('0x6c'),_0xd187('0x64'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')]('NOW()',_0xd187('0x66'))['from']('cm_hopper_final')['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x6f'),_0x52e364[_0xd187('0x48')]['state'][_0xd187('0x6e')]())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x60'))[_0xd187('0x72')](_0xd187('0x73'))['where'](_0xd187('0x6d'),_0x52e364[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x74'))[_0xd187('0x72')](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x6d'),_0x52e364['params']['id']['toString']())[_0xd187('0x39')](_0xd187('0x76')))[_0xd187('0x77')](_0xd187('0x62')))[_0xd187('0x6e')]();return db[_0xd187('0x4c')]['query'](_0x317bc3);}return[];})[_0xd187('0x3f')](respondWithResult(_0x569959,null))['catch'](handleError(_0x569959,null));};exports[_0xd187('0x78')]=function(_0x520f86,_0x5cbfa6,_0x304117){return db['Campaign'][_0xd187('0x46')]({'where':{'id':_0x520f86[_0xd187('0x43')]['id']}})[_0xd187('0x3f')](handleEntityNotFound(_0x5cbfa6,null))[_0xd187('0x3f')](function(_0x1b93db){var _0x13a362;if(_0x1b93db){_0x13a362=squel[_0xd187('0x79')]()[_0xd187('0x7a')](_0xd187('0x73'))[_0xd187('0x5f')]([_0xd187('0x60'),_0xd187('0x61'),_0xd187('0x62'),_0xd187('0x63'),_0xd187('0x7b'),'createdAt',_0xd187('0x66')],squel[_0xd187('0x71')]()[_0xd187('0x67')](_0xd187('0x68'),'phone')[_0xd187('0x67')](_0xd187('0x69'),'scheduledAt')['field'](_0xd187('0x6a'),_0xd187('0x62'))[_0xd187('0x67')](_0xd187('0x6b'),_0xd187('0x63'))[_0xd187('0x67')]('ANY_VALUE(CampaignId)',_0xd187('0x7b'))[_0xd187('0x67')]('NOW()',_0xd187('0x65'))[_0xd187('0x67')](_0xd187('0x69'),_0xd187('0x66'))['from']('cm_hopper_final')[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id']['toString']())[_0xd187('0x39')](_0xd187('0x6f'),_0x520f86[_0xd187('0x48')][_0xd187('0x7d')]['toString']())[_0xd187('0x39')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')['from'](_0xd187('0x73'))[_0xd187('0x39')]('CampaignId\x20=\x20?',_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]()))[_0xd187('0x39')](_0xd187('0x70'),squel[_0xd187('0x71')]()['field'](_0xd187('0x74'))['from'](_0xd187('0x75'))[_0xd187('0x39')](_0xd187('0x7c'),_0x520f86[_0xd187('0x43')]['id'][_0xd187('0x6e')]())[_0xd187('0x39')](_0xd187('0x76')))['group'](_0xd187('0x62')))[_0xd187('0x6e')]();return db['sequelize'][_0xd187('0x31')](_0x13a362);}return[];})[_0xd187('0x3f')](respondWithResult(_0x5cbfa6,null))['catch'](handleError(_0x5cbfa6,null));};exports[_0xd187('0x7e')]=function(_0x3bd1d8,_0x224312,_0x45b522){return db[_0xd187('0x7f')][_0xd187('0x80')]({'where':{'VoiceQueueId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x64')],'CampaignId':_0x3bd1d8['body'][_0xd187('0x7b')],'ContactId':_0x3bd1d8[_0xd187('0x48')][_0xd187('0x62')]}})[_0xd187('0x3f')](handleEntityNotFound(_0x224312,null))[_0xd187('0x3f')](function(_0x400a9){if(_0x400a9){return _0x400a9;}return null;})['then'](respondWithResult(_0x224312,null))['catch'](handleError(_0x224312,null));};
\ No newline at end of file
index 83819bf..cc52715 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ad7=['api','moment','bluebird','request-promise','../../config/environment','./cmHopperFinal.attributes','exports','define','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6ad7,0x131));var _0x76ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ad7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x76ad('0x0'));var util=require(_0x76ad('0x1'));var logger=require(_0x76ad('0x2'))(_0x76ad('0x3'));var moment=require(_0x76ad('0x4'));var BPromise=require(_0x76ad('0x5'));var rp=require(_0x76ad('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x76ad('0x7'));var attributes=require(_0x76ad('0x8'));module[_0x76ad('0x9')]=function(_0x37b420,_0x550af9){return _0x37b420[_0x76ad('0xa')]('CmHopperFinal',attributes,{'tableName':_0x76ad('0xb'),'paranoid':![],'indexes':[{'name':_0x76ad('0xc'),'fields':['calleridnum']},{'name':_0x76ad('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6884=['util','../../config/logger','api','moment','bluebird','request-promise','path','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash'];(function(_0xdae187,_0x4606c5){var _0x55f0ac=function(_0x56c812){while(--_0x56c812){_0xdae187['push'](_0xdae187['shift']());}};_0x55f0ac(++_0x4606c5);}(_0x6884,0x179));var _0x4688=function(_0x444d90,_0x11c679){_0x444d90=_0x444d90-0x0;var _0x3a8344=_0x6884[_0x444d90];return _0x3a8344;};'use strict';var _=require(_0x4688('0x0'));var util=require(_0x4688('0x1'));var logger=require(_0x4688('0x2'))(_0x4688('0x3'));var moment=require(_0x4688('0x4'));var BPromise=require(_0x4688('0x5'));var rp=require(_0x4688('0x6'));var fs=require('fs');var path=require(_0x4688('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4688('0x8'));module[_0x4688('0x9')]=function(_0x1aae00,_0x5be644){return _0x1aae00['define'](_0x4688('0xa'),attributes,{'tableName':_0x4688('0xb'),'paranoid':![],'indexes':[{'name':_0x4688('0xc'),'fields':['calleridnum']},{'name':_0x4688('0xd'),'fields':[_0x4688('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 4762b37..6267b9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2ab354,_0x156133){var _0x5ae9fb=function(_0x503431){while(--_0x503431){_0x2ab354['push'](_0x2ab354['shift']());}};_0x5ae9fb(++_0x156133);}(_0x7a54,0x106));var _0x47a5=function(_0x337a0c,_0xcdad4){_0x337a0c=_0x337a0c-0x0;var _0x229003=_0x7a54[_0x337a0c];return _0x229003;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
+var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x439367,_0x437ee1){var _0x442e7e=function(_0x217066){while(--_0x217066){_0x439367['push'](_0x439367['shift']());}};_0x442e7e(++_0x437ee1);}(_0x7a54,0x106));var _0x47a5=function(_0x4a3e52,_0x29da47){_0x4a3e52=_0x4a3e52-0x0;var _0x18337=_0x7a54[_0x4a3e52];return _0x18337;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
index b94386d..7322074 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa988=['post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','checkContactHopper','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xa988,0x1a7));var _0x8a98=function(_0x33c05e,_0x281f59){_0x33c05e=_0x33c05e-0x0;var _0xa4e036=_0xa988[_0x33c05e];return _0xa4e036;};'use strict';var multer=require(_0x8a98('0x0'));var util=require(_0x8a98('0x1'));var path=require(_0x8a98('0x2'));var timeout=require(_0x8a98('0x3'));var express=require(_0x8a98('0x4'));var router=express['Router']();var fs_extra=require(_0x8a98('0x5'));var auth=require(_0x8a98('0x6'));var interaction=require(_0x8a98('0x7'));var config=require(_0x8a98('0x8'));var controller=require(_0x8a98('0x9'));router[_0x8a98('0xa')]('/',auth[_0x8a98('0xb')](),controller[_0x8a98('0xc')]);router['get'](_0x8a98('0xd'),auth[_0x8a98('0xb')](),controller['describe']);router[_0x8a98('0xa')](_0x8a98('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x8a98('0xa')](_0x8a98('0xf'),auth['isAuthenticated'](),controller[_0x8a98('0x10')]);router[_0x8a98('0xa')](_0x8a98('0x11'),auth['isAuthenticated'](),controller[_0x8a98('0x12')]);router[_0x8a98('0x13')](_0x8a98('0x14'),auth['isAuthenticated'](),controller[_0x8a98('0x15')]);router['post']('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0x8a98('0x16')]);router['post']('/checkContactHopper',auth['isAuthenticated'](),controller[_0x8a98('0x17')]);router['put'](_0x8a98('0xe'),auth[_0x8a98('0xb')](),controller[_0x8a98('0x18')]);module[_0x8a98('0x19')]=router;
\ No newline at end of file
+var _0x8948=['countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','update','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','isAuthenticated','index','get','describe','/:id','show','/voice/queue/countAttributes/:id'];(function(_0x52cb32,_0x16f826){var _0x30a471=function(_0x1a0e86){while(--_0x1a0e86){_0x52cb32['push'](_0x52cb32['shift']());}};_0x30a471(++_0x16f826);}(_0x8948,0xa6));var _0x8894=function(_0x3bad75,_0xee992a){_0x3bad75=_0x3bad75-0x0;var _0x15e2ee=_0x8948[_0x3bad75];return _0x15e2ee;};'use strict';var multer=require('multer');var util=require(_0x8894('0x0'));var path=require(_0x8894('0x1'));var timeout=require(_0x8894('0x2'));var express=require(_0x8894('0x3'));var router=express[_0x8894('0x4')]();var fs_extra=require(_0x8894('0x5'));var auth=require(_0x8894('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8894('0x7'));var controller=require(_0x8894('0x8'));router['get']('/',auth[_0x8894('0x9')](),controller[_0x8894('0xa')]);router[_0x8894('0xb')]('/describe',auth[_0x8894('0x9')](),controller[_0x8894('0xc')]);router['get'](_0x8894('0xd'),auth['isAuthenticated'](),controller[_0x8894('0xe')]);router[_0x8894('0xb')](_0x8894('0xf'),auth[_0x8894('0x9')](),controller[_0x8894('0x10')]);router[_0x8894('0xb')](_0x8894('0x11'),auth['isAuthenticated'](),controller[_0x8894('0x12')]);router[_0x8894('0x13')](_0x8894('0x14'),auth[_0x8894('0x9')](),controller[_0x8894('0x15')]);router[_0x8894('0x13')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0x8894('0x16')]);router['post'](_0x8894('0x17'),auth[_0x8894('0x9')](),controller[_0x8894('0x18')]);router['put'](_0x8894('0xd'),auth[_0x8894('0x9')](),controller[_0x8894('0x19')]);module['exports']=router;
\ No newline at end of file
index 2d3699e..57267a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe654=['sequelize','exports','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x188703,_0x596b26){var _0x1a0c81=function(_0x1cd22d){while(--_0x1cd22d){_0x188703['push'](_0x188703['shift']());}};_0x1a0c81(++_0x596b26);}(_0xe654,0xde));var _0x4e65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe654[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4e65('0x0'));module[_0x4e65('0x1')]={'state':{'type':Sequelize[_0x4e65('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4e65('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x4e65('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x4e65('0x3')]},'calleridnum':{'type':Sequelize[_0x4e65('0x3')]},'calleridname':{'type':Sequelize[_0x4e65('0x3')]},'starttime':{'type':Sequelize[_0x4e65('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x4e65('0x4')]},'endtime':{'type':Sequelize[_0x4e65('0x4')]},'ringtime':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x4e65('0x3')]},'campaign':{'type':Sequelize[_0x4e65('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x4e65('0x3')]},'reason':{'type':Sequelize[_0x4e65('0x3')]},'amd':{'type':Sequelize[_0x4e65('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x4e65('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x4e65('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4e65('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4e65('0x4')]},'recallme':{'type':Sequelize[_0x4e65('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x4e65('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4e65('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x800c=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0xdd9039,_0x5be390){var _0xeb229b=function(_0x5eb22a){while(--_0x5eb22a){_0xdd9039['push'](_0xdd9039['shift']());}};_0xeb229b(++_0x5be390);}(_0x800c,0x1a1));var _0xc800=function(_0x164dd3,_0x90805c){_0x164dd3=_0x164dd3-0x0;var _0x5bb448=_0x800c[_0x164dd3];return _0x5bb448;};'use strict';var Sequelize=require(_0xc800('0x0'));module[_0xc800('0x1')]={'state':{'type':Sequelize[_0xc800('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xc800('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc800('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xc800('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc800('0x3')]},'starttime':{'type':Sequelize[_0xc800('0x4')]},'responsetime':{'type':Sequelize[_0xc800('0x4')]},'answertime':{'type':Sequelize[_0xc800('0x4')]},'droptime':{'type':Sequelize[_0xc800('0x4')]},'endtime':{'type':Sequelize[_0xc800('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xc800('0x3')]},'campaigntype':{'type':Sequelize[_0xc800('0x3')]},'membername':{'type':Sequelize[_0xc800('0x3')]},'reason':{'type':Sequelize[_0xc800('0x3')]},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xc800('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xc800('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc800('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc800('0x4')]},'recallme':{'type':Sequelize[_0xc800('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xc800('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc800('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 93ae9d8..c025aa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dc4=['where','pick','filter','merge','options','includeAll','catch','show','params','length','include','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','index','map','CmHopperHistory','rawAttributes','type','key','query','keys','filters','attributes','intersection','fields','model','order','sort'];(function(_0x33358a,_0x410ec6){var _0x4e9192=function(_0x10c78d){while(--_0x10c78d){_0x33358a['push'](_0x33358a['shift']());}};_0x4e9192(++_0x410ec6);}(_0x5dc4,0x187));var _0x45dc=function(_0x1438b1,_0x4a4ce6){_0x1438b1=_0x1438b1-0x0;var _0xb706b5=_0x5dc4[_0x1438b1];return _0xb706b5;};'use strict';var emlformat=require(_0x45dc('0x0'));var rimraf=require(_0x45dc('0x1'));var zipdir=require(_0x45dc('0x2'));var jsonpatch=require(_0x45dc('0x3'));var rp=require(_0x45dc('0x4'));var moment=require(_0x45dc('0x5'));var BPromise=require(_0x45dc('0x6'));var Mustache=require(_0x45dc('0x7'));var util=require(_0x45dc('0x8'));var path=require('path');var sox=require(_0x45dc('0x9'));var csv=require('to-csv');var ejs=require(_0x45dc('0xa'));var fs=require('fs');var fs_extra=require(_0x45dc('0xb'));var _=require(_0x45dc('0xc'));var squel=require(_0x45dc('0xd'));var crypto=require('crypto');var jsforce=require(_0x45dc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x45dc('0xf'));var querystring=require(_0x45dc('0x10'));var Papa=require('papaparse');var Redis=require(_0x45dc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x45dc('0x12'));var as=require(_0x45dc('0x13'));var hardwareService=require(_0x45dc('0x14'));var logger=require(_0x45dc('0x15'))(_0x45dc('0x16'));var utils=require(_0x45dc('0x17'));var config=require(_0x45dc('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x45dc('0x19'))['db'];function respondWithStatusCode(_0x4a8d6d,_0x55600c){_0x55600c=_0x55600c||0xcc;return function(_0xef9185){if(_0xef9185){return _0x4a8d6d[_0x45dc('0x1a')](_0x55600c);}return _0x4a8d6d[_0x45dc('0x1b')](_0x55600c)[_0x45dc('0x1c')]();};}function respondWithResult(_0x56282d,_0x59c8c5){_0x59c8c5=_0x59c8c5||0xc8;return function(_0x442215){if(_0x442215){return _0x56282d[_0x45dc('0x1b')](_0x59c8c5)[_0x45dc('0x1d')](_0x442215);}};}function respondWithFilteredResult(_0x3f9b7c,_0x2aa97d){return function(_0x1cfc8b){if(_0x1cfc8b){var _0x384007=typeof _0x2aa97d[_0x45dc('0x1e')]===_0x45dc('0x1f')&&typeof _0x2aa97d[_0x45dc('0x20')]===_0x45dc('0x1f');var _0x30c2ca=_0x1cfc8b[_0x45dc('0x21')];var _0x4d4d19=_0x384007?0x0:_0x2aa97d[_0x45dc('0x1e')];var _0x4cd059=_0x384007?_0x1cfc8b[_0x45dc('0x21')]:_0x2aa97d[_0x45dc('0x1e')]+_0x2aa97d[_0x45dc('0x20')];var _0x166620;if(_0x4cd059>=_0x30c2ca){_0x4cd059=_0x30c2ca;_0x166620=0xc8;}else{_0x166620=0xce;}_0x3f9b7c[_0x45dc('0x1b')](_0x166620);return _0x3f9b7c[_0x45dc('0x22')](_0x45dc('0x23'),_0x4d4d19+'-'+_0x4cd059+'/'+_0x30c2ca)[_0x45dc('0x1d')](_0x1cfc8b);}return null;};}function patchUpdates(_0x438359){return function(_0x22db29){try{jsonpatch[_0x45dc('0x24')](_0x22db29,_0x438359,!![]);}catch(_0x291361){return BPromise[_0x45dc('0x25')](_0x291361);}return _0x22db29[_0x45dc('0x26')]();};}function saveUpdates(_0x3ac9c7,_0x5d7a45){return function(_0x3a679d){if(_0x3a679d){return _0x3a679d[_0x45dc('0x27')](_0x3ac9c7)['then'](function(_0x95d251){return _0x95d251;});}return null;};}function removeEntity(_0x538c6b,_0x1206da){return function(_0x1ba2d5){if(_0x1ba2d5){return _0x1ba2d5[_0x45dc('0x28')]()[_0x45dc('0x29')](function(){_0x538c6b['status'](0xcc)[_0x45dc('0x1c')]();});}};}function handleEntityNotFound(_0x42772f,_0x4e71ea){return function(_0x495a1f){if(!_0x495a1f){_0x42772f[_0x45dc('0x1a')](0x194);}return _0x495a1f;};}function handleError(_0x16e9fb,_0x5d279a){_0x5d279a=_0x5d279a||0x1f4;return function(_0x337b79){logger['error'](_0x337b79[_0x45dc('0x2a')]);if(_0x337b79[_0x45dc('0x2b')]){delete _0x337b79['name'];}_0x16e9fb['status'](_0x5d279a)['send'](_0x337b79);};}exports[_0x45dc('0x2c')]=function(_0x7173b5,_0x11d8e3){var _0x55e1c0={},_0x2b9ed7={},_0x3d4114={'count':0x0,'rows':[]};var _0x399ef4=_[_0x45dc('0x2d')](db[_0x45dc('0x2e')][_0x45dc('0x2f')],function(_0x3657dc){return{'name':_0x3657dc['fieldName'],'type':_0x3657dc[_0x45dc('0x30')][_0x45dc('0x31')]};});_0x2b9ed7['model']=_[_0x45dc('0x2d')](_0x399ef4,_0x45dc('0x2b'));_0x2b9ed7[_0x45dc('0x32')]=_[_0x45dc('0x33')](_0x7173b5[_0x45dc('0x32')]);_0x2b9ed7[_0x45dc('0x34')]=_['intersection'](_0x2b9ed7['model'],_0x2b9ed7[_0x45dc('0x32')]);_0x55e1c0[_0x45dc('0x35')]=_[_0x45dc('0x36')](_0x2b9ed7['model'],qs[_0x45dc('0x37')](_0x7173b5['query'][_0x45dc('0x37')]));_0x55e1c0[_0x45dc('0x35')]=_0x55e1c0[_0x45dc('0x35')]['length']?_0x55e1c0[_0x45dc('0x35')]:_0x2b9ed7[_0x45dc('0x38')];if(!_0x7173b5[_0x45dc('0x32')]['hasOwnProperty']('nolimit')){_0x55e1c0[_0x45dc('0x20')]=qs[_0x45dc('0x20')](_0x7173b5[_0x45dc('0x32')]['limit']);_0x55e1c0['offset']=qs[_0x45dc('0x1e')](_0x7173b5['query']['offset']);}_0x55e1c0[_0x45dc('0x39')]=qs[_0x45dc('0x3a')](_0x7173b5[_0x45dc('0x32')][_0x45dc('0x3a')]);_0x55e1c0[_0x45dc('0x3b')]=qs[_0x45dc('0x34')](_[_0x45dc('0x3c')](_0x7173b5[_0x45dc('0x32')],_0x2b9ed7[_0x45dc('0x34')]),_0x399ef4);if(_0x7173b5[_0x45dc('0x32')][_0x45dc('0x3d')]){_0x55e1c0[_0x45dc('0x3b')]=_[_0x45dc('0x3e')](_0x55e1c0[_0x45dc('0x3b')],{'$or':_[_0x45dc('0x2d')](_0x399ef4,function(_0x865b4e){if(_0x865b4e['type']!=='VIRTUAL'){var _0xd794ea={};_0xd794ea[_0x865b4e[_0x45dc('0x2b')]]={'$like':'%'+_0x7173b5[_0x45dc('0x32')][_0x45dc('0x3d')]+'%'};return _0xd794ea;}})});}_0x55e1c0=_['merge']({},_0x55e1c0,_0x7173b5[_0x45dc('0x3f')]);var _0x3317a0={'where':_0x55e1c0[_0x45dc('0x3b')]};return db[_0x45dc('0x2e')]['count'](_0x3317a0)[_0x45dc('0x29')](function(_0x24fe25){_0x3d4114[_0x45dc('0x21')]=_0x24fe25;if(_0x7173b5['query'][_0x45dc('0x40')]){_0x55e1c0['include']=[{'all':!![]}];}return db[_0x45dc('0x2e')]['findAll'](_0x55e1c0);})['then'](function(_0x5b0d5c){_0x3d4114['rows']=_0x5b0d5c;return _0x3d4114;})[_0x45dc('0x29')](respondWithFilteredResult(_0x11d8e3,_0x55e1c0))[_0x45dc('0x41')](handleError(_0x11d8e3,null));};exports[_0x45dc('0x42')]=function(_0x31ddb5,_0x11f2a7){var _0x411d0f={'raw':!![],'where':{'id':_0x31ddb5[_0x45dc('0x43')]['id']}},_0x49e5aa={};_0x49e5aa['model']=_[_0x45dc('0x33')](db[_0x45dc('0x2e')][_0x45dc('0x2f')]);_0x49e5aa[_0x45dc('0x32')]=_[_0x45dc('0x33')](_0x31ddb5[_0x45dc('0x32')]);_0x49e5aa['filters']=_['intersection'](_0x49e5aa[_0x45dc('0x38')],_0x49e5aa['query']);_0x411d0f[_0x45dc('0x35')]=_[_0x45dc('0x36')](_0x49e5aa[_0x45dc('0x38')],qs['fields'](_0x31ddb5[_0x45dc('0x32')][_0x45dc('0x37')]));_0x411d0f[_0x45dc('0x35')]=_0x411d0f['attributes'][_0x45dc('0x44')]?_0x411d0f[_0x45dc('0x35')]:_0x49e5aa[_0x45dc('0x38')];if(_0x31ddb5[_0x45dc('0x32')]['includeAll']){_0x411d0f[_0x45dc('0x45')]=[{'all':!![]}];}_0x411d0f=_[_0x45dc('0x3e')]({},_0x411d0f,_0x31ddb5[_0x45dc('0x3f')]);return db[_0x45dc('0x2e')][_0x45dc('0x46')](_0x411d0f)[_0x45dc('0x29')](handleEntityNotFound(_0x11f2a7,null))[_0x45dc('0x29')](respondWithResult(_0x11f2a7,null))[_0x45dc('0x41')](handleError(_0x11f2a7,null));};exports[_0x45dc('0x47')]=function(_0x538680,_0xb8fdc1){return db['CmHopperHistory'][_0x45dc('0x47')](_0x538680[_0x45dc('0x48')],{})[_0x45dc('0x29')](respondWithResult(_0xb8fdc1,0xc9))[_0x45dc('0x41')](handleError(_0xb8fdc1,null));};exports[_0x45dc('0x49')]=function(_0x15b6f2,_0x225dc1){return db[_0x45dc('0x2e')]['describe']()[_0x45dc('0x29')](respondWithResult(_0x225dc1,null))[_0x45dc('0x41')](handleError(_0x225dc1,null));};exports['update']=function(_0x5c4c24,_0x5563db){if(_0x5c4c24[_0x45dc('0x48')]['uniqueid']){delete _0x5c4c24['body'][_0x45dc('0x4a')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x5c4c24[_0x45dc('0x43')]['id']}})[_0x45dc('0x29')](handleEntityNotFound(_0x5563db,null))[_0x45dc('0x29')](saveUpdates(_0x5c4c24['body'],null))[_0x45dc('0x29')](respondWithResult(_0x5563db,null))['catch'](handleError(_0x5563db,null));};
\ No newline at end of file
+var _0xdd03=['send','index','CmHopperHistory','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','findAll','show','length','includeAll','include','merge','find','catch','create','describe','body','uniqueid','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd03,0x103));var _0x3dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd03[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3dd0('0x0'));var rimraf=require(_0x3dd0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3dd0('0x2'));var moment=require('moment');var BPromise=require(_0x3dd0('0x3'));var Mustache=require(_0x3dd0('0x4'));var util=require(_0x3dd0('0x5'));var path=require(_0x3dd0('0x6'));var sox=require(_0x3dd0('0x7'));var csv=require('to-csv');var ejs=require(_0x3dd0('0x8'));var fs=require('fs');var fs_extra=require(_0x3dd0('0x9'));var _=require(_0x3dd0('0xa'));var squel=require(_0x3dd0('0xb'));var crypto=require('crypto');var jsforce=require(_0x3dd0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3dd0('0xd'));var querystring=require(_0x3dd0('0xe'));var Papa=require(_0x3dd0('0xf'));var Redis=require(_0x3dd0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3dd0('0x11'));var as=require(_0x3dd0('0x12'));var hardwareService=require(_0x3dd0('0x13'));var logger=require('../../config/logger')(_0x3dd0('0x14'));var utils=require('../../config/utils');var config=require(_0x3dd0('0x15'));var licenseUtil=require(_0x3dd0('0x16'));var db=require(_0x3dd0('0x17'))['db'];function respondWithStatusCode(_0x28b909,_0x11cc26){_0x11cc26=_0x11cc26||0xcc;return function(_0x2c4af7){if(_0x2c4af7){return _0x28b909['sendStatus'](_0x11cc26);}return _0x28b909[_0x3dd0('0x18')](_0x11cc26)['end']();};}function respondWithResult(_0x5dbce5,_0x16bf10){_0x16bf10=_0x16bf10||0xc8;return function(_0x2b513f){if(_0x2b513f){return _0x5dbce5[_0x3dd0('0x18')](_0x16bf10)[_0x3dd0('0x19')](_0x2b513f);}};}function respondWithFilteredResult(_0x3b3d8d,_0xce4761){return function(_0x448920){if(_0x448920){var _0x5ed48c=typeof _0xce4761[_0x3dd0('0x1a')]===_0x3dd0('0x1b')&&typeof _0xce4761['limit']==='undefined';var _0x393529=_0x448920['count'];var _0x5410dd=_0x5ed48c?0x0:_0xce4761[_0x3dd0('0x1a')];var _0x42f1b8=_0x5ed48c?_0x448920[_0x3dd0('0x1c')]:_0xce4761['offset']+_0xce4761[_0x3dd0('0x1d')];var _0x3c9d94;if(_0x42f1b8>=_0x393529){_0x42f1b8=_0x393529;_0x3c9d94=0xc8;}else{_0x3c9d94=0xce;}_0x3b3d8d['status'](_0x3c9d94);return _0x3b3d8d[_0x3dd0('0x1e')](_0x3dd0('0x1f'),_0x5410dd+'-'+_0x42f1b8+'/'+_0x393529)[_0x3dd0('0x19')](_0x448920);}return null;};}function patchUpdates(_0x39808c){return function(_0x578120){try{jsonpatch[_0x3dd0('0x20')](_0x578120,_0x39808c,!![]);}catch(_0xc535b0){return BPromise[_0x3dd0('0x21')](_0xc535b0);}return _0x578120[_0x3dd0('0x22')]();};}function saveUpdates(_0x2992bf,_0x27be4a){return function(_0x959a83){if(_0x959a83){return _0x959a83[_0x3dd0('0x23')](_0x2992bf)['then'](function(_0xd09d3){return _0xd09d3;});}return null;};}function removeEntity(_0x420039,_0x49ad59){return function(_0x10f25b){if(_0x10f25b){return _0x10f25b[_0x3dd0('0x24')]()[_0x3dd0('0x25')](function(){_0x420039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x20ed26,_0x19c0f9){return function(_0x2ff583){if(!_0x2ff583){_0x20ed26[_0x3dd0('0x26')](0x194);}return _0x2ff583;};}function handleError(_0x2c57ca,_0x1b4995){_0x1b4995=_0x1b4995||0x1f4;return function(_0x188faa){logger[_0x3dd0('0x27')](_0x188faa['stack']);if(_0x188faa[_0x3dd0('0x28')]){delete _0x188faa['name'];}_0x2c57ca[_0x3dd0('0x18')](_0x1b4995)[_0x3dd0('0x29')](_0x188faa);};}exports[_0x3dd0('0x2a')]=function(_0x5d6ca7,_0x221e70){var _0x2d9277={},_0x2d99e2={},_0x52733e={'count':0x0,'rows':[]};var _0x1869e3=_['map'](db[_0x3dd0('0x2b')][_0x3dd0('0x2c')],function(_0x1d5d2a){return{'name':_0x1d5d2a[_0x3dd0('0x2d')],'type':_0x1d5d2a[_0x3dd0('0x2e')]['key']};});_0x2d99e2[_0x3dd0('0x2f')]=_[_0x3dd0('0x30')](_0x1869e3,'name');_0x2d99e2[_0x3dd0('0x31')]=_[_0x3dd0('0x32')](_0x5d6ca7[_0x3dd0('0x31')]);_0x2d99e2[_0x3dd0('0x33')]=_[_0x3dd0('0x34')](_0x2d99e2[_0x3dd0('0x2f')],_0x2d99e2[_0x3dd0('0x31')]);_0x2d9277[_0x3dd0('0x35')]=_[_0x3dd0('0x34')](_0x2d99e2[_0x3dd0('0x2f')],qs[_0x3dd0('0x36')](_0x5d6ca7['query'][_0x3dd0('0x36')]));_0x2d9277[_0x3dd0('0x35')]=_0x2d9277['attributes']['length']?_0x2d9277[_0x3dd0('0x35')]:_0x2d99e2[_0x3dd0('0x2f')];if(!_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x37')]('nolimit')){_0x2d9277[_0x3dd0('0x1d')]=qs[_0x3dd0('0x1d')](_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x1d')]);_0x2d9277[_0x3dd0('0x1a')]=qs['offset'](_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x1a')]);}_0x2d9277[_0x3dd0('0x38')]=qs[_0x3dd0('0x39')](_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x39')]);_0x2d9277['where']=qs[_0x3dd0('0x33')](_[_0x3dd0('0x3a')](_0x5d6ca7[_0x3dd0('0x31')],_0x2d99e2[_0x3dd0('0x33')]),_0x1869e3);if(_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x3b')]){_0x2d9277[_0x3dd0('0x3c')]=_['merge'](_0x2d9277['where'],{'$or':_[_0x3dd0('0x30')](_0x1869e3,function(_0x41573e){if(_0x41573e['type']!==_0x3dd0('0x3d')){var _0x56b48d={};_0x56b48d[_0x41573e[_0x3dd0('0x28')]]={'$like':'%'+_0x5d6ca7[_0x3dd0('0x31')][_0x3dd0('0x3b')]+'%'};return _0x56b48d;}})});}_0x2d9277=_['merge']({},_0x2d9277,_0x5d6ca7[_0x3dd0('0x3e')]);var _0x97193d={'where':_0x2d9277[_0x3dd0('0x3c')]};return db['CmHopperHistory'][_0x3dd0('0x1c')](_0x97193d)[_0x3dd0('0x25')](function(_0x26818e){_0x52733e[_0x3dd0('0x1c')]=_0x26818e;if(_0x5d6ca7[_0x3dd0('0x31')]['includeAll']){_0x2d9277['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x3dd0('0x3f')](_0x2d9277);})[_0x3dd0('0x25')](function(_0x471d1c){_0x52733e['rows']=_0x471d1c;return _0x52733e;})[_0x3dd0('0x25')](respondWithFilteredResult(_0x221e70,_0x2d9277))['catch'](handleError(_0x221e70,null));};exports[_0x3dd0('0x40')]=function(_0x30a75e,_0x2d454f){var _0x422c21={'raw':!![],'where':{'id':_0x30a75e['params']['id']}},_0x11ae12={};_0x11ae12[_0x3dd0('0x2f')]=_['keys'](db[_0x3dd0('0x2b')][_0x3dd0('0x2c')]);_0x11ae12[_0x3dd0('0x31')]=_['keys'](_0x30a75e[_0x3dd0('0x31')]);_0x11ae12[_0x3dd0('0x33')]=_[_0x3dd0('0x34')](_0x11ae12[_0x3dd0('0x2f')],_0x11ae12[_0x3dd0('0x31')]);_0x422c21[_0x3dd0('0x35')]=_[_0x3dd0('0x34')](_0x11ae12[_0x3dd0('0x2f')],qs[_0x3dd0('0x36')](_0x30a75e[_0x3dd0('0x31')][_0x3dd0('0x36')]));_0x422c21['attributes']=_0x422c21['attributes'][_0x3dd0('0x41')]?_0x422c21[_0x3dd0('0x35')]:_0x11ae12[_0x3dd0('0x2f')];if(_0x30a75e['query'][_0x3dd0('0x42')]){_0x422c21[_0x3dd0('0x43')]=[{'all':!![]}];}_0x422c21=_[_0x3dd0('0x44')]({},_0x422c21,_0x30a75e[_0x3dd0('0x3e')]);return db['CmHopperHistory'][_0x3dd0('0x45')](_0x422c21)[_0x3dd0('0x25')](handleEntityNotFound(_0x2d454f,null))[_0x3dd0('0x25')](respondWithResult(_0x2d454f,null))[_0x3dd0('0x46')](handleError(_0x2d454f,null));};exports[_0x3dd0('0x47')]=function(_0x344e7f,_0x346e1){return db[_0x3dd0('0x2b')][_0x3dd0('0x47')](_0x344e7f['body'],{})['then'](respondWithResult(_0x346e1,0xc9))[_0x3dd0('0x46')](handleError(_0x346e1,null));};exports[_0x3dd0('0x48')]=function(_0x11ac92,_0x4d3710){return db[_0x3dd0('0x2b')][_0x3dd0('0x48')]()[_0x3dd0('0x25')](respondWithResult(_0x4d3710,null))[_0x3dd0('0x46')](handleError(_0x4d3710,null));};exports[_0x3dd0('0x23')]=function(_0x5508b1,_0x302cb0){if(_0x5508b1[_0x3dd0('0x49')]['uniqueid']){delete _0x5508b1['body'][_0x3dd0('0x4a')];}return db[_0x3dd0('0x2b')][_0x3dd0('0x45')]({'where':{'uniqueid':_0x5508b1['params']['id']}})[_0x3dd0('0x25')](handleEntityNotFound(_0x302cb0,null))[_0x3dd0('0x25')](saveUpdates(_0x5508b1['body'],null))[_0x3dd0('0x25')](respondWithResult(_0x302cb0,null))[_0x3dd0('0x46')](handleError(_0x302cb0,null));};
\ No newline at end of file
index 4d51543..19e1f94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc274=['uniqueid','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperHistory','endtime'];(function(_0x2461a0,_0x26167f){var _0x2fadbd=function(_0x493f1b){while(--_0x493f1b){_0x2461a0['push'](_0x2461a0['shift']());}};_0x2fadbd(++_0x26167f);}(_0xc274,0x151));var _0x4c27=function(_0x1784e4,_0x3a304f){_0x1784e4=_0x1784e4-0x0;var _0x31195b=_0xc274[_0x1784e4];return _0x31195b;};'use strict';var _=require('lodash');var util=require(_0x4c27('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4c27('0x1'));var BPromise=require(_0x4c27('0x2'));var rp=require(_0x4c27('0x3'));var fs=require('fs');var path=require(_0x4c27('0x4'));var rimraf=require(_0x4c27('0x5'));var config=require(_0x4c27('0x6'));var attributes=require('./cmHopperHistory.attributes');module[_0x4c27('0x7')]=function(_0x545647,_0x1789ca){return _0x545647[_0x4c27('0x8')](_0x4c27('0x9'),attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':'endtime','fields':[_0x4c27('0xa')]},{'name':'uniqueid','fields':[_0x4c27('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x65c9=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','cm_hopper_history','endtime','uniqueid','lodash','util','api','moment'];(function(_0x464091,_0x1bed8a){var _0x5ae274=function(_0x17b2cc){while(--_0x17b2cc){_0x464091['push'](_0x464091['shift']());}};_0x5ae274(++_0x1bed8a);}(_0x65c9,0x182));var _0x965c=function(_0x266d5e,_0x2f3c56){_0x266d5e=_0x266d5e-0x0;var _0xff450=_0x65c9[_0x266d5e];return _0xff450;};'use strict';var _=require(_0x965c('0x0'));var util=require(_0x965c('0x1'));var logger=require('../../config/logger')(_0x965c('0x2'));var moment=require(_0x965c('0x3'));var BPromise=require(_0x965c('0x4'));var rp=require(_0x965c('0x5'));var fs=require('fs');var path=require(_0x965c('0x6'));var rimraf=require(_0x965c('0x7'));var config=require(_0x965c('0x8'));var attributes=require(_0x965c('0x9'));module[_0x965c('0xa')]=function(_0xbda9ee,_0xb9c834){return _0xbda9ee[_0x965c('0xb')]('CmHopperHistory',attributes,{'tableName':_0x965c('0xc'),'paranoid':![],'indexes':[{'name':_0x965c('0xd'),'fields':[_0x965c('0xd')]},{'name':_0x965c('0xe'),'fields':[_0x965c('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 1b16088..3f46e9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4d4=['literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','ivrTotalCallsDays','GetCampaignHopperHistory','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','CreateCmHopperHistory','create','options','raw','then','info','CmHopperHistory','findAll','where','sequelize','COUNT','col'];(function(_0x10d406,_0x3ed1dd){var _0xbc4b73=function(_0x26906f){while(--_0x26906f){_0x10d406['push'](_0x10d406['shift']());}};_0xbc4b73(++_0x3ed1dd);}(_0xf4d4,0xf3));var _0x4f4d=function(_0x4449d6,_0x54e626){_0x4449d6=_0x4449d6-0x0;var _0x5b4bfd=_0xf4d4[_0x4449d6];return _0x5b4bfd;};'use strict';var _=require(_0x4f4d('0x0'));var util=require(_0x4f4d('0x1'));var moment=require(_0x4f4d('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f4d('0x3'));var fs=require('fs');var Redis=require(_0x4f4d('0x4'));var db=require(_0x4f4d('0x5'))['db'];var utils=require(_0x4f4d('0x6'));var logger=require(_0x4f4d('0x7'))(_0x4f4d('0x8'));var config=require(_0x4f4d('0x9'));var jayson=require(_0x4f4d('0xa'));var client=jayson['client'][_0x4f4d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e2c31,_0x58049b,_0x4cab19){return new BPromise(function(_0x4d3b45,_0x4e26aa){return client['request'](_0x4e2c31,_0x4cab19)['then'](function(_0x315fb4){logger['info'](_0x4f4d('0xc'),_0x58049b,_0x4f4d('0xd'));logger[_0x4f4d('0xe')](_0x4f4d('0xf'),_0x58049b,'request\x20sent',JSON[_0x4f4d('0x10')](_0x315fb4));if(_0x315fb4['error']){if(_0x315fb4['error'][_0x4f4d('0x11')]===0x1f4){logger[_0x4f4d('0x12')](_0x4f4d('0xc'),_0x58049b,_0x315fb4['error']['message']);return _0x4e26aa(_0x315fb4[_0x4f4d('0x12')][_0x4f4d('0x13')]);}logger['error'](_0x4f4d('0xc'),_0x58049b,_0x315fb4[_0x4f4d('0x12')][_0x4f4d('0x13')]);return _0x4d3b45(_0x315fb4[_0x4f4d('0x12')][_0x4f4d('0x13')]);}else{logger['info'](_0x4f4d('0xc'),_0x58049b,'request\x20sent');_0x4d3b45(_0x315fb4['result']['message']);}})[_0x4f4d('0x14')](function(_0x1cdf64){logger[_0x4f4d('0x12')](_0x4f4d('0xc'),_0x58049b,_0x1cdf64);_0x4e26aa(_0x1cdf64);});});}exports[_0x4f4d('0x15')]=function(_0x3af9a7){var _0x5ab09b=this;return new Promise(function(_0x2afc3a,_0x5e6423){return db['CmHopperHistory'][_0x4f4d('0x16')](_0x3af9a7['body'],{'raw':_0x3af9a7[_0x4f4d('0x17')]?_0x3af9a7[_0x4f4d('0x17')][_0x4f4d('0x18')]===undefined?!![]:![]:!![]})[_0x4f4d('0x19')](function(_0x51ee36){logger[_0x4f4d('0x1a')](_0x4f4d('0x15'),_0x3af9a7);logger[_0x4f4d('0xe')](_0x4f4d('0x15'),_0x3af9a7,JSON['stringify'](_0x51ee36));_0x2afc3a(_0x51ee36);})[_0x4f4d('0x14')](function(_0x27020e){logger['error'](_0x4f4d('0x15'),_0x27020e[_0x4f4d('0x13')],_0x3af9a7);_0x5e6423(_0x5ab09b[_0x4f4d('0x12')](0x1f4,_0x27020e[_0x4f4d('0x13')]));});});};exports['AvgHandleTime']=function(_0x4c34fa){var _0xddb558=this;return new Promise(function(_0x3512bf,_0x4ac2a3){return db[_0x4f4d('0x1b')][_0x4f4d('0x1c')]({'raw':_0x4c34fa[_0x4f4d('0x17')]?_0x4c34fa[_0x4f4d('0x17')][_0x4f4d('0x18')]===undefined?!![]:![]:!![],'where':_0x4c34fa['options']?_0x4c34fa[_0x4f4d('0x17')][_0x4f4d('0x1d')]||null:null,'attributes':[[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db[_0x4f4d('0x1e')][_0x4f4d('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0x4f4d('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x22')))),_0x4f4d('0x23')],[db[_0x4f4d('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x24')))),_0x4f4d('0x25')],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db[_0x4f4d('0x1e')]['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x26')))),_0x4f4d('0x27')],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x28'),db['sequelize']['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x29')))),_0x4f4d('0x2a')],[db['sequelize']['fn'](_0x4f4d('0x28'),db[_0x4f4d('0x1e')]['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x2b')))),_0x4f4d('0x2c')]]})[_0x4f4d('0x19')](function(_0x381643){logger[_0x4f4d('0x1a')](_0x4f4d('0x2d'),_0x4c34fa);logger[_0x4f4d('0xe')](_0x4f4d('0x2d'),_0x4c34fa,JSON[_0x4f4d('0x10')](_0x381643));_0x3512bf(_0x381643);})[_0x4f4d('0x14')](function(_0x4cd508){logger[_0x4f4d('0x12')](_0x4f4d('0x2d'),_0x4cd508[_0x4f4d('0x13')],_0x4c34fa);_0x4ac2a3(_0xddb558['error'](0x1f4,_0x4cd508[_0x4f4d('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4c35f2){var _0x9a069d=this;return new Promise(function(_0x3f43af,_0x29a162){return db[_0x4f4d('0x1b')][_0x4f4d('0x1c')]({'raw':_0x4c35f2[_0x4f4d('0x17')]?_0x4c35f2[_0x4f4d('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4c35f2[_0x4f4d('0x17')]?_0x4c35f2[_0x4f4d('0x17')][_0x4f4d('0x1d')]||null:null,'attributes':[[_0x4f4d('0x2e'),_0x4f4d('0x2f')],[db[_0x4f4d('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x30')))),'outboundNoSuchCallsDay'],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db['sequelize']['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x31')))),_0x4f4d('0x32')],[db[_0x4f4d('0x1e')]['fn']('COUNT',db[_0x4f4d('0x1e')]['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x22')))),'outboundAnswerCallsDay'],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db[_0x4f4d('0x1e')]['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x33')))),_0x4f4d('0x34')],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db[_0x4f4d('0x1e')]['fn']('IF',db[_0x4f4d('0x1e')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x4f4d('0x35')],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db[_0x4f4d('0x1e')]['fn']('IF',db[_0x4f4d('0x1e')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x4f4d('0x36')],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db['sequelize']['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x4f4d('0x37')],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db['sequelize']['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x38')))),_0x4f4d('0x39')],[db['sequelize']['fn'](_0x4f4d('0x1f'),db[_0x4f4d('0x1e')]['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db[_0x4f4d('0x1e')]['fn']('IF',db[_0x4f4d('0x1e')]['literal']('`state`\x20=\x2014,\x201,\x20null'))),_0x4f4d('0x3a')],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db[_0x4f4d('0x1e')]['fn']('IF',db['sequelize'][_0x4f4d('0x21')](_0x4f4d('0x3b')))),_0x4f4d('0x3c')],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db['sequelize']['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x3d')))),_0x4f4d('0x3e')],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db[_0x4f4d('0x1e')]['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x3f')))),_0x4f4d('0x3c')],[db[_0x4f4d('0x1e')]['fn']('COUNT',db[_0x4f4d('0x1e')]['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')](_0x4f4d('0x40')))),_0x4f4d('0x41')]],'group':[_0x4f4d('0x2e')]})[_0x4f4d('0x19')](function(_0x1c955d){logger[_0x4f4d('0x1a')]('GetVoiceQueueHopperHistory',_0x4c35f2);logger[_0x4f4d('0xe')](_0x4f4d('0x42'),_0x4c35f2,JSON[_0x4f4d('0x10')](_0x1c955d));_0x3f43af(_0x1c955d);})[_0x4f4d('0x14')](function(_0x318332){logger[_0x4f4d('0x12')](_0x4f4d('0x42'),_0x318332[_0x4f4d('0x13')],_0x4c35f2);_0x29a162(_0x9a069d[_0x4f4d('0x12')](0x1f4,_0x318332['message']));});});};exports['GetCampaignHopperHistory']=function(_0x3ef97d){var _0x45d29e=this;return new Promise(function(_0x283d21,_0x466424){return db[_0x4f4d('0x1b')]['findAll']({'raw':_0x3ef97d[_0x4f4d('0x17')]?_0x3ef97d[_0x4f4d('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3ef97d[_0x4f4d('0x17')]?_0x3ef97d[_0x4f4d('0x17')]['where']||null:null,'attributes':[[_0x4f4d('0x2e'),_0x4f4d('0x2f')],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db[_0x4f4d('0x1e')][_0x4f4d('0x20')]('id')),_0x4f4d('0x43')],[db[_0x4f4d('0x1e')]['fn'](_0x4f4d('0x1f'),db[_0x4f4d('0x1e')]['fn']('IF',db[_0x4f4d('0x1e')][_0x4f4d('0x21')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0x4f4d('0x2e')]})[_0x4f4d('0x19')](function(_0x59e24a){logger[_0x4f4d('0x1a')](_0x4f4d('0x44'),_0x3ef97d);logger[_0x4f4d('0xe')]('GetCampaignHopperHistory',_0x3ef97d,JSON[_0x4f4d('0x10')](_0x59e24a));_0x283d21(_0x59e24a);})['catch'](function(_0x2a27f5){logger[_0x4f4d('0x12')](_0x4f4d('0x44'),_0x2a27f5[_0x4f4d('0x13')],_0x3ef97d);_0x466424(_0x45d29e[_0x4f4d('0x12')](0x1f4,_0x2a27f5[_0x4f4d('0x13')]));});});};
\ No newline at end of file
+var _0xde71=['outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','`state`\x20=\x204,\x201,\x20null','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','CmHopperHistory,\x20%s,\x20%s','message','catch','create','options','CreateCmHopperHistory','findAll','raw','where','sequelize','COUNT','col','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','GetVoiceQueueHopperHistory','CmHopperHistory','campaign','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x371b29,_0x2d33ed){var _0x434d79=function(_0x3966cf){while(--_0x3966cf){_0x371b29['push'](_0x371b29['shift']());}};_0x434d79(++_0x2d33ed);}(_0xde71,0x1c1));var _0x1de7=function(_0x919445,_0x5467dc){_0x919445=_0x919445-0x0;var _0x511b3e=_0xde71[_0x919445];return _0x511b3e;};'use strict';var _=require(_0x1de7('0x0'));var util=require(_0x1de7('0x1'));var moment=require(_0x1de7('0x2'));var BPromise=require(_0x1de7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1de7('0x4'));var db=require(_0x1de7('0x5'))['db'];var utils=require(_0x1de7('0x6'));var logger=require(_0x1de7('0x7'))(_0x1de7('0x8'));var config=require(_0x1de7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1de7('0xa')][_0x1de7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8efed1,_0x1c92d9,_0x3a2f08){return new BPromise(function(_0x58a35f,_0x52940d){return client[_0x1de7('0xc')](_0x8efed1,_0x3a2f08)[_0x1de7('0xd')](function(_0x37383f){logger[_0x1de7('0xe')]('CmHopperHistory,\x20%s,\x20%s',_0x1c92d9,'request\x20sent');logger[_0x1de7('0xf')](_0x1de7('0x10'),_0x1c92d9,_0x1de7('0x11'),JSON[_0x1de7('0x12')](_0x37383f));if(_0x37383f['error']){if(_0x37383f['error'][_0x1de7('0x13')]===0x1f4){logger[_0x1de7('0x14')](_0x1de7('0x15'),_0x1c92d9,_0x37383f[_0x1de7('0x14')][_0x1de7('0x16')]);return _0x52940d(_0x37383f[_0x1de7('0x14')][_0x1de7('0x16')]);}logger[_0x1de7('0x14')](_0x1de7('0x15'),_0x1c92d9,_0x37383f['error'][_0x1de7('0x16')]);return _0x58a35f(_0x37383f['error']['message']);}else{logger['info'](_0x1de7('0x15'),_0x1c92d9,_0x1de7('0x11'));_0x58a35f(_0x37383f['result']['message']);}})[_0x1de7('0x17')](function(_0x2592c1){logger[_0x1de7('0x14')](_0x1de7('0x15'),_0x1c92d9,_0x2592c1);_0x52940d(_0x2592c1);});});}exports['CreateCmHopperHistory']=function(_0x1630d9){var _0x1bc2f7=this;return new Promise(function(_0x305c3a,_0x3b75d4){return db['CmHopperHistory'][_0x1de7('0x18')](_0x1630d9['body'],{'raw':_0x1630d9[_0x1de7('0x19')]?_0x1630d9[_0x1de7('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x24d123){logger[_0x1de7('0xe')](_0x1de7('0x1a'),_0x1630d9);logger['debug'](_0x1de7('0x1a'),_0x1630d9,JSON[_0x1de7('0x12')](_0x24d123));_0x305c3a(_0x24d123);})['catch'](function(_0xffd5cd){logger[_0x1de7('0x14')](_0x1de7('0x1a'),_0xffd5cd[_0x1de7('0x16')],_0x1630d9);_0x3b75d4(_0x1bc2f7[_0x1de7('0x14')](0x1f4,_0xffd5cd['message']));});});};exports['AvgHandleTime']=function(_0x574a06){var _0x32c80b=this;return new Promise(function(_0x5da0b2,_0x41b3d7){return db['CmHopperHistory'][_0x1de7('0x1b')]({'raw':_0x574a06[_0x1de7('0x19')]?_0x574a06[_0x1de7('0x19')][_0x1de7('0x1c')]===undefined?!![]:![]:!![],'where':_0x574a06[_0x1de7('0x19')]?_0x574a06['options'][_0x1de7('0x1d')]||null:null,'attributes':[[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db['sequelize'][_0x1de7('0x20')]('id')),'predictiveIntervalTotalCalls'],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x1de7('0x22')],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db['sequelize'][_0x1de7('0x21')](_0x1de7('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x24')))),_0x1de7('0x25')],[db['sequelize']['fn'](_0x1de7('0x26'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x27')))),_0x1de7('0x28')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x26'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x29')))),_0x1de7('0x2a')]]})[_0x1de7('0xd')](function(_0x5eb0f2){logger['info'](_0x1de7('0x2b'),_0x574a06);logger[_0x1de7('0xf')](_0x1de7('0x2b'),_0x574a06,JSON[_0x1de7('0x12')](_0x5eb0f2));_0x5da0b2(_0x5eb0f2);})[_0x1de7('0x17')](function(_0x35d0cf){logger['error']('AvgHandleTime',_0x35d0cf[_0x1de7('0x16')],_0x574a06);_0x41b3d7(_0x32c80b['error'](0x1f4,_0x35d0cf[_0x1de7('0x16')]));});});};exports[_0x1de7('0x2c')]=function(_0x368da5){var _0x2db375=this;return new Promise(function(_0x24c8a9,_0x432ac2){return db[_0x1de7('0x2d')][_0x1de7('0x1b')]({'raw':_0x368da5[_0x1de7('0x19')]?_0x368da5[_0x1de7('0x19')][_0x1de7('0x1c')]===undefined?!![]:![]:!![],'where':_0x368da5[_0x1de7('0x19')]?_0x368da5[_0x1de7('0x19')][_0x1de7('0x1d')]||null:null,'attributes':[[_0x1de7('0x2e'),'name'],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x2f')))),'outboundNoSuchCallsDay'],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x30')))),_0x1de7('0x31')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x1de7('0x32')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x33')))),_0x1de7('0x34')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x35')))),_0x1de7('0x36')],[db['sequelize']['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x37')))),_0x1de7('0x38')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x39')))),_0x1de7('0x3a')],[db['sequelize']['fn'](_0x1de7('0x1f'),db['sequelize']['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x3b')))),'outboundUnknownCallsDay'],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),_0x1de7('0x3c')],[db[_0x1de7('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x3d')))),_0x1de7('0x3e')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db['sequelize'][_0x1de7('0x21')](_0x1de7('0x3f')))),_0x1de7('0x40')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x41')))),_0x1de7('0x42')],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x43')))),_0x1de7('0x40')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')]['literal'](_0x1de7('0x44')))),_0x1de7('0x45')]],'group':[_0x1de7('0x2e')]})['then'](function(_0x4a799b){logger[_0x1de7('0xe')](_0x1de7('0x2c'),_0x368da5);logger['debug'](_0x1de7('0x2c'),_0x368da5,JSON['stringify'](_0x4a799b));_0x24c8a9(_0x4a799b);})['catch'](function(_0x41bf29){logger[_0x1de7('0x14')](_0x1de7('0x2c'),_0x41bf29['message'],_0x368da5);_0x432ac2(_0x2db375[_0x1de7('0x14')](0x1f4,_0x41bf29[_0x1de7('0x16')]));});});};exports[_0x1de7('0x46')]=function(_0x3a23b7){var _0x579321=this;return new Promise(function(_0x15b26e,_0x2d140d){return db['CmHopperHistory'][_0x1de7('0x1b')]({'raw':_0x3a23b7[_0x1de7('0x19')]?_0x3a23b7[_0x1de7('0x19')][_0x1de7('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a23b7[_0x1de7('0x19')]?_0x3a23b7[_0x1de7('0x19')][_0x1de7('0x1d')]||null:null,'attributes':[[_0x1de7('0x2e'),_0x1de7('0x47')],[db[_0x1de7('0x1e')]['fn']('COUNT',db[_0x1de7('0x1e')][_0x1de7('0x20')]('id')),_0x1de7('0x48')],[db[_0x1de7('0x1e')]['fn'](_0x1de7('0x1f'),db[_0x1de7('0x1e')]['fn']('IF',db[_0x1de7('0x1e')][_0x1de7('0x21')](_0x1de7('0x49')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x1de7('0xd')](function(_0x38ac74){logger['info'](_0x1de7('0x46'),_0x3a23b7);logger[_0x1de7('0xf')](_0x1de7('0x46'),_0x3a23b7,JSON['stringify'](_0x38ac74));_0x15b26e(_0x38ac74);})[_0x1de7('0x17')](function(_0x4b2f5a){logger['error'](_0x1de7('0x46'),_0x4b2f5a['message'],_0x3a23b7);_0x2d140d(_0x579321[_0x1de7('0x14')](0x1f4,_0x4b2f5a[_0x1de7('0x16')]));});});};
\ No newline at end of file
index 2fe9360..b0a9039 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6926=['isAuthenticated','show','post','create','put','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','describe','/:id'];(function(_0x277af0,_0x1f0361){var _0x43bd7c=function(_0x3ad480){while(--_0x3ad480){_0x277af0['push'](_0x277af0['shift']());}};_0x43bd7c(++_0x1f0361);}(_0x6926,0x142));var _0x6692=function(_0x4e2f83,_0x5a5c4b){_0x4e2f83=_0x4e2f83-0x0;var _0x4528c9=_0x6926[_0x4e2f83];return _0x4528c9;};'use strict';var multer=require(_0x6692('0x0'));var util=require(_0x6692('0x1'));var path=require('path');var timeout=require(_0x6692('0x2'));var express=require(_0x6692('0x3'));var router=express[_0x6692('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6692('0x5'));var interaction=require(_0x6692('0x6'));var config=require(_0x6692('0x7'));var controller=require(_0x6692('0x8'));router[_0x6692('0x9')]('/',auth['isAuthenticated'](),controller[_0x6692('0xa')]);router[_0x6692('0x9')](_0x6692('0xb'),auth['isAuthenticated'](),controller[_0x6692('0xc')]);router[_0x6692('0x9')](_0x6692('0xd'),auth[_0x6692('0xe')](),controller[_0x6692('0xf')]);router[_0x6692('0x10')]('/',auth[_0x6692('0xe')](),controller[_0x6692('0x11')]);router[_0x6692('0x12')](_0x6692('0xd'),auth['isAuthenticated'](),controller[_0x6692('0x13')]);module[_0x6692('0x14')]=router;
\ No newline at end of file
+var _0x8562=['isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4050f2,_0x55bfa8){var _0x3fb601=function(_0x413ff9){while(--_0x413ff9){_0x4050f2['push'](_0x4050f2['shift']());}};_0x3fb601(++_0x55bfa8);}(_0x8562,0x118));var _0x2856=function(_0x49bae9,_0x72b4d2){_0x49bae9=_0x49bae9-0x0;var _0x36f5bf=_0x8562[_0x49bae9];return _0x36f5bf;};'use strict';var multer=require('multer');var util=require(_0x2856('0x0'));var path=require(_0x2856('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2856('0x2')]();var fs_extra=require(_0x2856('0x3'));var auth=require(_0x2856('0x4'));var interaction=require(_0x2856('0x5'));var config=require(_0x2856('0x6'));var controller=require('./cmHopperHistory.controller');router[_0x2856('0x7')]('/',auth[_0x2856('0x8')](),controller[_0x2856('0x9')]);router[_0x2856('0x7')](_0x2856('0xa'),auth['isAuthenticated'](),controller[_0x2856('0xb')]);router['get']('/:id',auth[_0x2856('0x8')](),controller[_0x2856('0xc')]);router[_0x2856('0xd')]('/',auth[_0x2856('0x8')](),controller[_0x2856('0xe')]);router[_0x2856('0xf')](_0x2856('0x10'),auth[_0x2856('0x8')](),controller[_0x2856('0x11')]);module['exports']=router;
\ No newline at end of file
index f76dafe..8051af9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8de=['exports','STRING'];(function(_0x255917,_0x570afd){var _0x4953af=function(_0x130f40){while(--_0x130f40){_0x255917['push'](_0x255917['shift']());}};_0x4953af(++_0x570afd);}(_0xf8de,0x1d4));var _0xef8d=function(_0x23433a,_0x4e186c){_0x23433a=_0x23433a-0x0;var _0x2fb6fe=_0xf8de[_0x23433a];return _0x2fb6fe;};'use strict';var Sequelize=require('sequelize');module[_0xef8d('0x0')]={'name':{'type':Sequelize[_0xef8d('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xef8d('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x16d8=['name','exports','STRING'];(function(_0x22df70,_0x103d9d){var _0x30b9f4=function(_0x74890d){while(--_0x74890d){_0x22df70['push'](_0x22df70['shift']());}};_0x30b9f4(++_0x103d9d);}(_0x16d8,0xa3));var _0x816d=function(_0x382d2e,_0x38e835){_0x382d2e=_0x382d2e-0x0;var _0x8122b4=_0x16d8[_0x382d2e];return _0x8122b4;};'use strict';var Sequelize=require('sequelize');module[_0x816d('0x0')]={'name':{'type':Sequelize[_0x816d('0x1')],'unique':_0x816d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x816d('0x1')]},'dialPrefix':{'type':Sequelize[_0x816d('0x1')]}};
\ No newline at end of file
index 61f1770..dd756cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b68=['ListId','findOne','Disposition','hasOwnProperty','pick','include','addContacts','CmContact','tags','isArray','join','each','omit','success','errors','Malformed\x20request\x20syntax','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContacts','getContactsCsv','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','TEXT','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll','ids','emit','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','update','then','destroy','get','Lists','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','options','CmList','findAll','rows','catch','show','params','includeAll','merge','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','error','describe','addDisposition'];(function(_0x271951,_0x2c9964){var _0x3cac14=function(_0x2d5428){while(--_0x2d5428){_0x271951['push'](_0x271951['shift']());}};_0x3cac14(++_0x2c9964);}(_0x1b68,0x14e));var _0x81b6=function(_0x9618a5,_0x4586b2){_0x9618a5=_0x9618a5-0x0;var _0x22b5d1=_0x1b68[_0x9618a5];return _0x22b5d1;};'use strict';var emlformat=require(_0x81b6('0x0'));var rimraf=require(_0x81b6('0x1'));var zipdir=require(_0x81b6('0x2'));var jsonpatch=require(_0x81b6('0x3'));var rp=require(_0x81b6('0x4'));var moment=require(_0x81b6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x81b6('0x6'));var util=require(_0x81b6('0x7'));var path=require(_0x81b6('0x8'));var sox=require(_0x81b6('0x9'));var csv=require('to-csv');var ejs=require(_0x81b6('0xa'));var fs=require('fs');var fs_extra=require(_0x81b6('0xb'));var _=require(_0x81b6('0xc'));var squel=require('squel');var crypto=require(_0x81b6('0xd'));var jsforce=require(_0x81b6('0xe'));var deskjs=require(_0x81b6('0xf'));var toCsv=require('to-csv');var querystring=require(_0x81b6('0x10'));var Papa=require(_0x81b6('0x11'));var Redis=require(_0x81b6('0x12'));var authService=require(_0x81b6('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x81b6('0x14'));var hardwareService=require(_0x81b6('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x81b6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x81b6('0x17'));var db=require(_0x81b6('0x18'))['db'];config[_0x81b6('0x19')]=_[_0x81b6('0x1a')](config[_0x81b6('0x19')],{'host':_0x81b6('0x1b'),'port':0x18eb});var socket=require(_0x81b6('0x1c'))(new Redis(config[_0x81b6('0x19')]));require(_0x81b6('0x1d'))[_0x81b6('0x1e')](socket);function respondWithStatusCode(_0x49f9b6,_0x5cc24c){_0x5cc24c=_0x5cc24c||0xcc;return function(_0x4bf163){if(_0x4bf163){return _0x49f9b6[_0x81b6('0x1f')](_0x5cc24c);}return _0x49f9b6[_0x81b6('0x20')](_0x5cc24c)[_0x81b6('0x21')]();};}function respondWithResult(_0x3c4f75,_0x1d1f84){_0x1d1f84=_0x1d1f84||0xc8;return function(_0x578316){if(_0x578316){return _0x3c4f75[_0x81b6('0x20')](_0x1d1f84)['json'](_0x578316);}};}function respondWithFilteredResult(_0x3f697b,_0x76426c){return function(_0x4045a7){if(_0x4045a7){var _0x4806e7=typeof _0x76426c[_0x81b6('0x22')]==='undefined'&&typeof _0x76426c[_0x81b6('0x23')]===_0x81b6('0x24');var _0x2eeb13=_0x4045a7[_0x81b6('0x25')];var _0x56f598=_0x4806e7?0x0:_0x76426c[_0x81b6('0x22')];var _0x4d9a91=_0x4806e7?_0x4045a7[_0x81b6('0x25')]:_0x76426c[_0x81b6('0x22')]+_0x76426c[_0x81b6('0x23')];var _0x18c807;if(_0x4d9a91>=_0x2eeb13){_0x4d9a91=_0x2eeb13;_0x18c807=0xc8;}else{_0x18c807=0xce;}_0x3f697b['status'](_0x18c807);return _0x3f697b['set'](_0x81b6('0x26'),_0x56f598+'-'+_0x4d9a91+'/'+_0x2eeb13)[_0x81b6('0x27')](_0x4045a7);}return null;};}function patchUpdates(_0x536e3b){return function(_0x51a435){try{jsonpatch[_0x81b6('0x28')](_0x51a435,_0x536e3b,!![]);}catch(_0x5be74b){return BPromise['reject'](_0x5be74b);}return _0x51a435[_0x81b6('0x29')]();};}function saveUpdates(_0x29110f,_0x50c3ed){return function(_0x2ba7b9){if(_0x2ba7b9){return _0x2ba7b9[_0x81b6('0x2a')](_0x29110f)[_0x81b6('0x2b')](function(_0x211789){return _0x211789;});}return null;};}function removeEntity(_0x1d6d2a,_0x4a2d5a){return function(_0x42f42d){if(_0x42f42d){return _0x42f42d[_0x81b6('0x2c')]()[_0x81b6('0x2b')](function(){var _0x1a3284=_0x42f42d[_0x81b6('0x2d')]({'plain':!![]});var _0x5b7d72=_0x81b6('0x2e');return db[_0x81b6('0x2f')][_0x81b6('0x2c')]({'where':{'type':_0x5b7d72,'resourceId':_0x1a3284['id']}})[_0x81b6('0x2b')](function(){return _0x42f42d;});})[_0x81b6('0x2b')](function(){_0x1d6d2a[_0x81b6('0x20')](0xcc)[_0x81b6('0x21')]();});}};}function handleEntityNotFound(_0x25697a,_0x180611){return function(_0x5220ad){if(!_0x5220ad){_0x25697a['sendStatus'](0x194);}return _0x5220ad;};}function handleError(_0x151457,_0x422e53){_0x422e53=_0x422e53||0x1f4;return function(_0x39ef0e){logger['error'](_0x39ef0e[_0x81b6('0x30')]);if(_0x39ef0e[_0x81b6('0x31')]){delete _0x39ef0e[_0x81b6('0x31')];}_0x151457[_0x81b6('0x20')](_0x422e53)[_0x81b6('0x32')](_0x39ef0e);};}exports[_0x81b6('0x33')]=function(_0x1cfd12,_0xe75641){var _0x20b44a={},_0x48e576={},_0x3256d1={'count':0x0,'rows':[]};var _0x3938d4=_[_0x81b6('0x34')](db['CmList'][_0x81b6('0x35')],function(_0x2ad1d3){return{'name':_0x2ad1d3[_0x81b6('0x36')],'type':_0x2ad1d3[_0x81b6('0x37')][_0x81b6('0x38')]};});_0x48e576['model']=_[_0x81b6('0x34')](_0x3938d4,'name');_0x48e576['query']=_[_0x81b6('0x39')](_0x1cfd12[_0x81b6('0x3a')]);_0x48e576[_0x81b6('0x3b')]=_[_0x81b6('0x3c')](_0x48e576[_0x81b6('0x3d')],_0x48e576[_0x81b6('0x3a')]);_0x20b44a[_0x81b6('0x3e')]=_[_0x81b6('0x3c')](_0x48e576['model'],qs[_0x81b6('0x3f')](_0x1cfd12[_0x81b6('0x3a')]['fields']));_0x20b44a[_0x81b6('0x3e')]=_0x20b44a[_0x81b6('0x3e')][_0x81b6('0x40')]?_0x20b44a[_0x81b6('0x3e')]:_0x48e576['model'];if(!_0x1cfd12[_0x81b6('0x3a')]['hasOwnProperty'](_0x81b6('0x41'))){_0x20b44a['limit']=qs[_0x81b6('0x23')](_0x1cfd12[_0x81b6('0x3a')][_0x81b6('0x23')]);_0x20b44a[_0x81b6('0x22')]=qs[_0x81b6('0x22')](_0x1cfd12[_0x81b6('0x3a')][_0x81b6('0x22')]);}_0x20b44a[_0x81b6('0x42')]=qs[_0x81b6('0x43')](_0x1cfd12[_0x81b6('0x3a')][_0x81b6('0x43')]);_0x20b44a[_0x81b6('0x44')]=qs[_0x81b6('0x3b')](_['pick'](_0x1cfd12[_0x81b6('0x3a')],_0x48e576['filters']),_0x3938d4);if(_0x1cfd12[_0x81b6('0x3a')][_0x81b6('0x45')]){_0x20b44a['where']=_['merge'](_0x20b44a['where'],{'$or':_['map'](_0x3938d4,function(_0x7860cd){if(_0x7860cd[_0x81b6('0x37')]!==_0x81b6('0x46')){var _0x3405ae={};_0x3405ae[_0x7860cd['name']]={'$like':'%'+_0x1cfd12[_0x81b6('0x3a')][_0x81b6('0x45')]+'%'};return _0x3405ae;}})});}_0x20b44a=_['merge']({},_0x20b44a,_0x1cfd12[_0x81b6('0x47')]);var _0x321366={'where':_0x20b44a[_0x81b6('0x44')]};return db[_0x81b6('0x48')][_0x81b6('0x25')](_0x321366)[_0x81b6('0x2b')](function(_0x12e9d7){_0x3256d1[_0x81b6('0x25')]=_0x12e9d7;if(_0x1cfd12[_0x81b6('0x3a')]['includeAll']){_0x20b44a['include']=[{'all':!![]}];}return db[_0x81b6('0x48')][_0x81b6('0x49')](_0x20b44a);})[_0x81b6('0x2b')](function(_0x51f80b){_0x3256d1[_0x81b6('0x4a')]=_0x51f80b;return _0x3256d1;})[_0x81b6('0x2b')](respondWithFilteredResult(_0xe75641,_0x20b44a))[_0x81b6('0x4b')](handleError(_0xe75641,null));};exports[_0x81b6('0x4c')]=function(_0x1230b3,_0x37dc87){var _0x4b6baa={'raw':![],'where':{'id':_0x1230b3[_0x81b6('0x4d')]['id']}},_0x3c757c={};_0x3c757c[_0x81b6('0x3d')]=_[_0x81b6('0x39')](db['CmList'][_0x81b6('0x35')]);_0x3c757c[_0x81b6('0x3a')]=_['keys'](_0x1230b3[_0x81b6('0x3a')]);_0x3c757c['filters']=_['intersection'](_0x3c757c['model'],_0x3c757c[_0x81b6('0x3a')]);_0x4b6baa[_0x81b6('0x3e')]=_[_0x81b6('0x3c')](_0x3c757c[_0x81b6('0x3d')],qs['fields'](_0x1230b3['query'][_0x81b6('0x3f')]));_0x4b6baa[_0x81b6('0x3e')]=_0x4b6baa[_0x81b6('0x3e')]['length']?_0x4b6baa[_0x81b6('0x3e')]:_0x3c757c[_0x81b6('0x3d')];if(_0x1230b3['query'][_0x81b6('0x4e')]){_0x4b6baa['include']=[{'all':!![]}];}_0x4b6baa=_[_0x81b6('0x4f')]({},_0x4b6baa,_0x1230b3[_0x81b6('0x47')]);return db[_0x81b6('0x48')]['find'](_0x4b6baa)[_0x81b6('0x2b')](handleEntityNotFound(_0x37dc87,null))[_0x81b6('0x2b')](respondWithResult(_0x37dc87,null))[_0x81b6('0x4b')](handleError(_0x37dc87,null));};exports[_0x81b6('0x50')]=function(_0xeb8a17,_0x96da5a){return db[_0x81b6('0x48')][_0x81b6('0x50')](_0xeb8a17[_0x81b6('0x51')],{})[_0x81b6('0x2b')](function(_0x59f6f9){var _0x172522=_0xeb8a17['user'][_0x81b6('0x2d')]({'plain':!![]});if(!_0x172522)throw new Error(_0x81b6('0x52'));if(_0x172522['role']==='user'){var _0x436648=_0x59f6f9['get']({'plain':!![]});var _0xe0ec3a='Lists';return db['UserProfileSection'][_0x81b6('0x53')]({'where':{'name':_0xe0ec3a,'userProfileId':_0x172522[_0x81b6('0x54')]},'raw':!![]})[_0x81b6('0x2b')](function(_0x30e80b){if(_0x30e80b&&_0x30e80b[_0x81b6('0x55')]===0x0){return db['UserProfileResource'][_0x81b6('0x50')]({'name':_0x436648['name'],'resourceId':_0x436648['id'],'type':_0x30e80b[_0x81b6('0x31')],'sectionId':_0x30e80b['id']},{})[_0x81b6('0x2b')](function(){return _0x59f6f9;});}else{return _0x59f6f9;}})[_0x81b6('0x4b')](function(_0x3fa848){logger[_0x81b6('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fa848);throw _0x3fa848;});}return _0x59f6f9;})[_0x81b6('0x2b')](respondWithResult(_0x96da5a,0xc9))[_0x81b6('0x4b')](handleError(_0x96da5a,null));};exports[_0x81b6('0x2a')]=function(_0x2bfbf7,_0x13ceae){if(_0x2bfbf7[_0x81b6('0x51')]['id']){delete _0x2bfbf7[_0x81b6('0x51')]['id'];}return db[_0x81b6('0x48')]['find']({'where':{'id':_0x2bfbf7[_0x81b6('0x4d')]['id']}})[_0x81b6('0x2b')](handleEntityNotFound(_0x13ceae,null))[_0x81b6('0x2b')](saveUpdates(_0x2bfbf7[_0x81b6('0x51')],null))[_0x81b6('0x2b')](respondWithResult(_0x13ceae,null))[_0x81b6('0x4b')](handleError(_0x13ceae,null));};exports[_0x81b6('0x2c')]=function(_0x50e98a,_0x33b519){return db[_0x81b6('0x48')]['find']({'where':{'id':_0x50e98a['params']['id']}})['then'](handleEntityNotFound(_0x33b519,null))[_0x81b6('0x2b')](removeEntity(_0x33b519,null))[_0x81b6('0x4b')](handleError(_0x33b519,null));};exports[_0x81b6('0x57')]=function(_0x27f053,_0x399f2c){return db[_0x81b6('0x48')][_0x81b6('0x57')]()[_0x81b6('0x2b')](respondWithResult(_0x399f2c,null))[_0x81b6('0x4b')](handleError(_0x399f2c,null));};exports[_0x81b6('0x58')]=function(_0x1baa91,_0x14e8e0,_0x3ad7a0){if(_0x1baa91[_0x81b6('0x51')]['id']){delete _0x1baa91[_0x81b6('0x51')]['id'];}return db['CmList'][_0x81b6('0x53')]({'where':{'id':_0x1baa91[_0x81b6('0x4d')]['id']}})[_0x81b6('0x2b')](handleEntityNotFound(_0x14e8e0,null))[_0x81b6('0x2b')](function(_0x34ee37){if(_0x34ee37){_0x1baa91[_0x81b6('0x51')][_0x81b6('0x59')]=_0x34ee37['id'];return db['Disposition'][_0x81b6('0x50')](_0x1baa91[_0x81b6('0x51')]);}})[_0x81b6('0x2b')](respondWithResult(_0x14e8e0,null))['catch'](handleError(_0x14e8e0,null));};exports['getDispositions']=function(_0x5d540a,_0x332a2d,_0x3707bd){var _0x54d825={'raw':![],'where':{}};var _0x5be8c6={};var _0x42be95={'count':0x0,'rows':[]};return db['CmList'][_0x81b6('0x5a')]({'where':{'id':_0x5d540a['params']['id']}})['then'](handleEntityNotFound(_0x332a2d,null))[_0x81b6('0x2b')](function(_0x213d13){if(_0x213d13){_0x5be8c6[_0x81b6('0x3d')]=_[_0x81b6('0x39')](db[_0x81b6('0x5b')][_0x81b6('0x35')]);_0x5be8c6['query']=_[_0x81b6('0x39')](_0x5d540a[_0x81b6('0x3a')]);_0x5be8c6[_0x81b6('0x3b')]=_[_0x81b6('0x3c')](_0x5be8c6['model'],_0x5be8c6[_0x81b6('0x3a')]);_0x54d825[_0x81b6('0x3e')]=_[_0x81b6('0x3c')](_0x5be8c6[_0x81b6('0x3d')],qs[_0x81b6('0x3f')](_0x5d540a['query']['fields']));_0x54d825[_0x81b6('0x3e')]=_0x54d825['attributes']['length']?_0x54d825[_0x81b6('0x3e')]:_0x5be8c6[_0x81b6('0x3d')];if(!_0x5d540a['query'][_0x81b6('0x5c')](_0x81b6('0x41'))){_0x54d825[_0x81b6('0x23')]=qs[_0x81b6('0x23')](_0x5d540a[_0x81b6('0x3a')][_0x81b6('0x23')]);_0x54d825['offset']=qs[_0x81b6('0x22')](_0x5d540a[_0x81b6('0x3a')][_0x81b6('0x22')]);}_0x54d825[_0x81b6('0x42')]=qs['sort'](_0x5d540a['query'][_0x81b6('0x43')]);_0x54d825[_0x81b6('0x44')]=qs[_0x81b6('0x3b')](_[_0x81b6('0x5d')](_0x5d540a[_0x81b6('0x3a')],_0x5be8c6[_0x81b6('0x3b')]));_0x54d825['where'][_0x81b6('0x59')]=_0x213d13['id'];if(_0x5d540a[_0x81b6('0x3a')][_0x81b6('0x45')]){_0x54d825[_0x81b6('0x44')]=_['merge'](_0x54d825['where'],{'$or':_[_0x81b6('0x34')](_0x54d825['attributes'],function(_0x212372){var _0x373912={};_0x373912[_0x212372]={'$like':'%'+_0x5d540a['query']['filter']+'%'};return _0x373912;})});}_0x54d825=_[_0x81b6('0x4f')]({},_0x54d825,_0x5d540a['options']);return db[_0x81b6('0x5b')]['count']({'where':_0x54d825[_0x81b6('0x44')]})[_0x81b6('0x2b')](function(_0x43c1f0){_0x42be95[_0x81b6('0x25')]=_0x43c1f0;if(_0x5d540a[_0x81b6('0x3a')][_0x81b6('0x4e')]){_0x54d825[_0x81b6('0x5e')]=[{'all':!![]}];}return db['Disposition'][_0x81b6('0x49')](_0x54d825);})[_0x81b6('0x2b')](function(_0xd948a6){_0x42be95[_0x81b6('0x4a')]=_0xd948a6;return _0x42be95;});}})['then'](respondWithFilteredResult(_0x332a2d,_0x54d825))[_0x81b6('0x4b')](handleError(_0x332a2d,null));};exports['removeDispositions']=function(_0xf682,_0x2c58ae,_0x3bdd13){return db[_0x81b6('0x48')]['find']({'where':{'id':_0xf682[_0x81b6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2c58ae,null))[_0x81b6('0x2b')](function(_0x32ef2f){if(_0x32ef2f){return _0x32ef2f['removeDispositions'](_0xf682[_0x81b6('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x2c58ae,null))[_0x81b6('0x4b')](handleError(_0x2c58ae,null));};exports[_0x81b6('0x5f')]=function(_0x39d14d,_0x5e4efb,_0x1421c6){return db[_0x81b6('0x48')]['find']({'where':{'id':_0x39d14d['params']['id']}})['then'](handleEntityNotFound(_0x5e4efb,null))[_0x81b6('0x2b')](function(_0x40bd55){if(_0x40bd55){var _0x5a38a7=[];var _0x10dd01={'success':[],'errors':[]};return db[_0x81b6('0x60')][_0x81b6('0x57')]()[_0x81b6('0x2b')](function(_0x5caf7f){if(_0x39d14d['body'][_0x81b6('0x61')]&&_[_0x81b6('0x62')](_0x39d14d[_0x81b6('0x51')][_0x81b6('0x61')])){if(_0x39d14d[_0x81b6('0x51')][_0x81b6('0x61')][_0x81b6('0x40')]){_0x39d14d['body']['tags']=_0x39d14d[_0x81b6('0x51')]['tags'][_0x81b6('0x63')](';')+';';}else{_0x39d14d[_0x81b6('0x51')][_0x81b6('0x61')]=null;}}else{_0x39d14d[_0x81b6('0x51')]['tags']=null;}if(_0x39d14d[_0x81b6('0x51')]&&_[_0x81b6('0x62')](_0x39d14d[_0x81b6('0x51')])){for(var _0x1d5b70=0x0;_0x1d5b70<_0x39d14d['body'][_0x81b6('0x40')];_0x1d5b70+=0x1){_0x39d14d[_0x81b6('0x51')][_0x1d5b70]['ListId']=_0x39d14d[_0x81b6('0x4d')]['id'];_0x5a38a7['push'](_0x39d14d['body'][_0x1d5b70]);}return BPromise[_0x81b6('0x64')](_0x5a38a7,function(_0x58093a){return db[_0x81b6('0x60')][_0x81b6('0x50')](_[_0x81b6('0x65')](_0x58093a,['ids','id'])||{},{'fields':_[_0x81b6('0x39')](_0x5caf7f),'raw':!![]})['then'](function(_0x13a358){_0x10dd01[_0x81b6('0x66')]['push'](_0x13a358['dataValues']);})['catch'](function(_0x4e9e36){_0x10dd01[_0x81b6('0x67')]['push']({'data':_0x58093a,'error':_0x4e9e36['message']});});})[_0x81b6('0x2b')](function(_0x10f49b){return _0x10dd01;})[_0x81b6('0x4b')](function(_0x144a57){return _0x144a57;});}else{_0x5e4efb[_0x81b6('0x20')](0x190)[_0x81b6('0x27')]({'message':_0x81b6('0x68')});}});}})[_0x81b6('0x2b')](respondWithResult(_0x5e4efb,null))[_0x81b6('0x4b')](handleError(_0x5e4efb,null));};exports['getContacts']=function(_0xa2b5c6,_0x209eff,_0x1606f7){var _0x1b3788;return db[_0x81b6('0x48')][_0x81b6('0x53')]({'where':{'id':_0xa2b5c6[_0x81b6('0x4d')]['id']},'include':[{'model':db[_0x81b6('0x69')],'as':'CustomFields'}]})[_0x81b6('0x2b')](handleEntityNotFound(_0x209eff,null))[_0x81b6('0x2b')](function(_0x17e6c3){if(_0x17e6c3){_0x1b3788=_0x17e6c3;return db[_0x81b6('0x60')][_0x81b6('0x35')];}})[_0x81b6('0x2b')](function(_0x55d202){if(_0x55d202){var _0x3f1f23={};var _0x421042={};_0x421042[_0x81b6('0x3d')]=_[_0x81b6('0x6a')](_['keys'](_0x55d202),_[_0x81b6('0x34')](_0x1b3788[_0x81b6('0x6b')],function(_0x4b2f52){return util[_0x81b6('0x6c')](_0x81b6('0x6d'),_0x4b2f52['id']);}));_0x421042[_0x81b6('0x3a')]=_[_0x81b6('0x39')](_0xa2b5c6[_0x81b6('0x3a')]);_0x421042[_0x81b6('0x3b')]=_['intersection'](_0x421042['model'],_0x421042[_0x81b6('0x3a')]);_0x3f1f23[_0x81b6('0x3e')]=_[_0x81b6('0x3c')](_0x421042[_0x81b6('0x3d')],qs[_0x81b6('0x3f')](_0xa2b5c6[_0x81b6('0x3a')][_0x81b6('0x3f')]));_0x3f1f23[_0x81b6('0x3e')]=_0x3f1f23[_0x81b6('0x3e')]['length']?_0x3f1f23[_0x81b6('0x3e')]:_0x421042[_0x81b6('0x3d')];if(!_0xa2b5c6['query'][_0x81b6('0x5c')]('nolimit')){_0x3f1f23[_0x81b6('0x23')]=qs[_0x81b6('0x23')](_0xa2b5c6['query'][_0x81b6('0x23')]);_0x3f1f23[_0x81b6('0x22')]=qs[_0x81b6('0x22')](_0xa2b5c6[_0x81b6('0x3a')][_0x81b6('0x22')]);}_0x3f1f23['order']=qs['sort'](_0xa2b5c6[_0x81b6('0x3a')][_0x81b6('0x43')]);_0x3f1f23['where']=qs[_0x81b6('0x3b')](_[_0x81b6('0x5d')](_0xa2b5c6[_0x81b6('0x3a')],_0x421042[_0x81b6('0x3b')]));_0x3f1f23[_0x81b6('0x6e')]=!![];if(_0xa2b5c6[_0x81b6('0x3a')][_0x81b6('0x45')]){_0x3f1f23['where']=_['merge'](_0x3f1f23[_0x81b6('0x44')],{'$or':_[_0x81b6('0x34')](_0x3f1f23[_0x81b6('0x3e')],function(_0x321b05){var _0x571703={};_0x571703[_0x321b05]={'$like':'%'+_0xa2b5c6[_0x81b6('0x3a')][_0x81b6('0x45')]+'%'};return _0x571703;})});}_0x3f1f23=_[_0x81b6('0x4f')]({},_0x3f1f23,_0xa2b5c6['options']);return _0x1b3788[_0x81b6('0x6f')](_0x3f1f23);}})[_0x81b6('0x2b')](respondWithResult(_0x209eff,null))[_0x81b6('0x4b')](handleError(_0x209eff,null));};exports[_0x81b6('0x70')]=function(_0x4e24ae,_0x3c5237,_0x86eab0){var _0x2f02b5;return db[_0x81b6('0x48')][_0x81b6('0x53')]({'where':{'id':_0x4e24ae['params']['id']},'include':[{'model':db[_0x81b6('0x69')],'as':_0x81b6('0x6b')}]})[_0x81b6('0x2b')](handleEntityNotFound(_0x3c5237,null))[_0x81b6('0x2b')](function(_0x5e271f){if(_0x5e271f){_0x2f02b5=_0x5e271f;return db[_0x81b6('0x60')][_0x81b6('0x35')];}})[_0x81b6('0x2b')](function(_0x2490d0){if(_0x2490d0){var _0x13cc9c={};var _0x5b8f79={};_0x5b8f79[_0x81b6('0x3d')]=_[_0x81b6('0x6a')](_['keys'](_0x2490d0),_[_0x81b6('0x34')](_0x2f02b5['CustomFields'],function(_0x54fe4d){return util[_0x81b6('0x6c')](_0x81b6('0x6d'),_0x54fe4d['id']);}));_0x5b8f79[_0x81b6('0x3a')]=_['keys'](_0x4e24ae[_0x81b6('0x3a')]);_0x5b8f79[_0x81b6('0x3b')]=_['intersection'](_0x5b8f79[_0x81b6('0x3d')],_0x5b8f79[_0x81b6('0x3a')]);_0x13cc9c[_0x81b6('0x3e')]=_['intersection'](_0x5b8f79['model'],qs['fields'](_0x4e24ae[_0x81b6('0x3a')][_0x81b6('0x3f')]));_0x13cc9c[_0x81b6('0x3e')]=_0x13cc9c[_0x81b6('0x3e')][_0x81b6('0x40')]?_0x13cc9c[_0x81b6('0x3e')]:_0x5b8f79[_0x81b6('0x3d')];if(!_0x4e24ae[_0x81b6('0x3a')][_0x81b6('0x5c')](_0x81b6('0x41'))){_0x13cc9c['limit']=qs[_0x81b6('0x23')](_0x4e24ae[_0x81b6('0x3a')][_0x81b6('0x23')]);_0x13cc9c['offset']=qs[_0x81b6('0x22')](_0x4e24ae[_0x81b6('0x3a')][_0x81b6('0x22')]);}_0x13cc9c['order']=qs[_0x81b6('0x43')](_0x4e24ae['query'][_0x81b6('0x43')]);_0x13cc9c[_0x81b6('0x44')]=qs[_0x81b6('0x3b')](_[_0x81b6('0x5d')](_0x4e24ae[_0x81b6('0x3a')],_0x5b8f79[_0x81b6('0x3b')]));_0x13cc9c[_0x81b6('0x6e')]=!![];if(_0x4e24ae['query'][_0x81b6('0x45')]){_0x13cc9c[_0x81b6('0x44')]=_[_0x81b6('0x4f')](_0x13cc9c[_0x81b6('0x44')],{'$or':_[_0x81b6('0x34')](_0x13cc9c[_0x81b6('0x3e')],function(_0x4392e4){var _0x596109={};_0x596109[_0x4392e4]={'$like':'%'+_0x4e24ae[_0x81b6('0x3a')]['filter']+'%'};return _0x596109;})});}_0x13cc9c=_['merge']({},_0x13cc9c,_0x4e24ae[_0x81b6('0x47')]);return _0x2f02b5[_0x81b6('0x6f')](_0x13cc9c);}})[_0x81b6('0x2b')](function(_0x4052c7){if(!_[_0x81b6('0x71')](_0x4052c7)){var _0x4a0925=toCsv(_0x4052c7);var _0x14c572=Date[_0x81b6('0x72')]();fs['writeFileSync'](util[_0x81b6('0x6c')](_0x81b6('0x73'),_0x2f02b5['id'],_0x14c572),_0x4a0925);_0x3c5237[_0x81b6('0x74')](_0x81b6('0x75'),'attachment;\x20filename='+util['format'](_0x81b6('0x76'),_0x2f02b5['id'],_0x14c572));_0x3c5237[_0x81b6('0x74')](_0x81b6('0x77'),_0x81b6('0x78'));return _0x3c5237[_0x81b6('0x79')](util[_0x81b6('0x6c')](_0x81b6('0x73'),_0x2f02b5['id'],_0x14c572));}else{return _0x3c5237[_0x81b6('0x1f')](0xcc);}})[_0x81b6('0x4b')](handleError(_0x3c5237,null));};exports[_0x81b6('0x7a')]=function(_0x299a92,_0x4df44c,_0xddb461){var _0x3a0a58;delete _0x299a92[_0x81b6('0x51')]['id'];return db['CmList']['findOne']({'where':{'id':_0x299a92['params']['id']}})[_0x81b6('0x2b')](handleEntityNotFound(_0x4df44c,null))[_0x81b6('0x2b')](function(_0x15c7ce){if(_0x15c7ce){return db['sequelize'][_0x81b6('0x7b')](function(_0x2d7d49){return db['CmCustomField'][_0x81b6('0x50')](_0x299a92['body'],{'transaction':_0x2d7d49})[_0x81b6('0x2b')](function(_0x5816dc){_0x3a0a58=_0x5816dc;return _0x15c7ce[_0x81b6('0x7c')](_0x5816dc,{'transaction':_0x2d7d49});})[_0x81b6('0x2b')](function(){var _0x246218={'type':db['Sequelize'][_0x81b6('0x7d')],'transaction':_0x2d7d49};switch(_0x299a92[_0x81b6('0x51')][_0x81b6('0x37')]){case'text':_0x246218[_0x81b6('0x37')]=db[_0x81b6('0x7e')][_0x81b6('0x7d')];break;case _0x81b6('0x7f'):_0x246218[_0x81b6('0x37')]=db[_0x81b6('0x7e')][_0x81b6('0x80')];break;case'switch':_0x246218[_0x81b6('0x37')]=db[_0x81b6('0x7e')][_0x81b6('0x81')];_0x246218[_0x81b6('0x82')]=![];break;default:}return db['sequelize'][_0x81b6('0x83')]['addColumn'](_0x81b6('0x84'),util['format'](_0x81b6('0x85'),_0x3a0a58['id']),_0x246218);})[_0x81b6('0x2b')](function(){return _0x3a0a58;});});}})['then'](respondWithResult(_0x4df44c,null))[_0x81b6('0x4b')](handleError(_0x4df44c,null));};exports[_0x81b6('0x86')]=function(_0x469c9e,_0x29ae75,_0x147a54){var _0x366314={};var _0xc6d5b7={};var _0x45e9c5;var _0x583229;return db['CmList'][_0x81b6('0x5a')]({'where':{'id':_0x469c9e[_0x81b6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29ae75,null))[_0x81b6('0x2b')](function(_0x16d6be){if(_0x16d6be){_0x45e9c5=_0x16d6be;_0xc6d5b7[_0x81b6('0x3d')]=_[_0x81b6('0x39')](db['CmCustomField']['rawAttributes']);_0xc6d5b7['query']=_[_0x81b6('0x39')](_0x469c9e[_0x81b6('0x3a')]);_0xc6d5b7[_0x81b6('0x3b')]=_['intersection'](_0xc6d5b7[_0x81b6('0x3d')],_0xc6d5b7[_0x81b6('0x3a')]);_0x366314[_0x81b6('0x3e')]=_[_0x81b6('0x3c')](_0xc6d5b7['model'],qs['fields'](_0x469c9e[_0x81b6('0x3a')][_0x81b6('0x3f')]));_0x366314[_0x81b6('0x3e')]=_0x366314[_0x81b6('0x3e')][_0x81b6('0x40')]?_0x366314[_0x81b6('0x3e')]:_0xc6d5b7['model'];_0x366314[_0x81b6('0x42')]=qs[_0x81b6('0x43')](_0x469c9e[_0x81b6('0x3a')][_0x81b6('0x43')]);_0x366314['where']=qs[_0x81b6('0x3b')](_['pick'](_0x469c9e[_0x81b6('0x3a')],_0xc6d5b7[_0x81b6('0x3b')]));_0x366314[_0x81b6('0x44')]=_['merge'](_0x366314['where'],{'$or':[{'ListId':_0x16d6be['id']},{'ListId':null}]});if(_0x469c9e[_0x81b6('0x3a')][_0x81b6('0x45')]){_0x366314[_0x81b6('0x44')]=_[_0x81b6('0x4f')](_0x366314['where'],{'$or':_['map'](_0x366314[_0x81b6('0x3e')],function(_0x4251e9){var _0x291c51={};_0x291c51[_0x4251e9]={'$like':'%'+_0x469c9e[_0x81b6('0x3a')][_0x81b6('0x45')]+'%'};return _0x291c51;})});}_0x366314=_[_0x81b6('0x4f')]({},_0x366314,_0x469c9e[_0x81b6('0x47')]);return db[_0x81b6('0x69')][_0x81b6('0x87')](_0x366314);}})['then'](respondWithResult(_0x29ae75,null))['catch'](handleError(_0x29ae75,null));};exports['addAgents']=function(_0x474a29,_0x55e64f,_0x1a2bc6){return db['CmList'][_0x81b6('0x53')]({'where':{'id':_0x474a29[_0x81b6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x55e64f,null))[_0x81b6('0x2b')](function(_0x2bbffb){if(_0x2bbffb){return _0x2bbffb['addAgents'](_0x474a29[_0x81b6('0x51')][_0x81b6('0x88')],_['omit'](_0x474a29[_0x81b6('0x51')],['ids','id'])||{})['spread'](function(_0x5af96a){for(var _0x1e5e1d=0x0;_0x1e5e1d<_0x474a29[_0x81b6('0x51')][_0x81b6('0x88')][_0x81b6('0x40')];_0x1e5e1d+=0x1){socket[_0x81b6('0x89')]('userCmList:save',{'UserId':Number(_0x474a29[_0x81b6('0x51')][_0x81b6('0x88')][_0x1e5e1d]),'CmListId':Number(_0x474a29[_0x81b6('0x4d')]['id'])});}return _0x5af96a;});}})[_0x81b6('0x2b')](respondWithResult(_0x55e64f,null))[_0x81b6('0x4b')](handleError(_0x55e64f,null));};exports['removeAgents']=function(_0x45f79a,_0x263beb,_0xb9d4d7){return db[_0x81b6('0x48')][_0x81b6('0x53')]({'where':{'id':_0x45f79a[_0x81b6('0x4d')]['id']}})[_0x81b6('0x2b')](handleEntityNotFound(_0x263beb,null))[_0x81b6('0x2b')](function(_0x4222fb){if(_0x4222fb){return _0x4222fb['removeAgents'](_0x45f79a['query'][_0x81b6('0x88')])[_0x81b6('0x2b')](function(){if(_[_0x81b6('0x62')](_0x45f79a['query'][_0x81b6('0x88')])){for(var _0x90f80=0x0;_0x90f80<_0x45f79a[_0x81b6('0x3a')][_0x81b6('0x88')][_0x81b6('0x40')];_0x90f80+=0x1){socket[_0x81b6('0x89')]('userCmList:remove',{'UserId':Number(_0x45f79a[_0x81b6('0x3a')][_0x81b6('0x88')][_0x90f80]),'CmListId':Number(_0x45f79a[_0x81b6('0x4d')]['id'])});}}else{socket['emit'](_0x81b6('0x8a'),{'UserId':Number(_0x45f79a[_0x81b6('0x3a')][_0x81b6('0x88')]),'CmListId':Number(_0x45f79a[_0x81b6('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x263beb,null))[_0x81b6('0x4b')](handleError(_0x263beb,null));};exports[_0x81b6('0x8b')]=function(_0x227a29,_0x14c7b5,_0x20e7b9){var _0x2086e6={};var _0x30cce0={};var _0x2fefa3;var _0x2cfb56;return db[_0x81b6('0x48')][_0x81b6('0x5a')]({'where':{'id':_0x227a29['params']['id']}})[_0x81b6('0x2b')](handleEntityNotFound(_0x14c7b5,null))[_0x81b6('0x2b')](function(_0x159822){if(_0x159822){_0x2fefa3=_0x159822;_0x30cce0[_0x81b6('0x3d')]=_[_0x81b6('0x39')](db[_0x81b6('0x8c')][_0x81b6('0x35')]);_0x30cce0[_0x81b6('0x3a')]=_[_0x81b6('0x39')](_0x227a29[_0x81b6('0x3a')]);_0x30cce0['filters']=_[_0x81b6('0x3c')](_0x30cce0['model'],_0x30cce0[_0x81b6('0x3a')]);_0x2086e6[_0x81b6('0x3e')]=_[_0x81b6('0x3c')](_0x30cce0['model'],qs['fields'](_0x227a29[_0x81b6('0x3a')]['fields']));_0x2086e6[_0x81b6('0x3e')]=_0x2086e6[_0x81b6('0x3e')]['length']?_0x2086e6[_0x81b6('0x3e')]:_0x30cce0[_0x81b6('0x3d')];_0x2086e6[_0x81b6('0x42')]=qs[_0x81b6('0x43')](_0x227a29['query']['sort']);_0x2086e6[_0x81b6('0x44')]=qs['filters'](_[_0x81b6('0x5d')](_0x227a29[_0x81b6('0x3a')],_0x30cce0[_0x81b6('0x3b')]));if(_0x227a29['query']['filter']){_0x2086e6[_0x81b6('0x44')]=_[_0x81b6('0x4f')](_0x2086e6['where'],{'$or':_[_0x81b6('0x34')](_0x2086e6[_0x81b6('0x3e')],function(_0x49ad28){var _0x235efb={};_0x235efb[_0x49ad28]={'$like':'%'+_0x227a29['query'][_0x81b6('0x45')]+'%'};return _0x235efb;})});}_0x2086e6=_[_0x81b6('0x4f')]({},_0x2086e6,_0x227a29[_0x81b6('0x47')]);return _0x2fefa3[_0x81b6('0x8b')](_0x2086e6);}})[_0x81b6('0x2b')](function(_0x3a1c52){if(_0x3a1c52){_0x2cfb56=_0x3a1c52[_0x81b6('0x40')];if(!_0x227a29[_0x81b6('0x3a')][_0x81b6('0x5c')]('nolimit')){_0x2086e6['limit']=qs[_0x81b6('0x23')](_0x227a29[_0x81b6('0x3a')][_0x81b6('0x23')]);_0x2086e6[_0x81b6('0x22')]=qs[_0x81b6('0x22')](_0x227a29[_0x81b6('0x3a')][_0x81b6('0x22')]);}return _0x2fefa3[_0x81b6('0x8b')](_0x2086e6);}})['then'](function(_0x4d9075){if(_0x4d9075){return _0x4d9075?{'count':_0x2cfb56,'rows':_0x4d9075}:null;}})[_0x81b6('0x2b')](respondWithResult(_0x14c7b5,null))[_0x81b6('0x4b')](handleError(_0x14c7b5,null));};
\ No newline at end of file
+var _0xd26c=['where','filter','merge','VIRTUAL','options','CmList','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','getDispositions','hasOwnProperty','pick','Disposition','ids','addContacts','CmContact','tags','push','each','omit','success','errors','message','json','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','cf_%d','getContacts','getContactsCsv','raw','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findOne','addAgents','spread','userCmList:save','removeAgents','isArray','userCmList:remove','emit','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','Lists','UserProfileResource','error','name','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd26c,0x180));var _0xcd26=function(_0x4afbb1,_0x296da0){_0x4afbb1=_0x4afbb1-0x0;var _0x286f39=_0xd26c[_0x4afbb1];return _0x286f39;};'use strict';var emlformat=require(_0xcd26('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd26('0x1'));var jsonpatch=require(_0xcd26('0x2'));var rp=require(_0xcd26('0x3'));var moment=require('moment');var BPromise=require(_0xcd26('0x4'));var Mustache=require(_0xcd26('0x5'));var util=require(_0xcd26('0x6'));var path=require(_0xcd26('0x7'));var sox=require(_0xcd26('0x8'));var csv=require(_0xcd26('0x9'));var ejs=require(_0xcd26('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd26('0xb'));var squel=require(_0xcd26('0xc'));var crypto=require(_0xcd26('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xcd26('0xe'));var toCsv=require(_0xcd26('0x9'));var querystring=require(_0xcd26('0xf'));var Papa=require(_0xcd26('0x10'));var Redis=require(_0xcd26('0x11'));var authService=require(_0xcd26('0x12'));var qs=require(_0xcd26('0x13'));var as=require(_0xcd26('0x14'));var hardwareService=require(_0xcd26('0x15'));var logger=require(_0xcd26('0x16'))(_0xcd26('0x17'));var utils=require('../../config/utils');var config=require(_0xcd26('0x18'));var licenseUtil=require(_0xcd26('0x19'));var db=require(_0xcd26('0x1a'))['db'];config[_0xcd26('0x1b')]=_['defaults'](config['redis'],{'host':_0xcd26('0x1c'),'port':0x18eb});var socket=require(_0xcd26('0x1d'))(new Redis(config['redis']));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x206859,_0xefbc52){_0xefbc52=_0xefbc52||0xcc;return function(_0xb135b1){if(_0xb135b1){return _0x206859[_0xcd26('0x1e')](_0xefbc52);}return _0x206859['status'](_0xefbc52)[_0xcd26('0x1f')]();};}function respondWithResult(_0x4ccd83,_0x62a0f7){_0x62a0f7=_0x62a0f7||0xc8;return function(_0x4887c9){if(_0x4887c9){return _0x4ccd83[_0xcd26('0x20')](_0x62a0f7)['json'](_0x4887c9);}};}function respondWithFilteredResult(_0x30483d,_0x896a4f){return function(_0x23f45f){if(_0x23f45f){var _0x370ad8=typeof _0x896a4f[_0xcd26('0x21')]===_0xcd26('0x22')&&typeof _0x896a4f[_0xcd26('0x23')]===_0xcd26('0x22');var _0x1ba2d8=_0x23f45f[_0xcd26('0x24')];var _0xe6f375=_0x370ad8?0x0:_0x896a4f[_0xcd26('0x21')];var _0x327910=_0x370ad8?_0x23f45f[_0xcd26('0x24')]:_0x896a4f[_0xcd26('0x21')]+_0x896a4f[_0xcd26('0x23')];var _0x4ce819;if(_0x327910>=_0x1ba2d8){_0x327910=_0x1ba2d8;_0x4ce819=0xc8;}else{_0x4ce819=0xce;}_0x30483d[_0xcd26('0x20')](_0x4ce819);return _0x30483d[_0xcd26('0x25')](_0xcd26('0x26'),_0xe6f375+'-'+_0x327910+'/'+_0x1ba2d8)['json'](_0x23f45f);}return null;};}function patchUpdates(_0x471a10){return function(_0x52d8fe){try{jsonpatch[_0xcd26('0x27')](_0x52d8fe,_0x471a10,!![]);}catch(_0x2ab1d9){return BPromise[_0xcd26('0x28')](_0x2ab1d9);}return _0x52d8fe[_0xcd26('0x29')]();};}function saveUpdates(_0x3ec439,_0x89f429){return function(_0x226b59){if(_0x226b59){return _0x226b59['update'](_0x3ec439)[_0xcd26('0x2a')](function(_0x531669){return _0x531669;});}return null;};}function removeEntity(_0x40677b,_0x51c368){return function(_0x2b21ff){if(_0x2b21ff){return _0x2b21ff[_0xcd26('0x2b')]()['then'](function(){var _0x3d0357=_0x2b21ff[_0xcd26('0x2c')]({'plain':!![]});var _0x5a70a6=_0xcd26('0x2d');return db[_0xcd26('0x2e')]['destroy']({'where':{'type':_0x5a70a6,'resourceId':_0x3d0357['id']}})[_0xcd26('0x2a')](function(){return _0x2b21ff;});})[_0xcd26('0x2a')](function(){_0x40677b['status'](0xcc)[_0xcd26('0x1f')]();});}};}function handleEntityNotFound(_0x5ab61d,_0x4d21a6){return function(_0x1e1d87){if(!_0x1e1d87){_0x5ab61d['sendStatus'](0x194);}return _0x1e1d87;};}function handleError(_0x1628eb,_0x5313ae){_0x5313ae=_0x5313ae||0x1f4;return function(_0x58e353){logger[_0xcd26('0x2f')](_0x58e353['stack']);if(_0x58e353[_0xcd26('0x30')]){delete _0x58e353[_0xcd26('0x30')];}_0x1628eb[_0xcd26('0x20')](_0x5313ae)['send'](_0x58e353);};}exports[_0xcd26('0x31')]=function(_0x595eee,_0x1f9e74){var _0x18d268={},_0x52e7ae={},_0x8ac8b1={'count':0x0,'rows':[]};var _0x2acf63=_[_0xcd26('0x32')](db['CmList'][_0xcd26('0x33')],function(_0x49589b){return{'name':_0x49589b[_0xcd26('0x34')],'type':_0x49589b[_0xcd26('0x35')][_0xcd26('0x36')]};});_0x52e7ae['model']=_['map'](_0x2acf63,'name');_0x52e7ae['query']=_[_0xcd26('0x37')](_0x595eee[_0xcd26('0x38')]);_0x52e7ae[_0xcd26('0x39')]=_[_0xcd26('0x3a')](_0x52e7ae[_0xcd26('0x3b')],_0x52e7ae[_0xcd26('0x38')]);_0x18d268[_0xcd26('0x3c')]=_[_0xcd26('0x3a')](_0x52e7ae[_0xcd26('0x3b')],qs[_0xcd26('0x3d')](_0x595eee['query'][_0xcd26('0x3d')]));_0x18d268['attributes']=_0x18d268[_0xcd26('0x3c')][_0xcd26('0x3e')]?_0x18d268[_0xcd26('0x3c')]:_0x52e7ae[_0xcd26('0x3b')];if(!_0x595eee[_0xcd26('0x38')]['hasOwnProperty'](_0xcd26('0x3f'))){_0x18d268[_0xcd26('0x23')]=qs[_0xcd26('0x23')](_0x595eee['query'][_0xcd26('0x23')]);_0x18d268[_0xcd26('0x21')]=qs['offset'](_0x595eee[_0xcd26('0x38')][_0xcd26('0x21')]);}_0x18d268[_0xcd26('0x40')]=qs[_0xcd26('0x41')](_0x595eee[_0xcd26('0x38')]['sort']);_0x18d268[_0xcd26('0x42')]=qs[_0xcd26('0x39')](_['pick'](_0x595eee['query'],_0x52e7ae['filters']),_0x2acf63);if(_0x595eee['query'][_0xcd26('0x43')]){_0x18d268[_0xcd26('0x42')]=_[_0xcd26('0x44')](_0x18d268[_0xcd26('0x42')],{'$or':_[_0xcd26('0x32')](_0x2acf63,function(_0x38f6a1){if(_0x38f6a1[_0xcd26('0x35')]!==_0xcd26('0x45')){var _0x2d04d8={};_0x2d04d8[_0x38f6a1[_0xcd26('0x30')]]={'$like':'%'+_0x595eee[_0xcd26('0x38')][_0xcd26('0x43')]+'%'};return _0x2d04d8;}})});}_0x18d268=_['merge']({},_0x18d268,_0x595eee[_0xcd26('0x46')]);var _0x3d1c4a={'where':_0x18d268[_0xcd26('0x42')]};return db[_0xcd26('0x47')][_0xcd26('0x24')](_0x3d1c4a)[_0xcd26('0x2a')](function(_0xaefc5){_0x8ac8b1[_0xcd26('0x24')]=_0xaefc5;if(_0x595eee[_0xcd26('0x38')][_0xcd26('0x48')]){_0x18d268[_0xcd26('0x49')]=[{'all':!![]}];}return db[_0xcd26('0x47')][_0xcd26('0x4a')](_0x18d268);})[_0xcd26('0x2a')](function(_0x1c62d7){_0x8ac8b1[_0xcd26('0x4b')]=_0x1c62d7;return _0x8ac8b1;})[_0xcd26('0x2a')](respondWithFilteredResult(_0x1f9e74,_0x18d268))[_0xcd26('0x4c')](handleError(_0x1f9e74,null));};exports[_0xcd26('0x4d')]=function(_0x1ec16a,_0x4afa71){var _0x259df2={'raw':![],'where':{'id':_0x1ec16a[_0xcd26('0x4e')]['id']}},_0x28ec83={};_0x28ec83[_0xcd26('0x3b')]=_[_0xcd26('0x37')](db[_0xcd26('0x47')][_0xcd26('0x33')]);_0x28ec83['query']=_[_0xcd26('0x37')](_0x1ec16a[_0xcd26('0x38')]);_0x28ec83[_0xcd26('0x39')]=_[_0xcd26('0x3a')](_0x28ec83[_0xcd26('0x3b')],_0x28ec83[_0xcd26('0x38')]);_0x259df2[_0xcd26('0x3c')]=_[_0xcd26('0x3a')](_0x28ec83[_0xcd26('0x3b')],qs[_0xcd26('0x3d')](_0x1ec16a[_0xcd26('0x38')][_0xcd26('0x3d')]));_0x259df2['attributes']=_0x259df2[_0xcd26('0x3c')]['length']?_0x259df2[_0xcd26('0x3c')]:_0x28ec83['model'];if(_0x1ec16a[_0xcd26('0x38')][_0xcd26('0x48')]){_0x259df2[_0xcd26('0x49')]=[{'all':!![]}];}_0x259df2=_[_0xcd26('0x44')]({},_0x259df2,_0x1ec16a[_0xcd26('0x46')]);return db[_0xcd26('0x47')][_0xcd26('0x4f')](_0x259df2)[_0xcd26('0x2a')](handleEntityNotFound(_0x4afa71,null))[_0xcd26('0x2a')](respondWithResult(_0x4afa71,null))[_0xcd26('0x4c')](handleError(_0x4afa71,null));};exports[_0xcd26('0x50')]=function(_0x1aab6f,_0x20b10e){return db[_0xcd26('0x47')][_0xcd26('0x50')](_0x1aab6f[_0xcd26('0x51')],{})[_0xcd26('0x2a')](function(_0x4f88cd){var _0x48b565=_0x1aab6f[_0xcd26('0x52')][_0xcd26('0x2c')]({'plain':!![]});if(!_0x48b565)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x48b565[_0xcd26('0x53')]===_0xcd26('0x52')){var _0x56c62b=_0x4f88cd[_0xcd26('0x2c')]({'plain':!![]});var _0x4c5055='Lists';return db[_0xcd26('0x54')][_0xcd26('0x4f')]({'where':{'name':_0x4c5055,'userProfileId':_0x48b565['userProfileId']},'raw':!![]})[_0xcd26('0x2a')](function(_0x3f05dd){if(_0x3f05dd&&_0x3f05dd[_0xcd26('0x55')]===0x0){return db[_0xcd26('0x2e')][_0xcd26('0x50')]({'name':_0x56c62b[_0xcd26('0x30')],'resourceId':_0x56c62b['id'],'type':_0x3f05dd[_0xcd26('0x30')],'sectionId':_0x3f05dd['id']},{})[_0xcd26('0x2a')](function(){return _0x4f88cd;});}else{return _0x4f88cd;}})[_0xcd26('0x4c')](function(_0x2473f7){logger[_0xcd26('0x2f')](_0xcd26('0x56'),_0x2473f7);throw _0x2473f7;});}return _0x4f88cd;})['then'](respondWithResult(_0x20b10e,0xc9))['catch'](handleError(_0x20b10e,null));};exports[_0xcd26('0x57')]=function(_0x29642d,_0x552481){if(_0x29642d[_0xcd26('0x51')]['id']){delete _0x29642d[_0xcd26('0x51')]['id'];}return db['CmList'][_0xcd26('0x4f')]({'where':{'id':_0x29642d[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x552481,null))[_0xcd26('0x2a')](saveUpdates(_0x29642d[_0xcd26('0x51')],null))[_0xcd26('0x2a')](respondWithResult(_0x552481,null))[_0xcd26('0x4c')](handleError(_0x552481,null));};exports[_0xcd26('0x2b')]=function(_0x360a23,_0x5a59aa){return db[_0xcd26('0x47')]['find']({'where':{'id':_0x360a23[_0xcd26('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5a59aa,null))[_0xcd26('0x2a')](removeEntity(_0x5a59aa,null))[_0xcd26('0x4c')](handleError(_0x5a59aa,null));};exports[_0xcd26('0x58')]=function(_0x33f556,_0x500ffa){return db['CmList']['describe']()['then'](respondWithResult(_0x500ffa,null))['catch'](handleError(_0x500ffa,null));};exports[_0xcd26('0x59')]=function(_0x38d809,_0x58a9e4,_0x29d3cb){if(_0x38d809[_0xcd26('0x51')]['id']){delete _0x38d809[_0xcd26('0x51')]['id'];}return db[_0xcd26('0x47')][_0xcd26('0x4f')]({'where':{'id':_0x38d809[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x58a9e4,null))[_0xcd26('0x2a')](function(_0x4c9896){if(_0x4c9896){_0x38d809[_0xcd26('0x51')][_0xcd26('0x5a')]=_0x4c9896['id'];return db['Disposition'][_0xcd26('0x50')](_0x38d809['body']);}})[_0xcd26('0x2a')](respondWithResult(_0x58a9e4,null))[_0xcd26('0x4c')](handleError(_0x58a9e4,null));};exports[_0xcd26('0x5b')]=function(_0x396cc3,_0x39a8e9,_0xe2f677){var _0x28df7e={'raw':![],'where':{}};var _0x370bca={};var _0x2b1082={'count':0x0,'rows':[]};return db[_0xcd26('0x47')]['findOne']({'where':{'id':_0x396cc3['params']['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x39a8e9,null))[_0xcd26('0x2a')](function(_0x31dd19){if(_0x31dd19){_0x370bca[_0xcd26('0x3b')]=_[_0xcd26('0x37')](db['Disposition'][_0xcd26('0x33')]);_0x370bca[_0xcd26('0x38')]=_[_0xcd26('0x37')](_0x396cc3[_0xcd26('0x38')]);_0x370bca['filters']=_[_0xcd26('0x3a')](_0x370bca[_0xcd26('0x3b')],_0x370bca['query']);_0x28df7e[_0xcd26('0x3c')]=_['intersection'](_0x370bca['model'],qs[_0xcd26('0x3d')](_0x396cc3[_0xcd26('0x38')][_0xcd26('0x3d')]));_0x28df7e['attributes']=_0x28df7e[_0xcd26('0x3c')][_0xcd26('0x3e')]?_0x28df7e[_0xcd26('0x3c')]:_0x370bca['model'];if(!_0x396cc3[_0xcd26('0x38')][_0xcd26('0x5c')](_0xcd26('0x3f'))){_0x28df7e[_0xcd26('0x23')]=qs[_0xcd26('0x23')](_0x396cc3[_0xcd26('0x38')]['limit']);_0x28df7e['offset']=qs[_0xcd26('0x21')](_0x396cc3[_0xcd26('0x38')]['offset']);}_0x28df7e[_0xcd26('0x40')]=qs[_0xcd26('0x41')](_0x396cc3[_0xcd26('0x38')]['sort']);_0x28df7e[_0xcd26('0x42')]=qs[_0xcd26('0x39')](_[_0xcd26('0x5d')](_0x396cc3[_0xcd26('0x38')],_0x370bca[_0xcd26('0x39')]));_0x28df7e[_0xcd26('0x42')]['ListId']=_0x31dd19['id'];if(_0x396cc3[_0xcd26('0x38')][_0xcd26('0x43')]){_0x28df7e['where']=_[_0xcd26('0x44')](_0x28df7e[_0xcd26('0x42')],{'$or':_['map'](_0x28df7e['attributes'],function(_0x58c3fc){var _0x3f7728={};_0x3f7728[_0x58c3fc]={'$like':'%'+_0x396cc3['query'][_0xcd26('0x43')]+'%'};return _0x3f7728;})});}_0x28df7e=_[_0xcd26('0x44')]({},_0x28df7e,_0x396cc3[_0xcd26('0x46')]);return db[_0xcd26('0x5e')][_0xcd26('0x24')]({'where':_0x28df7e[_0xcd26('0x42')]})[_0xcd26('0x2a')](function(_0x3cf5bf){_0x2b1082[_0xcd26('0x24')]=_0x3cf5bf;if(_0x396cc3[_0xcd26('0x38')]['includeAll']){_0x28df7e[_0xcd26('0x49')]=[{'all':!![]}];}return db[_0xcd26('0x5e')][_0xcd26('0x4a')](_0x28df7e);})['then'](function(_0x57bd82){_0x2b1082[_0xcd26('0x4b')]=_0x57bd82;return _0x2b1082;});}})[_0xcd26('0x2a')](respondWithFilteredResult(_0x39a8e9,_0x28df7e))[_0xcd26('0x4c')](handleError(_0x39a8e9,null));};exports['removeDispositions']=function(_0xde7094,_0x3b66ac,_0x46446b){return db[_0xcd26('0x47')][_0xcd26('0x4f')]({'where':{'id':_0xde7094[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x3b66ac,null))['then'](function(_0x4860d6){if(_0x4860d6){return _0x4860d6['removeDispositions'](_0xde7094[_0xcd26('0x38')][_0xcd26('0x5f')]);}})[_0xcd26('0x2a')](respondWithStatusCode(_0x3b66ac,null))[_0xcd26('0x4c')](handleError(_0x3b66ac,null));};exports[_0xcd26('0x60')]=function(_0xeb0a23,_0x287738,_0x8532db){return db[_0xcd26('0x47')][_0xcd26('0x4f')]({'where':{'id':_0xeb0a23[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x287738,null))[_0xcd26('0x2a')](function(_0x5b56f6){if(_0x5b56f6){var _0xf1448d=[];var _0x2e0498={'success':[],'errors':[]};return db[_0xcd26('0x61')][_0xcd26('0x58')]()[_0xcd26('0x2a')](function(_0x1bcc39){if(_0xeb0a23[_0xcd26('0x51')]['tags']&&_['isArray'](_0xeb0a23[_0xcd26('0x51')]['tags'])){if(_0xeb0a23[_0xcd26('0x51')][_0xcd26('0x62')][_0xcd26('0x3e')]){_0xeb0a23[_0xcd26('0x51')][_0xcd26('0x62')]=_0xeb0a23['body']['tags']['join'](';')+';';}else{_0xeb0a23[_0xcd26('0x51')][_0xcd26('0x62')]=null;}}else{_0xeb0a23['body'][_0xcd26('0x62')]=null;}if(_0xeb0a23[_0xcd26('0x51')]&&_['isArray'](_0xeb0a23[_0xcd26('0x51')])){for(var _0x45fd54=0x0;_0x45fd54<_0xeb0a23[_0xcd26('0x51')]['length'];_0x45fd54+=0x1){_0xeb0a23[_0xcd26('0x51')][_0x45fd54][_0xcd26('0x5a')]=_0xeb0a23['params']['id'];_0xf1448d[_0xcd26('0x63')](_0xeb0a23[_0xcd26('0x51')][_0x45fd54]);}return BPromise[_0xcd26('0x64')](_0xf1448d,function(_0x4409c5){return db['CmContact']['create'](_[_0xcd26('0x65')](_0x4409c5,[_0xcd26('0x5f'),'id'])||{},{'fields':_[_0xcd26('0x37')](_0x1bcc39),'raw':!![]})['then'](function(_0x15e15d){_0x2e0498[_0xcd26('0x66')][_0xcd26('0x63')](_0x15e15d['dataValues']);})['catch'](function(_0x4a2a0e){_0x2e0498[_0xcd26('0x67')][_0xcd26('0x63')]({'data':_0x4409c5,'error':_0x4a2a0e[_0xcd26('0x68')]});});})['then'](function(_0x23665e){return _0x2e0498;})['catch'](function(_0x4bf87d){return _0x4bf87d;});}else{_0x287738[_0xcd26('0x20')](0x190)[_0xcd26('0x69')]({'message':_0xcd26('0x6a')});}});}})['then'](respondWithResult(_0x287738,null))[_0xcd26('0x4c')](handleError(_0x287738,null));};exports['getContacts']=function(_0x5d9da1,_0xc26746,_0xb812fc){var _0x3cce34;return db[_0xcd26('0x47')][_0xcd26('0x4f')]({'where':{'id':_0x5d9da1[_0xcd26('0x4e')]['id']},'include':[{'model':db[_0xcd26('0x6b')],'as':_0xcd26('0x6c')}]})['then'](handleEntityNotFound(_0xc26746,null))[_0xcd26('0x2a')](function(_0x415a92){if(_0x415a92){_0x3cce34=_0x415a92;return db['CmContact'][_0xcd26('0x33')];}})[_0xcd26('0x2a')](function(_0x5b9a8a){if(_0x5b9a8a){var _0x3e483b={};var _0x5f186f={};_0x5f186f[_0xcd26('0x3b')]=_[_0xcd26('0x6d')](_[_0xcd26('0x37')](_0x5b9a8a),_[_0xcd26('0x32')](_0x3cce34[_0xcd26('0x6c')],function(_0xc49c4e){return util[_0xcd26('0x6e')](_0xcd26('0x6f'),_0xc49c4e['id']);}));_0x5f186f[_0xcd26('0x38')]=_[_0xcd26('0x37')](_0x5d9da1[_0xcd26('0x38')]);_0x5f186f[_0xcd26('0x39')]=_[_0xcd26('0x3a')](_0x5f186f['model'],_0x5f186f['query']);_0x3e483b[_0xcd26('0x3c')]=_[_0xcd26('0x3a')](_0x5f186f[_0xcd26('0x3b')],qs['fields'](_0x5d9da1[_0xcd26('0x38')][_0xcd26('0x3d')]));_0x3e483b[_0xcd26('0x3c')]=_0x3e483b[_0xcd26('0x3c')][_0xcd26('0x3e')]?_0x3e483b['attributes']:_0x5f186f['model'];if(!_0x5d9da1[_0xcd26('0x38')][_0xcd26('0x5c')](_0xcd26('0x3f'))){_0x3e483b[_0xcd26('0x23')]=qs[_0xcd26('0x23')](_0x5d9da1[_0xcd26('0x38')]['limit']);_0x3e483b[_0xcd26('0x21')]=qs[_0xcd26('0x21')](_0x5d9da1[_0xcd26('0x38')][_0xcd26('0x21')]);}_0x3e483b[_0xcd26('0x40')]=qs[_0xcd26('0x41')](_0x5d9da1[_0xcd26('0x38')]['sort']);_0x3e483b[_0xcd26('0x42')]=qs[_0xcd26('0x39')](_[_0xcd26('0x5d')](_0x5d9da1[_0xcd26('0x38')],_0x5f186f[_0xcd26('0x39')]));_0x3e483b['raw']=!![];if(_0x5d9da1[_0xcd26('0x38')][_0xcd26('0x43')]){_0x3e483b[_0xcd26('0x42')]=_[_0xcd26('0x44')](_0x3e483b[_0xcd26('0x42')],{'$or':_['map'](_0x3e483b[_0xcd26('0x3c')],function(_0x1d28bb){var _0x1854f1={};_0x1854f1[_0x1d28bb]={'$like':'%'+_0x5d9da1[_0xcd26('0x38')][_0xcd26('0x43')]+'%'};return _0x1854f1;})});}_0x3e483b=_[_0xcd26('0x44')]({},_0x3e483b,_0x5d9da1[_0xcd26('0x46')]);return _0x3cce34[_0xcd26('0x70')](_0x3e483b);}})['then'](respondWithResult(_0xc26746,null))[_0xcd26('0x4c')](handleError(_0xc26746,null));};exports[_0xcd26('0x71')]=function(_0x4d2093,_0x44ccce,_0x84753f){var _0x549ee5;return db[_0xcd26('0x47')]['find']({'where':{'id':_0x4d2093[_0xcd26('0x4e')]['id']},'include':[{'model':db[_0xcd26('0x6b')],'as':_0xcd26('0x6c')}]})[_0xcd26('0x2a')](handleEntityNotFound(_0x44ccce,null))[_0xcd26('0x2a')](function(_0x36b981){if(_0x36b981){_0x549ee5=_0x36b981;return db[_0xcd26('0x61')][_0xcd26('0x33')];}})[_0xcd26('0x2a')](function(_0x5d9038){if(_0x5d9038){var _0x2006c1={};var _0x388550={};_0x388550[_0xcd26('0x3b')]=_[_0xcd26('0x6d')](_[_0xcd26('0x37')](_0x5d9038),_[_0xcd26('0x32')](_0x549ee5[_0xcd26('0x6c')],function(_0x28999a){return util[_0xcd26('0x6e')](_0xcd26('0x6f'),_0x28999a['id']);}));_0x388550[_0xcd26('0x38')]=_['keys'](_0x4d2093['query']);_0x388550[_0xcd26('0x39')]=_[_0xcd26('0x3a')](_0x388550['model'],_0x388550[_0xcd26('0x38')]);_0x2006c1[_0xcd26('0x3c')]=_[_0xcd26('0x3a')](_0x388550[_0xcd26('0x3b')],qs['fields'](_0x4d2093['query'][_0xcd26('0x3d')]));_0x2006c1[_0xcd26('0x3c')]=_0x2006c1['attributes'][_0xcd26('0x3e')]?_0x2006c1[_0xcd26('0x3c')]:_0x388550[_0xcd26('0x3b')];if(!_0x4d2093[_0xcd26('0x38')][_0xcd26('0x5c')](_0xcd26('0x3f'))){_0x2006c1[_0xcd26('0x23')]=qs[_0xcd26('0x23')](_0x4d2093[_0xcd26('0x38')][_0xcd26('0x23')]);_0x2006c1[_0xcd26('0x21')]=qs['offset'](_0x4d2093[_0xcd26('0x38')][_0xcd26('0x21')]);}_0x2006c1['order']=qs[_0xcd26('0x41')](_0x4d2093['query'][_0xcd26('0x41')]);_0x2006c1[_0xcd26('0x42')]=qs[_0xcd26('0x39')](_[_0xcd26('0x5d')](_0x4d2093[_0xcd26('0x38')],_0x388550[_0xcd26('0x39')]));_0x2006c1[_0xcd26('0x72')]=!![];if(_0x4d2093[_0xcd26('0x38')]['filter']){_0x2006c1[_0xcd26('0x42')]=_[_0xcd26('0x44')](_0x2006c1[_0xcd26('0x42')],{'$or':_[_0xcd26('0x32')](_0x2006c1[_0xcd26('0x3c')],function(_0x592b95){var _0x451048={};_0x451048[_0x592b95]={'$like':'%'+_0x4d2093['query']['filter']+'%'};return _0x451048;})});}_0x2006c1=_['merge']({},_0x2006c1,_0x4d2093[_0xcd26('0x46')]);return _0x549ee5['getContacts'](_0x2006c1);}})['then'](function(_0x405767){if(!_[_0xcd26('0x73')](_0x405767)){var _0x58e249=toCsv(_0x405767);var _0x2f0e74=Date[_0xcd26('0x74')]();fs[_0xcd26('0x75')](util['format']('/tmp/list_%d_%s.csv',_0x549ee5['id'],_0x2f0e74),_0x58e249);_0x44ccce[_0xcd26('0x76')]('Content-disposition',_0xcd26('0x77')+util[_0xcd26('0x6e')](_0xcd26('0x78'),_0x549ee5['id'],_0x2f0e74));_0x44ccce[_0xcd26('0x76')](_0xcd26('0x79'),_0xcd26('0x7a'));return _0x44ccce[_0xcd26('0x7b')](util[_0xcd26('0x6e')](_0xcd26('0x7c'),_0x549ee5['id'],_0x2f0e74));}else{return _0x44ccce[_0xcd26('0x1e')](0xcc);}})['catch'](handleError(_0x44ccce,null));};exports[_0xcd26('0x7d')]=function(_0x3f3df8,_0x358506,_0x27df51){var _0x12d61f;delete _0x3f3df8[_0xcd26('0x51')]['id'];return db[_0xcd26('0x47')]['findOne']({'where':{'id':_0x3f3df8[_0xcd26('0x4e')]['id']}})['then'](handleEntityNotFound(_0x358506,null))[_0xcd26('0x2a')](function(_0x28f3ef){if(_0x28f3ef){return db[_0xcd26('0x7e')][_0xcd26('0x7f')](function(_0x48fcd0){return db[_0xcd26('0x6b')][_0xcd26('0x50')](_0x3f3df8[_0xcd26('0x51')],{'transaction':_0x48fcd0})[_0xcd26('0x2a')](function(_0x24a4e6){_0x12d61f=_0x24a4e6;return _0x28f3ef[_0xcd26('0x80')](_0x24a4e6,{'transaction':_0x48fcd0});})[_0xcd26('0x2a')](function(){var _0x367691={'type':db[_0xcd26('0x81')][_0xcd26('0x82')],'transaction':_0x48fcd0};switch(_0x3f3df8['body']['type']){case _0xcd26('0x83'):_0x367691['type']=db[_0xcd26('0x81')][_0xcd26('0x82')];break;case _0xcd26('0x84'):_0x367691[_0xcd26('0x35')]=db[_0xcd26('0x81')][_0xcd26('0x85')];break;case _0xcd26('0x86'):_0x367691[_0xcd26('0x35')]=db['Sequelize'][_0xcd26('0x87')];_0x367691[_0xcd26('0x88')]=![];break;default:}return db[_0xcd26('0x7e')]['queryInterface'][_0xcd26('0x89')](_0xcd26('0x8a'),util[_0xcd26('0x6e')](_0xcd26('0x8b'),_0x12d61f['id']),_0x367691);})[_0xcd26('0x2a')](function(){return _0x12d61f;});});}})[_0xcd26('0x2a')](respondWithResult(_0x358506,null))[_0xcd26('0x4c')](handleError(_0x358506,null));};exports[_0xcd26('0x8c')]=function(_0x388dd9,_0x40d0e2,_0x526646){var _0x575470={};var _0x2b2481={};var _0x19c45e;var _0x2f5652;return db[_0xcd26('0x47')][_0xcd26('0x8d')]({'where':{'id':_0x388dd9[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x40d0e2,null))[_0xcd26('0x2a')](function(_0x4f4134){if(_0x4f4134){_0x19c45e=_0x4f4134;_0x2b2481[_0xcd26('0x3b')]=_[_0xcd26('0x37')](db['CmCustomField']['rawAttributes']);_0x2b2481[_0xcd26('0x38')]=_[_0xcd26('0x37')](_0x388dd9['query']);_0x2b2481['filters']=_['intersection'](_0x2b2481[_0xcd26('0x3b')],_0x2b2481[_0xcd26('0x38')]);_0x575470[_0xcd26('0x3c')]=_[_0xcd26('0x3a')](_0x2b2481['model'],qs[_0xcd26('0x3d')](_0x388dd9[_0xcd26('0x38')][_0xcd26('0x3d')]));_0x575470['attributes']=_0x575470[_0xcd26('0x3c')][_0xcd26('0x3e')]?_0x575470[_0xcd26('0x3c')]:_0x2b2481[_0xcd26('0x3b')];_0x575470['order']=qs[_0xcd26('0x41')](_0x388dd9[_0xcd26('0x38')][_0xcd26('0x41')]);_0x575470[_0xcd26('0x42')]=qs['filters'](_[_0xcd26('0x5d')](_0x388dd9['query'],_0x2b2481[_0xcd26('0x39')]));_0x575470[_0xcd26('0x42')]=_['merge'](_0x575470[_0xcd26('0x42')],{'$or':[{'ListId':_0x4f4134['id']},{'ListId':null}]});if(_0x388dd9[_0xcd26('0x38')][_0xcd26('0x43')]){_0x575470['where']=_[_0xcd26('0x44')](_0x575470[_0xcd26('0x42')],{'$or':_['map'](_0x575470[_0xcd26('0x3c')],function(_0x57c874){var _0x28f0a0={};_0x28f0a0[_0x57c874]={'$like':'%'+_0x388dd9['query'][_0xcd26('0x43')]+'%'};return _0x28f0a0;})});}_0x575470=_[_0xcd26('0x44')]({},_0x575470,_0x388dd9['options']);return db[_0xcd26('0x6b')]['findAndCountAll'](_0x575470);}})[_0xcd26('0x2a')](respondWithResult(_0x40d0e2,null))['catch'](handleError(_0x40d0e2,null));};exports[_0xcd26('0x8e')]=function(_0x5b1b58,_0x33f163,_0x3249d8){return db[_0xcd26('0x47')][_0xcd26('0x4f')]({'where':{'id':_0x5b1b58[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x33f163,null))[_0xcd26('0x2a')](function(_0x31923f){if(_0x31923f){return _0x31923f[_0xcd26('0x8e')](_0x5b1b58[_0xcd26('0x51')][_0xcd26('0x5f')],_[_0xcd26('0x65')](_0x5b1b58[_0xcd26('0x51')],[_0xcd26('0x5f'),'id'])||{})[_0xcd26('0x8f')](function(_0x386dff){for(var _0xd1b444=0x0;_0xd1b444<_0x5b1b58[_0xcd26('0x51')][_0xcd26('0x5f')][_0xcd26('0x3e')];_0xd1b444+=0x1){socket['emit'](_0xcd26('0x90'),{'UserId':Number(_0x5b1b58[_0xcd26('0x51')]['ids'][_0xd1b444]),'CmListId':Number(_0x5b1b58[_0xcd26('0x4e')]['id'])});}return _0x386dff;});}})[_0xcd26('0x2a')](respondWithResult(_0x33f163,null))[_0xcd26('0x4c')](handleError(_0x33f163,null));};exports['removeAgents']=function(_0x2f14b0,_0x309137,_0x5cd722){return db['CmList'][_0xcd26('0x4f')]({'where':{'id':_0x2f14b0[_0xcd26('0x4e')]['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x309137,null))[_0xcd26('0x2a')](function(_0x20f4c5){if(_0x20f4c5){return _0x20f4c5[_0xcd26('0x91')](_0x2f14b0[_0xcd26('0x38')][_0xcd26('0x5f')])[_0xcd26('0x2a')](function(){if(_[_0xcd26('0x92')](_0x2f14b0['query'][_0xcd26('0x5f')])){for(var _0x3fc1c6=0x0;_0x3fc1c6<_0x2f14b0['query'][_0xcd26('0x5f')]['length'];_0x3fc1c6+=0x1){socket['emit'](_0xcd26('0x93'),{'UserId':Number(_0x2f14b0[_0xcd26('0x38')][_0xcd26('0x5f')][_0x3fc1c6]),'CmListId':Number(_0x2f14b0[_0xcd26('0x4e')]['id'])});}}else{socket[_0xcd26('0x94')](_0xcd26('0x93'),{'UserId':Number(_0x2f14b0['query'][_0xcd26('0x5f')]),'CmListId':Number(_0x2f14b0['params']['id'])});}});}})[_0xcd26('0x2a')](respondWithStatusCode(_0x309137,null))[_0xcd26('0x4c')](handleError(_0x309137,null));};exports[_0xcd26('0x95')]=function(_0x2dd01e,_0x4d7df5,_0x565397){var _0x2758de={};var _0x4aa32b={};var _0x5a9a3c;var _0x121a18;return db[_0xcd26('0x47')]['findOne']({'where':{'id':_0x2dd01e['params']['id']}})[_0xcd26('0x2a')](handleEntityNotFound(_0x4d7df5,null))['then'](function(_0x3105ec){if(_0x3105ec){_0x5a9a3c=_0x3105ec;_0x4aa32b[_0xcd26('0x3b')]=_[_0xcd26('0x37')](db['User'][_0xcd26('0x33')]);_0x4aa32b[_0xcd26('0x38')]=_[_0xcd26('0x37')](_0x2dd01e[_0xcd26('0x38')]);_0x4aa32b[_0xcd26('0x39')]=_[_0xcd26('0x3a')](_0x4aa32b[_0xcd26('0x3b')],_0x4aa32b[_0xcd26('0x38')]);_0x2758de['attributes']=_[_0xcd26('0x3a')](_0x4aa32b[_0xcd26('0x3b')],qs[_0xcd26('0x3d')](_0x2dd01e['query'][_0xcd26('0x3d')]));_0x2758de[_0xcd26('0x3c')]=_0x2758de[_0xcd26('0x3c')]['length']?_0x2758de[_0xcd26('0x3c')]:_0x4aa32b[_0xcd26('0x3b')];_0x2758de[_0xcd26('0x40')]=qs[_0xcd26('0x41')](_0x2dd01e[_0xcd26('0x38')][_0xcd26('0x41')]);_0x2758de['where']=qs[_0xcd26('0x39')](_[_0xcd26('0x5d')](_0x2dd01e['query'],_0x4aa32b[_0xcd26('0x39')]));if(_0x2dd01e[_0xcd26('0x38')][_0xcd26('0x43')]){_0x2758de[_0xcd26('0x42')]=_[_0xcd26('0x44')](_0x2758de[_0xcd26('0x42')],{'$or':_['map'](_0x2758de['attributes'],function(_0x42352e){var _0x1ae035={};_0x1ae035[_0x42352e]={'$like':'%'+_0x2dd01e[_0xcd26('0x38')][_0xcd26('0x43')]+'%'};return _0x1ae035;})});}_0x2758de=_[_0xcd26('0x44')]({},_0x2758de,_0x2dd01e[_0xcd26('0x46')]);return _0x5a9a3c[_0xcd26('0x95')](_0x2758de);}})[_0xcd26('0x2a')](function(_0x32ce09){if(_0x32ce09){_0x121a18=_0x32ce09[_0xcd26('0x3e')];if(!_0x2dd01e[_0xcd26('0x38')][_0xcd26('0x5c')](_0xcd26('0x3f'))){_0x2758de[_0xcd26('0x23')]=qs['limit'](_0x2dd01e['query']['limit']);_0x2758de[_0xcd26('0x21')]=qs[_0xcd26('0x21')](_0x2dd01e[_0xcd26('0x38')][_0xcd26('0x21')]);}return _0x5a9a3c['getAgents'](_0x2758de);}})[_0xcd26('0x2a')](function(_0x49e37a){if(_0x49e37a){return _0x49e37a?{'count':_0x121a18,'rows':_0x49e37a}:null;}})['then'](respondWithResult(_0x4d7df5,null))[_0xcd26('0x4c')](handleError(_0x4d7df5,null));};
\ No newline at end of file
index 5a10fad..b6ee07f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x3e74,0x175));var _0x43e7=function(_0xa25687,_0x2458f2){_0xa25687=_0xa25687-0x0;var _0x2d8406=_0x3e74[_0xa25687];return _0x2d8406;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents;
\ No newline at end of file
+var _0x9957=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','CmList'];(function(_0x2b4da2,_0xd6c6c7){var _0x564a35=function(_0x12c6a9){while(--_0x12c6a9){_0x2b4da2['push'](_0x2b4da2['shift']());}};_0x564a35(++_0xd6c6c7);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var EventEmitter=require(_0x7995('0x0'));var CmList=require(_0x7995('0x1'))['db'][_0x7995('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7995('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7995('0x4'),'afterDestroy':_0x7995('0x5')};function emitEvent(_0x1902b4){return function(_0x462a03,_0x576d89,_0x744bea){CmListEvents[_0x7995('0x6')](_0x1902b4+':'+_0x462a03['id'],_0x462a03);CmListEvents[_0x7995('0x6')](_0x1902b4,_0x462a03);_0x744bea(null);};}for(var e in events){if(events[_0x7995('0x7')](e)){var event=events[e];CmList[_0x7995('0x8')](e,emitEvent(event));}}module[_0x7995('0x9')]=CmListEvents;
\ No newline at end of file
index 318e7be..18c2235 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb5=['define','CmList','cm_lists','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports'];(function(_0x314441,_0x5e5d2d){var _0x3c7849=function(_0x470aa2){while(--_0x470aa2){_0x314441['push'](_0x314441['shift']());}};_0x3c7849(++_0x5e5d2d);}(_0x0bb5,0x148));var _0x50bb=function(_0x3f3264,_0x4e0df8){_0x3f3264=_0x3f3264-0x0;var _0x5bc95d=_0x0bb5[_0x3f3264];return _0x5bc95d;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x50bb('0x2'));var BPromise=require(_0x50bb('0x3'));var rp=require(_0x50bb('0x4'));var fs=require('fs');var path=require(_0x50bb('0x5'));var rimraf=require(_0x50bb('0x6'));var config=require(_0x50bb('0x7'));var attributes=require(_0x50bb('0x8'));module[_0x50bb('0x9')]=function(_0x4e6093,_0x4a105c){return _0x4e6093[_0x50bb('0xa')](_0x50bb('0xb'),attributes,{'tableName':_0x50bb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x878f=['path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x878f,0x173));var _0xf878=function(_0x5e85b2,_0x2d4b38){_0x5e85b2=_0x5e85b2-0x0;var _0x3b428a=_0x878f[_0x5e85b2];return _0x3b428a;};'use strict';var _=require('lodash');var util=require(_0xf878('0x0'));var logger=require(_0xf878('0x1'))(_0xf878('0x2'));var moment=require(_0xf878('0x3'));var BPromise=require(_0xf878('0x4'));var rp=require(_0xf878('0x5'));var fs=require('fs');var path=require(_0xf878('0x6'));var rimraf=require(_0xf878('0x7'));var config=require(_0xf878('0x8'));var attributes=require(_0xf878('0x9'));module[_0xf878('0xa')]=function(_0x4bc9aa,_0x4ac8d8){return _0x4bc9aa[_0xf878('0xb')](_0xf878('0xc'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 94a1642..6624bf3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cf0=['stringify','error','code','CmList,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','socket.io-emitter','redis','./cmList.socket','register','request','then','info','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7cf0,0x128));var _0x07cf=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x7cf0[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x07cf('0x0'));var util=require(_0x07cf('0x1'));var moment=require(_0x07cf('0x2'));var BPromise=require(_0x07cf('0x3'));var rs=require(_0x07cf('0x4'));var fs=require('fs');var Redis=require(_0x07cf('0x5'));var db=require(_0x07cf('0x6'))['db'];var utils=require(_0x07cf('0x7'));var logger=require(_0x07cf('0x8'))(_0x07cf('0x9'));var config=require('../../config/environment');var jayson=require(_0x07cf('0xa'));var client=jayson['client'][_0x07cf('0xb')]({'port':0x232a});config['redis']=_[_0x07cf('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x07cf('0xd'))(new Redis(config[_0x07cf('0xe')]));require(_0x07cf('0xf'))[_0x07cf('0x10')](socket);function respondWithRpcPromise(_0x14dca8,_0x5b3364,_0x3a79c3){return new BPromise(function(_0x432e2d,_0x4150b0){return client[_0x07cf('0x11')](_0x14dca8,_0x3a79c3)[_0x07cf('0x12')](function(_0x122b4e){logger[_0x07cf('0x13')]('CmList,\x20%s,\x20%s',_0x5b3364,'request\x20sent');logger[_0x07cf('0x14')](_0x07cf('0x15'),_0x5b3364,_0x07cf('0x16'),JSON[_0x07cf('0x17')](_0x122b4e));if(_0x122b4e[_0x07cf('0x18')]){if(_0x122b4e[_0x07cf('0x18')][_0x07cf('0x19')]===0x1f4){logger[_0x07cf('0x18')](_0x07cf('0x1a'),_0x5b3364,_0x122b4e[_0x07cf('0x18')][_0x07cf('0x1b')]);return _0x4150b0(_0x122b4e[_0x07cf('0x18')][_0x07cf('0x1b')]);}logger[_0x07cf('0x18')]('CmList,\x20%s,\x20%s',_0x5b3364,_0x122b4e[_0x07cf('0x18')]['message']);return _0x432e2d(_0x122b4e['error'][_0x07cf('0x1b')]);}else{logger[_0x07cf('0x13')](_0x07cf('0x1a'),_0x5b3364,_0x07cf('0x16'));_0x432e2d(_0x122b4e['result']['message']);}})[_0x07cf('0x1c')](function(_0x100903){logger['error']('CmList,\x20%s,\x20%s',_0x5b3364,_0x100903);_0x4150b0(_0x100903);});});}
\ No newline at end of file
+var _0x1802=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','./cmList.socket','register','then','request\x20sent','debug','stringify','error','code','CmList,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x52b8eb,_0x395554){var _0x4b2c00=function(_0x4559bd){while(--_0x4559bd){_0x52b8eb['push'](_0x52b8eb['shift']());}};_0x4b2c00(++_0x395554);}(_0x1802,0x1e6));var _0x2180=function(_0x3f0b1e,_0x4ece3d){_0x3f0b1e=_0x3f0b1e-0x0;var _0x300d2d=_0x1802[_0x3f0b1e];return _0x300d2d;};'use strict';var _=require(_0x2180('0x0'));var util=require(_0x2180('0x1'));var moment=require(_0x2180('0x2'));var BPromise=require(_0x2180('0x3'));var rs=require(_0x2180('0x4'));var fs=require('fs');var Redis=require(_0x2180('0x5'));var db=require(_0x2180('0x6'))['db'];var utils=require(_0x2180('0x7'));var logger=require(_0x2180('0x8'))(_0x2180('0x9'));var config=require(_0x2180('0xa'));var jayson=require(_0x2180('0xb'));var client=jayson['client'][_0x2180('0xc')]({'port':0x232a});config[_0x2180('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2180('0xe'))[_0x2180('0xf')](socket);function respondWithRpcPromise(_0x56814e,_0x1d1282,_0x230c04){return new BPromise(function(_0x5d6fce,_0x1779ca){return client['request'](_0x56814e,_0x230c04)[_0x2180('0x10')](function(_0x2a76b8){logger['info']('CmList,\x20%s,\x20%s',_0x1d1282,_0x2180('0x11'));logger[_0x2180('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x1d1282,_0x2180('0x11'),JSON[_0x2180('0x13')](_0x2a76b8));if(_0x2a76b8[_0x2180('0x14')]){if(_0x2a76b8[_0x2180('0x14')][_0x2180('0x15')]===0x1f4){logger['error'](_0x2180('0x16'),_0x1d1282,_0x2a76b8[_0x2180('0x14')]['message']);return _0x1779ca(_0x2a76b8['error'][_0x2180('0x17')]);}logger[_0x2180('0x14')]('CmList,\x20%s,\x20%s',_0x1d1282,_0x2a76b8[_0x2180('0x14')][_0x2180('0x17')]);return _0x5d6fce(_0x2a76b8[_0x2180('0x14')][_0x2180('0x17')]);}else{logger[_0x2180('0x18')](_0x2180('0x16'),_0x1d1282,_0x2180('0x11'));_0x5d6fce(_0x2a76b8['result'][_0x2180('0x17')]);}})[_0x2180('0x19')](function(_0xab8da8){logger[_0x2180('0x14')]('CmList,\x20%s,\x20%s',_0x1d1282,_0xab8da8);_0x1779ca(_0xab8da8);});});}
\ No newline at end of file
index 1461487..b1bcd3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x09f6=['emit','removeListener','register','length','cmList:','./cmList.events','remove','update'];(function(_0x5e944a,_0x2847b4){var _0x38f07b=function(_0x433e88){while(--_0x433e88){_0x5e944a['push'](_0x5e944a['shift']());}};_0x38f07b(++_0x2847b4);}(_0x09f6,0xfd));var _0x609f=function(_0x9f54a1,_0x398ca6){_0x9f54a1=_0x9f54a1-0x0;var _0x3c54fa=_0x09f6[_0x9f54a1];return _0x3c54fa;};'use strict';var CmListEvents=require(_0x609f('0x0'));var events=['save',_0x609f('0x1'),_0x609f('0x2')];function createListener(_0x54cae2,_0x2f0b2f){return function(_0x190844){_0x2f0b2f[_0x609f('0x3')](_0x54cae2,_0x190844);};}function removeListener(_0x147a05,_0x38db90){return function(){CmListEvents[_0x609f('0x4')](_0x147a05,_0x38db90);};}exports[_0x609f('0x5')]=function(_0x2f96c1){for(var _0x33e941=0x0,_0x16d29b=events[_0x609f('0x6')];_0x33e941<_0x16d29b;_0x33e941++){var _0x588b29=events[_0x33e941];var _0x2fb3f8=createListener(_0x609f('0x7')+_0x588b29,_0x2f96c1);CmListEvents['on'](_0x588b29,_0x2fb3f8);}};
\ No newline at end of file
+var _0xc526=['length','save','update','emit','removeListener','register'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xc526,0x1bd));var _0x6c52=function(_0x5cc0d6,_0x39b4ae){_0x5cc0d6=_0x5cc0d6-0x0;var _0x47f300=_0xc526[_0x5cc0d6];return _0x47f300;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0x6c52('0x0'),'remove',_0x6c52('0x1')];function createListener(_0x470878,_0x18e097){return function(_0x195211){_0x18e097[_0x6c52('0x2')](_0x470878,_0x195211);};}function removeListener(_0x21fee6,_0x1f8fe3){return function(){CmListEvents[_0x6c52('0x3')](_0x21fee6,_0x1f8fe3);};}exports[_0x6c52('0x4')]=function(_0x4cc61b){for(var _0x457ca2=0x0,_0x18f5e7=events[_0x6c52('0x5')];_0x457ca2<_0x18f5e7;_0x457ca2++){var _0x40a391=events[_0x457ca2];var _0x48f62c=createListener('cmList:'+_0x40a391,_0x4cc61b);CmListEvents['on'](_0x40a391,_0x48f62c);}};
\ No newline at end of file
index 22df05f..ba7efe8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67cc=['index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','create','post','addDisposition','addContacts','addCustomField','addAgents','/:id','update','delete','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated'];(function(_0xd00021,_0x19c414){var _0x992dc3=function(_0x4697e0){while(--_0x4697e0){_0xd00021['push'](_0xd00021['shift']());}};_0x992dc3(++_0x19c414);}(_0x67cc,0x1f4));var _0xc67c=function(_0x1ee7e4,_0x4ba132){_0x1ee7e4=_0x1ee7e4-0x0;var _0x4a99aa=_0x67cc[_0x1ee7e4];return _0x4a99aa;};'use strict';var multer=require(_0xc67c('0x0'));var util=require(_0xc67c('0x1'));var path=require('path');var timeout=require(_0xc67c('0x2'));var express=require(_0xc67c('0x3'));var router=express['Router']();var fs_extra=require(_0xc67c('0x4'));var auth=require(_0xc67c('0x5'));var interaction=require(_0xc67c('0x6'));var config=require('../../config/environment');var controller=require(_0xc67c('0x7'));router[_0xc67c('0x8')]('/',auth[_0xc67c('0x9')](),controller[_0xc67c('0xa')]);router[_0xc67c('0x8')](_0xc67c('0xb'),auth[_0xc67c('0x9')](),controller[_0xc67c('0xc')]);router[_0xc67c('0x8')]('/:id',auth[_0xc67c('0x9')](),controller[_0xc67c('0xd')]);router[_0xc67c('0x8')](_0xc67c('0xe'),auth[_0xc67c('0x9')](),controller[_0xc67c('0xf')]);router['get'](_0xc67c('0x10'),auth['isAuthenticated'](),controller['getContacts']);router[_0xc67c('0x8')](_0xc67c('0x11'),auth[_0xc67c('0x9')](),controller[_0xc67c('0x12')]);router[_0xc67c('0x8')](_0xc67c('0x13'),auth['isAuthenticated'](),controller[_0xc67c('0x14')]);router[_0xc67c('0x8')](_0xc67c('0x15'),auth[_0xc67c('0x9')](),controller[_0xc67c('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc67c('0x17')]);router[_0xc67c('0x18')](_0xc67c('0xe'),auth[_0xc67c('0x9')](),controller[_0xc67c('0x19')]);router[_0xc67c('0x18')](_0xc67c('0x10'),auth[_0xc67c('0x9')](),controller[_0xc67c('0x1a')]);router[_0xc67c('0x18')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc67c('0x1b')]);router[_0xc67c('0x18')](_0xc67c('0x15'),auth[_0xc67c('0x9')](),controller[_0xc67c('0x1c')]);router['put'](_0xc67c('0x1d'),auth[_0xc67c('0x9')](),controller[_0xc67c('0x1e')]);router['delete'](_0xc67c('0x1d'),auth['isAuthenticated'](),controller['destroy']);router[_0xc67c('0x1f')](_0xc67c('0xe'),auth[_0xc67c('0x9')](),controller['removeDispositions']);router[_0xc67c('0x1f')](_0xc67c('0x15'),auth[_0xc67c('0x9')](),controller[_0xc67c('0x20')]);module[_0xc67c('0x21')]=router;
\ No newline at end of file
+var _0x747c=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getAgents','post','create','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','put','destroy','delete','removeDispositions','removeAgents','exports','multer','util'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x747c,0x196));var _0xc747=function(_0x3b0b02,_0x37c8ee){_0x3b0b02=_0x3b0b02-0x0;var _0x22041c=_0x747c[_0x3b0b02];return _0x22041c;};'use strict';var multer=require(_0xc747('0x0'));var util=require(_0xc747('0x1'));var path=require(_0xc747('0x2'));var timeout=require('connect-timeout');var express=require(_0xc747('0x3'));var router=express['Router']();var fs_extra=require(_0xc747('0x4'));var auth=require(_0xc747('0x5'));var interaction=require(_0xc747('0x6'));var config=require(_0xc747('0x7'));var controller=require('./cmList.controller');router[_0xc747('0x8')]('/',auth[_0xc747('0x9')](),controller[_0xc747('0xa')]);router['get'](_0xc747('0xb'),auth[_0xc747('0x9')](),controller[_0xc747('0xc')]);router['get'](_0xc747('0xd'),auth[_0xc747('0x9')](),controller[_0xc747('0xe')]);router[_0xc747('0x8')](_0xc747('0xf'),auth[_0xc747('0x9')](),controller['getDispositions']);router['get'](_0xc747('0x10'),auth[_0xc747('0x9')](),controller[_0xc747('0x11')]);router[_0xc747('0x8')](_0xc747('0x12'),auth[_0xc747('0x9')](),controller[_0xc747('0x13')]);router['get']('/:id/fields',auth[_0xc747('0x9')](),controller['getCustomFields']);router[_0xc747('0x8')]('/:id/users',auth[_0xc747('0x9')](),controller[_0xc747('0x14')]);router[_0xc747('0x15')]('/',auth['isAuthenticated'](),controller[_0xc747('0x16')]);router['post'](_0xc747('0xf'),auth['isAuthenticated'](),controller['addDisposition']);router[_0xc747('0x15')]('/:id/contacts',auth[_0xc747('0x9')](),controller[_0xc747('0x17')]);router[_0xc747('0x15')](_0xc747('0x18'),auth['isAuthenticated'](),controller[_0xc747('0x19')]);router['post'](_0xc747('0x1a'),auth[_0xc747('0x9')](),controller[_0xc747('0x1b')]);router[_0xc747('0x1c')](_0xc747('0xd'),auth[_0xc747('0x9')](),controller['update']);router['delete'](_0xc747('0xd'),auth[_0xc747('0x9')](),controller[_0xc747('0x1d')]);router[_0xc747('0x1e')](_0xc747('0xf'),auth[_0xc747('0x9')](),controller[_0xc747('0x1f')]);router[_0xc747('0x1e')](_0xc747('0x1a'),auth[_0xc747('0x9')](),controller[_0xc747('0x20')]);module[_0xc747('0x21')]=router;
\ No newline at end of file
index 5ba7374..ba75569 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22db=['getDataValue','STRING','sequelize','exports'];(function(_0x473ee7,_0x4dd754){var _0x30f0d4=function(_0x4d961d){while(--_0x4d961d){_0x473ee7['push'](_0x473ee7['shift']());}};_0x30f0d4(++_0x4dd754);}(_0x22db,0x1de));var _0xb22d=function(_0x449216,_0x33b40f){_0x449216=_0x449216-0x0;var _0x23443c=_0x22db[_0x449216];return _0x23443c;};'use strict';var Sequelize=require(_0xb22d('0x0'));module[_0xb22d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x25b2d2){return this[_0xb22d('0x2')]('field');}},'field':{'type':Sequelize[_0xb22d('0x3')],'allowNull':![]},'operator':{'type':Sequelize[_0xb22d('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xb22d('0x3')],'allowNull':![]}};
\ No newline at end of file
+var _0x9cd5=['STRING','VIRTUAL'];(function(_0x237c49,_0x40c939){var _0x39bc47=function(_0x41b1e9){while(--_0x41b1e9){_0x237c49['push'](_0x237c49['shift']());}};_0x39bc47(++_0x40c939);}(_0x9cd5,0x1a3));var _0x59cd=function(_0x4254cb,_0x493ef9){_0x4254cb=_0x4254cb-0x0;var _0x5f5507=_0x9cd5[_0x4254cb];return _0x5f5507;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x59cd('0x0')],'get':function(_0x448312){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x59cd('0x1')],'allowNull':![]},'operator':{'type':Sequelize[_0x59cd('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x59cd('0x1')],'allowNull':![]}};
\ No newline at end of file
index 71eaa7f..0b247c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5a7963,_0xec6e47){var _0x1be170=function(_0x232bde){while(--_0x232bde){_0x5a7963['push'](_0x5a7963['shift']());}};_0x1be170(++_0xec6e47);}(_0x7a54,0x106));var _0x47a5=function(_0xfc972f,_0x165c5a){_0xfc972f=_0xfc972f-0x0;var _0x1c2b12=_0x7a54[_0xfc972f];return _0x1c2b12;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
+var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x37b666,_0x429468){var _0x2b0035=function(_0x3b141b){while(--_0x3b141b){_0x37b666['push'](_0x37b666['shift']());}};_0x2b0035(++_0x429468);}(_0x7a54,0x106));var _0x47a5=function(_0x4ee225,_0x280416){_0x4ee225=_0x4ee225-0x0;var _0x5740c2=_0x7a54[_0x4ee225];return _0x5740c2;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));};
\ No newline at end of file
index 368b48b..092836a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x916f=['define','Condition','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x2e6ed0,_0x46838a){var _0x218fba=function(_0x315f44){while(--_0x315f44){_0x2e6ed0['push'](_0x2e6ed0['shift']());}};_0x218fba(++_0x46838a);}(_0x916f,0xb8));var _0xf916=function(_0x4d525c,_0x277dac){_0x4d525c=_0x4d525c-0x0;var _0x3f0655=_0x916f[_0x4d525c];return _0x3f0655;};'use strict';var _=require(_0xf916('0x0'));var util=require('util');var logger=require(_0xf916('0x1'))(_0xf916('0x2'));var moment=require(_0xf916('0x3'));var BPromise=require(_0xf916('0x4'));var rp=require(_0xf916('0x5'));var fs=require('fs');var path=require(_0xf916('0x6'));var rimraf=require(_0xf916('0x7'));var config=require(_0xf916('0x8'));var attributes=require(_0xf916('0x9'));module[_0xf916('0xa')]=function(_0x4c6d9d,_0x57f473){return _0x4c6d9d[_0xf916('0xb')](_0xf916('0xc'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c69=['../../config/environment','./condition.attributes','exports','define','Condition','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4e4519,_0x392ae){var _0x340044=function(_0x11721f){while(--_0x11721f){_0x4e4519['push'](_0x4e4519['shift']());}};_0x340044(++_0x392ae);}(_0x9c69,0x71));var _0x99c6=function(_0x21bcc5,_0x3c0552){_0x21bcc5=_0x21bcc5-0x0;var _0xc62ace=_0x9c69[_0x21bcc5];return _0xc62ace;};'use strict';var _=require('lodash');var util=require(_0x99c6('0x0'));var logger=require('../../config/logger')(_0x99c6('0x1'));var moment=require(_0x99c6('0x2'));var BPromise=require(_0x99c6('0x3'));var rp=require(_0x99c6('0x4'));var fs=require('fs');var path=require(_0x99c6('0x5'));var rimraf=require(_0x99c6('0x6'));var config=require(_0x99c6('0x7'));var attributes=require(_0x99c6('0x8'));module[_0x99c6('0x9')]=function(_0x11e4bf,_0x4af159){return _0x11e4bf[_0x99c6('0xa')](_0x99c6('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ed9e6c0..4fe61fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x048b=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s'];(function(_0x4902f3,_0x58ad56){var _0x4ae306=function(_0x2b034f){while(--_0x2b034f){_0x4902f3['push'](_0x4902f3['shift']());}};_0x4ae306(++_0x58ad56);}(_0x048b,0x10d));var _0xb048=function(_0x5cacec,_0x358c70){_0x5cacec=_0x5cacec-0x0;var _0x30ee9e=_0x048b[_0x5cacec];return _0x30ee9e;};'use strict';var _=require(_0xb048('0x0'));var util=require(_0xb048('0x1'));var moment=require(_0xb048('0x2'));var BPromise=require('bluebird');var rs=require(_0xb048('0x3'));var fs=require('fs');var Redis=require(_0xb048('0x4'));var db=require(_0xb048('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb048('0x6'))(_0xb048('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb048('0x8')][_0xb048('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbc141a,_0x3836d1,_0x27ab33){return new BPromise(function(_0xd39470,_0x515d3b){return client[_0xb048('0xa')](_0xbc141a,_0x27ab33)[_0xb048('0xb')](function(_0x186408){logger[_0xb048('0xc')](_0xb048('0xd'),_0x3836d1,_0xb048('0xe'));logger[_0xb048('0xf')](_0xb048('0x10'),_0x3836d1,_0xb048('0xe'),JSON[_0xb048('0x11')](_0x186408));if(_0x186408[_0xb048('0x12')]){if(_0x186408[_0xb048('0x12')]['code']===0x1f4){logger['error'](_0xb048('0xd'),_0x3836d1,_0x186408[_0xb048('0x12')][_0xb048('0x13')]);return _0x515d3b(_0x186408[_0xb048('0x12')][_0xb048('0x13')]);}logger['error'](_0xb048('0xd'),_0x3836d1,_0x186408[_0xb048('0x12')][_0xb048('0x13')]);return _0xd39470(_0x186408['error'][_0xb048('0x13')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x3836d1,_0xb048('0xe'));_0xd39470(_0x186408[_0xb048('0x14')][_0xb048('0x13')]);}})[_0xb048('0x15')](function(_0x5996f7){logger[_0xb048('0x12')]('Condition,\x20%s,\x20%s',_0x3836d1,_0x5996f7);_0x515d3b(_0x5996f7);});});}
\ No newline at end of file
+var _0xc62e=['stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','request','then','info','Condition,\x20%s,\x20%s','debug','Condition,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x49239a,_0x1fd222){var _0x4382f0=function(_0xe2ef3a){while(--_0xe2ef3a){_0x49239a['push'](_0x49239a['shift']());}};_0x4382f0(++_0x1fd222);}(_0xc62e,0x116));var _0xec62=function(_0x283fd1,_0x5a2a3e){_0x283fd1=_0x283fd1-0x0;var _0x4e6def=_0xc62e[_0x283fd1];return _0x4e6def;};'use strict';var _=require(_0xec62('0x0'));var util=require('util');var moment=require(_0xec62('0x1'));var BPromise=require(_0xec62('0x2'));var rs=require(_0xec62('0x3'));var fs=require('fs');var Redis=require(_0xec62('0x4'));var db=require(_0xec62('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xec62('0x6'))('rpc');var config=require(_0xec62('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xec62('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14216b,_0x592a16,_0x3fac0f){return new BPromise(function(_0x289fa0,_0x5b0314){return client[_0xec62('0x9')](_0x14216b,_0x3fac0f)[_0xec62('0xa')](function(_0x4451e0){logger[_0xec62('0xb')](_0xec62('0xc'),_0x592a16,'request\x20sent');logger[_0xec62('0xd')](_0xec62('0xe'),_0x592a16,_0xec62('0xf'),JSON[_0xec62('0x10')](_0x4451e0));if(_0x4451e0[_0xec62('0x11')]){if(_0x4451e0[_0xec62('0x11')][_0xec62('0x12')]===0x1f4){logger[_0xec62('0x11')](_0xec62('0xc'),_0x592a16,_0x4451e0[_0xec62('0x11')][_0xec62('0x13')]);return _0x5b0314(_0x4451e0[_0xec62('0x11')][_0xec62('0x13')]);}logger[_0xec62('0x11')](_0xec62('0xc'),_0x592a16,_0x4451e0[_0xec62('0x11')][_0xec62('0x13')]);return _0x289fa0(_0x4451e0[_0xec62('0x11')][_0xec62('0x13')]);}else{logger[_0xec62('0xb')](_0xec62('0xc'),_0x592a16,_0xec62('0xf'));_0x289fa0(_0x4451e0[_0xec62('0x14')][_0xec62('0x13')]);}})['catch'](function(_0x163ce1){logger[_0xec62('0x11')](_0xec62('0xc'),_0x592a16,_0x163ce1);_0x5b0314(_0x163ce1);});});}
\ No newline at end of file
index fa4391f..b527384 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5874=['express','../../components/auth/service','../../config/environment','put','update','/:id','isAuthenticated','destroy','exports','multer','util','path','connect-timeout'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x5874,0xcc));var _0x4587=function(_0x251e47,_0x34e097){_0x251e47=_0x251e47-0x0;var _0x3764ab=_0x5874[_0x251e47];return _0x3764ab;};'use strict';var multer=require(_0x4587('0x0'));var util=require(_0x4587('0x1'));var path=require(_0x4587('0x2'));var timeout=require(_0x4587('0x3'));var express=require(_0x4587('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4587('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4587('0x6'));var controller=require('./condition.controller');router[_0x4587('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x4587('0x8')]);router['delete'](_0x4587('0x9'),auth[_0x4587('0xa')](),controller[_0x4587('0xb')]);module[_0x4587('0xc')]=router;
\ No newline at end of file
+var _0x2577=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','delete','isAuthenticated','exports','multer','util','path','express'];(function(_0x31b882,_0x1f5c3e){var _0x343154=function(_0x21ff50){while(--_0x21ff50){_0x31b882['push'](_0x31b882['shift']());}};_0x343154(++_0x1f5c3e);}(_0x2577,0x1e6));var _0x7257=function(_0x332bb4,_0x24246d){_0x332bb4=_0x332bb4-0x0;var _0x136f0b=_0x2577[_0x332bb4];return _0x136f0b;};'use strict';var multer=require(_0x7257('0x0'));var util=require(_0x7257('0x1'));var path=require(_0x7257('0x2'));var timeout=require('connect-timeout');var express=require(_0x7257('0x3'));var router=express['Router']();var fs_extra=require(_0x7257('0x4'));var auth=require(_0x7257('0x5'));var interaction=require(_0x7257('0x6'));var config=require(_0x7257('0x7'));var controller=require(_0x7257('0x8'));router[_0x7257('0x9')](_0x7257('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x7257('0xb')](_0x7257('0xa'),auth[_0x7257('0xc')](),controller['destroy']);module[_0x7257('0xd')]=router;
\ No newline at end of file
index 785d6f8..1d1205f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['name','sequelize','STRING'];(function(_0x2d2d2b,_0x2a7837){var _0x33906f=function(_0x5cdfef){while(--_0x5cdfef){_0x2d2d2b['push'](_0x2d2d2b['shift']());}};_0x33906f(++_0x2a7837);}(_0xb10b,0x12a));var _0xbb10=function(_0x495c18,_0xae1131){_0x495c18=_0x495c18-0x0;var _0x27b50d=_0xb10b[_0x495c18];return _0x27b50d;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
+var _0xb10b=['name','sequelize','STRING'];(function(_0x35c502,_0x20024c){var _0x1d7825=function(_0x3289b2){while(--_0x3289b2){_0x35c502['push'](_0x35c502['shift']());}};_0x1d7825(++_0x20024c);}(_0xb10b,0x12a));var _0xbb10=function(_0xeffc63,_0x4acafd){_0xeffc63=_0xeffc63-0x0;var _0x175db2=_0xb10b[_0xeffc63];return _0x175db2;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}};
\ No newline at end of file
index 5455f2c..d5e6922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fb0=['length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields'];(function(_0x5f30b7,_0x207758){var _0x425cb2=function(_0x49d5e8){while(--_0x49d5e8){_0x5f30b7['push'](_0x5f30b7['shift']());}};_0x425cb2(++_0x207758);}(_0x1fb0,0x13e));var _0x01fb=function(_0x2dd7fc,_0x42c03c){_0x2dd7fc=_0x2dd7fc-0x0;var _0x1eac5d=_0x1fb0[_0x2dd7fc];return _0x1eac5d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x01fb('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x01fb('0x1'));var moment=require('moment');var BPromise=require(_0x01fb('0x2'));var Mustache=require(_0x01fb('0x3'));var util=require('util');var path=require('path');var sox=require(_0x01fb('0x4'));var csv=require(_0x01fb('0x5'));var ejs=require(_0x01fb('0x6'));var fs=require('fs');var fs_extra=require(_0x01fb('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x01fb('0x8'));var jsforce=require(_0x01fb('0x9'));var deskjs=require(_0x01fb('0xa'));var toCsv=require('to-csv');var querystring=require(_0x01fb('0xb'));var Papa=require(_0x01fb('0xc'));var Redis=require(_0x01fb('0xd'));var authService=require(_0x01fb('0xe'));var qs=require(_0x01fb('0xf'));var as=require(_0x01fb('0x10'));var hardwareService=require(_0x01fb('0x11'));var logger=require(_0x01fb('0x12'))('api');var utils=require(_0x01fb('0x13'));var config=require(_0x01fb('0x14'));var licenseUtil=require(_0x01fb('0x15'));var db=require(_0x01fb('0x16'))['db'];config[_0x01fb('0x17')]=_[_0x01fb('0x18')](config[_0x01fb('0x17')],{'host':_0x01fb('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x01fb('0x1a'))[_0x01fb('0x1b')](socket);function respondWithStatusCode(_0x494d32,_0x15de81){_0x15de81=_0x15de81||0xcc;return function(_0x5b6107){if(_0x5b6107){return _0x494d32[_0x01fb('0x1c')](_0x15de81);}return _0x494d32[_0x01fb('0x1d')](_0x15de81)[_0x01fb('0x1e')]();};}function respondWithResult(_0xcc50f6,_0x1a066f){_0x1a066f=_0x1a066f||0xc8;return function(_0x585dff){if(_0x585dff){return _0xcc50f6[_0x01fb('0x1d')](_0x1a066f)[_0x01fb('0x1f')](_0x585dff);}};}function respondWithFilteredResult(_0x56e651,_0x312c69){return function(_0x5f3ea2){if(_0x5f3ea2){var _0x2c108f=typeof _0x312c69[_0x01fb('0x20')]===_0x01fb('0x21')&&typeof _0x312c69['limit']===_0x01fb('0x21');var _0x595b23=_0x5f3ea2['count'];var _0x37f18f=_0x2c108f?0x0:_0x312c69[_0x01fb('0x20')];var _0x20016e=_0x2c108f?_0x5f3ea2[_0x01fb('0x22')]:_0x312c69[_0x01fb('0x20')]+_0x312c69[_0x01fb('0x23')];var _0x5ee027;if(_0x20016e>=_0x595b23){_0x20016e=_0x595b23;_0x5ee027=0xc8;}else{_0x5ee027=0xce;}_0x56e651['status'](_0x5ee027);return _0x56e651[_0x01fb('0x24')](_0x01fb('0x25'),_0x37f18f+'-'+_0x20016e+'/'+_0x595b23)['json'](_0x5f3ea2);}return null;};}function patchUpdates(_0x3762f7){return function(_0x3c35d1){try{jsonpatch[_0x01fb('0x26')](_0x3c35d1,_0x3762f7,!![]);}catch(_0x5dc751){return BPromise['reject'](_0x5dc751);}return _0x3c35d1[_0x01fb('0x27')]();};}function saveUpdates(_0x57592d,_0x4ae5ce){return function(_0x352bab){if(_0x352bab){return _0x352bab[_0x01fb('0x28')](_0x57592d)['then'](function(_0x4f1c23){return _0x4f1c23;});}return null;};}function removeEntity(_0x40611f,_0x16bb70){return function(_0x67bcf7){if(_0x67bcf7){return _0x67bcf7[_0x01fb('0x29')]()[_0x01fb('0x2a')](function(){var _0x473871=_0x67bcf7[_0x01fb('0x2b')]({'plain':!![]});var _0x500c31=_0x01fb('0x2c');return db[_0x01fb('0x2d')][_0x01fb('0x29')]({'where':{'type':_0x500c31,'resourceId':_0x473871['id']}})['then'](function(){return _0x67bcf7;});})[_0x01fb('0x2a')](function(){_0x40611f[_0x01fb('0x1d')](0xcc)[_0x01fb('0x1e')]();});}};}function handleEntityNotFound(_0x6414eb,_0x1b0867){return function(_0x71a75b){if(!_0x71a75b){_0x6414eb[_0x01fb('0x1c')](0x194);}return _0x71a75b;};}function handleError(_0x301265,_0x154f67){_0x154f67=_0x154f67||0x1f4;return function(_0xcf1688){logger[_0x01fb('0x2e')](_0xcf1688[_0x01fb('0x2f')]);if(_0xcf1688[_0x01fb('0x30')]){delete _0xcf1688[_0x01fb('0x30')];}_0x301265[_0x01fb('0x1d')](_0x154f67)[_0x01fb('0x31')](_0xcf1688);};}exports[_0x01fb('0x32')]=function(_0x571513,_0x3f4a9a){var _0x4fc13c={},_0x4ccf66={},_0x34996c={'count':0x0,'rows':[]};var _0x359ab6=_[_0x01fb('0x33')](db[_0x01fb('0x34')][_0x01fb('0x35')],function(_0x59395e){return{'name':_0x59395e[_0x01fb('0x36')],'type':_0x59395e[_0x01fb('0x37')][_0x01fb('0x38')]};});_0x4ccf66[_0x01fb('0x39')]=_[_0x01fb('0x33')](_0x359ab6,_0x01fb('0x30'));_0x4ccf66[_0x01fb('0x3a')]=_[_0x01fb('0x3b')](_0x571513[_0x01fb('0x3a')]);_0x4ccf66['filters']=_[_0x01fb('0x3c')](_0x4ccf66[_0x01fb('0x39')],_0x4ccf66[_0x01fb('0x3a')]);_0x4fc13c[_0x01fb('0x3d')]=_['intersection'](_0x4ccf66[_0x01fb('0x39')],qs['fields'](_0x571513[_0x01fb('0x3a')][_0x01fb('0x3e')]));_0x4fc13c[_0x01fb('0x3d')]=_0x4fc13c[_0x01fb('0x3d')][_0x01fb('0x3f')]?_0x4fc13c[_0x01fb('0x3d')]:_0x4ccf66[_0x01fb('0x39')];if(!_0x571513[_0x01fb('0x3a')][_0x01fb('0x40')](_0x01fb('0x41'))){_0x4fc13c['limit']=qs['limit'](_0x571513[_0x01fb('0x3a')][_0x01fb('0x23')]);_0x4fc13c[_0x01fb('0x20')]=qs[_0x01fb('0x20')](_0x571513[_0x01fb('0x3a')]['offset']);}_0x4fc13c[_0x01fb('0x42')]=qs[_0x01fb('0x43')](_0x571513['query'][_0x01fb('0x43')]);_0x4fc13c[_0x01fb('0x44')]=qs[_0x01fb('0x45')](_[_0x01fb('0x46')](_0x571513[_0x01fb('0x3a')],_0x4ccf66[_0x01fb('0x45')]),_0x359ab6);if(_0x571513['query']['filter']){_0x4fc13c['where']=_[_0x01fb('0x47')](_0x4fc13c[_0x01fb('0x44')],{'$or':_[_0x01fb('0x33')](_0x359ab6,function(_0x57f4d9){if(_0x57f4d9[_0x01fb('0x37')]!==_0x01fb('0x48')){var _0x10d282={};_0x10d282[_0x57f4d9[_0x01fb('0x30')]]={'$like':'%'+_0x571513[_0x01fb('0x3a')][_0x01fb('0x49')]+'%'};return _0x10d282;}})});}_0x4fc13c=_[_0x01fb('0x47')]({},_0x4fc13c,_0x571513[_0x01fb('0x4a')]);var _0x168341={'where':_0x4fc13c[_0x01fb('0x44')]};return db[_0x01fb('0x34')][_0x01fb('0x22')](_0x168341)[_0x01fb('0x2a')](function(_0x4de72f){_0x34996c[_0x01fb('0x22')]=_0x4de72f;if(_0x571513[_0x01fb('0x3a')][_0x01fb('0x4b')]){_0x4fc13c[_0x01fb('0x4c')]=[{'all':!![]}];}return db[_0x01fb('0x34')][_0x01fb('0x4d')](_0x4fc13c);})[_0x01fb('0x2a')](function(_0x523f19){_0x34996c[_0x01fb('0x4e')]=_0x523f19;return _0x34996c;})[_0x01fb('0x2a')](respondWithFilteredResult(_0x3f4a9a,_0x4fc13c))['catch'](handleError(_0x3f4a9a,null));};exports[_0x01fb('0x4f')]=function(_0x4ad54e,_0xac2f72){var _0x15a4d2={'raw':![],'where':{'id':_0x4ad54e[_0x01fb('0x50')]['id']}},_0x23c5d4={};_0x23c5d4['model']=_[_0x01fb('0x3b')](db[_0x01fb('0x34')]['rawAttributes']);_0x23c5d4[_0x01fb('0x3a')]=_[_0x01fb('0x3b')](_0x4ad54e[_0x01fb('0x3a')]);_0x23c5d4['filters']=_[_0x01fb('0x3c')](_0x23c5d4['model'],_0x23c5d4[_0x01fb('0x3a')]);_0x15a4d2[_0x01fb('0x3d')]=_[_0x01fb('0x3c')](_0x23c5d4['model'],qs[_0x01fb('0x3e')](_0x4ad54e[_0x01fb('0x3a')][_0x01fb('0x3e')]));_0x15a4d2[_0x01fb('0x3d')]=_0x15a4d2[_0x01fb('0x3d')][_0x01fb('0x3f')]?_0x15a4d2['attributes']:_0x23c5d4[_0x01fb('0x39')];if(_0x4ad54e['query'][_0x01fb('0x4b')]){_0x15a4d2[_0x01fb('0x4c')]=[{'all':!![]}];}_0x15a4d2=_[_0x01fb('0x47')]({},_0x15a4d2,_0x4ad54e[_0x01fb('0x4a')]);return db[_0x01fb('0x34')][_0x01fb('0x51')](_0x15a4d2)[_0x01fb('0x2a')](handleEntityNotFound(_0xac2f72,null))['then'](respondWithResult(_0xac2f72,null))[_0x01fb('0x52')](handleError(_0xac2f72,null));};exports[_0x01fb('0x53')]=function(_0x54128a,_0x4ef8df){return db['Dashboard'][_0x01fb('0x53')](_0x54128a[_0x01fb('0x54')],{})[_0x01fb('0x2a')](function(_0x4931eb){var _0x40ac6f=_0x54128a[_0x01fb('0x55')]['get']({'plain':!![]});if(!_0x40ac6f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40ac6f[_0x01fb('0x56')]==='user'){var _0x1ba599=_0x4931eb[_0x01fb('0x2b')]({'plain':!![]});var _0x3b7dd4=_0x01fb('0x2c');return db['UserProfileSection'][_0x01fb('0x51')]({'where':{'name':_0x3b7dd4,'userProfileId':_0x40ac6f[_0x01fb('0x57')]},'raw':!![]})[_0x01fb('0x2a')](function(_0x5a4694){if(_0x5a4694&&_0x5a4694[_0x01fb('0x58')]===0x0){return db[_0x01fb('0x2d')][_0x01fb('0x53')]({'name':_0x1ba599['name'],'resourceId':_0x1ba599['id'],'type':_0x5a4694['name'],'sectionId':_0x5a4694['id']},{})['then'](function(){return _0x4931eb;});}else{return _0x4931eb;}})[_0x01fb('0x52')](function(_0x584be5){logger[_0x01fb('0x2e')](_0x01fb('0x59'),_0x584be5);throw _0x584be5;});}return _0x4931eb;})[_0x01fb('0x2a')](respondWithResult(_0x4ef8df,0xc9))[_0x01fb('0x52')](handleError(_0x4ef8df,null));};exports[_0x01fb('0x5a')]=function(_0x1938bb,_0x1d5103){var _0x476a88={'where':{'id':_0x1938bb[_0x01fb('0x50')]['id']}},_0x443b66={};_0x443b66['model']=_[_0x01fb('0x3b')](db[_0x01fb('0x34')][_0x01fb('0x35')]);_0x476a88['attributes']=_['intersection'](_0x443b66[_0x01fb('0x39')],qs[_0x01fb('0x3e')](_0x1938bb[_0x01fb('0x3a')]['fields']));_0x476a88[_0x01fb('0x3d')]=_0x476a88[_0x01fb('0x3d')][_0x01fb('0x3f')]?_0x476a88['attributes']:_0x443b66[_0x01fb('0x39')];if(_0x1938bb[_0x01fb('0x3a')][_0x01fb('0x4b')]){_0x476a88['include']=[{'all':!![]}];}_0x476a88=_[_0x01fb('0x47')]({},_0x476a88,_0x1938bb['options']);return db[_0x01fb('0x34')]['find'](_0x476a88)[_0x01fb('0x2a')](handleEntityNotFound(_0x1d5103,null))[_0x01fb('0x2a')](function(_0x177b12){if(_0x177b12){var _0x1f17b4=_0x177b12[_0x01fb('0x2b')]({'plain':!![]});_0x1f17b4=qs[_0x01fb('0x5b')](_0x1f17b4,['id',_0x01fb('0x5c'),_0x01fb('0x5d')]);_0x1938bb['body']=_[_0x01fb('0x5b')](_0x1938bb[_0x01fb('0x54')],['id',_0x01fb('0x5c'),_0x01fb('0x5d')]);return db['Dashboard'][_0x01fb('0x53')](_['merge'](_0x1f17b4,_0x1938bb[_0x01fb('0x54')]),{'include':_0x1938bb[_0x01fb('0x3a')]['includeAll']?[{'all':!![]}]:undefined})[_0x01fb('0x2a')](function(_0x112409){var _0x2add4a=_0x1938bb[_0x01fb('0x55')]['get']({'plain':!![]});if(!_0x2add4a)throw new Error(_0x01fb('0x5e'));if(_0x2add4a[_0x01fb('0x56')]==='user'){var _0x317879=_0x112409[_0x01fb('0x2b')]({'plain':!![]});var _0xd74568='CustomDashboards';return db[_0x01fb('0x5f')]['find']({'where':{'name':_0xd74568,'userProfileId':_0x2add4a[_0x01fb('0x57')]},'raw':!![]})[_0x01fb('0x2a')](function(_0x19bae6){if(_0x19bae6&&_0x19bae6['autoAssociation']===0x0){return db[_0x01fb('0x2d')][_0x01fb('0x53')]({'name':_0x317879['name'],'resourceId':_0x317879['id'],'type':_0x19bae6[_0x01fb('0x30')],'sectionId':_0x19bae6['id']},{})[_0x01fb('0x2a')](function(){return _0x112409;});}else{return _0x112409;}})[_0x01fb('0x52')](function(_0x3168c8){logger[_0x01fb('0x2e')](_0x01fb('0x59'),_0x3168c8);throw _0x3168c8;});}return _0x112409;});}})[_0x01fb('0x2a')](respondWithResult(_0x1d5103,0xc9))[_0x01fb('0x52')](handleError(_0x1d5103,null));};exports[_0x01fb('0x28')]=function(_0x1c6dfe,_0x1cc292){if(_0x1c6dfe[_0x01fb('0x54')]['id']){delete _0x1c6dfe['body']['id'];}return db['Dashboard']['find']({'where':{'id':_0x1c6dfe[_0x01fb('0x50')]['id']}})['then'](handleEntityNotFound(_0x1cc292,null))[_0x01fb('0x2a')](saveUpdates(_0x1c6dfe[_0x01fb('0x54')],null))[_0x01fb('0x2a')](respondWithResult(_0x1cc292,null))[_0x01fb('0x52')](handleError(_0x1cc292,null));};exports[_0x01fb('0x29')]=function(_0x3aef54,_0x501bd9){return db[_0x01fb('0x34')][_0x01fb('0x51')]({'where':{'id':_0x3aef54[_0x01fb('0x50')]['id']}})['then'](handleEntityNotFound(_0x501bd9,null))[_0x01fb('0x2a')](removeEntity(_0x501bd9,null))['catch'](handleError(_0x501bd9,null));};function widgetAttributes(_0x2bdf06){try{switch(_0x2bdf06[_0x01fb('0x37')]){case'iframe':return[{'name':_0x01fb('0x60'),'value':_0x2bdf06[_0x01fb('0x60')]||(_0x2bdf06[_0x01fb('0x61')]&&_0x2bdf06[_0x01fb('0x61')][0x0]?_0x2bdf06[_0x01fb('0x61')][0x0][_0x01fb('0x62')]:undefined)||_0x01fb('0x63')}];case _0x01fb('0x64'):return[{'name':'attrPath','value':_0x2bdf06[_0x01fb('0x65')]||(_0x2bdf06[_0x01fb('0x61')]&&_0x2bdf06[_0x01fb('0x61')][0x0]?_0x2bdf06[_0x01fb('0x61')][0x0][_0x01fb('0x62')]:undefined)||''}];case _0x01fb('0x66'):return[{'name':_0x01fb('0x67'),'value':_0x2bdf06[_0x01fb('0x67')]||(_0x2bdf06['attrs']&&_0x2bdf06['attrs'][0x0]?_0x2bdf06[_0x01fb('0x61')][0x0]['value']:undefined)||_0x01fb('0x68')},{'name':'attrTimezone','value':_0x2bdf06[_0x01fb('0x69')]||(_0x2bdf06[_0x01fb('0x61')]&&_0x2bdf06[_0x01fb('0x61')][0x1]?_0x2bdf06[_0x01fb('0x61')][0x1][_0x01fb('0x62')]:undefined)||_0x01fb('0x6a')},{'name':_0x01fb('0x6b'),'value':_0x2bdf06[_0x01fb('0x6b')]||(_0x2bdf06['attrs']&&_0x2bdf06[_0x01fb('0x61')][0x2]?_0x2bdf06[_0x01fb('0x61')][0x2][_0x01fb('0x62')]:undefined)||0xc}];case _0x01fb('0x6c'):return[{'name':'attrMetric','value':_0x2bdf06[_0x01fb('0x6d')]||(_0x2bdf06['attrs']&&_0x2bdf06[_0x01fb('0x61')][0x0]?_0x2bdf06[_0x01fb('0x61')][0x0]['value']:undefined)||'total'},{'name':_0x01fb('0x6e'),'value':_0x2bdf06['attrVoiceQueues']||(_0x2bdf06['attrs']&&_0x2bdf06['attrs'][0x1]?_0x2bdf06[_0x01fb('0x61')][0x1][_0x01fb('0x62')]:undefined)||[]},{'name':_0x01fb('0x6b'),'value':_0x2bdf06[_0x01fb('0x6b')]||(_0x2bdf06[_0x01fb('0x61')]&&_0x2bdf06[_0x01fb('0x61')][0x2]?_0x2bdf06['attrs'][0x2][_0x01fb('0x62')]:undefined)||0x14}];case _0x01fb('0x6f'):case _0x01fb('0x70'):return[{'name':_0x01fb('0x71'),'value':_0x2bdf06['attrSerie1']||(_0x2bdf06[_0x01fb('0x61')]&&_0x2bdf06[_0x01fb('0x61')][0x0]?_0x2bdf06['attrs'][0x0][_0x01fb('0x62')]:undefined)||_0x01fb('0x72')},{'name':_0x01fb('0x73'),'value':_0x2bdf06[_0x01fb('0x73')]||(_0x2bdf06[_0x01fb('0x61')]&&_0x2bdf06[_0x01fb('0x61')][0x1]?_0x2bdf06[_0x01fb('0x61')][0x1][_0x01fb('0x62')]:undefined)||null},{'name':_0x01fb('0x74'),'value':_0x2bdf06[_0x01fb('0x74')]||(_0x2bdf06[_0x01fb('0x61')]&&_0x2bdf06['attrs'][0x2]?_0x2bdf06['attrs'][0x2]['value']:undefined)||null},{'name':_0x01fb('0x6e'),'value':_0x2bdf06[_0x01fb('0x6e')]||(_0x2bdf06[_0x01fb('0x61')]&&_0x2bdf06[_0x01fb('0x61')][0x3]?_0x2bdf06[_0x01fb('0x61')][0x3][_0x01fb('0x62')]:undefined)||[]}];case _0x01fb('0x75'):return[{'name':_0x01fb('0x76'),'type':_0x2bdf06[_0x01fb('0x77')]||(_0x2bdf06[_0x01fb('0x61')]&&_0x2bdf06[_0x01fb('0x61')][0x0]?_0x2bdf06['attrs'][0x0]['type']:undefined)||null,'value':_0x2bdf06[_0x01fb('0x76')]||(_0x2bdf06[_0x01fb('0x61')]&&_0x2bdf06[_0x01fb('0x61')][0x0]?_0x2bdf06[_0x01fb('0x61')][0x0][_0x01fb('0x62')]:undefined)||null},{'name':_0x01fb('0x78'),'value':_0x2bdf06['attrRefresh']||(_0x2bdf06['attrs']&&_0x2bdf06[_0x01fb('0x61')][0x1]?_0x2bdf06['attrs'][0x1][_0x01fb('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x1b6fe4){logger[_0x01fb('0x2e')]('widgetAttributes:\x20%s',JSON[_0x01fb('0x79')](_0x1b6fe4));return[];}}exports[_0x01fb('0x7a')]=function(_0x5ead48,_0x957130,_0x1a94f3){if(_0x5ead48[_0x01fb('0x54')]['id']){delete _0x5ead48[_0x01fb('0x54')]['id'];}return db['Dashboard'][_0x01fb('0x51')]({'where':{'id':_0x5ead48[_0x01fb('0x50')]['id']}})[_0x01fb('0x2a')](handleEntityNotFound(_0x957130,null))[_0x01fb('0x2a')](function(_0x46591e){if(_0x46591e){_0x5ead48[_0x01fb('0x54')][_0x01fb('0x7b')]=_0x46591e['id'];_0x5ead48[_0x01fb('0x54')]['attrs']=widgetAttributes(_0x5ead48[_0x01fb('0x54')]);return db[_0x01fb('0x7c')]['create'](_0x5ead48[_0x01fb('0x54')]);}})['then'](respondWithResult(_0x957130,null))[_0x01fb('0x52')](handleError(_0x957130,null));};exports[_0x01fb('0x7d')]=function(_0x351c9a,_0x27a274,_0xf5381d){var _0x5e1f5a={};var _0x3c35f8={};var _0x592b40;var _0x2be40d;return db[_0x01fb('0x34')][_0x01fb('0x7e')]({'where':{'id':_0x351c9a['params']['id']}})[_0x01fb('0x2a')](handleEntityNotFound(_0x27a274,null))[_0x01fb('0x2a')](function(_0x2e470d){if(_0x2e470d){_0x592b40=_0x2e470d;_0x3c35f8[_0x01fb('0x39')]=_[_0x01fb('0x3b')](db[_0x01fb('0x7c')][_0x01fb('0x35')]);_0x3c35f8[_0x01fb('0x3a')]=_[_0x01fb('0x3b')](_0x351c9a[_0x01fb('0x3a')]);_0x3c35f8[_0x01fb('0x45')]=_['intersection'](_0x3c35f8[_0x01fb('0x39')],_0x3c35f8[_0x01fb('0x3a')]);_0x5e1f5a['attributes']=_['intersection'](_0x3c35f8['model'],qs[_0x01fb('0x3e')](_0x351c9a[_0x01fb('0x3a')]['fields']));_0x5e1f5a[_0x01fb('0x3d')]=_0x5e1f5a[_0x01fb('0x3d')][_0x01fb('0x3f')]?_0x5e1f5a['attributes']:_0x3c35f8[_0x01fb('0x39')];_0x5e1f5a[_0x01fb('0x42')]=qs[_0x01fb('0x43')](_0x351c9a[_0x01fb('0x3a')][_0x01fb('0x43')]);_0x5e1f5a[_0x01fb('0x44')]=qs[_0x01fb('0x45')](_['pick'](_0x351c9a['query'],_0x3c35f8['filters']));if(_0x351c9a[_0x01fb('0x3a')]['filter']){_0x5e1f5a[_0x01fb('0x44')]=_['merge'](_0x5e1f5a[_0x01fb('0x44')],{'$or':_['map'](_0x5e1f5a['attributes'],function(_0x13083e){var _0x485b87={};_0x485b87[_0x13083e]={'$like':'%'+_0x351c9a['query'][_0x01fb('0x49')]+'%'};return _0x485b87;})});}_0x5e1f5a=_[_0x01fb('0x47')]({},_0x5e1f5a,_0x351c9a['options']);return _0x592b40[_0x01fb('0x7d')](_0x5e1f5a);}})['then'](function(_0x4492b6){if(_0x4492b6){_0x2be40d=_0x4492b6[_0x01fb('0x3f')];if(!_0x351c9a['query'][_0x01fb('0x40')]('nolimit')){_0x5e1f5a['limit']=qs[_0x01fb('0x23')](_0x351c9a['query'][_0x01fb('0x23')]);_0x5e1f5a[_0x01fb('0x20')]=qs[_0x01fb('0x20')](_0x351c9a[_0x01fb('0x3a')]['offset']);}return _0x592b40[_0x01fb('0x7d')](_0x5e1f5a);}})[_0x01fb('0x2a')](function(_0x3cbfaf){if(_0x3cbfaf){return _0x3cbfaf?{'count':_0x2be40d,'rows':_0x3cbfaf}:null;}})[_0x01fb('0x2a')](respondWithResult(_0x27a274,null))[_0x01fb('0x52')](handleError(_0x27a274,null));};
\ No newline at end of file
+var _0x7a79=['HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','DashboardId','getItems','findOne','DashboardItem','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','clone','omit','createdAt','updatedAt','body','attrUrl','attrs','value','https://','custom','attrPath','attrHourFormat'];(function(_0x5521cd,_0x5875a3){var _0x143ffe=function(_0x5ecdd9){while(--_0x5ecdd9){_0x5521cd['push'](_0x5521cd['shift']());}};_0x143ffe(++_0x5875a3);}(_0x7a79,0xfc));var _0x97a7=function(_0x439790,_0x2f4e02){_0x439790=_0x439790-0x0;var _0x1275ab=_0x7a79[_0x439790];return _0x1275ab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x97a7('0x0'));var rp=require('request-promise');var moment=require(_0x97a7('0x1'));var BPromise=require(_0x97a7('0x2'));var Mustache=require(_0x97a7('0x3'));var util=require('util');var path=require(_0x97a7('0x4'));var sox=require('sox');var csv=require(_0x97a7('0x5'));var ejs=require(_0x97a7('0x6'));var fs=require('fs');var fs_extra=require(_0x97a7('0x7'));var _=require(_0x97a7('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x97a7('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x97a7('0xa'));var Papa=require('papaparse');var Redis=require(_0x97a7('0xb'));var authService=require(_0x97a7('0xc'));var qs=require(_0x97a7('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x97a7('0xe'));var logger=require(_0x97a7('0xf'))(_0x97a7('0x10'));var utils=require(_0x97a7('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x97a7('0x12'))['db'];config[_0x97a7('0x13')]=_[_0x97a7('0x14')](config[_0x97a7('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x97a7('0x15'))(new Redis(config[_0x97a7('0x13')]));require(_0x97a7('0x16'))[_0x97a7('0x17')](socket);function respondWithStatusCode(_0xa4818,_0x405c9f){_0x405c9f=_0x405c9f||0xcc;return function(_0x1548d8){if(_0x1548d8){return _0xa4818[_0x97a7('0x18')](_0x405c9f);}return _0xa4818[_0x97a7('0x19')](_0x405c9f)[_0x97a7('0x1a')]();};}function respondWithResult(_0x5bb190,_0x2fbf3d){_0x2fbf3d=_0x2fbf3d||0xc8;return function(_0x19cbc1){if(_0x19cbc1){return _0x5bb190[_0x97a7('0x19')](_0x2fbf3d)[_0x97a7('0x1b')](_0x19cbc1);}};}function respondWithFilteredResult(_0x212223,_0x26ddf4){return function(_0x277b79){if(_0x277b79){var _0x14d8da=typeof _0x26ddf4[_0x97a7('0x1c')]==='undefined'&&typeof _0x26ddf4[_0x97a7('0x1d')]==='undefined';var _0x287b0f=_0x277b79[_0x97a7('0x1e')];var _0x4adf31=_0x14d8da?0x0:_0x26ddf4[_0x97a7('0x1c')];var _0x2f8bbc=_0x14d8da?_0x277b79[_0x97a7('0x1e')]:_0x26ddf4[_0x97a7('0x1c')]+_0x26ddf4['limit'];var _0x42133f;if(_0x2f8bbc>=_0x287b0f){_0x2f8bbc=_0x287b0f;_0x42133f=0xc8;}else{_0x42133f=0xce;}_0x212223[_0x97a7('0x19')](_0x42133f);return _0x212223['set'](_0x97a7('0x1f'),_0x4adf31+'-'+_0x2f8bbc+'/'+_0x287b0f)[_0x97a7('0x1b')](_0x277b79);}return null;};}function patchUpdates(_0x3c2987){return function(_0x461e2b){try{jsonpatch[_0x97a7('0x20')](_0x461e2b,_0x3c2987,!![]);}catch(_0x2974ad){return BPromise[_0x97a7('0x21')](_0x2974ad);}return _0x461e2b[_0x97a7('0x22')]();};}function saveUpdates(_0x8321fc,_0x48cbcf){return function(_0x479119){if(_0x479119){return _0x479119[_0x97a7('0x23')](_0x8321fc)[_0x97a7('0x24')](function(_0x3aa135){return _0x3aa135;});}return null;};}function removeEntity(_0x1b98d7,_0x490db7){return function(_0x1fdbbd){if(_0x1fdbbd){return _0x1fdbbd[_0x97a7('0x25')]()['then'](function(){var _0x34decb=_0x1fdbbd[_0x97a7('0x26')]({'plain':!![]});var _0x4a3418=_0x97a7('0x27');return db[_0x97a7('0x28')]['destroy']({'where':{'type':_0x4a3418,'resourceId':_0x34decb['id']}})[_0x97a7('0x24')](function(){return _0x1fdbbd;});})[_0x97a7('0x24')](function(){_0x1b98d7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34b094,_0x15e74d){return function(_0x6e261d){if(!_0x6e261d){_0x34b094['sendStatus'](0x194);}return _0x6e261d;};}function handleError(_0xcda3ca,_0x1e5ce6){_0x1e5ce6=_0x1e5ce6||0x1f4;return function(_0x49b34e){logger[_0x97a7('0x29')](_0x49b34e[_0x97a7('0x2a')]);if(_0x49b34e['name']){delete _0x49b34e[_0x97a7('0x2b')];}_0xcda3ca[_0x97a7('0x19')](_0x1e5ce6)[_0x97a7('0x2c')](_0x49b34e);};}exports[_0x97a7('0x2d')]=function(_0x4f9702,_0x53348e){var _0x440c5b={},_0x364490={},_0x4ca852={'count':0x0,'rows':[]};var _0x5c53e3=_[_0x97a7('0x2e')](db[_0x97a7('0x2f')][_0x97a7('0x30')],function(_0x153741){return{'name':_0x153741[_0x97a7('0x31')],'type':_0x153741[_0x97a7('0x32')][_0x97a7('0x33')]};});_0x364490[_0x97a7('0x34')]=_[_0x97a7('0x2e')](_0x5c53e3,'name');_0x364490[_0x97a7('0x35')]=_[_0x97a7('0x36')](_0x4f9702['query']);_0x364490[_0x97a7('0x37')]=_['intersection'](_0x364490[_0x97a7('0x34')],_0x364490[_0x97a7('0x35')]);_0x440c5b[_0x97a7('0x38')]=_[_0x97a7('0x39')](_0x364490['model'],qs[_0x97a7('0x3a')](_0x4f9702[_0x97a7('0x35')]['fields']));_0x440c5b[_0x97a7('0x38')]=_0x440c5b['attributes'][_0x97a7('0x3b')]?_0x440c5b['attributes']:_0x364490[_0x97a7('0x34')];if(!_0x4f9702[_0x97a7('0x35')][_0x97a7('0x3c')](_0x97a7('0x3d'))){_0x440c5b[_0x97a7('0x1d')]=qs['limit'](_0x4f9702['query']['limit']);_0x440c5b[_0x97a7('0x1c')]=qs['offset'](_0x4f9702[_0x97a7('0x35')]['offset']);}_0x440c5b[_0x97a7('0x3e')]=qs[_0x97a7('0x3f')](_0x4f9702[_0x97a7('0x35')][_0x97a7('0x3f')]);_0x440c5b['where']=qs[_0x97a7('0x37')](_[_0x97a7('0x40')](_0x4f9702[_0x97a7('0x35')],_0x364490[_0x97a7('0x37')]),_0x5c53e3);if(_0x4f9702[_0x97a7('0x35')][_0x97a7('0x41')]){_0x440c5b[_0x97a7('0x42')]=_[_0x97a7('0x43')](_0x440c5b[_0x97a7('0x42')],{'$or':_[_0x97a7('0x2e')](_0x5c53e3,function(_0xcb6816){if(_0xcb6816['type']!==_0x97a7('0x44')){var _0xd63fb4={};_0xd63fb4[_0xcb6816[_0x97a7('0x2b')]]={'$like':'%'+_0x4f9702[_0x97a7('0x35')][_0x97a7('0x41')]+'%'};return _0xd63fb4;}})});}_0x440c5b=_['merge']({},_0x440c5b,_0x4f9702[_0x97a7('0x45')]);var _0x432960={'where':_0x440c5b[_0x97a7('0x42')]};return db[_0x97a7('0x2f')][_0x97a7('0x1e')](_0x432960)[_0x97a7('0x24')](function(_0x3e98c4){_0x4ca852[_0x97a7('0x1e')]=_0x3e98c4;if(_0x4f9702[_0x97a7('0x35')][_0x97a7('0x46')]){_0x440c5b[_0x97a7('0x47')]=[{'all':!![]}];}return db[_0x97a7('0x2f')][_0x97a7('0x48')](_0x440c5b);})['then'](function(_0x1031b8){_0x4ca852['rows']=_0x1031b8;return _0x4ca852;})['then'](respondWithFilteredResult(_0x53348e,_0x440c5b))[_0x97a7('0x49')](handleError(_0x53348e,null));};exports[_0x97a7('0x4a')]=function(_0x24d1d4,_0x45c30f){var _0x1c93d9={'raw':![],'where':{'id':_0x24d1d4[_0x97a7('0x4b')]['id']}},_0x2300b0={};_0x2300b0[_0x97a7('0x34')]=_[_0x97a7('0x36')](db[_0x97a7('0x2f')][_0x97a7('0x30')]);_0x2300b0[_0x97a7('0x35')]=_['keys'](_0x24d1d4[_0x97a7('0x35')]);_0x2300b0[_0x97a7('0x37')]=_[_0x97a7('0x39')](_0x2300b0[_0x97a7('0x34')],_0x2300b0[_0x97a7('0x35')]);_0x1c93d9[_0x97a7('0x38')]=_[_0x97a7('0x39')](_0x2300b0['model'],qs[_0x97a7('0x3a')](_0x24d1d4[_0x97a7('0x35')][_0x97a7('0x3a')]));_0x1c93d9[_0x97a7('0x38')]=_0x1c93d9['attributes']['length']?_0x1c93d9[_0x97a7('0x38')]:_0x2300b0[_0x97a7('0x34')];if(_0x24d1d4[_0x97a7('0x35')][_0x97a7('0x46')]){_0x1c93d9[_0x97a7('0x47')]=[{'all':!![]}];}_0x1c93d9=_['merge']({},_0x1c93d9,_0x24d1d4['options']);return db[_0x97a7('0x2f')]['find'](_0x1c93d9)[_0x97a7('0x24')](handleEntityNotFound(_0x45c30f,null))['then'](respondWithResult(_0x45c30f,null))[_0x97a7('0x49')](handleError(_0x45c30f,null));};exports[_0x97a7('0x4c')]=function(_0x4eaf6c,_0x284aa1){return db[_0x97a7('0x2f')]['create'](_0x4eaf6c['body'],{})['then'](function(_0x1b77ae){var _0x9f311e=_0x4eaf6c[_0x97a7('0x4d')][_0x97a7('0x26')]({'plain':!![]});if(!_0x9f311e)throw new Error(_0x97a7('0x4e'));if(_0x9f311e[_0x97a7('0x4f')]===_0x97a7('0x4d')){var _0x4365c4=_0x1b77ae[_0x97a7('0x26')]({'plain':!![]});var _0xc35155=_0x97a7('0x27');return db[_0x97a7('0x50')][_0x97a7('0x51')]({'where':{'name':_0xc35155,'userProfileId':_0x9f311e[_0x97a7('0x52')]},'raw':!![]})[_0x97a7('0x24')](function(_0x4429fe){if(_0x4429fe&&_0x4429fe[_0x97a7('0x53')]===0x0){return db['UserProfileResource'][_0x97a7('0x4c')]({'name':_0x4365c4[_0x97a7('0x2b')],'resourceId':_0x4365c4['id'],'type':_0x4429fe[_0x97a7('0x2b')],'sectionId':_0x4429fe['id']},{})[_0x97a7('0x24')](function(){return _0x1b77ae;});}else{return _0x1b77ae;}})[_0x97a7('0x49')](function(_0x10a8bd){logger[_0x97a7('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10a8bd);throw _0x10a8bd;});}return _0x1b77ae;})['then'](respondWithResult(_0x284aa1,0xc9))['catch'](handleError(_0x284aa1,null));};exports[_0x97a7('0x54')]=function(_0xb8fa70,_0x5f58ba){var _0x5b31d3={'where':{'id':_0xb8fa70[_0x97a7('0x4b')]['id']}},_0x1ae011={};_0x1ae011['model']=_['keys'](db[_0x97a7('0x2f')][_0x97a7('0x30')]);_0x5b31d3[_0x97a7('0x38')]=_[_0x97a7('0x39')](_0x1ae011[_0x97a7('0x34')],qs[_0x97a7('0x3a')](_0xb8fa70[_0x97a7('0x35')][_0x97a7('0x3a')]));_0x5b31d3[_0x97a7('0x38')]=_0x5b31d3[_0x97a7('0x38')][_0x97a7('0x3b')]?_0x5b31d3[_0x97a7('0x38')]:_0x1ae011[_0x97a7('0x34')];if(_0xb8fa70[_0x97a7('0x35')]['includeAll']){_0x5b31d3[_0x97a7('0x47')]=[{'all':!![]}];}_0x5b31d3=_[_0x97a7('0x43')]({},_0x5b31d3,_0xb8fa70['options']);return db[_0x97a7('0x2f')]['find'](_0x5b31d3)['then'](handleEntityNotFound(_0x5f58ba,null))[_0x97a7('0x24')](function(_0x467798){if(_0x467798){var _0x467f47=_0x467798[_0x97a7('0x26')]({'plain':!![]});_0x467f47=qs[_0x97a7('0x55')](_0x467f47,['id',_0x97a7('0x56'),_0x97a7('0x57')]);_0xb8fa70[_0x97a7('0x58')]=_['omit'](_0xb8fa70['body'],['id','createdAt',_0x97a7('0x57')]);return db['Dashboard'][_0x97a7('0x4c')](_[_0x97a7('0x43')](_0x467f47,_0xb8fa70[_0x97a7('0x58')]),{'include':_0xb8fa70[_0x97a7('0x35')][_0x97a7('0x46')]?[{'all':!![]}]:undefined})[_0x97a7('0x24')](function(_0x2ee613){var _0x2bd366=_0xb8fa70[_0x97a7('0x4d')][_0x97a7('0x26')]({'plain':!![]});if(!_0x2bd366)throw new Error(_0x97a7('0x4e'));if(_0x2bd366[_0x97a7('0x4f')]===_0x97a7('0x4d')){var _0x514f46=_0x2ee613['get']({'plain':!![]});var _0x512d59='CustomDashboards';return db[_0x97a7('0x50')]['find']({'where':{'name':_0x512d59,'userProfileId':_0x2bd366[_0x97a7('0x52')]},'raw':!![]})[_0x97a7('0x24')](function(_0x133d3e){if(_0x133d3e&&_0x133d3e[_0x97a7('0x53')]===0x0){return db[_0x97a7('0x28')][_0x97a7('0x4c')]({'name':_0x514f46[_0x97a7('0x2b')],'resourceId':_0x514f46['id'],'type':_0x133d3e[_0x97a7('0x2b')],'sectionId':_0x133d3e['id']},{})['then'](function(){return _0x2ee613;});}else{return _0x2ee613;}})[_0x97a7('0x49')](function(_0x504c2b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x504c2b);throw _0x504c2b;});}return _0x2ee613;});}})[_0x97a7('0x24')](respondWithResult(_0x5f58ba,0xc9))[_0x97a7('0x49')](handleError(_0x5f58ba,null));};exports[_0x97a7('0x23')]=function(_0x2bb323,_0x31e550){if(_0x2bb323[_0x97a7('0x58')]['id']){delete _0x2bb323[_0x97a7('0x58')]['id'];}return db['Dashboard'][_0x97a7('0x51')]({'where':{'id':_0x2bb323[_0x97a7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x31e550,null))['then'](saveUpdates(_0x2bb323['body'],null))[_0x97a7('0x24')](respondWithResult(_0x31e550,null))[_0x97a7('0x49')](handleError(_0x31e550,null));};exports[_0x97a7('0x25')]=function(_0x45f7fc,_0x3a5656){return db[_0x97a7('0x2f')][_0x97a7('0x51')]({'where':{'id':_0x45f7fc['params']['id']}})[_0x97a7('0x24')](handleEntityNotFound(_0x3a5656,null))['then'](removeEntity(_0x3a5656,null))[_0x97a7('0x49')](handleError(_0x3a5656,null));};function widgetAttributes(_0x1e5ae9){try{switch(_0x1e5ae9['type']){case'iframe':return[{'name':_0x97a7('0x59'),'value':_0x1e5ae9[_0x97a7('0x59')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x0]?_0x1e5ae9[_0x97a7('0x5a')][0x0][_0x97a7('0x5b')]:undefined)||_0x97a7('0x5c')}];case _0x97a7('0x5d'):return[{'name':_0x97a7('0x5e'),'value':_0x1e5ae9[_0x97a7('0x5e')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x0]?_0x1e5ae9[_0x97a7('0x5a')][0x0][_0x97a7('0x5b')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x1e5ae9[_0x97a7('0x5f')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x0]?_0x1e5ae9[_0x97a7('0x5a')][0x0][_0x97a7('0x5b')]:undefined)||_0x97a7('0x60')},{'name':_0x97a7('0x61'),'value':_0x1e5ae9['attrTimezone']||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x1]?_0x1e5ae9[_0x97a7('0x5a')][0x1][_0x97a7('0x5b')]:undefined)||'0.00'},{'name':_0x97a7('0x62'),'value':_0x1e5ae9[_0x97a7('0x62')]||(_0x1e5ae9['attrs']&&_0x1e5ae9[_0x97a7('0x5a')][0x2]?_0x1e5ae9[_0x97a7('0x5a')][0x2]['value']:undefined)||0xc}];case _0x97a7('0x63'):return[{'name':_0x97a7('0x64'),'value':_0x1e5ae9[_0x97a7('0x64')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x0]?_0x1e5ae9['attrs'][0x0][_0x97a7('0x5b')]:undefined)||_0x97a7('0x65')},{'name':'attrVoiceQueues','value':_0x1e5ae9['attrVoiceQueues']||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x1]?_0x1e5ae9[_0x97a7('0x5a')][0x1][_0x97a7('0x5b')]:undefined)||[]},{'name':_0x97a7('0x62'),'value':_0x1e5ae9[_0x97a7('0x62')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x2]?_0x1e5ae9['attrs'][0x2]['value']:undefined)||0x14}];case _0x97a7('0x66'):case _0x97a7('0x67'):return[{'name':_0x97a7('0x68'),'value':_0x1e5ae9[_0x97a7('0x68')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x0]?_0x1e5ae9[_0x97a7('0x5a')][0x0][_0x97a7('0x5b')]:undefined)||_0x97a7('0x65')},{'name':_0x97a7('0x69'),'value':_0x1e5ae9[_0x97a7('0x69')]||(_0x1e5ae9['attrs']&&_0x1e5ae9[_0x97a7('0x5a')][0x1]?_0x1e5ae9[_0x97a7('0x5a')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x1e5ae9[_0x97a7('0x6a')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x2]?_0x1e5ae9[_0x97a7('0x5a')][0x2]['value']:undefined)||null},{'name':_0x97a7('0x6b'),'value':_0x1e5ae9['attrVoiceQueues']||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x3]?_0x1e5ae9[_0x97a7('0x5a')][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':_0x97a7('0x6c'),'type':_0x1e5ae9[_0x97a7('0x6d')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9['attrs'][0x0]?_0x1e5ae9['attrs'][0x0][_0x97a7('0x32')]:undefined)||null,'value':_0x1e5ae9[_0x97a7('0x6c')]||(_0x1e5ae9[_0x97a7('0x5a')]&&_0x1e5ae9[_0x97a7('0x5a')][0x0]?_0x1e5ae9['attrs'][0x0]['value']:undefined)||null},{'name':_0x97a7('0x6e'),'value':_0x1e5ae9[_0x97a7('0x6e')]||(_0x1e5ae9['attrs']&&_0x1e5ae9[_0x97a7('0x5a')][0x1]?_0x1e5ae9[_0x97a7('0x5a')][0x1][_0x97a7('0x5b')]:undefined)||0x0}];default:return[];}}catch(_0x3393a9){logger[_0x97a7('0x29')](_0x97a7('0x6f'),JSON['stringify'](_0x3393a9));return[];}}exports['addItem']=function(_0x57e5ea,_0x543e07,_0xca723b){if(_0x57e5ea[_0x97a7('0x58')]['id']){delete _0x57e5ea[_0x97a7('0x58')]['id'];}return db['Dashboard'][_0x97a7('0x51')]({'where':{'id':_0x57e5ea['params']['id']}})[_0x97a7('0x24')](handleEntityNotFound(_0x543e07,null))['then'](function(_0x50b3a3){if(_0x50b3a3){_0x57e5ea[_0x97a7('0x58')][_0x97a7('0x70')]=_0x50b3a3['id'];_0x57e5ea[_0x97a7('0x58')]['attrs']=widgetAttributes(_0x57e5ea[_0x97a7('0x58')]);return db['DashboardItem'][_0x97a7('0x4c')](_0x57e5ea[_0x97a7('0x58')]);}})[_0x97a7('0x24')](respondWithResult(_0x543e07,null))[_0x97a7('0x49')](handleError(_0x543e07,null));};exports[_0x97a7('0x71')]=function(_0x1dcb9f,_0x1b369d,_0x2b501f){var _0x344db7={};var _0x5ad0c6={};var _0x4b2b1d;var _0x5ddc51;return db['Dashboard'][_0x97a7('0x72')]({'where':{'id':_0x1dcb9f[_0x97a7('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1b369d,null))['then'](function(_0x150776){if(_0x150776){_0x4b2b1d=_0x150776;_0x5ad0c6['model']=_[_0x97a7('0x36')](db[_0x97a7('0x73')][_0x97a7('0x30')]);_0x5ad0c6[_0x97a7('0x35')]=_['keys'](_0x1dcb9f['query']);_0x5ad0c6[_0x97a7('0x37')]=_[_0x97a7('0x39')](_0x5ad0c6[_0x97a7('0x34')],_0x5ad0c6[_0x97a7('0x35')]);_0x344db7[_0x97a7('0x38')]=_[_0x97a7('0x39')](_0x5ad0c6[_0x97a7('0x34')],qs[_0x97a7('0x3a')](_0x1dcb9f['query'][_0x97a7('0x3a')]));_0x344db7[_0x97a7('0x38')]=_0x344db7[_0x97a7('0x38')][_0x97a7('0x3b')]?_0x344db7[_0x97a7('0x38')]:_0x5ad0c6[_0x97a7('0x34')];_0x344db7[_0x97a7('0x3e')]=qs[_0x97a7('0x3f')](_0x1dcb9f[_0x97a7('0x35')][_0x97a7('0x3f')]);_0x344db7[_0x97a7('0x42')]=qs[_0x97a7('0x37')](_[_0x97a7('0x40')](_0x1dcb9f[_0x97a7('0x35')],_0x5ad0c6['filters']));if(_0x1dcb9f[_0x97a7('0x35')][_0x97a7('0x41')]){_0x344db7[_0x97a7('0x42')]=_[_0x97a7('0x43')](_0x344db7['where'],{'$or':_[_0x97a7('0x2e')](_0x344db7[_0x97a7('0x38')],function(_0x34f9dc){var _0x19166b={};_0x19166b[_0x34f9dc]={'$like':'%'+_0x1dcb9f[_0x97a7('0x35')][_0x97a7('0x41')]+'%'};return _0x19166b;})});}_0x344db7=_[_0x97a7('0x43')]({},_0x344db7,_0x1dcb9f[_0x97a7('0x45')]);return _0x4b2b1d[_0x97a7('0x71')](_0x344db7);}})[_0x97a7('0x24')](function(_0x8052c4){if(_0x8052c4){_0x5ddc51=_0x8052c4[_0x97a7('0x3b')];if(!_0x1dcb9f[_0x97a7('0x35')][_0x97a7('0x3c')]('nolimit')){_0x344db7[_0x97a7('0x1d')]=qs[_0x97a7('0x1d')](_0x1dcb9f[_0x97a7('0x35')][_0x97a7('0x1d')]);_0x344db7[_0x97a7('0x1c')]=qs['offset'](_0x1dcb9f[_0x97a7('0x35')]['offset']);}return _0x4b2b1d[_0x97a7('0x71')](_0x344db7);}})[_0x97a7('0x24')](function(_0x167463){if(_0x167463){return _0x167463?{'count':_0x5ddc51,'rows':_0x167463}:null;}})[_0x97a7('0x24')](respondWithResult(_0x1b369d,null))[_0x97a7('0x49')](handleError(_0x1b369d,null));};
\ No newline at end of file
index 5aee7cd..7646956 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc69b=['Dashboard','save','update','remove','emit','hook','exports','events'];(function(_0x2cd09e,_0xa9897a){var _0x2884a7=function(_0x2e61bc){while(--_0x2e61bc){_0x2cd09e['push'](_0x2cd09e['shift']());}};_0x2884a7(++_0xa9897a);}(_0xc69b,0xcf));var _0xbc69=function(_0x2786ea,_0x16c3c3){_0x2786ea=_0x2786ea-0x0;var _0x5c38e5=_0xc69b[_0x2786ea];return _0x5c38e5;};'use strict';var EventEmitter=require(_0xbc69('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xbc69('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbc69('0x2'),'afterUpdate':_0xbc69('0x3'),'afterDestroy':_0xbc69('0x4')};function emitEvent(_0x4aec7f){return function(_0xdf60e4,_0x4ee44b,_0x59fd9b){DashboardEvents[_0xbc69('0x5')](_0x4aec7f+':'+_0xdf60e4['id'],_0xdf60e4);DashboardEvents[_0xbc69('0x5')](_0x4aec7f,_0xdf60e4);_0x59fd9b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xbc69('0x6')](e,emitEvent(event));}}module[_0xbc69('0x7')]=DashboardEvents;
\ No newline at end of file
+var _0x32f3=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','Dashboard','setMaxListeners','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x32f3,0xd4));var _0x332f=function(_0x36ac8b,_0x19cf8e){_0x36ac8b=_0x36ac8b-0x0;var _0x5003b9=_0x32f3[_0x36ac8b];return _0x5003b9;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x332f('0x0'))['db'][_0x332f('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x332f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x332f('0x3'),'afterDestroy':_0x332f('0x4')};function emitEvent(_0x1f8a06){return function(_0x59f1b8,_0x66f96d,_0x4161bc){DashboardEvents[_0x332f('0x5')](_0x1f8a06+':'+_0x59f1b8['id'],_0x59f1b8);DashboardEvents[_0x332f('0x5')](_0x1f8a06,_0x59f1b8);_0x4161bc(null);};}for(var e in events){if(events[_0x332f('0x6')](e)){var event=events[e];Dashboard[_0x332f('0x7')](e,emitEvent(event));}}module[_0x332f('0x8')]=DashboardEvents;
\ No newline at end of file
index 7260e31..f04a8a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51ab=['define','Dashboard','dashboards','../../config/logger','bluebird','request-promise','./dashboard.attributes','exports'];(function(_0x18bca2,_0x2ae078){var _0x5ee25d=function(_0x275352){while(--_0x275352){_0x18bca2['push'](_0x18bca2['shift']());}};_0x5ee25d(++_0x2ae078);}(_0x51ab,0x103));var _0xb51a=function(_0x506ffc,_0x305e08){_0x506ffc=_0x506ffc-0x0;var _0x478db7=_0x51ab[_0x506ffc];return _0x478db7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb51a('0x0'))('api');var moment=require('moment');var BPromise=require(_0xb51a('0x1'));var rp=require(_0xb51a('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb51a('0x3'));module[_0xb51a('0x4')]=function(_0x5400f0,_0x394d92){return _0x5400f0[_0xb51a('0x5')](_0xb51a('0x6'),attributes,{'tableName':_0xb51a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xeabf=['../../config/environment','exports','Dashboard','dashboards','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x4c5b87,_0x4bb889){var _0x166de3=function(_0x5cb872){while(--_0x5cb872){_0x4c5b87['push'](_0x4c5b87['shift']());}};_0x166de3(++_0x4bb889);}(_0xeabf,0x159));var _0xfeab=function(_0x248166,_0x36ec54){_0x248166=_0x248166-0x0;var _0x5d364e=_0xeabf[_0x248166];return _0x5d364e;};'use strict';var _=require(_0xfeab('0x0'));var util=require(_0xfeab('0x1'));var logger=require('../../config/logger')(_0xfeab('0x2'));var moment=require(_0xfeab('0x3'));var BPromise=require(_0xfeab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfeab('0x5'));var rimraf=require(_0xfeab('0x6'));var config=require(_0xfeab('0x7'));var attributes=require('./dashboard.attributes');module[_0xfeab('0x8')]=function(_0x30b8fe,_0x5bd151){return _0x30b8fe['define'](_0xfeab('0x9'),attributes,{'tableName':_0xfeab('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a14d935..a18e2f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3fff=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x44dfa1,_0x40e91d){var _0x1d74ab=function(_0xa65bb){while(--_0xa65bb){_0x44dfa1['push'](_0x44dfa1['shift']());}};_0x1d74ab(++_0x40e91d);}(_0x3fff,0x8d));var _0xf3ff=function(_0x4e13b0,_0x1ca561){_0x4e13b0=_0x4e13b0-0x0;var _0x5c2a63=_0x3fff[_0x4e13b0];return _0x5c2a63;};'use strict';var _=require(_0xf3ff('0x0'));var util=require(_0xf3ff('0x1'));var moment=require(_0xf3ff('0x2'));var BPromise=require(_0xf3ff('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf3ff('0x4'));var db=require(_0xf3ff('0x5'))['db'];var utils=require(_0xf3ff('0x6'));var logger=require(_0xf3ff('0x7'))(_0xf3ff('0x8'));var config=require(_0xf3ff('0x9'));var jayson=require(_0xf3ff('0xa'));var client=jayson[_0xf3ff('0xb')][_0xf3ff('0xc')]({'port':0x232a});config[_0xf3ff('0xd')]=_[_0xf3ff('0xe')](config[_0xf3ff('0xd')],{'host':_0xf3ff('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0xf3ff('0x10')](socket);function respondWithRpcPromise(_0x3d2c02,_0x362db8,_0x41a068){return new BPromise(function(_0x3c4210,_0x178438){return client[_0xf3ff('0x11')](_0x3d2c02,_0x41a068)['then'](function(_0x2a3d43){logger['info'](_0xf3ff('0x12'),_0x362db8,_0xf3ff('0x13'));logger[_0xf3ff('0x14')](_0xf3ff('0x15'),_0x362db8,_0xf3ff('0x13'),JSON[_0xf3ff('0x16')](_0x2a3d43));if(_0x2a3d43[_0xf3ff('0x17')]){if(_0x2a3d43[_0xf3ff('0x17')][_0xf3ff('0x18')]===0x1f4){logger[_0xf3ff('0x17')](_0xf3ff('0x12'),_0x362db8,_0x2a3d43[_0xf3ff('0x17')][_0xf3ff('0x19')]);return _0x178438(_0x2a3d43[_0xf3ff('0x17')]['message']);}logger[_0xf3ff('0x17')](_0xf3ff('0x12'),_0x362db8,_0x2a3d43[_0xf3ff('0x17')][_0xf3ff('0x19')]);return _0x3c4210(_0x2a3d43[_0xf3ff('0x17')]['message']);}else{logger[_0xf3ff('0x1a')](_0xf3ff('0x12'),_0x362db8,'request\x20sent');_0x3c4210(_0x2a3d43['result'][_0xf3ff('0x19')]);}})[_0xf3ff('0x1b')](function(_0x320338){logger['error'](_0xf3ff('0x12'),_0x362db8,_0x320338);_0x178438(_0x320338);});});}
\ No newline at end of file
+var _0x9dbe=['../../config/logger','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9dbe,0x1e8));var _0xe9db=function(_0x371b36,_0x8606f7){_0x371b36=_0x371b36-0x0;var _0x449638=_0x9dbe[_0x371b36];return _0x449638;};'use strict';var _=require(_0xe9db('0x0'));var util=require(_0xe9db('0x1'));var moment=require(_0xe9db('0x2'));var BPromise=require(_0xe9db('0x3'));var rs=require(_0xe9db('0x4'));var fs=require('fs');var Redis=require(_0xe9db('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe9db('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe9db('0x7')][_0xe9db('0x8')]({'port':0x232a});config[_0xe9db('0x9')]=_['defaults'](config[_0xe9db('0x9')],{'host':_0xe9db('0xa'),'port':0x18eb});var socket=require(_0xe9db('0xb'))(new Redis(config[_0xe9db('0x9')]));require(_0xe9db('0xc'))[_0xe9db('0xd')](socket);function respondWithRpcPromise(_0x4974f7,_0x511750,_0x5505cc){return new BPromise(function(_0x387d3d,_0x3927c4){return client[_0xe9db('0xe')](_0x4974f7,_0x5505cc)[_0xe9db('0xf')](function(_0x296174){logger['info'](_0xe9db('0x10'),_0x511750,'request\x20sent');logger['debug'](_0xe9db('0x11'),_0x511750,'request\x20sent',JSON[_0xe9db('0x12')](_0x296174));if(_0x296174[_0xe9db('0x13')]){if(_0x296174[_0xe9db('0x13')][_0xe9db('0x14')]===0x1f4){logger[_0xe9db('0x13')]('Dashboard,\x20%s,\x20%s',_0x511750,_0x296174[_0xe9db('0x13')][_0xe9db('0x15')]);return _0x3927c4(_0x296174['error'][_0xe9db('0x15')]);}logger[_0xe9db('0x13')]('Dashboard,\x20%s,\x20%s',_0x511750,_0x296174['error'][_0xe9db('0x15')]);return _0x387d3d(_0x296174[_0xe9db('0x13')][_0xe9db('0x15')]);}else{logger[_0xe9db('0x16')]('Dashboard,\x20%s,\x20%s',_0x511750,_0xe9db('0x17'));_0x387d3d(_0x296174[_0xe9db('0x18')][_0xe9db('0x15')]);}})[_0xe9db('0x19')](function(_0x301c91){logger[_0xe9db('0x13')](_0xe9db('0x10'),_0x511750,_0x301c91);_0x3927c4(_0x301c91);});});}
\ No newline at end of file
index 4b1f3fb..fa788e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca05=['emit','register','length','dashboard:','./dashboard.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xca05,0x94));var _0x5ca0=function(_0x4cefc3,_0x23f291){_0x4cefc3=_0x4cefc3-0x0;var _0x1cc779=_0xca05[_0x4cefc3];return _0x1cc779;};'use strict';var DashboardEvents=require(_0x5ca0('0x0'));var events=[_0x5ca0('0x1'),'remove','update'];function createListener(_0x5e03e5,_0x2c9ae2){return function(_0x39f2e1){_0x2c9ae2[_0x5ca0('0x2')](_0x5e03e5,_0x39f2e1);};}function removeListener(_0x34b004,_0x53dda9){return function(){DashboardEvents['removeListener'](_0x34b004,_0x53dda9);};}exports[_0x5ca0('0x3')]=function(_0x422908){for(var _0x3a5e49=0x0,_0x3096d2=events[_0x5ca0('0x4')];_0x3a5e49<_0x3096d2;_0x3a5e49++){var _0x1b7e7d=events[_0x3a5e49];var _0x3e4a72=createListener(_0x5ca0('0x5')+_0x1b7e7d,_0x422908);DashboardEvents['on'](_0x1b7e7d,_0x3e4a72);}};
\ No newline at end of file
+var _0x842d=['./dashboard.events','save','remove','update','emit','removeListener','register'];(function(_0x5b1698,_0x4624a8){var _0x1b416e=function(_0xa8db71){while(--_0xa8db71){_0x5b1698['push'](_0x5b1698['shift']());}};_0x1b416e(++_0x4624a8);}(_0x842d,0x7e));var _0xd842=function(_0x12a2a6,_0x374ff1){_0x12a2a6=_0x12a2a6-0x0;var _0x1754ae=_0x842d[_0x12a2a6];return _0x1754ae;};'use strict';var DashboardEvents=require(_0xd842('0x0'));var events=[_0xd842('0x1'),_0xd842('0x2'),_0xd842('0x3')];function createListener(_0x532d77,_0x52bc63){return function(_0x128dfc){_0x52bc63[_0xd842('0x4')](_0x532d77,_0x128dfc);};}function removeListener(_0x4c1c31,_0x11eaf8){return function(){DashboardEvents[_0xd842('0x5')](_0x4c1c31,_0x11eaf8);};}exports[_0xd842('0x6')]=function(_0x35c162){for(var _0x40e8af=0x0,_0x336fd4=events['length'];_0x40e8af<_0x336fd4;_0x40e8af++){var _0x5e0350=events[_0x40e8af];var _0x32a9b4=createListener('dashboard:'+_0x5e0350,_0x35c162);DashboardEvents['on'](_0x5e0350,_0x32a9b4);}};
\ No newline at end of file
index fa98659..9fab1da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f16=['multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/items','getItems','post','/:id/clone','clone','addItem','put','update','delete','destroy','exports'];(function(_0x121886,_0x8cd8e5){var _0x20ca01=function(_0x15e144){while(--_0x15e144){_0x121886['push'](_0x121886['shift']());}};_0x20ca01(++_0x8cd8e5);}(_0x4f16,0xf2));var _0x64f1=function(_0x369a41,_0x5ed95c){_0x369a41=_0x369a41-0x0;var _0x16807d=_0x4f16[_0x369a41];return _0x16807d;};'use strict';var multer=require(_0x64f1('0x0'));var util=require('util');var path=require(_0x64f1('0x1'));var timeout=require('connect-timeout');var express=require(_0x64f1('0x2'));var router=express['Router']();var fs_extra=require(_0x64f1('0x3'));var auth=require(_0x64f1('0x4'));var interaction=require(_0x64f1('0x5'));var config=require(_0x64f1('0x6'));var controller=require('./dashboard.controller');router[_0x64f1('0x7')]('/',auth[_0x64f1('0x8')](),controller['index']);router[_0x64f1('0x7')](_0x64f1('0x9'),auth[_0x64f1('0x8')](),controller[_0x64f1('0xa')]);router['get'](_0x64f1('0xb'),auth['isAuthenticated'](),controller[_0x64f1('0xc')]);router[_0x64f1('0xd')]('/',auth[_0x64f1('0x8')](),controller['create']);router[_0x64f1('0xd')](_0x64f1('0xe'),auth[_0x64f1('0x8')](),controller[_0x64f1('0xf')]);router[_0x64f1('0xd')](_0x64f1('0xb'),auth[_0x64f1('0x8')](),controller[_0x64f1('0x10')]);router[_0x64f1('0x11')](_0x64f1('0x9'),auth[_0x64f1('0x8')](),controller[_0x64f1('0x12')]);router[_0x64f1('0x13')](_0x64f1('0x9'),auth[_0x64f1('0x8')](),controller[_0x64f1('0x14')]);module[_0x64f1('0x15')]=router;
\ No newline at end of file
+var _0x6c0f=['get','isAuthenticated','index','/:id','show','/:id/items','post','/:id/clone','clone','addItem','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x57435e,_0xa6c9bc){var _0x1869f1=function(_0x2b2619){while(--_0x2b2619){_0x57435e['push'](_0x57435e['shift']());}};_0x1869f1(++_0xa6c9bc);}(_0x6c0f,0x150));var _0xf6c0=function(_0x55c937,_0x4136f7){_0x55c937=_0x55c937-0x0;var _0xc45fad=_0x6c0f[_0x55c937];return _0xc45fad;};'use strict';var multer=require('multer');var util=require(_0xf6c0('0x0'));var path=require(_0xf6c0('0x1'));var timeout=require(_0xf6c0('0x2'));var express=require(_0xf6c0('0x3'));var router=express[_0xf6c0('0x4')]();var fs_extra=require(_0xf6c0('0x5'));var auth=require(_0xf6c0('0x6'));var interaction=require(_0xf6c0('0x7'));var config=require(_0xf6c0('0x8'));var controller=require('./dashboard.controller');router[_0xf6c0('0x9')]('/',auth[_0xf6c0('0xa')](),controller[_0xf6c0('0xb')]);router['get'](_0xf6c0('0xc'),auth['isAuthenticated'](),controller[_0xf6c0('0xd')]);router['get'](_0xf6c0('0xe'),auth['isAuthenticated'](),controller['getItems']);router[_0xf6c0('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xf6c0('0x10'),auth[_0xf6c0('0xa')](),controller[_0xf6c0('0x11')]);router[_0xf6c0('0xf')](_0xf6c0('0xe'),auth[_0xf6c0('0xa')](),controller[_0xf6c0('0x12')]);router['put'](_0xf6c0('0xc'),auth['isAuthenticated'](),controller[_0xf6c0('0x13')]);router[_0xf6c0('0x14')]('/:id',auth[_0xf6c0('0xa')](),controller[_0xf6c0('0x15')]);module[_0xf6c0('0x16')]=router;
\ No newline at end of file
index 0d9557c..c7ed4b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d38=['INTEGER','STRING','#2196f3','squel','lodash','exports','TEXT','parse','getDataValue','attrs','setDataValue','stringify'];(function(_0xdf7923,_0x320d6d){var _0x23553e=function(_0x191190){while(--_0x191190){_0xdf7923['push'](_0xdf7923['shift']());}};_0x23553e(++_0x320d6d);}(_0x6d38,0x1ef));var _0x86d3=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6d38[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x86d3('0x0'));var _=require(_0x86d3('0x1'));module[_0x86d3('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x86d3('0x3')]('long'),'get':function(){try{return JSON[_0x86d3('0x4')](this[_0x86d3('0x5')](_0x86d3('0x6')));}catch(_0x4ef557){return[];}},'set':function(_0x2d8272){try{this[_0x86d3('0x7')](_0x86d3('0x6'),JSON[_0x86d3('0x8')](_0x2d8272));}catch(_0x47e654){this['setDataValue'](_0x86d3('0x6'),JSON[_0x86d3('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x86d3('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x86d3('0x9')]},'background':{'type':Sequelize[_0x86d3('0xa')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x86d3('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x86d3('0xa')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
+var _0xe2fe=['setDataValue','INTEGER','sequelize','exports','STRING','TEXT','long','parse','getDataValue','attrs','stringify'];(function(_0x5c528c,_0x30cbae){var _0x31a944=function(_0x60a402){while(--_0x60a402){_0x5c528c['push'](_0x5c528c['shift']());}};_0x31a944(++_0x30cbae);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xee2f('0x0'));var squel=require('squel');var _=require('lodash');module[_0xee2f('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xee2f('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xee2f('0x3')](_0xee2f('0x4')),'get':function(){try{return JSON[_0xee2f('0x5')](this[_0xee2f('0x6')]('attrs'));}catch(_0x311a2f){return[];}},'set':function(_0x2b7e7c){try{this['setDataValue'](_0xee2f('0x7'),JSON[_0xee2f('0x8')](_0x2b7e7c));}catch(_0x5a7975){this[_0xee2f('0x9')]('attrs',JSON[_0xee2f('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xee2f('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xee2f('0xa')]},'col':{'type':Sequelize[_0xee2f('0xa')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xee2f('0x2')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
index ee39a53..cad6f35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b9a=['https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','body','create','update','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','end','json','offset','limit','undefined','count','set','Content-Range','save','destroy','then','status','sendStatus','error','name','show','params','model','keys','DashboardItem','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','type','iframe','attrUrl','attrs','value'];(function(_0x5b04c3,_0x397c67){var _0x4e7679=function(_0x601305){while(--_0x601305){_0x5b04c3['push'](_0x5b04c3['shift']());}};_0x4e7679(++_0x397c67);}(_0x5b9a,0x71));var _0xa5b9=function(_0x28ea8e,_0x487669){_0x28ea8e=_0x28ea8e-0x0;var _0x3e8e62=_0x5b9a[_0x28ea8e];return _0x3e8e62;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa5b9('0x0'));var zipdir=require(_0xa5b9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5b9('0x2'));var moment=require(_0xa5b9('0x3'));var BPromise=require(_0xa5b9('0x4'));var Mustache=require(_0xa5b9('0x5'));var util=require(_0xa5b9('0x6'));var path=require(_0xa5b9('0x7'));var sox=require('sox');var csv=require(_0xa5b9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa5b9('0x9'));var _=require('lodash');var squel=require(_0xa5b9('0xa'));var crypto=require(_0xa5b9('0xb'));var jsforce=require(_0xa5b9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa5b9('0x8'));var querystring=require(_0xa5b9('0xd'));var Papa=require(_0xa5b9('0xe'));var Redis=require(_0xa5b9('0xf'));var authService=require(_0xa5b9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa5b9('0x11'));var hardwareService=require(_0xa5b9('0x12'));var logger=require(_0xa5b9('0x13'))('api');var utils=require(_0xa5b9('0x14'));var config=require(_0xa5b9('0x15'));var licenseUtil=require(_0xa5b9('0x16'));var db=require('../../mysqldb')['db'];config[_0xa5b9('0x17')]=_[_0xa5b9('0x18')](config[_0xa5b9('0x17')],{'host':_0xa5b9('0x19'),'port':0x18eb});var socket=require(_0xa5b9('0x1a'))(new Redis(config[_0xa5b9('0x17')]));require(_0xa5b9('0x1b'))[_0xa5b9('0x1c')](socket);function respondWithStatusCode(_0x4c9f62,_0x4b862a){_0x4b862a=_0x4b862a||0xcc;return function(_0x87e05a){if(_0x87e05a){return _0x4c9f62['sendStatus'](_0x4b862a);}return _0x4c9f62['status'](_0x4b862a)[_0xa5b9('0x1d')]();};}function respondWithResult(_0x103d1d,_0x29aa64){_0x29aa64=_0x29aa64||0xc8;return function(_0x181a4c){if(_0x181a4c){return _0x103d1d['status'](_0x29aa64)[_0xa5b9('0x1e')](_0x181a4c);}};}function respondWithFilteredResult(_0x56442b,_0x5e7668){return function(_0x5804c5){if(_0x5804c5){var _0x3613aa=typeof _0x5e7668[_0xa5b9('0x1f')]==='undefined'&&typeof _0x5e7668[_0xa5b9('0x20')]===_0xa5b9('0x21');var _0x70b1ba=_0x5804c5[_0xa5b9('0x22')];var _0x3e0f6e=_0x3613aa?0x0:_0x5e7668[_0xa5b9('0x1f')];var _0x112d5c=_0x3613aa?_0x5804c5[_0xa5b9('0x22')]:_0x5e7668[_0xa5b9('0x1f')]+_0x5e7668[_0xa5b9('0x20')];var _0x36aaa0;if(_0x112d5c>=_0x70b1ba){_0x112d5c=_0x70b1ba;_0x36aaa0=0xc8;}else{_0x36aaa0=0xce;}_0x56442b['status'](_0x36aaa0);return _0x56442b[_0xa5b9('0x23')](_0xa5b9('0x24'),_0x3e0f6e+'-'+_0x112d5c+'/'+_0x70b1ba)[_0xa5b9('0x1e')](_0x5804c5);}return null;};}function patchUpdates(_0x1b7708){return function(_0xa22116){try{jsonpatch['apply'](_0xa22116,_0x1b7708,!![]);}catch(_0x377e6d){return BPromise['reject'](_0x377e6d);}return _0xa22116[_0xa5b9('0x25')]();};}function saveUpdates(_0x13d78d,_0x3d0e08){return function(_0xc68446){if(_0xc68446){return _0xc68446['update'](_0x13d78d)['then'](function(_0x3d39a4){return _0x3d39a4;});}return null;};}function removeEntity(_0x79ab,_0x509756){return function(_0x297bf2){if(_0x297bf2){return _0x297bf2[_0xa5b9('0x26')]()[_0xa5b9('0x27')](function(){_0x79ab[_0xa5b9('0x28')](0xcc)[_0xa5b9('0x1d')]();});}};}function handleEntityNotFound(_0x227c50,_0x28d828){return function(_0x54adaa){if(!_0x54adaa){_0x227c50[_0xa5b9('0x29')](0x194);}return _0x54adaa;};}function handleError(_0x5ca2ec,_0x4dc43b){_0x4dc43b=_0x4dc43b||0x1f4;return function(_0x4ec81a){logger[_0xa5b9('0x2a')](_0x4ec81a['stack']);if(_0x4ec81a[_0xa5b9('0x2b')]){delete _0x4ec81a[_0xa5b9('0x2b')];}_0x5ca2ec[_0xa5b9('0x28')](_0x4dc43b)['send'](_0x4ec81a);};}exports[_0xa5b9('0x2c')]=function(_0x59b7e2,_0x220357){var _0x29474e={'raw':![],'where':{'id':_0x59b7e2[_0xa5b9('0x2d')]['id']}},_0x56a318={};_0x56a318[_0xa5b9('0x2e')]=_[_0xa5b9('0x2f')](db[_0xa5b9('0x30')]['rawAttributes']);_0x56a318[_0xa5b9('0x31')]=_[_0xa5b9('0x2f')](_0x59b7e2[_0xa5b9('0x31')]);_0x56a318[_0xa5b9('0x32')]=_[_0xa5b9('0x33')](_0x56a318[_0xa5b9('0x2e')],_0x56a318[_0xa5b9('0x31')]);_0x29474e[_0xa5b9('0x34')]=_[_0xa5b9('0x33')](_0x56a318[_0xa5b9('0x2e')],qs[_0xa5b9('0x35')](_0x59b7e2['query'][_0xa5b9('0x35')]));_0x29474e[_0xa5b9('0x34')]=_0x29474e[_0xa5b9('0x34')][_0xa5b9('0x36')]?_0x29474e[_0xa5b9('0x34')]:_0x56a318[_0xa5b9('0x2e')];if(_0x59b7e2[_0xa5b9('0x31')][_0xa5b9('0x37')]){_0x29474e[_0xa5b9('0x38')]=[{'all':!![]}];}_0x29474e=_[_0xa5b9('0x39')]({},_0x29474e,_0x59b7e2['options']);return db['DashboardItem'][_0xa5b9('0x3a')](_0x29474e)['then'](handleEntityNotFound(_0x220357,null))[_0xa5b9('0x27')](respondWithResult(_0x220357,null))[_0xa5b9('0x3b')](handleError(_0x220357,null));};exports[_0xa5b9('0x26')]=function(_0x3c03b2,_0x4582d7){return db[_0xa5b9('0x30')][_0xa5b9('0x3a')]({'where':{'id':_0x3c03b2[_0xa5b9('0x2d')]['id']}})[_0xa5b9('0x27')](handleEntityNotFound(_0x4582d7,null))[_0xa5b9('0x27')](removeEntity(_0x4582d7,null))[_0xa5b9('0x3b')](handleError(_0x4582d7,null));};function widgetAttributes(_0x31ffa2){try{switch(_0x31ffa2[_0xa5b9('0x3c')]){case _0xa5b9('0x3d'):return[{'name':_0xa5b9('0x3e'),'value':_0x31ffa2[_0xa5b9('0x3e')]||(_0x31ffa2[_0xa5b9('0x3f')]&&_0x31ffa2['attrs'][0x0]?_0x31ffa2[_0xa5b9('0x3f')][0x0][_0xa5b9('0x40')]:undefined)||_0xa5b9('0x41')}];case'custom':return[{'name':_0xa5b9('0x42'),'value':_0x31ffa2[_0xa5b9('0x42')]||(_0x31ffa2['attrs']&&_0x31ffa2['attrs'][0x0]?_0x31ffa2[_0xa5b9('0x3f')][0x0][_0xa5b9('0x40')]:undefined)||''}];case _0xa5b9('0x43'):return[{'name':_0xa5b9('0x44'),'value':_0x31ffa2[_0xa5b9('0x44')]||(_0x31ffa2[_0xa5b9('0x3f')]&&_0x31ffa2[_0xa5b9('0x3f')][0x0]?_0x31ffa2['attrs'][0x0]['value']:undefined)||_0xa5b9('0x45')},{'name':_0xa5b9('0x46'),'value':_0x31ffa2[_0xa5b9('0x46')]||(_0x31ffa2[_0xa5b9('0x3f')]&&_0x31ffa2[_0xa5b9('0x3f')][0x1]?_0x31ffa2[_0xa5b9('0x3f')][0x1][_0xa5b9('0x40')]:undefined)||_0xa5b9('0x47')},{'name':_0xa5b9('0x48'),'value':_0x31ffa2[_0xa5b9('0x48')]||(_0x31ffa2[_0xa5b9('0x3f')]&&_0x31ffa2['attrs'][0x2]?_0x31ffa2['attrs'][0x2][_0xa5b9('0x40')]:undefined)||0xc}];case _0xa5b9('0x49'):return[{'name':_0xa5b9('0x4a'),'value':_0x31ffa2[_0xa5b9('0x4a')]||(_0x31ffa2['attrs']&&_0x31ffa2['attrs'][0x0]?_0x31ffa2[_0xa5b9('0x3f')][0x0][_0xa5b9('0x40')]:undefined)||'total'},{'name':_0xa5b9('0x4b'),'value':_0x31ffa2['attrVoiceQueues']||(_0x31ffa2[_0xa5b9('0x3f')]&&_0x31ffa2[_0xa5b9('0x3f')][0x1]?_0x31ffa2['attrs'][0x1][_0xa5b9('0x40')]:undefined)||[]},{'name':_0xa5b9('0x48'),'value':_0x31ffa2[_0xa5b9('0x48')]||(_0x31ffa2[_0xa5b9('0x3f')]&&_0x31ffa2[_0xa5b9('0x3f')][0x2]?_0x31ffa2[_0xa5b9('0x3f')][0x2][_0xa5b9('0x40')]:undefined)||0x14}];case _0xa5b9('0x4c'):case _0xa5b9('0x4d'):return[{'name':_0xa5b9('0x4e'),'value':_0x31ffa2[_0xa5b9('0x4e')]||(_0x31ffa2[_0xa5b9('0x3f')]&&_0x31ffa2[_0xa5b9('0x3f')][0x0]?_0x31ffa2[_0xa5b9('0x3f')][0x0][_0xa5b9('0x40')]:undefined)||'total'},{'name':'attrSerie2','value':_0x31ffa2[_0xa5b9('0x4f')]||(_0x31ffa2['attrs']&&_0x31ffa2[_0xa5b9('0x3f')][0x1]?_0x31ffa2[_0xa5b9('0x3f')][0x1][_0xa5b9('0x40')]:undefined)||null},{'name':'attrSerie3','value':_0x31ffa2[_0xa5b9('0x50')]||(_0x31ffa2[_0xa5b9('0x3f')]&&_0x31ffa2['attrs'][0x2]?_0x31ffa2['attrs'][0x2][_0xa5b9('0x40')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x31ffa2[_0xa5b9('0x4b')]||(_0x31ffa2[_0xa5b9('0x3f')]&&_0x31ffa2[_0xa5b9('0x3f')][0x3]?_0x31ffa2['attrs'][0x3][_0xa5b9('0x40')]:undefined)||[]}];case _0xa5b9('0x51'):return[{'name':_0xa5b9('0x52'),'type':_0x31ffa2['reportType']||(_0x31ffa2['attrs']&&_0x31ffa2[_0xa5b9('0x3f')][0x0]?_0x31ffa2['attrs'][0x0][_0xa5b9('0x3c')]:undefined)||null,'value':_0x31ffa2[_0xa5b9('0x52')]||(_0x31ffa2[_0xa5b9('0x3f')]&&_0x31ffa2['attrs'][0x0]?_0x31ffa2[_0xa5b9('0x3f')][0x0]['value']:undefined)||null},{'name':_0xa5b9('0x53'),'value':_0x31ffa2[_0xa5b9('0x53')]||(_0x31ffa2[_0xa5b9('0x3f')]&&_0x31ffa2[_0xa5b9('0x3f')][0x1]?_0x31ffa2['attrs'][0x1][_0xa5b9('0x40')]:undefined)||0x0}];default:return[];}}catch(_0x24f568){logger[_0xa5b9('0x2a')](_0xa5b9('0x54'),JSON[_0xa5b9('0x55')](_0x24f568));return[];}}exports['create']=function(_0x16b89f,_0x8db9e6){if(_0x16b89f[_0xa5b9('0x56')]){_0x16b89f[_0xa5b9('0x56')][_0xa5b9('0x3f')]=widgetAttributes(_0x16b89f['body']);}return db[_0xa5b9('0x30')][_0xa5b9('0x57')](_0x16b89f[_0xa5b9('0x56')],{})[_0xa5b9('0x27')](respondWithResult(_0x8db9e6,0xc9))[_0xa5b9('0x3b')](handleError(_0x8db9e6,null));};exports[_0xa5b9('0x58')]=function(_0x4880b2,_0x28a725){if(_0x4880b2[_0xa5b9('0x56')]['id']){delete _0x4880b2[_0xa5b9('0x56')]['id'];}_0x4880b2[_0xa5b9('0x56')]['attrs']=widgetAttributes(_0x4880b2['body']);return db[_0xa5b9('0x30')][_0xa5b9('0x3a')]({'where':{'id':_0x4880b2[_0xa5b9('0x2d')]['id']}})[_0xa5b9('0x27')](handleEntityNotFound(_0x28a725,null))[_0xa5b9('0x27')](saveUpdates(_0x4880b2[_0xa5b9('0x56')],null))[_0xa5b9('0x27')](respondWithResult(_0x28a725,null))[_0xa5b9('0x3b')](handleError(_0x28a725,null));};
\ No newline at end of file
+var _0xe91f=['attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','lodash','squel','crypto','desk.js','papaparse','ioredis','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','end','status','json','offset','undefined','limit','count','apply','reject','update','then','sendStatus','error','name','send','params','model','DashboardItem','rawAttributes','query','keys','filters','attributes','fields','includeAll','include','merge','options','catch','destroy','find','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1'];(function(_0x12f452,_0x34ecbc){var _0x1b7778=function(_0x4ba457){while(--_0x4ba457){_0x12f452['push'](_0x12f452['shift']());}};_0x1b7778(++_0x34ecbc);}(_0xe91f,0xf8));var _0xfe91=function(_0x1fb9e2,_0x277bcc){_0x1fb9e2=_0x1fb9e2-0x0;var _0x379305=_0xe91f[_0x1fb9e2];return _0x379305;};'use strict';var emlformat=require(_0xfe91('0x0'));var rimraf=require(_0xfe91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe91('0x2'));var rp=require('request-promise');var moment=require(_0xfe91('0x3'));var BPromise=require(_0xfe91('0x4'));var Mustache=require(_0xfe91('0x5'));var util=require('util');var path=require(_0xfe91('0x6'));var sox=require(_0xfe91('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe91('0x8'));var squel=require(_0xfe91('0x9'));var crypto=require(_0xfe91('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfe91('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfe91('0xc'));var Redis=require(_0xfe91('0xd'));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('../../config/logger')(_0xfe91('0xe'));var utils=require(_0xfe91('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xfe91('0x10'));var db=require(_0xfe91('0x11'))['db'];config[_0xfe91('0x12')]=_['defaults'](config[_0xfe91('0x12')],{'host':_0xfe91('0x13'),'port':0x18eb});var socket=require(_0xfe91('0x14'))(new Redis(config[_0xfe91('0x12')]));require(_0xfe91('0x15'))['register'](socket);function respondWithStatusCode(_0x27f41d,_0x41b0bf){_0x41b0bf=_0x41b0bf||0xcc;return function(_0x145c77){if(_0x145c77){return _0x27f41d['sendStatus'](_0x41b0bf);}return _0x27f41d['status'](_0x41b0bf)[_0xfe91('0x16')]();};}function respondWithResult(_0x5cefbf,_0x2efd25){_0x2efd25=_0x2efd25||0xc8;return function(_0x1dd98f){if(_0x1dd98f){return _0x5cefbf[_0xfe91('0x17')](_0x2efd25)[_0xfe91('0x18')](_0x1dd98f);}};}function respondWithFilteredResult(_0x23f685,_0x3a5c80){return function(_0x49d580){if(_0x49d580){var _0x2ed04a=typeof _0x3a5c80[_0xfe91('0x19')]===_0xfe91('0x1a')&&typeof _0x3a5c80[_0xfe91('0x1b')]==='undefined';var _0x4158d4=_0x49d580[_0xfe91('0x1c')];var _0x423cc4=_0x2ed04a?0x0:_0x3a5c80[_0xfe91('0x19')];var _0xebc4cd=_0x2ed04a?_0x49d580[_0xfe91('0x1c')]:_0x3a5c80[_0xfe91('0x19')]+_0x3a5c80[_0xfe91('0x1b')];var _0xd94f30;if(_0xebc4cd>=_0x4158d4){_0xebc4cd=_0x4158d4;_0xd94f30=0xc8;}else{_0xd94f30=0xce;}_0x23f685[_0xfe91('0x17')](_0xd94f30);return _0x23f685['set']('Content-Range',_0x423cc4+'-'+_0xebc4cd+'/'+_0x4158d4)[_0xfe91('0x18')](_0x49d580);}return null;};}function patchUpdates(_0x2ab69c){return function(_0x8ab145){try{jsonpatch[_0xfe91('0x1d')](_0x8ab145,_0x2ab69c,!![]);}catch(_0x37bc71){return BPromise[_0xfe91('0x1e')](_0x37bc71);}return _0x8ab145['save']();};}function saveUpdates(_0xe14856,_0x4d1b6c){return function(_0x378ca4){if(_0x378ca4){return _0x378ca4[_0xfe91('0x1f')](_0xe14856)[_0xfe91('0x20')](function(_0x396719){return _0x396719;});}return null;};}function removeEntity(_0x3cdc0f,_0x418a1c){return function(_0x1668ea){if(_0x1668ea){return _0x1668ea['destroy']()[_0xfe91('0x20')](function(){_0x3cdc0f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4200d0,_0x2fef82){return function(_0x3f44df){if(!_0x3f44df){_0x4200d0[_0xfe91('0x21')](0x194);}return _0x3f44df;};}function handleError(_0x544b91,_0x5ef011){_0x5ef011=_0x5ef011||0x1f4;return function(_0x23ebe1){logger[_0xfe91('0x22')](_0x23ebe1['stack']);if(_0x23ebe1[_0xfe91('0x23')]){delete _0x23ebe1['name'];}_0x544b91[_0xfe91('0x17')](_0x5ef011)[_0xfe91('0x24')](_0x23ebe1);};}exports['show']=function(_0x9c2da9,_0x5f4cfb){var _0x1a168d={'raw':![],'where':{'id':_0x9c2da9[_0xfe91('0x25')]['id']}},_0x3d6086={};_0x3d6086[_0xfe91('0x26')]=_['keys'](db[_0xfe91('0x27')][_0xfe91('0x28')]);_0x3d6086[_0xfe91('0x29')]=_[_0xfe91('0x2a')](_0x9c2da9['query']);_0x3d6086[_0xfe91('0x2b')]=_['intersection'](_0x3d6086[_0xfe91('0x26')],_0x3d6086[_0xfe91('0x29')]);_0x1a168d[_0xfe91('0x2c')]=_['intersection'](_0x3d6086[_0xfe91('0x26')],qs[_0xfe91('0x2d')](_0x9c2da9[_0xfe91('0x29')][_0xfe91('0x2d')]));_0x1a168d[_0xfe91('0x2c')]=_0x1a168d['attributes']['length']?_0x1a168d[_0xfe91('0x2c')]:_0x3d6086[_0xfe91('0x26')];if(_0x9c2da9[_0xfe91('0x29')][_0xfe91('0x2e')]){_0x1a168d[_0xfe91('0x2f')]=[{'all':!![]}];}_0x1a168d=_[_0xfe91('0x30')]({},_0x1a168d,_0x9c2da9[_0xfe91('0x31')]);return db[_0xfe91('0x27')]['find'](_0x1a168d)[_0xfe91('0x20')](handleEntityNotFound(_0x5f4cfb,null))[_0xfe91('0x20')](respondWithResult(_0x5f4cfb,null))[_0xfe91('0x32')](handleError(_0x5f4cfb,null));};exports[_0xfe91('0x33')]=function(_0x343ca9,_0x2ff63f){return db['DashboardItem'][_0xfe91('0x34')]({'where':{'id':_0x343ca9[_0xfe91('0x25')]['id']}})[_0xfe91('0x20')](handleEntityNotFound(_0x2ff63f,null))[_0xfe91('0x20')](removeEntity(_0x2ff63f,null))[_0xfe91('0x32')](handleError(_0x2ff63f,null));};function widgetAttributes(_0x5b21cc){try{switch(_0x5b21cc[_0xfe91('0x35')]){case _0xfe91('0x36'):return[{'name':_0xfe91('0x37'),'value':_0x5b21cc[_0xfe91('0x37')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc[_0xfe91('0x38')][0x0][_0xfe91('0x39')]:undefined)||_0xfe91('0x3a')}];case'custom':return[{'name':_0xfe91('0x3b'),'value':_0x5b21cc['attrPath']||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc['attrs'][0x0]?_0x5b21cc[_0xfe91('0x38')][0x0][_0xfe91('0x39')]:undefined)||''}];case _0xfe91('0x3c'):return[{'name':_0xfe91('0x3d'),'value':_0x5b21cc[_0xfe91('0x3d')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc[_0xfe91('0x38')][0x0]['value']:undefined)||_0xfe91('0x3e')},{'name':_0xfe91('0x3f'),'value':_0x5b21cc[_0xfe91('0x3f')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc['attrs'][0x1]?_0x5b21cc[_0xfe91('0x38')][0x1][_0xfe91('0x39')]:undefined)||'0.00'},{'name':_0xfe91('0x40'),'value':_0x5b21cc[_0xfe91('0x40')]||(_0x5b21cc['attrs']&&_0x5b21cc[_0xfe91('0x38')][0x2]?_0x5b21cc[_0xfe91('0x38')][0x2][_0xfe91('0x39')]:undefined)||0xc}];case _0xfe91('0x41'):return[{'name':_0xfe91('0x42'),'value':_0x5b21cc[_0xfe91('0x42')]||(_0x5b21cc['attrs']&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc['attrs'][0x0][_0xfe91('0x39')]:undefined)||_0xfe91('0x43')},{'name':'attrVoiceQueues','value':_0x5b21cc[_0xfe91('0x44')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc['attrs'][0x1]?_0x5b21cc[_0xfe91('0x38')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x5b21cc[_0xfe91('0x40')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x2]?_0x5b21cc[_0xfe91('0x38')][0x2][_0xfe91('0x39')]:undefined)||0x14}];case _0xfe91('0x45'):case _0xfe91('0x46'):return[{'name':_0xfe91('0x47'),'value':_0x5b21cc[_0xfe91('0x47')]||(_0x5b21cc['attrs']&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc[_0xfe91('0x38')][0x0][_0xfe91('0x39')]:undefined)||_0xfe91('0x43')},{'name':_0xfe91('0x48'),'value':_0x5b21cc[_0xfe91('0x48')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x1]?_0x5b21cc[_0xfe91('0x38')][0x1][_0xfe91('0x39')]:undefined)||null},{'name':_0xfe91('0x49'),'value':_0x5b21cc['attrSerie3']||(_0x5b21cc['attrs']&&_0x5b21cc[_0xfe91('0x38')][0x2]?_0x5b21cc[_0xfe91('0x38')][0x2][_0xfe91('0x39')]:undefined)||null},{'name':_0xfe91('0x44'),'value':_0x5b21cc[_0xfe91('0x44')]||(_0x5b21cc['attrs']&&_0x5b21cc['attrs'][0x3]?_0x5b21cc['attrs'][0x3]['value']:undefined)||[]}];case _0xfe91('0x4a'):return[{'name':_0xfe91('0x4b'),'type':_0x5b21cc[_0xfe91('0x4c')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc['attrs'][0x0][_0xfe91('0x35')]:undefined)||null,'value':_0x5b21cc['attrReport']||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc[_0xfe91('0x38')][0x0]?_0x5b21cc['attrs'][0x0][_0xfe91('0x39')]:undefined)||null},{'name':_0xfe91('0x4d'),'value':_0x5b21cc[_0xfe91('0x4d')]||(_0x5b21cc[_0xfe91('0x38')]&&_0x5b21cc['attrs'][0x1]?_0x5b21cc[_0xfe91('0x38')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1da056){logger[_0xfe91('0x22')]('widgetAttributes:\x20%s',JSON['stringify'](_0x1da056));return[];}}exports[_0xfe91('0x4e')]=function(_0x3178ef,_0x5ec74b){if(_0x3178ef[_0xfe91('0x4f')]){_0x3178ef['body'][_0xfe91('0x38')]=widgetAttributes(_0x3178ef[_0xfe91('0x4f')]);}return db[_0xfe91('0x27')][_0xfe91('0x4e')](_0x3178ef[_0xfe91('0x4f')],{})[_0xfe91('0x20')](respondWithResult(_0x5ec74b,0xc9))[_0xfe91('0x32')](handleError(_0x5ec74b,null));};exports[_0xfe91('0x1f')]=function(_0x38dbfd,_0x28a392){if(_0x38dbfd[_0xfe91('0x4f')]['id']){delete _0x38dbfd[_0xfe91('0x4f')]['id'];}_0x38dbfd[_0xfe91('0x4f')][_0xfe91('0x38')]=widgetAttributes(_0x38dbfd['body']);return db[_0xfe91('0x27')]['find']({'where':{'id':_0x38dbfd[_0xfe91('0x25')]['id']}})['then'](handleEntityNotFound(_0x28a392,null))[_0xfe91('0x20')](saveUpdates(_0x38dbfd[_0xfe91('0x4f')],null))['then'](respondWithResult(_0x28a392,null))[_0xfe91('0x32')](handleError(_0x28a392,null));};
\ No newline at end of file
index bdc4d1f..f16b59d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6dfc=['../../mysqldb','setMaxListeners','save','update','emit','exports'];(function(_0x1c3000,_0x26e05d){var _0x25bb7b=function(_0x409db3){while(--_0x409db3){_0x1c3000['push'](_0x1c3000['shift']());}};_0x25bb7b(++_0x26e05d);}(_0x6dfc,0x120));var _0xc6df=function(_0x5dcb1e,_0x307631){_0x5dcb1e=_0x5dcb1e-0x0;var _0x1b42da=_0x6dfc[_0x5dcb1e];return _0x1b42da;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0xc6df('0x0'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc6df('0x1')](0x0);var events={'afterCreate':_0xc6df('0x2'),'afterUpdate':_0xc6df('0x3'),'afterDestroy':'remove'};function emitEvent(_0x27a335){return function(_0x54e68d,_0x5e9892,_0x45caf0){DashboardItemEvents[_0xc6df('0x4')](_0x27a335+':'+_0x54e68d['id'],_0x54e68d);DashboardItemEvents[_0xc6df('0x4')](_0x27a335,_0x54e68d);_0x45caf0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xc6df('0x5')]=DashboardItemEvents;
\ No newline at end of file
+var _0x2d20=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','save','update'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x2d20,0x1d1));var _0x02d2=function(_0x1c9176,_0x1b66eb){_0x1c9176=_0x1c9176-0x0;var _0x93deeb=_0x2d20[_0x1c9176];return _0x93deeb;};'use strict';var EventEmitter=require(_0x02d2('0x0'));var DashboardItem=require(_0x02d2('0x1'))['db'][_0x02d2('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x02d2('0x3'),'afterUpdate':_0x02d2('0x4'),'afterDestroy':_0x02d2('0x5')};function emitEvent(_0x46e545){return function(_0xc5dbf3,_0xd46046,_0x30799b){DashboardItemEvents[_0x02d2('0x6')](_0x46e545+':'+_0xc5dbf3['id'],_0xc5dbf3);DashboardItemEvents[_0x02d2('0x6')](_0x46e545,_0xc5dbf3);_0x30799b(null);};}for(var e in events){if(events[_0x02d2('0x7')](e)){var event=events[e];DashboardItem[_0x02d2('0x8')](e,emitEvent(event));}}module[_0x02d2('0x9')]=DashboardItemEvents;
\ No newline at end of file
index 311a01e..73ea2fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc212=['DashboardItem','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes','exports','define'];(function(_0x52f1e6,_0xf70489){var _0x21f104=function(_0xb89f9e){while(--_0xb89f9e){_0x52f1e6['push'](_0x52f1e6['shift']());}};_0x21f104(++_0xf70489);}(_0xc212,0x175));var _0x2c21=function(_0xc80ded,_0x171132){_0xc80ded=_0xc80ded-0x0;var _0x5179c3=_0xc212[_0xc80ded];return _0x5179c3;};'use strict';var _=require(_0x2c21('0x0'));var util=require('util');var logger=require(_0x2c21('0x1'))(_0x2c21('0x2'));var moment=require(_0x2c21('0x3'));var BPromise=require(_0x2c21('0x4'));var rp=require(_0x2c21('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c21('0x6'));var config=require(_0x2c21('0x7'));var attributes=require(_0x2c21('0x8'));module[_0x2c21('0x9')]=function(_0x48b783,_0x302f42){return _0x48b783[_0x2c21('0xa')](_0x2c21('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x92a4=['lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','dashboard_items'];(function(_0x453db0,_0x5cdc9b){var _0x382549=function(_0x2e3b69){while(--_0x2e3b69){_0x453db0['push'](_0x453db0['shift']());}};_0x382549(++_0x5cdc9b);}(_0x92a4,0xb4));var _0x492a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x92a4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x492a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x492a('0x1'));var moment=require('moment');var BPromise=require(_0x492a('0x2'));var rp=require(_0x492a('0x3'));var fs=require('fs');var path=require(_0x492a('0x4'));var rimraf=require(_0x492a('0x5'));var config=require(_0x492a('0x6'));var attributes=require(_0x492a('0x7'));module['exports']=function(_0x239caf,_0x3e47a2){return _0x239caf['define']('DashboardItem',attributes,{'tableName':_0x492a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5a40f78..65cac3a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfc6=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./dashboardItem.socket','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x3fbc73,_0x2e7e71){var _0x23a171=function(_0x3b7404){while(--_0x3b7404){_0x3fbc73['push'](_0x3fbc73['shift']());}};_0x23a171(++_0x2e7e71);}(_0xbfc6,0xf4));var _0x6bfc=function(_0x9e4081,_0x1f9ab0){_0x9e4081=_0x9e4081-0x0;var _0x58bb7c=_0xbfc6[_0x9e4081];return _0x58bb7c;};'use strict';var _=require(_0x6bfc('0x0'));var util=require(_0x6bfc('0x1'));var moment=require('moment');var BPromise=require(_0x6bfc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6bfc('0x3'));var db=require(_0x6bfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6bfc('0x5'))(_0x6bfc('0x6'));var config=require(_0x6bfc('0x7'));var jayson=require(_0x6bfc('0x8'));var client=jayson[_0x6bfc('0x9')][_0x6bfc('0xa')]({'port':0x232a});config[_0x6bfc('0xb')]=_[_0x6bfc('0xc')](config[_0x6bfc('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6bfc('0xd'))['register'](socket);function respondWithRpcPromise(_0x4cc90f,_0x3dc1a9,_0xc4b03b){return new BPromise(function(_0x4fa773,_0x35d6b9){return client[_0x6bfc('0xe')](_0x4cc90f,_0xc4b03b)[_0x6bfc('0xf')](function(_0x310ffe){logger[_0x6bfc('0x10')](_0x6bfc('0x11'),_0x3dc1a9,'request\x20sent');logger[_0x6bfc('0x12')](_0x6bfc('0x13'),_0x3dc1a9,_0x6bfc('0x14'),JSON[_0x6bfc('0x15')](_0x310ffe));if(_0x310ffe[_0x6bfc('0x16')]){if(_0x310ffe[_0x6bfc('0x16')][_0x6bfc('0x17')]===0x1f4){logger[_0x6bfc('0x16')]('DashboardItem,\x20%s,\x20%s',_0x3dc1a9,_0x310ffe[_0x6bfc('0x16')][_0x6bfc('0x18')]);return _0x35d6b9(_0x310ffe['error'][_0x6bfc('0x18')]);}logger[_0x6bfc('0x16')]('DashboardItem,\x20%s,\x20%s',_0x3dc1a9,_0x310ffe[_0x6bfc('0x16')][_0x6bfc('0x18')]);return _0x4fa773(_0x310ffe[_0x6bfc('0x16')][_0x6bfc('0x18')]);}else{logger[_0x6bfc('0x10')](_0x6bfc('0x11'),_0x3dc1a9,_0x6bfc('0x14'));_0x4fa773(_0x310ffe['result'][_0x6bfc('0x18')]);}})['catch'](function(_0x4b3404){logger[_0x6bfc('0x16')]('DashboardItem,\x20%s,\x20%s',_0x3dc1a9,_0x4b3404);_0x35d6b9(_0x4b3404);});});}
\ No newline at end of file
+var _0x482a=['then','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','DashboardItem,\x20%s,\x20%s','message','info','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register'];(function(_0x2a318a,_0x3f8006){var _0x346cf3=function(_0x314595){while(--_0x314595){_0x2a318a['push'](_0x2a318a['shift']());}};_0x346cf3(++_0x3f8006);}(_0x482a,0xc0));var _0xa482=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x482a[_0x368fb9];return _0x4892fb;};'use strict';var _=require(_0xa482('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa482('0x1'));var rs=require(_0xa482('0x2'));var fs=require('fs');var Redis=require(_0xa482('0x3'));var db=require(_0xa482('0x4'))['db'];var utils=require(_0xa482('0x5'));var logger=require('../../config/logger')(_0xa482('0x6'));var config=require(_0xa482('0x7'));var jayson=require(_0xa482('0x8'));var client=jayson[_0xa482('0x9')]['http']({'port':0x232a});config[_0xa482('0xa')]=_[_0xa482('0xb')](config[_0xa482('0xa')],{'host':_0xa482('0xc'),'port':0x18eb});var socket=require(_0xa482('0xd'))(new Redis(config['redis']));require(_0xa482('0xe'))[_0xa482('0xf')](socket);function respondWithRpcPromise(_0x585e12,_0x2713e4,_0x4d9c03){return new BPromise(function(_0x107d03,_0x16f8bb){return client['request'](_0x585e12,_0x4d9c03)[_0xa482('0x10')](function(_0x216466){logger['info']('DashboardItem,\x20%s,\x20%s',_0x2713e4,_0xa482('0x11'));logger[_0xa482('0x12')](_0xa482('0x13'),_0x2713e4,'request\x20sent',JSON['stringify'](_0x216466));if(_0x216466[_0xa482('0x14')]){if(_0x216466[_0xa482('0x14')][_0xa482('0x15')]===0x1f4){logger['error'](_0xa482('0x16'),_0x2713e4,_0x216466['error'][_0xa482('0x17')]);return _0x16f8bb(_0x216466[_0xa482('0x14')][_0xa482('0x17')]);}logger[_0xa482('0x14')](_0xa482('0x16'),_0x2713e4,_0x216466[_0xa482('0x14')][_0xa482('0x17')]);return _0x107d03(_0x216466[_0xa482('0x14')][_0xa482('0x17')]);}else{logger[_0xa482('0x18')](_0xa482('0x16'),_0x2713e4,_0xa482('0x11'));_0x107d03(_0x216466[_0xa482('0x19')][_0xa482('0x17')]);}})['catch'](function(_0x28838f){logger[_0xa482('0x14')](_0xa482('0x16'),_0x2713e4,_0x28838f);_0x16f8bb(_0x28838f);});});}
\ No newline at end of file
index e991a90..16e4865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88df=['length','save','remove','update','emit','register'];(function(_0x5dfbc4,_0x324f2f){var _0x4a8c1e=function(_0xa0ddd5){while(--_0xa0ddd5){_0x5dfbc4['push'](_0x5dfbc4['shift']());}};_0x4a8c1e(++_0x324f2f);}(_0x88df,0x169));var _0xf88d=function(_0x1a1b81,_0x3f1e2e){_0x1a1b81=_0x1a1b81-0x0;var _0x53f9b9=_0x88df[_0x1a1b81];return _0x53f9b9;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xf88d('0x0'),_0xf88d('0x1'),_0xf88d('0x2')];function createListener(_0x5a8a7d,_0x5171d0){return function(_0xd45b4d){_0x5171d0[_0xf88d('0x3')](_0x5a8a7d,_0xd45b4d);};}function removeListener(_0x4e6fb6,_0x13ec37){return function(){DashboardItemEvents['removeListener'](_0x4e6fb6,_0x13ec37);};}exports[_0xf88d('0x4')]=function(_0x520281){for(var _0x4eee19=0x0,_0x5918a6=events[_0xf88d('0x5')];_0x4eee19<_0x5918a6;_0x4eee19++){var _0x4dba10=events[_0x4eee19];var _0x2da7ca=createListener('dashboardItem:'+_0x4dba10,_0x520281);DashboardItemEvents['on'](_0x4dba10,_0x2da7ca);}};
\ No newline at end of file
+var _0x9542=['dashboardItem:','./dashboardItem.events','save','update','length'];(function(_0x2691dd,_0x5b7947){var _0x4e66c1=function(_0x3db4a9){while(--_0x3db4a9){_0x2691dd['push'](_0x2691dd['shift']());}};_0x4e66c1(++_0x5b7947);}(_0x9542,0x11e));var _0x2954=function(_0x33353b,_0x401751){_0x33353b=_0x33353b-0x0;var _0x20086d=_0x9542[_0x33353b];return _0x20086d;};'use strict';var DashboardItemEvents=require(_0x2954('0x0'));var events=[_0x2954('0x1'),'remove',_0x2954('0x2')];function createListener(_0x182c57,_0x573273){return function(_0x36bc88){_0x573273['emit'](_0x182c57,_0x36bc88);};}function removeListener(_0x2b8730,_0x51243a){return function(){DashboardItemEvents['removeListener'](_0x2b8730,_0x51243a);};}exports['register']=function(_0x4e0d0b){for(var _0x1d4d5e=0x0,_0x550aa2=events[_0x2954('0x3')];_0x1d4d5e<_0x550aa2;_0x1d4d5e++){var _0x2e3b13=events[_0x1d4d5e];var _0x5e8a40=createListener(_0x2954('0x4')+_0x2e3b13,_0x4e0d0b);DashboardItemEvents['on'](_0x2e3b13,_0x5e8a40);}};
\ No newline at end of file
index 9fbdd63..defe2c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa682=['show','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','/:id','isAuthenticated'];(function(_0x2e9f72,_0x36480c){var _0x4b1a98=function(_0x2c7f62){while(--_0x2c7f62){_0x2e9f72['push'](_0x2e9f72['shift']());}};_0x4b1a98(++_0x36480c);}(_0xa682,0x1d1));var _0x2a68=function(_0x6fb0ec,_0x5a6f92){_0x6fb0ec=_0x6fb0ec-0x0;var _0x22aa78=_0xa682[_0x6fb0ec];return _0x22aa78;};'use strict';var multer=require(_0x2a68('0x0'));var util=require(_0x2a68('0x1'));var path=require(_0x2a68('0x2'));var timeout=require(_0x2a68('0x3'));var express=require('express');var router=express[_0x2a68('0x4')]();var fs_extra=require(_0x2a68('0x5'));var auth=require(_0x2a68('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2a68('0x7'));var controller=require('./dashboardItem.controller');router[_0x2a68('0x8')](_0x2a68('0x9'),auth[_0x2a68('0xa')](),controller[_0x2a68('0xb')]);router[_0x2a68('0xc')]('/',auth[_0x2a68('0xa')](),controller['create']);router[_0x2a68('0xd')](_0x2a68('0x9'),auth[_0x2a68('0xa')](),controller[_0x2a68('0xe')]);router[_0x2a68('0xf')](_0x2a68('0x9'),auth[_0x2a68('0xa')](),controller['destroy']);module[_0x2a68('0x10')]=router;
\ No newline at end of file
+var _0xcafb=['show','isAuthenticated','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id'];(function(_0x17086d,_0x36fd66){var _0x57adce=function(_0x183422){while(--_0x183422){_0x17086d['push'](_0x17086d['shift']());}};_0x57adce(++_0x36fd66);}(_0xcafb,0xe4));var _0xbcaf=function(_0x29d79e,_0x4c1e50){_0x29d79e=_0x29d79e-0x0;var _0xf91ad2=_0xcafb[_0x29d79e];return _0xf91ad2;};'use strict';var multer=require(_0xbcaf('0x0'));var util=require(_0xbcaf('0x1'));var path=require(_0xbcaf('0x2'));var timeout=require(_0xbcaf('0x3'));var express=require(_0xbcaf('0x4'));var router=express[_0xbcaf('0x5')]();var fs_extra=require(_0xbcaf('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xbcaf('0x7'));var config=require(_0xbcaf('0x8'));var controller=require(_0xbcaf('0x9'));router[_0xbcaf('0xa')](_0xbcaf('0xb'),auth['isAuthenticated'](),controller[_0xbcaf('0xc')]);router['post']('/',auth[_0xbcaf('0xd')](),controller['create']);router[_0xbcaf('0xe')](_0xbcaf('0xb'),auth['isAuthenticated'](),controller[_0xbcaf('0xf')]);router['delete']('/:id',auth[_0xbcaf('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index c2eb759..59878e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7da=['STRING','first','sequelize'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0xb7da,0x1d3));var _0xab7d=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0xb7da[_0x36bff5];return _0x80ade5;};'use strict';var Sequelize=require(_0xab7d('0x0'));module['exports']={'name':{'type':Sequelize[_0xab7d('0x1')],'allowNull':![]},'level':{'type':Sequelize['ENUM'](_0xab7d('0x2'),'second','third'),'allowNull':![],'defaultValue':_0xab7d('0x2')},'description':{'type':Sequelize[_0xab7d('0x1')]}};
\ No newline at end of file
+var _0x0f3f=['first','STRING','exports','ENUM'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x0f3f,0x19a));var _0xf0f3=function(_0x289c3e,_0x3614b5){_0x289c3e=_0x289c3e-0x0;var _0x25a4b3=_0x0f3f[_0x289c3e];return _0x25a4b3;};'use strict';var Sequelize=require('sequelize');module[_0xf0f3('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xf0f3('0x1')](_0xf0f3('0x2'),'second','third'),'allowNull':![],'defaultValue':_0xf0f3('0x2')},'description':{'type':Sequelize[_0xf0f3('0x3')]}};
\ No newline at end of file
index f625b79..0498486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40b7=['count','limit','status','set','Content-Range','save','then','destroy','get','Dispositions','UserProfileResource','stack','name','send','index','map','Disposition','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined'];(function(_0x5dccea,_0x1a8fb9){var _0x1c17bd=function(_0x3aeda6){while(--_0x3aeda6){_0x5dccea['push'](_0x5dccea['shift']());}};_0x1c17bd(++_0x1a8fb9);}(_0x40b7,0x1e2));var _0x740b=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x40b7[_0x2555d0];return _0x3bb486;};'use strict';var emlformat=require(_0x740b('0x0'));var rimraf=require(_0x740b('0x1'));var zipdir=require(_0x740b('0x2'));var jsonpatch=require(_0x740b('0x3'));var rp=require(_0x740b('0x4'));var moment=require('moment');var BPromise=require(_0x740b('0x5'));var Mustache=require(_0x740b('0x6'));var util=require(_0x740b('0x7'));var path=require(_0x740b('0x8'));var sox=require(_0x740b('0x9'));var csv=require(_0x740b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x740b('0xb'));var _=require(_0x740b('0xc'));var squel=require(_0x740b('0xd'));var crypto=require(_0x740b('0xe'));var jsforce=require(_0x740b('0xf'));var deskjs=require(_0x740b('0x10'));var toCsv=require(_0x740b('0xa'));var querystring=require(_0x740b('0x11'));var Papa=require(_0x740b('0x12'));var Redis=require(_0x740b('0x13'));var authService=require(_0x740b('0x14'));var qs=require(_0x740b('0x15'));var as=require(_0x740b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x740b('0x17'))(_0x740b('0x18'));var utils=require(_0x740b('0x19'));var config=require(_0x740b('0x1a'));var licenseUtil=require(_0x740b('0x1b'));var db=require(_0x740b('0x1c'))['db'];function respondWithStatusCode(_0x5d085f,_0x392338){_0x392338=_0x392338||0xcc;return function(_0x290988){if(_0x290988){return _0x5d085f[_0x740b('0x1d')](_0x392338);}return _0x5d085f['status'](_0x392338)[_0x740b('0x1e')]();};}function respondWithResult(_0x1e7c53,_0x3649f1){_0x3649f1=_0x3649f1||0xc8;return function(_0x48b519){if(_0x48b519){return _0x1e7c53['status'](_0x3649f1)[_0x740b('0x1f')](_0x48b519);}};}function respondWithFilteredResult(_0x12c610,_0x3d113d){return function(_0x2be391){if(_0x2be391){var _0x16c2e4=typeof _0x3d113d[_0x740b('0x20')]==='undefined'&&typeof _0x3d113d['limit']===_0x740b('0x21');var _0x1a8987=_0x2be391[_0x740b('0x22')];var _0x33c58b=_0x16c2e4?0x0:_0x3d113d[_0x740b('0x20')];var _0x203785=_0x16c2e4?_0x2be391[_0x740b('0x22')]:_0x3d113d[_0x740b('0x20')]+_0x3d113d[_0x740b('0x23')];var _0x2eff3e;if(_0x203785>=_0x1a8987){_0x203785=_0x1a8987;_0x2eff3e=0xc8;}else{_0x2eff3e=0xce;}_0x12c610[_0x740b('0x24')](_0x2eff3e);return _0x12c610[_0x740b('0x25')](_0x740b('0x26'),_0x33c58b+'-'+_0x203785+'/'+_0x1a8987)[_0x740b('0x1f')](_0x2be391);}return null;};}function patchUpdates(_0x2e9c4d){return function(_0x454686){try{jsonpatch['apply'](_0x454686,_0x2e9c4d,!![]);}catch(_0x1ad3f4){return BPromise['reject'](_0x1ad3f4);}return _0x454686[_0x740b('0x27')]();};}function saveUpdates(_0x2f788f,_0x107113){return function(_0x1fa8f5){if(_0x1fa8f5){return _0x1fa8f5['update'](_0x2f788f)[_0x740b('0x28')](function(_0x27dc56){return _0x27dc56;});}return null;};}function removeEntity(_0x247df8,_0x194316){return function(_0x1b6b15){if(_0x1b6b15){return _0x1b6b15[_0x740b('0x29')]()[_0x740b('0x28')](function(){var _0x241416=_0x1b6b15[_0x740b('0x2a')]({'plain':!![]});var _0x43f4c2=_0x740b('0x2b');return db[_0x740b('0x2c')][_0x740b('0x29')]({'where':{'type':_0x43f4c2,'resourceId':_0x241416['id']}})[_0x740b('0x28')](function(){return _0x1b6b15;});})[_0x740b('0x28')](function(){_0x247df8[_0x740b('0x24')](0xcc)[_0x740b('0x1e')]();});}};}function handleEntityNotFound(_0x519e67,_0x2a8649){return function(_0xee0922){if(!_0xee0922){_0x519e67[_0x740b('0x1d')](0x194);}return _0xee0922;};}function handleError(_0xc9d05e,_0x48474b){_0x48474b=_0x48474b||0x1f4;return function(_0x373502){logger['error'](_0x373502[_0x740b('0x2d')]);if(_0x373502[_0x740b('0x2e')]){delete _0x373502['name'];}_0xc9d05e[_0x740b('0x24')](_0x48474b)[_0x740b('0x2f')](_0x373502);};}exports[_0x740b('0x30')]=function(_0x254a00,_0x10ca70){var _0x28275e={},_0x9ea6f4={},_0x5520ca={'count':0x0,'rows':[]};var _0x35b3f4=_[_0x740b('0x31')](db[_0x740b('0x32')]['rawAttributes'],function(_0x4835b3){return{'name':_0x4835b3[_0x740b('0x33')],'type':_0x4835b3[_0x740b('0x34')][_0x740b('0x35')]};});_0x9ea6f4[_0x740b('0x36')]=_[_0x740b('0x31')](_0x35b3f4,_0x740b('0x2e'));_0x9ea6f4[_0x740b('0x37')]=_['keys'](_0x254a00['query']);_0x9ea6f4[_0x740b('0x38')]=_['intersection'](_0x9ea6f4[_0x740b('0x36')],_0x9ea6f4[_0x740b('0x37')]);_0x28275e[_0x740b('0x39')]=_[_0x740b('0x3a')](_0x9ea6f4[_0x740b('0x36')],qs['fields'](_0x254a00['query'][_0x740b('0x3b')]));_0x28275e[_0x740b('0x39')]=_0x28275e[_0x740b('0x39')][_0x740b('0x3c')]?_0x28275e[_0x740b('0x39')]:_0x9ea6f4[_0x740b('0x36')];if(!_0x254a00['query']['hasOwnProperty'](_0x740b('0x3d'))){_0x28275e[_0x740b('0x23')]=qs['limit'](_0x254a00[_0x740b('0x37')]['limit']);_0x28275e[_0x740b('0x20')]=qs[_0x740b('0x20')](_0x254a00[_0x740b('0x37')][_0x740b('0x20')]);}_0x28275e[_0x740b('0x3e')]=qs['sort'](_0x254a00[_0x740b('0x37')]['sort']);_0x28275e[_0x740b('0x3f')]=qs[_0x740b('0x38')](_[_0x740b('0x40')](_0x254a00['query'],_0x9ea6f4[_0x740b('0x38')]),_0x35b3f4);if(_0x254a00[_0x740b('0x37')][_0x740b('0x41')]){_0x28275e['where']=_[_0x740b('0x42')](_0x28275e[_0x740b('0x3f')],{'$or':_[_0x740b('0x31')](_0x35b3f4,function(_0x5d4b01){if(_0x5d4b01[_0x740b('0x34')]!==_0x740b('0x43')){var _0x5c50b3={};_0x5c50b3[_0x5d4b01[_0x740b('0x2e')]]={'$like':'%'+_0x254a00['query'][_0x740b('0x41')]+'%'};return _0x5c50b3;}})});}_0x28275e=_['merge']({},_0x28275e,_0x254a00[_0x740b('0x44')]);var _0xf0e6b3={'where':_0x28275e[_0x740b('0x3f')]};return db[_0x740b('0x32')][_0x740b('0x22')](_0xf0e6b3)[_0x740b('0x28')](function(_0x2a2059){_0x5520ca[_0x740b('0x22')]=_0x2a2059;if(_0x254a00[_0x740b('0x37')][_0x740b('0x45')]){_0x28275e[_0x740b('0x46')]=[{'all':!![]}];}return db[_0x740b('0x32')][_0x740b('0x47')](_0x28275e);})[_0x740b('0x28')](function(_0x5eb0ff){_0x5520ca[_0x740b('0x48')]=_0x5eb0ff;return _0x5520ca;})[_0x740b('0x28')](respondWithFilteredResult(_0x10ca70,_0x28275e))[_0x740b('0x49')](handleError(_0x10ca70,null));};exports['show']=function(_0x2860a1,_0x3450e2){var _0x52208e={'raw':!![],'where':{'id':_0x2860a1[_0x740b('0x4a')]['id']}},_0x433147={};_0x433147[_0x740b('0x36')]=_[_0x740b('0x4b')](db[_0x740b('0x32')]['rawAttributes']);_0x433147[_0x740b('0x37')]=_[_0x740b('0x4b')](_0x2860a1[_0x740b('0x37')]);_0x433147[_0x740b('0x38')]=_[_0x740b('0x3a')](_0x433147[_0x740b('0x36')],_0x433147[_0x740b('0x37')]);_0x52208e[_0x740b('0x39')]=_['intersection'](_0x433147[_0x740b('0x36')],qs['fields'](_0x2860a1[_0x740b('0x37')][_0x740b('0x3b')]));_0x52208e[_0x740b('0x39')]=_0x52208e[_0x740b('0x39')][_0x740b('0x3c')]?_0x52208e[_0x740b('0x39')]:_0x433147[_0x740b('0x36')];if(_0x2860a1[_0x740b('0x37')][_0x740b('0x45')]){_0x52208e[_0x740b('0x46')]=[{'all':!![]}];}_0x52208e=_[_0x740b('0x42')]({},_0x52208e,_0x2860a1[_0x740b('0x44')]);return db[_0x740b('0x32')][_0x740b('0x4c')](_0x52208e)['then'](handleEntityNotFound(_0x3450e2,null))[_0x740b('0x28')](respondWithResult(_0x3450e2,null))[_0x740b('0x49')](handleError(_0x3450e2,null));};exports[_0x740b('0x4d')]=function(_0x2926ad,_0x5f174c){return db['Disposition'][_0x740b('0x4d')](_0x2926ad['body'],{})[_0x740b('0x28')](function(_0x9f8691){var _0x29a5a1=_0x2926ad[_0x740b('0x4e')]['get']({'plain':!![]});if(!_0x29a5a1)throw new Error(_0x740b('0x4f'));if(_0x29a5a1[_0x740b('0x50')]===_0x740b('0x4e')){var _0x2fc934=_0x9f8691[_0x740b('0x2a')]({'plain':!![]});var _0x27cd32=_0x740b('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x27cd32,'userProfileId':_0x29a5a1[_0x740b('0x51')]},'raw':!![]})[_0x740b('0x28')](function(_0x151f43){if(_0x151f43&&_0x151f43[_0x740b('0x52')]===0x0){return db[_0x740b('0x2c')][_0x740b('0x4d')]({'name':_0x2fc934['name'],'resourceId':_0x2fc934['id'],'type':_0x151f43[_0x740b('0x2e')],'sectionId':_0x151f43['id']},{})[_0x740b('0x28')](function(){return _0x9f8691;});}else{return _0x9f8691;}})[_0x740b('0x49')](function(_0x1d6337){logger[_0x740b('0x53')](_0x740b('0x54'),_0x1d6337);throw _0x1d6337;});}return _0x9f8691;})['then'](respondWithResult(_0x5f174c,0xc9))[_0x740b('0x49')](handleError(_0x5f174c,null));};exports['update']=function(_0x2f75e9,_0x541dcb){if(_0x2f75e9['body']['id']){delete _0x2f75e9[_0x740b('0x55')]['id'];}return db[_0x740b('0x32')]['find']({'where':{'id':_0x2f75e9[_0x740b('0x4a')]['id']}})[_0x740b('0x28')](handleEntityNotFound(_0x541dcb,null))[_0x740b('0x28')](saveUpdates(_0x2f75e9[_0x740b('0x55')],null))[_0x740b('0x28')](respondWithResult(_0x541dcb,null))[_0x740b('0x49')](handleError(_0x541dcb,null));};exports['destroy']=function(_0x1daa5f,_0x36fdcf){return db[_0x740b('0x32')][_0x740b('0x4c')]({'where':{'id':_0x1daa5f[_0x740b('0x4a')]['id']}})[_0x740b('0x28')](handleEntityNotFound(_0x36fdcf,null))['then'](removeEntity(_0x36fdcf,null))[_0x740b('0x49')](handleError(_0x36fdcf,null));};
\ No newline at end of file
+var _0x9034=['end','offset','undefined','count','limit','set','Content-Range','json','apply','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Disposition','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','find','userProfileId','autoAssociation','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x1b860b,_0xe4be7){var _0x2aad10=function(_0x220468){while(--_0x220468){_0x1b860b['push'](_0x1b860b['shift']());}};_0x2aad10(++_0xe4be7);}(_0x9034,0x1cd));var _0x4903=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9034[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4903('0x0'));var zipdir=require(_0x4903('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4903('0x2'));var moment=require('moment');var BPromise=require(_0x4903('0x3'));var Mustache=require(_0x4903('0x4'));var util=require(_0x4903('0x5'));var path=require(_0x4903('0x6'));var sox=require('sox');var csv=require(_0x4903('0x7'));var ejs=require(_0x4903('0x8'));var fs=require('fs');var fs_extra=require(_0x4903('0x9'));var _=require(_0x4903('0xa'));var squel=require(_0x4903('0xb'));var crypto=require('crypto');var jsforce=require(_0x4903('0xc'));var deskjs=require(_0x4903('0xd'));var toCsv=require(_0x4903('0x7'));var querystring=require(_0x4903('0xe'));var Papa=require(_0x4903('0xf'));var Redis=require('ioredis');var authService=require(_0x4903('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4903('0x11'));var hardwareService=require(_0x4903('0x12'));var logger=require('../../config/logger')(_0x4903('0x13'));var utils=require('../../config/utils');var config=require(_0x4903('0x14'));var licenseUtil=require(_0x4903('0x15'));var db=require(_0x4903('0x16'))['db'];function respondWithStatusCode(_0x23dd77,_0x3deb11){_0x3deb11=_0x3deb11||0xcc;return function(_0x5cbe80){if(_0x5cbe80){return _0x23dd77[_0x4903('0x17')](_0x3deb11);}return _0x23dd77[_0x4903('0x18')](_0x3deb11)[_0x4903('0x19')]();};}function respondWithResult(_0x111738,_0x30e22b){_0x30e22b=_0x30e22b||0xc8;return function(_0x3fae15){if(_0x3fae15){return _0x111738[_0x4903('0x18')](_0x30e22b)['json'](_0x3fae15);}};}function respondWithFilteredResult(_0x954494,_0x5d100d){return function(_0x2176cd){if(_0x2176cd){var _0x115478=typeof _0x5d100d[_0x4903('0x1a')]==='undefined'&&typeof _0x5d100d['limit']===_0x4903('0x1b');var _0x25bac1=_0x2176cd[_0x4903('0x1c')];var _0x5934a1=_0x115478?0x0:_0x5d100d[_0x4903('0x1a')];var _0x3dea5f=_0x115478?_0x2176cd['count']:_0x5d100d[_0x4903('0x1a')]+_0x5d100d[_0x4903('0x1d')];var _0x333374;if(_0x3dea5f>=_0x25bac1){_0x3dea5f=_0x25bac1;_0x333374=0xc8;}else{_0x333374=0xce;}_0x954494[_0x4903('0x18')](_0x333374);return _0x954494[_0x4903('0x1e')](_0x4903('0x1f'),_0x5934a1+'-'+_0x3dea5f+'/'+_0x25bac1)[_0x4903('0x20')](_0x2176cd);}return null;};}function patchUpdates(_0x5b6505){return function(_0x149c4b){try{jsonpatch[_0x4903('0x21')](_0x149c4b,_0x5b6505,!![]);}catch(_0x8741f2){return BPromise['reject'](_0x8741f2);}return _0x149c4b['save']();};}function saveUpdates(_0x1e47ee,_0x2fdce6){return function(_0x1aa5b5){if(_0x1aa5b5){return _0x1aa5b5[_0x4903('0x22')](_0x1e47ee)[_0x4903('0x23')](function(_0x186f2d){return _0x186f2d;});}return null;};}function removeEntity(_0x154312,_0x4635b9){return function(_0x2da1e6){if(_0x2da1e6){return _0x2da1e6['destroy']()[_0x4903('0x23')](function(){var _0x2823b3=_0x2da1e6[_0x4903('0x24')]({'plain':!![]});var _0x4fe6f8='Dispositions';return db[_0x4903('0x25')][_0x4903('0x26')]({'where':{'type':_0x4fe6f8,'resourceId':_0x2823b3['id']}})[_0x4903('0x23')](function(){return _0x2da1e6;});})['then'](function(){_0x154312['status'](0xcc)[_0x4903('0x19')]();});}};}function handleEntityNotFound(_0x368116,_0x164aa5){return function(_0x8ab962){if(!_0x8ab962){_0x368116[_0x4903('0x17')](0x194);}return _0x8ab962;};}function handleError(_0x2b0379,_0xb21966){_0xb21966=_0xb21966||0x1f4;return function(_0x57f015){logger[_0x4903('0x27')](_0x57f015[_0x4903('0x28')]);if(_0x57f015['name']){delete _0x57f015[_0x4903('0x29')];}_0x2b0379[_0x4903('0x18')](_0xb21966)[_0x4903('0x2a')](_0x57f015);};}exports[_0x4903('0x2b')]=function(_0x32f4fb,_0x15a4d7){var _0x4dda21={},_0x30bbf0={},_0xab17d6={'count':0x0,'rows':[]};var _0x18ac9b=_[_0x4903('0x2c')](db[_0x4903('0x2d')][_0x4903('0x2e')],function(_0x25c9d8){return{'name':_0x25c9d8['fieldName'],'type':_0x25c9d8['type'][_0x4903('0x2f')]};});_0x30bbf0[_0x4903('0x30')]=_['map'](_0x18ac9b,_0x4903('0x29'));_0x30bbf0[_0x4903('0x31')]=_[_0x4903('0x32')](_0x32f4fb['query']);_0x30bbf0['filters']=_[_0x4903('0x33')](_0x30bbf0['model'],_0x30bbf0[_0x4903('0x31')]);_0x4dda21[_0x4903('0x34')]=_[_0x4903('0x33')](_0x30bbf0[_0x4903('0x30')],qs['fields'](_0x32f4fb[_0x4903('0x31')][_0x4903('0x35')]));_0x4dda21['attributes']=_0x4dda21[_0x4903('0x34')][_0x4903('0x36')]?_0x4dda21[_0x4903('0x34')]:_0x30bbf0[_0x4903('0x30')];if(!_0x32f4fb[_0x4903('0x31')][_0x4903('0x37')](_0x4903('0x38'))){_0x4dda21[_0x4903('0x1d')]=qs['limit'](_0x32f4fb[_0x4903('0x31')][_0x4903('0x1d')]);_0x4dda21['offset']=qs['offset'](_0x32f4fb[_0x4903('0x31')][_0x4903('0x1a')]);}_0x4dda21[_0x4903('0x39')]=qs[_0x4903('0x3a')](_0x32f4fb['query'][_0x4903('0x3a')]);_0x4dda21[_0x4903('0x3b')]=qs[_0x4903('0x3c')](_[_0x4903('0x3d')](_0x32f4fb['query'],_0x30bbf0[_0x4903('0x3c')]),_0x18ac9b);if(_0x32f4fb[_0x4903('0x31')][_0x4903('0x3e')]){_0x4dda21[_0x4903('0x3b')]=_[_0x4903('0x3f')](_0x4dda21[_0x4903('0x3b')],{'$or':_[_0x4903('0x2c')](_0x18ac9b,function(_0x373968){if(_0x373968[_0x4903('0x40')]!==_0x4903('0x41')){var _0x256796={};_0x256796[_0x373968[_0x4903('0x29')]]={'$like':'%'+_0x32f4fb[_0x4903('0x31')][_0x4903('0x3e')]+'%'};return _0x256796;}})});}_0x4dda21=_[_0x4903('0x3f')]({},_0x4dda21,_0x32f4fb[_0x4903('0x42')]);var _0x432fed={'where':_0x4dda21[_0x4903('0x3b')]};return db[_0x4903('0x2d')]['count'](_0x432fed)[_0x4903('0x23')](function(_0x189b51){_0xab17d6[_0x4903('0x1c')]=_0x189b51;if(_0x32f4fb[_0x4903('0x31')][_0x4903('0x43')]){_0x4dda21[_0x4903('0x44')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x4dda21);})[_0x4903('0x23')](function(_0x2f1067){_0xab17d6['rows']=_0x2f1067;return _0xab17d6;})['then'](respondWithFilteredResult(_0x15a4d7,_0x4dda21))[_0x4903('0x45')](handleError(_0x15a4d7,null));};exports[_0x4903('0x46')]=function(_0x3b054f,_0xe5fc77){var _0x3f7e20={'raw':!![],'where':{'id':_0x3b054f['params']['id']}},_0x149704={};_0x149704[_0x4903('0x30')]=_[_0x4903('0x32')](db['Disposition'][_0x4903('0x2e')]);_0x149704[_0x4903('0x31')]=_['keys'](_0x3b054f[_0x4903('0x31')]);_0x149704[_0x4903('0x3c')]=_[_0x4903('0x33')](_0x149704[_0x4903('0x30')],_0x149704['query']);_0x3f7e20[_0x4903('0x34')]=_[_0x4903('0x33')](_0x149704[_0x4903('0x30')],qs[_0x4903('0x35')](_0x3b054f[_0x4903('0x31')]['fields']));_0x3f7e20[_0x4903('0x34')]=_0x3f7e20[_0x4903('0x34')][_0x4903('0x36')]?_0x3f7e20[_0x4903('0x34')]:_0x149704[_0x4903('0x30')];if(_0x3b054f['query'][_0x4903('0x43')]){_0x3f7e20['include']=[{'all':!![]}];}_0x3f7e20=_[_0x4903('0x3f')]({},_0x3f7e20,_0x3b054f['options']);return db[_0x4903('0x2d')]['find'](_0x3f7e20)[_0x4903('0x23')](handleEntityNotFound(_0xe5fc77,null))[_0x4903('0x23')](respondWithResult(_0xe5fc77,null))[_0x4903('0x45')](handleError(_0xe5fc77,null));};exports[_0x4903('0x47')]=function(_0x8f2d4c,_0x5ef362){return db[_0x4903('0x2d')][_0x4903('0x47')](_0x8f2d4c[_0x4903('0x48')],{})[_0x4903('0x23')](function(_0x418689){var _0x217ede=_0x8f2d4c[_0x4903('0x49')][_0x4903('0x24')]({'plain':!![]});if(!_0x217ede)throw new Error(_0x4903('0x4a'));if(_0x217ede[_0x4903('0x4b')]===_0x4903('0x49')){var _0x58bb3f=_0x418689[_0x4903('0x24')]({'plain':!![]});var _0x793c16=_0x4903('0x4c');return db[_0x4903('0x4d')][_0x4903('0x4e')]({'where':{'name':_0x793c16,'userProfileId':_0x217ede[_0x4903('0x4f')]},'raw':!![]})[_0x4903('0x23')](function(_0x4f469f){if(_0x4f469f&&_0x4f469f[_0x4903('0x50')]===0x0){return db[_0x4903('0x25')][_0x4903('0x47')]({'name':_0x58bb3f['name'],'resourceId':_0x58bb3f['id'],'type':_0x4f469f[_0x4903('0x29')],'sectionId':_0x4f469f['id']},{})['then'](function(){return _0x418689;});}else{return _0x418689;}})[_0x4903('0x45')](function(_0x1e6e3d){logger[_0x4903('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e6e3d);throw _0x1e6e3d;});}return _0x418689;})[_0x4903('0x23')](respondWithResult(_0x5ef362,0xc9))['catch'](handleError(_0x5ef362,null));};exports[_0x4903('0x22')]=function(_0x2df451,_0x529e42){if(_0x2df451[_0x4903('0x48')]['id']){delete _0x2df451['body']['id'];}return db[_0x4903('0x2d')][_0x4903('0x4e')]({'where':{'id':_0x2df451['params']['id']}})[_0x4903('0x23')](handleEntityNotFound(_0x529e42,null))[_0x4903('0x23')](saveUpdates(_0x2df451['body'],null))['then'](respondWithResult(_0x529e42,null))[_0x4903('0x45')](handleError(_0x529e42,null));};exports['destroy']=function(_0x5779b7,_0x37cb02){return db[_0x4903('0x2d')][_0x4903('0x4e')]({'where':{'id':_0x5779b7['params']['id']}})['then'](handleEntityNotFound(_0x37cb02,null))[_0x4903('0x23')](removeEntity(_0x37cb02,null))['catch'](handleError(_0x37cb02,null));};
\ No newline at end of file
index f410bfe..a1c2ea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab61=['name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./disposition.attributes','exports','define','name_voice','name','name_chat'];(function(_0x2d8b76,_0x55ae6c){var _0x5c8b28=function(_0x24f733){while(--_0x24f733){_0x2d8b76['push'](_0x2d8b76['shift']());}};_0x5c8b28(++_0x55ae6c);}(_0xab61,0x179));var _0x1ab6=function(_0x575045,_0x1c2016){_0x575045=_0x575045-0x0;var _0x2d73d5=_0xab61[_0x575045];return _0x2d73d5;};'use strict';var _=require(_0x1ab6('0x0'));var util=require(_0x1ab6('0x1'));var logger=require(_0x1ab6('0x2'))(_0x1ab6('0x3'));var moment=require(_0x1ab6('0x4'));var BPromise=require('bluebird');var rp=require(_0x1ab6('0x5'));var fs=require('fs');var path=require(_0x1ab6('0x6'));var rimraf=require(_0x1ab6('0x7'));var config=require('../../config/environment');var attributes=require(_0x1ab6('0x8'));module[_0x1ab6('0x9')]=function(_0x495aef,_0x9053f2){return _0x495aef[_0x1ab6('0xa')]('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x1ab6('0xb'),'fields':[_0x1ab6('0xc'),'ListId']},{'unique':!![],'name':_0x1ab6('0xd'),'fields':[_0x1ab6('0xc'),'ChatWebsiteId']},{'unique':!![],'name':_0x1ab6('0xe'),'fields':[_0x1ab6('0xc'),_0x1ab6('0xf')]},{'unique':!![],'name':_0x1ab6('0x10'),'fields':['name',_0x1ab6('0x11')]},{'unique':!![],'name':_0x1ab6('0x12'),'fields':[_0x1ab6('0xc'),_0x1ab6('0x13')]},{'unique':!![],'name':_0x1ab6('0x14'),'fields':['name',_0x1ab6('0x15')]},{'unique':!![],'name':_0x1ab6('0x16'),'fields':[_0x1ab6('0xc'),'WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc931=['exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','FaxAccountId','name_openchannel','name_whatsapp','WhatsappAccountId','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./disposition.attributes'];(function(_0x186496,_0x3c83ed){var _0xf2d985=function(_0x4f44a1){while(--_0x4f44a1){_0x186496['push'](_0x186496['shift']());}};_0xf2d985(++_0x3c83ed);}(_0xc931,0xd0));var _0x1c93=function(_0x2a1a10,_0x4b1eff){_0x2a1a10=_0x2a1a10-0x0;var _0x180e23=_0xc931[_0x2a1a10];return _0x180e23;};'use strict';var _=require('lodash');var util=require(_0x1c93('0x0'));var logger=require(_0x1c93('0x1'))('api');var moment=require(_0x1c93('0x2'));var BPromise=require('bluebird');var rp=require(_0x1c93('0x3'));var fs=require('fs');var path=require(_0x1c93('0x4'));var rimraf=require(_0x1c93('0x5'));var config=require(_0x1c93('0x6'));var attributes=require(_0x1c93('0x7'));module[_0x1c93('0x8')]=function(_0x258889,_0x2b871d){return _0x258889[_0x1c93('0x9')](_0x1c93('0xa'),attributes,{'tableName':_0x1c93('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x1c93('0xc'),'fields':[_0x1c93('0xd'),_0x1c93('0xe')]},{'unique':!![],'name':_0x1c93('0xf'),'fields':[_0x1c93('0xd'),_0x1c93('0x10')]},{'unique':!![],'name':'name_mail','fields':[_0x1c93('0xd'),_0x1c93('0x11')]},{'unique':!![],'name':_0x1c93('0x12'),'fields':['name',_0x1c93('0x13')]},{'unique':!![],'name':'name_fax','fields':['name',_0x1c93('0x14')]},{'unique':!![],'name':_0x1c93('0x15'),'fields':[_0x1c93('0xd'),'OpenchannelAccountId']},{'unique':!![],'name':_0x1c93('0x16'),'fields':['name',_0x1c93('0x17')]}],'timestamps':!![]});};
\ No newline at end of file
index ec68189..b11a8eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x176523,_0x3bacbc){var _0x96a0b5=function(_0x3d4944){while(--_0x3d4944){_0x176523['push'](_0x176523['shift']());}};_0x96a0b5(++_0x3bacbc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xa9e0[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xad4022,_0x5877c9){var _0x543bde=function(_0x32b85c){while(--_0x32b85c){_0xad4022['push'](_0xad4022['shift']());}};_0x543bde(++_0x5877c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 feb4fea..875aa2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1d2=['index','/:id','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1010fb,_0x4b676c){var _0x4e03c1=function(_0x236d4d){while(--_0x236d4d){_0x1010fb['push'](_0x1010fb['shift']());}};_0x4e03c1(++_0x4b676c);}(_0xb1d2,0x116));var _0x2b1d=function(_0x55356f,_0x521fc8){_0x55356f=_0x55356f-0x0;var _0x5e2b01=_0xb1d2[_0x55356f];return _0x5e2b01;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b1d('0x0'));var timeout=require(_0x2b1d('0x1'));var express=require(_0x2b1d('0x2'));var router=express[_0x2b1d('0x3')]();var fs_extra=require(_0x2b1d('0x4'));var auth=require(_0x2b1d('0x5'));var interaction=require(_0x2b1d('0x6'));var config=require(_0x2b1d('0x7'));var controller=require('./disposition.controller');router[_0x2b1d('0x8')]('/',auth[_0x2b1d('0x9')](),controller[_0x2b1d('0xa')]);router['get'](_0x2b1d('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x2b1d('0xc')]);router[_0x2b1d('0xd')](_0x2b1d('0xb'),auth[_0x2b1d('0x9')](),controller[_0x2b1d('0xe')]);router[_0x2b1d('0xf')](_0x2b1d('0xb'),auth[_0x2b1d('0x9')](),controller[_0x2b1d('0x10')]);module[_0x2b1d('0x11')]=router;
\ No newline at end of file
+var _0x87e0=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','put','delete'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x87e0,0x154));var _0x087e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x87e0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0x087e('0x0'));var path=require(_0x087e('0x1'));var timeout=require(_0x087e('0x2'));var express=require(_0x087e('0x3'));var router=express[_0x087e('0x4')]();var fs_extra=require(_0x087e('0x5'));var auth=require(_0x087e('0x6'));var interaction=require(_0x087e('0x7'));var config=require(_0x087e('0x8'));var controller=require(_0x087e('0x9'));router[_0x087e('0xa')]('/',auth[_0x087e('0xb')](),controller[_0x087e('0xc')]);router[_0x087e('0xa')](_0x087e('0xd'),auth[_0x087e('0xb')](),controller[_0x087e('0xe')]);router['post']('/',auth[_0x087e('0xb')](),controller['create']);router[_0x087e('0xf')](_0x087e('0xd'),auth[_0x087e('0xb')](),controller['update']);router[_0x087e('0x10')](_0x087e('0xd'),auth[_0x087e('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 6006c99..2fa440d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95ff=['9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800'];(function(_0x30bd66,_0x36a93d){var _0x74c9dd=function(_0x2cd660){while(--_0x2cd660){_0x30bd66['push'](_0x30bd66['shift']());}};_0x74c9dd(++_0x36a93d);}(_0x95ff,0xe7));var _0xf95f=function(_0x483a07,_0x23e01b){_0x483a07=_0x483a07-0x0;var _0x4c0673=_0x95ff[_0x483a07];return _0x4c0673;};'use strict';var Sequelize=require(_0xf95f('0x0'));module[_0xf95f('0x1')]={'name':{'type':Sequelize[_0xf95f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf95f('0x2')]},'ecm':{'type':Sequelize[_0xf95f('0x3')](_0xf95f('0x4'),'no'),'defaultValue':_0xf95f('0x4')},'headerinfo':{'type':Sequelize[_0xf95f('0x2')],'defaultValue':_0xf95f('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0xf95f('0x6')},'minrate':{'type':Sequelize[_0xf95f('0x3')](_0xf95f('0x7'),_0xf95f('0x8'),'7200',_0xf95f('0x9'),_0xf95f('0xa'),_0xf95f('0xb')),'defaultValue':_0xf95f('0x8')},'maxrate':{'type':Sequelize[_0xf95f('0x3')](_0xf95f('0x7'),_0xf95f('0x8'),'7200',_0xf95f('0x9'),'12000',_0xf95f('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xf95f('0x2')],'defaultValue':_0xf95f('0xc')},'gateway':{'type':Sequelize[_0xf95f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xf95f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xf95f('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xf95f('0x3')](_0xf95f('0xe'),_0xf95f('0xf'),_0xf95f('0x10'),_0xf95f('0x11')),'defaultValue':_0xf95f('0xe')},'key':{'type':Sequelize[_0xf95f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf95f('0x12')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xf95f('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf95f('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf95f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf95f('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf95f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf95f('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf95f('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf95f('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0xf95f('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xf95f('0x13')],'defaultValue':![],'comment':_0xf95f('0x15'),'set':function(_0x530b04){if(!_0x530b04)this['setDataValue'](_0xf95f('0x16'),null);this['setDataValue'](_0xf95f('0x17'),_0x530b04);}}};
\ No newline at end of file
+var _0xc361=['STRING','yes','localstationid','4800','7200','9600','12000','14400','ENUM','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','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','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0xc361,0x76));var _0x1c36=function(_0x2f2c64,_0x29db54){_0x2f2c64=_0x2f2c64-0x0;var _0x4ee4aa=_0xc361[_0x2f2c64];return _0x4ee4aa;};'use strict';var Sequelize=require(_0x1c36('0x0'));module[_0x1c36('0x1')]={'name':{'type':Sequelize[_0x1c36('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1c36('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0x1c36('0x3'),'no'),'defaultValue':_0x1c36('0x3')},'headerinfo':{'type':Sequelize[_0x1c36('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x1c36('0x2')],'unique':_0x1c36('0x4')},'minrate':{'type':Sequelize['ENUM']('2400',_0x1c36('0x5'),_0x1c36('0x6'),_0x1c36('0x7'),_0x1c36('0x8'),_0x1c36('0x9')),'defaultValue':_0x1c36('0x5')},'maxrate':{'type':Sequelize[_0x1c36('0xa')]('2400',_0x1c36('0x5'),_0x1c36('0x6'),_0x1c36('0x7'),_0x1c36('0x8'),'14400'),'defaultValue':_0x1c36('0x9')},'modem':{'type':Sequelize[_0x1c36('0x2')],'defaultValue':_0x1c36('0xb')},'gateway':{'type':Sequelize[_0x1c36('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1c36('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x1c36('0xa')](_0x1c36('0xd'),_0x1c36('0xe'),_0x1c36('0xf'),_0x1c36('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x1c36('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x1c36('0x11');}},'notificationSound':{'type':Sequelize[_0x1c36('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1c36('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1c36('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1c36('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1c36('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1c36('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1c36('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x1c36('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x1c36('0x14'),'set':function(_0x46e8eb){if(!_0x46e8eb)this['setDataValue'](_0x1c36('0x15'),null);this[_0x1c36('0x16')](_0x1c36('0x17'),_0x46e8eb);}}};
\ No newline at end of file
index 5b0b87c..a0cda98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8191=['omit','Contact','User','Owner','internal','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','ecm','faxdetect','headerinfo','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','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','send','CmList','List','CmContact','Contacts','attachments','join','root','basename','CheckAfterSend','isNil','path','from','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','get','FaxAccounts','UserProfileResource','destroy','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','VIRTUAL','filter','options','includeAll','include','findAll','then','rows','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','describe','addDisposition','FaxAccountId','Disposition','findOne','order','pick','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','addInteraction','FaxInteraction'];(function(_0x5af59e,_0x3771c1){var _0x4240df=function(_0x2267fd){while(--_0x2267fd){_0x5af59e['push'](_0x5af59e['shift']());}};_0x4240df(++_0x3771c1);}(_0x8191,0x1d7));var _0x1819=function(_0x5dafd0,_0x3bcbb6){_0x5dafd0=_0x5dafd0-0x0;var _0x364354=_0x8191[_0x5dafd0];return _0x364354;};'use strict';var emlformat=require(_0x1819('0x0'));var rimraf=require(_0x1819('0x1'));var zipdir=require(_0x1819('0x2'));var jsonpatch=require(_0x1819('0x3'));var rp=require('request-promise');var moment=require(_0x1819('0x4'));var BPromise=require(_0x1819('0x5'));var Mustache=require(_0x1819('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1819('0x7'));var ejs=require(_0x1819('0x8'));var fs=require('fs');var fs_extra=require(_0x1819('0x9'));var _=require(_0x1819('0xa'));var squel=require('squel');var crypto=require(_0x1819('0xb'));var jsforce=require(_0x1819('0xc'));var deskjs=require(_0x1819('0xd'));var toCsv=require(_0x1819('0x7'));var querystring=require(_0x1819('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1819('0xf'));var qs=require(_0x1819('0x10'));var as=require(_0x1819('0x11'));var hardwareService=require(_0x1819('0x12'));var logger=require('../../config/logger')(_0x1819('0x13'));var utils=require(_0x1819('0x14'));var config=require(_0x1819('0x15'));var licenseUtil=require(_0x1819('0x16'));var db=require(_0x1819('0x17'))['db'];config[_0x1819('0x18')]=_[_0x1819('0x19')](config['redis'],{'host':_0x1819('0x1a'),'port':0x18eb});var socket=require(_0x1819('0x1b'))(new Redis(config['redis']));require(_0x1819('0x1c'))[_0x1819('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1819('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x1819('0x1e')][_0x1819('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x440195,_0x1173ae,_0x535c6b,_0x507274){return new BPromise(function(_0x22d14a,_0x3d0d6e){var _0x1808f3=_0x507274||client;return _0x1808f3[_0x1819('0x20')](_0x440195,_0x535c6b)['then'](function(_0x26a33c){logger[_0x1819('0x21')](_0x1819('0x22'),_0x1173ae,_0x1819('0x23'));logger[_0x1819('0x24')](_0x1819('0x25'),_0x1173ae,_0x1819('0x23'),JSON['stringify'](_0x26a33c));if(_0x26a33c[_0x1819('0x26')]){if(_0x26a33c[_0x1819('0x26')][_0x1819('0x27')]===0x1f4){logger[_0x1819('0x26')](_0x1819('0x22'),_0x1173ae,_0x26a33c[_0x1819('0x26')][_0x1819('0x28')]);return _0x3d0d6e(_0x26a33c[_0x1819('0x26')][_0x1819('0x28')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x1173ae,_0x26a33c['error'][_0x1819('0x28')]);return _0x22d14a(_0x26a33c[_0x1819('0x26')][_0x1819('0x28')]);}else{logger[_0x1819('0x21')](_0x1819('0x22'),_0x1173ae,_0x1819('0x23'));_0x22d14a(_0x26a33c[_0x1819('0x29')][_0x1819('0x28')]);}})[_0x1819('0x2a')](function(_0x1cb128){logger[_0x1819('0x26')](_0x1819('0x22'),_0x1173ae,_0x1cb128);_0x3d0d6e(_0x1cb128);});});}function respondWithStatusCode(_0x3ae563,_0x139577){_0x139577=_0x139577||0xcc;return function(_0xd075bb){if(_0xd075bb){return _0x3ae563[_0x1819('0x2b')](_0x139577);}return _0x3ae563[_0x1819('0x2c')](_0x139577)[_0x1819('0x2d')]();};}function respondWithResult(_0x38b7c3,_0x32a27f){_0x32a27f=_0x32a27f||0xc8;return function(_0x5e8d8c){if(_0x5e8d8c){return _0x38b7c3[_0x1819('0x2c')](_0x32a27f)[_0x1819('0x2e')](_0x5e8d8c);}};}function respondWithFilteredResult(_0xca15,_0x488f3a){return function(_0x8a9e40){if(_0x8a9e40){var _0x148e7d=typeof _0x488f3a[_0x1819('0x2f')]==='undefined'&&typeof _0x488f3a[_0x1819('0x30')]===_0x1819('0x31');var _0x415f72=_0x8a9e40['count'];var _0x4ea70e=_0x148e7d?0x0:_0x488f3a['offset'];var _0x1c7bd5=_0x148e7d?_0x8a9e40[_0x1819('0x32')]:_0x488f3a[_0x1819('0x2f')]+_0x488f3a[_0x1819('0x30')];var _0x3d1003;if(_0x1c7bd5>=_0x415f72){_0x1c7bd5=_0x415f72;_0x3d1003=0xc8;}else{_0x3d1003=0xce;}_0xca15['status'](_0x3d1003);return _0xca15['set']('Content-Range',_0x4ea70e+'-'+_0x1c7bd5+'/'+_0x415f72)[_0x1819('0x2e')](_0x8a9e40);}return null;};}function patchUpdates(_0x5c20fa){return function(_0x57e947){try{jsonpatch[_0x1819('0x33')](_0x57e947,_0x5c20fa,!![]);}catch(_0x2b1963){return BPromise[_0x1819('0x34')](_0x2b1963);}return _0x57e947[_0x1819('0x35')]();};}function saveUpdates(_0xf81d39,_0x229f29){return function(_0x46c69b){if(_0x46c69b){return _0x46c69b['update'](_0xf81d39)['then'](function(_0x3d812b){return _0x3d812b;});}return null;};}function removeEntity(_0x5dfd6f,_0x2260d7){return function(_0x440acd){if(_0x440acd){return _0x440acd['destroy']()['then'](function(){var _0x617f62=_0x440acd[_0x1819('0x36')]({'plain':!![]});var _0x430685=_0x1819('0x37');return db[_0x1819('0x38')][_0x1819('0x39')]({'where':{'type':_0x430685,'resourceId':_0x617f62['id']}})['then'](function(){return _0x440acd;});})['then'](function(){_0x5dfd6f[_0x1819('0x2c')](0xcc)[_0x1819('0x2d')]();});}};}function handleEntityNotFound(_0x37d925,_0x466eab){return function(_0x32da31){if(!_0x32da31){_0x37d925[_0x1819('0x2b')](0x194);}return _0x32da31;};}function handleError(_0x8cdad4,_0x2c7347){_0x2c7347=_0x2c7347||0x1f4;return function(_0x273fcf){logger[_0x1819('0x26')](_0x273fcf['stack']);if(_0x273fcf['name']){delete _0x273fcf[_0x1819('0x3a')];}_0x8cdad4[_0x1819('0x2c')](_0x2c7347)['send'](_0x273fcf);};}exports[_0x1819('0x3b')]=function(_0x35bca3,_0x4964b2){var _0x49f246={'include':[{'model':db[_0x1819('0x3c')],'as':_0x1819('0x3d')}]},_0x3b4ff8={},_0x3c3e1f={'count':0x0,'rows':[]};var _0x36276f=_[_0x1819('0x3e')](db[_0x1819('0x3f')][_0x1819('0x40')],function(_0xcdc3c5){return{'name':_0xcdc3c5[_0x1819('0x41')],'type':_0xcdc3c5[_0x1819('0x42')][_0x1819('0x43')]};});_0x3b4ff8[_0x1819('0x44')]=_[_0x1819('0x3e')](_0x36276f,_0x1819('0x3a'));_0x3b4ff8[_0x1819('0x45')]=_[_0x1819('0x46')](_0x35bca3[_0x1819('0x45')]);_0x3b4ff8[_0x1819('0x47')]=_['intersection'](_0x3b4ff8[_0x1819('0x44')],_0x3b4ff8[_0x1819('0x45')]);_0x49f246[_0x1819('0x48')]=_[_0x1819('0x49')](_0x3b4ff8[_0x1819('0x44')],qs['fields'](_0x35bca3['query'][_0x1819('0x4a')]));_0x49f246[_0x1819('0x48')]=_0x49f246[_0x1819('0x48')][_0x1819('0x4b')]?_0x49f246['attributes']:_0x3b4ff8['model'];if(!_0x35bca3['query'][_0x1819('0x4c')](_0x1819('0x4d'))){_0x49f246['limit']=qs[_0x1819('0x30')](_0x35bca3['query'][_0x1819('0x30')]);_0x49f246[_0x1819('0x2f')]=qs['offset'](_0x35bca3[_0x1819('0x45')][_0x1819('0x2f')]);}_0x49f246['order']=qs[_0x1819('0x4e')](_0x35bca3[_0x1819('0x45')][_0x1819('0x4e')]);_0x49f246['where']=qs[_0x1819('0x47')](_['pick'](_0x35bca3[_0x1819('0x45')],_0x3b4ff8['filters']),_0x36276f);if(_0x35bca3[_0x1819('0x45')]['filter']){_0x49f246[_0x1819('0x4f')]=_['merge'](_0x49f246[_0x1819('0x4f')],{'$or':_[_0x1819('0x3e')](_0x36276f,function(_0x352980){if(_0x352980['type']!==_0x1819('0x50')){var _0x271fd7={};_0x271fd7[_0x352980[_0x1819('0x3a')]]={'$like':'%'+_0x35bca3[_0x1819('0x45')][_0x1819('0x51')]+'%'};return _0x271fd7;}})});}_0x49f246=_['merge']({},_0x49f246,_0x35bca3[_0x1819('0x52')]);var _0x1eb718={'where':_0x49f246[_0x1819('0x4f')]};return db['FaxAccount'][_0x1819('0x32')](_0x1eb718)['then'](function(_0x539748){_0x3c3e1f[_0x1819('0x32')]=_0x539748;if(_0x35bca3[_0x1819('0x45')][_0x1819('0x53')]){_0x49f246[_0x1819('0x54')]=[{'all':!![]}];}return db['FaxAccount'][_0x1819('0x55')](_0x49f246);})[_0x1819('0x56')](function(_0x3a1b20){_0x3c3e1f[_0x1819('0x57')]=_0x3a1b20;return _0x3c3e1f;})['then'](respondWithFilteredResult(_0x4964b2,_0x49f246))[_0x1819('0x2a')](handleError(_0x4964b2,null));};exports['show']=function(_0x1d28e3,_0x4a6a77){var _0xf4601e={'raw':![],'where':{'id':_0x1d28e3['params']['id']},'include':[{'model':db[_0x1819('0x3c')],'as':_0x1819('0x3d')}]},_0x1a8caa={};_0x1a8caa['model']=_[_0x1819('0x46')](db[_0x1819('0x3f')][_0x1819('0x40')]);_0x1a8caa[_0x1819('0x45')]=_[_0x1819('0x46')](_0x1d28e3['query']);_0x1a8caa[_0x1819('0x47')]=_[_0x1819('0x49')](_0x1a8caa[_0x1819('0x44')],_0x1a8caa[_0x1819('0x45')]);_0xf4601e[_0x1819('0x48')]=_['intersection'](_0x1a8caa[_0x1819('0x44')],qs[_0x1819('0x4a')](_0x1d28e3[_0x1819('0x45')][_0x1819('0x4a')]));_0xf4601e[_0x1819('0x48')]=_0xf4601e[_0x1819('0x48')]['length']?_0xf4601e[_0x1819('0x48')]:_0x1a8caa['model'];if(_0x1d28e3[_0x1819('0x45')][_0x1819('0x53')]){_0xf4601e[_0x1819('0x54')]=[{'all':!![]}];}_0xf4601e=_[_0x1819('0x58')]({},_0xf4601e,_0x1d28e3['options']);return db[_0x1819('0x3f')]['find'](_0xf4601e)['then'](handleEntityNotFound(_0x4a6a77,null))[_0x1819('0x56')](respondWithResult(_0x4a6a77,null))[_0x1819('0x2a')](handleError(_0x4a6a77,null));};exports[_0x1819('0x59')]=function(_0xc9e23b,_0x23f568){return db[_0x1819('0x3f')]['create'](_0xc9e23b[_0x1819('0x5a')],{})[_0x1819('0x56')](function(_0x483084){var _0x4534fd=_0xc9e23b[_0x1819('0x5b')][_0x1819('0x36')]({'plain':!![]});if(!_0x4534fd)throw new Error(_0x1819('0x5c'));if(_0x4534fd[_0x1819('0x5d')]===_0x1819('0x5b')){var _0x28b750=_0x483084[_0x1819('0x36')]({'plain':!![]});var _0x2a78b1=_0x1819('0x37');return db[_0x1819('0x5e')]['find']({'where':{'name':_0x2a78b1,'userProfileId':_0x4534fd[_0x1819('0x5f')]},'raw':!![]})[_0x1819('0x56')](function(_0x36e9dd){if(_0x36e9dd&&_0x36e9dd['autoAssociation']===0x0){return db[_0x1819('0x38')]['create']({'name':_0x28b750[_0x1819('0x3a')],'resourceId':_0x28b750['id'],'type':_0x36e9dd[_0x1819('0x3a')],'sectionId':_0x36e9dd['id']},{})[_0x1819('0x56')](function(){return _0x483084;});}else{return _0x483084;}})[_0x1819('0x2a')](function(_0x4566e6){logger[_0x1819('0x26')](_0x1819('0x60'),_0x4566e6);throw _0x4566e6;});}return _0x483084;})[_0x1819('0x56')](respondWithResult(_0x23f568,0xc9))['catch'](handleError(_0x23f568,null));};exports[_0x1819('0x61')]=function(_0x1d9a5f,_0x8287b9){if(_0x1d9a5f[_0x1819('0x5a')]['id']){delete _0x1d9a5f[_0x1819('0x5a')]['id'];}return db[_0x1819('0x3f')][_0x1819('0x62')]({'where':{'id':_0x1d9a5f['params']['id']},'include':[{'model':db[_0x1819('0x3c')],'as':_0x1819('0x3d')}]})['then'](handleEntityNotFound(_0x8287b9,null))['then'](saveUpdates(_0x1d9a5f[_0x1819('0x5a')],null))[_0x1819('0x56')](respondWithResult(_0x8287b9,null))[_0x1819('0x2a')](handleError(_0x8287b9,null));};exports[_0x1819('0x39')]=function(_0x583faa,_0x4f5ece){return db['FaxAccount'][_0x1819('0x62')]({'where':{'id':_0x583faa[_0x1819('0x63')]['id']}})[_0x1819('0x56')](handleEntityNotFound(_0x4f5ece,null))[_0x1819('0x56')](removeEntity(_0x4f5ece,null))[_0x1819('0x2a')](handleError(_0x4f5ece,null));};exports[_0x1819('0x64')]=function(_0x436065,_0x3db4ba){return db['FaxAccount'][_0x1819('0x64')]()[_0x1819('0x56')](respondWithResult(_0x3db4ba,null))[_0x1819('0x2a')](handleError(_0x3db4ba,null));};exports[_0x1819('0x65')]=function(_0x236e6b,_0x2e1b9b,_0xc8d8c0){if(_0x236e6b[_0x1819('0x5a')]['id']){delete _0x236e6b[_0x1819('0x5a')]['id'];}return db[_0x1819('0x3f')]['find']({'where':{'id':_0x236e6b['params']['id']}})[_0x1819('0x56')](handleEntityNotFound(_0x2e1b9b,null))['then'](function(_0x37053b){if(_0x37053b){_0x236e6b[_0x1819('0x5a')][_0x1819('0x66')]=_0x37053b['id'];return db[_0x1819('0x67')][_0x1819('0x59')](_0x236e6b['body']);}})[_0x1819('0x56')](respondWithResult(_0x2e1b9b,null))[_0x1819('0x2a')](handleError(_0x2e1b9b,null));};exports['getDispositions']=function(_0x55aa5f,_0x2b91ac,_0x305808){var _0x30d7da={'raw':![],'where':{}};var _0x13c8fe={};var _0x107ef2={'count':0x0,'rows':[]};return db[_0x1819('0x3f')][_0x1819('0x68')]({'where':{'id':_0x55aa5f[_0x1819('0x63')]['id']}})[_0x1819('0x56')](handleEntityNotFound(_0x2b91ac,null))[_0x1819('0x56')](function(_0x201614){if(_0x201614){_0x13c8fe[_0x1819('0x44')]=_['keys'](db[_0x1819('0x67')][_0x1819('0x40')]);_0x13c8fe['query']=_['keys'](_0x55aa5f[_0x1819('0x45')]);_0x13c8fe[_0x1819('0x47')]=_[_0x1819('0x49')](_0x13c8fe[_0x1819('0x44')],_0x13c8fe['query']);_0x30d7da[_0x1819('0x48')]=_[_0x1819('0x49')](_0x13c8fe[_0x1819('0x44')],qs[_0x1819('0x4a')](_0x55aa5f[_0x1819('0x45')][_0x1819('0x4a')]));_0x30d7da['attributes']=_0x30d7da[_0x1819('0x48')][_0x1819('0x4b')]?_0x30d7da[_0x1819('0x48')]:_0x13c8fe['model'];if(!_0x55aa5f['query']['hasOwnProperty']('nolimit')){_0x30d7da[_0x1819('0x30')]=qs[_0x1819('0x30')](_0x55aa5f['query'][_0x1819('0x30')]);_0x30d7da['offset']=qs[_0x1819('0x2f')](_0x55aa5f['query'][_0x1819('0x2f')]);}_0x30d7da[_0x1819('0x69')]=qs[_0x1819('0x4e')](_0x55aa5f['query'][_0x1819('0x4e')]);_0x30d7da['where']=qs['filters'](_[_0x1819('0x6a')](_0x55aa5f[_0x1819('0x45')],_0x13c8fe[_0x1819('0x47')]));_0x30d7da[_0x1819('0x4f')][_0x1819('0x66')]=_0x201614['id'];if(_0x55aa5f[_0x1819('0x45')][_0x1819('0x51')]){_0x30d7da[_0x1819('0x4f')]=_[_0x1819('0x58')](_0x30d7da[_0x1819('0x4f')],{'$or':_['map'](_0x30d7da[_0x1819('0x48')],function(_0x3ae4ec){var _0x239d3b={};_0x239d3b[_0x3ae4ec]={'$like':'%'+_0x55aa5f[_0x1819('0x45')]['filter']+'%'};return _0x239d3b;})});}_0x30d7da=_['merge']({},_0x30d7da,_0x55aa5f[_0x1819('0x52')]);return db[_0x1819('0x67')][_0x1819('0x32')]({'where':_0x30d7da[_0x1819('0x4f')]})[_0x1819('0x56')](function(_0x5302a5){_0x107ef2[_0x1819('0x32')]=_0x5302a5;if(_0x55aa5f[_0x1819('0x45')]['includeAll']){_0x30d7da[_0x1819('0x54')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x30d7da);})[_0x1819('0x56')](function(_0x5e07da){_0x107ef2[_0x1819('0x57')]=_0x5e07da;return _0x107ef2;});}})['then'](respondWithFilteredResult(_0x2b91ac,_0x30d7da))[_0x1819('0x2a')](handleError(_0x2b91ac,null));};exports[_0x1819('0x6b')]=function(_0x4539b5,_0x17bffb,_0x5df30c){return db[_0x1819('0x3f')][_0x1819('0x62')]({'where':{'id':_0x4539b5[_0x1819('0x63')]['id']}})[_0x1819('0x56')](handleEntityNotFound(_0x17bffb,null))[_0x1819('0x56')](function(_0x45aea4){if(_0x45aea4){return _0x45aea4[_0x1819('0x6b')](_0x4539b5[_0x1819('0x45')]['ids']);}})[_0x1819('0x56')](respondWithStatusCode(_0x17bffb,null))[_0x1819('0x2a')](handleError(_0x17bffb,null));};exports[_0x1819('0x6c')]=function(_0x6bbb41,_0xa86168,_0x32b4d0){if(_0x6bbb41[_0x1819('0x5a')]['id']){delete _0x6bbb41[_0x1819('0x5a')]['id'];}return db[_0x1819('0x3f')]['find']({'where':{'id':_0x6bbb41[_0x1819('0x63')]['id']}})[_0x1819('0x56')](handleEntityNotFound(_0xa86168,null))['then'](function(_0x9470c0){if(_0x9470c0){_0x6bbb41[_0x1819('0x5a')][_0x1819('0x66')]=_0x9470c0['id'];return db[_0x1819('0x6d')][_0x1819('0x59')](_0x6bbb41['body']);}})[_0x1819('0x56')](respondWithResult(_0xa86168,null))['catch'](handleError(_0xa86168,null));};exports['getAnswers']=function(_0x2022d8,_0x2dce88,_0x4a8eff){var _0x4512a6={'raw':![],'where':{}};var _0x38d844={};var _0x49f9a6={'count':0x0,'rows':[]};return db[_0x1819('0x3f')][_0x1819('0x68')]({'where':{'id':_0x2022d8[_0x1819('0x63')]['id']}})[_0x1819('0x56')](handleEntityNotFound(_0x2dce88,null))['then'](function(_0x9537cc){if(_0x9537cc){_0x38d844[_0x1819('0x44')]=_['keys'](db['CannedAnswer'][_0x1819('0x40')]);_0x38d844[_0x1819('0x45')]=_[_0x1819('0x46')](_0x2022d8[_0x1819('0x45')]);_0x38d844['filters']=_['intersection'](_0x38d844[_0x1819('0x44')],_0x38d844[_0x1819('0x45')]);_0x4512a6[_0x1819('0x48')]=_[_0x1819('0x49')](_0x38d844[_0x1819('0x44')],qs[_0x1819('0x4a')](_0x2022d8[_0x1819('0x45')][_0x1819('0x4a')]));_0x4512a6[_0x1819('0x48')]=_0x4512a6[_0x1819('0x48')][_0x1819('0x4b')]?_0x4512a6[_0x1819('0x48')]:_0x38d844['model'];if(!_0x2022d8[_0x1819('0x45')][_0x1819('0x4c')](_0x1819('0x4d'))){_0x4512a6[_0x1819('0x30')]=qs[_0x1819('0x30')](_0x2022d8[_0x1819('0x45')][_0x1819('0x30')]);_0x4512a6[_0x1819('0x2f')]=qs[_0x1819('0x2f')](_0x2022d8[_0x1819('0x45')]['offset']);}_0x4512a6[_0x1819('0x69')]=qs['sort'](_0x2022d8[_0x1819('0x45')][_0x1819('0x4e')]);_0x4512a6[_0x1819('0x4f')]=qs[_0x1819('0x47')](_[_0x1819('0x6a')](_0x2022d8[_0x1819('0x45')],_0x38d844[_0x1819('0x47')]));_0x4512a6[_0x1819('0x4f')]['FaxAccountId']=_0x9537cc['id'];if(_0x2022d8[_0x1819('0x45')]['filter']){_0x4512a6[_0x1819('0x4f')]=_['merge'](_0x4512a6['where'],{'$or':_['map'](_0x4512a6[_0x1819('0x48')],function(_0x3d5406){var _0x7c7fe3={};_0x7c7fe3[_0x3d5406]={'$like':'%'+_0x2022d8[_0x1819('0x45')]['filter']+'%'};return _0x7c7fe3;})});}_0x4512a6=_['merge']({},_0x4512a6,_0x2022d8[_0x1819('0x52')]);return db['CannedAnswer'][_0x1819('0x32')]({'where':_0x4512a6[_0x1819('0x4f')]})['then'](function(_0x269d65){_0x49f9a6['count']=_0x269d65;if(_0x2022d8['query'][_0x1819('0x53')]){_0x4512a6[_0x1819('0x54')]=[{'all':!![]}];}return db[_0x1819('0x6d')]['findAll'](_0x4512a6);})['then'](function(_0x3061e8){_0x49f9a6['rows']=_0x3061e8;return _0x49f9a6;});}})['then'](respondWithFilteredResult(_0x2dce88,_0x4512a6))['catch'](handleError(_0x2dce88,null));};exports[_0x1819('0x6e')]=function(_0x2bf642,_0x5fafc,_0x433b53){return db['FaxAccount'][_0x1819('0x62')]({'where':{'id':_0x2bf642['params']['id']}})[_0x1819('0x56')](handleEntityNotFound(_0x5fafc,null))[_0x1819('0x56')](function(_0x369683){if(_0x369683){return _0x369683[_0x1819('0x6e')](_0x2bf642[_0x1819('0x45')][_0x1819('0x6f')]);}})[_0x1819('0x56')](respondWithStatusCode(_0x5fafc,null))[_0x1819('0x2a')](handleError(_0x5fafc,null));};exports[_0x1819('0x70')]=function(_0x4fceb0,_0x33866a,_0x4ab0cc){return db[_0x1819('0x71')][_0x1819('0x62')]({'where':{'id':_0x4fceb0[_0x1819('0x63')]['id']}})['then'](handleEntityNotFound(_0x33866a,null))[_0x1819('0x56')](function(_0x14934d){if(_0x14934d){return _0x14934d['addInteraction'](_0x4fceb0['body']['ids'],_[_0x1819('0x72')](_0x4fceb0[_0x1819('0x5a')],[_0x1819('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x33866a,null))[_0x1819('0x2a')](handleError(_0x33866a,null));};exports['getInteractions']=function(_0x215a9b,_0x35efa2,_0x5598aa){var _0x354ab8={'raw':![],'where':{}};var _0x3664b7={};var _0x5db242={'count':0x0,'rows':[]};return db['FaxAccount'][_0x1819('0x68')]({'where':{'id':_0x215a9b[_0x1819('0x63')]['id']}})[_0x1819('0x56')](handleEntityNotFound(_0x35efa2,null))[_0x1819('0x56')](function(_0x3ba02c){if(_0x3ba02c){_0x3664b7[_0x1819('0x44')]=_[_0x1819('0x46')](db[_0x1819('0x71')][_0x1819('0x40')]);_0x3664b7[_0x1819('0x45')]=_[_0x1819('0x46')](_0x215a9b['query']);_0x3664b7[_0x1819('0x47')]=_['intersection'](_0x3664b7[_0x1819('0x44')],_0x3664b7['query']);_0x354ab8[_0x1819('0x48')]=_[_0x1819('0x49')](_0x3664b7['model'],qs['fields'](_0x215a9b[_0x1819('0x45')]['fields']));_0x354ab8[_0x1819('0x48')]=_0x354ab8[_0x1819('0x48')][_0x1819('0x4b')]?_0x354ab8[_0x1819('0x48')]:_0x3664b7[_0x1819('0x44')];if(!_0x215a9b['query']['hasOwnProperty'](_0x1819('0x4d'))){_0x354ab8[_0x1819('0x30')]=qs[_0x1819('0x30')](_0x215a9b[_0x1819('0x45')]['limit']);_0x354ab8[_0x1819('0x2f')]=qs[_0x1819('0x2f')](_0x215a9b[_0x1819('0x45')][_0x1819('0x2f')]);}_0x354ab8[_0x1819('0x69')]=qs[_0x1819('0x4e')](_0x215a9b['query']['sort']);_0x354ab8[_0x1819('0x4f')]=qs[_0x1819('0x47')](_['pick'](_0x215a9b['query'],_0x3664b7['filters']));_0x354ab8['where'][_0x1819('0x66')]=_0x3ba02c['id'];if(_0x215a9b[_0x1819('0x45')][_0x1819('0x51')]){_0x354ab8[_0x1819('0x4f')]=_[_0x1819('0x58')](_0x354ab8['where'],{'$or':_['map'](_0x354ab8[_0x1819('0x48')],function(_0x282c9f){var _0x3dbf2e={};_0x3dbf2e[_0x282c9f]={'$like':'%'+_0x215a9b[_0x1819('0x45')]['filter']+'%'};return _0x3dbf2e;})});}_0x354ab8=_[_0x1819('0x58')]({},_0x354ab8,_0x215a9b[_0x1819('0x52')]);return db[_0x1819('0x71')][_0x1819('0x32')]({'where':_0x354ab8[_0x1819('0x4f')]})[_0x1819('0x56')](function(_0x394ec3){_0x5db242['count']=_0x394ec3;if(_0x215a9b[_0x1819('0x45')][_0x1819('0x53')]){_0x354ab8[_0x1819('0x54')]=[{'model':db['CmContact'],'as':_0x1819('0x73'),'required':![]},{'model':db[_0x1819('0x74')],'as':_0x1819('0x75'),'attributes':[_0x1819('0x3a'),'fullname',_0x1819('0x76')],'required':![]},{'model':db[_0x1819('0x77')],'as':_0x1819('0x78'),'attributes':['id',_0x1819('0x3a'),'color'],'where':_0x215a9b[_0x1819('0x45')]['tag']?{'id':_0x215a9b['query'][_0x1819('0x79')]}:undefined,'required':_0x215a9b[_0x1819('0x45')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x1819('0x55')](_0x354ab8);})[_0x1819('0x56')](function(_0xee64a2){_0x5db242['rows']=_0xee64a2;return _0x5db242;});}})['then'](respondWithFilteredResult(_0x35efa2,_0x354ab8))[_0x1819('0x2a')](handleError(_0x35efa2,null));};exports[_0x1819('0x7a')]=function(_0x58492c,_0x3d03c6,_0x47b59){return db['FaxAccount'][_0x1819('0x68')]({'where':{'id':_0x58492c['params']['id']}})[_0x1819('0x56')](handleEntityNotFound(_0x3d03c6,null))[_0x1819('0x56')](function(_0x4385e6){if(_0x4385e6){return db[_0x1819('0x7b')][_0x1819('0x7c')](function(_0x5d3711){return db[_0x1819('0x7d')]['destroy']({'where':{'FaxAccountId':_0x58492c[_0x1819('0x63')]['id']},'transaction':_0x5d3711})['then'](function(_0x203c23){var _0x4b0c92=_[_0x1819('0x3e')](_0x58492c['body'],function(_0x24ea8a){_0x24ea8a['FaxAccountId']=_0x58492c[_0x1819('0x63')]['id'];return _0x24ea8a;});return db[_0x1819('0x7d')]['bulkCreate'](_0x4b0c92,{'transaction':_0x5d3711});});})[_0x1819('0x56')](function(){return db['FaxApplication'][_0x1819('0x7e')]({'where':{'FaxAccountId':_0x58492c[_0x1819('0x63')]['id']},'order':_0x1819('0x7f')});});}})['then'](respondWithResult(_0x3d03c6,null))[_0x1819('0x2a')](handleError(_0x3d03c6,null));};exports['getApplications']=function(_0x1625e6,_0x2a048d,_0x3761d6){var _0x2ec424={};var _0x6da813={};var _0x574c8c;var _0x52e485;return db[_0x1819('0x3f')][_0x1819('0x68')]({'where':{'id':_0x1625e6[_0x1819('0x63')]['id']}})['then'](handleEntityNotFound(_0x2a048d,null))[_0x1819('0x56')](function(_0x4be5f2){if(_0x4be5f2){_0x574c8c=_0x4be5f2;_0x6da813[_0x1819('0x44')]=_[_0x1819('0x46')](db[_0x1819('0x7d')][_0x1819('0x40')]);_0x6da813['query']=_[_0x1819('0x46')](_0x1625e6['query']);_0x6da813[_0x1819('0x47')]=_[_0x1819('0x49')](_0x6da813['model'],_0x6da813[_0x1819('0x45')]);_0x2ec424['attributes']=_[_0x1819('0x49')](_0x6da813[_0x1819('0x44')],qs['fields'](_0x1625e6[_0x1819('0x45')]['fields']));_0x2ec424[_0x1819('0x48')]=_0x2ec424[_0x1819('0x48')][_0x1819('0x4b')]?_0x2ec424['attributes']:_0x6da813[_0x1819('0x44')];_0x2ec424[_0x1819('0x69')]=qs['sort'](_0x1625e6[_0x1819('0x45')][_0x1819('0x4e')]);_0x2ec424[_0x1819('0x4f')]=qs[_0x1819('0x47')](_[_0x1819('0x6a')](_0x1625e6[_0x1819('0x45')],_0x6da813[_0x1819('0x47')]));if(_0x1625e6[_0x1819('0x45')]['filter']){_0x2ec424['where']=_[_0x1819('0x58')](_0x2ec424[_0x1819('0x4f')],{'$or':_[_0x1819('0x3e')](_0x2ec424[_0x1819('0x48')],function(_0x2b3ecd){var _0x76206d={};_0x76206d[_0x2b3ecd]={'$like':'%'+_0x1625e6[_0x1819('0x45')][_0x1819('0x51')]+'%'};return _0x76206d;})});}_0x2ec424=_[_0x1819('0x58')]({},_0x2ec424,_0x1625e6[_0x1819('0x52')]);return _0x574c8c[_0x1819('0x80')](_0x2ec424);}})['then'](function(_0xdaf4ce){if(_0xdaf4ce){_0x52e485=_0xdaf4ce[_0x1819('0x4b')];if(!_0x1625e6[_0x1819('0x45')][_0x1819('0x4c')](_0x1819('0x4d'))){_0x2ec424['limit']=qs[_0x1819('0x30')](_0x1625e6['query'][_0x1819('0x30')]);_0x2ec424[_0x1819('0x2f')]=qs[_0x1819('0x2f')](_0x1625e6['query'][_0x1819('0x2f')]);}return _0x574c8c[_0x1819('0x80')](_0x2ec424);}})[_0x1819('0x56')](function(_0x1df6f0){if(_0x1df6f0){return _0x1df6f0?{'count':_0x52e485,'rows':_0x1df6f0}:null;}})[_0x1819('0x56')](respondWithResult(_0x2a048d,null))['catch'](handleError(_0x2a048d,null));};function Extension(_0x3c5a4e,_0xeb3a28,_0x75f3dd,_0x694cbb){this[_0x1819('0x81')]=_0x1819('0x82');this[_0x1819('0x83')]=_0x3c5a4e[_0x1819('0x84')];this[_0x1819('0x85')]=_0x694cbb;this[_0x1819('0x42')]=_0x1819('0x86');this['description']=_0x1819('0x87');this[_0x1819('0x66')]=_0x3c5a4e['id'];this['priority']=_0xeb3a28;this[_0x1819('0x88')]=_0x75f3dd;}function createExtensionsReciveFax(_0x39dbcb){var _0x1fbda0=0x1;var _0x199bf5=[];_0x199bf5[_0x1819('0x89')](new Extension(_0x39dbcb,_0x1fbda0,'','Answer'));_0x1fbda0+=0x1;_0x199bf5['push'](new Extension(_0x39dbcb,_0x1fbda0,_0x1819('0x8a'),_0x1819('0x8b')));_0x1fbda0+=0x1;for(var _0x1320f0 in _0x39dbcb){if(_0x39dbcb[_0x1819('0x4c')](_0x1320f0)&&(_0x1320f0===_0x1819('0x8c')||_0x1320f0===_0x1819('0x84')||_0x1320f0==='gateway'||_0x1320f0===_0x1819('0x8d')||_0x1320f0===_0x1819('0x8e')||_0x1320f0==='maxrate'||_0x1320f0==='minrate'||_0x1320f0==='modem'||_0x1320f0===_0x1819('0x8f'))){_0x199bf5[_0x1819('0x89')](new Extension(_0x39dbcb,_0x1fbda0,_0x1819('0x90')+_0x1320f0+')='+_0x39dbcb[_0x1320f0],_0x1819('0x8b')));_0x1fbda0+=0x1;}}_0x199bf5[_0x1819('0x89')](new Extension(_0x39dbcb,_0x1fbda0,'6',_0x1819('0x91')));_0x1fbda0+=0x1;_0x199bf5[_0x1819('0x89')](new Extension(_0x39dbcb,_0x1fbda0,_0x1819('0x92'),_0x1819('0x93')));_0x1fbda0=0x0;return _0x199bf5;}exports[_0x1819('0x94')]=function(_0x1f6508,_0x8fc32e,_0x4e5101){var _0x41ddee;return db[_0x1819('0x7b')][_0x1819('0x7c')](function(_0xcf65de){return db[_0x1819('0x3f')][_0x1819('0x59')](_0x1f6508[_0x1819('0x5a')],{'transaction':_0xcf65de})[_0x1819('0x56')](function(_0x481ca8){_0x41ddee=_0x481ca8['get']({'plain':!![]});return db[_0x1819('0x95')][_0x1819('0x96')](createExtensionsReciveFax(_0x41ddee),{'transaction':_0xcf65de});});})[_0x1819('0x56')](function(){return _0x41ddee;})[_0x1819('0x56')](respondWithResult(_0x8fc32e,null))[_0x1819('0x2a')](handleError(_0x8fc32e,null));};exports[_0x1819('0x97')]=function(_0x8fc1c,_0x1ee840,_0x711424){var _0x48b178;return db[_0x1819('0x7b')][_0x1819('0x7c')](function(_0x2cf189){return db['FaxAccount'][_0x1819('0x61')](_0x8fc1c['body'],{'where':{'id':_0x8fc1c[_0x1819('0x5a')]['id']},'transaction':_0x2cf189})['then'](function(_0xbfd660){return db[_0x1819('0x95')]['destroy']({'where':{'FaxAccountId':_0x8fc1c[_0x1819('0x5a')]['id']},'transaction':_0x2cf189})[_0x1819('0x56')](function(_0x33cdc4){return db[_0x1819('0x95')][_0x1819('0x96')](createExtensionsReciveFax(_['omit'](_0x8fc1c[_0x1819('0x5a')],[_0x1819('0x98'),_0x1819('0x43'),_0x1819('0x99'),_0x1819('0x9a'),_0x1819('0x9b'),_0x1819('0x9c')])),{'transaction':_0x2cf189});});});})[_0x1819('0x56')](function(){return db[_0x1819('0x3f')][_0x1819('0x9d')](_0x8fc1c[_0x1819('0x5a')]['id']);})['then'](respondWithResult(_0x1ee840,null))['catch'](handleError(_0x1ee840,null));};exports['getMessages']=function(_0x58a6c2,_0x1b9dd6,_0xd226c8){var _0x5c4b85={'raw':!![],'where':{}};var _0x3b58b8={};var _0x108bba={'count':0x0,'rows':[]};return db[_0x1819('0x3f')][_0x1819('0x68')]({'where':{'id':_0x58a6c2[_0x1819('0x63')]['id']}})[_0x1819('0x56')](handleEntityNotFound(_0x1b9dd6,null))['then'](function(_0x3f381c){if(_0x3f381c){_0x3b58b8[_0x1819('0x44')]=_[_0x1819('0x46')](db['FaxMessage'][_0x1819('0x40')]);_0x3b58b8[_0x1819('0x45')]=_[_0x1819('0x46')](_0x58a6c2[_0x1819('0x45')]);_0x3b58b8[_0x1819('0x47')]=_[_0x1819('0x49')](_0x3b58b8[_0x1819('0x44')],_0x3b58b8[_0x1819('0x45')]);_0x5c4b85[_0x1819('0x48')]=_[_0x1819('0x49')](_0x3b58b8[_0x1819('0x44')],qs[_0x1819('0x4a')](_0x58a6c2['query'][_0x1819('0x4a')]));_0x5c4b85['attributes']=_0x5c4b85['attributes']['length']?_0x5c4b85[_0x1819('0x48')]:_0x3b58b8['model'];if(!_0x58a6c2['query'][_0x1819('0x4c')](_0x1819('0x4d'))){_0x5c4b85[_0x1819('0x30')]=qs[_0x1819('0x30')](_0x58a6c2[_0x1819('0x45')][_0x1819('0x30')]);_0x5c4b85[_0x1819('0x2f')]=qs['offset'](_0x58a6c2['query']['offset']);}_0x5c4b85[_0x1819('0x69')]=qs[_0x1819('0x4e')](_0x58a6c2['query']['sort']);_0x5c4b85[_0x1819('0x4f')]=qs[_0x1819('0x47')](_[_0x1819('0x6a')](_0x58a6c2['query'],_0x3b58b8[_0x1819('0x47')]));_0x5c4b85[_0x1819('0x4f')][_0x1819('0x66')]=_0x3f381c['id'];if(_0x58a6c2['query']['filter']){_0x5c4b85[_0x1819('0x4f')]=_[_0x1819('0x58')](_0x5c4b85[_0x1819('0x4f')],{'$or':_[_0x1819('0x3e')](_0x5c4b85[_0x1819('0x48')],function(_0x207d5b){var _0x340a4b={};_0x340a4b[_0x207d5b]={'$like':'%'+_0x58a6c2[_0x1819('0x45')][_0x1819('0x51')]+'%'};return _0x340a4b;})});}if(_0x58a6c2[_0x1819('0x45')][_0x1819('0x9e')]){var _0x185455=_0x58a6c2[_0x1819('0x45')][_0x1819('0x9e')][_0x1819('0x9f')](',');var _0x147b34={};_0x147b34[_0x185455[0x0]]={'$gte':moment(_0x185455[0x1])[_0x1819('0xa0')](_0x1819('0xa1'))};_0x5c4b85[_0x1819('0x4f')]=_['merge'](_0x5c4b85[_0x1819('0x4f')],_0x147b34);}_0x5c4b85=_['merge']({},_0x5c4b85,_0x58a6c2[_0x1819('0x52')]);return db[_0x1819('0xa2')][_0x1819('0x32')]({'where':_0x5c4b85[_0x1819('0x4f')]})['then'](function(_0xd4fb54){_0x108bba[_0x1819('0x32')]=_0xd4fb54;if(_0x58a6c2[_0x1819('0x45')][_0x1819('0x53')]){_0x5c4b85[_0x1819('0x54')]=[{'all':!![]}];}return db[_0x1819('0xa2')][_0x1819('0x55')](_0x5c4b85);})['then'](function(_0x33f06e){_0x108bba[_0x1819('0x57')]=_0x33f06e;return _0x108bba;});}})[_0x1819('0x56')](respondWithFilteredResult(_0x1b9dd6,_0x5c4b85))[_0x1819('0x2a')](handleError(_0x1b9dd6,null));};exports[_0x1819('0xa3')]=function(_0x26d4e9,_0x2bd4bf,_0x241e20){var _0x476d13,_0xeb1ef3={},_0x3d439c;if(_0x26d4e9[_0x1819('0x5a')]['to']){_0x3d439c=_0x26d4e9[_0x1819('0x5a')]['to'][0x0];}return db['FaxAccount'][_0x1819('0x62')]({'where':{'id':_0x26d4e9[_0x1819('0x63')]['id']},'include':[{'model':db[_0x1819('0xa4')],'as':_0x1819('0xa5'),'include':[{'model':db[_0x1819('0xa6')],'as':_0x1819('0xa7'),'where':{'fax':_0x3d439c},'limit':0x1,'order':[[_0x1819('0x9a'),'DESC']]}]}]})[_0x1819('0x56')](handleEntityNotFound(_0x2bd4bf,null))[_0x1819('0x56')](function(_0x121569){_0x476d13=_0x121569;if(_0x26d4e9[_0x1819('0x5a')][_0x1819('0xa8')]&&_0x26d4e9[_0x1819('0x5a')]['attachments'][_0x1819('0x4b')]){for(var _0x402f8a=0x0;_0x402f8a<_0x26d4e9[_0x1819('0x5a')]['attachments'][_0x1819('0x4b')];_0x402f8a+=0x1){_0x26d4e9[_0x1819('0x5a')][_0x1819('0xa8')][_0x402f8a]={'filename':_0x26d4e9[_0x1819('0x5a')][_0x1819('0xa8')][_0x402f8a]['name'],'id':_0x26d4e9['body'][_0x1819('0xa8')][_0x402f8a]['id'],'path':path[_0x1819('0xa9')](config[_0x1819('0xaa')],'server/files/attachments',_0x26d4e9[_0x1819('0x5a')][_0x1819('0xa8')][_0x402f8a][_0x1819('0xab')])};}}return respondWithRpcPromise('CheckAfterSend',_0x1819('0xac'),{'FaxAccountId':_[_0x1819('0xad')](_0x26d4e9[_0x1819('0x63')]['id'])?undefined:_0x26d4e9['params']['id'],'path':_[_0x1819('0xad')](_0x26d4e9['body']['attachments'][0x0]['path'])?undefined:_0x26d4e9[_0x1819('0x5a')][_0x1819('0xa8')][0x0][_0x1819('0xae')],'fax':_[_0x1819('0xad')](_0x26d4e9[_0x1819('0x5a')]['to'][0x0])?undefined:_0x26d4e9[_0x1819('0x5a')]['to'][0x0]},client9002);})['then'](function(){if(_0x476d13){if(_[_0x1819('0xad')](_0x26d4e9[_0x1819('0x5a')]['from'])){_0x26d4e9[_0x1819('0x5a')][_0x1819('0xaf')]=util[_0x1819('0xa0')](_0x1819('0xb0'),_0x476d13[_0x1819('0x3a')],_0x476d13[_0x1819('0xb1')]);}if(_0x476d13[_0x1819('0xa5')]){if(_0x476d13[_0x1819('0xa5')][_0x1819('0xa7')][_0x1819('0x4b')]){return _0x476d13[_0x1819('0xa5')]['Contacts'][0x0];}else{return db['CmContact'][_0x1819('0x59')](_[_0x1819('0x19')](_0x26d4e9[_0x1819('0x5a')],{'firstName':_0x26d4e9[_0x1819('0x5a')]['to'][0x0],'phone':_0x26d4e9['body']['to'][0x0],'fax':_0x26d4e9[_0x1819('0x5a')]['to'][0x0],'ListId':_0x476d13[_0x1819('0x9c')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x1819('0xb2'));}})['then'](function(_0x2d4376){if(_0x2d4376){return db[_0x1819('0x71')]['find']({'where':{'ContactId':_0x2d4376['id'],'closed':![],'FaxAccountId':_0x476d13['id']}})[_0x1819('0x56')](function(_0x230bd5){if(_0x230bd5){return[_0x230bd5,![]];}return db[_0x1819('0x71')][_0x1819('0x59')]({'UserId':_0x26d4e9[_0x1819('0x5b')]['id'],'ContactId':_0x2d4376['id'],'FaxAccountId':_0x476d13['id'],'fax':_0x26d4e9[_0x1819('0x5a')]['to'][0x0],'firstMsgDirection':_0x1819('0xb3'),'Messages':[_[_0x1819('0x58')](_0x26d4e9['body'],{'read':![],'body':_0x26d4e9[_0x1819('0x5a')][_0x1819('0xa8')][0x0][_0x1819('0xb4')],'FaxAccountId':_0x476d13['id'],'UserId':_0x26d4e9[_0x1819('0x5b')]['id'],'ContactId':_0x2d4376['id'],'AttachmentId':_0x26d4e9['body'][_0x1819('0xa8')][0x0]['id']})]},{'include':[{'model':db[_0x1819('0xa2')],'as':'Messages'}]})[_0x1819('0x56')](function(_0x55be97){return[_0x55be97,!![]];});});}else{throw new Error(_0x1819('0xb5'));}})['spread'](function(_0x584326,_0x4083bc){if(_0x4083bc){return _0x584326;}return db[_0x1819('0xa2')]['create']({'direction':'out','read':![],'body':_0x26d4e9[_0x1819('0x5a')][_0x1819('0xa8')][0x0][_0x1819('0xb4')],'FaxAccountId':_0x476d13['id'],'FaxInteractionId':_0x584326['id'],'UserId':_0x26d4e9[_0x1819('0x5b')]['id'],'ContactId':_0x584326[_0x1819('0xb6')],'AttachmentId':_0x26d4e9[_0x1819('0x5a')][_0x1819('0xa8')][0x0]['id']})[_0x1819('0x56')](function(_0x2d8ee3){_0x584326[_0x1819('0xb7')]['Messages']=[];_0x584326['dataValues'][_0x1819('0xb8')]['push'](_0x2d8ee3[_0x1819('0xb7')]);return _0x584326;});})[_0x1819('0x56')](function(_0x451b78){respondWithRpcPromise(_0x1819('0xb9'),_0x1819('0xb9'),{'FaxAccountId':_['isNil'](_0x26d4e9[_0x1819('0x63')]['id'])?undefined:_0x26d4e9['params']['id'],'path':_[_0x1819('0xad')](_0x26d4e9[_0x1819('0x5a')][_0x1819('0xa8')][0x0]['path'])?undefined:_0x26d4e9['body'][_0x1819('0xa8')][0x0]['path'],'fax':_[_0x1819('0xad')](_0x26d4e9[_0x1819('0x5a')]['to'][0x0])?undefined:_0x26d4e9[_0x1819('0x5a')]['to'][0x0],'AttachmentId':_0x26d4e9[_0x1819('0x5a')][_0x1819('0xa8')][0x0]['id']},client9002)[_0x1819('0x56')](function(_0x15b52c){logger[_0x1819('0x21')](_0x1819('0xba'),_0x15b52c);})[_0x1819('0x2a')](function(_0x26427e){logger[_0x1819('0x21')](_0x1819('0xba'),_0x26427e);});return _0x451b78;})[_0x1819('0x56')](respondWithResult(_0x2bd4bf,null))[_0x1819('0x2a')](handleError(_0x2bd4bf,null));};exports[_0x1819('0xbb')]=function(_0x3e6414,_0x3beb01,_0x5e6968){return db[_0x1819('0x3f')][_0x1819('0x62')]({'where':{'id':_0x3e6414[_0x1819('0x63')]['id']}})['then'](handleEntityNotFound(_0x3beb01,null))[_0x1819('0x56')](function(_0x453d72){if(_0x453d72){return _0x453d72['addAgents'](_0x3e6414[_0x1819('0x5a')]['ids'],_[_0x1819('0x72')](_0x3e6414[_0x1819('0x5a')],['ids','id'])||{})[_0x1819('0xbc')](function(_0x1dec41){for(var _0x2cdf27=0x0;_0x2cdf27<_0x3e6414['body'][_0x1819('0x6f')][_0x1819('0x4b')];_0x2cdf27+=0x1){socket[_0x1819('0xbd')](_0x1819('0xbe'),{'UserId':Number(_0x3e6414[_0x1819('0x5a')][_0x1819('0x6f')][_0x2cdf27]),'FaxAccountId':Number(_0x3e6414[_0x1819('0x63')]['id'])});}return _0x1dec41;});}})['then'](respondWithResult(_0x3beb01,null))[_0x1819('0x2a')](handleError(_0x3beb01,null));};exports['removeAgents']=function(_0x2f11d7,_0x533a56,_0x1175fa){return db[_0x1819('0x3f')][_0x1819('0x62')]({'where':{'id':_0x2f11d7[_0x1819('0x63')]['id']}})[_0x1819('0x56')](handleEntityNotFound(_0x533a56,null))[_0x1819('0x56')](function(_0x2ea7a9){if(_0x2ea7a9){return _0x2ea7a9[_0x1819('0xbf')](_0x2f11d7[_0x1819('0x45')][_0x1819('0x6f')])[_0x1819('0x56')](function(){if(_[_0x1819('0xc0')](_0x2f11d7[_0x1819('0x45')][_0x1819('0x6f')])){for(var _0x3ee22b=0x0;_0x3ee22b<_0x2f11d7[_0x1819('0x45')][_0x1819('0x6f')][_0x1819('0x4b')];_0x3ee22b+=0x1){socket[_0x1819('0xbd')](_0x1819('0xc1'),{'UserId':Number(_0x2f11d7[_0x1819('0x45')]['ids'][_0x3ee22b]),'FaxAccountId':Number(_0x2f11d7['params']['id'])});}}else{socket[_0x1819('0xbd')]('userFaxAccount:remove',{'UserId':Number(_0x2f11d7[_0x1819('0x45')][_0x1819('0x6f')]),'FaxAccountId':Number(_0x2f11d7[_0x1819('0x63')]['id'])});}});}})['then'](respondWithStatusCode(_0x533a56,null))['catch'](handleError(_0x533a56,null));};exports[_0x1819('0xc2')]=function(_0x149fe1,_0x35d49d,_0x25fd7e){var _0x77fbc3={};var _0x2636af={};var _0x87cf83;var _0x5e6de6;return db[_0x1819('0x3f')][_0x1819('0x68')]({'where':{'id':_0x149fe1[_0x1819('0x63')]['id']}})[_0x1819('0x56')](handleEntityNotFound(_0x35d49d,null))[_0x1819('0x56')](function(_0x267da9){if(_0x267da9){_0x87cf83=_0x267da9;_0x2636af[_0x1819('0x44')]=_[_0x1819('0x46')](db[_0x1819('0x74')][_0x1819('0x40')]);_0x2636af[_0x1819('0x45')]=_[_0x1819('0x46')](_0x149fe1[_0x1819('0x45')]);_0x2636af[_0x1819('0x47')]=_['intersection'](_0x2636af[_0x1819('0x44')],_0x2636af['query']);_0x77fbc3[_0x1819('0x48')]=_['intersection'](_0x2636af[_0x1819('0x44')],qs[_0x1819('0x4a')](_0x149fe1[_0x1819('0x45')]['fields']));_0x77fbc3[_0x1819('0x48')]=_0x77fbc3[_0x1819('0x48')][_0x1819('0x4b')]?_0x77fbc3[_0x1819('0x48')]:_0x2636af[_0x1819('0x44')];_0x77fbc3[_0x1819('0x69')]=qs[_0x1819('0x4e')](_0x149fe1[_0x1819('0x45')]['sort']);_0x77fbc3[_0x1819('0x4f')]=qs[_0x1819('0x47')](_[_0x1819('0x6a')](_0x149fe1[_0x1819('0x45')],_0x2636af[_0x1819('0x47')]));if(_0x149fe1['query']['filter']){_0x77fbc3[_0x1819('0x4f')]=_[_0x1819('0x58')](_0x77fbc3['where'],{'$or':_[_0x1819('0x3e')](_0x77fbc3[_0x1819('0x48')],function(_0x23c6de){var _0x4df72b={};_0x4df72b[_0x23c6de]={'$like':'%'+_0x149fe1[_0x1819('0x45')][_0x1819('0x51')]+'%'};return _0x4df72b;})});}_0x77fbc3=_[_0x1819('0x58')]({},_0x77fbc3,_0x149fe1['options']);return _0x87cf83[_0x1819('0xc2')](_0x77fbc3);}})[_0x1819('0x56')](function(_0xc7f39a){if(_0xc7f39a){_0x5e6de6=_0xc7f39a['length'];if(!_0x149fe1[_0x1819('0x45')][_0x1819('0x4c')](_0x1819('0x4d'))){_0x77fbc3[_0x1819('0x30')]=qs[_0x1819('0x30')](_0x149fe1[_0x1819('0x45')][_0x1819('0x30')]);_0x77fbc3[_0x1819('0x2f')]=qs['offset'](_0x149fe1[_0x1819('0x45')][_0x1819('0x2f')]);}return _0x87cf83[_0x1819('0xc2')](_0x77fbc3);}})[_0x1819('0x56')](function(_0x112a20){if(_0x112a20){return _0x112a20?{'count':_0x5e6de6,'rows':_0x112a20}:null;}})[_0x1819('0x56')](respondWithResult(_0x35d49d,null))[_0x1819('0x2a')](handleError(_0x35d49d,null));};
\ No newline at end of file
+var _0x371d=['CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','out','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','sendStatus','status','json','limit','count','offset','set','Content-Range','apply','reject','save','destroy','get','FaxAccounts','end','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','update','describe','FaxAccountId','Disposition','getDispositions','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','getInteractions','findOne','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','bulkCreate','priority','getApplications','context','from-voip-provider','app','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','ecm','localstationid','faxdetect','headerinfo','maxrate','minrate','t38timeout','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','VoiceExtension','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','send','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename'];(function(_0x8567ae,_0x118fcf){var _0x2f9e9b=function(_0x7bef6f){while(--_0x7bef6f){_0x8567ae['push'](_0x8567ae['shift']());}};_0x2f9e9b(++_0x118fcf);}(_0x371d,0xd4));var _0xd371=function(_0x24fcec,_0x14a697){_0x24fcec=_0x24fcec-0x0;var _0x5533d3=_0x371d[_0x24fcec];return _0x5533d3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd371('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd371('0x1'));var rp=require(_0xd371('0x2'));var moment=require(_0xd371('0x3'));var BPromise=require(_0xd371('0x4'));var Mustache=require(_0xd371('0x5'));var util=require(_0xd371('0x6'));var path=require(_0xd371('0x7'));var sox=require(_0xd371('0x8'));var csv=require('to-csv');var ejs=require(_0xd371('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd371('0xa'));var squel=require(_0xd371('0xb'));var crypto=require('crypto');var jsforce=require(_0xd371('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd371('0xd'));var Papa=require(_0xd371('0xe'));var Redis=require(_0xd371('0xf'));var authService=require(_0xd371('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd371('0x11'));var hardwareService=require(_0xd371('0x12'));var logger=require(_0xd371('0x13'))(_0xd371('0x14'));var utils=require(_0xd371('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd371('0x16'));var db=require(_0xd371('0x17'))['db'];config[_0xd371('0x18')]=_[_0xd371('0x19')](config['redis'],{'host':_0xd371('0x1a'),'port':0x18eb});var socket=require(_0xd371('0x1b'))(new Redis(config[_0xd371('0x18')]));require(_0xd371('0x1c'))[_0xd371('0x1d')](socket);var jayson=require(_0xd371('0x1e'));var client=jayson[_0xd371('0x1f')][_0xd371('0x20')]({'port':0x232c});var client9002=jayson[_0xd371('0x1f')][_0xd371('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x47fa17,_0x244f7b,_0x12ae86,_0x32ada9){return new BPromise(function(_0x44c615,_0x5561b4){var _0x41f97c=_0x32ada9||client;return _0x41f97c[_0xd371('0x21')](_0x47fa17,_0x12ae86)[_0xd371('0x22')](function(_0x482aba){logger[_0xd371('0x23')]('FaxAccount,\x20%s,\x20%s',_0x244f7b,'request\x20sent');logger[_0xd371('0x24')](_0xd371('0x25'),_0x244f7b,_0xd371('0x26'),JSON[_0xd371('0x27')](_0x482aba));if(_0x482aba[_0xd371('0x28')]){if(_0x482aba[_0xd371('0x28')][_0xd371('0x29')]===0x1f4){logger['error'](_0xd371('0x2a'),_0x244f7b,_0x482aba[_0xd371('0x28')][_0xd371('0x2b')]);return _0x5561b4(_0x482aba[_0xd371('0x28')][_0xd371('0x2b')]);}logger[_0xd371('0x28')](_0xd371('0x2a'),_0x244f7b,_0x482aba[_0xd371('0x28')][_0xd371('0x2b')]);return _0x44c615(_0x482aba['error']['message']);}else{logger[_0xd371('0x23')](_0xd371('0x2a'),_0x244f7b,_0xd371('0x26'));_0x44c615(_0x482aba['result'][_0xd371('0x2b')]);}})['catch'](function(_0x4d0d8b){logger[_0xd371('0x28')](_0xd371('0x2a'),_0x244f7b,_0x4d0d8b);_0x5561b4(_0x4d0d8b);});});}function respondWithStatusCode(_0x3109c4,_0x499b3d){_0x499b3d=_0x499b3d||0xcc;return function(_0x4e0702){if(_0x4e0702){return _0x3109c4[_0xd371('0x2c')](_0x499b3d);}return _0x3109c4[_0xd371('0x2d')](_0x499b3d)['end']();};}function respondWithResult(_0x528ac4,_0x4a9228){_0x4a9228=_0x4a9228||0xc8;return function(_0x119a7b){if(_0x119a7b){return _0x528ac4[_0xd371('0x2d')](_0x4a9228)[_0xd371('0x2e')](_0x119a7b);}};}function respondWithFilteredResult(_0x4cce43,_0x5a556e){return function(_0x1e1d72){if(_0x1e1d72){var _0x30820f=typeof _0x5a556e['offset']==='undefined'&&typeof _0x5a556e[_0xd371('0x2f')]==='undefined';var _0x18036e=_0x1e1d72[_0xd371('0x30')];var _0x5342d3=_0x30820f?0x0:_0x5a556e[_0xd371('0x31')];var _0xb2f239=_0x30820f?_0x1e1d72[_0xd371('0x30')]:_0x5a556e[_0xd371('0x31')]+_0x5a556e[_0xd371('0x2f')];var _0x59dd87;if(_0xb2f239>=_0x18036e){_0xb2f239=_0x18036e;_0x59dd87=0xc8;}else{_0x59dd87=0xce;}_0x4cce43[_0xd371('0x2d')](_0x59dd87);return _0x4cce43[_0xd371('0x32')](_0xd371('0x33'),_0x5342d3+'-'+_0xb2f239+'/'+_0x18036e)[_0xd371('0x2e')](_0x1e1d72);}return null;};}function patchUpdates(_0x2ac6cb){return function(_0x30b769){try{jsonpatch[_0xd371('0x34')](_0x30b769,_0x2ac6cb,!![]);}catch(_0x32da93){return BPromise[_0xd371('0x35')](_0x32da93);}return _0x30b769[_0xd371('0x36')]();};}function saveUpdates(_0x246909,_0x48c734){return function(_0x523603){if(_0x523603){return _0x523603['update'](_0x246909)[_0xd371('0x22')](function(_0x30fad7){return _0x30fad7;});}return null;};}function removeEntity(_0x226868,_0x20ad9d){return function(_0x476b75){if(_0x476b75){return _0x476b75[_0xd371('0x37')]()[_0xd371('0x22')](function(){var _0x7bddb4=_0x476b75[_0xd371('0x38')]({'plain':!![]});var _0x279b0f=_0xd371('0x39');return db['UserProfileResource'][_0xd371('0x37')]({'where':{'type':_0x279b0f,'resourceId':_0x7bddb4['id']}})[_0xd371('0x22')](function(){return _0x476b75;});})[_0xd371('0x22')](function(){_0x226868[_0xd371('0x2d')](0xcc)[_0xd371('0x3a')]();});}};}function handleEntityNotFound(_0x49d9f2,_0x33d086){return function(_0x3f8ce8){if(!_0x3f8ce8){_0x49d9f2[_0xd371('0x2c')](0x194);}return _0x3f8ce8;};}function handleError(_0x41eb11,_0x240150){_0x240150=_0x240150||0x1f4;return function(_0x5c04d9){logger[_0xd371('0x28')](_0x5c04d9['stack']);if(_0x5c04d9[_0xd371('0x3b')]){delete _0x5c04d9[_0xd371('0x3b')];}_0x41eb11[_0xd371('0x2d')](_0x240150)['send'](_0x5c04d9);};}exports[_0xd371('0x3c')]=function(_0xba202,_0x3804cd){var _0x460884={'include':[{'model':db[_0xd371('0x3d')],'as':_0xd371('0x3e')}]},_0x2fd62f={},_0x58b602={'count':0x0,'rows':[]};var _0x52155d=_[_0xd371('0x3f')](db[_0xd371('0x40')][_0xd371('0x41')],function(_0x23f356){return{'name':_0x23f356[_0xd371('0x42')],'type':_0x23f356[_0xd371('0x43')][_0xd371('0x44')]};});_0x2fd62f['model']=_[_0xd371('0x3f')](_0x52155d,_0xd371('0x3b'));_0x2fd62f[_0xd371('0x45')]=_[_0xd371('0x46')](_0xba202['query']);_0x2fd62f['filters']=_['intersection'](_0x2fd62f[_0xd371('0x47')],_0x2fd62f['query']);_0x460884[_0xd371('0x48')]=_[_0xd371('0x49')](_0x2fd62f['model'],qs[_0xd371('0x4a')](_0xba202[_0xd371('0x45')]['fields']));_0x460884[_0xd371('0x48')]=_0x460884[_0xd371('0x48')][_0xd371('0x4b')]?_0x460884['attributes']:_0x2fd62f[_0xd371('0x47')];if(!_0xba202[_0xd371('0x45')]['hasOwnProperty'](_0xd371('0x4c'))){_0x460884['limit']=qs[_0xd371('0x2f')](_0xba202[_0xd371('0x45')][_0xd371('0x2f')]);_0x460884[_0xd371('0x31')]=qs[_0xd371('0x31')](_0xba202['query'][_0xd371('0x31')]);}_0x460884[_0xd371('0x4d')]=qs[_0xd371('0x4e')](_0xba202[_0xd371('0x45')][_0xd371('0x4e')]);_0x460884[_0xd371('0x4f')]=qs['filters'](_[_0xd371('0x50')](_0xba202['query'],_0x2fd62f[_0xd371('0x51')]),_0x52155d);if(_0xba202[_0xd371('0x45')][_0xd371('0x52')]){_0x460884[_0xd371('0x4f')]=_[_0xd371('0x53')](_0x460884['where'],{'$or':_['map'](_0x52155d,function(_0x317bce){if(_0x317bce['type']!==_0xd371('0x54')){var _0x10fd53={};_0x10fd53[_0x317bce[_0xd371('0x3b')]]={'$like':'%'+_0xba202[_0xd371('0x45')]['filter']+'%'};return _0x10fd53;}})});}_0x460884=_['merge']({},_0x460884,_0xba202[_0xd371('0x55')]);var _0x1103f9={'where':_0x460884[_0xd371('0x4f')]};return db['FaxAccount'][_0xd371('0x30')](_0x1103f9)[_0xd371('0x22')](function(_0x49a7df){_0x58b602['count']=_0x49a7df;if(_0xba202['query'][_0xd371('0x56')]){_0x460884[_0xd371('0x57')]=[{'all':!![]}];}return db['FaxAccount'][_0xd371('0x58')](_0x460884);})[_0xd371('0x22')](function(_0x157e1c){_0x58b602[_0xd371('0x59')]=_0x157e1c;return _0x58b602;})[_0xd371('0x22')](respondWithFilteredResult(_0x3804cd,_0x460884))[_0xd371('0x5a')](handleError(_0x3804cd,null));};exports[_0xd371('0x5b')]=function(_0x292b0a,_0x4c7467){var _0x493238={'raw':![],'where':{'id':_0x292b0a[_0xd371('0x5c')]['id']},'include':[{'model':db[_0xd371('0x3d')],'as':_0xd371('0x3e')}]},_0xd3da12={};_0xd3da12[_0xd371('0x47')]=_['keys'](db['FaxAccount']['rawAttributes']);_0xd3da12[_0xd371('0x45')]=_[_0xd371('0x46')](_0x292b0a[_0xd371('0x45')]);_0xd3da12[_0xd371('0x51')]=_[_0xd371('0x49')](_0xd3da12[_0xd371('0x47')],_0xd3da12['query']);_0x493238[_0xd371('0x48')]=_['intersection'](_0xd3da12['model'],qs['fields'](_0x292b0a[_0xd371('0x45')][_0xd371('0x4a')]));_0x493238[_0xd371('0x48')]=_0x493238[_0xd371('0x48')]['length']?_0x493238[_0xd371('0x48')]:_0xd3da12[_0xd371('0x47')];if(_0x292b0a[_0xd371('0x45')][_0xd371('0x56')]){_0x493238[_0xd371('0x57')]=[{'all':!![]}];}_0x493238=_[_0xd371('0x53')]({},_0x493238,_0x292b0a[_0xd371('0x55')]);return db[_0xd371('0x40')][_0xd371('0x5d')](_0x493238)[_0xd371('0x22')](handleEntityNotFound(_0x4c7467,null))[_0xd371('0x22')](respondWithResult(_0x4c7467,null))['catch'](handleError(_0x4c7467,null));};exports['create']=function(_0x34c762,_0x121133){return db['FaxAccount'][_0xd371('0x5e')](_0x34c762[_0xd371('0x5f')],{})[_0xd371('0x22')](function(_0x1ec64c){var _0x15f5b7=_0x34c762['user'][_0xd371('0x38')]({'plain':!![]});if(!_0x15f5b7)throw new Error(_0xd371('0x60'));if(_0x15f5b7[_0xd371('0x61')]===_0xd371('0x62')){var _0x149636=_0x1ec64c[_0xd371('0x38')]({'plain':!![]});var _0x480b62=_0xd371('0x39');return db[_0xd371('0x63')][_0xd371('0x5d')]({'where':{'name':_0x480b62,'userProfileId':_0x15f5b7[_0xd371('0x64')]},'raw':!![]})[_0xd371('0x22')](function(_0xde55aa){if(_0xde55aa&&_0xde55aa[_0xd371('0x65')]===0x0){return db[_0xd371('0x66')]['create']({'name':_0x149636[_0xd371('0x3b')],'resourceId':_0x149636['id'],'type':_0xde55aa[_0xd371('0x3b')],'sectionId':_0xde55aa['id']},{})[_0xd371('0x22')](function(){return _0x1ec64c;});}else{return _0x1ec64c;}})[_0xd371('0x5a')](function(_0x110d90){logger[_0xd371('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x110d90);throw _0x110d90;});}return _0x1ec64c;})[_0xd371('0x22')](respondWithResult(_0x121133,0xc9))[_0xd371('0x5a')](handleError(_0x121133,null));};exports[_0xd371('0x67')]=function(_0x363cbf,_0x1d26d3){if(_0x363cbf[_0xd371('0x5f')]['id']){delete _0x363cbf[_0xd371('0x5f')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x363cbf['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xd371('0x22')](handleEntityNotFound(_0x1d26d3,null))[_0xd371('0x22')](saveUpdates(_0x363cbf[_0xd371('0x5f')],null))[_0xd371('0x22')](respondWithResult(_0x1d26d3,null))[_0xd371('0x5a')](handleError(_0x1d26d3,null));};exports[_0xd371('0x37')]=function(_0x5b21fd,_0x586888){return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x5b21fd[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0x586888,null))[_0xd371('0x22')](removeEntity(_0x586888,null))[_0xd371('0x5a')](handleError(_0x586888,null));};exports[_0xd371('0x68')]=function(_0x52b6ee,_0x9a6ecf){return db[_0xd371('0x40')][_0xd371('0x68')]()[_0xd371('0x22')](respondWithResult(_0x9a6ecf,null))[_0xd371('0x5a')](handleError(_0x9a6ecf,null));};exports['addDisposition']=function(_0x1a56c9,_0xdcdd94,_0x3174b8){if(_0x1a56c9[_0xd371('0x5f')]['id']){delete _0x1a56c9[_0xd371('0x5f')]['id'];}return db[_0xd371('0x40')]['find']({'where':{'id':_0x1a56c9[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0xdcdd94,null))[_0xd371('0x22')](function(_0x24e597){if(_0x24e597){_0x1a56c9[_0xd371('0x5f')][_0xd371('0x69')]=_0x24e597['id'];return db[_0xd371('0x6a')][_0xd371('0x5e')](_0x1a56c9[_0xd371('0x5f')]);}})[_0xd371('0x22')](respondWithResult(_0xdcdd94,null))[_0xd371('0x5a')](handleError(_0xdcdd94,null));};exports[_0xd371('0x6b')]=function(_0x58d71b,_0x287880,_0xca67d0){var _0x3ec15d={'raw':![],'where':{}};var _0x255df6={};var _0x5e9dc8={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x58d71b['params']['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x287880,null))[_0xd371('0x22')](function(_0x347fc3){if(_0x347fc3){_0x255df6[_0xd371('0x47')]=_['keys'](db[_0xd371('0x6a')]['rawAttributes']);_0x255df6[_0xd371('0x45')]=_[_0xd371('0x46')](_0x58d71b['query']);_0x255df6[_0xd371('0x51')]=_[_0xd371('0x49')](_0x255df6['model'],_0x255df6['query']);_0x3ec15d['attributes']=_[_0xd371('0x49')](_0x255df6[_0xd371('0x47')],qs[_0xd371('0x4a')](_0x58d71b[_0xd371('0x45')][_0xd371('0x4a')]));_0x3ec15d['attributes']=_0x3ec15d['attributes'][_0xd371('0x4b')]?_0x3ec15d[_0xd371('0x48')]:_0x255df6[_0xd371('0x47')];if(!_0x58d71b[_0xd371('0x45')][_0xd371('0x6c')](_0xd371('0x4c'))){_0x3ec15d['limit']=qs[_0xd371('0x2f')](_0x58d71b[_0xd371('0x45')][_0xd371('0x2f')]);_0x3ec15d[_0xd371('0x31')]=qs[_0xd371('0x31')](_0x58d71b['query'][_0xd371('0x31')]);}_0x3ec15d['order']=qs[_0xd371('0x4e')](_0x58d71b[_0xd371('0x45')][_0xd371('0x4e')]);_0x3ec15d['where']=qs[_0xd371('0x51')](_['pick'](_0x58d71b['query'],_0x255df6['filters']));_0x3ec15d[_0xd371('0x4f')]['FaxAccountId']=_0x347fc3['id'];if(_0x58d71b[_0xd371('0x45')]['filter']){_0x3ec15d[_0xd371('0x4f')]=_['merge'](_0x3ec15d[_0xd371('0x4f')],{'$or':_[_0xd371('0x3f')](_0x3ec15d['attributes'],function(_0x1a8e88){var _0x45bf68={};_0x45bf68[_0x1a8e88]={'$like':'%'+_0x58d71b[_0xd371('0x45')][_0xd371('0x52')]+'%'};return _0x45bf68;})});}_0x3ec15d=_['merge']({},_0x3ec15d,_0x58d71b[_0xd371('0x55')]);return db[_0xd371('0x6a')][_0xd371('0x30')]({'where':_0x3ec15d[_0xd371('0x4f')]})[_0xd371('0x22')](function(_0x5848e0){_0x5e9dc8[_0xd371('0x30')]=_0x5848e0;if(_0x58d71b[_0xd371('0x45')][_0xd371('0x56')]){_0x3ec15d['include']=[{'all':!![]}];}return db[_0xd371('0x6a')][_0xd371('0x58')](_0x3ec15d);})[_0xd371('0x22')](function(_0x5febda){_0x5e9dc8[_0xd371('0x59')]=_0x5febda;return _0x5e9dc8;});}})[_0xd371('0x22')](respondWithFilteredResult(_0x287880,_0x3ec15d))[_0xd371('0x5a')](handleError(_0x287880,null));};exports[_0xd371('0x6d')]=function(_0x40115c,_0xd36479,_0x4f7a68){return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x40115c[_0xd371('0x5c')]['id']}})[_0xd371('0x22')](handleEntityNotFound(_0xd36479,null))[_0xd371('0x22')](function(_0x3f50eb){if(_0x3f50eb){return _0x3f50eb['removeDispositions'](_0x40115c[_0xd371('0x45')][_0xd371('0x6e')]);}})[_0xd371('0x22')](respondWithStatusCode(_0xd36479,null))[_0xd371('0x5a')](handleError(_0xd36479,null));};exports[_0xd371('0x6f')]=function(_0x2ec4ee,_0x140050,_0x4b8346){if(_0x2ec4ee[_0xd371('0x5f')]['id']){delete _0x2ec4ee['body']['id'];}return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x2ec4ee[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0x140050,null))[_0xd371('0x22')](function(_0x4b9a83){if(_0x4b9a83){_0x2ec4ee[_0xd371('0x5f')]['FaxAccountId']=_0x4b9a83['id'];return db[_0xd371('0x70')][_0xd371('0x5e')](_0x2ec4ee[_0xd371('0x5f')]);}})[_0xd371('0x22')](respondWithResult(_0x140050,null))[_0xd371('0x5a')](handleError(_0x140050,null));};exports[_0xd371('0x71')]=function(_0x5882c4,_0xab14fb,_0x1c73ad){var _0x48f1ea={'raw':![],'where':{}};var _0x5b2129={};var _0x145213={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x5882c4[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0xab14fb,null))[_0xd371('0x22')](function(_0x41599e){if(_0x41599e){_0x5b2129[_0xd371('0x47')]=_[_0xd371('0x46')](db[_0xd371('0x70')][_0xd371('0x41')]);_0x5b2129[_0xd371('0x45')]=_[_0xd371('0x46')](_0x5882c4[_0xd371('0x45')]);_0x5b2129[_0xd371('0x51')]=_[_0xd371('0x49')](_0x5b2129[_0xd371('0x47')],_0x5b2129[_0xd371('0x45')]);_0x48f1ea[_0xd371('0x48')]=_['intersection'](_0x5b2129[_0xd371('0x47')],qs[_0xd371('0x4a')](_0x5882c4[_0xd371('0x45')]['fields']));_0x48f1ea[_0xd371('0x48')]=_0x48f1ea['attributes'][_0xd371('0x4b')]?_0x48f1ea[_0xd371('0x48')]:_0x5b2129[_0xd371('0x47')];if(!_0x5882c4[_0xd371('0x45')][_0xd371('0x6c')](_0xd371('0x4c'))){_0x48f1ea[_0xd371('0x2f')]=qs[_0xd371('0x2f')](_0x5882c4[_0xd371('0x45')][_0xd371('0x2f')]);_0x48f1ea['offset']=qs['offset'](_0x5882c4[_0xd371('0x45')]['offset']);}_0x48f1ea[_0xd371('0x4d')]=qs[_0xd371('0x4e')](_0x5882c4[_0xd371('0x45')][_0xd371('0x4e')]);_0x48f1ea[_0xd371('0x4f')]=qs[_0xd371('0x51')](_['pick'](_0x5882c4[_0xd371('0x45')],_0x5b2129['filters']));_0x48f1ea[_0xd371('0x4f')][_0xd371('0x69')]=_0x41599e['id'];if(_0x5882c4[_0xd371('0x45')][_0xd371('0x52')]){_0x48f1ea[_0xd371('0x4f')]=_[_0xd371('0x53')](_0x48f1ea[_0xd371('0x4f')],{'$or':_[_0xd371('0x3f')](_0x48f1ea[_0xd371('0x48')],function(_0x2c61ed){var _0x176265={};_0x176265[_0x2c61ed]={'$like':'%'+_0x5882c4[_0xd371('0x45')][_0xd371('0x52')]+'%'};return _0x176265;})});}_0x48f1ea=_[_0xd371('0x53')]({},_0x48f1ea,_0x5882c4[_0xd371('0x55')]);return db[_0xd371('0x70')][_0xd371('0x30')]({'where':_0x48f1ea[_0xd371('0x4f')]})['then'](function(_0x2b40c0){_0x145213[_0xd371('0x30')]=_0x2b40c0;if(_0x5882c4[_0xd371('0x45')]['includeAll']){_0x48f1ea[_0xd371('0x57')]=[{'all':!![]}];}return db[_0xd371('0x70')][_0xd371('0x58')](_0x48f1ea);})['then'](function(_0x5a4642){_0x145213[_0xd371('0x59')]=_0x5a4642;return _0x145213;});}})[_0xd371('0x22')](respondWithFilteredResult(_0xab14fb,_0x48f1ea))[_0xd371('0x5a')](handleError(_0xab14fb,null));};exports['removeAnswers']=function(_0x1922b4,_0x21a073,_0x59b0a9){return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x1922b4['params']['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x21a073,null))['then'](function(_0x29b6c6){if(_0x29b6c6){return _0x29b6c6[_0xd371('0x72')](_0x1922b4['query'][_0xd371('0x6e')]);}})[_0xd371('0x22')](respondWithStatusCode(_0x21a073,null))[_0xd371('0x5a')](handleError(_0x21a073,null));};exports['addInteraction']=function(_0x33da6a,_0x1faf02,_0x2b12f2){return db[_0xd371('0x73')][_0xd371('0x5d')]({'where':{'id':_0x33da6a[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1faf02,null))['then'](function(_0x14d1da){if(_0x14d1da){return _0x14d1da[_0xd371('0x74')](_0x33da6a[_0xd371('0x5f')][_0xd371('0x6e')],_[_0xd371('0x75')](_0x33da6a[_0xd371('0x5f')],[_0xd371('0x6e'),'id'])||{});}})[_0xd371('0x22')](respondWithResult(_0x1faf02,null))[_0xd371('0x5a')](handleError(_0x1faf02,null));};exports[_0xd371('0x76')]=function(_0x2f9c67,_0x24c241,_0x1168b4){var _0x2ab5a7={'raw':![],'where':{}};var _0x27687e={};var _0x3b349e={'count':0x0,'rows':[]};return db[_0xd371('0x40')][_0xd371('0x77')]({'where':{'id':_0x2f9c67[_0xd371('0x5c')]['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x24c241,null))[_0xd371('0x22')](function(_0x26d202){if(_0x26d202){_0x27687e['model']=_[_0xd371('0x46')](db[_0xd371('0x73')][_0xd371('0x41')]);_0x27687e[_0xd371('0x45')]=_[_0xd371('0x46')](_0x2f9c67['query']);_0x27687e[_0xd371('0x51')]=_['intersection'](_0x27687e['model'],_0x27687e[_0xd371('0x45')]);_0x2ab5a7[_0xd371('0x48')]=_[_0xd371('0x49')](_0x27687e['model'],qs[_0xd371('0x4a')](_0x2f9c67['query']['fields']));_0x2ab5a7[_0xd371('0x48')]=_0x2ab5a7[_0xd371('0x48')]['length']?_0x2ab5a7[_0xd371('0x48')]:_0x27687e[_0xd371('0x47')];if(!_0x2f9c67[_0xd371('0x45')]['hasOwnProperty'](_0xd371('0x4c'))){_0x2ab5a7[_0xd371('0x2f')]=qs[_0xd371('0x2f')](_0x2f9c67[_0xd371('0x45')][_0xd371('0x2f')]);_0x2ab5a7[_0xd371('0x31')]=qs['offset'](_0x2f9c67[_0xd371('0x45')][_0xd371('0x31')]);}_0x2ab5a7[_0xd371('0x4d')]=qs[_0xd371('0x4e')](_0x2f9c67[_0xd371('0x45')]['sort']);_0x2ab5a7[_0xd371('0x4f')]=qs[_0xd371('0x51')](_[_0xd371('0x50')](_0x2f9c67['query'],_0x27687e[_0xd371('0x51')]));_0x2ab5a7[_0xd371('0x4f')][_0xd371('0x69')]=_0x26d202['id'];if(_0x2f9c67[_0xd371('0x45')][_0xd371('0x52')]){_0x2ab5a7[_0xd371('0x4f')]=_[_0xd371('0x53')](_0x2ab5a7[_0xd371('0x4f')],{'$or':_['map'](_0x2ab5a7[_0xd371('0x48')],function(_0x37955f){var _0x197e50={};_0x197e50[_0x37955f]={'$like':'%'+_0x2f9c67[_0xd371('0x45')][_0xd371('0x52')]+'%'};return _0x197e50;})});}_0x2ab5a7=_[_0xd371('0x53')]({},_0x2ab5a7,_0x2f9c67[_0xd371('0x55')]);return db[_0xd371('0x73')]['count']({'where':_0x2ab5a7[_0xd371('0x4f')]})['then'](function(_0x4eda26){_0x3b349e[_0xd371('0x30')]=_0x4eda26;if(_0x2f9c67['query'][_0xd371('0x56')]){_0x2ab5a7['include']=[{'model':db[_0xd371('0x78')],'as':_0xd371('0x79'),'required':![]},{'model':db[_0xd371('0x7a')],'as':_0xd371('0x7b'),'attributes':[_0xd371('0x3b'),'fullname',_0xd371('0x7c')],'required':![]},{'model':db[_0xd371('0x7d')],'as':_0xd371('0x7e'),'attributes':['id',_0xd371('0x3b'),_0xd371('0x7f')],'where':_0x2f9c67[_0xd371('0x45')][_0xd371('0x80')]?{'id':_0x2f9c67[_0xd371('0x45')][_0xd371('0x80')]}:undefined,'required':_0x2f9c67[_0xd371('0x45')][_0xd371('0x80')]?!![]:![]}];}return db[_0xd371('0x73')]['findAll'](_0x2ab5a7);})[_0xd371('0x22')](function(_0x371c70){_0x3b349e[_0xd371('0x59')]=_0x371c70;return _0x3b349e;});}})[_0xd371('0x22')](respondWithFilteredResult(_0x24c241,_0x2ab5a7))['catch'](handleError(_0x24c241,null));};exports['addApplications']=function(_0x1e287d,_0x4f8814,_0x35843f){return db['FaxAccount'][_0xd371('0x77')]({'where':{'id':_0x1e287d['params']['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x4f8814,null))[_0xd371('0x22')](function(_0x3cebe3){if(_0x3cebe3){return db[_0xd371('0x81')][_0xd371('0x82')](function(_0x19b01f){return db['FaxApplication'][_0xd371('0x37')]({'where':{'FaxAccountId':_0x1e287d[_0xd371('0x5c')]['id']},'transaction':_0x19b01f})[_0xd371('0x22')](function(_0x28ce5a){var _0xb548cc=_[_0xd371('0x3f')](_0x1e287d[_0xd371('0x5f')],function(_0x3dee84){_0x3dee84[_0xd371('0x69')]=_0x1e287d[_0xd371('0x5c')]['id'];return _0x3dee84;});return db[_0xd371('0x83')][_0xd371('0x84')](_0xb548cc,{'transaction':_0x19b01f});});})[_0xd371('0x22')](function(){return db[_0xd371('0x83')]['findAndCountAll']({'where':{'FaxAccountId':_0x1e287d[_0xd371('0x5c')]['id']},'order':_0xd371('0x85')});});}})['then'](respondWithResult(_0x4f8814,null))[_0xd371('0x5a')](handleError(_0x4f8814,null));};exports[_0xd371('0x86')]=function(_0x87260b,_0x2da975,_0x514e83){var _0x477c19={};var _0x136956={};var _0x4fde7b;var _0x27174e;return db[_0xd371('0x40')][_0xd371('0x77')]({'where':{'id':_0x87260b[_0xd371('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2da975,null))[_0xd371('0x22')](function(_0x39e71e){if(_0x39e71e){_0x4fde7b=_0x39e71e;_0x136956[_0xd371('0x47')]=_[_0xd371('0x46')](db[_0xd371('0x83')][_0xd371('0x41')]);_0x136956[_0xd371('0x45')]=_[_0xd371('0x46')](_0x87260b['query']);_0x136956['filters']=_[_0xd371('0x49')](_0x136956['model'],_0x136956[_0xd371('0x45')]);_0x477c19[_0xd371('0x48')]=_[_0xd371('0x49')](_0x136956['model'],qs['fields'](_0x87260b[_0xd371('0x45')][_0xd371('0x4a')]));_0x477c19[_0xd371('0x48')]=_0x477c19['attributes'][_0xd371('0x4b')]?_0x477c19[_0xd371('0x48')]:_0x136956[_0xd371('0x47')];_0x477c19[_0xd371('0x4d')]=qs[_0xd371('0x4e')](_0x87260b[_0xd371('0x45')][_0xd371('0x4e')]);_0x477c19[_0xd371('0x4f')]=qs[_0xd371('0x51')](_[_0xd371('0x50')](_0x87260b[_0xd371('0x45')],_0x136956['filters']));if(_0x87260b[_0xd371('0x45')][_0xd371('0x52')]){_0x477c19[_0xd371('0x4f')]=_[_0xd371('0x53')](_0x477c19[_0xd371('0x4f')],{'$or':_[_0xd371('0x3f')](_0x477c19[_0xd371('0x48')],function(_0x35caa9){var _0x31a20c={};_0x31a20c[_0x35caa9]={'$like':'%'+_0x87260b[_0xd371('0x45')][_0xd371('0x52')]+'%'};return _0x31a20c;})});}_0x477c19=_[_0xd371('0x53')]({},_0x477c19,_0x87260b[_0xd371('0x55')]);return _0x4fde7b[_0xd371('0x86')](_0x477c19);}})[_0xd371('0x22')](function(_0x1f81ee){if(_0x1f81ee){_0x27174e=_0x1f81ee[_0xd371('0x4b')];if(!_0x87260b[_0xd371('0x45')][_0xd371('0x6c')](_0xd371('0x4c'))){_0x477c19['limit']=qs[_0xd371('0x2f')](_0x87260b[_0xd371('0x45')][_0xd371('0x2f')]);_0x477c19[_0xd371('0x31')]=qs['offset'](_0x87260b[_0xd371('0x45')]['offset']);}return _0x4fde7b[_0xd371('0x86')](_0x477c19);}})['then'](function(_0x3b0604){if(_0x3b0604){return _0x3b0604?{'count':_0x27174e,'rows':_0x3b0604}:null;}})[_0xd371('0x22')](respondWithResult(_0x2da975,null))['catch'](handleError(_0x2da975,null));};function Extension(_0x22ef1c,_0x22a826,_0x198447,_0x5b260b){this[_0xd371('0x87')]=_0xd371('0x88');this['exten']=_0x22ef1c['localstationid'];this[_0xd371('0x89')]=_0x5b260b;this[_0xd371('0x43')]='system';this[_0xd371('0x8a')]=_0xd371('0x8b');this['FaxAccountId']=_0x22ef1c['id'];this[_0xd371('0x85')]=_0x22a826;this['appdata']=_0x198447;}function createExtensionsReciveFax(_0x2f37d8){var _0x19ae68=0x1;var _0x17c134=[];_0x17c134[_0xd371('0x8c')](new Extension(_0x2f37d8,_0x19ae68,'',_0xd371('0x8d')));_0x19ae68+=0x1;_0x17c134[_0xd371('0x8c')](new Extension(_0x2f37d8,_0x19ae68,_0xd371('0x8e'),'Set'));_0x19ae68+=0x1;for(var _0x1eced0 in _0x2f37d8){if(_0x2f37d8[_0xd371('0x6c')](_0x1eced0)&&(_0x1eced0===_0xd371('0x8f')||_0x1eced0===_0xd371('0x90')||_0x1eced0==='gateway'||_0x1eced0===_0xd371('0x91')||_0x1eced0===_0xd371('0x92')||_0x1eced0===_0xd371('0x93')||_0x1eced0===_0xd371('0x94')||_0x1eced0==='modem'||_0x1eced0===_0xd371('0x95'))){_0x17c134['push'](new Extension(_0x2f37d8,_0x19ae68,'FAXOPT('+_0x1eced0+')='+_0x2f37d8[_0x1eced0],_0xd371('0x96')));_0x19ae68+=0x1;}}_0x17c134[_0xd371('0x8c')](new Extension(_0x2f37d8,_0x19ae68,'6',_0xd371('0x97')));_0x19ae68+=0x1;_0x17c134[_0xd371('0x8c')](new Extension(_0x2f37d8,_0x19ae68,_0xd371('0x98'),_0xd371('0x99')));_0x19ae68=0x0;return _0x17c134;}exports[_0xd371('0x9a')]=function(_0x48b84a,_0x2cfa10,_0x1ca0a2){var _0x3a0d51;return db['sequelize'][_0xd371('0x82')](function(_0x5da301){return db[_0xd371('0x40')][_0xd371('0x5e')](_0x48b84a[_0xd371('0x5f')],{'transaction':_0x5da301})[_0xd371('0x22')](function(_0x1b0038){_0x3a0d51=_0x1b0038['get']({'plain':!![]});return db[_0xd371('0x9b')]['bulkCreate'](createExtensionsReciveFax(_0x3a0d51),{'transaction':_0x5da301});});})[_0xd371('0x22')](function(){return _0x3a0d51;})[_0xd371('0x22')](respondWithResult(_0x2cfa10,null))[_0xd371('0x5a')](handleError(_0x2cfa10,null));};exports['updateAccountApplications']=function(_0x26fa93,_0x588bad,_0x58627b){var _0xf8996c;return db[_0xd371('0x81')]['transaction'](function(_0x36c74d){return db['FaxAccount'][_0xd371('0x67')](_0x26fa93[_0xd371('0x5f')],{'where':{'id':_0x26fa93[_0xd371('0x5f')]['id']},'transaction':_0x36c74d})['then'](function(_0x3de513){return db[_0xd371('0x9b')][_0xd371('0x37')]({'where':{'FaxAccountId':_0x26fa93[_0xd371('0x5f')]['id']},'transaction':_0x36c74d})[_0xd371('0x22')](function(_0x396f32){return db[_0xd371('0x9b')]['bulkCreate'](createExtensionsReciveFax(_[_0xd371('0x75')](_0x26fa93[_0xd371('0x5f')],['tech','key','createdAt',_0xd371('0x9c'),_0xd371('0x9d'),_0xd371('0x9e')])),{'transaction':_0x36c74d});});});})[_0xd371('0x22')](function(){return db['FaxAccount'][_0xd371('0x9f')](_0x26fa93[_0xd371('0x5f')]['id']);})['then'](respondWithResult(_0x588bad,null))[_0xd371('0x5a')](handleError(_0x588bad,null));};exports['getMessages']=function(_0x3bf4e8,_0x2d3b82,_0x34e2ba){var _0x533bb1={'raw':!![],'where':{}};var _0x3e737d={};var _0x3b0a4b={'count':0x0,'rows':[]};return db[_0xd371('0x40')]['findOne']({'where':{'id':_0x3bf4e8[_0xd371('0x5c')]['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x2d3b82,null))[_0xd371('0x22')](function(_0x16aca9){if(_0x16aca9){_0x3e737d['model']=_[_0xd371('0x46')](db[_0xd371('0xa0')]['rawAttributes']);_0x3e737d[_0xd371('0x45')]=_[_0xd371('0x46')](_0x3bf4e8[_0xd371('0x45')]);_0x3e737d[_0xd371('0x51')]=_['intersection'](_0x3e737d[_0xd371('0x47')],_0x3e737d[_0xd371('0x45')]);_0x533bb1['attributes']=_[_0xd371('0x49')](_0x3e737d[_0xd371('0x47')],qs[_0xd371('0x4a')](_0x3bf4e8['query']['fields']));_0x533bb1['attributes']=_0x533bb1['attributes']['length']?_0x533bb1[_0xd371('0x48')]:_0x3e737d[_0xd371('0x47')];if(!_0x3bf4e8['query'][_0xd371('0x6c')]('nolimit')){_0x533bb1['limit']=qs[_0xd371('0x2f')](_0x3bf4e8[_0xd371('0x45')]['limit']);_0x533bb1[_0xd371('0x31')]=qs['offset'](_0x3bf4e8[_0xd371('0x45')][_0xd371('0x31')]);}_0x533bb1['order']=qs['sort'](_0x3bf4e8['query'][_0xd371('0x4e')]);_0x533bb1['where']=qs[_0xd371('0x51')](_[_0xd371('0x50')](_0x3bf4e8['query'],_0x3e737d[_0xd371('0x51')]));_0x533bb1[_0xd371('0x4f')][_0xd371('0x69')]=_0x16aca9['id'];if(_0x3bf4e8[_0xd371('0x45')][_0xd371('0x52')]){_0x533bb1['where']=_[_0xd371('0x53')](_0x533bb1[_0xd371('0x4f')],{'$or':_['map'](_0x533bb1[_0xd371('0x48')],function(_0x83afd7){var _0x17ddd0={};_0x17ddd0[_0x83afd7]={'$like':'%'+_0x3bf4e8[_0xd371('0x45')]['filter']+'%'};return _0x17ddd0;})});}if(_0x3bf4e8['query'][_0xd371('0xa1')]){var _0x188649=_0x3bf4e8[_0xd371('0x45')][_0xd371('0xa1')][_0xd371('0xa2')](',');var _0x39d266={};_0x39d266[_0x188649[0x0]]={'$gte':moment(_0x188649[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x533bb1[_0xd371('0x4f')]=_[_0xd371('0x53')](_0x533bb1[_0xd371('0x4f')],_0x39d266);}_0x533bb1=_['merge']({},_0x533bb1,_0x3bf4e8['options']);return db['FaxMessage'][_0xd371('0x30')]({'where':_0x533bb1[_0xd371('0x4f')]})[_0xd371('0x22')](function(_0x59c283){_0x3b0a4b['count']=_0x59c283;if(_0x3bf4e8[_0xd371('0x45')][_0xd371('0x56')]){_0x533bb1['include']=[{'all':!![]}];}return db[_0xd371('0xa0')][_0xd371('0x58')](_0x533bb1);})['then'](function(_0x585cab){_0x3b0a4b[_0xd371('0x59')]=_0x585cab;return _0x3b0a4b;});}})[_0xd371('0x22')](respondWithFilteredResult(_0x2d3b82,_0x533bb1))[_0xd371('0x5a')](handleError(_0x2d3b82,null));};exports[_0xd371('0xa3')]=function(_0x5e20b5,_0x2c72e3,_0x232933){var _0x25a7d6,_0x36b7a6={},_0x145d53;if(_0x5e20b5[_0xd371('0x5f')]['to']){_0x145d53=_0x5e20b5[_0xd371('0x5f')]['to'][0x0];}return db['FaxAccount'][_0xd371('0x5d')]({'where':{'id':_0x5e20b5[_0xd371('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xd371('0xa4'),'include':[{'model':db[_0xd371('0x78')],'as':_0xd371('0xa5'),'where':{'fax':_0x145d53},'limit':0x1,'order':[['updatedAt',_0xd371('0xa6')]]}]}]})[_0xd371('0x22')](handleEntityNotFound(_0x2c72e3,null))[_0xd371('0x22')](function(_0x5b3e90){_0x25a7d6=_0x5b3e90;if(_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')]&&_0x5e20b5['body'][_0xd371('0xa7')][_0xd371('0x4b')]){for(var _0x1bbcc2=0x0;_0x1bbcc2<_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][_0xd371('0x4b')];_0x1bbcc2+=0x1){_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][_0x1bbcc2]={'filename':_0x5e20b5[_0xd371('0x5f')]['attachments'][_0x1bbcc2]['name'],'id':_0x5e20b5[_0xd371('0x5f')]['attachments'][_0x1bbcc2]['id'],'path':path[_0xd371('0xa8')](config[_0xd371('0xa9')],_0xd371('0xaa'),_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][_0x1bbcc2][_0xd371('0xab')])};}}return respondWithRpcPromise(_0xd371('0xac'),_0xd371('0xac'),{'FaxAccountId':_[_0xd371('0xad')](_0x5e20b5[_0xd371('0x5c')]['id'])?undefined:_0x5e20b5[_0xd371('0x5c')]['id'],'path':_[_0xd371('0xad')](_0x5e20b5['body'][_0xd371('0xa7')][0x0][_0xd371('0x7')])?undefined:_0x5e20b5[_0xd371('0x5f')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x5e20b5['body']['to'][0x0])?undefined:_0x5e20b5[_0xd371('0x5f')]['to'][0x0]},client9002);})['then'](function(){if(_0x25a7d6){if(_[_0xd371('0xad')](_0x5e20b5[_0xd371('0x5f')][_0xd371('0xae')])){_0x5e20b5[_0xd371('0x5f')][_0xd371('0xae')]=util[_0xd371('0xaf')](_0xd371('0xb0'),_0x25a7d6[_0xd371('0x3b')],_0x25a7d6[_0xd371('0xb1')]);}if(_0x25a7d6[_0xd371('0xa4')]){if(_0x25a7d6[_0xd371('0xa4')]['Contacts']['length']){return _0x25a7d6[_0xd371('0xa4')][_0xd371('0xa5')][0x0];}else{return db['CmContact'][_0xd371('0x5e')](_[_0xd371('0x19')](_0x5e20b5[_0xd371('0x5f')],{'firstName':_0x5e20b5[_0xd371('0x5f')]['to'][0x0],'phone':_0x5e20b5[_0xd371('0x5f')]['to'][0x0],'fax':_0x5e20b5[_0xd371('0x5f')]['to'][0x0],'ListId':_0x25a7d6[_0xd371('0x9e')]}));}}else{throw new Error(_0xd371('0xb2'));}}else{throw new Error('Send\x20Fax\x20failed');}})[_0xd371('0x22')](function(_0x2ad1ce){if(_0x2ad1ce){return db[_0xd371('0x73')][_0xd371('0x5d')]({'where':{'ContactId':_0x2ad1ce['id'],'closed':![],'FaxAccountId':_0x25a7d6['id']}})['then'](function(_0x43a4e0){if(_0x43a4e0){return[_0x43a4e0,![]];}return db[_0xd371('0x73')][_0xd371('0x5e')]({'UserId':_0x5e20b5[_0xd371('0x62')]['id'],'ContactId':_0x2ad1ce['id'],'FaxAccountId':_0x25a7d6['id'],'fax':_0x5e20b5[_0xd371('0x5f')]['to'][0x0],'firstMsgDirection':_0xd371('0xb3'),'Messages':[_[_0xd371('0x53')](_0x5e20b5['body'],{'read':![],'body':_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][0x0]['filename'],'FaxAccountId':_0x25a7d6['id'],'UserId':_0x5e20b5['user']['id'],'ContactId':_0x2ad1ce['id'],'AttachmentId':_0x5e20b5[_0xd371('0x5f')]['attachments'][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0xd371('0xb4')}]})[_0xd371('0x22')](function(_0x2dd877){return[_0x2dd877,!![]];});});}else{throw new Error(_0xd371('0xb5'));}})['spread'](function(_0x164e40,_0x511201){if(_0x511201){return _0x164e40;}return db[_0xd371('0xa0')][_0xd371('0x5e')]({'direction':_0xd371('0xb3'),'read':![],'body':_0x5e20b5[_0xd371('0x5f')]['attachments'][0x0]['filename'],'FaxAccountId':_0x25a7d6['id'],'FaxInteractionId':_0x164e40['id'],'UserId':_0x5e20b5['user']['id'],'ContactId':_0x164e40[_0xd371('0xb6')],'AttachmentId':_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][0x0]['id']})[_0xd371('0x22')](function(_0x1f20d2){_0x164e40[_0xd371('0xb7')]['Messages']=[];_0x164e40[_0xd371('0xb7')][_0xd371('0xb4')][_0xd371('0x8c')](_0x1f20d2['dataValues']);return _0x164e40;});})[_0xd371('0x22')](function(_0x430c56){respondWithRpcPromise(_0xd371('0xb8'),'SendFax',{'FaxAccountId':_[_0xd371('0xad')](_0x5e20b5[_0xd371('0x5c')]['id'])?undefined:_0x5e20b5[_0xd371('0x5c')]['id'],'path':_[_0xd371('0xad')](_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][0x0][_0xd371('0x7')])?undefined:_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][0x0][_0xd371('0x7')],'fax':_['isNil'](_0x5e20b5[_0xd371('0x5f')]['to'][0x0])?undefined:_0x5e20b5['body']['to'][0x0],'AttachmentId':_0x5e20b5[_0xd371('0x5f')][_0xd371('0xa7')][0x0]['id']},client9002)[_0xd371('0x22')](function(_0x5a2c61){logger[_0xd371('0x23')](_0xd371('0xb9'),_0x5a2c61);})[_0xd371('0x5a')](function(_0x5ee736){logger['info']('SendFaxRpc,\x20%s',_0x5ee736);});return _0x430c56;})[_0xd371('0x22')](respondWithResult(_0x2c72e3,null))['catch'](handleError(_0x2c72e3,null));};exports['addAgents']=function(_0x1a3a73,_0x37c3c3,_0x46fec3){return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x1a3a73['params']['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x37c3c3,null))[_0xd371('0x22')](function(_0x1d00af){if(_0x1d00af){return _0x1d00af[_0xd371('0xba')](_0x1a3a73[_0xd371('0x5f')][_0xd371('0x6e')],_[_0xd371('0x75')](_0x1a3a73[_0xd371('0x5f')],[_0xd371('0x6e'),'id'])||{})['spread'](function(_0x3d1bfa){for(var _0x32651f=0x0;_0x32651f<_0x1a3a73[_0xd371('0x5f')][_0xd371('0x6e')]['length'];_0x32651f+=0x1){socket[_0xd371('0xbb')](_0xd371('0xbc'),{'UserId':Number(_0x1a3a73[_0xd371('0x5f')][_0xd371('0x6e')][_0x32651f]),'FaxAccountId':Number(_0x1a3a73[_0xd371('0x5c')]['id'])});}return _0x3d1bfa;});}})[_0xd371('0x22')](respondWithResult(_0x37c3c3,null))[_0xd371('0x5a')](handleError(_0x37c3c3,null));};exports['removeAgents']=function(_0x248a8d,_0x2501c8,_0x94f942){return db[_0xd371('0x40')][_0xd371('0x5d')]({'where':{'id':_0x248a8d[_0xd371('0x5c')]['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x2501c8,null))[_0xd371('0x22')](function(_0x171a3e){if(_0x171a3e){return _0x171a3e[_0xd371('0xbd')](_0x248a8d[_0xd371('0x45')][_0xd371('0x6e')])[_0xd371('0x22')](function(){if(_[_0xd371('0xbe')](_0x248a8d['query'][_0xd371('0x6e')])){for(var _0x28159d=0x0;_0x28159d<_0x248a8d[_0xd371('0x45')][_0xd371('0x6e')]['length'];_0x28159d+=0x1){socket[_0xd371('0xbb')](_0xd371('0xbf'),{'UserId':Number(_0x248a8d[_0xd371('0x45')][_0xd371('0x6e')][_0x28159d]),'FaxAccountId':Number(_0x248a8d[_0xd371('0x5c')]['id'])});}}else{socket[_0xd371('0xbb')](_0xd371('0xbf'),{'UserId':Number(_0x248a8d[_0xd371('0x45')][_0xd371('0x6e')]),'FaxAccountId':Number(_0x248a8d[_0xd371('0x5c')]['id'])});}});}})[_0xd371('0x22')](respondWithStatusCode(_0x2501c8,null))[_0xd371('0x5a')](handleError(_0x2501c8,null));};exports['getAgents']=function(_0x489210,_0x299f97,_0x58790b){var _0x13c351={};var _0x15bdfb={};var _0x1a8e40;var _0x1232fc;return db[_0xd371('0x40')][_0xd371('0x77')]({'where':{'id':_0x489210[_0xd371('0x5c')]['id']}})[_0xd371('0x22')](handleEntityNotFound(_0x299f97,null))[_0xd371('0x22')](function(_0x301771){if(_0x301771){_0x1a8e40=_0x301771;_0x15bdfb[_0xd371('0x47')]=_['keys'](db['User']['rawAttributes']);_0x15bdfb[_0xd371('0x45')]=_[_0xd371('0x46')](_0x489210['query']);_0x15bdfb['filters']=_[_0xd371('0x49')](_0x15bdfb[_0xd371('0x47')],_0x15bdfb[_0xd371('0x45')]);_0x13c351['attributes']=_[_0xd371('0x49')](_0x15bdfb[_0xd371('0x47')],qs[_0xd371('0x4a')](_0x489210[_0xd371('0x45')]['fields']));_0x13c351[_0xd371('0x48')]=_0x13c351[_0xd371('0x48')]['length']?_0x13c351[_0xd371('0x48')]:_0x15bdfb['model'];_0x13c351[_0xd371('0x4d')]=qs['sort'](_0x489210[_0xd371('0x45')][_0xd371('0x4e')]);_0x13c351[_0xd371('0x4f')]=qs[_0xd371('0x51')](_[_0xd371('0x50')](_0x489210[_0xd371('0x45')],_0x15bdfb[_0xd371('0x51')]));if(_0x489210['query'][_0xd371('0x52')]){_0x13c351['where']=_[_0xd371('0x53')](_0x13c351[_0xd371('0x4f')],{'$or':_[_0xd371('0x3f')](_0x13c351['attributes'],function(_0x93f18e){var _0x5014ab={};_0x5014ab[_0x93f18e]={'$like':'%'+_0x489210[_0xd371('0x45')]['filter']+'%'};return _0x5014ab;})});}_0x13c351=_[_0xd371('0x53')]({},_0x13c351,_0x489210[_0xd371('0x55')]);return _0x1a8e40['getAgents'](_0x13c351);}})['then'](function(_0x5d49af){if(_0x5d49af){_0x1232fc=_0x5d49af[_0xd371('0x4b')];if(!_0x489210['query'][_0xd371('0x6c')](_0xd371('0x4c'))){_0x13c351[_0xd371('0x2f')]=qs[_0xd371('0x2f')](_0x489210[_0xd371('0x45')]['limit']);_0x13c351[_0xd371('0x31')]=qs[_0xd371('0x31')](_0x489210[_0xd371('0x45')][_0xd371('0x31')]);}return _0x1a8e40['getAgents'](_0x13c351);}})[_0xd371('0x22')](function(_0xac13c8){if(_0xac13c8){return _0xac13c8?{'count':_0x1232fc,'rows':_0xac13c8}:null;}})[_0xd371('0x22')](respondWithResult(_0x299f97,null))[_0xd371('0x5a')](handleError(_0x299f97,null));};
\ No newline at end of file
index 2f683c1..496621a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2700=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x36067f,_0xba548e){var _0x44f0b3=function(_0x1954af){while(--_0x1954af){_0x36067f['push'](_0x36067f['shift']());}};_0x44f0b3(++_0xba548e);}(_0x2700,0xc0));var _0x0270=function(_0x4e30c0,_0x534a76){_0x4e30c0=_0x4e30c0-0x0;var _0x5db594=_0x2700[_0x4e30c0];return _0x5db594;};'use strict';var EventEmitter=require(_0x0270('0x0'));var FaxAccount=require(_0x0270('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0270('0x2')](0x0);var events={'afterCreate':_0x0270('0x3'),'afterUpdate':_0x0270('0x4'),'afterDestroy':_0x0270('0x5')};function emitEvent(_0x11bb0f){return function(_0x4e93a3,_0x10b5be,_0x50ce4a){FaxAccountEvents['emit'](_0x11bb0f+':'+_0x4e93a3['id'],_0x4e93a3);FaxAccountEvents['emit'](_0x11bb0f,_0x4e93a3);_0x50ce4a(null);};}for(var e in events){if(events[_0x0270('0x6')](e)){var event=events[e];FaxAccount[_0x0270('0x7')](e,emitEvent(event));}}module[_0x0270('0x8')]=FaxAccountEvents;
\ No newline at end of file
+var _0xfa89=['update','emit','hasOwnProperty','hook','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x8d3f30,_0x4ff433){var _0x385596=function(_0x35d874){while(--_0x35d874){_0x8d3f30['push'](_0x8d3f30['shift']());}};_0x385596(++_0x4ff433);}(_0xfa89,0x64));var _0x9fa8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa89[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x9fa8('0x0'))['db'][_0x9fa8('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x9fa8('0x2')](0x0);var events={'afterCreate':_0x9fa8('0x3'),'afterUpdate':_0x9fa8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2f17dd){return function(_0x44d00b,_0x6c9a9f,_0x1c3e22){FaxAccountEvents[_0x9fa8('0x5')](_0x2f17dd+':'+_0x44d00b['id'],_0x44d00b);FaxAccountEvents[_0x9fa8('0x5')](_0x2f17dd,_0x44d00b);_0x1c3e22(null);};}for(var e in events){if(events[_0x9fa8('0x6')](e)){var event=events[e];FaxAccount[_0x9fa8('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents;
\ No newline at end of file
index 1a7062a..25980ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29c0=['bluebird','request-promise','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x29c0,0x1d6));var _0x029c=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x29c0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x029c('0x0'));var util=require(_0x029c('0x1'));var logger=require(_0x029c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x029c('0x3'));var rp=require(_0x029c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x029c('0x5'));var attributes=require(_0x029c('0x6'));module[_0x029c('0x7')]=function(_0x8ab241,_0x55f87b){return _0x8ab241[_0x029c('0x8')](_0x029c('0x9'),attributes,{'tableName':_0x029c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x25e3=['path','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0x25e58e,_0x563989){var _0x133279=function(_0x45fcd9){while(--_0x45fcd9){_0x25e58e['push'](_0x25e58e['shift']());}};_0x133279(++_0x563989);}(_0x25e3,0x125));var _0x325e=function(_0x53e72f,_0x196c4f){_0x53e72f=_0x53e72f-0x0;var _0x307b1a=_0x25e3[_0x53e72f];return _0x307b1a;};'use strict';var _=require(_0x325e('0x0'));var util=require(_0x325e('0x1'));var logger=require('../../config/logger')(_0x325e('0x2'));var moment=require(_0x325e('0x3'));var BPromise=require(_0x325e('0x4'));var rp=require(_0x325e('0x5'));var fs=require('fs');var path=require(_0x325e('0x6'));var rimraf=require('rimraf');var config=require(_0x325e('0x7'));var attributes=require(_0x325e('0x8'));module[_0x325e('0x9')]=function(_0x1b2d19,_0x491782){return _0x1b2d19[_0x325e('0xa')](_0x325e('0xb'),attributes,{'tableName':_0x325e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fa3ad93..29f1081 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47b1=['from','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','find','CmList','List','Contacts','DESC','FaxApplication','Applications','applications','orderBy','priority','account','length','defaults','create','contact','FaxInteraction','get','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','ContactId','AttachmentId','User','name','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxAccount','FaxAccount','options','raw','where','limit','include','attributes','map','model','debug','NotifyFaxAccount','fax','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','isNil'];(function(_0x292b01,_0x16dd7c){var _0x1830ae=function(_0x17d7ed){while(--_0x17d7ed){_0x292b01['push'](_0x292b01['shift']());}};_0x1830ae(++_0x16dd7c);}(_0x47b1,0x1e6));var _0x147b=function(_0x3a868c,_0x5e7a0b){_0x3a868c=_0x3a868c-0x0;var _0x1aab21=_0x47b1[_0x3a868c];return _0x1aab21;};'use strict';var _=require(_0x147b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x147b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x147b('0x2'));var db=require(_0x147b('0x3'))['db'];var utils=require(_0x147b('0x4'));var logger=require(_0x147b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x147b('0x6')][_0x147b('0x7')]({'port':0x232c});config[_0x147b('0x8')]=_['defaults'](config['redis'],{'host':_0x147b('0x9'),'port':0x18eb});var socket=require(_0x147b('0xa'))(new Redis(config[_0x147b('0x8')]));require(_0x147b('0xb'))[_0x147b('0xc')](socket);function respondWithRpcPromise(_0x24acc6,_0x4b8d1c,_0x25db6f){return new BPromise(function(_0x527437,_0x21481c){return client['request'](_0x24acc6,_0x25db6f)[_0x147b('0xd')](function(_0x5a351e){logger[_0x147b('0xe')](_0x147b('0xf'),_0x4b8d1c,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x4b8d1c,_0x147b('0x10'),JSON[_0x147b('0x11')](_0x5a351e));if(_0x5a351e[_0x147b('0x12')]){if(_0x5a351e[_0x147b('0x12')][_0x147b('0x13')]===0x1f4){logger[_0x147b('0x12')](_0x147b('0xf'),_0x4b8d1c,_0x5a351e[_0x147b('0x12')][_0x147b('0x14')]);return _0x21481c(_0x5a351e[_0x147b('0x12')][_0x147b('0x14')]);}logger[_0x147b('0x12')](_0x147b('0xf'),_0x4b8d1c,_0x5a351e[_0x147b('0x12')][_0x147b('0x14')]);return _0x527437(_0x5a351e[_0x147b('0x12')][_0x147b('0x14')]);}else{logger[_0x147b('0xe')]('FaxAccount,\x20%s,\x20%s',_0x4b8d1c,_0x147b('0x10'));_0x527437(_0x5a351e[_0x147b('0x15')][_0x147b('0x14')]);}})[_0x147b('0x16')](function(_0x4962cc){logger['error'](_0x147b('0xf'),_0x4b8d1c,_0x4962cc);_0x21481c(_0x4962cc);});});}exports[_0x147b('0x17')]=function(_0x2aa67a){var _0x5e2298=this;return new Promise(function(_0x4c67ac,_0x238700){return db[_0x147b('0x18')]['findAll']({'raw':_0x2aa67a['options']?_0x2aa67a[_0x147b('0x19')][_0x147b('0x1a')]===undefined?!![]:![]:!![],'where':_0x2aa67a[_0x147b('0x19')]?_0x2aa67a[_0x147b('0x19')][_0x147b('0x1b')]||null:null,'attributes':_0x2aa67a[_0x147b('0x19')]?_0x2aa67a[_0x147b('0x19')]['attributes']||null:null,'limit':_0x2aa67a[_0x147b('0x19')]?_0x2aa67a[_0x147b('0x19')][_0x147b('0x1c')]||null:null,'include':_0x2aa67a[_0x147b('0x19')]?_0x2aa67a[_0x147b('0x19')][_0x147b('0x1d')]?_['map'](_0x2aa67a[_0x147b('0x19')]['include'],function(_0xca4efe){return{'model':db[_0xca4efe['model']],'as':_0xca4efe['as'],'attributes':_0xca4efe[_0x147b('0x1e')],'include':_0xca4efe[_0x147b('0x1d')]?_[_0x147b('0x1f')](_0xca4efe[_0x147b('0x1d')],function(_0x337962){return{'model':db[_0x337962[_0x147b('0x20')]],'as':_0x337962['as'],'attributes':_0x337962[_0x147b('0x1e')],'include':_0x337962[_0x147b('0x1d')]?_[_0x147b('0x1f')](_0x337962[_0x147b('0x1d')],function(_0xb615c5){return{'model':db[_0xb615c5[_0x147b('0x20')]],'as':_0xb615c5['as'],'attributes':_0xb615c5[_0x147b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d388e){logger['info']('GetFaxAccount',_0x2aa67a);logger[_0x147b('0x21')](_0x147b('0x17'),_0x2aa67a,JSON[_0x147b('0x11')](_0x2d388e));_0x4c67ac(_0x2d388e);})[_0x147b('0x16')](function(_0x409f83){logger[_0x147b('0x12')]('GetFaxAccount',_0x409f83['message'],_0x2aa67a);_0x238700(_0x5e2298[_0x147b('0x12')](0x1f4,_0x409f83['message']));});});};exports[_0x147b('0x22')]=function(_0x5a8358,_0x424e1b,_0x3eaa5c){var _0x210721=this;return new Promise(function(_0x5031c0,_0x2333f0){var _0x4ca3b5={'body':_0x5a8358['body'],'channel':_0x147b('0x23')};var _0x585466=[];var _0x410ce8=[];var _0x273f35={};return db[_0x147b('0x24')][_0x147b('0x25')]()[_0x147b('0xd')](function(_0xd41669){if(!_0xd41669){throw new db[(_0x147b('0x26'))]['ValidationError'](_0x147b('0x27'));}_0x585466=_[_0x147b('0x28')](_[_0x147b('0x29')](_0xd41669),[_0x147b('0x2a'),_0x147b('0x2b')]);_0x410ce8=_[_0x147b('0x28')](_[_0x147b('0x29')](_0xd41669),[_0x147b('0x2a'),'updatedAt',_0x147b('0x2c'),_0x147b('0x2d')]);if(_0x5a8358[_0x147b('0x2e')]['id']){delete _0x5a8358[_0x147b('0x2e')]['id'];}if(_[_0x147b('0x2f')](_0x5a8358['body'][_0x147b('0x30')])){throw new db[(_0x147b('0x26'))][(_0x147b('0x31'))](_0x147b('0x32'));}if(_[_0x147b('0x2f')](_0x5a8358['body'][_0x147b('0x2e')])||_0x5a8358[_0x147b('0x2e')][_0x147b('0x2e')]===''){throw new db[(_0x147b('0x26'))][(_0x147b('0x31'))](_0x147b('0x33'));}if(_[_0x147b('0x2f')](_0x5a8358[_0x147b('0x2e')][_0x147b('0x34')])){throw new db[(_0x147b('0x26'))]['ValidationError'](_0x147b('0x35')+_0x410ce8);}if(!_[_0x147b('0x36')](_0x410ce8,_0x5a8358[_0x147b('0x2e')]['mapKey'])){throw new db[(_0x147b('0x26'))][(_0x147b('0x31'))](_0x147b('0x37')+_0x410ce8);}_0x273f35[_0x5a8358[_0x147b('0x2e')]['mapKey']]=_0x5a8358['body'][_0x147b('0x30')];})['then'](function(){return db[_0x147b('0x18')][_0x147b('0x38')]({'where':{'id':_0x5a8358['account']['id']},'include':[{'model':db[_0x147b('0x39')],'as':_0x147b('0x3a'),'include':[{'model':db[_0x147b('0x24')],'as':_0x147b('0x3b'),'where':_0x273f35,'limit':0x1,'order':[[_0x147b('0x2b'),_0x147b('0x3c')]]}]},{'model':db[_0x147b('0x3d')],'as':_0x147b('0x3e')}]});})[_0x147b('0xd')](function(_0x588426){if(_0x588426&&_0x588426[_0x147b('0x3a')]){var _0x2f0dff=_0x588426['get']({'plain':!![]});_0x4ca3b5['account']=_0x2f0dff;_0x4ca3b5[_0x147b('0x3f')]=_0x2f0dff[_0x147b('0x3e')];_0x4ca3b5['list']=_0x2f0dff[_0x147b('0x3a')];_0x4ca3b5['applications']=_[_0x147b('0x40')](_0x4ca3b5[_0x147b('0x3f')],[_0x147b('0x41')],['asc']);if(_0x4ca3b5[_0x147b('0x42')][_0x147b('0x3e')]){delete _0x4ca3b5[_0x147b('0x42')][_0x147b('0x3e')];}if(_0x4ca3b5[_0x147b('0x42')][_0x147b('0x3a')]&&_0x4ca3b5['account'][_0x147b('0x3a')][_0x147b('0x3b')][_0x147b('0x43')]){return _0x4ca3b5['account'][_0x147b('0x3a')]['Contacts'][0x0];}var _0x43abb2=_[_0x147b('0x44')](_0x5a8358[_0x147b('0x2e')],{'firstName':_0x5a8358[_0x147b('0x2e')][_0x147b('0x30')],'ListId':_0x2f0dff[_0x147b('0x2d')]});_0x43abb2[_0x5a8358[_0x147b('0x2e')][_0x147b('0x34')]]=_0x5a8358['body'][_0x147b('0x30')];return db['CmContact'][_0x147b('0x45')](_0x43abb2,{'fields':_0x585466,'raw':!![]});}})['then'](function(_0x2569e3){_0x4ca3b5[_0x147b('0x46')]=_0x2569e3;if(_0x2569e3){var _0x4dc104={'ContactId':_0x2569e3['id'],'FaxAccountId':_0x5a8358[_0x147b('0x42')]['id'],'fax':_0x2569e3['fax']};return db['FaxInteraction'][_0x147b('0x38')]({'where':{'ContactId':_0x2569e3['id'],'closed':![],'FaxAccountId':_0x5a8358[_0x147b('0x42')]['id']}})[_0x147b('0xd')](function(_0x1d7fd9){if(_0x1d7fd9){return[_0x1d7fd9,![]];}return db[_0x147b('0x47')]['create'](_0x4dc104)['then'](function(_0x4999a0){return[_0x4999a0,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x1e2b89,_0x1b8a8b){var _0x5c144a=_0x1e2b89[_0x147b('0x48')]({'plain':!![]});if(_0x1b8a8b){if(_0x4ca3b5[_0x147b('0x42')][_0x147b('0x49')]){_0x4ca3b5[_0x147b('0x3f')][_0x147b('0x4a')]({'id':0x0,'priority':_0x4ca3b5[_0x147b('0x3f')][_0x147b('0x43')]+0x1,'app':_0x147b('0x4b'),'appdata':_0x147b('0x4c'),'interval':_0x147b('0x4d')});}_0x5c144a[_0x147b('0x4e')]=!![];}else{_0x5c144a[_0x147b('0x4e')]=![];}_0x4ca3b5[_0x147b('0x4f')]=_0x5c144a;return db['FaxMessage'][_0x147b('0x45')]({'body':_0x5a8358[_0x147b('0x2e')]['body'],'FaxAccountId':_0x5a8358[_0x147b('0x42')]['id'],'FaxInteractionId':_0x1e2b89['id'],'direction':'in','ContactId':_0x1e2b89[_0x147b('0x50')],'AttachmentId':_0x5a8358[_0x147b('0x2e')][_0x147b('0x51')]});})['then'](function(_0x3a7e51){_0x4ca3b5[_0x147b('0x14')]=_0x3a7e51;if(_0x4ca3b5['interaction']['UserId']){return db[_0x147b('0x52')][_0x147b('0x38')]({'attributes':['id',_0x147b('0x53')],'where':{'id':_0x4ca3b5[_0x147b('0x4f')][_0x147b('0x54')]}})['then'](function(_0x242b5d){if(_0x242b5d){_0x4ca3b5[_0x147b('0x3f')][_0x147b('0x55')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x242b5d[_0x147b('0x53')]+','+(_0x4ca3b5[_0x147b('0x42')][_0x147b('0x56')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x147b('0x57'),_0x147b('0x58'),_0x4ca3b5);});}return respondWithRpcPromise(_0x147b('0x57'),_0x147b('0x58'),_0x4ca3b5);})[_0x147b('0xd')](function(_0x3c94de){_0x5031c0(_0x3c94de);})[_0x147b('0x16')](function(_0x14bed0){_0x2333f0(_0x210721[_0x147b('0x12')](0x1f4,_0x14bed0['message']));});});};
\ No newline at end of file
+var _0x9c20=['from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','List','CmContact','Contacts','DESC','FaxApplication','Applications','get','list','applications','orderBy','asc','length','defaults','create','FaxInteraction','close','unmanaged','created','interaction','FaxMessage','AttachmentId','UserId','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxAccount','findAll','options','raw','attributes','limit','include','model','map','debug','catch','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','isNil','from'];(function(_0x56e0e8,_0x16ef91){var _0x2dab50=function(_0x4fe720){while(--_0x4fe720){_0x56e0e8['push'](_0x56e0e8['shift']());}};_0x2dab50(++_0x16ef91);}(_0x9c20,0xcd));var _0x09c2=function(_0x3ff811,_0x5be877){_0x3ff811=_0x3ff811-0x0;var _0x326566=_0x9c20[_0x3ff811];return _0x326566;};'use strict';var _=require(_0x09c2('0x0'));var util=require('util');var moment=require(_0x09c2('0x1'));var BPromise=require('bluebird');var rs=require(_0x09c2('0x2'));var fs=require('fs');var Redis=require(_0x09c2('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09c2('0x4'));var logger=require('../../config/logger')(_0x09c2('0x5'));var config=require(_0x09c2('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x09c2('0x7')][_0x09c2('0x8')]({'port':0x232c});config['redis']=_['defaults'](config[_0x09c2('0x9')],{'host':_0x09c2('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x09c2('0x9')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x4e6ff1,_0x27109e,_0x1f1f32){return new BPromise(function(_0x53d0b5,_0x1345b0){return client[_0x09c2('0xb')](_0x4e6ff1,_0x1f1f32)[_0x09c2('0xc')](function(_0x541fd0){logger[_0x09c2('0xd')](_0x09c2('0xe'),_0x27109e,_0x09c2('0xf'));logger['debug'](_0x09c2('0x10'),_0x27109e,_0x09c2('0xf'),JSON[_0x09c2('0x11')](_0x541fd0));if(_0x541fd0[_0x09c2('0x12')]){if(_0x541fd0[_0x09c2('0x12')][_0x09c2('0x13')]===0x1f4){logger[_0x09c2('0x12')](_0x09c2('0xe'),_0x27109e,_0x541fd0[_0x09c2('0x12')][_0x09c2('0x14')]);return _0x1345b0(_0x541fd0[_0x09c2('0x12')][_0x09c2('0x14')]);}logger['error'](_0x09c2('0xe'),_0x27109e,_0x541fd0[_0x09c2('0x12')][_0x09c2('0x14')]);return _0x53d0b5(_0x541fd0[_0x09c2('0x12')][_0x09c2('0x14')]);}else{logger[_0x09c2('0xd')](_0x09c2('0xe'),_0x27109e,_0x09c2('0xf'));_0x53d0b5(_0x541fd0[_0x09c2('0x15')][_0x09c2('0x14')]);}})['catch'](function(_0x59b177){logger['error'](_0x09c2('0xe'),_0x27109e,_0x59b177);_0x1345b0(_0x59b177);});});}exports[_0x09c2('0x16')]=function(_0x5dbb5d){var _0x2582ff=this;return new Promise(function(_0x361951,_0x52b8f1){return db['FaxAccount'][_0x09c2('0x17')]({'raw':_0x5dbb5d[_0x09c2('0x18')]?_0x5dbb5d['options'][_0x09c2('0x19')]===undefined?!![]:![]:!![],'where':_0x5dbb5d['options']?_0x5dbb5d['options']['where']||null:null,'attributes':_0x5dbb5d['options']?_0x5dbb5d[_0x09c2('0x18')][_0x09c2('0x1a')]||null:null,'limit':_0x5dbb5d[_0x09c2('0x18')]?_0x5dbb5d[_0x09c2('0x18')][_0x09c2('0x1b')]||null:null,'include':_0x5dbb5d[_0x09c2('0x18')]?_0x5dbb5d[_0x09c2('0x18')][_0x09c2('0x1c')]?_['map'](_0x5dbb5d[_0x09c2('0x18')][_0x09c2('0x1c')],function(_0x49c05e){return{'model':db[_0x49c05e[_0x09c2('0x1d')]],'as':_0x49c05e['as'],'attributes':_0x49c05e['attributes'],'include':_0x49c05e[_0x09c2('0x1c')]?_['map'](_0x49c05e[_0x09c2('0x1c')],function(_0x1c70e8){return{'model':db[_0x1c70e8[_0x09c2('0x1d')]],'as':_0x1c70e8['as'],'attributes':_0x1c70e8[_0x09c2('0x1a')],'include':_0x1c70e8[_0x09c2('0x1c')]?_[_0x09c2('0x1e')](_0x1c70e8['include'],function(_0x5b7c5c){return{'model':db[_0x5b7c5c[_0x09c2('0x1d')]],'as':_0x5b7c5c['as'],'attributes':_0x5b7c5c[_0x09c2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x09c2('0xc')](function(_0x5d39a8){logger['info'](_0x09c2('0x16'),_0x5dbb5d);logger[_0x09c2('0x1f')](_0x09c2('0x16'),_0x5dbb5d,JSON[_0x09c2('0x11')](_0x5d39a8));_0x361951(_0x5d39a8);})[_0x09c2('0x20')](function(_0x1a4977){logger['error']('GetFaxAccount',_0x1a4977[_0x09c2('0x14')],_0x5dbb5d);_0x52b8f1(_0x2582ff[_0x09c2('0x12')](0x1f4,_0x1a4977[_0x09c2('0x14')]));});});};exports[_0x09c2('0x21')]=function(_0x375f3a,_0x153c0a,_0x387b43){var _0x1cdde6=this;return new Promise(function(_0x56980b,_0x306254){var _0x2f8b01={'body':_0x375f3a[_0x09c2('0x22')],'channel':_0x09c2('0x23')};var _0x49df58=[];var _0x4cfcb1=[];var _0x31081e={};return db['CmContact'][_0x09c2('0x24')]()['then'](function(_0x5d984f){if(!_0x5d984f){throw new db[(_0x09c2('0x25'))][(_0x09c2('0x26'))](_0x09c2('0x27'));}_0x49df58=_[_0x09c2('0x28')](_['keys'](_0x5d984f),['createdAt',_0x09c2('0x29')]);_0x4cfcb1=_[_0x09c2('0x28')](_['keys'](_0x5d984f),[_0x09c2('0x2a'),_0x09c2('0x29'),_0x09c2('0x2b'),_0x09c2('0x2c')]);if(_0x375f3a['body']['id']){delete _0x375f3a[_0x09c2('0x22')]['id'];}if(_[_0x09c2('0x2d')](_0x375f3a[_0x09c2('0x22')][_0x09c2('0x2e')])){throw new db['Sequelize']['ValidationError'](_0x09c2('0x2f'));}if(_[_0x09c2('0x2d')](_0x375f3a[_0x09c2('0x22')][_0x09c2('0x22')])||_0x375f3a[_0x09c2('0x22')][_0x09c2('0x22')]===''){throw new db[(_0x09c2('0x25'))]['ValidationError'](_0x09c2('0x30'));}if(_[_0x09c2('0x2d')](_0x375f3a['body'][_0x09c2('0x31')])){throw new db['Sequelize'][(_0x09c2('0x26'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4cfcb1);}if(!_[_0x09c2('0x32')](_0x4cfcb1,_0x375f3a[_0x09c2('0x22')][_0x09c2('0x31')])){throw new db['Sequelize'][(_0x09c2('0x26'))](_0x09c2('0x33')+_0x4cfcb1);}_0x31081e[_0x375f3a[_0x09c2('0x22')][_0x09c2('0x31')]]=_0x375f3a[_0x09c2('0x22')][_0x09c2('0x2e')];})[_0x09c2('0xc')](function(){return db[_0x09c2('0x34')][_0x09c2('0x35')]({'where':{'id':_0x375f3a[_0x09c2('0x36')]['id']},'include':[{'model':db['CmList'],'as':_0x09c2('0x37'),'include':[{'model':db[_0x09c2('0x38')],'as':_0x09c2('0x39'),'where':_0x31081e,'limit':0x1,'order':[['updatedAt',_0x09c2('0x3a')]]}]},{'model':db[_0x09c2('0x3b')],'as':_0x09c2('0x3c')}]});})[_0x09c2('0xc')](function(_0x13523a){if(_0x13523a&&_0x13523a[_0x09c2('0x37')]){var _0x32cbfd=_0x13523a[_0x09c2('0x3d')]({'plain':!![]});_0x2f8b01['account']=_0x32cbfd;_0x2f8b01['applications']=_0x32cbfd['Applications'];_0x2f8b01[_0x09c2('0x3e')]=_0x32cbfd[_0x09c2('0x37')];_0x2f8b01[_0x09c2('0x3f')]=_[_0x09c2('0x40')](_0x2f8b01[_0x09c2('0x3f')],['priority'],[_0x09c2('0x41')]);if(_0x2f8b01['account'][_0x09c2('0x3c')]){delete _0x2f8b01[_0x09c2('0x36')][_0x09c2('0x3c')];}if(_0x2f8b01[_0x09c2('0x36')]['List']&&_0x2f8b01[_0x09c2('0x36')][_0x09c2('0x37')][_0x09c2('0x39')][_0x09c2('0x42')]){return _0x2f8b01[_0x09c2('0x36')][_0x09c2('0x37')][_0x09c2('0x39')][0x0];}var _0x3fe893=_[_0x09c2('0x43')](_0x375f3a[_0x09c2('0x22')],{'firstName':_0x375f3a['body'][_0x09c2('0x2e')],'ListId':_0x32cbfd[_0x09c2('0x2c')]});_0x3fe893[_0x375f3a[_0x09c2('0x22')]['mapKey']]=_0x375f3a[_0x09c2('0x22')][_0x09c2('0x2e')];return db[_0x09c2('0x38')][_0x09c2('0x44')](_0x3fe893,{'fields':_0x49df58,'raw':!![]});}})[_0x09c2('0xc')](function(_0x3243d1){_0x2f8b01['contact']=_0x3243d1;if(_0x3243d1){var _0x3cf784={'ContactId':_0x3243d1['id'],'FaxAccountId':_0x375f3a[_0x09c2('0x36')]['id'],'fax':_0x3243d1[_0x09c2('0x23')]};return db[_0x09c2('0x45')][_0x09c2('0x35')]({'where':{'ContactId':_0x3243d1['id'],'closed':![],'FaxAccountId':_0x375f3a[_0x09c2('0x36')]['id']}})['then'](function(_0x16f6c9){if(_0x16f6c9){return[_0x16f6c9,![]];}return db['FaxInteraction']['create'](_0x3cf784)['then'](function(_0x170723){return[_0x170723,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x207968,_0x5e40b1){var _0x4764ae=_0x207968['get']({'plain':!![]});if(_0x5e40b1){if(_0x2f8b01['account']['autoclose']){_0x2f8b01['applications']['push']({'id':0x0,'priority':_0x2f8b01[_0x09c2('0x3f')][_0x09c2('0x42')]+0x1,'app':_0x09c2('0x46'),'appdata':_0x09c2('0x47'),'interval':'*,*,*,*'});}_0x4764ae[_0x09c2('0x48')]=!![];}else{_0x4764ae[_0x09c2('0x48')]=![];}_0x2f8b01[_0x09c2('0x49')]=_0x4764ae;return db[_0x09c2('0x4a')][_0x09c2('0x44')]({'body':_0x375f3a['body'][_0x09c2('0x22')],'FaxAccountId':_0x375f3a[_0x09c2('0x36')]['id'],'FaxInteractionId':_0x207968['id'],'direction':'in','ContactId':_0x207968['ContactId'],'AttachmentId':_0x375f3a[_0x09c2('0x22')][_0x09c2('0x4b')]});})[_0x09c2('0xc')](function(_0x5d9fc5){_0x2f8b01['message']=_0x5d9fc5;if(_0x2f8b01[_0x09c2('0x49')][_0x09c2('0x4c')]){return db['User'][_0x09c2('0x35')]({'attributes':['id','name'],'where':{'id':_0x2f8b01[_0x09c2('0x49')][_0x09c2('0x4c')]}})['then'](function(_0x2de19d){if(_0x2de19d){_0x2f8b01[_0x09c2('0x3f')][_0x09c2('0x4d')]({'id':0x0,'priority':0x0,'app':_0x09c2('0x4e'),'appdata':_0x2de19d[_0x09c2('0x4f')]+','+(_0x2f8b01[_0x09c2('0x36')][_0x09c2('0x50')]||0xa),'interval':_0x09c2('0x51')});}return respondWithRpcPromise(_0x09c2('0x52'),_0x09c2('0x53'),_0x2f8b01);});}return respondWithRpcPromise(_0x09c2('0x52'),'startRouting',_0x2f8b01);})['then'](function(_0x51259e){_0x56980b(_0x51259e);})[_0x09c2('0x20')](function(_0x28677f){_0x306254(_0x1cdde6[_0x09c2('0x12')](0x1f4,_0x28677f[_0x09c2('0x14')]));});});};
\ No newline at end of file
index 5446dbb..af83ba8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3e0=['./faxAccount.events','save','remove','update','emit','removeListener','register','faxAccount:'];(function(_0x2bddf9,_0x22c873){var _0x3f3ae9=function(_0x2d91ac){while(--_0x2d91ac){_0x2bddf9['push'](_0x2bddf9['shift']());}};_0x3f3ae9(++_0x22c873);}(_0xf3e0,0xb8));var _0x0f3e=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0xf3e0[_0x12f688];return _0x59c3de;};'use strict';var FaxAccountEvents=require(_0x0f3e('0x0'));var events=[_0x0f3e('0x1'),_0x0f3e('0x2'),_0x0f3e('0x3')];function createListener(_0xd782bf,_0x2b89cb){return function(_0x4c97f6){_0x2b89cb[_0x0f3e('0x4')](_0xd782bf,_0x4c97f6);};}function removeListener(_0x4a8476,_0xecdea1){return function(){FaxAccountEvents[_0x0f3e('0x5')](_0x4a8476,_0xecdea1);};}exports[_0x0f3e('0x6')]=function(_0x37099a){for(var _0xf553ab=0x0,_0x22c6fd=events['length'];_0xf553ab<_0x22c6fd;_0xf553ab++){var _0xd03654=events[_0xf553ab];var _0x3755a5=createListener(_0x0f3e('0x7')+_0xd03654,_0x37099a);FaxAccountEvents['on'](_0xd03654,_0x3755a5);}};
\ No newline at end of file
+var _0x94e9=['faxAccount:','remove','emit','removeListener'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x94e9,0x14d));var _0x994e=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x94e9[_0x47e7cb];return _0x2a8874;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=['save',_0x994e('0x0'),'update'];function createListener(_0x3047b0,_0x3edfd6){return function(_0x4739c4){_0x3edfd6[_0x994e('0x1')](_0x3047b0,_0x4739c4);};}function removeListener(_0x190cc3,_0x278a3c){return function(){FaxAccountEvents[_0x994e('0x2')](_0x190cc3,_0x278a3c);};}exports['register']=function(_0xedb24a){for(var _0x4b393d=0x0,_0x4a6bbb=events['length'];_0x4b393d<_0x4a6bbb;_0x4b393d++){var _0x165280=events[_0x4b393d];var _0x3a4c9c=createListener(_0x994e('0x3')+_0x165280,_0xedb24a);FaxAccountEvents['on'](_0x165280,_0x3a4c9c);}};
\ No newline at end of file
index d439f20..90c37aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x9621dc,_0x357367){var _0x2e7a67=function(_0x280bfd){while(--_0x280bfd){_0x9621dc['push'](_0x9621dc['shift']());}};_0x2e7a67(++_0x357367);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x233369,_0x5be2c9){var _0x40a709=function(_0x10bfcd){while(--_0x10bfcd){_0x233369['push'](_0x233369['shift']());}};_0x40a709(++_0x5be2c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
index 5eb2410..3dbb395 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7ff=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x470925,_0x3c14fc){var _0x53a5a3=function(_0x38facc){while(--_0x38facc){_0x470925['push'](_0x470925['shift']());}};_0x53a5a3(++_0x3c14fc);}(_0xb7ff,0xa5));var _0xfb7f=function(_0x172afe,_0x471612){_0x172afe=_0x172afe-0x0;var _0x503473=_0xb7ff[_0x172afe];return _0x503473;};'use strict';var Sequelize=require(_0xfb7f('0x0'));module[_0xfb7f('0x1')]={'priority':{'type':Sequelize[_0xfb7f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfb7f('0x3')],'allowNull':![],'defaultValue':_0xfb7f('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xfb7f('0x5')}};
\ No newline at end of file
+var _0x547c=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x547c,0x13b));var _0xc547=function(_0x5a7bd6,_0x3ed838){_0x5a7bd6=_0x5a7bd6-0x0;var _0x490f39=_0x547c[_0x5a7bd6];return _0x490f39;};'use strict';var Sequelize=require('sequelize');module[_0xc547('0x0')]={'priority':{'type':Sequelize[_0xc547('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc547('0x2')],'allowNull':![],'defaultValue':_0xc547('0x3')},'appdata':{'type':Sequelize[_0xc547('0x4')]()},'description':{'type':Sequelize[_0xc547('0x2')]},'interval':{'type':Sequelize[_0xc547('0x2')],'defaultValue':_0xc547('0x5')}};
\ No newline at end of file
index 09d5191..43b0de5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74bf=['map','FaxApplication','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','index'];(function(_0x53d650,_0x568746){var _0x535951=function(_0x500b59){while(--_0x500b59){_0x53d650['push'](_0x53d650['shift']());}};_0x535951(++_0x568746);}(_0x74bf,0x18e));var _0xf74b=function(_0x2c98be,_0x4c985f){_0x2c98be=_0x2c98be-0x0;var _0x45747d=_0x74bf[_0x2c98be];return _0x45747d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf74b('0x0'));var zipdir=require(_0xf74b('0x1'));var jsonpatch=require(_0xf74b('0x2'));var rp=require(_0xf74b('0x3'));var moment=require(_0xf74b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf74b('0x5'));var path=require(_0xf74b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf74b('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf74b('0x8'));var squel=require('squel');var crypto=require(_0xf74b('0x9'));var jsforce=require(_0xf74b('0xa'));var deskjs=require(_0xf74b('0xb'));var toCsv=require(_0xf74b('0xc'));var querystring=require('querystring');var Papa=require(_0xf74b('0xd'));var Redis=require('ioredis');var authService=require(_0xf74b('0xe'));var qs=require(_0xf74b('0xf'));var as=require(_0xf74b('0x10'));var hardwareService=require(_0xf74b('0x11'));var logger=require(_0xf74b('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xf74b('0x13'));var licenseUtil=require(_0xf74b('0x14'));var db=require(_0xf74b('0x15'))['db'];function respondWithStatusCode(_0x11188a,_0x27a426){_0x27a426=_0x27a426||0xcc;return function(_0x4abb48){if(_0x4abb48){return _0x11188a['sendStatus'](_0x27a426);}return _0x11188a[_0xf74b('0x16')](_0x27a426)[_0xf74b('0x17')]();};}function respondWithResult(_0x29acd2,_0x4742e1){_0x4742e1=_0x4742e1||0xc8;return function(_0xa67c79){if(_0xa67c79){return _0x29acd2['status'](_0x4742e1)['json'](_0xa67c79);}};}function respondWithFilteredResult(_0x366ff8,_0x532030){return function(_0x1a66dc){if(_0x1a66dc){var _0x16af08=typeof _0x532030['offset']==='undefined'&&typeof _0x532030[_0xf74b('0x18')]===_0xf74b('0x19');var _0x180688=_0x1a66dc['count'];var _0x173550=_0x16af08?0x0:_0x532030['offset'];var _0x1afcb0=_0x16af08?_0x1a66dc[_0xf74b('0x1a')]:_0x532030[_0xf74b('0x1b')]+_0x532030['limit'];var _0x10d29e;if(_0x1afcb0>=_0x180688){_0x1afcb0=_0x180688;_0x10d29e=0xc8;}else{_0x10d29e=0xce;}_0x366ff8[_0xf74b('0x16')](_0x10d29e);return _0x366ff8[_0xf74b('0x1c')](_0xf74b('0x1d'),_0x173550+'-'+_0x1afcb0+'/'+_0x180688)[_0xf74b('0x1e')](_0x1a66dc);}return null;};}function patchUpdates(_0x267a46){return function(_0x1cb627){try{jsonpatch[_0xf74b('0x1f')](_0x1cb627,_0x267a46,!![]);}catch(_0x1ecb9a){return BPromise[_0xf74b('0x20')](_0x1ecb9a);}return _0x1cb627[_0xf74b('0x21')]();};}function saveUpdates(_0x1ec9ad,_0x526690){return function(_0x4cb1f5){if(_0x4cb1f5){return _0x4cb1f5['update'](_0x1ec9ad)[_0xf74b('0x22')](function(_0x5ec9f9){return _0x5ec9f9;});}return null;};}function removeEntity(_0x219cdd,_0x51bcc6){return function(_0x16779f){if(_0x16779f){return _0x16779f['destroy']()[_0xf74b('0x22')](function(){_0x219cdd[_0xf74b('0x16')](0xcc)[_0xf74b('0x17')]();});}};}function handleEntityNotFound(_0x46bb13,_0x4a18c7){return function(_0x503204){if(!_0x503204){_0x46bb13[_0xf74b('0x23')](0x194);}return _0x503204;};}function handleError(_0x254ded,_0x5de429){_0x5de429=_0x5de429||0x1f4;return function(_0x4a4f5b){logger[_0xf74b('0x24')](_0x4a4f5b[_0xf74b('0x25')]);if(_0x4a4f5b[_0xf74b('0x26')]){delete _0x4a4f5b[_0xf74b('0x26')];}_0x254ded['status'](_0x5de429)['send'](_0x4a4f5b);};}exports[_0xf74b('0x27')]=function(_0x487543,_0x28744a){var _0x1b65c4={},_0x575fbb={},_0x3a370f={'count':0x0,'rows':[]};var _0x1564f3=_[_0xf74b('0x28')](db[_0xf74b('0x29')][_0xf74b('0x2a')],function(_0x39ba03){return{'name':_0x39ba03[_0xf74b('0x2b')],'type':_0x39ba03[_0xf74b('0x2c')][_0xf74b('0x2d')]};});_0x575fbb['model']=_[_0xf74b('0x28')](_0x1564f3,_0xf74b('0x26'));_0x575fbb[_0xf74b('0x2e')]=_[_0xf74b('0x2f')](_0x487543[_0xf74b('0x2e')]);_0x575fbb['filters']=_['intersection'](_0x575fbb[_0xf74b('0x30')],_0x575fbb[_0xf74b('0x2e')]);_0x1b65c4[_0xf74b('0x31')]=_[_0xf74b('0x32')](_0x575fbb['model'],qs[_0xf74b('0x33')](_0x487543['query'][_0xf74b('0x33')]));_0x1b65c4[_0xf74b('0x31')]=_0x1b65c4[_0xf74b('0x31')][_0xf74b('0x34')]?_0x1b65c4['attributes']:_0x575fbb['model'];if(!_0x487543['query'][_0xf74b('0x35')]('nolimit')){_0x1b65c4[_0xf74b('0x18')]=qs[_0xf74b('0x18')](_0x487543[_0xf74b('0x2e')][_0xf74b('0x18')]);_0x1b65c4[_0xf74b('0x1b')]=qs[_0xf74b('0x1b')](_0x487543[_0xf74b('0x2e')][_0xf74b('0x1b')]);}_0x1b65c4['order']=qs['sort'](_0x487543[_0xf74b('0x2e')][_0xf74b('0x36')]);_0x1b65c4[_0xf74b('0x37')]=qs[_0xf74b('0x38')](_[_0xf74b('0x39')](_0x487543[_0xf74b('0x2e')],_0x575fbb[_0xf74b('0x38')]),_0x1564f3);if(_0x487543[_0xf74b('0x2e')][_0xf74b('0x3a')]){_0x1b65c4[_0xf74b('0x37')]=_['merge'](_0x1b65c4['where'],{'$or':_[_0xf74b('0x28')](_0x1564f3,function(_0x166fa6){if(_0x166fa6[_0xf74b('0x2c')]!==_0xf74b('0x3b')){var _0x4c89ba={};_0x4c89ba[_0x166fa6[_0xf74b('0x26')]]={'$like':'%'+_0x487543[_0xf74b('0x2e')][_0xf74b('0x3a')]+'%'};return _0x4c89ba;}})});}_0x1b65c4=_[_0xf74b('0x3c')]({},_0x1b65c4,_0x487543[_0xf74b('0x3d')]);var _0x1dd228={'where':_0x1b65c4[_0xf74b('0x37')]};return db['FaxApplication'][_0xf74b('0x1a')](_0x1dd228)[_0xf74b('0x22')](function(_0x44d616){_0x3a370f[_0xf74b('0x1a')]=_0x44d616;if(_0x487543[_0xf74b('0x2e')][_0xf74b('0x3e')]){_0x1b65c4[_0xf74b('0x3f')]=[{'all':!![]}];}return db[_0xf74b('0x29')][_0xf74b('0x40')](_0x1b65c4);})[_0xf74b('0x22')](function(_0x17b79d){_0x3a370f['rows']=_0x17b79d;return _0x3a370f;})[_0xf74b('0x22')](respondWithFilteredResult(_0x28744a,_0x1b65c4))[_0xf74b('0x41')](handleError(_0x28744a,null));};exports[_0xf74b('0x42')]=function(_0xd5a129,_0x50391b){var _0x2f570d={'raw':!![],'where':{'id':_0xd5a129[_0xf74b('0x43')]['id']}},_0x6da965={};_0x6da965[_0xf74b('0x30')]=_[_0xf74b('0x2f')](db[_0xf74b('0x29')][_0xf74b('0x2a')]);_0x6da965[_0xf74b('0x2e')]=_[_0xf74b('0x2f')](_0xd5a129['query']);_0x6da965[_0xf74b('0x38')]=_[_0xf74b('0x32')](_0x6da965[_0xf74b('0x30')],_0x6da965[_0xf74b('0x2e')]);_0x2f570d[_0xf74b('0x31')]=_[_0xf74b('0x32')](_0x6da965[_0xf74b('0x30')],qs[_0xf74b('0x33')](_0xd5a129[_0xf74b('0x2e')][_0xf74b('0x33')]));_0x2f570d[_0xf74b('0x31')]=_0x2f570d[_0xf74b('0x31')][_0xf74b('0x34')]?_0x2f570d[_0xf74b('0x31')]:_0x6da965[_0xf74b('0x30')];if(_0xd5a129[_0xf74b('0x2e')][_0xf74b('0x3e')]){_0x2f570d[_0xf74b('0x3f')]=[{'all':!![]}];}_0x2f570d=_['merge']({},_0x2f570d,_0xd5a129['options']);return db[_0xf74b('0x29')][_0xf74b('0x44')](_0x2f570d)[_0xf74b('0x22')](handleEntityNotFound(_0x50391b,null))['then'](respondWithResult(_0x50391b,null))['catch'](handleError(_0x50391b,null));};exports['create']=function(_0x4ea4ee,_0x1485f8){return db[_0xf74b('0x29')][_0xf74b('0x45')](_0x4ea4ee[_0xf74b('0x46')],{})[_0xf74b('0x22')](respondWithResult(_0x1485f8,0xc9))['catch'](handleError(_0x1485f8,null));};exports[_0xf74b('0x47')]=function(_0xba35e,_0x54b00a){if(_0xba35e['body']['id']){delete _0xba35e[_0xf74b('0x46')]['id'];}return db[_0xf74b('0x29')][_0xf74b('0x44')]({'where':{'id':_0xba35e['params']['id']}})['then'](handleEntityNotFound(_0x54b00a,null))[_0xf74b('0x22')](saveUpdates(_0xba35e[_0xf74b('0x46')],null))[_0xf74b('0x22')](respondWithResult(_0x54b00a,null))[_0xf74b('0x41')](handleError(_0x54b00a,null));};exports[_0xf74b('0x48')]=function(_0x21e95a,_0x312f61){return db[_0xf74b('0x29')][_0xf74b('0x44')]({'where':{'id':_0x21e95a[_0xf74b('0x43')]['id']}})[_0xf74b('0x22')](handleEntityNotFound(_0x312f61,null))[_0xf74b('0x22')](removeEntity(_0x312f61,null))[_0xf74b('0x41')](handleError(_0x312f61,null));};
\ No newline at end of file
+var _0x38dc=['rawAttributes','keys','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','save','update','then','destroy','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','limit','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x38dc,0x11a));var _0xc38d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x38dc[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xc38d('0x0'));var rimraf=require(_0xc38d('0x1'));var zipdir=require(_0xc38d('0x2'));var jsonpatch=require(_0xc38d('0x3'));var rp=require(_0xc38d('0x4'));var moment=require(_0xc38d('0x5'));var BPromise=require(_0xc38d('0x6'));var Mustache=require(_0xc38d('0x7'));var util=require(_0xc38d('0x8'));var path=require(_0xc38d('0x9'));var sox=require(_0xc38d('0xa'));var csv=require(_0xc38d('0xb'));var ejs=require(_0xc38d('0xc'));var fs=require('fs');var fs_extra=require(_0xc38d('0xd'));var _=require('lodash');var squel=require(_0xc38d('0xe'));var crypto=require(_0xc38d('0xf'));var jsforce=require(_0xc38d('0x10'));var deskjs=require(_0xc38d('0x11'));var toCsv=require(_0xc38d('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc38d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc38d('0x13'));var logger=require('../../config/logger')(_0xc38d('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc38d('0x15'));var db=require(_0xc38d('0x16'))['db'];function respondWithStatusCode(_0x4ef258,_0x2df8df){_0x2df8df=_0x2df8df||0xcc;return function(_0x10a87e){if(_0x10a87e){return _0x4ef258[_0xc38d('0x17')](_0x2df8df);}return _0x4ef258[_0xc38d('0x18')](_0x2df8df)[_0xc38d('0x19')]();};}function respondWithResult(_0x5ec506,_0x3e76e1){_0x3e76e1=_0x3e76e1||0xc8;return function(_0x306563){if(_0x306563){return _0x5ec506[_0xc38d('0x18')](_0x3e76e1)['json'](_0x306563);}};}function respondWithFilteredResult(_0x5d45cb,_0x4b6d7e){return function(_0x1dd4d9){if(_0x1dd4d9){var _0x4794d0=typeof _0x4b6d7e[_0xc38d('0x1a')]===_0xc38d('0x1b')&&typeof _0x4b6d7e['limit']===_0xc38d('0x1b');var _0x302f9d=_0x1dd4d9['count'];var _0x2171d0=_0x4794d0?0x0:_0x4b6d7e['offset'];var _0xdd9979=_0x4794d0?_0x1dd4d9['count']:_0x4b6d7e[_0xc38d('0x1a')]+_0x4b6d7e['limit'];var _0x2832a9;if(_0xdd9979>=_0x302f9d){_0xdd9979=_0x302f9d;_0x2832a9=0xc8;}else{_0x2832a9=0xce;}_0x5d45cb[_0xc38d('0x18')](_0x2832a9);return _0x5d45cb['set']('Content-Range',_0x2171d0+'-'+_0xdd9979+'/'+_0x302f9d)['json'](_0x1dd4d9);}return null;};}function patchUpdates(_0x1a2a66){return function(_0x5a67b7){try{jsonpatch['apply'](_0x5a67b7,_0x1a2a66,!![]);}catch(_0x7a925c){return BPromise['reject'](_0x7a925c);}return _0x5a67b7[_0xc38d('0x1c')]();};}function saveUpdates(_0x5629db,_0x2b628f){return function(_0x1bc74a){if(_0x1bc74a){return _0x1bc74a[_0xc38d('0x1d')](_0x5629db)[_0xc38d('0x1e')](function(_0x8c0c5b){return _0x8c0c5b;});}return null;};}function removeEntity(_0x4a2b11,_0x55c804){return function(_0x3ae83d){if(_0x3ae83d){return _0x3ae83d[_0xc38d('0x1f')]()[_0xc38d('0x1e')](function(){_0x4a2b11['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x221280,_0x5cfc4c){return function(_0x3fb3b5){if(!_0x3fb3b5){_0x221280[_0xc38d('0x17')](0x194);}return _0x3fb3b5;};}function handleError(_0xb260b8,_0x6962e1){_0x6962e1=_0x6962e1||0x1f4;return function(_0x2f6aa3){logger['error'](_0x2f6aa3[_0xc38d('0x20')]);if(_0x2f6aa3[_0xc38d('0x21')]){delete _0x2f6aa3[_0xc38d('0x21')];}_0xb260b8[_0xc38d('0x18')](_0x6962e1)[_0xc38d('0x22')](_0x2f6aa3);};}exports[_0xc38d('0x23')]=function(_0x132dff,_0x597fa7){var _0x21598c={},_0x3dfd00={},_0x35a8b3={'count':0x0,'rows':[]};var _0x4d3a8b=_[_0xc38d('0x24')](db[_0xc38d('0x25')]['rawAttributes'],function(_0x4bb6f4){return{'name':_0x4bb6f4[_0xc38d('0x26')],'type':_0x4bb6f4[_0xc38d('0x27')][_0xc38d('0x28')]};});_0x3dfd00[_0xc38d('0x29')]=_['map'](_0x4d3a8b,_0xc38d('0x21'));_0x3dfd00[_0xc38d('0x2a')]=_['keys'](_0x132dff[_0xc38d('0x2a')]);_0x3dfd00['filters']=_[_0xc38d('0x2b')](_0x3dfd00[_0xc38d('0x29')],_0x3dfd00['query']);_0x21598c[_0xc38d('0x2c')]=_[_0xc38d('0x2b')](_0x3dfd00[_0xc38d('0x29')],qs[_0xc38d('0x2d')](_0x132dff[_0xc38d('0x2a')][_0xc38d('0x2d')]));_0x21598c[_0xc38d('0x2c')]=_0x21598c[_0xc38d('0x2c')]['length']?_0x21598c[_0xc38d('0x2c')]:_0x3dfd00['model'];if(!_0x132dff['query']['hasOwnProperty'](_0xc38d('0x2e'))){_0x21598c['limit']=qs['limit'](_0x132dff[_0xc38d('0x2a')][_0xc38d('0x2f')]);_0x21598c['offset']=qs[_0xc38d('0x1a')](_0x132dff[_0xc38d('0x2a')][_0xc38d('0x1a')]);}_0x21598c['order']=qs[_0xc38d('0x30')](_0x132dff[_0xc38d('0x2a')][_0xc38d('0x30')]);_0x21598c[_0xc38d('0x31')]=qs[_0xc38d('0x32')](_[_0xc38d('0x33')](_0x132dff[_0xc38d('0x2a')],_0x3dfd00[_0xc38d('0x32')]),_0x4d3a8b);if(_0x132dff[_0xc38d('0x2a')][_0xc38d('0x34')]){_0x21598c['where']=_[_0xc38d('0x35')](_0x21598c[_0xc38d('0x31')],{'$or':_['map'](_0x4d3a8b,function(_0x146f77){if(_0x146f77[_0xc38d('0x27')]!=='VIRTUAL'){var _0x43d454={};_0x43d454[_0x146f77[_0xc38d('0x21')]]={'$like':'%'+_0x132dff[_0xc38d('0x2a')]['filter']+'%'};return _0x43d454;}})});}_0x21598c=_['merge']({},_0x21598c,_0x132dff[_0xc38d('0x36')]);var _0x364de9={'where':_0x21598c[_0xc38d('0x31')]};return db[_0xc38d('0x25')][_0xc38d('0x37')](_0x364de9)[_0xc38d('0x1e')](function(_0x440b03){_0x35a8b3[_0xc38d('0x37')]=_0x440b03;if(_0x132dff[_0xc38d('0x2a')][_0xc38d('0x38')]){_0x21598c[_0xc38d('0x39')]=[{'all':!![]}];}return db['FaxApplication'][_0xc38d('0x3a')](_0x21598c);})[_0xc38d('0x1e')](function(_0x371da8){_0x35a8b3[_0xc38d('0x3b')]=_0x371da8;return _0x35a8b3;})[_0xc38d('0x1e')](respondWithFilteredResult(_0x597fa7,_0x21598c))[_0xc38d('0x3c')](handleError(_0x597fa7,null));};exports[_0xc38d('0x3d')]=function(_0x26b570,_0x3009d4){var _0x56335e={'raw':!![],'where':{'id':_0x26b570[_0xc38d('0x3e')]['id']}},_0x252b9d={};_0x252b9d[_0xc38d('0x29')]=_['keys'](db[_0xc38d('0x25')][_0xc38d('0x3f')]);_0x252b9d[_0xc38d('0x2a')]=_[_0xc38d('0x40')](_0x26b570[_0xc38d('0x2a')]);_0x252b9d['filters']=_[_0xc38d('0x2b')](_0x252b9d['model'],_0x252b9d[_0xc38d('0x2a')]);_0x56335e['attributes']=_[_0xc38d('0x2b')](_0x252b9d['model'],qs[_0xc38d('0x2d')](_0x26b570[_0xc38d('0x2a')][_0xc38d('0x2d')]));_0x56335e[_0xc38d('0x2c')]=_0x56335e[_0xc38d('0x2c')][_0xc38d('0x41')]?_0x56335e[_0xc38d('0x2c')]:_0x252b9d['model'];if(_0x26b570['query'][_0xc38d('0x38')]){_0x56335e[_0xc38d('0x39')]=[{'all':!![]}];}_0x56335e=_[_0xc38d('0x35')]({},_0x56335e,_0x26b570[_0xc38d('0x36')]);return db[_0xc38d('0x25')][_0xc38d('0x42')](_0x56335e)[_0xc38d('0x1e')](handleEntityNotFound(_0x3009d4,null))[_0xc38d('0x1e')](respondWithResult(_0x3009d4,null))['catch'](handleError(_0x3009d4,null));};exports[_0xc38d('0x43')]=function(_0x2c07c,_0x7de061){return db[_0xc38d('0x25')][_0xc38d('0x43')](_0x2c07c[_0xc38d('0x44')],{})[_0xc38d('0x1e')](respondWithResult(_0x7de061,0xc9))['catch'](handleError(_0x7de061,null));};exports[_0xc38d('0x1d')]=function(_0x11988f,_0x67c89a){if(_0x11988f['body']['id']){delete _0x11988f['body']['id'];}return db[_0xc38d('0x25')][_0xc38d('0x42')]({'where':{'id':_0x11988f[_0xc38d('0x3e')]['id']}})[_0xc38d('0x1e')](handleEntityNotFound(_0x67c89a,null))[_0xc38d('0x1e')](saveUpdates(_0x11988f[_0xc38d('0x44')],null))[_0xc38d('0x1e')](respondWithResult(_0x67c89a,null))[_0xc38d('0x3c')](handleError(_0x67c89a,null));};exports[_0xc38d('0x1f')]=function(_0x49a06e,_0x2b1324){return db['FaxApplication'][_0xc38d('0x42')]({'where':{'id':_0x49a06e[_0xc38d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x2b1324,null))['then'](removeEntity(_0x2b1324,null))[_0xc38d('0x3c')](handleError(_0x2b1324,null));};
\ No newline at end of file
index 21483f1..eac8f23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x088b=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x313967,_0x3084c6){var _0x368b38=function(_0x86f02d){while(--_0x86f02d){_0x313967['push'](_0x313967['shift']());}};_0x368b38(++_0x3084c6);}(_0x088b,0x15f));var _0xb088=function(_0x425561,_0x3a4598){_0x425561=_0x425561-0x0;var _0x303b28=_0x088b[_0x425561];return _0x303b28;};'use strict';var _=require(_0xb088('0x0'));var util=require(_0xb088('0x1'));var logger=require(_0xb088('0x2'))(_0xb088('0x3'));var moment=require('moment');var BPromise=require(_0xb088('0x4'));var rp=require(_0xb088('0x5'));var fs=require('fs');var path=require(_0xb088('0x6'));var rimraf=require(_0xb088('0x7'));var config=require(_0xb088('0x8'));var attributes=require(_0xb088('0x9'));module[_0xb088('0xa')]=function(_0x103c2d,_0x1ecc63){return _0x103c2d[_0xb088('0xb')](_0xb088('0xc'),attributes,{'tableName':_0xb088('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb088('0xe'),'collate':_0xb088('0xf')});};
\ No newline at end of file
+var _0x0972=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./faxApplication.attributes','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x0972,0x12c));var _0x2097=function(_0x2d92e4,_0x4a6bf4){_0x2d92e4=_0x2d92e4-0x0;var _0x181f2d=_0x0972[_0x2d92e4];return _0x181f2d;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var logger=require(_0x2097('0x1'))(_0x2097('0x2'));var moment=require('moment');var BPromise=require(_0x2097('0x3'));var rp=require(_0x2097('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2097('0x5'));var config=require(_0x2097('0x6'));var attributes=require(_0x2097('0x7'));module['exports']=function(_0x1f1909,_0x219c0f){return _0x1f1909['define']('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2097('0x8'),'collate':_0x2097('0x9')});};
\ No newline at end of file
index 186c59a..ba318a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fa9=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateFaxApplication','FaxApplication','update','options','where','attributes','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x427d3a,_0x23724c){var _0xe5c521=function(_0x77b277){while(--_0x77b277){_0x427d3a['push'](_0x427d3a['shift']());}};_0xe5c521(++_0x23724c);}(_0x2fa9,0x144));var _0x92fa=function(_0x57c6be,_0x132406){_0x57c6be=_0x57c6be-0x0;var _0x3eb627=_0x2fa9[_0x57c6be];return _0x3eb627;};'use strict';var _=require(_0x92fa('0x0'));var util=require(_0x92fa('0x1'));var moment=require(_0x92fa('0x2'));var BPromise=require(_0x92fa('0x3'));var rs=require(_0x92fa('0x4'));var fs=require('fs');var Redis=require(_0x92fa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x92fa('0x6'));var logger=require(_0x92fa('0x7'))(_0x92fa('0x8'));var config=require('../../config/environment');var jayson=require(_0x92fa('0x9'));var client=jayson[_0x92fa('0xa')][_0x92fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a3d25,_0x1da0db,_0x30cf75){return new BPromise(function(_0x3f5bd9,_0x25d495){return client['request'](_0x4a3d25,_0x30cf75)[_0x92fa('0xc')](function(_0x1694bb){logger['info'](_0x92fa('0xd'),_0x1da0db,_0x92fa('0xe'));logger[_0x92fa('0xf')](_0x92fa('0x10'),_0x1da0db,_0x92fa('0xe'),JSON[_0x92fa('0x11')](_0x1694bb));if(_0x1694bb[_0x92fa('0x12')]){if(_0x1694bb[_0x92fa('0x12')][_0x92fa('0x13')]===0x1f4){logger[_0x92fa('0x12')](_0x92fa('0xd'),_0x1da0db,_0x1694bb[_0x92fa('0x12')][_0x92fa('0x14')]);return _0x25d495(_0x1694bb['error'][_0x92fa('0x14')]);}logger[_0x92fa('0x12')](_0x92fa('0xd'),_0x1da0db,_0x1694bb[_0x92fa('0x12')][_0x92fa('0x14')]);return _0x3f5bd9(_0x1694bb['error'][_0x92fa('0x14')]);}else{logger[_0x92fa('0x15')](_0x92fa('0xd'),_0x1da0db,_0x92fa('0xe'));_0x3f5bd9(_0x1694bb[_0x92fa('0x16')]['message']);}})[_0x92fa('0x17')](function(_0xe7a253){logger[_0x92fa('0x12')]('FaxApplication,\x20%s,\x20%s',_0x1da0db,_0xe7a253);_0x25d495(_0xe7a253);});});}exports[_0x92fa('0x18')]=function(_0x11528b){var _0x1bf5f2=this;return new Promise(function(_0x30f8b4,_0x2cc8e3){return db[_0x92fa('0x19')][_0x92fa('0x1a')](_0x11528b['body'],{'raw':_0x11528b['options']?_0x11528b['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11528b[_0x92fa('0x1b')]?_0x11528b['options'][_0x92fa('0x1c')]||null:null,'attributes':_0x11528b['options']?_0x11528b[_0x92fa('0x1b')][_0x92fa('0x1d')]||null:null,'limit':_0x11528b['options']?_0x11528b[_0x92fa('0x1b')]['limit']||null:null})[_0x92fa('0xc')](function(_0x9b9b77){logger[_0x92fa('0x15')]('UpdateFaxApplication',_0x11528b);logger['debug'](_0x92fa('0x18'),_0x11528b,JSON['stringify'](_0x9b9b77));_0x30f8b4(_0x9b9b77);})['catch'](function(_0x4799d1){logger[_0x92fa('0x12')]('UpdateFaxApplication',_0x4799d1['message'],_0x11528b);_0x2cc8e3(_0x1bf5f2['error'](0x1f4,_0x4799d1[_0x92fa('0x14')]));});});};
\ No newline at end of file
+var _0x82d2=['http','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','message','catch','update','options','raw','then','stringify','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x483597,_0x198104){var _0x392ccf=function(_0x3e1984){while(--_0x3e1984){_0x483597['push'](_0x483597['shift']());}};_0x392ccf(++_0x198104);}(_0x82d2,0xdd));var _0x282d=function(_0x249338,_0x6558fa){_0x249338=_0x249338-0x0;var _0x1dbe4a=_0x82d2[_0x249338];return _0x1dbe4a;};'use strict';var _=require(_0x282d('0x0'));var util=require(_0x282d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x282d('0x2'));var fs=require('fs');var Redis=require(_0x282d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x282d('0x4'));var logger=require('../../config/logger')(_0x282d('0x5'));var config=require(_0x282d('0x6'));var jayson=require(_0x282d('0x7'));var client=jayson[_0x282d('0x8')][_0x282d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33c274,_0xd871be,_0x3ea5fd){return new BPromise(function(_0x54ffc0,_0x374dc3){return client['request'](_0x33c274,_0x3ea5fd)['then'](function(_0x4b8f82){logger[_0x282d('0xa')](_0x282d('0xb'),_0xd871be,_0x282d('0xc'));logger[_0x282d('0xd')](_0x282d('0xe'),_0xd871be,_0x282d('0xc'),JSON['stringify'](_0x4b8f82));if(_0x4b8f82[_0x282d('0xf')]){if(_0x4b8f82['error']['code']===0x1f4){logger[_0x282d('0xf')](_0x282d('0xb'),_0xd871be,_0x4b8f82[_0x282d('0xf')][_0x282d('0x10')]);return _0x374dc3(_0x4b8f82[_0x282d('0xf')]['message']);}logger['error'](_0x282d('0xb'),_0xd871be,_0x4b8f82[_0x282d('0xf')][_0x282d('0x10')]);return _0x54ffc0(_0x4b8f82['error'][_0x282d('0x10')]);}else{logger['info']('FaxApplication,\x20%s,\x20%s',_0xd871be,_0x282d('0xc'));_0x54ffc0(_0x4b8f82['result'][_0x282d('0x10')]);}})[_0x282d('0x11')](function(_0x11ce08){logger[_0x282d('0xf')](_0x282d('0xb'),_0xd871be,_0x11ce08);_0x374dc3(_0x11ce08);});});}exports['UpdateFaxApplication']=function(_0x547e15){var _0x1eeb42=this;return new Promise(function(_0x1d5051,_0x2282e2){return db['FaxApplication'][_0x282d('0x12')](_0x547e15['body'],{'raw':_0x547e15['options']?_0x547e15[_0x282d('0x13')][_0x282d('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x547e15[_0x282d('0x13')]?_0x547e15[_0x282d('0x13')]['where']||null:null,'attributes':_0x547e15[_0x282d('0x13')]?_0x547e15[_0x282d('0x13')]['attributes']||null:null,'limit':_0x547e15[_0x282d('0x13')]?_0x547e15[_0x282d('0x13')]['limit']||null:null})[_0x282d('0x15')](function(_0x43758d){logger[_0x282d('0xa')]('UpdateFaxApplication',_0x547e15);logger[_0x282d('0xd')]('UpdateFaxApplication',_0x547e15,JSON[_0x282d('0x16')](_0x43758d));_0x1d5051(_0x43758d);})[_0x282d('0x11')](function(_0x50237a){logger[_0x282d('0xf')]('UpdateFaxApplication',_0x50237a[_0x282d('0x10')],_0x547e15);_0x2282e2(_0x1eeb42[_0x282d('0xf')](0x1f4,_0x50237a['message']));});});};
\ No newline at end of file
index 46fc4d4..c9f9d65 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14a0=['get','isAuthenticated','/:id','show','create','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxApplication.controller'];(function(_0x5ef7e0,_0x249f96){var _0x4958e1=function(_0x2b59ff){while(--_0x2b59ff){_0x5ef7e0['push'](_0x5ef7e0['shift']());}};_0x4958e1(++_0x249f96);}(_0x14a0,0x8e));var _0x014a=function(_0x2a4af0,_0xdc5343){_0x2a4af0=_0x2a4af0-0x0;var _0x21fa03=_0x14a0[_0x2a4af0];return _0x21fa03;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require(_0x014a('0x1'));var timeout=require(_0x014a('0x2'));var express=require(_0x014a('0x3'));var router=express[_0x014a('0x4')]();var fs_extra=require(_0x014a('0x5'));var auth=require(_0x014a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x014a('0x7'));router[_0x014a('0x8')]('/',auth[_0x014a('0x9')](),controller['index']);router['get'](_0x014a('0xa'),auth[_0x014a('0x9')](),controller[_0x014a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x014a('0xd')]('/:id',auth[_0x014a('0x9')](),controller[_0x014a('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x4e74c2,_0x287d93){var _0x2bd9c0=function(_0x31b05b){while(--_0x31b05b){_0x4e74c2['push'](_0x4e74c2['shift']());}};_0x2bd9c0(++_0x287d93);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./faxApplication.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router;
\ No newline at end of file
index 03c4c4c..33ef51b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe56=['DATE','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfe56,0x1b8));var _0x6fe5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xfe56[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x6fe5('0x0'));module[_0x6fe5('0x1')]={'closed':{'type':Sequelize[_0x6fe5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6fe5('0x3')]},'secondDisposition':{'type':Sequelize[_0x6fe5('0x3')]},'thirdDisposition':{'type':Sequelize[_0x6fe5('0x3')]},'note':{'type':Sequelize[_0x6fe5('0x3')]},'read1stAt':{'type':Sequelize[_0x6fe5('0x4')]},'fax':{'type':Sequelize[_0x6fe5('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x6fe5('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x6fe5('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x1892=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x4df349,_0x4d8194){var _0xf4cba5=function(_0x40529){while(--_0x40529){_0x4df349['push'](_0x4df349['shift']());}};_0xf4cba5(++_0x4d8194);}(_0x1892,0x8d));var _0x2189=function(_0x48292a,_0x12e2ec){_0x48292a=_0x48292a-0x0;var _0x31ca8a=_0x1892[_0x48292a];return _0x31ca8a;};'use strict';var Sequelize=require(_0x2189('0x0'));module['exports']={'closed':{'type':Sequelize[_0x2189('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2189('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2189('0x3')]},'thirdDisposition':{'type':Sequelize[_0x2189('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x2189('0x2')]},'fax':{'type':Sequelize[_0x2189('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2189('0x4')]('in',_0x2189('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2189('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x2189('0x4')]('in',_0x2189('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index f2ac5ee..6e6b6a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb178=['split','forEach','push','index','rawAttributes','type','key','model','filters','intersection','attributes','fields','query','length','nolimit','order','sort','where','pick','field','color','from','select','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','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','tools_tags','expr','parseSearch','search','sqlOperator','conditions','find','value','having','`\x20>\x200','Contact','$substring','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','start','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','keys','some','compact','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','agent','sequelize','toString','keyBy','merge','FaxInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','all','rows','catch','show','params','includeAll','options','create','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','findAll','emit','faxInteractionTags:save','removeTags','download','unix','server','files','join','attachments','format','transcript-%d-%s.zip','Attachment','Messages','get','basename','createReadStream','pipe','createWriteStream','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','end','json','offset','undefined','limit','count','status','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','fullname','TagIds','Tags'];(function(_0x5dc713,_0x4e90cf){var _0x5fc2d2=function(_0x1b0dfa){while(--_0x1b0dfa){_0x5dc713['push'](_0x5dc713['shift']());}};_0x5fc2d2(++_0x4e90cf);}(_0xb178,0x178));var _0x8b17=function(_0x1b925b,_0x1ab3c9){_0x1b925b=_0x1b925b-0x0;var _0x275f07=_0xb178[_0x1b925b];return _0x275f07;};'use strict';var emlformat=require(_0x8b17('0x0'));var rimraf=require(_0x8b17('0x1'));var zipdir=require(_0x8b17('0x2'));var jsonpatch=require(_0x8b17('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8b17('0x4'));var Mustache=require(_0x8b17('0x5'));var util=require(_0x8b17('0x6'));var path=require(_0x8b17('0x7'));var sox=require(_0x8b17('0x8'));var csv=require(_0x8b17('0x9'));var ejs=require(_0x8b17('0xa'));var fs=require('fs');var fs_extra=require(_0x8b17('0xb'));var _=require(_0x8b17('0xc'));var squel=require(_0x8b17('0xd'));var crypto=require(_0x8b17('0xe'));var jsforce=require(_0x8b17('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8b17('0x10'));var Papa=require(_0x8b17('0x11'));var Redis=require(_0x8b17('0x12'));var authService=require(_0x8b17('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8b17('0x14'));var hardwareService=require(_0x8b17('0x15'));var logger=require(_0x8b17('0x16'))(_0x8b17('0x17'));var utils=require(_0x8b17('0x18'));var config=require(_0x8b17('0x19'));var licenseUtil=require(_0x8b17('0x1a'));var db=require(_0x8b17('0x1b'))['db'];config[_0x8b17('0x1c')]=_[_0x8b17('0x1d')](config[_0x8b17('0x1c')],{'host':_0x8b17('0x1e'),'port':0x18eb});var socket=require(_0x8b17('0x1f'))(new Redis(config[_0x8b17('0x1c')]));require(_0x8b17('0x20'))[_0x8b17('0x21')](socket);function respondWithStatusCode(_0xb28b42,_0x2ab109){_0x2ab109=_0x2ab109||0xcc;return function(_0x30f762){if(_0x30f762){return _0xb28b42['sendStatus'](_0x2ab109);}return _0xb28b42['status'](_0x2ab109)[_0x8b17('0x22')]();};}function respondWithResult(_0x4e3bf0,_0x52de1e){_0x52de1e=_0x52de1e||0xc8;return function(_0x48ab17){if(_0x48ab17){return _0x4e3bf0['status'](_0x52de1e)[_0x8b17('0x23')](_0x48ab17);}};}function respondWithFilteredResult(_0x3ad96b,_0x5f366c){return function(_0x12622d){if(_0x12622d){var _0x3e0d3f=typeof _0x5f366c[_0x8b17('0x24')]===_0x8b17('0x25')&&typeof _0x5f366c[_0x8b17('0x26')]===_0x8b17('0x25');var _0x5aa505=_0x12622d[_0x8b17('0x27')];var _0x32c156=_0x3e0d3f?0x0:_0x5f366c[_0x8b17('0x24')];var _0xf8d2b7=_0x3e0d3f?_0x12622d[_0x8b17('0x27')]:_0x5f366c[_0x8b17('0x24')]+_0x5f366c[_0x8b17('0x26')];var _0x34f91c;if(_0xf8d2b7>=_0x5aa505){_0xf8d2b7=_0x5aa505;_0x34f91c=0xc8;}else{_0x34f91c=0xce;}_0x3ad96b[_0x8b17('0x28')](_0x34f91c);return _0x3ad96b['set']('Content-Range',_0x32c156+'-'+_0xf8d2b7+'/'+_0x5aa505)[_0x8b17('0x23')](_0x12622d);}return null;};}function patchUpdates(_0x5d7ff1){return function(_0x476b0e){try{jsonpatch[_0x8b17('0x29')](_0x476b0e,_0x5d7ff1,!![]);}catch(_0xd508b2){return BPromise[_0x8b17('0x2a')](_0xd508b2);}return _0x476b0e[_0x8b17('0x2b')]();};}function saveUpdates(_0x146d20,_0x25f17f){return function(_0x457a9c){if(_0x457a9c){return _0x457a9c[_0x8b17('0x2c')](_0x146d20)[_0x8b17('0x2d')](function(_0x28a5d3){return _0x28a5d3;});}return null;};}function removeEntity(_0x10de65,_0x4c0b4b){return function(_0x187ace){if(_0x187ace){return _0x187ace[_0x8b17('0x2e')]()[_0x8b17('0x2d')](function(){_0x10de65[_0x8b17('0x28')](0xcc)[_0x8b17('0x22')]();});}};}function handleEntityNotFound(_0x4d53d8,_0x47662d){return function(_0x152a43){if(!_0x152a43){_0x4d53d8[_0x8b17('0x2f')](0x194);}return _0x152a43;};}function handleError(_0x1136ed,_0x174dd1){_0x174dd1=_0x174dd1||0x1f4;return function(_0x5c2d5a){logger[_0x8b17('0x30')](_0x5c2d5a[_0x8b17('0x31')]);if(_0x5c2d5a[_0x8b17('0x32')]){delete _0x5c2d5a['name'];}_0x1136ed[_0x8b17('0x28')](_0x174dd1)[_0x8b17('0x33')](_0x5c2d5a);};}function getInteractionUsers(_0xc792b7,_0x4aa34b){return new BPromise(function(_0x5e0962,_0x4f0bd1){try{if(_0x4aa34b[_0xc792b7['id']]){_0xc792b7['Users']=_[_0x8b17('0x34')](_0x4aa34b[_0xc792b7['id']],function(_0x1171a6){return{'id':_0x1171a6['id'],'fullname':_0x1171a6[_0x8b17('0x35')]};});}}catch(_0x42604a){_0x4f0bd1(_0x42604a);}_0x5e0962(_0xc792b7);});}function getInteractionTags(_0x33f475,_0x3adafa){return new BPromise(function(_0x2f746a,_0x39b820){try{if(_0x33f475[_0x8b17('0x36')]){_0x33f475[_0x8b17('0x37')]=[];_0x33f475['TagIds'][_0x8b17('0x38')](',')[_0x8b17('0x39')](function(_0x84722b){_0x33f475[_0x8b17('0x37')][_0x8b17('0x3a')](_0x3adafa[_0x84722b]);});}delete _0x33f475[_0x8b17('0x36')];}catch(_0x390cbe){_0x39b820(_0x390cbe);}_0x2f746a(_0x33f475);});}function updateFaxInteraction(_0x25dfb3,_0x5b0d3b,_0x4b0558){return new BPromise(function(_0x2e85da,_0x4f67ab){return getInteractionUsers(_0x25dfb3,_0x4b0558)['then'](function(_0x1aeb7e){return getInteractionTags(_0x1aeb7e,_0x5b0d3b);})['then'](function(_0x758c13){_0x2e85da(_0x758c13);})['catch'](function(_0x13a172){_0x4f67ab(_0x13a172);});});}exports[_0x8b17('0x3b')]=function(_0x1e85b2,_0x162f47){var _0x413d1a={},_0x2fd686={},_0x216dcc={'count':0x0,'rows':[]};var _0x37bf84=_[_0x8b17('0x34')](db['FaxInteraction'][_0x8b17('0x3c')],function(_0xaaec2c){return{'name':_0xaaec2c['fieldName'],'type':_0xaaec2c[_0x8b17('0x3d')][_0x8b17('0x3e')]};});_0x2fd686[_0x8b17('0x3f')]=_[_0x8b17('0x34')](_0x37bf84,'name');_0x2fd686['query']=_['keys'](_0x1e85b2['query']);_0x2fd686[_0x8b17('0x40')]=_[_0x8b17('0x41')](_0x2fd686[_0x8b17('0x3f')],_0x2fd686['query']);_0x413d1a[_0x8b17('0x42')]=_[_0x8b17('0x41')](_0x2fd686['model'],qs[_0x8b17('0x43')](_0x1e85b2[_0x8b17('0x44')][_0x8b17('0x43')]));_0x413d1a[_0x8b17('0x42')]=_0x413d1a[_0x8b17('0x42')][_0x8b17('0x45')]?_0x413d1a['attributes']:_0x2fd686[_0x8b17('0x3f')];if(!_0x1e85b2[_0x8b17('0x44')]['hasOwnProperty'](_0x8b17('0x46'))){_0x413d1a['limit']=qs['limit'](_0x1e85b2[_0x8b17('0x44')][_0x8b17('0x26')]);_0x413d1a[_0x8b17('0x24')]=qs[_0x8b17('0x24')](_0x1e85b2[_0x8b17('0x44')]['offset']);}_0x413d1a[_0x8b17('0x47')]=qs['sort'](_0x1e85b2[_0x8b17('0x44')][_0x8b17('0x48')]);_0x413d1a[_0x8b17('0x49')]=qs['filters'](_[_0x8b17('0x4a')](_0x1e85b2['query'],_0x2fd686[_0x8b17('0x40')]),_0x37bf84);var _0x483d64=[];var _0x199909=squel['select']()[_0x8b17('0x4b')]('id')['field'](_0x8b17('0x32'))[_0x8b17('0x4b')](_0x8b17('0x4c'))[_0x8b17('0x4d')]('tools_tags');var _0x25ddfd=squel[_0x8b17('0x4e')]()[_0x8b17('0x4b')](_0x8b17('0x4f'))['field'](_0x8b17('0x50'))[_0x8b17('0x4b')](_0x8b17('0x51'))[_0x8b17('0x4d')](_0x8b17('0x52'),'ui')[_0x8b17('0x53')](_0x8b17('0x54'),'u',_0x8b17('0x55'));var _0x5c9d85=squel[_0x8b17('0x4e')]()['from']('fax_interactions','i')[_0x8b17('0x53')](_0x8b17('0x56'),'c',_0x8b17('0x57'))['left_join'](_0x8b17('0x54'),'o','o.id\x20=\x20i.UserId')[_0x8b17('0x53')](_0x8b17('0x58'),'a',_0x8b17('0x59'))[_0x8b17('0x53')]('fax_messages','me',_0x8b17('0x5a'))[_0x8b17('0x53')](_0x8b17('0x5b'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x8b17('0x53')](_0x8b17('0x5c'),'t','t.id\x20=\x20it.TagId');var _0x3e48eb=squel[_0x8b17('0x5d')]();var _0x14bf9b=[];var _0x37b67d=squel['expr']();var _0x66fbc;if(_0x1e85b2[_0x8b17('0x44')]['search']){_0x66fbc=as[_0x8b17('0x5e')](_0x1e85b2['query'][_0x8b17('0x5f')]);var _0x38d580=_0x66fbc[_0x8b17('0x60')];for(var _0x7caf35=0x0;_0x7caf35<_0x66fbc[_0x8b17('0x61')]['length'];_0x7caf35++){var _0x1ab7a5=_0x66fbc['conditions'][_0x7caf35];var _0x4522f7='i';var _0x65e64a=_[_0x8b17('0x62')](_0x37bf84,[_0x8b17('0x32'),_0x1ab7a5[_0x8b17('0x4b')]]);if(!_0x65e64a){switch(_0x1ab7a5[_0x8b17('0x4b')]){case'unreadMessages':if(_0x1ab7a5[_0x8b17('0x63')]==0x1){_0x5c9d85['having']('`'+_0x1ab7a5[_0x8b17('0x4b')]+'`\x20=\x200');}else{_0x5c9d85[_0x8b17('0x64')]('`'+_0x1ab7a5[_0x8b17('0x4b')]+_0x8b17('0x65'));}break;case _0x8b17('0x66'):if(_0x1ab7a5['operator']===_0x8b17('0x67')){if(_0x1ab7a5[_0x8b17('0x63')][_0x8b17('0x38')]('\x20')[_0x8b17('0x45')]>0x1){_0x3e48eb[_0x38d580]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x1ab7a5[_0x8b17('0x63')]),null);}else{var _0x46f005='%'+_0x1ab7a5[_0x8b17('0x63')]+'%';_0x3e48eb[_0x38d580](_0x8b17('0x68'),_0x46f005,_0x46f005,_0x46f005);}}else{_0x65e64a=_[_0x8b17('0x62')](_0x37bf84,[_0x8b17('0x32'),'ContactId']);_0x1ab7a5[_0x8b17('0x4b')]='ContactId';_0x2040be=as[_0x8b17('0x69')](_0x4522f7,_0x65e64a[_0x8b17('0x3d')],_0x1ab7a5);_0x3e48eb[_0x38d580](_0x2040be['text'],_0x2040be[_0x8b17('0x63')][_0x8b17('0x6a')],_0x2040be['value']['end']);}break;case'Tag':var _0x2ba7ca=_0x1ab7a5[_0x8b17('0x63')][_0x8b17('0x38')](',')[_0x8b17('0x34')](function(_0x2b1237){return Number(_0x2b1237);});_0x2ba7ca[_0x8b17('0x39')](function(_0x222888){_0x37b67d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x222888+',%');});_0x14bf9b=_[_0x8b17('0x6b')](_0x14bf9b,_0x2ba7ca);break;case _0x8b17('0x6c'):if(_0x1ab7a5[_0x8b17('0x6d')]===_0x8b17('0x67')){_0x3e48eb[_0x38d580](_0x8b17('0x6e'),'%'+_0x1ab7a5[_0x8b17('0x63')]+'%',null);}else{_0x65e64a=_[_0x8b17('0x62')](_0x37bf84,[_0x8b17('0x32'),_0x8b17('0x6f')]);_0x1ab7a5['field']='UserId';_0x2040be=as[_0x8b17('0x69')](_0x4522f7,_0x65e64a['type'],_0x1ab7a5);_0x3e48eb[_0x38d580](_0x2040be[_0x8b17('0x70')],_0x2040be[_0x8b17('0x63')][_0x8b17('0x6a')],_0x2040be[_0x8b17('0x63')][_0x8b17('0x22')]);}break;case _0x8b17('0x71'):_0x2040be=as['buildExpression']('me',null,_0x1ab7a5);_0x3e48eb[_0x38d580](_0x2040be[_0x8b17('0x70')],_0x2040be[_0x8b17('0x63')][_0x8b17('0x6a')],_0x2040be[_0x8b17('0x63')][_0x8b17('0x22')]);break;}}else{var _0x2040be=as[_0x8b17('0x69')](_0x4522f7,_0x65e64a['type'],_0x1ab7a5);_0x3e48eb[_0x38d580](_0x2040be['text'],_0x2040be[_0x8b17('0x63')][_0x8b17('0x6a')],_0x2040be['value']['end']);}}}else{var _0x381e18=_(_0x1e85b2[_0x8b17('0x44')])[_0x8b17('0x72')]()[_0x8b17('0x34')](function(_0x19e26f){return _[_0x8b17('0x73')](_0x37bf84,[_0x8b17('0x32'),_0x19e26f])?_0x19e26f:undefined;})[_0x8b17('0x74')]()[_0x8b17('0x63')]();if(!_['isEmpty'](_0x381e18)){_0x381e18[_0x8b17('0x39')](function(_0xfddedf){if(_0xfddedf==='FaxAccountId'){_0x5c9d85['where']('i.FaxAccountId\x20IN\x20?',[][_0x8b17('0x75')](_0x1e85b2[_0x8b17('0x44')][_0xfddedf]));}else if(_0xfddedf===_0x8b17('0x76')){var _0x1becab=JSON[_0x8b17('0x77')](_0x1e85b2[_0x8b17('0x44')][_0xfddedf])[_0x8b17('0x78')];var _0x5632f1=JSON[_0x8b17('0x77')](_0x1e85b2[_0x8b17('0x44')][_0xfddedf])[_0x8b17('0x79')];_0x5c9d85['where'](_0x8b17('0x7a'),_0x1becab,_0x5632f1);}else{if(_0x1e85b2[_0x8b17('0x44')][_0xfddedf]===_0x8b17('0x7b')){_0x5c9d85['where']('i.'+_0xfddedf+_0x8b17('0x7c'));}else{_0x5c9d85['where']('i.'+_0xfddedf+'\x20=\x20?',_0x1e85b2['query'][_0xfddedf]);}}});}if(_0x1e85b2[_0x8b17('0x44')][_0x8b17('0x7d')]){if(_0x1e85b2[_0x8b17('0x44')][_0x8b17('0x7d')]==0x1){_0x5c9d85[_0x8b17('0x64')](_0x8b17('0x7e'));}else{_0x5c9d85[_0x8b17('0x64')](_0x8b17('0x7f'));}}if(_0x1e85b2['query'][_0x8b17('0x80')]){_0x14bf9b=_['isArray'](_0x1e85b2[_0x8b17('0x44')][_0x8b17('0x80')])?_0x1e85b2[_0x8b17('0x44')]['tag']:new Array(_0x1e85b2['query'][_0x8b17('0x80')]);_0x14bf9b[_0x8b17('0x39')](function(_0x300326){_0x37b67d['or'](_0x8b17('0x81'),'%,'+_0x300326+',%');});}if(_0x1e85b2['query'][_0x8b17('0x82')]){var _0x283e1f=_0x1e85b2[_0x8b17('0x44')]['filter'][_0x8b17('0x83')]('\x5c','\x5c\x5c')[_0x8b17('0x83')](/'/g,'\x27\x27');if(qs[_0x8b17('0x84')](_0x283e1f)){_0x3e48eb['or'](_0x8b17('0x85'),_0x283e1f+'%')['or'](_0x8b17('0x86'),_0x283e1f+'%');}_0x3e48eb['or'](_0x8b17('0x87'),_0x283e1f+'%');}}_0x5c9d85[_0x8b17('0x49')](_0x3e48eb);_0x5c9d85[_0x8b17('0x88')](_0x8b17('0x89'));var _0x830c1a={'type':db[_0x8b17('0x8a')][_0x8b17('0x8b')][_0x8b17('0x8c')],'raw':!![]};var _0x232b3e=_0x5c9d85[_0x8b17('0x8d')]();_0x232b3e[_0x8b17('0x4b')]('i.id');_0x232b3e[_0x8b17('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8b17('0x8e'));if(_0x413d1a[_0x8b17('0x47')]){_0x413d1a[_0x8b17('0x47')][_0x8b17('0x39')](function(_0xb3b04){var _0x2fe98f=_0xb3b04[0x0]===_0x8b17('0x8f')?_0xb3b04[0x0]:'i.'+_0xb3b04[0x0];_0x5c9d85[_0x8b17('0x47')](_0x2fe98f,_0xb3b04[0x1]===_0x8b17('0x90')?![]:!![]);});}if(!_[_0x8b17('0x91')](_0x14bf9b)){_0x5c9d85[_0x8b17('0x64')](_0x37b67d);_0x232b3e[_0x8b17('0x49')](_0x8b17('0x92'),_0x14bf9b);}BPromise[_0x8b17('0x93')]()[_0x8b17('0x2d')](function(){if(!_0x66fbc){if(_0x1e85b2[_0x8b17('0x44')][_0x8b17('0x94')])return;_0x232b3e[_0x8b17('0x49')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x5c9d85['where'](_0x8b17('0x95'));return;}if(_0x1e85b2[_0x8b17('0x96')][_0x8b17('0x97')]!=='agent')return;return _0x1e85b2[_0x8b17('0x96')][_0x8b17('0x98')]({'attributes':['id'],'raw':!![]})[_0x8b17('0x2d')](function(_0x2141d0){if(_[_0x8b17('0x91')](_0x2141d0)){_0x232b3e[_0x8b17('0x49')](_0x8b17('0x99'));_0x5c9d85[_0x8b17('0x49')](_0x8b17('0x99'));}else{_0x232b3e[_0x8b17('0x49')](_0x8b17('0x9a'),_['map'](_0x2141d0,'id'));_0x5c9d85['where'](_0x8b17('0x9a'),_[_0x8b17('0x34')](_0x2141d0,'id'));}});})['then'](function(){if(_0x1e85b2[_0x8b17('0x96')][_0x8b17('0x97')]===_0x8b17('0x9b')&&!_0x66fbc&&!_0x1e85b2[_0x8b17('0x44')]['FaxAccountId'])return[];return db[_0x8b17('0x9c')][_0x8b17('0x44')](_0x232b3e[_0x8b17('0x9d')](),_0x830c1a);})[_0x8b17('0x2d')](function(_0x5c0f26){_0x216dcc[_0x8b17('0x27')]=_0x5c0f26[_0x8b17('0x45')];if(_0x216dcc[_0x8b17('0x27')]===0x0)return[];return db[_0x8b17('0x9c')][_0x8b17('0x44')](_0x199909[_0x8b17('0x9d')](),_0x830c1a)[_0x8b17('0x2d')](function(_0x4267d8){_0x483d64=_[_0x8b17('0x9e')](_0x4267d8,'id');_0x830c1a=_[_0x8b17('0x9f')](_0x830c1a,{'model':db[_0x8b17('0xa0')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1e85b2[_0x8b17('0x44')][_0x8b17('0x43')]){_0x413d1a['attributes'][_0x8b17('0x39')](function(_0xca565f){_0x5c9d85[_0x8b17('0x4b')]('i.'+_0xca565f);});}else{_0x5c9d85[_0x8b17('0x4b')](_0x8b17('0xa1'),_0x8b17('0x8e'));_0x5c9d85[_0x8b17('0x4b')](_0x8b17('0xa2'),_0x8b17('0xa3'));_0x5c9d85[_0x8b17('0x4b')](_0x8b17('0xa4'),_0x8b17('0xa5'));_0x5c9d85[_0x8b17('0x4b')](_0x8b17('0xa6'),_0x8b17('0x8f'));_0x5c9d85[_0x8b17('0x4b')](_0x8b17('0xa7'));_0x5c9d85[_0x8b17('0x4b')]('c.firstName',_0x8b17('0xa8'));_0x5c9d85[_0x8b17('0x4b')]('c.lastName','Contact.lastName');_0x5c9d85['field'](_0x8b17('0xa9'),_0x8b17('0xaa'));_0x5c9d85[_0x8b17('0x4b')](_0x8b17('0xab'),_0x8b17('0xac'));_0x5c9d85[_0x8b17('0x4b')]('c.mobile',_0x8b17('0xad'));_0x5c9d85[_0x8b17('0x4b')]('c.fax','Contact.fax');_0x5c9d85[_0x8b17('0x4b')]('o.fullname',_0x8b17('0xae'));_0x5c9d85['field'](_0x8b17('0xaf'),_0x8b17('0xb0'));_0x5c9d85[_0x8b17('0x4b')](_0x8b17('0xb1'),_0x8b17('0x36'));}if(_0x413d1a[_0x8b17('0x26')])_0x5c9d85[_0x8b17('0x26')](_0x413d1a[_0x8b17('0x26')]);if(_0x413d1a[_0x8b17('0x24')])_0x5c9d85[_0x8b17('0x24')](_0x413d1a['offset']);return db['sequelize'][_0x8b17('0x44')](_0x5c9d85[_0x8b17('0x9d')](),_0x830c1a);})['then'](function(_0x2e58c4){if(_0x2e58c4['length']>0x0)_0x25ddfd[_0x8b17('0x49')](_0x8b17('0xb2'),_[_0x8b17('0x34')](_0x2e58c4,'id'));return db[_0x8b17('0x9c')][_0x8b17('0x44')](_0x25ddfd[_0x8b17('0x9d')](),_0x830c1a)[_0x8b17('0x2d')](function(_0x52111c){var _0x5bd402=_['groupBy'](_0x52111c,'FaxInteractionId');var _0x516e68=[];_0x2e58c4[_0x8b17('0x39')](function(_0x1ffb55){_0x516e68[_0x8b17('0x3a')](updateFaxInteraction(_0x1ffb55,_0x483d64,_0x5bd402));});return BPromise[_0x8b17('0xb3')](_0x516e68);});});})[_0x8b17('0x2d')](function(_0x2fadfc){_0x216dcc[_0x8b17('0xb4')]=_0x2fadfc;return _0x216dcc;})[_0x8b17('0x2d')](respondWithFilteredResult(_0x162f47,_0x413d1a))[_0x8b17('0xb5')](handleError(_0x162f47,null));};exports[_0x8b17('0xb6')]=function(_0xddc9a6,_0x124b0c){var _0x3816ea={'raw':![],'where':{'id':_0xddc9a6[_0x8b17('0xb7')]['id']}},_0x26301e={};_0x26301e[_0x8b17('0x3f')]=_[_0x8b17('0x72')](db[_0x8b17('0xa0')][_0x8b17('0x3c')]);_0x26301e[_0x8b17('0x44')]=_['keys'](_0xddc9a6[_0x8b17('0x44')]);_0x26301e[_0x8b17('0x40')]=_[_0x8b17('0x41')](_0x26301e[_0x8b17('0x3f')],_0x26301e[_0x8b17('0x44')]);_0x3816ea[_0x8b17('0x42')]=_[_0x8b17('0x41')](_0x26301e['model'],qs['fields'](_0xddc9a6[_0x8b17('0x44')][_0x8b17('0x43')]));_0x3816ea['attributes']=_0x3816ea[_0x8b17('0x42')][_0x8b17('0x45')]?_0x3816ea[_0x8b17('0x42')]:_0x26301e[_0x8b17('0x3f')];if(_0xddc9a6[_0x8b17('0x44')][_0x8b17('0xb8')]){_0x3816ea['include']=[{'all':!![]}];}_0x3816ea=_[_0x8b17('0x9f')]({},_0x3816ea,_0xddc9a6[_0x8b17('0xb9')]);return db[_0x8b17('0xa0')][_0x8b17('0x62')](_0x3816ea)[_0x8b17('0x2d')](handleEntityNotFound(_0x124b0c,null))[_0x8b17('0x2d')](respondWithResult(_0x124b0c,null))['catch'](handleError(_0x124b0c,null));};exports[_0x8b17('0xba')]=function(_0x37278a,_0x418d25){return db[_0x8b17('0xa0')]['create'](_0x37278a['body'],{})[_0x8b17('0x2d')](respondWithResult(_0x418d25,0xc9))[_0x8b17('0xb5')](handleError(_0x418d25,null));};exports['update']=function(_0xfac036,_0x1eb413){if(_0xfac036[_0x8b17('0x71')]['id']){delete _0xfac036[_0x8b17('0x71')]['id'];}return db[_0x8b17('0xa0')][_0x8b17('0x62')]({'where':{'id':_0xfac036[_0x8b17('0xb7')]['id']}})[_0x8b17('0x2d')](handleEntityNotFound(_0x1eb413,null))['then'](saveUpdates(_0xfac036[_0x8b17('0x71')],null))[_0x8b17('0x2d')](respondWithResult(_0x1eb413,null))[_0x8b17('0xb5')](handleError(_0x1eb413,null));};exports[_0x8b17('0x2e')]=function(_0x5883f7,_0x59d255){return db[_0x8b17('0xa0')][_0x8b17('0x62')]({'where':{'id':_0x5883f7[_0x8b17('0xb7')]['id']}})[_0x8b17('0x2d')](handleEntityNotFound(_0x59d255,null))['then'](removeEntity(_0x59d255,null))[_0x8b17('0xb5')](handleError(_0x59d255,null));};exports['describe']=function(_0x3b725b,_0x565ff3){return db[_0x8b17('0xa0')][_0x8b17('0xbb')]()['then'](respondWithResult(_0x565ff3,null))['catch'](handleError(_0x565ff3,null));};exports[_0x8b17('0xbc')]=function(_0xb8b40b,_0x2af565,_0x458211){return db[_0x8b17('0xbd')][_0x8b17('0x62')]({'where':{'id':_0xb8b40b['params']['id']}})['then'](handleEntityNotFound(_0x2af565,null))[_0x8b17('0x2d')](function(_0x3ee1f2){if(_0x3ee1f2){return _0x3ee1f2['addMessage'](_0xb8b40b[_0x8b17('0x71')][_0x8b17('0xbe')],_[_0x8b17('0xbf')](_0xb8b40b[_0x8b17('0x71')],[_0x8b17('0xbe'),'id'])||{});}})['then'](respondWithResult(_0x2af565,null))['catch'](handleError(_0x2af565,null));};exports[_0x8b17('0xc0')]=function(_0x13c302,_0x300461,_0x1fe677){var _0x2ebf23={'raw':![],'where':{}};var _0x26bc15={};var _0x3cfe76={'count':0x0,'rows':[]};return db[_0x8b17('0xa0')][_0x8b17('0xc1')]({'where':{'id':_0x13c302[_0x8b17('0xb7')]['id']}})[_0x8b17('0x2d')](handleEntityNotFound(_0x300461,null))[_0x8b17('0x2d')](function(_0x3198c2){if(_0x3198c2){_0x26bc15[_0x8b17('0x3f')]=_[_0x8b17('0x72')](db[_0x8b17('0xbd')][_0x8b17('0x3c')]);_0x26bc15[_0x8b17('0x44')]=_[_0x8b17('0x72')](_0x13c302['query']);_0x26bc15[_0x8b17('0x40')]=_[_0x8b17('0x41')](_0x26bc15[_0x8b17('0x3f')],_0x26bc15['query']);_0x2ebf23[_0x8b17('0x42')]=_['intersection'](_0x26bc15[_0x8b17('0x3f')],qs['fields'](_0x13c302[_0x8b17('0x44')][_0x8b17('0x43')]));_0x2ebf23[_0x8b17('0x42')]=_0x2ebf23['attributes'][_0x8b17('0x45')]?_0x2ebf23[_0x8b17('0x42')]:_0x26bc15[_0x8b17('0x3f')];if(!_0x13c302[_0x8b17('0x44')]['hasOwnProperty']('nolimit')){_0x2ebf23[_0x8b17('0x26')]=qs[_0x8b17('0x26')](_0x13c302[_0x8b17('0x44')][_0x8b17('0x26')]);_0x2ebf23[_0x8b17('0x24')]=qs[_0x8b17('0x24')](_0x13c302[_0x8b17('0x44')][_0x8b17('0x24')]);}_0x2ebf23[_0x8b17('0x47')]=qs[_0x8b17('0x48')](_0x13c302[_0x8b17('0x44')][_0x8b17('0x48')]);_0x2ebf23[_0x8b17('0x49')]=qs[_0x8b17('0x40')](_[_0x8b17('0x4a')](_0x13c302[_0x8b17('0x44')],_0x26bc15[_0x8b17('0x40')]));_0x2ebf23['where']['FaxInteractionId']=_0x3198c2['id'];if(_0x13c302[_0x8b17('0x44')][_0x8b17('0x82')]){_0x2ebf23[_0x8b17('0x49')]=_[_0x8b17('0x9f')](_0x2ebf23[_0x8b17('0x49')],{'$or':_[_0x8b17('0x34')](_0x2ebf23[_0x8b17('0x42')],function(_0x41e90a){var _0x141bfa={};_0x141bfa[_0x41e90a]={'$like':'%'+_0x13c302[_0x8b17('0x44')]['filter']+'%'};return _0x141bfa;})});}if(_0x13c302[_0x8b17('0x44')][_0x8b17('0x78')]){var _0x833a43=_0x13c302[_0x8b17('0x44')][_0x8b17('0x78')]['split'](',');var _0xfc263f={};_0xfc263f[_0x833a43[0x0]]={'$gte':moment(_0x833a43[0x1])['format'](_0x8b17('0xc2'))};_0x2ebf23[_0x8b17('0x49')]=_['merge'](_0x2ebf23['where'],_0xfc263f);}_0x2ebf23=_[_0x8b17('0x9f')]({},_0x2ebf23,_0x13c302[_0x8b17('0xb9')]);return db[_0x8b17('0xbd')][_0x8b17('0x27')]({'where':_0x2ebf23[_0x8b17('0x49')]})[_0x8b17('0x2d')](function(_0x5014d3){_0x3cfe76['count']=_0x5014d3;if(_0x13c302[_0x8b17('0x44')][_0x8b17('0xb8')]){_0x2ebf23['include']=[{'all':!![]}];}return db[_0x8b17('0xbd')]['findAll'](_0x2ebf23);})['then'](function(_0x163da1){_0x3cfe76[_0x8b17('0xb4')]=_0x163da1;return _0x3cfe76;});}})[_0x8b17('0x2d')](respondWithFilteredResult(_0x300461,_0x2ebf23))[_0x8b17('0xb5')](handleError(_0x300461,null));};exports[_0x8b17('0xc3')]=function(_0x388d03,_0x408ddf,_0x3680e8){return db[_0x8b17('0xa0')][_0x8b17('0x62')]({'where':{'id':_0x388d03[_0x8b17('0xb7')]['id']}})[_0x8b17('0x2d')](handleEntityNotFound(_0x408ddf,null))['then'](function(_0x1863d1){if(_0x1863d1){return _0x1863d1[_0x8b17('0xc4')](_0x388d03[_0x8b17('0x71')][_0x8b17('0xbe')],_[_0x8b17('0xbf')](_0x388d03['body'],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x8b17('0xc5')]({'attributes':['id','name',_0x8b17('0x4c')],'where':{'id':_0x388d03[_0x8b17('0x71')][_0x8b17('0xbe')]}});})[_0x8b17('0x2d')](function(_0x18e243){socket[_0x8b17('0xc6')](_0x8b17('0xc7'),{'id':Number(_0x388d03[_0x8b17('0xb7')]['id']),'tags':_0x18e243||[]});return{'id':Number(_0x388d03[_0x8b17('0xb7')]['id']),'tags':_0x18e243||[]};});}})[_0x8b17('0x2d')](respondWithResult(_0x408ddf,null))['catch'](handleError(_0x408ddf,null));};exports[_0x8b17('0xc8')]=function(_0xf863ef,_0x472834,_0x191e57){return db[_0x8b17('0xa0')][_0x8b17('0x62')]({'where':{'id':_0xf863ef[_0x8b17('0xb7')]['id']}})['then'](handleEntityNotFound(_0x472834,null))[_0x8b17('0x2d')](function(_0xfde0df){if(_0xfde0df){return _0xfde0df[_0x8b17('0xc8')](_0xf863ef['query'][_0x8b17('0xbe')]);}})[_0x8b17('0x2d')](respondWithStatusCode(_0x472834,null))[_0x8b17('0xb5')](handleError(_0x472834,null));};exports[_0x8b17('0xc9')]=function(_0x58ec67,_0x529591){var _0x4a3993=moment()[_0x8b17('0xca')]()[_0x8b17('0x9d')]();var _0x57577a=path['join'](config['root'],_0x8b17('0xcb'),_0x8b17('0xcc'),'tmp');var _0x5e7c50=path[_0x8b17('0xcd')](config['root'],_0x8b17('0xcb'),_0x8b17('0xcc'),_0x8b17('0xce'));var _0x43e820=path[_0x8b17('0xcd')](_0x57577a,_0x4a3993);var _0x1215ff=util[_0x8b17('0xcf')](_0x8b17('0xd0'),_0x58ec67['params']['id'],_0x4a3993);var _0x3b3bf5=path[_0x8b17('0xcd')](_0x57577a,_0x1215ff);var _0x452765=[];_0x452765['push']({'model':db[_0x8b17('0xd1')],'as':'Attachment','raw':!![]});var _0x16eed2=[{'model':db[_0x8b17('0xbd')],'as':_0x8b17('0xd2'),'attributes':['id',_0x8b17('0x71'),'createdAt'],'include':_0x452765}];return db[_0x8b17('0xa0')]['find']({'where':{'id':_0x58ec67[_0x8b17('0xb7')]['id']},'include':_0x16eed2})[_0x8b17('0x2d')](handleEntityNotFound(_0x529591,null))[_0x8b17('0x2d')](function(_0x1ac350){if(_0x1ac350&&_0x1ac350[_0x8b17('0xd2')]){var _0x4c58b9=_0x1ac350[_0x8b17('0xd3')]({'plain':!![]});fs['mkdirSync'](_0x43e820);for(var _0x228133=0x0;_0x228133<_0x4c58b9[_0x8b17('0xd2')][_0x8b17('0x45')];_0x228133++){var _0x2c388d=_0x4c58b9['Messages'][_0x228133][_0x8b17('0xd1')];if(_0x2c388d){var _0x47af81=path[_0x8b17('0xcd')](_0x5e7c50,_0x2c388d[_0x8b17('0xd4')]);if(fs['existsSync'](_0x47af81)){fs[_0x8b17('0xd5')](_0x47af81)[_0x8b17('0xd6')](fs[_0x8b17('0xd7')](path[_0x8b17('0xcd')](_0x43e820,_0x2c388d[_0x8b17('0xd4')])));}}}return BPromise['resolve']()['then'](function(){return new BPromise(function(_0x22e6b2,_0x477f05){zipdir(_0x43e820,{'saveTo':_0x3b3bf5},function(_0x453c7f,_0x5cb892){if(_0x453c7f)return _0x477f05(_0x453c7f);return _0x22e6b2(_0x5cb892);});})['then'](function(){return new BPromise(function(_0xea3566,_0x2979c3){rimraf(_0x43e820,function(_0x443407){if(_0x443407)_0x2979c3(_0x443407);return _0xea3566();});});})['then'](function(){return _0x529591[_0x8b17('0xc9')](_0x3b3bf5,_0x1215ff,function(_0x42b1f7){if(_0x42b1f7){console['log']('err',_0x42b1f7);}else{fs['unlinkSync'](_0x3b3bf5);}});});});}else{return _0x529591['sendStatus'](0xc8);}})[_0x8b17('0xb5')](handleError(_0x529591,null));};
\ No newline at end of file
+var _0x8342=['to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','fullname','TagIds','Tags','forEach','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','user_has_fax_interactions','left_join','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','value','having','`\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?','ContactId','buildExpression','text','start','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','all','show','params','intersection','include','options','create','describe','addMessage','ids','findOne','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','server','root','files','attachments','transcript-%d-%s.zip','Attachment','Messages','createdAt','get','mkdirSync','basename','createReadStream','pipe','createWriteStream','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path'];(function(_0x4796d9,_0xc2a231){var _0x3912c0=function(_0x442951){while(--_0x442951){_0x4796d9['push'](_0x4796d9['shift']());}};_0x3912c0(++_0xc2a231);}(_0x8342,0x1ae));var _0x2834=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0x8342[_0x3a8db5];return _0x2c03cd;};'use strict';var emlformat=require(_0x2834('0x0'));var rimraf=require(_0x2834('0x1'));var zipdir=require(_0x2834('0x2'));var jsonpatch=require(_0x2834('0x3'));var rp=require(_0x2834('0x4'));var moment=require(_0x2834('0x5'));var BPromise=require(_0x2834('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2834('0x7'));var sox=require('sox');var csv=require(_0x2834('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2834('0x9'));var _=require(_0x2834('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2834('0xb'));var deskjs=require(_0x2834('0xc'));var toCsv=require(_0x2834('0x8'));var querystring=require(_0x2834('0xd'));var Papa=require(_0x2834('0xe'));var Redis=require(_0x2834('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2834('0x10'));var hardwareService=require(_0x2834('0x11'));var logger=require(_0x2834('0x12'))(_0x2834('0x13'));var utils=require(_0x2834('0x14'));var config=require(_0x2834('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x2834('0x16'))['db'];config[_0x2834('0x17')]=_[_0x2834('0x18')](config[_0x2834('0x17')],{'host':_0x2834('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2834('0x1a'))[_0x2834('0x1b')](socket);function respondWithStatusCode(_0x512685,_0x476dda){_0x476dda=_0x476dda||0xcc;return function(_0xddd2bb){if(_0xddd2bb){return _0x512685[_0x2834('0x1c')](_0x476dda);}return _0x512685[_0x2834('0x1d')](_0x476dda)[_0x2834('0x1e')]();};}function respondWithResult(_0x2d43d5,_0x4729b1){_0x4729b1=_0x4729b1||0xc8;return function(_0x28c593){if(_0x28c593){return _0x2d43d5[_0x2834('0x1d')](_0x4729b1)[_0x2834('0x1f')](_0x28c593);}};}function respondWithFilteredResult(_0x4ae400,_0xc9d97d){return function(_0x1d9f71){if(_0x1d9f71){var _0x34b679=typeof _0xc9d97d['offset']===_0x2834('0x20')&&typeof _0xc9d97d[_0x2834('0x21')]===_0x2834('0x20');var _0x9f51be=_0x1d9f71['count'];var _0x13f608=_0x34b679?0x0:_0xc9d97d['offset'];var _0x464e91=_0x34b679?_0x1d9f71[_0x2834('0x22')]:_0xc9d97d[_0x2834('0x23')]+_0xc9d97d[_0x2834('0x21')];var _0x23203a;if(_0x464e91>=_0x9f51be){_0x464e91=_0x9f51be;_0x23203a=0xc8;}else{_0x23203a=0xce;}_0x4ae400[_0x2834('0x1d')](_0x23203a);return _0x4ae400['set'](_0x2834('0x24'),_0x13f608+'-'+_0x464e91+'/'+_0x9f51be)[_0x2834('0x1f')](_0x1d9f71);}return null;};}function patchUpdates(_0x5afb37){return function(_0x2dceb2){try{jsonpatch['apply'](_0x2dceb2,_0x5afb37,!![]);}catch(_0x48b303){return BPromise[_0x2834('0x25')](_0x48b303);}return _0x2dceb2[_0x2834('0x26')]();};}function saveUpdates(_0x5d6dae,_0x53f641){return function(_0x3c7aad){if(_0x3c7aad){return _0x3c7aad[_0x2834('0x27')](_0x5d6dae)[_0x2834('0x28')](function(_0x1255e8){return _0x1255e8;});}return null;};}function removeEntity(_0x184d64,_0x479dbf){return function(_0x3356e8){if(_0x3356e8){return _0x3356e8[_0x2834('0x29')]()[_0x2834('0x28')](function(){_0x184d64[_0x2834('0x1d')](0xcc)[_0x2834('0x1e')]();});}};}function handleEntityNotFound(_0x56de6c,_0x5932ce){return function(_0x172966){if(!_0x172966){_0x56de6c[_0x2834('0x1c')](0x194);}return _0x172966;};}function handleError(_0x551401,_0xa7acbc){_0xa7acbc=_0xa7acbc||0x1f4;return function(_0x494c0a){logger[_0x2834('0x2a')](_0x494c0a[_0x2834('0x2b')]);if(_0x494c0a[_0x2834('0x2c')]){delete _0x494c0a[_0x2834('0x2c')];}_0x551401[_0x2834('0x1d')](_0xa7acbc)[_0x2834('0x2d')](_0x494c0a);};}function getInteractionUsers(_0x440f89,_0x1cc84e){return new BPromise(function(_0xf6f764,_0x4a7520){try{if(_0x1cc84e[_0x440f89['id']]){_0x440f89['Users']=_[_0x2834('0x2e')](_0x1cc84e[_0x440f89['id']],function(_0x5eb18c){return{'id':_0x5eb18c['id'],'fullname':_0x5eb18c[_0x2834('0x2f')]};});}}catch(_0x3ae134){_0x4a7520(_0x3ae134);}_0xf6f764(_0x440f89);});}function getInteractionTags(_0x1c98cd,_0x18b1a0){return new BPromise(function(_0x1e6642,_0x434d3c){try{if(_0x1c98cd[_0x2834('0x30')]){_0x1c98cd[_0x2834('0x31')]=[];_0x1c98cd[_0x2834('0x30')]['split'](',')[_0x2834('0x32')](function(_0x5e1064){_0x1c98cd[_0x2834('0x31')][_0x2834('0x33')](_0x18b1a0[_0x5e1064]);});}delete _0x1c98cd[_0x2834('0x30')];}catch(_0x544109){_0x434d3c(_0x544109);}_0x1e6642(_0x1c98cd);});}function updateFaxInteraction(_0x615df7,_0x588a45,_0x378d21){return new BPromise(function(_0x1b6991,_0x13dae2){return getInteractionUsers(_0x615df7,_0x378d21)[_0x2834('0x28')](function(_0x10fc5d){return getInteractionTags(_0x10fc5d,_0x588a45);})[_0x2834('0x28')](function(_0x391fde){_0x1b6991(_0x391fde);})[_0x2834('0x34')](function(_0x4ae454){_0x13dae2(_0x4ae454);});});}exports[_0x2834('0x35')]=function(_0x54ec9c,_0x1fc752){var _0x12a404={},_0x573715={},_0x340237={'count':0x0,'rows':[]};var _0x52bf69=_[_0x2834('0x2e')](db[_0x2834('0x36')][_0x2834('0x37')],function(_0x5c6bbf){return{'name':_0x5c6bbf[_0x2834('0x38')],'type':_0x5c6bbf[_0x2834('0x39')]['key']};});_0x573715[_0x2834('0x3a')]=_[_0x2834('0x2e')](_0x52bf69,'name');_0x573715['query']=_[_0x2834('0x3b')](_0x54ec9c[_0x2834('0x3c')]);_0x573715[_0x2834('0x3d')]=_['intersection'](_0x573715['model'],_0x573715['query']);_0x12a404[_0x2834('0x3e')]=_['intersection'](_0x573715[_0x2834('0x3a')],qs[_0x2834('0x3f')](_0x54ec9c[_0x2834('0x3c')][_0x2834('0x3f')]));_0x12a404[_0x2834('0x3e')]=_0x12a404[_0x2834('0x3e')][_0x2834('0x40')]?_0x12a404[_0x2834('0x3e')]:_0x573715[_0x2834('0x3a')];if(!_0x54ec9c[_0x2834('0x3c')][_0x2834('0x41')](_0x2834('0x42'))){_0x12a404[_0x2834('0x21')]=qs[_0x2834('0x21')](_0x54ec9c[_0x2834('0x3c')][_0x2834('0x21')]);_0x12a404[_0x2834('0x23')]=qs[_0x2834('0x23')](_0x54ec9c[_0x2834('0x3c')][_0x2834('0x23')]);}_0x12a404['order']=qs[_0x2834('0x43')](_0x54ec9c['query'][_0x2834('0x43')]);_0x12a404[_0x2834('0x44')]=qs[_0x2834('0x3d')](_['pick'](_0x54ec9c['query'],_0x573715[_0x2834('0x3d')]),_0x52bf69);var _0x580161=[];var _0xdd54a4=squel['select']()[_0x2834('0x45')]('id')[_0x2834('0x45')]('name')['field'](_0x2834('0x46'))[_0x2834('0x47')](_0x2834('0x48'));var _0x54d148=squel[_0x2834('0x49')]()[_0x2834('0x45')](_0x2834('0x4a'))[_0x2834('0x45')](_0x2834('0x4b'))[_0x2834('0x45')]('ui.FaxInteractionId')[_0x2834('0x47')](_0x2834('0x4c'),'ui')[_0x2834('0x4d')](_0x2834('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x4a4753=squel['select']()[_0x2834('0x47')](_0x2834('0x4f'),'i')[_0x2834('0x4d')](_0x2834('0x50'),'c',_0x2834('0x51'))['left_join'](_0x2834('0x4e'),'o','o.id\x20=\x20i.UserId')[_0x2834('0x4d')](_0x2834('0x52'),'a',_0x2834('0x53'))[_0x2834('0x4d')](_0x2834('0x54'),'me','me.FaxInteractionId\x20=\x20i.id')[_0x2834('0x4d')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0x2834('0x4d')]('tools_tags','t',_0x2834('0x55'));var _0x5c450e=squel[_0x2834('0x56')]();var _0x5ce134=[];var _0x514710=squel[_0x2834('0x56')]();var _0x288dd7;if(_0x54ec9c[_0x2834('0x3c')][_0x2834('0x57')]){_0x288dd7=as[_0x2834('0x58')](_0x54ec9c[_0x2834('0x3c')]['search']);var _0x15709f=_0x288dd7['sqlOperator'];for(var _0x494a30=0x0;_0x494a30<_0x288dd7[_0x2834('0x59')][_0x2834('0x40')];_0x494a30++){var _0xb8773a=_0x288dd7['conditions'][_0x494a30];var _0x3e801c='i';var _0xa3bf13=_[_0x2834('0x5a')](_0x52bf69,[_0x2834('0x2c'),_0xb8773a[_0x2834('0x45')]]);if(!_0xa3bf13){switch(_0xb8773a[_0x2834('0x45')]){case'unreadMessages':if(_0xb8773a[_0x2834('0x5b')]==0x1){_0x4a4753['having']('`'+_0xb8773a['field']+'`\x20=\x200');}else{_0x4a4753[_0x2834('0x5c')]('`'+_0xb8773a[_0x2834('0x45')]+_0x2834('0x5d'));}break;case _0x2834('0x5e'):if(_0xb8773a[_0x2834('0x5f')]==='$substring'){if(_0xb8773a[_0x2834('0x5b')][_0x2834('0x60')]('\x20')[_0x2834('0x40')]>0x1){_0x5c450e[_0x15709f](_0x2834('0x61'),qs['getFullTextValue'](_0xb8773a[_0x2834('0x5b')]),null);}else{var _0x5282f6='%'+_0xb8773a[_0x2834('0x5b')]+'%';_0x5c450e[_0x15709f](_0x2834('0x62'),_0x5282f6,_0x5282f6,_0x5282f6);}}else{_0xa3bf13=_[_0x2834('0x5a')](_0x52bf69,['name',_0x2834('0x63')]);_0xb8773a[_0x2834('0x45')]=_0x2834('0x63');_0x5a5c72=as[_0x2834('0x64')](_0x3e801c,_0xa3bf13[_0x2834('0x39')],_0xb8773a);_0x5c450e[_0x15709f](_0x5a5c72[_0x2834('0x65')],_0x5a5c72['value'][_0x2834('0x66')],_0x5a5c72[_0x2834('0x5b')][_0x2834('0x1e')]);}break;case _0x2834('0x67'):var _0x1a320d=_0xb8773a[_0x2834('0x5b')]['split'](',')['map'](function(_0x580110){return Number(_0x580110);});_0x1a320d[_0x2834('0x32')](function(_0x11e37b){_0x514710['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x11e37b+',%');});_0x5ce134=_[_0x2834('0x68')](_0x5ce134,_0x1a320d);break;case _0x2834('0x69'):if(_0xb8773a[_0x2834('0x5f')]===_0x2834('0x6a')){_0x5c450e[_0x15709f](_0x2834('0x6b'),'%'+_0xb8773a[_0x2834('0x5b')]+'%',null);}else{_0xa3bf13=_[_0x2834('0x5a')](_0x52bf69,[_0x2834('0x2c'),'UserId']);_0xb8773a[_0x2834('0x45')]=_0x2834('0x6c');_0x5a5c72=as['buildExpression'](_0x3e801c,_0xa3bf13['type'],_0xb8773a);_0x5c450e[_0x15709f](_0x5a5c72[_0x2834('0x65')],_0x5a5c72[_0x2834('0x5b')][_0x2834('0x66')],_0x5a5c72['value'][_0x2834('0x1e')]);}break;case _0x2834('0x6d'):_0x5a5c72=as[_0x2834('0x64')]('me',null,_0xb8773a);_0x5c450e[_0x15709f](_0x5a5c72[_0x2834('0x65')],_0x5a5c72['value'][_0x2834('0x66')],_0x5a5c72[_0x2834('0x5b')][_0x2834('0x1e')]);break;}}else{var _0x5a5c72=as[_0x2834('0x64')](_0x3e801c,_0xa3bf13['type'],_0xb8773a);_0x5c450e[_0x15709f](_0x5a5c72[_0x2834('0x65')],_0x5a5c72['value'][_0x2834('0x66')],_0x5a5c72[_0x2834('0x5b')][_0x2834('0x1e')]);}}}else{var _0x6de357=_(_0x54ec9c[_0x2834('0x3c')])['keys']()[_0x2834('0x2e')](function(_0x47808a){return _[_0x2834('0x6e')](_0x52bf69,['name',_0x47808a])?_0x47808a:undefined;})[_0x2834('0x6f')]()[_0x2834('0x5b')]();if(!_[_0x2834('0x70')](_0x6de357)){_0x6de357[_0x2834('0x32')](function(_0x45e4d1){if(_0x45e4d1===_0x2834('0x71')){_0x4a4753[_0x2834('0x44')](_0x2834('0x72'),[][_0x2834('0x73')](_0x54ec9c['query'][_0x45e4d1]));}else if(_0x45e4d1==='createdAt'){var _0x31c75e=JSON[_0x2834('0x74')](_0x54ec9c[_0x2834('0x3c')][_0x45e4d1])['$gte'];var _0x360b56=JSON['parse'](_0x54ec9c['query'][_0x45e4d1])['$lte'];_0x4a4753[_0x2834('0x44')](_0x2834('0x75'),_0x31c75e,_0x360b56);}else{if(_0x54ec9c[_0x2834('0x3c')][_0x45e4d1]==='null'){_0x4a4753[_0x2834('0x44')]('i.'+_0x45e4d1+_0x2834('0x76'));}else{_0x4a4753[_0x2834('0x44')]('i.'+_0x45e4d1+_0x2834('0x77'),_0x54ec9c[_0x2834('0x3c')][_0x45e4d1]);}}});}if(_0x54ec9c['query'][_0x2834('0x78')]){if(_0x54ec9c[_0x2834('0x3c')][_0x2834('0x78')]==0x1){_0x4a4753[_0x2834('0x5c')](_0x2834('0x79'));}else{_0x4a4753[_0x2834('0x5c')](_0x2834('0x7a'));}}if(_0x54ec9c['query'][_0x2834('0x7b')]){_0x5ce134=_[_0x2834('0x7c')](_0x54ec9c[_0x2834('0x3c')][_0x2834('0x7b')])?_0x54ec9c[_0x2834('0x3c')][_0x2834('0x7b')]:new Array(_0x54ec9c[_0x2834('0x3c')][_0x2834('0x7b')]);_0x5ce134[_0x2834('0x32')](function(_0x24e33c){_0x514710['or'](_0x2834('0x7d'),'%,'+_0x24e33c+',%');});}if(_0x54ec9c[_0x2834('0x3c')][_0x2834('0x7e')]){var _0x4eba25=_0x54ec9c[_0x2834('0x3c')][_0x2834('0x7e')][_0x2834('0x7f')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x2834('0x80')](_0x4eba25)){_0x5c450e['or'](_0x2834('0x81'),_0x4eba25+'%')['or'](_0x2834('0x82'),_0x4eba25+'%');}_0x5c450e['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4eba25+'%');}}_0x4a4753[_0x2834('0x44')](_0x5c450e);_0x4a4753[_0x2834('0x83')](_0x2834('0x84'));var _0x52f2eb={'type':db[_0x2834('0x85')][_0x2834('0x86')][_0x2834('0x87')],'raw':!![]};var _0x535fa9=_0x4a4753[_0x2834('0x88')]();_0x535fa9[_0x2834('0x45')](_0x2834('0x84'));_0x535fa9['field'](_0x2834('0x89'),_0x2834('0x8a'));if(_0x12a404[_0x2834('0x8b')]){_0x12a404[_0x2834('0x8b')]['forEach'](function(_0x5aeddf){var _0xc2d7ca=_0x5aeddf[0x0]===_0x2834('0x8c')?_0x5aeddf[0x0]:'i.'+_0x5aeddf[0x0];_0x4a4753[_0x2834('0x8b')](_0xc2d7ca,_0x5aeddf[0x1]===_0x2834('0x8d')?![]:!![]);});}if(!_['isEmpty'](_0x5ce134)){_0x4a4753[_0x2834('0x5c')](_0x514710);_0x535fa9[_0x2834('0x44')](_0x2834('0x8e'),_0x5ce134);}BPromise[_0x2834('0x8f')]()['then'](function(){if(!_0x288dd7){if(_0x54ec9c[_0x2834('0x3c')]['FaxAccountId'])return;_0x535fa9[_0x2834('0x44')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x4a4753[_0x2834('0x44')](_0x2834('0x90'));return;}if(_0x54ec9c['user'][_0x2834('0x91')]!==_0x2834('0x92'))return;return _0x54ec9c[_0x2834('0x93')][_0x2834('0x94')]({'attributes':['id'],'raw':!![]})[_0x2834('0x28')](function(_0x1abbd3){if(_[_0x2834('0x70')](_0x1abbd3)){_0x535fa9[_0x2834('0x44')](_0x2834('0x95'));_0x4a4753[_0x2834('0x44')](_0x2834('0x95'));}else{_0x535fa9[_0x2834('0x44')](_0x2834('0x72'),_[_0x2834('0x2e')](_0x1abbd3,'id'));_0x4a4753['where'](_0x2834('0x72'),_['map'](_0x1abbd3,'id'));}});})['then'](function(){if(_0x54ec9c[_0x2834('0x93')][_0x2834('0x91')]===_0x2834('0x92')&&!_0x288dd7&&!_0x54ec9c[_0x2834('0x3c')][_0x2834('0x71')])return[];return db[_0x2834('0x96')][_0x2834('0x3c')](_0x535fa9[_0x2834('0x97')](),_0x52f2eb);})['then'](function(_0x3e9625){_0x340237[_0x2834('0x22')]=_0x3e9625[_0x2834('0x40')];if(_0x340237[_0x2834('0x22')]===0x0)return[];return db[_0x2834('0x96')][_0x2834('0x3c')](_0xdd54a4[_0x2834('0x97')](),_0x52f2eb)['then'](function(_0x46b5a0){_0x580161=_[_0x2834('0x98')](_0x46b5a0,'id');_0x52f2eb=_[_0x2834('0x99')](_0x52f2eb,{'model':db[_0x2834('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x54ec9c[_0x2834('0x3c')]['fields']){_0x12a404[_0x2834('0x3e')][_0x2834('0x32')](function(_0x568c8e){_0x4a4753[_0x2834('0x45')]('i.'+_0x568c8e);});}else{_0x4a4753[_0x2834('0x45')](_0x2834('0x89'),_0x2834('0x8a'));_0x4a4753[_0x2834('0x45')]('a.key',_0x2834('0x9a'));_0x4a4753[_0x2834('0x45')](_0x2834('0x9b'),'Account.mandatoryDisposition');_0x4a4753[_0x2834('0x45')](_0x2834('0x9c'),_0x2834('0x8c'));_0x4a4753[_0x2834('0x45')](_0x2834('0x9d'));_0x4a4753['field'](_0x2834('0x9e'),_0x2834('0x9f'));_0x4a4753[_0x2834('0x45')](_0x2834('0xa0'),_0x2834('0xa1'));_0x4a4753[_0x2834('0x45')](_0x2834('0xa2'),_0x2834('0xa3'));_0x4a4753[_0x2834('0x45')](_0x2834('0xa4'),_0x2834('0xa5'));_0x4a4753[_0x2834('0x45')]('c.mobile',_0x2834('0xa6'));_0x4a4753[_0x2834('0x45')](_0x2834('0xa7'),_0x2834('0xa8'));_0x4a4753[_0x2834('0x45')](_0x2834('0xa9'),_0x2834('0xaa'));_0x4a4753['field'](_0x2834('0xab'),'Owner.internal');_0x4a4753[_0x2834('0x45')](_0x2834('0xac'),_0x2834('0x30'));}if(_0x12a404['limit'])_0x4a4753[_0x2834('0x21')](_0x12a404[_0x2834('0x21')]);if(_0x12a404[_0x2834('0x23')])_0x4a4753[_0x2834('0x23')](_0x12a404[_0x2834('0x23')]);return db[_0x2834('0x96')]['query'](_0x4a4753[_0x2834('0x97')](),_0x52f2eb);})[_0x2834('0x28')](function(_0x3db2ab){if(_0x3db2ab[_0x2834('0x40')]>0x0)_0x54d148['where'](_0x2834('0xad'),_['map'](_0x3db2ab,'id'));return db[_0x2834('0x96')]['query'](_0x54d148[_0x2834('0x97')](),_0x52f2eb)['then'](function(_0x2b3e14){var _0x558df7=_[_0x2834('0xae')](_0x2b3e14,_0x2834('0xaf'));var _0x6e5e5d=[];_0x3db2ab[_0x2834('0x32')](function(_0x5ed367){_0x6e5e5d[_0x2834('0x33')](updateFaxInteraction(_0x5ed367,_0x580161,_0x558df7));});return BPromise[_0x2834('0xb0')](_0x6e5e5d);});});})[_0x2834('0x28')](function(_0x1ee6ef){_0x340237['rows']=_0x1ee6ef;return _0x340237;})['then'](respondWithFilteredResult(_0x1fc752,_0x12a404))['catch'](handleError(_0x1fc752,null));};exports[_0x2834('0xb1')]=function(_0x2d78fc,_0x16f916){var _0x1bf35a={'raw':![],'where':{'id':_0x2d78fc[_0x2834('0xb2')]['id']}},_0x56ebad={};_0x56ebad[_0x2834('0x3a')]=_[_0x2834('0x3b')](db[_0x2834('0x36')][_0x2834('0x37')]);_0x56ebad[_0x2834('0x3c')]=_[_0x2834('0x3b')](_0x2d78fc['query']);_0x56ebad[_0x2834('0x3d')]=_[_0x2834('0xb3')](_0x56ebad[_0x2834('0x3a')],_0x56ebad[_0x2834('0x3c')]);_0x1bf35a[_0x2834('0x3e')]=_[_0x2834('0xb3')](_0x56ebad[_0x2834('0x3a')],qs[_0x2834('0x3f')](_0x2d78fc[_0x2834('0x3c')]['fields']));_0x1bf35a[_0x2834('0x3e')]=_0x1bf35a[_0x2834('0x3e')][_0x2834('0x40')]?_0x1bf35a[_0x2834('0x3e')]:_0x56ebad[_0x2834('0x3a')];if(_0x2d78fc[_0x2834('0x3c')]['includeAll']){_0x1bf35a[_0x2834('0xb4')]=[{'all':!![]}];}_0x1bf35a=_['merge']({},_0x1bf35a,_0x2d78fc[_0x2834('0xb5')]);return db[_0x2834('0x36')]['find'](_0x1bf35a)[_0x2834('0x28')](handleEntityNotFound(_0x16f916,null))[_0x2834('0x28')](respondWithResult(_0x16f916,null))['catch'](handleError(_0x16f916,null));};exports['create']=function(_0x3b8580,_0x97213e){return db['FaxInteraction'][_0x2834('0xb6')](_0x3b8580[_0x2834('0x6d')],{})['then'](respondWithResult(_0x97213e,0xc9))[_0x2834('0x34')](handleError(_0x97213e,null));};exports[_0x2834('0x27')]=function(_0x2d57aa,_0x38b111){if(_0x2d57aa[_0x2834('0x6d')]['id']){delete _0x2d57aa['body']['id'];}return db[_0x2834('0x36')][_0x2834('0x5a')]({'where':{'id':_0x2d57aa[_0x2834('0xb2')]['id']}})['then'](handleEntityNotFound(_0x38b111,null))[_0x2834('0x28')](saveUpdates(_0x2d57aa[_0x2834('0x6d')],null))[_0x2834('0x28')](respondWithResult(_0x38b111,null))[_0x2834('0x34')](handleError(_0x38b111,null));};exports[_0x2834('0x29')]=function(_0x2c677e,_0x577918){return db['FaxInteraction'][_0x2834('0x5a')]({'where':{'id':_0x2c677e[_0x2834('0xb2')]['id']}})[_0x2834('0x28')](handleEntityNotFound(_0x577918,null))[_0x2834('0x28')](removeEntity(_0x577918,null))[_0x2834('0x34')](handleError(_0x577918,null));};exports[_0x2834('0xb7')]=function(_0x3b22fd,_0x3034df){return db[_0x2834('0x36')][_0x2834('0xb7')]()[_0x2834('0x28')](respondWithResult(_0x3034df,null))[_0x2834('0x34')](handleError(_0x3034df,null));};exports[_0x2834('0xb8')]=function(_0x213e45,_0x2fd8c5,_0x5db9ed){return db['FaxMessage'][_0x2834('0x5a')]({'where':{'id':_0x213e45[_0x2834('0xb2')]['id']}})[_0x2834('0x28')](handleEntityNotFound(_0x2fd8c5,null))[_0x2834('0x28')](function(_0x2d43ab){if(_0x2d43ab){return _0x2d43ab[_0x2834('0xb8')](_0x213e45[_0x2834('0x6d')][_0x2834('0xb9')],_['omit'](_0x213e45['body'],[_0x2834('0xb9'),'id'])||{});}})[_0x2834('0x28')](respondWithResult(_0x2fd8c5,null))[_0x2834('0x34')](handleError(_0x2fd8c5,null));};exports['getMessages']=function(_0x891240,_0x5e0dda,_0x22f6c3){var _0x3a71df={'raw':![],'where':{}};var _0x33eb70={};var _0x1d7901={'count':0x0,'rows':[]};return db[_0x2834('0x36')][_0x2834('0xba')]({'where':{'id':_0x891240[_0x2834('0xb2')]['id']}})[_0x2834('0x28')](handleEntityNotFound(_0x5e0dda,null))['then'](function(_0xf0127a){if(_0xf0127a){_0x33eb70['model']=_[_0x2834('0x3b')](db[_0x2834('0xbb')][_0x2834('0x37')]);_0x33eb70[_0x2834('0x3c')]=_['keys'](_0x891240['query']);_0x33eb70[_0x2834('0x3d')]=_['intersection'](_0x33eb70['model'],_0x33eb70[_0x2834('0x3c')]);_0x3a71df[_0x2834('0x3e')]=_[_0x2834('0xb3')](_0x33eb70[_0x2834('0x3a')],qs[_0x2834('0x3f')](_0x891240['query']['fields']));_0x3a71df[_0x2834('0x3e')]=_0x3a71df[_0x2834('0x3e')][_0x2834('0x40')]?_0x3a71df['attributes']:_0x33eb70[_0x2834('0x3a')];if(!_0x891240[_0x2834('0x3c')][_0x2834('0x41')](_0x2834('0x42'))){_0x3a71df[_0x2834('0x21')]=qs[_0x2834('0x21')](_0x891240[_0x2834('0x3c')][_0x2834('0x21')]);_0x3a71df[_0x2834('0x23')]=qs[_0x2834('0x23')](_0x891240[_0x2834('0x3c')][_0x2834('0x23')]);}_0x3a71df[_0x2834('0x8b')]=qs['sort'](_0x891240[_0x2834('0x3c')]['sort']);_0x3a71df[_0x2834('0x44')]=qs[_0x2834('0x3d')](_['pick'](_0x891240[_0x2834('0x3c')],_0x33eb70['filters']));_0x3a71df[_0x2834('0x44')][_0x2834('0xaf')]=_0xf0127a['id'];if(_0x891240[_0x2834('0x3c')][_0x2834('0x7e')]){_0x3a71df[_0x2834('0x44')]=_['merge'](_0x3a71df[_0x2834('0x44')],{'$or':_['map'](_0x3a71df[_0x2834('0x3e')],function(_0x2241b1){var _0x33787d={};_0x33787d[_0x2241b1]={'$like':'%'+_0x891240[_0x2834('0x3c')]['filter']+'%'};return _0x33787d;})});}if(_0x891240[_0x2834('0x3c')][_0x2834('0xbc')]){var _0xabb0cf=_0x891240['query'][_0x2834('0xbc')]['split'](',');var _0x3176a3={};_0x3176a3[_0xabb0cf[0x0]]={'$gte':moment(_0xabb0cf[0x1])[_0x2834('0xbd')](_0x2834('0xbe'))};_0x3a71df['where']=_['merge'](_0x3a71df[_0x2834('0x44')],_0x3176a3);}_0x3a71df=_[_0x2834('0x99')]({},_0x3a71df,_0x891240[_0x2834('0xb5')]);return db[_0x2834('0xbb')]['count']({'where':_0x3a71df['where']})[_0x2834('0x28')](function(_0x3266ad){_0x1d7901['count']=_0x3266ad;if(_0x891240['query']['includeAll']){_0x3a71df[_0x2834('0xb4')]=[{'all':!![]}];}return db[_0x2834('0xbb')][_0x2834('0xbf')](_0x3a71df);})['then'](function(_0x211a55){_0x1d7901[_0x2834('0xc0')]=_0x211a55;return _0x1d7901;});}})[_0x2834('0x28')](respondWithFilteredResult(_0x5e0dda,_0x3a71df))['catch'](handleError(_0x5e0dda,null));};exports[_0x2834('0xc1')]=function(_0x431642,_0x30f794,_0x2661ae){return db[_0x2834('0x36')]['find']({'where':{'id':_0x431642[_0x2834('0xb2')]['id']}})[_0x2834('0x28')](handleEntityNotFound(_0x30f794,null))[_0x2834('0x28')](function(_0x352a04){if(_0x352a04){return _0x352a04[_0x2834('0xc2')](_0x431642[_0x2834('0x6d')][_0x2834('0xb9')],_[_0x2834('0xc3')](_0x431642['body'],[_0x2834('0xb9'),'id'])||{})[_0x2834('0xc4')](function(){return db[_0x2834('0x67')][_0x2834('0xbf')]({'attributes':['id','name',_0x2834('0x46')],'where':{'id':_0x431642[_0x2834('0x6d')][_0x2834('0xb9')]}});})['then'](function(_0x469b49){socket[_0x2834('0xc5')](_0x2834('0xc6'),{'id':Number(_0x431642[_0x2834('0xb2')]['id']),'tags':_0x469b49||[]});return{'id':Number(_0x431642['params']['id']),'tags':_0x469b49||[]};});}})[_0x2834('0x28')](respondWithResult(_0x30f794,null))['catch'](handleError(_0x30f794,null));};exports[_0x2834('0xc7')]=function(_0x40e387,_0x579138,_0x42a8f1){return db[_0x2834('0x36')][_0x2834('0x5a')]({'where':{'id':_0x40e387[_0x2834('0xb2')]['id']}})[_0x2834('0x28')](handleEntityNotFound(_0x579138,null))[_0x2834('0x28')](function(_0x35670b){if(_0x35670b){return _0x35670b['removeTags'](_0x40e387['query']['ids']);}})['then'](respondWithStatusCode(_0x579138,null))[_0x2834('0x34')](handleError(_0x579138,null));};exports[_0x2834('0xc8')]=function(_0x3ee070,_0x4909bc){var _0x324d19=moment()[_0x2834('0xc9')]()[_0x2834('0x97')]();var _0x1329aa=path[_0x2834('0xca')](config['root'],_0x2834('0xcb'),'files','tmp');var _0x3f27a3=path[_0x2834('0xca')](config[_0x2834('0xcc')],_0x2834('0xcb'),_0x2834('0xcd'),_0x2834('0xce'));var _0x387202=path['join'](_0x1329aa,_0x324d19);var _0x44cf08=util[_0x2834('0xbd')](_0x2834('0xcf'),_0x3ee070[_0x2834('0xb2')]['id'],_0x324d19);var _0x492e00=path[_0x2834('0xca')](_0x1329aa,_0x44cf08);var _0xd55322=[];_0xd55322[_0x2834('0x33')]({'model':db[_0x2834('0xd0')],'as':_0x2834('0xd0'),'raw':!![]});var _0x330190=[{'model':db[_0x2834('0xbb')],'as':_0x2834('0xd1'),'attributes':['id',_0x2834('0x6d'),_0x2834('0xd2')],'include':_0xd55322}];return db[_0x2834('0x36')][_0x2834('0x5a')]({'where':{'id':_0x3ee070[_0x2834('0xb2')]['id']},'include':_0x330190})[_0x2834('0x28')](handleEntityNotFound(_0x4909bc,null))[_0x2834('0x28')](function(_0x1d5e85){if(_0x1d5e85&&_0x1d5e85[_0x2834('0xd1')]){var _0x4f288f=_0x1d5e85[_0x2834('0xd3')]({'plain':!![]});fs[_0x2834('0xd4')](_0x387202);for(var _0x17945f=0x0;_0x17945f<_0x4f288f[_0x2834('0xd1')][_0x2834('0x40')];_0x17945f++){var _0x3275ce=_0x4f288f[_0x2834('0xd1')][_0x17945f][_0x2834('0xd0')];if(_0x3275ce){var _0xa33723=path[_0x2834('0xca')](_0x3f27a3,_0x3275ce[_0x2834('0xd5')]);if(fs['existsSync'](_0xa33723)){fs[_0x2834('0xd6')](_0xa33723)[_0x2834('0xd7')](fs[_0x2834('0xd8')](path['join'](_0x387202,_0x3275ce[_0x2834('0xd5')])));}}}return BPromise[_0x2834('0x8f')]()[_0x2834('0x28')](function(){return new BPromise(function(_0xdb359,_0x37b0a8){zipdir(_0x387202,{'saveTo':_0x492e00},function(_0x247b47,_0x43d09d){if(_0x247b47)return _0x37b0a8(_0x247b47);return _0xdb359(_0x43d09d);});})[_0x2834('0x28')](function(){return new BPromise(function(_0x371f0f,_0x568331){rimraf(_0x387202,function(_0x1dec45){if(_0x1dec45)_0x568331(_0x1dec45);return _0x371f0f();});});})[_0x2834('0x28')](function(){return _0x4909bc[_0x2834('0xc8')](_0x492e00,_0x44cf08,function(_0x2087d8){if(_0x2087d8){console[_0x2834('0xd9')](_0x2834('0xda'),_0x2087d8);}else{fs['unlinkSync'](_0x492e00);}});});});}else{return _0x4909bc[_0x2834('0x1c')](0xc8);}})[_0x2834('0x34')](handleError(_0x4909bc,null));};
\ No newline at end of file
index 860f84b..67d1405 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b55=['Users','map','length','emit','catch','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue'];(function(_0x5a1d58,_0x42ab8d){var _0x5911a9=function(_0x3769a4){while(--_0x3769a4){_0x5a1d58['push'](_0x5a1d58['shift']());}};_0x5911a9(++_0x42ab8d);}(_0x3b55,0xf5));var _0x53b5=function(_0x544072,_0xc41ee1){_0x544072=_0x544072-0x0;var _0x590bf6=_0x3b55[_0x544072];return _0x590bf6;};'use strict';var EventEmitter=require(_0x53b5('0x0'));var FaxInteraction=require(_0x53b5('0x1'))['db'][_0x53b5('0x2')];var FaxMessage=require(_0x53b5('0x1'))['db'][_0x53b5('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x53b5('0x4')](0x0);var events={'afterCreate':_0x53b5('0x5'),'afterUpdate':_0x53b5('0x6'),'afterDestroy':_0x53b5('0x7')};function emitEvent(_0x1461d0){return function(_0x2bfb54,_0x38ccb6,_0x1500dc){_0x2bfb54['getUsers']({'attributes':['id'],'raw':!![]})[_0x53b5('0x8')](function(_0x25124d){_0x2bfb54[_0x53b5('0x9')](_0x53b5('0xa'),_0x25124d[_0x53b5('0xb')](function(_0x3a9295){return{'id':_0x3a9295['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x2bfb54['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x407b3c){_0x2bfb54['setDataValue']('unreadMessages',_0x407b3c[_0x53b5('0xc')]);FaxInteractionEvents[_0x53b5('0xd')](_0x1461d0+':'+_0x2bfb54['id'],_0x2bfb54);FaxInteractionEvents[_0x53b5('0xd')](_0x1461d0,_0x2bfb54);_0x1500dc(null);})[_0x53b5('0xe')](_0x1500dc(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x53b5('0xf')](e,emitEvent(event));}}module[_0x53b5('0x10')]=FaxInteractionEvents;
\ No newline at end of file
+var _0xcd1a=['unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','save','remove','then','setDataValue','Users','map','findAll'];(function(_0x2fc403,_0x5b052a){var _0xe7f1ff=function(_0xe0a58e){while(--_0xe0a58e){_0x2fc403['push'](_0x2fc403['shift']());}};_0xe7f1ff(++_0x5b052a);}(_0xcd1a,0x1f4));var _0xacd1=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xcd1a[_0x3070dc];return _0x431489;};'use strict';var EventEmitter=require(_0xacd1('0x0'));var FaxInteraction=require(_0xacd1('0x1'))['db'][_0xacd1('0x2')];var FaxMessage=require(_0xacd1('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xacd1('0x3'),'afterUpdate':'update','afterDestroy':_0xacd1('0x4')};function emitEvent(_0x56cb54){return function(_0x57b979,_0xe4f602,_0x3608bc){_0x57b979['getUsers']({'attributes':['id'],'raw':!![]})[_0xacd1('0x5')](function(_0x377e87){_0x57b979[_0xacd1('0x6')](_0xacd1('0x7'),_0x377e87[_0xacd1('0x8')](function(_0x911e7c){return{'id':_0x911e7c['id']};}));return FaxMessage[_0xacd1('0x9')]({'where':{'FaxInteractionId':_0x57b979['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3a105d){_0x57b979[_0xacd1('0x6')](_0xacd1('0xa'),_0x3a105d[_0xacd1('0xb')]);FaxInteractionEvents[_0xacd1('0xc')](_0x56cb54+':'+_0x57b979['id'],_0x57b979);FaxInteractionEvents['emit'](_0x56cb54,_0x57b979);_0x3608bc(null);})[_0xacd1('0xd')](_0x3608bc(null));};}for(var e in events){if(events[_0xacd1('0xe')](e)){var event=events[e];FaxInteraction[_0xacd1('0xf')](e,emitEvent(event));}}module[_0xacd1('0x10')]=FaxInteractionEvents;
\ No newline at end of file
index dde8c8b..780a63f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55d6=['changed','closed','closedAt','format','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','FaxInteraction','fax_interactions'];(function(_0x5130c5,_0x5a3458){var _0x39acbf=function(_0x3bd9b6){while(--_0x3bd9b6){_0x5130c5['push'](_0x5130c5['shift']());}};_0x39acbf(++_0x5a3458);}(_0x55d6,0x112));var _0x655d=function(_0x3dc68b,_0xb1f4ac){_0x3dc68b=_0x3dc68b-0x0;var _0x2d00bb=_0x55d6[_0x3dc68b];return _0x2d00bb;};'use strict';var _=require(_0x655d('0x0'));var util=require(_0x655d('0x1'));var logger=require('../../config/logger')(_0x655d('0x2'));var moment=require(_0x655d('0x3'));var BPromise=require(_0x655d('0x4'));var rp=require(_0x655d('0x5'));var fs=require('fs');var path=require(_0x655d('0x6'));var rimraf=require('rimraf');var config=require(_0x655d('0x7'));var attributes=require(_0x655d('0x8'));module['exports']=function(_0x4f30a4,_0x23b634){return _0x4f30a4['define'](_0x655d('0x9'),attributes,{'tableName':_0x655d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52dbcc,_0x707022,_0x57eab1){if(_0x52dbcc[_0x655d('0xb')](_0x655d('0xc'))){_0x52dbcc[_0x655d('0xd')]=moment()[_0x655d('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x57eab1(null,_0x52dbcc);}}});};
\ No newline at end of file
+var _0xc7c3=['util','../../config/logger','request-promise','path','../../config/environment','./faxInteraction.attributes','FaxInteraction','fax_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3a441a,_0x43eb56){var _0x3128a2=function(_0x5d5a17){while(--_0x5d5a17){_0x3a441a['push'](_0x3a441a['shift']());}};_0x3128a2(++_0x43eb56);}(_0xc7c3,0x143));var _0x3c7c=function(_0x54c289,_0x247de9){_0x54c289=_0x54c289-0x0;var _0x46edb1=_0xc7c3[_0x54c289];return _0x46edb1;};'use strict';var _=require(_0x3c7c('0x0'));var util=require(_0x3c7c('0x1'));var logger=require(_0x3c7c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3c7c('0x3'));var fs=require('fs');var path=require(_0x3c7c('0x4'));var rimraf=require('rimraf');var config=require(_0x3c7c('0x5'));var attributes=require(_0x3c7c('0x6'));module['exports']=function(_0xc36ebc,_0x321cc5){return _0xc36ebc['define'](_0x3c7c('0x7'),attributes,{'tableName':_0x3c7c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x166e42,_0x3d160c,_0x186f61){if(_0x166e42[_0x3c7c('0x9')]('closed')){_0x166e42['closedAt']=moment()[_0x3c7c('0xa')](_0x3c7c('0xb'));}_0x186f61(null,_0x166e42);}}});};
\ No newline at end of file
index a82a139..e7e7ab6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f49=['util','moment','bluebird','randomstring','ioredis','client','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','debug','AddTagsToFaxInteraction','find','addTags','ids','spread','AddTags','catch','lodash'];(function(_0x29b97,_0x34f5ee){var _0x474630=function(_0x4d8751){while(--_0x4d8751){_0x29b97['push'](_0x29b97['shift']());}};_0x474630(++_0x34f5ee);}(_0x0f49,0xef));var _0x90f4=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x0f49[_0x425716];return _0x2d39af;};'use strict';var _=require(_0x90f4('0x0'));var util=require(_0x90f4('0x1'));var moment=require(_0x90f4('0x2'));var BPromise=require(_0x90f4('0x3'));var rs=require(_0x90f4('0x4'));var fs=require('fs');var Redis=require(_0x90f4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x90f4('0x6')]['http']({'port':0x232a});config[_0x90f4('0x7')]=_[_0x90f4('0x8')](config[_0x90f4('0x7')],{'host':_0x90f4('0x9'),'port':0x18eb});var socket=require(_0x90f4('0xa'))(new Redis(config[_0x90f4('0x7')]));require(_0x90f4('0xb'))[_0x90f4('0xc')](socket);function respondWithRpcPromise(_0x404ec0,_0x131f03,_0x2349ad){return new BPromise(function(_0x473f41,_0x5daffd){return client[_0x90f4('0xd')](_0x404ec0,_0x2349ad)[_0x90f4('0xe')](function(_0x245a9b){logger[_0x90f4('0xf')](_0x90f4('0x10'),_0x131f03,_0x90f4('0x11'));logger['debug'](_0x90f4('0x12'),_0x131f03,_0x90f4('0x11'),JSON[_0x90f4('0x13')](_0x245a9b));if(_0x245a9b['error']){if(_0x245a9b[_0x90f4('0x14')][_0x90f4('0x15')]===0x1f4){logger[_0x90f4('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x131f03,_0x245a9b[_0x90f4('0x14')]['message']);return _0x5daffd(_0x245a9b['error'][_0x90f4('0x16')]);}logger['error'](_0x90f4('0x10'),_0x131f03,_0x245a9b['error'][_0x90f4('0x16')]);return _0x473f41(_0x245a9b[_0x90f4('0x14')][_0x90f4('0x16')]);}else{logger['info'](_0x90f4('0x10'),_0x131f03,_0x90f4('0x11'));_0x473f41(_0x245a9b[_0x90f4('0x17')][_0x90f4('0x16')]);}})['catch'](function(_0x2d1697){logger[_0x90f4('0x14')](_0x90f4('0x10'),_0x131f03,_0x2d1697);_0x5daffd(_0x2d1697);});});}exports[_0x90f4('0x18')]=function(_0x593493){var _0xd979e2=this;return new Promise(function(_0x20694c,_0x4eaac8){return db[_0x90f4('0x19')][_0x90f4('0x1a')](_0x593493[_0x90f4('0x1b')],{'raw':_0x593493[_0x90f4('0x1c')]?_0x593493[_0x90f4('0x1c')][_0x90f4('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x593493[_0x90f4('0x1c')]?_0x593493['options'][_0x90f4('0x1e')]||null:null,'attributes':_0x593493[_0x90f4('0x1c')]?_0x593493[_0x90f4('0x1c')][_0x90f4('0x1f')]||null:null,'limit':_0x593493[_0x90f4('0x1c')]?_0x593493[_0x90f4('0x1c')]['limit']||null:null})[_0x90f4('0xe')](function(_0x3f4402){logger[_0x90f4('0xf')](_0x90f4('0x18'),_0x593493);logger[_0x90f4('0x20')](_0x90f4('0x18'),_0x593493,JSON['stringify'](_0x3f4402));_0x20694c(_0x3f4402);})['catch'](function(_0x3179a7){logger['error'](_0x90f4('0x18'),_0x3179a7[_0x90f4('0x16')],_0x593493);_0x4eaac8(_0xd979e2['error'](0x1f4,_0x3179a7[_0x90f4('0x16')]));});});};exports[_0x90f4('0x21')]=function(_0x4768b0){return new Promise(function(_0x116ea0,_0x51dbde){return db[_0x90f4('0x19')][_0x90f4('0x22')]({'where':_0x4768b0[_0x90f4('0x1c')]?_0x4768b0[_0x90f4('0x1c')]['where']||null:null})[_0x90f4('0xe')](function(_0x58939b){if(_0x58939b){return _0x58939b[_0x90f4('0x23')](_0x4768b0[_0x90f4('0x1b')][_0x90f4('0x24')],_['omit'](_0x4768b0['body'],[_0x90f4('0x24'),'id'])||{});}})[_0x90f4('0x25')](function(_0x29c29f){logger['info'](_0x90f4('0x26'),_0x4768b0);logger[_0x90f4('0x20')](_0x90f4('0x26'),_0x4768b0,JSON['stringify'](_0x29c29f));_0x116ea0(_0x29c29f);})[_0x90f4('0x27')](function(_0x1fc632){logger[_0x90f4('0x14')]('AddTags',_0x1fc632[_0x90f4('0x16')],_0x4768b0);_0x51dbde(_this[_0x90f4('0x14')](0x1f4,_0x1fc632[_0x90f4('0x16')]));});});};
\ No newline at end of file
+var _0x58af=['catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','limit','where','then','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x408ad6,_0x186394){var _0x4d38c2=function(_0x1ad425){while(--_0x1ad425){_0x408ad6['push'](_0x408ad6['shift']());}};_0x4d38c2(++_0x186394);}(_0x58af,0x94));var _0xf58a=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x58af[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf58a('0x0'));var util=require('util');var moment=require(_0xf58a('0x1'));var BPromise=require(_0xf58a('0x2'));var rs=require(_0xf58a('0x3'));var fs=require('fs');var Redis=require(_0xf58a('0x4'));var db=require(_0xf58a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf58a('0x6'))(_0xf58a('0x7'));var config=require(_0xf58a('0x8'));var jayson=require(_0xf58a('0x9'));var client=jayson[_0xf58a('0xa')][_0xf58a('0xb')]({'port':0x232a});config[_0xf58a('0xc')]=_[_0xf58a('0xd')](config[_0xf58a('0xc')],{'host':_0xf58a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf58a('0xf'))[_0xf58a('0x10')](socket);function respondWithRpcPromise(_0x2d8b85,_0x509f56,_0x20ddc6){return new BPromise(function(_0xa9135a,_0x57f719){return client[_0xf58a('0x11')](_0x2d8b85,_0x20ddc6)['then'](function(_0x573ec8){logger[_0xf58a('0x12')](_0xf58a('0x13'),_0x509f56,_0xf58a('0x14'));logger[_0xf58a('0x15')](_0xf58a('0x16'),_0x509f56,_0xf58a('0x14'),JSON[_0xf58a('0x17')](_0x573ec8));if(_0x573ec8[_0xf58a('0x18')]){if(_0x573ec8['error'][_0xf58a('0x19')]===0x1f4){logger['error'](_0xf58a('0x13'),_0x509f56,_0x573ec8['error']['message']);return _0x57f719(_0x573ec8['error']['message']);}logger[_0xf58a('0x18')](_0xf58a('0x13'),_0x509f56,_0x573ec8[_0xf58a('0x18')][_0xf58a('0x1a')]);return _0xa9135a(_0x573ec8['error'][_0xf58a('0x1a')]);}else{logger[_0xf58a('0x12')](_0xf58a('0x13'),_0x509f56,_0xf58a('0x14'));_0xa9135a(_0x573ec8[_0xf58a('0x1b')][_0xf58a('0x1a')]);}})[_0xf58a('0x1c')](function(_0x1b5d45){logger[_0xf58a('0x18')](_0xf58a('0x13'),_0x509f56,_0x1b5d45);_0x57f719(_0x1b5d45);});});}exports[_0xf58a('0x1d')]=function(_0x3df4dc){var _0x40be43=this;return new Promise(function(_0x41a21c,_0x133b42){return db[_0xf58a('0x1e')][_0xf58a('0x1f')](_0x3df4dc[_0xf58a('0x20')],{'raw':_0x3df4dc[_0xf58a('0x21')]?_0x3df4dc['options'][_0xf58a('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3df4dc['options']?_0x3df4dc[_0xf58a('0x21')]['where']||null:null,'attributes':_0x3df4dc[_0xf58a('0x21')]?_0x3df4dc[_0xf58a('0x21')][_0xf58a('0x23')]||null:null,'limit':_0x3df4dc['options']?_0x3df4dc[_0xf58a('0x21')][_0xf58a('0x24')]||null:null})['then'](function(_0x39ba80){logger[_0xf58a('0x12')]('UpdateFaxInteraction',_0x3df4dc);logger[_0xf58a('0x15')](_0xf58a('0x1d'),_0x3df4dc,JSON[_0xf58a('0x17')](_0x39ba80));_0x41a21c(_0x39ba80);})['catch'](function(_0x9e5cc8){logger[_0xf58a('0x18')](_0xf58a('0x1d'),_0x9e5cc8[_0xf58a('0x1a')],_0x3df4dc);_0x133b42(_0x40be43[_0xf58a('0x18')](0x1f4,_0x9e5cc8['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x3a1cab){return new Promise(function(_0x56024f,_0x212326){return db['FaxInteraction']['find']({'where':_0x3a1cab[_0xf58a('0x21')]?_0x3a1cab['options'][_0xf58a('0x25')]||null:null})[_0xf58a('0x26')](function(_0x9af097){if(_0x9af097){return _0x9af097[_0xf58a('0x27')](_0x3a1cab[_0xf58a('0x20')][_0xf58a('0x28')],_[_0xf58a('0x29')](_0x3a1cab[_0xf58a('0x20')],[_0xf58a('0x28'),'id'])||{});}})[_0xf58a('0x2a')](function(_0x5c5b45){logger[_0xf58a('0x12')]('AddTags',_0x3a1cab);logger[_0xf58a('0x15')](_0xf58a('0x2b'),_0x3a1cab,JSON[_0xf58a('0x17')](_0x5c5b45));_0x56024f(_0x5c5b45);})['catch'](function(_0x23481c){logger[_0xf58a('0x18')](_0xf58a('0x2b'),_0x23481c['message'],_0x3a1cab);_0x212326(_this[_0xf58a('0x18')](0x1f4,_0x23481c[_0xf58a('0x1a')]));});});};
\ No newline at end of file
index 925bc5c..2331b2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x144b=['removeListener','register','length','faxInteraction:','./faxInteraction.events','save','remove'];(function(_0x307c4b,_0x5f530e){var _0x343909=function(_0x2b1d2c){while(--_0x2b1d2c){_0x307c4b['push'](_0x307c4b['shift']());}};_0x343909(++_0x5f530e);}(_0x144b,0x7b));var _0xb144=function(_0x3e13a2,_0x5c8a0c){_0x3e13a2=_0x3e13a2-0x0;var _0x4f0c52=_0x144b[_0x3e13a2];return _0x4f0c52;};'use strict';var FaxInteractionEvents=require(_0xb144('0x0'));var events=[_0xb144('0x1'),_0xb144('0x2'),'update'];function createListener(_0x4dcb9f,_0x2870cb){return function(_0x7302fe){_0x2870cb['emit'](_0x4dcb9f,_0x7302fe);};}function removeListener(_0x44e4a2,_0x5489de){return function(){FaxInteractionEvents[_0xb144('0x3')](_0x44e4a2,_0x5489de);};}exports[_0xb144('0x4')]=function(_0x18a3e3){for(var _0x5147e0=0x0,_0x22418e=events[_0xb144('0x5')];_0x5147e0<_0x22418e;_0x5147e0++){var _0x490904=events[_0x5147e0];var _0x357a08=createListener(_0xb144('0x6')+_0x490904,_0x18a3e3);FaxInteractionEvents['on'](_0x490904,_0x357a08);}};
\ No newline at end of file
+var _0xcec3=['length','faxInteraction:','./faxInteraction.events','remove','removeListener'];(function(_0x52b4e1,_0x169ee0){var _0x1789b8=function(_0x340cf2){while(--_0x340cf2){_0x52b4e1['push'](_0x52b4e1['shift']());}};_0x1789b8(++_0x169ee0);}(_0xcec3,0x1c4));var _0x3cec=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xcec3[_0x19950b];return _0x3c6b41;};'use strict';var FaxInteractionEvents=require(_0x3cec('0x0'));var events=['save',_0x3cec('0x1'),'update'];function createListener(_0x486c0a,_0x718e14){return function(_0x2318b8){_0x718e14['emit'](_0x486c0a,_0x2318b8);};}function removeListener(_0x2535d3,_0x2aec86){return function(){FaxInteractionEvents[_0x3cec('0x2')](_0x2535d3,_0x2aec86);};}exports['register']=function(_0x120e62){for(var _0x551d10=0x0,_0x3f5a08=events[_0x3cec('0x3')];_0x551d10<_0x3f5a08;_0x551d10++){var _0x4b5246=events[_0x551d10];var _0x43a8fb=createListener(_0x3cec('0x4')+_0x4b5246,_0x120e62);FaxInteractionEvents['on'](_0x4b5246,_0x43a8fb);}};
\ No newline at end of file
index aca35e7..61e43af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x07b1=['fax','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','/:id/download','download','create','addMessage','post','/:id/tags','tracked'];(function(_0x30d1d5,_0x378828){var _0x1e6703=function(_0x27defa){while(--_0x27defa){_0x30d1d5['push'](_0x30d1d5['shift']());}};_0x1e6703(++_0x378828);}(_0x07b1,0x1a9));var _0x107b=function(_0x515be2,_0x51b3ff){_0x515be2=_0x515be2-0x0;var _0x514679=_0x07b1[_0x515be2];return _0x514679;};'use strict';var multer=require(_0x107b('0x0'));var util=require('util');var path=require(_0x107b('0x1'));var timeout=require(_0x107b('0x2'));var express=require(_0x107b('0x3'));var router=express[_0x107b('0x4')]();var fs_extra=require(_0x107b('0x5'));var auth=require(_0x107b('0x6'));var interaction=require(_0x107b('0x7'));var config=require('../../config/environment');var controller=require(_0x107b('0x8'));router[_0x107b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x107b('0x9')](_0x107b('0xa'),auth[_0x107b('0xb')](),controller[_0x107b('0xc')]);router[_0x107b('0x9')](_0x107b('0xd'),auth[_0x107b('0xb')](),controller[_0x107b('0xe')]);router[_0x107b('0x9')](_0x107b('0xf'),auth['isAuthenticated'](),controller['getMessages']);router[_0x107b('0x9')](_0x107b('0x10'),auth['isAuthenticated'](),controller[_0x107b('0x11')]);router['post']('/',auth[_0x107b('0xb')](),controller[_0x107b('0x12')]);router['post'](_0x107b('0xf'),auth[_0x107b('0xb')](),controller[_0x107b('0x13')]);router[_0x107b('0x14')](_0x107b('0x15'),auth[_0x107b('0xb')](),interaction[_0x107b('0x16')](_0x107b('0x17'),'faxinteraction:addtags'),controller[_0x107b('0x18')]);router[_0x107b('0x19')](_0x107b('0xd'),auth[_0x107b('0xb')](),interaction['tracked']('fax',_0x107b('0x1a')),controller[_0x107b('0x1b')]);router[_0x107b('0x1c')](_0x107b('0xd'),auth['isAuthenticated'](),interaction[_0x107b('0x16')](_0x107b('0x17'),_0x107b('0x1d')),controller[_0x107b('0x1e')]);router[_0x107b('0x1c')](_0x107b('0x15'),auth['isAuthenticated'](),controller['removeTags']);module[_0x107b('0x1f')]=router;
\ No newline at end of file
+var _0x2d27=['faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','tracked','faxinteraction:destroy','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','isAuthenticated','index','get','describe','/:id','show','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x178474,_0x37d82d){var _0x35cc54=function(_0x10aebe){while(--_0x10aebe){_0x178474['push'](_0x178474['shift']());}};_0x35cc54(++_0x37d82d);}(_0x2d27,0x13e));var _0x72d2=function(_0x38494c,_0x5393f5){_0x38494c=_0x38494c-0x0;var _0x591aec=_0x2d27[_0x38494c];return _0x591aec;};'use strict';var multer=require(_0x72d2('0x0'));var util=require('util');var path=require(_0x72d2('0x1'));var timeout=require(_0x72d2('0x2'));var express=require(_0x72d2('0x3'));var router=express[_0x72d2('0x4')]();var fs_extra=require(_0x72d2('0x5'));var auth=require(_0x72d2('0x6'));var interaction=require(_0x72d2('0x7'));var config=require('../../config/environment');var controller=require(_0x72d2('0x8'));router['get']('/',auth[_0x72d2('0x9')](),controller[_0x72d2('0xa')]);router[_0x72d2('0xb')]('/describe',auth[_0x72d2('0x9')](),controller[_0x72d2('0xc')]);router[_0x72d2('0xb')](_0x72d2('0xd'),auth[_0x72d2('0x9')](),controller[_0x72d2('0xe')]);router[_0x72d2('0xb')]('/:id/messages',auth[_0x72d2('0x9')](),controller[_0x72d2('0xf')]);router['get'](_0x72d2('0x10'),auth[_0x72d2('0x9')](),controller[_0x72d2('0x11')]);router[_0x72d2('0x12')]('/',auth[_0x72d2('0x9')](),controller[_0x72d2('0x13')]);router['post']('/:id/messages',auth[_0x72d2('0x9')](),controller[_0x72d2('0x14')]);router[_0x72d2('0x12')](_0x72d2('0x15'),auth[_0x72d2('0x9')](),interaction['tracked']('fax',_0x72d2('0x16')),controller[_0x72d2('0x17')]);router[_0x72d2('0x18')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x72d2('0x19'),_0x72d2('0x1a')),controller[_0x72d2('0x1b')]);router[_0x72d2('0x1c')](_0x72d2('0xd'),auth[_0x72d2('0x9')](),interaction[_0x72d2('0x1d')]('fax',_0x72d2('0x1e')),controller[_0x72d2('0x1f')]);router[_0x72d2('0x1c')]('/:id/tags',auth['isAuthenticated'](),controller[_0x72d2('0x20')]);module[_0x72d2('0x21')]=router;
\ No newline at end of file
index a423195..9327a55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19ea=['ENUM','out','sequelize','medium'];(function(_0x3e9e0d,_0x544f01){var _0xd871d2=function(_0x2f1a4c){while(--_0x2f1a4c){_0x3e9e0d['push'](_0x3e9e0d['shift']());}};_0xd871d2(++_0x544f01);}(_0x19ea,0xfe));var _0xa19e=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0x19ea[_0x33bc64];return _0x3fdd34;};'use strict';var Sequelize=require(_0xa19e('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa19e('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa19e('0x2')]('in',_0xa19e('0x3')),'defaultValue':_0xa19e('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x6ddd=['TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x1f251e,_0x35ec2a){var _0x1fc13d=function(_0x3ba1f9){while(--_0x3ba1f9){_0x1f251e['push'](_0x1f251e['shift']());}};_0x1fc13d(++_0x35ec2a);}(_0x6ddd,0xae));var _0xd6dd=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x6ddd[_0x465028];return _0xb783d4;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xd6dd('0x0')](_0xd6dd('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xd6dd('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd6dd('0x3')]('in','out'),'defaultValue':_0xd6dd('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0xd6dd('0x5')]}};
\ No newline at end of file
index 90f3530..f5221df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f81=['request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','map','FaxMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','include','rows','show','params','fields','includeAll','body','find','describe','accept','fax','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','FaxInteraction','read1stAt','format','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','SIP/%s','event','EventManager','fax-interactions','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','interface','channel','rejectmessage','create','findOne','isNil','Attachment','SendFax','FaxAccountId','AttachmentId','download','root','server','files','attachments','join','basename','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./faxMessage.socket','jayson/promise','client','http','then','info','FaxMessage,\x20%s,\x20%s'];(function(_0x1f196f,_0x1b58e4){var _0x415f39=function(_0x58945c){while(--_0x58945c){_0x1f196f['push'](_0x1f196f['shift']());}};_0x415f39(++_0x1b58e4);}(_0x7f81,0xf3));var _0x17f8=function(_0x57f5ac,_0x170b49){_0x57f5ac=_0x57f5ac-0x0;var _0x39e083=_0x7f81[_0x57f5ac];return _0x39e083;};'use strict';var emlformat=require(_0x17f8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x17f8('0x1'));var rp=require('request-promise');var moment=require(_0x17f8('0x2'));var BPromise=require(_0x17f8('0x3'));var Mustache=require(_0x17f8('0x4'));var util=require(_0x17f8('0x5'));var path=require(_0x17f8('0x6'));var sox=require(_0x17f8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x17f8('0x8'));var _=require(_0x17f8('0x9'));var squel=require(_0x17f8('0xa'));var crypto=require('crypto');var jsforce=require(_0x17f8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x17f8('0xc'));var querystring=require(_0x17f8('0xd'));var Papa=require(_0x17f8('0xe'));var Redis=require(_0x17f8('0xf'));var authService=require(_0x17f8('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x17f8('0x11'));var hardwareService=require(_0x17f8('0x12'));var logger=require(_0x17f8('0x13'))(_0x17f8('0x14'));var utils=require(_0x17f8('0x15'));var config=require(_0x17f8('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x17f8('0x17'))['db'];config[_0x17f8('0x18')]=_[_0x17f8('0x19')](config[_0x17f8('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x17f8('0x1a'))['register'](socket);var jayson=require(_0x17f8('0x1b'));var client=jayson[_0x17f8('0x1c')][_0x17f8('0x1d')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x58f3e6,_0x5b645b,_0xabe12,_0x11a475){return new BPromise(function(_0x1ab9f0,_0x2e31d2){var _0x19887b=_0x11a475||client;return _0x19887b['request'](_0x58f3e6,_0xabe12)[_0x17f8('0x1e')](function(_0x360db9){logger[_0x17f8('0x1f')](_0x17f8('0x20'),_0x5b645b,_0x17f8('0x21'));logger['debug'](_0x17f8('0x22'),_0x5b645b,_0x17f8('0x21'),JSON[_0x17f8('0x23')](_0x360db9));if(_0x360db9['error']){if(_0x360db9['error'][_0x17f8('0x24')]===0x1f4){logger[_0x17f8('0x25')](_0x17f8('0x20'),_0x5b645b,_0x360db9['error'][_0x17f8('0x26')]);return _0x2e31d2(_0x360db9[_0x17f8('0x25')][_0x17f8('0x26')]);}logger['error'](_0x17f8('0x20'),_0x5b645b,_0x360db9['error']['message']);return _0x1ab9f0(_0x360db9[_0x17f8('0x25')]['message']);}else{logger[_0x17f8('0x1f')](_0x17f8('0x20'),_0x5b645b,_0x17f8('0x21'));_0x1ab9f0(_0x360db9[_0x17f8('0x27')][_0x17f8('0x26')]);}})[_0x17f8('0x28')](function(_0x287b97){logger['error'](_0x17f8('0x20'),_0x5b645b,_0x287b97);_0x2e31d2(_0x287b97);});});}function respondWithStatusCode(_0x505494,_0x385146){_0x385146=_0x385146||0xcc;return function(_0x4e29b3){if(_0x4e29b3){return _0x505494[_0x17f8('0x29')](_0x385146);}return _0x505494['status'](_0x385146)['end']();};}function respondWithResult(_0x201103,_0xd286a5){_0xd286a5=_0xd286a5||0xc8;return function(_0x23f0aa){if(_0x23f0aa){return _0x201103[_0x17f8('0x2a')](_0xd286a5)['json'](_0x23f0aa);}};}function respondWithFilteredResult(_0x11abc9,_0x19229d){return function(_0x13e471){if(_0x13e471){var _0x45c336=typeof _0x19229d[_0x17f8('0x2b')]===_0x17f8('0x2c')&&typeof _0x19229d[_0x17f8('0x2d')]===_0x17f8('0x2c');var _0x4a2376=_0x13e471[_0x17f8('0x2e')];var _0x367bd3=_0x45c336?0x0:_0x19229d['offset'];var _0x133359=_0x45c336?_0x13e471['count']:_0x19229d[_0x17f8('0x2b')]+_0x19229d[_0x17f8('0x2d')];var _0x75b0f8;if(_0x133359>=_0x4a2376){_0x133359=_0x4a2376;_0x75b0f8=0xc8;}else{_0x75b0f8=0xce;}_0x11abc9[_0x17f8('0x2a')](_0x75b0f8);return _0x11abc9[_0x17f8('0x2f')](_0x17f8('0x30'),_0x367bd3+'-'+_0x133359+'/'+_0x4a2376)[_0x17f8('0x31')](_0x13e471);}return null;};}function patchUpdates(_0x578f9a){return function(_0x2fc8f7){try{jsonpatch[_0x17f8('0x32')](_0x2fc8f7,_0x578f9a,!![]);}catch(_0x5d85b7){return BPromise[_0x17f8('0x33')](_0x5d85b7);}return _0x2fc8f7[_0x17f8('0x34')]();};}function saveUpdates(_0x50d053,_0x545140){return function(_0x3bebba){if(_0x3bebba){return _0x3bebba[_0x17f8('0x35')](_0x50d053)['then'](function(_0x43f44){return _0x43f44;});}return null;};}function removeEntity(_0x38b00c,_0xd0fc27){return function(_0x55bfc2){if(_0x55bfc2){return _0x55bfc2[_0x17f8('0x36')]()[_0x17f8('0x1e')](function(){_0x38b00c[_0x17f8('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c4bff,_0x4d4b62){return function(_0x27ce4d){if(!_0x27ce4d){_0x1c4bff['sendStatus'](0x194);}return _0x27ce4d;};}function handleError(_0x1929f9,_0x1d467c){_0x1d467c=_0x1d467c||0x1f4;return function(_0x3b6530){logger[_0x17f8('0x25')](_0x3b6530[_0x17f8('0x37')]);if(_0x3b6530['name']){delete _0x3b6530[_0x17f8('0x38')];}_0x1929f9[_0x17f8('0x2a')](_0x1d467c)['send'](_0x3b6530);};}exports['index']=function(_0x478fcf,_0x3df3ce){var _0x2e1a81={},_0x34ade2={},_0x211622={'count':0x0,'rows':[]};var _0x327cdf=_[_0x17f8('0x39')](db[_0x17f8('0x3a')][_0x17f8('0x3b')],function(_0xc319a6){return{'name':_0xc319a6[_0x17f8('0x3c')],'type':_0xc319a6['type'][_0x17f8('0x3d')]};});_0x34ade2[_0x17f8('0x3e')]=_['map'](_0x327cdf,_0x17f8('0x38'));_0x34ade2[_0x17f8('0x3f')]=_[_0x17f8('0x40')](_0x478fcf[_0x17f8('0x3f')]);_0x34ade2[_0x17f8('0x41')]=_[_0x17f8('0x42')](_0x34ade2[_0x17f8('0x3e')],_0x34ade2[_0x17f8('0x3f')]);_0x2e1a81[_0x17f8('0x43')]=_['intersection'](_0x34ade2[_0x17f8('0x3e')],qs['fields'](_0x478fcf[_0x17f8('0x3f')]['fields']));_0x2e1a81[_0x17f8('0x43')]=_0x2e1a81['attributes'][_0x17f8('0x44')]?_0x2e1a81[_0x17f8('0x43')]:_0x34ade2[_0x17f8('0x3e')];if(!_0x478fcf[_0x17f8('0x3f')]['hasOwnProperty'](_0x17f8('0x45'))){_0x2e1a81[_0x17f8('0x2d')]=qs[_0x17f8('0x2d')](_0x478fcf[_0x17f8('0x3f')][_0x17f8('0x2d')]);_0x2e1a81[_0x17f8('0x2b')]=qs[_0x17f8('0x2b')](_0x478fcf[_0x17f8('0x3f')][_0x17f8('0x2b')]);}_0x2e1a81['order']=qs[_0x17f8('0x46')](_0x478fcf[_0x17f8('0x3f')][_0x17f8('0x46')]);_0x2e1a81['where']=qs[_0x17f8('0x41')](_[_0x17f8('0x47')](_0x478fcf['query'],_0x34ade2['filters']),_0x327cdf);if(_0x478fcf[_0x17f8('0x3f')][_0x17f8('0x48')]){_0x2e1a81[_0x17f8('0x49')]=_['merge'](_0x2e1a81['where'],{'$or':_[_0x17f8('0x39')](_0x327cdf,function(_0x4a7592){if(_0x4a7592[_0x17f8('0x4a')]!==_0x17f8('0x4b')){var _0xceda7b={};_0xceda7b[_0x4a7592[_0x17f8('0x38')]]={'$like':'%'+_0x478fcf['query'][_0x17f8('0x48')]+'%'};return _0xceda7b;}})});}_0x2e1a81=_[_0x17f8('0x4c')]({},_0x2e1a81,_0x478fcf[_0x17f8('0x4d')]);var _0x59bb02={'where':_0x2e1a81[_0x17f8('0x49')]};return db[_0x17f8('0x3a')]['count'](_0x59bb02)[_0x17f8('0x1e')](function(_0x496252){_0x211622['count']=_0x496252;if(_0x478fcf[_0x17f8('0x3f')]['includeAll']){_0x2e1a81[_0x17f8('0x4e')]=[{'all':!![]}];}return db[_0x17f8('0x3a')]['findAll'](_0x2e1a81);})[_0x17f8('0x1e')](function(_0x39f3b4){_0x211622[_0x17f8('0x4f')]=_0x39f3b4;return _0x211622;})[_0x17f8('0x1e')](respondWithFilteredResult(_0x3df3ce,_0x2e1a81))['catch'](handleError(_0x3df3ce,null));};exports[_0x17f8('0x50')]=function(_0x3aa89c,_0x54a356){var _0x5d54d5={'raw':!![],'where':{'id':_0x3aa89c[_0x17f8('0x51')]['id']}},_0x5688c2={};_0x5688c2[_0x17f8('0x3e')]=_[_0x17f8('0x40')](db['FaxMessage'][_0x17f8('0x3b')]);_0x5688c2['query']=_[_0x17f8('0x40')](_0x3aa89c[_0x17f8('0x3f')]);_0x5688c2[_0x17f8('0x41')]=_[_0x17f8('0x42')](_0x5688c2[_0x17f8('0x3e')],_0x5688c2['query']);_0x5d54d5[_0x17f8('0x43')]=_[_0x17f8('0x42')](_0x5688c2['model'],qs[_0x17f8('0x52')](_0x3aa89c['query']['fields']));_0x5d54d5['attributes']=_0x5d54d5[_0x17f8('0x43')][_0x17f8('0x44')]?_0x5d54d5['attributes']:_0x5688c2['model'];if(_0x3aa89c[_0x17f8('0x3f')][_0x17f8('0x53')]){_0x5d54d5['include']=[{'all':!![]}];}_0x5d54d5=_[_0x17f8('0x4c')]({},_0x5d54d5,_0x3aa89c[_0x17f8('0x4d')]);return db[_0x17f8('0x3a')]['find'](_0x5d54d5)[_0x17f8('0x1e')](handleEntityNotFound(_0x54a356,null))[_0x17f8('0x1e')](respondWithResult(_0x54a356,null))['catch'](handleError(_0x54a356,null));};exports[_0x17f8('0x35')]=function(_0x1cace5,_0x3d9cb0){if(_0x1cace5[_0x17f8('0x54')]['id']){delete _0x1cace5[_0x17f8('0x54')]['id'];}return db[_0x17f8('0x3a')][_0x17f8('0x55')]({'where':{'id':_0x1cace5[_0x17f8('0x51')]['id']}})[_0x17f8('0x1e')](handleEntityNotFound(_0x3d9cb0,null))['then'](saveUpdates(_0x1cace5[_0x17f8('0x54')],null))[_0x17f8('0x1e')](respondWithResult(_0x3d9cb0,null))[_0x17f8('0x28')](handleError(_0x3d9cb0,null));};exports[_0x17f8('0x36')]=function(_0x10390a,_0x32dfbf){return db[_0x17f8('0x3a')]['find']({'where':{'id':_0x10390a['params']['id']}})[_0x17f8('0x1e')](handleEntityNotFound(_0x32dfbf,null))[_0x17f8('0x1e')](removeEntity(_0x32dfbf,null))[_0x17f8('0x28')](handleError(_0x32dfbf,null));};exports[_0x17f8('0x56')]=function(_0x5a23af,_0x591b3a){return db[_0x17f8('0x3a')][_0x17f8('0x56')]()[_0x17f8('0x1e')](respondWithResult(_0x591b3a,null))['catch'](handleError(_0x591b3a,null));};var interaction_log=require(_0x17f8('0x13'))('fax-interactions');exports[_0x17f8('0x57')]=function(_0x309e0f,_0x4b948c,_0x2339c7){var _0x4e24e0={'agent':{},'channel':_0x17f8('0x58')};if(_0x309e0f[_0x17f8('0x54')]['id']){delete _0x309e0f[_0x17f8('0x54')]['id'];}_0x309e0f[_0x17f8('0x54')]['read']=!![];_0x309e0f[_0x17f8('0x54')]['readAt']=moment()['format'](_0x17f8('0x59'));_0x309e0f[_0x17f8('0x54')][_0x17f8('0x5a')]=_0x309e0f[_0x17f8('0x54')][_0x17f8('0x5a')]||_0x309e0f[_0x17f8('0x5b')]['id'];_0x4e24e0[_0x17f8('0x5c')]['id']=_0x309e0f[_0x17f8('0x54')][_0x17f8('0x5a')];return db[_0x17f8('0x3a')]['find']({'where':{'id':_0x309e0f['params']['id'],'UserId':null}})[_0x17f8('0x1e')](handleEntityNotFound(_0x4b948c,null))[_0x17f8('0x1e')](saveUpdates(_0x309e0f[_0x17f8('0x54')],null))['then'](function(_0x50866b){if(_0x50866b){_0x4e24e0['message']=_0x50866b['get']({'plain':!![]});return db[_0x17f8('0x5d')][_0x17f8('0x55')]({'where':{'id':_0x50866b['FaxInteractionId']}});}return null;})[_0x17f8('0x1e')](handleEntityNotFound(_0x4b948c,null))[_0x17f8('0x1e')](function(_0xa801bb){if(_0xa801bb){return _0xa801bb['update']({'UserId':_0x309e0f[_0x17f8('0x54')]['UserId'],'read1stAt':_['isNil'](_0xa801bb[_0x17f8('0x5e')])?moment()[_0x17f8('0x5f')](_0x17f8('0x59')):undefined});}return null;})[_0x17f8('0x1e')](function(_0xf51f44){if(_0xf51f44){_0x4e24e0[_0x17f8('0x60')]=_0xf51f44[_0x17f8('0x61')]({'plain':!![]});interaction_log[_0x17f8('0x1f')](_0x17f8('0x62'),_0x309e0f[_0x17f8('0x5b')]['id'],_0x309e0f[_0x17f8('0x5b')][_0x17f8('0x38')],_0x309e0f[_0x17f8('0x5b')][_0x17f8('0x63')],_0x4e24e0['interaction']['id'],_0x309e0f[_0x17f8('0x54')]?JSON['stringify'](_0x309e0f['body']):'null');return respondWithRpcPromise(_0x17f8('0x64'),_0x17f8('0x65'),_0x4e24e0);}return null;})['then'](function(_0xd004ee){var _0x291d07='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xd004ee['message'][_0x17f8('0x66')];return db[_0x17f8('0x67')][_0x17f8('0x3f')](_0x291d07,{'type':db[_0x17f8('0x68')][_0x17f8('0x69')][_0x17f8('0x6a')],'raw':!![]})['then'](function(_0xc79c64){return _0xc79c64;});})[_0x17f8('0x1e')](function(_0x328837){if(_0x328837){_0x4e24e0[_0x17f8('0x26')][_0x17f8('0x6b')]=_0x328837[0x0];if(!_0x309e0f[_0x17f8('0x54')][_0x17f8('0x5a')])return;return db[_0x17f8('0x6c')][_0x17f8('0x55')]({'where':{'id':_0x309e0f[_0x17f8('0x54')][_0x17f8('0x5a')],'role':_0x17f8('0x5c')},'attributes':['id',_0x17f8('0x38'),'fullname',_0x17f8('0x6d'),_0x17f8('0x6e')],'raw':!![]});}return null;})['then'](function(_0x1cc37a){if(!_0x1cc37a)return null;_0x4e24e0[_0x17f8('0x26')][_0x17f8('0x5c')]=_0x1cc37a;return _0x4e24e0;})[_0x17f8('0x1e')](function(_0x34990f){if(_0x34990f){if(_0x309e0f[_0x17f8('0x54')][_0x17f8('0x6f')]){_0x4e24e0['message']['interface']=util['format'](_0x17f8('0x70'),_0x309e0f['user'][_0x17f8('0x38')]);_0x4e24e0[_0x17f8('0x26')]['channel']=_0x4e24e0['channel'];_0x4e24e0[_0x17f8('0x26')][_0x17f8('0x71')]=_0x17f8('0x57');return respondWithRpcPromise('EventManager',_0x17f8('0x72'),{'event':'acceptmessage','message':_0x4e24e0[_0x17f8('0x26')]},client9002)[_0x17f8('0x1e')](function(){return _0x4e24e0;});}return _0x4e24e0;}return null;})[_0x17f8('0x1e')](respondWithResult(_0x4b948c,null))[_0x17f8('0x28')](handleError(_0x4b948c,null));};var interaction_log=require(_0x17f8('0x13'))(_0x17f8('0x73'));exports[_0x17f8('0x33')]=function(_0x457b8e,_0x4e692f,_0x59385c){var _0x57819f={'agent':{},'channel':_0x17f8('0x58')};if(_0x457b8e[_0x17f8('0x54')]['id']){delete _0x457b8e['body']['id'];}_0x457b8e[_0x17f8('0x54')][_0x17f8('0x5a')]=_0x457b8e[_0x17f8('0x54')][_0x17f8('0x5a')]||_0x457b8e['user']['id'];_0x57819f[_0x17f8('0x5c')]['id']=_0x457b8e[_0x17f8('0x54')]['UserId'];return db[_0x17f8('0x3a')][_0x17f8('0x55')]({'where':{'id':_0x457b8e[_0x17f8('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e692f,null))['then'](function(_0x12692e){if(_0x12692e){_0x57819f[_0x17f8('0x26')]=_0x12692e[_0x17f8('0x61')]({'plain':!![]});return db[_0x17f8('0x5d')][_0x17f8('0x55')]({'where':{'id':_0x12692e[_0x17f8('0x74')]}});}return null;})['then'](handleEntityNotFound(_0x4e692f,null))[_0x17f8('0x1e')](function(_0x1b0cf0){if(_0x1b0cf0){_0x57819f[_0x17f8('0x60')]=_0x1b0cf0[_0x17f8('0x61')]({'plain':!![]});interaction_log['info'](_0x17f8('0x75'),_0x457b8e[_0x17f8('0x5b')]['id'],_0x457b8e['user']['name'],_0x457b8e[_0x17f8('0x5b')][_0x17f8('0x63')],_0x57819f['interaction']['id'],_0x457b8e[_0x17f8('0x54')]?JSON['stringify'](_0x457b8e[_0x17f8('0x54')]):_0x17f8('0x76'));return respondWithRpcPromise(_0x17f8('0x77'),'rejectMessage',_0x57819f);}return null;})[_0x17f8('0x1e')](function(_0x558a02){var _0x402ce1=_0x17f8('0x78')+_0x558a02[_0x17f8('0x26')][_0x17f8('0x66')];return db[_0x17f8('0x67')][_0x17f8('0x3f')](_0x402ce1,{'type':db[_0x17f8('0x68')][_0x17f8('0x69')][_0x17f8('0x6a')],'raw':!![]})[_0x17f8('0x1e')](function(_0x1b033c){return _0x1b033c;});})[_0x17f8('0x1e')](function(_0xd8fea2){if(_0xd8fea2){_0x57819f['message'][_0x17f8('0x6b')]=_0xd8fea2[0x0];if(!_0x457b8e[_0x17f8('0x54')][_0x17f8('0x5a')])return;return db[_0x17f8('0x6c')][_0x17f8('0x55')]({'where':{'id':_0x457b8e[_0x17f8('0x54')][_0x17f8('0x5a')],'role':_0x17f8('0x5c')},'attributes':['id',_0x17f8('0x38'),'fullname','email','internal'],'raw':!![]});}return null;})[_0x17f8('0x1e')](function(_0x3db506){if(!_0x3db506)return null;_0x57819f[_0x17f8('0x26')][_0x17f8('0x5c')]=_0x3db506;return _0x57819f;})['then'](function(_0x3b671e){if(_0x3b671e){_0x3b671e[_0x17f8('0x26')][_0x17f8('0x79')]=util[_0x17f8('0x5f')](_0x17f8('0x70'),_0x457b8e[_0x17f8('0x5b')]['name']);_0x3b671e[_0x17f8('0x26')][_0x17f8('0x7a')]=_0x57819f['channel'];_0x3b671e[_0x17f8('0x26')][_0x17f8('0x71')]='reject';respondWithRpcPromise(_0x17f8('0x72'),_0x17f8('0x72'),{'event':_0x17f8('0x7b'),'message':_0x3b671e[_0x17f8('0x26')]},client9002);return _0x57819f;}return null;})[_0x17f8('0x1e')](respondWithResult(_0x4e692f,null))[_0x17f8('0x28')](handleError(_0x4e692f,null));};exports['create']=function(_0x40e077,_0x16d30a){var _0x2b753b;return db['FaxMessage'][_0x17f8('0x7c')](_0x40e077['body'],{})[_0x17f8('0x1e')](function(_0x231888){_0x2b753b=_0x231888;return db['CmContact'][_0x17f8('0x7d')]({'where':{'id':_0x2b753b[_0x17f8('0x66')]}});})['then'](function(_0x24d131){if(_[_0x17f8('0x7e')](_0x24d131)){return;}else{_0x2b753b['fax']=_0x24d131[_0x17f8('0x58')];return db[_0x17f8('0x7f')][_0x17f8('0x7d')]({'where':{'id':_0x2b753b['AttachmentId']}});}})[_0x17f8('0x1e')](function(_0x265ec1){return respondWithRpcPromise(_0x17f8('0x80'),_0x17f8('0x80'),{'FaxAccountId':_['isNil'](_0x40e077[_0x17f8('0x54')])?undefined:_0x40e077[_0x17f8('0x54')][_0x17f8('0x81')],'path':_[_0x17f8('0x7e')](_0x265ec1)?undefined:util['format']('/var/opt/motion2/server/files/attachments/%s',_0x265ec1['basename']),'fax':_[_0x17f8('0x7e')](_0x2b753b['fax'])?undefined:_0x2b753b['fax'],'AttachmentId':_0x2b753b[_0x17f8('0x82')]},client9002);})['then'](respondWithResult(_0x16d30a,0xc9))[_0x17f8('0x28')](handleError(_0x16d30a,null));};exports[_0x17f8('0x83')]=function(_0x525020,_0xa983d3){var _0x5880e2=path['join'](config[_0x17f8('0x84')],_0x17f8('0x85'),_0x17f8('0x86'),_0x17f8('0x87'));return db[_0x17f8('0x3a')][_0x17f8('0x55')]({'where':{'id':_0x525020[_0x17f8('0x51')]['id']},'include':[{'model':db['Attachment'],'as':_0x17f8('0x7f')}]})['then'](handleEntityNotFound(_0xa983d3,null))[_0x17f8('0x1e')](function(_0x43d804){if(_0x43d804){return _0xa983d3['download'](path[_0x17f8('0x88')](_0x5880e2,_0x43d804[_0x17f8('0x7f')][_0x17f8('0x89')]));}})[_0x17f8('0x28')](handleError(_0xa983d3,null));};
\ No newline at end of file
+var _0x9ce0=['map','FaxMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','body','describe','fax','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','User','email','manual','SIP/%s','channel','event','accept','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT','internal','interface','rejectmessage','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','basename','join','root','server','attachments','download','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send'];(function(_0xf00074,_0x57ae02){var _0x122942=function(_0x1d2ee8){while(--_0x1d2ee8){_0xf00074['push'](_0xf00074['shift']());}};_0x122942(++_0x57ae02);}(_0x9ce0,0xde));var _0x09ce=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9ce0[_0x1facfa];return _0x9ec701;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09ce('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x09ce('0x1'));var rp=require(_0x09ce('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x09ce('0x3'));var util=require('util');var path=require(_0x09ce('0x4'));var sox=require('sox');var csv=require(_0x09ce('0x5'));var ejs=require(_0x09ce('0x6'));var fs=require('fs');var fs_extra=require(_0x09ce('0x7'));var _=require(_0x09ce('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x09ce('0x9'));var deskjs=require(_0x09ce('0xa'));var toCsv=require(_0x09ce('0x5'));var querystring=require(_0x09ce('0xb'));var Papa=require(_0x09ce('0xc'));var Redis=require(_0x09ce('0xd'));var authService=require(_0x09ce('0xe'));var qs=require(_0x09ce('0xf'));var as=require(_0x09ce('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x09ce('0x11'))(_0x09ce('0x12'));var utils=require(_0x09ce('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x09ce('0x14'))['db'];config['redis']=_[_0x09ce('0x15')](config[_0x09ce('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x09ce('0x17'))(new Redis(config[_0x09ce('0x16')]));require('./faxMessage.socket')[_0x09ce('0x18')](socket);var jayson=require(_0x09ce('0x19'));var client=jayson[_0x09ce('0x1a')][_0x09ce('0x1b')]({'port':0x232c});var client9002=jayson[_0x09ce('0x1a')][_0x09ce('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x743e93,_0x7e19b7,_0x4129f4,_0x184eeb){return new BPromise(function(_0x3a8e38,_0x21509b){var _0x6395ca=_0x184eeb||client;return _0x6395ca[_0x09ce('0x1c')](_0x743e93,_0x4129f4)[_0x09ce('0x1d')](function(_0xa67d39){logger[_0x09ce('0x1e')](_0x09ce('0x1f'),_0x7e19b7,_0x09ce('0x20'));logger[_0x09ce('0x21')](_0x09ce('0x22'),_0x7e19b7,_0x09ce('0x20'),JSON[_0x09ce('0x23')](_0xa67d39));if(_0xa67d39[_0x09ce('0x24')]){if(_0xa67d39['error'][_0x09ce('0x25')]===0x1f4){logger[_0x09ce('0x24')]('FaxMessage,\x20%s,\x20%s',_0x7e19b7,_0xa67d39[_0x09ce('0x24')][_0x09ce('0x26')]);return _0x21509b(_0xa67d39[_0x09ce('0x24')]['message']);}logger[_0x09ce('0x24')]('FaxMessage,\x20%s,\x20%s',_0x7e19b7,_0xa67d39[_0x09ce('0x24')]['message']);return _0x3a8e38(_0xa67d39[_0x09ce('0x24')][_0x09ce('0x26')]);}else{logger[_0x09ce('0x1e')](_0x09ce('0x1f'),_0x7e19b7,_0x09ce('0x20'));_0x3a8e38(_0xa67d39[_0x09ce('0x27')][_0x09ce('0x26')]);}})[_0x09ce('0x28')](function(_0x491193){logger[_0x09ce('0x24')](_0x09ce('0x1f'),_0x7e19b7,_0x491193);_0x21509b(_0x491193);});});}function respondWithStatusCode(_0x299df6,_0x3a242b){_0x3a242b=_0x3a242b||0xcc;return function(_0x3987c6){if(_0x3987c6){return _0x299df6[_0x09ce('0x29')](_0x3a242b);}return _0x299df6[_0x09ce('0x2a')](_0x3a242b)[_0x09ce('0x2b')]();};}function respondWithResult(_0xd25033,_0x4007c2){_0x4007c2=_0x4007c2||0xc8;return function(_0x3a56a3){if(_0x3a56a3){return _0xd25033[_0x09ce('0x2a')](_0x4007c2)[_0x09ce('0x2c')](_0x3a56a3);}};}function respondWithFilteredResult(_0xc78a31,_0x57d850){return function(_0x1bf3d4){if(_0x1bf3d4){var _0x4c8185=typeof _0x57d850[_0x09ce('0x2d')]==='undefined'&&typeof _0x57d850['limit']===_0x09ce('0x2e');var _0x3dbfd2=_0x1bf3d4[_0x09ce('0x2f')];var _0x37c3af=_0x4c8185?0x0:_0x57d850[_0x09ce('0x2d')];var _0x344895=_0x4c8185?_0x1bf3d4['count']:_0x57d850[_0x09ce('0x2d')]+_0x57d850['limit'];var _0x1d22cb;if(_0x344895>=_0x3dbfd2){_0x344895=_0x3dbfd2;_0x1d22cb=0xc8;}else{_0x1d22cb=0xce;}_0xc78a31[_0x09ce('0x2a')](_0x1d22cb);return _0xc78a31[_0x09ce('0x30')](_0x09ce('0x31'),_0x37c3af+'-'+_0x344895+'/'+_0x3dbfd2)['json'](_0x1bf3d4);}return null;};}function patchUpdates(_0x12bbb2){return function(_0xcfd446){try{jsonpatch[_0x09ce('0x32')](_0xcfd446,_0x12bbb2,!![]);}catch(_0x1ea5e7){return BPromise[_0x09ce('0x33')](_0x1ea5e7);}return _0xcfd446[_0x09ce('0x34')]();};}function saveUpdates(_0x163156,_0x314873){return function(_0x1e8d33){if(_0x1e8d33){return _0x1e8d33[_0x09ce('0x35')](_0x163156)[_0x09ce('0x1d')](function(_0x49db36){return _0x49db36;});}return null;};}function removeEntity(_0x4f1f03,_0x2c21a8){return function(_0x334e31){if(_0x334e31){return _0x334e31[_0x09ce('0x36')]()[_0x09ce('0x1d')](function(){_0x4f1f03[_0x09ce('0x2a')](0xcc)[_0x09ce('0x2b')]();});}};}function handleEntityNotFound(_0xea677b,_0x53df6b){return function(_0x5c6239){if(!_0x5c6239){_0xea677b[_0x09ce('0x29')](0x194);}return _0x5c6239;};}function handleError(_0x2b3305,_0x1124d2){_0x1124d2=_0x1124d2||0x1f4;return function(_0x5c24a9){logger[_0x09ce('0x24')](_0x5c24a9[_0x09ce('0x37')]);if(_0x5c24a9[_0x09ce('0x38')]){delete _0x5c24a9[_0x09ce('0x38')];}_0x2b3305[_0x09ce('0x2a')](_0x1124d2)[_0x09ce('0x39')](_0x5c24a9);};}exports['index']=function(_0x1dd7ac,_0x3b0baa){var _0x3a0b3b={},_0x1797aa={},_0x51c1b8={'count':0x0,'rows':[]};var _0x4a176d=_[_0x09ce('0x3a')](db[_0x09ce('0x3b')][_0x09ce('0x3c')],function(_0xafc984){return{'name':_0xafc984['fieldName'],'type':_0xafc984[_0x09ce('0x3d')]['key']};});_0x1797aa[_0x09ce('0x3e')]=_[_0x09ce('0x3a')](_0x4a176d,_0x09ce('0x38'));_0x1797aa[_0x09ce('0x3f')]=_[_0x09ce('0x40')](_0x1dd7ac['query']);_0x1797aa[_0x09ce('0x41')]=_[_0x09ce('0x42')](_0x1797aa[_0x09ce('0x3e')],_0x1797aa[_0x09ce('0x3f')]);_0x3a0b3b[_0x09ce('0x43')]=_[_0x09ce('0x42')](_0x1797aa[_0x09ce('0x3e')],qs[_0x09ce('0x44')](_0x1dd7ac['query'][_0x09ce('0x44')]));_0x3a0b3b[_0x09ce('0x43')]=_0x3a0b3b[_0x09ce('0x43')][_0x09ce('0x45')]?_0x3a0b3b[_0x09ce('0x43')]:_0x1797aa['model'];if(!_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x46')]('nolimit')){_0x3a0b3b[_0x09ce('0x47')]=qs[_0x09ce('0x47')](_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x47')]);_0x3a0b3b[_0x09ce('0x2d')]=qs['offset'](_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x2d')]);}_0x3a0b3b[_0x09ce('0x48')]=qs['sort'](_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x49')]);_0x3a0b3b[_0x09ce('0x4a')]=qs['filters'](_[_0x09ce('0x4b')](_0x1dd7ac[_0x09ce('0x3f')],_0x1797aa[_0x09ce('0x41')]),_0x4a176d);if(_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x4c')]){_0x3a0b3b['where']=_[_0x09ce('0x4d')](_0x3a0b3b['where'],{'$or':_['map'](_0x4a176d,function(_0x4e952c){if(_0x4e952c['type']!==_0x09ce('0x4e')){var _0x4c8b3c={};_0x4c8b3c[_0x4e952c[_0x09ce('0x38')]]={'$like':'%'+_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x4c')]+'%'};return _0x4c8b3c;}})});}_0x3a0b3b=_[_0x09ce('0x4d')]({},_0x3a0b3b,_0x1dd7ac[_0x09ce('0x4f')]);var _0x427d53={'where':_0x3a0b3b['where']};return db[_0x09ce('0x3b')]['count'](_0x427d53)[_0x09ce('0x1d')](function(_0x29b789){_0x51c1b8[_0x09ce('0x2f')]=_0x29b789;if(_0x1dd7ac[_0x09ce('0x3f')][_0x09ce('0x50')]){_0x3a0b3b[_0x09ce('0x51')]=[{'all':!![]}];}return db[_0x09ce('0x3b')][_0x09ce('0x52')](_0x3a0b3b);})[_0x09ce('0x1d')](function(_0x289c78){_0x51c1b8['rows']=_0x289c78;return _0x51c1b8;})['then'](respondWithFilteredResult(_0x3b0baa,_0x3a0b3b))[_0x09ce('0x28')](handleError(_0x3b0baa,null));};exports[_0x09ce('0x53')]=function(_0x29d49a,_0x3f6cb9){var _0x1e20d4={'raw':!![],'where':{'id':_0x29d49a[_0x09ce('0x54')]['id']}},_0x50cce6={};_0x50cce6[_0x09ce('0x3e')]=_['keys'](db[_0x09ce('0x3b')]['rawAttributes']);_0x50cce6['query']=_['keys'](_0x29d49a[_0x09ce('0x3f')]);_0x50cce6['filters']=_[_0x09ce('0x42')](_0x50cce6[_0x09ce('0x3e')],_0x50cce6[_0x09ce('0x3f')]);_0x1e20d4[_0x09ce('0x43')]=_['intersection'](_0x50cce6[_0x09ce('0x3e')],qs['fields'](_0x29d49a[_0x09ce('0x3f')][_0x09ce('0x44')]));_0x1e20d4[_0x09ce('0x43')]=_0x1e20d4[_0x09ce('0x43')][_0x09ce('0x45')]?_0x1e20d4[_0x09ce('0x43')]:_0x50cce6[_0x09ce('0x3e')];if(_0x29d49a[_0x09ce('0x3f')][_0x09ce('0x50')]){_0x1e20d4[_0x09ce('0x51')]=[{'all':!![]}];}_0x1e20d4=_['merge']({},_0x1e20d4,_0x29d49a[_0x09ce('0x4f')]);return db[_0x09ce('0x3b')][_0x09ce('0x55')](_0x1e20d4)[_0x09ce('0x1d')](handleEntityNotFound(_0x3f6cb9,null))[_0x09ce('0x1d')](respondWithResult(_0x3f6cb9,null))[_0x09ce('0x28')](handleError(_0x3f6cb9,null));};exports['update']=function(_0x5b815d,_0x4c3d7a){if(_0x5b815d[_0x09ce('0x56')]['id']){delete _0x5b815d['body']['id'];}return db[_0x09ce('0x3b')][_0x09ce('0x55')]({'where':{'id':_0x5b815d[_0x09ce('0x54')]['id']}})[_0x09ce('0x1d')](handleEntityNotFound(_0x4c3d7a,null))['then'](saveUpdates(_0x5b815d[_0x09ce('0x56')],null))[_0x09ce('0x1d')](respondWithResult(_0x4c3d7a,null))['catch'](handleError(_0x4c3d7a,null));};exports['destroy']=function(_0xce1d6,_0x491a1d){return db['FaxMessage'][_0x09ce('0x55')]({'where':{'id':_0xce1d6[_0x09ce('0x54')]['id']}})['then'](handleEntityNotFound(_0x491a1d,null))[_0x09ce('0x1d')](removeEntity(_0x491a1d,null))[_0x09ce('0x28')](handleError(_0x491a1d,null));};exports[_0x09ce('0x57')]=function(_0x423fb2,_0x37f943){return db[_0x09ce('0x3b')]['describe']()[_0x09ce('0x1d')](respondWithResult(_0x37f943,null))['catch'](handleError(_0x37f943,null));};var interaction_log=require(_0x09ce('0x11'))('fax-interactions');exports['accept']=function(_0x57d109,_0x59255e,_0x55aba3){var _0x8feb39={'agent':{},'channel':_0x09ce('0x58')};if(_0x57d109['body']['id']){delete _0x57d109[_0x09ce('0x56')]['id'];}_0x57d109[_0x09ce('0x56')][_0x09ce('0x59')]=!![];_0x57d109['body']['readAt']=moment()[_0x09ce('0x5a')](_0x09ce('0x5b'));_0x57d109[_0x09ce('0x56')][_0x09ce('0x5c')]=_0x57d109['body'][_0x09ce('0x5c')]||_0x57d109[_0x09ce('0x5d')]['id'];_0x8feb39[_0x09ce('0x5e')]['id']=_0x57d109[_0x09ce('0x56')][_0x09ce('0x5c')];return db[_0x09ce('0x3b')][_0x09ce('0x55')]({'where':{'id':_0x57d109[_0x09ce('0x54')]['id'],'UserId':null}})[_0x09ce('0x1d')](handleEntityNotFound(_0x59255e,null))[_0x09ce('0x1d')](saveUpdates(_0x57d109[_0x09ce('0x56')],null))[_0x09ce('0x1d')](function(_0x26ab3e){if(_0x26ab3e){_0x8feb39[_0x09ce('0x26')]=_0x26ab3e[_0x09ce('0x5f')]({'plain':!![]});return db[_0x09ce('0x60')][_0x09ce('0x55')]({'where':{'id':_0x26ab3e[_0x09ce('0x61')]}});}return null;})[_0x09ce('0x1d')](handleEntityNotFound(_0x59255e,null))[_0x09ce('0x1d')](function(_0x2b4c2c){if(_0x2b4c2c){return _0x2b4c2c[_0x09ce('0x35')]({'UserId':_0x57d109[_0x09ce('0x56')][_0x09ce('0x5c')],'read1stAt':_[_0x09ce('0x62')](_0x2b4c2c[_0x09ce('0x63')])?moment()['format'](_0x09ce('0x5b')):undefined});}return null;})[_0x09ce('0x1d')](function(_0x49bf7){if(_0x49bf7){_0x8feb39[_0x09ce('0x64')]=_0x49bf7[_0x09ce('0x5f')]({'plain':!![]});interaction_log[_0x09ce('0x1e')](_0x09ce('0x65'),_0x57d109[_0x09ce('0x5d')]['id'],_0x57d109['user'][_0x09ce('0x38')],_0x57d109[_0x09ce('0x5d')]['role'],_0x8feb39[_0x09ce('0x64')]['id'],_0x57d109['body']?JSON['stringify'](_0x57d109['body']):_0x09ce('0x66'));return respondWithRpcPromise(_0x09ce('0x67'),_0x09ce('0x68'),_0x8feb39);}return null;})[_0x09ce('0x1d')](function(_0x50b4cc){var _0x39fd61=_0x09ce('0x69')+_0x50b4cc['message'][_0x09ce('0x6a')];return db[_0x09ce('0x6b')][_0x09ce('0x3f')](_0x39fd61,{'type':db['Sequelize'][_0x09ce('0x6c')]['SELECT'],'raw':!![]})['then'](function(_0x1be00e){return _0x1be00e;});})[_0x09ce('0x1d')](function(_0x1ee867){if(_0x1ee867){_0x8feb39[_0x09ce('0x26')][_0x09ce('0x6d')]=_0x1ee867[0x0];if(!_0x57d109['body'][_0x09ce('0x5c')])return;return db[_0x09ce('0x6e')][_0x09ce('0x55')]({'where':{'id':_0x57d109[_0x09ce('0x56')][_0x09ce('0x5c')],'role':_0x09ce('0x5e')},'attributes':['id',_0x09ce('0x38'),'fullname',_0x09ce('0x6f'),'internal'],'raw':!![]});}return null;})[_0x09ce('0x1d')](function(_0x4a00b7){if(!_0x4a00b7)return null;_0x8feb39[_0x09ce('0x26')]['agent']=_0x4a00b7;return _0x8feb39;})[_0x09ce('0x1d')](function(_0x42c3b0){if(_0x42c3b0){if(_0x57d109[_0x09ce('0x56')][_0x09ce('0x70')]){_0x8feb39['message']['interface']=util['format'](_0x09ce('0x71'),_0x57d109['user']['name']);_0x8feb39[_0x09ce('0x26')][_0x09ce('0x72')]=_0x8feb39[_0x09ce('0x72')];_0x8feb39['message'][_0x09ce('0x73')]=_0x09ce('0x74');return respondWithRpcPromise('EventManager',_0x09ce('0x75'),{'event':_0x09ce('0x76'),'message':_0x8feb39['message']},client9002)['then'](function(){return _0x8feb39;});}return _0x8feb39;}return null;})['then'](respondWithResult(_0x59255e,null))[_0x09ce('0x28')](handleError(_0x59255e,null));};var interaction_log=require(_0x09ce('0x11'))(_0x09ce('0x77'));exports[_0x09ce('0x33')]=function(_0x260f03,_0x15704a,_0xdef760){var _0x34a048={'agent':{},'channel':'fax'};if(_0x260f03['body']['id']){delete _0x260f03[_0x09ce('0x56')]['id'];}_0x260f03['body'][_0x09ce('0x5c')]=_0x260f03[_0x09ce('0x56')][_0x09ce('0x5c')]||_0x260f03[_0x09ce('0x5d')]['id'];_0x34a048[_0x09ce('0x5e')]['id']=_0x260f03[_0x09ce('0x56')][_0x09ce('0x5c')];return db[_0x09ce('0x3b')][_0x09ce('0x55')]({'where':{'id':_0x260f03[_0x09ce('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x15704a,null))[_0x09ce('0x1d')](function(_0x543b53){if(_0x543b53){_0x34a048[_0x09ce('0x26')]=_0x543b53[_0x09ce('0x5f')]({'plain':!![]});return db[_0x09ce('0x60')][_0x09ce('0x55')]({'where':{'id':_0x543b53[_0x09ce('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x15704a,null))[_0x09ce('0x1d')](function(_0xd584a5){if(_0xd584a5){_0x34a048[_0x09ce('0x64')]=_0xd584a5['get']({'plain':!![]});interaction_log[_0x09ce('0x1e')](_0x09ce('0x78'),_0x260f03[_0x09ce('0x5d')]['id'],_0x260f03['user'][_0x09ce('0x38')],_0x260f03[_0x09ce('0x5d')][_0x09ce('0x79')],_0x34a048[_0x09ce('0x64')]['id'],_0x260f03[_0x09ce('0x56')]?JSON['stringify'](_0x260f03[_0x09ce('0x56')]):_0x09ce('0x66'));return respondWithRpcPromise(_0x09ce('0x7a'),_0x09ce('0x7b'),_0x34a048);}return null;})[_0x09ce('0x1d')](function(_0x12e4c7){var _0x4d2aff='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x12e4c7['message'][_0x09ce('0x6a')];return db['sequelize'][_0x09ce('0x3f')](_0x4d2aff,{'type':db['Sequelize'][_0x09ce('0x6c')][_0x09ce('0x7c')],'raw':!![]})['then'](function(_0x4931ae){return _0x4931ae;});})['then'](function(_0x2abf72){if(_0x2abf72){_0x34a048[_0x09ce('0x26')][_0x09ce('0x6d')]=_0x2abf72[0x0];if(!_0x260f03[_0x09ce('0x56')][_0x09ce('0x5c')])return;return db[_0x09ce('0x6e')][_0x09ce('0x55')]({'where':{'id':_0x260f03['body'][_0x09ce('0x5c')],'role':_0x09ce('0x5e')},'attributes':['id',_0x09ce('0x38'),'fullname',_0x09ce('0x6f'),_0x09ce('0x7d')],'raw':!![]});}return null;})[_0x09ce('0x1d')](function(_0x219636){if(!_0x219636)return null;_0x34a048[_0x09ce('0x26')][_0x09ce('0x5e')]=_0x219636;return _0x34a048;})[_0x09ce('0x1d')](function(_0x38c9f0){if(_0x38c9f0){_0x38c9f0['message'][_0x09ce('0x7e')]=util[_0x09ce('0x5a')](_0x09ce('0x71'),_0x260f03[_0x09ce('0x5d')]['name']);_0x38c9f0['message'][_0x09ce('0x72')]=_0x34a048['channel'];_0x38c9f0[_0x09ce('0x26')][_0x09ce('0x73')]=_0x09ce('0x33');respondWithRpcPromise('EventManager',_0x09ce('0x75'),{'event':_0x09ce('0x7f'),'message':_0x38c9f0['message']},client9002);return _0x34a048;}return null;})[_0x09ce('0x1d')](respondWithResult(_0x15704a,null))['catch'](handleError(_0x15704a,null));};exports[_0x09ce('0x80')]=function(_0x29a54e,_0x1fcf17){var _0x5298cc;return db['FaxMessage'][_0x09ce('0x80')](_0x29a54e[_0x09ce('0x56')],{})['then'](function(_0x316ad4){_0x5298cc=_0x316ad4;return db['CmContact'][_0x09ce('0x81')]({'where':{'id':_0x5298cc[_0x09ce('0x6a')]}});})[_0x09ce('0x1d')](function(_0x120d88){if(_[_0x09ce('0x62')](_0x120d88)){return;}else{_0x5298cc[_0x09ce('0x58')]=_0x120d88[_0x09ce('0x58')];return db[_0x09ce('0x82')][_0x09ce('0x81')]({'where':{'id':_0x5298cc[_0x09ce('0x83')]}});}})[_0x09ce('0x1d')](function(_0x50da21){return respondWithRpcPromise(_0x09ce('0x84'),_0x09ce('0x84'),{'FaxAccountId':_[_0x09ce('0x62')](_0x29a54e[_0x09ce('0x56')])?undefined:_0x29a54e[_0x09ce('0x56')][_0x09ce('0x85')],'path':_[_0x09ce('0x62')](_0x50da21)?undefined:util[_0x09ce('0x5a')]('/var/opt/motion2/server/files/attachments/%s',_0x50da21[_0x09ce('0x86')]),'fax':_['isNil'](_0x5298cc[_0x09ce('0x58')])?undefined:_0x5298cc[_0x09ce('0x58')],'AttachmentId':_0x5298cc[_0x09ce('0x83')]},client9002);})[_0x09ce('0x1d')](respondWithResult(_0x1fcf17,0xc9))[_0x09ce('0x28')](handleError(_0x1fcf17,null));};exports['download']=function(_0x524055,_0x587b5f){var _0x57572b=path[_0x09ce('0x87')](config[_0x09ce('0x88')],_0x09ce('0x89'),'files',_0x09ce('0x8a'));return db[_0x09ce('0x3b')][_0x09ce('0x55')]({'where':{'id':_0x524055['params']['id']},'include':[{'model':db['Attachment'],'as':_0x09ce('0x82')}]})[_0x09ce('0x1d')](handleEntityNotFound(_0x587b5f,null))[_0x09ce('0x1d')](function(_0x668a61){if(_0x668a61){return _0x587b5f[_0x09ce('0x8b')](path[_0x09ce('0x87')](_0x57572b,_0x668a61[_0x09ce('0x82')][_0x09ce('0x86')]));}})[_0x09ce('0x28')](handleError(_0x587b5f,null));};
\ No newline at end of file
index 00d5a4d..26938d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a6=['FaxMessage','save','update','hook','exports','../../mysqldb'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x63a6,0x1c7));var _0x663a=function(_0x3efe87,_0x35ad48){_0x3efe87=_0x3efe87-0x0;var _0x56a4cc=_0x63a6[_0x3efe87];return _0x56a4cc;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x663a('0x0'))['db'][_0x663a('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x663a('0x2'),'afterUpdate':_0x663a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2a63c6){return function(_0x2a1a20,_0x10be49,_0x125e93){FaxMessageEvents['emit'](_0x2a63c6+':'+_0x2a1a20['id'],_0x2a1a20);FaxMessageEvents['emit'](_0x2a63c6,_0x2a1a20);_0x125e93(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x663a('0x4')](e,emitEvent(event));}}module[_0x663a('0x5')]=FaxMessageEvents;
\ No newline at end of file
+var _0x2b47=['FaxMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x5360b9,_0xaa2c02){var _0x1b8e7f=function(_0x44e0dc){while(--_0x44e0dc){_0x5360b9['push'](_0x5360b9['shift']());}};_0x1b8e7f(++_0xaa2c02);}(_0x2b47,0x177));var _0x72b4=function(_0x2b2b08,_0x13b004){_0x2b2b08=_0x2b2b08-0x0;var _0x3719c3=_0x2b47[_0x2b2b08];return _0x3719c3;};'use strict';var EventEmitter=require(_0x72b4('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x72b4('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x72b4('0x2')](0x0);var events={'afterCreate':_0x72b4('0x3'),'afterUpdate':'update','afterDestroy':_0x72b4('0x4')};function emitEvent(_0x299680){return function(_0x2a3f83,_0x302681,_0x160600){FaxMessageEvents[_0x72b4('0x5')](_0x299680+':'+_0x2a3f83['id'],_0x2a3f83);FaxMessageEvents['emit'](_0x299680,_0x2a3f83);_0x160600(null);};}for(var e in events){if(events[_0x72b4('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x72b4('0x7')]=FaxMessageEvents;
\ No newline at end of file
index 70e3fba..7f29029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bcf=['request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','FaxInteraction','FaxInteractionId','then','createdAt','catch','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x836465,_0x5442ae){var _0x2150ea=function(_0x4f4bc2){while(--_0x4f4bc2){_0x836465['push'](_0x836465['shift']());}};_0x2150ea(++_0x5442ae);}(_0x2bcf,0x173));var _0xf2bc=function(_0x37d9b1,_0x358b0d){_0x37d9b1=_0x37d9b1-0x0;var _0x580044=_0x2bcf[_0x37d9b1];return _0x580044;};'use strict';var _=require(_0xf2bc('0x0'));var util=require(_0xf2bc('0x1'));var logger=require(_0xf2bc('0x2'))(_0xf2bc('0x3'));var moment=require(_0xf2bc('0x4'));var BPromise=require(_0xf2bc('0x5'));var rp=require(_0xf2bc('0x6'));var fs=require('fs');var path=require(_0xf2bc('0x7'));var rimraf=require(_0xf2bc('0x8'));var config=require(_0xf2bc('0x9'));var attributes=require(_0xf2bc('0xa'));module[_0xf2bc('0xb')]=function(_0x140b2c,_0x5bd0fa){return _0x140b2c[_0xf2bc('0xc')]('FaxMessage',attributes,{'tableName':_0xf2bc('0xd'),'paranoid':![],'indexes':[{'name':_0xf2bc('0xe'),'fields':[_0xf2bc('0xf')],'type':_0xf2bc('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6c25e7,_0x4eee22,_0x8c05fe){var _0x3a810c=_0x140b2c[_0xf2bc('0x11')];var _0x36767c=_0x6c25e7['get']({'plain':!![]});if(_0x36767c[_0xf2bc('0x12')]['toLowerCase']()==='in'||_0x36767c[_0xf2bc('0x12')][_0xf2bc('0x13')]()===_0xf2bc('0x14')&&!_0x36767c['secret']&&!_[_0xf2bc('0x15')](_0x36767c[_0xf2bc('0x16')])){_0x3a810c[_0xf2bc('0x17')]['findOne']({'where':{'id':_0x36767c[_0xf2bc('0x18')]}})[_0xf2bc('0x19')](function(_0x29898d){if(_0x29898d){_0x29898d['update']({'lastMsgAt':_0x36767c[_0xf2bc('0x1a')],'lastMsgDirection':_0x36767c[_0xf2bc('0x12')][_0xf2bc('0x13')]()});}})[_0xf2bc('0x1b')](function(_0x58c0b8){console['error'](_0x58c0b8);});}_0x8c05fe();}},'charset':_0xf2bc('0x1c'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x29a2=['rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','get','direction','toLowerCase','out','isNil','UserId','findOne','then','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x29a2,0x7c));var _0x229a=function(_0x2e41e2,_0x4e7250){_0x2e41e2=_0x2e41e2-0x0;var _0x2844d6=_0x29a2[_0x2e41e2];return _0x2844d6;};'use strict';var _=require('lodash');var util=require(_0x229a('0x0'));var logger=require(_0x229a('0x1'))(_0x229a('0x2'));var moment=require(_0x229a('0x3'));var BPromise=require(_0x229a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x229a('0x5'));var rimraf=require(_0x229a('0x6'));var config=require('../../config/environment');var attributes=require(_0x229a('0x7'));module[_0x229a('0x8')]=function(_0x26c97a,_0x490aae){return _0x26c97a[_0x229a('0x9')](_0x229a('0xa'),attributes,{'tableName':_0x229a('0xb'),'paranoid':![],'indexes':[{'name':_0x229a('0xc'),'fields':[_0x229a('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1d4c3c,_0xd1ec52,_0x570b2b){var _0x3ab3d1=_0x26c97a['models'];var _0x487687=_0x1d4c3c[_0x229a('0xe')]({'plain':!![]});if(_0x487687[_0x229a('0xf')][_0x229a('0x10')]()==='in'||_0x487687['direction']['toLowerCase']()===_0x229a('0x11')&&!_0x487687['secret']&&!_[_0x229a('0x12')](_0x487687[_0x229a('0x13')])){_0x3ab3d1['FaxInteraction'][_0x229a('0x14')]({'where':{'id':_0x487687['FaxInteractionId']}})[_0x229a('0x15')](function(_0x363132){if(_0x363132){_0x363132['update']({'lastMsgAt':_0x487687['createdAt'],'lastMsgDirection':_0x487687['direction'][_0x229a('0x10')]()});}})[_0x229a('0x16')](function(_0x1c3dad){console[_0x229a('0x17')](_0x1c3dad);});}_0x570b2b();}},'charset':_0x229a('0x18'),'collate':_0x229a('0x19')});};
\ No newline at end of file
index 03cdf5f..65cd048 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c4e=['localhost','socket.io-emitter','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','debug','stringify','attributes','limit','UpdateFaxMessage','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults'];(function(_0x1a8d28,_0x273169){var _0x1ceee2=function(_0x346f7e){while(--_0x346f7e){_0x1a8d28['push'](_0x1a8d28['shift']());}};_0x1ceee2(++_0x273169);}(_0x4c4e,0x152));var _0xe4c4=function(_0x2eaab2,_0x366b90){_0x2eaab2=_0x2eaab2-0x0;var _0x5145d3=_0x4c4e[_0x2eaab2];return _0x5145d3;};'use strict';var _=require(_0xe4c4('0x0'));var util=require('util');var moment=require(_0xe4c4('0x1'));var BPromise=require(_0xe4c4('0x2'));var rs=require(_0xe4c4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe4c4('0x4'))['db'];var utils=require(_0xe4c4('0x5'));var logger=require(_0xe4c4('0x6'))('rpc');var config=require(_0xe4c4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe4c4('0x8')][_0xe4c4('0x9')]({'port':0x232a});config[_0xe4c4('0xa')]=_[_0xe4c4('0xb')](config[_0xe4c4('0xa')],{'host':_0xe4c4('0xc'),'port':0x18eb});var socket=require(_0xe4c4('0xd'))(new Redis(config[_0xe4c4('0xa')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x31f879,_0x6f2545,_0x27ad42){return new BPromise(function(_0x1bc786,_0x333c08){return client[_0xe4c4('0xe')](_0x31f879,_0x27ad42)['then'](function(_0x303d89){logger[_0xe4c4('0xf')](_0xe4c4('0x10'),_0x6f2545,_0xe4c4('0x11'));logger['debug'](_0xe4c4('0x12'),_0x6f2545,_0xe4c4('0x11'),JSON['stringify'](_0x303d89));if(_0x303d89[_0xe4c4('0x13')]){if(_0x303d89[_0xe4c4('0x13')]['code']===0x1f4){logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x303d89['error'][_0xe4c4('0x14')]);return _0x333c08(_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);}logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);return _0x1bc786(_0x303d89[_0xe4c4('0x13')][_0xe4c4('0x14')]);}else{logger[_0xe4c4('0xf')](_0xe4c4('0x10'),_0x6f2545,_0xe4c4('0x11'));_0x1bc786(_0x303d89[_0xe4c4('0x15')][_0xe4c4('0x14')]);}})[_0xe4c4('0x16')](function(_0x5a32b5){logger[_0xe4c4('0x13')](_0xe4c4('0x10'),_0x6f2545,_0x5a32b5);_0x333c08(_0x5a32b5);});});}exports[_0xe4c4('0x17')]=function(_0x317cc8){var _0x5da165=this;return new Promise(function(_0x3d5856,_0x1cad5d){return db[_0xe4c4('0x18')][_0xe4c4('0x19')](_0x317cc8[_0xe4c4('0x1a')],{'raw':_0x317cc8[_0xe4c4('0x1b')]?_0x317cc8[_0xe4c4('0x1b')][_0xe4c4('0x1c')]===undefined?!![]:![]:!![]})[_0xe4c4('0x1d')](function(_0x1a7690){logger[_0xe4c4('0xf')](_0xe4c4('0x17'),_0x317cc8);logger[_0xe4c4('0x1e')](_0xe4c4('0x17'),_0x317cc8,JSON[_0xe4c4('0x1f')](_0x1a7690));_0x3d5856(_0x1a7690);})['catch'](function(_0x49cadc){logger[_0xe4c4('0x13')]('CreateFaxMessage',_0x49cadc[_0xe4c4('0x14')],_0x317cc8);_0x1cad5d(_0x5da165['error'](0x1f4,_0x49cadc[_0xe4c4('0x14')]));});});};exports['UpdateFaxMessage']=function(_0x34d667){var _0x583393=this;return new Promise(function(_0xba53ef,_0x4a0199){return db['FaxMessage']['update'](_0x34d667['body'],{'raw':_0x34d667[_0xe4c4('0x1b')]?_0x34d667['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34d667[_0xe4c4('0x1b')]?_0x34d667[_0xe4c4('0x1b')]['where']||null:null,'attributes':_0x34d667['options']?_0x34d667[_0xe4c4('0x1b')][_0xe4c4('0x20')]||null:null,'limit':_0x34d667['options']?_0x34d667[_0xe4c4('0x1b')][_0xe4c4('0x21')]||null:null})[_0xe4c4('0x1d')](function(_0x48060e){logger['info'](_0xe4c4('0x22'),_0x34d667);logger[_0xe4c4('0x1e')](_0xe4c4('0x22'),_0x34d667,JSON[_0xe4c4('0x1f')](_0x48060e));_0xba53ef(_0x48060e);})['catch'](function(_0x49c913){logger[_0xe4c4('0x13')](_0xe4c4('0x22'),_0x49c913['message'],_0x34d667);_0x4a0199(_0x583393[_0xe4c4('0x13')](0x1f4,_0x49c913[_0xe4c4('0x14')]));});});};
\ No newline at end of file
+var _0xac31=['attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','update','where'];(function(_0x299c63,_0x1aa16e){var _0x19fe63=function(_0x3f99a5){while(--_0x3f99a5){_0x299c63['push'](_0x299c63['shift']());}};_0x19fe63(++_0x1aa16e);}(_0xac31,0xca));var _0x1ac3=function(_0x34c643,_0x3d7b55){_0x34c643=_0x34c643-0x0;var _0x29862d=_0xac31[_0x34c643];return _0x29862d;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});config[_0x1ac3('0xb')]=_[_0x1ac3('0xc')](config[_0x1ac3('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ac3('0xd'))(new Redis(config['redis']));require(_0x1ac3('0xe'))[_0x1ac3('0xf')](socket);function respondWithRpcPromise(_0x344674,_0x53500b,_0xa26c88){return new BPromise(function(_0x1e2642,_0x3e835b){return client[_0x1ac3('0x10')](_0x344674,_0xa26c88)[_0x1ac3('0x11')](function(_0x422d19){logger['info'](_0x1ac3('0x12'),_0x53500b,_0x1ac3('0x13'));logger[_0x1ac3('0x14')](_0x1ac3('0x15'),_0x53500b,'request\x20sent',JSON[_0x1ac3('0x16')](_0x422d19));if(_0x422d19[_0x1ac3('0x17')]){if(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x18')]===0x1f4){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x422d19[_0x1ac3('0x17')]['message']);return _0x3e835b(_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);}logger[_0x1ac3('0x17')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x422d19[_0x1ac3('0x17')][_0x1ac3('0x19')]);return _0x1e2642(_0x422d19[_0x1ac3('0x17')]['message']);}else{logger[_0x1ac3('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x53500b,_0x1ac3('0x13'));_0x1e2642(_0x422d19[_0x1ac3('0x1b')][_0x1ac3('0x19')]);}})[_0x1ac3('0x1c')](function(_0x18b985){logger['error'](_0x1ac3('0x12'),_0x53500b,_0x18b985);_0x3e835b(_0x18b985);});});}exports[_0x1ac3('0x1d')]=function(_0x296abf){var _0x257f60=this;return new Promise(function(_0x5f1918,_0x48d18a){return db[_0x1ac3('0x1e')][_0x1ac3('0x1f')](_0x296abf[_0x1ac3('0x20')],{'raw':_0x296abf[_0x1ac3('0x21')]?_0x296abf[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![]})[_0x1ac3('0x11')](function(_0x10912a){logger[_0x1ac3('0x1a')]('CreateFaxMessage',_0x296abf);logger[_0x1ac3('0x14')](_0x1ac3('0x1d'),_0x296abf,JSON['stringify'](_0x10912a));_0x5f1918(_0x10912a);})[_0x1ac3('0x1c')](function(_0x10f30c){logger['error'](_0x1ac3('0x1d'),_0x10f30c[_0x1ac3('0x19')],_0x296abf);_0x48d18a(_0x257f60[_0x1ac3('0x17')](0x1f4,_0x10f30c[_0x1ac3('0x19')]));});});};exports[_0x1ac3('0x23')]=function(_0x565a0f){var _0x5a2ab2=this;return new Promise(function(_0x503a64,_0x528807){return db['FaxMessage'][_0x1ac3('0x24')](_0x565a0f['body'],{'raw':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f['options'][_0x1ac3('0x25')]||null:null,'attributes':_0x565a0f['options']?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x26')]||null:null,'limit':_0x565a0f[_0x1ac3('0x21')]?_0x565a0f[_0x1ac3('0x21')][_0x1ac3('0x27')]||null:null})[_0x1ac3('0x11')](function(_0x9c17c2){logger['info'](_0x1ac3('0x23'),_0x565a0f);logger[_0x1ac3('0x14')](_0x1ac3('0x23'),_0x565a0f,JSON[_0x1ac3('0x16')](_0x9c17c2));_0x503a64(_0x9c17c2);})['catch'](function(_0x3591a9){logger[_0x1ac3('0x17')](_0x1ac3('0x23'),_0x3591a9[_0x1ac3('0x19')],_0x565a0f);_0x528807(_0x5a2ab2[_0x1ac3('0x17')](0x1f4,_0x3591a9['message']));});});};
\ No newline at end of file
index c3be90f..8dacca0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fce=['remove','update','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save'];(function(_0x19278d,_0x27999d){var _0x2673f8=function(_0x976501){while(--_0x976501){_0x19278d['push'](_0x19278d['shift']());}};_0x2673f8(++_0x27999d);}(_0x1fce,0xdf));var _0xe1fc=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x1fce[_0x349367];return _0x14179b;};'use strict';var FaxMessageEvents=require(_0xe1fc('0x0'));var events=[_0xe1fc('0x1'),_0xe1fc('0x2'),_0xe1fc('0x3')];function createListener(_0x35c3b4,_0x1bc27e){return function(_0x10e47e){_0x1bc27e[_0xe1fc('0x4')](_0x35c3b4,_0x10e47e);};}function removeListener(_0x59ff24,_0x556fa8){return function(){FaxMessageEvents[_0xe1fc('0x5')](_0x59ff24,_0x556fa8);};}exports[_0xe1fc('0x6')]=function(_0x2e5b05){for(var _0x37d0a2=0x0,_0x23534d=events[_0xe1fc('0x7')];_0x37d0a2<_0x23534d;_0x37d0a2++){var _0x579ad6=events[_0x37d0a2];var _0x37bc86=createListener(_0xe1fc('0x8')+_0x579ad6,_0x2e5b05);FaxMessageEvents['on'](_0x579ad6,_0x37bc86);}};
\ No newline at end of file
+var _0x0034=['remove','emit','removeListener','register','faxMessage:','./faxMessage.events'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0034,0x1d3));var _0x4003=function(_0x52fb3c,_0x2cf66e){_0x52fb3c=_0x52fb3c-0x0;var _0x5c9223=_0x0034[_0x52fb3c];return _0x5c9223;};'use strict';var FaxMessageEvents=require(_0x4003('0x0'));var events=['save',_0x4003('0x1'),'update'];function createListener(_0x2d30a6,_0x115bea){return function(_0x44f68d){_0x115bea[_0x4003('0x2')](_0x2d30a6,_0x44f68d);};}function removeListener(_0x864bf2,_0x2335ee){return function(){FaxMessageEvents[_0x4003('0x3')](_0x864bf2,_0x2335ee);};}exports[_0x4003('0x4')]=function(_0x100d46){for(var _0x163e37=0x0,_0x34a248=events['length'];_0x163e37<_0x34a248;_0x163e37++){var _0x282b51=events[_0x163e37];var _0xcf4051=createListener(_0x4003('0x5')+_0x282b51,_0x100d46);FaxMessageEvents['on'](_0x282b51,_0xcf4051);}};
\ No newline at end of file
index a9bf7fd..15cfc60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['/:id/accept','accept','/:id/reject','delete','exports','multer','Router','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','tracked','faxmessage:create','create','put'];(function(_0x56b300,_0x380cda){var _0x133df0=function(_0x32b107){while(--_0x32b107){_0x56b300['push'](_0x56b300['shift']());}};_0x133df0(++_0x380cda);}(_0xf4eb,0xec));var _0xbf4e=function(_0x514139,_0x4334f6){_0x514139=_0x514139-0x0;var _0x1aab73=_0xf4eb[_0x514139];return _0x1aab73;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0x5')](_0xbf4e('0xa'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xbf4e('0xc')]('fax',_0xbf4e('0xd')),controller[_0xbf4e('0xe')]);router['put'](_0xbf4e('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xbf4e('0xf')](_0xbf4e('0x10'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x11')]);router[_0xbf4e('0xf')](_0xbf4e('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0xbf4e('0x13')](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0x14')]=router;
\ No newline at end of file
+var _0xc368=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','download','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','delete','destroy','exports','util','connect-timeout'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xc368,0x7b));var _0x8c36=function(_0x4daf90,_0x31d7c5){_0x4daf90=_0x4daf90-0x0;var _0x16b208=_0xc368[_0x4daf90];return _0x16b208;};'use strict';var multer=require('multer');var util=require(_0x8c36('0x0'));var path=require('path');var timeout=require(_0x8c36('0x1'));var express=require(_0x8c36('0x2'));var router=express[_0x8c36('0x3')]();var fs_extra=require(_0x8c36('0x4'));var auth=require(_0x8c36('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8c36('0x6'));var controller=require(_0x8c36('0x7'));router[_0x8c36('0x8')]('/',auth[_0x8c36('0x9')](),controller['index']);router['get'](_0x8c36('0xa'),auth[_0x8c36('0x9')](),controller[_0x8c36('0xb')]);router[_0x8c36('0x8')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller['show']);router['get']('/:id/download',auth[_0x8c36('0x9')](),controller[_0x8c36('0xd')]);router['post']('/',auth[_0x8c36('0x9')](),interaction[_0x8c36('0xe')](_0x8c36('0xf'),_0x8c36('0x10')),controller[_0x8c36('0x11')]);router[_0x8c36('0x12')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x13')]);router[_0x8c36('0x12')](_0x8c36('0x14'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x15')]);router[_0x8c36('0x12')]('/:id/reject',auth[_0x8c36('0x9')](),controller['reject']);router[_0x8c36('0x16')](_0x8c36('0xc'),auth[_0x8c36('0x9')](),controller[_0x8c36('0x17')]);module[_0x8c36('0x18')]=router;
\ No newline at end of file
index e95f37f..77626b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3599=['exports','STRING','name','beepall','sequelize'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x3599,0x185));var _0x9359=function(_0xe3212a,_0x46f0d8){_0xe3212a=_0xe3212a-0x0;var _0xbdd2c1=_0x3599[_0xe3212a];return _0xbdd2c1;};'use strict';var Sequelize=require(_0x9359('0x0'));module[_0x9359('0x1')]={'name':{'type':Sequelize[_0x9359('0x2')],'unique':_0x9359('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9359('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x9359('0x4'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x288a=['STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x288a,0x1d5));var _0xa288=function(_0x96db0f,_0x4e5537){_0x96db0f=_0x96db0f-0x0;var _0x5c74f5=_0x288a[_0x96db0f];return _0x5c74f5;};'use strict';var Sequelize=require(_0xa288('0x0'));module[_0xa288('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa288('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa288('0x3')]},'timeout':{'type':Sequelize[_0xa288('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa288('0x5')](_0xa288('0x6'),'beepall',_0xa288('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa288('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 62500b8..69cb13c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26fe=['TeamId','includes','all','union','compact','value','removeTeams','isEmpty','userFaxQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','set','apply','reject','save','update','then','destroy','FaxQueues','UserProfileResource','error','stack','send','map','FaxQueue','fieldName','type','key','name','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','filter','options','rows','catch','keys','rawAttributes','includeAll','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','create','body','params','describe','getMembers','findOne','UserFaxQueue','pick','findAll','User','findAndCountAll','UserId','faxPause','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userFaxQueue:save','field','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x26fe,0x1ad));var _0xe26f=function(_0x5d968e,_0x2a15bf){_0x5d968e=_0x5d968e-0x0;var _0x492fa1=_0x26fe[_0x5d968e];return _0x492fa1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe26f('0x0'));var jsonpatch=require(_0xe26f('0x1'));var rp=require(_0xe26f('0x2'));var moment=require(_0xe26f('0x3'));var BPromise=require(_0xe26f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe26f('0x5'));var sox=require(_0xe26f('0x6'));var csv=require(_0xe26f('0x7'));var ejs=require(_0xe26f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe26f('0x9'));var crypto=require(_0xe26f('0xa'));var jsforce=require(_0xe26f('0xb'));var deskjs=require(_0xe26f('0xc'));var toCsv=require(_0xe26f('0x7'));var querystring=require(_0xe26f('0xd'));var Papa=require(_0xe26f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe26f('0xf'));var as=require(_0xe26f('0x10'));var hardwareService=require(_0xe26f('0x11'));var logger=require('../../config/logger')(_0xe26f('0x12'));var utils=require(_0xe26f('0x13'));var config=require(_0xe26f('0x14'));var licenseUtil=require(_0xe26f('0x15'));var db=require(_0xe26f('0x16'))['db'];config['redis']=_[_0xe26f('0x17')](config[_0xe26f('0x18')],{'host':_0xe26f('0x19'),'port':0x18eb});var socket=require(_0xe26f('0x1a'))(new Redis(config[_0xe26f('0x18')]));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x5d81bc,_0x3f539e){_0x3f539e=_0x3f539e||0xcc;return function(_0x2ef08e){if(_0x2ef08e){return _0x5d81bc[_0xe26f('0x1b')](_0x3f539e);}return _0x5d81bc[_0xe26f('0x1c')](_0x3f539e)[_0xe26f('0x1d')]();};}function respondWithResult(_0x3eb890,_0x1d1e6c){_0x1d1e6c=_0x1d1e6c||0xc8;return function(_0x5f2368){if(_0x5f2368){return _0x3eb890[_0xe26f('0x1c')](_0x1d1e6c)[_0xe26f('0x1e')](_0x5f2368);}};}function respondWithFilteredResult(_0x3bd3be,_0x466810){return function(_0x53042b){if(_0x53042b){var _0x756a2a=typeof _0x466810[_0xe26f('0x1f')]===_0xe26f('0x20')&&typeof _0x466810['limit']===_0xe26f('0x20');var _0x4bd98f=_0x53042b[_0xe26f('0x21')];var _0x6ea5e6=_0x756a2a?0x0:_0x466810[_0xe26f('0x1f')];var _0x4ec6c2=_0x756a2a?_0x53042b['count']:_0x466810[_0xe26f('0x1f')]+_0x466810['limit'];var _0x5c26ba;if(_0x4ec6c2>=_0x4bd98f){_0x4ec6c2=_0x4bd98f;_0x5c26ba=0xc8;}else{_0x5c26ba=0xce;}_0x3bd3be[_0xe26f('0x1c')](_0x5c26ba);return _0x3bd3be[_0xe26f('0x22')]('Content-Range',_0x6ea5e6+'-'+_0x4ec6c2+'/'+_0x4bd98f)['json'](_0x53042b);}return null;};}function patchUpdates(_0x292ae8){return function(_0x25921a){try{jsonpatch[_0xe26f('0x23')](_0x25921a,_0x292ae8,!![]);}catch(_0x110a18){return BPromise[_0xe26f('0x24')](_0x110a18);}return _0x25921a[_0xe26f('0x25')]();};}function saveUpdates(_0x3a4c30,_0x5ab923){return function(_0x5cfece){if(_0x5cfece){return _0x5cfece[_0xe26f('0x26')](_0x3a4c30)[_0xe26f('0x27')](function(_0x35f1e1){return _0x35f1e1;});}return null;};}function removeEntity(_0x5d2990,_0x1607ba){return function(_0x216f89){if(_0x216f89){return _0x216f89[_0xe26f('0x28')]()[_0xe26f('0x27')](function(){var _0x5a00e1=_0x216f89['get']({'plain':!![]});var _0x13d1a6=_0xe26f('0x29');return db[_0xe26f('0x2a')]['destroy']({'where':{'type':_0x13d1a6,'resourceId':_0x5a00e1['id']}})['then'](function(){return _0x216f89;});})['then'](function(){_0x5d2990[_0xe26f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12c2f7,_0x44d9e3){return function(_0x30363b){if(!_0x30363b){_0x12c2f7[_0xe26f('0x1b')](0x194);}return _0x30363b;};}function handleError(_0xc97559,_0x4b0bd8){_0x4b0bd8=_0x4b0bd8||0x1f4;return function(_0x18c5b2){logger[_0xe26f('0x2b')](_0x18c5b2[_0xe26f('0x2c')]);if(_0x18c5b2['name']){delete _0x18c5b2['name'];}_0xc97559['status'](_0x4b0bd8)[_0xe26f('0x2d')](_0x18c5b2);};}exports['index']=function(_0x2d7b4c,_0x2eb38b){var _0xd8796d={},_0x1bfcf0={},_0x17c656={'count':0x0,'rows':[]};var _0x2cdd53=_[_0xe26f('0x2e')](db[_0xe26f('0x2f')]['rawAttributes'],function(_0x4f06b8){return{'name':_0x4f06b8[_0xe26f('0x30')],'type':_0x4f06b8[_0xe26f('0x31')][_0xe26f('0x32')]};});_0x1bfcf0['model']=_[_0xe26f('0x2e')](_0x2cdd53,_0xe26f('0x33'));_0x1bfcf0[_0xe26f('0x34')]=_['keys'](_0x2d7b4c[_0xe26f('0x34')]);_0x1bfcf0[_0xe26f('0x35')]=_[_0xe26f('0x36')](_0x1bfcf0['model'],_0x1bfcf0[_0xe26f('0x34')]);_0xd8796d[_0xe26f('0x37')]=_['intersection'](_0x1bfcf0[_0xe26f('0x38')],qs[_0xe26f('0x39')](_0x2d7b4c[_0xe26f('0x34')][_0xe26f('0x39')]));_0xd8796d[_0xe26f('0x37')]=_0xd8796d[_0xe26f('0x37')][_0xe26f('0x3a')]?_0xd8796d[_0xe26f('0x37')]:_0x1bfcf0[_0xe26f('0x38')];if(!_0x2d7b4c['query'][_0xe26f('0x3b')](_0xe26f('0x3c'))){_0xd8796d[_0xe26f('0x3d')]=qs['limit'](_0x2d7b4c['query']['limit']);_0xd8796d[_0xe26f('0x1f')]=qs[_0xe26f('0x1f')](_0x2d7b4c[_0xe26f('0x34')][_0xe26f('0x1f')]);}_0xd8796d[_0xe26f('0x3e')]=qs[_0xe26f('0x3f')](_0x2d7b4c[_0xe26f('0x34')][_0xe26f('0x3f')]);_0xd8796d[_0xe26f('0x40')]=qs[_0xe26f('0x35')](_['pick'](_0x2d7b4c[_0xe26f('0x34')],_0x1bfcf0[_0xe26f('0x35')]),_0x2cdd53);if(_0x2d7b4c['query']['filter']){_0xd8796d['where']=_[_0xe26f('0x41')](_0xd8796d[_0xe26f('0x40')],{'$or':_[_0xe26f('0x2e')](_0x2cdd53,function(_0x3af2cc){if(_0x3af2cc[_0xe26f('0x31')]!==_0xe26f('0x42')){var _0x85625b={};_0x85625b[_0x3af2cc[_0xe26f('0x33')]]={'$like':'%'+_0x2d7b4c[_0xe26f('0x34')][_0xe26f('0x43')]+'%'};return _0x85625b;}})});}_0xd8796d=_[_0xe26f('0x41')]({},_0xd8796d,_0x2d7b4c[_0xe26f('0x44')]);var _0x15a6c8={'where':_0xd8796d['where']};return db[_0xe26f('0x2f')][_0xe26f('0x21')](_0x15a6c8)[_0xe26f('0x27')](function(_0x23a6a7){_0x17c656[_0xe26f('0x21')]=_0x23a6a7;if(_0x2d7b4c[_0xe26f('0x34')]['includeAll']){_0xd8796d['include']=[{'all':!![]}];}return db[_0xe26f('0x2f')]['findAll'](_0xd8796d);})[_0xe26f('0x27')](function(_0x1f8859){_0x17c656[_0xe26f('0x45')]=_0x1f8859;return _0x17c656;})['then'](respondWithFilteredResult(_0x2eb38b,_0xd8796d))[_0xe26f('0x46')](handleError(_0x2eb38b,null));};exports['show']=function(_0x10b3ab,_0xe72455){var _0x27ee6a={'raw':!![],'where':{'id':_0x10b3ab['params']['id']}},_0x32c08c={};_0x32c08c['model']=_[_0xe26f('0x47')](db[_0xe26f('0x2f')][_0xe26f('0x48')]);_0x32c08c[_0xe26f('0x34')]=_['keys'](_0x10b3ab[_0xe26f('0x34')]);_0x32c08c[_0xe26f('0x35')]=_['intersection'](_0x32c08c[_0xe26f('0x38')],_0x32c08c[_0xe26f('0x34')]);_0x27ee6a[_0xe26f('0x37')]=_['intersection'](_0x32c08c[_0xe26f('0x38')],qs[_0xe26f('0x39')](_0x10b3ab[_0xe26f('0x34')][_0xe26f('0x39')]));_0x27ee6a[_0xe26f('0x37')]=_0x27ee6a['attributes'][_0xe26f('0x3a')]?_0x27ee6a[_0xe26f('0x37')]:_0x32c08c[_0xe26f('0x38')];if(_0x10b3ab['query'][_0xe26f('0x49')]){_0x27ee6a['include']=[{'all':!![]}];}_0x27ee6a=_[_0xe26f('0x41')]({},_0x27ee6a,_0x10b3ab['options']);return db[_0xe26f('0x2f')][_0xe26f('0x4a')](_0x27ee6a)[_0xe26f('0x27')](handleEntityNotFound(_0xe72455,null))['then'](respondWithResult(_0xe72455,null))[_0xe26f('0x46')](handleError(_0xe72455,null));};exports['create']=function(_0x1d0a76,_0x4289db){return db[_0xe26f('0x2f')]['create'](_0x1d0a76['body'],{})[_0xe26f('0x27')](function(_0x54c3bb){var _0x3af0fd=_0x1d0a76[_0xe26f('0x4b')][_0xe26f('0x4c')]({'plain':!![]});if(!_0x3af0fd)throw new Error(_0xe26f('0x4d'));if(_0x3af0fd[_0xe26f('0x4e')]==='user'){var _0x173a5f=_0x54c3bb['get']({'plain':!![]});var _0x6b324e=_0xe26f('0x29');return db['UserProfileSection'][_0xe26f('0x4a')]({'where':{'name':_0x6b324e,'userProfileId':_0x3af0fd['userProfileId']},'raw':!![]})['then'](function(_0x438acb){if(_0x438acb&&_0x438acb[_0xe26f('0x4f')]===0x0){return db[_0xe26f('0x2a')][_0xe26f('0x50')]({'name':_0x173a5f[_0xe26f('0x33')],'resourceId':_0x173a5f['id'],'type':_0x438acb[_0xe26f('0x33')],'sectionId':_0x438acb['id']},{})[_0xe26f('0x27')](function(){return _0x54c3bb;});}else{return _0x54c3bb;}})[_0xe26f('0x46')](function(_0x4dc300){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4dc300);throw _0x4dc300;});}return _0x54c3bb;})['then'](respondWithResult(_0x4289db,0xc9))[_0xe26f('0x46')](handleError(_0x4289db,null));};exports['update']=function(_0x342703,_0x3a715f){if(_0x342703[_0xe26f('0x51')]['id']){delete _0x342703[_0xe26f('0x51')]['id'];}return db[_0xe26f('0x2f')][_0xe26f('0x4a')]({'where':{'id':_0x342703[_0xe26f('0x52')]['id']}})[_0xe26f('0x27')](handleEntityNotFound(_0x3a715f,null))[_0xe26f('0x27')](saveUpdates(_0x342703[_0xe26f('0x51')],null))[_0xe26f('0x27')](respondWithResult(_0x3a715f,null))[_0xe26f('0x46')](handleError(_0x3a715f,null));};exports['destroy']=function(_0x54d859,_0x11b729){return db['FaxQueue'][_0xe26f('0x4a')]({'where':{'id':_0x54d859[_0xe26f('0x52')]['id']}})[_0xe26f('0x27')](handleEntityNotFound(_0x11b729,null))[_0xe26f('0x27')](removeEntity(_0x11b729,null))['catch'](handleError(_0x11b729,null));};exports[_0xe26f('0x53')]=function(_0x25f000,_0x2e31df){return db['FaxQueue']['describe']()[_0xe26f('0x27')](respondWithResult(_0x2e31df,null))[_0xe26f('0x46')](handleError(_0x2e31df,null));};exports[_0xe26f('0x54')]=function(_0x204e36,_0x20bfe3,_0x47abdf){var _0x3aba63={'raw':!![],'where':{}},_0x9b273b={},_0x329191;return db['FaxQueue'][_0xe26f('0x55')]({'where':{'id':_0x204e36[_0xe26f('0x52')]['id']}})[_0xe26f('0x27')](handleEntityNotFound(_0x20bfe3,null))[_0xe26f('0x27')](function(_0x8198b){if(_0x8198b){_0x329191=_0x8198b[_0xe26f('0x4c')]({'plain':!![]});_0x9b273b[_0xe26f('0x38')]=_[_0xe26f('0x47')](db[_0xe26f('0x56')]['rawAttributes']);_0x9b273b[_0xe26f('0x34')]=_[_0xe26f('0x47')](_0x204e36[_0xe26f('0x34')]);_0x9b273b[_0xe26f('0x35')]=_[_0xe26f('0x36')](_0x9b273b[_0xe26f('0x38')],_0x9b273b[_0xe26f('0x34')]);_0x3aba63[_0xe26f('0x37')]=_['intersection'](_0x9b273b[_0xe26f('0x38')],qs[_0xe26f('0x39')](_0x204e36['query']['fields']));_0x3aba63[_0xe26f('0x37')]=_0x3aba63[_0xe26f('0x37')][_0xe26f('0x3a')]?_0x3aba63[_0xe26f('0x37')]:_0x9b273b[_0xe26f('0x38')];if(!_0x204e36[_0xe26f('0x34')][_0xe26f('0x3b')](_0xe26f('0x3c'))){_0x3aba63[_0xe26f('0x3d')]=qs['limit'](_0x204e36['query'][_0xe26f('0x3d')]);_0x3aba63[_0xe26f('0x1f')]=qs[_0xe26f('0x1f')](_0x204e36['query'][_0xe26f('0x1f')]);}_0x3aba63['order']=qs['sort'](_0x204e36['query'][_0xe26f('0x3f')]);_0x3aba63['where']=qs[_0xe26f('0x35')](_[_0xe26f('0x57')](_0x204e36[_0xe26f('0x34')],_0x9b273b['filters']));_0x3aba63['where']['FaxQueueId']=_0x8198b['id'];if(_0x204e36['query']['filter']){_0x3aba63[_0xe26f('0x40')]=_['merge'](_0x3aba63[_0xe26f('0x40')],{'$or':_[_0xe26f('0x2e')](_0x3aba63[_0xe26f('0x37')],function(_0x3828bf){var _0x26d292={};_0x26d292[_0x3828bf]={'$like':'%'+_0x204e36[_0xe26f('0x34')][_0xe26f('0x43')]+'%'};return _0x26d292;})});}_0x3aba63=_['merge']({},_0x3aba63,_0x204e36['options']);return db[_0xe26f('0x56')][_0xe26f('0x58')](_0x3aba63);}})[_0xe26f('0x27')](function(_0x5552ed){if(_0x5552ed){return db[_0xe26f('0x59')][_0xe26f('0x5a')]({'where':{'id':_[_0xe26f('0x2e')](_0x5552ed,_0xe26f('0x5b')),'role':'agent'},'attributes':['id',_0xe26f('0x33'),_0xe26f('0x5c'),'updatedAt','createdAt']});}})[_0xe26f('0x27')](function(_0x58e488){if(_0x58e488){return{'count':_0x58e488[_0xe26f('0x21')],'rows':_[_0xe26f('0x2e')](_0x58e488['rows'],function(_0x3fd2ae){return{'membername':_0x3fd2ae[_0xe26f('0x33')],'UserId':_0x3fd2ae['id'],'queue_name':_0x329191[_0xe26f('0x33')],'FaxQueueId':_0x329191['id'],'interface':util[_0xe26f('0x5d')](_0xe26f('0x5e'),_0xe26f('0x5f'),_0x3fd2ae[_0xe26f('0x33')]),'penalty':0x0,'paused':_0x3fd2ae[_0xe26f('0x5c')],'createdAt':_0x3fd2ae[_0xe26f('0x60')],'updatedAt':_0x3fd2ae[_0xe26f('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe26f('0x27')](respondWithFilteredResult(_0x20bfe3,_0x3aba63))[_0xe26f('0x46')](handleError(_0x20bfe3,null));};exports[_0xe26f('0x62')]=function(_0x37c72b,_0x235ac5,_0x18d086){var _0x593efa={};var _0x11e527={};var _0x3b8765;var _0x4ca7c0;return db[_0xe26f('0x2f')][_0xe26f('0x55')]({'where':{'id':_0x37c72b[_0xe26f('0x52')]['id']}})[_0xe26f('0x27')](handleEntityNotFound(_0x235ac5,null))[_0xe26f('0x27')](function(_0x495399){if(_0x495399){_0x3b8765=_0x495399;_0x11e527[_0xe26f('0x38')]=_[_0xe26f('0x47')](db[_0xe26f('0x63')][_0xe26f('0x48')]);_0x11e527[_0xe26f('0x34')]=_[_0xe26f('0x47')](_0x37c72b[_0xe26f('0x34')]);_0x11e527[_0xe26f('0x35')]=_[_0xe26f('0x36')](_0x11e527['model'],_0x11e527['query']);_0x593efa[_0xe26f('0x37')]=_[_0xe26f('0x36')](_0x11e527[_0xe26f('0x38')],qs['fields'](_0x37c72b['query'][_0xe26f('0x39')]));_0x593efa[_0xe26f('0x37')]=_0x593efa[_0xe26f('0x37')]['length']?_0x593efa[_0xe26f('0x37')]:_0x11e527['model'];_0x593efa['order']=qs[_0xe26f('0x3f')](_0x37c72b[_0xe26f('0x34')][_0xe26f('0x3f')]);_0x593efa[_0xe26f('0x40')]=qs[_0xe26f('0x35')](_[_0xe26f('0x57')](_0x37c72b['query'],_0x11e527[_0xe26f('0x35')]));if(_0x37c72b['query'][_0xe26f('0x43')]){_0x593efa['where']=_[_0xe26f('0x41')](_0x593efa[_0xe26f('0x40')],{'$or':_['map'](_0x593efa[_0xe26f('0x37')],function(_0xbf9485){var _0x12e19b={};_0x12e19b[_0xbf9485]={'$like':'%'+_0x37c72b['query'][_0xe26f('0x43')]+'%'};return _0x12e19b;})});}_0x593efa=_['merge']({},_0x593efa,_0x37c72b[_0xe26f('0x44')]);return _0x3b8765['getTeams'](_0x593efa);}})[_0xe26f('0x27')](function(_0x9b8305){if(_0x9b8305){_0x4ca7c0=_0x9b8305[_0xe26f('0x3a')];if(!_0x37c72b[_0xe26f('0x34')][_0xe26f('0x3b')](_0xe26f('0x3c'))){_0x593efa[_0xe26f('0x3d')]=qs[_0xe26f('0x3d')](_0x37c72b[_0xe26f('0x34')][_0xe26f('0x3d')]);_0x593efa['offset']=qs[_0xe26f('0x1f')](_0x37c72b[_0xe26f('0x34')][_0xe26f('0x1f')]);}return _0x3b8765[_0xe26f('0x62')](_0x593efa);}})['then'](function(_0x3d3530){if(_0x3d3530){return _0x3d3530?{'count':_0x4ca7c0,'rows':_0x3d3530}:null;}})[_0xe26f('0x27')](respondWithResult(_0x235ac5,null))[_0xe26f('0x46')](handleError(_0x235ac5,null));};exports['addTeams']=function(_0x26f6ad,_0x2d9a62,_0xa26f5f){var _0x301f23=_0x26f6ad[_0xe26f('0x51')][_0xe26f('0x64')];return db[_0xe26f('0x63')][_0xe26f('0x58')]({'where':{'id':_0x301f23},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe26f('0x65'),'attributes':['id',_0xe26f('0x33'),_0xe26f('0x66'),_0xe26f('0x67'),_0xe26f('0x68')],'raw':!![]}]})[_0xe26f('0x27')](function(_0x18fad1){if(_0x18fad1){var _0x17844d=_[_0xe26f('0x69')](_0x18fad1,function(_0x24270f){var _0x41e814=_0x24270f[_0xe26f('0x4c')]({'plain':!![]});return _0x41e814[_0xe26f('0x65')];});return db[_0xe26f('0x2f')][_0xe26f('0x4a')]({'where':{'id':_0x26f6ad[_0xe26f('0x52')]['id']}})[_0xe26f('0x27')](function(_0xcc5673){return db[_0xe26f('0x6a')][_0xe26f('0x6b')](function(_0xddf859){return _0xcc5673[_0xe26f('0x6c')](_0x301f23,{'transaction':_0xddf859})['then'](function(){return BPromise[_0xe26f('0x6d')](_0x17844d,function(_0x3b8585){return db[_0xe26f('0x56')][_0xe26f('0x6e')]({'where':{'UserId':_0x3b8585['id'],'FaxQueueId':_0x26f6ad[_0xe26f('0x52')]['id']},'transaction':_0xddf859});});})[_0xe26f('0x27')](function(){_0x17844d[_0xe26f('0x6f')](function(_0x2b556f){socket[_0xe26f('0x70')](_0xe26f('0x71'),{'UserId':_0x2b556f['id'],'FaxQueueId':_0xcc5673['id']});});});});});}})['then'](respondWithStatusCode(_0x2d9a62,null))['catch'](handleError(_0x2d9a62,null));};exports['removeTeams']=function(_0x32ae37,_0x20aae3,_0x2a0c62){return db[_0xe26f('0x63')][_0xe26f('0x58')]({'where':{'id':_0x32ae37[_0xe26f('0x34')][_0xe26f('0x64')]},'attributes':['id'],'include':[{'model':db[_0xe26f('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x20aae3,null))[_0xe26f('0x27')](function(_0x12c2e9){var _0x19ca69=_['map'](_0x12c2e9,'id');var _0x5a59e3=[];var _0xc0cf86=[];var _0x1d4598=squel['select']();_0x1d4598[_0xe26f('0x72')]('tq.TeamId')['from'](_0xe26f('0x73'),'tq')[_0xe26f('0x74')](_0xe26f('0x75'),'ut',_0xe26f('0x76'))['where']('FaxQueueId\x20=\x20?',_0x32ae37[_0xe26f('0x52')]['id']);for(var _0x72ac12=0x0;_0x72ac12<_0x12c2e9[_0xe26f('0x3a')];_0x72ac12+=0x1){let _0x5496c0=_0x12c2e9[_0x72ac12];for(var _0x8f1e7=0x0;_0x8f1e7<_0x5496c0[_0xe26f('0x65')]['length'];_0x8f1e7+=0x1){let _0xb5a031=_0x5496c0['Agents'][_0x8f1e7];var _0xdc0a0f=_0x1d4598[_0xe26f('0x77')]();_0xdc0a0f[_0xe26f('0x40')](_0xe26f('0x78'),_0xb5a031['id']);_0xc0cf86['push'](db[_0xe26f('0x6a')][_0xe26f('0x34')](_0xdc0a0f['toString'](),{'type':db[_0xe26f('0x6a')][_0xe26f('0x79')][_0xe26f('0x7a')]})[_0xe26f('0x27')](function(_0x377aef){if(_0x377aef[_0xe26f('0x3a')]===0x1){return _0xb5a031['id'];}else{var _0x23e975=_['every'](_[_0xe26f('0x2e')](_0x377aef,_0xe26f('0x7b')),function(_0x205e1b){return _[_0xe26f('0x7c')](_0x19ca69,_0x205e1b);});if(_0x23e975){return _0xb5a031['id'];}}}));}}return BPromise[_0xe26f('0x7d')](_0xc0cf86)['then'](function(_0xe24cdd){_0x5a59e3=_(_0x5a59e3)[_0xe26f('0x7e')](_0xe24cdd)[_0xe26f('0x7f')]()[_0xe26f('0x80')]();return db[_0xe26f('0x2f')][_0xe26f('0x4a')]({'where':{'id':_0x32ae37[_0xe26f('0x52')]['id']}})[_0xe26f('0x27')](function(_0xefabaf){return db[_0xe26f('0x6a')][_0xe26f('0x6b')](function(_0x556830){return _0xefabaf[_0xe26f('0x81')](_0x32ae37['query']['ids'],{'transaction':_0x556830})['then'](function(){if(!_[_0xe26f('0x82')](_0x5a59e3)){return _0xefabaf['removeAgents'](_0x5a59e3,{'transaction':_0x556830});}})['then'](function(){_0x5a59e3[_0xe26f('0x6f')](function(_0x265bf7){socket['emit'](_0xe26f('0x83'),{'UserId':_0x265bf7,'FaxQueueId':_0xefabaf['id']});});});});});});})[_0xe26f('0x27')](respondWithStatusCode(_0x20aae3,null))['catch'](handleError(_0x20aae3,null));};exports[_0xe26f('0x84')]=function(_0x489e91,_0x3dffb7,_0x3460f2){return db[_0xe26f('0x2f')][_0xe26f('0x4a')]({'where':{'id':_0x489e91[_0xe26f('0x52')]['id']}})[_0xe26f('0x27')](handleEntityNotFound(_0x3dffb7,null))[_0xe26f('0x27')](function(_0x13d2dd){if(_0x13d2dd){return _0x13d2dd[_0xe26f('0x84')](_0x489e91[_0xe26f('0x51')][_0xe26f('0x64')],_[_0xe26f('0x85')](_0x489e91[_0xe26f('0x51')],[_0xe26f('0x64'),'id'])||{})[_0xe26f('0x86')](function(_0x5b42e2){for(var _0x8550e0=0x0;_0x8550e0<_0x489e91['body']['ids'][_0xe26f('0x3a')];_0x8550e0+=0x1){socket[_0xe26f('0x70')](_0xe26f('0x71'),{'UserId':Number(_0x489e91[_0xe26f('0x51')][_0xe26f('0x64')][_0x8550e0]),'FaxQueueId':Number(_0x489e91['params']['id'])});}return _0x5b42e2;});}})['then'](respondWithResult(_0x3dffb7,null))[_0xe26f('0x46')](handleError(_0x3dffb7,null));};exports[_0xe26f('0x87')]=function(_0x550666,_0x44a3c7,_0x3dae41){return db[_0xe26f('0x2f')][_0xe26f('0x4a')]({'where':{'id':_0x550666['params']['id']}})[_0xe26f('0x27')](handleEntityNotFound(_0x44a3c7,null))[_0xe26f('0x27')](function(_0x37cead){if(_0x37cead){return _0x37cead['removeAgents'](_0x550666[_0xe26f('0x34')][_0xe26f('0x64')])[_0xe26f('0x27')](function(){if(_[_0xe26f('0x88')](_0x550666['query'][_0xe26f('0x64')])){for(var _0x13af77=0x0;_0x13af77<_0x550666[_0xe26f('0x34')][_0xe26f('0x64')][_0xe26f('0x3a')];_0x13af77+=0x1){socket['emit'](_0xe26f('0x83'),{'UserId':Number(_0x550666[_0xe26f('0x34')]['ids'][_0x13af77]),'FaxQueueId':Number(_0x550666['params']['id'])});}}else{socket[_0xe26f('0x70')](_0xe26f('0x83'),{'UserId':Number(_0x550666[_0xe26f('0x34')][_0xe26f('0x64')]),'FaxQueueId':Number(_0x550666[_0xe26f('0x52')]['id'])});}});}})[_0xe26f('0x27')](respondWithStatusCode(_0x44a3c7,null))[_0xe26f('0x46')](handleError(_0x44a3c7,null));};exports[_0xe26f('0x89')]=function(_0x1d1586,_0x60e8bc,_0x698e6d){var _0x68b19e={};var _0x56d2fd={};var _0x37deed;var _0x337031;return db[_0xe26f('0x2f')]['findOne']({'where':{'id':_0x1d1586[_0xe26f('0x52')]['id']}})[_0xe26f('0x27')](handleEntityNotFound(_0x60e8bc,null))[_0xe26f('0x27')](function(_0x36a58a){if(_0x36a58a){_0x37deed=_0x36a58a;_0x56d2fd[_0xe26f('0x38')]=_[_0xe26f('0x47')](db['User'][_0xe26f('0x48')]);_0x56d2fd['query']=_[_0xe26f('0x47')](_0x1d1586[_0xe26f('0x34')]);_0x56d2fd[_0xe26f('0x35')]=_[_0xe26f('0x36')](_0x56d2fd[_0xe26f('0x38')],_0x56d2fd['query']);_0x68b19e[_0xe26f('0x37')]=_[_0xe26f('0x36')](_0x56d2fd[_0xe26f('0x38')],qs[_0xe26f('0x39')](_0x1d1586['query']['fields']));_0x68b19e[_0xe26f('0x37')]=_0x68b19e[_0xe26f('0x37')][_0xe26f('0x3a')]?_0x68b19e[_0xe26f('0x37')]:_0x56d2fd[_0xe26f('0x38')];_0x68b19e[_0xe26f('0x3e')]=qs[_0xe26f('0x3f')](_0x1d1586['query'][_0xe26f('0x3f')]);_0x68b19e[_0xe26f('0x40')]=qs['filters'](_['pick'](_0x1d1586[_0xe26f('0x34')],_0x56d2fd[_0xe26f('0x35')]));if(_0x1d1586[_0xe26f('0x34')]['filter']){_0x68b19e[_0xe26f('0x40')]=_['merge'](_0x68b19e['where'],{'$or':_[_0xe26f('0x2e')](_0x68b19e['attributes'],function(_0x510673){var _0x22cb4f={};_0x22cb4f[_0x510673]={'$like':'%'+_0x1d1586[_0xe26f('0x34')][_0xe26f('0x43')]+'%'};return _0x22cb4f;})});}_0x68b19e=_[_0xe26f('0x41')]({},_0x68b19e,_0x1d1586[_0xe26f('0x44')]);return _0x37deed[_0xe26f('0x89')](_0x68b19e);}})[_0xe26f('0x27')](function(_0x5c6cce){if(_0x5c6cce){_0x337031=_0x5c6cce[_0xe26f('0x3a')];if(!_0x1d1586[_0xe26f('0x34')][_0xe26f('0x3b')](_0xe26f('0x3c'))){_0x68b19e[_0xe26f('0x3d')]=qs[_0xe26f('0x3d')](_0x1d1586[_0xe26f('0x34')][_0xe26f('0x3d')]);_0x68b19e[_0xe26f('0x1f')]=qs['offset'](_0x1d1586[_0xe26f('0x34')][_0xe26f('0x1f')]);}return _0x37deed[_0xe26f('0x89')](_0x68b19e);}})['then'](function(_0x44b2f6){if(_0x44b2f6){return _0x44b2f6?{'count':_0x337031,'rows':_0x44b2f6}:null;}})['then'](respondWithResult(_0x60e8bc,null))[_0xe26f('0x46')](handleError(_0x60e8bc,null));};
\ No newline at end of file
+var _0xa4e8=['user_has_teams','ut.TeamId\x20=\x20tq.TeamId','push','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','reject','update','then','FaxQueues','UserProfileResource','destroy','end','error','stack','name','send','index','FaxQueue','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','role','UserProfileSection','autoAssociation','describe','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','from','join'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa4e8,0x12d));var _0x8a4e=function(_0x22924d,_0x59e3a4){_0x22924d=_0x22924d-0x0;var _0x4f86d6=_0xa4e8[_0x22924d];return _0x4f86d6;};'use strict';var emlformat=require(_0x8a4e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a4e('0x1'));var jsonpatch=require(_0x8a4e('0x2'));var rp=require(_0x8a4e('0x3'));var moment=require('moment');var BPromise=require(_0x8a4e('0x4'));var Mustache=require(_0x8a4e('0x5'));var util=require(_0x8a4e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x8a4e('0x7'));var ejs=require(_0x8a4e('0x8'));var fs=require('fs');var fs_extra=require(_0x8a4e('0x9'));var _=require(_0x8a4e('0xa'));var squel=require(_0x8a4e('0xb'));var crypto=require('crypto');var jsforce=require(_0x8a4e('0xc'));var deskjs=require(_0x8a4e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8a4e('0xe'));var Redis=require('ioredis');var authService=require(_0x8a4e('0xf'));var qs=require(_0x8a4e('0x10'));var as=require(_0x8a4e('0x11'));var hardwareService=require(_0x8a4e('0x12'));var logger=require('../../config/logger')(_0x8a4e('0x13'));var utils=require(_0x8a4e('0x14'));var config=require(_0x8a4e('0x15'));var licenseUtil=require(_0x8a4e('0x16'));var db=require(_0x8a4e('0x17'))['db'];config['redis']=_[_0x8a4e('0x18')](config[_0x8a4e('0x19')],{'host':_0x8a4e('0x1a'),'port':0x18eb});var socket=require(_0x8a4e('0x1b'))(new Redis(config[_0x8a4e('0x19')]));require(_0x8a4e('0x1c'))[_0x8a4e('0x1d')](socket);function respondWithStatusCode(_0x38cecd,_0xea8b4f){_0xea8b4f=_0xea8b4f||0xcc;return function(_0x1b759b){if(_0x1b759b){return _0x38cecd[_0x8a4e('0x1e')](_0xea8b4f);}return _0x38cecd[_0x8a4e('0x1f')](_0xea8b4f)['end']();};}function respondWithResult(_0x1558b6,_0x220e11){_0x220e11=_0x220e11||0xc8;return function(_0x45894c){if(_0x45894c){return _0x1558b6[_0x8a4e('0x1f')](_0x220e11)[_0x8a4e('0x20')](_0x45894c);}};}function respondWithFilteredResult(_0xeb4219,_0x3932f0){return function(_0x59d6d9){if(_0x59d6d9){var _0x2c3067=typeof _0x3932f0['offset']===_0x8a4e('0x21')&&typeof _0x3932f0[_0x8a4e('0x22')]===_0x8a4e('0x21');var _0xda92d7=_0x59d6d9[_0x8a4e('0x23')];var _0x4725d7=_0x2c3067?0x0:_0x3932f0['offset'];var _0x201761=_0x2c3067?_0x59d6d9['count']:_0x3932f0[_0x8a4e('0x24')]+_0x3932f0[_0x8a4e('0x22')];var _0x4a1190;if(_0x201761>=_0xda92d7){_0x201761=_0xda92d7;_0x4a1190=0xc8;}else{_0x4a1190=0xce;}_0xeb4219[_0x8a4e('0x1f')](_0x4a1190);return _0xeb4219['set']('Content-Range',_0x4725d7+'-'+_0x201761+'/'+_0xda92d7)[_0x8a4e('0x20')](_0x59d6d9);}return null;};}function patchUpdates(_0x5716e4){return function(_0x145305){try{jsonpatch['apply'](_0x145305,_0x5716e4,!![]);}catch(_0x25e8b7){return BPromise[_0x8a4e('0x25')](_0x25e8b7);}return _0x145305['save']();};}function saveUpdates(_0x35a00e,_0x196c87){return function(_0xb776a4){if(_0xb776a4){return _0xb776a4[_0x8a4e('0x26')](_0x35a00e)[_0x8a4e('0x27')](function(_0x559e78){return _0x559e78;});}return null;};}function removeEntity(_0x4d36aa,_0x10ae7e){return function(_0x4eb393){if(_0x4eb393){return _0x4eb393['destroy']()[_0x8a4e('0x27')](function(){var _0xfba397=_0x4eb393['get']({'plain':!![]});var _0x5dfb00=_0x8a4e('0x28');return db[_0x8a4e('0x29')][_0x8a4e('0x2a')]({'where':{'type':_0x5dfb00,'resourceId':_0xfba397['id']}})['then'](function(){return _0x4eb393;});})['then'](function(){_0x4d36aa[_0x8a4e('0x1f')](0xcc)[_0x8a4e('0x2b')]();});}};}function handleEntityNotFound(_0xf2f0b3,_0x460cb3){return function(_0x58bf5b){if(!_0x58bf5b){_0xf2f0b3['sendStatus'](0x194);}return _0x58bf5b;};}function handleError(_0x5b9dd1,_0x3d6316){_0x3d6316=_0x3d6316||0x1f4;return function(_0xa1c127){logger[_0x8a4e('0x2c')](_0xa1c127[_0x8a4e('0x2d')]);if(_0xa1c127[_0x8a4e('0x2e')]){delete _0xa1c127[_0x8a4e('0x2e')];}_0x5b9dd1['status'](_0x3d6316)[_0x8a4e('0x2f')](_0xa1c127);};}exports[_0x8a4e('0x30')]=function(_0x4af39b,_0xd06b77){var _0x3fc179={},_0x3bb874={},_0x3fc413={'count':0x0,'rows':[]};var _0xcf2358=_['map'](db[_0x8a4e('0x31')]['rawAttributes'],function(_0x3d8830){return{'name':_0x3d8830[_0x8a4e('0x32')],'type':_0x3d8830[_0x8a4e('0x33')]['key']};});_0x3bb874['model']=_[_0x8a4e('0x34')](_0xcf2358,_0x8a4e('0x2e'));_0x3bb874[_0x8a4e('0x35')]=_[_0x8a4e('0x36')](_0x4af39b[_0x8a4e('0x35')]);_0x3bb874[_0x8a4e('0x37')]=_[_0x8a4e('0x38')](_0x3bb874[_0x8a4e('0x39')],_0x3bb874[_0x8a4e('0x35')]);_0x3fc179[_0x8a4e('0x3a')]=_[_0x8a4e('0x38')](_0x3bb874[_0x8a4e('0x39')],qs[_0x8a4e('0x3b')](_0x4af39b[_0x8a4e('0x35')][_0x8a4e('0x3b')]));_0x3fc179[_0x8a4e('0x3a')]=_0x3fc179[_0x8a4e('0x3a')][_0x8a4e('0x3c')]?_0x3fc179['attributes']:_0x3bb874['model'];if(!_0x4af39b['query'][_0x8a4e('0x3d')](_0x8a4e('0x3e'))){_0x3fc179[_0x8a4e('0x22')]=qs['limit'](_0x4af39b[_0x8a4e('0x35')][_0x8a4e('0x22')]);_0x3fc179[_0x8a4e('0x24')]=qs[_0x8a4e('0x24')](_0x4af39b[_0x8a4e('0x35')][_0x8a4e('0x24')]);}_0x3fc179[_0x8a4e('0x3f')]=qs[_0x8a4e('0x40')](_0x4af39b['query'][_0x8a4e('0x40')]);_0x3fc179[_0x8a4e('0x41')]=qs[_0x8a4e('0x37')](_[_0x8a4e('0x42')](_0x4af39b[_0x8a4e('0x35')],_0x3bb874[_0x8a4e('0x37')]),_0xcf2358);if(_0x4af39b['query'][_0x8a4e('0x43')]){_0x3fc179['where']=_[_0x8a4e('0x44')](_0x3fc179['where'],{'$or':_[_0x8a4e('0x34')](_0xcf2358,function(_0x32d9f6){if(_0x32d9f6[_0x8a4e('0x33')]!=='VIRTUAL'){var _0x2bd74a={};_0x2bd74a[_0x32d9f6[_0x8a4e('0x2e')]]={'$like':'%'+_0x4af39b[_0x8a4e('0x35')][_0x8a4e('0x43')]+'%'};return _0x2bd74a;}})});}_0x3fc179=_['merge']({},_0x3fc179,_0x4af39b[_0x8a4e('0x45')]);var _0x2133d7={'where':_0x3fc179[_0x8a4e('0x41')]};return db[_0x8a4e('0x31')]['count'](_0x2133d7)['then'](function(_0x4b954b){_0x3fc413['count']=_0x4b954b;if(_0x4af39b[_0x8a4e('0x35')][_0x8a4e('0x46')]){_0x3fc179[_0x8a4e('0x47')]=[{'all':!![]}];}return db[_0x8a4e('0x31')][_0x8a4e('0x48')](_0x3fc179);})['then'](function(_0x2cddd8){_0x3fc413[_0x8a4e('0x49')]=_0x2cddd8;return _0x3fc413;})[_0x8a4e('0x27')](respondWithFilteredResult(_0xd06b77,_0x3fc179))[_0x8a4e('0x4a')](handleError(_0xd06b77,null));};exports[_0x8a4e('0x4b')]=function(_0x398c0b,_0x285009){var _0x16efbb={'raw':!![],'where':{'id':_0x398c0b[_0x8a4e('0x4c')]['id']}},_0x496cda={};_0x496cda[_0x8a4e('0x39')]=_[_0x8a4e('0x36')](db[_0x8a4e('0x31')][_0x8a4e('0x4d')]);_0x496cda[_0x8a4e('0x35')]=_['keys'](_0x398c0b[_0x8a4e('0x35')]);_0x496cda[_0x8a4e('0x37')]=_['intersection'](_0x496cda[_0x8a4e('0x39')],_0x496cda[_0x8a4e('0x35')]);_0x16efbb[_0x8a4e('0x3a')]=_['intersection'](_0x496cda[_0x8a4e('0x39')],qs[_0x8a4e('0x3b')](_0x398c0b['query'][_0x8a4e('0x3b')]));_0x16efbb[_0x8a4e('0x3a')]=_0x16efbb[_0x8a4e('0x3a')][_0x8a4e('0x3c')]?_0x16efbb[_0x8a4e('0x3a')]:_0x496cda[_0x8a4e('0x39')];if(_0x398c0b[_0x8a4e('0x35')][_0x8a4e('0x46')]){_0x16efbb['include']=[{'all':!![]}];}_0x16efbb=_[_0x8a4e('0x44')]({},_0x16efbb,_0x398c0b[_0x8a4e('0x45')]);return db[_0x8a4e('0x31')][_0x8a4e('0x4e')](_0x16efbb)[_0x8a4e('0x27')](handleEntityNotFound(_0x285009,null))[_0x8a4e('0x27')](respondWithResult(_0x285009,null))[_0x8a4e('0x4a')](handleError(_0x285009,null));};exports[_0x8a4e('0x4f')]=function(_0x42c835,_0x453c70){return db[_0x8a4e('0x31')][_0x8a4e('0x4f')](_0x42c835[_0x8a4e('0x50')],{})[_0x8a4e('0x27')](function(_0x6a76cd){var _0x1ea489=_0x42c835[_0x8a4e('0x51')][_0x8a4e('0x52')]({'plain':!![]});if(!_0x1ea489)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ea489[_0x8a4e('0x53')]===_0x8a4e('0x51')){var _0x3195ab=_0x6a76cd[_0x8a4e('0x52')]({'plain':!![]});var _0x45b1cb=_0x8a4e('0x28');return db[_0x8a4e('0x54')]['find']({'where':{'name':_0x45b1cb,'userProfileId':_0x1ea489['userProfileId']},'raw':!![]})[_0x8a4e('0x27')](function(_0x2d9893){if(_0x2d9893&&_0x2d9893[_0x8a4e('0x55')]===0x0){return db[_0x8a4e('0x29')][_0x8a4e('0x4f')]({'name':_0x3195ab[_0x8a4e('0x2e')],'resourceId':_0x3195ab['id'],'type':_0x2d9893['name'],'sectionId':_0x2d9893['id']},{})['then'](function(){return _0x6a76cd;});}else{return _0x6a76cd;}})['catch'](function(_0x2f5737){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f5737);throw _0x2f5737;});}return _0x6a76cd;})[_0x8a4e('0x27')](respondWithResult(_0x453c70,0xc9))['catch'](handleError(_0x453c70,null));};exports[_0x8a4e('0x26')]=function(_0x40d023,_0x137ffb){if(_0x40d023['body']['id']){delete _0x40d023['body']['id'];}return db['FaxQueue']['find']({'where':{'id':_0x40d023[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x137ffb,null))[_0x8a4e('0x27')](saveUpdates(_0x40d023[_0x8a4e('0x50')],null))['then'](respondWithResult(_0x137ffb,null))[_0x8a4e('0x4a')](handleError(_0x137ffb,null));};exports[_0x8a4e('0x2a')]=function(_0x2dfba3,_0x104f77){return db[_0x8a4e('0x31')][_0x8a4e('0x4e')]({'where':{'id':_0x2dfba3['params']['id']}})['then'](handleEntityNotFound(_0x104f77,null))[_0x8a4e('0x27')](removeEntity(_0x104f77,null))[_0x8a4e('0x4a')](handleError(_0x104f77,null));};exports[_0x8a4e('0x56')]=function(_0x359997,_0x1b5a03){return db['FaxQueue'][_0x8a4e('0x56')]()['then'](respondWithResult(_0x1b5a03,null))[_0x8a4e('0x4a')](handleError(_0x1b5a03,null));};exports['getMembers']=function(_0x32a61c,_0x5abb5e,_0x4da87f){var _0x15a25a={'raw':!![],'where':{}},_0x27b6bb={},_0x11671f;return db['FaxQueue'][_0x8a4e('0x57')]({'where':{'id':_0x32a61c[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x5abb5e,null))['then'](function(_0x532292){if(_0x532292){_0x11671f=_0x532292[_0x8a4e('0x52')]({'plain':!![]});_0x27b6bb[_0x8a4e('0x39')]=_[_0x8a4e('0x36')](db[_0x8a4e('0x58')][_0x8a4e('0x4d')]);_0x27b6bb[_0x8a4e('0x35')]=_['keys'](_0x32a61c[_0x8a4e('0x35')]);_0x27b6bb[_0x8a4e('0x37')]=_['intersection'](_0x27b6bb[_0x8a4e('0x39')],_0x27b6bb['query']);_0x15a25a[_0x8a4e('0x3a')]=_[_0x8a4e('0x38')](_0x27b6bb['model'],qs[_0x8a4e('0x3b')](_0x32a61c['query'][_0x8a4e('0x3b')]));_0x15a25a['attributes']=_0x15a25a[_0x8a4e('0x3a')][_0x8a4e('0x3c')]?_0x15a25a['attributes']:_0x27b6bb[_0x8a4e('0x39')];if(!_0x32a61c[_0x8a4e('0x35')][_0x8a4e('0x3d')]('nolimit')){_0x15a25a['limit']=qs['limit'](_0x32a61c[_0x8a4e('0x35')]['limit']);_0x15a25a[_0x8a4e('0x24')]=qs[_0x8a4e('0x24')](_0x32a61c[_0x8a4e('0x35')][_0x8a4e('0x24')]);}_0x15a25a['order']=qs[_0x8a4e('0x40')](_0x32a61c[_0x8a4e('0x35')][_0x8a4e('0x40')]);_0x15a25a[_0x8a4e('0x41')]=qs[_0x8a4e('0x37')](_[_0x8a4e('0x42')](_0x32a61c[_0x8a4e('0x35')],_0x27b6bb[_0x8a4e('0x37')]));_0x15a25a[_0x8a4e('0x41')][_0x8a4e('0x59')]=_0x532292['id'];if(_0x32a61c[_0x8a4e('0x35')][_0x8a4e('0x43')]){_0x15a25a[_0x8a4e('0x41')]=_['merge'](_0x15a25a[_0x8a4e('0x41')],{'$or':_[_0x8a4e('0x34')](_0x15a25a[_0x8a4e('0x3a')],function(_0x578b71){var _0x6b5ca6={};_0x6b5ca6[_0x578b71]={'$like':'%'+_0x32a61c['query'][_0x8a4e('0x43')]+'%'};return _0x6b5ca6;})});}_0x15a25a=_[_0x8a4e('0x44')]({},_0x15a25a,_0x32a61c[_0x8a4e('0x45')]);return db[_0x8a4e('0x58')][_0x8a4e('0x48')](_0x15a25a);}})[_0x8a4e('0x27')](function(_0x114a34){if(_0x114a34){return db[_0x8a4e('0x5a')][_0x8a4e('0x5b')]({'where':{'id':_['map'](_0x114a34,_0x8a4e('0x5c')),'role':_0x8a4e('0x5d')},'attributes':['id',_0x8a4e('0x2e'),_0x8a4e('0x5e'),_0x8a4e('0x5f'),_0x8a4e('0x60')]});}})[_0x8a4e('0x27')](function(_0x389cc1){if(_0x389cc1){return{'count':_0x389cc1['count'],'rows':_[_0x8a4e('0x34')](_0x389cc1[_0x8a4e('0x49')],function(_0x14ff4d){return{'membername':_0x14ff4d[_0x8a4e('0x2e')],'UserId':_0x14ff4d['id'],'queue_name':_0x11671f[_0x8a4e('0x2e')],'FaxQueueId':_0x11671f['id'],'interface':util[_0x8a4e('0x61')](_0x8a4e('0x62'),_0x8a4e('0x63'),_0x14ff4d[_0x8a4e('0x2e')]),'penalty':0x0,'paused':_0x14ff4d[_0x8a4e('0x5e')],'createdAt':_0x14ff4d[_0x8a4e('0x60')],'updatedAt':_0x14ff4d[_0x8a4e('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8a4e('0x27')](respondWithFilteredResult(_0x5abb5e,_0x15a25a))[_0x8a4e('0x4a')](handleError(_0x5abb5e,null));};exports[_0x8a4e('0x64')]=function(_0x440b00,_0x238c61,_0x2c21bc){var _0x2e76ee={};var _0x2944ec={};var _0xcf89b0;var _0x4eb917;return db[_0x8a4e('0x31')][_0x8a4e('0x57')]({'where':{'id':_0x440b00[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x238c61,null))[_0x8a4e('0x27')](function(_0x5cabde){if(_0x5cabde){_0xcf89b0=_0x5cabde;_0x2944ec[_0x8a4e('0x39')]=_[_0x8a4e('0x36')](db[_0x8a4e('0x65')][_0x8a4e('0x4d')]);_0x2944ec[_0x8a4e('0x35')]=_[_0x8a4e('0x36')](_0x440b00[_0x8a4e('0x35')]);_0x2944ec[_0x8a4e('0x37')]=_[_0x8a4e('0x38')](_0x2944ec[_0x8a4e('0x39')],_0x2944ec[_0x8a4e('0x35')]);_0x2e76ee[_0x8a4e('0x3a')]=_[_0x8a4e('0x38')](_0x2944ec['model'],qs['fields'](_0x440b00[_0x8a4e('0x35')]['fields']));_0x2e76ee['attributes']=_0x2e76ee[_0x8a4e('0x3a')][_0x8a4e('0x3c')]?_0x2e76ee[_0x8a4e('0x3a')]:_0x2944ec[_0x8a4e('0x39')];_0x2e76ee[_0x8a4e('0x3f')]=qs[_0x8a4e('0x40')](_0x440b00[_0x8a4e('0x35')][_0x8a4e('0x40')]);_0x2e76ee['where']=qs['filters'](_[_0x8a4e('0x42')](_0x440b00[_0x8a4e('0x35')],_0x2944ec['filters']));if(_0x440b00['query'][_0x8a4e('0x43')]){_0x2e76ee[_0x8a4e('0x41')]=_[_0x8a4e('0x44')](_0x2e76ee['where'],{'$or':_[_0x8a4e('0x34')](_0x2e76ee['attributes'],function(_0xa7341){var _0x5b7ee7={};_0x5b7ee7[_0xa7341]={'$like':'%'+_0x440b00[_0x8a4e('0x35')]['filter']+'%'};return _0x5b7ee7;})});}_0x2e76ee=_[_0x8a4e('0x44')]({},_0x2e76ee,_0x440b00['options']);return _0xcf89b0['getTeams'](_0x2e76ee);}})[_0x8a4e('0x27')](function(_0x549bcf){if(_0x549bcf){_0x4eb917=_0x549bcf['length'];if(!_0x440b00[_0x8a4e('0x35')][_0x8a4e('0x3d')](_0x8a4e('0x3e'))){_0x2e76ee[_0x8a4e('0x22')]=qs[_0x8a4e('0x22')](_0x440b00[_0x8a4e('0x35')][_0x8a4e('0x22')]);_0x2e76ee['offset']=qs[_0x8a4e('0x24')](_0x440b00[_0x8a4e('0x35')][_0x8a4e('0x24')]);}return _0xcf89b0[_0x8a4e('0x64')](_0x2e76ee);}})['then'](function(_0x86dddd){if(_0x86dddd){return _0x86dddd?{'count':_0x4eb917,'rows':_0x86dddd}:null;}})[_0x8a4e('0x27')](respondWithResult(_0x238c61,null))[_0x8a4e('0x4a')](handleError(_0x238c61,null));};exports[_0x8a4e('0x66')]=function(_0x49e1bd,_0x4d26ed,_0x1f6d7d){var _0x527fdf=_0x49e1bd[_0x8a4e('0x50')][_0x8a4e('0x67')];return db[_0x8a4e('0x65')]['findAll']({'where':{'id':_0x527fdf},'attributes':['id'],'include':[{'model':db[_0x8a4e('0x5a')],'as':_0x8a4e('0x68'),'attributes':['id','name',_0x8a4e('0x69'),_0x8a4e('0x6a'),_0x8a4e('0x6b')],'raw':!![]}]})[_0x8a4e('0x27')](function(_0x83a559){if(_0x83a559){var _0x1fb656=_[_0x8a4e('0x6c')](_0x83a559,function(_0x41a808){var _0x4ffba4=_0x41a808[_0x8a4e('0x52')]({'plain':!![]});return _0x4ffba4[_0x8a4e('0x68')];});return db[_0x8a4e('0x31')][_0x8a4e('0x4e')]({'where':{'id':_0x49e1bd[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](function(_0x4ab411){return db['sequelize'][_0x8a4e('0x6d')](function(_0x3f76bb){return _0x4ab411['addTeams'](_0x527fdf,{'transaction':_0x3f76bb})[_0x8a4e('0x27')](function(){return BPromise[_0x8a4e('0x6e')](_0x1fb656,function(_0x6e566b){return db['UserFaxQueue'][_0x8a4e('0x6f')]({'where':{'UserId':_0x6e566b['id'],'FaxQueueId':_0x49e1bd['params']['id']},'transaction':_0x3f76bb});});})[_0x8a4e('0x27')](function(){_0x1fb656[_0x8a4e('0x70')](function(_0x148c60){socket[_0x8a4e('0x71')](_0x8a4e('0x72'),{'UserId':_0x148c60['id'],'FaxQueueId':_0x4ab411['id']});});});});});}})[_0x8a4e('0x27')](respondWithStatusCode(_0x4d26ed,null))[_0x8a4e('0x4a')](handleError(_0x4d26ed,null));};exports['removeTeams']=function(_0xcf7360,_0x5b7bd8,_0xf46837){return db[_0x8a4e('0x65')][_0x8a4e('0x48')]({'where':{'id':_0xcf7360['query'][_0x8a4e('0x67')]},'attributes':['id'],'include':[{'model':db[_0x8a4e('0x5a')],'as':_0x8a4e('0x68'),'attributes':['id'],'raw':!![]}]})[_0x8a4e('0x27')](handleEntityNotFound(_0x5b7bd8,null))[_0x8a4e('0x27')](function(_0x4448a7){var _0xda4a57=_[_0x8a4e('0x34')](_0x4448a7,'id');var _0x1cec22=[];var _0x4594c2=[];var _0x5b0e91=squel[_0x8a4e('0x73')]();_0x5b0e91[_0x8a4e('0x74')]('tq.TeamId')[_0x8a4e('0x75')]('team_has_fax_queues','tq')[_0x8a4e('0x76')](_0x8a4e('0x77'),'ut',_0x8a4e('0x78'))['where']('FaxQueueId\x20=\x20?',_0xcf7360[_0x8a4e('0x4c')]['id']);for(var _0x3c32d3=0x0;_0x3c32d3<_0x4448a7['length'];_0x3c32d3+=0x1){let _0x2aa026=_0x4448a7[_0x3c32d3];for(var _0x59acbb=0x0;_0x59acbb<_0x2aa026[_0x8a4e('0x68')]['length'];_0x59acbb+=0x1){let _0xd111e2=_0x2aa026[_0x8a4e('0x68')][_0x59acbb];var _0x4f21fe=_0x5b0e91['clone']();_0x4f21fe[_0x8a4e('0x41')]('ut.UserId\x20=\x20?',_0xd111e2['id']);_0x4594c2[_0x8a4e('0x79')](db[_0x8a4e('0x7a')][_0x8a4e('0x35')](_0x4f21fe['toString'](),{'type':db[_0x8a4e('0x7a')][_0x8a4e('0x7b')][_0x8a4e('0x7c')]})[_0x8a4e('0x27')](function(_0x9e25f2){if(_0x9e25f2[_0x8a4e('0x3c')]===0x1){return _0xd111e2['id'];}else{var _0x20c519=_['every'](_[_0x8a4e('0x34')](_0x9e25f2,_0x8a4e('0x7d')),function(_0x1dca86){return _[_0x8a4e('0x7e')](_0xda4a57,_0x1dca86);});if(_0x20c519){return _0xd111e2['id'];}}}));}}return BPromise[_0x8a4e('0x7f')](_0x4594c2)[_0x8a4e('0x27')](function(_0x5a4661){_0x1cec22=_(_0x1cec22)[_0x8a4e('0x80')](_0x5a4661)[_0x8a4e('0x81')]()[_0x8a4e('0x82')]();return db[_0x8a4e('0x31')][_0x8a4e('0x4e')]({'where':{'id':_0xcf7360[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](function(_0x2c7dd9){return db['sequelize'][_0x8a4e('0x6d')](function(_0x543f17){return _0x2c7dd9[_0x8a4e('0x83')](_0xcf7360[_0x8a4e('0x35')][_0x8a4e('0x67')],{'transaction':_0x543f17})['then'](function(){if(!_[_0x8a4e('0x84')](_0x1cec22)){return _0x2c7dd9[_0x8a4e('0x85')](_0x1cec22,{'transaction':_0x543f17});}})[_0x8a4e('0x27')](function(){_0x1cec22[_0x8a4e('0x70')](function(_0x4a2d60){socket[_0x8a4e('0x71')](_0x8a4e('0x86'),{'UserId':_0x4a2d60,'FaxQueueId':_0x2c7dd9['id']});});});});});});})[_0x8a4e('0x27')](respondWithStatusCode(_0x5b7bd8,null))['catch'](handleError(_0x5b7bd8,null));};exports['addAgents']=function(_0x599b4b,_0x2d5e31,_0x168bef){return db[_0x8a4e('0x31')]['find']({'where':{'id':_0x599b4b[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x2d5e31,null))[_0x8a4e('0x27')](function(_0x2576bd){if(_0x2576bd){return _0x2576bd[_0x8a4e('0x87')](_0x599b4b['body'][_0x8a4e('0x67')],_[_0x8a4e('0x88')](_0x599b4b['body'],[_0x8a4e('0x67'),'id'])||{})[_0x8a4e('0x89')](function(_0x35ea26){for(var _0x4b61ee=0x0;_0x4b61ee<_0x599b4b[_0x8a4e('0x50')][_0x8a4e('0x67')][_0x8a4e('0x3c')];_0x4b61ee+=0x1){socket[_0x8a4e('0x71')](_0x8a4e('0x72'),{'UserId':Number(_0x599b4b[_0x8a4e('0x50')][_0x8a4e('0x67')][_0x4b61ee]),'FaxQueueId':Number(_0x599b4b['params']['id'])});}return _0x35ea26;});}})[_0x8a4e('0x27')](respondWithResult(_0x2d5e31,null))['catch'](handleError(_0x2d5e31,null));};exports[_0x8a4e('0x85')]=function(_0x448806,_0x5c1376,_0x4e613a){return db[_0x8a4e('0x31')]['find']({'where':{'id':_0x448806[_0x8a4e('0x4c')]['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x5c1376,null))[_0x8a4e('0x27')](function(_0x27f188){if(_0x27f188){return _0x27f188['removeAgents'](_0x448806['query'][_0x8a4e('0x67')])[_0x8a4e('0x27')](function(){if(_[_0x8a4e('0x8a')](_0x448806[_0x8a4e('0x35')][_0x8a4e('0x67')])){for(var _0xa118d0=0x0;_0xa118d0<_0x448806['query'][_0x8a4e('0x67')][_0x8a4e('0x3c')];_0xa118d0+=0x1){socket[_0x8a4e('0x71')](_0x8a4e('0x86'),{'UserId':Number(_0x448806[_0x8a4e('0x35')][_0x8a4e('0x67')][_0xa118d0]),'FaxQueueId':Number(_0x448806[_0x8a4e('0x4c')]['id'])});}}else{socket[_0x8a4e('0x71')](_0x8a4e('0x86'),{'UserId':Number(_0x448806[_0x8a4e('0x35')][_0x8a4e('0x67')]),'FaxQueueId':Number(_0x448806['params']['id'])});}});}})[_0x8a4e('0x27')](respondWithStatusCode(_0x5c1376,null))[_0x8a4e('0x4a')](handleError(_0x5c1376,null));};exports[_0x8a4e('0x8b')]=function(_0x3a1e76,_0x39d7db,_0x148320){var _0x1934fd={};var _0xe978a6={};var _0x104e9a;var _0x2dc61e;return db[_0x8a4e('0x31')][_0x8a4e('0x57')]({'where':{'id':_0x3a1e76['params']['id']}})[_0x8a4e('0x27')](handleEntityNotFound(_0x39d7db,null))[_0x8a4e('0x27')](function(_0x33fd84){if(_0x33fd84){_0x104e9a=_0x33fd84;_0xe978a6[_0x8a4e('0x39')]=_[_0x8a4e('0x36')](db[_0x8a4e('0x5a')][_0x8a4e('0x4d')]);_0xe978a6[_0x8a4e('0x35')]=_[_0x8a4e('0x36')](_0x3a1e76[_0x8a4e('0x35')]);_0xe978a6[_0x8a4e('0x37')]=_[_0x8a4e('0x38')](_0xe978a6[_0x8a4e('0x39')],_0xe978a6[_0x8a4e('0x35')]);_0x1934fd[_0x8a4e('0x3a')]=_[_0x8a4e('0x38')](_0xe978a6[_0x8a4e('0x39')],qs[_0x8a4e('0x3b')](_0x3a1e76[_0x8a4e('0x35')][_0x8a4e('0x3b')]));_0x1934fd[_0x8a4e('0x3a')]=_0x1934fd[_0x8a4e('0x3a')]['length']?_0x1934fd[_0x8a4e('0x3a')]:_0xe978a6[_0x8a4e('0x39')];_0x1934fd['order']=qs['sort'](_0x3a1e76[_0x8a4e('0x35')][_0x8a4e('0x40')]);_0x1934fd['where']=qs['filters'](_[_0x8a4e('0x42')](_0x3a1e76[_0x8a4e('0x35')],_0xe978a6[_0x8a4e('0x37')]));if(_0x3a1e76['query'][_0x8a4e('0x43')]){_0x1934fd[_0x8a4e('0x41')]=_[_0x8a4e('0x44')](_0x1934fd[_0x8a4e('0x41')],{'$or':_['map'](_0x1934fd['attributes'],function(_0x33560f){var _0x94c06a={};_0x94c06a[_0x33560f]={'$like':'%'+_0x3a1e76[_0x8a4e('0x35')][_0x8a4e('0x43')]+'%'};return _0x94c06a;})});}_0x1934fd=_[_0x8a4e('0x44')]({},_0x1934fd,_0x3a1e76['options']);return _0x104e9a[_0x8a4e('0x8b')](_0x1934fd);}})['then'](function(_0x1d5127){if(_0x1d5127){_0x2dc61e=_0x1d5127[_0x8a4e('0x3c')];if(!_0x3a1e76[_0x8a4e('0x35')][_0x8a4e('0x3d')](_0x8a4e('0x3e'))){_0x1934fd[_0x8a4e('0x22')]=qs['limit'](_0x3a1e76['query'][_0x8a4e('0x22')]);_0x1934fd['offset']=qs[_0x8a4e('0x24')](_0x3a1e76[_0x8a4e('0x35')][_0x8a4e('0x24')]);}return _0x104e9a[_0x8a4e('0x8b')](_0x1934fd);}})[_0x8a4e('0x27')](function(_0x5bc2bd){if(_0x5bc2bd){return _0x5bc2bd?{'count':_0x2dc61e,'rows':_0x5bc2bd}:null;}})[_0x8a4e('0x27')](respondWithResult(_0x39d7db,null))[_0x8a4e('0x4a')](handleError(_0x39d7db,null));};
\ No newline at end of file
index c0afcb6..c6322f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6427=['save','update','remove','emit','exports','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x152243,_0x137ee7){var _0x59df69=function(_0x5b904c){while(--_0x5b904c){_0x152243['push'](_0x152243['shift']());}};_0x59df69(++_0x137ee7);}(_0x6427,0xc2));var _0x7642=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6427[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0x7642('0x0'));var FaxQueue=require(_0x7642('0x1'))['db'][_0x7642('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x7642('0x3')](0x0);var events={'afterCreate':_0x7642('0x4'),'afterUpdate':_0x7642('0x5'),'afterDestroy':_0x7642('0x6')};function emitEvent(_0xde3647){return function(_0x3bdf29,_0x13c979,_0x2caaad){FaxQueueEvents[_0x7642('0x7')](_0xde3647+':'+_0x3bdf29['id'],_0x3bdf29);FaxQueueEvents[_0x7642('0x7')](_0xde3647,_0x3bdf29);_0x2caaad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x7642('0x8')]=FaxQueueEvents;
\ No newline at end of file
+var _0x9e63=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue'];(function(_0x242d6f,_0x24a25c){var _0x4f034e=function(_0x549953){while(--_0x549953){_0x242d6f['push'](_0x242d6f['shift']());}};_0x4f034e(++_0x24a25c);}(_0x9e63,0x192));var _0x39e6=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x9e63[_0x5b561d];return _0x431060;};'use strict';var EventEmitter=require(_0x39e6('0x0'));var FaxQueue=require(_0x39e6('0x1'))['db'][_0x39e6('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x39e6('0x3')](0x0);var events={'afterCreate':_0x39e6('0x4'),'afterUpdate':_0x39e6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3a69a2){return function(_0x55cf21,_0x47bf70,_0x1e32ae){FaxQueueEvents[_0x39e6('0x6')](_0x3a69a2+':'+_0x55cf21['id'],_0x55cf21);FaxQueueEvents[_0x39e6('0x6')](_0x3a69a2,_0x55cf21);_0x1e32ae(null);};}for(var e in events){if(events[_0x39e6('0x7')](e)){var event=events[e];FaxQueue[_0x39e6('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
index 2aac20f..46f5eb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1712=['api','moment','path','rimraf','exports','define','lodash','util','../../config/logger'];(function(_0x1e48d4,_0x4a8aa5){var _0x52cfbc=function(_0x347c48){while(--_0x347c48){_0x1e48d4['push'](_0x1e48d4['shift']());}};_0x52cfbc(++_0x4a8aa5);}(_0x1712,0x16e));var _0x2171=function(_0x1c4409,_0x3b2e8f){_0x1c4409=_0x1c4409-0x0;var _0x356d8f=_0x1712[_0x1c4409];return _0x356d8f;};'use strict';var _=require(_0x2171('0x0'));var util=require(_0x2171('0x1'));var logger=require(_0x2171('0x2'))(_0x2171('0x3'));var moment=require(_0x2171('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2171('0x5'));var rimraf=require(_0x2171('0x6'));var config=require('../../config/environment');var attributes=require('./faxQueue.attributes');module[_0x2171('0x7')]=function(_0x27f06b,_0x4a1c18){return _0x27f06b[_0x2171('0x8')]('FaxQueue',attributes,{'tableName':'fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a19=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./faxQueue.attributes','fax_queues','util'];(function(_0x290fa6,_0x16d017){var _0x47f1f3=function(_0x2b5eb8){while(--_0x2b5eb8){_0x290fa6['push'](_0x290fa6['shift']());}};_0x47f1f3(++_0x16d017);}(_0x2a19,0x1c1));var _0x92a1=function(_0x43e987,_0x38c3a3){_0x43e987=_0x43e987-0x0;var _0x36a7f5=_0x2a19[_0x43e987];return _0x36a7f5;};'use strict';var _=require('lodash');var util=require(_0x92a1('0x0'));var logger=require(_0x92a1('0x1'))(_0x92a1('0x2'));var moment=require(_0x92a1('0x3'));var BPromise=require(_0x92a1('0x4'));var rp=require(_0x92a1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x92a1('0x6'));var attributes=require(_0x92a1('0x7'));module['exports']=function(_0x364b8c,_0x2e2ea3){return _0x364b8c['define']('FaxQueue',attributes,{'tableName':_0x92a1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d43b235..1f6c241 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd090=['map','model','GetFaxQueue','stringify','ShowFaxQueue','find','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','then','request\x20sent','debug','error','code','FaxQueue,\x20%s,\x20%s','info','result','message','catch','FaxQueue','findAll','raw','options','attributes','limit','include'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0xd090,0x166));var _0x0d09=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd090[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0d09('0x0'));var util=require(_0x0d09('0x1'));var moment=require(_0x0d09('0x2'));var BPromise=require(_0x0d09('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d09('0x4'));var db=require(_0x0d09('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d09('0x6'))(_0x0d09('0x7'));var config=require(_0x0d09('0x8'));var jayson=require(_0x0d09('0x9'));var client=jayson['client'][_0x0d09('0xa')]({'port':0x232a});config[_0x0d09('0xb')]=_[_0x0d09('0xc')](config[_0x0d09('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d09('0xd'))(new Redis(config[_0x0d09('0xb')]));require('./faxQueue.socket')[_0x0d09('0xe')](socket);function respondWithRpcPromise(_0x1f252b,_0x504bac,_0x16ddfe){return new BPromise(function(_0x3c60ac,_0x4fc0ab){return client['request'](_0x1f252b,_0x16ddfe)[_0x0d09('0xf')](function(_0x424b0d){logger['info']('FaxQueue,\x20%s,\x20%s',_0x504bac,_0x0d09('0x10'));logger[_0x0d09('0x11')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x504bac,_0x0d09('0x10'),JSON['stringify'](_0x424b0d));if(_0x424b0d[_0x0d09('0x12')]){if(_0x424b0d[_0x0d09('0x12')][_0x0d09('0x13')]===0x1f4){logger[_0x0d09('0x12')](_0x0d09('0x14'),_0x504bac,_0x424b0d[_0x0d09('0x12')]['message']);return _0x4fc0ab(_0x424b0d[_0x0d09('0x12')]['message']);}logger['error'](_0x0d09('0x14'),_0x504bac,_0x424b0d[_0x0d09('0x12')]['message']);return _0x3c60ac(_0x424b0d[_0x0d09('0x12')]['message']);}else{logger[_0x0d09('0x15')](_0x0d09('0x14'),_0x504bac,_0x0d09('0x10'));_0x3c60ac(_0x424b0d[_0x0d09('0x16')][_0x0d09('0x17')]);}})[_0x0d09('0x18')](function(_0x2a818f){logger[_0x0d09('0x12')](_0x0d09('0x14'),_0x504bac,_0x2a818f);_0x4fc0ab(_0x2a818f);});});}exports['GetFaxQueue']=function(_0x5186a5){var _0x13d0e6=this;return new Promise(function(_0x980366,_0x537a1f){return db[_0x0d09('0x19')][_0x0d09('0x1a')]({'raw':_0x5186a5['options']?_0x5186a5['options'][_0x0d09('0x1b')]===undefined?!![]:![]:!![],'where':_0x5186a5[_0x0d09('0x1c')]?_0x5186a5[_0x0d09('0x1c')]['where']||null:null,'attributes':_0x5186a5[_0x0d09('0x1c')]?_0x5186a5[_0x0d09('0x1c')][_0x0d09('0x1d')]||null:null,'limit':_0x5186a5[_0x0d09('0x1c')]?_0x5186a5[_0x0d09('0x1c')][_0x0d09('0x1e')]||null:null,'include':_0x5186a5[_0x0d09('0x1c')]?_0x5186a5['options'][_0x0d09('0x1f')]?_[_0x0d09('0x20')](_0x5186a5[_0x0d09('0x1c')][_0x0d09('0x1f')],function(_0x13d95c){return{'model':db[_0x13d95c[_0x0d09('0x21')]],'as':_0x13d95c['as'],'attributes':_0x13d95c[_0x0d09('0x1d')],'include':_0x13d95c[_0x0d09('0x1f')]?_[_0x0d09('0x20')](_0x13d95c['include'],function(_0x3f9a49){return{'model':db[_0x3f9a49['model']],'as':_0x3f9a49['as'],'attributes':_0x3f9a49[_0x0d09('0x1d')],'include':_0x3f9a49[_0x0d09('0x1f')]?_[_0x0d09('0x20')](_0x3f9a49[_0x0d09('0x1f')],function(_0x5ca216){return{'model':db[_0x5ca216[_0x0d09('0x21')]],'as':_0x5ca216['as'],'attributes':_0x5ca216[_0x0d09('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0d09('0xf')](function(_0x3417ce){logger['info'](_0x0d09('0x22'),_0x5186a5);logger['debug'](_0x0d09('0x22'),_0x5186a5,JSON[_0x0d09('0x23')](_0x3417ce));_0x980366(_0x3417ce);})[_0x0d09('0x18')](function(_0x2b3211){logger[_0x0d09('0x12')](_0x0d09('0x22'),_0x2b3211[_0x0d09('0x17')],_0x5186a5);_0x537a1f(_0x13d0e6[_0x0d09('0x12')](0x1f4,_0x2b3211[_0x0d09('0x17')]));});});};exports[_0x0d09('0x24')]=function(_0x2dbea0){var _0x50787a=this;return new Promise(function(_0x1d154d,_0x308bc1){return db[_0x0d09('0x19')][_0x0d09('0x25')]({'raw':_0x2dbea0['options']?_0x2dbea0[_0x0d09('0x1c')][_0x0d09('0x1b')]===undefined?!![]:![]:!![],'where':_0x2dbea0[_0x0d09('0x1c')]?_0x2dbea0[_0x0d09('0x1c')][_0x0d09('0x26')]||null:null,'attributes':_0x2dbea0['options']?_0x2dbea0[_0x0d09('0x1c')][_0x0d09('0x1d')]||null:null,'include':_0x2dbea0[_0x0d09('0x1c')]?_0x2dbea0[_0x0d09('0x1c')][_0x0d09('0x1f')]?_[_0x0d09('0x20')](_0x2dbea0[_0x0d09('0x1c')][_0x0d09('0x1f')],function(_0x56d8f6){return{'model':db[_0x56d8f6[_0x0d09('0x21')]],'as':_0x56d8f6['as'],'attributes':_0x56d8f6[_0x0d09('0x1d')],'include':_0x56d8f6['include']?_[_0x0d09('0x20')](_0x56d8f6['include'],function(_0x3848d4){return{'model':db[_0x3848d4[_0x0d09('0x21')]],'as':_0x3848d4['as'],'attributes':_0x3848d4[_0x0d09('0x1d')],'include':_0x3848d4[_0x0d09('0x1f')]?_[_0x0d09('0x20')](_0x3848d4[_0x0d09('0x1f')],function(_0x1ed34c){return{'model':db[_0x1ed34c[_0x0d09('0x21')]],'as':_0x1ed34c['as'],'attributes':_0x1ed34c[_0x0d09('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x334649){logger['info']('ShowFaxQueue',_0x2dbea0);logger['debug'](_0x0d09('0x24'),_0x2dbea0,JSON[_0x0d09('0x23')](_0x334649));_0x1d154d(_0x334649);})[_0x0d09('0x18')](function(_0xfc5b09){logger['error']('ShowFaxQueue',_0xfc5b09['message'],_0x2dbea0);_0x308bc1(_0x50787a[_0x0d09('0x12')](0x1f4,_0xfc5b09[_0x0d09('0x17')]));});});};
\ No newline at end of file
+var _0xefd5=['raw','where','include','map','model','attributes','GetFaxQueue','ShowFaxQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','FaxQueue','findAll','options'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0xefd5,0xa9));var _0x5efd=function(_0x5d8d42,_0x1ee52c){_0x5d8d42=_0x5d8d42-0x0;var _0x474f7b=_0xefd5[_0x5d8d42];return _0x474f7b;};'use strict';var _=require(_0x5efd('0x0'));var util=require('util');var moment=require(_0x5efd('0x1'));var BPromise=require(_0x5efd('0x2'));var rs=require(_0x5efd('0x3'));var fs=require('fs');var Redis=require(_0x5efd('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5efd('0x5'))(_0x5efd('0x6'));var config=require(_0x5efd('0x7'));var jayson=require(_0x5efd('0x8'));var client=jayson[_0x5efd('0x9')]['http']({'port':0x232a});config[_0x5efd('0xa')]=_[_0x5efd('0xb')](config[_0x5efd('0xa')],{'host':_0x5efd('0xc'),'port':0x18eb});var socket=require(_0x5efd('0xd'))(new Redis(config[_0x5efd('0xa')]));require(_0x5efd('0xe'))[_0x5efd('0xf')](socket);function respondWithRpcPromise(_0x3f1423,_0x45ca48,_0x1b8e6d){return new BPromise(function(_0x1b428d,_0x58288c){return client[_0x5efd('0x10')](_0x3f1423,_0x1b8e6d)[_0x5efd('0x11')](function(_0x5dae32){logger[_0x5efd('0x12')](_0x5efd('0x13'),_0x45ca48,_0x5efd('0x14'));logger[_0x5efd('0x15')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x45ca48,_0x5efd('0x14'),JSON[_0x5efd('0x16')](_0x5dae32));if(_0x5dae32[_0x5efd('0x17')]){if(_0x5dae32[_0x5efd('0x17')][_0x5efd('0x18')]===0x1f4){logger[_0x5efd('0x17')](_0x5efd('0x13'),_0x45ca48,_0x5dae32[_0x5efd('0x17')][_0x5efd('0x19')]);return _0x58288c(_0x5dae32[_0x5efd('0x17')][_0x5efd('0x19')]);}logger['error'](_0x5efd('0x13'),_0x45ca48,_0x5dae32[_0x5efd('0x17')][_0x5efd('0x19')]);return _0x1b428d(_0x5dae32[_0x5efd('0x17')][_0x5efd('0x19')]);}else{logger[_0x5efd('0x12')]('FaxQueue,\x20%s,\x20%s',_0x45ca48,'request\x20sent');_0x1b428d(_0x5dae32[_0x5efd('0x1a')][_0x5efd('0x19')]);}})[_0x5efd('0x1b')](function(_0x5f4db5){logger[_0x5efd('0x17')](_0x5efd('0x13'),_0x45ca48,_0x5f4db5);_0x58288c(_0x5f4db5);});});}exports['GetFaxQueue']=function(_0x21e3a0){var _0x33e59a=this;return new Promise(function(_0x4a9bbe,_0x1d7c6d){return db[_0x5efd('0x1c')][_0x5efd('0x1d')]({'raw':_0x21e3a0['options']?_0x21e3a0[_0x5efd('0x1e')][_0x5efd('0x1f')]===undefined?!![]:![]:!![],'where':_0x21e3a0[_0x5efd('0x1e')]?_0x21e3a0[_0x5efd('0x1e')][_0x5efd('0x20')]||null:null,'attributes':_0x21e3a0[_0x5efd('0x1e')]?_0x21e3a0[_0x5efd('0x1e')]['attributes']||null:null,'limit':_0x21e3a0[_0x5efd('0x1e')]?_0x21e3a0[_0x5efd('0x1e')]['limit']||null:null,'include':_0x21e3a0['options']?_0x21e3a0[_0x5efd('0x1e')][_0x5efd('0x21')]?_[_0x5efd('0x22')](_0x21e3a0[_0x5efd('0x1e')]['include'],function(_0x1a1369){return{'model':db[_0x1a1369[_0x5efd('0x23')]],'as':_0x1a1369['as'],'attributes':_0x1a1369[_0x5efd('0x24')],'include':_0x1a1369['include']?_['map'](_0x1a1369[_0x5efd('0x21')],function(_0x4a13cb){return{'model':db[_0x4a13cb['model']],'as':_0x4a13cb['as'],'attributes':_0x4a13cb['attributes'],'include':_0x4a13cb['include']?_[_0x5efd('0x22')](_0x4a13cb[_0x5efd('0x21')],function(_0x32ff53){return{'model':db[_0x32ff53['model']],'as':_0x32ff53['as'],'attributes':_0x32ff53[_0x5efd('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5efd('0x11')](function(_0x35400e){logger[_0x5efd('0x12')]('GetFaxQueue',_0x21e3a0);logger[_0x5efd('0x15')](_0x5efd('0x25'),_0x21e3a0,JSON[_0x5efd('0x16')](_0x35400e));_0x4a9bbe(_0x35400e);})[_0x5efd('0x1b')](function(_0x1366e7){logger[_0x5efd('0x17')]('GetFaxQueue',_0x1366e7[_0x5efd('0x19')],_0x21e3a0);_0x1d7c6d(_0x33e59a[_0x5efd('0x17')](0x1f4,_0x1366e7[_0x5efd('0x19')]));});});};exports[_0x5efd('0x26')]=function(_0x1e81cc){var _0xe7b778=this;return new Promise(function(_0x243d56,_0xee28f1){return db['FaxQueue'][_0x5efd('0x27')]({'raw':_0x1e81cc[_0x5efd('0x1e')]?_0x1e81cc[_0x5efd('0x1e')][_0x5efd('0x1f')]===undefined?!![]:![]:!![],'where':_0x1e81cc[_0x5efd('0x1e')]?_0x1e81cc[_0x5efd('0x1e')][_0x5efd('0x20')]||null:null,'attributes':_0x1e81cc[_0x5efd('0x1e')]?_0x1e81cc[_0x5efd('0x1e')][_0x5efd('0x24')]||null:null,'include':_0x1e81cc['options']?_0x1e81cc[_0x5efd('0x1e')][_0x5efd('0x21')]?_['map'](_0x1e81cc[_0x5efd('0x1e')]['include'],function(_0xc72644){return{'model':db[_0xc72644[_0x5efd('0x23')]],'as':_0xc72644['as'],'attributes':_0xc72644['attributes'],'include':_0xc72644[_0x5efd('0x21')]?_[_0x5efd('0x22')](_0xc72644[_0x5efd('0x21')],function(_0x445221){return{'model':db[_0x445221[_0x5efd('0x23')]],'as':_0x445221['as'],'attributes':_0x445221[_0x5efd('0x24')],'include':_0x445221[_0x5efd('0x21')]?_[_0x5efd('0x22')](_0x445221[_0x5efd('0x21')],function(_0x4b035f){return{'model':db[_0x4b035f[_0x5efd('0x23')]],'as':_0x4b035f['as'],'attributes':_0x4b035f[_0x5efd('0x24')]};}):[]};}):[]};}):[]:[]})[_0x5efd('0x11')](function(_0x308dbb){logger[_0x5efd('0x12')](_0x5efd('0x26'),_0x1e81cc);logger[_0x5efd('0x15')](_0x5efd('0x26'),_0x1e81cc,JSON['stringify'](_0x308dbb));_0x243d56(_0x308dbb);})[_0x5efd('0x1b')](function(_0x71b62b){logger[_0x5efd('0x17')]('ShowFaxQueue',_0x71b62b[_0x5efd('0x19')],_0x1e81cc);_0xee28f1(_0xe7b778[_0x5efd('0x17')](0x1f4,_0x71b62b[_0x5efd('0x19')]));});});};
\ No newline at end of file
index df59a22..4073d3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0699=['length','./faxQueue.events','save','remove','update','removeListener'];(function(_0x2e3488,_0x4ca2e5){var _0x1cf01e=function(_0x4d97b8){while(--_0x4d97b8){_0x2e3488['push'](_0x2e3488['shift']());}};_0x1cf01e(++_0x4ca2e5);}(_0x0699,0x181));var _0x9069=function(_0x4096e5,_0x5c021c){_0x4096e5=_0x4096e5-0x0;var _0x3f83cd=_0x0699[_0x4096e5];return _0x3f83cd;};'use strict';var FaxQueueEvents=require(_0x9069('0x0'));var events=[_0x9069('0x1'),_0x9069('0x2'),_0x9069('0x3')];function createListener(_0x5dd7ef,_0x31d7d6){return function(_0x3ff490){_0x31d7d6['emit'](_0x5dd7ef,_0x3ff490);};}function removeListener(_0x6dcc78,_0x8a001f){return function(){FaxQueueEvents[_0x9069('0x4')](_0x6dcc78,_0x8a001f);};}exports['register']=function(_0x5da1c9){for(var _0x854611=0x0,_0x19152e=events[_0x9069('0x5')];_0x854611<_0x19152e;_0x854611++){var _0x44a634=events[_0x854611];var _0x2db100=createListener('faxQueue:'+_0x44a634,_0x5da1c9);FaxQueueEvents['on'](_0x44a634,_0x2db100);}};
\ No newline at end of file
+var _0xed05=['update','emit','removeListener','register','length','./faxQueue.events','save','remove'];(function(_0x5a2871,_0x386326){var _0x55d597=function(_0x2a73ee){while(--_0x2a73ee){_0x5a2871['push'](_0x5a2871['shift']());}};_0x55d597(++_0x386326);}(_0xed05,0xcd));var _0x5ed0=function(_0x1b736a,_0x108e5e){_0x1b736a=_0x1b736a-0x0;var _0x18a24f=_0xed05[_0x1b736a];return _0x18a24f;};'use strict';var FaxQueueEvents=require(_0x5ed0('0x0'));var events=[_0x5ed0('0x1'),_0x5ed0('0x2'),_0x5ed0('0x3')];function createListener(_0x11e3f4,_0x8093a0){return function(_0xaf86e8){_0x8093a0[_0x5ed0('0x4')](_0x11e3f4,_0xaf86e8);};}function removeListener(_0x220e77,_0x2e0d6a){return function(){FaxQueueEvents[_0x5ed0('0x5')](_0x220e77,_0x2e0d6a);};}exports[_0x5ed0('0x6')]=function(_0x5b9994){for(var _0x4712b3=0x0,_0x484c11=events[_0x5ed0('0x7')];_0x4712b3<_0x484c11;_0x4712b3++){var _0x4cc5e2=events[_0x4712b3];var _0x454445=createListener('faxQueue:'+_0x4cc5e2,_0x5b9994);FaxQueueEvents['on'](_0x4cc5e2,_0x454445);}};
\ No newline at end of file
index 3b24b6b..9b7ed89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c8f=['isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','create','/:id/users','addAgents','put','delete','destroy','removeTeams','exports','util','Router','fs-extra','../../components/auth/service','./faxQueue.controller','get'];(function(_0xa1cefc,_0x47791a){var _0x423e76=function(_0x4b3fbc){while(--_0x4b3fbc){_0xa1cefc['push'](_0xa1cefc['shift']());}};_0x423e76(++_0x47791a);}(_0x2c8f,0x192));var _0xf2c8=function(_0x215c2e,_0x107d54){_0x215c2e=_0x215c2e-0x0;var _0xbe2e15=_0x2c8f[_0x215c2e];return _0xbe2e15;};'use strict';var multer=require('multer');var util=require(_0xf2c8('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf2c8('0x1')]();var fs_extra=require(_0xf2c8('0x2'));var auth=require(_0xf2c8('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf2c8('0x4'));router[_0xf2c8('0x5')]('/',auth[_0xf2c8('0x6')](),controller[_0xf2c8('0x7')]);router[_0xf2c8('0x5')]('/describe',auth[_0xf2c8('0x6')](),controller[_0xf2c8('0x8')]);router[_0xf2c8('0x5')](_0xf2c8('0x9'),auth[_0xf2c8('0x6')](),controller[_0xf2c8('0xa')]);router['get'](_0xf2c8('0xb'),auth[_0xf2c8('0x6')](),controller[_0xf2c8('0xc')]);router[_0xf2c8('0x5')](_0xf2c8('0xd'),auth[_0xf2c8('0x6')](),controller[_0xf2c8('0xe')]);router[_0xf2c8('0x5')]('/:id/users',auth[_0xf2c8('0x6')](),controller['getAgents']);router[_0xf2c8('0xf')]('/',auth[_0xf2c8('0x6')](),controller[_0xf2c8('0x10')]);router[_0xf2c8('0xf')](_0xf2c8('0xd'),auth[_0xf2c8('0x6')](),controller['addTeams']);router[_0xf2c8('0xf')](_0xf2c8('0x11'),auth[_0xf2c8('0x6')](),controller[_0xf2c8('0x12')]);router[_0xf2c8('0x13')](_0xf2c8('0x9'),auth[_0xf2c8('0x6')](),controller['update']);router[_0xf2c8('0x14')](_0xf2c8('0x9'),auth[_0xf2c8('0x6')](),controller[_0xf2c8('0x15')]);router[_0xf2c8('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0xf2c8('0x16')]);router[_0xf2c8('0x14')](_0xf2c8('0x11'),auth[_0xf2c8('0x6')](),controller['removeAgents']);module[_0xf2c8('0x17')]=router;
\ No newline at end of file
+var _0xdbb1=['../../config/environment','./faxQueue.controller','index','get','/describe','isAuthenticated','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','removeTeams','multer','express','../../components/auth/service'];(function(_0x61ec5f,_0x3900ff){var _0x4a72e5=function(_0x4d14e8){while(--_0x4d14e8){_0x61ec5f['push'](_0x61ec5f['shift']());}};_0x4a72e5(++_0x3900ff);}(_0xdbb1,0x105));var _0x1dbb=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xdbb1[_0x24061a];return _0x82054e;};'use strict';var multer=require(_0x1dbb('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1dbb('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1dbb('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x1dbb('0x3'));var controller=require(_0x1dbb('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x1dbb('0x5')]);router[_0x1dbb('0x6')](_0x1dbb('0x7'),auth[_0x1dbb('0x8')](),controller['describe']);router[_0x1dbb('0x6')](_0x1dbb('0x9'),auth['isAuthenticated'](),controller[_0x1dbb('0xa')]);router[_0x1dbb('0x6')](_0x1dbb('0xb'),auth[_0x1dbb('0x8')](),controller[_0x1dbb('0xc')]);router[_0x1dbb('0x6')](_0x1dbb('0xd'),auth[_0x1dbb('0x8')](),controller[_0x1dbb('0xe')]);router[_0x1dbb('0x6')](_0x1dbb('0xf'),auth['isAuthenticated'](),controller[_0x1dbb('0x10')]);router[_0x1dbb('0x11')]('/',auth[_0x1dbb('0x8')](),controller[_0x1dbb('0x12')]);router['post']('/:id/teams',auth[_0x1dbb('0x8')](),controller[_0x1dbb('0x13')]);router[_0x1dbb('0x11')](_0x1dbb('0xf'),auth[_0x1dbb('0x8')](),controller['addAgents']);router[_0x1dbb('0x14')](_0x1dbb('0x9'),auth[_0x1dbb('0x8')](),controller['update']);router[_0x1dbb('0x15')](_0x1dbb('0x9'),auth['isAuthenticated'](),controller[_0x1dbb('0x16')]);router[_0x1dbb('0x15')](_0x1dbb('0xd'),auth[_0x1dbb('0x8')](),controller[_0x1dbb('0x17')]);router[_0x1dbb('0x15')](_0x1dbb('0xf'),auth[_0x1dbb('0x8')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 20afe80..261edb2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4f1=['DATE','exports','STRING'];(function(_0x5dd106,_0x52fc46){var _0x3fa406=function(_0x247aa6){while(--_0x247aa6){_0x5dd106['push'](_0x5dd106['shift']());}};_0x3fa406(++_0x52fc46);}(_0xa4f1,0xe2));var _0x1a4f=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xa4f1[_0x49b207];return _0x2dc8fa;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1a4f('0x0')]={'uniqueid':{'type':Sequelize[_0x1a4f('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x1a4f('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1a4f('0x2')]},'exitAt':{'type':Sequelize[_0x1a4f('0x2')]},'reason':{'type':Sequelize[_0x1a4f('0x1')]}};
\ No newline at end of file
+var _0x5e04=['sequelize','exports','STRING','DATE','moment'];(function(_0x1203bb,_0x4ddd17){var _0x10434f=function(_0xe85f33){while(--_0xe85f33){_0x1203bb['push'](_0x1203bb['shift']());}};_0x10434f(++_0x4ddd17);}(_0x5e04,0x176));var _0x45e0=function(_0x2a0c21,_0x51ad5e){_0x2a0c21=_0x2a0c21-0x0;var _0x28f2ff=_0x5e04[_0x2a0c21];return _0x28f2ff;};'use strict';var moment=require(_0x45e0('0x0'));var Sequelize=require(_0x45e0('0x1'));module[_0x45e0('0x2')]={'uniqueid':{'type':Sequelize[_0x45e0('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x45e0('0x3')]},'joinAt':{'type':Sequelize[_0x45e0('0x4')]},'leaveAt':{'type':Sequelize[_0x45e0('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x45e0('0x4')]},'reason':{'type':Sequelize[_0x45e0('0x3')]}};
\ No newline at end of file
index 843c920..486734c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ddd=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','include','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6ddd,0xae));var _0xd6dd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ddd[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd6dd('0x0'));var jsonpatch=require(_0xd6dd('0x1'));var rp=require(_0xd6dd('0x2'));var moment=require(_0xd6dd('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd6dd('0x4'));var util=require('util');var path=require(_0xd6dd('0x5'));var sox=require('sox');var csv=require(_0xd6dd('0x6'));var ejs=require(_0xd6dd('0x7'));var fs=require('fs');var fs_extra=require(_0xd6dd('0x8'));var _=require('lodash');var squel=require(_0xd6dd('0x9'));var crypto=require(_0xd6dd('0xa'));var jsforce=require(_0xd6dd('0xb'));var deskjs=require(_0xd6dd('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd6dd('0xd'));var Papa=require(_0xd6dd('0xe'));var Redis=require(_0xd6dd('0xf'));var authService=require(_0xd6dd('0x10'));var qs=require(_0xd6dd('0x11'));var as=require(_0xd6dd('0x12'));var hardwareService=require(_0xd6dd('0x13'));var logger=require(_0xd6dd('0x14'))(_0xd6dd('0x15'));var utils=require(_0xd6dd('0x16'));var config=require(_0xd6dd('0x17'));var licenseUtil=require(_0xd6dd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3436b5,_0x1ddb38){_0x1ddb38=_0x1ddb38||0xcc;return function(_0x240b83){if(_0x240b83){return _0x3436b5[_0xd6dd('0x19')](_0x1ddb38);}return _0x3436b5[_0xd6dd('0x1a')](_0x1ddb38)[_0xd6dd('0x1b')]();};}function respondWithResult(_0x302760,_0x550953){_0x550953=_0x550953||0xc8;return function(_0x305928){if(_0x305928){return _0x302760[_0xd6dd('0x1a')](_0x550953)[_0xd6dd('0x1c')](_0x305928);}};}function respondWithFilteredResult(_0x40febd,_0x3381e9){return function(_0x2c935e){if(_0x2c935e){var _0x41b358=typeof _0x3381e9[_0xd6dd('0x1d')]===_0xd6dd('0x1e')&&typeof _0x3381e9[_0xd6dd('0x1f')]===_0xd6dd('0x1e');var _0x289865=_0x2c935e['count'];var _0x254fb9=_0x41b358?0x0:_0x3381e9[_0xd6dd('0x1d')];var _0x3941d3=_0x41b358?_0x2c935e[_0xd6dd('0x20')]:_0x3381e9['offset']+_0x3381e9['limit'];var _0x84a5d4;if(_0x3941d3>=_0x289865){_0x3941d3=_0x289865;_0x84a5d4=0xc8;}else{_0x84a5d4=0xce;}_0x40febd[_0xd6dd('0x1a')](_0x84a5d4);return _0x40febd['set'](_0xd6dd('0x21'),_0x254fb9+'-'+_0x3941d3+'/'+_0x289865)[_0xd6dd('0x1c')](_0x2c935e);}return null;};}function patchUpdates(_0x4f27dd){return function(_0x4436c9){try{jsonpatch[_0xd6dd('0x22')](_0x4436c9,_0x4f27dd,!![]);}catch(_0x1786c8){return BPromise['reject'](_0x1786c8);}return _0x4436c9[_0xd6dd('0x23')]();};}function saveUpdates(_0x44e84c,_0x2acc65){return function(_0x4b2275){if(_0x4b2275){return _0x4b2275[_0xd6dd('0x24')](_0x44e84c)[_0xd6dd('0x25')](function(_0x46fe45){return _0x46fe45;});}return null;};}function removeEntity(_0x1b9275,_0x23d5bc){return function(_0x33f40b){if(_0x33f40b){return _0x33f40b[_0xd6dd('0x26')]()['then'](function(){_0x1b9275['status'](0xcc)[_0xd6dd('0x1b')]();});}};}function handleEntityNotFound(_0x48c31a,_0x5be1c6){return function(_0x4f9d51){if(!_0x4f9d51){_0x48c31a[_0xd6dd('0x19')](0x194);}return _0x4f9d51;};}function handleError(_0x4a03a5,_0x5274fe){_0x5274fe=_0x5274fe||0x1f4;return function(_0x5b6424){logger[_0xd6dd('0x27')](_0x5b6424[_0xd6dd('0x28')]);if(_0x5b6424[_0xd6dd('0x29')]){delete _0x5b6424[_0xd6dd('0x29')];}_0x4a03a5[_0xd6dd('0x1a')](_0x5274fe)[_0xd6dd('0x2a')](_0x5b6424);};}exports['index']=function(_0x108c10,_0x530cb9){var _0x336ec7={},_0x1e7b30={},_0x188cc7={'count':0x0,'rows':[]};var _0x115c9f=_[_0xd6dd('0x2b')](db[_0xd6dd('0x2c')][_0xd6dd('0x2d')],function(_0x38e44d){return{'name':_0x38e44d[_0xd6dd('0x2e')],'type':_0x38e44d[_0xd6dd('0x2f')]['key']};});_0x1e7b30[_0xd6dd('0x30')]=_[_0xd6dd('0x2b')](_0x115c9f,_0xd6dd('0x29'));_0x1e7b30[_0xd6dd('0x31')]=_[_0xd6dd('0x32')](_0x108c10['query']);_0x1e7b30['filters']=_[_0xd6dd('0x33')](_0x1e7b30[_0xd6dd('0x30')],_0x1e7b30[_0xd6dd('0x31')]);_0x336ec7[_0xd6dd('0x34')]=_[_0xd6dd('0x33')](_0x1e7b30[_0xd6dd('0x30')],qs[_0xd6dd('0x35')](_0x108c10[_0xd6dd('0x31')]['fields']));_0x336ec7[_0xd6dd('0x34')]=_0x336ec7[_0xd6dd('0x34')][_0xd6dd('0x36')]?_0x336ec7[_0xd6dd('0x34')]:_0x1e7b30[_0xd6dd('0x30')];if(!_0x108c10[_0xd6dd('0x31')][_0xd6dd('0x37')]('nolimit')){_0x336ec7[_0xd6dd('0x1f')]=qs['limit'](_0x108c10[_0xd6dd('0x31')]['limit']);_0x336ec7[_0xd6dd('0x1d')]=qs[_0xd6dd('0x1d')](_0x108c10['query'][_0xd6dd('0x1d')]);}_0x336ec7[_0xd6dd('0x38')]=qs['sort'](_0x108c10['query'][_0xd6dd('0x39')]);_0x336ec7[_0xd6dd('0x3a')]=qs[_0xd6dd('0x3b')](_[_0xd6dd('0x3c')](_0x108c10[_0xd6dd('0x31')],_0x1e7b30['filters']),_0x115c9f);if(_0x108c10['query'][_0xd6dd('0x3d')]){_0x336ec7[_0xd6dd('0x3a')]=_[_0xd6dd('0x3e')](_0x336ec7[_0xd6dd('0x3a')],{'$or':_[_0xd6dd('0x2b')](_0x115c9f,function(_0x20fef9){if(_0x20fef9['type']!==_0xd6dd('0x3f')){var _0x4a5989={};_0x4a5989[_0x20fef9['name']]={'$like':'%'+_0x108c10[_0xd6dd('0x31')][_0xd6dd('0x3d')]+'%'};return _0x4a5989;}})});}_0x336ec7=_[_0xd6dd('0x3e')]({},_0x336ec7,_0x108c10[_0xd6dd('0x40')]);var _0x2d96af={'where':_0x336ec7[_0xd6dd('0x3a')]};return db[_0xd6dd('0x2c')][_0xd6dd('0x20')](_0x2d96af)['then'](function(_0x2b6101){_0x188cc7[_0xd6dd('0x20')]=_0x2b6101;if(_0x108c10[_0xd6dd('0x31')][_0xd6dd('0x41')]){_0x336ec7['include']=[{'all':!![]}];}return db[_0xd6dd('0x2c')][_0xd6dd('0x42')](_0x336ec7);})['then'](function(_0x20ccb4){_0x188cc7['rows']=_0x20ccb4;return _0x188cc7;})[_0xd6dd('0x25')](respondWithFilteredResult(_0x530cb9,_0x336ec7))[_0xd6dd('0x43')](handleError(_0x530cb9,null));};exports['show']=function(_0x5b7808,_0x183963){var _0x49c2c2={'raw':!![],'where':{'id':_0x5b7808[_0xd6dd('0x44')]['id']}},_0x3b73ff={};_0x3b73ff[_0xd6dd('0x30')]=_['keys'](db['FaxQueueReport'][_0xd6dd('0x2d')]);_0x3b73ff[_0xd6dd('0x31')]=_[_0xd6dd('0x32')](_0x5b7808[_0xd6dd('0x31')]);_0x3b73ff[_0xd6dd('0x3b')]=_[_0xd6dd('0x33')](_0x3b73ff[_0xd6dd('0x30')],_0x3b73ff['query']);_0x49c2c2[_0xd6dd('0x34')]=_[_0xd6dd('0x33')](_0x3b73ff[_0xd6dd('0x30')],qs['fields'](_0x5b7808[_0xd6dd('0x31')][_0xd6dd('0x35')]));_0x49c2c2[_0xd6dd('0x34')]=_0x49c2c2[_0xd6dd('0x34')][_0xd6dd('0x36')]?_0x49c2c2[_0xd6dd('0x34')]:_0x3b73ff[_0xd6dd('0x30')];if(_0x5b7808[_0xd6dd('0x31')]['includeAll']){_0x49c2c2[_0xd6dd('0x45')]=[{'all':!![]}];}_0x49c2c2=_[_0xd6dd('0x3e')]({},_0x49c2c2,_0x5b7808[_0xd6dd('0x40')]);return db['FaxQueueReport'][_0xd6dd('0x46')](_0x49c2c2)[_0xd6dd('0x25')](handleEntityNotFound(_0x183963,null))[_0xd6dd('0x25')](respondWithResult(_0x183963,null))['catch'](handleError(_0x183963,null));};exports[_0xd6dd('0x47')]=function(_0x5071fa,_0x3ca93f){return db[_0xd6dd('0x2c')][_0xd6dd('0x47')](_0x5071fa[_0xd6dd('0x48')],{})['then'](respondWithResult(_0x3ca93f,0xc9))[_0xd6dd('0x43')](handleError(_0x3ca93f,null));};exports[_0xd6dd('0x24')]=function(_0x36befa,_0x9de2ea){if(_0x36befa[_0xd6dd('0x48')]['id']){delete _0x36befa['body']['id'];}return db[_0xd6dd('0x2c')][_0xd6dd('0x46')]({'where':{'id':_0x36befa['params']['id']}})[_0xd6dd('0x25')](handleEntityNotFound(_0x9de2ea,null))[_0xd6dd('0x25')](saveUpdates(_0x36befa[_0xd6dd('0x48')],null))['then'](respondWithResult(_0x9de2ea,null))[_0xd6dd('0x43')](handleError(_0x9de2ea,null));};exports[_0xd6dd('0x26')]=function(_0x41a7f7,_0x26ff26){return db[_0xd6dd('0x2c')]['find']({'where':{'id':_0x41a7f7[_0xd6dd('0x44')]['id']}})['then'](handleEntityNotFound(_0x26ff26,null))['then'](removeEntity(_0x26ff26,null))[_0xd6dd('0x43')](handleError(_0x26ff26,null));};exports[_0xd6dd('0x49')]=function(_0x2d9563,_0x18b050){return db[_0xd6dd('0x2c')]['describe']()['then'](respondWithResult(_0x18b050,null))[_0xd6dd('0x43')](handleError(_0x18b050,null));};
\ No newline at end of file
+var _0xca56=['show','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','end','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch'];(function(_0x2a3969,_0x42b9bc){var _0x31a010=function(_0x2f7d8a){while(--_0x2f7d8a){_0x2a3969['push'](_0x2a3969['shift']());}};_0x31a010(++_0x42b9bc);}(_0xca56,0xee));var _0x6ca5=function(_0x16b909,_0x57814d){_0x16b909=_0x16b909-0x0;var _0x2e0e48=_0xca56[_0x16b909];return _0x2e0e48;};'use strict';var emlformat=require(_0x6ca5('0x0'));var rimraf=require(_0x6ca5('0x1'));var zipdir=require(_0x6ca5('0x2'));var jsonpatch=require(_0x6ca5('0x3'));var rp=require(_0x6ca5('0x4'));var moment=require(_0x6ca5('0x5'));var BPromise=require(_0x6ca5('0x6'));var Mustache=require(_0x6ca5('0x7'));var util=require(_0x6ca5('0x8'));var path=require('path');var sox=require(_0x6ca5('0x9'));var csv=require(_0x6ca5('0xa'));var ejs=require(_0x6ca5('0xb'));var fs=require('fs');var fs_extra=require(_0x6ca5('0xc'));var _=require('lodash');var squel=require(_0x6ca5('0xd'));var crypto=require(_0x6ca5('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6ca5('0xa'));var querystring=require(_0x6ca5('0xf'));var Papa=require(_0x6ca5('0x10'));var Redis=require(_0x6ca5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6ca5('0x12'));var hardwareService=require(_0x6ca5('0x13'));var logger=require(_0x6ca5('0x14'))(_0x6ca5('0x15'));var utils=require(_0x6ca5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6ca5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eb3b9,_0x4fb08b){_0x4fb08b=_0x4fb08b||0xcc;return function(_0x5dd594){if(_0x5dd594){return _0x2eb3b9[_0x6ca5('0x18')](_0x4fb08b);}return _0x2eb3b9['status'](_0x4fb08b)['end']();};}function respondWithResult(_0x2a35cf,_0x428419){_0x428419=_0x428419||0xc8;return function(_0x5ba653){if(_0x5ba653){return _0x2a35cf[_0x6ca5('0x19')](_0x428419)[_0x6ca5('0x1a')](_0x5ba653);}};}function respondWithFilteredResult(_0x491a95,_0x40483f){return function(_0x19debd){if(_0x19debd){var _0x1cdfdc=typeof _0x40483f[_0x6ca5('0x1b')]===_0x6ca5('0x1c')&&typeof _0x40483f['limit']===_0x6ca5('0x1c');var _0x38f3db=_0x19debd['count'];var _0x2b3daf=_0x1cdfdc?0x0:_0x40483f[_0x6ca5('0x1b')];var _0x4fefd0=_0x1cdfdc?_0x19debd[_0x6ca5('0x1d')]:_0x40483f[_0x6ca5('0x1b')]+_0x40483f[_0x6ca5('0x1e')];var _0x37e362;if(_0x4fefd0>=_0x38f3db){_0x4fefd0=_0x38f3db;_0x37e362=0xc8;}else{_0x37e362=0xce;}_0x491a95[_0x6ca5('0x19')](_0x37e362);return _0x491a95[_0x6ca5('0x1f')]('Content-Range',_0x2b3daf+'-'+_0x4fefd0+'/'+_0x38f3db)[_0x6ca5('0x1a')](_0x19debd);}return null;};}function patchUpdates(_0xc7c1cb){return function(_0x44df63){try{jsonpatch[_0x6ca5('0x20')](_0x44df63,_0xc7c1cb,!![]);}catch(_0x11fe18){return BPromise[_0x6ca5('0x21')](_0x11fe18);}return _0x44df63[_0x6ca5('0x22')]();};}function saveUpdates(_0x1f8119,_0x23c16b){return function(_0x324881){if(_0x324881){return _0x324881[_0x6ca5('0x23')](_0x1f8119)[_0x6ca5('0x24')](function(_0x3754f5){return _0x3754f5;});}return null;};}function removeEntity(_0x1a23f2,_0x18967e){return function(_0x4e2f36){if(_0x4e2f36){return _0x4e2f36[_0x6ca5('0x25')]()[_0x6ca5('0x24')](function(){_0x1a23f2[_0x6ca5('0x19')](0xcc)[_0x6ca5('0x26')]();});}};}function handleEntityNotFound(_0x553930,_0xc10fad){return function(_0x350a69){if(!_0x350a69){_0x553930[_0x6ca5('0x18')](0x194);}return _0x350a69;};}function handleError(_0x1bdcc2,_0x409d7b){_0x409d7b=_0x409d7b||0x1f4;return function(_0x26239c){logger[_0x6ca5('0x27')](_0x26239c['stack']);if(_0x26239c[_0x6ca5('0x28')]){delete _0x26239c[_0x6ca5('0x28')];}_0x1bdcc2[_0x6ca5('0x19')](_0x409d7b)[_0x6ca5('0x29')](_0x26239c);};}exports[_0x6ca5('0x2a')]=function(_0x1b1ee9,_0x51b148){var _0xa570e4={},_0x31ab9c={},_0x3f0756={'count':0x0,'rows':[]};var _0x1b6359=_[_0x6ca5('0x2b')](db[_0x6ca5('0x2c')][_0x6ca5('0x2d')],function(_0x451c2d){return{'name':_0x451c2d[_0x6ca5('0x2e')],'type':_0x451c2d[_0x6ca5('0x2f')][_0x6ca5('0x30')]};});_0x31ab9c[_0x6ca5('0x31')]=_[_0x6ca5('0x2b')](_0x1b6359,_0x6ca5('0x28'));_0x31ab9c[_0x6ca5('0x32')]=_[_0x6ca5('0x33')](_0x1b1ee9[_0x6ca5('0x32')]);_0x31ab9c[_0x6ca5('0x34')]=_[_0x6ca5('0x35')](_0x31ab9c[_0x6ca5('0x31')],_0x31ab9c['query']);_0xa570e4[_0x6ca5('0x36')]=_['intersection'](_0x31ab9c[_0x6ca5('0x31')],qs[_0x6ca5('0x37')](_0x1b1ee9[_0x6ca5('0x32')][_0x6ca5('0x37')]));_0xa570e4['attributes']=_0xa570e4[_0x6ca5('0x36')][_0x6ca5('0x38')]?_0xa570e4[_0x6ca5('0x36')]:_0x31ab9c[_0x6ca5('0x31')];if(!_0x1b1ee9[_0x6ca5('0x32')][_0x6ca5('0x39')](_0x6ca5('0x3a'))){_0xa570e4[_0x6ca5('0x1e')]=qs[_0x6ca5('0x1e')](_0x1b1ee9['query'][_0x6ca5('0x1e')]);_0xa570e4[_0x6ca5('0x1b')]=qs[_0x6ca5('0x1b')](_0x1b1ee9['query'][_0x6ca5('0x1b')]);}_0xa570e4[_0x6ca5('0x3b')]=qs[_0x6ca5('0x3c')](_0x1b1ee9[_0x6ca5('0x32')]['sort']);_0xa570e4[_0x6ca5('0x3d')]=qs[_0x6ca5('0x34')](_[_0x6ca5('0x3e')](_0x1b1ee9[_0x6ca5('0x32')],_0x31ab9c[_0x6ca5('0x34')]),_0x1b6359);if(_0x1b1ee9['query'][_0x6ca5('0x3f')]){_0xa570e4[_0x6ca5('0x3d')]=_[_0x6ca5('0x40')](_0xa570e4[_0x6ca5('0x3d')],{'$or':_['map'](_0x1b6359,function(_0x9261a8){if(_0x9261a8[_0x6ca5('0x2f')]!==_0x6ca5('0x41')){var _0x47ca92={};_0x47ca92[_0x9261a8[_0x6ca5('0x28')]]={'$like':'%'+_0x1b1ee9[_0x6ca5('0x32')][_0x6ca5('0x3f')]+'%'};return _0x47ca92;}})});}_0xa570e4=_[_0x6ca5('0x40')]({},_0xa570e4,_0x1b1ee9['options']);var _0x2b506a={'where':_0xa570e4[_0x6ca5('0x3d')]};return db['FaxQueueReport'][_0x6ca5('0x1d')](_0x2b506a)[_0x6ca5('0x24')](function(_0x14f069){_0x3f0756[_0x6ca5('0x1d')]=_0x14f069;if(_0x1b1ee9[_0x6ca5('0x32')][_0x6ca5('0x42')]){_0xa570e4[_0x6ca5('0x43')]=[{'all':!![]}];}return db[_0x6ca5('0x2c')][_0x6ca5('0x44')](_0xa570e4);})[_0x6ca5('0x24')](function(_0x116caf){_0x3f0756['rows']=_0x116caf;return _0x3f0756;})[_0x6ca5('0x24')](respondWithFilteredResult(_0x51b148,_0xa570e4))[_0x6ca5('0x45')](handleError(_0x51b148,null));};exports[_0x6ca5('0x46')]=function(_0xfce19e,_0x4fb2a8){var _0x3522e3={'raw':!![],'where':{'id':_0xfce19e['params']['id']}},_0x3616b3={};_0x3616b3[_0x6ca5('0x31')]=_[_0x6ca5('0x33')](db['FaxQueueReport'][_0x6ca5('0x2d')]);_0x3616b3['query']=_['keys'](_0xfce19e['query']);_0x3616b3[_0x6ca5('0x34')]=_[_0x6ca5('0x35')](_0x3616b3[_0x6ca5('0x31')],_0x3616b3[_0x6ca5('0x32')]);_0x3522e3[_0x6ca5('0x36')]=_[_0x6ca5('0x35')](_0x3616b3[_0x6ca5('0x31')],qs['fields'](_0xfce19e['query'][_0x6ca5('0x37')]));_0x3522e3[_0x6ca5('0x36')]=_0x3522e3[_0x6ca5('0x36')][_0x6ca5('0x38')]?_0x3522e3[_0x6ca5('0x36')]:_0x3616b3['model'];if(_0xfce19e[_0x6ca5('0x32')][_0x6ca5('0x42')]){_0x3522e3[_0x6ca5('0x43')]=[{'all':!![]}];}_0x3522e3=_[_0x6ca5('0x40')]({},_0x3522e3,_0xfce19e[_0x6ca5('0x47')]);return db['FaxQueueReport']['find'](_0x3522e3)[_0x6ca5('0x24')](handleEntityNotFound(_0x4fb2a8,null))['then'](respondWithResult(_0x4fb2a8,null))[_0x6ca5('0x45')](handleError(_0x4fb2a8,null));};exports[_0x6ca5('0x48')]=function(_0x4d5856,_0x9802c3){return db[_0x6ca5('0x2c')][_0x6ca5('0x48')](_0x4d5856[_0x6ca5('0x49')],{})['then'](respondWithResult(_0x9802c3,0xc9))[_0x6ca5('0x45')](handleError(_0x9802c3,null));};exports[_0x6ca5('0x23')]=function(_0x290c6c,_0x2aa3b1){if(_0x290c6c[_0x6ca5('0x49')]['id']){delete _0x290c6c[_0x6ca5('0x49')]['id'];}return db[_0x6ca5('0x2c')][_0x6ca5('0x4a')]({'where':{'id':_0x290c6c['params']['id']}})[_0x6ca5('0x24')](handleEntityNotFound(_0x2aa3b1,null))['then'](saveUpdates(_0x290c6c['body'],null))[_0x6ca5('0x24')](respondWithResult(_0x2aa3b1,null))[_0x6ca5('0x45')](handleError(_0x2aa3b1,null));};exports[_0x6ca5('0x25')]=function(_0x555a52,_0x42567c){return db[_0x6ca5('0x2c')][_0x6ca5('0x4a')]({'where':{'id':_0x555a52[_0x6ca5('0x4b')]['id']}})[_0x6ca5('0x24')](handleEntityNotFound(_0x42567c,null))[_0x6ca5('0x24')](removeEntity(_0x42567c,null))['catch'](handleError(_0x42567c,null));};exports[_0x6ca5('0x4c')]=function(_0x4d2c1c,_0x1e60a2){return db[_0x6ca5('0x2c')]['describe']()[_0x6ca5('0x24')](respondWithResult(_0x1e60a2,null))['catch'](handleError(_0x1e60a2,null));};
\ No newline at end of file
index 250edc8..c253aa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','uniqueid','lodash','api','request-promise','path'];(function(_0x1d11b6,_0x1ff68a){var _0x5237f6=function(_0x1fa4ef){while(--_0x1fa4ef){_0x1d11b6['push'](_0x1d11b6['shift']());}};_0x5237f6(++_0x1ff68a);}(_0x0295,0x1f0));var _0x5029=function(_0x4d0ebd,_0x17ab0b){_0x4d0ebd=_0x4d0ebd-0x0;var _0x594e9c=_0x0295[_0x4d0ebd];return _0x594e9c;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5029('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1cb9=['api','moment','bluebird','path','rimraf','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','../../config/logger'];(function(_0x1cbcf1,_0x3f9fd9){var _0x3a06f0=function(_0x5425d4){while(--_0x5425d4){_0x1cbcf1['push'](_0x1cbcf1['shift']());}};_0x3a06f0(++_0x3f9fd9);}(_0x1cb9,0x14e));var _0x91cb=function(_0x231fc1,_0x44bad4){_0x231fc1=_0x231fc1-0x0;var _0x57a520=_0x1cb9[_0x231fc1];return _0x57a520;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x91cb('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 8fbb24a..8b4b944 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2408=['body','options','raw','then','limit','UpdateFaxQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create'];(function(_0xf361b3,_0x517f53){var _0xcbf45b=function(_0x3e67fb){while(--_0x3e67fb){_0xf361b3['push'](_0xf361b3['shift']());}};_0xcbf45b(++_0x517f53);}(_0x2408,0x10e));var _0x8240=function(_0x2b9c87,_0x117aed){_0x2b9c87=_0x2b9c87-0x0;var _0x4cb113=_0x2408[_0x2b9c87];return _0x4cb113;};'use strict';var _=require(_0x8240('0x0'));var util=require(_0x8240('0x1'));var moment=require('moment');var BPromise=require(_0x8240('0x2'));var rs=require(_0x8240('0x3'));var fs=require('fs');var Redis=require(_0x8240('0x4'));var db=require(_0x8240('0x5'))['db'];var utils=require(_0x8240('0x6'));var logger=require(_0x8240('0x7'))('rpc');var config=require(_0x8240('0x8'));var jayson=require(_0x8240('0x9'));var client=jayson[_0x8240('0xa')][_0x8240('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f8f5c,_0x241e0b,_0xdbdc73){return new BPromise(function(_0x3a952b,_0x53170b){return client[_0x8240('0xc')](_0x2f8f5c,_0xdbdc73)['then'](function(_0x4b3206){logger[_0x8240('0xd')](_0x8240('0xe'),_0x241e0b,_0x8240('0xf'));logger[_0x8240('0x10')](_0x8240('0x11'),_0x241e0b,_0x8240('0xf'),JSON[_0x8240('0x12')](_0x4b3206));if(_0x4b3206['error']){if(_0x4b3206[_0x8240('0x13')][_0x8240('0x14')]===0x1f4){logger[_0x8240('0x13')](_0x8240('0xe'),_0x241e0b,_0x4b3206[_0x8240('0x13')][_0x8240('0x15')]);return _0x53170b(_0x4b3206[_0x8240('0x13')]['message']);}logger[_0x8240('0x13')](_0x8240('0xe'),_0x241e0b,_0x4b3206[_0x8240('0x13')][_0x8240('0x15')]);return _0x3a952b(_0x4b3206[_0x8240('0x13')][_0x8240('0x15')]);}else{logger[_0x8240('0xd')](_0x8240('0xe'),_0x241e0b,_0x8240('0xf'));_0x3a952b(_0x4b3206[_0x8240('0x16')][_0x8240('0x15')]);}})[_0x8240('0x17')](function(_0x2ed642){logger[_0x8240('0x13')](_0x8240('0xe'),_0x241e0b,_0x2ed642);_0x53170b(_0x2ed642);});});}exports[_0x8240('0x18')]=function(_0x4d56b2){var _0x3f178a=this;return new Promise(function(_0x36e867,_0x17eacf){return db[_0x8240('0x19')][_0x8240('0x1a')](_0x4d56b2[_0x8240('0x1b')],{'raw':_0x4d56b2[_0x8240('0x1c')]?_0x4d56b2[_0x8240('0x1c')][_0x8240('0x1d')]===undefined?!![]:![]:!![]})[_0x8240('0x1e')](function(_0x595884){logger[_0x8240('0xd')](_0x8240('0x18'),_0x4d56b2);logger[_0x8240('0x10')]('CreateFaxQueueReport',_0x4d56b2,JSON['stringify'](_0x595884));_0x36e867(_0x595884);})[_0x8240('0x17')](function(_0x59828d){logger[_0x8240('0x13')](_0x8240('0x18'),_0x59828d[_0x8240('0x15')],_0x4d56b2);_0x17eacf(_0x3f178a[_0x8240('0x13')](0x1f4,_0x59828d[_0x8240('0x15')]));});});};exports['UpdateFaxQueueReport']=function(_0x32f0e4){var _0x5f4327=this;return new Promise(function(_0x3330a4,_0x3a18e4){return db[_0x8240('0x19')]['update'](_0x32f0e4['body'],{'raw':_0x32f0e4[_0x8240('0x1c')]?_0x32f0e4[_0x8240('0x1c')][_0x8240('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32f0e4[_0x8240('0x1c')]?_0x32f0e4[_0x8240('0x1c')]['where']||null:null,'attributes':_0x32f0e4[_0x8240('0x1c')]?_0x32f0e4[_0x8240('0x1c')]['attributes']||null:null,'limit':_0x32f0e4[_0x8240('0x1c')]?_0x32f0e4['options'][_0x8240('0x1f')]||null:null})[_0x8240('0x1e')](function(_0x549bd1){logger[_0x8240('0xd')](_0x8240('0x20'),_0x32f0e4);logger[_0x8240('0x10')](_0x8240('0x20'),_0x32f0e4,JSON[_0x8240('0x12')](_0x549bd1));_0x3330a4(_0x549bd1);})['catch'](function(_0x273c0e){logger['error'](_0x8240('0x20'),_0x273c0e['message'],_0x32f0e4);_0x3a18e4(_0x5f4327['error'](0x1f4,_0x273c0e['message']));});});};
\ No newline at end of file
+var _0xe57e=['code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','UpdateFaxQueueReport','where','attributes','limit','then','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xe57e,0x12f));var _0xee57=function(_0x29b672,_0x27967b){_0x29b672=_0x29b672-0x0;var _0x50c112=_0xe57e[_0x29b672];return _0x50c112;};'use strict';var _=require('lodash');var util=require(_0xee57('0x0'));var moment=require(_0xee57('0x1'));var BPromise=require(_0xee57('0x2'));var rs=require(_0xee57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee57('0x4'))['db'];var utils=require(_0xee57('0x5'));var logger=require(_0xee57('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xee57('0x7'));var client=jayson[_0xee57('0x8')][_0xee57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33452b,_0x3d2c48,_0x3db846){return new BPromise(function(_0x3b581b,_0x2b5f26){return client[_0xee57('0xa')](_0x33452b,_0x3db846)['then'](function(_0x2d91d8){logger[_0xee57('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x3d2c48,'request\x20sent');logger[_0xee57('0xc')](_0xee57('0xd'),_0x3d2c48,_0xee57('0xe'),JSON[_0xee57('0xf')](_0x2d91d8));if(_0x2d91d8['error']){if(_0x2d91d8[_0xee57('0x10')][_0xee57('0x11')]===0x1f4){logger[_0xee57('0x10')](_0xee57('0x12'),_0x3d2c48,_0x2d91d8[_0xee57('0x10')][_0xee57('0x13')]);return _0x2b5f26(_0x2d91d8[_0xee57('0x10')]['message']);}logger[_0xee57('0x10')](_0xee57('0x12'),_0x3d2c48,_0x2d91d8[_0xee57('0x10')][_0xee57('0x13')]);return _0x3b581b(_0x2d91d8[_0xee57('0x10')]['message']);}else{logger[_0xee57('0xb')](_0xee57('0x12'),_0x3d2c48,_0xee57('0xe'));_0x3b581b(_0x2d91d8[_0xee57('0x14')][_0xee57('0x13')]);}})[_0xee57('0x15')](function(_0x48c5a5){logger[_0xee57('0x10')](_0xee57('0x12'),_0x3d2c48,_0x48c5a5);_0x2b5f26(_0x48c5a5);});});}exports[_0xee57('0x16')]=function(_0x21ac09){var _0x5aae39=this;return new Promise(function(_0x5dc708,_0x33100b){return db[_0xee57('0x17')][_0xee57('0x18')](_0x21ac09[_0xee57('0x19')],{'raw':_0x21ac09[_0xee57('0x1a')]?_0x21ac09['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x21d74d){logger[_0xee57('0xb')](_0xee57('0x16'),_0x21ac09);logger[_0xee57('0xc')](_0xee57('0x16'),_0x21ac09,JSON[_0xee57('0xf')](_0x21d74d));_0x5dc708(_0x21d74d);})['catch'](function(_0x1d5f87){logger[_0xee57('0x10')]('CreateFaxQueueReport',_0x1d5f87[_0xee57('0x13')],_0x21ac09);_0x33100b(_0x5aae39['error'](0x1f4,_0x1d5f87[_0xee57('0x13')]));});});};exports[_0xee57('0x1b')]=function(_0x1939dc){var _0x3bb14e=this;return new Promise(function(_0x45ce51,_0x379e13){return db['FaxQueueReport']['update'](_0x1939dc[_0xee57('0x19')],{'raw':_0x1939dc['options']?_0x1939dc[_0xee57('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1939dc[_0xee57('0x1a')]?_0x1939dc[_0xee57('0x1a')][_0xee57('0x1c')]||null:null,'attributes':_0x1939dc[_0xee57('0x1a')]?_0x1939dc['options'][_0xee57('0x1d')]||null:null,'limit':_0x1939dc[_0xee57('0x1a')]?_0x1939dc[_0xee57('0x1a')][_0xee57('0x1e')]||null:null})[_0xee57('0x1f')](function(_0x4c800e){logger['info'](_0xee57('0x1b'),_0x1939dc);logger[_0xee57('0xc')](_0xee57('0x1b'),_0x1939dc,JSON['stringify'](_0x4c800e));_0x45ce51(_0x4c800e);})['catch'](function(_0x21b939){logger[_0xee57('0x10')]('UpdateFaxQueueReport',_0x21b939['message'],_0x1939dc);_0x379e13(_0x3bb14e['error'](0x1f4,_0x21b939[_0xee57('0x13')]));});});};
\ No newline at end of file
index 84e4827..b1cfbdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e48=['show','post','create','put','/:id','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','/describe','describe'];(function(_0x1a88eb,_0x50aa81){var _0x428ece=function(_0x29ee4d){while(--_0x29ee4d){_0x1a88eb['push'](_0x1a88eb['shift']());}};_0x428ece(++_0x50aa81);}(_0x1e48,0x121));var _0x81e4=function(_0x2cdf4e,_0x210079){_0x2cdf4e=_0x2cdf4e-0x0;var _0x5a4400=_0x1e48[_0x2cdf4e];return _0x5a4400;};'use strict';var multer=require(_0x81e4('0x0'));var util=require('util');var path=require(_0x81e4('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x81e4('0x2')]();var fs_extra=require(_0x81e4('0x3'));var auth=require(_0x81e4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x81e4('0x5'));var controller=require(_0x81e4('0x6'));router[_0x81e4('0x7')]('/',auth[_0x81e4('0x8')](),controller['index']);router['get'](_0x81e4('0x9'),auth[_0x81e4('0x8')](),controller[_0x81e4('0xa')]);router[_0x81e4('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x81e4('0xb')]);router[_0x81e4('0xc')]('/',auth[_0x81e4('0x8')](),controller[_0x81e4('0xd')]);router[_0x81e4('0xe')](_0x81e4('0xf'),auth[_0x81e4('0x8')](),controller[_0x81e4('0x10')]);router[_0x81e4('0x11')](_0x81e4('0xf'),auth[_0x81e4('0x8')](),controller[_0x81e4('0x12')]);module[_0x81e4('0x13')]=router;
\ No newline at end of file
+var _0xf64a=['index','describe','/:id','show','post','create','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../config/environment','./faxQueueReport.controller','get','isAuthenticated'];(function(_0x19b84d,_0x4f1e23){var _0x429f31=function(_0x507f10){while(--_0x507f10){_0x19b84d['push'](_0x19b84d['shift']());}};_0x429f31(++_0x4f1e23);}(_0xf64a,0x15c));var _0xaf64=function(_0x4179e2,_0xf2dbb){_0x4179e2=_0x4179e2-0x0;var _0x24cb50=_0xf64a[_0x4179e2];return _0x24cb50;};'use strict';var multer=require(_0xaf64('0x0'));var util=require(_0xaf64('0x1'));var path=require('path');var timeout=require(_0xaf64('0x2'));var express=require(_0xaf64('0x3'));var router=express['Router']();var fs_extra=require(_0xaf64('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaf64('0x5'));var controller=require(_0xaf64('0x6'));router[_0xaf64('0x7')]('/',auth[_0xaf64('0x8')](),controller[_0xaf64('0x9')]);router[_0xaf64('0x7')]('/describe',auth[_0xaf64('0x8')](),controller[_0xaf64('0xa')]);router[_0xaf64('0x7')](_0xaf64('0xb'),auth[_0xaf64('0x8')](),controller[_0xaf64('0xc')]);router[_0xaf64('0xd')]('/',auth[_0xaf64('0x8')](),controller[_0xaf64('0xe')]);router['put'](_0xaf64('0xb'),auth[_0xaf64('0x8')](),controller['update']);router[_0xaf64('0xf')](_0xaf64('0xb'),auth[_0xaf64('0x8')](),controller[_0xaf64('0x10')]);module['exports']=router;
\ No newline at end of file
index 31886be..e8d9ac1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x526074,_0x5e5d09){var _0x83c6c8=function(_0x571483){while(--_0x571483){_0x526074['push'](_0x526074['shift']());}};_0x83c6c8(++_0x5e5d09);}(_0x008c,0x188));var _0xc008=function(_0xf64026,_0x43afd3){_0xf64026=_0xf64026-0x0;var _0x1050be=_0x008c[_0xf64026];return _0x1050be;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}};
\ No newline at end of file
+var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x4d0c64,_0x2d729f){var _0x132d6f=function(_0x1a3380){while(--_0x1a3380){_0x4d0c64['push'](_0x4d0c64['shift']());}};_0x132d6f(++_0x2d729f);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5c6994,_0x19ad9a){_0x5c6994=_0x5c6994-0x0;var _0x1d5c84=_0x4b84[_0x5c6994];return _0x1d5c84;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
index b428b13..f36b866 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bcc=['querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','length','includeAll','find','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','to-csv'];(function(_0x2a0f3f,_0x4dce14){var _0x43daa7=function(_0x357b96){while(--_0x357b96){_0x2a0f3f['push'](_0x2a0f3f['shift']());}};_0x43daa7(++_0x4dce14);}(_0x6bcc,0xdd));var _0xc6bc=function(_0x4d87fc,_0x82feff){_0x4d87fc=_0x4d87fc-0x0;var _0x43c86e=_0x6bcc[_0x4d87fc];return _0x43c86e;};'use strict';var emlformat=require(_0xc6bc('0x0'));var rimraf=require(_0xc6bc('0x1'));var zipdir=require(_0xc6bc('0x2'));var jsonpatch=require(_0xc6bc('0x3'));var rp=require(_0xc6bc('0x4'));var moment=require(_0xc6bc('0x5'));var BPromise=require(_0xc6bc('0x6'));var Mustache=require(_0xc6bc('0x7'));var util=require(_0xc6bc('0x8'));var path=require(_0xc6bc('0x9'));var sox=require(_0xc6bc('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6bc('0xb'));var _=require('lodash');var squel=require(_0xc6bc('0xc'));var crypto=require('crypto');var jsforce=require(_0xc6bc('0xd'));var deskjs=require(_0xc6bc('0xe'));var toCsv=require(_0xc6bc('0xf'));var querystring=require(_0xc6bc('0x10'));var Papa=require('papaparse');var Redis=require(_0xc6bc('0x11'));var authService=require(_0xc6bc('0x12'));var qs=require(_0xc6bc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc6bc('0x14'));var logger=require('../../config/logger')(_0xc6bc('0x15'));var utils=require(_0xc6bc('0x16'));var config=require(_0xc6bc('0x17'));var licenseUtil=require(_0xc6bc('0x18'));var db=require(_0xc6bc('0x19'))['db'];function respondWithStatusCode(_0x5246b4,_0x273e50){_0x273e50=_0x273e50||0xcc;return function(_0x9c388d){if(_0x9c388d){return _0x5246b4['sendStatus'](_0x273e50);}return _0x5246b4[_0xc6bc('0x1a')](_0x273e50)['end']();};}function respondWithResult(_0x43933f,_0x2387b9){_0x2387b9=_0x2387b9||0xc8;return function(_0x2e0b75){if(_0x2e0b75){return _0x43933f['status'](_0x2387b9)[_0xc6bc('0x1b')](_0x2e0b75);}};}function respondWithFilteredResult(_0x530c38,_0x523b75){return function(_0x22d083){if(_0x22d083){var _0x5a2421=typeof _0x523b75[_0xc6bc('0x1c')]===_0xc6bc('0x1d')&&typeof _0x523b75[_0xc6bc('0x1e')]===_0xc6bc('0x1d');var _0x1256b5=_0x22d083['count'];var _0x56ed45=_0x5a2421?0x0:_0x523b75['offset'];var _0xab016f=_0x5a2421?_0x22d083[_0xc6bc('0x1f')]:_0x523b75[_0xc6bc('0x1c')]+_0x523b75[_0xc6bc('0x1e')];var _0x5af8e0;if(_0xab016f>=_0x1256b5){_0xab016f=_0x1256b5;_0x5af8e0=0xc8;}else{_0x5af8e0=0xce;}_0x530c38[_0xc6bc('0x1a')](_0x5af8e0);return _0x530c38[_0xc6bc('0x20')](_0xc6bc('0x21'),_0x56ed45+'-'+_0xab016f+'/'+_0x1256b5)[_0xc6bc('0x1b')](_0x22d083);}return null;};}function patchUpdates(_0x44bd87){return function(_0x3eda7f){try{jsonpatch[_0xc6bc('0x22')](_0x3eda7f,_0x44bd87,!![]);}catch(_0x98f036){return BPromise[_0xc6bc('0x23')](_0x98f036);}return _0x3eda7f[_0xc6bc('0x24')]();};}function saveUpdates(_0xdd8dd5,_0x4ea174){return function(_0x213c73){if(_0x213c73){return _0x213c73[_0xc6bc('0x25')](_0xdd8dd5)[_0xc6bc('0x26')](function(_0x5a5166){return _0x5a5166;});}return null;};}function removeEntity(_0x488930,_0x4c4d97){return function(_0xa70ed5){if(_0xa70ed5){return _0xa70ed5[_0xc6bc('0x27')]()[_0xc6bc('0x26')](function(){_0x488930['status'](0xcc)[_0xc6bc('0x28')]();});}};}function handleEntityNotFound(_0x1ba0d8,_0x429a48){return function(_0x43560a){if(!_0x43560a){_0x1ba0d8[_0xc6bc('0x29')](0x194);}return _0x43560a;};}function handleError(_0x109ab0,_0x34771f){_0x34771f=_0x34771f||0x1f4;return function(_0x29fb76){logger[_0xc6bc('0x2a')](_0x29fb76[_0xc6bc('0x2b')]);if(_0x29fb76[_0xc6bc('0x2c')]){delete _0x29fb76[_0xc6bc('0x2c')];}_0x109ab0[_0xc6bc('0x1a')](_0x34771f)[_0xc6bc('0x2d')](_0x29fb76);};}exports['index']=function(_0x187957,_0x120619){var _0x21b9f2={},_0x4f995b={},_0x5dae3c={'count':0x0,'rows':[]};var _0x4365ff=_[_0xc6bc('0x2e')](db[_0xc6bc('0x2f')][_0xc6bc('0x30')],function(_0x5e38be){return{'name':_0x5e38be[_0xc6bc('0x31')],'type':_0x5e38be[_0xc6bc('0x32')][_0xc6bc('0x33')]};});_0x4f995b[_0xc6bc('0x34')]=_['map'](_0x4365ff,'name');_0x4f995b['query']=_[_0xc6bc('0x35')](_0x187957['query']);_0x4f995b[_0xc6bc('0x36')]=_[_0xc6bc('0x37')](_0x4f995b[_0xc6bc('0x34')],_0x4f995b[_0xc6bc('0x38')]);_0x21b9f2[_0xc6bc('0x39')]=_[_0xc6bc('0x37')](_0x4f995b[_0xc6bc('0x34')],qs[_0xc6bc('0x3a')](_0x187957[_0xc6bc('0x38')][_0xc6bc('0x3a')]));_0x21b9f2[_0xc6bc('0x39')]=_0x21b9f2[_0xc6bc('0x39')]['length']?_0x21b9f2[_0xc6bc('0x39')]:_0x4f995b[_0xc6bc('0x34')];if(!_0x187957[_0xc6bc('0x38')][_0xc6bc('0x3b')](_0xc6bc('0x3c'))){_0x21b9f2[_0xc6bc('0x1e')]=qs[_0xc6bc('0x1e')](_0x187957[_0xc6bc('0x38')]['limit']);_0x21b9f2[_0xc6bc('0x1c')]=qs[_0xc6bc('0x1c')](_0x187957['query']['offset']);}_0x21b9f2[_0xc6bc('0x3d')]=qs[_0xc6bc('0x3e')](_0x187957[_0xc6bc('0x38')][_0xc6bc('0x3e')]);_0x21b9f2[_0xc6bc('0x3f')]=qs[_0xc6bc('0x36')](_[_0xc6bc('0x40')](_0x187957[_0xc6bc('0x38')],_0x4f995b[_0xc6bc('0x36')]),_0x4365ff);if(_0x187957[_0xc6bc('0x38')][_0xc6bc('0x41')]){_0x21b9f2['where']=_[_0xc6bc('0x42')](_0x21b9f2['where'],{'$or':_[_0xc6bc('0x2e')](_0x4365ff,function(_0x2438e9){if(_0x2438e9['type']!==_0xc6bc('0x43')){var _0x323ef5={};_0x323ef5[_0x2438e9[_0xc6bc('0x2c')]]={'$like':'%'+_0x187957[_0xc6bc('0x38')][_0xc6bc('0x41')]+'%'};return _0x323ef5;}})});}_0x21b9f2=_['merge']({},_0x21b9f2,_0x187957[_0xc6bc('0x44')]);var _0x8cd0ed={'where':_0x21b9f2[_0xc6bc('0x3f')]};return db[_0xc6bc('0x2f')][_0xc6bc('0x1f')](_0x8cd0ed)[_0xc6bc('0x26')](function(_0x5506e4){_0x5dae3c[_0xc6bc('0x1f')]=_0x5506e4;if(_0x187957['query']['includeAll']){_0x21b9f2[_0xc6bc('0x45')]=[{'all':!![]}];}return db[_0xc6bc('0x2f')]['findAll'](_0x21b9f2);})[_0xc6bc('0x26')](function(_0x2382d5){_0x5dae3c[_0xc6bc('0x46')]=_0x2382d5;return _0x5dae3c;})[_0xc6bc('0x26')](respondWithFilteredResult(_0x120619,_0x21b9f2))['catch'](handleError(_0x120619,null));};exports[_0xc6bc('0x47')]=function(_0x2153a8,_0x1aaa11){var _0x2aecc5={'raw':!![],'where':{'id':_0x2153a8['params']['id']}},_0x33d630={};_0x33d630[_0xc6bc('0x34')]=_[_0xc6bc('0x35')](db[_0xc6bc('0x2f')][_0xc6bc('0x30')]);_0x33d630[_0xc6bc('0x38')]=_[_0xc6bc('0x35')](_0x2153a8[_0xc6bc('0x38')]);_0x33d630[_0xc6bc('0x36')]=_[_0xc6bc('0x37')](_0x33d630[_0xc6bc('0x34')],_0x33d630['query']);_0x2aecc5[_0xc6bc('0x39')]=_[_0xc6bc('0x37')](_0x33d630[_0xc6bc('0x34')],qs[_0xc6bc('0x3a')](_0x2153a8[_0xc6bc('0x38')][_0xc6bc('0x3a')]));_0x2aecc5[_0xc6bc('0x39')]=_0x2aecc5[_0xc6bc('0x39')][_0xc6bc('0x48')]?_0x2aecc5[_0xc6bc('0x39')]:_0x33d630[_0xc6bc('0x34')];if(_0x2153a8[_0xc6bc('0x38')][_0xc6bc('0x49')]){_0x2aecc5['include']=[{'all':!![]}];}_0x2aecc5=_[_0xc6bc('0x42')]({},_0x2aecc5,_0x2153a8[_0xc6bc('0x44')]);return db[_0xc6bc('0x2f')][_0xc6bc('0x4a')](_0x2aecc5)[_0xc6bc('0x26')](handleEntityNotFound(_0x1aaa11,null))[_0xc6bc('0x26')](respondWithResult(_0x1aaa11,null))[_0xc6bc('0x4b')](handleError(_0x1aaa11,null));};exports['create']=function(_0x35c724,_0x474f91){return db[_0xc6bc('0x2f')]['create'](_0x35c724[_0xc6bc('0x4c')],{})['then'](respondWithResult(_0x474f91,0xc9))['catch'](handleError(_0x474f91,null));};exports['update']=function(_0x3148f4,_0x3ad313){if(_0x3148f4[_0xc6bc('0x4c')]['id']){delete _0x3148f4[_0xc6bc('0x4c')]['id'];}return db[_0xc6bc('0x2f')][_0xc6bc('0x4a')]({'where':{'id':_0x3148f4[_0xc6bc('0x4d')]['id']}})[_0xc6bc('0x26')](handleEntityNotFound(_0x3ad313,null))['then'](saveUpdates(_0x3148f4[_0xc6bc('0x4c')],null))[_0xc6bc('0x26')](respondWithResult(_0x3ad313,null))[_0xc6bc('0x4b')](handleError(_0x3ad313,null));};exports[_0xc6bc('0x27')]=function(_0xd41feb,_0x273bc4){return db[_0xc6bc('0x2f')][_0xc6bc('0x4a')]({'where':{'id':_0xd41feb[_0xc6bc('0x4d')]['id']}})[_0xc6bc('0x26')](handleEntityNotFound(_0x273bc4,null))['then'](removeEntity(_0x273bc4,null))[_0xc6bc('0x4b')](handleError(_0x273bc4,null));};exports[_0xc6bc('0x4e')]=function(_0x1dbf76,_0x29572c){return db[_0xc6bc('0x2f')]['describe']()['then'](respondWithResult(_0x29572c,null))[_0xc6bc('0x4b')](handleError(_0x29572c,null));};
\ No newline at end of file
+var _0x208f=['../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api'];(function(_0x4e005f,_0x3cf4ac){var _0x439682=function(_0x11f8df){while(--_0x11f8df){_0x4e005f['push'](_0x4e005f['shift']());}};_0x439682(++_0x3cf4ac);}(_0x208f,0x1ad));var _0xf208=function(_0x1ac728,_0x4aff0d){_0x1ac728=_0x1ac728-0x0;var _0x503bd7=_0x208f[_0x1ac728];return _0x503bd7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf208('0x0'));var zipdir=require(_0xf208('0x1'));var jsonpatch=require(_0xf208('0x2'));var rp=require(_0xf208('0x3'));var moment=require('moment');var BPromise=require(_0xf208('0x4'));var Mustache=require(_0xf208('0x5'));var util=require(_0xf208('0x6'));var path=require(_0xf208('0x7'));var sox=require('sox');var csv=require(_0xf208('0x8'));var ejs=require(_0xf208('0x9'));var fs=require('fs');var fs_extra=require(_0xf208('0xa'));var _=require(_0xf208('0xb'));var squel=require('squel');var crypto=require(_0xf208('0xc'));var jsforce=require(_0xf208('0xd'));var deskjs=require(_0xf208('0xe'));var toCsv=require(_0xf208('0x8'));var querystring=require(_0xf208('0xf'));var Papa=require('papaparse');var Redis=require(_0xf208('0x10'));var authService=require(_0xf208('0x11'));var qs=require(_0xf208('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf208('0x13'))(_0xf208('0x14'));var utils=require(_0xf208('0x15'));var config=require(_0xf208('0x16'));var licenseUtil=require(_0xf208('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c86fe,_0x3eeb2e){_0x3eeb2e=_0x3eeb2e||0xcc;return function(_0x2da0a5){if(_0x2da0a5){return _0x3c86fe['sendStatus'](_0x3eeb2e);}return _0x3c86fe['status'](_0x3eeb2e)['end']();};}function respondWithResult(_0x5afc55,_0x55bfd0){_0x55bfd0=_0x55bfd0||0xc8;return function(_0x498e83){if(_0x498e83){return _0x5afc55[_0xf208('0x18')](_0x55bfd0)[_0xf208('0x19')](_0x498e83);}};}function respondWithFilteredResult(_0x4d8cf1,_0x43ee49){return function(_0x198732){if(_0x198732){var _0x15200b=typeof _0x43ee49[_0xf208('0x1a')]===_0xf208('0x1b')&&typeof _0x43ee49['limit']===_0xf208('0x1b');var _0x3bf54e=_0x198732[_0xf208('0x1c')];var _0x2df2b8=_0x15200b?0x0:_0x43ee49['offset'];var _0x4a2e87=_0x15200b?_0x198732[_0xf208('0x1c')]:_0x43ee49[_0xf208('0x1a')]+_0x43ee49[_0xf208('0x1d')];var _0x34c02c;if(_0x4a2e87>=_0x3bf54e){_0x4a2e87=_0x3bf54e;_0x34c02c=0xc8;}else{_0x34c02c=0xce;}_0x4d8cf1['status'](_0x34c02c);return _0x4d8cf1[_0xf208('0x1e')](_0xf208('0x1f'),_0x2df2b8+'-'+_0x4a2e87+'/'+_0x3bf54e)['json'](_0x198732);}return null;};}function patchUpdates(_0x28fe76){return function(_0x2ecab1){try{jsonpatch[_0xf208('0x20')](_0x2ecab1,_0x28fe76,!![]);}catch(_0x1e1e0a){return BPromise['reject'](_0x1e1e0a);}return _0x2ecab1[_0xf208('0x21')]();};}function saveUpdates(_0x36e9a1,_0x57c0b0){return function(_0x55c92a){if(_0x55c92a){return _0x55c92a[_0xf208('0x22')](_0x36e9a1)[_0xf208('0x23')](function(_0x429a93){return _0x429a93;});}return null;};}function removeEntity(_0x4dc40d,_0x1a9554){return function(_0x13dc6d){if(_0x13dc6d){return _0x13dc6d[_0xf208('0x24')]()[_0xf208('0x23')](function(){_0x4dc40d['status'](0xcc)[_0xf208('0x25')]();});}};}function handleEntityNotFound(_0x1d98a6,_0x190040){return function(_0x11f980){if(!_0x11f980){_0x1d98a6[_0xf208('0x26')](0x194);}return _0x11f980;};}function handleError(_0x1bab40,_0x420bdd){_0x420bdd=_0x420bdd||0x1f4;return function(_0x3136b3){logger[_0xf208('0x27')](_0x3136b3[_0xf208('0x28')]);if(_0x3136b3['name']){delete _0x3136b3[_0xf208('0x29')];}_0x1bab40['status'](_0x420bdd)[_0xf208('0x2a')](_0x3136b3);};}exports[_0xf208('0x2b')]=function(_0x810643,_0x30db8b){var _0x45a134={},_0x1132b2={},_0x168bd5={'count':0x0,'rows':[]};var _0x2210da=_[_0xf208('0x2c')](db['FaxTransferReport'][_0xf208('0x2d')],function(_0x556c0a){return{'name':_0x556c0a['fieldName'],'type':_0x556c0a[_0xf208('0x2e')]['key']};});_0x1132b2[_0xf208('0x2f')]=_['map'](_0x2210da,_0xf208('0x29'));_0x1132b2[_0xf208('0x30')]=_[_0xf208('0x31')](_0x810643['query']);_0x1132b2[_0xf208('0x32')]=_[_0xf208('0x33')](_0x1132b2['model'],_0x1132b2[_0xf208('0x30')]);_0x45a134[_0xf208('0x34')]=_[_0xf208('0x33')](_0x1132b2[_0xf208('0x2f')],qs['fields'](_0x810643[_0xf208('0x30')][_0xf208('0x35')]));_0x45a134[_0xf208('0x34')]=_0x45a134[_0xf208('0x34')][_0xf208('0x36')]?_0x45a134[_0xf208('0x34')]:_0x1132b2[_0xf208('0x2f')];if(!_0x810643[_0xf208('0x30')]['hasOwnProperty'](_0xf208('0x37'))){_0x45a134[_0xf208('0x1d')]=qs[_0xf208('0x1d')](_0x810643['query'][_0xf208('0x1d')]);_0x45a134[_0xf208('0x1a')]=qs[_0xf208('0x1a')](_0x810643[_0xf208('0x30')][_0xf208('0x1a')]);}_0x45a134[_0xf208('0x38')]=qs[_0xf208('0x39')](_0x810643['query'][_0xf208('0x39')]);_0x45a134['where']=qs[_0xf208('0x32')](_['pick'](_0x810643[_0xf208('0x30')],_0x1132b2['filters']),_0x2210da);if(_0x810643[_0xf208('0x30')][_0xf208('0x3a')]){_0x45a134[_0xf208('0x3b')]=_[_0xf208('0x3c')](_0x45a134[_0xf208('0x3b')],{'$or':_[_0xf208('0x2c')](_0x2210da,function(_0x3df8b6){if(_0x3df8b6[_0xf208('0x2e')]!==_0xf208('0x3d')){var _0x13beab={};_0x13beab[_0x3df8b6[_0xf208('0x29')]]={'$like':'%'+_0x810643[_0xf208('0x30')][_0xf208('0x3a')]+'%'};return _0x13beab;}})});}_0x45a134=_[_0xf208('0x3c')]({},_0x45a134,_0x810643[_0xf208('0x3e')]);var _0x17831e={'where':_0x45a134[_0xf208('0x3b')]};return db[_0xf208('0x3f')][_0xf208('0x1c')](_0x17831e)[_0xf208('0x23')](function(_0x3db8a5){_0x168bd5[_0xf208('0x1c')]=_0x3db8a5;if(_0x810643[_0xf208('0x30')][_0xf208('0x40')]){_0x45a134[_0xf208('0x41')]=[{'all':!![]}];}return db['FaxTransferReport'][_0xf208('0x42')](_0x45a134);})[_0xf208('0x23')](function(_0x49f3c9){_0x168bd5[_0xf208('0x43')]=_0x49f3c9;return _0x168bd5;})[_0xf208('0x23')](respondWithFilteredResult(_0x30db8b,_0x45a134))[_0xf208('0x44')](handleError(_0x30db8b,null));};exports[_0xf208('0x45')]=function(_0x42edb5,_0x437b5f){var _0x335724={'raw':!![],'where':{'id':_0x42edb5[_0xf208('0x46')]['id']}},_0x4df1d4={};_0x4df1d4[_0xf208('0x2f')]=_[_0xf208('0x31')](db[_0xf208('0x3f')][_0xf208('0x2d')]);_0x4df1d4[_0xf208('0x30')]=_[_0xf208('0x31')](_0x42edb5['query']);_0x4df1d4['filters']=_[_0xf208('0x33')](_0x4df1d4[_0xf208('0x2f')],_0x4df1d4['query']);_0x335724[_0xf208('0x34')]=_[_0xf208('0x33')](_0x4df1d4[_0xf208('0x2f')],qs[_0xf208('0x35')](_0x42edb5[_0xf208('0x30')]['fields']));_0x335724[_0xf208('0x34')]=_0x335724['attributes']['length']?_0x335724[_0xf208('0x34')]:_0x4df1d4[_0xf208('0x2f')];if(_0x42edb5[_0xf208('0x30')][_0xf208('0x40')]){_0x335724['include']=[{'all':!![]}];}_0x335724=_[_0xf208('0x3c')]({},_0x335724,_0x42edb5[_0xf208('0x3e')]);return db[_0xf208('0x3f')][_0xf208('0x47')](_0x335724)['then'](handleEntityNotFound(_0x437b5f,null))['then'](respondWithResult(_0x437b5f,null))[_0xf208('0x44')](handleError(_0x437b5f,null));};exports[_0xf208('0x48')]=function(_0x156b95,_0x3c3a23){return db[_0xf208('0x3f')][_0xf208('0x48')](_0x156b95[_0xf208('0x49')],{})[_0xf208('0x23')](respondWithResult(_0x3c3a23,0xc9))[_0xf208('0x44')](handleError(_0x3c3a23,null));};exports['update']=function(_0x5ea8aa,_0x3b8bc3){if(_0x5ea8aa[_0xf208('0x49')]['id']){delete _0x5ea8aa[_0xf208('0x49')]['id'];}return db[_0xf208('0x3f')][_0xf208('0x47')]({'where':{'id':_0x5ea8aa['params']['id']}})[_0xf208('0x23')](handleEntityNotFound(_0x3b8bc3,null))[_0xf208('0x23')](saveUpdates(_0x5ea8aa[_0xf208('0x49')],null))[_0xf208('0x23')](respondWithResult(_0x3b8bc3,null))['catch'](handleError(_0x3b8bc3,null));};exports[_0xf208('0x24')]=function(_0x3e103d,_0x45528f){return db[_0xf208('0x3f')]['find']({'where':{'id':_0x3e103d['params']['id']}})[_0xf208('0x23')](handleEntityNotFound(_0x45528f,null))[_0xf208('0x23')](removeEntity(_0x45528f,null))[_0xf208('0x44')](handleError(_0x45528f,null));};exports[_0xf208('0x4a')]=function(_0x5a2362,_0x4d8caf){return db[_0xf208('0x3f')][_0xf208('0x4a')]()[_0xf208('0x23')](respondWithResult(_0x4d8caf,null))['catch'](handleError(_0x4d8caf,null));};
\ No newline at end of file
index 0c5077d..0e35d72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20df=['path','rimraf','../../config/environment','exports','define','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4ae6ca,_0xc64c63){var _0x7e2d28=function(_0x117565){while(--_0x117565){_0x4ae6ca['push'](_0x4ae6ca['shift']());}};_0x7e2d28(++_0xc64c63);}(_0x20df,0x7c));var _0xf20d=function(_0x29c3b2,_0x3c12ac){_0x29c3b2=_0x29c3b2-0x0;var _0x4b3aa7=_0x20df[_0x29c3b2];return _0x4b3aa7;};'use strict';var _=require(_0xf20d('0x0'));var util=require(_0xf20d('0x1'));var logger=require(_0xf20d('0x2'))(_0xf20d('0x3'));var moment=require('moment');var BPromise=require(_0xf20d('0x4'));var rp=require(_0xf20d('0x5'));var fs=require('fs');var path=require(_0xf20d('0x6'));var rimraf=require(_0xf20d('0x7'));var config=require(_0xf20d('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0xf20d('0x9')]=function(_0x48d4f2,_0x397065){return _0x48d4f2[_0xf20d('0xa')]('FaxTransferReport',attributes,{'tableName':_0xf20d('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xf20d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc48e=['../../config/environment','./faxTransferReport.attributes','exports','report_fax_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','rimraf'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0xc48e,0xd7));var _0xec48=function(_0x52fb4e,_0x46d5c1){_0x52fb4e=_0x52fb4e-0x0;var _0x442197=_0xc48e[_0x52fb4e];return _0x442197;};'use strict';var _=require(_0xec48('0x0'));var util=require('util');var logger=require(_0xec48('0x1'))('api');var moment=require(_0xec48('0x2'));var BPromise=require(_0xec48('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec48('0x4'));var config=require(_0xec48('0x5'));var attributes=require(_0xec48('0x6'));module[_0xec48('0x7')]=function(_0x1e369f,_0x10e11f){return _0x1e369f['define']('FaxTransferReport',attributes,{'tableName':_0xec48('0x8'),'paranoid':![],'indexes':[{'name':_0xec48('0x9'),'fields':[_0xec48('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 6947afa..16447c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1baf=['catch','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x15e950,_0x1db756){var _0x3425e5=function(_0x1fa0f4){while(--_0x1fa0f4){_0x15e950['push'](_0x15e950['shift']());}};_0x3425e5(++_0x1db756);}(_0x1baf,0xc9));var _0xf1ba=function(_0x3547df,_0x19a3e6){_0x3547df=_0x3547df-0x0;var _0xb68a29=_0x1baf[_0x3547df];return _0xb68a29;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf1ba('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf1ba('0x1'))['db'];var utils=require(_0xf1ba('0x2'));var logger=require(_0xf1ba('0x3'))(_0xf1ba('0x4'));var config=require(_0xf1ba('0x5'));var jayson=require(_0xf1ba('0x6'));var client=jayson[_0xf1ba('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d25ca,_0x34b12d,_0x4fc492){return new BPromise(function(_0x5a3740,_0x1c4578){return client[_0xf1ba('0x8')](_0x5d25ca,_0x4fc492)[_0xf1ba('0x9')](function(_0x58c098){logger[_0xf1ba('0xa')](_0xf1ba('0xb'),_0x34b12d,_0xf1ba('0xc'));logger[_0xf1ba('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x34b12d,_0xf1ba('0xc'),JSON[_0xf1ba('0xe')](_0x58c098));if(_0x58c098['error']){if(_0x58c098[_0xf1ba('0xf')][_0xf1ba('0x10')]===0x1f4){logger[_0xf1ba('0xf')](_0xf1ba('0xb'),_0x34b12d,_0x58c098[_0xf1ba('0xf')][_0xf1ba('0x11')]);return _0x1c4578(_0x58c098[_0xf1ba('0xf')][_0xf1ba('0x11')]);}logger[_0xf1ba('0xf')](_0xf1ba('0xb'),_0x34b12d,_0x58c098[_0xf1ba('0xf')][_0xf1ba('0x11')]);return _0x5a3740(_0x58c098[_0xf1ba('0xf')][_0xf1ba('0x11')]);}else{logger[_0xf1ba('0xa')](_0xf1ba('0xb'),_0x34b12d,_0xf1ba('0xc'));_0x5a3740(_0x58c098[_0xf1ba('0x12')][_0xf1ba('0x11')]);}})[_0xf1ba('0x13')](function(_0x14b989){logger[_0xf1ba('0xf')](_0xf1ba('0xb'),_0x34b12d,_0x14b989);_0x1c4578(_0x14b989);});});}
\ No newline at end of file
+var _0x0c1f=['client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4b7bc0,_0x49a7f8){var _0x274223=function(_0x4c2bbb){while(--_0x4c2bbb){_0x4b7bc0['push'](_0x4b7bc0['shift']());}};_0x274223(++_0x49a7f8);}(_0x0c1f,0x176));var _0xf0c1=function(_0x2ddd52,_0x4e3b17){_0x2ddd52=_0x2ddd52-0x0;var _0x4bb4ec=_0x0c1f[_0x2ddd52];return _0x4bb4ec;};'use strict';var _=require(_0xf0c1('0x0'));var util=require(_0xf0c1('0x1'));var moment=require('moment');var BPromise=require(_0xf0c1('0x2'));var rs=require(_0xf0c1('0x3'));var fs=require('fs');var Redis=require(_0xf0c1('0x4'));var db=require(_0xf0c1('0x5'))['db'];var utils=require(_0xf0c1('0x6'));var logger=require(_0xf0c1('0x7'))(_0xf0c1('0x8'));var config=require('../../config/environment');var jayson=require(_0xf0c1('0x9'));var client=jayson[_0xf0c1('0xa')][_0xf0c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f97de,_0x570c49,_0xd7f963){return new BPromise(function(_0x465c20,_0x5edcd7){return client[_0xf0c1('0xc')](_0x1f97de,_0xd7f963)[_0xf0c1('0xd')](function(_0x14a6c4){logger[_0xf0c1('0xe')](_0xf0c1('0xf'),_0x570c49,_0xf0c1('0x10'));logger['debug'](_0xf0c1('0x11'),_0x570c49,_0xf0c1('0x10'),JSON[_0xf0c1('0x12')](_0x14a6c4));if(_0x14a6c4[_0xf0c1('0x13')]){if(_0x14a6c4[_0xf0c1('0x13')][_0xf0c1('0x14')]===0x1f4){logger[_0xf0c1('0x13')](_0xf0c1('0xf'),_0x570c49,_0x14a6c4['error'][_0xf0c1('0x15')]);return _0x5edcd7(_0x14a6c4['error'][_0xf0c1('0x15')]);}logger['error'](_0xf0c1('0xf'),_0x570c49,_0x14a6c4[_0xf0c1('0x13')]['message']);return _0x465c20(_0x14a6c4[_0xf0c1('0x13')][_0xf0c1('0x15')]);}else{logger[_0xf0c1('0xe')](_0xf0c1('0xf'),_0x570c49,'request\x20sent');_0x465c20(_0x14a6c4[_0xf0c1('0x16')][_0xf0c1('0x15')]);}})[_0xf0c1('0x17')](function(_0xcc3516){logger[_0xf0c1('0x13')]('FaxTransferReport,\x20%s,\x20%s',_0x570c49,_0xcc3516);_0x5edcd7(_0xcc3516);});});}
\ No newline at end of file
index cea6836..7c1211c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e17=['get','isAuthenticated','index','/describe','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller'];(function(_0x3dcbd0,_0x48b7ad){var _0x2ae829=function(_0x4bfc24){while(--_0x4bfc24){_0x3dcbd0['push'](_0x3dcbd0['shift']());}};_0x2ae829(++_0x48b7ad);}(_0x4e17,0x156));var _0x74e1=function(_0x404de6,_0x55ba0c){_0x404de6=_0x404de6-0x0;var _0x12cf56=_0x4e17[_0x404de6];return _0x12cf56;};'use strict';var multer=require(_0x74e1('0x0'));var util=require(_0x74e1('0x1'));var path=require(_0x74e1('0x2'));var timeout=require('connect-timeout');var express=require(_0x74e1('0x3'));var router=express[_0x74e1('0x4')]();var fs_extra=require(_0x74e1('0x5'));var auth=require(_0x74e1('0x6'));var interaction=require(_0x74e1('0x7'));var config=require(_0x74e1('0x8'));var controller=require(_0x74e1('0x9'));router[_0x74e1('0xa')]('/',auth[_0x74e1('0xb')](),controller[_0x74e1('0xc')]);router['get'](_0x74e1('0xd'),auth[_0x74e1('0xb')](),controller[_0x74e1('0xe')]);router[_0x74e1('0xa')](_0x74e1('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x74e1('0x10')]('/',auth[_0x74e1('0xb')](),controller[_0x74e1('0x11')]);router['put']('/:id',auth[_0x74e1('0xb')](),controller[_0x74e1('0x12')]);router[_0x74e1('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x74e1('0x14')]);module[_0x74e1('0x15')]=router;
\ No newline at end of file
+var _0xb7b6=['./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4f2f5c,_0x5a3f1a){var _0x22b549=function(_0x532149){while(--_0x532149){_0x4f2f5c['push'](_0x4f2f5c['shift']());}};_0x22b549(++_0x5a3f1a);}(_0xb7b6,0x1b1));var _0x6b7b=function(_0x641ab,_0x13e9f0){_0x641ab=_0x641ab-0x0;var _0x5a554e=_0xb7b6[_0x641ab];return _0x5a554e;};'use strict';var multer=require(_0x6b7b('0x0'));var util=require('util');var path=require(_0x6b7b('0x1'));var timeout=require(_0x6b7b('0x2'));var express=require('express');var router=express[_0x6b7b('0x3')]();var fs_extra=require(_0x6b7b('0x4'));var auth=require(_0x6b7b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6b7b('0x6'));var controller=require(_0x6b7b('0x7'));router[_0x6b7b('0x8')]('/',auth[_0x6b7b('0x9')](),controller[_0x6b7b('0xa')]);router[_0x6b7b('0x8')](_0x6b7b('0xb'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0xc')]);router['get'](_0x6b7b('0xd'),auth['isAuthenticated'](),controller[_0x6b7b('0xe')]);router[_0x6b7b('0xf')]('/',auth['isAuthenticated'](),controller[_0x6b7b('0x10')]);router[_0x6b7b('0x11')](_0x6b7b('0xd'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0x12')]);router[_0x6b7b('0x13')](_0x6b7b('0xd'),auth[_0x6b7b('0x9')](),controller[_0x6b7b('0x14')]);module[_0x6b7b('0x15')]=router;
\ No newline at end of file
index b4b9b2d..10ef316 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeac7=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put'];(function(_0x338420,_0x5aa14b){var _0x30abc2=function(_0x47b3f6){while(--_0x47b3f6){_0x338420['push'](_0x338420['shift']());}};_0x30abc2(++_0x5aa14b);}(_0xeac7,0x169));var _0x7eac=function(_0x5997e2,_0xb6c57){_0x5997e2=_0x5997e2-0x0;var _0x3b46ef=_0xeac7[_0x5997e2];return _0x3b46ef;};'use strict';var multer=require(_0x7eac('0x0'));var util=require(_0x7eac('0x1'));var path=require(_0x7eac('0x2'));var timeout=require(_0x7eac('0x3'));var express=require('express');var router=express[_0x7eac('0x4')]();var fs_extra=require(_0x7eac('0x5'));var auth=require(_0x7eac('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7eac('0x7'));var controller=require(_0x7eac('0x8'));router['get']('/',auth[_0x7eac('0x9')](),controller['index']);router[_0x7eac('0xa')](_0x7eac('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x7eac('0xa')](_0x7eac('0xc'),auth[_0x7eac('0x9')](),controller[_0x7eac('0xd')]);router[_0x7eac('0xa')](_0x7eac('0xe'),auth['isAuthenticated'](),controller[_0x7eac('0xf')]);router[_0x7eac('0x10')]('/',auth[_0x7eac('0x9')](),controller['create']);router[_0x7eac('0x10')](_0x7eac('0xc'),auth[_0x7eac('0x9')](),controller[_0x7eac('0x11')]);router[_0x7eac('0x12')](_0x7eac('0xb'),auth[_0x7eac('0x9')](),controller['update']);router['delete'](_0x7eac('0xb'),auth[_0x7eac('0x9')](),controller['destroy']);module[_0x7eac('0x13')]=router;
\ No newline at end of file
+var _0x1da1=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','util'];(function(_0x421738,_0x4863c8){var _0xc44c82=function(_0x166d96){while(--_0x166d96){_0x421738['push'](_0x421738['shift']());}};_0xc44c82(++_0x4863c8);}(_0x1da1,0x1df));var _0x11da=function(_0x213e71,_0x4ea1c0){_0x213e71=_0x213e71-0x0;var _0x367e94=_0x1da1[_0x213e71];return _0x367e94;};'use strict';var multer=require('multer');var util=require(_0x11da('0x0'));var path=require(_0x11da('0x1'));var timeout=require(_0x11da('0x2'));var express=require('express');var router=express[_0x11da('0x3')]();var fs_extra=require(_0x11da('0x4'));var auth=require(_0x11da('0x5'));var interaction=require(_0x11da('0x6'));var config=require('../../config/environment');var controller=require(_0x11da('0x7'));router[_0x11da('0x8')]('/',auth[_0x11da('0x9')](),controller[_0x11da('0xa')]);router[_0x11da('0x8')](_0x11da('0xb'),auth['isAuthenticated'](),controller[_0x11da('0xc')]);router[_0x11da('0x8')](_0x11da('0xd'),auth['isAuthenticated'](),controller[_0x11da('0xe')]);router[_0x11da('0x8')](_0x11da('0xf'),auth[_0x11da('0x9')](),controller[_0x11da('0x10')]);router[_0x11da('0x11')]('/',auth[_0x11da('0x9')](),controller[_0x11da('0x12')]);router[_0x11da('0x11')]('/:id/configurations',auth[_0x11da('0x9')](),controller[_0x11da('0x13')]);router[_0x11da('0x14')](_0x11da('0xb'),auth[_0x11da('0x9')](),controller[_0x11da('0x15')]);router[_0x11da('0x16')](_0x11da('0xb'),auth[_0x11da('0x9')](),controller['destroy']);module[_0x11da('0x17')]=router;
\ No newline at end of file
index 94e360a..33caff7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc67=['exports','STRING','ENUM','basic','newTab','sequelize'];(function(_0x5a8832,_0x9e1cf){var _0x3b0668=function(_0x4735c1){while(--_0x4735c1){_0x5a8832['push'](_0x5a8832['shift']());}};_0x3b0668(++_0x9e1cf);}(_0xdc67,0x1f1));var _0x7dc6=function(_0x1f4b18,_0x4e777c){_0x1f4b18=_0x1f4b18-0x0;var _0xde3957=_0xdc67[_0x1f4b18];return _0xde3957;};'use strict';var Sequelize=require(_0x7dc6('0x0'));module[_0x7dc6('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7dc6('0x2')]},'remoteUri':{'type':Sequelize[_0x7dc6('0x2')]},'authType':{'type':Sequelize[_0x7dc6('0x3')]('basic'),'defaultValue':_0x7dc6('0x4')},'password':{'type':Sequelize[_0x7dc6('0x2')]},'consumerKey':{'type':Sequelize[_0x7dc6('0x2')]},'consumerSecret':{'type':Sequelize[_0x7dc6('0x2')]},'token':{'type':Sequelize[_0x7dc6('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x7dc6('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7dc6('0x3')]('integrationTab',_0x7dc6('0x5')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0x5e3c=['ENUM','basic','integrationTab','sequelize','exports','STRING'];(function(_0x455ee1,_0x43b4f4){var _0x2097aa=function(_0x5b3e4e){while(--_0x5b3e4e){_0x455ee1['push'](_0x455ee1['shift']());}};_0x2097aa(++_0x43b4f4);}(_0x5e3c,0x93));var _0xc5e3=function(_0x2981e2,_0x54d6aa){_0x2981e2=_0x2981e2-0x0;var _0x2406b1=_0x5e3c[_0x2981e2];return _0x2406b1;};'use strict';var Sequelize=require(_0xc5e3('0x0'));module[_0xc5e3('0x1')]={'name':{'type':Sequelize[_0xc5e3('0x2')]},'description':{'type':Sequelize[_0xc5e3('0x2')]},'username':{'type':Sequelize[_0xc5e3('0x2')]},'remoteUri':{'type':Sequelize[_0xc5e3('0x2')]},'authType':{'type':Sequelize[_0xc5e3('0x3')](_0xc5e3('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0xc5e3('0x2')]},'consumerKey':{'type':Sequelize[_0xc5e3('0x2')]},'consumerSecret':{'type':Sequelize[_0xc5e3('0x2')]},'token':{'type':Sequelize[_0xc5e3('0x2')]},'tokenSecret':{'type':Sequelize[_0xc5e3('0x2')]},'serverUrl':{'type':Sequelize[_0xc5e3('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xc5e3('0x3')](_0xc5e3('0x5'),'newTab'),'defaultValue':_0xc5e3('0x5')}};
\ No newline at end of file
index be5aa78..8a51143 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b8b=['undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','DeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','include','rows','catch','params','find','create','body','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','DeskField','getFields','priority','authType','password','consumerSecret','tokenSecret','remoteUri','substring','GET','%s/custom_fields','application/json','headers','format','Basic\x20%s','%s:%s','base64','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end'];(function(_0x119d4d,_0xb678ff){var _0x4f21d0=function(_0x1e4fc0){while(--_0x1e4fc0){_0x119d4d['push'](_0x119d4d['shift']());}};_0x4f21d0(++_0xb678ff);}(_0x9b8b,0xbe));var _0xb9b8=function(_0x4d201c,_0x394e9d){_0x4d201c=_0x4d201c-0x0;var _0x5e3d28=_0x9b8b[_0x4d201c];return _0x5e3d28;};'use strict';var emlformat=require(_0xb9b8('0x0'));var rimraf=require(_0xb9b8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb9b8('0x2'));var rp=require('request-promise');var moment=require(_0xb9b8('0x3'));var BPromise=require(_0xb9b8('0x4'));var Mustache=require(_0xb9b8('0x5'));var util=require(_0xb9b8('0x6'));var path=require(_0xb9b8('0x7'));var sox=require(_0xb9b8('0x8'));var csv=require(_0xb9b8('0x9'));var ejs=require(_0xb9b8('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9b8('0xb'));var squel=require(_0xb9b8('0xc'));var crypto=require(_0xb9b8('0xd'));var jsforce=require(_0xb9b8('0xe'));var deskjs=require(_0xb9b8('0xf'));var toCsv=require(_0xb9b8('0x9'));var querystring=require('querystring');var Papa=require(_0xb9b8('0x10'));var Redis=require(_0xb9b8('0x11'));var authService=require(_0xb9b8('0x12'));var qs=require(_0xb9b8('0x13'));var as=require(_0xb9b8('0x14'));var hardwareService=require(_0xb9b8('0x15'));var logger=require(_0xb9b8('0x16'))(_0xb9b8('0x17'));var utils=require('../../config/utils');var config=require(_0xb9b8('0x18'));var licenseUtil=require(_0xb9b8('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb9b8('0x1a'));function respondWithStatusCode(_0x1e4b0c,_0x48ef72){_0x48ef72=_0x48ef72||0xcc;return function(_0x42123b){if(_0x42123b){return _0x1e4b0c[_0xb9b8('0x1b')](_0x48ef72);}return _0x1e4b0c[_0xb9b8('0x1c')](_0x48ef72)[_0xb9b8('0x1d')]();};}function respondWithResult(_0x143c2a,_0xc9aac8){_0xc9aac8=_0xc9aac8||0xc8;return function(_0xa0bf6e){if(_0xa0bf6e){return _0x143c2a[_0xb9b8('0x1c')](_0xc9aac8)['json'](_0xa0bf6e);}};}function respondWithFilteredResult(_0x1ce2ad,_0x56ccd7){return function(_0x42c21b){if(_0x42c21b){var _0x4f68cb=typeof _0x56ccd7['offset']===_0xb9b8('0x1e')&&typeof _0x56ccd7[_0xb9b8('0x1f')]===_0xb9b8('0x1e');var _0x4e9d4d=_0x42c21b[_0xb9b8('0x20')];var _0x3f5ae7=_0x4f68cb?0x0:_0x56ccd7[_0xb9b8('0x21')];var _0x4727ae=_0x4f68cb?_0x42c21b[_0xb9b8('0x20')]:_0x56ccd7[_0xb9b8('0x21')]+_0x56ccd7[_0xb9b8('0x1f')];var _0x44a544;if(_0x4727ae>=_0x4e9d4d){_0x4727ae=_0x4e9d4d;_0x44a544=0xc8;}else{_0x44a544=0xce;}_0x1ce2ad[_0xb9b8('0x1c')](_0x44a544);return _0x1ce2ad[_0xb9b8('0x22')](_0xb9b8('0x23'),_0x3f5ae7+'-'+_0x4727ae+'/'+_0x4e9d4d)[_0xb9b8('0x24')](_0x42c21b);}return null;};}function patchUpdates(_0x3ccf2c){return function(_0x5c2789){try{jsonpatch[_0xb9b8('0x25')](_0x5c2789,_0x3ccf2c,!![]);}catch(_0x26e16b){return BPromise[_0xb9b8('0x26')](_0x26e16b);}return _0x5c2789[_0xb9b8('0x27')]();};}function saveUpdates(_0x31bdf7,_0x2e134d){return function(_0x37deff){if(_0x37deff){return _0x37deff[_0xb9b8('0x28')](_0x31bdf7)['then'](function(_0xaaa309){return _0xaaa309;});}return null;};}function removeEntity(_0x5aba23,_0x4740c1){return function(_0x1d1452){if(_0x1d1452){return _0x1d1452[_0xb9b8('0x29')]()[_0xb9b8('0x2a')](function(){_0x5aba23[_0xb9b8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e0c3b,_0xfabb49){return function(_0x5494ab){if(!_0x5494ab){_0x4e0c3b[_0xb9b8('0x1b')](0x194);}return _0x5494ab;};}function handleError(_0x2ec942,_0x25e339){_0x25e339=_0x25e339||0x1f4;return function(_0x42aab1){logger[_0xb9b8('0x2b')](_0x42aab1[_0xb9b8('0x2c')]);if(_0x42aab1[_0xb9b8('0x2d')]){delete _0x42aab1['name'];}_0x2ec942['status'](_0x25e339)['send'](_0x42aab1);};}exports[_0xb9b8('0x2e')]=function(_0x8500fb,_0x52f779){var _0x1488b3={},_0x32a095={},_0x5dc5ca={'count':0x0,'rows':[]};var _0x4c5175=_['map'](db[_0xb9b8('0x2f')][_0xb9b8('0x30')],function(_0x3a7438){return{'name':_0x3a7438[_0xb9b8('0x31')],'type':_0x3a7438[_0xb9b8('0x32')]['key']};});_0x32a095[_0xb9b8('0x33')]=_['map'](_0x4c5175,_0xb9b8('0x2d'));_0x32a095[_0xb9b8('0x34')]=_[_0xb9b8('0x35')](_0x8500fb['query']);_0x32a095[_0xb9b8('0x36')]=_[_0xb9b8('0x37')](_0x32a095[_0xb9b8('0x33')],_0x32a095['query']);_0x1488b3[_0xb9b8('0x38')]=_[_0xb9b8('0x37')](_0x32a095[_0xb9b8('0x33')],qs[_0xb9b8('0x39')](_0x8500fb[_0xb9b8('0x34')][_0xb9b8('0x39')]));_0x1488b3[_0xb9b8('0x38')]=_0x1488b3['attributes'][_0xb9b8('0x3a')]?_0x1488b3[_0xb9b8('0x38')]:_0x32a095[_0xb9b8('0x33')];if(!_0x8500fb[_0xb9b8('0x34')]['hasOwnProperty'](_0xb9b8('0x3b'))){_0x1488b3[_0xb9b8('0x1f')]=qs[_0xb9b8('0x1f')](_0x8500fb[_0xb9b8('0x34')]['limit']);_0x1488b3[_0xb9b8('0x21')]=qs[_0xb9b8('0x21')](_0x8500fb[_0xb9b8('0x34')][_0xb9b8('0x21')]);}_0x1488b3[_0xb9b8('0x3c')]=qs['sort'](_0x8500fb[_0xb9b8('0x34')][_0xb9b8('0x3d')]);_0x1488b3[_0xb9b8('0x3e')]=qs[_0xb9b8('0x36')](_[_0xb9b8('0x3f')](_0x8500fb[_0xb9b8('0x34')],_0x32a095['filters']),_0x4c5175);if(_0x8500fb['query'][_0xb9b8('0x40')]){_0x1488b3['where']=_[_0xb9b8('0x41')](_0x1488b3['where'],{'$or':_[_0xb9b8('0x42')](_0x4c5175,function(_0x59e8db){if(_0x59e8db['type']!==_0xb9b8('0x43')){var _0xe61506={};_0xe61506[_0x59e8db[_0xb9b8('0x2d')]]={'$like':'%'+_0x8500fb[_0xb9b8('0x34')]['filter']+'%'};return _0xe61506;}})});}_0x1488b3=_[_0xb9b8('0x41')]({},_0x1488b3,_0x8500fb[_0xb9b8('0x44')]);var _0xb83aeb={'where':_0x1488b3['where']};return db[_0xb9b8('0x2f')][_0xb9b8('0x20')](_0xb83aeb)[_0xb9b8('0x2a')](function(_0x3e5ef6){_0x5dc5ca[_0xb9b8('0x20')]=_0x3e5ef6;if(_0x8500fb[_0xb9b8('0x34')]['includeAll']){_0x1488b3[_0xb9b8('0x45')]=[{'all':!![]}];}return db[_0xb9b8('0x2f')]['findAll'](_0x1488b3);})[_0xb9b8('0x2a')](function(_0x25e557){_0x5dc5ca[_0xb9b8('0x46')]=_0x25e557;return _0x5dc5ca;})[_0xb9b8('0x2a')](respondWithFilteredResult(_0x52f779,_0x1488b3))[_0xb9b8('0x47')](handleError(_0x52f779,null));};exports['show']=function(_0x5c1328,_0x18c04b){var _0x274cb3={'raw':![],'where':{'id':_0x5c1328[_0xb9b8('0x48')]['id']}},_0x53a6e7={};_0x53a6e7['model']=_[_0xb9b8('0x35')](db[_0xb9b8('0x2f')]['rawAttributes']);_0x53a6e7[_0xb9b8('0x34')]=_[_0xb9b8('0x35')](_0x5c1328['query']);_0x53a6e7[_0xb9b8('0x36')]=_[_0xb9b8('0x37')](_0x53a6e7[_0xb9b8('0x33')],_0x53a6e7[_0xb9b8('0x34')]);_0x274cb3[_0xb9b8('0x38')]=_['intersection'](_0x53a6e7['model'],qs['fields'](_0x5c1328[_0xb9b8('0x34')][_0xb9b8('0x39')]));_0x274cb3[_0xb9b8('0x38')]=_0x274cb3['attributes']['length']?_0x274cb3['attributes']:_0x53a6e7[_0xb9b8('0x33')];if(_0x5c1328['query']['includeAll']){_0x274cb3['include']=[{'all':!![]}];}_0x274cb3=_[_0xb9b8('0x41')]({},_0x274cb3,_0x5c1328[_0xb9b8('0x44')]);return db[_0xb9b8('0x2f')][_0xb9b8('0x49')](_0x274cb3)[_0xb9b8('0x2a')](handleEntityNotFound(_0x18c04b,null))[_0xb9b8('0x2a')](respondWithResult(_0x18c04b,null))['catch'](handleError(_0x18c04b,null));};exports[_0xb9b8('0x4a')]=function(_0xdbe916,_0x4f3b98){return db[_0xb9b8('0x2f')][_0xb9b8('0x4a')](_0xdbe916[_0xb9b8('0x4b')],{})[_0xb9b8('0x2a')](respondWithResult(_0x4f3b98,0xc9))['catch'](handleError(_0x4f3b98,null));};exports[_0xb9b8('0x28')]=function(_0x3f4199,_0x3429ba){if(_0x3f4199[_0xb9b8('0x4b')]['id']){delete _0x3f4199[_0xb9b8('0x4b')]['id'];}return db['DeskAccount'][_0xb9b8('0x49')]({'where':{'id':_0x3f4199[_0xb9b8('0x48')]['id']}})[_0xb9b8('0x2a')](handleEntityNotFound(_0x3429ba,null))[_0xb9b8('0x2a')](saveUpdates(_0x3f4199['body'],null))['then'](respondWithResult(_0x3429ba,null))[_0xb9b8('0x47')](handleError(_0x3429ba,null));};exports[_0xb9b8('0x29')]=function(_0x5402b6,_0x29b474){return db['DeskAccount']['find']({'where':{'id':_0x5402b6[_0xb9b8('0x48')]['id']}})['then'](handleEntityNotFound(_0x29b474,null))[_0xb9b8('0x2a')](removeEntity(_0x29b474,null))['catch'](handleError(_0x29b474,null));};exports[_0xb9b8('0x4c')]=function(_0x11b3e5,_0x2d24b8,_0x2d8d41){var _0x36e777={};var _0x296c2f={};var _0x162c17;var _0x4a1572;return db[_0xb9b8('0x2f')][_0xb9b8('0x4d')]({'where':{'id':_0x11b3e5['params']['id']}})['then'](handleEntityNotFound(_0x2d24b8,null))[_0xb9b8('0x2a')](function(_0x1d6390){if(_0x1d6390){_0x162c17=_0x1d6390;_0x296c2f[_0xb9b8('0x33')]=_[_0xb9b8('0x35')](db[_0xb9b8('0x4e')][_0xb9b8('0x30')]);_0x296c2f[_0xb9b8('0x34')]=_[_0xb9b8('0x35')](_0x11b3e5[_0xb9b8('0x34')]);_0x296c2f['filters']=_[_0xb9b8('0x37')](_0x296c2f[_0xb9b8('0x33')],_0x296c2f[_0xb9b8('0x34')]);_0x36e777[_0xb9b8('0x38')]=_['intersection'](_0x296c2f[_0xb9b8('0x33')],qs[_0xb9b8('0x39')](_0x11b3e5[_0xb9b8('0x34')][_0xb9b8('0x39')]));_0x36e777[_0xb9b8('0x38')]=_0x36e777[_0xb9b8('0x38')]['length']?_0x36e777[_0xb9b8('0x38')]:_0x296c2f[_0xb9b8('0x33')];_0x36e777[_0xb9b8('0x3c')]=qs[_0xb9b8('0x3d')](_0x11b3e5[_0xb9b8('0x34')]['sort']);_0x36e777[_0xb9b8('0x3e')]=qs['filters'](_['pick'](_0x11b3e5[_0xb9b8('0x34')],_0x296c2f[_0xb9b8('0x36')]));if(_0x11b3e5[_0xb9b8('0x34')][_0xb9b8('0x40')]){_0x36e777['where']=_[_0xb9b8('0x41')](_0x36e777[_0xb9b8('0x3e')],{'$or':_['map'](_0x36e777[_0xb9b8('0x38')],function(_0x5bfaf2){var _0x1cd412={};_0x1cd412[_0x5bfaf2]={'$like':'%'+_0x11b3e5['query']['filter']+'%'};return _0x1cd412;})});}_0x36e777=_[_0xb9b8('0x41')]({},_0x36e777,_0x11b3e5[_0xb9b8('0x44')]);return _0x162c17['getConfigurations'](_0x36e777);}})[_0xb9b8('0x2a')](function(_0x2ddd36){if(_0x2ddd36){_0x4a1572=_0x2ddd36[_0xb9b8('0x3a')];if(!_0x11b3e5['query'][_0xb9b8('0x4f')](_0xb9b8('0x3b'))){_0x36e777[_0xb9b8('0x1f')]=qs[_0xb9b8('0x1f')](_0x11b3e5[_0xb9b8('0x34')]['limit']);_0x36e777[_0xb9b8('0x21')]=qs[_0xb9b8('0x21')](_0x11b3e5[_0xb9b8('0x34')]['offset']);}return _0x162c17[_0xb9b8('0x4c')](_0x36e777);}})['then'](function(_0x42dd2e){if(_0x42dd2e){return _0x42dd2e?{'count':_0x4a1572,'rows':_0x42dd2e}:null;}})[_0xb9b8('0x2a')](respondWithResult(_0x2d24b8,null))[_0xb9b8('0x47')](handleError(_0x2d24b8,null));};exports[_0xb9b8('0x50')]=function(_0x330b29,_0x543071,_0x11340f){if(_0x330b29['body']['id']){delete _0x330b29[_0xb9b8('0x4b')]['id'];}return db[_0xb9b8('0x2f')][_0xb9b8('0x4d')]({'where':{'id':_0x330b29[_0xb9b8('0x48')]['id']}})[_0xb9b8('0x2a')](handleEntityNotFound(_0x543071,null))['then'](function(_0x50b72a){if(_0x50b72a){_0x330b29[_0xb9b8('0x4b')][_0xb9b8('0x51')]=_0x50b72a['id'];_0x330b29[_0xb9b8('0x4b')][_0xb9b8('0x52')]=integrations[_0xb9b8('0x53')](_0x330b29[_0xb9b8('0x4b')]['channel'],_0x330b29[_0xb9b8('0x4b')][_0xb9b8('0x32')]);_0x330b29[_0xb9b8('0x4b')][_0xb9b8('0x54')]=integrations['getDescriptions'](_0x330b29[_0xb9b8('0x4b')][_0xb9b8('0x55')],_0x330b29[_0xb9b8('0x4b')][_0xb9b8('0x32')]);return db[_0xb9b8('0x4e')][_0xb9b8('0x4a')](_0x330b29[_0xb9b8('0x4b')],{'include':[{'model':db[_0xb9b8('0x56')],'as':_0xb9b8('0x52')},{'model':db[_0xb9b8('0x56')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x543071,null))[_0xb9b8('0x47')](handleError(_0x543071,null));};exports[_0xb9b8('0x57')]=function(_0x25d950,_0x2c38fd,_0x516872){var _0x3ba90f=[{'name':_0xb9b8('0x58'),'label':'priority','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 _0xd88be6='';return db[_0xb9b8('0x2f')][_0xb9b8('0x4d')]({'where':{'id':_0x25d950['params']['id']},'attributes':['id','remoteUri',_0xb9b8('0x59'),'username',_0xb9b8('0x5a'),'consumerKey',_0xb9b8('0x5b'),'token',_0xb9b8('0x5c')]})[_0xb9b8('0x2a')](handleEntityNotFound(_0x2c38fd,null))[_0xb9b8('0x2a')](function(_0x5d5591){if(_0x5d5591){_0xd88be6=_0x5d5591[_0xb9b8('0x5d')];var _0x3dc737=_0xd88be6['slice'](-0x1);if(_0x3dc737==='/'){_0xd88be6=_0xd88be6[_0xb9b8('0x5e')](0x0,_0xd88be6['lastIndexOf'](_0x3dc737));}var _0x462ad7={'method':_0xb9b8('0x5f'),'uri':util['format'](_0xb9b8('0x60'),_0xd88be6),'headers':{'Content-Type':_0xb9b8('0x61'),'Accept':'application/json'},'json':!![]};if(_0x5d5591['authType']==='basic'){_0x462ad7[_0xb9b8('0x62')]['Authorization']=util[_0xb9b8('0x63')](_0xb9b8('0x64'),new Buffer(util[_0xb9b8('0x63')](_0xb9b8('0x65'),_0x5d5591['username'],_0x5d5591[_0xb9b8('0x5a')]))['toString'](_0xb9b8('0x66')));}return rp(_0x462ad7)[_0xb9b8('0x2a')](function(_0x28c791){return _0x3ba90f['concat'](_['map'](_0x28c791['_embedded'][_0xb9b8('0x67')],function(_0x18a2ac){return{'id':_0x18a2ac[_0xb9b8('0x2d')],'name':_0x18a2ac[_0xb9b8('0x2d')],'type':_0x18a2ac[_0xb9b8('0x32')],'active':_0x18a2ac['active'],'label':_0x18a2ac[_0xb9b8('0x68')],'custom':!![]};}));});}})['then'](function(_0x5e19af){return{'count':_0x5e19af[_0xb9b8('0x3a')],'rows':_0x5e19af};})['then'](respondWithResult(_0x2c38fd,null))['catch'](function(_0x67ac9c){var _0x508531=_0x25d950[_0xb9b8('0x34')][_0xb9b8('0x69')]?0x1f4:_0x67ac9c[_0xb9b8('0x6a')]||0x1f4;logger[_0xb9b8('0x2b')](_0xb9b8('0x6b'),_0xb9b8('0x57'),_0x508531,JSON['stringify'](_0x67ac9c));delete _0x67ac9c[_0xb9b8('0x2d')];if(_0x508531===0x191){_0x508531=0x190;}_0x2c38fd['status'](_0x508531)[_0xb9b8('0x6c')](_0x25d950[_0xb9b8('0x34')][_0xb9b8('0x69')]?{'message':_0xb9b8('0x6d'),'statusCode':_0x67ac9c[_0xb9b8('0x6a')]}:_0x67ac9c);});};
\ No newline at end of file
+var _0xe206=['Subjects','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','slice','substring','GET','format','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','base64','concat','_embedded','entries','active','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','count','limit','status','apply','reject','save','update','then','destroy','end','name','send','index','map','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','DeskAccount','includeAll','include','rows','catch','params','find','body','getConfigurations','findOne','DeskConfiguration','rawAttributes','pick','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','DeskField'];(function(_0x421cf8,_0x23152c){var _0x145c48=function(_0x565862){while(--_0x565862){_0x421cf8['push'](_0x421cf8['shift']());}};_0x145c48(++_0x23152c);}(_0xe206,0xfc));var _0x6e20=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xe206[_0x243b59];return _0x3e1676;};'use strict';var emlformat=require(_0x6e20('0x0'));var rimraf=require(_0x6e20('0x1'));var zipdir=require(_0x6e20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e20('0x3'));var moment=require(_0x6e20('0x4'));var BPromise=require(_0x6e20('0x5'));var Mustache=require(_0x6e20('0x6'));var util=require(_0x6e20('0x7'));var path=require(_0x6e20('0x8'));var sox=require(_0x6e20('0x9'));var csv=require(_0x6e20('0xa'));var ejs=require(_0x6e20('0xb'));var fs=require('fs');var fs_extra=require(_0x6e20('0xc'));var _=require(_0x6e20('0xd'));var squel=require(_0x6e20('0xe'));var crypto=require(_0x6e20('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6e20('0x10'));var Redis=require('ioredis');var authService=require(_0x6e20('0x11'));var qs=require(_0x6e20('0x12'));var as=require(_0x6e20('0x13'));var hardwareService=require(_0x6e20('0x14'));var logger=require('../../config/logger')(_0x6e20('0x15'));var utils=require(_0x6e20('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6e20('0x17'))['db'];var integrations=require(_0x6e20('0x18'));function respondWithStatusCode(_0x4d5ead,_0x98fe7f){_0x98fe7f=_0x98fe7f||0xcc;return function(_0x303a0e){if(_0x303a0e){return _0x4d5ead[_0x6e20('0x19')](_0x98fe7f);}return _0x4d5ead['status'](_0x98fe7f)['end']();};}function respondWithResult(_0x572bc1,_0x553b4a){_0x553b4a=_0x553b4a||0xc8;return function(_0x1221a6){if(_0x1221a6){return _0x572bc1['status'](_0x553b4a)[_0x6e20('0x1a')](_0x1221a6);}};}function respondWithFilteredResult(_0x5b8f15,_0x154ec7){return function(_0x358204){if(_0x358204){var _0x19cce2=typeof _0x154ec7[_0x6e20('0x1b')]===_0x6e20('0x1c')&&typeof _0x154ec7['limit']==='undefined';var _0x3faf84=_0x358204[_0x6e20('0x1d')];var _0x5d9223=_0x19cce2?0x0:_0x154ec7[_0x6e20('0x1b')];var _0x498f23=_0x19cce2?_0x358204[_0x6e20('0x1d')]:_0x154ec7['offset']+_0x154ec7[_0x6e20('0x1e')];var _0x15a3fd;if(_0x498f23>=_0x3faf84){_0x498f23=_0x3faf84;_0x15a3fd=0xc8;}else{_0x15a3fd=0xce;}_0x5b8f15[_0x6e20('0x1f')](_0x15a3fd);return _0x5b8f15['set']('Content-Range',_0x5d9223+'-'+_0x498f23+'/'+_0x3faf84)['json'](_0x358204);}return null;};}function patchUpdates(_0x2d1aea){return function(_0x537463){try{jsonpatch[_0x6e20('0x20')](_0x537463,_0x2d1aea,!![]);}catch(_0xe5ece){return BPromise[_0x6e20('0x21')](_0xe5ece);}return _0x537463[_0x6e20('0x22')]();};}function saveUpdates(_0x5f2c95,_0x1d0087){return function(_0x2e6de1){if(_0x2e6de1){return _0x2e6de1[_0x6e20('0x23')](_0x5f2c95)[_0x6e20('0x24')](function(_0x2d8dcd){return _0x2d8dcd;});}return null;};}function removeEntity(_0xcd1db9,_0x43ea14){return function(_0x16a763){if(_0x16a763){return _0x16a763[_0x6e20('0x25')]()[_0x6e20('0x24')](function(){_0xcd1db9[_0x6e20('0x1f')](0xcc)[_0x6e20('0x26')]();});}};}function handleEntityNotFound(_0x309e00,_0x5dd33d){return function(_0x401a79){if(!_0x401a79){_0x309e00[_0x6e20('0x19')](0x194);}return _0x401a79;};}function handleError(_0x4cf9b1,_0x200c2c){_0x200c2c=_0x200c2c||0x1f4;return function(_0x2a0b32){logger['error'](_0x2a0b32['stack']);if(_0x2a0b32[_0x6e20('0x27')]){delete _0x2a0b32[_0x6e20('0x27')];}_0x4cf9b1[_0x6e20('0x1f')](_0x200c2c)[_0x6e20('0x28')](_0x2a0b32);};}exports[_0x6e20('0x29')]=function(_0x3c0e85,_0x64f6b4){var _0x565b1f={},_0x452659={},_0x40ee36={'count':0x0,'rows':[]};var _0x5d8d6f=_[_0x6e20('0x2a')](db['DeskAccount']['rawAttributes'],function(_0x4faab3){return{'name':_0x4faab3[_0x6e20('0x2b')],'type':_0x4faab3['type']['key']};});_0x452659[_0x6e20('0x2c')]=_[_0x6e20('0x2a')](_0x5d8d6f,'name');_0x452659[_0x6e20('0x2d')]=_[_0x6e20('0x2e')](_0x3c0e85['query']);_0x452659[_0x6e20('0x2f')]=_['intersection'](_0x452659[_0x6e20('0x2c')],_0x452659['query']);_0x565b1f[_0x6e20('0x30')]=_[_0x6e20('0x31')](_0x452659[_0x6e20('0x2c')],qs[_0x6e20('0x32')](_0x3c0e85[_0x6e20('0x2d')]['fields']));_0x565b1f[_0x6e20('0x30')]=_0x565b1f[_0x6e20('0x30')][_0x6e20('0x33')]?_0x565b1f[_0x6e20('0x30')]:_0x452659[_0x6e20('0x2c')];if(!_0x3c0e85[_0x6e20('0x2d')][_0x6e20('0x34')](_0x6e20('0x35'))){_0x565b1f[_0x6e20('0x1e')]=qs[_0x6e20('0x1e')](_0x3c0e85[_0x6e20('0x2d')]['limit']);_0x565b1f[_0x6e20('0x1b')]=qs[_0x6e20('0x1b')](_0x3c0e85['query'][_0x6e20('0x1b')]);}_0x565b1f[_0x6e20('0x36')]=qs[_0x6e20('0x37')](_0x3c0e85['query']['sort']);_0x565b1f[_0x6e20('0x38')]=qs['filters'](_['pick'](_0x3c0e85[_0x6e20('0x2d')],_0x452659['filters']),_0x5d8d6f);if(_0x3c0e85[_0x6e20('0x2d')][_0x6e20('0x39')]){_0x565b1f[_0x6e20('0x38')]=_['merge'](_0x565b1f[_0x6e20('0x38')],{'$or':_['map'](_0x5d8d6f,function(_0x410b4d){if(_0x410b4d[_0x6e20('0x3a')]!==_0x6e20('0x3b')){var _0x4fa93f={};_0x4fa93f[_0x410b4d[_0x6e20('0x27')]]={'$like':'%'+_0x3c0e85[_0x6e20('0x2d')][_0x6e20('0x39')]+'%'};return _0x4fa93f;}})});}_0x565b1f=_[_0x6e20('0x3c')]({},_0x565b1f,_0x3c0e85[_0x6e20('0x3d')]);var _0x17458a={'where':_0x565b1f[_0x6e20('0x38')]};return db[_0x6e20('0x3e')][_0x6e20('0x1d')](_0x17458a)['then'](function(_0xe89d64){_0x40ee36[_0x6e20('0x1d')]=_0xe89d64;if(_0x3c0e85['query'][_0x6e20('0x3f')]){_0x565b1f[_0x6e20('0x40')]=[{'all':!![]}];}return db[_0x6e20('0x3e')]['findAll'](_0x565b1f);})[_0x6e20('0x24')](function(_0x3f9fee){_0x40ee36[_0x6e20('0x41')]=_0x3f9fee;return _0x40ee36;})[_0x6e20('0x24')](respondWithFilteredResult(_0x64f6b4,_0x565b1f))[_0x6e20('0x42')](handleError(_0x64f6b4,null));};exports['show']=function(_0x3aed28,_0x31a486){var _0x3c2319={'raw':![],'where':{'id':_0x3aed28[_0x6e20('0x43')]['id']}},_0x4e3a80={};_0x4e3a80[_0x6e20('0x2c')]=_[_0x6e20('0x2e')](db[_0x6e20('0x3e')]['rawAttributes']);_0x4e3a80[_0x6e20('0x2d')]=_[_0x6e20('0x2e')](_0x3aed28['query']);_0x4e3a80['filters']=_[_0x6e20('0x31')](_0x4e3a80[_0x6e20('0x2c')],_0x4e3a80[_0x6e20('0x2d')]);_0x3c2319['attributes']=_[_0x6e20('0x31')](_0x4e3a80[_0x6e20('0x2c')],qs['fields'](_0x3aed28[_0x6e20('0x2d')][_0x6e20('0x32')]));_0x3c2319[_0x6e20('0x30')]=_0x3c2319[_0x6e20('0x30')][_0x6e20('0x33')]?_0x3c2319['attributes']:_0x4e3a80['model'];if(_0x3aed28['query'][_0x6e20('0x3f')]){_0x3c2319[_0x6e20('0x40')]=[{'all':!![]}];}_0x3c2319=_['merge']({},_0x3c2319,_0x3aed28['options']);return db[_0x6e20('0x3e')][_0x6e20('0x44')](_0x3c2319)[_0x6e20('0x24')](handleEntityNotFound(_0x31a486,null))['then'](respondWithResult(_0x31a486,null))[_0x6e20('0x42')](handleError(_0x31a486,null));};exports['create']=function(_0x3cadd8,_0x4cf54c){return db['DeskAccount']['create'](_0x3cadd8[_0x6e20('0x45')],{})[_0x6e20('0x24')](respondWithResult(_0x4cf54c,0xc9))['catch'](handleError(_0x4cf54c,null));};exports[_0x6e20('0x23')]=function(_0x17e810,_0x22278a){if(_0x17e810[_0x6e20('0x45')]['id']){delete _0x17e810[_0x6e20('0x45')]['id'];}return db[_0x6e20('0x3e')]['find']({'where':{'id':_0x17e810[_0x6e20('0x43')]['id']}})[_0x6e20('0x24')](handleEntityNotFound(_0x22278a,null))[_0x6e20('0x24')](saveUpdates(_0x17e810['body'],null))[_0x6e20('0x24')](respondWithResult(_0x22278a,null))['catch'](handleError(_0x22278a,null));};exports[_0x6e20('0x25')]=function(_0x4e87c2,_0x186468){return db[_0x6e20('0x3e')][_0x6e20('0x44')]({'where':{'id':_0x4e87c2[_0x6e20('0x43')]['id']}})[_0x6e20('0x24')](handleEntityNotFound(_0x186468,null))[_0x6e20('0x24')](removeEntity(_0x186468,null))[_0x6e20('0x42')](handleError(_0x186468,null));};exports[_0x6e20('0x46')]=function(_0x396546,_0x3aee44,_0x2d29bb){var _0x4cb355={};var _0x263f97={};var _0x825570;var _0x1877bc;return db['DeskAccount'][_0x6e20('0x47')]({'where':{'id':_0x396546[_0x6e20('0x43')]['id']}})['then'](handleEntityNotFound(_0x3aee44,null))['then'](function(_0x593e7e){if(_0x593e7e){_0x825570=_0x593e7e;_0x263f97['model']=_[_0x6e20('0x2e')](db[_0x6e20('0x48')][_0x6e20('0x49')]);_0x263f97['query']=_[_0x6e20('0x2e')](_0x396546[_0x6e20('0x2d')]);_0x263f97[_0x6e20('0x2f')]=_[_0x6e20('0x31')](_0x263f97[_0x6e20('0x2c')],_0x263f97['query']);_0x4cb355[_0x6e20('0x30')]=_[_0x6e20('0x31')](_0x263f97[_0x6e20('0x2c')],qs[_0x6e20('0x32')](_0x396546[_0x6e20('0x2d')][_0x6e20('0x32')]));_0x4cb355['attributes']=_0x4cb355[_0x6e20('0x30')][_0x6e20('0x33')]?_0x4cb355[_0x6e20('0x30')]:_0x263f97['model'];_0x4cb355[_0x6e20('0x36')]=qs['sort'](_0x396546['query']['sort']);_0x4cb355[_0x6e20('0x38')]=qs['filters'](_[_0x6e20('0x4a')](_0x396546[_0x6e20('0x2d')],_0x263f97[_0x6e20('0x2f')]));if(_0x396546[_0x6e20('0x2d')][_0x6e20('0x39')]){_0x4cb355[_0x6e20('0x38')]=_['merge'](_0x4cb355[_0x6e20('0x38')],{'$or':_[_0x6e20('0x2a')](_0x4cb355[_0x6e20('0x30')],function(_0x3e3c76){var _0x89772b={};_0x89772b[_0x3e3c76]={'$like':'%'+_0x396546[_0x6e20('0x2d')][_0x6e20('0x39')]+'%'};return _0x89772b;})});}_0x4cb355=_['merge']({},_0x4cb355,_0x396546['options']);return _0x825570[_0x6e20('0x46')](_0x4cb355);}})[_0x6e20('0x24')](function(_0x3472e2){if(_0x3472e2){_0x1877bc=_0x3472e2[_0x6e20('0x33')];if(!_0x396546['query']['hasOwnProperty'](_0x6e20('0x35'))){_0x4cb355[_0x6e20('0x1e')]=qs['limit'](_0x396546[_0x6e20('0x2d')][_0x6e20('0x1e')]);_0x4cb355[_0x6e20('0x1b')]=qs[_0x6e20('0x1b')](_0x396546[_0x6e20('0x2d')][_0x6e20('0x1b')]);}return _0x825570[_0x6e20('0x46')](_0x4cb355);}})['then'](function(_0x50b1ee){if(_0x50b1ee){return _0x50b1ee?{'count':_0x1877bc,'rows':_0x50b1ee}:null;}})['then'](respondWithResult(_0x3aee44,null))['catch'](handleError(_0x3aee44,null));};exports[_0x6e20('0x4b')]=function(_0x255f62,_0x2c4fa3,_0x45c71e){if(_0x255f62['body']['id']){delete _0x255f62[_0x6e20('0x45')]['id'];}return db['DeskAccount']['findOne']({'where':{'id':_0x255f62[_0x6e20('0x43')]['id']}})[_0x6e20('0x24')](handleEntityNotFound(_0x2c4fa3,null))['then'](function(_0x5bbbbc){if(_0x5bbbbc){_0x255f62[_0x6e20('0x45')][_0x6e20('0x4c')]=_0x5bbbbc['id'];_0x255f62[_0x6e20('0x45')]['Subjects']=integrations[_0x6e20('0x4d')](_0x255f62[_0x6e20('0x45')]['channel'],_0x255f62[_0x6e20('0x45')][_0x6e20('0x3a')]);_0x255f62[_0x6e20('0x45')][_0x6e20('0x4e')]=integrations[_0x6e20('0x4f')](_0x255f62[_0x6e20('0x45')]['channel'],_0x255f62['body']['type']);return db['DeskConfiguration']['create'](_0x255f62[_0x6e20('0x45')],{'include':[{'model':db[_0x6e20('0x50')],'as':_0x6e20('0x51')},{'model':db[_0x6e20('0x50')],'as':_0x6e20('0x4e')}]});}return null;})[_0x6e20('0x24')](respondWithResult(_0x2c4fa3,null))['catch'](handleError(_0x2c4fa3,null));};exports[_0x6e20('0x52')]=function(_0x11300e,_0x58b541,_0x4ab261){var _0xe8778c=[{'name':'priority','label':_0x6e20('0x53'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x289b0a='';return db[_0x6e20('0x3e')][_0x6e20('0x47')]({'where':{'id':_0x11300e['params']['id']},'attributes':['id',_0x6e20('0x54'),_0x6e20('0x55'),_0x6e20('0x56'),_0x6e20('0x57'),_0x6e20('0x58'),_0x6e20('0x59'),_0x6e20('0x5a'),'tokenSecret']})[_0x6e20('0x24')](handleEntityNotFound(_0x58b541,null))['then'](function(_0x10c4dc){if(_0x10c4dc){_0x289b0a=_0x10c4dc[_0x6e20('0x54')];var _0x4055fe=_0x289b0a[_0x6e20('0x5b')](-0x1);if(_0x4055fe==='/'){_0x289b0a=_0x289b0a[_0x6e20('0x5c')](0x0,_0x289b0a['lastIndexOf'](_0x4055fe));}var _0x174dc9={'method':_0x6e20('0x5d'),'uri':util[_0x6e20('0x5e')]('%s/custom_fields',_0x289b0a),'headers':{'Content-Type':_0x6e20('0x5f'),'Accept':'application/json'},'json':!![]};if(_0x10c4dc['authType']===_0x6e20('0x60')){_0x174dc9['headers'][_0x6e20('0x61')]=util[_0x6e20('0x5e')](_0x6e20('0x62'),new Buffer(util[_0x6e20('0x5e')](_0x6e20('0x63'),_0x10c4dc[_0x6e20('0x56')],_0x10c4dc[_0x6e20('0x57')]))[_0x6e20('0x64')](_0x6e20('0x65')));}return rp(_0x174dc9)[_0x6e20('0x24')](function(_0x8156ea){return _0xe8778c[_0x6e20('0x66')](_[_0x6e20('0x2a')](_0x8156ea[_0x6e20('0x67')][_0x6e20('0x68')],function(_0x488412){return{'id':_0x488412[_0x6e20('0x27')],'name':_0x488412[_0x6e20('0x27')],'type':_0x488412[_0x6e20('0x3a')],'active':_0x488412[_0x6e20('0x69')],'label':_0x488412['label'],'custom':!![]};}));});}})[_0x6e20('0x24')](function(_0x247616){return{'count':_0x247616[_0x6e20('0x33')],'rows':_0x247616};})[_0x6e20('0x24')](respondWithResult(_0x58b541,null))[_0x6e20('0x42')](function(_0x393b71){var _0x5c9733=_0x11300e['query'][_0x6e20('0x6a')]?0x1f4:_0x393b71[_0x6e20('0x6b')]||0x1f4;logger[_0x6e20('0x6c')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x5c9733,JSON[_0x6e20('0x6d')](_0x393b71));delete _0x393b71[_0x6e20('0x27')];if(_0x5c9733===0x191){_0x5c9733=0x190;}_0x58b541[_0x6e20('0x1f')](_0x5c9733)[_0x6e20('0x28')](_0x11300e[_0x6e20('0x2d')][_0x6e20('0x6a')]?{'message':_0x6e20('0x6e'),'statusCode':_0x393b71[_0x6e20('0x6b')]}:_0x393b71);});};
\ No newline at end of file
index 96cce8c..167d9e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84f1=['rimraf','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5cceb0,_0xa4989c){var _0x2cb714=function(_0xdda4dd){while(--_0xdda4dd){_0x5cceb0['push'](_0x5cceb0['shift']());}};_0x2cb714(++_0xa4989c);}(_0x84f1,0x172));var _0x184f=function(_0x14da27,_0x41b95f){_0x14da27=_0x14da27-0x0;var _0xb1c714=_0x84f1[_0x14da27];return _0xb1c714;};'use strict';var _=require(_0x184f('0x0'));var util=require('util');var logger=require(_0x184f('0x1'))(_0x184f('0x2'));var moment=require(_0x184f('0x3'));var BPromise=require(_0x184f('0x4'));var rp=require(_0x184f('0x5'));var fs=require('fs');var path=require(_0x184f('0x6'));var rimraf=require(_0x184f('0x7'));var config=require('../../config/environment');var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x184f('0x8'));module[_0x184f('0x9')]=function(_0x4eae7b,_0x5a4a60){return _0x4eae7b[_0x184f('0xa')](_0x184f('0xb'),attributes,{'tableName':_0x184f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4e5e=['int_desk_accounts','util','api','moment','bluebird','request-promise','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x475fa8,_0x444305){var _0x5c1657=function(_0x47a757){while(--_0x47a757){_0x475fa8['push'](_0x475fa8['shift']());}};_0x5c1657(++_0x444305);}(_0x4e5e,0x18d));var _0xe4e5=function(_0x51d959,_0x56b9c5){_0x51d959=_0x51d959-0x0;var _0x5d7d92=_0x4e5e[_0x51d959];return _0x5d7d92;};'use strict';var _=require('lodash');var util=require(_0xe4e5('0x0'));var logger=require('../../config/logger')(_0xe4e5('0x1'));var moment=require(_0xe4e5('0x2'));var BPromise=require(_0xe4e5('0x3'));var rp=require(_0xe4e5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe4e5('0x5'));var attributes=require(_0xe4e5('0x6'));var integrations=require(_0xe4e5('0x7'));module[_0xe4e5('0x8')]=function(_0x104008,_0x2a1004){return _0x104008[_0xe4e5('0x9')]('DeskAccount',attributes,{'tableName':_0xe4e5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b856730..d6f3863 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x520f=['lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','result','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowDeskAccount','find','catch'];(function(_0x333734,_0x412291){var _0x4e91e7=function(_0x272e12){while(--_0x272e12){_0x333734['push'](_0x333734['shift']());}};_0x4e91e7(++_0x412291);}(_0x520f,0xb4));var _0xf520=function(_0xcd39c8,_0x2ad166){_0xcd39c8=_0xcd39c8-0x0;var _0x463dfc=_0x520f[_0xcd39c8];return _0x463dfc;};'use strict';var _=require(_0xf520('0x0'));var util=require('util');var moment=require(_0xf520('0x1'));var BPromise=require('bluebird');var rs=require(_0xf520('0x2'));var fs=require('fs');var Redis=require(_0xf520('0x3'));var db=require(_0xf520('0x4'))['db'];var utils=require(_0xf520('0x5'));var logger=require(_0xf520('0x6'))(_0xf520('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf520('0x8')][_0xf520('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a1ff5,_0xc92ec2,_0x4974a4){return new BPromise(function(_0x1722e8,_0x4e4b41){return client[_0xf520('0xa')](_0x4a1ff5,_0x4974a4)[_0xf520('0xb')](function(_0x582d90){logger[_0xf520('0xc')]('DeskAccount,\x20%s,\x20%s',_0xc92ec2,_0xf520('0xd'));logger[_0xf520('0xe')](_0xf520('0xf'),_0xc92ec2,_0xf520('0xd'),JSON[_0xf520('0x10')](_0x582d90));if(_0x582d90[_0xf520('0x11')]){if(_0x582d90[_0xf520('0x11')][_0xf520('0x12')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0xc92ec2,_0x582d90[_0xf520('0x11')]['message']);return _0x4e4b41(_0x582d90[_0xf520('0x11')][_0xf520('0x13')]);}logger['error'](_0xf520('0x14'),_0xc92ec2,_0x582d90['error'][_0xf520('0x13')]);return _0x1722e8(_0x582d90[_0xf520('0x11')][_0xf520('0x13')]);}else{logger[_0xf520('0xc')]('DeskAccount,\x20%s,\x20%s',_0xc92ec2,_0xf520('0xd'));_0x1722e8(_0x582d90[_0xf520('0x15')][_0xf520('0x13')]);}})['catch'](function(_0x2cf345){logger[_0xf520('0x11')]('DeskAccount,\x20%s,\x20%s',_0xc92ec2,_0x2cf345);_0x4e4b41(_0x2cf345);});});}exports[_0xf520('0x16')]=function(_0x80bc61){var _0x4574ed=this;return new Promise(function(_0x4ae271,_0x4df472){return db[_0xf520('0x17')][_0xf520('0x18')]({'raw':_0x80bc61[_0xf520('0x19')]?_0x80bc61[_0xf520('0x19')][_0xf520('0x1a')]===undefined?!![]:![]:!![],'where':_0x80bc61[_0xf520('0x19')]?_0x80bc61[_0xf520('0x19')][_0xf520('0x1b')]||null:null,'attributes':_0x80bc61[_0xf520('0x19')]?_0x80bc61[_0xf520('0x19')][_0xf520('0x1c')]||null:null,'limit':_0x80bc61['options']?_0x80bc61[_0xf520('0x19')][_0xf520('0x1d')]||null:null,'include':_0x80bc61[_0xf520('0x19')]?_0x80bc61[_0xf520('0x19')][_0xf520('0x1e')]?_[_0xf520('0x1f')](_0x80bc61[_0xf520('0x19')][_0xf520('0x1e')],function(_0x58d83a){return{'model':db[_0x58d83a[_0xf520('0x20')]],'as':_0x58d83a['as'],'attributes':_0x58d83a['attributes'],'include':_0x58d83a[_0xf520('0x1e')]?_[_0xf520('0x1f')](_0x58d83a[_0xf520('0x1e')],function(_0x5471c2){return{'model':db[_0x5471c2[_0xf520('0x20')]],'as':_0x5471c2['as'],'attributes':_0x5471c2[_0xf520('0x1c')],'include':_0x5471c2[_0xf520('0x1e')]?_[_0xf520('0x1f')](_0x5471c2[_0xf520('0x1e')],function(_0xa71c53){return{'model':db[_0xa71c53[_0xf520('0x20')]],'as':_0xa71c53['as'],'attributes':_0xa71c53['attributes']};}):[]};}):[]};}):[]:[]})[_0xf520('0xb')](function(_0x3fd715){logger[_0xf520('0xc')](_0xf520('0x16'),_0x80bc61);logger['debug'](_0xf520('0x16'),_0x80bc61,JSON['stringify'](_0x3fd715));_0x4ae271(_0x3fd715);})['catch'](function(_0x35e1dc){logger[_0xf520('0x11')](_0xf520('0x16'),_0x35e1dc[_0xf520('0x13')],_0x80bc61);_0x4df472(_0x4574ed[_0xf520('0x11')](0x1f4,_0x35e1dc[_0xf520('0x13')]));});});};exports[_0xf520('0x21')]=function(_0x129814){var _0x3b8659=this;return new Promise(function(_0x5ec285,_0x29bb20){return db[_0xf520('0x17')][_0xf520('0x22')]({'raw':_0x129814[_0xf520('0x19')]?_0x129814[_0xf520('0x19')][_0xf520('0x1a')]===undefined?!![]:![]:!![],'where':_0x129814[_0xf520('0x19')]?_0x129814[_0xf520('0x19')][_0xf520('0x1b')]||null:null,'attributes':_0x129814[_0xf520('0x19')]?_0x129814[_0xf520('0x19')][_0xf520('0x1c')]||null:null,'include':_0x129814[_0xf520('0x19')]?_0x129814['options'][_0xf520('0x1e')]?_['map'](_0x129814['options']['include'],function(_0x170f0f){return{'model':db[_0x170f0f['model']],'as':_0x170f0f['as'],'attributes':_0x170f0f['attributes'],'include':_0x170f0f[_0xf520('0x1e')]?_[_0xf520('0x1f')](_0x170f0f[_0xf520('0x1e')],function(_0x481bb3){return{'model':db[_0x481bb3['model']],'as':_0x481bb3['as'],'attributes':_0x481bb3[_0xf520('0x1c')],'include':_0x481bb3[_0xf520('0x1e')]?_[_0xf520('0x1f')](_0x481bb3[_0xf520('0x1e')],function(_0x1e9b5f){return{'model':db[_0x1e9b5f[_0xf520('0x20')]],'as':_0x1e9b5f['as'],'attributes':_0x1e9b5f[_0xf520('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf520('0xb')](function(_0x568751){logger['info']('ShowDeskAccount',_0x129814);logger['debug'](_0xf520('0x21'),_0x129814,JSON['stringify'](_0x568751));_0x5ec285(_0x568751);})[_0xf520('0x23')](function(_0x5d17e3){logger[_0xf520('0x11')]('ShowDeskAccount',_0x5d17e3['message'],_0x129814);_0x29bb20(_0x3b8659['error'](0x1f4,_0x5d17e3['message']));});});};
\ No newline at end of file
+var _0x1eaa=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowDeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xac5aeb,_0x14ce88){var _0x57d45b=function(_0x211e07){while(--_0x211e07){_0xac5aeb['push'](_0xac5aeb['shift']());}};_0x57d45b(++_0x14ce88);}(_0x1eaa,0xdd));var _0xa1ea=function(_0x1eaf12,_0x598b17){_0x1eaf12=_0x1eaf12-0x0;var _0x26a801=_0x1eaa[_0x1eaf12];return _0x26a801;};'use strict';var _=require(_0xa1ea('0x0'));var util=require(_0xa1ea('0x1'));var moment=require(_0xa1ea('0x2'));var BPromise=require(_0xa1ea('0x3'));var rs=require(_0xa1ea('0x4'));var fs=require('fs');var Redis=require(_0xa1ea('0x5'));var db=require(_0xa1ea('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa1ea('0x7'));var config=require(_0xa1ea('0x8'));var jayson=require(_0xa1ea('0x9'));var client=jayson[_0xa1ea('0xa')][_0xa1ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b1b3c,_0x2463ae,_0xcf0653){return new BPromise(function(_0x4aa8b0,_0x5f4007){return client[_0xa1ea('0xc')](_0x1b1b3c,_0xcf0653)[_0xa1ea('0xd')](function(_0xf43a25){logger[_0xa1ea('0xe')](_0xa1ea('0xf'),_0x2463ae,_0xa1ea('0x10'));logger[_0xa1ea('0x11')](_0xa1ea('0x12'),_0x2463ae,'request\x20sent',JSON['stringify'](_0xf43a25));if(_0xf43a25[_0xa1ea('0x13')]){if(_0xf43a25[_0xa1ea('0x13')][_0xa1ea('0x14')]===0x1f4){logger[_0xa1ea('0x13')](_0xa1ea('0xf'),_0x2463ae,_0xf43a25['error'][_0xa1ea('0x15')]);return _0x5f4007(_0xf43a25[_0xa1ea('0x13')][_0xa1ea('0x15')]);}logger[_0xa1ea('0x13')](_0xa1ea('0xf'),_0x2463ae,_0xf43a25[_0xa1ea('0x13')]['message']);return _0x4aa8b0(_0xf43a25[_0xa1ea('0x13')]['message']);}else{logger[_0xa1ea('0xe')](_0xa1ea('0xf'),_0x2463ae,_0xa1ea('0x10'));_0x4aa8b0(_0xf43a25[_0xa1ea('0x16')]['message']);}})[_0xa1ea('0x17')](function(_0x3b31aa){logger[_0xa1ea('0x13')](_0xa1ea('0xf'),_0x2463ae,_0x3b31aa);_0x5f4007(_0x3b31aa);});});}exports[_0xa1ea('0x18')]=function(_0x276bdd){var _0x2ed099=this;return new Promise(function(_0x1fe90b,_0x58d13e){return db[_0xa1ea('0x19')][_0xa1ea('0x1a')]({'raw':_0x276bdd['options']?_0x276bdd[_0xa1ea('0x1b')][_0xa1ea('0x1c')]===undefined?!![]:![]:!![],'where':_0x276bdd[_0xa1ea('0x1b')]?_0x276bdd[_0xa1ea('0x1b')][_0xa1ea('0x1d')]||null:null,'attributes':_0x276bdd[_0xa1ea('0x1b')]?_0x276bdd['options'][_0xa1ea('0x1e')]||null:null,'limit':_0x276bdd[_0xa1ea('0x1b')]?_0x276bdd[_0xa1ea('0x1b')][_0xa1ea('0x1f')]||null:null,'include':_0x276bdd[_0xa1ea('0x1b')]?_0x276bdd[_0xa1ea('0x1b')]['include']?_['map'](_0x276bdd[_0xa1ea('0x1b')][_0xa1ea('0x20')],function(_0x5a8c48){return{'model':db[_0x5a8c48[_0xa1ea('0x21')]],'as':_0x5a8c48['as'],'attributes':_0x5a8c48['attributes'],'include':_0x5a8c48[_0xa1ea('0x20')]?_['map'](_0x5a8c48[_0xa1ea('0x20')],function(_0x5bbfb0){return{'model':db[_0x5bbfb0['model']],'as':_0x5bbfb0['as'],'attributes':_0x5bbfb0[_0xa1ea('0x1e')],'include':_0x5bbfb0['include']?_[_0xa1ea('0x22')](_0x5bbfb0['include'],function(_0x1c9ed0){return{'model':db[_0x1c9ed0[_0xa1ea('0x21')]],'as':_0x1c9ed0['as'],'attributes':_0x1c9ed0['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x549bc3){logger['info'](_0xa1ea('0x18'),_0x276bdd);logger[_0xa1ea('0x11')]('GetDeskAccount',_0x276bdd,JSON[_0xa1ea('0x23')](_0x549bc3));_0x1fe90b(_0x549bc3);})[_0xa1ea('0x17')](function(_0x44e185){logger[_0xa1ea('0x13')](_0xa1ea('0x18'),_0x44e185[_0xa1ea('0x15')],_0x276bdd);_0x58d13e(_0x2ed099[_0xa1ea('0x13')](0x1f4,_0x44e185[_0xa1ea('0x15')]));});});};exports[_0xa1ea('0x24')]=function(_0x1438bf){var _0x1ba0be=this;return new Promise(function(_0x462ade,_0x45f08e){return db[_0xa1ea('0x19')][_0xa1ea('0x25')]({'raw':_0x1438bf[_0xa1ea('0x1b')]?_0x1438bf['options'][_0xa1ea('0x1c')]===undefined?!![]:![]:!![],'where':_0x1438bf[_0xa1ea('0x1b')]?_0x1438bf['options'][_0xa1ea('0x1d')]||null:null,'attributes':_0x1438bf[_0xa1ea('0x1b')]?_0x1438bf[_0xa1ea('0x1b')][_0xa1ea('0x1e')]||null:null,'include':_0x1438bf[_0xa1ea('0x1b')]?_0x1438bf[_0xa1ea('0x1b')][_0xa1ea('0x20')]?_[_0xa1ea('0x22')](_0x1438bf[_0xa1ea('0x1b')][_0xa1ea('0x20')],function(_0x14688c){return{'model':db[_0x14688c[_0xa1ea('0x21')]],'as':_0x14688c['as'],'attributes':_0x14688c[_0xa1ea('0x1e')],'include':_0x14688c[_0xa1ea('0x20')]?_[_0xa1ea('0x22')](_0x14688c[_0xa1ea('0x20')],function(_0x17158c){return{'model':db[_0x17158c['model']],'as':_0x17158c['as'],'attributes':_0x17158c[_0xa1ea('0x1e')],'include':_0x17158c[_0xa1ea('0x20')]?_[_0xa1ea('0x22')](_0x17158c['include'],function(_0x15d6e5){return{'model':db[_0x15d6e5[_0xa1ea('0x21')]],'as':_0x15d6e5['as'],'attributes':_0x15d6e5[_0xa1ea('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x490654){logger[_0xa1ea('0xe')](_0xa1ea('0x24'),_0x1438bf);logger[_0xa1ea('0x11')]('ShowDeskAccount',_0x1438bf,JSON[_0xa1ea('0x23')](_0x490654));_0x462ade(_0x490654);})[_0xa1ea('0x17')](function(_0x3f3790){logger[_0xa1ea('0x13')](_0xa1ea('0x24'),_0x3f3790['message'],_0x1438bf);_0x45f08e(_0x1ba0be['error'](0x1f4,_0x3f3790[_0xa1ea('0x15')]));});});};
\ No newline at end of file
index a580a5a..66b4161 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x442659,_0x15c724){var _0x1e5ef8=function(_0x31f93e){while(--_0x31f93e){_0x442659['push'](_0x442659['shift']());}};_0x1e5ef8(++_0x15c724);}(_0x7217,0x19e));var _0x7721=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x7217[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router;
\ No newline at end of file
+var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x11d7d3,_0x54a7a0){var _0x480a5f=function(_0x69725d){while(--_0x69725d){_0x11d7d3['push'](_0x11d7d3['shift']());}};_0x480a5f(++_0x54a7a0);}(_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 fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router;
\ No newline at end of file
index 0115206..1be8970 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a47=['sequelize','exports','STRING'];(function(_0x32710c,_0x58ab8f){var _0x289dcf=function(_0x3d2108){while(--_0x3d2108){_0x32710c['push'](_0x32710c['shift']());}};_0x289dcf(++_0x58ab8f);}(_0x4a47,0x90));var _0x74a4=function(_0x5842c3,_0x56bd74){_0x5842c3=_0x5842c3-0x0;var _0x44bf8c=_0x4a47[_0x5842c3];return _0x44bf8c;};'use strict';var Sequelize=require(_0x74a4('0x0'));module[_0x74a4('0x1')]={'name':{'type':Sequelize[_0x74a4('0x2')]},'description':{'type':Sequelize[_0x74a4('0x2')]}};
\ No newline at end of file
+var _0xc090=['exports','STRING','sequelize'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xc090,0x1e5));var _0x0c09=function(_0x4da8ad,_0xf16c52){_0x4da8ad=_0x4da8ad-0x0;var _0x974c7d=_0xc090[_0x4da8ad];return _0x974c7d;};'use strict';var Sequelize=require(_0x0c09('0x0'));module[_0x0c09('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0c09('0x2')]}};
\ No newline at end of file
index d71f419..0b44334 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x917a=['name','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','type','merge','DeskConfiguration','includeAll','include','findAll','rows','params','rawAttributes','length','options','catch','create','body','destroy','find','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','pick','setTags','ids','fast-json-patch','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack'];(function(_0x32b6fc,_0x1b0b24){var _0xdd7d1f=function(_0x3d83fe){while(--_0x3d83fe){_0x32b6fc['push'](_0x32b6fc['shift']());}};_0xdd7d1f(++_0x1b0b24);}(_0x917a,0x1b7));var _0xa917=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x917a[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa917('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa917('0x1'));var Mustache=require(_0xa917('0x2'));var util=require(_0xa917('0x3'));var path=require(_0xa917('0x4'));var sox=require(_0xa917('0x5'));var csv=require('to-csv');var ejs=require(_0xa917('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa917('0x7'));var jsforce=require(_0xa917('0x8'));var deskjs=require(_0xa917('0x9'));var toCsv=require(_0xa917('0xa'));var querystring=require(_0xa917('0xb'));var Papa=require(_0xa917('0xc'));var Redis=require('ioredis');var authService=require(_0xa917('0xd'));var qs=require(_0xa917('0xe'));var as=require(_0xa917('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa917('0x10'))(_0xa917('0x11'));var utils=require(_0xa917('0x12'));var config=require(_0xa917('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13889b,_0x430416){_0x430416=_0x430416||0xcc;return function(_0x1d9004){if(_0x1d9004){return _0x13889b[_0xa917('0x14')](_0x430416);}return _0x13889b[_0xa917('0x15')](_0x430416)[_0xa917('0x16')]();};}function respondWithResult(_0xa4172d,_0x36f6ba){_0x36f6ba=_0x36f6ba||0xc8;return function(_0x76f681){if(_0x76f681){return _0xa4172d[_0xa917('0x15')](_0x36f6ba)[_0xa917('0x17')](_0x76f681);}};}function respondWithFilteredResult(_0x2e55f4,_0x4ef486){return function(_0x482cb6){if(_0x482cb6){var _0x384d17=typeof _0x4ef486[_0xa917('0x18')]===_0xa917('0x19')&&typeof _0x4ef486[_0xa917('0x1a')]===_0xa917('0x19');var _0x5f42a6=_0x482cb6[_0xa917('0x1b')];var _0x501873=_0x384d17?0x0:_0x4ef486[_0xa917('0x18')];var _0x185bac=_0x384d17?_0x482cb6[_0xa917('0x1b')]:_0x4ef486[_0xa917('0x18')]+_0x4ef486['limit'];var _0x246383;if(_0x185bac>=_0x5f42a6){_0x185bac=_0x5f42a6;_0x246383=0xc8;}else{_0x246383=0xce;}_0x2e55f4['status'](_0x246383);return _0x2e55f4[_0xa917('0x1c')](_0xa917('0x1d'),_0x501873+'-'+_0x185bac+'/'+_0x5f42a6)[_0xa917('0x17')](_0x482cb6);}return null;};}function patchUpdates(_0x1ad514){return function(_0x513a00){try{jsonpatch[_0xa917('0x1e')](_0x513a00,_0x1ad514,!![]);}catch(_0x590b97){return BPromise[_0xa917('0x1f')](_0x590b97);}return _0x513a00['save']();};}function saveUpdates(_0x1ac77a,_0xd80f0c){return function(_0xd62511){if(_0xd62511){return _0xd62511[_0xa917('0x20')](_0x1ac77a)[_0xa917('0x21')](function(_0x4d41bd){return _0x4d41bd;});}return null;};}function removeEntity(_0x19c15f,_0x22031c){return function(_0x1eab43){if(_0x1eab43){return _0x1eab43['destroy']()[_0xa917('0x21')](function(){_0x19c15f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x58f360,_0x4377b7){return function(_0x480572){if(!_0x480572){_0x58f360[_0xa917('0x14')](0x194);}return _0x480572;};}function handleError(_0x1a6cf9,_0x1bb9b7){_0x1bb9b7=_0x1bb9b7||0x1f4;return function(_0x3deb64){logger['error'](_0x3deb64[_0xa917('0x22')]);if(_0x3deb64[_0xa917('0x23')]){delete _0x3deb64['name'];}_0x1a6cf9[_0xa917('0x15')](_0x1bb9b7)['send'](_0x3deb64);};}exports[_0xa917('0x24')]=function(_0x372c67,_0x11a032){var _0x5d9044={},_0x9dfa66={},_0xc9be61={'count':0x0,'rows':[]};var _0x39511e=_[_0xa917('0x25')](db['DeskConfiguration']['rawAttributes'],function(_0x36140e){return{'name':_0x36140e[_0xa917('0x26')],'type':_0x36140e['type'][_0xa917('0x27')]};});_0x9dfa66[_0xa917('0x28')]=_[_0xa917('0x25')](_0x39511e,_0xa917('0x23'));_0x9dfa66[_0xa917('0x29')]=_[_0xa917('0x2a')](_0x372c67[_0xa917('0x29')]);_0x9dfa66[_0xa917('0x2b')]=_[_0xa917('0x2c')](_0x9dfa66[_0xa917('0x28')],_0x9dfa66['query']);_0x5d9044[_0xa917('0x2d')]=_[_0xa917('0x2c')](_0x9dfa66[_0xa917('0x28')],qs['fields'](_0x372c67[_0xa917('0x29')][_0xa917('0x2e')]));_0x5d9044[_0xa917('0x2d')]=_0x5d9044[_0xa917('0x2d')]['length']?_0x5d9044['attributes']:_0x9dfa66['model'];if(!_0x372c67[_0xa917('0x29')][_0xa917('0x2f')](_0xa917('0x30'))){_0x5d9044[_0xa917('0x1a')]=qs[_0xa917('0x1a')](_0x372c67[_0xa917('0x29')][_0xa917('0x1a')]);_0x5d9044['offset']=qs[_0xa917('0x18')](_0x372c67[_0xa917('0x29')][_0xa917('0x18')]);}_0x5d9044[_0xa917('0x31')]=qs[_0xa917('0x32')](_0x372c67['query']['sort']);_0x5d9044[_0xa917('0x33')]=qs[_0xa917('0x2b')](_['pick'](_0x372c67[_0xa917('0x29')],_0x9dfa66[_0xa917('0x2b')]),_0x39511e);if(_0x372c67[_0xa917('0x29')][_0xa917('0x34')]){_0x5d9044[_0xa917('0x33')]=_['merge'](_0x5d9044[_0xa917('0x33')],{'$or':_[_0xa917('0x25')](_0x39511e,function(_0xe39b49){if(_0xe39b49[_0xa917('0x35')]!=='VIRTUAL'){var _0x22a0bf={};_0x22a0bf[_0xe39b49[_0xa917('0x23')]]={'$like':'%'+_0x372c67[_0xa917('0x29')][_0xa917('0x34')]+'%'};return _0x22a0bf;}})});}_0x5d9044=_[_0xa917('0x36')]({},_0x5d9044,_0x372c67['options']);var _0x109bcc={'where':_0x5d9044[_0xa917('0x33')]};return db[_0xa917('0x37')][_0xa917('0x1b')](_0x109bcc)[_0xa917('0x21')](function(_0x11b722){_0xc9be61[_0xa917('0x1b')]=_0x11b722;if(_0x372c67['query'][_0xa917('0x38')]){_0x5d9044[_0xa917('0x39')]=[{'all':!![]}];}return db[_0xa917('0x37')][_0xa917('0x3a')](_0x5d9044);})['then'](function(_0x277fc1){_0xc9be61[_0xa917('0x3b')]=_0x277fc1;return _0xc9be61;})[_0xa917('0x21')](respondWithFilteredResult(_0x11a032,_0x5d9044))['catch'](handleError(_0x11a032,null));};exports['show']=function(_0x448bb9,_0x8abee0){var _0x16ce51={'raw':![],'where':{'id':_0x448bb9[_0xa917('0x3c')]['id']}},_0xf5ddff={};_0xf5ddff['model']=_['keys'](db['DeskConfiguration'][_0xa917('0x3d')]);_0xf5ddff['query']=_[_0xa917('0x2a')](_0x448bb9[_0xa917('0x29')]);_0xf5ddff[_0xa917('0x2b')]=_['intersection'](_0xf5ddff[_0xa917('0x28')],_0xf5ddff[_0xa917('0x29')]);_0x16ce51[_0xa917('0x2d')]=_[_0xa917('0x2c')](_0xf5ddff[_0xa917('0x28')],qs['fields'](_0x448bb9['query']['fields']));_0x16ce51[_0xa917('0x2d')]=_0x16ce51[_0xa917('0x2d')][_0xa917('0x3e')]?_0x16ce51['attributes']:_0xf5ddff[_0xa917('0x28')];if(_0x448bb9[_0xa917('0x29')][_0xa917('0x38')]){_0x16ce51[_0xa917('0x39')]=[{'all':!![]}];}_0x16ce51=_[_0xa917('0x36')]({},_0x16ce51,_0x448bb9[_0xa917('0x3f')]);return db[_0xa917('0x37')]['find'](_0x16ce51)['then'](handleEntityNotFound(_0x8abee0,null))[_0xa917('0x21')](respondWithResult(_0x8abee0,null))[_0xa917('0x40')](handleError(_0x8abee0,null));};exports[_0xa917('0x41')]=function(_0xd201a4,_0x2900c2){return db['DeskConfiguration'][_0xa917('0x41')](_0xd201a4[_0xa917('0x42')],{})['then'](respondWithResult(_0x2900c2,0xc9))[_0xa917('0x40')](handleError(_0x2900c2,null));};exports['update']=function(_0x20e983,_0x4cd84a){if(_0x20e983[_0xa917('0x42')]['id']){delete _0x20e983[_0xa917('0x42')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x20e983[_0xa917('0x3c')]['id']}})[_0xa917('0x21')](handleEntityNotFound(_0x4cd84a,null))[_0xa917('0x21')](saveUpdates(_0x20e983[_0xa917('0x42')],null))[_0xa917('0x21')](respondWithResult(_0x4cd84a,null))[_0xa917('0x40')](handleError(_0x4cd84a,null));};exports[_0xa917('0x43')]=function(_0x5b7403,_0x4e3d93){return db['DeskConfiguration'][_0xa917('0x44')]({'where':{'id':_0x5b7403[_0xa917('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4e3d93,null))[_0xa917('0x21')](removeEntity(_0x4e3d93,null))[_0xa917('0x40')](handleError(_0x4e3d93,null));};exports[_0xa917('0x45')]=function(_0x1d0727,_0x2e598e,_0x5b628e){var _0x41dfc1={};var _0x238a4a={};var _0x22cbe8;var _0x38449d;return db[_0xa917('0x37')][_0xa917('0x46')]({'where':{'id':_0x1d0727[_0xa917('0x3c')]['id']}})[_0xa917('0x21')](handleEntityNotFound(_0x2e598e,null))[_0xa917('0x21')](function(_0x21d0d3){if(_0x21d0d3){_0x22cbe8=_0x21d0d3;_0x238a4a[_0xa917('0x28')]=_[_0xa917('0x2a')](db[_0xa917('0x47')][_0xa917('0x3d')]);_0x238a4a[_0xa917('0x29')]=_[_0xa917('0x2a')](_0x1d0727['query']);_0x238a4a[_0xa917('0x2b')]=_[_0xa917('0x2c')](_0x238a4a['model'],_0x238a4a['query']);_0x41dfc1[_0xa917('0x2d')]=_['intersection'](_0x238a4a[_0xa917('0x28')],qs[_0xa917('0x2e')](_0x1d0727[_0xa917('0x29')][_0xa917('0x2e')]));_0x41dfc1[_0xa917('0x2d')]=_0x41dfc1[_0xa917('0x2d')][_0xa917('0x3e')]?_0x41dfc1['attributes']:_0x238a4a[_0xa917('0x28')];_0x41dfc1['order']=qs[_0xa917('0x32')](_0x1d0727[_0xa917('0x29')][_0xa917('0x32')]);_0x41dfc1[_0xa917('0x33')]=qs[_0xa917('0x2b')](_['pick'](_0x1d0727[_0xa917('0x29')],_0x238a4a[_0xa917('0x2b')]));if(_0x1d0727[_0xa917('0x29')]['filter']){_0x41dfc1[_0xa917('0x33')]=_['merge'](_0x41dfc1[_0xa917('0x33')],{'$or':_[_0xa917('0x25')](_0x41dfc1[_0xa917('0x2d')],function(_0x5304c2){var _0x5b5e01={};_0x5b5e01[_0x5304c2]={'$like':'%'+_0x1d0727[_0xa917('0x29')][_0xa917('0x34')]+'%'};return _0x5b5e01;})});}_0x41dfc1=_[_0xa917('0x36')]({},_0x41dfc1,_0x1d0727[_0xa917('0x3f')]);return _0x22cbe8[_0xa917('0x45')](_0x41dfc1);}})['then'](function(_0x57a088){if(_0x57a088){_0x38449d=_0x57a088[_0xa917('0x3e')];if(!_0x1d0727[_0xa917('0x29')][_0xa917('0x2f')]('nolimit')){_0x41dfc1[_0xa917('0x1a')]=qs['limit'](_0x1d0727[_0xa917('0x29')][_0xa917('0x1a')]);_0x41dfc1['offset']=qs['offset'](_0x1d0727['query'][_0xa917('0x18')]);}return _0x22cbe8['getFields'](_0x41dfc1);}})[_0xa917('0x21')](function(_0x2d89d1){if(_0x2d89d1){return _0x2d89d1?{'count':_0x38449d,'rows':_0x2d89d1}:null;}})['then'](respondWithResult(_0x2e598e,null))[_0xa917('0x40')](handleError(_0x2e598e,null));};exports['getSubjects']=function(_0x3db835,_0x19fa27,_0x338f46){var _0x5e62d1={};var _0x190899={};var _0x193f05;var _0x1f6668;return db['DeskConfiguration'][_0xa917('0x46')]({'where':{'id':_0x3db835[_0xa917('0x3c')]['id']}})[_0xa917('0x21')](handleEntityNotFound(_0x19fa27,null))[_0xa917('0x21')](function(_0xeee674){if(_0xeee674){_0x193f05=_0xeee674;_0x190899[_0xa917('0x28')]=_[_0xa917('0x2a')](db[_0xa917('0x47')][_0xa917('0x3d')]);_0x190899[_0xa917('0x29')]=_['keys'](_0x3db835[_0xa917('0x29')]);_0x190899[_0xa917('0x2b')]=_[_0xa917('0x2c')](_0x190899[_0xa917('0x28')],_0x190899[_0xa917('0x29')]);_0x5e62d1[_0xa917('0x2d')]=_['intersection'](_0x190899['model'],qs[_0xa917('0x2e')](_0x3db835[_0xa917('0x29')][_0xa917('0x2e')]));_0x5e62d1[_0xa917('0x2d')]=_0x5e62d1['attributes'][_0xa917('0x3e')]?_0x5e62d1['attributes']:_0x190899[_0xa917('0x28')];_0x5e62d1[_0xa917('0x31')]=qs['sort'](_0x3db835['query'][_0xa917('0x32')]);_0x5e62d1['where']=qs['filters'](_['pick'](_0x3db835[_0xa917('0x29')],_0x190899['filters']));if(_0x3db835['query'][_0xa917('0x34')]){_0x5e62d1[_0xa917('0x33')]=_[_0xa917('0x36')](_0x5e62d1[_0xa917('0x33')],{'$or':_[_0xa917('0x25')](_0x5e62d1[_0xa917('0x2d')],function(_0x2a709c){var _0x4d336c={};_0x4d336c[_0x2a709c]={'$like':'%'+_0x3db835[_0xa917('0x29')]['filter']+'%'};return _0x4d336c;})});}_0x5e62d1=_[_0xa917('0x36')]({},_0x5e62d1,_0x3db835[_0xa917('0x3f')]);return _0x193f05[_0xa917('0x48')](_0x5e62d1);}})[_0xa917('0x21')](function(_0x29aff0){if(_0x29aff0){_0x1f6668=_0x29aff0[_0xa917('0x3e')];if(!_0x3db835[_0xa917('0x29')][_0xa917('0x2f')]('nolimit')){_0x5e62d1['limit']=qs[_0xa917('0x1a')](_0x3db835[_0xa917('0x29')]['limit']);_0x5e62d1[_0xa917('0x18')]=qs[_0xa917('0x18')](_0x3db835[_0xa917('0x29')][_0xa917('0x18')]);}return _0x193f05[_0xa917('0x48')](_0x5e62d1);}})[_0xa917('0x21')](function(_0x57d9ad){if(_0x57d9ad){return _0x57d9ad?{'count':_0x1f6668,'rows':_0x57d9ad}:null;}})[_0xa917('0x21')](respondWithResult(_0x19fa27,null))[_0xa917('0x40')](handleError(_0x19fa27,null));};exports['getDescriptions']=function(_0x2d8bae,_0x542ae7,_0x45a2bb){var _0x24f8a7={};var _0x186b51={};var _0xb45c67;var _0x50e676;return db['DeskConfiguration'][_0xa917('0x46')]({'where':{'id':_0x2d8bae[_0xa917('0x3c')]['id']}})[_0xa917('0x21')](handleEntityNotFound(_0x542ae7,null))[_0xa917('0x21')](function(_0x5984ad){if(_0x5984ad){_0xb45c67=_0x5984ad;_0x186b51[_0xa917('0x28')]=_[_0xa917('0x2a')](db[_0xa917('0x47')][_0xa917('0x3d')]);_0x186b51[_0xa917('0x29')]=_[_0xa917('0x2a')](_0x2d8bae[_0xa917('0x29')]);_0x186b51[_0xa917('0x2b')]=_[_0xa917('0x2c')](_0x186b51[_0xa917('0x28')],_0x186b51[_0xa917('0x29')]);_0x24f8a7[_0xa917('0x2d')]=_[_0xa917('0x2c')](_0x186b51[_0xa917('0x28')],qs[_0xa917('0x2e')](_0x2d8bae[_0xa917('0x29')][_0xa917('0x2e')]));_0x24f8a7['attributes']=_0x24f8a7['attributes'][_0xa917('0x3e')]?_0x24f8a7[_0xa917('0x2d')]:_0x186b51[_0xa917('0x28')];_0x24f8a7[_0xa917('0x31')]=qs[_0xa917('0x32')](_0x2d8bae[_0xa917('0x29')]['sort']);_0x24f8a7[_0xa917('0x33')]=qs[_0xa917('0x2b')](_['pick'](_0x2d8bae[_0xa917('0x29')],_0x186b51['filters']));if(_0x2d8bae[_0xa917('0x29')][_0xa917('0x34')]){_0x24f8a7[_0xa917('0x33')]=_[_0xa917('0x36')](_0x24f8a7[_0xa917('0x33')],{'$or':_[_0xa917('0x25')](_0x24f8a7['attributes'],function(_0xf47c44){var _0x2a0447={};_0x2a0447[_0xf47c44]={'$like':'%'+_0x2d8bae['query'][_0xa917('0x34')]+'%'};return _0x2a0447;})});}_0x24f8a7=_['merge']({},_0x24f8a7,_0x2d8bae[_0xa917('0x3f')]);return _0xb45c67[_0xa917('0x49')](_0x24f8a7);}})[_0xa917('0x21')](function(_0x54f240){if(_0x54f240){_0x50e676=_0x54f240[_0xa917('0x3e')];if(!_0x2d8bae[_0xa917('0x29')]['hasOwnProperty'](_0xa917('0x30'))){_0x24f8a7[_0xa917('0x1a')]=qs['limit'](_0x2d8bae['query'][_0xa917('0x1a')]);_0x24f8a7[_0xa917('0x18')]=qs[_0xa917('0x18')](_0x2d8bae['query'][_0xa917('0x18')]);}return _0xb45c67[_0xa917('0x49')](_0x24f8a7);}})[_0xa917('0x21')](function(_0x1f080e){if(_0x1f080e){return _0x1f080e?{'count':_0x50e676,'rows':_0x1f080e}:null;}})['then'](respondWithResult(_0x542ae7,null))['catch'](handleError(_0x542ae7,null));};exports[_0xa917('0x4a')]=function(_0x9836a1,_0x517fb7,_0xf99bde){var _0x2cad06={};var _0x197243={};var _0x314da5;var _0x4f82e0;return db[_0xa917('0x37')]['findOne']({'where':{'id':_0x9836a1[_0xa917('0x3c')]['id']}})[_0xa917('0x21')](handleEntityNotFound(_0x517fb7,null))['then'](function(_0x56514b){if(_0x56514b){_0x314da5=_0x56514b;_0x197243['model']=_[_0xa917('0x2a')](db[_0xa917('0x4b')][_0xa917('0x3d')]);_0x197243[_0xa917('0x29')]=_['keys'](_0x9836a1[_0xa917('0x29')]);_0x197243[_0xa917('0x2b')]=_[_0xa917('0x2c')](_0x197243['model'],_0x197243['query']);_0x2cad06[_0xa917('0x2d')]=_[_0xa917('0x2c')](_0x197243[_0xa917('0x28')],qs['fields'](_0x9836a1['query'][_0xa917('0x2e')]));_0x2cad06['attributes']=_0x2cad06[_0xa917('0x2d')][_0xa917('0x3e')]?_0x2cad06['attributes']:_0x197243['model'];_0x2cad06['order']=qs[_0xa917('0x32')](_0x9836a1['query'][_0xa917('0x32')]);_0x2cad06[_0xa917('0x33')]=qs[_0xa917('0x2b')](_[_0xa917('0x4c')](_0x9836a1[_0xa917('0x29')],_0x197243[_0xa917('0x2b')]));if(_0x9836a1[_0xa917('0x29')]['filter']){_0x2cad06[_0xa917('0x33')]=_[_0xa917('0x36')](_0x2cad06[_0xa917('0x33')],{'$or':_[_0xa917('0x25')](_0x2cad06[_0xa917('0x2d')],function(_0x7b4436){var _0x266437={};_0x266437[_0x7b4436]={'$like':'%'+_0x9836a1['query'][_0xa917('0x34')]+'%'};return _0x266437;})});}_0x2cad06=_['merge']({},_0x2cad06,_0x9836a1[_0xa917('0x3f')]);return _0x314da5[_0xa917('0x4a')](_0x2cad06);}})[_0xa917('0x21')](function(_0x44e688){if(_0x44e688){_0x4f82e0=_0x44e688[_0xa917('0x3e')];if(!_0x9836a1['query'][_0xa917('0x2f')](_0xa917('0x30'))){_0x2cad06[_0xa917('0x1a')]=qs['limit'](_0x9836a1[_0xa917('0x29')]['limit']);_0x2cad06['offset']=qs[_0xa917('0x18')](_0x9836a1[_0xa917('0x29')][_0xa917('0x18')]);}return _0x314da5[_0xa917('0x4a')](_0x2cad06);}})[_0xa917('0x21')](function(_0x2e4603){if(_0x2e4603){return _0x2e4603?{'count':_0x4f82e0,'rows':_0x2e4603}:null;}})['then'](respondWithResult(_0x517fb7,null))[_0xa917('0x40')](handleError(_0x517fb7,null));};exports[_0xa917('0x4d')]=function(_0x4140fd,_0x1db1e8,_0xef491b){if(_0x4140fd[_0xa917('0x42')]['id']){delete _0x4140fd['body']['id'];}return db[_0xa917('0x37')]['findOne']({'where':{'id':_0x4140fd[_0xa917('0x3c')]['id']}})[_0xa917('0x21')](handleEntityNotFound(_0x1db1e8,null))[_0xa917('0x21')](function(_0x1a64ce){if(_0x1a64ce){return _0x1a64ce[_0xa917('0x4d')](_0x4140fd[_0xa917('0x42')][_0xa917('0x4e')]||[]);}return null;})[_0xa917('0x21')](respondWithResult(_0x1db1e8,null))[_0xa917('0x40')](handleError(_0x1db1e8,null));};
\ No newline at end of file
+var _0x4696=['keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','DeskConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','findOne','DeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query'];(function(_0x5635dd,_0x553f61){var _0x529070=function(_0x6160d){while(--_0x6160d){_0x5635dd['push'](_0x5635dd['shift']());}};_0x529070(++_0x553f61);}(_0x4696,0x1c9));var _0x6469=function(_0x1c9b46,_0x507d41){_0x1c9b46=_0x1c9b46-0x0;var _0x2d199c=_0x4696[_0x1c9b46];return _0x2d199c;};'use strict';var emlformat=require(_0x6469('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6469('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6469('0x2'));var moment=require(_0x6469('0x3'));var BPromise=require(_0x6469('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6469('0x5'));var sox=require(_0x6469('0x6'));var csv=require('to-csv');var ejs=require(_0x6469('0x7'));var fs=require('fs');var fs_extra=require(_0x6469('0x8'));var _=require(_0x6469('0x9'));var squel=require(_0x6469('0xa'));var crypto=require('crypto');var jsforce=require(_0x6469('0xb'));var deskjs=require(_0x6469('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6469('0xd'));var Redis=require(_0x6469('0xe'));var authService=require(_0x6469('0xf'));var qs=require(_0x6469('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6469('0x11'));var logger=require('../../config/logger')(_0x6469('0x12'));var utils=require(_0x6469('0x13'));var config=require(_0x6469('0x14'));var licenseUtil=require(_0x6469('0x15'));var db=require(_0x6469('0x16'))['db'];function respondWithStatusCode(_0x836d42,_0x5d0b54){_0x5d0b54=_0x5d0b54||0xcc;return function(_0x4e4577){if(_0x4e4577){return _0x836d42[_0x6469('0x17')](_0x5d0b54);}return _0x836d42[_0x6469('0x18')](_0x5d0b54)[_0x6469('0x19')]();};}function respondWithResult(_0x80f51,_0x33c9bb){_0x33c9bb=_0x33c9bb||0xc8;return function(_0x346719){if(_0x346719){return _0x80f51['status'](_0x33c9bb)[_0x6469('0x1a')](_0x346719);}};}function respondWithFilteredResult(_0x1ff916,_0x3f88df){return function(_0x6c8097){if(_0x6c8097){var _0x5ed5a4=typeof _0x3f88df[_0x6469('0x1b')]===_0x6469('0x1c')&&typeof _0x3f88df['limit']===_0x6469('0x1c');var _0x84c6df=_0x6c8097[_0x6469('0x1d')];var _0xe6aa36=_0x5ed5a4?0x0:_0x3f88df[_0x6469('0x1b')];var _0x2de6f8=_0x5ed5a4?_0x6c8097['count']:_0x3f88df['offset']+_0x3f88df[_0x6469('0x1e')];var _0x263210;if(_0x2de6f8>=_0x84c6df){_0x2de6f8=_0x84c6df;_0x263210=0xc8;}else{_0x263210=0xce;}_0x1ff916['status'](_0x263210);return _0x1ff916[_0x6469('0x1f')]('Content-Range',_0xe6aa36+'-'+_0x2de6f8+'/'+_0x84c6df)[_0x6469('0x1a')](_0x6c8097);}return null;};}function patchUpdates(_0x2bdf93){return function(_0x3a8668){try{jsonpatch[_0x6469('0x20')](_0x3a8668,_0x2bdf93,!![]);}catch(_0x14a90b){return BPromise['reject'](_0x14a90b);}return _0x3a8668[_0x6469('0x21')]();};}function saveUpdates(_0x4990d1,_0x5c39ad){return function(_0x49a2e9){if(_0x49a2e9){return _0x49a2e9[_0x6469('0x22')](_0x4990d1)[_0x6469('0x23')](function(_0x2b5485){return _0x2b5485;});}return null;};}function removeEntity(_0x4ae00f,_0x5d9a8b){return function(_0x59f023){if(_0x59f023){return _0x59f023['destroy']()[_0x6469('0x23')](function(){_0x4ae00f[_0x6469('0x18')](0xcc)[_0x6469('0x19')]();});}};}function handleEntityNotFound(_0x4d7b9c,_0x33aeaf){return function(_0xf67874){if(!_0xf67874){_0x4d7b9c[_0x6469('0x17')](0x194);}return _0xf67874;};}function handleError(_0x2aeace,_0x7aca91){_0x7aca91=_0x7aca91||0x1f4;return function(_0x1ba314){logger[_0x6469('0x24')](_0x1ba314['stack']);if(_0x1ba314[_0x6469('0x25')]){delete _0x1ba314[_0x6469('0x25')];}_0x2aeace[_0x6469('0x18')](_0x7aca91)[_0x6469('0x26')](_0x1ba314);};}exports[_0x6469('0x27')]=function(_0xc12e34,_0x41ddec){var _0x12625d={},_0xd6baab={},_0x1b82ea={'count':0x0,'rows':[]};var _0x16ad1d=_[_0x6469('0x28')](db['DeskConfiguration'][_0x6469('0x29')],function(_0x3cdaa4){return{'name':_0x3cdaa4[_0x6469('0x2a')],'type':_0x3cdaa4[_0x6469('0x2b')][_0x6469('0x2c')]};});_0xd6baab[_0x6469('0x2d')]=_['map'](_0x16ad1d,_0x6469('0x25'));_0xd6baab[_0x6469('0x2e')]=_[_0x6469('0x2f')](_0xc12e34['query']);_0xd6baab[_0x6469('0x30')]=_['intersection'](_0xd6baab[_0x6469('0x2d')],_0xd6baab[_0x6469('0x2e')]);_0x12625d[_0x6469('0x31')]=_[_0x6469('0x32')](_0xd6baab[_0x6469('0x2d')],qs[_0x6469('0x33')](_0xc12e34['query'][_0x6469('0x33')]));_0x12625d[_0x6469('0x31')]=_0x12625d[_0x6469('0x31')][_0x6469('0x34')]?_0x12625d['attributes']:_0xd6baab[_0x6469('0x2d')];if(!_0xc12e34[_0x6469('0x2e')][_0x6469('0x35')](_0x6469('0x36'))){_0x12625d[_0x6469('0x1e')]=qs[_0x6469('0x1e')](_0xc12e34[_0x6469('0x2e')][_0x6469('0x1e')]);_0x12625d[_0x6469('0x1b')]=qs[_0x6469('0x1b')](_0xc12e34['query']['offset']);}_0x12625d[_0x6469('0x37')]=qs[_0x6469('0x38')](_0xc12e34[_0x6469('0x2e')]['sort']);_0x12625d[_0x6469('0x39')]=qs[_0x6469('0x30')](_[_0x6469('0x3a')](_0xc12e34[_0x6469('0x2e')],_0xd6baab[_0x6469('0x30')]),_0x16ad1d);if(_0xc12e34[_0x6469('0x2e')][_0x6469('0x3b')]){_0x12625d['where']=_[_0x6469('0x3c')](_0x12625d[_0x6469('0x39')],{'$or':_[_0x6469('0x28')](_0x16ad1d,function(_0x190e09){if(_0x190e09[_0x6469('0x2b')]!==_0x6469('0x3d')){var _0x524c48={};_0x524c48[_0x190e09[_0x6469('0x25')]]={'$like':'%'+_0xc12e34[_0x6469('0x2e')][_0x6469('0x3b')]+'%'};return _0x524c48;}})});}_0x12625d=_['merge']({},_0x12625d,_0xc12e34[_0x6469('0x3e')]);var _0x282824={'where':_0x12625d[_0x6469('0x39')]};return db[_0x6469('0x3f')][_0x6469('0x1d')](_0x282824)[_0x6469('0x23')](function(_0xe2ddea){_0x1b82ea['count']=_0xe2ddea;if(_0xc12e34[_0x6469('0x2e')][_0x6469('0x40')]){_0x12625d[_0x6469('0x41')]=[{'all':!![]}];}return db[_0x6469('0x3f')][_0x6469('0x42')](_0x12625d);})['then'](function(_0x44e900){_0x1b82ea[_0x6469('0x43')]=_0x44e900;return _0x1b82ea;})[_0x6469('0x23')](respondWithFilteredResult(_0x41ddec,_0x12625d))[_0x6469('0x44')](handleError(_0x41ddec,null));};exports[_0x6469('0x45')]=function(_0x22915b,_0x1c38f2){var _0x1d1313={'raw':![],'where':{'id':_0x22915b[_0x6469('0x46')]['id']}},_0x5b7cad={};_0x5b7cad[_0x6469('0x2d')]=_['keys'](db[_0x6469('0x3f')]['rawAttributes']);_0x5b7cad[_0x6469('0x2e')]=_[_0x6469('0x2f')](_0x22915b[_0x6469('0x2e')]);_0x5b7cad[_0x6469('0x30')]=_[_0x6469('0x32')](_0x5b7cad['model'],_0x5b7cad[_0x6469('0x2e')]);_0x1d1313[_0x6469('0x31')]=_['intersection'](_0x5b7cad[_0x6469('0x2d')],qs[_0x6469('0x33')](_0x22915b[_0x6469('0x2e')]['fields']));_0x1d1313['attributes']=_0x1d1313[_0x6469('0x31')][_0x6469('0x34')]?_0x1d1313[_0x6469('0x31')]:_0x5b7cad[_0x6469('0x2d')];if(_0x22915b[_0x6469('0x2e')]['includeAll']){_0x1d1313[_0x6469('0x41')]=[{'all':!![]}];}_0x1d1313=_[_0x6469('0x3c')]({},_0x1d1313,_0x22915b[_0x6469('0x3e')]);return db[_0x6469('0x3f')][_0x6469('0x47')](_0x1d1313)[_0x6469('0x23')](handleEntityNotFound(_0x1c38f2,null))['then'](respondWithResult(_0x1c38f2,null))[_0x6469('0x44')](handleError(_0x1c38f2,null));};exports[_0x6469('0x48')]=function(_0x4bbcd3,_0x58dda8){return db[_0x6469('0x3f')]['create'](_0x4bbcd3[_0x6469('0x49')],{})[_0x6469('0x23')](respondWithResult(_0x58dda8,0xc9))[_0x6469('0x44')](handleError(_0x58dda8,null));};exports[_0x6469('0x22')]=function(_0x33ba69,_0x157091){if(_0x33ba69[_0x6469('0x49')]['id']){delete _0x33ba69[_0x6469('0x49')]['id'];}return db['DeskConfiguration'][_0x6469('0x47')]({'where':{'id':_0x33ba69[_0x6469('0x46')]['id']}})['then'](handleEntityNotFound(_0x157091,null))[_0x6469('0x23')](saveUpdates(_0x33ba69[_0x6469('0x49')],null))[_0x6469('0x23')](respondWithResult(_0x157091,null))[_0x6469('0x44')](handleError(_0x157091,null));};exports[_0x6469('0x4a')]=function(_0x15fd85,_0x1f4bc4){return db[_0x6469('0x3f')][_0x6469('0x47')]({'where':{'id':_0x15fd85[_0x6469('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f4bc4,null))[_0x6469('0x23')](removeEntity(_0x1f4bc4,null))[_0x6469('0x44')](handleError(_0x1f4bc4,null));};exports['getFields']=function(_0x429d1d,_0x1d9839,_0x5ba868){var _0x281ceb={};var _0x29c42b={};var _0x2d16a2;var _0x4cd9e2;return db[_0x6469('0x3f')][_0x6469('0x4b')]({'where':{'id':_0x429d1d[_0x6469('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d9839,null))['then'](function(_0x54a791){if(_0x54a791){_0x2d16a2=_0x54a791;_0x29c42b['model']=_[_0x6469('0x2f')](db[_0x6469('0x4c')]['rawAttributes']);_0x29c42b['query']=_['keys'](_0x429d1d[_0x6469('0x2e')]);_0x29c42b['filters']=_[_0x6469('0x32')](_0x29c42b['model'],_0x29c42b[_0x6469('0x2e')]);_0x281ceb['attributes']=_['intersection'](_0x29c42b[_0x6469('0x2d')],qs[_0x6469('0x33')](_0x429d1d[_0x6469('0x2e')][_0x6469('0x33')]));_0x281ceb[_0x6469('0x31')]=_0x281ceb[_0x6469('0x31')]['length']?_0x281ceb[_0x6469('0x31')]:_0x29c42b[_0x6469('0x2d')];_0x281ceb[_0x6469('0x37')]=qs[_0x6469('0x38')](_0x429d1d['query']['sort']);_0x281ceb[_0x6469('0x39')]=qs['filters'](_[_0x6469('0x3a')](_0x429d1d[_0x6469('0x2e')],_0x29c42b[_0x6469('0x30')]));if(_0x429d1d['query'][_0x6469('0x3b')]){_0x281ceb[_0x6469('0x39')]=_[_0x6469('0x3c')](_0x281ceb[_0x6469('0x39')],{'$or':_[_0x6469('0x28')](_0x281ceb[_0x6469('0x31')],function(_0x3560ac){var _0x43f9ee={};_0x43f9ee[_0x3560ac]={'$like':'%'+_0x429d1d[_0x6469('0x2e')]['filter']+'%'};return _0x43f9ee;})});}_0x281ceb=_['merge']({},_0x281ceb,_0x429d1d['options']);return _0x2d16a2[_0x6469('0x4d')](_0x281ceb);}})['then'](function(_0x3f058d){if(_0x3f058d){_0x4cd9e2=_0x3f058d[_0x6469('0x34')];if(!_0x429d1d['query'][_0x6469('0x35')](_0x6469('0x36'))){_0x281ceb[_0x6469('0x1e')]=qs[_0x6469('0x1e')](_0x429d1d[_0x6469('0x2e')][_0x6469('0x1e')]);_0x281ceb[_0x6469('0x1b')]=qs['offset'](_0x429d1d['query']['offset']);}return _0x2d16a2[_0x6469('0x4d')](_0x281ceb);}})[_0x6469('0x23')](function(_0x3f33fc){if(_0x3f33fc){return _0x3f33fc?{'count':_0x4cd9e2,'rows':_0x3f33fc}:null;}})[_0x6469('0x23')](respondWithResult(_0x1d9839,null))[_0x6469('0x44')](handleError(_0x1d9839,null));};exports[_0x6469('0x4e')]=function(_0xc93e43,_0x479c7d,_0x2ec0d1){var _0x23a000={};var _0x3a5c9f={};var _0x25daf0;var _0x1ac89b;return db[_0x6469('0x3f')][_0x6469('0x4b')]({'where':{'id':_0xc93e43[_0x6469('0x46')]['id']}})[_0x6469('0x23')](handleEntityNotFound(_0x479c7d,null))['then'](function(_0x4f9ca4){if(_0x4f9ca4){_0x25daf0=_0x4f9ca4;_0x3a5c9f['model']=_[_0x6469('0x2f')](db[_0x6469('0x4c')][_0x6469('0x29')]);_0x3a5c9f[_0x6469('0x2e')]=_[_0x6469('0x2f')](_0xc93e43[_0x6469('0x2e')]);_0x3a5c9f[_0x6469('0x30')]=_[_0x6469('0x32')](_0x3a5c9f[_0x6469('0x2d')],_0x3a5c9f[_0x6469('0x2e')]);_0x23a000['attributes']=_[_0x6469('0x32')](_0x3a5c9f[_0x6469('0x2d')],qs[_0x6469('0x33')](_0xc93e43['query'][_0x6469('0x33')]));_0x23a000[_0x6469('0x31')]=_0x23a000[_0x6469('0x31')][_0x6469('0x34')]?_0x23a000['attributes']:_0x3a5c9f[_0x6469('0x2d')];_0x23a000[_0x6469('0x37')]=qs[_0x6469('0x38')](_0xc93e43['query'][_0x6469('0x38')]);_0x23a000[_0x6469('0x39')]=qs[_0x6469('0x30')](_[_0x6469('0x3a')](_0xc93e43[_0x6469('0x2e')],_0x3a5c9f[_0x6469('0x30')]));if(_0xc93e43[_0x6469('0x2e')][_0x6469('0x3b')]){_0x23a000[_0x6469('0x39')]=_[_0x6469('0x3c')](_0x23a000['where'],{'$or':_['map'](_0x23a000[_0x6469('0x31')],function(_0x127ebf){var _0x3f71a1={};_0x3f71a1[_0x127ebf]={'$like':'%'+_0xc93e43[_0x6469('0x2e')]['filter']+'%'};return _0x3f71a1;})});}_0x23a000=_[_0x6469('0x3c')]({},_0x23a000,_0xc93e43[_0x6469('0x3e')]);return _0x25daf0[_0x6469('0x4e')](_0x23a000);}})['then'](function(_0x43c963){if(_0x43c963){_0x1ac89b=_0x43c963['length'];if(!_0xc93e43['query'][_0x6469('0x35')](_0x6469('0x36'))){_0x23a000[_0x6469('0x1e')]=qs[_0x6469('0x1e')](_0xc93e43[_0x6469('0x2e')][_0x6469('0x1e')]);_0x23a000[_0x6469('0x1b')]=qs['offset'](_0xc93e43[_0x6469('0x2e')][_0x6469('0x1b')]);}return _0x25daf0[_0x6469('0x4e')](_0x23a000);}})['then'](function(_0x41639e){if(_0x41639e){return _0x41639e?{'count':_0x1ac89b,'rows':_0x41639e}:null;}})[_0x6469('0x23')](respondWithResult(_0x479c7d,null))[_0x6469('0x44')](handleError(_0x479c7d,null));};exports[_0x6469('0x4f')]=function(_0x4a7301,_0x4a80db,_0x45ebd9){var _0x28e794={};var _0x5b46b0={};var _0x90209d;var _0x367224;return db[_0x6469('0x3f')][_0x6469('0x4b')]({'where':{'id':_0x4a7301[_0x6469('0x46')]['id']}})[_0x6469('0x23')](handleEntityNotFound(_0x4a80db,null))['then'](function(_0x5a69cc){if(_0x5a69cc){_0x90209d=_0x5a69cc;_0x5b46b0[_0x6469('0x2d')]=_[_0x6469('0x2f')](db[_0x6469('0x4c')][_0x6469('0x29')]);_0x5b46b0[_0x6469('0x2e')]=_[_0x6469('0x2f')](_0x4a7301[_0x6469('0x2e')]);_0x5b46b0['filters']=_['intersection'](_0x5b46b0[_0x6469('0x2d')],_0x5b46b0['query']);_0x28e794[_0x6469('0x31')]=_[_0x6469('0x32')](_0x5b46b0[_0x6469('0x2d')],qs[_0x6469('0x33')](_0x4a7301['query'][_0x6469('0x33')]));_0x28e794[_0x6469('0x31')]=_0x28e794[_0x6469('0x31')][_0x6469('0x34')]?_0x28e794[_0x6469('0x31')]:_0x5b46b0[_0x6469('0x2d')];_0x28e794[_0x6469('0x37')]=qs[_0x6469('0x38')](_0x4a7301['query']['sort']);_0x28e794[_0x6469('0x39')]=qs['filters'](_['pick'](_0x4a7301[_0x6469('0x2e')],_0x5b46b0[_0x6469('0x30')]));if(_0x4a7301['query']['filter']){_0x28e794['where']=_[_0x6469('0x3c')](_0x28e794[_0x6469('0x39')],{'$or':_[_0x6469('0x28')](_0x28e794[_0x6469('0x31')],function(_0x1fec92){var _0x506343={};_0x506343[_0x1fec92]={'$like':'%'+_0x4a7301[_0x6469('0x2e')][_0x6469('0x3b')]+'%'};return _0x506343;})});}_0x28e794=_[_0x6469('0x3c')]({},_0x28e794,_0x4a7301[_0x6469('0x3e')]);return _0x90209d[_0x6469('0x4f')](_0x28e794);}})[_0x6469('0x23')](function(_0x587703){if(_0x587703){_0x367224=_0x587703['length'];if(!_0x4a7301[_0x6469('0x2e')][_0x6469('0x35')](_0x6469('0x36'))){_0x28e794[_0x6469('0x1e')]=qs[_0x6469('0x1e')](_0x4a7301[_0x6469('0x2e')][_0x6469('0x1e')]);_0x28e794[_0x6469('0x1b')]=qs[_0x6469('0x1b')](_0x4a7301['query']['offset']);}return _0x90209d[_0x6469('0x4f')](_0x28e794);}})[_0x6469('0x23')](function(_0x895708){if(_0x895708){return _0x895708?{'count':_0x367224,'rows':_0x895708}:null;}})[_0x6469('0x23')](respondWithResult(_0x4a80db,null))['catch'](handleError(_0x4a80db,null));};exports[_0x6469('0x50')]=function(_0x104ff6,_0x4de137,_0x4236e8){var _0x2c7e94={};var _0x17c3db={};var _0x3bf98f;var _0xac55d5;return db[_0x6469('0x3f')]['findOne']({'where':{'id':_0x104ff6['params']['id']}})[_0x6469('0x23')](handleEntityNotFound(_0x4de137,null))['then'](function(_0x5e57f9){if(_0x5e57f9){_0x3bf98f=_0x5e57f9;_0x17c3db[_0x6469('0x2d')]=_[_0x6469('0x2f')](db[_0x6469('0x51')][_0x6469('0x29')]);_0x17c3db[_0x6469('0x2e')]=_[_0x6469('0x2f')](_0x104ff6[_0x6469('0x2e')]);_0x17c3db[_0x6469('0x30')]=_[_0x6469('0x32')](_0x17c3db[_0x6469('0x2d')],_0x17c3db[_0x6469('0x2e')]);_0x2c7e94[_0x6469('0x31')]=_[_0x6469('0x32')](_0x17c3db['model'],qs[_0x6469('0x33')](_0x104ff6['query'][_0x6469('0x33')]));_0x2c7e94[_0x6469('0x31')]=_0x2c7e94[_0x6469('0x31')]['length']?_0x2c7e94[_0x6469('0x31')]:_0x17c3db[_0x6469('0x2d')];_0x2c7e94['order']=qs[_0x6469('0x38')](_0x104ff6[_0x6469('0x2e')][_0x6469('0x38')]);_0x2c7e94[_0x6469('0x39')]=qs[_0x6469('0x30')](_[_0x6469('0x3a')](_0x104ff6[_0x6469('0x2e')],_0x17c3db[_0x6469('0x30')]));if(_0x104ff6[_0x6469('0x2e')][_0x6469('0x3b')]){_0x2c7e94[_0x6469('0x39')]=_[_0x6469('0x3c')](_0x2c7e94[_0x6469('0x39')],{'$or':_[_0x6469('0x28')](_0x2c7e94[_0x6469('0x31')],function(_0x340bf6){var _0x354c4c={};_0x354c4c[_0x340bf6]={'$like':'%'+_0x104ff6[_0x6469('0x2e')][_0x6469('0x3b')]+'%'};return _0x354c4c;})});}_0x2c7e94=_['merge']({},_0x2c7e94,_0x104ff6[_0x6469('0x3e')]);return _0x3bf98f[_0x6469('0x50')](_0x2c7e94);}})[_0x6469('0x23')](function(_0x1dc2b1){if(_0x1dc2b1){_0xac55d5=_0x1dc2b1['length'];if(!_0x104ff6[_0x6469('0x2e')]['hasOwnProperty'](_0x6469('0x36'))){_0x2c7e94[_0x6469('0x1e')]=qs[_0x6469('0x1e')](_0x104ff6[_0x6469('0x2e')][_0x6469('0x1e')]);_0x2c7e94[_0x6469('0x1b')]=qs[_0x6469('0x1b')](_0x104ff6[_0x6469('0x2e')][_0x6469('0x1b')]);}return _0x3bf98f[_0x6469('0x50')](_0x2c7e94);}})['then'](function(_0x394e71){if(_0x394e71){return _0x394e71?{'count':_0xac55d5,'rows':_0x394e71}:null;}})[_0x6469('0x23')](respondWithResult(_0x4de137,null))[_0x6469('0x44')](handleError(_0x4de137,null));};exports[_0x6469('0x52')]=function(_0x5467a6,_0x1c19e8,_0x20c904){if(_0x5467a6[_0x6469('0x49')]['id']){delete _0x5467a6['body']['id'];}return db[_0x6469('0x3f')][_0x6469('0x4b')]({'where':{'id':_0x5467a6[_0x6469('0x46')]['id']}})[_0x6469('0x23')](handleEntityNotFound(_0x1c19e8,null))[_0x6469('0x23')](function(_0x5b49ed){if(_0x5b49ed){return _0x5b49ed[_0x6469('0x52')](_0x5467a6[_0x6469('0x49')][_0x6469('0x53')]||[]);}return null;})[_0x6469('0x23')](respondWithResult(_0x1c19e8,null))[_0x6469('0x44')](handleError(_0x1c19e8,null));};
\ No newline at end of file
index dbb6c4a..6f3d541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe0e=['../../config/environment','./intDeskConfiguration.attributes','define','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xfe0e,0x1a4));var _0xefe0=function(_0xe96931,_0x2f59d7){_0xe96931=_0xe96931-0x0;var _0x332f08=_0xfe0e[_0xe96931];return _0x332f08;};'use strict';var _=require(_0xefe0('0x0'));var util=require(_0xefe0('0x1'));var logger=require(_0xefe0('0x2'))(_0xefe0('0x3'));var moment=require(_0xefe0('0x4'));var BPromise=require(_0xefe0('0x5'));var rp=require(_0xefe0('0x6'));var fs=require('fs');var path=require(_0xefe0('0x7'));var rimraf=require(_0xefe0('0x8'));var config=require(_0xefe0('0x9'));var attributes=require(_0xefe0('0xa'));module['exports']=function(_0x118045,_0xd1de62){return _0x118045[_0xefe0('0xb')]('DeskConfiguration',attributes,{'tableName':_0xefe0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x051a=['bluebird','request-promise','path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','lodash','util','api'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x051a,0xe3));var _0xa051=function(_0x53c31c,_0x332310){_0x53c31c=_0x53c31c-0x0;var _0x1710d=_0x051a[_0x53c31c];return _0x1710d;};'use strict';var _=require(_0xa051('0x0'));var util=require(_0xa051('0x1'));var logger=require('../../config/logger')(_0xa051('0x2'));var moment=require('moment');var BPromise=require(_0xa051('0x3'));var rp=require(_0xa051('0x4'));var fs=require('fs');var path=require(_0xa051('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa051('0x6'));module[_0xa051('0x7')]=function(_0x78d440,_0x5895d8){return _0x78d440[_0xa051('0x8')](_0xa051('0x9'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d3c6de..070e9b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf08c=['jayson/promise','http','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x5e5138,_0x3f9a31){var _0x28c2cd=function(_0x25a196){while(--_0x25a196){_0x5e5138['push'](_0x5e5138['shift']());}};_0x28c2cd(++_0x3f9a31);}(_0xf08c,0xb5));var _0xcf08=function(_0x3cd5eb,_0x195801){_0x3cd5eb=_0x3cd5eb-0x0;var _0x38b875=_0xf08c[_0x3cd5eb];return _0x38b875;};'use strict';var _=require(_0xcf08('0x0'));var util=require(_0xcf08('0x1'));var moment=require(_0xcf08('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf08('0x3'));var fs=require('fs');var Redis=require(_0xcf08('0x4'));var db=require(_0xcf08('0x5'))['db'];var utils=require(_0xcf08('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcf08('0x7'));var jayson=require(_0xcf08('0x8'));var client=jayson['client'][_0xcf08('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37efab,_0x13b89c,_0x42c7b0){return new BPromise(function(_0x59d6d6,_0x5044bb){return client[_0xcf08('0xa')](_0x37efab,_0x42c7b0)['then'](function(_0x1ab45d){logger[_0xcf08('0xb')](_0xcf08('0xc'),_0x13b89c,_0xcf08('0xd'));logger['debug'](_0xcf08('0xe'),_0x13b89c,_0xcf08('0xd'),JSON[_0xcf08('0xf')](_0x1ab45d));if(_0x1ab45d[_0xcf08('0x10')]){if(_0x1ab45d[_0xcf08('0x10')][_0xcf08('0x11')]===0x1f4){logger[_0xcf08('0x10')](_0xcf08('0xc'),_0x13b89c,_0x1ab45d[_0xcf08('0x10')][_0xcf08('0x12')]);return _0x5044bb(_0x1ab45d[_0xcf08('0x10')]['message']);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x13b89c,_0x1ab45d[_0xcf08('0x10')][_0xcf08('0x12')]);return _0x59d6d6(_0x1ab45d['error'][_0xcf08('0x12')]);}else{logger[_0xcf08('0xb')](_0xcf08('0xc'),_0x13b89c,_0xcf08('0xd'));_0x59d6d6(_0x1ab45d[_0xcf08('0x13')]['message']);}})[_0xcf08('0x14')](function(_0x5d89a7){logger['error'](_0xcf08('0xc'),_0x13b89c,_0x5d89a7);_0x5044bb(_0x5d89a7);});});}
\ No newline at end of file
+var _0x4628=['jayson/promise','client','request','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0xad9d4d,_0x5bf432){var _0x195e72=function(_0x1d2e78){while(--_0x1d2e78){_0xad9d4d['push'](_0xad9d4d['shift']());}};_0x195e72(++_0x5bf432);}(_0x4628,0xd3));var _0x8462=function(_0x56d372,_0x2dbf5d){_0x56d372=_0x56d372-0x0;var _0x3650e5=_0x4628[_0x56d372];return _0x3650e5;};'use strict';var _=require(_0x8462('0x0'));var util=require(_0x8462('0x1'));var moment=require('moment');var BPromise=require(_0x8462('0x2'));var rs=require(_0x8462('0x3'));var fs=require('fs');var Redis=require(_0x8462('0x4'));var db=require(_0x8462('0x5'))['db'];var utils=require(_0x8462('0x6'));var logger=require('../../config/logger')(_0x8462('0x7'));var config=require(_0x8462('0x8'));var jayson=require(_0x8462('0x9'));var client=jayson[_0x8462('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12dad7,_0x4b92a7,_0x162bea){return new BPromise(function(_0x4b987a,_0x314c4c){return client[_0x8462('0xb')](_0x12dad7,_0x162bea)['then'](function(_0x58ec31){logger[_0x8462('0xc')](_0x8462('0xd'),_0x4b92a7,_0x8462('0xe'));logger[_0x8462('0xf')](_0x8462('0x10'),_0x4b92a7,_0x8462('0xe'),JSON['stringify'](_0x58ec31));if(_0x58ec31[_0x8462('0x11')]){if(_0x58ec31[_0x8462('0x11')]['code']===0x1f4){logger[_0x8462('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4b92a7,_0x58ec31['error']['message']);return _0x314c4c(_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);}logger[_0x8462('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4b92a7,_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);return _0x4b987a(_0x58ec31[_0x8462('0x11')][_0x8462('0x12')]);}else{logger['info'](_0x8462('0xd'),_0x4b92a7,_0x8462('0xe'));_0x4b987a(_0x58ec31['result'][_0x8462('0x12')]);}})[_0x8462('0x13')](function(_0xabd292){logger[_0x8462('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x4b92a7,_0xabd292);_0x314c4c(_0xabd292);});});}
\ No newline at end of file
index 82840a8..e60f073 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88be=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post','create','update'];(function(_0x4eb36c,_0x4ccf62){var _0x11dbb0=function(_0x101732){while(--_0x101732){_0x4eb36c['push'](_0x4eb36c['shift']());}};_0x11dbb0(++_0x4ccf62);}(_0x88be,0xcb));var _0xe88b=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x88be[_0x543084];return _0x306a57;};'use strict';var multer=require('multer');var util=require(_0xe88b('0x0'));var path=require(_0xe88b('0x1'));var timeout=require(_0xe88b('0x2'));var express=require(_0xe88b('0x3'));var router=express[_0xe88b('0x4')]();var fs_extra=require(_0xe88b('0x5'));var auth=require(_0xe88b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe88b('0x7'));var controller=require(_0xe88b('0x8'));router['get']('/',auth[_0xe88b('0x9')](),controller[_0xe88b('0xa')]);router[_0xe88b('0xb')](_0xe88b('0xc'),auth[_0xe88b('0x9')](),controller[_0xe88b('0xd')]);router[_0xe88b('0xe')]('/',auth['isAuthenticated'](),controller[_0xe88b('0xf')]);router['put'](_0xe88b('0xc'),auth[_0xe88b('0x9')](),controller[_0xe88b('0x10')]);router[_0xe88b('0x11')]('/:id',auth[_0xe88b('0x9')](),controller[_0xe88b('0x12')]);module[_0xe88b('0x13')]=router;
\ No newline at end of file
+var _0x3442=['create','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDeskField.controller','isAuthenticated','index','get','/:id','show','post'];(function(_0x89013d,_0xc03f0b){var _0x35e196=function(_0x53e894){while(--_0x53e894){_0x89013d['push'](_0x89013d['shift']());}};_0x35e196(++_0xc03f0b);}(_0x3442,0x15a));var _0x2344=function(_0x4adcd4,_0x15bbb4){_0x4adcd4=_0x4adcd4-0x0;var _0x1193ca=_0x3442[_0x4adcd4];return _0x1193ca;};'use strict';var multer=require('multer');var util=require(_0x2344('0x0'));var path=require(_0x2344('0x1'));var timeout=require(_0x2344('0x2'));var express=require(_0x2344('0x3'));var router=express[_0x2344('0x4')]();var fs_extra=require(_0x2344('0x5'));var auth=require(_0x2344('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2344('0x7'));var controller=require(_0x2344('0x8'));router['get']('/',auth[_0x2344('0x9')](),controller[_0x2344('0xa')]);router[_0x2344('0xb')](_0x2344('0xc'),auth[_0x2344('0x9')](),controller[_0x2344('0xd')]);router[_0x2344('0xe')]('/',auth[_0x2344('0x9')](),controller[_0x2344('0xf')]);router['put'](_0x2344('0xc'),auth[_0x2344('0x9')](),controller[_0x2344('0x10')]);router[_0x2344('0x11')](_0x2344('0xc'),auth[_0x2344('0x9')](),controller['destroy']);module[_0x2344('0x12')]=router;
\ No newline at end of file
index 7ed8d57..e8d0856 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x028f=['ENUM','BOOLEAN','sequelize','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x1ff1fd,_0x3dd41e){var _0x311102=function(_0x37694e){while(--_0x37694e){_0x1ff1fd['push'](_0x1ff1fd['shift']());}};_0x311102(++_0x3dd41e);}(_0x028f,0x161));var _0xf028=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x028f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf028('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xf028('0x1'),_0xf028('0x2'),_0xf028('0x3'),_0xf028('0x4'),_0xf028('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xf028('0x6')]},'key':{'type':Sequelize[_0xf028('0x6')]},'keyType':{'type':Sequelize[_0xf028('0x7')](_0xf028('0x1'),_0xf028('0x2'),_0xf028('0x3'))},'keyContent':{'type':Sequelize[_0xf028('0x6')]},'idField':{'type':Sequelize[_0xf028('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf028('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8273=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x2cde0a,_0x1f9695){var _0x260610=function(_0x179089){while(--_0x179089){_0x2cde0a['push'](_0x2cde0a['shift']());}};_0x260610(++_0x1f9695);}(_0x8273,0xb9));var _0x3827=function(_0xcd22a3,_0x33ae8f){_0xcd22a3=_0xcd22a3-0x0;var _0x1deacc=_0x8273[_0xcd22a3];return _0x1deacc;};'use strict';var Sequelize=require(_0x3827('0x0'));module[_0x3827('0x1')]={'type':{'type':Sequelize[_0x3827('0x2')](_0x3827('0x3'),_0x3827('0x4'),_0x3827('0x5'),_0x3827('0x6'),_0x3827('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3827('0x8')]},'key':{'type':Sequelize[_0x3827('0x8')]},'keyType':{'type':Sequelize['ENUM']('string',_0x3827('0x4'),_0x3827('0x5'))},'keyContent':{'type':Sequelize[_0x3827('0x8')]},'idField':{'type':Sequelize[_0x3827('0x8')]},'nameField':{'type':Sequelize[_0x3827('0x8')]},'customField':{'type':Sequelize[_0x3827('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 26e7e32..7774851 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb39f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','DeskField','includeAll','rows','show','params','length','find','catch','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x5d177f,_0x2728cd){var _0x4ed627=function(_0x1c856d){while(--_0x1c856d){_0x5d177f['push'](_0x5d177f['shift']());}};_0x4ed627(++_0x2728cd);}(_0xb39f,0x1e6));var _0xfb39=function(_0x81ba67,_0x20082b){_0x81ba67=_0x81ba67-0x0;var _0x2fa794=_0xb39f[_0x81ba67];return _0x2fa794;};'use strict';var emlformat=require(_0xfb39('0x0'));var rimraf=require(_0xfb39('0x1'));var zipdir=require(_0xfb39('0x2'));var jsonpatch=require(_0xfb39('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfb39('0x4'));var util=require('util');var path=require(_0xfb39('0x5'));var sox=require(_0xfb39('0x6'));var csv=require('to-csv');var ejs=require(_0xfb39('0x7'));var fs=require('fs');var fs_extra=require(_0xfb39('0x8'));var _=require(_0xfb39('0x9'));var squel=require(_0xfb39('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfb39('0xb'));var toCsv=require(_0xfb39('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfb39('0xd'));var qs=require(_0xfb39('0xe'));var as=require(_0xfb39('0xf'));var hardwareService=require(_0xfb39('0x10'));var logger=require(_0xfb39('0x11'))('api');var utils=require(_0xfb39('0x12'));var config=require(_0xfb39('0x13'));var licenseUtil=require(_0xfb39('0x14'));var db=require(_0xfb39('0x15'))['db'];function respondWithStatusCode(_0x35aeb4,_0x5e1cfa){_0x5e1cfa=_0x5e1cfa||0xcc;return function(_0x58249d){if(_0x58249d){return _0x35aeb4[_0xfb39('0x16')](_0x5e1cfa);}return _0x35aeb4[_0xfb39('0x17')](_0x5e1cfa)[_0xfb39('0x18')]();};}function respondWithResult(_0x480a86,_0x3ef405){_0x3ef405=_0x3ef405||0xc8;return function(_0x2a3724){if(_0x2a3724){return _0x480a86['status'](_0x3ef405)['json'](_0x2a3724);}};}function respondWithFilteredResult(_0x177a14,_0x4a0662){return function(_0x31b1dc){if(_0x31b1dc){var _0x4897be=typeof _0x4a0662['offset']===_0xfb39('0x19')&&typeof _0x4a0662[_0xfb39('0x1a')]===_0xfb39('0x19');var _0x1d1ad3=_0x31b1dc[_0xfb39('0x1b')];var _0x5cb552=_0x4897be?0x0:_0x4a0662[_0xfb39('0x1c')];var _0xd2ad6d=_0x4897be?_0x31b1dc[_0xfb39('0x1b')]:_0x4a0662[_0xfb39('0x1c')]+_0x4a0662['limit'];var _0x50765f;if(_0xd2ad6d>=_0x1d1ad3){_0xd2ad6d=_0x1d1ad3;_0x50765f=0xc8;}else{_0x50765f=0xce;}_0x177a14[_0xfb39('0x17')](_0x50765f);return _0x177a14[_0xfb39('0x1d')](_0xfb39('0x1e'),_0x5cb552+'-'+_0xd2ad6d+'/'+_0x1d1ad3)[_0xfb39('0x1f')](_0x31b1dc);}return null;};}function patchUpdates(_0x116b22){return function(_0x57bebf){try{jsonpatch[_0xfb39('0x20')](_0x57bebf,_0x116b22,!![]);}catch(_0x3d5697){return BPromise[_0xfb39('0x21')](_0x3d5697);}return _0x57bebf[_0xfb39('0x22')]();};}function saveUpdates(_0x3b4393,_0x5f2f60){return function(_0x50b2e2){if(_0x50b2e2){return _0x50b2e2[_0xfb39('0x23')](_0x3b4393)[_0xfb39('0x24')](function(_0x561b60){return _0x561b60;});}return null;};}function removeEntity(_0x1b1e65,_0x33d029){return function(_0x23bd78){if(_0x23bd78){return _0x23bd78['destroy']()['then'](function(){_0x1b1e65[_0xfb39('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x228288,_0x14651a){return function(_0x30dbc5){if(!_0x30dbc5){_0x228288[_0xfb39('0x16')](0x194);}return _0x30dbc5;};}function handleError(_0x118aa7,_0x2a7add){_0x2a7add=_0x2a7add||0x1f4;return function(_0x38e145){logger[_0xfb39('0x25')](_0x38e145[_0xfb39('0x26')]);if(_0x38e145[_0xfb39('0x27')]){delete _0x38e145[_0xfb39('0x27')];}_0x118aa7[_0xfb39('0x17')](_0x2a7add)[_0xfb39('0x28')](_0x38e145);};}exports[_0xfb39('0x29')]=function(_0x5d05e2,_0x4a98e9){var _0x34977d={},_0x233d80={},_0xc6129d={'count':0x0,'rows':[]};var _0x2a247c=_[_0xfb39('0x2a')](db['DeskField']['rawAttributes'],function(_0x4665e9){return{'name':_0x4665e9['fieldName'],'type':_0x4665e9['type'][_0xfb39('0x2b')]};});_0x233d80[_0xfb39('0x2c')]=_['map'](_0x2a247c,'name');_0x233d80[_0xfb39('0x2d')]=_[_0xfb39('0x2e')](_0x5d05e2[_0xfb39('0x2d')]);_0x233d80[_0xfb39('0x2f')]=_[_0xfb39('0x30')](_0x233d80['model'],_0x233d80[_0xfb39('0x2d')]);_0x34977d[_0xfb39('0x31')]=_['intersection'](_0x233d80[_0xfb39('0x2c')],qs['fields'](_0x5d05e2[_0xfb39('0x2d')][_0xfb39('0x32')]));_0x34977d['attributes']=_0x34977d[_0xfb39('0x31')]['length']?_0x34977d['attributes']:_0x233d80[_0xfb39('0x2c')];if(!_0x5d05e2[_0xfb39('0x2d')][_0xfb39('0x33')](_0xfb39('0x34'))){_0x34977d[_0xfb39('0x1a')]=qs[_0xfb39('0x1a')](_0x5d05e2[_0xfb39('0x2d')][_0xfb39('0x1a')]);_0x34977d[_0xfb39('0x1c')]=qs['offset'](_0x5d05e2[_0xfb39('0x2d')][_0xfb39('0x1c')]);}_0x34977d[_0xfb39('0x35')]=qs[_0xfb39('0x36')](_0x5d05e2[_0xfb39('0x2d')][_0xfb39('0x36')]);_0x34977d[_0xfb39('0x37')]=qs[_0xfb39('0x2f')](_['pick'](_0x5d05e2[_0xfb39('0x2d')],_0x233d80[_0xfb39('0x2f')]),_0x2a247c);if(_0x5d05e2['query'][_0xfb39('0x38')]){_0x34977d[_0xfb39('0x37')]=_[_0xfb39('0x39')](_0x34977d[_0xfb39('0x37')],{'$or':_[_0xfb39('0x2a')](_0x2a247c,function(_0x1347c0){if(_0x1347c0[_0xfb39('0x3a')]!==_0xfb39('0x3b')){var _0x42f414={};_0x42f414[_0x1347c0[_0xfb39('0x27')]]={'$like':'%'+_0x5d05e2[_0xfb39('0x2d')]['filter']+'%'};return _0x42f414;}})});}_0x34977d=_[_0xfb39('0x39')]({},_0x34977d,_0x5d05e2[_0xfb39('0x3c')]);var _0x5e55b7={'where':_0x34977d[_0xfb39('0x37')]};return db[_0xfb39('0x3d')][_0xfb39('0x1b')](_0x5e55b7)['then'](function(_0xff7831){_0xc6129d[_0xfb39('0x1b')]=_0xff7831;if(_0x5d05e2['query'][_0xfb39('0x3e')]){_0x34977d['include']=[{'all':!![]}];}return db[_0xfb39('0x3d')]['findAll'](_0x34977d);})['then'](function(_0x545180){_0xc6129d[_0xfb39('0x3f')]=_0x545180;return _0xc6129d;})[_0xfb39('0x24')](respondWithFilteredResult(_0x4a98e9,_0x34977d))['catch'](handleError(_0x4a98e9,null));};exports[_0xfb39('0x40')]=function(_0x328288,_0x2a8ec8){var _0x2ece4e={'raw':!![],'where':{'id':_0x328288[_0xfb39('0x41')]['id']}},_0x512bba={};_0x512bba[_0xfb39('0x2c')]=_[_0xfb39('0x2e')](db['DeskField']['rawAttributes']);_0x512bba[_0xfb39('0x2d')]=_['keys'](_0x328288[_0xfb39('0x2d')]);_0x512bba[_0xfb39('0x2f')]=_[_0xfb39('0x30')](_0x512bba['model'],_0x512bba[_0xfb39('0x2d')]);_0x2ece4e[_0xfb39('0x31')]=_['intersection'](_0x512bba[_0xfb39('0x2c')],qs['fields'](_0x328288['query'][_0xfb39('0x32')]));_0x2ece4e[_0xfb39('0x31')]=_0x2ece4e[_0xfb39('0x31')][_0xfb39('0x42')]?_0x2ece4e['attributes']:_0x512bba[_0xfb39('0x2c')];if(_0x328288['query'][_0xfb39('0x3e')]){_0x2ece4e['include']=[{'all':!![]}];}_0x2ece4e=_[_0xfb39('0x39')]({},_0x2ece4e,_0x328288[_0xfb39('0x3c')]);return db[_0xfb39('0x3d')][_0xfb39('0x43')](_0x2ece4e)[_0xfb39('0x24')](handleEntityNotFound(_0x2a8ec8,null))['then'](respondWithResult(_0x2a8ec8,null))[_0xfb39('0x44')](handleError(_0x2a8ec8,null));};exports['create']=function(_0x43ccf4,_0x544293){return db[_0xfb39('0x3d')][_0xfb39('0x45')](_0x43ccf4['body'],{})[_0xfb39('0x24')](respondWithResult(_0x544293,0xc9))[_0xfb39('0x44')](handleError(_0x544293,null));};exports[_0xfb39('0x23')]=function(_0x43c619,_0x197123){if(_0x43c619[_0xfb39('0x46')]['id']){delete _0x43c619['body']['id'];}return db['DeskField'][_0xfb39('0x43')]({'where':{'id':_0x43c619[_0xfb39('0x41')]['id']}})[_0xfb39('0x24')](handleEntityNotFound(_0x197123,null))[_0xfb39('0x24')](saveUpdates(_0x43c619[_0xfb39('0x46')],null))['then'](respondWithResult(_0x197123,null))[_0xfb39('0x44')](handleError(_0x197123,null));};exports[_0xfb39('0x47')]=function(_0x21fe27,_0x11d1e8){return db[_0xfb39('0x3d')][_0xfb39('0x43')]({'where':{'id':_0x21fe27['params']['id']}})[_0xfb39('0x24')](handleEntityNotFound(_0x11d1e8,null))[_0xfb39('0x24')](removeEntity(_0x11d1e8,null))['catch'](handleError(_0x11d1e8,null));};
\ No newline at end of file
+var _0x5eca=['sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','DeskField','includeAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x5eca,0x10e));var _0xa5ec=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5eca[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xa5ec('0x0'));var rimraf=require(_0xa5ec('0x1'));var zipdir=require(_0xa5ec('0x2'));var jsonpatch=require(_0xa5ec('0x3'));var rp=require(_0xa5ec('0x4'));var moment=require('moment');var BPromise=require(_0xa5ec('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa5ec('0x6'));var sox=require(_0xa5ec('0x7'));var csv=require(_0xa5ec('0x8'));var ejs=require(_0xa5ec('0x9'));var fs=require('fs');var fs_extra=require(_0xa5ec('0xa'));var _=require(_0xa5ec('0xb'));var squel=require(_0xa5ec('0xc'));var crypto=require('crypto');var jsforce=require(_0xa5ec('0xd'));var deskjs=require(_0xa5ec('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa5ec('0xf'));var Papa=require('papaparse');var Redis=require(_0xa5ec('0x10'));var authService=require(_0xa5ec('0x11'));var qs=require(_0xa5ec('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa5ec('0x13'));var logger=require(_0xa5ec('0x14'))(_0xa5ec('0x15'));var utils=require(_0xa5ec('0x16'));var config=require(_0xa5ec('0x17'));var licenseUtil=require(_0xa5ec('0x18'));var db=require(_0xa5ec('0x19'))['db'];function respondWithStatusCode(_0x703db5,_0x3e5ce7){_0x3e5ce7=_0x3e5ce7||0xcc;return function(_0x69bcea){if(_0x69bcea){return _0x703db5[_0xa5ec('0x1a')](_0x3e5ce7);}return _0x703db5[_0xa5ec('0x1b')](_0x3e5ce7)[_0xa5ec('0x1c')]();};}function respondWithResult(_0x58c1d7,_0x21c65a){_0x21c65a=_0x21c65a||0xc8;return function(_0x241d2b){if(_0x241d2b){return _0x58c1d7[_0xa5ec('0x1b')](_0x21c65a)[_0xa5ec('0x1d')](_0x241d2b);}};}function respondWithFilteredResult(_0x142305,_0x2fe110){return function(_0x54288a){if(_0x54288a){var _0x471de4=typeof _0x2fe110['offset']===_0xa5ec('0x1e')&&typeof _0x2fe110[_0xa5ec('0x1f')]===_0xa5ec('0x1e');var _0x32281e=_0x54288a[_0xa5ec('0x20')];var _0x372767=_0x471de4?0x0:_0x2fe110[_0xa5ec('0x21')];var _0x29fbb4=_0x471de4?_0x54288a[_0xa5ec('0x20')]:_0x2fe110[_0xa5ec('0x21')]+_0x2fe110['limit'];var _0x7613;if(_0x29fbb4>=_0x32281e){_0x29fbb4=_0x32281e;_0x7613=0xc8;}else{_0x7613=0xce;}_0x142305[_0xa5ec('0x1b')](_0x7613);return _0x142305[_0xa5ec('0x22')](_0xa5ec('0x23'),_0x372767+'-'+_0x29fbb4+'/'+_0x32281e)[_0xa5ec('0x1d')](_0x54288a);}return null;};}function patchUpdates(_0x3560d7){return function(_0x1255bc){try{jsonpatch[_0xa5ec('0x24')](_0x1255bc,_0x3560d7,!![]);}catch(_0x2a0602){return BPromise['reject'](_0x2a0602);}return _0x1255bc[_0xa5ec('0x25')]();};}function saveUpdates(_0x3581b7,_0x3c957){return function(_0xa2daff){if(_0xa2daff){return _0xa2daff[_0xa5ec('0x26')](_0x3581b7)[_0xa5ec('0x27')](function(_0x1995f4){return _0x1995f4;});}return null;};}function removeEntity(_0x364770,_0x5eef95){return function(_0x584d82){if(_0x584d82){return _0x584d82['destroy']()[_0xa5ec('0x27')](function(){_0x364770['status'](0xcc)[_0xa5ec('0x1c')]();});}};}function handleEntityNotFound(_0x38be6b,_0x57ef19){return function(_0x20612a){if(!_0x20612a){_0x38be6b[_0xa5ec('0x1a')](0x194);}return _0x20612a;};}function handleError(_0x4ff18c,_0x4643aa){_0x4643aa=_0x4643aa||0x1f4;return function(_0x12bfbb){logger['error'](_0x12bfbb[_0xa5ec('0x28')]);if(_0x12bfbb['name']){delete _0x12bfbb[_0xa5ec('0x29')];}_0x4ff18c[_0xa5ec('0x1b')](_0x4643aa)[_0xa5ec('0x2a')](_0x12bfbb);};}exports[_0xa5ec('0x2b')]=function(_0x39907f,_0x40a05a){var _0x45e32c={},_0x2cda8c={},_0x25ef57={'count':0x0,'rows':[]};var _0x4c1871=_[_0xa5ec('0x2c')](db['DeskField']['rawAttributes'],function(_0xa8caab){return{'name':_0xa8caab[_0xa5ec('0x2d')],'type':_0xa8caab[_0xa5ec('0x2e')][_0xa5ec('0x2f')]};});_0x2cda8c[_0xa5ec('0x30')]=_[_0xa5ec('0x2c')](_0x4c1871,'name');_0x2cda8c[_0xa5ec('0x31')]=_[_0xa5ec('0x32')](_0x39907f['query']);_0x2cda8c[_0xa5ec('0x33')]=_[_0xa5ec('0x34')](_0x2cda8c[_0xa5ec('0x30')],_0x2cda8c[_0xa5ec('0x31')]);_0x45e32c['attributes']=_[_0xa5ec('0x34')](_0x2cda8c[_0xa5ec('0x30')],qs[_0xa5ec('0x35')](_0x39907f[_0xa5ec('0x31')]['fields']));_0x45e32c[_0xa5ec('0x36')]=_0x45e32c['attributes'][_0xa5ec('0x37')]?_0x45e32c[_0xa5ec('0x36')]:_0x2cda8c['model'];if(!_0x39907f['query'][_0xa5ec('0x38')](_0xa5ec('0x39'))){_0x45e32c[_0xa5ec('0x1f')]=qs[_0xa5ec('0x1f')](_0x39907f[_0xa5ec('0x31')]['limit']);_0x45e32c[_0xa5ec('0x21')]=qs[_0xa5ec('0x21')](_0x39907f[_0xa5ec('0x31')][_0xa5ec('0x21')]);}_0x45e32c[_0xa5ec('0x3a')]=qs[_0xa5ec('0x3b')](_0x39907f['query'][_0xa5ec('0x3b')]);_0x45e32c['where']=qs[_0xa5ec('0x33')](_[_0xa5ec('0x3c')](_0x39907f[_0xa5ec('0x31')],_0x2cda8c[_0xa5ec('0x33')]),_0x4c1871);if(_0x39907f[_0xa5ec('0x31')]['filter']){_0x45e32c[_0xa5ec('0x3d')]=_[_0xa5ec('0x3e')](_0x45e32c[_0xa5ec('0x3d')],{'$or':_[_0xa5ec('0x2c')](_0x4c1871,function(_0x12feed){if(_0x12feed[_0xa5ec('0x2e')]!==_0xa5ec('0x3f')){var _0x5dda81={};_0x5dda81[_0x12feed[_0xa5ec('0x29')]]={'$like':'%'+_0x39907f[_0xa5ec('0x31')]['filter']+'%'};return _0x5dda81;}})});}_0x45e32c=_[_0xa5ec('0x3e')]({},_0x45e32c,_0x39907f[_0xa5ec('0x40')]);var _0x3c4f1c={'where':_0x45e32c[_0xa5ec('0x3d')]};return db[_0xa5ec('0x41')][_0xa5ec('0x20')](_0x3c4f1c)[_0xa5ec('0x27')](function(_0x1c13b2){_0x25ef57[_0xa5ec('0x20')]=_0x1c13b2;if(_0x39907f[_0xa5ec('0x31')][_0xa5ec('0x42')]){_0x45e32c['include']=[{'all':!![]}];}return db['DeskField']['findAll'](_0x45e32c);})['then'](function(_0x1744be){_0x25ef57[_0xa5ec('0x43')]=_0x1744be;return _0x25ef57;})[_0xa5ec('0x27')](respondWithFilteredResult(_0x40a05a,_0x45e32c))[_0xa5ec('0x44')](handleError(_0x40a05a,null));};exports[_0xa5ec('0x45')]=function(_0x1ae6e4,_0xa6369a){var _0x46d042={'raw':!![],'where':{'id':_0x1ae6e4[_0xa5ec('0x46')]['id']}},_0x56dfa4={};_0x56dfa4['model']=_[_0xa5ec('0x32')](db[_0xa5ec('0x41')]['rawAttributes']);_0x56dfa4['query']=_[_0xa5ec('0x32')](_0x1ae6e4[_0xa5ec('0x31')]);_0x56dfa4[_0xa5ec('0x33')]=_[_0xa5ec('0x34')](_0x56dfa4[_0xa5ec('0x30')],_0x56dfa4[_0xa5ec('0x31')]);_0x46d042[_0xa5ec('0x36')]=_[_0xa5ec('0x34')](_0x56dfa4[_0xa5ec('0x30')],qs[_0xa5ec('0x35')](_0x1ae6e4['query']['fields']));_0x46d042[_0xa5ec('0x36')]=_0x46d042[_0xa5ec('0x36')][_0xa5ec('0x37')]?_0x46d042[_0xa5ec('0x36')]:_0x56dfa4[_0xa5ec('0x30')];if(_0x1ae6e4[_0xa5ec('0x31')][_0xa5ec('0x42')]){_0x46d042['include']=[{'all':!![]}];}_0x46d042=_[_0xa5ec('0x3e')]({},_0x46d042,_0x1ae6e4['options']);return db['DeskField'][_0xa5ec('0x47')](_0x46d042)[_0xa5ec('0x27')](handleEntityNotFound(_0xa6369a,null))[_0xa5ec('0x27')](respondWithResult(_0xa6369a,null))['catch'](handleError(_0xa6369a,null));};exports[_0xa5ec('0x48')]=function(_0x55c3c7,_0xfcc42b){return db[_0xa5ec('0x41')][_0xa5ec('0x48')](_0x55c3c7[_0xa5ec('0x49')],{})[_0xa5ec('0x27')](respondWithResult(_0xfcc42b,0xc9))[_0xa5ec('0x44')](handleError(_0xfcc42b,null));};exports['update']=function(_0x485f07,_0xc74073){if(_0x485f07['body']['id']){delete _0x485f07[_0xa5ec('0x49')]['id'];}return db[_0xa5ec('0x41')]['find']({'where':{'id':_0x485f07['params']['id']}})[_0xa5ec('0x27')](handleEntityNotFound(_0xc74073,null))[_0xa5ec('0x27')](saveUpdates(_0x485f07[_0xa5ec('0x49')],null))[_0xa5ec('0x27')](respondWithResult(_0xc74073,null))['catch'](handleError(_0xc74073,null));};exports['destroy']=function(_0x388f20,_0x17b719){return db[_0xa5ec('0x41')][_0xa5ec('0x47')]({'where':{'id':_0x388f20[_0xa5ec('0x46')]['id']}})[_0xa5ec('0x27')](handleEntityNotFound(_0x17b719,null))[_0xa5ec('0x27')](removeEntity(_0x17b719,null))[_0xa5ec('0x44')](handleError(_0x17b719,null));};
\ No newline at end of file
index 0afc453..93f8342 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8415=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId'];(function(_0x2a816c,_0x480195){var _0x2035bd=function(_0x17dc71){while(--_0x17dc71){_0x2a816c['push'](_0x2a816c['shift']());}};_0x2035bd(++_0x480195);}(_0x8415,0xd2));var _0x5841=function(_0x4bd6bd,_0x2b3406){_0x4bd6bd=_0x4bd6bd-0x0;var _0x49bc35=_0x8415[_0x4bd6bd];return _0x49bc35;};'use strict';var _=require(_0x5841('0x0'));var util=require(_0x5841('0x1'));var logger=require(_0x5841('0x2'))(_0x5841('0x3'));var moment=require(_0x5841('0x4'));var BPromise=require(_0x5841('0x5'));var rp=require(_0x5841('0x6'));var fs=require('fs');var path=require(_0x5841('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x5841('0x8')]=function(_0x512614,_0x4011b9){return _0x512614[_0x5841('0x9')](_0x5841('0xa'),attributes,{'tableName':_0x5841('0xb'),'paranoid':![],'indexes':[{'name':_0x5841('0xc'),'fields':[_0x5841('0xd'),_0x5841('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc077=['util','../../config/logger','api','moment','bluebird','exports','define','DeskField','int_desk_fields','idField','FieldId','lodash'];(function(_0x235563,_0x260ece){var _0x219be0=function(_0xef2469){while(--_0xef2469){_0x235563['push'](_0x235563['shift']());}};_0x219be0(++_0x260ece);}(_0xc077,0x15b));var _0x7c07=function(_0x1e9bf5,_0x2b8466){_0x1e9bf5=_0x1e9bf5-0x0;var _0x3e43a0=_0xc077[_0x1e9bf5];return _0x3e43a0;};'use strict';var _=require(_0x7c07('0x0'));var util=require(_0x7c07('0x1'));var logger=require(_0x7c07('0x2'))(_0x7c07('0x3'));var moment=require(_0x7c07('0x4'));var BPromise=require(_0x7c07('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskField.attributes');module[_0x7c07('0x6')]=function(_0x1af351,_0x1e61f5){return _0x1af351[_0x7c07('0x7')](_0x7c07('0x8'),attributes,{'tableName':_0x7c07('0x9'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x7c07('0xa'),_0x7c07('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index b32a360..1a14231 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41c3=['DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','DeskField,\x20%s,\x20%s','request\x20sent'];(function(_0xac480a,_0x3d3117){var _0x485842=function(_0x3249b3){while(--_0x3249b3){_0xac480a['push'](_0xac480a['shift']());}};_0x485842(++_0x3d3117);}(_0x41c3,0x1ea));var _0x341c=function(_0x5af1cd,_0x199b33){_0x5af1cd=_0x5af1cd-0x0;var _0x5703bb=_0x41c3[_0x5af1cd];return _0x5703bb;};'use strict';var _=require(_0x341c('0x0'));var util=require(_0x341c('0x1'));var moment=require('moment');var BPromise=require(_0x341c('0x2'));var rs=require(_0x341c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x341c('0x4'))['db'];var utils=require(_0x341c('0x5'));var logger=require(_0x341c('0x6'))(_0x341c('0x7'));var config=require(_0x341c('0x8'));var jayson=require(_0x341c('0x9'));var client=jayson['client'][_0x341c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16b3a9,_0x3dce01,_0x5e332b){return new BPromise(function(_0x3a1014,_0x585755){return client[_0x341c('0xb')](_0x16b3a9,_0x5e332b)['then'](function(_0x307767){logger['info'](_0x341c('0xc'),_0x3dce01,_0x341c('0xd'));logger['debug'](_0x341c('0xe'),_0x3dce01,_0x341c('0xd'),JSON[_0x341c('0xf')](_0x307767));if(_0x307767[_0x341c('0x10')]){if(_0x307767['error'][_0x341c('0x11')]===0x1f4){logger['error'](_0x341c('0xc'),_0x3dce01,_0x307767[_0x341c('0x10')][_0x341c('0x12')]);return _0x585755(_0x307767['error'][_0x341c('0x12')]);}logger[_0x341c('0x10')](_0x341c('0xc'),_0x3dce01,_0x307767[_0x341c('0x10')]['message']);return _0x3a1014(_0x307767[_0x341c('0x10')][_0x341c('0x12')]);}else{logger[_0x341c('0x13')](_0x341c('0xc'),_0x3dce01,_0x341c('0xd'));_0x3a1014(_0x307767['result'][_0x341c('0x12')]);}})[_0x341c('0x14')](function(_0x3bd866){logger[_0x341c('0x10')]('DeskField,\x20%s,\x20%s',_0x3dce01,_0x3bd866);_0x585755(_0x3bd866);});});}
\ No newline at end of file
+var _0xa868=['rpc','../../config/environment','jayson/promise','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x438c8d,_0x5afcfc){var _0x1d5d1b=function(_0x5e256c){while(--_0x5e256c){_0x438c8d['push'](_0x438c8d['shift']());}};_0x1d5d1b(++_0x5afcfc);}(_0xa868,0x136));var _0x8a86=function(_0xafdec6,_0x3d94df){_0xafdec6=_0xafdec6-0x0;var _0x372bdb=_0xa868[_0xafdec6];return _0x372bdb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8a86('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a86('0x1'));var db=require(_0x8a86('0x2'))['db'];var utils=require(_0x8a86('0x3'));var logger=require(_0x8a86('0x4'))(_0x8a86('0x5'));var config=require(_0x8a86('0x6'));var jayson=require(_0x8a86('0x7'));var client=jayson['client'][_0x8a86('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x534ccb,_0x3883ae,_0x3a8a2f){return new BPromise(function(_0x1e0e79,_0x238763){return client[_0x8a86('0x9')](_0x534ccb,_0x3a8a2f)[_0x8a86('0xa')](function(_0x370e2d){logger[_0x8a86('0xb')](_0x8a86('0xc'),_0x3883ae,'request\x20sent');logger[_0x8a86('0xd')](_0x8a86('0xe'),_0x3883ae,'request\x20sent',JSON[_0x8a86('0xf')](_0x370e2d));if(_0x370e2d['error']){if(_0x370e2d['error'][_0x8a86('0x10')]===0x1f4){logger[_0x8a86('0x11')](_0x8a86('0xc'),_0x3883ae,_0x370e2d['error'][_0x8a86('0x12')]);return _0x238763(_0x370e2d[_0x8a86('0x11')]['message']);}logger[_0x8a86('0x11')](_0x8a86('0xc'),_0x3883ae,_0x370e2d[_0x8a86('0x11')][_0x8a86('0x12')]);return _0x1e0e79(_0x370e2d[_0x8a86('0x11')][_0x8a86('0x12')]);}else{logger[_0x8a86('0xb')]('DeskField,\x20%s,\x20%s',_0x3883ae,_0x8a86('0x13'));_0x1e0e79(_0x370e2d[_0x8a86('0x14')]['message']);}})['catch'](function(_0x1f4f9c){logger[_0x8a86('0x11')](_0x8a86('0xc'),_0x3883ae,_0x1f4f9c);_0x238763(_0x1f4f9c);});});}
\ No newline at end of file
index b320232..5ed316d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ac3=['multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDynamics365Account.controller','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','update','/:id'];(function(_0x4c8c73,_0x3be355){var _0x555888=function(_0x3d7680){while(--_0x3d7680){_0x4c8c73['push'](_0x4c8c73['shift']());}};_0x555888(++_0x3be355);}(_0x0ac3,0x1dc));var _0x30ac=function(_0xcc6972,_0x53a373){_0xcc6972=_0xcc6972-0x0;var _0x4f4069=_0x0ac3[_0xcc6972];return _0x4f4069;};'use strict';var multer=require(_0x30ac('0x0'));var util=require('util');var path=require(_0x30ac('0x1'));var timeout=require(_0x30ac('0x2'));var express=require(_0x30ac('0x3'));var router=express[_0x30ac('0x4')]();var fs_extra=require(_0x30ac('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x30ac('0x6'));var controller=require(_0x30ac('0x7'));router[_0x30ac('0x8')]('/',auth['isAuthenticated'](),controller[_0x30ac('0x9')]);router[_0x30ac('0x8')]('/:id',auth[_0x30ac('0xa')](),controller[_0x30ac('0xb')]);router[_0x30ac('0x8')](_0x30ac('0xc'),auth[_0x30ac('0xa')](),controller['getConfigurations']);router[_0x30ac('0x8')](_0x30ac('0xd'),auth[_0x30ac('0xa')](),controller[_0x30ac('0xe')]);router['post']('/',auth[_0x30ac('0xa')](),controller['create']);router['post'](_0x30ac('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put']('/:id',auth[_0x30ac('0xa')](),controller[_0x30ac('0xf')]);router['delete'](_0x30ac('0x10'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x6038=['post','/:id/configurations','addConfiguration','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','isAuthenticated','getConfigurations','/:id/fields','getFields'];(function(_0x5aed9,_0xa3c19b){var _0x2d681a=function(_0x2cb1fa){while(--_0x2cb1fa){_0x5aed9['push'](_0x5aed9['shift']());}};_0x2d681a(++_0xa3c19b);}(_0x6038,0x194));var _0x8603=function(_0x382862,_0x2557fa){_0x382862=_0x382862-0x0;var _0x429ac2=_0x6038[_0x382862];return _0x429ac2;};'use strict';var multer=require(_0x8603('0x0'));var util=require(_0x8603('0x1'));var path=require(_0x8603('0x2'));var timeout=require(_0x8603('0x3'));var express=require(_0x8603('0x4'));var router=express[_0x8603('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8603('0x6'));var interaction=require(_0x8603('0x7'));var config=require(_0x8603('0x8'));var controller=require(_0x8603('0x9'));router[_0x8603('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8603('0xa')](_0x8603('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x8603('0xa')]('/:id/configurations',auth[_0x8603('0xc')](),controller[_0x8603('0xd')]);router[_0x8603('0xa')](_0x8603('0xe'),auth[_0x8603('0xc')](),controller[_0x8603('0xf')]);router[_0x8603('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x8603('0x11'),auth[_0x8603('0xc')](),controller[_0x8603('0x12')]);router['put'](_0x8603('0xb'),auth[_0x8603('0xc')](),controller[_0x8603('0x13')]);router['delete']('/:id',auth[_0x8603('0xc')](),controller['destroy']);module[_0x8603('0x14')]=router;
\ No newline at end of file
index 4383293..dc87c48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee5c=['exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xee5c,0x8c));var _0xcee5=function(_0x1b91c7,_0x539acd){_0x1b91c7=_0x1b91c7-0x0;var _0xbbe014=_0xee5c[_0x1b91c7];return _0xbbe014;};'use strict';var Sequelize=require('sequelize');module[_0xcee5('0x0')]={'name':{'type':Sequelize[_0xcee5('0x1')]},'username':{'type':Sequelize[_0xcee5('0x1')]},'password':{'type':Sequelize[_0xcee5('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xcee5('0x1')]},'clientSecret':{'type':Sequelize[_0xcee5('0x1')]},'serverUrl':{'type':Sequelize[_0xcee5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xcee5('0x1')]}};
\ No newline at end of file
+var _0xeaec=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeaec,0xde));var _0xceae=function(_0x197ed4,_0xfdb80f){_0x197ed4=_0x197ed4-0x0;var _0x2bf99a=_0xeaec[_0x197ed4];return _0x2bf99a;};'use strict';var Sequelize=require(_0xceae('0x0'));module[_0xceae('0x1')]={'name':{'type':Sequelize[_0xceae('0x2')]},'username':{'type':Sequelize[_0xceae('0x2')]},'password':{'type':Sequelize[_0xceae('0x2')]},'remoteUri':{'type':Sequelize[_0xceae('0x2')]},'tenantId':{'type':Sequelize[_0xceae('0x2')]},'clientId':{'type':Sequelize[_0xceae('0x2')]},'clientSecret':{'type':Sequelize[_0xceae('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xceae('0x2')]}};
\ No newline at end of file
index df0220b..6910693 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7fc=['owneridyominame','primarycontactidyominame','prioritycodename','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','timezoneruleversionnumber','traversedpath','concat','username','password','clientId','clientSecret','remoteUri','substring','lastIndexOf','format','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','includes','LogicalName','@odata.type','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','forEach','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','length','test','statusCode','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','eml-format','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','save','update','then','destroy','error','name','index','Dynamics365Account','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','findAll','show','params','includeAll','include','find','catch','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','Dynamics365Field','getFields','incident','Incident','title','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','entityimage_timestamp','entityimage_url','exchangerate','firstresponsebykpiidname','followupby','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype'];(function(_0x54c193,_0x4f3343){var _0x5e22a5=function(_0x109436){while(--_0x109436){_0x54c193['push'](_0x54c193['shift']());}};_0x5e22a5(++_0x4f3343);}(_0xb7fc,0x1e3));var _0xcb7f=function(_0x2264a1,_0x1a38b7){_0x2264a1=_0x2264a1-0x0;var _0x14de54=_0xb7fc[_0x2264a1];return _0x14de54;};'use strict';var emlformat=require(_0xcb7f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcb7f('0x1'));var rp=require(_0xcb7f('0x2'));var moment=require(_0xcb7f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcb7f('0x4'));var path=require(_0xcb7f('0x5'));var sox=require(_0xcb7f('0x6'));var csv=require(_0xcb7f('0x7'));var ejs=require(_0xcb7f('0x8'));var fs=require('fs');var fs_extra=require(_0xcb7f('0x9'));var _=require('lodash');var squel=require(_0xcb7f('0xa'));var crypto=require(_0xcb7f('0xb'));var jsforce=require(_0xcb7f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcb7f('0x7'));var querystring=require(_0xcb7f('0xd'));var Papa=require('papaparse');var Redis=require(_0xcb7f('0xe'));var authService=require(_0xcb7f('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xcb7f('0x10'));var hardwareService=require(_0xcb7f('0x11'));var logger=require(_0xcb7f('0x12'))(_0xcb7f('0x13'));var utils=require(_0xcb7f('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcb7f('0x15'))['db'];var integrations=require(_0xcb7f('0x16'));function respondWithStatusCode(_0x115b93,_0x123af0){_0x123af0=_0x123af0||0xcc;return function(_0x189345){if(_0x189345){return _0x115b93[_0xcb7f('0x17')](_0x123af0);}return _0x115b93[_0xcb7f('0x18')](_0x123af0)[_0xcb7f('0x19')]();};}function respondWithResult(_0x3a07da,_0x1b47ca){_0x1b47ca=_0x1b47ca||0xc8;return function(_0x1f4a2d){if(_0x1f4a2d){return _0x3a07da[_0xcb7f('0x18')](_0x1b47ca)[_0xcb7f('0x1a')](_0x1f4a2d);}};}function respondWithFilteredResult(_0x281d98,_0x159a49){return function(_0x45189d){if(_0x45189d){var _0x17e54f=typeof _0x159a49[_0xcb7f('0x1b')]===_0xcb7f('0x1c')&&typeof _0x159a49[_0xcb7f('0x1d')]===_0xcb7f('0x1c');var _0x2e76c5=_0x45189d['count'];var _0x2430b3=_0x17e54f?0x0:_0x159a49[_0xcb7f('0x1b')];var _0x57274b=_0x17e54f?_0x45189d['count']:_0x159a49[_0xcb7f('0x1b')]+_0x159a49[_0xcb7f('0x1d')];var _0x42b272;if(_0x57274b>=_0x2e76c5){_0x57274b=_0x2e76c5;_0x42b272=0xc8;}else{_0x42b272=0xce;}_0x281d98['status'](_0x42b272);return _0x281d98['set'](_0xcb7f('0x1e'),_0x2430b3+'-'+_0x57274b+'/'+_0x2e76c5)['json'](_0x45189d);}return null;};}function patchUpdates(_0x493863){return function(_0x595558){try{jsonpatch[_0xcb7f('0x1f')](_0x595558,_0x493863,!![]);}catch(_0x4132c3){return BPromise['reject'](_0x4132c3);}return _0x595558[_0xcb7f('0x20')]();};}function saveUpdates(_0x2a791f,_0x417738){return function(_0x27ed68){if(_0x27ed68){return _0x27ed68[_0xcb7f('0x21')](_0x2a791f)[_0xcb7f('0x22')](function(_0x5d0798){return _0x5d0798;});}return null;};}function removeEntity(_0x588a4b,_0x44d513){return function(_0x3974ae){if(_0x3974ae){return _0x3974ae[_0xcb7f('0x23')]()[_0xcb7f('0x22')](function(){_0x588a4b[_0xcb7f('0x18')](0xcc)[_0xcb7f('0x19')]();});}};}function handleEntityNotFound(_0x4835f8,_0x9a5a64){return function(_0x397539){if(!_0x397539){_0x4835f8[_0xcb7f('0x17')](0x194);}return _0x397539;};}function handleError(_0x53965b,_0x30ecb7){_0x30ecb7=_0x30ecb7||0x1f4;return function(_0x380c75){logger[_0xcb7f('0x24')](_0x380c75['stack']);if(_0x380c75[_0xcb7f('0x25')]){delete _0x380c75['name'];}_0x53965b[_0xcb7f('0x18')](_0x30ecb7)['send'](_0x380c75);};}exports[_0xcb7f('0x26')]=function(_0x381277,_0x5659a8){var _0x597a82={},_0x5c0e90={},_0x103ebc={'count':0x0,'rows':[]};var _0xff7b82=_['map'](db[_0xcb7f('0x27')][_0xcb7f('0x28')],function(_0x21665e){return{'name':_0x21665e[_0xcb7f('0x29')],'type':_0x21665e[_0xcb7f('0x2a')]['key']};});_0x5c0e90[_0xcb7f('0x2b')]=_[_0xcb7f('0x2c')](_0xff7b82,_0xcb7f('0x25'));_0x5c0e90[_0xcb7f('0x2d')]=_[_0xcb7f('0x2e')](_0x381277[_0xcb7f('0x2d')]);_0x5c0e90[_0xcb7f('0x2f')]=_[_0xcb7f('0x30')](_0x5c0e90[_0xcb7f('0x2b')],_0x5c0e90['query']);_0x597a82[_0xcb7f('0x31')]=_[_0xcb7f('0x30')](_0x5c0e90['model'],qs[_0xcb7f('0x32')](_0x381277[_0xcb7f('0x2d')][_0xcb7f('0x32')]));_0x597a82[_0xcb7f('0x31')]=_0x597a82['attributes']['length']?_0x597a82['attributes']:_0x5c0e90['model'];if(!_0x381277[_0xcb7f('0x2d')][_0xcb7f('0x33')](_0xcb7f('0x34'))){_0x597a82[_0xcb7f('0x1d')]=qs[_0xcb7f('0x1d')](_0x381277[_0xcb7f('0x2d')]['limit']);_0x597a82[_0xcb7f('0x1b')]=qs[_0xcb7f('0x1b')](_0x381277[_0xcb7f('0x2d')][_0xcb7f('0x1b')]);}_0x597a82[_0xcb7f('0x35')]=qs[_0xcb7f('0x36')](_0x381277[_0xcb7f('0x2d')][_0xcb7f('0x36')]);_0x597a82['where']=qs[_0xcb7f('0x2f')](_[_0xcb7f('0x37')](_0x381277['query'],_0x5c0e90[_0xcb7f('0x2f')]),_0xff7b82);if(_0x381277['query'][_0xcb7f('0x38')]){_0x597a82[_0xcb7f('0x39')]=_[_0xcb7f('0x3a')](_0x597a82[_0xcb7f('0x39')],{'$or':_[_0xcb7f('0x2c')](_0xff7b82,function(_0x2f77cb){if(_0x2f77cb[_0xcb7f('0x2a')]!==_0xcb7f('0x3b')){var _0x577b42={};_0x577b42[_0x2f77cb[_0xcb7f('0x25')]]={'$like':'%'+_0x381277[_0xcb7f('0x2d')][_0xcb7f('0x38')]+'%'};return _0x577b42;}})});}_0x597a82=_['merge']({},_0x597a82,_0x381277[_0xcb7f('0x3c')]);var _0x14ab76={'where':_0x597a82[_0xcb7f('0x39')]};return db[_0xcb7f('0x27')][_0xcb7f('0x3d')](_0x14ab76)[_0xcb7f('0x22')](function(_0x1f6304){_0x103ebc['count']=_0x1f6304;if(_0x381277[_0xcb7f('0x2d')]['includeAll']){_0x597a82['include']=[{'all':!![]}];}return db[_0xcb7f('0x27')][_0xcb7f('0x3e')](_0x597a82);})[_0xcb7f('0x22')](function(_0x1bf470){_0x103ebc['rows']=_0x1bf470;return _0x103ebc;})[_0xcb7f('0x22')](respondWithFilteredResult(_0x5659a8,_0x597a82))['catch'](handleError(_0x5659a8,null));};exports[_0xcb7f('0x3f')]=function(_0x1dc4fd,_0x2f794a){var _0x2719a0={'raw':![],'where':{'id':_0x1dc4fd[_0xcb7f('0x40')]['id']}},_0x10cc7b={};_0x10cc7b[_0xcb7f('0x2b')]=_['keys'](db[_0xcb7f('0x27')][_0xcb7f('0x28')]);_0x10cc7b[_0xcb7f('0x2d')]=_['keys'](_0x1dc4fd['query']);_0x10cc7b['filters']=_[_0xcb7f('0x30')](_0x10cc7b[_0xcb7f('0x2b')],_0x10cc7b[_0xcb7f('0x2d')]);_0x2719a0[_0xcb7f('0x31')]=_[_0xcb7f('0x30')](_0x10cc7b['model'],qs[_0xcb7f('0x32')](_0x1dc4fd['query'][_0xcb7f('0x32')]));_0x2719a0['attributes']=_0x2719a0[_0xcb7f('0x31')]['length']?_0x2719a0[_0xcb7f('0x31')]:_0x10cc7b['model'];if(_0x1dc4fd[_0xcb7f('0x2d')][_0xcb7f('0x41')]){_0x2719a0[_0xcb7f('0x42')]=[{'all':!![]}];}_0x2719a0=_['merge']({},_0x2719a0,_0x1dc4fd['options']);return db[_0xcb7f('0x27')][_0xcb7f('0x43')](_0x2719a0)[_0xcb7f('0x22')](handleEntityNotFound(_0x2f794a,null))[_0xcb7f('0x22')](respondWithResult(_0x2f794a,null))[_0xcb7f('0x44')](handleError(_0x2f794a,null));};exports[_0xcb7f('0x45')]=function(_0x2772ba,_0x2a0d78){return db[_0xcb7f('0x27')][_0xcb7f('0x45')](_0x2772ba[_0xcb7f('0x46')],{})[_0xcb7f('0x22')](respondWithResult(_0x2a0d78,0xc9))[_0xcb7f('0x44')](handleError(_0x2a0d78,null));};exports[_0xcb7f('0x21')]=function(_0x5076df,_0x4a1ebc){if(_0x5076df[_0xcb7f('0x46')]['id']){delete _0x5076df['body']['id'];}return db[_0xcb7f('0x27')][_0xcb7f('0x43')]({'where':{'id':_0x5076df[_0xcb7f('0x40')]['id']}})[_0xcb7f('0x22')](handleEntityNotFound(_0x4a1ebc,null))['then'](saveUpdates(_0x5076df['body'],null))['then'](respondWithResult(_0x4a1ebc,null))[_0xcb7f('0x44')](handleError(_0x4a1ebc,null));};exports[_0xcb7f('0x23')]=function(_0x1e780b,_0xea4b1b){return db[_0xcb7f('0x27')]['find']({'where':{'id':_0x1e780b[_0xcb7f('0x40')]['id']}})['then'](handleEntityNotFound(_0xea4b1b,null))[_0xcb7f('0x22')](removeEntity(_0xea4b1b,null))[_0xcb7f('0x44')](handleError(_0xea4b1b,null));};exports[_0xcb7f('0x47')]=function(_0x523866,_0x2142ee,_0x939ba7){var _0x1ca996={};var _0x5b48a2={};var _0x1131e9;var _0x4c9ba4;return db[_0xcb7f('0x27')][_0xcb7f('0x48')]({'where':{'id':_0x523866['params']['id']}})[_0xcb7f('0x22')](handleEntityNotFound(_0x2142ee,null))[_0xcb7f('0x22')](function(_0x20724d){if(_0x20724d){_0x1131e9=_0x20724d;_0x5b48a2['model']=_[_0xcb7f('0x2e')](db[_0xcb7f('0x49')][_0xcb7f('0x28')]);_0x5b48a2[_0xcb7f('0x2d')]=_['keys'](_0x523866[_0xcb7f('0x2d')]);_0x5b48a2[_0xcb7f('0x2f')]=_['intersection'](_0x5b48a2[_0xcb7f('0x2b')],_0x5b48a2[_0xcb7f('0x2d')]);_0x1ca996['attributes']=_[_0xcb7f('0x30')](_0x5b48a2[_0xcb7f('0x2b')],qs[_0xcb7f('0x32')](_0x523866[_0xcb7f('0x2d')]['fields']));_0x1ca996['attributes']=_0x1ca996[_0xcb7f('0x31')]['length']?_0x1ca996[_0xcb7f('0x31')]:_0x5b48a2[_0xcb7f('0x2b')];_0x1ca996[_0xcb7f('0x35')]=qs['sort'](_0x523866['query'][_0xcb7f('0x36')]);_0x1ca996[_0xcb7f('0x39')]=qs['filters'](_[_0xcb7f('0x37')](_0x523866[_0xcb7f('0x2d')],_0x5b48a2[_0xcb7f('0x2f')]));if(_0x523866[_0xcb7f('0x2d')][_0xcb7f('0x38')]){_0x1ca996[_0xcb7f('0x39')]=_[_0xcb7f('0x3a')](_0x1ca996[_0xcb7f('0x39')],{'$or':_['map'](_0x1ca996[_0xcb7f('0x31')],function(_0x25b877){var _0x2fb3f8={};_0x2fb3f8[_0x25b877]={'$like':'%'+_0x523866['query'][_0xcb7f('0x38')]+'%'};return _0x2fb3f8;})});}_0x1ca996=_[_0xcb7f('0x3a')]({},_0x1ca996,_0x523866[_0xcb7f('0x3c')]);return _0x1131e9[_0xcb7f('0x47')](_0x1ca996);}})['then'](function(_0x469144){if(_0x469144){_0x4c9ba4=_0x469144['length'];if(!_0x523866[_0xcb7f('0x2d')][_0xcb7f('0x33')](_0xcb7f('0x34'))){_0x1ca996['limit']=qs['limit'](_0x523866['query'][_0xcb7f('0x1d')]);_0x1ca996[_0xcb7f('0x1b')]=qs[_0xcb7f('0x1b')](_0x523866[_0xcb7f('0x2d')][_0xcb7f('0x1b')]);}return _0x1131e9[_0xcb7f('0x47')](_0x1ca996);}})[_0xcb7f('0x22')](function(_0x58edb7){if(_0x58edb7){return _0x58edb7?{'count':_0x4c9ba4,'rows':_0x58edb7}:null;}})['then'](respondWithResult(_0x2142ee,null))['catch'](handleError(_0x2142ee,null));};exports[_0xcb7f('0x4a')]=function(_0x4c91e0,_0xadde91,_0xe8be35){if(_0x4c91e0[_0xcb7f('0x46')]['id']){delete _0x4c91e0[_0xcb7f('0x46')]['id'];}return db[_0xcb7f('0x27')][_0xcb7f('0x48')]({'where':{'id':_0x4c91e0['params']['id']}})[_0xcb7f('0x22')](handleEntityNotFound(_0xadde91,null))[_0xcb7f('0x22')](function(_0x41ab03){if(_0x41ab03){_0x4c91e0[_0xcb7f('0x46')]['AccountId']=_0x41ab03['id'];_0x4c91e0[_0xcb7f('0x46')][_0xcb7f('0x4b')]=integrations[_0xcb7f('0x4c')](_0x4c91e0[_0xcb7f('0x46')]['channel'],_0x4c91e0[_0xcb7f('0x46')]['type']);_0x4c91e0[_0xcb7f('0x46')][_0xcb7f('0x4d')]=integrations[_0xcb7f('0x4e')](_0x4c91e0[_0xcb7f('0x46')]['channel'],_0x4c91e0['body'][_0xcb7f('0x2a')]);return db[_0xcb7f('0x49')][_0xcb7f('0x45')](_0x4c91e0['body'],{'include':[{'model':db['Dynamics365Field'],'as':_0xcb7f('0x4b')},{'model':db[_0xcb7f('0x4f')],'as':_0xcb7f('0x4d')}]});}return null;})[_0xcb7f('0x22')](respondWithResult(_0xadde91,null))['catch'](handleError(_0xadde91,null));};exports[_0xcb7f('0x50')]=function(_0x1b3ba5,_0x18f014,_0x3e08bf){var _0x587fdd=_0x1b3ba5[_0xcb7f('0x2d')]['ticketType'];var _0x121e2d=_0x587fdd===_0xcb7f('0x51')?_0xcb7f('0x52'):'PhoneCall';var _0x4f0563='';var _0x1afaee='';var _0x37018c='';var _0x3d1edb='';var _0x4a9405='';var _0x422f4a='';var _0x37282e='';var _0x141b00='';var _0x2ba9f8=[_0xcb7f('0x53'),'description',_0xcb7f('0x54'),_0xcb7f('0x55'),'caseorigincode',_0xcb7f('0x56'),_0xcb7f('0x57'),_0xcb7f('0x58'),_0xcb7f('0x59'),'phonecall_activity_parties'];var _0x358d03=[_0xcb7f('0x5a'),_0xcb7f('0x5b'),_0xcb7f('0x5c'),_0xcb7f('0x5d'),_0xcb7f('0x5e'),_0xcb7f('0x5f'),_0xcb7f('0x60'),_0xcb7f('0x61'),_0xcb7f('0x62'),_0xcb7f('0x63'),_0xcb7f('0x64'),_0xcb7f('0x65'),_0xcb7f('0x66'),_0xcb7f('0x67'),_0xcb7f('0x68'),_0xcb7f('0x69'),'customeridtype',_0xcb7f('0x6a'),'emailaddress','entitlementidname',_0xcb7f('0x6b'),_0xcb7f('0x6c'),'escalatedon',_0xcb7f('0x6d'),_0xcb7f('0x6e'),_0xcb7f('0x6f'),'importsequencenumber','influencescore',_0xcb7f('0x70'),_0xcb7f('0x71'),'masteridname',_0xcb7f('0x72'),_0xcb7f('0x73'),_0xcb7f('0x74'),_0xcb7f('0x75'),_0xcb7f('0x76'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0xcb7f('0x77'),_0xcb7f('0x78'),_0xcb7f('0x79'),_0xcb7f('0x7a'),_0xcb7f('0x7b'),_0xcb7f('0x7c'),_0xcb7f('0x7d'),_0xcb7f('0x7e'),'parentcaseidname','primarycontactidname',_0xcb7f('0x7f'),_0xcb7f('0x80'),'productidname',_0xcb7f('0x81'),_0xcb7f('0x82'),_0xcb7f('0x83'),_0xcb7f('0x84'),_0xcb7f('0x85'),_0xcb7f('0x86'),_0xcb7f('0x87'),_0xcb7f('0x88'),_0xcb7f('0x89'),'socialprofileidname',_0xcb7f('0x8a'),'statuscode',_0xcb7f('0x8b'),_0xcb7f('0x8c'),_0xcb7f('0x8d'),'transactioncurrencyidname',_0xcb7f('0x8e'),'utcconversiontimezonecode','versionnumber'];var _0x531ef3=_0x2ba9f8[_0xcb7f('0x8f')](_0x358d03);return db[_0xcb7f('0x27')]['findOne']({'where':{'id':_0x1b3ba5[_0xcb7f('0x40')]['id']},'attributes':['id',_0xcb7f('0x90'),_0xcb7f('0x91'),'remoteUri','tenantId',_0xcb7f('0x92'),_0xcb7f('0x93')]})[_0xcb7f('0x22')](handleEntityNotFound(_0x18f014,null))[_0xcb7f('0x22')](function(_0x289558){if(_0x289558){_0x141b00=_0x289558[_0xcb7f('0x94')];var _0x318a4d=_0x141b00['slice'](-0x1);if(_0x318a4d==='/'){_0x141b00=_0x141b00[_0xcb7f('0x95')](0x0,_0x141b00[_0xcb7f('0x96')](_0x318a4d));}_0x37282e=util[_0xcb7f('0x97')]('%s/api/data/v9.0/',_0x141b00);var _0x17a07d={'method':_0xcb7f('0x98'),'uri':_0xcb7f('0x99')+_0x289558[_0xcb7f('0x9a')]+_0xcb7f('0x9b'),'form':{'client_id':_0x289558['clientId'],'resource':_0x141b00,'username':_0x289558[_0xcb7f('0x90')],'password':_0x289558['password'],'grant_type':_0xcb7f('0x91'),'client_secret':_0x289558[_0xcb7f('0x93')]},'json':!![]};return rp(_0x17a07d);}})['then'](function(_0x36df80){_0x422f4a=_0x36df80[_0xcb7f('0x9c')];var _0x25786f={'method':'GET','uri':encodeURI(_0x37282e+_0xcb7f('0x9d')+_0x121e2d+'\x27'),'headers':{'Authorization':_0xcb7f('0x9e')+_0x422f4a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x25786f);})[_0xcb7f('0x22')](function(_0x5bdf37){var _0x5cfd04=_0x5bdf37[_0xcb7f('0x9f')][0x0];var _0x213d63=_0x5cfd04[_0xcb7f('0xa0')];var _0x3518f4={'method':_0xcb7f('0xa1'),'uri':_0x37282e+_0xcb7f('0xa2')+_0x213d63+_0xcb7f('0xa3'),'headers':{'Authorization':_0xcb7f('0x9e')+_0x422f4a,'If-None-Match':null,'OData-Version':_0xcb7f('0xa4')},'json':!![]};return rp(_0x3518f4);})['then'](function(_0xc07f34){_0x4f0563=_0xc07f34;_0x1afaee=_0x4f0563[_0xcb7f('0xa5')];_0x1afaee=_['remove'](_0x1afaee,function(_0x1cff2c){return!_0x531ef3[_0xcb7f('0xa6')](_0x1cff2c[_0xcb7f('0xa7')]);});var _0x43a40f=[];var _0x5a7f4b=[];_0x1afaee['forEach'](function(_0x35b46d){if(_0x35b46d[_0xcb7f('0xa8')]){var _0x1c1ca3=_0x35b46d[_0xcb7f('0xa8')][_0xcb7f('0x95')](_0x35b46d[_0xcb7f('0xa8')][_0xcb7f('0x96')]('.')+0x1);if(_0x1c1ca3===_0xcb7f('0xa9')){_0x43a40f[_0xcb7f('0xaa')](getSelectList(_0x37282e,_0x587fdd,_0x5a7f4b,_0x4f0563[_0xcb7f('0xa0')],_0x35b46d[_0xcb7f('0xa0')],_0x422f4a));}}});return Promise[_0xcb7f('0xab')](_0x43a40f);})['then'](function(_0x5ae61b){_0x37018c=_0x5ae61b[0x0];var _0x3f1a03=[];var _0xa80cc3=[];_0x1afaee['forEach'](function(_0x5470db){if(!_['isNil'](_0x5470db[_0xcb7f('0xa8')])){var _0x572121=_0x5470db[_0xcb7f('0xa8')]['substring'](_0x5470db[_0xcb7f('0xa8')][_0xcb7f('0x96')]('.')+0x1);if(_0x572121===_0xcb7f('0xac')){_0x3f1a03[_0xcb7f('0xaa')](getBooleanList(_0x37282e,_0x587fdd,_0xa80cc3,_0x4f0563[_0xcb7f('0xa0')],_0x5470db['MetadataId'],_0x422f4a));}}});return Promise['all'](_0x3f1a03);})['then'](function(_0x116a77){_0x3d1edb=_0x116a77[0x0];var _0x326f80=[];var _0x122ed7=[];_0x1afaee[_0xcb7f('0xad')](function(_0x38d0f8){if(_0x38d0f8[_0xcb7f('0xa8')]){var _0x25a65b=_0x38d0f8[_0xcb7f('0xa8')][_0xcb7f('0x95')](_0x38d0f8[_0xcb7f('0xa8')]['lastIndexOf']('.')+0x1);if(_0x25a65b===_0xcb7f('0xae')||_0x25a65b===_0xcb7f('0xaf')||_0x25a65b===_0xcb7f('0xb0')||_0x25a65b===_0xcb7f('0xb1')||_0x25a65b==='MemoAttributeMetadata'||_0x25a65b===_0xcb7f('0xb2')||_0x25a65b===_0xcb7f('0xb3')||_0x25a65b===_0xcb7f('0xb4')||_0x25a65b===_0xcb7f('0xb5')||_0x25a65b===_0xcb7f('0xb6')){_0x326f80[_0xcb7f('0xaa')](getInputList(_0x37282e,_0x587fdd,_0x25a65b,_0x122ed7,_0x4f0563[_0xcb7f('0xa0')],_0x38d0f8[_0xcb7f('0xa0')],_0x422f4a));}}});return Promise[_0xcb7f('0xab')](_0x326f80);})[_0xcb7f('0x22')](function(_0x533ef9){_0x4a9405=_0x533ef9[0x0];var _0x587ec9=_0x37018c['concat'](_0x3d1edb)[_0xcb7f('0x8f')](_0x4a9405);var _0x2875b2={'count':_0x587ec9[_0xcb7f('0xb7')],'rows':_0x587ec9};return _0x2875b2;})['then'](respondWithResult(_0x18f014,null))[_0xcb7f('0x44')](function(_0x37b275){var _0x240c36=_0x1b3ba5['query'][_0xcb7f('0xb8')]?0x1f4:_0x37b275[_0xcb7f('0xb9')]||0x1f4;logger[_0xcb7f('0x24')](_0x37b275[_0xcb7f('0xba')]);delete _0x37b275[_0xcb7f('0x25')];if(_0x240c36===0x191){_0x240c36=0x190;}_0x18f014[_0xcb7f('0x18')](_0x240c36)[_0xcb7f('0xbb')](_0x1b3ba5[_0xcb7f('0x2d')][_0xcb7f('0xb8')]?{'message':_0xcb7f('0xbc'),'statusCode':_0x37b275['statusCode']}:_0x37b275);});};function getSelectList(_0x2d00be,_0x2e6abe,_0x3686a9,_0x5ed03a,_0x264775,_0x2c8133){var _0x32b196={'method':_0xcb7f('0xa1'),'uri':_0x2d00be+_0xcb7f('0xa2')+_0x5ed03a+_0xcb7f('0xbd')+_0x264775+_0xcb7f('0xbe')+_0xcb7f('0xbf'),'headers':{'Authorization':_0xcb7f('0x9e')+_0x2c8133,'If-None-Match':null,'OData-Version':_0xcb7f('0xa4')},'json':!![]};return rp(_0x32b196)[_0xcb7f('0x22')](function(_0x2f1e3a){var _0x14744d=[];var _0x209a05=_0x2f1e3a[_0xcb7f('0xc0')][_0xcb7f('0xc1')];_0x209a05[_0xcb7f('0xad')](function(_0x423211){_0x14744d['push']({'name':_0x423211[_0xcb7f('0xc2')][_0xcb7f('0xc3')]['Label'],'value':String(_0x423211[_0xcb7f('0xc4')])});});var _0x11b16f={'id':_0x2e6abe+'_'+_0x2f1e3a[_0xcb7f('0xa7')],'name':_0x2f1e3a[_0xcb7f('0xc5')]['UserLocalizedLabel'][_0xcb7f('0xc2')],'custom':![],'options':_0x14744d};_0x3686a9[_0xcb7f('0xaa')](_0x11b16f);return _0x3686a9;});}function getBooleanList(_0x562f76,_0x42cb96,_0xa2ec5e,_0x407d83,_0x30f474,_0x22e0fe){var _0x17c465={'method':'GET','uri':_0x562f76+_0xcb7f('0xa2')+_0x407d83+')/Attributes('+_0x30f474+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xcb7f('0x9e')+_0x22e0fe,'If-None-Match':null,'OData-Version':_0xcb7f('0xa4')},'json':!![]};return rp(_0x17c465)[_0xcb7f('0x22')](function(_0x4d0a1c){var _0x1d8451=[];_0x1d8451[_0xcb7f('0xaa')]({'name':_0x4d0a1c[_0xcb7f('0xc0')][_0xcb7f('0xc6')]['Label'][_0xcb7f('0xc3')][_0xcb7f('0xc2')],'value':_0xcb7f('0xc7')},{'name':_0x4d0a1c[_0xcb7f('0xc0')][_0xcb7f('0xc8')][_0xcb7f('0xc2')][_0xcb7f('0xc3')]['Label'],'value':_0xcb7f('0xc9')});var _0x36f4dc={'id':_0x42cb96+'_'+_0x4d0a1c[_0xcb7f('0xa7')],'name':_0x4d0a1c[_0xcb7f('0xc5')][_0xcb7f('0xc3')][_0xcb7f('0xc2')],'custom':![],'options':_0x1d8451};_0xa2ec5e[_0xcb7f('0xaa')](_0x36f4dc);return _0xa2ec5e;});}function getInputList(_0x274992,_0x2894cc,_0x5e309f,_0x583f9c,_0x1f2139,_0x363b9f,_0x469469){var _0x951c9d={'method':_0xcb7f('0xa1'),'uri':_0x274992+_0xcb7f('0xa2')+_0x1f2139+_0xcb7f('0xbd')+_0x363b9f+_0xcb7f('0xca')+_0x5e309f+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xcb7f('0x9e')+_0x469469,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x951c9d)[_0xcb7f('0x22')](function(_0x2ff001){var _0x1426e4={'id':_0x2894cc+'_'+_0x2ff001['LogicalName'],'name':_0x2ff001[_0xcb7f('0xc5')][_0xcb7f('0xc3')]?_0x2ff001[_0xcb7f('0xc5')][_0xcb7f('0xc3')][_0xcb7f('0xc2')]:_0x2ff001['LogicalName'],'custom':![],'options':[]};_0x583f9c['push'](_0x1426e4);return _0x583f9c;});}
\ No newline at end of file
+var _0x0bde=['slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','password','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','LogicalName','forEach','@odata.type','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','stack','send','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','then','end','error','name','index','Dynamics365Account','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','length','find','create','body','catch','params','getConfigurations','findOne','Dynamics365Configuration','order','pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','Dynamics365Field','Subjects','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridyominame','parentcaseidname','primarycontactidname','resolveby','responseby','responsiblecontactidname','sentimentvalue'];(function(_0x5ce6eb,_0x2c1544){var _0x2632d4=function(_0x3f5c67){while(--_0x3f5c67){_0x5ce6eb['push'](_0x5ce6eb['shift']());}};_0x2632d4(++_0x2c1544);}(_0x0bde,0x110));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0xe0bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0bd('0x1'));var jsonpatch=require(_0xe0bd('0x2'));var rp=require('request-promise');var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require(_0xe0bd('0xd'));var jsforce=require(_0xe0bd('0xe'));var deskjs=require(_0xe0bd('0xf'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0x10'));var Papa=require(_0xe0bd('0x11'));var Redis=require('ioredis');var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe0bd('0x14'));var logger=require('../../config/logger')(_0xe0bd('0x15'));var utils=require(_0xe0bd('0x16'));var config=require(_0xe0bd('0x17'));var licenseUtil=require(_0xe0bd('0x18'));var db=require(_0xe0bd('0x19'))['db'];var integrations=require(_0xe0bd('0x1a'));function respondWithStatusCode(_0x1905b2,_0x500a9e){_0x500a9e=_0x500a9e||0xcc;return function(_0xadea83){if(_0xadea83){return _0x1905b2[_0xe0bd('0x1b')](_0x500a9e);}return _0x1905b2[_0xe0bd('0x1c')](_0x500a9e)['end']();};}function respondWithResult(_0x479438,_0x48afde){_0x48afde=_0x48afde||0xc8;return function(_0x1858b8){if(_0x1858b8){return _0x479438[_0xe0bd('0x1c')](_0x48afde)[_0xe0bd('0x1d')](_0x1858b8);}};}function respondWithFilteredResult(_0x3042e1,_0x361429){return function(_0x302f5f){if(_0x302f5f){var _0x39e222=typeof _0x361429[_0xe0bd('0x1e')]==='undefined'&&typeof _0x361429['limit']===_0xe0bd('0x1f');var _0xd8746d=_0x302f5f[_0xe0bd('0x20')];var _0x100b8f=_0x39e222?0x0:_0x361429[_0xe0bd('0x1e')];var _0x2a015c=_0x39e222?_0x302f5f['count']:_0x361429['offset']+_0x361429[_0xe0bd('0x21')];var _0x1edb3d;if(_0x2a015c>=_0xd8746d){_0x2a015c=_0xd8746d;_0x1edb3d=0xc8;}else{_0x1edb3d=0xce;}_0x3042e1[_0xe0bd('0x1c')](_0x1edb3d);return _0x3042e1[_0xe0bd('0x22')](_0xe0bd('0x23'),_0x100b8f+'-'+_0x2a015c+'/'+_0xd8746d)[_0xe0bd('0x1d')](_0x302f5f);}return null;};}function patchUpdates(_0x3dbd98){return function(_0x572c25){try{jsonpatch['apply'](_0x572c25,_0x3dbd98,!![]);}catch(_0x1597ab){return BPromise[_0xe0bd('0x24')](_0x1597ab);}return _0x572c25[_0xe0bd('0x25')]();};}function saveUpdates(_0xdcb789,_0x290c1e){return function(_0x4ac6b7){if(_0x4ac6b7){return _0x4ac6b7[_0xe0bd('0x26')](_0xdcb789)['then'](function(_0x242cbe){return _0x242cbe;});}return null;};}function removeEntity(_0x296f64,_0x3f24b6){return function(_0x5467ff){if(_0x5467ff){return _0x5467ff[_0xe0bd('0x27')]()[_0xe0bd('0x28')](function(){_0x296f64['status'](0xcc)[_0xe0bd('0x29')]();});}};}function handleEntityNotFound(_0x5e6496,_0x2debcb){return function(_0x54d1d0){if(!_0x54d1d0){_0x5e6496[_0xe0bd('0x1b')](0x194);}return _0x54d1d0;};}function handleError(_0x72e284,_0x3c851d){_0x3c851d=_0x3c851d||0x1f4;return function(_0x53a727){logger[_0xe0bd('0x2a')](_0x53a727['stack']);if(_0x53a727[_0xe0bd('0x2b')]){delete _0x53a727[_0xe0bd('0x2b')];}_0x72e284['status'](_0x3c851d)['send'](_0x53a727);};}exports[_0xe0bd('0x2c')]=function(_0x3789a1,_0x441475){var _0x23a317={},_0x2d7f2f={},_0x17e614={'count':0x0,'rows':[]};var _0x8e0a2f=_['map'](db[_0xe0bd('0x2d')][_0xe0bd('0x2e')],function(_0x52329b){return{'name':_0x52329b[_0xe0bd('0x2f')],'type':_0x52329b[_0xe0bd('0x30')][_0xe0bd('0x31')]};});_0x2d7f2f['model']=_[_0xe0bd('0x32')](_0x8e0a2f,_0xe0bd('0x2b'));_0x2d7f2f[_0xe0bd('0x33')]=_[_0xe0bd('0x34')](_0x3789a1[_0xe0bd('0x33')]);_0x2d7f2f[_0xe0bd('0x35')]=_[_0xe0bd('0x36')](_0x2d7f2f[_0xe0bd('0x37')],_0x2d7f2f['query']);_0x23a317['attributes']=_[_0xe0bd('0x36')](_0x2d7f2f[_0xe0bd('0x37')],qs[_0xe0bd('0x38')](_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x38')]));_0x23a317['attributes']=_0x23a317['attributes']['length']?_0x23a317[_0xe0bd('0x39')]:_0x2d7f2f[_0xe0bd('0x37')];if(!_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x3a')](_0xe0bd('0x3b'))){_0x23a317[_0xe0bd('0x21')]=qs['limit'](_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x21')]);_0x23a317[_0xe0bd('0x1e')]=qs['offset'](_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x1e')]);}_0x23a317['order']=qs[_0xe0bd('0x3c')](_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x3c')]);_0x23a317['where']=qs[_0xe0bd('0x35')](_['pick'](_0x3789a1[_0xe0bd('0x33')],_0x2d7f2f[_0xe0bd('0x35')]),_0x8e0a2f);if(_0x3789a1[_0xe0bd('0x33')][_0xe0bd('0x3d')]){_0x23a317['where']=_[_0xe0bd('0x3e')](_0x23a317[_0xe0bd('0x3f')],{'$or':_[_0xe0bd('0x32')](_0x8e0a2f,function(_0x4f73dd){if(_0x4f73dd['type']!==_0xe0bd('0x40')){var _0x2d18db={};_0x2d18db[_0x4f73dd[_0xe0bd('0x2b')]]={'$like':'%'+_0x3789a1['query']['filter']+'%'};return _0x2d18db;}})});}_0x23a317=_[_0xe0bd('0x3e')]({},_0x23a317,_0x3789a1[_0xe0bd('0x41')]);var _0x324bb2={'where':_0x23a317[_0xe0bd('0x3f')]};return db['Dynamics365Account'][_0xe0bd('0x20')](_0x324bb2)[_0xe0bd('0x28')](function(_0x351412){_0x17e614['count']=_0x351412;if(_0x3789a1['query'][_0xe0bd('0x42')]){_0x23a317[_0xe0bd('0x43')]=[{'all':!![]}];}return db[_0xe0bd('0x2d')][_0xe0bd('0x44')](_0x23a317);})['then'](function(_0x7a2547){_0x17e614[_0xe0bd('0x45')]=_0x7a2547;return _0x17e614;})[_0xe0bd('0x28')](respondWithFilteredResult(_0x441475,_0x23a317))['catch'](handleError(_0x441475,null));};exports['show']=function(_0x27a582,_0x52a0af){var _0x24be53={'raw':![],'where':{'id':_0x27a582['params']['id']}},_0x2f5a60={};_0x2f5a60[_0xe0bd('0x37')]=_[_0xe0bd('0x34')](db[_0xe0bd('0x2d')]['rawAttributes']);_0x2f5a60[_0xe0bd('0x33')]=_[_0xe0bd('0x34')](_0x27a582[_0xe0bd('0x33')]);_0x2f5a60[_0xe0bd('0x35')]=_[_0xe0bd('0x36')](_0x2f5a60[_0xe0bd('0x37')],_0x2f5a60[_0xe0bd('0x33')]);_0x24be53[_0xe0bd('0x39')]=_['intersection'](_0x2f5a60[_0xe0bd('0x37')],qs[_0xe0bd('0x38')](_0x27a582[_0xe0bd('0x33')][_0xe0bd('0x38')]));_0x24be53[_0xe0bd('0x39')]=_0x24be53[_0xe0bd('0x39')][_0xe0bd('0x46')]?_0x24be53[_0xe0bd('0x39')]:_0x2f5a60['model'];if(_0x27a582[_0xe0bd('0x33')][_0xe0bd('0x42')]){_0x24be53[_0xe0bd('0x43')]=[{'all':!![]}];}_0x24be53=_[_0xe0bd('0x3e')]({},_0x24be53,_0x27a582[_0xe0bd('0x41')]);return db['Dynamics365Account'][_0xe0bd('0x47')](_0x24be53)['then'](handleEntityNotFound(_0x52a0af,null))['then'](respondWithResult(_0x52a0af,null))['catch'](handleError(_0x52a0af,null));};exports[_0xe0bd('0x48')]=function(_0x55dd83,_0x545cfb){return db[_0xe0bd('0x2d')][_0xe0bd('0x48')](_0x55dd83[_0xe0bd('0x49')],{})[_0xe0bd('0x28')](respondWithResult(_0x545cfb,0xc9))[_0xe0bd('0x4a')](handleError(_0x545cfb,null));};exports[_0xe0bd('0x26')]=function(_0xe2b989,_0x1c4464){if(_0xe2b989[_0xe0bd('0x49')]['id']){delete _0xe2b989[_0xe0bd('0x49')]['id'];}return db['Dynamics365Account'][_0xe0bd('0x47')]({'where':{'id':_0xe2b989['params']['id']}})['then'](handleEntityNotFound(_0x1c4464,null))[_0xe0bd('0x28')](saveUpdates(_0xe2b989[_0xe0bd('0x49')],null))[_0xe0bd('0x28')](respondWithResult(_0x1c4464,null))['catch'](handleError(_0x1c4464,null));};exports[_0xe0bd('0x27')]=function(_0x3fe076,_0x2ace8e){return db[_0xe0bd('0x2d')][_0xe0bd('0x47')]({'where':{'id':_0x3fe076[_0xe0bd('0x4b')]['id']}})[_0xe0bd('0x28')](handleEntityNotFound(_0x2ace8e,null))[_0xe0bd('0x28')](removeEntity(_0x2ace8e,null))[_0xe0bd('0x4a')](handleError(_0x2ace8e,null));};exports[_0xe0bd('0x4c')]=function(_0x29c7f8,_0x29c721,_0x544195){var _0x1a62ce={};var _0xa761ae={};var _0x530338;var _0x5b246b;return db['Dynamics365Account'][_0xe0bd('0x4d')]({'where':{'id':_0x29c7f8['params']['id']}})['then'](handleEntityNotFound(_0x29c721,null))['then'](function(_0x26b184){if(_0x26b184){_0x530338=_0x26b184;_0xa761ae[_0xe0bd('0x37')]=_[_0xe0bd('0x34')](db[_0xe0bd('0x4e')]['rawAttributes']);_0xa761ae[_0xe0bd('0x33')]=_['keys'](_0x29c7f8[_0xe0bd('0x33')]);_0xa761ae[_0xe0bd('0x35')]=_[_0xe0bd('0x36')](_0xa761ae[_0xe0bd('0x37')],_0xa761ae[_0xe0bd('0x33')]);_0x1a62ce[_0xe0bd('0x39')]=_[_0xe0bd('0x36')](_0xa761ae[_0xe0bd('0x37')],qs[_0xe0bd('0x38')](_0x29c7f8[_0xe0bd('0x33')][_0xe0bd('0x38')]));_0x1a62ce[_0xe0bd('0x39')]=_0x1a62ce[_0xe0bd('0x39')]['length']?_0x1a62ce[_0xe0bd('0x39')]:_0xa761ae['model'];_0x1a62ce[_0xe0bd('0x4f')]=qs[_0xe0bd('0x3c')](_0x29c7f8[_0xe0bd('0x33')][_0xe0bd('0x3c')]);_0x1a62ce[_0xe0bd('0x3f')]=qs[_0xe0bd('0x35')](_[_0xe0bd('0x50')](_0x29c7f8[_0xe0bd('0x33')],_0xa761ae[_0xe0bd('0x35')]));if(_0x29c7f8['query']['filter']){_0x1a62ce['where']=_[_0xe0bd('0x3e')](_0x1a62ce[_0xe0bd('0x3f')],{'$or':_[_0xe0bd('0x32')](_0x1a62ce[_0xe0bd('0x39')],function(_0x3c12a2){var _0x293f91={};_0x293f91[_0x3c12a2]={'$like':'%'+_0x29c7f8[_0xe0bd('0x33')][_0xe0bd('0x3d')]+'%'};return _0x293f91;})});}_0x1a62ce=_[_0xe0bd('0x3e')]({},_0x1a62ce,_0x29c7f8['options']);return _0x530338[_0xe0bd('0x4c')](_0x1a62ce);}})['then'](function(_0x5f0226){if(_0x5f0226){_0x5b246b=_0x5f0226[_0xe0bd('0x46')];if(!_0x29c7f8[_0xe0bd('0x33')][_0xe0bd('0x3a')](_0xe0bd('0x3b'))){_0x1a62ce[_0xe0bd('0x21')]=qs[_0xe0bd('0x21')](_0x29c7f8[_0xe0bd('0x33')]['limit']);_0x1a62ce[_0xe0bd('0x1e')]=qs[_0xe0bd('0x1e')](_0x29c7f8[_0xe0bd('0x33')]['offset']);}return _0x530338[_0xe0bd('0x4c')](_0x1a62ce);}})[_0xe0bd('0x28')](function(_0x593e24){if(_0x593e24){return _0x593e24?{'count':_0x5b246b,'rows':_0x593e24}:null;}})[_0xe0bd('0x28')](respondWithResult(_0x29c721,null))[_0xe0bd('0x4a')](handleError(_0x29c721,null));};exports[_0xe0bd('0x51')]=function(_0x26d6fc,_0x5a43e0,_0x4721f9){if(_0x26d6fc[_0xe0bd('0x49')]['id']){delete _0x26d6fc[_0xe0bd('0x49')]['id'];}return db[_0xe0bd('0x2d')][_0xe0bd('0x4d')]({'where':{'id':_0x26d6fc[_0xe0bd('0x4b')]['id']}})[_0xe0bd('0x28')](handleEntityNotFound(_0x5a43e0,null))[_0xe0bd('0x28')](function(_0x1a6881){if(_0x1a6881){_0x26d6fc[_0xe0bd('0x49')][_0xe0bd('0x52')]=_0x1a6881['id'];_0x26d6fc[_0xe0bd('0x49')]['Subjects']=integrations[_0xe0bd('0x53')](_0x26d6fc[_0xe0bd('0x49')][_0xe0bd('0x54')],_0x26d6fc[_0xe0bd('0x49')][_0xe0bd('0x30')]);_0x26d6fc[_0xe0bd('0x49')][_0xe0bd('0x55')]=integrations['getDescriptions'](_0x26d6fc[_0xe0bd('0x49')]['channel'],_0x26d6fc[_0xe0bd('0x49')]['type']);return db[_0xe0bd('0x4e')][_0xe0bd('0x48')](_0x26d6fc[_0xe0bd('0x49')],{'include':[{'model':db[_0xe0bd('0x56')],'as':_0xe0bd('0x57')},{'model':db[_0xe0bd('0x56')],'as':_0xe0bd('0x55')}]});}return null;})[_0xe0bd('0x28')](respondWithResult(_0x5a43e0,null))[_0xe0bd('0x4a')](handleError(_0x5a43e0,null));};exports[_0xe0bd('0x58')]=function(_0x47d775,_0x2a997f,_0x354f31){var _0x184c64=_0x47d775[_0xe0bd('0x33')][_0xe0bd('0x59')];var _0x2336d8=_0x184c64===_0xe0bd('0x5a')?_0xe0bd('0x5b'):_0xe0bd('0x5c');var _0xde7194='';var _0x4a5413='';var _0x5c4ba0='';var _0x23c450='';var _0x95dd5='';var _0x236217='';var _0x522daf='';var _0x46841c='';var _0x10a29b=[_0xe0bd('0x5d'),'description',_0xe0bd('0x5e'),_0xe0bd('0x5f'),'caseorigincode',_0xe0bd('0x60'),_0xe0bd('0x61'),_0xe0bd('0x62'),_0xe0bd('0x63'),'phonecall_activity_parties'];var _0x543e78=[_0xe0bd('0x64'),'accountidyominame',_0xe0bd('0x65'),_0xe0bd('0x66'),_0xe0bd('0x67'),_0xe0bd('0x68'),_0xe0bd('0x69'),_0xe0bd('0x6a'),_0xe0bd('0x6b'),'createdbyexternalpartyyominame',_0xe0bd('0x6c'),_0xe0bd('0x6d'),_0xe0bd('0x6e'),'createdonbehalfbyname','createdonbehalfbyyominame','customeridname',_0xe0bd('0x6f'),_0xe0bd('0x70'),_0xe0bd('0x71'),_0xe0bd('0x72'),_0xe0bd('0x73'),_0xe0bd('0x74'),'escalatedon',_0xe0bd('0x75'),'firstresponsebykpiidname','followupby',_0xe0bd('0x76'),_0xe0bd('0x77'),_0xe0bd('0x78'),_0xe0bd('0x79'),_0xe0bd('0x7a'),_0xe0bd('0x7b'),_0xe0bd('0x7c'),_0xe0bd('0x7d'),_0xe0bd('0x7e'),_0xe0bd('0x7f'),_0xe0bd('0x80'),'modifiedonbehalfbyyominame',_0xe0bd('0x81'),_0xe0bd('0x82'),'numberofchildincidents',_0xe0bd('0x83'),_0xe0bd('0x84'),'owneridname','owneridtype',_0xe0bd('0x85'),_0xe0bd('0x86'),_0xe0bd('0x87'),'primarycontactidyominame','prioritycodename','productidname','productserialnumber',_0xe0bd('0x88'),'resolvebykpiidname',_0xe0bd('0x89'),_0xe0bd('0x8a'),'responsiblecontactidyominame',_0xe0bd('0x8b'),_0xe0bd('0x8c'),_0xe0bd('0x8d'),_0xe0bd('0x8e'),_0xe0bd('0x8f'),_0xe0bd('0x90'),_0xe0bd('0x91'),_0xe0bd('0x92'),_0xe0bd('0x93'),_0xe0bd('0x94'),'traversedpath',_0xe0bd('0x95'),_0xe0bd('0x96')];var _0x17ecc0=_0x10a29b['concat'](_0x543e78);return db[_0xe0bd('0x2d')][_0xe0bd('0x4d')]({'where':{'id':_0x47d775[_0xe0bd('0x4b')]['id']},'attributes':['id','username',_0xe0bd('0x97'),_0xe0bd('0x98'),'tenantId',_0xe0bd('0x99'),_0xe0bd('0x9a')]})[_0xe0bd('0x28')](handleEntityNotFound(_0x2a997f,null))[_0xe0bd('0x28')](function(_0x425159){if(_0x425159){_0x46841c=_0x425159[_0xe0bd('0x98')];var _0x5dbbc7=_0x46841c[_0xe0bd('0x9b')](-0x1);if(_0x5dbbc7==='/'){_0x46841c=_0x46841c[_0xe0bd('0x9c')](0x0,_0x46841c[_0xe0bd('0x9d')](_0x5dbbc7));}_0x522daf=util[_0xe0bd('0x9e')](_0xe0bd('0x9f'),_0x46841c);var _0x1a32a1={'method':_0xe0bd('0xa0'),'uri':_0xe0bd('0xa1')+_0x425159['tenantId']+_0xe0bd('0xa2'),'form':{'client_id':_0x425159[_0xe0bd('0x99')],'resource':_0x46841c,'username':_0x425159['username'],'password':_0x425159[_0xe0bd('0x97')],'grant_type':_0xe0bd('0x97'),'client_secret':_0x425159[_0xe0bd('0x9a')]},'json':!![]};return rp(_0x1a32a1);}})['then'](function(_0x445a58){_0x236217=_0x445a58[_0xe0bd('0xa3')];var _0x5dfb39={'method':_0xe0bd('0xa4'),'uri':encodeURI(_0x522daf+_0xe0bd('0xa5')+_0x2336d8+'\x27'),'headers':{'Authorization':_0xe0bd('0xa6')+_0x236217,'If-None-Match':null,'OData-Version':_0xe0bd('0xa7')},'json':!![]};return rp(_0x5dfb39);})[_0xe0bd('0x28')](function(_0xc295e9){var _0x53ba2f=_0xc295e9[_0xe0bd('0xa8')][0x0];var _0x5be878=_0x53ba2f[_0xe0bd('0xa9')];var _0x308efa={'method':_0xe0bd('0xa4'),'uri':_0x522daf+_0xe0bd('0xaa')+_0x5be878+_0xe0bd('0xab'),'headers':{'Authorization':_0xe0bd('0xa6')+_0x236217,'If-None-Match':null,'OData-Version':_0xe0bd('0xa7')},'json':!![]};return rp(_0x308efa);})[_0xe0bd('0x28')](function(_0xe753ad){_0xde7194=_0xe753ad;_0x4a5413=_0xde7194['Attributes'];_0x4a5413=_[_0xe0bd('0xac')](_0x4a5413,function(_0x2d742d){return!_0x17ecc0['includes'](_0x2d742d[_0xe0bd('0xad')]);});var _0x35ee85=[];var _0x142b98=[];_0x4a5413[_0xe0bd('0xae')](function(_0x40f0e1){if(_0x40f0e1[_0xe0bd('0xaf')]){var _0x117abb=_0x40f0e1['@odata.type'][_0xe0bd('0x9c')](_0x40f0e1[_0xe0bd('0xaf')][_0xe0bd('0x9d')]('.')+0x1);if(_0x117abb==='PicklistAttributeMetadata'){_0x35ee85[_0xe0bd('0xb0')](getSelectList(_0x522daf,_0x184c64,_0x142b98,_0xde7194['MetadataId'],_0x40f0e1[_0xe0bd('0xa9')],_0x236217));}}});return Promise[_0xe0bd('0xb1')](_0x35ee85);})[_0xe0bd('0x28')](function(_0x280107){_0x5c4ba0=_0x280107[0x0];var _0x359b34=[];var _0x538adf=[];_0x4a5413[_0xe0bd('0xae')](function(_0x14bb92){if(!_[_0xe0bd('0xb2')](_0x14bb92[_0xe0bd('0xaf')])){var _0x3edc86=_0x14bb92[_0xe0bd('0xaf')][_0xe0bd('0x9c')](_0x14bb92[_0xe0bd('0xaf')][_0xe0bd('0x9d')]('.')+0x1);if(_0x3edc86===_0xe0bd('0xb3')){_0x359b34[_0xe0bd('0xb0')](getBooleanList(_0x522daf,_0x184c64,_0x538adf,_0xde7194['MetadataId'],_0x14bb92[_0xe0bd('0xa9')],_0x236217));}}});return Promise[_0xe0bd('0xb1')](_0x359b34);})['then'](function(_0x220710){_0x23c450=_0x220710[0x0];var _0x4d7f3b=[];var _0xd8aba3=[];_0x4a5413[_0xe0bd('0xae')](function(_0x202f9b){if(_0x202f9b['@odata.type']){var _0x1e75b6=_0x202f9b[_0xe0bd('0xaf')][_0xe0bd('0x9c')](_0x202f9b[_0xe0bd('0xaf')][_0xe0bd('0x9d')]('.')+0x1);if(_0x1e75b6===_0xe0bd('0xb4')||_0x1e75b6===_0xe0bd('0xb5')||_0x1e75b6===_0xe0bd('0xb6')||_0x1e75b6==='IntegerAttributeMetadata'||_0x1e75b6===_0xe0bd('0xb7')||_0x1e75b6===_0xe0bd('0xb8')||_0x1e75b6===_0xe0bd('0xb9')||_0x1e75b6==='EntityNameAttributeMetadata'||_0x1e75b6===_0xe0bd('0xba')||_0x1e75b6===_0xe0bd('0xbb')){_0x4d7f3b[_0xe0bd('0xb0')](getInputList(_0x522daf,_0x184c64,_0x1e75b6,_0xd8aba3,_0xde7194['MetadataId'],_0x202f9b['MetadataId'],_0x236217));}}});return Promise[_0xe0bd('0xb1')](_0x4d7f3b);})['then'](function(_0x2aec8e){_0x95dd5=_0x2aec8e[0x0];var _0x58629=_0x5c4ba0[_0xe0bd('0xbc')](_0x23c450)[_0xe0bd('0xbc')](_0x95dd5);var _0x4eaa9b={'count':_0x58629[_0xe0bd('0x46')],'rows':_0x58629};return _0x4eaa9b;})[_0xe0bd('0x28')](respondWithResult(_0x2a997f,null))[_0xe0bd('0x4a')](function(_0x26e2a7){var _0x591a5e=_0x47d775['query'][_0xe0bd('0xbd')]?0x1f4:_0x26e2a7['statusCode']||0x1f4;logger[_0xe0bd('0x2a')](_0x26e2a7[_0xe0bd('0xbe')]);delete _0x26e2a7[_0xe0bd('0x2b')];if(_0x591a5e===0x191){_0x591a5e=0x190;}_0x2a997f[_0xe0bd('0x1c')](_0x591a5e)[_0xe0bd('0xbf')](_0x47d775[_0xe0bd('0x33')][_0xe0bd('0xbd')]?{'message':_0xe0bd('0xc0'),'statusCode':_0x26e2a7['statusCode']}:_0x26e2a7);});};function getSelectList(_0x59833b,_0x197ddb,_0x193257,_0x35e991,_0x28de70,_0x4e9055){var _0x28ee47={'method':'GET','uri':_0x59833b+_0xe0bd('0xaa')+_0x35e991+')/Attributes('+_0x28de70+_0xe0bd('0xc1')+_0xe0bd('0xc2'),'headers':{'Authorization':_0xe0bd('0xa6')+_0x4e9055,'If-None-Match':null,'OData-Version':_0xe0bd('0xa7')},'json':!![]};return rp(_0x28ee47)[_0xe0bd('0x28')](function(_0x1736a3){var _0x176d4a=[];var _0x3c5f36=_0x1736a3[_0xe0bd('0xc3')]['Options'];_0x3c5f36[_0xe0bd('0xae')](function(_0xc3798b){_0x176d4a['push']({'name':_0xc3798b[_0xe0bd('0xc4')][_0xe0bd('0xc5')][_0xe0bd('0xc4')],'value':String(_0xc3798b[_0xe0bd('0xc6')])});});var _0x4408f8={'id':_0x197ddb+'_'+_0x1736a3[_0xe0bd('0xad')],'name':_0x1736a3[_0xe0bd('0xc7')][_0xe0bd('0xc5')]['Label'],'custom':![],'options':_0x176d4a};_0x193257[_0xe0bd('0xb0')](_0x4408f8);return _0x193257;});}function getBooleanList(_0x6bf871,_0x46fa11,_0x461598,_0x4e0ed9,_0x133415,_0x5e396b){var _0x8850b4={'method':_0xe0bd('0xa4'),'uri':_0x6bf871+_0xe0bd('0xaa')+_0x4e0ed9+_0xe0bd('0xc8')+_0x133415+_0xe0bd('0xc9'),'headers':{'Authorization':_0xe0bd('0xa6')+_0x5e396b,'If-None-Match':null,'OData-Version':_0xe0bd('0xa7')},'json':!![]};return rp(_0x8850b4)[_0xe0bd('0x28')](function(_0x3f9bd1){var _0x1cfdfa=[];_0x1cfdfa[_0xe0bd('0xb0')]({'name':_0x3f9bd1[_0xe0bd('0xc3')][_0xe0bd('0xca')][_0xe0bd('0xc4')][_0xe0bd('0xc5')][_0xe0bd('0xc4')],'value':_0xe0bd('0xcb')},{'name':_0x3f9bd1[_0xe0bd('0xc3')]['FalseOption'][_0xe0bd('0xc4')][_0xe0bd('0xc5')][_0xe0bd('0xc4')],'value':_0xe0bd('0xcc')});var _0x23b4c4={'id':_0x46fa11+'_'+_0x3f9bd1[_0xe0bd('0xad')],'name':_0x3f9bd1['DisplayName'][_0xe0bd('0xc5')][_0xe0bd('0xc4')],'custom':![],'options':_0x1cfdfa};_0x461598['push'](_0x23b4c4);return _0x461598;});}function getInputList(_0x1daf26,_0x35125d,_0x41b36e,_0x5cc40c,_0x66909f,_0x549200,_0x373911){var _0x123a1c={'method':_0xe0bd('0xa4'),'uri':_0x1daf26+_0xe0bd('0xaa')+_0x66909f+_0xe0bd('0xc8')+_0x549200+_0xe0bd('0xcd')+_0x41b36e+'?$select=DisplayName,LogicalName','headers':{'Authorization':'Bearer\x20'+_0x373911,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x123a1c)[_0xe0bd('0x28')](function(_0x2271d4){var _0x482458={'id':_0x35125d+'_'+_0x2271d4[_0xe0bd('0xad')],'name':_0x2271d4['DisplayName'][_0xe0bd('0xc5')]?_0x2271d4[_0xe0bd('0xc7')][_0xe0bd('0xc5')][_0xe0bd('0xc4')]:_0x2271d4[_0xe0bd('0xad')],'custom':![],'options':[]};_0x5cc40c['push'](_0x482458);return _0x5cc40c;});}
\ No newline at end of file
index 86bd413..1074318 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x42b01c,_0x49e2b7){var _0x3ddc2d=function(_0x1f4a39){while(--_0x1f4a39){_0x42b01c['push'](_0x42b01c['shift']());}};_0x3ddc2d(++_0x49e2b7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xb7e7[_0x1abb09];return _0xea1c07;};'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'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x523b93,_0x5a842b){var _0x24f40a=function(_0x31049d){while(--_0x31049d){_0x523b93['push'](_0x523b93['shift']());}};_0x24f40a(++_0x5a842b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f9e3895..f26f3ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8725=['model','GetDynamics365Account','debug','stringify','ShowDynamics365Account','where','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','Dynamics365Account','findAll','options','raw','limit','include','map','attributes'];(function(_0x5762cc,_0xffa080){var _0x1d66b5=function(_0x13fef0){while(--_0x13fef0){_0x5762cc['push'](_0x5762cc['shift']());}};_0x1d66b5(++_0xffa080);}(_0x8725,0xde));var _0x5872=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0x8725[_0x3e0763];return _0x351ca2;};'use strict';var _=require(_0x5872('0x0'));var util=require(_0x5872('0x1'));var moment=require(_0x5872('0x2'));var BPromise=require(_0x5872('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5872('0x4'))['db'];var utils=require(_0x5872('0x5'));var logger=require(_0x5872('0x6'))(_0x5872('0x7'));var config=require(_0x5872('0x8'));var jayson=require(_0x5872('0x9'));var client=jayson['client'][_0x5872('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41dad6,_0x50ca2c,_0x20307a){return new BPromise(function(_0x4af038,_0x34bdae){return client[_0x5872('0xb')](_0x41dad6,_0x20307a)[_0x5872('0xc')](function(_0x84f918){logger[_0x5872('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x50ca2c,_0x5872('0xe'));logger['debug'](_0x5872('0xf'),_0x50ca2c,'request\x20sent',JSON['stringify'](_0x84f918));if(_0x84f918[_0x5872('0x10')]){if(_0x84f918['error'][_0x5872('0x11')]===0x1f4){logger[_0x5872('0x10')](_0x5872('0x12'),_0x50ca2c,_0x84f918[_0x5872('0x10')][_0x5872('0x13')]);return _0x34bdae(_0x84f918['error'][_0x5872('0x13')]);}logger[_0x5872('0x10')](_0x5872('0x12'),_0x50ca2c,_0x84f918['error'][_0x5872('0x13')]);return _0x4af038(_0x84f918[_0x5872('0x10')][_0x5872('0x13')]);}else{logger[_0x5872('0xd')](_0x5872('0x12'),_0x50ca2c,_0x5872('0xe'));_0x4af038(_0x84f918[_0x5872('0x14')]['message']);}})[_0x5872('0x15')](function(_0x2d78ec){logger[_0x5872('0x10')](_0x5872('0x12'),_0x50ca2c,_0x2d78ec);_0x34bdae(_0x2d78ec);});});}exports['GetDynamics365Account']=function(_0xe4cbde){var _0x8a5953=this;return new Promise(function(_0x11ea50,_0x4bbec0){return db[_0x5872('0x16')][_0x5872('0x17')]({'raw':_0xe4cbde[_0x5872('0x18')]?_0xe4cbde[_0x5872('0x18')][_0x5872('0x19')]===undefined?!![]:![]:!![],'where':_0xe4cbde[_0x5872('0x18')]?_0xe4cbde[_0x5872('0x18')]['where']||null:null,'attributes':_0xe4cbde['options']?_0xe4cbde[_0x5872('0x18')]['attributes']||null:null,'limit':_0xe4cbde[_0x5872('0x18')]?_0xe4cbde[_0x5872('0x18')][_0x5872('0x1a')]||null:null,'include':_0xe4cbde[_0x5872('0x18')]?_0xe4cbde[_0x5872('0x18')][_0x5872('0x1b')]?_[_0x5872('0x1c')](_0xe4cbde['options']['include'],function(_0x128192){return{'model':db[_0x128192['model']],'as':_0x128192['as'],'attributes':_0x128192[_0x5872('0x1d')],'include':_0x128192['include']?_[_0x5872('0x1c')](_0x128192[_0x5872('0x1b')],function(_0x969c2a){return{'model':db[_0x969c2a[_0x5872('0x1e')]],'as':_0x969c2a['as'],'attributes':_0x969c2a[_0x5872('0x1d')],'include':_0x969c2a[_0x5872('0x1b')]?_[_0x5872('0x1c')](_0x969c2a[_0x5872('0x1b')],function(_0x5b640c){return{'model':db[_0x5b640c[_0x5872('0x1e')]],'as':_0x5b640c['as'],'attributes':_0x5b640c[_0x5872('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5872('0xc')](function(_0x3e8199){logger['info'](_0x5872('0x1f'),_0xe4cbde);logger[_0x5872('0x20')]('GetDynamics365Account',_0xe4cbde,JSON[_0x5872('0x21')](_0x3e8199));_0x11ea50(_0x3e8199);})[_0x5872('0x15')](function(_0x2bfc33){logger['error'](_0x5872('0x1f'),_0x2bfc33['message'],_0xe4cbde);_0x4bbec0(_0x8a5953['error'](0x1f4,_0x2bfc33[_0x5872('0x13')]));});});};exports[_0x5872('0x22')]=function(_0x465147){var _0x4c22cf=this;return new Promise(function(_0x2614cc,_0x32b31b){return db[_0x5872('0x16')]['find']({'raw':_0x465147['options']?_0x465147[_0x5872('0x18')][_0x5872('0x19')]===undefined?!![]:![]:!![],'where':_0x465147['options']?_0x465147[_0x5872('0x18')][_0x5872('0x23')]||null:null,'attributes':_0x465147['options']?_0x465147[_0x5872('0x18')][_0x5872('0x1d')]||null:null,'include':_0x465147[_0x5872('0x18')]?_0x465147[_0x5872('0x18')][_0x5872('0x1b')]?_[_0x5872('0x1c')](_0x465147[_0x5872('0x18')][_0x5872('0x1b')],function(_0x152649){return{'model':db[_0x152649[_0x5872('0x1e')]],'as':_0x152649['as'],'attributes':_0x152649[_0x5872('0x1d')],'include':_0x152649[_0x5872('0x1b')]?_[_0x5872('0x1c')](_0x152649[_0x5872('0x1b')],function(_0x154792){return{'model':db[_0x154792[_0x5872('0x1e')]],'as':_0x154792['as'],'attributes':_0x154792[_0x5872('0x1d')],'include':_0x154792[_0x5872('0x1b')]?_['map'](_0x154792[_0x5872('0x1b')],function(_0x2fbb73){return{'model':db[_0x2fbb73[_0x5872('0x1e')]],'as':_0x2fbb73['as'],'attributes':_0x2fbb73['attributes']};}):[]};}):[]};}):[]:[]})[_0x5872('0xc')](function(_0x3adda3){logger[_0x5872('0xd')](_0x5872('0x22'),_0x465147);logger['debug'](_0x5872('0x22'),_0x465147,JSON[_0x5872('0x21')](_0x3adda3));_0x2614cc(_0x3adda3);})[_0x5872('0x15')](function(_0x13e355){logger[_0x5872('0x10')](_0x5872('0x22'),_0x13e355[_0x5872('0x13')],_0x465147);_0x32b31b(_0x4c22cf[_0x5872('0x10')](0x1f4,_0x13e355['message']));});});};
\ No newline at end of file
+var _0x15c6=['then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetDynamics365Account','debug','ShowDynamics365Account','Dynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x5ba343,_0x5340da){var _0x4e4811=function(_0x47293c){while(--_0x47293c){_0x5ba343['push'](_0x5ba343['shift']());}};_0x4e4811(++_0x5340da);}(_0x15c6,0x11b));var _0x615c=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x15c6[_0x12f688];return _0x59c3de;};'use strict';var _=require(_0x615c('0x0'));var util=require(_0x615c('0x1'));var moment=require(_0x615c('0x2'));var BPromise=require(_0x615c('0x3'));var rs=require(_0x615c('0x4'));var fs=require('fs');var Redis=require(_0x615c('0x5'));var db=require(_0x615c('0x6'))['db'];var utils=require(_0x615c('0x7'));var logger=require('../../config/logger')(_0x615c('0x8'));var config=require(_0x615c('0x9'));var jayson=require(_0x615c('0xa'));var client=jayson[_0x615c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39b4e9,_0x30e5d1,_0x59091f){return new BPromise(function(_0x116f6d,_0x4581ee){return client[_0x615c('0xc')](_0x39b4e9,_0x59091f)[_0x615c('0xd')](function(_0xdd2025){logger[_0x615c('0xe')](_0x615c('0xf'),_0x30e5d1,_0x615c('0x10'));logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x30e5d1,_0x615c('0x10'),JSON[_0x615c('0x11')](_0xdd2025));if(_0xdd2025[_0x615c('0x12')]){if(_0xdd2025['error'][_0x615c('0x13')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x30e5d1,_0xdd2025['error']['message']);return _0x4581ee(_0xdd2025[_0x615c('0x12')][_0x615c('0x14')]);}logger[_0x615c('0x12')](_0x615c('0xf'),_0x30e5d1,_0xdd2025['error'][_0x615c('0x14')]);return _0x116f6d(_0xdd2025[_0x615c('0x12')]['message']);}else{logger[_0x615c('0xe')](_0x615c('0xf'),_0x30e5d1,_0x615c('0x10'));_0x116f6d(_0xdd2025[_0x615c('0x15')][_0x615c('0x14')]);}})[_0x615c('0x16')](function(_0x41406e){logger[_0x615c('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x30e5d1,_0x41406e);_0x4581ee(_0x41406e);});});}exports['GetDynamics365Account']=function(_0x317302){var _0x55a38a=this;return new Promise(function(_0x475526,_0x154a56){return db['Dynamics365Account'][_0x615c('0x17')]({'raw':_0x317302[_0x615c('0x18')]?_0x317302[_0x615c('0x18')][_0x615c('0x19')]===undefined?!![]:![]:!![],'where':_0x317302[_0x615c('0x18')]?_0x317302[_0x615c('0x18')][_0x615c('0x1a')]||null:null,'attributes':_0x317302['options']?_0x317302[_0x615c('0x18')][_0x615c('0x1b')]||null:null,'limit':_0x317302[_0x615c('0x18')]?_0x317302[_0x615c('0x18')][_0x615c('0x1c')]||null:null,'include':_0x317302[_0x615c('0x18')]?_0x317302[_0x615c('0x18')][_0x615c('0x1d')]?_[_0x615c('0x1e')](_0x317302[_0x615c('0x18')][_0x615c('0x1d')],function(_0x598d89){return{'model':db[_0x598d89[_0x615c('0x1f')]],'as':_0x598d89['as'],'attributes':_0x598d89[_0x615c('0x1b')],'include':_0x598d89['include']?_['map'](_0x598d89['include'],function(_0x1cd317){return{'model':db[_0x1cd317[_0x615c('0x1f')]],'as':_0x1cd317['as'],'attributes':_0x1cd317[_0x615c('0x1b')],'include':_0x1cd317[_0x615c('0x1d')]?_[_0x615c('0x1e')](_0x1cd317[_0x615c('0x1d')],function(_0x2a3be9){return{'model':db[_0x2a3be9[_0x615c('0x1f')]],'as':_0x2a3be9['as'],'attributes':_0x2a3be9[_0x615c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x615c('0xd')](function(_0x12cd91){logger[_0x615c('0xe')](_0x615c('0x20'),_0x317302);logger[_0x615c('0x21')](_0x615c('0x20'),_0x317302,JSON[_0x615c('0x11')](_0x12cd91));_0x475526(_0x12cd91);})[_0x615c('0x16')](function(_0xbc1392){logger[_0x615c('0x12')](_0x615c('0x20'),_0xbc1392[_0x615c('0x14')],_0x317302);_0x154a56(_0x55a38a[_0x615c('0x12')](0x1f4,_0xbc1392['message']));});});};exports[_0x615c('0x22')]=function(_0x3714eb){var _0x264322=this;return new Promise(function(_0x171844,_0x5c962c){return db[_0x615c('0x23')][_0x615c('0x24')]({'raw':_0x3714eb[_0x615c('0x18')]?_0x3714eb[_0x615c('0x18')][_0x615c('0x19')]===undefined?!![]:![]:!![],'where':_0x3714eb[_0x615c('0x18')]?_0x3714eb[_0x615c('0x18')][_0x615c('0x1a')]||null:null,'attributes':_0x3714eb['options']?_0x3714eb[_0x615c('0x18')][_0x615c('0x1b')]||null:null,'include':_0x3714eb[_0x615c('0x18')]?_0x3714eb[_0x615c('0x18')][_0x615c('0x1d')]?_[_0x615c('0x1e')](_0x3714eb[_0x615c('0x18')][_0x615c('0x1d')],function(_0x4b2e6e){return{'model':db[_0x4b2e6e['model']],'as':_0x4b2e6e['as'],'attributes':_0x4b2e6e['attributes'],'include':_0x4b2e6e[_0x615c('0x1d')]?_[_0x615c('0x1e')](_0x4b2e6e['include'],function(_0x455cf8){return{'model':db[_0x455cf8['model']],'as':_0x455cf8['as'],'attributes':_0x455cf8[_0x615c('0x1b')],'include':_0x455cf8[_0x615c('0x1d')]?_[_0x615c('0x1e')](_0x455cf8[_0x615c('0x1d')],function(_0x5074aa){return{'model':db[_0x5074aa[_0x615c('0x1f')]],'as':_0x5074aa['as'],'attributes':_0x5074aa[_0x615c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x615c('0xd')](function(_0x2a1468){logger[_0x615c('0xe')](_0x615c('0x22'),_0x3714eb);logger[_0x615c('0x21')](_0x615c('0x22'),_0x3714eb,JSON[_0x615c('0x11')](_0x2a1468));_0x171844(_0x2a1468);})['catch'](function(_0x146b56){logger[_0x615c('0x12')]('ShowDynamics365Account',_0x146b56[_0x615c('0x14')],_0x3714eb);_0x5c962c(_0x264322[_0x615c('0x12')](0x1f4,_0x146b56[_0x615c('0x14')]));});});};
\ No newline at end of file
index ffdf0c6..944ad10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ba3=['create','put','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller','get','/:id','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','post'];(function(_0x3433dd,_0x5ad46a){var _0x464c5e=function(_0x2f6cea){while(--_0x2f6cea){_0x3433dd['push'](_0x3433dd['shift']());}};_0x464c5e(++_0x5ad46a);}(_0x5ba3,0x140));var _0x35ba=function(_0xc2155f,_0x2140ab){_0xc2155f=_0xc2155f-0x0;var _0x229e1f=_0x5ba3[_0xc2155f];return _0x229e1f;};'use strict';var multer=require(_0x35ba('0x0'));var util=require('util');var path=require(_0x35ba('0x1'));var timeout=require(_0x35ba('0x2'));var express=require('express');var router=express[_0x35ba('0x3')]();var fs_extra=require(_0x35ba('0x4'));var auth=require(_0x35ba('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x35ba('0x6'));var controller=require(_0x35ba('0x7'));router[_0x35ba('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35ba('0x8')](_0x35ba('0x9'),auth[_0x35ba('0xa')](),controller['show']);router[_0x35ba('0x8')]('/:id/fields',auth[_0x35ba('0xa')](),controller[_0x35ba('0xb')]);router[_0x35ba('0x8')](_0x35ba('0xc'),auth['isAuthenticated'](),controller[_0x35ba('0xd')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x35ba('0xe')]);router[_0x35ba('0xf')]('/',auth[_0x35ba('0xa')](),controller[_0x35ba('0x10')]);router[_0x35ba('0x11')](_0x35ba('0x9'),auth[_0x35ba('0xa')](),controller[_0x35ba('0x12')]);router['delete'](_0x35ba('0x9'),auth[_0x35ba('0xa')](),controller[_0x35ba('0x13')]);module[_0x35ba('0x14')]=router;
\ No newline at end of file
+var _0xed11=['../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','destroy','Router','fs-extra','../../components/auth/service'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0xed11,0x107));var _0x1ed1=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xed11[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1ed1('0x0')]();var fs_extra=require(_0x1ed1('0x1'));var auth=require(_0x1ed1('0x2'));var interaction=require(_0x1ed1('0x3'));var config=require('../../config/environment');var controller=require(_0x1ed1('0x4'));router[_0x1ed1('0x5')]('/',auth[_0x1ed1('0x6')](),controller[_0x1ed1('0x7')]);router[_0x1ed1('0x5')](_0x1ed1('0x8'),auth[_0x1ed1('0x6')](),controller[_0x1ed1('0x9')]);router[_0x1ed1('0x5')](_0x1ed1('0xa'),auth[_0x1ed1('0x6')](),controller[_0x1ed1('0xb')]);router['get'](_0x1ed1('0xc'),auth[_0x1ed1('0x6')](),controller['getSubjects']);router[_0x1ed1('0x5')](_0x1ed1('0xd'),auth[_0x1ed1('0x6')](),controller[_0x1ed1('0xe')]);router[_0x1ed1('0xf')]('/',auth[_0x1ed1('0x6')](),controller['create']);router[_0x1ed1('0x10')](_0x1ed1('0x8'),auth[_0x1ed1('0x6')](),controller[_0x1ed1('0x11')]);router['delete'](_0x1ed1('0x8'),auth[_0x1ed1('0x6')](),controller[_0x1ed1('0x12')]);module['exports']=router;
\ No newline at end of file
index 872cd24..fa1d850 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef7e=['phonecall','sequelize','exports','STRING','ENUM','incident'];(function(_0x49fb6e,_0xe19194){var _0x5dfa81=function(_0x23ee3c){while(--_0x23ee3c){_0x49fb6e['push'](_0x49fb6e['shift']());}};_0x5dfa81(++_0xe19194);}(_0xef7e,0x109));var _0xeef7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef7e[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xeef7('0x0'));module[_0xeef7('0x1')]={'name':{'type':Sequelize[_0xeef7('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xeef7('0x3')](_0xeef7('0x4'),_0xeef7('0x5')),'defaultValue':'incident'}};
\ No newline at end of file
+var _0x5348=['STRING','ENUM','incident','sequelize'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x5348,0x1eb));var _0x8534=function(_0x47e153,_0x5ef1b3){_0x47e153=_0x47e153-0x0;var _0x44e260=_0x5348[_0x47e153];return _0x44e260;};'use strict';var Sequelize=require(_0x8534('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8534('0x1')]},'ticketType':{'type':Sequelize[_0x8534('0x2')](_0x8534('0x3'),'phonecall'),'defaultValue':_0x8534('0x3')}};
\ No newline at end of file
index 913dda6..ce7e812 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8d5=['type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','include','Dynamics365Configuration','catch','show','params','keys','rawAttributes','fields','length','includeAll','merge','options','find','create','body','destroy','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','index','fieldName'];(function(_0x1f7996,_0x299a14){var _0x584609=function(_0x14c34a){while(--_0x14c34a){_0x1f7996['push'](_0x1f7996['shift']());}};_0x584609(++_0x299a14);}(_0xa8d5,0x16d));var _0x5a8d=function(_0x2dd107,_0x1b9f0b){_0x2dd107=_0x2dd107-0x0;var _0x3987b5=_0xa8d5[_0x2dd107];return _0x3987b5;};'use strict';var emlformat=require(_0x5a8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5a8d('0x1'));var jsonpatch=require(_0x5a8d('0x2'));var rp=require(_0x5a8d('0x3'));var moment=require(_0x5a8d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5a8d('0x5'));var path=require('path');var sox=require(_0x5a8d('0x6'));var csv=require(_0x5a8d('0x7'));var ejs=require(_0x5a8d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5a8d('0x9'));var squel=require(_0x5a8d('0xa'));var crypto=require(_0x5a8d('0xb'));var jsforce=require(_0x5a8d('0xc'));var deskjs=require(_0x5a8d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5a8d('0xe'));var Papa=require(_0x5a8d('0xf'));var Redis=require(_0x5a8d('0x10'));var authService=require(_0x5a8d('0x11'));var qs=require(_0x5a8d('0x12'));var as=require(_0x5a8d('0x13'));var hardwareService=require(_0x5a8d('0x14'));var logger=require(_0x5a8d('0x15'))(_0x5a8d('0x16'));var utils=require(_0x5a8d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5a8d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20acc9,_0x51eebd){_0x51eebd=_0x51eebd||0xcc;return function(_0x1b3736){if(_0x1b3736){return _0x20acc9[_0x5a8d('0x19')](_0x51eebd);}return _0x20acc9[_0x5a8d('0x1a')](_0x51eebd)[_0x5a8d('0x1b')]();};}function respondWithResult(_0x1d3504,_0x1277fc){_0x1277fc=_0x1277fc||0xc8;return function(_0x2adebe){if(_0x2adebe){return _0x1d3504['status'](_0x1277fc)[_0x5a8d('0x1c')](_0x2adebe);}};}function respondWithFilteredResult(_0x182f91,_0x2b899e){return function(_0x20c3b7){if(_0x20c3b7){var _0x296a81=typeof _0x2b899e[_0x5a8d('0x1d')]===_0x5a8d('0x1e')&&typeof _0x2b899e[_0x5a8d('0x1f')]===_0x5a8d('0x1e');var _0xbec522=_0x20c3b7[_0x5a8d('0x20')];var _0x590b2a=_0x296a81?0x0:_0x2b899e['offset'];var _0x3c55dc=_0x296a81?_0x20c3b7[_0x5a8d('0x20')]:_0x2b899e[_0x5a8d('0x1d')]+_0x2b899e[_0x5a8d('0x1f')];var _0x4a56c2;if(_0x3c55dc>=_0xbec522){_0x3c55dc=_0xbec522;_0x4a56c2=0xc8;}else{_0x4a56c2=0xce;}_0x182f91[_0x5a8d('0x1a')](_0x4a56c2);return _0x182f91[_0x5a8d('0x21')](_0x5a8d('0x22'),_0x590b2a+'-'+_0x3c55dc+'/'+_0xbec522)[_0x5a8d('0x1c')](_0x20c3b7);}return null;};}function patchUpdates(_0x1da774){return function(_0x343c8b){try{jsonpatch[_0x5a8d('0x23')](_0x343c8b,_0x1da774,!![]);}catch(_0x16b7ca){return BPromise[_0x5a8d('0x24')](_0x16b7ca);}return _0x343c8b[_0x5a8d('0x25')]();};}function saveUpdates(_0x13b910,_0x2ab8e8){return function(_0x2b1f0b){if(_0x2b1f0b){return _0x2b1f0b[_0x5a8d('0x26')](_0x13b910)[_0x5a8d('0x27')](function(_0x4240b1){return _0x4240b1;});}return null;};}function removeEntity(_0x5b05c8,_0x4f5a23){return function(_0x2982b7){if(_0x2982b7){return _0x2982b7['destroy']()[_0x5a8d('0x27')](function(){_0x5b05c8[_0x5a8d('0x1a')](0xcc)[_0x5a8d('0x1b')]();});}};}function handleEntityNotFound(_0xb2f8a5,_0x58a4f8){return function(_0x1fbb52){if(!_0x1fbb52){_0xb2f8a5[_0x5a8d('0x19')](0x194);}return _0x1fbb52;};}function handleError(_0x3e2a80,_0x54dbe2){_0x54dbe2=_0x54dbe2||0x1f4;return function(_0x1b58e0){logger[_0x5a8d('0x28')](_0x1b58e0['stack']);if(_0x1b58e0[_0x5a8d('0x29')]){delete _0x1b58e0[_0x5a8d('0x29')];}_0x3e2a80[_0x5a8d('0x1a')](_0x54dbe2)[_0x5a8d('0x2a')](_0x1b58e0);};}exports[_0x5a8d('0x2b')]=function(_0x3ae32c,_0x34706a){var _0x1e4ff4={},_0x27ab85={},_0x55fad4={'count':0x0,'rows':[]};var _0x27965b=_['map'](db['Dynamics365Configuration']['rawAttributes'],function(_0x38663c){return{'name':_0x38663c[_0x5a8d('0x2c')],'type':_0x38663c[_0x5a8d('0x2d')][_0x5a8d('0x2e')]};});_0x27ab85[_0x5a8d('0x2f')]=_['map'](_0x27965b,_0x5a8d('0x29'));_0x27ab85['query']=_['keys'](_0x3ae32c[_0x5a8d('0x30')]);_0x27ab85[_0x5a8d('0x31')]=_[_0x5a8d('0x32')](_0x27ab85['model'],_0x27ab85[_0x5a8d('0x30')]);_0x1e4ff4[_0x5a8d('0x33')]=_[_0x5a8d('0x32')](_0x27ab85[_0x5a8d('0x2f')],qs['fields'](_0x3ae32c[_0x5a8d('0x30')]['fields']));_0x1e4ff4['attributes']=_0x1e4ff4['attributes']['length']?_0x1e4ff4[_0x5a8d('0x33')]:_0x27ab85['model'];if(!_0x3ae32c[_0x5a8d('0x30')][_0x5a8d('0x34')](_0x5a8d('0x35'))){_0x1e4ff4['limit']=qs[_0x5a8d('0x1f')](_0x3ae32c[_0x5a8d('0x30')][_0x5a8d('0x1f')]);_0x1e4ff4[_0x5a8d('0x1d')]=qs[_0x5a8d('0x1d')](_0x3ae32c[_0x5a8d('0x30')][_0x5a8d('0x1d')]);}_0x1e4ff4[_0x5a8d('0x36')]=qs[_0x5a8d('0x37')](_0x3ae32c[_0x5a8d('0x30')][_0x5a8d('0x37')]);_0x1e4ff4[_0x5a8d('0x38')]=qs[_0x5a8d('0x31')](_[_0x5a8d('0x39')](_0x3ae32c['query'],_0x27ab85['filters']),_0x27965b);if(_0x3ae32c[_0x5a8d('0x30')]['filter']){_0x1e4ff4[_0x5a8d('0x38')]=_['merge'](_0x1e4ff4[_0x5a8d('0x38')],{'$or':_[_0x5a8d('0x3a')](_0x27965b,function(_0x199553){if(_0x199553['type']!==_0x5a8d('0x3b')){var _0x4f8af6={};_0x4f8af6[_0x199553[_0x5a8d('0x29')]]={'$like':'%'+_0x3ae32c[_0x5a8d('0x30')][_0x5a8d('0x3c')]+'%'};return _0x4f8af6;}})});}_0x1e4ff4=_['merge']({},_0x1e4ff4,_0x3ae32c['options']);var _0x27d01f={'where':_0x1e4ff4[_0x5a8d('0x38')]};return db['Dynamics365Configuration'][_0x5a8d('0x20')](_0x27d01f)[_0x5a8d('0x27')](function(_0x2c10da){_0x55fad4[_0x5a8d('0x20')]=_0x2c10da;if(_0x3ae32c['query']['includeAll']){_0x1e4ff4[_0x5a8d('0x3d')]=[{'all':!![]}];}return db[_0x5a8d('0x3e')]['findAll'](_0x1e4ff4);})[_0x5a8d('0x27')](function(_0x156c98){_0x55fad4['rows']=_0x156c98;return _0x55fad4;})[_0x5a8d('0x27')](respondWithFilteredResult(_0x34706a,_0x1e4ff4))[_0x5a8d('0x3f')](handleError(_0x34706a,null));};exports[_0x5a8d('0x40')]=function(_0x4bf956,_0x3601f0){var _0x20c11f={'raw':![],'where':{'id':_0x4bf956[_0x5a8d('0x41')]['id']}},_0x2d811c={};_0x2d811c[_0x5a8d('0x2f')]=_[_0x5a8d('0x42')](db[_0x5a8d('0x3e')][_0x5a8d('0x43')]);_0x2d811c[_0x5a8d('0x30')]=_[_0x5a8d('0x42')](_0x4bf956[_0x5a8d('0x30')]);_0x2d811c[_0x5a8d('0x31')]=_[_0x5a8d('0x32')](_0x2d811c['model'],_0x2d811c['query']);_0x20c11f[_0x5a8d('0x33')]=_[_0x5a8d('0x32')](_0x2d811c[_0x5a8d('0x2f')],qs['fields'](_0x4bf956['query'][_0x5a8d('0x44')]));_0x20c11f[_0x5a8d('0x33')]=_0x20c11f['attributes'][_0x5a8d('0x45')]?_0x20c11f[_0x5a8d('0x33')]:_0x2d811c[_0x5a8d('0x2f')];if(_0x4bf956[_0x5a8d('0x30')][_0x5a8d('0x46')]){_0x20c11f['include']=[{'all':!![]}];}_0x20c11f=_[_0x5a8d('0x47')]({},_0x20c11f,_0x4bf956[_0x5a8d('0x48')]);return db['Dynamics365Configuration'][_0x5a8d('0x49')](_0x20c11f)[_0x5a8d('0x27')](handleEntityNotFound(_0x3601f0,null))[_0x5a8d('0x27')](respondWithResult(_0x3601f0,null))[_0x5a8d('0x3f')](handleError(_0x3601f0,null));};exports[_0x5a8d('0x4a')]=function(_0x1391ed,_0x310252){return db[_0x5a8d('0x3e')][_0x5a8d('0x4a')](_0x1391ed[_0x5a8d('0x4b')],{})['then'](respondWithResult(_0x310252,0xc9))[_0x5a8d('0x3f')](handleError(_0x310252,null));};exports[_0x5a8d('0x26')]=function(_0xe19ade,_0x441ff8){if(_0xe19ade[_0x5a8d('0x4b')]['id']){delete _0xe19ade[_0x5a8d('0x4b')]['id'];}return db[_0x5a8d('0x3e')][_0x5a8d('0x49')]({'where':{'id':_0xe19ade['params']['id']}})[_0x5a8d('0x27')](handleEntityNotFound(_0x441ff8,null))['then'](saveUpdates(_0xe19ade[_0x5a8d('0x4b')],null))[_0x5a8d('0x27')](respondWithResult(_0x441ff8,null))[_0x5a8d('0x3f')](handleError(_0x441ff8,null));};exports[_0x5a8d('0x4c')]=function(_0x4a9c23,_0x37615f){return db[_0x5a8d('0x3e')][_0x5a8d('0x49')]({'where':{'id':_0x4a9c23['params']['id']}})['then'](handleEntityNotFound(_0x37615f,null))[_0x5a8d('0x27')](removeEntity(_0x37615f,null))[_0x5a8d('0x3f')](handleError(_0x37615f,null));};exports[_0x5a8d('0x4d')]=function(_0x2a04ce,_0x2ab95b,_0x2efd94){var _0x566e4b={};var _0x2a61c2={};var _0x1d5964;var _0x5456a1;return db['Dynamics365Configuration'][_0x5a8d('0x4e')]({'where':{'id':_0x2a04ce['params']['id']}})['then'](handleEntityNotFound(_0x2ab95b,null))[_0x5a8d('0x27')](function(_0x159a17){if(_0x159a17){_0x1d5964=_0x159a17;_0x2a61c2[_0x5a8d('0x2f')]=_[_0x5a8d('0x42')](db[_0x5a8d('0x4f')][_0x5a8d('0x43')]);_0x2a61c2[_0x5a8d('0x30')]=_[_0x5a8d('0x42')](_0x2a04ce['query']);_0x2a61c2[_0x5a8d('0x31')]=_[_0x5a8d('0x32')](_0x2a61c2[_0x5a8d('0x2f')],_0x2a61c2[_0x5a8d('0x30')]);_0x566e4b[_0x5a8d('0x33')]=_[_0x5a8d('0x32')](_0x2a61c2[_0x5a8d('0x2f')],qs['fields'](_0x2a04ce[_0x5a8d('0x30')][_0x5a8d('0x44')]));_0x566e4b[_0x5a8d('0x33')]=_0x566e4b['attributes']['length']?_0x566e4b[_0x5a8d('0x33')]:_0x2a61c2[_0x5a8d('0x2f')];_0x566e4b[_0x5a8d('0x36')]=qs[_0x5a8d('0x37')](_0x2a04ce[_0x5a8d('0x30')][_0x5a8d('0x37')]);_0x566e4b[_0x5a8d('0x38')]=qs['filters'](_[_0x5a8d('0x39')](_0x2a04ce[_0x5a8d('0x30')],_0x2a61c2[_0x5a8d('0x31')]));if(_0x2a04ce[_0x5a8d('0x30')][_0x5a8d('0x3c')]){_0x566e4b['where']=_[_0x5a8d('0x47')](_0x566e4b[_0x5a8d('0x38')],{'$or':_['map'](_0x566e4b[_0x5a8d('0x33')],function(_0x5efa04){var _0x319a0b={};_0x319a0b[_0x5efa04]={'$like':'%'+_0x2a04ce[_0x5a8d('0x30')][_0x5a8d('0x3c')]+'%'};return _0x319a0b;})});}_0x566e4b=_[_0x5a8d('0x47')]({},_0x566e4b,_0x2a04ce[_0x5a8d('0x48')]);return _0x1d5964[_0x5a8d('0x4d')](_0x566e4b);}})['then'](function(_0x2af732){if(_0x2af732){_0x5456a1=_0x2af732['length'];if(!_0x2a04ce['query']['hasOwnProperty']('nolimit')){_0x566e4b[_0x5a8d('0x1f')]=qs[_0x5a8d('0x1f')](_0x2a04ce[_0x5a8d('0x30')][_0x5a8d('0x1f')]);_0x566e4b[_0x5a8d('0x1d')]=qs[_0x5a8d('0x1d')](_0x2a04ce[_0x5a8d('0x30')]['offset']);}return _0x1d5964['getFields'](_0x566e4b);}})[_0x5a8d('0x27')](function(_0x21ace2){if(_0x21ace2){return _0x21ace2?{'count':_0x5456a1,'rows':_0x21ace2}:null;}})[_0x5a8d('0x27')](respondWithResult(_0x2ab95b,null))['catch'](handleError(_0x2ab95b,null));};exports[_0x5a8d('0x50')]=function(_0x8a59d4,_0x2b53fa,_0x1d9673){var _0x37207e={};var _0x6408a8={};var _0x4660db;var _0x2c5708;return db[_0x5a8d('0x3e')][_0x5a8d('0x4e')]({'where':{'id':_0x8a59d4[_0x5a8d('0x41')]['id']}})[_0x5a8d('0x27')](handleEntityNotFound(_0x2b53fa,null))[_0x5a8d('0x27')](function(_0x34d256){if(_0x34d256){_0x4660db=_0x34d256;_0x6408a8['model']=_[_0x5a8d('0x42')](db[_0x5a8d('0x4f')][_0x5a8d('0x43')]);_0x6408a8[_0x5a8d('0x30')]=_[_0x5a8d('0x42')](_0x8a59d4[_0x5a8d('0x30')]);_0x6408a8['filters']=_[_0x5a8d('0x32')](_0x6408a8['model'],_0x6408a8['query']);_0x37207e[_0x5a8d('0x33')]=_[_0x5a8d('0x32')](_0x6408a8[_0x5a8d('0x2f')],qs['fields'](_0x8a59d4['query']['fields']));_0x37207e['attributes']=_0x37207e[_0x5a8d('0x33')][_0x5a8d('0x45')]?_0x37207e[_0x5a8d('0x33')]:_0x6408a8['model'];_0x37207e[_0x5a8d('0x36')]=qs[_0x5a8d('0x37')](_0x8a59d4['query'][_0x5a8d('0x37')]);_0x37207e[_0x5a8d('0x38')]=qs[_0x5a8d('0x31')](_[_0x5a8d('0x39')](_0x8a59d4[_0x5a8d('0x30')],_0x6408a8[_0x5a8d('0x31')]));if(_0x8a59d4['query'][_0x5a8d('0x3c')]){_0x37207e['where']=_[_0x5a8d('0x47')](_0x37207e[_0x5a8d('0x38')],{'$or':_['map'](_0x37207e[_0x5a8d('0x33')],function(_0x1277da){var _0x4e99fe={};_0x4e99fe[_0x1277da]={'$like':'%'+_0x8a59d4[_0x5a8d('0x30')][_0x5a8d('0x3c')]+'%'};return _0x4e99fe;})});}_0x37207e=_[_0x5a8d('0x47')]({},_0x37207e,_0x8a59d4[_0x5a8d('0x48')]);return _0x4660db['getSubjects'](_0x37207e);}})[_0x5a8d('0x27')](function(_0x3fd130){if(_0x3fd130){_0x2c5708=_0x3fd130['length'];if(!_0x8a59d4[_0x5a8d('0x30')]['hasOwnProperty'](_0x5a8d('0x35'))){_0x37207e['limit']=qs[_0x5a8d('0x1f')](_0x8a59d4[_0x5a8d('0x30')][_0x5a8d('0x1f')]);_0x37207e[_0x5a8d('0x1d')]=qs['offset'](_0x8a59d4[_0x5a8d('0x30')][_0x5a8d('0x1d')]);}return _0x4660db[_0x5a8d('0x50')](_0x37207e);}})[_0x5a8d('0x27')](function(_0x19f274){if(_0x19f274){return _0x19f274?{'count':_0x2c5708,'rows':_0x19f274}:null;}})[_0x5a8d('0x27')](respondWithResult(_0x2b53fa,null))[_0x5a8d('0x3f')](handleError(_0x2b53fa,null));};exports[_0x5a8d('0x51')]=function(_0x507777,_0xc6a272,_0xd5352b){var _0x5d1f34={};var _0x5c1e83={};var _0x4628a7;var _0x60d622;return db[_0x5a8d('0x3e')][_0x5a8d('0x4e')]({'where':{'id':_0x507777[_0x5a8d('0x41')]['id']}})[_0x5a8d('0x27')](handleEntityNotFound(_0xc6a272,null))[_0x5a8d('0x27')](function(_0xef5278){if(_0xef5278){_0x4628a7=_0xef5278;_0x5c1e83[_0x5a8d('0x2f')]=_['keys'](db[_0x5a8d('0x4f')][_0x5a8d('0x43')]);_0x5c1e83[_0x5a8d('0x30')]=_[_0x5a8d('0x42')](_0x507777[_0x5a8d('0x30')]);_0x5c1e83[_0x5a8d('0x31')]=_[_0x5a8d('0x32')](_0x5c1e83[_0x5a8d('0x2f')],_0x5c1e83[_0x5a8d('0x30')]);_0x5d1f34[_0x5a8d('0x33')]=_['intersection'](_0x5c1e83[_0x5a8d('0x2f')],qs[_0x5a8d('0x44')](_0x507777[_0x5a8d('0x30')][_0x5a8d('0x44')]));_0x5d1f34[_0x5a8d('0x33')]=_0x5d1f34[_0x5a8d('0x33')]['length']?_0x5d1f34[_0x5a8d('0x33')]:_0x5c1e83[_0x5a8d('0x2f')];_0x5d1f34[_0x5a8d('0x36')]=qs[_0x5a8d('0x37')](_0x507777[_0x5a8d('0x30')][_0x5a8d('0x37')]);_0x5d1f34[_0x5a8d('0x38')]=qs[_0x5a8d('0x31')](_[_0x5a8d('0x39')](_0x507777[_0x5a8d('0x30')],_0x5c1e83[_0x5a8d('0x31')]));if(_0x507777[_0x5a8d('0x30')][_0x5a8d('0x3c')]){_0x5d1f34['where']=_[_0x5a8d('0x47')](_0x5d1f34[_0x5a8d('0x38')],{'$or':_[_0x5a8d('0x3a')](_0x5d1f34[_0x5a8d('0x33')],function(_0x2ecbf8){var _0x4705f9={};_0x4705f9[_0x2ecbf8]={'$like':'%'+_0x507777[_0x5a8d('0x30')]['filter']+'%'};return _0x4705f9;})});}_0x5d1f34=_['merge']({},_0x5d1f34,_0x507777[_0x5a8d('0x48')]);return _0x4628a7[_0x5a8d('0x51')](_0x5d1f34);}})[_0x5a8d('0x27')](function(_0x39338e){if(_0x39338e){_0x60d622=_0x39338e[_0x5a8d('0x45')];if(!_0x507777[_0x5a8d('0x30')][_0x5a8d('0x34')]('nolimit')){_0x5d1f34['limit']=qs['limit'](_0x507777['query'][_0x5a8d('0x1f')]);_0x5d1f34[_0x5a8d('0x1d')]=qs[_0x5a8d('0x1d')](_0x507777['query'][_0x5a8d('0x1d')]);}return _0x4628a7[_0x5a8d('0x51')](_0x5d1f34);}})[_0x5a8d('0x27')](function(_0x1cb4c4){if(_0x1cb4c4){return _0x1cb4c4?{'count':_0x60d622,'rows':_0x1cb4c4}:null;}})[_0x5a8d('0x27')](respondWithResult(_0xc6a272,null))[_0x5a8d('0x3f')](handleError(_0xc6a272,null));};
\ No newline at end of file
+var _0x86bd=['VIRTUAL','options','Dynamics365Configuration','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','getFields','findOne','Dynamics365Field','rawAttributes','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type'];(function(_0x4263f5,_0x2a1ebd){var _0x58a6dc=function(_0x291b74){while(--_0x291b74){_0x4263f5['push'](_0x4263f5['shift']());}};_0x58a6dc(++_0x2a1ebd);}(_0x86bd,0x110));var _0xd86b=function(_0x10513a,_0xceafff){_0x10513a=_0x10513a-0x0;var _0x2289b8=_0x86bd[_0x10513a];return _0x2289b8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd86b('0x0'));var zipdir=require(_0xd86b('0x1'));var jsonpatch=require(_0xd86b('0x2'));var rp=require(_0xd86b('0x3'));var moment=require(_0xd86b('0x4'));var BPromise=require(_0xd86b('0x5'));var Mustache=require(_0xd86b('0x6'));var util=require('util');var path=require(_0xd86b('0x7'));var sox=require(_0xd86b('0x8'));var csv=require(_0xd86b('0x9'));var ejs=require(_0xd86b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd86b('0xb'));var squel=require(_0xd86b('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd86b('0xd'));var toCsv=require(_0xd86b('0x9'));var querystring=require(_0xd86b('0xe'));var Papa=require(_0xd86b('0xf'));var Redis=require('ioredis');var authService=require(_0xd86b('0x10'));var qs=require(_0xd86b('0x11'));var as=require(_0xd86b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd86b('0x13'));var utils=require(_0xd86b('0x14'));var config=require(_0xd86b('0x15'));var licenseUtil=require(_0xd86b('0x16'));var db=require(_0xd86b('0x17'))['db'];function respondWithStatusCode(_0x550bc6,_0x15c2af){_0x15c2af=_0x15c2af||0xcc;return function(_0x521929){if(_0x521929){return _0x550bc6[_0xd86b('0x18')](_0x15c2af);}return _0x550bc6[_0xd86b('0x19')](_0x15c2af)[_0xd86b('0x1a')]();};}function respondWithResult(_0x1ab043,_0x164796){_0x164796=_0x164796||0xc8;return function(_0x4c1feb){if(_0x4c1feb){return _0x1ab043[_0xd86b('0x19')](_0x164796)['json'](_0x4c1feb);}};}function respondWithFilteredResult(_0x2464e3,_0x3e59f3){return function(_0x217ed1){if(_0x217ed1){var _0x467ecb=typeof _0x3e59f3[_0xd86b('0x1b')]===_0xd86b('0x1c')&&typeof _0x3e59f3[_0xd86b('0x1d')]==='undefined';var _0x545734=_0x217ed1[_0xd86b('0x1e')];var _0x339eb8=_0x467ecb?0x0:_0x3e59f3[_0xd86b('0x1b')];var _0x3769c4=_0x467ecb?_0x217ed1[_0xd86b('0x1e')]:_0x3e59f3[_0xd86b('0x1b')]+_0x3e59f3['limit'];var _0x443d99;if(_0x3769c4>=_0x545734){_0x3769c4=_0x545734;_0x443d99=0xc8;}else{_0x443d99=0xce;}_0x2464e3[_0xd86b('0x19')](_0x443d99);return _0x2464e3[_0xd86b('0x1f')](_0xd86b('0x20'),_0x339eb8+'-'+_0x3769c4+'/'+_0x545734)[_0xd86b('0x21')](_0x217ed1);}return null;};}function patchUpdates(_0xde7b06){return function(_0x4c62e9){try{jsonpatch[_0xd86b('0x22')](_0x4c62e9,_0xde7b06,!![]);}catch(_0x532ba3){return BPromise[_0xd86b('0x23')](_0x532ba3);}return _0x4c62e9[_0xd86b('0x24')]();};}function saveUpdates(_0x24c987,_0x43645a){return function(_0x5ef7ad){if(_0x5ef7ad){return _0x5ef7ad['update'](_0x24c987)[_0xd86b('0x25')](function(_0x16a60c){return _0x16a60c;});}return null;};}function removeEntity(_0x15b6fc,_0x481bc3){return function(_0x55cd38){if(_0x55cd38){return _0x55cd38[_0xd86b('0x26')]()[_0xd86b('0x25')](function(){_0x15b6fc[_0xd86b('0x19')](0xcc)[_0xd86b('0x1a')]();});}};}function handleEntityNotFound(_0x1236b8,_0x5d20ff){return function(_0x1f1cef){if(!_0x1f1cef){_0x1236b8[_0xd86b('0x18')](0x194);}return _0x1f1cef;};}function handleError(_0x278490,_0xffe4b8){_0xffe4b8=_0xffe4b8||0x1f4;return function(_0x28a2a0){logger[_0xd86b('0x27')](_0x28a2a0[_0xd86b('0x28')]);if(_0x28a2a0[_0xd86b('0x29')]){delete _0x28a2a0[_0xd86b('0x29')];}_0x278490[_0xd86b('0x19')](_0xffe4b8)[_0xd86b('0x2a')](_0x28a2a0);};}exports[_0xd86b('0x2b')]=function(_0x12dc48,_0x54d117){var _0x42223f={},_0x574be7={},_0x629052={'count':0x0,'rows':[]};var _0xa935e7=_[_0xd86b('0x2c')](db['Dynamics365Configuration']['rawAttributes'],function(_0x3033db){return{'name':_0x3033db[_0xd86b('0x2d')],'type':_0x3033db['type'][_0xd86b('0x2e')]};});_0x574be7[_0xd86b('0x2f')]=_[_0xd86b('0x2c')](_0xa935e7,_0xd86b('0x29'));_0x574be7[_0xd86b('0x30')]=_[_0xd86b('0x31')](_0x12dc48[_0xd86b('0x30')]);_0x574be7[_0xd86b('0x32')]=_[_0xd86b('0x33')](_0x574be7['model'],_0x574be7[_0xd86b('0x30')]);_0x42223f[_0xd86b('0x34')]=_[_0xd86b('0x33')](_0x574be7['model'],qs[_0xd86b('0x35')](_0x12dc48['query'][_0xd86b('0x35')]));_0x42223f['attributes']=_0x42223f[_0xd86b('0x34')][_0xd86b('0x36')]?_0x42223f['attributes']:_0x574be7[_0xd86b('0x2f')];if(!_0x12dc48[_0xd86b('0x30')][_0xd86b('0x37')](_0xd86b('0x38'))){_0x42223f['limit']=qs[_0xd86b('0x1d')](_0x12dc48[_0xd86b('0x30')][_0xd86b('0x1d')]);_0x42223f[_0xd86b('0x1b')]=qs[_0xd86b('0x1b')](_0x12dc48[_0xd86b('0x30')][_0xd86b('0x1b')]);}_0x42223f[_0xd86b('0x39')]=qs['sort'](_0x12dc48['query'][_0xd86b('0x3a')]);_0x42223f[_0xd86b('0x3b')]=qs[_0xd86b('0x32')](_[_0xd86b('0x3c')](_0x12dc48['query'],_0x574be7[_0xd86b('0x32')]),_0xa935e7);if(_0x12dc48['query'][_0xd86b('0x3d')]){_0x42223f[_0xd86b('0x3b')]=_[_0xd86b('0x3e')](_0x42223f[_0xd86b('0x3b')],{'$or':_['map'](_0xa935e7,function(_0x141738){if(_0x141738[_0xd86b('0x3f')]!==_0xd86b('0x40')){var _0x5e9805={};_0x5e9805[_0x141738[_0xd86b('0x29')]]={'$like':'%'+_0x12dc48['query'][_0xd86b('0x3d')]+'%'};return _0x5e9805;}})});}_0x42223f=_[_0xd86b('0x3e')]({},_0x42223f,_0x12dc48[_0xd86b('0x41')]);var _0x13031d={'where':_0x42223f['where']};return db[_0xd86b('0x42')]['count'](_0x13031d)[_0xd86b('0x25')](function(_0x4da1d0){_0x629052[_0xd86b('0x1e')]=_0x4da1d0;if(_0x12dc48['query'][_0xd86b('0x43')]){_0x42223f['include']=[{'all':!![]}];}return db[_0xd86b('0x42')][_0xd86b('0x44')](_0x42223f);})[_0xd86b('0x25')](function(_0xe82eca){_0x629052[_0xd86b('0x45')]=_0xe82eca;return _0x629052;})[_0xd86b('0x25')](respondWithFilteredResult(_0x54d117,_0x42223f))[_0xd86b('0x46')](handleError(_0x54d117,null));};exports[_0xd86b('0x47')]=function(_0x43acf3,_0x5b63c7){var _0x27312d={'raw':![],'where':{'id':_0x43acf3[_0xd86b('0x48')]['id']}},_0x19c7a3={};_0x19c7a3[_0xd86b('0x2f')]=_[_0xd86b('0x31')](db[_0xd86b('0x42')]['rawAttributes']);_0x19c7a3[_0xd86b('0x30')]=_[_0xd86b('0x31')](_0x43acf3[_0xd86b('0x30')]);_0x19c7a3[_0xd86b('0x32')]=_[_0xd86b('0x33')](_0x19c7a3['model'],_0x19c7a3[_0xd86b('0x30')]);_0x27312d[_0xd86b('0x34')]=_[_0xd86b('0x33')](_0x19c7a3[_0xd86b('0x2f')],qs[_0xd86b('0x35')](_0x43acf3['query'][_0xd86b('0x35')]));_0x27312d[_0xd86b('0x34')]=_0x27312d[_0xd86b('0x34')][_0xd86b('0x36')]?_0x27312d['attributes']:_0x19c7a3[_0xd86b('0x2f')];if(_0x43acf3[_0xd86b('0x30')][_0xd86b('0x43')]){_0x27312d[_0xd86b('0x49')]=[{'all':!![]}];}_0x27312d=_[_0xd86b('0x3e')]({},_0x27312d,_0x43acf3[_0xd86b('0x41')]);return db[_0xd86b('0x42')][_0xd86b('0x4a')](_0x27312d)[_0xd86b('0x25')](handleEntityNotFound(_0x5b63c7,null))[_0xd86b('0x25')](respondWithResult(_0x5b63c7,null))[_0xd86b('0x46')](handleError(_0x5b63c7,null));};exports[_0xd86b('0x4b')]=function(_0x21acfc,_0x4fbe9a){return db[_0xd86b('0x42')][_0xd86b('0x4b')](_0x21acfc[_0xd86b('0x4c')],{})[_0xd86b('0x25')](respondWithResult(_0x4fbe9a,0xc9))[_0xd86b('0x46')](handleError(_0x4fbe9a,null));};exports[_0xd86b('0x4d')]=function(_0x1c00fe,_0x2135f2){if(_0x1c00fe[_0xd86b('0x4c')]['id']){delete _0x1c00fe[_0xd86b('0x4c')]['id'];}return db[_0xd86b('0x42')][_0xd86b('0x4a')]({'where':{'id':_0x1c00fe[_0xd86b('0x48')]['id']}})[_0xd86b('0x25')](handleEntityNotFound(_0x2135f2,null))[_0xd86b('0x25')](saveUpdates(_0x1c00fe['body'],null))[_0xd86b('0x25')](respondWithResult(_0x2135f2,null))[_0xd86b('0x46')](handleError(_0x2135f2,null));};exports[_0xd86b('0x26')]=function(_0x4b454d,_0x1ef04c){return db['Dynamics365Configuration'][_0xd86b('0x4a')]({'where':{'id':_0x4b454d[_0xd86b('0x48')]['id']}})[_0xd86b('0x25')](handleEntityNotFound(_0x1ef04c,null))['then'](removeEntity(_0x1ef04c,null))[_0xd86b('0x46')](handleError(_0x1ef04c,null));};exports[_0xd86b('0x4e')]=function(_0x4cba57,_0x28d14c,_0x76c35b){var _0x2f1cf3={};var _0x196490={};var _0x17c806;var _0x5113ee;return db['Dynamics365Configuration'][_0xd86b('0x4f')]({'where':{'id':_0x4cba57[_0xd86b('0x48')]['id']}})[_0xd86b('0x25')](handleEntityNotFound(_0x28d14c,null))[_0xd86b('0x25')](function(_0x3bb09f){if(_0x3bb09f){_0x17c806=_0x3bb09f;_0x196490['model']=_['keys'](db[_0xd86b('0x50')][_0xd86b('0x51')]);_0x196490[_0xd86b('0x30')]=_[_0xd86b('0x31')](_0x4cba57[_0xd86b('0x30')]);_0x196490[_0xd86b('0x32')]=_[_0xd86b('0x33')](_0x196490['model'],_0x196490['query']);_0x2f1cf3['attributes']=_[_0xd86b('0x33')](_0x196490[_0xd86b('0x2f')],qs[_0xd86b('0x35')](_0x4cba57['query'][_0xd86b('0x35')]));_0x2f1cf3['attributes']=_0x2f1cf3[_0xd86b('0x34')][_0xd86b('0x36')]?_0x2f1cf3[_0xd86b('0x34')]:_0x196490[_0xd86b('0x2f')];_0x2f1cf3[_0xd86b('0x39')]=qs['sort'](_0x4cba57[_0xd86b('0x30')][_0xd86b('0x3a')]);_0x2f1cf3[_0xd86b('0x3b')]=qs[_0xd86b('0x32')](_[_0xd86b('0x3c')](_0x4cba57[_0xd86b('0x30')],_0x196490[_0xd86b('0x32')]));if(_0x4cba57['query'][_0xd86b('0x3d')]){_0x2f1cf3[_0xd86b('0x3b')]=_['merge'](_0x2f1cf3[_0xd86b('0x3b')],{'$or':_[_0xd86b('0x2c')](_0x2f1cf3[_0xd86b('0x34')],function(_0x5509d0){var _0x5a287c={};_0x5a287c[_0x5509d0]={'$like':'%'+_0x4cba57['query'][_0xd86b('0x3d')]+'%'};return _0x5a287c;})});}_0x2f1cf3=_[_0xd86b('0x3e')]({},_0x2f1cf3,_0x4cba57[_0xd86b('0x41')]);return _0x17c806[_0xd86b('0x4e')](_0x2f1cf3);}})[_0xd86b('0x25')](function(_0xa94e0){if(_0xa94e0){_0x5113ee=_0xa94e0[_0xd86b('0x36')];if(!_0x4cba57[_0xd86b('0x30')][_0xd86b('0x37')](_0xd86b('0x38'))){_0x2f1cf3[_0xd86b('0x1d')]=qs[_0xd86b('0x1d')](_0x4cba57['query']['limit']);_0x2f1cf3[_0xd86b('0x1b')]=qs[_0xd86b('0x1b')](_0x4cba57[_0xd86b('0x30')][_0xd86b('0x1b')]);}return _0x17c806['getFields'](_0x2f1cf3);}})['then'](function(_0x53906b){if(_0x53906b){return _0x53906b?{'count':_0x5113ee,'rows':_0x53906b}:null;}})['then'](respondWithResult(_0x28d14c,null))[_0xd86b('0x46')](handleError(_0x28d14c,null));};exports[_0xd86b('0x52')]=function(_0x29ade8,_0x4fc79f,_0x5e017d){var _0x43041d={};var _0x48ac1b={};var _0x5aebd4;var _0x32938c;return db[_0xd86b('0x42')][_0xd86b('0x4f')]({'where':{'id':_0x29ade8[_0xd86b('0x48')]['id']}})[_0xd86b('0x25')](handleEntityNotFound(_0x4fc79f,null))['then'](function(_0x155310){if(_0x155310){_0x5aebd4=_0x155310;_0x48ac1b[_0xd86b('0x2f')]=_[_0xd86b('0x31')](db['Dynamics365Field']['rawAttributes']);_0x48ac1b[_0xd86b('0x30')]=_[_0xd86b('0x31')](_0x29ade8[_0xd86b('0x30')]);_0x48ac1b[_0xd86b('0x32')]=_['intersection'](_0x48ac1b[_0xd86b('0x2f')],_0x48ac1b[_0xd86b('0x30')]);_0x43041d[_0xd86b('0x34')]=_[_0xd86b('0x33')](_0x48ac1b[_0xd86b('0x2f')],qs[_0xd86b('0x35')](_0x29ade8[_0xd86b('0x30')]['fields']));_0x43041d[_0xd86b('0x34')]=_0x43041d[_0xd86b('0x34')][_0xd86b('0x36')]?_0x43041d[_0xd86b('0x34')]:_0x48ac1b[_0xd86b('0x2f')];_0x43041d[_0xd86b('0x39')]=qs['sort'](_0x29ade8[_0xd86b('0x30')][_0xd86b('0x3a')]);_0x43041d[_0xd86b('0x3b')]=qs[_0xd86b('0x32')](_[_0xd86b('0x3c')](_0x29ade8['query'],_0x48ac1b[_0xd86b('0x32')]));if(_0x29ade8[_0xd86b('0x30')][_0xd86b('0x3d')]){_0x43041d[_0xd86b('0x3b')]=_['merge'](_0x43041d['where'],{'$or':_[_0xd86b('0x2c')](_0x43041d[_0xd86b('0x34')],function(_0x4dedfc){var _0x3ba156={};_0x3ba156[_0x4dedfc]={'$like':'%'+_0x29ade8['query'][_0xd86b('0x3d')]+'%'};return _0x3ba156;})});}_0x43041d=_['merge']({},_0x43041d,_0x29ade8[_0xd86b('0x41')]);return _0x5aebd4['getSubjects'](_0x43041d);}})[_0xd86b('0x25')](function(_0x135ee0){if(_0x135ee0){_0x32938c=_0x135ee0[_0xd86b('0x36')];if(!_0x29ade8[_0xd86b('0x30')]['hasOwnProperty'](_0xd86b('0x38'))){_0x43041d[_0xd86b('0x1d')]=qs[_0xd86b('0x1d')](_0x29ade8[_0xd86b('0x30')][_0xd86b('0x1d')]);_0x43041d[_0xd86b('0x1b')]=qs[_0xd86b('0x1b')](_0x29ade8[_0xd86b('0x30')][_0xd86b('0x1b')]);}return _0x5aebd4[_0xd86b('0x52')](_0x43041d);}})['then'](function(_0x5780dd){if(_0x5780dd){return _0x5780dd?{'count':_0x32938c,'rows':_0x5780dd}:null;}})[_0xd86b('0x25')](respondWithResult(_0x4fc79f,null))[_0xd86b('0x46')](handleError(_0x4fc79f,null));};exports[_0xd86b('0x53')]=function(_0x4af2ed,_0x243871,_0x210a66){var _0x1742d0={};var _0x444fe6={};var _0x2ea58c;var _0x3257c9;return db[_0xd86b('0x42')][_0xd86b('0x4f')]({'where':{'id':_0x4af2ed[_0xd86b('0x48')]['id']}})[_0xd86b('0x25')](handleEntityNotFound(_0x243871,null))[_0xd86b('0x25')](function(_0x31db9e){if(_0x31db9e){_0x2ea58c=_0x31db9e;_0x444fe6['model']=_[_0xd86b('0x31')](db['Dynamics365Field'][_0xd86b('0x51')]);_0x444fe6[_0xd86b('0x30')]=_[_0xd86b('0x31')](_0x4af2ed[_0xd86b('0x30')]);_0x444fe6['filters']=_[_0xd86b('0x33')](_0x444fe6[_0xd86b('0x2f')],_0x444fe6[_0xd86b('0x30')]);_0x1742d0[_0xd86b('0x34')]=_[_0xd86b('0x33')](_0x444fe6['model'],qs['fields'](_0x4af2ed['query'][_0xd86b('0x35')]));_0x1742d0[_0xd86b('0x34')]=_0x1742d0[_0xd86b('0x34')][_0xd86b('0x36')]?_0x1742d0[_0xd86b('0x34')]:_0x444fe6[_0xd86b('0x2f')];_0x1742d0['order']=qs[_0xd86b('0x3a')](_0x4af2ed[_0xd86b('0x30')][_0xd86b('0x3a')]);_0x1742d0[_0xd86b('0x3b')]=qs[_0xd86b('0x32')](_[_0xd86b('0x3c')](_0x4af2ed[_0xd86b('0x30')],_0x444fe6[_0xd86b('0x32')]));if(_0x4af2ed[_0xd86b('0x30')][_0xd86b('0x3d')]){_0x1742d0['where']=_[_0xd86b('0x3e')](_0x1742d0[_0xd86b('0x3b')],{'$or':_['map'](_0x1742d0[_0xd86b('0x34')],function(_0x514986){var _0x1a8af7={};_0x1a8af7[_0x514986]={'$like':'%'+_0x4af2ed[_0xd86b('0x30')][_0xd86b('0x3d')]+'%'};return _0x1a8af7;})});}_0x1742d0=_[_0xd86b('0x3e')]({},_0x1742d0,_0x4af2ed['options']);return _0x2ea58c[_0xd86b('0x53')](_0x1742d0);}})[_0xd86b('0x25')](function(_0x369504){if(_0x369504){_0x3257c9=_0x369504[_0xd86b('0x36')];if(!_0x4af2ed['query'][_0xd86b('0x37')]('nolimit')){_0x1742d0['limit']=qs[_0xd86b('0x1d')](_0x4af2ed['query'][_0xd86b('0x1d')]);_0x1742d0[_0xd86b('0x1b')]=qs[_0xd86b('0x1b')](_0x4af2ed['query']['offset']);}return _0x2ea58c['getDescriptions'](_0x1742d0);}})[_0xd86b('0x25')](function(_0xd4d344){if(_0xd4d344){return _0xd4d344?{'count':_0x3257c9,'rows':_0xd4d344}:null;}})[_0xd86b('0x25')](respondWithResult(_0x243871,null))[_0xd86b('0x46')](handleError(_0x243871,null));};
\ No newline at end of file
index f270503..5c5c693 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e74=['exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','../../config/logger','api','moment','path','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x118733,_0x2bd820){var _0x4777af=function(_0x52886a){while(--_0x52886a){_0x118733['push'](_0x118733['shift']());}};_0x4777af(++_0x2bd820);}(_0x3e74,0x175));var _0x43e7=function(_0x1d54ab,_0x3a36c1){_0x1d54ab=_0x1d54ab-0x0;var _0x54a453=_0x3e74[_0x1d54ab];return _0x54a453;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0xb97d6c,_0x84e16d){var _0x2bd7b3=function(_0x20051c){while(--_0x20051c){_0xb97d6c['push'](_0xb97d6c['shift']());}};_0x2bd7b3(++_0x84e16d);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c636465..16d99b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89f6=['Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x5bcd6e,_0x59baf5){var _0xad7079=function(_0x54e055){while(--_0x54e055){_0x5bcd6e['push'](_0x5bcd6e['shift']());}};_0xad7079(++_0x59baf5);}(_0x89f6,0x190));var _0x689f=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x89f6[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x689f('0x0'));var util=require(_0x689f('0x1'));var moment=require(_0x689f('0x2'));var BPromise=require(_0x689f('0x3'));var rs=require(_0x689f('0x4'));var fs=require('fs');var Redis=require(_0x689f('0x5'));var db=require(_0x689f('0x6'))['db'];var utils=require(_0x689f('0x7'));var logger=require(_0x689f('0x8'))(_0x689f('0x9'));var config=require(_0x689f('0xa'));var jayson=require(_0x689f('0xb'));var client=jayson['client'][_0x689f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3b0535,_0x46e299,_0x1a26ce){return new BPromise(function(_0xa9b9a,_0xa9b0d9){return client[_0x689f('0xd')](_0x3b0535,_0x1a26ce)[_0x689f('0xe')](function(_0x3a6a38){logger[_0x689f('0xf')](_0x689f('0x10'),_0x46e299,_0x689f('0x11'));logger[_0x689f('0x12')](_0x689f('0x13'),_0x46e299,'request\x20sent',JSON[_0x689f('0x14')](_0x3a6a38));if(_0x3a6a38[_0x689f('0x15')]){if(_0x3a6a38[_0x689f('0x15')][_0x689f('0x16')]===0x1f4){logger[_0x689f('0x15')](_0x689f('0x10'),_0x46e299,_0x3a6a38['error']['message']);return _0xa9b0d9(_0x3a6a38[_0x689f('0x15')][_0x689f('0x17')]);}logger[_0x689f('0x15')]('Dynamics365Configuration,\x20%s,\x20%s',_0x46e299,_0x3a6a38[_0x689f('0x15')][_0x689f('0x17')]);return _0xa9b9a(_0x3a6a38[_0x689f('0x15')]['message']);}else{logger[_0x689f('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x46e299,_0x689f('0x11'));_0xa9b9a(_0x3a6a38[_0x689f('0x18')][_0x689f('0x17')]);}})[_0x689f('0x19')](function(_0x1a239b){logger['error'](_0x689f('0x10'),_0x46e299,_0x1a239b);_0xa9b0d9(_0x1a239b);});});}
\ No newline at end of file
+var _0xa561=['code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','error'];(function(_0x12a0ab,_0x2753b3){var _0x9be6bd=function(_0x5e406a){while(--_0x5e406a){_0x12a0ab['push'](_0x12a0ab['shift']());}};_0x9be6bd(++_0x2753b3);}(_0xa561,0x1ac));var _0x1a56=function(_0x16e55,_0xd402c8){_0x16e55=_0x16e55-0x0;var _0x21e73e=_0xa561[_0x16e55];return _0x21e73e;};'use strict';var _=require('lodash');var util=require(_0x1a56('0x0'));var moment=require(_0x1a56('0x1'));var BPromise=require(_0x1a56('0x2'));var rs=require(_0x1a56('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a56('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a56('0x5'));var config=require(_0x1a56('0x6'));var jayson=require(_0x1a56('0x7'));var client=jayson['client'][_0x1a56('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x37605d,_0x100e56,_0x53a1cc){return new BPromise(function(_0x1f5624,_0x144641){return client['request'](_0x37605d,_0x53a1cc)[_0x1a56('0x9')](function(_0x1df0ad){logger[_0x1a56('0xa')](_0x1a56('0xb'),_0x100e56,_0x1a56('0xc'));logger['debug']('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x100e56,_0x1a56('0xc'),JSON['stringify'](_0x1df0ad));if(_0x1df0ad['error']){if(_0x1df0ad[_0x1a56('0xd')][_0x1a56('0xe')]===0x1f4){logger[_0x1a56('0xd')](_0x1a56('0xb'),_0x100e56,_0x1df0ad[_0x1a56('0xd')][_0x1a56('0xf')]);return _0x144641(_0x1df0ad['error']['message']);}logger[_0x1a56('0xd')](_0x1a56('0xb'),_0x100e56,_0x1df0ad[_0x1a56('0xd')][_0x1a56('0xf')]);return _0x1f5624(_0x1df0ad['error']['message']);}else{logger[_0x1a56('0xa')](_0x1a56('0xb'),_0x100e56,_0x1a56('0xc'));_0x1f5624(_0x1df0ad['result'][_0x1a56('0xf')]);}})[_0x1a56('0x10')](function(_0x61c13){logger[_0x1a56('0xd')](_0x1a56('0xb'),_0x100e56,_0x61c13);_0x144641(_0x61c13);});});}
\ No newline at end of file
index 8929876..312cfd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdfc=['put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x4c7935,_0x4a53fb){var _0x30651d=function(_0x12f35f){while(--_0x12f35f){_0x4c7935['push'](_0x4c7935['shift']());}};_0x30651d(++_0x4a53fb);}(_0xbdfc,0x1bd));var _0xcbdf=function(_0xbf09a4,_0x2b6d56){_0xbf09a4=_0xbf09a4-0x0;var _0x3ec9d6=_0xbdfc[_0xbf09a4];return _0x3ec9d6;};'use strict';var multer=require('multer');var util=require(_0xcbdf('0x0'));var path=require(_0xcbdf('0x1'));var timeout=require(_0xcbdf('0x2'));var express=require(_0xcbdf('0x3'));var router=express['Router']();var fs_extra=require(_0xcbdf('0x4'));var auth=require(_0xcbdf('0x5'));var interaction=require(_0xcbdf('0x6'));var config=require('../../config/environment');var controller=require(_0xcbdf('0x7'));router[_0xcbdf('0x8')]('/',auth[_0xcbdf('0x9')](),controller[_0xcbdf('0xa')]);router[_0xcbdf('0x8')](_0xcbdf('0xb'),auth['isAuthenticated'](),controller[_0xcbdf('0xc')]);router[_0xcbdf('0xd')]('/',auth[_0xcbdf('0x9')](),controller[_0xcbdf('0xe')]);router[_0xcbdf('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xcbdf('0x10')]);router[_0xcbdf('0x11')](_0xcbdf('0xb'),auth[_0xcbdf('0x9')](),controller[_0xcbdf('0x12')]);module[_0xcbdf('0x13')]=router;
\ No newline at end of file
+var _0x7186=['exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./intDynamics365Field.controller','isAuthenticated','get','show','post','create','put','/:id','update','delete','destroy'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x7186,0x10f));var _0x6718=function(_0x3e9dfb,_0x92d3aa){_0x3e9dfb=_0x3e9dfb-0x0;var _0x491efb=_0x7186[_0x3e9dfb];return _0x491efb;};'use strict';var multer=require(_0x6718('0x0'));var util=require(_0x6718('0x1'));var path=require('path');var timeout=require(_0x6718('0x2'));var express=require(_0x6718('0x3'));var router=express['Router']();var fs_extra=require(_0x6718('0x4'));var auth=require(_0x6718('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6718('0x6'));router['get']('/',auth[_0x6718('0x7')](),controller['index']);router[_0x6718('0x8')]('/:id',auth[_0x6718('0x7')](),controller[_0x6718('0x9')]);router[_0x6718('0xa')]('/',auth[_0x6718('0x7')](),controller[_0x6718('0xb')]);router[_0x6718('0xc')](_0x6718('0xd'),auth['isAuthenticated'](),controller[_0x6718('0xe')]);router[_0x6718('0xf')](_0x6718('0xd'),auth[_0x6718('0x7')](),controller[_0x6718('0x10')]);module[_0x6718('0x11')]=router;
\ No newline at end of file
index bfffffa..9d2e49e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3d0=['keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable'];(function(_0x207d2f,_0x44400f){var _0x3c3498=function(_0x57fdfb){while(--_0x57fdfb){_0x207d2f['push'](_0x207d2f['shift']());}};_0x3c3498(++_0x44400f);}(_0xe3d0,0x13f));var _0x0e3d=function(_0x523639,_0xcaac4e){_0x523639=_0x523639-0x0;var _0x4aa452=_0xe3d0[_0x523639];return _0x4aa452;};'use strict';var Sequelize=require(_0x0e3d('0x0'));module[_0x0e3d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0e3d('0x2'),_0x0e3d('0x3'),_0x0e3d('0x4'),_0x0e3d('0x5'),'picklist'),'defaultValue':_0x0e3d('0x2')},'content':{'type':Sequelize[_0x0e3d('0x6')]},'key':{'type':Sequelize[_0x0e3d('0x6')]},'keyType':{'type':Sequelize[_0x0e3d('0x7')]('string',_0x0e3d('0x3'),_0x0e3d('0x4'))},'keyContent':{'type':Sequelize[_0x0e3d('0x6')]},'idField':{'type':Sequelize[_0x0e3d('0x6')]},'nameField':{'type':Sequelize[_0x0e3d('0x6')]},'customField':{'type':Sequelize[_0x0e3d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0e3d('0x6')]}};
\ No newline at end of file
+var _0x0eff=['variable','customVariable','keyValue','string','STRING','sequelize','ENUM'];(function(_0x4628c6,_0x212c5e){var _0x181ddc=function(_0x36280a){while(--_0x36280a){_0x4628c6['push'](_0x4628c6['shift']());}};_0x181ddc(++_0x212c5e);}(_0x0eff,0x178));var _0xf0ef=function(_0x2f32c4,_0x531dc6){_0x2f32c4=_0x2f32c4-0x0;var _0x3f3018=_0x0eff[_0x2f32c4];return _0x3f3018;};'use strict';var Sequelize=require(_0xf0ef('0x0'));module['exports']={'type':{'type':Sequelize[_0xf0ef('0x1')]('string',_0xf0ef('0x2'),_0xf0ef('0x3'),_0xf0ef('0x4'),'picklist'),'defaultValue':_0xf0ef('0x5')},'content':{'type':Sequelize[_0xf0ef('0x6')]},'key':{'type':Sequelize[_0xf0ef('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xf0ef('0x5'),'variable',_0xf0ef('0x3'))},'keyContent':{'type':Sequelize[_0xf0ef('0x6')]},'idField':{'type':Sequelize[_0xf0ef('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d5d3bbf..b42d208 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05f2=['catch','fields','find','create','body','params','destroy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','Dynamics365Field','includeAll','include','rows'];(function(_0x5458b3,_0x203b29){var _0x58ee24=function(_0x2b8faa){while(--_0x2b8faa){_0x5458b3['push'](_0x5458b3['shift']());}};_0x58ee24(++_0x203b29);}(_0x05f2,0x1cf));var _0x205f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x05f2[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x205f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x205f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x205f('0x2'));var moment=require(_0x205f('0x3'));var BPromise=require(_0x205f('0x4'));var Mustache=require(_0x205f('0x5'));var util=require('util');var path=require(_0x205f('0x6'));var sox=require(_0x205f('0x7'));var csv=require(_0x205f('0x8'));var ejs=require(_0x205f('0x9'));var fs=require('fs');var fs_extra=require(_0x205f('0xa'));var _=require(_0x205f('0xb'));var squel=require(_0x205f('0xc'));var crypto=require(_0x205f('0xd'));var jsforce=require(_0x205f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x205f('0x8'));var querystring=require(_0x205f('0xf'));var Papa=require(_0x205f('0x10'));var Redis=require(_0x205f('0x11'));var authService=require(_0x205f('0x12'));var qs=require(_0x205f('0x13'));var as=require(_0x205f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x205f('0x15'))(_0x205f('0x16'));var utils=require(_0x205f('0x17'));var config=require(_0x205f('0x18'));var licenseUtil=require(_0x205f('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13dee3,_0xee54d0){_0xee54d0=_0xee54d0||0xcc;return function(_0x45a98d){if(_0x45a98d){return _0x13dee3[_0x205f('0x1a')](_0xee54d0);}return _0x13dee3[_0x205f('0x1b')](_0xee54d0)[_0x205f('0x1c')]();};}function respondWithResult(_0x29ce44,_0x2a9466){_0x2a9466=_0x2a9466||0xc8;return function(_0x50527d){if(_0x50527d){return _0x29ce44['status'](_0x2a9466)[_0x205f('0x1d')](_0x50527d);}};}function respondWithFilteredResult(_0x1e137b,_0x2cb97f){return function(_0x3a3c12){if(_0x3a3c12){var _0x224af9=typeof _0x2cb97f['offset']===_0x205f('0x1e')&&typeof _0x2cb97f[_0x205f('0x1f')]===_0x205f('0x1e');var _0x37753e=_0x3a3c12[_0x205f('0x20')];var _0x355b93=_0x224af9?0x0:_0x2cb97f['offset'];var _0x4f8a50=_0x224af9?_0x3a3c12[_0x205f('0x20')]:_0x2cb97f[_0x205f('0x21')]+_0x2cb97f['limit'];var _0x2b45ea;if(_0x4f8a50>=_0x37753e){_0x4f8a50=_0x37753e;_0x2b45ea=0xc8;}else{_0x2b45ea=0xce;}_0x1e137b[_0x205f('0x1b')](_0x2b45ea);return _0x1e137b[_0x205f('0x22')](_0x205f('0x23'),_0x355b93+'-'+_0x4f8a50+'/'+_0x37753e)[_0x205f('0x1d')](_0x3a3c12);}return null;};}function patchUpdates(_0x461682){return function(_0x4abb13){try{jsonpatch[_0x205f('0x24')](_0x4abb13,_0x461682,!![]);}catch(_0x378dda){return BPromise[_0x205f('0x25')](_0x378dda);}return _0x4abb13['save']();};}function saveUpdates(_0x5f0233,_0x4f47cc){return function(_0xe591d5){if(_0xe591d5){return _0xe591d5[_0x205f('0x26')](_0x5f0233)[_0x205f('0x27')](function(_0xf6e86b){return _0xf6e86b;});}return null;};}function removeEntity(_0x5ecf11,_0x581dfd){return function(_0x469a4e){if(_0x469a4e){return _0x469a4e['destroy']()['then'](function(){_0x5ecf11['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x8c84d2,_0x4f351b){return function(_0xcfd237){if(!_0xcfd237){_0x8c84d2[_0x205f('0x1a')](0x194);}return _0xcfd237;};}function handleError(_0x5405d0,_0x20581e){_0x20581e=_0x20581e||0x1f4;return function(_0x102c2d){logger[_0x205f('0x28')](_0x102c2d[_0x205f('0x29')]);if(_0x102c2d['name']){delete _0x102c2d[_0x205f('0x2a')];}_0x5405d0[_0x205f('0x1b')](_0x20581e)[_0x205f('0x2b')](_0x102c2d);};}exports[_0x205f('0x2c')]=function(_0x18671a,_0x58a56e){var _0x5f5588={},_0x7b809f={},_0x4f7f30={'count':0x0,'rows':[]};var _0x201a30=_['map'](db['Dynamics365Field'][_0x205f('0x2d')],function(_0x484a21){return{'name':_0x484a21[_0x205f('0x2e')],'type':_0x484a21[_0x205f('0x2f')][_0x205f('0x30')]};});_0x7b809f[_0x205f('0x31')]=_[_0x205f('0x32')](_0x201a30,_0x205f('0x2a'));_0x7b809f['query']=_[_0x205f('0x33')](_0x18671a[_0x205f('0x34')]);_0x7b809f[_0x205f('0x35')]=_[_0x205f('0x36')](_0x7b809f[_0x205f('0x31')],_0x7b809f[_0x205f('0x34')]);_0x5f5588[_0x205f('0x37')]=_[_0x205f('0x36')](_0x7b809f['model'],qs['fields'](_0x18671a['query']['fields']));_0x5f5588[_0x205f('0x37')]=_0x5f5588[_0x205f('0x37')][_0x205f('0x38')]?_0x5f5588[_0x205f('0x37')]:_0x7b809f[_0x205f('0x31')];if(!_0x18671a[_0x205f('0x34')]['hasOwnProperty'](_0x205f('0x39'))){_0x5f5588[_0x205f('0x1f')]=qs['limit'](_0x18671a[_0x205f('0x34')]['limit']);_0x5f5588['offset']=qs[_0x205f('0x21')](_0x18671a[_0x205f('0x34')]['offset']);}_0x5f5588[_0x205f('0x3a')]=qs[_0x205f('0x3b')](_0x18671a[_0x205f('0x34')][_0x205f('0x3b')]);_0x5f5588['where']=qs['filters'](_[_0x205f('0x3c')](_0x18671a[_0x205f('0x34')],_0x7b809f[_0x205f('0x35')]),_0x201a30);if(_0x18671a[_0x205f('0x34')][_0x205f('0x3d')]){_0x5f5588[_0x205f('0x3e')]=_[_0x205f('0x3f')](_0x5f5588['where'],{'$or':_[_0x205f('0x32')](_0x201a30,function(_0x3bf152){if(_0x3bf152[_0x205f('0x2f')]!=='VIRTUAL'){var _0x245c0d={};_0x245c0d[_0x3bf152[_0x205f('0x2a')]]={'$like':'%'+_0x18671a[_0x205f('0x34')][_0x205f('0x3d')]+'%'};return _0x245c0d;}})});}_0x5f5588=_[_0x205f('0x3f')]({},_0x5f5588,_0x18671a[_0x205f('0x40')]);var _0x385a3d={'where':_0x5f5588['where']};return db[_0x205f('0x41')]['count'](_0x385a3d)[_0x205f('0x27')](function(_0x3a23de){_0x4f7f30['count']=_0x3a23de;if(_0x18671a[_0x205f('0x34')][_0x205f('0x42')]){_0x5f5588[_0x205f('0x43')]=[{'all':!![]}];}return db[_0x205f('0x41')]['findAll'](_0x5f5588);})[_0x205f('0x27')](function(_0x3a5485){_0x4f7f30[_0x205f('0x44')]=_0x3a5485;return _0x4f7f30;})[_0x205f('0x27')](respondWithFilteredResult(_0x58a56e,_0x5f5588))[_0x205f('0x45')](handleError(_0x58a56e,null));};exports['show']=function(_0x5ae3ef,_0x2e51b1){var _0x249e91={'raw':!![],'where':{'id':_0x5ae3ef['params']['id']}},_0x4429c9={};_0x4429c9[_0x205f('0x31')]=_[_0x205f('0x33')](db[_0x205f('0x41')]['rawAttributes']);_0x4429c9['query']=_[_0x205f('0x33')](_0x5ae3ef[_0x205f('0x34')]);_0x4429c9[_0x205f('0x35')]=_[_0x205f('0x36')](_0x4429c9[_0x205f('0x31')],_0x4429c9['query']);_0x249e91['attributes']=_[_0x205f('0x36')](_0x4429c9['model'],qs[_0x205f('0x46')](_0x5ae3ef[_0x205f('0x34')][_0x205f('0x46')]));_0x249e91[_0x205f('0x37')]=_0x249e91[_0x205f('0x37')]['length']?_0x249e91[_0x205f('0x37')]:_0x4429c9[_0x205f('0x31')];if(_0x5ae3ef[_0x205f('0x34')][_0x205f('0x42')]){_0x249e91[_0x205f('0x43')]=[{'all':!![]}];}_0x249e91=_['merge']({},_0x249e91,_0x5ae3ef['options']);return db[_0x205f('0x41')][_0x205f('0x47')](_0x249e91)[_0x205f('0x27')](handleEntityNotFound(_0x2e51b1,null))[_0x205f('0x27')](respondWithResult(_0x2e51b1,null))[_0x205f('0x45')](handleError(_0x2e51b1,null));};exports[_0x205f('0x48')]=function(_0x3c1e9e,_0x5022da){return db[_0x205f('0x41')][_0x205f('0x48')](_0x3c1e9e[_0x205f('0x49')],{})[_0x205f('0x27')](respondWithResult(_0x5022da,0xc9))['catch'](handleError(_0x5022da,null));};exports[_0x205f('0x26')]=function(_0xfd11aa,_0x5388c8){if(_0xfd11aa[_0x205f('0x49')]['id']){delete _0xfd11aa[_0x205f('0x49')]['id'];}return db['Dynamics365Field'][_0x205f('0x47')]({'where':{'id':_0xfd11aa[_0x205f('0x4a')]['id']}})[_0x205f('0x27')](handleEntityNotFound(_0x5388c8,null))[_0x205f('0x27')](saveUpdates(_0xfd11aa[_0x205f('0x49')],null))[_0x205f('0x27')](respondWithResult(_0x5388c8,null))[_0x205f('0x45')](handleError(_0x5388c8,null));};exports[_0x205f('0x4b')]=function(_0x431750,_0x5a8001){return db['Dynamics365Field'][_0x205f('0x47')]({'where':{'id':_0x431750[_0x205f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5a8001,null))['then'](removeEntity(_0x5a8001,null))[_0x205f('0x45')](handleError(_0x5a8001,null));};
\ No newline at end of file
+var _0x364e=['sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','where','pick','filter','merge','type','VIRTUAL','Dynamics365Field','includeAll','include','rows','catch','length','options','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path'];(function(_0x30b4da,_0x1e1a64){var _0xc5eaaa=function(_0x126fac){while(--_0x126fac){_0x30b4da['push'](_0x30b4da['shift']());}};_0xc5eaaa(++_0x1e1a64);}(_0x364e,0x15b));var _0xe364=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x364e[_0x125ff8];return _0x2d9ef;};'use strict';var emlformat=require(_0xe364('0x0'));var rimraf=require(_0xe364('0x1'));var zipdir=require(_0xe364('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe364('0x3'));var moment=require('moment');var BPromise=require(_0xe364('0x4'));var Mustache=require(_0xe364('0x5'));var util=require(_0xe364('0x6'));var path=require(_0xe364('0x7'));var sox=require(_0xe364('0x8'));var csv=require(_0xe364('0x9'));var ejs=require(_0xe364('0xa'));var fs=require('fs');var fs_extra=require(_0xe364('0xb'));var _=require('lodash');var squel=require(_0xe364('0xc'));var crypto=require('crypto');var jsforce=require(_0xe364('0xd'));var deskjs=require(_0xe364('0xe'));var toCsv=require(_0xe364('0x9'));var querystring=require(_0xe364('0xf'));var Papa=require(_0xe364('0x10'));var Redis=require('ioredis');var authService=require(_0xe364('0x11'));var qs=require(_0xe364('0x12'));var as=require(_0xe364('0x13'));var hardwareService=require(_0xe364('0x14'));var logger=require(_0xe364('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xe364('0x16'));var licenseUtil=require(_0xe364('0x17'));var db=require(_0xe364('0x18'))['db'];function respondWithStatusCode(_0x4fb272,_0x1f92b3){_0x1f92b3=_0x1f92b3||0xcc;return function(_0x38a3ca){if(_0x38a3ca){return _0x4fb272[_0xe364('0x19')](_0x1f92b3);}return _0x4fb272[_0xe364('0x1a')](_0x1f92b3)[_0xe364('0x1b')]();};}function respondWithResult(_0x4aa54f,_0x377220){_0x377220=_0x377220||0xc8;return function(_0xfd8b3c){if(_0xfd8b3c){return _0x4aa54f[_0xe364('0x1a')](_0x377220)['json'](_0xfd8b3c);}};}function respondWithFilteredResult(_0x39a040,_0x750d96){return function(_0x40dc8b){if(_0x40dc8b){var _0x4e52d3=typeof _0x750d96[_0xe364('0x1c')]===_0xe364('0x1d')&&typeof _0x750d96['limit']==='undefined';var _0x3590d9=_0x40dc8b[_0xe364('0x1e')];var _0x49b5b1=_0x4e52d3?0x0:_0x750d96[_0xe364('0x1c')];var _0x445cc3=_0x4e52d3?_0x40dc8b[_0xe364('0x1e')]:_0x750d96[_0xe364('0x1c')]+_0x750d96[_0xe364('0x1f')];var _0x3ec0cf;if(_0x445cc3>=_0x3590d9){_0x445cc3=_0x3590d9;_0x3ec0cf=0xc8;}else{_0x3ec0cf=0xce;}_0x39a040[_0xe364('0x1a')](_0x3ec0cf);return _0x39a040[_0xe364('0x20')](_0xe364('0x21'),_0x49b5b1+'-'+_0x445cc3+'/'+_0x3590d9)[_0xe364('0x22')](_0x40dc8b);}return null;};}function patchUpdates(_0x1b6241){return function(_0x23232d){try{jsonpatch[_0xe364('0x23')](_0x23232d,_0x1b6241,!![]);}catch(_0x196e05){return BPromise[_0xe364('0x24')](_0x196e05);}return _0x23232d[_0xe364('0x25')]();};}function saveUpdates(_0x8b052a,_0x3a2c4e){return function(_0x3aa838){if(_0x3aa838){return _0x3aa838['update'](_0x8b052a)[_0xe364('0x26')](function(_0x46b8e2){return _0x46b8e2;});}return null;};}function removeEntity(_0x3b974d,_0x8bc806){return function(_0x1309b2){if(_0x1309b2){return _0x1309b2[_0xe364('0x27')]()[_0xe364('0x26')](function(){_0x3b974d[_0xe364('0x1a')](0xcc)[_0xe364('0x1b')]();});}};}function handleEntityNotFound(_0x55a366,_0x115229){return function(_0x5009db){if(!_0x5009db){_0x55a366[_0xe364('0x19')](0x194);}return _0x5009db;};}function handleError(_0x43dacc,_0x42d3d3){_0x42d3d3=_0x42d3d3||0x1f4;return function(_0x47fef8){logger['error'](_0x47fef8['stack']);if(_0x47fef8[_0xe364('0x28')]){delete _0x47fef8['name'];}_0x43dacc[_0xe364('0x1a')](_0x42d3d3)['send'](_0x47fef8);};}exports[_0xe364('0x29')]=function(_0x2c8b34,_0x4d689f){var _0x53902f={},_0x2df6ac={},_0x547d62={'count':0x0,'rows':[]};var _0x496bb6=_[_0xe364('0x2a')](db['Dynamics365Field'][_0xe364('0x2b')],function(_0x587e16){return{'name':_0x587e16['fieldName'],'type':_0x587e16['type'][_0xe364('0x2c')]};});_0x2df6ac[_0xe364('0x2d')]=_[_0xe364('0x2a')](_0x496bb6,_0xe364('0x28'));_0x2df6ac[_0xe364('0x2e')]=_[_0xe364('0x2f')](_0x2c8b34['query']);_0x2df6ac[_0xe364('0x30')]=_[_0xe364('0x31')](_0x2df6ac['model'],_0x2df6ac[_0xe364('0x2e')]);_0x53902f[_0xe364('0x32')]=_['intersection'](_0x2df6ac[_0xe364('0x2d')],qs['fields'](_0x2c8b34['query'][_0xe364('0x33')]));_0x53902f[_0xe364('0x32')]=_0x53902f[_0xe364('0x32')]['length']?_0x53902f['attributes']:_0x2df6ac[_0xe364('0x2d')];if(!_0x2c8b34[_0xe364('0x2e')][_0xe364('0x34')](_0xe364('0x35'))){_0x53902f[_0xe364('0x1f')]=qs['limit'](_0x2c8b34[_0xe364('0x2e')]['limit']);_0x53902f['offset']=qs['offset'](_0x2c8b34[_0xe364('0x2e')][_0xe364('0x1c')]);}_0x53902f['order']=qs['sort'](_0x2c8b34[_0xe364('0x2e')]['sort']);_0x53902f[_0xe364('0x36')]=qs[_0xe364('0x30')](_[_0xe364('0x37')](_0x2c8b34[_0xe364('0x2e')],_0x2df6ac[_0xe364('0x30')]),_0x496bb6);if(_0x2c8b34[_0xe364('0x2e')][_0xe364('0x38')]){_0x53902f[_0xe364('0x36')]=_[_0xe364('0x39')](_0x53902f[_0xe364('0x36')],{'$or':_[_0xe364('0x2a')](_0x496bb6,function(_0x5f041a){if(_0x5f041a[_0xe364('0x3a')]!==_0xe364('0x3b')){var _0x10c6cd={};_0x10c6cd[_0x5f041a['name']]={'$like':'%'+_0x2c8b34['query'][_0xe364('0x38')]+'%'};return _0x10c6cd;}})});}_0x53902f=_[_0xe364('0x39')]({},_0x53902f,_0x2c8b34['options']);var _0x1a28da={'where':_0x53902f['where']};return db[_0xe364('0x3c')][_0xe364('0x1e')](_0x1a28da)[_0xe364('0x26')](function(_0x51fd29){_0x547d62[_0xe364('0x1e')]=_0x51fd29;if(_0x2c8b34[_0xe364('0x2e')][_0xe364('0x3d')]){_0x53902f[_0xe364('0x3e')]=[{'all':!![]}];}return db[_0xe364('0x3c')]['findAll'](_0x53902f);})[_0xe364('0x26')](function(_0x178ac2){_0x547d62[_0xe364('0x3f')]=_0x178ac2;return _0x547d62;})[_0xe364('0x26')](respondWithFilteredResult(_0x4d689f,_0x53902f))[_0xe364('0x40')](handleError(_0x4d689f,null));};exports['show']=function(_0x25ff1e,_0x1712f5){var _0x4c57ff={'raw':!![],'where':{'id':_0x25ff1e['params']['id']}},_0x2ca1bc={};_0x2ca1bc[_0xe364('0x2d')]=_[_0xe364('0x2f')](db[_0xe364('0x3c')][_0xe364('0x2b')]);_0x2ca1bc[_0xe364('0x2e')]=_[_0xe364('0x2f')](_0x25ff1e[_0xe364('0x2e')]);_0x2ca1bc['filters']=_[_0xe364('0x31')](_0x2ca1bc[_0xe364('0x2d')],_0x2ca1bc[_0xe364('0x2e')]);_0x4c57ff[_0xe364('0x32')]=_[_0xe364('0x31')](_0x2ca1bc['model'],qs['fields'](_0x25ff1e[_0xe364('0x2e')]['fields']));_0x4c57ff[_0xe364('0x32')]=_0x4c57ff[_0xe364('0x32')][_0xe364('0x41')]?_0x4c57ff['attributes']:_0x2ca1bc['model'];if(_0x25ff1e[_0xe364('0x2e')][_0xe364('0x3d')]){_0x4c57ff[_0xe364('0x3e')]=[{'all':!![]}];}_0x4c57ff=_[_0xe364('0x39')]({},_0x4c57ff,_0x25ff1e[_0xe364('0x42')]);return db['Dynamics365Field'][_0xe364('0x43')](_0x4c57ff)['then'](handleEntityNotFound(_0x1712f5,null))[_0xe364('0x26')](respondWithResult(_0x1712f5,null))[_0xe364('0x40')](handleError(_0x1712f5,null));};exports[_0xe364('0x44')]=function(_0x3e9ef8,_0x2378e5){return db[_0xe364('0x3c')][_0xe364('0x44')](_0x3e9ef8['body'],{})['then'](respondWithResult(_0x2378e5,0xc9))[_0xe364('0x40')](handleError(_0x2378e5,null));};exports['update']=function(_0x2eecfc,_0x45af98){if(_0x2eecfc[_0xe364('0x45')]['id']){delete _0x2eecfc['body']['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x2eecfc[_0xe364('0x46')]['id']}})[_0xe364('0x26')](handleEntityNotFound(_0x45af98,null))[_0xe364('0x26')](saveUpdates(_0x2eecfc['body'],null))[_0xe364('0x26')](respondWithResult(_0x45af98,null))[_0xe364('0x40')](handleError(_0x45af98,null));};exports[_0xe364('0x27')]=function(_0x107847,_0x5528a7){return db['Dynamics365Field'][_0xe364('0x43')]({'where':{'id':_0x107847[_0xe364('0x46')]['id']}})[_0xe364('0x26')](handleEntityNotFound(_0x5528a7,null))[_0xe364('0x26')](removeEntity(_0x5528a7,null))['catch'](handleError(_0x5528a7,null));};
\ No newline at end of file
index f53c9fc..51a0374 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b86=['../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','moment','bluebird','request-promise','path'];(function(_0x4ff421,_0x2d65ff){var _0x52d1e3=function(_0x459e7e){while(--_0x459e7e){_0x4ff421['push'](_0x4ff421['shift']());}};_0x52d1e3(++_0x2d65ff);}(_0x8b86,0x1dc));var _0x68b8=function(_0x407a3e,_0x15acb0){_0x407a3e=_0x407a3e-0x0;var _0x129fe3=_0x8b86[_0x407a3e];return _0x129fe3;};'use strict';var _=require('lodash');var util=require(_0x68b8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x68b8('0x1'));var BPromise=require(_0x68b8('0x2'));var rp=require(_0x68b8('0x3'));var fs=require('fs');var path=require(_0x68b8('0x4'));var rimraf=require('rimraf');var config=require(_0x68b8('0x5'));var attributes=require(_0x68b8('0x6'));module[_0x68b8('0x7')]=function(_0x3278d1,_0x249e99){return _0x3278d1['define'](_0x68b8('0x8'),attributes,{'tableName':_0x68b8('0x9'),'paranoid':![],'indexes':[{'name':_0x68b8('0xa'),'fields':[_0x68b8('0xb'),_0x68b8('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x6459=['api','moment','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','FieldId','lodash','util','../../config/logger'];(function(_0xa7aed2,_0x2f9971){var _0x43304a=function(_0xde20e9){while(--_0xde20e9){_0xa7aed2['push'](_0xa7aed2['shift']());}};_0x43304a(++_0x2f9971);}(_0x6459,0x8d));var _0x9645=function(_0xcac6ad,_0x4131ad){_0xcac6ad=_0xcac6ad-0x0;var _0x5a4406=_0x6459[_0xcac6ad];return _0x5a4406;};'use strict';var _=require(_0x9645('0x0'));var util=require(_0x9645('0x1'));var logger=require(_0x9645('0x2'))(_0x9645('0x3'));var moment=require(_0x9645('0x4'));var BPromise=require('bluebird');var rp=require(_0x9645('0x5'));var fs=require('fs');var path=require(_0x9645('0x6'));var rimraf=require('rimraf');var config=require(_0x9645('0x7'));var attributes=require(_0x9645('0x8'));module[_0x9645('0x9')]=function(_0x5a71d1,_0x5a9188){return _0x5a71d1['define'](_0x9645('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x9645('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index ee92b77..f1e791d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe9d=['request','then','info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','bluebird','randomstring','ioredis','jayson/promise','client','http'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbe9d,0xd9));var _0xdbe9=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xbe9d[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xdbe9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xdbe9('0x1'));var rs=require(_0xdbe9('0x2'));var fs=require('fs');var Redis=require(_0xdbe9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdbe9('0x4'));var client=jayson[_0xdbe9('0x5')][_0xdbe9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a9b12,_0x16ffcc,_0x3aa29e){return new BPromise(function(_0x3a8a16,_0x47642d){return client[_0xdbe9('0x7')](_0x5a9b12,_0x3aa29e)[_0xdbe9('0x8')](function(_0x25a75f){logger[_0xdbe9('0x9')](_0xdbe9('0xa'),_0x16ffcc,'request\x20sent');logger['debug'](_0xdbe9('0xb'),_0x16ffcc,_0xdbe9('0xc'),JSON['stringify'](_0x25a75f));if(_0x25a75f[_0xdbe9('0xd')]){if(_0x25a75f[_0xdbe9('0xd')]['code']===0x1f4){logger[_0xdbe9('0xd')](_0xdbe9('0xa'),_0x16ffcc,_0x25a75f[_0xdbe9('0xd')][_0xdbe9('0xe')]);return _0x47642d(_0x25a75f[_0xdbe9('0xd')][_0xdbe9('0xe')]);}logger[_0xdbe9('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x16ffcc,_0x25a75f[_0xdbe9('0xd')][_0xdbe9('0xe')]);return _0x3a8a16(_0x25a75f[_0xdbe9('0xd')]['message']);}else{logger[_0xdbe9('0x9')](_0xdbe9('0xa'),_0x16ffcc,_0xdbe9('0xc'));_0x3a8a16(_0x25a75f[_0xdbe9('0xf')]['message']);}})['catch'](function(_0x3af284){logger[_0xdbe9('0xd')](_0xdbe9('0xa'),_0x16ffcc,_0x3af284);_0x47642d(_0x3af284);});});}
\ No newline at end of file
+var _0x06ad=['jayson/promise','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x357cc6,_0x39255a){var _0x39befe=function(_0x5a0d4a){while(--_0x5a0d4a){_0x357cc6['push'](_0x357cc6['shift']());}};_0x39befe(++_0x39255a);}(_0x06ad,0x13a));var _0xd06a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x06ad[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd06a('0x0'));var util=require(_0xd06a('0x1'));var moment=require(_0xd06a('0x2'));var BPromise=require(_0xd06a('0x3'));var rs=require(_0xd06a('0x4'));var fs=require('fs');var Redis=require(_0xd06a('0x5'));var db=require(_0xd06a('0x6'))['db'];var utils=require(_0xd06a('0x7'));var logger=require(_0xd06a('0x8'))(_0xd06a('0x9'));var config=require(_0xd06a('0xa'));var jayson=require(_0xd06a('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4c3048,_0x3b305e,_0x286f8b){return new BPromise(function(_0x5a86cc,_0x371826){return client[_0xd06a('0xc')](_0x4c3048,_0x286f8b)[_0xd06a('0xd')](function(_0x360ffa){logger[_0xd06a('0xe')](_0xd06a('0xf'),_0x3b305e,_0xd06a('0x10'));logger[_0xd06a('0x11')](_0xd06a('0x12'),_0x3b305e,_0xd06a('0x10'),JSON[_0xd06a('0x13')](_0x360ffa));if(_0x360ffa['error']){if(_0x360ffa[_0xd06a('0x14')][_0xd06a('0x15')]===0x1f4){logger[_0xd06a('0x14')](_0xd06a('0xf'),_0x3b305e,_0x360ffa[_0xd06a('0x14')][_0xd06a('0x16')]);return _0x371826(_0x360ffa[_0xd06a('0x14')]['message']);}logger[_0xd06a('0x14')](_0xd06a('0xf'),_0x3b305e,_0x360ffa[_0xd06a('0x14')][_0xd06a('0x16')]);return _0x5a86cc(_0x360ffa['error'][_0xd06a('0x16')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x3b305e,_0xd06a('0x10'));_0x5a86cc(_0x360ffa[_0xd06a('0x17')][_0xd06a('0x16')]);}})[_0xd06a('0x18')](function(_0x5c6a42){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x3b305e,_0x5c6a42);_0x371826(_0x5c6a42);});});}
\ No newline at end of file
index febe667..3d1e354 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe73d=['get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0x2a2cbc,_0x620277){var _0x51a366=function(_0x440d24){while(--_0x440d24){_0x2a2cbc['push'](_0x2a2cbc['shift']());}};_0x51a366(++_0x620277);}(_0xe73d,0x12e));var _0xde73=function(_0x358650,_0x55672a){_0x358650=_0x358650-0x0;var _0x3214d8=_0xe73d[_0x358650];return _0x3214d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xde73('0x0'));var timeout=require('connect-timeout');var express=require(_0xde73('0x1'));var router=express[_0xde73('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xde73('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xde73('0x4'));var controller=require(_0xde73('0x5'));router[_0xde73('0x6')]('/',auth[_0xde73('0x7')](),controller[_0xde73('0x8')]);router['get'](_0xde73('0x9'),auth[_0xde73('0x7')](),controller['show']);router[_0xde73('0x6')](_0xde73('0xa'),auth['isAuthenticated'](),controller[_0xde73('0xb')]);router[_0xde73('0x6')](_0xde73('0xc'),auth[_0xde73('0x7')](),controller[_0xde73('0xd')]);router[_0xde73('0xe')]('/',auth['isAuthenticated'](),controller[_0xde73('0xf')]);router['post']('/:id/configurations',auth[_0xde73('0x7')](),controller[_0xde73('0x10')]);router[_0xde73('0x11')](_0xde73('0x9'),auth[_0xde73('0x7')](),controller[_0xde73('0x12')]);router[_0xde73('0x13')](_0xde73('0x9'),auth[_0xde73('0x7')](),controller[_0xde73('0x14')]);module[_0xde73('0x15')]=router;
\ No newline at end of file
+var _0x9516=['/:id/fields','getFields','post','addConfiguration','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations'];(function(_0x3c6b7d,_0x5f0d90){var _0x1d3ed2=function(_0x1a8f35){while(--_0x1a8f35){_0x3c6b7d['push'](_0x3c6b7d['shift']());}};_0x1d3ed2(++_0x5f0d90);}(_0x9516,0x119));var _0x6951=function(_0x214d8c,_0x242dc3){_0x214d8c=_0x214d8c-0x0;var _0x5a5060=_0x9516[_0x214d8c];return _0x5a5060;};'use strict';var multer=require(_0x6951('0x0'));var util=require(_0x6951('0x1'));var path=require('path');var timeout=require(_0x6951('0x2'));var express=require('express');var router=express[_0x6951('0x3')]();var fs_extra=require(_0x6951('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6951('0x5'));var config=require(_0x6951('0x6'));var controller=require(_0x6951('0x7'));router[_0x6951('0x8')]('/',auth[_0x6951('0x9')](),controller['index']);router[_0x6951('0x8')](_0x6951('0xa'),auth[_0x6951('0x9')](),controller[_0x6951('0xb')]);router[_0x6951('0x8')](_0x6951('0xc'),auth[_0x6951('0x9')](),controller['getConfigurations']);router[_0x6951('0x8')](_0x6951('0xd'),auth[_0x6951('0x9')](),controller[_0x6951('0xe')]);router[_0x6951('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6951('0xf')](_0x6951('0xc'),auth[_0x6951('0x9')](),controller[_0x6951('0x10')]);router['put'](_0x6951('0xa'),auth[_0x6951('0x9')](),controller[_0x6951('0x11')]);router[_0x6951('0x12')](_0x6951('0xa'),auth[_0x6951('0x9')](),controller[_0x6951('0x13')]);module[_0x6951('0x14')]=router;
\ No newline at end of file
index 27b9c18..ec83865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8603=['remoteUri','exports','STRING'];(function(_0x1b8df5,_0x393e65){var _0x59b384=function(_0x5aa21c){while(--_0x5aa21c){_0x1b8df5['push'](_0x1b8df5['shift']());}};_0x59b384(++_0x393e65);}(_0x8603,0x190));var _0x3860=function(_0x53a7a8,_0xed2bff){_0x53a7a8=_0x53a7a8-0x0;var _0x555f71=_0x8603[_0x53a7a8];return _0x555f71;};'use strict';var Sequelize=require('sequelize');module[_0x3860('0x0')]={'name':{'type':Sequelize[_0x3860('0x1')]},'description':{'type':Sequelize[_0x3860('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x3860('0x1')]},'remoteUri':{'type':Sequelize[_0x3860('0x1')],'unique':_0x3860('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x5204=['exports','STRING','username','sequelize'];(function(_0x4df199,_0x510858){var _0x2b7bd2=function(_0x110f0e){while(--_0x110f0e){_0x4df199['push'](_0x4df199['shift']());}};_0x2b7bd2(++_0x510858);}(_0x5204,0xdf));var _0x4520=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x5204[_0x204eb7];return _0x37e444;};'use strict';var Sequelize=require(_0x4520('0x0'));module[_0x4520('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4520('0x2')]},'username':{'type':Sequelize[_0x4520('0x2')],'unique':_0x4520('0x3')},'apiKey':{'type':Sequelize[_0x4520('0x2')]},'remoteUri':{'type':Sequelize[_0x4520('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4520('0x2')],'allowNull':![]}};
\ No newline at end of file
index f2ecb64..e57c8ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe9d=['nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','findOne','FreshdeskConfiguration','rawAttributes','pick','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','getFields','remoteUri','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','agent','description','group','source','company','remove','includes','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','limit','count','json','apply','save','update','then','destroy','error','stack','send','index','map','FreshdeskAccount','fieldName','type','key','name','query','keys','filters','intersection','attributes','model','fields','length'];(function(_0x1cf0cd,_0x3ca2ce){var _0xcf0393=function(_0x2d0fe3){while(--_0x2d0fe3){_0x1cf0cd['push'](_0x1cf0cd['shift']());}};_0xcf0393(++_0x3ca2ce);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x4c15db,_0x8ec5ed){_0x4c15db=_0x4c15db-0x0;var _0x1eb557=_0xfe9d[_0x4c15db];return _0x1eb557;};'use strict';var emlformat=require(_0xdfe9('0x0'));var rimraf=require(_0xdfe9('0x1'));var zipdir=require(_0xdfe9('0x2'));var jsonpatch=require(_0xdfe9('0x3'));var rp=require(_0xdfe9('0x4'));var moment=require('moment');var BPromise=require(_0xdfe9('0x5'));var Mustache=require('mustache');var util=require(_0xdfe9('0x6'));var path=require(_0xdfe9('0x7'));var sox=require(_0xdfe9('0x8'));var csv=require(_0xdfe9('0x9'));var ejs=require(_0xdfe9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdfe9('0xb'));var crypto=require('crypto');var jsforce=require(_0xdfe9('0xc'));var deskjs=require(_0xdfe9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdfe9('0xe'));var Papa=require(_0xdfe9('0xf'));var Redis=require(_0xdfe9('0x10'));var authService=require(_0xdfe9('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xdfe9('0x12'));var hardwareService=require(_0xdfe9('0x13'));var logger=require(_0xdfe9('0x14'))(_0xdfe9('0x15'));var utils=require(_0xdfe9('0x16'));var config=require(_0xdfe9('0x17'));var licenseUtil=require(_0xdfe9('0x18'));var db=require(_0xdfe9('0x19'))['db'];var integrations=require(_0xdfe9('0x1a'));function respondWithStatusCode(_0x351cc8,_0x5560ab){_0x5560ab=_0x5560ab||0xcc;return function(_0xed269b){if(_0xed269b){return _0x351cc8['sendStatus'](_0x5560ab);}return _0x351cc8['status'](_0x5560ab)[_0xdfe9('0x1b')]();};}function respondWithResult(_0x4a1e01,_0x531409){_0x531409=_0x531409||0xc8;return function(_0x186792){if(_0x186792){return _0x4a1e01[_0xdfe9('0x1c')](_0x531409)['json'](_0x186792);}};}function respondWithFilteredResult(_0x313e61,_0x5b849b){return function(_0x2d151b){if(_0x2d151b){var _0x1bcc94=typeof _0x5b849b[_0xdfe9('0x1d')]===_0xdfe9('0x1e')&&typeof _0x5b849b[_0xdfe9('0x1f')]===_0xdfe9('0x1e');var _0x55ef2a=_0x2d151b['count'];var _0x3889fa=_0x1bcc94?0x0:_0x5b849b['offset'];var _0x1d80bf=_0x1bcc94?_0x2d151b[_0xdfe9('0x20')]:_0x5b849b[_0xdfe9('0x1d')]+_0x5b849b['limit'];var _0x4ad1fc;if(_0x1d80bf>=_0x55ef2a){_0x1d80bf=_0x55ef2a;_0x4ad1fc=0xc8;}else{_0x4ad1fc=0xce;}_0x313e61[_0xdfe9('0x1c')](_0x4ad1fc);return _0x313e61['set']('Content-Range',_0x3889fa+'-'+_0x1d80bf+'/'+_0x55ef2a)[_0xdfe9('0x21')](_0x2d151b);}return null;};}function patchUpdates(_0x5691cc){return function(_0x51891d){try{jsonpatch[_0xdfe9('0x22')](_0x51891d,_0x5691cc,!![]);}catch(_0x5890bc){return BPromise['reject'](_0x5890bc);}return _0x51891d[_0xdfe9('0x23')]();};}function saveUpdates(_0x233e18,_0x2fa679){return function(_0x30eaed){if(_0x30eaed){return _0x30eaed[_0xdfe9('0x24')](_0x233e18)[_0xdfe9('0x25')](function(_0x271b3e){return _0x271b3e;});}return null;};}function removeEntity(_0x3a81eb,_0x3a5a98){return function(_0x3ce587){if(_0x3ce587){return _0x3ce587[_0xdfe9('0x26')]()['then'](function(){_0x3a81eb['status'](0xcc)[_0xdfe9('0x1b')]();});}};}function handleEntityNotFound(_0x2ad2ac,_0x57005b){return function(_0x244b92){if(!_0x244b92){_0x2ad2ac['sendStatus'](0x194);}return _0x244b92;};}function handleError(_0x5bebb0,_0x18aa02){_0x18aa02=_0x18aa02||0x1f4;return function(_0x2923c4){logger[_0xdfe9('0x27')](_0x2923c4[_0xdfe9('0x28')]);if(_0x2923c4['name']){delete _0x2923c4['name'];}_0x5bebb0[_0xdfe9('0x1c')](_0x18aa02)[_0xdfe9('0x29')](_0x2923c4);};}exports[_0xdfe9('0x2a')]=function(_0x216406,_0x49b0be){var _0x1e1ce0={},_0x6bc5f0={},_0x4e1a44={'count':0x0,'rows':[]};var _0x2cba66=_[_0xdfe9('0x2b')](db[_0xdfe9('0x2c')]['rawAttributes'],function(_0x45edc){return{'name':_0x45edc[_0xdfe9('0x2d')],'type':_0x45edc[_0xdfe9('0x2e')][_0xdfe9('0x2f')]};});_0x6bc5f0['model']=_[_0xdfe9('0x2b')](_0x2cba66,_0xdfe9('0x30'));_0x6bc5f0[_0xdfe9('0x31')]=_[_0xdfe9('0x32')](_0x216406['query']);_0x6bc5f0[_0xdfe9('0x33')]=_[_0xdfe9('0x34')](_0x6bc5f0['model'],_0x6bc5f0[_0xdfe9('0x31')]);_0x1e1ce0[_0xdfe9('0x35')]=_[_0xdfe9('0x34')](_0x6bc5f0[_0xdfe9('0x36')],qs[_0xdfe9('0x37')](_0x216406[_0xdfe9('0x31')][_0xdfe9('0x37')]));_0x1e1ce0[_0xdfe9('0x35')]=_0x1e1ce0[_0xdfe9('0x35')][_0xdfe9('0x38')]?_0x1e1ce0[_0xdfe9('0x35')]:_0x6bc5f0[_0xdfe9('0x36')];if(!_0x216406['query']['hasOwnProperty'](_0xdfe9('0x39'))){_0x1e1ce0[_0xdfe9('0x1f')]=qs[_0xdfe9('0x1f')](_0x216406[_0xdfe9('0x31')][_0xdfe9('0x1f')]);_0x1e1ce0[_0xdfe9('0x1d')]=qs[_0xdfe9('0x1d')](_0x216406[_0xdfe9('0x31')]['offset']);}_0x1e1ce0[_0xdfe9('0x3a')]=qs[_0xdfe9('0x3b')](_0x216406[_0xdfe9('0x31')]['sort']);_0x1e1ce0['where']=qs[_0xdfe9('0x33')](_['pick'](_0x216406[_0xdfe9('0x31')],_0x6bc5f0[_0xdfe9('0x33')]),_0x2cba66);if(_0x216406['query'][_0xdfe9('0x3c')]){_0x1e1ce0[_0xdfe9('0x3d')]=_[_0xdfe9('0x3e')](_0x1e1ce0[_0xdfe9('0x3d')],{'$or':_[_0xdfe9('0x2b')](_0x2cba66,function(_0x382549){if(_0x382549['type']!==_0xdfe9('0x3f')){var _0x2fa190={};_0x2fa190[_0x382549['name']]={'$like':'%'+_0x216406[_0xdfe9('0x31')][_0xdfe9('0x3c')]+'%'};return _0x2fa190;}})});}_0x1e1ce0=_[_0xdfe9('0x3e')]({},_0x1e1ce0,_0x216406[_0xdfe9('0x40')]);var _0x175537={'where':_0x1e1ce0[_0xdfe9('0x3d')]};return db[_0xdfe9('0x2c')][_0xdfe9('0x20')](_0x175537)[_0xdfe9('0x25')](function(_0x236591){_0x4e1a44[_0xdfe9('0x20')]=_0x236591;if(_0x216406[_0xdfe9('0x31')][_0xdfe9('0x41')]){_0x1e1ce0[_0xdfe9('0x42')]=[{'all':!![]}];}return db[_0xdfe9('0x2c')][_0xdfe9('0x43')](_0x1e1ce0);})['then'](function(_0x41bc6f){_0x4e1a44[_0xdfe9('0x44')]=_0x41bc6f;return _0x4e1a44;})[_0xdfe9('0x25')](respondWithFilteredResult(_0x49b0be,_0x1e1ce0))[_0xdfe9('0x45')](handleError(_0x49b0be,null));};exports[_0xdfe9('0x46')]=function(_0x5c8304,_0x17991f){var _0x499ab0={'raw':![],'where':{'id':_0x5c8304[_0xdfe9('0x47')]['id']}},_0xd18a0c={};_0xd18a0c[_0xdfe9('0x36')]=_['keys'](db['FreshdeskAccount']['rawAttributes']);_0xd18a0c[_0xdfe9('0x31')]=_[_0xdfe9('0x32')](_0x5c8304[_0xdfe9('0x31')]);_0xd18a0c[_0xdfe9('0x33')]=_['intersection'](_0xd18a0c[_0xdfe9('0x36')],_0xd18a0c[_0xdfe9('0x31')]);_0x499ab0[_0xdfe9('0x35')]=_['intersection'](_0xd18a0c[_0xdfe9('0x36')],qs[_0xdfe9('0x37')](_0x5c8304[_0xdfe9('0x31')][_0xdfe9('0x37')]));_0x499ab0[_0xdfe9('0x35')]=_0x499ab0[_0xdfe9('0x35')][_0xdfe9('0x38')]?_0x499ab0['attributes']:_0xd18a0c[_0xdfe9('0x36')];if(_0x5c8304[_0xdfe9('0x31')][_0xdfe9('0x41')]){_0x499ab0[_0xdfe9('0x42')]=[{'all':!![]}];}_0x499ab0=_['merge']({},_0x499ab0,_0x5c8304[_0xdfe9('0x40')]);return db[_0xdfe9('0x2c')]['find'](_0x499ab0)[_0xdfe9('0x25')](handleEntityNotFound(_0x17991f,null))[_0xdfe9('0x25')](respondWithResult(_0x17991f,null))['catch'](handleError(_0x17991f,null));};exports['create']=function(_0x2f7b71,_0x3ca4c1){return db[_0xdfe9('0x2c')][_0xdfe9('0x48')](_0x2f7b71[_0xdfe9('0x49')],{})[_0xdfe9('0x25')](respondWithResult(_0x3ca4c1,0xc9))['catch'](handleError(_0x3ca4c1,null));};exports[_0xdfe9('0x24')]=function(_0x135c2e,_0x15f7ac){if(_0x135c2e['body']['id']){delete _0x135c2e[_0xdfe9('0x49')]['id'];}return db[_0xdfe9('0x2c')][_0xdfe9('0x4a')]({'where':{'id':_0x135c2e[_0xdfe9('0x47')]['id']}})[_0xdfe9('0x25')](handleEntityNotFound(_0x15f7ac,null))[_0xdfe9('0x25')](saveUpdates(_0x135c2e['body'],null))['then'](respondWithResult(_0x15f7ac,null))[_0xdfe9('0x45')](handleError(_0x15f7ac,null));};exports[_0xdfe9('0x26')]=function(_0x461b4f,_0x23555f){return db['FreshdeskAccount'][_0xdfe9('0x4a')]({'where':{'id':_0x461b4f['params']['id']}})['then'](handleEntityNotFound(_0x23555f,null))[_0xdfe9('0x25')](removeEntity(_0x23555f,null))[_0xdfe9('0x45')](handleError(_0x23555f,null));};exports['getConfigurations']=function(_0x5b71ba,_0x2a273f,_0x13562a){var _0x429724={};var _0x5d17a4={};var _0x8baf0a;var _0x48c049;return db[_0xdfe9('0x2c')][_0xdfe9('0x4b')]({'where':{'id':_0x5b71ba['params']['id']}})[_0xdfe9('0x25')](handleEntityNotFound(_0x2a273f,null))['then'](function(_0xa3a429){if(_0xa3a429){_0x8baf0a=_0xa3a429;_0x5d17a4[_0xdfe9('0x36')]=_[_0xdfe9('0x32')](db[_0xdfe9('0x4c')][_0xdfe9('0x4d')]);_0x5d17a4[_0xdfe9('0x31')]=_[_0xdfe9('0x32')](_0x5b71ba[_0xdfe9('0x31')]);_0x5d17a4[_0xdfe9('0x33')]=_['intersection'](_0x5d17a4[_0xdfe9('0x36')],_0x5d17a4[_0xdfe9('0x31')]);_0x429724[_0xdfe9('0x35')]=_[_0xdfe9('0x34')](_0x5d17a4[_0xdfe9('0x36')],qs['fields'](_0x5b71ba['query'][_0xdfe9('0x37')]));_0x429724[_0xdfe9('0x35')]=_0x429724[_0xdfe9('0x35')][_0xdfe9('0x38')]?_0x429724[_0xdfe9('0x35')]:_0x5d17a4[_0xdfe9('0x36')];_0x429724['order']=qs[_0xdfe9('0x3b')](_0x5b71ba[_0xdfe9('0x31')][_0xdfe9('0x3b')]);_0x429724['where']=qs['filters'](_[_0xdfe9('0x4e')](_0x5b71ba['query'],_0x5d17a4['filters']));if(_0x5b71ba[_0xdfe9('0x31')]['filter']){_0x429724[_0xdfe9('0x3d')]=_[_0xdfe9('0x3e')](_0x429724['where'],{'$or':_[_0xdfe9('0x2b')](_0x429724[_0xdfe9('0x35')],function(_0x45b445){var _0xfb7a08={};_0xfb7a08[_0x45b445]={'$like':'%'+_0x5b71ba[_0xdfe9('0x31')]['filter']+'%'};return _0xfb7a08;})});}_0x429724=_[_0xdfe9('0x3e')]({},_0x429724,_0x5b71ba['options']);return _0x8baf0a[_0xdfe9('0x4f')](_0x429724);}})[_0xdfe9('0x25')](function(_0x853aec){if(_0x853aec){_0x48c049=_0x853aec[_0xdfe9('0x38')];if(!_0x5b71ba[_0xdfe9('0x31')]['hasOwnProperty'](_0xdfe9('0x39'))){_0x429724[_0xdfe9('0x1f')]=qs['limit'](_0x5b71ba[_0xdfe9('0x31')][_0xdfe9('0x1f')]);_0x429724[_0xdfe9('0x1d')]=qs[_0xdfe9('0x1d')](_0x5b71ba[_0xdfe9('0x31')][_0xdfe9('0x1d')]);}return _0x8baf0a[_0xdfe9('0x4f')](_0x429724);}})[_0xdfe9('0x25')](function(_0x257c55){if(_0x257c55){return _0x257c55?{'count':_0x48c049,'rows':_0x257c55}:null;}})[_0xdfe9('0x25')](respondWithResult(_0x2a273f,null))[_0xdfe9('0x45')](handleError(_0x2a273f,null));};exports[_0xdfe9('0x50')]=function(_0xb186b1,_0x5e6b8c,_0x2a07a5){if(_0xb186b1[_0xdfe9('0x49')]['id']){delete _0xb186b1[_0xdfe9('0x49')]['id'];}return db[_0xdfe9('0x2c')][_0xdfe9('0x4b')]({'where':{'id':_0xb186b1[_0xdfe9('0x47')]['id']}})[_0xdfe9('0x25')](handleEntityNotFound(_0x5e6b8c,null))[_0xdfe9('0x25')](function(_0x40398d){if(_0x40398d){_0xb186b1['body'][_0xdfe9('0x51')]=_0x40398d['id'];_0xb186b1[_0xdfe9('0x49')][_0xdfe9('0x52')]=integrations[_0xdfe9('0x53')](_0xb186b1[_0xdfe9('0x49')][_0xdfe9('0x54')],_0xb186b1[_0xdfe9('0x49')]['type']);_0xb186b1['body'][_0xdfe9('0x55')]=integrations[_0xdfe9('0x56')](_0xb186b1[_0xdfe9('0x49')][_0xdfe9('0x54')],_0xb186b1[_0xdfe9('0x49')][_0xdfe9('0x2e')]);return db[_0xdfe9('0x4c')][_0xdfe9('0x48')](_0xb186b1[_0xdfe9('0x49')],{'include':[{'model':db['FreshdeskField'],'as':_0xdfe9('0x52')},{'model':db['FreshdeskField'],'as':_0xdfe9('0x55')}]});}return null;})['then'](respondWithResult(_0x5e6b8c,null))[_0xdfe9('0x45')](handleError(_0x5e6b8c,null));};exports[_0xdfe9('0x57')]=function(_0x5a81f9,_0xdf75fe,_0x2fc023){var _0xbcae65='';return db[_0xdfe9('0x2c')]['findOne']({'where':{'id':_0x5a81f9[_0xdfe9('0x47')]['id']},'attributes':['id','remoteUri','apiKey']})[_0xdfe9('0x25')](handleEntityNotFound(_0xdf75fe,null))[_0xdfe9('0x25')](function(_0x1bd0a3){if(_0x1bd0a3){_0xbcae65=_0x1bd0a3[_0xdfe9('0x58')];var _0x33a31f=_0xbcae65['slice'](-0x1);if(_0x33a31f==='/'){_0xbcae65=_0xbcae65['substring'](0x0,_0xbcae65[_0xdfe9('0x59')](_0x33a31f));}return rp({'method':'GET','uri':util[_0xdfe9('0x5a')](_0xdfe9('0x5b'),_0xbcae65,_0xdfe9('0x5c')),'headers':{'Authorization':util[_0xdfe9('0x5a')](_0xdfe9('0x5d'),new Buffer(util['format']('%s:X',_0x1bd0a3['apiKey']))['toString']('base64'))},'json':!![]});}})[_0xdfe9('0x25')](function(_0x6cb624){if(_0x6cb624){var _0x156bf7=['requester','subject',_0xdfe9('0x5e'),_0xdfe9('0x5f'),_0xdfe9('0x1c'),'priority',_0xdfe9('0x60'),_0xdfe9('0x61'),'ticket_type',_0xdfe9('0x60'),_0xdfe9('0x62')];_[_0xdfe9('0x63')](_0x6cb624,function(_0xe2ffe3){return _0x156bf7[_0xdfe9('0x64')](_0xe2ffe3[_0xdfe9('0x30')])||!_0xe2ffe3['default']&&_0xe2ffe3[_0xdfe9('0x2e')]!=='custom_text'&&_0xe2ffe3[_0xdfe9('0x2e')]!==_0xdfe9('0x65');});return{'count':_0x6cb624[_0xdfe9('0x38')],'rows':_['map'](_0x6cb624,function(_0x6cbe65){return{'id':_0x6cbe65[_0xdfe9('0x30')],'name':_0x6cbe65['label'],'custom':!_0x6cbe65['default'],'options':_0x6cbe65['choices']?_[_0xdfe9('0x2b')](_0x6cbe65[_0xdfe9('0x66')],function(_0xd33c87){return{'name':_[_0xdfe9('0x67')](_0xd33c87),'value':_0xd33c87};}):[]};})};}})[_0xdfe9('0x25')](respondWithResult(_0xdf75fe,null))[_0xdfe9('0x45')](function(_0x531025){var _0xb567c0=_0x5a81f9[_0xdfe9('0x31')][_0xdfe9('0x68')]?0x1f4:_0x531025[_0xdfe9('0x69')]||0x1f4;logger[_0xdfe9('0x27')](_0xdfe9('0x6a'),_0xdfe9('0x57'),_0xb567c0,JSON[_0xdfe9('0x6b')](_0x531025));delete _0x531025[_0xdfe9('0x30')];if(_0xb567c0===0x191){_0xb567c0=0x190;}_0xdf75fe[_0xdfe9('0x1c')](_0xb567c0)[_0xdfe9('0x29')](_0x5a81f9[_0xdfe9('0x31')]['test']?{'message':_0xdfe9('0x6c'),'statusCode':_0x531025[_0xdfe9('0x69')]}:_0x531025);});};
\ No newline at end of file
+var _0x3f59=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error','name','send','map','rawAttributes','type','key','model','query','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','params','keys','length','create','body','find','destroy','getConfigurations','findOne','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshdeskField','getFields','remoteUri','slice','substring','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','apiKey','toString','subject','agent','description','source','group','company','default','label','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials'];(function(_0x515bcd,_0x4ea1c1){var _0x5d21fa=function(_0x7d323a){while(--_0x7d323a){_0x515bcd['push'](_0x515bcd['shift']());}};_0x5d21fa(++_0x4ea1c1);}(_0x3f59,0x1b0));var _0x93f5=function(_0x6b63fe,_0x1d62ea){_0x6b63fe=_0x6b63fe-0x0;var _0x2532d3=_0x3f59[_0x6b63fe];return _0x2532d3;};'use strict';var emlformat=require(_0x93f5('0x0'));var rimraf=require(_0x93f5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93f5('0x2'));var rp=require(_0x93f5('0x3'));var moment=require(_0x93f5('0x4'));var BPromise=require(_0x93f5('0x5'));var Mustache=require(_0x93f5('0x6'));var util=require(_0x93f5('0x7'));var path=require(_0x93f5('0x8'));var sox=require(_0x93f5('0x9'));var csv=require(_0x93f5('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93f5('0xb'));var squel=require(_0x93f5('0xc'));var crypto=require(_0x93f5('0xd'));var jsforce=require(_0x93f5('0xe'));var deskjs=require(_0x93f5('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x93f5('0x10'));var qs=require(_0x93f5('0x11'));var as=require(_0x93f5('0x12'));var hardwareService=require(_0x93f5('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x93f5('0x14'));var config=require(_0x93f5('0x15'));var licenseUtil=require(_0x93f5('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x93f5('0x17'));function respondWithStatusCode(_0x4ea7b4,_0x3e7e84){_0x3e7e84=_0x3e7e84||0xcc;return function(_0x107b90){if(_0x107b90){return _0x4ea7b4[_0x93f5('0x18')](_0x3e7e84);}return _0x4ea7b4[_0x93f5('0x19')](_0x3e7e84)[_0x93f5('0x1a')]();};}function respondWithResult(_0x45a275,_0x5d6001){_0x5d6001=_0x5d6001||0xc8;return function(_0x108b11){if(_0x108b11){return _0x45a275[_0x93f5('0x19')](_0x5d6001)[_0x93f5('0x1b')](_0x108b11);}};}function respondWithFilteredResult(_0x2ab5ce,_0x316fb2){return function(_0x22bcd7){if(_0x22bcd7){var _0x36aa85=typeof _0x316fb2[_0x93f5('0x1c')]===_0x93f5('0x1d')&&typeof _0x316fb2[_0x93f5('0x1e')]===_0x93f5('0x1d');var _0x869415=_0x22bcd7['count'];var _0x8d8ffe=_0x36aa85?0x0:_0x316fb2[_0x93f5('0x1c')];var _0x45eac3=_0x36aa85?_0x22bcd7[_0x93f5('0x1f')]:_0x316fb2[_0x93f5('0x1c')]+_0x316fb2['limit'];var _0x34edb9;if(_0x45eac3>=_0x869415){_0x45eac3=_0x869415;_0x34edb9=0xc8;}else{_0x34edb9=0xce;}_0x2ab5ce[_0x93f5('0x19')](_0x34edb9);return _0x2ab5ce[_0x93f5('0x20')](_0x93f5('0x21'),_0x8d8ffe+'-'+_0x45eac3+'/'+_0x869415)[_0x93f5('0x1b')](_0x22bcd7);}return null;};}function patchUpdates(_0xb44720){return function(_0x17e4ef){try{jsonpatch[_0x93f5('0x22')](_0x17e4ef,_0xb44720,!![]);}catch(_0x466ad7){return BPromise[_0x93f5('0x23')](_0x466ad7);}return _0x17e4ef[_0x93f5('0x24')]();};}function saveUpdates(_0xb59065,_0x330869){return function(_0x5b1a1f){if(_0x5b1a1f){return _0x5b1a1f[_0x93f5('0x25')](_0xb59065)[_0x93f5('0x26')](function(_0x34f8ce){return _0x34f8ce;});}return null;};}function removeEntity(_0x3ffe51,_0x365afd){return function(_0x1b4576){if(_0x1b4576){return _0x1b4576['destroy']()[_0x93f5('0x26')](function(){_0x3ffe51[_0x93f5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x107d91,_0x43fad9){return function(_0x57ae09){if(!_0x57ae09){_0x107d91['sendStatus'](0x194);}return _0x57ae09;};}function handleError(_0x403b45,_0x11e86c){_0x11e86c=_0x11e86c||0x1f4;return function(_0x469968){logger[_0x93f5('0x27')](_0x469968['stack']);if(_0x469968[_0x93f5('0x28')]){delete _0x469968['name'];}_0x403b45[_0x93f5('0x19')](_0x11e86c)[_0x93f5('0x29')](_0x469968);};}exports['index']=function(_0x36d579,_0x95e47e){var _0x136dc4={},_0x5e5cb5={},_0x3090a9={'count':0x0,'rows':[]};var _0x4883c6=_[_0x93f5('0x2a')](db['FreshdeskAccount'][_0x93f5('0x2b')],function(_0x2484bc){return{'name':_0x2484bc['fieldName'],'type':_0x2484bc[_0x93f5('0x2c')][_0x93f5('0x2d')]};});_0x5e5cb5[_0x93f5('0x2e')]=_[_0x93f5('0x2a')](_0x4883c6,'name');_0x5e5cb5[_0x93f5('0x2f')]=_['keys'](_0x36d579[_0x93f5('0x2f')]);_0x5e5cb5['filters']=_[_0x93f5('0x30')](_0x5e5cb5[_0x93f5('0x2e')],_0x5e5cb5[_0x93f5('0x2f')]);_0x136dc4[_0x93f5('0x31')]=_['intersection'](_0x5e5cb5[_0x93f5('0x2e')],qs[_0x93f5('0x32')](_0x36d579[_0x93f5('0x2f')][_0x93f5('0x32')]));_0x136dc4['attributes']=_0x136dc4[_0x93f5('0x31')]['length']?_0x136dc4[_0x93f5('0x31')]:_0x5e5cb5[_0x93f5('0x2e')];if(!_0x36d579[_0x93f5('0x2f')][_0x93f5('0x33')]('nolimit')){_0x136dc4[_0x93f5('0x1e')]=qs['limit'](_0x36d579[_0x93f5('0x2f')]['limit']);_0x136dc4['offset']=qs[_0x93f5('0x1c')](_0x36d579[_0x93f5('0x2f')][_0x93f5('0x1c')]);}_0x136dc4['order']=qs[_0x93f5('0x34')](_0x36d579[_0x93f5('0x2f')]['sort']);_0x136dc4[_0x93f5('0x35')]=qs['filters'](_[_0x93f5('0x36')](_0x36d579['query'],_0x5e5cb5[_0x93f5('0x37')]),_0x4883c6);if(_0x36d579[_0x93f5('0x2f')][_0x93f5('0x38')]){_0x136dc4[_0x93f5('0x35')]=_[_0x93f5('0x39')](_0x136dc4['where'],{'$or':_[_0x93f5('0x2a')](_0x4883c6,function(_0x364b5d){if(_0x364b5d[_0x93f5('0x2c')]!==_0x93f5('0x3a')){var _0x5c8687={};_0x5c8687[_0x364b5d[_0x93f5('0x28')]]={'$like':'%'+_0x36d579['query'][_0x93f5('0x38')]+'%'};return _0x5c8687;}})});}_0x136dc4=_[_0x93f5('0x39')]({},_0x136dc4,_0x36d579[_0x93f5('0x3b')]);var _0x1a6e28={'where':_0x136dc4[_0x93f5('0x35')]};return db[_0x93f5('0x3c')]['count'](_0x1a6e28)[_0x93f5('0x26')](function(_0x4f45d8){_0x3090a9[_0x93f5('0x1f')]=_0x4f45d8;if(_0x36d579[_0x93f5('0x2f')]['includeAll']){_0x136dc4[_0x93f5('0x3d')]=[{'all':!![]}];}return db[_0x93f5('0x3c')][_0x93f5('0x3e')](_0x136dc4);})[_0x93f5('0x26')](function(_0x53958b){_0x3090a9[_0x93f5('0x3f')]=_0x53958b;return _0x3090a9;})['then'](respondWithFilteredResult(_0x95e47e,_0x136dc4))[_0x93f5('0x40')](handleError(_0x95e47e,null));};exports[_0x93f5('0x41')]=function(_0x283261,_0x24d2dc){var _0xd4d915={'raw':![],'where':{'id':_0x283261[_0x93f5('0x42')]['id']}},_0x1d4c11={};_0x1d4c11['model']=_[_0x93f5('0x43')](db[_0x93f5('0x3c')][_0x93f5('0x2b')]);_0x1d4c11[_0x93f5('0x2f')]=_[_0x93f5('0x43')](_0x283261[_0x93f5('0x2f')]);_0x1d4c11[_0x93f5('0x37')]=_[_0x93f5('0x30')](_0x1d4c11['model'],_0x1d4c11['query']);_0xd4d915[_0x93f5('0x31')]=_['intersection'](_0x1d4c11[_0x93f5('0x2e')],qs['fields'](_0x283261[_0x93f5('0x2f')][_0x93f5('0x32')]));_0xd4d915['attributes']=_0xd4d915['attributes'][_0x93f5('0x44')]?_0xd4d915['attributes']:_0x1d4c11[_0x93f5('0x2e')];if(_0x283261[_0x93f5('0x2f')]['includeAll']){_0xd4d915[_0x93f5('0x3d')]=[{'all':!![]}];}_0xd4d915=_[_0x93f5('0x39')]({},_0xd4d915,_0x283261[_0x93f5('0x3b')]);return db[_0x93f5('0x3c')]['find'](_0xd4d915)[_0x93f5('0x26')](handleEntityNotFound(_0x24d2dc,null))['then'](respondWithResult(_0x24d2dc,null))[_0x93f5('0x40')](handleError(_0x24d2dc,null));};exports[_0x93f5('0x45')]=function(_0x548ee2,_0x5be105){return db[_0x93f5('0x3c')][_0x93f5('0x45')](_0x548ee2['body'],{})[_0x93f5('0x26')](respondWithResult(_0x5be105,0xc9))[_0x93f5('0x40')](handleError(_0x5be105,null));};exports[_0x93f5('0x25')]=function(_0x576500,_0x544091){if(_0x576500[_0x93f5('0x46')]['id']){delete _0x576500[_0x93f5('0x46')]['id'];}return db['FreshdeskAccount'][_0x93f5('0x47')]({'where':{'id':_0x576500['params']['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x544091,null))[_0x93f5('0x26')](saveUpdates(_0x576500[_0x93f5('0x46')],null))[_0x93f5('0x26')](respondWithResult(_0x544091,null))[_0x93f5('0x40')](handleError(_0x544091,null));};exports[_0x93f5('0x48')]=function(_0x970bcf,_0x14e053){return db[_0x93f5('0x3c')][_0x93f5('0x47')]({'where':{'id':_0x970bcf[_0x93f5('0x42')]['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x14e053,null))[_0x93f5('0x26')](removeEntity(_0x14e053,null))[_0x93f5('0x40')](handleError(_0x14e053,null));};exports[_0x93f5('0x49')]=function(_0xd2d30a,_0x178b03,_0x389f31){var _0x2f81c2={};var _0x57cff5={};var _0x26507f;var _0x4c0810;return db['FreshdeskAccount'][_0x93f5('0x4a')]({'where':{'id':_0xd2d30a['params']['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x178b03,null))['then'](function(_0x4366d7){if(_0x4366d7){_0x26507f=_0x4366d7;_0x57cff5[_0x93f5('0x2e')]=_['keys'](db['FreshdeskConfiguration'][_0x93f5('0x2b')]);_0x57cff5['query']=_[_0x93f5('0x43')](_0xd2d30a[_0x93f5('0x2f')]);_0x57cff5[_0x93f5('0x37')]=_['intersection'](_0x57cff5['model'],_0x57cff5[_0x93f5('0x2f')]);_0x2f81c2['attributes']=_['intersection'](_0x57cff5['model'],qs['fields'](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x32')]));_0x2f81c2[_0x93f5('0x31')]=_0x2f81c2[_0x93f5('0x31')]['length']?_0x2f81c2['attributes']:_0x57cff5['model'];_0x2f81c2[_0x93f5('0x4b')]=qs[_0x93f5('0x34')](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x34')]);_0x2f81c2[_0x93f5('0x35')]=qs[_0x93f5('0x37')](_['pick'](_0xd2d30a['query'],_0x57cff5['filters']));if(_0xd2d30a[_0x93f5('0x2f')]['filter']){_0x2f81c2[_0x93f5('0x35')]=_['merge'](_0x2f81c2[_0x93f5('0x35')],{'$or':_[_0x93f5('0x2a')](_0x2f81c2[_0x93f5('0x31')],function(_0x204467){var _0x5eb615={};_0x5eb615[_0x204467]={'$like':'%'+_0xd2d30a['query'][_0x93f5('0x38')]+'%'};return _0x5eb615;})});}_0x2f81c2=_[_0x93f5('0x39')]({},_0x2f81c2,_0xd2d30a[_0x93f5('0x3b')]);return _0x26507f[_0x93f5('0x49')](_0x2f81c2);}})[_0x93f5('0x26')](function(_0x246484){if(_0x246484){_0x4c0810=_0x246484[_0x93f5('0x44')];if(!_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x33')](_0x93f5('0x4c'))){_0x2f81c2[_0x93f5('0x1e')]=qs[_0x93f5('0x1e')](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x1e')]);_0x2f81c2[_0x93f5('0x1c')]=qs[_0x93f5('0x1c')](_0xd2d30a[_0x93f5('0x2f')][_0x93f5('0x1c')]);}return _0x26507f[_0x93f5('0x49')](_0x2f81c2);}})[_0x93f5('0x26')](function(_0x5ad360){if(_0x5ad360){return _0x5ad360?{'count':_0x4c0810,'rows':_0x5ad360}:null;}})['then'](respondWithResult(_0x178b03,null))['catch'](handleError(_0x178b03,null));};exports[_0x93f5('0x4d')]=function(_0x1296b0,_0x49e4a1,_0x2882d7){if(_0x1296b0[_0x93f5('0x46')]['id']){delete _0x1296b0[_0x93f5('0x46')]['id'];}return db[_0x93f5('0x3c')][_0x93f5('0x4a')]({'where':{'id':_0x1296b0['params']['id']}})[_0x93f5('0x26')](handleEntityNotFound(_0x49e4a1,null))[_0x93f5('0x26')](function(_0x251f7a){if(_0x251f7a){_0x1296b0[_0x93f5('0x46')][_0x93f5('0x4e')]=_0x251f7a['id'];_0x1296b0[_0x93f5('0x46')][_0x93f5('0x4f')]=integrations[_0x93f5('0x50')](_0x1296b0['body'][_0x93f5('0x51')],_0x1296b0[_0x93f5('0x46')][_0x93f5('0x2c')]);_0x1296b0['body'][_0x93f5('0x52')]=integrations['getDescriptions'](_0x1296b0['body'][_0x93f5('0x51')],_0x1296b0[_0x93f5('0x46')][_0x93f5('0x2c')]);return db['FreshdeskConfiguration'][_0x93f5('0x45')](_0x1296b0[_0x93f5('0x46')],{'include':[{'model':db[_0x93f5('0x53')],'as':'Subjects'},{'model':db[_0x93f5('0x53')],'as':_0x93f5('0x52')}]});}return null;})[_0x93f5('0x26')](respondWithResult(_0x49e4a1,null))['catch'](handleError(_0x49e4a1,null));};exports[_0x93f5('0x54')]=function(_0x1c5fd4,_0x30d670,_0x365520){var _0x28cff8='';return db[_0x93f5('0x3c')]['findOne']({'where':{'id':_0x1c5fd4[_0x93f5('0x42')]['id']},'attributes':['id',_0x93f5('0x55'),'apiKey']})[_0x93f5('0x26')](handleEntityNotFound(_0x30d670,null))[_0x93f5('0x26')](function(_0x1290e4){if(_0x1290e4){_0x28cff8=_0x1290e4[_0x93f5('0x55')];var _0x18f25d=_0x28cff8[_0x93f5('0x56')](-0x1);if(_0x18f25d==='/'){_0x28cff8=_0x28cff8[_0x93f5('0x57')](0x0,_0x28cff8['lastIndexOf'](_0x18f25d));}return rp({'method':_0x93f5('0x58'),'uri':util['format'](_0x93f5('0x59'),_0x28cff8,_0x93f5('0x5a')),'headers':{'Authorization':util[_0x93f5('0x5b')](_0x93f5('0x5c'),new Buffer(util[_0x93f5('0x5b')]('%s:X',_0x1290e4[_0x93f5('0x5d')]))[_0x93f5('0x5e')]('base64'))},'json':!![]});}})[_0x93f5('0x26')](function(_0x2cf8c5){if(_0x2cf8c5){var _0x48b41b=['requester',_0x93f5('0x5f'),_0x93f5('0x60'),_0x93f5('0x61'),_0x93f5('0x19'),'priority','group',_0x93f5('0x62'),'ticket_type',_0x93f5('0x63'),_0x93f5('0x64')];_['remove'](_0x2cf8c5,function(_0x385392){return _0x48b41b['includes'](_0x385392[_0x93f5('0x28')])||!_0x385392[_0x93f5('0x65')]&&_0x385392[_0x93f5('0x2c')]!=='custom_text'&&_0x385392[_0x93f5('0x2c')]!=='custom_dropdown';});return{'count':_0x2cf8c5[_0x93f5('0x44')],'rows':_[_0x93f5('0x2a')](_0x2cf8c5,function(_0x13c1df){return{'id':_0x13c1df[_0x93f5('0x28')],'name':_0x13c1df[_0x93f5('0x66')],'custom':!_0x13c1df[_0x93f5('0x65')],'options':_0x13c1df['choices']?_[_0x93f5('0x2a')](_0x13c1df[_0x93f5('0x67')],function(_0x149fec){return{'name':_['capitalize'](_0x149fec),'value':_0x149fec};}):[]};})};}})[_0x93f5('0x26')](respondWithResult(_0x30d670,null))[_0x93f5('0x40')](function(_0xfaac55){var _0x57e0c4=_0x1c5fd4[_0x93f5('0x2f')][_0x93f5('0x68')]?0x1f4:_0xfaac55[_0x93f5('0x69')]||0x1f4;logger['error'](_0x93f5('0x6a'),_0x93f5('0x54'),_0x57e0c4,JSON['stringify'](_0xfaac55));delete _0xfaac55[_0x93f5('0x28')];if(_0x57e0c4===0x191){_0x57e0c4=0x190;}_0x30d670[_0x93f5('0x19')](_0x57e0c4)[_0x93f5('0x29')](_0x1c5fd4[_0x93f5('0x2f')]['test']?{'message':_0x93f5('0x6b'),'statusCode':_0xfaac55[_0x93f5('0x69')]}:_0xfaac55);});};
\ No newline at end of file
index 78cdce0..cbe3dde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b25=['rimraf','../../config/environment','../../components/integrations/configuration','exports','int_freshdesk_accounts','../../config/logger','api','moment','request-promise','path'];(function(_0x2f4348,_0x3139f5){var _0x4b33e2=function(_0x540803){while(--_0x540803){_0x2f4348['push'](_0x2f4348['shift']());}};_0x4b33e2(++_0x3139f5);}(_0x2b25,0x13b));var _0x52b2=function(_0x1526a9,_0x48fb64){_0x1526a9=_0x1526a9-0x0;var _0x9f4049=_0x2b25[_0x1526a9];return _0x9f4049;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x52b2('0x0'))(_0x52b2('0x1'));var moment=require(_0x52b2('0x2'));var BPromise=require('bluebird');var rp=require(_0x52b2('0x3'));var fs=require('fs');var path=require(_0x52b2('0x4'));var rimraf=require(_0x52b2('0x5'));var config=require(_0x52b2('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x52b2('0x7'));module[_0x52b2('0x8')]=function(_0x351dfd,_0x194bb1){return _0x351dfd['define']('FreshdeskAccount',attributes,{'tableName':_0x52b2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe8c4=['path','rimraf','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts','util','moment'];(function(_0x439368,_0x49fbba){var _0x3e8b1c=function(_0x4b9f9d){while(--_0x4b9f9d){_0x439368['push'](_0x439368['shift']());}};_0x3e8b1c(++_0x49fbba);}(_0xe8c4,0xe6));var _0x4e8c=function(_0x1aa56e,_0x68a659){_0x1aa56e=_0x1aa56e-0x0;var _0x1e845d=_0xe8c4[_0x1aa56e];return _0x1e845d;};'use strict';var _=require('lodash');var util=require(_0x4e8c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4e8c('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e8c('0x2'));var rimraf=require(_0x4e8c('0x3'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x4e8c('0x4'));module['exports']=function(_0x3d5829,_0xc1e9b0){return _0x3d5829[_0x4e8c('0x5')](_0x4e8c('0x6'),attributes,{'tableName':_0x4e8c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b355f6c..e040877 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bba=['limit','include','map','model','stringify','catch','ShowFreshdeskAccount','find','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','attributes'];(function(_0x44e8bd,_0x338a3d){var _0x418acd=function(_0x47bded){while(--_0x47bded){_0x44e8bd['push'](_0x44e8bd['shift']());}};_0x418acd(++_0x338a3d);}(_0x0bba,0x143));var _0xa0bb=function(_0x80fae3,_0x5b4121){_0x80fae3=_0x80fae3-0x0;var _0x1a88d5=_0x0bba[_0x80fae3];return _0x1a88d5;};'use strict';var _=require('lodash');var util=require(_0xa0bb('0x0'));var moment=require(_0xa0bb('0x1'));var BPromise=require(_0xa0bb('0x2'));var rs=require(_0xa0bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa0bb('0x4'))['db'];var utils=require(_0xa0bb('0x5'));var logger=require(_0xa0bb('0x6'))(_0xa0bb('0x7'));var config=require(_0xa0bb('0x8'));var jayson=require(_0xa0bb('0x9'));var client=jayson['client'][_0xa0bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18461e,_0x289c4b,_0x379506){return new BPromise(function(_0x196386,_0x3e2a2b){return client[_0xa0bb('0xb')](_0x18461e,_0x379506)[_0xa0bb('0xc')](function(_0x15f38b){logger[_0xa0bb('0xd')](_0xa0bb('0xe'),_0x289c4b,_0xa0bb('0xf'));logger[_0xa0bb('0x10')](_0xa0bb('0x11'),_0x289c4b,'request\x20sent',JSON['stringify'](_0x15f38b));if(_0x15f38b[_0xa0bb('0x12')]){if(_0x15f38b[_0xa0bb('0x12')]['code']===0x1f4){logger[_0xa0bb('0x12')](_0xa0bb('0xe'),_0x289c4b,_0x15f38b[_0xa0bb('0x12')][_0xa0bb('0x13')]);return _0x3e2a2b(_0x15f38b[_0xa0bb('0x12')]['message']);}logger[_0xa0bb('0x12')](_0xa0bb('0xe'),_0x289c4b,_0x15f38b['error'][_0xa0bb('0x13')]);return _0x196386(_0x15f38b[_0xa0bb('0x12')][_0xa0bb('0x13')]);}else{logger[_0xa0bb('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x289c4b,_0xa0bb('0xf'));_0x196386(_0x15f38b[_0xa0bb('0x14')]['message']);}})['catch'](function(_0x2832e1){logger['error']('FreshdeskAccount,\x20%s,\x20%s',_0x289c4b,_0x2832e1);_0x3e2a2b(_0x2832e1);});});}exports[_0xa0bb('0x15')]=function(_0x2d9f9d){var _0x11f234=this;return new Promise(function(_0x1c1c4b,_0x2c98e1){return db[_0xa0bb('0x16')][_0xa0bb('0x17')]({'raw':_0x2d9f9d[_0xa0bb('0x18')]?_0x2d9f9d[_0xa0bb('0x18')][_0xa0bb('0x19')]===undefined?!![]:![]:!![],'where':_0x2d9f9d[_0xa0bb('0x18')]?_0x2d9f9d[_0xa0bb('0x18')]['where']||null:null,'attributes':_0x2d9f9d[_0xa0bb('0x18')]?_0x2d9f9d[_0xa0bb('0x18')][_0xa0bb('0x1a')]||null:null,'limit':_0x2d9f9d['options']?_0x2d9f9d['options'][_0xa0bb('0x1b')]||null:null,'include':_0x2d9f9d[_0xa0bb('0x18')]?_0x2d9f9d['options'][_0xa0bb('0x1c')]?_[_0xa0bb('0x1d')](_0x2d9f9d['options'][_0xa0bb('0x1c')],function(_0x50e8b3){return{'model':db[_0x50e8b3[_0xa0bb('0x1e')]],'as':_0x50e8b3['as'],'attributes':_0x50e8b3[_0xa0bb('0x1a')],'include':_0x50e8b3['include']?_[_0xa0bb('0x1d')](_0x50e8b3['include'],function(_0x318e5f){return{'model':db[_0x318e5f[_0xa0bb('0x1e')]],'as':_0x318e5f['as'],'attributes':_0x318e5f[_0xa0bb('0x1a')],'include':_0x318e5f['include']?_[_0xa0bb('0x1d')](_0x318e5f[_0xa0bb('0x1c')],function(_0x1ab53b){return{'model':db[_0x1ab53b[_0xa0bb('0x1e')]],'as':_0x1ab53b['as'],'attributes':_0x1ab53b[_0xa0bb('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe699f4){logger['info']('GetFreshdeskAccount',_0x2d9f9d);logger[_0xa0bb('0x10')](_0xa0bb('0x15'),_0x2d9f9d,JSON[_0xa0bb('0x1f')](_0xe699f4));_0x1c1c4b(_0xe699f4);})[_0xa0bb('0x20')](function(_0x546c80){logger['error'](_0xa0bb('0x15'),_0x546c80[_0xa0bb('0x13')],_0x2d9f9d);_0x2c98e1(_0x11f234['error'](0x1f4,_0x546c80[_0xa0bb('0x13')]));});});};exports[_0xa0bb('0x21')]=function(_0x1bb646){var _0x59effa=this;return new Promise(function(_0xd7ddad,_0x188045){return db['FreshdeskAccount'][_0xa0bb('0x22')]({'raw':_0x1bb646[_0xa0bb('0x18')]?_0x1bb646['options'][_0xa0bb('0x19')]===undefined?!![]:![]:!![],'where':_0x1bb646['options']?_0x1bb646[_0xa0bb('0x18')]['where']||null:null,'attributes':_0x1bb646[_0xa0bb('0x18')]?_0x1bb646['options'][_0xa0bb('0x1a')]||null:null,'include':_0x1bb646['options']?_0x1bb646[_0xa0bb('0x18')][_0xa0bb('0x1c')]?_[_0xa0bb('0x1d')](_0x1bb646[_0xa0bb('0x18')][_0xa0bb('0x1c')],function(_0xb56982){return{'model':db[_0xb56982[_0xa0bb('0x1e')]],'as':_0xb56982['as'],'attributes':_0xb56982[_0xa0bb('0x1a')],'include':_0xb56982['include']?_['map'](_0xb56982['include'],function(_0x237e33){return{'model':db[_0x237e33[_0xa0bb('0x1e')]],'as':_0x237e33['as'],'attributes':_0x237e33['attributes'],'include':_0x237e33[_0xa0bb('0x1c')]?_['map'](_0x237e33[_0xa0bb('0x1c')],function(_0x212b41){return{'model':db[_0x212b41[_0xa0bb('0x1e')]],'as':_0x212b41['as'],'attributes':_0x212b41[_0xa0bb('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa0bb('0xc')](function(_0x369b84){logger[_0xa0bb('0xd')](_0xa0bb('0x21'),_0x1bb646);logger['debug'](_0xa0bb('0x21'),_0x1bb646,JSON['stringify'](_0x369b84));_0xd7ddad(_0x369b84);})[_0xa0bb('0x20')](function(_0x29c733){logger[_0xa0bb('0x12')]('ShowFreshdeskAccount',_0x29c733['message'],_0x1bb646);_0x188045(_0x59effa['error'](0x1f4,_0x29c733[_0xa0bb('0x13')]));});});};
\ No newline at end of file
+var _0x0a20=['map','ShowFreshdeskAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','request\x20sent','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','include','model'];(function(_0x401642,_0x58fbf3){var _0x572e85=function(_0x14968e){while(--_0x14968e){_0x401642['push'](_0x401642['shift']());}};_0x572e85(++_0x58fbf3);}(_0x0a20,0x65));var _0x00a2=function(_0x1ce7e9,_0x5f1f2a){_0x1ce7e9=_0x1ce7e9-0x0;var _0x3d786c=_0x0a20[_0x1ce7e9];return _0x3d786c;};'use strict';var _=require(_0x00a2('0x0'));var util=require(_0x00a2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x00a2('0x2'));var fs=require('fs');var Redis=require(_0x00a2('0x3'));var db=require(_0x00a2('0x4'))['db'];var utils=require(_0x00a2('0x5'));var logger=require(_0x00a2('0x6'))(_0x00a2('0x7'));var config=require(_0x00a2('0x8'));var jayson=require(_0x00a2('0x9'));var client=jayson[_0x00a2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22068b,_0x41298f,_0x186241){return new BPromise(function(_0x2fc422,_0x34cfcf){return client['request'](_0x22068b,_0x186241)[_0x00a2('0xb')](function(_0x47a5ad){logger[_0x00a2('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x41298f,'request\x20sent');logger[_0x00a2('0xd')](_0x00a2('0xe'),_0x41298f,'request\x20sent',JSON[_0x00a2('0xf')](_0x47a5ad));if(_0x47a5ad[_0x00a2('0x10')]){if(_0x47a5ad[_0x00a2('0x10')][_0x00a2('0x11')]===0x1f4){logger['error'](_0x00a2('0x12'),_0x41298f,_0x47a5ad[_0x00a2('0x10')]['message']);return _0x34cfcf(_0x47a5ad[_0x00a2('0x10')][_0x00a2('0x13')]);}logger[_0x00a2('0x10')](_0x00a2('0x12'),_0x41298f,_0x47a5ad[_0x00a2('0x10')][_0x00a2('0x13')]);return _0x2fc422(_0x47a5ad[_0x00a2('0x10')]['message']);}else{logger[_0x00a2('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x41298f,_0x00a2('0x14'));_0x2fc422(_0x47a5ad['result']['message']);}})[_0x00a2('0x15')](function(_0x3a6c5e){logger[_0x00a2('0x10')](_0x00a2('0x12'),_0x41298f,_0x3a6c5e);_0x34cfcf(_0x3a6c5e);});});}exports[_0x00a2('0x16')]=function(_0x3e03c4){var _0x49c476=this;return new Promise(function(_0x52249c,_0x462c27){return db[_0x00a2('0x17')][_0x00a2('0x18')]({'raw':_0x3e03c4[_0x00a2('0x19')]?_0x3e03c4[_0x00a2('0x19')][_0x00a2('0x1a')]===undefined?!![]:![]:!![],'where':_0x3e03c4[_0x00a2('0x19')]?_0x3e03c4[_0x00a2('0x19')][_0x00a2('0x1b')]||null:null,'attributes':_0x3e03c4[_0x00a2('0x19')]?_0x3e03c4[_0x00a2('0x19')][_0x00a2('0x1c')]||null:null,'limit':_0x3e03c4['options']?_0x3e03c4[_0x00a2('0x19')]['limit']||null:null,'include':_0x3e03c4[_0x00a2('0x19')]?_0x3e03c4[_0x00a2('0x19')][_0x00a2('0x1d')]?_['map'](_0x3e03c4['options'][_0x00a2('0x1d')],function(_0x585b55){return{'model':db[_0x585b55[_0x00a2('0x1e')]],'as':_0x585b55['as'],'attributes':_0x585b55[_0x00a2('0x1c')],'include':_0x585b55['include']?_[_0x00a2('0x1f')](_0x585b55[_0x00a2('0x1d')],function(_0x18fe7f){return{'model':db[_0x18fe7f[_0x00a2('0x1e')]],'as':_0x18fe7f['as'],'attributes':_0x18fe7f[_0x00a2('0x1c')],'include':_0x18fe7f[_0x00a2('0x1d')]?_[_0x00a2('0x1f')](_0x18fe7f[_0x00a2('0x1d')],function(_0x140a5d){return{'model':db[_0x140a5d['model']],'as':_0x140a5d['as'],'attributes':_0x140a5d[_0x00a2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x00a2('0xb')](function(_0x157186){logger[_0x00a2('0xc')](_0x00a2('0x16'),_0x3e03c4);logger[_0x00a2('0xd')](_0x00a2('0x16'),_0x3e03c4,JSON[_0x00a2('0xf')](_0x157186));_0x52249c(_0x157186);})[_0x00a2('0x15')](function(_0x23ac51){logger[_0x00a2('0x10')](_0x00a2('0x16'),_0x23ac51[_0x00a2('0x13')],_0x3e03c4);_0x462c27(_0x49c476[_0x00a2('0x10')](0x1f4,_0x23ac51['message']));});});};exports[_0x00a2('0x20')]=function(_0x1ec3cb){var _0x2fdd63=this;return new Promise(function(_0x5b69e8,_0x51858e){return db[_0x00a2('0x17')]['find']({'raw':_0x1ec3cb['options']?_0x1ec3cb[_0x00a2('0x19')][_0x00a2('0x1a')]===undefined?!![]:![]:!![],'where':_0x1ec3cb['options']?_0x1ec3cb[_0x00a2('0x19')][_0x00a2('0x1b')]||null:null,'attributes':_0x1ec3cb['options']?_0x1ec3cb[_0x00a2('0x19')][_0x00a2('0x1c')]||null:null,'include':_0x1ec3cb['options']?_0x1ec3cb[_0x00a2('0x19')][_0x00a2('0x1d')]?_[_0x00a2('0x1f')](_0x1ec3cb[_0x00a2('0x19')][_0x00a2('0x1d')],function(_0x385a93){return{'model':db[_0x385a93['model']],'as':_0x385a93['as'],'attributes':_0x385a93[_0x00a2('0x1c')],'include':_0x385a93[_0x00a2('0x1d')]?_[_0x00a2('0x1f')](_0x385a93[_0x00a2('0x1d')],function(_0x52bc55){return{'model':db[_0x52bc55[_0x00a2('0x1e')]],'as':_0x52bc55['as'],'attributes':_0x52bc55['attributes'],'include':_0x52bc55[_0x00a2('0x1d')]?_[_0x00a2('0x1f')](_0x52bc55[_0x00a2('0x1d')],function(_0x3b5a4a){return{'model':db[_0x3b5a4a['model']],'as':_0x3b5a4a['as'],'attributes':_0x3b5a4a[_0x00a2('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x00a2('0xb')](function(_0x355679){logger['info'](_0x00a2('0x20'),_0x1ec3cb);logger['debug'](_0x00a2('0x20'),_0x1ec3cb,JSON[_0x00a2('0xf')](_0x355679));_0x5b69e8(_0x355679);})[_0x00a2('0x15')](function(_0x333946){logger['error'](_0x00a2('0x20'),_0x333946['message'],_0x1ec3cb);_0x51858e(_0x2fdd63[_0x00a2('0x10')](0x1f4,_0x333946[_0x00a2('0x13')]));});});};
\ No newline at end of file
index 8c7f10c..68fd55e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a4a=['../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x41852b,_0x455df4){var _0x1ead7d=function(_0x3fc6ad){while(--_0x3fc6ad){_0x41852b['push'](_0x41852b['shift']());}};_0x1ead7d(++_0x455df4);}(_0x5a4a,0x90));var _0xa5a4=function(_0x41d09a,_0x2a2699){_0x41d09a=_0x41d09a-0x0;var _0x26e807=_0x5a4a[_0x41d09a];return _0x26e807;};'use strict';var multer=require(_0xa5a4('0x0'));var util=require('util');var path=require(_0xa5a4('0x1'));var timeout=require(_0xa5a4('0x2'));var express=require(_0xa5a4('0x3'));var router=express[_0xa5a4('0x4')]();var fs_extra=require(_0xa5a4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa5a4('0x6'));var config=require(_0xa5a4('0x7'));var controller=require(_0xa5a4('0x8'));router[_0xa5a4('0x9')]('/',auth[_0xa5a4('0xa')](),controller['index']);router['get'](_0xa5a4('0xb'),auth[_0xa5a4('0xa')](),controller['show']);router[_0xa5a4('0x9')](_0xa5a4('0xc'),auth[_0xa5a4('0xa')](),controller[_0xa5a4('0xd')]);router[_0xa5a4('0x9')]('/:id/subjects',auth[_0xa5a4('0xa')](),controller[_0xa5a4('0xe')]);router[_0xa5a4('0x9')](_0xa5a4('0xf'),auth[_0xa5a4('0xa')](),controller[_0xa5a4('0x10')]);router[_0xa5a4('0x9')](_0xa5a4('0x11'),auth['isAuthenticated'](),controller['getTags']);router['post']('/',auth[_0xa5a4('0xa')](),controller[_0xa5a4('0x12')]);router[_0xa5a4('0x13')](_0xa5a4('0x11'),auth[_0xa5a4('0xa')](),controller['setTags']);router[_0xa5a4('0x14')](_0xa5a4('0xb'),auth[_0xa5a4('0xa')](),controller[_0xa5a4('0x15')]);router[_0xa5a4('0x16')](_0xa5a4('0xb'),auth[_0xa5a4('0xa')](),controller[_0xa5a4('0x17')]);module[_0xa5a4('0x18')]=router;
\ No newline at end of file
+var _0x1444=['getTags','post','setTags','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags'];(function(_0x1d149a,_0x4215cd){var _0x12c67a=function(_0x1db9d2){while(--_0x1db9d2){_0x1d149a['push'](_0x1d149a['shift']());}};_0x12c67a(++_0x4215cd);}(_0x1444,0x163));var _0x4144=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x1444[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x4144('0x0'));var util=require(_0x4144('0x1'));var path=require('path');var timeout=require(_0x4144('0x2'));var express=require(_0x4144('0x3'));var router=express[_0x4144('0x4')]();var fs_extra=require(_0x4144('0x5'));var auth=require(_0x4144('0x6'));var interaction=require(_0x4144('0x7'));var config=require(_0x4144('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x4144('0x9')]('/',auth[_0x4144('0xa')](),controller[_0x4144('0xb')]);router['get'](_0x4144('0xc'),auth[_0x4144('0xa')](),controller[_0x4144('0xd')]);router[_0x4144('0x9')](_0x4144('0xe'),auth[_0x4144('0xa')](),controller[_0x4144('0xf')]);router[_0x4144('0x9')](_0x4144('0x10'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x4144('0x9')](_0x4144('0x11'),auth['isAuthenticated'](),controller[_0x4144('0x12')]);router[_0x4144('0x9')](_0x4144('0x13'),auth[_0x4144('0xa')](),controller[_0x4144('0x14')]);router[_0x4144('0x15')]('/',auth[_0x4144('0xa')](),controller['create']);router[_0x4144('0x15')]('/:id/tags',auth[_0x4144('0xa')](),controller[_0x4144('0x16')]);router['put'](_0x4144('0xc'),auth[_0x4144('0xa')](),controller['update']);router[_0x4144('0x17')](_0x4144('0xc'),auth[_0x4144('0xa')](),controller[_0x4144('0x18')]);module['exports']=router;
\ No newline at end of file
index a21953a..1adda5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc29f=['sequelize','STRING'];(function(_0x18deb5,_0x21fe70){var _0x440b46=function(_0x21cf63){while(--_0x21cf63){_0x18deb5['push'](_0x18deb5['shift']());}};_0x440b46(++_0x21fe70);}(_0xc29f,0x94));var _0xfc29=function(_0x20b398,_0x24a7e0){_0x20b398=_0x20b398-0x0;var _0x152d9e=_0xc29f[_0x20b398];return _0x152d9e;};'use strict';var Sequelize=require(_0xfc29('0x0'));module['exports']={'name':{'type':Sequelize[_0xfc29('0x1')]},'description':{'type':Sequelize[_0xfc29('0x1')]}};
\ No newline at end of file
+var _0x21a7=['exports','STRING'];(function(_0x50dbc6,_0x4e226a){var _0x349828=function(_0x16aa64){while(--_0x16aa64){_0x50dbc6['push'](_0x50dbc6['shift']());}};_0x349828(++_0x4e226a);}(_0x21a7,0xec));var _0x721a=function(_0xef3aef,_0x235a57){_0xef3aef=_0xef3aef-0x0;var _0x41240c=_0x21a7[_0xef3aef];return _0x41240c;};'use strict';var Sequelize=require('sequelize');module[_0x721a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x721a('0x1')]}};
\ No newline at end of file
index 2f3c05e..cc954a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x031e=['FreshdeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','getFields','findOne'];(function(_0x37a178,_0x3f4e9c){var _0x26c836=function(_0xcb162d){while(--_0xcb162d){_0x37a178['push'](_0x37a178['shift']());}};_0x26c836(++_0x3f4e9c);}(_0x031e,0xaf));var _0xe031=function(_0x3718b7,_0x2da677){_0x3718b7=_0x3718b7-0x0;var _0xf8c91e=_0x031e[_0x3718b7];return _0xf8c91e;};'use strict';var emlformat=require(_0xe031('0x0'));var rimraf=require(_0xe031('0x1'));var zipdir=require(_0xe031('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe031('0x3'));var moment=require(_0xe031('0x4'));var BPromise=require(_0xe031('0x5'));var Mustache=require(_0xe031('0x6'));var util=require('util');var path=require(_0xe031('0x7'));var sox=require(_0xe031('0x8'));var csv=require(_0xe031('0x9'));var ejs=require(_0xe031('0xa'));var fs=require('fs');var fs_extra=require(_0xe031('0xb'));var _=require(_0xe031('0xc'));var squel=require(_0xe031('0xd'));var crypto=require(_0xe031('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe031('0x9'));var querystring=require('querystring');var Papa=require(_0xe031('0xf'));var Redis=require('ioredis');var authService=require(_0xe031('0x10'));var qs=require(_0xe031('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe031('0x12'));var logger=require(_0xe031('0x13'))(_0xe031('0x14'));var utils=require(_0xe031('0x15'));var config=require(_0xe031('0x16'));var licenseUtil=require(_0xe031('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x722a08,_0x5d3232){_0x5d3232=_0x5d3232||0xcc;return function(_0x31219c){if(_0x31219c){return _0x722a08[_0xe031('0x18')](_0x5d3232);}return _0x722a08[_0xe031('0x19')](_0x5d3232)['end']();};}function respondWithResult(_0x2b9b38,_0x3e90e2){_0x3e90e2=_0x3e90e2||0xc8;return function(_0x3b013d){if(_0x3b013d){return _0x2b9b38['status'](_0x3e90e2)[_0xe031('0x1a')](_0x3b013d);}};}function respondWithFilteredResult(_0x4425b7,_0x43e793){return function(_0x4da899){if(_0x4da899){var _0x5c4ade=typeof _0x43e793[_0xe031('0x1b')]===_0xe031('0x1c')&&typeof _0x43e793[_0xe031('0x1d')]==='undefined';var _0x26e4eb=_0x4da899[_0xe031('0x1e')];var _0x699811=_0x5c4ade?0x0:_0x43e793[_0xe031('0x1b')];var _0x5ec1ed=_0x5c4ade?_0x4da899[_0xe031('0x1e')]:_0x43e793[_0xe031('0x1b')]+_0x43e793[_0xe031('0x1d')];var _0x577a67;if(_0x5ec1ed>=_0x26e4eb){_0x5ec1ed=_0x26e4eb;_0x577a67=0xc8;}else{_0x577a67=0xce;}_0x4425b7[_0xe031('0x19')](_0x577a67);return _0x4425b7[_0xe031('0x1f')](_0xe031('0x20'),_0x699811+'-'+_0x5ec1ed+'/'+_0x26e4eb)[_0xe031('0x1a')](_0x4da899);}return null;};}function patchUpdates(_0x70bfd0){return function(_0x5dd549){try{jsonpatch[_0xe031('0x21')](_0x5dd549,_0x70bfd0,!![]);}catch(_0x585a02){return BPromise[_0xe031('0x22')](_0x585a02);}return _0x5dd549[_0xe031('0x23')]();};}function saveUpdates(_0x46c04b,_0x2561e3){return function(_0x4b6b03){if(_0x4b6b03){return _0x4b6b03[_0xe031('0x24')](_0x46c04b)['then'](function(_0x36fc2b){return _0x36fc2b;});}return null;};}function removeEntity(_0x188a36,_0x847089){return function(_0xdd4c32){if(_0xdd4c32){return _0xdd4c32[_0xe031('0x25')]()[_0xe031('0x26')](function(){_0x188a36['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29ef18,_0x474977){return function(_0x545222){if(!_0x545222){_0x29ef18[_0xe031('0x18')](0x194);}return _0x545222;};}function handleError(_0x302581,_0x286806){_0x286806=_0x286806||0x1f4;return function(_0x4d9c41){logger[_0xe031('0x27')](_0x4d9c41['stack']);if(_0x4d9c41['name']){delete _0x4d9c41[_0xe031('0x28')];}_0x302581[_0xe031('0x19')](_0x286806)[_0xe031('0x29')](_0x4d9c41);};}exports[_0xe031('0x2a')]=function(_0x47bfc9,_0x4b88a3){var _0x104d6f={},_0x2a0a59={},_0x56cd4b={'count':0x0,'rows':[]};var _0x5e02e8=_[_0xe031('0x2b')](db[_0xe031('0x2c')][_0xe031('0x2d')],function(_0x1b20a4){return{'name':_0x1b20a4[_0xe031('0x2e')],'type':_0x1b20a4['type'][_0xe031('0x2f')]};});_0x2a0a59['model']=_[_0xe031('0x2b')](_0x5e02e8,_0xe031('0x28'));_0x2a0a59[_0xe031('0x30')]=_[_0xe031('0x31')](_0x47bfc9['query']);_0x2a0a59[_0xe031('0x32')]=_[_0xe031('0x33')](_0x2a0a59[_0xe031('0x34')],_0x2a0a59['query']);_0x104d6f['attributes']=_[_0xe031('0x33')](_0x2a0a59['model'],qs[_0xe031('0x35')](_0x47bfc9['query'][_0xe031('0x35')]));_0x104d6f[_0xe031('0x36')]=_0x104d6f['attributes'][_0xe031('0x37')]?_0x104d6f[_0xe031('0x36')]:_0x2a0a59['model'];if(!_0x47bfc9[_0xe031('0x30')][_0xe031('0x38')](_0xe031('0x39'))){_0x104d6f[_0xe031('0x1d')]=qs[_0xe031('0x1d')](_0x47bfc9[_0xe031('0x30')][_0xe031('0x1d')]);_0x104d6f[_0xe031('0x1b')]=qs[_0xe031('0x1b')](_0x47bfc9[_0xe031('0x30')][_0xe031('0x1b')]);}_0x104d6f['order']=qs[_0xe031('0x3a')](_0x47bfc9[_0xe031('0x30')][_0xe031('0x3a')]);_0x104d6f[_0xe031('0x3b')]=qs[_0xe031('0x32')](_[_0xe031('0x3c')](_0x47bfc9[_0xe031('0x30')],_0x2a0a59[_0xe031('0x32')]),_0x5e02e8);if(_0x47bfc9['query']['filter']){_0x104d6f[_0xe031('0x3b')]=_[_0xe031('0x3d')](_0x104d6f[_0xe031('0x3b')],{'$or':_['map'](_0x5e02e8,function(_0xb3fa34){if(_0xb3fa34['type']!==_0xe031('0x3e')){var _0x2d3c08={};_0x2d3c08[_0xb3fa34['name']]={'$like':'%'+_0x47bfc9[_0xe031('0x30')][_0xe031('0x3f')]+'%'};return _0x2d3c08;}})});}_0x104d6f=_[_0xe031('0x3d')]({},_0x104d6f,_0x47bfc9[_0xe031('0x40')]);var _0x2a80dc={'where':_0x104d6f[_0xe031('0x3b')]};return db['FreshdeskConfiguration'][_0xe031('0x1e')](_0x2a80dc)[_0xe031('0x26')](function(_0x316e39){_0x56cd4b['count']=_0x316e39;if(_0x47bfc9[_0xe031('0x30')][_0xe031('0x41')]){_0x104d6f[_0xe031('0x42')]=[{'all':!![]}];}return db[_0xe031('0x2c')][_0xe031('0x43')](_0x104d6f);})[_0xe031('0x26')](function(_0x3efe06){_0x56cd4b[_0xe031('0x44')]=_0x3efe06;return _0x56cd4b;})[_0xe031('0x26')](respondWithFilteredResult(_0x4b88a3,_0x104d6f))[_0xe031('0x45')](handleError(_0x4b88a3,null));};exports[_0xe031('0x46')]=function(_0x4b5aff,_0x261ad8){var _0x36a328={'raw':![],'where':{'id':_0x4b5aff[_0xe031('0x47')]['id']}},_0x13952a={};_0x13952a[_0xe031('0x34')]=_[_0xe031('0x31')](db[_0xe031('0x2c')][_0xe031('0x2d')]);_0x13952a[_0xe031('0x30')]=_[_0xe031('0x31')](_0x4b5aff[_0xe031('0x30')]);_0x13952a[_0xe031('0x32')]=_[_0xe031('0x33')](_0x13952a[_0xe031('0x34')],_0x13952a[_0xe031('0x30')]);_0x36a328['attributes']=_[_0xe031('0x33')](_0x13952a[_0xe031('0x34')],qs[_0xe031('0x35')](_0x4b5aff[_0xe031('0x30')][_0xe031('0x35')]));_0x36a328[_0xe031('0x36')]=_0x36a328[_0xe031('0x36')][_0xe031('0x37')]?_0x36a328[_0xe031('0x36')]:_0x13952a[_0xe031('0x34')];if(_0x4b5aff[_0xe031('0x30')][_0xe031('0x41')]){_0x36a328[_0xe031('0x42')]=[{'all':!![]}];}_0x36a328=_[_0xe031('0x3d')]({},_0x36a328,_0x4b5aff['options']);return db[_0xe031('0x2c')]['find'](_0x36a328)[_0xe031('0x26')](handleEntityNotFound(_0x261ad8,null))[_0xe031('0x26')](respondWithResult(_0x261ad8,null))[_0xe031('0x45')](handleError(_0x261ad8,null));};exports[_0xe031('0x48')]=function(_0x57315b,_0x269c5b){return db[_0xe031('0x2c')][_0xe031('0x48')](_0x57315b[_0xe031('0x49')],{})['then'](respondWithResult(_0x269c5b,0xc9))['catch'](handleError(_0x269c5b,null));};exports[_0xe031('0x24')]=function(_0x2c2a02,_0x120dd6){if(_0x2c2a02['body']['id']){delete _0x2c2a02[_0xe031('0x49')]['id'];}return db[_0xe031('0x2c')][_0xe031('0x4a')]({'where':{'id':_0x2c2a02[_0xe031('0x47')]['id']}})[_0xe031('0x26')](handleEntityNotFound(_0x120dd6,null))['then'](saveUpdates(_0x2c2a02[_0xe031('0x49')],null))[_0xe031('0x26')](respondWithResult(_0x120dd6,null))[_0xe031('0x45')](handleError(_0x120dd6,null));};exports[_0xe031('0x25')]=function(_0x4fc5c6,_0xa350b1){return db[_0xe031('0x2c')][_0xe031('0x4a')]({'where':{'id':_0x4fc5c6[_0xe031('0x47')]['id']}})[_0xe031('0x26')](handleEntityNotFound(_0xa350b1,null))['then'](removeEntity(_0xa350b1,null))[_0xe031('0x45')](handleError(_0xa350b1,null));};exports[_0xe031('0x4b')]=function(_0x2c26e9,_0x5b9215,_0x378509){var _0x2bdd35={};var _0x22b4b7={};var _0x473d6e;var _0x5916bc;return db[_0xe031('0x2c')][_0xe031('0x4c')]({'where':{'id':_0x2c26e9[_0xe031('0x47')]['id']}})[_0xe031('0x26')](handleEntityNotFound(_0x5b9215,null))[_0xe031('0x26')](function(_0x252a3a){if(_0x252a3a){_0x473d6e=_0x252a3a;_0x22b4b7[_0xe031('0x34')]=_[_0xe031('0x31')](db[_0xe031('0x4d')]['rawAttributes']);_0x22b4b7[_0xe031('0x30')]=_[_0xe031('0x31')](_0x2c26e9[_0xe031('0x30')]);_0x22b4b7[_0xe031('0x32')]=_[_0xe031('0x33')](_0x22b4b7[_0xe031('0x34')],_0x22b4b7[_0xe031('0x30')]);_0x2bdd35[_0xe031('0x36')]=_[_0xe031('0x33')](_0x22b4b7['model'],qs[_0xe031('0x35')](_0x2c26e9[_0xe031('0x30')][_0xe031('0x35')]));_0x2bdd35[_0xe031('0x36')]=_0x2bdd35[_0xe031('0x36')]['length']?_0x2bdd35[_0xe031('0x36')]:_0x22b4b7['model'];_0x2bdd35[_0xe031('0x4e')]=qs[_0xe031('0x3a')](_0x2c26e9[_0xe031('0x30')][_0xe031('0x3a')]);_0x2bdd35['where']=qs[_0xe031('0x32')](_[_0xe031('0x3c')](_0x2c26e9[_0xe031('0x30')],_0x22b4b7['filters']));if(_0x2c26e9['query'][_0xe031('0x3f')]){_0x2bdd35['where']=_[_0xe031('0x3d')](_0x2bdd35['where'],{'$or':_[_0xe031('0x2b')](_0x2bdd35['attributes'],function(_0x4f547){var _0x3b2b3f={};_0x3b2b3f[_0x4f547]={'$like':'%'+_0x2c26e9['query'][_0xe031('0x3f')]+'%'};return _0x3b2b3f;})});}_0x2bdd35=_[_0xe031('0x3d')]({},_0x2bdd35,_0x2c26e9['options']);return _0x473d6e[_0xe031('0x4b')](_0x2bdd35);}})['then'](function(_0x312d24){if(_0x312d24){_0x5916bc=_0x312d24[_0xe031('0x37')];if(!_0x2c26e9[_0xe031('0x30')][_0xe031('0x38')](_0xe031('0x39'))){_0x2bdd35[_0xe031('0x1d')]=qs[_0xe031('0x1d')](_0x2c26e9[_0xe031('0x30')][_0xe031('0x1d')]);_0x2bdd35['offset']=qs[_0xe031('0x1b')](_0x2c26e9['query'][_0xe031('0x1b')]);}return _0x473d6e[_0xe031('0x4b')](_0x2bdd35);}})[_0xe031('0x26')](function(_0x185940){if(_0x185940){return _0x185940?{'count':_0x5916bc,'rows':_0x185940}:null;}})[_0xe031('0x26')](respondWithResult(_0x5b9215,null))[_0xe031('0x45')](handleError(_0x5b9215,null));};exports[_0xe031('0x4f')]=function(_0x1a3761,_0x2d2de6,_0x1e4439){var _0x44c546={};var _0x2ffb72={};var _0x2d2212;var _0x217132;return db[_0xe031('0x2c')][_0xe031('0x4c')]({'where':{'id':_0x1a3761[_0xe031('0x47')]['id']}})['then'](handleEntityNotFound(_0x2d2de6,null))[_0xe031('0x26')](function(_0x37d9c3){if(_0x37d9c3){_0x2d2212=_0x37d9c3;_0x2ffb72[_0xe031('0x34')]=_[_0xe031('0x31')](db[_0xe031('0x4d')][_0xe031('0x2d')]);_0x2ffb72[_0xe031('0x30')]=_[_0xe031('0x31')](_0x1a3761[_0xe031('0x30')]);_0x2ffb72[_0xe031('0x32')]=_[_0xe031('0x33')](_0x2ffb72[_0xe031('0x34')],_0x2ffb72['query']);_0x44c546[_0xe031('0x36')]=_[_0xe031('0x33')](_0x2ffb72[_0xe031('0x34')],qs[_0xe031('0x35')](_0x1a3761['query'][_0xe031('0x35')]));_0x44c546['attributes']=_0x44c546[_0xe031('0x36')][_0xe031('0x37')]?_0x44c546[_0xe031('0x36')]:_0x2ffb72[_0xe031('0x34')];_0x44c546[_0xe031('0x4e')]=qs[_0xe031('0x3a')](_0x1a3761[_0xe031('0x30')]['sort']);_0x44c546[_0xe031('0x3b')]=qs['filters'](_[_0xe031('0x3c')](_0x1a3761[_0xe031('0x30')],_0x2ffb72[_0xe031('0x32')]));if(_0x1a3761['query'][_0xe031('0x3f')]){_0x44c546[_0xe031('0x3b')]=_[_0xe031('0x3d')](_0x44c546['where'],{'$or':_[_0xe031('0x2b')](_0x44c546[_0xe031('0x36')],function(_0x49fbea){var _0x42336d={};_0x42336d[_0x49fbea]={'$like':'%'+_0x1a3761[_0xe031('0x30')]['filter']+'%'};return _0x42336d;})});}_0x44c546=_[_0xe031('0x3d')]({},_0x44c546,_0x1a3761[_0xe031('0x40')]);return _0x2d2212[_0xe031('0x4f')](_0x44c546);}})[_0xe031('0x26')](function(_0x1357f0){if(_0x1357f0){_0x217132=_0x1357f0[_0xe031('0x37')];if(!_0x1a3761[_0xe031('0x30')][_0xe031('0x38')](_0xe031('0x39'))){_0x44c546[_0xe031('0x1d')]=qs['limit'](_0x1a3761[_0xe031('0x30')][_0xe031('0x1d')]);_0x44c546[_0xe031('0x1b')]=qs[_0xe031('0x1b')](_0x1a3761['query'][_0xe031('0x1b')]);}return _0x2d2212[_0xe031('0x4f')](_0x44c546);}})[_0xe031('0x26')](function(_0x38f2a1){if(_0x38f2a1){return _0x38f2a1?{'count':_0x217132,'rows':_0x38f2a1}:null;}})[_0xe031('0x26')](respondWithResult(_0x2d2de6,null))[_0xe031('0x45')](handleError(_0x2d2de6,null));};exports[_0xe031('0x50')]=function(_0x35ed65,_0x434307,_0x420dcf){var _0x5315fc={};var _0x165e4d={};var _0x1ef115;var _0x485315;return db[_0xe031('0x2c')][_0xe031('0x4c')]({'where':{'id':_0x35ed65[_0xe031('0x47')]['id']}})['then'](handleEntityNotFound(_0x434307,null))['then'](function(_0x2ff068){if(_0x2ff068){_0x1ef115=_0x2ff068;_0x165e4d[_0xe031('0x34')]=_['keys'](db[_0xe031('0x4d')][_0xe031('0x2d')]);_0x165e4d['query']=_['keys'](_0x35ed65[_0xe031('0x30')]);_0x165e4d[_0xe031('0x32')]=_[_0xe031('0x33')](_0x165e4d[_0xe031('0x34')],_0x165e4d['query']);_0x5315fc[_0xe031('0x36')]=_['intersection'](_0x165e4d['model'],qs[_0xe031('0x35')](_0x35ed65[_0xe031('0x30')][_0xe031('0x35')]));_0x5315fc[_0xe031('0x36')]=_0x5315fc['attributes'][_0xe031('0x37')]?_0x5315fc[_0xe031('0x36')]:_0x165e4d['model'];_0x5315fc[_0xe031('0x4e')]=qs[_0xe031('0x3a')](_0x35ed65[_0xe031('0x30')][_0xe031('0x3a')]);_0x5315fc[_0xe031('0x3b')]=qs[_0xe031('0x32')](_[_0xe031('0x3c')](_0x35ed65[_0xe031('0x30')],_0x165e4d['filters']));if(_0x35ed65[_0xe031('0x30')]['filter']){_0x5315fc['where']=_[_0xe031('0x3d')](_0x5315fc[_0xe031('0x3b')],{'$or':_['map'](_0x5315fc[_0xe031('0x36')],function(_0x1c7a5f){var _0x376c35={};_0x376c35[_0x1c7a5f]={'$like':'%'+_0x35ed65[_0xe031('0x30')][_0xe031('0x3f')]+'%'};return _0x376c35;})});}_0x5315fc=_[_0xe031('0x3d')]({},_0x5315fc,_0x35ed65['options']);return _0x1ef115[_0xe031('0x50')](_0x5315fc);}})[_0xe031('0x26')](function(_0x351342){if(_0x351342){_0x485315=_0x351342[_0xe031('0x37')];if(!_0x35ed65[_0xe031('0x30')][_0xe031('0x38')]('nolimit')){_0x5315fc[_0xe031('0x1d')]=qs[_0xe031('0x1d')](_0x35ed65[_0xe031('0x30')]['limit']);_0x5315fc[_0xe031('0x1b')]=qs['offset'](_0x35ed65['query']['offset']);}return _0x1ef115[_0xe031('0x50')](_0x5315fc);}})[_0xe031('0x26')](function(_0x317e9d){if(_0x317e9d){return _0x317e9d?{'count':_0x485315,'rows':_0x317e9d}:null;}})[_0xe031('0x26')](respondWithResult(_0x434307,null))['catch'](handleError(_0x434307,null));};exports[_0xe031('0x51')]=function(_0x4091ce,_0x56bfc5,_0x184d37){var _0x17bf7e={};var _0x1012ed={};var _0x4671a8;var _0x3d2c3a;return db[_0xe031('0x2c')][_0xe031('0x4c')]({'where':{'id':_0x4091ce[_0xe031('0x47')]['id']}})['then'](handleEntityNotFound(_0x56bfc5,null))[_0xe031('0x26')](function(_0x170b20){if(_0x170b20){_0x4671a8=_0x170b20;_0x1012ed[_0xe031('0x34')]=_[_0xe031('0x31')](db[_0xe031('0x52')][_0xe031('0x2d')]);_0x1012ed[_0xe031('0x30')]=_[_0xe031('0x31')](_0x4091ce[_0xe031('0x30')]);_0x1012ed[_0xe031('0x32')]=_[_0xe031('0x33')](_0x1012ed[_0xe031('0x34')],_0x1012ed[_0xe031('0x30')]);_0x17bf7e[_0xe031('0x36')]=_[_0xe031('0x33')](_0x1012ed[_0xe031('0x34')],qs[_0xe031('0x35')](_0x4091ce[_0xe031('0x30')][_0xe031('0x35')]));_0x17bf7e[_0xe031('0x36')]=_0x17bf7e['attributes'][_0xe031('0x37')]?_0x17bf7e[_0xe031('0x36')]:_0x1012ed[_0xe031('0x34')];_0x17bf7e['order']=qs[_0xe031('0x3a')](_0x4091ce[_0xe031('0x30')][_0xe031('0x3a')]);_0x17bf7e[_0xe031('0x3b')]=qs[_0xe031('0x32')](_[_0xe031('0x3c')](_0x4091ce[_0xe031('0x30')],_0x1012ed[_0xe031('0x32')]));if(_0x4091ce[_0xe031('0x30')][_0xe031('0x3f')]){_0x17bf7e[_0xe031('0x3b')]=_[_0xe031('0x3d')](_0x17bf7e['where'],{'$or':_[_0xe031('0x2b')](_0x17bf7e['attributes'],function(_0x159ede){var _0x159107={};_0x159107[_0x159ede]={'$like':'%'+_0x4091ce[_0xe031('0x30')]['filter']+'%'};return _0x159107;})});}_0x17bf7e=_[_0xe031('0x3d')]({},_0x17bf7e,_0x4091ce['options']);return _0x4671a8[_0xe031('0x51')](_0x17bf7e);}})[_0xe031('0x26')](function(_0x447dfa){if(_0x447dfa){_0x3d2c3a=_0x447dfa[_0xe031('0x37')];if(!_0x4091ce[_0xe031('0x30')][_0xe031('0x38')]('nolimit')){_0x17bf7e[_0xe031('0x1d')]=qs[_0xe031('0x1d')](_0x4091ce['query']['limit']);_0x17bf7e[_0xe031('0x1b')]=qs[_0xe031('0x1b')](_0x4091ce[_0xe031('0x30')][_0xe031('0x1b')]);}return _0x4671a8[_0xe031('0x51')](_0x17bf7e);}})['then'](function(_0x44c73a){if(_0x44c73a){return _0x44c73a?{'count':_0x3d2c3a,'rows':_0x44c73a}:null;}})[_0xe031('0x26')](respondWithResult(_0x56bfc5,null))['catch'](handleError(_0x56bfc5,null));};exports['setTags']=function(_0x58e5e0,_0x4461af,_0x2402b0){if(_0x58e5e0[_0xe031('0x49')]['id']){delete _0x58e5e0[_0xe031('0x49')]['id'];}return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x58e5e0['params']['id']}})[_0xe031('0x26')](handleEntityNotFound(_0x4461af,null))[_0xe031('0x26')](function(_0x364d21){if(_0x364d21){return _0x364d21[_0xe031('0x53')](_0x58e5e0[_0xe031('0x49')]['ids']||[]);}return null;})[_0xe031('0x26')](respondWithResult(_0x4461af,null))['catch'](handleError(_0x4461af,null));};
\ No newline at end of file
+var _0x4860=['where','filters','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','find','create','body','getFields','FreshdeskField','getSubjects','findOne','getTags','Tag','setTags','rimraf','zip-dir','bluebird','util','path','ejs','fs-extra','lodash','squel','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x4860,0x1b3));var _0x0486=function(_0x4fb70e,_0x49e793){_0x4fb70e=_0x4fb70e-0x0;var _0x2d3465=_0x4860[_0x4fb70e];return _0x2d3465;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0486('0x0'));var zipdir=require(_0x0486('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0486('0x2'));var Mustache=require('mustache');var util=require(_0x0486('0x3'));var path=require(_0x0486('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0486('0x5'));var fs=require('fs');var fs_extra=require(_0x0486('0x6'));var _=require(_0x0486('0x7'));var squel=require(_0x0486('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0486('0x9'));var querystring=require(_0x0486('0xa'));var Papa=require('papaparse');var Redis=require(_0x0486('0xb'));var authService=require(_0x0486('0xc'));var qs=require(_0x0486('0xd'));var as=require(_0x0486('0xe'));var hardwareService=require(_0x0486('0xf'));var logger=require(_0x0486('0x10'))('api');var utils=require(_0x0486('0x11'));var config=require(_0x0486('0x12'));var licenseUtil=require(_0x0486('0x13'));var db=require(_0x0486('0x14'))['db'];function respondWithStatusCode(_0x3a3375,_0x594477){_0x594477=_0x594477||0xcc;return function(_0x7d5212){if(_0x7d5212){return _0x3a3375[_0x0486('0x15')](_0x594477);}return _0x3a3375[_0x0486('0x16')](_0x594477)[_0x0486('0x17')]();};}function respondWithResult(_0x36cab7,_0x2682bb){_0x2682bb=_0x2682bb||0xc8;return function(_0x948f31){if(_0x948f31){return _0x36cab7['status'](_0x2682bb)['json'](_0x948f31);}};}function respondWithFilteredResult(_0x5a119c,_0x13581f){return function(_0x4d68c0){if(_0x4d68c0){var _0x1e87f7=typeof _0x13581f[_0x0486('0x18')]===_0x0486('0x19')&&typeof _0x13581f['limit']===_0x0486('0x19');var _0x4f67c7=_0x4d68c0[_0x0486('0x1a')];var _0x4b98b3=_0x1e87f7?0x0:_0x13581f[_0x0486('0x18')];var _0x4dba92=_0x1e87f7?_0x4d68c0[_0x0486('0x1a')]:_0x13581f[_0x0486('0x18')]+_0x13581f[_0x0486('0x1b')];var _0x44397c;if(_0x4dba92>=_0x4f67c7){_0x4dba92=_0x4f67c7;_0x44397c=0xc8;}else{_0x44397c=0xce;}_0x5a119c[_0x0486('0x16')](_0x44397c);return _0x5a119c[_0x0486('0x1c')](_0x0486('0x1d'),_0x4b98b3+'-'+_0x4dba92+'/'+_0x4f67c7)[_0x0486('0x1e')](_0x4d68c0);}return null;};}function patchUpdates(_0x47d589){return function(_0x27a948){try{jsonpatch[_0x0486('0x1f')](_0x27a948,_0x47d589,!![]);}catch(_0x35cd10){return BPromise[_0x0486('0x20')](_0x35cd10);}return _0x27a948[_0x0486('0x21')]();};}function saveUpdates(_0x2e11a9,_0x318496){return function(_0x3070bc){if(_0x3070bc){return _0x3070bc[_0x0486('0x22')](_0x2e11a9)[_0x0486('0x23')](function(_0x1bd525){return _0x1bd525;});}return null;};}function removeEntity(_0x247031,_0x583cf3){return function(_0x64127b){if(_0x64127b){return _0x64127b[_0x0486('0x24')]()[_0x0486('0x23')](function(){_0x247031['status'](0xcc)[_0x0486('0x17')]();});}};}function handleEntityNotFound(_0x4f2f79,_0xdd239f){return function(_0x16264d){if(!_0x16264d){_0x4f2f79[_0x0486('0x15')](0x194);}return _0x16264d;};}function handleError(_0x49ff5c,_0x415ea9){_0x415ea9=_0x415ea9||0x1f4;return function(_0x5207fa){logger[_0x0486('0x25')](_0x5207fa[_0x0486('0x26')]);if(_0x5207fa[_0x0486('0x27')]){delete _0x5207fa[_0x0486('0x27')];}_0x49ff5c[_0x0486('0x16')](_0x415ea9)[_0x0486('0x28')](_0x5207fa);};}exports[_0x0486('0x29')]=function(_0x41c934,_0x32dc9c){var _0x3ecff7={},_0x1024df={},_0x573a8d={'count':0x0,'rows':[]};var _0x46f26a=_[_0x0486('0x2a')](db[_0x0486('0x2b')]['rawAttributes'],function(_0x1e7c5f){return{'name':_0x1e7c5f[_0x0486('0x2c')],'type':_0x1e7c5f[_0x0486('0x2d')][_0x0486('0x2e')]};});_0x1024df[_0x0486('0x2f')]=_[_0x0486('0x2a')](_0x46f26a,_0x0486('0x27'));_0x1024df[_0x0486('0x30')]=_[_0x0486('0x31')](_0x41c934[_0x0486('0x30')]);_0x1024df['filters']=_[_0x0486('0x32')](_0x1024df[_0x0486('0x2f')],_0x1024df[_0x0486('0x30')]);_0x3ecff7[_0x0486('0x33')]=_[_0x0486('0x32')](_0x1024df[_0x0486('0x2f')],qs['fields'](_0x41c934[_0x0486('0x30')]['fields']));_0x3ecff7[_0x0486('0x33')]=_0x3ecff7[_0x0486('0x33')][_0x0486('0x34')]?_0x3ecff7[_0x0486('0x33')]:_0x1024df[_0x0486('0x2f')];if(!_0x41c934[_0x0486('0x30')][_0x0486('0x35')](_0x0486('0x36'))){_0x3ecff7[_0x0486('0x1b')]=qs[_0x0486('0x1b')](_0x41c934['query'][_0x0486('0x1b')]);_0x3ecff7['offset']=qs['offset'](_0x41c934['query'][_0x0486('0x18')]);}_0x3ecff7[_0x0486('0x37')]=qs[_0x0486('0x38')](_0x41c934[_0x0486('0x30')][_0x0486('0x38')]);_0x3ecff7[_0x0486('0x39')]=qs[_0x0486('0x3a')](_[_0x0486('0x3b')](_0x41c934[_0x0486('0x30')],_0x1024df[_0x0486('0x3a')]),_0x46f26a);if(_0x41c934['query'][_0x0486('0x3c')]){_0x3ecff7['where']=_[_0x0486('0x3d')](_0x3ecff7['where'],{'$or':_[_0x0486('0x2a')](_0x46f26a,function(_0x48994a){if(_0x48994a[_0x0486('0x2d')]!=='VIRTUAL'){var _0x59ba54={};_0x59ba54[_0x48994a['name']]={'$like':'%'+_0x41c934[_0x0486('0x30')][_0x0486('0x3c')]+'%'};return _0x59ba54;}})});}_0x3ecff7=_[_0x0486('0x3d')]({},_0x3ecff7,_0x41c934[_0x0486('0x3e')]);var _0xeca751={'where':_0x3ecff7['where']};return db['FreshdeskConfiguration']['count'](_0xeca751)['then'](function(_0xeac4ac){_0x573a8d[_0x0486('0x1a')]=_0xeac4ac;if(_0x41c934[_0x0486('0x30')]['includeAll']){_0x3ecff7[_0x0486('0x3f')]=[{'all':!![]}];}return db[_0x0486('0x2b')][_0x0486('0x40')](_0x3ecff7);})[_0x0486('0x23')](function(_0x397a72){_0x573a8d[_0x0486('0x41')]=_0x397a72;return _0x573a8d;})[_0x0486('0x23')](respondWithFilteredResult(_0x32dc9c,_0x3ecff7))[_0x0486('0x42')](handleError(_0x32dc9c,null));};exports[_0x0486('0x43')]=function(_0x5774bd,_0x457d25){var _0x218e4c={'raw':![],'where':{'id':_0x5774bd[_0x0486('0x44')]['id']}},_0x26b569={};_0x26b569[_0x0486('0x2f')]=_['keys'](db[_0x0486('0x2b')][_0x0486('0x45')]);_0x26b569[_0x0486('0x30')]=_[_0x0486('0x31')](_0x5774bd['query']);_0x26b569[_0x0486('0x3a')]=_[_0x0486('0x32')](_0x26b569['model'],_0x26b569['query']);_0x218e4c['attributes']=_['intersection'](_0x26b569[_0x0486('0x2f')],qs[_0x0486('0x46')](_0x5774bd[_0x0486('0x30')][_0x0486('0x46')]));_0x218e4c[_0x0486('0x33')]=_0x218e4c['attributes'][_0x0486('0x34')]?_0x218e4c[_0x0486('0x33')]:_0x26b569[_0x0486('0x2f')];if(_0x5774bd['query'][_0x0486('0x47')]){_0x218e4c[_0x0486('0x3f')]=[{'all':!![]}];}_0x218e4c=_[_0x0486('0x3d')]({},_0x218e4c,_0x5774bd[_0x0486('0x3e')]);return db[_0x0486('0x2b')][_0x0486('0x48')](_0x218e4c)[_0x0486('0x23')](handleEntityNotFound(_0x457d25,null))['then'](respondWithResult(_0x457d25,null))[_0x0486('0x42')](handleError(_0x457d25,null));};exports[_0x0486('0x49')]=function(_0x44a6f8,_0xd6bd02){return db['FreshdeskConfiguration']['create'](_0x44a6f8[_0x0486('0x4a')],{})[_0x0486('0x23')](respondWithResult(_0xd6bd02,0xc9))[_0x0486('0x42')](handleError(_0xd6bd02,null));};exports['update']=function(_0x5a2ad6,_0x5b2b33){if(_0x5a2ad6[_0x0486('0x4a')]['id']){delete _0x5a2ad6['body']['id'];}return db[_0x0486('0x2b')][_0x0486('0x48')]({'where':{'id':_0x5a2ad6[_0x0486('0x44')]['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x5b2b33,null))[_0x0486('0x23')](saveUpdates(_0x5a2ad6['body'],null))[_0x0486('0x23')](respondWithResult(_0x5b2b33,null))[_0x0486('0x42')](handleError(_0x5b2b33,null));};exports['destroy']=function(_0x4fd7ac,_0x3a87c0){return db['FreshdeskConfiguration'][_0x0486('0x48')]({'where':{'id':_0x4fd7ac[_0x0486('0x44')]['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x3a87c0,null))[_0x0486('0x23')](removeEntity(_0x3a87c0,null))[_0x0486('0x42')](handleError(_0x3a87c0,null));};exports[_0x0486('0x4b')]=function(_0x2fb689,_0x2717b8,_0x4378e6){var _0x10d6cb={};var _0xe257f0={};var _0x5cf5ef;var _0x5c9a98;return db[_0x0486('0x2b')]['findOne']({'where':{'id':_0x2fb689['params']['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x2717b8,null))['then'](function(_0x4702ca){if(_0x4702ca){_0x5cf5ef=_0x4702ca;_0xe257f0[_0x0486('0x2f')]=_[_0x0486('0x31')](db[_0x0486('0x4c')][_0x0486('0x45')]);_0xe257f0[_0x0486('0x30')]=_['keys'](_0x2fb689[_0x0486('0x30')]);_0xe257f0['filters']=_['intersection'](_0xe257f0[_0x0486('0x2f')],_0xe257f0[_0x0486('0x30')]);_0x10d6cb[_0x0486('0x33')]=_[_0x0486('0x32')](_0xe257f0[_0x0486('0x2f')],qs['fields'](_0x2fb689[_0x0486('0x30')][_0x0486('0x46')]));_0x10d6cb[_0x0486('0x33')]=_0x10d6cb[_0x0486('0x33')][_0x0486('0x34')]?_0x10d6cb[_0x0486('0x33')]:_0xe257f0['model'];_0x10d6cb[_0x0486('0x37')]=qs[_0x0486('0x38')](_0x2fb689[_0x0486('0x30')][_0x0486('0x38')]);_0x10d6cb[_0x0486('0x39')]=qs['filters'](_[_0x0486('0x3b')](_0x2fb689[_0x0486('0x30')],_0xe257f0[_0x0486('0x3a')]));if(_0x2fb689[_0x0486('0x30')][_0x0486('0x3c')]){_0x10d6cb[_0x0486('0x39')]=_[_0x0486('0x3d')](_0x10d6cb[_0x0486('0x39')],{'$or':_[_0x0486('0x2a')](_0x10d6cb[_0x0486('0x33')],function(_0x56a978){var _0x347a2b={};_0x347a2b[_0x56a978]={'$like':'%'+_0x2fb689[_0x0486('0x30')][_0x0486('0x3c')]+'%'};return _0x347a2b;})});}_0x10d6cb=_[_0x0486('0x3d')]({},_0x10d6cb,_0x2fb689['options']);return _0x5cf5ef[_0x0486('0x4b')](_0x10d6cb);}})[_0x0486('0x23')](function(_0x33c3cc){if(_0x33c3cc){_0x5c9a98=_0x33c3cc[_0x0486('0x34')];if(!_0x2fb689['query'][_0x0486('0x35')](_0x0486('0x36'))){_0x10d6cb['limit']=qs[_0x0486('0x1b')](_0x2fb689[_0x0486('0x30')][_0x0486('0x1b')]);_0x10d6cb[_0x0486('0x18')]=qs[_0x0486('0x18')](_0x2fb689[_0x0486('0x30')][_0x0486('0x18')]);}return _0x5cf5ef[_0x0486('0x4b')](_0x10d6cb);}})[_0x0486('0x23')](function(_0x43563f){if(_0x43563f){return _0x43563f?{'count':_0x5c9a98,'rows':_0x43563f}:null;}})[_0x0486('0x23')](respondWithResult(_0x2717b8,null))['catch'](handleError(_0x2717b8,null));};exports[_0x0486('0x4d')]=function(_0x452941,_0x14415d,_0x20dbc5){var _0x3f6423={};var _0x323778={};var _0x495692;var _0x5a1cdb;return db['FreshdeskConfiguration'][_0x0486('0x4e')]({'where':{'id':_0x452941[_0x0486('0x44')]['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x14415d,null))[_0x0486('0x23')](function(_0x159382){if(_0x159382){_0x495692=_0x159382;_0x323778[_0x0486('0x2f')]=_[_0x0486('0x31')](db['FreshdeskField'][_0x0486('0x45')]);_0x323778['query']=_['keys'](_0x452941[_0x0486('0x30')]);_0x323778['filters']=_['intersection'](_0x323778[_0x0486('0x2f')],_0x323778[_0x0486('0x30')]);_0x3f6423[_0x0486('0x33')]=_['intersection'](_0x323778['model'],qs[_0x0486('0x46')](_0x452941[_0x0486('0x30')][_0x0486('0x46')]));_0x3f6423[_0x0486('0x33')]=_0x3f6423[_0x0486('0x33')]['length']?_0x3f6423[_0x0486('0x33')]:_0x323778[_0x0486('0x2f')];_0x3f6423[_0x0486('0x37')]=qs[_0x0486('0x38')](_0x452941['query'][_0x0486('0x38')]);_0x3f6423[_0x0486('0x39')]=qs['filters'](_[_0x0486('0x3b')](_0x452941[_0x0486('0x30')],_0x323778[_0x0486('0x3a')]));if(_0x452941[_0x0486('0x30')][_0x0486('0x3c')]){_0x3f6423['where']=_[_0x0486('0x3d')](_0x3f6423[_0x0486('0x39')],{'$or':_[_0x0486('0x2a')](_0x3f6423[_0x0486('0x33')],function(_0x27098b){var _0x3e401b={};_0x3e401b[_0x27098b]={'$like':'%'+_0x452941['query'][_0x0486('0x3c')]+'%'};return _0x3e401b;})});}_0x3f6423=_[_0x0486('0x3d')]({},_0x3f6423,_0x452941[_0x0486('0x3e')]);return _0x495692[_0x0486('0x4d')](_0x3f6423);}})[_0x0486('0x23')](function(_0x582bc1){if(_0x582bc1){_0x5a1cdb=_0x582bc1[_0x0486('0x34')];if(!_0x452941['query'][_0x0486('0x35')]('nolimit')){_0x3f6423[_0x0486('0x1b')]=qs[_0x0486('0x1b')](_0x452941[_0x0486('0x30')][_0x0486('0x1b')]);_0x3f6423['offset']=qs[_0x0486('0x18')](_0x452941['query'][_0x0486('0x18')]);}return _0x495692[_0x0486('0x4d')](_0x3f6423);}})[_0x0486('0x23')](function(_0x8d90d3){if(_0x8d90d3){return _0x8d90d3?{'count':_0x5a1cdb,'rows':_0x8d90d3}:null;}})['then'](respondWithResult(_0x14415d,null))[_0x0486('0x42')](handleError(_0x14415d,null));};exports['getDescriptions']=function(_0xd237a0,_0x1e7223,_0x2f4eee){var _0xd6d0e0={};var _0x452bfd={};var _0x2f3d00;var _0x330273;return db['FreshdeskConfiguration'][_0x0486('0x4e')]({'where':{'id':_0xd237a0[_0x0486('0x44')]['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x1e7223,null))['then'](function(_0x3018cd){if(_0x3018cd){_0x2f3d00=_0x3018cd;_0x452bfd[_0x0486('0x2f')]=_[_0x0486('0x31')](db['FreshdeskField'][_0x0486('0x45')]);_0x452bfd['query']=_[_0x0486('0x31')](_0xd237a0[_0x0486('0x30')]);_0x452bfd[_0x0486('0x3a')]=_[_0x0486('0x32')](_0x452bfd[_0x0486('0x2f')],_0x452bfd[_0x0486('0x30')]);_0xd6d0e0[_0x0486('0x33')]=_[_0x0486('0x32')](_0x452bfd['model'],qs['fields'](_0xd237a0['query']['fields']));_0xd6d0e0['attributes']=_0xd6d0e0[_0x0486('0x33')][_0x0486('0x34')]?_0xd6d0e0[_0x0486('0x33')]:_0x452bfd[_0x0486('0x2f')];_0xd6d0e0['order']=qs['sort'](_0xd237a0[_0x0486('0x30')][_0x0486('0x38')]);_0xd6d0e0[_0x0486('0x39')]=qs[_0x0486('0x3a')](_[_0x0486('0x3b')](_0xd237a0[_0x0486('0x30')],_0x452bfd[_0x0486('0x3a')]));if(_0xd237a0[_0x0486('0x30')]['filter']){_0xd6d0e0['where']=_[_0x0486('0x3d')](_0xd6d0e0[_0x0486('0x39')],{'$or':_[_0x0486('0x2a')](_0xd6d0e0['attributes'],function(_0x330679){var _0x41855f={};_0x41855f[_0x330679]={'$like':'%'+_0xd237a0['query']['filter']+'%'};return _0x41855f;})});}_0xd6d0e0=_[_0x0486('0x3d')]({},_0xd6d0e0,_0xd237a0[_0x0486('0x3e')]);return _0x2f3d00['getDescriptions'](_0xd6d0e0);}})[_0x0486('0x23')](function(_0x57b084){if(_0x57b084){_0x330273=_0x57b084['length'];if(!_0xd237a0[_0x0486('0x30')][_0x0486('0x35')](_0x0486('0x36'))){_0xd6d0e0[_0x0486('0x1b')]=qs['limit'](_0xd237a0['query']['limit']);_0xd6d0e0[_0x0486('0x18')]=qs[_0x0486('0x18')](_0xd237a0[_0x0486('0x30')][_0x0486('0x18')]);}return _0x2f3d00['getDescriptions'](_0xd6d0e0);}})['then'](function(_0x33967c){if(_0x33967c){return _0x33967c?{'count':_0x330273,'rows':_0x33967c}:null;}})[_0x0486('0x23')](respondWithResult(_0x1e7223,null))[_0x0486('0x42')](handleError(_0x1e7223,null));};exports[_0x0486('0x4f')]=function(_0x9c3fa2,_0x41e6b6,_0xad5ed3){var _0x3b8b71={};var _0x4ed65e={};var _0x58d538;var _0xa3a266;return db['FreshdeskConfiguration'][_0x0486('0x4e')]({'where':{'id':_0x9c3fa2['params']['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x41e6b6,null))['then'](function(_0x51df20){if(_0x51df20){_0x58d538=_0x51df20;_0x4ed65e['model']=_['keys'](db[_0x0486('0x50')][_0x0486('0x45')]);_0x4ed65e[_0x0486('0x30')]=_[_0x0486('0x31')](_0x9c3fa2[_0x0486('0x30')]);_0x4ed65e[_0x0486('0x3a')]=_[_0x0486('0x32')](_0x4ed65e[_0x0486('0x2f')],_0x4ed65e[_0x0486('0x30')]);_0x3b8b71[_0x0486('0x33')]=_['intersection'](_0x4ed65e[_0x0486('0x2f')],qs[_0x0486('0x46')](_0x9c3fa2['query']['fields']));_0x3b8b71[_0x0486('0x33')]=_0x3b8b71[_0x0486('0x33')][_0x0486('0x34')]?_0x3b8b71[_0x0486('0x33')]:_0x4ed65e[_0x0486('0x2f')];_0x3b8b71[_0x0486('0x37')]=qs[_0x0486('0x38')](_0x9c3fa2[_0x0486('0x30')][_0x0486('0x38')]);_0x3b8b71['where']=qs['filters'](_[_0x0486('0x3b')](_0x9c3fa2[_0x0486('0x30')],_0x4ed65e[_0x0486('0x3a')]));if(_0x9c3fa2[_0x0486('0x30')][_0x0486('0x3c')]){_0x3b8b71[_0x0486('0x39')]=_['merge'](_0x3b8b71[_0x0486('0x39')],{'$or':_[_0x0486('0x2a')](_0x3b8b71[_0x0486('0x33')],function(_0x299854){var _0x4e923d={};_0x4e923d[_0x299854]={'$like':'%'+_0x9c3fa2[_0x0486('0x30')][_0x0486('0x3c')]+'%'};return _0x4e923d;})});}_0x3b8b71=_[_0x0486('0x3d')]({},_0x3b8b71,_0x9c3fa2[_0x0486('0x3e')]);return _0x58d538['getTags'](_0x3b8b71);}})[_0x0486('0x23')](function(_0x13b6dd){if(_0x13b6dd){_0xa3a266=_0x13b6dd[_0x0486('0x34')];if(!_0x9c3fa2[_0x0486('0x30')]['hasOwnProperty'](_0x0486('0x36'))){_0x3b8b71[_0x0486('0x1b')]=qs[_0x0486('0x1b')](_0x9c3fa2[_0x0486('0x30')][_0x0486('0x1b')]);_0x3b8b71['offset']=qs[_0x0486('0x18')](_0x9c3fa2[_0x0486('0x30')][_0x0486('0x18')]);}return _0x58d538[_0x0486('0x4f')](_0x3b8b71);}})['then'](function(_0x58eb73){if(_0x58eb73){return _0x58eb73?{'count':_0xa3a266,'rows':_0x58eb73}:null;}})[_0x0486('0x23')](respondWithResult(_0x41e6b6,null))[_0x0486('0x42')](handleError(_0x41e6b6,null));};exports[_0x0486('0x51')]=function(_0x232a95,_0x15cda8,_0x314697){if(_0x232a95[_0x0486('0x4a')]['id']){delete _0x232a95[_0x0486('0x4a')]['id'];}return db['FreshdeskConfiguration'][_0x0486('0x4e')]({'where':{'id':_0x232a95[_0x0486('0x44')]['id']}})[_0x0486('0x23')](handleEntityNotFound(_0x15cda8,null))[_0x0486('0x23')](function(_0x544144){if(_0x544144){return _0x544144['setTags'](_0x232a95['body']['ids']||[]);}return null;})['then'](respondWithResult(_0x15cda8,null))[_0x0486('0x42')](handleError(_0x15cda8,null));};
\ No newline at end of file
index bff7b21..5a130ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ff5=['bluebird','request-promise','path','rimraf','../../config/environment','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x4463bc,_0xd1ab32){var _0x414f59=function(_0x18f50c){while(--_0x18f50c){_0x4463bc['push'](_0x4463bc['shift']());}};_0x414f59(++_0xd1ab32);}(_0x5ff5,0x170));var _0x55ff=function(_0x4b6eb4,_0xddf8a9){_0x4b6eb4=_0x4b6eb4-0x0;var _0x46b38d=_0x5ff5[_0x4b6eb4];return _0x46b38d;};'use strict';var _=require(_0x55ff('0x0'));var util=require(_0x55ff('0x1'));var logger=require(_0x55ff('0x2'))(_0x55ff('0x3'));var moment=require('moment');var BPromise=require(_0x55ff('0x4'));var rp=require(_0x55ff('0x5'));var fs=require('fs');var path=require(_0x55ff('0x6'));var rimraf=require(_0x55ff('0x7'));var config=require(_0x55ff('0x8'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x4d29b3,_0xa5743){return _0x4d29b3[_0x55ff('0x9')](_0x55ff('0xa'),attributes,{'tableName':_0x55ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbb81=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations'];(function(_0x35940f,_0x1a8d9a){var _0x3ca801=function(_0x4ff9b5){while(--_0x4ff9b5){_0x35940f['push'](_0x35940f['shift']());}};_0x3ca801(++_0x1a8d9a);}(_0xbb81,0x16c));var _0x1bb8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb81[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1bb8('0x0'));var util=require(_0x1bb8('0x1'));var logger=require(_0x1bb8('0x2'))(_0x1bb8('0x3'));var moment=require(_0x1bb8('0x4'));var BPromise=require('bluebird');var rp=require(_0x1bb8('0x5'));var fs=require('fs');var path=require(_0x1bb8('0x6'));var rimraf=require(_0x1bb8('0x7'));var config=require(_0x1bb8('0x8'));var attributes=require(_0x1bb8('0x9'));module[_0x1bb8('0xa')]=function(_0x34481c,_0x440252){return _0x34481c[_0x1bb8('0xb')]('FreshdeskConfiguration',attributes,{'tableName':_0x1bb8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7a4e0f4..4af2ac1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24c8=['FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','http','request'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x24c8,0xc3));var _0x824c=function(_0x5bfa44,_0x76dacc){_0x5bfa44=_0x5bfa44-0x0;var _0x43815f=_0x24c8[_0x5bfa44];return _0x43815f;};'use strict';var _=require('lodash');var util=require(_0x824c('0x0'));var moment=require(_0x824c('0x1'));var BPromise=require('bluebird');var rs=require(_0x824c('0x2'));var fs=require('fs');var Redis=require(_0x824c('0x3'));var db=require(_0x824c('0x4'))['db'];var utils=require(_0x824c('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x824c('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x824c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1442ee,_0x3d81dd,_0x298c5b){return new BPromise(function(_0x8b294,_0x7acde5){return client[_0x824c('0x8')](_0x1442ee,_0x298c5b)['then'](function(_0x1e9d5b){logger['info'](_0x824c('0x9'),_0x3d81dd,_0x824c('0xa'));logger['debug'](_0x824c('0xb'),_0x3d81dd,'request\x20sent',JSON[_0x824c('0xc')](_0x1e9d5b));if(_0x1e9d5b[_0x824c('0xd')]){if(_0x1e9d5b[_0x824c('0xd')][_0x824c('0xe')]===0x1f4){logger[_0x824c('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d81dd,_0x1e9d5b['error']['message']);return _0x7acde5(_0x1e9d5b[_0x824c('0xd')][_0x824c('0xf')]);}logger[_0x824c('0xd')](_0x824c('0x9'),_0x3d81dd,_0x1e9d5b[_0x824c('0xd')][_0x824c('0xf')]);return _0x8b294(_0x1e9d5b[_0x824c('0xd')]['message']);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d81dd,_0x824c('0xa'));_0x8b294(_0x1e9d5b['result']['message']);}})[_0x824c('0x10')](function(_0x50403e){logger[_0x824c('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3d81dd,_0x50403e);_0x7acde5(_0x50403e);});});}
\ No newline at end of file
+var _0x9415=['code','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5c41e9,_0x435daf){var _0x2dcb5c=function(_0x3e8ebb){while(--_0x3e8ebb){_0x5c41e9['push'](_0x5c41e9['shift']());}};_0x2dcb5c(++_0x435daf);}(_0x9415,0xad));var _0x5941=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0x9415[_0x122e9b];return _0x22c247;};'use strict';var _=require(_0x5941('0x0'));var util=require(_0x5941('0x1'));var moment=require(_0x5941('0x2'));var BPromise=require(_0x5941('0x3'));var rs=require(_0x5941('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5941('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5941('0x6'));var jayson=require(_0x5941('0x7'));var client=jayson[_0x5941('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16c375,_0x81d6,_0x26f164){return new BPromise(function(_0x4e9094,_0x584909){return client[_0x5941('0x9')](_0x16c375,_0x26f164)['then'](function(_0x52af70){logger[_0x5941('0xa')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x81d6,_0x5941('0xb'));logger[_0x5941('0xc')](_0x5941('0xd'),_0x81d6,_0x5941('0xb'),JSON[_0x5941('0xe')](_0x52af70));if(_0x52af70[_0x5941('0xf')]){if(_0x52af70[_0x5941('0xf')][_0x5941('0x10')]===0x1f4){logger[_0x5941('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x81d6,_0x52af70[_0x5941('0xf')]['message']);return _0x584909(_0x52af70[_0x5941('0xf')][_0x5941('0x11')]);}logger[_0x5941('0xf')](_0x5941('0x12'),_0x81d6,_0x52af70['error'][_0x5941('0x11')]);return _0x4e9094(_0x52af70[_0x5941('0xf')][_0x5941('0x11')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x81d6,_0x5941('0xb'));_0x4e9094(_0x52af70[_0x5941('0x13')][_0x5941('0x11')]);}})[_0x5941('0x14')](function(_0x310e59){logger[_0x5941('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x81d6,_0x310e59);_0x584909(_0x310e59);});});}
\ No newline at end of file
index 110f9c9..7158efc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x448e=['post','create','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','isAuthenticated','index','get','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x448e,0x1a7));var _0xe448=function(_0x319f60,_0x4f36b0){_0x319f60=_0x319f60-0x0;var _0x1d4491=_0x448e[_0x319f60];return _0x1d4491;};'use strict';var multer=require(_0xe448('0x0'));var util=require(_0xe448('0x1'));var path=require(_0xe448('0x2'));var timeout=require(_0xe448('0x3'));var express=require('express');var router=express[_0xe448('0x4')]();var fs_extra=require(_0xe448('0x5'));var auth=require(_0xe448('0x6'));var interaction=require(_0xe448('0x7'));var config=require(_0xe448('0x8'));var controller=require(_0xe448('0x9'));router['get']('/',auth[_0xe448('0xa')](),controller[_0xe448('0xb')]);router[_0xe448('0xc')]('/:id',auth[_0xe448('0xa')](),controller[_0xe448('0xd')]);router[_0xe448('0xe')]('/',auth[_0xe448('0xa')](),controller[_0xe448('0xf')]);router['put'](_0xe448('0x10'),auth[_0xe448('0xa')](),controller['update']);router['delete'](_0xe448('0x10'),auth['isAuthenticated'](),controller[_0xe448('0x11')]);module[_0xe448('0x12')]=router;
\ No newline at end of file
+var _0xdae9=['create','put','update','delete','destroy','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x5a4c25,_0x47bc4c){var _0x2b4881=function(_0x2e7e67){while(--_0x2e7e67){_0x5a4c25['push'](_0x5a4c25['shift']());}};_0x2b4881(++_0x47bc4c);}(_0xdae9,0x65));var _0x9dae=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0xdae9[_0x58965a];return _0x254efc;};'use strict';var multer=require(_0x9dae('0x0'));var util=require('util');var path=require(_0x9dae('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9dae('0x2')]();var fs_extra=require(_0x9dae('0x3'));var auth=require(_0x9dae('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9dae('0x5'));var controller=require(_0x9dae('0x6'));router[_0x9dae('0x7')]('/',auth[_0x9dae('0x8')](),controller[_0x9dae('0x9')]);router[_0x9dae('0x7')](_0x9dae('0xa'),auth[_0x9dae('0x8')](),controller[_0x9dae('0xb')]);router[_0x9dae('0xc')]('/',auth[_0x9dae('0x8')](),controller[_0x9dae('0xd')]);router[_0x9dae('0xe')](_0x9dae('0xa'),auth['isAuthenticated'](),controller[_0x9dae('0xf')]);router[_0x9dae('0x10')](_0x9dae('0xa'),auth[_0x9dae('0x8')](),controller[_0x9dae('0x11')]);module[_0x9dae('0x12')]=router;
\ No newline at end of file
index 89aa715..387618c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb064=['BOOLEAN','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x2ccd5e,_0x3deb44){var _0x1a758e=function(_0x535991){while(--_0x535991){_0x2ccd5e['push'](_0x2ccd5e['shift']());}};_0x1a758e(++_0x3deb44);}(_0xb064,0x104));var _0x4b06=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xb064[_0x1e7b16];return _0x37fadc;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x4b06('0x0'),_0x4b06('0x1'),_0x4b06('0x2'),_0x4b06('0x3'),_0x4b06('0x4')),'defaultValue':_0x4b06('0x0')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x4b06('0x0'),_0x4b06('0x1'),_0x4b06('0x2'))},'keyContent':{'type':Sequelize[_0x4b06('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4b06('0x5')]},'customField':{'type':Sequelize[_0x4b06('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xc3a2=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x323419,_0x2a6172){var _0x4c0be7=function(_0x5ae2df){while(--_0x5ae2df){_0x323419['push'](_0x323419['shift']());}};_0x4c0be7(++_0x2a6172);}(_0xc3a2,0xfb));var _0x2c3a=function(_0x52e8c1,_0x47ca37){_0x52e8c1=_0x52e8c1-0x0;var _0x1e6bc8=_0xc3a2[_0x52e8c1];return _0x1e6bc8;};'use strict';var Sequelize=require(_0x2c3a('0x0'));module['exports']={'type':{'type':Sequelize[_0x2c3a('0x1')](_0x2c3a('0x2'),_0x2c3a('0x3'),_0x2c3a('0x4'),_0x2c3a('0x5'),_0x2c3a('0x6')),'defaultValue':_0x2c3a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2c3a('0x7')]},'keyType':{'type':Sequelize[_0x2c3a('0x1')]('string',_0x2c3a('0x3'),_0x2c3a('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2c3a('0x7')]},'nameField':{'type':Sequelize[_0x2c3a('0x7')]},'customField':{'type':Sequelize[_0x2c3a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2c3a('0x7')]}};
\ No newline at end of file
index 8549808..a5fa755 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca66=['ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','name','send','FreshdeskField','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','type','VIRTUAL','merge','includeAll','include','rows','catch','params','find','create','body','eml-format','fast-json-patch','request-promise','moment','mustache','path','to-csv'];(function(_0x20d3fc,_0x3d9143){var _0x53959f=function(_0x52851a){while(--_0x52851a){_0x20d3fc['push'](_0x20d3fc['shift']());}};_0x53959f(++_0x3d9143);}(_0xca66,0x8b));var _0x6ca6=function(_0x1f82d2,_0x5d3c78){_0x1f82d2=_0x1f82d2-0x0;var _0x52f18f=_0xca66[_0x1f82d2];return _0x52f18f;};'use strict';var emlformat=require(_0x6ca6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6ca6('0x1'));var rp=require(_0x6ca6('0x2'));var moment=require(_0x6ca6('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6ca6('0x4'));var util=require('util');var path=require(_0x6ca6('0x5'));var sox=require('sox');var csv=require(_0x6ca6('0x6'));var ejs=require(_0x6ca6('0x7'));var fs=require('fs');var fs_extra=require(_0x6ca6('0x8'));var _=require(_0x6ca6('0x9'));var squel=require(_0x6ca6('0xa'));var crypto=require(_0x6ca6('0xb'));var jsforce=require(_0x6ca6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6ca6('0x6'));var querystring=require(_0x6ca6('0xd'));var Papa=require(_0x6ca6('0xe'));var Redis=require(_0x6ca6('0xf'));var authService=require(_0x6ca6('0x10'));var qs=require(_0x6ca6('0x11'));var as=require(_0x6ca6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ca6('0x13'))(_0x6ca6('0x14'));var utils=require(_0x6ca6('0x15'));var config=require(_0x6ca6('0x16'));var licenseUtil=require(_0x6ca6('0x17'));var db=require(_0x6ca6('0x18'))['db'];function respondWithStatusCode(_0x4c05e9,_0x152e63){_0x152e63=_0x152e63||0xcc;return function(_0x38de67){if(_0x38de67){return _0x4c05e9['sendStatus'](_0x152e63);}return _0x4c05e9[_0x6ca6('0x19')](_0x152e63)[_0x6ca6('0x1a')]();};}function respondWithResult(_0x3f417f,_0x3570f1){_0x3570f1=_0x3570f1||0xc8;return function(_0xc774c){if(_0xc774c){return _0x3f417f[_0x6ca6('0x19')](_0x3570f1)['json'](_0xc774c);}};}function respondWithFilteredResult(_0x52c59a,_0x5785b1){return function(_0x36ff3e){if(_0x36ff3e){var _0x19e94f=typeof _0x5785b1[_0x6ca6('0x1b')]===_0x6ca6('0x1c')&&typeof _0x5785b1[_0x6ca6('0x1d')]===_0x6ca6('0x1c');var _0x25dc6c=_0x36ff3e['count'];var _0x2391ce=_0x19e94f?0x0:_0x5785b1[_0x6ca6('0x1b')];var _0xc97f0=_0x19e94f?_0x36ff3e[_0x6ca6('0x1e')]:_0x5785b1[_0x6ca6('0x1b')]+_0x5785b1[_0x6ca6('0x1d')];var _0x16a3d7;if(_0xc97f0>=_0x25dc6c){_0xc97f0=_0x25dc6c;_0x16a3d7=0xc8;}else{_0x16a3d7=0xce;}_0x52c59a[_0x6ca6('0x19')](_0x16a3d7);return _0x52c59a[_0x6ca6('0x1f')](_0x6ca6('0x20'),_0x2391ce+'-'+_0xc97f0+'/'+_0x25dc6c)[_0x6ca6('0x21')](_0x36ff3e);}return null;};}function patchUpdates(_0x4c3be9){return function(_0x28a982){try{jsonpatch[_0x6ca6('0x22')](_0x28a982,_0x4c3be9,!![]);}catch(_0x38cad4){return BPromise[_0x6ca6('0x23')](_0x38cad4);}return _0x28a982[_0x6ca6('0x24')]();};}function saveUpdates(_0x438694,_0x593f15){return function(_0xfb962d){if(_0xfb962d){return _0xfb962d[_0x6ca6('0x25')](_0x438694)['then'](function(_0x4927c1){return _0x4927c1;});}return null;};}function removeEntity(_0xfbf496,_0x216701){return function(_0xfe0760){if(_0xfe0760){return _0xfe0760[_0x6ca6('0x26')]()[_0x6ca6('0x27')](function(){_0xfbf496['status'](0xcc)[_0x6ca6('0x1a')]();});}};}function handleEntityNotFound(_0x1d6caa,_0x1c43ee){return function(_0x2d8c64){if(!_0x2d8c64){_0x1d6caa[_0x6ca6('0x28')](0x194);}return _0x2d8c64;};}function handleError(_0x29f37e,_0x3c32ae){_0x3c32ae=_0x3c32ae||0x1f4;return function(_0x2a1e2d){logger['error'](_0x2a1e2d['stack']);if(_0x2a1e2d[_0x6ca6('0x29')]){delete _0x2a1e2d[_0x6ca6('0x29')];}_0x29f37e[_0x6ca6('0x19')](_0x3c32ae)[_0x6ca6('0x2a')](_0x2a1e2d);};}exports['index']=function(_0x5ea6f7,_0x306583){var _0x47cf48={},_0x4ab84c={},_0x141e78={'count':0x0,'rows':[]};var _0xefd407=_['map'](db[_0x6ca6('0x2b')][_0x6ca6('0x2c')],function(_0xac50e8){return{'name':_0xac50e8[_0x6ca6('0x2d')],'type':_0xac50e8['type'][_0x6ca6('0x2e')]};});_0x4ab84c[_0x6ca6('0x2f')]=_[_0x6ca6('0x30')](_0xefd407,_0x6ca6('0x29'));_0x4ab84c['query']=_[_0x6ca6('0x31')](_0x5ea6f7[_0x6ca6('0x32')]);_0x4ab84c[_0x6ca6('0x33')]=_[_0x6ca6('0x34')](_0x4ab84c['model'],_0x4ab84c['query']);_0x47cf48['attributes']=_['intersection'](_0x4ab84c['model'],qs[_0x6ca6('0x35')](_0x5ea6f7[_0x6ca6('0x32')][_0x6ca6('0x35')]));_0x47cf48['attributes']=_0x47cf48[_0x6ca6('0x36')][_0x6ca6('0x37')]?_0x47cf48[_0x6ca6('0x36')]:_0x4ab84c[_0x6ca6('0x2f')];if(!_0x5ea6f7['query'][_0x6ca6('0x38')](_0x6ca6('0x39'))){_0x47cf48[_0x6ca6('0x1d')]=qs[_0x6ca6('0x1d')](_0x5ea6f7['query'][_0x6ca6('0x1d')]);_0x47cf48['offset']=qs[_0x6ca6('0x1b')](_0x5ea6f7['query']['offset']);}_0x47cf48[_0x6ca6('0x3a')]=qs[_0x6ca6('0x3b')](_0x5ea6f7[_0x6ca6('0x32')][_0x6ca6('0x3b')]);_0x47cf48['where']=qs['filters'](_[_0x6ca6('0x3c')](_0x5ea6f7[_0x6ca6('0x32')],_0x4ab84c['filters']),_0xefd407);if(_0x5ea6f7[_0x6ca6('0x32')]['filter']){_0x47cf48[_0x6ca6('0x3d')]=_['merge'](_0x47cf48[_0x6ca6('0x3d')],{'$or':_[_0x6ca6('0x30')](_0xefd407,function(_0x254733){if(_0x254733[_0x6ca6('0x3e')]!==_0x6ca6('0x3f')){var _0x3ca258={};_0x3ca258[_0x254733[_0x6ca6('0x29')]]={'$like':'%'+_0x5ea6f7[_0x6ca6('0x32')]['filter']+'%'};return _0x3ca258;}})});}_0x47cf48=_[_0x6ca6('0x40')]({},_0x47cf48,_0x5ea6f7['options']);var _0x57186c={'where':_0x47cf48[_0x6ca6('0x3d')]};return db[_0x6ca6('0x2b')]['count'](_0x57186c)[_0x6ca6('0x27')](function(_0x500ed4){_0x141e78[_0x6ca6('0x1e')]=_0x500ed4;if(_0x5ea6f7[_0x6ca6('0x32')][_0x6ca6('0x41')]){_0x47cf48[_0x6ca6('0x42')]=[{'all':!![]}];}return db['FreshdeskField']['findAll'](_0x47cf48);})[_0x6ca6('0x27')](function(_0x3813d6){_0x141e78[_0x6ca6('0x43')]=_0x3813d6;return _0x141e78;})[_0x6ca6('0x27')](respondWithFilteredResult(_0x306583,_0x47cf48))[_0x6ca6('0x44')](handleError(_0x306583,null));};exports['show']=function(_0x76db8d,_0x2ffdfc){var _0x5bed6e={'raw':!![],'where':{'id':_0x76db8d[_0x6ca6('0x45')]['id']}},_0x317b5e={};_0x317b5e[_0x6ca6('0x2f')]=_[_0x6ca6('0x31')](db[_0x6ca6('0x2b')][_0x6ca6('0x2c')]);_0x317b5e[_0x6ca6('0x32')]=_[_0x6ca6('0x31')](_0x76db8d[_0x6ca6('0x32')]);_0x317b5e['filters']=_[_0x6ca6('0x34')](_0x317b5e[_0x6ca6('0x2f')],_0x317b5e[_0x6ca6('0x32')]);_0x5bed6e[_0x6ca6('0x36')]=_[_0x6ca6('0x34')](_0x317b5e[_0x6ca6('0x2f')],qs[_0x6ca6('0x35')](_0x76db8d[_0x6ca6('0x32')]['fields']));_0x5bed6e['attributes']=_0x5bed6e[_0x6ca6('0x36')][_0x6ca6('0x37')]?_0x5bed6e[_0x6ca6('0x36')]:_0x317b5e[_0x6ca6('0x2f')];if(_0x76db8d[_0x6ca6('0x32')][_0x6ca6('0x41')]){_0x5bed6e[_0x6ca6('0x42')]=[{'all':!![]}];}_0x5bed6e=_['merge']({},_0x5bed6e,_0x76db8d['options']);return db[_0x6ca6('0x2b')][_0x6ca6('0x46')](_0x5bed6e)['then'](handleEntityNotFound(_0x2ffdfc,null))[_0x6ca6('0x27')](respondWithResult(_0x2ffdfc,null))[_0x6ca6('0x44')](handleError(_0x2ffdfc,null));};exports[_0x6ca6('0x47')]=function(_0x34a388,_0xc1928f){return db[_0x6ca6('0x2b')][_0x6ca6('0x47')](_0x34a388['body'],{})[_0x6ca6('0x27')](respondWithResult(_0xc1928f,0xc9))[_0x6ca6('0x44')](handleError(_0xc1928f,null));};exports[_0x6ca6('0x25')]=function(_0x4fde51,_0x408df3){if(_0x4fde51['body']['id']){delete _0x4fde51[_0x6ca6('0x48')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x4fde51['params']['id']}})[_0x6ca6('0x27')](handleEntityNotFound(_0x408df3,null))[_0x6ca6('0x27')](saveUpdates(_0x4fde51[_0x6ca6('0x48')],null))['then'](respondWithResult(_0x408df3,null))[_0x6ca6('0x44')](handleError(_0x408df3,null));};exports['destroy']=function(_0x1f552d,_0x1010a6){return db[_0x6ca6('0x2b')][_0x6ca6('0x46')]({'where':{'id':_0x1f552d[_0x6ca6('0x45')]['id']}})[_0x6ca6('0x27')](handleEntityNotFound(_0x1010a6,null))[_0x6ca6('0x27')](removeEntity(_0x1010a6,null))[_0x6ca6('0x44')](handleError(_0x1010a6,null));};
\ No newline at end of file
+var _0xb6b1=['set','Content-Range','apply','reject','save','update','then','error','name','send','map','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x4bb234,_0xac641f){var _0x21eba7=function(_0x2d2d96){while(--_0x2d2d96){_0x4bb234['push'](_0x4bb234['shift']());}};_0x21eba7(++_0xac641f);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0xb6b1[_0x119705];return _0x2affc2;};'use strict';var emlformat=require(_0x1b6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6b('0x2'));var moment=require(_0x1b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b6b('0x4'));var util=require('util');var path=require(_0x1b6b('0x5'));var sox=require(_0x1b6b('0x6'));var csv=require(_0x1b6b('0x7'));var ejs=require(_0x1b6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b6b('0x9'));var squel=require('squel');var crypto=require(_0x1b6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b6b('0xb'));var toCsv=require(_0x1b6b('0x7'));var querystring=require(_0x1b6b('0xc'));var Papa=require(_0x1b6b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6b('0xe'));var as=require(_0x1b6b('0xf'));var hardwareService=require(_0x1b6b('0x10'));var logger=require(_0x1b6b('0x11'))(_0x1b6b('0x12'));var utils=require(_0x1b6b('0x13'));var config=require(_0x1b6b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b6b('0x15'))['db'];function respondWithStatusCode(_0x3554b5,_0xf6a4be){_0xf6a4be=_0xf6a4be||0xcc;return function(_0x5abe44){if(_0x5abe44){return _0x3554b5[_0x1b6b('0x16')](_0xf6a4be);}return _0x3554b5['status'](_0xf6a4be)['end']();};}function respondWithResult(_0x2f540f,_0x20a2d7){_0x20a2d7=_0x20a2d7||0xc8;return function(_0x1e474f){if(_0x1e474f){return _0x2f540f[_0x1b6b('0x17')](_0x20a2d7)[_0x1b6b('0x18')](_0x1e474f);}};}function respondWithFilteredResult(_0x268fe9,_0x321263){return function(_0x553a6d){if(_0x553a6d){var _0x1069a4=typeof _0x321263[_0x1b6b('0x19')]===_0x1b6b('0x1a')&&typeof _0x321263[_0x1b6b('0x1b')]==='undefined';var _0x26345c=_0x553a6d[_0x1b6b('0x1c')];var _0x2e608b=_0x1069a4?0x0:_0x321263['offset'];var _0x923711=_0x1069a4?_0x553a6d[_0x1b6b('0x1c')]:_0x321263[_0x1b6b('0x19')]+_0x321263[_0x1b6b('0x1b')];var _0xacd21b;if(_0x923711>=_0x26345c){_0x923711=_0x26345c;_0xacd21b=0xc8;}else{_0xacd21b=0xce;}_0x268fe9[_0x1b6b('0x17')](_0xacd21b);return _0x268fe9[_0x1b6b('0x1d')](_0x1b6b('0x1e'),_0x2e608b+'-'+_0x923711+'/'+_0x26345c)[_0x1b6b('0x18')](_0x553a6d);}return null;};}function patchUpdates(_0x20a5a3){return function(_0x5dbd46){try{jsonpatch[_0x1b6b('0x1f')](_0x5dbd46,_0x20a5a3,!![]);}catch(_0x395118){return BPromise[_0x1b6b('0x20')](_0x395118);}return _0x5dbd46[_0x1b6b('0x21')]();};}function saveUpdates(_0x27974f,_0x276713){return function(_0x3d4ec2){if(_0x3d4ec2){return _0x3d4ec2[_0x1b6b('0x22')](_0x27974f)[_0x1b6b('0x23')](function(_0x4987ee){return _0x4987ee;});}return null;};}function removeEntity(_0x1b2cdf,_0x489e7a){return function(_0x4efab0){if(_0x4efab0){return _0x4efab0['destroy']()[_0x1b6b('0x23')](function(){_0x1b2cdf[_0x1b6b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a317c,_0x47c318){return function(_0x15dfc7){if(!_0x15dfc7){_0x6a317c[_0x1b6b('0x16')](0x194);}return _0x15dfc7;};}function handleError(_0x466c0c,_0x308955){_0x308955=_0x308955||0x1f4;return function(_0xd41b04){logger[_0x1b6b('0x24')](_0xd41b04['stack']);if(_0xd41b04[_0x1b6b('0x25')]){delete _0xd41b04[_0x1b6b('0x25')];}_0x466c0c[_0x1b6b('0x17')](_0x308955)[_0x1b6b('0x26')](_0xd41b04);};}exports['index']=function(_0x23dac4,_0x5a46bd){var _0x5bbcd8={},_0x39b055={},_0x4e9843={'count':0x0,'rows':[]};var _0x165fe8=_[_0x1b6b('0x27')](db['FreshdeskField']['rawAttributes'],function(_0x36878c){return{'name':_0x36878c[_0x1b6b('0x28')],'type':_0x36878c['type']['key']};});_0x39b055[_0x1b6b('0x29')]=_[_0x1b6b('0x27')](_0x165fe8,_0x1b6b('0x25'));_0x39b055[_0x1b6b('0x2a')]=_['keys'](_0x23dac4[_0x1b6b('0x2a')]);_0x39b055[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],_0x39b055[_0x1b6b('0x2a')]);_0x5bbcd8[_0x1b6b('0x2d')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x23dac4['query'][_0x1b6b('0x2e')]));_0x5bbcd8[_0x1b6b('0x2d')]=_0x5bbcd8[_0x1b6b('0x2d')][_0x1b6b('0x2f')]?_0x5bbcd8['attributes']:_0x39b055[_0x1b6b('0x29')];if(!_0x23dac4['query'][_0x1b6b('0x30')]('nolimit')){_0x5bbcd8['limit']=qs[_0x1b6b('0x1b')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x1b')]);_0x5bbcd8['offset']=qs[_0x1b6b('0x19')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x19')]);}_0x5bbcd8[_0x1b6b('0x31')]=qs[_0x1b6b('0x32')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x32')]);_0x5bbcd8[_0x1b6b('0x33')]=qs[_0x1b6b('0x2b')](_[_0x1b6b('0x34')](_0x23dac4[_0x1b6b('0x2a')],_0x39b055[_0x1b6b('0x2b')]),_0x165fe8);if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x35')]){_0x5bbcd8['where']=_[_0x1b6b('0x36')](_0x5bbcd8[_0x1b6b('0x33')],{'$or':_['map'](_0x165fe8,function(_0x41e0db){if(_0x41e0db['type']!==_0x1b6b('0x37')){var _0x19049f={};_0x19049f[_0x41e0db[_0x1b6b('0x25')]]={'$like':'%'+_0x23dac4['query'][_0x1b6b('0x35')]+'%'};return _0x19049f;}})});}_0x5bbcd8=_[_0x1b6b('0x36')]({},_0x5bbcd8,_0x23dac4[_0x1b6b('0x38')]);var _0x5578d9={'where':_0x5bbcd8[_0x1b6b('0x33')]};return db[_0x1b6b('0x39')][_0x1b6b('0x1c')](_0x5578d9)['then'](function(_0x48ece6){_0x4e9843['count']=_0x48ece6;if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x3a')]){_0x5bbcd8[_0x1b6b('0x3b')]=[{'all':!![]}];}return db[_0x1b6b('0x39')][_0x1b6b('0x3c')](_0x5bbcd8);})[_0x1b6b('0x23')](function(_0xe8bea5){_0x4e9843['rows']=_0xe8bea5;return _0x4e9843;})[_0x1b6b('0x23')](respondWithFilteredResult(_0x5a46bd,_0x5bbcd8))[_0x1b6b('0x3d')](handleError(_0x5a46bd,null));};exports[_0x1b6b('0x3e')]=function(_0x31c2bf,_0x1dcba5){var _0x3d8374={'raw':!![],'where':{'id':_0x31c2bf[_0x1b6b('0x3f')]['id']}},_0x5cb83a={};_0x5cb83a[_0x1b6b('0x29')]=_[_0x1b6b('0x40')](db[_0x1b6b('0x39')][_0x1b6b('0x41')]);_0x5cb83a[_0x1b6b('0x2a')]=_[_0x1b6b('0x40')](_0x31c2bf[_0x1b6b('0x2a')]);_0x5cb83a[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],_0x5cb83a[_0x1b6b('0x2a')]);_0x3d8374['attributes']=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x31c2bf[_0x1b6b('0x2a')][_0x1b6b('0x2e')]));_0x3d8374[_0x1b6b('0x2d')]=_0x3d8374['attributes']['length']?_0x3d8374[_0x1b6b('0x2d')]:_0x5cb83a['model'];if(_0x31c2bf[_0x1b6b('0x2a')]['includeAll']){_0x3d8374[_0x1b6b('0x3b')]=[{'all':!![]}];}_0x3d8374=_[_0x1b6b('0x36')]({},_0x3d8374,_0x31c2bf[_0x1b6b('0x38')]);return db[_0x1b6b('0x39')]['find'](_0x3d8374)[_0x1b6b('0x23')](handleEntityNotFound(_0x1dcba5,null))['then'](respondWithResult(_0x1dcba5,null))['catch'](handleError(_0x1dcba5,null));};exports[_0x1b6b('0x42')]=function(_0x123045,_0x151774){return db[_0x1b6b('0x39')]['create'](_0x123045[_0x1b6b('0x43')],{})['then'](respondWithResult(_0x151774,0xc9))[_0x1b6b('0x3d')](handleError(_0x151774,null));};exports[_0x1b6b('0x22')]=function(_0x281f19,_0x4b0b47){if(_0x281f19[_0x1b6b('0x43')]['id']){delete _0x281f19['body']['id'];}return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x281f19[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x4b0b47,null))[_0x1b6b('0x23')](saveUpdates(_0x281f19[_0x1b6b('0x43')],null))[_0x1b6b('0x23')](respondWithResult(_0x4b0b47,null))[_0x1b6b('0x3d')](handleError(_0x4b0b47,null));};exports['destroy']=function(_0x4c1e02,_0x2be336){return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x4c1e02[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x2be336,null))[_0x1b6b('0x23')](removeEntity(_0x2be336,null))[_0x1b6b('0x3d')](handleError(_0x2be336,null));};
\ No newline at end of file
index 49419ed..fb8a711 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dca=['lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','idField','FieldId'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0x4dca,0x1c0));var _0xa4dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4dca[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa4dc('0x0'));var util=require(_0xa4dc('0x1'));var logger=require(_0xa4dc('0x2'))('api');var moment=require(_0xa4dc('0x3'));var BPromise=require(_0xa4dc('0x4'));var rp=require(_0xa4dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4dc('0x6'));var config=require(_0xa4dc('0x7'));var attributes=require('./intFreshdeskField.attributes');module[_0xa4dc('0x8')]=function(_0x515137,_0x2628f9){return _0x515137[_0xa4dc('0x9')](_0xa4dc('0xa'),attributes,{'tableName':_0xa4dc('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xa4dc('0xc'),_0xa4dc('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5615=['define','FreshdeskField','freshdesk_unique_index','FieldId','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0x1e4b93,_0x3a4c8d){var _0x51aa4f=function(_0x2aa9af){while(--_0x2aa9af){_0x1e4b93['push'](_0x1e4b93['shift']());}};_0x51aa4f(++_0x3a4c8d);}(_0x5615,0xa0));var _0x5561=function(_0x2d4fca,_0x17d3f5){_0x2d4fca=_0x2d4fca-0x0;var _0xadb8c8=_0x5615[_0x2d4fca];return _0xadb8c8;};'use strict';var _=require(_0x5561('0x0'));var util=require(_0x5561('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5561('0x2'));var BPromise=require(_0x5561('0x3'));var rp=require(_0x5561('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5561('0x5'));var config=require(_0x5561('0x6'));var attributes=require(_0x5561('0x7'));module['exports']=function(_0x3aaddb,_0x1ef83c){return _0x3aaddb[_0x5561('0x8')](_0x5561('0x9'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x5561('0xa'),'fields':['idField',_0x5561('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index d90962c..ebce343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a17=['info','FreshdeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x439b55,_0x22fe8d){var _0x3be0f8=function(_0x420c9b){while(--_0x420c9b){_0x439b55['push'](_0x439b55['shift']());}};_0x3be0f8(++_0x22fe8d);}(_0x0a17,0x130));var _0x70a1=function(_0x130182,_0x161259){_0x130182=_0x130182-0x0;var _0x319127=_0x0a17[_0x130182];return _0x319127;};'use strict';var _=require('lodash');var util=require(_0x70a1('0x0'));var moment=require(_0x70a1('0x1'));var BPromise=require('bluebird');var rs=require(_0x70a1('0x2'));var fs=require('fs');var Redis=require(_0x70a1('0x3'));var db=require(_0x70a1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x70a1('0x5'))(_0x70a1('0x6'));var config=require(_0x70a1('0x7'));var jayson=require(_0x70a1('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3fe00b,_0x35dd87,_0x1f2362){return new BPromise(function(_0x110a5e,_0x161755){return client[_0x70a1('0x9')](_0x3fe00b,_0x1f2362)[_0x70a1('0xa')](function(_0xfb00f9){logger[_0x70a1('0xb')](_0x70a1('0xc'),_0x35dd87,'request\x20sent');logger[_0x70a1('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x35dd87,'request\x20sent',JSON[_0x70a1('0xe')](_0xfb00f9));if(_0xfb00f9[_0x70a1('0xf')]){if(_0xfb00f9[_0x70a1('0xf')][_0x70a1('0x10')]===0x1f4){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x35dd87,_0xfb00f9[_0x70a1('0xf')][_0x70a1('0x11')]);return _0x161755(_0xfb00f9['error'][_0x70a1('0x11')]);}logger[_0x70a1('0xf')](_0x70a1('0xc'),_0x35dd87,_0xfb00f9['error']['message']);return _0x110a5e(_0xfb00f9[_0x70a1('0xf')][_0x70a1('0x11')]);}else{logger['info'](_0x70a1('0xc'),_0x35dd87,_0x70a1('0x12'));_0x110a5e(_0xfb00f9[_0x70a1('0x13')][_0x70a1('0x11')]);}})[_0x70a1('0x14')](function(_0x1a6642){logger[_0x70a1('0xf')]('FreshdeskField,\x20%s,\x20%s',_0x35dd87,_0x1a6642);_0x161755(_0x1a6642);});});}
\ No newline at end of file
+var _0xceba=['lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','FreshdeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0xaa6529,_0x52f7db){var _0x39b304=function(_0x366394){while(--_0x366394){_0xaa6529['push'](_0xaa6529['shift']());}};_0x39b304(++_0x52f7db);}(_0xceba,0xd2));var _0xaceb=function(_0x340ec7,_0x31436a){_0x340ec7=_0x340ec7-0x0;var _0x2c553a=_0xceba[_0x340ec7];return _0x2c553a;};'use strict';var _=require(_0xaceb('0x0'));var util=require(_0xaceb('0x1'));var moment=require(_0xaceb('0x2'));var BPromise=require(_0xaceb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xaceb('0x4'));var logger=require(_0xaceb('0x5'))(_0xaceb('0x6'));var config=require(_0xaceb('0x7'));var jayson=require(_0xaceb('0x8'));var client=jayson[_0xaceb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x943cae,_0x4f2209,_0x9554d1){return new BPromise(function(_0x2dc985,_0x289c26){return client['request'](_0x943cae,_0x9554d1)[_0xaceb('0xa')](function(_0x4900e){logger[_0xaceb('0xb')](_0xaceb('0xc'),_0x4f2209,'request\x20sent');logger[_0xaceb('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x4f2209,_0xaceb('0xe'),JSON[_0xaceb('0xf')](_0x4900e));if(_0x4900e[_0xaceb('0x10')]){if(_0x4900e[_0xaceb('0x10')][_0xaceb('0x11')]===0x1f4){logger[_0xaceb('0x10')](_0xaceb('0xc'),_0x4f2209,_0x4900e[_0xaceb('0x10')]['message']);return _0x289c26(_0x4900e[_0xaceb('0x10')][_0xaceb('0x12')]);}logger[_0xaceb('0x10')](_0xaceb('0xc'),_0x4f2209,_0x4900e[_0xaceb('0x10')][_0xaceb('0x12')]);return _0x2dc985(_0x4900e[_0xaceb('0x10')][_0xaceb('0x12')]);}else{logger[_0xaceb('0xb')](_0xaceb('0xc'),_0x4f2209,'request\x20sent');_0x2dc985(_0x4900e[_0xaceb('0x13')][_0xaceb('0x12')]);}})[_0xaceb('0x14')](function(_0x3b2b99){logger['error'](_0xaceb('0xc'),_0x4f2209,_0x3b2b99);_0x289c26(_0x3b2b99);});});}
\ No newline at end of file
index 2572a7d..a61cdbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xea28=['index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','get'];(function(_0x711022,_0x498262){var _0x2c5cc1=function(_0x1cf52f){while(--_0x1cf52f){_0x711022['push'](_0x711022['shift']());}};_0x2c5cc1(++_0x498262);}(_0xea28,0x13a));var _0x8ea2=function(_0x184ad2,_0x131ee7){_0x184ad2=_0x184ad2-0x0;var _0x2d8e86=_0xea28[_0x184ad2];return _0x2d8e86;};'use strict';var multer=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var path=require(_0x8ea2('0x2'));var timeout=require(_0x8ea2('0x3'));var express=require(_0x8ea2('0x4'));var router=express[_0x8ea2('0x5')]();var fs_extra=require(_0x8ea2('0x6'));var auth=require(_0x8ea2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8ea2('0x8'));var controller=require(_0x8ea2('0x9'));router[_0x8ea2('0xa')]('/',auth['isAuthenticated'](),controller[_0x8ea2('0xb')]);router[_0x8ea2('0xa')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0xe')]);router[_0x8ea2('0xa')](_0x8ea2('0xf'),auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x10')]);router[_0x8ea2('0xa')](_0x8ea2('0x11'),auth[_0x8ea2('0xd')](),controller['getFields']);router['post']('/',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x12')]);router[_0x8ea2('0x13')]('/:id/configurations',auth[_0x8ea2('0xd')](),controller[_0x8ea2('0x14')]);router[_0x8ea2('0x15')](_0x8ea2('0xc'),auth[_0x8ea2('0xd')](),controller['update']);router[_0x8ea2('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x8ea2('0x17')]);module[_0x8ea2('0x18')]=router;
\ No newline at end of file
+var _0xee5b=['multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','delete','/:id'];(function(_0x2e03bd,_0x4f3058){var _0x580d3a=function(_0x2de8ff){while(--_0x2de8ff){_0x2e03bd['push'](_0x2e03bd['shift']());}};_0x580d3a(++_0x4f3058);}(_0xee5b,0x1f4));var _0xbee5=function(_0x32fac0,_0x433566){_0x32fac0=_0x32fac0-0x0;var _0xe919c2=_0xee5b[_0x32fac0];return _0xe919c2;};'use strict';var multer=require(_0xbee5('0x0'));var util=require('util');var path=require(_0xbee5('0x1'));var timeout=require(_0xbee5('0x2'));var express=require('express');var router=express[_0xbee5('0x3')]();var fs_extra=require(_0xbee5('0x4'));var auth=require(_0xbee5('0x5'));var interaction=require(_0xbee5('0x6'));var config=require('../../config/environment');var controller=require('./intFreshsalesAccount.controller');router[_0xbee5('0x7')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0x9')]);router[_0xbee5('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth[_0xbee5('0x8')](),controller[_0xbee5('0xa')]);router[_0xbee5('0x7')](_0xbee5('0xb'),auth['isAuthenticated'](),controller[_0xbee5('0xc')]);router[_0xbee5('0xd')]('/',auth[_0xbee5('0x8')](),controller[_0xbee5('0xe')]);router[_0xbee5('0xd')](_0xbee5('0xf'),auth[_0xbee5('0x8')](),controller[_0xbee5('0x10')]);router[_0xbee5('0x11')]('/:id',auth[_0xbee5('0x8')](),controller['update']);router[_0xbee5('0x12')](_0xbee5('0x13'),auth[_0xbee5('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index f2b7acd..148fdca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2542=['remoteUri','sequelize','exports','STRING','username'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x2542,0x169));var _0x2254=function(_0x4506ee,_0x468b38){_0x4506ee=_0x4506ee-0x0;var _0x13abac=_0x2542[_0x4506ee];return _0x13abac;};'use strict';var Sequelize=require(_0x2254('0x0'));module[_0x2254('0x1')]={'name':{'type':Sequelize[_0x2254('0x2')]},'description':{'type':Sequelize[_0x2254('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x2254('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2254('0x2')],'unique':_0x2254('0x4')},'serverUrl':{'type':Sequelize[_0x2254('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x77e6=['STRING','username','sequelize','exports'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x77e6,0x1a6));var _0x677e=function(_0x51981e,_0x2965d8){_0x51981e=_0x51981e-0x0;var _0x2c9bd2=_0x77e6[_0x51981e];return _0x2c9bd2;};'use strict';var Sequelize=require(_0x677e('0x0'));module[_0x677e('0x1')]={'name':{'type':Sequelize[_0x677e('0x2')]},'description':{'type':Sequelize[_0x677e('0x2')]},'username':{'type':Sequelize[_0x677e('0x2')],'unique':_0x677e('0x3')},'apiKey':{'type':Sequelize[_0x677e('0x2')]},'remoteUri':{'type':Sequelize[_0x677e('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x677e('0x2')],'allowNull':![]}};
\ No newline at end of file
index 55b7911..72aa367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45cc=['FreshsalesField','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','destroy','then','end','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','find','update','body','getConfigurations','params','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','FreshsalesConfiguration','create'];(function(_0x9e55f6,_0x5df434){var _0x220e55=function(_0x1fd729){while(--_0x1fd729){_0x9e55f6['push'](_0x9e55f6['shift']());}};_0x220e55(++_0x5df434);}(_0x45cc,0x13a));var _0xc45c=function(_0x39f5b,_0x224393){_0x39f5b=_0x39f5b-0x0;var _0x29c795=_0x45cc[_0x39f5b];return _0x29c795;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc45c('0x0'));var zipdir=require(_0xc45c('0x1'));var jsonpatch=require(_0xc45c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc45c('0x3'));var Mustache=require(_0xc45c('0x4'));var util=require(_0xc45c('0x5'));var path=require(_0xc45c('0x6'));var sox=require(_0xc45c('0x7'));var csv=require('to-csv');var ejs=require(_0xc45c('0x8'));var fs=require('fs');var fs_extra=require(_0xc45c('0x9'));var _=require('lodash');var squel=require(_0xc45c('0xa'));var crypto=require(_0xc45c('0xb'));var jsforce=require(_0xc45c('0xc'));var deskjs=require(_0xc45c('0xd'));var toCsv=require(_0xc45c('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc45c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc45c('0x10'));var as=require(_0xc45c('0x11'));var hardwareService=require(_0xc45c('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xc45c('0x13'));var config=require(_0xc45c('0x14'));var licenseUtil=require(_0xc45c('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x21ce58,_0x14c9e8){_0x14c9e8=_0x14c9e8||0xcc;return function(_0x5bc647){if(_0x5bc647){return _0x21ce58[_0xc45c('0x16')](_0x14c9e8);}return _0x21ce58[_0xc45c('0x17')](_0x14c9e8)['end']();};}function respondWithResult(_0x74077c,_0x51e036){_0x51e036=_0x51e036||0xc8;return function(_0x8a79f5){if(_0x8a79f5){return _0x74077c['status'](_0x51e036)[_0xc45c('0x18')](_0x8a79f5);}};}function respondWithFilteredResult(_0x561f21,_0x381522){return function(_0xae3e16){if(_0xae3e16){var _0x286386=typeof _0x381522[_0xc45c('0x19')]===_0xc45c('0x1a')&&typeof _0x381522['limit']===_0xc45c('0x1a');var _0xe6e8ac=_0xae3e16[_0xc45c('0x1b')];var _0x578983=_0x286386?0x0:_0x381522[_0xc45c('0x19')];var _0x3c104e=_0x286386?_0xae3e16[_0xc45c('0x1b')]:_0x381522[_0xc45c('0x19')]+_0x381522[_0xc45c('0x1c')];var _0x50aed6;if(_0x3c104e>=_0xe6e8ac){_0x3c104e=_0xe6e8ac;_0x50aed6=0xc8;}else{_0x50aed6=0xce;}_0x561f21[_0xc45c('0x17')](_0x50aed6);return _0x561f21[_0xc45c('0x1d')](_0xc45c('0x1e'),_0x578983+'-'+_0x3c104e+'/'+_0xe6e8ac)[_0xc45c('0x18')](_0xae3e16);}return null;};}function patchUpdates(_0x348c67){return function(_0x3d29ae){try{jsonpatch['apply'](_0x3d29ae,_0x348c67,!![]);}catch(_0x57fbaf){return BPromise[_0xc45c('0x1f')](_0x57fbaf);}return _0x3d29ae[_0xc45c('0x20')]();};}function saveUpdates(_0x24c624,_0x5b417b){return function(_0x1a90ab){if(_0x1a90ab){return _0x1a90ab['update'](_0x24c624)['then'](function(_0x3dd5ab){return _0x3dd5ab;});}return null;};}function removeEntity(_0x1bc562,_0x5a1a80){return function(_0x6f6a4a){if(_0x6f6a4a){return _0x6f6a4a[_0xc45c('0x21')]()[_0xc45c('0x22')](function(){_0x1bc562[_0xc45c('0x17')](0xcc)[_0xc45c('0x23')]();});}};}function handleEntityNotFound(_0x3dc3ca,_0x114b95){return function(_0x1c363b){if(!_0x1c363b){_0x3dc3ca[_0xc45c('0x16')](0x194);}return _0x1c363b;};}function handleError(_0x2e2e8b,_0x451093){_0x451093=_0x451093||0x1f4;return function(_0x368eb8){logger[_0xc45c('0x24')](_0x368eb8[_0xc45c('0x25')]);if(_0x368eb8[_0xc45c('0x26')]){delete _0x368eb8[_0xc45c('0x26')];}_0x2e2e8b[_0xc45c('0x17')](_0x451093)[_0xc45c('0x27')](_0x368eb8);};}exports[_0xc45c('0x28')]=function(_0x3401b4,_0x19394d){var _0x2316e9={},_0xe0c860={},_0x32654={'count':0x0,'rows':[]};var _0x2814c0=_[_0xc45c('0x29')](db[_0xc45c('0x2a')][_0xc45c('0x2b')],function(_0x4b6da6){return{'name':_0x4b6da6[_0xc45c('0x2c')],'type':_0x4b6da6[_0xc45c('0x2d')]['key']};});_0xe0c860[_0xc45c('0x2e')]=_[_0xc45c('0x29')](_0x2814c0,_0xc45c('0x26'));_0xe0c860[_0xc45c('0x2f')]=_[_0xc45c('0x30')](_0x3401b4[_0xc45c('0x2f')]);_0xe0c860['filters']=_['intersection'](_0xe0c860[_0xc45c('0x2e')],_0xe0c860[_0xc45c('0x2f')]);_0x2316e9[_0xc45c('0x31')]=_[_0xc45c('0x32')](_0xe0c860[_0xc45c('0x2e')],qs[_0xc45c('0x33')](_0x3401b4[_0xc45c('0x2f')][_0xc45c('0x33')]));_0x2316e9[_0xc45c('0x31')]=_0x2316e9[_0xc45c('0x31')][_0xc45c('0x34')]?_0x2316e9[_0xc45c('0x31')]:_0xe0c860[_0xc45c('0x2e')];if(!_0x3401b4[_0xc45c('0x2f')][_0xc45c('0x35')](_0xc45c('0x36'))){_0x2316e9[_0xc45c('0x1c')]=qs['limit'](_0x3401b4[_0xc45c('0x2f')][_0xc45c('0x1c')]);_0x2316e9[_0xc45c('0x19')]=qs[_0xc45c('0x19')](_0x3401b4[_0xc45c('0x2f')][_0xc45c('0x19')]);}_0x2316e9[_0xc45c('0x37')]=qs[_0xc45c('0x38')](_0x3401b4[_0xc45c('0x2f')][_0xc45c('0x38')]);_0x2316e9['where']=qs[_0xc45c('0x39')](_[_0xc45c('0x3a')](_0x3401b4[_0xc45c('0x2f')],_0xe0c860[_0xc45c('0x39')]),_0x2814c0);if(_0x3401b4[_0xc45c('0x2f')][_0xc45c('0x3b')]){_0x2316e9[_0xc45c('0x3c')]=_[_0xc45c('0x3d')](_0x2316e9[_0xc45c('0x3c')],{'$or':_[_0xc45c('0x29')](_0x2814c0,function(_0x2014a7){if(_0x2014a7['type']!==_0xc45c('0x3e')){var _0x9f5b67={};_0x9f5b67[_0x2014a7[_0xc45c('0x26')]]={'$like':'%'+_0x3401b4[_0xc45c('0x2f')][_0xc45c('0x3b')]+'%'};return _0x9f5b67;}})});}_0x2316e9=_[_0xc45c('0x3d')]({},_0x2316e9,_0x3401b4[_0xc45c('0x3f')]);var _0x5f0a1f={'where':_0x2316e9['where']};return db[_0xc45c('0x2a')][_0xc45c('0x1b')](_0x5f0a1f)[_0xc45c('0x22')](function(_0x3fe896){_0x32654[_0xc45c('0x1b')]=_0x3fe896;if(_0x3401b4[_0xc45c('0x2f')][_0xc45c('0x40')]){_0x2316e9[_0xc45c('0x41')]=[{'all':!![]}];}return db[_0xc45c('0x2a')][_0xc45c('0x42')](_0x2316e9);})[_0xc45c('0x22')](function(_0x598840){_0x32654['rows']=_0x598840;return _0x32654;})[_0xc45c('0x22')](respondWithFilteredResult(_0x19394d,_0x2316e9))[_0xc45c('0x43')](handleError(_0x19394d,null));};exports['show']=function(_0x3064ad,_0x2aefe3){var _0xfc3f2={'raw':![],'where':{'id':_0x3064ad['params']['id']}},_0x5cc07e={};_0x5cc07e['model']=_[_0xc45c('0x30')](db[_0xc45c('0x2a')][_0xc45c('0x2b')]);_0x5cc07e[_0xc45c('0x2f')]=_[_0xc45c('0x30')](_0x3064ad[_0xc45c('0x2f')]);_0x5cc07e['filters']=_[_0xc45c('0x32')](_0x5cc07e['model'],_0x5cc07e[_0xc45c('0x2f')]);_0xfc3f2['attributes']=_['intersection'](_0x5cc07e[_0xc45c('0x2e')],qs[_0xc45c('0x33')](_0x3064ad[_0xc45c('0x2f')][_0xc45c('0x33')]));_0xfc3f2['attributes']=_0xfc3f2['attributes']['length']?_0xfc3f2[_0xc45c('0x31')]:_0x5cc07e['model'];if(_0x3064ad[_0xc45c('0x2f')][_0xc45c('0x40')]){_0xfc3f2['include']=[{'all':!![]}];}_0xfc3f2=_[_0xc45c('0x3d')]({},_0xfc3f2,_0x3064ad[_0xc45c('0x3f')]);return db[_0xc45c('0x2a')][_0xc45c('0x44')](_0xfc3f2)['then'](handleEntityNotFound(_0x2aefe3,null))[_0xc45c('0x22')](respondWithResult(_0x2aefe3,null))[_0xc45c('0x43')](handleError(_0x2aefe3,null));};exports['create']=function(_0x5280e5,_0x3a64a3){return db[_0xc45c('0x2a')]['create'](_0x5280e5['body'],{})[_0xc45c('0x22')](respondWithResult(_0x3a64a3,0xc9))[_0xc45c('0x43')](handleError(_0x3a64a3,null));};exports[_0xc45c('0x45')]=function(_0x1dac28,_0x2e6342){if(_0x1dac28['body']['id']){delete _0x1dac28['body']['id'];}return db['FreshsalesAccount'][_0xc45c('0x44')]({'where':{'id':_0x1dac28['params']['id']}})[_0xc45c('0x22')](handleEntityNotFound(_0x2e6342,null))[_0xc45c('0x22')](saveUpdates(_0x1dac28[_0xc45c('0x46')],null))['then'](respondWithResult(_0x2e6342,null))[_0xc45c('0x43')](handleError(_0x2e6342,null));};exports['destroy']=function(_0x59548a,_0x59a266){return db[_0xc45c('0x2a')][_0xc45c('0x44')]({'where':{'id':_0x59548a['params']['id']}})[_0xc45c('0x22')](handleEntityNotFound(_0x59a266,null))[_0xc45c('0x22')](removeEntity(_0x59a266,null))['catch'](handleError(_0x59a266,null));};exports[_0xc45c('0x47')]=function(_0x1b7f60,_0x27d330,_0x378976){var _0x5d38ef={};var _0x5c6a1d={};var _0x301817;var _0x5600e2;return db[_0xc45c('0x2a')]['findOne']({'where':{'id':_0x1b7f60[_0xc45c('0x48')]['id']}})[_0xc45c('0x22')](handleEntityNotFound(_0x27d330,null))[_0xc45c('0x22')](function(_0x259746){if(_0x259746){_0x301817=_0x259746;_0x5c6a1d[_0xc45c('0x2e')]=_['keys'](db['FreshsalesConfiguration']['rawAttributes']);_0x5c6a1d[_0xc45c('0x2f')]=_[_0xc45c('0x30')](_0x1b7f60[_0xc45c('0x2f')]);_0x5c6a1d[_0xc45c('0x39')]=_[_0xc45c('0x32')](_0x5c6a1d[_0xc45c('0x2e')],_0x5c6a1d[_0xc45c('0x2f')]);_0x5d38ef[_0xc45c('0x31')]=_[_0xc45c('0x32')](_0x5c6a1d[_0xc45c('0x2e')],qs['fields'](_0x1b7f60[_0xc45c('0x2f')][_0xc45c('0x33')]));_0x5d38ef[_0xc45c('0x31')]=_0x5d38ef[_0xc45c('0x31')]['length']?_0x5d38ef[_0xc45c('0x31')]:_0x5c6a1d[_0xc45c('0x2e')];_0x5d38ef[_0xc45c('0x37')]=qs[_0xc45c('0x38')](_0x1b7f60[_0xc45c('0x2f')][_0xc45c('0x38')]);_0x5d38ef[_0xc45c('0x3c')]=qs[_0xc45c('0x39')](_[_0xc45c('0x3a')](_0x1b7f60['query'],_0x5c6a1d[_0xc45c('0x39')]));if(_0x1b7f60[_0xc45c('0x2f')][_0xc45c('0x3b')]){_0x5d38ef[_0xc45c('0x3c')]=_[_0xc45c('0x3d')](_0x5d38ef['where'],{'$or':_['map'](_0x5d38ef['attributes'],function(_0x4a02c7){var _0x5807b5={};_0x5807b5[_0x4a02c7]={'$like':'%'+_0x1b7f60[_0xc45c('0x2f')][_0xc45c('0x3b')]+'%'};return _0x5807b5;})});}_0x5d38ef=_['merge']({},_0x5d38ef,_0x1b7f60[_0xc45c('0x3f')]);return _0x301817[_0xc45c('0x47')](_0x5d38ef);}})[_0xc45c('0x22')](function(_0x3060e0){if(_0x3060e0){_0x5600e2=_0x3060e0[_0xc45c('0x34')];if(!_0x1b7f60['query'][_0xc45c('0x35')](_0xc45c('0x36'))){_0x5d38ef[_0xc45c('0x1c')]=qs[_0xc45c('0x1c')](_0x1b7f60[_0xc45c('0x2f')][_0xc45c('0x1c')]);_0x5d38ef['offset']=qs[_0xc45c('0x19')](_0x1b7f60[_0xc45c('0x2f')][_0xc45c('0x19')]);}return _0x301817[_0xc45c('0x47')](_0x5d38ef);}})[_0xc45c('0x22')](function(_0x206f66){if(_0x206f66){return _0x206f66?{'count':_0x5600e2,'rows':_0x206f66}:null;}})[_0xc45c('0x22')](respondWithResult(_0x27d330,null))[_0xc45c('0x43')](handleError(_0x27d330,null));};exports[_0xc45c('0x49')]=function(_0x5d08c5,_0x84e5fa,_0x5051c9){if(_0x5d08c5[_0xc45c('0x46')]['id']){delete _0x5d08c5['body']['id'];}return db[_0xc45c('0x2a')][_0xc45c('0x4a')]({'where':{'id':_0x5d08c5[_0xc45c('0x48')]['id']}})[_0xc45c('0x22')](handleEntityNotFound(_0x84e5fa,null))[_0xc45c('0x22')](function(_0x28798b){if(_0x28798b){_0x5d08c5['body'][_0xc45c('0x4b')]=_0x28798b['id'];_0x5d08c5[_0xc45c('0x46')][_0xc45c('0x4c')]=integrations['getSubjects'](_0x5d08c5[_0xc45c('0x46')][_0xc45c('0x4d')],_0x5d08c5[_0xc45c('0x46')]['type']);_0x5d08c5[_0xc45c('0x46')][_0xc45c('0x4e')]=integrations[_0xc45c('0x4f')](_0x5d08c5[_0xc45c('0x46')][_0xc45c('0x4d')],_0x5d08c5['body'][_0xc45c('0x2d')]);return db[_0xc45c('0x50')][_0xc45c('0x51')](_0x5d08c5[_0xc45c('0x46')],{'include':[{'model':db[_0xc45c('0x52')],'as':_0xc45c('0x4c')},{'model':db['FreshsalesField'],'as':_0xc45c('0x4e')}]});}return null;})['then'](respondWithResult(_0x84e5fa,null))[_0xc45c('0x43')](handleError(_0x84e5fa,null));};exports['getFields']=function(_0x2cf3b4,_0x7bb495,_0x9ca492){var _0x6af823='';var _0xb98dc='';return db[_0xc45c('0x2a')]['findOne']({'where':{'id':_0x2cf3b4['params']['id']},'attributes':['id','username',_0xc45c('0x53'),_0xc45c('0x54')]})[_0xc45c('0x22')](handleEntityNotFound(_0x7bb495,null))['then'](function(_0x4490c3){if(_0x4490c3){_0xb98dc=_0x4490c3['username'];_0x6af823=_0x4490c3['remoteUri'];var _0x16d21d=_0x4490c3[_0xc45c('0x53')][_0xc45c('0x55')](-0x1);if(_0x16d21d==='/'){_0x6af823=_0x6af823['substring'](0x0,_0x6af823[_0xc45c('0x56')](_0x16d21d));}return rp({'method':_0xc45c('0x57'),'uri':util[_0xc45c('0x58')](_0xc45c('0x59'),_0x6af823,_0xc45c('0x5a')),'headers':{'Authorization':_0xc45c('0x5b')+_0x4490c3[_0xc45c('0x54')]},'json':!![]});}})['then'](function(_0x13b046){if(_0x13b046){var _0xc52405=_0x13b046[_0xc45c('0x5c')];var _0x2580f6=![];var _0x1f20ee=null;for(_0x1f20ee=0x0;_0x1f20ee<_0xc52405[_0xc45c('0x34')];_0x1f20ee++){if(_0xc52405[_0x1f20ee][_0xc45c('0x5d')]===_0xb98dc){_0x2580f6=!![];}}if(_0x2580f6){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xc45c('0x5e')});}}})[_0xc45c('0x22')](respondWithResult(_0x7bb495,null))[_0xc45c('0x43')](function(_0x545d80){var _0x2be2e6=_0x2cf3b4[_0xc45c('0x2f')][_0xc45c('0x5f')]?0x1f4:_0x545d80[_0xc45c('0x60')]||0x1f4;logger['error'](_0xc45c('0x61'),'getFields',_0x2be2e6,JSON['stringify'](_0x545d80));delete _0x545d80[_0xc45c('0x26')];if(_0x2be2e6===0x191){_0x2be2e6=0x190;}_0x7bb495['status'](_0x2be2e6)[_0xc45c('0x27')](_0x2cf3b4[_0xc45c('0x2f')][_0xc45c('0x5f')]?{'message':_0xc45c('0x62'),'statusCode':_0x545d80[_0xc45c('0x60')]}:_0x545d80);});};
\ No newline at end of file
+var _0x43f5=['name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','length','create','body','find','params','getConfigurations','FreshsalesConfiguration','hasOwnProperty','addConfiguration','findOne','getSubjects','getDescriptions','channel','FreshsalesField','Subjects','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0xa6c94a,_0x55a8b1){var _0x2f7674=function(_0x1df5fe){while(--_0x1df5fe){_0xa6c94a['push'](_0xa6c94a['shift']());}};_0x2f7674(++_0x55a8b1);}(_0x43f5,0x175));var _0x543f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x43f5[_0x413feb];return _0x40ee88;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x543f('0x0'));var zipdir=require(_0x543f('0x1'));var jsonpatch=require(_0x543f('0x2'));var rp=require(_0x543f('0x3'));var moment=require(_0x543f('0x4'));var BPromise=require(_0x543f('0x5'));var Mustache=require('mustache');var util=require(_0x543f('0x6'));var path=require(_0x543f('0x7'));var sox=require(_0x543f('0x8'));var csv=require(_0x543f('0x9'));var ejs=require(_0x543f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x543f('0xb'));var jsforce=require(_0x543f('0xc'));var deskjs=require(_0x543f('0xd'));var toCsv=require(_0x543f('0x9'));var querystring=require(_0x543f('0xe'));var Papa=require(_0x543f('0xf'));var Redis=require(_0x543f('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x543f('0x11'));var as=require(_0x543f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x543f('0x13'));var utils=require(_0x543f('0x14'));var config=require(_0x543f('0x15'));var licenseUtil=require(_0x543f('0x16'));var db=require(_0x543f('0x17'))['db'];var integrations=require(_0x543f('0x18'));function respondWithStatusCode(_0x3b80d2,_0x4d6311){_0x4d6311=_0x4d6311||0xcc;return function(_0x207aec){if(_0x207aec){return _0x3b80d2[_0x543f('0x19')](_0x4d6311);}return _0x3b80d2[_0x543f('0x1a')](_0x4d6311)[_0x543f('0x1b')]();};}function respondWithResult(_0x43f82f,_0x4f7e94){_0x4f7e94=_0x4f7e94||0xc8;return function(_0xe1adc6){if(_0xe1adc6){return _0x43f82f[_0x543f('0x1a')](_0x4f7e94)[_0x543f('0x1c')](_0xe1adc6);}};}function respondWithFilteredResult(_0x2ca4c9,_0x28ed34){return function(_0x21154d){if(_0x21154d){var _0xa858be=typeof _0x28ed34['offset']===_0x543f('0x1d')&&typeof _0x28ed34[_0x543f('0x1e')]==='undefined';var _0x337c77=_0x21154d[_0x543f('0x1f')];var _0x1696dd=_0xa858be?0x0:_0x28ed34[_0x543f('0x20')];var _0x5f395b=_0xa858be?_0x21154d[_0x543f('0x1f')]:_0x28ed34[_0x543f('0x20')]+_0x28ed34[_0x543f('0x1e')];var _0x55053e;if(_0x5f395b>=_0x337c77){_0x5f395b=_0x337c77;_0x55053e=0xc8;}else{_0x55053e=0xce;}_0x2ca4c9[_0x543f('0x1a')](_0x55053e);return _0x2ca4c9[_0x543f('0x21')](_0x543f('0x22'),_0x1696dd+'-'+_0x5f395b+'/'+_0x337c77)[_0x543f('0x1c')](_0x21154d);}return null;};}function patchUpdates(_0x5a5f6a){return function(_0x5b7924){try{jsonpatch[_0x543f('0x23')](_0x5b7924,_0x5a5f6a,!![]);}catch(_0x487ca3){return BPromise[_0x543f('0x24')](_0x487ca3);}return _0x5b7924[_0x543f('0x25')]();};}function saveUpdates(_0x15243e,_0x39d508){return function(_0x418b20){if(_0x418b20){return _0x418b20[_0x543f('0x26')](_0x15243e)[_0x543f('0x27')](function(_0x37a6a7){return _0x37a6a7;});}return null;};}function removeEntity(_0x426609,_0x142ce9){return function(_0x1eb064){if(_0x1eb064){return _0x1eb064[_0x543f('0x28')]()[_0x543f('0x27')](function(){_0x426609['status'](0xcc)[_0x543f('0x1b')]();});}};}function handleEntityNotFound(_0x58861f,_0x1548f9){return function(_0x1a4cf4){if(!_0x1a4cf4){_0x58861f[_0x543f('0x19')](0x194);}return _0x1a4cf4;};}function handleError(_0x2ebbc4,_0x4b3698){_0x4b3698=_0x4b3698||0x1f4;return function(_0x3e3a65){logger[_0x543f('0x29')](_0x3e3a65[_0x543f('0x2a')]);if(_0x3e3a65[_0x543f('0x2b')]){delete _0x3e3a65[_0x543f('0x2b')];}_0x2ebbc4[_0x543f('0x1a')](_0x4b3698)['send'](_0x3e3a65);};}exports[_0x543f('0x2c')]=function(_0x24c402,_0x362963){var _0x30b1ae={},_0x6a50fa={},_0x3602e4={'count':0x0,'rows':[]};var _0x32d298=_[_0x543f('0x2d')](db[_0x543f('0x2e')][_0x543f('0x2f')],function(_0x2508e8){return{'name':_0x2508e8[_0x543f('0x30')],'type':_0x2508e8[_0x543f('0x31')][_0x543f('0x32')]};});_0x6a50fa[_0x543f('0x33')]=_[_0x543f('0x2d')](_0x32d298,_0x543f('0x2b'));_0x6a50fa[_0x543f('0x34')]=_[_0x543f('0x35')](_0x24c402[_0x543f('0x34')]);_0x6a50fa[_0x543f('0x36')]=_[_0x543f('0x37')](_0x6a50fa[_0x543f('0x33')],_0x6a50fa[_0x543f('0x34')]);_0x30b1ae[_0x543f('0x38')]=_[_0x543f('0x37')](_0x6a50fa['model'],qs['fields'](_0x24c402[_0x543f('0x34')][_0x543f('0x39')]));_0x30b1ae['attributes']=_0x30b1ae[_0x543f('0x38')]['length']?_0x30b1ae[_0x543f('0x38')]:_0x6a50fa[_0x543f('0x33')];if(!_0x24c402['query']['hasOwnProperty'](_0x543f('0x3a'))){_0x30b1ae[_0x543f('0x1e')]=qs['limit'](_0x24c402[_0x543f('0x34')][_0x543f('0x1e')]);_0x30b1ae[_0x543f('0x20')]=qs[_0x543f('0x20')](_0x24c402[_0x543f('0x34')][_0x543f('0x20')]);}_0x30b1ae[_0x543f('0x3b')]=qs[_0x543f('0x3c')](_0x24c402['query'][_0x543f('0x3c')]);_0x30b1ae[_0x543f('0x3d')]=qs['filters'](_[_0x543f('0x3e')](_0x24c402[_0x543f('0x34')],_0x6a50fa[_0x543f('0x36')]),_0x32d298);if(_0x24c402[_0x543f('0x34')][_0x543f('0x3f')]){_0x30b1ae[_0x543f('0x3d')]=_[_0x543f('0x40')](_0x30b1ae['where'],{'$or':_[_0x543f('0x2d')](_0x32d298,function(_0x40768e){if(_0x40768e[_0x543f('0x31')]!=='VIRTUAL'){var _0x1f0c81={};_0x1f0c81[_0x40768e[_0x543f('0x2b')]]={'$like':'%'+_0x24c402[_0x543f('0x34')][_0x543f('0x3f')]+'%'};return _0x1f0c81;}})});}_0x30b1ae=_[_0x543f('0x40')]({},_0x30b1ae,_0x24c402[_0x543f('0x41')]);var _0x4e74e8={'where':_0x30b1ae[_0x543f('0x3d')]};return db['FreshsalesAccount'][_0x543f('0x1f')](_0x4e74e8)[_0x543f('0x27')](function(_0x28d30a){_0x3602e4[_0x543f('0x1f')]=_0x28d30a;if(_0x24c402[_0x543f('0x34')][_0x543f('0x42')]){_0x30b1ae[_0x543f('0x43')]=[{'all':!![]}];}return db[_0x543f('0x2e')][_0x543f('0x44')](_0x30b1ae);})['then'](function(_0x384ba8){_0x3602e4[_0x543f('0x45')]=_0x384ba8;return _0x3602e4;})[_0x543f('0x27')](respondWithFilteredResult(_0x362963,_0x30b1ae))[_0x543f('0x46')](handleError(_0x362963,null));};exports['show']=function(_0x27dd8e,_0x39c537){var _0x3cfb5e={'raw':![],'where':{'id':_0x27dd8e['params']['id']}},_0x275af8={};_0x275af8[_0x543f('0x33')]=_['keys'](db['FreshsalesAccount'][_0x543f('0x2f')]);_0x275af8[_0x543f('0x34')]=_[_0x543f('0x35')](_0x27dd8e['query']);_0x275af8['filters']=_['intersection'](_0x275af8[_0x543f('0x33')],_0x275af8[_0x543f('0x34')]);_0x3cfb5e[_0x543f('0x38')]=_[_0x543f('0x37')](_0x275af8['model'],qs[_0x543f('0x39')](_0x27dd8e[_0x543f('0x34')][_0x543f('0x39')]));_0x3cfb5e[_0x543f('0x38')]=_0x3cfb5e[_0x543f('0x38')][_0x543f('0x47')]?_0x3cfb5e['attributes']:_0x275af8[_0x543f('0x33')];if(_0x27dd8e[_0x543f('0x34')][_0x543f('0x42')]){_0x3cfb5e[_0x543f('0x43')]=[{'all':!![]}];}_0x3cfb5e=_[_0x543f('0x40')]({},_0x3cfb5e,_0x27dd8e[_0x543f('0x41')]);return db[_0x543f('0x2e')]['find'](_0x3cfb5e)['then'](handleEntityNotFound(_0x39c537,null))[_0x543f('0x27')](respondWithResult(_0x39c537,null))[_0x543f('0x46')](handleError(_0x39c537,null));};exports[_0x543f('0x48')]=function(_0x1d5fd1,_0x2b7f29){return db[_0x543f('0x2e')][_0x543f('0x48')](_0x1d5fd1[_0x543f('0x49')],{})[_0x543f('0x27')](respondWithResult(_0x2b7f29,0xc9))[_0x543f('0x46')](handleError(_0x2b7f29,null));};exports[_0x543f('0x26')]=function(_0x284616,_0x3e879d){if(_0x284616['body']['id']){delete _0x284616[_0x543f('0x49')]['id'];}return db[_0x543f('0x2e')][_0x543f('0x4a')]({'where':{'id':_0x284616[_0x543f('0x4b')]['id']}})[_0x543f('0x27')](handleEntityNotFound(_0x3e879d,null))[_0x543f('0x27')](saveUpdates(_0x284616['body'],null))['then'](respondWithResult(_0x3e879d,null))[_0x543f('0x46')](handleError(_0x3e879d,null));};exports[_0x543f('0x28')]=function(_0x52115a,_0x1cd8fe){return db[_0x543f('0x2e')][_0x543f('0x4a')]({'where':{'id':_0x52115a['params']['id']}})[_0x543f('0x27')](handleEntityNotFound(_0x1cd8fe,null))[_0x543f('0x27')](removeEntity(_0x1cd8fe,null))[_0x543f('0x46')](handleError(_0x1cd8fe,null));};exports[_0x543f('0x4c')]=function(_0xcb777a,_0xa845b1,_0x2c0a02){var _0x27e4e9={};var _0x18300={};var _0x11c7a8;var _0x457ac2;return db[_0x543f('0x2e')]['findOne']({'where':{'id':_0xcb777a[_0x543f('0x4b')]['id']}})[_0x543f('0x27')](handleEntityNotFound(_0xa845b1,null))[_0x543f('0x27')](function(_0x1d0d28){if(_0x1d0d28){_0x11c7a8=_0x1d0d28;_0x18300['model']=_['keys'](db[_0x543f('0x4d')]['rawAttributes']);_0x18300[_0x543f('0x34')]=_['keys'](_0xcb777a[_0x543f('0x34')]);_0x18300[_0x543f('0x36')]=_['intersection'](_0x18300[_0x543f('0x33')],_0x18300[_0x543f('0x34')]);_0x27e4e9[_0x543f('0x38')]=_[_0x543f('0x37')](_0x18300[_0x543f('0x33')],qs[_0x543f('0x39')](_0xcb777a[_0x543f('0x34')][_0x543f('0x39')]));_0x27e4e9['attributes']=_0x27e4e9[_0x543f('0x38')]['length']?_0x27e4e9['attributes']:_0x18300['model'];_0x27e4e9[_0x543f('0x3b')]=qs[_0x543f('0x3c')](_0xcb777a[_0x543f('0x34')][_0x543f('0x3c')]);_0x27e4e9[_0x543f('0x3d')]=qs['filters'](_[_0x543f('0x3e')](_0xcb777a[_0x543f('0x34')],_0x18300[_0x543f('0x36')]));if(_0xcb777a[_0x543f('0x34')][_0x543f('0x3f')]){_0x27e4e9[_0x543f('0x3d')]=_[_0x543f('0x40')](_0x27e4e9[_0x543f('0x3d')],{'$or':_['map'](_0x27e4e9['attributes'],function(_0xa72e66){var _0x3efcf7={};_0x3efcf7[_0xa72e66]={'$like':'%'+_0xcb777a[_0x543f('0x34')][_0x543f('0x3f')]+'%'};return _0x3efcf7;})});}_0x27e4e9=_[_0x543f('0x40')]({},_0x27e4e9,_0xcb777a[_0x543f('0x41')]);return _0x11c7a8[_0x543f('0x4c')](_0x27e4e9);}})[_0x543f('0x27')](function(_0x2c1c9e){if(_0x2c1c9e){_0x457ac2=_0x2c1c9e['length'];if(!_0xcb777a[_0x543f('0x34')][_0x543f('0x4e')](_0x543f('0x3a'))){_0x27e4e9[_0x543f('0x1e')]=qs[_0x543f('0x1e')](_0xcb777a[_0x543f('0x34')][_0x543f('0x1e')]);_0x27e4e9['offset']=qs[_0x543f('0x20')](_0xcb777a[_0x543f('0x34')]['offset']);}return _0x11c7a8[_0x543f('0x4c')](_0x27e4e9);}})[_0x543f('0x27')](function(_0xcf46a8){if(_0xcf46a8){return _0xcf46a8?{'count':_0x457ac2,'rows':_0xcf46a8}:null;}})['then'](respondWithResult(_0xa845b1,null))[_0x543f('0x46')](handleError(_0xa845b1,null));};exports[_0x543f('0x4f')]=function(_0x3c76da,_0x5525bc,_0x33652f){if(_0x3c76da['body']['id']){delete _0x3c76da[_0x543f('0x49')]['id'];}return db[_0x543f('0x2e')][_0x543f('0x50')]({'where':{'id':_0x3c76da[_0x543f('0x4b')]['id']}})[_0x543f('0x27')](handleEntityNotFound(_0x5525bc,null))['then'](function(_0x6baf47){if(_0x6baf47){_0x3c76da['body']['AccountId']=_0x6baf47['id'];_0x3c76da[_0x543f('0x49')]['Subjects']=integrations[_0x543f('0x51')](_0x3c76da[_0x543f('0x49')]['channel'],_0x3c76da[_0x543f('0x49')][_0x543f('0x31')]);_0x3c76da[_0x543f('0x49')]['Descriptions']=integrations[_0x543f('0x52')](_0x3c76da[_0x543f('0x49')][_0x543f('0x53')],_0x3c76da['body'][_0x543f('0x31')]);return db[_0x543f('0x4d')][_0x543f('0x48')](_0x3c76da[_0x543f('0x49')],{'include':[{'model':db[_0x543f('0x54')],'as':_0x543f('0x55')},{'model':db[_0x543f('0x54')],'as':_0x543f('0x56')}]});}return null;})[_0x543f('0x27')](respondWithResult(_0x5525bc,null))[_0x543f('0x46')](handleError(_0x5525bc,null));};exports[_0x543f('0x57')]=function(_0x378585,_0x39c076,_0x3418e4){var _0x5a8a1e='';var _0x4d061a='';return db[_0x543f('0x2e')]['findOne']({'where':{'id':_0x378585[_0x543f('0x4b')]['id']},'attributes':['id',_0x543f('0x58'),_0x543f('0x59'),_0x543f('0x5a')]})[_0x543f('0x27')](handleEntityNotFound(_0x39c076,null))[_0x543f('0x27')](function(_0x42e255){if(_0x42e255){_0x4d061a=_0x42e255[_0x543f('0x58')];_0x5a8a1e=_0x42e255[_0x543f('0x59')];var _0x5bfbd7=_0x42e255[_0x543f('0x59')][_0x543f('0x5b')](-0x1);if(_0x5bfbd7==='/'){_0x5a8a1e=_0x5a8a1e[_0x543f('0x5c')](0x0,_0x5a8a1e[_0x543f('0x5d')](_0x5bfbd7));}return rp({'method':_0x543f('0x5e'),'uri':util[_0x543f('0x5f')](_0x543f('0x60'),_0x5a8a1e,'/api/selector/owners'),'headers':{'Authorization':_0x543f('0x61')+_0x42e255[_0x543f('0x5a')]},'json':!![]});}})[_0x543f('0x27')](function(_0x5f1047){if(_0x5f1047){var _0x37bbce=_0x5f1047[_0x543f('0x62')];var _0x55dced=![];var _0x239e2e=null;for(_0x239e2e=0x0;_0x239e2e<_0x37bbce['length'];_0x239e2e++){if(_0x37bbce[_0x239e2e][_0x543f('0x63')]===_0x4d061a){_0x55dced=!![];}}if(_0x55dced){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x543f('0x64')});}}})[_0x543f('0x27')](respondWithResult(_0x39c076,null))[_0x543f('0x46')](function(_0x4000e5){var _0xcde883=_0x378585[_0x543f('0x34')][_0x543f('0x65')]?0x1f4:_0x4000e5['statusCode']||0x1f4;logger[_0x543f('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x543f('0x57'),_0xcde883,JSON[_0x543f('0x66')](_0x4000e5));delete _0x4000e5['name'];if(_0xcde883===0x191){_0xcde883=0x190;}_0x39c076[_0x543f('0x1a')](_0xcde883)['send'](_0x378585['query'][_0x543f('0x65')]?{'message':_0x543f('0x67'),'statusCode':_0x4000e5['statusCode']}:_0x4000e5);});};
\ No newline at end of file
index 1685201..fafc589 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4991=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4991,0xf7));var _0x1499=function(_0x24cb91,_0x22d163){_0x24cb91=_0x24cb91-0x0;var _0x2b3b97=_0x4991[_0x24cb91];return _0x2b3b97;};'use strict';var _=require(_0x1499('0x0'));var util=require('util');var logger=require(_0x1499('0x1'))('api');var moment=require(_0x1499('0x2'));var BPromise=require(_0x1499('0x3'));var rp=require(_0x1499('0x4'));var fs=require('fs');var path=require(_0x1499('0x5'));var rimraf=require(_0x1499('0x6'));var config=require(_0x1499('0x7'));var attributes=require(_0x1499('0x8'));var integrations=require(_0x1499('0x9'));module['exports']=function(_0x2a8e96,_0x1c3bd7){return _0x2a8e96[_0x1499('0xa')](_0x1499('0xb'),attributes,{'tableName':_0x1499('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x209f9c,_0x4ea385){var _0x13c1ef=function(_0x455599){while(--_0x455599){_0x209f9c['push'](_0x209f9c['shift']());}};_0x13c1ef(++_0x4ea385);}(_0xdb28,0x106));var _0x8db2=function(_0x4f3679,_0x3c93cc){_0x4f3679=_0x4f3679-0x0;var _0x8678a0=_0xdb28[_0x4f3679];return _0x8678a0;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x8db2('0x9'));module[_0x8db2('0xa')]=function(_0x5f42ee,_0x494b40){return _0x5f42ee[_0x8db2('0xb')](_0x8db2('0xc'),attributes,{'tableName':_0x8db2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 068baa0..a22562b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb44a=['moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','info','catch','GetFreshsalesAccount','FreshsalesAccount','options','raw','attributes','limit','include','map','model','ShowFreshsalesAccount','find','where'];(function(_0x18ece4,_0x33b65a){var _0x52286b=function(_0x3b0728){while(--_0x3b0728){_0x18ece4['push'](_0x18ece4['shift']());}};_0x52286b(++_0x33b65a);}(_0xb44a,0x1c2));var _0xab44=function(_0x2e6dee,_0x1a61b0){_0x2e6dee=_0x2e6dee-0x0;var _0x47706=_0xb44a[_0x2e6dee];return _0x47706;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab44('0x0'));var BPromise=require('bluebird');var rs=require(_0xab44('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xab44('0x2'));var logger=require('../../config/logger')(_0xab44('0x3'));var config=require(_0xab44('0x4'));var jayson=require(_0xab44('0x5'));var client=jayson[_0xab44('0x6')][_0xab44('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3303b1,_0x3ead8d,_0x495825){return new BPromise(function(_0x137a8c,_0x133a6d){return client[_0xab44('0x8')](_0x3303b1,_0x495825)[_0xab44('0x9')](function(_0xa14367){logger['info'](_0xab44('0xa'),_0x3ead8d,'request\x20sent');logger[_0xab44('0xb')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x3ead8d,'request\x20sent',JSON[_0xab44('0xc')](_0xa14367));if(_0xa14367[_0xab44('0xd')]){if(_0xa14367[_0xab44('0xd')][_0xab44('0xe')]===0x1f4){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0xa14367['error']['message']);return _0x133a6d(_0xa14367[_0xab44('0xd')]['message']);}logger[_0xab44('0xd')]('FreshsalesAccount,\x20%s,\x20%s',_0x3ead8d,_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);return _0x137a8c(_0xa14367[_0xab44('0xd')][_0xab44('0xf')]);}else{logger[_0xab44('0x10')](_0xab44('0xa'),_0x3ead8d,'request\x20sent');_0x137a8c(_0xa14367['result'][_0xab44('0xf')]);}})[_0xab44('0x11')](function(_0x14fe36){logger[_0xab44('0xd')](_0xab44('0xa'),_0x3ead8d,_0x14fe36);_0x133a6d(_0x14fe36);});});}exports[_0xab44('0x12')]=function(_0x354b09){var _0x44fa43=this;return new Promise(function(_0x310b15,_0xc4b3dc){return db[_0xab44('0x13')]['findAll']({'raw':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')][_0xab44('0x15')]===undefined?!![]:![]:!![],'where':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')]['where']||null:null,'attributes':_0x354b09[_0xab44('0x14')]?_0x354b09['options'][_0xab44('0x16')]||null:null,'limit':_0x354b09[_0xab44('0x14')]?_0x354b09[_0xab44('0x14')][_0xab44('0x17')]||null:null,'include':_0x354b09['options']?_0x354b09[_0xab44('0x14')][_0xab44('0x18')]?_[_0xab44('0x19')](_0x354b09[_0xab44('0x14')][_0xab44('0x18')],function(_0x402950){return{'model':db[_0x402950[_0xab44('0x1a')]],'as':_0x402950['as'],'attributes':_0x402950['attributes'],'include':_0x402950['include']?_[_0xab44('0x19')](_0x402950['include'],function(_0x2439f3){return{'model':db[_0x2439f3['model']],'as':_0x2439f3['as'],'attributes':_0x2439f3[_0xab44('0x16')],'include':_0x2439f3['include']?_['map'](_0x2439f3[_0xab44('0x18')],function(_0x25287b){return{'model':db[_0x25287b[_0xab44('0x1a')]],'as':_0x25287b['as'],'attributes':_0x25287b[_0xab44('0x16')]};}):[]};}):[]};}):[]:[]})[_0xab44('0x9')](function(_0x4e820c){logger[_0xab44('0x10')](_0xab44('0x12'),_0x354b09);logger['debug'](_0xab44('0x12'),_0x354b09,JSON[_0xab44('0xc')](_0x4e820c));_0x310b15(_0x4e820c);})[_0xab44('0x11')](function(_0x1cd486){logger[_0xab44('0xd')](_0xab44('0x12'),_0x1cd486['message'],_0x354b09);_0xc4b3dc(_0x44fa43[_0xab44('0xd')](0x1f4,_0x1cd486[_0xab44('0xf')]));});});};exports[_0xab44('0x1b')]=function(_0x47e1be){var _0x54cac8=this;return new Promise(function(_0x106d3a,_0x5082e4){return db['FreshsalesAccount'][_0xab44('0x1c')]({'raw':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x15')]===undefined?!![]:![]:!![],'where':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x1d')]||null:null,'attributes':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x16')]||null:null,'include':_0x47e1be[_0xab44('0x14')]?_0x47e1be[_0xab44('0x14')][_0xab44('0x18')]?_[_0xab44('0x19')](_0x47e1be['options']['include'],function(_0x27e318){return{'model':db[_0x27e318[_0xab44('0x1a')]],'as':_0x27e318['as'],'attributes':_0x27e318['attributes'],'include':_0x27e318[_0xab44('0x18')]?_[_0xab44('0x19')](_0x27e318[_0xab44('0x18')],function(_0x1e0be7){return{'model':db[_0x1e0be7[_0xab44('0x1a')]],'as':_0x1e0be7['as'],'attributes':_0x1e0be7[_0xab44('0x16')],'include':_0x1e0be7[_0xab44('0x18')]?_[_0xab44('0x19')](_0x1e0be7[_0xab44('0x18')],function(_0xe26f9f){return{'model':db[_0xe26f9f[_0xab44('0x1a')]],'as':_0xe26f9f['as'],'attributes':_0xe26f9f[_0xab44('0x16')]};}):[]};}):[]};}):[]:[]})[_0xab44('0x9')](function(_0x532aad){logger[_0xab44('0x10')](_0xab44('0x1b'),_0x47e1be);logger[_0xab44('0xb')](_0xab44('0x1b'),_0x47e1be,JSON['stringify'](_0x532aad));_0x106d3a(_0x532aad);})[_0xab44('0x11')](function(_0x31b599){logger[_0xab44('0xd')](_0xab44('0x1b'),_0x31b599['message'],_0x47e1be);_0x5082e4(_0x54cac8[_0xab44('0xd')](0x1f4,_0x31b599[_0xab44('0xf')]));});});};
\ No newline at end of file
+var _0x627e=['request','info','FreshsalesAccount,\x20%s,\x20%s','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFreshsalesAccount','findAll','raw','options','where','map','model','attributes','include','then','debug','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0xcf69e4,_0x22359f){var _0x3ae183=function(_0x34d0fc){while(--_0x34d0fc){_0xcf69e4['push'](_0xcf69e4['shift']());}};_0x3ae183(++_0x22359f);}(_0x627e,0x14a));var _0xe627=function(_0x1ea7cd,_0x512062){_0x1ea7cd=_0x1ea7cd-0x0;var _0xd78427=_0x627e[_0x1ea7cd];return _0xd78427;};'use strict';var _=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var moment=require(_0xe627('0x2'));var BPromise=require(_0xe627('0x3'));var rs=require(_0xe627('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe627('0x5'))['db'];var utils=require(_0xe627('0x6'));var logger=require(_0xe627('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe627('0x8')][_0xe627('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45e49a,_0x2d4f63,_0xd5016e){return new BPromise(function(_0xe065b,_0x4bae52){return client[_0xe627('0xa')](_0x45e49a,_0xd5016e)['then'](function(_0x56549e){logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,'request\x20sent');logger['debug'](_0xe627('0xd'),_0x2d4f63,_0xe627('0xe'),JSON[_0xe627('0xf')](_0x56549e));if(_0x56549e[_0xe627('0x10')]){if(_0x56549e[_0xe627('0x10')][_0xe627('0x11')]===0x1f4){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x56549e[_0xe627('0x10')]['message']);return _0x4bae52(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}logger[_0xe627('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0x2d4f63,_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);return _0xe065b(_0x56549e[_0xe627('0x10')][_0xe627('0x12')]);}else{logger[_0xe627('0xb')](_0xe627('0xc'),_0x2d4f63,_0xe627('0xe'));_0xe065b(_0x56549e['result'][_0xe627('0x12')]);}})[_0xe627('0x13')](function(_0x16c2d7){logger[_0xe627('0x10')](_0xe627('0xc'),_0x2d4f63,_0x16c2d7);_0x4bae52(_0x16c2d7);});});}exports[_0xe627('0x14')]=function(_0x56559b){var _0x2fe46a=this;return new Promise(function(_0x538b22,_0x24fddd){return db['FreshsalesAccount'][_0xe627('0x15')]({'raw':_0x56559b['options']?_0x56559b['options'][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x56559b['options']?_0x56559b[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x56559b['options']?_0x56559b['options']['attributes']||null:null,'limit':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['limit']||null:null,'include':_0x56559b[_0xe627('0x17')]?_0x56559b[_0xe627('0x17')]['include']?_[_0xe627('0x19')](_0x56559b[_0xe627('0x17')]['include'],function(_0x42f3d1){return{'model':db[_0x42f3d1[_0xe627('0x1a')]],'as':_0x42f3d1['as'],'attributes':_0x42f3d1[_0xe627('0x1b')],'include':_0x42f3d1['include']?_[_0xe627('0x19')](_0x42f3d1[_0xe627('0x1c')],function(_0x1a5081){return{'model':db[_0x1a5081[_0xe627('0x1a')]],'as':_0x1a5081['as'],'attributes':_0x1a5081['attributes'],'include':_0x1a5081[_0xe627('0x1c')]?_[_0xe627('0x19')](_0x1a5081[_0xe627('0x1c')],function(_0x29eb8e){return{'model':db[_0x29eb8e[_0xe627('0x1a')]],'as':_0x29eb8e['as'],'attributes':_0x29eb8e[_0xe627('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x44c9f7){logger[_0xe627('0xb')]('GetFreshsalesAccount',_0x56559b);logger[_0xe627('0x1e')]('GetFreshsalesAccount',_0x56559b,JSON['stringify'](_0x44c9f7));_0x538b22(_0x44c9f7);})[_0xe627('0x13')](function(_0xdf63c8){logger['error'](_0xe627('0x14'),_0xdf63c8['message'],_0x56559b);_0x24fddd(_0x2fe46a[_0xe627('0x10')](0x1f4,_0xdf63c8['message']));});});};exports[_0xe627('0x1f')]=function(_0x26833a){var _0x5d8992=this;return new Promise(function(_0x33e9dd,_0x4f92c9){return db[_0xe627('0x20')][_0xe627('0x21')]({'raw':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x16')]===undefined?!![]:![]:!![],'where':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x18')]||null:null,'attributes':_0x26833a[_0xe627('0x17')]?_0x26833a[_0xe627('0x17')][_0xe627('0x1b')]||null:null,'include':_0x26833a['options']?_0x26833a['options'][_0xe627('0x1c')]?_['map'](_0x26833a[_0xe627('0x17')]['include'],function(_0x56d1d7){return{'model':db[_0x56d1d7[_0xe627('0x1a')]],'as':_0x56d1d7['as'],'attributes':_0x56d1d7['attributes'],'include':_0x56d1d7['include']?_[_0xe627('0x19')](_0x56d1d7[_0xe627('0x1c')],function(_0x55f001){return{'model':db[_0x55f001['model']],'as':_0x55f001['as'],'attributes':_0x55f001['attributes'],'include':_0x55f001['include']?_[_0xe627('0x19')](_0x55f001['include'],function(_0x39338c){return{'model':db[_0x39338c[_0xe627('0x1a')]],'as':_0x39338c['as'],'attributes':_0x39338c['attributes']};}):[]};}):[]};}):[]:[]})[_0xe627('0x1d')](function(_0x35a303){logger['info'](_0xe627('0x1f'),_0x26833a);logger[_0xe627('0x1e')](_0xe627('0x1f'),_0x26833a,JSON[_0xe627('0xf')](_0x35a303));_0x33e9dd(_0x35a303);})[_0xe627('0x13')](function(_0x28fd59){logger['error'](_0xe627('0x1f'),_0x28fd59['message'],_0x26833a);_0x4f92c9(_0x5d8992[_0xe627('0x10')](0x1f4,_0x28fd59['message']));});});};
\ No newline at end of file
index 91ac3c4..301f9df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29f6=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','/:id/descriptions','/:id/fields','getFields','post','create','put','update','destroy','exports'];(function(_0x370c7d,_0x163162){var _0x915abb=function(_0x143fea){while(--_0x143fea){_0x370c7d['push'](_0x370c7d['shift']());}};_0x915abb(++_0x163162);}(_0x29f6,0xcf));var _0x629f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x29f6[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x629f('0x0'));var path=require(_0x629f('0x1'));var timeout=require(_0x629f('0x2'));var express=require(_0x629f('0x3'));var router=express[_0x629f('0x4')]();var fs_extra=require(_0x629f('0x5'));var auth=require(_0x629f('0x6'));var interaction=require(_0x629f('0x7'));var config=require('../../config/environment');var controller=require(_0x629f('0x8'));router[_0x629f('0x9')]('/',auth[_0x629f('0xa')](),controller[_0x629f('0xb')]);router['get'](_0x629f('0xc'),auth[_0x629f('0xa')](),controller['show']);router[_0x629f('0x9')](_0x629f('0xd'),auth[_0x629f('0xa')](),controller['getSubjects']);router[_0x629f('0x9')](_0x629f('0xe'),auth[_0x629f('0xa')](),controller['getDescriptions']);router['get'](_0x629f('0xf'),auth[_0x629f('0xa')](),controller[_0x629f('0x10')]);router[_0x629f('0x11')]('/',auth['isAuthenticated'](),controller[_0x629f('0x12')]);router[_0x629f('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x629f('0x14')]);router['delete'](_0x629f('0xc'),auth[_0x629f('0xa')](),controller[_0x629f('0x15')]);module[_0x629f('0x16')]=router;
\ No newline at end of file
+var _0xc8a9=['isAuthenticated','index','/:id','show','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x3c3603,_0xb16e87){var _0x588811=function(_0x1b27f3){while(--_0x1b27f3){_0x3c3603['push'](_0x3c3603['shift']());}};_0x588811(++_0xb16e87);}(_0xc8a9,0x1da));var _0x9c8a=function(_0x340f57,_0x41e0ac){_0x340f57=_0x340f57-0x0;var _0x5bd435=_0xc8a9[_0x340f57];return _0x5bd435;};'use strict';var multer=require(_0x9c8a('0x0'));var util=require(_0x9c8a('0x1'));var path=require(_0x9c8a('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c8a('0x3'));var router=express[_0x9c8a('0x4')]();var fs_extra=require(_0x9c8a('0x5'));var auth=require(_0x9c8a('0x6'));var interaction=require(_0x9c8a('0x7'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0x9c8a('0x8')]('/',auth[_0x9c8a('0x9')](),controller[_0x9c8a('0xa')]);router[_0x9c8a('0x8')](_0x9c8a('0xb'),auth['isAuthenticated'](),controller[_0x9c8a('0xc')]);router[_0x9c8a('0x8')]('/:id/subjects',auth[_0x9c8a('0x9')](),controller[_0x9c8a('0xd')]);router['get'](_0x9c8a('0xe'),auth[_0x9c8a('0x9')](),controller[_0x9c8a('0xf')]);router[_0x9c8a('0x8')](_0x9c8a('0x10'),auth[_0x9c8a('0x9')](),controller[_0x9c8a('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9c8a('0x12')]);router[_0x9c8a('0x13')](_0x9c8a('0xb'),auth[_0x9c8a('0x9')](),controller[_0x9c8a('0x14')]);router['delete']('/:id',auth[_0x9c8a('0x9')](),controller[_0x9c8a('0x15')]);module[_0x9c8a('0x16')]=router;
\ No newline at end of file
index 634b531..a9cab9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17ca=['STRING'];(function(_0x419b1e,_0x20f2cc){var _0x29c055=function(_0x282234){while(--_0x282234){_0x419b1e['push'](_0x419b1e['shift']());}};_0x29c055(++_0x20f2cc);}(_0x17ca,0x1ee));var _0xa17c=function(_0xcef371,_0xad25a7){_0xcef371=_0xcef371-0x0;var _0x1661cd=_0x17ca[_0xcef371];return _0x1661cd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa17c('0x0')]},'description':{'type':Sequelize[_0xa17c('0x0')]}};
\ No newline at end of file
+var _0xe519=['STRING','sequelize','exports'];(function(_0x51e838,_0x3e066a){var _0x4983e7=function(_0x3d5a95){while(--_0x3d5a95){_0x51e838['push'](_0x51e838['shift']());}};_0x4983e7(++_0x3e066a);}(_0xe519,0x1d8));var _0x9e51=function(_0x3dbc19,_0x66da4){_0x3dbc19=_0x3dbc19-0x0;var _0x1b0df2=_0xe519[_0x3dbc19];return _0x1b0df2;};'use strict';var Sequelize=require(_0x9e51('0x0'));module[_0x9e51('0x1')]={'name':{'type':Sequelize[_0x9e51('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f3c853b..153545a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4a8=['name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','getSubjects','findOne','order','hasOwnProperty','nolimit','FreshsalesField','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','error','stack'];(function(_0x3aeee9,_0x5aa444){var _0x2f06f8=function(_0xb1ae7e){while(--_0xb1ae7e){_0x3aeee9['push'](_0x3aeee9['shift']());}};_0x2f06f8(++_0x5aa444);}(_0xa4a8,0x1c2));var _0x8a4a=function(_0x463192,_0x2a7738){_0x463192=_0x463192-0x0;var _0x3e6e6c=_0xa4a8[_0x463192];return _0x3e6e6c;};'use strict';var emlformat=require(_0x8a4a('0x0'));var rimraf=require(_0x8a4a('0x1'));var zipdir=require(_0x8a4a('0x2'));var jsonpatch=require(_0x8a4a('0x3'));var rp=require(_0x8a4a('0x4'));var moment=require(_0x8a4a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8a4a('0x6'));var util=require(_0x8a4a('0x7'));var path=require(_0x8a4a('0x8'));var sox=require(_0x8a4a('0x9'));var csv=require(_0x8a4a('0xa'));var ejs=require(_0x8a4a('0xb'));var fs=require('fs');var fs_extra=require(_0x8a4a('0xc'));var _=require(_0x8a4a('0xd'));var squel=require(_0x8a4a('0xe'));var crypto=require('crypto');var jsforce=require(_0x8a4a('0xf'));var deskjs=require(_0x8a4a('0x10'));var toCsv=require(_0x8a4a('0xa'));var querystring=require(_0x8a4a('0x11'));var Papa=require(_0x8a4a('0x12'));var Redis=require(_0x8a4a('0x13'));var authService=require(_0x8a4a('0x14'));var qs=require(_0x8a4a('0x15'));var as=require(_0x8a4a('0x16'));var hardwareService=require(_0x8a4a('0x17'));var logger=require('../../config/logger')(_0x8a4a('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8a4a('0x19'));var db=require(_0x8a4a('0x1a'))['db'];function respondWithStatusCode(_0x48d13b,_0x58b0f4){_0x58b0f4=_0x58b0f4||0xcc;return function(_0x5ceb1d){if(_0x5ceb1d){return _0x48d13b[_0x8a4a('0x1b')](_0x58b0f4);}return _0x48d13b['status'](_0x58b0f4)[_0x8a4a('0x1c')]();};}function respondWithResult(_0x599c17,_0x54cf6b){_0x54cf6b=_0x54cf6b||0xc8;return function(_0x4adc84){if(_0x4adc84){return _0x599c17[_0x8a4a('0x1d')](_0x54cf6b)[_0x8a4a('0x1e')](_0x4adc84);}};}function respondWithFilteredResult(_0x4161a3,_0xf0d680){return function(_0x2e6288){if(_0x2e6288){var _0x200e52=typeof _0xf0d680[_0x8a4a('0x1f')]===_0x8a4a('0x20')&&typeof _0xf0d680['limit']===_0x8a4a('0x20');var _0x520998=_0x2e6288[_0x8a4a('0x21')];var _0x245f13=_0x200e52?0x0:_0xf0d680['offset'];var _0x344640=_0x200e52?_0x2e6288['count']:_0xf0d680[_0x8a4a('0x1f')]+_0xf0d680[_0x8a4a('0x22')];var _0x571480;if(_0x344640>=_0x520998){_0x344640=_0x520998;_0x571480=0xc8;}else{_0x571480=0xce;}_0x4161a3[_0x8a4a('0x1d')](_0x571480);return _0x4161a3['set'](_0x8a4a('0x23'),_0x245f13+'-'+_0x344640+'/'+_0x520998)[_0x8a4a('0x1e')](_0x2e6288);}return null;};}function patchUpdates(_0x1ed8e6){return function(_0x10f1ce){try{jsonpatch[_0x8a4a('0x24')](_0x10f1ce,_0x1ed8e6,!![]);}catch(_0x7ef0bd){return BPromise[_0x8a4a('0x25')](_0x7ef0bd);}return _0x10f1ce['save']();};}function saveUpdates(_0x5d6570,_0x6cf41b){return function(_0x2e67bb){if(_0x2e67bb){return _0x2e67bb[_0x8a4a('0x26')](_0x5d6570)[_0x8a4a('0x27')](function(_0x2dddf0){return _0x2dddf0;});}return null;};}function removeEntity(_0x72824b,_0xae4260){return function(_0x3229fc){if(_0x3229fc){return _0x3229fc['destroy']()['then'](function(){_0x72824b[_0x8a4a('0x1d')](0xcc)[_0x8a4a('0x1c')]();});}};}function handleEntityNotFound(_0x2466c7,_0x52fc8e){return function(_0x46079f){if(!_0x46079f){_0x2466c7['sendStatus'](0x194);}return _0x46079f;};}function handleError(_0xa6c7c0,_0x1730e2){_0x1730e2=_0x1730e2||0x1f4;return function(_0x28fb93){logger[_0x8a4a('0x28')](_0x28fb93[_0x8a4a('0x29')]);if(_0x28fb93['name']){delete _0x28fb93[_0x8a4a('0x2a')];}_0xa6c7c0[_0x8a4a('0x1d')](_0x1730e2)[_0x8a4a('0x2b')](_0x28fb93);};}exports['index']=function(_0x8ee1a6,_0x366766){var _0x464906={},_0x5d2e4e={},_0x2d83e4={'count':0x0,'rows':[]};var _0x3880b4=_['map'](db['FreshsalesConfiguration'][_0x8a4a('0x2c')],function(_0x12c1cb){return{'name':_0x12c1cb[_0x8a4a('0x2d')],'type':_0x12c1cb[_0x8a4a('0x2e')][_0x8a4a('0x2f')]};});_0x5d2e4e[_0x8a4a('0x30')]=_[_0x8a4a('0x31')](_0x3880b4,_0x8a4a('0x2a'));_0x5d2e4e[_0x8a4a('0x32')]=_[_0x8a4a('0x33')](_0x8ee1a6[_0x8a4a('0x32')]);_0x5d2e4e[_0x8a4a('0x34')]=_[_0x8a4a('0x35')](_0x5d2e4e['model'],_0x5d2e4e[_0x8a4a('0x32')]);_0x464906[_0x8a4a('0x36')]=_[_0x8a4a('0x35')](_0x5d2e4e[_0x8a4a('0x30')],qs[_0x8a4a('0x37')](_0x8ee1a6[_0x8a4a('0x32')][_0x8a4a('0x37')]));_0x464906[_0x8a4a('0x36')]=_0x464906['attributes'][_0x8a4a('0x38')]?_0x464906['attributes']:_0x5d2e4e[_0x8a4a('0x30')];if(!_0x8ee1a6['query']['hasOwnProperty']('nolimit')){_0x464906[_0x8a4a('0x22')]=qs[_0x8a4a('0x22')](_0x8ee1a6[_0x8a4a('0x32')][_0x8a4a('0x22')]);_0x464906['offset']=qs[_0x8a4a('0x1f')](_0x8ee1a6[_0x8a4a('0x32')][_0x8a4a('0x1f')]);}_0x464906['order']=qs[_0x8a4a('0x39')](_0x8ee1a6[_0x8a4a('0x32')]['sort']);_0x464906[_0x8a4a('0x3a')]=qs[_0x8a4a('0x34')](_[_0x8a4a('0x3b')](_0x8ee1a6[_0x8a4a('0x32')],_0x5d2e4e['filters']),_0x3880b4);if(_0x8ee1a6[_0x8a4a('0x32')][_0x8a4a('0x3c')]){_0x464906[_0x8a4a('0x3a')]=_[_0x8a4a('0x3d')](_0x464906[_0x8a4a('0x3a')],{'$or':_['map'](_0x3880b4,function(_0x59b85b){if(_0x59b85b['type']!=='VIRTUAL'){var _0x5b5cdd={};_0x5b5cdd[_0x59b85b[_0x8a4a('0x2a')]]={'$like':'%'+_0x8ee1a6[_0x8a4a('0x32')][_0x8a4a('0x3c')]+'%'};return _0x5b5cdd;}})});}_0x464906=_[_0x8a4a('0x3d')]({},_0x464906,_0x8ee1a6[_0x8a4a('0x3e')]);var _0x40c911={'where':_0x464906['where']};return db[_0x8a4a('0x3f')][_0x8a4a('0x21')](_0x40c911)[_0x8a4a('0x27')](function(_0x55852c){_0x2d83e4[_0x8a4a('0x21')]=_0x55852c;if(_0x8ee1a6[_0x8a4a('0x32')][_0x8a4a('0x40')]){_0x464906[_0x8a4a('0x41')]=[{'all':!![]}];}return db[_0x8a4a('0x3f')][_0x8a4a('0x42')](_0x464906);})['then'](function(_0x4c0d01){_0x2d83e4[_0x8a4a('0x43')]=_0x4c0d01;return _0x2d83e4;})[_0x8a4a('0x27')](respondWithFilteredResult(_0x366766,_0x464906))[_0x8a4a('0x44')](handleError(_0x366766,null));};exports[_0x8a4a('0x45')]=function(_0x5ce3b7,_0x9475d3){var _0x1ebe28={'raw':![],'where':{'id':_0x5ce3b7[_0x8a4a('0x46')]['id']}},_0x528b9c={};_0x528b9c[_0x8a4a('0x30')]=_[_0x8a4a('0x33')](db[_0x8a4a('0x3f')][_0x8a4a('0x2c')]);_0x528b9c[_0x8a4a('0x32')]=_['keys'](_0x5ce3b7[_0x8a4a('0x32')]);_0x528b9c[_0x8a4a('0x34')]=_[_0x8a4a('0x35')](_0x528b9c['model'],_0x528b9c[_0x8a4a('0x32')]);_0x1ebe28[_0x8a4a('0x36')]=_[_0x8a4a('0x35')](_0x528b9c[_0x8a4a('0x30')],qs[_0x8a4a('0x37')](_0x5ce3b7[_0x8a4a('0x32')][_0x8a4a('0x37')]));_0x1ebe28[_0x8a4a('0x36')]=_0x1ebe28[_0x8a4a('0x36')][_0x8a4a('0x38')]?_0x1ebe28[_0x8a4a('0x36')]:_0x528b9c[_0x8a4a('0x30')];if(_0x5ce3b7[_0x8a4a('0x32')][_0x8a4a('0x40')]){_0x1ebe28[_0x8a4a('0x41')]=[{'all':!![]}];}_0x1ebe28=_[_0x8a4a('0x3d')]({},_0x1ebe28,_0x5ce3b7[_0x8a4a('0x3e')]);return db['FreshsalesConfiguration'][_0x8a4a('0x47')](_0x1ebe28)[_0x8a4a('0x27')](handleEntityNotFound(_0x9475d3,null))[_0x8a4a('0x27')](respondWithResult(_0x9475d3,null))[_0x8a4a('0x44')](handleError(_0x9475d3,null));};exports[_0x8a4a('0x48')]=function(_0x137c01,_0x434ba0){return db[_0x8a4a('0x3f')]['create'](_0x137c01[_0x8a4a('0x49')],{})[_0x8a4a('0x27')](respondWithResult(_0x434ba0,0xc9))[_0x8a4a('0x44')](handleError(_0x434ba0,null));};exports[_0x8a4a('0x26')]=function(_0x1521ed,_0x2c4acb){if(_0x1521ed[_0x8a4a('0x49')]['id']){delete _0x1521ed['body']['id'];}return db[_0x8a4a('0x3f')][_0x8a4a('0x47')]({'where':{'id':_0x1521ed[_0x8a4a('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c4acb,null))[_0x8a4a('0x27')](saveUpdates(_0x1521ed[_0x8a4a('0x49')],null))[_0x8a4a('0x27')](respondWithResult(_0x2c4acb,null))[_0x8a4a('0x44')](handleError(_0x2c4acb,null));};exports[_0x8a4a('0x4a')]=function(_0x41d0c4,_0x571fc4){return db[_0x8a4a('0x3f')][_0x8a4a('0x47')]({'where':{'id':_0x41d0c4['params']['id']}})[_0x8a4a('0x27')](handleEntityNotFound(_0x571fc4,null))[_0x8a4a('0x27')](removeEntity(_0x571fc4,null))[_0x8a4a('0x44')](handleError(_0x571fc4,null));};exports[_0x8a4a('0x4b')]=function(_0x22cc2c,_0x14ae9a,_0x534e86){var _0x16264a={};var _0x2fb6db={};var _0x5a7aec;var _0x1e90fb;return db[_0x8a4a('0x3f')][_0x8a4a('0x4c')]({'where':{'id':_0x22cc2c[_0x8a4a('0x46')]['id']}})['then'](handleEntityNotFound(_0x14ae9a,null))['then'](function(_0x320a6c){if(_0x320a6c){_0x5a7aec=_0x320a6c;_0x2fb6db[_0x8a4a('0x30')]=_[_0x8a4a('0x33')](db['FreshsalesField'][_0x8a4a('0x2c')]);_0x2fb6db[_0x8a4a('0x32')]=_[_0x8a4a('0x33')](_0x22cc2c[_0x8a4a('0x32')]);_0x2fb6db[_0x8a4a('0x34')]=_[_0x8a4a('0x35')](_0x2fb6db[_0x8a4a('0x30')],_0x2fb6db[_0x8a4a('0x32')]);_0x16264a[_0x8a4a('0x36')]=_[_0x8a4a('0x35')](_0x2fb6db['model'],qs['fields'](_0x22cc2c['query'][_0x8a4a('0x37')]));_0x16264a[_0x8a4a('0x36')]=_0x16264a[_0x8a4a('0x36')][_0x8a4a('0x38')]?_0x16264a[_0x8a4a('0x36')]:_0x2fb6db['model'];_0x16264a[_0x8a4a('0x4d')]=qs[_0x8a4a('0x39')](_0x22cc2c[_0x8a4a('0x32')][_0x8a4a('0x39')]);_0x16264a[_0x8a4a('0x3a')]=qs[_0x8a4a('0x34')](_[_0x8a4a('0x3b')](_0x22cc2c[_0x8a4a('0x32')],_0x2fb6db[_0x8a4a('0x34')]));if(_0x22cc2c[_0x8a4a('0x32')]['filter']){_0x16264a[_0x8a4a('0x3a')]=_[_0x8a4a('0x3d')](_0x16264a[_0x8a4a('0x3a')],{'$or':_[_0x8a4a('0x31')](_0x16264a['attributes'],function(_0x65e9e0){var _0x18d1c0={};_0x18d1c0[_0x65e9e0]={'$like':'%'+_0x22cc2c[_0x8a4a('0x32')][_0x8a4a('0x3c')]+'%'};return _0x18d1c0;})});}_0x16264a=_[_0x8a4a('0x3d')]({},_0x16264a,_0x22cc2c[_0x8a4a('0x3e')]);return _0x5a7aec[_0x8a4a('0x4b')](_0x16264a);}})[_0x8a4a('0x27')](function(_0x145426){if(_0x145426){_0x1e90fb=_0x145426[_0x8a4a('0x38')];if(!_0x22cc2c[_0x8a4a('0x32')][_0x8a4a('0x4e')](_0x8a4a('0x4f'))){_0x16264a['limit']=qs[_0x8a4a('0x22')](_0x22cc2c[_0x8a4a('0x32')][_0x8a4a('0x22')]);_0x16264a[_0x8a4a('0x1f')]=qs[_0x8a4a('0x1f')](_0x22cc2c[_0x8a4a('0x32')]['offset']);}return _0x5a7aec[_0x8a4a('0x4b')](_0x16264a);}})[_0x8a4a('0x27')](function(_0x4cf3c9){if(_0x4cf3c9){return _0x4cf3c9?{'count':_0x1e90fb,'rows':_0x4cf3c9}:null;}})[_0x8a4a('0x27')](respondWithResult(_0x14ae9a,null))[_0x8a4a('0x44')](handleError(_0x14ae9a,null));};exports['getDescriptions']=function(_0x52d173,_0x370ece,_0x289109){var _0x512b90={};var _0x56a074={};var _0x211642;var _0x5ed46d;return db[_0x8a4a('0x3f')][_0x8a4a('0x4c')]({'where':{'id':_0x52d173['params']['id']}})[_0x8a4a('0x27')](handleEntityNotFound(_0x370ece,null))[_0x8a4a('0x27')](function(_0x37f32a){if(_0x37f32a){_0x211642=_0x37f32a;_0x56a074[_0x8a4a('0x30')]=_[_0x8a4a('0x33')](db[_0x8a4a('0x50')]['rawAttributes']);_0x56a074[_0x8a4a('0x32')]=_[_0x8a4a('0x33')](_0x52d173[_0x8a4a('0x32')]);_0x56a074[_0x8a4a('0x34')]=_[_0x8a4a('0x35')](_0x56a074[_0x8a4a('0x30')],_0x56a074[_0x8a4a('0x32')]);_0x512b90[_0x8a4a('0x36')]=_['intersection'](_0x56a074[_0x8a4a('0x30')],qs[_0x8a4a('0x37')](_0x52d173[_0x8a4a('0x32')][_0x8a4a('0x37')]));_0x512b90[_0x8a4a('0x36')]=_0x512b90['attributes']['length']?_0x512b90[_0x8a4a('0x36')]:_0x56a074[_0x8a4a('0x30')];_0x512b90[_0x8a4a('0x4d')]=qs[_0x8a4a('0x39')](_0x52d173[_0x8a4a('0x32')][_0x8a4a('0x39')]);_0x512b90[_0x8a4a('0x3a')]=qs[_0x8a4a('0x34')](_[_0x8a4a('0x3b')](_0x52d173['query'],_0x56a074[_0x8a4a('0x34')]));if(_0x52d173[_0x8a4a('0x32')][_0x8a4a('0x3c')]){_0x512b90['where']=_['merge'](_0x512b90[_0x8a4a('0x3a')],{'$or':_[_0x8a4a('0x31')](_0x512b90['attributes'],function(_0x4d33b8){var _0x563b3d={};_0x563b3d[_0x4d33b8]={'$like':'%'+_0x52d173[_0x8a4a('0x32')][_0x8a4a('0x3c')]+'%'};return _0x563b3d;})});}_0x512b90=_[_0x8a4a('0x3d')]({},_0x512b90,_0x52d173['options']);return _0x211642['getDescriptions'](_0x512b90);}})['then'](function(_0x4c0f96){if(_0x4c0f96){_0x5ed46d=_0x4c0f96['length'];if(!_0x52d173['query'][_0x8a4a('0x4e')](_0x8a4a('0x4f'))){_0x512b90[_0x8a4a('0x22')]=qs['limit'](_0x52d173['query'][_0x8a4a('0x22')]);_0x512b90[_0x8a4a('0x1f')]=qs[_0x8a4a('0x1f')](_0x52d173[_0x8a4a('0x32')][_0x8a4a('0x1f')]);}return _0x211642['getDescriptions'](_0x512b90);}})[_0x8a4a('0x27')](function(_0x13728e){if(_0x13728e){return _0x13728e?{'count':_0x5ed46d,'rows':_0x13728e}:null;}})[_0x8a4a('0x27')](respondWithResult(_0x370ece,null))[_0x8a4a('0x44')](handleError(_0x370ece,null));};exports[_0x8a4a('0x51')]=function(_0x6388b0,_0x26c0d3,_0x421f6a){var _0x3c2651={};var _0x49f4a6={};var _0x4e3e1d;var _0x1e0b78;return db[_0x8a4a('0x3f')][_0x8a4a('0x4c')]({'where':{'id':_0x6388b0[_0x8a4a('0x46')]['id']}})[_0x8a4a('0x27')](handleEntityNotFound(_0x26c0d3,null))[_0x8a4a('0x27')](function(_0x52082d){if(_0x52082d){_0x4e3e1d=_0x52082d;_0x49f4a6[_0x8a4a('0x30')]=_['keys'](db[_0x8a4a('0x50')][_0x8a4a('0x2c')]);_0x49f4a6[_0x8a4a('0x32')]=_[_0x8a4a('0x33')](_0x6388b0['query']);_0x49f4a6['filters']=_[_0x8a4a('0x35')](_0x49f4a6[_0x8a4a('0x30')],_0x49f4a6['query']);_0x3c2651[_0x8a4a('0x36')]=_['intersection'](_0x49f4a6['model'],qs['fields'](_0x6388b0[_0x8a4a('0x32')]['fields']));_0x3c2651[_0x8a4a('0x36')]=_0x3c2651['attributes'][_0x8a4a('0x38')]?_0x3c2651['attributes']:_0x49f4a6[_0x8a4a('0x30')];_0x3c2651[_0x8a4a('0x4d')]=qs[_0x8a4a('0x39')](_0x6388b0[_0x8a4a('0x32')]['sort']);_0x3c2651['where']=qs[_0x8a4a('0x34')](_[_0x8a4a('0x3b')](_0x6388b0['query'],_0x49f4a6[_0x8a4a('0x34')]));if(_0x6388b0['query'][_0x8a4a('0x3c')]){_0x3c2651[_0x8a4a('0x3a')]=_[_0x8a4a('0x3d')](_0x3c2651[_0x8a4a('0x3a')],{'$or':_['map'](_0x3c2651['attributes'],function(_0x3276a4){var _0x1e8e70={};_0x1e8e70[_0x3276a4]={'$like':'%'+_0x6388b0[_0x8a4a('0x32')][_0x8a4a('0x3c')]+'%'};return _0x1e8e70;})});}_0x3c2651=_[_0x8a4a('0x3d')]({},_0x3c2651,_0x6388b0[_0x8a4a('0x3e')]);return _0x4e3e1d['getFields'](_0x3c2651);}})['then'](function(_0x5c836e){if(_0x5c836e){_0x1e0b78=_0x5c836e[_0x8a4a('0x38')];if(!_0x6388b0['query'][_0x8a4a('0x4e')](_0x8a4a('0x4f'))){_0x3c2651[_0x8a4a('0x22')]=qs[_0x8a4a('0x22')](_0x6388b0[_0x8a4a('0x32')][_0x8a4a('0x22')]);_0x3c2651[_0x8a4a('0x1f')]=qs[_0x8a4a('0x1f')](_0x6388b0[_0x8a4a('0x32')][_0x8a4a('0x1f')]);}return _0x4e3e1d['getFields'](_0x3c2651);}})['then'](function(_0x515759){if(_0x515759){return _0x515759?{'count':_0x1e0b78,'rows':_0x515759}:null;}})['then'](respondWithResult(_0x26c0d3,null))[_0x8a4a('0x44')](handleError(_0x26c0d3,null));};
\ No newline at end of file
+var _0x853e=['lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesConfiguration','include','findAll','show','params','intersection','find','catch','create','body','getSubjects','findOne','FreshsalesField','order','getFields','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0x853e,0x93));var _0xe853=function(_0x1351d2,_0x5ce945){_0x1351d2=_0x1351d2-0x0;var _0x4412ad=_0x853e[_0x1351d2];return _0x4412ad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe853('0x0'));var jsonpatch=require(_0xe853('0x1'));var rp=require(_0xe853('0x2'));var moment=require(_0xe853('0x3'));var BPromise=require(_0xe853('0x4'));var Mustache=require(_0xe853('0x5'));var util=require(_0xe853('0x6'));var path=require(_0xe853('0x7'));var sox=require(_0xe853('0x8'));var csv=require(_0xe853('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe853('0xa'));var _=require(_0xe853('0xb'));var squel=require(_0xe853('0xc'));var crypto=require('crypto');var jsforce=require(_0xe853('0xd'));var deskjs=require(_0xe853('0xe'));var toCsv=require(_0xe853('0x9'));var querystring=require(_0xe853('0xf'));var Papa=require(_0xe853('0x10'));var Redis=require(_0xe853('0x11'));var authService=require(_0xe853('0x12'));var qs=require(_0xe853('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe853('0x14'));var logger=require(_0xe853('0x15'))(_0xe853('0x16'));var utils=require(_0xe853('0x17'));var config=require(_0xe853('0x18'));var licenseUtil=require(_0xe853('0x19'));var db=require(_0xe853('0x1a'))['db'];function respondWithStatusCode(_0x324c6e,_0x38c1c8){_0x38c1c8=_0x38c1c8||0xcc;return function(_0x2d2ba9){if(_0x2d2ba9){return _0x324c6e[_0xe853('0x1b')](_0x38c1c8);}return _0x324c6e[_0xe853('0x1c')](_0x38c1c8)[_0xe853('0x1d')]();};}function respondWithResult(_0x5e593f,_0x3f4efb){_0x3f4efb=_0x3f4efb||0xc8;return function(_0x1f85eb){if(_0x1f85eb){return _0x5e593f[_0xe853('0x1c')](_0x3f4efb)[_0xe853('0x1e')](_0x1f85eb);}};}function respondWithFilteredResult(_0x3f4cd7,_0x20f1c1){return function(_0x3f5bfb){if(_0x3f5bfb){var _0x4c282d=typeof _0x20f1c1[_0xe853('0x1f')]===_0xe853('0x20')&&typeof _0x20f1c1[_0xe853('0x21')]===_0xe853('0x20');var _0x17eab4=_0x3f5bfb['count'];var _0x32072f=_0x4c282d?0x0:_0x20f1c1[_0xe853('0x1f')];var _0xe1ed33=_0x4c282d?_0x3f5bfb[_0xe853('0x22')]:_0x20f1c1[_0xe853('0x1f')]+_0x20f1c1[_0xe853('0x21')];var _0x34832d;if(_0xe1ed33>=_0x17eab4){_0xe1ed33=_0x17eab4;_0x34832d=0xc8;}else{_0x34832d=0xce;}_0x3f4cd7['status'](_0x34832d);return _0x3f4cd7['set'](_0xe853('0x23'),_0x32072f+'-'+_0xe1ed33+'/'+_0x17eab4)['json'](_0x3f5bfb);}return null;};}function patchUpdates(_0x5debca){return function(_0x495121){try{jsonpatch[_0xe853('0x24')](_0x495121,_0x5debca,!![]);}catch(_0x53f35a){return BPromise[_0xe853('0x25')](_0x53f35a);}return _0x495121[_0xe853('0x26')]();};}function saveUpdates(_0x486d78,_0x21584e){return function(_0x39e074){if(_0x39e074){return _0x39e074[_0xe853('0x27')](_0x486d78)[_0xe853('0x28')](function(_0x5cae3f){return _0x5cae3f;});}return null;};}function removeEntity(_0x529076,_0x37af61){return function(_0x3da3ce){if(_0x3da3ce){return _0x3da3ce[_0xe853('0x29')]()['then'](function(){_0x529076[_0xe853('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x575607,_0x9285f9){return function(_0x3f1d64){if(!_0x3f1d64){_0x575607[_0xe853('0x1b')](0x194);}return _0x3f1d64;};}function handleError(_0x17a26c,_0x169cce){_0x169cce=_0x169cce||0x1f4;return function(_0x549874){logger[_0xe853('0x2a')](_0x549874['stack']);if(_0x549874[_0xe853('0x2b')]){delete _0x549874[_0xe853('0x2b')];}_0x17a26c[_0xe853('0x1c')](_0x169cce)['send'](_0x549874);};}exports['index']=function(_0x87c6a5,_0x11b3e0){var _0x1ffe79={},_0x15497a={},_0x363758={'count':0x0,'rows':[]};var _0x4df92b=_['map'](db['FreshsalesConfiguration'][_0xe853('0x2c')],function(_0x10e277){return{'name':_0x10e277[_0xe853('0x2d')],'type':_0x10e277[_0xe853('0x2e')]['key']};});_0x15497a[_0xe853('0x2f')]=_[_0xe853('0x30')](_0x4df92b,_0xe853('0x2b'));_0x15497a[_0xe853('0x31')]=_[_0xe853('0x32')](_0x87c6a5[_0xe853('0x31')]);_0x15497a[_0xe853('0x33')]=_['intersection'](_0x15497a[_0xe853('0x2f')],_0x15497a[_0xe853('0x31')]);_0x1ffe79[_0xe853('0x34')]=_['intersection'](_0x15497a[_0xe853('0x2f')],qs[_0xe853('0x35')](_0x87c6a5[_0xe853('0x31')][_0xe853('0x35')]));_0x1ffe79['attributes']=_0x1ffe79[_0xe853('0x34')][_0xe853('0x36')]?_0x1ffe79['attributes']:_0x15497a['model'];if(!_0x87c6a5['query'][_0xe853('0x37')](_0xe853('0x38'))){_0x1ffe79[_0xe853('0x21')]=qs[_0xe853('0x21')](_0x87c6a5['query'][_0xe853('0x21')]);_0x1ffe79[_0xe853('0x1f')]=qs[_0xe853('0x1f')](_0x87c6a5[_0xe853('0x31')][_0xe853('0x1f')]);}_0x1ffe79['order']=qs[_0xe853('0x39')](_0x87c6a5[_0xe853('0x31')][_0xe853('0x39')]);_0x1ffe79[_0xe853('0x3a')]=qs[_0xe853('0x33')](_[_0xe853('0x3b')](_0x87c6a5[_0xe853('0x31')],_0x15497a[_0xe853('0x33')]),_0x4df92b);if(_0x87c6a5['query'][_0xe853('0x3c')]){_0x1ffe79[_0xe853('0x3a')]=_[_0xe853('0x3d')](_0x1ffe79[_0xe853('0x3a')],{'$or':_['map'](_0x4df92b,function(_0x35d0f3){if(_0x35d0f3[_0xe853('0x2e')]!==_0xe853('0x3e')){var _0x2e7f73={};_0x2e7f73[_0x35d0f3['name']]={'$like':'%'+_0x87c6a5[_0xe853('0x31')]['filter']+'%'};return _0x2e7f73;}})});}_0x1ffe79=_[_0xe853('0x3d')]({},_0x1ffe79,_0x87c6a5[_0xe853('0x3f')]);var _0x4e7d40={'where':_0x1ffe79[_0xe853('0x3a')]};return db[_0xe853('0x40')]['count'](_0x4e7d40)[_0xe853('0x28')](function(_0xbd1745){_0x363758[_0xe853('0x22')]=_0xbd1745;if(_0x87c6a5[_0xe853('0x31')]['includeAll']){_0x1ffe79[_0xe853('0x41')]=[{'all':!![]}];}return db[_0xe853('0x40')][_0xe853('0x42')](_0x1ffe79);})[_0xe853('0x28')](function(_0x82fd73){_0x363758['rows']=_0x82fd73;return _0x363758;})[_0xe853('0x28')](respondWithFilteredResult(_0x11b3e0,_0x1ffe79))['catch'](handleError(_0x11b3e0,null));};exports[_0xe853('0x43')]=function(_0x414034,_0x274db8){var _0x5ad50a={'raw':![],'where':{'id':_0x414034[_0xe853('0x44')]['id']}},_0x789e1d={};_0x789e1d['model']=_[_0xe853('0x32')](db[_0xe853('0x40')]['rawAttributes']);_0x789e1d[_0xe853('0x31')]=_[_0xe853('0x32')](_0x414034[_0xe853('0x31')]);_0x789e1d[_0xe853('0x33')]=_[_0xe853('0x45')](_0x789e1d[_0xe853('0x2f')],_0x789e1d[_0xe853('0x31')]);_0x5ad50a[_0xe853('0x34')]=_[_0xe853('0x45')](_0x789e1d[_0xe853('0x2f')],qs['fields'](_0x414034[_0xe853('0x31')][_0xe853('0x35')]));_0x5ad50a['attributes']=_0x5ad50a['attributes']['length']?_0x5ad50a['attributes']:_0x789e1d[_0xe853('0x2f')];if(_0x414034[_0xe853('0x31')]['includeAll']){_0x5ad50a[_0xe853('0x41')]=[{'all':!![]}];}_0x5ad50a=_[_0xe853('0x3d')]({},_0x5ad50a,_0x414034[_0xe853('0x3f')]);return db[_0xe853('0x40')][_0xe853('0x46')](_0x5ad50a)[_0xe853('0x28')](handleEntityNotFound(_0x274db8,null))['then'](respondWithResult(_0x274db8,null))[_0xe853('0x47')](handleError(_0x274db8,null));};exports['create']=function(_0x46fcd6,_0x3fb95a){return db[_0xe853('0x40')][_0xe853('0x48')](_0x46fcd6[_0xe853('0x49')],{})[_0xe853('0x28')](respondWithResult(_0x3fb95a,0xc9))[_0xe853('0x47')](handleError(_0x3fb95a,null));};exports[_0xe853('0x27')]=function(_0x7f7e1,_0x35be0d){if(_0x7f7e1['body']['id']){delete _0x7f7e1[_0xe853('0x49')]['id'];}return db[_0xe853('0x40')][_0xe853('0x46')]({'where':{'id':_0x7f7e1[_0xe853('0x44')]['id']}})[_0xe853('0x28')](handleEntityNotFound(_0x35be0d,null))[_0xe853('0x28')](saveUpdates(_0x7f7e1[_0xe853('0x49')],null))[_0xe853('0x28')](respondWithResult(_0x35be0d,null))[_0xe853('0x47')](handleError(_0x35be0d,null));};exports['destroy']=function(_0x4226c9,_0xa5b464){return db[_0xe853('0x40')]['find']({'where':{'id':_0x4226c9['params']['id']}})['then'](handleEntityNotFound(_0xa5b464,null))['then'](removeEntity(_0xa5b464,null))['catch'](handleError(_0xa5b464,null));};exports[_0xe853('0x4a')]=function(_0x16a586,_0x1f0cdf,_0x11ba42){var _0x56339d={};var _0x70c8db={};var _0x3b42ae;var _0x2d77d5;return db[_0xe853('0x40')][_0xe853('0x4b')]({'where':{'id':_0x16a586['params']['id']}})[_0xe853('0x28')](handleEntityNotFound(_0x1f0cdf,null))[_0xe853('0x28')](function(_0x3f4d34){if(_0x3f4d34){_0x3b42ae=_0x3f4d34;_0x70c8db[_0xe853('0x2f')]=_['keys'](db[_0xe853('0x4c')][_0xe853('0x2c')]);_0x70c8db['query']=_['keys'](_0x16a586[_0xe853('0x31')]);_0x70c8db[_0xe853('0x33')]=_[_0xe853('0x45')](_0x70c8db[_0xe853('0x2f')],_0x70c8db[_0xe853('0x31')]);_0x56339d[_0xe853('0x34')]=_['intersection'](_0x70c8db[_0xe853('0x2f')],qs['fields'](_0x16a586[_0xe853('0x31')][_0xe853('0x35')]));_0x56339d[_0xe853('0x34')]=_0x56339d['attributes'][_0xe853('0x36')]?_0x56339d['attributes']:_0x70c8db[_0xe853('0x2f')];_0x56339d[_0xe853('0x4d')]=qs[_0xe853('0x39')](_0x16a586[_0xe853('0x31')][_0xe853('0x39')]);_0x56339d[_0xe853('0x3a')]=qs[_0xe853('0x33')](_[_0xe853('0x3b')](_0x16a586[_0xe853('0x31')],_0x70c8db['filters']));if(_0x16a586[_0xe853('0x31')]['filter']){_0x56339d[_0xe853('0x3a')]=_[_0xe853('0x3d')](_0x56339d[_0xe853('0x3a')],{'$or':_[_0xe853('0x30')](_0x56339d[_0xe853('0x34')],function(_0x5d3323){var _0x220941={};_0x220941[_0x5d3323]={'$like':'%'+_0x16a586['query'][_0xe853('0x3c')]+'%'};return _0x220941;})});}_0x56339d=_[_0xe853('0x3d')]({},_0x56339d,_0x16a586['options']);return _0x3b42ae[_0xe853('0x4a')](_0x56339d);}})[_0xe853('0x28')](function(_0xe37ce8){if(_0xe37ce8){_0x2d77d5=_0xe37ce8[_0xe853('0x36')];if(!_0x16a586[_0xe853('0x31')][_0xe853('0x37')](_0xe853('0x38'))){_0x56339d[_0xe853('0x21')]=qs[_0xe853('0x21')](_0x16a586[_0xe853('0x31')]['limit']);_0x56339d[_0xe853('0x1f')]=qs[_0xe853('0x1f')](_0x16a586[_0xe853('0x31')][_0xe853('0x1f')]);}return _0x3b42ae[_0xe853('0x4a')](_0x56339d);}})[_0xe853('0x28')](function(_0x146679){if(_0x146679){return _0x146679?{'count':_0x2d77d5,'rows':_0x146679}:null;}})[_0xe853('0x28')](respondWithResult(_0x1f0cdf,null))[_0xe853('0x47')](handleError(_0x1f0cdf,null));};exports['getDescriptions']=function(_0x11d431,_0x4cbf7f,_0x16af41){var _0x1cba43={};var _0x886cc9={};var _0x3943d7;var _0x5f5b7a;return db[_0xe853('0x40')][_0xe853('0x4b')]({'where':{'id':_0x11d431[_0xe853('0x44')]['id']}})[_0xe853('0x28')](handleEntityNotFound(_0x4cbf7f,null))[_0xe853('0x28')](function(_0x4d0d72){if(_0x4d0d72){_0x3943d7=_0x4d0d72;_0x886cc9[_0xe853('0x2f')]=_[_0xe853('0x32')](db[_0xe853('0x4c')][_0xe853('0x2c')]);_0x886cc9['query']=_[_0xe853('0x32')](_0x11d431[_0xe853('0x31')]);_0x886cc9[_0xe853('0x33')]=_['intersection'](_0x886cc9[_0xe853('0x2f')],_0x886cc9[_0xe853('0x31')]);_0x1cba43[_0xe853('0x34')]=_[_0xe853('0x45')](_0x886cc9['model'],qs[_0xe853('0x35')](_0x11d431[_0xe853('0x31')][_0xe853('0x35')]));_0x1cba43[_0xe853('0x34')]=_0x1cba43[_0xe853('0x34')][_0xe853('0x36')]?_0x1cba43[_0xe853('0x34')]:_0x886cc9[_0xe853('0x2f')];_0x1cba43[_0xe853('0x4d')]=qs[_0xe853('0x39')](_0x11d431[_0xe853('0x31')][_0xe853('0x39')]);_0x1cba43[_0xe853('0x3a')]=qs[_0xe853('0x33')](_[_0xe853('0x3b')](_0x11d431['query'],_0x886cc9['filters']));if(_0x11d431[_0xe853('0x31')]['filter']){_0x1cba43[_0xe853('0x3a')]=_[_0xe853('0x3d')](_0x1cba43['where'],{'$or':_[_0xe853('0x30')](_0x1cba43['attributes'],function(_0x4d73d7){var _0x1a3279={};_0x1a3279[_0x4d73d7]={'$like':'%'+_0x11d431[_0xe853('0x31')][_0xe853('0x3c')]+'%'};return _0x1a3279;})});}_0x1cba43=_[_0xe853('0x3d')]({},_0x1cba43,_0x11d431[_0xe853('0x3f')]);return _0x3943d7['getDescriptions'](_0x1cba43);}})[_0xe853('0x28')](function(_0x22cb4b){if(_0x22cb4b){_0x5f5b7a=_0x22cb4b[_0xe853('0x36')];if(!_0x11d431[_0xe853('0x31')][_0xe853('0x37')](_0xe853('0x38'))){_0x1cba43[_0xe853('0x21')]=qs['limit'](_0x11d431[_0xe853('0x31')][_0xe853('0x21')]);_0x1cba43[_0xe853('0x1f')]=qs[_0xe853('0x1f')](_0x11d431[_0xe853('0x31')][_0xe853('0x1f')]);}return _0x3943d7['getDescriptions'](_0x1cba43);}})['then'](function(_0x312dae){if(_0x312dae){return _0x312dae?{'count':_0x5f5b7a,'rows':_0x312dae}:null;}})[_0xe853('0x28')](respondWithResult(_0x4cbf7f,null))['catch'](handleError(_0x4cbf7f,null));};exports[_0xe853('0x4e')]=function(_0x413fb2,_0x589d44,_0x25e0a4){var _0xd1ca92={};var _0x4bf877={};var _0x5def41;var _0x3ade92;return db[_0xe853('0x40')]['findOne']({'where':{'id':_0x413fb2['params']['id']}})[_0xe853('0x28')](handleEntityNotFound(_0x589d44,null))[_0xe853('0x28')](function(_0x2c1d77){if(_0x2c1d77){_0x5def41=_0x2c1d77;_0x4bf877[_0xe853('0x2f')]=_['keys'](db['FreshsalesField'][_0xe853('0x2c')]);_0x4bf877[_0xe853('0x31')]=_[_0xe853('0x32')](_0x413fb2['query']);_0x4bf877[_0xe853('0x33')]=_['intersection'](_0x4bf877[_0xe853('0x2f')],_0x4bf877[_0xe853('0x31')]);_0xd1ca92[_0xe853('0x34')]=_['intersection'](_0x4bf877['model'],qs[_0xe853('0x35')](_0x413fb2['query'][_0xe853('0x35')]));_0xd1ca92[_0xe853('0x34')]=_0xd1ca92['attributes'][_0xe853('0x36')]?_0xd1ca92[_0xe853('0x34')]:_0x4bf877[_0xe853('0x2f')];_0xd1ca92[_0xe853('0x4d')]=qs[_0xe853('0x39')](_0x413fb2['query'][_0xe853('0x39')]);_0xd1ca92[_0xe853('0x3a')]=qs[_0xe853('0x33')](_[_0xe853('0x3b')](_0x413fb2[_0xe853('0x31')],_0x4bf877[_0xe853('0x33')]));if(_0x413fb2[_0xe853('0x31')][_0xe853('0x3c')]){_0xd1ca92[_0xe853('0x3a')]=_[_0xe853('0x3d')](_0xd1ca92[_0xe853('0x3a')],{'$or':_['map'](_0xd1ca92['attributes'],function(_0x19c7b0){var _0x18a655={};_0x18a655[_0x19c7b0]={'$like':'%'+_0x413fb2[_0xe853('0x31')][_0xe853('0x3c')]+'%'};return _0x18a655;})});}_0xd1ca92=_[_0xe853('0x3d')]({},_0xd1ca92,_0x413fb2[_0xe853('0x3f')]);return _0x5def41[_0xe853('0x4e')](_0xd1ca92);}})[_0xe853('0x28')](function(_0x301e07){if(_0x301e07){_0x3ade92=_0x301e07[_0xe853('0x36')];if(!_0x413fb2[_0xe853('0x31')]['hasOwnProperty'](_0xe853('0x38'))){_0xd1ca92['limit']=qs[_0xe853('0x21')](_0x413fb2[_0xe853('0x31')][_0xe853('0x21')]);_0xd1ca92['offset']=qs[_0xe853('0x1f')](_0x413fb2[_0xe853('0x31')]['offset']);}return _0x5def41[_0xe853('0x4e')](_0xd1ca92);}})[_0xe853('0x28')](function(_0x4e5c4d){if(_0x4e5c4d){return _0x4e5c4d?{'count':_0x3ade92,'rows':_0x4e5c4d}:null;}})[_0xe853('0x28')](respondWithResult(_0x589d44,null))[_0xe853('0x47')](handleError(_0x589d44,null));};
\ No newline at end of file
index 2c57ca3..a607341 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0633=['path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','util','../../config/logger','api','moment','bluebird'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0633,0x1db));var _0x3063=function(_0x5e87e7,_0x471685){_0x5e87e7=_0x5e87e7-0x0;var _0x2aaa25=_0x0633[_0x5e87e7];return _0x2aaa25;};'use strict';var _=require('lodash');var util=require(_0x3063('0x0'));var logger=require(_0x3063('0x1'))(_0x3063('0x2'));var moment=require(_0x3063('0x3'));var BPromise=require(_0x3063('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3063('0x5'));var rimraf=require(_0x3063('0x6'));var config=require(_0x3063('0x7'));var attributes=require(_0x3063('0x8'));module['exports']=function(_0x5eeb85,_0x178b39){return _0x5eeb85[_0x3063('0x9')](_0x3063('0xa'),attributes,{'tableName':_0x3063('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x68f8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','int_freshsales_configurations','lodash','../../config/logger','api'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x68f8,0x14f));var _0x868f=function(_0x435abe,_0x3d3682){_0x435abe=_0x435abe-0x0;var _0x4349e0=_0x68f8[_0x435abe];return _0x4349e0;};'use strict';var _=require(_0x868f('0x0'));var util=require('util');var logger=require(_0x868f('0x1'))(_0x868f('0x2'));var moment=require(_0x868f('0x3'));var BPromise=require(_0x868f('0x4'));var rp=require(_0x868f('0x5'));var fs=require('fs');var path=require(_0x868f('0x6'));var rimraf=require(_0x868f('0x7'));var config=require(_0x868f('0x8'));var attributes=require(_0x868f('0x9'));module[_0x868f('0xa')]=function(_0x4ca7e6,_0x22d1ec){return _0x4ca7e6[_0x868f('0xb')]('FreshsalesConfiguration',attributes,{'tableName':_0x868f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 59c4baf..549565a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71e9=['FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x71e9,0x16d));var _0x971e=function(_0x52630b,_0x99ba){_0x52630b=_0x52630b-0x0;var _0x4d5bbc=_0x71e9[_0x52630b];return _0x4d5bbc;};'use strict';var _=require(_0x971e('0x0'));var util=require(_0x971e('0x1'));var moment=require('moment');var BPromise=require(_0x971e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x971e('0x3'));var db=require(_0x971e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x971e('0x5'))(_0x971e('0x6'));var config=require(_0x971e('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x971e('0x8')][_0x971e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x35ef12,_0x2be580,_0x303388){return new BPromise(function(_0x14cbea,_0x548d41){return client[_0x971e('0xa')](_0x35ef12,_0x303388)[_0x971e('0xb')](function(_0x517c0e){logger[_0x971e('0xc')](_0x971e('0xd'),_0x2be580,_0x971e('0xe'));logger[_0x971e('0xf')](_0x971e('0x10'),_0x2be580,'request\x20sent',JSON['stringify'](_0x517c0e));if(_0x517c0e[_0x971e('0x11')]){if(_0x517c0e[_0x971e('0x11')][_0x971e('0x12')]===0x1f4){logger['error'](_0x971e('0xd'),_0x2be580,_0x517c0e[_0x971e('0x11')]['message']);return _0x548d41(_0x517c0e['error'][_0x971e('0x13')]);}logger[_0x971e('0x11')](_0x971e('0xd'),_0x2be580,_0x517c0e[_0x971e('0x11')]['message']);return _0x14cbea(_0x517c0e[_0x971e('0x11')][_0x971e('0x13')]);}else{logger[_0x971e('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2be580,_0x971e('0xe'));_0x14cbea(_0x517c0e['result']['message']);}})[_0x971e('0x14')](function(_0x5549c5){logger[_0x971e('0x11')](_0x971e('0xd'),_0x2be580,_0x5549c5);_0x548d41(_0x5549c5);});});}
\ No newline at end of file
+var _0xbde0=['stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x38f38f,_0xfb83e2){var _0x58377d=function(_0x5177f4){while(--_0x5177f4){_0x38f38f['push'](_0x38f38f['shift']());}};_0x58377d(++_0xfb83e2);}(_0xbde0,0x8a));var _0x0bde=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xbde0[_0x1589dd];return _0x1bddd1;};'use strict';var _=require('lodash');var util=require(_0x0bde('0x0'));var moment=require(_0x0bde('0x1'));var BPromise=require(_0x0bde('0x2'));var rs=require(_0x0bde('0x3'));var fs=require('fs');var Redis=require(_0x0bde('0x4'));var db=require(_0x0bde('0x5'))['db'];var utils=require(_0x0bde('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x0bde('0x7'));var jayson=require(_0x0bde('0x8'));var client=jayson[_0x0bde('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53e098,_0x2c8cd0,_0x54e379){return new BPromise(function(_0x297233,_0x53e708){return client[_0x0bde('0xa')](_0x53e098,_0x54e379)[_0x0bde('0xb')](function(_0x58695c){logger[_0x0bde('0xc')](_0x0bde('0xd'),_0x2c8cd0,_0x0bde('0xe'));logger['debug'](_0x0bde('0xf'),_0x2c8cd0,_0x0bde('0xe'),JSON[_0x0bde('0x10')](_0x58695c));if(_0x58695c[_0x0bde('0x11')]){if(_0x58695c['error'][_0x0bde('0x12')]===0x1f4){logger['error'](_0x0bde('0xd'),_0x2c8cd0,_0x58695c[_0x0bde('0x11')][_0x0bde('0x13')]);return _0x53e708(_0x58695c['error'][_0x0bde('0x13')]);}logger[_0x0bde('0x11')](_0x0bde('0xd'),_0x2c8cd0,_0x58695c[_0x0bde('0x11')][_0x0bde('0x13')]);return _0x297233(_0x58695c[_0x0bde('0x11')][_0x0bde('0x13')]);}else{logger[_0x0bde('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2c8cd0,_0x0bde('0xe'));_0x297233(_0x58695c[_0x0bde('0x14')][_0x0bde('0x13')]);}})[_0x0bde('0x15')](function(_0x573e68){logger[_0x0bde('0x11')](_0x0bde('0xd'),_0x2c8cd0,_0x573e68);_0x53e708(_0x573e68);});});}
\ No newline at end of file
index f196ae6..88cec09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x949d=['../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','get','show','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x2f7409,_0x5678aa){var _0x473c14=function(_0x21d1a9){while(--_0x21d1a9){_0x2f7409['push'](_0x2f7409['shift']());}};_0x473c14(++_0x5678aa);}(_0x949d,0x162));var _0xd949=function(_0x4c1f2a,_0x1c8b14){_0x4c1f2a=_0x4c1f2a-0x0;var _0x543ece=_0x949d[_0x4c1f2a];return _0x543ece;};'use strict';var multer=require(_0xd949('0x0'));var util=require(_0xd949('0x1'));var path=require(_0xd949('0x2'));var timeout=require(_0xd949('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd949('0x4'));var auth=require(_0xd949('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd949('0x6'));var controller=require(_0xd949('0x7'));router['get']('/',auth[_0xd949('0x8')](),controller[_0xd949('0x9')]);router[_0xd949('0xa')]('/:id',auth[_0xd949('0x8')](),controller[_0xd949('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd949('0xc')]);router[_0xd949('0xd')](_0xd949('0xe'),auth[_0xd949('0x8')](),controller[_0xd949('0xf')]);router['delete']('/:id',auth[_0xd949('0x8')](),controller[_0xd949('0x10')]);module[_0xd949('0x11')]=router;
\ No newline at end of file
+var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x564cda,_0x5bb97f){var _0xc09e18=function(_0x222d60){while(--_0x222d60){_0x564cda['push'](_0x564cda['shift']());}};_0xc09e18(++_0x5bb97f);}(_0x008c,0x188));var _0xc008=function(_0x4d0df6,_0x4634f3){_0x4d0df6=_0x4d0df6-0x0;var _0x4e2615=_0x008c[_0x4d0df6];return _0x4e2615;};'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 fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router;
\ No newline at end of file
index 8b2e578..cb93ea5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba57=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x2ed7d1,_0x363741){var _0x38ae3c=function(_0x4a1b42){while(--_0x4a1b42){_0x2ed7d1['push'](_0x2ed7d1['shift']());}};_0x38ae3c(++_0x363741);}(_0xba57,0xe9));var _0x7ba5=function(_0x33996f,_0x260902){_0x33996f=_0x33996f-0x0;var _0x5cf03c=_0xba57[_0x33996f];return _0x5cf03c;};'use strict';var Sequelize=require(_0x7ba5('0x0'));module[_0x7ba5('0x1')]={'type':{'type':Sequelize[_0x7ba5('0x2')](_0x7ba5('0x3'),_0x7ba5('0x4'),_0x7ba5('0x5'),_0x7ba5('0x6'),'picklist'),'defaultValue':_0x7ba5('0x3')},'content':{'type':Sequelize[_0x7ba5('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7ba5('0x2')](_0x7ba5('0x3'),_0x7ba5('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x7ba5('0x7')]},'idField':{'type':Sequelize[_0x7ba5('0x7')]},'nameField':{'type':Sequelize[_0x7ba5('0x7')]},'customField':{'type':Sequelize[_0x7ba5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7ba5('0x7')]}};
\ No newline at end of file
+var _0xd888=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN','sequelize'];(function(_0x1abace,_0x453116){var _0x3eac5d=function(_0x33ff55){while(--_0x33ff55){_0x1abace['push'](_0x1abace['shift']());}};_0x3eac5d(++_0x453116);}(_0xd888,0x77));var _0x8d88=function(_0x389da3,_0x1208ed){_0x389da3=_0x389da3-0x0;var _0x5a8e6c=_0xd888[_0x389da3];return _0x5a8e6c;};'use strict';var Sequelize=require(_0x8d88('0x0'));module[_0x8d88('0x1')]={'type':{'type':Sequelize[_0x8d88('0x2')]('string',_0x8d88('0x3'),_0x8d88('0x4'),_0x8d88('0x5'),_0x8d88('0x6')),'defaultValue':_0x8d88('0x7')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8d88('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x8d88('0x7'),_0x8d88('0x3'),_0x8d88('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8d88('0x8')]},'customField':{'type':Sequelize[_0x8d88('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8d88('0x8')]}};
\ No newline at end of file
index c4808f4..9c54bbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac8b=['squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','name','send','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','FreshsalesField','findAll','rows','catch','show','params','keys','intersection','create','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x2a72be,_0x57ebda){var _0x56c8f2=function(_0xc39188){while(--_0xc39188){_0x2a72be['push'](_0x2a72be['shift']());}};_0x56c8f2(++_0x57ebda);}(_0xac8b,0x161));var _0xbac8=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xac8b[_0x9cd4c3];return _0x4c9025;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbac8('0x0'));var zipdir=require(_0xbac8('0x1'));var jsonpatch=require(_0xbac8('0x2'));var rp=require('request-promise');var moment=require(_0xbac8('0x3'));var BPromise=require(_0xbac8('0x4'));var Mustache=require('mustache');var util=require(_0xbac8('0x5'));var path=require(_0xbac8('0x6'));var sox=require(_0xbac8('0x7'));var csv=require(_0xbac8('0x8'));var ejs=require(_0xbac8('0x9'));var fs=require('fs');var fs_extra=require(_0xbac8('0xa'));var _=require(_0xbac8('0xb'));var squel=require(_0xbac8('0xc'));var crypto=require(_0xbac8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbac8('0xe'));var toCsv=require(_0xbac8('0x8'));var querystring=require(_0xbac8('0xf'));var Papa=require('papaparse');var Redis=require(_0xbac8('0x10'));var authService=require(_0xbac8('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbac8('0x12'));var logger=require(_0xbac8('0x13'))(_0xbac8('0x14'));var utils=require('../../config/utils');var config=require(_0xbac8('0x15'));var licenseUtil=require(_0xbac8('0x16'));var db=require(_0xbac8('0x17'))['db'];function respondWithStatusCode(_0x3791b9,_0x2d702c){_0x2d702c=_0x2d702c||0xcc;return function(_0x23e787){if(_0x23e787){return _0x3791b9[_0xbac8('0x18')](_0x2d702c);}return _0x3791b9['status'](_0x2d702c)[_0xbac8('0x19')]();};}function respondWithResult(_0x1ca557,_0x31257f){_0x31257f=_0x31257f||0xc8;return function(_0x2544d9){if(_0x2544d9){return _0x1ca557[_0xbac8('0x1a')](_0x31257f)[_0xbac8('0x1b')](_0x2544d9);}};}function respondWithFilteredResult(_0x5613a9,_0x4c9cd8){return function(_0x4205bd){if(_0x4205bd){var _0xe6c671=typeof _0x4c9cd8[_0xbac8('0x1c')]===_0xbac8('0x1d')&&typeof _0x4c9cd8[_0xbac8('0x1e')]==='undefined';var _0xdca072=_0x4205bd[_0xbac8('0x1f')];var _0x2cc36e=_0xe6c671?0x0:_0x4c9cd8[_0xbac8('0x1c')];var _0x501547=_0xe6c671?_0x4205bd['count']:_0x4c9cd8[_0xbac8('0x1c')]+_0x4c9cd8[_0xbac8('0x1e')];var _0x4f5233;if(_0x501547>=_0xdca072){_0x501547=_0xdca072;_0x4f5233=0xc8;}else{_0x4f5233=0xce;}_0x5613a9[_0xbac8('0x1a')](_0x4f5233);return _0x5613a9['set'](_0xbac8('0x20'),_0x2cc36e+'-'+_0x501547+'/'+_0xdca072)['json'](_0x4205bd);}return null;};}function patchUpdates(_0x7f02d8){return function(_0x52b085){try{jsonpatch[_0xbac8('0x21')](_0x52b085,_0x7f02d8,!![]);}catch(_0x2baef9){return BPromise[_0xbac8('0x22')](_0x2baef9);}return _0x52b085[_0xbac8('0x23')]();};}function saveUpdates(_0x507b64,_0x7085dc){return function(_0x387fe9){if(_0x387fe9){return _0x387fe9[_0xbac8('0x24')](_0x507b64)['then'](function(_0x2523d9){return _0x2523d9;});}return null;};}function removeEntity(_0x5125d4,_0x2f62de){return function(_0x55c02f){if(_0x55c02f){return _0x55c02f[_0xbac8('0x25')]()[_0xbac8('0x26')](function(){_0x5125d4[_0xbac8('0x1a')](0xcc)[_0xbac8('0x19')]();});}};}function handleEntityNotFound(_0x42ae15,_0x462e72){return function(_0xa432fc){if(!_0xa432fc){_0x42ae15[_0xbac8('0x18')](0x194);}return _0xa432fc;};}function handleError(_0x16fd1a,_0x24776b){_0x24776b=_0x24776b||0x1f4;return function(_0x23c805){logger['error'](_0x23c805['stack']);if(_0x23c805[_0xbac8('0x27')]){delete _0x23c805[_0xbac8('0x27')];}_0x16fd1a['status'](_0x24776b)[_0xbac8('0x28')](_0x23c805);};}exports['index']=function(_0x119368,_0x5b35a6){var _0x4baeb5={},_0x5db2ff={},_0x114f02={'count':0x0,'rows':[]};var _0x301efc=_['map'](db['FreshsalesField'][_0xbac8('0x29')],function(_0x460c85){return{'name':_0x460c85[_0xbac8('0x2a')],'type':_0x460c85[_0xbac8('0x2b')][_0xbac8('0x2c')]};});_0x5db2ff[_0xbac8('0x2d')]=_[_0xbac8('0x2e')](_0x301efc,_0xbac8('0x27'));_0x5db2ff['query']=_['keys'](_0x119368[_0xbac8('0x2f')]);_0x5db2ff[_0xbac8('0x30')]=_['intersection'](_0x5db2ff[_0xbac8('0x2d')],_0x5db2ff[_0xbac8('0x2f')]);_0x4baeb5[_0xbac8('0x31')]=_['intersection'](_0x5db2ff[_0xbac8('0x2d')],qs[_0xbac8('0x32')](_0x119368['query']['fields']));_0x4baeb5[_0xbac8('0x31')]=_0x4baeb5[_0xbac8('0x31')][_0xbac8('0x33')]?_0x4baeb5[_0xbac8('0x31')]:_0x5db2ff['model'];if(!_0x119368[_0xbac8('0x2f')][_0xbac8('0x34')](_0xbac8('0x35'))){_0x4baeb5[_0xbac8('0x1e')]=qs[_0xbac8('0x1e')](_0x119368[_0xbac8('0x2f')][_0xbac8('0x1e')]);_0x4baeb5[_0xbac8('0x1c')]=qs[_0xbac8('0x1c')](_0x119368[_0xbac8('0x2f')][_0xbac8('0x1c')]);}_0x4baeb5['order']=qs[_0xbac8('0x36')](_0x119368[_0xbac8('0x2f')][_0xbac8('0x36')]);_0x4baeb5[_0xbac8('0x37')]=qs[_0xbac8('0x30')](_['pick'](_0x119368['query'],_0x5db2ff[_0xbac8('0x30')]),_0x301efc);if(_0x119368[_0xbac8('0x2f')][_0xbac8('0x38')]){_0x4baeb5['where']=_[_0xbac8('0x39')](_0x4baeb5[_0xbac8('0x37')],{'$or':_[_0xbac8('0x2e')](_0x301efc,function(_0x391b83){if(_0x391b83[_0xbac8('0x2b')]!==_0xbac8('0x3a')){var _0x5025a7={};_0x5025a7[_0x391b83['name']]={'$like':'%'+_0x119368[_0xbac8('0x2f')]['filter']+'%'};return _0x5025a7;}})});}_0x4baeb5=_[_0xbac8('0x39')]({},_0x4baeb5,_0x119368[_0xbac8('0x3b')]);var _0x5b615a={'where':_0x4baeb5[_0xbac8('0x37')]};return db['FreshsalesField'][_0xbac8('0x1f')](_0x5b615a)[_0xbac8('0x26')](function(_0x215714){_0x114f02[_0xbac8('0x1f')]=_0x215714;if(_0x119368[_0xbac8('0x2f')][_0xbac8('0x3c')]){_0x4baeb5[_0xbac8('0x3d')]=[{'all':!![]}];}return db[_0xbac8('0x3e')][_0xbac8('0x3f')](_0x4baeb5);})[_0xbac8('0x26')](function(_0x18a54e){_0x114f02[_0xbac8('0x40')]=_0x18a54e;return _0x114f02;})[_0xbac8('0x26')](respondWithFilteredResult(_0x5b35a6,_0x4baeb5))[_0xbac8('0x41')](handleError(_0x5b35a6,null));};exports[_0xbac8('0x42')]=function(_0x463e5c,_0x417f77){var _0x3a65b1={'raw':!![],'where':{'id':_0x463e5c[_0xbac8('0x43')]['id']}},_0x5e6379={};_0x5e6379['model']=_[_0xbac8('0x44')](db[_0xbac8('0x3e')][_0xbac8('0x29')]);_0x5e6379[_0xbac8('0x2f')]=_['keys'](_0x463e5c[_0xbac8('0x2f')]);_0x5e6379[_0xbac8('0x30')]=_[_0xbac8('0x45')](_0x5e6379['model'],_0x5e6379['query']);_0x3a65b1['attributes']=_[_0xbac8('0x45')](_0x5e6379[_0xbac8('0x2d')],qs[_0xbac8('0x32')](_0x463e5c[_0xbac8('0x2f')]['fields']));_0x3a65b1[_0xbac8('0x31')]=_0x3a65b1[_0xbac8('0x31')][_0xbac8('0x33')]?_0x3a65b1[_0xbac8('0x31')]:_0x5e6379[_0xbac8('0x2d')];if(_0x463e5c[_0xbac8('0x2f')][_0xbac8('0x3c')]){_0x3a65b1[_0xbac8('0x3d')]=[{'all':!![]}];}_0x3a65b1=_[_0xbac8('0x39')]({},_0x3a65b1,_0x463e5c[_0xbac8('0x3b')]);return db[_0xbac8('0x3e')]['find'](_0x3a65b1)[_0xbac8('0x26')](handleEntityNotFound(_0x417f77,null))[_0xbac8('0x26')](respondWithResult(_0x417f77,null))[_0xbac8('0x41')](handleError(_0x417f77,null));};exports[_0xbac8('0x46')]=function(_0x59f209,_0x1c5c13){return db['FreshsalesField']['create'](_0x59f209[_0xbac8('0x47')],{})[_0xbac8('0x26')](respondWithResult(_0x1c5c13,0xc9))['catch'](handleError(_0x1c5c13,null));};exports['update']=function(_0x4dd3dc,_0x15e628){if(_0x4dd3dc[_0xbac8('0x47')]['id']){delete _0x4dd3dc[_0xbac8('0x47')]['id'];}return db[_0xbac8('0x3e')][_0xbac8('0x48')]({'where':{'id':_0x4dd3dc['params']['id']}})[_0xbac8('0x26')](handleEntityNotFound(_0x15e628,null))[_0xbac8('0x26')](saveUpdates(_0x4dd3dc[_0xbac8('0x47')],null))[_0xbac8('0x26')](respondWithResult(_0x15e628,null))[_0xbac8('0x41')](handleError(_0x15e628,null));};exports[_0xbac8('0x25')]=function(_0x2f39c5,_0x1efaf6){return db[_0xbac8('0x3e')][_0xbac8('0x48')]({'where':{'id':_0x2f39c5[_0xbac8('0x43')]['id']}})[_0xbac8('0x26')](handleEntityNotFound(_0x1efaf6,null))[_0xbac8('0x26')](removeEntity(_0x1efaf6,null))[_0xbac8('0x41')](handleError(_0x1efaf6,null));};
\ No newline at end of file
+var _0x48e6=['crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','FreshsalesField','rawAttributes','type','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','merge','where','map','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','eml-format','rimraf','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash'];(function(_0x20ea8e,_0x46a195){var _0x4a8598=function(_0x2d3981){while(--_0x2d3981){_0x20ea8e['push'](_0x20ea8e['shift']());}};_0x4a8598(++_0x46a195);}(_0x48e6,0x1a0));var _0x648e=function(_0x45fb5c,_0xcf432a){_0x45fb5c=_0x45fb5c-0x0;var _0x410841=_0x48e6[_0x45fb5c];return _0x410841;};'use strict';var emlformat=require(_0x648e('0x0'));var rimraf=require(_0x648e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x648e('0x2'));var moment=require('moment');var BPromise=require(_0x648e('0x3'));var Mustache=require(_0x648e('0x4'));var util=require('util');var path=require(_0x648e('0x5'));var sox=require(_0x648e('0x6'));var csv=require('to-csv');var ejs=require(_0x648e('0x7'));var fs=require('fs');var fs_extra=require(_0x648e('0x8'));var _=require(_0x648e('0x9'));var squel=require('squel');var crypto=require(_0x648e('0xa'));var jsforce=require(_0x648e('0xb'));var deskjs=require(_0x648e('0xc'));var toCsv=require(_0x648e('0xd'));var querystring=require('querystring');var Papa=require(_0x648e('0xe'));var Redis=require(_0x648e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x648e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x648e('0x11'));var logger=require('../../config/logger')(_0x648e('0x12'));var utils=require(_0x648e('0x13'));var config=require(_0x648e('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x648e('0x15'))['db'];function respondWithStatusCode(_0x449a06,_0x3fb327){_0x3fb327=_0x3fb327||0xcc;return function(_0x23695e){if(_0x23695e){return _0x449a06['sendStatus'](_0x3fb327);}return _0x449a06['status'](_0x3fb327)[_0x648e('0x16')]();};}function respondWithResult(_0x2b9be4,_0x2ea0ba){_0x2ea0ba=_0x2ea0ba||0xc8;return function(_0x4cc58f){if(_0x4cc58f){return _0x2b9be4[_0x648e('0x17')](_0x2ea0ba)[_0x648e('0x18')](_0x4cc58f);}};}function respondWithFilteredResult(_0x57a1f9,_0x260cb5){return function(_0x1bb34d){if(_0x1bb34d){var _0x3f158a=typeof _0x260cb5[_0x648e('0x19')]===_0x648e('0x1a')&&typeof _0x260cb5[_0x648e('0x1b')]==='undefined';var _0xf6df2f=_0x1bb34d['count'];var _0x227927=_0x3f158a?0x0:_0x260cb5[_0x648e('0x19')];var _0x14433c=_0x3f158a?_0x1bb34d[_0x648e('0x1c')]:_0x260cb5[_0x648e('0x19')]+_0x260cb5[_0x648e('0x1b')];var _0x58ed4a;if(_0x14433c>=_0xf6df2f){_0x14433c=_0xf6df2f;_0x58ed4a=0xc8;}else{_0x58ed4a=0xce;}_0x57a1f9[_0x648e('0x17')](_0x58ed4a);return _0x57a1f9[_0x648e('0x1d')](_0x648e('0x1e'),_0x227927+'-'+_0x14433c+'/'+_0xf6df2f)[_0x648e('0x18')](_0x1bb34d);}return null;};}function patchUpdates(_0x2c7157){return function(_0x425de2){try{jsonpatch[_0x648e('0x1f')](_0x425de2,_0x2c7157,!![]);}catch(_0x6d7137){return BPromise[_0x648e('0x20')](_0x6d7137);}return _0x425de2[_0x648e('0x21')]();};}function saveUpdates(_0x41f3dc,_0x3a7c24){return function(_0x162608){if(_0x162608){return _0x162608[_0x648e('0x22')](_0x41f3dc)[_0x648e('0x23')](function(_0x4b9282){return _0x4b9282;});}return null;};}function removeEntity(_0x532533,_0x535e61){return function(_0x199713){if(_0x199713){return _0x199713[_0x648e('0x24')]()[_0x648e('0x23')](function(){_0x532533[_0x648e('0x17')](0xcc)[_0x648e('0x16')]();});}};}function handleEntityNotFound(_0x22caf5,_0x4d9374){return function(_0x20f6fa){if(!_0x20f6fa){_0x22caf5[_0x648e('0x25')](0x194);}return _0x20f6fa;};}function handleError(_0x4390f1,_0x3aef32){_0x3aef32=_0x3aef32||0x1f4;return function(_0x3fe017){logger[_0x648e('0x26')](_0x3fe017[_0x648e('0x27')]);if(_0x3fe017[_0x648e('0x28')]){delete _0x3fe017[_0x648e('0x28')];}_0x4390f1[_0x648e('0x17')](_0x3aef32)[_0x648e('0x29')](_0x3fe017);};}exports[_0x648e('0x2a')]=function(_0x2bcce7,_0x1f023a){var _0x5e4713={},_0x5613a0={},_0x5458f9={'count':0x0,'rows':[]};var _0x400168=_['map'](db[_0x648e('0x2b')][_0x648e('0x2c')],function(_0x416702){return{'name':_0x416702['fieldName'],'type':_0x416702[_0x648e('0x2d')]['key']};});_0x5613a0[_0x648e('0x2e')]=_['map'](_0x400168,_0x648e('0x28'));_0x5613a0['query']=_[_0x648e('0x2f')](_0x2bcce7['query']);_0x5613a0['filters']=_[_0x648e('0x30')](_0x5613a0[_0x648e('0x2e')],_0x5613a0[_0x648e('0x31')]);_0x5e4713[_0x648e('0x32')]=_[_0x648e('0x30')](_0x5613a0['model'],qs[_0x648e('0x33')](_0x2bcce7['query']['fields']));_0x5e4713['attributes']=_0x5e4713[_0x648e('0x32')][_0x648e('0x34')]?_0x5e4713['attributes']:_0x5613a0[_0x648e('0x2e')];if(!_0x2bcce7[_0x648e('0x31')][_0x648e('0x35')](_0x648e('0x36'))){_0x5e4713['limit']=qs[_0x648e('0x1b')](_0x2bcce7[_0x648e('0x31')][_0x648e('0x1b')]);_0x5e4713[_0x648e('0x19')]=qs[_0x648e('0x19')](_0x2bcce7[_0x648e('0x31')][_0x648e('0x19')]);}_0x5e4713[_0x648e('0x37')]=qs[_0x648e('0x38')](_0x2bcce7[_0x648e('0x31')][_0x648e('0x38')]);_0x5e4713['where']=qs[_0x648e('0x39')](_['pick'](_0x2bcce7[_0x648e('0x31')],_0x5613a0[_0x648e('0x39')]),_0x400168);if(_0x2bcce7['query']['filter']){_0x5e4713['where']=_[_0x648e('0x3a')](_0x5e4713[_0x648e('0x3b')],{'$or':_[_0x648e('0x3c')](_0x400168,function(_0x45b55e){if(_0x45b55e[_0x648e('0x2d')]!==_0x648e('0x3d')){var _0x3c5a59={};_0x3c5a59[_0x45b55e[_0x648e('0x28')]]={'$like':'%'+_0x2bcce7['query']['filter']+'%'};return _0x3c5a59;}})});}_0x5e4713=_[_0x648e('0x3a')]({},_0x5e4713,_0x2bcce7[_0x648e('0x3e')]);var _0x2ee5f0={'where':_0x5e4713['where']};return db[_0x648e('0x2b')][_0x648e('0x1c')](_0x2ee5f0)[_0x648e('0x23')](function(_0x513b16){_0x5458f9[_0x648e('0x1c')]=_0x513b16;if(_0x2bcce7[_0x648e('0x31')][_0x648e('0x3f')]){_0x5e4713[_0x648e('0x40')]=[{'all':!![]}];}return db[_0x648e('0x2b')][_0x648e('0x41')](_0x5e4713);})[_0x648e('0x23')](function(_0x306ea6){_0x5458f9['rows']=_0x306ea6;return _0x5458f9;})[_0x648e('0x23')](respondWithFilteredResult(_0x1f023a,_0x5e4713))[_0x648e('0x42')](handleError(_0x1f023a,null));};exports['show']=function(_0x4da9dc,_0x2209b2){var _0x26d00c={'raw':!![],'where':{'id':_0x4da9dc[_0x648e('0x43')]['id']}},_0x5eeb57={};_0x5eeb57['model']=_[_0x648e('0x2f')](db[_0x648e('0x2b')][_0x648e('0x2c')]);_0x5eeb57['query']=_['keys'](_0x4da9dc[_0x648e('0x31')]);_0x5eeb57[_0x648e('0x39')]=_['intersection'](_0x5eeb57[_0x648e('0x2e')],_0x5eeb57[_0x648e('0x31')]);_0x26d00c['attributes']=_['intersection'](_0x5eeb57[_0x648e('0x2e')],qs[_0x648e('0x33')](_0x4da9dc[_0x648e('0x31')]['fields']));_0x26d00c['attributes']=_0x26d00c[_0x648e('0x32')]['length']?_0x26d00c[_0x648e('0x32')]:_0x5eeb57[_0x648e('0x2e')];if(_0x4da9dc[_0x648e('0x31')]['includeAll']){_0x26d00c[_0x648e('0x40')]=[{'all':!![]}];}_0x26d00c=_[_0x648e('0x3a')]({},_0x26d00c,_0x4da9dc[_0x648e('0x3e')]);return db['FreshsalesField'][_0x648e('0x44')](_0x26d00c)['then'](handleEntityNotFound(_0x2209b2,null))['then'](respondWithResult(_0x2209b2,null))['catch'](handleError(_0x2209b2,null));};exports[_0x648e('0x45')]=function(_0x152c26,_0x25c5ab){return db[_0x648e('0x2b')][_0x648e('0x45')](_0x152c26[_0x648e('0x46')],{})[_0x648e('0x23')](respondWithResult(_0x25c5ab,0xc9))[_0x648e('0x42')](handleError(_0x25c5ab,null));};exports[_0x648e('0x22')]=function(_0x98c50b,_0x4a0438){if(_0x98c50b[_0x648e('0x46')]['id']){delete _0x98c50b[_0x648e('0x46')]['id'];}return db[_0x648e('0x2b')][_0x648e('0x44')]({'where':{'id':_0x98c50b['params']['id']}})[_0x648e('0x23')](handleEntityNotFound(_0x4a0438,null))[_0x648e('0x23')](saveUpdates(_0x98c50b[_0x648e('0x46')],null))[_0x648e('0x23')](respondWithResult(_0x4a0438,null))[_0x648e('0x42')](handleError(_0x4a0438,null));};exports[_0x648e('0x24')]=function(_0x28299b,_0x10e779){return db[_0x648e('0x2b')][_0x648e('0x44')]({'where':{'id':_0x28299b[_0x648e('0x43')]['id']}})[_0x648e('0x23')](handleEntityNotFound(_0x10e779,null))[_0x648e('0x23')](removeEntity(_0x10e779,null))[_0x648e('0x42')](handleError(_0x10e779,null));};
\ No newline at end of file
index 00c0ef8..e55d4ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe062=['request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','freshsales_unique_index','idField','lodash','util','moment','bluebird'];(function(_0x30c2dc,_0x4f66d5){var _0x27ec6d=function(_0x3dd9f5){while(--_0x3dd9f5){_0x30c2dc['push'](_0x30c2dc['shift']());}};_0x27ec6d(++_0x4f66d5);}(_0xe062,0x1b8));var _0x2e06=function(_0xdd6796,_0xdb87d0){_0xdd6796=_0xdd6796-0x0;var _0x3210b0=_0xe062[_0xdd6796];return _0x3210b0;};'use strict';var _=require(_0x2e06('0x0'));var util=require(_0x2e06('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2e06('0x2'));var BPromise=require(_0x2e06('0x3'));var rp=require(_0x2e06('0x4'));var fs=require('fs');var path=require(_0x2e06('0x5'));var rimraf=require(_0x2e06('0x6'));var config=require(_0x2e06('0x7'));var attributes=require(_0x2e06('0x8'));module[_0x2e06('0x9')]=function(_0x7fc3ae,_0x480c91){return _0x7fc3ae['define']('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x2e06('0xa'),'fields':[_0x2e06('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2dd8=['FieldId','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','define','FreshsalesField','freshsales_unique_index','idField'];(function(_0x3cd546,_0x4c9db7){var _0x5e0ac1=function(_0x2aa5aa){while(--_0x2aa5aa){_0x3cd546['push'](_0x3cd546['shift']());}};_0x5e0ac1(++_0x4c9db7);}(_0x2dd8,0x143));var _0x82dd=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2dd8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x82dd('0x0'));var util=require(_0x82dd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x82dd('0x2'));var BPromise=require(_0x82dd('0x3'));var rp=require(_0x82dd('0x4'));var fs=require('fs');var path=require(_0x82dd('0x5'));var rimraf=require(_0x82dd('0x6'));var config=require(_0x82dd('0x7'));var attributes=require(_0x82dd('0x8'));module['exports']=function(_0x4026c3,_0x1cfdce){return _0x4026c3[_0x82dd('0x9')](_0x82dd('0xa'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x82dd('0xb'),'fields':[_0x82dd('0xc'),_0x82dd('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index f949305..0b18d54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f8a=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x311306,_0x2e91c0){_0x311306=_0x311306-0x0;var _0x569aea=_0x3f8a[_0x311306];return _0x569aea;};'use strict';var _=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var moment=require(_0xa3f8('0x2'));var BPromise=require(_0xa3f8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa3f8('0x4'));var db=require(_0xa3f8('0x5'))['db'];var utils=require(_0xa3f8('0x6'));var logger=require(_0xa3f8('0x7'))(_0xa3f8('0x8'));var config=require(_0xa3f8('0x9'));var jayson=require(_0xa3f8('0xa'));var client=jayson[_0xa3f8('0xb')][_0xa3f8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xf895d9,_0xcfea5,_0x268332){return new BPromise(function(_0x2faf2e,_0x2448de){return client[_0xa3f8('0xd')](_0xf895d9,_0x268332)[_0xa3f8('0xe')](function(_0xcdb0d4){logger['info'](_0xa3f8('0xf'),_0xcfea5,_0xa3f8('0x10'));logger[_0xa3f8('0x11')](_0xa3f8('0x12'),_0xcfea5,'request\x20sent',JSON[_0xa3f8('0x13')](_0xcdb0d4));if(_0xcdb0d4[_0xa3f8('0x14')]){if(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x15')]===0x1f4){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);return _0x2448de(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0xcdb0d4['error'][_0xa3f8('0x16')]);return _0x2faf2e(_0xcdb0d4[_0xa3f8('0x14')][_0xa3f8('0x16')]);}else{logger[_0xa3f8('0x17')]('FreshsalesField,\x20%s,\x20%s',_0xcfea5,_0xa3f8('0x10'));_0x2faf2e(_0xcdb0d4[_0xa3f8('0x18')][_0xa3f8('0x16')]);}})[_0xa3f8('0x19')](function(_0x45ef64){logger[_0xa3f8('0x14')](_0xa3f8('0xf'),_0xcfea5,_0x45ef64);_0x2448de(_0x45ef64);});});}
\ No newline at end of file
+var _0x7c09=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0xc14a52,_0x5b84b9){var _0x2e5227=function(_0x580348){while(--_0x580348){_0xc14a52['push'](_0xc14a52['shift']());}};_0x2e5227(++_0x5b84b9);}(_0x7c09,0x102));var _0x97c0=function(_0x1b3a7a,_0x11c287){_0x1b3a7a=_0x1b3a7a-0x0;var _0x4881e8=_0x7c09[_0x1b3a7a];return _0x4881e8;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var moment=require(_0x97c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x97c0('0x2'));var fs=require('fs');var Redis=require(_0x97c0('0x3'));var db=require(_0x97c0('0x4'))['db'];var utils=require(_0x97c0('0x5'));var logger=require(_0x97c0('0x6'))(_0x97c0('0x7'));var config=require(_0x97c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x46fdd9,_0x42c6c7,_0x2c19fa){return new BPromise(function(_0x109bc8,_0x293785){return client['request'](_0x46fdd9,_0x2c19fa)[_0x97c0('0x9')](function(_0x4ac5f1){logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,'request\x20sent');logger['debug'](_0x97c0('0xc'),_0x42c6c7,_0x97c0('0xd'),JSON[_0x97c0('0xe')](_0x4ac5f1));if(_0x4ac5f1[_0x97c0('0xf')]){if(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x10')]===0x1f4){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x293785(_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);}logger[_0x97c0('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x42c6c7,_0x4ac5f1[_0x97c0('0xf')][_0x97c0('0x11')]);return _0x109bc8(_0x4ac5f1[_0x97c0('0xf')]['message']);}else{logger[_0x97c0('0xa')](_0x97c0('0xb'),_0x42c6c7,_0x97c0('0xd'));_0x109bc8(_0x4ac5f1[_0x97c0('0x12')][_0x97c0('0x11')]);}})[_0x97c0('0x13')](function(_0x49c0d9){logger[_0x97c0('0xf')](_0x97c0('0xb'),_0x42c6c7,_0x49c0d9);_0x293785(_0x49c0d9);});});}
\ No newline at end of file
index 18ec6fa..06fdf48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x169c08,_0x16ac55){var _0x48f138=function(_0x5674e7){while(--_0x5674e7){_0x169c08['push'](_0x169c08['shift']());}};_0x48f138(++_0x16ac55);}(_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 fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x36d79e,_0x47381e){var _0x4230c8=function(_0x2e35d5){while(--_0x2e35d5){_0x36d79e['push'](_0x36d79e['shift']());}};_0x4230c8(++_0x47381e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
index 5e75503..debbaf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cfd=['integrationTab','newTab','exports','STRING','username'];(function(_0x16fba6,_0x316823){var _0x2d0878=function(_0x52a3d9){while(--_0x52a3d9){_0x16fba6['push'](_0x16fba6['shift']());}};_0x2d0878(++_0x316823);}(_0x2cfd,0x179));var _0xd2cf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cfd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0xd2cf('0x0')]={'name':{'type':Sequelize[_0xd2cf('0x1')]},'description':{'type':Sequelize[_0xd2cf('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xd2cf('0x2')},'remoteUri':{'type':Sequelize[_0xd2cf('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0xd2cf('0x1')]},'serverUrl':{'type':Sequelize[_0xd2cf('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xd2cf('0x3'),_0xd2cf('0x4')),'defaultValue':_0xd2cf('0x3')}};
\ No newline at end of file
+var _0x99e7=['username','integrationTab','sequelize','exports','STRING'];(function(_0x1a7809,_0x392d2b){var _0x10c780=function(_0x5a6219){while(--_0x5a6219){_0x1a7809['push'](_0x1a7809['shift']());}};_0x10c780(++_0x392d2b);}(_0x99e7,0x1b5));var _0x799e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x99e7[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x799e('0x0'));module[_0x799e('0x1')]={'name':{'type':Sequelize[_0x799e('0x2')]},'description':{'type':Sequelize[_0x799e('0x2')]},'username':{'type':Sequelize[_0x799e('0x2')],'unique':_0x799e('0x3')},'remoteUri':{'type':Sequelize[_0x799e('0x2')]},'password':{'type':Sequelize[_0x799e('0x2')]},'clientId':{'type':Sequelize[_0x799e('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x799e('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x799e('0x4'),'newTab'),'defaultValue':_0x799e('0x4')}};
\ No newline at end of file
index bc3ea06..f01fa28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeec6=['save','update','then','destroy','error','stack','map','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','options','SalesforceAccount','include','findAll','rows','show','params','fields','length','includeAll','find','catch','create','body','getConfigurations','findOne','sort','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','lastIndexOf','Connection','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','email','phone','remove','includes','custom','picklistValues','label','value','true','False','false','test','statusCode','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply'];(function(_0x3a1ba4,_0x35cf00){var _0x1e1e2d=function(_0x24fd55){while(--_0x24fd55){_0x3a1ba4['push'](_0x3a1ba4['shift']());}};_0x1e1e2d(++_0x35cf00);}(_0xeec6,0x158));var _0x6eec=function(_0x1bf8f5,_0x28f62c){_0x1bf8f5=_0x1bf8f5-0x0;var _0x36a54e=_0xeec6[_0x1bf8f5];return _0x36a54e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6eec('0x0'));var zipdir=require(_0x6eec('0x1'));var jsonpatch=require(_0x6eec('0x2'));var rp=require(_0x6eec('0x3'));var moment=require(_0x6eec('0x4'));var BPromise=require(_0x6eec('0x5'));var Mustache=require(_0x6eec('0x6'));var util=require(_0x6eec('0x7'));var path=require(_0x6eec('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6eec('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6eec('0xa'));var squel=require(_0x6eec('0xb'));var crypto=require(_0x6eec('0xc'));var jsforce=require(_0x6eec('0xd'));var deskjs=require(_0x6eec('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6eec('0xf'));var Papa=require(_0x6eec('0x10'));var Redis=require('ioredis');var authService=require(_0x6eec('0x11'));var qs=require(_0x6eec('0x12'));var as=require(_0x6eec('0x13'));var hardwareService=require(_0x6eec('0x14'));var logger=require(_0x6eec('0x15'))(_0x6eec('0x16'));var utils=require(_0x6eec('0x17'));var config=require(_0x6eec('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6eec('0x19'))['db'];var integrations=require(_0x6eec('0x1a'));function respondWithStatusCode(_0x37b3c2,_0xf15e46){_0xf15e46=_0xf15e46||0xcc;return function(_0x21d758){if(_0x21d758){return _0x37b3c2[_0x6eec('0x1b')](_0xf15e46);}return _0x37b3c2[_0x6eec('0x1c')](_0xf15e46)[_0x6eec('0x1d')]();};}function respondWithResult(_0x101aeb,_0x211f8c){_0x211f8c=_0x211f8c||0xc8;return function(_0x4124a7){if(_0x4124a7){return _0x101aeb[_0x6eec('0x1c')](_0x211f8c)['json'](_0x4124a7);}};}function respondWithFilteredResult(_0xacdd4e,_0x4477a7){return function(_0x12dd9f){if(_0x12dd9f){var _0x2c614e=typeof _0x4477a7[_0x6eec('0x1e')]===_0x6eec('0x1f')&&typeof _0x4477a7['limit']===_0x6eec('0x1f');var _0x4d8b66=_0x12dd9f[_0x6eec('0x20')];var _0x2ab8c2=_0x2c614e?0x0:_0x4477a7[_0x6eec('0x1e')];var _0xacf3de=_0x2c614e?_0x12dd9f['count']:_0x4477a7[_0x6eec('0x1e')]+_0x4477a7[_0x6eec('0x21')];var _0x1e66c5;if(_0xacf3de>=_0x4d8b66){_0xacf3de=_0x4d8b66;_0x1e66c5=0xc8;}else{_0x1e66c5=0xce;}_0xacdd4e[_0x6eec('0x1c')](_0x1e66c5);return _0xacdd4e['set'](_0x6eec('0x22'),_0x2ab8c2+'-'+_0xacf3de+'/'+_0x4d8b66)[_0x6eec('0x23')](_0x12dd9f);}return null;};}function patchUpdates(_0x4d8398){return function(_0x407742){try{jsonpatch[_0x6eec('0x24')](_0x407742,_0x4d8398,!![]);}catch(_0x3c235d){return BPromise['reject'](_0x3c235d);}return _0x407742[_0x6eec('0x25')]();};}function saveUpdates(_0x50d9ed,_0x4bdb56){return function(_0x374760){if(_0x374760){return _0x374760[_0x6eec('0x26')](_0x50d9ed)[_0x6eec('0x27')](function(_0x3887eb){return _0x3887eb;});}return null;};}function removeEntity(_0x58ed38,_0xca6f4e){return function(_0x38c8d6){if(_0x38c8d6){return _0x38c8d6[_0x6eec('0x28')]()[_0x6eec('0x27')](function(){_0x58ed38[_0x6eec('0x1c')](0xcc)[_0x6eec('0x1d')]();});}};}function handleEntityNotFound(_0x47ee70,_0x1509fc){return function(_0xee6444){if(!_0xee6444){_0x47ee70[_0x6eec('0x1b')](0x194);}return _0xee6444;};}function handleError(_0x5733a7,_0x1cf46a){_0x1cf46a=_0x1cf46a||0x1f4;return function(_0x2c7d9f){logger[_0x6eec('0x29')](_0x2c7d9f[_0x6eec('0x2a')]);if(_0x2c7d9f['name']){delete _0x2c7d9f['name'];}_0x5733a7['status'](_0x1cf46a)['send'](_0x2c7d9f);};}exports['index']=function(_0x270438,_0x270d8e){var _0x2147a5={},_0x455d5b={},_0x2a0d63={'count':0x0,'rows':[]};var _0x1f3f37=_[_0x6eec('0x2b')](db['SalesforceAccount'][_0x6eec('0x2c')],function(_0xef70f4){return{'name':_0xef70f4['fieldName'],'type':_0xef70f4[_0x6eec('0x2d')][_0x6eec('0x2e')]};});_0x455d5b[_0x6eec('0x2f')]=_['map'](_0x1f3f37,_0x6eec('0x30'));_0x455d5b[_0x6eec('0x31')]=_[_0x6eec('0x32')](_0x270438[_0x6eec('0x31')]);_0x455d5b[_0x6eec('0x33')]=_[_0x6eec('0x34')](_0x455d5b[_0x6eec('0x2f')],_0x455d5b['query']);_0x2147a5[_0x6eec('0x35')]=_[_0x6eec('0x34')](_0x455d5b[_0x6eec('0x2f')],qs['fields'](_0x270438['query']['fields']));_0x2147a5[_0x6eec('0x35')]=_0x2147a5[_0x6eec('0x35')]['length']?_0x2147a5['attributes']:_0x455d5b[_0x6eec('0x2f')];if(!_0x270438[_0x6eec('0x31')][_0x6eec('0x36')](_0x6eec('0x37'))){_0x2147a5[_0x6eec('0x21')]=qs[_0x6eec('0x21')](_0x270438[_0x6eec('0x31')]['limit']);_0x2147a5[_0x6eec('0x1e')]=qs[_0x6eec('0x1e')](_0x270438['query']['offset']);}_0x2147a5[_0x6eec('0x38')]=qs['sort'](_0x270438[_0x6eec('0x31')]['sort']);_0x2147a5['where']=qs[_0x6eec('0x33')](_[_0x6eec('0x39')](_0x270438[_0x6eec('0x31')],_0x455d5b[_0x6eec('0x33')]),_0x1f3f37);if(_0x270438[_0x6eec('0x31')][_0x6eec('0x3a')]){_0x2147a5[_0x6eec('0x3b')]=_[_0x6eec('0x3c')](_0x2147a5[_0x6eec('0x3b')],{'$or':_['map'](_0x1f3f37,function(_0x225a1b){if(_0x225a1b['type']!==_0x6eec('0x3d')){var _0x463716={};_0x463716[_0x225a1b[_0x6eec('0x30')]]={'$like':'%'+_0x270438[_0x6eec('0x31')]['filter']+'%'};return _0x463716;}})});}_0x2147a5=_[_0x6eec('0x3c')]({},_0x2147a5,_0x270438[_0x6eec('0x3e')]);var _0xe9cb82={'where':_0x2147a5[_0x6eec('0x3b')]};return db[_0x6eec('0x3f')][_0x6eec('0x20')](_0xe9cb82)[_0x6eec('0x27')](function(_0x51f547){_0x2a0d63['count']=_0x51f547;if(_0x270438['query']['includeAll']){_0x2147a5[_0x6eec('0x40')]=[{'all':!![]}];}return db[_0x6eec('0x3f')][_0x6eec('0x41')](_0x2147a5);})[_0x6eec('0x27')](function(_0x5cf1c5){_0x2a0d63[_0x6eec('0x42')]=_0x5cf1c5;return _0x2a0d63;})[_0x6eec('0x27')](respondWithFilteredResult(_0x270d8e,_0x2147a5))['catch'](handleError(_0x270d8e,null));};exports[_0x6eec('0x43')]=function(_0x1c3bf4,_0xfe7ac3){var _0x346035={'raw':![],'where':{'id':_0x1c3bf4[_0x6eec('0x44')]['id']}},_0x397dca={};_0x397dca['model']=_[_0x6eec('0x32')](db['SalesforceAccount'][_0x6eec('0x2c')]);_0x397dca[_0x6eec('0x31')]=_[_0x6eec('0x32')](_0x1c3bf4[_0x6eec('0x31')]);_0x397dca[_0x6eec('0x33')]=_['intersection'](_0x397dca[_0x6eec('0x2f')],_0x397dca[_0x6eec('0x31')]);_0x346035[_0x6eec('0x35')]=_[_0x6eec('0x34')](_0x397dca[_0x6eec('0x2f')],qs[_0x6eec('0x45')](_0x1c3bf4[_0x6eec('0x31')]['fields']));_0x346035[_0x6eec('0x35')]=_0x346035[_0x6eec('0x35')][_0x6eec('0x46')]?_0x346035[_0x6eec('0x35')]:_0x397dca['model'];if(_0x1c3bf4[_0x6eec('0x31')][_0x6eec('0x47')]){_0x346035[_0x6eec('0x40')]=[{'all':!![]}];}_0x346035=_[_0x6eec('0x3c')]({},_0x346035,_0x1c3bf4[_0x6eec('0x3e')]);return db[_0x6eec('0x3f')][_0x6eec('0x48')](_0x346035)[_0x6eec('0x27')](handleEntityNotFound(_0xfe7ac3,null))[_0x6eec('0x27')](respondWithResult(_0xfe7ac3,null))[_0x6eec('0x49')](handleError(_0xfe7ac3,null));};exports[_0x6eec('0x4a')]=function(_0x397a75,_0x4af72d){return db[_0x6eec('0x3f')][_0x6eec('0x4a')](_0x397a75[_0x6eec('0x4b')],{})['then'](respondWithResult(_0x4af72d,0xc9))[_0x6eec('0x49')](handleError(_0x4af72d,null));};exports[_0x6eec('0x26')]=function(_0xbd35e,_0x270c84){if(_0xbd35e[_0x6eec('0x4b')]['id']){delete _0xbd35e[_0x6eec('0x4b')]['id'];}return db['SalesforceAccount'][_0x6eec('0x48')]({'where':{'id':_0xbd35e['params']['id']}})[_0x6eec('0x27')](handleEntityNotFound(_0x270c84,null))['then'](saveUpdates(_0xbd35e[_0x6eec('0x4b')],null))[_0x6eec('0x27')](respondWithResult(_0x270c84,null))[_0x6eec('0x49')](handleError(_0x270c84,null));};exports['destroy']=function(_0x21bb3c,_0x5bc8a8){return db['SalesforceAccount']['find']({'where':{'id':_0x21bb3c[_0x6eec('0x44')]['id']}})[_0x6eec('0x27')](handleEntityNotFound(_0x5bc8a8,null))['then'](removeEntity(_0x5bc8a8,null))[_0x6eec('0x49')](handleError(_0x5bc8a8,null));};exports[_0x6eec('0x4c')]=function(_0x26f46e,_0x397e2d,_0x7d1d4c){var _0xc45a08={};var _0x3b2d36={};var _0x4049f7;var _0x5b169f;return db[_0x6eec('0x3f')][_0x6eec('0x4d')]({'where':{'id':_0x26f46e[_0x6eec('0x44')]['id']}})[_0x6eec('0x27')](handleEntityNotFound(_0x397e2d,null))[_0x6eec('0x27')](function(_0x217a4c){if(_0x217a4c){_0x4049f7=_0x217a4c;_0x3b2d36[_0x6eec('0x2f')]=_[_0x6eec('0x32')](db['SalesforceConfiguration']['rawAttributes']);_0x3b2d36[_0x6eec('0x31')]=_[_0x6eec('0x32')](_0x26f46e['query']);_0x3b2d36['filters']=_[_0x6eec('0x34')](_0x3b2d36[_0x6eec('0x2f')],_0x3b2d36['query']);_0xc45a08['attributes']=_[_0x6eec('0x34')](_0x3b2d36[_0x6eec('0x2f')],qs[_0x6eec('0x45')](_0x26f46e[_0x6eec('0x31')]['fields']));_0xc45a08[_0x6eec('0x35')]=_0xc45a08[_0x6eec('0x35')][_0x6eec('0x46')]?_0xc45a08['attributes']:_0x3b2d36['model'];_0xc45a08['order']=qs[_0x6eec('0x4e')](_0x26f46e[_0x6eec('0x31')]['sort']);_0xc45a08[_0x6eec('0x3b')]=qs['filters'](_[_0x6eec('0x39')](_0x26f46e['query'],_0x3b2d36[_0x6eec('0x33')]));if(_0x26f46e[_0x6eec('0x31')][_0x6eec('0x3a')]){_0xc45a08[_0x6eec('0x3b')]=_['merge'](_0xc45a08['where'],{'$or':_['map'](_0xc45a08['attributes'],function(_0x2481f7){var _0x56a915={};_0x56a915[_0x2481f7]={'$like':'%'+_0x26f46e[_0x6eec('0x31')][_0x6eec('0x3a')]+'%'};return _0x56a915;})});}_0xc45a08=_[_0x6eec('0x3c')]({},_0xc45a08,_0x26f46e[_0x6eec('0x3e')]);return _0x4049f7['getConfigurations'](_0xc45a08);}})['then'](function(_0x54621e){if(_0x54621e){_0x5b169f=_0x54621e[_0x6eec('0x46')];if(!_0x26f46e[_0x6eec('0x31')][_0x6eec('0x36')](_0x6eec('0x37'))){_0xc45a08[_0x6eec('0x21')]=qs[_0x6eec('0x21')](_0x26f46e['query'][_0x6eec('0x21')]);_0xc45a08[_0x6eec('0x1e')]=qs['offset'](_0x26f46e[_0x6eec('0x31')][_0x6eec('0x1e')]);}return _0x4049f7[_0x6eec('0x4c')](_0xc45a08);}})['then'](function(_0xa3b482){if(_0xa3b482){return _0xa3b482?{'count':_0x5b169f,'rows':_0xa3b482}:null;}})[_0x6eec('0x27')](respondWithResult(_0x397e2d,null))[_0x6eec('0x49')](handleError(_0x397e2d,null));};exports[_0x6eec('0x4f')]=function(_0x36f61e,_0x523c42,_0x457275){if(_0x36f61e[_0x6eec('0x4b')]['id']){delete _0x36f61e[_0x6eec('0x4b')]['id'];}return db[_0x6eec('0x3f')][_0x6eec('0x4d')]({'where':{'id':_0x36f61e[_0x6eec('0x44')]['id']}})[_0x6eec('0x27')](handleEntityNotFound(_0x523c42,null))[_0x6eec('0x27')](function(_0x554740){if(_0x554740){_0x36f61e[_0x6eec('0x4b')][_0x6eec('0x50')]=_0x554740['id'];_0x36f61e[_0x6eec('0x4b')]['Subjects']=integrations[_0x6eec('0x51')](_0x36f61e[_0x6eec('0x4b')]['channel'],_0x36f61e[_0x6eec('0x4b')][_0x6eec('0x2d')]);_0x36f61e['body'][_0x6eec('0x52')]=integrations[_0x6eec('0x53')](_0x36f61e[_0x6eec('0x4b')]['channel'],_0x36f61e[_0x6eec('0x4b')][_0x6eec('0x2d')]);return db[_0x6eec('0x54')][_0x6eec('0x4a')](_0x36f61e['body'],{'include':[{'model':db[_0x6eec('0x55')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0x6eec('0x52')}]});}return null;})[_0x6eec('0x27')](respondWithResult(_0x523c42,null))[_0x6eec('0x49')](handleError(_0x523c42,null));};exports[_0x6eec('0x56')]=function(_0x994e8,_0x3ebc6c,_0x440a05){var _0x1782be;var _0x7713cc='';var _0x10543d=_0x6eec('0x57');return db['SalesforceAccount']['findOne']({'where':{'id':_0x994e8['params']['id']},'attributes':['id',_0x6eec('0x58'),_0x6eec('0x59'),_0x6eec('0x5a'),_0x6eec('0x5b'),_0x6eec('0x5c'),'securityToken']})['then'](handleEntityNotFound(_0x3ebc6c,null))[_0x6eec('0x27')](function(_0x5240a0){if(_0x5240a0){_0x7713cc=_0x5240a0['remoteUri'];var _0x47c2ea=_0x7713cc[_0x6eec('0x5d')](-0x1);if(_0x47c2ea==='/'){_0x7713cc=_0x7713cc['substring'](0x0,_0x7713cc[_0x6eec('0x5e')](_0x47c2ea));}_0x1782be=new jsforce[(_0x6eec('0x5f'))]({'oauth2':{'loginUrl':_0x7713cc,'clientId':_0x5240a0[_0x6eec('0x59')],'clientSecret':_0x5240a0[_0x6eec('0x5a')]}});return _0x1782be['login'](_0x5240a0[_0x6eec('0x5b')],_0x5240a0[_0x6eec('0x5c')][_0x6eec('0x60')](_0x5240a0[_0x6eec('0x61')]));}})['then'](function(_0x3964b8){if(_0x3964b8){if(!_[_0x6eec('0x62')](_0x994e8[_0x6eec('0x31')][_0x6eec('0x63')])){_0x10543d=_0x994e8[_0x6eec('0x31')][_0x6eec('0x63')];}return _0x1782be[_0x6eec('0x64')](_0x10543d)[_0x6eec('0x65')]();}})[_0x6eec('0x27')](function(_0x11430d){var _0x47f64a=[_0x6eec('0x66'),_0x6eec('0x67'),_0x6eec('0x68'),_0x6eec('0x69'),_0x6eec('0x6a'),_0x6eec('0x6b')];var _0x56b601=[_0x6eec('0x6c'),_0x6eec('0x6d'),_0x6eec('0x6e'),_0x6eec('0x6f'),_0x6eec('0x70'),'textarea',_0x6eec('0x71')];if(_0x11430d){_[_0x6eec('0x72')](_0x11430d['fields'],function(_0x4c6313){return _0x47f64a[_0x6eec('0x73')](_0x4c6313[_0x6eec('0x30')])||!_0x56b601[_0x6eec('0x73')](_0x4c6313[_0x6eec('0x2d')]);});return{'count':_0x11430d[_0x6eec('0x45')][_0x6eec('0x46')],'rows':_['map'](_0x11430d[_0x6eec('0x45')],function(_0x42f8e1){return{'id':_0x42f8e1[_0x6eec('0x30')],'name':_0x42f8e1['label'],'custom':_0x42f8e1[_0x6eec('0x74')],'options':_0x42f8e1[_0x6eec('0x75')][_0x6eec('0x46')]>0x0?_[_0x6eec('0x2b')](_0x42f8e1['picklistValues'],function(_0x54ab14){return{'name':_0x54ab14[_0x6eec('0x76')],'value':_0x54ab14[_0x6eec('0x77')]};}):_0x42f8e1[_0x6eec('0x2d')]==_0x6eec('0x6f')?[{'name':'True','value':_0x6eec('0x78')},{'name':_0x6eec('0x79'),'value':_0x6eec('0x7a')}]:[]};})};}})[_0x6eec('0x27')](respondWithResult(_0x3ebc6c,null))[_0x6eec('0x49')](function(_0x3f5a1f){var _0x2c1f31=_0x994e8['query'][_0x6eec('0x7b')]?0x1f4:_0x3f5a1f[_0x6eec('0x7c')]||0x1f4;logger[_0x6eec('0x29')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x2c1f31,JSON['stringify'](_0x3f5a1f));delete _0x3f5a1f[_0x6eec('0x30')];if(_0x2c1f31===0x191){_0x2c1f31=0x190;}_0x3ebc6c[_0x6eec('0x1c')](_0x2c1f31)[_0x6eec('0x7d')](_0x994e8[_0x6eec('0x31')][_0x6eec('0x7b')]?{'message':_0x6eec('0x7e'),'statusCode':_0x3f5a1f[_0x6eec('0x7c')]}:_0x3f5a1f);});};
\ No newline at end of file
+var _0xc4d4=['../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','end','status','json','offset','undefined','count','limit','set','reject','update','destroy','sendStatus','error','name','send','model','map','keys','query','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','SalesforceAccount','then','includeAll','include','findAll','catch','show','params','rawAttributes','length','create','body','find','getConfigurations','findOne','SalesforceConfiguration','pick','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','password','slice','lastIndexOf','Connection','clientSecret','login','username','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','string','int','textarea','phone','remove','includes','label','custom','picklistValues','value','boolean','True','False','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x46ce21,_0x254327){var _0x4901ba=function(_0x528f1c){while(--_0x528f1c){_0x46ce21['push'](_0x46ce21['shift']());}};_0x4901ba(++_0x254327);}(_0xc4d4,0x1cc));var _0x4c4d=function(_0x50514b,_0x83db65){_0x50514b=_0x50514b-0x0;var _0x5d8587=_0xc4d4[_0x50514b];return _0x5d8587;};'use strict';var emlformat=require(_0x4c4d('0x0'));var rimraf=require(_0x4c4d('0x1'));var zipdir=require(_0x4c4d('0x2'));var jsonpatch=require(_0x4c4d('0x3'));var rp=require(_0x4c4d('0x4'));var moment=require('moment');var BPromise=require(_0x4c4d('0x5'));var Mustache=require('mustache');var util=require(_0x4c4d('0x6'));var path=require('path');var sox=require(_0x4c4d('0x7'));var csv=require(_0x4c4d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c4d('0x9'));var _=require(_0x4c4d('0xa'));var squel=require(_0x4c4d('0xb'));var crypto=require(_0x4c4d('0xc'));var jsforce=require(_0x4c4d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4c4d('0x8'));var querystring=require(_0x4c4d('0xe'));var Papa=require(_0x4c4d('0xf'));var Redis=require('ioredis');var authService=require(_0x4c4d('0x10'));var qs=require(_0x4c4d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4c4d('0x12'));var logger=require('../../config/logger')(_0x4c4d('0x13'));var utils=require(_0x4c4d('0x14'));var config=require(_0x4c4d('0x15'));var licenseUtil=require(_0x4c4d('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4c4d('0x17'));function respondWithStatusCode(_0x2b2601,_0x6d319a){_0x6d319a=_0x6d319a||0xcc;return function(_0x5200ae){if(_0x5200ae){return _0x2b2601['sendStatus'](_0x6d319a);}return _0x2b2601['status'](_0x6d319a)[_0x4c4d('0x18')]();};}function respondWithResult(_0x501af,_0x254fdd){_0x254fdd=_0x254fdd||0xc8;return function(_0x1b462a){if(_0x1b462a){return _0x501af[_0x4c4d('0x19')](_0x254fdd)[_0x4c4d('0x1a')](_0x1b462a);}};}function respondWithFilteredResult(_0x500a4d,_0x5c4ae0){return function(_0x416718){if(_0x416718){var _0x5a75f4=typeof _0x5c4ae0[_0x4c4d('0x1b')]===_0x4c4d('0x1c')&&typeof _0x5c4ae0['limit']===_0x4c4d('0x1c');var _0x369c2e=_0x416718['count'];var _0x5cec9d=_0x5a75f4?0x0:_0x5c4ae0[_0x4c4d('0x1b')];var _0x5a3d63=_0x5a75f4?_0x416718[_0x4c4d('0x1d')]:_0x5c4ae0[_0x4c4d('0x1b')]+_0x5c4ae0[_0x4c4d('0x1e')];var _0x183ce3;if(_0x5a3d63>=_0x369c2e){_0x5a3d63=_0x369c2e;_0x183ce3=0xc8;}else{_0x183ce3=0xce;}_0x500a4d[_0x4c4d('0x19')](_0x183ce3);return _0x500a4d[_0x4c4d('0x1f')]('Content-Range',_0x5cec9d+'-'+_0x5a3d63+'/'+_0x369c2e)['json'](_0x416718);}return null;};}function patchUpdates(_0x571095){return function(_0x4f9d29){try{jsonpatch['apply'](_0x4f9d29,_0x571095,!![]);}catch(_0x2f6261){return BPromise[_0x4c4d('0x20')](_0x2f6261);}return _0x4f9d29['save']();};}function saveUpdates(_0x33488d,_0x17ecf5){return function(_0x96e3f7){if(_0x96e3f7){return _0x96e3f7[_0x4c4d('0x21')](_0x33488d)['then'](function(_0x347c68){return _0x347c68;});}return null;};}function removeEntity(_0x5dcaaa,_0x53e3fd){return function(_0x4a3dd1){if(_0x4a3dd1){return _0x4a3dd1[_0x4c4d('0x22')]()['then'](function(){_0x5dcaaa[_0x4c4d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d8139,_0x2d9be6){return function(_0x34fb28){if(!_0x34fb28){_0x5d8139[_0x4c4d('0x23')](0x194);}return _0x34fb28;};}function handleError(_0x245eca,_0x2398c9){_0x2398c9=_0x2398c9||0x1f4;return function(_0x3ee0f7){logger[_0x4c4d('0x24')](_0x3ee0f7['stack']);if(_0x3ee0f7[_0x4c4d('0x25')]){delete _0x3ee0f7['name'];}_0x245eca[_0x4c4d('0x19')](_0x2398c9)[_0x4c4d('0x26')](_0x3ee0f7);};}exports['index']=function(_0x3dfac9,_0x58e191){var _0x1db2b0={},_0x3d56c4={},_0x2ca339={'count':0x0,'rows':[]};var _0x235987=_['map'](db['SalesforceAccount']['rawAttributes'],function(_0x49b0cf){return{'name':_0x49b0cf['fieldName'],'type':_0x49b0cf['type']['key']};});_0x3d56c4[_0x4c4d('0x27')]=_[_0x4c4d('0x28')](_0x235987,_0x4c4d('0x25'));_0x3d56c4['query']=_[_0x4c4d('0x29')](_0x3dfac9[_0x4c4d('0x2a')]);_0x3d56c4[_0x4c4d('0x2b')]=_[_0x4c4d('0x2c')](_0x3d56c4[_0x4c4d('0x27')],_0x3d56c4['query']);_0x1db2b0[_0x4c4d('0x2d')]=_[_0x4c4d('0x2c')](_0x3d56c4[_0x4c4d('0x27')],qs[_0x4c4d('0x2e')](_0x3dfac9[_0x4c4d('0x2a')][_0x4c4d('0x2e')]));_0x1db2b0[_0x4c4d('0x2d')]=_0x1db2b0[_0x4c4d('0x2d')]['length']?_0x1db2b0[_0x4c4d('0x2d')]:_0x3d56c4['model'];if(!_0x3dfac9['query']['hasOwnProperty'](_0x4c4d('0x2f'))){_0x1db2b0[_0x4c4d('0x1e')]=qs['limit'](_0x3dfac9['query']['limit']);_0x1db2b0['offset']=qs[_0x4c4d('0x1b')](_0x3dfac9[_0x4c4d('0x2a')][_0x4c4d('0x1b')]);}_0x1db2b0[_0x4c4d('0x30')]=qs[_0x4c4d('0x31')](_0x3dfac9[_0x4c4d('0x2a')][_0x4c4d('0x31')]);_0x1db2b0['where']=qs[_0x4c4d('0x2b')](_['pick'](_0x3dfac9['query'],_0x3d56c4[_0x4c4d('0x2b')]),_0x235987);if(_0x3dfac9[_0x4c4d('0x2a')][_0x4c4d('0x32')]){_0x1db2b0[_0x4c4d('0x33')]=_[_0x4c4d('0x34')](_0x1db2b0[_0x4c4d('0x33')],{'$or':_['map'](_0x235987,function(_0x502c1b){if(_0x502c1b[_0x4c4d('0x35')]!==_0x4c4d('0x36')){var _0x438a3f={};_0x438a3f[_0x502c1b[_0x4c4d('0x25')]]={'$like':'%'+_0x3dfac9[_0x4c4d('0x2a')]['filter']+'%'};return _0x438a3f;}})});}_0x1db2b0=_['merge']({},_0x1db2b0,_0x3dfac9[_0x4c4d('0x37')]);var _0x303572={'where':_0x1db2b0[_0x4c4d('0x33')]};return db[_0x4c4d('0x38')]['count'](_0x303572)[_0x4c4d('0x39')](function(_0x529697){_0x2ca339[_0x4c4d('0x1d')]=_0x529697;if(_0x3dfac9[_0x4c4d('0x2a')][_0x4c4d('0x3a')]){_0x1db2b0[_0x4c4d('0x3b')]=[{'all':!![]}];}return db[_0x4c4d('0x38')][_0x4c4d('0x3c')](_0x1db2b0);})[_0x4c4d('0x39')](function(_0x281c89){_0x2ca339['rows']=_0x281c89;return _0x2ca339;})['then'](respondWithFilteredResult(_0x58e191,_0x1db2b0))[_0x4c4d('0x3d')](handleError(_0x58e191,null));};exports[_0x4c4d('0x3e')]=function(_0x3d48f9,_0x1797a2){var _0x5d5600={'raw':![],'where':{'id':_0x3d48f9[_0x4c4d('0x3f')]['id']}},_0x8e52d7={};_0x8e52d7[_0x4c4d('0x27')]=_[_0x4c4d('0x29')](db[_0x4c4d('0x38')][_0x4c4d('0x40')]);_0x8e52d7['query']=_[_0x4c4d('0x29')](_0x3d48f9['query']);_0x8e52d7[_0x4c4d('0x2b')]=_[_0x4c4d('0x2c')](_0x8e52d7[_0x4c4d('0x27')],_0x8e52d7['query']);_0x5d5600[_0x4c4d('0x2d')]=_[_0x4c4d('0x2c')](_0x8e52d7[_0x4c4d('0x27')],qs[_0x4c4d('0x2e')](_0x3d48f9['query'][_0x4c4d('0x2e')]));_0x5d5600[_0x4c4d('0x2d')]=_0x5d5600['attributes'][_0x4c4d('0x41')]?_0x5d5600['attributes']:_0x8e52d7[_0x4c4d('0x27')];if(_0x3d48f9[_0x4c4d('0x2a')][_0x4c4d('0x3a')]){_0x5d5600[_0x4c4d('0x3b')]=[{'all':!![]}];}_0x5d5600=_[_0x4c4d('0x34')]({},_0x5d5600,_0x3d48f9[_0x4c4d('0x37')]);return db[_0x4c4d('0x38')]['find'](_0x5d5600)['then'](handleEntityNotFound(_0x1797a2,null))['then'](respondWithResult(_0x1797a2,null))[_0x4c4d('0x3d')](handleError(_0x1797a2,null));};exports[_0x4c4d('0x42')]=function(_0x2457ab,_0x31a1a1){return db[_0x4c4d('0x38')][_0x4c4d('0x42')](_0x2457ab[_0x4c4d('0x43')],{})[_0x4c4d('0x39')](respondWithResult(_0x31a1a1,0xc9))['catch'](handleError(_0x31a1a1,null));};exports[_0x4c4d('0x21')]=function(_0x58a55b,_0x5bfd7b){if(_0x58a55b[_0x4c4d('0x43')]['id']){delete _0x58a55b[_0x4c4d('0x43')]['id'];}return db[_0x4c4d('0x38')][_0x4c4d('0x44')]({'where':{'id':_0x58a55b[_0x4c4d('0x3f')]['id']}})[_0x4c4d('0x39')](handleEntityNotFound(_0x5bfd7b,null))[_0x4c4d('0x39')](saveUpdates(_0x58a55b['body'],null))[_0x4c4d('0x39')](respondWithResult(_0x5bfd7b,null))[_0x4c4d('0x3d')](handleError(_0x5bfd7b,null));};exports[_0x4c4d('0x22')]=function(_0xc4eec7,_0x36abb3){return db['SalesforceAccount'][_0x4c4d('0x44')]({'where':{'id':_0xc4eec7['params']['id']}})[_0x4c4d('0x39')](handleEntityNotFound(_0x36abb3,null))[_0x4c4d('0x39')](removeEntity(_0x36abb3,null))[_0x4c4d('0x3d')](handleError(_0x36abb3,null));};exports[_0x4c4d('0x45')]=function(_0x2a35d1,_0x3ecfdf,_0x1f16f0){var _0x296780={};var _0x507a22={};var _0x384ea4;var _0x1957de;return db[_0x4c4d('0x38')][_0x4c4d('0x46')]({'where':{'id':_0x2a35d1[_0x4c4d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3ecfdf,null))['then'](function(_0x42a27c){if(_0x42a27c){_0x384ea4=_0x42a27c;_0x507a22['model']=_[_0x4c4d('0x29')](db[_0x4c4d('0x47')][_0x4c4d('0x40')]);_0x507a22[_0x4c4d('0x2a')]=_[_0x4c4d('0x29')](_0x2a35d1[_0x4c4d('0x2a')]);_0x507a22[_0x4c4d('0x2b')]=_['intersection'](_0x507a22[_0x4c4d('0x27')],_0x507a22[_0x4c4d('0x2a')]);_0x296780[_0x4c4d('0x2d')]=_[_0x4c4d('0x2c')](_0x507a22['model'],qs[_0x4c4d('0x2e')](_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x2e')]));_0x296780[_0x4c4d('0x2d')]=_0x296780[_0x4c4d('0x2d')][_0x4c4d('0x41')]?_0x296780[_0x4c4d('0x2d')]:_0x507a22[_0x4c4d('0x27')];_0x296780[_0x4c4d('0x30')]=qs['sort'](_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x31')]);_0x296780[_0x4c4d('0x33')]=qs[_0x4c4d('0x2b')](_[_0x4c4d('0x48')](_0x2a35d1[_0x4c4d('0x2a')],_0x507a22[_0x4c4d('0x2b')]));if(_0x2a35d1['query']['filter']){_0x296780[_0x4c4d('0x33')]=_[_0x4c4d('0x34')](_0x296780['where'],{'$or':_[_0x4c4d('0x28')](_0x296780[_0x4c4d('0x2d')],function(_0x426084){var _0x57d15b={};_0x57d15b[_0x426084]={'$like':'%'+_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x32')]+'%'};return _0x57d15b;})});}_0x296780=_[_0x4c4d('0x34')]({},_0x296780,_0x2a35d1[_0x4c4d('0x37')]);return _0x384ea4[_0x4c4d('0x45')](_0x296780);}})[_0x4c4d('0x39')](function(_0x400ca9){if(_0x400ca9){_0x1957de=_0x400ca9[_0x4c4d('0x41')];if(!_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x49')](_0x4c4d('0x2f'))){_0x296780[_0x4c4d('0x1e')]=qs[_0x4c4d('0x1e')](_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x1e')]);_0x296780[_0x4c4d('0x1b')]=qs['offset'](_0x2a35d1[_0x4c4d('0x2a')][_0x4c4d('0x1b')]);}return _0x384ea4[_0x4c4d('0x45')](_0x296780);}})[_0x4c4d('0x39')](function(_0x5c0320){if(_0x5c0320){return _0x5c0320?{'count':_0x1957de,'rows':_0x5c0320}:null;}})[_0x4c4d('0x39')](respondWithResult(_0x3ecfdf,null))['catch'](handleError(_0x3ecfdf,null));};exports[_0x4c4d('0x4a')]=function(_0x26f55e,_0x224c2a,_0x304915){if(_0x26f55e[_0x4c4d('0x43')]['id']){delete _0x26f55e[_0x4c4d('0x43')]['id'];}return db[_0x4c4d('0x38')][_0x4c4d('0x46')]({'where':{'id':_0x26f55e[_0x4c4d('0x3f')]['id']}})[_0x4c4d('0x39')](handleEntityNotFound(_0x224c2a,null))[_0x4c4d('0x39')](function(_0x4df04e){if(_0x4df04e){_0x26f55e[_0x4c4d('0x43')][_0x4c4d('0x4b')]=_0x4df04e['id'];_0x26f55e['body']['Subjects']=integrations[_0x4c4d('0x4c')](_0x26f55e[_0x4c4d('0x43')][_0x4c4d('0x4d')],_0x26f55e[_0x4c4d('0x43')][_0x4c4d('0x35')]);_0x26f55e[_0x4c4d('0x43')]['Descriptions']=integrations['getDescriptions'](_0x26f55e['body']['channel'],_0x26f55e[_0x4c4d('0x43')][_0x4c4d('0x35')]);return db['SalesforceConfiguration']['create'](_0x26f55e[_0x4c4d('0x43')],{'include':[{'model':db[_0x4c4d('0x4e')],'as':'Subjects'},{'model':db[_0x4c4d('0x4e')],'as':_0x4c4d('0x4f')}]});}return null;})[_0x4c4d('0x39')](respondWithResult(_0x224c2a,null))[_0x4c4d('0x3d')](handleError(_0x224c2a,null));};exports[_0x4c4d('0x50')]=function(_0x465f2e,_0x3298d1,_0x38f0d6){var _0x5a3833;var _0x366923='';var _0x105246=_0x4c4d('0x51');return db['SalesforceAccount'][_0x4c4d('0x46')]({'where':{'id':_0x465f2e[_0x4c4d('0x3f')]['id']},'attributes':['id',_0x4c4d('0x52'),_0x4c4d('0x53'),'clientSecret','username',_0x4c4d('0x54'),'securityToken']})[_0x4c4d('0x39')](handleEntityNotFound(_0x3298d1,null))[_0x4c4d('0x39')](function(_0x2eeeee){if(_0x2eeeee){_0x366923=_0x2eeeee['remoteUri'];var _0x2ff0cd=_0x366923[_0x4c4d('0x55')](-0x1);if(_0x2ff0cd==='/'){_0x366923=_0x366923['substring'](0x0,_0x366923[_0x4c4d('0x56')](_0x2ff0cd));}_0x5a3833=new jsforce[(_0x4c4d('0x57'))]({'oauth2':{'loginUrl':_0x366923,'clientId':_0x2eeeee[_0x4c4d('0x53')],'clientSecret':_0x2eeeee[_0x4c4d('0x58')]}});return _0x5a3833[_0x4c4d('0x59')](_0x2eeeee[_0x4c4d('0x5a')],_0x2eeeee[_0x4c4d('0x54')][_0x4c4d('0x5b')](_0x2eeeee['securityToken']));}})[_0x4c4d('0x39')](function(_0x137b01){if(_0x137b01){if(!_[_0x4c4d('0x5c')](_0x465f2e['query'][_0x4c4d('0x5d')])){_0x105246=_0x465f2e[_0x4c4d('0x2a')][_0x4c4d('0x5d')];}return _0x5a3833[_0x4c4d('0x5e')](_0x105246)[_0x4c4d('0x5f')]();}})[_0x4c4d('0x39')](function(_0x5b0d28){var _0x10a69a=[_0x4c4d('0x60'),_0x4c4d('0x61'),'IsReminderSet',_0x4c4d('0x62'),_0x4c4d('0x63'),_0x4c4d('0x64')];var _0x4cf068=[_0x4c4d('0x65'),_0x4c4d('0x66'),'picklist','boolean','email',_0x4c4d('0x67'),_0x4c4d('0x68')];if(_0x5b0d28){_[_0x4c4d('0x69')](_0x5b0d28[_0x4c4d('0x2e')],function(_0x49acc3){return _0x10a69a[_0x4c4d('0x6a')](_0x49acc3['name'])||!_0x4cf068[_0x4c4d('0x6a')](_0x49acc3['type']);});return{'count':_0x5b0d28[_0x4c4d('0x2e')][_0x4c4d('0x41')],'rows':_['map'](_0x5b0d28[_0x4c4d('0x2e')],function(_0xbc7fda){return{'id':_0xbc7fda[_0x4c4d('0x25')],'name':_0xbc7fda[_0x4c4d('0x6b')],'custom':_0xbc7fda[_0x4c4d('0x6c')],'options':_0xbc7fda[_0x4c4d('0x6d')][_0x4c4d('0x41')]>0x0?_[_0x4c4d('0x28')](_0xbc7fda[_0x4c4d('0x6d')],function(_0x246c07){return{'name':_0x246c07['label'],'value':_0x246c07[_0x4c4d('0x6e')]};}):_0xbc7fda[_0x4c4d('0x35')]==_0x4c4d('0x6f')?[{'name':_0x4c4d('0x70'),'value':'true'},{'name':_0x4c4d('0x71'),'value':_0x4c4d('0x72')}]:[]};})};}})[_0x4c4d('0x39')](respondWithResult(_0x3298d1,null))[_0x4c4d('0x3d')](function(_0x302941){var _0x57b222=_0x465f2e[_0x4c4d('0x2a')][_0x4c4d('0x73')]?0x1f4:_0x302941['statusCode']||0x1f4;logger[_0x4c4d('0x24')](_0x4c4d('0x74'),_0x4c4d('0x50'),_0x57b222,JSON[_0x4c4d('0x75')](_0x302941));delete _0x302941[_0x4c4d('0x25')];if(_0x57b222===0x191){_0x57b222=0x190;}_0x3298d1[_0x4c4d('0x19')](_0x57b222)['send'](_0x465f2e['query'][_0x4c4d('0x73')]?{'message':_0x4c4d('0x76'),'statusCode':_0x302941[_0x4c4d('0x77')]}:_0x302941);});};
\ No newline at end of file
index e1c9878..6826e04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7024=['int_salesforce_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','SalesforceAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7024,0x139));var _0x4702=function(_0x375af2,_0x420b79){_0x375af2=_0x375af2-0x0;var _0xf870d1=_0x7024[_0x375af2];return _0xf870d1;};'use strict';var _=require(_0x4702('0x0'));var util=require(_0x4702('0x1'));var logger=require(_0x4702('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4702('0x3'));var rp=require(_0x4702('0x4'));var fs=require('fs');var path=require(_0x4702('0x5'));var rimraf=require(_0x4702('0x6'));var config=require(_0x4702('0x7'));var attributes=require(_0x4702('0x8'));var integrations=require(_0x4702('0x9'));module[_0x4702('0xa')]=function(_0x56b83b,_0x44e9c7){return _0x56b83b['define'](_0x4702('0xb'),attributes,{'tableName':_0x4702('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0178=['rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','api','moment','bluebird','request-promise','path'];(function(_0x3ba38b,_0x39c0be){var _0x574206=function(_0x138d19){while(--_0x138d19){_0x3ba38b['push'](_0x3ba38b['shift']());}};_0x574206(++_0x39c0be);}(_0x0178,0x1e6));var _0x8017=function(_0x5133a0,_0x2289a0){_0x5133a0=_0x5133a0-0x0;var _0x1f6247=_0x0178[_0x5133a0];return _0x1f6247;};'use strict';var _=require(_0x8017('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8017('0x1'));var moment=require(_0x8017('0x2'));var BPromise=require(_0x8017('0x3'));var rp=require(_0x8017('0x4'));var fs=require('fs');var path=require(_0x8017('0x5'));var rimraf=require(_0x8017('0x6'));var config=require('../../config/environment');var attributes=require(_0x8017('0x7'));var integrations=require(_0x8017('0x8'));module['exports']=function(_0x4ff3f7,_0x5dab34){return _0x4ff3f7[_0x8017('0x9')](_0x8017('0xa'),attributes,{'tableName':_0x8017('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index df827f5..edbfa34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3d6=['info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','include','map','model','raw','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x4b4682,_0x49e412){var _0x17c6c6=function(_0xe4bfa7){while(--_0xe4bfa7){_0x4b4682['push'](_0x4b4682['shift']());}};_0x17c6c6(++_0x49e412);}(_0xd3d6,0x1c6));var _0x6d3d=function(_0x29de90,_0xe11f07){_0x29de90=_0x29de90-0x0;var _0x1bbb17=_0xd3d6[_0x29de90];return _0x1bbb17;};'use strict';var _=require(_0x6d3d('0x0'));var util=require(_0x6d3d('0x1'));var moment=require(_0x6d3d('0x2'));var BPromise=require(_0x6d3d('0x3'));var rs=require(_0x6d3d('0x4'));var fs=require('fs');var Redis=require(_0x6d3d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d3d('0x6'));var logger=require(_0x6d3d('0x7'))(_0x6d3d('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d3d('0x9'));var client=jayson[_0x6d3d('0xa')][_0x6d3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x87f167,_0x46b45a,_0x1ffa10){return new BPromise(function(_0x4b1c5e,_0x5d06bb){return client[_0x6d3d('0xc')](_0x87f167,_0x1ffa10)[_0x6d3d('0xd')](function(_0x1498ca){logger[_0x6d3d('0xe')](_0x6d3d('0xf'),_0x46b45a,_0x6d3d('0x10'));logger[_0x6d3d('0x11')](_0x6d3d('0x12'),_0x46b45a,_0x6d3d('0x10'),JSON[_0x6d3d('0x13')](_0x1498ca));if(_0x1498ca[_0x6d3d('0x14')]){if(_0x1498ca[_0x6d3d('0x14')][_0x6d3d('0x15')]===0x1f4){logger['error'](_0x6d3d('0xf'),_0x46b45a,_0x1498ca[_0x6d3d('0x14')][_0x6d3d('0x16')]);return _0x5d06bb(_0x1498ca['error']['message']);}logger[_0x6d3d('0x14')](_0x6d3d('0xf'),_0x46b45a,_0x1498ca[_0x6d3d('0x14')][_0x6d3d('0x16')]);return _0x4b1c5e(_0x1498ca['error'][_0x6d3d('0x16')]);}else{logger[_0x6d3d('0xe')](_0x6d3d('0xf'),_0x46b45a,_0x6d3d('0x10'));_0x4b1c5e(_0x1498ca[_0x6d3d('0x17')][_0x6d3d('0x16')]);}})[_0x6d3d('0x18')](function(_0x3e8d5e){logger[_0x6d3d('0x14')](_0x6d3d('0xf'),_0x46b45a,_0x3e8d5e);_0x5d06bb(_0x3e8d5e);});});}exports[_0x6d3d('0x19')]=function(_0xcf426e){var _0x13bd90=this;return new Promise(function(_0x3df7c8,_0x5925a1){return db[_0x6d3d('0x1a')][_0x6d3d('0x1b')]({'raw':_0xcf426e[_0x6d3d('0x1c')]?_0xcf426e['options']['raw']===undefined?!![]:![]:!![],'where':_0xcf426e[_0x6d3d('0x1c')]?_0xcf426e[_0x6d3d('0x1c')][_0x6d3d('0x1d')]||null:null,'attributes':_0xcf426e[_0x6d3d('0x1c')]?_0xcf426e['options'][_0x6d3d('0x1e')]||null:null,'limit':_0xcf426e[_0x6d3d('0x1c')]?_0xcf426e[_0x6d3d('0x1c')]['limit']||null:null,'include':_0xcf426e[_0x6d3d('0x1c')]?_0xcf426e['options'][_0x6d3d('0x1f')]?_[_0x6d3d('0x20')](_0xcf426e[_0x6d3d('0x1c')][_0x6d3d('0x1f')],function(_0x3e3796){return{'model':db[_0x3e3796[_0x6d3d('0x21')]],'as':_0x3e3796['as'],'attributes':_0x3e3796['attributes'],'include':_0x3e3796[_0x6d3d('0x1f')]?_[_0x6d3d('0x20')](_0x3e3796[_0x6d3d('0x1f')],function(_0x4c5168){return{'model':db[_0x4c5168['model']],'as':_0x4c5168['as'],'attributes':_0x4c5168[_0x6d3d('0x1e')],'include':_0x4c5168['include']?_[_0x6d3d('0x20')](_0x4c5168[_0x6d3d('0x1f')],function(_0xf06a58){return{'model':db[_0xf06a58['model']],'as':_0xf06a58['as'],'attributes':_0xf06a58[_0x6d3d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6d3d('0xd')](function(_0x4237d6){logger[_0x6d3d('0xe')](_0x6d3d('0x19'),_0xcf426e);logger[_0x6d3d('0x11')]('GetSalesforceAccount',_0xcf426e,JSON[_0x6d3d('0x13')](_0x4237d6));_0x3df7c8(_0x4237d6);})['catch'](function(_0x45515c){logger[_0x6d3d('0x14')](_0x6d3d('0x19'),_0x45515c[_0x6d3d('0x16')],_0xcf426e);_0x5925a1(_0x13bd90[_0x6d3d('0x14')](0x1f4,_0x45515c[_0x6d3d('0x16')]));});});};exports['ShowSalesforceAccount']=function(_0x505727){var _0x7046bf=this;return new Promise(function(_0x271596,_0x51e5e8){return db[_0x6d3d('0x1a')]['find']({'raw':_0x505727[_0x6d3d('0x1c')]?_0x505727[_0x6d3d('0x1c')][_0x6d3d('0x22')]===undefined?!![]:![]:!![],'where':_0x505727[_0x6d3d('0x1c')]?_0x505727['options'][_0x6d3d('0x1d')]||null:null,'attributes':_0x505727[_0x6d3d('0x1c')]?_0x505727[_0x6d3d('0x1c')][_0x6d3d('0x1e')]||null:null,'include':_0x505727[_0x6d3d('0x1c')]?_0x505727['options'][_0x6d3d('0x1f')]?_[_0x6d3d('0x20')](_0x505727['options'][_0x6d3d('0x1f')],function(_0x7aa572){return{'model':db[_0x7aa572[_0x6d3d('0x21')]],'as':_0x7aa572['as'],'attributes':_0x7aa572[_0x6d3d('0x1e')],'include':_0x7aa572[_0x6d3d('0x1f')]?_['map'](_0x7aa572[_0x6d3d('0x1f')],function(_0x3a285d){return{'model':db[_0x3a285d[_0x6d3d('0x21')]],'as':_0x3a285d['as'],'attributes':_0x3a285d[_0x6d3d('0x1e')],'include':_0x3a285d[_0x6d3d('0x1f')]?_['map'](_0x3a285d['include'],function(_0x50ab12){return{'model':db[_0x50ab12[_0x6d3d('0x21')]],'as':_0x50ab12['as'],'attributes':_0x50ab12[_0x6d3d('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6d3d('0xd')](function(_0x292045){logger['info'](_0x6d3d('0x23'),_0x505727);logger[_0x6d3d('0x11')]('ShowSalesforceAccount',_0x505727,JSON[_0x6d3d('0x13')](_0x292045));_0x271596(_0x292045);})['catch'](function(_0x503ce4){logger[_0x6d3d('0x14')]('ShowSalesforceAccount',_0x503ce4[_0x6d3d('0x16')],_0x505727);_0x51e5e8(_0x7046bf[_0x6d3d('0x14')](0x1f4,_0x503ce4[_0x6d3d('0x16')]));});});};
\ No newline at end of file
+var _0x9953=['http','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSalesforceAccount','SalesforceAccount','findAll','raw','where','attributes','options','limit','include','model','map','then','catch','ShowSalesforceAccount','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2a1575,_0x50a230){var _0x5a1b4c=function(_0x2da545){while(--_0x2da545){_0x2a1575['push'](_0x2a1575['shift']());}};_0x5a1b4c(++_0x50a230);}(_0x9953,0x1d7));var _0x3995=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0x9953[_0x81dcac];return _0xc7803b;};'use strict';var _=require('lodash');var util=require(_0x3995('0x0'));var moment=require(_0x3995('0x1'));var BPromise=require(_0x3995('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3995('0x3'));var db=require(_0x3995('0x4'))['db'];var utils=require(_0x3995('0x5'));var logger=require(_0x3995('0x6'))(_0x3995('0x7'));var config=require(_0x3995('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3995('0x9')][_0x3995('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x224056,_0x9ecd5b,_0x3cafcf){return new BPromise(function(_0x23c0f7,_0x473f1d){return client[_0x3995('0xb')](_0x224056,_0x3cafcf)['then'](function(_0x3b5854){logger[_0x3995('0xc')](_0x3995('0xd'),_0x9ecd5b,_0x3995('0xe'));logger[_0x3995('0xf')](_0x3995('0x10'),_0x9ecd5b,_0x3995('0xe'),JSON[_0x3995('0x11')](_0x3b5854));if(_0x3b5854[_0x3995('0x12')]){if(_0x3b5854[_0x3995('0x12')][_0x3995('0x13')]===0x1f4){logger[_0x3995('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x9ecd5b,_0x3b5854['error'][_0x3995('0x14')]);return _0x473f1d(_0x3b5854[_0x3995('0x12')][_0x3995('0x14')]);}logger[_0x3995('0x12')]('SalesforceAccount,\x20%s,\x20%s',_0x9ecd5b,_0x3b5854[_0x3995('0x12')][_0x3995('0x14')]);return _0x23c0f7(_0x3b5854['error']['message']);}else{logger[_0x3995('0xc')](_0x3995('0xd'),_0x9ecd5b,'request\x20sent');_0x23c0f7(_0x3b5854[_0x3995('0x15')]['message']);}})['catch'](function(_0xebc4fc){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x9ecd5b,_0xebc4fc);_0x473f1d(_0xebc4fc);});});}exports[_0x3995('0x16')]=function(_0x7708d3){var _0x1e5c3b=this;return new Promise(function(_0x3ab1d9,_0x5ae951){return db[_0x3995('0x17')][_0x3995('0x18')]({'raw':_0x7708d3['options']?_0x7708d3['options'][_0x3995('0x19')]===undefined?!![]:![]:!![],'where':_0x7708d3['options']?_0x7708d3['options'][_0x3995('0x1a')]||null:null,'attributes':_0x7708d3['options']?_0x7708d3['options'][_0x3995('0x1b')]||null:null,'limit':_0x7708d3[_0x3995('0x1c')]?_0x7708d3['options'][_0x3995('0x1d')]||null:null,'include':_0x7708d3[_0x3995('0x1c')]?_0x7708d3[_0x3995('0x1c')][_0x3995('0x1e')]?_['map'](_0x7708d3['options']['include'],function(_0x4e0827){return{'model':db[_0x4e0827[_0x3995('0x1f')]],'as':_0x4e0827['as'],'attributes':_0x4e0827[_0x3995('0x1b')],'include':_0x4e0827[_0x3995('0x1e')]?_['map'](_0x4e0827[_0x3995('0x1e')],function(_0x38379c){return{'model':db[_0x38379c[_0x3995('0x1f')]],'as':_0x38379c['as'],'attributes':_0x38379c[_0x3995('0x1b')],'include':_0x38379c[_0x3995('0x1e')]?_[_0x3995('0x20')](_0x38379c['include'],function(_0x185289){return{'model':db[_0x185289[_0x3995('0x1f')]],'as':_0x185289['as'],'attributes':_0x185289[_0x3995('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3995('0x21')](function(_0x28efd8){logger[_0x3995('0xc')]('GetSalesforceAccount',_0x7708d3);logger[_0x3995('0xf')](_0x3995('0x16'),_0x7708d3,JSON[_0x3995('0x11')](_0x28efd8));_0x3ab1d9(_0x28efd8);})[_0x3995('0x22')](function(_0x1c0592){logger['error'](_0x3995('0x16'),_0x1c0592[_0x3995('0x14')],_0x7708d3);_0x5ae951(_0x1e5c3b[_0x3995('0x12')](0x1f4,_0x1c0592[_0x3995('0x14')]));});});};exports[_0x3995('0x23')]=function(_0x20004a){var _0xc332c5=this;return new Promise(function(_0x303312,_0x306f7c){return db[_0x3995('0x17')][_0x3995('0x24')]({'raw':_0x20004a[_0x3995('0x1c')]?_0x20004a[_0x3995('0x1c')][_0x3995('0x19')]===undefined?!![]:![]:!![],'where':_0x20004a[_0x3995('0x1c')]?_0x20004a[_0x3995('0x1c')]['where']||null:null,'attributes':_0x20004a['options']?_0x20004a[_0x3995('0x1c')][_0x3995('0x1b')]||null:null,'include':_0x20004a[_0x3995('0x1c')]?_0x20004a['options'][_0x3995('0x1e')]?_[_0x3995('0x20')](_0x20004a[_0x3995('0x1c')][_0x3995('0x1e')],function(_0x16fece){return{'model':db[_0x16fece[_0x3995('0x1f')]],'as':_0x16fece['as'],'attributes':_0x16fece[_0x3995('0x1b')],'include':_0x16fece[_0x3995('0x1e')]?_[_0x3995('0x20')](_0x16fece[_0x3995('0x1e')],function(_0x376b89){return{'model':db[_0x376b89['model']],'as':_0x376b89['as'],'attributes':_0x376b89[_0x3995('0x1b')],'include':_0x376b89[_0x3995('0x1e')]?_[_0x3995('0x20')](_0x376b89[_0x3995('0x1e')],function(_0x4490f2){return{'model':db[_0x4490f2[_0x3995('0x1f')]],'as':_0x4490f2['as'],'attributes':_0x4490f2[_0x3995('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3995('0x21')](function(_0x2438a6){logger[_0x3995('0xc')](_0x3995('0x23'),_0x20004a);logger[_0x3995('0xf')](_0x3995('0x23'),_0x20004a,JSON['stringify'](_0x2438a6));_0x303312(_0x2438a6);})[_0x3995('0x22')](function(_0x3116bc){logger['error'](_0x3995('0x23'),_0x3116bc['message'],_0x20004a);_0x306f7c(_0xc332c5[_0x3995('0x12')](0x1f4,_0x3116bc[_0x3995('0x14')]));});});};
\ No newline at end of file
index 7992b7a..f6e05dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x6adbd6,_0x4379ae){var _0x4dd96c=function(_0x1073c8){while(--_0x1073c8){_0x6adbd6['push'](_0x6adbd6['shift']());}};_0x4dd96c(++_0x4379ae);}(_0xadb5,0xad));var _0x5adb=function(_0x2f6497,_0x3f0801){_0x2f6497=_0x2f6497-0x0;var _0x4d7c97=_0xadb5[_0x2f6497];return _0x4d7c97;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router;
\ No newline at end of file
+var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x43f34e,_0x90a749){var _0x93eac8=function(_0x319e57){while(--_0x319e57){_0x43f34e['push'](_0x43f34e['shift']());}};_0x93eac8(++_0x90a749);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router;
\ No newline at end of file
index ddd97f1..26a04f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71f6=['contact_lead','contact','lead','account_contact_lead','nothing','exports','STRING','ENUM','Task'];(function(_0x471f10,_0x31df6a){var _0xcf9c2c=function(_0x816ed5){while(--_0x816ed5){_0x471f10['push'](_0x471f10['shift']());}};_0xcf9c2c(++_0x31df6a);}(_0x71f6,0x1ac));var _0x671f=function(_0x28f29e,_0x34e49a){_0x28f29e=_0x28f29e-0x0;var _0x337dd1=_0x71f6[_0x28f29e];return _0x337dd1;};'use strict';var Sequelize=require('sequelize');module[_0x671f('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x671f('0x1')]},'ticketType':{'type':Sequelize[_0x671f('0x2')](_0x671f('0x3'),'Case'),'defaultValue':_0x671f('0x3')},'moduleSearch':{'type':Sequelize[_0x671f('0x2')](_0x671f('0x4'),_0x671f('0x5'),_0x671f('0x6'),_0x671f('0x7'),'account'),'defaultValue':_0x671f('0x4')},'moduleCreate':{'type':Sequelize[_0x671f('0x2')](_0x671f('0x8'),_0x671f('0x5'),_0x671f('0x6'),'account'),'defaultValue':_0x671f('0x6')},'leadId':{'type':Sequelize[_0x671f('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x671f('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x671f('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x671f('0x1')]}};
\ No newline at end of file
+var _0xa57f=['account','contact','exports','STRING','Case','Task','ENUM','contact_lead','lead'];(function(_0x4eb156,_0x4fb47a){var _0x5dc502=function(_0x1899d8){while(--_0x1899d8){_0x4eb156['push'](_0x4eb156['shift']());}};_0x5dc502(++_0x4fb47a);}(_0xa57f,0x77));var _0xfa57=function(_0xa2e43d,_0x3d08aa){_0xa2e43d=_0xa2e43d-0x0;var _0x13fe43=_0xa57f[_0xa2e43d];return _0x13fe43;};'use strict';var Sequelize=require('sequelize');module[_0xfa57('0x0')]={'name':{'type':Sequelize[_0xfa57('0x1')]},'description':{'type':Sequelize[_0xfa57('0x1')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0xfa57('0x2')),'defaultValue':_0xfa57('0x3')},'moduleSearch':{'type':Sequelize[_0xfa57('0x4')](_0xfa57('0x5'),'contact',_0xfa57('0x6'),'account_contact_lead',_0xfa57('0x7')),'defaultValue':_0xfa57('0x5')},'moduleCreate':{'type':Sequelize[_0xfa57('0x4')]('nothing',_0xfa57('0x8'),_0xfa57('0x6'),'account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xfa57('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0xfa57('0x1')]},'additionalSearchContact':{'type':Sequelize[_0xfa57('0x1')]},'additionalSearchLead':{'type':Sequelize[_0xfa57('0x1')]}};
\ No newline at end of file
index ccc4a75..18e8ec8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2ac=['lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','length','find','create','body','params','getFields','findOne','SalesforceField','nolimit','getSubjects','order','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x40728f,_0x2db420){var _0x22ea49=function(_0x4f6d4a){while(--_0x4f6d4a){_0x40728f['push'](_0x40728f['shift']());}};_0x22ea49(++_0x2db420);}(_0xf2ac,0x91));var _0xcf2a=function(_0x18dbcc,_0x59877d){_0x18dbcc=_0x18dbcc-0x0;var _0x4c5524=_0xf2ac[_0x18dbcc];return _0x4c5524;};'use strict';var emlformat=require(_0xcf2a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xcf2a('0x1'));var rp=require('request-promise');var moment=require(_0xcf2a('0x2'));var BPromise=require(_0xcf2a('0x3'));var Mustache=require(_0xcf2a('0x4'));var util=require('util');var path=require(_0xcf2a('0x5'));var sox=require(_0xcf2a('0x6'));var csv=require(_0xcf2a('0x7'));var ejs=require(_0xcf2a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf2a('0x9'));var squel=require(_0xcf2a('0xa'));var crypto=require(_0xcf2a('0xb'));var jsforce=require(_0xcf2a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcf2a('0x7'));var querystring=require(_0xcf2a('0xd'));var Papa=require(_0xcf2a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcf2a('0xf'));var as=require(_0xcf2a('0x10'));var hardwareService=require(_0xcf2a('0x11'));var logger=require(_0xcf2a('0x12'))('api');var utils=require(_0xcf2a('0x13'));var config=require(_0xcf2a('0x14'));var licenseUtil=require(_0xcf2a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ac6dc,_0x197cae){_0x197cae=_0x197cae||0xcc;return function(_0x35b102){if(_0x35b102){return _0x1ac6dc['sendStatus'](_0x197cae);}return _0x1ac6dc[_0xcf2a('0x16')](_0x197cae)[_0xcf2a('0x17')]();};}function respondWithResult(_0x2ef504,_0x8a4d88){_0x8a4d88=_0x8a4d88||0xc8;return function(_0x50073f){if(_0x50073f){return _0x2ef504[_0xcf2a('0x16')](_0x8a4d88)['json'](_0x50073f);}};}function respondWithFilteredResult(_0x5bda11,_0x26590a){return function(_0x1b95bb){if(_0x1b95bb){var _0x19b68d=typeof _0x26590a[_0xcf2a('0x18')]===_0xcf2a('0x19')&&typeof _0x26590a[_0xcf2a('0x1a')]==='undefined';var _0x13b210=_0x1b95bb[_0xcf2a('0x1b')];var _0x2b4bf9=_0x19b68d?0x0:_0x26590a['offset'];var _0x2d13f5=_0x19b68d?_0x1b95bb['count']:_0x26590a[_0xcf2a('0x18')]+_0x26590a[_0xcf2a('0x1a')];var _0x46ac39;if(_0x2d13f5>=_0x13b210){_0x2d13f5=_0x13b210;_0x46ac39=0xc8;}else{_0x46ac39=0xce;}_0x5bda11[_0xcf2a('0x16')](_0x46ac39);return _0x5bda11[_0xcf2a('0x1c')](_0xcf2a('0x1d'),_0x2b4bf9+'-'+_0x2d13f5+'/'+_0x13b210)[_0xcf2a('0x1e')](_0x1b95bb);}return null;};}function patchUpdates(_0x45d3c4){return function(_0x2f8c66){try{jsonpatch[_0xcf2a('0x1f')](_0x2f8c66,_0x45d3c4,!![]);}catch(_0x566f0e){return BPromise[_0xcf2a('0x20')](_0x566f0e);}return _0x2f8c66[_0xcf2a('0x21')]();};}function saveUpdates(_0x1a3bf4,_0x390408){return function(_0x5d0305){if(_0x5d0305){return _0x5d0305['update'](_0x1a3bf4)[_0xcf2a('0x22')](function(_0x47a5c5){return _0x47a5c5;});}return null;};}function removeEntity(_0x1c62e9,_0x4cc4c9){return function(_0x42736b){if(_0x42736b){return _0x42736b[_0xcf2a('0x23')]()[_0xcf2a('0x22')](function(){_0x1c62e9[_0xcf2a('0x16')](0xcc)[_0xcf2a('0x17')]();});}};}function handleEntityNotFound(_0x356dac,_0x72f2c7){return function(_0xca8cc6){if(!_0xca8cc6){_0x356dac['sendStatus'](0x194);}return _0xca8cc6;};}function handleError(_0x2dbcc6,_0x58ba3e){_0x58ba3e=_0x58ba3e||0x1f4;return function(_0x4dad5a){logger[_0xcf2a('0x24')](_0x4dad5a[_0xcf2a('0x25')]);if(_0x4dad5a[_0xcf2a('0x26')]){delete _0x4dad5a[_0xcf2a('0x26')];}_0x2dbcc6[_0xcf2a('0x16')](_0x58ba3e)[_0xcf2a('0x27')](_0x4dad5a);};}exports[_0xcf2a('0x28')]=function(_0x11f4e3,_0x2eb7fe){var _0x54ba73={},_0xd43295={},_0x3fb9db={'count':0x0,'rows':[]};var _0x521ae9=_[_0xcf2a('0x29')](db[_0xcf2a('0x2a')][_0xcf2a('0x2b')],function(_0x38597d){return{'name':_0x38597d[_0xcf2a('0x2c')],'type':_0x38597d['type'][_0xcf2a('0x2d')]};});_0xd43295[_0xcf2a('0x2e')]=_[_0xcf2a('0x29')](_0x521ae9,_0xcf2a('0x26'));_0xd43295['query']=_[_0xcf2a('0x2f')](_0x11f4e3[_0xcf2a('0x30')]);_0xd43295[_0xcf2a('0x31')]=_[_0xcf2a('0x32')](_0xd43295['model'],_0xd43295[_0xcf2a('0x30')]);_0x54ba73[_0xcf2a('0x33')]=_['intersection'](_0xd43295[_0xcf2a('0x2e')],qs[_0xcf2a('0x34')](_0x11f4e3[_0xcf2a('0x30')][_0xcf2a('0x34')]));_0x54ba73[_0xcf2a('0x33')]=_0x54ba73[_0xcf2a('0x33')]['length']?_0x54ba73['attributes']:_0xd43295[_0xcf2a('0x2e')];if(!_0x11f4e3[_0xcf2a('0x30')][_0xcf2a('0x35')]('nolimit')){_0x54ba73[_0xcf2a('0x1a')]=qs[_0xcf2a('0x1a')](_0x11f4e3[_0xcf2a('0x30')][_0xcf2a('0x1a')]);_0x54ba73[_0xcf2a('0x18')]=qs[_0xcf2a('0x18')](_0x11f4e3[_0xcf2a('0x30')][_0xcf2a('0x18')]);}_0x54ba73['order']=qs[_0xcf2a('0x36')](_0x11f4e3[_0xcf2a('0x30')]['sort']);_0x54ba73[_0xcf2a('0x37')]=qs[_0xcf2a('0x31')](_[_0xcf2a('0x38')](_0x11f4e3['query'],_0xd43295['filters']),_0x521ae9);if(_0x11f4e3[_0xcf2a('0x30')][_0xcf2a('0x39')]){_0x54ba73['where']=_[_0xcf2a('0x3a')](_0x54ba73[_0xcf2a('0x37')],{'$or':_['map'](_0x521ae9,function(_0x48a14a){if(_0x48a14a[_0xcf2a('0x3b')]!=='VIRTUAL'){var _0x26de4a={};_0x26de4a[_0x48a14a[_0xcf2a('0x26')]]={'$like':'%'+_0x11f4e3[_0xcf2a('0x30')]['filter']+'%'};return _0x26de4a;}})});}_0x54ba73=_[_0xcf2a('0x3a')]({},_0x54ba73,_0x11f4e3[_0xcf2a('0x3c')]);var _0x4740f0={'where':_0x54ba73[_0xcf2a('0x37')]};return db[_0xcf2a('0x2a')][_0xcf2a('0x1b')](_0x4740f0)[_0xcf2a('0x22')](function(_0x1caaa0){_0x3fb9db[_0xcf2a('0x1b')]=_0x1caaa0;if(_0x11f4e3['query'][_0xcf2a('0x3d')]){_0x54ba73[_0xcf2a('0x3e')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x54ba73);})[_0xcf2a('0x22')](function(_0xcc6c6e){_0x3fb9db[_0xcf2a('0x3f')]=_0xcc6c6e;return _0x3fb9db;})['then'](respondWithFilteredResult(_0x2eb7fe,_0x54ba73))[_0xcf2a('0x40')](handleError(_0x2eb7fe,null));};exports[_0xcf2a('0x41')]=function(_0x5ca19e,_0x218b3d){var _0x54cde5={'raw':![],'where':{'id':_0x5ca19e['params']['id']}},_0x9b85e9={};_0x9b85e9[_0xcf2a('0x2e')]=_[_0xcf2a('0x2f')](db['SalesforceConfiguration'][_0xcf2a('0x2b')]);_0x9b85e9['query']=_[_0xcf2a('0x2f')](_0x5ca19e['query']);_0x9b85e9['filters']=_[_0xcf2a('0x32')](_0x9b85e9[_0xcf2a('0x2e')],_0x9b85e9[_0xcf2a('0x30')]);_0x54cde5[_0xcf2a('0x33')]=_[_0xcf2a('0x32')](_0x9b85e9[_0xcf2a('0x2e')],qs[_0xcf2a('0x34')](_0x5ca19e[_0xcf2a('0x30')][_0xcf2a('0x34')]));_0x54cde5[_0xcf2a('0x33')]=_0x54cde5[_0xcf2a('0x33')][_0xcf2a('0x42')]?_0x54cde5[_0xcf2a('0x33')]:_0x9b85e9[_0xcf2a('0x2e')];if(_0x5ca19e[_0xcf2a('0x30')]['includeAll']){_0x54cde5[_0xcf2a('0x3e')]=[{'all':!![]}];}_0x54cde5=_['merge']({},_0x54cde5,_0x5ca19e['options']);return db[_0xcf2a('0x2a')][_0xcf2a('0x43')](_0x54cde5)[_0xcf2a('0x22')](handleEntityNotFound(_0x218b3d,null))['then'](respondWithResult(_0x218b3d,null))[_0xcf2a('0x40')](handleError(_0x218b3d,null));};exports[_0xcf2a('0x44')]=function(_0x1886be,_0x5683b5){return db['SalesforceConfiguration'][_0xcf2a('0x44')](_0x1886be[_0xcf2a('0x45')],{})[_0xcf2a('0x22')](respondWithResult(_0x5683b5,0xc9))[_0xcf2a('0x40')](handleError(_0x5683b5,null));};exports['update']=function(_0x1a8963,_0x2be105){if(_0x1a8963[_0xcf2a('0x45')]['id']){delete _0x1a8963['body']['id'];}return db[_0xcf2a('0x2a')][_0xcf2a('0x43')]({'where':{'id':_0x1a8963[_0xcf2a('0x46')]['id']}})['then'](handleEntityNotFound(_0x2be105,null))['then'](saveUpdates(_0x1a8963[_0xcf2a('0x45')],null))[_0xcf2a('0x22')](respondWithResult(_0x2be105,null))[_0xcf2a('0x40')](handleError(_0x2be105,null));};exports['destroy']=function(_0x1fe269,_0x1fc13c){return db[_0xcf2a('0x2a')][_0xcf2a('0x43')]({'where':{'id':_0x1fe269['params']['id']}})[_0xcf2a('0x22')](handleEntityNotFound(_0x1fc13c,null))[_0xcf2a('0x22')](removeEntity(_0x1fc13c,null))[_0xcf2a('0x40')](handleError(_0x1fc13c,null));};exports[_0xcf2a('0x47')]=function(_0xd55bdb,_0x36b29d,_0x36c165){var _0x1ad44d={};var _0x1787c8={};var _0x44a8b5;var _0x5736ed;return db[_0xcf2a('0x2a')][_0xcf2a('0x48')]({'where':{'id':_0xd55bdb[_0xcf2a('0x46')]['id']}})[_0xcf2a('0x22')](handleEntityNotFound(_0x36b29d,null))[_0xcf2a('0x22')](function(_0x58c52b){if(_0x58c52b){_0x44a8b5=_0x58c52b;_0x1787c8[_0xcf2a('0x2e')]=_['keys'](db[_0xcf2a('0x49')]['rawAttributes']);_0x1787c8[_0xcf2a('0x30')]=_[_0xcf2a('0x2f')](_0xd55bdb['query']);_0x1787c8['filters']=_[_0xcf2a('0x32')](_0x1787c8[_0xcf2a('0x2e')],_0x1787c8[_0xcf2a('0x30')]);_0x1ad44d[_0xcf2a('0x33')]=_[_0xcf2a('0x32')](_0x1787c8[_0xcf2a('0x2e')],qs[_0xcf2a('0x34')](_0xd55bdb[_0xcf2a('0x30')][_0xcf2a('0x34')]));_0x1ad44d['attributes']=_0x1ad44d['attributes'][_0xcf2a('0x42')]?_0x1ad44d[_0xcf2a('0x33')]:_0x1787c8[_0xcf2a('0x2e')];_0x1ad44d['order']=qs[_0xcf2a('0x36')](_0xd55bdb[_0xcf2a('0x30')]['sort']);_0x1ad44d[_0xcf2a('0x37')]=qs[_0xcf2a('0x31')](_[_0xcf2a('0x38')](_0xd55bdb['query'],_0x1787c8[_0xcf2a('0x31')]));if(_0xd55bdb[_0xcf2a('0x30')][_0xcf2a('0x39')]){_0x1ad44d['where']=_[_0xcf2a('0x3a')](_0x1ad44d[_0xcf2a('0x37')],{'$or':_[_0xcf2a('0x29')](_0x1ad44d['attributes'],function(_0x2760ac){var _0x197e1f={};_0x197e1f[_0x2760ac]={'$like':'%'+_0xd55bdb[_0xcf2a('0x30')]['filter']+'%'};return _0x197e1f;})});}_0x1ad44d=_['merge']({},_0x1ad44d,_0xd55bdb['options']);return _0x44a8b5[_0xcf2a('0x47')](_0x1ad44d);}})[_0xcf2a('0x22')](function(_0x5d82a9){if(_0x5d82a9){_0x5736ed=_0x5d82a9[_0xcf2a('0x42')];if(!_0xd55bdb['query']['hasOwnProperty'](_0xcf2a('0x4a'))){_0x1ad44d[_0xcf2a('0x1a')]=qs['limit'](_0xd55bdb[_0xcf2a('0x30')]['limit']);_0x1ad44d[_0xcf2a('0x18')]=qs['offset'](_0xd55bdb[_0xcf2a('0x30')][_0xcf2a('0x18')]);}return _0x44a8b5[_0xcf2a('0x47')](_0x1ad44d);}})[_0xcf2a('0x22')](function(_0x378258){if(_0x378258){return _0x378258?{'count':_0x5736ed,'rows':_0x378258}:null;}})[_0xcf2a('0x22')](respondWithResult(_0x36b29d,null))[_0xcf2a('0x40')](handleError(_0x36b29d,null));};exports[_0xcf2a('0x4b')]=function(_0x2b587c,_0x14ac39,_0x2877a8){var _0x3165b0={};var _0x4a4b7a={};var _0x2ebd81;var _0x14e2f1;return db[_0xcf2a('0x2a')][_0xcf2a('0x48')]({'where':{'id':_0x2b587c[_0xcf2a('0x46')]['id']}})[_0xcf2a('0x22')](handleEntityNotFound(_0x14ac39,null))['then'](function(_0x4b9557){if(_0x4b9557){_0x2ebd81=_0x4b9557;_0x4a4b7a['model']=_['keys'](db['SalesforceField']['rawAttributes']);_0x4a4b7a[_0xcf2a('0x30')]=_[_0xcf2a('0x2f')](_0x2b587c[_0xcf2a('0x30')]);_0x4a4b7a['filters']=_[_0xcf2a('0x32')](_0x4a4b7a['model'],_0x4a4b7a['query']);_0x3165b0[_0xcf2a('0x33')]=_[_0xcf2a('0x32')](_0x4a4b7a[_0xcf2a('0x2e')],qs['fields'](_0x2b587c[_0xcf2a('0x30')]['fields']));_0x3165b0['attributes']=_0x3165b0[_0xcf2a('0x33')][_0xcf2a('0x42')]?_0x3165b0[_0xcf2a('0x33')]:_0x4a4b7a['model'];_0x3165b0[_0xcf2a('0x4c')]=qs['sort'](_0x2b587c[_0xcf2a('0x30')][_0xcf2a('0x36')]);_0x3165b0[_0xcf2a('0x37')]=qs[_0xcf2a('0x31')](_[_0xcf2a('0x38')](_0x2b587c[_0xcf2a('0x30')],_0x4a4b7a['filters']));if(_0x2b587c[_0xcf2a('0x30')][_0xcf2a('0x39')]){_0x3165b0['where']=_['merge'](_0x3165b0[_0xcf2a('0x37')],{'$or':_['map'](_0x3165b0[_0xcf2a('0x33')],function(_0x36b1ee){var _0x1645bd={};_0x1645bd[_0x36b1ee]={'$like':'%'+_0x2b587c['query'][_0xcf2a('0x39')]+'%'};return _0x1645bd;})});}_0x3165b0=_[_0xcf2a('0x3a')]({},_0x3165b0,_0x2b587c[_0xcf2a('0x3c')]);return _0x2ebd81[_0xcf2a('0x4b')](_0x3165b0);}})[_0xcf2a('0x22')](function(_0x454501){if(_0x454501){_0x14e2f1=_0x454501[_0xcf2a('0x42')];if(!_0x2b587c[_0xcf2a('0x30')][_0xcf2a('0x35')]('nolimit')){_0x3165b0['limit']=qs[_0xcf2a('0x1a')](_0x2b587c[_0xcf2a('0x30')][_0xcf2a('0x1a')]);_0x3165b0[_0xcf2a('0x18')]=qs[_0xcf2a('0x18')](_0x2b587c[_0xcf2a('0x30')][_0xcf2a('0x18')]);}return _0x2ebd81['getSubjects'](_0x3165b0);}})[_0xcf2a('0x22')](function(_0x17b256){if(_0x17b256){return _0x17b256?{'count':_0x14e2f1,'rows':_0x17b256}:null;}})[_0xcf2a('0x22')](respondWithResult(_0x14ac39,null))[_0xcf2a('0x40')](handleError(_0x14ac39,null));};exports['getDescriptions']=function(_0xa1be88,_0x12da42,_0x3271bd){var _0xa80a67={};var _0x3ac0b3={};var _0x1f4c0c;var _0x2be81b;return db[_0xcf2a('0x2a')]['findOne']({'where':{'id':_0xa1be88[_0xcf2a('0x46')]['id']}})['then'](handleEntityNotFound(_0x12da42,null))['then'](function(_0x590241){if(_0x590241){_0x1f4c0c=_0x590241;_0x3ac0b3[_0xcf2a('0x2e')]=_['keys'](db[_0xcf2a('0x49')][_0xcf2a('0x2b')]);_0x3ac0b3[_0xcf2a('0x30')]=_[_0xcf2a('0x2f')](_0xa1be88['query']);_0x3ac0b3[_0xcf2a('0x31')]=_[_0xcf2a('0x32')](_0x3ac0b3[_0xcf2a('0x2e')],_0x3ac0b3['query']);_0xa80a67['attributes']=_[_0xcf2a('0x32')](_0x3ac0b3[_0xcf2a('0x2e')],qs[_0xcf2a('0x34')](_0xa1be88[_0xcf2a('0x30')][_0xcf2a('0x34')]));_0xa80a67[_0xcf2a('0x33')]=_0xa80a67['attributes']['length']?_0xa80a67['attributes']:_0x3ac0b3[_0xcf2a('0x2e')];_0xa80a67[_0xcf2a('0x4c')]=qs[_0xcf2a('0x36')](_0xa1be88[_0xcf2a('0x30')][_0xcf2a('0x36')]);_0xa80a67[_0xcf2a('0x37')]=qs['filters'](_['pick'](_0xa1be88[_0xcf2a('0x30')],_0x3ac0b3[_0xcf2a('0x31')]));if(_0xa1be88[_0xcf2a('0x30')][_0xcf2a('0x39')]){_0xa80a67[_0xcf2a('0x37')]=_['merge'](_0xa80a67[_0xcf2a('0x37')],{'$or':_[_0xcf2a('0x29')](_0xa80a67['attributes'],function(_0x76aa1d){var _0x16022a={};_0x16022a[_0x76aa1d]={'$like':'%'+_0xa1be88[_0xcf2a('0x30')][_0xcf2a('0x39')]+'%'};return _0x16022a;})});}_0xa80a67=_[_0xcf2a('0x3a')]({},_0xa80a67,_0xa1be88[_0xcf2a('0x3c')]);return _0x1f4c0c['getDescriptions'](_0xa80a67);}})[_0xcf2a('0x22')](function(_0x445b59){if(_0x445b59){_0x2be81b=_0x445b59[_0xcf2a('0x42')];if(!_0xa1be88[_0xcf2a('0x30')][_0xcf2a('0x35')](_0xcf2a('0x4a'))){_0xa80a67[_0xcf2a('0x1a')]=qs[_0xcf2a('0x1a')](_0xa1be88[_0xcf2a('0x30')]['limit']);_0xa80a67[_0xcf2a('0x18')]=qs[_0xcf2a('0x18')](_0xa1be88[_0xcf2a('0x30')]['offset']);}return _0x1f4c0c['getDescriptions'](_0xa80a67);}})[_0xcf2a('0x22')](function(_0x9b680a){if(_0x9b680a){return _0x9b680a?{'count':_0x2be81b,'rows':_0x9b680a}:null;}})['then'](respondWithResult(_0x12da42,null))[_0xcf2a('0x40')](handleError(_0x12da42,null));};
\ No newline at end of file
+var _0x6a46=['reject','update','destroy','error','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','type','VIRTUAL','filter','merge','options','then','includeAll','include','rows','catch','show','params','length','find','create','body','getFields','findOne','SalesforceField','pick','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply'];(function(_0x527e74,_0x56115d){var _0x10acf7=function(_0x1c53b0){while(--_0x1c53b0){_0x527e74['push'](_0x527e74['shift']());}};_0x10acf7(++_0x56115d);}(_0x6a46,0x1cd));var _0x66a4=function(_0xc2261,_0x545d7b){_0xc2261=_0xc2261-0x0;var _0x57c043=_0x6a46[_0xc2261];return _0x57c043;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x66a4('0x0'));var jsonpatch=require(_0x66a4('0x1'));var rp=require(_0x66a4('0x2'));var moment=require(_0x66a4('0x3'));var BPromise=require(_0x66a4('0x4'));var Mustache=require(_0x66a4('0x5'));var util=require(_0x66a4('0x6'));var path=require(_0x66a4('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x66a4('0x8'));var fs=require('fs');var fs_extra=require(_0x66a4('0x9'));var _=require(_0x66a4('0xa'));var squel=require(_0x66a4('0xb'));var crypto=require(_0x66a4('0xc'));var jsforce=require(_0x66a4('0xd'));var deskjs=require(_0x66a4('0xe'));var toCsv=require(_0x66a4('0xf'));var querystring=require(_0x66a4('0x10'));var Papa=require(_0x66a4('0x11'));var Redis=require(_0x66a4('0x12'));var authService=require(_0x66a4('0x13'));var qs=require(_0x66a4('0x14'));var as=require(_0x66a4('0x15'));var hardwareService=require(_0x66a4('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x66a4('0x17'));var licenseUtil=require(_0x66a4('0x18'));var db=require(_0x66a4('0x19'))['db'];function respondWithStatusCode(_0x19e148,_0x1f2e1a){_0x1f2e1a=_0x1f2e1a||0xcc;return function(_0x1d7bdd){if(_0x1d7bdd){return _0x19e148[_0x66a4('0x1a')](_0x1f2e1a);}return _0x19e148[_0x66a4('0x1b')](_0x1f2e1a)[_0x66a4('0x1c')]();};}function respondWithResult(_0x649ba9,_0x18a23b){_0x18a23b=_0x18a23b||0xc8;return function(_0xfe049b){if(_0xfe049b){return _0x649ba9[_0x66a4('0x1b')](_0x18a23b)[_0x66a4('0x1d')](_0xfe049b);}};}function respondWithFilteredResult(_0x414c2e,_0xaedf94){return function(_0x467884){if(_0x467884){var _0x34cbb8=typeof _0xaedf94[_0x66a4('0x1e')]==='undefined'&&typeof _0xaedf94[_0x66a4('0x1f')]===_0x66a4('0x20');var _0x4b464a=_0x467884['count'];var _0x6b58d0=_0x34cbb8?0x0:_0xaedf94[_0x66a4('0x1e')];var _0x4e1820=_0x34cbb8?_0x467884[_0x66a4('0x21')]:_0xaedf94['offset']+_0xaedf94[_0x66a4('0x1f')];var _0x35500;if(_0x4e1820>=_0x4b464a){_0x4e1820=_0x4b464a;_0x35500=0xc8;}else{_0x35500=0xce;}_0x414c2e[_0x66a4('0x1b')](_0x35500);return _0x414c2e[_0x66a4('0x22')](_0x66a4('0x23'),_0x6b58d0+'-'+_0x4e1820+'/'+_0x4b464a)['json'](_0x467884);}return null;};}function patchUpdates(_0x3385e8){return function(_0x101e28){try{jsonpatch[_0x66a4('0x24')](_0x101e28,_0x3385e8,!![]);}catch(_0x8dde4){return BPromise[_0x66a4('0x25')](_0x8dde4);}return _0x101e28['save']();};}function saveUpdates(_0x365d8f,_0x5d6ad5){return function(_0x2bcbc9){if(_0x2bcbc9){return _0x2bcbc9[_0x66a4('0x26')](_0x365d8f)['then'](function(_0x57c330){return _0x57c330;});}return null;};}function removeEntity(_0x4c0016,_0xeb2828){return function(_0x20a3ef){if(_0x20a3ef){return _0x20a3ef[_0x66a4('0x27')]()['then'](function(){_0x4c0016[_0x66a4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf036c1,_0x2d4ad4){return function(_0xd30ef6){if(!_0xd30ef6){_0xf036c1['sendStatus'](0x194);}return _0xd30ef6;};}function handleError(_0x43107c,_0x27a125){_0x27a125=_0x27a125||0x1f4;return function(_0x5552a2){logger[_0x66a4('0x28')](_0x5552a2['stack']);if(_0x5552a2[_0x66a4('0x29')]){delete _0x5552a2[_0x66a4('0x29')];}_0x43107c['status'](_0x27a125)[_0x66a4('0x2a')](_0x5552a2);};}exports[_0x66a4('0x2b')]=function(_0x55d5b4,_0x5bbf65){var _0x2ba516={},_0x3a8fa8={},_0x5ee1b6={'count':0x0,'rows':[]};var _0x46d77a=_[_0x66a4('0x2c')](db[_0x66a4('0x2d')][_0x66a4('0x2e')],function(_0x1820fa){return{'name':_0x1820fa[_0x66a4('0x2f')],'type':_0x1820fa['type'][_0x66a4('0x30')]};});_0x3a8fa8[_0x66a4('0x31')]=_[_0x66a4('0x2c')](_0x46d77a,_0x66a4('0x29'));_0x3a8fa8[_0x66a4('0x32')]=_[_0x66a4('0x33')](_0x55d5b4[_0x66a4('0x32')]);_0x3a8fa8['filters']=_[_0x66a4('0x34')](_0x3a8fa8['model'],_0x3a8fa8[_0x66a4('0x32')]);_0x2ba516[_0x66a4('0x35')]=_['intersection'](_0x3a8fa8['model'],qs['fields'](_0x55d5b4[_0x66a4('0x32')][_0x66a4('0x36')]));_0x2ba516['attributes']=_0x2ba516[_0x66a4('0x35')]['length']?_0x2ba516[_0x66a4('0x35')]:_0x3a8fa8[_0x66a4('0x31')];if(!_0x55d5b4['query'][_0x66a4('0x37')](_0x66a4('0x38'))){_0x2ba516[_0x66a4('0x1f')]=qs[_0x66a4('0x1f')](_0x55d5b4[_0x66a4('0x32')][_0x66a4('0x1f')]);_0x2ba516[_0x66a4('0x1e')]=qs[_0x66a4('0x1e')](_0x55d5b4[_0x66a4('0x32')]['offset']);}_0x2ba516[_0x66a4('0x39')]=qs[_0x66a4('0x3a')](_0x55d5b4['query'][_0x66a4('0x3a')]);_0x2ba516[_0x66a4('0x3b')]=qs[_0x66a4('0x3c')](_['pick'](_0x55d5b4[_0x66a4('0x32')],_0x3a8fa8[_0x66a4('0x3c')]),_0x46d77a);if(_0x55d5b4[_0x66a4('0x32')]['filter']){_0x2ba516[_0x66a4('0x3b')]=_['merge'](_0x2ba516[_0x66a4('0x3b')],{'$or':_[_0x66a4('0x2c')](_0x46d77a,function(_0x35eaa5){if(_0x35eaa5[_0x66a4('0x3d')]!==_0x66a4('0x3e')){var _0x36e39a={};_0x36e39a[_0x35eaa5['name']]={'$like':'%'+_0x55d5b4['query'][_0x66a4('0x3f')]+'%'};return _0x36e39a;}})});}_0x2ba516=_[_0x66a4('0x40')]({},_0x2ba516,_0x55d5b4[_0x66a4('0x41')]);var _0x4a7ac0={'where':_0x2ba516[_0x66a4('0x3b')]};return db['SalesforceConfiguration'][_0x66a4('0x21')](_0x4a7ac0)[_0x66a4('0x42')](function(_0x258ac8){_0x5ee1b6['count']=_0x258ac8;if(_0x55d5b4[_0x66a4('0x32')][_0x66a4('0x43')]){_0x2ba516[_0x66a4('0x44')]=[{'all':!![]}];}return db[_0x66a4('0x2d')]['findAll'](_0x2ba516);})[_0x66a4('0x42')](function(_0x59d31e){_0x5ee1b6[_0x66a4('0x45')]=_0x59d31e;return _0x5ee1b6;})['then'](respondWithFilteredResult(_0x5bbf65,_0x2ba516))[_0x66a4('0x46')](handleError(_0x5bbf65,null));};exports[_0x66a4('0x47')]=function(_0x49bb66,_0xeb5e74){var _0x1c4d4f={'raw':![],'where':{'id':_0x49bb66[_0x66a4('0x48')]['id']}},_0x1c2ecb={};_0x1c2ecb[_0x66a4('0x31')]=_['keys'](db[_0x66a4('0x2d')][_0x66a4('0x2e')]);_0x1c2ecb['query']=_[_0x66a4('0x33')](_0x49bb66[_0x66a4('0x32')]);_0x1c2ecb[_0x66a4('0x3c')]=_[_0x66a4('0x34')](_0x1c2ecb[_0x66a4('0x31')],_0x1c2ecb['query']);_0x1c4d4f[_0x66a4('0x35')]=_[_0x66a4('0x34')](_0x1c2ecb[_0x66a4('0x31')],qs[_0x66a4('0x36')](_0x49bb66[_0x66a4('0x32')]['fields']));_0x1c4d4f[_0x66a4('0x35')]=_0x1c4d4f[_0x66a4('0x35')][_0x66a4('0x49')]?_0x1c4d4f[_0x66a4('0x35')]:_0x1c2ecb[_0x66a4('0x31')];if(_0x49bb66[_0x66a4('0x32')][_0x66a4('0x43')]){_0x1c4d4f[_0x66a4('0x44')]=[{'all':!![]}];}_0x1c4d4f=_[_0x66a4('0x40')]({},_0x1c4d4f,_0x49bb66[_0x66a4('0x41')]);return db[_0x66a4('0x2d')][_0x66a4('0x4a')](_0x1c4d4f)[_0x66a4('0x42')](handleEntityNotFound(_0xeb5e74,null))[_0x66a4('0x42')](respondWithResult(_0xeb5e74,null))[_0x66a4('0x46')](handleError(_0xeb5e74,null));};exports[_0x66a4('0x4b')]=function(_0x27440d,_0x6212a0){return db[_0x66a4('0x2d')][_0x66a4('0x4b')](_0x27440d[_0x66a4('0x4c')],{})[_0x66a4('0x42')](respondWithResult(_0x6212a0,0xc9))['catch'](handleError(_0x6212a0,null));};exports[_0x66a4('0x26')]=function(_0x3de166,_0x1a8e88){if(_0x3de166[_0x66a4('0x4c')]['id']){delete _0x3de166[_0x66a4('0x4c')]['id'];}return db[_0x66a4('0x2d')]['find']({'where':{'id':_0x3de166[_0x66a4('0x48')]['id']}})[_0x66a4('0x42')](handleEntityNotFound(_0x1a8e88,null))[_0x66a4('0x42')](saveUpdates(_0x3de166[_0x66a4('0x4c')],null))[_0x66a4('0x42')](respondWithResult(_0x1a8e88,null))[_0x66a4('0x46')](handleError(_0x1a8e88,null));};exports['destroy']=function(_0x3df273,_0x42d26c){return db[_0x66a4('0x2d')][_0x66a4('0x4a')]({'where':{'id':_0x3df273[_0x66a4('0x48')]['id']}})[_0x66a4('0x42')](handleEntityNotFound(_0x42d26c,null))[_0x66a4('0x42')](removeEntity(_0x42d26c,null))[_0x66a4('0x46')](handleError(_0x42d26c,null));};exports[_0x66a4('0x4d')]=function(_0x188a6d,_0x273109,_0x2d5e8b){var _0x402370={};var _0x141c3e={};var _0x309e83;var _0x570024;return db[_0x66a4('0x2d')][_0x66a4('0x4e')]({'where':{'id':_0x188a6d['params']['id']}})['then'](handleEntityNotFound(_0x273109,null))[_0x66a4('0x42')](function(_0x11119){if(_0x11119){_0x309e83=_0x11119;_0x141c3e[_0x66a4('0x31')]=_[_0x66a4('0x33')](db[_0x66a4('0x4f')]['rawAttributes']);_0x141c3e[_0x66a4('0x32')]=_[_0x66a4('0x33')](_0x188a6d['query']);_0x141c3e['filters']=_['intersection'](_0x141c3e[_0x66a4('0x31')],_0x141c3e[_0x66a4('0x32')]);_0x402370[_0x66a4('0x35')]=_[_0x66a4('0x34')](_0x141c3e[_0x66a4('0x31')],qs[_0x66a4('0x36')](_0x188a6d[_0x66a4('0x32')][_0x66a4('0x36')]));_0x402370[_0x66a4('0x35')]=_0x402370[_0x66a4('0x35')][_0x66a4('0x49')]?_0x402370[_0x66a4('0x35')]:_0x141c3e[_0x66a4('0x31')];_0x402370[_0x66a4('0x39')]=qs[_0x66a4('0x3a')](_0x188a6d[_0x66a4('0x32')][_0x66a4('0x3a')]);_0x402370[_0x66a4('0x3b')]=qs['filters'](_[_0x66a4('0x50')](_0x188a6d['query'],_0x141c3e[_0x66a4('0x3c')]));if(_0x188a6d['query'][_0x66a4('0x3f')]){_0x402370['where']=_[_0x66a4('0x40')](_0x402370['where'],{'$or':_[_0x66a4('0x2c')](_0x402370[_0x66a4('0x35')],function(_0x22eeb3){var _0xca2c6c={};_0xca2c6c[_0x22eeb3]={'$like':'%'+_0x188a6d[_0x66a4('0x32')][_0x66a4('0x3f')]+'%'};return _0xca2c6c;})});}_0x402370=_[_0x66a4('0x40')]({},_0x402370,_0x188a6d['options']);return _0x309e83['getFields'](_0x402370);}})[_0x66a4('0x42')](function(_0x4114f8){if(_0x4114f8){_0x570024=_0x4114f8[_0x66a4('0x49')];if(!_0x188a6d[_0x66a4('0x32')][_0x66a4('0x37')]('nolimit')){_0x402370[_0x66a4('0x1f')]=qs[_0x66a4('0x1f')](_0x188a6d[_0x66a4('0x32')][_0x66a4('0x1f')]);_0x402370['offset']=qs[_0x66a4('0x1e')](_0x188a6d[_0x66a4('0x32')][_0x66a4('0x1e')]);}return _0x309e83[_0x66a4('0x4d')](_0x402370);}})['then'](function(_0x4bc837){if(_0x4bc837){return _0x4bc837?{'count':_0x570024,'rows':_0x4bc837}:null;}})[_0x66a4('0x42')](respondWithResult(_0x273109,null))[_0x66a4('0x46')](handleError(_0x273109,null));};exports[_0x66a4('0x51')]=function(_0x5653a0,_0x59fa98,_0x224810){var _0x2c2d8c={};var _0x42c62f={};var _0x4e7dca;var _0x3a6350;return db['SalesforceConfiguration'][_0x66a4('0x4e')]({'where':{'id':_0x5653a0[_0x66a4('0x48')]['id']}})[_0x66a4('0x42')](handleEntityNotFound(_0x59fa98,null))['then'](function(_0x99a03){if(_0x99a03){_0x4e7dca=_0x99a03;_0x42c62f[_0x66a4('0x31')]=_[_0x66a4('0x33')](db[_0x66a4('0x4f')][_0x66a4('0x2e')]);_0x42c62f['query']=_[_0x66a4('0x33')](_0x5653a0[_0x66a4('0x32')]);_0x42c62f['filters']=_['intersection'](_0x42c62f[_0x66a4('0x31')],_0x42c62f[_0x66a4('0x32')]);_0x2c2d8c[_0x66a4('0x35')]=_[_0x66a4('0x34')](_0x42c62f[_0x66a4('0x31')],qs[_0x66a4('0x36')](_0x5653a0[_0x66a4('0x32')]['fields']));_0x2c2d8c[_0x66a4('0x35')]=_0x2c2d8c[_0x66a4('0x35')]['length']?_0x2c2d8c[_0x66a4('0x35')]:_0x42c62f[_0x66a4('0x31')];_0x2c2d8c[_0x66a4('0x39')]=qs[_0x66a4('0x3a')](_0x5653a0[_0x66a4('0x32')][_0x66a4('0x3a')]);_0x2c2d8c['where']=qs[_0x66a4('0x3c')](_[_0x66a4('0x50')](_0x5653a0[_0x66a4('0x32')],_0x42c62f['filters']));if(_0x5653a0[_0x66a4('0x32')][_0x66a4('0x3f')]){_0x2c2d8c[_0x66a4('0x3b')]=_[_0x66a4('0x40')](_0x2c2d8c[_0x66a4('0x3b')],{'$or':_[_0x66a4('0x2c')](_0x2c2d8c[_0x66a4('0x35')],function(_0x546327){var _0x5d5dc2={};_0x5d5dc2[_0x546327]={'$like':'%'+_0x5653a0['query'][_0x66a4('0x3f')]+'%'};return _0x5d5dc2;})});}_0x2c2d8c=_['merge']({},_0x2c2d8c,_0x5653a0[_0x66a4('0x41')]);return _0x4e7dca['getSubjects'](_0x2c2d8c);}})[_0x66a4('0x42')](function(_0xaf4ca8){if(_0xaf4ca8){_0x3a6350=_0xaf4ca8['length'];if(!_0x5653a0['query']['hasOwnProperty'](_0x66a4('0x38'))){_0x2c2d8c[_0x66a4('0x1f')]=qs[_0x66a4('0x1f')](_0x5653a0[_0x66a4('0x32')][_0x66a4('0x1f')]);_0x2c2d8c['offset']=qs['offset'](_0x5653a0[_0x66a4('0x32')][_0x66a4('0x1e')]);}return _0x4e7dca[_0x66a4('0x51')](_0x2c2d8c);}})[_0x66a4('0x42')](function(_0x49d7b5){if(_0x49d7b5){return _0x49d7b5?{'count':_0x3a6350,'rows':_0x49d7b5}:null;}})[_0x66a4('0x42')](respondWithResult(_0x59fa98,null))[_0x66a4('0x46')](handleError(_0x59fa98,null));};exports[_0x66a4('0x52')]=function(_0xbba75a,_0x5a5bdc,_0x970c04){var _0x18b0fa={};var _0xdc0975={};var _0x2395e9;var _0xef77f5;return db[_0x66a4('0x2d')][_0x66a4('0x4e')]({'where':{'id':_0xbba75a['params']['id']}})[_0x66a4('0x42')](handleEntityNotFound(_0x5a5bdc,null))['then'](function(_0x5eddb3){if(_0x5eddb3){_0x2395e9=_0x5eddb3;_0xdc0975[_0x66a4('0x31')]=_[_0x66a4('0x33')](db[_0x66a4('0x4f')][_0x66a4('0x2e')]);_0xdc0975[_0x66a4('0x32')]=_[_0x66a4('0x33')](_0xbba75a['query']);_0xdc0975[_0x66a4('0x3c')]=_[_0x66a4('0x34')](_0xdc0975[_0x66a4('0x31')],_0xdc0975['query']);_0x18b0fa[_0x66a4('0x35')]=_[_0x66a4('0x34')](_0xdc0975[_0x66a4('0x31')],qs[_0x66a4('0x36')](_0xbba75a['query'][_0x66a4('0x36')]));_0x18b0fa[_0x66a4('0x35')]=_0x18b0fa[_0x66a4('0x35')][_0x66a4('0x49')]?_0x18b0fa[_0x66a4('0x35')]:_0xdc0975[_0x66a4('0x31')];_0x18b0fa[_0x66a4('0x39')]=qs['sort'](_0xbba75a[_0x66a4('0x32')][_0x66a4('0x3a')]);_0x18b0fa[_0x66a4('0x3b')]=qs[_0x66a4('0x3c')](_['pick'](_0xbba75a[_0x66a4('0x32')],_0xdc0975[_0x66a4('0x3c')]));if(_0xbba75a[_0x66a4('0x32')][_0x66a4('0x3f')]){_0x18b0fa[_0x66a4('0x3b')]=_[_0x66a4('0x40')](_0x18b0fa[_0x66a4('0x3b')],{'$or':_[_0x66a4('0x2c')](_0x18b0fa['attributes'],function(_0x5849f9){var _0x5aca65={};_0x5aca65[_0x5849f9]={'$like':'%'+_0xbba75a[_0x66a4('0x32')][_0x66a4('0x3f')]+'%'};return _0x5aca65;})});}_0x18b0fa=_[_0x66a4('0x40')]({},_0x18b0fa,_0xbba75a[_0x66a4('0x41')]);return _0x2395e9[_0x66a4('0x52')](_0x18b0fa);}})[_0x66a4('0x42')](function(_0x44b7c1){if(_0x44b7c1){_0xef77f5=_0x44b7c1[_0x66a4('0x49')];if(!_0xbba75a[_0x66a4('0x32')]['hasOwnProperty'](_0x66a4('0x38'))){_0x18b0fa[_0x66a4('0x1f')]=qs[_0x66a4('0x1f')](_0xbba75a['query'][_0x66a4('0x1f')]);_0x18b0fa[_0x66a4('0x1e')]=qs[_0x66a4('0x1e')](_0xbba75a[_0x66a4('0x32')][_0x66a4('0x1e')]);}return _0x2395e9[_0x66a4('0x52')](_0x18b0fa);}})[_0x66a4('0x42')](function(_0x219587){if(_0x219587){return _0x219587?{'count':_0xef77f5,'rows':_0x219587}:null;}})[_0x66a4('0x42')](respondWithResult(_0x5a5bdc,null))[_0x66a4('0x46')](handleError(_0x5a5bdc,null));};
\ No newline at end of file
index 142fa9d..3608cf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa49e=['SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define'];(function(_0x192521,_0x145344){var _0x5d9a6c=function(_0x145f34){while(--_0x145f34){_0x192521['push'](_0x192521['shift']());}};_0x5d9a6c(++_0x145344);}(_0xa49e,0x182));var _0xea49=function(_0x33d5d6,_0x2ad866){_0x33d5d6=_0x33d5d6-0x0;var _0x27032e=_0xa49e[_0x33d5d6];return _0x27032e;};'use strict';var _=require(_0xea49('0x0'));var util=require(_0xea49('0x1'));var logger=require(_0xea49('0x2'))(_0xea49('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xea49('0x4'));var fs=require('fs');var path=require(_0xea49('0x5'));var rimraf=require(_0xea49('0x6'));var config=require(_0xea49('0x7'));var attributes=require(_0xea49('0x8'));module['exports']=function(_0x432ba3,_0x46a758){return _0x432ba3[_0xea49('0x9')](_0xea49('0xa'),attributes,{'tableName':_0xea49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa4c7=['int_salesforce_configurations','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','SalesforceConfiguration'];(function(_0x3b45e8,_0x628af6){var _0x370099=function(_0x80765f){while(--_0x80765f){_0x3b45e8['push'](_0x3b45e8['shift']());}};_0x370099(++_0x628af6);}(_0xa4c7,0x91));var _0x7a4c=function(_0x39e511,_0x3937ca){_0x39e511=_0x39e511-0x0;var _0x12712e=_0xa4c7[_0x39e511];return _0x12712e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7a4c('0x0'))(_0x7a4c('0x1'));var moment=require(_0x7a4c('0x2'));var BPromise=require(_0x7a4c('0x3'));var rp=require(_0x7a4c('0x4'));var fs=require('fs');var path=require(_0x7a4c('0x5'));var rimraf=require(_0x7a4c('0x6'));var config=require(_0x7a4c('0x7'));var attributes=require(_0x7a4c('0x8'));module[_0x7a4c('0x9')]=function(_0x2bc019,_0x1d2871){return _0x2bc019['define'](_0x7a4c('0xa'),attributes,{'tableName':_0x7a4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ab52650..2fdf064 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fcf=['http','request','then','SalesforceConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2cfb48,_0x24b83b){var _0xc4594f=function(_0x3bc089){while(--_0x3bc089){_0x2cfb48['push'](_0x2cfb48['shift']());}};_0xc4594f(++_0x24b83b);}(_0x8fcf,0x138));var _0xf8fc=function(_0x3817fb,_0x2aecd3){_0x3817fb=_0x3817fb-0x0;var _0x25651d=_0x8fcf[_0x3817fb];return _0x25651d;};'use strict';var _=require(_0xf8fc('0x0'));var util=require(_0xf8fc('0x1'));var moment=require(_0xf8fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8fc('0x3'));var fs=require('fs');var Redis=require(_0xf8fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8fc('0x5'));var logger=require(_0xf8fc('0x6'))('rpc');var config=require(_0xf8fc('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf8fc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x55fa46,_0x57705a,_0x33075a){return new BPromise(function(_0x1ee421,_0xb09624){return client[_0xf8fc('0x9')](_0x55fa46,_0x33075a)[_0xf8fc('0xa')](function(_0x5b6215){logger['info'](_0xf8fc('0xb'),_0x57705a,'request\x20sent');logger[_0xf8fc('0xc')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x57705a,_0xf8fc('0xd'),JSON[_0xf8fc('0xe')](_0x5b6215));if(_0x5b6215['error']){if(_0x5b6215[_0xf8fc('0xf')][_0xf8fc('0x10')]===0x1f4){logger[_0xf8fc('0xf')](_0xf8fc('0xb'),_0x57705a,_0x5b6215[_0xf8fc('0xf')][_0xf8fc('0x11')]);return _0xb09624(_0x5b6215['error'][_0xf8fc('0x11')]);}logger[_0xf8fc('0xf')](_0xf8fc('0xb'),_0x57705a,_0x5b6215[_0xf8fc('0xf')][_0xf8fc('0x11')]);return _0x1ee421(_0x5b6215['error'][_0xf8fc('0x11')]);}else{logger[_0xf8fc('0x12')]('SalesforceConfiguration,\x20%s,\x20%s',_0x57705a,'request\x20sent');_0x1ee421(_0x5b6215[_0xf8fc('0x13')]['message']);}})['catch'](function(_0x5ed321){logger[_0xf8fc('0xf')](_0xf8fc('0xb'),_0x57705a,_0x5ed321);_0xb09624(_0x5ed321);});});}
\ No newline at end of file
+var _0xe637=['SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','debug','request\x20sent','stringify','error'];(function(_0x27fedb,_0x31c693){var _0x58ab78=function(_0x532732){while(--_0x532732){_0x27fedb['push'](_0x27fedb['shift']());}};_0x58ab78(++_0x31c693);}(_0xe637,0x82));var _0x7e63=function(_0x2a5866,_0x525d41){_0x2a5866=_0x2a5866-0x0;var _0x47b6b5=_0xe637[_0x2a5866];return _0x47b6b5;};'use strict';var _=require(_0x7e63('0x0'));var util=require(_0x7e63('0x1'));var moment=require('moment');var BPromise=require(_0x7e63('0x2'));var rs=require(_0x7e63('0x3'));var fs=require('fs');var Redis=require(_0x7e63('0x4'));var db=require(_0x7e63('0x5'))['db'];var utils=require(_0x7e63('0x6'));var logger=require(_0x7e63('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7e63('0x8'));var client=jayson[_0x7e63('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x430b05,_0x886517,_0x17573a){return new BPromise(function(_0x182718,_0x539763){return client[_0x7e63('0xa')](_0x430b05,_0x17573a)[_0x7e63('0xb')](function(_0x43031a){logger[_0x7e63('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x886517,'request\x20sent');logger[_0x7e63('0xd')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x886517,_0x7e63('0xe'),JSON[_0x7e63('0xf')](_0x43031a));if(_0x43031a[_0x7e63('0x10')]){if(_0x43031a[_0x7e63('0x10')]['code']===0x1f4){logger[_0x7e63('0x10')](_0x7e63('0x11'),_0x886517,_0x43031a[_0x7e63('0x10')][_0x7e63('0x12')]);return _0x539763(_0x43031a[_0x7e63('0x10')][_0x7e63('0x12')]);}logger['error'](_0x7e63('0x11'),_0x886517,_0x43031a[_0x7e63('0x10')][_0x7e63('0x12')]);return _0x182718(_0x43031a['error'][_0x7e63('0x12')]);}else{logger[_0x7e63('0xc')](_0x7e63('0x11'),_0x886517,_0x7e63('0xe'));_0x182718(_0x43031a[_0x7e63('0x13')][_0x7e63('0x12')]);}})[_0x7e63('0x14')](function(_0x53812a){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x886517,_0x53812a);_0x539763(_0x53812a);});});}
\ No newline at end of file
index 373b7ab..994b42c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ae6=['./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2ff4bd,_0x4780a6){var _0x28edc6=function(_0x792380){while(--_0x792380){_0x2ff4bd['push'](_0x2ff4bd['shift']());}};_0x28edc6(++_0x4780a6);}(_0x6ae6,0x1af));var _0x66ae=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6ae6[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x66ae('0x0'));var util=require(_0x66ae('0x1'));var path=require(_0x66ae('0x2'));var timeout=require(_0x66ae('0x3'));var express=require(_0x66ae('0x4'));var router=express[_0x66ae('0x5')]();var fs_extra=require(_0x66ae('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x66ae('0x7'));var config=require(_0x66ae('0x8'));var controller=require(_0x66ae('0x9'));router[_0x66ae('0xa')]('/',auth[_0x66ae('0xb')](),controller[_0x66ae('0xc')]);router['get'](_0x66ae('0xd'),auth['isAuthenticated'](),controller[_0x66ae('0xe')]);router[_0x66ae('0xf')]('/',auth[_0x66ae('0xb')](),controller[_0x66ae('0x10')]);router[_0x66ae('0x11')](_0x66ae('0xd'),auth[_0x66ae('0xb')](),controller['update']);router[_0x66ae('0x12')](_0x66ae('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x66ae('0x13')]=router;
\ No newline at end of file
+var _0x277a=['delete','exports','multer','util','connect-timeout','Router','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x2af100,_0x74d2b){var _0x25948a=function(_0xc3e717){while(--_0xc3e717){_0x2af100['push'](_0x2af100['shift']());}};_0x25948a(++_0x74d2b);}(_0x277a,0x1c2));var _0xa277=function(_0x969859,_0x77c4b2){_0x969859=_0x969859-0x0;var _0x129fc8=_0x277a[_0x969859];return _0x129fc8;};'use strict';var multer=require(_0xa277('0x0'));var util=require(_0xa277('0x1'));var path=require('path');var timeout=require(_0xa277('0x2'));var express=require('express');var router=express[_0xa277('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa277('0x4'));router[_0xa277('0x5')]('/',auth[_0xa277('0x6')](),controller[_0xa277('0x7')]);router[_0xa277('0x5')](_0xa277('0x8'),auth[_0xa277('0x6')](),controller[_0xa277('0x9')]);router[_0xa277('0xa')]('/',auth['isAuthenticated'](),controller[_0xa277('0xb')]);router[_0xa277('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xa277('0xd')]);router[_0xa277('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa277('0xf')]=router;
\ No newline at end of file
index 257dd8d..d4c7cfa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29be=['string','STRING','sequelize','ENUM','variable','customVariable','keyValue','picklist'];(function(_0xbd5768,_0x339f80){var _0x16a9db=function(_0x2e6ed0){while(--_0x2e6ed0){_0xbd5768['push'](_0xbd5768['shift']());}};_0x16a9db(++_0x339f80);}(_0x29be,0xba));var _0xe29b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x29be[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require(_0xe29b('0x0'));module['exports']={'type':{'type':Sequelize[_0xe29b('0x1')]('string',_0xe29b('0x2'),_0xe29b('0x3'),_0xe29b('0x4'),_0xe29b('0x5')),'defaultValue':_0xe29b('0x6')},'content':{'type':Sequelize[_0xe29b('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe29b('0x1')](_0xe29b('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xe29b('0x7')]},'variableName':{'type':Sequelize[_0xe29b('0x7')]}};
\ No newline at end of file
+var _0x73e6=['ENUM','exports','string','variable','customVariable','keyValue','picklist','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x73e6,0x1d9));var _0x673e=function(_0x2294b6,_0x3df3c5){_0x2294b6=_0x2294b6-0x0;var _0x5e8208=_0x73e6[_0x2294b6];return _0x5e8208;};'use strict';var Sequelize=require('sequelize');module[_0x673e('0x0')]={'type':{'type':Sequelize['ENUM'](_0x673e('0x1'),_0x673e('0x2'),_0x673e('0x3'),_0x673e('0x4'),_0x673e('0x5')),'defaultValue':_0x673e('0x1')},'content':{'type':Sequelize[_0x673e('0x6')]},'key':{'type':Sequelize[_0x673e('0x6')]},'keyType':{'type':Sequelize[_0x673e('0x7')](_0x673e('0x1'),_0x673e('0x2'),_0x673e('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x673e('0x6')]}};
\ No newline at end of file
index 98e8fb9..ab57003 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd585=['stack','name','send','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error'];(function(_0x480bc8,_0x1fac40){var _0x28c245=function(_0x22a049){while(--_0x22a049){_0x480bc8['push'](_0x480bc8['shift']());}};_0x28c245(++_0x1fac40);}(_0xd585,0x146));var _0x5d58=function(_0xd93f3d,_0x408731){_0xd93f3d=_0xd93f3d-0x0;var _0x271402=_0xd585[_0xd93f3d];return _0x271402;};'use strict';var emlformat=require(_0x5d58('0x0'));var rimraf=require(_0x5d58('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5d58('0x2'));var rp=require(_0x5d58('0x3'));var moment=require('moment');var BPromise=require(_0x5d58('0x4'));var Mustache=require(_0x5d58('0x5'));var util=require('util');var path=require(_0x5d58('0x6'));var sox=require(_0x5d58('0x7'));var csv=require('to-csv');var ejs=require(_0x5d58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5d58('0x9'));var squel=require(_0x5d58('0xa'));var crypto=require(_0x5d58('0xb'));var jsforce=require(_0x5d58('0xc'));var deskjs=require(_0x5d58('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5d58('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5d58('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5d58('0x10'));var hardwareService=require(_0x5d58('0x11'));var logger=require(_0x5d58('0x12'))(_0x5d58('0x13'));var utils=require(_0x5d58('0x14'));var config=require(_0x5d58('0x15'));var licenseUtil=require(_0x5d58('0x16'));var db=require(_0x5d58('0x17'))['db'];function respondWithStatusCode(_0x35406f,_0x51cf52){_0x51cf52=_0x51cf52||0xcc;return function(_0x382f66){if(_0x382f66){return _0x35406f['sendStatus'](_0x51cf52);}return _0x35406f['status'](_0x51cf52)[_0x5d58('0x18')]();};}function respondWithResult(_0x4412be,_0x526cc3){_0x526cc3=_0x526cc3||0xc8;return function(_0x5df8d3){if(_0x5df8d3){return _0x4412be[_0x5d58('0x19')](_0x526cc3)[_0x5d58('0x1a')](_0x5df8d3);}};}function respondWithFilteredResult(_0x4a2209,_0x451ce4){return function(_0x2bd3f8){if(_0x2bd3f8){var _0xa2c904=typeof _0x451ce4[_0x5d58('0x1b')]==='undefined'&&typeof _0x451ce4[_0x5d58('0x1c')]==='undefined';var _0x44846a=_0x2bd3f8[_0x5d58('0x1d')];var _0x41c654=_0xa2c904?0x0:_0x451ce4[_0x5d58('0x1b')];var _0x499c05=_0xa2c904?_0x2bd3f8['count']:_0x451ce4['offset']+_0x451ce4['limit'];var _0x24e209;if(_0x499c05>=_0x44846a){_0x499c05=_0x44846a;_0x24e209=0xc8;}else{_0x24e209=0xce;}_0x4a2209[_0x5d58('0x19')](_0x24e209);return _0x4a2209[_0x5d58('0x1e')](_0x5d58('0x1f'),_0x41c654+'-'+_0x499c05+'/'+_0x44846a)['json'](_0x2bd3f8);}return null;};}function patchUpdates(_0x13763d){return function(_0x247b36){try{jsonpatch[_0x5d58('0x20')](_0x247b36,_0x13763d,!![]);}catch(_0x30eb17){return BPromise[_0x5d58('0x21')](_0x30eb17);}return _0x247b36['save']();};}function saveUpdates(_0x14111e,_0x581d92){return function(_0xca4a00){if(_0xca4a00){return _0xca4a00[_0x5d58('0x22')](_0x14111e)[_0x5d58('0x23')](function(_0x27ce52){return _0x27ce52;});}return null;};}function removeEntity(_0xe8d486,_0x135365){return function(_0x1dfddf){if(_0x1dfddf){return _0x1dfddf[_0x5d58('0x24')]()['then'](function(){_0xe8d486[_0x5d58('0x19')](0xcc)[_0x5d58('0x18')]();});}};}function handleEntityNotFound(_0x43196c,_0xfdb532){return function(_0x30cb8f){if(!_0x30cb8f){_0x43196c[_0x5d58('0x25')](0x194);}return _0x30cb8f;};}function handleError(_0x2746de,_0x122458){_0x122458=_0x122458||0x1f4;return function(_0x3c8f5b){logger[_0x5d58('0x26')](_0x3c8f5b[_0x5d58('0x27')]);if(_0x3c8f5b['name']){delete _0x3c8f5b[_0x5d58('0x28')];}_0x2746de[_0x5d58('0x19')](_0x122458)[_0x5d58('0x29')](_0x3c8f5b);};}exports['index']=function(_0x2cece0,_0x595aed){var _0x3ec8b6={},_0x450cef={},_0x3c5c73={'count':0x0,'rows':[]};var _0x107b5a=_[_0x5d58('0x2a')](db[_0x5d58('0x2b')][_0x5d58('0x2c')],function(_0x2fdba0){return{'name':_0x2fdba0[_0x5d58('0x2d')],'type':_0x2fdba0[_0x5d58('0x2e')][_0x5d58('0x2f')]};});_0x450cef[_0x5d58('0x30')]=_[_0x5d58('0x2a')](_0x107b5a,'name');_0x450cef[_0x5d58('0x31')]=_[_0x5d58('0x32')](_0x2cece0['query']);_0x450cef[_0x5d58('0x33')]=_['intersection'](_0x450cef['model'],_0x450cef[_0x5d58('0x31')]);_0x3ec8b6[_0x5d58('0x34')]=_[_0x5d58('0x35')](_0x450cef[_0x5d58('0x30')],qs[_0x5d58('0x36')](_0x2cece0[_0x5d58('0x31')][_0x5d58('0x36')]));_0x3ec8b6[_0x5d58('0x34')]=_0x3ec8b6['attributes'][_0x5d58('0x37')]?_0x3ec8b6[_0x5d58('0x34')]:_0x450cef[_0x5d58('0x30')];if(!_0x2cece0['query'][_0x5d58('0x38')](_0x5d58('0x39'))){_0x3ec8b6[_0x5d58('0x1c')]=qs[_0x5d58('0x1c')](_0x2cece0[_0x5d58('0x31')]['limit']);_0x3ec8b6[_0x5d58('0x1b')]=qs['offset'](_0x2cece0[_0x5d58('0x31')]['offset']);}_0x3ec8b6['order']=qs[_0x5d58('0x3a')](_0x2cece0['query'][_0x5d58('0x3a')]);_0x3ec8b6[_0x5d58('0x3b')]=qs[_0x5d58('0x33')](_[_0x5d58('0x3c')](_0x2cece0[_0x5d58('0x31')],_0x450cef[_0x5d58('0x33')]),_0x107b5a);if(_0x2cece0[_0x5d58('0x31')][_0x5d58('0x3d')]){_0x3ec8b6[_0x5d58('0x3b')]=_['merge'](_0x3ec8b6['where'],{'$or':_[_0x5d58('0x2a')](_0x107b5a,function(_0x2a7277){if(_0x2a7277[_0x5d58('0x2e')]!==_0x5d58('0x3e')){var _0x4f4470={};_0x4f4470[_0x2a7277[_0x5d58('0x28')]]={'$like':'%'+_0x2cece0[_0x5d58('0x31')][_0x5d58('0x3d')]+'%'};return _0x4f4470;}})});}_0x3ec8b6=_[_0x5d58('0x3f')]({},_0x3ec8b6,_0x2cece0[_0x5d58('0x40')]);var _0x180444={'where':_0x3ec8b6[_0x5d58('0x3b')]};return db[_0x5d58('0x2b')][_0x5d58('0x1d')](_0x180444)[_0x5d58('0x23')](function(_0xf98aee){_0x3c5c73[_0x5d58('0x1d')]=_0xf98aee;if(_0x2cece0[_0x5d58('0x31')][_0x5d58('0x41')]){_0x3ec8b6[_0x5d58('0x42')]=[{'all':!![]}];}return db[_0x5d58('0x2b')][_0x5d58('0x43')](_0x3ec8b6);})[_0x5d58('0x23')](function(_0x2ca8e8){_0x3c5c73['rows']=_0x2ca8e8;return _0x3c5c73;})[_0x5d58('0x23')](respondWithFilteredResult(_0x595aed,_0x3ec8b6))[_0x5d58('0x44')](handleError(_0x595aed,null));};exports[_0x5d58('0x45')]=function(_0x7ba4a2,_0x24a21d){var _0x234201={'raw':!![],'where':{'id':_0x7ba4a2[_0x5d58('0x46')]['id']}},_0x5871c4={};_0x5871c4['model']=_[_0x5d58('0x32')](db[_0x5d58('0x2b')]['rawAttributes']);_0x5871c4[_0x5d58('0x31')]=_[_0x5d58('0x32')](_0x7ba4a2[_0x5d58('0x31')]);_0x5871c4[_0x5d58('0x33')]=_[_0x5d58('0x35')](_0x5871c4['model'],_0x5871c4['query']);_0x234201[_0x5d58('0x34')]=_[_0x5d58('0x35')](_0x5871c4['model'],qs[_0x5d58('0x36')](_0x7ba4a2['query'][_0x5d58('0x36')]));_0x234201['attributes']=_0x234201[_0x5d58('0x34')][_0x5d58('0x37')]?_0x234201['attributes']:_0x5871c4[_0x5d58('0x30')];if(_0x7ba4a2[_0x5d58('0x31')][_0x5d58('0x41')]){_0x234201['include']=[{'all':!![]}];}_0x234201=_['merge']({},_0x234201,_0x7ba4a2[_0x5d58('0x40')]);return db['SalesforceField'][_0x5d58('0x47')](_0x234201)[_0x5d58('0x23')](handleEntityNotFound(_0x24a21d,null))['then'](respondWithResult(_0x24a21d,null))[_0x5d58('0x44')](handleError(_0x24a21d,null));};exports['create']=function(_0x21af1a,_0x24d121){return db[_0x5d58('0x2b')]['create'](_0x21af1a[_0x5d58('0x48')],{})[_0x5d58('0x23')](respondWithResult(_0x24d121,0xc9))[_0x5d58('0x44')](handleError(_0x24d121,null));};exports[_0x5d58('0x22')]=function(_0x31ea3d,_0x13a2e8){if(_0x31ea3d['body']['id']){delete _0x31ea3d[_0x5d58('0x48')]['id'];}return db[_0x5d58('0x2b')][_0x5d58('0x47')]({'where':{'id':_0x31ea3d[_0x5d58('0x46')]['id']}})[_0x5d58('0x23')](handleEntityNotFound(_0x13a2e8,null))[_0x5d58('0x23')](saveUpdates(_0x31ea3d[_0x5d58('0x48')],null))[_0x5d58('0x23')](respondWithResult(_0x13a2e8,null))[_0x5d58('0x44')](handleError(_0x13a2e8,null));};exports[_0x5d58('0x24')]=function(_0x574f11,_0x19ecb2){return db['SalesforceField']['find']({'where':{'id':_0x574f11[_0x5d58('0x46')]['id']}})[_0x5d58('0x23')](handleEntityNotFound(_0x19ecb2,null))[_0x5d58('0x23')](removeEntity(_0x19ecb2,null))['catch'](handleError(_0x19ecb2,null));};
\ No newline at end of file
+var _0xd18a=['apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','merge','filter','SalesforceField','includeAll','include','findAll','rows','catch','fields','options','find','create','body','params','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xd18a,0x106));var _0xad18=function(_0x13c9c8,_0x51d14d){_0x13c9c8=_0x13c9c8-0x0;var _0x39e0e2=_0xd18a[_0x13c9c8];return _0x39e0e2;};'use strict';var emlformat=require(_0xad18('0x0'));var rimraf=require(_0xad18('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xad18('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xad18('0x3'));var Mustache=require(_0xad18('0x4'));var util=require(_0xad18('0x5'));var path=require('path');var sox=require(_0xad18('0x6'));var csv=require(_0xad18('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad18('0x8'));var _=require(_0xad18('0x9'));var squel=require(_0xad18('0xa'));var crypto=require(_0xad18('0xb'));var jsforce=require(_0xad18('0xc'));var deskjs=require(_0xad18('0xd'));var toCsv=require(_0xad18('0x7'));var querystring=require(_0xad18('0xe'));var Papa=require(_0xad18('0xf'));var Redis=require('ioredis');var authService=require(_0xad18('0x10'));var qs=require(_0xad18('0x11'));var as=require(_0xad18('0x12'));var hardwareService=require(_0xad18('0x13'));var logger=require('../../config/logger')(_0xad18('0x14'));var utils=require(_0xad18('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xad18('0x16'));var db=require(_0xad18('0x17'))['db'];function respondWithStatusCode(_0x1fda28,_0x19c044){_0x19c044=_0x19c044||0xcc;return function(_0x307377){if(_0x307377){return _0x1fda28[_0xad18('0x18')](_0x19c044);}return _0x1fda28[_0xad18('0x19')](_0x19c044)[_0xad18('0x1a')]();};}function respondWithResult(_0x1ec538,_0x41ca0b){_0x41ca0b=_0x41ca0b||0xc8;return function(_0x448be7){if(_0x448be7){return _0x1ec538[_0xad18('0x19')](_0x41ca0b)[_0xad18('0x1b')](_0x448be7);}};}function respondWithFilteredResult(_0xc02630,_0x372a51){return function(_0x35c136){if(_0x35c136){var _0x45fa10=typeof _0x372a51[_0xad18('0x1c')]===_0xad18('0x1d')&&typeof _0x372a51[_0xad18('0x1e')]===_0xad18('0x1d');var _0x45fe01=_0x35c136[_0xad18('0x1f')];var _0x5d50e3=_0x45fa10?0x0:_0x372a51['offset'];var _0x18691a=_0x45fa10?_0x35c136['count']:_0x372a51['offset']+_0x372a51[_0xad18('0x1e')];var _0x1ccb13;if(_0x18691a>=_0x45fe01){_0x18691a=_0x45fe01;_0x1ccb13=0xc8;}else{_0x1ccb13=0xce;}_0xc02630[_0xad18('0x19')](_0x1ccb13);return _0xc02630[_0xad18('0x20')](_0xad18('0x21'),_0x5d50e3+'-'+_0x18691a+'/'+_0x45fe01)[_0xad18('0x1b')](_0x35c136);}return null;};}function patchUpdates(_0x16bc71){return function(_0x1bbd0e){try{jsonpatch[_0xad18('0x22')](_0x1bbd0e,_0x16bc71,!![]);}catch(_0x4b57d8){return BPromise[_0xad18('0x23')](_0x4b57d8);}return _0x1bbd0e[_0xad18('0x24')]();};}function saveUpdates(_0x5a4a6f,_0x39078a){return function(_0x495fee){if(_0x495fee){return _0x495fee[_0xad18('0x25')](_0x5a4a6f)[_0xad18('0x26')](function(_0x1e58c9){return _0x1e58c9;});}return null;};}function removeEntity(_0x50738e,_0x49c5be){return function(_0x336a9a){if(_0x336a9a){return _0x336a9a[_0xad18('0x27')]()[_0xad18('0x26')](function(){_0x50738e[_0xad18('0x19')](0xcc)[_0xad18('0x1a')]();});}};}function handleEntityNotFound(_0x3801ea,_0x504cdd){return function(_0x410ab6){if(!_0x410ab6){_0x3801ea[_0xad18('0x18')](0x194);}return _0x410ab6;};}function handleError(_0x77700,_0x5293aa){_0x5293aa=_0x5293aa||0x1f4;return function(_0x217c62){logger[_0xad18('0x28')](_0x217c62['stack']);if(_0x217c62[_0xad18('0x29')]){delete _0x217c62[_0xad18('0x29')];}_0x77700[_0xad18('0x19')](_0x5293aa)[_0xad18('0x2a')](_0x217c62);};}exports[_0xad18('0x2b')]=function(_0x5ffc81,_0x2f1cec){var _0x59a234={},_0x34a9d4={},_0x7bbc64={'count':0x0,'rows':[]};var _0xb16e54=_[_0xad18('0x2c')](db['SalesforceField'][_0xad18('0x2d')],function(_0x3307b6){return{'name':_0x3307b6[_0xad18('0x2e')],'type':_0x3307b6[_0xad18('0x2f')][_0xad18('0x30')]};});_0x34a9d4[_0xad18('0x31')]=_[_0xad18('0x2c')](_0xb16e54,'name');_0x34a9d4[_0xad18('0x32')]=_[_0xad18('0x33')](_0x5ffc81[_0xad18('0x32')]);_0x34a9d4[_0xad18('0x34')]=_[_0xad18('0x35')](_0x34a9d4[_0xad18('0x31')],_0x34a9d4['query']);_0x59a234['attributes']=_[_0xad18('0x35')](_0x34a9d4['model'],qs['fields'](_0x5ffc81[_0xad18('0x32')]['fields']));_0x59a234['attributes']=_0x59a234[_0xad18('0x36')][_0xad18('0x37')]?_0x59a234[_0xad18('0x36')]:_0x34a9d4[_0xad18('0x31')];if(!_0x5ffc81[_0xad18('0x32')]['hasOwnProperty'](_0xad18('0x38'))){_0x59a234[_0xad18('0x1e')]=qs['limit'](_0x5ffc81[_0xad18('0x32')][_0xad18('0x1e')]);_0x59a234[_0xad18('0x1c')]=qs['offset'](_0x5ffc81['query'][_0xad18('0x1c')]);}_0x59a234[_0xad18('0x39')]=qs['sort'](_0x5ffc81['query'][_0xad18('0x3a')]);_0x59a234[_0xad18('0x3b')]=qs[_0xad18('0x34')](_['pick'](_0x5ffc81[_0xad18('0x32')],_0x34a9d4[_0xad18('0x34')]),_0xb16e54);if(_0x5ffc81[_0xad18('0x32')]['filter']){_0x59a234[_0xad18('0x3b')]=_[_0xad18('0x3c')](_0x59a234['where'],{'$or':_[_0xad18('0x2c')](_0xb16e54,function(_0xeee56d){if(_0xeee56d[_0xad18('0x2f')]!=='VIRTUAL'){var _0x206e31={};_0x206e31[_0xeee56d[_0xad18('0x29')]]={'$like':'%'+_0x5ffc81['query'][_0xad18('0x3d')]+'%'};return _0x206e31;}})});}_0x59a234=_[_0xad18('0x3c')]({},_0x59a234,_0x5ffc81['options']);var _0x1a1683={'where':_0x59a234['where']};return db[_0xad18('0x3e')][_0xad18('0x1f')](_0x1a1683)[_0xad18('0x26')](function(_0x303ce5){_0x7bbc64[_0xad18('0x1f')]=_0x303ce5;if(_0x5ffc81[_0xad18('0x32')][_0xad18('0x3f')]){_0x59a234[_0xad18('0x40')]=[{'all':!![]}];}return db['SalesforceField'][_0xad18('0x41')](_0x59a234);})[_0xad18('0x26')](function(_0x4f6391){_0x7bbc64[_0xad18('0x42')]=_0x4f6391;return _0x7bbc64;})[_0xad18('0x26')](respondWithFilteredResult(_0x2f1cec,_0x59a234))[_0xad18('0x43')](handleError(_0x2f1cec,null));};exports['show']=function(_0x338e70,_0x2fe06b){var _0x1f4b82={'raw':!![],'where':{'id':_0x338e70['params']['id']}},_0x595641={};_0x595641['model']=_[_0xad18('0x33')](db['SalesforceField']['rawAttributes']);_0x595641[_0xad18('0x32')]=_[_0xad18('0x33')](_0x338e70[_0xad18('0x32')]);_0x595641[_0xad18('0x34')]=_[_0xad18('0x35')](_0x595641[_0xad18('0x31')],_0x595641[_0xad18('0x32')]);_0x1f4b82[_0xad18('0x36')]=_[_0xad18('0x35')](_0x595641['model'],qs[_0xad18('0x44')](_0x338e70[_0xad18('0x32')][_0xad18('0x44')]));_0x1f4b82[_0xad18('0x36')]=_0x1f4b82[_0xad18('0x36')]['length']?_0x1f4b82[_0xad18('0x36')]:_0x595641[_0xad18('0x31')];if(_0x338e70['query']['includeAll']){_0x1f4b82[_0xad18('0x40')]=[{'all':!![]}];}_0x1f4b82=_['merge']({},_0x1f4b82,_0x338e70[_0xad18('0x45')]);return db[_0xad18('0x3e')][_0xad18('0x46')](_0x1f4b82)[_0xad18('0x26')](handleEntityNotFound(_0x2fe06b,null))[_0xad18('0x26')](respondWithResult(_0x2fe06b,null))[_0xad18('0x43')](handleError(_0x2fe06b,null));};exports['create']=function(_0x167553,_0x590c59){return db[_0xad18('0x3e')][_0xad18('0x47')](_0x167553['body'],{})[_0xad18('0x26')](respondWithResult(_0x590c59,0xc9))[_0xad18('0x43')](handleError(_0x590c59,null));};exports[_0xad18('0x25')]=function(_0x3ff499,_0x520cc9){if(_0x3ff499[_0xad18('0x48')]['id']){delete _0x3ff499[_0xad18('0x48')]['id'];}return db[_0xad18('0x3e')][_0xad18('0x46')]({'where':{'id':_0x3ff499['params']['id']}})[_0xad18('0x26')](handleEntityNotFound(_0x520cc9,null))[_0xad18('0x26')](saveUpdates(_0x3ff499[_0xad18('0x48')],null))[_0xad18('0x26')](respondWithResult(_0x520cc9,null))[_0xad18('0x43')](handleError(_0x520cc9,null));};exports['destroy']=function(_0x45deb3,_0x17deff){return db[_0xad18('0x3e')][_0xad18('0x46')]({'where':{'id':_0x45deb3[_0xad18('0x49')]['id']}})[_0xad18('0x26')](handleEntityNotFound(_0x17deff,null))[_0xad18('0x26')](removeEntity(_0x17deff,null))['catch'](handleError(_0x17deff,null));};
\ No newline at end of file
index 1a45667..c041f5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7856=['SalesforceField','int_salesforce_fields','salesforce_unique_index','FieldId','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define'];(function(_0x3de39e,_0x3467c1){var _0x5be091=function(_0x1cdd65){while(--_0x1cdd65){_0x3de39e['push'](_0x3de39e['shift']());}};_0x5be091(++_0x3467c1);}(_0x7856,0x74));var _0x6785=function(_0x54a4f0,_0x13ea10){_0x54a4f0=_0x54a4f0-0x0;var _0x44f907=_0x7856[_0x54a4f0];return _0x44f907;};'use strict';var _=require('lodash');var util=require(_0x6785('0x0'));var logger=require(_0x6785('0x1'))(_0x6785('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6785('0x3'));var fs=require('fs');var path=require(_0x6785('0x4'));var rimraf=require(_0x6785('0x5'));var config=require(_0x6785('0x6'));var attributes=require(_0x6785('0x7'));module[_0x6785('0x8')]=function(_0x250e2d,_0x306c13){return _0x250e2d[_0x6785('0x9')](_0x6785('0xa'),attributes,{'tableName':_0x6785('0xb'),'paranoid':![],'indexes':[{'name':_0x6785('0xc'),'fields':['idField',_0x6785('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9fd4=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash'];(function(_0x56fc59,_0x1d808a){var _0x426b31=function(_0xcc23a8){while(--_0xcc23a8){_0x56fc59['push'](_0x56fc59['shift']());}};_0x426b31(++_0x1d808a);}(_0x9fd4,0x151));var _0x49fd=function(_0x5b8608,_0x527731){_0x5b8608=_0x5b8608-0x0;var _0x3f8d3d=_0x9fd4[_0x5b8608];return _0x3f8d3d;};'use strict';var _=require(_0x49fd('0x0'));var util=require(_0x49fd('0x1'));var logger=require(_0x49fd('0x2'))(_0x49fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x49fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x49fd('0x5'));var config=require(_0x49fd('0x6'));var attributes=require(_0x49fd('0x7'));module[_0x49fd('0x8')]=function(_0x5b5bbc,_0x33efa4){return _0x5b5bbc['define'](_0x49fd('0x9'),attributes,{'tableName':_0x49fd('0xa'),'paranoid':![],'indexes':[{'name':_0x49fd('0xb'),'fields':[_0x49fd('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 8f86684..c5b3d89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b7b=['randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','request\x20sent','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird'];(function(_0x2a7066,_0x279e23){var _0x21814e=function(_0x3925a5){while(--_0x3925a5){_0x2a7066['push'](_0x2a7066['shift']());}};_0x21814e(++_0x279e23);}(_0x2b7b,0x100));var _0xb2b7=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x2b7b[_0x599e60];return _0x468e19;};'use strict';var _=require(_0xb2b7('0x0'));var util=require(_0xb2b7('0x1'));var moment=require(_0xb2b7('0x2'));var BPromise=require(_0xb2b7('0x3'));var rs=require(_0xb2b7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb2b7('0x5'));var logger=require(_0xb2b7('0x6'))(_0xb2b7('0x7'));var config=require(_0xb2b7('0x8'));var jayson=require(_0xb2b7('0x9'));var client=jayson[_0xb2b7('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1dadf9,_0x399316,_0x2c7d6a){return new BPromise(function(_0x156191,_0x17ac48){return client['request'](_0x1dadf9,_0x2c7d6a)['then'](function(_0x332087){logger[_0xb2b7('0xb')]('SalesforceField,\x20%s,\x20%s',_0x399316,_0xb2b7('0xc'));logger['debug'](_0xb2b7('0xd'),_0x399316,_0xb2b7('0xc'),JSON[_0xb2b7('0xe')](_0x332087));if(_0x332087['error']){if(_0x332087[_0xb2b7('0xf')][_0xb2b7('0x10')]===0x1f4){logger[_0xb2b7('0xf')](_0xb2b7('0x11'),_0x399316,_0x332087[_0xb2b7('0xf')][_0xb2b7('0x12')]);return _0x17ac48(_0x332087[_0xb2b7('0xf')][_0xb2b7('0x12')]);}logger[_0xb2b7('0xf')](_0xb2b7('0x11'),_0x399316,_0x332087[_0xb2b7('0xf')][_0xb2b7('0x12')]);return _0x156191(_0x332087[_0xb2b7('0xf')][_0xb2b7('0x12')]);}else{logger[_0xb2b7('0xb')](_0xb2b7('0x11'),_0x399316,_0xb2b7('0xc'));_0x156191(_0x332087['result'][_0xb2b7('0x12')]);}})[_0xb2b7('0x13')](function(_0xbfeaed){logger[_0xb2b7('0xf')](_0xb2b7('0x11'),_0x399316,_0xbfeaed);_0x17ac48(_0xbfeaed);});});}
\ No newline at end of file
+var _0x2485=['../../config/logger','../../config/environment','client','request','then','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x15abc6,_0x40eeb5){var _0x20b05b=function(_0x365802){while(--_0x365802){_0x15abc6['push'](_0x15abc6['shift']());}};_0x20b05b(++_0x40eeb5);}(_0x2485,0x1b1));var _0x5248=function(_0x543eac,_0x3a39a1){_0x543eac=_0x543eac-0x0;var _0x16c036=_0x2485[_0x543eac];return _0x16c036;};'use strict';var _=require(_0x5248('0x0'));var util=require('util');var moment=require(_0x5248('0x1'));var BPromise=require(_0x5248('0x2'));var rs=require(_0x5248('0x3'));var fs=require('fs');var Redis=require(_0x5248('0x4'));var db=require(_0x5248('0x5'))['db'];var utils=require(_0x5248('0x6'));var logger=require(_0x5248('0x7'))('rpc');var config=require(_0x5248('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5248('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf77b1a,_0x59d018,_0x59b051){return new BPromise(function(_0x90d3b,_0x289985){return client[_0x5248('0xa')](_0xf77b1a,_0x59b051)[_0x5248('0xb')](function(_0x205ce3){logger['info'](_0x5248('0xc'),_0x59d018,_0x5248('0xd'));logger[_0x5248('0xe')](_0x5248('0xf'),_0x59d018,'request\x20sent',JSON['stringify'](_0x205ce3));if(_0x205ce3[_0x5248('0x10')]){if(_0x205ce3[_0x5248('0x10')][_0x5248('0x11')]===0x1f4){logger[_0x5248('0x10')]('SalesforceField,\x20%s,\x20%s',_0x59d018,_0x205ce3['error'][_0x5248('0x12')]);return _0x289985(_0x205ce3[_0x5248('0x10')][_0x5248('0x12')]);}logger[_0x5248('0x10')](_0x5248('0xc'),_0x59d018,_0x205ce3[_0x5248('0x10')]['message']);return _0x90d3b(_0x205ce3[_0x5248('0x10')][_0x5248('0x12')]);}else{logger[_0x5248('0x13')]('SalesforceField,\x20%s,\x20%s',_0x59d018,_0x5248('0xd'));_0x90d3b(_0x205ce3[_0x5248('0x14')]['message']);}})[_0x5248('0x15')](function(_0x54bf58){logger['error']('SalesforceField,\x20%s,\x20%s',_0x59d018,_0x54bf58);_0x289985(_0x54bf58);});});}
\ No newline at end of file
index b1b2b4d..d8a6e16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f73=['isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get'];(function(_0x8b0f43,_0x1c57b8){var _0x3f4425=function(_0x16e59a){while(--_0x16e59a){_0x8b0f43['push'](_0x8b0f43['shift']());}};_0x3f4425(++_0x1c57b8);}(_0x8f73,0x79));var _0x38f7=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x8f73[_0x24061a];return _0x82054e;};'use strict';var multer=require(_0x38f7('0x0'));var util=require(_0x38f7('0x1'));var path=require(_0x38f7('0x2'));var timeout=require(_0x38f7('0x3'));var express=require(_0x38f7('0x4'));var router=express[_0x38f7('0x5')]();var fs_extra=require(_0x38f7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x38f7('0x7'));var config=require(_0x38f7('0x8'));var controller=require(_0x38f7('0x9'));router[_0x38f7('0xa')]('/',auth[_0x38f7('0xb')](),controller['index']);router[_0x38f7('0xa')](_0x38f7('0xc'),auth['isAuthenticated'](),controller[_0x38f7('0xd')]);router[_0x38f7('0xa')](_0x38f7('0xe'),auth[_0x38f7('0xb')](),controller['getConfigurations']);router[_0x38f7('0xa')](_0x38f7('0xf'),auth[_0x38f7('0xb')](),controller[_0x38f7('0x10')]);router[_0x38f7('0x11')]('/',auth['isAuthenticated'](),controller[_0x38f7('0x12')]);router[_0x38f7('0x11')](_0x38f7('0xe'),auth[_0x38f7('0xb')](),controller[_0x38f7('0x13')]);router['put'](_0x38f7('0xc'),auth[_0x38f7('0xb')](),controller[_0x38f7('0x14')]);router[_0x38f7('0x15')](_0x38f7('0xc'),auth[_0x38f7('0xb')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xa900=['./intServicenowAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xa900,0x101));var _0x0a90=function(_0x29f6f8,_0x370292){_0x29f6f8=_0x29f6f8-0x0;var _0x379929=_0xa900[_0x29f6f8];return _0x379929;};'use strict';var multer=require(_0x0a90('0x0'));var util=require(_0x0a90('0x1'));var path=require(_0x0a90('0x2'));var timeout=require(_0x0a90('0x3'));var express=require(_0x0a90('0x4'));var router=express[_0x0a90('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0a90('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a90('0x7'));router[_0x0a90('0x8')]('/',auth[_0x0a90('0x9')](),controller[_0x0a90('0xa')]);router['get'](_0x0a90('0xb'),auth[_0x0a90('0x9')](),controller[_0x0a90('0xc')]);router['get'](_0x0a90('0xd'),auth[_0x0a90('0x9')](),controller[_0x0a90('0xe')]);router['get'](_0x0a90('0xf'),auth['isAuthenticated'](),controller[_0x0a90('0x10')]);router[_0x0a90('0x11')]('/',auth['isAuthenticated'](),controller[_0x0a90('0x12')]);router[_0x0a90('0x11')](_0x0a90('0xd'),auth[_0x0a90('0x9')](),controller[_0x0a90('0x13')]);router[_0x0a90('0x14')](_0x0a90('0xb'),auth[_0x0a90('0x9')](),controller[_0x0a90('0x15')]);router[_0x0a90('0x16')](_0x0a90('0xb'),auth[_0x0a90('0x9')](),controller[_0x0a90('0x17')]);module['exports']=router;
\ No newline at end of file
index 492641e..1566c29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f21=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0x8f21,0x74));var _0x18f2=function(_0xd3a734,_0x218ec1){_0xd3a734=_0xd3a734-0x0;var _0x55b88b=_0x8f21[_0xd3a734];return _0x55b88b;};'use strict';var Sequelize=require(_0x18f2('0x0'));module[_0x18f2('0x1')]={'name':{'type':Sequelize[_0x18f2('0x2')]},'description':{'type':Sequelize[_0x18f2('0x2')]},'username':{'type':Sequelize[_0x18f2('0x2')],'unique':_0x18f2('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x18f2('0x2')]},'remoteUri':{'type':Sequelize[_0x18f2('0x2')],'unique':_0x18f2('0x4')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xc8db=['sequelize','exports','STRING','remoteUri'];(function(_0x129534,_0x560a44){var _0x430eb4=function(_0x3454ab){while(--_0x3454ab){_0x129534['push'](_0x129534['shift']());}};_0x430eb4(++_0x560a44);}(_0xc8db,0x150));var _0xbc8d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc8db[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0xbc8d('0x0'));module[_0xbc8d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbc8d('0x2')]},'username':{'type':Sequelize[_0xbc8d('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xbc8d('0x2')],'unique':_0xbc8d('0x3')},'serverUrl':{'type':Sequelize[_0xbc8d('0x2')],'allowNull':![]}};
\ No newline at end of file
index 1bd2897..7070486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eb2=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','map','ServicenowAccount','rawAttributes','type','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','update','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','made_sla','knowledge','subcategory','close_code','incident_state','category','caused_by','watch_list','sys_updated_on','hold_reason','number','resolved_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','delivery_plan','impact','active','work_notes_list','business_service','time_worked','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','closed_by','parent_incident','sys_id','contact_type','reopened_by','problem_id','reassignment_count','assigned_to','severity','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','password','incident?sysparm_display_value=all','result','log','assign','remove','includes','internalType','push','all','forEach','ServiceNow\x20error:\x20','statusCode','test','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','crypto'];(function(_0x55a8b7,_0xe2cfc){var _0x95cb76=function(_0x16204e){while(--_0x16204e){_0x55a8b7['push'](_0x55a8b7['shift']());}};_0x95cb76(++_0xe2cfc);}(_0x6eb2,0xa9));var _0x26eb=function(_0x8f4ca2,_0xc4ac52){_0x8f4ca2=_0x8f4ca2-0x0;var _0x126663=_0x6eb2[_0x8f4ca2];return _0x126663;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x26eb('0x0'));var jsonpatch=require(_0x26eb('0x1'));var rp=require(_0x26eb('0x2'));var moment=require(_0x26eb('0x3'));var BPromise=require(_0x26eb('0x4'));var Mustache=require(_0x26eb('0x5'));var util=require(_0x26eb('0x6'));var path=require(_0x26eb('0x7'));var sox=require(_0x26eb('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x26eb('0x9'));var jsforce=require(_0x26eb('0xa'));var deskjs=require(_0x26eb('0xb'));var toCsv=require(_0x26eb('0xc'));var querystring=require(_0x26eb('0xd'));var Papa=require(_0x26eb('0xe'));var Redis=require(_0x26eb('0xf'));var authService=require(_0x26eb('0x10'));var qs=require(_0x26eb('0x11'));var as=require(_0x26eb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x26eb('0x13'));var utils=require('../../config/utils');var config=require(_0x26eb('0x14'));var licenseUtil=require(_0x26eb('0x15'));var db=require(_0x26eb('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2cac13,_0x1c5a54){_0x1c5a54=_0x1c5a54||0xcc;return function(_0xad6cb){if(_0xad6cb){return _0x2cac13[_0x26eb('0x17')](_0x1c5a54);}return _0x2cac13[_0x26eb('0x18')](_0x1c5a54)['end']();};}function respondWithResult(_0x3c98e4,_0x224633){_0x224633=_0x224633||0xc8;return function(_0x2a9071){if(_0x2a9071){return _0x3c98e4[_0x26eb('0x18')](_0x224633)[_0x26eb('0x19')](_0x2a9071);}};}function respondWithFilteredResult(_0x24ba61,_0x3a4b5c){return function(_0x5b6744){if(_0x5b6744){var _0x56e643=typeof _0x3a4b5c[_0x26eb('0x1a')]===_0x26eb('0x1b')&&typeof _0x3a4b5c[_0x26eb('0x1c')]===_0x26eb('0x1b');var _0x35e96a=_0x5b6744['count'];var _0x369d95=_0x56e643?0x0:_0x3a4b5c[_0x26eb('0x1a')];var _0x58f168=_0x56e643?_0x5b6744[_0x26eb('0x1d')]:_0x3a4b5c[_0x26eb('0x1a')]+_0x3a4b5c[_0x26eb('0x1c')];var _0x262366;if(_0x58f168>=_0x35e96a){_0x58f168=_0x35e96a;_0x262366=0xc8;}else{_0x262366=0xce;}_0x24ba61[_0x26eb('0x18')](_0x262366);return _0x24ba61[_0x26eb('0x1e')](_0x26eb('0x1f'),_0x369d95+'-'+_0x58f168+'/'+_0x35e96a)[_0x26eb('0x19')](_0x5b6744);}return null;};}function patchUpdates(_0x14610d){return function(_0x5a95f7){try{jsonpatch[_0x26eb('0x20')](_0x5a95f7,_0x14610d,!![]);}catch(_0x27d198){return BPromise[_0x26eb('0x21')](_0x27d198);}return _0x5a95f7['save']();};}function saveUpdates(_0x50fdf9,_0x30b807){return function(_0x3314b6){if(_0x3314b6){return _0x3314b6['update'](_0x50fdf9)[_0x26eb('0x22')](function(_0x1c0cac){return _0x1c0cac;});}return null;};}function removeEntity(_0xb70161,_0x16fa34){return function(_0xc8bb7a){if(_0xc8bb7a){return _0xc8bb7a[_0x26eb('0x23')]()['then'](function(){_0xb70161['status'](0xcc)[_0x26eb('0x24')]();});}};}function handleEntityNotFound(_0x1d9d01,_0x5723ee){return function(_0x1e8394){if(!_0x1e8394){_0x1d9d01[_0x26eb('0x17')](0x194);}return _0x1e8394;};}function handleError(_0x67b2,_0x18114c){_0x18114c=_0x18114c||0x1f4;return function(_0x2053bf){logger[_0x26eb('0x25')](_0x2053bf[_0x26eb('0x26')]);if(_0x2053bf[_0x26eb('0x27')]){delete _0x2053bf[_0x26eb('0x27')];}_0x67b2[_0x26eb('0x18')](_0x18114c)[_0x26eb('0x28')](_0x2053bf);};}exports[_0x26eb('0x29')]=function(_0x1940eb,_0x4d9d2e){var _0x2f29a4={},_0x28a758={},_0x32c7a9={'count':0x0,'rows':[]};var _0x3c9d1c=_[_0x26eb('0x2a')](db[_0x26eb('0x2b')][_0x26eb('0x2c')],function(_0x488967){return{'name':_0x488967['fieldName'],'type':_0x488967[_0x26eb('0x2d')]['key']};});_0x28a758['model']=_[_0x26eb('0x2a')](_0x3c9d1c,_0x26eb('0x27'));_0x28a758['query']=_[_0x26eb('0x2e')](_0x1940eb['query']);_0x28a758[_0x26eb('0x2f')]=_[_0x26eb('0x30')](_0x28a758[_0x26eb('0x31')],_0x28a758[_0x26eb('0x32')]);_0x2f29a4[_0x26eb('0x33')]=_['intersection'](_0x28a758['model'],qs[_0x26eb('0x34')](_0x1940eb[_0x26eb('0x32')][_0x26eb('0x34')]));_0x2f29a4[_0x26eb('0x33')]=_0x2f29a4['attributes'][_0x26eb('0x35')]?_0x2f29a4[_0x26eb('0x33')]:_0x28a758[_0x26eb('0x31')];if(!_0x1940eb[_0x26eb('0x32')][_0x26eb('0x36')](_0x26eb('0x37'))){_0x2f29a4[_0x26eb('0x1c')]=qs[_0x26eb('0x1c')](_0x1940eb[_0x26eb('0x32')]['limit']);_0x2f29a4[_0x26eb('0x1a')]=qs[_0x26eb('0x1a')](_0x1940eb['query'][_0x26eb('0x1a')]);}_0x2f29a4[_0x26eb('0x38')]=qs[_0x26eb('0x39')](_0x1940eb[_0x26eb('0x32')]['sort']);_0x2f29a4[_0x26eb('0x3a')]=qs[_0x26eb('0x2f')](_[_0x26eb('0x3b')](_0x1940eb['query'],_0x28a758['filters']),_0x3c9d1c);if(_0x1940eb[_0x26eb('0x32')]['filter']){_0x2f29a4[_0x26eb('0x3a')]=_[_0x26eb('0x3c')](_0x2f29a4[_0x26eb('0x3a')],{'$or':_['map'](_0x3c9d1c,function(_0x5e3cee){if(_0x5e3cee[_0x26eb('0x2d')]!=='VIRTUAL'){var _0x2061a3={};_0x2061a3[_0x5e3cee['name']]={'$like':'%'+_0x1940eb[_0x26eb('0x32')][_0x26eb('0x3d')]+'%'};return _0x2061a3;}})});}_0x2f29a4=_[_0x26eb('0x3c')]({},_0x2f29a4,_0x1940eb[_0x26eb('0x3e')]);var _0x1531f1={'where':_0x2f29a4['where']};return db[_0x26eb('0x2b')][_0x26eb('0x1d')](_0x1531f1)[_0x26eb('0x22')](function(_0x149c20){_0x32c7a9[_0x26eb('0x1d')]=_0x149c20;if(_0x1940eb['query'][_0x26eb('0x3f')]){_0x2f29a4['include']=[{'all':!![]}];}return db[_0x26eb('0x2b')][_0x26eb('0x40')](_0x2f29a4);})[_0x26eb('0x22')](function(_0x18364d){_0x32c7a9[_0x26eb('0x41')]=_0x18364d;return _0x32c7a9;})['then'](respondWithFilteredResult(_0x4d9d2e,_0x2f29a4))[_0x26eb('0x42')](handleError(_0x4d9d2e,null));};exports[_0x26eb('0x43')]=function(_0x11ad82,_0x114844){var _0x2692f8={'raw':![],'where':{'id':_0x11ad82[_0x26eb('0x44')]['id']}},_0x4848c8={};_0x4848c8[_0x26eb('0x31')]=_[_0x26eb('0x2e')](db[_0x26eb('0x2b')][_0x26eb('0x2c')]);_0x4848c8['query']=_[_0x26eb('0x2e')](_0x11ad82[_0x26eb('0x32')]);_0x4848c8[_0x26eb('0x2f')]=_[_0x26eb('0x30')](_0x4848c8[_0x26eb('0x31')],_0x4848c8[_0x26eb('0x32')]);_0x2692f8[_0x26eb('0x33')]=_[_0x26eb('0x30')](_0x4848c8[_0x26eb('0x31')],qs[_0x26eb('0x34')](_0x11ad82[_0x26eb('0x32')][_0x26eb('0x34')]));_0x2692f8[_0x26eb('0x33')]=_0x2692f8['attributes'][_0x26eb('0x35')]?_0x2692f8['attributes']:_0x4848c8[_0x26eb('0x31')];if(_0x11ad82[_0x26eb('0x32')]['includeAll']){_0x2692f8[_0x26eb('0x45')]=[{'all':!![]}];}_0x2692f8=_[_0x26eb('0x3c')]({},_0x2692f8,_0x11ad82[_0x26eb('0x3e')]);return db[_0x26eb('0x2b')][_0x26eb('0x46')](_0x2692f8)[_0x26eb('0x22')](handleEntityNotFound(_0x114844,null))['then'](respondWithResult(_0x114844,null))[_0x26eb('0x42')](handleError(_0x114844,null));};exports[_0x26eb('0x47')]=function(_0x96c756,_0x29e92e){return db['ServicenowAccount'][_0x26eb('0x47')](_0x96c756['body'],{})[_0x26eb('0x22')](respondWithResult(_0x29e92e,0xc9))['catch'](handleError(_0x29e92e,null));};exports[_0x26eb('0x48')]=function(_0x3ac8e5,_0x2b2a94){if(_0x3ac8e5[_0x26eb('0x49')]['id']){delete _0x3ac8e5[_0x26eb('0x49')]['id'];}return db['ServicenowAccount'][_0x26eb('0x46')]({'where':{'id':_0x3ac8e5[_0x26eb('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b2a94,null))[_0x26eb('0x22')](saveUpdates(_0x3ac8e5[_0x26eb('0x49')],null))[_0x26eb('0x22')](respondWithResult(_0x2b2a94,null))[_0x26eb('0x42')](handleError(_0x2b2a94,null));};exports[_0x26eb('0x23')]=function(_0x5863cb,_0x4e46a1){return db[_0x26eb('0x2b')]['find']({'where':{'id':_0x5863cb[_0x26eb('0x44')]['id']}})[_0x26eb('0x22')](handleEntityNotFound(_0x4e46a1,null))[_0x26eb('0x22')](removeEntity(_0x4e46a1,null))[_0x26eb('0x42')](handleError(_0x4e46a1,null));};exports[_0x26eb('0x4a')]=function(_0x535d98,_0x50bdcb,_0x261c3a){var _0x445b22={};var _0x185154={};var _0x2e8c56;var _0x586316;return db[_0x26eb('0x2b')][_0x26eb('0x4b')]({'where':{'id':_0x535d98[_0x26eb('0x44')]['id']}})[_0x26eb('0x22')](handleEntityNotFound(_0x50bdcb,null))['then'](function(_0x48bb65){if(_0x48bb65){_0x2e8c56=_0x48bb65;_0x185154[_0x26eb('0x31')]=_[_0x26eb('0x2e')](db[_0x26eb('0x4c')][_0x26eb('0x2c')]);_0x185154[_0x26eb('0x32')]=_[_0x26eb('0x2e')](_0x535d98[_0x26eb('0x32')]);_0x185154['filters']=_[_0x26eb('0x30')](_0x185154[_0x26eb('0x31')],_0x185154['query']);_0x445b22['attributes']=_['intersection'](_0x185154[_0x26eb('0x31')],qs[_0x26eb('0x34')](_0x535d98[_0x26eb('0x32')]['fields']));_0x445b22[_0x26eb('0x33')]=_0x445b22['attributes'][_0x26eb('0x35')]?_0x445b22[_0x26eb('0x33')]:_0x185154[_0x26eb('0x31')];_0x445b22[_0x26eb('0x38')]=qs[_0x26eb('0x39')](_0x535d98[_0x26eb('0x32')]['sort']);_0x445b22[_0x26eb('0x3a')]=qs[_0x26eb('0x2f')](_[_0x26eb('0x3b')](_0x535d98[_0x26eb('0x32')],_0x185154['filters']));if(_0x535d98[_0x26eb('0x32')]['filter']){_0x445b22[_0x26eb('0x3a')]=_['merge'](_0x445b22[_0x26eb('0x3a')],{'$or':_[_0x26eb('0x2a')](_0x445b22[_0x26eb('0x33')],function(_0x4bb23a){var _0x3299f5={};_0x3299f5[_0x4bb23a]={'$like':'%'+_0x535d98[_0x26eb('0x32')][_0x26eb('0x3d')]+'%'};return _0x3299f5;})});}_0x445b22=_[_0x26eb('0x3c')]({},_0x445b22,_0x535d98[_0x26eb('0x3e')]);return _0x2e8c56[_0x26eb('0x4a')](_0x445b22);}})[_0x26eb('0x22')](function(_0x44268f){if(_0x44268f){_0x586316=_0x44268f[_0x26eb('0x35')];if(!_0x535d98['query']['hasOwnProperty'](_0x26eb('0x37'))){_0x445b22[_0x26eb('0x1c')]=qs[_0x26eb('0x1c')](_0x535d98[_0x26eb('0x32')][_0x26eb('0x1c')]);_0x445b22[_0x26eb('0x1a')]=qs[_0x26eb('0x1a')](_0x535d98[_0x26eb('0x32')][_0x26eb('0x1a')]);}return _0x2e8c56[_0x26eb('0x4a')](_0x445b22);}})[_0x26eb('0x22')](function(_0x3681c1){if(_0x3681c1){return _0x3681c1?{'count':_0x586316,'rows':_0x3681c1}:null;}})[_0x26eb('0x22')](respondWithResult(_0x50bdcb,null))[_0x26eb('0x42')](handleError(_0x50bdcb,null));};exports[_0x26eb('0x4d')]=function(_0x25b5be,_0x2ffa34,_0x30eec2){if(_0x25b5be['body']['id']){delete _0x25b5be[_0x26eb('0x49')]['id'];}return db[_0x26eb('0x2b')][_0x26eb('0x4b')]({'where':{'id':_0x25b5be[_0x26eb('0x44')]['id']}})[_0x26eb('0x22')](handleEntityNotFound(_0x2ffa34,null))['then'](function(_0x4e2d3b){if(_0x4e2d3b){_0x25b5be[_0x26eb('0x49')][_0x26eb('0x4e')]=_0x4e2d3b['id'];_0x25b5be[_0x26eb('0x49')][_0x26eb('0x4f')]=integrations[_0x26eb('0x50')](_0x25b5be[_0x26eb('0x49')][_0x26eb('0x51')],_0x25b5be[_0x26eb('0x49')][_0x26eb('0x2d')]);_0x25b5be[_0x26eb('0x49')][_0x26eb('0x52')]=integrations['getDescriptions'](_0x25b5be['body']['channel'],_0x25b5be[_0x26eb('0x49')][_0x26eb('0x2d')]);return db[_0x26eb('0x4c')][_0x26eb('0x47')](_0x25b5be[_0x26eb('0x49')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0x26eb('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x2ffa34,null))['catch'](handleError(_0x2ffa34,null));};exports['getFields']=function(_0x399d0a,_0x1557c5,_0x1b3920){var _0x3827eb=[_0x26eb('0x54'),'hold_reason',_0x26eb('0x55'),_0x26eb('0x56'),_0x26eb('0x57'),'notify',_0x26eb('0x58'),'severity',_0x26eb('0x59')];var _0x10bdba=['parent',_0x26eb('0x54'),_0x26eb('0x5a'),_0x26eb('0x5b'),'upon_reject',_0x26eb('0x5c'),'child_incidents',_0x26eb('0x5d'),'approval_history',_0x26eb('0x5e'),_0x26eb('0x5f'),'sys_updated_by',_0x26eb('0x60'),_0x26eb('0x61'),_0x26eb('0x62'),'sys_domain',_0x26eb('0x63'),_0x26eb('0x64'),_0x26eb('0x55'),_0x26eb('0x38'),_0x26eb('0x65'),_0x26eb('0x66'),'cmdb_ci',_0x26eb('0x67'),_0x26eb('0x68'),_0x26eb('0x69'),_0x26eb('0x6a'),_0x26eb('0x6b'),'priority','sys_domain_path','rfc',_0x26eb('0x6c'),'expected_start','opened_at',_0x26eb('0x6d'),_0x26eb('0x6e'),_0x26eb('0x6f'),_0x26eb('0x70'),_0x26eb('0x71'),_0x26eb('0x72'),_0x26eb('0x73'),'subcategory',_0x26eb('0x74'),_0x26eb('0x75'),_0x26eb('0x57'),_0x26eb('0x76'),_0x26eb('0x77'),_0x26eb('0x78'),_0x26eb('0x79'),_0x26eb('0x7a'),_0x26eb('0x7b'),_0x26eb('0x7c'),_0x26eb('0x7d'),_0x26eb('0x7e'),_0x26eb('0x7f'),'close_notes',_0x26eb('0x80'),'follow_up',_0x26eb('0x81'),_0x26eb('0x82'),_0x26eb('0x83'),_0x26eb('0x84'),_0x26eb('0x58'),'urgency',_0x26eb('0x85'),'company',_0x26eb('0x86'),'activity_due',_0x26eb('0x87'),_0x26eb('0x88'),'comments','sla_due',_0x26eb('0x89'),_0x26eb('0x8a'),_0x26eb('0x8b'),_0x26eb('0x8c'),_0x26eb('0x8d'),_0x26eb('0x8e'),_0x26eb('0x8f'),_0x26eb('0x90'),_0x26eb('0x91'),_0x26eb('0x92'),_0x26eb('0x59')];var _0x352947='';var _0x35836b='';var _0x23646e=[];var _0x13bda9='';var _0x2573ea='';var _0x21f4ee=[];var _0x302ca0='';var _0x8b377f='';var _0x5ba2ab={};var _0x51a1ad='';return db[_0x26eb('0x2b')][_0x26eb('0x4b')]({'where':{'id':_0x399d0a[_0x26eb('0x44')]['id']},'attributes':['id',_0x26eb('0x93'),'password','email','remoteUri',_0x26eb('0x94')]})[_0x26eb('0x22')](handleEntityNotFound(_0x1557c5,null))[_0x26eb('0x22')](function(_0x24f96a){if(_0x24f96a){_0x51a1ad=_0x24f96a[_0x26eb('0x95')];var _0x366a77=_0x51a1ad[_0x26eb('0x96')](-0x1);if(_0x366a77==='/'){_0x51a1ad=_0x51a1ad[_0x26eb('0x97')](0x0,_0x51a1ad[_0x26eb('0x98')](_0x366a77));}_0x8b377f=util[_0x26eb('0x99')](_0x26eb('0x9a'),_0x51a1ad);_0x302ca0=util[_0x26eb('0x99')](_0x26eb('0x9b'),_0x51a1ad);_0x5ba2ab={'user':_0x24f96a[_0x26eb('0x93')],'pass':_0x24f96a[_0x26eb('0x9c')]};var _0xd670f6={'method':'GET','uri':_0x8b377f+_0x26eb('0x9d'),'auth':_0x5ba2ab,'json':!![]};return rp(_0xd670f6);}})[_0x26eb('0x22')](function(_0x4a5c55){if(_0x4a5c55[_0x26eb('0x9e')]['length']>0x0){_0x352947=_0x4a5c55[_0x26eb('0x9e')];}console[_0x26eb('0x9f')]('incident\x20table\x20objects',_0x352947);_0x21f4ee=[];_0x35836b=Object[_0x26eb('0xa0')]([],_0x352947);_[_0x26eb('0xa1')](_0x35836b,function(_0x562838){return!_0x3827eb[_0x26eb('0xa2')](_0x562838['name']);});_0x35836b['forEach'](function(_0x1eb86f){var _0x3adcc3=createFieldObject(_0x302ca0,_0x5ba2ab,_0x1eb86f[_0x26eb('0xa3')],_0x1eb86f['name'],_0x1eb86f['label'],![]);_0x21f4ee[_0x26eb('0xa4')](_0x3adcc3);});return Promise[_0x26eb('0xa5')](_0x21f4ee);})['then'](function(_0x1cca1a){_0x23646e=_0x1cca1a;_0x13bda9=Object[_0x26eb('0xa0')]([],_0x352947);console[_0x26eb('0x9f')]('TCL:\x20_object',_0x352947);_[_0x26eb('0xa1')](_0x13bda9,function(_0x385475){return _0x10bdba[_0x26eb('0xa2')](_0x385475[_0x26eb('0x27')]);});console[_0x26eb('0x9f')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x13bda9);_0x21f4ee=[];_0x13bda9[_0x26eb('0xa6')](function(_0x40289e){var _0x41bd11=createFieldObject(_0x302ca0,_0x5ba2ab,_0x40289e[_0x26eb('0xa3')],_0x40289e[_0x26eb('0x27')],_0x40289e['label'],!![]);_0x21f4ee['push'](_0x41bd11);});return Promise[_0x26eb('0xa5')](_0x21f4ee);})[_0x26eb('0x22')](function(_0x250668){_0x2573ea=_0x250668;var _0x10853a=_0x23646e['concat'](_0x2573ea);return{'count':_0x10853a['length'],'rows':_0x10853a};})[_0x26eb('0x22')](respondWithResult(_0x1557c5,null))['catch'](function(_0x80a35){console[_0x26eb('0x9f')](_0x26eb('0xa7')+_0x80a35);var _0x51fc21=_0x399d0a[_0x26eb('0x32')]['test']?0x1f4:_0x80a35[_0x26eb('0xa8')]||0x1f4;logger[_0x26eb('0x25')](_0x80a35[_0x26eb('0x26')]);delete _0x80a35[_0x26eb('0x27')];if(_0x51fc21===0x191){_0x51fc21=0x190;}_0x1557c5['status'](_0x51fc21)['send'](_0x399d0a[_0x26eb('0x32')][_0x26eb('0xa9')]?{'message':_0x26eb('0xaa'),'statusCode':_0x80a35['statusCode']}:_0x80a35);});};function createFieldObject(_0x2c34a6,_0x43b9d6,_0x8cc6be,_0x2fa22c,_0x496649,_0x2b1b63){return new Promise(function(_0x40c6e7,_0x5ad6fc){var _0x53e943={'id':_0x2fa22c,'name':_0x496649,'custom':_0x2b1b63};if(_0x8cc6be===_0x26eb('0xab')){_0x53e943[_0x26eb('0x3e')]=[{'name':_0x26eb('0xac'),'value':_0x26eb('0xad')},{'name':_0x26eb('0xae'),'value':_0x26eb('0xaf')}];_0x40c6e7(_0x53e943);}else{var _0x4927de={'method':_0x26eb('0xb0'),'uri':_0x2c34a6+_0x26eb('0xb1')+_0x2fa22c,'auth':_0x43b9d6,'json':!![]};return rp(_0x4927de)[_0x26eb('0x22')](function(_0x1554c3){var _0x5e5fc7=[];if(_0x1554c3[_0x26eb('0x9e')][_0x26eb('0x35')]>0x0){_0x1554c3[_0x26eb('0x9e')][_0x26eb('0xa6')](function(_0x77fa31){if(_0x77fa31[_0x26eb('0xb2')]===_0x26eb('0xaf')){var _0x48ac79={'name':_0x77fa31['label'],'value':_0x77fa31['value']};_0x5e5fc7[_0x26eb('0xa4')](_0x48ac79);}});}_0x53e943[_0x26eb('0x3e')]=_0x5e5fc7;if(_0x53e943[_0x26eb('0x3e')]['length']>0x0){_0x40c6e7(_0x53e943);}else{if(_0x2b1b63==![]){_0x40c6e7();}else{_0x40c6e7(_0x53e943);}}});}});}
\ No newline at end of file
+var _0xd773=['params','keys','includeAll','merge','find','create','body','getConfigurations','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','subcategory','notify','incident_state','severity','category','parent','made_sla','caused_by','sys_updated_on','child_incidents','hold_reason','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','delivery_task','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','email','serverUrl','remoteUri','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','zip-dir','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','send','ServicenowAccount','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd773,0x79));var _0x3d77=function(_0x13c204,_0x509d52){_0x13c204=_0x13c204-0x0;var _0x23080f=_0xd773[_0x13c204];return _0x23080f;};'use strict';var emlformat=require(_0x3d77('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d77('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d77('0x2'));var Mustache=require('mustache');var util=require(_0x3d77('0x3'));var path=require(_0x3d77('0x4'));var sox=require(_0x3d77('0x5'));var csv=require(_0x3d77('0x6'));var ejs=require(_0x3d77('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3d77('0x8'));var squel=require(_0x3d77('0x9'));var crypto=require(_0x3d77('0xa'));var jsforce=require(_0x3d77('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x3d77('0x6'));var querystring=require(_0x3d77('0xc'));var Papa=require(_0x3d77('0xd'));var Redis=require(_0x3d77('0xe'));var authService=require(_0x3d77('0xf'));var qs=require(_0x3d77('0x10'));var as=require(_0x3d77('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3d77('0x12'))(_0x3d77('0x13'));var utils=require(_0x3d77('0x14'));var config=require(_0x3d77('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d77('0x16'))['db'];var integrations=require(_0x3d77('0x17'));function respondWithStatusCode(_0x55ac6a,_0x1b2e58){_0x1b2e58=_0x1b2e58||0xcc;return function(_0x1fca4f){if(_0x1fca4f){return _0x55ac6a[_0x3d77('0x18')](_0x1b2e58);}return _0x55ac6a[_0x3d77('0x19')](_0x1b2e58)['end']();};}function respondWithResult(_0x337487,_0x5e3d8e){_0x5e3d8e=_0x5e3d8e||0xc8;return function(_0x4475f7){if(_0x4475f7){return _0x337487[_0x3d77('0x19')](_0x5e3d8e)[_0x3d77('0x1a')](_0x4475f7);}};}function respondWithFilteredResult(_0x32ccd4,_0x2b7b32){return function(_0x52653b){if(_0x52653b){var _0x469ac6=typeof _0x2b7b32[_0x3d77('0x1b')]===_0x3d77('0x1c')&&typeof _0x2b7b32['limit']==='undefined';var _0xcb5789=_0x52653b[_0x3d77('0x1d')];var _0x5ad7c3=_0x469ac6?0x0:_0x2b7b32[_0x3d77('0x1b')];var _0x1cf3c5=_0x469ac6?_0x52653b[_0x3d77('0x1d')]:_0x2b7b32[_0x3d77('0x1b')]+_0x2b7b32[_0x3d77('0x1e')];var _0x478492;if(_0x1cf3c5>=_0xcb5789){_0x1cf3c5=_0xcb5789;_0x478492=0xc8;}else{_0x478492=0xce;}_0x32ccd4[_0x3d77('0x19')](_0x478492);return _0x32ccd4[_0x3d77('0x1f')](_0x3d77('0x20'),_0x5ad7c3+'-'+_0x1cf3c5+'/'+_0xcb5789)[_0x3d77('0x1a')](_0x52653b);}return null;};}function patchUpdates(_0xb60eaf){return function(_0x21423b){try{jsonpatch[_0x3d77('0x21')](_0x21423b,_0xb60eaf,!![]);}catch(_0x5ce9c2){return BPromise[_0x3d77('0x22')](_0x5ce9c2);}return _0x21423b[_0x3d77('0x23')]();};}function saveUpdates(_0x1a6a9e,_0x2c133a){return function(_0x373ddf){if(_0x373ddf){return _0x373ddf[_0x3d77('0x24')](_0x1a6a9e)[_0x3d77('0x25')](function(_0x8e2d01){return _0x8e2d01;});}return null;};}function removeEntity(_0x40ae84,_0x2b5af9){return function(_0x2027db){if(_0x2027db){return _0x2027db['destroy']()[_0x3d77('0x25')](function(){_0x40ae84[_0x3d77('0x19')](0xcc)[_0x3d77('0x26')]();});}};}function handleEntityNotFound(_0x92b21c,_0x37112a){return function(_0x555aee){if(!_0x555aee){_0x92b21c[_0x3d77('0x18')](0x194);}return _0x555aee;};}function handleError(_0x135f35,_0x3dc9aa){_0x3dc9aa=_0x3dc9aa||0x1f4;return function(_0x506140){logger[_0x3d77('0x27')](_0x506140[_0x3d77('0x28')]);if(_0x506140[_0x3d77('0x29')]){delete _0x506140[_0x3d77('0x29')];}_0x135f35[_0x3d77('0x19')](_0x3dc9aa)[_0x3d77('0x2a')](_0x506140);};}exports['index']=function(_0x388532,_0x202a8c){var _0x5811cf={},_0x404d19={},_0x2675cc={'count':0x0,'rows':[]};var _0x2760be=_['map'](db[_0x3d77('0x2b')][_0x3d77('0x2c')],function(_0x5822a8){return{'name':_0x5822a8[_0x3d77('0x2d')],'type':_0x5822a8[_0x3d77('0x2e')][_0x3d77('0x2f')]};});_0x404d19[_0x3d77('0x30')]=_[_0x3d77('0x31')](_0x2760be,_0x3d77('0x29'));_0x404d19['query']=_['keys'](_0x388532[_0x3d77('0x32')]);_0x404d19[_0x3d77('0x33')]=_['intersection'](_0x404d19[_0x3d77('0x30')],_0x404d19['query']);_0x5811cf[_0x3d77('0x34')]=_[_0x3d77('0x35')](_0x404d19[_0x3d77('0x30')],qs['fields'](_0x388532[_0x3d77('0x32')][_0x3d77('0x36')]));_0x5811cf[_0x3d77('0x34')]=_0x5811cf[_0x3d77('0x34')][_0x3d77('0x37')]?_0x5811cf[_0x3d77('0x34')]:_0x404d19[_0x3d77('0x30')];if(!_0x388532[_0x3d77('0x32')][_0x3d77('0x38')]('nolimit')){_0x5811cf[_0x3d77('0x1e')]=qs['limit'](_0x388532[_0x3d77('0x32')][_0x3d77('0x1e')]);_0x5811cf[_0x3d77('0x1b')]=qs['offset'](_0x388532[_0x3d77('0x32')]['offset']);}_0x5811cf[_0x3d77('0x39')]=qs[_0x3d77('0x3a')](_0x388532[_0x3d77('0x32')][_0x3d77('0x3a')]);_0x5811cf[_0x3d77('0x3b')]=qs[_0x3d77('0x33')](_[_0x3d77('0x3c')](_0x388532[_0x3d77('0x32')],_0x404d19[_0x3d77('0x33')]),_0x2760be);if(_0x388532[_0x3d77('0x32')][_0x3d77('0x3d')]){_0x5811cf[_0x3d77('0x3b')]=_['merge'](_0x5811cf['where'],{'$or':_[_0x3d77('0x31')](_0x2760be,function(_0x53b2c3){if(_0x53b2c3[_0x3d77('0x2e')]!==_0x3d77('0x3e')){var _0x4738d7={};_0x4738d7[_0x53b2c3[_0x3d77('0x29')]]={'$like':'%'+_0x388532[_0x3d77('0x32')][_0x3d77('0x3d')]+'%'};return _0x4738d7;}})});}_0x5811cf=_['merge']({},_0x5811cf,_0x388532[_0x3d77('0x3f')]);var _0x4282f3={'where':_0x5811cf['where']};return db[_0x3d77('0x2b')]['count'](_0x4282f3)[_0x3d77('0x25')](function(_0x3fa44f){_0x2675cc[_0x3d77('0x1d')]=_0x3fa44f;if(_0x388532['query']['includeAll']){_0x5811cf[_0x3d77('0x40')]=[{'all':!![]}];}return db[_0x3d77('0x2b')][_0x3d77('0x41')](_0x5811cf);})[_0x3d77('0x25')](function(_0x83b1d5){_0x2675cc[_0x3d77('0x42')]=_0x83b1d5;return _0x2675cc;})[_0x3d77('0x25')](respondWithFilteredResult(_0x202a8c,_0x5811cf))[_0x3d77('0x43')](handleError(_0x202a8c,null));};exports[_0x3d77('0x44')]=function(_0x394181,_0x3d5be4){var _0x2fcd69={'raw':![],'where':{'id':_0x394181[_0x3d77('0x45')]['id']}},_0x2bda5e={};_0x2bda5e[_0x3d77('0x30')]=_['keys'](db[_0x3d77('0x2b')][_0x3d77('0x2c')]);_0x2bda5e[_0x3d77('0x32')]=_[_0x3d77('0x46')](_0x394181['query']);_0x2bda5e[_0x3d77('0x33')]=_[_0x3d77('0x35')](_0x2bda5e['model'],_0x2bda5e[_0x3d77('0x32')]);_0x2fcd69[_0x3d77('0x34')]=_[_0x3d77('0x35')](_0x2bda5e[_0x3d77('0x30')],qs[_0x3d77('0x36')](_0x394181[_0x3d77('0x32')][_0x3d77('0x36')]));_0x2fcd69[_0x3d77('0x34')]=_0x2fcd69[_0x3d77('0x34')][_0x3d77('0x37')]?_0x2fcd69['attributes']:_0x2bda5e['model'];if(_0x394181['query'][_0x3d77('0x47')]){_0x2fcd69[_0x3d77('0x40')]=[{'all':!![]}];}_0x2fcd69=_[_0x3d77('0x48')]({},_0x2fcd69,_0x394181[_0x3d77('0x3f')]);return db[_0x3d77('0x2b')][_0x3d77('0x49')](_0x2fcd69)[_0x3d77('0x25')](handleEntityNotFound(_0x3d5be4,null))['then'](respondWithResult(_0x3d5be4,null))['catch'](handleError(_0x3d5be4,null));};exports['create']=function(_0x49047c,_0xb9a57c){return db['ServicenowAccount'][_0x3d77('0x4a')](_0x49047c[_0x3d77('0x4b')],{})[_0x3d77('0x25')](respondWithResult(_0xb9a57c,0xc9))[_0x3d77('0x43')](handleError(_0xb9a57c,null));};exports[_0x3d77('0x24')]=function(_0x451b4b,_0x5be5ad){if(_0x451b4b[_0x3d77('0x4b')]['id']){delete _0x451b4b['body']['id'];}return db['ServicenowAccount'][_0x3d77('0x49')]({'where':{'id':_0x451b4b['params']['id']}})[_0x3d77('0x25')](handleEntityNotFound(_0x5be5ad,null))[_0x3d77('0x25')](saveUpdates(_0x451b4b[_0x3d77('0x4b')],null))[_0x3d77('0x25')](respondWithResult(_0x5be5ad,null))['catch'](handleError(_0x5be5ad,null));};exports['destroy']=function(_0x25c77b,_0x40247c){return db[_0x3d77('0x2b')]['find']({'where':{'id':_0x25c77b[_0x3d77('0x45')]['id']}})['then'](handleEntityNotFound(_0x40247c,null))[_0x3d77('0x25')](removeEntity(_0x40247c,null))[_0x3d77('0x43')](handleError(_0x40247c,null));};exports['getConfigurations']=function(_0x5654b8,_0x4ce314,_0x4ddbe9){var _0x4157a2={};var _0x1dc095={};var _0x49fdc5;var _0x1d6a86;return db['ServicenowAccount']['findOne']({'where':{'id':_0x5654b8['params']['id']}})[_0x3d77('0x25')](handleEntityNotFound(_0x4ce314,null))[_0x3d77('0x25')](function(_0x3cfa3f){if(_0x3cfa3f){_0x49fdc5=_0x3cfa3f;_0x1dc095[_0x3d77('0x30')]=_[_0x3d77('0x46')](db['ServicenowConfiguration'][_0x3d77('0x2c')]);_0x1dc095[_0x3d77('0x32')]=_[_0x3d77('0x46')](_0x5654b8['query']);_0x1dc095[_0x3d77('0x33')]=_[_0x3d77('0x35')](_0x1dc095[_0x3d77('0x30')],_0x1dc095['query']);_0x4157a2[_0x3d77('0x34')]=_[_0x3d77('0x35')](_0x1dc095[_0x3d77('0x30')],qs[_0x3d77('0x36')](_0x5654b8[_0x3d77('0x32')]['fields']));_0x4157a2[_0x3d77('0x34')]=_0x4157a2[_0x3d77('0x34')][_0x3d77('0x37')]?_0x4157a2['attributes']:_0x1dc095[_0x3d77('0x30')];_0x4157a2[_0x3d77('0x39')]=qs[_0x3d77('0x3a')](_0x5654b8['query'][_0x3d77('0x3a')]);_0x4157a2['where']=qs[_0x3d77('0x33')](_['pick'](_0x5654b8[_0x3d77('0x32')],_0x1dc095[_0x3d77('0x33')]));if(_0x5654b8[_0x3d77('0x32')]['filter']){_0x4157a2[_0x3d77('0x3b')]=_[_0x3d77('0x48')](_0x4157a2['where'],{'$or':_[_0x3d77('0x31')](_0x4157a2[_0x3d77('0x34')],function(_0x33975e){var _0x319d57={};_0x319d57[_0x33975e]={'$like':'%'+_0x5654b8[_0x3d77('0x32')][_0x3d77('0x3d')]+'%'};return _0x319d57;})});}_0x4157a2=_[_0x3d77('0x48')]({},_0x4157a2,_0x5654b8['options']);return _0x49fdc5[_0x3d77('0x4c')](_0x4157a2);}})['then'](function(_0x5c6083){if(_0x5c6083){_0x1d6a86=_0x5c6083[_0x3d77('0x37')];if(!_0x5654b8['query'][_0x3d77('0x38')]('nolimit')){_0x4157a2['limit']=qs[_0x3d77('0x1e')](_0x5654b8[_0x3d77('0x32')][_0x3d77('0x1e')]);_0x4157a2[_0x3d77('0x1b')]=qs['offset'](_0x5654b8['query'][_0x3d77('0x1b')]);}return _0x49fdc5[_0x3d77('0x4c')](_0x4157a2);}})[_0x3d77('0x25')](function(_0x22b577){if(_0x22b577){return _0x22b577?{'count':_0x1d6a86,'rows':_0x22b577}:null;}})[_0x3d77('0x25')](respondWithResult(_0x4ce314,null))[_0x3d77('0x43')](handleError(_0x4ce314,null));};exports[_0x3d77('0x4d')]=function(_0x97592d,_0x4582e9,_0x491af4){if(_0x97592d[_0x3d77('0x4b')]['id']){delete _0x97592d[_0x3d77('0x4b')]['id'];}return db[_0x3d77('0x2b')][_0x3d77('0x4e')]({'where':{'id':_0x97592d[_0x3d77('0x45')]['id']}})[_0x3d77('0x25')](handleEntityNotFound(_0x4582e9,null))[_0x3d77('0x25')](function(_0x464012){if(_0x464012){_0x97592d[_0x3d77('0x4b')][_0x3d77('0x4f')]=_0x464012['id'];_0x97592d[_0x3d77('0x4b')][_0x3d77('0x50')]=integrations['getSubjects'](_0x97592d[_0x3d77('0x4b')][_0x3d77('0x51')],_0x97592d[_0x3d77('0x4b')][_0x3d77('0x2e')]);_0x97592d['body'][_0x3d77('0x52')]=integrations[_0x3d77('0x53')](_0x97592d[_0x3d77('0x4b')][_0x3d77('0x51')],_0x97592d[_0x3d77('0x4b')][_0x3d77('0x2e')]);return db[_0x3d77('0x54')][_0x3d77('0x4a')](_0x97592d[_0x3d77('0x4b')],{'include':[{'model':db[_0x3d77('0x55')],'as':'Subjects'},{'model':db['ServicenowField'],'as':_0x3d77('0x52')}]});}return null;})[_0x3d77('0x25')](respondWithResult(_0x4582e9,null))[_0x3d77('0x43')](handleError(_0x4582e9,null));};exports[_0x3d77('0x56')]=function(_0x166f79,_0x43a55c,_0x1db1c2){var _0x48f258=['made_sla','hold_reason','knowledge',_0x3d77('0x57'),'close_code',_0x3d77('0x58'),_0x3d77('0x59'),_0x3d77('0x5a'),_0x3d77('0x5b')];var _0x1ffef1=[_0x3d77('0x5c'),_0x3d77('0x5d'),_0x3d77('0x5e'),'watch_list','upon_reject',_0x3d77('0x5f'),_0x3d77('0x60'),_0x3d77('0x61'),_0x3d77('0x62'),_0x3d77('0x63'),'resolved_by',_0x3d77('0x64'),_0x3d77('0x65'),_0x3d77('0x66'),_0x3d77('0x67'),'sys_domain','state',_0x3d77('0x68'),_0x3d77('0x69'),_0x3d77('0x39'),_0x3d77('0x6a'),_0x3d77('0x6b'),_0x3d77('0x6c'),_0x3d77('0x6d'),_0x3d77('0x6e'),_0x3d77('0x6f'),_0x3d77('0x70'),_0x3d77('0x71'),_0x3d77('0x72'),_0x3d77('0x73'),_0x3d77('0x74'),'time_worked',_0x3d77('0x75'),_0x3d77('0x76'),_0x3d77('0x77'),_0x3d77('0x78'),_0x3d77('0x79'),_0x3d77('0x7a'),_0x3d77('0x7b'),_0x3d77('0x7c'),_0x3d77('0x7d'),'subcategory',_0x3d77('0x7e'),_0x3d77('0x7f'),_0x3d77('0x80'),'correlation_display',_0x3d77('0x81'),'work_start',_0x3d77('0x82'),_0x3d77('0x83'),_0x3d77('0x84'),_0x3d77('0x85'),'calendar_duration','notify',_0x3d77('0x86'),_0x3d77('0x87'),_0x3d77('0x88'),_0x3d77('0x89'),_0x3d77('0x8a'),_0x3d77('0x8b'),_0x3d77('0x8c'),_0x3d77('0x8d'),_0x3d77('0x59'),_0x3d77('0x8e'),_0x3d77('0x8f'),'company',_0x3d77('0x90'),_0x3d77('0x91'),_0x3d77('0x92'),_0x3d77('0x5a'),'comments',_0x3d77('0x93'),_0x3d77('0x94'),_0x3d77('0x95'),'due_date',_0x3d77('0x96'),_0x3d77('0x97'),_0x3d77('0x98'),_0x3d77('0x99'),_0x3d77('0x9a'),_0x3d77('0x9b'),_0x3d77('0x9c'),_0x3d77('0x5b')];var _0xaeaf35='';var _0x312d3e='';var _0x5b96b7=[];var _0x42cc7f='';var _0x56b295='';var _0x5336d4=[];var _0x60a9b4='';var _0x510f7b='';var _0x578e8c={};var _0x3f7970='';return db[_0x3d77('0x2b')][_0x3d77('0x4e')]({'where':{'id':_0x166f79['params']['id']},'attributes':['id',_0x3d77('0x9d'),_0x3d77('0x9e'),_0x3d77('0x9f'),'remoteUri',_0x3d77('0xa0')]})[_0x3d77('0x25')](handleEntityNotFound(_0x43a55c,null))[_0x3d77('0x25')](function(_0x578ecc){if(_0x578ecc){_0x3f7970=_0x578ecc[_0x3d77('0xa1')];var _0x4cbb22=_0x3f7970[_0x3d77('0xa2')](-0x1);if(_0x4cbb22==='/'){_0x3f7970=_0x3f7970[_0x3d77('0xa3')](0x0,_0x3f7970['lastIndexOf'](_0x4cbb22));}_0x510f7b=util[_0x3d77('0xa4')](_0x3d77('0xa5'),_0x3f7970);_0x60a9b4=util[_0x3d77('0xa4')](_0x3d77('0xa6'),_0x3f7970);_0x578e8c={'user':_0x578ecc['username'],'pass':_0x578ecc[_0x3d77('0x9e')]};var _0x510acb={'method':_0x3d77('0xa7'),'uri':_0x510f7b+'incident?sysparm_display_value=all','auth':_0x578e8c,'json':!![]};return rp(_0x510acb);}})[_0x3d77('0x25')](function(_0x5747fd){if(_0x5747fd['result'][_0x3d77('0x37')]>0x0){_0xaeaf35=_0x5747fd[_0x3d77('0xa8')];}console[_0x3d77('0xa9')](_0x3d77('0xaa'),_0xaeaf35);_0x5336d4=[];_0x312d3e=Object[_0x3d77('0xab')]([],_0xaeaf35);_[_0x3d77('0xac')](_0x312d3e,function(_0x3f46af){return!_0x48f258[_0x3d77('0xad')](_0x3f46af[_0x3d77('0x29')]);});_0x312d3e[_0x3d77('0xae')](function(_0x31bdc9){var _0x3707de=createFieldObject(_0x60a9b4,_0x578e8c,_0x31bdc9[_0x3d77('0xaf')],_0x31bdc9[_0x3d77('0x29')],_0x31bdc9[_0x3d77('0xb0')],![]);_0x5336d4[_0x3d77('0xb1')](_0x3707de);});return Promise[_0x3d77('0xb2')](_0x5336d4);})[_0x3d77('0x25')](function(_0x118e65){_0x5b96b7=_0x118e65;_0x42cc7f=Object[_0x3d77('0xab')]([],_0xaeaf35);console[_0x3d77('0xa9')]('TCL:\x20_object',_0xaeaf35);_[_0x3d77('0xac')](_0x42cc7f,function(_0x472e01){return _0x1ffef1['includes'](_0x472e01['name']);});console[_0x3d77('0xa9')](_0x3d77('0xb3'),_0x42cc7f);_0x5336d4=[];_0x42cc7f['forEach'](function(_0x445fe){var _0x3776dc=createFieldObject(_0x60a9b4,_0x578e8c,_0x445fe[_0x3d77('0xaf')],_0x445fe[_0x3d77('0x29')],_0x445fe['label'],!![]);_0x5336d4[_0x3d77('0xb1')](_0x3776dc);});return Promise['all'](_0x5336d4);})[_0x3d77('0x25')](function(_0x551675){_0x56b295=_0x551675;var _0x36e22e=_0x5b96b7[_0x3d77('0xb4')](_0x56b295);return{'count':_0x36e22e[_0x3d77('0x37')],'rows':_0x36e22e};})[_0x3d77('0x25')](respondWithResult(_0x43a55c,null))['catch'](function(_0xe6e738){console[_0x3d77('0xa9')](_0x3d77('0xb5')+_0xe6e738);var _0x30ddd2=_0x166f79['query'][_0x3d77('0xb6')]?0x1f4:_0xe6e738['statusCode']||0x1f4;logger['error'](_0xe6e738[_0x3d77('0x28')]);delete _0xe6e738[_0x3d77('0x29')];if(_0x30ddd2===0x191){_0x30ddd2=0x190;}_0x43a55c[_0x3d77('0x19')](_0x30ddd2)[_0x3d77('0x2a')](_0x166f79[_0x3d77('0x32')][_0x3d77('0xb6')]?{'message':'Wrong\x20credentials','statusCode':_0xe6e738['statusCode']}:_0xe6e738);});};function createFieldObject(_0x57df77,_0x29ed63,_0xb8665,_0x144cca,_0x6af9e0,_0x212103){return new Promise(function(_0x24e898,_0x9c5ba4){var _0x3017f3={'id':_0x144cca,'name':_0x6af9e0,'custom':_0x212103};if(_0xb8665===_0x3d77('0xb7')){_0x3017f3[_0x3d77('0x3f')]=[{'name':_0x3d77('0xb8'),'value':_0x3d77('0xb9')},{'name':_0x3d77('0xba'),'value':_0x3d77('0xbb')}];_0x24e898(_0x3017f3);}else{var _0x472d6d={'method':_0x3d77('0xa7'),'uri':_0x57df77+_0x3d77('0xbc')+_0x144cca,'auth':_0x29ed63,'json':!![]};return rp(_0x472d6d)[_0x3d77('0x25')](function(_0x8f2eb1){var _0x5b95fb=[];if(_0x8f2eb1[_0x3d77('0xa8')][_0x3d77('0x37')]>0x0){_0x8f2eb1[_0x3d77('0xa8')][_0x3d77('0xae')](function(_0xf336b7){if(_0xf336b7[_0x3d77('0xbd')]===_0x3d77('0xbb')){var _0x21ebda={'name':_0xf336b7['label'],'value':_0xf336b7['value']};_0x5b95fb[_0x3d77('0xb1')](_0x21ebda);}});}_0x3017f3[_0x3d77('0x3f')]=_0x5b95fb;if(_0x3017f3['options'][_0x3d77('0x37')]>0x0){_0x24e898(_0x3017f3);}else{if(_0x212103==![]){_0x24e898();}else{_0x24e898(_0x3017f3);}}});}});}
\ No newline at end of file
index ad26e44..c76d97c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','api','bluebird','request-promise'];(function(_0x272b44,_0x4acf76){var _0x155cd8=function(_0x38b7a8){while(--_0x38b7a8){_0x272b44['push'](_0x272b44['shift']());}};_0x155cd8(++_0x4acf76);}(_0x71ab,0x64));var _0xb71a=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x71ab[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c5a=['int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x46ccb7,_0x13eae4){var _0x29c02d=function(_0x561b82){while(--_0x561b82){_0x46ccb7['push'](_0x46ccb7['shift']());}};_0x29c02d(++_0x13eae4);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x50b6da,_0x4e71a8){_0x50b6da=_0x50b6da-0x0;var _0x343d24=_0x9c5a[_0x50b6da];return _0x343d24;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0xa9c5('0x8'));module['exports']=function(_0x394d84,_0x3df556){return _0x394d84['define']('ServicenowAccount',attributes,{'tableName':_0xa9c5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 30af3a1..4b74cc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2823=['ServicenowAccount','options','raw','where','attributes','limit','include','map','model','info','ShowServicenowAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount'];(function(_0x40bc10,_0x3d8f0f){var _0x5cffc6=function(_0x29b620){while(--_0x29b620){_0x40bc10['push'](_0x40bc10['shift']());}};_0x5cffc6(++_0x3d8f0f);}(_0x2823,0x78));var _0x3282=function(_0x3337f6,_0x58f050){_0x3337f6=_0x3337f6-0x0;var _0x2f5cd4=_0x2823[_0x3337f6];return _0x2f5cd4;};'use strict';var _=require(_0x3282('0x0'));var util=require('util');var moment=require(_0x3282('0x1'));var BPromise=require(_0x3282('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3282('0x3'));var db=require(_0x3282('0x4'))['db'];var utils=require(_0x3282('0x5'));var logger=require(_0x3282('0x6'))(_0x3282('0x7'));var config=require(_0x3282('0x8'));var jayson=require(_0x3282('0x9'));var client=jayson[_0x3282('0xa')][_0x3282('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bfd86,_0x29ee38,_0x5ea0d3){return new BPromise(function(_0x351bbb,_0x4864aa){return client['request'](_0x1bfd86,_0x5ea0d3)[_0x3282('0xc')](function(_0x46fd3c){logger['info'](_0x3282('0xd'),_0x29ee38,_0x3282('0xe'));logger[_0x3282('0xf')](_0x3282('0x10'),_0x29ee38,_0x3282('0xe'),JSON[_0x3282('0x11')](_0x46fd3c));if(_0x46fd3c[_0x3282('0x12')]){if(_0x46fd3c[_0x3282('0x12')][_0x3282('0x13')]===0x1f4){logger[_0x3282('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x29ee38,_0x46fd3c[_0x3282('0x12')][_0x3282('0x14')]);return _0x4864aa(_0x46fd3c[_0x3282('0x12')][_0x3282('0x14')]);}logger[_0x3282('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x29ee38,_0x46fd3c[_0x3282('0x12')][_0x3282('0x14')]);return _0x351bbb(_0x46fd3c[_0x3282('0x12')][_0x3282('0x14')]);}else{logger['info'](_0x3282('0xd'),_0x29ee38,'request\x20sent');_0x351bbb(_0x46fd3c[_0x3282('0x15')]['message']);}})[_0x3282('0x16')](function(_0x12f805){logger[_0x3282('0x12')](_0x3282('0xd'),_0x29ee38,_0x12f805);_0x4864aa(_0x12f805);});});}exports[_0x3282('0x17')]=function(_0x314b3c){var _0x4f20b2=this;return new Promise(function(_0xd6d5a4,_0x8ab60b){return db[_0x3282('0x18')]['findAll']({'raw':_0x314b3c[_0x3282('0x19')]?_0x314b3c[_0x3282('0x19')][_0x3282('0x1a')]===undefined?!![]:![]:!![],'where':_0x314b3c['options']?_0x314b3c['options'][_0x3282('0x1b')]||null:null,'attributes':_0x314b3c[_0x3282('0x19')]?_0x314b3c['options'][_0x3282('0x1c')]||null:null,'limit':_0x314b3c[_0x3282('0x19')]?_0x314b3c[_0x3282('0x19')][_0x3282('0x1d')]||null:null,'include':_0x314b3c[_0x3282('0x19')]?_0x314b3c[_0x3282('0x19')][_0x3282('0x1e')]?_[_0x3282('0x1f')](_0x314b3c['options'][_0x3282('0x1e')],function(_0x378fb2){return{'model':db[_0x378fb2['model']],'as':_0x378fb2['as'],'attributes':_0x378fb2[_0x3282('0x1c')],'include':_0x378fb2[_0x3282('0x1e')]?_['map'](_0x378fb2[_0x3282('0x1e')],function(_0x230765){return{'model':db[_0x230765[_0x3282('0x20')]],'as':_0x230765['as'],'attributes':_0x230765[_0x3282('0x1c')],'include':_0x230765[_0x3282('0x1e')]?_['map'](_0x230765[_0x3282('0x1e')],function(_0x177caa){return{'model':db[_0x177caa['model']],'as':_0x177caa['as'],'attributes':_0x177caa[_0x3282('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3282('0xc')](function(_0x1537d3){logger[_0x3282('0x21')]('GetServicenowAccount',_0x314b3c);logger[_0x3282('0xf')]('GetServicenowAccount',_0x314b3c,JSON['stringify'](_0x1537d3));_0xd6d5a4(_0x1537d3);})[_0x3282('0x16')](function(_0x357404){logger['error'](_0x3282('0x17'),_0x357404[_0x3282('0x14')],_0x314b3c);_0x8ab60b(_0x4f20b2['error'](0x1f4,_0x357404[_0x3282('0x14')]));});});};exports[_0x3282('0x22')]=function(_0x2ffacf){var _0x52148d=this;return new Promise(function(_0x4668b9,_0x5daf7d){return db['ServicenowAccount'][_0x3282('0x23')]({'raw':_0x2ffacf['options']?_0x2ffacf[_0x3282('0x19')][_0x3282('0x1a')]===undefined?!![]:![]:!![],'where':_0x2ffacf[_0x3282('0x19')]?_0x2ffacf[_0x3282('0x19')][_0x3282('0x1b')]||null:null,'attributes':_0x2ffacf[_0x3282('0x19')]?_0x2ffacf['options'][_0x3282('0x1c')]||null:null,'include':_0x2ffacf[_0x3282('0x19')]?_0x2ffacf['options']['include']?_[_0x3282('0x1f')](_0x2ffacf[_0x3282('0x19')][_0x3282('0x1e')],function(_0x2ed1b3){return{'model':db[_0x2ed1b3[_0x3282('0x20')]],'as':_0x2ed1b3['as'],'attributes':_0x2ed1b3[_0x3282('0x1c')],'include':_0x2ed1b3[_0x3282('0x1e')]?_[_0x3282('0x1f')](_0x2ed1b3[_0x3282('0x1e')],function(_0x4d1005){return{'model':db[_0x4d1005[_0x3282('0x20')]],'as':_0x4d1005['as'],'attributes':_0x4d1005['attributes'],'include':_0x4d1005[_0x3282('0x1e')]?_[_0x3282('0x1f')](_0x4d1005[_0x3282('0x1e')],function(_0x598dba){return{'model':db[_0x598dba[_0x3282('0x20')]],'as':_0x598dba['as'],'attributes':_0x598dba['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b79b1){logger[_0x3282('0x21')]('ShowServicenowAccount',_0x2ffacf);logger[_0x3282('0xf')](_0x3282('0x22'),_0x2ffacf,JSON[_0x3282('0x11')](_0x4b79b1));_0x4668b9(_0x4b79b1);})[_0x3282('0x16')](function(_0x23f203){logger[_0x3282('0x12')]('ShowServicenowAccount',_0x23f203['message'],_0x2ffacf);_0x5daf7d(_0x52148d[_0x3282('0x12')](0x1f4,_0x23f203[_0x3282('0x14')]));});});};
\ No newline at end of file
+var _0x12d0=['http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','include','model','map','ShowServicenowAccount','find','raw','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x12d0,0xea));var _0x012d=function(_0xa99346,_0x4d0753){_0xa99346=_0xa99346-0x0;var _0x27925c=_0x12d0[_0xa99346];return _0x27925c;};'use strict';var _=require(_0x012d('0x0'));var util=require(_0x012d('0x1'));var moment=require(_0x012d('0x2'));var BPromise=require('bluebird');var rs=require(_0x012d('0x3'));var fs=require('fs');var Redis=require(_0x012d('0x4'));var db=require(_0x012d('0x5'))['db'];var utils=require(_0x012d('0x6'));var logger=require(_0x012d('0x7'))(_0x012d('0x8'));var config=require('../../config/environment');var jayson=require(_0x012d('0x9'));var client=jayson[_0x012d('0xa')][_0x012d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a5bef,_0x1a8ea3,_0xbc5711){return new BPromise(function(_0x38685c,_0x265042){return client[_0x012d('0xc')](_0x3a5bef,_0xbc5711)[_0x012d('0xd')](function(_0x1e1d69){logger[_0x012d('0xe')](_0x012d('0xf'),_0x1a8ea3,'request\x20sent');logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1a8ea3,_0x012d('0x10'),JSON[_0x012d('0x11')](_0x1e1d69));if(_0x1e1d69[_0x012d('0x12')]){if(_0x1e1d69[_0x012d('0x12')]['code']===0x1f4){logger['error'](_0x012d('0xf'),_0x1a8ea3,_0x1e1d69[_0x012d('0x12')]['message']);return _0x265042(_0x1e1d69[_0x012d('0x12')][_0x012d('0x13')]);}logger[_0x012d('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x1a8ea3,_0x1e1d69['error']['message']);return _0x38685c(_0x1e1d69[_0x012d('0x12')]['message']);}else{logger[_0x012d('0xe')](_0x012d('0xf'),_0x1a8ea3,_0x012d('0x10'));_0x38685c(_0x1e1d69[_0x012d('0x14')][_0x012d('0x13')]);}})['catch'](function(_0x2b08b7){logger[_0x012d('0x12')](_0x012d('0xf'),_0x1a8ea3,_0x2b08b7);_0x265042(_0x2b08b7);});});}exports[_0x012d('0x15')]=function(_0x317f32){var _0x22fa15=this;return new Promise(function(_0x379cd3,_0x21f256){return db[_0x012d('0x16')][_0x012d('0x17')]({'raw':_0x317f32[_0x012d('0x18')]?_0x317f32[_0x012d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x317f32[_0x012d('0x18')]?_0x317f32[_0x012d('0x18')][_0x012d('0x19')]||null:null,'attributes':_0x317f32[_0x012d('0x18')]?_0x317f32[_0x012d('0x18')][_0x012d('0x1a')]||null:null,'limit':_0x317f32['options']?_0x317f32['options']['limit']||null:null,'include':_0x317f32[_0x012d('0x18')]?_0x317f32[_0x012d('0x18')][_0x012d('0x1b')]?_['map'](_0x317f32[_0x012d('0x18')][_0x012d('0x1b')],function(_0x118843){return{'model':db[_0x118843[_0x012d('0x1c')]],'as':_0x118843['as'],'attributes':_0x118843['attributes'],'include':_0x118843[_0x012d('0x1b')]?_[_0x012d('0x1d')](_0x118843[_0x012d('0x1b')],function(_0x1ed4d3){return{'model':db[_0x1ed4d3[_0x012d('0x1c')]],'as':_0x1ed4d3['as'],'attributes':_0x1ed4d3[_0x012d('0x1a')],'include':_0x1ed4d3[_0x012d('0x1b')]?_[_0x012d('0x1d')](_0x1ed4d3[_0x012d('0x1b')],function(_0x4e6ced){return{'model':db[_0x4e6ced[_0x012d('0x1c')]],'as':_0x4e6ced['as'],'attributes':_0x4e6ced[_0x012d('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x012d('0xd')](function(_0x3d4f9b){logger[_0x012d('0xe')](_0x012d('0x15'),_0x317f32);logger['debug'](_0x012d('0x15'),_0x317f32,JSON['stringify'](_0x3d4f9b));_0x379cd3(_0x3d4f9b);})['catch'](function(_0x558784){logger[_0x012d('0x12')](_0x012d('0x15'),_0x558784[_0x012d('0x13')],_0x317f32);_0x21f256(_0x22fa15[_0x012d('0x12')](0x1f4,_0x558784[_0x012d('0x13')]));});});};exports[_0x012d('0x1e')]=function(_0xbb048d){var _0x131d2d=this;return new Promise(function(_0x42e4a7,_0xa7c001){return db['ServicenowAccount'][_0x012d('0x1f')]({'raw':_0xbb048d[_0x012d('0x18')]?_0xbb048d['options'][_0x012d('0x20')]===undefined?!![]:![]:!![],'where':_0xbb048d[_0x012d('0x18')]?_0xbb048d[_0x012d('0x18')]['where']||null:null,'attributes':_0xbb048d['options']?_0xbb048d[_0x012d('0x18')][_0x012d('0x1a')]||null:null,'include':_0xbb048d[_0x012d('0x18')]?_0xbb048d[_0x012d('0x18')][_0x012d('0x1b')]?_['map'](_0xbb048d[_0x012d('0x18')]['include'],function(_0x1b443f){return{'model':db[_0x1b443f[_0x012d('0x1c')]],'as':_0x1b443f['as'],'attributes':_0x1b443f[_0x012d('0x1a')],'include':_0x1b443f['include']?_[_0x012d('0x1d')](_0x1b443f[_0x012d('0x1b')],function(_0x528f99){return{'model':db[_0x528f99[_0x012d('0x1c')]],'as':_0x528f99['as'],'attributes':_0x528f99[_0x012d('0x1a')],'include':_0x528f99['include']?_[_0x012d('0x1d')](_0x528f99['include'],function(_0x514275){return{'model':db[_0x514275['model']],'as':_0x514275['as'],'attributes':_0x514275['attributes']};}):[]};}):[]};}):[]:[]})[_0x012d('0xd')](function(_0x38cf65){logger['info'](_0x012d('0x1e'),_0xbb048d);logger[_0x012d('0x21')]('ShowServicenowAccount',_0xbb048d,JSON[_0x012d('0x11')](_0x38cf65));_0x42e4a7(_0x38cf65);})[_0x012d('0x22')](function(_0x246e60){logger[_0x012d('0x12')](_0x012d('0x1e'),_0x246e60[_0x012d('0x13')],_0xbb048d);_0xa7c001(_0x131d2d[_0x012d('0x12')](0x1f4,_0x246e60[_0x012d('0x13')]));});});};
\ No newline at end of file
index 145e7e3..362ad4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb209=['../../components/auth/service','get','isAuthenticated','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','put','update','destroy','exports','multer','util','path','Router'];(function(_0x185a91,_0x4d2db7){var _0x263df8=function(_0xabd537){while(--_0xabd537){_0x185a91['push'](_0x185a91['shift']());}};_0x263df8(++_0x4d2db7);}(_0xb209,0x13c));var _0x9b20=function(_0x1c8d7f,_0x21734c){_0x1c8d7f=_0x1c8d7f-0x0;var _0x380dcb=_0xb209[_0x1c8d7f];return _0x380dcb;};'use strict';var multer=require(_0x9b20('0x0'));var util=require(_0x9b20('0x1'));var path=require(_0x9b20('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9b20('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9b20('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intServicenowConfiguration.controller');router[_0x9b20('0x5')]('/',auth[_0x9b20('0x6')](),controller['index']);router[_0x9b20('0x5')]('/:id',auth[_0x9b20('0x6')](),controller['show']);router['get'](_0x9b20('0x7'),auth[_0x9b20('0x6')](),controller[_0x9b20('0x8')]);router[_0x9b20('0x5')]('/:id/subjects',auth[_0x9b20('0x6')](),controller['getSubjects']);router[_0x9b20('0x5')](_0x9b20('0x9'),auth[_0x9b20('0x6')](),controller[_0x9b20('0xa')]);router[_0x9b20('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9b20('0xc')]('/:id',auth[_0x9b20('0x6')](),controller[_0x9b20('0xd')]);router['delete']('/:id',auth[_0x9b20('0x6')](),controller[_0x9b20('0xe')]);module[_0x9b20('0xf')]=router;
\ No newline at end of file
+var _0x8367=['get','isAuthenticated','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller'];(function(_0x1131e1,_0x584dda){var _0x24688e=function(_0x2334d6){while(--_0x2334d6){_0x1131e1['push'](_0x1131e1['shift']());}};_0x24688e(++_0x584dda);}(_0x8367,0x167));var _0x7836=function(_0x10a1ac,_0x25f5b0){_0x10a1ac=_0x10a1ac-0x0;var _0x45b99e=_0x8367[_0x10a1ac];return _0x45b99e;};'use strict';var multer=require('multer');var util=require(_0x7836('0x0'));var path=require('path');var timeout=require(_0x7836('0x1'));var express=require(_0x7836('0x2'));var router=express[_0x7836('0x3')]();var fs_extra=require(_0x7836('0x4'));var auth=require(_0x7836('0x5'));var interaction=require(_0x7836('0x6'));var config=require(_0x7836('0x7'));var controller=require(_0x7836('0x8'));router[_0x7836('0x9')]('/',auth[_0x7836('0xa')](),controller['index']);router[_0x7836('0x9')](_0x7836('0xb'),auth[_0x7836('0xa')](),controller[_0x7836('0xc')]);router[_0x7836('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7836('0xd')]);router[_0x7836('0x9')](_0x7836('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router['get'](_0x7836('0xf'),auth[_0x7836('0xa')](),controller[_0x7836('0x10')]);router['post']('/',auth[_0x7836('0xa')](),controller[_0x7836('0x11')]);router[_0x7836('0x12')](_0x7836('0xb'),auth[_0x7836('0xa')](),controller[_0x7836('0x13')]);router[_0x7836('0x14')](_0x7836('0xb'),auth['isAuthenticated'](),controller[_0x7836('0x15')]);module[_0x7836('0x16')]=router;
\ No newline at end of file
index 91d98d5..5e70345 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x552a=['STRING','sequelize'];(function(_0x3e3bed,_0x28cdc0){var _0x30595b=function(_0xa67c7d){while(--_0xa67c7d){_0x3e3bed['push'](_0x3e3bed['shift']());}};_0x30595b(++_0x28cdc0);}(_0x552a,0x185));var _0xa552=function(_0x4687c9,_0x907363){_0x4687c9=_0x4687c9-0x0;var _0x2ee533=_0x552a[_0x4687c9];return _0x2ee533;};'use strict';var Sequelize=require(_0xa552('0x0'));module['exports']={'name':{'type':Sequelize[_0xa552('0x1')]},'description':{'type':Sequelize[_0xa552('0x1')]}};
\ No newline at end of file
+var _0x0bd7=['sequelize','STRING'];(function(_0x2f89f0,_0x20d04d){var _0x2bc11f=function(_0xfe3a47){while(--_0xfe3a47){_0x2f89f0['push'](_0x2f89f0['shift']());}};_0x2bc11f(++_0x20d04d);}(_0x0bd7,0x96));var _0x70bd=function(_0x1a4a06,_0x36a5c2){_0x1a4a06=_0x1a4a06-0x0;var _0x49ec08=_0x0bd7[_0x1a4a06];return _0x49ec08;};'use strict';var Sequelize=require(_0x70bd('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x70bd('0x1')]}};
\ No newline at end of file
index 79e5031..f466cf2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a9=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','findOne','sort','getFields','getSubjects','ServicenowField','options','getDescriptions','eml-format','rimraf','zip-dir'];(function(_0x3f2ad0,_0x10d42b){var _0x5a9b8d=function(_0x35f32b){while(--_0x35f32b){_0x3f2ad0['push'](_0x3f2ad0['shift']());}};_0x5a9b8d(++_0x10d42b);}(_0xa8a9,0x135));var _0x9a8a=function(_0x3db5c5,_0x4410ca){_0x3db5c5=_0x3db5c5-0x0;var _0x50211e=_0xa8a9[_0x3db5c5];return _0x50211e;};'use strict';var emlformat=require(_0x9a8a('0x0'));var rimraf=require(_0x9a8a('0x1'));var zipdir=require(_0x9a8a('0x2'));var jsonpatch=require(_0x9a8a('0x3'));var rp=require(_0x9a8a('0x4'));var moment=require(_0x9a8a('0x5'));var BPromise=require(_0x9a8a('0x6'));var Mustache=require('mustache');var util=require(_0x9a8a('0x7'));var path=require(_0x9a8a('0x8'));var sox=require(_0x9a8a('0x9'));var csv=require(_0x9a8a('0xa'));var ejs=require(_0x9a8a('0xb'));var fs=require('fs');var fs_extra=require(_0x9a8a('0xc'));var _=require('lodash');var squel=require(_0x9a8a('0xd'));var crypto=require('crypto');var jsforce=require(_0x9a8a('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9a8a('0xa'));var querystring=require('querystring');var Papa=require(_0x9a8a('0xf'));var Redis=require(_0x9a8a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9a8a('0x11'));var as=require(_0x9a8a('0x12'));var hardwareService=require(_0x9a8a('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x9a8a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9a8a('0x15'));var db=require(_0x9a8a('0x16'))['db'];function respondWithStatusCode(_0x5b7293,_0x35b8b1){_0x35b8b1=_0x35b8b1||0xcc;return function(_0x55d423){if(_0x55d423){return _0x5b7293[_0x9a8a('0x17')](_0x35b8b1);}return _0x5b7293['status'](_0x35b8b1)[_0x9a8a('0x18')]();};}function respondWithResult(_0x48c401,_0x2c02c2){_0x2c02c2=_0x2c02c2||0xc8;return function(_0x8e16ee){if(_0x8e16ee){return _0x48c401[_0x9a8a('0x19')](_0x2c02c2)[_0x9a8a('0x1a')](_0x8e16ee);}};}function respondWithFilteredResult(_0x1a4b25,_0x4c0793){return function(_0x492894){if(_0x492894){var _0x103aaa=typeof _0x4c0793[_0x9a8a('0x1b')]===_0x9a8a('0x1c')&&typeof _0x4c0793[_0x9a8a('0x1d')]===_0x9a8a('0x1c');var _0x2a263b=_0x492894[_0x9a8a('0x1e')];var _0xaeb081=_0x103aaa?0x0:_0x4c0793['offset'];var _0xe07d59=_0x103aaa?_0x492894[_0x9a8a('0x1e')]:_0x4c0793[_0x9a8a('0x1b')]+_0x4c0793[_0x9a8a('0x1d')];var _0x1d0cf9;if(_0xe07d59>=_0x2a263b){_0xe07d59=_0x2a263b;_0x1d0cf9=0xc8;}else{_0x1d0cf9=0xce;}_0x1a4b25['status'](_0x1d0cf9);return _0x1a4b25[_0x9a8a('0x1f')](_0x9a8a('0x20'),_0xaeb081+'-'+_0xe07d59+'/'+_0x2a263b)['json'](_0x492894);}return null;};}function patchUpdates(_0x88c2b){return function(_0x9f32fa){try{jsonpatch[_0x9a8a('0x21')](_0x9f32fa,_0x88c2b,!![]);}catch(_0xe5450){return BPromise['reject'](_0xe5450);}return _0x9f32fa['save']();};}function saveUpdates(_0x5de61c,_0x3140d4){return function(_0x378dde){if(_0x378dde){return _0x378dde['update'](_0x5de61c)[_0x9a8a('0x22')](function(_0x1903b6){return _0x1903b6;});}return null;};}function removeEntity(_0x21b14b,_0xc4beaf){return function(_0xdabfc0){if(_0xdabfc0){return _0xdabfc0[_0x9a8a('0x23')]()['then'](function(){_0x21b14b[_0x9a8a('0x19')](0xcc)[_0x9a8a('0x18')]();});}};}function handleEntityNotFound(_0x5bd805,_0x13f75c){return function(_0x9f07c7){if(!_0x9f07c7){_0x5bd805['sendStatus'](0x194);}return _0x9f07c7;};}function handleError(_0xc02852,_0x202914){_0x202914=_0x202914||0x1f4;return function(_0x36f3e0){logger[_0x9a8a('0x24')](_0x36f3e0[_0x9a8a('0x25')]);if(_0x36f3e0['name']){delete _0x36f3e0[_0x9a8a('0x26')];}_0xc02852[_0x9a8a('0x19')](_0x202914)[_0x9a8a('0x27')](_0x36f3e0);};}exports[_0x9a8a('0x28')]=function(_0xd3d70c,_0x5edc0e){var _0x2510ad={},_0x2b815c={},_0x33c565={'count':0x0,'rows':[]};var _0x3a5c6c=_[_0x9a8a('0x29')](db[_0x9a8a('0x2a')][_0x9a8a('0x2b')],function(_0x4f6b2d){return{'name':_0x4f6b2d['fieldName'],'type':_0x4f6b2d[_0x9a8a('0x2c')]['key']};});_0x2b815c['model']=_[_0x9a8a('0x29')](_0x3a5c6c,_0x9a8a('0x26'));_0x2b815c['query']=_['keys'](_0xd3d70c[_0x9a8a('0x2d')]);_0x2b815c[_0x9a8a('0x2e')]=_[_0x9a8a('0x2f')](_0x2b815c[_0x9a8a('0x30')],_0x2b815c[_0x9a8a('0x2d')]);_0x2510ad[_0x9a8a('0x31')]=_[_0x9a8a('0x2f')](_0x2b815c[_0x9a8a('0x30')],qs['fields'](_0xd3d70c[_0x9a8a('0x2d')][_0x9a8a('0x32')]));_0x2510ad[_0x9a8a('0x31')]=_0x2510ad['attributes'][_0x9a8a('0x33')]?_0x2510ad[_0x9a8a('0x31')]:_0x2b815c[_0x9a8a('0x30')];if(!_0xd3d70c[_0x9a8a('0x2d')][_0x9a8a('0x34')](_0x9a8a('0x35'))){_0x2510ad['limit']=qs['limit'](_0xd3d70c[_0x9a8a('0x2d')][_0x9a8a('0x1d')]);_0x2510ad[_0x9a8a('0x1b')]=qs['offset'](_0xd3d70c[_0x9a8a('0x2d')][_0x9a8a('0x1b')]);}_0x2510ad[_0x9a8a('0x36')]=qs['sort'](_0xd3d70c[_0x9a8a('0x2d')]['sort']);_0x2510ad[_0x9a8a('0x37')]=qs[_0x9a8a('0x2e')](_[_0x9a8a('0x38')](_0xd3d70c[_0x9a8a('0x2d')],_0x2b815c[_0x9a8a('0x2e')]),_0x3a5c6c);if(_0xd3d70c[_0x9a8a('0x2d')][_0x9a8a('0x39')]){_0x2510ad[_0x9a8a('0x37')]=_[_0x9a8a('0x3a')](_0x2510ad[_0x9a8a('0x37')],{'$or':_[_0x9a8a('0x29')](_0x3a5c6c,function(_0x41aa20){if(_0x41aa20[_0x9a8a('0x2c')]!==_0x9a8a('0x3b')){var _0x1d7e5c={};_0x1d7e5c[_0x41aa20[_0x9a8a('0x26')]]={'$like':'%'+_0xd3d70c[_0x9a8a('0x2d')]['filter']+'%'};return _0x1d7e5c;}})});}_0x2510ad=_[_0x9a8a('0x3a')]({},_0x2510ad,_0xd3d70c['options']);var _0x1f0c10={'where':_0x2510ad[_0x9a8a('0x37')]};return db[_0x9a8a('0x2a')]['count'](_0x1f0c10)[_0x9a8a('0x22')](function(_0x4b6e04){_0x33c565[_0x9a8a('0x1e')]=_0x4b6e04;if(_0xd3d70c[_0x9a8a('0x2d')][_0x9a8a('0x3c')]){_0x2510ad[_0x9a8a('0x3d')]=[{'all':!![]}];}return db[_0x9a8a('0x2a')][_0x9a8a('0x3e')](_0x2510ad);})[_0x9a8a('0x22')](function(_0x43e358){_0x33c565[_0x9a8a('0x3f')]=_0x43e358;return _0x33c565;})[_0x9a8a('0x22')](respondWithFilteredResult(_0x5edc0e,_0x2510ad))[_0x9a8a('0x40')](handleError(_0x5edc0e,null));};exports[_0x9a8a('0x41')]=function(_0x44e133,_0x33c51b){var _0x430f18={'raw':![],'where':{'id':_0x44e133[_0x9a8a('0x42')]['id']}},_0x105ce5={};_0x105ce5[_0x9a8a('0x30')]=_[_0x9a8a('0x43')](db[_0x9a8a('0x2a')][_0x9a8a('0x2b')]);_0x105ce5[_0x9a8a('0x2d')]=_[_0x9a8a('0x43')](_0x44e133['query']);_0x105ce5[_0x9a8a('0x2e')]=_[_0x9a8a('0x2f')](_0x105ce5[_0x9a8a('0x30')],_0x105ce5[_0x9a8a('0x2d')]);_0x430f18[_0x9a8a('0x31')]=_[_0x9a8a('0x2f')](_0x105ce5[_0x9a8a('0x30')],qs[_0x9a8a('0x32')](_0x44e133[_0x9a8a('0x2d')][_0x9a8a('0x32')]));_0x430f18['attributes']=_0x430f18[_0x9a8a('0x31')][_0x9a8a('0x33')]?_0x430f18[_0x9a8a('0x31')]:_0x105ce5[_0x9a8a('0x30')];if(_0x44e133[_0x9a8a('0x2d')][_0x9a8a('0x3c')]){_0x430f18[_0x9a8a('0x3d')]=[{'all':!![]}];}_0x430f18=_[_0x9a8a('0x3a')]({},_0x430f18,_0x44e133['options']);return db[_0x9a8a('0x2a')][_0x9a8a('0x44')](_0x430f18)[_0x9a8a('0x22')](handleEntityNotFound(_0x33c51b,null))[_0x9a8a('0x22')](respondWithResult(_0x33c51b,null))[_0x9a8a('0x40')](handleError(_0x33c51b,null));};exports['create']=function(_0x1f682f,_0x1798a1){return db[_0x9a8a('0x2a')][_0x9a8a('0x45')](_0x1f682f['body'],{})[_0x9a8a('0x22')](respondWithResult(_0x1798a1,0xc9))[_0x9a8a('0x40')](handleError(_0x1798a1,null));};exports['update']=function(_0x11380,_0x3037b5){if(_0x11380[_0x9a8a('0x46')]['id']){delete _0x11380[_0x9a8a('0x46')]['id'];}return db[_0x9a8a('0x2a')]['find']({'where':{'id':_0x11380[_0x9a8a('0x42')]['id']}})[_0x9a8a('0x22')](handleEntityNotFound(_0x3037b5,null))[_0x9a8a('0x22')](saveUpdates(_0x11380['body'],null))[_0x9a8a('0x22')](respondWithResult(_0x3037b5,null))[_0x9a8a('0x40')](handleError(_0x3037b5,null));};exports['destroy']=function(_0x4c96cd,_0x4220c6){return db[_0x9a8a('0x2a')][_0x9a8a('0x44')]({'where':{'id':_0x4c96cd[_0x9a8a('0x42')]['id']}})[_0x9a8a('0x22')](handleEntityNotFound(_0x4220c6,null))[_0x9a8a('0x22')](removeEntity(_0x4220c6,null))[_0x9a8a('0x40')](handleError(_0x4220c6,null));};exports['getFields']=function(_0xfe6560,_0xb10c55,_0x458216){var _0x357ae6={};var _0x5573db={};var _0x4b052c;var _0x147426;return db[_0x9a8a('0x2a')][_0x9a8a('0x47')]({'where':{'id':_0xfe6560['params']['id']}})[_0x9a8a('0x22')](handleEntityNotFound(_0xb10c55,null))[_0x9a8a('0x22')](function(_0x1a3bbf){if(_0x1a3bbf){_0x4b052c=_0x1a3bbf;_0x5573db['model']=_[_0x9a8a('0x43')](db['ServicenowField'][_0x9a8a('0x2b')]);_0x5573db['query']=_['keys'](_0xfe6560[_0x9a8a('0x2d')]);_0x5573db['filters']=_[_0x9a8a('0x2f')](_0x5573db[_0x9a8a('0x30')],_0x5573db[_0x9a8a('0x2d')]);_0x357ae6[_0x9a8a('0x31')]=_[_0x9a8a('0x2f')](_0x5573db[_0x9a8a('0x30')],qs[_0x9a8a('0x32')](_0xfe6560[_0x9a8a('0x2d')][_0x9a8a('0x32')]));_0x357ae6['attributes']=_0x357ae6[_0x9a8a('0x31')][_0x9a8a('0x33')]?_0x357ae6[_0x9a8a('0x31')]:_0x5573db[_0x9a8a('0x30')];_0x357ae6[_0x9a8a('0x36')]=qs['sort'](_0xfe6560[_0x9a8a('0x2d')][_0x9a8a('0x48')]);_0x357ae6[_0x9a8a('0x37')]=qs[_0x9a8a('0x2e')](_[_0x9a8a('0x38')](_0xfe6560[_0x9a8a('0x2d')],_0x5573db[_0x9a8a('0x2e')]));if(_0xfe6560[_0x9a8a('0x2d')][_0x9a8a('0x39')]){_0x357ae6['where']=_[_0x9a8a('0x3a')](_0x357ae6[_0x9a8a('0x37')],{'$or':_['map'](_0x357ae6['attributes'],function(_0x17c192){var _0xfa9202={};_0xfa9202[_0x17c192]={'$like':'%'+_0xfe6560[_0x9a8a('0x2d')][_0x9a8a('0x39')]+'%'};return _0xfa9202;})});}_0x357ae6=_[_0x9a8a('0x3a')]({},_0x357ae6,_0xfe6560['options']);return _0x4b052c[_0x9a8a('0x49')](_0x357ae6);}})[_0x9a8a('0x22')](function(_0x2b795c){if(_0x2b795c){_0x147426=_0x2b795c['length'];if(!_0xfe6560[_0x9a8a('0x2d')]['hasOwnProperty'](_0x9a8a('0x35'))){_0x357ae6[_0x9a8a('0x1d')]=qs[_0x9a8a('0x1d')](_0xfe6560[_0x9a8a('0x2d')]['limit']);_0x357ae6[_0x9a8a('0x1b')]=qs[_0x9a8a('0x1b')](_0xfe6560[_0x9a8a('0x2d')][_0x9a8a('0x1b')]);}return _0x4b052c['getFields'](_0x357ae6);}})['then'](function(_0x3c9b0d){if(_0x3c9b0d){return _0x3c9b0d?{'count':_0x147426,'rows':_0x3c9b0d}:null;}})[_0x9a8a('0x22')](respondWithResult(_0xb10c55,null))[_0x9a8a('0x40')](handleError(_0xb10c55,null));};exports[_0x9a8a('0x4a')]=function(_0x51744e,_0x5818d5,_0x445dc7){var _0x4b07a7={};var _0xe1d3a7={};var _0x562d04;var _0x50d9a5;return db['ServicenowConfiguration'][_0x9a8a('0x47')]({'where':{'id':_0x51744e[_0x9a8a('0x42')]['id']}})[_0x9a8a('0x22')](handleEntityNotFound(_0x5818d5,null))[_0x9a8a('0x22')](function(_0x169181){if(_0x169181){_0x562d04=_0x169181;_0xe1d3a7[_0x9a8a('0x30')]=_[_0x9a8a('0x43')](db[_0x9a8a('0x4b')][_0x9a8a('0x2b')]);_0xe1d3a7[_0x9a8a('0x2d')]=_['keys'](_0x51744e['query']);_0xe1d3a7[_0x9a8a('0x2e')]=_[_0x9a8a('0x2f')](_0xe1d3a7[_0x9a8a('0x30')],_0xe1d3a7['query']);_0x4b07a7['attributes']=_[_0x9a8a('0x2f')](_0xe1d3a7['model'],qs[_0x9a8a('0x32')](_0x51744e['query'][_0x9a8a('0x32')]));_0x4b07a7['attributes']=_0x4b07a7[_0x9a8a('0x31')][_0x9a8a('0x33')]?_0x4b07a7[_0x9a8a('0x31')]:_0xe1d3a7[_0x9a8a('0x30')];_0x4b07a7['order']=qs[_0x9a8a('0x48')](_0x51744e[_0x9a8a('0x2d')]['sort']);_0x4b07a7[_0x9a8a('0x37')]=qs[_0x9a8a('0x2e')](_['pick'](_0x51744e[_0x9a8a('0x2d')],_0xe1d3a7['filters']));if(_0x51744e[_0x9a8a('0x2d')]['filter']){_0x4b07a7[_0x9a8a('0x37')]=_['merge'](_0x4b07a7[_0x9a8a('0x37')],{'$or':_[_0x9a8a('0x29')](_0x4b07a7[_0x9a8a('0x31')],function(_0x5631ca){var _0x20c934={};_0x20c934[_0x5631ca]={'$like':'%'+_0x51744e[_0x9a8a('0x2d')][_0x9a8a('0x39')]+'%'};return _0x20c934;})});}_0x4b07a7=_[_0x9a8a('0x3a')]({},_0x4b07a7,_0x51744e[_0x9a8a('0x4c')]);return _0x562d04[_0x9a8a('0x4a')](_0x4b07a7);}})['then'](function(_0x4315ee){if(_0x4315ee){_0x50d9a5=_0x4315ee['length'];if(!_0x51744e[_0x9a8a('0x2d')][_0x9a8a('0x34')](_0x9a8a('0x35'))){_0x4b07a7[_0x9a8a('0x1d')]=qs['limit'](_0x51744e[_0x9a8a('0x2d')][_0x9a8a('0x1d')]);_0x4b07a7[_0x9a8a('0x1b')]=qs['offset'](_0x51744e['query']['offset']);}return _0x562d04[_0x9a8a('0x4a')](_0x4b07a7);}})[_0x9a8a('0x22')](function(_0x5d516d){if(_0x5d516d){return _0x5d516d?{'count':_0x50d9a5,'rows':_0x5d516d}:null;}})[_0x9a8a('0x22')](respondWithResult(_0x5818d5,null))['catch'](handleError(_0x5818d5,null));};exports[_0x9a8a('0x4d')]=function(_0x130495,_0x3c05e1,_0x499703){var _0x288dcb={};var _0x5245f8={};var _0x50873b;var _0xc976ca;return db[_0x9a8a('0x2a')][_0x9a8a('0x47')]({'where':{'id':_0x130495[_0x9a8a('0x42')]['id']}})[_0x9a8a('0x22')](handleEntityNotFound(_0x3c05e1,null))[_0x9a8a('0x22')](function(_0x1e1820){if(_0x1e1820){_0x50873b=_0x1e1820;_0x5245f8['model']=_['keys'](db[_0x9a8a('0x4b')][_0x9a8a('0x2b')]);_0x5245f8['query']=_[_0x9a8a('0x43')](_0x130495['query']);_0x5245f8[_0x9a8a('0x2e')]=_[_0x9a8a('0x2f')](_0x5245f8[_0x9a8a('0x30')],_0x5245f8[_0x9a8a('0x2d')]);_0x288dcb[_0x9a8a('0x31')]=_[_0x9a8a('0x2f')](_0x5245f8[_0x9a8a('0x30')],qs[_0x9a8a('0x32')](_0x130495[_0x9a8a('0x2d')][_0x9a8a('0x32')]));_0x288dcb['attributes']=_0x288dcb[_0x9a8a('0x31')][_0x9a8a('0x33')]?_0x288dcb[_0x9a8a('0x31')]:_0x5245f8[_0x9a8a('0x30')];_0x288dcb[_0x9a8a('0x36')]=qs['sort'](_0x130495[_0x9a8a('0x2d')][_0x9a8a('0x48')]);_0x288dcb[_0x9a8a('0x37')]=qs[_0x9a8a('0x2e')](_[_0x9a8a('0x38')](_0x130495['query'],_0x5245f8[_0x9a8a('0x2e')]));if(_0x130495[_0x9a8a('0x2d')][_0x9a8a('0x39')]){_0x288dcb['where']=_[_0x9a8a('0x3a')](_0x288dcb[_0x9a8a('0x37')],{'$or':_[_0x9a8a('0x29')](_0x288dcb[_0x9a8a('0x31')],function(_0x5bfc12){var _0x5712fe={};_0x5712fe[_0x5bfc12]={'$like':'%'+_0x130495[_0x9a8a('0x2d')]['filter']+'%'};return _0x5712fe;})});}_0x288dcb=_[_0x9a8a('0x3a')]({},_0x288dcb,_0x130495[_0x9a8a('0x4c')]);return _0x50873b[_0x9a8a('0x4d')](_0x288dcb);}})[_0x9a8a('0x22')](function(_0x25355f){if(_0x25355f){_0xc976ca=_0x25355f[_0x9a8a('0x33')];if(!_0x130495[_0x9a8a('0x2d')][_0x9a8a('0x34')](_0x9a8a('0x35'))){_0x288dcb[_0x9a8a('0x1d')]=qs['limit'](_0x130495[_0x9a8a('0x2d')][_0x9a8a('0x1d')]);_0x288dcb[_0x9a8a('0x1b')]=qs[_0x9a8a('0x1b')](_0x130495[_0x9a8a('0x2d')][_0x9a8a('0x1b')]);}return _0x50873b['getDescriptions'](_0x288dcb);}})[_0x9a8a('0x22')](function(_0x318340){if(_0x318340){return _0x318340?{'count':_0xc976ca,'rows':_0x318340}:null;}})[_0x9a8a('0x22')](respondWithResult(_0x3c05e1,null))[_0x9a8a('0x40')](handleError(_0x3c05e1,null));};
\ No newline at end of file
+var _0x2f6e=['../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','ServicenowConfiguration','include','findAll','rows','catch','show','keys','length','includeAll','find','create','body','params','getFields','findOne','ServicenowField','merge','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x34c22e,_0x5bc5cb){var _0x139908=function(_0x16af47){while(--_0x16af47){_0x34c22e['push'](_0x34c22e['shift']());}};_0x139908(++_0x5bc5cb);}(_0x2f6e,0xd7));var _0xe2f6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2f6e[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xe2f6('0x0'));var rimraf=require(_0xe2f6('0x1'));var zipdir=require(_0xe2f6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe2f6('0x3'));var Mustache=require(_0xe2f6('0x4'));var util=require(_0xe2f6('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe2f6('0x6'));var fs=require('fs');var fs_extra=require(_0xe2f6('0x7'));var _=require(_0xe2f6('0x8'));var squel=require(_0xe2f6('0x9'));var crypto=require(_0xe2f6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe2f6('0xb'));var querystring=require(_0xe2f6('0xc'));var Papa=require(_0xe2f6('0xd'));var Redis=require('ioredis');var authService=require(_0xe2f6('0xe'));var qs=require(_0xe2f6('0xf'));var as=require(_0xe2f6('0x10'));var hardwareService=require(_0xe2f6('0x11'));var logger=require(_0xe2f6('0x12'))('api');var utils=require(_0xe2f6('0x13'));var config=require(_0xe2f6('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe2f6('0x15'))['db'];function respondWithStatusCode(_0x35bdc1,_0x3eaf74){_0x3eaf74=_0x3eaf74||0xcc;return function(_0x2757a6){if(_0x2757a6){return _0x35bdc1['sendStatus'](_0x3eaf74);}return _0x35bdc1[_0xe2f6('0x16')](_0x3eaf74)[_0xe2f6('0x17')]();};}function respondWithResult(_0x5e992b,_0xaba54){_0xaba54=_0xaba54||0xc8;return function(_0x419cf0){if(_0x419cf0){return _0x5e992b[_0xe2f6('0x16')](_0xaba54)['json'](_0x419cf0);}};}function respondWithFilteredResult(_0x3a7df4,_0x12661d){return function(_0x226afe){if(_0x226afe){var _0x521ce8=typeof _0x12661d[_0xe2f6('0x18')]===_0xe2f6('0x19')&&typeof _0x12661d[_0xe2f6('0x1a')]===_0xe2f6('0x19');var _0xed49c7=_0x226afe[_0xe2f6('0x1b')];var _0x288b2f=_0x521ce8?0x0:_0x12661d[_0xe2f6('0x18')];var _0x58134b=_0x521ce8?_0x226afe[_0xe2f6('0x1b')]:_0x12661d[_0xe2f6('0x18')]+_0x12661d[_0xe2f6('0x1a')];var _0x326dee;if(_0x58134b>=_0xed49c7){_0x58134b=_0xed49c7;_0x326dee=0xc8;}else{_0x326dee=0xce;}_0x3a7df4[_0xe2f6('0x16')](_0x326dee);return _0x3a7df4['set'](_0xe2f6('0x1c'),_0x288b2f+'-'+_0x58134b+'/'+_0xed49c7)[_0xe2f6('0x1d')](_0x226afe);}return null;};}function patchUpdates(_0x3fd610){return function(_0x20d425){try{jsonpatch[_0xe2f6('0x1e')](_0x20d425,_0x3fd610,!![]);}catch(_0x22f4fc){return BPromise[_0xe2f6('0x1f')](_0x22f4fc);}return _0x20d425['save']();};}function saveUpdates(_0x4f70ad,_0x35b2ee){return function(_0x4b540b){if(_0x4b540b){return _0x4b540b[_0xe2f6('0x20')](_0x4f70ad)[_0xe2f6('0x21')](function(_0x59f05f){return _0x59f05f;});}return null;};}function removeEntity(_0x4a9a2b,_0x19257d){return function(_0x30fedc){if(_0x30fedc){return _0x30fedc[_0xe2f6('0x22')]()[_0xe2f6('0x21')](function(){_0x4a9a2b[_0xe2f6('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1154d4,_0x573563){return function(_0x371736){if(!_0x371736){_0x1154d4[_0xe2f6('0x23')](0x194);}return _0x371736;};}function handleError(_0x5cd584,_0x595d98){_0x595d98=_0x595d98||0x1f4;return function(_0x42b911){logger[_0xe2f6('0x24')](_0x42b911[_0xe2f6('0x25')]);if(_0x42b911[_0xe2f6('0x26')]){delete _0x42b911[_0xe2f6('0x26')];}_0x5cd584['status'](_0x595d98)[_0xe2f6('0x27')](_0x42b911);};}exports[_0xe2f6('0x28')]=function(_0x3e0556,_0x44d941){var _0x3e93e8={},_0x27aa96={},_0xb28d4c={'count':0x0,'rows':[]};var _0x3eecb0=_[_0xe2f6('0x29')](db['ServicenowConfiguration'][_0xe2f6('0x2a')],function(_0x346e04){return{'name':_0x346e04['fieldName'],'type':_0x346e04[_0xe2f6('0x2b')][_0xe2f6('0x2c')]};});_0x27aa96[_0xe2f6('0x2d')]=_['map'](_0x3eecb0,_0xe2f6('0x26'));_0x27aa96['query']=_['keys'](_0x3e0556[_0xe2f6('0x2e')]);_0x27aa96['filters']=_['intersection'](_0x27aa96[_0xe2f6('0x2d')],_0x27aa96[_0xe2f6('0x2e')]);_0x3e93e8[_0xe2f6('0x2f')]=_[_0xe2f6('0x30')](_0x27aa96[_0xe2f6('0x2d')],qs[_0xe2f6('0x31')](_0x3e0556[_0xe2f6('0x2e')]['fields']));_0x3e93e8['attributes']=_0x3e93e8[_0xe2f6('0x2f')]['length']?_0x3e93e8[_0xe2f6('0x2f')]:_0x27aa96['model'];if(!_0x3e0556['query'][_0xe2f6('0x32')](_0xe2f6('0x33'))){_0x3e93e8['limit']=qs[_0xe2f6('0x1a')](_0x3e0556[_0xe2f6('0x2e')][_0xe2f6('0x1a')]);_0x3e93e8['offset']=qs['offset'](_0x3e0556[_0xe2f6('0x2e')]['offset']);}_0x3e93e8[_0xe2f6('0x34')]=qs[_0xe2f6('0x35')](_0x3e0556[_0xe2f6('0x2e')][_0xe2f6('0x35')]);_0x3e93e8[_0xe2f6('0x36')]=qs[_0xe2f6('0x37')](_[_0xe2f6('0x38')](_0x3e0556[_0xe2f6('0x2e')],_0x27aa96[_0xe2f6('0x37')]),_0x3eecb0);if(_0x3e0556[_0xe2f6('0x2e')][_0xe2f6('0x39')]){_0x3e93e8['where']=_['merge'](_0x3e93e8['where'],{'$or':_[_0xe2f6('0x29')](_0x3eecb0,function(_0x51827a){if(_0x51827a[_0xe2f6('0x2b')]!=='VIRTUAL'){var _0x2df01f={};_0x2df01f[_0x51827a[_0xe2f6('0x26')]]={'$like':'%'+_0x3e0556[_0xe2f6('0x2e')][_0xe2f6('0x39')]+'%'};return _0x2df01f;}})});}_0x3e93e8=_['merge']({},_0x3e93e8,_0x3e0556[_0xe2f6('0x3a')]);var _0x4256fc={'where':_0x3e93e8[_0xe2f6('0x36')]};return db[_0xe2f6('0x3b')]['count'](_0x4256fc)[_0xe2f6('0x21')](function(_0x4817e3){_0xb28d4c[_0xe2f6('0x1b')]=_0x4817e3;if(_0x3e0556['query']['includeAll']){_0x3e93e8[_0xe2f6('0x3c')]=[{'all':!![]}];}return db[_0xe2f6('0x3b')][_0xe2f6('0x3d')](_0x3e93e8);})[_0xe2f6('0x21')](function(_0xc488d5){_0xb28d4c[_0xe2f6('0x3e')]=_0xc488d5;return _0xb28d4c;})[_0xe2f6('0x21')](respondWithFilteredResult(_0x44d941,_0x3e93e8))[_0xe2f6('0x3f')](handleError(_0x44d941,null));};exports[_0xe2f6('0x40')]=function(_0x52a1b4,_0x271b9b){var _0x4f2f4a={'raw':![],'where':{'id':_0x52a1b4['params']['id']}},_0x3fcc06={};_0x3fcc06['model']=_[_0xe2f6('0x41')](db['ServicenowConfiguration'][_0xe2f6('0x2a')]);_0x3fcc06[_0xe2f6('0x2e')]=_[_0xe2f6('0x41')](_0x52a1b4[_0xe2f6('0x2e')]);_0x3fcc06[_0xe2f6('0x37')]=_[_0xe2f6('0x30')](_0x3fcc06[_0xe2f6('0x2d')],_0x3fcc06[_0xe2f6('0x2e')]);_0x4f2f4a['attributes']=_[_0xe2f6('0x30')](_0x3fcc06[_0xe2f6('0x2d')],qs['fields'](_0x52a1b4[_0xe2f6('0x2e')][_0xe2f6('0x31')]));_0x4f2f4a[_0xe2f6('0x2f')]=_0x4f2f4a[_0xe2f6('0x2f')][_0xe2f6('0x42')]?_0x4f2f4a[_0xe2f6('0x2f')]:_0x3fcc06[_0xe2f6('0x2d')];if(_0x52a1b4[_0xe2f6('0x2e')][_0xe2f6('0x43')]){_0x4f2f4a[_0xe2f6('0x3c')]=[{'all':!![]}];}_0x4f2f4a=_['merge']({},_0x4f2f4a,_0x52a1b4[_0xe2f6('0x3a')]);return db[_0xe2f6('0x3b')][_0xe2f6('0x44')](_0x4f2f4a)[_0xe2f6('0x21')](handleEntityNotFound(_0x271b9b,null))['then'](respondWithResult(_0x271b9b,null))['catch'](handleError(_0x271b9b,null));};exports['create']=function(_0x119c51,_0x1d5ecc){return db['ServicenowConfiguration'][_0xe2f6('0x45')](_0x119c51['body'],{})[_0xe2f6('0x21')](respondWithResult(_0x1d5ecc,0xc9))[_0xe2f6('0x3f')](handleError(_0x1d5ecc,null));};exports['update']=function(_0x40aa66,_0x11fca7){if(_0x40aa66[_0xe2f6('0x46')]['id']){delete _0x40aa66[_0xe2f6('0x46')]['id'];}return db[_0xe2f6('0x3b')]['find']({'where':{'id':_0x40aa66['params']['id']}})[_0xe2f6('0x21')](handleEntityNotFound(_0x11fca7,null))[_0xe2f6('0x21')](saveUpdates(_0x40aa66['body'],null))[_0xe2f6('0x21')](respondWithResult(_0x11fca7,null))[_0xe2f6('0x3f')](handleError(_0x11fca7,null));};exports[_0xe2f6('0x22')]=function(_0x1f9eef,_0x1fd9e6){return db[_0xe2f6('0x3b')][_0xe2f6('0x44')]({'where':{'id':_0x1f9eef[_0xe2f6('0x47')]['id']}})[_0xe2f6('0x21')](handleEntityNotFound(_0x1fd9e6,null))[_0xe2f6('0x21')](removeEntity(_0x1fd9e6,null))[_0xe2f6('0x3f')](handleError(_0x1fd9e6,null));};exports[_0xe2f6('0x48')]=function(_0x4fbdda,_0x4cffbc,_0x521db1){var _0x45290c={};var _0x1849b1={};var _0x1b6662;var _0x1ab411;return db[_0xe2f6('0x3b')][_0xe2f6('0x49')]({'where':{'id':_0x4fbdda['params']['id']}})[_0xe2f6('0x21')](handleEntityNotFound(_0x4cffbc,null))[_0xe2f6('0x21')](function(_0x30b67c){if(_0x30b67c){_0x1b6662=_0x30b67c;_0x1849b1[_0xe2f6('0x2d')]=_[_0xe2f6('0x41')](db[_0xe2f6('0x4a')]['rawAttributes']);_0x1849b1[_0xe2f6('0x2e')]=_[_0xe2f6('0x41')](_0x4fbdda[_0xe2f6('0x2e')]);_0x1849b1[_0xe2f6('0x37')]=_[_0xe2f6('0x30')](_0x1849b1[_0xe2f6('0x2d')],_0x1849b1['query']);_0x45290c[_0xe2f6('0x2f')]=_[_0xe2f6('0x30')](_0x1849b1[_0xe2f6('0x2d')],qs['fields'](_0x4fbdda['query'][_0xe2f6('0x31')]));_0x45290c['attributes']=_0x45290c[_0xe2f6('0x2f')][_0xe2f6('0x42')]?_0x45290c[_0xe2f6('0x2f')]:_0x1849b1[_0xe2f6('0x2d')];_0x45290c[_0xe2f6('0x34')]=qs[_0xe2f6('0x35')](_0x4fbdda['query'][_0xe2f6('0x35')]);_0x45290c[_0xe2f6('0x36')]=qs[_0xe2f6('0x37')](_['pick'](_0x4fbdda[_0xe2f6('0x2e')],_0x1849b1[_0xe2f6('0x37')]));if(_0x4fbdda[_0xe2f6('0x2e')][_0xe2f6('0x39')]){_0x45290c['where']=_[_0xe2f6('0x4b')](_0x45290c[_0xe2f6('0x36')],{'$or':_[_0xe2f6('0x29')](_0x45290c[_0xe2f6('0x2f')],function(_0x3a1385){var _0x1fac74={};_0x1fac74[_0x3a1385]={'$like':'%'+_0x4fbdda[_0xe2f6('0x2e')][_0xe2f6('0x39')]+'%'};return _0x1fac74;})});}_0x45290c=_[_0xe2f6('0x4b')]({},_0x45290c,_0x4fbdda['options']);return _0x1b6662[_0xe2f6('0x48')](_0x45290c);}})[_0xe2f6('0x21')](function(_0x5788f5){if(_0x5788f5){_0x1ab411=_0x5788f5[_0xe2f6('0x42')];if(!_0x4fbdda[_0xe2f6('0x2e')][_0xe2f6('0x32')](_0xe2f6('0x33'))){_0x45290c[_0xe2f6('0x1a')]=qs[_0xe2f6('0x1a')](_0x4fbdda[_0xe2f6('0x2e')]['limit']);_0x45290c[_0xe2f6('0x18')]=qs['offset'](_0x4fbdda[_0xe2f6('0x2e')][_0xe2f6('0x18')]);}return _0x1b6662[_0xe2f6('0x48')](_0x45290c);}})[_0xe2f6('0x21')](function(_0x17d9d0){if(_0x17d9d0){return _0x17d9d0?{'count':_0x1ab411,'rows':_0x17d9d0}:null;}})[_0xe2f6('0x21')](respondWithResult(_0x4cffbc,null))[_0xe2f6('0x3f')](handleError(_0x4cffbc,null));};exports['getSubjects']=function(_0xa82e5e,_0x4460ed,_0x1fd6a0){var _0x2c7a4c={};var _0x334022={};var _0x55b840;var _0x20e8c0;return db[_0xe2f6('0x3b')][_0xe2f6('0x49')]({'where':{'id':_0xa82e5e[_0xe2f6('0x47')]['id']}})[_0xe2f6('0x21')](handleEntityNotFound(_0x4460ed,null))[_0xe2f6('0x21')](function(_0x1d3bb5){if(_0x1d3bb5){_0x55b840=_0x1d3bb5;_0x334022[_0xe2f6('0x2d')]=_['keys'](db['ServicenowField'][_0xe2f6('0x2a')]);_0x334022[_0xe2f6('0x2e')]=_['keys'](_0xa82e5e['query']);_0x334022[_0xe2f6('0x37')]=_['intersection'](_0x334022[_0xe2f6('0x2d')],_0x334022[_0xe2f6('0x2e')]);_0x2c7a4c['attributes']=_['intersection'](_0x334022[_0xe2f6('0x2d')],qs[_0xe2f6('0x31')](_0xa82e5e[_0xe2f6('0x2e')][_0xe2f6('0x31')]));_0x2c7a4c[_0xe2f6('0x2f')]=_0x2c7a4c['attributes'][_0xe2f6('0x42')]?_0x2c7a4c[_0xe2f6('0x2f')]:_0x334022[_0xe2f6('0x2d')];_0x2c7a4c['order']=qs['sort'](_0xa82e5e[_0xe2f6('0x2e')]['sort']);_0x2c7a4c['where']=qs[_0xe2f6('0x37')](_[_0xe2f6('0x38')](_0xa82e5e['query'],_0x334022[_0xe2f6('0x37')]));if(_0xa82e5e[_0xe2f6('0x2e')][_0xe2f6('0x39')]){_0x2c7a4c['where']=_['merge'](_0x2c7a4c[_0xe2f6('0x36')],{'$or':_[_0xe2f6('0x29')](_0x2c7a4c[_0xe2f6('0x2f')],function(_0x2f2b70){var _0x5c576f={};_0x5c576f[_0x2f2b70]={'$like':'%'+_0xa82e5e[_0xe2f6('0x2e')]['filter']+'%'};return _0x5c576f;})});}_0x2c7a4c=_[_0xe2f6('0x4b')]({},_0x2c7a4c,_0xa82e5e[_0xe2f6('0x3a')]);return _0x55b840[_0xe2f6('0x4c')](_0x2c7a4c);}})[_0xe2f6('0x21')](function(_0x2c17e3){if(_0x2c17e3){_0x20e8c0=_0x2c17e3[_0xe2f6('0x42')];if(!_0xa82e5e[_0xe2f6('0x2e')]['hasOwnProperty'](_0xe2f6('0x33'))){_0x2c7a4c[_0xe2f6('0x1a')]=qs[_0xe2f6('0x1a')](_0xa82e5e[_0xe2f6('0x2e')][_0xe2f6('0x1a')]);_0x2c7a4c[_0xe2f6('0x18')]=qs[_0xe2f6('0x18')](_0xa82e5e[_0xe2f6('0x2e')][_0xe2f6('0x18')]);}return _0x55b840['getSubjects'](_0x2c7a4c);}})[_0xe2f6('0x21')](function(_0x31a19e){if(_0x31a19e){return _0x31a19e?{'count':_0x20e8c0,'rows':_0x31a19e}:null;}})[_0xe2f6('0x21')](respondWithResult(_0x4460ed,null))[_0xe2f6('0x3f')](handleError(_0x4460ed,null));};exports[_0xe2f6('0x4d')]=function(_0x2796f8,_0xf1bb54,_0x16af8a){var _0x4ddcb8={};var _0x459ef={};var _0x159313;var _0x5b881b;return db['ServicenowConfiguration'][_0xe2f6('0x49')]({'where':{'id':_0x2796f8[_0xe2f6('0x47')]['id']}})[_0xe2f6('0x21')](handleEntityNotFound(_0xf1bb54,null))[_0xe2f6('0x21')](function(_0x45984d){if(_0x45984d){_0x159313=_0x45984d;_0x459ef[_0xe2f6('0x2d')]=_['keys'](db[_0xe2f6('0x4a')][_0xe2f6('0x2a')]);_0x459ef[_0xe2f6('0x2e')]=_['keys'](_0x2796f8[_0xe2f6('0x2e')]);_0x459ef[_0xe2f6('0x37')]=_[_0xe2f6('0x30')](_0x459ef[_0xe2f6('0x2d')],_0x459ef[_0xe2f6('0x2e')]);_0x4ddcb8[_0xe2f6('0x2f')]=_[_0xe2f6('0x30')](_0x459ef[_0xe2f6('0x2d')],qs['fields'](_0x2796f8['query'][_0xe2f6('0x31')]));_0x4ddcb8[_0xe2f6('0x2f')]=_0x4ddcb8[_0xe2f6('0x2f')][_0xe2f6('0x42')]?_0x4ddcb8[_0xe2f6('0x2f')]:_0x459ef[_0xe2f6('0x2d')];_0x4ddcb8['order']=qs[_0xe2f6('0x35')](_0x2796f8[_0xe2f6('0x2e')][_0xe2f6('0x35')]);_0x4ddcb8['where']=qs[_0xe2f6('0x37')](_[_0xe2f6('0x38')](_0x2796f8[_0xe2f6('0x2e')],_0x459ef[_0xe2f6('0x37')]));if(_0x2796f8[_0xe2f6('0x2e')]['filter']){_0x4ddcb8['where']=_['merge'](_0x4ddcb8[_0xe2f6('0x36')],{'$or':_[_0xe2f6('0x29')](_0x4ddcb8[_0xe2f6('0x2f')],function(_0x16bca6){var _0xf94060={};_0xf94060[_0x16bca6]={'$like':'%'+_0x2796f8[_0xe2f6('0x2e')][_0xe2f6('0x39')]+'%'};return _0xf94060;})});}_0x4ddcb8=_[_0xe2f6('0x4b')]({},_0x4ddcb8,_0x2796f8[_0xe2f6('0x3a')]);return _0x159313[_0xe2f6('0x4d')](_0x4ddcb8);}})[_0xe2f6('0x21')](function(_0x3606d4){if(_0x3606d4){_0x5b881b=_0x3606d4[_0xe2f6('0x42')];if(!_0x2796f8['query']['hasOwnProperty'](_0xe2f6('0x33'))){_0x4ddcb8[_0xe2f6('0x1a')]=qs[_0xe2f6('0x1a')](_0x2796f8[_0xe2f6('0x2e')][_0xe2f6('0x1a')]);_0x4ddcb8[_0xe2f6('0x18')]=qs['offset'](_0x2796f8['query']['offset']);}return _0x159313[_0xe2f6('0x4d')](_0x4ddcb8);}})[_0xe2f6('0x21')](function(_0x2c0dc9){if(_0x2c0dc9){return _0x2c0dc9?{'count':_0x5b881b,'rows':_0x2c0dc9}:null;}})[_0xe2f6('0x21')](respondWithResult(_0xf1bb54,null))[_0xe2f6('0x3f')](handleError(_0xf1bb54,null));};
\ No newline at end of file
index 06e6935..b8e8b08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd506=['rimraf','define','int_servicenow_configurations','lodash'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd506,0x197));var _0x6d50=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xd506[_0x55abd9];return _0x3e5669;};'use strict';var _=require(_0x6d50('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d50('0x1'));var config=require('../../config/environment');var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x167f4e,_0x23c343){return _0x167f4e[_0x6d50('0x2')]('ServicenowConfiguration',attributes,{'tableName':_0x6d50('0x3'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb1fa=['./intServicenowConfiguration.attributes','define','int_servicenow_configurations','../../config/logger','moment'];(function(_0x123d91,_0x511da7){var _0x1f9d90=function(_0x49560a){while(--_0x49560a){_0x123d91['push'](_0x123d91['shift']());}};_0x1f9d90(++_0x511da7);}(_0xb1fa,0x9e));var _0xab1f=function(_0x2ddff1,_0x4b135d){_0x2ddff1=_0x2ddff1-0x0;var _0x5232e0=_0xb1fa[_0x2ddff1];return _0x5232e0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab1f('0x0'))('api');var moment=require(_0xab1f('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab1f('0x2'));module['exports']=function(_0x50ada8,_0x4ee73b){return _0x50ada8[_0xab1f('0x3')]('ServicenowConfiguration',attributes,{'tableName':_0xab1f('0x4'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 855bf4f..52ae5bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fcf=['error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5e196c,_0x2a1cda){var _0x4d22ff=function(_0x132465){while(--_0x132465){_0x5e196c['push'](_0x5e196c['shift']());}};_0x4d22ff(++_0x2a1cda);}(_0x0fcf,0x145));var _0xf0fc=function(_0x2a1151,_0x183c34){_0x2a1151=_0x2a1151-0x0;var _0x41b691=_0x0fcf[_0x2a1151];return _0x41b691;};'use strict';var _=require(_0xf0fc('0x0'));var util=require('util');var moment=require(_0xf0fc('0x1'));var BPromise=require(_0xf0fc('0x2'));var rs=require(_0xf0fc('0x3'));var fs=require('fs');var Redis=require(_0xf0fc('0x4'));var db=require(_0xf0fc('0x5'))['db'];var utils=require(_0xf0fc('0x6'));var logger=require(_0xf0fc('0x7'))(_0xf0fc('0x8'));var config=require(_0xf0fc('0x9'));var jayson=require(_0xf0fc('0xa'));var client=jayson[_0xf0fc('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x527cc2,_0x114879,_0x51a104){return new BPromise(function(_0x2d55f2,_0xde587f){return client[_0xf0fc('0xc')](_0x527cc2,_0x51a104)[_0xf0fc('0xd')](function(_0x1f989b){logger[_0xf0fc('0xe')](_0xf0fc('0xf'),_0x114879,_0xf0fc('0x10'));logger[_0xf0fc('0x11')](_0xf0fc('0x12'),_0x114879,_0xf0fc('0x10'),JSON[_0xf0fc('0x13')](_0x1f989b));if(_0x1f989b['error']){if(_0x1f989b[_0xf0fc('0x14')][_0xf0fc('0x15')]===0x1f4){logger[_0xf0fc('0x14')](_0xf0fc('0xf'),_0x114879,_0x1f989b[_0xf0fc('0x14')]['message']);return _0xde587f(_0x1f989b['error'][_0xf0fc('0x16')]);}logger[_0xf0fc('0x14')](_0xf0fc('0xf'),_0x114879,_0x1f989b[_0xf0fc('0x14')][_0xf0fc('0x16')]);return _0x2d55f2(_0x1f989b[_0xf0fc('0x14')][_0xf0fc('0x16')]);}else{logger['info'](_0xf0fc('0xf'),_0x114879,_0xf0fc('0x10'));_0x2d55f2(_0x1f989b['result']['message']);}})['catch'](function(_0x4abcfc){logger[_0xf0fc('0x14')]('ServicenowConfiguration,\x20%s,\x20%s',_0x114879,_0x4abcfc);_0xde587f(_0x4abcfc);});});}
\ No newline at end of file
+var _0xb1fc=['ServicenowConfiguration,\x20%s,\x20%s','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0xb1fc,0xb3));var _0xcb1f=function(_0x1bb8ec,_0x429b95){_0x1bb8ec=_0x1bb8ec-0x0;var _0x5f1b72=_0xb1fc[_0x1bb8ec];return _0x5f1b72;};'use strict';var _=require(_0xcb1f('0x0'));var util=require(_0xcb1f('0x1'));var moment=require('moment');var BPromise=require(_0xcb1f('0x2'));var rs=require(_0xcb1f('0x3'));var fs=require('fs');var Redis=require(_0xcb1f('0x4'));var db=require(_0xcb1f('0x5'))['db'];var utils=require(_0xcb1f('0x6'));var logger=require(_0xcb1f('0x7'))(_0xcb1f('0x8'));var config=require(_0xcb1f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcb1f('0xa')][_0xcb1f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fcf0c,_0x348b02,_0x372433){return new BPromise(function(_0x3a79cb,_0x44281a){return client[_0xcb1f('0xc')](_0x2fcf0c,_0x372433)['then'](function(_0x423aac){logger['info'](_0xcb1f('0xd'),_0x348b02,'request\x20sent');logger[_0xcb1f('0xe')](_0xcb1f('0xf'),_0x348b02,_0xcb1f('0x10'),JSON[_0xcb1f('0x11')](_0x423aac));if(_0x423aac[_0xcb1f('0x12')]){if(_0x423aac[_0xcb1f('0x12')][_0xcb1f('0x13')]===0x1f4){logger[_0xcb1f('0x12')](_0xcb1f('0xd'),_0x348b02,_0x423aac['error'][_0xcb1f('0x14')]);return _0x44281a(_0x423aac[_0xcb1f('0x12')][_0xcb1f('0x14')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x348b02,_0x423aac[_0xcb1f('0x12')][_0xcb1f('0x14')]);return _0x3a79cb(_0x423aac[_0xcb1f('0x12')]['message']);}else{logger[_0xcb1f('0x15')](_0xcb1f('0xd'),_0x348b02,'request\x20sent');_0x3a79cb(_0x423aac[_0xcb1f('0x16')]['message']);}})[_0xcb1f('0x17')](function(_0x1e5873){logger[_0xcb1f('0x12')]('ServicenowConfiguration,\x20%s,\x20%s',_0x348b02,_0x1e5873);_0x44281a(_0x1e5873);});});}
\ No newline at end of file
index c223191..9942e35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a23=['get','index','/:id','isAuthenticated','post','create','update','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3a0fc1,_0x76ba20){var _0x5e0111=function(_0x42ce47){while(--_0x42ce47){_0x3a0fc1['push'](_0x3a0fc1['shift']());}};_0x5e0111(++_0x76ba20);}(_0x0a23,0x14e));var _0x30a2=function(_0x438e75,_0x4ef9d5){_0x438e75=_0x438e75-0x0;var _0x2f5edb=_0x0a23[_0x438e75];return _0x2f5edb;};'use strict';var multer=require('multer');var util=require(_0x30a2('0x0'));var path=require('path');var timeout=require(_0x30a2('0x1'));var express=require(_0x30a2('0x2'));var router=express[_0x30a2('0x3')]();var fs_extra=require(_0x30a2('0x4'));var auth=require(_0x30a2('0x5'));var interaction=require(_0x30a2('0x6'));var config=require(_0x30a2('0x7'));var controller=require('./intServicenowField.controller');router[_0x30a2('0x8')]('/',auth['isAuthenticated'](),controller[_0x30a2('0x9')]);router['get'](_0x30a2('0xa'),auth[_0x30a2('0xb')](),controller['show']);router[_0x30a2('0xc')]('/',auth[_0x30a2('0xb')](),controller[_0x30a2('0xd')]);router['put']('/:id',auth[_0x30a2('0xb')](),controller[_0x30a2('0xe')]);router[_0x30a2('0xf')](_0x30a2('0xa'),auth[_0x30a2('0xb')](),controller[_0x30a2('0x10')]);module[_0x30a2('0x11')]=router;
\ No newline at end of file
+var _0xb97f=['../../components/interaction/service','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','Router','../../components/auth/service'];(function(_0x1b1e9c,_0x5c77d8){var _0x5de36a=function(_0x39a0cb){while(--_0x39a0cb){_0x1b1e9c['push'](_0x1b1e9c['shift']());}};_0x5de36a(++_0x5c77d8);}(_0xb97f,0x12d));var _0xfb97=function(_0x18c32e,_0x1ffd75){_0x18c32e=_0x18c32e-0x0;var _0xfc3c5=_0xb97f[_0x18c32e];return _0xfc3c5;};'use strict';var multer=require('multer');var util=require(_0xfb97('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfb97('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xfb97('0x2'));var interaction=require(_0xfb97('0x3'));var config=require('../../config/environment');var controller=require(_0xfb97('0x4'));router[_0xfb97('0x5')]('/',auth[_0xfb97('0x6')](),controller[_0xfb97('0x7')]);router[_0xfb97('0x5')](_0xfb97('0x8'),auth['isAuthenticated'](),controller[_0xfb97('0x9')]);router[_0xfb97('0xa')]('/',auth[_0xfb97('0x6')](),controller[_0xfb97('0xb')]);router[_0xfb97('0xc')](_0xfb97('0x8'),auth[_0xfb97('0x6')](),controller['update']);router[_0xfb97('0xd')]('/:id',auth[_0xfb97('0x6')](),controller[_0xfb97('0xe')]);module[_0xfb97('0xf')]=router;
\ No newline at end of file
index ed2b163..e3def25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfae3=['keyValue','picklist','string','STRING','ENUM','BOOLEAN','exports','variable','customVariable'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0xfae3,0x16e));var _0x3fae=function(_0x1c05c0,_0x38e872){_0x1c05c0=_0x1c05c0-0x0;var _0x4b8d87=_0xfae3[_0x1c05c0];return _0x4b8d87;};'use strict';var Sequelize=require('sequelize');module[_0x3fae('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0x3fae('0x1'),_0x3fae('0x2'),_0x3fae('0x3'),_0x3fae('0x4')),'defaultValue':_0x3fae('0x5')},'content':{'type':Sequelize[_0x3fae('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x3fae('0x7')]('string',_0x3fae('0x1'),_0x3fae('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3fae('0x6')]},'nameField':{'type':Sequelize[_0x3fae('0x6')]},'customField':{'type':Sequelize[_0x3fae('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3fae('0x6')]}};
\ No newline at end of file
+var _0x3990=['string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3ee7e4,_0x304097){var _0x1aec5e=function(_0x5ec005){while(--_0x5ec005){_0x3ee7e4['push'](_0x3ee7e4['shift']());}};_0x1aec5e(++_0x304097);}(_0x3990,0x14a));var _0x0399=function(_0x49965d,_0x11f614){_0x49965d=_0x49965d-0x0;var _0x46e0ae=_0x3990[_0x49965d];return _0x46e0ae;};'use strict';var Sequelize=require(_0x0399('0x0'));module[_0x0399('0x1')]={'type':{'type':Sequelize[_0x0399('0x2')](_0x0399('0x3'),_0x0399('0x4'),_0x0399('0x5'),'keyValue',_0x0399('0x6')),'defaultValue':_0x0399('0x3')},'content':{'type':Sequelize[_0x0399('0x7')]},'key':{'type':Sequelize[_0x0399('0x7')]},'keyType':{'type':Sequelize[_0x0399('0x2')](_0x0399('0x3'),_0x0399('0x4'),_0x0399('0x5'))},'keyContent':{'type':Sequelize[_0x0399('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0399('0x7')]},'customField':{'type':Sequelize[_0x0399('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 651dba8..9780eeb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63b9=['create','body','destroy','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','undefined','count','offset','limit','status','json','reject','save','update','then','error','stack','name','send','map','ServicenowField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','params','include'];(function(_0x3ba16b,_0x546899){var _0x54ccdc=function(_0x10f308){while(--_0x10f308){_0x3ba16b['push'](_0x3ba16b['shift']());}};_0x54ccdc(++_0x546899);}(_0x63b9,0x130));var _0x963b=function(_0x11c030,_0x132158){_0x11c030=_0x11c030-0x0;var _0x3877f0=_0x63b9[_0x11c030];return _0x3877f0;};'use strict';var emlformat=require(_0x963b('0x0'));var rimraf=require(_0x963b('0x1'));var zipdir=require(_0x963b('0x2'));var jsonpatch=require(_0x963b('0x3'));var rp=require(_0x963b('0x4'));var moment=require(_0x963b('0x5'));var BPromise=require(_0x963b('0x6'));var Mustache=require(_0x963b('0x7'));var util=require(_0x963b('0x8'));var path=require(_0x963b('0x9'));var sox=require(_0x963b('0xa'));var csv=require(_0x963b('0xb'));var ejs=require(_0x963b('0xc'));var fs=require('fs');var fs_extra=require(_0x963b('0xd'));var _=require(_0x963b('0xe'));var squel=require(_0x963b('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x963b('0xb'));var querystring=require(_0x963b('0x10'));var Papa=require(_0x963b('0x11'));var Redis=require(_0x963b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x963b('0x13'));var as=require(_0x963b('0x14'));var hardwareService=require(_0x963b('0x15'));var logger=require(_0x963b('0x16'))(_0x963b('0x17'));var utils=require(_0x963b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x963b('0x19'));var db=require(_0x963b('0x1a'))['db'];function respondWithStatusCode(_0x4cb5b6,_0x49eb5c){_0x49eb5c=_0x49eb5c||0xcc;return function(_0x2a4832){if(_0x2a4832){return _0x4cb5b6[_0x963b('0x1b')](_0x49eb5c);}return _0x4cb5b6['status'](_0x49eb5c)[_0x963b('0x1c')]();};}function respondWithResult(_0x110539,_0x24ac18){_0x24ac18=_0x24ac18||0xc8;return function(_0x4742b4){if(_0x4742b4){return _0x110539['status'](_0x24ac18)['json'](_0x4742b4);}};}function respondWithFilteredResult(_0x53d70f,_0x175529){return function(_0x50b484){if(_0x50b484){var _0x5d87d9=typeof _0x175529['offset']===_0x963b('0x1d')&&typeof _0x175529['limit']==='undefined';var _0x163a41=_0x50b484[_0x963b('0x1e')];var _0x4e5dcd=_0x5d87d9?0x0:_0x175529[_0x963b('0x1f')];var _0x4bbe79=_0x5d87d9?_0x50b484[_0x963b('0x1e')]:_0x175529[_0x963b('0x1f')]+_0x175529[_0x963b('0x20')];var _0x5b3632;if(_0x4bbe79>=_0x163a41){_0x4bbe79=_0x163a41;_0x5b3632=0xc8;}else{_0x5b3632=0xce;}_0x53d70f[_0x963b('0x21')](_0x5b3632);return _0x53d70f['set']('Content-Range',_0x4e5dcd+'-'+_0x4bbe79+'/'+_0x163a41)[_0x963b('0x22')](_0x50b484);}return null;};}function patchUpdates(_0x4fe9d1){return function(_0xf6d142){try{jsonpatch['apply'](_0xf6d142,_0x4fe9d1,!![]);}catch(_0x37be79){return BPromise[_0x963b('0x23')](_0x37be79);}return _0xf6d142[_0x963b('0x24')]();};}function saveUpdates(_0x2ae0a9,_0x242c0b){return function(_0x34fc87){if(_0x34fc87){return _0x34fc87[_0x963b('0x25')](_0x2ae0a9)[_0x963b('0x26')](function(_0x3a6bb7){return _0x3a6bb7;});}return null;};}function removeEntity(_0x52ff2d,_0x56b84a){return function(_0x404506){if(_0x404506){return _0x404506['destroy']()[_0x963b('0x26')](function(){_0x52ff2d['status'](0xcc)[_0x963b('0x1c')]();});}};}function handleEntityNotFound(_0x227b15,_0x34e178){return function(_0x3f8214){if(!_0x3f8214){_0x227b15['sendStatus'](0x194);}return _0x3f8214;};}function handleError(_0x2db2af,_0x5d482b){_0x5d482b=_0x5d482b||0x1f4;return function(_0x3f4b13){logger[_0x963b('0x27')](_0x3f4b13[_0x963b('0x28')]);if(_0x3f4b13[_0x963b('0x29')]){delete _0x3f4b13[_0x963b('0x29')];}_0x2db2af[_0x963b('0x21')](_0x5d482b)[_0x963b('0x2a')](_0x3f4b13);};}exports['index']=function(_0x169f5b,_0x293aff){var _0x585001={},_0x5645a2={},_0x8669={'count':0x0,'rows':[]};var _0x556f6c=_[_0x963b('0x2b')](db[_0x963b('0x2c')][_0x963b('0x2d')],function(_0xd8d23c){return{'name':_0xd8d23c[_0x963b('0x2e')],'type':_0xd8d23c[_0x963b('0x2f')][_0x963b('0x30')]};});_0x5645a2[_0x963b('0x31')]=_[_0x963b('0x2b')](_0x556f6c,'name');_0x5645a2[_0x963b('0x32')]=_[_0x963b('0x33')](_0x169f5b[_0x963b('0x32')]);_0x5645a2[_0x963b('0x34')]=_[_0x963b('0x35')](_0x5645a2[_0x963b('0x31')],_0x5645a2[_0x963b('0x32')]);_0x585001[_0x963b('0x36')]=_[_0x963b('0x35')](_0x5645a2['model'],qs[_0x963b('0x37')](_0x169f5b[_0x963b('0x32')]['fields']));_0x585001['attributes']=_0x585001[_0x963b('0x36')][_0x963b('0x38')]?_0x585001[_0x963b('0x36')]:_0x5645a2['model'];if(!_0x169f5b[_0x963b('0x32')]['hasOwnProperty'](_0x963b('0x39'))){_0x585001[_0x963b('0x20')]=qs['limit'](_0x169f5b[_0x963b('0x32')][_0x963b('0x20')]);_0x585001[_0x963b('0x1f')]=qs[_0x963b('0x1f')](_0x169f5b['query'][_0x963b('0x1f')]);}_0x585001[_0x963b('0x3a')]=qs['sort'](_0x169f5b[_0x963b('0x32')]['sort']);_0x585001[_0x963b('0x3b')]=qs[_0x963b('0x34')](_[_0x963b('0x3c')](_0x169f5b[_0x963b('0x32')],_0x5645a2[_0x963b('0x34')]),_0x556f6c);if(_0x169f5b[_0x963b('0x32')][_0x963b('0x3d')]){_0x585001['where']=_['merge'](_0x585001[_0x963b('0x3b')],{'$or':_[_0x963b('0x2b')](_0x556f6c,function(_0x3e4157){if(_0x3e4157[_0x963b('0x2f')]!==_0x963b('0x3e')){var _0x54af89={};_0x54af89[_0x3e4157[_0x963b('0x29')]]={'$like':'%'+_0x169f5b['query'][_0x963b('0x3d')]+'%'};return _0x54af89;}})});}_0x585001=_[_0x963b('0x3f')]({},_0x585001,_0x169f5b[_0x963b('0x40')]);var _0x46b550={'where':_0x585001[_0x963b('0x3b')]};return db[_0x963b('0x2c')][_0x963b('0x1e')](_0x46b550)['then'](function(_0x1bfdbe){_0x8669[_0x963b('0x1e')]=_0x1bfdbe;if(_0x169f5b[_0x963b('0x32')][_0x963b('0x41')]){_0x585001['include']=[{'all':!![]}];}return db[_0x963b('0x2c')][_0x963b('0x42')](_0x585001);})[_0x963b('0x26')](function(_0x4ca3d5){_0x8669[_0x963b('0x43')]=_0x4ca3d5;return _0x8669;})['then'](respondWithFilteredResult(_0x293aff,_0x585001))[_0x963b('0x44')](handleError(_0x293aff,null));};exports['show']=function(_0x45c0ed,_0x49d23a){var _0x1538c5={'raw':!![],'where':{'id':_0x45c0ed[_0x963b('0x45')]['id']}},_0x4d4d20={};_0x4d4d20[_0x963b('0x31')]=_[_0x963b('0x33')](db[_0x963b('0x2c')]['rawAttributes']);_0x4d4d20[_0x963b('0x32')]=_[_0x963b('0x33')](_0x45c0ed[_0x963b('0x32')]);_0x4d4d20[_0x963b('0x34')]=_[_0x963b('0x35')](_0x4d4d20[_0x963b('0x31')],_0x4d4d20['query']);_0x1538c5['attributes']=_[_0x963b('0x35')](_0x4d4d20[_0x963b('0x31')],qs[_0x963b('0x37')](_0x45c0ed[_0x963b('0x32')]['fields']));_0x1538c5[_0x963b('0x36')]=_0x1538c5['attributes'][_0x963b('0x38')]?_0x1538c5[_0x963b('0x36')]:_0x4d4d20['model'];if(_0x45c0ed[_0x963b('0x32')][_0x963b('0x41')]){_0x1538c5[_0x963b('0x46')]=[{'all':!![]}];}_0x1538c5=_['merge']({},_0x1538c5,_0x45c0ed['options']);return db['ServicenowField']['find'](_0x1538c5)[_0x963b('0x26')](handleEntityNotFound(_0x49d23a,null))[_0x963b('0x26')](respondWithResult(_0x49d23a,null))[_0x963b('0x44')](handleError(_0x49d23a,null));};exports[_0x963b('0x47')]=function(_0x58aca8,_0x444191){return db[_0x963b('0x2c')]['create'](_0x58aca8['body'],{})[_0x963b('0x26')](respondWithResult(_0x444191,0xc9))['catch'](handleError(_0x444191,null));};exports[_0x963b('0x25')]=function(_0x36f63e,_0x1f9fd8){if(_0x36f63e[_0x963b('0x48')]['id']){delete _0x36f63e[_0x963b('0x48')]['id'];}return db[_0x963b('0x2c')]['find']({'where':{'id':_0x36f63e[_0x963b('0x45')]['id']}})[_0x963b('0x26')](handleEntityNotFound(_0x1f9fd8,null))['then'](saveUpdates(_0x36f63e[_0x963b('0x48')],null))['then'](respondWithResult(_0x1f9fd8,null))[_0x963b('0x44')](handleError(_0x1f9fd8,null));};exports[_0x963b('0x49')]=function(_0x3751d2,_0x5f2110){return db[_0x963b('0x2c')][_0x963b('0x4a')]({'where':{'id':_0x3751d2[_0x963b('0x45')]['id']}})[_0x963b('0x26')](handleEntityNotFound(_0x5f2110,null))['then'](removeEntity(_0x5f2110,null))['catch'](handleError(_0x5f2110,null));};
\ No newline at end of file
+var _0x0c96=['order','sort','where','filter','merge','VIRTUAL','options','ServicenowField','includeAll','include','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','update','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x7c326a,_0x54361e){var _0x2a64ba=function(_0xc9f2c5){while(--_0xc9f2c5){_0x7c326a['push'](_0x7c326a['shift']());}};_0x2a64ba(++_0x54361e);}(_0x0c96,0x131));var _0x60c9=function(_0x2aa395,_0xd33991){_0x2aa395=_0x2aa395-0x0;var _0x2efa31=_0x0c96[_0x2aa395];return _0x2efa31;};'use strict';var emlformat=require(_0x60c9('0x0'));var rimraf=require(_0x60c9('0x1'));var zipdir=require(_0x60c9('0x2'));var jsonpatch=require(_0x60c9('0x3'));var rp=require(_0x60c9('0x4'));var moment=require('moment');var BPromise=require(_0x60c9('0x5'));var Mustache=require(_0x60c9('0x6'));var util=require(_0x60c9('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x60c9('0x8'));var ejs=require(_0x60c9('0x9'));var fs=require('fs');var fs_extra=require(_0x60c9('0xa'));var _=require(_0x60c9('0xb'));var squel=require(_0x60c9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x60c9('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x60c9('0xe'));var Redis=require(_0x60c9('0xf'));var authService=require(_0x60c9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x60c9('0x11'));var hardwareService=require(_0x60c9('0x12'));var logger=require(_0x60c9('0x13'))(_0x60c9('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x60c9('0x15'));var db=require(_0x60c9('0x16'))['db'];function respondWithStatusCode(_0x1334cf,_0x3a32e4){_0x3a32e4=_0x3a32e4||0xcc;return function(_0x2ba9c7){if(_0x2ba9c7){return _0x1334cf[_0x60c9('0x17')](_0x3a32e4);}return _0x1334cf[_0x60c9('0x18')](_0x3a32e4)[_0x60c9('0x19')]();};}function respondWithResult(_0x3ed6d9,_0xbf47bc){_0xbf47bc=_0xbf47bc||0xc8;return function(_0x542c9a){if(_0x542c9a){return _0x3ed6d9[_0x60c9('0x18')](_0xbf47bc)[_0x60c9('0x1a')](_0x542c9a);}};}function respondWithFilteredResult(_0x435fe3,_0x58714f){return function(_0x2905ee){if(_0x2905ee){var _0xe61068=typeof _0x58714f[_0x60c9('0x1b')]===_0x60c9('0x1c')&&typeof _0x58714f['limit']===_0x60c9('0x1c');var _0x543bbc=_0x2905ee['count'];var _0x2e3b69=_0xe61068?0x0:_0x58714f[_0x60c9('0x1b')];var _0x237363=_0xe61068?_0x2905ee[_0x60c9('0x1d')]:_0x58714f[_0x60c9('0x1b')]+_0x58714f['limit'];var _0x5161c7;if(_0x237363>=_0x543bbc){_0x237363=_0x543bbc;_0x5161c7=0xc8;}else{_0x5161c7=0xce;}_0x435fe3[_0x60c9('0x18')](_0x5161c7);return _0x435fe3[_0x60c9('0x1e')]('Content-Range',_0x2e3b69+'-'+_0x237363+'/'+_0x543bbc)['json'](_0x2905ee);}return null;};}function patchUpdates(_0x4a3505){return function(_0x1b8139){try{jsonpatch[_0x60c9('0x1f')](_0x1b8139,_0x4a3505,!![]);}catch(_0x47d65b){return BPromise['reject'](_0x47d65b);}return _0x1b8139['save']();};}function saveUpdates(_0x754a8,_0x21ed62){return function(_0x46ac87){if(_0x46ac87){return _0x46ac87[_0x60c9('0x20')](_0x754a8)['then'](function(_0x1f0374){return _0x1f0374;});}return null;};}function removeEntity(_0x1ba3a9,_0x331f1a){return function(_0x279ce8){if(_0x279ce8){return _0x279ce8[_0x60c9('0x21')]()[_0x60c9('0x22')](function(){_0x1ba3a9['status'](0xcc)[_0x60c9('0x19')]();});}};}function handleEntityNotFound(_0x46354e,_0x5789f4){return function(_0x4415fb){if(!_0x4415fb){_0x46354e['sendStatus'](0x194);}return _0x4415fb;};}function handleError(_0x3d0e81,_0x297532){_0x297532=_0x297532||0x1f4;return function(_0x45ebc0){logger[_0x60c9('0x23')](_0x45ebc0[_0x60c9('0x24')]);if(_0x45ebc0[_0x60c9('0x25')]){delete _0x45ebc0[_0x60c9('0x25')];}_0x3d0e81[_0x60c9('0x18')](_0x297532)['send'](_0x45ebc0);};}exports[_0x60c9('0x26')]=function(_0x53df63,_0xee9852){var _0x4ba2dc={},_0xe4e2eb={},_0x2f0281={'count':0x0,'rows':[]};var _0x2b6489=_[_0x60c9('0x27')](db['ServicenowField'][_0x60c9('0x28')],function(_0x5c9db9){return{'name':_0x5c9db9[_0x60c9('0x29')],'type':_0x5c9db9[_0x60c9('0x2a')][_0x60c9('0x2b')]};});_0xe4e2eb[_0x60c9('0x2c')]=_[_0x60c9('0x27')](_0x2b6489,_0x60c9('0x25'));_0xe4e2eb[_0x60c9('0x2d')]=_[_0x60c9('0x2e')](_0x53df63[_0x60c9('0x2d')]);_0xe4e2eb[_0x60c9('0x2f')]=_['intersection'](_0xe4e2eb[_0x60c9('0x2c')],_0xe4e2eb[_0x60c9('0x2d')]);_0x4ba2dc[_0x60c9('0x30')]=_[_0x60c9('0x31')](_0xe4e2eb[_0x60c9('0x2c')],qs[_0x60c9('0x32')](_0x53df63['query'][_0x60c9('0x32')]));_0x4ba2dc[_0x60c9('0x30')]=_0x4ba2dc['attributes'][_0x60c9('0x33')]?_0x4ba2dc[_0x60c9('0x30')]:_0xe4e2eb[_0x60c9('0x2c')];if(!_0x53df63[_0x60c9('0x2d')][_0x60c9('0x34')](_0x60c9('0x35'))){_0x4ba2dc[_0x60c9('0x36')]=qs[_0x60c9('0x36')](_0x53df63[_0x60c9('0x2d')][_0x60c9('0x36')]);_0x4ba2dc[_0x60c9('0x1b')]=qs[_0x60c9('0x1b')](_0x53df63['query']['offset']);}_0x4ba2dc[_0x60c9('0x37')]=qs['sort'](_0x53df63[_0x60c9('0x2d')][_0x60c9('0x38')]);_0x4ba2dc[_0x60c9('0x39')]=qs[_0x60c9('0x2f')](_['pick'](_0x53df63[_0x60c9('0x2d')],_0xe4e2eb[_0x60c9('0x2f')]),_0x2b6489);if(_0x53df63['query'][_0x60c9('0x3a')]){_0x4ba2dc[_0x60c9('0x39')]=_[_0x60c9('0x3b')](_0x4ba2dc[_0x60c9('0x39')],{'$or':_[_0x60c9('0x27')](_0x2b6489,function(_0x5ed06c){if(_0x5ed06c[_0x60c9('0x2a')]!==_0x60c9('0x3c')){var _0x2e9def={};_0x2e9def[_0x5ed06c[_0x60c9('0x25')]]={'$like':'%'+_0x53df63['query'][_0x60c9('0x3a')]+'%'};return _0x2e9def;}})});}_0x4ba2dc=_[_0x60c9('0x3b')]({},_0x4ba2dc,_0x53df63[_0x60c9('0x3d')]);var _0x124e4c={'where':_0x4ba2dc[_0x60c9('0x39')]};return db[_0x60c9('0x3e')][_0x60c9('0x1d')](_0x124e4c)[_0x60c9('0x22')](function(_0x52e4c7){_0x2f0281[_0x60c9('0x1d')]=_0x52e4c7;if(_0x53df63[_0x60c9('0x2d')][_0x60c9('0x3f')]){_0x4ba2dc[_0x60c9('0x40')]=[{'all':!![]}];}return db[_0x60c9('0x3e')]['findAll'](_0x4ba2dc);})[_0x60c9('0x22')](function(_0x5277cc){_0x2f0281[_0x60c9('0x41')]=_0x5277cc;return _0x2f0281;})[_0x60c9('0x22')](respondWithFilteredResult(_0xee9852,_0x4ba2dc))[_0x60c9('0x42')](handleError(_0xee9852,null));};exports[_0x60c9('0x43')]=function(_0x4b6dc0,_0x4afb4f){var _0x55a422={'raw':!![],'where':{'id':_0x4b6dc0[_0x60c9('0x44')]['id']}},_0x332713={};_0x332713['model']=_[_0x60c9('0x2e')](db[_0x60c9('0x3e')][_0x60c9('0x28')]);_0x332713[_0x60c9('0x2d')]=_['keys'](_0x4b6dc0[_0x60c9('0x2d')]);_0x332713[_0x60c9('0x2f')]=_[_0x60c9('0x31')](_0x332713['model'],_0x332713[_0x60c9('0x2d')]);_0x55a422[_0x60c9('0x30')]=_[_0x60c9('0x31')](_0x332713[_0x60c9('0x2c')],qs['fields'](_0x4b6dc0[_0x60c9('0x2d')][_0x60c9('0x32')]));_0x55a422[_0x60c9('0x30')]=_0x55a422[_0x60c9('0x30')][_0x60c9('0x33')]?_0x55a422[_0x60c9('0x30')]:_0x332713['model'];if(_0x4b6dc0[_0x60c9('0x2d')][_0x60c9('0x3f')]){_0x55a422['include']=[{'all':!![]}];}_0x55a422=_['merge']({},_0x55a422,_0x4b6dc0[_0x60c9('0x3d')]);return db[_0x60c9('0x3e')][_0x60c9('0x45')](_0x55a422)['then'](handleEntityNotFound(_0x4afb4f,null))['then'](respondWithResult(_0x4afb4f,null))['catch'](handleError(_0x4afb4f,null));};exports[_0x60c9('0x46')]=function(_0x495a21,_0x4a7770){return db[_0x60c9('0x3e')][_0x60c9('0x46')](_0x495a21[_0x60c9('0x47')],{})[_0x60c9('0x22')](respondWithResult(_0x4a7770,0xc9))['catch'](handleError(_0x4a7770,null));};exports['update']=function(_0x4b2d2e,_0x4be57f){if(_0x4b2d2e[_0x60c9('0x47')]['id']){delete _0x4b2d2e['body']['id'];}return db[_0x60c9('0x3e')][_0x60c9('0x45')]({'where':{'id':_0x4b2d2e[_0x60c9('0x44')]['id']}})[_0x60c9('0x22')](handleEntityNotFound(_0x4be57f,null))['then'](saveUpdates(_0x4b2d2e['body'],null))[_0x60c9('0x22')](respondWithResult(_0x4be57f,null))[_0x60c9('0x42')](handleError(_0x4be57f,null));};exports[_0x60c9('0x21')]=function(_0x506efb,_0x1b43d3){return db[_0x60c9('0x3e')][_0x60c9('0x45')]({'where':{'id':_0x506efb[_0x60c9('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b43d3,null))[_0x60c9('0x22')](removeEntity(_0x1b43d3,null))[_0x60c9('0x42')](handleError(_0x1b43d3,null));};
\ No newline at end of file
index 66532d8..dfcdb4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f06=['bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','moment'];(function(_0x58984b,_0x10b1bc){var _0x8dc535=function(_0x1b3d59){while(--_0x1b3d59){_0x58984b['push'](_0x58984b['shift']());}};_0x8dc535(++_0x10b1bc);}(_0x1f06,0x9b));var _0x61f0=function(_0x177525,_0x53298d){_0x177525=_0x177525-0x0;var _0x13e383=_0x1f06[_0x177525];return _0x13e383;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x61f0('0x0'));var BPromise=require(_0x61f0('0x1'));var rp=require(_0x61f0('0x2'));var fs=require('fs');var path=require(_0x61f0('0x3'));var rimraf=require(_0x61f0('0x4'));var config=require('../../config/environment');var attributes=require(_0x61f0('0x5'));module[_0x61f0('0x6')]=function(_0xa112c2,_0x2b180d){return _0xa112c2[_0x61f0('0x7')](_0x61f0('0x8'),attributes,{'tableName':_0x61f0('0x9'),'paranoid':![],'indexes':[{'name':_0x61f0('0xa'),'fields':[_0x61f0('0xb'),_0x61f0('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa748=['define','ServicenowField','int_servicenow_fields','servicenow_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intServicenowField.attributes'];(function(_0x4b0b3b,_0x2cabb4){var _0x243eec=function(_0x51af60){while(--_0x51af60){_0x4b0b3b['push'](_0x4b0b3b['shift']());}};_0x243eec(++_0x2cabb4);}(_0xa748,0xbb));var _0x8a74=function(_0x885c8a,_0x47960a){_0x885c8a=_0x885c8a-0x0;var _0x2624ae=_0xa748[_0x885c8a];return _0x2624ae;};'use strict';var _=require(_0x8a74('0x0'));var util=require(_0x8a74('0x1'));var logger=require(_0x8a74('0x2'))(_0x8a74('0x3'));var moment=require(_0x8a74('0x4'));var BPromise=require(_0x8a74('0x5'));var rp=require(_0x8a74('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8a74('0x7'));var config=require('../../config/environment');var attributes=require(_0x8a74('0x8'));module['exports']=function(_0x1d5b48,_0x25c238){return _0x1d5b48[_0x8a74('0x9')](_0x8a74('0xa'),attributes,{'tableName':_0x8a74('0xb'),'paranoid':![],'indexes':[{'name':_0x8a74('0xc'),'fields':['idField',_0x8a74('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 418b75e..0e3ca83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x6cdf84,_0x58bce5){var _0x750e90=function(_0x8eba8b){while(--_0x8eba8b){_0x6cdf84['push'](_0x6cdf84['shift']());}};_0x750e90(++_0x58bce5);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x22db5f,_0xc63775){_0x22db5f=_0x22db5f-0x0;var _0x384994=_0x9ffd[_0x22db5f];return _0x384994;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\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(_0x1a65e8,_0x3354ec){var _0x1508d9=function(_0x186946){while(--_0x186946){_0x1a65e8['push'](_0x1a65e8['shift']());}};_0x1508d9(++_0x3354ec);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 a1e6381..09e05c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x6bed5f,_0xccb234){var _0x4c7ade=function(_0xd329f2){while(--_0xd329f2){_0x6bed5f['push'](_0x6bed5f['shift']());}};_0x4c7ade(++_0xccb234);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x44f642,_0x5c0b1c){var _0x3cedf3=function(_0x443fd1){while(--_0x443fd1){_0x44f642['push'](_0x44f642['shift']());}};_0x3cedf3(++_0x5c0b1c);}(_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 fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
index 31c69c9..fdd8335 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x538a43,_0x2ed8ee){var _0x45696d=function(_0x2e2d7b){while(--_0x2e2d7b){_0x538a43['push'](_0x538a43['shift']());}};_0x45696d(++_0x2ed8ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x7f4d13,_0xe9aa0e){var _0x4ab736=function(_0x336f05){while(--_0x336f05){_0x7f4d13['push'](_0x7f4d13['shift']());}};_0x4ab736(++_0xe9aa0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}};
\ No newline at end of file
index 2c4e930..4042b79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x674d=['rows','catch','show','rawAttributes','length','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','options','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','JSON','PLAIN','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','values','module_fields','remove','label','endsWith','statusCode','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../components/integrations/configuration','end','json','offset','undefined','count','limit','status','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmAccount','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include'];(function(_0x2bd02f,_0x5ae68e){var _0x1f0f80=function(_0x50ecb2){while(--_0x50ecb2){_0x2bd02f['push'](_0x2bd02f['shift']());}};_0x1f0f80(++_0x5ae68e);}(_0x674d,0x11a));var _0xd674=function(_0x644560,_0x1783aa){_0x644560=_0x644560-0x0;var _0x41b76b=_0x674d[_0x644560];return _0x41b76b;};'use strict';var emlformat=require(_0xd674('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd674('0x1'));var rp=require(_0xd674('0x2'));var moment=require(_0xd674('0x3'));var BPromise=require(_0xd674('0x4'));var Mustache=require(_0xd674('0x5'));var util=require(_0xd674('0x6'));var path=require(_0xd674('0x7'));var sox=require('sox');var csv=require(_0xd674('0x8'));var ejs=require(_0xd674('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd674('0xa'));var squel=require(_0xd674('0xb'));var crypto=require(_0xd674('0xc'));var jsforce=require(_0xd674('0xd'));var deskjs=require(_0xd674('0xe'));var toCsv=require(_0xd674('0x8'));var querystring=require(_0xd674('0xf'));var Papa=require(_0xd674('0x10'));var Redis=require('ioredis');var authService=require(_0xd674('0x11'));var qs=require(_0xd674('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd674('0x13'));var logger=require(_0xd674('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xd674('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd674('0x16'));function respondWithStatusCode(_0x490b50,_0x160f95){_0x160f95=_0x160f95||0xcc;return function(_0x74a53c){if(_0x74a53c){return _0x490b50['sendStatus'](_0x160f95);}return _0x490b50['status'](_0x160f95)[_0xd674('0x17')]();};}function respondWithResult(_0x3263ac,_0x16eca9){_0x16eca9=_0x16eca9||0xc8;return function(_0x501824){if(_0x501824){return _0x3263ac['status'](_0x16eca9)[_0xd674('0x18')](_0x501824);}};}function respondWithFilteredResult(_0x110d55,_0x44480d){return function(_0x746777){if(_0x746777){var _0x4b403c=typeof _0x44480d[_0xd674('0x19')]===_0xd674('0x1a')&&typeof _0x44480d['limit']===_0xd674('0x1a');var _0x190764=_0x746777[_0xd674('0x1b')];var _0x392da6=_0x4b403c?0x0:_0x44480d['offset'];var _0x34a6d9=_0x4b403c?_0x746777['count']:_0x44480d['offset']+_0x44480d[_0xd674('0x1c')];var _0x33db26;if(_0x34a6d9>=_0x190764){_0x34a6d9=_0x190764;_0x33db26=0xc8;}else{_0x33db26=0xce;}_0x110d55[_0xd674('0x1d')](_0x33db26);return _0x110d55[_0xd674('0x1e')](_0xd674('0x1f'),_0x392da6+'-'+_0x34a6d9+'/'+_0x190764)[_0xd674('0x18')](_0x746777);}return null;};}function patchUpdates(_0x48a68e){return function(_0x3399e4){try{jsonpatch['apply'](_0x3399e4,_0x48a68e,!![]);}catch(_0x1b850d){return BPromise[_0xd674('0x20')](_0x1b850d);}return _0x3399e4['save']();};}function saveUpdates(_0x29d0ec,_0x169d1a){return function(_0x2ebb16){if(_0x2ebb16){return _0x2ebb16[_0xd674('0x21')](_0x29d0ec)[_0xd674('0x22')](function(_0x84e9ad){return _0x84e9ad;});}return null;};}function removeEntity(_0x5189ec,_0x485258){return function(_0x5ae1f4){if(_0x5ae1f4){return _0x5ae1f4[_0xd674('0x23')]()['then'](function(){_0x5189ec[_0xd674('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46cb61,_0x44d9da){return function(_0x420809){if(!_0x420809){_0x46cb61[_0xd674('0x24')](0x194);}return _0x420809;};}function handleError(_0x193cf8,_0x138992){_0x138992=_0x138992||0x1f4;return function(_0x2bae2c){logger[_0xd674('0x25')](_0x2bae2c[_0xd674('0x26')]);if(_0x2bae2c[_0xd674('0x27')]){delete _0x2bae2c[_0xd674('0x27')];}_0x193cf8['status'](_0x138992)[_0xd674('0x28')](_0x2bae2c);};}exports[_0xd674('0x29')]=function(_0x5dae9b,_0xad18b6){var _0x481a9d={},_0x2b6660={},_0x179e60={'count':0x0,'rows':[]};var _0x5f126c=_[_0xd674('0x2a')](db[_0xd674('0x2b')]['rawAttributes'],function(_0x1f874f){return{'name':_0x1f874f[_0xd674('0x2c')],'type':_0x1f874f[_0xd674('0x2d')][_0xd674('0x2e')]};});_0x2b6660['model']=_[_0xd674('0x2a')](_0x5f126c,_0xd674('0x27'));_0x2b6660[_0xd674('0x2f')]=_[_0xd674('0x30')](_0x5dae9b[_0xd674('0x2f')]);_0x2b6660[_0xd674('0x31')]=_[_0xd674('0x32')](_0x2b6660[_0xd674('0x33')],_0x2b6660['query']);_0x481a9d[_0xd674('0x34')]=_[_0xd674('0x32')](_0x2b6660[_0xd674('0x33')],qs[_0xd674('0x35')](_0x5dae9b[_0xd674('0x2f')]['fields']));_0x481a9d[_0xd674('0x34')]=_0x481a9d[_0xd674('0x34')]['length']?_0x481a9d['attributes']:_0x2b6660[_0xd674('0x33')];if(!_0x5dae9b['query']['hasOwnProperty'](_0xd674('0x36'))){_0x481a9d['limit']=qs['limit'](_0x5dae9b[_0xd674('0x2f')][_0xd674('0x1c')]);_0x481a9d[_0xd674('0x19')]=qs[_0xd674('0x19')](_0x5dae9b[_0xd674('0x2f')][_0xd674('0x19')]);}_0x481a9d[_0xd674('0x37')]=qs['sort'](_0x5dae9b[_0xd674('0x2f')][_0xd674('0x38')]);_0x481a9d[_0xd674('0x39')]=qs['filters'](_['pick'](_0x5dae9b['query'],_0x2b6660[_0xd674('0x31')]),_0x5f126c);if(_0x5dae9b[_0xd674('0x2f')][_0xd674('0x3a')]){_0x481a9d[_0xd674('0x39')]=_[_0xd674('0x3b')](_0x481a9d[_0xd674('0x39')],{'$or':_['map'](_0x5f126c,function(_0x2456e1){if(_0x2456e1[_0xd674('0x2d')]!==_0xd674('0x3c')){var _0xf2a874={};_0xf2a874[_0x2456e1[_0xd674('0x27')]]={'$like':'%'+_0x5dae9b[_0xd674('0x2f')]['filter']+'%'};return _0xf2a874;}})});}_0x481a9d=_[_0xd674('0x3b')]({},_0x481a9d,_0x5dae9b['options']);var _0xf16861={'where':_0x481a9d['where']};return db[_0xd674('0x2b')][_0xd674('0x1b')](_0xf16861)[_0xd674('0x22')](function(_0x1f5043){_0x179e60['count']=_0x1f5043;if(_0x5dae9b['query'][_0xd674('0x3d')]){_0x481a9d[_0xd674('0x3e')]=[{'all':!![]}];}return db[_0xd674('0x2b')]['findAll'](_0x481a9d);})[_0xd674('0x22')](function(_0x192085){_0x179e60[_0xd674('0x3f')]=_0x192085;return _0x179e60;})['then'](respondWithFilteredResult(_0xad18b6,_0x481a9d))[_0xd674('0x40')](handleError(_0xad18b6,null));};exports[_0xd674('0x41')]=function(_0x1dc23e,_0x26b5c5){var _0x1ba295={'raw':![],'where':{'id':_0x1dc23e['params']['id']}},_0x2bb395={};_0x2bb395[_0xd674('0x33')]=_[_0xd674('0x30')](db[_0xd674('0x2b')][_0xd674('0x42')]);_0x2bb395[_0xd674('0x2f')]=_[_0xd674('0x30')](_0x1dc23e[_0xd674('0x2f')]);_0x2bb395[_0xd674('0x31')]=_[_0xd674('0x32')](_0x2bb395[_0xd674('0x33')],_0x2bb395[_0xd674('0x2f')]);_0x1ba295[_0xd674('0x34')]=_[_0xd674('0x32')](_0x2bb395[_0xd674('0x33')],qs[_0xd674('0x35')](_0x1dc23e[_0xd674('0x2f')][_0xd674('0x35')]));_0x1ba295['attributes']=_0x1ba295[_0xd674('0x34')][_0xd674('0x43')]?_0x1ba295[_0xd674('0x34')]:_0x2bb395[_0xd674('0x33')];if(_0x1dc23e['query'][_0xd674('0x3d')]){_0x1ba295[_0xd674('0x3e')]=[{'all':!![]}];}_0x1ba295=_[_0xd674('0x3b')]({},_0x1ba295,_0x1dc23e['options']);return db[_0xd674('0x2b')][_0xd674('0x44')](_0x1ba295)['then'](handleEntityNotFound(_0x26b5c5,null))[_0xd674('0x22')](respondWithResult(_0x26b5c5,null))[_0xd674('0x40')](handleError(_0x26b5c5,null));};exports[_0xd674('0x45')]=function(_0x1585d4,_0x1d65ef){return db['SugarcrmAccount'][_0xd674('0x45')](_0x1585d4[_0xd674('0x46')],{})[_0xd674('0x22')](respondWithResult(_0x1d65ef,0xc9))[_0xd674('0x40')](handleError(_0x1d65ef,null));};exports[_0xd674('0x21')]=function(_0x16d45a,_0x1963bc){if(_0x16d45a['body']['id']){delete _0x16d45a[_0xd674('0x46')]['id'];}return db[_0xd674('0x2b')]['find']({'where':{'id':_0x16d45a[_0xd674('0x47')]['id']}})[_0xd674('0x22')](handleEntityNotFound(_0x1963bc,null))['then'](saveUpdates(_0x16d45a[_0xd674('0x46')],null))[_0xd674('0x22')](respondWithResult(_0x1963bc,null))[_0xd674('0x40')](handleError(_0x1963bc,null));};exports[_0xd674('0x23')]=function(_0x5839a7,_0x3448a8){return db[_0xd674('0x2b')][_0xd674('0x44')]({'where':{'id':_0x5839a7[_0xd674('0x47')]['id']}})[_0xd674('0x22')](handleEntityNotFound(_0x3448a8,null))[_0xd674('0x22')](removeEntity(_0x3448a8,null))['catch'](handleError(_0x3448a8,null));};exports[_0xd674('0x48')]=function(_0x541693,_0x260247,_0x241410){var _0x1eba97={};var _0x22744a={};var _0x18d5c5;var _0x469b7e;return db[_0xd674('0x2b')][_0xd674('0x49')]({'where':{'id':_0x541693[_0xd674('0x47')]['id']}})['then'](handleEntityNotFound(_0x260247,null))['then'](function(_0xb3aa40){if(_0xb3aa40){_0x18d5c5=_0xb3aa40;_0x22744a[_0xd674('0x33')]=_[_0xd674('0x30')](db[_0xd674('0x4a')][_0xd674('0x42')]);_0x22744a['query']=_['keys'](_0x541693['query']);_0x22744a[_0xd674('0x31')]=_[_0xd674('0x32')](_0x22744a[_0xd674('0x33')],_0x22744a[_0xd674('0x2f')]);_0x1eba97['attributes']=_[_0xd674('0x32')](_0x22744a[_0xd674('0x33')],qs[_0xd674('0x35')](_0x541693[_0xd674('0x2f')][_0xd674('0x35')]));_0x1eba97[_0xd674('0x34')]=_0x1eba97[_0xd674('0x34')][_0xd674('0x43')]?_0x1eba97[_0xd674('0x34')]:_0x22744a[_0xd674('0x33')];_0x1eba97[_0xd674('0x37')]=qs['sort'](_0x541693[_0xd674('0x2f')][_0xd674('0x38')]);_0x1eba97['where']=qs[_0xd674('0x31')](_['pick'](_0x541693['query'],_0x22744a[_0xd674('0x31')]));if(_0x541693[_0xd674('0x2f')]['filter']){_0x1eba97[_0xd674('0x39')]=_['merge'](_0x1eba97[_0xd674('0x39')],{'$or':_[_0xd674('0x2a')](_0x1eba97[_0xd674('0x34')],function(_0x1952ba){var _0x45faea={};_0x45faea[_0x1952ba]={'$like':'%'+_0x541693[_0xd674('0x2f')][_0xd674('0x3a')]+'%'};return _0x45faea;})});}_0x1eba97=_[_0xd674('0x3b')]({},_0x1eba97,_0x541693[_0xd674('0x4b')]);return _0x18d5c5[_0xd674('0x48')](_0x1eba97);}})[_0xd674('0x22')](function(_0x7a67c7){if(_0x7a67c7){_0x469b7e=_0x7a67c7[_0xd674('0x43')];if(!_0x541693[_0xd674('0x2f')]['hasOwnProperty'](_0xd674('0x36'))){_0x1eba97['limit']=qs[_0xd674('0x1c')](_0x541693['query']['limit']);_0x1eba97[_0xd674('0x19')]=qs[_0xd674('0x19')](_0x541693['query'][_0xd674('0x19')]);}return _0x18d5c5[_0xd674('0x48')](_0x1eba97);}})[_0xd674('0x22')](function(_0x4060da){if(_0x4060da){return _0x4060da?{'count':_0x469b7e,'rows':_0x4060da}:null;}})[_0xd674('0x22')](respondWithResult(_0x260247,null))['catch'](handleError(_0x260247,null));};exports['addConfiguration']=function(_0x531312,_0x31c555,_0x31b588){if(_0x531312[_0xd674('0x46')]['id']){delete _0x531312[_0xd674('0x46')]['id'];}return db[_0xd674('0x2b')][_0xd674('0x49')]({'where':{'id':_0x531312[_0xd674('0x47')]['id']}})['then'](handleEntityNotFound(_0x31c555,null))['then'](function(_0x4aef7a){if(_0x4aef7a){_0x531312['body']['AccountId']=_0x4aef7a['id'];_0x531312[_0xd674('0x46')][_0xd674('0x4c')]=integrations[_0xd674('0x4d')](_0x531312[_0xd674('0x46')][_0xd674('0x4e')],_0x531312['body'][_0xd674('0x2d')]);_0x531312[_0xd674('0x46')][_0xd674('0x4f')]=integrations[_0xd674('0x50')](_0x531312['body']['channel'],_0x531312[_0xd674('0x46')][_0xd674('0x2d')]);return db[_0xd674('0x4a')][_0xd674('0x45')](_0x531312['body'],{'include':[{'model':db[_0xd674('0x51')],'as':_0xd674('0x4c')},{'model':db[_0xd674('0x51')],'as':_0xd674('0x4f')}]});}return null;})[_0xd674('0x22')](respondWithResult(_0x31c555,null))[_0xd674('0x40')](handleError(_0x31c555,null));};exports[_0xd674('0x52')]=function(_0x596401,_0x2f887e,_0x3984c8){var _0x2fa0ae='';var _0x350ea1=['id','name',_0xd674('0x53'),_0xd674('0x54'),'description','date_start',_0xd674('0x55'),_0xd674('0x56'),_0xd674('0x57'),_0xd674('0x58'),_0xd674('0x59'),_0xd674('0x5a')];return db[_0xd674('0x2b')]['findOne']({'where':{'id':_0x596401[_0xd674('0x47')]['id']},'attributes':['id',_0xd674('0x5b'),_0xd674('0x5c'),_0xd674('0x5d')]})[_0xd674('0x22')](handleEntityNotFound(_0x2f887e,null))[_0xd674('0x22')](function(_0x3060d){if(_0x3060d){_0x2fa0ae=_0x3060d['remoteUri'];var _0x2dce15=_0x2fa0ae[_0xd674('0x5e')](-0x1);if(_0x2dce15==='/'){_0x2fa0ae=_0x2fa0ae[_0xd674('0x5f')](0x0,_0x2fa0ae[_0xd674('0x60')](_0x2dce15));}return rp({'method':'POST','uri':util[_0xd674('0x61')](_0xd674('0x62'),_0x2fa0ae,_0xd674('0x63')),'json':!![],'form':{'method':'login','input_type':_0xd674('0x64'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3060d[_0xd674('0x5b')],'password':_0x3060d[_0xd674('0x5c')],'encryption':_0xd674('0x65')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xd674('0x22')](function(_0x27090b){if(_0x27090b&&_0x27090b[_0xd674('0x27')]!==_0xd674('0x66')&&_0x27090b[_0xd674('0x27')]!==_0xd674('0x67')){return rp({'method':'POST','uri':util['format'](_0xd674('0x62'),_0x2fa0ae,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xd674('0x68'),'input_type':_0xd674('0x64'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x27090b['id'],'module_name':_0xd674('0x69')})}})[_0xd674('0x22')](function(_0x3a3190){if(_0x3a3190){var _0x4d16fa=_[_0xd674('0x6a')](_0x3a3190[_0xd674('0x6b')]);_[_0xd674('0x6c')](_0x4d16fa,function(_0x65cd15){return _0x350ea1['includes'](_0x65cd15[_0xd674('0x27')]);});return{'count':_0x4d16fa['length'],'rows':_[_0xd674('0x2a')](_0x4d16fa,function(_0x44263c){return{'id':_0x44263c[_0xd674('0x27')],'name':_0x44263c[_0xd674('0x6d')],'custom':_[_0xd674('0x6e')](_0x44263c[_0xd674('0x27')],'_c')?!![]:![],'options':_0x44263c[_0xd674('0x4b')]?_['map'](_[_0xd674('0x6a')](_0x44263c[_0xd674('0x4b')]),function(_0x11b605){return{'name':_0x11b605['value'],'value':_0x11b605[_0xd674('0x27')]};}):[]};})};}})[_0xd674('0x22')](respondWithResult(_0x2f887e,null))['catch'](function(_0x4ef321){var _0x4471db=_0x596401[_0xd674('0x2f')]['test']?0x1f4:_0x4ef321[_0xd674('0x6f')]||0x1f4;logger[_0xd674('0x25')](_0xd674('0x70'),_0xd674('0x52'),_0x4471db,JSON['stringify'](_0x4ef321));delete _0x4ef321[_0xd674('0x27')];if(_0x4471db===0x191){_0x4471db=0x190;}_0x2f887e[_0xd674('0x1d')](_0x4471db)['send'](_0x596401[_0xd674('0x2f')][_0xd674('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x4ef321[_0xd674('0x6f')]}:_0x4ef321);});}else{var _0x2eaeaa=0x1f4;_0x2f887e[_0xd674('0x1d')](_0x2eaeaa)[_0xd674('0x28')]({'message':_0xd674('0x72'),'statusCode':0x190});}});};
\ No newline at end of file
+var _0xec75=['xCALLY\x20Motion\x20Integration','Password\x20Expired','Calls','values','remove','includes','label','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SugarcrmAccount','includeAll','include','rows','catch','params','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','remoteUri','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','username','PLAIN'];(function(_0x15965a,_0x4bbec6){var _0xe6145d=function(_0x1d1cae){while(--_0x1d1cae){_0x15965a['push'](_0x15965a['shift']());}};_0xe6145d(++_0x4bbec6);}(_0xec75,0xec));var _0x5ec7=function(_0x20b543,_0xb1a972){_0x20b543=_0x20b543-0x0;var _0x390150=_0xec75[_0x20b543];return _0x390150;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5ec7('0x0'));var jsonpatch=require(_0x5ec7('0x1'));var rp=require(_0x5ec7('0x2'));var moment=require(_0x5ec7('0x3'));var BPromise=require(_0x5ec7('0x4'));var Mustache=require(_0x5ec7('0x5'));var util=require(_0x5ec7('0x6'));var path=require('path');var sox=require(_0x5ec7('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5ec7('0x8'));var _=require(_0x5ec7('0x9'));var squel=require(_0x5ec7('0xa'));var crypto=require(_0x5ec7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5ec7('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5ec7('0xd'));var Papa=require(_0x5ec7('0xe'));var Redis=require(_0x5ec7('0xf'));var authService=require(_0x5ec7('0x10'));var qs=require(_0x5ec7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5ec7('0x12'));var utils=require('../../config/utils');var config=require(_0x5ec7('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x5ec7('0x14'));function respondWithStatusCode(_0x5ea268,_0x523824){_0x523824=_0x523824||0xcc;return function(_0x10a84e){if(_0x10a84e){return _0x5ea268[_0x5ec7('0x15')](_0x523824);}return _0x5ea268['status'](_0x523824)[_0x5ec7('0x16')]();};}function respondWithResult(_0x5c4231,_0x253886){_0x253886=_0x253886||0xc8;return function(_0x5486d9){if(_0x5486d9){return _0x5c4231[_0x5ec7('0x17')](_0x253886)[_0x5ec7('0x18')](_0x5486d9);}};}function respondWithFilteredResult(_0x56835b,_0x42841c){return function(_0x553280){if(_0x553280){var _0x56e5fc=typeof _0x42841c[_0x5ec7('0x19')]===_0x5ec7('0x1a')&&typeof _0x42841c['limit']===_0x5ec7('0x1a');var _0x281426=_0x553280['count'];var _0xcaec31=_0x56e5fc?0x0:_0x42841c[_0x5ec7('0x19')];var _0x37850b=_0x56e5fc?_0x553280[_0x5ec7('0x1b')]:_0x42841c[_0x5ec7('0x19')]+_0x42841c[_0x5ec7('0x1c')];var _0x389d4b;if(_0x37850b>=_0x281426){_0x37850b=_0x281426;_0x389d4b=0xc8;}else{_0x389d4b=0xce;}_0x56835b[_0x5ec7('0x17')](_0x389d4b);return _0x56835b['set'](_0x5ec7('0x1d'),_0xcaec31+'-'+_0x37850b+'/'+_0x281426)[_0x5ec7('0x18')](_0x553280);}return null;};}function patchUpdates(_0x5ce956){return function(_0x5062e6){try{jsonpatch[_0x5ec7('0x1e')](_0x5062e6,_0x5ce956,!![]);}catch(_0xa0f00){return BPromise['reject'](_0xa0f00);}return _0x5062e6[_0x5ec7('0x1f')]();};}function saveUpdates(_0x4a113b,_0x2ed688){return function(_0x2ba17a){if(_0x2ba17a){return _0x2ba17a['update'](_0x4a113b)[_0x5ec7('0x20')](function(_0xa35f17){return _0xa35f17;});}return null;};}function removeEntity(_0x451adc,_0x33ed62){return function(_0x547743){if(_0x547743){return _0x547743[_0x5ec7('0x21')]()[_0x5ec7('0x20')](function(){_0x451adc['status'](0xcc)[_0x5ec7('0x16')]();});}};}function handleEntityNotFound(_0x3185e5,_0x53e656){return function(_0x93afb7){if(!_0x93afb7){_0x3185e5[_0x5ec7('0x15')](0x194);}return _0x93afb7;};}function handleError(_0x7ceb9d,_0x4bf8af){_0x4bf8af=_0x4bf8af||0x1f4;return function(_0x48c9c2){logger[_0x5ec7('0x22')](_0x48c9c2['stack']);if(_0x48c9c2[_0x5ec7('0x23')]){delete _0x48c9c2[_0x5ec7('0x23')];}_0x7ceb9d[_0x5ec7('0x17')](_0x4bf8af)[_0x5ec7('0x24')](_0x48c9c2);};}exports[_0x5ec7('0x25')]=function(_0x322c86,_0x352bf2){var _0x1cfeae={},_0x3d59c2={},_0x5177c5={'count':0x0,'rows':[]};var _0x4f7639=_['map'](db['SugarcrmAccount']['rawAttributes'],function(_0x179a10){return{'name':_0x179a10[_0x5ec7('0x26')],'type':_0x179a10[_0x5ec7('0x27')][_0x5ec7('0x28')]};});_0x3d59c2[_0x5ec7('0x29')]=_[_0x5ec7('0x2a')](_0x4f7639,_0x5ec7('0x23'));_0x3d59c2[_0x5ec7('0x2b')]=_[_0x5ec7('0x2c')](_0x322c86[_0x5ec7('0x2b')]);_0x3d59c2[_0x5ec7('0x2d')]=_[_0x5ec7('0x2e')](_0x3d59c2[_0x5ec7('0x29')],_0x3d59c2[_0x5ec7('0x2b')]);_0x1cfeae['attributes']=_[_0x5ec7('0x2e')](_0x3d59c2['model'],qs['fields'](_0x322c86['query'][_0x5ec7('0x2f')]));_0x1cfeae['attributes']=_0x1cfeae[_0x5ec7('0x30')][_0x5ec7('0x31')]?_0x1cfeae[_0x5ec7('0x30')]:_0x3d59c2[_0x5ec7('0x29')];if(!_0x322c86[_0x5ec7('0x2b')][_0x5ec7('0x32')](_0x5ec7('0x33'))){_0x1cfeae[_0x5ec7('0x1c')]=qs[_0x5ec7('0x1c')](_0x322c86[_0x5ec7('0x2b')][_0x5ec7('0x1c')]);_0x1cfeae[_0x5ec7('0x19')]=qs[_0x5ec7('0x19')](_0x322c86[_0x5ec7('0x2b')]['offset']);}_0x1cfeae[_0x5ec7('0x34')]=qs[_0x5ec7('0x35')](_0x322c86[_0x5ec7('0x2b')][_0x5ec7('0x35')]);_0x1cfeae[_0x5ec7('0x36')]=qs[_0x5ec7('0x2d')](_[_0x5ec7('0x37')](_0x322c86[_0x5ec7('0x2b')],_0x3d59c2['filters']),_0x4f7639);if(_0x322c86['query'][_0x5ec7('0x38')]){_0x1cfeae['where']=_[_0x5ec7('0x39')](_0x1cfeae['where'],{'$or':_[_0x5ec7('0x2a')](_0x4f7639,function(_0x56e188){if(_0x56e188[_0x5ec7('0x27')]!=='VIRTUAL'){var _0x327503={};_0x327503[_0x56e188[_0x5ec7('0x23')]]={'$like':'%'+_0x322c86[_0x5ec7('0x2b')][_0x5ec7('0x38')]+'%'};return _0x327503;}})});}_0x1cfeae=_[_0x5ec7('0x39')]({},_0x1cfeae,_0x322c86[_0x5ec7('0x3a')]);var _0x31f7fa={'where':_0x1cfeae['where']};return db[_0x5ec7('0x3b')][_0x5ec7('0x1b')](_0x31f7fa)['then'](function(_0x12e7ae){_0x5177c5[_0x5ec7('0x1b')]=_0x12e7ae;if(_0x322c86[_0x5ec7('0x2b')][_0x5ec7('0x3c')]){_0x1cfeae[_0x5ec7('0x3d')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x1cfeae);})[_0x5ec7('0x20')](function(_0xba3a90){_0x5177c5[_0x5ec7('0x3e')]=_0xba3a90;return _0x5177c5;})['then'](respondWithFilteredResult(_0x352bf2,_0x1cfeae))[_0x5ec7('0x3f')](handleError(_0x352bf2,null));};exports['show']=function(_0x4b25b6,_0x15cecc){var _0x12cc88={'raw':![],'where':{'id':_0x4b25b6[_0x5ec7('0x40')]['id']}},_0x10ce9b={};_0x10ce9b['model']=_[_0x5ec7('0x2c')](db[_0x5ec7('0x3b')][_0x5ec7('0x41')]);_0x10ce9b[_0x5ec7('0x2b')]=_[_0x5ec7('0x2c')](_0x4b25b6[_0x5ec7('0x2b')]);_0x10ce9b[_0x5ec7('0x2d')]=_[_0x5ec7('0x2e')](_0x10ce9b['model'],_0x10ce9b[_0x5ec7('0x2b')]);_0x12cc88[_0x5ec7('0x30')]=_[_0x5ec7('0x2e')](_0x10ce9b['model'],qs[_0x5ec7('0x2f')](_0x4b25b6[_0x5ec7('0x2b')][_0x5ec7('0x2f')]));_0x12cc88[_0x5ec7('0x30')]=_0x12cc88[_0x5ec7('0x30')]['length']?_0x12cc88['attributes']:_0x10ce9b[_0x5ec7('0x29')];if(_0x4b25b6[_0x5ec7('0x2b')]['includeAll']){_0x12cc88[_0x5ec7('0x3d')]=[{'all':!![]}];}_0x12cc88=_[_0x5ec7('0x39')]({},_0x12cc88,_0x4b25b6[_0x5ec7('0x3a')]);return db[_0x5ec7('0x3b')][_0x5ec7('0x42')](_0x12cc88)['then'](handleEntityNotFound(_0x15cecc,null))[_0x5ec7('0x20')](respondWithResult(_0x15cecc,null))[_0x5ec7('0x3f')](handleError(_0x15cecc,null));};exports[_0x5ec7('0x43')]=function(_0x454bf2,_0x539d02){return db['SugarcrmAccount']['create'](_0x454bf2[_0x5ec7('0x44')],{})[_0x5ec7('0x20')](respondWithResult(_0x539d02,0xc9))[_0x5ec7('0x3f')](handleError(_0x539d02,null));};exports['update']=function(_0x105ab3,_0x38405b){if(_0x105ab3['body']['id']){delete _0x105ab3[_0x5ec7('0x44')]['id'];}return db[_0x5ec7('0x3b')][_0x5ec7('0x42')]({'where':{'id':_0x105ab3['params']['id']}})[_0x5ec7('0x20')](handleEntityNotFound(_0x38405b,null))[_0x5ec7('0x20')](saveUpdates(_0x105ab3[_0x5ec7('0x44')],null))[_0x5ec7('0x20')](respondWithResult(_0x38405b,null))[_0x5ec7('0x3f')](handleError(_0x38405b,null));};exports[_0x5ec7('0x21')]=function(_0x1eb3d9,_0x3964f6){return db['SugarcrmAccount']['find']({'where':{'id':_0x1eb3d9[_0x5ec7('0x40')]['id']}})[_0x5ec7('0x20')](handleEntityNotFound(_0x3964f6,null))[_0x5ec7('0x20')](removeEntity(_0x3964f6,null))[_0x5ec7('0x3f')](handleError(_0x3964f6,null));};exports[_0x5ec7('0x45')]=function(_0x4fde54,_0x284fa0,_0x203d90){var _0x496c66={};var _0x19eb46={};var _0x39d0dc;var _0x3ae122;return db[_0x5ec7('0x3b')][_0x5ec7('0x46')]({'where':{'id':_0x4fde54['params']['id']}})['then'](handleEntityNotFound(_0x284fa0,null))[_0x5ec7('0x20')](function(_0x32ddaa){if(_0x32ddaa){_0x39d0dc=_0x32ddaa;_0x19eb46['model']=_[_0x5ec7('0x2c')](db[_0x5ec7('0x47')][_0x5ec7('0x41')]);_0x19eb46[_0x5ec7('0x2b')]=_[_0x5ec7('0x2c')](_0x4fde54[_0x5ec7('0x2b')]);_0x19eb46[_0x5ec7('0x2d')]=_[_0x5ec7('0x2e')](_0x19eb46[_0x5ec7('0x29')],_0x19eb46[_0x5ec7('0x2b')]);_0x496c66['attributes']=_[_0x5ec7('0x2e')](_0x19eb46[_0x5ec7('0x29')],qs[_0x5ec7('0x2f')](_0x4fde54[_0x5ec7('0x2b')][_0x5ec7('0x2f')]));_0x496c66[_0x5ec7('0x30')]=_0x496c66[_0x5ec7('0x30')][_0x5ec7('0x31')]?_0x496c66[_0x5ec7('0x30')]:_0x19eb46['model'];_0x496c66['order']=qs['sort'](_0x4fde54['query'][_0x5ec7('0x35')]);_0x496c66['where']=qs['filters'](_[_0x5ec7('0x37')](_0x4fde54[_0x5ec7('0x2b')],_0x19eb46[_0x5ec7('0x2d')]));if(_0x4fde54[_0x5ec7('0x2b')][_0x5ec7('0x38')]){_0x496c66[_0x5ec7('0x36')]=_[_0x5ec7('0x39')](_0x496c66[_0x5ec7('0x36')],{'$or':_[_0x5ec7('0x2a')](_0x496c66['attributes'],function(_0x163d55){var _0xad7b61={};_0xad7b61[_0x163d55]={'$like':'%'+_0x4fde54[_0x5ec7('0x2b')]['filter']+'%'};return _0xad7b61;})});}_0x496c66=_[_0x5ec7('0x39')]({},_0x496c66,_0x4fde54['options']);return _0x39d0dc[_0x5ec7('0x45')](_0x496c66);}})[_0x5ec7('0x20')](function(_0x30fbd8){if(_0x30fbd8){_0x3ae122=_0x30fbd8[_0x5ec7('0x31')];if(!_0x4fde54['query'][_0x5ec7('0x32')](_0x5ec7('0x33'))){_0x496c66[_0x5ec7('0x1c')]=qs[_0x5ec7('0x1c')](_0x4fde54[_0x5ec7('0x2b')][_0x5ec7('0x1c')]);_0x496c66[_0x5ec7('0x19')]=qs[_0x5ec7('0x19')](_0x4fde54['query'][_0x5ec7('0x19')]);}return _0x39d0dc[_0x5ec7('0x45')](_0x496c66);}})[_0x5ec7('0x20')](function(_0x2e0b82){if(_0x2e0b82){return _0x2e0b82?{'count':_0x3ae122,'rows':_0x2e0b82}:null;}})[_0x5ec7('0x20')](respondWithResult(_0x284fa0,null))['catch'](handleError(_0x284fa0,null));};exports[_0x5ec7('0x48')]=function(_0x2d505c,_0x46a7fa,_0x167a9d){if(_0x2d505c[_0x5ec7('0x44')]['id']){delete _0x2d505c['body']['id'];}return db[_0x5ec7('0x3b')]['findOne']({'where':{'id':_0x2d505c[_0x5ec7('0x40')]['id']}})['then'](handleEntityNotFound(_0x46a7fa,null))[_0x5ec7('0x20')](function(_0x35b3d8){if(_0x35b3d8){_0x2d505c[_0x5ec7('0x44')][_0x5ec7('0x49')]=_0x35b3d8['id'];_0x2d505c['body'][_0x5ec7('0x4a')]=integrations[_0x5ec7('0x4b')](_0x2d505c[_0x5ec7('0x44')][_0x5ec7('0x4c')],_0x2d505c[_0x5ec7('0x44')][_0x5ec7('0x27')]);_0x2d505c[_0x5ec7('0x44')][_0x5ec7('0x4d')]=integrations[_0x5ec7('0x4e')](_0x2d505c['body'][_0x5ec7('0x4c')],_0x2d505c[_0x5ec7('0x44')]['type']);return db[_0x5ec7('0x47')][_0x5ec7('0x43')](_0x2d505c[_0x5ec7('0x44')],{'include':[{'model':db[_0x5ec7('0x4f')],'as':'Subjects'},{'model':db[_0x5ec7('0x4f')],'as':_0x5ec7('0x4d')}]});}return null;})[_0x5ec7('0x20')](respondWithResult(_0x46a7fa,null))[_0x5ec7('0x3f')](handleError(_0x46a7fa,null));};exports[_0x5ec7('0x50')]=function(_0x4edf06,_0x24266e,_0xf76168){var _0x5b6376='';var _0x404bf9=['id',_0x5ec7('0x23'),_0x5ec7('0x51'),_0x5ec7('0x52'),'description',_0x5ec7('0x53'),_0x5ec7('0x54'),_0x5ec7('0x55'),_0x5ec7('0x56'),_0x5ec7('0x57'),_0x5ec7('0x58'),_0x5ec7('0x59')];return db[_0x5ec7('0x3b')]['findOne']({'where':{'id':_0x4edf06[_0x5ec7('0x40')]['id']},'attributes':['id','username','password',_0x5ec7('0x5a')]})['then'](handleEntityNotFound(_0x24266e,null))[_0x5ec7('0x20')](function(_0x39b986){if(_0x39b986){_0x5b6376=_0x39b986['remoteUri'];var _0x43218d=_0x5b6376['slice'](-0x1);if(_0x43218d==='/'){_0x5b6376=_0x5b6376['substring'](0x0,_0x5b6376[_0x5ec7('0x5b')](_0x43218d));}return rp({'method':_0x5ec7('0x5c'),'uri':util[_0x5ec7('0x5d')](_0x5ec7('0x5e'),_0x5b6376,_0x5ec7('0x5f')),'json':!![],'form':{'method':'login','input_type':_0x5ec7('0x60'),'response_type':_0x5ec7('0x60'),'rest_data':JSON[_0x5ec7('0x61')]({'user_auth':{'user_name':_0x39b986[_0x5ec7('0x62')],'password':_0x39b986['password'],'encryption':_0x5ec7('0x63')},'application':_0x5ec7('0x64')})}});}})[_0x5ec7('0x20')](function(_0x1143d6){if(_0x1143d6&&_0x1143d6[_0x5ec7('0x23')]!=='Invalid\x20Login'&&_0x1143d6[_0x5ec7('0x23')]!==_0x5ec7('0x65')){return rp({'method':_0x5ec7('0x5c'),'uri':util[_0x5ec7('0x5d')]('%s%s',_0x5b6376,_0x5ec7('0x5f')),'json':!![],'form':{'method':'get_module_fields','input_type':_0x5ec7('0x60'),'response_type':_0x5ec7('0x60'),'rest_data':JSON[_0x5ec7('0x61')]({'session':_0x1143d6['id'],'module_name':_0x5ec7('0x66')})}})[_0x5ec7('0x20')](function(_0x433e9e){if(_0x433e9e){var _0x563605=_[_0x5ec7('0x67')](_0x433e9e['module_fields']);_[_0x5ec7('0x68')](_0x563605,function(_0x2f8da0){return _0x404bf9[_0x5ec7('0x69')](_0x2f8da0[_0x5ec7('0x23')]);});return{'count':_0x563605['length'],'rows':_['map'](_0x563605,function(_0x943cc8){return{'id':_0x943cc8[_0x5ec7('0x23')],'name':_0x943cc8[_0x5ec7('0x6a')],'custom':_[_0x5ec7('0x6b')](_0x943cc8[_0x5ec7('0x23')],'_c')?!![]:![],'options':_0x943cc8[_0x5ec7('0x3a')]?_[_0x5ec7('0x2a')](_['values'](_0x943cc8[_0x5ec7('0x3a')]),function(_0x37563e){return{'name':_0x37563e[_0x5ec7('0x6c')],'value':_0x37563e[_0x5ec7('0x23')]};}):[]};})};}})['then'](respondWithResult(_0x24266e,null))[_0x5ec7('0x3f')](function(_0x33089d){var _0x21b58e=_0x4edf06[_0x5ec7('0x2b')][_0x5ec7('0x6d')]?0x1f4:_0x33089d['statusCode']||0x1f4;logger[_0x5ec7('0x22')](_0x5ec7('0x6e'),_0x5ec7('0x50'),_0x21b58e,JSON[_0x5ec7('0x61')](_0x33089d));delete _0x33089d[_0x5ec7('0x23')];if(_0x21b58e===0x191){_0x21b58e=0x190;}_0x24266e[_0x5ec7('0x17')](_0x21b58e)[_0x5ec7('0x24')](_0x4edf06[_0x5ec7('0x2b')][_0x5ec7('0x6d')]?{'message':_0x5ec7('0x6f'),'statusCode':_0x33089d['statusCode']}:_0x33089d);});}else{var _0x37cb8a=0x1f4;_0x24266e[_0x5ec7('0x17')](_0x37cb8a)[_0x5ec7('0x24')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
index 6546245..d68e70f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0e3=['int_sugarcrm_accounts','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount'];(function(_0x288715,_0xef119){var _0x4040a0=function(_0x574097){while(--_0x574097){_0x288715['push'](_0x288715['shift']());}};_0x4040a0(++_0xef119);}(_0xc0e3,0x1a5));var _0x3c0e=function(_0x311c35,_0x54a2b0){_0x311c35=_0x311c35-0x0;var _0x31ff65=_0xc0e3[_0x311c35];return _0x31ff65;};'use strict';var _=require(_0x3c0e('0x0'));var util=require('util');var logger=require(_0x3c0e('0x1'))(_0x3c0e('0x2'));var moment=require('moment');var BPromise=require(_0x3c0e('0x3'));var rp=require(_0x3c0e('0x4'));var fs=require('fs');var path=require(_0x3c0e('0x5'));var rimraf=require('rimraf');var config=require(_0x3c0e('0x6'));var attributes=require(_0x3c0e('0x7'));var integrations=require(_0x3c0e('0x8'));module[_0x3c0e('0x9')]=function(_0xdaf45a,_0x3be3c4){return _0xdaf45a['define'](_0x3c0e('0xa'),attributes,{'tableName':_0x3c0e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdffb=['api','moment','bluebird','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','lodash'];(function(_0x2a2e1b,_0x533801){var _0xd4402b=function(_0x5eb43f){while(--_0x5eb43f){_0x2a2e1b['push'](_0x2a2e1b['shift']());}};_0xd4402b(++_0x533801);}(_0xdffb,0xa9));var _0xbdff=function(_0x1ea464,_0x40648c){_0x1ea464=_0x1ea464-0x0;var _0x81ca73=_0xdffb[_0x1ea464];return _0x81ca73;};'use strict';var _=require(_0xbdff('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbdff('0x1'));var moment=require(_0xbdff('0x2'));var BPromise=require(_0xbdff('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbdff('0x4'));var attributes=require(_0xbdff('0x5'));var integrations=require(_0xbdff('0x6'));module[_0xbdff('0x7')]=function(_0x3f878b,_0x1e2654){return _0x3f878b[_0xbdff('0x8')](_0xbdff('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d1483cc..00dfcfd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c96=['stringify','error','code','message','catch','GetSugarcrmAccount','options','where','attributes','map','include','model','debug','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0xafa7eb,_0x39a0c5){var _0x571ddc=function(_0x3dca9){while(--_0x3dca9){_0xafa7eb['push'](_0xafa7eb['shift']());}};_0x571ddc(++_0x39a0c5);}(_0x2c96,0x1de));var _0x62c9=function(_0x3301a2,_0x2c0110){_0x3301a2=_0x3301a2-0x0;var _0x18cdf5=_0x2c96[_0x3301a2];return _0x18cdf5;};'use strict';var _=require(_0x62c9('0x0'));var util=require(_0x62c9('0x1'));var moment=require(_0x62c9('0x2'));var BPromise=require(_0x62c9('0x3'));var rs=require(_0x62c9('0x4'));var fs=require('fs');var Redis=require(_0x62c9('0x5'));var db=require(_0x62c9('0x6'))['db'];var utils=require(_0x62c9('0x7'));var logger=require('../../config/logger')(_0x62c9('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x62c9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc4a7,_0x4bf253,_0x220d57){return new BPromise(function(_0x124a70,_0x3d25d5){return client['request'](_0x3dc4a7,_0x220d57)[_0x62c9('0xa')](function(_0x44dbd6){logger[_0x62c9('0xb')](_0x62c9('0xc'),_0x4bf253,_0x62c9('0xd'));logger['debug'](_0x62c9('0xe'),_0x4bf253,_0x62c9('0xd'),JSON[_0x62c9('0xf')](_0x44dbd6));if(_0x44dbd6[_0x62c9('0x10')]){if(_0x44dbd6[_0x62c9('0x10')][_0x62c9('0x11')]===0x1f4){logger['error'](_0x62c9('0xc'),_0x4bf253,_0x44dbd6[_0x62c9('0x10')][_0x62c9('0x12')]);return _0x3d25d5(_0x44dbd6[_0x62c9('0x10')][_0x62c9('0x12')]);}logger[_0x62c9('0x10')](_0x62c9('0xc'),_0x4bf253,_0x44dbd6[_0x62c9('0x10')][_0x62c9('0x12')]);return _0x124a70(_0x44dbd6[_0x62c9('0x10')][_0x62c9('0x12')]);}else{logger[_0x62c9('0xb')](_0x62c9('0xc'),_0x4bf253,_0x62c9('0xd'));_0x124a70(_0x44dbd6['result']['message']);}})[_0x62c9('0x13')](function(_0x5a1193){logger[_0x62c9('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x4bf253,_0x5a1193);_0x3d25d5(_0x5a1193);});});}exports[_0x62c9('0x14')]=function(_0x351b8b){var _0x3e5530=this;return new Promise(function(_0x42cf34,_0x1b334e){return db['SugarcrmAccount']['findAll']({'raw':_0x351b8b[_0x62c9('0x15')]?_0x351b8b[_0x62c9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x351b8b['options']?_0x351b8b[_0x62c9('0x15')][_0x62c9('0x16')]||null:null,'attributes':_0x351b8b[_0x62c9('0x15')]?_0x351b8b[_0x62c9('0x15')][_0x62c9('0x17')]||null:null,'limit':_0x351b8b[_0x62c9('0x15')]?_0x351b8b['options']['limit']||null:null,'include':_0x351b8b[_0x62c9('0x15')]?_0x351b8b['options']['include']?_[_0x62c9('0x18')](_0x351b8b['options'][_0x62c9('0x19')],function(_0x4cc084){return{'model':db[_0x4cc084['model']],'as':_0x4cc084['as'],'attributes':_0x4cc084[_0x62c9('0x17')],'include':_0x4cc084[_0x62c9('0x19')]?_[_0x62c9('0x18')](_0x4cc084['include'],function(_0x26214a){return{'model':db[_0x26214a[_0x62c9('0x1a')]],'as':_0x26214a['as'],'attributes':_0x26214a[_0x62c9('0x17')],'include':_0x26214a[_0x62c9('0x19')]?_[_0x62c9('0x18')](_0x26214a[_0x62c9('0x19')],function(_0x1e9a51){return{'model':db[_0x1e9a51[_0x62c9('0x1a')]],'as':_0x1e9a51['as'],'attributes':_0x1e9a51[_0x62c9('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5a2679){logger[_0x62c9('0xb')](_0x62c9('0x14'),_0x351b8b);logger[_0x62c9('0x1b')](_0x62c9('0x14'),_0x351b8b,JSON['stringify'](_0x5a2679));_0x42cf34(_0x5a2679);})[_0x62c9('0x13')](function(_0x2cb5d0){logger['error']('GetSugarcrmAccount',_0x2cb5d0[_0x62c9('0x12')],_0x351b8b);_0x1b334e(_0x3e5530[_0x62c9('0x10')](0x1f4,_0x2cb5d0[_0x62c9('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x23be87){var _0xdba8f1=this;return new Promise(function(_0x8ecbde,_0x5aa578){return db['SugarcrmAccount']['find']({'raw':_0x23be87['options']?_0x23be87[_0x62c9('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x23be87['options']?_0x23be87[_0x62c9('0x15')][_0x62c9('0x16')]||null:null,'attributes':_0x23be87[_0x62c9('0x15')]?_0x23be87['options'][_0x62c9('0x17')]||null:null,'include':_0x23be87[_0x62c9('0x15')]?_0x23be87[_0x62c9('0x15')][_0x62c9('0x19')]?_['map'](_0x23be87[_0x62c9('0x15')][_0x62c9('0x19')],function(_0x281aab){return{'model':db[_0x281aab[_0x62c9('0x1a')]],'as':_0x281aab['as'],'attributes':_0x281aab[_0x62c9('0x17')],'include':_0x281aab[_0x62c9('0x19')]?_[_0x62c9('0x18')](_0x281aab[_0x62c9('0x19')],function(_0x448dbc){return{'model':db[_0x448dbc[_0x62c9('0x1a')]],'as':_0x448dbc['as'],'attributes':_0x448dbc[_0x62c9('0x17')],'include':_0x448dbc[_0x62c9('0x19')]?_[_0x62c9('0x18')](_0x448dbc[_0x62c9('0x19')],function(_0x5e430b){return{'model':db[_0x5e430b[_0x62c9('0x1a')]],'as':_0x5e430b['as'],'attributes':_0x5e430b['attributes']};}):[]};}):[]};}):[]:[]})[_0x62c9('0xa')](function(_0x3f1d18){logger[_0x62c9('0xb')](_0x62c9('0x1c'),_0x23be87);logger[_0x62c9('0x1b')]('ShowSugarcrmAccount',_0x23be87,JSON[_0x62c9('0xf')](_0x3f1d18));_0x8ecbde(_0x3f1d18);})[_0x62c9('0x13')](function(_0x4163cd){logger[_0x62c9('0x10')](_0x62c9('0x1c'),_0x4163cd[_0x62c9('0x12')],_0x23be87);_0x5aa578(_0xdba8f1[_0x62c9('0x10')](0x1f4,_0x4163cd['message']));});});};
\ No newline at end of file
+var _0x4610=['stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','SugarcrmAccount','findAll','options','raw','attributes','limit','include','model','map','GetSugarcrmAccount','find','where','ShowSugarcrmAccount'];(function(_0x266e60,_0x485526){var _0x20ae1d=function(_0x5516a){while(--_0x5516a){_0x266e60['push'](_0x266e60['shift']());}};_0x20ae1d(++_0x485526);}(_0x4610,0x182));var _0x0461=function(_0x5ed54b,_0x3a2827){_0x5ed54b=_0x5ed54b-0x0;var _0x4b58c7=_0x4610[_0x5ed54b];return _0x4b58c7;};'use strict';var _=require(_0x0461('0x0'));var util=require(_0x0461('0x1'));var moment=require('moment');var BPromise=require(_0x0461('0x2'));var rs=require(_0x0461('0x3'));var fs=require('fs');var Redis=require(_0x0461('0x4'));var db=require(_0x0461('0x5'))['db'];var utils=require(_0x0461('0x6'));var logger=require(_0x0461('0x7'))(_0x0461('0x8'));var config=require(_0x0461('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0461('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x103a5e,_0x1420cd,_0x3a87b3){return new BPromise(function(_0x249367,_0x436f78){return client['request'](_0x103a5e,_0x3a87b3)[_0x0461('0xb')](function(_0x1d6594){logger[_0x0461('0xc')](_0x0461('0xd'),_0x1420cd,'request\x20sent');logger[_0x0461('0xe')](_0x0461('0xf'),_0x1420cd,'request\x20sent',JSON['stringify'](_0x1d6594));if(_0x1d6594[_0x0461('0x10')]){if(_0x1d6594[_0x0461('0x10')]['code']===0x1f4){logger[_0x0461('0x10')](_0x0461('0xd'),_0x1420cd,_0x1d6594['error'][_0x0461('0x11')]);return _0x436f78(_0x1d6594[_0x0461('0x10')][_0x0461('0x11')]);}logger[_0x0461('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x1420cd,_0x1d6594[_0x0461('0x10')][_0x0461('0x11')]);return _0x249367(_0x1d6594[_0x0461('0x10')][_0x0461('0x11')]);}else{logger[_0x0461('0xc')](_0x0461('0xd'),_0x1420cd,_0x0461('0x12'));_0x249367(_0x1d6594[_0x0461('0x13')][_0x0461('0x11')]);}})[_0x0461('0x14')](function(_0x1da994){logger[_0x0461('0x10')](_0x0461('0xd'),_0x1420cd,_0x1da994);_0x436f78(_0x1da994);});});}exports['GetSugarcrmAccount']=function(_0x5b7656){var _0x31ad22=this;return new Promise(function(_0x18e440,_0x17948e){return db[_0x0461('0x15')][_0x0461('0x16')]({'raw':_0x5b7656[_0x0461('0x17')]?_0x5b7656[_0x0461('0x17')][_0x0461('0x18')]===undefined?!![]:![]:!![],'where':_0x5b7656['options']?_0x5b7656[_0x0461('0x17')]['where']||null:null,'attributes':_0x5b7656[_0x0461('0x17')]?_0x5b7656['options'][_0x0461('0x19')]||null:null,'limit':_0x5b7656['options']?_0x5b7656['options'][_0x0461('0x1a')]||null:null,'include':_0x5b7656[_0x0461('0x17')]?_0x5b7656[_0x0461('0x17')]['include']?_['map'](_0x5b7656[_0x0461('0x17')][_0x0461('0x1b')],function(_0x23a7aa){return{'model':db[_0x23a7aa[_0x0461('0x1c')]],'as':_0x23a7aa['as'],'attributes':_0x23a7aa[_0x0461('0x19')],'include':_0x23a7aa['include']?_['map'](_0x23a7aa[_0x0461('0x1b')],function(_0x38df0d){return{'model':db[_0x38df0d[_0x0461('0x1c')]],'as':_0x38df0d['as'],'attributes':_0x38df0d['attributes'],'include':_0x38df0d['include']?_[_0x0461('0x1d')](_0x38df0d[_0x0461('0x1b')],function(_0x23da82){return{'model':db[_0x23da82[_0x0461('0x1c')]],'as':_0x23da82['as'],'attributes':_0x23da82[_0x0461('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0461('0xb')](function(_0x106ba3){logger[_0x0461('0xc')](_0x0461('0x1e'),_0x5b7656);logger[_0x0461('0xe')](_0x0461('0x1e'),_0x5b7656,JSON['stringify'](_0x106ba3));_0x18e440(_0x106ba3);})['catch'](function(_0x3c3ec8){logger[_0x0461('0x10')](_0x0461('0x1e'),_0x3c3ec8[_0x0461('0x11')],_0x5b7656);_0x17948e(_0x31ad22[_0x0461('0x10')](0x1f4,_0x3c3ec8[_0x0461('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x378e87){var _0x1329ba=this;return new Promise(function(_0x11472a,_0xf806c6){return db[_0x0461('0x15')][_0x0461('0x1f')]({'raw':_0x378e87[_0x0461('0x17')]?_0x378e87['options'][_0x0461('0x18')]===undefined?!![]:![]:!![],'where':_0x378e87[_0x0461('0x17')]?_0x378e87[_0x0461('0x17')][_0x0461('0x20')]||null:null,'attributes':_0x378e87[_0x0461('0x17')]?_0x378e87[_0x0461('0x17')]['attributes']||null:null,'include':_0x378e87[_0x0461('0x17')]?_0x378e87['options'][_0x0461('0x1b')]?_[_0x0461('0x1d')](_0x378e87[_0x0461('0x17')][_0x0461('0x1b')],function(_0x5c23c6){return{'model':db[_0x5c23c6['model']],'as':_0x5c23c6['as'],'attributes':_0x5c23c6[_0x0461('0x19')],'include':_0x5c23c6[_0x0461('0x1b')]?_['map'](_0x5c23c6[_0x0461('0x1b')],function(_0x18b87d){return{'model':db[_0x18b87d[_0x0461('0x1c')]],'as':_0x18b87d['as'],'attributes':_0x18b87d[_0x0461('0x19')],'include':_0x18b87d['include']?_['map'](_0x18b87d[_0x0461('0x1b')],function(_0x520910){return{'model':db[_0x520910['model']],'as':_0x520910['as'],'attributes':_0x520910[_0x0461('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0461('0xb')](function(_0x5b9745){logger[_0x0461('0xc')](_0x0461('0x21'),_0x378e87);logger['debug']('ShowSugarcrmAccount',_0x378e87,JSON[_0x0461('0x22')](_0x5b9745));_0x11472a(_0x5b9745);})[_0x0461('0x14')](function(_0x460c33){logger['error'](_0x0461('0x21'),_0x460c33[_0x0461('0x11')],_0x378e87);_0xf806c6(_0x1329ba[_0x0461('0x10')](0x1f4,_0x460c33[_0x0461('0x11')]));});});};
\ No newline at end of file
index 936d471..d528c7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5eec=['post','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x5eec,0x1d2));var _0xc5ee=function(_0x3a4c5b,_0xd09bb2){_0x3a4c5b=_0x3a4c5b-0x0;var _0x231aac=_0x5eec[_0x3a4c5b];return _0x231aac;};'use strict';var multer=require(_0xc5ee('0x0'));var util=require('util');var path=require(_0xc5ee('0x1'));var timeout=require(_0xc5ee('0x2'));var express=require(_0xc5ee('0x3'));var router=express[_0xc5ee('0x4')]();var fs_extra=require(_0xc5ee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc5ee('0x6'));var config=require(_0xc5ee('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router['get']('/',auth[_0xc5ee('0x8')](),controller[_0xc5ee('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc5ee('0xa')]);router[_0xc5ee('0xb')](_0xc5ee('0xc'),auth['isAuthenticated'](),controller[_0xc5ee('0xd')]);router[_0xc5ee('0xb')](_0xc5ee('0xe'),auth[_0xc5ee('0x8')](),controller[_0xc5ee('0xf')]);router[_0xc5ee('0xb')](_0xc5ee('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xc5ee('0x11')]('/',auth['isAuthenticated'](),controller[_0xc5ee('0x12')]);router[_0xc5ee('0x13')](_0xc5ee('0x14'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc5ee('0x14'),auth[_0xc5ee('0x8')](),controller[_0xc5ee('0x15')]);module[_0xc5ee('0x16')]=router;
\ No newline at end of file
+var _0x45e8=['delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','update'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x45e8,0x12e));var _0x845e=function(_0x794207,_0x54a989){_0x794207=_0x794207-0x0;var _0x4ee1c9=_0x45e8[_0x794207];return _0x4ee1c9;};'use strict';var multer=require('multer');var util=require(_0x845e('0x0'));var path=require(_0x845e('0x1'));var timeout=require('connect-timeout');var express=require(_0x845e('0x2'));var router=express['Router']();var fs_extra=require(_0x845e('0x3'));var auth=require(_0x845e('0x4'));var interaction=require(_0x845e('0x5'));var config=require(_0x845e('0x6'));var controller=require(_0x845e('0x7'));router[_0x845e('0x8')]('/',auth[_0x845e('0x9')](),controller[_0x845e('0xa')]);router[_0x845e('0x8')](_0x845e('0xb'),auth[_0x845e('0x9')](),controller[_0x845e('0xc')]);router['get'](_0x845e('0xd'),auth[_0x845e('0x9')](),controller[_0x845e('0xe')]);router['get'](_0x845e('0xf'),auth[_0x845e('0x9')](),controller['getSubjects']);router[_0x845e('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x845e('0x10')]);router[_0x845e('0x11')]('/',auth['isAuthenticated'](),controller[_0x845e('0x12')]);router['put']('/:id',auth[_0x845e('0x9')](),controller[_0x845e('0x13')]);router[_0x845e('0x14')]('/:id',auth[_0x845e('0x9')](),controller[_0x845e('0x15')]);module[_0x845e('0x16')]=router;
\ No newline at end of file
index 0dab3ea..9e48fb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e06=['sequelize','exports','STRING'];(function(_0x4b3d03,_0x24fda4){var _0x2ea0a7=function(_0x288894){while(--_0x288894){_0x4b3d03['push'](_0x4b3d03['shift']());}};_0x2ea0a7(++_0x24fda4);}(_0x7e06,0xd8));var _0x67e0=function(_0x1321b1,_0x380c9f){_0x1321b1=_0x1321b1-0x0;var _0xd6e919=_0x7e06[_0x1321b1];return _0xd6e919;};'use strict';var Sequelize=require(_0x67e0('0x0'));module[_0x67e0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x67e0('0x2')]}};
\ No newline at end of file
+var _0xcf28=['STRING','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcf28,0x76));var _0x8cf2=function(_0x38b72e,_0x2d4e01){_0x38b72e=_0x38b72e-0x0;var _0x284562=_0xcf28[_0x38b72e];return _0x284562;};'use strict';var Sequelize=require(_0x8cf2('0x0'));module[_0x8cf2('0x1')]={'name':{'type':Sequelize[_0x8cf2('0x2')]},'description':{'type':Sequelize[_0x8cf2('0x2')]}};
\ No newline at end of file
index 8033217..7555ca2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdc1=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','save','update','destroy','error','stack','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','SugarcrmConfiguration','then','rows','show','params','rawAttributes','includeAll','include','options','find','catch','create','body','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xbdc1,0x94));var _0x1bdc=function(_0x43c12b,_0x553cb0){_0x43c12b=_0x43c12b-0x0;var _0x4701c0=_0xbdc1[_0x43c12b];return _0x4701c0;};'use strict';var emlformat=require(_0x1bdc('0x0'));var rimraf=require(_0x1bdc('0x1'));var zipdir=require(_0x1bdc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1bdc('0x3'));var BPromise=require(_0x1bdc('0x4'));var Mustache=require(_0x1bdc('0x5'));var util=require('util');var path=require(_0x1bdc('0x6'));var sox=require(_0x1bdc('0x7'));var csv=require(_0x1bdc('0x8'));var ejs=require(_0x1bdc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bdc('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1bdc('0xb'));var deskjs=require(_0x1bdc('0xc'));var toCsv=require(_0x1bdc('0x8'));var querystring=require(_0x1bdc('0xd'));var Papa=require(_0x1bdc('0xe'));var Redis=require(_0x1bdc('0xf'));var authService=require(_0x1bdc('0x10'));var qs=require(_0x1bdc('0x11'));var as=require(_0x1bdc('0x12'));var hardwareService=require(_0x1bdc('0x13'));var logger=require(_0x1bdc('0x14'))(_0x1bdc('0x15'));var utils=require(_0x1bdc('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x1bdc('0x17'));var db=require(_0x1bdc('0x18'))['db'];function respondWithStatusCode(_0x6229e6,_0x2c2c76){_0x2c2c76=_0x2c2c76||0xcc;return function(_0x4654a0){if(_0x4654a0){return _0x6229e6[_0x1bdc('0x19')](_0x2c2c76);}return _0x6229e6[_0x1bdc('0x1a')](_0x2c2c76)[_0x1bdc('0x1b')]();};}function respondWithResult(_0x482f42,_0x4fc3ec){_0x4fc3ec=_0x4fc3ec||0xc8;return function(_0x4b2b5a){if(_0x4b2b5a){return _0x482f42[_0x1bdc('0x1a')](_0x4fc3ec)[_0x1bdc('0x1c')](_0x4b2b5a);}};}function respondWithFilteredResult(_0x58e032,_0x453df4){return function(_0x54d5bc){if(_0x54d5bc){var _0xa324b=typeof _0x453df4['offset']==='undefined'&&typeof _0x453df4[_0x1bdc('0x1d')]===_0x1bdc('0x1e');var _0x3383e2=_0x54d5bc[_0x1bdc('0x1f')];var _0x2fe649=_0xa324b?0x0:_0x453df4['offset'];var _0x2f0ee0=_0xa324b?_0x54d5bc[_0x1bdc('0x1f')]:_0x453df4[_0x1bdc('0x20')]+_0x453df4[_0x1bdc('0x1d')];var _0x95c5e1;if(_0x2f0ee0>=_0x3383e2){_0x2f0ee0=_0x3383e2;_0x95c5e1=0xc8;}else{_0x95c5e1=0xce;}_0x58e032['status'](_0x95c5e1);return _0x58e032[_0x1bdc('0x21')]('Content-Range',_0x2fe649+'-'+_0x2f0ee0+'/'+_0x3383e2)[_0x1bdc('0x1c')](_0x54d5bc);}return null;};}function patchUpdates(_0x32fe3f){return function(_0xc658f1){try{jsonpatch['apply'](_0xc658f1,_0x32fe3f,!![]);}catch(_0x1ff9e8){return BPromise['reject'](_0x1ff9e8);}return _0xc658f1[_0x1bdc('0x22')]();};}function saveUpdates(_0x37a88b,_0x1a486a){return function(_0x50c242){if(_0x50c242){return _0x50c242[_0x1bdc('0x23')](_0x37a88b)['then'](function(_0x2ccd9b){return _0x2ccd9b;});}return null;};}function removeEntity(_0x541f9b,_0x237db5){return function(_0x5e3d29){if(_0x5e3d29){return _0x5e3d29[_0x1bdc('0x24')]()['then'](function(){_0x541f9b[_0x1bdc('0x1a')](0xcc)[_0x1bdc('0x1b')]();});}};}function handleEntityNotFound(_0x31c3ab,_0x1be93a){return function(_0x37b506){if(!_0x37b506){_0x31c3ab[_0x1bdc('0x19')](0x194);}return _0x37b506;};}function handleError(_0x162d0c,_0x40ac14){_0x40ac14=_0x40ac14||0x1f4;return function(_0x7e4e9){logger[_0x1bdc('0x25')](_0x7e4e9[_0x1bdc('0x26')]);if(_0x7e4e9['name']){delete _0x7e4e9[_0x1bdc('0x27')];}_0x162d0c[_0x1bdc('0x1a')](_0x40ac14)[_0x1bdc('0x28')](_0x7e4e9);};}exports[_0x1bdc('0x29')]=function(_0x5b68b3,_0x4eee99){var _0x4dcf6e={},_0x24cf9c={},_0x1bd9cc={'count':0x0,'rows':[]};var _0x15f46c=_['map'](db['SugarcrmConfiguration']['rawAttributes'],function(_0x6f6d51){return{'name':_0x6f6d51[_0x1bdc('0x2a')],'type':_0x6f6d51[_0x1bdc('0x2b')][_0x1bdc('0x2c')]};});_0x24cf9c[_0x1bdc('0x2d')]=_[_0x1bdc('0x2e')](_0x15f46c,_0x1bdc('0x27'));_0x24cf9c['query']=_[_0x1bdc('0x2f')](_0x5b68b3['query']);_0x24cf9c[_0x1bdc('0x30')]=_[_0x1bdc('0x31')](_0x24cf9c[_0x1bdc('0x2d')],_0x24cf9c['query']);_0x4dcf6e[_0x1bdc('0x32')]=_[_0x1bdc('0x31')](_0x24cf9c[_0x1bdc('0x2d')],qs[_0x1bdc('0x33')](_0x5b68b3[_0x1bdc('0x34')][_0x1bdc('0x33')]));_0x4dcf6e['attributes']=_0x4dcf6e['attributes'][_0x1bdc('0x35')]?_0x4dcf6e[_0x1bdc('0x32')]:_0x24cf9c[_0x1bdc('0x2d')];if(!_0x5b68b3[_0x1bdc('0x34')][_0x1bdc('0x36')](_0x1bdc('0x37'))){_0x4dcf6e[_0x1bdc('0x1d')]=qs['limit'](_0x5b68b3[_0x1bdc('0x34')][_0x1bdc('0x1d')]);_0x4dcf6e[_0x1bdc('0x20')]=qs['offset'](_0x5b68b3['query']['offset']);}_0x4dcf6e[_0x1bdc('0x38')]=qs[_0x1bdc('0x39')](_0x5b68b3[_0x1bdc('0x34')]['sort']);_0x4dcf6e[_0x1bdc('0x3a')]=qs[_0x1bdc('0x30')](_[_0x1bdc('0x3b')](_0x5b68b3['query'],_0x24cf9c['filters']),_0x15f46c);if(_0x5b68b3[_0x1bdc('0x34')]['filter']){_0x4dcf6e[_0x1bdc('0x3a')]=_['merge'](_0x4dcf6e[_0x1bdc('0x3a')],{'$or':_[_0x1bdc('0x2e')](_0x15f46c,function(_0xb26a84){if(_0xb26a84[_0x1bdc('0x2b')]!==_0x1bdc('0x3c')){var _0x431ca1={};_0x431ca1[_0xb26a84[_0x1bdc('0x27')]]={'$like':'%'+_0x5b68b3[_0x1bdc('0x34')][_0x1bdc('0x3d')]+'%'};return _0x431ca1;}})});}_0x4dcf6e=_[_0x1bdc('0x3e')]({},_0x4dcf6e,_0x5b68b3['options']);var _0xd82682={'where':_0x4dcf6e[_0x1bdc('0x3a')]};return db[_0x1bdc('0x3f')][_0x1bdc('0x1f')](_0xd82682)[_0x1bdc('0x40')](function(_0x333b47){_0x1bd9cc[_0x1bdc('0x1f')]=_0x333b47;if(_0x5b68b3[_0x1bdc('0x34')]['includeAll']){_0x4dcf6e['include']=[{'all':!![]}];}return db[_0x1bdc('0x3f')]['findAll'](_0x4dcf6e);})[_0x1bdc('0x40')](function(_0x184f7d){_0x1bd9cc[_0x1bdc('0x41')]=_0x184f7d;return _0x1bd9cc;})[_0x1bdc('0x40')](respondWithFilteredResult(_0x4eee99,_0x4dcf6e))['catch'](handleError(_0x4eee99,null));};exports[_0x1bdc('0x42')]=function(_0x3f0a7d,_0x9b99fa){var _0x23b938={'raw':![],'where':{'id':_0x3f0a7d[_0x1bdc('0x43')]['id']}},_0x1de31c={};_0x1de31c[_0x1bdc('0x2d')]=_[_0x1bdc('0x2f')](db[_0x1bdc('0x3f')][_0x1bdc('0x44')]);_0x1de31c['query']=_['keys'](_0x3f0a7d[_0x1bdc('0x34')]);_0x1de31c[_0x1bdc('0x30')]=_['intersection'](_0x1de31c[_0x1bdc('0x2d')],_0x1de31c[_0x1bdc('0x34')]);_0x23b938[_0x1bdc('0x32')]=_['intersection'](_0x1de31c[_0x1bdc('0x2d')],qs[_0x1bdc('0x33')](_0x3f0a7d['query'][_0x1bdc('0x33')]));_0x23b938['attributes']=_0x23b938[_0x1bdc('0x32')][_0x1bdc('0x35')]?_0x23b938[_0x1bdc('0x32')]:_0x1de31c[_0x1bdc('0x2d')];if(_0x3f0a7d[_0x1bdc('0x34')][_0x1bdc('0x45')]){_0x23b938[_0x1bdc('0x46')]=[{'all':!![]}];}_0x23b938=_[_0x1bdc('0x3e')]({},_0x23b938,_0x3f0a7d[_0x1bdc('0x47')]);return db['SugarcrmConfiguration'][_0x1bdc('0x48')](_0x23b938)['then'](handleEntityNotFound(_0x9b99fa,null))['then'](respondWithResult(_0x9b99fa,null))[_0x1bdc('0x49')](handleError(_0x9b99fa,null));};exports[_0x1bdc('0x4a')]=function(_0x10bc7e,_0x3ab081){return db[_0x1bdc('0x3f')][_0x1bdc('0x4a')](_0x10bc7e[_0x1bdc('0x4b')],{})[_0x1bdc('0x40')](respondWithResult(_0x3ab081,0xc9))[_0x1bdc('0x49')](handleError(_0x3ab081,null));};exports[_0x1bdc('0x23')]=function(_0x57640f,_0x17b449){if(_0x57640f['body']['id']){delete _0x57640f[_0x1bdc('0x4b')]['id'];}return db[_0x1bdc('0x3f')]['find']({'where':{'id':_0x57640f[_0x1bdc('0x43')]['id']}})['then'](handleEntityNotFound(_0x17b449,null))[_0x1bdc('0x40')](saveUpdates(_0x57640f[_0x1bdc('0x4b')],null))[_0x1bdc('0x40')](respondWithResult(_0x17b449,null))[_0x1bdc('0x49')](handleError(_0x17b449,null));};exports[_0x1bdc('0x24')]=function(_0x5ef91c,_0x1a68f3){return db['SugarcrmConfiguration'][_0x1bdc('0x48')]({'where':{'id':_0x5ef91c[_0x1bdc('0x43')]['id']}})['then'](handleEntityNotFound(_0x1a68f3,null))['then'](removeEntity(_0x1a68f3,null))[_0x1bdc('0x49')](handleError(_0x1a68f3,null));};exports[_0x1bdc('0x4c')]=function(_0x46aed8,_0x4c0c63,_0x179961){var _0x25cd33={};var _0x21f6bf={};var _0x1d3910;var _0x192d6c;return db[_0x1bdc('0x3f')][_0x1bdc('0x4d')]({'where':{'id':_0x46aed8[_0x1bdc('0x43')]['id']}})[_0x1bdc('0x40')](handleEntityNotFound(_0x4c0c63,null))[_0x1bdc('0x40')](function(_0x48dbd7){if(_0x48dbd7){_0x1d3910=_0x48dbd7;_0x21f6bf['model']=_[_0x1bdc('0x2f')](db[_0x1bdc('0x4e')]['rawAttributes']);_0x21f6bf[_0x1bdc('0x34')]=_[_0x1bdc('0x2f')](_0x46aed8['query']);_0x21f6bf[_0x1bdc('0x30')]=_[_0x1bdc('0x31')](_0x21f6bf[_0x1bdc('0x2d')],_0x21f6bf[_0x1bdc('0x34')]);_0x25cd33['attributes']=_[_0x1bdc('0x31')](_0x21f6bf[_0x1bdc('0x2d')],qs['fields'](_0x46aed8[_0x1bdc('0x34')][_0x1bdc('0x33')]));_0x25cd33[_0x1bdc('0x32')]=_0x25cd33[_0x1bdc('0x32')][_0x1bdc('0x35')]?_0x25cd33[_0x1bdc('0x32')]:_0x21f6bf['model'];_0x25cd33[_0x1bdc('0x38')]=qs[_0x1bdc('0x39')](_0x46aed8['query'][_0x1bdc('0x39')]);_0x25cd33[_0x1bdc('0x3a')]=qs[_0x1bdc('0x30')](_[_0x1bdc('0x3b')](_0x46aed8['query'],_0x21f6bf['filters']));if(_0x46aed8['query'][_0x1bdc('0x3d')]){_0x25cd33[_0x1bdc('0x3a')]=_['merge'](_0x25cd33[_0x1bdc('0x3a')],{'$or':_[_0x1bdc('0x2e')](_0x25cd33['attributes'],function(_0x2d34c7){var _0x3479d1={};_0x3479d1[_0x2d34c7]={'$like':'%'+_0x46aed8[_0x1bdc('0x34')][_0x1bdc('0x3d')]+'%'};return _0x3479d1;})});}_0x25cd33=_[_0x1bdc('0x3e')]({},_0x25cd33,_0x46aed8['options']);return _0x1d3910[_0x1bdc('0x4c')](_0x25cd33);}})[_0x1bdc('0x40')](function(_0x50a01c){if(_0x50a01c){_0x192d6c=_0x50a01c[_0x1bdc('0x35')];if(!_0x46aed8[_0x1bdc('0x34')][_0x1bdc('0x36')]('nolimit')){_0x25cd33['limit']=qs['limit'](_0x46aed8['query'][_0x1bdc('0x1d')]);_0x25cd33[_0x1bdc('0x20')]=qs[_0x1bdc('0x20')](_0x46aed8[_0x1bdc('0x34')][_0x1bdc('0x20')]);}return _0x1d3910['getFields'](_0x25cd33);}})['then'](function(_0x3302d9){if(_0x3302d9){return _0x3302d9?{'count':_0x192d6c,'rows':_0x3302d9}:null;}})['then'](respondWithResult(_0x4c0c63,null))[_0x1bdc('0x49')](handleError(_0x4c0c63,null));};exports[_0x1bdc('0x4f')]=function(_0x66b247,_0x497b28,_0xda9eb9){var _0x947e60={};var _0x1b3a2f={};var _0x1fe05d;var _0x10bd67;return db['SugarcrmConfiguration'][_0x1bdc('0x4d')]({'where':{'id':_0x66b247[_0x1bdc('0x43')]['id']}})[_0x1bdc('0x40')](handleEntityNotFound(_0x497b28,null))[_0x1bdc('0x40')](function(_0x143af2){if(_0x143af2){_0x1fe05d=_0x143af2;_0x1b3a2f[_0x1bdc('0x2d')]=_[_0x1bdc('0x2f')](db[_0x1bdc('0x4e')][_0x1bdc('0x44')]);_0x1b3a2f[_0x1bdc('0x34')]=_[_0x1bdc('0x2f')](_0x66b247['query']);_0x1b3a2f[_0x1bdc('0x30')]=_[_0x1bdc('0x31')](_0x1b3a2f[_0x1bdc('0x2d')],_0x1b3a2f[_0x1bdc('0x34')]);_0x947e60[_0x1bdc('0x32')]=_[_0x1bdc('0x31')](_0x1b3a2f[_0x1bdc('0x2d')],qs['fields'](_0x66b247[_0x1bdc('0x34')][_0x1bdc('0x33')]));_0x947e60['attributes']=_0x947e60['attributes'][_0x1bdc('0x35')]?_0x947e60['attributes']:_0x1b3a2f['model'];_0x947e60[_0x1bdc('0x38')]=qs[_0x1bdc('0x39')](_0x66b247['query']['sort']);_0x947e60['where']=qs[_0x1bdc('0x30')](_['pick'](_0x66b247[_0x1bdc('0x34')],_0x1b3a2f['filters']));if(_0x66b247[_0x1bdc('0x34')][_0x1bdc('0x3d')]){_0x947e60['where']=_[_0x1bdc('0x3e')](_0x947e60[_0x1bdc('0x3a')],{'$or':_[_0x1bdc('0x2e')](_0x947e60[_0x1bdc('0x32')],function(_0x5f4159){var _0x30e6ce={};_0x30e6ce[_0x5f4159]={'$like':'%'+_0x66b247[_0x1bdc('0x34')][_0x1bdc('0x3d')]+'%'};return _0x30e6ce;})});}_0x947e60=_[_0x1bdc('0x3e')]({},_0x947e60,_0x66b247[_0x1bdc('0x47')]);return _0x1fe05d[_0x1bdc('0x4f')](_0x947e60);}})[_0x1bdc('0x40')](function(_0x57159f){if(_0x57159f){_0x10bd67=_0x57159f[_0x1bdc('0x35')];if(!_0x66b247[_0x1bdc('0x34')][_0x1bdc('0x36')](_0x1bdc('0x37'))){_0x947e60[_0x1bdc('0x1d')]=qs[_0x1bdc('0x1d')](_0x66b247[_0x1bdc('0x34')][_0x1bdc('0x1d')]);_0x947e60[_0x1bdc('0x20')]=qs[_0x1bdc('0x20')](_0x66b247[_0x1bdc('0x34')][_0x1bdc('0x20')]);}return _0x1fe05d[_0x1bdc('0x4f')](_0x947e60);}})[_0x1bdc('0x40')](function(_0x5605d1){if(_0x5605d1){return _0x5605d1?{'count':_0x10bd67,'rows':_0x5605d1}:null;}})['then'](respondWithResult(_0x497b28,null))['catch'](handleError(_0x497b28,null));};exports[_0x1bdc('0x50')]=function(_0x1c313,_0x59eef2,_0x29ce46){var _0x5f4a5d={};var _0x17b0c5={};var _0x3620e9;var _0x319d55;return db[_0x1bdc('0x3f')]['findOne']({'where':{'id':_0x1c313[_0x1bdc('0x43')]['id']}})['then'](handleEntityNotFound(_0x59eef2,null))['then'](function(_0x18955e){if(_0x18955e){_0x3620e9=_0x18955e;_0x17b0c5[_0x1bdc('0x2d')]=_[_0x1bdc('0x2f')](db[_0x1bdc('0x4e')]['rawAttributes']);_0x17b0c5['query']=_['keys'](_0x1c313[_0x1bdc('0x34')]);_0x17b0c5[_0x1bdc('0x30')]=_['intersection'](_0x17b0c5[_0x1bdc('0x2d')],_0x17b0c5[_0x1bdc('0x34')]);_0x5f4a5d[_0x1bdc('0x32')]=_[_0x1bdc('0x31')](_0x17b0c5[_0x1bdc('0x2d')],qs['fields'](_0x1c313[_0x1bdc('0x34')][_0x1bdc('0x33')]));_0x5f4a5d[_0x1bdc('0x32')]=_0x5f4a5d['attributes'][_0x1bdc('0x35')]?_0x5f4a5d[_0x1bdc('0x32')]:_0x17b0c5[_0x1bdc('0x2d')];_0x5f4a5d[_0x1bdc('0x38')]=qs['sort'](_0x1c313[_0x1bdc('0x34')][_0x1bdc('0x39')]);_0x5f4a5d['where']=qs[_0x1bdc('0x30')](_[_0x1bdc('0x3b')](_0x1c313['query'],_0x17b0c5[_0x1bdc('0x30')]));if(_0x1c313[_0x1bdc('0x34')]['filter']){_0x5f4a5d[_0x1bdc('0x3a')]=_[_0x1bdc('0x3e')](_0x5f4a5d['where'],{'$or':_[_0x1bdc('0x2e')](_0x5f4a5d[_0x1bdc('0x32')],function(_0x48324a){var _0xb4ad8e={};_0xb4ad8e[_0x48324a]={'$like':'%'+_0x1c313[_0x1bdc('0x34')]['filter']+'%'};return _0xb4ad8e;})});}_0x5f4a5d=_[_0x1bdc('0x3e')]({},_0x5f4a5d,_0x1c313[_0x1bdc('0x47')]);return _0x3620e9[_0x1bdc('0x50')](_0x5f4a5d);}})[_0x1bdc('0x40')](function(_0x301ce0){if(_0x301ce0){_0x319d55=_0x301ce0[_0x1bdc('0x35')];if(!_0x1c313['query']['hasOwnProperty']('nolimit')){_0x5f4a5d[_0x1bdc('0x1d')]=qs[_0x1bdc('0x1d')](_0x1c313[_0x1bdc('0x34')][_0x1bdc('0x1d')]);_0x5f4a5d[_0x1bdc('0x20')]=qs[_0x1bdc('0x20')](_0x1c313[_0x1bdc('0x34')]['offset']);}return _0x3620e9[_0x1bdc('0x50')](_0x5f4a5d);}})['then'](function(_0x158690){if(_0x158690){return _0x158690?{'count':_0x319d55,'rows':_0x158690}:null;}})[_0x1bdc('0x40')](respondWithResult(_0x59eef2,null))[_0x1bdc('0x49')](handleError(_0x59eef2,null));};
\ No newline at end of file
+var _0xd194=['include','findAll','rows','params','length','find','catch','create','body','getFields','findOne','SugarcrmField','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','error','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options'];(function(_0x5b5cbc,_0x5602cb){var _0x45dc47=function(_0x49e90b){while(--_0x49e90b){_0x5b5cbc['push'](_0x5b5cbc['shift']());}};_0x45dc47(++_0x5602cb);}(_0xd194,0x153));var _0x4d19=function(_0x4f550e,_0x396412){_0x4f550e=_0x4f550e-0x0;var _0x56691b=_0xd194[_0x4f550e];return _0x56691b;};'use strict';var emlformat=require(_0x4d19('0x0'));var rimraf=require(_0x4d19('0x1'));var zipdir=require(_0x4d19('0x2'));var jsonpatch=require(_0x4d19('0x3'));var rp=require(_0x4d19('0x4'));var moment=require(_0x4d19('0x5'));var BPromise=require(_0x4d19('0x6'));var Mustache=require(_0x4d19('0x7'));var util=require(_0x4d19('0x8'));var path=require('path');var sox=require(_0x4d19('0x9'));var csv=require(_0x4d19('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4d19('0xb'));var _=require(_0x4d19('0xc'));var squel=require(_0x4d19('0xd'));var crypto=require(_0x4d19('0xe'));var jsforce=require(_0x4d19('0xf'));var deskjs=require(_0x4d19('0x10'));var toCsv=require(_0x4d19('0xa'));var querystring=require(_0x4d19('0x11'));var Papa=require(_0x4d19('0x12'));var Redis=require(_0x4d19('0x13'));var authService=require(_0x4d19('0x14'));var qs=require(_0x4d19('0x15'));var as=require(_0x4d19('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4d19('0x17'));var utils=require(_0x4d19('0x18'));var config=require(_0x4d19('0x19'));var licenseUtil=require(_0x4d19('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e4ef0,_0xb3f32a){_0xb3f32a=_0xb3f32a||0xcc;return function(_0x59bcae){if(_0x59bcae){return _0x4e4ef0[_0x4d19('0x1b')](_0xb3f32a);}return _0x4e4ef0[_0x4d19('0x1c')](_0xb3f32a)[_0x4d19('0x1d')]();};}function respondWithResult(_0x20781f,_0x4e9965){_0x4e9965=_0x4e9965||0xc8;return function(_0x36835b){if(_0x36835b){return _0x20781f[_0x4d19('0x1c')](_0x4e9965)[_0x4d19('0x1e')](_0x36835b);}};}function respondWithFilteredResult(_0x137978,_0x46ef4b){return function(_0xb3692f){if(_0xb3692f){var _0x286226=typeof _0x46ef4b[_0x4d19('0x1f')]==='undefined'&&typeof _0x46ef4b[_0x4d19('0x20')]===_0x4d19('0x21');var _0x128c9f=_0xb3692f['count'];var _0x76a9c=_0x286226?0x0:_0x46ef4b[_0x4d19('0x1f')];var _0x5c725e=_0x286226?_0xb3692f[_0x4d19('0x22')]:_0x46ef4b[_0x4d19('0x1f')]+_0x46ef4b[_0x4d19('0x20')];var _0x300bc3;if(_0x5c725e>=_0x128c9f){_0x5c725e=_0x128c9f;_0x300bc3=0xc8;}else{_0x300bc3=0xce;}_0x137978['status'](_0x300bc3);return _0x137978['set'](_0x4d19('0x23'),_0x76a9c+'-'+_0x5c725e+'/'+_0x128c9f)['json'](_0xb3692f);}return null;};}function patchUpdates(_0x34a7bb){return function(_0x363a4c){try{jsonpatch[_0x4d19('0x24')](_0x363a4c,_0x34a7bb,!![]);}catch(_0x3e2e0a){return BPromise['reject'](_0x3e2e0a);}return _0x363a4c[_0x4d19('0x25')]();};}function saveUpdates(_0x503e3c,_0x59a64c){return function(_0xd35efa){if(_0xd35efa){return _0xd35efa[_0x4d19('0x26')](_0x503e3c)[_0x4d19('0x27')](function(_0x569083){return _0x569083;});}return null;};}function removeEntity(_0x399b22,_0xb0bc35){return function(_0x4600e1){if(_0x4600e1){return _0x4600e1[_0x4d19('0x28')]()[_0x4d19('0x27')](function(){_0x399b22[_0x4d19('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dc79c,_0x5a1387){return function(_0x5626ed){if(!_0x5626ed){_0x2dc79c[_0x4d19('0x1b')](0x194);}return _0x5626ed;};}function handleError(_0x59dc56,_0x224d2){_0x224d2=_0x224d2||0x1f4;return function(_0x39578b){logger[_0x4d19('0x29')](_0x39578b['stack']);if(_0x39578b[_0x4d19('0x2a')]){delete _0x39578b[_0x4d19('0x2a')];}_0x59dc56['status'](_0x224d2)[_0x4d19('0x2b')](_0x39578b);};}exports[_0x4d19('0x2c')]=function(_0x3bb20a,_0x1a72fc){var _0x2bc2fd={},_0xa5451e={},_0x4e99d7={'count':0x0,'rows':[]};var _0xb75681=_['map'](db[_0x4d19('0x2d')][_0x4d19('0x2e')],function(_0x5ef12a){return{'name':_0x5ef12a[_0x4d19('0x2f')],'type':_0x5ef12a[_0x4d19('0x30')]['key']};});_0xa5451e['model']=_[_0x4d19('0x31')](_0xb75681,_0x4d19('0x2a'));_0xa5451e[_0x4d19('0x32')]=_[_0x4d19('0x33')](_0x3bb20a[_0x4d19('0x32')]);_0xa5451e[_0x4d19('0x34')]=_['intersection'](_0xa5451e[_0x4d19('0x35')],_0xa5451e[_0x4d19('0x32')]);_0x2bc2fd[_0x4d19('0x36')]=_[_0x4d19('0x37')](_0xa5451e[_0x4d19('0x35')],qs[_0x4d19('0x38')](_0x3bb20a['query']['fields']));_0x2bc2fd[_0x4d19('0x36')]=_0x2bc2fd[_0x4d19('0x36')]['length']?_0x2bc2fd[_0x4d19('0x36')]:_0xa5451e[_0x4d19('0x35')];if(!_0x3bb20a[_0x4d19('0x32')][_0x4d19('0x39')]('nolimit')){_0x2bc2fd[_0x4d19('0x20')]=qs[_0x4d19('0x20')](_0x3bb20a['query'][_0x4d19('0x20')]);_0x2bc2fd[_0x4d19('0x1f')]=qs[_0x4d19('0x1f')](_0x3bb20a['query'][_0x4d19('0x1f')]);}_0x2bc2fd[_0x4d19('0x3a')]=qs[_0x4d19('0x3b')](_0x3bb20a['query']['sort']);_0x2bc2fd[_0x4d19('0x3c')]=qs['filters'](_[_0x4d19('0x3d')](_0x3bb20a[_0x4d19('0x32')],_0xa5451e[_0x4d19('0x34')]),_0xb75681);if(_0x3bb20a['query']['filter']){_0x2bc2fd[_0x4d19('0x3c')]=_[_0x4d19('0x3e')](_0x2bc2fd[_0x4d19('0x3c')],{'$or':_[_0x4d19('0x31')](_0xb75681,function(_0x3be404){if(_0x3be404[_0x4d19('0x30')]!==_0x4d19('0x3f')){var _0x57235f={};_0x57235f[_0x3be404[_0x4d19('0x2a')]]={'$like':'%'+_0x3bb20a[_0x4d19('0x32')][_0x4d19('0x40')]+'%'};return _0x57235f;}})});}_0x2bc2fd=_[_0x4d19('0x3e')]({},_0x2bc2fd,_0x3bb20a[_0x4d19('0x41')]);var _0x315818={'where':_0x2bc2fd[_0x4d19('0x3c')]};return db[_0x4d19('0x2d')][_0x4d19('0x22')](_0x315818)[_0x4d19('0x27')](function(_0x4b9386){_0x4e99d7[_0x4d19('0x22')]=_0x4b9386;if(_0x3bb20a[_0x4d19('0x32')]['includeAll']){_0x2bc2fd[_0x4d19('0x42')]=[{'all':!![]}];}return db[_0x4d19('0x2d')][_0x4d19('0x43')](_0x2bc2fd);})[_0x4d19('0x27')](function(_0x1a1e16){_0x4e99d7[_0x4d19('0x44')]=_0x1a1e16;return _0x4e99d7;})[_0x4d19('0x27')](respondWithFilteredResult(_0x1a72fc,_0x2bc2fd))['catch'](handleError(_0x1a72fc,null));};exports['show']=function(_0x46b8ef,_0xe7ef4){var _0x1833d8={'raw':![],'where':{'id':_0x46b8ef[_0x4d19('0x45')]['id']}},_0x3be6e1={};_0x3be6e1['model']=_[_0x4d19('0x33')](db['SugarcrmConfiguration'][_0x4d19('0x2e')]);_0x3be6e1[_0x4d19('0x32')]=_[_0x4d19('0x33')](_0x46b8ef[_0x4d19('0x32')]);_0x3be6e1[_0x4d19('0x34')]=_[_0x4d19('0x37')](_0x3be6e1[_0x4d19('0x35')],_0x3be6e1[_0x4d19('0x32')]);_0x1833d8[_0x4d19('0x36')]=_[_0x4d19('0x37')](_0x3be6e1[_0x4d19('0x35')],qs[_0x4d19('0x38')](_0x46b8ef[_0x4d19('0x32')][_0x4d19('0x38')]));_0x1833d8[_0x4d19('0x36')]=_0x1833d8[_0x4d19('0x36')][_0x4d19('0x46')]?_0x1833d8[_0x4d19('0x36')]:_0x3be6e1['model'];if(_0x46b8ef['query']['includeAll']){_0x1833d8[_0x4d19('0x42')]=[{'all':!![]}];}_0x1833d8=_[_0x4d19('0x3e')]({},_0x1833d8,_0x46b8ef[_0x4d19('0x41')]);return db[_0x4d19('0x2d')][_0x4d19('0x47')](_0x1833d8)[_0x4d19('0x27')](handleEntityNotFound(_0xe7ef4,null))['then'](respondWithResult(_0xe7ef4,null))[_0x4d19('0x48')](handleError(_0xe7ef4,null));};exports['create']=function(_0xef70bc,_0x4dd56d){return db[_0x4d19('0x2d')][_0x4d19('0x49')](_0xef70bc[_0x4d19('0x4a')],{})[_0x4d19('0x27')](respondWithResult(_0x4dd56d,0xc9))['catch'](handleError(_0x4dd56d,null));};exports[_0x4d19('0x26')]=function(_0x23c668,_0x1159ea){if(_0x23c668[_0x4d19('0x4a')]['id']){delete _0x23c668[_0x4d19('0x4a')]['id'];}return db[_0x4d19('0x2d')][_0x4d19('0x47')]({'where':{'id':_0x23c668[_0x4d19('0x45')]['id']}})[_0x4d19('0x27')](handleEntityNotFound(_0x1159ea,null))['then'](saveUpdates(_0x23c668[_0x4d19('0x4a')],null))[_0x4d19('0x27')](respondWithResult(_0x1159ea,null))[_0x4d19('0x48')](handleError(_0x1159ea,null));};exports['destroy']=function(_0x47c785,_0x35f4be){return db[_0x4d19('0x2d')][_0x4d19('0x47')]({'where':{'id':_0x47c785[_0x4d19('0x45')]['id']}})[_0x4d19('0x27')](handleEntityNotFound(_0x35f4be,null))[_0x4d19('0x27')](removeEntity(_0x35f4be,null))['catch'](handleError(_0x35f4be,null));};exports[_0x4d19('0x4b')]=function(_0x485771,_0x47593f,_0x3f82af){var _0x148950={};var _0x20e0ab={};var _0x4c24c2;var _0x4a735c;return db[_0x4d19('0x2d')][_0x4d19('0x4c')]({'where':{'id':_0x485771['params']['id']}})[_0x4d19('0x27')](handleEntityNotFound(_0x47593f,null))['then'](function(_0xd5983c){if(_0xd5983c){_0x4c24c2=_0xd5983c;_0x20e0ab[_0x4d19('0x35')]=_[_0x4d19('0x33')](db[_0x4d19('0x4d')][_0x4d19('0x2e')]);_0x20e0ab['query']=_[_0x4d19('0x33')](_0x485771[_0x4d19('0x32')]);_0x20e0ab[_0x4d19('0x34')]=_[_0x4d19('0x37')](_0x20e0ab[_0x4d19('0x35')],_0x20e0ab[_0x4d19('0x32')]);_0x148950[_0x4d19('0x36')]=_['intersection'](_0x20e0ab['model'],qs[_0x4d19('0x38')](_0x485771[_0x4d19('0x32')][_0x4d19('0x38')]));_0x148950[_0x4d19('0x36')]=_0x148950[_0x4d19('0x36')][_0x4d19('0x46')]?_0x148950[_0x4d19('0x36')]:_0x20e0ab[_0x4d19('0x35')];_0x148950[_0x4d19('0x3a')]=qs['sort'](_0x485771['query'][_0x4d19('0x3b')]);_0x148950[_0x4d19('0x3c')]=qs[_0x4d19('0x34')](_[_0x4d19('0x3d')](_0x485771[_0x4d19('0x32')],_0x20e0ab[_0x4d19('0x34')]));if(_0x485771[_0x4d19('0x32')][_0x4d19('0x40')]){_0x148950['where']=_[_0x4d19('0x3e')](_0x148950[_0x4d19('0x3c')],{'$or':_['map'](_0x148950[_0x4d19('0x36')],function(_0x4ec803){var _0x2977ae={};_0x2977ae[_0x4ec803]={'$like':'%'+_0x485771[_0x4d19('0x32')][_0x4d19('0x40')]+'%'};return _0x2977ae;})});}_0x148950=_[_0x4d19('0x3e')]({},_0x148950,_0x485771[_0x4d19('0x41')]);return _0x4c24c2[_0x4d19('0x4b')](_0x148950);}})[_0x4d19('0x27')](function(_0x394b7e){if(_0x394b7e){_0x4a735c=_0x394b7e['length'];if(!_0x485771['query']['hasOwnProperty'](_0x4d19('0x4e'))){_0x148950[_0x4d19('0x20')]=qs[_0x4d19('0x20')](_0x485771[_0x4d19('0x32')][_0x4d19('0x20')]);_0x148950['offset']=qs[_0x4d19('0x1f')](_0x485771[_0x4d19('0x32')][_0x4d19('0x1f')]);}return _0x4c24c2['getFields'](_0x148950);}})[_0x4d19('0x27')](function(_0x294619){if(_0x294619){return _0x294619?{'count':_0x4a735c,'rows':_0x294619}:null;}})['then'](respondWithResult(_0x47593f,null))[_0x4d19('0x48')](handleError(_0x47593f,null));};exports[_0x4d19('0x4f')]=function(_0x36b712,_0x284691,_0x390e77){var _0x223cb4={};var _0x33ea35={};var _0x11a018;var _0x1af13e;return db[_0x4d19('0x2d')][_0x4d19('0x4c')]({'where':{'id':_0x36b712[_0x4d19('0x45')]['id']}})[_0x4d19('0x27')](handleEntityNotFound(_0x284691,null))[_0x4d19('0x27')](function(_0x1c0bdc){if(_0x1c0bdc){_0x11a018=_0x1c0bdc;_0x33ea35[_0x4d19('0x35')]=_[_0x4d19('0x33')](db[_0x4d19('0x4d')][_0x4d19('0x2e')]);_0x33ea35[_0x4d19('0x32')]=_[_0x4d19('0x33')](_0x36b712[_0x4d19('0x32')]);_0x33ea35['filters']=_[_0x4d19('0x37')](_0x33ea35['model'],_0x33ea35[_0x4d19('0x32')]);_0x223cb4[_0x4d19('0x36')]=_[_0x4d19('0x37')](_0x33ea35[_0x4d19('0x35')],qs[_0x4d19('0x38')](_0x36b712[_0x4d19('0x32')][_0x4d19('0x38')]));_0x223cb4[_0x4d19('0x36')]=_0x223cb4[_0x4d19('0x36')][_0x4d19('0x46')]?_0x223cb4[_0x4d19('0x36')]:_0x33ea35[_0x4d19('0x35')];_0x223cb4['order']=qs['sort'](_0x36b712['query'][_0x4d19('0x3b')]);_0x223cb4[_0x4d19('0x3c')]=qs[_0x4d19('0x34')](_[_0x4d19('0x3d')](_0x36b712['query'],_0x33ea35[_0x4d19('0x34')]));if(_0x36b712[_0x4d19('0x32')]['filter']){_0x223cb4[_0x4d19('0x3c')]=_['merge'](_0x223cb4[_0x4d19('0x3c')],{'$or':_[_0x4d19('0x31')](_0x223cb4[_0x4d19('0x36')],function(_0x44ee23){var _0x45797b={};_0x45797b[_0x44ee23]={'$like':'%'+_0x36b712[_0x4d19('0x32')]['filter']+'%'};return _0x45797b;})});}_0x223cb4=_['merge']({},_0x223cb4,_0x36b712[_0x4d19('0x41')]);return _0x11a018[_0x4d19('0x4f')](_0x223cb4);}})[_0x4d19('0x27')](function(_0x1c3bc6){if(_0x1c3bc6){_0x1af13e=_0x1c3bc6['length'];if(!_0x36b712[_0x4d19('0x32')][_0x4d19('0x39')](_0x4d19('0x4e'))){_0x223cb4[_0x4d19('0x20')]=qs['limit'](_0x36b712['query'][_0x4d19('0x20')]);_0x223cb4['offset']=qs['offset'](_0x36b712['query'][_0x4d19('0x1f')]);}return _0x11a018[_0x4d19('0x4f')](_0x223cb4);}})[_0x4d19('0x27')](function(_0x3313a2){if(_0x3313a2){return _0x3313a2?{'count':_0x1af13e,'rows':_0x3313a2}:null;}})[_0x4d19('0x27')](respondWithResult(_0x284691,null))[_0x4d19('0x48')](handleError(_0x284691,null));};exports[_0x4d19('0x50')]=function(_0x536936,_0x4bf269,_0x5b1b81){var _0x537243={};var _0x4d0de6={};var _0x186769;var _0x3face1;return db[_0x4d19('0x2d')][_0x4d19('0x4c')]({'where':{'id':_0x536936[_0x4d19('0x45')]['id']}})[_0x4d19('0x27')](handleEntityNotFound(_0x4bf269,null))[_0x4d19('0x27')](function(_0x3e91d4){if(_0x3e91d4){_0x186769=_0x3e91d4;_0x4d0de6['model']=_[_0x4d19('0x33')](db[_0x4d19('0x4d')]['rawAttributes']);_0x4d0de6['query']=_[_0x4d19('0x33')](_0x536936['query']);_0x4d0de6[_0x4d19('0x34')]=_[_0x4d19('0x37')](_0x4d0de6['model'],_0x4d0de6['query']);_0x537243[_0x4d19('0x36')]=_[_0x4d19('0x37')](_0x4d0de6['model'],qs['fields'](_0x536936['query'][_0x4d19('0x38')]));_0x537243['attributes']=_0x537243['attributes'][_0x4d19('0x46')]?_0x537243[_0x4d19('0x36')]:_0x4d0de6[_0x4d19('0x35')];_0x537243['order']=qs['sort'](_0x536936[_0x4d19('0x32')][_0x4d19('0x3b')]);_0x537243[_0x4d19('0x3c')]=qs[_0x4d19('0x34')](_[_0x4d19('0x3d')](_0x536936[_0x4d19('0x32')],_0x4d0de6[_0x4d19('0x34')]));if(_0x536936[_0x4d19('0x32')]['filter']){_0x537243['where']=_[_0x4d19('0x3e')](_0x537243[_0x4d19('0x3c')],{'$or':_['map'](_0x537243[_0x4d19('0x36')],function(_0x54d60d){var _0x23a827={};_0x23a827[_0x54d60d]={'$like':'%'+_0x536936[_0x4d19('0x32')][_0x4d19('0x40')]+'%'};return _0x23a827;})});}_0x537243=_[_0x4d19('0x3e')]({},_0x537243,_0x536936[_0x4d19('0x41')]);return _0x186769['getDescriptions'](_0x537243);}})[_0x4d19('0x27')](function(_0x53e353){if(_0x53e353){_0x3face1=_0x53e353[_0x4d19('0x46')];if(!_0x536936['query'][_0x4d19('0x39')](_0x4d19('0x4e'))){_0x537243[_0x4d19('0x20')]=qs[_0x4d19('0x20')](_0x536936[_0x4d19('0x32')][_0x4d19('0x20')]);_0x537243[_0x4d19('0x1f')]=qs[_0x4d19('0x1f')](_0x536936[_0x4d19('0x32')]['offset']);}return _0x186769[_0x4d19('0x50')](_0x537243);}})[_0x4d19('0x27')](function(_0x32b87b){if(_0x32b87b){return _0x32b87b?{'count':_0x3face1,'rows':_0x32b87b}:null;}})[_0x4d19('0x27')](respondWithResult(_0x4bf269,null))[_0x4d19('0x48')](handleError(_0x4bf269,null));};
\ No newline at end of file
index 277fd69..856de9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8721=['SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','../../config/environment','./intSugarcrmConfiguration.attributes','define'];(function(_0x543460,_0x2c3426){var _0x1a8fc9=function(_0x36fe56){while(--_0x36fe56){_0x543460['push'](_0x543460['shift']());}};_0x1a8fc9(++_0x2c3426);}(_0x8721,0xc0));var _0x1872=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0x8721[_0x59162a];return _0x35e50d;};'use strict';var _=require('lodash');var util=require(_0x1872('0x0'));var logger=require(_0x1872('0x1'))(_0x1872('0x2'));var moment=require(_0x1872('0x3'));var BPromise=require(_0x1872('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1872('0x5'));var attributes=require(_0x1872('0x6'));module['exports']=function(_0x5cb888,_0x352b73){return _0x5cb888[_0x1872('0x7')](_0x1872('0x8'),attributes,{'tableName':_0x1872('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ea3=['bluebird','request-promise','../../config/environment','exports','define','int_sugarcrm_configurations','util','../../config/logger','moment'];(function(_0x2b4736,_0x5079b7){var _0x357cd0=function(_0x2ed3f3){while(--_0x2ed3f3){_0x2b4736['push'](_0x2b4736['shift']());}};_0x357cd0(++_0x5079b7);}(_0x5ea3,0x14a));var _0x35ea=function(_0x1b12ec,_0x31f00d){_0x1b12ec=_0x1b12ec-0x0;var _0x43c4c0=_0x5ea3[_0x1b12ec];return _0x43c4c0;};'use strict';var _=require('lodash');var util=require(_0x35ea('0x0'));var logger=require(_0x35ea('0x1'))('api');var moment=require(_0x35ea('0x2'));var BPromise=require(_0x35ea('0x3'));var rp=require(_0x35ea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x35ea('0x5'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x35ea('0x6')]=function(_0x2f76c8,_0x8f851f){return _0x2f76c8[_0x35ea('0x7')]('SugarcrmConfiguration',attributes,{'tableName':_0x35ea('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6e394c1..c41cd19 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32ac=['stringify','code','error','SugarcrmConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1f123b,_0x3ece91){var _0x11ee3a=function(_0x2e94aa){while(--_0x2e94aa){_0x1f123b['push'](_0x1f123b['shift']());}};_0x11ee3a(++_0x3ece91);}(_0x32ac,0xe7));var _0xc32a=function(_0x4fadb6,_0x4280d7){_0x4fadb6=_0x4fadb6-0x0;var _0x373cf9=_0x32ac[_0x4fadb6];return _0x373cf9;};'use strict';var _=require(_0xc32a('0x0'));var util=require(_0xc32a('0x1'));var moment=require(_0xc32a('0x2'));var BPromise=require(_0xc32a('0x3'));var rs=require(_0xc32a('0x4'));var fs=require('fs');var Redis=require(_0xc32a('0x5'));var db=require(_0xc32a('0x6'))['db'];var utils=require(_0xc32a('0x7'));var logger=require(_0xc32a('0x8'))('rpc');var config=require(_0xc32a('0x9'));var jayson=require(_0xc32a('0xa'));var client=jayson[_0xc32a('0xb')][_0xc32a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x68ca8d,_0x232633,_0x43d28c){return new BPromise(function(_0xb07b2b,_0x34876b){return client[_0xc32a('0xd')](_0x68ca8d,_0x43d28c)[_0xc32a('0xe')](function(_0x674b32){logger[_0xc32a('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x232633,'request\x20sent');logger[_0xc32a('0x10')](_0xc32a('0x11'),_0x232633,_0xc32a('0x12'),JSON[_0xc32a('0x13')](_0x674b32));if(_0x674b32['error']){if(_0x674b32['error'][_0xc32a('0x14')]===0x1f4){logger[_0xc32a('0x15')](_0xc32a('0x16'),_0x232633,_0x674b32['error'][_0xc32a('0x17')]);return _0x34876b(_0x674b32[_0xc32a('0x15')][_0xc32a('0x17')]);}logger[_0xc32a('0x15')](_0xc32a('0x16'),_0x232633,_0x674b32[_0xc32a('0x15')][_0xc32a('0x17')]);return _0xb07b2b(_0x674b32[_0xc32a('0x15')][_0xc32a('0x17')]);}else{logger['info'](_0xc32a('0x16'),_0x232633,_0xc32a('0x12'));_0xb07b2b(_0x674b32['result']['message']);}})[_0xc32a('0x18')](function(_0xa145e2){logger['error'](_0xc32a('0x16'),_0x232633,_0xa145e2);_0x34876b(_0xa145e2);});});}
\ No newline at end of file
+var _0x0842=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x500853,_0xbffce1){var _0x5c6c98=function(_0x56847d){while(--_0x56847d){_0x500853['push'](_0x500853['shift']());}};_0x5c6c98(++_0xbffce1);}(_0x0842,0x85));var _0x2084=function(_0x4b034d,_0x4503f0){_0x4b034d=_0x4b034d-0x0;var _0x144c84=_0x0842[_0x4b034d];return _0x144c84;};'use strict';var _=require(_0x2084('0x0'));var util=require('util');var moment=require(_0x2084('0x1'));var BPromise=require(_0x2084('0x2'));var rs=require(_0x2084('0x3'));var fs=require('fs');var Redis=require(_0x2084('0x4'));var db=require(_0x2084('0x5'))['db'];var utils=require(_0x2084('0x6'));var logger=require(_0x2084('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x2084('0x8'));var client=jayson[_0x2084('0x9')][_0x2084('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e9f16,_0x4f16d2,_0x23c452){return new BPromise(function(_0x1672df,_0x175f3c){return client['request'](_0x1e9f16,_0x23c452)[_0x2084('0xb')](function(_0x3ef95b){logger['info'](_0x2084('0xc'),_0x4f16d2,_0x2084('0xd'));logger[_0x2084('0xe')](_0x2084('0xf'),_0x4f16d2,_0x2084('0xd'),JSON[_0x2084('0x10')](_0x3ef95b));if(_0x3ef95b['error']){if(_0x3ef95b[_0x2084('0x11')][_0x2084('0x12')]===0x1f4){logger[_0x2084('0x11')](_0x2084('0xc'),_0x4f16d2,_0x3ef95b['error'][_0x2084('0x13')]);return _0x175f3c(_0x3ef95b[_0x2084('0x11')][_0x2084('0x13')]);}logger[_0x2084('0x11')](_0x2084('0xc'),_0x4f16d2,_0x3ef95b['error'][_0x2084('0x13')]);return _0x1672df(_0x3ef95b['error']['message']);}else{logger[_0x2084('0x14')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x4f16d2,'request\x20sent');_0x1672df(_0x3ef95b[_0x2084('0x15')][_0x2084('0x13')]);}})[_0x2084('0x16')](function(_0x2cd1d1){logger[_0x2084('0x11')](_0x2084('0xc'),_0x4f16d2,_0x2cd1d1);_0x175f3c(_0x2cd1d1);});});}
\ No newline at end of file
index e0fafd3..a4ed3b1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6be5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x25b71e,_0xd1260a){var _0x277ed7=function(_0xbd3bba){while(--_0xbd3bba){_0x25b71e['push'](_0x25b71e['shift']());}};_0x277ed7(++_0xd1260a);}(_0x6be5,0xd5));var _0x56be=function(_0x5341aa,_0x40b3da){_0x5341aa=_0x5341aa-0x0;var _0x13847a=_0x6be5[_0x5341aa];return _0x13847a;};'use strict';var multer=require(_0x56be('0x0'));var util=require('util');var path=require(_0x56be('0x1'));var timeout=require(_0x56be('0x2'));var express=require('express');var router=express[_0x56be('0x3')]();var fs_extra=require(_0x56be('0x4'));var auth=require(_0x56be('0x5'));var interaction=require(_0x56be('0x6'));var config=require(_0x56be('0x7'));var controller=require('./intSugarcrmField.controller');router[_0x56be('0x8')]('/',auth[_0x56be('0x9')](),controller['index']);router[_0x56be('0x8')](_0x56be('0xa'),auth[_0x56be('0x9')](),controller[_0x56be('0xb')]);router[_0x56be('0xc')]('/',auth['isAuthenticated'](),controller[_0x56be('0xd')]);router[_0x56be('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x56be('0xf')]);router[_0x56be('0x10')](_0x56be('0xa'),auth[_0x56be('0x9')](),controller['destroy']);module[_0x56be('0x11')]=router;
\ No newline at end of file
+var _0x0bf6=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete'];(function(_0x3edbfc,_0x4d1508){var _0x54438e=function(_0x40b578){while(--_0x40b578){_0x3edbfc['push'](_0x3edbfc['shift']());}};_0x54438e(++_0x4d1508);}(_0x0bf6,0xd8));var _0x60bf=function(_0x3c4b08,_0xfd606c){_0x3c4b08=_0x3c4b08-0x0;var _0xdfa64=_0x0bf6[_0x3c4b08];return _0xdfa64;};'use strict';var multer=require(_0x60bf('0x0'));var util=require(_0x60bf('0x1'));var path=require(_0x60bf('0x2'));var timeout=require('connect-timeout');var express=require(_0x60bf('0x3'));var router=express[_0x60bf('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x60bf('0x5'));var interaction=require(_0x60bf('0x6'));var config=require(_0x60bf('0x7'));var controller=require(_0x60bf('0x8'));router[_0x60bf('0x9')]('/',auth[_0x60bf('0xa')](),controller[_0x60bf('0xb')]);router[_0x60bf('0x9')]('/:id',auth[_0x60bf('0xa')](),controller[_0x60bf('0xc')]);router[_0x60bf('0xd')]('/',auth[_0x60bf('0xa')](),controller[_0x60bf('0xe')]);router['put'](_0x60bf('0xf'),auth[_0x60bf('0xa')](),controller[_0x60bf('0x10')]);router[_0x60bf('0x11')](_0x60bf('0xf'),auth[_0x60bf('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 415e1e7..8874f7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4738=['picklist','STRING','sequelize','string','variable','customVariable','keyValue'];(function(_0x2325b3,_0x17b918){var _0x27cac3=function(_0x25471e){while(--_0x25471e){_0x2325b3['push'](_0x2325b3['shift']());}};_0x27cac3(++_0x17b918);}(_0x4738,0x87));var _0x8473=function(_0x50f54c,_0x145310){_0x50f54c=_0x50f54c-0x0;var _0x4af4fd=_0x4738[_0x50f54c];return _0x4af4fd;};'use strict';var Sequelize=require(_0x8473('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x8473('0x1'),_0x8473('0x2'),_0x8473('0x3'),_0x8473('0x4'),_0x8473('0x5')),'defaultValue':_0x8473('0x1')},'content':{'type':Sequelize[_0x8473('0x6')]},'key':{'type':Sequelize[_0x8473('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x8473('0x2'),_0x8473('0x3'))},'keyContent':{'type':Sequelize[_0x8473('0x6')]},'idField':{'type':Sequelize[_0x8473('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8473('0x6')]}};
\ No newline at end of file
+var _0xf930=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x4f388f,_0x5bc1df){var _0x2e5fa2=function(_0x4bdb85){while(--_0x4bdb85){_0x4f388f['push'](_0x4f388f['shift']());}};_0x2e5fa2(++_0x5bc1df);}(_0xf930,0x129));var _0x0f93=function(_0x4fb930,_0x4141c4){_0x4fb930=_0x4fb930-0x0;var _0x59adc4=_0xf930[_0x4fb930];return _0x59adc4;};'use strict';var Sequelize=require('sequelize');module[_0x0f93('0x0')]={'type':{'type':Sequelize[_0x0f93('0x1')](_0x0f93('0x2'),_0x0f93('0x3'),_0x0f93('0x4'),_0x0f93('0x5'),_0x0f93('0x6')),'defaultValue':_0x0f93('0x2')},'content':{'type':Sequelize[_0x0f93('0x7')]},'key':{'type':Sequelize[_0x0f93('0x7')]},'keyType':{'type':Sequelize[_0x0f93('0x1')]('string',_0x0f93('0x3'),_0x0f93('0x4'))},'keyContent':{'type':Sequelize[_0x0f93('0x7')]},'idField':{'type':Sequelize[_0x0f93('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0f93('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 58b8543..9e0842f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cb8=['name','send','index','SugarcrmField','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','show','keys','find','create','body','params','catch','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','update','destroy','then','error','stack'];(function(_0x3009ea,_0x13a06e){var _0x2ae8a8=function(_0x2f1f0e){while(--_0x2f1f0e){_0x3009ea['push'](_0x3009ea['shift']());}};_0x2ae8a8(++_0x13a06e);}(_0x9cb8,0x1be));var _0x89cb=function(_0x46a3a7,_0x2a0a3b){_0x46a3a7=_0x46a3a7-0x0;var _0xd0a926=_0x9cb8[_0x46a3a7];return _0xd0a926;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x89cb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x89cb('0x1'));var rp=require('request-promise');var moment=require(_0x89cb('0x2'));var BPromise=require(_0x89cb('0x3'));var Mustache=require(_0x89cb('0x4'));var util=require(_0x89cb('0x5'));var path=require(_0x89cb('0x6'));var sox=require(_0x89cb('0x7'));var csv=require(_0x89cb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x89cb('0x9'));var _=require('lodash');var squel=require(_0x89cb('0xa'));var crypto=require(_0x89cb('0xb'));var jsforce=require(_0x89cb('0xc'));var deskjs=require(_0x89cb('0xd'));var toCsv=require(_0x89cb('0x8'));var querystring=require(_0x89cb('0xe'));var Papa=require(_0x89cb('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x89cb('0x10'));var as=require(_0x89cb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x89cb('0x12'))(_0x89cb('0x13'));var utils=require('../../config/utils');var config=require(_0x89cb('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x89cb('0x15'))['db'];function respondWithStatusCode(_0x4679ef,_0x277f06){_0x277f06=_0x277f06||0xcc;return function(_0x97fdd6){if(_0x97fdd6){return _0x4679ef[_0x89cb('0x16')](_0x277f06);}return _0x4679ef[_0x89cb('0x17')](_0x277f06)[_0x89cb('0x18')]();};}function respondWithResult(_0xdc6329,_0x57d7ab){_0x57d7ab=_0x57d7ab||0xc8;return function(_0x2b7b57){if(_0x2b7b57){return _0xdc6329['status'](_0x57d7ab)[_0x89cb('0x19')](_0x2b7b57);}};}function respondWithFilteredResult(_0x577c5c,_0x4e1913){return function(_0x5cc663){if(_0x5cc663){var _0xa49f79=typeof _0x4e1913[_0x89cb('0x1a')]==='undefined'&&typeof _0x4e1913[_0x89cb('0x1b')]===_0x89cb('0x1c');var _0x5db6e2=_0x5cc663[_0x89cb('0x1d')];var _0x42d453=_0xa49f79?0x0:_0x4e1913[_0x89cb('0x1a')];var _0x136a58=_0xa49f79?_0x5cc663['count']:_0x4e1913[_0x89cb('0x1a')]+_0x4e1913[_0x89cb('0x1b')];var _0x2ccc3c;if(_0x136a58>=_0x5db6e2){_0x136a58=_0x5db6e2;_0x2ccc3c=0xc8;}else{_0x2ccc3c=0xce;}_0x577c5c['status'](_0x2ccc3c);return _0x577c5c[_0x89cb('0x1e')]('Content-Range',_0x42d453+'-'+_0x136a58+'/'+_0x5db6e2)[_0x89cb('0x19')](_0x5cc663);}return null;};}function patchUpdates(_0x5a0670){return function(_0x23ded3){try{jsonpatch['apply'](_0x23ded3,_0x5a0670,!![]);}catch(_0x2a1108){return BPromise[_0x89cb('0x1f')](_0x2a1108);}return _0x23ded3['save']();};}function saveUpdates(_0xe0d41e,_0x6831ca){return function(_0x5290c8){if(_0x5290c8){return _0x5290c8[_0x89cb('0x20')](_0xe0d41e)['then'](function(_0x310a6b){return _0x310a6b;});}return null;};}function removeEntity(_0x16a444,_0x26ea72){return function(_0x30176b){if(_0x30176b){return _0x30176b[_0x89cb('0x21')]()[_0x89cb('0x22')](function(){_0x16a444[_0x89cb('0x17')](0xcc)[_0x89cb('0x18')]();});}};}function handleEntityNotFound(_0x368b1a,_0x1767f7){return function(_0x5f1b65){if(!_0x5f1b65){_0x368b1a[_0x89cb('0x16')](0x194);}return _0x5f1b65;};}function handleError(_0x5187d6,_0x4a5db7){_0x4a5db7=_0x4a5db7||0x1f4;return function(_0xf01f0e){logger[_0x89cb('0x23')](_0xf01f0e[_0x89cb('0x24')]);if(_0xf01f0e[_0x89cb('0x25')]){delete _0xf01f0e[_0x89cb('0x25')];}_0x5187d6['status'](_0x4a5db7)[_0x89cb('0x26')](_0xf01f0e);};}exports[_0x89cb('0x27')]=function(_0x38065f,_0x29be05){var _0x2b0c07={},_0x5dbfe4={},_0x13a8c0={'count':0x0,'rows':[]};var _0x1dec91=_['map'](db[_0x89cb('0x28')][_0x89cb('0x29')],function(_0x37fee4){return{'name':_0x37fee4['fieldName'],'type':_0x37fee4[_0x89cb('0x2a')][_0x89cb('0x2b')]};});_0x5dbfe4[_0x89cb('0x2c')]=_[_0x89cb('0x2d')](_0x1dec91,'name');_0x5dbfe4[_0x89cb('0x2e')]=_['keys'](_0x38065f[_0x89cb('0x2e')]);_0x5dbfe4[_0x89cb('0x2f')]=_[_0x89cb('0x30')](_0x5dbfe4['model'],_0x5dbfe4['query']);_0x2b0c07[_0x89cb('0x31')]=_[_0x89cb('0x30')](_0x5dbfe4[_0x89cb('0x2c')],qs['fields'](_0x38065f['query'][_0x89cb('0x32')]));_0x2b0c07[_0x89cb('0x31')]=_0x2b0c07[_0x89cb('0x31')][_0x89cb('0x33')]?_0x2b0c07[_0x89cb('0x31')]:_0x5dbfe4[_0x89cb('0x2c')];if(!_0x38065f[_0x89cb('0x2e')]['hasOwnProperty'](_0x89cb('0x34'))){_0x2b0c07[_0x89cb('0x1b')]=qs[_0x89cb('0x1b')](_0x38065f['query'][_0x89cb('0x1b')]);_0x2b0c07[_0x89cb('0x1a')]=qs[_0x89cb('0x1a')](_0x38065f[_0x89cb('0x2e')]['offset']);}_0x2b0c07[_0x89cb('0x35')]=qs[_0x89cb('0x36')](_0x38065f[_0x89cb('0x2e')][_0x89cb('0x36')]);_0x2b0c07[_0x89cb('0x37')]=qs[_0x89cb('0x2f')](_['pick'](_0x38065f[_0x89cb('0x2e')],_0x5dbfe4[_0x89cb('0x2f')]),_0x1dec91);if(_0x38065f[_0x89cb('0x2e')][_0x89cb('0x38')]){_0x2b0c07[_0x89cb('0x37')]=_[_0x89cb('0x39')](_0x2b0c07['where'],{'$or':_[_0x89cb('0x2d')](_0x1dec91,function(_0x30b014){if(_0x30b014[_0x89cb('0x2a')]!==_0x89cb('0x3a')){var _0x29fd9a={};_0x29fd9a[_0x30b014['name']]={'$like':'%'+_0x38065f[_0x89cb('0x2e')][_0x89cb('0x38')]+'%'};return _0x29fd9a;}})});}_0x2b0c07=_[_0x89cb('0x39')]({},_0x2b0c07,_0x38065f[_0x89cb('0x3b')]);var _0x102b29={'where':_0x2b0c07[_0x89cb('0x37')]};return db['SugarcrmField']['count'](_0x102b29)[_0x89cb('0x22')](function(_0x54f7ec){_0x13a8c0[_0x89cb('0x1d')]=_0x54f7ec;if(_0x38065f['query'][_0x89cb('0x3c')]){_0x2b0c07['include']=[{'all':!![]}];}return db['SugarcrmField']['findAll'](_0x2b0c07);})['then'](function(_0x443bda){_0x13a8c0[_0x89cb('0x3d')]=_0x443bda;return _0x13a8c0;})[_0x89cb('0x22')](respondWithFilteredResult(_0x29be05,_0x2b0c07))['catch'](handleError(_0x29be05,null));};exports[_0x89cb('0x3e')]=function(_0x3ebd27,_0x3876c4){var _0x3d055a={'raw':!![],'where':{'id':_0x3ebd27['params']['id']}},_0x6c7b4b={};_0x6c7b4b['model']=_[_0x89cb('0x3f')](db['SugarcrmField']['rawAttributes']);_0x6c7b4b[_0x89cb('0x2e')]=_[_0x89cb('0x3f')](_0x3ebd27['query']);_0x6c7b4b[_0x89cb('0x2f')]=_[_0x89cb('0x30')](_0x6c7b4b[_0x89cb('0x2c')],_0x6c7b4b['query']);_0x3d055a[_0x89cb('0x31')]=_['intersection'](_0x6c7b4b[_0x89cb('0x2c')],qs['fields'](_0x3ebd27['query'][_0x89cb('0x32')]));_0x3d055a[_0x89cb('0x31')]=_0x3d055a[_0x89cb('0x31')][_0x89cb('0x33')]?_0x3d055a[_0x89cb('0x31')]:_0x6c7b4b[_0x89cb('0x2c')];if(_0x3ebd27['query'][_0x89cb('0x3c')]){_0x3d055a['include']=[{'all':!![]}];}_0x3d055a=_[_0x89cb('0x39')]({},_0x3d055a,_0x3ebd27[_0x89cb('0x3b')]);return db[_0x89cb('0x28')][_0x89cb('0x40')](_0x3d055a)[_0x89cb('0x22')](handleEntityNotFound(_0x3876c4,null))[_0x89cb('0x22')](respondWithResult(_0x3876c4,null))['catch'](handleError(_0x3876c4,null));};exports[_0x89cb('0x41')]=function(_0x3b29df,_0x26a2ef){return db[_0x89cb('0x28')][_0x89cb('0x41')](_0x3b29df[_0x89cb('0x42')],{})['then'](respondWithResult(_0x26a2ef,0xc9))['catch'](handleError(_0x26a2ef,null));};exports['update']=function(_0x342a9a,_0x186b54){if(_0x342a9a['body']['id']){delete _0x342a9a[_0x89cb('0x42')]['id'];}return db[_0x89cb('0x28')]['find']({'where':{'id':_0x342a9a[_0x89cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x186b54,null))[_0x89cb('0x22')](saveUpdates(_0x342a9a[_0x89cb('0x42')],null))[_0x89cb('0x22')](respondWithResult(_0x186b54,null))[_0x89cb('0x44')](handleError(_0x186b54,null));};exports[_0x89cb('0x21')]=function(_0x5c7d37,_0x517864){return db[_0x89cb('0x28')][_0x89cb('0x40')]({'where':{'id':_0x5c7d37['params']['id']}})['then'](handleEntityNotFound(_0x517864,null))[_0x89cb('0x22')](removeEntity(_0x517864,null))['catch'](handleError(_0x517864,null));};
\ No newline at end of file
+var _0x6f86=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmField','includeAll','include','findAll','catch','show','params','find','create','body','update','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','reject','save','then','destroy','error','name','send','map','rawAttributes','type','key','model'];(function(_0x5318f5,_0x43bf80){var _0xdea691=function(_0x51c30d){while(--_0x51c30d){_0x5318f5['push'](_0x5318f5['shift']());}};_0xdea691(++_0x43bf80);}(_0x6f86,0xa9));var _0x66f8=function(_0xbd2356,_0x441dc9){_0xbd2356=_0xbd2356-0x0;var _0xf0b100=_0x6f86[_0xbd2356];return _0xf0b100;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x66f8('0x0'));var jsonpatch=require(_0x66f8('0x1'));var rp=require(_0x66f8('0x2'));var moment=require(_0x66f8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x66f8('0x4'));var util=require(_0x66f8('0x5'));var path=require(_0x66f8('0x6'));var sox=require(_0x66f8('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66f8('0x8'));var _=require(_0x66f8('0x9'));var squel=require(_0x66f8('0xa'));var crypto=require(_0x66f8('0xb'));var jsforce=require(_0x66f8('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x66f8('0xd'));var Papa=require('papaparse');var Redis=require(_0x66f8('0xe'));var authService=require(_0x66f8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x66f8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x66f8('0x11'))(_0x66f8('0x12'));var utils=require(_0x66f8('0x13'));var config=require(_0x66f8('0x14'));var licenseUtil=require(_0x66f8('0x15'));var db=require(_0x66f8('0x16'))['db'];function respondWithStatusCode(_0x4580de,_0x356afb){_0x356afb=_0x356afb||0xcc;return function(_0x5c7dcc){if(_0x5c7dcc){return _0x4580de[_0x66f8('0x17')](_0x356afb);}return _0x4580de['status'](_0x356afb)[_0x66f8('0x18')]();};}function respondWithResult(_0x117679,_0x493039){_0x493039=_0x493039||0xc8;return function(_0xded6f){if(_0xded6f){return _0x117679['status'](_0x493039)['json'](_0xded6f);}};}function respondWithFilteredResult(_0x192ba4,_0x34e77b){return function(_0x19e480){if(_0x19e480){var _0x47bef8=typeof _0x34e77b[_0x66f8('0x19')]===_0x66f8('0x1a')&&typeof _0x34e77b[_0x66f8('0x1b')]===_0x66f8('0x1a');var _0x2fc8b2=_0x19e480[_0x66f8('0x1c')];var _0x5bedb3=_0x47bef8?0x0:_0x34e77b[_0x66f8('0x19')];var _0x468982=_0x47bef8?_0x19e480[_0x66f8('0x1c')]:_0x34e77b['offset']+_0x34e77b[_0x66f8('0x1b')];var _0x57b125;if(_0x468982>=_0x2fc8b2){_0x468982=_0x2fc8b2;_0x57b125=0xc8;}else{_0x57b125=0xce;}_0x192ba4[_0x66f8('0x1d')](_0x57b125);return _0x192ba4[_0x66f8('0x1e')](_0x66f8('0x1f'),_0x5bedb3+'-'+_0x468982+'/'+_0x2fc8b2)['json'](_0x19e480);}return null;};}function patchUpdates(_0x4ba1aa){return function(_0x5f3d64){try{jsonpatch['apply'](_0x5f3d64,_0x4ba1aa,!![]);}catch(_0x1b0049){return BPromise[_0x66f8('0x20')](_0x1b0049);}return _0x5f3d64[_0x66f8('0x21')]();};}function saveUpdates(_0x471092,_0x571e18){return function(_0x924aab){if(_0x924aab){return _0x924aab['update'](_0x471092)[_0x66f8('0x22')](function(_0x4a17a6){return _0x4a17a6;});}return null;};}function removeEntity(_0x4fe122,_0x482525){return function(_0x2a71cc){if(_0x2a71cc){return _0x2a71cc[_0x66f8('0x23')]()[_0x66f8('0x22')](function(){_0x4fe122[_0x66f8('0x1d')](0xcc)[_0x66f8('0x18')]();});}};}function handleEntityNotFound(_0x478e59,_0x3fe028){return function(_0x266adf){if(!_0x266adf){_0x478e59[_0x66f8('0x17')](0x194);}return _0x266adf;};}function handleError(_0x2499ac,_0x14beef){_0x14beef=_0x14beef||0x1f4;return function(_0x1af183){logger[_0x66f8('0x24')](_0x1af183['stack']);if(_0x1af183[_0x66f8('0x25')]){delete _0x1af183[_0x66f8('0x25')];}_0x2499ac[_0x66f8('0x1d')](_0x14beef)[_0x66f8('0x26')](_0x1af183);};}exports['index']=function(_0x2ac3c7,_0xacd121){var _0x134c69={},_0x498347={},_0x191559={'count':0x0,'rows':[]};var _0x53f12e=_[_0x66f8('0x27')](db['SugarcrmField'][_0x66f8('0x28')],function(_0x524a61){return{'name':_0x524a61['fieldName'],'type':_0x524a61[_0x66f8('0x29')][_0x66f8('0x2a')]};});_0x498347[_0x66f8('0x2b')]=_['map'](_0x53f12e,_0x66f8('0x25'));_0x498347[_0x66f8('0x2c')]=_[_0x66f8('0x2d')](_0x2ac3c7[_0x66f8('0x2c')]);_0x498347[_0x66f8('0x2e')]=_[_0x66f8('0x2f')](_0x498347[_0x66f8('0x2b')],_0x498347[_0x66f8('0x2c')]);_0x134c69[_0x66f8('0x30')]=_[_0x66f8('0x2f')](_0x498347['model'],qs[_0x66f8('0x31')](_0x2ac3c7[_0x66f8('0x2c')][_0x66f8('0x31')]));_0x134c69[_0x66f8('0x30')]=_0x134c69['attributes'][_0x66f8('0x32')]?_0x134c69[_0x66f8('0x30')]:_0x498347[_0x66f8('0x2b')];if(!_0x2ac3c7['query'][_0x66f8('0x33')](_0x66f8('0x34'))){_0x134c69[_0x66f8('0x1b')]=qs['limit'](_0x2ac3c7[_0x66f8('0x2c')][_0x66f8('0x1b')]);_0x134c69['offset']=qs[_0x66f8('0x19')](_0x2ac3c7['query']['offset']);}_0x134c69['order']=qs[_0x66f8('0x35')](_0x2ac3c7[_0x66f8('0x2c')]['sort']);_0x134c69['where']=qs[_0x66f8('0x2e')](_[_0x66f8('0x36')](_0x2ac3c7[_0x66f8('0x2c')],_0x498347[_0x66f8('0x2e')]),_0x53f12e);if(_0x2ac3c7['query'][_0x66f8('0x37')]){_0x134c69[_0x66f8('0x38')]=_[_0x66f8('0x39')](_0x134c69[_0x66f8('0x38')],{'$or':_[_0x66f8('0x27')](_0x53f12e,function(_0x12a28d){if(_0x12a28d[_0x66f8('0x29')]!==_0x66f8('0x3a')){var _0x59df51={};_0x59df51[_0x12a28d[_0x66f8('0x25')]]={'$like':'%'+_0x2ac3c7[_0x66f8('0x2c')][_0x66f8('0x37')]+'%'};return _0x59df51;}})});}_0x134c69=_[_0x66f8('0x39')]({},_0x134c69,_0x2ac3c7[_0x66f8('0x3b')]);var _0x1da2d4={'where':_0x134c69[_0x66f8('0x38')]};return db[_0x66f8('0x3c')][_0x66f8('0x1c')](_0x1da2d4)[_0x66f8('0x22')](function(_0x482421){_0x191559['count']=_0x482421;if(_0x2ac3c7[_0x66f8('0x2c')][_0x66f8('0x3d')]){_0x134c69[_0x66f8('0x3e')]=[{'all':!![]}];}return db[_0x66f8('0x3c')][_0x66f8('0x3f')](_0x134c69);})[_0x66f8('0x22')](function(_0x17a9f9){_0x191559['rows']=_0x17a9f9;return _0x191559;})[_0x66f8('0x22')](respondWithFilteredResult(_0xacd121,_0x134c69))[_0x66f8('0x40')](handleError(_0xacd121,null));};exports[_0x66f8('0x41')]=function(_0x1ea30e,_0x34870f){var _0x341378={'raw':!![],'where':{'id':_0x1ea30e[_0x66f8('0x42')]['id']}},_0x1f8016={};_0x1f8016[_0x66f8('0x2b')]=_[_0x66f8('0x2d')](db['SugarcrmField'][_0x66f8('0x28')]);_0x1f8016[_0x66f8('0x2c')]=_[_0x66f8('0x2d')](_0x1ea30e['query']);_0x1f8016[_0x66f8('0x2e')]=_[_0x66f8('0x2f')](_0x1f8016[_0x66f8('0x2b')],_0x1f8016[_0x66f8('0x2c')]);_0x341378[_0x66f8('0x30')]=_[_0x66f8('0x2f')](_0x1f8016[_0x66f8('0x2b')],qs['fields'](_0x1ea30e[_0x66f8('0x2c')][_0x66f8('0x31')]));_0x341378[_0x66f8('0x30')]=_0x341378[_0x66f8('0x30')]['length']?_0x341378['attributes']:_0x1f8016[_0x66f8('0x2b')];if(_0x1ea30e[_0x66f8('0x2c')][_0x66f8('0x3d')]){_0x341378[_0x66f8('0x3e')]=[{'all':!![]}];}_0x341378=_['merge']({},_0x341378,_0x1ea30e[_0x66f8('0x3b')]);return db[_0x66f8('0x3c')][_0x66f8('0x43')](_0x341378)['then'](handleEntityNotFound(_0x34870f,null))[_0x66f8('0x22')](respondWithResult(_0x34870f,null))[_0x66f8('0x40')](handleError(_0x34870f,null));};exports[_0x66f8('0x44')]=function(_0x99e9c4,_0xf37361){return db[_0x66f8('0x3c')][_0x66f8('0x44')](_0x99e9c4[_0x66f8('0x45')],{})[_0x66f8('0x22')](respondWithResult(_0xf37361,0xc9))[_0x66f8('0x40')](handleError(_0xf37361,null));};exports[_0x66f8('0x46')]=function(_0x53dcba,_0x5f41b5){if(_0x53dcba[_0x66f8('0x45')]['id']){delete _0x53dcba['body']['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x53dcba['params']['id']}})[_0x66f8('0x22')](handleEntityNotFound(_0x5f41b5,null))[_0x66f8('0x22')](saveUpdates(_0x53dcba[_0x66f8('0x45')],null))[_0x66f8('0x22')](respondWithResult(_0x5f41b5,null))[_0x66f8('0x40')](handleError(_0x5f41b5,null));};exports[_0x66f8('0x23')]=function(_0x64b367,_0xedfff8){return db[_0x66f8('0x3c')][_0x66f8('0x43')]({'where':{'id':_0x64b367['params']['id']}})[_0x66f8('0x22')](handleEntityNotFound(_0xedfff8,null))[_0x66f8('0x22')](removeEntity(_0xedfff8,null))['catch'](handleError(_0xedfff8,null));};
\ No newline at end of file
index 671ff0c..72e3caf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf57d=['moment','request-promise','rimraf','../../config/environment','define','int_sugarcrm_fields','idField','lodash','util','api'];(function(_0x4665a7,_0xe3c2e9){var _0x47c836=function(_0xfaa606){while(--_0xfaa606){_0x4665a7['push'](_0x4665a7['shift']());}};_0x47c836(++_0xe3c2e9);}(_0xf57d,0x15b));var _0xdf57=function(_0x171ca6,_0x2f8f9d){_0x171ca6=_0x171ca6-0x0;var _0x244768=_0xf57d[_0x171ca6];return _0x244768;};'use strict';var _=require(_0xdf57('0x0'));var util=require(_0xdf57('0x1'));var logger=require('../../config/logger')(_0xdf57('0x2'));var moment=require(_0xdf57('0x3'));var BPromise=require('bluebird');var rp=require(_0xdf57('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf57('0x5'));var config=require(_0xdf57('0x6'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x974d83,_0x58d403){return _0x974d83[_0xdf57('0x7')]('SugarcrmField',attributes,{'tableName':_0xdf57('0x8'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xdf57('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a33=['FieldId','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0x7a33,0x8d));var _0x37a3=function(_0x554d5c,_0x40b847){_0x554d5c=_0x554d5c-0x0;var _0x3ffd5e=_0x7a33[_0x554d5c];return _0x3ffd5e;};'use strict';var _=require(_0x37a3('0x0'));var util=require(_0x37a3('0x1'));var logger=require(_0x37a3('0x2'))('api');var moment=require('moment');var BPromise=require(_0x37a3('0x3'));var rp=require(_0x37a3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x37a3('0x5'));var attributes=require(_0x37a3('0x6'));module[_0x37a3('0x7')]=function(_0x42257d,_0x7205b7){return _0x42257d[_0x37a3('0x8')](_0x37a3('0x9'),attributes,{'tableName':_0x37a3('0xa'),'paranoid':![],'indexes':[{'name':_0x37a3('0xb'),'fields':[_0x37a3('0xc'),_0x37a3('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index f2e6661..a0d55a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbeb=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x23e859,_0x419ccc){var _0xe4964=function(_0x2e2501){while(--_0x2e2501){_0x23e859['push'](_0x23e859['shift']());}};_0xe4964(++_0x419ccc);}(_0xdbeb,0xd0));var _0xbdbe=function(_0x18923c,_0x1ce189){_0x18923c=_0x18923c-0x0;var _0x63d34d=_0xdbeb[_0x18923c];return _0x63d34d;};'use strict';var _=require(_0xbdbe('0x0'));var util=require(_0xbdbe('0x1'));var moment=require(_0xbdbe('0x2'));var BPromise=require(_0xbdbe('0x3'));var rs=require(_0xbdbe('0x4'));var fs=require('fs');var Redis=require(_0xbdbe('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdbe('0x6'));var logger=require(_0xbdbe('0x7'))(_0xbdbe('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbdbe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4acf1a,_0x102725,_0x133bec){return new BPromise(function(_0x4b0b04,_0x1d7870){return client['request'](_0x4acf1a,_0x133bec)[_0xbdbe('0xa')](function(_0x3c806f){logger[_0xbdbe('0xb')](_0xbdbe('0xc'),_0x102725,_0xbdbe('0xd'));logger[_0xbdbe('0xe')](_0xbdbe('0xf'),_0x102725,'request\x20sent',JSON[_0xbdbe('0x10')](_0x3c806f));if(_0x3c806f[_0xbdbe('0x11')]){if(_0x3c806f['error']['code']===0x1f4){logger[_0xbdbe('0x11')](_0xbdbe('0xc'),_0x102725,_0x3c806f[_0xbdbe('0x11')][_0xbdbe('0x12')]);return _0x1d7870(_0x3c806f['error'][_0xbdbe('0x12')]);}logger[_0xbdbe('0x11')](_0xbdbe('0xc'),_0x102725,_0x3c806f['error'][_0xbdbe('0x12')]);return _0x4b0b04(_0x3c806f[_0xbdbe('0x11')][_0xbdbe('0x12')]);}else{logger[_0xbdbe('0xb')](_0xbdbe('0xc'),_0x102725,_0xbdbe('0xd'));_0x4b0b04(_0x3c806f[_0xbdbe('0x13')][_0xbdbe('0x12')]);}})[_0xbdbe('0x14')](function(_0x4ecbac){logger[_0xbdbe('0x11')](_0xbdbe('0xc'),_0x102725,_0x4ecbac);_0x1d7870(_0x4ecbac);});});}
\ No newline at end of file
+var _0x7382=['error','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7382,0xe3));var _0x2738=function(_0x31e7ce,_0x409619){_0x31e7ce=_0x31e7ce-0x0;var _0x3b2616=_0x7382[_0x31e7ce];return _0x3b2616;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var moment=require(_0x2738('0x1'));var BPromise=require(_0x2738('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2738('0x3'));var db=require(_0x2738('0x4'))['db'];var utils=require(_0x2738('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2738('0x6')][_0x2738('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x43b4a6,_0x41bea9,_0x51d199){return new BPromise(function(_0x259e5f,_0x233cda){return client[_0x2738('0x8')](_0x43b4a6,_0x51d199)[_0x2738('0x9')](function(_0x2262fc){logger[_0x2738('0xa')](_0x2738('0xb'),_0x41bea9,_0x2738('0xc'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x41bea9,_0x2738('0xc'),JSON['stringify'](_0x2262fc));if(_0x2262fc[_0x2738('0xd')]){if(_0x2262fc[_0x2738('0xd')]['code']===0x1f4){logger[_0x2738('0xd')]('SugarcrmField,\x20%s,\x20%s',_0x41bea9,_0x2262fc[_0x2738('0xd')][_0x2738('0xe')]);return _0x233cda(_0x2262fc[_0x2738('0xd')][_0x2738('0xe')]);}logger[_0x2738('0xd')](_0x2738('0xb'),_0x41bea9,_0x2262fc['error'][_0x2738('0xe')]);return _0x259e5f(_0x2262fc[_0x2738('0xd')]['message']);}else{logger[_0x2738('0xa')](_0x2738('0xb'),_0x41bea9,'request\x20sent');_0x259e5f(_0x2262fc[_0x2738('0xf')][_0x2738('0xe')]);}})['catch'](function(_0x596bb3){logger[_0x2738('0xd')](_0x2738('0xb'),_0x41bea9,_0x596bb3);_0x233cda(_0x596bb3);});});}
\ No newline at end of file
index 90cac1c..453e3ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x146a=['create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post'];(function(_0x13c324,_0x547f55){var _0x58e361=function(_0x27d8be){while(--_0x27d8be){_0x13c324['push'](_0x13c324['shift']());}};_0x58e361(++_0x547f55);}(_0x146a,0x9d));var _0xa146=function(_0x4c0619,_0x58dd6b){_0x4c0619=_0x4c0619-0x0;var _0x40ee84=_0x146a[_0x4c0619];return _0x40ee84;};'use strict';var multer=require(_0xa146('0x0'));var util=require(_0xa146('0x1'));var path=require('path');var timeout=require(_0xa146('0x2'));var express=require(_0xa146('0x3'));var router=express[_0xa146('0x4')]();var fs_extra=require(_0xa146('0x5'));var auth=require(_0xa146('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa146('0x7'));var controller=require(_0xa146('0x8'));router[_0xa146('0x9')]('/',auth[_0xa146('0xa')](),controller[_0xa146('0xb')]);router['get'](_0xa146('0xc'),auth[_0xa146('0xa')](),controller[_0xa146('0xd')]);router[_0xa146('0x9')](_0xa146('0xe'),auth[_0xa146('0xa')](),controller[_0xa146('0xf')]);router[_0xa146('0x9')]('/:id/fields',auth[_0xa146('0xa')](),controller[_0xa146('0x10')]);router[_0xa146('0x11')]('/',auth[_0xa146('0xa')](),controller[_0xa146('0x12')]);router[_0xa146('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xa146('0x13')]);router[_0xa146('0x14')](_0xa146('0xc'),auth[_0xa146('0xa')](),controller[_0xa146('0x15')]);router[_0xa146('0x16')](_0xa146('0xc'),auth[_0xa146('0xa')](),controller[_0xa146('0x17')]);module[_0xa146('0x18')]=router;
\ No newline at end of file
+var _0xfe3f=['getFields','create','/:id/configurations','addConfiguration','put','update','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x158a58,_0x28e8e7){var _0x4935d9=function(_0x1e698c){while(--_0x1e698c){_0x158a58['push'](_0x158a58['shift']());}};_0x4935d9(++_0x28e8e7);}(_0xfe3f,0x194));var _0xffe3=function(_0x56d082,_0xc597d6){_0x56d082=_0x56d082-0x0;var _0x2c4c19=_0xfe3f[_0x56d082];return _0x2c4c19;};'use strict';var multer=require(_0xffe3('0x0'));var util=require(_0xffe3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xffe3('0x2')]();var fs_extra=require(_0xffe3('0x3'));var auth=require(_0xffe3('0x4'));var interaction=require(_0xffe3('0x5'));var config=require(_0xffe3('0x6'));var controller=require(_0xffe3('0x7'));router[_0xffe3('0x8')]('/',auth[_0xffe3('0x9')](),controller[_0xffe3('0xa')]);router[_0xffe3('0x8')](_0xffe3('0xb'),auth['isAuthenticated'](),controller[_0xffe3('0xc')]);router[_0xffe3('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0xffe3('0x8')](_0xffe3('0xd'),auth[_0xffe3('0x9')](),controller[_0xffe3('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xffe3('0xf')]);router['post'](_0xffe3('0x10'),auth[_0xffe3('0x9')](),controller[_0xffe3('0x11')]);router[_0xffe3('0x12')](_0xffe3('0xb'),auth[_0xffe3('0x9')](),controller[_0xffe3('0x13')]);router['delete'](_0xffe3('0xb'),auth[_0xffe3('0x9')](),controller[_0xffe3('0x14')]);module[_0xffe3('0x15')]=router;
\ No newline at end of file
index 77d11ec..99b3ae5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf08f=['exports','STRING','sequelize'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xf08f,0xe0));var _0xff08=function(_0x4404ff,_0x13d7a9){_0x4404ff=_0x4404ff-0x0;var _0x5e7b19=_0xf08f[_0x4404ff];return _0x5e7b19;};'use strict';var Sequelize=require(_0xff08('0x0'));module[_0xff08('0x1')]={'name':{'type':Sequelize[_0xff08('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xff08('0x2')]},'username':{'type':Sequelize[_0xff08('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xff08('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xff08('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xff08('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x4fae=['sequelize','exports','STRING','HelpDesk'];(function(_0xdfeed1,_0x4d8e7e){var _0x2976fc=function(_0x148e85){while(--_0x148e85){_0xdfeed1['push'](_0xdfeed1['shift']());}};_0x2976fc(++_0x4d8e7e);}(_0x4fae,0x68));var _0xe4fa=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x4fae[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0xe4fa('0x0'));module[_0xe4fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe4fa('0x2')]},'username':{'type':Sequelize[_0xe4fa('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe4fa('0x2')],'allowNull':![],'defaultValue':_0xe4fa('0x3')},'remoteUri':{'type':Sequelize[_0xe4fa('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xe4fa('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe4fa('0x2')],'allowNull':![]}};
\ No newline at end of file
index a9bbcc8..3dce554 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f9a=['sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','then','error','stack','name','map','type','key','keys','filters','intersection','model','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','VtigerAccount','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','destroy','getConfigurations','findOne','VtigerConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','VtigerField','md5','getFields','username','description','moduleName','accessKey','remoteUri','slice','substring','format','%s/webservice.php','success','POST','login','token','GET','result','sessionName','autogenerated','reference','owner','remove','includes','editable','false','startsWith','cf_','picklist','picklistValues','value','log','test','stringify','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x29e793,_0x8e6ba7){var _0x9712e4=function(_0xea06c0){while(--_0xea06c0){_0x29e793['push'](_0x29e793['shift']());}};_0x9712e4(++_0x8e6ba7);}(_0x2f9a,0x15b));var _0xa2f9=function(_0x17c938,_0x557096){_0x17c938=_0x17c938-0x0;var _0x2d22b2=_0x2f9a[_0x17c938];return _0x2d22b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa2f9('0x0'));var zipdir=require(_0xa2f9('0x1'));var jsonpatch=require(_0xa2f9('0x2'));var rp=require(_0xa2f9('0x3'));var moment=require(_0xa2f9('0x4'));var BPromise=require(_0xa2f9('0x5'));var Mustache=require(_0xa2f9('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa2f9('0x7'));var csv=require(_0xa2f9('0x8'));var ejs=require(_0xa2f9('0x9'));var fs=require('fs');var fs_extra=require(_0xa2f9('0xa'));var _=require(_0xa2f9('0xb'));var squel=require('squel');var crypto=require(_0xa2f9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa2f9('0x8'));var querystring=require(_0xa2f9('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa2f9('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa2f9('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa2f9('0x10'))(_0xa2f9('0x11'));var utils=require(_0xa2f9('0x12'));var config=require(_0xa2f9('0x13'));var licenseUtil=require(_0xa2f9('0x14'));var db=require(_0xa2f9('0x15'))['db'];var integrations=require(_0xa2f9('0x16'));function respondWithStatusCode(_0x53c85d,_0x597459){_0x597459=_0x597459||0xcc;return function(_0x46a8aa){if(_0x46a8aa){return _0x53c85d[_0xa2f9('0x17')](_0x597459);}return _0x53c85d[_0xa2f9('0x18')](_0x597459)[_0xa2f9('0x19')]();};}function respondWithResult(_0x2912c2,_0x2e9148){_0x2e9148=_0x2e9148||0xc8;return function(_0x4107e3){if(_0x4107e3){return _0x2912c2[_0xa2f9('0x18')](_0x2e9148)[_0xa2f9('0x1a')](_0x4107e3);}};}function respondWithFilteredResult(_0x1b493f,_0x3ad66e){return function(_0x144f79){if(_0x144f79){var _0x3c9151=typeof _0x3ad66e[_0xa2f9('0x1b')]==='undefined'&&typeof _0x3ad66e[_0xa2f9('0x1c')]==='undefined';var _0x2c8f34=_0x144f79[_0xa2f9('0x1d')];var _0x4310a0=_0x3c9151?0x0:_0x3ad66e[_0xa2f9('0x1b')];var _0x25ba6e=_0x3c9151?_0x144f79[_0xa2f9('0x1d')]:_0x3ad66e[_0xa2f9('0x1b')]+_0x3ad66e['limit'];var _0x4ea249;if(_0x25ba6e>=_0x2c8f34){_0x25ba6e=_0x2c8f34;_0x4ea249=0xc8;}else{_0x4ea249=0xce;}_0x1b493f[_0xa2f9('0x18')](_0x4ea249);return _0x1b493f[_0xa2f9('0x1e')]('Content-Range',_0x4310a0+'-'+_0x25ba6e+'/'+_0x2c8f34)['json'](_0x144f79);}return null;};}function patchUpdates(_0x4968a3){return function(_0x2610e6){try{jsonpatch[_0xa2f9('0x1f')](_0x2610e6,_0x4968a3,!![]);}catch(_0x401eb7){return BPromise[_0xa2f9('0x20')](_0x401eb7);}return _0x2610e6[_0xa2f9('0x21')]();};}function saveUpdates(_0x1fbabb,_0x36f0ae){return function(_0x89d538){if(_0x89d538){return _0x89d538['update'](_0x1fbabb)[_0xa2f9('0x22')](function(_0x5c60e4){return _0x5c60e4;});}return null;};}function removeEntity(_0x2d0ae4,_0x506a00){return function(_0x270680){if(_0x270680){return _0x270680['destroy']()[_0xa2f9('0x22')](function(){_0x2d0ae4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a62fe,_0x1fc11a){return function(_0x3ef2b7){if(!_0x3ef2b7){_0x3a62fe[_0xa2f9('0x17')](0x194);}return _0x3ef2b7;};}function handleError(_0x24d91a,_0x1218d6){_0x1218d6=_0x1218d6||0x1f4;return function(_0x6b8858){logger[_0xa2f9('0x23')](_0x6b8858[_0xa2f9('0x24')]);if(_0x6b8858['name']){delete _0x6b8858[_0xa2f9('0x25')];}_0x24d91a[_0xa2f9('0x18')](_0x1218d6)['send'](_0x6b8858);};}exports['index']=function(_0x140aa7,_0x4a77e6){var _0x10acc0={},_0x3eab86={},_0xb5bba9={'count':0x0,'rows':[]};var _0x524528=_[_0xa2f9('0x26')](db['VtigerAccount']['rawAttributes'],function(_0x3962bd){return{'name':_0x3962bd['fieldName'],'type':_0x3962bd[_0xa2f9('0x27')][_0xa2f9('0x28')]};});_0x3eab86['model']=_['map'](_0x524528,_0xa2f9('0x25'));_0x3eab86['query']=_[_0xa2f9('0x29')](_0x140aa7['query']);_0x3eab86[_0xa2f9('0x2a')]=_[_0xa2f9('0x2b')](_0x3eab86[_0xa2f9('0x2c')],_0x3eab86['query']);_0x10acc0[_0xa2f9('0x2d')]=_[_0xa2f9('0x2b')](_0x3eab86[_0xa2f9('0x2c')],qs[_0xa2f9('0x2e')](_0x140aa7[_0xa2f9('0x2f')][_0xa2f9('0x2e')]));_0x10acc0[_0xa2f9('0x2d')]=_0x10acc0[_0xa2f9('0x2d')][_0xa2f9('0x30')]?_0x10acc0[_0xa2f9('0x2d')]:_0x3eab86[_0xa2f9('0x2c')];if(!_0x140aa7[_0xa2f9('0x2f')][_0xa2f9('0x31')]('nolimit')){_0x10acc0[_0xa2f9('0x1c')]=qs['limit'](_0x140aa7[_0xa2f9('0x2f')][_0xa2f9('0x1c')]);_0x10acc0['offset']=qs['offset'](_0x140aa7[_0xa2f9('0x2f')][_0xa2f9('0x1b')]);}_0x10acc0[_0xa2f9('0x32')]=qs['sort'](_0x140aa7[_0xa2f9('0x2f')][_0xa2f9('0x33')]);_0x10acc0[_0xa2f9('0x34')]=qs['filters'](_[_0xa2f9('0x35')](_0x140aa7[_0xa2f9('0x2f')],_0x3eab86[_0xa2f9('0x2a')]),_0x524528);if(_0x140aa7[_0xa2f9('0x2f')][_0xa2f9('0x36')]){_0x10acc0['where']=_[_0xa2f9('0x37')](_0x10acc0[_0xa2f9('0x34')],{'$or':_['map'](_0x524528,function(_0x3de7cf){if(_0x3de7cf['type']!==_0xa2f9('0x38')){var _0x281917={};_0x281917[_0x3de7cf[_0xa2f9('0x25')]]={'$like':'%'+_0x140aa7[_0xa2f9('0x2f')]['filter']+'%'};return _0x281917;}})});}_0x10acc0=_['merge']({},_0x10acc0,_0x140aa7[_0xa2f9('0x39')]);var _0x2c5f04={'where':_0x10acc0[_0xa2f9('0x34')]};return db[_0xa2f9('0x3a')][_0xa2f9('0x1d')](_0x2c5f04)[_0xa2f9('0x22')](function(_0x2fd7eb){_0xb5bba9[_0xa2f9('0x1d')]=_0x2fd7eb;if(_0x140aa7[_0xa2f9('0x2f')][_0xa2f9('0x3b')]){_0x10acc0[_0xa2f9('0x3c')]=[{'all':!![]}];}return db[_0xa2f9('0x3a')][_0xa2f9('0x3d')](_0x10acc0);})['then'](function(_0x15d3ad){_0xb5bba9[_0xa2f9('0x3e')]=_0x15d3ad;return _0xb5bba9;})[_0xa2f9('0x22')](respondWithFilteredResult(_0x4a77e6,_0x10acc0))[_0xa2f9('0x3f')](handleError(_0x4a77e6,null));};exports[_0xa2f9('0x40')]=function(_0x28910b,_0x5c4730){var _0x5a0308={'raw':![],'where':{'id':_0x28910b['params']['id']}},_0x261872={};_0x261872[_0xa2f9('0x2c')]=_[_0xa2f9('0x29')](db[_0xa2f9('0x3a')][_0xa2f9('0x41')]);_0x261872[_0xa2f9('0x2f')]=_[_0xa2f9('0x29')](_0x28910b[_0xa2f9('0x2f')]);_0x261872[_0xa2f9('0x2a')]=_['intersection'](_0x261872[_0xa2f9('0x2c')],_0x261872[_0xa2f9('0x2f')]);_0x5a0308[_0xa2f9('0x2d')]=_[_0xa2f9('0x2b')](_0x261872[_0xa2f9('0x2c')],qs[_0xa2f9('0x2e')](_0x28910b[_0xa2f9('0x2f')]['fields']));_0x5a0308[_0xa2f9('0x2d')]=_0x5a0308[_0xa2f9('0x2d')][_0xa2f9('0x30')]?_0x5a0308['attributes']:_0x261872[_0xa2f9('0x2c')];if(_0x28910b[_0xa2f9('0x2f')][_0xa2f9('0x3b')]){_0x5a0308[_0xa2f9('0x3c')]=[{'all':!![]}];}_0x5a0308=_[_0xa2f9('0x37')]({},_0x5a0308,_0x28910b[_0xa2f9('0x39')]);return db['VtigerAccount'][_0xa2f9('0x42')](_0x5a0308)[_0xa2f9('0x22')](handleEntityNotFound(_0x5c4730,null))[_0xa2f9('0x22')](respondWithResult(_0x5c4730,null))['catch'](handleError(_0x5c4730,null));};exports[_0xa2f9('0x43')]=function(_0x37fadd,_0x4ec788){return db[_0xa2f9('0x3a')][_0xa2f9('0x43')](_0x37fadd[_0xa2f9('0x44')],{})['then'](respondWithResult(_0x4ec788,0xc9))['catch'](handleError(_0x4ec788,null));};exports[_0xa2f9('0x45')]=function(_0x81ecff,_0x45d491){if(_0x81ecff['body']['id']){delete _0x81ecff['body']['id'];}return db[_0xa2f9('0x3a')][_0xa2f9('0x42')]({'where':{'id':_0x81ecff[_0xa2f9('0x46')]['id']}})[_0xa2f9('0x22')](handleEntityNotFound(_0x45d491,null))[_0xa2f9('0x22')](saveUpdates(_0x81ecff['body'],null))[_0xa2f9('0x22')](respondWithResult(_0x45d491,null))[_0xa2f9('0x3f')](handleError(_0x45d491,null));};exports[_0xa2f9('0x47')]=function(_0x401a80,_0x3b21d2){return db[_0xa2f9('0x3a')][_0xa2f9('0x42')]({'where':{'id':_0x401a80[_0xa2f9('0x46')]['id']}})[_0xa2f9('0x22')](handleEntityNotFound(_0x3b21d2,null))['then'](removeEntity(_0x3b21d2,null))[_0xa2f9('0x3f')](handleError(_0x3b21d2,null));};exports[_0xa2f9('0x48')]=function(_0x2a39d4,_0x61bf7d,_0x1d5e27){var _0x1710db={};var _0x8c0c93={};var _0x235129;var _0x21774e;return db[_0xa2f9('0x3a')][_0xa2f9('0x49')]({'where':{'id':_0x2a39d4[_0xa2f9('0x46')]['id']}})[_0xa2f9('0x22')](handleEntityNotFound(_0x61bf7d,null))[_0xa2f9('0x22')](function(_0x5a705c){if(_0x5a705c){_0x235129=_0x5a705c;_0x8c0c93[_0xa2f9('0x2c')]=_['keys'](db[_0xa2f9('0x4a')][_0xa2f9('0x41')]);_0x8c0c93['query']=_[_0xa2f9('0x29')](_0x2a39d4[_0xa2f9('0x2f')]);_0x8c0c93[_0xa2f9('0x2a')]=_[_0xa2f9('0x2b')](_0x8c0c93[_0xa2f9('0x2c')],_0x8c0c93[_0xa2f9('0x2f')]);_0x1710db[_0xa2f9('0x2d')]=_[_0xa2f9('0x2b')](_0x8c0c93[_0xa2f9('0x2c')],qs['fields'](_0x2a39d4[_0xa2f9('0x2f')]['fields']));_0x1710db[_0xa2f9('0x2d')]=_0x1710db['attributes'][_0xa2f9('0x30')]?_0x1710db[_0xa2f9('0x2d')]:_0x8c0c93[_0xa2f9('0x2c')];_0x1710db[_0xa2f9('0x32')]=qs[_0xa2f9('0x33')](_0x2a39d4[_0xa2f9('0x2f')][_0xa2f9('0x33')]);_0x1710db[_0xa2f9('0x34')]=qs[_0xa2f9('0x2a')](_[_0xa2f9('0x35')](_0x2a39d4[_0xa2f9('0x2f')],_0x8c0c93[_0xa2f9('0x2a')]));if(_0x2a39d4[_0xa2f9('0x2f')]['filter']){_0x1710db[_0xa2f9('0x34')]=_[_0xa2f9('0x37')](_0x1710db[_0xa2f9('0x34')],{'$or':_[_0xa2f9('0x26')](_0x1710db['attributes'],function(_0x216907){var _0x3fca60={};_0x3fca60[_0x216907]={'$like':'%'+_0x2a39d4['query'][_0xa2f9('0x36')]+'%'};return _0x3fca60;})});}_0x1710db=_['merge']({},_0x1710db,_0x2a39d4[_0xa2f9('0x39')]);return _0x235129['getConfigurations'](_0x1710db);}})[_0xa2f9('0x22')](function(_0x156668){if(_0x156668){_0x21774e=_0x156668[_0xa2f9('0x30')];if(!_0x2a39d4[_0xa2f9('0x2f')][_0xa2f9('0x31')](_0xa2f9('0x4b'))){_0x1710db[_0xa2f9('0x1c')]=qs[_0xa2f9('0x1c')](_0x2a39d4[_0xa2f9('0x2f')][_0xa2f9('0x1c')]);_0x1710db[_0xa2f9('0x1b')]=qs[_0xa2f9('0x1b')](_0x2a39d4[_0xa2f9('0x2f')][_0xa2f9('0x1b')]);}return _0x235129[_0xa2f9('0x48')](_0x1710db);}})['then'](function(_0x25e8e2){if(_0x25e8e2){return _0x25e8e2?{'count':_0x21774e,'rows':_0x25e8e2}:null;}})[_0xa2f9('0x22')](respondWithResult(_0x61bf7d,null))[_0xa2f9('0x3f')](handleError(_0x61bf7d,null));};exports[_0xa2f9('0x4c')]=function(_0x57f5b5,_0x447d3a,_0x2f1b9f){if(_0x57f5b5[_0xa2f9('0x44')]['id']){delete _0x57f5b5[_0xa2f9('0x44')]['id'];}return db['VtigerAccount'][_0xa2f9('0x49')]({'where':{'id':_0x57f5b5['params']['id']}})[_0xa2f9('0x22')](handleEntityNotFound(_0x447d3a,null))[_0xa2f9('0x22')](function(_0x36504b){if(_0x36504b){_0x57f5b5[_0xa2f9('0x44')][_0xa2f9('0x4d')]=_0x36504b['id'];_0x57f5b5['body']['Subjects']=integrations[_0xa2f9('0x4e')](_0x57f5b5[_0xa2f9('0x44')][_0xa2f9('0x4f')],_0x57f5b5[_0xa2f9('0x44')]['type']);_0x57f5b5[_0xa2f9('0x44')][_0xa2f9('0x50')]=integrations[_0xa2f9('0x51')](_0x57f5b5['body']['channel'],_0x57f5b5[_0xa2f9('0x44')][_0xa2f9('0x27')]);return db[_0xa2f9('0x4a')]['create'](_0x57f5b5['body'],{'include':[{'model':db['VtigerField'],'as':_0xa2f9('0x52')},{'model':db[_0xa2f9('0x53')],'as':'Descriptions'}]});}return null;})[_0xa2f9('0x22')](respondWithResult(_0x447d3a,null))[_0xa2f9('0x3f')](handleError(_0x447d3a,null));};var md5=require(_0xa2f9('0x54'));exports[_0xa2f9('0x55')]=function(_0x1a3635,_0xafaeb1,_0xe7b02e){var _0x4f6cd0=null;var _0x4f2dfe=null;var _0xbfa04a=null;var _0x2ca6d0=null;var _0x16d306='';return db[_0xa2f9('0x3a')][_0xa2f9('0x49')]({'where':{'id':_0x1a3635['params']['id']},'attributes':['id',_0xa2f9('0x25'),_0xa2f9('0x56'),_0xa2f9('0x57'),_0xa2f9('0x58'),'remoteUri','serverUrl',_0xa2f9('0x59')]})[_0xa2f9('0x22')](handleEntityNotFound(_0xafaeb1,null))[_0xa2f9('0x22')](function(_0x313224){if(_0x313224){_0x4f6cd0=_0x313224[_0xa2f9('0x56')];_0x4f2dfe=_0x313224[_0xa2f9('0x59')];_0xbfa04a=_0x313224[_0xa2f9('0x58')];_0x16d306=_0x313224[_0xa2f9('0x5a')];var _0x17f5e6=_0x16d306[_0xa2f9('0x5b')](-0x1);if(_0x17f5e6==='/'){_0x16d306=_0x16d306[_0xa2f9('0x5c')](0x0,_0x16d306['lastIndexOf'](_0x17f5e6));}_0x2ca6d0=util[_0xa2f9('0x5d')](_0xa2f9('0x5e'),_0x16d306);var _0x5e09ba={'method':'GET','uri':_0x2ca6d0,'qs':{'operation':'getchallenge','username':_0x313224[_0xa2f9('0x56')]},'json':!![]};return rp(_0x5e09ba);}})[_0xa2f9('0x22')](function(_0x2c45d8){if(_0x2c45d8[_0xa2f9('0x5f')]){var _0x29e7dc={'method':_0xa2f9('0x60'),'uri':_0x2ca6d0,'form':{'operation':_0xa2f9('0x61'),'username':_0x4f6cd0,'accessKey':md5(_0x2c45d8['result'][_0xa2f9('0x62')]+_0x4f2dfe)},'json':!![]};return rp(_0x29e7dc);}})[_0xa2f9('0x22')](function(_0x4bde3e){if(_0x4bde3e[_0xa2f9('0x5f')]){var _0x4ef7bc={'method':_0xa2f9('0x63'),'uri':_0x2ca6d0,'qs':{'operation':'describe','username':_0x4f6cd0,'sessionName':_0x4bde3e[_0xa2f9('0x64')][_0xa2f9('0x65')],'elementType':_0xbfa04a},'json':!![]};return rp(_0x4ef7bc);}})[_0xa2f9('0x22')](function(_0x467e87){if(_0x467e87[_0xa2f9('0x5f')]){var _0x2ff312=[_0xa2f9('0x66'),_0xa2f9('0x67'),_0xa2f9('0x68')];_[_0xa2f9('0x69')](_0x467e87['result'][_0xa2f9('0x2e')],function(_0x30c6e0){return _0x2ff312[_0xa2f9('0x6a')](_0x30c6e0[_0xa2f9('0x27')]['name']);});_[_0xa2f9('0x69')](_0x467e87[_0xa2f9('0x64')][_0xa2f9('0x2e')],function(_0x4da9f5){return _0x4da9f5[_0xa2f9('0x6b')]===_0xa2f9('0x6c');});return{'count':_0x467e87[_0xa2f9('0x64')][_0xa2f9('0x2e')][_0xa2f9('0x30')],'rows':_[_0xa2f9('0x26')](_0x467e87[_0xa2f9('0x64')][_0xa2f9('0x2e')],function(_0x232750){return{'id':_0x232750[_0xa2f9('0x25')],'name':_0x232750['label'],'custom':_[_0xa2f9('0x6d')](_0x232750['name'],_0xa2f9('0x6e'))?!![]:![],'options':_0x232750[_0xa2f9('0x27')][_0xa2f9('0x25')]===_0xa2f9('0x6f')&&_0x232750[_0xa2f9('0x27')]['picklistValues'][_0xa2f9('0x30')]>0x0?_[_0xa2f9('0x26')](_0x232750[_0xa2f9('0x27')][_0xa2f9('0x70')],function(_0x42006e){return{'name':_0x42006e['label'],'value':_0x42006e[_0xa2f9('0x71')]};}):[]};})};}})[_0xa2f9('0x22')](respondWithResult(_0xafaeb1,null))[_0xa2f9('0x3f')](function(_0x39317e){console[_0xa2f9('0x72')]('vTiger\x20error:\x20'+_0x39317e);var _0xa27041=_0x1a3635['query'][_0xa2f9('0x73')]?0x1f4:_0x39317e['statusCode']||0x1f4;logger[_0xa2f9('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xa2f9('0x55'),_0xa27041,JSON[_0xa2f9('0x74')](_0x39317e));delete _0x39317e['name'];if(_0xa27041===0x191){_0xa27041=0x190;}_0xafaeb1[_0xa2f9('0x18')](_0xa27041)[_0xa2f9('0x75')](_0x1a3635[_0xa2f9('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x39317e['statusCode']}:_0x39317e);});};
\ No newline at end of file
+var _0xbf7c=['params','findOne','VtigerConfiguration','order','nolimit','getConfigurations','AccountId','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','username','description','moduleName','accessKey','remoteUri','slice','substring','lastIndexOf','format','%s/webservice.php','GET','success','POST','login','result','token','sessionName','autogenerated','reference','includes','remove','editable','label','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','VtigerAccount','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','include','find','create','body'];(function(_0x472f1f,_0x10121d){var _0xe1ace8=function(_0x5a96b2){while(--_0x5a96b2){_0x472f1f['push'](_0x472f1f['shift']());}};_0xe1ace8(++_0x10121d);}(_0xbf7c,0x184));var _0xcbf7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf7c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcbf7('0x0'));var zipdir=require(_0xcbf7('0x1'));var jsonpatch=require(_0xcbf7('0x2'));var rp=require(_0xcbf7('0x3'));var moment=require('moment');var BPromise=require(_0xcbf7('0x4'));var Mustache=require('mustache');var util=require(_0xcbf7('0x5'));var path=require('path');var sox=require(_0xcbf7('0x6'));var csv=require(_0xcbf7('0x7'));var ejs=require(_0xcbf7('0x8'));var fs=require('fs');var fs_extra=require(_0xcbf7('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcbf7('0xa'));var jsforce=require(_0xcbf7('0xb'));var deskjs=require(_0xcbf7('0xc'));var toCsv=require(_0xcbf7('0x7'));var querystring=require('querystring');var Papa=require(_0xcbf7('0xd'));var Redis=require(_0xcbf7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xcbf7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbf7('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xcbf7('0x11'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xcbf7('0x12'));function respondWithStatusCode(_0x5966d4,_0x1a5b68){_0x1a5b68=_0x1a5b68||0xcc;return function(_0x28774c){if(_0x28774c){return _0x5966d4[_0xcbf7('0x13')](_0x1a5b68);}return _0x5966d4[_0xcbf7('0x14')](_0x1a5b68)[_0xcbf7('0x15')]();};}function respondWithResult(_0x555e89,_0x413954){_0x413954=_0x413954||0xc8;return function(_0x156597){if(_0x156597){return _0x555e89[_0xcbf7('0x14')](_0x413954)[_0xcbf7('0x16')](_0x156597);}};}function respondWithFilteredResult(_0x961ca9,_0x579100){return function(_0x56ace5){if(_0x56ace5){var _0x28f929=typeof _0x579100[_0xcbf7('0x17')]===_0xcbf7('0x18')&&typeof _0x579100[_0xcbf7('0x19')]===_0xcbf7('0x18');var _0x2fb281=_0x56ace5[_0xcbf7('0x1a')];var _0x15cbb0=_0x28f929?0x0:_0x579100[_0xcbf7('0x17')];var _0x2b0070=_0x28f929?_0x56ace5[_0xcbf7('0x1a')]:_0x579100[_0xcbf7('0x17')]+_0x579100['limit'];var _0x29c020;if(_0x2b0070>=_0x2fb281){_0x2b0070=_0x2fb281;_0x29c020=0xc8;}else{_0x29c020=0xce;}_0x961ca9[_0xcbf7('0x14')](_0x29c020);return _0x961ca9['set'](_0xcbf7('0x1b'),_0x15cbb0+'-'+_0x2b0070+'/'+_0x2fb281)[_0xcbf7('0x16')](_0x56ace5);}return null;};}function patchUpdates(_0x3130c3){return function(_0x26e705){try{jsonpatch[_0xcbf7('0x1c')](_0x26e705,_0x3130c3,!![]);}catch(_0x589df7){return BPromise[_0xcbf7('0x1d')](_0x589df7);}return _0x26e705[_0xcbf7('0x1e')]();};}function saveUpdates(_0x557529,_0x9eae4){return function(_0x44e454){if(_0x44e454){return _0x44e454[_0xcbf7('0x1f')](_0x557529)[_0xcbf7('0x20')](function(_0x3b3bfc){return _0x3b3bfc;});}return null;};}function removeEntity(_0x532b6c,_0x1caa38){return function(_0x5e6aef){if(_0x5e6aef){return _0x5e6aef[_0xcbf7('0x21')]()['then'](function(){_0x532b6c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x12150c,_0x1fd8d2){return function(_0x21313e){if(!_0x21313e){_0x12150c[_0xcbf7('0x13')](0x194);}return _0x21313e;};}function handleError(_0x26f1d7,_0x397bdc){_0x397bdc=_0x397bdc||0x1f4;return function(_0x53d39c){logger[_0xcbf7('0x22')](_0x53d39c[_0xcbf7('0x23')]);if(_0x53d39c[_0xcbf7('0x24')]){delete _0x53d39c['name'];}_0x26f1d7['status'](_0x397bdc)[_0xcbf7('0x25')](_0x53d39c);};}exports[_0xcbf7('0x26')]=function(_0x2d41a2,_0x46f616){var _0x5b6d19={},_0x11672a={},_0x4ef673={'count':0x0,'rows':[]};var _0x2f250a=_[_0xcbf7('0x27')](db[_0xcbf7('0x28')][_0xcbf7('0x29')],function(_0x1ec0e1){return{'name':_0x1ec0e1['fieldName'],'type':_0x1ec0e1[_0xcbf7('0x2a')][_0xcbf7('0x2b')]};});_0x11672a['model']=_[_0xcbf7('0x27')](_0x2f250a,_0xcbf7('0x24'));_0x11672a[_0xcbf7('0x2c')]=_[_0xcbf7('0x2d')](_0x2d41a2[_0xcbf7('0x2c')]);_0x11672a['filters']=_[_0xcbf7('0x2e')](_0x11672a[_0xcbf7('0x2f')],_0x11672a[_0xcbf7('0x2c')]);_0x5b6d19[_0xcbf7('0x30')]=_[_0xcbf7('0x2e')](_0x11672a['model'],qs[_0xcbf7('0x31')](_0x2d41a2[_0xcbf7('0x2c')][_0xcbf7('0x31')]));_0x5b6d19[_0xcbf7('0x30')]=_0x5b6d19['attributes'][_0xcbf7('0x32')]?_0x5b6d19[_0xcbf7('0x30')]:_0x11672a[_0xcbf7('0x2f')];if(!_0x2d41a2[_0xcbf7('0x2c')][_0xcbf7('0x33')]('nolimit')){_0x5b6d19[_0xcbf7('0x19')]=qs[_0xcbf7('0x19')](_0x2d41a2['query'][_0xcbf7('0x19')]);_0x5b6d19[_0xcbf7('0x17')]=qs[_0xcbf7('0x17')](_0x2d41a2['query'][_0xcbf7('0x17')]);}_0x5b6d19['order']=qs[_0xcbf7('0x34')](_0x2d41a2[_0xcbf7('0x2c')]['sort']);_0x5b6d19['where']=qs[_0xcbf7('0x35')](_[_0xcbf7('0x36')](_0x2d41a2[_0xcbf7('0x2c')],_0x11672a['filters']),_0x2f250a);if(_0x2d41a2[_0xcbf7('0x2c')][_0xcbf7('0x37')]){_0x5b6d19[_0xcbf7('0x38')]=_[_0xcbf7('0x39')](_0x5b6d19[_0xcbf7('0x38')],{'$or':_[_0xcbf7('0x27')](_0x2f250a,function(_0x3edb43){if(_0x3edb43[_0xcbf7('0x2a')]!==_0xcbf7('0x3a')){var _0x1cefda={};_0x1cefda[_0x3edb43['name']]={'$like':'%'+_0x2d41a2[_0xcbf7('0x2c')][_0xcbf7('0x37')]+'%'};return _0x1cefda;}})});}_0x5b6d19=_[_0xcbf7('0x39')]({},_0x5b6d19,_0x2d41a2[_0xcbf7('0x3b')]);var _0x44976b={'where':_0x5b6d19[_0xcbf7('0x38')]};return db[_0xcbf7('0x28')][_0xcbf7('0x1a')](_0x44976b)[_0xcbf7('0x20')](function(_0x53d4fe){_0x4ef673[_0xcbf7('0x1a')]=_0x53d4fe;if(_0x2d41a2['query'][_0xcbf7('0x3c')]){_0x5b6d19['include']=[{'all':!![]}];}return db[_0xcbf7('0x28')][_0xcbf7('0x3d')](_0x5b6d19);})[_0xcbf7('0x20')](function(_0x346678){_0x4ef673['rows']=_0x346678;return _0x4ef673;})[_0xcbf7('0x20')](respondWithFilteredResult(_0x46f616,_0x5b6d19))[_0xcbf7('0x3e')](handleError(_0x46f616,null));};exports[_0xcbf7('0x3f')]=function(_0x24708b,_0x525599){var _0x4000d9={'raw':![],'where':{'id':_0x24708b['params']['id']}},_0x493a06={};_0x493a06[_0xcbf7('0x2f')]=_[_0xcbf7('0x2d')](db[_0xcbf7('0x28')]['rawAttributes']);_0x493a06[_0xcbf7('0x2c')]=_['keys'](_0x24708b['query']);_0x493a06['filters']=_[_0xcbf7('0x2e')](_0x493a06['model'],_0x493a06[_0xcbf7('0x2c')]);_0x4000d9[_0xcbf7('0x30')]=_[_0xcbf7('0x2e')](_0x493a06[_0xcbf7('0x2f')],qs[_0xcbf7('0x31')](_0x24708b[_0xcbf7('0x2c')][_0xcbf7('0x31')]));_0x4000d9['attributes']=_0x4000d9['attributes'][_0xcbf7('0x32')]?_0x4000d9['attributes']:_0x493a06[_0xcbf7('0x2f')];if(_0x24708b[_0xcbf7('0x2c')][_0xcbf7('0x3c')]){_0x4000d9[_0xcbf7('0x40')]=[{'all':!![]}];}_0x4000d9=_[_0xcbf7('0x39')]({},_0x4000d9,_0x24708b[_0xcbf7('0x3b')]);return db['VtigerAccount'][_0xcbf7('0x41')](_0x4000d9)[_0xcbf7('0x20')](handleEntityNotFound(_0x525599,null))[_0xcbf7('0x20')](respondWithResult(_0x525599,null))['catch'](handleError(_0x525599,null));};exports['create']=function(_0x11cc25,_0x158cce){return db[_0xcbf7('0x28')][_0xcbf7('0x42')](_0x11cc25['body'],{})[_0xcbf7('0x20')](respondWithResult(_0x158cce,0xc9))[_0xcbf7('0x3e')](handleError(_0x158cce,null));};exports[_0xcbf7('0x1f')]=function(_0x33f44e,_0x31e22d){if(_0x33f44e[_0xcbf7('0x43')]['id']){delete _0x33f44e[_0xcbf7('0x43')]['id'];}return db[_0xcbf7('0x28')][_0xcbf7('0x41')]({'where':{'id':_0x33f44e[_0xcbf7('0x44')]['id']}})[_0xcbf7('0x20')](handleEntityNotFound(_0x31e22d,null))['then'](saveUpdates(_0x33f44e[_0xcbf7('0x43')],null))['then'](respondWithResult(_0x31e22d,null))[_0xcbf7('0x3e')](handleError(_0x31e22d,null));};exports[_0xcbf7('0x21')]=function(_0x39e5c1,_0x5ce12c){return db[_0xcbf7('0x28')][_0xcbf7('0x41')]({'where':{'id':_0x39e5c1['params']['id']}})[_0xcbf7('0x20')](handleEntityNotFound(_0x5ce12c,null))['then'](removeEntity(_0x5ce12c,null))[_0xcbf7('0x3e')](handleError(_0x5ce12c,null));};exports['getConfigurations']=function(_0x9c11f6,_0x2972f1,_0x548c8a){var _0xd3124e={};var _0x389786={};var _0x18b8a6;var _0x1df2f0;return db['VtigerAccount'][_0xcbf7('0x45')]({'where':{'id':_0x9c11f6[_0xcbf7('0x44')]['id']}})[_0xcbf7('0x20')](handleEntityNotFound(_0x2972f1,null))[_0xcbf7('0x20')](function(_0x18d9c3){if(_0x18d9c3){_0x18b8a6=_0x18d9c3;_0x389786['model']=_[_0xcbf7('0x2d')](db[_0xcbf7('0x46')][_0xcbf7('0x29')]);_0x389786[_0xcbf7('0x2c')]=_[_0xcbf7('0x2d')](_0x9c11f6[_0xcbf7('0x2c')]);_0x389786['filters']=_[_0xcbf7('0x2e')](_0x389786[_0xcbf7('0x2f')],_0x389786[_0xcbf7('0x2c')]);_0xd3124e[_0xcbf7('0x30')]=_[_0xcbf7('0x2e')](_0x389786[_0xcbf7('0x2f')],qs[_0xcbf7('0x31')](_0x9c11f6[_0xcbf7('0x2c')][_0xcbf7('0x31')]));_0xd3124e[_0xcbf7('0x30')]=_0xd3124e['attributes'][_0xcbf7('0x32')]?_0xd3124e['attributes']:_0x389786['model'];_0xd3124e[_0xcbf7('0x47')]=qs[_0xcbf7('0x34')](_0x9c11f6[_0xcbf7('0x2c')]['sort']);_0xd3124e[_0xcbf7('0x38')]=qs[_0xcbf7('0x35')](_[_0xcbf7('0x36')](_0x9c11f6[_0xcbf7('0x2c')],_0x389786[_0xcbf7('0x35')]));if(_0x9c11f6['query'][_0xcbf7('0x37')]){_0xd3124e[_0xcbf7('0x38')]=_[_0xcbf7('0x39')](_0xd3124e['where'],{'$or':_['map'](_0xd3124e[_0xcbf7('0x30')],function(_0x1d1cde){var _0x19989c={};_0x19989c[_0x1d1cde]={'$like':'%'+_0x9c11f6[_0xcbf7('0x2c')][_0xcbf7('0x37')]+'%'};return _0x19989c;})});}_0xd3124e=_[_0xcbf7('0x39')]({},_0xd3124e,_0x9c11f6[_0xcbf7('0x3b')]);return _0x18b8a6['getConfigurations'](_0xd3124e);}})[_0xcbf7('0x20')](function(_0x5a57cc){if(_0x5a57cc){_0x1df2f0=_0x5a57cc[_0xcbf7('0x32')];if(!_0x9c11f6[_0xcbf7('0x2c')][_0xcbf7('0x33')](_0xcbf7('0x48'))){_0xd3124e[_0xcbf7('0x19')]=qs[_0xcbf7('0x19')](_0x9c11f6[_0xcbf7('0x2c')][_0xcbf7('0x19')]);_0xd3124e[_0xcbf7('0x17')]=qs[_0xcbf7('0x17')](_0x9c11f6[_0xcbf7('0x2c')]['offset']);}return _0x18b8a6[_0xcbf7('0x49')](_0xd3124e);}})[_0xcbf7('0x20')](function(_0xb93e8a){if(_0xb93e8a){return _0xb93e8a?{'count':_0x1df2f0,'rows':_0xb93e8a}:null;}})[_0xcbf7('0x20')](respondWithResult(_0x2972f1,null))['catch'](handleError(_0x2972f1,null));};exports['addConfiguration']=function(_0x5e7f87,_0x56a9b1,_0x503388){if(_0x5e7f87[_0xcbf7('0x43')]['id']){delete _0x5e7f87['body']['id'];}return db[_0xcbf7('0x28')][_0xcbf7('0x45')]({'where':{'id':_0x5e7f87[_0xcbf7('0x44')]['id']}})[_0xcbf7('0x20')](handleEntityNotFound(_0x56a9b1,null))[_0xcbf7('0x20')](function(_0x123994){if(_0x123994){_0x5e7f87['body'][_0xcbf7('0x4a')]=_0x123994['id'];_0x5e7f87[_0xcbf7('0x43')]['Subjects']=integrations['getSubjects'](_0x5e7f87[_0xcbf7('0x43')][_0xcbf7('0x4b')],_0x5e7f87[_0xcbf7('0x43')][_0xcbf7('0x2a')]);_0x5e7f87['body'][_0xcbf7('0x4c')]=integrations[_0xcbf7('0x4d')](_0x5e7f87[_0xcbf7('0x43')]['channel'],_0x5e7f87['body'][_0xcbf7('0x2a')]);return db['VtigerConfiguration'][_0xcbf7('0x42')](_0x5e7f87[_0xcbf7('0x43')],{'include':[{'model':db[_0xcbf7('0x4e')],'as':'Subjects'},{'model':db[_0xcbf7('0x4e')],'as':_0xcbf7('0x4c')}]});}return null;})[_0xcbf7('0x20')](respondWithResult(_0x56a9b1,null))['catch'](handleError(_0x56a9b1,null));};var md5=require(_0xcbf7('0x4f'));exports[_0xcbf7('0x50')]=function(_0x3e1d46,_0x347db4,_0x372f69){var _0x8c1e51=null;var _0x58668d=null;var _0x39e127=null;var _0x45bb64=null;var _0x459f22='';return db[_0xcbf7('0x28')]['findOne']({'where':{'id':_0x3e1d46[_0xcbf7('0x44')]['id']},'attributes':['id',_0xcbf7('0x24'),_0xcbf7('0x51'),_0xcbf7('0x52'),_0xcbf7('0x53'),'remoteUri','serverUrl','accessKey']})['then'](handleEntityNotFound(_0x347db4,null))[_0xcbf7('0x20')](function(_0x4678fb){if(_0x4678fb){_0x8c1e51=_0x4678fb[_0xcbf7('0x51')];_0x58668d=_0x4678fb[_0xcbf7('0x54')];_0x39e127=_0x4678fb[_0xcbf7('0x53')];_0x459f22=_0x4678fb[_0xcbf7('0x55')];var _0x5eb932=_0x459f22[_0xcbf7('0x56')](-0x1);if(_0x5eb932==='/'){_0x459f22=_0x459f22[_0xcbf7('0x57')](0x0,_0x459f22[_0xcbf7('0x58')](_0x5eb932));}_0x45bb64=util[_0xcbf7('0x59')](_0xcbf7('0x5a'),_0x459f22);var _0x452924={'method':_0xcbf7('0x5b'),'uri':_0x45bb64,'qs':{'operation':'getchallenge','username':_0x4678fb[_0xcbf7('0x51')]},'json':!![]};return rp(_0x452924);}})[_0xcbf7('0x20')](function(_0x15cf40){if(_0x15cf40[_0xcbf7('0x5c')]){var _0x2f87ba={'method':_0xcbf7('0x5d'),'uri':_0x45bb64,'form':{'operation':_0xcbf7('0x5e'),'username':_0x8c1e51,'accessKey':md5(_0x15cf40[_0xcbf7('0x5f')][_0xcbf7('0x60')]+_0x58668d)},'json':!![]};return rp(_0x2f87ba);}})[_0xcbf7('0x20')](function(_0x48ddd1){if(_0x48ddd1[_0xcbf7('0x5c')]){var _0x11bbae={'method':_0xcbf7('0x5b'),'uri':_0x45bb64,'qs':{'operation':'describe','username':_0x8c1e51,'sessionName':_0x48ddd1[_0xcbf7('0x5f')][_0xcbf7('0x61')],'elementType':_0x39e127},'json':!![]};return rp(_0x11bbae);}})['then'](function(_0x16876a){if(_0x16876a[_0xcbf7('0x5c')]){var _0x28ea30=[_0xcbf7('0x62'),_0xcbf7('0x63'),'owner'];_['remove'](_0x16876a[_0xcbf7('0x5f')][_0xcbf7('0x31')],function(_0x16762c){return _0x28ea30[_0xcbf7('0x64')](_0x16762c[_0xcbf7('0x2a')][_0xcbf7('0x24')]);});_[_0xcbf7('0x65')](_0x16876a[_0xcbf7('0x5f')][_0xcbf7('0x31')],function(_0x3f8d54){return _0x3f8d54[_0xcbf7('0x66')]==='false';});return{'count':_0x16876a['result']['fields'][_0xcbf7('0x32')],'rows':_[_0xcbf7('0x27')](_0x16876a['result'][_0xcbf7('0x31')],function(_0x128bdd){return{'id':_0x128bdd[_0xcbf7('0x24')],'name':_0x128bdd[_0xcbf7('0x67')],'custom':_['startsWith'](_0x128bdd[_0xcbf7('0x24')],_0xcbf7('0x68'))?!![]:![],'options':_0x128bdd['type'][_0xcbf7('0x24')]===_0xcbf7('0x69')&&_0x128bdd[_0xcbf7('0x2a')][_0xcbf7('0x6a')][_0xcbf7('0x32')]>0x0?_[_0xcbf7('0x27')](_0x128bdd[_0xcbf7('0x2a')][_0xcbf7('0x6a')],function(_0x2824a3){return{'name':_0x2824a3[_0xcbf7('0x67')],'value':_0x2824a3[_0xcbf7('0x6b')]};}):[]};})};}})[_0xcbf7('0x20')](respondWithResult(_0x347db4,null))[_0xcbf7('0x3e')](function(_0x541369){console['log'](_0xcbf7('0x6c')+_0x541369);var _0x2c3107=_0x3e1d46[_0xcbf7('0x2c')][_0xcbf7('0x6d')]?0x1f4:_0x541369['statusCode']||0x1f4;logger[_0xcbf7('0x22')](_0xcbf7('0x6e'),_0xcbf7('0x50'),_0x2c3107,JSON[_0xcbf7('0x6f')](_0x541369));delete _0x541369[_0xcbf7('0x24')];if(_0x2c3107===0x191){_0x2c3107=0x190;}_0x347db4[_0xcbf7('0x14')](_0x2c3107)[_0xcbf7('0x25')](_0x3e1d46[_0xcbf7('0x2c')][_0xcbf7('0x6d')]?{'message':_0xcbf7('0x70'),'statusCode':_0x541369[_0xcbf7('0x71')]}:_0x541369);});};
\ No newline at end of file
index 3132034..ba27ad6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00c9=['./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x00c9,0x1b9));var _0x900c=function(_0x507fb9,_0xc1dd73){_0x507fb9=_0x507fb9-0x0;var _0x68007=_0x00c9[_0x507fb9];return _0x68007;};'use strict';var _=require('lodash');var util=require(_0x900c('0x0'));var logger=require(_0x900c('0x1'))(_0x900c('0x2'));var moment=require(_0x900c('0x3'));var BPromise=require(_0x900c('0x4'));var rp=require(_0x900c('0x5'));var fs=require('fs');var path=require(_0x900c('0x6'));var rimraf=require(_0x900c('0x7'));var config=require(_0x900c('0x8'));var attributes=require(_0x900c('0x9'));var integrations=require(_0x900c('0xa'));module[_0x900c('0xb')]=function(_0xb4351b,_0x44cfc1){return _0xb4351b[_0x900c('0xc')](_0x900c('0xd'),attributes,{'tableName':_0x900c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a4d=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','util','moment'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x2a4d,0x1ab));var _0xd2a4=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x2a4d[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require('lodash');var util=require(_0xd2a4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd2a4('0x1'));var BPromise=require(_0xd2a4('0x2'));var rp=require(_0xd2a4('0x3'));var fs=require('fs');var path=require(_0xd2a4('0x4'));var rimraf=require(_0xd2a4('0x5'));var config=require(_0xd2a4('0x6'));var attributes=require(_0xd2a4('0x7'));var integrations=require(_0xd2a4('0x8'));module[_0xd2a4('0x9')]=function(_0x2b119b,_0x4acf11){return _0x2b119b[_0xd2a4('0xa')](_0xd2a4('0xb'),attributes,{'tableName':_0xd2a4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7b444f3..66e7575 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cf8=['info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetVtigerAccount','options','raw','attributes','include','map','model','ShowVtigerAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x4cf8[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var moment=require(_0x84cf('0x2'));var BPromise=require(_0x84cf('0x3'));var rs=require(_0x84cf('0x4'));var fs=require('fs');var Redis=require(_0x84cf('0x5'));var db=require(_0x84cf('0x6'))['db'];var utils=require(_0x84cf('0x7'));var logger=require(_0x84cf('0x8'))(_0x84cf('0x9'));var config=require(_0x84cf('0xa'));var jayson=require(_0x84cf('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x455345,_0x56c5cc,_0x15ba85){return new BPromise(function(_0x2c11b0,_0x51b84c){return client[_0x84cf('0xc')](_0x455345,_0x15ba85)[_0x84cf('0xd')](function(_0x489063){logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));logger[_0x84cf('0x11')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x56c5cc,_0x84cf('0x10'),JSON[_0x84cf('0x12')](_0x489063));if(_0x489063['error']){if(_0x489063['error'][_0x84cf('0x13')]===0x1f4){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x51b84c(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);return _0x2c11b0(_0x489063[_0x84cf('0x14')][_0x84cf('0x15')]);}else{logger[_0x84cf('0xe')](_0x84cf('0xf'),_0x56c5cc,_0x84cf('0x10'));_0x2c11b0(_0x489063[_0x84cf('0x16')][_0x84cf('0x15')]);}})[_0x84cf('0x17')](function(_0x5b8ac8){logger[_0x84cf('0x14')](_0x84cf('0xf'),_0x56c5cc,_0x5b8ac8);_0x51b84c(_0x5b8ac8);});});}exports[_0x84cf('0x18')]=function(_0x1abe2d){var _0x1dad1a=this;return new Promise(function(_0x13ba16,_0xe6b5b6){return db['VtigerAccount']['findAll']({'raw':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1a')]===undefined?!![]:![]:!![],'where':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')]['where']||null:null,'attributes':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1b')]||null:null,'limit':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')]['limit']||null:null,'include':_0x1abe2d[_0x84cf('0x19')]?_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1c')]?_[_0x84cf('0x1d')](_0x1abe2d[_0x84cf('0x19')][_0x84cf('0x1c')],function(_0x7feb4){return{'model':db[_0x7feb4['model']],'as':_0x7feb4['as'],'attributes':_0x7feb4[_0x84cf('0x1b')],'include':_0x7feb4[_0x84cf('0x1c')]?_[_0x84cf('0x1d')](_0x7feb4[_0x84cf('0x1c')],function(_0x1d220a){return{'model':db[_0x1d220a[_0x84cf('0x1e')]],'as':_0x1d220a['as'],'attributes':_0x1d220a[_0x84cf('0x1b')],'include':_0x1d220a[_0x84cf('0x1c')]?_[_0x84cf('0x1d')](_0x1d220a[_0x84cf('0x1c')],function(_0x5179c1){return{'model':db[_0x5179c1[_0x84cf('0x1e')]],'as':_0x5179c1['as'],'attributes':_0x5179c1[_0x84cf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x84cf('0xd')](function(_0x41a5db){logger['info'](_0x84cf('0x18'),_0x1abe2d);logger['debug'](_0x84cf('0x18'),_0x1abe2d,JSON[_0x84cf('0x12')](_0x41a5db));_0x13ba16(_0x41a5db);})[_0x84cf('0x17')](function(_0xc15298){logger[_0x84cf('0x14')](_0x84cf('0x18'),_0xc15298[_0x84cf('0x15')],_0x1abe2d);_0xe6b5b6(_0x1dad1a[_0x84cf('0x14')](0x1f4,_0xc15298[_0x84cf('0x15')]));});});};exports[_0x84cf('0x1f')]=function(_0x31dbf5){var _0x308f8f=this;return new Promise(function(_0x18243d,_0x44f16e){return db['VtigerAccount']['find']({'raw':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')][_0x84cf('0x1a')]===undefined?!![]:![]:!![],'where':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')][_0x84cf('0x20')]||null:null,'attributes':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')]['attributes']||null:null,'include':_0x31dbf5[_0x84cf('0x19')]?_0x31dbf5[_0x84cf('0x19')]['include']?_[_0x84cf('0x1d')](_0x31dbf5['options'][_0x84cf('0x1c')],function(_0x3ea5b9){return{'model':db[_0x3ea5b9[_0x84cf('0x1e')]],'as':_0x3ea5b9['as'],'attributes':_0x3ea5b9[_0x84cf('0x1b')],'include':_0x3ea5b9[_0x84cf('0x1c')]?_['map'](_0x3ea5b9[_0x84cf('0x1c')],function(_0x48309d){return{'model':db[_0x48309d['model']],'as':_0x48309d['as'],'attributes':_0x48309d[_0x84cf('0x1b')],'include':_0x48309d[_0x84cf('0x1c')]?_['map'](_0x48309d[_0x84cf('0x1c')],function(_0x263372){return{'model':db[_0x263372[_0x84cf('0x1e')]],'as':_0x263372['as'],'attributes':_0x263372[_0x84cf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x84cf('0xd')](function(_0x300f94){logger['info'](_0x84cf('0x1f'),_0x31dbf5);logger[_0x84cf('0x11')](_0x84cf('0x1f'),_0x31dbf5,JSON[_0x84cf('0x12')](_0x300f94));_0x18243d(_0x300f94);})[_0x84cf('0x17')](function(_0x2a8992){logger['error'](_0x84cf('0x1f'),_0x2a8992['message'],_0x31dbf5);_0x44f16e(_0x308f8f[_0x84cf('0x14')](0x1f4,_0x2a8992[_0x84cf('0x15')]));});});};
\ No newline at end of file
+var _0x5eb8=['where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','catch','VtigerAccount','findAll','options','raw','limit','include','model','attributes','map','then','GetVtigerAccount','stringify','ShowVtigerAccount'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x5eb8,0xb0));var _0x85eb=function(_0x496738,_0x3f1a9f){_0x496738=_0x496738-0x0;var _0xee1381=_0x5eb8[_0x496738];return _0xee1381;};'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')]('VtigerAccount,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['GetVtigerAccount']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')]({'raw':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8['options'][_0x85eb('0x18')]===undefined?!![]:![]:!![],'where':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')]['where']||null:null,'attributes':_0x50d2a8['options']?_0x50d2a8['options']['attributes']||null:null,'limit':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x19')]||null:null,'include':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x1a')]?_['map'](_0x50d2a8['options']['include'],function(_0x298e84){return{'model':db[_0x298e84[_0x85eb('0x1b')]],'as':_0x298e84['as'],'attributes':_0x298e84[_0x85eb('0x1c')],'include':_0x298e84[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x298e84[_0x85eb('0x1a')],function(_0x5dfc96){return{'model':db[_0x5dfc96[_0x85eb('0x1b')]],'as':_0x5dfc96['as'],'attributes':_0x5dfc96[_0x85eb('0x1c')],'include':_0x5dfc96[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x5dfc96[_0x85eb('0x1a')],function(_0x57a03c){return{'model':db[_0x57a03c[_0x85eb('0x1b')]],'as':_0x57a03c['as'],'attributes':_0x57a03c[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x3e7eb9){logger[_0x85eb('0xd')](_0x85eb('0x1f'),_0x50d2a8);logger['debug']('GetVtigerAccount',_0x50d2a8,JSON[_0x85eb('0x20')](_0x3e7eb9));_0x39ca96(_0x3e7eb9);})['catch'](function(_0xa9b14f){logger['error'](_0x85eb('0x1f'),_0xa9b14f[_0x85eb('0x13')],_0x50d2a8);_0x10cf2f(_0xe198ca[_0x85eb('0x12')](0x1f4,_0xa9b14f[_0x85eb('0x13')]));});});};exports[_0x85eb('0x21')]=function(_0xf4ac13){var _0x41ed76=this;return new Promise(function(_0x5decd5,_0x237f19){return db[_0x85eb('0x15')]['find']({'raw':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13['options']['raw']===undefined?!![]:![]:!![],'where':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x22')]||null:null,'attributes':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1c')]||null:null,'include':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0xf4ac13['options'][_0x85eb('0x1a')],function(_0x3a5b87){return{'model':db[_0x3a5b87['model']],'as':_0x3a5b87['as'],'attributes':_0x3a5b87['attributes'],'include':_0x3a5b87[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x3a5b87[_0x85eb('0x1a')],function(_0x12cb4c){return{'model':db[_0x12cb4c[_0x85eb('0x1b')]],'as':_0x12cb4c['as'],'attributes':_0x12cb4c[_0x85eb('0x1c')],'include':_0x12cb4c[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x12cb4c[_0x85eb('0x1a')],function(_0x373e5f){return{'model':db[_0x373e5f[_0x85eb('0x1b')]],'as':_0x373e5f['as'],'attributes':_0x373e5f[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x33605a){logger['info'](_0x85eb('0x21'),_0xf4ac13);logger[_0x85eb('0x10')]('ShowVtigerAccount',_0xf4ac13,JSON['stringify'](_0x33605a));_0x5decd5(_0x33605a);})[_0x85eb('0x14')](function(_0xe22d16){logger['error'](_0x85eb('0x21'),_0xe22d16['message'],_0xf4ac13);_0x237f19(_0x41ed76[_0x85eb('0x12')](0x1f4,_0xe22d16['message']));});});};
\ No newline at end of file
index 27b81f1..0909d0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86a6=['../../components/auth/service','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x33b2dd,_0x57c889){var _0x324fa7=function(_0x53743a){while(--_0x53743a){_0x33b2dd['push'](_0x33b2dd['shift']());}};_0x324fa7(++_0x57c889);}(_0x86a6,0xe1));var _0x686a=function(_0x291f8b,_0x3b5591){_0x291f8b=_0x291f8b-0x0;var _0x275171=_0x86a6[_0x291f8b];return _0x275171;};'use strict';var multer=require(_0x686a('0x0'));var util=require(_0x686a('0x1'));var path=require(_0x686a('0x2'));var timeout=require(_0x686a('0x3'));var express=require(_0x686a('0x4'));var router=express[_0x686a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x686a('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x686a('0x7'));router[_0x686a('0x8')]('/',auth[_0x686a('0x9')](),controller[_0x686a('0xa')]);router['get'](_0x686a('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x686a('0x8')]('/:id/fields',auth[_0x686a('0x9')](),controller['getFields']);router[_0x686a('0x8')](_0x686a('0xc'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x686a('0x8')](_0x686a('0xd'),auth[_0x686a('0x9')](),controller[_0x686a('0xe')]);router[_0x686a('0xf')]('/',auth[_0x686a('0x9')](),controller[_0x686a('0x10')]);router[_0x686a('0x11')]('/:id',auth[_0x686a('0x9')](),controller['update']);router[_0x686a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x686a('0x13')]);module[_0x686a('0x14')]=router;
\ No newline at end of file
+var _0x3969=['getFields','/:id/subjects','getSubjects','/:id/descriptions','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','show','/:id/fields'];(function(_0x17f3ef,_0x3cad21){var _0x53610a=function(_0x35fcbc){while(--_0x35fcbc){_0x17f3ef['push'](_0x17f3ef['shift']());}};_0x53610a(++_0x3cad21);}(_0x3969,0xd8));var _0x9396=function(_0xe3a294,_0x4b7a24){_0xe3a294=_0xe3a294-0x0;var _0x1f30e1=_0x3969[_0xe3a294];return _0x1f30e1;};'use strict';var multer=require(_0x9396('0x0'));var util=require(_0x9396('0x1'));var path=require(_0x9396('0x2'));var timeout=require(_0x9396('0x3'));var express=require(_0x9396('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9396('0x5'));var interaction=require(_0x9396('0x6'));var config=require(_0x9396('0x7'));var controller=require(_0x9396('0x8'));router[_0x9396('0x9')]('/',auth[_0x9396('0xa')](),controller[_0x9396('0xb')]);router[_0x9396('0x9')]('/:id',auth[_0x9396('0xa')](),controller[_0x9396('0xc')]);router[_0x9396('0x9')](_0x9396('0xd'),auth[_0x9396('0xa')](),controller[_0x9396('0xe')]);router[_0x9396('0x9')](_0x9396('0xf'),auth[_0x9396('0xa')](),controller[_0x9396('0x10')]);router[_0x9396('0x9')](_0x9396('0x11'),auth[_0x9396('0xa')](),controller['getDescriptions']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9396('0x12')](_0x9396('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x9396('0x14')]('/:id',auth[_0x9396('0xa')](),controller[_0x9396('0x15')]);module[_0x9396('0x16')]=router;
\ No newline at end of file
index 93e541a..b7c8a25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9dc=['sequelize','exports','STRING'];(function(_0x529bde,_0x32d640){var _0xb7109c=function(_0xc5c3b1){while(--_0xc5c3b1){_0x529bde['push'](_0x529bde['shift']());}};_0xb7109c(++_0x32d640);}(_0xe9dc,0x156));var _0xce9d=function(_0x2ded4e,_0x1aa7d8){_0x2ded4e=_0x2ded4e-0x0;var _0x4c9144=_0xe9dc[_0x2ded4e];return _0x4c9144;};'use strict';var Sequelize=require(_0xce9d('0x0'));module[_0xce9d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xce9d('0x2')]}};
\ No newline at end of file
+var _0x1926=['sequelize','exports','STRING'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x1926,0xab));var _0x6192=function(_0x5baa98,_0x9e5c5){_0x5baa98=_0x5baa98-0x0;var _0x5b8e22=_0x1926[_0x5baa98];return _0x5b8e22;};'use strict';var Sequelize=require(_0x6192('0x0'));module[_0x6192('0x1')]={'name':{'type':Sequelize[_0x6192('0x2')]},'description':{'type':Sequelize[_0x6192('0x2')]}};
\ No newline at end of file
index 3f1da05..3506fa4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff24=['filters','where','merge','type','filter','options','includeAll','include','findAll','rows','find','catch','create','update','body','params','getFields','getSubjects','findOne','VtigerField','order','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','map','VtigerConfiguration','rawAttributes','key','query','keys','model','intersection','fields','attributes','length','nolimit','sort'];(function(_0x1be349,_0x2aeaa1){var _0xf9c3fe=function(_0x521935){while(--_0x521935){_0x1be349['push'](_0x1be349['shift']());}};_0xf9c3fe(++_0x2aeaa1);}(_0xff24,0x146));var _0x4ff2=function(_0x5eac82,_0x3593ad){_0x5eac82=_0x5eac82-0x0;var _0x4e0e82=_0xff24[_0x5eac82];return _0x4e0e82;};'use strict';var emlformat=require(_0x4ff2('0x0'));var rimraf=require(_0x4ff2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ff2('0x2'));var rp=require(_0x4ff2('0x3'));var moment=require(_0x4ff2('0x4'));var BPromise=require(_0x4ff2('0x5'));var Mustache=require(_0x4ff2('0x6'));var util=require(_0x4ff2('0x7'));var path=require(_0x4ff2('0x8'));var sox=require(_0x4ff2('0x9'));var csv=require('to-csv');var ejs=require(_0x4ff2('0xa'));var fs=require('fs');var fs_extra=require(_0x4ff2('0xb'));var _=require(_0x4ff2('0xc'));var squel=require(_0x4ff2('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4ff2('0xe'));var toCsv=require(_0x4ff2('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4ff2('0x10'));var authService=require(_0x4ff2('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4ff2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4ff2('0x13'));var config=require(_0x4ff2('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4ff2('0x15'))['db'];function respondWithStatusCode(_0x5cc2d6,_0x22e91b){_0x22e91b=_0x22e91b||0xcc;return function(_0x435c54){if(_0x435c54){return _0x5cc2d6['sendStatus'](_0x22e91b);}return _0x5cc2d6[_0x4ff2('0x16')](_0x22e91b)[_0x4ff2('0x17')]();};}function respondWithResult(_0x4de836,_0x4561b3){_0x4561b3=_0x4561b3||0xc8;return function(_0x3e8c1a){if(_0x3e8c1a){return _0x4de836[_0x4ff2('0x16')](_0x4561b3)[_0x4ff2('0x18')](_0x3e8c1a);}};}function respondWithFilteredResult(_0x179487,_0xedd364){return function(_0xe5941c){if(_0xe5941c){var _0x8b4ff7=typeof _0xedd364[_0x4ff2('0x19')]==='undefined'&&typeof _0xedd364[_0x4ff2('0x1a')]===_0x4ff2('0x1b');var _0x13a445=_0xe5941c[_0x4ff2('0x1c')];var _0x483088=_0x8b4ff7?0x0:_0xedd364[_0x4ff2('0x19')];var _0x6b7547=_0x8b4ff7?_0xe5941c[_0x4ff2('0x1c')]:_0xedd364[_0x4ff2('0x19')]+_0xedd364[_0x4ff2('0x1a')];var _0x53ba94;if(_0x6b7547>=_0x13a445){_0x6b7547=_0x13a445;_0x53ba94=0xc8;}else{_0x53ba94=0xce;}_0x179487['status'](_0x53ba94);return _0x179487[_0x4ff2('0x1d')](_0x4ff2('0x1e'),_0x483088+'-'+_0x6b7547+'/'+_0x13a445)[_0x4ff2('0x18')](_0xe5941c);}return null;};}function patchUpdates(_0x456d4e){return function(_0x433ac2){try{jsonpatch[_0x4ff2('0x1f')](_0x433ac2,_0x456d4e,!![]);}catch(_0x3fb57a){return BPromise[_0x4ff2('0x20')](_0x3fb57a);}return _0x433ac2[_0x4ff2('0x21')]();};}function saveUpdates(_0x167621,_0x9400){return function(_0x49f6ea){if(_0x49f6ea){return _0x49f6ea['update'](_0x167621)[_0x4ff2('0x22')](function(_0x15c39f){return _0x15c39f;});}return null;};}function removeEntity(_0x36c297,_0x32c80a){return function(_0x13cfa1){if(_0x13cfa1){return _0x13cfa1[_0x4ff2('0x23')]()[_0x4ff2('0x22')](function(){_0x36c297[_0x4ff2('0x16')](0xcc)[_0x4ff2('0x17')]();});}};}function handleEntityNotFound(_0x15422d,_0x5e63bd){return function(_0xdf8b27){if(!_0xdf8b27){_0x15422d[_0x4ff2('0x24')](0x194);}return _0xdf8b27;};}function handleError(_0x2727c0,_0x1b43bd){_0x1b43bd=_0x1b43bd||0x1f4;return function(_0x1b6756){logger[_0x4ff2('0x25')](_0x1b6756[_0x4ff2('0x26')]);if(_0x1b6756[_0x4ff2('0x27')]){delete _0x1b6756['name'];}_0x2727c0[_0x4ff2('0x16')](_0x1b43bd)[_0x4ff2('0x28')](_0x1b6756);};}exports['index']=function(_0x264aa5,_0x2b4873){var _0x468018={},_0x48900c={},_0x4ce95f={'count':0x0,'rows':[]};var _0x56dfe4=_[_0x4ff2('0x29')](db[_0x4ff2('0x2a')][_0x4ff2('0x2b')],function(_0x4185d8){return{'name':_0x4185d8['fieldName'],'type':_0x4185d8['type'][_0x4ff2('0x2c')]};});_0x48900c['model']=_[_0x4ff2('0x29')](_0x56dfe4,_0x4ff2('0x27'));_0x48900c[_0x4ff2('0x2d')]=_[_0x4ff2('0x2e')](_0x264aa5[_0x4ff2('0x2d')]);_0x48900c['filters']=_['intersection'](_0x48900c[_0x4ff2('0x2f')],_0x48900c[_0x4ff2('0x2d')]);_0x468018['attributes']=_[_0x4ff2('0x30')](_0x48900c[_0x4ff2('0x2f')],qs[_0x4ff2('0x31')](_0x264aa5[_0x4ff2('0x2d')][_0x4ff2('0x31')]));_0x468018[_0x4ff2('0x32')]=_0x468018[_0x4ff2('0x32')][_0x4ff2('0x33')]?_0x468018[_0x4ff2('0x32')]:_0x48900c[_0x4ff2('0x2f')];if(!_0x264aa5[_0x4ff2('0x2d')]['hasOwnProperty'](_0x4ff2('0x34'))){_0x468018[_0x4ff2('0x1a')]=qs[_0x4ff2('0x1a')](_0x264aa5['query'][_0x4ff2('0x1a')]);_0x468018['offset']=qs[_0x4ff2('0x19')](_0x264aa5[_0x4ff2('0x2d')][_0x4ff2('0x19')]);}_0x468018['order']=qs['sort'](_0x264aa5[_0x4ff2('0x2d')][_0x4ff2('0x35')]);_0x468018['where']=qs[_0x4ff2('0x36')](_['pick'](_0x264aa5[_0x4ff2('0x2d')],_0x48900c['filters']),_0x56dfe4);if(_0x264aa5[_0x4ff2('0x2d')]['filter']){_0x468018[_0x4ff2('0x37')]=_[_0x4ff2('0x38')](_0x468018['where'],{'$or':_[_0x4ff2('0x29')](_0x56dfe4,function(_0x412477){if(_0x412477[_0x4ff2('0x39')]!=='VIRTUAL'){var _0x51b43b={};_0x51b43b[_0x412477['name']]={'$like':'%'+_0x264aa5[_0x4ff2('0x2d')][_0x4ff2('0x3a')]+'%'};return _0x51b43b;}})});}_0x468018=_[_0x4ff2('0x38')]({},_0x468018,_0x264aa5[_0x4ff2('0x3b')]);var _0x5673ec={'where':_0x468018[_0x4ff2('0x37')]};return db[_0x4ff2('0x2a')][_0x4ff2('0x1c')](_0x5673ec)[_0x4ff2('0x22')](function(_0x2a3b45){_0x4ce95f[_0x4ff2('0x1c')]=_0x2a3b45;if(_0x264aa5[_0x4ff2('0x2d')][_0x4ff2('0x3c')]){_0x468018[_0x4ff2('0x3d')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x4ff2('0x3e')](_0x468018);})[_0x4ff2('0x22')](function(_0x15d91a){_0x4ce95f[_0x4ff2('0x3f')]=_0x15d91a;return _0x4ce95f;})[_0x4ff2('0x22')](respondWithFilteredResult(_0x2b4873,_0x468018))['catch'](handleError(_0x2b4873,null));};exports['show']=function(_0x48916d,_0x137014){var _0x352d8c={'raw':![],'where':{'id':_0x48916d['params']['id']}},_0xe1c278={};_0xe1c278[_0x4ff2('0x2f')]=_[_0x4ff2('0x2e')](db[_0x4ff2('0x2a')]['rawAttributes']);_0xe1c278[_0x4ff2('0x2d')]=_[_0x4ff2('0x2e')](_0x48916d[_0x4ff2('0x2d')]);_0xe1c278['filters']=_['intersection'](_0xe1c278['model'],_0xe1c278[_0x4ff2('0x2d')]);_0x352d8c[_0x4ff2('0x32')]=_[_0x4ff2('0x30')](_0xe1c278[_0x4ff2('0x2f')],qs[_0x4ff2('0x31')](_0x48916d[_0x4ff2('0x2d')]['fields']));_0x352d8c[_0x4ff2('0x32')]=_0x352d8c[_0x4ff2('0x32')]['length']?_0x352d8c[_0x4ff2('0x32')]:_0xe1c278[_0x4ff2('0x2f')];if(_0x48916d[_0x4ff2('0x2d')][_0x4ff2('0x3c')]){_0x352d8c[_0x4ff2('0x3d')]=[{'all':!![]}];}_0x352d8c=_[_0x4ff2('0x38')]({},_0x352d8c,_0x48916d[_0x4ff2('0x3b')]);return db[_0x4ff2('0x2a')][_0x4ff2('0x40')](_0x352d8c)[_0x4ff2('0x22')](handleEntityNotFound(_0x137014,null))[_0x4ff2('0x22')](respondWithResult(_0x137014,null))[_0x4ff2('0x41')](handleError(_0x137014,null));};exports[_0x4ff2('0x42')]=function(_0x1b4f7f,_0x10a447){return db['VtigerConfiguration'][_0x4ff2('0x42')](_0x1b4f7f['body'],{})[_0x4ff2('0x22')](respondWithResult(_0x10a447,0xc9))['catch'](handleError(_0x10a447,null));};exports[_0x4ff2('0x43')]=function(_0x54c517,_0x205176){if(_0x54c517[_0x4ff2('0x44')]['id']){delete _0x54c517[_0x4ff2('0x44')]['id'];}return db[_0x4ff2('0x2a')][_0x4ff2('0x40')]({'where':{'id':_0x54c517[_0x4ff2('0x45')]['id']}})[_0x4ff2('0x22')](handleEntityNotFound(_0x205176,null))['then'](saveUpdates(_0x54c517[_0x4ff2('0x44')],null))[_0x4ff2('0x22')](respondWithResult(_0x205176,null))['catch'](handleError(_0x205176,null));};exports[_0x4ff2('0x23')]=function(_0x31db0b,_0x3f0313){return db[_0x4ff2('0x2a')][_0x4ff2('0x40')]({'where':{'id':_0x31db0b[_0x4ff2('0x45')]['id']}})[_0x4ff2('0x22')](handleEntityNotFound(_0x3f0313,null))[_0x4ff2('0x22')](removeEntity(_0x3f0313,null))[_0x4ff2('0x41')](handleError(_0x3f0313,null));};exports['getFields']=function(_0x3c5ab8,_0x57adc7,_0x5d6062){var _0x5959cf={};var _0x3840f4={};var _0x107e39;var _0x48f725;return db[_0x4ff2('0x2a')]['findOne']({'where':{'id':_0x3c5ab8['params']['id']}})[_0x4ff2('0x22')](handleEntityNotFound(_0x57adc7,null))[_0x4ff2('0x22')](function(_0xc5ec96){if(_0xc5ec96){_0x107e39=_0xc5ec96;_0x3840f4['model']=_[_0x4ff2('0x2e')](db['VtigerField'][_0x4ff2('0x2b')]);_0x3840f4[_0x4ff2('0x2d')]=_[_0x4ff2('0x2e')](_0x3c5ab8[_0x4ff2('0x2d')]);_0x3840f4[_0x4ff2('0x36')]=_[_0x4ff2('0x30')](_0x3840f4[_0x4ff2('0x2f')],_0x3840f4[_0x4ff2('0x2d')]);_0x5959cf[_0x4ff2('0x32')]=_[_0x4ff2('0x30')](_0x3840f4[_0x4ff2('0x2f')],qs[_0x4ff2('0x31')](_0x3c5ab8[_0x4ff2('0x2d')][_0x4ff2('0x31')]));_0x5959cf[_0x4ff2('0x32')]=_0x5959cf['attributes'][_0x4ff2('0x33')]?_0x5959cf[_0x4ff2('0x32')]:_0x3840f4['model'];_0x5959cf['order']=qs[_0x4ff2('0x35')](_0x3c5ab8[_0x4ff2('0x2d')][_0x4ff2('0x35')]);_0x5959cf[_0x4ff2('0x37')]=qs[_0x4ff2('0x36')](_['pick'](_0x3c5ab8['query'],_0x3840f4[_0x4ff2('0x36')]));if(_0x3c5ab8[_0x4ff2('0x2d')][_0x4ff2('0x3a')]){_0x5959cf[_0x4ff2('0x37')]=_[_0x4ff2('0x38')](_0x5959cf['where'],{'$or':_[_0x4ff2('0x29')](_0x5959cf['attributes'],function(_0x1e37f6){var _0x41b7f9={};_0x41b7f9[_0x1e37f6]={'$like':'%'+_0x3c5ab8[_0x4ff2('0x2d')][_0x4ff2('0x3a')]+'%'};return _0x41b7f9;})});}_0x5959cf=_[_0x4ff2('0x38')]({},_0x5959cf,_0x3c5ab8[_0x4ff2('0x3b')]);return _0x107e39[_0x4ff2('0x46')](_0x5959cf);}})[_0x4ff2('0x22')](function(_0x423c70){if(_0x423c70){_0x48f725=_0x423c70[_0x4ff2('0x33')];if(!_0x3c5ab8['query']['hasOwnProperty'](_0x4ff2('0x34'))){_0x5959cf[_0x4ff2('0x1a')]=qs[_0x4ff2('0x1a')](_0x3c5ab8[_0x4ff2('0x2d')][_0x4ff2('0x1a')]);_0x5959cf[_0x4ff2('0x19')]=qs[_0x4ff2('0x19')](_0x3c5ab8[_0x4ff2('0x2d')]['offset']);}return _0x107e39['getFields'](_0x5959cf);}})['then'](function(_0x57fd3d){if(_0x57fd3d){return _0x57fd3d?{'count':_0x48f725,'rows':_0x57fd3d}:null;}})[_0x4ff2('0x22')](respondWithResult(_0x57adc7,null))[_0x4ff2('0x41')](handleError(_0x57adc7,null));};exports[_0x4ff2('0x47')]=function(_0x472767,_0x469d71,_0x487396){var _0x22ec5b={};var _0x4ea60a={};var _0x4e4b0f;var _0x43c082;return db['VtigerConfiguration'][_0x4ff2('0x48')]({'where':{'id':_0x472767[_0x4ff2('0x45')]['id']}})[_0x4ff2('0x22')](handleEntityNotFound(_0x469d71,null))[_0x4ff2('0x22')](function(_0x1c21c5){if(_0x1c21c5){_0x4e4b0f=_0x1c21c5;_0x4ea60a[_0x4ff2('0x2f')]=_[_0x4ff2('0x2e')](db[_0x4ff2('0x49')][_0x4ff2('0x2b')]);_0x4ea60a[_0x4ff2('0x2d')]=_[_0x4ff2('0x2e')](_0x472767['query']);_0x4ea60a[_0x4ff2('0x36')]=_[_0x4ff2('0x30')](_0x4ea60a['model'],_0x4ea60a[_0x4ff2('0x2d')]);_0x22ec5b[_0x4ff2('0x32')]=_['intersection'](_0x4ea60a[_0x4ff2('0x2f')],qs[_0x4ff2('0x31')](_0x472767[_0x4ff2('0x2d')]['fields']));_0x22ec5b[_0x4ff2('0x32')]=_0x22ec5b[_0x4ff2('0x32')][_0x4ff2('0x33')]?_0x22ec5b[_0x4ff2('0x32')]:_0x4ea60a[_0x4ff2('0x2f')];_0x22ec5b[_0x4ff2('0x4a')]=qs['sort'](_0x472767[_0x4ff2('0x2d')]['sort']);_0x22ec5b[_0x4ff2('0x37')]=qs[_0x4ff2('0x36')](_['pick'](_0x472767[_0x4ff2('0x2d')],_0x4ea60a['filters']));if(_0x472767[_0x4ff2('0x2d')][_0x4ff2('0x3a')]){_0x22ec5b[_0x4ff2('0x37')]=_[_0x4ff2('0x38')](_0x22ec5b[_0x4ff2('0x37')],{'$or':_[_0x4ff2('0x29')](_0x22ec5b[_0x4ff2('0x32')],function(_0x32ba8d){var _0x29ee38={};_0x29ee38[_0x32ba8d]={'$like':'%'+_0x472767[_0x4ff2('0x2d')][_0x4ff2('0x3a')]+'%'};return _0x29ee38;})});}_0x22ec5b=_[_0x4ff2('0x38')]({},_0x22ec5b,_0x472767[_0x4ff2('0x3b')]);return _0x4e4b0f['getSubjects'](_0x22ec5b);}})[_0x4ff2('0x22')](function(_0x4c0b52){if(_0x4c0b52){_0x43c082=_0x4c0b52['length'];if(!_0x472767['query']['hasOwnProperty'](_0x4ff2('0x34'))){_0x22ec5b[_0x4ff2('0x1a')]=qs[_0x4ff2('0x1a')](_0x472767[_0x4ff2('0x2d')][_0x4ff2('0x1a')]);_0x22ec5b[_0x4ff2('0x19')]=qs[_0x4ff2('0x19')](_0x472767[_0x4ff2('0x2d')][_0x4ff2('0x19')]);}return _0x4e4b0f[_0x4ff2('0x47')](_0x22ec5b);}})[_0x4ff2('0x22')](function(_0x3e761d){if(_0x3e761d){return _0x3e761d?{'count':_0x43c082,'rows':_0x3e761d}:null;}})[_0x4ff2('0x22')](respondWithResult(_0x469d71,null))[_0x4ff2('0x41')](handleError(_0x469d71,null));};exports['getDescriptions']=function(_0x5bb84a,_0x2cc2de,_0x640795){var _0xece6df={};var _0x35b4cb={};var _0x24d58f;var _0x31ebd3;return db[_0x4ff2('0x2a')][_0x4ff2('0x48')]({'where':{'id':_0x5bb84a[_0x4ff2('0x45')]['id']}})['then'](handleEntityNotFound(_0x2cc2de,null))[_0x4ff2('0x22')](function(_0x56fddf){if(_0x56fddf){_0x24d58f=_0x56fddf;_0x35b4cb[_0x4ff2('0x2f')]=_['keys'](db[_0x4ff2('0x49')][_0x4ff2('0x2b')]);_0x35b4cb[_0x4ff2('0x2d')]=_[_0x4ff2('0x2e')](_0x5bb84a[_0x4ff2('0x2d')]);_0x35b4cb['filters']=_[_0x4ff2('0x30')](_0x35b4cb[_0x4ff2('0x2f')],_0x35b4cb[_0x4ff2('0x2d')]);_0xece6df[_0x4ff2('0x32')]=_['intersection'](_0x35b4cb[_0x4ff2('0x2f')],qs[_0x4ff2('0x31')](_0x5bb84a[_0x4ff2('0x2d')][_0x4ff2('0x31')]));_0xece6df[_0x4ff2('0x32')]=_0xece6df[_0x4ff2('0x32')]['length']?_0xece6df[_0x4ff2('0x32')]:_0x35b4cb[_0x4ff2('0x2f')];_0xece6df[_0x4ff2('0x4a')]=qs[_0x4ff2('0x35')](_0x5bb84a[_0x4ff2('0x2d')]['sort']);_0xece6df[_0x4ff2('0x37')]=qs[_0x4ff2('0x36')](_['pick'](_0x5bb84a[_0x4ff2('0x2d')],_0x35b4cb[_0x4ff2('0x36')]));if(_0x5bb84a[_0x4ff2('0x2d')][_0x4ff2('0x3a')]){_0xece6df['where']=_['merge'](_0xece6df[_0x4ff2('0x37')],{'$or':_[_0x4ff2('0x29')](_0xece6df[_0x4ff2('0x32')],function(_0x3fb481){var _0xfac7b6={};_0xfac7b6[_0x3fb481]={'$like':'%'+_0x5bb84a[_0x4ff2('0x2d')][_0x4ff2('0x3a')]+'%'};return _0xfac7b6;})});}_0xece6df=_[_0x4ff2('0x38')]({},_0xece6df,_0x5bb84a[_0x4ff2('0x3b')]);return _0x24d58f[_0x4ff2('0x4b')](_0xece6df);}})[_0x4ff2('0x22')](function(_0x59b42c){if(_0x59b42c){_0x31ebd3=_0x59b42c[_0x4ff2('0x33')];if(!_0x5bb84a[_0x4ff2('0x2d')]['hasOwnProperty'](_0x4ff2('0x34'))){_0xece6df['limit']=qs[_0x4ff2('0x1a')](_0x5bb84a[_0x4ff2('0x2d')][_0x4ff2('0x1a')]);_0xece6df[_0x4ff2('0x19')]=qs[_0x4ff2('0x19')](_0x5bb84a[_0x4ff2('0x2d')][_0x4ff2('0x19')]);}return _0x24d58f[_0x4ff2('0x4b')](_0xece6df);}})[_0x4ff2('0x22')](function(_0x8c34bf){if(_0x8c34bf){return _0x8c34bf?{'count':_0x31ebd3,'rows':_0x8c34bf}:null;}})[_0x4ff2('0x22')](respondWithResult(_0x2cc2de,null))[_0x4ff2('0x41')](handleError(_0x2cc2de,null));};
\ No newline at end of file
+var _0x9f3a=['sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','send','VtigerConfiguration','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','length','nolimit','sort','where','pick','merge','VIRTUAL','options','rows','show','keys','fields','includeAll','include','find','create','body','catch','params','getFields','VtigerField','filter','getSubjects','findOne','hasOwnProperty','order','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1f19d8,_0x5c5032){var _0x3adeb7=function(_0x5ccf58){while(--_0x5ccf58){_0x1f19d8['push'](_0x1f19d8['shift']());}};_0x3adeb7(++_0x5c5032);}(_0x9f3a,0xcc));var _0xa9f3=function(_0x5d31f3,_0x4239b0){_0x5d31f3=_0x5d31f3-0x0;var _0x1cc88c=_0x9f3a[_0x5d31f3];return _0x1cc88c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa9f3('0x0'));var zipdir=require(_0xa9f3('0x1'));var jsonpatch=require(_0xa9f3('0x2'));var rp=require(_0xa9f3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xa9f3('0x4'));var csv=require(_0xa9f3('0x5'));var ejs=require(_0xa9f3('0x6'));var fs=require('fs');var fs_extra=require(_0xa9f3('0x7'));var _=require(_0xa9f3('0x8'));var squel=require(_0xa9f3('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa9f3('0x5'));var querystring=require(_0xa9f3('0xa'));var Papa=require(_0xa9f3('0xb'));var Redis=require(_0xa9f3('0xc'));var authService=require(_0xa9f3('0xd'));var qs=require(_0xa9f3('0xe'));var as=require(_0xa9f3('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9f3('0x10'))('api');var utils=require(_0xa9f3('0x11'));var config=require(_0xa9f3('0x12'));var licenseUtil=require(_0xa9f3('0x13'));var db=require(_0xa9f3('0x14'))['db'];function respondWithStatusCode(_0x5714b0,_0x3f68b4){_0x3f68b4=_0x3f68b4||0xcc;return function(_0x566ab4){if(_0x566ab4){return _0x5714b0[_0xa9f3('0x15')](_0x3f68b4);}return _0x5714b0[_0xa9f3('0x16')](_0x3f68b4)[_0xa9f3('0x17')]();};}function respondWithResult(_0x4f8714,_0x28c97e){_0x28c97e=_0x28c97e||0xc8;return function(_0x414cdf){if(_0x414cdf){return _0x4f8714[_0xa9f3('0x16')](_0x28c97e)[_0xa9f3('0x18')](_0x414cdf);}};}function respondWithFilteredResult(_0x516bee,_0xfb0537){return function(_0x8e6e54){if(_0x8e6e54){var _0xb814f5=typeof _0xfb0537['offset']==='undefined'&&typeof _0xfb0537[_0xa9f3('0x19')]==='undefined';var _0x180471=_0x8e6e54[_0xa9f3('0x1a')];var _0x5c2e5e=_0xb814f5?0x0:_0xfb0537[_0xa9f3('0x1b')];var _0x24aba7=_0xb814f5?_0x8e6e54[_0xa9f3('0x1a')]:_0xfb0537[_0xa9f3('0x1b')]+_0xfb0537[_0xa9f3('0x19')];var _0x6e6236;if(_0x24aba7>=_0x180471){_0x24aba7=_0x180471;_0x6e6236=0xc8;}else{_0x6e6236=0xce;}_0x516bee[_0xa9f3('0x16')](_0x6e6236);return _0x516bee[_0xa9f3('0x1c')](_0xa9f3('0x1d'),_0x5c2e5e+'-'+_0x24aba7+'/'+_0x180471)['json'](_0x8e6e54);}return null;};}function patchUpdates(_0x34778f){return function(_0x2b2ed8){try{jsonpatch[_0xa9f3('0x1e')](_0x2b2ed8,_0x34778f,!![]);}catch(_0xde9bc3){return BPromise['reject'](_0xde9bc3);}return _0x2b2ed8['save']();};}function saveUpdates(_0x5bde31,_0xf392b4){return function(_0x5ef6c4){if(_0x5ef6c4){return _0x5ef6c4[_0xa9f3('0x1f')](_0x5bde31)[_0xa9f3('0x20')](function(_0x1cd8b4){return _0x1cd8b4;});}return null;};}function removeEntity(_0x1ce40c,_0x32e958){return function(_0x1a569b){if(_0x1a569b){return _0x1a569b[_0xa9f3('0x21')]()[_0xa9f3('0x20')](function(){_0x1ce40c[_0xa9f3('0x16')](0xcc)[_0xa9f3('0x17')]();});}};}function handleEntityNotFound(_0x308096,_0x47d1e1){return function(_0x21e5aa){if(!_0x21e5aa){_0x308096[_0xa9f3('0x15')](0x194);}return _0x21e5aa;};}function handleError(_0x129233,_0x1e4c07){_0x1e4c07=_0x1e4c07||0x1f4;return function(_0x24b170){logger['error'](_0x24b170[_0xa9f3('0x22')]);if(_0x24b170[_0xa9f3('0x23')]){delete _0x24b170['name'];}_0x129233[_0xa9f3('0x16')](_0x1e4c07)[_0xa9f3('0x24')](_0x24b170);};}exports['index']=function(_0x35f896,_0x5b0140){var _0xc03613={},_0x34c479={},_0x5a8f4d={'count':0x0,'rows':[]};var _0x59741b=_['map'](db[_0xa9f3('0x25')][_0xa9f3('0x26')],function(_0x39d426){return{'name':_0x39d426[_0xa9f3('0x27')],'type':_0x39d426[_0xa9f3('0x28')][_0xa9f3('0x29')]};});_0x34c479['model']=_[_0xa9f3('0x2a')](_0x59741b,_0xa9f3('0x23'));_0x34c479[_0xa9f3('0x2b')]=_['keys'](_0x35f896[_0xa9f3('0x2b')]);_0x34c479[_0xa9f3('0x2c')]=_[_0xa9f3('0x2d')](_0x34c479['model'],_0x34c479[_0xa9f3('0x2b')]);_0xc03613[_0xa9f3('0x2e')]=_[_0xa9f3('0x2d')](_0x34c479[_0xa9f3('0x2f')],qs['fields'](_0x35f896['query']['fields']));_0xc03613['attributes']=_0xc03613['attributes'][_0xa9f3('0x30')]?_0xc03613['attributes']:_0x34c479[_0xa9f3('0x2f')];if(!_0x35f896['query']['hasOwnProperty'](_0xa9f3('0x31'))){_0xc03613[_0xa9f3('0x19')]=qs[_0xa9f3('0x19')](_0x35f896[_0xa9f3('0x2b')][_0xa9f3('0x19')]);_0xc03613[_0xa9f3('0x1b')]=qs[_0xa9f3('0x1b')](_0x35f896[_0xa9f3('0x2b')][_0xa9f3('0x1b')]);}_0xc03613['order']=qs[_0xa9f3('0x32')](_0x35f896[_0xa9f3('0x2b')][_0xa9f3('0x32')]);_0xc03613[_0xa9f3('0x33')]=qs['filters'](_[_0xa9f3('0x34')](_0x35f896['query'],_0x34c479[_0xa9f3('0x2c')]),_0x59741b);if(_0x35f896['query']['filter']){_0xc03613[_0xa9f3('0x33')]=_[_0xa9f3('0x35')](_0xc03613['where'],{'$or':_[_0xa9f3('0x2a')](_0x59741b,function(_0x39999b){if(_0x39999b[_0xa9f3('0x28')]!==_0xa9f3('0x36')){var _0x25be8a={};_0x25be8a[_0x39999b[_0xa9f3('0x23')]]={'$like':'%'+_0x35f896[_0xa9f3('0x2b')]['filter']+'%'};return _0x25be8a;}})});}_0xc03613=_[_0xa9f3('0x35')]({},_0xc03613,_0x35f896[_0xa9f3('0x37')]);var _0x3c1ac8={'where':_0xc03613[_0xa9f3('0x33')]};return db[_0xa9f3('0x25')]['count'](_0x3c1ac8)[_0xa9f3('0x20')](function(_0x24d409){_0x5a8f4d[_0xa9f3('0x1a')]=_0x24d409;if(_0x35f896[_0xa9f3('0x2b')]['includeAll']){_0xc03613['include']=[{'all':!![]}];}return db[_0xa9f3('0x25')]['findAll'](_0xc03613);})[_0xa9f3('0x20')](function(_0x26857d){_0x5a8f4d[_0xa9f3('0x38')]=_0x26857d;return _0x5a8f4d;})['then'](respondWithFilteredResult(_0x5b0140,_0xc03613))['catch'](handleError(_0x5b0140,null));};exports[_0xa9f3('0x39')]=function(_0x4f9154,_0x118667){var _0x1697e2={'raw':![],'where':{'id':_0x4f9154['params']['id']}},_0x5d603d={};_0x5d603d[_0xa9f3('0x2f')]=_[_0xa9f3('0x3a')](db[_0xa9f3('0x25')]['rawAttributes']);_0x5d603d[_0xa9f3('0x2b')]=_['keys'](_0x4f9154[_0xa9f3('0x2b')]);_0x5d603d['filters']=_['intersection'](_0x5d603d[_0xa9f3('0x2f')],_0x5d603d[_0xa9f3('0x2b')]);_0x1697e2[_0xa9f3('0x2e')]=_[_0xa9f3('0x2d')](_0x5d603d[_0xa9f3('0x2f')],qs[_0xa9f3('0x3b')](_0x4f9154[_0xa9f3('0x2b')]['fields']));_0x1697e2[_0xa9f3('0x2e')]=_0x1697e2[_0xa9f3('0x2e')][_0xa9f3('0x30')]?_0x1697e2['attributes']:_0x5d603d[_0xa9f3('0x2f')];if(_0x4f9154[_0xa9f3('0x2b')][_0xa9f3('0x3c')]){_0x1697e2[_0xa9f3('0x3d')]=[{'all':!![]}];}_0x1697e2=_[_0xa9f3('0x35')]({},_0x1697e2,_0x4f9154[_0xa9f3('0x37')]);return db[_0xa9f3('0x25')][_0xa9f3('0x3e')](_0x1697e2)['then'](handleEntityNotFound(_0x118667,null))[_0xa9f3('0x20')](respondWithResult(_0x118667,null))['catch'](handleError(_0x118667,null));};exports[_0xa9f3('0x3f')]=function(_0x4197ec,_0x16c178){return db[_0xa9f3('0x25')][_0xa9f3('0x3f')](_0x4197ec[_0xa9f3('0x40')],{})[_0xa9f3('0x20')](respondWithResult(_0x16c178,0xc9))[_0xa9f3('0x41')](handleError(_0x16c178,null));};exports['update']=function(_0x3dc5c7,_0x3ed7a7){if(_0x3dc5c7[_0xa9f3('0x40')]['id']){delete _0x3dc5c7[_0xa9f3('0x40')]['id'];}return db[_0xa9f3('0x25')]['find']({'where':{'id':_0x3dc5c7[_0xa9f3('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ed7a7,null))[_0xa9f3('0x20')](saveUpdates(_0x3dc5c7[_0xa9f3('0x40')],null))['then'](respondWithResult(_0x3ed7a7,null))[_0xa9f3('0x41')](handleError(_0x3ed7a7,null));};exports[_0xa9f3('0x21')]=function(_0x19dd83,_0x488050){return db[_0xa9f3('0x25')][_0xa9f3('0x3e')]({'where':{'id':_0x19dd83['params']['id']}})[_0xa9f3('0x20')](handleEntityNotFound(_0x488050,null))[_0xa9f3('0x20')](removeEntity(_0x488050,null))['catch'](handleError(_0x488050,null));};exports[_0xa9f3('0x43')]=function(_0x9c51a0,_0x48070e,_0x5ee97c){var _0x5226e7={};var _0x282f90={};var _0x4ff35f;var _0x5abd85;return db[_0xa9f3('0x25')]['findOne']({'where':{'id':_0x9c51a0[_0xa9f3('0x42')]['id']}})[_0xa9f3('0x20')](handleEntityNotFound(_0x48070e,null))[_0xa9f3('0x20')](function(_0x442f12){if(_0x442f12){_0x4ff35f=_0x442f12;_0x282f90[_0xa9f3('0x2f')]=_[_0xa9f3('0x3a')](db[_0xa9f3('0x44')][_0xa9f3('0x26')]);_0x282f90[_0xa9f3('0x2b')]=_[_0xa9f3('0x3a')](_0x9c51a0[_0xa9f3('0x2b')]);_0x282f90[_0xa9f3('0x2c')]=_[_0xa9f3('0x2d')](_0x282f90[_0xa9f3('0x2f')],_0x282f90[_0xa9f3('0x2b')]);_0x5226e7['attributes']=_[_0xa9f3('0x2d')](_0x282f90[_0xa9f3('0x2f')],qs[_0xa9f3('0x3b')](_0x9c51a0[_0xa9f3('0x2b')][_0xa9f3('0x3b')]));_0x5226e7[_0xa9f3('0x2e')]=_0x5226e7[_0xa9f3('0x2e')][_0xa9f3('0x30')]?_0x5226e7[_0xa9f3('0x2e')]:_0x282f90[_0xa9f3('0x2f')];_0x5226e7['order']=qs['sort'](_0x9c51a0[_0xa9f3('0x2b')][_0xa9f3('0x32')]);_0x5226e7[_0xa9f3('0x33')]=qs[_0xa9f3('0x2c')](_[_0xa9f3('0x34')](_0x9c51a0['query'],_0x282f90[_0xa9f3('0x2c')]));if(_0x9c51a0[_0xa9f3('0x2b')][_0xa9f3('0x45')]){_0x5226e7[_0xa9f3('0x33')]=_[_0xa9f3('0x35')](_0x5226e7[_0xa9f3('0x33')],{'$or':_[_0xa9f3('0x2a')](_0x5226e7['attributes'],function(_0x545ad7){var _0x2edfc4={};_0x2edfc4[_0x545ad7]={'$like':'%'+_0x9c51a0[_0xa9f3('0x2b')]['filter']+'%'};return _0x2edfc4;})});}_0x5226e7=_[_0xa9f3('0x35')]({},_0x5226e7,_0x9c51a0['options']);return _0x4ff35f[_0xa9f3('0x43')](_0x5226e7);}})['then'](function(_0x241c01){if(_0x241c01){_0x5abd85=_0x241c01[_0xa9f3('0x30')];if(!_0x9c51a0[_0xa9f3('0x2b')]['hasOwnProperty'](_0xa9f3('0x31'))){_0x5226e7[_0xa9f3('0x19')]=qs[_0xa9f3('0x19')](_0x9c51a0['query'][_0xa9f3('0x19')]);_0x5226e7[_0xa9f3('0x1b')]=qs[_0xa9f3('0x1b')](_0x9c51a0[_0xa9f3('0x2b')][_0xa9f3('0x1b')]);}return _0x4ff35f[_0xa9f3('0x43')](_0x5226e7);}})[_0xa9f3('0x20')](function(_0x265361){if(_0x265361){return _0x265361?{'count':_0x5abd85,'rows':_0x265361}:null;}})['then'](respondWithResult(_0x48070e,null))[_0xa9f3('0x41')](handleError(_0x48070e,null));};exports[_0xa9f3('0x46')]=function(_0x3af6d0,_0x4c9d4a,_0x3d77d6){var _0x2cbbcc={};var _0x24c4f5={};var _0xe0d067;var _0x1ebeb6;return db[_0xa9f3('0x25')][_0xa9f3('0x47')]({'where':{'id':_0x3af6d0[_0xa9f3('0x42')]['id']}})['then'](handleEntityNotFound(_0x4c9d4a,null))[_0xa9f3('0x20')](function(_0x48fe47){if(_0x48fe47){_0xe0d067=_0x48fe47;_0x24c4f5[_0xa9f3('0x2f')]=_[_0xa9f3('0x3a')](db['VtigerField'][_0xa9f3('0x26')]);_0x24c4f5[_0xa9f3('0x2b')]=_[_0xa9f3('0x3a')](_0x3af6d0[_0xa9f3('0x2b')]);_0x24c4f5['filters']=_[_0xa9f3('0x2d')](_0x24c4f5['model'],_0x24c4f5[_0xa9f3('0x2b')]);_0x2cbbcc[_0xa9f3('0x2e')]=_[_0xa9f3('0x2d')](_0x24c4f5[_0xa9f3('0x2f')],qs['fields'](_0x3af6d0[_0xa9f3('0x2b')]['fields']));_0x2cbbcc[_0xa9f3('0x2e')]=_0x2cbbcc[_0xa9f3('0x2e')][_0xa9f3('0x30')]?_0x2cbbcc['attributes']:_0x24c4f5[_0xa9f3('0x2f')];_0x2cbbcc['order']=qs[_0xa9f3('0x32')](_0x3af6d0[_0xa9f3('0x2b')]['sort']);_0x2cbbcc['where']=qs[_0xa9f3('0x2c')](_['pick'](_0x3af6d0['query'],_0x24c4f5['filters']));if(_0x3af6d0[_0xa9f3('0x2b')][_0xa9f3('0x45')]){_0x2cbbcc[_0xa9f3('0x33')]=_[_0xa9f3('0x35')](_0x2cbbcc[_0xa9f3('0x33')],{'$or':_[_0xa9f3('0x2a')](_0x2cbbcc[_0xa9f3('0x2e')],function(_0x3767fb){var _0x4dd0e4={};_0x4dd0e4[_0x3767fb]={'$like':'%'+_0x3af6d0[_0xa9f3('0x2b')]['filter']+'%'};return _0x4dd0e4;})});}_0x2cbbcc=_['merge']({},_0x2cbbcc,_0x3af6d0[_0xa9f3('0x37')]);return _0xe0d067[_0xa9f3('0x46')](_0x2cbbcc);}})[_0xa9f3('0x20')](function(_0x508fa3){if(_0x508fa3){_0x1ebeb6=_0x508fa3[_0xa9f3('0x30')];if(!_0x3af6d0['query'][_0xa9f3('0x48')](_0xa9f3('0x31'))){_0x2cbbcc[_0xa9f3('0x19')]=qs[_0xa9f3('0x19')](_0x3af6d0[_0xa9f3('0x2b')][_0xa9f3('0x19')]);_0x2cbbcc[_0xa9f3('0x1b')]=qs[_0xa9f3('0x1b')](_0x3af6d0[_0xa9f3('0x2b')][_0xa9f3('0x1b')]);}return _0xe0d067[_0xa9f3('0x46')](_0x2cbbcc);}})[_0xa9f3('0x20')](function(_0x2fe243){if(_0x2fe243){return _0x2fe243?{'count':_0x1ebeb6,'rows':_0x2fe243}:null;}})[_0xa9f3('0x20')](respondWithResult(_0x4c9d4a,null))['catch'](handleError(_0x4c9d4a,null));};exports['getDescriptions']=function(_0x4aaef1,_0x3e4008,_0x350035){var _0x4d732f={};var _0x144749={};var _0x12d469;var _0x2bfc4d;return db[_0xa9f3('0x25')][_0xa9f3('0x47')]({'where':{'id':_0x4aaef1['params']['id']}})[_0xa9f3('0x20')](handleEntityNotFound(_0x3e4008,null))['then'](function(_0x216efc){if(_0x216efc){_0x12d469=_0x216efc;_0x144749[_0xa9f3('0x2f')]=_[_0xa9f3('0x3a')](db[_0xa9f3('0x44')][_0xa9f3('0x26')]);_0x144749[_0xa9f3('0x2b')]=_[_0xa9f3('0x3a')](_0x4aaef1['query']);_0x144749[_0xa9f3('0x2c')]=_[_0xa9f3('0x2d')](_0x144749['model'],_0x144749['query']);_0x4d732f[_0xa9f3('0x2e')]=_['intersection'](_0x144749['model'],qs[_0xa9f3('0x3b')](_0x4aaef1[_0xa9f3('0x2b')][_0xa9f3('0x3b')]));_0x4d732f['attributes']=_0x4d732f[_0xa9f3('0x2e')][_0xa9f3('0x30')]?_0x4d732f[_0xa9f3('0x2e')]:_0x144749[_0xa9f3('0x2f')];_0x4d732f[_0xa9f3('0x49')]=qs[_0xa9f3('0x32')](_0x4aaef1[_0xa9f3('0x2b')][_0xa9f3('0x32')]);_0x4d732f['where']=qs['filters'](_[_0xa9f3('0x34')](_0x4aaef1[_0xa9f3('0x2b')],_0x144749[_0xa9f3('0x2c')]));if(_0x4aaef1[_0xa9f3('0x2b')][_0xa9f3('0x45')]){_0x4d732f[_0xa9f3('0x33')]=_['merge'](_0x4d732f['where'],{'$or':_[_0xa9f3('0x2a')](_0x4d732f[_0xa9f3('0x2e')],function(_0x142e99){var _0x5de2cc={};_0x5de2cc[_0x142e99]={'$like':'%'+_0x4aaef1[_0xa9f3('0x2b')]['filter']+'%'};return _0x5de2cc;})});}_0x4d732f=_[_0xa9f3('0x35')]({},_0x4d732f,_0x4aaef1['options']);return _0x12d469[_0xa9f3('0x4a')](_0x4d732f);}})[_0xa9f3('0x20')](function(_0x28ff7e){if(_0x28ff7e){_0x2bfc4d=_0x28ff7e['length'];if(!_0x4aaef1[_0xa9f3('0x2b')][_0xa9f3('0x48')]('nolimit')){_0x4d732f[_0xa9f3('0x19')]=qs[_0xa9f3('0x19')](_0x4aaef1[_0xa9f3('0x2b')]['limit']);_0x4d732f[_0xa9f3('0x1b')]=qs[_0xa9f3('0x1b')](_0x4aaef1[_0xa9f3('0x2b')][_0xa9f3('0x1b')]);}return _0x12d469[_0xa9f3('0x4a')](_0x4d732f);}})['then'](function(_0x2b3752){if(_0x2b3752){return _0x2b3752?{'count':_0x2bfc4d,'rows':_0x2b3752}:null;}})[_0xa9f3('0x20')](respondWithResult(_0x3e4008,null))[_0xa9f3('0x41')](handleError(_0x3e4008,null));};
\ No newline at end of file
index c586db2..774c2f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb078=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3a7134,_0x35959d){var _0x4bedf8=function(_0x38bff7){while(--_0x38bff7){_0x3a7134['push'](_0x3a7134['shift']());}};_0x4bedf8(++_0x35959d);}(_0xb078,0x119));var _0x8b07=function(_0x1c08d2,_0x5eca10){_0x1c08d2=_0x1c08d2-0x0;var _0x4c979d=_0xb078[_0x1c08d2];return _0x4c979d;};'use strict';var _=require('lodash');var util=require(_0x8b07('0x0'));var logger=require(_0x8b07('0x1'))('api');var moment=require(_0x8b07('0x2'));var BPromise=require(_0x8b07('0x3'));var rp=require(_0x8b07('0x4'));var fs=require('fs');var path=require(_0x8b07('0x5'));var rimraf=require(_0x8b07('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b07('0x7'));module[_0x8b07('0x8')]=function(_0x8ee450,_0x2a53fc){return _0x8ee450[_0x8b07('0x9')](_0x8b07('0xa'),attributes,{'tableName':_0x8b07('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6b03=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x6287b6,_0x5682e7){var _0x5d6be4=function(_0x3e3975){while(--_0x3e3975){_0x6287b6['push'](_0x6287b6['shift']());}};_0x5d6be4(++_0x5682e7);}(_0x6b03,0x17f));var _0x36b0=function(_0x1f0e64,_0x5d8ca5){_0x1f0e64=_0x1f0e64-0x0;var _0x294176=_0x6b03[_0x1f0e64];return _0x294176;};'use strict';var _=require(_0x36b0('0x0'));var util=require('util');var logger=require(_0x36b0('0x1'))('api');var moment=require(_0x36b0('0x2'));var BPromise=require(_0x36b0('0x3'));var rp=require(_0x36b0('0x4'));var fs=require('fs');var path=require(_0x36b0('0x5'));var rimraf=require(_0x36b0('0x6'));var config=require(_0x36b0('0x7'));var attributes=require(_0x36b0('0x8'));module[_0x36b0('0x9')]=function(_0x488ee9,_0x3bc43a){return _0x488ee9[_0x36b0('0xa')](_0x36b0('0xb'),attributes,{'tableName':_0x36b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 29519bf..69bf706 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc2ff=['request','then','request\x20sent','debug','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','util','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1190e3,_0x5c6d16){var _0x2a1ab7=function(_0x235829){while(--_0x235829){_0x1190e3['push'](_0x1190e3['shift']());}};_0x2a1ab7(++_0x5c6d16);}(_0xc2ff,0xe1));var _0xfc2f=function(_0x5eb40b,_0x3fcd44){_0x5eb40b=_0x5eb40b-0x0;var _0x53f4e9=_0xc2ff[_0x5eb40b];return _0x53f4e9;};'use strict';var _=require('lodash');var util=require(_0xfc2f('0x0'));var moment=require(_0xfc2f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc2f('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc2f('0x3'))(_0xfc2f('0x4'));var config=require(_0xfc2f('0x5'));var jayson=require(_0xfc2f('0x6'));var client=jayson[_0xfc2f('0x7')][_0xfc2f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ef457,_0x4ba408,_0x3a715a){return new BPromise(function(_0x2a3254,_0x155a22){return client[_0xfc2f('0x9')](_0x5ef457,_0x3a715a)[_0xfc2f('0xa')](function(_0x2ff8d5){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x4ba408,_0xfc2f('0xb'));logger[_0xfc2f('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x4ba408,_0xfc2f('0xb'),JSON['stringify'](_0x2ff8d5));if(_0x2ff8d5[_0xfc2f('0xd')]){if(_0x2ff8d5[_0xfc2f('0xd')][_0xfc2f('0xe')]===0x1f4){logger[_0xfc2f('0xd')](_0xfc2f('0xf'),_0x4ba408,_0x2ff8d5['error'][_0xfc2f('0x10')]);return _0x155a22(_0x2ff8d5[_0xfc2f('0xd')][_0xfc2f('0x10')]);}logger[_0xfc2f('0xd')](_0xfc2f('0xf'),_0x4ba408,_0x2ff8d5[_0xfc2f('0xd')][_0xfc2f('0x10')]);return _0x2a3254(_0x2ff8d5['error'][_0xfc2f('0x10')]);}else{logger['info'](_0xfc2f('0xf'),_0x4ba408,_0xfc2f('0xb'));_0x2a3254(_0x2ff8d5[_0xfc2f('0x11')][_0xfc2f('0x10')]);}})['catch'](function(_0x15720f){logger['error'](_0xfc2f('0xf'),_0x4ba408,_0x15720f);_0x155a22(_0x15720f);});});}
\ No newline at end of file
+var _0xc045=['catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','VtigerConfiguration,\x20%s,\x20%s','result'];(function(_0x1d0456,_0x353c0b){var _0x1f4fbf=function(_0x21c62c){while(--_0x21c62c){_0x1d0456['push'](_0x1d0456['shift']());}};_0x1f4fbf(++_0x353c0b);}(_0xc045,0x1a3));var _0x5c04=function(_0x153ab3,_0x5c7acb){_0x153ab3=_0x153ab3-0x0;var _0x4e2455=_0xc045[_0x153ab3];return _0x4e2455;};'use strict';var _=require('lodash');var util=require(_0x5c04('0x0'));var moment=require('moment');var BPromise=require(_0x5c04('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c04('0x2'));var db=require(_0x5c04('0x3'))['db'];var utils=require(_0x5c04('0x4'));var logger=require(_0x5c04('0x5'))(_0x5c04('0x6'));var config=require(_0x5c04('0x7'));var jayson=require(_0x5c04('0x8'));var client=jayson[_0x5c04('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b06a7,_0x69ef6a,_0x59b140){return new BPromise(function(_0x49fa10,_0x42328d){return client[_0x5c04('0xa')](_0x1b06a7,_0x59b140)['then'](function(_0x20f6c0){logger[_0x5c04('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x69ef6a,_0x5c04('0xc'));logger[_0x5c04('0xd')](_0x5c04('0xe'),_0x69ef6a,_0x5c04('0xc'),JSON[_0x5c04('0xf')](_0x20f6c0));if(_0x20f6c0['error']){if(_0x20f6c0['error'][_0x5c04('0x10')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x69ef6a,_0x20f6c0[_0x5c04('0x11')][_0x5c04('0x12')]);return _0x42328d(_0x20f6c0['error'][_0x5c04('0x12')]);}logger['error'](_0x5c04('0x13'),_0x69ef6a,_0x20f6c0[_0x5c04('0x11')]['message']);return _0x49fa10(_0x20f6c0['error']['message']);}else{logger[_0x5c04('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x69ef6a,'request\x20sent');_0x49fa10(_0x20f6c0[_0x5c04('0x14')][_0x5c04('0x12')]);}})[_0x5c04('0x15')](function(_0x18eaf0){logger[_0x5c04('0x11')](_0x5c04('0x13'),_0x69ef6a,_0x18eaf0);_0x42328d(_0x18eaf0);});});}
\ No newline at end of file
index 9d2990b..1a4c20c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bf6=['isAuthenticated','index','/:id','post','create','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get'];(function(_0x49029d,_0x5a4ff1){var _0x5a0926=function(_0x515815){while(--_0x515815){_0x49029d['push'](_0x49029d['shift']());}};_0x5a0926(++_0x5a4ff1);}(_0x6bf6,0x184));var _0x66bf=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x6bf6[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require('multer');var util=require(_0x66bf('0x0'));var path=require(_0x66bf('0x1'));var timeout=require(_0x66bf('0x2'));var express=require(_0x66bf('0x3'));var router=express[_0x66bf('0x4')]();var fs_extra=require(_0x66bf('0x5'));var auth=require(_0x66bf('0x6'));var interaction=require(_0x66bf('0x7'));var config=require(_0x66bf('0x8'));var controller=require(_0x66bf('0x9'));router[_0x66bf('0xa')]('/',auth[_0x66bf('0xb')](),controller[_0x66bf('0xc')]);router[_0x66bf('0xa')](_0x66bf('0xd'),auth[_0x66bf('0xb')](),controller['show']);router[_0x66bf('0xe')]('/',auth[_0x66bf('0xb')](),controller[_0x66bf('0xf')]);router['put'](_0x66bf('0xd'),auth[_0x66bf('0xb')](),controller[_0x66bf('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x66bf('0x11')]);module[_0x66bf('0x12')]=router;
\ No newline at end of file
+var _0x42ce=['create','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x42ce,0x77));var _0xe42c=function(_0x133156,_0x109b02){_0x133156=_0x133156-0x0;var _0xb6d904=_0x42ce[_0x133156];return _0xb6d904;};'use strict';var multer=require(_0xe42c('0x0'));var util=require(_0xe42c('0x1'));var path=require(_0xe42c('0x2'));var timeout=require('connect-timeout');var express=require(_0xe42c('0x3'));var router=express[_0xe42c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe42c('0x5'));var interaction=require(_0xe42c('0x6'));var config=require(_0xe42c('0x7'));var controller=require('./intVtigerField.controller');router[_0xe42c('0x8')]('/',auth[_0xe42c('0x9')](),controller[_0xe42c('0xa')]);router[_0xe42c('0x8')](_0xe42c('0xb'),auth[_0xe42c('0x9')](),controller[_0xe42c('0xc')]);router[_0xe42c('0xd')]('/',auth[_0xe42c('0x9')](),controller[_0xe42c('0xe')]);router[_0xe42c('0xf')](_0xe42c('0xb'),auth[_0xe42c('0x9')](),controller['update']);router[_0xe42c('0x10')](_0xe42c('0xb'),auth[_0xe42c('0x9')](),controller[_0xe42c('0x11')]);module[_0xe42c('0x12')]=router;
\ No newline at end of file
index bdd4a07..40eee29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x048d=['keyValue','picklist','string','STRING','BOOLEAN','sequelize','ENUM','variable','customVariable'];(function(_0x334d1e,_0x28a488){var _0x3b33ba=function(_0x25afca){while(--_0x25afca){_0x334d1e['push'](_0x334d1e['shift']());}};_0x3b33ba(++_0x28a488);}(_0x048d,0x1b5));var _0xd048=function(_0x3daf3c,_0x2a7982){_0x3daf3c=_0x3daf3c-0x0;var _0x293126=_0x048d[_0x3daf3c];return _0x293126;};'use strict';var Sequelize=require(_0xd048('0x0'));module['exports']={'type':{'type':Sequelize[_0xd048('0x1')]('string',_0xd048('0x2'),_0xd048('0x3'),_0xd048('0x4'),_0xd048('0x5')),'defaultValue':_0xd048('0x6')},'content':{'type':Sequelize[_0xd048('0x7')]},'key':{'type':Sequelize[_0xd048('0x7')]},'keyType':{'type':Sequelize[_0xd048('0x1')](_0xd048('0x6'),_0xd048('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xd048('0x7')]},'idField':{'type':Sequelize[_0xd048('0x7')]},'nameField':{'type':Sequelize[_0xd048('0x7')]},'customField':{'type':Sequelize[_0xd048('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd048('0x7')]}};
\ No newline at end of file
+var _0x5547=['keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x4c4a86,_0x2d9f53){var _0x3ece53=function(_0xfed791){while(--_0xfed791){_0x4c4a86['push'](_0x4c4a86['shift']());}};_0x3ece53(++_0x2d9f53);}(_0x5547,0x1ab));var _0x7554=function(_0x3ce4a5,_0x50bc4b){_0x3ce4a5=_0x3ce4a5-0x0;var _0x3f5809=_0x5547[_0x3ce4a5];return _0x3f5809;};'use strict';var Sequelize=require(_0x7554('0x0'));module['exports']={'type':{'type':Sequelize[_0x7554('0x1')](_0x7554('0x2'),_0x7554('0x3'),_0x7554('0x4'),_0x7554('0x5'),_0x7554('0x6')),'defaultValue':_0x7554('0x2')},'content':{'type':Sequelize[_0x7554('0x7')]},'key':{'type':Sequelize[_0x7554('0x7')]},'keyType':{'type':Sequelize[_0x7554('0x1')](_0x7554('0x2'),_0x7554('0x3'),_0x7554('0x4'))},'keyContent':{'type':Sequelize[_0x7554('0x7')]},'idField':{'type':Sequelize[_0x7554('0x7')]},'nameField':{'type':Sequelize[_0x7554('0x7')]},'customField':{'type':Sequelize[_0x7554('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7554('0x7')]}};
\ No newline at end of file
index 3dd05df..aca9767 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd321=['VtigerField','type','key','model','map','keys','filters','query','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','fields','length','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index'];(function(_0x3c5a41,_0x558b2c){var _0x5389f5=function(_0x161ae3){while(--_0x161ae3){_0x3c5a41['push'](_0x3c5a41['shift']());}};_0x5389f5(++_0x558b2c);}(_0xd321,0x1cf));var _0x1d32=function(_0x9ce40c,_0x5ea968){_0x9ce40c=_0x9ce40c-0x0;var _0x2ef180=_0xd321[_0x9ce40c];return _0x2ef180;};'use strict';var emlformat=require(_0x1d32('0x0'));var rimraf=require(_0x1d32('0x1'));var zipdir=require(_0x1d32('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d32('0x3'));var moment=require(_0x1d32('0x4'));var BPromise=require(_0x1d32('0x5'));var Mustache=require(_0x1d32('0x6'));var util=require('util');var path=require(_0x1d32('0x7'));var sox=require(_0x1d32('0x8'));var csv=require(_0x1d32('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d32('0xa'));var squel=require('squel');var crypto=require(_0x1d32('0xb'));var jsforce=require(_0x1d32('0xc'));var deskjs=require(_0x1d32('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1d32('0xe'));var Papa=require('papaparse');var Redis=require(_0x1d32('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1d32('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d32('0x11'))(_0x1d32('0x12'));var utils=require(_0x1d32('0x13'));var config=require(_0x1d32('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x539232,_0xa3551c){_0xa3551c=_0xa3551c||0xcc;return function(_0x47b2ce){if(_0x47b2ce){return _0x539232[_0x1d32('0x15')](_0xa3551c);}return _0x539232['status'](_0xa3551c)[_0x1d32('0x16')]();};}function respondWithResult(_0x5bfff2,_0x28e363){_0x28e363=_0x28e363||0xc8;return function(_0x1057e1){if(_0x1057e1){return _0x5bfff2[_0x1d32('0x17')](_0x28e363)[_0x1d32('0x18')](_0x1057e1);}};}function respondWithFilteredResult(_0x503cef,_0x10171c){return function(_0x162588){if(_0x162588){var _0x4681b3=typeof _0x10171c[_0x1d32('0x19')]===_0x1d32('0x1a')&&typeof _0x10171c['limit']===_0x1d32('0x1a');var _0x40eebc=_0x162588[_0x1d32('0x1b')];var _0xd8a3f1=_0x4681b3?0x0:_0x10171c[_0x1d32('0x19')];var _0x4d30a6=_0x4681b3?_0x162588[_0x1d32('0x1b')]:_0x10171c[_0x1d32('0x19')]+_0x10171c[_0x1d32('0x1c')];var _0x136a35;if(_0x4d30a6>=_0x40eebc){_0x4d30a6=_0x40eebc;_0x136a35=0xc8;}else{_0x136a35=0xce;}_0x503cef[_0x1d32('0x17')](_0x136a35);return _0x503cef[_0x1d32('0x1d')](_0x1d32('0x1e'),_0xd8a3f1+'-'+_0x4d30a6+'/'+_0x40eebc)[_0x1d32('0x18')](_0x162588);}return null;};}function patchUpdates(_0x5edb79){return function(_0x363a60){try{jsonpatch[_0x1d32('0x1f')](_0x363a60,_0x5edb79,!![]);}catch(_0x113408){return BPromise[_0x1d32('0x20')](_0x113408);}return _0x363a60[_0x1d32('0x21')]();};}function saveUpdates(_0x4356d1,_0x4bc338){return function(_0x573da9){if(_0x573da9){return _0x573da9[_0x1d32('0x22')](_0x4356d1)['then'](function(_0x2ef2f7){return _0x2ef2f7;});}return null;};}function removeEntity(_0x249bc2,_0x5062e9){return function(_0x29d468){if(_0x29d468){return _0x29d468[_0x1d32('0x23')]()[_0x1d32('0x24')](function(){_0x249bc2[_0x1d32('0x17')](0xcc)[_0x1d32('0x16')]();});}};}function handleEntityNotFound(_0x513a32,_0x3b4aff){return function(_0x704c9d){if(!_0x704c9d){_0x513a32[_0x1d32('0x15')](0x194);}return _0x704c9d;};}function handleError(_0x3fe63c,_0xe60281){_0xe60281=_0xe60281||0x1f4;return function(_0x57d9cc){logger['error'](_0x57d9cc[_0x1d32('0x25')]);if(_0x57d9cc[_0x1d32('0x26')]){delete _0x57d9cc[_0x1d32('0x26')];}_0x3fe63c[_0x1d32('0x17')](_0xe60281)[_0x1d32('0x27')](_0x57d9cc);};}exports[_0x1d32('0x28')]=function(_0x26c226,_0x564b0a){var _0x3b03ca={},_0x580f7c={},_0x36c57f={'count':0x0,'rows':[]};var _0x6e6ea6=_['map'](db[_0x1d32('0x29')]['rawAttributes'],function(_0x58796f){return{'name':_0x58796f['fieldName'],'type':_0x58796f[_0x1d32('0x2a')][_0x1d32('0x2b')]};});_0x580f7c[_0x1d32('0x2c')]=_[_0x1d32('0x2d')](_0x6e6ea6,_0x1d32('0x26'));_0x580f7c['query']=_[_0x1d32('0x2e')](_0x26c226['query']);_0x580f7c[_0x1d32('0x2f')]=_['intersection'](_0x580f7c[_0x1d32('0x2c')],_0x580f7c[_0x1d32('0x30')]);_0x3b03ca[_0x1d32('0x31')]=_[_0x1d32('0x32')](_0x580f7c[_0x1d32('0x2c')],qs['fields'](_0x26c226['query']['fields']));_0x3b03ca[_0x1d32('0x31')]=_0x3b03ca[_0x1d32('0x31')]['length']?_0x3b03ca[_0x1d32('0x31')]:_0x580f7c[_0x1d32('0x2c')];if(!_0x26c226['query'][_0x1d32('0x33')](_0x1d32('0x34'))){_0x3b03ca['limit']=qs['limit'](_0x26c226[_0x1d32('0x30')][_0x1d32('0x1c')]);_0x3b03ca[_0x1d32('0x19')]=qs[_0x1d32('0x19')](_0x26c226[_0x1d32('0x30')][_0x1d32('0x19')]);}_0x3b03ca[_0x1d32('0x35')]=qs[_0x1d32('0x36')](_0x26c226[_0x1d32('0x30')]['sort']);_0x3b03ca[_0x1d32('0x37')]=qs[_0x1d32('0x2f')](_[_0x1d32('0x38')](_0x26c226[_0x1d32('0x30')],_0x580f7c[_0x1d32('0x2f')]),_0x6e6ea6);if(_0x26c226[_0x1d32('0x30')][_0x1d32('0x39')]){_0x3b03ca[_0x1d32('0x37')]=_[_0x1d32('0x3a')](_0x3b03ca[_0x1d32('0x37')],{'$or':_[_0x1d32('0x2d')](_0x6e6ea6,function(_0x5c8101){if(_0x5c8101[_0x1d32('0x2a')]!=='VIRTUAL'){var _0xc3a3b7={};_0xc3a3b7[_0x5c8101[_0x1d32('0x26')]]={'$like':'%'+_0x26c226[_0x1d32('0x30')][_0x1d32('0x39')]+'%'};return _0xc3a3b7;}})});}_0x3b03ca=_[_0x1d32('0x3a')]({},_0x3b03ca,_0x26c226[_0x1d32('0x3b')]);var _0x56d036={'where':_0x3b03ca[_0x1d32('0x37')]};return db[_0x1d32('0x29')][_0x1d32('0x1b')](_0x56d036)[_0x1d32('0x24')](function(_0x59ab6e){_0x36c57f[_0x1d32('0x1b')]=_0x59ab6e;if(_0x26c226[_0x1d32('0x30')][_0x1d32('0x3c')]){_0x3b03ca[_0x1d32('0x3d')]=[{'all':!![]}];}return db['VtigerField']['findAll'](_0x3b03ca);})[_0x1d32('0x24')](function(_0x1a9e84){_0x36c57f[_0x1d32('0x3e')]=_0x1a9e84;return _0x36c57f;})[_0x1d32('0x24')](respondWithFilteredResult(_0x564b0a,_0x3b03ca))[_0x1d32('0x3f')](handleError(_0x564b0a,null));};exports[_0x1d32('0x40')]=function(_0x59b739,_0xce4dc0){var _0x3944d5={'raw':!![],'where':{'id':_0x59b739[_0x1d32('0x41')]['id']}},_0x303bc9={};_0x303bc9[_0x1d32('0x2c')]=_['keys'](db['VtigerField'][_0x1d32('0x42')]);_0x303bc9[_0x1d32('0x30')]=_[_0x1d32('0x2e')](_0x59b739[_0x1d32('0x30')]);_0x303bc9['filters']=_[_0x1d32('0x32')](_0x303bc9[_0x1d32('0x2c')],_0x303bc9[_0x1d32('0x30')]);_0x3944d5[_0x1d32('0x31')]=_['intersection'](_0x303bc9[_0x1d32('0x2c')],qs[_0x1d32('0x43')](_0x59b739[_0x1d32('0x30')][_0x1d32('0x43')]));_0x3944d5['attributes']=_0x3944d5['attributes'][_0x1d32('0x44')]?_0x3944d5['attributes']:_0x303bc9[_0x1d32('0x2c')];if(_0x59b739['query'][_0x1d32('0x3c')]){_0x3944d5[_0x1d32('0x3d')]=[{'all':!![]}];}_0x3944d5=_[_0x1d32('0x3a')]({},_0x3944d5,_0x59b739[_0x1d32('0x3b')]);return db[_0x1d32('0x29')]['find'](_0x3944d5)[_0x1d32('0x24')](handleEntityNotFound(_0xce4dc0,null))[_0x1d32('0x24')](respondWithResult(_0xce4dc0,null))[_0x1d32('0x3f')](handleError(_0xce4dc0,null));};exports[_0x1d32('0x45')]=function(_0x5a17f0,_0x1e7f8e){return db[_0x1d32('0x29')][_0x1d32('0x45')](_0x5a17f0['body'],{})[_0x1d32('0x24')](respondWithResult(_0x1e7f8e,0xc9))[_0x1d32('0x3f')](handleError(_0x1e7f8e,null));};exports['update']=function(_0x4f5a0f,_0x1d9b8c){if(_0x4f5a0f['body']['id']){delete _0x4f5a0f['body']['id'];}return db[_0x1d32('0x29')]['find']({'where':{'id':_0x4f5a0f[_0x1d32('0x41')]['id']}})[_0x1d32('0x24')](handleEntityNotFound(_0x1d9b8c,null))[_0x1d32('0x24')](saveUpdates(_0x4f5a0f[_0x1d32('0x46')],null))[_0x1d32('0x24')](respondWithResult(_0x1d9b8c,null))[_0x1d32('0x3f')](handleError(_0x1d9b8c,null));};exports[_0x1d32('0x23')]=function(_0xb6decb,_0x152800){return db[_0x1d32('0x29')][_0x1d32('0x47')]({'where':{'id':_0xb6decb[_0x1d32('0x41')]['id']}})['then'](handleEntityNotFound(_0x152800,null))[_0x1d32('0x24')](removeEntity(_0x152800,null))['catch'](handleError(_0x152800,null));};
\ No newline at end of file
+var _0x3a7c=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','VtigerField','includeAll','include','rows','catch','params','rawAttributes','create','body','find','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','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','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','fieldName'];(function(_0x1daf09,_0x3e0a2f){var _0x12b53c=function(_0x29faab){while(--_0x29faab){_0x1daf09['push'](_0x1daf09['shift']());}};_0x12b53c(++_0x3e0a2f);}(_0x3a7c,0x6a));var _0xc3a7=function(_0x126f42,_0x57f1ad){_0x126f42=_0x126f42-0x0;var _0x219119=_0x3a7c[_0x126f42];return _0x219119;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3a7('0x0'));var zipdir=require(_0xc3a7('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc3a7('0x2'));var moment=require(_0xc3a7('0x3'));var BPromise=require(_0xc3a7('0x4'));var Mustache=require(_0xc3a7('0x5'));var util=require('util');var path=require(_0xc3a7('0x6'));var sox=require(_0xc3a7('0x7'));var csv=require('to-csv');var ejs=require(_0xc3a7('0x8'));var fs=require('fs');var fs_extra=require(_0xc3a7('0x9'));var _=require(_0xc3a7('0xa'));var squel=require(_0xc3a7('0xb'));var crypto=require(_0xc3a7('0xc'));var jsforce=require(_0xc3a7('0xd'));var deskjs=require(_0xc3a7('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc3a7('0xf'));var Papa=require(_0xc3a7('0x10'));var Redis=require(_0xc3a7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc3a7('0x12'));var as=require(_0xc3a7('0x13'));var hardwareService=require(_0xc3a7('0x14'));var logger=require(_0xc3a7('0x15'))(_0xc3a7('0x16'));var utils=require(_0xc3a7('0x17'));var config=require(_0xc3a7('0x18'));var licenseUtil=require(_0xc3a7('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1896f9,_0x3c0e32){_0x3c0e32=_0x3c0e32||0xcc;return function(_0x3dfad7){if(_0x3dfad7){return _0x1896f9[_0xc3a7('0x1a')](_0x3c0e32);}return _0x1896f9['status'](_0x3c0e32)[_0xc3a7('0x1b')]();};}function respondWithResult(_0x9cce96,_0x51d93e){_0x51d93e=_0x51d93e||0xc8;return function(_0x1adf90){if(_0x1adf90){return _0x9cce96['status'](_0x51d93e)[_0xc3a7('0x1c')](_0x1adf90);}};}function respondWithFilteredResult(_0x40caad,_0x2e7dc6){return function(_0x138d61){if(_0x138d61){var _0x27b00c=typeof _0x2e7dc6[_0xc3a7('0x1d')]===_0xc3a7('0x1e')&&typeof _0x2e7dc6[_0xc3a7('0x1f')]==='undefined';var _0xb9e743=_0x138d61[_0xc3a7('0x20')];var _0xdb8056=_0x27b00c?0x0:_0x2e7dc6['offset'];var _0xedd437=_0x27b00c?_0x138d61[_0xc3a7('0x20')]:_0x2e7dc6[_0xc3a7('0x1d')]+_0x2e7dc6['limit'];var _0x5ec295;if(_0xedd437>=_0xb9e743){_0xedd437=_0xb9e743;_0x5ec295=0xc8;}else{_0x5ec295=0xce;}_0x40caad[_0xc3a7('0x21')](_0x5ec295);return _0x40caad[_0xc3a7('0x22')](_0xc3a7('0x23'),_0xdb8056+'-'+_0xedd437+'/'+_0xb9e743)['json'](_0x138d61);}return null;};}function patchUpdates(_0x10db0){return function(_0x338fe1){try{jsonpatch[_0xc3a7('0x24')](_0x338fe1,_0x10db0,!![]);}catch(_0x3f8f4c){return BPromise[_0xc3a7('0x25')](_0x3f8f4c);}return _0x338fe1['save']();};}function saveUpdates(_0x2c4ac3,_0x290442){return function(_0x48179b){if(_0x48179b){return _0x48179b[_0xc3a7('0x26')](_0x2c4ac3)[_0xc3a7('0x27')](function(_0x40986d){return _0x40986d;});}return null;};}function removeEntity(_0x117222,_0x398c25){return function(_0x1a81ef){if(_0x1a81ef){return _0x1a81ef[_0xc3a7('0x28')]()['then'](function(){_0x117222[_0xc3a7('0x21')](0xcc)[_0xc3a7('0x1b')]();});}};}function handleEntityNotFound(_0x202121,_0x264e40){return function(_0x4831b6){if(!_0x4831b6){_0x202121[_0xc3a7('0x1a')](0x194);}return _0x4831b6;};}function handleError(_0x24fec6,_0xe371a5){_0xe371a5=_0xe371a5||0x1f4;return function(_0x42fbdb){logger[_0xc3a7('0x29')](_0x42fbdb[_0xc3a7('0x2a')]);if(_0x42fbdb['name']){delete _0x42fbdb[_0xc3a7('0x2b')];}_0x24fec6[_0xc3a7('0x21')](_0xe371a5)[_0xc3a7('0x2c')](_0x42fbdb);};}exports[_0xc3a7('0x2d')]=function(_0x34b59f,_0x3487b0){var _0x114d18={},_0x3d9b7e={},_0x2835d7={'count':0x0,'rows':[]};var _0x10750d=_[_0xc3a7('0x2e')](db['VtigerField']['rawAttributes'],function(_0x47b1eb){return{'name':_0x47b1eb[_0xc3a7('0x2f')],'type':_0x47b1eb[_0xc3a7('0x30')][_0xc3a7('0x31')]};});_0x3d9b7e[_0xc3a7('0x32')]=_[_0xc3a7('0x2e')](_0x10750d,_0xc3a7('0x2b'));_0x3d9b7e[_0xc3a7('0x33')]=_[_0xc3a7('0x34')](_0x34b59f[_0xc3a7('0x33')]);_0x3d9b7e[_0xc3a7('0x35')]=_[_0xc3a7('0x36')](_0x3d9b7e['model'],_0x3d9b7e[_0xc3a7('0x33')]);_0x114d18[_0xc3a7('0x37')]=_[_0xc3a7('0x36')](_0x3d9b7e[_0xc3a7('0x32')],qs[_0xc3a7('0x38')](_0x34b59f['query'][_0xc3a7('0x38')]));_0x114d18[_0xc3a7('0x37')]=_0x114d18['attributes'][_0xc3a7('0x39')]?_0x114d18[_0xc3a7('0x37')]:_0x3d9b7e[_0xc3a7('0x32')];if(!_0x34b59f['query'][_0xc3a7('0x3a')]('nolimit')){_0x114d18[_0xc3a7('0x1f')]=qs['limit'](_0x34b59f[_0xc3a7('0x33')][_0xc3a7('0x1f')]);_0x114d18[_0xc3a7('0x1d')]=qs['offset'](_0x34b59f[_0xc3a7('0x33')][_0xc3a7('0x1d')]);}_0x114d18[_0xc3a7('0x3b')]=qs[_0xc3a7('0x3c')](_0x34b59f['query'][_0xc3a7('0x3c')]);_0x114d18['where']=qs['filters'](_[_0xc3a7('0x3d')](_0x34b59f['query'],_0x3d9b7e[_0xc3a7('0x35')]),_0x10750d);if(_0x34b59f['query']['filter']){_0x114d18[_0xc3a7('0x3e')]=_[_0xc3a7('0x3f')](_0x114d18[_0xc3a7('0x3e')],{'$or':_[_0xc3a7('0x2e')](_0x10750d,function(_0x26ecad){if(_0x26ecad[_0xc3a7('0x30')]!==_0xc3a7('0x40')){var _0x46def0={};_0x46def0[_0x26ecad[_0xc3a7('0x2b')]]={'$like':'%'+_0x34b59f[_0xc3a7('0x33')][_0xc3a7('0x41')]+'%'};return _0x46def0;}})});}_0x114d18=_[_0xc3a7('0x3f')]({},_0x114d18,_0x34b59f[_0xc3a7('0x42')]);var _0x34946e={'where':_0x114d18[_0xc3a7('0x3e')]};return db[_0xc3a7('0x43')][_0xc3a7('0x20')](_0x34946e)[_0xc3a7('0x27')](function(_0x1fdd81){_0x2835d7[_0xc3a7('0x20')]=_0x1fdd81;if(_0x34b59f[_0xc3a7('0x33')][_0xc3a7('0x44')]){_0x114d18[_0xc3a7('0x45')]=[{'all':!![]}];}return db[_0xc3a7('0x43')]['findAll'](_0x114d18);})['then'](function(_0x5e62e9){_0x2835d7[_0xc3a7('0x46')]=_0x5e62e9;return _0x2835d7;})[_0xc3a7('0x27')](respondWithFilteredResult(_0x3487b0,_0x114d18))[_0xc3a7('0x47')](handleError(_0x3487b0,null));};exports['show']=function(_0x4e6095,_0x16b37b){var _0x307d73={'raw':!![],'where':{'id':_0x4e6095[_0xc3a7('0x48')]['id']}},_0x2a1743={};_0x2a1743[_0xc3a7('0x32')]=_[_0xc3a7('0x34')](db[_0xc3a7('0x43')][_0xc3a7('0x49')]);_0x2a1743[_0xc3a7('0x33')]=_['keys'](_0x4e6095[_0xc3a7('0x33')]);_0x2a1743['filters']=_[_0xc3a7('0x36')](_0x2a1743[_0xc3a7('0x32')],_0x2a1743['query']);_0x307d73['attributes']=_[_0xc3a7('0x36')](_0x2a1743['model'],qs[_0xc3a7('0x38')](_0x4e6095[_0xc3a7('0x33')][_0xc3a7('0x38')]));_0x307d73['attributes']=_0x307d73['attributes'][_0xc3a7('0x39')]?_0x307d73['attributes']:_0x2a1743[_0xc3a7('0x32')];if(_0x4e6095['query']['includeAll']){_0x307d73[_0xc3a7('0x45')]=[{'all':!![]}];}_0x307d73=_[_0xc3a7('0x3f')]({},_0x307d73,_0x4e6095[_0xc3a7('0x42')]);return db[_0xc3a7('0x43')]['find'](_0x307d73)[_0xc3a7('0x27')](handleEntityNotFound(_0x16b37b,null))[_0xc3a7('0x27')](respondWithResult(_0x16b37b,null))['catch'](handleError(_0x16b37b,null));};exports['create']=function(_0x276595,_0x535229){return db[_0xc3a7('0x43')][_0xc3a7('0x4a')](_0x276595[_0xc3a7('0x4b')],{})[_0xc3a7('0x27')](respondWithResult(_0x535229,0xc9))['catch'](handleError(_0x535229,null));};exports['update']=function(_0x3a1ca8,_0xeac996){if(_0x3a1ca8['body']['id']){delete _0x3a1ca8[_0xc3a7('0x4b')]['id'];}return db[_0xc3a7('0x43')][_0xc3a7('0x4c')]({'where':{'id':_0x3a1ca8['params']['id']}})['then'](handleEntityNotFound(_0xeac996,null))[_0xc3a7('0x27')](saveUpdates(_0x3a1ca8['body'],null))[_0xc3a7('0x27')](respondWithResult(_0xeac996,null))[_0xc3a7('0x47')](handleError(_0xeac996,null));};exports[_0xc3a7('0x28')]=function(_0x3c68e9,_0x117e6d){return db[_0xc3a7('0x43')][_0xc3a7('0x4c')]({'where':{'id':_0x3c68e9['params']['id']}})[_0xc3a7('0x27')](handleEntityNotFound(_0x117e6d,null))[_0xc3a7('0x27')](removeEntity(_0x117e6d,null))['catch'](handleError(_0x117e6d,null));};
\ No newline at end of file
index 42cd923..6406b87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe660=['request-promise','path','../../config/environment','define','VtigerField','int_vtiger_fields','idField','util','../../config/logger','api','moment','bluebird'];(function(_0x3eea50,_0x54d651){var _0x3f1f0e=function(_0x1f50f7){while(--_0x1f50f7){_0x3eea50['push'](_0x3eea50['shift']());}};_0x3f1f0e(++_0x54d651);}(_0xe660,0x97));var _0x0e66=function(_0x2300f2,_0x315c5f){_0x2300f2=_0x2300f2-0x0;var _0x6bd508=_0xe660[_0x2300f2];return _0x6bd508;};'use strict';var _=require('lodash');var util=require(_0x0e66('0x0'));var logger=require(_0x0e66('0x1'))(_0x0e66('0x2'));var moment=require(_0x0e66('0x3'));var BPromise=require(_0x0e66('0x4'));var rp=require(_0x0e66('0x5'));var fs=require('fs');var path=require(_0x0e66('0x6'));var rimraf=require('rimraf');var config=require(_0x0e66('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x503c04,_0x4949f9){return _0x503c04[_0x0e66('0x8')](_0x0e66('0x9'),attributes,{'tableName':_0x0e66('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x0e66('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d56=['exports','vtiger_unique_index','idField','FieldId','util','moment','path','../../config/environment','./intVtigerField.attributes'];(function(_0x94cefc,_0x601961){var _0x2b62cd=function(_0x2a0a30){while(--_0x2a0a30){_0x94cefc['push'](_0x94cefc['shift']());}};_0x2b62cd(++_0x601961);}(_0x1d56,0x163));var _0x61d5=function(_0x2bc454,_0x2b1ad5){_0x2bc454=_0x2bc454-0x0;var _0x4d6a07=_0x1d56[_0x2bc454];return _0x4d6a07;};'use strict';var _=require('lodash');var util=require(_0x61d5('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x61d5('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x61d5('0x2'));var rimraf=require('rimraf');var config=require(_0x61d5('0x3'));var attributes=require(_0x61d5('0x4'));module[_0x61d5('0x5')]=function(_0x8947fd,_0x3cb431){return _0x8947fd['define']('VtigerField',attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x61d5('0x6'),'fields':[_0x61d5('0x7'),_0x61d5('0x8')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index ad2df4c..3cc8f31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8bc9=['jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8bc9,0x1c3));var _0x98bc=function(_0x4ea609,_0x30cd0f){_0x4ea609=_0x4ea609-0x0;var _0x504146=_0x8bc9[_0x4ea609];return _0x504146;};'use strict';var _=require(_0x98bc('0x0'));var util=require(_0x98bc('0x1'));var moment=require('moment');var BPromise=require(_0x98bc('0x2'));var rs=require(_0x98bc('0x3'));var fs=require('fs');var Redis=require(_0x98bc('0x4'));var db=require(_0x98bc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x98bc('0x6'))(_0x98bc('0x7'));var config=require(_0x98bc('0x8'));var jayson=require(_0x98bc('0x9'));var client=jayson[_0x98bc('0xa')][_0x98bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31bc8a,_0x3bb921,_0x1d277a){return new BPromise(function(_0x1a6e5f,_0x40c817){return client[_0x98bc('0xc')](_0x31bc8a,_0x1d277a)[_0x98bc('0xd')](function(_0x150986){logger[_0x98bc('0xe')](_0x98bc('0xf'),_0x3bb921,_0x98bc('0x10'));logger[_0x98bc('0x11')](_0x98bc('0x12'),_0x3bb921,_0x98bc('0x10'),JSON['stringify'](_0x150986));if(_0x150986[_0x98bc('0x13')]){if(_0x150986[_0x98bc('0x13')][_0x98bc('0x14')]===0x1f4){logger[_0x98bc('0x13')](_0x98bc('0xf'),_0x3bb921,_0x150986[_0x98bc('0x13')][_0x98bc('0x15')]);return _0x40c817(_0x150986[_0x98bc('0x13')][_0x98bc('0x15')]);}logger['error'](_0x98bc('0xf'),_0x3bb921,_0x150986[_0x98bc('0x13')]['message']);return _0x1a6e5f(_0x150986[_0x98bc('0x13')][_0x98bc('0x15')]);}else{logger[_0x98bc('0xe')](_0x98bc('0xf'),_0x3bb921,_0x98bc('0x10'));_0x1a6e5f(_0x150986['result']['message']);}})[_0x98bc('0x16')](function(_0x15b52c){logger[_0x98bc('0x13')]('VtigerField,\x20%s,\x20%s',_0x3bb921,_0x15b52c);_0x40c817(_0x15b52c);});});}
\ No newline at end of file
+var _0x27ba=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','debug','stringify','error','VtigerField,\x20%s,\x20%s','message','result','catch','util'];(function(_0x57265d,_0x31fa8b){var _0x1c4476=function(_0x3261a9){while(--_0x3261a9){_0x57265d['push'](_0x57265d['shift']());}};_0x1c4476(++_0x31fa8b);}(_0x27ba,0x1c7));var _0xa27b=function(_0x566500,_0x4e665a){_0x566500=_0x566500-0x0;var _0xb1aba7=_0x27ba[_0x566500];return _0xb1aba7;};'use strict';var _=require('lodash');var util=require(_0xa27b('0x0'));var moment=require('moment');var BPromise=require(_0xa27b('0x1'));var rs=require(_0xa27b('0x2'));var fs=require('fs');var Redis=require(_0xa27b('0x3'));var db=require(_0xa27b('0x4'))['db'];var utils=require(_0xa27b('0x5'));var logger=require(_0xa27b('0x6'))('rpc');var config=require(_0xa27b('0x7'));var jayson=require(_0xa27b('0x8'));var client=jayson['client'][_0xa27b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d1ee9,_0x3be3b4,_0x37634b){return new BPromise(function(_0x549ce7,_0x40d81b){return client['request'](_0x1d1ee9,_0x37634b)['then'](function(_0x4f3e1f){logger[_0xa27b('0xa')]('VtigerField,\x20%s,\x20%s',_0x3be3b4,_0xa27b('0xb'));logger[_0xa27b('0xc')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x3be3b4,_0xa27b('0xb'),JSON[_0xa27b('0xd')](_0x4f3e1f));if(_0x4f3e1f[_0xa27b('0xe')]){if(_0x4f3e1f[_0xa27b('0xe')]['code']===0x1f4){logger[_0xa27b('0xe')](_0xa27b('0xf'),_0x3be3b4,_0x4f3e1f[_0xa27b('0xe')]['message']);return _0x40d81b(_0x4f3e1f[_0xa27b('0xe')][_0xa27b('0x10')]);}logger[_0xa27b('0xe')](_0xa27b('0xf'),_0x3be3b4,_0x4f3e1f['error'][_0xa27b('0x10')]);return _0x549ce7(_0x4f3e1f[_0xa27b('0xe')][_0xa27b('0x10')]);}else{logger[_0xa27b('0xa')](_0xa27b('0xf'),_0x3be3b4,'request\x20sent');_0x549ce7(_0x4f3e1f[_0xa27b('0x11')][_0xa27b('0x10')]);}})[_0xa27b('0x12')](function(_0x2bc083){logger[_0xa27b('0xe')](_0xa27b('0xf'),_0x3be3b4,_0x2bc083);_0x40d81b(_0x2bc083);});});}
\ No newline at end of file
index e9df0c8..8d4635c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0867=['update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskAccount.controller','isAuthenticated','index','get','show','/:id/fields','getFields','post','create','/:id/configurations','put','/:id'];(function(_0x2867d8,_0xef3ee0){var _0x3b8176=function(_0x2b9eb8){while(--_0x2b9eb8){_0x2867d8['push'](_0x2867d8['shift']());}};_0x3b8176(++_0xef3ee0);}(_0x0867,0x72));var _0x7086=function(_0x3e8a7f,_0x14163d){_0x3e8a7f=_0x3e8a7f-0x0;var _0x10eade=_0x0867[_0x3e8a7f];return _0x10eade;};'use strict';var multer=require(_0x7086('0x0'));var util=require(_0x7086('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x7086('0x2')]();var fs_extra=require(_0x7086('0x3'));var auth=require(_0x7086('0x4'));var interaction=require(_0x7086('0x5'));var config=require('../../config/environment');var controller=require(_0x7086('0x6'));router['get']('/',auth[_0x7086('0x7')](),controller[_0x7086('0x8')]);router[_0x7086('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x7086('0xa')]);router['get']('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x7086('0x9')](_0x7086('0xb'),auth[_0x7086('0x7')](),controller[_0x7086('0xc')]);router[_0x7086('0xd')]('/',auth['isAuthenticated'](),controller[_0x7086('0xe')]);router[_0x7086('0xd')](_0x7086('0xf'),auth[_0x7086('0x7')](),controller['addConfiguration']);router[_0x7086('0x10')](_0x7086('0x11'),auth[_0x7086('0x7')](),controller[_0x7086('0x12')]);router[_0x7086('0x13')](_0x7086('0x11'),auth['isAuthenticated'](),controller[_0x7086('0x14')]);module[_0x7086('0x15')]=router;
\ No newline at end of file
+var _0x05e8=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','index','/:id','show','get','isAuthenticated','getConfigurations','create','post','/:id/configurations','addConfiguration','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x3bef2c,_0x5a86fd){var _0x331503=function(_0x463430){while(--_0x463430){_0x3bef2c['push'](_0x3bef2c['shift']());}};_0x331503(++_0x5a86fd);}(_0x05e8,0x1aa));var _0x805e=function(_0x3e496d,_0x134a3a){_0x3e496d=_0x3e496d-0x0;var _0x4aeada=_0x05e8[_0x3e496d];return _0x4aeada;};'use strict';var multer=require(_0x805e('0x0'));var util=require('util');var path=require(_0x805e('0x1'));var timeout=require(_0x805e('0x2'));var express=require(_0x805e('0x3'));var router=express[_0x805e('0x4')]();var fs_extra=require(_0x805e('0x5'));var auth=require(_0x805e('0x6'));var interaction=require(_0x805e('0x7'));var config=require(_0x805e('0x8'));var controller=require(_0x805e('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x805e('0xa')]);router['get'](_0x805e('0xb'),auth['isAuthenticated'](),controller[_0x805e('0xc')]);router[_0x805e('0xd')]('/:id/configurations',auth[_0x805e('0xe')](),controller[_0x805e('0xf')]);router['get']('/:id/fields',auth[_0x805e('0xe')](),controller['getFields']);router['post']('/',auth[_0x805e('0xe')](),controller[_0x805e('0x10')]);router[_0x805e('0x11')](_0x805e('0x12'),auth['isAuthenticated'](),controller[_0x805e('0x13')]);router['put']('/:id',auth[_0x805e('0xe')](),controller[_0x805e('0x14')]);router[_0x805e('0x15')](_0x805e('0xb'),auth[_0x805e('0xe')](),controller[_0x805e('0x16')]);module[_0x805e('0x17')]=router;
\ No newline at end of file
index 3dd9e0d..6551073 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba18=['sequelize','exports','STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab'];(function(_0xaaf1cc,_0x4f137d){var _0x1d0b4a=function(_0xa88a77){while(--_0xa88a77){_0xaaf1cc['push'](_0xaaf1cc['shift']());}};_0x1d0b4a(++_0x4f137d);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8ba1('0x0'));module[_0x8ba1('0x1')]={'name':{'type':Sequelize[_0x8ba1('0x2')]},'description':{'type':Sequelize[_0x8ba1('0x2')]},'username':{'type':Sequelize[_0x8ba1('0x2')],'unique':_0x8ba1('0x3')},'password':{'type':Sequelize[_0x8ba1('0x2')]},'token':{'type':Sequelize[_0x8ba1('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8ba1('0x4')},'authType':{'type':Sequelize[_0x8ba1('0x5')](_0x8ba1('0x6'),_0x8ba1('0x7')),'defaultValue':_0x8ba1('0x6')},'serverUrl':{'type':Sequelize[_0x8ba1('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8ba1('0x8'),_0x8ba1('0x9')),'defaultValue':'integrationTab'}};
\ No newline at end of file
+var _0xde81=['integrationTab','sequelize','exports','STRING','username','ENUM','password','token'];(function(_0x4f8e06,_0x3226b1){var _0x327dad=function(_0x4dced3){while(--_0x4dced3){_0x4f8e06['push'](_0x4f8e06['shift']());}};_0x327dad(++_0x3226b1);}(_0xde81,0x109));var _0x1de8=function(_0x222612,_0x57b680){_0x222612=_0x222612-0x0;var _0x576df2=_0xde81[_0x222612];return _0x576df2;};'use strict';var Sequelize=require(_0x1de8('0x0'));module[_0x1de8('0x1')]={'name':{'type':Sequelize[_0x1de8('0x2')]},'description':{'type':Sequelize[_0x1de8('0x2')]},'username':{'type':Sequelize[_0x1de8('0x2')],'unique':_0x1de8('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1de8('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x1de8('0x4')](_0x1de8('0x5'),_0x1de8('0x6')),'defaultValue':_0x1de8('0x5')},'serverUrl':{'type':Sequelize[_0x1de8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1de8('0x4')](_0x1de8('0x7'),'newTab'),'defaultValue':'integrationTab'}};
\ No newline at end of file
index eecf838..dc2a530 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ec6=['Sequelize','ValidationError','Unknown\x20authentication\x20type','description','remove','includes','title','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','body','findOne','ZendeskConfiguration','length','getConfigurations','addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','%s:%s','toString','base64','headers'];(function(_0x2c6f5a,_0x3a35aa){var _0x327de8=function(_0x21a9b0){while(--_0x21a9b0){_0x2c6f5a['push'](_0x2c6f5a['shift']());}};_0x327de8(++_0x3a35aa);}(_0x5ec6,0x7f));var _0x65ec=function(_0x201282,_0x44a1e0){_0x201282=_0x201282-0x0;var _0x23e600=_0x5ec6[_0x201282];return _0x23e600;};'use strict';var emlformat=require(_0x65ec('0x0'));var rimraf=require(_0x65ec('0x1'));var zipdir=require(_0x65ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ec('0x3'));var moment=require('moment');var BPromise=require(_0x65ec('0x4'));var Mustache=require('mustache');var util=require(_0x65ec('0x5'));var path=require('path');var sox=require(_0x65ec('0x6'));var csv=require('to-csv');var ejs=require(_0x65ec('0x7'));var fs=require('fs');var fs_extra=require(_0x65ec('0x8'));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('0xc'));var querystring=require(_0x65ec('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xf'));var hardwareService=require(_0x65ec('0x10'));var logger=require('../../config/logger')(_0x65ec('0x11'));var utils=require(_0x65ec('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x65ec('0x13'));var db=require(_0x65ec('0x14'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3e52c8,_0x2af7d6){_0x2af7d6=_0x2af7d6||0xcc;return function(_0x411a7b){if(_0x411a7b){return _0x3e52c8[_0x65ec('0x15')](_0x2af7d6);}return _0x3e52c8[_0x65ec('0x16')](_0x2af7d6)[_0x65ec('0x17')]();};}function respondWithResult(_0x344724,_0x3edbfd){_0x3edbfd=_0x3edbfd||0xc8;return function(_0x58c81f){if(_0x58c81f){return _0x344724[_0x65ec('0x16')](_0x3edbfd)[_0x65ec('0x18')](_0x58c81f);}};}function respondWithFilteredResult(_0x35d06b,_0x4bbe88){return function(_0x5a0442){if(_0x5a0442){var _0x25cdd4=typeof _0x4bbe88[_0x65ec('0x19')]===_0x65ec('0x1a')&&typeof _0x4bbe88['limit']===_0x65ec('0x1a');var _0x286eac=_0x5a0442[_0x65ec('0x1b')];var _0xb4ed90=_0x25cdd4?0x0:_0x4bbe88[_0x65ec('0x19')];var _0xd81ed3=_0x25cdd4?_0x5a0442[_0x65ec('0x1b')]:_0x4bbe88[_0x65ec('0x19')]+_0x4bbe88[_0x65ec('0x1c')];var _0x441ad0;if(_0xd81ed3>=_0x286eac){_0xd81ed3=_0x286eac;_0x441ad0=0xc8;}else{_0x441ad0=0xce;}_0x35d06b[_0x65ec('0x16')](_0x441ad0);return _0x35d06b[_0x65ec('0x1d')](_0x65ec('0x1e'),_0xb4ed90+'-'+_0xd81ed3+'/'+_0x286eac)[_0x65ec('0x18')](_0x5a0442);}return null;};}function patchUpdates(_0x3804a4){return function(_0x1d538c){try{jsonpatch[_0x65ec('0x1f')](_0x1d538c,_0x3804a4,!![]);}catch(_0x130d4e){return BPromise[_0x65ec('0x20')](_0x130d4e);}return _0x1d538c['save']();};}function saveUpdates(_0x170703,_0x297fba){return function(_0x89e640){if(_0x89e640){return _0x89e640[_0x65ec('0x21')](_0x170703)[_0x65ec('0x22')](function(_0x163e55){return _0x163e55;});}return null;};}function removeEntity(_0x47288d,_0x58239f){return function(_0xf1ff97){if(_0xf1ff97){return _0xf1ff97[_0x65ec('0x23')]()[_0x65ec('0x22')](function(){_0x47288d[_0x65ec('0x16')](0xcc)[_0x65ec('0x17')]();});}};}function handleEntityNotFound(_0x156793,_0x21426b){return function(_0xf5adc7){if(!_0xf5adc7){_0x156793[_0x65ec('0x15')](0x194);}return _0xf5adc7;};}function handleError(_0x4c846b,_0x10baef){_0x10baef=_0x10baef||0x1f4;return function(_0x30f0cf){logger[_0x65ec('0x24')](_0x30f0cf[_0x65ec('0x25')]);if(_0x30f0cf['name']){delete _0x30f0cf[_0x65ec('0x26')];}_0x4c846b['status'](_0x10baef)[_0x65ec('0x27')](_0x30f0cf);};}exports[_0x65ec('0x28')]=function(_0x1d0b5c,_0x30366c){var _0x14431d={},_0x46d4c1={},_0x46bf66={'count':0x0,'rows':[]};var _0x39410f=_[_0x65ec('0x29')](db[_0x65ec('0x2a')][_0x65ec('0x2b')],function(_0x4b435c){return{'name':_0x4b435c['fieldName'],'type':_0x4b435c[_0x65ec('0x2c')]['key']};});_0x46d4c1[_0x65ec('0x2d')]=_[_0x65ec('0x29')](_0x39410f,'name');_0x46d4c1[_0x65ec('0x2e')]=_[_0x65ec('0x2f')](_0x1d0b5c[_0x65ec('0x2e')]);_0x46d4c1[_0x65ec('0x30')]=_['intersection'](_0x46d4c1[_0x65ec('0x2d')],_0x46d4c1[_0x65ec('0x2e')]);_0x14431d[_0x65ec('0x31')]=_[_0x65ec('0x32')](_0x46d4c1[_0x65ec('0x2d')],qs[_0x65ec('0x33')](_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x14431d[_0x65ec('0x31')]=_0x14431d[_0x65ec('0x31')]['length']?_0x14431d[_0x65ec('0x31')]:_0x46d4c1[_0x65ec('0x2d')];if(!_0x1d0b5c['query'][_0x65ec('0x34')](_0x65ec('0x35'))){_0x14431d[_0x65ec('0x1c')]=qs[_0x65ec('0x1c')](_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x1c')]);_0x14431d[_0x65ec('0x19')]=qs['offset'](_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x19')]);}_0x14431d[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x1d0b5c['query'][_0x65ec('0x37')]);_0x14431d[_0x65ec('0x38')]=qs[_0x65ec('0x30')](_[_0x65ec('0x39')](_0x1d0b5c['query'],_0x46d4c1['filters']),_0x39410f);if(_0x1d0b5c[_0x65ec('0x2e')]['filter']){_0x14431d[_0x65ec('0x38')]=_[_0x65ec('0x3a')](_0x14431d['where'],{'$or':_[_0x65ec('0x29')](_0x39410f,function(_0x1fbc2b){if(_0x1fbc2b[_0x65ec('0x2c')]!==_0x65ec('0x3b')){var _0x3cffbf={};_0x3cffbf[_0x1fbc2b[_0x65ec('0x26')]]={'$like':'%'+_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x3c')]+'%'};return _0x3cffbf;}})});}_0x14431d=_[_0x65ec('0x3a')]({},_0x14431d,_0x1d0b5c[_0x65ec('0x3d')]);var _0x3561ef={'where':_0x14431d['where']};return db[_0x65ec('0x2a')]['count'](_0x3561ef)[_0x65ec('0x22')](function(_0x278d43){_0x46bf66[_0x65ec('0x1b')]=_0x278d43;if(_0x1d0b5c[_0x65ec('0x2e')][_0x65ec('0x3e')]){_0x14431d[_0x65ec('0x3f')]=[{'all':!![]}];}return db['ZendeskAccount'][_0x65ec('0x40')](_0x14431d);})['then'](function(_0x5d8d57){_0x46bf66[_0x65ec('0x41')]=_0x5d8d57;return _0x46bf66;})[_0x65ec('0x22')](respondWithFilteredResult(_0x30366c,_0x14431d))[_0x65ec('0x42')](handleError(_0x30366c,null));};exports[_0x65ec('0x43')]=function(_0x1d475e,_0x524235){var _0x4843ca={'raw':![],'where':{'id':_0x1d475e[_0x65ec('0x44')]['id']}},_0x1aef6d={};_0x1aef6d[_0x65ec('0x2d')]=_[_0x65ec('0x2f')](db[_0x65ec('0x2a')]['rawAttributes']);_0x1aef6d['query']=_[_0x65ec('0x2f')](_0x1d475e[_0x65ec('0x2e')]);_0x1aef6d[_0x65ec('0x30')]=_[_0x65ec('0x32')](_0x1aef6d[_0x65ec('0x2d')],_0x1aef6d[_0x65ec('0x2e')]);_0x4843ca[_0x65ec('0x31')]=_['intersection'](_0x1aef6d[_0x65ec('0x2d')],qs[_0x65ec('0x33')](_0x1d475e[_0x65ec('0x2e')]['fields']));_0x4843ca[_0x65ec('0x31')]=_0x4843ca[_0x65ec('0x31')]['length']?_0x4843ca[_0x65ec('0x31')]:_0x1aef6d[_0x65ec('0x2d')];if(_0x1d475e[_0x65ec('0x2e')][_0x65ec('0x3e')]){_0x4843ca[_0x65ec('0x3f')]=[{'all':!![]}];}_0x4843ca=_['merge']({},_0x4843ca,_0x1d475e[_0x65ec('0x3d')]);return db[_0x65ec('0x2a')][_0x65ec('0x45')](_0x4843ca)[_0x65ec('0x22')](handleEntityNotFound(_0x524235,null))['then'](respondWithResult(_0x524235,null))[_0x65ec('0x42')](handleError(_0x524235,null));};exports['create']=function(_0x1ed0f9,_0x169890){return db[_0x65ec('0x2a')]['create'](_0x1ed0f9['body'],{})[_0x65ec('0x22')](respondWithResult(_0x169890,0xc9))[_0x65ec('0x42')](handleError(_0x169890,null));};exports[_0x65ec('0x21')]=function(_0x2111af,_0x1b3732){if(_0x2111af[_0x65ec('0x46')]['id']){delete _0x2111af[_0x65ec('0x46')]['id'];}return db[_0x65ec('0x2a')][_0x65ec('0x45')]({'where':{'id':_0x2111af[_0x65ec('0x44')]['id']}})[_0x65ec('0x22')](handleEntityNotFound(_0x1b3732,null))[_0x65ec('0x22')](saveUpdates(_0x2111af[_0x65ec('0x46')],null))[_0x65ec('0x22')](respondWithResult(_0x1b3732,null))[_0x65ec('0x42')](handleError(_0x1b3732,null));};exports[_0x65ec('0x23')]=function(_0x22c28c,_0x5eb6d3){return db[_0x65ec('0x2a')][_0x65ec('0x45')]({'where':{'id':_0x22c28c['params']['id']}})[_0x65ec('0x22')](handleEntityNotFound(_0x5eb6d3,null))[_0x65ec('0x22')](removeEntity(_0x5eb6d3,null))[_0x65ec('0x42')](handleError(_0x5eb6d3,null));};exports['getConfigurations']=function(_0x3eee1e,_0x2b2756,_0x27843b){var _0x50f1c3={};var _0xabb4e3={};var _0x5e5e48;var _0x4c9905;return db[_0x65ec('0x2a')][_0x65ec('0x47')]({'where':{'id':_0x3eee1e[_0x65ec('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b2756,null))[_0x65ec('0x22')](function(_0x28a686){if(_0x28a686){_0x5e5e48=_0x28a686;_0xabb4e3[_0x65ec('0x2d')]=_[_0x65ec('0x2f')](db[_0x65ec('0x48')][_0x65ec('0x2b')]);_0xabb4e3[_0x65ec('0x2e')]=_[_0x65ec('0x2f')](_0x3eee1e[_0x65ec('0x2e')]);_0xabb4e3['filters']=_['intersection'](_0xabb4e3[_0x65ec('0x2d')],_0xabb4e3['query']);_0x50f1c3[_0x65ec('0x31')]=_['intersection'](_0xabb4e3[_0x65ec('0x2d')],qs[_0x65ec('0x33')](_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x50f1c3[_0x65ec('0x31')]=_0x50f1c3[_0x65ec('0x31')][_0x65ec('0x49')]?_0x50f1c3['attributes']:_0xabb4e3[_0x65ec('0x2d')];_0x50f1c3[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x37')]);_0x50f1c3['where']=qs[_0x65ec('0x30')](_[_0x65ec('0x39')](_0x3eee1e[_0x65ec('0x2e')],_0xabb4e3[_0x65ec('0x30')]));if(_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x3c')]){_0x50f1c3[_0x65ec('0x38')]=_[_0x65ec('0x3a')](_0x50f1c3['where'],{'$or':_[_0x65ec('0x29')](_0x50f1c3[_0x65ec('0x31')],function(_0x12bb9b){var _0x233b9b={};_0x233b9b[_0x12bb9b]={'$like':'%'+_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x3c')]+'%'};return _0x233b9b;})});}_0x50f1c3=_[_0x65ec('0x3a')]({},_0x50f1c3,_0x3eee1e['options']);return _0x5e5e48['getConfigurations'](_0x50f1c3);}})[_0x65ec('0x22')](function(_0x56dd47){if(_0x56dd47){_0x4c9905=_0x56dd47[_0x65ec('0x49')];if(!_0x3eee1e[_0x65ec('0x2e')]['hasOwnProperty'](_0x65ec('0x35'))){_0x50f1c3[_0x65ec('0x1c')]=qs[_0x65ec('0x1c')](_0x3eee1e[_0x65ec('0x2e')][_0x65ec('0x1c')]);_0x50f1c3[_0x65ec('0x19')]=qs[_0x65ec('0x19')](_0x3eee1e['query']['offset']);}return _0x5e5e48[_0x65ec('0x4a')](_0x50f1c3);}})[_0x65ec('0x22')](function(_0xd14e5){if(_0xd14e5){return _0xd14e5?{'count':_0x4c9905,'rows':_0xd14e5}:null;}})['then'](respondWithResult(_0x2b2756,null))[_0x65ec('0x42')](handleError(_0x2b2756,null));};exports[_0x65ec('0x4b')]=function(_0x17059d,_0x3d761f,_0x21096d){if(_0x17059d[_0x65ec('0x46')]['id']){delete _0x17059d[_0x65ec('0x46')]['id'];}return db['ZendeskAccount'][_0x65ec('0x47')]({'where':{'id':_0x17059d[_0x65ec('0x44')]['id']}})[_0x65ec('0x22')](handleEntityNotFound(_0x3d761f,null))[_0x65ec('0x22')](function(_0x3da824){if(_0x3da824){_0x17059d[_0x65ec('0x46')][_0x65ec('0x4c')]=_0x3da824['id'];_0x17059d[_0x65ec('0x46')][_0x65ec('0x4d')]=integrations['getSubjects'](_0x17059d['body'][_0x65ec('0x4e')],_0x17059d['body']['type']);_0x17059d[_0x65ec('0x46')][_0x65ec('0x4f')]=integrations[_0x65ec('0x50')](_0x17059d['body']['channel'],_0x17059d[_0x65ec('0x46')]['type']);return db['ZendeskConfiguration']['create'](_0x17059d[_0x65ec('0x46')],{'include':[{'model':db['ZendeskField'],'as':_0x65ec('0x4d')},{'model':db[_0x65ec('0x51')],'as':_0x65ec('0x4f')}]});}return null;})['then'](respondWithResult(_0x3d761f,null))['catch'](handleError(_0x3d761f,null));};exports[_0x65ec('0x52')]=function(_0x54f1cb,_0x244d12,_0x1c2972){var _0xf78f6a='';return db[_0x65ec('0x2a')][_0x65ec('0x47')]({'where':{'id':_0x54f1cb[_0x65ec('0x44')]['id']},'attributes':['id',_0x65ec('0x53'),_0x65ec('0x54'),_0x65ec('0x55'),_0x65ec('0x56'),'remoteUri']})[_0x65ec('0x22')](handleEntityNotFound(_0x244d12,null))['then'](function(_0x46e454){if(_0x46e454){_0xf78f6a=_0x46e454[_0x65ec('0x57')];var _0x292f81=_0xf78f6a[_0x65ec('0x58')](-0x1);if(_0x292f81==='/'){_0xf78f6a=_0xf78f6a['substring'](0x0,_0xf78f6a[_0x65ec('0x59')](_0x292f81));}var _0x556c5e={'method':_0x65ec('0x5a'),'uri':util[_0x65ec('0x5b')](_0x65ec('0x5c'),_0xf78f6a,_0x65ec('0x5d')),'json':!![]};switch(_0x46e454['authType']){case'password':_0x556c5e['headers']={'Authorization':util[_0x65ec('0x5b')](_0x65ec('0x5e'),new Buffer(util[_0x65ec('0x5b')](_0x65ec('0x5f'),_0x46e454[_0x65ec('0x53')],_0x46e454[_0x65ec('0x54')]))[_0x65ec('0x60')](_0x65ec('0x61')))};break;case _0x65ec('0x55'):_0x556c5e[_0x65ec('0x62')]={'Authorization':util[_0x65ec('0x5b')](_0x65ec('0x5e'),new Buffer(util[_0x65ec('0x5b')]('%s/token:%s',_0x46e454[_0x65ec('0x53')],_0x46e454[_0x65ec('0x55')]))[_0x65ec('0x60')](_0x65ec('0x61')))};break;default:throw new db[(_0x65ec('0x63'))][(_0x65ec('0x64'))](_0x65ec('0x65'));}return rp(_0x556c5e);}})[_0x65ec('0x22')](function(_0x3b5640){if(_0x3b5640){var _0x26ac0e=['subject',_0x65ec('0x66'),'group','assignee'];_[_0x65ec('0x67')](_0x3b5640[_0x65ec('0x5d')],function(_0x272432){return _0x26ac0e[_0x65ec('0x68')](_0x272432[_0x65ec('0x2c')]);});return{'count':_0x3b5640[_0x65ec('0x5d')][_0x65ec('0x49')],'rows':_[_0x65ec('0x29')](_0x3b5640['ticket_fields'],function(_0x1f5fe7){return{'id':_0x1f5fe7['id'],'name':_0x1f5fe7['position']>0x7?_0x1f5fe7[_0x65ec('0x69')]:_0x1f5fe7[_0x65ec('0x2c')],'custom':_0x1f5fe7[_0x65ec('0x6a')]>0x7?!![]:![],'options':_0x1f5fe7['system_field_options']?_0x1f5fe7[_0x65ec('0x6b')]:_0x1f5fe7[_0x65ec('0x6c')]?_0x1f5fe7[_0x65ec('0x6c')]:[]};})};}})[_0x65ec('0x22')](respondWithResult(_0x244d12,null))[_0x65ec('0x42')](function(_0x77ebd2){var _0x1172f3=_0x54f1cb['query'][_0x65ec('0x6d')]?0x1f4:_0x77ebd2[_0x65ec('0x6e')]||0x1f4;logger[_0x65ec('0x24')](_0x65ec('0x6f'),'getFields',_0x1172f3,JSON['stringify'](_0x77ebd2));delete _0x77ebd2[_0x65ec('0x26')];if(_0x1172f3===0x191){_0x1172f3=0x190;}_0x244d12[_0x65ec('0x16')](_0x1172f3)[_0x65ec('0x27')](_0x54f1cb[_0x65ec('0x2e')][_0x65ec('0x6d')]?{'message':_0x65ec('0x70'),'statusCode':_0x77ebd2['statusCode']}:_0x77ebd2);});};
\ No newline at end of file
+var _0x351d=['Subjects','Descriptions','getFields','password','token','remoteUri','slice','substring','lastIndexOf','format','%s/%s','authType','headers','Basic\x20%s','%s:%s','username','toString','base64','%s/token:%s','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','ticket_fields','position','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','status','end','json','undefined','count','offset','Content-Range','apply','reject','then','destroy','sendStatus','stack','index','rawAttributes','fieldName','type','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','where','pick','filter','merge','options','ZendeskAccount','includeAll','findAll','catch','params','include','find','create','body','update','findOne','ZendeskConfiguration','order','sort','getConfigurations','addConfiguration','AccountId','getSubjects','getDescriptions','channel','ZendeskField'];(function(_0x31cd31,_0x4480e1){var _0x2db328=function(_0x54f954){while(--_0x54f954){_0x31cd31['push'](_0x31cd31['shift']());}};_0x2db328(++_0x4480e1);}(_0x351d,0x90));var _0xd351=function(_0x4a58f2,_0x4483c2){_0x4a58f2=_0x4a58f2-0x0;var _0x5ef971=_0x351d[_0x4a58f2];return _0x5ef971;};'use strict';var emlformat=require(_0xd351('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd351('0x1'));var jsonpatch=require(_0xd351('0x2'));var rp=require(_0xd351('0x3'));var moment=require('moment');var BPromise=require(_0xd351('0x4'));var Mustache=require('mustache');var util=require(_0xd351('0x5'));var path=require(_0xd351('0x6'));var sox=require('sox');var csv=require(_0xd351('0x7'));var ejs=require(_0xd351('0x8'));var fs=require('fs');var fs_extra=require(_0xd351('0x9'));var _=require('lodash');var squel=require(_0xd351('0xa'));var crypto=require(_0xd351('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd351('0xc'));var toCsv=require(_0xd351('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd351('0xe'));var as=require(_0xd351('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd351('0x10'))(_0xd351('0x11'));var utils=require('../../config/utils');var config=require(_0xd351('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xd351('0x13'));function respondWithStatusCode(_0x15549a,_0x23445f){_0x23445f=_0x23445f||0xcc;return function(_0x1eb2a9){if(_0x1eb2a9){return _0x15549a['sendStatus'](_0x23445f);}return _0x15549a[_0xd351('0x14')](_0x23445f)[_0xd351('0x15')]();};}function respondWithResult(_0x597d7c,_0xc5a145){_0xc5a145=_0xc5a145||0xc8;return function(_0xb106ef){if(_0xb106ef){return _0x597d7c[_0xd351('0x14')](_0xc5a145)[_0xd351('0x16')](_0xb106ef);}};}function respondWithFilteredResult(_0x3867fb,_0x4d238c){return function(_0x9f790f){if(_0x9f790f){var _0x49d8bb=typeof _0x4d238c['offset']===_0xd351('0x17')&&typeof _0x4d238c['limit']===_0xd351('0x17');var _0x1de35f=_0x9f790f[_0xd351('0x18')];var _0x4c6693=_0x49d8bb?0x0:_0x4d238c[_0xd351('0x19')];var _0x2bfc53=_0x49d8bb?_0x9f790f[_0xd351('0x18')]:_0x4d238c[_0xd351('0x19')]+_0x4d238c['limit'];var _0xc2d2c0;if(_0x2bfc53>=_0x1de35f){_0x2bfc53=_0x1de35f;_0xc2d2c0=0xc8;}else{_0xc2d2c0=0xce;}_0x3867fb['status'](_0xc2d2c0);return _0x3867fb['set'](_0xd351('0x1a'),_0x4c6693+'-'+_0x2bfc53+'/'+_0x1de35f)['json'](_0x9f790f);}return null;};}function patchUpdates(_0x33b1e5){return function(_0x2d75dd){try{jsonpatch[_0xd351('0x1b')](_0x2d75dd,_0x33b1e5,!![]);}catch(_0x42631b){return BPromise[_0xd351('0x1c')](_0x42631b);}return _0x2d75dd['save']();};}function saveUpdates(_0x18625b,_0xbbc58){return function(_0x241265){if(_0x241265){return _0x241265['update'](_0x18625b)[_0xd351('0x1d')](function(_0x2d9aa0){return _0x2d9aa0;});}return null;};}function removeEntity(_0x365bbc,_0x59fb6d){return function(_0x1ce279){if(_0x1ce279){return _0x1ce279[_0xd351('0x1e')]()[_0xd351('0x1d')](function(){_0x365bbc[_0xd351('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f7f3,_0x483c92){return function(_0x358bff){if(!_0x358bff){_0x40f7f3[_0xd351('0x1f')](0x194);}return _0x358bff;};}function handleError(_0x54f471,_0x2648d0){_0x2648d0=_0x2648d0||0x1f4;return function(_0x55b4d3){logger['error'](_0x55b4d3[_0xd351('0x20')]);if(_0x55b4d3['name']){delete _0x55b4d3['name'];}_0x54f471[_0xd351('0x14')](_0x2648d0)['send'](_0x55b4d3);};}exports[_0xd351('0x21')]=function(_0x2ddae8,_0x407b50){var _0x4d3f48={},_0x71ce9c={},_0x4aa902={'count':0x0,'rows':[]};var _0x1c826b=_['map'](db['ZendeskAccount'][_0xd351('0x22')],function(_0x38c82f){return{'name':_0x38c82f[_0xd351('0x23')],'type':_0x38c82f[_0xd351('0x24')]['key']};});_0x71ce9c[_0xd351('0x25')]=_[_0xd351('0x26')](_0x1c826b,_0xd351('0x27'));_0x71ce9c[_0xd351('0x28')]=_[_0xd351('0x29')](_0x2ddae8[_0xd351('0x28')]);_0x71ce9c[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],_0x71ce9c['query']);_0x4d3f48[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x71ce9c[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x2ddae8['query'][_0xd351('0x2d')]));_0x4d3f48[_0xd351('0x2c')]=_0x4d3f48[_0xd351('0x2c')][_0xd351('0x2e')]?_0x4d3f48[_0xd351('0x2c')]:_0x71ce9c[_0xd351('0x25')];if(!_0x2ddae8[_0xd351('0x28')][_0xd351('0x2f')](_0xd351('0x30'))){_0x4d3f48['limit']=qs['limit'](_0x2ddae8[_0xd351('0x28')][_0xd351('0x31')]);_0x4d3f48[_0xd351('0x19')]=qs[_0xd351('0x19')](_0x2ddae8[_0xd351('0x28')][_0xd351('0x19')]);}_0x4d3f48['order']=qs['sort'](_0x2ddae8[_0xd351('0x28')]['sort']);_0x4d3f48[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x2ddae8[_0xd351('0x28')],_0x71ce9c[_0xd351('0x2a')]),_0x1c826b);if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]){_0x4d3f48[_0xd351('0x32')]=_[_0xd351('0x35')](_0x4d3f48[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x1c826b,function(_0x4b15db){if(_0x4b15db[_0xd351('0x24')]!=='VIRTUAL'){var _0x22631={};_0x22631[_0x4b15db[_0xd351('0x27')]]={'$like':'%'+_0x2ddae8[_0xd351('0x28')][_0xd351('0x34')]+'%'};return _0x22631;}})});}_0x4d3f48=_[_0xd351('0x35')]({},_0x4d3f48,_0x2ddae8[_0xd351('0x36')]);var _0x545bfc={'where':_0x4d3f48[_0xd351('0x32')]};return db[_0xd351('0x37')]['count'](_0x545bfc)[_0xd351('0x1d')](function(_0x2d8ea8){_0x4aa902[_0xd351('0x18')]=_0x2d8ea8;if(_0x2ddae8[_0xd351('0x28')][_0xd351('0x38')]){_0x4d3f48['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0xd351('0x39')](_0x4d3f48);})[_0xd351('0x1d')](function(_0x5dae6d){_0x4aa902['rows']=_0x5dae6d;return _0x4aa902;})[_0xd351('0x1d')](respondWithFilteredResult(_0x407b50,_0x4d3f48))[_0xd351('0x3a')](handleError(_0x407b50,null));};exports['show']=function(_0x570d57,_0x46af23){var _0x18f9d1={'raw':![],'where':{'id':_0x570d57[_0xd351('0x3b')]['id']}},_0x3b8526={};_0x3b8526[_0xd351('0x25')]=_[_0xd351('0x29')](db[_0xd351('0x37')][_0xd351('0x22')]);_0x3b8526[_0xd351('0x28')]=_['keys'](_0x570d57['query']);_0x3b8526[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],_0x3b8526[_0xd351('0x28')]);_0x18f9d1[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x3b8526[_0xd351('0x25')],qs[_0xd351('0x2d')](_0x570d57[_0xd351('0x28')][_0xd351('0x2d')]));_0x18f9d1[_0xd351('0x2c')]=_0x18f9d1[_0xd351('0x2c')][_0xd351('0x2e')]?_0x18f9d1[_0xd351('0x2c')]:_0x3b8526[_0xd351('0x25')];if(_0x570d57[_0xd351('0x28')]['includeAll']){_0x18f9d1[_0xd351('0x3c')]=[{'all':!![]}];}_0x18f9d1=_[_0xd351('0x35')]({},_0x18f9d1,_0x570d57[_0xd351('0x36')]);return db['ZendeskAccount'][_0xd351('0x3d')](_0x18f9d1)[_0xd351('0x1d')](handleEntityNotFound(_0x46af23,null))[_0xd351('0x1d')](respondWithResult(_0x46af23,null))[_0xd351('0x3a')](handleError(_0x46af23,null));};exports[_0xd351('0x3e')]=function(_0x5bc86a,_0x5adea4){return db['ZendeskAccount'][_0xd351('0x3e')](_0x5bc86a[_0xd351('0x3f')],{})['then'](respondWithResult(_0x5adea4,0xc9))['catch'](handleError(_0x5adea4,null));};exports[_0xd351('0x40')]=function(_0x444206,_0x2af877){if(_0x444206['body']['id']){delete _0x444206[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')]['find']({'where':{'id':_0x444206[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2af877,null))[_0xd351('0x1d')](saveUpdates(_0x444206[_0xd351('0x3f')],null))['then'](respondWithResult(_0x2af877,null))['catch'](handleError(_0x2af877,null));};exports[_0xd351('0x1e')]=function(_0x58ce5a,_0xf9f375){return db[_0xd351('0x37')][_0xd351('0x3d')]({'where':{'id':_0x58ce5a['params']['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0xf9f375,null))['then'](removeEntity(_0xf9f375,null))['catch'](handleError(_0xf9f375,null));};exports['getConfigurations']=function(_0x7e4bad,_0x292af3,_0x334029){var _0x5a2e9b={};var _0x554e3a={};var _0x1748f0;var _0x42f248;return db['ZendeskAccount'][_0xd351('0x41')]({'where':{'id':_0x7e4bad[_0xd351('0x3b')]['id']}})['then'](handleEntityNotFound(_0x292af3,null))[_0xd351('0x1d')](function(_0x59ab0f){if(_0x59ab0f){_0x1748f0=_0x59ab0f;_0x554e3a[_0xd351('0x25')]=_['keys'](db[_0xd351('0x42')][_0xd351('0x22')]);_0x554e3a[_0xd351('0x28')]=_[_0xd351('0x29')](_0x7e4bad[_0xd351('0x28')]);_0x554e3a[_0xd351('0x2a')]=_[_0xd351('0x2b')](_0x554e3a['model'],_0x554e3a['query']);_0x5a2e9b[_0xd351('0x2c')]=_[_0xd351('0x2b')](_0x554e3a['model'],qs[_0xd351('0x2d')](_0x7e4bad[_0xd351('0x28')][_0xd351('0x2d')]));_0x5a2e9b['attributes']=_0x5a2e9b[_0xd351('0x2c')]['length']?_0x5a2e9b['attributes']:_0x554e3a[_0xd351('0x25')];_0x5a2e9b[_0xd351('0x43')]=qs['sort'](_0x7e4bad[_0xd351('0x28')][_0xd351('0x44')]);_0x5a2e9b[_0xd351('0x32')]=qs[_0xd351('0x2a')](_[_0xd351('0x33')](_0x7e4bad[_0xd351('0x28')],_0x554e3a['filters']));if(_0x7e4bad[_0xd351('0x28')][_0xd351('0x34')]){_0x5a2e9b[_0xd351('0x32')]=_[_0xd351('0x35')](_0x5a2e9b[_0xd351('0x32')],{'$or':_[_0xd351('0x26')](_0x5a2e9b[_0xd351('0x2c')],function(_0x4b2029){var _0x24dcdb={};_0x24dcdb[_0x4b2029]={'$like':'%'+_0x7e4bad['query'][_0xd351('0x34')]+'%'};return _0x24dcdb;})});}_0x5a2e9b=_[_0xd351('0x35')]({},_0x5a2e9b,_0x7e4bad[_0xd351('0x36')]);return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x4eaf18){if(_0x4eaf18){_0x42f248=_0x4eaf18[_0xd351('0x2e')];if(!_0x7e4bad['query'][_0xd351('0x2f')](_0xd351('0x30'))){_0x5a2e9b[_0xd351('0x31')]=qs[_0xd351('0x31')](_0x7e4bad[_0xd351('0x28')]['limit']);_0x5a2e9b['offset']=qs[_0xd351('0x19')](_0x7e4bad[_0xd351('0x28')]['offset']);}return _0x1748f0[_0xd351('0x45')](_0x5a2e9b);}})[_0xd351('0x1d')](function(_0x2718e9){if(_0x2718e9){return _0x2718e9?{'count':_0x42f248,'rows':_0x2718e9}:null;}})['then'](respondWithResult(_0x292af3,null))[_0xd351('0x3a')](handleError(_0x292af3,null));};exports[_0xd351('0x46')]=function(_0x284d12,_0x5dbdef,_0x5d13ec){if(_0x284d12['body']['id']){delete _0x284d12[_0xd351('0x3f')]['id'];}return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x284d12[_0xd351('0x3b')]['id']}})[_0xd351('0x1d')](handleEntityNotFound(_0x5dbdef,null))[_0xd351('0x1d')](function(_0x2c83fe){if(_0x2c83fe){_0x284d12['body'][_0xd351('0x47')]=_0x2c83fe['id'];_0x284d12['body']['Subjects']=integrations[_0xd351('0x48')](_0x284d12[_0xd351('0x3f')]['channel'],_0x284d12[_0xd351('0x3f')]['type']);_0x284d12['body']['Descriptions']=integrations[_0xd351('0x49')](_0x284d12[_0xd351('0x3f')][_0xd351('0x4a')],_0x284d12['body'][_0xd351('0x24')]);return db[_0xd351('0x42')][_0xd351('0x3e')](_0x284d12[_0xd351('0x3f')],{'include':[{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4c')},{'model':db[_0xd351('0x4b')],'as':_0xd351('0x4d')}]});}return null;})[_0xd351('0x1d')](respondWithResult(_0x5dbdef,null))[_0xd351('0x3a')](handleError(_0x5dbdef,null));};exports[_0xd351('0x4e')]=function(_0x4d20af,_0x2fcede,_0x2d59a5){var _0x431e91='';return db[_0xd351('0x37')][_0xd351('0x41')]({'where':{'id':_0x4d20af[_0xd351('0x3b')]['id']},'attributes':['id','username',_0xd351('0x4f'),_0xd351('0x50'),'authType','remoteUri']})[_0xd351('0x1d')](handleEntityNotFound(_0x2fcede,null))[_0xd351('0x1d')](function(_0x44dc58){if(_0x44dc58){_0x431e91=_0x44dc58[_0xd351('0x51')];var _0x1db455=_0x431e91[_0xd351('0x52')](-0x1);if(_0x1db455==='/'){_0x431e91=_0x431e91[_0xd351('0x53')](0x0,_0x431e91[_0xd351('0x54')](_0x1db455));}var _0x3ce2b9={'method':'GET','uri':util[_0xd351('0x55')](_0xd351('0x56'),_0x431e91,'ticket_fields'),'json':!![]};switch(_0x44dc58[_0xd351('0x57')]){case'password':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util['format'](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5a'),_0x44dc58[_0xd351('0x5b')],_0x44dc58[_0xd351('0x4f')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;case'token':_0x3ce2b9[_0xd351('0x58')]={'Authorization':util[_0xd351('0x55')](_0xd351('0x59'),new Buffer(util[_0xd351('0x55')](_0xd351('0x5e'),_0x44dc58['username'],_0x44dc58[_0xd351('0x50')]))[_0xd351('0x5c')](_0xd351('0x5d')))};break;default:throw new db['Sequelize'][(_0xd351('0x5f'))](_0xd351('0x60'));}return rp(_0x3ce2b9);}})[_0xd351('0x1d')](function(_0x3f0d27){if(_0x3f0d27){var _0x3635ad=[_0xd351('0x61'),_0xd351('0x62'),_0xd351('0x63'),_0xd351('0x64')];_['remove'](_0x3f0d27[_0xd351('0x65')],function(_0x190a00){return _0x3635ad['includes'](_0x190a00[_0xd351('0x24')]);});return{'count':_0x3f0d27['ticket_fields']['length'],'rows':_['map'](_0x3f0d27[_0xd351('0x65')],function(_0x3367f8){return{'id':_0x3367f8['id'],'name':_0x3367f8[_0xd351('0x66')]>0x7?_0x3367f8['title']:_0x3367f8[_0xd351('0x24')],'custom':_0x3367f8['position']>0x7?!![]:![],'options':_0x3367f8[_0xd351('0x67')]?_0x3367f8['system_field_options']:_0x3367f8[_0xd351('0x68')]?_0x3367f8[_0xd351('0x68')]:[]};})};}})[_0xd351('0x1d')](respondWithResult(_0x2fcede,null))[_0xd351('0x3a')](function(_0x35b148){var _0x1bb955=_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?0x1f4:_0x35b148[_0xd351('0x6a')]||0x1f4;logger[_0xd351('0x6b')](_0xd351('0x6c'),_0xd351('0x4e'),_0x1bb955,JSON['stringify'](_0x35b148));delete _0x35b148[_0xd351('0x27')];if(_0x1bb955===0x191){_0x1bb955=0x190;}_0x2fcede[_0xd351('0x14')](_0x1bb955)[_0xd351('0x6d')](_0x4d20af[_0xd351('0x28')][_0xd351('0x69')]?{'message':'Wrong\x20credentials','statusCode':_0x35b148[_0xd351('0x6a')]}:_0x35b148);});};
\ No newline at end of file
index 3cd1a05..fde334b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ce0=['define','ZendeskAccount','int_zendesk_accounts','lodash','util','api','moment','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x7ce0,0x196));var _0x07ce=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x7ce0[_0x1e1965];return _0x1a2e96;};'use strict';var _=require(_0x07ce('0x0'));var util=require(_0x07ce('0x1'));var logger=require('../../config/logger')(_0x07ce('0x2'));var moment=require(_0x07ce('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x07ce('0x4'));var rimraf=require(_0x07ce('0x5'));var config=require(_0x07ce('0x6'));var attributes=require(_0x07ce('0x7'));var integrations=require(_0x07ce('0x8'));module[_0x07ce('0x9')]=function(_0x4539dd,_0x2d7fe5){return _0x4539dd[_0x07ce('0xa')](_0x07ce('0xb'),attributes,{'tableName':_0x07ce('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xba37=['ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','bluebird','rimraf','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xba37,0x13d));var _0x7ba3=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xba37[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x7ba3('0x0'));var util=require('util');var logger=require(_0x7ba3('0x1'))('api');var moment=require('moment');var BPromise=require(_0x7ba3('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7ba3('0x3'));var config=require('../../config/environment');var attributes=require(_0x7ba3('0x4'));var integrations=require(_0x7ba3('0x5'));module[_0x7ba3('0x6')]=function(_0x4123d0,_0x267c2a){return _0x4123d0['define'](_0x7ba3('0x7'),attributes,{'tableName':_0x7ba3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 271d8ed..8919349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dda=['limit','map','model','attributes','include','catch','find','raw','ShowZendeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','ZendeskAccount','options','where'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x2dda,0x121));var _0xa2dd=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2dda[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xa2dd('0x0'));var util=require(_0xa2dd('0x1'));var moment=require(_0xa2dd('0x2'));var BPromise=require('bluebird');var rs=require(_0xa2dd('0x3'));var fs=require('fs');var Redis=require(_0xa2dd('0x4'));var db=require(_0xa2dd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa2dd('0x6'));var config=require('../../config/environment');var jayson=require(_0xa2dd('0x7'));var client=jayson[_0xa2dd('0x8')][_0xa2dd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfae19,_0x3c56d6,_0x4c397f){return new BPromise(function(_0x348b72,_0x269805){return client[_0xa2dd('0xa')](_0xfae19,_0x4c397f)[_0xa2dd('0xb')](function(_0x56a289){logger[_0xa2dd('0xc')](_0xa2dd('0xd'),_0x3c56d6,_0xa2dd('0xe'));logger[_0xa2dd('0xf')](_0xa2dd('0x10'),_0x3c56d6,_0xa2dd('0xe'),JSON[_0xa2dd('0x11')](_0x56a289));if(_0x56a289[_0xa2dd('0x12')]){if(_0x56a289[_0xa2dd('0x12')][_0xa2dd('0x13')]===0x1f4){logger[_0xa2dd('0x12')](_0xa2dd('0xd'),_0x3c56d6,_0x56a289[_0xa2dd('0x12')][_0xa2dd('0x14')]);return _0x269805(_0x56a289[_0xa2dd('0x12')][_0xa2dd('0x14')]);}logger[_0xa2dd('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x3c56d6,_0x56a289[_0xa2dd('0x12')][_0xa2dd('0x14')]);return _0x348b72(_0x56a289['error']['message']);}else{logger[_0xa2dd('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x3c56d6,'request\x20sent');_0x348b72(_0x56a289[_0xa2dd('0x15')]['message']);}})['catch'](function(_0x4e27b8){logger['error'](_0xa2dd('0xd'),_0x3c56d6,_0x4e27b8);_0x269805(_0x4e27b8);});});}exports[_0xa2dd('0x16')]=function(_0x320176){var _0x154f20=this;return new Promise(function(_0x53dc3c,_0x3dc884){return db[_0xa2dd('0x17')]['findAll']({'raw':_0x320176['options']?_0x320176[_0xa2dd('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x320176[_0xa2dd('0x18')]?_0x320176[_0xa2dd('0x18')][_0xa2dd('0x19')]||null:null,'attributes':_0x320176[_0xa2dd('0x18')]?_0x320176['options']['attributes']||null:null,'limit':_0x320176[_0xa2dd('0x18')]?_0x320176[_0xa2dd('0x18')][_0xa2dd('0x1a')]||null:null,'include':_0x320176['options']?_0x320176[_0xa2dd('0x18')]['include']?_[_0xa2dd('0x1b')](_0x320176['options']['include'],function(_0x39b9b8){return{'model':db[_0x39b9b8[_0xa2dd('0x1c')]],'as':_0x39b9b8['as'],'attributes':_0x39b9b8[_0xa2dd('0x1d')],'include':_0x39b9b8[_0xa2dd('0x1e')]?_[_0xa2dd('0x1b')](_0x39b9b8[_0xa2dd('0x1e')],function(_0xf23583){return{'model':db[_0xf23583[_0xa2dd('0x1c')]],'as':_0xf23583['as'],'attributes':_0xf23583[_0xa2dd('0x1d')],'include':_0xf23583[_0xa2dd('0x1e')]?_[_0xa2dd('0x1b')](_0xf23583[_0xa2dd('0x1e')],function(_0x365ab4){return{'model':db[_0x365ab4[_0xa2dd('0x1c')]],'as':_0x365ab4['as'],'attributes':_0x365ab4[_0xa2dd('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bbb9c){logger[_0xa2dd('0xc')]('GetZendeskAccount',_0x320176);logger[_0xa2dd('0xf')]('GetZendeskAccount',_0x320176,JSON['stringify'](_0x1bbb9c));_0x53dc3c(_0x1bbb9c);})[_0xa2dd('0x1f')](function(_0x3d9fe6){logger[_0xa2dd('0x12')](_0xa2dd('0x16'),_0x3d9fe6[_0xa2dd('0x14')],_0x320176);_0x3dc884(_0x154f20[_0xa2dd('0x12')](0x1f4,_0x3d9fe6[_0xa2dd('0x14')]));});});};exports['ShowZendeskAccount']=function(_0x5c0ba2){var _0x3d3352=this;return new Promise(function(_0x1ae769,_0x4824f3){return db[_0xa2dd('0x17')][_0xa2dd('0x20')]({'raw':_0x5c0ba2[_0xa2dd('0x18')]?_0x5c0ba2[_0xa2dd('0x18')][_0xa2dd('0x21')]===undefined?!![]:![]:!![],'where':_0x5c0ba2['options']?_0x5c0ba2[_0xa2dd('0x18')][_0xa2dd('0x19')]||null:null,'attributes':_0x5c0ba2[_0xa2dd('0x18')]?_0x5c0ba2[_0xa2dd('0x18')][_0xa2dd('0x1d')]||null:null,'include':_0x5c0ba2[_0xa2dd('0x18')]?_0x5c0ba2[_0xa2dd('0x18')][_0xa2dd('0x1e')]?_['map'](_0x5c0ba2[_0xa2dd('0x18')][_0xa2dd('0x1e')],function(_0x15c610){return{'model':db[_0x15c610['model']],'as':_0x15c610['as'],'attributes':_0x15c610[_0xa2dd('0x1d')],'include':_0x15c610[_0xa2dd('0x1e')]?_[_0xa2dd('0x1b')](_0x15c610[_0xa2dd('0x1e')],function(_0x27ead6){return{'model':db[_0x27ead6['model']],'as':_0x27ead6['as'],'attributes':_0x27ead6[_0xa2dd('0x1d')],'include':_0x27ead6[_0xa2dd('0x1e')]?_[_0xa2dd('0x1b')](_0x27ead6['include'],function(_0x1a5162){return{'model':db[_0x1a5162[_0xa2dd('0x1c')]],'as':_0x1a5162['as'],'attributes':_0x1a5162[_0xa2dd('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa2dd('0xb')](function(_0x5bed2f){logger[_0xa2dd('0xc')](_0xa2dd('0x22'),_0x5c0ba2);logger[_0xa2dd('0xf')](_0xa2dd('0x22'),_0x5c0ba2,JSON[_0xa2dd('0x11')](_0x5bed2f));_0x1ae769(_0x5bed2f);})[_0xa2dd('0x1f')](function(_0x54a0f8){logger[_0xa2dd('0x12')](_0xa2dd('0x22'),_0x54a0f8[_0xa2dd('0x14')],_0x5c0ba2);_0x4824f3(_0x3d3352[_0xa2dd('0x12')](0x1f4,_0x54a0f8['message']));});});};
\ No newline at end of file
+var _0xea98=['../../config/environment','jayson/promise','client','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','model','map','then','ZendeskAccount','find','ShowZendeskAccount','lodash','util','moment','randomstring','../../mysqldb','rpc'];(function(_0x1e37be,_0x405f43){var _0x749eca=function(_0x4c2126){while(--_0x4c2126){_0x1e37be['push'](_0x1e37be['shift']());}};_0x749eca(++_0x405f43);}(_0xea98,0x19e));var _0x8ea9=function(_0x433f44,_0xa365ce){_0x433f44=_0x433f44-0x0;var _0x73664=_0xea98[_0x433f44];return _0x73664;};'use strict';var _=require(_0x8ea9('0x0'));var util=require(_0x8ea9('0x1'));var moment=require(_0x8ea9('0x2'));var BPromise=require('bluebird');var rs=require(_0x8ea9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8ea9('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8ea9('0x5'));var config=require(_0x8ea9('0x6'));var jayson=require(_0x8ea9('0x7'));var client=jayson[_0x8ea9('0x8')][_0x8ea9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfc7eb5,_0x4847c0,_0x4ea298){return new BPromise(function(_0xef01,_0x34dcf2){return client['request'](_0xfc7eb5,_0x4ea298)['then'](function(_0x13a6c3){logger[_0x8ea9('0xa')](_0x8ea9('0xb'),_0x4847c0,_0x8ea9('0xc'));logger[_0x8ea9('0xd')](_0x8ea9('0xe'),_0x4847c0,_0x8ea9('0xc'),JSON[_0x8ea9('0xf')](_0x13a6c3));if(_0x13a6c3[_0x8ea9('0x10')]){if(_0x13a6c3[_0x8ea9('0x10')][_0x8ea9('0x11')]===0x1f4){logger['error'](_0x8ea9('0xb'),_0x4847c0,_0x13a6c3['error'][_0x8ea9('0x12')]);return _0x34dcf2(_0x13a6c3[_0x8ea9('0x10')]['message']);}logger[_0x8ea9('0x10')](_0x8ea9('0xb'),_0x4847c0,_0x13a6c3[_0x8ea9('0x10')][_0x8ea9('0x12')]);return _0xef01(_0x13a6c3[_0x8ea9('0x10')][_0x8ea9('0x12')]);}else{logger['info'](_0x8ea9('0xb'),_0x4847c0,_0x8ea9('0xc'));_0xef01(_0x13a6c3[_0x8ea9('0x13')][_0x8ea9('0x12')]);}})[_0x8ea9('0x14')](function(_0x5809fd){logger[_0x8ea9('0x10')]('ZendeskAccount,\x20%s,\x20%s',_0x4847c0,_0x5809fd);_0x34dcf2(_0x5809fd);});});}exports[_0x8ea9('0x15')]=function(_0x134953){var _0x5c82af=this;return new Promise(function(_0x2b5b14,_0x5263dd){return db['ZendeskAccount'][_0x8ea9('0x16')]({'raw':_0x134953['options']?_0x134953[_0x8ea9('0x17')][_0x8ea9('0x18')]===undefined?!![]:![]:!![],'where':_0x134953['options']?_0x134953[_0x8ea9('0x17')][_0x8ea9('0x19')]||null:null,'attributes':_0x134953[_0x8ea9('0x17')]?_0x134953['options'][_0x8ea9('0x1a')]||null:null,'limit':_0x134953['options']?_0x134953[_0x8ea9('0x17')][_0x8ea9('0x1b')]||null:null,'include':_0x134953[_0x8ea9('0x17')]?_0x134953[_0x8ea9('0x17')]['include']?_['map'](_0x134953['options'][_0x8ea9('0x1c')],function(_0x5a7962){return{'model':db[_0x5a7962[_0x8ea9('0x1d')]],'as':_0x5a7962['as'],'attributes':_0x5a7962['attributes'],'include':_0x5a7962[_0x8ea9('0x1c')]?_[_0x8ea9('0x1e')](_0x5a7962[_0x8ea9('0x1c')],function(_0x58392b){return{'model':db[_0x58392b[_0x8ea9('0x1d')]],'as':_0x58392b['as'],'attributes':_0x58392b[_0x8ea9('0x1a')],'include':_0x58392b[_0x8ea9('0x1c')]?_[_0x8ea9('0x1e')](_0x58392b['include'],function(_0x123827){return{'model':db[_0x123827['model']],'as':_0x123827['as'],'attributes':_0x123827['attributes']};}):[]};}):[]};}):[]:[]})[_0x8ea9('0x1f')](function(_0x2744fc){logger[_0x8ea9('0xa')](_0x8ea9('0x15'),_0x134953);logger['debug']('GetZendeskAccount',_0x134953,JSON['stringify'](_0x2744fc));_0x2b5b14(_0x2744fc);})[_0x8ea9('0x14')](function(_0xbddbff){logger['error'](_0x8ea9('0x15'),_0xbddbff[_0x8ea9('0x12')],_0x134953);_0x5263dd(_0x5c82af['error'](0x1f4,_0xbddbff[_0x8ea9('0x12')]));});});};exports['ShowZendeskAccount']=function(_0x2f3a7a){var _0x80afa5=this;return new Promise(function(_0x422f97,_0x96822f){return db[_0x8ea9('0x20')][_0x8ea9('0x21')]({'raw':_0x2f3a7a['options']?_0x2f3a7a['options'][_0x8ea9('0x18')]===undefined?!![]:![]:!![],'where':_0x2f3a7a['options']?_0x2f3a7a[_0x8ea9('0x17')][_0x8ea9('0x19')]||null:null,'attributes':_0x2f3a7a['options']?_0x2f3a7a[_0x8ea9('0x17')][_0x8ea9('0x1a')]||null:null,'include':_0x2f3a7a[_0x8ea9('0x17')]?_0x2f3a7a['options'][_0x8ea9('0x1c')]?_[_0x8ea9('0x1e')](_0x2f3a7a[_0x8ea9('0x17')][_0x8ea9('0x1c')],function(_0x1c01db){return{'model':db[_0x1c01db[_0x8ea9('0x1d')]],'as':_0x1c01db['as'],'attributes':_0x1c01db['attributes'],'include':_0x1c01db[_0x8ea9('0x1c')]?_[_0x8ea9('0x1e')](_0x1c01db[_0x8ea9('0x1c')],function(_0x4e1c6d){return{'model':db[_0x4e1c6d[_0x8ea9('0x1d')]],'as':_0x4e1c6d['as'],'attributes':_0x4e1c6d[_0x8ea9('0x1a')],'include':_0x4e1c6d['include']?_['map'](_0x4e1c6d['include'],function(_0x5ea208){return{'model':db[_0x5ea208[_0x8ea9('0x1d')]],'as':_0x5ea208['as'],'attributes':_0x5ea208[_0x8ea9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8ea9('0x1f')](function(_0x4952bc){logger['info'](_0x8ea9('0x22'),_0x2f3a7a);logger[_0x8ea9('0xd')](_0x8ea9('0x22'),_0x2f3a7a,JSON[_0x8ea9('0xf')](_0x4952bc));_0x422f97(_0x4952bc);})[_0x8ea9('0x14')](function(_0x2251cb){logger[_0x8ea9('0x10')](_0x8ea9('0x22'),_0x2251cb['message'],_0x2f3a7a);_0x96822f(_0x80afa5['error'](0x1f4,_0x2251cb[_0x8ea9('0x12')]));});});};
\ No newline at end of file
index fd09d34..0a502ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c00=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','getFields','/:id/subjects','getSubjects','/:id/tags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x3449c3,_0x4dbeff){var _0x1f13bc=function(_0x1a032a){while(--_0x1a032a){_0x3449c3['push'](_0x3449c3['shift']());}};_0x1f13bc(++_0x4dbeff);}(_0x5c00,0x17e));var _0x05c0=function(_0x67143c,_0x433024){_0x67143c=_0x67143c-0x0;var _0x1dbbc3=_0x5c00[_0x67143c];return _0x1dbbc3;};'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 fs_extra=require(_0x05c0('0x4'));var auth=require(_0x05c0('0x5'));var interaction=require(_0x05c0('0x6'));var config=require(_0x05c0('0x7'));var controller=require('./intZendeskConfiguration.controller');router[_0x05c0('0x8')]('/',auth[_0x05c0('0x9')](),controller[_0x05c0('0xa')]);router[_0x05c0('0x8')]('/:id',auth[_0x05c0('0x9')](),controller[_0x05c0('0xb')]);router[_0x05c0('0x8')]('/:id/fields',auth[_0x05c0('0x9')](),controller[_0x05c0('0xc')]);router[_0x05c0('0x8')](_0x05c0('0xd'),auth[_0x05c0('0x9')](),controller[_0x05c0('0xe')]);router['get']('/:id/descriptions',auth[_0x05c0('0x9')](),controller['getDescriptions']);router[_0x05c0('0x8')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller['getTags']);router[_0x05c0('0x10')]('/',auth['isAuthenticated'](),controller[_0x05c0('0x11')]);router[_0x05c0('0x10')](_0x05c0('0xf'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x12')]);router[_0x05c0('0x13')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller['update']);router[_0x05c0('0x15')](_0x05c0('0x14'),auth[_0x05c0('0x9')](),controller[_0x05c0('0x16')]);module[_0x05c0('0x17')]=router;
\ No newline at end of file
+var _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0x267a92,_0x144bb1){var _0x41c589=function(_0x4ceae2){while(--_0x4ceae2){_0x267a92['push'](_0x267a92['shift']());}};_0x41c589(++_0x144bb1);}(_0x4483,0x1a3));var _0x3448=function(_0x534bd8,_0xe4bdd2){_0x534bd8=_0x534bd8-0x0;var _0x304f99=_0x4483[_0x534bd8];return _0x304f99;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router;
\ No newline at end of file
index 3a6d30f..ebd4924 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5cd=['sequelize','exports','STRING'];(function(_0xd0dab6,_0x25ceac){var _0x1cfb5a=function(_0x4abd35){while(--_0x4abd35){_0xd0dab6['push'](_0xd0dab6['shift']());}};_0x1cfb5a(++_0x25ceac);}(_0xe5cd,0x6c));var _0xde5c=function(_0x2c7cd3,_0x369d68){_0x2c7cd3=_0x2c7cd3-0x0;var _0x36d395=_0xe5cd[_0x2c7cd3];return _0x36d395;};'use strict';var Sequelize=require(_0xde5c('0x0'));module[_0xde5c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xde5c('0x2')]}};
\ No newline at end of file
+var _0xde9c=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde9c,0x1ad));var _0xcde9=function(_0x394ded,_0x397091){_0x394ded=_0x394ded-0x0;var _0x188301=_0xde9c[_0x394ded];return _0x188301;};'use strict';var Sequelize=require(_0xcde9('0x0'));module[_0xcde9('0x1')]={'name':{'type':Sequelize[_0xcde9('0x2')]},'description':{'type':Sequelize[_0xcde9('0x2')]}};
\ No newline at end of file
index 82b497c..45353b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc43d=['merge','VIRTUAL','options','ZendeskConfiguration','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','getFields','findOne','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0xc43d,0x1b1));var _0xdc43=function(_0x33e4a7,_0x2e80a2){_0x33e4a7=_0x33e4a7-0x0;var _0x598620=_0xc43d[_0x33e4a7];return _0x598620;};'use strict';var emlformat=require(_0xdc43('0x0'));var rimraf=require(_0xdc43('0x1'));var zipdir=require(_0xdc43('0x2'));var jsonpatch=require(_0xdc43('0x3'));var rp=require(_0xdc43('0x4'));var moment=require(_0xdc43('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdc43('0x6'));var util=require('util');var path=require('path');var sox=require(_0xdc43('0x7'));var csv=require(_0xdc43('0x8'));var ejs=require(_0xdc43('0x9'));var fs=require('fs');var fs_extra=require(_0xdc43('0xa'));var _=require(_0xdc43('0xb'));var squel=require('squel');var crypto=require(_0xdc43('0xc'));var jsforce=require(_0xdc43('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdc43('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdc43('0xe'));var authService=require(_0xdc43('0xf'));var qs=require(_0xdc43('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc43('0x11'))('api');var utils=require(_0xdc43('0x12'));var config=require(_0xdc43('0x13'));var licenseUtil=require(_0xdc43('0x14'));var db=require(_0xdc43('0x15'))['db'];function respondWithStatusCode(_0x3a8cad,_0x4edc24){_0x4edc24=_0x4edc24||0xcc;return function(_0x581f37){if(_0x581f37){return _0x3a8cad['sendStatus'](_0x4edc24);}return _0x3a8cad['status'](_0x4edc24)[_0xdc43('0x16')]();};}function respondWithResult(_0x3f3960,_0x35aa56){_0x35aa56=_0x35aa56||0xc8;return function(_0x356a72){if(_0x356a72){return _0x3f3960[_0xdc43('0x17')](_0x35aa56)[_0xdc43('0x18')](_0x356a72);}};}function respondWithFilteredResult(_0x3b66d7,_0x4b5bf7){return function(_0x1e27c1){if(_0x1e27c1){var _0x438f1c=typeof _0x4b5bf7['offset']===_0xdc43('0x19')&&typeof _0x4b5bf7[_0xdc43('0x1a')]==='undefined';var _0xc600b0=_0x1e27c1[_0xdc43('0x1b')];var _0x7cc856=_0x438f1c?0x0:_0x4b5bf7[_0xdc43('0x1c')];var _0x5c2350=_0x438f1c?_0x1e27c1[_0xdc43('0x1b')]:_0x4b5bf7[_0xdc43('0x1c')]+_0x4b5bf7[_0xdc43('0x1a')];var _0x5ca052;if(_0x5c2350>=_0xc600b0){_0x5c2350=_0xc600b0;_0x5ca052=0xc8;}else{_0x5ca052=0xce;}_0x3b66d7[_0xdc43('0x17')](_0x5ca052);return _0x3b66d7[_0xdc43('0x1d')]('Content-Range',_0x7cc856+'-'+_0x5c2350+'/'+_0xc600b0)[_0xdc43('0x18')](_0x1e27c1);}return null;};}function patchUpdates(_0x378791){return function(_0x9b89b5){try{jsonpatch['apply'](_0x9b89b5,_0x378791,!![]);}catch(_0x3e5905){return BPromise[_0xdc43('0x1e')](_0x3e5905);}return _0x9b89b5[_0xdc43('0x1f')]();};}function saveUpdates(_0x13bef3,_0x23524d){return function(_0x1750da){if(_0x1750da){return _0x1750da[_0xdc43('0x20')](_0x13bef3)[_0xdc43('0x21')](function(_0x45809e){return _0x45809e;});}return null;};}function removeEntity(_0x1d1068,_0x5ceaa3){return function(_0x2d2078){if(_0x2d2078){return _0x2d2078[_0xdc43('0x22')]()[_0xdc43('0x21')](function(){_0x1d1068[_0xdc43('0x17')](0xcc)[_0xdc43('0x16')]();});}};}function handleEntityNotFound(_0x2b7026,_0x2cc73e){return function(_0x3851b5){if(!_0x3851b5){_0x2b7026[_0xdc43('0x23')](0x194);}return _0x3851b5;};}function handleError(_0x2f4b5e,_0x50348c){_0x50348c=_0x50348c||0x1f4;return function(_0x2c72bd){logger['error'](_0x2c72bd[_0xdc43('0x24')]);if(_0x2c72bd[_0xdc43('0x25')]){delete _0x2c72bd[_0xdc43('0x25')];}_0x2f4b5e['status'](_0x50348c)[_0xdc43('0x26')](_0x2c72bd);};}exports[_0xdc43('0x27')]=function(_0xca1515,_0x27b1b7){var _0x568acc={},_0x28d7e0={},_0x169d6e={'count':0x0,'rows':[]};var _0x3eca1c=_[_0xdc43('0x28')](db['ZendeskConfiguration'][_0xdc43('0x29')],function(_0x5b38c2){return{'name':_0x5b38c2[_0xdc43('0x2a')],'type':_0x5b38c2[_0xdc43('0x2b')][_0xdc43('0x2c')]};});_0x28d7e0['model']=_[_0xdc43('0x28')](_0x3eca1c,_0xdc43('0x25'));_0x28d7e0['query']=_['keys'](_0xca1515[_0xdc43('0x2d')]);_0x28d7e0[_0xdc43('0x2e')]=_[_0xdc43('0x2f')](_0x28d7e0[_0xdc43('0x30')],_0x28d7e0[_0xdc43('0x2d')]);_0x568acc['attributes']=_[_0xdc43('0x2f')](_0x28d7e0[_0xdc43('0x30')],qs[_0xdc43('0x31')](_0xca1515['query'][_0xdc43('0x31')]));_0x568acc['attributes']=_0x568acc[_0xdc43('0x32')][_0xdc43('0x33')]?_0x568acc['attributes']:_0x28d7e0[_0xdc43('0x30')];if(!_0xca1515[_0xdc43('0x2d')][_0xdc43('0x34')](_0xdc43('0x35'))){_0x568acc[_0xdc43('0x1a')]=qs[_0xdc43('0x1a')](_0xca1515[_0xdc43('0x2d')][_0xdc43('0x1a')]);_0x568acc['offset']=qs[_0xdc43('0x1c')](_0xca1515[_0xdc43('0x2d')]['offset']);}_0x568acc[_0xdc43('0x36')]=qs['sort'](_0xca1515[_0xdc43('0x2d')][_0xdc43('0x37')]);_0x568acc[_0xdc43('0x38')]=qs['filters'](_[_0xdc43('0x39')](_0xca1515[_0xdc43('0x2d')],_0x28d7e0['filters']),_0x3eca1c);if(_0xca1515[_0xdc43('0x2d')][_0xdc43('0x3a')]){_0x568acc['where']=_[_0xdc43('0x3b')](_0x568acc['where'],{'$or':_[_0xdc43('0x28')](_0x3eca1c,function(_0x2ba289){if(_0x2ba289['type']!==_0xdc43('0x3c')){var _0x9394e6={};_0x9394e6[_0x2ba289['name']]={'$like':'%'+_0xca1515[_0xdc43('0x2d')][_0xdc43('0x3a')]+'%'};return _0x9394e6;}})});}_0x568acc=_[_0xdc43('0x3b')]({},_0x568acc,_0xca1515[_0xdc43('0x3d')]);var _0x848b36={'where':_0x568acc[_0xdc43('0x38')]};return db[_0xdc43('0x3e')][_0xdc43('0x1b')](_0x848b36)[_0xdc43('0x21')](function(_0xdd401){_0x169d6e[_0xdc43('0x1b')]=_0xdd401;if(_0xca1515[_0xdc43('0x2d')][_0xdc43('0x3f')]){_0x568acc[_0xdc43('0x40')]=[{'all':!![]}];}return db[_0xdc43('0x3e')][_0xdc43('0x41')](_0x568acc);})['then'](function(_0x433a77){_0x169d6e[_0xdc43('0x42')]=_0x433a77;return _0x169d6e;})[_0xdc43('0x21')](respondWithFilteredResult(_0x27b1b7,_0x568acc))[_0xdc43('0x43')](handleError(_0x27b1b7,null));};exports[_0xdc43('0x44')]=function(_0x1b682c,_0x44b091){var _0x1128c6={'raw':![],'where':{'id':_0x1b682c[_0xdc43('0x45')]['id']}},_0x62476c={};_0x62476c['model']=_[_0xdc43('0x46')](db['ZendeskConfiguration']['rawAttributes']);_0x62476c['query']=_['keys'](_0x1b682c[_0xdc43('0x2d')]);_0x62476c['filters']=_[_0xdc43('0x2f')](_0x62476c[_0xdc43('0x30')],_0x62476c[_0xdc43('0x2d')]);_0x1128c6[_0xdc43('0x32')]=_['intersection'](_0x62476c[_0xdc43('0x30')],qs['fields'](_0x1b682c[_0xdc43('0x2d')][_0xdc43('0x31')]));_0x1128c6[_0xdc43('0x32')]=_0x1128c6['attributes'][_0xdc43('0x33')]?_0x1128c6[_0xdc43('0x32')]:_0x62476c['model'];if(_0x1b682c[_0xdc43('0x2d')][_0xdc43('0x3f')]){_0x1128c6[_0xdc43('0x40')]=[{'all':!![]}];}_0x1128c6=_[_0xdc43('0x3b')]({},_0x1128c6,_0x1b682c[_0xdc43('0x3d')]);return db[_0xdc43('0x3e')][_0xdc43('0x47')](_0x1128c6)[_0xdc43('0x21')](handleEntityNotFound(_0x44b091,null))[_0xdc43('0x21')](respondWithResult(_0x44b091,null))[_0xdc43('0x43')](handleError(_0x44b091,null));};exports[_0xdc43('0x48')]=function(_0x13179a,_0x2b3aba){return db['ZendeskConfiguration'][_0xdc43('0x48')](_0x13179a[_0xdc43('0x49')],{})[_0xdc43('0x21')](respondWithResult(_0x2b3aba,0xc9))[_0xdc43('0x43')](handleError(_0x2b3aba,null));};exports[_0xdc43('0x20')]=function(_0x2c07e3,_0x53bf47){if(_0x2c07e3[_0xdc43('0x49')]['id']){delete _0x2c07e3[_0xdc43('0x49')]['id'];}return db[_0xdc43('0x3e')][_0xdc43('0x47')]({'where':{'id':_0x2c07e3[_0xdc43('0x45')]['id']}})[_0xdc43('0x21')](handleEntityNotFound(_0x53bf47,null))[_0xdc43('0x21')](saveUpdates(_0x2c07e3[_0xdc43('0x49')],null))[_0xdc43('0x21')](respondWithResult(_0x53bf47,null))['catch'](handleError(_0x53bf47,null));};exports[_0xdc43('0x22')]=function(_0x5a7097,_0x1c8770){return db[_0xdc43('0x3e')][_0xdc43('0x47')]({'where':{'id':_0x5a7097['params']['id']}})[_0xdc43('0x21')](handleEntityNotFound(_0x1c8770,null))[_0xdc43('0x21')](removeEntity(_0x1c8770,null))[_0xdc43('0x43')](handleError(_0x1c8770,null));};exports[_0xdc43('0x4a')]=function(_0x351724,_0x5c6826,_0x1b7fc8){var _0x541746={};var _0x49e9b9={};var _0x4f4a34;var _0x805748;return db['ZendeskConfiguration'][_0xdc43('0x4b')]({'where':{'id':_0x351724[_0xdc43('0x45')]['id']}})[_0xdc43('0x21')](handleEntityNotFound(_0x5c6826,null))['then'](function(_0x5eee91){if(_0x5eee91){_0x4f4a34=_0x5eee91;_0x49e9b9[_0xdc43('0x30')]=_[_0xdc43('0x46')](db['ZendeskField'][_0xdc43('0x29')]);_0x49e9b9[_0xdc43('0x2d')]=_['keys'](_0x351724[_0xdc43('0x2d')]);_0x49e9b9[_0xdc43('0x2e')]=_[_0xdc43('0x2f')](_0x49e9b9['model'],_0x49e9b9[_0xdc43('0x2d')]);_0x541746[_0xdc43('0x32')]=_[_0xdc43('0x2f')](_0x49e9b9[_0xdc43('0x30')],qs[_0xdc43('0x31')](_0x351724[_0xdc43('0x2d')][_0xdc43('0x31')]));_0x541746['attributes']=_0x541746['attributes'][_0xdc43('0x33')]?_0x541746['attributes']:_0x49e9b9[_0xdc43('0x30')];_0x541746[_0xdc43('0x36')]=qs[_0xdc43('0x37')](_0x351724[_0xdc43('0x2d')]['sort']);_0x541746[_0xdc43('0x38')]=qs['filters'](_[_0xdc43('0x39')](_0x351724[_0xdc43('0x2d')],_0x49e9b9['filters']));if(_0x351724[_0xdc43('0x2d')][_0xdc43('0x3a')]){_0x541746[_0xdc43('0x38')]=_[_0xdc43('0x3b')](_0x541746[_0xdc43('0x38')],{'$or':_[_0xdc43('0x28')](_0x541746['attributes'],function(_0x22d07e){var _0x5aea19={};_0x5aea19[_0x22d07e]={'$like':'%'+_0x351724[_0xdc43('0x2d')]['filter']+'%'};return _0x5aea19;})});}_0x541746=_[_0xdc43('0x3b')]({},_0x541746,_0x351724[_0xdc43('0x3d')]);return _0x4f4a34['getFields'](_0x541746);}})['then'](function(_0x280657){if(_0x280657){_0x805748=_0x280657[_0xdc43('0x33')];if(!_0x351724[_0xdc43('0x2d')][_0xdc43('0x34')](_0xdc43('0x35'))){_0x541746['limit']=qs['limit'](_0x351724[_0xdc43('0x2d')]['limit']);_0x541746[_0xdc43('0x1c')]=qs['offset'](_0x351724[_0xdc43('0x2d')][_0xdc43('0x1c')]);}return _0x4f4a34['getFields'](_0x541746);}})[_0xdc43('0x21')](function(_0x5b2b31){if(_0x5b2b31){return _0x5b2b31?{'count':_0x805748,'rows':_0x5b2b31}:null;}})[_0xdc43('0x21')](respondWithResult(_0x5c6826,null))[_0xdc43('0x43')](handleError(_0x5c6826,null));};exports[_0xdc43('0x4c')]=function(_0x3841c2,_0x4ad2cf,_0x5ddb42){var _0x5470cc={};var _0x3f1f57={};var _0x115cea;var _0x2b10bf;return db[_0xdc43('0x3e')][_0xdc43('0x4b')]({'where':{'id':_0x3841c2[_0xdc43('0x45')]['id']}})[_0xdc43('0x21')](handleEntityNotFound(_0x4ad2cf,null))[_0xdc43('0x21')](function(_0x1d741c){if(_0x1d741c){_0x115cea=_0x1d741c;_0x3f1f57[_0xdc43('0x30')]=_['keys'](db[_0xdc43('0x4d')][_0xdc43('0x29')]);_0x3f1f57[_0xdc43('0x2d')]=_[_0xdc43('0x46')](_0x3841c2[_0xdc43('0x2d')]);_0x3f1f57[_0xdc43('0x2e')]=_[_0xdc43('0x2f')](_0x3f1f57[_0xdc43('0x30')],_0x3f1f57[_0xdc43('0x2d')]);_0x5470cc[_0xdc43('0x32')]=_[_0xdc43('0x2f')](_0x3f1f57[_0xdc43('0x30')],qs[_0xdc43('0x31')](_0x3841c2[_0xdc43('0x2d')]['fields']));_0x5470cc[_0xdc43('0x32')]=_0x5470cc[_0xdc43('0x32')]['length']?_0x5470cc[_0xdc43('0x32')]:_0x3f1f57[_0xdc43('0x30')];_0x5470cc[_0xdc43('0x36')]=qs[_0xdc43('0x37')](_0x3841c2['query'][_0xdc43('0x37')]);_0x5470cc[_0xdc43('0x38')]=qs[_0xdc43('0x2e')](_[_0xdc43('0x39')](_0x3841c2[_0xdc43('0x2d')],_0x3f1f57[_0xdc43('0x2e')]));if(_0x3841c2[_0xdc43('0x2d')][_0xdc43('0x3a')]){_0x5470cc[_0xdc43('0x38')]=_['merge'](_0x5470cc[_0xdc43('0x38')],{'$or':_['map'](_0x5470cc['attributes'],function(_0x1a17f1){var _0x4d86e1={};_0x4d86e1[_0x1a17f1]={'$like':'%'+_0x3841c2[_0xdc43('0x2d')]['filter']+'%'};return _0x4d86e1;})});}_0x5470cc=_[_0xdc43('0x3b')]({},_0x5470cc,_0x3841c2[_0xdc43('0x3d')]);return _0x115cea[_0xdc43('0x4c')](_0x5470cc);}})[_0xdc43('0x21')](function(_0x581549){if(_0x581549){_0x2b10bf=_0x581549[_0xdc43('0x33')];if(!_0x3841c2[_0xdc43('0x2d')][_0xdc43('0x34')](_0xdc43('0x35'))){_0x5470cc[_0xdc43('0x1a')]=qs[_0xdc43('0x1a')](_0x3841c2['query'][_0xdc43('0x1a')]);_0x5470cc[_0xdc43('0x1c')]=qs[_0xdc43('0x1c')](_0x3841c2[_0xdc43('0x2d')][_0xdc43('0x1c')]);}return _0x115cea['getSubjects'](_0x5470cc);}})[_0xdc43('0x21')](function(_0x3907ad){if(_0x3907ad){return _0x3907ad?{'count':_0x2b10bf,'rows':_0x3907ad}:null;}})[_0xdc43('0x21')](respondWithResult(_0x4ad2cf,null))['catch'](handleError(_0x4ad2cf,null));};exports[_0xdc43('0x4e')]=function(_0x35027a,_0x54a776,_0x53fa7e){var _0x580a13={};var _0x194932={};var _0x5732a8;var _0x5226a7;return db['ZendeskConfiguration'][_0xdc43('0x4b')]({'where':{'id':_0x35027a[_0xdc43('0x45')]['id']}})[_0xdc43('0x21')](handleEntityNotFound(_0x54a776,null))[_0xdc43('0x21')](function(_0x4dcc68){if(_0x4dcc68){_0x5732a8=_0x4dcc68;_0x194932[_0xdc43('0x30')]=_['keys'](db[_0xdc43('0x4d')][_0xdc43('0x29')]);_0x194932[_0xdc43('0x2d')]=_[_0xdc43('0x46')](_0x35027a[_0xdc43('0x2d')]);_0x194932[_0xdc43('0x2e')]=_['intersection'](_0x194932[_0xdc43('0x30')],_0x194932['query']);_0x580a13['attributes']=_['intersection'](_0x194932[_0xdc43('0x30')],qs[_0xdc43('0x31')](_0x35027a['query']['fields']));_0x580a13[_0xdc43('0x32')]=_0x580a13[_0xdc43('0x32')]['length']?_0x580a13[_0xdc43('0x32')]:_0x194932[_0xdc43('0x30')];_0x580a13['order']=qs[_0xdc43('0x37')](_0x35027a[_0xdc43('0x2d')]['sort']);_0x580a13[_0xdc43('0x38')]=qs[_0xdc43('0x2e')](_[_0xdc43('0x39')](_0x35027a[_0xdc43('0x2d')],_0x194932[_0xdc43('0x2e')]));if(_0x35027a[_0xdc43('0x2d')][_0xdc43('0x3a')]){_0x580a13[_0xdc43('0x38')]=_[_0xdc43('0x3b')](_0x580a13[_0xdc43('0x38')],{'$or':_['map'](_0x580a13[_0xdc43('0x32')],function(_0x2c4105){var _0xe90249={};_0xe90249[_0x2c4105]={'$like':'%'+_0x35027a[_0xdc43('0x2d')][_0xdc43('0x3a')]+'%'};return _0xe90249;})});}_0x580a13=_[_0xdc43('0x3b')]({},_0x580a13,_0x35027a[_0xdc43('0x3d')]);return _0x5732a8[_0xdc43('0x4e')](_0x580a13);}})[_0xdc43('0x21')](function(_0x19d044){if(_0x19d044){_0x5226a7=_0x19d044[_0xdc43('0x33')];if(!_0x35027a[_0xdc43('0x2d')][_0xdc43('0x34')](_0xdc43('0x35'))){_0x580a13['limit']=qs['limit'](_0x35027a['query'][_0xdc43('0x1a')]);_0x580a13['offset']=qs['offset'](_0x35027a[_0xdc43('0x2d')][_0xdc43('0x1c')]);}return _0x5732a8[_0xdc43('0x4e')](_0x580a13);}})[_0xdc43('0x21')](function(_0x4e8786){if(_0x4e8786){return _0x4e8786?{'count':_0x5226a7,'rows':_0x4e8786}:null;}})[_0xdc43('0x21')](respondWithResult(_0x54a776,null))[_0xdc43('0x43')](handleError(_0x54a776,null));};exports[_0xdc43('0x4f')]=function(_0x2650b3,_0x5e2dbc,_0x2556d8){var _0x34f4ec={};var _0x4bc62f={};var _0x422d02;var _0x42928b;return db[_0xdc43('0x3e')][_0xdc43('0x4b')]({'where':{'id':_0x2650b3[_0xdc43('0x45')]['id']}})[_0xdc43('0x21')](handleEntityNotFound(_0x5e2dbc,null))[_0xdc43('0x21')](function(_0x2abc26){if(_0x2abc26){_0x422d02=_0x2abc26;_0x4bc62f['model']=_['keys'](db[_0xdc43('0x50')]['rawAttributes']);_0x4bc62f[_0xdc43('0x2d')]=_['keys'](_0x2650b3[_0xdc43('0x2d')]);_0x4bc62f['filters']=_[_0xdc43('0x2f')](_0x4bc62f['model'],_0x4bc62f['query']);_0x34f4ec['attributes']=_[_0xdc43('0x2f')](_0x4bc62f[_0xdc43('0x30')],qs[_0xdc43('0x31')](_0x2650b3[_0xdc43('0x2d')][_0xdc43('0x31')]));_0x34f4ec[_0xdc43('0x32')]=_0x34f4ec[_0xdc43('0x32')]['length']?_0x34f4ec[_0xdc43('0x32')]:_0x4bc62f[_0xdc43('0x30')];_0x34f4ec['order']=qs[_0xdc43('0x37')](_0x2650b3['query'][_0xdc43('0x37')]);_0x34f4ec[_0xdc43('0x38')]=qs[_0xdc43('0x2e')](_[_0xdc43('0x39')](_0x2650b3[_0xdc43('0x2d')],_0x4bc62f['filters']));if(_0x2650b3[_0xdc43('0x2d')]['filter']){_0x34f4ec[_0xdc43('0x38')]=_[_0xdc43('0x3b')](_0x34f4ec[_0xdc43('0x38')],{'$or':_[_0xdc43('0x28')](_0x34f4ec['attributes'],function(_0x52fe6d){var _0x225318={};_0x225318[_0x52fe6d]={'$like':'%'+_0x2650b3[_0xdc43('0x2d')][_0xdc43('0x3a')]+'%'};return _0x225318;})});}_0x34f4ec=_[_0xdc43('0x3b')]({},_0x34f4ec,_0x2650b3[_0xdc43('0x3d')]);return _0x422d02['getTags'](_0x34f4ec);}})[_0xdc43('0x21')](function(_0x2c623c){if(_0x2c623c){_0x42928b=_0x2c623c[_0xdc43('0x33')];if(!_0x2650b3[_0xdc43('0x2d')]['hasOwnProperty'](_0xdc43('0x35'))){_0x34f4ec['limit']=qs[_0xdc43('0x1a')](_0x2650b3[_0xdc43('0x2d')][_0xdc43('0x1a')]);_0x34f4ec['offset']=qs['offset'](_0x2650b3[_0xdc43('0x2d')][_0xdc43('0x1c')]);}return _0x422d02['getTags'](_0x34f4ec);}})[_0xdc43('0x21')](function(_0xb23c50){if(_0xb23c50){return _0xb23c50?{'count':_0x42928b,'rows':_0xb23c50}:null;}})['then'](respondWithResult(_0x5e2dbc,null))[_0xdc43('0x43')](handleError(_0x5e2dbc,null));};exports[_0xdc43('0x51')]=function(_0x4efcd6,_0x143d13,_0x375c4a){if(_0x4efcd6[_0xdc43('0x49')]['id']){delete _0x4efcd6[_0xdc43('0x49')]['id'];}return db[_0xdc43('0x3e')][_0xdc43('0x4b')]({'where':{'id':_0x4efcd6['params']['id']}})[_0xdc43('0x21')](handleEntityNotFound(_0x143d13,null))[_0xdc43('0x21')](function(_0x40cf39){if(_0x40cf39){return _0x40cf39['setTags'](_0x4efcd6[_0xdc43('0x49')]['ids']||[]);}return null;})[_0xdc43('0x21')](respondWithResult(_0x143d13,null))[_0xdc43('0x43')](handleError(_0x143d13,null));};
\ No newline at end of file
+var _0x094a=['send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','getSubjects','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','name'];(function(_0x4e9d3c,_0x1f4b98){var _0x2d0825=function(_0x384676){while(--_0x384676){_0x4e9d3c['push'](_0x4e9d3c['shift']());}};_0x2d0825(++_0x1f4b98);}(_0x094a,0x11f));var _0xa094=function(_0x270e98,_0x6bc28c){_0x270e98=_0x270e98-0x0;var _0x278e24=_0x094a[_0x270e98];return _0x278e24;};'use strict';var emlformat=require(_0xa094('0x0'));var rimraf=require(_0xa094('0x1'));var zipdir=require(_0xa094('0x2'));var jsonpatch=require(_0xa094('0x3'));var rp=require('request-promise');var moment=require(_0xa094('0x4'));var BPromise=require(_0xa094('0x5'));var Mustache=require('mustache');var util=require(_0xa094('0x6'));var path=require(_0xa094('0x7'));var sox=require(_0xa094('0x8'));var csv=require('to-csv');var ejs=require(_0xa094('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa094('0xa'));var squel=require(_0xa094('0xb'));var crypto=require(_0xa094('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa094('0xd'));var toCsv=require(_0xa094('0xe'));var querystring=require(_0xa094('0xf'));var Papa=require(_0xa094('0x10'));var Redis=require('ioredis');var authService=require(_0xa094('0x11'));var qs=require(_0xa094('0x12'));var as=require(_0xa094('0x13'));var hardwareService=require(_0xa094('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xa094('0x15'));var config=require(_0xa094('0x16'));var licenseUtil=require(_0xa094('0x17'));var db=require(_0xa094('0x18'))['db'];function respondWithStatusCode(_0x862e4,_0x2eb122){_0x2eb122=_0x2eb122||0xcc;return function(_0x50dd47){if(_0x50dd47){return _0x862e4[_0xa094('0x19')](_0x2eb122);}return _0x862e4[_0xa094('0x1a')](_0x2eb122)[_0xa094('0x1b')]();};}function respondWithResult(_0x17076a,_0x3b4760){_0x3b4760=_0x3b4760||0xc8;return function(_0x59163c){if(_0x59163c){return _0x17076a[_0xa094('0x1a')](_0x3b4760)[_0xa094('0x1c')](_0x59163c);}};}function respondWithFilteredResult(_0x34699f,_0x2b340c){return function(_0x16dc14){if(_0x16dc14){var _0x2e63ce=typeof _0x2b340c[_0xa094('0x1d')]===_0xa094('0x1e')&&typeof _0x2b340c[_0xa094('0x1f')]===_0xa094('0x1e');var _0x1319c8=_0x16dc14[_0xa094('0x20')];var _0x115990=_0x2e63ce?0x0:_0x2b340c[_0xa094('0x1d')];var _0x1f3abd=_0x2e63ce?_0x16dc14[_0xa094('0x20')]:_0x2b340c[_0xa094('0x1d')]+_0x2b340c[_0xa094('0x1f')];var _0x262d3a;if(_0x1f3abd>=_0x1319c8){_0x1f3abd=_0x1319c8;_0x262d3a=0xc8;}else{_0x262d3a=0xce;}_0x34699f[_0xa094('0x1a')](_0x262d3a);return _0x34699f[_0xa094('0x21')](_0xa094('0x22'),_0x115990+'-'+_0x1f3abd+'/'+_0x1319c8)[_0xa094('0x1c')](_0x16dc14);}return null;};}function patchUpdates(_0x2335c){return function(_0x4feae1){try{jsonpatch['apply'](_0x4feae1,_0x2335c,!![]);}catch(_0x5a2344){return BPromise['reject'](_0x5a2344);}return _0x4feae1[_0xa094('0x23')]();};}function saveUpdates(_0x16acac,_0x41b069){return function(_0xf9be6b){if(_0xf9be6b){return _0xf9be6b[_0xa094('0x24')](_0x16acac)['then'](function(_0x130562){return _0x130562;});}return null;};}function removeEntity(_0x581223,_0x4f8b58){return function(_0x31c88){if(_0x31c88){return _0x31c88[_0xa094('0x25')]()[_0xa094('0x26')](function(){_0x581223[_0xa094('0x1a')](0xcc)[_0xa094('0x1b')]();});}};}function handleEntityNotFound(_0x541f21,_0x43c629){return function(_0x1eabf7){if(!_0x1eabf7){_0x541f21[_0xa094('0x19')](0x194);}return _0x1eabf7;};}function handleError(_0x4da869,_0xde1de0){_0xde1de0=_0xde1de0||0x1f4;return function(_0x180e30){logger[_0xa094('0x27')](_0x180e30['stack']);if(_0x180e30[_0xa094('0x28')]){delete _0x180e30[_0xa094('0x28')];}_0x4da869[_0xa094('0x1a')](_0xde1de0)[_0xa094('0x29')](_0x180e30);};}exports[_0xa094('0x2a')]=function(_0x2e82d8,_0x408c1d){var _0x5bd5d0={},_0x5b28cb={},_0x16176f={'count':0x0,'rows':[]};var _0x59aeef=_[_0xa094('0x2b')](db[_0xa094('0x2c')][_0xa094('0x2d')],function(_0x47ce0b){return{'name':_0x47ce0b[_0xa094('0x2e')],'type':_0x47ce0b[_0xa094('0x2f')]['key']};});_0x5b28cb[_0xa094('0x30')]=_[_0xa094('0x2b')](_0x59aeef,_0xa094('0x28'));_0x5b28cb[_0xa094('0x31')]=_[_0xa094('0x32')](_0x2e82d8[_0xa094('0x31')]);_0x5b28cb[_0xa094('0x33')]=_[_0xa094('0x34')](_0x5b28cb[_0xa094('0x30')],_0x5b28cb[_0xa094('0x31')]);_0x5bd5d0[_0xa094('0x35')]=_[_0xa094('0x34')](_0x5b28cb['model'],qs['fields'](_0x2e82d8[_0xa094('0x31')][_0xa094('0x36')]));_0x5bd5d0[_0xa094('0x35')]=_0x5bd5d0[_0xa094('0x35')][_0xa094('0x37')]?_0x5bd5d0[_0xa094('0x35')]:_0x5b28cb['model'];if(!_0x2e82d8['query'][_0xa094('0x38')](_0xa094('0x39'))){_0x5bd5d0['limit']=qs['limit'](_0x2e82d8[_0xa094('0x31')]['limit']);_0x5bd5d0[_0xa094('0x1d')]=qs['offset'](_0x2e82d8[_0xa094('0x31')]['offset']);}_0x5bd5d0[_0xa094('0x3a')]=qs[_0xa094('0x3b')](_0x2e82d8[_0xa094('0x31')][_0xa094('0x3b')]);_0x5bd5d0['where']=qs[_0xa094('0x33')](_[_0xa094('0x3c')](_0x2e82d8['query'],_0x5b28cb[_0xa094('0x33')]),_0x59aeef);if(_0x2e82d8[_0xa094('0x31')][_0xa094('0x3d')]){_0x5bd5d0['where']=_[_0xa094('0x3e')](_0x5bd5d0['where'],{'$or':_[_0xa094('0x2b')](_0x59aeef,function(_0x305a9c){if(_0x305a9c['type']!=='VIRTUAL'){var _0x2b2c9d={};_0x2b2c9d[_0x305a9c[_0xa094('0x28')]]={'$like':'%'+_0x2e82d8['query'][_0xa094('0x3d')]+'%'};return _0x2b2c9d;}})});}_0x5bd5d0=_[_0xa094('0x3e')]({},_0x5bd5d0,_0x2e82d8[_0xa094('0x3f')]);var _0x1ac617={'where':_0x5bd5d0[_0xa094('0x40')]};return db[_0xa094('0x2c')]['count'](_0x1ac617)[_0xa094('0x26')](function(_0x8683db){_0x16176f['count']=_0x8683db;if(_0x2e82d8[_0xa094('0x31')][_0xa094('0x41')]){_0x5bd5d0[_0xa094('0x42')]=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xa094('0x43')](_0x5bd5d0);})[_0xa094('0x26')](function(_0x1a36a0){_0x16176f[_0xa094('0x44')]=_0x1a36a0;return _0x16176f;})[_0xa094('0x26')](respondWithFilteredResult(_0x408c1d,_0x5bd5d0))[_0xa094('0x45')](handleError(_0x408c1d,null));};exports[_0xa094('0x46')]=function(_0x30d044,_0x14e642){var _0x292f8a={'raw':![],'where':{'id':_0x30d044[_0xa094('0x47')]['id']}},_0x1a2bfa={};_0x1a2bfa[_0xa094('0x30')]=_[_0xa094('0x32')](db['ZendeskConfiguration'][_0xa094('0x2d')]);_0x1a2bfa[_0xa094('0x31')]=_[_0xa094('0x32')](_0x30d044[_0xa094('0x31')]);_0x1a2bfa[_0xa094('0x33')]=_[_0xa094('0x34')](_0x1a2bfa[_0xa094('0x30')],_0x1a2bfa[_0xa094('0x31')]);_0x292f8a[_0xa094('0x35')]=_[_0xa094('0x34')](_0x1a2bfa[_0xa094('0x30')],qs['fields'](_0x30d044[_0xa094('0x31')][_0xa094('0x36')]));_0x292f8a[_0xa094('0x35')]=_0x292f8a['attributes'][_0xa094('0x37')]?_0x292f8a[_0xa094('0x35')]:_0x1a2bfa[_0xa094('0x30')];if(_0x30d044['query'][_0xa094('0x41')]){_0x292f8a[_0xa094('0x42')]=[{'all':!![]}];}_0x292f8a=_[_0xa094('0x3e')]({},_0x292f8a,_0x30d044['options']);return db[_0xa094('0x2c')][_0xa094('0x48')](_0x292f8a)[_0xa094('0x26')](handleEntityNotFound(_0x14e642,null))[_0xa094('0x26')](respondWithResult(_0x14e642,null))[_0xa094('0x45')](handleError(_0x14e642,null));};exports['create']=function(_0xe8a9d9,_0x5acf6a){return db[_0xa094('0x2c')][_0xa094('0x49')](_0xe8a9d9[_0xa094('0x4a')],{})[_0xa094('0x26')](respondWithResult(_0x5acf6a,0xc9))[_0xa094('0x45')](handleError(_0x5acf6a,null));};exports['update']=function(_0x3e2b38,_0x2c78f5){if(_0x3e2b38[_0xa094('0x4a')]['id']){delete _0x3e2b38[_0xa094('0x4a')]['id'];}return db[_0xa094('0x2c')][_0xa094('0x48')]({'where':{'id':_0x3e2b38[_0xa094('0x47')]['id']}})[_0xa094('0x26')](handleEntityNotFound(_0x2c78f5,null))[_0xa094('0x26')](saveUpdates(_0x3e2b38['body'],null))[_0xa094('0x26')](respondWithResult(_0x2c78f5,null))[_0xa094('0x45')](handleError(_0x2c78f5,null));};exports[_0xa094('0x25')]=function(_0x1ea48c,_0x35b073){return db[_0xa094('0x2c')][_0xa094('0x48')]({'where':{'id':_0x1ea48c[_0xa094('0x47')]['id']}})['then'](handleEntityNotFound(_0x35b073,null))[_0xa094('0x26')](removeEntity(_0x35b073,null))['catch'](handleError(_0x35b073,null));};exports[_0xa094('0x4b')]=function(_0x306007,_0x965235,_0x4238ce){var _0x39a21a={};var _0x4b70a0={};var _0x30be7b;var _0x4e454a;return db['ZendeskConfiguration'][_0xa094('0x4c')]({'where':{'id':_0x306007[_0xa094('0x47')]['id']}})[_0xa094('0x26')](handleEntityNotFound(_0x965235,null))[_0xa094('0x26')](function(_0x39c121){if(_0x39c121){_0x30be7b=_0x39c121;_0x4b70a0[_0xa094('0x30')]=_[_0xa094('0x32')](db['ZendeskField']['rawAttributes']);_0x4b70a0['query']=_[_0xa094('0x32')](_0x306007[_0xa094('0x31')]);_0x4b70a0[_0xa094('0x33')]=_[_0xa094('0x34')](_0x4b70a0[_0xa094('0x30')],_0x4b70a0['query']);_0x39a21a[_0xa094('0x35')]=_['intersection'](_0x4b70a0[_0xa094('0x30')],qs['fields'](_0x306007[_0xa094('0x31')]['fields']));_0x39a21a[_0xa094('0x35')]=_0x39a21a[_0xa094('0x35')][_0xa094('0x37')]?_0x39a21a[_0xa094('0x35')]:_0x4b70a0[_0xa094('0x30')];_0x39a21a['order']=qs['sort'](_0x306007[_0xa094('0x31')]['sort']);_0x39a21a['where']=qs[_0xa094('0x33')](_[_0xa094('0x3c')](_0x306007[_0xa094('0x31')],_0x4b70a0[_0xa094('0x33')]));if(_0x306007[_0xa094('0x31')][_0xa094('0x3d')]){_0x39a21a[_0xa094('0x40')]=_[_0xa094('0x3e')](_0x39a21a[_0xa094('0x40')],{'$or':_[_0xa094('0x2b')](_0x39a21a[_0xa094('0x35')],function(_0x164398){var _0x3459b6={};_0x3459b6[_0x164398]={'$like':'%'+_0x306007[_0xa094('0x31')][_0xa094('0x3d')]+'%'};return _0x3459b6;})});}_0x39a21a=_['merge']({},_0x39a21a,_0x306007['options']);return _0x30be7b[_0xa094('0x4b')](_0x39a21a);}})[_0xa094('0x26')](function(_0x1c1413){if(_0x1c1413){_0x4e454a=_0x1c1413[_0xa094('0x37')];if(!_0x306007[_0xa094('0x31')]['hasOwnProperty'](_0xa094('0x39'))){_0x39a21a[_0xa094('0x1f')]=qs['limit'](_0x306007[_0xa094('0x31')]['limit']);_0x39a21a[_0xa094('0x1d')]=qs[_0xa094('0x1d')](_0x306007['query']['offset']);}return _0x30be7b[_0xa094('0x4b')](_0x39a21a);}})['then'](function(_0x62e947){if(_0x62e947){return _0x62e947?{'count':_0x4e454a,'rows':_0x62e947}:null;}})['then'](respondWithResult(_0x965235,null))[_0xa094('0x45')](handleError(_0x965235,null));};exports['getSubjects']=function(_0x439212,_0x48e841,_0x554e7a){var _0x1aad82={};var _0x32a074={};var _0x2fb64b;var _0x70755d;return db[_0xa094('0x2c')][_0xa094('0x4c')]({'where':{'id':_0x439212[_0xa094('0x47')]['id']}})['then'](handleEntityNotFound(_0x48e841,null))[_0xa094('0x26')](function(_0x47a42c){if(_0x47a42c){_0x2fb64b=_0x47a42c;_0x32a074[_0xa094('0x30')]=_[_0xa094('0x32')](db['ZendeskField'][_0xa094('0x2d')]);_0x32a074['query']=_[_0xa094('0x32')](_0x439212[_0xa094('0x31')]);_0x32a074[_0xa094('0x33')]=_['intersection'](_0x32a074['model'],_0x32a074[_0xa094('0x31')]);_0x1aad82[_0xa094('0x35')]=_[_0xa094('0x34')](_0x32a074[_0xa094('0x30')],qs['fields'](_0x439212[_0xa094('0x31')][_0xa094('0x36')]));_0x1aad82[_0xa094('0x35')]=_0x1aad82[_0xa094('0x35')][_0xa094('0x37')]?_0x1aad82[_0xa094('0x35')]:_0x32a074[_0xa094('0x30')];_0x1aad82['order']=qs[_0xa094('0x3b')](_0x439212[_0xa094('0x31')]['sort']);_0x1aad82[_0xa094('0x40')]=qs[_0xa094('0x33')](_[_0xa094('0x3c')](_0x439212[_0xa094('0x31')],_0x32a074[_0xa094('0x33')]));if(_0x439212[_0xa094('0x31')][_0xa094('0x3d')]){_0x1aad82['where']=_[_0xa094('0x3e')](_0x1aad82[_0xa094('0x40')],{'$or':_['map'](_0x1aad82[_0xa094('0x35')],function(_0xc3d12){var _0x36b937={};_0x36b937[_0xc3d12]={'$like':'%'+_0x439212[_0xa094('0x31')][_0xa094('0x3d')]+'%'};return _0x36b937;})});}_0x1aad82=_[_0xa094('0x3e')]({},_0x1aad82,_0x439212[_0xa094('0x3f')]);return _0x2fb64b[_0xa094('0x4d')](_0x1aad82);}})['then'](function(_0x16ddeb){if(_0x16ddeb){_0x70755d=_0x16ddeb[_0xa094('0x37')];if(!_0x439212['query'][_0xa094('0x38')](_0xa094('0x39'))){_0x1aad82[_0xa094('0x1f')]=qs[_0xa094('0x1f')](_0x439212[_0xa094('0x31')][_0xa094('0x1f')]);_0x1aad82[_0xa094('0x1d')]=qs[_0xa094('0x1d')](_0x439212[_0xa094('0x31')][_0xa094('0x1d')]);}return _0x2fb64b[_0xa094('0x4d')](_0x1aad82);}})[_0xa094('0x26')](function(_0x586a86){if(_0x586a86){return _0x586a86?{'count':_0x70755d,'rows':_0x586a86}:null;}})[_0xa094('0x26')](respondWithResult(_0x48e841,null))[_0xa094('0x45')](handleError(_0x48e841,null));};exports[_0xa094('0x4e')]=function(_0x2af0fc,_0x3a3c3b,_0x2a78e7){var _0x12ad76={};var _0x535982={};var _0x19a979;var _0x5bbbb8;return db[_0xa094('0x2c')][_0xa094('0x4c')]({'where':{'id':_0x2af0fc['params']['id']}})[_0xa094('0x26')](handleEntityNotFound(_0x3a3c3b,null))[_0xa094('0x26')](function(_0x152a4c){if(_0x152a4c){_0x19a979=_0x152a4c;_0x535982[_0xa094('0x30')]=_['keys'](db['ZendeskField'][_0xa094('0x2d')]);_0x535982[_0xa094('0x31')]=_['keys'](_0x2af0fc[_0xa094('0x31')]);_0x535982['filters']=_[_0xa094('0x34')](_0x535982['model'],_0x535982['query']);_0x12ad76[_0xa094('0x35')]=_[_0xa094('0x34')](_0x535982['model'],qs['fields'](_0x2af0fc[_0xa094('0x31')][_0xa094('0x36')]));_0x12ad76[_0xa094('0x35')]=_0x12ad76[_0xa094('0x35')][_0xa094('0x37')]?_0x12ad76['attributes']:_0x535982[_0xa094('0x30')];_0x12ad76[_0xa094('0x3a')]=qs['sort'](_0x2af0fc[_0xa094('0x31')][_0xa094('0x3b')]);_0x12ad76['where']=qs[_0xa094('0x33')](_[_0xa094('0x3c')](_0x2af0fc[_0xa094('0x31')],_0x535982[_0xa094('0x33')]));if(_0x2af0fc[_0xa094('0x31')]['filter']){_0x12ad76['where']=_[_0xa094('0x3e')](_0x12ad76[_0xa094('0x40')],{'$or':_[_0xa094('0x2b')](_0x12ad76['attributes'],function(_0x324464){var _0x5dcc02={};_0x5dcc02[_0x324464]={'$like':'%'+_0x2af0fc['query'][_0xa094('0x3d')]+'%'};return _0x5dcc02;})});}_0x12ad76=_['merge']({},_0x12ad76,_0x2af0fc[_0xa094('0x3f')]);return _0x19a979['getDescriptions'](_0x12ad76);}})[_0xa094('0x26')](function(_0x33c367){if(_0x33c367){_0x5bbbb8=_0x33c367['length'];if(!_0x2af0fc[_0xa094('0x31')][_0xa094('0x38')](_0xa094('0x39'))){_0x12ad76[_0xa094('0x1f')]=qs[_0xa094('0x1f')](_0x2af0fc['query'][_0xa094('0x1f')]);_0x12ad76[_0xa094('0x1d')]=qs[_0xa094('0x1d')](_0x2af0fc[_0xa094('0x31')][_0xa094('0x1d')]);}return _0x19a979[_0xa094('0x4e')](_0x12ad76);}})[_0xa094('0x26')](function(_0x42bf86){if(_0x42bf86){return _0x42bf86?{'count':_0x5bbbb8,'rows':_0x42bf86}:null;}})[_0xa094('0x26')](respondWithResult(_0x3a3c3b,null))[_0xa094('0x45')](handleError(_0x3a3c3b,null));};exports[_0xa094('0x4f')]=function(_0x487d9e,_0x7c71ab,_0x2266a9){var _0x41aba2={};var _0x1f5864={};var _0x33842c;var _0x3bdd0a;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x487d9e[_0xa094('0x47')]['id']}})[_0xa094('0x26')](handleEntityNotFound(_0x7c71ab,null))[_0xa094('0x26')](function(_0x22a416){if(_0x22a416){_0x33842c=_0x22a416;_0x1f5864[_0xa094('0x30')]=_['keys'](db['Tag']['rawAttributes']);_0x1f5864[_0xa094('0x31')]=_[_0xa094('0x32')](_0x487d9e['query']);_0x1f5864[_0xa094('0x33')]=_[_0xa094('0x34')](_0x1f5864[_0xa094('0x30')],_0x1f5864[_0xa094('0x31')]);_0x41aba2[_0xa094('0x35')]=_['intersection'](_0x1f5864[_0xa094('0x30')],qs[_0xa094('0x36')](_0x487d9e[_0xa094('0x31')][_0xa094('0x36')]));_0x41aba2['attributes']=_0x41aba2[_0xa094('0x35')][_0xa094('0x37')]?_0x41aba2[_0xa094('0x35')]:_0x1f5864[_0xa094('0x30')];_0x41aba2['order']=qs['sort'](_0x487d9e[_0xa094('0x31')][_0xa094('0x3b')]);_0x41aba2[_0xa094('0x40')]=qs[_0xa094('0x33')](_[_0xa094('0x3c')](_0x487d9e[_0xa094('0x31')],_0x1f5864[_0xa094('0x33')]));if(_0x487d9e[_0xa094('0x31')][_0xa094('0x3d')]){_0x41aba2[_0xa094('0x40')]=_[_0xa094('0x3e')](_0x41aba2[_0xa094('0x40')],{'$or':_[_0xa094('0x2b')](_0x41aba2[_0xa094('0x35')],function(_0x5d1ee7){var _0x55abd2={};_0x55abd2[_0x5d1ee7]={'$like':'%'+_0x487d9e[_0xa094('0x31')]['filter']+'%'};return _0x55abd2;})});}_0x41aba2=_[_0xa094('0x3e')]({},_0x41aba2,_0x487d9e[_0xa094('0x3f')]);return _0x33842c[_0xa094('0x4f')](_0x41aba2);}})[_0xa094('0x26')](function(_0x10c673){if(_0x10c673){_0x3bdd0a=_0x10c673[_0xa094('0x37')];if(!_0x487d9e[_0xa094('0x31')][_0xa094('0x38')]('nolimit')){_0x41aba2[_0xa094('0x1f')]=qs[_0xa094('0x1f')](_0x487d9e[_0xa094('0x31')][_0xa094('0x1f')]);_0x41aba2[_0xa094('0x1d')]=qs['offset'](_0x487d9e[_0xa094('0x31')][_0xa094('0x1d')]);}return _0x33842c[_0xa094('0x4f')](_0x41aba2);}})['then'](function(_0x23effd){if(_0x23effd){return _0x23effd?{'count':_0x3bdd0a,'rows':_0x23effd}:null;}})[_0xa094('0x26')](respondWithResult(_0x7c71ab,null))[_0xa094('0x45')](handleError(_0x7c71ab,null));};exports['setTags']=function(_0x354613,_0x4dc994,_0x33f543){if(_0x354613[_0xa094('0x4a')]['id']){delete _0x354613[_0xa094('0x4a')]['id'];}return db[_0xa094('0x2c')]['findOne']({'where':{'id':_0x354613[_0xa094('0x47')]['id']}})[_0xa094('0x26')](handleEntityNotFound(_0x4dc994,null))[_0xa094('0x26')](function(_0xbb9226){if(_0xbb9226){return _0xbb9226[_0xa094('0x50')](_0x354613[_0xa094('0x4a')][_0xa094('0x51')]||[]);}return null;})[_0xa094('0x26')](respondWithResult(_0x4dc994,null))[_0xa094('0x45')](handleError(_0x4dc994,null));};
\ No newline at end of file
index b9321bf..62fd640 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbbc=['request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x2c1524,_0x311a60){_0x2c1524=_0x2c1524-0x0;var _0x4ddd51=_0xbbbc[_0x2c1524];return _0x4ddd51;};'use strict';var _=require(_0xcbbb('0x0'));var util=require(_0xcbbb('0x1'));var logger=require(_0xcbbb('0x2'))(_0xcbbb('0x3'));var moment=require(_0xcbbb('0x4'));var BPromise=require(_0xcbbb('0x5'));var rp=require(_0xcbbb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbbb('0x7'));var config=require(_0xcbbb('0x8'));var attributes=require(_0xcbbb('0x9'));module[_0xcbbb('0xa')]=function(_0x43ff05,_0x4978a9){return _0x43ff05[_0xcbbb('0xb')](_0xcbbb('0xc'),attributes,{'tableName':_0xcbbb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd4f4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash'];(function(_0x5581ba,_0x268887){var _0x1e927f=function(_0x1803b2){while(--_0x1803b2){_0x5581ba['push'](_0x5581ba['shift']());}};_0x1e927f(++_0x268887);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x551386,_0x6c0c9){_0x551386=_0x551386-0x0;var _0xf5a5e2=_0xd4f4[_0x551386];return _0xf5a5e2;};'use strict';var _=require(_0x4d4f('0x0'));var util=require(_0x4d4f('0x1'));var logger=require(_0x4d4f('0x2'))(_0x4d4f('0x3'));var moment=require(_0x4d4f('0x4'));var BPromise=require(_0x4d4f('0x5'));var rp=require(_0x4d4f('0x6'));var fs=require('fs');var path=require(_0x4d4f('0x7'));var rimraf=require(_0x4d4f('0x8'));var config=require(_0x4d4f('0x9'));var attributes=require(_0x4d4f('0xa'));module['exports']=function(_0x5f451b,_0x5e38d2){return _0x5f451b[_0x4d4f('0xb')](_0x4d4f('0xc'),attributes,{'tableName':_0x4d4f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a7e863d..64a0f38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e13=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ZendeskConfiguration,\x20%s,\x20%s','debug'];(function(_0x5109fc,_0x47cb41){var _0x280cff=function(_0x151757){while(--_0x151757){_0x5109fc['push'](_0x5109fc['shift']());}};_0x280cff(++_0x47cb41);}(_0x9e13,0x12d));var _0x39e1=function(_0x64e68f,_0x4a98ee){_0x64e68f=_0x64e68f-0x0;var _0x5f29c5=_0x9e13[_0x64e68f];return _0x5f29c5;};'use strict';var _=require(_0x39e1('0x0'));var util=require(_0x39e1('0x1'));var moment=require(_0x39e1('0x2'));var BPromise=require('bluebird');var rs=require(_0x39e1('0x3'));var fs=require('fs');var Redis=require(_0x39e1('0x4'));var db=require(_0x39e1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x39e1('0x6'))(_0x39e1('0x7'));var config=require(_0x39e1('0x8'));var jayson=require(_0x39e1('0x9'));var client=jayson['client'][_0x39e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42a338,_0x351aac,_0x23edcf){return new BPromise(function(_0x368a57,_0xa62479){return client['request'](_0x42a338,_0x23edcf)['then'](function(_0x2c0609){logger[_0x39e1('0xb')](_0x39e1('0xc'),_0x351aac,'request\x20sent');logger[_0x39e1('0xd')](_0x39e1('0xe'),_0x351aac,'request\x20sent',JSON[_0x39e1('0xf')](_0x2c0609));if(_0x2c0609[_0x39e1('0x10')]){if(_0x2c0609[_0x39e1('0x10')]['code']===0x1f4){logger[_0x39e1('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x351aac,_0x2c0609[_0x39e1('0x10')]['message']);return _0xa62479(_0x2c0609[_0x39e1('0x10')][_0x39e1('0x11')]);}logger['error'](_0x39e1('0xc'),_0x351aac,_0x2c0609[_0x39e1('0x10')][_0x39e1('0x11')]);return _0x368a57(_0x2c0609[_0x39e1('0x10')]['message']);}else{logger[_0x39e1('0xb')](_0x39e1('0xc'),_0x351aac,_0x39e1('0x12'));_0x368a57(_0x2c0609[_0x39e1('0x13')][_0x39e1('0x11')]);}})[_0x39e1('0x14')](function(_0x266ecb){logger['error'](_0x39e1('0xc'),_0x351aac,_0x266ecb);_0xa62479(_0x266ecb);});});}
\ No newline at end of file
+var _0xa10f=['error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x13071e,_0x302980){var _0x292049=function(_0x1a40db){while(--_0x1a40db){_0x13071e['push'](_0x13071e['shift']());}};_0x292049(++_0x302980);}(_0xa10f,0x1b9));var _0xfa10=function(_0x4215b0,_0x266efa){_0x4215b0=_0x4215b0-0x0;var _0x3275e0=_0xa10f[_0x4215b0];return _0x3275e0;};'use strict';var _=require(_0xfa10('0x0'));var util=require(_0xfa10('0x1'));var moment=require(_0xfa10('0x2'));var BPromise=require(_0xfa10('0x3'));var rs=require(_0xfa10('0x4'));var fs=require('fs');var Redis=require(_0xfa10('0x5'));var db=require(_0xfa10('0x6'))['db'];var utils=require(_0xfa10('0x7'));var logger=require(_0xfa10('0x8'))(_0xfa10('0x9'));var config=require('../../config/environment');var jayson=require(_0xfa10('0xa'));var client=jayson['client'][_0xfa10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c51b1,_0x8db338,_0x597bfd){return new BPromise(function(_0x323628,_0x2409d4){return client[_0xfa10('0xc')](_0x5c51b1,_0x597bfd)[_0xfa10('0xd')](function(_0x2e3cb1){logger['info'](_0xfa10('0xe'),_0x8db338,'request\x20sent');logger[_0xfa10('0xf')](_0xfa10('0x10'),_0x8db338,_0xfa10('0x11'),JSON[_0xfa10('0x12')](_0x2e3cb1));if(_0x2e3cb1[_0xfa10('0x13')]){if(_0x2e3cb1[_0xfa10('0x13')]['code']===0x1f4){logger[_0xfa10('0x13')](_0xfa10('0xe'),_0x8db338,_0x2e3cb1[_0xfa10('0x13')][_0xfa10('0x14')]);return _0x2409d4(_0x2e3cb1[_0xfa10('0x13')][_0xfa10('0x14')]);}logger[_0xfa10('0x13')](_0xfa10('0xe'),_0x8db338,_0x2e3cb1[_0xfa10('0x13')]['message']);return _0x323628(_0x2e3cb1[_0xfa10('0x13')][_0xfa10('0x14')]);}else{logger['info'](_0xfa10('0xe'),_0x8db338,'request\x20sent');_0x323628(_0x2e3cb1[_0xfa10('0x15')][_0xfa10('0x14')]);}})[_0xfa10('0x16')](function(_0x3da0){logger[_0xfa10('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x8db338,_0x3da0);_0x2409d4(_0x3da0);});});}
\ No newline at end of file
index 6945e5e..d46aefb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c02=['destroy','util','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','index','/:id','post','create','put','isAuthenticated','update','delete'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0x1c02,0x171));var _0x21c0=function(_0xaa2353,_0x48840d){_0xaa2353=_0xaa2353-0x0;var _0x5b24a8=_0x1c02[_0xaa2353];return _0x5b24a8;};'use strict';var multer=require('multer');var util=require(_0x21c0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x21c0('0x1'));var router=express[_0x21c0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x21c0('0x3'));var interaction=require(_0x21c0('0x4'));var config=require('../../config/environment');var controller=require(_0x21c0('0x5'));router[_0x21c0('0x6')]('/',auth['isAuthenticated'](),controller[_0x21c0('0x7')]);router[_0x21c0('0x6')](_0x21c0('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x21c0('0x9')]('/',auth['isAuthenticated'](),controller[_0x21c0('0xa')]);router[_0x21c0('0xb')](_0x21c0('0x8'),auth[_0x21c0('0xc')](),controller[_0x21c0('0xd')]);router[_0x21c0('0xe')](_0x21c0('0x8'),auth[_0x21c0('0xc')](),controller[_0x21c0('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x44bc=['create','put','/:id','update','destroy','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','post'];(function(_0x211808,_0x155be5){var _0x3ece86=function(_0x59f47b){while(--_0x59f47b){_0x211808['push'](_0x211808['shift']());}};_0x3ece86(++_0x155be5);}(_0x44bc,0x127));var _0xc44b=function(_0x5df34f,_0x196d57){_0x5df34f=_0x5df34f-0x0;var _0x2e2289=_0x44bc[_0x5df34f];return _0x2e2289;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc44b('0x0'));var timeout=require('connect-timeout');var express=require(_0xc44b('0x1'));var router=express['Router']();var fs_extra=require(_0xc44b('0x2'));var auth=require(_0xc44b('0x3'));var interaction=require(_0xc44b('0x4'));var config=require(_0xc44b('0x5'));var controller=require(_0xc44b('0x6'));router[_0xc44b('0x7')]('/',auth[_0xc44b('0x8')](),controller[_0xc44b('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xc44b('0xa')]('/',auth[_0xc44b('0x8')](),controller[_0xc44b('0xb')]);router[_0xc44b('0xc')](_0xc44b('0xd'),auth[_0xc44b('0x8')](),controller[_0xc44b('0xe')]);router['delete'](_0xc44b('0xd'),auth[_0xc44b('0x8')](),controller[_0xc44b('0xf')]);module[_0xc44b('0x10')]=router;
\ No newline at end of file
index daef45a..b04f806 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4249=['string','BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','picklist','STRING'];(function(_0x296d2a,_0x3698cd){var _0x466a14=function(_0x4048c3){while(--_0x4048c3){_0x296d2a['push'](_0x296d2a['shift']());}};_0x466a14(++_0x3698cd);}(_0x4249,0x158));var _0x9424=function(_0x4e746a,_0x1555a8){_0x4e746a=_0x4e746a-0x0;var _0xd8efcc=_0x4249[_0x4e746a];return _0xd8efcc;};'use strict';var Sequelize=require(_0x9424('0x0'));module['exports']={'type':{'type':Sequelize[_0x9424('0x1')]('string',_0x9424('0x2'),_0x9424('0x3'),_0x9424('0x4'),_0x9424('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9424('0x6')]},'key':{'type':Sequelize[_0x9424('0x6')]},'keyType':{'type':Sequelize[_0x9424('0x1')](_0x9424('0x7'),'variable',_0x9424('0x3'))},'keyContent':{'type':Sequelize[_0x9424('0x6')]},'idField':{'type':Sequelize[_0x9424('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9424('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1df1=['string','variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM'];(function(_0x2034d2,_0x5b59bc){var _0x453d55=function(_0x56bd2a){while(--_0x56bd2a){_0x2034d2['push'](_0x2034d2['shift']());}};_0x453d55(++_0x5b59bc);}(_0x1df1,0x1d1));var _0x11df=function(_0x505d19,_0x5cc3d4){_0x505d19=_0x505d19-0x0;var _0x52546e=_0x1df1[_0x505d19];return _0x52546e;};'use strict';var Sequelize=require(_0x11df('0x0'));module[_0x11df('0x1')]={'type':{'type':Sequelize[_0x11df('0x2')](_0x11df('0x3'),_0x11df('0x4'),_0x11df('0x5'),_0x11df('0x6'),_0x11df('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x11df('0x8')]},'key':{'type':Sequelize[_0x11df('0x8')]},'keyType':{'type':Sequelize[_0x11df('0x2')](_0x11df('0x3'),_0x11df('0x4'),_0x11df('0x5'))},'keyContent':{'type':Sequelize[_0x11df('0x8')]},'idField':{'type':Sequelize[_0x11df('0x8')]},'nameField':{'type':Sequelize[_0x11df('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x11df('0x8')]}};
\ No newline at end of file
index ef461a8..c235f05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1058=['error','stack','name','send','index','map','ZendeskField','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','request-promise','moment','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then'];(function(_0x37fb6c,_0x1584f3){var _0x51a9fc=function(_0x7235b1){while(--_0x7235b1){_0x37fb6c['push'](_0x37fb6c['shift']());}};_0x51a9fc(++_0x1584f3);}(_0x1058,0x148));var _0x8105=function(_0xd2b062,_0x3ce9a6){_0xd2b062=_0xd2b062-0x0;var _0x4b2b5c=_0x1058[_0xd2b062];return _0x4b2b5c;};'use strict';var emlformat=require(_0x8105('0x0'));var rimraf=require(_0x8105('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8105('0x2'));var moment=require(_0x8105('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x8105('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8105('0x5'));var fs=require('fs');var fs_extra=require(_0x8105('0x6'));var _=require(_0x8105('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8105('0x8'));var deskjs=require(_0x8105('0x9'));var toCsv=require(_0x8105('0xa'));var querystring=require(_0x8105('0xb'));var Papa=require(_0x8105('0xc'));var Redis=require(_0x8105('0xd'));var authService=require(_0x8105('0xe'));var qs=require(_0x8105('0xf'));var as=require(_0x8105('0x10'));var hardwareService=require(_0x8105('0x11'));var logger=require('../../config/logger')(_0x8105('0x12'));var utils=require(_0x8105('0x13'));var config=require(_0x8105('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8105('0x15'))['db'];function respondWithStatusCode(_0x3868c0,_0x14534f){_0x14534f=_0x14534f||0xcc;return function(_0x23ea87){if(_0x23ea87){return _0x3868c0[_0x8105('0x16')](_0x14534f);}return _0x3868c0[_0x8105('0x17')](_0x14534f)[_0x8105('0x18')]();};}function respondWithResult(_0x1dba3d,_0x5536b7){_0x5536b7=_0x5536b7||0xc8;return function(_0xfe0de6){if(_0xfe0de6){return _0x1dba3d[_0x8105('0x17')](_0x5536b7)[_0x8105('0x19')](_0xfe0de6);}};}function respondWithFilteredResult(_0x36fb50,_0x1e5889){return function(_0x403bdc){if(_0x403bdc){var _0x122882=typeof _0x1e5889[_0x8105('0x1a')]==='undefined'&&typeof _0x1e5889[_0x8105('0x1b')]===_0x8105('0x1c');var _0x22d243=_0x403bdc[_0x8105('0x1d')];var _0x370377=_0x122882?0x0:_0x1e5889[_0x8105('0x1a')];var _0x350a3b=_0x122882?_0x403bdc[_0x8105('0x1d')]:_0x1e5889[_0x8105('0x1a')]+_0x1e5889['limit'];var _0xd36687;if(_0x350a3b>=_0x22d243){_0x350a3b=_0x22d243;_0xd36687=0xc8;}else{_0xd36687=0xce;}_0x36fb50[_0x8105('0x17')](_0xd36687);return _0x36fb50[_0x8105('0x1e')](_0x8105('0x1f'),_0x370377+'-'+_0x350a3b+'/'+_0x22d243)[_0x8105('0x19')](_0x403bdc);}return null;};}function patchUpdates(_0x3639e2){return function(_0x1b8bf9){try{jsonpatch[_0x8105('0x20')](_0x1b8bf9,_0x3639e2,!![]);}catch(_0x12bd92){return BPromise[_0x8105('0x21')](_0x12bd92);}return _0x1b8bf9['save']();};}function saveUpdates(_0x1424d1,_0x2219fa){return function(_0xa93ddb){if(_0xa93ddb){return _0xa93ddb[_0x8105('0x22')](_0x1424d1)['then'](function(_0x4cf239){return _0x4cf239;});}return null;};}function removeEntity(_0x4b9e0e,_0x47f1b5){return function(_0x66d606){if(_0x66d606){return _0x66d606[_0x8105('0x23')]()[_0x8105('0x24')](function(){_0x4b9e0e[_0x8105('0x17')](0xcc)[_0x8105('0x18')]();});}};}function handleEntityNotFound(_0x374c34,_0x534bf0){return function(_0x1ffbe0){if(!_0x1ffbe0){_0x374c34[_0x8105('0x16')](0x194);}return _0x1ffbe0;};}function handleError(_0x5f1795,_0x4b0732){_0x4b0732=_0x4b0732||0x1f4;return function(_0x40be64){logger[_0x8105('0x25')](_0x40be64[_0x8105('0x26')]);if(_0x40be64[_0x8105('0x27')]){delete _0x40be64['name'];}_0x5f1795[_0x8105('0x17')](_0x4b0732)[_0x8105('0x28')](_0x40be64);};}exports[_0x8105('0x29')]=function(_0x1a14b8,_0x9b92b1){var _0x487e96={},_0x177120={},_0x25235a={'count':0x0,'rows':[]};var _0x453669=_[_0x8105('0x2a')](db[_0x8105('0x2b')]['rawAttributes'],function(_0x57e96a){return{'name':_0x57e96a[_0x8105('0x2c')],'type':_0x57e96a[_0x8105('0x2d')][_0x8105('0x2e')]};});_0x177120[_0x8105('0x2f')]=_['map'](_0x453669,_0x8105('0x27'));_0x177120['query']=_['keys'](_0x1a14b8[_0x8105('0x30')]);_0x177120[_0x8105('0x31')]=_[_0x8105('0x32')](_0x177120[_0x8105('0x2f')],_0x177120[_0x8105('0x30')]);_0x487e96[_0x8105('0x33')]=_[_0x8105('0x32')](_0x177120['model'],qs[_0x8105('0x34')](_0x1a14b8[_0x8105('0x30')]['fields']));_0x487e96[_0x8105('0x33')]=_0x487e96[_0x8105('0x33')][_0x8105('0x35')]?_0x487e96['attributes']:_0x177120[_0x8105('0x2f')];if(!_0x1a14b8['query'][_0x8105('0x36')]('nolimit')){_0x487e96[_0x8105('0x1b')]=qs[_0x8105('0x1b')](_0x1a14b8['query'][_0x8105('0x1b')]);_0x487e96[_0x8105('0x1a')]=qs['offset'](_0x1a14b8[_0x8105('0x30')]['offset']);}_0x487e96[_0x8105('0x37')]=qs[_0x8105('0x38')](_0x1a14b8[_0x8105('0x30')][_0x8105('0x38')]);_0x487e96[_0x8105('0x39')]=qs[_0x8105('0x31')](_[_0x8105('0x3a')](_0x1a14b8[_0x8105('0x30')],_0x177120['filters']),_0x453669);if(_0x1a14b8[_0x8105('0x30')][_0x8105('0x3b')]){_0x487e96[_0x8105('0x39')]=_[_0x8105('0x3c')](_0x487e96[_0x8105('0x39')],{'$or':_[_0x8105('0x2a')](_0x453669,function(_0x16bf96){if(_0x16bf96['type']!==_0x8105('0x3d')){var _0x91a42c={};_0x91a42c[_0x16bf96[_0x8105('0x27')]]={'$like':'%'+_0x1a14b8['query']['filter']+'%'};return _0x91a42c;}})});}_0x487e96=_[_0x8105('0x3c')]({},_0x487e96,_0x1a14b8[_0x8105('0x3e')]);var _0x147c94={'where':_0x487e96[_0x8105('0x39')]};return db[_0x8105('0x2b')][_0x8105('0x1d')](_0x147c94)[_0x8105('0x24')](function(_0xa3e63e){_0x25235a['count']=_0xa3e63e;if(_0x1a14b8[_0x8105('0x30')][_0x8105('0x3f')]){_0x487e96['include']=[{'all':!![]}];}return db[_0x8105('0x2b')][_0x8105('0x40')](_0x487e96);})[_0x8105('0x24')](function(_0x16b5c6){_0x25235a[_0x8105('0x41')]=_0x16b5c6;return _0x25235a;})[_0x8105('0x24')](respondWithFilteredResult(_0x9b92b1,_0x487e96))[_0x8105('0x42')](handleError(_0x9b92b1,null));};exports[_0x8105('0x43')]=function(_0x953d4a,_0x2cd28d){var _0x3edd63={'raw':!![],'where':{'id':_0x953d4a[_0x8105('0x44')]['id']}},_0x340b6d={};_0x340b6d[_0x8105('0x2f')]=_['keys'](db[_0x8105('0x2b')][_0x8105('0x45')]);_0x340b6d['query']=_['keys'](_0x953d4a[_0x8105('0x30')]);_0x340b6d[_0x8105('0x31')]=_['intersection'](_0x340b6d['model'],_0x340b6d[_0x8105('0x30')]);_0x3edd63['attributes']=_['intersection'](_0x340b6d[_0x8105('0x2f')],qs[_0x8105('0x34')](_0x953d4a['query'][_0x8105('0x34')]));_0x3edd63[_0x8105('0x33')]=_0x3edd63[_0x8105('0x33')]['length']?_0x3edd63[_0x8105('0x33')]:_0x340b6d['model'];if(_0x953d4a[_0x8105('0x30')][_0x8105('0x3f')]){_0x3edd63['include']=[{'all':!![]}];}_0x3edd63=_[_0x8105('0x3c')]({},_0x3edd63,_0x953d4a[_0x8105('0x3e')]);return db[_0x8105('0x2b')][_0x8105('0x46')](_0x3edd63)[_0x8105('0x24')](handleEntityNotFound(_0x2cd28d,null))['then'](respondWithResult(_0x2cd28d,null))[_0x8105('0x42')](handleError(_0x2cd28d,null));};exports[_0x8105('0x47')]=function(_0x415359,_0x19ef3c){return db[_0x8105('0x2b')][_0x8105('0x47')](_0x415359[_0x8105('0x48')],{})['then'](respondWithResult(_0x19ef3c,0xc9))[_0x8105('0x42')](handleError(_0x19ef3c,null));};exports['update']=function(_0x2d0ee2,_0x5ce2c1){if(_0x2d0ee2[_0x8105('0x48')]['id']){delete _0x2d0ee2[_0x8105('0x48')]['id'];}return db[_0x8105('0x2b')][_0x8105('0x46')]({'where':{'id':_0x2d0ee2[_0x8105('0x44')]['id']}})['then'](handleEntityNotFound(_0x5ce2c1,null))[_0x8105('0x24')](saveUpdates(_0x2d0ee2['body'],null))[_0x8105('0x24')](respondWithResult(_0x5ce2c1,null))[_0x8105('0x42')](handleError(_0x5ce2c1,null));};exports[_0x8105('0x23')]=function(_0x426f7e,_0x5ccd99){return db[_0x8105('0x2b')]['find']({'where':{'id':_0x426f7e[_0x8105('0x44')]['id']}})[_0x8105('0x24')](handleEntityNotFound(_0x5ccd99,null))['then'](removeEntity(_0x5ccd99,null))[_0x8105('0x42')](handleError(_0x5ccd99,null));};
\ No newline at end of file
+var _0xf337=['VIRTUAL','options','ZendeskField','count','includeAll','include','catch','show','params','find','create','body','rimraf','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/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','set','Content-Range','json','apply','save','update','then','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf337,0x174));var _0x7f33=function(_0x16c39e,_0x383a5e){_0x16c39e=_0x16c39e-0x0;var _0x1448e1=_0xf337[_0x16c39e];return _0x1448e1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f33('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7f33('0x1'));var moment=require(_0x7f33('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7f33('0x3'));var util=require(_0x7f33('0x4'));var path=require(_0x7f33('0x5'));var sox=require(_0x7f33('0x6'));var csv=require(_0x7f33('0x7'));var ejs=require(_0x7f33('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f33('0x9'));var squel=require(_0x7f33('0xa'));var crypto=require(_0x7f33('0xb'));var jsforce=require(_0x7f33('0xc'));var deskjs=require(_0x7f33('0xd'));var toCsv=require(_0x7f33('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7f33('0xe'));var authService=require(_0x7f33('0xf'));var qs=require(_0x7f33('0x10'));var as=require(_0x7f33('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f33('0x12'))('api');var utils=require(_0x7f33('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x7f33('0x14'));var db=require(_0x7f33('0x15'))['db'];function respondWithStatusCode(_0x38294e,_0x3617c5){_0x3617c5=_0x3617c5||0xcc;return function(_0x2b13a3){if(_0x2b13a3){return _0x38294e[_0x7f33('0x16')](_0x3617c5);}return _0x38294e['status'](_0x3617c5)[_0x7f33('0x17')]();};}function respondWithResult(_0x22f4d6,_0x17f699){_0x17f699=_0x17f699||0xc8;return function(_0x5c23e2){if(_0x5c23e2){return _0x22f4d6[_0x7f33('0x18')](_0x17f699)['json'](_0x5c23e2);}};}function respondWithFilteredResult(_0x5ea40f,_0x4c12d7){return function(_0x1f0ec8){if(_0x1f0ec8){var _0x4ef498=typeof _0x4c12d7[_0x7f33('0x19')]===_0x7f33('0x1a')&&typeof _0x4c12d7[_0x7f33('0x1b')]==='undefined';var _0x2bbf16=_0x1f0ec8['count'];var _0x1f7ce9=_0x4ef498?0x0:_0x4c12d7[_0x7f33('0x19')];var _0x5cb525=_0x4ef498?_0x1f0ec8['count']:_0x4c12d7[_0x7f33('0x19')]+_0x4c12d7[_0x7f33('0x1b')];var _0x13e0b2;if(_0x5cb525>=_0x2bbf16){_0x5cb525=_0x2bbf16;_0x13e0b2=0xc8;}else{_0x13e0b2=0xce;}_0x5ea40f[_0x7f33('0x18')](_0x13e0b2);return _0x5ea40f[_0x7f33('0x1c')](_0x7f33('0x1d'),_0x1f7ce9+'-'+_0x5cb525+'/'+_0x2bbf16)[_0x7f33('0x1e')](_0x1f0ec8);}return null;};}function patchUpdates(_0x2328ab){return function(_0xdc2610){try{jsonpatch[_0x7f33('0x1f')](_0xdc2610,_0x2328ab,!![]);}catch(_0x3d014b){return BPromise['reject'](_0x3d014b);}return _0xdc2610[_0x7f33('0x20')]();};}function saveUpdates(_0x22109e,_0x583e8d){return function(_0x75804a){if(_0x75804a){return _0x75804a[_0x7f33('0x21')](_0x22109e)[_0x7f33('0x22')](function(_0x31f1ec){return _0x31f1ec;});}return null;};}function removeEntity(_0xf5fa60,_0x137cb0){return function(_0x1961a3){if(_0x1961a3){return _0x1961a3['destroy']()[_0x7f33('0x22')](function(){_0xf5fa60[_0x7f33('0x18')](0xcc)[_0x7f33('0x17')]();});}};}function handleEntityNotFound(_0x154966,_0x1f80ad){return function(_0x17a00f){if(!_0x17a00f){_0x154966[_0x7f33('0x16')](0x194);}return _0x17a00f;};}function handleError(_0x4602a8,_0x576f50){_0x576f50=_0x576f50||0x1f4;return function(_0x4f1498){logger[_0x7f33('0x23')](_0x4f1498[_0x7f33('0x24')]);if(_0x4f1498[_0x7f33('0x25')]){delete _0x4f1498[_0x7f33('0x25')];}_0x4602a8[_0x7f33('0x18')](_0x576f50)[_0x7f33('0x26')](_0x4f1498);};}exports['index']=function(_0x4296c3,_0x58ba21){var _0x1661b5={},_0x256cc0={},_0x2095fe={'count':0x0,'rows':[]};var _0x527c86=_['map'](db['ZendeskField'][_0x7f33('0x27')],function(_0x32b0ab){return{'name':_0x32b0ab[_0x7f33('0x28')],'type':_0x32b0ab[_0x7f33('0x29')][_0x7f33('0x2a')]};});_0x256cc0[_0x7f33('0x2b')]=_[_0x7f33('0x2c')](_0x527c86,_0x7f33('0x25'));_0x256cc0[_0x7f33('0x2d')]=_[_0x7f33('0x2e')](_0x4296c3[_0x7f33('0x2d')]);_0x256cc0[_0x7f33('0x2f')]=_[_0x7f33('0x30')](_0x256cc0[_0x7f33('0x2b')],_0x256cc0[_0x7f33('0x2d')]);_0x1661b5['attributes']=_[_0x7f33('0x30')](_0x256cc0[_0x7f33('0x2b')],qs[_0x7f33('0x31')](_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x31')]));_0x1661b5[_0x7f33('0x32')]=_0x1661b5[_0x7f33('0x32')][_0x7f33('0x33')]?_0x1661b5['attributes']:_0x256cc0[_0x7f33('0x2b')];if(!_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x34')](_0x7f33('0x35'))){_0x1661b5['limit']=qs[_0x7f33('0x1b')](_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x1b')]);_0x1661b5[_0x7f33('0x19')]=qs['offset'](_0x4296c3['query'][_0x7f33('0x19')]);}_0x1661b5[_0x7f33('0x36')]=qs[_0x7f33('0x37')](_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x37')]);_0x1661b5['where']=qs['filters'](_[_0x7f33('0x38')](_0x4296c3[_0x7f33('0x2d')],_0x256cc0['filters']),_0x527c86);if(_0x4296c3['query'][_0x7f33('0x39')]){_0x1661b5[_0x7f33('0x3a')]=_[_0x7f33('0x3b')](_0x1661b5[_0x7f33('0x3a')],{'$or':_[_0x7f33('0x2c')](_0x527c86,function(_0x4d5e3c){if(_0x4d5e3c[_0x7f33('0x29')]!==_0x7f33('0x3c')){var _0x15bd2b={};_0x15bd2b[_0x4d5e3c[_0x7f33('0x25')]]={'$like':'%'+_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x39')]+'%'};return _0x15bd2b;}})});}_0x1661b5=_[_0x7f33('0x3b')]({},_0x1661b5,_0x4296c3[_0x7f33('0x3d')]);var _0x33f5a9={'where':_0x1661b5[_0x7f33('0x3a')]};return db[_0x7f33('0x3e')]['count'](_0x33f5a9)[_0x7f33('0x22')](function(_0x4a84ef){_0x2095fe[_0x7f33('0x3f')]=_0x4a84ef;if(_0x4296c3[_0x7f33('0x2d')][_0x7f33('0x40')]){_0x1661b5[_0x7f33('0x41')]=[{'all':!![]}];}return db[_0x7f33('0x3e')]['findAll'](_0x1661b5);})[_0x7f33('0x22')](function(_0x1d3f4b){_0x2095fe['rows']=_0x1d3f4b;return _0x2095fe;})['then'](respondWithFilteredResult(_0x58ba21,_0x1661b5))[_0x7f33('0x42')](handleError(_0x58ba21,null));};exports[_0x7f33('0x43')]=function(_0x1ced77,_0x1a2ba9){var _0x3f418e={'raw':!![],'where':{'id':_0x1ced77[_0x7f33('0x44')]['id']}},_0x4e2ae7={};_0x4e2ae7[_0x7f33('0x2b')]=_['keys'](db[_0x7f33('0x3e')][_0x7f33('0x27')]);_0x4e2ae7[_0x7f33('0x2d')]=_[_0x7f33('0x2e')](_0x1ced77[_0x7f33('0x2d')]);_0x4e2ae7[_0x7f33('0x2f')]=_[_0x7f33('0x30')](_0x4e2ae7[_0x7f33('0x2b')],_0x4e2ae7[_0x7f33('0x2d')]);_0x3f418e[_0x7f33('0x32')]=_[_0x7f33('0x30')](_0x4e2ae7[_0x7f33('0x2b')],qs['fields'](_0x1ced77[_0x7f33('0x2d')]['fields']));_0x3f418e[_0x7f33('0x32')]=_0x3f418e[_0x7f33('0x32')][_0x7f33('0x33')]?_0x3f418e[_0x7f33('0x32')]:_0x4e2ae7['model'];if(_0x1ced77[_0x7f33('0x2d')]['includeAll']){_0x3f418e['include']=[{'all':!![]}];}_0x3f418e=_['merge']({},_0x3f418e,_0x1ced77[_0x7f33('0x3d')]);return db[_0x7f33('0x3e')][_0x7f33('0x45')](_0x3f418e)['then'](handleEntityNotFound(_0x1a2ba9,null))[_0x7f33('0x22')](respondWithResult(_0x1a2ba9,null))['catch'](handleError(_0x1a2ba9,null));};exports[_0x7f33('0x46')]=function(_0x4bcddf,_0x4d42cb){return db[_0x7f33('0x3e')][_0x7f33('0x46')](_0x4bcddf['body'],{})[_0x7f33('0x22')](respondWithResult(_0x4d42cb,0xc9))[_0x7f33('0x42')](handleError(_0x4d42cb,null));};exports['update']=function(_0x4a9739,_0x3859ea){if(_0x4a9739[_0x7f33('0x47')]['id']){delete _0x4a9739['body']['id'];}return db[_0x7f33('0x3e')]['find']({'where':{'id':_0x4a9739[_0x7f33('0x44')]['id']}})[_0x7f33('0x22')](handleEntityNotFound(_0x3859ea,null))[_0x7f33('0x22')](saveUpdates(_0x4a9739[_0x7f33('0x47')],null))[_0x7f33('0x22')](respondWithResult(_0x3859ea,null))[_0x7f33('0x42')](handleError(_0x3859ea,null));};exports['destroy']=function(_0x20ccd9,_0x57c776){return db[_0x7f33('0x3e')][_0x7f33('0x45')]({'where':{'id':_0x20ccd9['params']['id']}})[_0x7f33('0x22')](handleEntityNotFound(_0x57c776,null))[_0x7f33('0x22')](removeEntity(_0x57c776,null))['catch'](handleError(_0x57c776,null));};
\ No newline at end of file
index decc1a6..a6da4f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c45=['../../config/environment','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x5c5675,_0x558d7d){var _0x42fa76=function(_0x2e3aad){while(--_0x2e3aad){_0x5c5675['push'](_0x5c5675['shift']());}};_0x42fa76(++_0x558d7d);}(_0x0c45,0x156));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x50c4('0x0'));var logger=require(_0x50c4('0x1'))('api');var moment=require(_0x50c4('0x2'));var BPromise=require('bluebird');var rp=require(_0x50c4('0x3'));var fs=require('fs');var path=require(_0x50c4('0x4'));var rimraf=require(_0x50c4('0x5'));var config=require(_0x50c4('0x6'));var attributes=require('./intZendeskField.attributes');module[_0x50c4('0x7')]=function(_0x4dc97a,_0x2ce827){return _0x4dc97a[_0x50c4('0x8')](_0x50c4('0x9'),attributes,{'tableName':_0x50c4('0xa'),'paranoid':![],'indexes':[{'name':_0x50c4('0xb'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9c50=['path','rimraf','./intZendeskField.attributes','ZendeskField','zendesk_unique_index','idField','lodash','util','api','request-promise'];(function(_0x350b82,_0x5bc7a2){var _0x2d2d36=function(_0x55fb10){while(--_0x55fb10){_0x350b82['push'](_0x350b82['shift']());}};_0x2d2d36(++_0x5bc7a2);}(_0x9c50,0x18c));var _0x09c5=function(_0x202e67,_0x4c7339){_0x202e67=_0x202e67-0x0;var _0x226a63=_0x9c50[_0x202e67];return _0x226a63;};'use strict';var _=require(_0x09c5('0x0'));var util=require(_0x09c5('0x1'));var logger=require('../../config/logger')(_0x09c5('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x09c5('0x3'));var fs=require('fs');var path=require(_0x09c5('0x4'));var rimraf=require(_0x09c5('0x5'));var config=require('../../config/environment');var attributes=require(_0x09c5('0x6'));module['exports']=function(_0x1985b8,_0x3c864b){return _0x1985b8['define'](_0x09c5('0x7'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x09c5('0x8'),'fields':[_0x09c5('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 9c44f25..b6f37c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1efd=['../../config/environment','jayson/promise','client','http','request','then','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZendeskField,\x20%s,\x20%s','message','info','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x19a11f,_0x6d8be7){var _0x51485f=function(_0x1394a1){while(--_0x1394a1){_0x19a11f['push'](_0x19a11f['shift']());}};_0x51485f(++_0x6d8be7);}(_0x1efd,0x143));var _0xd1ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1efd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd1ef('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd1ef('0x1'));var rs=require(_0xd1ef('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1ef('0x3'))['db'];var utils=require(_0xd1ef('0x4'));var logger=require(_0xd1ef('0x5'))(_0xd1ef('0x6'));var config=require(_0xd1ef('0x7'));var jayson=require(_0xd1ef('0x8'));var client=jayson[_0xd1ef('0x9')][_0xd1ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5475ee,_0x12b644,_0x45bec0){return new BPromise(function(_0x19defa,_0x2a1b8d){return client[_0xd1ef('0xb')](_0x5475ee,_0x45bec0)[_0xd1ef('0xc')](function(_0x420194){logger['info']('ZendeskField,\x20%s,\x20%s',_0x12b644,'request\x20sent');logger['debug'](_0xd1ef('0xd'),_0x12b644,_0xd1ef('0xe'),JSON[_0xd1ef('0xf')](_0x420194));if(_0x420194[_0xd1ef('0x10')]){if(_0x420194[_0xd1ef('0x10')]['code']===0x1f4){logger[_0xd1ef('0x10')](_0xd1ef('0x11'),_0x12b644,_0x420194[_0xd1ef('0x10')][_0xd1ef('0x12')]);return _0x2a1b8d(_0x420194[_0xd1ef('0x10')][_0xd1ef('0x12')]);}logger[_0xd1ef('0x10')](_0xd1ef('0x11'),_0x12b644,_0x420194[_0xd1ef('0x10')]['message']);return _0x19defa(_0x420194[_0xd1ef('0x10')][_0xd1ef('0x12')]);}else{logger[_0xd1ef('0x13')]('ZendeskField,\x20%s,\x20%s',_0x12b644,_0xd1ef('0xe'));_0x19defa(_0x420194[_0xd1ef('0x14')]['message']);}})[_0xd1ef('0x15')](function(_0x38f99b){logger['error']('ZendeskField,\x20%s,\x20%s',_0x12b644,_0x38f99b);_0x2a1b8d(_0x38f99b);});});}
\ No newline at end of file
+var _0x9f33=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x9f33,0x1e1));var _0x39f3=function(_0x3bd9cb,_0x57c7ed){_0x3bd9cb=_0x3bd9cb-0x0;var _0x221a8f=_0x9f33[_0x3bd9cb];return _0x221a8f;};'use strict';var _=require(_0x39f3('0x0'));var util=require(_0x39f3('0x1'));var moment=require(_0x39f3('0x2'));var BPromise=require(_0x39f3('0x3'));var rs=require(_0x39f3('0x4'));var fs=require('fs');var Redis=require(_0x39f3('0x5'));var db=require(_0x39f3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x39f3('0x7'))(_0x39f3('0x8'));var config=require(_0x39f3('0x9'));var jayson=require(_0x39f3('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x25d256,_0x5bd88b,_0x4dcfdc){return new BPromise(function(_0xc10450,_0x40d076){return client[_0x39f3('0xb')](_0x25d256,_0x4dcfdc)[_0x39f3('0xc')](function(_0x502e71){logger[_0x39f3('0xd')](_0x39f3('0xe'),_0x5bd88b,'request\x20sent');logger[_0x39f3('0xf')](_0x39f3('0x10'),_0x5bd88b,_0x39f3('0x11'),JSON['stringify'](_0x502e71));if(_0x502e71[_0x39f3('0x12')]){if(_0x502e71[_0x39f3('0x12')][_0x39f3('0x13')]===0x1f4){logger[_0x39f3('0x12')](_0x39f3('0xe'),_0x5bd88b,_0x502e71[_0x39f3('0x12')]['message']);return _0x40d076(_0x502e71[_0x39f3('0x12')][_0x39f3('0x14')]);}logger[_0x39f3('0x12')]('ZendeskField,\x20%s,\x20%s',_0x5bd88b,_0x502e71['error'][_0x39f3('0x14')]);return _0xc10450(_0x502e71[_0x39f3('0x12')][_0x39f3('0x14')]);}else{logger[_0x39f3('0xd')](_0x39f3('0xe'),_0x5bd88b,_0x39f3('0x11'));_0xc10450(_0x502e71['result'][_0x39f3('0x14')]);}})['catch'](function(_0x36f96d){logger[_0x39f3('0x12')](_0x39f3('0xe'),_0x5bd88b,_0x36f96d);_0x40d076(_0x36f96d);});});}
\ No newline at end of file
index 931a49d..4c691f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fda=['Router','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','isAuthenticated','index','get','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','/:id','update','delete','destroy','exports','path','connect-timeout','express'];(function(_0x1b1bd5,_0xf50a3){var _0x12bf17=function(_0x5a1a9f){while(--_0x5a1a9f){_0x1b1bd5['push'](_0x1b1bd5['shift']());}};_0x12bf17(++_0xf50a3);}(_0x9fda,0x135));var _0xa9fd=function(_0x5b743b,_0x1dda50){_0x5b743b=_0x5b743b-0x0;var _0x3df5ec=_0x9fda[_0x5b743b];return _0x3df5ec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa9fd('0x0'));var timeout=require(_0xa9fd('0x1'));var express=require(_0xa9fd('0x2'));var router=express[_0xa9fd('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa9fd('0x4'));var config=require(_0xa9fd('0x5'));var controller=require(_0xa9fd('0x6'));router['get']('/',auth[_0xa9fd('0x7')](),controller[_0xa9fd('0x8')]);router[_0xa9fd('0x9')]('/:id',auth[_0xa9fd('0x7')](),controller[_0xa9fd('0xa')]);router[_0xa9fd('0x9')]('/:id/configurations',auth[_0xa9fd('0x7')](),controller[_0xa9fd('0xb')]);router[_0xa9fd('0x9')](_0xa9fd('0xc'),auth[_0xa9fd('0x7')](),controller[_0xa9fd('0xd')]);router[_0xa9fd('0xe')]('/',auth[_0xa9fd('0x7')](),controller[_0xa9fd('0xf')]);router[_0xa9fd('0xe')](_0xa9fd('0x10'),auth[_0xa9fd('0x7')](),controller[_0xa9fd('0x11')]);router[_0xa9fd('0x12')](_0xa9fd('0x13'),auth[_0xa9fd('0x7')](),controller[_0xa9fd('0x14')]);router[_0xa9fd('0x15')]('/:id',auth[_0xa9fd('0x7')](),controller[_0xa9fd('0x16')]);module[_0xa9fd('0x17')]=router;
\ No newline at end of file
+var _0x2dec=['isAuthenticated','getFields','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','index','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x11362b,_0x3f1927){var _0x46d24d=function(_0x3feeff){while(--_0x3feeff){_0x11362b['push'](_0x11362b['shift']());}};_0x46d24d(++_0x3f1927);}(_0x2dec,0xda));var _0xc2de=function(_0x540133,_0x41783f){_0x540133=_0x540133-0x0;var _0x26b6e9=_0x2dec[_0x540133];return _0x26b6e9;};'use strict';var multer=require(_0xc2de('0x0'));var util=require(_0xc2de('0x1'));var path=require(_0xc2de('0x2'));var timeout=require(_0xc2de('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc2de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc2de('0x5'));var config=require(_0xc2de('0x6'));var controller=require('./intZohoAccount.controller');router[_0xc2de('0x7')]('/',auth['isAuthenticated'](),controller[_0xc2de('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc2de('0x9')]);router[_0xc2de('0x7')](_0xc2de('0xa'),auth['isAuthenticated'](),controller[_0xc2de('0xb')]);router[_0xc2de('0x7')](_0xc2de('0xc'),auth[_0xc2de('0xd')](),controller[_0xc2de('0xe')]);router[_0xc2de('0xf')]('/',auth[_0xc2de('0xd')](),controller['create']);router[_0xc2de('0xf')]('/:id/configurations',auth[_0xc2de('0xd')](),controller['addConfiguration']);router[_0xc2de('0x10')](_0xc2de('0x11'),auth[_0xc2de('0xd')](),controller[_0xc2de('0x12')]);router[_0xc2de('0x13')](_0xc2de('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0xc2de('0x14')]=router;
\ No newline at end of file
index 00f6731..ca347e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['exports','STRING','sequelize'];(function(_0x5a6d99,_0x452a70){var _0x2b14bb=function(_0x47f072){while(--_0x47f072){_0x5a6d99['push'](_0x5a6d99['shift']());}};_0x2b14bb(++_0x452a70);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x32bce8,_0x54f965){_0x32bce8=_0x32bce8-0x0;var _0x38badc=_0xf3cd[_0x32bce8];return _0x38badc;};'use strict';var Sequelize=require(_0xdf3c('0x0'));module[_0xdf3c('0x1')]={'name':{'type':Sequelize[_0xdf3c('0x2')]},'description':{'type':Sequelize[_0xdf3c('0x2')]},'host':{'type':Sequelize[_0xdf3c('0x2')]},'zone':{'type':Sequelize[_0xdf3c('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xdf3c('0x2')]},'serverUrl':{'type':Sequelize[_0xdf3c('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0xdf3c('0x2')]},'refreshToken':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x41bb=['exports','STRING','sequelize'];(function(_0x4deff,_0x42c328){var _0x440123=function(_0x2d7dde){while(--_0x2d7dde){_0x4deff['push'](_0x4deff['shift']());}};_0x440123(++_0x42c328);}(_0x41bb,0xc5));var _0xb41b=function(_0x3c9817,_0x3a5e94){_0x3c9817=_0x3c9817-0x0;var _0x57b25b=_0x41bb[_0x3c9817];return _0x57b25b;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}};
\ No newline at end of file
index 5645b51..25e5c54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadcd=['../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','then','includeAll','include','rows','params','keys','find','catch','create','body','getConfigurations','findOne','ZohoConfiguration','addConfiguration','Subjects','getDescriptions','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','clientSecret','refresh_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x4b83e9,_0x2508d1){var _0x138f0c=function(_0x10c43e){while(--_0x10c43e){_0x4b83e9['push'](_0x4b83e9['shift']());}};_0x138f0c(++_0x2508d1);}(_0xadcd,0x16f));var _0xdadc=function(_0x413510,_0xa2b93b){_0x413510=_0x413510-0x0;var _0x3fbabc=_0xadcd[_0x413510];return _0x3fbabc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdadc('0x0'));var zipdir=require(_0xdadc('0x1'));var jsonpatch=require(_0xdadc('0x2'));var rp=require('request-promise');var moment=require(_0xdadc('0x3'));var BPromise=require(_0xdadc('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xdadc('0x5'));var sox=require(_0xdadc('0x6'));var csv=require(_0xdadc('0x7'));var ejs=require(_0xdadc('0x8'));var fs=require('fs');var fs_extra=require(_0xdadc('0x9'));var _=require(_0xdadc('0xa'));var squel=require(_0xdadc('0xb'));var crypto=require(_0xdadc('0xc'));var jsforce=require(_0xdadc('0xd'));var deskjs=require(_0xdadc('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdadc('0xf'));var Redis=require(_0xdadc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xdadc('0x11'));var as=require(_0xdadc('0x12'));var hardwareService=require(_0xdadc('0x13'));var logger=require(_0xdadc('0x14'))(_0xdadc('0x15'));var utils=require('../../config/utils');var config=require(_0xdadc('0x16'));var licenseUtil=require(_0xdadc('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xdadc('0x18'));function respondWithStatusCode(_0x23add3,_0x1ac2b2){_0x1ac2b2=_0x1ac2b2||0xcc;return function(_0x490a2e){if(_0x490a2e){return _0x23add3[_0xdadc('0x19')](_0x1ac2b2);}return _0x23add3[_0xdadc('0x1a')](_0x1ac2b2)[_0xdadc('0x1b')]();};}function respondWithResult(_0x1092a8,_0x1d7da0){_0x1d7da0=_0x1d7da0||0xc8;return function(_0x3e7e79){if(_0x3e7e79){return _0x1092a8[_0xdadc('0x1a')](_0x1d7da0)['json'](_0x3e7e79);}};}function respondWithFilteredResult(_0x2708e7,_0x31529e){return function(_0x5b5544){if(_0x5b5544){var _0x55dc80=typeof _0x31529e[_0xdadc('0x1c')]===_0xdadc('0x1d')&&typeof _0x31529e[_0xdadc('0x1e')]===_0xdadc('0x1d');var _0x29f100=_0x5b5544[_0xdadc('0x1f')];var _0x2bfe39=_0x55dc80?0x0:_0x31529e[_0xdadc('0x1c')];var _0x5c620a=_0x55dc80?_0x5b5544[_0xdadc('0x1f')]:_0x31529e[_0xdadc('0x1c')]+_0x31529e[_0xdadc('0x1e')];var _0x3e3099;if(_0x5c620a>=_0x29f100){_0x5c620a=_0x29f100;_0x3e3099=0xc8;}else{_0x3e3099=0xce;}_0x2708e7[_0xdadc('0x1a')](_0x3e3099);return _0x2708e7[_0xdadc('0x20')](_0xdadc('0x21'),_0x2bfe39+'-'+_0x5c620a+'/'+_0x29f100)[_0xdadc('0x22')](_0x5b5544);}return null;};}function patchUpdates(_0x20f6db){return function(_0x2ade23){try{jsonpatch['apply'](_0x2ade23,_0x20f6db,!![]);}catch(_0x19b3e0){return BPromise['reject'](_0x19b3e0);}return _0x2ade23[_0xdadc('0x23')]();};}function saveUpdates(_0x320dff,_0x211307){return function(_0x16afa6){if(_0x16afa6){return _0x16afa6[_0xdadc('0x24')](_0x320dff)['then'](function(_0x5c111b){return _0x5c111b;});}return null;};}function removeEntity(_0x1e2920,_0xe4f3a1){return function(_0x3fbe0a){if(_0x3fbe0a){return _0x3fbe0a[_0xdadc('0x25')]()['then'](function(){_0x1e2920[_0xdadc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42e386,_0x42a188){return function(_0x51d934){if(!_0x51d934){_0x42e386[_0xdadc('0x19')](0x194);}return _0x51d934;};}function handleError(_0xb79073,_0x5197dd){_0x5197dd=_0x5197dd||0x1f4;return function(_0x57e411){logger[_0xdadc('0x26')](_0x57e411[_0xdadc('0x27')]);if(_0x57e411[_0xdadc('0x28')]){delete _0x57e411[_0xdadc('0x28')];}_0xb79073[_0xdadc('0x1a')](_0x5197dd)[_0xdadc('0x29')](_0x57e411);};}exports[_0xdadc('0x2a')]=function(_0x15f836,_0x3c83d3){var _0x302f3e={},_0x14213c={},_0x3eeadd={'count':0x0,'rows':[]};var _0x113109=_[_0xdadc('0x2b')](db[_0xdadc('0x2c')][_0xdadc('0x2d')],function(_0x1812dd){return{'name':_0x1812dd['fieldName'],'type':_0x1812dd[_0xdadc('0x2e')][_0xdadc('0x2f')]};});_0x14213c[_0xdadc('0x30')]=_[_0xdadc('0x2b')](_0x113109,_0xdadc('0x28'));_0x14213c[_0xdadc('0x31')]=_['keys'](_0x15f836['query']);_0x14213c['filters']=_[_0xdadc('0x32')](_0x14213c['model'],_0x14213c[_0xdadc('0x31')]);_0x302f3e[_0xdadc('0x33')]=_[_0xdadc('0x32')](_0x14213c[_0xdadc('0x30')],qs[_0xdadc('0x34')](_0x15f836['query'][_0xdadc('0x34')]));_0x302f3e[_0xdadc('0x33')]=_0x302f3e['attributes'][_0xdadc('0x35')]?_0x302f3e[_0xdadc('0x33')]:_0x14213c[_0xdadc('0x30')];if(!_0x15f836[_0xdadc('0x31')][_0xdadc('0x36')](_0xdadc('0x37'))){_0x302f3e[_0xdadc('0x1e')]=qs[_0xdadc('0x1e')](_0x15f836[_0xdadc('0x31')][_0xdadc('0x1e')]);_0x302f3e[_0xdadc('0x1c')]=qs[_0xdadc('0x1c')](_0x15f836[_0xdadc('0x31')]['offset']);}_0x302f3e[_0xdadc('0x38')]=qs['sort'](_0x15f836[_0xdadc('0x31')][_0xdadc('0x39')]);_0x302f3e[_0xdadc('0x3a')]=qs['filters'](_[_0xdadc('0x3b')](_0x15f836['query'],_0x14213c[_0xdadc('0x3c')]),_0x113109);if(_0x15f836[_0xdadc('0x31')][_0xdadc('0x3d')]){_0x302f3e[_0xdadc('0x3a')]=_[_0xdadc('0x3e')](_0x302f3e['where'],{'$or':_[_0xdadc('0x2b')](_0x113109,function(_0x325020){if(_0x325020[_0xdadc('0x2e')]!==_0xdadc('0x3f')){var _0x2b67f4={};_0x2b67f4[_0x325020[_0xdadc('0x28')]]={'$like':'%'+_0x15f836[_0xdadc('0x31')]['filter']+'%'};return _0x2b67f4;}})});}_0x302f3e=_['merge']({},_0x302f3e,_0x15f836[_0xdadc('0x40')]);var _0x5e908c={'where':_0x302f3e[_0xdadc('0x3a')]};return db[_0xdadc('0x2c')][_0xdadc('0x1f')](_0x5e908c)[_0xdadc('0x41')](function(_0x4ae2cd){_0x3eeadd['count']=_0x4ae2cd;if(_0x15f836['query'][_0xdadc('0x42')]){_0x302f3e[_0xdadc('0x43')]=[{'all':!![]}];}return db[_0xdadc('0x2c')]['findAll'](_0x302f3e);})[_0xdadc('0x41')](function(_0x2468c6){_0x3eeadd[_0xdadc('0x44')]=_0x2468c6;return _0x3eeadd;})['then'](respondWithFilteredResult(_0x3c83d3,_0x302f3e))['catch'](handleError(_0x3c83d3,null));};exports['show']=function(_0x1a4fcc,_0x5b7e29){var _0xe25d78={'raw':![],'where':{'id':_0x1a4fcc[_0xdadc('0x45')]['id']}},_0x8dd5f4={};_0x8dd5f4[_0xdadc('0x30')]=_['keys'](db['ZohoAccount'][_0xdadc('0x2d')]);_0x8dd5f4[_0xdadc('0x31')]=_[_0xdadc('0x46')](_0x1a4fcc['query']);_0x8dd5f4[_0xdadc('0x3c')]=_[_0xdadc('0x32')](_0x8dd5f4[_0xdadc('0x30')],_0x8dd5f4[_0xdadc('0x31')]);_0xe25d78[_0xdadc('0x33')]=_[_0xdadc('0x32')](_0x8dd5f4[_0xdadc('0x30')],qs[_0xdadc('0x34')](_0x1a4fcc[_0xdadc('0x31')]['fields']));_0xe25d78[_0xdadc('0x33')]=_0xe25d78[_0xdadc('0x33')][_0xdadc('0x35')]?_0xe25d78[_0xdadc('0x33')]:_0x8dd5f4['model'];if(_0x1a4fcc[_0xdadc('0x31')][_0xdadc('0x42')]){_0xe25d78[_0xdadc('0x43')]=[{'all':!![]}];}_0xe25d78=_[_0xdadc('0x3e')]({},_0xe25d78,_0x1a4fcc[_0xdadc('0x40')]);return db[_0xdadc('0x2c')][_0xdadc('0x47')](_0xe25d78)[_0xdadc('0x41')](handleEntityNotFound(_0x5b7e29,null))[_0xdadc('0x41')](respondWithResult(_0x5b7e29,null))[_0xdadc('0x48')](handleError(_0x5b7e29,null));};exports[_0xdadc('0x49')]=function(_0x34faf0,_0x590f64){return db[_0xdadc('0x2c')][_0xdadc('0x49')](_0x34faf0['body'],{})[_0xdadc('0x41')](respondWithResult(_0x590f64,0xc9))[_0xdadc('0x48')](handleError(_0x590f64,null));};exports[_0xdadc('0x24')]=function(_0x370911,_0x4903cf){if(_0x370911[_0xdadc('0x4a')]['id']){delete _0x370911[_0xdadc('0x4a')]['id'];}return db[_0xdadc('0x2c')][_0xdadc('0x47')]({'where':{'id':_0x370911[_0xdadc('0x45')]['id']}})['then'](handleEntityNotFound(_0x4903cf,null))[_0xdadc('0x41')](saveUpdates(_0x370911[_0xdadc('0x4a')],null))[_0xdadc('0x41')](respondWithResult(_0x4903cf,null))[_0xdadc('0x48')](handleError(_0x4903cf,null));};exports[_0xdadc('0x25')]=function(_0x1b7aad,_0x567f2b){return db[_0xdadc('0x2c')][_0xdadc('0x47')]({'where':{'id':_0x1b7aad[_0xdadc('0x45')]['id']}})['then'](handleEntityNotFound(_0x567f2b,null))[_0xdadc('0x41')](removeEntity(_0x567f2b,null))['catch'](handleError(_0x567f2b,null));};exports[_0xdadc('0x4b')]=function(_0x46eb87,_0x3c15e6,_0x27a68b){var _0x2cb998={};var _0x2e8640={};var _0x53686f;var _0x17552f;return db[_0xdadc('0x2c')][_0xdadc('0x4c')]({'where':{'id':_0x46eb87[_0xdadc('0x45')]['id']}})[_0xdadc('0x41')](handleEntityNotFound(_0x3c15e6,null))[_0xdadc('0x41')](function(_0x5c7f51){if(_0x5c7f51){_0x53686f=_0x5c7f51;_0x2e8640['model']=_[_0xdadc('0x46')](db[_0xdadc('0x4d')]['rawAttributes']);_0x2e8640[_0xdadc('0x31')]=_['keys'](_0x46eb87[_0xdadc('0x31')]);_0x2e8640['filters']=_[_0xdadc('0x32')](_0x2e8640[_0xdadc('0x30')],_0x2e8640[_0xdadc('0x31')]);_0x2cb998['attributes']=_[_0xdadc('0x32')](_0x2e8640['model'],qs[_0xdadc('0x34')](_0x46eb87['query'][_0xdadc('0x34')]));_0x2cb998[_0xdadc('0x33')]=_0x2cb998[_0xdadc('0x33')][_0xdadc('0x35')]?_0x2cb998[_0xdadc('0x33')]:_0x2e8640['model'];_0x2cb998[_0xdadc('0x38')]=qs['sort'](_0x46eb87[_0xdadc('0x31')][_0xdadc('0x39')]);_0x2cb998[_0xdadc('0x3a')]=qs[_0xdadc('0x3c')](_[_0xdadc('0x3b')](_0x46eb87['query'],_0x2e8640[_0xdadc('0x3c')]));if(_0x46eb87[_0xdadc('0x31')][_0xdadc('0x3d')]){_0x2cb998[_0xdadc('0x3a')]=_[_0xdadc('0x3e')](_0x2cb998['where'],{'$or':_[_0xdadc('0x2b')](_0x2cb998[_0xdadc('0x33')],function(_0x5b43a3){var _0x4dce98={};_0x4dce98[_0x5b43a3]={'$like':'%'+_0x46eb87[_0xdadc('0x31')][_0xdadc('0x3d')]+'%'};return _0x4dce98;})});}_0x2cb998=_[_0xdadc('0x3e')]({},_0x2cb998,_0x46eb87[_0xdadc('0x40')]);return _0x53686f[_0xdadc('0x4b')](_0x2cb998);}})['then'](function(_0x1bdf83){if(_0x1bdf83){_0x17552f=_0x1bdf83[_0xdadc('0x35')];if(!_0x46eb87[_0xdadc('0x31')][_0xdadc('0x36')]('nolimit')){_0x2cb998[_0xdadc('0x1e')]=qs['limit'](_0x46eb87[_0xdadc('0x31')][_0xdadc('0x1e')]);_0x2cb998[_0xdadc('0x1c')]=qs['offset'](_0x46eb87[_0xdadc('0x31')][_0xdadc('0x1c')]);}return _0x53686f[_0xdadc('0x4b')](_0x2cb998);}})[_0xdadc('0x41')](function(_0x30072f){if(_0x30072f){return _0x30072f?{'count':_0x17552f,'rows':_0x30072f}:null;}})[_0xdadc('0x41')](respondWithResult(_0x3c15e6,null))[_0xdadc('0x48')](handleError(_0x3c15e6,null));};exports[_0xdadc('0x4e')]=function(_0x391d65,_0x484bb6,_0x5607f6){if(_0x391d65['body']['id']){delete _0x391d65['body']['id'];}return db[_0xdadc('0x2c')]['findOne']({'where':{'id':_0x391d65[_0xdadc('0x45')]['id']}})['then'](handleEntityNotFound(_0x484bb6,null))[_0xdadc('0x41')](function(_0x5c8c71){if(_0x5c8c71){_0x391d65[_0xdadc('0x4a')]['AccountId']=_0x5c8c71['id'];_0x391d65[_0xdadc('0x4a')][_0xdadc('0x4f')]=integrations['getSubjects'](_0x391d65[_0xdadc('0x4a')]['channel'],_0x391d65['body'][_0xdadc('0x2e')]);_0x391d65[_0xdadc('0x4a')]['Descriptions']=integrations[_0xdadc('0x50')](_0x391d65[_0xdadc('0x4a')][_0xdadc('0x51')],_0x391d65[_0xdadc('0x4a')][_0xdadc('0x2e')]);return db['ZohoConfiguration'][_0xdadc('0x49')](_0x391d65[_0xdadc('0x4a')],{'include':[{'model':db[_0xdadc('0x52')],'as':_0xdadc('0x4f')},{'model':db[_0xdadc('0x52')],'as':_0xdadc('0x53')}]});}return null;})[_0xdadc('0x41')](respondWithResult(_0x484bb6,null))[_0xdadc('0x48')](handleError(_0x484bb6,null));};function getAccessToken(_0x457399){return new Promise(function(_0x27d293,_0x16f29c){var _0x2c5dc5;switch(_0x457399[_0xdadc('0x54')]){case'US':_0x2c5dc5=_0xdadc('0x55');break;case'AU':_0x2c5dc5=_0xdadc('0x56');break;case'EU':_0x2c5dc5=_0xdadc('0x57');break;case'IN':_0x2c5dc5='https://accounts.zoho.in';break;case'CN':_0x2c5dc5=_0xdadc('0x58');break;default:_0x2c5dc5=_0xdadc('0x57');break;}var _0x22f725={'method':_0xdadc('0x59'),'uri':_0x2c5dc5+'/oauth/v2/token','qs':{'refresh_token':_0x457399['refreshToken'],'client_id':_0x457399['clientId'],'client_secret':_0x457399[_0xdadc('0x5a')],'grant_type':_0xdadc('0x5b')},'json':!![]};return rp(_0x22f725)[_0xdadc('0x41')](function(_0xcc59b5){if(_0xcc59b5['access_token']){_0x27d293(_0xcc59b5['access_token']);}else{_0x16f29c(_0xdadc('0x5c'));}})[_0xdadc('0x48')](function(_0x12a2b3){_0x16f29c(_0x12a2b3);});});}exports[_0xdadc('0x5d')]=function(_0x500875,_0x394c28,_0x10447b){var _0x3fb2b8,_0x1b97dd,_0x1d9e48,_0x4c84a7,_0x187acb;return db[_0xdadc('0x2c')][_0xdadc('0x4c')]({'where':{'id':_0x500875[_0xdadc('0x45')]['id']},'attributes':['id',_0xdadc('0x5e'),_0xdadc('0x54'),'clientId',_0xdadc('0x5a'),_0xdadc('0x5f'),'code',_0xdadc('0x60')]})[_0xdadc('0x41')](handleEntityNotFound(_0x394c28,null))[_0xdadc('0x41')](function(_0x2a029b){_0x187acb=_0x2a029b;_0x3fb2b8=_0x187acb[_0xdadc('0x5e')];_0x1b97dd=_0x3fb2b8===_0xdadc('0x61')?'eu':_0xdadc('0x62');_0x1d9e48=_0x187acb[_0xdadc('0x5f')];var _0x7992b8=_0x1d9e48[_0xdadc('0x63')](-0x1);if(_0x7992b8==='/'||_0x7992b8==='\x5c'||_0x7992b8===':'){_0x1d9e48=_0x1d9e48[_0xdadc('0x64')](0x0,_0x1d9e48[_0xdadc('0x65')](_0x7992b8));}if(!_0x187acb[_0xdadc('0x60')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x187acb);})[_0xdadc('0x41')](function(_0x2ff64a){if(_0x2ff64a){return rp({'method':_0xdadc('0x66'),'uri':util[_0xdadc('0x67')](_0xdadc('0x68'),_0x1b97dd),'qs':{'module':_0xdadc('0x69')},'headers':{'Authorization':_0xdadc('0x6a')+_0x2ff64a},'json':!![]});}})[_0xdadc('0x41')](function(_0x5a7204){if(_0x5a7204){if(_0x5a7204[_0xdadc('0x6b')]&&_0x5a7204[_0xdadc('0x6b')][_0xdadc('0x26')]){throw new Error(_0x5a7204[_0xdadc('0x6b')][_0xdadc('0x26')][_0xdadc('0x6c')]);}var _0x3ce19d=[];var _0x42b9b1=[];var _0x570d8b=[_0xdadc('0x6d'),_0xdadc('0x6e'),_0xdadc('0x6f'),_0xdadc('0x70'),_0xdadc('0x71'),_0xdadc('0x72'),_0xdadc('0x73'),_0xdadc('0x74')];_0x42b9b1=_[_0xdadc('0x75')](_0x5a7204[_0xdadc('0x34')],function(_0x2cdf51){return _0x570d8b[_0xdadc('0x76')](_0x2cdf51[_0xdadc('0x77')]);});for(var _0x40d3ab=0x0;_0x40d3ab<_0x42b9b1[_0xdadc('0x35')];_0x40d3ab++){if(_0x42b9b1[_0x40d3ab][_0xdadc('0x78')]===![]){_0x3ce19d[_0xdadc('0x79')]({'id':_0x42b9b1[_0x40d3ab]['id'],'name':_0x42b9b1[_0x40d3ab][_0xdadc('0x7a')],'custom':_0x42b9b1[_0x40d3ab]['custom_field'],'options':_0x42b9b1[_0x40d3ab][_0xdadc('0x7b')]===_0xdadc('0x7c')&&_0x42b9b1[_0x40d3ab][_0xdadc('0x7d')][_0xdadc('0x35')]>-0x1?_[_0xdadc('0x2b')](_0x42b9b1[_0x40d3ab][_0xdadc('0x7d')],function(_0x4719e2){return{'name':_0x4719e2,'value':_0x4719e2};}):[]});}}return{'count':_0x3ce19d[_0xdadc('0x35')],'rows':_0x3ce19d};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x394c28,null))[_0xdadc('0x48')](function(_0x42b905){var _0x63ff0d=_0x500875[_0xdadc('0x31')][_0xdadc('0x7e')]?0x1f4:_0x42b905[_0xdadc('0x7f')]||0x1f4;logger['error'](_0xdadc('0x80'),_0xdadc('0x5d'),_0x63ff0d,JSON['stringify'](_0x42b905));delete _0x42b905[_0xdadc('0x28')];if(_0x63ff0d===0x191){_0x63ff0d=0x190;}_0x394c28['status'](_0x63ff0d)[_0xdadc('0x29')](_0x500875[_0xdadc('0x31')][_0xdadc('0x7e')]?{'message':_0xdadc('0x81'),'statusCode':_0x42b905[_0xdadc('0x7f')]}:_0x42b905);});};
\ No newline at end of file
+var _0x5ea2=['Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','serverUrl','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','picklist','pick_list_values','statusCode','stringify','test','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoAccount','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','sort','where','filter','VIRTUAL','merge','includeAll','include','catch','show','params','rawAttributes','options','create','body','update','find','pick','hasOwnProperty','nolimit','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','refresh_token','access_token'];(function(_0x588d8c,_0x43e6fe){var _0x35189c=function(_0x416cf5){while(--_0x416cf5){_0x588d8c['push'](_0x588d8c['shift']());}};_0x35189c(++_0x43e6fe);}(_0x5ea2,0x99));var _0x25ea=function(_0x1b27ca,_0x1292a5){_0x1b27ca=_0x1b27ca-0x0;var _0x1f276b=_0x5ea2[_0x1b27ca];return _0x1f276b;};'use strict';var emlformat=require(_0x25ea('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x25ea('0x1'));var rp=require(_0x25ea('0x2'));var moment=require(_0x25ea('0x3'));var BPromise=require(_0x25ea('0x4'));var Mustache=require(_0x25ea('0x5'));var util=require('util');var path=require(_0x25ea('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x25ea('0x7'));var fs=require('fs');var fs_extra=require(_0x25ea('0x8'));var _=require(_0x25ea('0x9'));var squel=require(_0x25ea('0xa'));var crypto=require(_0x25ea('0xb'));var jsforce=require(_0x25ea('0xc'));var deskjs=require(_0x25ea('0xd'));var toCsv=require(_0x25ea('0xe'));var querystring=require(_0x25ea('0xf'));var Papa=require('papaparse');var Redis=require(_0x25ea('0x10'));var authService=require(_0x25ea('0x11'));var qs=require(_0x25ea('0x12'));var as=require(_0x25ea('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x25ea('0x14'))(_0x25ea('0x15'));var utils=require(_0x25ea('0x16'));var config=require(_0x25ea('0x17'));var licenseUtil=require(_0x25ea('0x18'));var db=require(_0x25ea('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5e1059,_0x138c9a){_0x138c9a=_0x138c9a||0xcc;return function(_0x1bdef2){if(_0x1bdef2){return _0x5e1059['sendStatus'](_0x138c9a);}return _0x5e1059[_0x25ea('0x1a')](_0x138c9a)[_0x25ea('0x1b')]();};}function respondWithResult(_0x1e247c,_0x190d5a){_0x190d5a=_0x190d5a||0xc8;return function(_0x41b47d){if(_0x41b47d){return _0x1e247c[_0x25ea('0x1a')](_0x190d5a)['json'](_0x41b47d);}};}function respondWithFilteredResult(_0x16c2e8,_0x81c080){return function(_0x4c60a0){if(_0x4c60a0){var _0x4705bc=typeof _0x81c080[_0x25ea('0x1c')]===_0x25ea('0x1d')&&typeof _0x81c080[_0x25ea('0x1e')]===_0x25ea('0x1d');var _0x3f8335=_0x4c60a0['count'];var _0x29878b=_0x4705bc?0x0:_0x81c080[_0x25ea('0x1c')];var _0x3b327e=_0x4705bc?_0x4c60a0[_0x25ea('0x1f')]:_0x81c080[_0x25ea('0x1c')]+_0x81c080[_0x25ea('0x1e')];var _0x43dee7;if(_0x3b327e>=_0x3f8335){_0x3b327e=_0x3f8335;_0x43dee7=0xc8;}else{_0x43dee7=0xce;}_0x16c2e8['status'](_0x43dee7);return _0x16c2e8[_0x25ea('0x20')](_0x25ea('0x21'),_0x29878b+'-'+_0x3b327e+'/'+_0x3f8335)['json'](_0x4c60a0);}return null;};}function patchUpdates(_0x13884d){return function(_0x58d927){try{jsonpatch['apply'](_0x58d927,_0x13884d,!![]);}catch(_0x3be0a2){return BPromise['reject'](_0x3be0a2);}return _0x58d927[_0x25ea('0x22')]();};}function saveUpdates(_0x3fdde6,_0x445100){return function(_0x3d1d2b){if(_0x3d1d2b){return _0x3d1d2b['update'](_0x3fdde6)[_0x25ea('0x23')](function(_0x35fee2){return _0x35fee2;});}return null;};}function removeEntity(_0xf34d84,_0x4ee5e6){return function(_0x2e98f9){if(_0x2e98f9){return _0x2e98f9[_0x25ea('0x24')]()['then'](function(){_0xf34d84[_0x25ea('0x1a')](0xcc)[_0x25ea('0x1b')]();});}};}function handleEntityNotFound(_0x5b9780,_0x260e8a){return function(_0x104361){if(!_0x104361){_0x5b9780[_0x25ea('0x25')](0x194);}return _0x104361;};}function handleError(_0x39de65,_0x20c65b){_0x20c65b=_0x20c65b||0x1f4;return function(_0xe63b85){logger[_0x25ea('0x26')](_0xe63b85[_0x25ea('0x27')]);if(_0xe63b85[_0x25ea('0x28')]){delete _0xe63b85[_0x25ea('0x28')];}_0x39de65[_0x25ea('0x1a')](_0x20c65b)[_0x25ea('0x29')](_0xe63b85);};}exports[_0x25ea('0x2a')]=function(_0x55020d,_0x4cb7a5){var _0x3599c3={},_0x21c4fc={},_0x576f56={'count':0x0,'rows':[]};var _0x1869d0=_[_0x25ea('0x2b')](db[_0x25ea('0x2c')]['rawAttributes'],function(_0x54459c){return{'name':_0x54459c[_0x25ea('0x2d')],'type':_0x54459c[_0x25ea('0x2e')]['key']};});_0x21c4fc[_0x25ea('0x2f')]=_[_0x25ea('0x2b')](_0x1869d0,'name');_0x21c4fc[_0x25ea('0x30')]=_[_0x25ea('0x31')](_0x55020d[_0x25ea('0x30')]);_0x21c4fc[_0x25ea('0x32')]=_['intersection'](_0x21c4fc[_0x25ea('0x2f')],_0x21c4fc['query']);_0x3599c3[_0x25ea('0x33')]=_[_0x25ea('0x34')](_0x21c4fc[_0x25ea('0x2f')],qs[_0x25ea('0x35')](_0x55020d['query']['fields']));_0x3599c3[_0x25ea('0x33')]=_0x3599c3['attributes'][_0x25ea('0x36')]?_0x3599c3[_0x25ea('0x33')]:_0x21c4fc['model'];if(!_0x55020d[_0x25ea('0x30')]['hasOwnProperty']('nolimit')){_0x3599c3[_0x25ea('0x1e')]=qs[_0x25ea('0x1e')](_0x55020d[_0x25ea('0x30')][_0x25ea('0x1e')]);_0x3599c3[_0x25ea('0x1c')]=qs[_0x25ea('0x1c')](_0x55020d['query']['offset']);}_0x3599c3['order']=qs[_0x25ea('0x37')](_0x55020d[_0x25ea('0x30')][_0x25ea('0x37')]);_0x3599c3[_0x25ea('0x38')]=qs[_0x25ea('0x32')](_['pick'](_0x55020d[_0x25ea('0x30')],_0x21c4fc[_0x25ea('0x32')]),_0x1869d0);if(_0x55020d[_0x25ea('0x30')][_0x25ea('0x39')]){_0x3599c3[_0x25ea('0x38')]=_['merge'](_0x3599c3[_0x25ea('0x38')],{'$or':_[_0x25ea('0x2b')](_0x1869d0,function(_0x349eb5){if(_0x349eb5[_0x25ea('0x2e')]!==_0x25ea('0x3a')){var _0x380ea1={};_0x380ea1[_0x349eb5[_0x25ea('0x28')]]={'$like':'%'+_0x55020d[_0x25ea('0x30')][_0x25ea('0x39')]+'%'};return _0x380ea1;}})});}_0x3599c3=_[_0x25ea('0x3b')]({},_0x3599c3,_0x55020d['options']);var _0x31f4d6={'where':_0x3599c3[_0x25ea('0x38')]};return db[_0x25ea('0x2c')][_0x25ea('0x1f')](_0x31f4d6)[_0x25ea('0x23')](function(_0x2c8eb4){_0x576f56[_0x25ea('0x1f')]=_0x2c8eb4;if(_0x55020d[_0x25ea('0x30')][_0x25ea('0x3c')]){_0x3599c3[_0x25ea('0x3d')]=[{'all':!![]}];}return db[_0x25ea('0x2c')]['findAll'](_0x3599c3);})[_0x25ea('0x23')](function(_0xafd268){_0x576f56['rows']=_0xafd268;return _0x576f56;})[_0x25ea('0x23')](respondWithFilteredResult(_0x4cb7a5,_0x3599c3))[_0x25ea('0x3e')](handleError(_0x4cb7a5,null));};exports[_0x25ea('0x3f')]=function(_0xf5cb77,_0x62acdb){var _0x307cc8={'raw':![],'where':{'id':_0xf5cb77[_0x25ea('0x40')]['id']}},_0x2cb146={};_0x2cb146[_0x25ea('0x2f')]=_[_0x25ea('0x31')](db[_0x25ea('0x2c')][_0x25ea('0x41')]);_0x2cb146[_0x25ea('0x30')]=_[_0x25ea('0x31')](_0xf5cb77[_0x25ea('0x30')]);_0x2cb146['filters']=_[_0x25ea('0x34')](_0x2cb146[_0x25ea('0x2f')],_0x2cb146[_0x25ea('0x30')]);_0x307cc8[_0x25ea('0x33')]=_[_0x25ea('0x34')](_0x2cb146[_0x25ea('0x2f')],qs[_0x25ea('0x35')](_0xf5cb77[_0x25ea('0x30')][_0x25ea('0x35')]));_0x307cc8['attributes']=_0x307cc8[_0x25ea('0x33')]['length']?_0x307cc8[_0x25ea('0x33')]:_0x2cb146[_0x25ea('0x2f')];if(_0xf5cb77[_0x25ea('0x30')][_0x25ea('0x3c')]){_0x307cc8[_0x25ea('0x3d')]=[{'all':!![]}];}_0x307cc8=_[_0x25ea('0x3b')]({},_0x307cc8,_0xf5cb77[_0x25ea('0x42')]);return db[_0x25ea('0x2c')]['find'](_0x307cc8)[_0x25ea('0x23')](handleEntityNotFound(_0x62acdb,null))['then'](respondWithResult(_0x62acdb,null))[_0x25ea('0x3e')](handleError(_0x62acdb,null));};exports[_0x25ea('0x43')]=function(_0x2e2ec6,_0x2e82a0){return db[_0x25ea('0x2c')][_0x25ea('0x43')](_0x2e2ec6[_0x25ea('0x44')],{})['then'](respondWithResult(_0x2e82a0,0xc9))[_0x25ea('0x3e')](handleError(_0x2e82a0,null));};exports[_0x25ea('0x45')]=function(_0x517fb0,_0x21dd22){if(_0x517fb0['body']['id']){delete _0x517fb0[_0x25ea('0x44')]['id'];}return db[_0x25ea('0x2c')][_0x25ea('0x46')]({'where':{'id':_0x517fb0[_0x25ea('0x40')]['id']}})[_0x25ea('0x23')](handleEntityNotFound(_0x21dd22,null))['then'](saveUpdates(_0x517fb0['body'],null))[_0x25ea('0x23')](respondWithResult(_0x21dd22,null))[_0x25ea('0x3e')](handleError(_0x21dd22,null));};exports[_0x25ea('0x24')]=function(_0x2e8d3c,_0x1dcf6a){return db[_0x25ea('0x2c')][_0x25ea('0x46')]({'where':{'id':_0x2e8d3c[_0x25ea('0x40')]['id']}})[_0x25ea('0x23')](handleEntityNotFound(_0x1dcf6a,null))[_0x25ea('0x23')](removeEntity(_0x1dcf6a,null))['catch'](handleError(_0x1dcf6a,null));};exports['getConfigurations']=function(_0x2b7ff4,_0x3a1bef,_0x5859ae){var _0x32c1f3={};var _0x150385={};var _0x4b015a;var _0x5588ef;return db[_0x25ea('0x2c')]['findOne']({'where':{'id':_0x2b7ff4[_0x25ea('0x40')]['id']}})[_0x25ea('0x23')](handleEntityNotFound(_0x3a1bef,null))[_0x25ea('0x23')](function(_0x9edb78){if(_0x9edb78){_0x4b015a=_0x9edb78;_0x150385[_0x25ea('0x2f')]=_['keys'](db['ZohoConfiguration'][_0x25ea('0x41')]);_0x150385['query']=_[_0x25ea('0x31')](_0x2b7ff4[_0x25ea('0x30')]);_0x150385[_0x25ea('0x32')]=_['intersection'](_0x150385[_0x25ea('0x2f')],_0x150385[_0x25ea('0x30')]);_0x32c1f3['attributes']=_[_0x25ea('0x34')](_0x150385[_0x25ea('0x2f')],qs[_0x25ea('0x35')](_0x2b7ff4['query']['fields']));_0x32c1f3[_0x25ea('0x33')]=_0x32c1f3['attributes'][_0x25ea('0x36')]?_0x32c1f3[_0x25ea('0x33')]:_0x150385[_0x25ea('0x2f')];_0x32c1f3['order']=qs[_0x25ea('0x37')](_0x2b7ff4[_0x25ea('0x30')][_0x25ea('0x37')]);_0x32c1f3[_0x25ea('0x38')]=qs[_0x25ea('0x32')](_[_0x25ea('0x47')](_0x2b7ff4['query'],_0x150385[_0x25ea('0x32')]));if(_0x2b7ff4['query']['filter']){_0x32c1f3[_0x25ea('0x38')]=_[_0x25ea('0x3b')](_0x32c1f3[_0x25ea('0x38')],{'$or':_[_0x25ea('0x2b')](_0x32c1f3[_0x25ea('0x33')],function(_0x2848e2){var _0x19b554={};_0x19b554[_0x2848e2]={'$like':'%'+_0x2b7ff4['query'][_0x25ea('0x39')]+'%'};return _0x19b554;})});}_0x32c1f3=_[_0x25ea('0x3b')]({},_0x32c1f3,_0x2b7ff4['options']);return _0x4b015a['getConfigurations'](_0x32c1f3);}})[_0x25ea('0x23')](function(_0x394841){if(_0x394841){_0x5588ef=_0x394841[_0x25ea('0x36')];if(!_0x2b7ff4['query'][_0x25ea('0x48')](_0x25ea('0x49'))){_0x32c1f3['limit']=qs[_0x25ea('0x1e')](_0x2b7ff4['query'][_0x25ea('0x1e')]);_0x32c1f3[_0x25ea('0x1c')]=qs[_0x25ea('0x1c')](_0x2b7ff4[_0x25ea('0x30')][_0x25ea('0x1c')]);}return _0x4b015a[_0x25ea('0x4a')](_0x32c1f3);}})[_0x25ea('0x23')](function(_0x3f04ad){if(_0x3f04ad){return _0x3f04ad?{'count':_0x5588ef,'rows':_0x3f04ad}:null;}})[_0x25ea('0x23')](respondWithResult(_0x3a1bef,null))[_0x25ea('0x3e')](handleError(_0x3a1bef,null));};exports[_0x25ea('0x4b')]=function(_0x40f790,_0x320a62,_0x36e097){if(_0x40f790[_0x25ea('0x44')]['id']){delete _0x40f790['body']['id'];}return db[_0x25ea('0x2c')][_0x25ea('0x4c')]({'where':{'id':_0x40f790[_0x25ea('0x40')]['id']}})[_0x25ea('0x23')](handleEntityNotFound(_0x320a62,null))[_0x25ea('0x23')](function(_0x2ae85d){if(_0x2ae85d){_0x40f790[_0x25ea('0x44')][_0x25ea('0x4d')]=_0x2ae85d['id'];_0x40f790[_0x25ea('0x44')][_0x25ea('0x4e')]=integrations[_0x25ea('0x4f')](_0x40f790[_0x25ea('0x44')][_0x25ea('0x50')],_0x40f790['body'][_0x25ea('0x2e')]);_0x40f790['body'][_0x25ea('0x51')]=integrations[_0x25ea('0x52')](_0x40f790[_0x25ea('0x44')][_0x25ea('0x50')],_0x40f790[_0x25ea('0x44')][_0x25ea('0x2e')]);return db[_0x25ea('0x53')]['create'](_0x40f790[_0x25ea('0x44')],{'include':[{'model':db[_0x25ea('0x54')],'as':_0x25ea('0x4e')},{'model':db[_0x25ea('0x54')],'as':_0x25ea('0x51')}]});}return null;})[_0x25ea('0x23')](respondWithResult(_0x320a62,null))[_0x25ea('0x3e')](handleError(_0x320a62,null));};function getAccessToken(_0x5897b4){return new Promise(function(_0x755f97,_0x5db6fe){var _0x4e605b;switch(_0x5897b4[_0x25ea('0x55')]){case'US':_0x4e605b='https://accounts.zoho.com';break;case'AU':_0x4e605b='https://accounts.zoho.com.au';break;case'EU':_0x4e605b='https://accounts.zoho.eu';break;case'IN':_0x4e605b=_0x25ea('0x56');break;case'CN':_0x4e605b=_0x25ea('0x57');break;default:_0x4e605b='https://accounts.zoho.eu';break;}var _0x100479={'method':_0x25ea('0x58'),'uri':_0x4e605b+'/oauth/v2/token','qs':{'refresh_token':_0x5897b4[_0x25ea('0x59')],'client_id':_0x5897b4[_0x25ea('0x5a')],'client_secret':_0x5897b4['clientSecret'],'grant_type':_0x25ea('0x5b')},'json':!![]};return rp(_0x100479)[_0x25ea('0x23')](function(_0x13dc42){if(_0x13dc42[_0x25ea('0x5c')]){_0x755f97(_0x13dc42[_0x25ea('0x5c')]);}else{_0x5db6fe(_0x25ea('0x5d'));}})['catch'](function(_0x3ef892){_0x5db6fe(_0x3ef892);});});}exports[_0x25ea('0x5e')]=function(_0x1f8643,_0x549a12,_0x36fac2){var _0x44f2df,_0xfa3099,_0x2a7d0b,_0x23411d,_0x2c9965;return db[_0x25ea('0x2c')][_0x25ea('0x4c')]({'where':{'id':_0x1f8643[_0x25ea('0x40')]['id']},'attributes':['id',_0x25ea('0x5f'),'zone',_0x25ea('0x5a'),_0x25ea('0x60'),_0x25ea('0x61'),'code','refreshToken']})[_0x25ea('0x23')](handleEntityNotFound(_0x549a12,null))['then'](function(_0x391696){_0x2c9965=_0x391696;_0x44f2df=_0x2c9965[_0x25ea('0x5f')];_0xfa3099=_0x44f2df==='zoho.eu'?'eu':_0x25ea('0x62');_0x2a7d0b=_0x2c9965[_0x25ea('0x61')];var _0x421abe=_0x2a7d0b['slice'](-0x1);if(_0x421abe==='/'||_0x421abe==='\x5c'||_0x421abe===':'){_0x2a7d0b=_0x2a7d0b[_0x25ea('0x63')](0x0,_0x2a7d0b[_0x25ea('0x64')](_0x421abe));}if(!_0x2c9965['refreshToken']){throw new Error(_0x25ea('0x65'));}return getAccessToken(_0x2c9965);})[_0x25ea('0x23')](function(_0x3b051d){if(_0x3b051d){return rp({'method':'GET','uri':util[_0x25ea('0x66')](_0x25ea('0x67'),_0xfa3099),'qs':{'module':'Calls'},'headers':{'Authorization':_0x25ea('0x68')+_0x3b051d},'json':!![]});}})[_0x25ea('0x23')](function(_0x5e452a){if(_0x5e452a){if(_0x5e452a[_0x25ea('0x69')]&&_0x5e452a[_0x25ea('0x69')][_0x25ea('0x26')]){throw new Error(_0x5e452a[_0x25ea('0x69')][_0x25ea('0x26')]['message']);}var _0x35d9bb=[];var _0x347294=[];var _0x6b0912=['Owner',_0x25ea('0x6a'),_0x25ea('0x6b'),_0x25ea('0x6c'),_0x25ea('0x6d'),_0x25ea('0x6e'),_0x25ea('0x6f'),_0x25ea('0x70')];_0x347294=_[_0x25ea('0x71')](_0x5e452a[_0x25ea('0x35')],function(_0x32d2f1){return _0x6b0912[_0x25ea('0x72')](_0x32d2f1[_0x25ea('0x73')]);});for(var _0x17abf5=0x0;_0x17abf5<_0x347294[_0x25ea('0x36')];_0x17abf5++){if(_0x347294[_0x17abf5][_0x25ea('0x74')]===![]){_0x35d9bb[_0x25ea('0x75')]({'id':_0x347294[_0x17abf5]['id'],'name':_0x347294[_0x17abf5]['display_label'],'custom':_0x347294[_0x17abf5]['custom_field'],'options':_0x347294[_0x17abf5]['data_type']===_0x25ea('0x76')&&_0x347294[_0x17abf5][_0x25ea('0x77')][_0x25ea('0x36')]>-0x1?_['map'](_0x347294[_0x17abf5][_0x25ea('0x77')],function(_0x57575f){return{'name':_0x57575f,'value':_0x57575f};}):[]});}}return{'count':_0x35d9bb[_0x25ea('0x36')],'rows':_0x35d9bb};}else{return{'count':0x0,'rows':[]};}})[_0x25ea('0x23')](respondWithResult(_0x549a12,null))[_0x25ea('0x3e')](function(_0x2728f8){var _0xc24832=_0x1f8643[_0x25ea('0x30')]['test']?0x1f4:_0x2728f8[_0x25ea('0x78')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x25ea('0x5e'),_0xc24832,JSON[_0x25ea('0x79')](_0x2728f8));delete _0x2728f8[_0x25ea('0x28')];if(_0xc24832===0x191){_0xc24832=0x190;}_0x549a12[_0x25ea('0x1a')](_0xc24832)['send'](_0x1f8643[_0x25ea('0x30')][_0x25ea('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x2728f8[_0x25ea('0x78')]}:_0x2728f8);});};
\ No newline at end of file
index c468078..596d8f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6c7=['refreshToken','error','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','changed','zone','serverUrl','clientId','clientSecret','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','slice'];(function(_0x1eddf6,_0x86a081){var _0x111e30=function(_0x2b882d){while(--_0x2b882d){_0x1eddf6['push'](_0x1eddf6['shift']());}};_0x111e30(++_0x86a081);}(_0xe6c7,0x1a6));var _0x7e6c=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0xe6c7[_0xb1cf84];return _0x4bad2e;};'use strict';var _=require(_0x7e6c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7e6c('0x1'));var moment=require(_0x7e6c('0x2'));var BPromise=require(_0x7e6c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7e6c('0x4'));var rimraf=require(_0x7e6c('0x5'));var config=require(_0x7e6c('0x6'));var attributes=require(_0x7e6c('0x7'));var integrations=require(_0x7e6c('0x8'));module[_0x7e6c('0x9')]=function(_0x2d1aba,_0x182c3c){return _0x2d1aba[_0x7e6c('0xa')](_0x7e6c('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x414581,_0x217051,_0x210d6a){if(_0x414581[_0x7e6c('0xc')](_0x7e6c('0xd'))||_0x414581[_0x7e6c('0xc')](_0x7e6c('0xe'))||_0x414581[_0x7e6c('0xc')](_0x7e6c('0xf'))||_0x414581[_0x7e6c('0xc')](_0x7e6c('0x10'))||_0x414581[_0x7e6c('0xc')]('code')||_0x414581[_0x7e6c('0xc')](_0x7e6c('0x11'))){var _0x2ef41f,_0x40627f;_0x2ef41f=_0x414581[_0x7e6c('0xe')];var _0x4fde3e=_0x2ef41f['slice'](-0x1);if(_0x4fde3e==='/'||_0x4fde3e==='\x5c'||_0x4fde3e===':'){_0x2ef41f=_0x2ef41f[_0x7e6c('0x12')](0x0,_0x2ef41f[_0x7e6c('0x13')](_0x4fde3e));}switch(_0x414581[_0x7e6c('0xd')]){case'US':_0x40627f=_0x7e6c('0x14');break;case'AU':_0x40627f=_0x7e6c('0x15');break;case'IN':_0x40627f=_0x7e6c('0x16');break;case'CN':_0x40627f=_0x7e6c('0x17');break;default:_0x40627f=_0x7e6c('0x18');break;}var _0x42a24a={'method':_0x7e6c('0x19'),'uri':_0x40627f+_0x7e6c('0x1a'),'form':{'grant_type':_0x7e6c('0x1b'),'client_id':_0x414581[_0x7e6c('0xf')],'client_secret':_0x414581[_0x7e6c('0x10')],'redirect_uri':_0x414581[_0x7e6c('0xe')],'code':_0x414581[_0x7e6c('0x1c')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x42a24a)[_0x7e6c('0x1d')](function(_0x458c90){var _0x4e0b8f=JSON[_0x7e6c('0x1e')](_0x458c90);if(_0x4e0b8f[_0x7e6c('0x1f')]){_0x414581['refreshToken']=_0x4e0b8f[_0x7e6c('0x1f')];logger[_0x7e6c('0x20')](util[_0x7e6c('0x21')](_0x7e6c('0x22'),_0x414581['name'],_0x414581['id']));}else{logger['error'](util[_0x7e6c('0x21')](_0x7e6c('0x23'),_0x414581[_0x7e6c('0x24')],_0x414581['id']),util[_0x7e6c('0x25')](_0x4e0b8f,{'showHidden':![],'depth':null}));}return _0x210d6a(null,_0x217051);})[_0x7e6c('0x26')](function(_0x418d04){logger['error'](util['format'](_0x7e6c('0x23'),_0x414581[_0x7e6c('0x24')],_0x414581['id']),util[_0x7e6c('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x210d6a(_0x418d04);});}else{return _0x210d6a(null,_0x217051);}},'beforeUpdate':function(_0x3bf2e6,_0x2bf861,_0x13dc46){if(_0x3bf2e6['changed'](_0x7e6c('0xd'))||_0x3bf2e6['changed'](_0x7e6c('0xe'))||_0x3bf2e6['changed'](_0x7e6c('0xf'))||_0x3bf2e6[_0x7e6c('0xc')]('clientSecret')||_0x3bf2e6[_0x7e6c('0xc')](_0x7e6c('0x1c'))||_0x3bf2e6[_0x7e6c('0xc')]('host')){var _0x3c9cb9,_0x59c5ca;_0x3c9cb9=_0x3bf2e6[_0x7e6c('0xe')];var _0x110523=_0x3c9cb9[_0x7e6c('0x27')](-0x1);if(_0x110523==='/'||_0x110523==='\x5c'||_0x110523===':'){_0x3c9cb9=_0x3c9cb9['substring'](0x0,_0x3c9cb9[_0x7e6c('0x13')](_0x110523));}switch(_0x3bf2e6[_0x7e6c('0xd')]){case'US':_0x59c5ca=_0x7e6c('0x14');break;case'AU':_0x59c5ca='https://accounts.zoho.com.au';break;case'IN':_0x59c5ca=_0x7e6c('0x16');break;case'CN':_0x59c5ca=_0x7e6c('0x17');break;default:_0x59c5ca=_0x7e6c('0x18');break;}var _0x1041a3={'method':_0x7e6c('0x19'),'uri':_0x59c5ca+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x3bf2e6[_0x7e6c('0xf')],'client_secret':_0x3bf2e6[_0x7e6c('0x10')],'redirect_uri':_0x3bf2e6[_0x7e6c('0xe')],'code':_0x3bf2e6[_0x7e6c('0x1c')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x1041a3)['then'](function(_0x18cdcf){var _0x17231f=JSON[_0x7e6c('0x1e')](_0x18cdcf);if(_0x17231f[_0x7e6c('0x1f')]){_0x3bf2e6[_0x7e6c('0x28')]=_0x17231f[_0x7e6c('0x1f')];logger[_0x7e6c('0x20')](util[_0x7e6c('0x21')](_0x7e6c('0x22'),_0x3bf2e6[_0x7e6c('0x24')],_0x3bf2e6['id']));}else{logger[_0x7e6c('0x29')](util[_0x7e6c('0x21')](_0x7e6c('0x23'),_0x3bf2e6['name'],_0x3bf2e6['id']),util['inspect'](_0x17231f,{'showHidden':![],'depth':null}));}return _0x13dc46(null,_0x2bf861);})['catch'](function(_0x235c4e){logger['error'](util[_0x7e6c('0x21')](_0x7e6c('0x23'),_0x3bf2e6[_0x7e6c('0x24')],_0x3bf2e6['id']),util[_0x7e6c('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x13dc46(_0x235c4e);});}else{return _0x13dc46(null,_0x2bf861);}}}});};
\ No newline at end of file
+var _0x3ea4=['clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','format','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','name','https://accounts.zoho.com','info','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','ZohoAccount','int_zoho_accounts','zone','serverUrl','changed','clientId'];(function(_0x10acc2,_0x381818){var _0x5159f0=function(_0x272676){while(--_0x272676){_0x10acc2['push'](_0x10acc2['shift']());}};_0x5159f0(++_0x381818);}(_0x3ea4,0x18a));var _0x43ea=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x3ea4[_0x5538d5];return _0x323b1a;};'use strict';var _=require(_0x43ea('0x0'));var util=require(_0x43ea('0x1'));var logger=require(_0x43ea('0x2'))('api');var moment=require(_0x43ea('0x3'));var BPromise=require(_0x43ea('0x4'));var rp=require(_0x43ea('0x5'));var fs=require('fs');var path=require(_0x43ea('0x6'));var rimraf=require(_0x43ea('0x7'));var config=require(_0x43ea('0x8'));var attributes=require(_0x43ea('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x4e34ea,_0x317eb7){return _0x4e34ea['define'](_0x43ea('0xa'),attributes,{'tableName':_0x43ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x29f8de,_0x4cb813,_0x44d4f1){if(_0x29f8de['changed'](_0x43ea('0xc'))||_0x29f8de['changed'](_0x43ea('0xd'))||_0x29f8de[_0x43ea('0xe')](_0x43ea('0xf'))||_0x29f8de[_0x43ea('0xe')](_0x43ea('0x10'))||_0x29f8de['changed'](_0x43ea('0x11'))||_0x29f8de[_0x43ea('0xe')](_0x43ea('0x12'))){var _0x1ea827,_0x46e401;_0x1ea827=_0x29f8de[_0x43ea('0xd')];var _0x5a00de=_0x1ea827[_0x43ea('0x13')](-0x1);if(_0x5a00de==='/'||_0x5a00de==='\x5c'||_0x5a00de===':'){_0x1ea827=_0x1ea827[_0x43ea('0x14')](0x0,_0x1ea827[_0x43ea('0x15')](_0x5a00de));}switch(_0x29f8de['zone']){case'US':_0x46e401='https://accounts.zoho.com';break;case'AU':_0x46e401=_0x43ea('0x16');break;case'IN':_0x46e401=_0x43ea('0x17');break;case'CN':_0x46e401=_0x43ea('0x18');break;default:_0x46e401=_0x43ea('0x19');break;}var _0xd55419={'method':_0x43ea('0x1a'),'uri':_0x46e401+_0x43ea('0x1b'),'form':{'grant_type':_0x43ea('0x1c'),'client_id':_0x29f8de['clientId'],'client_secret':_0x29f8de[_0x43ea('0x10')],'redirect_uri':_0x29f8de[_0x43ea('0xd')],'code':_0x29f8de[_0x43ea('0x11')]},'headers':{'Content-Type':_0x43ea('0x1d')}};return rp(_0xd55419)[_0x43ea('0x1e')](function(_0x485931){var _0x2f16ac=JSON['parse'](_0x485931);if(_0x2f16ac[_0x43ea('0x1f')]){_0x29f8de[_0x43ea('0x20')]=_0x2f16ac['refresh_token'];logger['info'](util[_0x43ea('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x29f8de['name'],_0x29f8de['id']));}else{logger[_0x43ea('0x22')](util[_0x43ea('0x21')](_0x43ea('0x23'),_0x29f8de['name'],_0x29f8de['id']),util[_0x43ea('0x24')](_0x2f16ac,{'showHidden':![],'depth':null}));}return _0x44d4f1(null,_0x4cb813);})[_0x43ea('0x25')](function(_0x8673fe){logger[_0x43ea('0x22')](util[_0x43ea('0x21')](_0x43ea('0x23'),_0x29f8de[_0x43ea('0x26')],_0x29f8de['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x44d4f1(_0x8673fe);});}else{return _0x44d4f1(null,_0x4cb813);}},'beforeUpdate':function(_0x2f9eb2,_0x1e7442,_0x457f29){if(_0x2f9eb2[_0x43ea('0xe')](_0x43ea('0xc'))||_0x2f9eb2['changed']('serverUrl')||_0x2f9eb2[_0x43ea('0xe')](_0x43ea('0xf'))||_0x2f9eb2[_0x43ea('0xe')]('clientSecret')||_0x2f9eb2[_0x43ea('0xe')](_0x43ea('0x11'))||_0x2f9eb2['changed'](_0x43ea('0x12'))){var _0x564411,_0x2f3242;_0x564411=_0x2f9eb2[_0x43ea('0xd')];var _0x47987e=_0x564411[_0x43ea('0x13')](-0x1);if(_0x47987e==='/'||_0x47987e==='\x5c'||_0x47987e===':'){_0x564411=_0x564411['substring'](0x0,_0x564411[_0x43ea('0x15')](_0x47987e));}switch(_0x2f9eb2[_0x43ea('0xc')]){case'US':_0x2f3242=_0x43ea('0x27');break;case'AU':_0x2f3242=_0x43ea('0x16');break;case'IN':_0x2f3242=_0x43ea('0x17');break;case'CN':_0x2f3242=_0x43ea('0x18');break;default:_0x2f3242=_0x43ea('0x19');break;}var _0xc2090d={'method':_0x43ea('0x1a'),'uri':_0x2f3242+'/oauth/v2/token','form':{'grant_type':_0x43ea('0x1c'),'client_id':_0x2f9eb2['clientId'],'client_secret':_0x2f9eb2['clientSecret'],'redirect_uri':_0x2f9eb2[_0x43ea('0xd')],'code':_0x2f9eb2['code']},'headers':{'Content-Type':_0x43ea('0x1d')}};return rp(_0xc2090d)[_0x43ea('0x1e')](function(_0x2de514){var _0x25d9d3=JSON['parse'](_0x2de514);if(_0x25d9d3[_0x43ea('0x1f')]){_0x2f9eb2[_0x43ea('0x20')]=_0x25d9d3['refresh_token'];logger[_0x43ea('0x28')](util[_0x43ea('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2f9eb2[_0x43ea('0x26')],_0x2f9eb2['id']));}else{logger[_0x43ea('0x22')](util[_0x43ea('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2f9eb2[_0x43ea('0x26')],_0x2f9eb2['id']),util[_0x43ea('0x24')](_0x25d9d3,{'showHidden':![],'depth':null}));}return _0x457f29(null,_0x1e7442);})[_0x43ea('0x25')](function(_0x548d5a){logger[_0x43ea('0x22')](util[_0x43ea('0x21')](_0x43ea('0x23'),_0x2f9eb2[_0x43ea('0x26')],_0x2f9eb2['id']),util[_0x43ea('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x457f29(_0x548d5a);});}else{return _0x457f29(null,_0x1e7442);}}}});};
\ No newline at end of file
index 80b7db1..81887e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e63=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','GetZohoAccount','ZohoAccount','options','raw','where','include','map','model','attributes','find','ShowZohoAccount','stringify','lodash'];(function(_0x10136e,_0x1bb577){var _0x34be9a=function(_0x3af687){while(--_0x3af687){_0x10136e['push'](_0x10136e['shift']());}};_0x34be9a(++_0x1bb577);}(_0x9e63,0x65));var _0x39e6=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x9e63[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x39e6('0x0'));var util=require(_0x39e6('0x1'));var moment=require(_0x39e6('0x2'));var BPromise=require('bluebird');var rs=require(_0x39e6('0x3'));var fs=require('fs');var Redis=require(_0x39e6('0x4'));var db=require(_0x39e6('0x5'))['db'];var utils=require(_0x39e6('0x6'));var logger=require(_0x39e6('0x7'))(_0x39e6('0x8'));var config=require(_0x39e6('0x9'));var jayson=require(_0x39e6('0xa'));var client=jayson['client'][_0x39e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c2224,_0x3f2fa2,_0x554392){return new BPromise(function(_0x21938f,_0xddc291){return client['request'](_0x3c2224,_0x554392)[_0x39e6('0xc')](function(_0x4ee158){logger['info'](_0x39e6('0xd'),_0x3f2fa2,_0x39e6('0xe'));logger[_0x39e6('0xf')](_0x39e6('0x10'),_0x3f2fa2,_0x39e6('0xe'),JSON['stringify'](_0x4ee158));if(_0x4ee158['error']){if(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x12')]===0x1f4){logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x4ee158[_0x39e6('0x11')]['message']);return _0xddc291(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x13')]);}logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x4ee158['error']['message']);return _0x21938f(_0x4ee158[_0x39e6('0x11')][_0x39e6('0x13')]);}else{logger[_0x39e6('0x14')](_0x39e6('0xd'),_0x3f2fa2,_0x39e6('0xe'));_0x21938f(_0x4ee158['result'][_0x39e6('0x13')]);}})[_0x39e6('0x15')](function(_0x32ad13){logger[_0x39e6('0x11')](_0x39e6('0xd'),_0x3f2fa2,_0x32ad13);_0xddc291(_0x32ad13);});});}exports[_0x39e6('0x16')]=function(_0x1a3adf){var _0x512279=this;return new Promise(function(_0x24a61c,_0x3e6c74){return db[_0x39e6('0x17')]['findAll']({'raw':_0x1a3adf['options']?_0x1a3adf[_0x39e6('0x18')][_0x39e6('0x19')]===undefined?!![]:![]:!![],'where':_0x1a3adf[_0x39e6('0x18')]?_0x1a3adf[_0x39e6('0x18')][_0x39e6('0x1a')]||null:null,'attributes':_0x1a3adf['options']?_0x1a3adf[_0x39e6('0x18')]['attributes']||null:null,'limit':_0x1a3adf[_0x39e6('0x18')]?_0x1a3adf[_0x39e6('0x18')]['limit']||null:null,'include':_0x1a3adf[_0x39e6('0x18')]?_0x1a3adf[_0x39e6('0x18')][_0x39e6('0x1b')]?_[_0x39e6('0x1c')](_0x1a3adf[_0x39e6('0x18')][_0x39e6('0x1b')],function(_0x183f33){return{'model':db[_0x183f33[_0x39e6('0x1d')]],'as':_0x183f33['as'],'attributes':_0x183f33[_0x39e6('0x1e')],'include':_0x183f33[_0x39e6('0x1b')]?_[_0x39e6('0x1c')](_0x183f33[_0x39e6('0x1b')],function(_0x3dce4d){return{'model':db[_0x3dce4d['model']],'as':_0x3dce4d['as'],'attributes':_0x3dce4d[_0x39e6('0x1e')],'include':_0x3dce4d['include']?_['map'](_0x3dce4d[_0x39e6('0x1b')],function(_0x22b820){return{'model':db[_0x22b820[_0x39e6('0x1d')]],'as':_0x22b820['as'],'attributes':_0x22b820[_0x39e6('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x39de88){logger[_0x39e6('0x14')]('GetZohoAccount',_0x1a3adf);logger[_0x39e6('0xf')](_0x39e6('0x16'),_0x1a3adf,JSON['stringify'](_0x39de88));_0x24a61c(_0x39de88);})[_0x39e6('0x15')](function(_0x2117d0){logger[_0x39e6('0x11')](_0x39e6('0x16'),_0x2117d0[_0x39e6('0x13')],_0x1a3adf);_0x3e6c74(_0x512279['error'](0x1f4,_0x2117d0[_0x39e6('0x13')]));});});};exports['ShowZohoAccount']=function(_0x355ad9){var _0x14c4d3=this;return new Promise(function(_0x3db607,_0x3c01e9){return db[_0x39e6('0x17')][_0x39e6('0x1f')]({'raw':_0x355ad9[_0x39e6('0x18')]?_0x355ad9[_0x39e6('0x18')][_0x39e6('0x19')]===undefined?!![]:![]:!![],'where':_0x355ad9[_0x39e6('0x18')]?_0x355ad9[_0x39e6('0x18')][_0x39e6('0x1a')]||null:null,'attributes':_0x355ad9[_0x39e6('0x18')]?_0x355ad9[_0x39e6('0x18')][_0x39e6('0x1e')]||null:null,'include':_0x355ad9[_0x39e6('0x18')]?_0x355ad9['options'][_0x39e6('0x1b')]?_[_0x39e6('0x1c')](_0x355ad9[_0x39e6('0x18')]['include'],function(_0x11b0c3){return{'model':db[_0x11b0c3[_0x39e6('0x1d')]],'as':_0x11b0c3['as'],'attributes':_0x11b0c3[_0x39e6('0x1e')],'include':_0x11b0c3['include']?_[_0x39e6('0x1c')](_0x11b0c3['include'],function(_0x15d6db){return{'model':db[_0x15d6db[_0x39e6('0x1d')]],'as':_0x15d6db['as'],'attributes':_0x15d6db[_0x39e6('0x1e')],'include':_0x15d6db['include']?_[_0x39e6('0x1c')](_0x15d6db[_0x39e6('0x1b')],function(_0x45c327){return{'model':db[_0x45c327[_0x39e6('0x1d')]],'as':_0x45c327['as'],'attributes':_0x45c327['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xbe8b5){logger[_0x39e6('0x14')](_0x39e6('0x20'),_0x355ad9);logger[_0x39e6('0xf')](_0x39e6('0x20'),_0x355ad9,JSON[_0x39e6('0x21')](_0xbe8b5));_0x3db607(_0xbe8b5);})[_0x39e6('0x15')](function(_0x4e0a01){logger[_0x39e6('0x11')]('ShowZohoAccount',_0x4e0a01['message'],_0x355ad9);_0x3c01e9(_0x14c4d3[_0x39e6('0x11')](0x1f4,_0x4e0a01[_0x39e6('0x13')]));});});};
\ No newline at end of file
+var _0xfff0=['model','info','GetZohoAccount','catch','ShowZohoAccount','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ZohoAccount','findAll','options','raw','attributes','include','map'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfff0,0x139));var _0x0fff=function(_0x46a0fd,_0x10ae4e){_0x46a0fd=_0x46a0fd-0x0;var _0x41e574=_0xfff0[_0x46a0fd];return _0x41e574;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d2b,_0x586dc5,_0x24cfb0){return new BPromise(function(_0x5e9672,_0x1f2658){return client['request'](_0x2f1d2b,_0x24cfb0)[_0x0fff('0xa')](function(_0x3db6f6){logger['info'](_0x0fff('0xb'),_0x586dc5,_0x0fff('0xc'));logger[_0x0fff('0xd')](_0x0fff('0xe'),_0x586dc5,_0x0fff('0xc'),JSON[_0x0fff('0xf')](_0x3db6f6));if(_0x3db6f6[_0x0fff('0x10')]){if(_0x3db6f6[_0x0fff('0x10')][_0x0fff('0x11')]===0x1f4){logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6['error'][_0x0fff('0x12')]);return _0x1f2658(_0x3db6f6['error'][_0x0fff('0x12')]);}logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6[_0x0fff('0x10')]['message']);return _0x5e9672(_0x3db6f6['error'][_0x0fff('0x12')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x586dc5,'request\x20sent');_0x5e9672(_0x3db6f6[_0x0fff('0x13')][_0x0fff('0x12')]);}})['catch'](function(_0x431b33){logger[_0x0fff('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x586dc5,_0x431b33);_0x1f2658(_0x431b33);});});}exports['GetZohoAccount']=function(_0x48f36d){var _0x2337f=this;return new Promise(function(_0x606792,_0x46a02d){return db[_0x0fff('0x14')][_0x0fff('0x15')]({'raw':_0x48f36d[_0x0fff('0x16')]?_0x48f36d['options'][_0x0fff('0x17')]===undefined?!![]:![]:!![],'where':_0x48f36d[_0x0fff('0x16')]?_0x48f36d[_0x0fff('0x16')]['where']||null:null,'attributes':_0x48f36d['options']?_0x48f36d[_0x0fff('0x16')][_0x0fff('0x18')]||null:null,'limit':_0x48f36d[_0x0fff('0x16')]?_0x48f36d[_0x0fff('0x16')]['limit']||null:null,'include':_0x48f36d[_0x0fff('0x16')]?_0x48f36d[_0x0fff('0x16')][_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x48f36d[_0x0fff('0x16')][_0x0fff('0x19')],function(_0x580b8e){return{'model':db[_0x580b8e[_0x0fff('0x1b')]],'as':_0x580b8e['as'],'attributes':_0x580b8e[_0x0fff('0x18')],'include':_0x580b8e[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x580b8e[_0x0fff('0x19')],function(_0x23d9f8){return{'model':db[_0x23d9f8['model']],'as':_0x23d9f8['as'],'attributes':_0x23d9f8[_0x0fff('0x18')],'include':_0x23d9f8[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x23d9f8[_0x0fff('0x19')],function(_0x36d268){return{'model':db[_0x36d268[_0x0fff('0x1b')]],'as':_0x36d268['as'],'attributes':_0x36d268[_0x0fff('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0fff('0xa')](function(_0x44e54a){logger[_0x0fff('0x1c')](_0x0fff('0x1d'),_0x48f36d);logger[_0x0fff('0xd')]('GetZohoAccount',_0x48f36d,JSON[_0x0fff('0xf')](_0x44e54a));_0x606792(_0x44e54a);})[_0x0fff('0x1e')](function(_0x17ab6f){logger[_0x0fff('0x10')](_0x0fff('0x1d'),_0x17ab6f[_0x0fff('0x12')],_0x48f36d);_0x46a02d(_0x2337f['error'](0x1f4,_0x17ab6f[_0x0fff('0x12')]));});});};exports[_0x0fff('0x1f')]=function(_0x351102){var _0x48f1d1=this;return new Promise(function(_0x1016fa,_0x3fa6fc){return db['ZohoAccount'][_0x0fff('0x20')]({'raw':_0x351102[_0x0fff('0x16')]?_0x351102[_0x0fff('0x16')][_0x0fff('0x17')]===undefined?!![]:![]:!![],'where':_0x351102[_0x0fff('0x16')]?_0x351102[_0x0fff('0x16')][_0x0fff('0x21')]||null:null,'attributes':_0x351102[_0x0fff('0x16')]?_0x351102[_0x0fff('0x16')][_0x0fff('0x18')]||null:null,'include':_0x351102['options']?_0x351102[_0x0fff('0x16')][_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x351102[_0x0fff('0x16')][_0x0fff('0x19')],function(_0x5967dc){return{'model':db[_0x5967dc['model']],'as':_0x5967dc['as'],'attributes':_0x5967dc[_0x0fff('0x18')],'include':_0x5967dc[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x5967dc[_0x0fff('0x19')],function(_0x5c1797){return{'model':db[_0x5c1797[_0x0fff('0x1b')]],'as':_0x5c1797['as'],'attributes':_0x5c1797[_0x0fff('0x18')],'include':_0x5c1797[_0x0fff('0x19')]?_[_0x0fff('0x1a')](_0x5c1797['include'],function(_0x36a233){return{'model':db[_0x36a233[_0x0fff('0x1b')]],'as':_0x36a233['as'],'attributes':_0x36a233[_0x0fff('0x18')]};}):[]};}):[]};}):[]:[]})[_0x0fff('0xa')](function(_0x191369){logger[_0x0fff('0x1c')](_0x0fff('0x1f'),_0x351102);logger[_0x0fff('0xd')](_0x0fff('0x1f'),_0x351102,JSON[_0x0fff('0xf')](_0x191369));_0x1016fa(_0x191369);})[_0x0fff('0x1e')](function(_0xeea9a7){logger['error'](_0x0fff('0x1f'),_0xeea9a7[_0x0fff('0x12')],_0x351102);_0x3fa6fc(_0x48f1d1[_0x0fff('0x10')](0x1f4,_0xeea9a7[_0x0fff('0x12')]));});});};
\ No newline at end of file
index fcf6fbc..52835dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8eab=['../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x502598,_0x1e95c8){var _0xbdee21=function(_0x140feb){while(--_0x140feb){_0x502598['push'](_0x502598['shift']());}};_0xbdee21(++_0x1e95c8);}(_0x8eab,0x1ae));var _0xb8ea=function(_0x54b2c1,_0x2be4c1){_0x54b2c1=_0x54b2c1-0x0;var _0x368a85=_0x8eab[_0x54b2c1];return _0x368a85;};'use strict';var multer=require(_0xb8ea('0x0'));var util=require(_0xb8ea('0x1'));var path=require(_0xb8ea('0x2'));var timeout=require(_0xb8ea('0x3'));var express=require(_0xb8ea('0x4'));var router=express[_0xb8ea('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb8ea('0x6'));var interaction=require(_0xb8ea('0x7'));var config=require(_0xb8ea('0x8'));var controller=require(_0xb8ea('0x9'));router[_0xb8ea('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb8ea('0xb'),auth[_0xb8ea('0xc')](),controller[_0xb8ea('0xd')]);router[_0xb8ea('0xa')](_0xb8ea('0xe'),auth[_0xb8ea('0xc')](),controller['getFields']);router['get'](_0xb8ea('0xf'),auth[_0xb8ea('0xc')](),controller['getSubjects']);router['get'](_0xb8ea('0x10'),auth[_0xb8ea('0xc')](),controller[_0xb8ea('0x11')]);router[_0xb8ea('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb8ea('0x13')](_0xb8ea('0xb'),auth[_0xb8ea('0xc')](),controller[_0xb8ea('0x14')]);router[_0xb8ea('0x15')](_0xb8ea('0xb'),auth['isAuthenticated'](),controller[_0xb8ea('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x542e=['post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x5b3a3c,_0x4f5d7e){var _0x5b8add=function(_0x93362d){while(--_0x93362d){_0x5b3a3c['push'](_0x5b3a3c['shift']());}};_0x5b8add(++_0x4f5d7e);}(_0x542e,0x7a));var _0xe542=function(_0x557ada,_0x271ee9){_0x557ada=_0x557ada-0x0;var _0x46d30f=_0x542e[_0x557ada];return _0x46d30f;};'use strict';var multer=require(_0xe542('0x0'));var util=require(_0xe542('0x1'));var path=require(_0xe542('0x2'));var timeout=require(_0xe542('0x3'));var express=require(_0xe542('0x4'));var router=express['Router']();var fs_extra=require(_0xe542('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe542('0x6'));var config=require(_0xe542('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0xe542('0x8')]('/',auth[_0xe542('0x9')](),controller[_0xe542('0xa')]);router[_0xe542('0x8')](_0xe542('0xb'),auth[_0xe542('0x9')](),controller['show']);router[_0xe542('0x8')](_0xe542('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xe542('0x8')]('/:id/subjects',auth[_0xe542('0x9')](),controller[_0xe542('0xd')]);router[_0xe542('0x8')](_0xe542('0xe'),auth[_0xe542('0x9')](),controller[_0xe542('0xf')]);router[_0xe542('0x10')]('/',auth[_0xe542('0x9')](),controller[_0xe542('0x11')]);router[_0xe542('0x12')](_0xe542('0xb'),auth[_0xe542('0x9')](),controller[_0xe542('0x13')]);router[_0xe542('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe542('0x15')]);module[_0xe542('0x16')]=router;
\ No newline at end of file
index 3f90bdf..7de4b6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8328=['sequelize','exports','STRING','ENUM','lead','contact','nothing','contact_lead'];(function(_0x39a2d6,_0x477459){var _0x23af66=function(_0x2eb95e){while(--_0x2eb95e){_0x39a2d6['push'](_0x39a2d6['shift']());}};_0x23af66(++_0x477459);}(_0x8328,0x1e0));var _0x8832=function(_0x2c5a1b,_0x4bef0e){_0x2c5a1b=_0x2c5a1b-0x0;var _0x2fff3e=_0x8328[_0x2c5a1b];return _0x2fff3e;};'use strict';var Sequelize=require(_0x8832('0x0'));module[_0x8832('0x1')]={'name':{'type':Sequelize[_0x8832('0x2')]},'moduleCreate':{'type':Sequelize[_0x8832('0x3')](_0x8832('0x4'),_0x8832('0x5'),_0x8832('0x6')),'defaultValue':_0x8832('0x4')},'moduleSearch':{'type':Sequelize[_0x8832('0x3')](_0x8832('0x7'),_0x8832('0x5'),_0x8832('0x4')),'defaultValue':_0x8832('0x7')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6a4f=['contact','exports','STRING','lead','ENUM'];(function(_0x3e8ba4,_0x2d1af1){var _0x5721d9=function(_0x4477b9){while(--_0x4477b9){_0x3e8ba4['push'](_0x3e8ba4['shift']());}};_0x5721d9(++_0x2d1af1);}(_0x6a4f,0x17d));var _0xf6a4=function(_0x193ad3,_0x3cd54e){_0x193ad3=_0x193ad3-0x0;var _0x1d12f2=_0x6a4f[_0x193ad3];return _0x1d12f2;};'use strict';var Sequelize=require('sequelize');module[_0xf6a4('0x0')]={'name':{'type':Sequelize[_0xf6a4('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xf6a4('0x2'),'contact','nothing'),'defaultValue':_0xf6a4('0x2')},'moduleSearch':{'type':Sequelize[_0xf6a4('0x3')]('contact_lead',_0xf6a4('0x4'),_0xf6a4('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xf6a4('0x1')]}};
\ No newline at end of file
index e2bcdd7..613719f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc12c=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','name','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','length','includeAll','options','create','body','find','getFields','findOne','ZohoField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x436981,_0x371571){var _0x2e4f86=function(_0x2da649){while(--_0x2da649){_0x436981['push'](_0x436981['shift']());}};_0x2e4f86(++_0x371571);}(_0xc12c,0xee));var _0xcc12=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xc12c[_0x92c450];return _0x2a9599;};'use strict';var emlformat=require(_0xcc12('0x0'));var rimraf=require(_0xcc12('0x1'));var zipdir=require(_0xcc12('0x2'));var jsonpatch=require(_0xcc12('0x3'));var rp=require(_0xcc12('0x4'));var moment=require('moment');var BPromise=require(_0xcc12('0x5'));var Mustache=require(_0xcc12('0x6'));var util=require(_0xcc12('0x7'));var path=require(_0xcc12('0x8'));var sox=require(_0xcc12('0x9'));var csv=require(_0xcc12('0xa'));var ejs=require(_0xcc12('0xb'));var fs=require('fs');var fs_extra=require(_0xcc12('0xc'));var _=require(_0xcc12('0xd'));var squel=require(_0xcc12('0xe'));var crypto=require(_0xcc12('0xf'));var jsforce=require(_0xcc12('0x10'));var deskjs=require(_0xcc12('0x11'));var toCsv=require(_0xcc12('0xa'));var querystring=require(_0xcc12('0x12'));var Papa=require(_0xcc12('0x13'));var Redis=require(_0xcc12('0x14'));var authService=require(_0xcc12('0x15'));var qs=require(_0xcc12('0x16'));var as=require(_0xcc12('0x17'));var hardwareService=require(_0xcc12('0x18'));var logger=require(_0xcc12('0x19'))('api');var utils=require('../../config/utils');var config=require(_0xcc12('0x1a'));var licenseUtil=require(_0xcc12('0x1b'));var db=require(_0xcc12('0x1c'))['db'];function respondWithStatusCode(_0x9ae14e,_0x38b6f5){_0x38b6f5=_0x38b6f5||0xcc;return function(_0x5cfc61){if(_0x5cfc61){return _0x9ae14e[_0xcc12('0x1d')](_0x38b6f5);}return _0x9ae14e[_0xcc12('0x1e')](_0x38b6f5)[_0xcc12('0x1f')]();};}function respondWithResult(_0x4b05d2,_0x1b59a8){_0x1b59a8=_0x1b59a8||0xc8;return function(_0xc43f2e){if(_0xc43f2e){return _0x4b05d2[_0xcc12('0x1e')](_0x1b59a8)[_0xcc12('0x20')](_0xc43f2e);}};}function respondWithFilteredResult(_0x1360f1,_0x2b61f4){return function(_0x4a0062){if(_0x4a0062){var _0x578aab=typeof _0x2b61f4[_0xcc12('0x21')]===_0xcc12('0x22')&&typeof _0x2b61f4[_0xcc12('0x23')]===_0xcc12('0x22');var _0x4ee656=_0x4a0062[_0xcc12('0x24')];var _0x22e547=_0x578aab?0x0:_0x2b61f4[_0xcc12('0x21')];var _0xaa9942=_0x578aab?_0x4a0062[_0xcc12('0x24')]:_0x2b61f4[_0xcc12('0x21')]+_0x2b61f4[_0xcc12('0x23')];var _0x3bc214;if(_0xaa9942>=_0x4ee656){_0xaa9942=_0x4ee656;_0x3bc214=0xc8;}else{_0x3bc214=0xce;}_0x1360f1[_0xcc12('0x1e')](_0x3bc214);return _0x1360f1[_0xcc12('0x25')](_0xcc12('0x26'),_0x22e547+'-'+_0xaa9942+'/'+_0x4ee656)[_0xcc12('0x20')](_0x4a0062);}return null;};}function patchUpdates(_0x258d9e){return function(_0x37fdd9){try{jsonpatch[_0xcc12('0x27')](_0x37fdd9,_0x258d9e,!![]);}catch(_0x23f352){return BPromise['reject'](_0x23f352);}return _0x37fdd9[_0xcc12('0x28')]();};}function saveUpdates(_0x337fbf,_0x183067){return function(_0x23ac15){if(_0x23ac15){return _0x23ac15[_0xcc12('0x29')](_0x337fbf)[_0xcc12('0x2a')](function(_0x4398c2){return _0x4398c2;});}return null;};}function removeEntity(_0x5bad20,_0x5d76b8){return function(_0x82eeee){if(_0x82eeee){return _0x82eeee[_0xcc12('0x2b')]()['then'](function(){_0x5bad20[_0xcc12('0x1e')](0xcc)[_0xcc12('0x1f')]();});}};}function handleEntityNotFound(_0x200ecb,_0x48c2db){return function(_0x58daff){if(!_0x58daff){_0x200ecb[_0xcc12('0x1d')](0x194);}return _0x58daff;};}function handleError(_0x4e394f,_0x142333){_0x142333=_0x142333||0x1f4;return function(_0x247ad5){logger[_0xcc12('0x2c')](_0x247ad5[_0xcc12('0x2d')]);if(_0x247ad5['name']){delete _0x247ad5['name'];}_0x4e394f[_0xcc12('0x1e')](_0x142333)[_0xcc12('0x2e')](_0x247ad5);};}exports[_0xcc12('0x2f')]=function(_0x179bf4,_0x18a418){var _0x10db14={},_0x879142={},_0xefc46f={'count':0x0,'rows':[]};var _0x103a9d=_[_0xcc12('0x30')](db[_0xcc12('0x31')][_0xcc12('0x32')],function(_0x41fc36){return{'name':_0x41fc36[_0xcc12('0x33')],'type':_0x41fc36[_0xcc12('0x34')][_0xcc12('0x35')]};});_0x879142[_0xcc12('0x36')]=_[_0xcc12('0x30')](_0x103a9d,_0xcc12('0x37'));_0x879142['query']=_[_0xcc12('0x38')](_0x179bf4[_0xcc12('0x39')]);_0x879142[_0xcc12('0x3a')]=_['intersection'](_0x879142[_0xcc12('0x36')],_0x879142[_0xcc12('0x39')]);_0x10db14[_0xcc12('0x3b')]=_[_0xcc12('0x3c')](_0x879142[_0xcc12('0x36')],qs[_0xcc12('0x3d')](_0x179bf4[_0xcc12('0x39')][_0xcc12('0x3d')]));_0x10db14[_0xcc12('0x3b')]=_0x10db14[_0xcc12('0x3b')]['length']?_0x10db14[_0xcc12('0x3b')]:_0x879142['model'];if(!_0x179bf4['query'][_0xcc12('0x3e')](_0xcc12('0x3f'))){_0x10db14[_0xcc12('0x23')]=qs[_0xcc12('0x23')](_0x179bf4[_0xcc12('0x39')]['limit']);_0x10db14[_0xcc12('0x21')]=qs['offset'](_0x179bf4[_0xcc12('0x39')][_0xcc12('0x21')]);}_0x10db14['order']=qs['sort'](_0x179bf4[_0xcc12('0x39')][_0xcc12('0x40')]);_0x10db14[_0xcc12('0x41')]=qs[_0xcc12('0x3a')](_[_0xcc12('0x42')](_0x179bf4['query'],_0x879142[_0xcc12('0x3a')]),_0x103a9d);if(_0x179bf4[_0xcc12('0x39')][_0xcc12('0x43')]){_0x10db14[_0xcc12('0x41')]=_[_0xcc12('0x44')](_0x10db14['where'],{'$or':_[_0xcc12('0x30')](_0x103a9d,function(_0x377202){if(_0x377202[_0xcc12('0x34')]!==_0xcc12('0x45')){var _0x244411={};_0x244411[_0x377202[_0xcc12('0x37')]]={'$like':'%'+_0x179bf4[_0xcc12('0x39')][_0xcc12('0x43')]+'%'};return _0x244411;}})});}_0x10db14=_['merge']({},_0x10db14,_0x179bf4['options']);var _0x39348b={'where':_0x10db14['where']};return db[_0xcc12('0x31')]['count'](_0x39348b)['then'](function(_0xf874de){_0xefc46f[_0xcc12('0x24')]=_0xf874de;if(_0x179bf4['query']['includeAll']){_0x10db14[_0xcc12('0x46')]=[{'all':!![]}];}return db[_0xcc12('0x31')]['findAll'](_0x10db14);})[_0xcc12('0x2a')](function(_0x59c135){_0xefc46f[_0xcc12('0x47')]=_0x59c135;return _0xefc46f;})[_0xcc12('0x2a')](respondWithFilteredResult(_0x18a418,_0x10db14))[_0xcc12('0x48')](handleError(_0x18a418,null));};exports[_0xcc12('0x49')]=function(_0x2f706d,_0x534512){var _0x5aa3d9={'raw':![],'where':{'id':_0x2f706d[_0xcc12('0x4a')]['id']}},_0x43eaab={};_0x43eaab[_0xcc12('0x36')]=_[_0xcc12('0x38')](db[_0xcc12('0x31')][_0xcc12('0x32')]);_0x43eaab[_0xcc12('0x39')]=_[_0xcc12('0x38')](_0x2f706d[_0xcc12('0x39')]);_0x43eaab['filters']=_[_0xcc12('0x3c')](_0x43eaab[_0xcc12('0x36')],_0x43eaab[_0xcc12('0x39')]);_0x5aa3d9['attributes']=_[_0xcc12('0x3c')](_0x43eaab[_0xcc12('0x36')],qs['fields'](_0x2f706d[_0xcc12('0x39')][_0xcc12('0x3d')]));_0x5aa3d9['attributes']=_0x5aa3d9['attributes'][_0xcc12('0x4b')]?_0x5aa3d9[_0xcc12('0x3b')]:_0x43eaab['model'];if(_0x2f706d[_0xcc12('0x39')][_0xcc12('0x4c')]){_0x5aa3d9[_0xcc12('0x46')]=[{'all':!![]}];}_0x5aa3d9=_[_0xcc12('0x44')]({},_0x5aa3d9,_0x2f706d[_0xcc12('0x4d')]);return db['ZohoConfiguration']['find'](_0x5aa3d9)['then'](handleEntityNotFound(_0x534512,null))['then'](respondWithResult(_0x534512,null))[_0xcc12('0x48')](handleError(_0x534512,null));};exports[_0xcc12('0x4e')]=function(_0x345dbf,_0x33b002){return db['ZohoConfiguration'][_0xcc12('0x4e')](_0x345dbf[_0xcc12('0x4f')],{})['then'](respondWithResult(_0x33b002,0xc9))[_0xcc12('0x48')](handleError(_0x33b002,null));};exports['update']=function(_0x4bc907,_0x386729){if(_0x4bc907[_0xcc12('0x4f')]['id']){delete _0x4bc907[_0xcc12('0x4f')]['id'];}return db['ZohoConfiguration'][_0xcc12('0x50')]({'where':{'id':_0x4bc907[_0xcc12('0x4a')]['id']}})[_0xcc12('0x2a')](handleEntityNotFound(_0x386729,null))[_0xcc12('0x2a')](saveUpdates(_0x4bc907['body'],null))[_0xcc12('0x2a')](respondWithResult(_0x386729,null))[_0xcc12('0x48')](handleError(_0x386729,null));};exports[_0xcc12('0x2b')]=function(_0x147bcb,_0x12c7d4){return db[_0xcc12('0x31')]['find']({'where':{'id':_0x147bcb[_0xcc12('0x4a')]['id']}})[_0xcc12('0x2a')](handleEntityNotFound(_0x12c7d4,null))['then'](removeEntity(_0x12c7d4,null))[_0xcc12('0x48')](handleError(_0x12c7d4,null));};exports[_0xcc12('0x51')]=function(_0x51a0b5,_0x3f8df3,_0x1a195d){var _0xe07f7c={};var _0x42b70c={};var _0x40005c;var _0x31d808;return db[_0xcc12('0x31')][_0xcc12('0x52')]({'where':{'id':_0x51a0b5[_0xcc12('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3f8df3,null))[_0xcc12('0x2a')](function(_0x14a6c1){if(_0x14a6c1){_0x40005c=_0x14a6c1;_0x42b70c['model']=_['keys'](db[_0xcc12('0x53')][_0xcc12('0x32')]);_0x42b70c[_0xcc12('0x39')]=_[_0xcc12('0x38')](_0x51a0b5[_0xcc12('0x39')]);_0x42b70c['filters']=_['intersection'](_0x42b70c[_0xcc12('0x36')],_0x42b70c[_0xcc12('0x39')]);_0xe07f7c[_0xcc12('0x3b')]=_[_0xcc12('0x3c')](_0x42b70c['model'],qs['fields'](_0x51a0b5[_0xcc12('0x39')][_0xcc12('0x3d')]));_0xe07f7c[_0xcc12('0x3b')]=_0xe07f7c[_0xcc12('0x3b')]['length']?_0xe07f7c[_0xcc12('0x3b')]:_0x42b70c['model'];_0xe07f7c[_0xcc12('0x54')]=qs[_0xcc12('0x40')](_0x51a0b5[_0xcc12('0x39')][_0xcc12('0x40')]);_0xe07f7c['where']=qs['filters'](_[_0xcc12('0x42')](_0x51a0b5[_0xcc12('0x39')],_0x42b70c[_0xcc12('0x3a')]));if(_0x51a0b5[_0xcc12('0x39')][_0xcc12('0x43')]){_0xe07f7c['where']=_['merge'](_0xe07f7c['where'],{'$or':_['map'](_0xe07f7c[_0xcc12('0x3b')],function(_0x2d32da){var _0x3377a5={};_0x3377a5[_0x2d32da]={'$like':'%'+_0x51a0b5['query'][_0xcc12('0x43')]+'%'};return _0x3377a5;})});}_0xe07f7c=_[_0xcc12('0x44')]({},_0xe07f7c,_0x51a0b5['options']);return _0x40005c[_0xcc12('0x51')](_0xe07f7c);}})[_0xcc12('0x2a')](function(_0x3ab78c){if(_0x3ab78c){_0x31d808=_0x3ab78c[_0xcc12('0x4b')];if(!_0x51a0b5[_0xcc12('0x39')][_0xcc12('0x3e')](_0xcc12('0x3f'))){_0xe07f7c[_0xcc12('0x23')]=qs[_0xcc12('0x23')](_0x51a0b5[_0xcc12('0x39')][_0xcc12('0x23')]);_0xe07f7c[_0xcc12('0x21')]=qs[_0xcc12('0x21')](_0x51a0b5[_0xcc12('0x39')]['offset']);}return _0x40005c['getFields'](_0xe07f7c);}})[_0xcc12('0x2a')](function(_0x4c7c16){if(_0x4c7c16){return _0x4c7c16?{'count':_0x31d808,'rows':_0x4c7c16}:null;}})['then'](respondWithResult(_0x3f8df3,null))['catch'](handleError(_0x3f8df3,null));};exports[_0xcc12('0x55')]=function(_0x57ce05,_0x1a55dd,_0x233de1){var _0x47c914={};var _0x32e845={};var _0x17707a;var _0x7641e0;return db['ZohoConfiguration'][_0xcc12('0x52')]({'where':{'id':_0x57ce05[_0xcc12('0x4a')]['id']}})[_0xcc12('0x2a')](handleEntityNotFound(_0x1a55dd,null))[_0xcc12('0x2a')](function(_0x14513a){if(_0x14513a){_0x17707a=_0x14513a;_0x32e845[_0xcc12('0x36')]=_['keys'](db['ZohoField']['rawAttributes']);_0x32e845[_0xcc12('0x39')]=_[_0xcc12('0x38')](_0x57ce05[_0xcc12('0x39')]);_0x32e845[_0xcc12('0x3a')]=_[_0xcc12('0x3c')](_0x32e845['model'],_0x32e845[_0xcc12('0x39')]);_0x47c914[_0xcc12('0x3b')]=_[_0xcc12('0x3c')](_0x32e845[_0xcc12('0x36')],qs[_0xcc12('0x3d')](_0x57ce05[_0xcc12('0x39')]['fields']));_0x47c914[_0xcc12('0x3b')]=_0x47c914['attributes'][_0xcc12('0x4b')]?_0x47c914[_0xcc12('0x3b')]:_0x32e845[_0xcc12('0x36')];_0x47c914[_0xcc12('0x54')]=qs[_0xcc12('0x40')](_0x57ce05[_0xcc12('0x39')][_0xcc12('0x40')]);_0x47c914[_0xcc12('0x41')]=qs[_0xcc12('0x3a')](_[_0xcc12('0x42')](_0x57ce05[_0xcc12('0x39')],_0x32e845[_0xcc12('0x3a')]));if(_0x57ce05[_0xcc12('0x39')][_0xcc12('0x43')]){_0x47c914[_0xcc12('0x41')]=_[_0xcc12('0x44')](_0x47c914[_0xcc12('0x41')],{'$or':_[_0xcc12('0x30')](_0x47c914[_0xcc12('0x3b')],function(_0x3ee8bf){var _0x267fce={};_0x267fce[_0x3ee8bf]={'$like':'%'+_0x57ce05[_0xcc12('0x39')][_0xcc12('0x43')]+'%'};return _0x267fce;})});}_0x47c914=_[_0xcc12('0x44')]({},_0x47c914,_0x57ce05['options']);return _0x17707a[_0xcc12('0x55')](_0x47c914);}})[_0xcc12('0x2a')](function(_0x2c493a){if(_0x2c493a){_0x7641e0=_0x2c493a['length'];if(!_0x57ce05[_0xcc12('0x39')][_0xcc12('0x3e')](_0xcc12('0x3f'))){_0x47c914[_0xcc12('0x23')]=qs[_0xcc12('0x23')](_0x57ce05[_0xcc12('0x39')]['limit']);_0x47c914['offset']=qs['offset'](_0x57ce05['query']['offset']);}return _0x17707a[_0xcc12('0x55')](_0x47c914);}})[_0xcc12('0x2a')](function(_0x5ce30a){if(_0x5ce30a){return _0x5ce30a?{'count':_0x7641e0,'rows':_0x5ce30a}:null;}})[_0xcc12('0x2a')](respondWithResult(_0x1a55dd,null))[_0xcc12('0x48')](handleError(_0x1a55dd,null));};exports[_0xcc12('0x56')]=function(_0x82f7ec,_0x35339f,_0x2f29b9){var _0x25b12b={};var _0x375b21={};var _0x2764ee;var _0x53095b;return db[_0xcc12('0x31')][_0xcc12('0x52')]({'where':{'id':_0x82f7ec['params']['id']}})[_0xcc12('0x2a')](handleEntityNotFound(_0x35339f,null))[_0xcc12('0x2a')](function(_0x4ebc44){if(_0x4ebc44){_0x2764ee=_0x4ebc44;_0x375b21[_0xcc12('0x36')]=_[_0xcc12('0x38')](db[_0xcc12('0x53')]['rawAttributes']);_0x375b21[_0xcc12('0x39')]=_[_0xcc12('0x38')](_0x82f7ec['query']);_0x375b21[_0xcc12('0x3a')]=_[_0xcc12('0x3c')](_0x375b21[_0xcc12('0x36')],_0x375b21['query']);_0x25b12b['attributes']=_[_0xcc12('0x3c')](_0x375b21['model'],qs[_0xcc12('0x3d')](_0x82f7ec[_0xcc12('0x39')][_0xcc12('0x3d')]));_0x25b12b[_0xcc12('0x3b')]=_0x25b12b['attributes'][_0xcc12('0x4b')]?_0x25b12b[_0xcc12('0x3b')]:_0x375b21[_0xcc12('0x36')];_0x25b12b['order']=qs[_0xcc12('0x40')](_0x82f7ec['query'][_0xcc12('0x40')]);_0x25b12b[_0xcc12('0x41')]=qs['filters'](_[_0xcc12('0x42')](_0x82f7ec[_0xcc12('0x39')],_0x375b21[_0xcc12('0x3a')]));if(_0x82f7ec[_0xcc12('0x39')][_0xcc12('0x43')]){_0x25b12b[_0xcc12('0x41')]=_[_0xcc12('0x44')](_0x25b12b[_0xcc12('0x41')],{'$or':_['map'](_0x25b12b['attributes'],function(_0x39467a){var _0x5758de={};_0x5758de[_0x39467a]={'$like':'%'+_0x82f7ec[_0xcc12('0x39')][_0xcc12('0x43')]+'%'};return _0x5758de;})});}_0x25b12b=_[_0xcc12('0x44')]({},_0x25b12b,_0x82f7ec[_0xcc12('0x4d')]);return _0x2764ee[_0xcc12('0x56')](_0x25b12b);}})[_0xcc12('0x2a')](function(_0x3c70a1){if(_0x3c70a1){_0x53095b=_0x3c70a1[_0xcc12('0x4b')];if(!_0x82f7ec[_0xcc12('0x39')][_0xcc12('0x3e')](_0xcc12('0x3f'))){_0x25b12b['limit']=qs[_0xcc12('0x23')](_0x82f7ec['query'][_0xcc12('0x23')]);_0x25b12b[_0xcc12('0x21')]=qs['offset'](_0x82f7ec[_0xcc12('0x39')][_0xcc12('0x21')]);}return _0x2764ee[_0xcc12('0x56')](_0x25b12b);}})[_0xcc12('0x2a')](function(_0x466fec){if(_0x466fec){return _0x466fec?{'count':_0x53095b,'rows':_0x466fec}:null;}})[_0xcc12('0x2a')](respondWithResult(_0x35339f,null))[_0xcc12('0x48')](handleError(_0x35339f,null));};
\ No newline at end of file
+var _0xdcde=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','save','update','then','destroy','end','error','stack','name','fieldName','query','keys','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','where','pick','filters','filter','merge','VIRTUAL','includeAll','ZohoConfiguration','findAll','rows','show','params','rawAttributes','include','options','find','catch','create','body','getFields','findOne','ZohoField','sort','map','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','jsforce','desk.js'];(function(_0x4d53d0,_0x32076a){var _0xf4203c=function(_0x8782aa){while(--_0x8782aa){_0x4d53d0['push'](_0x4d53d0['shift']());}};_0xf4203c(++_0x32076a);}(_0xdcde,0x8d));var _0xedcd=function(_0x5f3e99,_0xe7e8bf){_0x5f3e99=_0x5f3e99-0x0;var _0x17dc01=_0xdcde[_0x5f3e99];return _0x17dc01;};'use strict';var emlformat=require(_0xedcd('0x0'));var rimraf=require(_0xedcd('0x1'));var zipdir=require(_0xedcd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xedcd('0x3'));var moment=require(_0xedcd('0x4'));var BPromise=require(_0xedcd('0x5'));var Mustache=require(_0xedcd('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xedcd('0x7'));var ejs=require(_0xedcd('0x8'));var fs=require('fs');var fs_extra=require(_0xedcd('0x9'));var _=require(_0xedcd('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xedcd('0xb'));var deskjs=require(_0xedcd('0xc'));var toCsv=require(_0xedcd('0x7'));var querystring=require(_0xedcd('0xd'));var Papa=require(_0xedcd('0xe'));var Redis=require('ioredis');var authService=require(_0xedcd('0xf'));var qs=require(_0xedcd('0x10'));var as=require(_0xedcd('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xedcd('0x12'))(_0xedcd('0x13'));var utils=require(_0xedcd('0x14'));var config=require(_0xedcd('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xedcd('0x16'))['db'];function respondWithStatusCode(_0x3b83a4,_0x52d0fb){_0x52d0fb=_0x52d0fb||0xcc;return function(_0x2ec46c){if(_0x2ec46c){return _0x3b83a4[_0xedcd('0x17')](_0x52d0fb);}return _0x3b83a4[_0xedcd('0x18')](_0x52d0fb)['end']();};}function respondWithResult(_0x22bedf,_0x28eb02){_0x28eb02=_0x28eb02||0xc8;return function(_0x4af453){if(_0x4af453){return _0x22bedf[_0xedcd('0x18')](_0x28eb02)[_0xedcd('0x19')](_0x4af453);}};}function respondWithFilteredResult(_0x3e7d79,_0x3ce025){return function(_0xbbe937){if(_0xbbe937){var _0x8a151=typeof _0x3ce025['offset']===_0xedcd('0x1a')&&typeof _0x3ce025[_0xedcd('0x1b')]===_0xedcd('0x1a');var _0x5a9711=_0xbbe937[_0xedcd('0x1c')];var _0x333fb6=_0x8a151?0x0:_0x3ce025[_0xedcd('0x1d')];var _0x2c7448=_0x8a151?_0xbbe937[_0xedcd('0x1c')]:_0x3ce025[_0xedcd('0x1d')]+_0x3ce025[_0xedcd('0x1b')];var _0x25d98a;if(_0x2c7448>=_0x5a9711){_0x2c7448=_0x5a9711;_0x25d98a=0xc8;}else{_0x25d98a=0xce;}_0x3e7d79[_0xedcd('0x18')](_0x25d98a);return _0x3e7d79[_0xedcd('0x1e')](_0xedcd('0x1f'),_0x333fb6+'-'+_0x2c7448+'/'+_0x5a9711)['json'](_0xbbe937);}return null;};}function patchUpdates(_0x48fc4e){return function(_0x294d04){try{jsonpatch['apply'](_0x294d04,_0x48fc4e,!![]);}catch(_0x4f730a){return BPromise['reject'](_0x4f730a);}return _0x294d04[_0xedcd('0x20')]();};}function saveUpdates(_0x57ebe2,_0x5e9a38){return function(_0x4f9bad){if(_0x4f9bad){return _0x4f9bad[_0xedcd('0x21')](_0x57ebe2)[_0xedcd('0x22')](function(_0x464c56){return _0x464c56;});}return null;};}function removeEntity(_0x47223b,_0x141732){return function(_0x28e12a){if(_0x28e12a){return _0x28e12a[_0xedcd('0x23')]()[_0xedcd('0x22')](function(){_0x47223b[_0xedcd('0x18')](0xcc)[_0xedcd('0x24')]();});}};}function handleEntityNotFound(_0x39e8e6,_0x4484a2){return function(_0x396fbf){if(!_0x396fbf){_0x39e8e6[_0xedcd('0x17')](0x194);}return _0x396fbf;};}function handleError(_0x366df5,_0x3043dd){_0x3043dd=_0x3043dd||0x1f4;return function(_0x3ceaa7){logger[_0xedcd('0x25')](_0x3ceaa7[_0xedcd('0x26')]);if(_0x3ceaa7[_0xedcd('0x27')]){delete _0x3ceaa7[_0xedcd('0x27')];}_0x366df5[_0xedcd('0x18')](_0x3043dd)['send'](_0x3ceaa7);};}exports['index']=function(_0x3e65b3,_0x1e6fd8){var _0x4c8cc6={},_0x32f096={},_0x2e8ac0={'count':0x0,'rows':[]};var _0x5877bb=_['map'](db['ZohoConfiguration']['rawAttributes'],function(_0x1ba80f){return{'name':_0x1ba80f[_0xedcd('0x28')],'type':_0x1ba80f['type']['key']};});_0x32f096['model']=_['map'](_0x5877bb,_0xedcd('0x27'));_0x32f096[_0xedcd('0x29')]=_[_0xedcd('0x2a')](_0x3e65b3[_0xedcd('0x29')]);_0x32f096['filters']=_[_0xedcd('0x2b')](_0x32f096['model'],_0x32f096[_0xedcd('0x29')]);_0x4c8cc6['attributes']=_[_0xedcd('0x2b')](_0x32f096['model'],qs[_0xedcd('0x2c')](_0x3e65b3['query'][_0xedcd('0x2c')]));_0x4c8cc6[_0xedcd('0x2d')]=_0x4c8cc6[_0xedcd('0x2d')][_0xedcd('0x2e')]?_0x4c8cc6[_0xedcd('0x2d')]:_0x32f096[_0xedcd('0x2f')];if(!_0x3e65b3[_0xedcd('0x29')][_0xedcd('0x30')](_0xedcd('0x31'))){_0x4c8cc6['limit']=qs[_0xedcd('0x1b')](_0x3e65b3[_0xedcd('0x29')][_0xedcd('0x1b')]);_0x4c8cc6[_0xedcd('0x1d')]=qs[_0xedcd('0x1d')](_0x3e65b3['query'][_0xedcd('0x1d')]);}_0x4c8cc6[_0xedcd('0x32')]=qs['sort'](_0x3e65b3[_0xedcd('0x29')]['sort']);_0x4c8cc6[_0xedcd('0x33')]=qs['filters'](_[_0xedcd('0x34')](_0x3e65b3['query'],_0x32f096[_0xedcd('0x35')]),_0x5877bb);if(_0x3e65b3[_0xedcd('0x29')][_0xedcd('0x36')]){_0x4c8cc6[_0xedcd('0x33')]=_[_0xedcd('0x37')](_0x4c8cc6[_0xedcd('0x33')],{'$or':_['map'](_0x5877bb,function(_0x2c7fb7){if(_0x2c7fb7['type']!==_0xedcd('0x38')){var _0x82aaa1={};_0x82aaa1[_0x2c7fb7['name']]={'$like':'%'+_0x3e65b3[_0xedcd('0x29')][_0xedcd('0x36')]+'%'};return _0x82aaa1;}})});}_0x4c8cc6=_['merge']({},_0x4c8cc6,_0x3e65b3['options']);var _0x516766={'where':_0x4c8cc6['where']};return db['ZohoConfiguration']['count'](_0x516766)[_0xedcd('0x22')](function(_0x2fb7f1){_0x2e8ac0[_0xedcd('0x1c')]=_0x2fb7f1;if(_0x3e65b3[_0xedcd('0x29')][_0xedcd('0x39')]){_0x4c8cc6['include']=[{'all':!![]}];}return db[_0xedcd('0x3a')][_0xedcd('0x3b')](_0x4c8cc6);})[_0xedcd('0x22')](function(_0x20c771){_0x2e8ac0[_0xedcd('0x3c')]=_0x20c771;return _0x2e8ac0;})[_0xedcd('0x22')](respondWithFilteredResult(_0x1e6fd8,_0x4c8cc6))['catch'](handleError(_0x1e6fd8,null));};exports[_0xedcd('0x3d')]=function(_0x42dcd7,_0x38df62){var _0x2b7dca={'raw':![],'where':{'id':_0x42dcd7[_0xedcd('0x3e')]['id']}},_0x228133={};_0x228133['model']=_[_0xedcd('0x2a')](db[_0xedcd('0x3a')][_0xedcd('0x3f')]);_0x228133['query']=_[_0xedcd('0x2a')](_0x42dcd7[_0xedcd('0x29')]);_0x228133[_0xedcd('0x35')]=_['intersection'](_0x228133['model'],_0x228133[_0xedcd('0x29')]);_0x2b7dca[_0xedcd('0x2d')]=_[_0xedcd('0x2b')](_0x228133[_0xedcd('0x2f')],qs[_0xedcd('0x2c')](_0x42dcd7[_0xedcd('0x29')]['fields']));_0x2b7dca[_0xedcd('0x2d')]=_0x2b7dca[_0xedcd('0x2d')][_0xedcd('0x2e')]?_0x2b7dca[_0xedcd('0x2d')]:_0x228133['model'];if(_0x42dcd7[_0xedcd('0x29')][_0xedcd('0x39')]){_0x2b7dca[_0xedcd('0x40')]=[{'all':!![]}];}_0x2b7dca=_[_0xedcd('0x37')]({},_0x2b7dca,_0x42dcd7[_0xedcd('0x41')]);return db[_0xedcd('0x3a')][_0xedcd('0x42')](_0x2b7dca)[_0xedcd('0x22')](handleEntityNotFound(_0x38df62,null))[_0xedcd('0x22')](respondWithResult(_0x38df62,null))[_0xedcd('0x43')](handleError(_0x38df62,null));};exports[_0xedcd('0x44')]=function(_0x195c28,_0x4735c5){return db['ZohoConfiguration'][_0xedcd('0x44')](_0x195c28['body'],{})[_0xedcd('0x22')](respondWithResult(_0x4735c5,0xc9))[_0xedcd('0x43')](handleError(_0x4735c5,null));};exports[_0xedcd('0x21')]=function(_0x17aa42,_0x450220){if(_0x17aa42[_0xedcd('0x45')]['id']){delete _0x17aa42['body']['id'];}return db[_0xedcd('0x3a')][_0xedcd('0x42')]({'where':{'id':_0x17aa42[_0xedcd('0x3e')]['id']}})['then'](handleEntityNotFound(_0x450220,null))['then'](saveUpdates(_0x17aa42[_0xedcd('0x45')],null))[_0xedcd('0x22')](respondWithResult(_0x450220,null))[_0xedcd('0x43')](handleError(_0x450220,null));};exports[_0xedcd('0x23')]=function(_0x303ba2,_0xb3cf84){return db[_0xedcd('0x3a')][_0xedcd('0x42')]({'where':{'id':_0x303ba2[_0xedcd('0x3e')]['id']}})['then'](handleEntityNotFound(_0xb3cf84,null))[_0xedcd('0x22')](removeEntity(_0xb3cf84,null))[_0xedcd('0x43')](handleError(_0xb3cf84,null));};exports[_0xedcd('0x46')]=function(_0x2e7d31,_0x4aa21f,_0x565633){var _0xc85a1={};var _0x4dee3a={};var _0x3d0ce2;var _0x49bfd0;return db[_0xedcd('0x3a')][_0xedcd('0x47')]({'where':{'id':_0x2e7d31[_0xedcd('0x3e')]['id']}})[_0xedcd('0x22')](handleEntityNotFound(_0x4aa21f,null))['then'](function(_0x302715){if(_0x302715){_0x3d0ce2=_0x302715;_0x4dee3a[_0xedcd('0x2f')]=_[_0xedcd('0x2a')](db[_0xedcd('0x48')][_0xedcd('0x3f')]);_0x4dee3a[_0xedcd('0x29')]=_[_0xedcd('0x2a')](_0x2e7d31[_0xedcd('0x29')]);_0x4dee3a[_0xedcd('0x35')]=_[_0xedcd('0x2b')](_0x4dee3a[_0xedcd('0x2f')],_0x4dee3a[_0xedcd('0x29')]);_0xc85a1['attributes']=_[_0xedcd('0x2b')](_0x4dee3a[_0xedcd('0x2f')],qs[_0xedcd('0x2c')](_0x2e7d31[_0xedcd('0x29')]['fields']));_0xc85a1[_0xedcd('0x2d')]=_0xc85a1[_0xedcd('0x2d')][_0xedcd('0x2e')]?_0xc85a1[_0xedcd('0x2d')]:_0x4dee3a[_0xedcd('0x2f')];_0xc85a1[_0xedcd('0x32')]=qs[_0xedcd('0x49')](_0x2e7d31[_0xedcd('0x29')][_0xedcd('0x49')]);_0xc85a1['where']=qs[_0xedcd('0x35')](_[_0xedcd('0x34')](_0x2e7d31['query'],_0x4dee3a[_0xedcd('0x35')]));if(_0x2e7d31[_0xedcd('0x29')][_0xedcd('0x36')]){_0xc85a1[_0xedcd('0x33')]=_[_0xedcd('0x37')](_0xc85a1['where'],{'$or':_[_0xedcd('0x4a')](_0xc85a1[_0xedcd('0x2d')],function(_0x57406f){var _0x3adcfe={};_0x3adcfe[_0x57406f]={'$like':'%'+_0x2e7d31[_0xedcd('0x29')][_0xedcd('0x36')]+'%'};return _0x3adcfe;})});}_0xc85a1=_[_0xedcd('0x37')]({},_0xc85a1,_0x2e7d31[_0xedcd('0x41')]);return _0x3d0ce2[_0xedcd('0x46')](_0xc85a1);}})[_0xedcd('0x22')](function(_0x5ac808){if(_0x5ac808){_0x49bfd0=_0x5ac808['length'];if(!_0x2e7d31[_0xedcd('0x29')]['hasOwnProperty'](_0xedcd('0x31'))){_0xc85a1[_0xedcd('0x1b')]=qs['limit'](_0x2e7d31[_0xedcd('0x29')][_0xedcd('0x1b')]);_0xc85a1[_0xedcd('0x1d')]=qs[_0xedcd('0x1d')](_0x2e7d31[_0xedcd('0x29')]['offset']);}return _0x3d0ce2[_0xedcd('0x46')](_0xc85a1);}})[_0xedcd('0x22')](function(_0x56f2f0){if(_0x56f2f0){return _0x56f2f0?{'count':_0x49bfd0,'rows':_0x56f2f0}:null;}})['then'](respondWithResult(_0x4aa21f,null))[_0xedcd('0x43')](handleError(_0x4aa21f,null));};exports[_0xedcd('0x4b')]=function(_0xf2d996,_0x535679,_0xbbd405){var _0x598401={};var _0x1bf301={};var _0x1edb8e;var _0x79f6d1;return db[_0xedcd('0x3a')][_0xedcd('0x47')]({'where':{'id':_0xf2d996['params']['id']}})['then'](handleEntityNotFound(_0x535679,null))[_0xedcd('0x22')](function(_0x4f7add){if(_0x4f7add){_0x1edb8e=_0x4f7add;_0x1bf301[_0xedcd('0x2f')]=_[_0xedcd('0x2a')](db[_0xedcd('0x48')][_0xedcd('0x3f')]);_0x1bf301['query']=_[_0xedcd('0x2a')](_0xf2d996[_0xedcd('0x29')]);_0x1bf301[_0xedcd('0x35')]=_[_0xedcd('0x2b')](_0x1bf301['model'],_0x1bf301['query']);_0x598401[_0xedcd('0x2d')]=_[_0xedcd('0x2b')](_0x1bf301[_0xedcd('0x2f')],qs[_0xedcd('0x2c')](_0xf2d996[_0xedcd('0x29')][_0xedcd('0x2c')]));_0x598401[_0xedcd('0x2d')]=_0x598401[_0xedcd('0x2d')][_0xedcd('0x2e')]?_0x598401[_0xedcd('0x2d')]:_0x1bf301[_0xedcd('0x2f')];_0x598401[_0xedcd('0x32')]=qs['sort'](_0xf2d996['query']['sort']);_0x598401['where']=qs['filters'](_[_0xedcd('0x34')](_0xf2d996[_0xedcd('0x29')],_0x1bf301['filters']));if(_0xf2d996[_0xedcd('0x29')][_0xedcd('0x36')]){_0x598401[_0xedcd('0x33')]=_['merge'](_0x598401[_0xedcd('0x33')],{'$or':_['map'](_0x598401[_0xedcd('0x2d')],function(_0x21ede2){var _0x244c8c={};_0x244c8c[_0x21ede2]={'$like':'%'+_0xf2d996[_0xedcd('0x29')][_0xedcd('0x36')]+'%'};return _0x244c8c;})});}_0x598401=_[_0xedcd('0x37')]({},_0x598401,_0xf2d996[_0xedcd('0x41')]);return _0x1edb8e[_0xedcd('0x4b')](_0x598401);}})[_0xedcd('0x22')](function(_0x512e76){if(_0x512e76){_0x79f6d1=_0x512e76[_0xedcd('0x2e')];if(!_0xf2d996['query']['hasOwnProperty'](_0xedcd('0x31'))){_0x598401[_0xedcd('0x1b')]=qs[_0xedcd('0x1b')](_0xf2d996[_0xedcd('0x29')]['limit']);_0x598401[_0xedcd('0x1d')]=qs[_0xedcd('0x1d')](_0xf2d996[_0xedcd('0x29')]['offset']);}return _0x1edb8e[_0xedcd('0x4b')](_0x598401);}})['then'](function(_0x1b21ed){if(_0x1b21ed){return _0x1b21ed?{'count':_0x79f6d1,'rows':_0x1b21ed}:null;}})[_0xedcd('0x22')](respondWithResult(_0x535679,null))[_0xedcd('0x43')](handleError(_0x535679,null));};exports[_0xedcd('0x4c')]=function(_0x121a2c,_0x6e8136,_0x332a2a){var _0x4f0b09={};var _0x1f35c5={};var _0x4bbfe5;var _0x48c543;return db['ZohoConfiguration'][_0xedcd('0x47')]({'where':{'id':_0x121a2c[_0xedcd('0x3e')]['id']}})[_0xedcd('0x22')](handleEntityNotFound(_0x6e8136,null))[_0xedcd('0x22')](function(_0x385f19){if(_0x385f19){_0x4bbfe5=_0x385f19;_0x1f35c5[_0xedcd('0x2f')]=_['keys'](db[_0xedcd('0x48')][_0xedcd('0x3f')]);_0x1f35c5[_0xedcd('0x29')]=_[_0xedcd('0x2a')](_0x121a2c[_0xedcd('0x29')]);_0x1f35c5[_0xedcd('0x35')]=_[_0xedcd('0x2b')](_0x1f35c5[_0xedcd('0x2f')],_0x1f35c5[_0xedcd('0x29')]);_0x4f0b09['attributes']=_['intersection'](_0x1f35c5[_0xedcd('0x2f')],qs[_0xedcd('0x2c')](_0x121a2c[_0xedcd('0x29')]['fields']));_0x4f0b09['attributes']=_0x4f0b09[_0xedcd('0x2d')][_0xedcd('0x2e')]?_0x4f0b09[_0xedcd('0x2d')]:_0x1f35c5[_0xedcd('0x2f')];_0x4f0b09[_0xedcd('0x32')]=qs[_0xedcd('0x49')](_0x121a2c[_0xedcd('0x29')][_0xedcd('0x49')]);_0x4f0b09[_0xedcd('0x33')]=qs[_0xedcd('0x35')](_[_0xedcd('0x34')](_0x121a2c['query'],_0x1f35c5[_0xedcd('0x35')]));if(_0x121a2c[_0xedcd('0x29')][_0xedcd('0x36')]){_0x4f0b09[_0xedcd('0x33')]=_['merge'](_0x4f0b09[_0xedcd('0x33')],{'$or':_['map'](_0x4f0b09[_0xedcd('0x2d')],function(_0xa0f567){var _0x2659b2={};_0x2659b2[_0xa0f567]={'$like':'%'+_0x121a2c[_0xedcd('0x29')][_0xedcd('0x36')]+'%'};return _0x2659b2;})});}_0x4f0b09=_[_0xedcd('0x37')]({},_0x4f0b09,_0x121a2c['options']);return _0x4bbfe5[_0xedcd('0x4c')](_0x4f0b09);}})['then'](function(_0xc2bfec){if(_0xc2bfec){_0x48c543=_0xc2bfec[_0xedcd('0x2e')];if(!_0x121a2c[_0xedcd('0x29')][_0xedcd('0x30')](_0xedcd('0x31'))){_0x4f0b09[_0xedcd('0x1b')]=qs[_0xedcd('0x1b')](_0x121a2c[_0xedcd('0x29')]['limit']);_0x4f0b09[_0xedcd('0x1d')]=qs[_0xedcd('0x1d')](_0x121a2c[_0xedcd('0x29')][_0xedcd('0x1d')]);}return _0x4bbfe5[_0xedcd('0x4c')](_0x4f0b09);}})[_0xedcd('0x22')](function(_0x57fa47){if(_0x57fa47){return _0x57fa47?{'count':_0x48c543,'rows':_0x57fa47}:null;}})[_0xedcd('0x22')](respondWithResult(_0x6e8136,null))['catch'](handleError(_0x6e8136,null));};
\ No newline at end of file
index b147e5e..0f3bae4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5334=['ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports','define'];(function(_0x2ec567,_0x3cea5b){var _0x52a42d=function(_0x5aab1a){while(--_0x5aab1a){_0x2ec567['push'](_0x2ec567['shift']());}};_0x52a42d(++_0x3cea5b);}(_0x5334,0xd4));var _0x4533=function(_0x4dbe4f,_0x4c5b0f){_0x4dbe4f=_0x4dbe4f-0x0;var _0xe66bde=_0x5334[_0x4dbe4f];return _0xe66bde;};'use strict';var _=require(_0x4533('0x0'));var util=require(_0x4533('0x1'));var logger=require(_0x4533('0x2'))(_0x4533('0x3'));var moment=require(_0x4533('0x4'));var BPromise=require(_0x4533('0x5'));var rp=require(_0x4533('0x6'));var fs=require('fs');var path=require(_0x4533('0x7'));var rimraf=require(_0x4533('0x8'));var config=require('../../config/environment');var attributes=require(_0x4533('0x9'));module[_0x4533('0xa')]=function(_0x3d4915,_0x566555){return _0x3d4915[_0x4533('0xb')](_0x4533('0xc'),attributes,{'tableName':_0x4533('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe334=['../../config/environment','exports','define','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x1ab4e8,_0x5b75f4){var _0x23bf8b=function(_0xd0fbfb){while(--_0xd0fbfb){_0x1ab4e8['push'](_0x1ab4e8['shift']());}};_0x23bf8b(++_0x5b75f4);}(_0xe334,0x138));var _0x4e33=function(_0x40096c,_0x425333){_0x40096c=_0x40096c-0x0;var _0x562d63=_0xe334[_0x40096c];return _0x562d63;};'use strict';var _=require(_0x4e33('0x0'));var util=require(_0x4e33('0x1'));var logger=require(_0x4e33('0x2'))(_0x4e33('0x3'));var moment=require('moment');var BPromise=require(_0x4e33('0x4'));var rp=require(_0x4e33('0x5'));var fs=require('fs');var path=require(_0x4e33('0x6'));var rimraf=require('rimraf');var config=require(_0x4e33('0x7'));var attributes=require('./intZohoConfiguration.attributes');module[_0x4e33('0x8')]=function(_0x1ab2f1,_0x484a71){return _0x1ab2f1[_0x4e33('0x9')]('ZohoConfiguration',attributes,{'tableName':_0x4e33('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ef849ca..ba0e59d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9778=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x46a284,_0x26b200){var _0x3e5be4=function(_0xc4a52c){while(--_0xc4a52c){_0x46a284['push'](_0x46a284['shift']());}};_0x3e5be4(++_0x26b200);}(_0x9778,0xe1));var _0x8977=function(_0x2ecb67,_0x8ec62d){_0x2ecb67=_0x2ecb67-0x0;var _0x168079=_0x9778[_0x2ecb67];return _0x168079;};'use strict';var _=require(_0x8977('0x0'));var util=require(_0x8977('0x1'));var moment=require(_0x8977('0x2'));var BPromise=require(_0x8977('0x3'));var rs=require(_0x8977('0x4'));var fs=require('fs');var Redis=require(_0x8977('0x5'));var db=require(_0x8977('0x6'))['db'];var utils=require(_0x8977('0x7'));var logger=require(_0x8977('0x8'))(_0x8977('0x9'));var config=require('../../config/environment');var jayson=require(_0x8977('0xa'));var client=jayson['client'][_0x8977('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3659bd,_0x45f220,_0x1be7da){return new BPromise(function(_0x56052c,_0x39ad5e){return client[_0x8977('0xc')](_0x3659bd,_0x1be7da)[_0x8977('0xd')](function(_0x358bd9){logger[_0x8977('0xe')](_0x8977('0xf'),_0x45f220,_0x8977('0x10'));logger[_0x8977('0x11')](_0x8977('0x12'),_0x45f220,_0x8977('0x10'),JSON[_0x8977('0x13')](_0x358bd9));if(_0x358bd9[_0x8977('0x14')]){if(_0x358bd9['error'][_0x8977('0x15')]===0x1f4){logger['error'](_0x8977('0xf'),_0x45f220,_0x358bd9[_0x8977('0x14')]['message']);return _0x39ad5e(_0x358bd9['error'][_0x8977('0x16')]);}logger[_0x8977('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x45f220,_0x358bd9[_0x8977('0x14')][_0x8977('0x16')]);return _0x56052c(_0x358bd9[_0x8977('0x14')][_0x8977('0x16')]);}else{logger[_0x8977('0xe')](_0x8977('0xf'),_0x45f220,'request\x20sent');_0x56052c(_0x358bd9[_0x8977('0x17')][_0x8977('0x16')]);}})[_0x8977('0x18')](function(_0x19d362){logger[_0x8977('0x14')](_0x8977('0xf'),_0x45f220,_0x19d362);_0x39ad5e(_0x19d362);});});}
\ No newline at end of file
+var _0xf450=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x59dc07,_0x13221a){var _0x14e62b=function(_0x4a79cc){while(--_0x4a79cc){_0x59dc07['push'](_0x59dc07['shift']());}};_0x14e62b(++_0x13221a);}(_0xf450,0x1ab));var _0x0f45=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf450[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x0f45('0x0'));var util=require(_0x0f45('0x1'));var moment=require(_0x0f45('0x2'));var BPromise=require(_0x0f45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f45('0x4'));var db=require(_0x0f45('0x5'))['db'];var utils=require(_0x0f45('0x6'));var logger=require(_0x0f45('0x7'))(_0x0f45('0x8'));var config=require(_0x0f45('0x9'));var jayson=require(_0x0f45('0xa'));var client=jayson[_0x0f45('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3046e6,_0x3101ae,_0x5026cd){return new BPromise(function(_0x56e736,_0x4730bb){return client[_0x0f45('0xc')](_0x3046e6,_0x5026cd)[_0x0f45('0xd')](function(_0x180400){logger[_0x0f45('0xe')](_0x0f45('0xf'),_0x3101ae,_0x0f45('0x10'));logger[_0x0f45('0x11')](_0x0f45('0x12'),_0x3101ae,'request\x20sent',JSON['stringify'](_0x180400));if(_0x180400['error']){if(_0x180400['error'][_0x0f45('0x13')]===0x1f4){logger[_0x0f45('0x14')](_0x0f45('0xf'),_0x3101ae,_0x180400[_0x0f45('0x14')][_0x0f45('0x15')]);return _0x4730bb(_0x180400['error'][_0x0f45('0x15')]);}logger['error'](_0x0f45('0xf'),_0x3101ae,_0x180400['error']['message']);return _0x56e736(_0x180400['error'][_0x0f45('0x15')]);}else{logger['info'](_0x0f45('0xf'),_0x3101ae,_0x0f45('0x10'));_0x56e736(_0x180400[_0x0f45('0x16')][_0x0f45('0x15')]);}})[_0x0f45('0x17')](function(_0xbf83b4){logger[_0x0f45('0x14')](_0x0f45('0xf'),_0x3101ae,_0xbf83b4);_0x4730bb(_0xbf83b4);});});}
\ No newline at end of file
index c56138b..27881aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa58d=['connect-timeout','express','Router','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post','create','put','destroy','multer','util','path'];(function(_0x47f652,_0x3b017f){var _0x11dd47=function(_0x104882){while(--_0x104882){_0x47f652['push'](_0x47f652['shift']());}};_0x11dd47(++_0x3b017f);}(_0xa58d,0xcd));var _0xda58=function(_0x53ebc2,_0x59dfdd){_0x53ebc2=_0x53ebc2-0x0;var _0x29a4f4=_0xa58d[_0x53ebc2];return _0x29a4f4;};'use strict';var multer=require(_0xda58('0x0'));var util=require(_0xda58('0x1'));var path=require(_0xda58('0x2'));var timeout=require(_0xda58('0x3'));var express=require(_0xda58('0x4'));var router=express[_0xda58('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xda58('0x6'));var controller=require(_0xda58('0x7'));router[_0xda58('0x8')]('/',auth[_0xda58('0x9')](),controller['index']);router[_0xda58('0x8')](_0xda58('0xa'),auth['isAuthenticated'](),controller[_0xda58('0xb')]);router[_0xda58('0xc')]('/',auth[_0xda58('0x9')](),controller[_0xda58('0xd')]);router[_0xda58('0xe')](_0xda58('0xa'),auth[_0xda58('0x9')](),controller['update']);router['delete']('/:id',auth[_0xda58('0x9')](),controller[_0xda58('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xce59=['./intZohoField.controller','isAuthenticated','index','get','/:id','post','create','put','update','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x12019a,_0x407485){var _0x49520a=function(_0x150fb6){while(--_0x150fb6){_0x12019a['push'](_0x12019a['shift']());}};_0x49520a(++_0x407485);}(_0xce59,0x1d4));var _0x9ce5=function(_0x594c6d,_0x4d984f){_0x594c6d=_0x594c6d-0x0;var _0x522757=_0xce59[_0x594c6d];return _0x522757;};'use strict';var multer=require(_0x9ce5('0x0'));var util=require(_0x9ce5('0x1'));var path=require(_0x9ce5('0x2'));var timeout=require('connect-timeout');var express=require(_0x9ce5('0x3'));var router=express[_0x9ce5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9ce5('0x5'));var interaction=require(_0x9ce5('0x6'));var config=require(_0x9ce5('0x7'));var controller=require(_0x9ce5('0x8'));router['get']('/',auth[_0x9ce5('0x9')](),controller[_0x9ce5('0xa')]);router[_0x9ce5('0xb')](_0x9ce5('0xc'),auth[_0x9ce5('0x9')](),controller['show']);router[_0x9ce5('0xd')]('/',auth['isAuthenticated'](),controller[_0x9ce5('0xe')]);router[_0x9ce5('0xf')]('/:id',auth[_0x9ce5('0x9')](),controller[_0x9ce5('0x10')]);router['delete'](_0x9ce5('0xc'),auth[_0x9ce5('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 8a4a3d6..abdca6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62cf=['customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist','STRING','variable'];(function(_0xd2c5d3,_0x57ff54){var _0x4c4d1e=function(_0x33fc45){while(--_0x33fc45){_0xd2c5d3['push'](_0xd2c5d3['shift']());}};_0x4c4d1e(++_0x57ff54);}(_0x62cf,0x12e));var _0xf62c=function(_0x23d736,_0x438b1f){_0x23d736=_0x23d736-0x0;var _0x22952e=_0x62cf[_0x23d736];return _0x22952e;};'use strict';var Sequelize=require(_0xf62c('0x0'));module[_0xf62c('0x1')]={'type':{'type':Sequelize[_0xf62c('0x2')](_0xf62c('0x3'),'variable','customVariable',_0xf62c('0x4'),_0xf62c('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf62c('0x6')]},'keyType':{'type':Sequelize[_0xf62c('0x2')](_0xf62c('0x3'),_0xf62c('0x7'),_0xf62c('0x8'))},'keyContent':{'type':Sequelize[_0xf62c('0x6')]},'idField':{'type':Sequelize[_0xf62c('0x6')]},'nameField':{'type':Sequelize[_0xf62c('0x6')]},'customField':{'type':Sequelize[_0xf62c('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2612=['customVariable','keyValue','picklist','STRING','sequelize','exports','string','variable'];(function(_0x306059,_0x4b5a8b){var _0x554a87=function(_0x2188d3){while(--_0x2188d3){_0x306059['push'](_0x306059['shift']());}};_0x554a87(++_0x4b5a8b);}(_0x2612,0x114));var _0x2261=function(_0x4c1fb6,_0x16eaff){_0x4c1fb6=_0x4c1fb6-0x0;var _0x303cba=_0x2612[_0x4c1fb6];return _0x303cba;};'use strict';var Sequelize=require(_0x2261('0x0'));module[_0x2261('0x1')]={'type':{'type':Sequelize['ENUM'](_0x2261('0x2'),_0x2261('0x3'),_0x2261('0x4'),_0x2261('0x5'),_0x2261('0x6')),'defaultValue':_0x2261('0x2')},'content':{'type':Sequelize[_0x2261('0x7')]},'key':{'type':Sequelize[_0x2261('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x2261('0x2'),_0x2261('0x3'),_0x2261('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2261('0x7')]},'nameField':{'type':Sequelize[_0x2261('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2261('0x7')]}};
\ No newline at end of file
index 0cc9ac8..b316bd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa53d=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','include','catch','create','update','body','find','params','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5d0423,_0x35a0b4){var _0x14b06d=function(_0x21208f){while(--_0x21208f){_0x5d0423['push'](_0x5d0423['shift']());}};_0x14b06d(++_0x35a0b4);}(_0xa53d,0x17b));var _0xda53=function(_0x58c8ea,_0x40392d){_0x58c8ea=_0x58c8ea-0x0;var _0x284d0e=_0xa53d[_0x58c8ea];return _0x284d0e;};'use strict';var emlformat=require(_0xda53('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xda53('0x1'));var rp=require('request-promise');var moment=require(_0xda53('0x2'));var BPromise=require(_0xda53('0x3'));var Mustache=require(_0xda53('0x4'));var util=require('util');var path=require(_0xda53('0x5'));var sox=require(_0xda53('0x6'));var csv=require(_0xda53('0x7'));var ejs=require(_0xda53('0x8'));var fs=require('fs');var fs_extra=require(_0xda53('0x9'));var _=require(_0xda53('0xa'));var squel=require(_0xda53('0xb'));var crypto=require(_0xda53('0xc'));var jsforce=require(_0xda53('0xd'));var deskjs=require(_0xda53('0xe'));var toCsv=require(_0xda53('0x7'));var querystring=require(_0xda53('0xf'));var Papa=require(_0xda53('0x10'));var Redis=require(_0xda53('0x11'));var authService=require(_0xda53('0x12'));var qs=require(_0xda53('0x13'));var as=require(_0xda53('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xda53('0x15'))(_0xda53('0x16'));var utils=require(_0xda53('0x17'));var config=require(_0xda53('0x18'));var licenseUtil=require(_0xda53('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x522551,_0x462a8f){_0x462a8f=_0x462a8f||0xcc;return function(_0x5760e6){if(_0x5760e6){return _0x522551[_0xda53('0x1a')](_0x462a8f);}return _0x522551[_0xda53('0x1b')](_0x462a8f)[_0xda53('0x1c')]();};}function respondWithResult(_0x3c3bc5,_0x3592a7){_0x3592a7=_0x3592a7||0xc8;return function(_0x1ddead){if(_0x1ddead){return _0x3c3bc5['status'](_0x3592a7)[_0xda53('0x1d')](_0x1ddead);}};}function respondWithFilteredResult(_0x3ac791,_0x421b07){return function(_0x17b955){if(_0x17b955){var _0x3aaf1d=typeof _0x421b07[_0xda53('0x1e')]==='undefined'&&typeof _0x421b07[_0xda53('0x1f')]===_0xda53('0x20');var _0x49fd99=_0x17b955[_0xda53('0x21')];var _0x2c2916=_0x3aaf1d?0x0:_0x421b07[_0xda53('0x1e')];var _0x2ca00b=_0x3aaf1d?_0x17b955['count']:_0x421b07[_0xda53('0x1e')]+_0x421b07[_0xda53('0x1f')];var _0x26fbf4;if(_0x2ca00b>=_0x49fd99){_0x2ca00b=_0x49fd99;_0x26fbf4=0xc8;}else{_0x26fbf4=0xce;}_0x3ac791[_0xda53('0x1b')](_0x26fbf4);return _0x3ac791[_0xda53('0x22')](_0xda53('0x23'),_0x2c2916+'-'+_0x2ca00b+'/'+_0x49fd99)[_0xda53('0x1d')](_0x17b955);}return null;};}function patchUpdates(_0x373724){return function(_0x1b2f66){try{jsonpatch[_0xda53('0x24')](_0x1b2f66,_0x373724,!![]);}catch(_0x37511f){return BPromise[_0xda53('0x25')](_0x37511f);}return _0x1b2f66[_0xda53('0x26')]();};}function saveUpdates(_0x339b67,_0x281ef8){return function(_0x2e3d11){if(_0x2e3d11){return _0x2e3d11['update'](_0x339b67)[_0xda53('0x27')](function(_0x4134fa){return _0x4134fa;});}return null;};}function removeEntity(_0x18a36f,_0x447f90){return function(_0x5ca7ea){if(_0x5ca7ea){return _0x5ca7ea[_0xda53('0x28')]()[_0xda53('0x27')](function(){_0x18a36f[_0xda53('0x1b')](0xcc)[_0xda53('0x1c')]();});}};}function handleEntityNotFound(_0xfd5936,_0x53d5bc){return function(_0x7b1184){if(!_0x7b1184){_0xfd5936[_0xda53('0x1a')](0x194);}return _0x7b1184;};}function handleError(_0x258fab,_0x47bee1){_0x47bee1=_0x47bee1||0x1f4;return function(_0x5a2a06){logger[_0xda53('0x29')](_0x5a2a06[_0xda53('0x2a')]);if(_0x5a2a06[_0xda53('0x2b')]){delete _0x5a2a06[_0xda53('0x2b')];}_0x258fab['status'](_0x47bee1)[_0xda53('0x2c')](_0x5a2a06);};}exports[_0xda53('0x2d')]=function(_0x2f939c,_0x2bbf40){var _0x63d42d={},_0x5e2440={},_0x690564={'count':0x0,'rows':[]};var _0x1c268d=_[_0xda53('0x2e')](db[_0xda53('0x2f')][_0xda53('0x30')],function(_0x216859){return{'name':_0x216859[_0xda53('0x31')],'type':_0x216859['type']['key']};});_0x5e2440[_0xda53('0x32')]=_[_0xda53('0x2e')](_0x1c268d,_0xda53('0x2b'));_0x5e2440['query']=_[_0xda53('0x33')](_0x2f939c[_0xda53('0x34')]);_0x5e2440['filters']=_[_0xda53('0x35')](_0x5e2440[_0xda53('0x32')],_0x5e2440[_0xda53('0x34')]);_0x63d42d['attributes']=_['intersection'](_0x5e2440[_0xda53('0x32')],qs[_0xda53('0x36')](_0x2f939c[_0xda53('0x34')]['fields']));_0x63d42d[_0xda53('0x37')]=_0x63d42d[_0xda53('0x37')][_0xda53('0x38')]?_0x63d42d[_0xda53('0x37')]:_0x5e2440[_0xda53('0x32')];if(!_0x2f939c[_0xda53('0x34')][_0xda53('0x39')](_0xda53('0x3a'))){_0x63d42d[_0xda53('0x1f')]=qs['limit'](_0x2f939c[_0xda53('0x34')][_0xda53('0x1f')]);_0x63d42d[_0xda53('0x1e')]=qs[_0xda53('0x1e')](_0x2f939c[_0xda53('0x34')][_0xda53('0x1e')]);}_0x63d42d[_0xda53('0x3b')]=qs[_0xda53('0x3c')](_0x2f939c[_0xda53('0x34')][_0xda53('0x3c')]);_0x63d42d['where']=qs[_0xda53('0x3d')](_['pick'](_0x2f939c['query'],_0x5e2440['filters']),_0x1c268d);if(_0x2f939c[_0xda53('0x34')]['filter']){_0x63d42d[_0xda53('0x3e')]=_[_0xda53('0x3f')](_0x63d42d[_0xda53('0x3e')],{'$or':_[_0xda53('0x2e')](_0x1c268d,function(_0x24098b){if(_0x24098b[_0xda53('0x40')]!==_0xda53('0x41')){var _0x562cea={};_0x562cea[_0x24098b[_0xda53('0x2b')]]={'$like':'%'+_0x2f939c[_0xda53('0x34')]['filter']+'%'};return _0x562cea;}})});}_0x63d42d=_[_0xda53('0x3f')]({},_0x63d42d,_0x2f939c[_0xda53('0x42')]);var _0x38f588={'where':_0x63d42d['where']};return db[_0xda53('0x2f')][_0xda53('0x21')](_0x38f588)[_0xda53('0x27')](function(_0x368a63){_0x690564[_0xda53('0x21')]=_0x368a63;if(_0x2f939c['query'][_0xda53('0x43')]){_0x63d42d['include']=[{'all':!![]}];}return db[_0xda53('0x2f')][_0xda53('0x44')](_0x63d42d);})[_0xda53('0x27')](function(_0x5ef53f){_0x690564[_0xda53('0x45')]=_0x5ef53f;return _0x690564;})[_0xda53('0x27')](respondWithFilteredResult(_0x2bbf40,_0x63d42d))['catch'](handleError(_0x2bbf40,null));};exports[_0xda53('0x46')]=function(_0x26109c,_0x159874){var _0x36aead={'raw':!![],'where':{'id':_0x26109c['params']['id']}},_0x1bcda5={};_0x1bcda5['model']=_[_0xda53('0x33')](db['ZohoField']['rawAttributes']);_0x1bcda5[_0xda53('0x34')]=_[_0xda53('0x33')](_0x26109c[_0xda53('0x34')]);_0x1bcda5[_0xda53('0x3d')]=_[_0xda53('0x35')](_0x1bcda5[_0xda53('0x32')],_0x1bcda5[_0xda53('0x34')]);_0x36aead[_0xda53('0x37')]=_[_0xda53('0x35')](_0x1bcda5['model'],qs['fields'](_0x26109c['query'][_0xda53('0x36')]));_0x36aead[_0xda53('0x37')]=_0x36aead['attributes'][_0xda53('0x38')]?_0x36aead[_0xda53('0x37')]:_0x1bcda5[_0xda53('0x32')];if(_0x26109c[_0xda53('0x34')][_0xda53('0x43')]){_0x36aead[_0xda53('0x47')]=[{'all':!![]}];}_0x36aead=_[_0xda53('0x3f')]({},_0x36aead,_0x26109c[_0xda53('0x42')]);return db[_0xda53('0x2f')]['find'](_0x36aead)[_0xda53('0x27')](handleEntityNotFound(_0x159874,null))[_0xda53('0x27')](respondWithResult(_0x159874,null))[_0xda53('0x48')](handleError(_0x159874,null));};exports[_0xda53('0x49')]=function(_0x4f3a0e,_0x44c612){return db[_0xda53('0x2f')][_0xda53('0x49')](_0x4f3a0e['body'],{})[_0xda53('0x27')](respondWithResult(_0x44c612,0xc9))[_0xda53('0x48')](handleError(_0x44c612,null));};exports[_0xda53('0x4a')]=function(_0x2f4e8f,_0x27a776){if(_0x2f4e8f[_0xda53('0x4b')]['id']){delete _0x2f4e8f['body']['id'];}return db['ZohoField'][_0xda53('0x4c')]({'where':{'id':_0x2f4e8f[_0xda53('0x4d')]['id']}})[_0xda53('0x27')](handleEntityNotFound(_0x27a776,null))[_0xda53('0x27')](saveUpdates(_0x2f4e8f['body'],null))[_0xda53('0x27')](respondWithResult(_0x27a776,null))[_0xda53('0x48')](handleError(_0x27a776,null));};exports['destroy']=function(_0x2bf376,_0x586053){return db['ZohoField'][_0xda53('0x4c')]({'where':{'id':_0x2bf376[_0xda53('0x4d')]['id']}})[_0xda53('0x27')](handleEntityNotFound(_0x586053,null))[_0xda53('0x27')](removeEntity(_0x586053,null))[_0xda53('0x48')](handleError(_0x586053,null));};
\ No newline at end of file
+var _0x9025=['map','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','ZohoField','count','includeAll','include','findAll','rows','catch','show','intersection','find','create','body','params','destroy','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','fieldName','type','model'];(function(_0x5ca48a,_0x5a02fd){var _0x10348b=function(_0x167999){while(--_0x167999){_0x5ca48a['push'](_0x5ca48a['shift']());}};_0x10348b(++_0x5a02fd);}(_0x9025,0x17c));var _0x5902=function(_0x53ef23,_0x25ebc1){_0x53ef23=_0x53ef23-0x0;var _0x4f1dd5=_0x9025[_0x53ef23];return _0x4f1dd5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5902('0x0'));var rp=require(_0x5902('0x1'));var moment=require(_0x5902('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5902('0x3'));var util=require(_0x5902('0x4'));var path=require(_0x5902('0x5'));var sox=require(_0x5902('0x6'));var csv=require(_0x5902('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5902('0x8'));var jsforce=require(_0x5902('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x5902('0x7'));var querystring=require(_0x5902('0xa'));var Papa=require(_0x5902('0xb'));var Redis=require(_0x5902('0xc'));var authService=require(_0x5902('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x5902('0xe'));var hardwareService=require(_0x5902('0xf'));var logger=require(_0x5902('0x10'))(_0x5902('0x11'));var utils=require(_0x5902('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x24ca7b,_0x52137d){_0x52137d=_0x52137d||0xcc;return function(_0x341bf1){if(_0x341bf1){return _0x24ca7b[_0x5902('0x13')](_0x52137d);}return _0x24ca7b['status'](_0x52137d)[_0x5902('0x14')]();};}function respondWithResult(_0x5b4fcd,_0x4979da){_0x4979da=_0x4979da||0xc8;return function(_0x40da85){if(_0x40da85){return _0x5b4fcd[_0x5902('0x15')](_0x4979da)[_0x5902('0x16')](_0x40da85);}};}function respondWithFilteredResult(_0x78ccf4,_0x5e867d){return function(_0x58cfb9){if(_0x58cfb9){var _0x1a3aee=typeof _0x5e867d[_0x5902('0x17')]===_0x5902('0x18')&&typeof _0x5e867d[_0x5902('0x19')]==='undefined';var _0x48043a=_0x58cfb9['count'];var _0x465bc6=_0x1a3aee?0x0:_0x5e867d[_0x5902('0x17')];var _0x3025d6=_0x1a3aee?_0x58cfb9['count']:_0x5e867d[_0x5902('0x17')]+_0x5e867d[_0x5902('0x19')];var _0x37ba3d;if(_0x3025d6>=_0x48043a){_0x3025d6=_0x48043a;_0x37ba3d=0xc8;}else{_0x37ba3d=0xce;}_0x78ccf4[_0x5902('0x15')](_0x37ba3d);return _0x78ccf4[_0x5902('0x1a')](_0x5902('0x1b'),_0x465bc6+'-'+_0x3025d6+'/'+_0x48043a)[_0x5902('0x16')](_0x58cfb9);}return null;};}function patchUpdates(_0x40f498){return function(_0x596073){try{jsonpatch[_0x5902('0x1c')](_0x596073,_0x40f498,!![]);}catch(_0x3bba88){return BPromise[_0x5902('0x1d')](_0x3bba88);}return _0x596073[_0x5902('0x1e')]();};}function saveUpdates(_0x4028ef,_0xdfabd7){return function(_0x37465a){if(_0x37465a){return _0x37465a[_0x5902('0x1f')](_0x4028ef)[_0x5902('0x20')](function(_0x2a6919){return _0x2a6919;});}return null;};}function removeEntity(_0x4ce6ee,_0x219200){return function(_0x3fd220){if(_0x3fd220){return _0x3fd220['destroy']()[_0x5902('0x20')](function(){_0x4ce6ee[_0x5902('0x15')](0xcc)[_0x5902('0x14')]();});}};}function handleEntityNotFound(_0x3506a,_0x5b403d){return function(_0x347fab){if(!_0x347fab){_0x3506a['sendStatus'](0x194);}return _0x347fab;};}function handleError(_0x472bf1,_0x45a08e){_0x45a08e=_0x45a08e||0x1f4;return function(_0x5c0a3d){logger[_0x5902('0x21')](_0x5c0a3d['stack']);if(_0x5c0a3d['name']){delete _0x5c0a3d[_0x5902('0x22')];}_0x472bf1[_0x5902('0x15')](_0x45a08e)[_0x5902('0x23')](_0x5c0a3d);};}exports[_0x5902('0x24')]=function(_0x26c9f8,_0xff4cbd){var _0x497370={},_0x137987={},_0x1f7915={'count':0x0,'rows':[]};var _0x41613c=_['map'](db['ZohoField']['rawAttributes'],function(_0x132b22){return{'name':_0x132b22[_0x5902('0x25')],'type':_0x132b22[_0x5902('0x26')]['key']};});_0x137987[_0x5902('0x27')]=_[_0x5902('0x28')](_0x41613c,_0x5902('0x22'));_0x137987['query']=_[_0x5902('0x29')](_0x26c9f8[_0x5902('0x2a')]);_0x137987[_0x5902('0x2b')]=_['intersection'](_0x137987[_0x5902('0x27')],_0x137987['query']);_0x497370['attributes']=_['intersection'](_0x137987['model'],qs['fields'](_0x26c9f8['query'][_0x5902('0x2c')]));_0x497370['attributes']=_0x497370[_0x5902('0x2d')][_0x5902('0x2e')]?_0x497370[_0x5902('0x2d')]:_0x137987[_0x5902('0x27')];if(!_0x26c9f8[_0x5902('0x2a')][_0x5902('0x2f')](_0x5902('0x30'))){_0x497370[_0x5902('0x19')]=qs[_0x5902('0x19')](_0x26c9f8['query'][_0x5902('0x19')]);_0x497370[_0x5902('0x17')]=qs[_0x5902('0x17')](_0x26c9f8['query']['offset']);}_0x497370[_0x5902('0x31')]=qs[_0x5902('0x32')](_0x26c9f8['query'][_0x5902('0x32')]);_0x497370[_0x5902('0x33')]=qs[_0x5902('0x2b')](_[_0x5902('0x34')](_0x26c9f8['query'],_0x137987[_0x5902('0x2b')]),_0x41613c);if(_0x26c9f8[_0x5902('0x2a')][_0x5902('0x35')]){_0x497370['where']=_['merge'](_0x497370[_0x5902('0x33')],{'$or':_['map'](_0x41613c,function(_0x3219bb){if(_0x3219bb[_0x5902('0x26')]!==_0x5902('0x36')){var _0x4df884={};_0x4df884[_0x3219bb[_0x5902('0x22')]]={'$like':'%'+_0x26c9f8[_0x5902('0x2a')]['filter']+'%'};return _0x4df884;}})});}_0x497370=_[_0x5902('0x37')]({},_0x497370,_0x26c9f8['options']);var _0x4bfe76={'where':_0x497370[_0x5902('0x33')]};return db[_0x5902('0x38')][_0x5902('0x39')](_0x4bfe76)[_0x5902('0x20')](function(_0x463820){_0x1f7915[_0x5902('0x39')]=_0x463820;if(_0x26c9f8[_0x5902('0x2a')][_0x5902('0x3a')]){_0x497370[_0x5902('0x3b')]=[{'all':!![]}];}return db[_0x5902('0x38')][_0x5902('0x3c')](_0x497370);})['then'](function(_0x3c4361){_0x1f7915[_0x5902('0x3d')]=_0x3c4361;return _0x1f7915;})[_0x5902('0x20')](respondWithFilteredResult(_0xff4cbd,_0x497370))[_0x5902('0x3e')](handleError(_0xff4cbd,null));};exports[_0x5902('0x3f')]=function(_0x5f1347,_0x3a942d){var _0x1e56bd={'raw':!![],'where':{'id':_0x5f1347['params']['id']}},_0x15f14e={};_0x15f14e[_0x5902('0x27')]=_[_0x5902('0x29')](db[_0x5902('0x38')]['rawAttributes']);_0x15f14e['query']=_['keys'](_0x5f1347[_0x5902('0x2a')]);_0x15f14e['filters']=_[_0x5902('0x40')](_0x15f14e[_0x5902('0x27')],_0x15f14e[_0x5902('0x2a')]);_0x1e56bd['attributes']=_[_0x5902('0x40')](_0x15f14e[_0x5902('0x27')],qs[_0x5902('0x2c')](_0x5f1347[_0x5902('0x2a')][_0x5902('0x2c')]));_0x1e56bd[_0x5902('0x2d')]=_0x1e56bd[_0x5902('0x2d')][_0x5902('0x2e')]?_0x1e56bd[_0x5902('0x2d')]:_0x15f14e[_0x5902('0x27')];if(_0x5f1347[_0x5902('0x2a')][_0x5902('0x3a')]){_0x1e56bd['include']=[{'all':!![]}];}_0x1e56bd=_['merge']({},_0x1e56bd,_0x5f1347['options']);return db[_0x5902('0x38')][_0x5902('0x41')](_0x1e56bd)['then'](handleEntityNotFound(_0x3a942d,null))[_0x5902('0x20')](respondWithResult(_0x3a942d,null))[_0x5902('0x3e')](handleError(_0x3a942d,null));};exports['create']=function(_0x609cc,_0x4ef8fa){return db[_0x5902('0x38')][_0x5902('0x42')](_0x609cc[_0x5902('0x43')],{})[_0x5902('0x20')](respondWithResult(_0x4ef8fa,0xc9))[_0x5902('0x3e')](handleError(_0x4ef8fa,null));};exports[_0x5902('0x1f')]=function(_0x96d719,_0x155009){if(_0x96d719[_0x5902('0x43')]['id']){delete _0x96d719[_0x5902('0x43')]['id'];}return db[_0x5902('0x38')][_0x5902('0x41')]({'where':{'id':_0x96d719[_0x5902('0x44')]['id']}})[_0x5902('0x20')](handleEntityNotFound(_0x155009,null))[_0x5902('0x20')](saveUpdates(_0x96d719[_0x5902('0x43')],null))[_0x5902('0x20')](respondWithResult(_0x155009,null))['catch'](handleError(_0x155009,null));};exports[_0x5902('0x45')]=function(_0x5a3267,_0x295561){return db[_0x5902('0x38')][_0x5902('0x41')]({'where':{'id':_0x5a3267['params']['id']}})['then'](handleEntityNotFound(_0x295561,null))['then'](removeEntity(_0x295561,null))['catch'](handleError(_0x295561,null));};
\ No newline at end of file
index 247632a..2b3bcd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash'];(function(_0x57b8ac,_0x4692ff){var _0x39d6f6=function(_0x1befd5){while(--_0x1befd5){_0x57b8ac['push'](_0x57b8ac['shift']());}};_0x39d6f6(++_0x4692ff);}(_0x4975,0x86));var _0x5497=function(_0x265813,_0x21aef5){_0x265813=_0x265813-0x0;var _0x7912cb=_0x4975[_0x265813];return _0x7912cb;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['idField',_0x5497('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xadb5=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xadb5,0xad));var _0x5adb=function(_0x5a34b5,_0x50a057){_0x5a34b5=_0x5a34b5-0x0;var _0x161468=_0xadb5[_0x5a34b5];return _0x161468;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./intZohoField.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[{'name':_0x5adb('0xb'),'fields':[_0x5adb('0xc'),_0x5adb('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 9c86f89..ca81061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf011=['request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','ZohoField,\x20%s,\x20%s'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0xf011,0x166));var _0x1f01=function(_0x102030,_0x4ac303){_0x102030=_0x102030-0x0;var _0x41188b=_0xf011[_0x102030];return _0x41188b;};'use strict';var _=require(_0x1f01('0x0'));var util=require(_0x1f01('0x1'));var moment=require(_0x1f01('0x2'));var BPromise=require(_0x1f01('0x3'));var rs=require(_0x1f01('0x4'));var fs=require('fs');var Redis=require(_0x1f01('0x5'));var db=require(_0x1f01('0x6'))['db'];var utils=require(_0x1f01('0x7'));var logger=require(_0x1f01('0x8'))(_0x1f01('0x9'));var config=require(_0x1f01('0xa'));var jayson=require(_0x1f01('0xb'));var client=jayson[_0x1f01('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x340356,_0x1f9198,_0x3e13ab){return new BPromise(function(_0x4b5f80,_0x588067){return client[_0x1f01('0xd')](_0x340356,_0x3e13ab)[_0x1f01('0xe')](function(_0x542dad){logger[_0x1f01('0xf')](_0x1f01('0x10'),_0x1f9198,_0x1f01('0x11'));logger[_0x1f01('0x12')](_0x1f01('0x13'),_0x1f9198,'request\x20sent',JSON['stringify'](_0x542dad));if(_0x542dad[_0x1f01('0x14')]){if(_0x542dad[_0x1f01('0x14')][_0x1f01('0x15')]===0x1f4){logger[_0x1f01('0x14')](_0x1f01('0x10'),_0x1f9198,_0x542dad['error'][_0x1f01('0x16')]);return _0x588067(_0x542dad[_0x1f01('0x14')][_0x1f01('0x16')]);}logger['error'](_0x1f01('0x10'),_0x1f9198,_0x542dad[_0x1f01('0x14')][_0x1f01('0x16')]);return _0x4b5f80(_0x542dad[_0x1f01('0x14')][_0x1f01('0x16')]);}else{logger[_0x1f01('0xf')](_0x1f01('0x10'),_0x1f9198,_0x1f01('0x11'));_0x4b5f80(_0x542dad[_0x1f01('0x17')]['message']);}})[_0x1f01('0x18')](function(_0x5c2a90){logger[_0x1f01('0x14')]('ZohoField,\x20%s,\x20%s',_0x1f9198,_0x5c2a90);_0x588067(_0x5c2a90);});});}
\ No newline at end of file
+var _0x7a84=['code','message','ZohoField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error'];(function(_0x196e93,_0x2c1643){var _0x525b38=function(_0x2e206c){while(--_0x2e206c){_0x196e93['push'](_0x196e93['shift']());}};_0x525b38(++_0x2c1643);}(_0x7a84,0xec));var _0x47a8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7a84[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x47a8('0x0'));var util=require(_0x47a8('0x1'));var moment=require(_0x47a8('0x2'));var BPromise=require(_0x47a8('0x3'));var rs=require(_0x47a8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x47a8('0x5'))['db'];var utils=require(_0x47a8('0x6'));var logger=require(_0x47a8('0x7'))(_0x47a8('0x8'));var config=require('../../config/environment');var jayson=require(_0x47a8('0x9'));var client=jayson[_0x47a8('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1be2c2,_0x4f604d,_0x2007a4){return new BPromise(function(_0x12ad74,_0x48c302){return client[_0x47a8('0xb')](_0x1be2c2,_0x2007a4)['then'](function(_0x50dfa2){logger[_0x47a8('0xc')]('ZohoField,\x20%s,\x20%s',_0x4f604d,_0x47a8('0xd'));logger['debug'](_0x47a8('0xe'),_0x4f604d,'request\x20sent',JSON['stringify'](_0x50dfa2));if(_0x50dfa2[_0x47a8('0xf')]){if(_0x50dfa2[_0x47a8('0xf')][_0x47a8('0x10')]===0x1f4){logger[_0x47a8('0xf')]('ZohoField,\x20%s,\x20%s',_0x4f604d,_0x50dfa2[_0x47a8('0xf')][_0x47a8('0x11')]);return _0x48c302(_0x50dfa2[_0x47a8('0xf')][_0x47a8('0x11')]);}logger[_0x47a8('0xf')](_0x47a8('0x12'),_0x4f604d,_0x50dfa2[_0x47a8('0xf')]['message']);return _0x12ad74(_0x50dfa2[_0x47a8('0xf')][_0x47a8('0x11')]);}else{logger['info'](_0x47a8('0x12'),_0x4f604d,_0x47a8('0xd'));_0x12ad74(_0x50dfa2[_0x47a8('0x13')][_0x47a8('0x11')]);}})[_0x47a8('0x14')](function(_0x3d8003){logger['error'](_0x47a8('0x12'),_0x4f604d,_0x3d8003);_0x48c302(_0x3d8003);});});}
\ No newline at end of file
index ba41f26..910ff36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x40d46b,_0x5a76c1){var _0x2716cd=function(_0xde0d39){while(--_0xde0d39){_0x40d46b['push'](_0x40d46b['shift']());}};_0x2716cd(++_0x5a76c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x15fed8,_0x2f722b){var _0x381a80=function(_0x250fbc){while(--_0x250fbc){_0x15fed8['push'](_0x15fed8['shift']());}};_0x381a80(++_0x2f722b);}(_0x70e0,0x17b));var _0x070e=function(_0x2f7b93,_0xa9e304){_0x2f7b93=_0x2f7b93-0x0;var _0x3e0c9a=_0x70e0[_0x2f7b93];return _0x3e0c9a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index f8f07f6..6f1535b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82aa=['unique_name_and_version','INTEGER','state','sequelize','exports','STRING'];(function(_0x5ca684,_0x9b5c91){var _0x331c06=function(_0x587f5a){while(--_0x587f5a){_0x5ca684['push'](_0x5ca684['shift']());}};_0x331c06(++_0x9b5c91);}(_0x82aa,0xff));var _0xa82a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x82aa[_0x2c91e9];return _0x13f0ff;};'use strict';var Sequelize=require(_0xa82a('0x0'));module[_0xa82a('0x1')]={'name':{'type':Sequelize[_0xa82a('0x2')],'allowNull':![],'unique':_0xa82a('0x3')},'version':{'type':Sequelize[_0xa82a('0x2')],'allowNull':![],'unique':_0xa82a('0x3')},'main':{'type':Sequelize[_0xa82a('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xa82a('0x2')]},'path':{'type':Sequelize[_0xa82a('0x2')]},'type':{'type':Sequelize[_0xa82a('0x2')]},'size':{'type':Sequelize[_0xa82a('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xa82a('0x2')]},'logo':{'type':Sequelize[_0xa82a('0x2')]},'state':{'type':Sequelize[_0xa82a('0x2')],'unique':_0xa82a('0x5')},'description':{'type':Sequelize[_0xa82a('0x2')]},'title':{'type':Sequelize[_0xa82a('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
+var _0xaedf=['sequelize','STRING','unique_name_and_version','app.js','INTEGER','state'];(function(_0x189df2,_0x296866){var _0x33518b=function(_0x4a1dae){while(--_0x4a1dae){_0x189df2['push'](_0x189df2['shift']());}};_0x33518b(++_0x296866);}(_0xaedf,0x13e));var _0xfaed=function(_0x21343f,_0x360b84){_0x21343f=_0x21343f-0x0;var _0x191d29=_0xaedf[_0x21343f];return _0x191d29;};'use strict';var Sequelize=require(_0xfaed('0x0'));module['exports']={'name':{'type':Sequelize[_0xfaed('0x1')],'allowNull':![],'unique':_0xfaed('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfaed('0x2')},'main':{'type':Sequelize[_0xfaed('0x1')],'defaultValue':_0xfaed('0x3')},'filename':{'type':Sequelize[_0xfaed('0x1')]},'path':{'type':Sequelize[_0xfaed('0x1')]},'type':{'type':Sequelize[_0xfaed('0x1')]},'size':{'type':Sequelize[_0xfaed('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xfaed('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xfaed('0x1')],'unique':_0xfaed('0x5')},'description':{'type':Sequelize[_0xfaed('0x1')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xfaed('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}};
\ No newline at end of file
index e9bf473..ba8fd5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33af=['merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','length','include','create','body','find','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','Integration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','order','sort','where'];(function(_0x4623e8,_0x209db2){var _0x1bd6d8=function(_0x4d8aea){while(--_0x4d8aea){_0x4623e8['push'](_0x4623e8['shift']());}};_0x1bd6d8(++_0x209db2);}(_0x33af,0xec));var _0xf33a=function(_0x5d92d2,_0x399d73){_0x5d92d2=_0x5d92d2-0x0;var _0x5e6d11=_0x33af[_0x5d92d2];return _0x5e6d11;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf33a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf33a('0x1'));var rp=require(_0xf33a('0x2'));var moment=require(_0xf33a('0x3'));var BPromise=require(_0xf33a('0x4'));var Mustache=require(_0xf33a('0x5'));var util=require(_0xf33a('0x6'));var path=require('path');var sox=require(_0xf33a('0x7'));var csv=require(_0xf33a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf33a('0x9'));var _=require(_0xf33a('0xa'));var squel=require(_0xf33a('0xb'));var crypto=require(_0xf33a('0xc'));var jsforce=require(_0xf33a('0xd'));var deskjs=require(_0xf33a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf33a('0xf'));var Papa=require(_0xf33a('0x10'));var Redis=require(_0xf33a('0x11'));var authService=require(_0xf33a('0x12'));var qs=require(_0xf33a('0x13'));var as=require(_0xf33a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf33a('0x15'));var utils=require(_0xf33a('0x16'));var config=require(_0xf33a('0x17'));var licenseUtil=require(_0xf33a('0x18'));var db=require(_0xf33a('0x19'))['db'];function respondWithStatusCode(_0x5959c9,_0x9f87bc){_0x9f87bc=_0x9f87bc||0xcc;return function(_0x21b80e){if(_0x21b80e){return _0x5959c9['sendStatus'](_0x9f87bc);}return _0x5959c9['status'](_0x9f87bc)[_0xf33a('0x1a')]();};}function respondWithResult(_0x1b3bf0,_0x17043){_0x17043=_0x17043||0xc8;return function(_0x153bda){if(_0x153bda){return _0x1b3bf0[_0xf33a('0x1b')](_0x17043)[_0xf33a('0x1c')](_0x153bda);}};}function respondWithFilteredResult(_0x45e311,_0x1f2b1b){return function(_0x507cb9){if(_0x507cb9){var _0x441f59=typeof _0x1f2b1b['offset']===_0xf33a('0x1d')&&typeof _0x1f2b1b[_0xf33a('0x1e')]==='undefined';var _0x37e76c=_0x507cb9[_0xf33a('0x1f')];var _0x524109=_0x441f59?0x0:_0x1f2b1b[_0xf33a('0x20')];var _0x23d9e2=_0x441f59?_0x507cb9[_0xf33a('0x1f')]:_0x1f2b1b[_0xf33a('0x20')]+_0x1f2b1b['limit'];var _0x11efa0;if(_0x23d9e2>=_0x37e76c){_0x23d9e2=_0x37e76c;_0x11efa0=0xc8;}else{_0x11efa0=0xce;}_0x45e311[_0xf33a('0x1b')](_0x11efa0);return _0x45e311[_0xf33a('0x21')](_0xf33a('0x22'),_0x524109+'-'+_0x23d9e2+'/'+_0x37e76c)[_0xf33a('0x1c')](_0x507cb9);}return null;};}function patchUpdates(_0x6cdf7b){return function(_0x19986f){try{jsonpatch[_0xf33a('0x23')](_0x19986f,_0x6cdf7b,!![]);}catch(_0x19055e){return BPromise[_0xf33a('0x24')](_0x19055e);}return _0x19986f['save']();};}function saveUpdates(_0x3854b4,_0x272e60){return function(_0x1bf9bc){if(_0x1bf9bc){return _0x1bf9bc[_0xf33a('0x25')](_0x3854b4)[_0xf33a('0x26')](function(_0x51d3fd){return _0x51d3fd;});}return null;};}function removeEntity(_0x44654c,_0x5882ba){return function(_0x492986){if(_0x492986){return _0x492986[_0xf33a('0x27')]()[_0xf33a('0x26')](function(){_0x44654c[_0xf33a('0x1b')](0xcc)[_0xf33a('0x1a')]();});}};}function handleEntityNotFound(_0x4b9801,_0x57cb1d){return function(_0x393005){if(!_0x393005){_0x4b9801['sendStatus'](0x194);}return _0x393005;};}function handleError(_0x4af24a,_0x16ef31){_0x16ef31=_0x16ef31||0x1f4;return function(_0x5f0a53){logger['error'](_0x5f0a53[_0xf33a('0x28')]);if(_0x5f0a53['name']){delete _0x5f0a53[_0xf33a('0x29')];}_0x4af24a['status'](_0x16ef31)[_0xf33a('0x2a')](_0x5f0a53);};}exports[_0xf33a('0x2b')]=function(_0x469741,_0x729fca){var _0x4552c9={},_0x3068a9={},_0x1d19ee={'count':0x0,'rows':[]};var _0x1246ff=_[_0xf33a('0x2c')](db[_0xf33a('0x2d')][_0xf33a('0x2e')],function(_0x8f8ddc){return{'name':_0x8f8ddc[_0xf33a('0x2f')],'type':_0x8f8ddc[_0xf33a('0x30')][_0xf33a('0x31')]};});_0x3068a9['model']=_[_0xf33a('0x2c')](_0x1246ff,_0xf33a('0x29'));_0x3068a9[_0xf33a('0x32')]=_[_0xf33a('0x33')](_0x469741['query']);_0x3068a9[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x3068a9[_0xf33a('0x36')],_0x3068a9[_0xf33a('0x32')]);_0x4552c9[_0xf33a('0x37')]=_[_0xf33a('0x35')](_0x3068a9['model'],qs[_0xf33a('0x38')](_0x469741[_0xf33a('0x32')][_0xf33a('0x38')]));_0x4552c9[_0xf33a('0x37')]=_0x4552c9[_0xf33a('0x37')]['length']?_0x4552c9['attributes']:_0x3068a9[_0xf33a('0x36')];if(!_0x469741['query']['hasOwnProperty']('nolimit')){_0x4552c9[_0xf33a('0x1e')]=qs[_0xf33a('0x1e')](_0x469741['query'][_0xf33a('0x1e')]);_0x4552c9['offset']=qs[_0xf33a('0x20')](_0x469741[_0xf33a('0x32')][_0xf33a('0x20')]);}_0x4552c9[_0xf33a('0x39')]=qs[_0xf33a('0x3a')](_0x469741[_0xf33a('0x32')]['sort']);_0x4552c9[_0xf33a('0x3b')]=qs[_0xf33a('0x34')](_['pick'](_0x469741[_0xf33a('0x32')],_0x3068a9[_0xf33a('0x34')]),_0x1246ff);if(_0x469741[_0xf33a('0x32')]['filter']){_0x4552c9[_0xf33a('0x3b')]=_[_0xf33a('0x3c')](_0x4552c9[_0xf33a('0x3b')],{'$or':_[_0xf33a('0x2c')](_0x1246ff,function(_0x3ec562){if(_0x3ec562[_0xf33a('0x30')]!==_0xf33a('0x3d')){var _0x128baf={};_0x128baf[_0x3ec562[_0xf33a('0x29')]]={'$like':'%'+_0x469741['query'][_0xf33a('0x3e')]+'%'};return _0x128baf;}})});}_0x4552c9=_[_0xf33a('0x3c')]({},_0x4552c9,_0x469741['options']);var _0x1e8800={'where':_0x4552c9['where']};return db['Integration'][_0xf33a('0x1f')](_0x1e8800)[_0xf33a('0x26')](function(_0x4dada1){_0x1d19ee[_0xf33a('0x1f')]=_0x4dada1;if(_0x469741[_0xf33a('0x32')][_0xf33a('0x3f')]){_0x4552c9['include']=[{'all':!![]}];}return db[_0xf33a('0x2d')][_0xf33a('0x40')](_0x4552c9);})['then'](function(_0x1e9748){_0x1d19ee[_0xf33a('0x41')]=_0x1e9748;return _0x1d19ee;})[_0xf33a('0x26')](respondWithFilteredResult(_0x729fca,_0x4552c9))[_0xf33a('0x42')](handleError(_0x729fca,null));};exports[_0xf33a('0x43')]=function(_0x5044f9,_0x45ae15){var _0x1722e5={'raw':![],'where':{'id':_0x5044f9[_0xf33a('0x44')]['id']}},_0x2325eb={};_0x2325eb[_0xf33a('0x36')]=_['keys'](db[_0xf33a('0x2d')][_0xf33a('0x2e')]);_0x2325eb[_0xf33a('0x32')]=_['keys'](_0x5044f9[_0xf33a('0x32')]);_0x2325eb[_0xf33a('0x34')]=_[_0xf33a('0x35')](_0x2325eb[_0xf33a('0x36')],_0x2325eb[_0xf33a('0x32')]);_0x1722e5[_0xf33a('0x37')]=_['intersection'](_0x2325eb[_0xf33a('0x36')],qs[_0xf33a('0x38')](_0x5044f9[_0xf33a('0x32')][_0xf33a('0x38')]));_0x1722e5[_0xf33a('0x37')]=_0x1722e5['attributes'][_0xf33a('0x45')]?_0x1722e5[_0xf33a('0x37')]:_0x2325eb[_0xf33a('0x36')];if(_0x5044f9['query'][_0xf33a('0x3f')]){_0x1722e5[_0xf33a('0x46')]=[{'all':!![]}];}_0x1722e5=_['merge']({},_0x1722e5,_0x5044f9['options']);return db[_0xf33a('0x2d')]['find'](_0x1722e5)[_0xf33a('0x26')](handleEntityNotFound(_0x45ae15,null))[_0xf33a('0x26')](respondWithResult(_0x45ae15,null))[_0xf33a('0x42')](handleError(_0x45ae15,null));};exports[_0xf33a('0x47')]=function(_0xecc82f,_0x1a98f9){return db[_0xf33a('0x2d')][_0xf33a('0x47')](_0xecc82f[_0xf33a('0x48')],{})[_0xf33a('0x26')](respondWithResult(_0x1a98f9,0xc9))[_0xf33a('0x42')](handleError(_0x1a98f9,null));};exports[_0xf33a('0x25')]=function(_0x190a2b,_0x6b79da){if(_0x190a2b[_0xf33a('0x48')]['id']){delete _0x190a2b[_0xf33a('0x48')]['id'];}return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x190a2b[_0xf33a('0x44')]['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x6b79da,null))[_0xf33a('0x26')](saveUpdates(_0x190a2b[_0xf33a('0x48')],null))[_0xf33a('0x26')](respondWithResult(_0x6b79da,null))[_0xf33a('0x42')](handleError(_0x6b79da,null));};exports[_0xf33a('0x27')]=function(_0x1b15a1,_0x3bab07){return db[_0xf33a('0x2d')][_0xf33a('0x49')]({'where':{'id':_0x1b15a1['params']['id']}})[_0xf33a('0x26')](handleEntityNotFound(_0x3bab07,null))[_0xf33a('0x26')](removeEntity(_0x3bab07,null))['catch'](handleError(_0x3bab07,null));};
\ No newline at end of file
+var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Integration','includeAll','rows','catch','show'];(function(_0x575a16,_0x18eefa){var _0x298d59=function(_0x48dfa0){while(--_0x48dfa0){_0x575a16['push'](_0x575a16['shift']());}};_0x298d59(++_0x18eefa);}(_0x0295,0x1f0));var _0x5029=function(_0x581dd6,_0x23847f){_0x581dd6=_0x581dd6-0x0;var _0x4faeb3=_0x0295[_0x581dd6];return _0x4faeb3;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['Integration'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['Integration'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));};
\ No newline at end of file
index cd3a16b..7bd801a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb73=['request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','integrations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3ec306,_0x2c86d3){var _0x3616f4=function(_0x3c8d4c){while(--_0x3c8d4c){_0x3ec306['push'](_0x3ec306['shift']());}};_0x3616f4(++_0x2c86d3);}(_0xdb73,0xa3));var _0x3db7=function(_0x27cd35,_0x5eb3b2){_0x27cd35=_0x27cd35-0x0;var _0x39a6a3=_0xdb73[_0x27cd35];return _0x39a6a3;};'use strict';var _=require(_0x3db7('0x0'));var util=require(_0x3db7('0x1'));var logger=require(_0x3db7('0x2'))('api');var moment=require(_0x3db7('0x3'));var BPromise=require(_0x3db7('0x4'));var rp=require(_0x3db7('0x5'));var fs=require('fs');var path=require(_0x3db7('0x6'));var rimraf=require(_0x3db7('0x7'));var config=require(_0x3db7('0x8'));var attributes=require(_0x3db7('0x9'));module[_0x3db7('0xa')]=function(_0x2e1d70,_0x1445b1){return _0x2e1d70['define']('Integration',attributes,{'tableName':_0x3db7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc81b=['lodash','moment','bluebird','request-promise','path','../../config/environment','./integration.attributes','exports','Integration','integrations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc81b,0x19a));var _0xbc81=function(_0x584fc1,_0x2ea272){_0x584fc1=_0x584fc1-0x0;var _0xa4958=_0xc81b[_0x584fc1];return _0xa4958;};'use strict';var _=require(_0xbc81('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xbc81('0x1'));var BPromise=require(_0xbc81('0x2'));var rp=require(_0xbc81('0x3'));var fs=require('fs');var path=require(_0xbc81('0x4'));var rimraf=require('rimraf');var config=require(_0xbc81('0x5'));var attributes=require(_0xbc81('0x6'));module[_0xbc81('0x7')]=function(_0x12e3e8,_0x232827){return _0x12e3e8['define'](_0xbc81('0x8'),attributes,{'tableName':_0xbc81('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index da831b3..12f543e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4975=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x4975,0x86));var _0x5497=function(_0x29b1a4,_0x3f060c){_0x29b1a4=_0x29b1a4-0x0;var _0x137f90=_0x4975[_0x29b1a4];return _0x137f90;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('Integration,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x815b7c,_0xd1e418){var _0x3f9964=function(_0x9f77f){while(--_0x9f77f){_0x815b7c['push'](_0x815b7c['shift']());}};_0x3f9964(++_0xd1e418);}(_0xdb28,0x106));var _0x8db2=function(_0x53c8a6,_0x7ddbee){_0x53c8a6=_0x53c8a6-0x0;var _0x33691a=_0xdb28[_0x53c8a6];return _0x33691a;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index 5575833..a0162ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a85=['../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x117bb5,_0x14169e){var _0x4dfa5b=function(_0x1403bf){while(--_0x1403bf){_0x117bb5['push'](_0x117bb5['shift']());}};_0x4dfa5b(++_0x14169e);}(_0x1a85,0x178));var _0x51a8=function(_0x280221,_0x2d0576){_0x280221=_0x280221-0x0;var _0x11abd3=_0x1a85[_0x280221];return _0x11abd3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x51a8('0x0'));var timeout=require(_0x51a8('0x1'));var express=require(_0x51a8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x51a8('0x3'));var interaction=require(_0x51a8('0x4'));var config=require(_0x51a8('0x5'));var controller=require('./integrationReport.controller');router[_0x51a8('0x6')]('/',auth['isAuthenticated'](),controller[_0x51a8('0x7')]);router['get'](_0x51a8('0x8'),auth[_0x51a8('0x9')](),controller['describe']);router[_0x51a8('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x51a8('0xa')]);router[_0x51a8('0xb')]('/',auth[_0x51a8('0x9')](),controller[_0x51a8('0xc')]);router[_0x51a8('0xd')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0xf')]);router[_0x51a8('0x10')](_0x51a8('0xe'),auth[_0x51a8('0x9')](),controller[_0x51a8('0x11')]);module[_0x51a8('0x12')]=router;
\ No newline at end of file
+var _0xba34=['exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x10677c,_0x57bd1d){var _0x3e6748=function(_0xb4a6e5){while(--_0xb4a6e5){_0x10677c['push'](_0x10677c['shift']());}};_0x3e6748(++_0x57bd1d);}(_0xba34,0x119));var _0x4ba3=function(_0x32f54b,_0x37c05b){_0x32f54b=_0x32f54b-0x0;var _0x517f64=_0xba34[_0x32f54b];return _0x517f64;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/describe',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0xc'),auth['isAuthenticated'](),controller[_0x4ba3('0x11')]);router[_0x4ba3('0x12')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('0x13')]=router;
\ No newline at end of file
index 361a519..2204317 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d9f=['STRING','INTEGER','DATE','BOOLEAN','TEXT','RECEIVED','FAILED','sequelize','exports'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x1d9f,0x7c));var _0xf1d9=function(_0x1761f0,_0x27fe8b){_0x1761f0=_0x1761f0-0x0;var _0x371d9f=_0x1d9f[_0x1761f0];return _0x371d9f;};'use strict';var Sequelize=require(_0xf1d9('0x0'));module[_0xf1d9('0x1')]={'integration':{'type':Sequelize[_0xf1d9('0x2')]},'eventChannel':{'type':Sequelize[_0xf1d9('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xf1d9('0x2')]},'integrationId':{'type':Sequelize[_0xf1d9('0x3')]},'contacts':{'type':Sequelize[_0xf1d9('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf1d9('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xf1d9('0x2')]},'interface':{'type':Sequelize[_0xf1d9('0x2')]},'membername':{'type':Sequelize[_0xf1d9('0x2')]},'agentcalledAt':{'type':Sequelize[_0xf1d9('0x4')]},'agentconnectAt':{'type':Sequelize[_0xf1d9('0x4')]},'holdtime':{'type':Sequelize[_0xf1d9('0x3')]},'agentcomplete':{'type':Sequelize[_0xf1d9('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xf1d9('0x4')]},'talktime':{'type':Sequelize[_0xf1d9('0x3')]},'agentacw':{'type':Sequelize[_0xf1d9('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xf1d9('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xf1d9('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xf1d9('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xf1d9('0x4')]},'lastevent':{'type':Sequelize[_0xf1d9('0x2')]},'channel':{'type':Sequelize[_0xf1d9('0x2')]},'channelstate':{'type':Sequelize[_0xf1d9('0x3')]},'channelstatedesc':{'type':Sequelize[_0xf1d9('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xf1d9('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf1d9('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xf1d9('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf1d9('0x2')]},'destcalleridname':{'type':Sequelize[_0xf1d9('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xf1d9('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xf1d9('0x2')]},'destlanguage':{'type':Sequelize[_0xf1d9('0x2')]},'destaccountcode':{'type':Sequelize[_0xf1d9('0x2')]},'destcontext':{'type':Sequelize[_0xf1d9('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xf1d9('0x2')]},'destuniqueid':{'type':Sequelize[_0xf1d9('0x2')]},'messageId':{'type':Sequelize[_0xf1d9('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xf1d9('0x2')]},'cc':{'type':Sequelize[_0xf1d9('0x2')]},'attachment':{'type':Sequelize[_0xf1d9('0x6')]},'html':{'type':Sequelize[_0xf1d9('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize['ENUM']('SENT','SENDING',_0xf1d9('0x7'),_0xf1d9('0x8'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xf1d9('0x2')]},'projectId':{'type':Sequelize[_0xf1d9('0x3')]}};
\ No newline at end of file
+var _0x86bc=['DATE','TEXT','ENUM','SENT','RECEIVED','FAILED','sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x42b39a,_0x52f5fd){var _0x38b81d=function(_0x44c86c){while(--_0x44c86c){_0x42b39a['push'](_0x42b39a['shift']());}};_0x38b81d(++_0x52f5fd);}(_0x86bc,0x1d4));var _0xc86b=function(_0x3f8259,_0x43e923){_0x3f8259=_0x3f8259-0x0;var _0x4581d9=_0x86bc[_0x3f8259];return _0x4581d9;};'use strict';var Sequelize=require(_0xc86b('0x0'));module[_0xc86b('0x1')]={'integration':{'type':Sequelize[_0xc86b('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0xc86b('0x2')]},'ticketId':{'type':Sequelize[_0xc86b('0x2')]},'integrationId':{'type':Sequelize[_0xc86b('0x3')]},'contacts':{'type':Sequelize[_0xc86b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc86b('0x2')]},'calleridname':{'type':Sequelize[_0xc86b('0x2')]},'queue':{'type':Sequelize[_0xc86b('0x2')]},'interface':{'type':Sequelize[_0xc86b('0x2')]},'membername':{'type':Sequelize[_0xc86b('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xc86b('0x3')]},'agentcomplete':{'type':Sequelize[_0xc86b('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xc86b('0x5')]},'talktime':{'type':Sequelize[_0xc86b('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc86b('0x3')]},'reason':{'type':Sequelize[_0xc86b('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xc86b('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0xc86b('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc86b('0x5')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xc86b('0x2')]},'channelstate':{'type':Sequelize[_0xc86b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xc86b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xc86b('0x2')]},'language':{'type':Sequelize[_0xc86b('0x2')]},'accountcode':{'type':Sequelize[_0xc86b('0x2')]},'context':{'type':Sequelize[_0xc86b('0x2')]},'exten':{'type':Sequelize[_0xc86b('0x2')]},'priority':{'type':Sequelize[_0xc86b('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xc86b('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xc86b('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xc86b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xc86b('0x2')]},'destlanguage':{'type':Sequelize[_0xc86b('0x2')]},'destaccountcode':{'type':Sequelize[_0xc86b('0x2')]},'destcontext':{'type':Sequelize[_0xc86b('0x2')]},'destexten':{'type':Sequelize[_0xc86b('0x2')]},'destpriority':{'type':Sequelize[_0xc86b('0x2')]},'destuniqueid':{'type':Sequelize[_0xc86b('0x2')]},'messageId':{'type':Sequelize[_0xc86b('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xc86b('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xc86b('0x2')]},'attachment':{'type':Sequelize[_0xc86b('0x6')]},'html':{'type':Sequelize[_0xc86b('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xc86b('0x7')](_0xc86b('0x8'),'SENDING',_0xc86b('0x9'),_0xc86b('0xa'))},'url':{'type':Sequelize[_0xc86b('0x2')]},'app':{'type':Sequelize[_0xc86b('0x2')]},'appdata':{'type':Sequelize[_0xc86b('0x2')]},'projectId':{'type':Sequelize[_0xc86b('0x3')]}};
\ No newline at end of file
index d72077c..b9477ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10a=['fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','type','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','save','update','destroy','then','error','stack','name','index','map','IntegrationReport'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xb10a,0x146));var _0xab10=function(_0xb932cc,_0x52d741){_0xb932cc=_0xb932cc-0x0;var _0x238a76=_0xb10a[_0xb932cc];return _0x238a76;};'use strict';var emlformat=require(_0xab10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xab10('0x1'));var jsonpatch=require(_0xab10('0x2'));var rp=require(_0xab10('0x3'));var moment=require(_0xab10('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xab10('0x5'));var path=require(_0xab10('0x6'));var sox=require(_0xab10('0x7'));var csv=require(_0xab10('0x8'));var ejs=require(_0xab10('0x9'));var fs=require('fs');var fs_extra=require(_0xab10('0xa'));var _=require(_0xab10('0xb'));var squel=require(_0xab10('0xc'));var crypto=require(_0xab10('0xd'));var jsforce=require(_0xab10('0xe'));var deskjs=require(_0xab10('0xf'));var toCsv=require(_0xab10('0x8'));var querystring=require(_0xab10('0x10'));var Papa=require(_0xab10('0x11'));var Redis=require('ioredis');var authService=require(_0xab10('0x12'));var qs=require(_0xab10('0x13'));var as=require(_0xab10('0x14'));var hardwareService=require(_0xab10('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xab10('0x16'));var config=require(_0xab10('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xab10('0x18'))['db'];function respondWithStatusCode(_0xf592ef,_0x17f3f1){_0x17f3f1=_0x17f3f1||0xcc;return function(_0x4e07eb){if(_0x4e07eb){return _0xf592ef[_0xab10('0x19')](_0x17f3f1);}return _0xf592ef[_0xab10('0x1a')](_0x17f3f1)[_0xab10('0x1b')]();};}function respondWithResult(_0x563a09,_0x3610e4){_0x3610e4=_0x3610e4||0xc8;return function(_0x22c443){if(_0x22c443){return _0x563a09[_0xab10('0x1a')](_0x3610e4)[_0xab10('0x1c')](_0x22c443);}};}function respondWithFilteredResult(_0x3b9834,_0x4ffdf6){return function(_0x5766d4){if(_0x5766d4){var _0x551daf=typeof _0x4ffdf6['offset']===_0xab10('0x1d')&&typeof _0x4ffdf6[_0xab10('0x1e')]===_0xab10('0x1d');var _0x2308dc=_0x5766d4[_0xab10('0x1f')];var _0x45ad27=_0x551daf?0x0:_0x4ffdf6['offset'];var _0x489850=_0x551daf?_0x5766d4[_0xab10('0x1f')]:_0x4ffdf6[_0xab10('0x20')]+_0x4ffdf6[_0xab10('0x1e')];var _0x35b595;if(_0x489850>=_0x2308dc){_0x489850=_0x2308dc;_0x35b595=0xc8;}else{_0x35b595=0xce;}_0x3b9834['status'](_0x35b595);return _0x3b9834[_0xab10('0x21')]('Content-Range',_0x45ad27+'-'+_0x489850+'/'+_0x2308dc)[_0xab10('0x1c')](_0x5766d4);}return null;};}function patchUpdates(_0x160625){return function(_0x1ba51d){try{jsonpatch['apply'](_0x1ba51d,_0x160625,!![]);}catch(_0x3637e8){return BPromise['reject'](_0x3637e8);}return _0x1ba51d[_0xab10('0x22')]();};}function saveUpdates(_0x29b827,_0xe7bc){return function(_0x4fd3a8){if(_0x4fd3a8){return _0x4fd3a8[_0xab10('0x23')](_0x29b827)['then'](function(_0x1117cf){return _0x1117cf;});}return null;};}function removeEntity(_0x446c5d,_0x28c343){return function(_0x16fe87){if(_0x16fe87){return _0x16fe87[_0xab10('0x24')]()[_0xab10('0x25')](function(){_0x446c5d['status'](0xcc)[_0xab10('0x1b')]();});}};}function handleEntityNotFound(_0x5dfcec,_0x35900){return function(_0x26cdad){if(!_0x26cdad){_0x5dfcec[_0xab10('0x19')](0x194);}return _0x26cdad;};}function handleError(_0x18fefc,_0x23d07a){_0x23d07a=_0x23d07a||0x1f4;return function(_0x2e6d0a){logger[_0xab10('0x26')](_0x2e6d0a[_0xab10('0x27')]);if(_0x2e6d0a[_0xab10('0x28')]){delete _0x2e6d0a[_0xab10('0x28')];}_0x18fefc[_0xab10('0x1a')](_0x23d07a)['send'](_0x2e6d0a);};}exports[_0xab10('0x29')]=function(_0x1e6cf2,_0x482421){var _0x1c13b6={},_0x407eb6={},_0x543a34={'count':0x0,'rows':[]};var _0x3d665a=_[_0xab10('0x2a')](db[_0xab10('0x2b')]['rawAttributes'],function(_0xcb4b2a){return{'name':_0xcb4b2a[_0xab10('0x2c')],'type':_0xcb4b2a['type'][_0xab10('0x2d')]};});_0x407eb6[_0xab10('0x2e')]=_[_0xab10('0x2a')](_0x3d665a,'name');_0x407eb6[_0xab10('0x2f')]=_[_0xab10('0x30')](_0x1e6cf2['query']);_0x407eb6[_0xab10('0x31')]=_[_0xab10('0x32')](_0x407eb6['model'],_0x407eb6[_0xab10('0x2f')]);_0x1c13b6[_0xab10('0x33')]=_[_0xab10('0x32')](_0x407eb6[_0xab10('0x2e')],qs[_0xab10('0x34')](_0x1e6cf2['query']['fields']));_0x1c13b6[_0xab10('0x33')]=_0x1c13b6[_0xab10('0x33')][_0xab10('0x35')]?_0x1c13b6[_0xab10('0x33')]:_0x407eb6[_0xab10('0x2e')];if(!_0x1e6cf2['query'][_0xab10('0x36')](_0xab10('0x37'))){_0x1c13b6['limit']=qs['limit'](_0x1e6cf2[_0xab10('0x2f')]['limit']);_0x1c13b6[_0xab10('0x20')]=qs[_0xab10('0x20')](_0x1e6cf2[_0xab10('0x2f')][_0xab10('0x20')]);}_0x1c13b6['order']=qs[_0xab10('0x38')](_0x1e6cf2['query'][_0xab10('0x38')]);_0x1c13b6[_0xab10('0x39')]=qs['filters'](_['pick'](_0x1e6cf2[_0xab10('0x2f')],_0x407eb6['filters']),_0x3d665a);if(_0x1e6cf2[_0xab10('0x2f')][_0xab10('0x3a')]){_0x1c13b6[_0xab10('0x39')]=_['merge'](_0x1c13b6[_0xab10('0x39')],{'$or':_[_0xab10('0x2a')](_0x3d665a,function(_0x31e1f9){if(_0x31e1f9[_0xab10('0x3b')]!=='VIRTUAL'){var _0x2610e0={};_0x2610e0[_0x31e1f9['name']]={'$like':'%'+_0x1e6cf2['query'][_0xab10('0x3a')]+'%'};return _0x2610e0;}})});}_0x1c13b6=_[_0xab10('0x3c')]({},_0x1c13b6,_0x1e6cf2[_0xab10('0x3d')]);var _0x347a38={'where':_0x1c13b6[_0xab10('0x39')]};return db[_0xab10('0x2b')]['count'](_0x347a38)[_0xab10('0x25')](function(_0xc16663){_0x543a34[_0xab10('0x1f')]=_0xc16663;if(_0x1e6cf2['query'][_0xab10('0x3e')]){_0x1c13b6[_0xab10('0x3f')]=[{'all':!![]}];}return db[_0xab10('0x2b')][_0xab10('0x40')](_0x1c13b6);})['then'](function(_0x21bc7f){_0x543a34[_0xab10('0x41')]=_0x21bc7f;return _0x543a34;})['then'](respondWithFilteredResult(_0x482421,_0x1c13b6))['catch'](handleError(_0x482421,null));};exports[_0xab10('0x42')]=function(_0x4e7cf5,_0x1df09f){var _0x2f13ab={'raw':![],'where':{'id':_0x4e7cf5[_0xab10('0x43')]['id']}},_0x11e92d={};_0x11e92d[_0xab10('0x2e')]=_[_0xab10('0x30')](db[_0xab10('0x2b')][_0xab10('0x44')]);_0x11e92d['query']=_['keys'](_0x4e7cf5['query']);_0x11e92d['filters']=_[_0xab10('0x32')](_0x11e92d['model'],_0x11e92d[_0xab10('0x2f')]);_0x2f13ab[_0xab10('0x33')]=_['intersection'](_0x11e92d[_0xab10('0x2e')],qs[_0xab10('0x34')](_0x4e7cf5[_0xab10('0x2f')][_0xab10('0x34')]));_0x2f13ab[_0xab10('0x33')]=_0x2f13ab[_0xab10('0x33')][_0xab10('0x35')]?_0x2f13ab['attributes']:_0x11e92d[_0xab10('0x2e')];if(_0x4e7cf5[_0xab10('0x2f')]['includeAll']){_0x2f13ab[_0xab10('0x3f')]=[{'all':!![]}];}_0x2f13ab=_[_0xab10('0x3c')]({},_0x2f13ab,_0x4e7cf5['options']);return db[_0xab10('0x2b')][_0xab10('0x45')](_0x2f13ab)[_0xab10('0x25')](handleEntityNotFound(_0x1df09f,null))['then'](respondWithResult(_0x1df09f,null))[_0xab10('0x46')](handleError(_0x1df09f,null));};exports[_0xab10('0x47')]=function(_0x593086,_0x2152a1){return db[_0xab10('0x2b')][_0xab10('0x47')](_0x593086[_0xab10('0x48')],{})['then'](respondWithResult(_0x2152a1,0xc9))[_0xab10('0x46')](handleError(_0x2152a1,null));};exports[_0xab10('0x23')]=function(_0x4b83d2,_0x48758b){if(_0x4b83d2[_0xab10('0x48')]['id']){delete _0x4b83d2[_0xab10('0x48')]['id'];}return db[_0xab10('0x2b')][_0xab10('0x45')]({'where':{'id':_0x4b83d2[_0xab10('0x43')]['id']}})[_0xab10('0x25')](handleEntityNotFound(_0x48758b,null))[_0xab10('0x25')](saveUpdates(_0x4b83d2[_0xab10('0x48')],null))['then'](respondWithResult(_0x48758b,null))['catch'](handleError(_0x48758b,null));};exports[_0xab10('0x24')]=function(_0x3bb0f8,_0x1d0825){return db[_0xab10('0x2b')]['find']({'where':{'id':_0x3bb0f8[_0xab10('0x43')]['id']}})[_0xab10('0x25')](handleEntityNotFound(_0x1d0825,null))[_0xab10('0x25')](removeEntity(_0x1d0825,null))['catch'](handleError(_0x1d0825,null));};exports[_0xab10('0x49')]=function(_0x223626,_0x533f8c){return db[_0xab10('0x2b')][_0xab10('0x49')]()['then'](respondWithResult(_0x533f8c,null))[_0xab10('0x46')](handleError(_0x533f8c,null));};
\ No newline at end of file
+var _0xe887=['find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','IntegrationReport','rawAttributes','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','name','options','includeAll','include','findAll','catch','show','params','intersection'];(function(_0x2d9a6c,_0x4f3d0){var _0x47ca03=function(_0x5ed8c6){while(--_0x5ed8c6){_0x2d9a6c['push'](_0x2d9a6c['shift']());}};_0x47ca03(++_0x4f3d0);}(_0xe887,0x1bf));var _0x7e88=function(_0x158918,_0x4c6082){_0x158918=_0x158918-0x0;var _0x171089=_0xe887[_0x158918];return _0x171089;};'use strict';var emlformat=require(_0x7e88('0x0'));var rimraf=require(_0x7e88('0x1'));var zipdir=require(_0x7e88('0x2'));var jsonpatch=require(_0x7e88('0x3'));var rp=require(_0x7e88('0x4'));var moment=require(_0x7e88('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7e88('0x6'));var util=require(_0x7e88('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7e88('0x8'));var ejs=require(_0x7e88('0x9'));var fs=require('fs');var fs_extra=require(_0x7e88('0xa'));var _=require(_0x7e88('0xb'));var squel=require('squel');var crypto=require(_0x7e88('0xc'));var jsforce=require(_0x7e88('0xd'));var deskjs=require(_0x7e88('0xe'));var toCsv=require(_0x7e88('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7e88('0xf'));var hardwareService=require(_0x7e88('0x10'));var logger=require('../../config/logger')(_0x7e88('0x11'));var utils=require(_0x7e88('0x12'));var config=require(_0x7e88('0x13'));var licenseUtil=require(_0x7e88('0x14'));var db=require(_0x7e88('0x15'))['db'];function respondWithStatusCode(_0x5d05b4,_0x573877){_0x573877=_0x573877||0xcc;return function(_0x2100e9){if(_0x2100e9){return _0x5d05b4[_0x7e88('0x16')](_0x573877);}return _0x5d05b4[_0x7e88('0x17')](_0x573877)[_0x7e88('0x18')]();};}function respondWithResult(_0xf0ee26,_0x482205){_0x482205=_0x482205||0xc8;return function(_0x55d863){if(_0x55d863){return _0xf0ee26[_0x7e88('0x17')](_0x482205)[_0x7e88('0x19')](_0x55d863);}};}function respondWithFilteredResult(_0x46b147,_0x14b527){return function(_0x20750c){if(_0x20750c){var _0x252424=typeof _0x14b527[_0x7e88('0x1a')]===_0x7e88('0x1b')&&typeof _0x14b527[_0x7e88('0x1c')]===_0x7e88('0x1b');var _0x1fa465=_0x20750c[_0x7e88('0x1d')];var _0x5b3fa3=_0x252424?0x0:_0x14b527[_0x7e88('0x1a')];var _0x53565a=_0x252424?_0x20750c[_0x7e88('0x1d')]:_0x14b527[_0x7e88('0x1a')]+_0x14b527[_0x7e88('0x1c')];var _0x441cb3;if(_0x53565a>=_0x1fa465){_0x53565a=_0x1fa465;_0x441cb3=0xc8;}else{_0x441cb3=0xce;}_0x46b147[_0x7e88('0x17')](_0x441cb3);return _0x46b147[_0x7e88('0x1e')](_0x7e88('0x1f'),_0x5b3fa3+'-'+_0x53565a+'/'+_0x1fa465)[_0x7e88('0x19')](_0x20750c);}return null;};}function patchUpdates(_0xef416a){return function(_0x4bca43){try{jsonpatch[_0x7e88('0x20')](_0x4bca43,_0xef416a,!![]);}catch(_0x34811b){return BPromise[_0x7e88('0x21')](_0x34811b);}return _0x4bca43[_0x7e88('0x22')]();};}function saveUpdates(_0x13039f,_0x34377e){return function(_0x229c63){if(_0x229c63){return _0x229c63[_0x7e88('0x23')](_0x13039f)[_0x7e88('0x24')](function(_0x33c113){return _0x33c113;});}return null;};}function removeEntity(_0x1035d1,_0x554619){return function(_0x4aee13){if(_0x4aee13){return _0x4aee13[_0x7e88('0x25')]()[_0x7e88('0x24')](function(){_0x1035d1[_0x7e88('0x17')](0xcc)[_0x7e88('0x18')]();});}};}function handleEntityNotFound(_0x3c27ef,_0x39e2f7){return function(_0x2242fc){if(!_0x2242fc){_0x3c27ef['sendStatus'](0x194);}return _0x2242fc;};}function handleError(_0x3de99f,_0x3994d1){_0x3994d1=_0x3994d1||0x1f4;return function(_0x12f7e8){logger[_0x7e88('0x26')](_0x12f7e8[_0x7e88('0x27')]);if(_0x12f7e8['name']){delete _0x12f7e8['name'];}_0x3de99f[_0x7e88('0x17')](_0x3994d1)[_0x7e88('0x28')](_0x12f7e8);};}exports[_0x7e88('0x29')]=function(_0x592e18,_0xd2b2c8){var _0x20affb={},_0x4aed61={},_0x49fa4a={'count':0x0,'rows':[]};var _0x48f36c=_['map'](db[_0x7e88('0x2a')][_0x7e88('0x2b')],function(_0xd1432a){return{'name':_0xd1432a['fieldName'],'type':_0xd1432a['type']['key']};});_0x4aed61[_0x7e88('0x2c')]=_['map'](_0x48f36c,'name');_0x4aed61[_0x7e88('0x2d')]=_[_0x7e88('0x2e')](_0x592e18[_0x7e88('0x2d')]);_0x4aed61[_0x7e88('0x2f')]=_['intersection'](_0x4aed61[_0x7e88('0x2c')],_0x4aed61['query']);_0x20affb[_0x7e88('0x30')]=_['intersection'](_0x4aed61[_0x7e88('0x2c')],qs[_0x7e88('0x31')](_0x592e18[_0x7e88('0x2d')][_0x7e88('0x31')]));_0x20affb['attributes']=_0x20affb[_0x7e88('0x30')][_0x7e88('0x32')]?_0x20affb['attributes']:_0x4aed61['model'];if(!_0x592e18['query'][_0x7e88('0x33')](_0x7e88('0x34'))){_0x20affb[_0x7e88('0x1c')]=qs[_0x7e88('0x1c')](_0x592e18['query']['limit']);_0x20affb['offset']=qs[_0x7e88('0x1a')](_0x592e18[_0x7e88('0x2d')][_0x7e88('0x1a')]);}_0x20affb[_0x7e88('0x35')]=qs[_0x7e88('0x36')](_0x592e18['query'][_0x7e88('0x36')]);_0x20affb[_0x7e88('0x37')]=qs[_0x7e88('0x2f')](_[_0x7e88('0x38')](_0x592e18[_0x7e88('0x2d')],_0x4aed61['filters']),_0x48f36c);if(_0x592e18[_0x7e88('0x2d')][_0x7e88('0x39')]){_0x20affb[_0x7e88('0x37')]=_[_0x7e88('0x3a')](_0x20affb[_0x7e88('0x37')],{'$or':_[_0x7e88('0x3b')](_0x48f36c,function(_0x224586){if(_0x224586[_0x7e88('0x3c')]!==_0x7e88('0x3d')){var _0x5a2e30={};_0x5a2e30[_0x224586[_0x7e88('0x3e')]]={'$like':'%'+_0x592e18[_0x7e88('0x2d')][_0x7e88('0x39')]+'%'};return _0x5a2e30;}})});}_0x20affb=_[_0x7e88('0x3a')]({},_0x20affb,_0x592e18[_0x7e88('0x3f')]);var _0x1e6b5b={'where':_0x20affb[_0x7e88('0x37')]};return db['IntegrationReport'][_0x7e88('0x1d')](_0x1e6b5b)[_0x7e88('0x24')](function(_0xe361b3){_0x49fa4a[_0x7e88('0x1d')]=_0xe361b3;if(_0x592e18[_0x7e88('0x2d')][_0x7e88('0x40')]){_0x20affb[_0x7e88('0x41')]=[{'all':!![]}];}return db[_0x7e88('0x2a')][_0x7e88('0x42')](_0x20affb);})[_0x7e88('0x24')](function(_0x5a30cb){_0x49fa4a['rows']=_0x5a30cb;return _0x49fa4a;})[_0x7e88('0x24')](respondWithFilteredResult(_0xd2b2c8,_0x20affb))[_0x7e88('0x43')](handleError(_0xd2b2c8,null));};exports[_0x7e88('0x44')]=function(_0x5149ef,_0x1418fc){var _0x509cb3={'raw':![],'where':{'id':_0x5149ef[_0x7e88('0x45')]['id']}},_0x2ced16={};_0x2ced16[_0x7e88('0x2c')]=_[_0x7e88('0x2e')](db['IntegrationReport'][_0x7e88('0x2b')]);_0x2ced16[_0x7e88('0x2d')]=_[_0x7e88('0x2e')](_0x5149ef['query']);_0x2ced16['filters']=_[_0x7e88('0x46')](_0x2ced16[_0x7e88('0x2c')],_0x2ced16[_0x7e88('0x2d')]);_0x509cb3[_0x7e88('0x30')]=_[_0x7e88('0x46')](_0x2ced16[_0x7e88('0x2c')],qs[_0x7e88('0x31')](_0x5149ef[_0x7e88('0x2d')]['fields']));_0x509cb3[_0x7e88('0x30')]=_0x509cb3[_0x7e88('0x30')][_0x7e88('0x32')]?_0x509cb3['attributes']:_0x2ced16[_0x7e88('0x2c')];if(_0x5149ef[_0x7e88('0x2d')]['includeAll']){_0x509cb3[_0x7e88('0x41')]=[{'all':!![]}];}_0x509cb3=_['merge']({},_0x509cb3,_0x5149ef['options']);return db[_0x7e88('0x2a')][_0x7e88('0x47')](_0x509cb3)['then'](handleEntityNotFound(_0x1418fc,null))[_0x7e88('0x24')](respondWithResult(_0x1418fc,null))[_0x7e88('0x43')](handleError(_0x1418fc,null));};exports['create']=function(_0x2ba428,_0x25cd51){return db['IntegrationReport']['create'](_0x2ba428[_0x7e88('0x48')],{})[_0x7e88('0x24')](respondWithResult(_0x25cd51,0xc9))['catch'](handleError(_0x25cd51,null));};exports['update']=function(_0x424243,_0x1ef55e){if(_0x424243[_0x7e88('0x48')]['id']){delete _0x424243['body']['id'];}return db[_0x7e88('0x2a')][_0x7e88('0x47')]({'where':{'id':_0x424243[_0x7e88('0x45')]['id']}})[_0x7e88('0x24')](handleEntityNotFound(_0x1ef55e,null))[_0x7e88('0x24')](saveUpdates(_0x424243[_0x7e88('0x48')],null))['then'](respondWithResult(_0x1ef55e,null))[_0x7e88('0x43')](handleError(_0x1ef55e,null));};exports['destroy']=function(_0x574520,_0x496cb6){return db[_0x7e88('0x2a')][_0x7e88('0x47')]({'where':{'id':_0x574520['params']['id']}})[_0x7e88('0x24')](handleEntityNotFound(_0x496cb6,null))[_0x7e88('0x24')](removeEntity(_0x496cb6,null))['catch'](handleError(_0x496cb6,null));};exports[_0x7e88('0x49')]=function(_0xbefbaf,_0x1b07f2){return db[_0x7e88('0x2a')]['describe']()['then'](respondWithResult(_0x1b07f2,null))[_0x7e88('0x43')](handleError(_0x1b07f2,null));};
\ No newline at end of file
index 1a2475c..6698c25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7928=['../../config/environment','exports','IntegrationReport','report_integration','lodash','../../config/logger','api','bluebird','path'];(function(_0xca67f4,_0x59711b){var _0x2087fe=function(_0x4c1a33){while(--_0x4c1a33){_0xca67f4['push'](_0xca67f4['shift']());}};_0x2087fe(++_0x59711b);}(_0x7928,0x1d8));var _0x8792=function(_0x554296,_0x5b434e){_0x554296=_0x554296-0x0;var _0x127648=_0x7928[_0x554296];return _0x127648;};'use strict';var _=require(_0x8792('0x0'));var util=require('util');var logger=require(_0x8792('0x1'))(_0x8792('0x2'));var moment=require('moment');var BPromise=require(_0x8792('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8792('0x4'));var rimraf=require('rimraf');var config=require(_0x8792('0x5'));var attributes=require('./integrationReport.attributes');module[_0x8792('0x6')]=function(_0x290972,_0x4ae3a2){return _0x290972['define'](_0x8792('0x7'),attributes,{'tableName':_0x8792('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f55=['exports','define','report_integration','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes'];(function(_0x26d2ba,_0xc51eca){var _0x7548ed=function(_0x190d7a){while(--_0x190d7a){_0x26d2ba['push'](_0x26d2ba['shift']());}};_0x7548ed(++_0xc51eca);}(_0x6f55,0xd4));var _0x56f5=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x6f55[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x56f5('0x0'));var util=require('util');var logger=require(_0x56f5('0x1'))('api');var moment=require(_0x56f5('0x2'));var BPromise=require('bluebird');var rp=require(_0x56f5('0x3'));var fs=require('fs');var path=require(_0x56f5('0x4'));var rimraf=require(_0x56f5('0x5'));var config=require(_0x56f5('0x6'));var attributes=require(_0x56f5('0x7'));module[_0x56f5('0x8')]=function(_0x337352,_0x24b6b4){return _0x337352[_0x56f5('0x9')]('IntegrationReport',attributes,{'tableName':_0x56f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 69914e7..7081d0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0x687b,0x14a));var _0xb687=function(_0x1e5c8d,_0x1bd355){_0x1e5c8d=_0x1e5c8d-0x0;var _0x17f720=_0x687b[_0x1e5c8d];return _0x17f720;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x2abca8,_0x4c63d3){var _0x45d797=function(_0x101a14){while(--_0x101a14){_0x2abca8['push'](_0x2abca8['shift']());}};_0x45d797(++_0x4c63d3);}(_0x2ef3,0xba));var _0x32ef=function(_0x2c204d,_0x496228){_0x2c204d=_0x2c204d-0x0;var _0x4374e3=_0x2ef3[_0x2c204d];return _0x4374e3;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
index 348f4a6..cadd2c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8802=['../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','addIntervals','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x20acfb,_0x279f81){var _0x3de508=function(_0x8640a){while(--_0x8640a){_0x20acfb['push'](_0x20acfb['shift']());}};_0x3de508(++_0x279f81);}(_0x8802,0x7e));var _0x2880=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0x8802[_0x277af0];return _0x43bd7c;};'use strict';var multer=require(_0x2880('0x0'));var util=require('util');var path=require(_0x2880('0x1'));var timeout=require('connect-timeout');var express=require(_0x2880('0x2'));var router=express[_0x2880('0x3')]();var fs_extra=require(_0x2880('0x4'));var auth=require(_0x2880('0x5'));var interaction=require(_0x2880('0x6'));var config=require(_0x2880('0x7'));var controller=require(_0x2880('0x8'));router[_0x2880('0x9')]('/',auth[_0x2880('0xa')](),controller[_0x2880('0xb')]);router[_0x2880('0x9')](_0x2880('0xc'),auth[_0x2880('0xa')](),controller[_0x2880('0xd')]);router['get'](_0x2880('0xe'),auth[_0x2880('0xa')](),controller['getIntervals']);router['post']('/',auth[_0x2880('0xa')](),controller['create']);router[_0x2880('0xf')](_0x2880('0xe'),auth[_0x2880('0xa')](),controller[_0x2880('0x10')]);router[_0x2880('0xf')]('/:id/sub_intervals/create_many',auth[_0x2880('0xa')](),controller[_0x2880('0x11')]);router[_0x2880('0x12')]('/:id',auth[_0x2880('0xa')](),controller['update']);router[_0x2880('0x13')](_0x2880('0xc'),auth[_0x2880('0xa')](),controller[_0x2880('0x14')]);module[_0x2880('0x15')]=router;
\ No newline at end of file
+var _0x1f2b=['path','Router','../../components/interaction/service','./interval.controller','get','isAuthenticated','index','show','/:id/sub_intervals','getIntervals','post','addIntervals','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x1f2b,0x76));var _0xb1f2=function(_0x45a9b1,_0x260076){_0x45a9b1=_0x45a9b1-0x0;var _0x15de97=_0x1f2b[_0x45a9b1];return _0x15de97;};'use strict';var multer=require(_0xb1f2('0x0'));var util=require(_0xb1f2('0x1'));var path=require(_0xb1f2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1f2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb1f2('0x4'));var config=require('../../config/environment');var controller=require(_0xb1f2('0x5'));router[_0xb1f2('0x6')]('/',auth[_0xb1f2('0x7')](),controller[_0xb1f2('0x8')]);router[_0xb1f2('0x6')]('/:id',auth[_0xb1f2('0x7')](),controller[_0xb1f2('0x9')]);router['get'](_0xb1f2('0xa'),auth['isAuthenticated'](),controller[_0xb1f2('0xb')]);router[_0xb1f2('0xc')]('/',auth[_0xb1f2('0x7')](),controller['create']);router[_0xb1f2('0xc')](_0xb1f2('0xa'),auth[_0xb1f2('0x7')](),controller['addInterval']);router[_0xb1f2('0xc')]('/:id/sub_intervals/create_many',auth[_0xb1f2('0x7')](),controller[_0xb1f2('0xd')]);router[_0xb1f2('0xe')](_0xb1f2('0xf'),auth[_0xb1f2('0x7')](),controller[_0xb1f2('0x10')]);router[_0xb1f2('0x11')](_0xb1f2('0xf'),auth['isAuthenticated'](),controller[_0xb1f2('0x12')]);module[_0xb1f2('0x13')]=router;
\ No newline at end of file
index 2f56bad..0509d6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bb0=['STRING','exports'];(function(_0x3e8c82,_0x23d2f8){var _0x32c99b=function(_0x485105){while(--_0x485105){_0x3e8c82['push'](_0x3e8c82['shift']());}};_0x32c99b(++_0x23d2f8);}(_0x3bb0,0x199));var _0x03bb=function(_0xdb0130,_0x371659){_0xdb0130=_0xdb0130-0x0;var _0x230af8=_0x3bb0[_0xdb0130];return _0x230af8;};'use strict';var Sequelize=require('sequelize');module[_0x03bb('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x03bb('0x1')],'allowNull':!![]}};
\ No newline at end of file
+var _0x48d5=['exports','STRING','sequelize'];(function(_0x4b47eb,_0x3c9321){var _0x3bb8d9=function(_0x5682ca){while(--_0x5682ca){_0x4b47eb['push'](_0x4b47eb['shift']());}};_0x3bb8d9(++_0x3c9321);}(_0x48d5,0x18e));var _0x548d=function(_0x339f67,_0x3eef63){_0x339f67=_0x339f67-0x0;var _0x9d6b2=_0x48d5[_0x339f67];return _0x9d6b2;};'use strict';var Sequelize=require(_0x548d('0x0'));module[_0x548d('0x1')]={'name':{'type':Sequelize[_0x548d('0x2')]},'description':{'type':Sequelize[_0x548d('0x2')]},'interval':{'type':Sequelize[_0x548d('0x2')],'allowNull':!![]}};
\ No newline at end of file
index a1a9ee9..585d753 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d35=['status','end','offset','undefined','limit','count','set','json','reject','save','then','destroy','Intervals','UserProfileResource','error','stack','name','send','index','Interval','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','params','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','getIntervals','findOne','nolimit','addIntervals','sequelize','transaction','IntervalId','bulkCreate','findAll','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x3bca2d,_0x1af8f4){var _0x144a7c=function(_0x2a46ce){while(--_0x2a46ce){_0x3bca2d['push'](_0x3bca2d['shift']());}};_0x144a7c(++_0x1af8f4);}(_0x4d35,0x99));var _0x54d3=function(_0x3fe83b,_0x5ca3ce){_0x3fe83b=_0x3fe83b-0x0;var _0x3c0393=_0x4d35[_0x3fe83b];return _0x3c0393;};'use strict';var emlformat=require(_0x54d3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x54d3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x54d3('0x2'));var BPromise=require(_0x54d3('0x3'));var Mustache=require(_0x54d3('0x4'));var util=require(_0x54d3('0x5'));var path=require(_0x54d3('0x6'));var sox=require(_0x54d3('0x7'));var csv=require(_0x54d3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54d3('0x9'));var squel=require('squel');var crypto=require(_0x54d3('0xa'));var jsforce=require(_0x54d3('0xb'));var deskjs=require(_0x54d3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x54d3('0xd'));var Papa=require(_0x54d3('0xe'));var Redis=require('ioredis');var authService=require(_0x54d3('0xf'));var qs=require(_0x54d3('0x10'));var as=require(_0x54d3('0x11'));var hardwareService=require(_0x54d3('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x54d3('0x13'));var config=require(_0x54d3('0x14'));var licenseUtil=require(_0x54d3('0x15'));var db=require('../../mysqldb')['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x54ad74,_0x4ae2df){_0x4ae2df=_0x4ae2df||0xcc;return function(_0x1f077c){if(_0x1f077c){return _0x54ad74[_0x54d3('0x16')](_0x4ae2df);}return _0x54ad74[_0x54d3('0x17')](_0x4ae2df)[_0x54d3('0x18')]();};}function respondWithResult(_0x301a52,_0x46ed2f){_0x46ed2f=_0x46ed2f||0xc8;return function(_0x6aa95d){if(_0x6aa95d){return _0x301a52[_0x54d3('0x17')](_0x46ed2f)['json'](_0x6aa95d);}};}function respondWithFilteredResult(_0x59941c,_0x27c6d4){return function(_0x183982){if(_0x183982){var _0x9632be=typeof _0x27c6d4[_0x54d3('0x19')]===_0x54d3('0x1a')&&typeof _0x27c6d4[_0x54d3('0x1b')]===_0x54d3('0x1a');var _0x3b6488=_0x183982[_0x54d3('0x1c')];var _0x44dc8a=_0x9632be?0x0:_0x27c6d4[_0x54d3('0x19')];var _0x4f44f2=_0x9632be?_0x183982[_0x54d3('0x1c')]:_0x27c6d4['offset']+_0x27c6d4[_0x54d3('0x1b')];var _0x2467e8;if(_0x4f44f2>=_0x3b6488){_0x4f44f2=_0x3b6488;_0x2467e8=0xc8;}else{_0x2467e8=0xce;}_0x59941c[_0x54d3('0x17')](_0x2467e8);return _0x59941c[_0x54d3('0x1d')]('Content-Range',_0x44dc8a+'-'+_0x4f44f2+'/'+_0x3b6488)[_0x54d3('0x1e')](_0x183982);}return null;};}function patchUpdates(_0x3ced40){return function(_0x4c6fd4){try{jsonpatch['apply'](_0x4c6fd4,_0x3ced40,!![]);}catch(_0x3f4709){return BPromise[_0x54d3('0x1f')](_0x3f4709);}return _0x4c6fd4[_0x54d3('0x20')]();};}function saveUpdates(_0x4dec26,_0x362a1c){return function(_0x301dbd){if(_0x301dbd){return _0x301dbd['update'](_0x4dec26)[_0x54d3('0x21')](function(_0x35a86b){return _0x35a86b;});}return null;};}function removeEntity(_0x45bea8,_0x2f0723){return function(_0x11c9e6){if(_0x11c9e6){return _0x11c9e6[_0x54d3('0x22')]()[_0x54d3('0x21')](function(){var _0x25b6a4=_0x11c9e6['get']({'plain':!![]});var _0x5f2ae0=_0x54d3('0x23');return db[_0x54d3('0x24')]['destroy']({'where':{'type':_0x5f2ae0,'resourceId':_0x25b6a4['id']}})[_0x54d3('0x21')](function(){return _0x11c9e6;});})[_0x54d3('0x21')](function(){_0x45bea8[_0x54d3('0x17')](0xcc)[_0x54d3('0x18')]();});}};}function handleEntityNotFound(_0x3141bc,_0xa30923){return function(_0x15f0a5){if(!_0x15f0a5){_0x3141bc[_0x54d3('0x16')](0x194);}return _0x15f0a5;};}function handleError(_0x528e8d,_0x6aa2b2){_0x6aa2b2=_0x6aa2b2||0x1f4;return function(_0x1563b8){logger[_0x54d3('0x25')](_0x1563b8[_0x54d3('0x26')]);if(_0x1563b8[_0x54d3('0x27')]){delete _0x1563b8[_0x54d3('0x27')];}_0x528e8d[_0x54d3('0x17')](_0x6aa2b2)[_0x54d3('0x28')](_0x1563b8);};}exports[_0x54d3('0x29')]=function(_0x5c0e77,_0x125dd5){var _0x185bd9={},_0x20cb09={},_0x3997e4={'count':0x0,'rows':[]};var _0x26565e=_['map'](db[_0x54d3('0x2a')][_0x54d3('0x2b')],function(_0x326224){return{'name':_0x326224[_0x54d3('0x2c')],'type':_0x326224[_0x54d3('0x2d')][_0x54d3('0x2e')]};});_0x20cb09[_0x54d3('0x2f')]=_[_0x54d3('0x30')](_0x26565e,_0x54d3('0x27'));_0x20cb09[_0x54d3('0x31')]=_[_0x54d3('0x32')](_0x5c0e77[_0x54d3('0x31')]);_0x20cb09[_0x54d3('0x33')]=_[_0x54d3('0x34')](_0x20cb09[_0x54d3('0x2f')],_0x20cb09[_0x54d3('0x31')]);_0x185bd9[_0x54d3('0x35')]=_[_0x54d3('0x34')](_0x20cb09[_0x54d3('0x2f')],qs[_0x54d3('0x36')](_0x5c0e77[_0x54d3('0x31')][_0x54d3('0x36')]));_0x185bd9[_0x54d3('0x35')]=_0x185bd9[_0x54d3('0x35')][_0x54d3('0x37')]?_0x185bd9['attributes']:_0x20cb09[_0x54d3('0x2f')];if(!_0x5c0e77['query'][_0x54d3('0x38')]('nolimit')){_0x185bd9[_0x54d3('0x1b')]=qs[_0x54d3('0x1b')](_0x5c0e77[_0x54d3('0x31')][_0x54d3('0x1b')]);_0x185bd9[_0x54d3('0x19')]=qs[_0x54d3('0x19')](_0x5c0e77[_0x54d3('0x31')][_0x54d3('0x19')]);}_0x185bd9[_0x54d3('0x39')]=qs[_0x54d3('0x3a')](_0x5c0e77[_0x54d3('0x31')]['sort']);_0x185bd9[_0x54d3('0x3b')]=qs['filters'](_[_0x54d3('0x3c')](_0x5c0e77[_0x54d3('0x31')],_0x20cb09[_0x54d3('0x33')]),_0x26565e);if(_0x5c0e77[_0x54d3('0x31')][_0x54d3('0x3d')]){_0x185bd9['where']=_[_0x54d3('0x3e')](_0x185bd9['where'],{'$or':_['map'](_0x26565e,function(_0xe9e383){if(_0xe9e383[_0x54d3('0x2d')]!=='VIRTUAL'){var _0x300e24={};_0x300e24[_0xe9e383['name']]={'$like':'%'+_0x5c0e77['query']['filter']+'%'};return _0x300e24;}})});}_0x185bd9=_[_0x54d3('0x3e')]({},_0x185bd9,_0x5c0e77[_0x54d3('0x3f')]);var _0x193e85={'where':_0x185bd9[_0x54d3('0x3b')]};return db[_0x54d3('0x2a')][_0x54d3('0x1c')](_0x193e85)['then'](function(_0xe452b0){_0x3997e4['count']=_0xe452b0;if(_0x5c0e77[_0x54d3('0x31')][_0x54d3('0x40')]){_0x185bd9['include']=[{'all':!![]}];}return db['Interval']['findAll'](_0x185bd9);})[_0x54d3('0x21')](function(_0x5bf0d2){_0x3997e4[_0x54d3('0x41')]=_0x5bf0d2;return _0x3997e4;})['then'](respondWithFilteredResult(_0x125dd5,_0x185bd9))[_0x54d3('0x42')](handleError(_0x125dd5,null));};exports['show']=function(_0x5313c6,_0x3a933b){var _0x36a85d={'raw':!![],'where':{'id':_0x5313c6[_0x54d3('0x43')]['id']}},_0x1ab749={};_0x1ab749['model']=_[_0x54d3('0x32')](db[_0x54d3('0x2a')]['rawAttributes']);_0x1ab749[_0x54d3('0x31')]=_[_0x54d3('0x32')](_0x5313c6[_0x54d3('0x31')]);_0x1ab749[_0x54d3('0x33')]=_['intersection'](_0x1ab749[_0x54d3('0x2f')],_0x1ab749[_0x54d3('0x31')]);_0x36a85d[_0x54d3('0x35')]=_[_0x54d3('0x34')](_0x1ab749[_0x54d3('0x2f')],qs[_0x54d3('0x36')](_0x5313c6[_0x54d3('0x31')][_0x54d3('0x36')]));_0x36a85d[_0x54d3('0x35')]=_0x36a85d[_0x54d3('0x35')][_0x54d3('0x37')]?_0x36a85d['attributes']:_0x1ab749[_0x54d3('0x2f')];if(_0x5313c6[_0x54d3('0x31')][_0x54d3('0x40')]){_0x36a85d[_0x54d3('0x44')]=[{'all':!![]}];}_0x36a85d=_['merge']({},_0x36a85d,_0x5313c6['options']);return db[_0x54d3('0x2a')]['find'](_0x36a85d)[_0x54d3('0x21')](handleEntityNotFound(_0x3a933b,null))['then'](respondWithResult(_0x3a933b,null))[_0x54d3('0x42')](handleError(_0x3a933b,null));};exports[_0x54d3('0x45')]=function(_0x26a358,_0xc77957){return db[_0x54d3('0x2a')][_0x54d3('0x45')](_0x26a358[_0x54d3('0x46')],{})[_0x54d3('0x21')](function(_0x24be95){var _0x9d6bd4=_0x26a358[_0x54d3('0x47')][_0x54d3('0x48')]({'plain':!![]});if(!_0x9d6bd4)throw new Error(_0x54d3('0x49'));if(_0x9d6bd4[_0x54d3('0x4a')]===_0x54d3('0x47')){var _0x2b6f10=_0x24be95[_0x54d3('0x48')]({'plain':!![]});var _0x5cf950=_0x54d3('0x23');return db['UserProfileSection'][_0x54d3('0x4b')]({'where':{'name':_0x5cf950,'userProfileId':_0x9d6bd4['userProfileId']},'raw':!![]})['then'](function(_0x1d48de){if(_0x1d48de&&_0x1d48de[_0x54d3('0x4c')]===0x0){return db[_0x54d3('0x24')][_0x54d3('0x45')]({'name':_0x2b6f10[_0x54d3('0x27')],'resourceId':_0x2b6f10['id'],'type':_0x1d48de[_0x54d3('0x27')],'sectionId':_0x1d48de['id']},{})[_0x54d3('0x21')](function(){return _0x24be95;});}else{return _0x24be95;}})[_0x54d3('0x42')](function(_0x2f9851){logger[_0x54d3('0x25')](_0x54d3('0x4d'),_0x2f9851);throw _0x2f9851;});}return _0x24be95;})[_0x54d3('0x21')](respondWithResult(_0xc77957,0xc9))[_0x54d3('0x42')](handleError(_0xc77957,null));};exports['update']=function(_0xc9d683,_0x122d0c){if(_0xc9d683[_0x54d3('0x46')]['id']){delete _0xc9d683['body']['id'];}return db[_0x54d3('0x2a')]['find']({'where':{'id':_0xc9d683[_0x54d3('0x43')]['id']}})['then'](handleEntityNotFound(_0x122d0c,null))[_0x54d3('0x21')](saveUpdates(_0xc9d683[_0x54d3('0x46')],null))['then'](respondWithResult(_0x122d0c,null))[_0x54d3('0x42')](handleError(_0x122d0c,null));};exports[_0x54d3('0x22')]=function(_0x365fd4,_0x23f67a){return db[_0x54d3('0x2a')][_0x54d3('0x4b')]({'where':{'id':_0x365fd4[_0x54d3('0x43')]['id']}})[_0x54d3('0x21')](handleEntityNotFound(_0x23f67a,null))[_0x54d3('0x21')](removeEntity(_0x23f67a,null))[_0x54d3('0x42')](handleError(_0x23f67a,null));};exports[_0x54d3('0x4e')]=function(_0x1afd18,_0x1c3b3f,_0x375014){if(_0x1afd18[_0x54d3('0x46')]['id']){delete _0x1afd18[_0x54d3('0x46')]['id'];}return db[_0x54d3('0x2a')][_0x54d3('0x4b')]({'where':{'id':_0x1afd18['params']['id']}})[_0x54d3('0x21')](handleEntityNotFound(_0x1c3b3f,null))['then'](function(_0x3db39){if(_0x3db39){_0x1afd18[_0x54d3('0x46')]['IntervalId']=_0x3db39['id'];return db[_0x54d3('0x2a')][_0x54d3('0x45')](_0x1afd18[_0x54d3('0x46')]);}})[_0x54d3('0x21')](respondWithResult(_0x1c3b3f,null))[_0x54d3('0x42')](handleError(_0x1c3b3f,null));};exports[_0x54d3('0x4f')]=function(_0x1d3e4b,_0xaa3807,_0xe47837){var _0x2fe148={};var _0x8773ed={};var _0x4181a4;var _0x1d414;return db[_0x54d3('0x2a')][_0x54d3('0x50')]({'where':{'id':_0x1d3e4b['params']['id']}})[_0x54d3('0x21')](handleEntityNotFound(_0xaa3807,null))[_0x54d3('0x21')](function(_0x26df10){if(_0x26df10){_0x4181a4=_0x26df10;_0x8773ed[_0x54d3('0x2f')]=_[_0x54d3('0x32')](db[_0x54d3('0x2a')][_0x54d3('0x2b')]);_0x8773ed['query']=_[_0x54d3('0x32')](_0x1d3e4b[_0x54d3('0x31')]);_0x8773ed[_0x54d3('0x33')]=_[_0x54d3('0x34')](_0x8773ed[_0x54d3('0x2f')],_0x8773ed[_0x54d3('0x31')]);_0x2fe148[_0x54d3('0x35')]=_[_0x54d3('0x34')](_0x8773ed[_0x54d3('0x2f')],qs[_0x54d3('0x36')](_0x1d3e4b['query']['fields']));_0x2fe148[_0x54d3('0x35')]=_0x2fe148[_0x54d3('0x35')][_0x54d3('0x37')]?_0x2fe148['attributes']:_0x8773ed[_0x54d3('0x2f')];_0x2fe148['order']=qs['sort'](_0x1d3e4b[_0x54d3('0x31')][_0x54d3('0x3a')]);_0x2fe148[_0x54d3('0x3b')]=qs[_0x54d3('0x33')](_[_0x54d3('0x3c')](_0x1d3e4b[_0x54d3('0x31')],_0x8773ed[_0x54d3('0x33')]));if(_0x1d3e4b[_0x54d3('0x31')]['filter']){_0x2fe148[_0x54d3('0x3b')]=_[_0x54d3('0x3e')](_0x2fe148[_0x54d3('0x3b')],{'$or':_[_0x54d3('0x30')](_0x2fe148['attributes'],function(_0x376541){var _0x166260={};_0x166260[_0x376541]={'$like':'%'+_0x1d3e4b[_0x54d3('0x31')][_0x54d3('0x3d')]+'%'};return _0x166260;})});}_0x2fe148=_[_0x54d3('0x3e')]({},_0x2fe148,_0x1d3e4b[_0x54d3('0x3f')]);return _0x4181a4[_0x54d3('0x4f')](_0x2fe148);}})[_0x54d3('0x21')](function(_0x3fdd82){if(_0x3fdd82){_0x1d414=_0x3fdd82[_0x54d3('0x37')];if(!_0x1d3e4b[_0x54d3('0x31')][_0x54d3('0x38')](_0x54d3('0x51'))){_0x2fe148[_0x54d3('0x1b')]=qs[_0x54d3('0x1b')](_0x1d3e4b[_0x54d3('0x31')][_0x54d3('0x1b')]);_0x2fe148[_0x54d3('0x19')]=qs[_0x54d3('0x19')](_0x1d3e4b[_0x54d3('0x31')][_0x54d3('0x19')]);}return _0x4181a4['getIntervals'](_0x2fe148);}})['then'](function(_0x4ab618){if(_0x4ab618){return _0x4ab618?{'count':_0x1d414,'rows':_0x4ab618}:null;}})['then'](respondWithResult(_0xaa3807,null))[_0x54d3('0x42')](handleError(_0xaa3807,null));};exports[_0x54d3('0x52')]=function(_0x3510c1,_0x5d044c,_0x18714b){return db[_0x54d3('0x2a')][_0x54d3('0x50')]({'where':{'id':_0x3510c1['params']['id']}})['then'](handleEntityNotFound(_0x5d044c,null))[_0x54d3('0x21')](function(_0x58c6cf){if(_0x58c6cf){return db[_0x54d3('0x53')][_0x54d3('0x54')](function(_0xf6afa3){return db[_0x54d3('0x2a')]['destroy']({'where':{'IntervalId':_0x3510c1['params']['id']},'transaction':_0xf6afa3})[_0x54d3('0x21')](function(_0x4e7142){var _0x2d7b0d=_['map'](_0x3510c1[_0x54d3('0x46')],function(_0x30d077){delete _0x30d077['id'];_0x30d077[_0x54d3('0x55')]=_0x3510c1[_0x54d3('0x43')]['id'];return _0x30d077;});return db['Interval'][_0x54d3('0x56')](_0x2d7b0d,{'transaction':_0xf6afa3});});})[_0x54d3('0x21')](function(){return db[_0x54d3('0x2a')][_0x54d3('0x57')]({'where':{'IntervalId':_0x3510c1[_0x54d3('0x43')]['id']}});});}})[_0x54d3('0x21')](respondWithResult(_0x5d044c,null))[_0x54d3('0x42')](handleError(_0x5d044c,null));};
\ No newline at end of file
+var _0x42dc=['user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','Intervals','UserProfileResource','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Interval','findAll','rows','catch','show','params','includeAll','include','find','create','body'];(function(_0x17a47d,_0x3a048f){var _0x230e35=function(_0x40be){while(--_0x40be){_0x17a47d['push'](_0x17a47d['shift']());}};_0x230e35(++_0x3a048f);}(_0x42dc,0x6c));var _0xc42d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x42dc[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xc42d('0x0'));var rimraf=require(_0xc42d('0x1'));var zipdir=require(_0xc42d('0x2'));var jsonpatch=require(_0xc42d('0x3'));var rp=require(_0xc42d('0x4'));var moment=require(_0xc42d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc42d('0x6'));var util=require(_0xc42d('0x7'));var path=require('path');var sox=require(_0xc42d('0x8'));var csv=require(_0xc42d('0x9'));var ejs=require(_0xc42d('0xa'));var fs=require('fs');var fs_extra=require(_0xc42d('0xb'));var _=require(_0xc42d('0xc'));var squel=require('squel');var crypto=require(_0xc42d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc42d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc42d('0xf'));var Papa=require(_0xc42d('0x10'));var Redis=require(_0xc42d('0x11'));var authService=require(_0xc42d('0x12'));var qs=require(_0xc42d('0x13'));var as=require(_0xc42d('0x14'));var hardwareService=require(_0xc42d('0x15'));var logger=require(_0xc42d('0x16'))(_0xc42d('0x17'));var utils=require(_0xc42d('0x18'));var config=require(_0xc42d('0x19'));var licenseUtil=require(_0xc42d('0x1a'));var db=require(_0xc42d('0x1b'))['db'];var extensions=require(_0xc42d('0x1c'));function respondWithStatusCode(_0x589f29,_0x144598){_0x144598=_0x144598||0xcc;return function(_0x5c2a3b){if(_0x5c2a3b){return _0x589f29[_0xc42d('0x1d')](_0x144598);}return _0x589f29[_0xc42d('0x1e')](_0x144598)[_0xc42d('0x1f')]();};}function respondWithResult(_0x43797c,_0x589187){_0x589187=_0x589187||0xc8;return function(_0x5ac7fb){if(_0x5ac7fb){return _0x43797c[_0xc42d('0x1e')](_0x589187)[_0xc42d('0x20')](_0x5ac7fb);}};}function respondWithFilteredResult(_0x5a58df,_0x32b079){return function(_0x7a9dfd){if(_0x7a9dfd){var _0xf28c99=typeof _0x32b079[_0xc42d('0x21')]===_0xc42d('0x22')&&typeof _0x32b079[_0xc42d('0x23')]===_0xc42d('0x22');var _0x37dfeb=_0x7a9dfd[_0xc42d('0x24')];var _0x1c48fe=_0xf28c99?0x0:_0x32b079['offset'];var _0x1f8633=_0xf28c99?_0x7a9dfd['count']:_0x32b079[_0xc42d('0x21')]+_0x32b079[_0xc42d('0x23')];var _0x1af620;if(_0x1f8633>=_0x37dfeb){_0x1f8633=_0x37dfeb;_0x1af620=0xc8;}else{_0x1af620=0xce;}_0x5a58df[_0xc42d('0x1e')](_0x1af620);return _0x5a58df[_0xc42d('0x25')](_0xc42d('0x26'),_0x1c48fe+'-'+_0x1f8633+'/'+_0x37dfeb)[_0xc42d('0x20')](_0x7a9dfd);}return null;};}function patchUpdates(_0xc3e1b5){return function(_0x487754){try{jsonpatch[_0xc42d('0x27')](_0x487754,_0xc3e1b5,!![]);}catch(_0x6d8e7e){return BPromise['reject'](_0x6d8e7e);}return _0x487754[_0xc42d('0x28')]();};}function saveUpdates(_0x20f3b4,_0x5773ac){return function(_0x191f70){if(_0x191f70){return _0x191f70[_0xc42d('0x29')](_0x20f3b4)[_0xc42d('0x2a')](function(_0x52bd39){return _0x52bd39;});}return null;};}function removeEntity(_0x267c8b,_0x4c0bfc){return function(_0x46cbe2){if(_0x46cbe2){return _0x46cbe2[_0xc42d('0x2b')]()[_0xc42d('0x2a')](function(){var _0x5ac65a=_0x46cbe2[_0xc42d('0x2c')]({'plain':!![]});var _0x3edd6d=_0xc42d('0x2d');return db[_0xc42d('0x2e')]['destroy']({'where':{'type':_0x3edd6d,'resourceId':_0x5ac65a['id']}})[_0xc42d('0x2a')](function(){return _0x46cbe2;});})[_0xc42d('0x2a')](function(){_0x267c8b[_0xc42d('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3033b9,_0x2cb672){return function(_0x137cd9){if(!_0x137cd9){_0x3033b9[_0xc42d('0x1d')](0x194);}return _0x137cd9;};}function handleError(_0x138cd6,_0x2de605){_0x2de605=_0x2de605||0x1f4;return function(_0x18479d){logger['error'](_0x18479d['stack']);if(_0x18479d[_0xc42d('0x2f')]){delete _0x18479d['name'];}_0x138cd6['status'](_0x2de605)[_0xc42d('0x30')](_0x18479d);};}exports[_0xc42d('0x31')]=function(_0x62d529,_0x4626b8){var _0xd6f03b={},_0x1296a5={},_0xb637ac={'count':0x0,'rows':[]};var _0x1ff281=_[_0xc42d('0x32')](db['Interval'][_0xc42d('0x33')],function(_0x23f546){return{'name':_0x23f546[_0xc42d('0x34')],'type':_0x23f546['type']['key']};});_0x1296a5[_0xc42d('0x35')]=_[_0xc42d('0x32')](_0x1ff281,'name');_0x1296a5[_0xc42d('0x36')]=_[_0xc42d('0x37')](_0x62d529[_0xc42d('0x36')]);_0x1296a5[_0xc42d('0x38')]=_[_0xc42d('0x39')](_0x1296a5[_0xc42d('0x35')],_0x1296a5[_0xc42d('0x36')]);_0xd6f03b[_0xc42d('0x3a')]=_[_0xc42d('0x39')](_0x1296a5[_0xc42d('0x35')],qs[_0xc42d('0x3b')](_0x62d529[_0xc42d('0x36')]['fields']));_0xd6f03b['attributes']=_0xd6f03b[_0xc42d('0x3a')][_0xc42d('0x3c')]?_0xd6f03b[_0xc42d('0x3a')]:_0x1296a5[_0xc42d('0x35')];if(!_0x62d529[_0xc42d('0x36')][_0xc42d('0x3d')]('nolimit')){_0xd6f03b[_0xc42d('0x23')]=qs[_0xc42d('0x23')](_0x62d529[_0xc42d('0x36')][_0xc42d('0x23')]);_0xd6f03b[_0xc42d('0x21')]=qs[_0xc42d('0x21')](_0x62d529['query']['offset']);}_0xd6f03b[_0xc42d('0x3e')]=qs[_0xc42d('0x3f')](_0x62d529[_0xc42d('0x36')][_0xc42d('0x3f')]);_0xd6f03b[_0xc42d('0x40')]=qs[_0xc42d('0x38')](_[_0xc42d('0x41')](_0x62d529['query'],_0x1296a5[_0xc42d('0x38')]),_0x1ff281);if(_0x62d529[_0xc42d('0x36')][_0xc42d('0x42')]){_0xd6f03b[_0xc42d('0x40')]=_[_0xc42d('0x43')](_0xd6f03b[_0xc42d('0x40')],{'$or':_[_0xc42d('0x32')](_0x1ff281,function(_0x1aecb6){if(_0x1aecb6[_0xc42d('0x44')]!==_0xc42d('0x45')){var _0x597ad9={};_0x597ad9[_0x1aecb6[_0xc42d('0x2f')]]={'$like':'%'+_0x62d529['query']['filter']+'%'};return _0x597ad9;}})});}_0xd6f03b=_[_0xc42d('0x43')]({},_0xd6f03b,_0x62d529[_0xc42d('0x46')]);var _0x4c2dd9={'where':_0xd6f03b[_0xc42d('0x40')]};return db[_0xc42d('0x47')][_0xc42d('0x24')](_0x4c2dd9)[_0xc42d('0x2a')](function(_0x53e570){_0xb637ac[_0xc42d('0x24')]=_0x53e570;if(_0x62d529[_0xc42d('0x36')]['includeAll']){_0xd6f03b['include']=[{'all':!![]}];}return db[_0xc42d('0x47')][_0xc42d('0x48')](_0xd6f03b);})[_0xc42d('0x2a')](function(_0x341d09){_0xb637ac[_0xc42d('0x49')]=_0x341d09;return _0xb637ac;})['then'](respondWithFilteredResult(_0x4626b8,_0xd6f03b))[_0xc42d('0x4a')](handleError(_0x4626b8,null));};exports[_0xc42d('0x4b')]=function(_0x56434a,_0x268b6d){var _0x432083={'raw':!![],'where':{'id':_0x56434a[_0xc42d('0x4c')]['id']}},_0x5b50b2={};_0x5b50b2[_0xc42d('0x35')]=_[_0xc42d('0x37')](db[_0xc42d('0x47')][_0xc42d('0x33')]);_0x5b50b2[_0xc42d('0x36')]=_[_0xc42d('0x37')](_0x56434a['query']);_0x5b50b2['filters']=_[_0xc42d('0x39')](_0x5b50b2['model'],_0x5b50b2[_0xc42d('0x36')]);_0x432083[_0xc42d('0x3a')]=_[_0xc42d('0x39')](_0x5b50b2[_0xc42d('0x35')],qs[_0xc42d('0x3b')](_0x56434a[_0xc42d('0x36')][_0xc42d('0x3b')]));_0x432083[_0xc42d('0x3a')]=_0x432083[_0xc42d('0x3a')][_0xc42d('0x3c')]?_0x432083[_0xc42d('0x3a')]:_0x5b50b2[_0xc42d('0x35')];if(_0x56434a[_0xc42d('0x36')][_0xc42d('0x4d')]){_0x432083[_0xc42d('0x4e')]=[{'all':!![]}];}_0x432083=_[_0xc42d('0x43')]({},_0x432083,_0x56434a[_0xc42d('0x46')]);return db[_0xc42d('0x47')][_0xc42d('0x4f')](_0x432083)[_0xc42d('0x2a')](handleEntityNotFound(_0x268b6d,null))[_0xc42d('0x2a')](respondWithResult(_0x268b6d,null))[_0xc42d('0x4a')](handleError(_0x268b6d,null));};exports[_0xc42d('0x50')]=function(_0x4b7b71,_0x2fea1f){return db[_0xc42d('0x47')][_0xc42d('0x50')](_0x4b7b71[_0xc42d('0x51')],{})[_0xc42d('0x2a')](function(_0x13000a){var _0x25c03e=_0x4b7b71[_0xc42d('0x52')][_0xc42d('0x2c')]({'plain':!![]});if(!_0x25c03e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x25c03e['role']===_0xc42d('0x52')){var _0x58eaa4=_0x13000a[_0xc42d('0x2c')]({'plain':!![]});var _0x505d3b=_0xc42d('0x2d');return db[_0xc42d('0x53')][_0xc42d('0x4f')]({'where':{'name':_0x505d3b,'userProfileId':_0x25c03e['userProfileId']},'raw':!![]})[_0xc42d('0x2a')](function(_0x4dd17b){if(_0x4dd17b&&_0x4dd17b[_0xc42d('0x54')]===0x0){return db[_0xc42d('0x2e')][_0xc42d('0x50')]({'name':_0x58eaa4[_0xc42d('0x2f')],'resourceId':_0x58eaa4['id'],'type':_0x4dd17b[_0xc42d('0x2f')],'sectionId':_0x4dd17b['id']},{})[_0xc42d('0x2a')](function(){return _0x13000a;});}else{return _0x13000a;}})[_0xc42d('0x4a')](function(_0xa57d40){logger[_0xc42d('0x55')](_0xc42d('0x56'),_0xa57d40);throw _0xa57d40;});}return _0x13000a;})[_0xc42d('0x2a')](respondWithResult(_0x2fea1f,0xc9))[_0xc42d('0x4a')](handleError(_0x2fea1f,null));};exports[_0xc42d('0x29')]=function(_0x453109,_0x51aaed){if(_0x453109[_0xc42d('0x51')]['id']){delete _0x453109[_0xc42d('0x51')]['id'];}return db['Interval']['find']({'where':{'id':_0x453109[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2a')](handleEntityNotFound(_0x51aaed,null))[_0xc42d('0x2a')](saveUpdates(_0x453109[_0xc42d('0x51')],null))[_0xc42d('0x2a')](respondWithResult(_0x51aaed,null))[_0xc42d('0x4a')](handleError(_0x51aaed,null));};exports[_0xc42d('0x2b')]=function(_0x4b0798,_0x1e5f86){return db['Interval']['find']({'where':{'id':_0x4b0798[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2a')](handleEntityNotFound(_0x1e5f86,null))['then'](removeEntity(_0x1e5f86,null))[_0xc42d('0x4a')](handleError(_0x1e5f86,null));};exports[_0xc42d('0x57')]=function(_0x499d83,_0x4965ad,_0x48f1ba){if(_0x499d83[_0xc42d('0x51')]['id']){delete _0x499d83[_0xc42d('0x51')]['id'];}return db[_0xc42d('0x47')][_0xc42d('0x4f')]({'where':{'id':_0x499d83[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2a')](handleEntityNotFound(_0x4965ad,null))[_0xc42d('0x2a')](function(_0x5b16f3){if(_0x5b16f3){_0x499d83[_0xc42d('0x51')][_0xc42d('0x58')]=_0x5b16f3['id'];return db['Interval'][_0xc42d('0x50')](_0x499d83['body']);}})['then'](respondWithResult(_0x4965ad,null))[_0xc42d('0x4a')](handleError(_0x4965ad,null));};exports[_0xc42d('0x59')]=function(_0x2eab8d,_0x23db1e,_0x3e1785){var _0xd808e1={};var _0xd3f1aa={};var _0x10e0c0;var _0x547cf3;return db['Interval'][_0xc42d('0x5a')]({'where':{'id':_0x2eab8d[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2a')](handleEntityNotFound(_0x23db1e,null))[_0xc42d('0x2a')](function(_0x2215fe){if(_0x2215fe){_0x10e0c0=_0x2215fe;_0xd3f1aa[_0xc42d('0x35')]=_[_0xc42d('0x37')](db[_0xc42d('0x47')][_0xc42d('0x33')]);_0xd3f1aa[_0xc42d('0x36')]=_[_0xc42d('0x37')](_0x2eab8d[_0xc42d('0x36')]);_0xd3f1aa[_0xc42d('0x38')]=_[_0xc42d('0x39')](_0xd3f1aa[_0xc42d('0x35')],_0xd3f1aa[_0xc42d('0x36')]);_0xd808e1[_0xc42d('0x3a')]=_[_0xc42d('0x39')](_0xd3f1aa['model'],qs[_0xc42d('0x3b')](_0x2eab8d['query'][_0xc42d('0x3b')]));_0xd808e1[_0xc42d('0x3a')]=_0xd808e1[_0xc42d('0x3a')][_0xc42d('0x3c')]?_0xd808e1[_0xc42d('0x3a')]:_0xd3f1aa['model'];_0xd808e1[_0xc42d('0x3e')]=qs[_0xc42d('0x3f')](_0x2eab8d[_0xc42d('0x36')]['sort']);_0xd808e1[_0xc42d('0x40')]=qs['filters'](_['pick'](_0x2eab8d[_0xc42d('0x36')],_0xd3f1aa[_0xc42d('0x38')]));if(_0x2eab8d[_0xc42d('0x36')]['filter']){_0xd808e1[_0xc42d('0x40')]=_['merge'](_0xd808e1[_0xc42d('0x40')],{'$or':_[_0xc42d('0x32')](_0xd808e1[_0xc42d('0x3a')],function(_0x4c0e29){var _0x50a574={};_0x50a574[_0x4c0e29]={'$like':'%'+_0x2eab8d[_0xc42d('0x36')][_0xc42d('0x42')]+'%'};return _0x50a574;})});}_0xd808e1=_[_0xc42d('0x43')]({},_0xd808e1,_0x2eab8d[_0xc42d('0x46')]);return _0x10e0c0[_0xc42d('0x59')](_0xd808e1);}})[_0xc42d('0x2a')](function(_0x50ba3e){if(_0x50ba3e){_0x547cf3=_0x50ba3e[_0xc42d('0x3c')];if(!_0x2eab8d[_0xc42d('0x36')][_0xc42d('0x3d')]('nolimit')){_0xd808e1[_0xc42d('0x23')]=qs[_0xc42d('0x23')](_0x2eab8d[_0xc42d('0x36')][_0xc42d('0x23')]);_0xd808e1['offset']=qs[_0xc42d('0x21')](_0x2eab8d[_0xc42d('0x36')][_0xc42d('0x21')]);}return _0x10e0c0[_0xc42d('0x59')](_0xd808e1);}})[_0xc42d('0x2a')](function(_0x1bff16){if(_0x1bff16){return _0x1bff16?{'count':_0x547cf3,'rows':_0x1bff16}:null;}})[_0xc42d('0x2a')](respondWithResult(_0x23db1e,null))['catch'](handleError(_0x23db1e,null));};exports[_0xc42d('0x5b')]=function(_0x1237f0,_0x776cdf,_0x2bae89){return db[_0xc42d('0x47')][_0xc42d('0x5a')]({'where':{'id':_0x1237f0[_0xc42d('0x4c')]['id']}})[_0xc42d('0x2a')](handleEntityNotFound(_0x776cdf,null))[_0xc42d('0x2a')](function(_0x2973f8){if(_0x2973f8){return db[_0xc42d('0x5c')][_0xc42d('0x5d')](function(_0x232524){return db[_0xc42d('0x47')][_0xc42d('0x2b')]({'where':{'IntervalId':_0x1237f0[_0xc42d('0x4c')]['id']},'transaction':_0x232524})['then'](function(_0x175b63){var _0x352b46=_['map'](_0x1237f0['body'],function(_0x4a8703){delete _0x4a8703['id'];_0x4a8703[_0xc42d('0x58')]=_0x1237f0[_0xc42d('0x4c')]['id'];return _0x4a8703;});return db[_0xc42d('0x47')][_0xc42d('0x5e')](_0x352b46,{'transaction':_0x232524});});})['then'](function(){return db[_0xc42d('0x47')][_0xc42d('0x48')]({'where':{'IntervalId':_0x1237f0[_0xc42d('0x4c')]['id']}});});}})[_0xc42d('0x2a')](respondWithResult(_0x776cdf,null))['catch'](handleError(_0x776cdf,null));};
\ No newline at end of file
index 08ef54a..1010b6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3fc=['exports','define','tools_intervals','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xa3fc,0x1c4));var _0xca3f=function(_0x145eff,_0x269003){_0x145eff=_0x145eff-0x0;var _0x1a7a9e=_0xa3fc[_0x145eff];return _0x1a7a9e;};'use strict';var _=require(_0xca3f('0x0'));var util=require(_0xca3f('0x1'));var logger=require(_0xca3f('0x2'))(_0xca3f('0x3'));var moment=require(_0xca3f('0x4'));var BPromise=require(_0xca3f('0x5'));var rp=require(_0xca3f('0x6'));var fs=require('fs');var path=require(_0xca3f('0x7'));var rimraf=require(_0xca3f('0x8'));var config=require(_0xca3f('0x9'));var attributes=require(_0xca3f('0xa'));var extensions=require(_0xca3f('0xb'));module[_0xca3f('0xc')]=function(_0x1623d0,_0x1d596d){return _0x1623d0[_0xca3f('0xd')]('Interval',attributes,{'tableName':_0xca3f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x29feb1,_0x409df4){extensions[_0xca3f('0xf')](_0x1623d0,_0x29feb1);},'afterBulkCreate':function(_0x745dca,_0x53d3d3,_0x14ccd8){_0x14ccd8();extensions[_0xca3f('0xf')](_0x1623d0,_0x745dca[0x0]);},'afterUpdate':function(_0x24988b,_0x22c865){extensions[_0xca3f('0xf')](_0x1623d0,_0x24988b);},'afterDestroy':function(_0x594d61,_0x4d42e0){extensions[_0xca3f('0xf')](_0x1623d0,_0x594d61);}}});};
\ No newline at end of file
+var _0x9152=['Interval','tools_intervals','rewrite','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define'];(function(_0x3fa709,_0x2ddd85){var _0x2a7350=function(_0x360c47){while(--_0x360c47){_0x3fa709['push'](_0x3fa709['shift']());}};_0x2a7350(++_0x2ddd85);}(_0x9152,0x198));var _0x2915=function(_0x170ce1,_0x59f0fd){_0x170ce1=_0x170ce1-0x0;var _0x5d0b27=_0x9152[_0x170ce1];return _0x5d0b27;};'use strict';var _=require(_0x2915('0x0'));var util=require(_0x2915('0x1'));var logger=require(_0x2915('0x2'))('api');var moment=require(_0x2915('0x3'));var BPromise=require(_0x2915('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2915('0x5'));var rimraf=require(_0x2915('0x6'));var config=require(_0x2915('0x7'));var attributes=require(_0x2915('0x8'));var extensions=require(_0x2915('0x9'));module[_0x2915('0xa')]=function(_0x155737,_0x2fc5e3){return _0x155737[_0x2915('0xb')](_0x2915('0xc'),attributes,{'tableName':_0x2915('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x27db52,_0x4f9482){extensions[_0x2915('0xe')](_0x155737,_0x27db52);},'afterBulkCreate':function(_0x128da7,_0x4baba5,_0x1e0005){_0x1e0005();extensions[_0x2915('0xe')](_0x155737,_0x128da7[0x0]);},'afterUpdate':function(_0x21fb4c,_0x49362e){extensions['rewrite'](_0x155737,_0x21fb4c);},'afterDestroy':function(_0x2f2fcf,_0x4a790d){extensions[_0x2915('0xe')](_0x155737,_0x2f2fcf);}}});};
\ No newline at end of file
index afaa946..30661c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});};
\ No newline at end of file
+var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0xa1e3ca,_0x559022){var _0x5005ab=function(_0x12f90e){while(--_0x12f90e){_0xa1e3ca['push'](_0xa1e3ca['shift']());}};_0x5005ab(++_0x559022);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});};
\ No newline at end of file
index be641c4..4be527d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x38fe7b,_0x54988e){var _0x3492ac=function(_0xf59376){while(--_0xf59376){_0x38fe7b['push'](_0x38fe7b['shift']());}};_0x3492ac(++_0x54988e);}(_0xadb5,0xad));var _0x5adb=function(_0x201a28,_0x42c3ab){_0x201a28=_0x201a28-0x0;var _0x4c777d=_0xadb5[_0x201a28];return _0x4c777d;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router;
\ No newline at end of file
+var _0x5f2f=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x48725a,_0x578535){var _0x40f856=function(_0x2726da){while(--_0x2726da){_0x48725a['push'](_0x48725a['shift']());}};_0x40f856(++_0x578535);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4f9b88,_0x39065a){_0x4f9b88=_0x4f9b88-0x0;var _0x2521aa=_0x5f2f[_0x4f9b88];return _0x2521aa;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);module[_0xf5f2('0x7')]=router;
\ No newline at end of file
index 0dd60b8..00c0f74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfbc1=['headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','support','key','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','setEncoding','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','body'];(function(_0x3def57,_0x11b288){var _0x3099a6=function(_0x475a79){while(--_0x475a79){_0x3def57['push'](_0x3def57['shift']());}};_0x3099a6(++_0x11b288);}(_0xfbc1,0x101));var _0x1fbc=function(_0x1fc4e2,_0x493c3b){_0x1fc4e2=_0x1fc4e2-0x0;var _0x2ba184=_0xfbc1[_0x1fc4e2];return _0x2ba184;};'use strict';var BPromise=require(_0x1fbc('0x0'));var https=require('https');var logger=require('../../config/logger')('api');var USERNAME=_0x1fbc('0x1');var PASSWORD='3eAmWpBVP0';function openIssue(_0x4be57f,_0xbaad4f){var _0x54e649={'fields':{'project':{'key':_0x4be57f[_0x1fbc('0x2')]||'MOTGUI'},'summary':(_0x4be57f['summary']||_0x1fbc('0x3'))+_0x1fbc('0x4')+_0x4be57f['ip'],'description':_0x4be57f[_0x1fbc('0x5')]||JSON[_0x1fbc('0x6')](_0x4be57f),'issuetype':{'name':_0x4be57f[_0x1fbc('0x7')]||_0x1fbc('0x8')}}};_0x54e649[_0x1fbc('0x9')][_0x1fbc('0xa')]=_0x4be57f['email'];_0x54e649[_0x1fbc('0x9')][_0x1fbc('0xb')]=_0x4be57f['oldToken'];_0x54e649['fields'][_0x1fbc('0xc')]=_0x4be57f[_0x1fbc('0xd')];_0x54e649[_0x1fbc('0x9')][_0x1fbc('0xe')]=_0x4be57f[_0x1fbc('0xf')];_0x54e649[_0x1fbc('0x9')][_0x1fbc('0x10')]=_0x4be57f[_0x1fbc('0x11')];_0x54e649[_0x1fbc('0x9')][_0x1fbc('0x12')]=_0x4be57f['ip'];var _0x2af073={'host':_0x1fbc('0x13'),'port':0x1bb,'path':_0x1fbc('0x14'),'method':_0x1fbc('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x1fbc('0x16'),'Authorization':_0x1fbc('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x1fbc('0x18')](_0x1fbc('0x19'))}};var _0x43f036=JSON[_0x1fbc('0x6')](_0x54e649);var _0x5f1e49=https['request'](_0x2af073,function(_0x2e38e4){_0x2e38e4[_0x1fbc('0x1a')]('utf8');var _0x31643a='';_0x2e38e4['on'](_0x1fbc('0x1b'),function(_0xdedac){_0x31643a+=_0xdedac;});_0x2e38e4['on'](_0x1fbc('0x1c'),function(){if(_0xbaad4f){return _0xbaad4f[_0x1fbc('0x1d')](_0x2e38e4['statusCode'])[_0x1fbc('0x1e')](JSON[_0x1fbc('0x1f')](_0x31643a));}});});_0x5f1e49['on'](_0x1fbc('0x20'),function(_0x5ad5c4){if(_0xbaad4f){return _0xbaad4f[_0x1fbc('0x1d')](0x1f4)[_0x1fbc('0x1e')]({'errors':[{'message':_0x1fbc('0x21'),'type':_0x1fbc('0x22')}]});}});_0x5f1e49[_0x1fbc('0x23')](_0x43f036);_0x5f1e49[_0x1fbc('0x1c')]();}exports['openIssue']=openIssue;exports['send']=function(_0x236c6e,_0x3c9369){_0x236c6e[_0x1fbc('0x24')]['ip']=_0x236c6e[_0x1fbc('0x25')][_0x1fbc('0x26')]||_0x236c6e[_0x1fbc('0x27')][_0x1fbc('0x28')]||_0x236c6e[_0x1fbc('0x29')][_0x1fbc('0x28')]||_0x236c6e[_0x1fbc('0x27')][_0x1fbc('0x29')]['remoteAddress'];return openIssue(_0x236c6e[_0x1fbc('0x24')],_0x3c9369);};
\ No newline at end of file
+var _0x2ed0=['request','setEncoding','utf8','data','end','status','statusCode','json','parse','error','api.jira','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','customfield_11503','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x2ed0,0x1f4));var _0x02ed=function(_0x4e89dd,_0x42a780){_0x4e89dd=_0x4e89dd-0x0;var _0x13ef0c=_0x2ed0[_0x4e89dd];return _0x13ef0c;};'use strict';var BPromise=require(_0x02ed('0x0'));var https=require('https');var logger=require(_0x02ed('0x1'))('api');var USERNAME=_0x02ed('0x2');var PASSWORD=_0x02ed('0x3');function openIssue(_0x46c8a4,_0x5c1a90){var _0x55cbd1={'fields':{'project':{'key':_0x46c8a4[_0x02ed('0x4')]||_0x02ed('0x5')},'summary':(_0x46c8a4[_0x02ed('0x6')]||_0x02ed('0x7'))+_0x02ed('0x8')+_0x46c8a4['ip'],'description':_0x46c8a4[_0x02ed('0x9')]||JSON[_0x02ed('0xa')](_0x46c8a4),'issuetype':{'name':_0x46c8a4[_0x02ed('0xb')]||_0x02ed('0xc')}}};_0x55cbd1[_0x02ed('0xd')][_0x02ed('0xe')]=_0x46c8a4[_0x02ed('0xf')];_0x55cbd1[_0x02ed('0xd')][_0x02ed('0x10')]=_0x46c8a4[_0x02ed('0x11')];_0x55cbd1[_0x02ed('0xd')][_0x02ed('0x12')]=_0x46c8a4['newToken'];_0x55cbd1[_0x02ed('0xd')][_0x02ed('0x13')]=_0x46c8a4['name'];_0x55cbd1[_0x02ed('0xd')][_0x02ed('0x14')]=_0x46c8a4[_0x02ed('0x15')];_0x55cbd1[_0x02ed('0xd')][_0x02ed('0x16')]=_0x46c8a4['ip'];var _0x1d4dd4={'host':_0x02ed('0x17'),'port':0x1bb,'path':_0x02ed('0x18'),'method':_0x02ed('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0x02ed('0x1a'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x02ed('0x1b')]('base64')}};var _0x54abc5=JSON[_0x02ed('0xa')](_0x55cbd1);var _0x190933=https[_0x02ed('0x1c')](_0x1d4dd4,function(_0x279d01){_0x279d01[_0x02ed('0x1d')](_0x02ed('0x1e'));var _0x3ce651='';_0x279d01['on'](_0x02ed('0x1f'),function(_0xf8ee7b){_0x3ce651+=_0xf8ee7b;});_0x279d01['on'](_0x02ed('0x20'),function(){if(_0x5c1a90){return _0x5c1a90[_0x02ed('0x21')](_0x279d01[_0x02ed('0x22')])[_0x02ed('0x23')](JSON[_0x02ed('0x24')](_0x3ce651));}});});_0x190933['on'](_0x02ed('0x25'),function(_0x200242){if(_0x5c1a90){return _0x5c1a90['status'](0x1f4)[_0x02ed('0x23')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x02ed('0x26')}]});}});_0x190933['write'](_0x54abc5);_0x190933[_0x02ed('0x20')]();}exports['openIssue']=openIssue;exports['send']=function(_0xbc9069,_0x47c83d){_0xbc9069['body']['ip']=_0xbc9069[_0x02ed('0x27')][_0x02ed('0x28')]||_0xbc9069[_0x02ed('0x29')]['remoteAddress']||_0xbc9069['socket'][_0x02ed('0x2a')]||_0xbc9069[_0x02ed('0x29')][_0x02ed('0x2b')][_0x02ed('0x2a')];return openIssue(_0xbc9069['body'],_0x47c83d);};
\ No newline at end of file
index c51ee50..08bc7a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports'];(function(_0x26ed77,_0x5d3145){var _0x33ef92=function(_0x1c5ec0){while(--_0x1c5ec0){_0x26ed77['push'](_0x26ed77['shift']());}};_0x33ef92(++_0x5d3145);}(_0xedd9,0xfc));var _0x9edd=function(_0x50ab4f,_0x17ed0f){_0x50ab4f=_0x50ab4f-0x0;var _0x41b58b=_0xedd9[_0x50ab4f];return _0x41b58b;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router['delete'](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x13')]);module[_0x9edd('0x14')]=router;
\ No newline at end of file
+var _0xf4eb=['./jscriptyAnswerReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','Router','../../components/interaction/service','../../config/environment'];(function(_0xf77fc1,_0x1b5f46){var _0xf8faa7=function(_0x23a364){while(--_0x23a364){_0xf77fc1['push'](_0xf77fc1['shift']());}};_0xf8faa7(++_0x1b5f46);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4ef061,_0x5b3fd4){_0x4ef061=_0x4ef061-0x0;var _0x3a21ea=_0xf4eb[_0x4ef061];return _0x3a21ea;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf4e('0x2'));var config=require(_0xbf4e('0x3'));var controller=require(_0xbf4e('0x4'));router[_0xbf4e('0x5')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x7')]);router[_0xbf4e('0x5')]('/describe',auth[_0xbf4e('0x6')](),controller['describe']);router['get'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller[_0xbf4e('0x9')]);router[_0xbf4e('0xa')]('/',auth[_0xbf4e('0x6')](),controller[_0xbf4e('0xb')]);router[_0xbf4e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xbf4e('0xd')]);router['delete'](_0xbf4e('0x8'),auth[_0xbf4e('0x6')](),controller['destroy']);module[_0xbf4e('0xe')]=router;
\ No newline at end of file
index 00ef71d..21caa71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x7a54,0x106));var _0x47a5=function(_0x2ccdf9,_0x52b94a){_0x2ccdf9=_0x2ccdf9-0x0;var _0x3c60fc=_0x7a54[_0x2ccdf9];return _0x3c60fc;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x496afc,_0x11062b){_0x496afc=_0x496afc-0x0;var _0x3e19ac=_0x7a54[_0x496afc];return _0x3e19ac;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index 52b7361..e23c98b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda19=['rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','JscriptyAnswerReport','includeAll','findAll','catch','show','body','find','params','describe'];(function(_0x1b71ee,_0x1a77e5){var _0x3a98ac=function(_0x1e6d40){while(--_0x1e6d40){_0x1b71ee['push'](_0x1b71ee['shift']());}};_0x3a98ac(++_0x1a77e5);}(_0xda19,0xd5));var _0x9da1=function(_0x37f1c1,_0x1e2983){_0x37f1c1=_0x37f1c1-0x0;var _0x3a8138=_0xda19[_0x37f1c1];return _0x3a8138;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da1('0x0'));var zipdir=require(_0x9da1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9da1('0x2'));var moment=require('moment');var BPromise=require(_0x9da1('0x3'));var Mustache=require('mustache');var util=require(_0x9da1('0x4'));var path=require(_0x9da1('0x5'));var sox=require(_0x9da1('0x6'));var csv=require(_0x9da1('0x7'));var ejs=require(_0x9da1('0x8'));var fs=require('fs');var fs_extra=require(_0x9da1('0x9'));var _=require(_0x9da1('0xa'));var squel=require(_0x9da1('0xb'));var crypto=require(_0x9da1('0xc'));var jsforce=require(_0x9da1('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9da1('0xe'));var Redis=require('ioredis');var authService=require(_0x9da1('0xf'));var qs=require(_0x9da1('0x10'));var as=require(_0x9da1('0x11'));var hardwareService=require(_0x9da1('0x12'));var logger=require(_0x9da1('0x13'))(_0x9da1('0x14'));var utils=require(_0x9da1('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9da1('0x16'))['db'];function respondWithStatusCode(_0x596b6b,_0x4735c7){_0x4735c7=_0x4735c7||0xcc;return function(_0x1d93f8){if(_0x1d93f8){return _0x596b6b[_0x9da1('0x17')](_0x4735c7);}return _0x596b6b[_0x9da1('0x18')](_0x4735c7)['end']();};}function respondWithResult(_0x2837e3,_0x535a13){_0x535a13=_0x535a13||0xc8;return function(_0x4d17e1){if(_0x4d17e1){return _0x2837e3[_0x9da1('0x18')](_0x535a13)['json'](_0x4d17e1);}};}function respondWithFilteredResult(_0x433ff4,_0x43c093){return function(_0x37653d){if(_0x37653d){var _0x1a1a6b=typeof _0x43c093[_0x9da1('0x19')]==='undefined'&&typeof _0x43c093[_0x9da1('0x1a')]===_0x9da1('0x1b');var _0xf83bf8=_0x37653d[_0x9da1('0x1c')];var _0xfb278d=_0x1a1a6b?0x0:_0x43c093[_0x9da1('0x19')];var _0x497676=_0x1a1a6b?_0x37653d['count']:_0x43c093[_0x9da1('0x19')]+_0x43c093[_0x9da1('0x1a')];var _0x1b0e7f;if(_0x497676>=_0xf83bf8){_0x497676=_0xf83bf8;_0x1b0e7f=0xc8;}else{_0x1b0e7f=0xce;}_0x433ff4[_0x9da1('0x18')](_0x1b0e7f);return _0x433ff4[_0x9da1('0x1d')](_0x9da1('0x1e'),_0xfb278d+'-'+_0x497676+'/'+_0xf83bf8)[_0x9da1('0x1f')](_0x37653d);}return null;};}function patchUpdates(_0x47e5cf){return function(_0x1a459c){try{jsonpatch[_0x9da1('0x20')](_0x1a459c,_0x47e5cf,!![]);}catch(_0x9c3b37){return BPromise[_0x9da1('0x21')](_0x9c3b37);}return _0x1a459c[_0x9da1('0x22')]();};}function saveUpdates(_0x4e9d7d,_0x5454d3){return function(_0x14793b){if(_0x14793b){return _0x14793b[_0x9da1('0x23')](_0x4e9d7d)[_0x9da1('0x24')](function(_0x330219){return _0x330219;});}return null;};}function removeEntity(_0x32eb55,_0x165b73){return function(_0x4c60aa){if(_0x4c60aa){return _0x4c60aa[_0x9da1('0x25')]()[_0x9da1('0x24')](function(){_0x32eb55['status'](0xcc)[_0x9da1('0x26')]();});}};}function handleEntityNotFound(_0x3f5680,_0x534210){return function(_0x2fd49c){if(!_0x2fd49c){_0x3f5680[_0x9da1('0x17')](0x194);}return _0x2fd49c;};}function handleError(_0x4b1152,_0x36b87a){_0x36b87a=_0x36b87a||0x1f4;return function(_0x1d6af5){logger['error'](_0x1d6af5['stack']);if(_0x1d6af5[_0x9da1('0x27')]){delete _0x1d6af5[_0x9da1('0x27')];}_0x4b1152['status'](_0x36b87a)[_0x9da1('0x28')](_0x1d6af5);};}exports['index']=function(_0x5a6f2d,_0x5a59c2){var _0x31b826={},_0x404b86={},_0x24c6d5={'count':0x0,'rows':[]};var _0x26dd58=_[_0x9da1('0x29')](db['JscriptyAnswerReport'][_0x9da1('0x2a')],function(_0x4e6083){return{'name':_0x4e6083[_0x9da1('0x2b')],'type':_0x4e6083[_0x9da1('0x2c')]['key']};});_0x404b86[_0x9da1('0x2d')]=_[_0x9da1('0x29')](_0x26dd58,'name');_0x404b86[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x5a6f2d[_0x9da1('0x2e')]);_0x404b86[_0x9da1('0x30')]=_['intersection'](_0x404b86['model'],_0x404b86[_0x9da1('0x2e')]);_0x31b826[_0x9da1('0x31')]=_[_0x9da1('0x32')](_0x404b86[_0x9da1('0x2d')],qs[_0x9da1('0x33')](_0x5a6f2d['query'][_0x9da1('0x33')]));_0x31b826[_0x9da1('0x31')]=_0x31b826[_0x9da1('0x31')][_0x9da1('0x34')]?_0x31b826[_0x9da1('0x31')]:_0x404b86[_0x9da1('0x2d')];if(!_0x5a6f2d['query'][_0x9da1('0x35')]('nolimit')){_0x31b826['limit']=qs[_0x9da1('0x1a')](_0x5a6f2d['query'][_0x9da1('0x1a')]);_0x31b826[_0x9da1('0x19')]=qs[_0x9da1('0x19')](_0x5a6f2d[_0x9da1('0x2e')][_0x9da1('0x19')]);}_0x31b826[_0x9da1('0x36')]=qs[_0x9da1('0x37')](_0x5a6f2d[_0x9da1('0x2e')]['sort']);_0x31b826[_0x9da1('0x38')]=qs['filters'](_[_0x9da1('0x39')](_0x5a6f2d['query'],_0x404b86['filters']),_0x26dd58);if(_0x5a6f2d[_0x9da1('0x2e')]['filter']){_0x31b826[_0x9da1('0x38')]=_[_0x9da1('0x3a')](_0x31b826['where'],{'$or':_[_0x9da1('0x29')](_0x26dd58,function(_0x1b750f){if(_0x1b750f[_0x9da1('0x2c')]!==_0x9da1('0x3b')){var _0x56bd49={};_0x56bd49[_0x1b750f[_0x9da1('0x27')]]={'$like':'%'+_0x5a6f2d['query'][_0x9da1('0x3c')]+'%'};return _0x56bd49;}})});}_0x31b826=_['merge']({},_0x31b826,_0x5a6f2d[_0x9da1('0x3d')]);var _0x46c176={'where':_0x31b826['where']};return db[_0x9da1('0x3e')][_0x9da1('0x1c')](_0x46c176)[_0x9da1('0x24')](function(_0x4e9af3){_0x24c6d5['count']=_0x4e9af3;if(_0x5a6f2d['query'][_0x9da1('0x3f')]){_0x31b826['include']=[{'all':!![]}];}return db[_0x9da1('0x3e')][_0x9da1('0x40')](_0x31b826);})[_0x9da1('0x24')](function(_0x43c064){_0x24c6d5['rows']=_0x43c064;return _0x24c6d5;})[_0x9da1('0x24')](respondWithFilteredResult(_0x5a59c2,_0x31b826))[_0x9da1('0x41')](handleError(_0x5a59c2,null));};exports[_0x9da1('0x42')]=function(_0x173dc6,_0x28fc88){var _0x26c225={'raw':!![],'where':{'id':_0x173dc6['params']['id']}},_0x28e0b2={};_0x28e0b2[_0x9da1('0x2d')]=_['keys'](db[_0x9da1('0x3e')]['rawAttributes']);_0x28e0b2[_0x9da1('0x2e')]=_[_0x9da1('0x2f')](_0x173dc6['query']);_0x28e0b2[_0x9da1('0x30')]=_[_0x9da1('0x32')](_0x28e0b2['model'],_0x28e0b2[_0x9da1('0x2e')]);_0x26c225['attributes']=_[_0x9da1('0x32')](_0x28e0b2[_0x9da1('0x2d')],qs['fields'](_0x173dc6['query'][_0x9da1('0x33')]));_0x26c225[_0x9da1('0x31')]=_0x26c225[_0x9da1('0x31')][_0x9da1('0x34')]?_0x26c225[_0x9da1('0x31')]:_0x28e0b2[_0x9da1('0x2d')];if(_0x173dc6[_0x9da1('0x2e')][_0x9da1('0x3f')]){_0x26c225['include']=[{'all':!![]}];}_0x26c225=_[_0x9da1('0x3a')]({},_0x26c225,_0x173dc6[_0x9da1('0x3d')]);return db[_0x9da1('0x3e')]['find'](_0x26c225)[_0x9da1('0x24')](handleEntityNotFound(_0x28fc88,null))[_0x9da1('0x24')](respondWithResult(_0x28fc88,null))[_0x9da1('0x41')](handleError(_0x28fc88,null));};exports['create']=function(_0x336fc3,_0x351d4d){return db[_0x9da1('0x3e')]['create'](_0x336fc3[_0x9da1('0x43')],{})['then'](respondWithResult(_0x351d4d,0xc9))['catch'](handleError(_0x351d4d,null));};exports[_0x9da1('0x23')]=function(_0x43c47d,_0x5afbc7){if(_0x43c47d[_0x9da1('0x43')]['id']){delete _0x43c47d[_0x9da1('0x43')]['id'];}return db['JscriptyAnswerReport'][_0x9da1('0x44')]({'where':{'id':_0x43c47d[_0x9da1('0x45')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x5afbc7,null))[_0x9da1('0x24')](saveUpdates(_0x43c47d[_0x9da1('0x43')],null))[_0x9da1('0x24')](respondWithResult(_0x5afbc7,null))[_0x9da1('0x41')](handleError(_0x5afbc7,null));};exports[_0x9da1('0x25')]=function(_0x3889f4,_0x5c9b46){return db[_0x9da1('0x3e')][_0x9da1('0x44')]({'where':{'id':_0x3889f4[_0x9da1('0x45')]['id']}})[_0x9da1('0x24')](handleEntityNotFound(_0x5c9b46,null))['then'](removeEntity(_0x5c9b46,null))['catch'](handleError(_0x5c9b46,null));};exports[_0x9da1('0x46')]=function(_0x6ca1ac,_0x3870dd){return db[_0x9da1('0x3e')][_0x9da1('0x46')]()[_0x9da1('0x24')](respondWithResult(_0x3870dd,null))[_0x9da1('0x41')](handleError(_0x3870dd,null));};
\ No newline at end of file
+var _0xf987=['attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','catch','show','params','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','model','keys','filters','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf987,0x18a));var _0x7f98=function(_0x4735d9,_0x11db6f){_0x4735d9=_0x4735d9-0x0;var _0x2ee54e=_0xf987[_0x4735d9];return _0x2ee54e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7f98('0x0'));var jsonpatch=require(_0x7f98('0x1'));var rp=require('request-promise');var moment=require(_0x7f98('0x2'));var BPromise=require(_0x7f98('0x3'));var Mustache=require(_0x7f98('0x4'));var util=require(_0x7f98('0x5'));var path=require(_0x7f98('0x6'));var sox=require(_0x7f98('0x7'));var csv=require(_0x7f98('0x8'));var ejs=require(_0x7f98('0x9'));var fs=require('fs');var fs_extra=require(_0x7f98('0xa'));var _=require(_0x7f98('0xb'));var squel=require(_0x7f98('0xc'));var crypto=require(_0x7f98('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7f98('0xe'));var toCsv=require(_0x7f98('0x8'));var querystring=require(_0x7f98('0xf'));var Papa=require(_0x7f98('0x10'));var Redis=require(_0x7f98('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7f98('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f98('0x13'))(_0x7f98('0x14'));var utils=require(_0x7f98('0x15'));var config=require(_0x7f98('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f98('0x17'))['db'];function respondWithStatusCode(_0x4c4ae9,_0x9c2633){_0x9c2633=_0x9c2633||0xcc;return function(_0x2c26d8){if(_0x2c26d8){return _0x4c4ae9[_0x7f98('0x18')](_0x9c2633);}return _0x4c4ae9[_0x7f98('0x19')](_0x9c2633)[_0x7f98('0x1a')]();};}function respondWithResult(_0x11b1f8,_0x33108e){_0x33108e=_0x33108e||0xc8;return function(_0x3044d4){if(_0x3044d4){return _0x11b1f8[_0x7f98('0x19')](_0x33108e)[_0x7f98('0x1b')](_0x3044d4);}};}function respondWithFilteredResult(_0x2d366a,_0x1fa829){return function(_0x5e3bb5){if(_0x5e3bb5){var _0xcab406=typeof _0x1fa829['offset']==='undefined'&&typeof _0x1fa829[_0x7f98('0x1c')]===_0x7f98('0x1d');var _0x585a1a=_0x5e3bb5['count'];var _0x5f27dd=_0xcab406?0x0:_0x1fa829['offset'];var _0x111385=_0xcab406?_0x5e3bb5[_0x7f98('0x1e')]:_0x1fa829['offset']+_0x1fa829['limit'];var _0x4f3ac0;if(_0x111385>=_0x585a1a){_0x111385=_0x585a1a;_0x4f3ac0=0xc8;}else{_0x4f3ac0=0xce;}_0x2d366a[_0x7f98('0x19')](_0x4f3ac0);return _0x2d366a['set'](_0x7f98('0x1f'),_0x5f27dd+'-'+_0x111385+'/'+_0x585a1a)[_0x7f98('0x1b')](_0x5e3bb5);}return null;};}function patchUpdates(_0x3e78e2){return function(_0x446dd5){try{jsonpatch[_0x7f98('0x20')](_0x446dd5,_0x3e78e2,!![]);}catch(_0x1f2e6c){return BPromise[_0x7f98('0x21')](_0x1f2e6c);}return _0x446dd5[_0x7f98('0x22')]();};}function saveUpdates(_0x20ad36,_0x53c1ef){return function(_0x55189b){if(_0x55189b){return _0x55189b[_0x7f98('0x23')](_0x20ad36)['then'](function(_0xf39ff1){return _0xf39ff1;});}return null;};}function removeEntity(_0x2d9e09,_0x51eca3){return function(_0x417ad4){if(_0x417ad4){return _0x417ad4[_0x7f98('0x24')]()['then'](function(){_0x2d9e09[_0x7f98('0x19')](0xcc)[_0x7f98('0x1a')]();});}};}function handleEntityNotFound(_0x1d6bdb,_0x1a5788){return function(_0x3e1cd5){if(!_0x3e1cd5){_0x1d6bdb[_0x7f98('0x18')](0x194);}return _0x3e1cd5;};}function handleError(_0x2b58d0,_0x8b27a4){_0x8b27a4=_0x8b27a4||0x1f4;return function(_0x1d086f){logger[_0x7f98('0x25')](_0x1d086f[_0x7f98('0x26')]);if(_0x1d086f[_0x7f98('0x27')]){delete _0x1d086f[_0x7f98('0x27')];}_0x2b58d0['status'](_0x8b27a4)['send'](_0x1d086f);};}exports[_0x7f98('0x28')]=function(_0x2122f4,_0x186519){var _0x1dd8d5={},_0xc8f69f={},_0x16a8cb={'count':0x0,'rows':[]};var _0x20ff8d=_[_0x7f98('0x29')](db[_0x7f98('0x2a')][_0x7f98('0x2b')],function(_0x544bae){return{'name':_0x544bae[_0x7f98('0x2c')],'type':_0x544bae[_0x7f98('0x2d')]['key']};});_0xc8f69f[_0x7f98('0x2e')]=_[_0x7f98('0x29')](_0x20ff8d,_0x7f98('0x27'));_0xc8f69f['query']=_[_0x7f98('0x2f')](_0x2122f4['query']);_0xc8f69f[_0x7f98('0x30')]=_['intersection'](_0xc8f69f[_0x7f98('0x2e')],_0xc8f69f[_0x7f98('0x31')]);_0x1dd8d5[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0xc8f69f[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x2122f4[_0x7f98('0x31')]['fields']));_0x1dd8d5['attributes']=_0x1dd8d5[_0x7f98('0x32')][_0x7f98('0x35')]?_0x1dd8d5[_0x7f98('0x32')]:_0xc8f69f[_0x7f98('0x2e')];if(!_0x2122f4[_0x7f98('0x31')][_0x7f98('0x36')](_0x7f98('0x37'))){_0x1dd8d5['limit']=qs['limit'](_0x2122f4[_0x7f98('0x31')]['limit']);_0x1dd8d5[_0x7f98('0x38')]=qs['offset'](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x38')]);}_0x1dd8d5[_0x7f98('0x39')]=qs[_0x7f98('0x3a')](_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3a')]);_0x1dd8d5[_0x7f98('0x3b')]=qs[_0x7f98('0x30')](_[_0x7f98('0x3c')](_0x2122f4[_0x7f98('0x31')],_0xc8f69f[_0x7f98('0x30')]),_0x20ff8d);if(_0x2122f4[_0x7f98('0x31')][_0x7f98('0x3d')]){_0x1dd8d5[_0x7f98('0x3b')]=_[_0x7f98('0x3e')](_0x1dd8d5[_0x7f98('0x3b')],{'$or':_[_0x7f98('0x29')](_0x20ff8d,function(_0x45f280){if(_0x45f280[_0x7f98('0x2d')]!==_0x7f98('0x3f')){var _0x1b82cc={};_0x1b82cc[_0x45f280[_0x7f98('0x27')]]={'$like':'%'+_0x2122f4[_0x7f98('0x31')]['filter']+'%'};return _0x1b82cc;}})});}_0x1dd8d5=_[_0x7f98('0x3e')]({},_0x1dd8d5,_0x2122f4[_0x7f98('0x40')]);var _0x57a855={'where':_0x1dd8d5[_0x7f98('0x3b')]};return db['JscriptyAnswerReport']['count'](_0x57a855)[_0x7f98('0x41')](function(_0x24bbdc){_0x16a8cb['count']=_0x24bbdc;if(_0x2122f4[_0x7f98('0x31')]['includeAll']){_0x1dd8d5['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x7f98('0x42')](_0x1dd8d5);})['then'](function(_0x2ab479){_0x16a8cb['rows']=_0x2ab479;return _0x16a8cb;})[_0x7f98('0x41')](respondWithFilteredResult(_0x186519,_0x1dd8d5))[_0x7f98('0x43')](handleError(_0x186519,null));};exports[_0x7f98('0x44')]=function(_0x1d53eb,_0x48ede9){var _0x55a8cc={'raw':!![],'where':{'id':_0x1d53eb[_0x7f98('0x45')]['id']}},_0x5b8fef={};_0x5b8fef[_0x7f98('0x2e')]=_['keys'](db['JscriptyAnswerReport'][_0x7f98('0x2b')]);_0x5b8fef[_0x7f98('0x31')]=_[_0x7f98('0x2f')](_0x1d53eb[_0x7f98('0x31')]);_0x5b8fef[_0x7f98('0x30')]=_[_0x7f98('0x33')](_0x5b8fef['model'],_0x5b8fef[_0x7f98('0x31')]);_0x55a8cc[_0x7f98('0x32')]=_[_0x7f98('0x33')](_0x5b8fef[_0x7f98('0x2e')],qs[_0x7f98('0x34')](_0x1d53eb[_0x7f98('0x31')][_0x7f98('0x34')]));_0x55a8cc[_0x7f98('0x32')]=_0x55a8cc[_0x7f98('0x32')][_0x7f98('0x35')]?_0x55a8cc[_0x7f98('0x32')]:_0x5b8fef[_0x7f98('0x2e')];if(_0x1d53eb['query']['includeAll']){_0x55a8cc['include']=[{'all':!![]}];}_0x55a8cc=_[_0x7f98('0x3e')]({},_0x55a8cc,_0x1d53eb[_0x7f98('0x40')]);return db['JscriptyAnswerReport'][_0x7f98('0x46')](_0x55a8cc)[_0x7f98('0x41')](handleEntityNotFound(_0x48ede9,null))[_0x7f98('0x41')](respondWithResult(_0x48ede9,null))[_0x7f98('0x43')](handleError(_0x48ede9,null));};exports[_0x7f98('0x47')]=function(_0x83db32,_0x157723){return db[_0x7f98('0x2a')][_0x7f98('0x47')](_0x83db32['body'],{})[_0x7f98('0x41')](respondWithResult(_0x157723,0xc9))[_0x7f98('0x43')](handleError(_0x157723,null));};exports[_0x7f98('0x23')]=function(_0x32e242,_0x3396a7){if(_0x32e242['body']['id']){delete _0x32e242[_0x7f98('0x48')]['id'];}return db[_0x7f98('0x2a')]['find']({'where':{'id':_0x32e242[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3396a7,null))[_0x7f98('0x41')](saveUpdates(_0x32e242[_0x7f98('0x48')],null))['then'](respondWithResult(_0x3396a7,null))[_0x7f98('0x43')](handleError(_0x3396a7,null));};exports['destroy']=function(_0x513c2f,_0x3467ad){return db[_0x7f98('0x2a')][_0x7f98('0x46')]({'where':{'id':_0x513c2f[_0x7f98('0x45')]['id']}})[_0x7f98('0x41')](handleEntityNotFound(_0x3467ad,null))[_0x7f98('0x41')](removeEntity(_0x3467ad,null))[_0x7f98('0x43')](handleError(_0x3467ad,null));};exports[_0x7f98('0x49')]=function(_0x3b268d,_0x203a53){return db['JscriptyAnswerReport'][_0x7f98('0x49')]()[_0x7f98('0x41')](respondWithResult(_0x203a53,null))[_0x7f98('0x43')](handleError(_0x203a53,null));};
\ No newline at end of file
index 6e294a3..f13df37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x843c=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','util'];(function(_0x5a5276,_0x262d69){var _0x3e8ee2=function(_0x151ce3){while(--_0x151ce3){_0x5a5276['push'](_0x5a5276['shift']());}};_0x3e8ee2(++_0x262d69);}(_0x843c,0x173));var _0xc843=function(_0x29ece4,_0x5360c1){_0x29ece4=_0x29ece4-0x0;var _0x503ce0=_0x843c[_0x29ece4];return _0x503ce0;};'use strict';var _=require('lodash');var util=require(_0xc843('0x0'));var logger=require(_0xc843('0x1'))(_0xc843('0x2'));var moment=require(_0xc843('0x3'));var BPromise=require(_0xc843('0x4'));var rp=require(_0xc843('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc843('0x6'));var config=require(_0xc843('0x7'));var attributes=require(_0xc843('0x8'));module[_0xc843('0x9')]=function(_0x10f40f,_0x339da5){return _0x10f40f[_0xc843('0xa')]('JscriptyAnswerReport',attributes,{'tableName':_0xc843('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6d05=['path','rimraf','../../config/environment','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','moment','bluebird'];(function(_0x2f6b7d,_0x2868ce){var _0x3de713=function(_0x7a9410){while(--_0x7a9410){_0x2f6b7d['push'](_0x2f6b7d['shift']());}};_0x3de713(++_0x2868ce);}(_0x6d05,0xd4));var _0x56d0=function(_0x3a4488,_0x40055a){_0x3a4488=_0x3a4488-0x0;var _0x314e18=_0x6d05[_0x3a4488];return _0x314e18;};'use strict';var _=require('lodash');var util=require(_0x56d0('0x0'));var logger=require(_0x56d0('0x1'))('api');var moment=require(_0x56d0('0x2'));var BPromise=require(_0x56d0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56d0('0x4'));var rimraf=require(_0x56d0('0x5'));var config=require(_0x56d0('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x518a61,_0x39fb85){return _0x518a61['define'](_0x56d0('0x7'),attributes,{'tableName':_0x56d0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9438a2f..d75da33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d07=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x4b8232,_0x5ce9f0){var _0x3664b2=function(_0x339254){while(--_0x339254){_0x4b8232['push'](_0x4b8232['shift']());}};_0x3664b2(++_0x5ce9f0);}(_0x4d07,0x103));var _0x74d0=function(_0x5c0b14,_0x383089){_0x5c0b14=_0x5c0b14-0x0;var _0x2f4b18=_0x4d07[_0x5c0b14];return _0x2f4b18;};'use strict';var _=require(_0x74d0('0x0'));var util=require(_0x74d0('0x1'));var moment=require(_0x74d0('0x2'));var BPromise=require(_0x74d0('0x3'));var rs=require(_0x74d0('0x4'));var fs=require('fs');var Redis=require(_0x74d0('0x5'));var db=require(_0x74d0('0x6'))['db'];var utils=require(_0x74d0('0x7'));var logger=require(_0x74d0('0x8'))(_0x74d0('0x9'));var config=require(_0x74d0('0xa'));var jayson=require(_0x74d0('0xb'));var client=jayson[_0x74d0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x116577,_0x1edad8,_0x5eabf1){return new BPromise(function(_0x430a27,_0x44db65){return client[_0x74d0('0xd')](_0x116577,_0x5eabf1)[_0x74d0('0xe')](function(_0x45e55e){logger[_0x74d0('0xf')](_0x74d0('0x10'),_0x1edad8,_0x74d0('0x11'));logger[_0x74d0('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x1edad8,_0x74d0('0x11'),JSON[_0x74d0('0x13')](_0x45e55e));if(_0x45e55e[_0x74d0('0x14')]){if(_0x45e55e[_0x74d0('0x14')][_0x74d0('0x15')]===0x1f4){logger[_0x74d0('0x14')](_0x74d0('0x10'),_0x1edad8,_0x45e55e[_0x74d0('0x14')]['message']);return _0x44db65(_0x45e55e[_0x74d0('0x14')][_0x74d0('0x16')]);}logger[_0x74d0('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x1edad8,_0x45e55e[_0x74d0('0x14')][_0x74d0('0x16')]);return _0x430a27(_0x45e55e[_0x74d0('0x14')]['message']);}else{logger[_0x74d0('0xf')](_0x74d0('0x10'),_0x1edad8,_0x74d0('0x11'));_0x430a27(_0x45e55e[_0x74d0('0x17')]['message']);}})['catch'](function(_0x599af3){logger['error'](_0x74d0('0x10'),_0x1edad8,_0x599af3);_0x44db65(_0x599af3);});});}
\ No newline at end of file
+var _0x9b8a=['jayson/promise','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x278874,_0x527f6a){var _0x1f16d1=function(_0x58bde9){while(--_0x58bde9){_0x278874['push'](_0x278874['shift']());}};_0x1f16d1(++_0x527f6a);}(_0x9b8a,0xb4));var _0xa9b8=function(_0x2134b2,_0x5a82aa){_0x2134b2=_0x2134b2-0x0;var _0x4e4bc8=_0x9b8a[_0x2134b2];return _0x4e4bc8;};'use strict';var _=require(_0xa9b8('0x0'));var util=require(_0xa9b8('0x1'));var moment=require(_0xa9b8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9b8('0x3'));var db=require(_0xa9b8('0x4'))['db'];var utils=require(_0xa9b8('0x5'));var logger=require(_0xa9b8('0x6'))(_0xa9b8('0x7'));var config=require(_0xa9b8('0x8'));var jayson=require(_0xa9b8('0x9'));var client=jayson['client'][_0xa9b8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x118aac,_0x5c4ede,_0xfbbf13){return new BPromise(function(_0x4991c4,_0x510425){return client[_0xa9b8('0xb')](_0x118aac,_0xfbbf13)[_0xa9b8('0xc')](function(_0x59b00b){logger[_0xa9b8('0xd')](_0xa9b8('0xe'),_0x5c4ede,_0xa9b8('0xf'));logger[_0xa9b8('0x10')](_0xa9b8('0x11'),_0x5c4ede,_0xa9b8('0xf'),JSON['stringify'](_0x59b00b));if(_0x59b00b[_0xa9b8('0x12')]){if(_0x59b00b[_0xa9b8('0x12')]['code']===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x5c4ede,_0x59b00b[_0xa9b8('0x12')][_0xa9b8('0x13')]);return _0x510425(_0x59b00b['error'][_0xa9b8('0x13')]);}logger[_0xa9b8('0x12')](_0xa9b8('0xe'),_0x5c4ede,_0x59b00b[_0xa9b8('0x12')][_0xa9b8('0x13')]);return _0x4991c4(_0x59b00b[_0xa9b8('0x12')]['message']);}else{logger[_0xa9b8('0xd')](_0xa9b8('0xe'),_0x5c4ede,_0xa9b8('0xf'));_0x4991c4(_0x59b00b['result'][_0xa9b8('0x13')]);}})[_0xa9b8('0x14')](function(_0x53d42c){logger[_0xa9b8('0x12')](_0xa9b8('0xe'),_0x5c4ede,_0x53d42c);_0x510425(_0x53d42c);});});}
\ No newline at end of file
index b97801a..6c253aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4b9=['index','/:id','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','put','update','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated'];(function(_0x5d88be,_0x5a9a0d){var _0x27b2e7=function(_0x5662c1){while(--_0x5662c1){_0x5d88be['push'](_0x5d88be['shift']());}};_0x27b2e7(++_0x5a9a0d);}(_0xe4b9,0x17c));var _0x9e4b=function(_0x4ff121,_0x3ade9c){_0x4ff121=_0x4ff121-0x0;var _0x2987cf=_0xe4b9[_0x4ff121];return _0x2987cf;};'use strict';var multer=require(_0x9e4b('0x0'));var util=require(_0x9e4b('0x1'));var path=require(_0x9e4b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9e4b('0x3')]();var fs_extra=require(_0x9e4b('0x4'));var auth=require(_0x9e4b('0x5'));var interaction=require(_0x9e4b('0x6'));var config=require('../../config/environment');var controller=require(_0x9e4b('0x7'));router[_0x9e4b('0x8')]('/',auth[_0x9e4b('0x9')](),controller[_0x9e4b('0xa')]);router[_0x9e4b('0x8')](_0x9e4b('0xb'),auth[_0x9e4b('0x9')](),controller['show']);router[_0x9e4b('0x8')](_0x9e4b('0xc'),auth[_0x9e4b('0x9')](),controller[_0x9e4b('0xd')]);router['get']('/:id/answers',auth[_0x9e4b('0x9')](),controller[_0x9e4b('0xe')]);router[_0x9e4b('0x8')](_0x9e4b('0xf'),auth['isAuthenticated'](),timeout(_0x9e4b('0x10')),controller[_0x9e4b('0x11')]);router[_0x9e4b('0x12')]('/',auth[_0x9e4b('0x9')](),controller[_0x9e4b('0x13')]);router[_0x9e4b('0x12')](_0x9e4b('0x14'),auth[_0x9e4b('0x9')](),controller[_0x9e4b('0x15')]);router[_0x9e4b('0x16')](_0x9e4b('0xb'),auth[_0x9e4b('0x9')](),controller[_0x9e4b('0x17')]);router[_0x9e4b('0x18')]('/:id',auth[_0x9e4b('0x9')](),controller[_0x9e4b('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x6e20=['exports','multer','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','index','/:id','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone','put','update','delete','destroy'];(function(_0x38300b,_0x2a50f9){var _0x304b10=function(_0x29e02a){while(--_0x29e02a){_0x38300b['push'](_0x38300b['shift']());}};_0x304b10(++_0x2a50f9);}(_0x6e20,0x190));var _0x06e2=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x6e20[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0x06e2('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x06e2('0x1'));var interaction=require('../../components/interaction/service');var config=require(_0x06e2('0x2'));var controller=require(_0x06e2('0x3'));router[_0x06e2('0x4')]('/',auth[_0x06e2('0x5')](),controller[_0x06e2('0x6')]);router[_0x06e2('0x4')](_0x06e2('0x7'),auth[_0x06e2('0x5')](),controller['show']);router[_0x06e2('0x4')]('/:id/sessions',auth[_0x06e2('0x5')](),controller['getSessions']);router[_0x06e2('0x4')](_0x06e2('0x8'),auth[_0x06e2('0x5')](),controller[_0x06e2('0x9')]);router['get'](_0x06e2('0xa'),auth[_0x06e2('0x5')](),timeout(_0x06e2('0xb')),controller[_0x06e2('0xc')]);router['post']('/',auth[_0x06e2('0x5')](),controller[_0x06e2('0xd')]);router[_0x06e2('0xe')](_0x06e2('0xf'),auth['isAuthenticated'](),controller['clone']);router[_0x06e2('0x10')](_0x06e2('0x7'),auth['isAuthenticated'](),controller[_0x06e2('0x11')]);router[_0x06e2('0x12')](_0x06e2('0x7'),auth[_0x06e2('0x5')](),controller[_0x06e2('0x13')]);module[_0x06e2('0x14')]=router;
\ No newline at end of file
index 3445c2c..099b890 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1204=['format','getDataValue','description','BOOLEAN','sequelize','lodash','exports','name','long','setDataValue','formData','stringify','isString'];(function(_0x5ab23b,_0x88f5aa){var _0x28e18f=function(_0x2843ca){while(--_0x2843ca){_0x5ab23b['push'](_0x5ab23b['shift']());}};_0x28e18f(++_0x88f5aa);}(_0x1204,0xee));var _0x4120=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1204[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x4120('0x0'));var _=require(_0x4120('0x1'));var util=require('util');module[_0x4120('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x4120('0x3')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x4120('0x4')),'set':function(_0x8eb6){if(_['isObjectLike'](_0x8eb6)){this[_0x4120('0x5')](_0x4120('0x6'),JSON[_0x4120('0x7')](_0x8eb6));}else if(_[_0x4120('0x8')](_0x8eb6)){this[_0x4120('0x5')](_0x4120('0x6'),_0x8eb6);}else{this[_0x4120('0x5')](_0x4120('0x6'),util[_0x4120('0x9')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x4120('0xa')](_0x4120('0x3'))||'',this[_0x4120('0xa')](_0x4120('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x4120('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x4120('0xc')],'defaultValue':![]}};
\ No newline at end of file
+var _0x4483=['{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format'];(function(_0x562c93,_0x18cb82){var _0xae2b2c=function(_0x3b50a8){while(--_0x3b50a8){_0x562c93['push'](_0x562c93['shift']());}};_0xae2b2c(++_0x18cb82);}(_0x4483,0x1e0));var _0x3448=function(_0x4e4f4b,_0x33706a){_0x4e4f4b=_0x4e4f4b-0x0;var _0x4f674d=_0x4483[_0x4e4f4b];return _0x4f674d;};'use strict';var Sequelize=require(_0x3448('0x0'));var _=require('lodash');var util=require(_0x3448('0x1'));module[_0x3448('0x2')]={'name':{'type':Sequelize[_0x3448('0x3')],'unique':_0x3448('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x3448('0x5')](_0x3448('0x6')),'set':function(_0x2e9a18){if(_[_0x3448('0x7')](_0x2e9a18)){this[_0x3448('0x8')](_0x3448('0x9'),JSON[_0x3448('0xa')](_0x2e9a18));}else if(_[_0x3448('0xb')](_0x2e9a18)){this[_0x3448('0x8')](_0x3448('0x9'),_0x2e9a18);}else{this[_0x3448('0x8')](_0x3448('0x9'),util[_0x3448('0xc')](_0x3448('0xd'),this['getDataValue'](_0x3448('0x4'))||'',this[_0x3448('0xe')](_0x3448('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x3448('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x3448('0x10')],'defaultValue':![]}};
\ No newline at end of file
index eff6dbc..6ee1315 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7948=['format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Projects','name','send','index','map','JscriptyProject','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','rawAttributes','omit','createdAt','updatedAt','includeAll','userProfileId','error','getSessions','findOne','pick','ProjectId','JscriptySessionReport','JscriptyAnswerReport','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','YYYY-MM-DD\x20HH:mm:ss','isEmpty','now','writeFileSync'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7948,0x185));var _0x8794=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0x7948[_0x3f6b1b];return _0x4a3d2b;};'use strict';var emlformat=require(_0x8794('0x0'));var rimraf=require(_0x8794('0x1'));var zipdir=require(_0x8794('0x2'));var jsonpatch=require(_0x8794('0x3'));var rp=require(_0x8794('0x4'));var moment=require(_0x8794('0x5'));var BPromise=require(_0x8794('0x6'));var Mustache=require(_0x8794('0x7'));var util=require(_0x8794('0x8'));var path=require(_0x8794('0x9'));var sox=require(_0x8794('0xa'));var csv=require(_0x8794('0xb'));var ejs=require(_0x8794('0xc'));var fs=require('fs');var fs_extra=require(_0x8794('0xd'));var _=require(_0x8794('0xe'));var squel=require(_0x8794('0xf'));var crypto=require(_0x8794('0x10'));var jsforce=require(_0x8794('0x11'));var deskjs=require(_0x8794('0x12'));var toCsv=require(_0x8794('0xb'));var querystring=require(_0x8794('0x13'));var Papa=require(_0x8794('0x14'));var Redis=require(_0x8794('0x15'));var authService=require(_0x8794('0x16'));var qs=require(_0x8794('0x17'));var as=require(_0x8794('0x18'));var hardwareService=require(_0x8794('0x19'));var logger=require(_0x8794('0x1a'))(_0x8794('0x1b'));var utils=require(_0x8794('0x1c'));var config=require(_0x8794('0x1d'));var licenseUtil=require('../../config/license/util');var db=require(_0x8794('0x1e'))['db'];function respondWithStatusCode(_0x3b1453,_0x1e9dac){_0x1e9dac=_0x1e9dac||0xcc;return function(_0x10a723){if(_0x10a723){return _0x3b1453[_0x8794('0x1f')](_0x1e9dac);}return _0x3b1453[_0x8794('0x20')](_0x1e9dac)[_0x8794('0x21')]();};}function respondWithResult(_0x3af393,_0xb22e03){_0xb22e03=_0xb22e03||0xc8;return function(_0x2967e3){if(_0x2967e3){return _0x3af393[_0x8794('0x20')](_0xb22e03)[_0x8794('0x22')](_0x2967e3);}};}function respondWithFilteredResult(_0x40dd7c,_0x537e3d){return function(_0x7500eb){if(_0x7500eb){var _0x4f8b21=typeof _0x537e3d['offset']===_0x8794('0x23')&&typeof _0x537e3d[_0x8794('0x24')]===_0x8794('0x23');var _0x4b240b=_0x7500eb[_0x8794('0x25')];var _0x206039=_0x4f8b21?0x0:_0x537e3d[_0x8794('0x26')];var _0x5c2300=_0x4f8b21?_0x7500eb[_0x8794('0x25')]:_0x537e3d[_0x8794('0x26')]+_0x537e3d[_0x8794('0x24')];var _0x5cee8f;if(_0x5c2300>=_0x4b240b){_0x5c2300=_0x4b240b;_0x5cee8f=0xc8;}else{_0x5cee8f=0xce;}_0x40dd7c[_0x8794('0x20')](_0x5cee8f);return _0x40dd7c[_0x8794('0x27')](_0x8794('0x28'),_0x206039+'-'+_0x5c2300+'/'+_0x4b240b)['json'](_0x7500eb);}return null;};}function patchUpdates(_0x3f7f78){return function(_0x4bd1ef){try{jsonpatch[_0x8794('0x29')](_0x4bd1ef,_0x3f7f78,!![]);}catch(_0x1910d4){return BPromise[_0x8794('0x2a')](_0x1910d4);}return _0x4bd1ef[_0x8794('0x2b')]();};}function saveUpdates(_0x22f64b,_0xa180ac){return function(_0x1b8c19){if(_0x1b8c19){return _0x1b8c19[_0x8794('0x2c')](_0x22f64b)[_0x8794('0x2d')](function(_0x192fda){return _0x192fda;});}return null;};}function removeEntity(_0x518eb6,_0x3e3db9){return function(_0x4de3af){if(_0x4de3af){return _0x4de3af[_0x8794('0x2e')]()[_0x8794('0x2d')](function(){var _0x4f0383=_0x4de3af[_0x8794('0x2f')]({'plain':!![]});var _0x50bf48=_0x8794('0x30');return db['UserProfileResource'][_0x8794('0x2e')]({'where':{'type':_0x50bf48,'resourceId':_0x4f0383['id']}})['then'](function(){return _0x4de3af;});})[_0x8794('0x2d')](function(){_0x518eb6[_0x8794('0x20')](0xcc)[_0x8794('0x21')]();});}};}function handleEntityNotFound(_0x4bb6e6,_0x5e3afc){return function(_0x4214d2){if(!_0x4214d2){_0x4bb6e6[_0x8794('0x1f')](0x194);}return _0x4214d2;};}function handleError(_0x507daf,_0x54cd8b){_0x54cd8b=_0x54cd8b||0x1f4;return function(_0x1044b9){logger['error'](_0x1044b9['stack']);if(_0x1044b9[_0x8794('0x31')]){delete _0x1044b9[_0x8794('0x31')];}_0x507daf[_0x8794('0x20')](_0x54cd8b)[_0x8794('0x32')](_0x1044b9);};}exports[_0x8794('0x33')]=function(_0x4fd33e,_0x2d695c){var _0x375ac1={},_0x2b23ae={},_0x344409={'count':0x0,'rows':[]};var _0x53cc41=_[_0x8794('0x34')](db[_0x8794('0x35')]['rawAttributes'],function(_0x481546){return{'name':_0x481546[_0x8794('0x36')],'type':_0x481546[_0x8794('0x37')][_0x8794('0x38')]};});_0x2b23ae[_0x8794('0x39')]=_['map'](_0x53cc41,'name');_0x2b23ae[_0x8794('0x3a')]=_[_0x8794('0x3b')](_0x4fd33e[_0x8794('0x3a')]);_0x2b23ae[_0x8794('0x3c')]=_[_0x8794('0x3d')](_0x2b23ae[_0x8794('0x39')],_0x2b23ae[_0x8794('0x3a')]);_0x375ac1[_0x8794('0x3e')]=_[_0x8794('0x3d')](_0x2b23ae[_0x8794('0x39')],qs[_0x8794('0x3f')](_0x4fd33e['query'][_0x8794('0x3f')]));_0x375ac1[_0x8794('0x3e')]=_0x375ac1[_0x8794('0x3e')][_0x8794('0x40')]?_0x375ac1['attributes']:_0x2b23ae['model'];if(!_0x4fd33e[_0x8794('0x3a')][_0x8794('0x41')](_0x8794('0x42'))){_0x375ac1[_0x8794('0x24')]=qs[_0x8794('0x24')](_0x4fd33e[_0x8794('0x3a')][_0x8794('0x24')]);_0x375ac1[_0x8794('0x26')]=qs['offset'](_0x4fd33e[_0x8794('0x3a')][_0x8794('0x26')]);}_0x375ac1[_0x8794('0x43')]=qs['sort'](_0x4fd33e[_0x8794('0x3a')][_0x8794('0x44')]);_0x375ac1[_0x8794('0x45')]=qs[_0x8794('0x3c')](_['pick'](_0x4fd33e[_0x8794('0x3a')],_0x2b23ae[_0x8794('0x3c')]),_0x53cc41);if(_0x4fd33e[_0x8794('0x3a')][_0x8794('0x46')]){_0x375ac1[_0x8794('0x45')]=_['merge'](_0x375ac1[_0x8794('0x45')],{'$or':_['map'](_0x53cc41,function(_0x56c416){if(_0x56c416[_0x8794('0x37')]!==_0x8794('0x47')){var _0x2f1d5e={};_0x2f1d5e[_0x56c416['name']]={'$like':'%'+_0x4fd33e[_0x8794('0x3a')][_0x8794('0x46')]+'%'};return _0x2f1d5e;}})});}_0x375ac1=_[_0x8794('0x48')]({},_0x375ac1,_0x4fd33e[_0x8794('0x49')]);var _0x5a964e={'where':_0x375ac1[_0x8794('0x45')]};return db['JscriptyProject'][_0x8794('0x25')](_0x5a964e)[_0x8794('0x2d')](function(_0x168b26){_0x344409[_0x8794('0x25')]=_0x168b26;if(_0x4fd33e[_0x8794('0x3a')]['includeAll']){_0x375ac1[_0x8794('0x4a')]=[{'all':!![]}];}return db['JscriptyProject'][_0x8794('0x4b')](_0x375ac1);})['then'](function(_0x2ef73d){_0x344409[_0x8794('0x4c')]=_0x2ef73d;return _0x344409;})['then'](respondWithFilteredResult(_0x2d695c,_0x375ac1))[_0x8794('0x4d')](handleError(_0x2d695c,null));};exports[_0x8794('0x4e')]=function(_0x2b385b,_0x3b67a4){var _0x577a64={'raw':![],'where':{'id':_0x2b385b[_0x8794('0x4f')]['id']}},_0x5e7fc7={};_0x5e7fc7[_0x8794('0x39')]=_[_0x8794('0x3b')](db[_0x8794('0x35')]['rawAttributes']);_0x5e7fc7['query']=_[_0x8794('0x3b')](_0x2b385b[_0x8794('0x3a')]);_0x5e7fc7[_0x8794('0x3c')]=_[_0x8794('0x3d')](_0x5e7fc7[_0x8794('0x39')],_0x5e7fc7['query']);_0x577a64['attributes']=_[_0x8794('0x3d')](_0x5e7fc7['model'],qs[_0x8794('0x3f')](_0x2b385b[_0x8794('0x3a')]['fields']));_0x577a64[_0x8794('0x3e')]=_0x577a64[_0x8794('0x3e')][_0x8794('0x40')]?_0x577a64[_0x8794('0x3e')]:_0x5e7fc7[_0x8794('0x39')];if(_0x2b385b[_0x8794('0x3a')]['includeAll']){_0x577a64[_0x8794('0x4a')]=[{'all':!![]}];}_0x577a64=_[_0x8794('0x48')]({},_0x577a64,_0x2b385b[_0x8794('0x49')]);return db[_0x8794('0x35')][_0x8794('0x50')](_0x577a64)['then'](handleEntityNotFound(_0x3b67a4,null))[_0x8794('0x2d')](respondWithResult(_0x3b67a4,null))[_0x8794('0x4d')](handleError(_0x3b67a4,null));};exports[_0x8794('0x51')]=function(_0x38432f,_0x14df40){return db[_0x8794('0x35')][_0x8794('0x51')](_0x38432f[_0x8794('0x52')],{})['then'](function(_0x1339ff){var _0x4c0eb3=_0x38432f[_0x8794('0x53')][_0x8794('0x2f')]({'plain':!![]});if(!_0x4c0eb3)throw new Error(_0x8794('0x54'));if(_0x4c0eb3[_0x8794('0x55')]===_0x8794('0x53')){var _0xdfb522=_0x1339ff[_0x8794('0x2f')]({'plain':!![]});var _0x20db95=_0x8794('0x30');return db[_0x8794('0x56')]['find']({'where':{'name':_0x20db95,'userProfileId':_0x4c0eb3['userProfileId']},'raw':!![]})['then'](function(_0x33982f){if(_0x33982f&&_0x33982f[_0x8794('0x57')]===0x0){return db[_0x8794('0x58')]['create']({'name':_0xdfb522[_0x8794('0x31')],'resourceId':_0xdfb522['id'],'type':_0x33982f['name'],'sectionId':_0x33982f['id']},{})[_0x8794('0x2d')](function(){return _0x1339ff;});}else{return _0x1339ff;}})['catch'](function(_0x449668){logger['error'](_0x8794('0x59'),_0x449668);throw _0x449668;});}return _0x1339ff;})['then'](respondWithResult(_0x14df40,0xc9))[_0x8794('0x4d')](handleError(_0x14df40,null));};exports[_0x8794('0x5a')]=function(_0x1fe264,_0x5a783a){var _0x5a04a5={'where':{'id':_0x1fe264[_0x8794('0x4f')]['id']}},_0x6c00de={};_0x6c00de[_0x8794('0x39')]=_[_0x8794('0x3b')](db[_0x8794('0x35')][_0x8794('0x5b')]);_0x5a04a5['attributes']=_[_0x8794('0x3d')](_0x6c00de[_0x8794('0x39')],qs[_0x8794('0x3f')](_0x1fe264[_0x8794('0x3a')][_0x8794('0x3f')]));_0x5a04a5[_0x8794('0x3e')]=_0x5a04a5['attributes'][_0x8794('0x40')]?_0x5a04a5[_0x8794('0x3e')]:_0x6c00de[_0x8794('0x39')];if(_0x1fe264[_0x8794('0x3a')]['includeAll']){_0x5a04a5[_0x8794('0x4a')]=[{'all':!![]}];}_0x5a04a5=_['merge']({},_0x5a04a5,_0x1fe264[_0x8794('0x49')]);return db[_0x8794('0x35')][_0x8794('0x50')](_0x5a04a5)[_0x8794('0x2d')](handleEntityNotFound(_0x5a783a,null))[_0x8794('0x2d')](function(_0x408e50){if(_0x408e50){var _0x502a91=_0x408e50[_0x8794('0x2f')]({'plain':!![]});_0x502a91=qs[_0x8794('0x5c')](_0x502a91,['id',_0x8794('0x5d'),_0x8794('0x5e')]);_0x1fe264['body']=_['omit'](_0x1fe264['body'],['id',_0x8794('0x5d'),'updatedAt']);return db[_0x8794('0x35')][_0x8794('0x51')](_[_0x8794('0x48')](_0x502a91,_0x1fe264[_0x8794('0x52')]),{'include':_0x1fe264[_0x8794('0x3a')][_0x8794('0x5f')]?[{'all':!![]}]:undefined})[_0x8794('0x2d')](function(_0x4c9a59){var _0x2fae64=_0x1fe264[_0x8794('0x53')]['get']({'plain':!![]});if(!_0x2fae64)throw new Error(_0x8794('0x54'));if(_0x2fae64[_0x8794('0x55')]===_0x8794('0x53')){var _0xb16b2=_0x4c9a59['get']({'plain':!![]});var _0x269e29=_0x8794('0x30');return db[_0x8794('0x56')][_0x8794('0x50')]({'where':{'name':_0x269e29,'userProfileId':_0x2fae64[_0x8794('0x60')]},'raw':!![]})[_0x8794('0x2d')](function(_0x420cf5){if(_0x420cf5&&_0x420cf5[_0x8794('0x57')]===0x0){return db[_0x8794('0x58')][_0x8794('0x51')]({'name':_0xb16b2[_0x8794('0x31')],'resourceId':_0xb16b2['id'],'type':_0x420cf5['name'],'sectionId':_0x420cf5['id']},{})[_0x8794('0x2d')](function(){return _0x4c9a59;});}else{return _0x4c9a59;}})[_0x8794('0x4d')](function(_0x34835f){logger[_0x8794('0x61')](_0x8794('0x59'),_0x34835f);throw _0x34835f;});}return _0x4c9a59;});}})[_0x8794('0x2d')](respondWithResult(_0x5a783a,0xc9))['catch'](handleError(_0x5a783a,null));};exports['update']=function(_0x180b73,_0x4282ea){if(_0x180b73['body']['id']){delete _0x180b73[_0x8794('0x52')]['id'];}return db[_0x8794('0x35')][_0x8794('0x50')]({'where':{'id':_0x180b73[_0x8794('0x4f')]['id']}})[_0x8794('0x2d')](handleEntityNotFound(_0x4282ea,null))['then'](saveUpdates(_0x180b73[_0x8794('0x52')],null))[_0x8794('0x2d')](respondWithResult(_0x4282ea,null))[_0x8794('0x4d')](handleError(_0x4282ea,null));};exports['destroy']=function(_0x204d7c,_0x59d8e4){return db[_0x8794('0x35')][_0x8794('0x50')]({'where':{'id':_0x204d7c[_0x8794('0x4f')]['id']}})[_0x8794('0x2d')](handleEntityNotFound(_0x59d8e4,null))[_0x8794('0x2d')](removeEntity(_0x59d8e4,null))[_0x8794('0x4d')](handleError(_0x59d8e4,null));};exports[_0x8794('0x62')]=function(_0x652e3d,_0x5029e3,_0x1836bb){var _0x5b989b={'raw':!![],'where':{}};var _0x256ca2={};var _0x1ae06e={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x8794('0x63')]({'where':{'id':_0x652e3d[_0x8794('0x4f')]['id']}})[_0x8794('0x2d')](handleEntityNotFound(_0x5029e3,null))[_0x8794('0x2d')](function(_0x14746b){if(_0x14746b){_0x256ca2[_0x8794('0x39')]=_[_0x8794('0x3b')](db['JscriptySessionReport']['rawAttributes']);_0x256ca2[_0x8794('0x3a')]=_['keys'](_0x652e3d['query']);_0x256ca2[_0x8794('0x3c')]=_[_0x8794('0x3d')](_0x256ca2['model'],_0x256ca2[_0x8794('0x3a')]);_0x5b989b[_0x8794('0x3e')]=_[_0x8794('0x3d')](_0x256ca2[_0x8794('0x39')],qs['fields'](_0x652e3d[_0x8794('0x3a')][_0x8794('0x3f')]));_0x5b989b[_0x8794('0x3e')]=_0x5b989b[_0x8794('0x3e')][_0x8794('0x40')]?_0x5b989b['attributes']:_0x256ca2[_0x8794('0x39')];if(!_0x652e3d[_0x8794('0x3a')][_0x8794('0x41')](_0x8794('0x42'))){_0x5b989b[_0x8794('0x24')]=qs[_0x8794('0x24')](_0x652e3d[_0x8794('0x3a')][_0x8794('0x24')]);_0x5b989b[_0x8794('0x26')]=qs[_0x8794('0x26')](_0x652e3d[_0x8794('0x3a')][_0x8794('0x26')]);}_0x5b989b[_0x8794('0x43')]=qs[_0x8794('0x44')](_0x652e3d[_0x8794('0x3a')][_0x8794('0x44')]);_0x5b989b[_0x8794('0x45')]=qs[_0x8794('0x3c')](_[_0x8794('0x64')](_0x652e3d[_0x8794('0x3a')],_0x256ca2[_0x8794('0x3c')]));_0x5b989b[_0x8794('0x45')][_0x8794('0x65')]=_0x14746b['id'];if(_0x652e3d[_0x8794('0x3a')]['filter']){_0x5b989b['where']=_[_0x8794('0x48')](_0x5b989b[_0x8794('0x45')],{'$or':_[_0x8794('0x34')](_0x5b989b['attributes'],function(_0x543b11){var _0x24cfd6={};_0x24cfd6[_0x543b11]={'$like':'%'+_0x652e3d[_0x8794('0x3a')][_0x8794('0x46')]+'%'};return _0x24cfd6;})});}_0x5b989b=_[_0x8794('0x48')]({},_0x5b989b,_0x652e3d[_0x8794('0x49')]);return db['JscriptySessionReport']['count']({'where':_0x5b989b[_0x8794('0x45')]})[_0x8794('0x2d')](function(_0x2d1e6e){_0x1ae06e['count']=_0x2d1e6e;if(_0x652e3d[_0x8794('0x3a')][_0x8794('0x5f')]){_0x5b989b[_0x8794('0x4a')]=[{'all':!![]}];}return db[_0x8794('0x66')][_0x8794('0x4b')](_0x5b989b);})['then'](function(_0x15850b){_0x1ae06e['rows']=_0x15850b;return _0x1ae06e;});}})[_0x8794('0x2d')](respondWithFilteredResult(_0x5029e3,_0x5b989b))[_0x8794('0x4d')](handleError(_0x5029e3,null));};exports['getAnswers']=function(_0x7b8039,_0x6573e3,_0x141e57){var _0x14d726={'raw':!![],'where':{}};var _0x5626dc={};var _0x2217c4={'count':0x0,'rows':[]};return db[_0x8794('0x35')][_0x8794('0x63')]({'where':{'id':_0x7b8039[_0x8794('0x4f')]['id']}})[_0x8794('0x2d')](handleEntityNotFound(_0x6573e3,null))[_0x8794('0x2d')](function(_0xb281ea){if(_0xb281ea){_0x5626dc[_0x8794('0x39')]=_[_0x8794('0x3b')](db[_0x8794('0x67')][_0x8794('0x5b')]);_0x5626dc[_0x8794('0x3a')]=_[_0x8794('0x3b')](_0x7b8039[_0x8794('0x3a')]);_0x5626dc[_0x8794('0x3c')]=_[_0x8794('0x3d')](_0x5626dc[_0x8794('0x39')],_0x5626dc[_0x8794('0x3a')]);_0x14d726['attributes']=_['intersection'](_0x5626dc[_0x8794('0x39')],qs[_0x8794('0x3f')](_0x7b8039[_0x8794('0x3a')][_0x8794('0x3f')]));_0x14d726[_0x8794('0x3e')]=_0x14d726[_0x8794('0x3e')][_0x8794('0x40')]?_0x14d726[_0x8794('0x3e')]:_0x5626dc[_0x8794('0x39')];if(!_0x7b8039[_0x8794('0x3a')][_0x8794('0x41')]('nolimit')){_0x14d726[_0x8794('0x24')]=qs[_0x8794('0x24')](_0x7b8039[_0x8794('0x3a')]['limit']);_0x14d726['offset']=qs[_0x8794('0x26')](_0x7b8039['query'][_0x8794('0x26')]);}_0x14d726[_0x8794('0x43')]=qs[_0x8794('0x44')](_0x7b8039[_0x8794('0x3a')][_0x8794('0x44')]);_0x14d726['where']=qs[_0x8794('0x3c')](_[_0x8794('0x64')](_0x7b8039[_0x8794('0x3a')],_0x5626dc['filters']));_0x14d726[_0x8794('0x45')][_0x8794('0x65')]=_0xb281ea['id'];if(_0x7b8039[_0x8794('0x3a')]['filter']){_0x14d726[_0x8794('0x45')]=_['merge'](_0x14d726[_0x8794('0x45')],{'$or':_[_0x8794('0x34')](_0x14d726[_0x8794('0x3e')],function(_0x52a165){var _0x38a865={};_0x38a865[_0x52a165]={'$like':'%'+_0x7b8039[_0x8794('0x3a')][_0x8794('0x46')]+'%'};return _0x38a865;})});}_0x14d726=_['merge']({},_0x14d726,_0x7b8039[_0x8794('0x49')]);return db[_0x8794('0x67')][_0x8794('0x25')]({'where':_0x14d726[_0x8794('0x45')]})[_0x8794('0x2d')](function(_0x28583c){_0x2217c4[_0x8794('0x25')]=_0x28583c;if(_0x7b8039[_0x8794('0x3a')][_0x8794('0x5f')]){_0x14d726[_0x8794('0x4a')]=[{'all':!![]}];}return db[_0x8794('0x67')][_0x8794('0x4b')](_0x14d726);})[_0x8794('0x2d')](function(_0x2f7b5b){_0x2217c4['rows']=_0x2f7b5b;return _0x2217c4;});}})[_0x8794('0x2d')](respondWithFilteredResult(_0x6573e3,_0x14d726))[_0x8794('0x4d')](handleError(_0x6573e3,null));};function char(_0x177c54){return'number'===typeof _0x177c54?String['fromCharCode'][_0x8794('0x29')](null,arguments):_0x177c54;}function needsEncapsulation(_0x24eadf){return!!_0x24eadf&&(_0x24eadf[_0x8794('0x68')]()['indexOf'](char(0xd))>=0x0||_0x24eadf['toString']()[_0x8794('0x69')](char(0xa))>=0x0||_0x24eadf[_0x8794('0x68')]()[_0x8794('0x69')](char(0x2c))>=0x0||_0x24eadf[_0x8794('0x68')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x4e1f1b){var _0x454044=char(0x22),_0x25b493='\x5c'+char(0x22),_0x28f081=_0x4e1f1b[_0x8794('0x68')]()[_0x8794('0x6a')](new RegExp(_0x454044,'g'),_0x25b493);return _0x454044+_0x28f081+_0x454044;}exports[_0x8794('0x6b')]=function(_0x4e69b9,_0x13031d,_0x4368a3){var _0x2a260e,_0x293c85;var _0x2fde29={'where':{'ProjectId':_0x4e69b9['params']['id']}};if(_0x4e69b9[_0x8794('0x3a')][_0x8794('0x6c')]){_0x2fde29['where']['starttime']=JSON[_0x8794('0x6d')](_0x4e69b9[_0x8794('0x3a')][_0x8794('0x6c')]);}return db['JscriptySessionReport']['findAll'](_0x2fde29)[_0x8794('0x2d')](handleEntityNotFound(_0x13031d,null))['then'](function(_0xec6ee3){if(_0xec6ee3){_0x2a260e=_0xec6ee3;return db[_0x8794('0x6e')][_0x8794('0x4b')]({'where':{'SessionId':{'$in':_[_0x8794('0x34')](_0x2a260e,'id')},'ProjectId':_0x4e69b9[_0x8794('0x4f')]['id']},'order':_0x8794('0x6f')});}})['then'](handleEntityNotFound(_0x13031d,null))['then'](function(_0x3e5390){if(_0x3e5390){_0x293c85=_0x3e5390;var _0x373218={};for(var _0x3d2c5b=0x0,_0x271939=_0x293c85[_0x8794('0x40')];_0x3d2c5b<_0x271939;_0x3d2c5b++){if(!_0x373218[_0x8794('0x41')](_0x293c85[_0x3d2c5b]['questionId'])){_0x373218[_0x293c85[_0x3d2c5b][_0x8794('0x70')]]=needsEncapsulation(_0x293c85[_0x3d2c5b][_0x8794('0x71')])?encapsulate(_0x293c85[_0x3d2c5b][_0x8794('0x71')]):_0x293c85[_0x3d2c5b][_0x8794('0x71')];}}var _0x54a5f9=[],_0xa915a4={};for(var _0x58de1a=0x0,_0x567182=_0x2a260e[_0x8794('0x40')];_0x58de1a<_0x567182;_0x58de1a++){_0xa915a4={'ProjectId':_0x4e69b9['params']['id'],'SessionId':_0x2a260e[_0x58de1a]['id'],'StartTime':moment(_0x2a260e[_0x58de1a][_0x8794('0x72')])['format'](_0x8794('0x73'))};for(var _0x5df60a=0x0,_0x4c5985=_0x293c85[_0x8794('0x40')];_0x5df60a<_0x4c5985;_0x5df60a++){if(_0x293c85[_0x5df60a]['SessionId']==_0x2a260e[_0x58de1a]['id']&&_0x373218[_0x8794('0x41')](_0x293c85[_0x5df60a][_0x8794('0x70')])){_0xa915a4[_0x373218[_0x293c85[_0x5df60a]['questionId']]]=_0x293c85[_0x5df60a]['answer'];}}for(var _0x3ad4fc in _0x373218){if(!_0xa915a4[_0x8794('0x41')](_0x373218[_0x3ad4fc])){_0xa915a4[_0x373218[_0x3ad4fc]]=null;}}_0x54a5f9['push'](_0xa915a4);}return _0x54a5f9;}})[_0x8794('0x2d')](function(_0x197436){if(!_[_0x8794('0x74')](_0x197436)){var _0x1cfcfb=toCsv(_0x197436);var _0x50b5ab=Date[_0x8794('0x75')]();fs[_0x8794('0x76')](util[_0x8794('0x77')](_0x8794('0x78'),_0x4e69b9[_0x8794('0x4f')]['id'],_0x50b5ab),_0x1cfcfb);_0x13031d[_0x8794('0x79')](_0x8794('0x7a'),_0x8794('0x7b')+util[_0x8794('0x77')]('Jscripty_Project_%d_Summary_%s.csv',_0x4e69b9[_0x8794('0x4f')]['id'],_0x50b5ab));_0x13031d[_0x8794('0x79')](_0x8794('0x7c'),_0x8794('0x7d'));return _0x13031d[_0x8794('0x7e')](util[_0x8794('0x77')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4e69b9['params']['id'],_0x50b5ab));}else{return _0x13031d[_0x8794('0x1f')](0xcc);}})[_0x8794('0x4d')](handleError(_0x13031d,null));};
\ No newline at end of file
+var _0x8f4c=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','intersection','updatedAt','body','omit','createdAt','update','findOne','order','JscriptySessionReport','findAll','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','toString','indexOf','replace','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','push','now','writeFileSync','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','Projects','error','stack','name','send','map','JscriptyProject','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','keys','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8f4c,0x113));var _0xc8f4=function(_0xd921ef,_0x285f09){_0xd921ef=_0xd921ef-0x0;var _0x48da14=_0x8f4c[_0xd921ef];return _0x48da14;};'use strict';var emlformat=require(_0xc8f4('0x0'));var rimraf=require(_0xc8f4('0x1'));var zipdir=require(_0xc8f4('0x2'));var jsonpatch=require(_0xc8f4('0x3'));var rp=require(_0xc8f4('0x4'));var moment=require(_0xc8f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc8f4('0x6'));var util=require(_0xc8f4('0x7'));var path=require(_0xc8f4('0x8'));var sox=require('sox');var csv=require(_0xc8f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8f4('0xb'));var deskjs=require(_0xc8f4('0xc'));var toCsv=require(_0xc8f4('0x9'));var querystring=require(_0xc8f4('0xd'));var Papa=require(_0xc8f4('0xe'));var Redis=require('ioredis');var authService=require(_0xc8f4('0xf'));var qs=require(_0xc8f4('0x10'));var as=require(_0xc8f4('0x11'));var hardwareService=require(_0xc8f4('0x12'));var logger=require('../../config/logger')(_0xc8f4('0x13'));var utils=require('../../config/utils');var config=require(_0xc8f4('0x14'));var licenseUtil=require(_0xc8f4('0x15'));var db=require(_0xc8f4('0x16'))['db'];function respondWithStatusCode(_0x729f8f,_0x39b785){_0x39b785=_0x39b785||0xcc;return function(_0x4e31cf){if(_0x4e31cf){return _0x729f8f[_0xc8f4('0x17')](_0x39b785);}return _0x729f8f[_0xc8f4('0x18')](_0x39b785)[_0xc8f4('0x19')]();};}function respondWithResult(_0x14bc11,_0x1dcee5){_0x1dcee5=_0x1dcee5||0xc8;return function(_0x411c5c){if(_0x411c5c){return _0x14bc11['status'](_0x1dcee5)[_0xc8f4('0x1a')](_0x411c5c);}};}function respondWithFilteredResult(_0x2c7bc1,_0x1518a6){return function(_0x46ac15){if(_0x46ac15){var _0x22c08a=typeof _0x1518a6['offset']===_0xc8f4('0x1b')&&typeof _0x1518a6['limit']==='undefined';var _0x14bc02=_0x46ac15[_0xc8f4('0x1c')];var _0x108076=_0x22c08a?0x0:_0x1518a6[_0xc8f4('0x1d')];var _0x4763c1=_0x22c08a?_0x46ac15[_0xc8f4('0x1c')]:_0x1518a6[_0xc8f4('0x1d')]+_0x1518a6[_0xc8f4('0x1e')];var _0x1982bb;if(_0x4763c1>=_0x14bc02){_0x4763c1=_0x14bc02;_0x1982bb=0xc8;}else{_0x1982bb=0xce;}_0x2c7bc1[_0xc8f4('0x18')](_0x1982bb);return _0x2c7bc1[_0xc8f4('0x1f')](_0xc8f4('0x20'),_0x108076+'-'+_0x4763c1+'/'+_0x14bc02)[_0xc8f4('0x1a')](_0x46ac15);}return null;};}function patchUpdates(_0x5f3264){return function(_0x378f56){try{jsonpatch[_0xc8f4('0x21')](_0x378f56,_0x5f3264,!![]);}catch(_0x29e52d){return BPromise[_0xc8f4('0x22')](_0x29e52d);}return _0x378f56[_0xc8f4('0x23')]();};}function saveUpdates(_0x3b42ee,_0xaeee7d){return function(_0x43eb57){if(_0x43eb57){return _0x43eb57['update'](_0x3b42ee)[_0xc8f4('0x24')](function(_0x205c41){return _0x205c41;});}return null;};}function removeEntity(_0x3195ff,_0x1d159e){return function(_0x5d54a9){if(_0x5d54a9){return _0x5d54a9[_0xc8f4('0x25')]()['then'](function(){var _0x3782fd=_0x5d54a9['get']({'plain':!![]});var _0x177a44=_0xc8f4('0x26');return db['UserProfileResource'][_0xc8f4('0x25')]({'where':{'type':_0x177a44,'resourceId':_0x3782fd['id']}})[_0xc8f4('0x24')](function(){return _0x5d54a9;});})[_0xc8f4('0x24')](function(){_0x3195ff[_0xc8f4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3db490,_0x3484b6){return function(_0x5db666){if(!_0x5db666){_0x3db490[_0xc8f4('0x17')](0x194);}return _0x5db666;};}function handleError(_0x37957c,_0x157ad5){_0x157ad5=_0x157ad5||0x1f4;return function(_0x1b70bc){logger[_0xc8f4('0x27')](_0x1b70bc[_0xc8f4('0x28')]);if(_0x1b70bc['name']){delete _0x1b70bc[_0xc8f4('0x29')];}_0x37957c[_0xc8f4('0x18')](_0x157ad5)[_0xc8f4('0x2a')](_0x1b70bc);};}exports['index']=function(_0xf4a556,_0x3a4b1b){var _0x5ab6cb={},_0x56ec4b={},_0x4d6c43={'count':0x0,'rows':[]};var _0x2717ff=_[_0xc8f4('0x2b')](db[_0xc8f4('0x2c')][_0xc8f4('0x2d')],function(_0x273e73){return{'name':_0x273e73[_0xc8f4('0x2e')],'type':_0x273e73[_0xc8f4('0x2f')][_0xc8f4('0x30')]};});_0x56ec4b['model']=_[_0xc8f4('0x2b')](_0x2717ff,_0xc8f4('0x29'));_0x56ec4b[_0xc8f4('0x31')]=_['keys'](_0xf4a556[_0xc8f4('0x31')]);_0x56ec4b[_0xc8f4('0x32')]=_['intersection'](_0x56ec4b[_0xc8f4('0x33')],_0x56ec4b[_0xc8f4('0x31')]);_0x5ab6cb[_0xc8f4('0x34')]=_['intersection'](_0x56ec4b[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0xf4a556[_0xc8f4('0x31')]['fields']));_0x5ab6cb[_0xc8f4('0x34')]=_0x5ab6cb[_0xc8f4('0x34')][_0xc8f4('0x36')]?_0x5ab6cb[_0xc8f4('0x34')]:_0x56ec4b[_0xc8f4('0x33')];if(!_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x37')](_0xc8f4('0x38'))){_0x5ab6cb[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x1e')]);_0x5ab6cb[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x1d')]);}_0x5ab6cb['order']=qs[_0xc8f4('0x39')](_0xf4a556['query'][_0xc8f4('0x39')]);_0x5ab6cb['where']=qs[_0xc8f4('0x32')](_[_0xc8f4('0x3a')](_0xf4a556[_0xc8f4('0x31')],_0x56ec4b[_0xc8f4('0x32')]),_0x2717ff);if(_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3b')]){_0x5ab6cb[_0xc8f4('0x3c')]=_['merge'](_0x5ab6cb[_0xc8f4('0x3c')],{'$or':_[_0xc8f4('0x2b')](_0x2717ff,function(_0x3963f4){if(_0x3963f4[_0xc8f4('0x2f')]!=='VIRTUAL'){var _0x172836={};_0x172836[_0x3963f4[_0xc8f4('0x29')]]={'$like':'%'+_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3b')]+'%'};return _0x172836;}})});}_0x5ab6cb=_[_0xc8f4('0x3d')]({},_0x5ab6cb,_0xf4a556[_0xc8f4('0x3e')]);var _0xca3cc={'where':_0x5ab6cb[_0xc8f4('0x3c')]};return db[_0xc8f4('0x2c')][_0xc8f4('0x1c')](_0xca3cc)[_0xc8f4('0x24')](function(_0xd56415){_0x4d6c43['count']=_0xd56415;if(_0xf4a556[_0xc8f4('0x31')][_0xc8f4('0x3f')]){_0x5ab6cb[_0xc8f4('0x40')]=[{'all':!![]}];}return db[_0xc8f4('0x2c')]['findAll'](_0x5ab6cb);})['then'](function(_0x413a55){_0x4d6c43[_0xc8f4('0x41')]=_0x413a55;return _0x4d6c43;})['then'](respondWithFilteredResult(_0x3a4b1b,_0x5ab6cb))[_0xc8f4('0x42')](handleError(_0x3a4b1b,null));};exports[_0xc8f4('0x43')]=function(_0x530b69,_0x5a85bb){var _0x3c8569={'raw':![],'where':{'id':_0x530b69[_0xc8f4('0x44')]['id']}},_0x342c28={};_0x342c28[_0xc8f4('0x33')]=_[_0xc8f4('0x45')](db[_0xc8f4('0x2c')]['rawAttributes']);_0x342c28['query']=_[_0xc8f4('0x45')](_0x530b69[_0xc8f4('0x31')]);_0x342c28[_0xc8f4('0x32')]=_['intersection'](_0x342c28['model'],_0x342c28['query']);_0x3c8569['attributes']=_['intersection'](_0x342c28[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0x530b69[_0xc8f4('0x31')][_0xc8f4('0x35')]));_0x3c8569[_0xc8f4('0x34')]=_0x3c8569[_0xc8f4('0x34')]['length']?_0x3c8569[_0xc8f4('0x34')]:_0x342c28[_0xc8f4('0x33')];if(_0x530b69['query']['includeAll']){_0x3c8569[_0xc8f4('0x40')]=[{'all':!![]}];}_0x3c8569=_[_0xc8f4('0x3d')]({},_0x3c8569,_0x530b69[_0xc8f4('0x3e')]);return db[_0xc8f4('0x2c')]['find'](_0x3c8569)['then'](handleEntityNotFound(_0x5a85bb,null))[_0xc8f4('0x24')](respondWithResult(_0x5a85bb,null))[_0xc8f4('0x42')](handleError(_0x5a85bb,null));};exports[_0xc8f4('0x46')]=function(_0x2bc4db,_0x141f81){return db[_0xc8f4('0x2c')]['create'](_0x2bc4db['body'],{})[_0xc8f4('0x24')](function(_0x447473){var _0x199b7d=_0x2bc4db[_0xc8f4('0x47')][_0xc8f4('0x48')]({'plain':!![]});if(!_0x199b7d)throw new Error(_0xc8f4('0x49'));if(_0x199b7d[_0xc8f4('0x4a')]===_0xc8f4('0x47')){var _0x3d9d67=_0x447473['get']({'plain':!![]});var _0x5c7768=_0xc8f4('0x26');return db[_0xc8f4('0x4b')][_0xc8f4('0x4c')]({'where':{'name':_0x5c7768,'userProfileId':_0x199b7d[_0xc8f4('0x4d')]},'raw':!![]})[_0xc8f4('0x24')](function(_0x165aac){if(_0x165aac&&_0x165aac[_0xc8f4('0x4e')]===0x0){return db[_0xc8f4('0x4f')][_0xc8f4('0x46')]({'name':_0x3d9d67[_0xc8f4('0x29')],'resourceId':_0x3d9d67['id'],'type':_0x165aac[_0xc8f4('0x29')],'sectionId':_0x165aac['id']},{})[_0xc8f4('0x24')](function(){return _0x447473;});}else{return _0x447473;}})[_0xc8f4('0x42')](function(_0x4ec67d){logger[_0xc8f4('0x27')](_0xc8f4('0x50'),_0x4ec67d);throw _0x4ec67d;});}return _0x447473;})[_0xc8f4('0x24')](respondWithResult(_0x141f81,0xc9))[_0xc8f4('0x42')](handleError(_0x141f81,null));};exports['clone']=function(_0xd6052d,_0x450059){var _0x4b4de3={'where':{'id':_0xd6052d[_0xc8f4('0x44')]['id']}},_0x47995c={};_0x47995c['model']=_[_0xc8f4('0x45')](db[_0xc8f4('0x2c')][_0xc8f4('0x2d')]);_0x4b4de3[_0xc8f4('0x34')]=_[_0xc8f4('0x51')](_0x47995c[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0xd6052d[_0xc8f4('0x31')][_0xc8f4('0x35')]));_0x4b4de3[_0xc8f4('0x34')]=_0x4b4de3[_0xc8f4('0x34')]['length']?_0x4b4de3[_0xc8f4('0x34')]:_0x47995c[_0xc8f4('0x33')];if(_0xd6052d[_0xc8f4('0x31')][_0xc8f4('0x3f')]){_0x4b4de3['include']=[{'all':!![]}];}_0x4b4de3=_[_0xc8f4('0x3d')]({},_0x4b4de3,_0xd6052d['options']);return db['JscriptyProject'][_0xc8f4('0x4c')](_0x4b4de3)[_0xc8f4('0x24')](handleEntityNotFound(_0x450059,null))[_0xc8f4('0x24')](function(_0x39cb77){if(_0x39cb77){var _0x2bfb92=_0x39cb77[_0xc8f4('0x48')]({'plain':!![]});_0x2bfb92=qs['omit'](_0x2bfb92,['id','createdAt',_0xc8f4('0x52')]);_0xd6052d[_0xc8f4('0x53')]=_[_0xc8f4('0x54')](_0xd6052d[_0xc8f4('0x53')],['id',_0xc8f4('0x55'),_0xc8f4('0x52')]);return db[_0xc8f4('0x2c')]['create'](_[_0xc8f4('0x3d')](_0x2bfb92,_0xd6052d[_0xc8f4('0x53')]),{'include':_0xd6052d['query'][_0xc8f4('0x3f')]?[{'all':!![]}]:undefined})[_0xc8f4('0x24')](function(_0x9dbf80){var _0x5b8bf4=_0xd6052d[_0xc8f4('0x47')][_0xc8f4('0x48')]({'plain':!![]});if(!_0x5b8bf4)throw new Error(_0xc8f4('0x49'));if(_0x5b8bf4['role']===_0xc8f4('0x47')){var _0x470593=_0x9dbf80['get']({'plain':!![]});var _0x52e295=_0xc8f4('0x26');return db['UserProfileSection'][_0xc8f4('0x4c')]({'where':{'name':_0x52e295,'userProfileId':_0x5b8bf4[_0xc8f4('0x4d')]},'raw':!![]})['then'](function(_0x5f2781){if(_0x5f2781&&_0x5f2781['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x470593['name'],'resourceId':_0x470593['id'],'type':_0x5f2781[_0xc8f4('0x29')],'sectionId':_0x5f2781['id']},{})['then'](function(){return _0x9dbf80;});}else{return _0x9dbf80;}})[_0xc8f4('0x42')](function(_0x357e45){logger[_0xc8f4('0x27')](_0xc8f4('0x50'),_0x357e45);throw _0x357e45;});}return _0x9dbf80;});}})['then'](respondWithResult(_0x450059,0xc9))[_0xc8f4('0x42')](handleError(_0x450059,null));};exports[_0xc8f4('0x56')]=function(_0x3ca2ca,_0xb50e61){if(_0x3ca2ca['body']['id']){delete _0x3ca2ca[_0xc8f4('0x53')]['id'];}return db[_0xc8f4('0x2c')][_0xc8f4('0x4c')]({'where':{'id':_0x3ca2ca[_0xc8f4('0x44')]['id']}})['then'](handleEntityNotFound(_0xb50e61,null))[_0xc8f4('0x24')](saveUpdates(_0x3ca2ca[_0xc8f4('0x53')],null))['then'](respondWithResult(_0xb50e61,null))[_0xc8f4('0x42')](handleError(_0xb50e61,null));};exports[_0xc8f4('0x25')]=function(_0x42b9df,_0x262fca){return db[_0xc8f4('0x2c')][_0xc8f4('0x4c')]({'where':{'id':_0x42b9df['params']['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x262fca,null))[_0xc8f4('0x24')](removeEntity(_0x262fca,null))[_0xc8f4('0x42')](handleError(_0x262fca,null));};exports['getSessions']=function(_0x28db1f,_0x2b6510,_0x3cc1cb){var _0x498578={'raw':!![],'where':{}};var _0x199873={};var _0x38a486={'count':0x0,'rows':[]};return db[_0xc8f4('0x2c')][_0xc8f4('0x57')]({'where':{'id':_0x28db1f['params']['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x2b6510,null))[_0xc8f4('0x24')](function(_0x5500a9){if(_0x5500a9){_0x199873[_0xc8f4('0x33')]=_[_0xc8f4('0x45')](db['JscriptySessionReport'][_0xc8f4('0x2d')]);_0x199873[_0xc8f4('0x31')]=_[_0xc8f4('0x45')](_0x28db1f[_0xc8f4('0x31')]);_0x199873[_0xc8f4('0x32')]=_[_0xc8f4('0x51')](_0x199873[_0xc8f4('0x33')],_0x199873[_0xc8f4('0x31')]);_0x498578['attributes']=_[_0xc8f4('0x51')](_0x199873[_0xc8f4('0x33')],qs[_0xc8f4('0x35')](_0x28db1f[_0xc8f4('0x31')][_0xc8f4('0x35')]));_0x498578['attributes']=_0x498578[_0xc8f4('0x34')]['length']?_0x498578[_0xc8f4('0x34')]:_0x199873[_0xc8f4('0x33')];if(!_0x28db1f[_0xc8f4('0x31')][_0xc8f4('0x37')](_0xc8f4('0x38'))){_0x498578[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0x28db1f[_0xc8f4('0x31')][_0xc8f4('0x1e')]);_0x498578[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0x28db1f['query'][_0xc8f4('0x1d')]);}_0x498578[_0xc8f4('0x58')]=qs[_0xc8f4('0x39')](_0x28db1f[_0xc8f4('0x31')]['sort']);_0x498578['where']=qs[_0xc8f4('0x32')](_['pick'](_0x28db1f[_0xc8f4('0x31')],_0x199873['filters']));_0x498578[_0xc8f4('0x3c')]['ProjectId']=_0x5500a9['id'];if(_0x28db1f['query']['filter']){_0x498578['where']=_['merge'](_0x498578['where'],{'$or':_[_0xc8f4('0x2b')](_0x498578['attributes'],function(_0x1db7ea){var _0x3ad7dd={};_0x3ad7dd[_0x1db7ea]={'$like':'%'+_0x28db1f[_0xc8f4('0x31')][_0xc8f4('0x3b')]+'%'};return _0x3ad7dd;})});}_0x498578=_[_0xc8f4('0x3d')]({},_0x498578,_0x28db1f['options']);return db[_0xc8f4('0x59')][_0xc8f4('0x1c')]({'where':_0x498578[_0xc8f4('0x3c')]})['then'](function(_0x6da52){_0x38a486[_0xc8f4('0x1c')]=_0x6da52;if(_0x28db1f[_0xc8f4('0x31')][_0xc8f4('0x3f')]){_0x498578[_0xc8f4('0x40')]=[{'all':!![]}];}return db[_0xc8f4('0x59')][_0xc8f4('0x5a')](_0x498578);})[_0xc8f4('0x24')](function(_0x4d7018){_0x38a486[_0xc8f4('0x41')]=_0x4d7018;return _0x38a486;});}})[_0xc8f4('0x24')](respondWithFilteredResult(_0x2b6510,_0x498578))[_0xc8f4('0x42')](handleError(_0x2b6510,null));};exports[_0xc8f4('0x5b')]=function(_0xf2a4d7,_0x17c918,_0x16daa0){var _0xd17d2b={'raw':!![],'where':{}};var _0x14abbe={};var _0x2534ed={'count':0x0,'rows':[]};return db[_0xc8f4('0x2c')]['findOne']({'where':{'id':_0xf2a4d7[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x17c918,null))['then'](function(_0x412695){if(_0x412695){_0x14abbe[_0xc8f4('0x33')]=_['keys'](db[_0xc8f4('0x5c')][_0xc8f4('0x2d')]);_0x14abbe['query']=_['keys'](_0xf2a4d7[_0xc8f4('0x31')]);_0x14abbe[_0xc8f4('0x32')]=_[_0xc8f4('0x51')](_0x14abbe['model'],_0x14abbe[_0xc8f4('0x31')]);_0xd17d2b[_0xc8f4('0x34')]=_['intersection'](_0x14abbe['model'],qs[_0xc8f4('0x35')](_0xf2a4d7[_0xc8f4('0x31')][_0xc8f4('0x35')]));_0xd17d2b['attributes']=_0xd17d2b[_0xc8f4('0x34')][_0xc8f4('0x36')]?_0xd17d2b[_0xc8f4('0x34')]:_0x14abbe['model'];if(!_0xf2a4d7[_0xc8f4('0x31')][_0xc8f4('0x37')](_0xc8f4('0x38'))){_0xd17d2b[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0xf2a4d7[_0xc8f4('0x31')][_0xc8f4('0x1e')]);_0xd17d2b[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0xf2a4d7[_0xc8f4('0x31')][_0xc8f4('0x1d')]);}_0xd17d2b['order']=qs[_0xc8f4('0x39')](_0xf2a4d7['query'][_0xc8f4('0x39')]);_0xd17d2b[_0xc8f4('0x3c')]=qs[_0xc8f4('0x32')](_[_0xc8f4('0x3a')](_0xf2a4d7[_0xc8f4('0x31')],_0x14abbe[_0xc8f4('0x32')]));_0xd17d2b[_0xc8f4('0x3c')][_0xc8f4('0x5d')]=_0x412695['id'];if(_0xf2a4d7['query'][_0xc8f4('0x3b')]){_0xd17d2b['where']=_['merge'](_0xd17d2b[_0xc8f4('0x3c')],{'$or':_[_0xc8f4('0x2b')](_0xd17d2b[_0xc8f4('0x34')],function(_0x4fedd9){var _0x4c8e98={};_0x4c8e98[_0x4fedd9]={'$like':'%'+_0xf2a4d7[_0xc8f4('0x31')][_0xc8f4('0x3b')]+'%'};return _0x4c8e98;})});}_0xd17d2b=_[_0xc8f4('0x3d')]({},_0xd17d2b,_0xf2a4d7['options']);return db[_0xc8f4('0x5c')]['count']({'where':_0xd17d2b[_0xc8f4('0x3c')]})[_0xc8f4('0x24')](function(_0x30a87f){_0x2534ed[_0xc8f4('0x1c')]=_0x30a87f;if(_0xf2a4d7[_0xc8f4('0x31')]['includeAll']){_0xd17d2b[_0xc8f4('0x40')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc8f4('0x5a')](_0xd17d2b);})[_0xc8f4('0x24')](function(_0x1499fe){_0x2534ed[_0xc8f4('0x41')]=_0x1499fe;return _0x2534ed;});}})[_0xc8f4('0x24')](respondWithFilteredResult(_0x17c918,_0xd17d2b))[_0xc8f4('0x42')](handleError(_0x17c918,null));};function char(_0x3f1852){return _0xc8f4('0x5e')===typeof _0x3f1852?String[_0xc8f4('0x5f')][_0xc8f4('0x21')](null,arguments):_0x3f1852;}function needsEncapsulation(_0x28bcf0){return!!_0x28bcf0&&(_0x28bcf0['toString']()['indexOf'](char(0xd))>=0x0||_0x28bcf0[_0xc8f4('0x60')]()[_0xc8f4('0x61')](char(0xa))>=0x0||_0x28bcf0[_0xc8f4('0x60')]()[_0xc8f4('0x61')](char(0x2c))>=0x0||_0x28bcf0[_0xc8f4('0x60')]()[_0xc8f4('0x61')](char(0x22))>=0x0);}function encapsulate(_0x1c4763){var _0x13b1ad=char(0x22),_0xa6af22='\x5c'+char(0x22),_0x7758c2=_0x1c4763[_0xc8f4('0x60')]()[_0xc8f4('0x62')](new RegExp(_0x13b1ad,'g'),_0xa6af22);return _0x13b1ad+_0x7758c2+_0x13b1ad;}exports['getSummary']=function(_0x4971f7,_0x41a76a,_0x57c332){var _0x51ea01,_0x169ef3;var _0x4c525e={'where':{'ProjectId':_0x4971f7['params']['id']}};if(_0x4971f7['query']['startTime']){_0x4c525e['where'][_0xc8f4('0x63')]=JSON[_0xc8f4('0x64')](_0x4971f7[_0xc8f4('0x31')][_0xc8f4('0x65')]);}return db[_0xc8f4('0x59')][_0xc8f4('0x5a')](_0x4c525e)[_0xc8f4('0x24')](handleEntityNotFound(_0x41a76a,null))[_0xc8f4('0x24')](function(_0x1425c7){if(_0x1425c7){_0x51ea01=_0x1425c7;return db[_0xc8f4('0x66')][_0xc8f4('0x5a')]({'where':{'SessionId':{'$in':_[_0xc8f4('0x2b')](_0x51ea01,'id')},'ProjectId':_0x4971f7[_0xc8f4('0x44')]['id']},'order':_0xc8f4('0x67')});}})[_0xc8f4('0x24')](handleEntityNotFound(_0x41a76a,null))[_0xc8f4('0x24')](function(_0x3a86b2){if(_0x3a86b2){_0x169ef3=_0x3a86b2;var _0x20ea4d={};for(var _0xd8a37c=0x0,_0x35c5e9=_0x169ef3[_0xc8f4('0x36')];_0xd8a37c<_0x35c5e9;_0xd8a37c++){if(!_0x20ea4d[_0xc8f4('0x37')](_0x169ef3[_0xd8a37c][_0xc8f4('0x68')])){_0x20ea4d[_0x169ef3[_0xd8a37c]['questionId']]=needsEncapsulation(_0x169ef3[_0xd8a37c]['question'])?encapsulate(_0x169ef3[_0xd8a37c][_0xc8f4('0x69')]):_0x169ef3[_0xd8a37c][_0xc8f4('0x69')];}}var _0x35190f=[],_0xe6b7eb={};for(var _0x1f5a30=0x0,_0x427f72=_0x51ea01[_0xc8f4('0x36')];_0x1f5a30<_0x427f72;_0x1f5a30++){_0xe6b7eb={'ProjectId':_0x4971f7[_0xc8f4('0x44')]['id'],'SessionId':_0x51ea01[_0x1f5a30]['id'],'StartTime':moment(_0x51ea01[_0x1f5a30][_0xc8f4('0x63')])[_0xc8f4('0x6a')](_0xc8f4('0x6b'))};for(var _0x1bd476=0x0,_0x697807=_0x169ef3[_0xc8f4('0x36')];_0x1bd476<_0x697807;_0x1bd476++){if(_0x169ef3[_0x1bd476]['SessionId']==_0x51ea01[_0x1f5a30]['id']&&_0x20ea4d[_0xc8f4('0x37')](_0x169ef3[_0x1bd476][_0xc8f4('0x68')])){_0xe6b7eb[_0x20ea4d[_0x169ef3[_0x1bd476][_0xc8f4('0x68')]]]=_0x169ef3[_0x1bd476][_0xc8f4('0x6c')];}}for(var _0x464b77 in _0x20ea4d){if(!_0xe6b7eb['hasOwnProperty'](_0x20ea4d[_0x464b77])){_0xe6b7eb[_0x20ea4d[_0x464b77]]=null;}}_0x35190f[_0xc8f4('0x6d')](_0xe6b7eb);}return _0x35190f;}})[_0xc8f4('0x24')](function(_0x5a5f87){if(!_['isEmpty'](_0x5a5f87)){var _0x3930c1=toCsv(_0x5a5f87);var _0x18e362=Date[_0xc8f4('0x6e')]();fs[_0xc8f4('0x6f')](util[_0xc8f4('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4971f7['params']['id'],_0x18e362),_0x3930c1);_0x41a76a[_0xc8f4('0x70')](_0xc8f4('0x71'),'attachment;\x20filename='+util[_0xc8f4('0x6a')](_0xc8f4('0x72'),_0x4971f7[_0xc8f4('0x44')]['id'],_0x18e362));_0x41a76a[_0xc8f4('0x70')](_0xc8f4('0x73'),_0xc8f4('0x74'));return _0x41a76a[_0xc8f4('0x75')](util[_0xc8f4('0x6a')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4971f7[_0xc8f4('0x44')]['id'],_0x18e362));}else{return _0x41a76a[_0xc8f4('0x17')](0xcc);}})[_0xc8f4('0x42')](handleError(_0x41a76a,null));};
\ No newline at end of file
index 34aaced..fec6001 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10af=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','JscriptyProject','jscripty_projects'];(function(_0x13e1d9,_0x479e22){var _0x5e3c69=function(_0x314654){while(--_0x314654){_0x13e1d9['push'](_0x13e1d9['shift']());}};_0x5e3c69(++_0x479e22);}(_0x10af,0xfc));var _0xf10a=function(_0x710815,_0x520da8){_0x710815=_0x710815-0x0;var _0x5b3b89=_0x10af[_0x710815];return _0x5b3b89;};'use strict';var _=require(_0xf10a('0x0'));var util=require('util');var logger=require(_0xf10a('0x1'))(_0xf10a('0x2'));var moment=require(_0xf10a('0x3'));var BPromise=require(_0xf10a('0x4'));var rp=require(_0xf10a('0x5'));var fs=require('fs');var path=require(_0xf10a('0x6'));var rimraf=require(_0xf10a('0x7'));var config=require(_0xf10a('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0xf10a('0x9')]=function(_0xf86ea1,_0x5c9a4c){return _0xf86ea1['define'](_0xf10a('0xa'),attributes,{'tableName':_0xf10a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0dec=['bluebird','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api'];(function(_0x1efc03,_0x494189){var _0x14c07e=function(_0x4d5004){while(--_0x4d5004){_0x1efc03['push'](_0x1efc03['shift']());}};_0x14c07e(++_0x494189);}(_0x0dec,0x11c));var _0xc0de=function(_0x382ea4,_0x391c9a){_0x382ea4=_0x382ea4-0x0;var _0x2fd31f=_0x0dec[_0x382ea4];return _0x2fd31f;};'use strict';var _=require(_0xc0de('0x0'));var util=require(_0xc0de('0x1'));var logger=require(_0xc0de('0x2'))(_0xc0de('0x3'));var moment=require('moment');var BPromise=require(_0xc0de('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc0de('0x5'));var config=require(_0xc0de('0x6'));var attributes=require(_0xc0de('0x7'));module[_0xc0de('0x8')]=function(_0xae49db,_0x194937){return _0xae49db[_0xc0de('0x9')](_0xc0de('0xa'),attributes,{'tableName':_0xc0de('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 41c58cf..5247ecf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac4a,0x13f));var _0xaac4=function(_0x3be372,_0x2a9b52){_0x3be372=_0x3be372-0x0;var _0x2b97c5=_0xac4a[_0x3be372];return _0x2b97c5;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});}
\ No newline at end of file
+var _0xe706=['http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2b7a1e,_0x216d92){var _0x1af4ab=function(_0x26368f){while(--_0x26368f){_0x2b7a1e['push'](_0x2b7a1e['shift']());}};_0x1af4ab(++_0x216d92);}(_0xe706,0xa3));var _0x6e70=function(_0x297dcf,_0x448cf5){_0x297dcf=_0x297dcf-0x0;var _0xe1699b=_0xe706[_0x297dcf];return _0xe1699b;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('JscriptyProject,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
index cc5534f..92d70a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4304=['exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x20bb0a,_0x21d1cc){var _0x3b58a0=function(_0x1909bf){while(--_0x1909bf){_0x20bb0a['push'](_0x20bb0a['shift']());}};_0x3b58a0(++_0x21d1cc);}(_0x4304,0x190));var _0x4430=function(_0x4e4e1f,_0x4eb293){_0x4e4e1f=_0x4e4e1f-0x0;var _0x28c519=_0x4304[_0x4e4e1f];return _0x28c519;};'use strict';var multer=require(_0x4430('0x0'));var util=require('util');var path=require(_0x4430('0x1'));var timeout=require(_0x4430('0x2'));var express=require('express');var router=express[_0x4430('0x3')]();var fs_extra=require(_0x4430('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4430('0x5'));var config=require(_0x4430('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0x4430('0x7')]('/',auth[_0x4430('0x8')](),controller['index']);router[_0x4430('0x7')](_0x4430('0x9'),auth[_0x4430('0x8')](),controller['describe']);router[_0x4430('0x7')](_0x4430('0xa'),auth[_0x4430('0x8')](),controller[_0x4430('0xb')]);router[_0x4430('0xc')]('/',auth['isAuthenticated'](),controller[_0x4430('0xd')]);router[_0x4430('0xe')](_0x4430('0xa'),auth['isAuthenticated'](),controller[_0x4430('0xf')]);router[_0x4430('0x10')](_0x4430('0xa'),auth[_0x4430('0x8')](),controller[_0x4430('0x11')]);module[_0x4430('0x12')]=router;
\ No newline at end of file
+var _0x8696=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','exports','multer','util','path'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8696,0x1eb));var _0x6869=function(_0x54ccac,_0x5777a1){_0x54ccac=_0x54ccac-0x0;var _0x3c63f1=_0x8696[_0x54ccac];return _0x3c63f1;};'use strict';var multer=require(_0x6869('0x0'));var util=require(_0x6869('0x1'));var path=require(_0x6869('0x2'));var timeout=require(_0x6869('0x3'));var express=require('express');var router=express[_0x6869('0x4')]();var fs_extra=require(_0x6869('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6869('0x6'));var config=require(_0x6869('0x7'));var controller=require('./jscriptyQuestionReport.controller');router[_0x6869('0x8')]('/',auth[_0x6869('0x9')](),controller[_0x6869('0xa')]);router[_0x6869('0x8')](_0x6869('0xb'),auth[_0x6869('0x9')](),controller[_0x6869('0xc')]);router[_0x6869('0x8')](_0x6869('0xd'),auth[_0x6869('0x9')](),controller['show']);router[_0x6869('0xe')]('/',auth[_0x6869('0x9')](),controller[_0x6869('0xf')]);router[_0x6869('0x10')](_0x6869('0xd'),auth[_0x6869('0x9')](),controller['update']);router[_0x6869('0x11')](_0x6869('0xd'),auth[_0x6869('0x9')](),controller['destroy']);module[_0x6869('0x12')]=router;
\ No newline at end of file
index 3545d9b..8f09bbf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x7a54,0x106));var _0x47a5=function(_0x283821,_0x2235fc){_0x283821=_0x283821-0x0;var _0x1d1973=_0x7a54[_0x283821];return _0x1d1973;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x7a54,0x106));var _0x47a5=function(_0x4ad22c,_0x57dc67){_0x4ad22c=_0x4ad22c-0x0;var _0x121dd1=_0x7a54[_0x4ad22c];return _0x121dd1;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
index 4ae3bfe..4adb60a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b13=['fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','intersection','fields','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport'];(function(_0x9e9ead,_0x1a7ff3){var _0x31ff57=function(_0x22a9da){while(--_0x22a9da){_0x9e9ead['push'](_0x9e9ead['shift']());}};_0x31ff57(++_0x1a7ff3);}(_0x5b13,0x10c));var _0x35b1=function(_0x2fbdeb,_0xfd0bfd){_0x2fbdeb=_0x2fbdeb-0x0;var _0x1c947d=_0x5b13[_0x2fbdeb];return _0x1c947d;};'use strict';var emlformat=require(_0x35b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x35b1('0x1'));var jsonpatch=require(_0x35b1('0x2'));var rp=require(_0x35b1('0x3'));var moment=require(_0x35b1('0x4'));var BPromise=require(_0x35b1('0x5'));var Mustache=require('mustache');var util=require(_0x35b1('0x6'));var path=require(_0x35b1('0x7'));var sox=require(_0x35b1('0x8'));var csv=require(_0x35b1('0x9'));var ejs=require(_0x35b1('0xa'));var fs=require('fs');var fs_extra=require(_0x35b1('0xb'));var _=require(_0x35b1('0xc'));var squel=require('squel');var crypto=require(_0x35b1('0xd'));var jsforce=require(_0x35b1('0xe'));var deskjs=require(_0x35b1('0xf'));var toCsv=require(_0x35b1('0x9'));var querystring=require(_0x35b1('0x10'));var Papa=require(_0x35b1('0x11'));var Redis=require(_0x35b1('0x12'));var authService=require(_0x35b1('0x13'));var qs=require(_0x35b1('0x14'));var as=require(_0x35b1('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35b1('0x16'))(_0x35b1('0x17'));var utils=require('../../config/utils');var config=require(_0x35b1('0x18'));var licenseUtil=require(_0x35b1('0x19'));var db=require(_0x35b1('0x1a'))['db'];function respondWithStatusCode(_0x3332b2,_0x3a884f){_0x3a884f=_0x3a884f||0xcc;return function(_0x533732){if(_0x533732){return _0x3332b2[_0x35b1('0x1b')](_0x3a884f);}return _0x3332b2[_0x35b1('0x1c')](_0x3a884f)[_0x35b1('0x1d')]();};}function respondWithResult(_0x15f1be,_0x202dfe){_0x202dfe=_0x202dfe||0xc8;return function(_0x32cc13){if(_0x32cc13){return _0x15f1be[_0x35b1('0x1c')](_0x202dfe)['json'](_0x32cc13);}};}function respondWithFilteredResult(_0x2997d6,_0x49e255){return function(_0x4e0458){if(_0x4e0458){var _0x42f51c=typeof _0x49e255['offset']===_0x35b1('0x1e')&&typeof _0x49e255[_0x35b1('0x1f')]==='undefined';var _0xecdbfa=_0x4e0458[_0x35b1('0x20')];var _0x936592=_0x42f51c?0x0:_0x49e255[_0x35b1('0x21')];var _0x20642b=_0x42f51c?_0x4e0458[_0x35b1('0x20')]:_0x49e255[_0x35b1('0x21')]+_0x49e255[_0x35b1('0x1f')];var _0x437997;if(_0x20642b>=_0xecdbfa){_0x20642b=_0xecdbfa;_0x437997=0xc8;}else{_0x437997=0xce;}_0x2997d6[_0x35b1('0x1c')](_0x437997);return _0x2997d6[_0x35b1('0x22')](_0x35b1('0x23'),_0x936592+'-'+_0x20642b+'/'+_0xecdbfa)['json'](_0x4e0458);}return null;};}function patchUpdates(_0x25ac59){return function(_0xd83825){try{jsonpatch['apply'](_0xd83825,_0x25ac59,!![]);}catch(_0x28bb4b){return BPromise[_0x35b1('0x24')](_0x28bb4b);}return _0xd83825[_0x35b1('0x25')]();};}function saveUpdates(_0xa1102,_0x30a907){return function(_0x526f19){if(_0x526f19){return _0x526f19[_0x35b1('0x26')](_0xa1102)[_0x35b1('0x27')](function(_0x15e44b){return _0x15e44b;});}return null;};}function removeEntity(_0x268a66,_0x326818){return function(_0x22bff5){if(_0x22bff5){return _0x22bff5[_0x35b1('0x28')]()[_0x35b1('0x27')](function(){_0x268a66[_0x35b1('0x1c')](0xcc)[_0x35b1('0x1d')]();});}};}function handleEntityNotFound(_0x566481,_0xe37357){return function(_0x2034ff){if(!_0x2034ff){_0x566481[_0x35b1('0x1b')](0x194);}return _0x2034ff;};}function handleError(_0x472ca3,_0x5c5278){_0x5c5278=_0x5c5278||0x1f4;return function(_0x57205a){logger[_0x35b1('0x29')](_0x57205a[_0x35b1('0x2a')]);if(_0x57205a[_0x35b1('0x2b')]){delete _0x57205a[_0x35b1('0x2b')];}_0x472ca3[_0x35b1('0x1c')](_0x5c5278)[_0x35b1('0x2c')](_0x57205a);};}exports[_0x35b1('0x2d')]=function(_0x205b8f,_0x2307a4){var _0x182710={},_0x4b7990={},_0x4d660c={'count':0x0,'rows':[]};var _0x4b8c58=_[_0x35b1('0x2e')](db[_0x35b1('0x2f')]['rawAttributes'],function(_0x3f338a){return{'name':_0x3f338a[_0x35b1('0x30')],'type':_0x3f338a[_0x35b1('0x31')][_0x35b1('0x32')]};});_0x4b7990[_0x35b1('0x33')]=_[_0x35b1('0x2e')](_0x4b8c58,_0x35b1('0x2b'));_0x4b7990[_0x35b1('0x34')]=_[_0x35b1('0x35')](_0x205b8f[_0x35b1('0x34')]);_0x4b7990[_0x35b1('0x36')]=_['intersection'](_0x4b7990['model'],_0x4b7990['query']);_0x182710['attributes']=_['intersection'](_0x4b7990[_0x35b1('0x33')],qs['fields'](_0x205b8f[_0x35b1('0x34')]['fields']));_0x182710['attributes']=_0x182710[_0x35b1('0x37')][_0x35b1('0x38')]?_0x182710['attributes']:_0x4b7990['model'];if(!_0x205b8f[_0x35b1('0x34')][_0x35b1('0x39')](_0x35b1('0x3a'))){_0x182710[_0x35b1('0x1f')]=qs[_0x35b1('0x1f')](_0x205b8f[_0x35b1('0x34')][_0x35b1('0x1f')]);_0x182710[_0x35b1('0x21')]=qs[_0x35b1('0x21')](_0x205b8f['query'][_0x35b1('0x21')]);}_0x182710[_0x35b1('0x3b')]=qs['sort'](_0x205b8f[_0x35b1('0x34')]['sort']);_0x182710[_0x35b1('0x3c')]=qs[_0x35b1('0x36')](_[_0x35b1('0x3d')](_0x205b8f[_0x35b1('0x34')],_0x4b7990[_0x35b1('0x36')]),_0x4b8c58);if(_0x205b8f[_0x35b1('0x34')][_0x35b1('0x3e')]){_0x182710[_0x35b1('0x3c')]=_[_0x35b1('0x3f')](_0x182710['where'],{'$or':_[_0x35b1('0x2e')](_0x4b8c58,function(_0xffd688){if(_0xffd688['type']!==_0x35b1('0x40')){var _0x26cbfc={};_0x26cbfc[_0xffd688[_0x35b1('0x2b')]]={'$like':'%'+_0x205b8f[_0x35b1('0x34')]['filter']+'%'};return _0x26cbfc;}})});}_0x182710=_['merge']({},_0x182710,_0x205b8f[_0x35b1('0x41')]);var _0x2e749b={'where':_0x182710[_0x35b1('0x3c')]};return db[_0x35b1('0x2f')][_0x35b1('0x20')](_0x2e749b)[_0x35b1('0x27')](function(_0x116271){_0x4d660c['count']=_0x116271;if(_0x205b8f[_0x35b1('0x34')][_0x35b1('0x42')]){_0x182710[_0x35b1('0x43')]=[{'all':!![]}];}return db[_0x35b1('0x2f')]['findAll'](_0x182710);})[_0x35b1('0x27')](function(_0xa8da9d){_0x4d660c[_0x35b1('0x44')]=_0xa8da9d;return _0x4d660c;})['then'](respondWithFilteredResult(_0x2307a4,_0x182710))[_0x35b1('0x45')](handleError(_0x2307a4,null));};exports[_0x35b1('0x46')]=function(_0x43f890,_0x9c2d5b){var _0x1b6567={'raw':!![],'where':{'id':_0x43f890[_0x35b1('0x47')]['id']}},_0x23d1f4={};_0x23d1f4[_0x35b1('0x33')]=_[_0x35b1('0x35')](db['JscriptyQuestionReport'][_0x35b1('0x48')]);_0x23d1f4[_0x35b1('0x34')]=_[_0x35b1('0x35')](_0x43f890[_0x35b1('0x34')]);_0x23d1f4[_0x35b1('0x36')]=_[_0x35b1('0x49')](_0x23d1f4[_0x35b1('0x33')],_0x23d1f4[_0x35b1('0x34')]);_0x1b6567[_0x35b1('0x37')]=_[_0x35b1('0x49')](_0x23d1f4['model'],qs[_0x35b1('0x4a')](_0x43f890['query'][_0x35b1('0x4a')]));_0x1b6567[_0x35b1('0x37')]=_0x1b6567['attributes'][_0x35b1('0x38')]?_0x1b6567[_0x35b1('0x37')]:_0x23d1f4['model'];if(_0x43f890[_0x35b1('0x34')]['includeAll']){_0x1b6567['include']=[{'all':!![]}];}_0x1b6567=_[_0x35b1('0x3f')]({},_0x1b6567,_0x43f890[_0x35b1('0x41')]);return db['JscriptyQuestionReport'][_0x35b1('0x4b')](_0x1b6567)[_0x35b1('0x27')](handleEntityNotFound(_0x9c2d5b,null))[_0x35b1('0x27')](respondWithResult(_0x9c2d5b,null))[_0x35b1('0x45')](handleError(_0x9c2d5b,null));};exports[_0x35b1('0x4c')]=function(_0x46471a,_0x4e36a9){return db['JscriptyQuestionReport'][_0x35b1('0x4c')](_0x46471a[_0x35b1('0x4d')],{})[_0x35b1('0x27')](respondWithResult(_0x4e36a9,0xc9))[_0x35b1('0x45')](handleError(_0x4e36a9,null));};exports[_0x35b1('0x26')]=function(_0x53cc68,_0x21c128){if(_0x53cc68[_0x35b1('0x4d')]['id']){delete _0x53cc68[_0x35b1('0x4d')]['id'];}return db[_0x35b1('0x2f')][_0x35b1('0x4b')]({'where':{'id':_0x53cc68['params']['id']}})[_0x35b1('0x27')](handleEntityNotFound(_0x21c128,null))[_0x35b1('0x27')](saveUpdates(_0x53cc68[_0x35b1('0x4d')],null))['then'](respondWithResult(_0x21c128,null))[_0x35b1('0x45')](handleError(_0x21c128,null));};exports[_0x35b1('0x28')]=function(_0x10e18a,_0x1405d9){return db[_0x35b1('0x2f')][_0x35b1('0x4b')]({'where':{'id':_0x10e18a[_0x35b1('0x47')]['id']}})[_0x35b1('0x27')](handleEntityNotFound(_0x1405d9,null))['then'](removeEntity(_0x1405d9,null))[_0x35b1('0x45')](handleError(_0x1405d9,null));};exports[_0x35b1('0x4e')]=function(_0x20cfbc,_0x4e8c4d){return db['JscriptyQuestionReport']['describe']()[_0x35b1('0x27')](respondWithResult(_0x4e8c4d,null))[_0x35b1('0x45')](handleError(_0x4e8c4d,null));};
\ No newline at end of file
+var _0x52d1=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','show','params','include','options','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes'];(function(_0x1b510d,_0x2fce0d){var _0x4aec7a=function(_0x13fbdb){while(--_0x13fbdb){_0x1b510d['push'](_0x1b510d['shift']());}};_0x4aec7a(++_0x2fce0d);}(_0x52d1,0x66));var _0x152d=function(_0x2e472b,_0x363a0f){_0x2e472b=_0x2e472b-0x0;var _0xbb844a=_0x52d1[_0x2e472b];return _0xbb844a;};'use strict';var emlformat=require(_0x152d('0x0'));var rimraf=require(_0x152d('0x1'));var zipdir=require(_0x152d('0x2'));var jsonpatch=require(_0x152d('0x3'));var rp=require(_0x152d('0x4'));var moment=require(_0x152d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x152d('0x6'));var sox=require(_0x152d('0x7'));var csv=require(_0x152d('0x8'));var ejs=require(_0x152d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x152d('0xa'));var crypto=require(_0x152d('0xb'));var jsforce=require(_0x152d('0xc'));var deskjs=require(_0x152d('0xd'));var toCsv=require(_0x152d('0x8'));var querystring=require('querystring');var Papa=require(_0x152d('0xe'));var Redis=require(_0x152d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x152d('0x10'));var as=require(_0x152d('0x11'));var hardwareService=require(_0x152d('0x12'));var logger=require(_0x152d('0x13'))(_0x152d('0x14'));var utils=require(_0x152d('0x15'));var config=require(_0x152d('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a3596,_0xb353b){_0xb353b=_0xb353b||0xcc;return function(_0x4c6d75){if(_0x4c6d75){return _0x1a3596['sendStatus'](_0xb353b);}return _0x1a3596[_0x152d('0x17')](_0xb353b)[_0x152d('0x18')]();};}function respondWithResult(_0x59e5f6,_0x5a866e){_0x5a866e=_0x5a866e||0xc8;return function(_0x3e3518){if(_0x3e3518){return _0x59e5f6[_0x152d('0x17')](_0x5a866e)[_0x152d('0x19')](_0x3e3518);}};}function respondWithFilteredResult(_0x14a10a,_0x1ac87e){return function(_0x346613){if(_0x346613){var _0x2de9e8=typeof _0x1ac87e[_0x152d('0x1a')]===_0x152d('0x1b')&&typeof _0x1ac87e[_0x152d('0x1c')]===_0x152d('0x1b');var _0x50582d=_0x346613['count'];var _0x544074=_0x2de9e8?0x0:_0x1ac87e[_0x152d('0x1a')];var _0x4f8105=_0x2de9e8?_0x346613[_0x152d('0x1d')]:_0x1ac87e['offset']+_0x1ac87e[_0x152d('0x1c')];var _0x898e01;if(_0x4f8105>=_0x50582d){_0x4f8105=_0x50582d;_0x898e01=0xc8;}else{_0x898e01=0xce;}_0x14a10a[_0x152d('0x17')](_0x898e01);return _0x14a10a['set'](_0x152d('0x1e'),_0x544074+'-'+_0x4f8105+'/'+_0x50582d)['json'](_0x346613);}return null;};}function patchUpdates(_0x418d1a){return function(_0x194d25){try{jsonpatch[_0x152d('0x1f')](_0x194d25,_0x418d1a,!![]);}catch(_0x3a05bb){return BPromise[_0x152d('0x20')](_0x3a05bb);}return _0x194d25[_0x152d('0x21')]();};}function saveUpdates(_0x5189d4,_0x190488){return function(_0x2b9e15){if(_0x2b9e15){return _0x2b9e15['update'](_0x5189d4)['then'](function(_0x560e41){return _0x560e41;});}return null;};}function removeEntity(_0x53b802,_0x242d94){return function(_0xb50079){if(_0xb50079){return _0xb50079['destroy']()[_0x152d('0x22')](function(){_0x53b802[_0x152d('0x17')](0xcc)[_0x152d('0x18')]();});}};}function handleEntityNotFound(_0x5808f0,_0x48deb4){return function(_0x3fc9ef){if(!_0x3fc9ef){_0x5808f0['sendStatus'](0x194);}return _0x3fc9ef;};}function handleError(_0x17a852,_0x76d992){_0x76d992=_0x76d992||0x1f4;return function(_0x430f46){logger[_0x152d('0x23')](_0x430f46[_0x152d('0x24')]);if(_0x430f46[_0x152d('0x25')]){delete _0x430f46[_0x152d('0x25')];}_0x17a852[_0x152d('0x17')](_0x76d992)[_0x152d('0x26')](_0x430f46);};}exports[_0x152d('0x27')]=function(_0x19830d,_0x4e2102){var _0xc9f5b4={},_0x2dd536={},_0x19c4f7={'count':0x0,'rows':[]};var _0x390da7=_[_0x152d('0x28')](db[_0x152d('0x29')][_0x152d('0x2a')],function(_0x5354c5){return{'name':_0x5354c5[_0x152d('0x2b')],'type':_0x5354c5[_0x152d('0x2c')][_0x152d('0x2d')]};});_0x2dd536['model']=_[_0x152d('0x28')](_0x390da7,_0x152d('0x25'));_0x2dd536[_0x152d('0x2e')]=_[_0x152d('0x2f')](_0x19830d[_0x152d('0x2e')]);_0x2dd536[_0x152d('0x30')]=_[_0x152d('0x31')](_0x2dd536[_0x152d('0x32')],_0x2dd536['query']);_0xc9f5b4[_0x152d('0x33')]=_['intersection'](_0x2dd536[_0x152d('0x32')],qs[_0x152d('0x34')](_0x19830d['query'][_0x152d('0x34')]));_0xc9f5b4[_0x152d('0x33')]=_0xc9f5b4[_0x152d('0x33')][_0x152d('0x35')]?_0xc9f5b4[_0x152d('0x33')]:_0x2dd536[_0x152d('0x32')];if(!_0x19830d[_0x152d('0x2e')][_0x152d('0x36')](_0x152d('0x37'))){_0xc9f5b4[_0x152d('0x1c')]=qs[_0x152d('0x1c')](_0x19830d[_0x152d('0x2e')][_0x152d('0x1c')]);_0xc9f5b4[_0x152d('0x1a')]=qs['offset'](_0x19830d['query'][_0x152d('0x1a')]);}_0xc9f5b4[_0x152d('0x38')]=qs[_0x152d('0x39')](_0x19830d[_0x152d('0x2e')][_0x152d('0x39')]);_0xc9f5b4[_0x152d('0x3a')]=qs['filters'](_[_0x152d('0x3b')](_0x19830d[_0x152d('0x2e')],_0x2dd536[_0x152d('0x30')]),_0x390da7);if(_0x19830d['query'][_0x152d('0x3c')]){_0xc9f5b4[_0x152d('0x3a')]=_['merge'](_0xc9f5b4['where'],{'$or':_[_0x152d('0x28')](_0x390da7,function(_0xe08c94){if(_0xe08c94['type']!==_0x152d('0x3d')){var _0x4a9a99={};_0x4a9a99[_0xe08c94[_0x152d('0x25')]]={'$like':'%'+_0x19830d[_0x152d('0x2e')]['filter']+'%'};return _0x4a9a99;}})});}_0xc9f5b4=_[_0x152d('0x3e')]({},_0xc9f5b4,_0x19830d['options']);var _0x32c9d7={'where':_0xc9f5b4[_0x152d('0x3a')]};return db[_0x152d('0x29')][_0x152d('0x1d')](_0x32c9d7)['then'](function(_0x16b30e){_0x19c4f7[_0x152d('0x1d')]=_0x16b30e;if(_0x19830d['query'][_0x152d('0x3f')]){_0xc9f5b4['include']=[{'all':!![]}];}return db[_0x152d('0x29')][_0x152d('0x40')](_0xc9f5b4);})[_0x152d('0x22')](function(_0x32e8da){_0x19c4f7[_0x152d('0x41')]=_0x32e8da;return _0x19c4f7;})[_0x152d('0x22')](respondWithFilteredResult(_0x4e2102,_0xc9f5b4))['catch'](handleError(_0x4e2102,null));};exports[_0x152d('0x42')]=function(_0x44595e,_0x35053b){var _0x3954b4={'raw':!![],'where':{'id':_0x44595e[_0x152d('0x43')]['id']}},_0x362841={};_0x362841[_0x152d('0x32')]=_['keys'](db[_0x152d('0x29')][_0x152d('0x2a')]);_0x362841['query']=_['keys'](_0x44595e['query']);_0x362841[_0x152d('0x30')]=_[_0x152d('0x31')](_0x362841[_0x152d('0x32')],_0x362841[_0x152d('0x2e')]);_0x3954b4[_0x152d('0x33')]=_[_0x152d('0x31')](_0x362841[_0x152d('0x32')],qs[_0x152d('0x34')](_0x44595e[_0x152d('0x2e')]['fields']));_0x3954b4['attributes']=_0x3954b4['attributes']['length']?_0x3954b4[_0x152d('0x33')]:_0x362841[_0x152d('0x32')];if(_0x44595e[_0x152d('0x2e')][_0x152d('0x3f')]){_0x3954b4[_0x152d('0x44')]=[{'all':!![]}];}_0x3954b4=_[_0x152d('0x3e')]({},_0x3954b4,_0x44595e[_0x152d('0x45')]);return db[_0x152d('0x29')][_0x152d('0x46')](_0x3954b4)[_0x152d('0x22')](handleEntityNotFound(_0x35053b,null))[_0x152d('0x22')](respondWithResult(_0x35053b,null))[_0x152d('0x47')](handleError(_0x35053b,null));};exports[_0x152d('0x48')]=function(_0x48c360,_0x3f99f3){return db[_0x152d('0x29')][_0x152d('0x48')](_0x48c360[_0x152d('0x49')],{})['then'](respondWithResult(_0x3f99f3,0xc9))[_0x152d('0x47')](handleError(_0x3f99f3,null));};exports[_0x152d('0x4a')]=function(_0x44ff66,_0x260dbd){if(_0x44ff66[_0x152d('0x49')]['id']){delete _0x44ff66[_0x152d('0x49')]['id'];}return db[_0x152d('0x29')][_0x152d('0x46')]({'where':{'id':_0x44ff66[_0x152d('0x43')]['id']}})[_0x152d('0x22')](handleEntityNotFound(_0x260dbd,null))[_0x152d('0x22')](saveUpdates(_0x44ff66['body'],null))[_0x152d('0x22')](respondWithResult(_0x260dbd,null))[_0x152d('0x47')](handleError(_0x260dbd,null));};exports[_0x152d('0x4b')]=function(_0x2f506c,_0x57a1fb){return db[_0x152d('0x29')][_0x152d('0x46')]({'where':{'id':_0x2f506c[_0x152d('0x43')]['id']}})[_0x152d('0x22')](handleEntityNotFound(_0x57a1fb,null))[_0x152d('0x22')](removeEntity(_0x57a1fb,null))['catch'](handleError(_0x57a1fb,null));};exports[_0x152d('0x4c')]=function(_0x14fc68,_0x4e5d7e){return db[_0x152d('0x29')]['describe']()['then'](respondWithResult(_0x4e5d7e,null))['catch'](handleError(_0x4e5d7e,null));};
\ No newline at end of file
index 52ee413..7a6939a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x957f=['define','report_jscripty_questions','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x147700,_0x5bff63){var _0x26f85b=function(_0x1e6bb7){while(--_0x1e6bb7){_0x147700['push'](_0x147700['shift']());}};_0x26f85b(++_0x5bff63);}(_0x957f,0xde));var _0xf957=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0x957f[_0x56e4e7];return _0x383618;};'use strict';var _=require('lodash');var util=require(_0xf957('0x0'));var logger=require(_0xf957('0x1'))('api');var moment=require(_0xf957('0x2'));var BPromise=require(_0xf957('0x3'));var rp=require(_0xf957('0x4'));var fs=require('fs');var path=require(_0xf957('0x5'));var rimraf=require('rimraf');var config=require(_0xf957('0x6'));var attributes=require('./jscriptyQuestionReport.attributes');module[_0xf957('0x7')]=function(_0x4fbf0e,_0x4eef84){return _0x4fbf0e[_0xf957('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0xf957('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfaca=['define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger','api','moment','bluebird','request-promise','path','./jscriptyQuestionReport.attributes'];(function(_0x3efdca,_0xa17654){var _0x2d9479=function(_0xe3cf18){while(--_0xe3cf18){_0x3efdca['push'](_0x3efdca['shift']());}};_0x2d9479(++_0xa17654);}(_0xfaca,0x1dc));var _0xafac=function(_0xff410d,_0x4cdc44){_0xff410d=_0xff410d-0x0;var _0x2c9bb1=_0xfaca[_0xff410d];return _0x2c9bb1;};'use strict';var _=require('lodash');var util=require(_0xafac('0x0'));var logger=require(_0xafac('0x1'))(_0xafac('0x2'));var moment=require(_0xafac('0x3'));var BPromise=require(_0xafac('0x4'));var rp=require(_0xafac('0x5'));var fs=require('fs');var path=require(_0xafac('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xafac('0x7'));module['exports']=function(_0x58755c,_0x2f09fe){return _0x58755c[_0xafac('0x8')](_0xafac('0x9'),attributes,{'tableName':_0xafac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1600b99..7ebc307 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x284c=['bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','moment'];(function(_0x578a78,_0xfdd763){var _0x5b517b=function(_0x30e4e1){while(--_0x30e4e1){_0x578a78['push'](_0x578a78['shift']());}};_0x5b517b(++_0xfdd763);}(_0x284c,0x7c));var _0xc284=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x284c[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var util=require(_0xc284('0x0'));var moment=require(_0xc284('0x1'));var BPromise=require(_0xc284('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc284('0x3'))['db'];var utils=require(_0xc284('0x4'));var logger=require('../../config/logger')(_0xc284('0x5'));var config=require(_0xc284('0x6'));var jayson=require(_0xc284('0x7'));var client=jayson[_0xc284('0x8')][_0xc284('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x535f84,_0x25900a,_0x2caf20){return new BPromise(function(_0x5b8cf1,_0x3208ab){return client[_0xc284('0xa')](_0x535f84,_0x2caf20)[_0xc284('0xb')](function(_0x49d857){logger[_0xc284('0xc')](_0xc284('0xd'),_0x25900a,_0xc284('0xe'));logger[_0xc284('0xf')](_0xc284('0x10'),_0x25900a,_0xc284('0xe'),JSON[_0xc284('0x11')](_0x49d857));if(_0x49d857[_0xc284('0x12')]){if(_0x49d857[_0xc284('0x12')]['code']===0x1f4){logger['error'](_0xc284('0xd'),_0x25900a,_0x49d857[_0xc284('0x12')][_0xc284('0x13')]);return _0x3208ab(_0x49d857[_0xc284('0x12')]['message']);}logger[_0xc284('0x12')](_0xc284('0xd'),_0x25900a,_0x49d857[_0xc284('0x12')]['message']);return _0x5b8cf1(_0x49d857[_0xc284('0x12')][_0xc284('0x13')]);}else{logger['info'](_0xc284('0xd'),_0x25900a,_0xc284('0xe'));_0x5b8cf1(_0x49d857[_0xc284('0x14')][_0xc284('0x13')]);}})['catch'](function(_0x430ea9){logger['error'](_0xc284('0xd'),_0x25900a,_0x430ea9);_0x3208ab(_0x430ea9);});});}
\ No newline at end of file
+var _0xae4c=['request','then','info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3966c0,_0x50c500){var _0x24ebbf=function(_0x40086d){while(--_0x40086d){_0x3966c0['push'](_0x3966c0['shift']());}};_0x24ebbf(++_0x50c500);}(_0xae4c,0x6b));var _0xcae4=function(_0x4f768a,_0x413685){_0x4f768a=_0x4f768a-0x0;var _0x4ab541=_0xae4c[_0x4f768a];return _0x4ab541;};'use strict';var _=require(_0xcae4('0x0'));var util=require(_0xcae4('0x1'));var moment=require(_0xcae4('0x2'));var BPromise=require(_0xcae4('0x3'));var rs=require(_0xcae4('0x4'));var fs=require('fs');var Redis=require(_0xcae4('0x5'));var db=require(_0xcae4('0x6'))['db'];var utils=require(_0xcae4('0x7'));var logger=require(_0xcae4('0x8'))(_0xcae4('0x9'));var config=require(_0xcae4('0xa'));var jayson=require(_0xcae4('0xb'));var client=jayson['client'][_0xcae4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f5b7e,_0x1cd165,_0x5087e1){return new BPromise(function(_0x3990c1,_0x3bd145){return client[_0xcae4('0xd')](_0x3f5b7e,_0x5087e1)[_0xcae4('0xe')](function(_0x49de2c){logger[_0xcae4('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1cd165,_0xcae4('0x10'));logger['debug'](_0xcae4('0x11'),_0x1cd165,'request\x20sent',JSON[_0xcae4('0x12')](_0x49de2c));if(_0x49de2c['error']){if(_0x49de2c[_0xcae4('0x13')][_0xcae4('0x14')]===0x1f4){logger[_0xcae4('0x13')](_0xcae4('0x15'),_0x1cd165,_0x49de2c[_0xcae4('0x13')][_0xcae4('0x16')]);return _0x3bd145(_0x49de2c[_0xcae4('0x13')][_0xcae4('0x16')]);}logger[_0xcae4('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1cd165,_0x49de2c[_0xcae4('0x13')][_0xcae4('0x16')]);return _0x3990c1(_0x49de2c[_0xcae4('0x13')]['message']);}else{logger[_0xcae4('0xf')](_0xcae4('0x15'),_0x1cd165,'request\x20sent');_0x3990c1(_0x49de2c[_0xcae4('0x17')][_0xcae4('0x16')]);}})['catch'](function(_0x2b578c){logger[_0xcae4('0x13')](_0xcae4('0x15'),_0x1cd165,_0x2b578c);_0x3bd145(_0x2b578c);});});}
\ No newline at end of file
index f8a8242..bd8a8d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x968d=['show','/:id/questions','getQuestions','post','create','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','describe','/:id'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x968d,0x15c));var _0xd968=function(_0xe2955c,_0x4a116c){_0xe2955c=_0xe2955c-0x0;var _0xf95c91=_0x968d[_0xe2955c];return _0xf95c91;};'use strict';var multer=require(_0xd968('0x0'));var util=require('util');var path=require(_0xd968('0x1'));var timeout=require(_0xd968('0x2'));var express=require(_0xd968('0x3'));var router=express[_0xd968('0x4')]();var fs_extra=require(_0xd968('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd968('0x6'));var controller=require(_0xd968('0x7'));router[_0xd968('0x8')]('/',auth[_0xd968('0x9')](),controller['index']);router[_0xd968('0x8')]('/describe',auth[_0xd968('0x9')](),controller[_0xd968('0xa')]);router[_0xd968('0x8')](_0xd968('0xb'),auth[_0xd968('0x9')](),controller[_0xd968('0xc')]);router[_0xd968('0x8')](_0xd968('0xd'),auth[_0xd968('0x9')](),controller[_0xd968('0xe')]);router[_0xd968('0xf')]('/',auth[_0xd968('0x9')](),controller[_0xd968('0x10')]);router['put'](_0xd968('0xb'),auth[_0xd968('0x9')](),controller[_0xd968('0x11')]);router[_0xd968('0x12')](_0xd968('0xb'),auth[_0xd968('0x9')](),controller[_0xd968('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xa21d=['show','/:id/questions','getQuestions','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x15e717,_0x3251ce){var _0x4bb9ad=function(_0x1db82a){while(--_0x1db82a){_0x15e717['push'](_0x15e717['shift']());}};_0x4bb9ad(++_0x3251ce);}(_0xa21d,0x7a));var _0xda21=function(_0x15c39e,_0x2b52f9){_0x15c39e=_0x15c39e-0x0;var _0xf1c6d9=_0xa21d[_0x15c39e];return _0xf1c6d9;};'use strict';var multer=require(_0xda21('0x0'));var util=require(_0xda21('0x1'));var path=require(_0xda21('0x2'));var timeout=require(_0xda21('0x3'));var express=require(_0xda21('0x4'));var router=express[_0xda21('0x5')]();var fs_extra=require(_0xda21('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xda21('0x7'));var config=require(_0xda21('0x8'));var controller=require(_0xda21('0x9'));router[_0xda21('0xa')]('/',auth['isAuthenticated'](),controller[_0xda21('0xb')]);router[_0xda21('0xa')](_0xda21('0xc'),auth[_0xda21('0xd')](),controller[_0xda21('0xe')]);router[_0xda21('0xa')](_0xda21('0xf'),auth[_0xda21('0xd')](),controller[_0xda21('0x10')]);router[_0xda21('0xa')](_0xda21('0x11'),auth['isAuthenticated'](),controller[_0xda21('0x12')]);router['post']('/',auth[_0xda21('0xd')](),controller[_0xda21('0x13')]);router[_0xda21('0x14')]('/:id',auth[_0xda21('0xd')](),controller['update']);router[_0xda21('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xda21('0x16')]=router;
\ No newline at end of file
index a55fea2..a5c04a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29d2=['starttime','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','exports','DATE'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x29d2,0x7e));var _0x229d=function(_0x40925a,_0x539dae){_0x40925a=_0x40925a-0x0;var _0x4b7f66=_0x29d2[_0x40925a];return _0x4b7f66;};'use strict';var moment=require(_0x229d('0x0'));var Sequelize=require(_0x229d('0x1'));module[_0x229d('0x2')]={'starttime':{'type':Sequelize[_0x229d('0x3')],'set':function(_0x5b93ca){this['setDataValue'](_0x229d('0x4'),_0x5b93ca);this[_0x229d('0x5')]('endtime',moment()[_0x229d('0x6')](_0x229d('0x7')));}},'endtime':{'type':Sequelize[_0x229d('0x3')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x229d('0x8')]},'queue':{'type':Sequelize[_0x229d('0x8')]},'uniqueid':{'type':Sequelize[_0x229d('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x229d('0x8')]},'completed':{'type':Sequelize[_0x229d('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0xd497=['exports','DATE','starttime','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x4a4d88,_0x2be95a){var _0x479329=function(_0x37bb8e){while(--_0x37bb8e){_0x4a4d88['push'](_0x4a4d88['shift']());}};_0x479329(++_0x2be95a);}(_0xd497,0x170));var _0x7d49=function(_0x48daf0,_0x5af26b){_0x48daf0=_0x48daf0-0x0;var _0x40028e=_0xd497[_0x48daf0];return _0x40028e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x7d49('0x0')]={'starttime':{'type':Sequelize[_0x7d49('0x1')],'set':function(_0x43f1d8){this['setDataValue'](_0x7d49('0x2'),_0x43f1d8);this[_0x7d49('0x3')](_0x7d49('0x4'),moment()['format'](_0x7d49('0x5')));}},'endtime':{'type':Sequelize[_0x7d49('0x1')]},'membername':{'type':Sequelize[_0x7d49('0x6')]},'projectname':{'type':Sequelize[_0x7d49('0x6')]},'queue':{'type':Sequelize[_0x7d49('0x6')]},'uniqueid':{'type':Sequelize[_0x7d49('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7d49('0x6')]},'completed':{'type':Sequelize[_0x7d49('0x7')],'defaultValue':![]}};
\ No newline at end of file
index 582e05a..334bf31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x400f=['fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','undefined','offset','limit','apply','save','update','then','destroy','error','name','send','index','map','JscriptySessionReport','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include','rows','catch','show','rawAttributes','options','find','create','body','params','describe','getQuestions','findOne','hasOwnProperty','SessionId','JscriptyQuestionReport','count','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0x400f,0x132));var _0xf400=function(_0x5a1e2b,_0x30e5c2){_0x5a1e2b=_0x5a1e2b-0x0;var _0x2325ea=_0x400f[_0x5a1e2b];return _0x2325ea;};'use strict';var emlformat=require(_0xf400('0x0'));var rimraf=require(_0xf400('0x1'));var zipdir=require(_0xf400('0x2'));var jsonpatch=require(_0xf400('0x3'));var rp=require(_0xf400('0x4'));var moment=require(_0xf400('0x5'));var BPromise=require(_0xf400('0x6'));var Mustache=require('mustache');var util=require(_0xf400('0x7'));var path=require('path');var sox=require(_0xf400('0x8'));var csv=require(_0xf400('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf400('0xa'));var _=require('lodash');var squel=require(_0xf400('0xb'));var crypto=require(_0xf400('0xc'));var jsforce=require(_0xf400('0xd'));var deskjs=require(_0xf400('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf400('0xf'));var Papa=require(_0xf400('0x10'));var Redis=require(_0xf400('0x11'));var authService=require(_0xf400('0x12'));var qs=require(_0xf400('0x13'));var as=require(_0xf400('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf400('0x15'))(_0xf400('0x16'));var utils=require(_0xf400('0x17'));var config=require(_0xf400('0x18'));var licenseUtil=require(_0xf400('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x258dca,_0x5b3112){_0x5b3112=_0x5b3112||0xcc;return function(_0x471fe4){if(_0x471fe4){return _0x258dca['sendStatus'](_0x5b3112);}return _0x258dca[_0xf400('0x1a')](_0x5b3112)['end']();};}function respondWithResult(_0x456138,_0x508b47){_0x508b47=_0x508b47||0xc8;return function(_0x16c741){if(_0x16c741){return _0x456138['status'](_0x508b47)[_0xf400('0x1b')](_0x16c741);}};}function respondWithFilteredResult(_0x32623c,_0x1a3181){return function(_0x304b28){if(_0x304b28){var _0x44a607=typeof _0x1a3181['offset']===_0xf400('0x1c')&&typeof _0x1a3181['limit']===_0xf400('0x1c');var _0x5151ef=_0x304b28['count'];var _0x2e6f03=_0x44a607?0x0:_0x1a3181[_0xf400('0x1d')];var _0x4b1ecd=_0x44a607?_0x304b28['count']:_0x1a3181[_0xf400('0x1d')]+_0x1a3181[_0xf400('0x1e')];var _0x1d5229;if(_0x4b1ecd>=_0x5151ef){_0x4b1ecd=_0x5151ef;_0x1d5229=0xc8;}else{_0x1d5229=0xce;}_0x32623c['status'](_0x1d5229);return _0x32623c['set']('Content-Range',_0x2e6f03+'-'+_0x4b1ecd+'/'+_0x5151ef)['json'](_0x304b28);}return null;};}function patchUpdates(_0x2edbd9){return function(_0x54f3d4){try{jsonpatch[_0xf400('0x1f')](_0x54f3d4,_0x2edbd9,!![]);}catch(_0x3d1d63){return BPromise['reject'](_0x3d1d63);}return _0x54f3d4[_0xf400('0x20')]();};}function saveUpdates(_0x2c4ecc,_0xa9ffea){return function(_0x44d676){if(_0x44d676){return _0x44d676[_0xf400('0x21')](_0x2c4ecc)[_0xf400('0x22')](function(_0x4c8034){return _0x4c8034;});}return null;};}function removeEntity(_0x396e2b,_0x2ec9d1){return function(_0x19eaf6){if(_0x19eaf6){return _0x19eaf6[_0xf400('0x23')]()['then'](function(){_0x396e2b[_0xf400('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e1f0a,_0x18e5b1){return function(_0x351adf){if(!_0x351adf){_0x5e1f0a['sendStatus'](0x194);}return _0x351adf;};}function handleError(_0x5bde4c,_0x373bc0){_0x373bc0=_0x373bc0||0x1f4;return function(_0x1704db){logger[_0xf400('0x24')](_0x1704db['stack']);if(_0x1704db[_0xf400('0x25')]){delete _0x1704db[_0xf400('0x25')];}_0x5bde4c[_0xf400('0x1a')](_0x373bc0)[_0xf400('0x26')](_0x1704db);};}exports[_0xf400('0x27')]=function(_0x5e6399,_0x65ef3e){var _0x19d87a={},_0x17fdfd={},_0x4c20fa={'count':0x0,'rows':[]};var _0x227d5d=_[_0xf400('0x28')](db[_0xf400('0x29')]['rawAttributes'],function(_0x3ce64a){return{'name':_0x3ce64a[_0xf400('0x2a')],'type':_0x3ce64a[_0xf400('0x2b')]['key']};});_0x17fdfd['model']=_['map'](_0x227d5d,_0xf400('0x25'));_0x17fdfd[_0xf400('0x2c')]=_[_0xf400('0x2d')](_0x5e6399[_0xf400('0x2c')]);_0x17fdfd[_0xf400('0x2e')]=_[_0xf400('0x2f')](_0x17fdfd['model'],_0x17fdfd[_0xf400('0x2c')]);_0x19d87a[_0xf400('0x30')]=_[_0xf400('0x2f')](_0x17fdfd[_0xf400('0x31')],qs[_0xf400('0x32')](_0x5e6399[_0xf400('0x2c')][_0xf400('0x32')]));_0x19d87a[_0xf400('0x30')]=_0x19d87a[_0xf400('0x30')][_0xf400('0x33')]?_0x19d87a[_0xf400('0x30')]:_0x17fdfd[_0xf400('0x31')];if(!_0x5e6399[_0xf400('0x2c')]['hasOwnProperty'](_0xf400('0x34'))){_0x19d87a['limit']=qs[_0xf400('0x1e')](_0x5e6399[_0xf400('0x2c')][_0xf400('0x1e')]);_0x19d87a['offset']=qs[_0xf400('0x1d')](_0x5e6399[_0xf400('0x2c')][_0xf400('0x1d')]);}_0x19d87a[_0xf400('0x35')]=qs[_0xf400('0x36')](_0x5e6399[_0xf400('0x2c')][_0xf400('0x36')]);_0x19d87a['where']=qs[_0xf400('0x2e')](_[_0xf400('0x37')](_0x5e6399[_0xf400('0x2c')],_0x17fdfd['filters']),_0x227d5d);if(_0x5e6399['query'][_0xf400('0x38')]){_0x19d87a['where']=_[_0xf400('0x39')](_0x19d87a[_0xf400('0x3a')],{'$or':_[_0xf400('0x28')](_0x227d5d,function(_0x1e84f9){if(_0x1e84f9[_0xf400('0x2b')]!==_0xf400('0x3b')){var _0x4df100={};_0x4df100[_0x1e84f9[_0xf400('0x25')]]={'$like':'%'+_0x5e6399[_0xf400('0x2c')][_0xf400('0x38')]+'%'};return _0x4df100;}})});}_0x19d87a=_[_0xf400('0x39')]({},_0x19d87a,_0x5e6399['options']);var _0x412d3d={'where':_0x19d87a[_0xf400('0x3a')]};return db[_0xf400('0x29')]['count'](_0x412d3d)['then'](function(_0x2dafe1){_0x4c20fa['count']=_0x2dafe1;if(_0x5e6399[_0xf400('0x2c')][_0xf400('0x3c')]){_0x19d87a[_0xf400('0x3d')]=[{'all':!![]}];}return db[_0xf400('0x29')]['findAll'](_0x19d87a);})[_0xf400('0x22')](function(_0x4c9ae9){_0x4c20fa[_0xf400('0x3e')]=_0x4c9ae9;return _0x4c20fa;})[_0xf400('0x22')](respondWithFilteredResult(_0x65ef3e,_0x19d87a))[_0xf400('0x3f')](handleError(_0x65ef3e,null));};exports[_0xf400('0x40')]=function(_0x5639e9,_0x2b7ce7){var _0x1c8342={'raw':!![],'where':{'id':_0x5639e9['params']['id']}},_0x4a7d23={};_0x4a7d23[_0xf400('0x31')]=_[_0xf400('0x2d')](db[_0xf400('0x29')][_0xf400('0x41')]);_0x4a7d23[_0xf400('0x2c')]=_[_0xf400('0x2d')](_0x5639e9[_0xf400('0x2c')]);_0x4a7d23['filters']=_[_0xf400('0x2f')](_0x4a7d23[_0xf400('0x31')],_0x4a7d23[_0xf400('0x2c')]);_0x1c8342[_0xf400('0x30')]=_[_0xf400('0x2f')](_0x4a7d23[_0xf400('0x31')],qs['fields'](_0x5639e9[_0xf400('0x2c')][_0xf400('0x32')]));_0x1c8342[_0xf400('0x30')]=_0x1c8342[_0xf400('0x30')]['length']?_0x1c8342[_0xf400('0x30')]:_0x4a7d23[_0xf400('0x31')];if(_0x5639e9[_0xf400('0x2c')]['includeAll']){_0x1c8342[_0xf400('0x3d')]=[{'all':!![]}];}_0x1c8342=_[_0xf400('0x39')]({},_0x1c8342,_0x5639e9[_0xf400('0x42')]);return db[_0xf400('0x29')][_0xf400('0x43')](_0x1c8342)[_0xf400('0x22')](handleEntityNotFound(_0x2b7ce7,null))[_0xf400('0x22')](respondWithResult(_0x2b7ce7,null))[_0xf400('0x3f')](handleError(_0x2b7ce7,null));};exports['create']=function(_0xb9fd83,_0x115f8e){return db['JscriptySessionReport'][_0xf400('0x44')](_0xb9fd83[_0xf400('0x45')],{})[_0xf400('0x22')](respondWithResult(_0x115f8e,0xc9))[_0xf400('0x3f')](handleError(_0x115f8e,null));};exports[_0xf400('0x21')]=function(_0x58f24f,_0x153f8a){if(_0x58f24f['body']['id']){delete _0x58f24f[_0xf400('0x45')]['id'];}return db['JscriptySessionReport'][_0xf400('0x43')]({'where':{'id':_0x58f24f[_0xf400('0x46')]['id']}})[_0xf400('0x22')](handleEntityNotFound(_0x153f8a,null))[_0xf400('0x22')](saveUpdates(_0x58f24f[_0xf400('0x45')],null))[_0xf400('0x22')](respondWithResult(_0x153f8a,null))['catch'](handleError(_0x153f8a,null));};exports[_0xf400('0x23')]=function(_0x11905a,_0x598034){return db[_0xf400('0x29')][_0xf400('0x43')]({'where':{'id':_0x11905a[_0xf400('0x46')]['id']}})[_0xf400('0x22')](handleEntityNotFound(_0x598034,null))[_0xf400('0x22')](removeEntity(_0x598034,null))[_0xf400('0x3f')](handleError(_0x598034,null));};exports[_0xf400('0x47')]=function(_0x5b433e,_0x48974e){return db[_0xf400('0x29')][_0xf400('0x47')]()['then'](respondWithResult(_0x48974e,null))[_0xf400('0x3f')](handleError(_0x48974e,null));};exports[_0xf400('0x48')]=function(_0x1cea33,_0x123e69,_0x2184b3){var _0x59f173={'raw':!![],'where':{}};var _0x59dca2={};var _0x5daeca={'count':0x0,'rows':[]};return db[_0xf400('0x29')][_0xf400('0x49')]({'where':{'id':_0x1cea33[_0xf400('0x46')]['id']}})[_0xf400('0x22')](handleEntityNotFound(_0x123e69,null))[_0xf400('0x22')](function(_0x578100){if(_0x578100){_0x59dca2[_0xf400('0x31')]=_[_0xf400('0x2d')](db['JscriptyQuestionReport'][_0xf400('0x41')]);_0x59dca2[_0xf400('0x2c')]=_[_0xf400('0x2d')](_0x1cea33[_0xf400('0x2c')]);_0x59dca2['filters']=_[_0xf400('0x2f')](_0x59dca2[_0xf400('0x31')],_0x59dca2[_0xf400('0x2c')]);_0x59f173[_0xf400('0x30')]=_[_0xf400('0x2f')](_0x59dca2['model'],qs[_0xf400('0x32')](_0x1cea33[_0xf400('0x2c')][_0xf400('0x32')]));_0x59f173[_0xf400('0x30')]=_0x59f173[_0xf400('0x30')][_0xf400('0x33')]?_0x59f173[_0xf400('0x30')]:_0x59dca2['model'];if(!_0x1cea33[_0xf400('0x2c')][_0xf400('0x4a')](_0xf400('0x34'))){_0x59f173['limit']=qs[_0xf400('0x1e')](_0x1cea33[_0xf400('0x2c')]['limit']);_0x59f173[_0xf400('0x1d')]=qs[_0xf400('0x1d')](_0x1cea33[_0xf400('0x2c')][_0xf400('0x1d')]);}_0x59f173[_0xf400('0x35')]=qs[_0xf400('0x36')](_0x1cea33[_0xf400('0x2c')]['sort']);_0x59f173[_0xf400('0x3a')]=qs[_0xf400('0x2e')](_[_0xf400('0x37')](_0x1cea33[_0xf400('0x2c')],_0x59dca2[_0xf400('0x2e')]));_0x59f173[_0xf400('0x3a')][_0xf400('0x4b')]=_0x578100['id'];if(_0x1cea33['query']['filter']){_0x59f173['where']=_[_0xf400('0x39')](_0x59f173[_0xf400('0x3a')],{'$or':_[_0xf400('0x28')](_0x59f173[_0xf400('0x30')],function(_0x1629b7){var _0x5db03e={};_0x5db03e[_0x1629b7]={'$like':'%'+_0x1cea33[_0xf400('0x2c')][_0xf400('0x38')]+'%'};return _0x5db03e;})});}_0x59f173=_['merge']({},_0x59f173,_0x1cea33[_0xf400('0x42')]);return db[_0xf400('0x4c')][_0xf400('0x4d')]({'where':_0x59f173['where']})[_0xf400('0x22')](function(_0x160343){_0x5daeca[_0xf400('0x4d')]=_0x160343;if(_0x1cea33[_0xf400('0x2c')][_0xf400('0x3c')]){_0x59f173[_0xf400('0x3d')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xf400('0x4e')](_0x59f173);})[_0xf400('0x22')](function(_0x24924c){_0x5daeca[_0xf400('0x3e')]=_0x24924c;return _0x5daeca;});}})[_0xf400('0x22')](respondWithFilteredResult(_0x123e69,_0x59f173))['catch'](handleError(_0x123e69,null));};
\ No newline at end of file
+var _0x0e6e=['rows','catch','params','keys','include','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','order','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','end','error','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0e6e,0x1c9));var _0xe0e6=function(_0x3a8f81,_0x15b8b1){_0x3a8f81=_0x3a8f81-0x0;var _0x865f3e=_0x0e6e[_0x3a8f81];return _0x865f3e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0e6('0x0'));var zipdir=require(_0xe0e6('0x1'));var jsonpatch=require(_0xe0e6('0x2'));var rp=require(_0xe0e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe0e6('0x4'));var util=require(_0xe0e6('0x5'));var path=require(_0xe0e6('0x6'));var sox=require('sox');var csv=require(_0xe0e6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe0e6('0x8'));var squel=require('squel');var crypto=require(_0xe0e6('0x9'));var jsforce=require(_0xe0e6('0xa'));var deskjs=require(_0xe0e6('0xb'));var toCsv=require(_0xe0e6('0x7'));var querystring=require(_0xe0e6('0xc'));var Papa=require(_0xe0e6('0xd'));var Redis=require(_0xe0e6('0xe'));var authService=require(_0xe0e6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe0e6('0x10'));var hardwareService=require(_0xe0e6('0x11'));var logger=require('../../config/logger')(_0xe0e6('0x12'));var utils=require('../../config/utils');var config=require(_0xe0e6('0x13'));var licenseUtil=require(_0xe0e6('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b9bce,_0x383dfd){_0x383dfd=_0x383dfd||0xcc;return function(_0x5155a6){if(_0x5155a6){return _0x3b9bce[_0xe0e6('0x15')](_0x383dfd);}return _0x3b9bce[_0xe0e6('0x16')](_0x383dfd)['end']();};}function respondWithResult(_0x4bca1b,_0x11ef8a){_0x11ef8a=_0x11ef8a||0xc8;return function(_0x3b004e){if(_0x3b004e){return _0x4bca1b[_0xe0e6('0x16')](_0x11ef8a)[_0xe0e6('0x17')](_0x3b004e);}};}function respondWithFilteredResult(_0x3a35c7,_0x92f2ea){return function(_0xb5463d){if(_0xb5463d){var _0xda8603=typeof _0x92f2ea[_0xe0e6('0x18')]===_0xe0e6('0x19')&&typeof _0x92f2ea['limit']===_0xe0e6('0x19');var _0x9300c=_0xb5463d[_0xe0e6('0x1a')];var _0x2bab0a=_0xda8603?0x0:_0x92f2ea[_0xe0e6('0x18')];var _0x1b8a12=_0xda8603?_0xb5463d[_0xe0e6('0x1a')]:_0x92f2ea[_0xe0e6('0x18')]+_0x92f2ea[_0xe0e6('0x1b')];var _0x250341;if(_0x1b8a12>=_0x9300c){_0x1b8a12=_0x9300c;_0x250341=0xc8;}else{_0x250341=0xce;}_0x3a35c7[_0xe0e6('0x16')](_0x250341);return _0x3a35c7['set'](_0xe0e6('0x1c'),_0x2bab0a+'-'+_0x1b8a12+'/'+_0x9300c)['json'](_0xb5463d);}return null;};}function patchUpdates(_0x519077){return function(_0x1bc7e5){try{jsonpatch[_0xe0e6('0x1d')](_0x1bc7e5,_0x519077,!![]);}catch(_0x353bcb){return BPromise['reject'](_0x353bcb);}return _0x1bc7e5[_0xe0e6('0x1e')]();};}function saveUpdates(_0x59d605,_0x232b09){return function(_0x51fc82){if(_0x51fc82){return _0x51fc82[_0xe0e6('0x1f')](_0x59d605)[_0xe0e6('0x20')](function(_0x5b83a3){return _0x5b83a3;});}return null;};}function removeEntity(_0xa80e8a,_0x3a62d0){return function(_0x369d86){if(_0x369d86){return _0x369d86['destroy']()[_0xe0e6('0x20')](function(){_0xa80e8a[_0xe0e6('0x16')](0xcc)[_0xe0e6('0x21')]();});}};}function handleEntityNotFound(_0x4f8b81,_0x27a4ab){return function(_0x43fab8){if(!_0x43fab8){_0x4f8b81['sendStatus'](0x194);}return _0x43fab8;};}function handleError(_0x4e1fce,_0x268f63){_0x268f63=_0x268f63||0x1f4;return function(_0x5c7e1a){logger[_0xe0e6('0x22')](_0x5c7e1a[_0xe0e6('0x23')]);if(_0x5c7e1a['name']){delete _0x5c7e1a[_0xe0e6('0x24')];}_0x4e1fce['status'](_0x268f63)[_0xe0e6('0x25')](_0x5c7e1a);};}exports['index']=function(_0xfebba4,_0x4c9805){var _0x43693f={},_0x1f0ba9={},_0x3ccbd6={'count':0x0,'rows':[]};var _0x15cf8f=_[_0xe0e6('0x26')](db[_0xe0e6('0x27')][_0xe0e6('0x28')],function(_0x11d2f2){return{'name':_0x11d2f2[_0xe0e6('0x29')],'type':_0x11d2f2['type'][_0xe0e6('0x2a')]};});_0x1f0ba9[_0xe0e6('0x2b')]=_['map'](_0x15cf8f,'name');_0x1f0ba9[_0xe0e6('0x2c')]=_['keys'](_0xfebba4['query']);_0x1f0ba9['filters']=_[_0xe0e6('0x2d')](_0x1f0ba9['model'],_0x1f0ba9[_0xe0e6('0x2c')]);_0x43693f[_0xe0e6('0x2e')]=_[_0xe0e6('0x2d')](_0x1f0ba9[_0xe0e6('0x2b')],qs[_0xe0e6('0x2f')](_0xfebba4['query'][_0xe0e6('0x2f')]));_0x43693f['attributes']=_0x43693f[_0xe0e6('0x2e')][_0xe0e6('0x30')]?_0x43693f[_0xe0e6('0x2e')]:_0x1f0ba9['model'];if(!_0xfebba4['query'][_0xe0e6('0x31')](_0xe0e6('0x32'))){_0x43693f[_0xe0e6('0x1b')]=qs[_0xe0e6('0x1b')](_0xfebba4['query']['limit']);_0x43693f[_0xe0e6('0x18')]=qs[_0xe0e6('0x18')](_0xfebba4[_0xe0e6('0x2c')][_0xe0e6('0x18')]);}_0x43693f['order']=qs[_0xe0e6('0x33')](_0xfebba4['query']['sort']);_0x43693f[_0xe0e6('0x34')]=qs['filters'](_[_0xe0e6('0x35')](_0xfebba4[_0xe0e6('0x2c')],_0x1f0ba9[_0xe0e6('0x36')]),_0x15cf8f);if(_0xfebba4[_0xe0e6('0x2c')][_0xe0e6('0x37')]){_0x43693f[_0xe0e6('0x34')]=_[_0xe0e6('0x38')](_0x43693f[_0xe0e6('0x34')],{'$or':_[_0xe0e6('0x26')](_0x15cf8f,function(_0x251dfd){if(_0x251dfd['type']!==_0xe0e6('0x39')){var _0x39a315={};_0x39a315[_0x251dfd['name']]={'$like':'%'+_0xfebba4[_0xe0e6('0x2c')][_0xe0e6('0x37')]+'%'};return _0x39a315;}})});}_0x43693f=_[_0xe0e6('0x38')]({},_0x43693f,_0xfebba4[_0xe0e6('0x3a')]);var _0x5763db={'where':_0x43693f[_0xe0e6('0x34')]};return db[_0xe0e6('0x27')][_0xe0e6('0x1a')](_0x5763db)[_0xe0e6('0x20')](function(_0x49af78){_0x3ccbd6['count']=_0x49af78;if(_0xfebba4['query'][_0xe0e6('0x3b')]){_0x43693f['include']=[{'all':!![]}];}return db[_0xe0e6('0x27')][_0xe0e6('0x3c')](_0x43693f);})['then'](function(_0x4cd978){_0x3ccbd6[_0xe0e6('0x3d')]=_0x4cd978;return _0x3ccbd6;})[_0xe0e6('0x20')](respondWithFilteredResult(_0x4c9805,_0x43693f))[_0xe0e6('0x3e')](handleError(_0x4c9805,null));};exports['show']=function(_0x30e75e,_0x35fdc2){var _0x3c398a={'raw':!![],'where':{'id':_0x30e75e[_0xe0e6('0x3f')]['id']}},_0x552fb7={};_0x552fb7[_0xe0e6('0x2b')]=_[_0xe0e6('0x40')](db[_0xe0e6('0x27')][_0xe0e6('0x28')]);_0x552fb7[_0xe0e6('0x2c')]=_['keys'](_0x30e75e[_0xe0e6('0x2c')]);_0x552fb7[_0xe0e6('0x36')]=_[_0xe0e6('0x2d')](_0x552fb7[_0xe0e6('0x2b')],_0x552fb7['query']);_0x3c398a[_0xe0e6('0x2e')]=_[_0xe0e6('0x2d')](_0x552fb7[_0xe0e6('0x2b')],qs[_0xe0e6('0x2f')](_0x30e75e[_0xe0e6('0x2c')][_0xe0e6('0x2f')]));_0x3c398a[_0xe0e6('0x2e')]=_0x3c398a[_0xe0e6('0x2e')][_0xe0e6('0x30')]?_0x3c398a[_0xe0e6('0x2e')]:_0x552fb7[_0xe0e6('0x2b')];if(_0x30e75e[_0xe0e6('0x2c')][_0xe0e6('0x3b')]){_0x3c398a[_0xe0e6('0x41')]=[{'all':!![]}];}_0x3c398a=_[_0xe0e6('0x38')]({},_0x3c398a,_0x30e75e[_0xe0e6('0x3a')]);return db[_0xe0e6('0x27')]['find'](_0x3c398a)[_0xe0e6('0x20')](handleEntityNotFound(_0x35fdc2,null))[_0xe0e6('0x20')](respondWithResult(_0x35fdc2,null))['catch'](handleError(_0x35fdc2,null));};exports[_0xe0e6('0x42')]=function(_0xf09aae,_0x33e916){return db[_0xe0e6('0x27')][_0xe0e6('0x42')](_0xf09aae[_0xe0e6('0x43')],{})[_0xe0e6('0x20')](respondWithResult(_0x33e916,0xc9))[_0xe0e6('0x3e')](handleError(_0x33e916,null));};exports[_0xe0e6('0x1f')]=function(_0x178c76,_0x292ba6){if(_0x178c76[_0xe0e6('0x43')]['id']){delete _0x178c76[_0xe0e6('0x43')]['id'];}return db[_0xe0e6('0x27')][_0xe0e6('0x44')]({'where':{'id':_0x178c76[_0xe0e6('0x3f')]['id']}})[_0xe0e6('0x20')](handleEntityNotFound(_0x292ba6,null))['then'](saveUpdates(_0x178c76['body'],null))[_0xe0e6('0x20')](respondWithResult(_0x292ba6,null))['catch'](handleError(_0x292ba6,null));};exports['destroy']=function(_0x347007,_0x1acdac){return db[_0xe0e6('0x27')][_0xe0e6('0x44')]({'where':{'id':_0x347007[_0xe0e6('0x3f')]['id']}})[_0xe0e6('0x20')](handleEntityNotFound(_0x1acdac,null))['then'](removeEntity(_0x1acdac,null))['catch'](handleError(_0x1acdac,null));};exports[_0xe0e6('0x45')]=function(_0x2f2c1d,_0x48340a){return db[_0xe0e6('0x27')][_0xe0e6('0x45')]()[_0xe0e6('0x20')](respondWithResult(_0x48340a,null))[_0xe0e6('0x3e')](handleError(_0x48340a,null));};exports[_0xe0e6('0x46')]=function(_0x23af65,_0x4f1cba,_0x51bf19){var _0xa9580a={'raw':!![],'where':{}};var _0x243645={};var _0x1dfc55={'count':0x0,'rows':[]};return db[_0xe0e6('0x27')][_0xe0e6('0x47')]({'where':{'id':_0x23af65[_0xe0e6('0x3f')]['id']}})[_0xe0e6('0x20')](handleEntityNotFound(_0x4f1cba,null))[_0xe0e6('0x20')](function(_0x215b73){if(_0x215b73){_0x243645['model']=_[_0xe0e6('0x40')](db[_0xe0e6('0x48')][_0xe0e6('0x28')]);_0x243645[_0xe0e6('0x2c')]=_[_0xe0e6('0x40')](_0x23af65[_0xe0e6('0x2c')]);_0x243645[_0xe0e6('0x36')]=_[_0xe0e6('0x2d')](_0x243645['model'],_0x243645[_0xe0e6('0x2c')]);_0xa9580a['attributes']=_[_0xe0e6('0x2d')](_0x243645['model'],qs['fields'](_0x23af65[_0xe0e6('0x2c')]['fields']));_0xa9580a[_0xe0e6('0x2e')]=_0xa9580a['attributes'][_0xe0e6('0x30')]?_0xa9580a[_0xe0e6('0x2e')]:_0x243645[_0xe0e6('0x2b')];if(!_0x23af65['query'][_0xe0e6('0x31')]('nolimit')){_0xa9580a[_0xe0e6('0x1b')]=qs[_0xe0e6('0x1b')](_0x23af65['query']['limit']);_0xa9580a[_0xe0e6('0x18')]=qs['offset'](_0x23af65[_0xe0e6('0x2c')][_0xe0e6('0x18')]);}_0xa9580a[_0xe0e6('0x49')]=qs[_0xe0e6('0x33')](_0x23af65[_0xe0e6('0x2c')][_0xe0e6('0x33')]);_0xa9580a['where']=qs[_0xe0e6('0x36')](_[_0xe0e6('0x35')](_0x23af65[_0xe0e6('0x2c')],_0x243645[_0xe0e6('0x36')]));_0xa9580a[_0xe0e6('0x34')]['SessionId']=_0x215b73['id'];if(_0x23af65[_0xe0e6('0x2c')]['filter']){_0xa9580a[_0xe0e6('0x34')]=_[_0xe0e6('0x38')](_0xa9580a[_0xe0e6('0x34')],{'$or':_[_0xe0e6('0x26')](_0xa9580a[_0xe0e6('0x2e')],function(_0x5789d2){var _0xa7e8a0={};_0xa7e8a0[_0x5789d2]={'$like':'%'+_0x23af65[_0xe0e6('0x2c')][_0xe0e6('0x37')]+'%'};return _0xa7e8a0;})});}_0xa9580a=_['merge']({},_0xa9580a,_0x23af65[_0xe0e6('0x3a')]);return db['JscriptyQuestionReport'][_0xe0e6('0x1a')]({'where':_0xa9580a['where']})[_0xe0e6('0x20')](function(_0x93c470){_0x1dfc55['count']=_0x93c470;if(_0x23af65[_0xe0e6('0x2c')][_0xe0e6('0x3b')]){_0xa9580a[_0xe0e6('0x41')]=[{'all':!![]}];}return db[_0xe0e6('0x48')][_0xe0e6('0x3c')](_0xa9580a);})['then'](function(_0x25f237){_0x1dfc55[_0xe0e6('0x3d')]=_0x25f237;return _0x1dfc55;});}})['then'](respondWithFilteredResult(_0x4f1cba,_0xa9580a))['catch'](handleError(_0x4f1cba,null));};
\ No newline at end of file
index 9ca70d7..70d064f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x277c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','report_jscripty_sessions','lodash','../../config/logger'];(function(_0xae9ef4,_0x31188d){var _0x2259cc=function(_0x5282de){while(--_0x5282de){_0xae9ef4['push'](_0xae9ef4['shift']());}};_0x2259cc(++_0x31188d);}(_0x277c,0x153));var _0xc277=function(_0x1fe15c,_0x2779f7){_0x1fe15c=_0x1fe15c-0x0;var _0x1d0d60=_0x277c[_0x1fe15c];return _0x1d0d60;};'use strict';var _=require(_0xc277('0x0'));var util=require('util');var logger=require(_0xc277('0x1'))(_0xc277('0x2'));var moment=require(_0xc277('0x3'));var BPromise=require(_0xc277('0x4'));var rp=require(_0xc277('0x5'));var fs=require('fs');var path=require(_0xc277('0x6'));var rimraf=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var attributes=require('./jscriptySessionReport.attributes');module['exports']=function(_0x1a6582,_0x5a4f03){return _0x1a6582[_0xc277('0x9')]('JscriptySessionReport',attributes,{'tableName':_0xc277('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1883=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4a9765,_0x323732){var _0x1c363c=function(_0x4667d8){while(--_0x4667d8){_0x4a9765['push'](_0x4a9765['shift']());}};_0x1c363c(++_0x323732);}(_0x1883,0xab));var _0x3188=function(_0x200c95,_0x387ecb){_0x200c95=_0x200c95-0x0;var _0xef7c28=_0x1883[_0x200c95];return _0xef7c28;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var logger=require(_0x3188('0x2'))(_0x3188('0x3'));var moment=require(_0x3188('0x4'));var BPromise=require(_0x3188('0x5'));var rp=require(_0x3188('0x6'));var fs=require('fs');var path=require(_0x3188('0x7'));var rimraf=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var attributes=require(_0x3188('0xa'));module[_0x3188('0xb')]=function(_0x408ae0,_0x33b62d){return _0x408ae0[_0x3188('0xc')](_0x3188('0xd'),attributes,{'tableName':_0x3188('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 50cae48..2356837 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffd6=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xffd6,0x97));var _0x6ffd=function(_0x4d21ff,_0x19d202){_0x4d21ff=_0x4d21ff-0x0;var _0x22b554=_0xffd6[_0x4d21ff];return _0x22b554;};'use strict';var _=require(_0x6ffd('0x0'));var util=require(_0x6ffd('0x1'));var moment=require(_0x6ffd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6ffd('0x3'));var db=require(_0x6ffd('0x4'))['db'];var utils=require(_0x6ffd('0x5'));var logger=require('../../config/logger')(_0x6ffd('0x6'));var config=require(_0x6ffd('0x7'));var jayson=require(_0x6ffd('0x8'));var client=jayson[_0x6ffd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x122b71,_0xeefe34,_0x2445a0){return new BPromise(function(_0x1fbbe6,_0x1d8b50){return client['request'](_0x122b71,_0x2445a0)[_0x6ffd('0xa')](function(_0x417f34){logger['info'](_0x6ffd('0xb'),_0xeefe34,_0x6ffd('0xc'));logger[_0x6ffd('0xd')](_0x6ffd('0xe'),_0xeefe34,_0x6ffd('0xc'),JSON[_0x6ffd('0xf')](_0x417f34));if(_0x417f34[_0x6ffd('0x10')]){if(_0x417f34['error'][_0x6ffd('0x11')]===0x1f4){logger[_0x6ffd('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0xeefe34,_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);return _0x1d8b50(_0x417f34[_0x6ffd('0x10')][_0x6ffd('0x12')]);}logger['error'](_0x6ffd('0xb'),_0xeefe34,_0x417f34['error'][_0x6ffd('0x12')]);return _0x1fbbe6(_0x417f34['error'][_0x6ffd('0x12')]);}else{logger[_0x6ffd('0x13')](_0x6ffd('0xb'),_0xeefe34,'request\x20sent');_0x1fbbe6(_0x417f34[_0x6ffd('0x14')][_0x6ffd('0x12')]);}})[_0x6ffd('0x15')](function(_0x3394b2){logger[_0x6ffd('0x10')](_0x6ffd('0xb'),_0xeefe34,_0x3394b2);_0x1d8b50(_0x3394b2);});});}
\ No newline at end of file
+var _0x5496=['../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x8a9658,_0x5eb82b){var _0x32a841=function(_0x4f3181){while(--_0x4f3181){_0x8a9658['push'](_0x8a9658['shift']());}};_0x32a841(++_0x5eb82b);}(_0x5496,0x175));var _0x6549=function(_0x5dcdc6,_0xf99848){_0x5dcdc6=_0x5dcdc6-0x0;var _0xb5b636=_0x5496[_0x5dcdc6];return _0xb5b636;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var moment=require(_0x6549('0x2'));var BPromise=require(_0x6549('0x3'));var rs=require(_0x6549('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6549('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6549('0x6'))(_0x6549('0x7'));var config=require(_0x6549('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6549('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d8cea,_0x4fcffd,_0x1ca8fc){return new BPromise(function(_0x3442c3,_0x1ef2a6){return client['request'](_0x1d8cea,_0x1ca8fc)[_0x6549('0xa')](function(_0x35d008){logger[_0x6549('0xb')](_0x6549('0xc'),_0x4fcffd,_0x6549('0xd'));logger[_0x6549('0xe')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x4fcffd,'request\x20sent',JSON[_0x6549('0xf')](_0x35d008));if(_0x35d008[_0x6549('0x10')]){if(_0x35d008[_0x6549('0x10')][_0x6549('0x11')]===0x1f4){logger[_0x6549('0x10')]('JscriptySessionReport,\x20%s,\x20%s',_0x4fcffd,_0x35d008['error'][_0x6549('0x12')]);return _0x1ef2a6(_0x35d008[_0x6549('0x10')]['message']);}logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);return _0x3442c3(_0x35d008[_0x6549('0x10')][_0x6549('0x12')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x4fcffd,_0x6549('0xd'));_0x3442c3(_0x35d008[_0x6549('0x13')]['message']);}})[_0x6549('0x14')](function(_0x67acc0){logger[_0x6549('0x10')](_0x6549('0xc'),_0x4fcffd,_0x67acc0);_0x1ef2a6(_0x67acc0);});});}
\ No newline at end of file
index e374bc1..adafc6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcff4=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./license.controller','get','index','put','/:id','update'];(function(_0x2d81de,_0x2ed903){var _0xe91fc1=function(_0x4ae7d0){while(--_0x4ae7d0){_0x2d81de['push'](_0x2d81de['shift']());}};_0xe91fc1(++_0x2ed903);}(_0xcff4,0x11e));var _0x4cff=function(_0x8f5d55,_0x509c56){_0x8f5d55=_0x8f5d55-0x0;var _0x361b0d=_0xcff4[_0x8f5d55];return _0x361b0d;};'use strict';var multer=require(_0x4cff('0x0'));var util=require(_0x4cff('0x1'));var path=require(_0x4cff('0x2'));var timeout=require(_0x4cff('0x3'));var express=require(_0x4cff('0x4'));var router=express[_0x4cff('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4cff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4cff('0x7'));var controller=require(_0x4cff('0x8'));router[_0x4cff('0x9')]('/',controller[_0x4cff('0xa')]);router[_0x4cff('0xb')](_0x4cff('0xc'),auth['isAuthenticated'](),controller[_0x4cff('0xd')]);module[_0x4cff('0xe')]=router;
\ No newline at end of file
+var _0xb453=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','get','index','put','/:id','isAuthenticated','update','multer','util'];(function(_0x58416a,_0x2ff095){var _0x5b1573=function(_0xda0167){while(--_0xda0167){_0x58416a['push'](_0x58416a['shift']());}};_0x5b1573(++_0x2ff095);}(_0xb453,0x1e8));var _0x3b45=function(_0x1132cb,_0x415664){_0x1132cb=_0x1132cb-0x0;var _0x486604=_0xb453[_0x1132cb];return _0x486604;};'use strict';var multer=require(_0x3b45('0x0'));var util=require(_0x3b45('0x1'));var path=require('path');var timeout=require(_0x3b45('0x2'));var express=require(_0x3b45('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3b45('0x4'));var interaction=require(_0x3b45('0x5'));var config=require(_0x3b45('0x6'));var controller=require(_0x3b45('0x7'));router[_0x3b45('0x8')]('/',controller[_0x3b45('0x9')]);router[_0x3b45('0xa')](_0x3b45('0xb'),auth[_0x3b45('0xc')](),controller[_0x3b45('0xd')]);module['exports']=router;
\ No newline at end of file
index f83f23c..d5075b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24e4=['sequelize','exports','STRING'];(function(_0x58a1ef,_0x4938cd){var _0x384e65=function(_0x61be1e){while(--_0x61be1e){_0x58a1ef['push'](_0x58a1ef['shift']());}};_0x384e65(++_0x4938cd);}(_0x24e4,0x111));var _0x424e=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x24e4[_0xd7b0a4];return _0x184e9e;};'use strict';var Sequelize=require(_0x424e('0x0'));module[_0x424e('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x424e('0x2')]},'data2':{'type':Sequelize[_0x424e('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf18a=['STRING','INTEGER','sequelize','exports','TEXT'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0xf18a,0xde));var _0xaf18=function(_0xeb1c7,_0x3327b1){_0xeb1c7=_0xeb1c7-0x0;var _0x4d374d=_0xf18a[_0xeb1c7];return _0x4d374d;};'use strict';var Sequelize=require(_0xaf18('0x0'));module[_0xaf18('0x1')]={'license':{'type':Sequelize[_0xaf18('0x2')]},'data1':{'type':Sequelize[_0xaf18('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize[_0xaf18('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index a381918..71f4eb3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0295=['demo','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','body','License','find','checkLicense','key'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x0295,0x1f0));var _0x5029=function(_0xb66224,_0x3a3f2f){_0xb66224=_0xb66224-0x0;var _0x346365=_0x0295[_0xb66224];return _0x346365;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}var utilLicense=require(_0x5029('0x25'));exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={'raw':!![],'where':{'id':0x1}},_0x4b6f92={};_0x4b6f92[_0x5029('0x26')]=_[_0x5029('0x27')](db['License'][_0x5029('0x28')]);_0x4b6f92[_0x5029('0x29')]=_[_0x5029('0x27')](_0x32da06[_0x5029('0x29')]);_0x4b6f92[_0x5029('0x2a')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],_0x4b6f92[_0x5029('0x29')]);_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],qs[_0x5029('0x2d')](_0x32da06['query'][_0x5029('0x2d')]));_0xe5313e['attributes']=_0xe5313e[_0x5029('0x2c')]['length']?_0xe5313e['attributes']:_0x4b6f92[_0x5029('0x26')];_0xe5313e=_[_0x5029('0x2e')]({},_0xe5313e,_0x32da06[_0x5029('0x2f')]);return utilLicense['getLicense'](_0xe5313e)[_0x5029('0x20')](respondWithResult(_0x251f99,null))[_0x5029('0x30')](handleError(_0x251f99,null));};exports[_0x5029('0x1f')]=function(_0x29c59a,_0x1bb896){if(_0x29c59a[_0x5029('0x31')]['id']){delete _0x29c59a[_0x5029('0x31')]['id'];}return db[_0x5029('0x32')][_0x5029('0x33')]({'where':{'id':_0x29c59a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bb896,null))[_0x5029('0x20')](function(_0xc110e8){var _0x1b3817=_0xc110e8['get']({'plain':!![]});return utilLicense[_0x5029('0x34')](_0x1b3817,_0x29c59a[_0x5029('0x31')][_0x5029('0x35')]);})['then'](function(_0x4904cc){if(!_0x4904cc[_0x5029('0x36')]){return saveUpdates(_0x29c59a[_0x5029('0x31')],null);}return _0x4904cc;})['then'](respondWithResult(_0x1bb896,null))['catch'](handleError(_0x1bb896,null));};
\ No newline at end of file
+var _0x814b=['json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','model','keys','rawAttributes','intersection','query','attributes','fields','length','merge','options','getLicense','catch','body','License','params','get','key','demo','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x81a9b6,_0x3bf064){var _0x1f130f=function(_0x54d47a){while(--_0x54d47a){_0x81a9b6['push'](_0x81a9b6['shift']());}};_0x1f130f(++_0x3bf064);}(_0x814b,0x1a2));var _0xb814=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0x814b[_0x2431d6];return _0x4d0f9b;};'use strict';var emlformat=require(_0xb814('0x0'));var rimraf=require(_0xb814('0x1'));var zipdir=require(_0xb814('0x2'));var jsonpatch=require(_0xb814('0x3'));var rp=require(_0xb814('0x4'));var moment=require(_0xb814('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb814('0x6'));var util=require(_0xb814('0x7'));var path=require(_0xb814('0x8'));var sox=require(_0xb814('0x9'));var csv=require(_0xb814('0xa'));var ejs=require(_0xb814('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');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('0xa'));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 licenseUtil=require(_0xb814('0x19'));var db=require(_0xb814('0x1a'))['db'];function respondWithStatusCode(_0x35b10d,_0x2cc46b){_0x2cc46b=_0x2cc46b||0xcc;return function(_0x2ce718){if(_0x2ce718){return _0x35b10d[_0xb814('0x1b')](_0x2cc46b);}return _0x35b10d[_0xb814('0x1c')](_0x2cc46b)[_0xb814('0x1d')]();};}function respondWithResult(_0xa0a2e5,_0x2ab627){_0x2ab627=_0x2ab627||0xc8;return function(_0x3f4881){if(_0x3f4881){return _0xa0a2e5[_0xb814('0x1c')](_0x2ab627)[_0xb814('0x1e')](_0x3f4881);}};}function respondWithFilteredResult(_0x39bfcf,_0x303aca){return function(_0x3a71d6){if(_0x3a71d6){var _0x45e0d0=typeof _0x303aca[_0xb814('0x1f')]===_0xb814('0x20')&&typeof _0x303aca[_0xb814('0x21')]===_0xb814('0x20');var _0x48c9df=_0x3a71d6[_0xb814('0x22')];var _0x55ba16=_0x45e0d0?0x0:_0x303aca[_0xb814('0x1f')];var _0xfac75b=_0x45e0d0?_0x3a71d6['count']:_0x303aca['offset']+_0x303aca['limit'];var _0x399b43;if(_0xfac75b>=_0x48c9df){_0xfac75b=_0x48c9df;_0x399b43=0xc8;}else{_0x399b43=0xce;}_0x39bfcf['status'](_0x399b43);return _0x39bfcf['set'](_0xb814('0x23'),_0x55ba16+'-'+_0xfac75b+'/'+_0x48c9df)[_0xb814('0x1e')](_0x3a71d6);}return null;};}function patchUpdates(_0x25b6b6){return function(_0x4e139e){try{jsonpatch[_0xb814('0x24')](_0x4e139e,_0x25b6b6,!![]);}catch(_0x531032){return BPromise[_0xb814('0x25')](_0x531032);}return _0x4e139e[_0xb814('0x26')]();};}function saveUpdates(_0x3b267e,_0x470e81){return function(_0x27352e){if(_0x27352e){return _0x27352e[_0xb814('0x27')](_0x3b267e)[_0xb814('0x28')](function(_0x594470){return _0x594470;});}return null;};}function removeEntity(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(_0x3f81d0){return _0x3f81d0[_0xb814('0x29')]()[_0xb814('0x28')](function(){_0x2ead86[_0xb814('0x1c')](0xcc)[_0xb814('0x1d')]();});}};}function handleEntityNotFound(_0xb9e57d,_0x3d836c){return function(_0x5755ea){if(!_0x5755ea){_0xb9e57d[_0xb814('0x1b')](0x194);}return _0x5755ea;};}function handleError(_0xc0ef66,_0x1c2625){_0x1c2625=_0x1c2625||0x1f4;return function(_0x349394){logger[_0xb814('0x2a')](_0x349394[_0xb814('0x2b')]);if(_0x349394[_0xb814('0x2c')]){delete _0x349394[_0xb814('0x2c')];}_0xc0ef66['status'](_0x1c2625)[_0xb814('0x2d')](_0x349394);};}var utilLicense=require(_0xb814('0x19'));exports['index']=function(_0x9008b2,_0x37d24d){var _0x530744={'raw':!![],'where':{'id':0x1}},_0x499f22={};_0x499f22[_0xb814('0x2e')]=_[_0xb814('0x2f')](db['License'][_0xb814('0x30')]);_0x499f22['query']=_[_0xb814('0x2f')](_0x9008b2['query']);_0x499f22['filters']=_[_0xb814('0x31')](_0x499f22['model'],_0x499f22[_0xb814('0x32')]);_0x530744[_0xb814('0x33')]=_[_0xb814('0x31')](_0x499f22['model'],qs['fields'](_0x9008b2[_0xb814('0x32')][_0xb814('0x34')]));_0x530744['attributes']=_0x530744[_0xb814('0x33')][_0xb814('0x35')]?_0x530744[_0xb814('0x33')]:_0x499f22[_0xb814('0x2e')];_0x530744=_[_0xb814('0x36')]({},_0x530744,_0x9008b2[_0xb814('0x37')]);return utilLicense[_0xb814('0x38')](_0x530744)['then'](respondWithResult(_0x37d24d,null))[_0xb814('0x39')](handleError(_0x37d24d,null));};exports[_0xb814('0x27')]=function(_0x30de5a,_0x424e2b){if(_0x30de5a[_0xb814('0x3a')]['id']){delete _0x30de5a['body']['id'];}return db[_0xb814('0x3b')]['find']({'where':{'id':_0x30de5a[_0xb814('0x3c')]['id']}})[_0xb814('0x28')](handleEntityNotFound(_0x424e2b,null))[_0xb814('0x28')](function(_0x492d5e){var _0x40b885=_0x492d5e[_0xb814('0x3d')]({'plain':!![]});return utilLicense['checkLicense'](_0x40b885,_0x30de5a[_0xb814('0x3a')][_0xb814('0x3e')]);})[_0xb814('0x28')](function(_0x1f7cd8){if(!_0x1f7cd8[_0xb814('0x3f')]){return saveUpdates(_0x30de5a[_0xb814('0x3a')],null);}return _0x1f7cd8;})['then'](respondWithResult(_0x424e2b,null))[_0xb814('0x39')](handleError(_0x424e2b,null));};
\ No newline at end of file
index 271a5fb..54ac77d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe256=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./license.attributes','define','License','util'];(function(_0x48a94a,_0x1621ab){var _0x257b3a=function(_0x26bfc4){while(--_0x26bfc4){_0x48a94a['push'](_0x48a94a['shift']());}};_0x257b3a(++_0x1621ab);}(_0xe256,0xaf));var _0x6e25=function(_0x557829,_0x44aa65){_0x557829=_0x557829-0x0;var _0x7fbb10=_0xe256[_0x557829];return _0x7fbb10;};'use strict';var _=require('lodash');var util=require(_0x6e25('0x0'));var logger=require(_0x6e25('0x1'))(_0x6e25('0x2'));var moment=require(_0x6e25('0x3'));var BPromise=require(_0x6e25('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e25('0x5'));var rimraf=require(_0x6e25('0x6'));var config=require(_0x6e25('0x7'));var attributes=require(_0x6e25('0x8'));module['exports']=function(_0x76112b,_0x2e8b35){return _0x76112b[_0x6e25('0x9')](_0x6e25('0xa'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbc33=['./license.attributes','exports','License','api','bluebird','path','rimraf','../../config/environment'];(function(_0x15a676,_0x4036a1){var _0x48d768=function(_0x1e59c5){while(--_0x1e59c5){_0x15a676['push'](_0x15a676['shift']());}};_0x48d768(++_0x4036a1);}(_0xbc33,0x19b));var _0x3bc3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc33[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x3bc3('0x0'));var moment=require('moment');var BPromise=require(_0x3bc3('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bc3('0x2'));var rimraf=require(_0x3bc3('0x3'));var config=require(_0x3bc3('0x4'));var attributes=require(_0x3bc3('0x5'));module[_0x3bc3('0x6')]=function(_0x1cda43,_0x3d8600){return _0x1cda43['define'](_0x3bc3('0x7'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b02ae99..2e507c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55b1=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x55b1,0x1dd));var _0x155b=function(_0x5ce3c8,_0x2503bd){_0x5ce3c8=_0x5ce3c8-0x0;var _0xa76867=_0x55b1[_0x5ce3c8];return _0xa76867;};'use strict';var _=require(_0x155b('0x0'));var util=require(_0x155b('0x1'));var moment=require('moment');var BPromise=require(_0x155b('0x2'));var rs=require(_0x155b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x155b('0x4'))['db'];var utils=require(_0x155b('0x5'));var logger=require(_0x155b('0x6'))(_0x155b('0x7'));var config=require('../../config/environment');var jayson=require(_0x155b('0x8'));var client=jayson['client'][_0x155b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41feaf,_0x80ae97,_0x2d7c40){return new BPromise(function(_0x46acb3,_0x191ff0){return client[_0x155b('0xa')](_0x41feaf,_0x2d7c40)[_0x155b('0xb')](function(_0xea66fa){logger[_0x155b('0xc')](_0x155b('0xd'),_0x80ae97,_0x155b('0xe'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x80ae97,_0x155b('0xe'),JSON['stringify'](_0xea66fa));if(_0xea66fa['error']){if(_0xea66fa[_0x155b('0xf')]['code']===0x1f4){logger[_0x155b('0xf')](_0x155b('0xd'),_0x80ae97,_0xea66fa[_0x155b('0xf')][_0x155b('0x10')]);return _0x191ff0(_0xea66fa['error'][_0x155b('0x10')]);}logger['error'](_0x155b('0xd'),_0x80ae97,_0xea66fa[_0x155b('0xf')][_0x155b('0x10')]);return _0x46acb3(_0xea66fa[_0x155b('0xf')]['message']);}else{logger[_0x155b('0xc')](_0x155b('0xd'),_0x80ae97,_0x155b('0xe'));_0x46acb3(_0xea66fa[_0x155b('0x11')][_0x155b('0x10')]);}})[_0x155b('0x12')](function(_0x22b226){logger[_0x155b('0xf')](_0x155b('0xd'),_0x80ae97,_0x22b226);_0x191ff0(_0x22b226);});});}
\ No newline at end of file
+var _0x9b3e=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s'];(function(_0x39a184,_0x163ee9){var _0xdb5097=function(_0xba55c0){while(--_0xba55c0){_0x39a184['push'](_0x39a184['shift']());}};_0xdb5097(++_0x163ee9);}(_0x9b3e,0xc5));var _0xe9b3=function(_0x10ca5d,_0x5cb7bd){_0x10ca5d=_0x10ca5d-0x0;var _0x2998e7=_0x9b3e[_0x10ca5d];return _0x2998e7;};'use strict';var _=require(_0xe9b3('0x0'));var util=require(_0xe9b3('0x1'));var moment=require(_0xe9b3('0x2'));var BPromise=require(_0xe9b3('0x3'));var rs=require(_0xe9b3('0x4'));var fs=require('fs');var Redis=require(_0xe9b3('0x5'));var db=require(_0xe9b3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe9b3('0x7'))('rpc');var config=require(_0xe9b3('0x8'));var jayson=require(_0xe9b3('0x9'));var client=jayson[_0xe9b3('0xa')][_0xe9b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa4e3a5,_0x1a585f,_0x34df12){return new BPromise(function(_0xf7d134,_0x4fc379){return client[_0xe9b3('0xc')](_0xa4e3a5,_0x34df12)[_0xe9b3('0xd')](function(_0x2cf17f){logger[_0xe9b3('0xe')](_0xe9b3('0xf'),_0x1a585f,_0xe9b3('0x10'));logger[_0xe9b3('0x11')](_0xe9b3('0x12'),_0x1a585f,_0xe9b3('0x10'),JSON[_0xe9b3('0x13')](_0x2cf17f));if(_0x2cf17f[_0xe9b3('0x14')]){if(_0x2cf17f[_0xe9b3('0x14')][_0xe9b3('0x15')]===0x1f4){logger[_0xe9b3('0x14')](_0xe9b3('0xf'),_0x1a585f,_0x2cf17f[_0xe9b3('0x14')][_0xe9b3('0x16')]);return _0x4fc379(_0x2cf17f[_0xe9b3('0x14')]['message']);}logger[_0xe9b3('0x14')](_0xe9b3('0xf'),_0x1a585f,_0x2cf17f[_0xe9b3('0x14')]['message']);return _0xf7d134(_0x2cf17f['error']['message']);}else{logger[_0xe9b3('0xe')]('License,\x20%s,\x20%s',_0x1a585f,'request\x20sent');_0xf7d134(_0x2cf17f[_0xe9b3('0x17')][_0xe9b3('0x16')]);}})['catch'](function(_0x1e4db4){logger[_0xe9b3('0x14')](_0xe9b3('0xf'),_0x1a585f,_0x1e4db4);_0x4fc379(_0x1e4db4);});});}
\ No newline at end of file
index b934e42..0f1b72f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf2b9=['fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','util','path','connect-timeout','express','Router'];(function(_0x104cd0,_0x35885a){var _0x1ea759=function(_0x12e8e5){while(--_0x12e8e5){_0x104cd0['push'](_0x104cd0['shift']());}};_0x1ea759(++_0x35885a);}(_0xf2b9,0x11b));var _0x9f2b=function(_0x6f8d89,_0x35b256){_0x6f8d89=_0x6f8d89-0x0;var _0x34d6c4=_0xf2b9[_0x6f8d89];return _0x34d6c4;};'use strict';var multer=require('multer');var util=require(_0x9f2b('0x0'));var path=require(_0x9f2b('0x1'));var timeout=require(_0x9f2b('0x2'));var express=require(_0x9f2b('0x3'));var router=express[_0x9f2b('0x4')]();var fs_extra=require(_0x9f2b('0x5'));var auth=require(_0x9f2b('0x6'));var interaction=require(_0x9f2b('0x7'));var config=require('../../config/environment');var controller=require(_0x9f2b('0x8'));router[_0x9f2b('0x9')]('/',auth[_0x9f2b('0xa')](),controller[_0x9f2b('0xb')]);router['get'](_0x9f2b('0xc'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0xd')]);router[_0x9f2b('0x9')](_0x9f2b('0xe'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0xf')]);router[_0x9f2b('0x9')](_0x9f2b('0x10'),auth[_0x9f2b('0xa')](),controller['getDispositions']);router['get'](_0x9f2b('0x11'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x12')]);router[_0x9f2b('0x9')](_0x9f2b('0x13'),auth['isAuthenticated'](),controller['getImap']);router[_0x9f2b('0x9')](_0x9f2b('0x14'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x15')]);router[_0x9f2b('0x9')](_0x9f2b('0x16'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x17')]);router[_0x9f2b('0x9')](_0x9f2b('0x18'),auth['isAuthenticated'](),controller[_0x9f2b('0x19')]);router['get'](_0x9f2b('0x1a'),auth['isAuthenticated'](),controller[_0x9f2b('0x1b')]);router[_0x9f2b('0x9')](_0x9f2b('0x1c'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x1d')]);router['get'](_0x9f2b('0x1e'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x1f')]);router[_0x9f2b('0x20')](_0x9f2b('0x10'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x21')]);router[_0x9f2b('0x20')](_0x9f2b('0x11'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x22')]);router[_0x9f2b('0x20')]('/',auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x23')]);router['post']('/:id/in_servers',auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x24')]);router[_0x9f2b('0x20')](_0x9f2b('0x14'),auth[_0x9f2b('0xa')](),controller['addSmtp']);router[_0x9f2b('0x20')](_0x9f2b('0x16'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x9f2b('0x20')]('/:id/applications',auth['isAuthenticated'](),controller['addApplications']);router[_0x9f2b('0x20')](_0x9f2b('0x25'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x26')]);router[_0x9f2b('0x20')](_0x9f2b('0x1e'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x27')]);router[_0x9f2b('0x28')](_0x9f2b('0xe'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x29')]);router[_0x9f2b('0x2a')](_0x9f2b('0x10'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x2b')]);router['delete'](_0x9f2b('0x11'),auth['isAuthenticated'](),controller[_0x9f2b('0x2c')]);router[_0x9f2b('0x2a')](_0x9f2b('0x13'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x2d')]);router[_0x9f2b('0x2a')](_0x9f2b('0x14'),auth[_0x9f2b('0xa')](),controller[_0x9f2b('0x2e')]);router[_0x9f2b('0x2a')](_0x9f2b('0xe'),auth['isAuthenticated'](),controller[_0x9f2b('0x2f')]);router['delete']('/:id/users',auth[_0x9f2b('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0xbb8c=['index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/in_servers','/:id/out_servers','getSmtp','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','post','addDisposition','create','addSmtp','/:id/interactions','addApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated'];(function(_0x9011a6,_0x55b87d){var _0x312856=function(_0x554f60){while(--_0x554f60){_0x9011a6['push'](_0x9011a6['shift']());}};_0x312856(++_0x55b87d);}(_0xbb8c,0x14d));var _0xcbb8=function(_0x30b545,_0x2a29bb){_0x30b545=_0x30b545-0x0;var _0x3c092e=_0xbb8c[_0x30b545];return _0x3c092e;};'use strict';var multer=require('multer');var util=require(_0xcbb8('0x0'));var path=require(_0xcbb8('0x1'));var timeout=require(_0xcbb8('0x2'));var express=require(_0xcbb8('0x3'));var router=express[_0xcbb8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcbb8('0x5'));var interaction=require(_0xcbb8('0x6'));var config=require(_0xcbb8('0x7'));var controller=require(_0xcbb8('0x8'));router[_0xcbb8('0x9')]('/',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0xb')]);router[_0xcbb8('0x9')](_0xcbb8('0xc'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0xd')]);router[_0xcbb8('0x9')](_0xcbb8('0xe'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0xf')]);router[_0xcbb8('0x9')]('/:id/dispositions',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x10')]);router['get'](_0xcbb8('0x11'),auth[_0xcbb8('0xa')](),controller['getAnswers']);router[_0xcbb8('0x9')](_0xcbb8('0x12'),auth[_0xcbb8('0xa')](),controller['getImap']);router[_0xcbb8('0x9')](_0xcbb8('0x13'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x14')]);router[_0xcbb8('0x9')]('/:id/interactions',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x15')]);router[_0xcbb8('0x9')](_0xcbb8('0x16'),auth['isAuthenticated'](),controller['getApplications']);router[_0xcbb8('0x9')](_0xcbb8('0x17'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x18')]);router[_0xcbb8('0x9')]('/:id/verify',auth[_0xcbb8('0xa')](),controller['verifySmtp']);router['get'](_0xcbb8('0x19'),auth[_0xcbb8('0xa')](),controller['getAgents']);router[_0xcbb8('0x1a')]('/:id/dispositions',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x1b')]);router['post'](_0xcbb8('0x11'),auth[_0xcbb8('0xa')](),controller['addAnswer']);router[_0xcbb8('0x1a')]('/',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x1c')]);router[_0xcbb8('0x1a')](_0xcbb8('0x12'),auth[_0xcbb8('0xa')](),controller['addImap']);router[_0xcbb8('0x1a')](_0xcbb8('0x13'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x1d')]);router[_0xcbb8('0x1a')](_0xcbb8('0x1e'),auth[_0xcbb8('0xa')](),controller['addInteraction']);router['post'](_0xcbb8('0x16'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x1f')]);router[_0xcbb8('0x1a')](_0xcbb8('0x20'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x21')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0xcbb8('0x22')]);router[_0xcbb8('0x23')](_0xcbb8('0xe'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x24')]);router[_0xcbb8('0x25')]('/:id/dispositions',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x26')]);router[_0xcbb8('0x25')]('/:id/canned_answers',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x27')]);router[_0xcbb8('0x25')](_0xcbb8('0x12'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x28')]);router[_0xcbb8('0x25')]('/:id/out_servers',auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x29')]);router[_0xcbb8('0x25')](_0xcbb8('0xe'),auth[_0xcbb8('0xa')](),controller[_0xcbb8('0x2a')]);router[_0xcbb8('0x25')](_0xcbb8('0x19'),auth[_0xcbb8('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index d286800..ae22b7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68f5=['INTEGER','UNSIGNED','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68f5,0x11a));var _0x568f=function(_0x1a6a25,_0x2394f6){_0x1a6a25=_0x1a6a25-0x0;var _0x592ccb=_0x68f5[_0x1a6a25];return _0x592ccb;};'use strict';var Sequelize=require(_0x568f('0x0'));module[_0x568f('0x1')]={'description':{'type':Sequelize[_0x568f('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x568f('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x568f('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x568f('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x568f('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x568f('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x568f('0x2')],'allowNull':![],'defaultValue':_0x568f('0x5')},'fontSize':{'type':Sequelize[_0x568f('0x6')](0x2)[_0x568f('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x568f('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x568f('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x568f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x568f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x568f('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x568f('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x568f('0x3')],'defaultValue':![],'comment':_0x568f('0x8'),'set':function(_0x202a80){if(!_0x202a80)this[_0x568f('0x9')](_0x568f('0xa'),null);this[_0x568f('0x9')](_0x568f('0xb'),_0x202a80);}}};
\ No newline at end of file
+var _0x4b19=['BOOLEAN','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','STRING'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0x4b19,0x195));var _0x94b1=function(_0x486919,_0x1ff17d){_0x486919=_0x486919-0x0;var _0x30d637=_0x4b19[_0x486919];return _0x30d637;};'use strict';var Sequelize=require(_0x94b1('0x0'));module['exports']={'description':{'type':Sequelize[_0x94b1('0x1')]},'name':{'type':Sequelize[_0x94b1('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x94b1('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x94b1('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x94b1('0x1')],'allowNull':![],'defaultValue':_0x94b1('0x4')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x94b1('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x94b1('0x3')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x94b1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x94b1('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x94b1('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0x94b1('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x94b1('0x2')],'defaultValue':![],'comment':_0x94b1('0x8'),'set':function(_0x162995){if(!_0x162995)this[_0x94b1('0x9')]('mandatoryDispositionPauseId',null);this[_0x94b1('0x9')](_0x94b1('0xa'),_0x162995);}}};
\ No newline at end of file
index 2188cb7..a016ca8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13fd=['length','order','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','email','active','isNil','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','tag','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','List','Contacts','updatedAt','from','attachments','root','server/files/attachments','service','auth','secure','SendMail','List\x20not\x20found','ListId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','destroy','get','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','Pause','find','body','update','describe','addDisposition','MailAccountId','Disposition','create','findOne','rawAttributes'];(function(_0x35f7f5,_0x4e2ee1){var _0x5567a4=function(_0x3e5df0){while(--_0x3e5df0){_0x35f7f5['push'](_0x35f7f5['shift']());}};_0x5567a4(++_0x4e2ee1);}(_0x13fd,0x1d5));var _0xd13f=function(_0x546c9e,_0x3fe653){_0x546c9e=_0x546c9e-0x0;var _0x5138e8=_0x13fd[_0x546c9e];return _0x5138e8;};'use strict';var emlformat=require(_0xd13f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd13f('0x1'));var jsonpatch=require(_0xd13f('0x2'));var rp=require(_0xd13f('0x3'));var moment=require(_0xd13f('0x4'));var BPromise=require(_0xd13f('0x5'));var Mustache=require('mustache');var util=require(_0xd13f('0x6'));var path=require(_0xd13f('0x7'));var sox=require(_0xd13f('0x8'));var csv=require(_0xd13f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd13f('0xa'));var squel=require(_0xd13f('0xb'));var crypto=require(_0xd13f('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd13f('0xd'));var htmlToText=require('html-to-text');var juice=require('juice');var Redis=require(_0xd13f('0xe'));var authService=require(_0xd13f('0xf'));var qs=require(_0xd13f('0x10'));var as=require(_0xd13f('0x11'));var hardwareService=require(_0xd13f('0x12'));var logger=require(_0xd13f('0x13'))(_0xd13f('0x14'));var utils=require('../../config/utils');var config=require(_0xd13f('0x15'));var licenseUtil=require(_0xd13f('0x16'));var db=require(_0xd13f('0x17'))['db'];config[_0xd13f('0x18')]=_[_0xd13f('0x19')](config[_0xd13f('0x18')],{'host':_0xd13f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd13f('0x18')]));require(_0xd13f('0x1b'))[_0xd13f('0x1c')](socket);var jayson=require(_0xd13f('0x1d'));var client=jayson[_0xd13f('0x1e')][_0xd13f('0x1f')]({'port':0x232b});function respondWithRpcPromise(_0x20c080,_0x122254,_0x1170dd,_0x2dc4f4){return new BPromise(function(_0x62c0d4,_0x42c71b){var _0x5b5dea=_0x2dc4f4||client;return _0x5b5dea[_0xd13f('0x20')](_0x20c080,_0x1170dd)[_0xd13f('0x21')](function(_0x2db2c9){logger[_0xd13f('0x22')]('MailAccount,\x20%s,\x20%s',_0x122254,'request\x20sent');logger[_0xd13f('0x23')](_0xd13f('0x24'),_0x122254,_0xd13f('0x25'),JSON[_0xd13f('0x26')](_0x2db2c9));if(_0x2db2c9['error']){if(_0x2db2c9[_0xd13f('0x27')][_0xd13f('0x28')]===0x1f4){logger[_0xd13f('0x27')](_0xd13f('0x29'),_0x122254,_0x2db2c9[_0xd13f('0x27')][_0xd13f('0x2a')]);return _0x42c71b(_0x2db2c9[_0xd13f('0x27')][_0xd13f('0x2a')]);}logger[_0xd13f('0x27')](_0xd13f('0x29'),_0x122254,_0x2db2c9['error'][_0xd13f('0x2a')]);return _0x62c0d4(_0x2db2c9[_0xd13f('0x27')][_0xd13f('0x2a')]);}else{logger[_0xd13f('0x22')](_0xd13f('0x29'),_0x122254,_0xd13f('0x25'));_0x62c0d4(_0x2db2c9[_0xd13f('0x2b')][_0xd13f('0x2a')]);}})[_0xd13f('0x2c')](function(_0x12127a){logger[_0xd13f('0x27')](_0xd13f('0x29'),_0x122254,_0x12127a);_0x42c71b(_0x12127a);});});}function respondWithStatusCode(_0x47caaa,_0x5caf65){_0x5caf65=_0x5caf65||0xcc;return function(_0x22c348){if(_0x22c348){return _0x47caaa[_0xd13f('0x2d')](_0x5caf65);}return _0x47caaa[_0xd13f('0x2e')](_0x5caf65)[_0xd13f('0x2f')]();};}function respondWithResult(_0x49e0d5,_0x4ec98c){_0x4ec98c=_0x4ec98c||0xc8;return function(_0x1f4605){if(_0x1f4605){return _0x49e0d5['status'](_0x4ec98c)[_0xd13f('0x30')](_0x1f4605);}};}function respondWithFilteredResult(_0x44b2bd,_0x534fb5){return function(_0x1cd8c5){if(_0x1cd8c5){var _0x157c4e=typeof _0x534fb5['offset']===_0xd13f('0x31')&&typeof _0x534fb5[_0xd13f('0x32')]===_0xd13f('0x31');var _0xa427ce=_0x1cd8c5[_0xd13f('0x33')];var _0x4279d4=_0x157c4e?0x0:_0x534fb5[_0xd13f('0x34')];var _0xd15d2a=_0x157c4e?_0x1cd8c5['count']:_0x534fb5[_0xd13f('0x34')]+_0x534fb5[_0xd13f('0x32')];var _0x5a7b35;if(_0xd15d2a>=_0xa427ce){_0xd15d2a=_0xa427ce;_0x5a7b35=0xc8;}else{_0x5a7b35=0xce;}_0x44b2bd[_0xd13f('0x2e')](_0x5a7b35);return _0x44b2bd[_0xd13f('0x35')](_0xd13f('0x36'),_0x4279d4+'-'+_0xd15d2a+'/'+_0xa427ce)['json'](_0x1cd8c5);}return null;};}function patchUpdates(_0x29a265){return function(_0x375d6a){try{jsonpatch[_0xd13f('0x37')](_0x375d6a,_0x29a265,!![]);}catch(_0x5f484f){return BPromise['reject'](_0x5f484f);}return _0x375d6a[_0xd13f('0x38')]();};}function saveUpdates(_0x5987fc,_0x230197){return function(_0x1c06ce){if(_0x1c06ce){return _0x1c06ce['update'](_0x5987fc)[_0xd13f('0x21')](function(_0x44c569){return _0x44c569;});}return null;};}function removeEntity(_0xf6548e,_0xf215f8){return function(_0x15e91b){if(_0x15e91b){return _0x15e91b[_0xd13f('0x39')]()[_0xd13f('0x21')](function(){var _0x5c8aa6=_0x15e91b[_0xd13f('0x3a')]({'plain':!![]});var _0x536dfe='MailAccounts';return db[_0xd13f('0x3b')][_0xd13f('0x39')]({'where':{'type':_0x536dfe,'resourceId':_0x5c8aa6['id']}})[_0xd13f('0x21')](function(){return _0x15e91b;});})[_0xd13f('0x21')](function(){_0xf6548e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d194c,_0x4ccaef){return function(_0x23825d){if(!_0x23825d){_0x4d194c[_0xd13f('0x2d')](0x194);}return _0x23825d;};}function handleError(_0x9392f1,_0x5bb787){_0x5bb787=_0x5bb787||0x1f4;return function(_0x579e28){logger[_0xd13f('0x27')](_0x579e28[_0xd13f('0x3c')]);if(_0x579e28[_0xd13f('0x3d')]){delete _0x579e28[_0xd13f('0x3d')];}_0x9392f1[_0xd13f('0x2e')](_0x5bb787)[_0xd13f('0x3e')](_0x579e28);};}exports[_0xd13f('0x3f')]=function(_0x40d992,_0x337400){var _0x203288={'include':[{'model':db[_0xd13f('0x40')],'as':_0xd13f('0x41')},{'model':db[_0xd13f('0x42')],'as':_0xd13f('0x43')},{'model':db['Pause'],'as':_0xd13f('0x44')}]},_0x751c40={},_0xb80d9d={'count':0x0,'rows':[]};var _0x1ff4b3=_[_0xd13f('0x45')](db[_0xd13f('0x46')]['rawAttributes'],function(_0x59109d){return{'name':_0x59109d['fieldName'],'type':_0x59109d[_0xd13f('0x47')]['key']};});_0x751c40[_0xd13f('0x48')]=_[_0xd13f('0x45')](_0x1ff4b3,_0xd13f('0x3d'));_0x751c40[_0xd13f('0x49')]=_[_0xd13f('0x4a')](_0x40d992[_0xd13f('0x49')]);_0x751c40[_0xd13f('0x4b')]=_[_0xd13f('0x4c')](_0x751c40['model'],_0x751c40[_0xd13f('0x49')]);_0x203288[_0xd13f('0x4d')]=_[_0xd13f('0x4c')](_0x751c40[_0xd13f('0x48')],qs['fields'](_0x40d992[_0xd13f('0x49')][_0xd13f('0x4e')]));_0x203288[_0xd13f('0x4d')]=_0x203288[_0xd13f('0x4d')]['length']?_0x203288[_0xd13f('0x4d')]:_0x751c40[_0xd13f('0x48')];if(!_0x40d992['query'][_0xd13f('0x4f')](_0xd13f('0x50'))){_0x203288[_0xd13f('0x32')]=qs[_0xd13f('0x32')](_0x40d992[_0xd13f('0x49')][_0xd13f('0x32')]);_0x203288[_0xd13f('0x34')]=qs[_0xd13f('0x34')](_0x40d992[_0xd13f('0x49')][_0xd13f('0x34')]);}_0x203288['order']=qs[_0xd13f('0x51')](_0x40d992[_0xd13f('0x49')]['sort']);_0x203288[_0xd13f('0x52')]=qs['filters'](_[_0xd13f('0x53')](_0x40d992[_0xd13f('0x49')],_0x751c40[_0xd13f('0x4b')]),_0x1ff4b3);if(_0x40d992[_0xd13f('0x49')][_0xd13f('0x54')]){_0x203288['where']=_[_0xd13f('0x55')](_0x203288[_0xd13f('0x52')],{'$or':_[_0xd13f('0x45')](_0x1ff4b3,function(_0xe3e6cb){if(_0xe3e6cb['type']!==_0xd13f('0x56')){var _0x2672f9={};_0x2672f9[_0xe3e6cb[_0xd13f('0x3d')]]={'$like':'%'+_0x40d992[_0xd13f('0x49')]['filter']+'%'};return _0x2672f9;}})});}_0x203288=_[_0xd13f('0x55')]({},_0x203288,_0x40d992['options']);var _0x18105c={'where':_0x203288[_0xd13f('0x52')]};return db[_0xd13f('0x46')][_0xd13f('0x33')](_0x18105c)[_0xd13f('0x21')](function(_0xd233b){_0xb80d9d[_0xd13f('0x33')]=_0xd233b;if(_0x40d992[_0xd13f('0x49')][_0xd13f('0x57')]){_0x203288[_0xd13f('0x58')]=[{'all':!![]}];}return db[_0xd13f('0x46')][_0xd13f('0x59')](_0x203288);})['then'](function(_0x10288b){_0xb80d9d[_0xd13f('0x5a')]=_0x10288b;return _0xb80d9d;})[_0xd13f('0x21')](respondWithFilteredResult(_0x337400,_0x203288))[_0xd13f('0x2c')](handleError(_0x337400,null));};exports[_0xd13f('0x5b')]=function(_0x111164,_0x389940){var _0x14ba62={'raw':![],'where':{'id':_0x111164[_0xd13f('0x5c')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xd13f('0x42')],'as':'Smtp'},{'model':db[_0xd13f('0x5d')],'as':_0xd13f('0x44')}]},_0x5e2c27={};_0x5e2c27[_0xd13f('0x48')]=_[_0xd13f('0x4a')](db[_0xd13f('0x46')]['rawAttributes']);_0x5e2c27[_0xd13f('0x49')]=_[_0xd13f('0x4a')](_0x111164[_0xd13f('0x49')]);_0x5e2c27[_0xd13f('0x4b')]=_[_0xd13f('0x4c')](_0x5e2c27[_0xd13f('0x48')],_0x5e2c27[_0xd13f('0x49')]);_0x14ba62[_0xd13f('0x4d')]=_[_0xd13f('0x4c')](_0x5e2c27[_0xd13f('0x48')],qs[_0xd13f('0x4e')](_0x111164[_0xd13f('0x49')][_0xd13f('0x4e')]));_0x14ba62['attributes']=_0x14ba62[_0xd13f('0x4d')]['length']?_0x14ba62[_0xd13f('0x4d')]:_0x5e2c27[_0xd13f('0x48')];if(_0x111164[_0xd13f('0x49')]['includeAll']){_0x14ba62['include']=[{'all':!![]}];}_0x14ba62=_[_0xd13f('0x55')]({},_0x14ba62,_0x111164['options']);return db[_0xd13f('0x46')][_0xd13f('0x5e')](_0x14ba62)['then'](handleEntityNotFound(_0x389940,null))[_0xd13f('0x21')](respondWithResult(_0x389940,null))[_0xd13f('0x2c')](handleError(_0x389940,null));};exports['update']=function(_0x4e65c4,_0x28c979){if(_0x4e65c4['body']['id']){delete _0x4e65c4[_0xd13f('0x5f')]['id'];}return db[_0xd13f('0x46')][_0xd13f('0x5e')]({'where':{'id':_0x4e65c4['params']['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xd13f('0x42')],'as':_0xd13f('0x43')},{'model':db['Pause'],'as':_0xd13f('0x44')}]})[_0xd13f('0x21')](handleEntityNotFound(_0x28c979,null))['then'](saveUpdates(_0x4e65c4[_0xd13f('0x5f')],null))[_0xd13f('0x21')](function(_0x4763a1){if(_0x4763a1&&_0x4e65c4[_0xd13f('0x5f')][_0xd13f('0x41')]){return db['MailServerIn'][_0xd13f('0x60')](_0x4e65c4[_0xd13f('0x5f')]['Imap'],{'where':{'MailAccountId':_0x4763a1['id']}})[_0xd13f('0x21')](function(){return _0x4763a1;});}return _0x4763a1;})[_0xd13f('0x21')](function(_0x2b6a58){if(_0x2b6a58&&_0x4e65c4['body'][_0xd13f('0x43')]){return db[_0xd13f('0x42')][_0xd13f('0x60')](_0x4e65c4[_0xd13f('0x5f')][_0xd13f('0x43')],{'where':{'MailAccountId':_0x2b6a58['id']}})[_0xd13f('0x21')](function(){return _0x2b6a58;});}return _0x2b6a58;})[_0xd13f('0x21')](respondWithResult(_0x28c979,null))[_0xd13f('0x2c')](handleError(_0x28c979,null));};exports[_0xd13f('0x61')]=function(_0x1e14a4,_0x5bbc81){return db[_0xd13f('0x46')][_0xd13f('0x61')]()['then'](respondWithResult(_0x5bbc81,null))[_0xd13f('0x2c')](handleError(_0x5bbc81,null));};exports[_0xd13f('0x62')]=function(_0x369c3e,_0x48e85a,_0x6aa683){if(_0x369c3e['body']['id']){delete _0x369c3e[_0xd13f('0x5f')]['id'];}return db[_0xd13f('0x46')][_0xd13f('0x5e')]({'where':{'id':_0x369c3e[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x48e85a,null))[_0xd13f('0x21')](function(_0x4a77c2){if(_0x4a77c2){_0x369c3e[_0xd13f('0x5f')][_0xd13f('0x63')]=_0x4a77c2['id'];return db[_0xd13f('0x64')][_0xd13f('0x65')](_0x369c3e['body']);}})[_0xd13f('0x21')](respondWithResult(_0x48e85a,null))[_0xd13f('0x2c')](handleError(_0x48e85a,null));};exports['getDispositions']=function(_0x2bbf58,_0x44de80,_0x549bd4){var _0x4db34f={'raw':![],'where':{}};var _0x3aca78={};var _0x1397fe={'count':0x0,'rows':[]};return db['MailAccount'][_0xd13f('0x66')]({'where':{'id':_0x2bbf58[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x44de80,null))[_0xd13f('0x21')](function(_0x33b0c6){if(_0x33b0c6){_0x3aca78['model']=_['keys'](db[_0xd13f('0x64')][_0xd13f('0x67')]);_0x3aca78[_0xd13f('0x49')]=_[_0xd13f('0x4a')](_0x2bbf58[_0xd13f('0x49')]);_0x3aca78['filters']=_[_0xd13f('0x4c')](_0x3aca78[_0xd13f('0x48')],_0x3aca78['query']);_0x4db34f[_0xd13f('0x4d')]=_[_0xd13f('0x4c')](_0x3aca78[_0xd13f('0x48')],qs[_0xd13f('0x4e')](_0x2bbf58['query'][_0xd13f('0x4e')]));_0x4db34f[_0xd13f('0x4d')]=_0x4db34f[_0xd13f('0x4d')][_0xd13f('0x68')]?_0x4db34f[_0xd13f('0x4d')]:_0x3aca78[_0xd13f('0x48')];if(!_0x2bbf58[_0xd13f('0x49')][_0xd13f('0x4f')](_0xd13f('0x50'))){_0x4db34f[_0xd13f('0x32')]=qs['limit'](_0x2bbf58[_0xd13f('0x49')][_0xd13f('0x32')]);_0x4db34f['offset']=qs[_0xd13f('0x34')](_0x2bbf58[_0xd13f('0x49')][_0xd13f('0x34')]);}_0x4db34f[_0xd13f('0x69')]=qs['sort'](_0x2bbf58[_0xd13f('0x49')][_0xd13f('0x51')]);_0x4db34f[_0xd13f('0x52')]=qs['filters'](_['pick'](_0x2bbf58[_0xd13f('0x49')],_0x3aca78[_0xd13f('0x4b')]));_0x4db34f[_0xd13f('0x52')]['MailAccountId']=_0x33b0c6['id'];if(_0x2bbf58[_0xd13f('0x49')][_0xd13f('0x54')]){_0x4db34f[_0xd13f('0x52')]=_[_0xd13f('0x55')](_0x4db34f[_0xd13f('0x52')],{'$or':_[_0xd13f('0x45')](_0x4db34f[_0xd13f('0x4d')],function(_0x136022){var _0x3b20a7={};_0x3b20a7[_0x136022]={'$like':'%'+_0x2bbf58[_0xd13f('0x49')]['filter']+'%'};return _0x3b20a7;})});}_0x4db34f=_[_0xd13f('0x55')]({},_0x4db34f,_0x2bbf58[_0xd13f('0x6a')]);return db['Disposition'][_0xd13f('0x33')]({'where':_0x4db34f['where']})[_0xd13f('0x21')](function(_0x231cb9){_0x1397fe[_0xd13f('0x33')]=_0x231cb9;if(_0x2bbf58[_0xd13f('0x49')][_0xd13f('0x57')]){_0x4db34f[_0xd13f('0x58')]=[{'all':!![]}];}return db[_0xd13f('0x64')]['findAll'](_0x4db34f);})[_0xd13f('0x21')](function(_0x3816c4){_0x1397fe[_0xd13f('0x5a')]=_0x3816c4;return _0x1397fe;});}})[_0xd13f('0x21')](respondWithFilteredResult(_0x44de80,_0x4db34f))['catch'](handleError(_0x44de80,null));};exports[_0xd13f('0x6b')]=function(_0x21d568,_0x48d3f0,_0x577dbd){return db[_0xd13f('0x46')][_0xd13f('0x5e')]({'where':{'id':_0x21d568[_0xd13f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x48d3f0,null))['then'](function(_0x54993b){if(_0x54993b){return _0x54993b[_0xd13f('0x6b')](_0x21d568[_0xd13f('0x49')][_0xd13f('0x6c')]);}})['then'](respondWithStatusCode(_0x48d3f0,null))[_0xd13f('0x2c')](handleError(_0x48d3f0,null));};exports[_0xd13f('0x6d')]=function(_0x5e536d,_0x3bf86d,_0x352b5b){if(_0x5e536d[_0xd13f('0x5f')]['id']){delete _0x5e536d[_0xd13f('0x5f')]['id'];}return db[_0xd13f('0x46')]['find']({'where':{'id':_0x5e536d[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x3bf86d,null))[_0xd13f('0x21')](function(_0x3c6663){if(_0x3c6663){_0x5e536d['body'][_0xd13f('0x63')]=_0x3c6663['id'];return db[_0xd13f('0x6e')][_0xd13f('0x65')](_0x5e536d['body']);}})[_0xd13f('0x21')](respondWithResult(_0x3bf86d,null))[_0xd13f('0x2c')](handleError(_0x3bf86d,null));};exports[_0xd13f('0x6f')]=function(_0x45fae7,_0x3ec4dd,_0x300041){var _0x3b7912={'raw':![],'where':{}};var _0x427723={};var _0x2a7cbd={'count':0x0,'rows':[]};return db[_0xd13f('0x46')][_0xd13f('0x66')]({'where':{'id':_0x45fae7[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x3ec4dd,null))[_0xd13f('0x21')](function(_0xed6af7){if(_0xed6af7){_0x427723[_0xd13f('0x48')]=_[_0xd13f('0x4a')](db[_0xd13f('0x6e')]['rawAttributes']);_0x427723[_0xd13f('0x49')]=_[_0xd13f('0x4a')](_0x45fae7[_0xd13f('0x49')]);_0x427723[_0xd13f('0x4b')]=_['intersection'](_0x427723[_0xd13f('0x48')],_0x427723[_0xd13f('0x49')]);_0x3b7912[_0xd13f('0x4d')]=_[_0xd13f('0x4c')](_0x427723[_0xd13f('0x48')],qs['fields'](_0x45fae7[_0xd13f('0x49')]['fields']));_0x3b7912[_0xd13f('0x4d')]=_0x3b7912[_0xd13f('0x4d')][_0xd13f('0x68')]?_0x3b7912[_0xd13f('0x4d')]:_0x427723['model'];if(!_0x45fae7[_0xd13f('0x49')][_0xd13f('0x4f')]('nolimit')){_0x3b7912[_0xd13f('0x32')]=qs[_0xd13f('0x32')](_0x45fae7[_0xd13f('0x49')]['limit']);_0x3b7912[_0xd13f('0x34')]=qs[_0xd13f('0x34')](_0x45fae7['query'][_0xd13f('0x34')]);}_0x3b7912[_0xd13f('0x69')]=qs['sort'](_0x45fae7['query'][_0xd13f('0x51')]);_0x3b7912[_0xd13f('0x52')]=qs[_0xd13f('0x4b')](_[_0xd13f('0x53')](_0x45fae7['query'],_0x427723['filters']));_0x3b7912[_0xd13f('0x52')][_0xd13f('0x63')]=_0xed6af7['id'];if(_0x45fae7['query'][_0xd13f('0x54')]){_0x3b7912['where']=_[_0xd13f('0x55')](_0x3b7912[_0xd13f('0x52')],{'$or':_[_0xd13f('0x45')](_0x3b7912[_0xd13f('0x4d')],function(_0x525b6f){var _0x68e376={};_0x68e376[_0x525b6f]={'$like':'%'+_0x45fae7[_0xd13f('0x49')]['filter']+'%'};return _0x68e376;})});}_0x3b7912=_[_0xd13f('0x55')]({},_0x3b7912,_0x45fae7[_0xd13f('0x6a')]);return db[_0xd13f('0x6e')]['count']({'where':_0x3b7912[_0xd13f('0x52')]})[_0xd13f('0x21')](function(_0x32a59e){_0x2a7cbd[_0xd13f('0x33')]=_0x32a59e;if(_0x45fae7[_0xd13f('0x49')][_0xd13f('0x57')]){_0x3b7912['include']=[{'all':!![]}];}return db[_0xd13f('0x6e')][_0xd13f('0x59')](_0x3b7912);})[_0xd13f('0x21')](function(_0x2e7a2c){_0x2a7cbd['rows']=_0x2e7a2c;return _0x2a7cbd;});}})[_0xd13f('0x21')](respondWithFilteredResult(_0x3ec4dd,_0x3b7912))[_0xd13f('0x2c')](handleError(_0x3ec4dd,null));};exports[_0xd13f('0x70')]=function(_0x456a4d,_0x461ffe,_0x2bbd78){return db[_0xd13f('0x46')][_0xd13f('0x5e')]({'where':{'id':_0x456a4d['params']['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x461ffe,null))[_0xd13f('0x21')](function(_0x2c41ef){if(_0x2c41ef){return _0x2c41ef[_0xd13f('0x70')](_0x456a4d['query'][_0xd13f('0x6c')]);}})[_0xd13f('0x21')](respondWithStatusCode(_0x461ffe,null))['catch'](handleError(_0x461ffe,null));};exports[_0xd13f('0x65')]=function(_0x23aee7,_0x46c4fd){var _0x264a76={'name':_0x23aee7[_0xd13f('0x5f')]['name'],'key':_0x23aee7[_0xd13f('0x5f')][_0xd13f('0x71')],'email':_0x23aee7[_0xd13f('0x5f')][_0xd13f('0x72')],'ListId':_0x23aee7[_0xd13f('0x5f')]['ListId'],'active':!_['isNil'](_0x23aee7['body'][_0xd13f('0x73')])?_0x23aee7[_0xd13f('0x5f')][_0xd13f('0x73')]:!![],'description':_0x23aee7[_0xd13f('0x5f')]['description']||null,'Imap':{},'Smtp':{}};if(_[_0xd13f('0x74')](_0x23aee7[_0xd13f('0x5f')][_0xd13f('0x75')])){if(_0x23aee7[_0xd13f('0x5f')][_0xd13f('0x76')]){_0x264a76[_0xd13f('0x41')][_0xd13f('0x77')]=_0x264a76['Smtp'][_0xd13f('0x77')]=_0x23aee7[_0xd13f('0x5f')][_0xd13f('0x78')];_0x264a76[_0xd13f('0x41')][_0xd13f('0x79')]=_0x264a76[_0xd13f('0x43')][_0xd13f('0x7a')]=_0x23aee7[_0xd13f('0x5f')]['cpassword'];}else{_0x264a76[_0xd13f('0x41')]['authentication']=_0x264a76[_0xd13f('0x43')][_0xd13f('0x7b')]=![];}_0x264a76[_0xd13f('0x41')][_0xd13f('0x7c')]=_0x23aee7[_0xd13f('0x5f')]['Imap'][_0xd13f('0x7c')];_0x264a76[_0xd13f('0x41')][_0xd13f('0x7d')]=_0x23aee7['body'][_0xd13f('0x41')][_0xd13f('0x7d')];_0x264a76[_0xd13f('0x43')]['host']=_0x23aee7[_0xd13f('0x5f')][_0xd13f('0x43')]['host'];_0x264a76['Smtp']['port']=_0x23aee7[_0xd13f('0x5f')]['Smtp'][_0xd13f('0x7d')];}else{_0x264a76[_0xd13f('0x41')]['service']=_0x264a76[_0xd13f('0x43')]['service']=_0x23aee7['body'][_0xd13f('0x75')];_0x264a76[_0xd13f('0x41')][_0xd13f('0x77')]=_0x264a76[_0xd13f('0x43')]['user']=_0x23aee7['body'][_0xd13f('0x78')];_0x264a76[_0xd13f('0x41')][_0xd13f('0x79')]=_0x264a76['Smtp'][_0xd13f('0x7a')]=_0x23aee7[_0xd13f('0x5f')]['cpassword'];}return db['MailAccount'][_0xd13f('0x65')](_0x264a76,{'include':[{'model':db[_0xd13f('0x42')],'as':_0xd13f('0x43')},{'model':db[_0xd13f('0x40')],'as':_0xd13f('0x41')}]})[_0xd13f('0x21')](function(_0x385c2a){var _0x667d7=_0x23aee7[_0xd13f('0x77')]['get']({'plain':!![]});if(!_0x667d7)throw new Error(_0xd13f('0x7e'));if(_0x667d7['role']===_0xd13f('0x77')){var _0x55244a=_0x385c2a['get']({'plain':!![]});return db[_0xd13f('0x7f')]['find']({'where':{'name':_0xd13f('0x80'),'userProfileId':_0x667d7[_0xd13f('0x81')]},'raw':!![]})['then'](function(_0x142d31){if(_0x142d31&&_0x142d31[_0xd13f('0x82')]===0x0){return db['UserProfileResource']['create']({'name':_0x55244a[_0xd13f('0x3d')],'resourceId':_0x55244a['id'],'type':_0x142d31[_0xd13f('0x3d')],'sectionId':_0x142d31['id']},{})['then'](function(){return _0x385c2a;});}else{return _0x385c2a;}})[_0xd13f('0x2c')](function(_0x1dff46){logger[_0xd13f('0x27')](_0xd13f('0x83'),_0x1dff46);throw _0x1dff46;});}return _0x385c2a;})[_0xd13f('0x21')](respondWithResult(_0x46c4fd,0xc9))['catch'](handleError(_0x46c4fd,null));};exports[_0xd13f('0x84')]=function(_0x1c6ebe,_0x4595ae,_0x13615b){return db[_0xd13f('0x46')][_0xd13f('0x66')]({'where':{'id':_0x1c6ebe[_0xd13f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4595ae,null))[_0xd13f('0x21')](function(_0x31d7b2){if(_0x31d7b2){return _0x31d7b2[_0xd13f('0x84')]();}return null;})['then'](respondWithResult(_0x4595ae,null))[_0xd13f('0x2c')](handleError(_0x4595ae,null));};exports[_0xd13f('0x85')]=function(_0x5e5b4a,_0x32f57d,_0x4e93f9){if(_0x5e5b4a[_0xd13f('0x5f')]['id']){delete _0x5e5b4a[_0xd13f('0x5f')]['id'];}return db[_0xd13f('0x46')][_0xd13f('0x5e')]({'where':{'id':_0x5e5b4a[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x32f57d,null))[_0xd13f('0x21')](function(_0x1cb04f){if(_0x1cb04f){_0x5e5b4a[_0xd13f('0x5f')]['MailAccountId']=_0x1cb04f['id'];return db[_0xd13f('0x40')][_0xd13f('0x65')](_0x5e5b4a[_0xd13f('0x5f')]);}})[_0xd13f('0x21')](respondWithResult(_0x32f57d,null))[_0xd13f('0x2c')](handleError(_0x32f57d,null));};exports[_0xd13f('0x86')]=function(_0x56564d,_0x3f9484,_0x3fb028){return db[_0xd13f('0x46')]['findOne']({'where':{'id':_0x56564d[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x3f9484,null))[_0xd13f('0x21')](function(_0x3091b7){if(_0x3091b7){return _0x3091b7['setImap'](null);}return null;})[_0xd13f('0x21')](respondWithStatusCode(_0x3f9484,null))[_0xd13f('0x2c')](handleError(_0x3f9484,null));};exports[_0xd13f('0x87')]=function(_0x43fc74,_0x55b389,_0x313079){return db[_0xd13f('0x46')][_0xd13f('0x66')]({'where':{'id':_0x43fc74[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x55b389,null))['then'](function(_0x5909d7){if(_0x5909d7){return _0x5909d7[_0xd13f('0x87')]();}return null;})[_0xd13f('0x21')](respondWithResult(_0x55b389,null))['catch'](handleError(_0x55b389,null));};exports[_0xd13f('0x88')]=function(_0x506557,_0x1460f7,_0x525bea){if(_0x506557[_0xd13f('0x5f')]['id']){delete _0x506557['body']['id'];}return db[_0xd13f('0x46')]['find']({'where':{'id':_0x506557[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x1460f7,null))[_0xd13f('0x21')](function(_0xde67b8){if(_0xde67b8){_0x506557[_0xd13f('0x5f')]['MailAccountId']=_0xde67b8['id'];return db[_0xd13f('0x42')][_0xd13f('0x65')](_0x506557['body']);}})['then'](respondWithResult(_0x1460f7,null))[_0xd13f('0x2c')](handleError(_0x1460f7,null));};exports[_0xd13f('0x89')]=function(_0x4317d0,_0x342236,_0x4ea375){return db[_0xd13f('0x46')]['findOne']({'where':{'id':_0x4317d0[_0xd13f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x342236,null))[_0xd13f('0x21')](function(_0x36e885){if(_0x36e885){return _0x36e885['setSmtp'](null);}return null;})[_0xd13f('0x21')](respondWithStatusCode(_0x342236,null))[_0xd13f('0x2c')](handleError(_0x342236,null));};exports[_0xd13f('0x8a')]=function(_0x5c5527,_0x41ecfa,_0x5b6fc1){return db['MailInteraction'][_0xd13f('0x5e')]({'where':{'id':_0x5c5527[_0xd13f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x41ecfa,null))['then'](function(_0x587553){if(_0x587553){return _0x587553[_0xd13f('0x8a')](_0x5c5527['body'][_0xd13f('0x6c')],_[_0xd13f('0x8b')](_0x5c5527[_0xd13f('0x5f')],['ids','id'])||{});}})['then'](respondWithResult(_0x41ecfa,null))['catch'](handleError(_0x41ecfa,null));};exports[_0xd13f('0x8c')]=function(_0x2e8245,_0x10f4c6,_0x1154eb){var _0x5b8870={'raw':![],'where':{}};var _0x37a216={};var _0x490693={'count':0x0,'rows':[]};return db[_0xd13f('0x46')][_0xd13f('0x66')]({'where':{'id':_0x2e8245['params']['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x10f4c6,null))[_0xd13f('0x21')](function(_0x33d115){if(_0x33d115){_0x37a216[_0xd13f('0x48')]=_[_0xd13f('0x4a')](db['MailInteraction'][_0xd13f('0x67')]);_0x37a216[_0xd13f('0x49')]=_['keys'](_0x2e8245[_0xd13f('0x49')]);_0x37a216[_0xd13f('0x4b')]=_['intersection'](_0x37a216[_0xd13f('0x48')],_0x37a216[_0xd13f('0x49')]);_0x5b8870[_0xd13f('0x4d')]=_['intersection'](_0x37a216[_0xd13f('0x48')],qs[_0xd13f('0x4e')](_0x2e8245[_0xd13f('0x49')][_0xd13f('0x4e')]));_0x5b8870['attributes']=_0x5b8870[_0xd13f('0x4d')][_0xd13f('0x68')]?_0x5b8870['attributes']:_0x37a216[_0xd13f('0x48')];if(!_0x2e8245['query']['hasOwnProperty'](_0xd13f('0x50'))){_0x5b8870[_0xd13f('0x32')]=qs[_0xd13f('0x32')](_0x2e8245[_0xd13f('0x49')][_0xd13f('0x32')]);_0x5b8870[_0xd13f('0x34')]=qs['offset'](_0x2e8245[_0xd13f('0x49')][_0xd13f('0x34')]);}_0x5b8870[_0xd13f('0x69')]=qs[_0xd13f('0x51')](_0x2e8245[_0xd13f('0x49')]['sort']);_0x5b8870['where']=qs['filters'](_['pick'](_0x2e8245[_0xd13f('0x49')],_0x37a216[_0xd13f('0x4b')]));_0x5b8870[_0xd13f('0x52')][_0xd13f('0x63')]=_0x33d115['id'];if(_0x2e8245[_0xd13f('0x49')]['filter']){_0x5b8870[_0xd13f('0x52')]=_['merge'](_0x5b8870[_0xd13f('0x52')],{'$or':_[_0xd13f('0x45')](_0x5b8870[_0xd13f('0x4d')],function(_0x297e64){var _0x307407={};_0x307407[_0x297e64]={'$like':'%'+_0x2e8245[_0xd13f('0x49')][_0xd13f('0x54')]+'%'};return _0x307407;})});}_0x5b8870=_[_0xd13f('0x55')]({},_0x5b8870,_0x2e8245['options']);return db[_0xd13f('0x8d')][_0xd13f('0x33')]({'where':_0x5b8870[_0xd13f('0x52')]})[_0xd13f('0x21')](function(_0x2708bf){_0x490693[_0xd13f('0x33')]=_0x2708bf;if(_0x2e8245[_0xd13f('0x49')]['includeAll']){_0x5b8870[_0xd13f('0x58')]=[{'model':db[_0xd13f('0x8e')],'as':_0xd13f('0x8f'),'required':![]},{'model':db[_0xd13f('0x90')],'as':_0xd13f('0x91'),'attributes':[_0xd13f('0x3d'),_0xd13f('0x92'),_0xd13f('0x93')],'required':![]},{'model':db[_0xd13f('0x94')],'as':'Tags','attributes':['id','name','color'],'where':_0x2e8245['query'][_0xd13f('0x95')]?{'id':_0x2e8245[_0xd13f('0x49')][_0xd13f('0x95')]}:undefined,'required':_0x2e8245[_0xd13f('0x49')][_0xd13f('0x95')]?!![]:![]}];}return db['MailInteraction'][_0xd13f('0x59')](_0x5b8870);})['then'](function(_0x3b64a1){_0x490693[_0xd13f('0x5a')]=_0x3b64a1;return _0x490693;});}})[_0xd13f('0x21')](respondWithFilteredResult(_0x10f4c6,_0x5b8870))[_0xd13f('0x2c')](handleError(_0x10f4c6,null));};exports['addApplications']=function(_0x1acb31,_0x187f51,_0x1af3ba){return db[_0xd13f('0x46')][_0xd13f('0x66')]({'where':{'id':_0x1acb31[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x187f51,null))['then'](function(_0x206923){if(_0x206923){return db[_0xd13f('0x96')][_0xd13f('0x97')](function(_0x18cc39){return db[_0xd13f('0x98')]['destroy']({'where':{'MailAccountId':_0x1acb31[_0xd13f('0x5c')]['id']},'transaction':_0x18cc39})[_0xd13f('0x21')](function(_0x785905){var _0x28bfed=_['map'](_0x1acb31['body'],function(_0x26282){_0x26282[_0xd13f('0x63')]=_0x1acb31['params']['id'];return _0x26282;});return db[_0xd13f('0x98')][_0xd13f('0x99')](_0x28bfed,{'transaction':_0x18cc39});});})[_0xd13f('0x21')](function(){return db[_0xd13f('0x98')][_0xd13f('0x9a')]({'where':{'MailAccountId':_0x1acb31[_0xd13f('0x5c')]['id']},'order':_0xd13f('0x9b')});});}})[_0xd13f('0x21')](respondWithResult(_0x187f51,null))[_0xd13f('0x2c')](handleError(_0x187f51,null));};exports[_0xd13f('0x9c')]=function(_0x2d4f00,_0x22faa5,_0x332c0c){var _0x2b1845={};var _0x4869b9={};var _0x23dd94;var _0x1e5d1b;return db[_0xd13f('0x46')][_0xd13f('0x66')]({'where':{'id':_0x2d4f00['params']['id']}})['then'](handleEntityNotFound(_0x22faa5,null))[_0xd13f('0x21')](function(_0x1d7abc){if(_0x1d7abc){_0x23dd94=_0x1d7abc;_0x4869b9['model']=_[_0xd13f('0x4a')](db['MailApplication'][_0xd13f('0x67')]);_0x4869b9[_0xd13f('0x49')]=_[_0xd13f('0x4a')](_0x2d4f00[_0xd13f('0x49')]);_0x4869b9[_0xd13f('0x4b')]=_['intersection'](_0x4869b9[_0xd13f('0x48')],_0x4869b9['query']);_0x2b1845[_0xd13f('0x4d')]=_[_0xd13f('0x4c')](_0x4869b9[_0xd13f('0x48')],qs['fields'](_0x2d4f00[_0xd13f('0x49')]['fields']));_0x2b1845[_0xd13f('0x4d')]=_0x2b1845[_0xd13f('0x4d')]['length']?_0x2b1845[_0xd13f('0x4d')]:_0x4869b9[_0xd13f('0x48')];_0x2b1845['order']=qs[_0xd13f('0x51')](_0x2d4f00['query'][_0xd13f('0x51')]);_0x2b1845['where']=qs[_0xd13f('0x4b')](_[_0xd13f('0x53')](_0x2d4f00['query'],_0x4869b9[_0xd13f('0x4b')]));if(_0x2d4f00[_0xd13f('0x49')][_0xd13f('0x54')]){_0x2b1845[_0xd13f('0x52')]=_[_0xd13f('0x55')](_0x2b1845['where'],{'$or':_['map'](_0x2b1845['attributes'],function(_0x4c8935){var _0x432d4b={};_0x432d4b[_0x4c8935]={'$like':'%'+_0x2d4f00[_0xd13f('0x49')][_0xd13f('0x54')]+'%'};return _0x432d4b;})});}_0x2b1845=_[_0xd13f('0x55')]({},_0x2b1845,_0x2d4f00[_0xd13f('0x6a')]);return _0x23dd94['getApplications'](_0x2b1845);}})[_0xd13f('0x21')](function(_0x570e44){if(_0x570e44){_0x1e5d1b=_0x570e44[_0xd13f('0x68')];if(!_0x2d4f00[_0xd13f('0x49')][_0xd13f('0x4f')](_0xd13f('0x50'))){_0x2b1845[_0xd13f('0x32')]=qs[_0xd13f('0x32')](_0x2d4f00[_0xd13f('0x49')]['limit']);_0x2b1845['offset']=qs[_0xd13f('0x34')](_0x2d4f00[_0xd13f('0x49')][_0xd13f('0x34')]);}return _0x23dd94[_0xd13f('0x9c')](_0x2b1845);}})[_0xd13f('0x21')](function(_0x476155){if(_0x476155){return _0x476155?{'count':_0x1e5d1b,'rows':_0x476155}:null;}})[_0xd13f('0x21')](respondWithResult(_0x22faa5,null))[_0xd13f('0x2c')](handleError(_0x22faa5,null));};exports[_0xd13f('0x9d')]=function(_0x197a8,_0x21f2d6,_0x252be2){var _0x4f03b5={'raw':!![],'where':{}};var _0x27cb67={};var _0x176d2e={'count':0x0,'rows':[]};return db[_0xd13f('0x46')][_0xd13f('0x66')]({'where':{'id':_0x197a8['params']['id']}})['then'](handleEntityNotFound(_0x21f2d6,null))[_0xd13f('0x21')](function(_0x3ab24b){if(_0x3ab24b){_0x27cb67[_0xd13f('0x48')]=_[_0xd13f('0x4a')](db['MailMessage'][_0xd13f('0x67')]);_0x27cb67[_0xd13f('0x49')]=_[_0xd13f('0x4a')](_0x197a8[_0xd13f('0x49')]);_0x27cb67[_0xd13f('0x4b')]=_[_0xd13f('0x4c')](_0x27cb67[_0xd13f('0x48')],_0x27cb67[_0xd13f('0x49')]);_0x4f03b5[_0xd13f('0x4d')]=_['intersection'](_0x27cb67[_0xd13f('0x48')],qs[_0xd13f('0x4e')](_0x197a8['query'][_0xd13f('0x4e')]));_0x4f03b5['attributes']=_0x4f03b5[_0xd13f('0x4d')][_0xd13f('0x68')]?_0x4f03b5[_0xd13f('0x4d')]:_0x27cb67[_0xd13f('0x48')];if(!_0x197a8[_0xd13f('0x49')][_0xd13f('0x4f')](_0xd13f('0x50'))){_0x4f03b5['limit']=qs[_0xd13f('0x32')](_0x197a8[_0xd13f('0x49')]['limit']);_0x4f03b5[_0xd13f('0x34')]=qs[_0xd13f('0x34')](_0x197a8[_0xd13f('0x49')]['offset']);}_0x4f03b5[_0xd13f('0x69')]=qs[_0xd13f('0x51')](_0x197a8['query'][_0xd13f('0x51')]);_0x4f03b5[_0xd13f('0x52')]=qs[_0xd13f('0x4b')](_[_0xd13f('0x53')](_0x197a8['query'],_0x27cb67[_0xd13f('0x4b')]));_0x4f03b5[_0xd13f('0x52')]['MailAccountId']=_0x3ab24b['id'];if(_0x197a8[_0xd13f('0x49')][_0xd13f('0x54')]){_0x4f03b5[_0xd13f('0x52')]=_[_0xd13f('0x55')](_0x4f03b5['where'],{'$or':_['map'](_0x4f03b5['attributes'],function(_0x5ab628){var _0x19b6cc={};_0x19b6cc[_0x5ab628]={'$like':'%'+_0x197a8[_0xd13f('0x49')][_0xd13f('0x54')]+'%'};return _0x19b6cc;})});}if(_0x197a8[_0xd13f('0x49')]['$gte']){var _0x930164=_0x197a8[_0xd13f('0x49')][_0xd13f('0x9e')][_0xd13f('0x9f')](',');var _0x2baab3={};_0x2baab3[_0x930164[0x0]]={'$gte':moment(_0x930164[0x1])[_0xd13f('0xa0')](_0xd13f('0xa1'))};_0x4f03b5[_0xd13f('0x52')]=_[_0xd13f('0x55')](_0x4f03b5[_0xd13f('0x52')],_0x2baab3);}_0x4f03b5=_['merge']({},_0x4f03b5,_0x197a8[_0xd13f('0x6a')]);return db['MailMessage'][_0xd13f('0x33')]({'where':_0x4f03b5['where']})[_0xd13f('0x21')](function(_0x1ecf16){_0x176d2e[_0xd13f('0x33')]=_0x1ecf16;if(_0x197a8[_0xd13f('0x49')][_0xd13f('0x57')]){_0x4f03b5['include']=[{'all':!![]}];}return db[_0xd13f('0xa2')][_0xd13f('0x59')](_0x4f03b5);})[_0xd13f('0x21')](function(_0x2ab152){if(_0x197a8[_0xd13f('0x49')]['inlineCss']==='true'){for(var _0x4be65a=0x0;_0x4be65a<_0x2ab152[_0xd13f('0x68')];_0x4be65a++){_0x2ab152[_0x4be65a][_0xd13f('0x5f')]=juice(_0x2ab152[_0x4be65a][_0xd13f('0x5f')]);}}_0x176d2e[_0xd13f('0x5a')]=_0x2ab152;return _0x176d2e;});}})[_0xd13f('0x21')](respondWithFilteredResult(_0x21f2d6,_0x4f03b5))[_0xd13f('0x2c')](handleError(_0x21f2d6,null));};exports[_0xd13f('0x3e')]=function(_0x414948,_0x5e6429,_0x13a06b){var _0x5aa986,_0x591ee7={},_0x489949;if(_0x414948[_0xd13f('0x5f')]['to']){_0x489949=_0x414948[_0xd13f('0x5f')]['to']['split'](',')[0x0];}return db[_0xd13f('0x46')][_0xd13f('0x5e')]({'where':{'id':_0x414948['params']['id']},'include':[{'model':db['CmList'],'as':_0xd13f('0xa3'),'include':[{'model':db['CmContact'],'as':_0xd13f('0xa4'),'where':{'email':_0x489949},'limit':0x1,'order':[[_0xd13f('0xa5'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0xd13f('0x43'),'raw':!![]}]})[_0xd13f('0x21')](handleEntityNotFound(_0x5e6429,null))[_0xd13f('0x21')](function(_0x37f72d){if(_0x37f72d){_0x5aa986=_0x37f72d;if(_0x37f72d[_0xd13f('0x43')]){if(_[_0xd13f('0x74')](_0x414948[_0xd13f('0x5f')]['from'])){_0x414948[_0xd13f('0x5f')][_0xd13f('0xa6')]=util[_0xd13f('0xa0')]('%s\x20<%s>',_0x37f72d[_0xd13f('0x3d')],_0x37f72d[_0xd13f('0x72')]||_0x37f72d[_0xd13f('0x43')][_0xd13f('0x77')]);}if(_0x414948[_0xd13f('0x5f')]['attachments']&&_0x414948[_0xd13f('0x5f')]['attachments'][_0xd13f('0x68')]){for(var _0xfa813e=0x0;_0xfa813e<_0x414948[_0xd13f('0x5f')][_0xd13f('0xa7')][_0xd13f('0x68')];_0xfa813e+=0x1){_0x414948[_0xd13f('0x5f')][_0xd13f('0xa7')][_0xfa813e]={'filename':_0x414948[_0xd13f('0x5f')]['attachments'][_0xfa813e][_0xd13f('0x3d')],'path':path['join'](config[_0xd13f('0xa8')],_0xd13f('0xa9'),_0x414948[_0xd13f('0x5f')]['attachments'][_0xfa813e]['basename'])};}}var _0x1bb307={'tls':{'rejectUnauthorized':![]}};if(_[_0xd13f('0x74')](_0x37f72d[_0xd13f('0x43')][_0xd13f('0xaa')])){if(_0x37f72d['Smtp']['authentication']){_0x1bb307[_0xd13f('0xab')]={'user':_0x37f72d[_0xd13f('0x43')][_0xd13f('0x77')],'pass':_0x37f72d[_0xd13f('0x43')][_0xd13f('0x7a')]};}_0x1bb307['host']=_0x37f72d[_0xd13f('0x43')][_0xd13f('0x7c')];_0x1bb307[_0xd13f('0x7d')]=_0x37f72d[_0xd13f('0x43')]['port'];_0x1bb307[_0xd13f('0xac')]=_0x37f72d[_0xd13f('0x43')][_0xd13f('0xac')];}else{_0x1bb307[_0xd13f('0xaa')]=_0x37f72d['Smtp'][_0xd13f('0xaa')];_0x1bb307[_0xd13f('0xab')]={'user':_0x37f72d[_0xd13f('0x43')][_0xd13f('0x77')],'pass':_0x37f72d[_0xd13f('0x43')]['pass']};}return respondWithRpcPromise(_0xd13f('0xad'),'sendMail',{'account':_0x1bb307,'message':_0x414948['body']});}else{throw new Error(_0xd13f('0xae'));}}})[_0xd13f('0x21')](function(_0x1194a4){if(_0x1194a4){_0x591ee7=_0x1194a4;if(_0x5aa986[_0xd13f('0xa3')]){if(_0x5aa986[_0xd13f('0xa3')][_0xd13f('0xa4')][_0xd13f('0x68')]){return _0x5aa986['List'][_0xd13f('0xa4')][0x0];}else{return db[_0xd13f('0x8e')][_0xd13f('0x65')](_['defaults'](_0x414948['body'],{'firstName':_0x414948[_0xd13f('0x5f')]['to'],'email':_0x414948['body']['to'],'phone':_0x414948[_0xd13f('0x5f')]['to'],'ListId':_0x5aa986[_0xd13f('0xaf')]}));}}else{throw new Error(_0xd13f('0xae'));}}})['then'](function(_0x4573ec){if(_0x4573ec){var _0x35b48f={'UserId':_0x414948[_0xd13f('0x77')]['id'],'ContactId':_0x4573ec['id'],'MailAccountId':_0x5aa986['id'],'inReplyTo':_0x591ee7['messageId'],'to':_0x414948['body'][_0xd13f('0xa6')],'cc':_0x414948['body']['cc'],'subject':_0x414948[_0xd13f('0x5f')][_0xd13f('0xb0')],'attach':_0x414948[_0xd13f('0x5f')][_0xd13f('0xb1')],'firstMsgDirection':_0xd13f('0xb2'),'lastMsgAt':moment()[_0xd13f('0xa0')](_0xd13f('0xa1')),'lastMsgDirection':_0xd13f('0xb2'),'Messages':[_['merge'](_0x414948['body'],{'messageId':_0x591ee7['messageId'],'sentAt':moment()[_0xd13f('0xa0')](_0xd13f('0xa1')),'read':!![],'MailAccountId':_0x5aa986['id'],'UserId':_0x414948[_0xd13f('0x77')]['id'],'ContactId':_0x4573ec['id']})]};if(_0x414948[_0xd13f('0x5f')][_0xd13f('0xb3')]){_0x35b48f=_[_0xd13f('0x55')](_0x35b48f,_0x414948[_0xd13f('0x5f')]['Interaction']);}return db['MailInteraction'][_0xd13f('0x65')](_0x35b48f,{'include':[{'model':db['MailMessage'],'as':_0xd13f('0xb4')}]});}})['then'](respondWithResult(_0x5e6429,null))[_0xd13f('0x2c')](handleError(_0x5e6429,null));};exports[_0xd13f('0xb5')]=function(_0x548c0f,_0x152a59,_0x265cdd){return db[_0xd13f('0x46')][_0xd13f('0x5e')]({'where':{'id':_0x548c0f[_0xd13f('0x5c')]['id']},'include':[{'model':db[_0xd13f('0x42')],'as':_0xd13f('0x43'),'raw':!![]}]})[_0xd13f('0x21')](handleEntityNotFound(_0x152a59,null))[_0xd13f('0x21')](function(_0x4ec385){if(_0x4ec385&&_0x4ec385['Smtp']){var _0x41c094={'id':_0x4ec385['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4ec385['Smtp'][_0xd13f('0xaa')]){_0x41c094[_0xd13f('0xaa')]=_0x4ec385['Smtp']['service'];}else{_0x41c094[_0xd13f('0x7c')]=_0x4ec385[_0xd13f('0x43')][_0xd13f('0x7c')];_0x41c094[_0xd13f('0x7d')]=_0x4ec385[_0xd13f('0x43')][_0xd13f('0x7d')];_0x41c094[_0xd13f('0xac')]=_0x4ec385[_0xd13f('0x43')][_0xd13f('0xac')];}if(_0x4ec385[_0xd13f('0x43')][_0xd13f('0x7b')]){_0x41c094['auth']={'user':_0x4ec385[_0xd13f('0x43')][_0xd13f('0x77')],'pass':_0x4ec385[_0xd13f('0x43')][_0xd13f('0x7a')]};}return respondWithRpcPromise(_0xd13f('0xb6'),_0xd13f('0xb5'),{'account':_0x41c094});}})[_0xd13f('0x21')](respondWithResult(_0x152a59,null))[_0xd13f('0x2c')](handleError(_0x152a59,null));};exports[_0xd13f('0x39')]=function(_0x4be14f,_0x4800f5){return db[_0xd13f('0x46')][_0xd13f('0x5e')]({'where':{'id':_0x4be14f[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x4800f5,null))['then'](function(_0x3fc9eb){if(_0x3fc9eb&&_0x3fc9eb[_0xd13f('0xaa')]){throw new db[(_0xd13f('0xb7'))][(_0xd13f('0xb8'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x3fc9eb;})[_0xd13f('0x21')](removeEntity(_0x4800f5,null))[_0xd13f('0x2c')](handleError(_0x4800f5,null));};exports['addAgents']=function(_0x12da5b,_0x5d5b94,_0x1636a7){return db[_0xd13f('0x46')]['find']({'where':{'id':_0x12da5b[_0xd13f('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5d5b94,null))[_0xd13f('0x21')](function(_0x6814ed){if(_0x6814ed){return _0x6814ed['addAgents'](_0x12da5b[_0xd13f('0x5f')]['ids'],_[_0xd13f('0x8b')](_0x12da5b[_0xd13f('0x5f')],[_0xd13f('0x6c'),'id'])||{})[_0xd13f('0xb9')](function(_0x35dd96){for(var _0x17973d=0x0;_0x17973d<_0x12da5b[_0xd13f('0x5f')]['ids'][_0xd13f('0x68')];_0x17973d+=0x1){socket[_0xd13f('0xba')](_0xd13f('0xbb'),{'UserId':Number(_0x12da5b[_0xd13f('0x5f')][_0xd13f('0x6c')][_0x17973d]),'MailAccountId':Number(_0x12da5b['params']['id'])});}return _0x35dd96;});}})[_0xd13f('0x21')](respondWithResult(_0x5d5b94,null))[_0xd13f('0x2c')](handleError(_0x5d5b94,null));};exports[_0xd13f('0xbc')]=function(_0x1f43a2,_0x1b8c78,_0x3f456c){return db[_0xd13f('0x46')][_0xd13f('0x5e')]({'where':{'id':_0x1f43a2[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x1b8c78,null))[_0xd13f('0x21')](function(_0x8d7216){if(_0x8d7216){return _0x8d7216['removeAgents'](_0x1f43a2[_0xd13f('0x49')]['ids'])[_0xd13f('0x21')](function(){if(_['isArray'](_0x1f43a2[_0xd13f('0x49')][_0xd13f('0x6c')])){for(var _0xcf31e9=0x0;_0xcf31e9<_0x1f43a2['query']['ids'][_0xd13f('0x68')];_0xcf31e9+=0x1){socket[_0xd13f('0xba')](_0xd13f('0xbd'),{'UserId':Number(_0x1f43a2[_0xd13f('0x49')][_0xd13f('0x6c')][_0xcf31e9]),'MailAccountId':Number(_0x1f43a2[_0xd13f('0x5c')]['id'])});}}else{socket[_0xd13f('0xba')](_0xd13f('0xbd'),{'UserId':Number(_0x1f43a2['query'][_0xd13f('0x6c')]),'MailAccountId':Number(_0x1f43a2[_0xd13f('0x5c')]['id'])});}});}})[_0xd13f('0x21')](respondWithStatusCode(_0x1b8c78,null))[_0xd13f('0x2c')](handleError(_0x1b8c78,null));};exports[_0xd13f('0xbe')]=function(_0x29ebc6,_0x2c2771,_0xbf8f12){var _0x2d3006={};var _0x5a41f2={};var _0x2a4ff2;var _0x542aa2;return db[_0xd13f('0x46')]['findOne']({'where':{'id':_0x29ebc6[_0xd13f('0x5c')]['id']}})[_0xd13f('0x21')](handleEntityNotFound(_0x2c2771,null))[_0xd13f('0x21')](function(_0x70fa6d){if(_0x70fa6d){_0x2a4ff2=_0x70fa6d;_0x5a41f2['model']=_['keys'](db[_0xd13f('0x90')][_0xd13f('0x67')]);_0x5a41f2[_0xd13f('0x49')]=_[_0xd13f('0x4a')](_0x29ebc6[_0xd13f('0x49')]);_0x5a41f2[_0xd13f('0x4b')]=_['intersection'](_0x5a41f2[_0xd13f('0x48')],_0x5a41f2[_0xd13f('0x49')]);_0x2d3006[_0xd13f('0x4d')]=_['intersection'](_0x5a41f2[_0xd13f('0x48')],qs['fields'](_0x29ebc6[_0xd13f('0x49')][_0xd13f('0x4e')]));_0x2d3006[_0xd13f('0x4d')]=_0x2d3006[_0xd13f('0x4d')][_0xd13f('0x68')]?_0x2d3006[_0xd13f('0x4d')]:_0x5a41f2[_0xd13f('0x48')];_0x2d3006[_0xd13f('0x69')]=qs['sort'](_0x29ebc6['query'][_0xd13f('0x51')]);_0x2d3006[_0xd13f('0x52')]=qs[_0xd13f('0x4b')](_[_0xd13f('0x53')](_0x29ebc6['query'],_0x5a41f2[_0xd13f('0x4b')]));if(_0x29ebc6['query'][_0xd13f('0x54')]){_0x2d3006[_0xd13f('0x52')]=_['merge'](_0x2d3006[_0xd13f('0x52')],{'$or':_[_0xd13f('0x45')](_0x2d3006[_0xd13f('0x4d')],function(_0x2dc452){var _0x5537f2={};_0x5537f2[_0x2dc452]={'$like':'%'+_0x29ebc6[_0xd13f('0x49')]['filter']+'%'};return _0x5537f2;})});}_0x2d3006=_[_0xd13f('0x55')]({},_0x2d3006,_0x29ebc6[_0xd13f('0x6a')]);return _0x2a4ff2['getAgents'](_0x2d3006);}})[_0xd13f('0x21')](function(_0x17b893){if(_0x17b893){_0x542aa2=_0x17b893[_0xd13f('0x68')];if(!_0x29ebc6[_0xd13f('0x49')][_0xd13f('0x4f')](_0xd13f('0x50'))){_0x2d3006[_0xd13f('0x32')]=qs[_0xd13f('0x32')](_0x29ebc6[_0xd13f('0x49')][_0xd13f('0x32')]);_0x2d3006[_0xd13f('0x34')]=qs['offset'](_0x29ebc6[_0xd13f('0x49')][_0xd13f('0x34')]);}return _0x2a4ff2['getAgents'](_0x2d3006);}})[_0xd13f('0x21')](function(_0x210e15){if(_0x210e15){return _0x210e15?{'count':_0x542aa2,'rows':_0x210e15}:null;}})[_0xd13f('0x21')](respondWithResult(_0x2c2771,null))[_0xd13f('0x2c')](handleError(_0x2c2771,null));};
\ No newline at end of file
+var _0x71d0=['update','UserProfileResource','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','fieldName','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Pause','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','rawAttributes','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','description','isNil','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','get','role','MailAccounts','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','CmContact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','secure','auth','SendMail','sendMail','List\x20not\x20found','subject','attach','out','messageId','Interaction','Messages','verifySmtp','ValidationError','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','html-to-text','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./mailAccount.socket','register','jayson/promise','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save'];(function(_0x59dc77,_0x19d1db){var _0x3fb199=function(_0x33e12d){while(--_0x33e12d){_0x59dc77['push'](_0x59dc77['shift']());}};_0x3fb199(++_0x19d1db);}(_0x71d0,0x152));var _0x071d=function(_0xef4841,_0x51a756){_0xef4841=_0xef4841-0x0;var _0x1b37f8=_0x71d0[_0xef4841];return _0x1b37f8;};'use strict';var emlformat=require(_0x071d('0x0'));var rimraf=require(_0x071d('0x1'));var zipdir=require(_0x071d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x071d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x071d('0x4'));var path=require(_0x071d('0x5'));var sox=require(_0x071d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x071d('0x7'));var _=require(_0x071d('0x8'));var squel=require(_0x071d('0x9'));var crypto=require(_0x071d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x071d('0xb'));var toCsv=require(_0x071d('0xc'));var querystring=require(_0x071d('0xd'));var Papa=require(_0x071d('0xe'));var htmlToText=require(_0x071d('0xf'));var juice=require(_0x071d('0x10'));var Redis=require(_0x071d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x071d('0x12'));var as=require(_0x071d('0x13'));var hardwareService=require(_0x071d('0x14'));var logger=require(_0x071d('0x15'))('api');var utils=require(_0x071d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x071d('0x17'))['db'];config['redis']=_[_0x071d('0x18')](config[_0x071d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x071d('0x1a'))(new Redis(config[_0x071d('0x19')]));require(_0x071d('0x1b'))[_0x071d('0x1c')](socket);var jayson=require(_0x071d('0x1d'));var client=jayson['client'][_0x071d('0x1e')]({'port':0x232b});function respondWithRpcPromise(_0x1c454c,_0x3eb270,_0x264666,_0x2553bc){return new BPromise(function(_0x4e9070,_0x597219){var _0x473da8=_0x2553bc||client;return _0x473da8[_0x071d('0x1f')](_0x1c454c,_0x264666)[_0x071d('0x20')](function(_0x40856f){logger[_0x071d('0x21')](_0x071d('0x22'),_0x3eb270,_0x071d('0x23'));logger[_0x071d('0x24')](_0x071d('0x25'),_0x3eb270,_0x071d('0x23'),JSON[_0x071d('0x26')](_0x40856f));if(_0x40856f[_0x071d('0x27')]){if(_0x40856f[_0x071d('0x27')]['code']===0x1f4){logger[_0x071d('0x27')](_0x071d('0x22'),_0x3eb270,_0x40856f['error']['message']);return _0x597219(_0x40856f[_0x071d('0x27')][_0x071d('0x28')]);}logger['error'](_0x071d('0x22'),_0x3eb270,_0x40856f[_0x071d('0x27')][_0x071d('0x28')]);return _0x4e9070(_0x40856f[_0x071d('0x27')][_0x071d('0x28')]);}else{logger[_0x071d('0x21')]('MailAccount,\x20%s,\x20%s',_0x3eb270,'request\x20sent');_0x4e9070(_0x40856f[_0x071d('0x29')][_0x071d('0x28')]);}})[_0x071d('0x2a')](function(_0x3f6e9e){logger['error']('MailAccount,\x20%s,\x20%s',_0x3eb270,_0x3f6e9e);_0x597219(_0x3f6e9e);});});}function respondWithStatusCode(_0x2dd70d,_0x396608){_0x396608=_0x396608||0xcc;return function(_0x422df1){if(_0x422df1){return _0x2dd70d[_0x071d('0x2b')](_0x396608);}return _0x2dd70d[_0x071d('0x2c')](_0x396608)['end']();};}function respondWithResult(_0x1e2993,_0x43fe52){_0x43fe52=_0x43fe52||0xc8;return function(_0x3f60d0){if(_0x3f60d0){return _0x1e2993['status'](_0x43fe52)[_0x071d('0x2d')](_0x3f60d0);}};}function respondWithFilteredResult(_0x54eb6e,_0x117159){return function(_0x9a4202){if(_0x9a4202){var _0x176137=typeof _0x117159[_0x071d('0x2e')]===_0x071d('0x2f')&&typeof _0x117159[_0x071d('0x30')]===_0x071d('0x2f');var _0x3aac7a=_0x9a4202[_0x071d('0x31')];var _0xc12fd0=_0x176137?0x0:_0x117159[_0x071d('0x2e')];var _0x1563de=_0x176137?_0x9a4202['count']:_0x117159[_0x071d('0x2e')]+_0x117159[_0x071d('0x30')];var _0x448261;if(_0x1563de>=_0x3aac7a){_0x1563de=_0x3aac7a;_0x448261=0xc8;}else{_0x448261=0xce;}_0x54eb6e[_0x071d('0x2c')](_0x448261);return _0x54eb6e[_0x071d('0x32')](_0x071d('0x33'),_0xc12fd0+'-'+_0x1563de+'/'+_0x3aac7a)['json'](_0x9a4202);}return null;};}function patchUpdates(_0x466bdd){return function(_0x215201){try{jsonpatch[_0x071d('0x34')](_0x215201,_0x466bdd,!![]);}catch(_0x44b90c){return BPromise['reject'](_0x44b90c);}return _0x215201[_0x071d('0x35')]();};}function saveUpdates(_0x2a5f2e,_0x326753){return function(_0x51fb1b){if(_0x51fb1b){return _0x51fb1b[_0x071d('0x36')](_0x2a5f2e)[_0x071d('0x20')](function(_0x13e582){return _0x13e582;});}return null;};}function removeEntity(_0x44752d,_0x4760d9){return function(_0xbb491a){if(_0xbb491a){return _0xbb491a['destroy']()['then'](function(){var _0x4ca4e7=_0xbb491a['get']({'plain':!![]});var _0x17f894='MailAccounts';return db[_0x071d('0x37')][_0x071d('0x38')]({'where':{'type':_0x17f894,'resourceId':_0x4ca4e7['id']}})['then'](function(){return _0xbb491a;});})[_0x071d('0x20')](function(){_0x44752d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55bfcb,_0x4788bb){return function(_0x5329dc){if(!_0x5329dc){_0x55bfcb[_0x071d('0x2b')](0x194);}return _0x5329dc;};}function handleError(_0x52604a,_0xc5a55e){_0xc5a55e=_0xc5a55e||0x1f4;return function(_0x153b05){logger['error'](_0x153b05[_0x071d('0x39')]);if(_0x153b05[_0x071d('0x3a')]){delete _0x153b05[_0x071d('0x3a')];}_0x52604a[_0x071d('0x2c')](_0xc5a55e)[_0x071d('0x3b')](_0x153b05);};}exports[_0x071d('0x3c')]=function(_0x224ba0,_0x48dd9a){var _0x22c754={'include':[{'model':db[_0x071d('0x3d')],'as':_0x071d('0x3e')},{'model':db[_0x071d('0x3f')],'as':_0x071d('0x40')},{'model':db['Pause'],'as':_0x071d('0x41')}]},_0x161b8a={},_0x5c236e={'count':0x0,'rows':[]};var _0x22a38b=_[_0x071d('0x42')](db[_0x071d('0x43')]['rawAttributes'],function(_0x1afab7){return{'name':_0x1afab7[_0x071d('0x44')],'type':_0x1afab7[_0x071d('0x45')][_0x071d('0x46')]};});_0x161b8a['model']=_[_0x071d('0x42')](_0x22a38b,_0x071d('0x3a'));_0x161b8a[_0x071d('0x47')]=_[_0x071d('0x48')](_0x224ba0[_0x071d('0x47')]);_0x161b8a[_0x071d('0x49')]=_['intersection'](_0x161b8a['model'],_0x161b8a[_0x071d('0x47')]);_0x22c754[_0x071d('0x4a')]=_[_0x071d('0x4b')](_0x161b8a[_0x071d('0x4c')],qs[_0x071d('0x4d')](_0x224ba0['query'][_0x071d('0x4d')]));_0x22c754[_0x071d('0x4a')]=_0x22c754[_0x071d('0x4a')][_0x071d('0x4e')]?_0x22c754[_0x071d('0x4a')]:_0x161b8a['model'];if(!_0x224ba0[_0x071d('0x47')][_0x071d('0x4f')](_0x071d('0x50'))){_0x22c754[_0x071d('0x30')]=qs[_0x071d('0x30')](_0x224ba0[_0x071d('0x47')][_0x071d('0x30')]);_0x22c754[_0x071d('0x2e')]=qs[_0x071d('0x2e')](_0x224ba0[_0x071d('0x47')][_0x071d('0x2e')]);}_0x22c754['order']=qs['sort'](_0x224ba0[_0x071d('0x47')][_0x071d('0x51')]);_0x22c754[_0x071d('0x52')]=qs['filters'](_[_0x071d('0x53')](_0x224ba0[_0x071d('0x47')],_0x161b8a[_0x071d('0x49')]),_0x22a38b);if(_0x224ba0[_0x071d('0x47')][_0x071d('0x54')]){_0x22c754[_0x071d('0x52')]=_[_0x071d('0x55')](_0x22c754['where'],{'$or':_[_0x071d('0x42')](_0x22a38b,function(_0x2d6710){if(_0x2d6710['type']!==_0x071d('0x56')){var _0x5203a3={};_0x5203a3[_0x2d6710[_0x071d('0x3a')]]={'$like':'%'+_0x224ba0[_0x071d('0x47')]['filter']+'%'};return _0x5203a3;}})});}_0x22c754=_[_0x071d('0x55')]({},_0x22c754,_0x224ba0[_0x071d('0x57')]);var _0x2b2bc5={'where':_0x22c754[_0x071d('0x52')]};return db[_0x071d('0x43')][_0x071d('0x31')](_0x2b2bc5)['then'](function(_0x3159be){_0x5c236e[_0x071d('0x31')]=_0x3159be;if(_0x224ba0[_0x071d('0x47')][_0x071d('0x58')]){_0x22c754[_0x071d('0x59')]=[{'all':!![]}];}return db['MailAccount'][_0x071d('0x5a')](_0x22c754);})[_0x071d('0x20')](function(_0x18080f){_0x5c236e[_0x071d('0x5b')]=_0x18080f;return _0x5c236e;})[_0x071d('0x20')](respondWithFilteredResult(_0x48dd9a,_0x22c754))[_0x071d('0x2a')](handleError(_0x48dd9a,null));};exports[_0x071d('0x5c')]=function(_0x1fa141,_0x11e292){var _0x509027={'raw':![],'where':{'id':_0x1fa141[_0x071d('0x5d')]['id']},'include':[{'model':db[_0x071d('0x3d')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x071d('0x5e')],'as':_0x071d('0x41')}]},_0x2de0d2={};_0x2de0d2[_0x071d('0x4c')]=_['keys'](db[_0x071d('0x43')]['rawAttributes']);_0x2de0d2[_0x071d('0x47')]=_[_0x071d('0x48')](_0x1fa141[_0x071d('0x47')]);_0x2de0d2[_0x071d('0x49')]=_[_0x071d('0x4b')](_0x2de0d2['model'],_0x2de0d2['query']);_0x509027[_0x071d('0x4a')]=_[_0x071d('0x4b')](_0x2de0d2['model'],qs[_0x071d('0x4d')](_0x1fa141[_0x071d('0x47')][_0x071d('0x4d')]));_0x509027['attributes']=_0x509027[_0x071d('0x4a')][_0x071d('0x4e')]?_0x509027[_0x071d('0x4a')]:_0x2de0d2[_0x071d('0x4c')];if(_0x1fa141['query'][_0x071d('0x58')]){_0x509027[_0x071d('0x59')]=[{'all':!![]}];}_0x509027=_[_0x071d('0x55')]({},_0x509027,_0x1fa141['options']);return db[_0x071d('0x43')][_0x071d('0x5f')](_0x509027)['then'](handleEntityNotFound(_0x11e292,null))[_0x071d('0x20')](respondWithResult(_0x11e292,null))['catch'](handleError(_0x11e292,null));};exports[_0x071d('0x36')]=function(_0x45be8a,_0x172242){if(_0x45be8a[_0x071d('0x60')]['id']){delete _0x45be8a['body']['id'];}return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x45be8a[_0x071d('0x5d')]['id']},'include':[{'model':db[_0x071d('0x3d')],'as':'Imap'},{'model':db[_0x071d('0x3f')],'as':_0x071d('0x40')},{'model':db[_0x071d('0x5e')],'as':'mandatoryDispositionPause'}]})[_0x071d('0x20')](handleEntityNotFound(_0x172242,null))['then'](saveUpdates(_0x45be8a[_0x071d('0x60')],null))[_0x071d('0x20')](function(_0x45b40d){if(_0x45b40d&&_0x45be8a[_0x071d('0x60')][_0x071d('0x3e')]){return db[_0x071d('0x3d')][_0x071d('0x36')](_0x45be8a['body'][_0x071d('0x3e')],{'where':{'MailAccountId':_0x45b40d['id']}})[_0x071d('0x20')](function(){return _0x45b40d;});}return _0x45b40d;})[_0x071d('0x20')](function(_0x42a5d3){if(_0x42a5d3&&_0x45be8a[_0x071d('0x60')][_0x071d('0x40')]){return db[_0x071d('0x3f')][_0x071d('0x36')](_0x45be8a[_0x071d('0x60')][_0x071d('0x40')],{'where':{'MailAccountId':_0x42a5d3['id']}})['then'](function(){return _0x42a5d3;});}return _0x42a5d3;})[_0x071d('0x20')](respondWithResult(_0x172242,null))[_0x071d('0x2a')](handleError(_0x172242,null));};exports[_0x071d('0x61')]=function(_0x565350,_0x376807){return db[_0x071d('0x43')][_0x071d('0x61')]()[_0x071d('0x20')](respondWithResult(_0x376807,null))[_0x071d('0x2a')](handleError(_0x376807,null));};exports[_0x071d('0x62')]=function(_0x47a2a5,_0x53335b,_0x514d47){if(_0x47a2a5[_0x071d('0x60')]['id']){delete _0x47a2a5[_0x071d('0x60')]['id'];}return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x47a2a5[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x53335b,null))[_0x071d('0x20')](function(_0xee895a){if(_0xee895a){_0x47a2a5[_0x071d('0x60')][_0x071d('0x63')]=_0xee895a['id'];return db[_0x071d('0x64')][_0x071d('0x65')](_0x47a2a5[_0x071d('0x60')]);}})[_0x071d('0x20')](respondWithResult(_0x53335b,null))['catch'](handleError(_0x53335b,null));};exports[_0x071d('0x66')]=function(_0x198f68,_0x15b489,_0x4c2c93){var _0x4ba614={'raw':![],'where':{}};var _0xb09a53={};var _0x2cc82c={'count':0x0,'rows':[]};return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x198f68[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x15b489,null))[_0x071d('0x20')](function(_0x9350a6){if(_0x9350a6){_0xb09a53[_0x071d('0x4c')]=_[_0x071d('0x48')](db[_0x071d('0x64')][_0x071d('0x68')]);_0xb09a53['query']=_[_0x071d('0x48')](_0x198f68[_0x071d('0x47')]);_0xb09a53[_0x071d('0x49')]=_[_0x071d('0x4b')](_0xb09a53[_0x071d('0x4c')],_0xb09a53[_0x071d('0x47')]);_0x4ba614[_0x071d('0x4a')]=_['intersection'](_0xb09a53[_0x071d('0x4c')],qs[_0x071d('0x4d')](_0x198f68[_0x071d('0x47')]['fields']));_0x4ba614[_0x071d('0x4a')]=_0x4ba614['attributes'][_0x071d('0x4e')]?_0x4ba614[_0x071d('0x4a')]:_0xb09a53['model'];if(!_0x198f68[_0x071d('0x47')][_0x071d('0x4f')](_0x071d('0x50'))){_0x4ba614[_0x071d('0x30')]=qs['limit'](_0x198f68[_0x071d('0x47')][_0x071d('0x30')]);_0x4ba614['offset']=qs[_0x071d('0x2e')](_0x198f68[_0x071d('0x47')][_0x071d('0x2e')]);}_0x4ba614[_0x071d('0x69')]=qs[_0x071d('0x51')](_0x198f68[_0x071d('0x47')][_0x071d('0x51')]);_0x4ba614[_0x071d('0x52')]=qs['filters'](_['pick'](_0x198f68['query'],_0xb09a53[_0x071d('0x49')]));_0x4ba614[_0x071d('0x52')][_0x071d('0x63')]=_0x9350a6['id'];if(_0x198f68[_0x071d('0x47')][_0x071d('0x54')]){_0x4ba614[_0x071d('0x52')]=_[_0x071d('0x55')](_0x4ba614[_0x071d('0x52')],{'$or':_[_0x071d('0x42')](_0x4ba614['attributes'],function(_0x2d8be0){var _0x199750={};_0x199750[_0x2d8be0]={'$like':'%'+_0x198f68['query'][_0x071d('0x54')]+'%'};return _0x199750;})});}_0x4ba614=_[_0x071d('0x55')]({},_0x4ba614,_0x198f68[_0x071d('0x57')]);return db[_0x071d('0x64')]['count']({'where':_0x4ba614[_0x071d('0x52')]})['then'](function(_0x42236e){_0x2cc82c[_0x071d('0x31')]=_0x42236e;if(_0x198f68['query'][_0x071d('0x58')]){_0x4ba614[_0x071d('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x071d('0x5a')](_0x4ba614);})['then'](function(_0x58d064){_0x2cc82c[_0x071d('0x5b')]=_0x58d064;return _0x2cc82c;});}})[_0x071d('0x20')](respondWithFilteredResult(_0x15b489,_0x4ba614))['catch'](handleError(_0x15b489,null));};exports['removeDispositions']=function(_0x4feb03,_0x3fc37a,_0xafc6c0){return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x4feb03[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x3fc37a,null))[_0x071d('0x20')](function(_0x4ac880){if(_0x4ac880){return _0x4ac880[_0x071d('0x6a')](_0x4feb03[_0x071d('0x47')][_0x071d('0x6b')]);}})[_0x071d('0x20')](respondWithStatusCode(_0x3fc37a,null))[_0x071d('0x2a')](handleError(_0x3fc37a,null));};exports[_0x071d('0x6c')]=function(_0x4ed6af,_0x544228,_0x3a2ac0){if(_0x4ed6af[_0x071d('0x60')]['id']){delete _0x4ed6af[_0x071d('0x60')]['id'];}return db[_0x071d('0x43')]['find']({'where':{'id':_0x4ed6af[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x544228,null))[_0x071d('0x20')](function(_0x24285b){if(_0x24285b){_0x4ed6af[_0x071d('0x60')]['MailAccountId']=_0x24285b['id'];return db[_0x071d('0x6d')][_0x071d('0x65')](_0x4ed6af[_0x071d('0x60')]);}})[_0x071d('0x20')](respondWithResult(_0x544228,null))[_0x071d('0x2a')](handleError(_0x544228,null));};exports[_0x071d('0x6e')]=function(_0x2acd7f,_0x11154b,_0x444cec){var _0x291780={'raw':![],'where':{}};var _0x5792b7={};var _0x3d856d={'count':0x0,'rows':[]};return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x2acd7f[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x11154b,null))[_0x071d('0x20')](function(_0xce0cc6){if(_0xce0cc6){_0x5792b7[_0x071d('0x4c')]=_[_0x071d('0x48')](db[_0x071d('0x6d')][_0x071d('0x68')]);_0x5792b7[_0x071d('0x47')]=_[_0x071d('0x48')](_0x2acd7f['query']);_0x5792b7[_0x071d('0x49')]=_[_0x071d('0x4b')](_0x5792b7[_0x071d('0x4c')],_0x5792b7[_0x071d('0x47')]);_0x291780['attributes']=_[_0x071d('0x4b')](_0x5792b7['model'],qs['fields'](_0x2acd7f[_0x071d('0x47')][_0x071d('0x4d')]));_0x291780[_0x071d('0x4a')]=_0x291780[_0x071d('0x4a')][_0x071d('0x4e')]?_0x291780[_0x071d('0x4a')]:_0x5792b7[_0x071d('0x4c')];if(!_0x2acd7f['query'][_0x071d('0x4f')]('nolimit')){_0x291780[_0x071d('0x30')]=qs[_0x071d('0x30')](_0x2acd7f[_0x071d('0x47')][_0x071d('0x30')]);_0x291780['offset']=qs[_0x071d('0x2e')](_0x2acd7f['query'][_0x071d('0x2e')]);}_0x291780[_0x071d('0x69')]=qs['sort'](_0x2acd7f[_0x071d('0x47')][_0x071d('0x51')]);_0x291780[_0x071d('0x52')]=qs[_0x071d('0x49')](_['pick'](_0x2acd7f[_0x071d('0x47')],_0x5792b7['filters']));_0x291780[_0x071d('0x52')][_0x071d('0x63')]=_0xce0cc6['id'];if(_0x2acd7f['query'][_0x071d('0x54')]){_0x291780[_0x071d('0x52')]=_[_0x071d('0x55')](_0x291780[_0x071d('0x52')],{'$or':_[_0x071d('0x42')](_0x291780['attributes'],function(_0x4e8083){var _0x3c2d05={};_0x3c2d05[_0x4e8083]={'$like':'%'+_0x2acd7f[_0x071d('0x47')][_0x071d('0x54')]+'%'};return _0x3c2d05;})});}_0x291780=_[_0x071d('0x55')]({},_0x291780,_0x2acd7f[_0x071d('0x57')]);return db[_0x071d('0x6d')]['count']({'where':_0x291780[_0x071d('0x52')]})['then'](function(_0x4c9a54){_0x3d856d[_0x071d('0x31')]=_0x4c9a54;if(_0x2acd7f[_0x071d('0x47')][_0x071d('0x58')]){_0x291780['include']=[{'all':!![]}];}return db[_0x071d('0x6d')][_0x071d('0x5a')](_0x291780);})[_0x071d('0x20')](function(_0x3887a4){_0x3d856d[_0x071d('0x5b')]=_0x3887a4;return _0x3d856d;});}})[_0x071d('0x20')](respondWithFilteredResult(_0x11154b,_0x291780))['catch'](handleError(_0x11154b,null));};exports['removeAnswers']=function(_0x5e07cd,_0x132db2,_0x54f346){return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x5e07cd['params']['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x132db2,null))[_0x071d('0x20')](function(_0xc37142){if(_0xc37142){return _0xc37142[_0x071d('0x6f')](_0x5e07cd[_0x071d('0x47')][_0x071d('0x6b')]);}})[_0x071d('0x20')](respondWithStatusCode(_0x132db2,null))[_0x071d('0x2a')](handleError(_0x132db2,null));};exports[_0x071d('0x65')]=function(_0x31fcf8,_0x6655bd){var _0x273c29={'name':_0x31fcf8['body']['name'],'key':_0x31fcf8[_0x071d('0x60')]['key'],'email':_0x31fcf8[_0x071d('0x60')][_0x071d('0x70')],'ListId':_0x31fcf8[_0x071d('0x60')][_0x071d('0x71')],'active':!_['isNil'](_0x31fcf8[_0x071d('0x60')][_0x071d('0x72')])?_0x31fcf8[_0x071d('0x60')][_0x071d('0x72')]:!![],'description':_0x31fcf8[_0x071d('0x60')][_0x071d('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0x071d('0x74')](_0x31fcf8[_0x071d('0x60')][_0x071d('0x75')])){if(_0x31fcf8[_0x071d('0x60')][_0x071d('0x76')]){_0x273c29['Imap'][_0x071d('0x77')]=_0x273c29[_0x071d('0x40')]['user']=_0x31fcf8[_0x071d('0x60')][_0x071d('0x78')];_0x273c29[_0x071d('0x3e')][_0x071d('0x79')]=_0x273c29[_0x071d('0x40')][_0x071d('0x7a')]=_0x31fcf8['body'][_0x071d('0x7b')];}else{_0x273c29[_0x071d('0x3e')][_0x071d('0x7c')]=_0x273c29['Smtp'][_0x071d('0x7c')]=![];}_0x273c29[_0x071d('0x3e')][_0x071d('0x7d')]=_0x31fcf8[_0x071d('0x60')][_0x071d('0x3e')]['host'];_0x273c29['Imap'][_0x071d('0x7e')]=_0x31fcf8[_0x071d('0x60')]['Imap'][_0x071d('0x7e')];_0x273c29['Smtp'][_0x071d('0x7d')]=_0x31fcf8[_0x071d('0x60')][_0x071d('0x40')][_0x071d('0x7d')];_0x273c29[_0x071d('0x40')][_0x071d('0x7e')]=_0x31fcf8[_0x071d('0x60')][_0x071d('0x40')][_0x071d('0x7e')];}else{_0x273c29['Imap'][_0x071d('0x7f')]=_0x273c29[_0x071d('0x40')]['service']=_0x31fcf8['body'][_0x071d('0x75')];_0x273c29['Imap']['user']=_0x273c29[_0x071d('0x40')][_0x071d('0x77')]=_0x31fcf8[_0x071d('0x60')][_0x071d('0x78')];_0x273c29[_0x071d('0x3e')][_0x071d('0x79')]=_0x273c29[_0x071d('0x40')]['pass']=_0x31fcf8['body'][_0x071d('0x7b')];}return db[_0x071d('0x43')][_0x071d('0x65')](_0x273c29,{'include':[{'model':db[_0x071d('0x3f')],'as':_0x071d('0x40')},{'model':db[_0x071d('0x3d')],'as':_0x071d('0x3e')}]})['then'](function(_0xa5144){var _0x5a8bf5=_0x31fcf8[_0x071d('0x77')][_0x071d('0x80')]({'plain':!![]});if(!_0x5a8bf5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a8bf5[_0x071d('0x81')]===_0x071d('0x77')){var _0xf07221=_0xa5144[_0x071d('0x80')]({'plain':!![]});return db['UserProfileSection'][_0x071d('0x5f')]({'where':{'name':_0x071d('0x82'),'userProfileId':_0x5a8bf5['userProfileId']},'raw':!![]})[_0x071d('0x20')](function(_0x32d600){if(_0x32d600&&_0x32d600['autoAssociation']===0x0){return db[_0x071d('0x37')][_0x071d('0x65')]({'name':_0xf07221['name'],'resourceId':_0xf07221['id'],'type':_0x32d600[_0x071d('0x3a')],'sectionId':_0x32d600['id']},{})[_0x071d('0x20')](function(){return _0xa5144;});}else{return _0xa5144;}})[_0x071d('0x2a')](function(_0x46ec5a){logger[_0x071d('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46ec5a);throw _0x46ec5a;});}return _0xa5144;})[_0x071d('0x20')](respondWithResult(_0x6655bd,0xc9))[_0x071d('0x2a')](handleError(_0x6655bd,null));};exports[_0x071d('0x83')]=function(_0x1afb88,_0x27fcc8,_0x3cac71){return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x1afb88[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x27fcc8,null))[_0x071d('0x20')](function(_0x13ceea){if(_0x13ceea){return _0x13ceea['getImap']();}return null;})[_0x071d('0x20')](respondWithResult(_0x27fcc8,null))['catch'](handleError(_0x27fcc8,null));};exports['addImap']=function(_0xc3a2de,_0xc2eee,_0x21283d){if(_0xc3a2de[_0x071d('0x60')]['id']){delete _0xc3a2de['body']['id'];}return db[_0x071d('0x43')]['find']({'where':{'id':_0xc3a2de[_0x071d('0x5d')]['id']}})['then'](handleEntityNotFound(_0xc2eee,null))[_0x071d('0x20')](function(_0xaaf731){if(_0xaaf731){_0xc3a2de[_0x071d('0x60')][_0x071d('0x63')]=_0xaaf731['id'];return db['MailServerIn'][_0x071d('0x65')](_0xc3a2de[_0x071d('0x60')]);}})[_0x071d('0x20')](respondWithResult(_0xc2eee,null))[_0x071d('0x2a')](handleError(_0xc2eee,null));};exports[_0x071d('0x84')]=function(_0xe13132,_0xf085d8,_0xe9b007){return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0xe13132[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0xf085d8,null))['then'](function(_0xa60300){if(_0xa60300){return _0xa60300[_0x071d('0x85')](null);}return null;})['then'](respondWithStatusCode(_0xf085d8,null))[_0x071d('0x2a')](handleError(_0xf085d8,null));};exports[_0x071d('0x86')]=function(_0x5d5b48,_0x2ee9fa,_0x2c8937){return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x5d5b48[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x2ee9fa,null))['then'](function(_0x3def83){if(_0x3def83){return _0x3def83[_0x071d('0x86')]();}return null;})['then'](respondWithResult(_0x2ee9fa,null))[_0x071d('0x2a')](handleError(_0x2ee9fa,null));};exports[_0x071d('0x87')]=function(_0x151c32,_0xebf02f,_0xedc32c){if(_0x151c32[_0x071d('0x60')]['id']){delete _0x151c32[_0x071d('0x60')]['id'];}return db['MailAccount'][_0x071d('0x5f')]({'where':{'id':_0x151c32['params']['id']}})['then'](handleEntityNotFound(_0xebf02f,null))[_0x071d('0x20')](function(_0x23863b){if(_0x23863b){_0x151c32[_0x071d('0x60')][_0x071d('0x63')]=_0x23863b['id'];return db[_0x071d('0x3f')][_0x071d('0x65')](_0x151c32[_0x071d('0x60')]);}})[_0x071d('0x20')](respondWithResult(_0xebf02f,null))['catch'](handleError(_0xebf02f,null));};exports[_0x071d('0x88')]=function(_0xddc18d,_0x5e78d9,_0x1d4435){return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0xddc18d['params']['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x5e78d9,null))[_0x071d('0x20')](function(_0x1563c8){if(_0x1563c8){return _0x1563c8[_0x071d('0x89')](null);}return null;})[_0x071d('0x20')](respondWithStatusCode(_0x5e78d9,null))[_0x071d('0x2a')](handleError(_0x5e78d9,null));};exports['addInteraction']=function(_0x342edf,_0x4db4b7,_0xebd1d9){return db[_0x071d('0x8a')][_0x071d('0x5f')]({'where':{'id':_0x342edf['params']['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x4db4b7,null))['then'](function(_0x90cdd2){if(_0x90cdd2){return _0x90cdd2[_0x071d('0x8b')](_0x342edf[_0x071d('0x60')]['ids'],_[_0x071d('0x8c')](_0x342edf[_0x071d('0x60')],[_0x071d('0x6b'),'id'])||{});}})[_0x071d('0x20')](respondWithResult(_0x4db4b7,null))[_0x071d('0x2a')](handleError(_0x4db4b7,null));};exports['getInteractions']=function(_0x3f885a,_0x196185,_0x1688cd){var _0x4dac0f={'raw':![],'where':{}};var _0x248bff={};var _0x3e9013={'count':0x0,'rows':[]};return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x3f885a[_0x071d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x196185,null))[_0x071d('0x20')](function(_0x43342f){if(_0x43342f){_0x248bff['model']=_[_0x071d('0x48')](db[_0x071d('0x8a')][_0x071d('0x68')]);_0x248bff[_0x071d('0x47')]=_[_0x071d('0x48')](_0x3f885a['query']);_0x248bff[_0x071d('0x49')]=_[_0x071d('0x4b')](_0x248bff['model'],_0x248bff[_0x071d('0x47')]);_0x4dac0f[_0x071d('0x4a')]=_['intersection'](_0x248bff[_0x071d('0x4c')],qs['fields'](_0x3f885a[_0x071d('0x47')][_0x071d('0x4d')]));_0x4dac0f['attributes']=_0x4dac0f[_0x071d('0x4a')][_0x071d('0x4e')]?_0x4dac0f[_0x071d('0x4a')]:_0x248bff[_0x071d('0x4c')];if(!_0x3f885a[_0x071d('0x47')]['hasOwnProperty'](_0x071d('0x50'))){_0x4dac0f[_0x071d('0x30')]=qs['limit'](_0x3f885a['query'][_0x071d('0x30')]);_0x4dac0f[_0x071d('0x2e')]=qs['offset'](_0x3f885a[_0x071d('0x47')][_0x071d('0x2e')]);}_0x4dac0f[_0x071d('0x69')]=qs[_0x071d('0x51')](_0x3f885a[_0x071d('0x47')][_0x071d('0x51')]);_0x4dac0f[_0x071d('0x52')]=qs['filters'](_[_0x071d('0x53')](_0x3f885a[_0x071d('0x47')],_0x248bff[_0x071d('0x49')]));_0x4dac0f[_0x071d('0x52')]['MailAccountId']=_0x43342f['id'];if(_0x3f885a[_0x071d('0x47')][_0x071d('0x54')]){_0x4dac0f['where']=_[_0x071d('0x55')](_0x4dac0f[_0x071d('0x52')],{'$or':_[_0x071d('0x42')](_0x4dac0f['attributes'],function(_0x33b899){var _0x2f1046={};_0x2f1046[_0x33b899]={'$like':'%'+_0x3f885a[_0x071d('0x47')]['filter']+'%'};return _0x2f1046;})});}_0x4dac0f=_[_0x071d('0x55')]({},_0x4dac0f,_0x3f885a[_0x071d('0x57')]);return db['MailInteraction'][_0x071d('0x31')]({'where':_0x4dac0f[_0x071d('0x52')]})['then'](function(_0x24828a){_0x3e9013['count']=_0x24828a;if(_0x3f885a[_0x071d('0x47')][_0x071d('0x58')]){_0x4dac0f[_0x071d('0x59')]=[{'model':db[_0x071d('0x8d')],'as':'Contact','required':![]},{'model':db[_0x071d('0x8e')],'as':_0x071d('0x8f'),'attributes':[_0x071d('0x3a'),_0x071d('0x90'),_0x071d('0x91')],'required':![]},{'model':db[_0x071d('0x92')],'as':_0x071d('0x93'),'attributes':['id','name',_0x071d('0x94')],'where':_0x3f885a['query'][_0x071d('0x95')]?{'id':_0x3f885a[_0x071d('0x47')][_0x071d('0x95')]}:undefined,'required':_0x3f885a[_0x071d('0x47')][_0x071d('0x95')]?!![]:![]}];}return db[_0x071d('0x8a')][_0x071d('0x5a')](_0x4dac0f);})[_0x071d('0x20')](function(_0x406c7e){_0x3e9013[_0x071d('0x5b')]=_0x406c7e;return _0x3e9013;});}})[_0x071d('0x20')](respondWithFilteredResult(_0x196185,_0x4dac0f))[_0x071d('0x2a')](handleError(_0x196185,null));};exports[_0x071d('0x96')]=function(_0x49fd1d,_0x2d3e63,_0x40fd21){return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x49fd1d['params']['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x2d3e63,null))[_0x071d('0x20')](function(_0x42debf){if(_0x42debf){return db[_0x071d('0x97')][_0x071d('0x98')](function(_0x91cba4){return db[_0x071d('0x99')][_0x071d('0x38')]({'where':{'MailAccountId':_0x49fd1d[_0x071d('0x5d')]['id']},'transaction':_0x91cba4})[_0x071d('0x20')](function(_0x3cdd23){var _0x40092d=_['map'](_0x49fd1d[_0x071d('0x60')],function(_0x1b6963){_0x1b6963[_0x071d('0x63')]=_0x49fd1d[_0x071d('0x5d')]['id'];return _0x1b6963;});return db[_0x071d('0x99')][_0x071d('0x9a')](_0x40092d,{'transaction':_0x91cba4});});})[_0x071d('0x20')](function(){return db[_0x071d('0x99')][_0x071d('0x9b')]({'where':{'MailAccountId':_0x49fd1d[_0x071d('0x5d')]['id']},'order':_0x071d('0x9c')});});}})[_0x071d('0x20')](respondWithResult(_0x2d3e63,null))[_0x071d('0x2a')](handleError(_0x2d3e63,null));};exports[_0x071d('0x9d')]=function(_0x37da3e,_0x34f321,_0x11b8c9){var _0x1945e4={};var _0x213dd9={};var _0x14a0da;var _0x2b93c0;return db[_0x071d('0x43')][_0x071d('0x67')]({'where':{'id':_0x37da3e[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x34f321,null))['then'](function(_0x1be6b5){if(_0x1be6b5){_0x14a0da=_0x1be6b5;_0x213dd9[_0x071d('0x4c')]=_[_0x071d('0x48')](db[_0x071d('0x99')][_0x071d('0x68')]);_0x213dd9[_0x071d('0x47')]=_[_0x071d('0x48')](_0x37da3e[_0x071d('0x47')]);_0x213dd9['filters']=_[_0x071d('0x4b')](_0x213dd9[_0x071d('0x4c')],_0x213dd9[_0x071d('0x47')]);_0x1945e4[_0x071d('0x4a')]=_['intersection'](_0x213dd9[_0x071d('0x4c')],qs['fields'](_0x37da3e[_0x071d('0x47')][_0x071d('0x4d')]));_0x1945e4['attributes']=_0x1945e4[_0x071d('0x4a')]['length']?_0x1945e4[_0x071d('0x4a')]:_0x213dd9['model'];_0x1945e4[_0x071d('0x69')]=qs[_0x071d('0x51')](_0x37da3e['query'][_0x071d('0x51')]);_0x1945e4[_0x071d('0x52')]=qs['filters'](_[_0x071d('0x53')](_0x37da3e[_0x071d('0x47')],_0x213dd9[_0x071d('0x49')]));if(_0x37da3e[_0x071d('0x47')][_0x071d('0x54')]){_0x1945e4[_0x071d('0x52')]=_['merge'](_0x1945e4[_0x071d('0x52')],{'$or':_['map'](_0x1945e4['attributes'],function(_0x36da64){var _0x926321={};_0x926321[_0x36da64]={'$like':'%'+_0x37da3e[_0x071d('0x47')]['filter']+'%'};return _0x926321;})});}_0x1945e4=_[_0x071d('0x55')]({},_0x1945e4,_0x37da3e[_0x071d('0x57')]);return _0x14a0da['getApplications'](_0x1945e4);}})[_0x071d('0x20')](function(_0x36c930){if(_0x36c930){_0x2b93c0=_0x36c930[_0x071d('0x4e')];if(!_0x37da3e[_0x071d('0x47')]['hasOwnProperty'](_0x071d('0x50'))){_0x1945e4[_0x071d('0x30')]=qs[_0x071d('0x30')](_0x37da3e[_0x071d('0x47')][_0x071d('0x30')]);_0x1945e4[_0x071d('0x2e')]=qs[_0x071d('0x2e')](_0x37da3e[_0x071d('0x47')][_0x071d('0x2e')]);}return _0x14a0da[_0x071d('0x9d')](_0x1945e4);}})[_0x071d('0x20')](function(_0x4b7500){if(_0x4b7500){return _0x4b7500?{'count':_0x2b93c0,'rows':_0x4b7500}:null;}})[_0x071d('0x20')](respondWithResult(_0x34f321,null))[_0x071d('0x2a')](handleError(_0x34f321,null));};exports['getMessages']=function(_0x50054b,_0x475a98,_0x42e08d){var _0x380db5={'raw':!![],'where':{}};var _0x263389={};var _0x385310={'count':0x0,'rows':[]};return db['MailAccount'][_0x071d('0x67')]({'where':{'id':_0x50054b[_0x071d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x475a98,null))[_0x071d('0x20')](function(_0x55109a){if(_0x55109a){_0x263389[_0x071d('0x4c')]=_[_0x071d('0x48')](db[_0x071d('0x9e')][_0x071d('0x68')]);_0x263389[_0x071d('0x47')]=_[_0x071d('0x48')](_0x50054b[_0x071d('0x47')]);_0x263389['filters']=_['intersection'](_0x263389[_0x071d('0x4c')],_0x263389[_0x071d('0x47')]);_0x380db5[_0x071d('0x4a')]=_[_0x071d('0x4b')](_0x263389['model'],qs['fields'](_0x50054b[_0x071d('0x47')][_0x071d('0x4d')]));_0x380db5['attributes']=_0x380db5[_0x071d('0x4a')][_0x071d('0x4e')]?_0x380db5[_0x071d('0x4a')]:_0x263389[_0x071d('0x4c')];if(!_0x50054b['query'][_0x071d('0x4f')]('nolimit')){_0x380db5[_0x071d('0x30')]=qs[_0x071d('0x30')](_0x50054b[_0x071d('0x47')][_0x071d('0x30')]);_0x380db5[_0x071d('0x2e')]=qs[_0x071d('0x2e')](_0x50054b['query']['offset']);}_0x380db5['order']=qs['sort'](_0x50054b['query']['sort']);_0x380db5[_0x071d('0x52')]=qs['filters'](_[_0x071d('0x53')](_0x50054b['query'],_0x263389[_0x071d('0x49')]));_0x380db5[_0x071d('0x52')][_0x071d('0x63')]=_0x55109a['id'];if(_0x50054b['query'][_0x071d('0x54')]){_0x380db5[_0x071d('0x52')]=_[_0x071d('0x55')](_0x380db5[_0x071d('0x52')],{'$or':_[_0x071d('0x42')](_0x380db5[_0x071d('0x4a')],function(_0x127050){var _0x5cd5a8={};_0x5cd5a8[_0x127050]={'$like':'%'+_0x50054b[_0x071d('0x47')][_0x071d('0x54')]+'%'};return _0x5cd5a8;})});}if(_0x50054b[_0x071d('0x47')][_0x071d('0x9f')]){var _0x3433a4=_0x50054b[_0x071d('0x47')]['$gte'][_0x071d('0xa0')](',');var _0x206fb1={};_0x206fb1[_0x3433a4[0x0]]={'$gte':moment(_0x3433a4[0x1])[_0x071d('0xa1')](_0x071d('0xa2'))};_0x380db5['where']=_[_0x071d('0x55')](_0x380db5['where'],_0x206fb1);}_0x380db5=_['merge']({},_0x380db5,_0x50054b[_0x071d('0x57')]);return db[_0x071d('0x9e')][_0x071d('0x31')]({'where':_0x380db5[_0x071d('0x52')]})[_0x071d('0x20')](function(_0xdb8a4f){_0x385310[_0x071d('0x31')]=_0xdb8a4f;if(_0x50054b[_0x071d('0x47')][_0x071d('0x58')]){_0x380db5[_0x071d('0x59')]=[{'all':!![]}];}return db['MailMessage'][_0x071d('0x5a')](_0x380db5);})[_0x071d('0x20')](function(_0x5b5300){if(_0x50054b['query'][_0x071d('0xa3')]===_0x071d('0xa4')){for(var _0x53cdfa=0x0;_0x53cdfa<_0x5b5300[_0x071d('0x4e')];_0x53cdfa++){_0x5b5300[_0x53cdfa][_0x071d('0x60')]=juice(_0x5b5300[_0x53cdfa][_0x071d('0x60')]);}}_0x385310[_0x071d('0x5b')]=_0x5b5300;return _0x385310;});}})['then'](respondWithFilteredResult(_0x475a98,_0x380db5))['catch'](handleError(_0x475a98,null));};exports[_0x071d('0x3b')]=function(_0x32e4ad,_0x431a9a,_0x496513){var _0x1e67b3,_0x2d140a={},_0x301f83;if(_0x32e4ad[_0x071d('0x60')]['to']){_0x301f83=_0x32e4ad[_0x071d('0x60')]['to']['split'](',')[0x0];}return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x32e4ad[_0x071d('0x5d')]['id']},'include':[{'model':db[_0x071d('0xa5')],'as':_0x071d('0xa6'),'include':[{'model':db[_0x071d('0x8d')],'as':_0x071d('0xa7'),'where':{'email':_0x301f83},'limit':0x1,'order':[[_0x071d('0xa8'),_0x071d('0xa9')]]}]},{'model':db['MailServerOut'],'as':_0x071d('0x40'),'raw':!![]}]})['then'](handleEntityNotFound(_0x431a9a,null))[_0x071d('0x20')](function(_0x419181){if(_0x419181){_0x1e67b3=_0x419181;if(_0x419181[_0x071d('0x40')]){if(_[_0x071d('0x74')](_0x32e4ad['body'][_0x071d('0xaa')])){_0x32e4ad[_0x071d('0x60')]['from']=util[_0x071d('0xa1')](_0x071d('0xab'),_0x419181['name'],_0x419181['email']||_0x419181['Smtp'][_0x071d('0x77')]);}if(_0x32e4ad['body'][_0x071d('0xac')]&&_0x32e4ad['body'][_0x071d('0xac')]['length']){for(var _0x36bb1b=0x0;_0x36bb1b<_0x32e4ad[_0x071d('0x60')][_0x071d('0xac')][_0x071d('0x4e')];_0x36bb1b+=0x1){_0x32e4ad[_0x071d('0x60')][_0x071d('0xac')][_0x36bb1b]={'filename':_0x32e4ad[_0x071d('0x60')]['attachments'][_0x36bb1b][_0x071d('0x3a')],'path':path[_0x071d('0xad')](config['root'],_0x071d('0xae'),_0x32e4ad[_0x071d('0x60')][_0x071d('0xac')][_0x36bb1b]['basename'])};}}var _0x16b291={'tls':{'rejectUnauthorized':![]}};if(_[_0x071d('0x74')](_0x419181['Smtp'][_0x071d('0x7f')])){if(_0x419181[_0x071d('0x40')][_0x071d('0x7c')]){_0x16b291['auth']={'user':_0x419181['Smtp'][_0x071d('0x77')],'pass':_0x419181[_0x071d('0x40')]['pass']};}_0x16b291[_0x071d('0x7d')]=_0x419181[_0x071d('0x40')][_0x071d('0x7d')];_0x16b291['port']=_0x419181[_0x071d('0x40')][_0x071d('0x7e')];_0x16b291[_0x071d('0xaf')]=_0x419181['Smtp']['secure'];}else{_0x16b291[_0x071d('0x7f')]=_0x419181[_0x071d('0x40')][_0x071d('0x7f')];_0x16b291[_0x071d('0xb0')]={'user':_0x419181[_0x071d('0x40')][_0x071d('0x77')],'pass':_0x419181['Smtp'][_0x071d('0x7a')]};}return respondWithRpcPromise(_0x071d('0xb1'),_0x071d('0xb2'),{'account':_0x16b291,'message':_0x32e4ad[_0x071d('0x60')]});}else{throw new Error('List\x20not\x20found');}}})[_0x071d('0x20')](function(_0x21cd3e){if(_0x21cd3e){_0x2d140a=_0x21cd3e;if(_0x1e67b3[_0x071d('0xa6')]){if(_0x1e67b3[_0x071d('0xa6')]['Contacts'][_0x071d('0x4e')]){return _0x1e67b3[_0x071d('0xa6')][_0x071d('0xa7')][0x0];}else{return db[_0x071d('0x8d')]['create'](_[_0x071d('0x18')](_0x32e4ad['body'],{'firstName':_0x32e4ad[_0x071d('0x60')]['to'],'email':_0x32e4ad[_0x071d('0x60')]['to'],'phone':_0x32e4ad[_0x071d('0x60')]['to'],'ListId':_0x1e67b3[_0x071d('0x71')]}));}}else{throw new Error(_0x071d('0xb3'));}}})[_0x071d('0x20')](function(_0x163b8f){if(_0x163b8f){var _0x2403d0={'UserId':_0x32e4ad[_0x071d('0x77')]['id'],'ContactId':_0x163b8f['id'],'MailAccountId':_0x1e67b3['id'],'inReplyTo':_0x2d140a['messageId'],'to':_0x32e4ad[_0x071d('0x60')]['from'],'cc':_0x32e4ad[_0x071d('0x60')]['cc'],'subject':_0x32e4ad[_0x071d('0x60')][_0x071d('0xb4')],'attach':_0x32e4ad[_0x071d('0x60')][_0x071d('0xb5')],'firstMsgDirection':_0x071d('0xb6'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x071d('0xb6'),'Messages':[_[_0x071d('0x55')](_0x32e4ad[_0x071d('0x60')],{'messageId':_0x2d140a[_0x071d('0xb7')],'sentAt':moment()[_0x071d('0xa1')](_0x071d('0xa2')),'read':!![],'MailAccountId':_0x1e67b3['id'],'UserId':_0x32e4ad[_0x071d('0x77')]['id'],'ContactId':_0x163b8f['id']})]};if(_0x32e4ad[_0x071d('0x60')][_0x071d('0xb8')]){_0x2403d0=_[_0x071d('0x55')](_0x2403d0,_0x32e4ad[_0x071d('0x60')]['Interaction']);}return db['MailInteraction'][_0x071d('0x65')](_0x2403d0,{'include':[{'model':db['MailMessage'],'as':_0x071d('0xb9')}]});}})['then'](respondWithResult(_0x431a9a,null))[_0x071d('0x2a')](handleError(_0x431a9a,null));};exports[_0x071d('0xba')]=function(_0x5cdf39,_0x18842c,_0x5ff9ea){return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x5cdf39[_0x071d('0x5d')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x071d('0x40'),'raw':!![]}]})[_0x071d('0x20')](handleEntityNotFound(_0x18842c,null))[_0x071d('0x20')](function(_0x298a33){if(_0x298a33&&_0x298a33[_0x071d('0x40')]){var _0x2db17f={'id':_0x298a33['id'],'tls':{'rejectUnauthorized':![]}};if(_0x298a33['Smtp'][_0x071d('0x7f')]){_0x2db17f[_0x071d('0x7f')]=_0x298a33[_0x071d('0x40')][_0x071d('0x7f')];}else{_0x2db17f[_0x071d('0x7d')]=_0x298a33[_0x071d('0x40')][_0x071d('0x7d')];_0x2db17f[_0x071d('0x7e')]=_0x298a33[_0x071d('0x40')][_0x071d('0x7e')];_0x2db17f['secure']=_0x298a33['Smtp'][_0x071d('0xaf')];}if(_0x298a33[_0x071d('0x40')][_0x071d('0x7c')]){_0x2db17f['auth']={'user':_0x298a33[_0x071d('0x40')][_0x071d('0x77')],'pass':_0x298a33[_0x071d('0x40')]['pass']};}return respondWithRpcPromise('VerifySmtp',_0x071d('0xba'),{'account':_0x2db17f});}})[_0x071d('0x20')](respondWithResult(_0x18842c,null))[_0x071d('0x2a')](handleError(_0x18842c,null));};exports[_0x071d('0x38')]=function(_0x47d214,_0x4bac0f){return db[_0x071d('0x43')]['find']({'where':{'id':_0x47d214[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x4bac0f,null))[_0x071d('0x20')](function(_0x2a86ab){if(_0x2a86ab&&_0x2a86ab[_0x071d('0x7f')]){throw new db['Sequelize'][(_0x071d('0xbb'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x2a86ab;})[_0x071d('0x20')](removeEntity(_0x4bac0f,null))[_0x071d('0x2a')](handleError(_0x4bac0f,null));};exports[_0x071d('0xbc')]=function(_0x43efc6,_0x1334d5,_0x5f5267){return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x43efc6[_0x071d('0x5d')]['id']}})['then'](handleEntityNotFound(_0x1334d5,null))[_0x071d('0x20')](function(_0x47e01d){if(_0x47e01d){return _0x47e01d[_0x071d('0xbc')](_0x43efc6['body'][_0x071d('0x6b')],_[_0x071d('0x8c')](_0x43efc6[_0x071d('0x60')],['ids','id'])||{})[_0x071d('0xbd')](function(_0x97401c){for(var _0x50955d=0x0;_0x50955d<_0x43efc6[_0x071d('0x60')][_0x071d('0x6b')][_0x071d('0x4e')];_0x50955d+=0x1){socket['emit'](_0x071d('0xbe'),{'UserId':Number(_0x43efc6[_0x071d('0x60')][_0x071d('0x6b')][_0x50955d]),'MailAccountId':Number(_0x43efc6[_0x071d('0x5d')]['id'])});}return _0x97401c;});}})[_0x071d('0x20')](respondWithResult(_0x1334d5,null))[_0x071d('0x2a')](handleError(_0x1334d5,null));};exports['removeAgents']=function(_0x4ba40b,_0x19eb32,_0x78e36c){return db[_0x071d('0x43')][_0x071d('0x5f')]({'where':{'id':_0x4ba40b['params']['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x19eb32,null))['then'](function(_0x1b0670){if(_0x1b0670){return _0x1b0670[_0x071d('0xbf')](_0x4ba40b['query'][_0x071d('0x6b')])[_0x071d('0x20')](function(){if(_[_0x071d('0xc0')](_0x4ba40b[_0x071d('0x47')][_0x071d('0x6b')])){for(var _0x48dda0=0x0;_0x48dda0<_0x4ba40b['query'][_0x071d('0x6b')][_0x071d('0x4e')];_0x48dda0+=0x1){socket[_0x071d('0xc1')](_0x071d('0xc2'),{'UserId':Number(_0x4ba40b['query'][_0x071d('0x6b')][_0x48dda0]),'MailAccountId':Number(_0x4ba40b[_0x071d('0x5d')]['id'])});}}else{socket[_0x071d('0xc1')](_0x071d('0xc2'),{'UserId':Number(_0x4ba40b[_0x071d('0x47')]['ids']),'MailAccountId':Number(_0x4ba40b[_0x071d('0x5d')]['id'])});}});}})[_0x071d('0x20')](respondWithStatusCode(_0x19eb32,null))[_0x071d('0x2a')](handleError(_0x19eb32,null));};exports[_0x071d('0xc3')]=function(_0x1041c0,_0x2857a1,_0x1b26c1){var _0x59e051={};var _0x5798fe={};var _0x2116a3;var _0x5605ca;return db[_0x071d('0x43')]['findOne']({'where':{'id':_0x1041c0[_0x071d('0x5d')]['id']}})[_0x071d('0x20')](handleEntityNotFound(_0x2857a1,null))[_0x071d('0x20')](function(_0x2e3d4f){if(_0x2e3d4f){_0x2116a3=_0x2e3d4f;_0x5798fe['model']=_['keys'](db[_0x071d('0x8e')][_0x071d('0x68')]);_0x5798fe[_0x071d('0x47')]=_[_0x071d('0x48')](_0x1041c0[_0x071d('0x47')]);_0x5798fe[_0x071d('0x49')]=_[_0x071d('0x4b')](_0x5798fe[_0x071d('0x4c')],_0x5798fe[_0x071d('0x47')]);_0x59e051['attributes']=_[_0x071d('0x4b')](_0x5798fe[_0x071d('0x4c')],qs[_0x071d('0x4d')](_0x1041c0['query'][_0x071d('0x4d')]));_0x59e051[_0x071d('0x4a')]=_0x59e051[_0x071d('0x4a')][_0x071d('0x4e')]?_0x59e051[_0x071d('0x4a')]:_0x5798fe[_0x071d('0x4c')];_0x59e051['order']=qs[_0x071d('0x51')](_0x1041c0[_0x071d('0x47')]['sort']);_0x59e051[_0x071d('0x52')]=qs[_0x071d('0x49')](_['pick'](_0x1041c0['query'],_0x5798fe[_0x071d('0x49')]));if(_0x1041c0[_0x071d('0x47')][_0x071d('0x54')]){_0x59e051[_0x071d('0x52')]=_[_0x071d('0x55')](_0x59e051['where'],{'$or':_[_0x071d('0x42')](_0x59e051['attributes'],function(_0x17d41a){var _0x59b95b={};_0x59b95b[_0x17d41a]={'$like':'%'+_0x1041c0[_0x071d('0x47')]['filter']+'%'};return _0x59b95b;})});}_0x59e051=_[_0x071d('0x55')]({},_0x59e051,_0x1041c0['options']);return _0x2116a3[_0x071d('0xc3')](_0x59e051);}})[_0x071d('0x20')](function(_0x10b07e){if(_0x10b07e){_0x5605ca=_0x10b07e[_0x071d('0x4e')];if(!_0x1041c0['query'][_0x071d('0x4f')](_0x071d('0x50'))){_0x59e051[_0x071d('0x30')]=qs[_0x071d('0x30')](_0x1041c0[_0x071d('0x47')][_0x071d('0x30')]);_0x59e051['offset']=qs[_0x071d('0x2e')](_0x1041c0[_0x071d('0x47')][_0x071d('0x2e')]);}return _0x2116a3[_0x071d('0xc3')](_0x59e051);}})['then'](function(_0x5c9450){if(_0x5c9450){return _0x5c9450?{'count':_0x5605ca,'rows':_0x5c9450}:null;}})[_0x071d('0x20')](respondWithResult(_0x2857a1,null))[_0x071d('0x2a')](handleError(_0x2857a1,null));};
\ No newline at end of file
index 6102693..a0eb7d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5a6=['events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x39bd3f,_0x45b058){var _0x5ce625=function(_0x127975){while(--_0x127975){_0x39bd3f['push'](_0x39bd3f['shift']());}};_0x5ce625(++_0x45b058);}(_0xe5a6,0x104));var _0x6e5a=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0xe5a6[_0x4d7a70];return _0x3aafbb;};'use strict';var EventEmitter=require(_0x6e5a('0x0'));var MailAccount=require(_0x6e5a('0x1'))['db'][_0x6e5a('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x6e5a('0x3')](0x0);var events={'afterCreate':_0x6e5a('0x4'),'afterUpdate':_0x6e5a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3123e6){return function(_0x4195c1,_0x51944b,_0x34a9ff){MailAccountEvents[_0x6e5a('0x6')](_0x3123e6+':'+_0x4195c1['id'],_0x4195c1);MailAccountEvents[_0x6e5a('0x6')](_0x3123e6,_0x4195c1);_0x34a9ff(null);};}for(var e in events){if(events[_0x6e5a('0x7')](e)){var event=events[e];MailAccount[_0x6e5a('0x8')](e,emitEvent(event));}}module[_0x6e5a('0x9')]=MailAccountEvents;
\ No newline at end of file
+var _0x87f1=['MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x1f1d4f,_0xf024bb){var _0xa70fc=function(_0x2d03f5){while(--_0x2d03f5){_0x1f1d4f['push'](_0x1f1d4f['shift']());}};_0xa70fc(++_0xf024bb);}(_0x87f1,0x170));var _0x187f=function(_0x2613e1,_0x6065a8){_0x2613e1=_0x2613e1-0x0;var _0x5a05bb=_0x87f1[_0x2613e1];return _0x5a05bb;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0x187f('0x0'))['db'][_0x187f('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x187f('0x2')](0x0);var events={'afterCreate':_0x187f('0x3'),'afterUpdate':_0x187f('0x4'),'afterDestroy':_0x187f('0x5')};function emitEvent(_0x233cda){return function(_0x5eafdc,_0x19e8fb,_0x4c6db8){MailAccountEvents[_0x187f('0x6')](_0x233cda+':'+_0x5eafdc['id'],_0x5eafdc);MailAccountEvents['emit'](_0x233cda,_0x5eafdc);_0x4c6db8(null);};}for(var e in events){if(events[_0x187f('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x187f('0x8')]=MailAccountEvents;
\ No newline at end of file
index ec12854..5de5386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f12=['define','MailAccount','mail_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x5df532,_0x14cbbe){var _0x143974=function(_0x5d5a82){while(--_0x5d5a82){_0x5df532['push'](_0x5df532['shift']());}};_0x143974(++_0x14cbbe);}(_0x8f12,0x78));var _0x28f1=function(_0x4f7b43,_0x119c22){_0x4f7b43=_0x4f7b43-0x0;var _0x2fcdf3=_0x8f12[_0x4f7b43];return _0x2fcdf3;};'use strict';var _=require('lodash');var util=require(_0x28f1('0x0'));var logger=require(_0x28f1('0x1'))(_0x28f1('0x2'));var moment=require(_0x28f1('0x3'));var BPromise=require(_0x28f1('0x4'));var rp=require(_0x28f1('0x5'));var fs=require('fs');var path=require(_0x28f1('0x6'));var rimraf=require(_0x28f1('0x7'));var config=require(_0x28f1('0x8'));var attributes=require('./mailAccount.attributes');module[_0x28f1('0x9')]=function(_0x338368,_0x2f6060){return _0x338368[_0x28f1('0xa')](_0x28f1('0xb'),attributes,{'tableName':_0x28f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x45ed=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x72c89e,_0x1d17bd){var _0x16a4cb=function(_0x399bed){while(--_0x399bed){_0x72c89e['push'](_0x72c89e['shift']());}};_0x16a4cb(++_0x1d17bd);}(_0x45ed,0x149));var _0xd45e=function(_0x5585a6,_0x1ad47d){_0x5585a6=_0x5585a6-0x0;var _0x36a760=_0x45ed[_0x5585a6];return _0x36a760;};'use strict';var _=require(_0xd45e('0x0'));var util=require(_0xd45e('0x1'));var logger=require(_0xd45e('0x2'))(_0xd45e('0x3'));var moment=require('moment');var BPromise=require(_0xd45e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd45e('0x5'));var rimraf=require(_0xd45e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd45e('0x7'));module[_0xd45e('0x8')]=function(_0x56187e,_0x376812){return _0x56187e[_0xd45e('0x9')](_0xd45e('0xa'),attributes,{'tableName':_0xd45e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cc544b1..e69d130 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe94f=['mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','List','get','applications','list','orderBy','priority','push','length','close','*,*,*,*','defaults','ListId','create','List\x20not\x20found','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','format','interaction','created','contact','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailAccount.socket','request','info','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailAccount,\x20%s,\x20%s','result','MailAccount','options','raw','where','attributes','limit','include','map','model','then','GetMailAccount','debug','catch','find','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xe94f,0x10b));var _0xfe94=function(_0x55c485,_0x3fe77e){_0x55c485=_0x55c485-0x0;var _0x6bb521=_0xe94f[_0x55c485];return _0x6bb521;};'use strict';var _=require(_0xfe94('0x0'));var util=require('util');var moment=require(_0xfe94('0x1'));var BPromise=require(_0xfe94('0x2'));var rs=require(_0xfe94('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfe94('0x4'));var logger=require(_0xfe94('0x5'))('rpc');var config=require(_0xfe94('0x6'));var jayson=require(_0xfe94('0x7'));var client=jayson['client'][_0xfe94('0x8')]({'port':0x232c});config[_0xfe94('0x9')]=_['defaults'](config[_0xfe94('0x9')],{'host':_0xfe94('0xa'),'port':0x18eb});var socket=require(_0xfe94('0xb'))(new Redis(config[_0xfe94('0x9')]));require(_0xfe94('0xc'))['register'](socket);function respondWithRpcPromise(_0x31ac1,_0x268cf0,_0x333d9f){return new BPromise(function(_0x3c89f,_0x169b39){return client[_0xfe94('0xd')](_0x31ac1,_0x333d9f)['then'](function(_0x10f919){logger[_0xfe94('0xe')]('MailAccount,\x20%s,\x20%s',_0x268cf0,'request\x20sent');logger['debug'](_0xfe94('0xf'),_0x268cf0,_0xfe94('0x10'),JSON[_0xfe94('0x11')](_0x10f919));if(_0x10f919[_0xfe94('0x12')]){if(_0x10f919['error'][_0xfe94('0x13')]===0x1f4){logger[_0xfe94('0x12')]('MailAccount,\x20%s,\x20%s',_0x268cf0,_0x10f919['error'][_0xfe94('0x14')]);return _0x169b39(_0x10f919[_0xfe94('0x12')][_0xfe94('0x14')]);}logger[_0xfe94('0x12')](_0xfe94('0x15'),_0x268cf0,_0x10f919[_0xfe94('0x12')]['message']);return _0x3c89f(_0x10f919[_0xfe94('0x12')][_0xfe94('0x14')]);}else{logger['info'](_0xfe94('0x15'),_0x268cf0,_0xfe94('0x10'));_0x3c89f(_0x10f919[_0xfe94('0x16')][_0xfe94('0x14')]);}})['catch'](function(_0x348dd8){logger[_0xfe94('0x12')](_0xfe94('0x15'),_0x268cf0,_0x348dd8);_0x169b39(_0x348dd8);});});}exports['GetMailAccount']=function(_0x59455e){var _0x58afec=this;return new Promise(function(_0x2e0f7c,_0x3ffe73){return db[_0xfe94('0x17')]['findAll']({'raw':_0x59455e[_0xfe94('0x18')]?_0x59455e[_0xfe94('0x18')][_0xfe94('0x19')]===undefined?!![]:![]:!![],'where':_0x59455e[_0xfe94('0x18')]?_0x59455e[_0xfe94('0x18')][_0xfe94('0x1a')]||null:null,'attributes':_0x59455e[_0xfe94('0x18')]?_0x59455e[_0xfe94('0x18')][_0xfe94('0x1b')]||null:null,'limit':_0x59455e['options']?_0x59455e['options'][_0xfe94('0x1c')]||null:null,'include':_0x59455e[_0xfe94('0x18')]?_0x59455e[_0xfe94('0x18')][_0xfe94('0x1d')]?_[_0xfe94('0x1e')](_0x59455e[_0xfe94('0x18')][_0xfe94('0x1d')],function(_0x48d44f){return{'model':db[_0x48d44f[_0xfe94('0x1f')]],'as':_0x48d44f['as'],'attributes':_0x48d44f[_0xfe94('0x1b')],'include':_0x48d44f[_0xfe94('0x1d')]?_[_0xfe94('0x1e')](_0x48d44f[_0xfe94('0x1d')],function(_0xad3743){return{'model':db[_0xad3743[_0xfe94('0x1f')]],'as':_0xad3743['as'],'attributes':_0xad3743[_0xfe94('0x1b')],'include':_0xad3743[_0xfe94('0x1d')]?_[_0xfe94('0x1e')](_0xad3743[_0xfe94('0x1d')],function(_0x2908bf){return{'model':db[_0x2908bf['model']],'as':_0x2908bf['as'],'attributes':_0x2908bf[_0xfe94('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfe94('0x20')](function(_0x1dc083){logger[_0xfe94('0xe')](_0xfe94('0x21'),_0x59455e);logger[_0xfe94('0x22')](_0xfe94('0x21'),_0x59455e,JSON['stringify'](_0x1dc083));_0x2e0f7c(_0x1dc083);})[_0xfe94('0x23')](function(_0x5e6f0d){logger[_0xfe94('0x12')](_0xfe94('0x21'),_0x5e6f0d['message'],_0x59455e);_0x3ffe73(_0x58afec['error'](0x1f4,_0x5e6f0d[_0xfe94('0x14')]));});});};exports['ShowMailAccount']=function(_0x1e2384){var _0x355b0a=this;return new Promise(function(_0x19a173,_0x15a207){return db[_0xfe94('0x17')][_0xfe94('0x24')]({'raw':_0x1e2384['options']?_0x1e2384[_0xfe94('0x18')][_0xfe94('0x19')]===undefined?!![]:![]:!![],'where':_0x1e2384['options']?_0x1e2384[_0xfe94('0x18')]['where']||null:null,'attributes':_0x1e2384['options']?_0x1e2384['options']['attributes']||null:null,'include':_0x1e2384[_0xfe94('0x18')]?_0x1e2384[_0xfe94('0x18')][_0xfe94('0x1d')]?_[_0xfe94('0x1e')](_0x1e2384[_0xfe94('0x18')]['include'],function(_0x9bd21f){return{'model':db[_0x9bd21f[_0xfe94('0x1f')]],'as':_0x9bd21f['as'],'attributes':_0x9bd21f['attributes'],'include':_0x9bd21f['include']?_[_0xfe94('0x1e')](_0x9bd21f[_0xfe94('0x1d')],function(_0x277a3f){return{'model':db[_0x277a3f[_0xfe94('0x1f')]],'as':_0x277a3f['as'],'attributes':_0x277a3f[_0xfe94('0x1b')],'include':_0x277a3f['include']?_[_0xfe94('0x1e')](_0x277a3f[_0xfe94('0x1d')],function(_0x43fc73){return{'model':db[_0x43fc73[_0xfe94('0x1f')]],'as':_0x43fc73['as'],'attributes':_0x43fc73[_0xfe94('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x106244){logger['info'](_0xfe94('0x25'),_0x1e2384);logger[_0xfe94('0x22')]('ShowMailAccount',_0x1e2384,JSON['stringify'](_0x106244));_0x19a173(_0x106244);})[_0xfe94('0x23')](function(_0x1b4aaa){logger['error'](_0xfe94('0x25'),_0x1b4aaa['message'],_0x1e2384);_0x15a207(_0x355b0a[_0xfe94('0x12')](0x1f4,_0x1b4aaa[_0xfe94('0x14')]));});});};exports[_0xfe94('0x26')]=function(_0x43f371){var _0x339834=this;return new Promise(function(_0xe2220b,_0x38f23c){var _0x3a9d44={'body':_0x43f371[_0xfe94('0x27')],'channel':_0xfe94('0x28')};var _0xc3e97c=_[_0xfe94('0x29')](_[_0xfe94('0x2a')](db[_0xfe94('0x2b')][_0xfe94('0x2c')]),['createdAt',_0xfe94('0x2d'),_0xfe94('0x2e'),'ListId']);var _0x17b082=![];if(_0x43f371[_0xfe94('0x27')]['id']){delete _0x43f371[_0xfe94('0x27')]['id'];}if(_['isNil'](_0x43f371[_0xfe94('0x27')]['from'])){return _0x38f23c(_0x339834['error'](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x43f371['body'][_0xfe94('0x27')])||_0x43f371[_0xfe94('0x27')]['body']===''){return _0x38f23c(_0x339834[_0xfe94('0x12')](0x1f4,_0xfe94('0x2f')));}if(_['isNil'](_0x43f371[_0xfe94('0x27')]['mapKey'])){return _0x38f23c(_0x339834[_0xfe94('0x12')](0x1f4,_0xfe94('0x30')+_0xc3e97c));}if(!_[_0xfe94('0x31')](_0xc3e97c,_0x43f371[_0xfe94('0x27')][_0xfe94('0x32')])){return _0x38f23c(_0x339834['error'](0x1f4,_0xfe94('0x33')+_0xc3e97c));}var _0x5cb3f7={};_0x5cb3f7[_0x43f371['body'][_0xfe94('0x32')]]=_0x43f371['body'][_0xfe94('0x34')];return db[_0xfe94('0x17')][_0xfe94('0x24')]({'where':{'id':_0x43f371[_0xfe94('0x35')]['id']},'include':[{'model':db[_0xfe94('0x36')],'as':'List','include':[{'model':db[_0xfe94('0x2b')],'as':_0xfe94('0x37'),'where':_0x5cb3f7,'limit':0x1,'order':[[_0xfe94('0x2d'),_0xfe94('0x38')]]}]},{'model':db[_0xfe94('0x39')],'as':_0xfe94('0x3a')},{'model':db[_0xfe94('0x3b')],'as':'Smtp'}]})[_0xfe94('0x20')](function(_0x5d7369){if(_0x5d7369&&_0x5d7369[_0xfe94('0x3c')]){var _0x2e722d=_0x5d7369[_0xfe94('0x3d')]({'plain':!![]});_0x3a9d44[_0xfe94('0x35')]=_['omit'](_0x2e722d,[_0xfe94('0x3a'),_0xfe94('0x3c')]);_0x3a9d44[_0xfe94('0x3e')]=_0x2e722d[_0xfe94('0x3a')];_0x3a9d44[_0xfe94('0x3f')]=_0x2e722d[_0xfe94('0x3c')];_0x3a9d44[_0xfe94('0x3e')]=_[_0xfe94('0x40')](_0x3a9d44[_0xfe94('0x3e')],[_0xfe94('0x41')],['asc']);if(_0x3a9d44[_0xfe94('0x35')]&&_0x3a9d44[_0xfe94('0x35')]['autoclose']){_0x3a9d44[_0xfe94('0x3e')][_0xfe94('0x42')]({'id':0x0,'priority':_0x3a9d44[_0xfe94('0x3e')][_0xfe94('0x43')]+0x1,'app':_0xfe94('0x44'),'appdata':'autoclose','interval':_0xfe94('0x45')});}if(_0x3a9d44[_0xfe94('0x35')][_0xfe94('0x3a')]){delete _0x3a9d44[_0xfe94('0x35')][_0xfe94('0x3a')];}if(_0x3a9d44[_0xfe94('0x35')][_0xfe94('0x3c')]){delete _0x3a9d44[_0xfe94('0x35')][_0xfe94('0x3c')];}if(_0x2e722d[_0xfe94('0x3c')][_0xfe94('0x37')][_0xfe94('0x43')]){return _0x2e722d[_0xfe94('0x3c')][_0xfe94('0x37')][0x0];}var _0x32c5bb=_[_0xfe94('0x46')](_0x43f371[_0xfe94('0x27')],{'firstName':_0x43f371['body'][_0xfe94('0x34')],'ListId':_0x2e722d[_0xfe94('0x47')]});_0x32c5bb[_0x43f371[_0xfe94('0x27')][_0xfe94('0x32')]]=_0x43f371['body'][_0xfe94('0x34')];return db[_0xfe94('0x2b')][_0xfe94('0x48')](_0x32c5bb);}else{throw new Error(_0xfe94('0x49'));}})['then'](function(_0x3d12b5){_0x3a9d44['contact']=_0x3d12b5;if(_0x3d12b5){if(!_0x43f371['body'][_0xfe94('0x14')][_0xfe94('0x4a')]){_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')]['messageId']=rs['generate']()+'\x20'+_0x43f371[_0xfe94('0x27')]['message'][_0xfe94('0x34')];}var _0x694826={'ContactId':_0x3d12b5['id'],'MailAccountId':_0x43f371[_0xfe94('0x35')]['id'],'inReplyTo':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')][_0xfe94('0x4a')],'to':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')]['from'],'cc':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')]['cc'],'subject':_0x43f371[_0xfe94('0x27')]['message'][_0xfe94('0x4b')],'attach':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')][_0xfe94('0x4c')],'lastMsgAt':moment()['format'](_0xfe94('0x4d')),'lastMsgDirection':'in'};return db[_0xfe94('0x4e')][_0xfe94('0x24')]({'where':{'closed':![],'MailAccountId':_0x43f371[_0xfe94('0x35')]['id']},'include':[{'model':db[_0xfe94('0x4f')],'as':_0xfe94('0x50'),'attributes':['messageId'],'where':{'messageId':_0x43f371['body'][_0xfe94('0x14')][_0xfe94('0x51')]}}]})[_0xfe94('0x20')](function(_0x135a42){if(_0x135a42){return[_0x135a42,![]];}return db[_0xfe94('0x4e')]['create'](_0x694826)[_0xfe94('0x20')](function(_0x5f0bd6){return[_0x5f0bd6,!![]];});});}else{throw new Error(_0xfe94('0x52'));}})['spread'](function(_0x253a7f,_0x46906e){if(_0x253a7f){_0x17b082=_0x46906e;if(!_0x46906e){return _0x253a7f[_0xfe94('0x53')]({'inReplyTo':_0x43f371['body'][_0xfe94('0x14')]['messageId'],'to':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')][_0xfe94('0x34')],'cc':_0x43f371['body']['message']['cc'],'subject':_0x43f371['body'][_0xfe94('0x14')][_0xfe94('0x4b')],'attach':_0x253a7f['attach']?_0x253a7f['attach']:_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')][_0xfe94('0x4c')],'substatus':null,'substatusAt':moment()[_0xfe94('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0xfe94('0x54')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x253a7f;}}})[_0xfe94('0x20')](function(_0x58921d){_0x3a9d44['interaction']=_0x58921d[_0xfe94('0x3d')]({'plain':!![]});_0x3a9d44[_0xfe94('0x55')][_0xfe94('0x56')]=_0x17b082;return db[_0xfe94('0x4f')][_0xfe94('0x48')]({'body':_0x43f371['body'][_0xfe94('0x27')],'MailAccountId':_0x43f371[_0xfe94('0x35')]['id'],'MailInteractionId':_0x58921d['id'],'direction':'in','ContactId':_0x3a9d44[_0xfe94('0x57')]['id'],'messageId':_0x43f371['body'][_0xfe94('0x14')][_0xfe94('0x4a')],'from':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')][_0xfe94('0x34')],'to':_0x43f371['body'][_0xfe94('0x14')]['to'],'cc':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')]['cc'],'subject':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')][_0xfe94('0x4b')],'attach':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')][_0xfe94('0x4c')],'Attachments':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')][_0xfe94('0x58')],'originTo':_0x43f371[_0xfe94('0x27')]['message'][_0xfe94('0x59')],'originCc':_0x43f371[_0xfe94('0x27')]['message'][_0xfe94('0x5a')],'bcc':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')][_0xfe94('0x5b')],'ChatWebsiteId':_0x43f371[_0xfe94('0x27')][_0xfe94('0x14')][_0xfe94('0x5c')]||null,'originChannel':_0x43f371['body']['message'][_0xfe94('0x5d')]||_0xfe94('0x5e'),'ChatOfflineMessageId':_0x43f371['body']['message'][_0xfe94('0x5f')]||null},{'include':[{'model':db[_0xfe94('0x60')],'as':_0xfe94('0x61')}]});})['then'](function(_0x157cd3){_0x3a9d44[_0xfe94('0x14')]=_0x157cd3;if(_0x3a9d44[_0xfe94('0x55')][_0xfe94('0x62')]){return db[_0xfe94('0x63')]['find']({'attributes':['id',_0xfe94('0x64')],'where':{'id':_0x3a9d44['interaction'][_0xfe94('0x62')]}})[_0xfe94('0x20')](function(_0x1cf2d7){if(_0x1cf2d7){_0x3a9d44[_0xfe94('0x3e')][_0xfe94('0x65')]({'id':0x0,'priority':0x0,'app':_0xfe94('0x66'),'appdata':_0x1cf2d7[_0xfe94('0x64')]+','+(_0x3a9d44[_0xfe94('0x35')][_0xfe94('0x67')]||0xa),'interval':_0xfe94('0x45')});}return respondWithRpcPromise('Start',_0xfe94('0x68'),_0x3a9d44);});}return respondWithRpcPromise(_0xfe94('0x69'),_0xfe94('0x68'),_0x3a9d44);})[_0xfe94('0x20')](function(_0x47484d){_0xe2220b(_0x47484d);})['catch'](function(_0x89436e){_0x38f23c(_0x339834[_0xfe94('0x12')](0x1f4,_0x89436e[_0xfe94('0x14')]));});});};
\ No newline at end of file
+var _0xa2a1=['autoclose','create','List\x20not\x20found','contact','messageId','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','inReplyTo','Contact\x20not\x20found','spread','update','attach','interaction','created','attachments','originTo','originCc','bcc','Email','ChatOfflineMessageId','Attachment','Attachments','name','UserId','unshift','*,*,*,*','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetMailAccount','MailAccount','findAll','raw','options','attributes','include','map','model','ShowMailAccount','find','where','NotifyMailAccount','body','mail','keys','updatedAt','CompanyId','ListId','isNil','from','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','priority','asc','push','close'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xa2a1,0x147));var _0x1a2a=function(_0x1fefce,_0x5da114){_0x1fefce=_0x1fefce-0x0;var _0x5586de=_0xa2a1[_0x1fefce];return _0x5586de;};'use strict';var _=require(_0x1a2a('0x0'));var util=require(_0x1a2a('0x1'));var moment=require('moment');var BPromise=require(_0x1a2a('0x2'));var rs=require(_0x1a2a('0x3'));var fs=require('fs');var Redis=require(_0x1a2a('0x4'));var db=require(_0x1a2a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a2a('0x6'))('rpc');var config=require(_0x1a2a('0x7'));var jayson=require(_0x1a2a('0x8'));var client=jayson[_0x1a2a('0x9')]['http']({'port':0x232c});config[_0x1a2a('0xa')]=_[_0x1a2a('0xb')](config[_0x1a2a('0xa')],{'host':_0x1a2a('0xc'),'port':0x18eb});var socket=require(_0x1a2a('0xd'))(new Redis(config['redis']));require(_0x1a2a('0xe'))['register'](socket);function respondWithRpcPromise(_0x5598c9,_0x16eec7,_0x21133b){return new BPromise(function(_0x5e7b6e,_0x4b8fb6){return client['request'](_0x5598c9,_0x21133b)[_0x1a2a('0xf')](function(_0xf2a882){logger['info'](_0x1a2a('0x10'),_0x16eec7,_0x1a2a('0x11'));logger[_0x1a2a('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x16eec7,'request\x20sent',JSON[_0x1a2a('0x13')](_0xf2a882));if(_0xf2a882[_0x1a2a('0x14')]){if(_0xf2a882[_0x1a2a('0x14')][_0x1a2a('0x15')]===0x1f4){logger[_0x1a2a('0x14')]('MailAccount,\x20%s,\x20%s',_0x16eec7,_0xf2a882[_0x1a2a('0x14')][_0x1a2a('0x16')]);return _0x4b8fb6(_0xf2a882[_0x1a2a('0x14')]['message']);}logger['error'](_0x1a2a('0x10'),_0x16eec7,_0xf2a882[_0x1a2a('0x14')]['message']);return _0x5e7b6e(_0xf2a882[_0x1a2a('0x14')][_0x1a2a('0x16')]);}else{logger[_0x1a2a('0x17')](_0x1a2a('0x10'),_0x16eec7,_0x1a2a('0x11'));_0x5e7b6e(_0xf2a882[_0x1a2a('0x18')][_0x1a2a('0x16')]);}})[_0x1a2a('0x19')](function(_0x44d6fe){logger[_0x1a2a('0x14')](_0x1a2a('0x10'),_0x16eec7,_0x44d6fe);_0x4b8fb6(_0x44d6fe);});});}exports[_0x1a2a('0x1a')]=function(_0x5372e0){var _0x1c1311=this;return new Promise(function(_0x4c3b2f,_0x51f1ac){return db[_0x1a2a('0x1b')][_0x1a2a('0x1c')]({'raw':_0x5372e0['options']?_0x5372e0['options'][_0x1a2a('0x1d')]===undefined?!![]:![]:!![],'where':_0x5372e0[_0x1a2a('0x1e')]?_0x5372e0[_0x1a2a('0x1e')]['where']||null:null,'attributes':_0x5372e0[_0x1a2a('0x1e')]?_0x5372e0[_0x1a2a('0x1e')][_0x1a2a('0x1f')]||null:null,'limit':_0x5372e0[_0x1a2a('0x1e')]?_0x5372e0[_0x1a2a('0x1e')]['limit']||null:null,'include':_0x5372e0['options']?_0x5372e0['options'][_0x1a2a('0x20')]?_[_0x1a2a('0x21')](_0x5372e0[_0x1a2a('0x1e')]['include'],function(_0x490423){return{'model':db[_0x490423['model']],'as':_0x490423['as'],'attributes':_0x490423[_0x1a2a('0x1f')],'include':_0x490423[_0x1a2a('0x20')]?_[_0x1a2a('0x21')](_0x490423['include'],function(_0xac2615){return{'model':db[_0xac2615[_0x1a2a('0x22')]],'as':_0xac2615['as'],'attributes':_0xac2615[_0x1a2a('0x1f')],'include':_0xac2615['include']?_[_0x1a2a('0x21')](_0xac2615['include'],function(_0x4888d1){return{'model':db[_0x4888d1[_0x1a2a('0x22')]],'as':_0x4888d1['as'],'attributes':_0x4888d1[_0x1a2a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1a2a('0xf')](function(_0x3f920a){logger[_0x1a2a('0x17')](_0x1a2a('0x1a'),_0x5372e0);logger['debug'](_0x1a2a('0x1a'),_0x5372e0,JSON[_0x1a2a('0x13')](_0x3f920a));_0x4c3b2f(_0x3f920a);})[_0x1a2a('0x19')](function(_0x187288){logger['error'](_0x1a2a('0x1a'),_0x187288['message'],_0x5372e0);_0x51f1ac(_0x1c1311[_0x1a2a('0x14')](0x1f4,_0x187288[_0x1a2a('0x16')]));});});};exports[_0x1a2a('0x23')]=function(_0x271d29){var _0x18ff3b=this;return new Promise(function(_0x3d4e8c,_0x1e88ce){return db[_0x1a2a('0x1b')][_0x1a2a('0x24')]({'raw':_0x271d29[_0x1a2a('0x1e')]?_0x271d29[_0x1a2a('0x1e')][_0x1a2a('0x1d')]===undefined?!![]:![]:!![],'where':_0x271d29[_0x1a2a('0x1e')]?_0x271d29['options'][_0x1a2a('0x25')]||null:null,'attributes':_0x271d29[_0x1a2a('0x1e')]?_0x271d29[_0x1a2a('0x1e')][_0x1a2a('0x1f')]||null:null,'include':_0x271d29[_0x1a2a('0x1e')]?_0x271d29[_0x1a2a('0x1e')][_0x1a2a('0x20')]?_[_0x1a2a('0x21')](_0x271d29[_0x1a2a('0x1e')][_0x1a2a('0x20')],function(_0x309420){return{'model':db[_0x309420[_0x1a2a('0x22')]],'as':_0x309420['as'],'attributes':_0x309420[_0x1a2a('0x1f')],'include':_0x309420[_0x1a2a('0x20')]?_[_0x1a2a('0x21')](_0x309420['include'],function(_0x515c46){return{'model':db[_0x515c46[_0x1a2a('0x22')]],'as':_0x515c46['as'],'attributes':_0x515c46['attributes'],'include':_0x515c46[_0x1a2a('0x20')]?_['map'](_0x515c46[_0x1a2a('0x20')],function(_0x1b9623){return{'model':db[_0x1b9623[_0x1a2a('0x22')]],'as':_0x1b9623['as'],'attributes':_0x1b9623[_0x1a2a('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1a2a('0xf')](function(_0x44eec5){logger[_0x1a2a('0x17')](_0x1a2a('0x23'),_0x271d29);logger['debug']('ShowMailAccount',_0x271d29,JSON['stringify'](_0x44eec5));_0x3d4e8c(_0x44eec5);})['catch'](function(_0x1a3caf){logger[_0x1a2a('0x14')](_0x1a2a('0x23'),_0x1a3caf['message'],_0x271d29);_0x1e88ce(_0x18ff3b[_0x1a2a('0x14')](0x1f4,_0x1a3caf['message']));});});};exports[_0x1a2a('0x26')]=function(_0x55dbef){var _0x4e9fe9=this;return new Promise(function(_0x3db1d1,_0x1b9322){var _0x57b8b6={'body':_0x55dbef[_0x1a2a('0x27')],'channel':_0x1a2a('0x28')};var _0x95676e=_['difference'](_[_0x1a2a('0x29')](db['CmContact']['rawAttributes']),['createdAt',_0x1a2a('0x2a'),_0x1a2a('0x2b'),_0x1a2a('0x2c')]);var _0x39c100=![];if(_0x55dbef[_0x1a2a('0x27')]['id']){delete _0x55dbef[_0x1a2a('0x27')]['id'];}if(_[_0x1a2a('0x2d')](_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2e')])){return _0x1b9322(_0x4e9fe9[_0x1a2a('0x14')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x55dbef[_0x1a2a('0x27')]['body'])||_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x27')]===''){return _0x1b9322(_0x4e9fe9[_0x1a2a('0x14')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x1a2a('0x2d')](_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2f')])){return _0x1b9322(_0x4e9fe9[_0x1a2a('0x14')](0x1f4,_0x1a2a('0x30')+_0x95676e));}if(!_[_0x1a2a('0x31')](_0x95676e,_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2f')])){return _0x1b9322(_0x4e9fe9[_0x1a2a('0x14')](0x1f4,_0x1a2a('0x32')+_0x95676e));}var _0x47b252={};_0x47b252[_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2f')]]=_0x55dbef['body']['from'];return db['MailAccount'][_0x1a2a('0x24')]({'where':{'id':_0x55dbef[_0x1a2a('0x33')]['id']},'include':[{'model':db[_0x1a2a('0x34')],'as':_0x1a2a('0x35'),'include':[{'model':db['CmContact'],'as':_0x1a2a('0x36'),'where':_0x47b252,'limit':0x1,'order':[[_0x1a2a('0x2a'),_0x1a2a('0x37')]]}]},{'model':db[_0x1a2a('0x38')],'as':_0x1a2a('0x39')},{'model':db[_0x1a2a('0x3a')],'as':_0x1a2a('0x3b')}]})['then'](function(_0x5259f3){if(_0x5259f3&&_0x5259f3[_0x1a2a('0x35')]){var _0x2dd47d=_0x5259f3[_0x1a2a('0x3c')]({'plain':!![]});_0x57b8b6[_0x1a2a('0x33')]=_[_0x1a2a('0x3d')](_0x2dd47d,[_0x1a2a('0x39'),_0x1a2a('0x35')]);_0x57b8b6[_0x1a2a('0x3e')]=_0x2dd47d[_0x1a2a('0x39')];_0x57b8b6[_0x1a2a('0x3f')]=_0x2dd47d[_0x1a2a('0x35')];_0x57b8b6['applications']=_[_0x1a2a('0x40')](_0x57b8b6[_0x1a2a('0x3e')],[_0x1a2a('0x41')],[_0x1a2a('0x42')]);if(_0x57b8b6[_0x1a2a('0x33')]&&_0x57b8b6[_0x1a2a('0x33')]['autoclose']){_0x57b8b6[_0x1a2a('0x3e')][_0x1a2a('0x43')]({'id':0x0,'priority':_0x57b8b6[_0x1a2a('0x3e')]['length']+0x1,'app':_0x1a2a('0x44'),'appdata':_0x1a2a('0x45'),'interval':'*,*,*,*'});}if(_0x57b8b6[_0x1a2a('0x33')][_0x1a2a('0x39')]){delete _0x57b8b6[_0x1a2a('0x33')][_0x1a2a('0x39')];}if(_0x57b8b6[_0x1a2a('0x33')][_0x1a2a('0x35')]){delete _0x57b8b6[_0x1a2a('0x33')][_0x1a2a('0x35')];}if(_0x2dd47d[_0x1a2a('0x35')][_0x1a2a('0x36')]['length']){return _0x2dd47d[_0x1a2a('0x35')][_0x1a2a('0x36')][0x0];}var _0x13c526=_[_0x1a2a('0xb')](_0x55dbef['body'],{'firstName':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2e')],'ListId':_0x2dd47d[_0x1a2a('0x2c')]});_0x13c526[_0x55dbef[_0x1a2a('0x27')]['mapKey']]=_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x2e')];return db['CmContact'][_0x1a2a('0x46')](_0x13c526);}else{throw new Error(_0x1a2a('0x47'));}})[_0x1a2a('0xf')](function(_0x57e06e){_0x57b8b6[_0x1a2a('0x48')]=_0x57e06e;if(_0x57e06e){if(!_0x55dbef[_0x1a2a('0x27')]['message'][_0x1a2a('0x49')]){_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x49')]=rs['generate']()+'\x20'+_0x55dbef[_0x1a2a('0x27')]['message']['from'];}var _0x588113={'ContactId':_0x57e06e['id'],'MailAccountId':_0x55dbef['account']['id'],'inReplyTo':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['messageId'],'to':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x2e')],'cc':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['cc'],'subject':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['subject'],'attach':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['attach'],'lastMsgAt':moment()[_0x1a2a('0x4a')](_0x1a2a('0x4b')),'lastMsgDirection':'in'};return db[_0x1a2a('0x4c')][_0x1a2a('0x24')]({'where':{'closed':![],'MailAccountId':_0x55dbef[_0x1a2a('0x33')]['id']},'include':[{'model':db[_0x1a2a('0x4d')],'as':'Messages','attributes':[_0x1a2a('0x49')],'where':{'messageId':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x4e')]}}]})[_0x1a2a('0xf')](function(_0x57fe11){if(_0x57fe11){return[_0x57fe11,![]];}return db[_0x1a2a('0x4c')][_0x1a2a('0x46')](_0x588113)['then'](function(_0x3a0704){return[_0x3a0704,!![]];});});}else{throw new Error(_0x1a2a('0x4f'));}})[_0x1a2a('0x50')](function(_0x37c033,_0x49807c){if(_0x37c033){_0x39c100=_0x49807c;if(!_0x49807c){return _0x37c033[_0x1a2a('0x51')]({'inReplyTo':_0x55dbef[_0x1a2a('0x27')]['message'][_0x1a2a('0x49')],'to':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x2e')],'cc':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['cc'],'subject':_0x55dbef['body'][_0x1a2a('0x16')]['subject'],'attach':_0x37c033[_0x1a2a('0x52')]?_0x37c033[_0x1a2a('0x52')]:_0x55dbef['body'][_0x1a2a('0x16')][_0x1a2a('0x52')],'substatus':null,'substatusAt':moment()['format'](_0x1a2a('0x4b')),'lastMsgAt':moment()[_0x1a2a('0x4a')](_0x1a2a('0x4b')),'lastMsgDirection':'in'});}else{return _0x37c033;}}})[_0x1a2a('0xf')](function(_0x32b12f){_0x57b8b6[_0x1a2a('0x53')]=_0x32b12f[_0x1a2a('0x3c')]({'plain':!![]});_0x57b8b6[_0x1a2a('0x53')][_0x1a2a('0x54')]=_0x39c100;return db[_0x1a2a('0x4d')]['create']({'body':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x27')],'MailAccountId':_0x55dbef['account']['id'],'MailInteractionId':_0x32b12f['id'],'direction':'in','ContactId':_0x57b8b6[_0x1a2a('0x48')]['id'],'messageId':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x49')],'from':_0x55dbef['body']['message'][_0x1a2a('0x2e')],'to':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['to'],'cc':_0x55dbef['body'][_0x1a2a('0x16')]['cc'],'subject':_0x55dbef['body']['message']['subject'],'attach':_0x55dbef['body'][_0x1a2a('0x16')]['attach'],'Attachments':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x55')],'originTo':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x56')],'originCc':_0x55dbef['body'][_0x1a2a('0x16')][_0x1a2a('0x57')],'bcc':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')][_0x1a2a('0x58')],'ChatWebsiteId':_0x55dbef[_0x1a2a('0x27')][_0x1a2a('0x16')]['ChatWebsiteId']||null,'originChannel':_0x55dbef['body'][_0x1a2a('0x16')]['originChannel']||_0x1a2a('0x59'),'ChatOfflineMessageId':_0x55dbef['body'][_0x1a2a('0x16')][_0x1a2a('0x5a')]||null},{'include':[{'model':db[_0x1a2a('0x5b')],'as':_0x1a2a('0x5c')}]});})[_0x1a2a('0xf')](function(_0x508a0a){_0x57b8b6[_0x1a2a('0x16')]=_0x508a0a;if(_0x57b8b6[_0x1a2a('0x53')]['UserId']){return db['User'][_0x1a2a('0x24')]({'attributes':['id',_0x1a2a('0x5d')],'where':{'id':_0x57b8b6['interaction'][_0x1a2a('0x5e')]}})['then'](function(_0x17b949){if(_0x17b949){_0x57b8b6[_0x1a2a('0x3e')][_0x1a2a('0x5f')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x17b949['name']+','+(_0x57b8b6[_0x1a2a('0x33')]['waitForTheAssignedAgent']||0xa),'interval':_0x1a2a('0x60')});}return respondWithRpcPromise(_0x1a2a('0x61'),_0x1a2a('0x62'),_0x57b8b6);});}return respondWithRpcPromise(_0x1a2a('0x61'),'startRouting',_0x57b8b6);})['then'](function(_0x2ad8f6){_0x3db1d1(_0x2ad8f6);})[_0x1a2a('0x19')](function(_0x59776c){_0x1b9322(_0x4e9fe9[_0x1a2a('0x14')](0x1f4,_0x59776c[_0x1a2a('0x16')]));});});};
\ No newline at end of file
index 806aa6b..c39f3d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50c2=['save','remove','update','register','length'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x50c2,0x127));var _0x250c=function(_0x10ec04,_0x45ca9d){_0x10ec04=_0x10ec04-0x0;var _0x46eca4=_0x50c2[_0x10ec04];return _0x46eca4;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x250c('0x0'),_0x250c('0x1'),_0x250c('0x2')];function createListener(_0x1dfe1c,_0x3ab150){return function(_0x5b9fd9){_0x3ab150['emit'](_0x1dfe1c,_0x5b9fd9);};}function removeListener(_0x5d18e7,_0x8194d){return function(){MailAccountEvents['removeListener'](_0x5d18e7,_0x8194d);};}exports[_0x250c('0x3')]=function(_0x4193f5){for(var _0x1d015=0x0,_0x488fb1=events[_0x250c('0x4')];_0x1d015<_0x488fb1;_0x1d015++){var _0x3e2125=events[_0x1d015];var _0xe728ba=createListener('mailAccount:'+_0x3e2125,_0x4193f5);MailAccountEvents['on'](_0x3e2125,_0xe728ba);}};
\ No newline at end of file
+var _0x26d0=['mailAccount:','./mailAccount.events','save','emit','removeListener','length'];(function(_0x5aa2e9,_0x51c0fc){var _0x39c38d=function(_0x5812cc){while(--_0x5812cc){_0x5aa2e9['push'](_0x5aa2e9['shift']());}};_0x39c38d(++_0x51c0fc);}(_0x26d0,0x67));var _0x026d=function(_0x26aa2a,_0x150360){_0x26aa2a=_0x26aa2a-0x0;var _0x1058c8=_0x26d0[_0x26aa2a];return _0x1058c8;};'use strict';var MailAccountEvents=require(_0x026d('0x0'));var events=[_0x026d('0x1'),'remove','update'];function createListener(_0x4a3831,_0x4e2a17){return function(_0x4c4630){_0x4e2a17[_0x026d('0x2')](_0x4a3831,_0x4c4630);};}function removeListener(_0x8e4ee1,_0x377256){return function(){MailAccountEvents[_0x026d('0x3')](_0x8e4ee1,_0x377256);};}exports['register']=function(_0x467135){for(var _0x2c39be=0x0,_0x5906d0=events[_0x026d('0x4')];_0x2c39be<_0x5906d0;_0x2c39be++){var _0x4a465b=events[_0x2c39be];var _0x3ab647=createListener(_0x026d('0x5')+_0x4a465b,_0x467135);MailAccountEvents['on'](_0x4a465b,_0x3ab647);}};
\ No newline at end of file
index 0d38796..7716b55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c9d=['get','/:id','isAuthenticated','show','put','update','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2144d9,_0xdee16){var _0xac271c=function(_0x72c3c3){while(--_0x72c3c3){_0x2144d9['push'](_0x2144d9['shift']());}};_0xac271c(++_0xdee16);}(_0x3c9d,0x1d7));var _0xd3c9=function(_0x206ca8,_0x34739a){_0x206ca8=_0x206ca8-0x0;var _0x508d10=_0x3c9d[_0x206ca8];return _0x508d10;};'use strict';var multer=require(_0xd3c9('0x0'));var util=require(_0xd3c9('0x1'));var path=require(_0xd3c9('0x2'));var timeout=require(_0xd3c9('0x3'));var express=require(_0xd3c9('0x4'));var router=express['Router']();var fs_extra=require(_0xd3c9('0x5'));var auth=require(_0xd3c9('0x6'));var interaction=require(_0xd3c9('0x7'));var config=require(_0xd3c9('0x8'));var controller=require('./mailApplication.controller');router[_0xd3c9('0x9')](_0xd3c9('0xa'),auth[_0xd3c9('0xb')](),controller[_0xd3c9('0xc')]);router[_0xd3c9('0xd')](_0xd3c9('0xa'),auth[_0xd3c9('0xb')](),controller[_0xd3c9('0xe')]);router['delete']('/:id',auth[_0xd3c9('0xb')](),controller[_0xd3c9('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xf42b=['show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailApplication.controller','get','isAuthenticated'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0xf42b,0x116));var _0xbf42=function(_0x3a5367,_0x55f4fe){_0x3a5367=_0x3a5367-0x0;var _0x124c0a=_0xf42b[_0x3a5367];return _0x124c0a;};'use strict';var multer=require('multer');var util=require(_0xbf42('0x0'));var path=require(_0xbf42('0x1'));var timeout=require(_0xbf42('0x2'));var express=require(_0xbf42('0x3'));var router=express[_0xbf42('0x4')]();var fs_extra=require(_0xbf42('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbf42('0x6'));var config=require('../../config/environment');var controller=require(_0xbf42('0x7'));router[_0xbf42('0x8')]('/:id',auth[_0xbf42('0x9')](),controller[_0xbf42('0xa')]);router[_0xbf42('0xb')]('/:id',auth[_0xbf42('0x9')](),controller[_0xbf42('0xc')]);router[_0xbf42('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xbf42('0xe')]);module[_0xbf42('0xf')]=router;
\ No newline at end of file
index d90638b..5114fbb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8392=['INTEGER','TEXT','STRING','exports'];(function(_0x55f552,_0x51bb6b){var _0x576e60=function(_0x44b9c6){while(--_0x44b9c6){_0x55f552['push'](_0x55f552['shift']());}};_0x576e60(++_0x51bb6b);}(_0x8392,0x6b));var _0x2839=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8392[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x2839('0x0')]={'priority':{'type':Sequelize[_0x2839('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2839('0x2')]()},'description':{'type':Sequelize[_0x2839('0x3')]},'interval':{'type':Sequelize[_0x2839('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x0372=['*,*,*,*','INTEGER','STRING','noop','TEXT'];(function(_0x23096b,_0x35ebc1){var _0x24c0f4=function(_0x3ddd78){while(--_0x3ddd78){_0x23096b['push'](_0x23096b['shift']());}};_0x24c0f4(++_0x35ebc1);}(_0x0372,0x123));var _0x2037=function(_0x21b36c,_0x543483){_0x21b36c=_0x21b36c-0x0;var _0x236627=_0x0372[_0x21b36c];return _0x236627;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x2037('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x2037('0x1')],'allowNull':![],'defaultValue':_0x2037('0x2')},'appdata':{'type':Sequelize[_0x2037('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x2037('0x4')}};
\ No newline at end of file
index 543ae61..f8e95e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','attributes','intersection','fields','length','includeAll','include','merge','options','find','then','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set'];(function(_0x5a27fe,_0x43993b){var _0x121c88=function(_0x2aff1f){while(--_0x2aff1f){_0x5a27fe['push'](_0x5a27fe['shift']());}};_0x121c88(++_0x43993b);}(_0x9c44,0x178));var _0x49c4=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9c44[_0x3ff085];return _0x2b68c3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));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('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];function respondWithStatusCode(_0x5487cd,_0x7df3a9){_0x7df3a9=_0x7df3a9||0xcc;return function(_0x403bfb){if(_0x403bfb){return _0x5487cd['sendStatus'](_0x7df3a9);}return _0x5487cd[_0x49c4('0x16')](_0x7df3a9)[_0x49c4('0x17')]();};}function respondWithResult(_0x21f15a,_0x2decee){_0x2decee=_0x2decee||0xc8;return function(_0x12777c){if(_0x12777c){return _0x21f15a[_0x49c4('0x16')](_0x2decee)[_0x49c4('0x18')](_0x12777c);}};}function respondWithFilteredResult(_0x3de397,_0x58d177){return function(_0x3acd06){if(_0x3acd06){var _0x141003=typeof _0x58d177[_0x49c4('0x19')]===_0x49c4('0x1a')&&typeof _0x58d177[_0x49c4('0x1b')]==='undefined';var _0x44e607=_0x3acd06[_0x49c4('0x1c')];var _0x4c3253=_0x141003?0x0:_0x58d177['offset'];var _0x3c782d=_0x141003?_0x3acd06[_0x49c4('0x1c')]:_0x58d177[_0x49c4('0x19')]+_0x58d177['limit'];var _0x24856d;if(_0x3c782d>=_0x44e607){_0x3c782d=_0x44e607;_0x24856d=0xc8;}else{_0x24856d=0xce;}_0x3de397['status'](_0x24856d);return _0x3de397[_0x49c4('0x1d')](_0x49c4('0x1e'),_0x4c3253+'-'+_0x3c782d+'/'+_0x44e607)[_0x49c4('0x18')](_0x3acd06);}return null;};}function patchUpdates(_0x291526){return function(_0x382040){try{jsonpatch[_0x49c4('0x1f')](_0x382040,_0x291526,!![]);}catch(_0x280893){return BPromise[_0x49c4('0x20')](_0x280893);}return _0x382040[_0x49c4('0x21')]();};}function saveUpdates(_0x578447,_0x527126){return function(_0x57f502){if(_0x57f502){return _0x57f502[_0x49c4('0x22')](_0x578447)['then'](function(_0x592bb8){return _0x592bb8;});}return null;};}function removeEntity(_0x2263ae,_0x15581b){return function(_0x26c640){if(_0x26c640){return _0x26c640[_0x49c4('0x23')]()['then'](function(){_0x2263ae['status'](0xcc)[_0x49c4('0x17')]();});}};}function handleEntityNotFound(_0x9cb797,_0x565423){return function(_0x207358){if(!_0x207358){_0x9cb797[_0x49c4('0x24')](0x194);}return _0x207358;};}function handleError(_0x210159,_0xa7a826){_0xa7a826=_0xa7a826||0x1f4;return function(_0x531d92){logger['error'](_0x531d92[_0x49c4('0x25')]);if(_0x531d92['name']){delete _0x531d92[_0x49c4('0x26')];}_0x210159[_0x49c4('0x16')](_0xa7a826)[_0x49c4('0x27')](_0x531d92);};}exports[_0x49c4('0x28')]=function(_0x5987ae,_0x889909){var _0x2b2793={'raw':!![],'where':{'id':_0x5987ae[_0x49c4('0x29')]['id']}},_0x46e04d={};_0x46e04d[_0x49c4('0x2a')]=_[_0x49c4('0x2b')](db[_0x49c4('0x2c')][_0x49c4('0x2d')]);_0x46e04d[_0x49c4('0x2e')]=_[_0x49c4('0x2b')](_0x5987ae[_0x49c4('0x2e')]);_0x46e04d['filters']=_['intersection'](_0x46e04d['model'],_0x46e04d[_0x49c4('0x2e')]);_0x2b2793[_0x49c4('0x2f')]=_[_0x49c4('0x30')](_0x46e04d[_0x49c4('0x2a')],qs[_0x49c4('0x31')](_0x5987ae['query'][_0x49c4('0x31')]));_0x2b2793[_0x49c4('0x2f')]=_0x2b2793[_0x49c4('0x2f')][_0x49c4('0x32')]?_0x2b2793['attributes']:_0x46e04d['model'];if(_0x5987ae[_0x49c4('0x2e')][_0x49c4('0x33')]){_0x2b2793[_0x49c4('0x34')]=[{'all':!![]}];}_0x2b2793=_[_0x49c4('0x35')]({},_0x2b2793,_0x5987ae[_0x49c4('0x36')]);return db['MailApplication'][_0x49c4('0x37')](_0x2b2793)[_0x49c4('0x38')](handleEntityNotFound(_0x889909,null))[_0x49c4('0x38')](respondWithResult(_0x889909,null))['catch'](handleError(_0x889909,null));};exports['update']=function(_0x85dce2,_0x1991e9){if(_0x85dce2[_0x49c4('0x39')]['id']){delete _0x85dce2[_0x49c4('0x39')]['id'];}return db[_0x49c4('0x2c')][_0x49c4('0x37')]({'where':{'id':_0x85dce2[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x1991e9,null))[_0x49c4('0x38')](saveUpdates(_0x85dce2['body'],null))[_0x49c4('0x38')](respondWithResult(_0x1991e9,null))['catch'](handleError(_0x1991e9,null));};exports[_0x49c4('0x23')]=function(_0x349791,_0x2625a6){return db[_0x49c4('0x2c')]['find']({'where':{'id':_0x349791[_0x49c4('0x29')]['id']}})[_0x49c4('0x38')](handleEntityNotFound(_0x2625a6,null))[_0x49c4('0x38')](removeEntity(_0x2625a6,null))['catch'](handleError(_0x2625a6,null));};
\ No newline at end of file
+var _0xb43b=['name','status','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','fields','attributes','length','includeAll','merge','options','find','then','catch','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x105191,_0x485b8b){var _0x2fb62d=function(_0x3ae184){while(--_0x3ae184){_0x105191['push'](_0x105191['shift']());}};_0x2fb62d(++_0x485b8b);}(_0xb43b,0x1b2));var _0xbb43=function(_0x49972c,_0x1cb014){_0x49972c=_0x49972c-0x0;var _0x443084=_0xb43b[_0x49972c];return _0x443084;};'use strict';var emlformat=require(_0xbb43('0x0'));var rimraf=require(_0xbb43('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb43('0x2'));var rp=require(_0xbb43('0x3'));var moment=require(_0xbb43('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb43('0x5'));var util=require(_0xbb43('0x6'));var path=require(_0xbb43('0x7'));var sox=require(_0xbb43('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb43('0x9'));var _=require('lodash');var squel=require(_0xbb43('0xa'));var crypto=require(_0xbb43('0xb'));var jsforce=require(_0xbb43('0xc'));var deskjs=require(_0xbb43('0xd'));var toCsv=require(_0xbb43('0xe'));var querystring=require('querystring');var Papa=require(_0xbb43('0xf'));var Redis=require(_0xbb43('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb43('0x11'));var as=require(_0xbb43('0x12'));var hardwareService=require(_0xbb43('0x13'));var logger=require(_0xbb43('0x14'))(_0xbb43('0x15'));var utils=require(_0xbb43('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xbb43('0x17'));var db=require(_0xbb43('0x18'))['db'];function respondWithStatusCode(_0x50e2c0,_0x578392){_0x578392=_0x578392||0xcc;return function(_0x41e7e5){if(_0x41e7e5){return _0x50e2c0['sendStatus'](_0x578392);}return _0x50e2c0['status'](_0x578392)[_0xbb43('0x19')]();};}function respondWithResult(_0x5a509f,_0x68d45d){_0x68d45d=_0x68d45d||0xc8;return function(_0x43021d){if(_0x43021d){return _0x5a509f['status'](_0x68d45d)['json'](_0x43021d);}};}function respondWithFilteredResult(_0x4d5bcf,_0x338120){return function(_0x2abce0){if(_0x2abce0){var _0x57bd1d=typeof _0x338120['offset']===_0xbb43('0x1a')&&typeof _0x338120['limit']==='undefined';var _0x2b0797=_0x2abce0[_0xbb43('0x1b')];var _0x2e3b43=_0x57bd1d?0x0:_0x338120['offset'];var _0x1c16d7=_0x57bd1d?_0x2abce0['count']:_0x338120[_0xbb43('0x1c')]+_0x338120[_0xbb43('0x1d')];var _0x4dfc54;if(_0x1c16d7>=_0x2b0797){_0x1c16d7=_0x2b0797;_0x4dfc54=0xc8;}else{_0x4dfc54=0xce;}_0x4d5bcf['status'](_0x4dfc54);return _0x4d5bcf[_0xbb43('0x1e')](_0xbb43('0x1f'),_0x2e3b43+'-'+_0x1c16d7+'/'+_0x2b0797)[_0xbb43('0x20')](_0x2abce0);}return null;};}function patchUpdates(_0x2bf2d4){return function(_0x5bcce7){try{jsonpatch[_0xbb43('0x21')](_0x5bcce7,_0x2bf2d4,!![]);}catch(_0x5f4416){return BPromise[_0xbb43('0x22')](_0x5f4416);}return _0x5bcce7['save']();};}function saveUpdates(_0x2f5e31,_0x565256){return function(_0x3f323e){if(_0x3f323e){return _0x3f323e[_0xbb43('0x23')](_0x2f5e31)['then'](function(_0x1d0768){return _0x1d0768;});}return null;};}function removeEntity(_0x4dfb7f,_0xf24e60){return function(_0x298ce2){if(_0x298ce2){return _0x298ce2[_0xbb43('0x24')]()['then'](function(){_0x4dfb7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x269ca5,_0x32d7f0){return function(_0x5d8310){if(!_0x5d8310){_0x269ca5[_0xbb43('0x25')](0x194);}return _0x5d8310;};}function handleError(_0x2da653,_0x226827){_0x226827=_0x226827||0x1f4;return function(_0x3874fb){logger['error'](_0x3874fb['stack']);if(_0x3874fb[_0xbb43('0x26')]){delete _0x3874fb[_0xbb43('0x26')];}_0x2da653[_0xbb43('0x27')](_0x226827)[_0xbb43('0x28')](_0x3874fb);};}exports[_0xbb43('0x29')]=function(_0x40b04b,_0x21d386){var _0x473828={'raw':!![],'where':{'id':_0x40b04b[_0xbb43('0x2a')]['id']}},_0x539730={};_0x539730['model']=_[_0xbb43('0x2b')](db[_0xbb43('0x2c')][_0xbb43('0x2d')]);_0x539730[_0xbb43('0x2e')]=_['keys'](_0x40b04b[_0xbb43('0x2e')]);_0x539730['filters']=_['intersection'](_0x539730['model'],_0x539730[_0xbb43('0x2e')]);_0x473828['attributes']=_[_0xbb43('0x2f')](_0x539730[_0xbb43('0x30')],qs[_0xbb43('0x31')](_0x40b04b['query'][_0xbb43('0x31')]));_0x473828[_0xbb43('0x32')]=_0x473828[_0xbb43('0x32')][_0xbb43('0x33')]?_0x473828[_0xbb43('0x32')]:_0x539730[_0xbb43('0x30')];if(_0x40b04b[_0xbb43('0x2e')][_0xbb43('0x34')]){_0x473828['include']=[{'all':!![]}];}_0x473828=_[_0xbb43('0x35')]({},_0x473828,_0x40b04b[_0xbb43('0x36')]);return db[_0xbb43('0x2c')][_0xbb43('0x37')](_0x473828)[_0xbb43('0x38')](handleEntityNotFound(_0x21d386,null))[_0xbb43('0x38')](respondWithResult(_0x21d386,null))[_0xbb43('0x39')](handleError(_0x21d386,null));};exports[_0xbb43('0x23')]=function(_0x349a83,_0x57105c){if(_0x349a83[_0xbb43('0x3a')]['id']){delete _0x349a83[_0xbb43('0x3a')]['id'];}return db[_0xbb43('0x2c')][_0xbb43('0x37')]({'where':{'id':_0x349a83[_0xbb43('0x2a')]['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x57105c,null))['then'](saveUpdates(_0x349a83[_0xbb43('0x3a')],null))[_0xbb43('0x38')](respondWithResult(_0x57105c,null))['catch'](handleError(_0x57105c,null));};exports[_0xbb43('0x24')]=function(_0x2c9a7c,_0x11d384){return db['MailApplication']['find']({'where':{'id':_0x2c9a7c['params']['id']}})[_0xbb43('0x38')](handleEntityNotFound(_0x11d384,null))[_0xbb43('0x38')](removeEntity(_0x11d384,null))['catch'](handleError(_0x11d384,null));};
\ No newline at end of file
index ea6c35e..6a9094c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ac4=['rimraf','../../config/environment','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','request-promise','path'];(function(_0x535b50,_0x42f7c3){var _0x5af444=function(_0x296488){while(--_0x296488){_0x535b50['push'](_0x535b50['shift']());}};_0x5af444(++_0x42f7c3);}(_0x8ac4,0x163));var _0x48ac=function(_0x1f6f77,_0x18ec83){_0x1f6f77=_0x1f6f77-0x0;var _0x304971=_0x8ac4[_0x1f6f77];return _0x304971;};'use strict';var _=require(_0x48ac('0x0'));var util=require(_0x48ac('0x1'));var logger=require(_0x48ac('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x48ac('0x3'));var fs=require('fs');var path=require(_0x48ac('0x4'));var rimraf=require(_0x48ac('0x5'));var config=require(_0x48ac('0x6'));var attributes=require(_0x48ac('0x7'));module[_0x48ac('0x8')]=function(_0x2ccd8e,_0x48cdf8){return _0x2ccd8e['define'](_0x48ac('0x9'),attributes,{'tableName':_0x48ac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x48ac('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc7eb=['moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2dd359,_0x456fd7){var _0x5485ab=function(_0x5a83f9){while(--_0x5a83f9){_0x2dd359['push'](_0x2dd359['shift']());}};_0x5485ab(++_0x456fd7);}(_0xc7eb,0xa5));var _0xbc7e=function(_0x393d69,_0x3a8c83){_0x393d69=_0x393d69-0x0;var _0x3cee37=_0xc7eb[_0x393d69];return _0x3cee37;};'use strict';var _=require(_0xbc7e('0x0'));var util=require(_0xbc7e('0x1'));var logger=require(_0xbc7e('0x2'))('api');var moment=require(_0xbc7e('0x3'));var BPromise=require('bluebird');var rp=require(_0xbc7e('0x4'));var fs=require('fs');var path=require(_0xbc7e('0x5'));var rimraf=require(_0xbc7e('0x6'));var config=require(_0xbc7e('0x7'));var attributes=require(_0xbc7e('0x8'));module[_0xbc7e('0x9')]=function(_0x3ac590,_0x5e045b){return _0x3ac590[_0xbc7e('0xa')](_0xbc7e('0xb'),attributes,{'tableName':_0xbc7e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xbc7e('0xd')});};
\ No newline at end of file
index 653e0a6..6e071ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeec6=['request','then','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailApplication','options','raw','where','attributes','limit','UpdateMailApplication','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x275b1d,_0x9a82e){var _0x58cf92=function(_0x1a2c83){while(--_0x1a2c83){_0x275b1d['push'](_0x275b1d['shift']());}};_0x58cf92(++_0x9a82e);}(_0xeec6,0x199));var _0x6eec=function(_0x55969b,_0x1ebe62){_0x55969b=_0x55969b-0x0;var _0x3d7fc1=_0xeec6[_0x55969b];return _0x3d7fc1;};'use strict';var _=require('lodash');var util=require(_0x6eec('0x0'));var moment=require(_0x6eec('0x1'));var BPromise=require(_0x6eec('0x2'));var rs=require(_0x6eec('0x3'));var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6eec('0x6'))(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var jayson=require(_0x6eec('0x9'));var client=jayson[_0x6eec('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x182b2,_0x5d4843,_0x1e5844){return new BPromise(function(_0x2e5a3c,_0x4926fc){return client[_0x6eec('0xb')](_0x182b2,_0x1e5844)[_0x6eec('0xc')](function(_0x5e5773){logger['info'](_0x6eec('0xd'),_0x5d4843,_0x6eec('0xe'));logger['debug'](_0x6eec('0xf'),_0x5d4843,_0x6eec('0xe'),JSON[_0x6eec('0x10')](_0x5e5773));if(_0x5e5773[_0x6eec('0x11')]){if(_0x5e5773['error'][_0x6eec('0x12')]===0x1f4){logger[_0x6eec('0x11')](_0x6eec('0xd'),_0x5d4843,_0x5e5773[_0x6eec('0x11')][_0x6eec('0x13')]);return _0x4926fc(_0x5e5773[_0x6eec('0x11')][_0x6eec('0x13')]);}logger[_0x6eec('0x11')](_0x6eec('0xd'),_0x5d4843,_0x5e5773['error'][_0x6eec('0x13')]);return _0x2e5a3c(_0x5e5773['error'][_0x6eec('0x13')]);}else{logger['info'](_0x6eec('0xd'),_0x5d4843,_0x6eec('0xe'));_0x2e5a3c(_0x5e5773[_0x6eec('0x14')][_0x6eec('0x13')]);}})[_0x6eec('0x15')](function(_0x191ed1){logger[_0x6eec('0x11')](_0x6eec('0xd'),_0x5d4843,_0x191ed1);_0x4926fc(_0x191ed1);});});}exports['UpdateMailApplication']=function(_0x4cb16b){var _0x29d7c1=this;return new Promise(function(_0x53ed09,_0x2e99dc){return db[_0x6eec('0x16')]['update'](_0x4cb16b['body'],{'raw':_0x4cb16b[_0x6eec('0x17')]?_0x4cb16b['options'][_0x6eec('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4cb16b[_0x6eec('0x17')]?_0x4cb16b[_0x6eec('0x17')][_0x6eec('0x19')]||null:null,'attributes':_0x4cb16b[_0x6eec('0x17')]?_0x4cb16b[_0x6eec('0x17')][_0x6eec('0x1a')]||null:null,'limit':_0x4cb16b[_0x6eec('0x17')]?_0x4cb16b[_0x6eec('0x17')][_0x6eec('0x1b')]||null:null})[_0x6eec('0xc')](function(_0x5a6ece){logger['info'](_0x6eec('0x1c'),_0x4cb16b);logger[_0x6eec('0x1d')](_0x6eec('0x1c'),_0x4cb16b,JSON[_0x6eec('0x10')](_0x5a6ece));_0x53ed09(_0x5a6ece);})[_0x6eec('0x15')](function(_0x12f35e){logger[_0x6eec('0x11')](_0x6eec('0x1c'),_0x12f35e[_0x6eec('0x13')],_0x4cb16b);_0x2e99dc(_0x29d7c1[_0x6eec('0x11')](0x1f4,_0x12f35e['message']));});});};
\ No newline at end of file
+var _0xc926=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateMailApplication','MailApplication','update','options','raw','where','limit','catch','lodash','util','moment','bluebird','ioredis'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0xc926,0x11b));var _0x6c92=function(_0x431778,_0x261a44){_0x431778=_0x431778-0x0;var _0x15182a=_0xc926[_0x431778];return _0x15182a;};'use strict';var _=require(_0x6c92('0x0'));var util=require(_0x6c92('0x1'));var moment=require(_0x6c92('0x2'));var BPromise=require(_0x6c92('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c92('0x4'));var db=require(_0x6c92('0x5'))['db'];var utils=require(_0x6c92('0x6'));var logger=require(_0x6c92('0x7'))(_0x6c92('0x8'));var config=require(_0x6c92('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6c92('0xa')][_0x6c92('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29f13e,_0x5c578e,_0x55da07){return new BPromise(function(_0x385898,_0x4c5582){return client[_0x6c92('0xc')](_0x29f13e,_0x55da07)[_0x6c92('0xd')](function(_0x1b1f1d){logger['info'](_0x6c92('0xe'),_0x5c578e,_0x6c92('0xf'));logger[_0x6c92('0x10')](_0x6c92('0x11'),_0x5c578e,'request\x20sent',JSON[_0x6c92('0x12')](_0x1b1f1d));if(_0x1b1f1d[_0x6c92('0x13')]){if(_0x1b1f1d['error'][_0x6c92('0x14')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x5c578e,_0x1b1f1d[_0x6c92('0x13')][_0x6c92('0x15')]);return _0x4c5582(_0x1b1f1d[_0x6c92('0x13')][_0x6c92('0x15')]);}logger[_0x6c92('0x13')](_0x6c92('0xe'),_0x5c578e,_0x1b1f1d['error'][_0x6c92('0x15')]);return _0x385898(_0x1b1f1d[_0x6c92('0x13')]['message']);}else{logger[_0x6c92('0x16')]('MailApplication,\x20%s,\x20%s',_0x5c578e,_0x6c92('0xf'));_0x385898(_0x1b1f1d[_0x6c92('0x17')]['message']);}})['catch'](function(_0x12510d){logger['error'](_0x6c92('0xe'),_0x5c578e,_0x12510d);_0x4c5582(_0x12510d);});});}exports[_0x6c92('0x18')]=function(_0x4c9575){var _0x128212=this;return new Promise(function(_0x3f35f4,_0x4b332a){return db[_0x6c92('0x19')][_0x6c92('0x1a')](_0x4c9575['body'],{'raw':_0x4c9575[_0x6c92('0x1b')]?_0x4c9575[_0x6c92('0x1b')][_0x6c92('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4c9575[_0x6c92('0x1b')]?_0x4c9575['options'][_0x6c92('0x1d')]||null:null,'attributes':_0x4c9575[_0x6c92('0x1b')]?_0x4c9575['options']['attributes']||null:null,'limit':_0x4c9575[_0x6c92('0x1b')]?_0x4c9575[_0x6c92('0x1b')][_0x6c92('0x1e')]||null:null})[_0x6c92('0xd')](function(_0x2b9ca1){logger[_0x6c92('0x16')](_0x6c92('0x18'),_0x4c9575);logger[_0x6c92('0x10')](_0x6c92('0x18'),_0x4c9575,JSON[_0x6c92('0x12')](_0x2b9ca1));_0x3f35f4(_0x2b9ca1);})[_0x6c92('0x1f')](function(_0x22c996){logger[_0x6c92('0x13')]('UpdateMailApplication',_0x22c996['message'],_0x4c9575);_0x4b332a(_0x128212[_0x6c92('0x13')](0x1f4,_0x22c996[_0x6c92('0x15')]));});});};
\ No newline at end of file
index eccbdc1..0831190 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e41=['mailinteraction:update','delete','mailinteraction:destroy','destroy','removeTags','express','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','download','post','/:id/messages','addMessage','tracked','put','mail'];(function(_0x2049a0,_0x396bec){var _0x346277=function(_0x334227){while(--_0x334227){_0x2049a0['push'](_0x2049a0['shift']());}};_0x346277(++_0x396bec);}(_0x8e41,0x1e5));var _0x18e4=function(_0x552e94,_0x110f92){_0x552e94=_0x552e94-0x0;var _0x12587b=_0x8e41[_0x552e94];return _0x12587b;};'use strict';var express=require(_0x18e4('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var controller=require(_0x18e4('0x1'));router[_0x18e4('0x2')]('/',auth[_0x18e4('0x3')](),controller[_0x18e4('0x4')]);router[_0x18e4('0x2')](_0x18e4('0x5'),auth[_0x18e4('0x3')](),controller[_0x18e4('0x6')]);router['get'](_0x18e4('0x7'),auth[_0x18e4('0x3')](),controller['show']);router['get']('/:id/messages',auth[_0x18e4('0x3')](),controller['getMessages']);router[_0x18e4('0x2')]('/:id/download',auth[_0x18e4('0x3')](),controller[_0x18e4('0x8')]);router[_0x18e4('0x9')]('/',auth[_0x18e4('0x3')](),controller['create']);router['post'](_0x18e4('0xa'),auth[_0x18e4('0x3')](),controller[_0x18e4('0xb')]);router['post']('/:id/tags',auth[_0x18e4('0x3')](),interaction[_0x18e4('0xc')]('mail','mailinteraction:addtags'),controller['addTags']);router[_0x18e4('0xd')]('/:id',auth[_0x18e4('0x3')](),interaction['tracked'](_0x18e4('0xe'),_0x18e4('0xf')),controller['update']);router[_0x18e4('0x10')](_0x18e4('0x7'),auth[_0x18e4('0x3')](),interaction[_0x18e4('0xc')](_0x18e4('0xe'),_0x18e4('0x11')),controller[_0x18e4('0x12')]);router['delete']('/:id/tags',auth[_0x18e4('0x3')](),controller[_0x18e4('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x0491=['getMessages','/:id/download','download','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5bffd7,_0x1ac4f4){var _0x48e5dd=function(_0xdc6b8a){while(--_0xdc6b8a){_0x5bffd7['push'](_0x5bffd7['shift']());}};_0x48e5dd(++_0x1ac4f4);}(_0x0491,0xa3));var _0x1049=function(_0xcd49bd,_0x2a12a3){_0xcd49bd=_0xcd49bd-0x0;var _0xb6ee44=_0x0491[_0xcd49bd];return _0xb6ee44;};'use strict';var express=require('express');var router=express[_0x1049('0x0')]();var auth=require(_0x1049('0x1'));var interaction=require(_0x1049('0x2'));var controller=require(_0x1049('0x3'));router[_0x1049('0x4')]('/',auth[_0x1049('0x5')](),controller[_0x1049('0x6')]);router[_0x1049('0x4')](_0x1049('0x7'),auth[_0x1049('0x5')](),controller[_0x1049('0x8')]);router[_0x1049('0x4')](_0x1049('0x9'),auth[_0x1049('0x5')](),controller[_0x1049('0xa')]);router[_0x1049('0x4')]('/:id/messages',auth[_0x1049('0x5')](),controller[_0x1049('0xb')]);router[_0x1049('0x4')](_0x1049('0xc'),auth['isAuthenticated'](),controller[_0x1049('0xd')]);router['post']('/',auth[_0x1049('0x5')](),controller[_0x1049('0xe')]);router['post']('/:id/messages',auth[_0x1049('0x5')](),controller[_0x1049('0xf')]);router['post'](_0x1049('0x10'),auth[_0x1049('0x5')](),interaction[_0x1049('0x11')](_0x1049('0x12'),_0x1049('0x13')),controller[_0x1049('0x14')]);router[_0x1049('0x15')]('/:id',auth[_0x1049('0x5')](),interaction[_0x1049('0x11')](_0x1049('0x12'),_0x1049('0x16')),controller[_0x1049('0x17')]);router[_0x1049('0x18')](_0x1049('0x9'),auth[_0x1049('0x5')](),interaction[_0x1049('0x11')](_0x1049('0x12'),_0x1049('0x19')),controller[_0x1049('0x1a')]);router[_0x1049('0x18')](_0x1049('0x10'),auth[_0x1049('0x5')](),controller[_0x1049('0x1b')]);module[_0x1049('0x1c')]=router;
\ No newline at end of file
index 0325d68..327790c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x967c=['out','sequelize','iconv','BOOLEAN','STRING','TEXT','long','DATE','ENUM'];(function(_0x4cfc1d,_0x2c0927){var _0x1c01a0=function(_0x264a74){while(--_0x264a74){_0x4cfc1d['push'](_0x4cfc1d['shift']());}};_0x1c01a0(++_0x2c0927);}(_0x967c,0x1ba));var _0xc967=function(_0x3faaa7,_0x485311){_0x3faaa7=_0x3faaa7-0x0;var _0x78f658=_0x967c[_0x3faaa7];return _0x78f658;};'use strict';var Sequelize=require(_0xc967('0x0'));var iconv=require(_0xc967('0x1'));module['exports']={'closed':{'type':Sequelize[_0xc967('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc967('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc967('0x3')]},'note':{'type':Sequelize[_0xc967('0x3')]},'inReplyTo':{'type':Sequelize[_0xc967('0x3')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xc967('0x4')](_0xc967('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xc967('0x6')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xc967('0x6')]},'firstMsgDirection':{'type':Sequelize[_0xc967('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc967('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc967('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x4598=['exports','DATE','STRING','TEXT','long','ENUM','out','BOOLEAN'];(function(_0xf08c35,_0x2fd33c){var _0x10ea65=function(_0x542588){while(--_0x542588){_0xf08c35['push'](_0xf08c35['shift']());}};_0x10ea65(++_0x2fd33c);}(_0x4598,0x110));var _0x8459=function(_0x8a4494,_0x561354){_0x8a4494=_0x8a4494-0x0;var _0x9bb700=_0x4598[_0x8a4494];return _0x9bb700;};'use strict';var Sequelize=require('sequelize');var iconv=require('iconv');module[_0x8459('0x0')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8459('0x1')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x8459('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8459('0x2')]},'inReplyTo':{'type':Sequelize[_0x8459('0x2')](0x1fe)},'to':{'type':Sequelize[_0x8459('0x2')]},'cc':{'type':Sequelize[_0x8459('0x3')](_0x8459('0x4'))},'subject':{'type':Sequelize[_0x8459('0x3')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x8459('0x1')]},'substatus':{'type':Sequelize[_0x8459('0x2')](0x3c)},'substatusAt':{'type':Sequelize[_0x8459('0x1')]},'firstMsgDirection':{'type':Sequelize[_0x8459('0x5')]('in',_0x8459('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x8459('0x5')]('in',_0x8459('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8459('0x7')],'defaultValue':![]}};
\ No newline at end of file
index 0607316..e7da748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xb10b,0x12a));var _0xbb10=function(_0x2c8745,_0x4ba4b5){_0x2c8745=_0x2c8745-0x0;var _0x3d96dc=_0xb10b[_0x2c8745];return _0x3d96dc;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));};
\ No newline at end of file
+var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c68e4,_0x20e968){_0x3c68e4=_0x3c68e4-0x0;var _0x2b35e7=_0xb10b[_0x3c68e4];return _0x2b35e7;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));};
\ No newline at end of file
index 91419af..27ed284 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b64=['MailMessage','setMaxListeners','update','remove','then','setDataValue','Users','map','unreadMessages','length','emit','hook','events','../../mysqldb','MailInteraction'];(function(_0x516927,_0xb4aad0){var _0x30749b=function(_0x2ca6cc){while(--_0x2ca6cc){_0x516927['push'](_0x516927['shift']());}};_0x30749b(++_0xb4aad0);}(_0x3b64,0x1b0));var _0x43b6=function(_0xb0db9,_0x236a2d){_0xb0db9=_0xb0db9-0x0;var _0x2429bd=_0x3b64[_0xb0db9];return _0x2429bd;};'use strict';var EventEmitter=require(_0x43b6('0x0'));var MailInteraction=require(_0x43b6('0x1'))['db'][_0x43b6('0x2')];var MailMessage=require(_0x43b6('0x1'))['db'][_0x43b6('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x43b6('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x43b6('0x5'),'afterDestroy':_0x43b6('0x6')};function emitEvent(_0x2aa435){return function(_0x537706,_0x1d27cf,_0x128a6b){_0x537706['getUsers']({'attributes':['id'],'raw':!![]})[_0x43b6('0x7')](function(_0x263435){_0x537706[_0x43b6('0x8')](_0x43b6('0x9'),_0x263435[_0x43b6('0xa')](function(_0x366762){return{'id':_0x366762['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x537706['id'],'direction':'in','read':![]},'raw':!![]});})[_0x43b6('0x7')](function(_0x413f04){_0x537706['setDataValue'](_0x43b6('0xb'),_0x413f04[_0x43b6('0xc')]);MailInteractionEvents[_0x43b6('0xd')](_0x2aa435+':'+_0x537706['id'],_0x537706);MailInteractionEvents[_0x43b6('0xd')](_0x2aa435,_0x537706);_0x128a6b(null);})['catch'](_0x128a6b(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x43b6('0xe')](e,emitEvent(event));}}module['exports']=MailInteractionEvents;
\ No newline at end of file
+var _0x64de=['../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','remove','getUsers','setDataValue','Users','length','emit','hasOwnProperty','hook','exports','events'];(function(_0x15af0f,_0x5454ce){var _0x2bd1cb=function(_0x593818){while(--_0x593818){_0x15af0f['push'](_0x15af0f['shift']());}};_0x2bd1cb(++_0x5454ce);}(_0x64de,0x158));var _0xe64d=function(_0xc2b77f,_0x4788ef){_0xc2b77f=_0xc2b77f-0x0;var _0x2cbf84=_0x64de[_0xc2b77f];return _0x2cbf84;};'use strict';var EventEmitter=require(_0xe64d('0x0'));var MailInteraction=require(_0xe64d('0x1'))['db'][_0xe64d('0x2')];var MailMessage=require(_0xe64d('0x1'))['db'][_0xe64d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xe64d('0x4')](0x0);var events={'afterCreate':_0xe64d('0x5'),'afterUpdate':'update','afterDestroy':_0xe64d('0x6')};function emitEvent(_0x26f08e){return function(_0x51dfe8,_0x4c3b99,_0x1f68c9){_0x51dfe8[_0xe64d('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xf2ed88){_0x51dfe8[_0xe64d('0x8')](_0xe64d('0x9'),_0xf2ed88['map'](function(_0x498e77){return{'id':_0x498e77['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x51dfe8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xb92ba2){_0x51dfe8[_0xe64d('0x8')]('unreadMessages',_0xb92ba2[_0xe64d('0xa')]);MailInteractionEvents[_0xe64d('0xb')](_0x26f08e+':'+_0x51dfe8['id'],_0x51dfe8);MailInteractionEvents[_0xe64d('0xb')](_0x26f08e,_0x51dfe8);_0x1f68c9(null);})['catch'](_0x1f68c9(null));};}for(var e in events){if(events[_0xe64d('0xc')](e)){var event=events[e];MailInteraction[_0xe64d('0xd')](e,emitEvent(event));}}module[_0xe64d('0xe')]=MailInteractionEvents;
\ No newline at end of file
index 40eaf5a..a366a0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f33=['rimraf','exports','define','MailInteraction','mail_interactions','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path'];(function(_0x2bebdb,_0x2cb655){var _0x352507=function(_0xe7b08e){while(--_0xe7b08e){_0x2bebdb['push'](_0x2bebdb['shift']());}};_0x352507(++_0x2cb655);}(_0x3f33,0xca));var _0x33f3=function(_0x1b9c27,_0x126fd0){_0x1b9c27=_0x1b9c27-0x0;var _0x34d9c3=_0x3f33[_0x1b9c27];return _0x34d9c3;};'use strict';var _=require('lodash');var util=require(_0x33f3('0x0'));var logger=require(_0x33f3('0x1'))(_0x33f3('0x2'));var moment=require(_0x33f3('0x3'));var BPromise=require('bluebird');var rp=require(_0x33f3('0x4'));var fs=require('fs');var path=require(_0x33f3('0x5'));var rimraf=require(_0x33f3('0x6'));var config=require('../../config/environment');var attributes=require('./mailInteraction.attributes');module[_0x33f3('0x7')]=function(_0x34ffba,_0x4524ad){return _0x34ffba[_0x33f3('0x8')](_0x33f3('0x9'),attributes,{'tableName':_0x33f3('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':['subject','to'],'type':_0x33f3('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1ecde8,_0x5e5a65,_0x30490f){if(_0x1ecde8[_0x33f3('0xc')]){_0x1ecde8[_0x33f3('0xd')]=moment()[_0x33f3('0xe')](_0x33f3('0xf'));}if(_0x1ecde8[_0x33f3('0x10')]){_0x1ecde8[_0x33f3('0x11')]=moment()['format'](_0x33f3('0xf'));}_0x30490f(null,_0x5e5a65);},'beforeUpdate':function(_0x3f9ca3,_0x3539bf,_0x20a3a3){if(_0x3f9ca3[_0x33f3('0x12')](_0x33f3('0xc'))){_0x3f9ca3[_0x33f3('0xd')]=_0x3f9ca3[_0x33f3('0xc')]?moment()[_0x33f3('0xe')](_0x33f3('0xf')):null;}if(_0x3f9ca3[_0x33f3('0x12')](_0x33f3('0x10'))){_0x3f9ca3[_0x33f3('0x11')]=moment()[_0x33f3('0xe')](_0x33f3('0xf'));_0x3f9ca3[_0x33f3('0xc')]=null;_0x3f9ca3[_0x33f3('0xd')]=null;}_0x20a3a3(null,_0x3f9ca3);},'afterUpdate':function(_0x403b14,_0x389999,_0x308151){var _0x505db0=_0x34ffba[_0x33f3('0x13')];var _0x512ee1=_0x403b14['get']({'plain':!![]});if(_0x512ee1[_0x33f3('0x10')]){return _0x505db0[_0x33f3('0x14')][_0x33f3('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x512ee1['id']}})[_0x33f3('0x16')](function(){_0x308151();})[_0x33f3('0x17')](function(_0x3d8018){_0x308151(_0x3d8018);});}else{_0x308151();}}},'charset':_0x33f3('0x18'),'collate':_0x33f3('0x19')});};
\ No newline at end of file
+var _0x1975=['FULLTEXT','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','substatus','models','get','MailMessage','update','catch','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions'];(function(_0x210ebb,_0x19685f){var _0x3c181=function(_0x2ce128){while(--_0x2ce128){_0x210ebb['push'](_0x210ebb['shift']());}};_0x3c181(++_0x19685f);}(_0x1975,0x16c));var _0x5197=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0x1975[_0x43a1b8];return _0x324ecc;};'use strict';var _=require(_0x5197('0x0'));var util=require(_0x5197('0x1'));var logger=require('../../config/logger')(_0x5197('0x2'));var moment=require(_0x5197('0x3'));var BPromise=require(_0x5197('0x4'));var rp=require(_0x5197('0x5'));var fs=require('fs');var path=require(_0x5197('0x6'));var rimraf=require(_0x5197('0x7'));var config=require('../../config/environment');var attributes=require(_0x5197('0x8'));module[_0x5197('0x9')]=function(_0xe1ac81,_0x3f2d82){return _0xe1ac81[_0x5197('0xa')](_0x5197('0xb'),attributes,{'tableName':_0x5197('0xc'),'paranoid':![],'indexes':[{'name':_0x5197('0xd'),'fields':['subject','to'],'type':_0x5197('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x57ff39,_0x1693d3,_0x3784a5){if(_0x57ff39['substatus']){_0x57ff39[_0x5197('0xf')]=moment()[_0x5197('0x10')](_0x5197('0x11'));}if(_0x57ff39[_0x5197('0x12')]){_0x57ff39[_0x5197('0x13')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3784a5(null,_0x1693d3);},'beforeUpdate':function(_0x25afbf,_0xc7be73,_0xf2f737){if(_0x25afbf[_0x5197('0x14')]('substatus')){_0x25afbf['substatusAt']=_0x25afbf['substatus']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x25afbf[_0x5197('0x14')](_0x5197('0x12'))){_0x25afbf[_0x5197('0x13')]=moment()[_0x5197('0x10')](_0x5197('0x11'));_0x25afbf[_0x5197('0x15')]=null;_0x25afbf['substatusAt']=null;}_0xf2f737(null,_0x25afbf);},'afterUpdate':function(_0x20ca57,_0x126a20,_0x1dacb7){var _0x2637c8=_0xe1ac81[_0x5197('0x16')];var _0x3d0b6d=_0x20ca57[_0x5197('0x17')]({'plain':!![]});if(_0x3d0b6d[_0x5197('0x12')]){return _0x2637c8[_0x5197('0x18')][_0x5197('0x19')]({'read':!![]},{'where':{'MailInteractionId':_0x3d0b6d['id']}})['then'](function(){_0x1dacb7();})[_0x5197('0x1a')](function(_0x55bf04){_0x1dacb7(_0x55bf04);});}else{_0x1dacb7();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 4f5a390..787e529 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x724d=['where','UpdateMailInteraction','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailInteraction','update','body','options','raw'];(function(_0x5d9a85,_0x55221e){var _0x1ef8aa=function(_0x5241be){while(--_0x5241be){_0x5d9a85['push'](_0x5d9a85['shift']());}};_0x1ef8aa(++_0x55221e);}(_0x724d,0xe5));var _0xd724=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x724d[_0x2cde0a];return _0x260610;};'use strict';var _=require(_0xd724('0x0'));var util=require(_0xd724('0x1'));var moment=require(_0xd724('0x2'));var BPromise=require('bluebird');var rs=require(_0xd724('0x3'));var fs=require('fs');var Redis=require(_0xd724('0x4'));var db=require(_0xd724('0x5'))['db'];var utils=require(_0xd724('0x6'));var logger=require(_0xd724('0x7'))(_0xd724('0x8'));var config=require(_0xd724('0x9'));var jayson=require(_0xd724('0xa'));var client=jayson[_0xd724('0xb')][_0xd724('0xc')]({'port':0x232a});config[_0xd724('0xd')]=_[_0xd724('0xe')](config[_0xd724('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd724('0xf'))(new Redis(config[_0xd724('0xd')]));require(_0xd724('0x10'))[_0xd724('0x11')](socket);function respondWithRpcPromise(_0x3a4b3f,_0x3cb6bf,_0x4bc78e){return new BPromise(function(_0x20af57,_0x557bb9){return client['request'](_0x3a4b3f,_0x4bc78e)[_0xd724('0x12')](function(_0x188c76){logger[_0xd724('0x13')](_0xd724('0x14'),_0x3cb6bf,_0xd724('0x15'));logger[_0xd724('0x16')](_0xd724('0x17'),_0x3cb6bf,_0xd724('0x15'),JSON[_0xd724('0x18')](_0x188c76));if(_0x188c76[_0xd724('0x19')]){if(_0x188c76[_0xd724('0x19')][_0xd724('0x1a')]===0x1f4){logger[_0xd724('0x19')](_0xd724('0x14'),_0x3cb6bf,_0x188c76[_0xd724('0x19')][_0xd724('0x1b')]);return _0x557bb9(_0x188c76['error'][_0xd724('0x1b')]);}logger[_0xd724('0x19')](_0xd724('0x14'),_0x3cb6bf,_0x188c76[_0xd724('0x19')][_0xd724('0x1b')]);return _0x20af57(_0x188c76[_0xd724('0x19')][_0xd724('0x1b')]);}else{logger[_0xd724('0x13')](_0xd724('0x14'),_0x3cb6bf,_0xd724('0x15'));_0x20af57(_0x188c76[_0xd724('0x1c')][_0xd724('0x1b')]);}})[_0xd724('0x1d')](function(_0xbffe84){logger[_0xd724('0x19')]('MailInteraction,\x20%s,\x20%s',_0x3cb6bf,_0xbffe84);_0x557bb9(_0xbffe84);});});}exports['UpdateMailInteraction']=function(_0x42cf37){var _0x176c55=this;return new Promise(function(_0x9840fd,_0x180411){return db[_0xd724('0x1e')][_0xd724('0x1f')](_0x42cf37[_0xd724('0x20')],{'raw':_0x42cf37[_0xd724('0x21')]?_0x42cf37[_0xd724('0x21')][_0xd724('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42cf37[_0xd724('0x21')]?_0x42cf37[_0xd724('0x21')][_0xd724('0x23')]||null:null,'attributes':_0x42cf37['options']?_0x42cf37[_0xd724('0x21')]['attributes']||null:null,'limit':_0x42cf37[_0xd724('0x21')]?_0x42cf37[_0xd724('0x21')]['limit']||null:null})[_0xd724('0x12')](function(_0x40ce02){logger['info'](_0xd724('0x24'),_0x42cf37);logger[_0xd724('0x16')](_0xd724('0x24'),_0x42cf37,JSON[_0xd724('0x18')](_0x40ce02));_0x9840fd(_0x40ce02);})[_0xd724('0x1d')](function(_0x450abe){logger[_0xd724('0x19')]('UpdateMailInteraction',_0x450abe[_0xd724('0x1b')],_0x42cf37);_0x180411(_0x176c55[_0xd724('0x19')](0x1f4,_0x450abe[_0xd724('0x1b')]));});});};exports[_0xd724('0x25')]=function(_0x425d74){return new Promise(function(_0x3dfb89,_0x26b09a){return db['MailInteraction'][_0xd724('0x26')]({'where':_0x425d74[_0xd724('0x21')]?_0x425d74[_0xd724('0x21')]['where']||null:null})[_0xd724('0x12')](function(_0x308493){if(_0x308493){return _0x308493[_0xd724('0x27')](_0x425d74[_0xd724('0x20')][_0xd724('0x28')],_[_0xd724('0x29')](_0x425d74[_0xd724('0x20')],['ids','id'])||{});}})[_0xd724('0x2a')](function(_0x17263a){logger[_0xd724('0x13')]('AddTags',_0x425d74);logger[_0xd724('0x16')](_0xd724('0x2b'),_0x425d74,JSON['stringify'](_0x17263a));_0x3dfb89(_0x17263a);})['catch'](function(_0x233e8f){logger[_0xd724('0x19')](_0xd724('0x2b'),_0x233e8f[_0xd724('0x1b')],_0x425d74);_0x26b09a(_this['error'](0x1f4,_0x233e8f[_0xd724('0x1b')]));});});};
\ No newline at end of file
+var _0xc963=['addTags','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','info','catch','UpdateMailInteraction','MailInteraction','update','body','options','attributes','then','find','where'];(function(_0x50576d,_0x5cbaa3){var _0x8e7110=function(_0x364226){while(--_0x364226){_0x50576d['push'](_0x50576d['shift']());}};_0x8e7110(++_0x5cbaa3);}(_0xc963,0x17f));var _0x3c96=function(_0xcf5436,_0x4632c3){_0xcf5436=_0xcf5436-0x0;var _0xc4f5c8=_0xc963[_0xcf5436];return _0xc4f5c8;};'use strict';var _=require(_0x3c96('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3c96('0x1'));var rs=require(_0x3c96('0x2'));var fs=require('fs');var Redis=require(_0x3c96('0x3'));var db=require(_0x3c96('0x4'))['db'];var utils=require(_0x3c96('0x5'));var logger=require('../../config/logger')(_0x3c96('0x6'));var config=require(_0x3c96('0x7'));var jayson=require(_0x3c96('0x8'));var client=jayson[_0x3c96('0x9')][_0x3c96('0xa')]({'port':0x232a});config['redis']=_[_0x3c96('0xb')](config[_0x3c96('0xc')],{'host':_0x3c96('0xd'),'port':0x18eb});var socket=require(_0x3c96('0xe'))(new Redis(config[_0x3c96('0xc')]));require(_0x3c96('0xf'))[_0x3c96('0x10')](socket);function respondWithRpcPromise(_0x2e3490,_0x51e375,_0x389618){return new BPromise(function(_0x4d6407,_0x31fa8f){return client[_0x3c96('0x11')](_0x2e3490,_0x389618)['then'](function(_0x4cbf3){logger['info']('MailInteraction,\x20%s,\x20%s',_0x51e375,_0x3c96('0x12'));logger[_0x3c96('0x13')](_0x3c96('0x14'),_0x51e375,_0x3c96('0x12'),JSON[_0x3c96('0x15')](_0x4cbf3));if(_0x4cbf3[_0x3c96('0x16')]){if(_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x17')]===0x1f4){logger[_0x3c96('0x16')](_0x3c96('0x18'),_0x51e375,_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x19')]);return _0x31fa8f(_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x19')]);}logger['error'](_0x3c96('0x18'),_0x51e375,_0x4cbf3[_0x3c96('0x16')]['message']);return _0x4d6407(_0x4cbf3[_0x3c96('0x16')][_0x3c96('0x19')]);}else{logger[_0x3c96('0x1a')](_0x3c96('0x18'),_0x51e375,'request\x20sent');_0x4d6407(_0x4cbf3['result'][_0x3c96('0x19')]);}})[_0x3c96('0x1b')](function(_0x1ce943){logger[_0x3c96('0x16')](_0x3c96('0x18'),_0x51e375,_0x1ce943);_0x31fa8f(_0x1ce943);});});}exports[_0x3c96('0x1c')]=function(_0x15aa1d){var _0xa1abd4=this;return new Promise(function(_0x4eca85,_0x363a60){return db[_0x3c96('0x1d')][_0x3c96('0x1e')](_0x15aa1d[_0x3c96('0x1f')],{'raw':_0x15aa1d[_0x3c96('0x20')]?_0x15aa1d[_0x3c96('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15aa1d[_0x3c96('0x20')]?_0x15aa1d[_0x3c96('0x20')]['where']||null:null,'attributes':_0x15aa1d[_0x3c96('0x20')]?_0x15aa1d[_0x3c96('0x20')][_0x3c96('0x21')]||null:null,'limit':_0x15aa1d[_0x3c96('0x20')]?_0x15aa1d[_0x3c96('0x20')]['limit']||null:null})[_0x3c96('0x22')](function(_0x5d5145){logger[_0x3c96('0x1a')](_0x3c96('0x1c'),_0x15aa1d);logger[_0x3c96('0x13')](_0x3c96('0x1c'),_0x15aa1d,JSON[_0x3c96('0x15')](_0x5d5145));_0x4eca85(_0x5d5145);})[_0x3c96('0x1b')](function(_0x390e85){logger['error'](_0x3c96('0x1c'),_0x390e85['message'],_0x15aa1d);_0x363a60(_0xa1abd4[_0x3c96('0x16')](0x1f4,_0x390e85['message']));});});};exports['AddTagsToMailInteraction']=function(_0x253cf0){return new Promise(function(_0x3a237e,_0x76c23c){return db[_0x3c96('0x1d')][_0x3c96('0x23')]({'where':_0x253cf0[_0x3c96('0x20')]?_0x253cf0[_0x3c96('0x20')][_0x3c96('0x24')]||null:null})[_0x3c96('0x22')](function(_0x1e9206){if(_0x1e9206){return _0x1e9206[_0x3c96('0x25')](_0x253cf0[_0x3c96('0x1f')][_0x3c96('0x26')],_[_0x3c96('0x27')](_0x253cf0['body'],[_0x3c96('0x26'),'id'])||{});}})[_0x3c96('0x28')](function(_0x22e8e1){logger['info'](_0x3c96('0x29'),_0x253cf0);logger[_0x3c96('0x13')]('AddTags',_0x253cf0,JSON[_0x3c96('0x15')](_0x22e8e1));_0x3a237e(_0x22e8e1);})[_0x3c96('0x1b')](function(_0x511cfa){logger[_0x3c96('0x16')](_0x3c96('0x29'),_0x511cfa[_0x3c96('0x19')],_0x253cf0);_0x76c23c(_this[_0x3c96('0x16')](0x1f4,_0x511cfa[_0x3c96('0x19')]));});});};
\ No newline at end of file
index f0c06d6..3b63355 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0861=['length','mailInteraction:','./mailInteraction.events','emit','register'];(function(_0x3ef249,_0x3da5d2){var _0x2f26ee=function(_0x462d8f){while(--_0x462d8f){_0x3ef249['push'](_0x3ef249['shift']());}};_0x2f26ee(++_0x3da5d2);}(_0x0861,0x156));var _0x1086=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x0861[_0x2be8c2];return _0x97f531;};'use strict';var MailInteractionEvents=require(_0x1086('0x0'));var events=['save','remove','update'];function createListener(_0x559f08,_0x2c11da){return function(_0x3282d2){_0x2c11da[_0x1086('0x1')](_0x559f08,_0x3282d2);};}function removeListener(_0x478e47,_0x2583ca){return function(){MailInteractionEvents['removeListener'](_0x478e47,_0x2583ca);};}exports[_0x1086('0x2')]=function(_0x538365){for(var _0x3820c2=0x0,_0x293493=events[_0x1086('0x3')];_0x3820c2<_0x293493;_0x3820c2++){var _0x128ab0=events[_0x3820c2];var _0x28bab4=createListener(_0x1086('0x4')+_0x128ab0,_0x538365);MailInteractionEvents['on'](_0x128ab0,_0x28bab4);}};
\ No newline at end of file
+var _0xee92=['mailInteraction:','./mailInteraction.events','remove','update','removeListener','register','length'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xee92,0xf6));var _0x2ee9=function(_0x5c3be9,_0x1c287a){_0x5c3be9=_0x5c3be9-0x0;var _0x37d54d=_0xee92[_0x5c3be9];return _0x37d54d;};'use strict';var MailInteractionEvents=require(_0x2ee9('0x0'));var events=['save',_0x2ee9('0x1'),_0x2ee9('0x2')];function createListener(_0x522e8a,_0x36cbab){return function(_0x4c94f6){_0x36cbab['emit'](_0x522e8a,_0x4c94f6);};}function removeListener(_0x169fd9,_0x1861aa){return function(){MailInteractionEvents[_0x2ee9('0x3')](_0x169fd9,_0x1861aa);};}exports[_0x2ee9('0x4')]=function(_0x1faed0){for(var _0x2478db=0x0,_0x24411d=events[_0x2ee9('0x5')];_0x2478db<_0x24411d;_0x2478db++){var _0x5d3219=events[_0x2478db];var _0x9ab3d1=createListener(_0x2ee9('0x6')+_0x5d3219,_0x1faed0);MailInteractionEvents['on'](_0x5d3219,_0x9ab3d1);}};
\ No newline at end of file
index 8a61304..56209cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5e5=['/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x203afb,_0x296ee2){var _0x50cf12=function(_0xa1e23a){while(--_0xa1e23a){_0x203afb['push'](_0x203afb['shift']());}};_0x50cf12(++_0x296ee2);}(_0xd5e5,0x187));var _0x5d5e=function(_0x2721fc,_0x5c7a3e){_0x2721fc=_0x2721fc-0x0;var _0x33d65c=_0xd5e5[_0x2721fc];return _0x33d65c;};'use strict';var multer=require('multer');var util=require(_0x5d5e('0x0'));var path=require('path');var timeout=require(_0x5d5e('0x1'));var express=require('express');var router=express[_0x5d5e('0x2')]();var fs_extra=require(_0x5d5e('0x3'));var auth=require(_0x5d5e('0x4'));var interaction=require(_0x5d5e('0x5'));var config=require(_0x5d5e('0x6'));var controller=require(_0x5d5e('0x7'));router[_0x5d5e('0x8')]('/',auth['isAuthenticated'](),controller[_0x5d5e('0x9')]);router[_0x5d5e('0x8')](_0x5d5e('0xa'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0xc')]);router[_0x5d5e('0x8')](_0x5d5e('0xd'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0xe')]);router['get'](_0x5d5e('0xf'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x10')]);router[_0x5d5e('0x11')]('/',auth[_0x5d5e('0xb')](),interaction[_0x5d5e('0x12')](_0x5d5e('0x13'),_0x5d5e('0x14')),controller[_0x5d5e('0x15')]);router[_0x5d5e('0x16')](_0x5d5e('0xd'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x17')]);router[_0x5d5e('0x16')](_0x5d5e('0x18'),auth[_0x5d5e('0xb')](),controller[_0x5d5e('0x19')]);router[_0x5d5e('0x16')](_0x5d5e('0x1a'),auth['isAuthenticated'](),controller['reject']);router[_0x5d5e('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x5d5e('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x95c5=['./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x95c5,0x153));var _0x595c=function(_0x36de10,_0xfe25e8){_0x36de10=_0x36de10-0x0;var _0x58100f=_0x95c5[_0x36de10];return _0x58100f;};'use strict';var multer=require(_0x595c('0x0'));var util=require(_0x595c('0x1'));var path=require('path');var timeout=require(_0x595c('0x2'));var express=require(_0x595c('0x3'));var router=express[_0x595c('0x4')]();var fs_extra=require(_0x595c('0x5'));var auth=require(_0x595c('0x6'));var interaction=require(_0x595c('0x7'));var config=require(_0x595c('0x8'));var controller=require(_0x595c('0x9'));router[_0x595c('0xa')]('/',auth[_0x595c('0xb')](),controller['index']);router['get'](_0x595c('0xc'),auth[_0x595c('0xb')](),controller[_0x595c('0xd')]);router[_0x595c('0xa')](_0x595c('0xe'),auth[_0x595c('0xb')](),controller[_0x595c('0xf')]);router[_0x595c('0xa')](_0x595c('0x10'),auth['isAuthenticated'](),controller[_0x595c('0x11')]);router[_0x595c('0x12')]('/',auth[_0x595c('0xb')](),interaction['tracked'](_0x595c('0x13'),_0x595c('0x14')),controller[_0x595c('0x15')]);router[_0x595c('0x16')](_0x595c('0xe'),auth[_0x595c('0xb')](),controller[_0x595c('0x17')]);router[_0x595c('0x16')](_0x595c('0x18'),auth[_0x595c('0xb')](),controller[_0x595c('0x19')]);router[_0x595c('0x16')](_0x595c('0x1a'),auth[_0x595c('0xb')](),controller['reject']);router[_0x595c('0x1b')](_0x595c('0xe'),auth[_0x595c('0xb')](),controller[_0x595c('0x1c')]);module['exports']=router;
\ No newline at end of file
index db36c59..ac221a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9b4=['DATE','Email','Chat','lodash','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','INTEGER'];(function(_0x1298d1,_0x3d46a5){var _0x4d641e=function(_0x57ad42){while(--_0x57ad42){_0x1298d1['push'](_0x1298d1['shift']());}};_0x4d641e(++_0x3d46a5);}(_0xe9b4,0x1f1));var _0x4e9b=function(_0x83f606,_0x136187){_0x83f606=_0x83f606-0x0;var _0x4277e9=_0xe9b4[_0x83f606];return _0x4277e9;};'use strict';var Sequelize=require('sequelize');var _=require(_0x4e9b('0x0'));module[_0x4e9b('0x1')]={'body':{'type':Sequelize[_0x4e9b('0x2')](_0x4e9b('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4e9b('0x2')](_0x4e9b('0x4'))},'read':{'type':Sequelize[_0x4e9b('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4e9b('0x6')]('in',_0x4e9b('0x7')),'defaultValue':_0x4e9b('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x4e9b('0x8')](0x1fe)},'from':{'type':Sequelize[_0x4e9b('0x8')]},'to':{'type':Sequelize['TEXT']('long')},'cc':{'type':Sequelize[_0x4e9b('0x2')](_0x4e9b('0x3'))},'bcc':{'type':Sequelize['TEXT'](_0x4e9b('0x3'))},'subject':{'type':Sequelize[_0x4e9b('0x2')]},'sentAt':{'type':Sequelize['DATE']},'attach':{'type':Sequelize[_0x4e9b('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4e9b('0xa')]},'originTo':{'type':Sequelize[_0x4e9b('0x2')](_0x4e9b('0x3'))},'originCc':{'type':Sequelize[_0x4e9b('0x2')](_0x4e9b('0x3'))},'originChannel':{'type':Sequelize[_0x4e9b('0x6')](_0x4e9b('0xb'),_0x4e9b('0xc')),'defaultValue':_0x4e9b('0xb'),'allowNull':![]}};
\ No newline at end of file
+var _0xce38=['exports','TEXT','long','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','lodash'];(function(_0x541f0c,_0x1761c4){var _0x15ba48=function(_0x4b0f6c){while(--_0x4b0f6c){_0x541f0c['push'](_0x541f0c['shift']());}};_0x15ba48(++_0x1761c4);}(_0xce38,0x8d));var _0x8ce3=function(_0x1b857f,_0x286e31){_0x1b857f=_0x1b857f-0x0;var _0x5582e9=_0xce38[_0x1b857f];return _0x5582e9;};'use strict';var Sequelize=require(_0x8ce3('0x0'));var _=require(_0x8ce3('0x1'));module[_0x8ce3('0x2')]={'body':{'type':Sequelize[_0x8ce3('0x3')](_0x8ce3('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8ce3('0x3')]('medium')},'read':{'type':Sequelize[_0x8ce3('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8ce3('0x6')]('in',_0x8ce3('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x8ce3('0x8')](0x1fe)},'from':{'type':Sequelize[_0x8ce3('0x8')]},'to':{'type':Sequelize[_0x8ce3('0x3')]('long')},'cc':{'type':Sequelize[_0x8ce3('0x3')](_0x8ce3('0x4'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize[_0x8ce3('0x3')]},'sentAt':{'type':Sequelize[_0x8ce3('0x9')]},'attach':{'type':Sequelize[_0x8ce3('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x8ce3('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8ce3('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x8ce3('0x4'))},'originCc':{'type':Sequelize[_0x8ce3('0x3')](_0x8ce3('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0x8ce3('0xb'),_0x8ce3('0xc')),'defaultValue':_0x8ce3('0xb'),'allowNull':![]}};
\ No newline at end of file
index cc08afe..c90cdcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['params','describe','create','secret','split','MailAccount','MailAccountId','List','CmContact','updatedAt','DESC','MailServerOut','Smtp','isNil','port','secure','authentication','auth','service','user','pass','attachments','join','server/files/attachments','defaults','ListId','List\x20not\x20found','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','agent','UserId','MailInteraction','MailInteractionId','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','sequelize','Sequelize','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','reject','fromString','rejectmessage','unix','toString','root','server','files','tmp','message-%s.eml','from','subject','createdAt','headers','bcc','Bcc','Attachments','basename','existsSync','readFileSync','build','download','unlinkSync','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../config/environment','redis','localhost','socket.io-emitter','register','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','json','undefined','limit','count','offset','Content-Range','update','then','destroy','status','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','filters','find','body'];(function(_0x5ee78d,_0x5022b9){var _0x39bbc6=function(_0x1d5195){while(--_0x1d5195){_0x5ee78d['push'](_0x5ee78d['shift']());}};_0x39bbc6(++_0x5022b9);}(_0xedd9,0xfc));var _0x9edd=function(_0xadb124,_0x323df7){_0xadb124=_0xadb124-0x0;var _0x1bf490=_0xedd9[_0xadb124];return _0x1bf490;};'use strict';var emlformat=require('eml-format');var moment=require(_0x9edd('0x0'));var BPromise=require(_0x9edd('0x1'));var util=require(_0x9edd('0x2'));var path=require(_0x9edd('0x3'));var fs=require('fs');var _=require(_0x9edd('0x4'));var Redis=require(_0x9edd('0x5'));var htmlToText=require(_0x9edd('0x6'));var qs=require(_0x9edd('0x7'));var logger=require('../../config/logger')(_0x9edd('0x8'));var interaction_log=require(_0x9edd('0x9'))(_0x9edd('0xa'));var config=require(_0x9edd('0xb'));var db=require('../../mysqldb')['db'];config[_0x9edd('0xc')]=_['defaults'](config[_0x9edd('0xc')],{'host':_0x9edd('0xd'),'port':0x18eb});var socket=require(_0x9edd('0xe'))(new Redis(config[_0x9edd('0xc')]));require('./mailMessage.socket')[_0x9edd('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9edd('0x10')][_0x9edd('0x11')]({'port':0x232c});var client9003=jayson['client'][_0x9edd('0x11')]({'port':0x232b});var client9002=jayson[_0x9edd('0x10')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30c0d7,_0x1b73d1,_0x25e64c,_0xfd544a){return new BPromise(function(_0x287ddd,_0x3a7b84){var _0xfca576=_0xfd544a||client;return _0xfca576[_0x9edd('0x12')](_0x30c0d7,_0x25e64c)['then'](function(_0x176bfa){logger[_0x9edd('0x13')](_0x9edd('0x14'),_0x1b73d1,_0x9edd('0x15'));logger[_0x9edd('0x16')](_0x9edd('0x17'),_0x1b73d1,_0x9edd('0x15'),JSON[_0x9edd('0x18')](_0x176bfa));if(_0x176bfa['error']){if(_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1a')]===0x1f4){logger[_0x9edd('0x19')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x3a7b84(_0x176bfa[_0x9edd('0x19')]['message']);}logger[_0x9edd('0x19')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x176bfa[_0x9edd('0x19')][_0x9edd('0x1b')]);return _0x287ddd(_0x176bfa['error']['message']);}else{logger[_0x9edd('0x13')]('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x9edd('0x15'));_0x287ddd(_0x176bfa['result']['message']);}})[_0x9edd('0x1c')](function(_0x1c46a8){logger['error']('MailMessage,\x20%s,\x20%s',_0x1b73d1,_0x1c46a8);_0x3a7b84(_0x1c46a8);});});}function respondWithResult(_0x341d67,_0x186186){_0x186186=_0x186186||0xc8;return function(_0x477878){if(_0x477878){return _0x341d67['status'](_0x186186)[_0x9edd('0x1d')](_0x477878);}};}function respondWithFilteredResult(_0x1dca43,_0x44a6c1){return function(_0x2ca65f){if(_0x2ca65f){var _0x339a0d=typeof _0x44a6c1['offset']===_0x9edd('0x1e')&&typeof _0x44a6c1[_0x9edd('0x1f')]===_0x9edd('0x1e');var _0x2f9f86=_0x2ca65f[_0x9edd('0x20')];var _0x4d507f=_0x339a0d?0x0:_0x44a6c1['offset'];var _0x3276ee=_0x339a0d?_0x2ca65f[_0x9edd('0x20')]:_0x44a6c1[_0x9edd('0x21')]+_0x44a6c1[_0x9edd('0x1f')];var _0x3c2227;if(_0x3276ee>=_0x2f9f86){_0x3276ee=_0x2f9f86;_0x3c2227=0xc8;}else{_0x3c2227=0xce;}_0x1dca43['status'](_0x3c2227);return _0x1dca43['set'](_0x9edd('0x22'),_0x4d507f+'-'+_0x3276ee+'/'+_0x2f9f86)[_0x9edd('0x1d')](_0x2ca65f);}return null;};}function saveUpdates(_0x1c762c){return function(_0x52746a){if(_0x52746a){return _0x52746a[_0x9edd('0x23')](_0x1c762c)[_0x9edd('0x24')](function(_0x2ae8dd){return _0x2ae8dd;});}return null;};}function removeEntity(_0x41af53){return function(_0x5eccfb){if(_0x5eccfb){return _0x5eccfb[_0x9edd('0x25')]()[_0x9edd('0x24')](function(){_0x41af53[_0x9edd('0x26')](0xcc)[_0x9edd('0x27')]();});}};}function handleEntityNotFound(_0xbbf08f){return function(_0x42e664){if(!_0x42e664){_0xbbf08f[_0x9edd('0x28')](0x194);}return _0x42e664;};}function handleError(_0x1fba7b,_0x19b6c1){_0x19b6c1=_0x19b6c1||0x1f4;return function(_0x1c2e2b){logger[_0x9edd('0x19')](_0x1c2e2b[_0x9edd('0x29')]);if(_0x1c2e2b[_0x9edd('0x2a')]){delete _0x1c2e2b[_0x9edd('0x2a')];}_0x1fba7b[_0x9edd('0x26')](_0x19b6c1)['send'](_0x1c2e2b);};}exports[_0x9edd('0x2b')]=function(_0x259259,_0x267c74){var _0x5d1707={},_0x2d2f88={},_0x3990fb={'count':0x0,'rows':[]};var _0xde9b13=_[_0x9edd('0x2c')](db[_0x9edd('0x2d')][_0x9edd('0x2e')],function(_0x473068){return{'name':_0x473068[_0x9edd('0x2f')],'type':_0x473068[_0x9edd('0x30')][_0x9edd('0x31')]};});_0x2d2f88[_0x9edd('0x32')]=_[_0x9edd('0x2c')](_0xde9b13,_0x9edd('0x2a'));_0x2d2f88[_0x9edd('0x33')]=_['keys'](_0x259259[_0x9edd('0x33')]);_0x2d2f88['filters']=_[_0x9edd('0x34')](_0x2d2f88[_0x9edd('0x32')],_0x2d2f88[_0x9edd('0x33')]);_0x5d1707[_0x9edd('0x35')]=_[_0x9edd('0x34')](_0x2d2f88['model'],qs[_0x9edd('0x36')](_0x259259[_0x9edd('0x33')][_0x9edd('0x36')]));_0x5d1707[_0x9edd('0x35')]=_0x5d1707[_0x9edd('0x35')][_0x9edd('0x37')]?_0x5d1707[_0x9edd('0x35')]:_0x2d2f88[_0x9edd('0x32')];if(!_0x259259[_0x9edd('0x33')][_0x9edd('0x38')]('nolimit')){_0x5d1707[_0x9edd('0x1f')]=qs['limit'](_0x259259[_0x9edd('0x33')]['limit']);_0x5d1707[_0x9edd('0x21')]=qs[_0x9edd('0x21')](_0x259259[_0x9edd('0x33')]['offset']);}_0x5d1707[_0x9edd('0x39')]=qs[_0x9edd('0x3a')](_0x259259[_0x9edd('0x33')]['sort']);_0x5d1707[_0x9edd('0x3b')]=qs['filters'](_[_0x9edd('0x3c')](_0x259259[_0x9edd('0x33')],_0x2d2f88['filters']),_0xde9b13);if(_0x259259[_0x9edd('0x33')][_0x9edd('0x3d')]){_0x5d1707[_0x9edd('0x3b')]=_[_0x9edd('0x3e')](_0x5d1707['where'],{'$or':_[_0x9edd('0x2c')](_0xde9b13,function(_0x5bbdf8){if(_0x5bbdf8[_0x9edd('0x30')]!==_0x9edd('0x3f')){var _0x587d74={};_0x587d74[_0x5bbdf8[_0x9edd('0x2a')]]={'$like':'%'+_0x259259['query']['filter']+'%'};return _0x587d74;}})});}_0x5d1707=_[_0x9edd('0x3e')]({},_0x5d1707,_0x259259[_0x9edd('0x40')]);var _0x1f276b={'where':_0x5d1707[_0x9edd('0x3b')]};return db[_0x9edd('0x2d')][_0x9edd('0x20')](_0x1f276b)[_0x9edd('0x24')](function(_0x75efbe){_0x3990fb[_0x9edd('0x20')]=_0x75efbe;if(_0x259259[_0x9edd('0x33')][_0x9edd('0x41')]){_0x5d1707[_0x9edd('0x42')]=[{'all':!![]}];}return db[_0x9edd('0x2d')][_0x9edd('0x43')](_0x5d1707);})[_0x9edd('0x24')](function(_0x5416f8){_0x3990fb[_0x9edd('0x44')]=_0x5416f8;return _0x3990fb;})[_0x9edd('0x24')](respondWithFilteredResult(_0x267c74,_0x5d1707))[_0x9edd('0x1c')](handleError(_0x267c74,null));};exports[_0x9edd('0x45')]=function(_0x241929,_0x3ecdfd){var _0x10d41e={'raw':!![],'where':{'id':_0x241929['params']['id']}},_0x4e9ad1={};_0x4e9ad1['model']=_[_0x9edd('0x46')](db['MailMessage'][_0x9edd('0x2e')]);_0x4e9ad1[_0x9edd('0x33')]=_[_0x9edd('0x46')](_0x241929[_0x9edd('0x33')]);_0x4e9ad1[_0x9edd('0x47')]=_['intersection'](_0x4e9ad1[_0x9edd('0x32')],_0x4e9ad1[_0x9edd('0x33')]);_0x10d41e[_0x9edd('0x35')]=_['intersection'](_0x4e9ad1[_0x9edd('0x32')],qs[_0x9edd('0x36')](_0x241929[_0x9edd('0x33')][_0x9edd('0x36')]));_0x10d41e[_0x9edd('0x35')]=_0x10d41e[_0x9edd('0x35')]['length']?_0x10d41e[_0x9edd('0x35')]:_0x4e9ad1[_0x9edd('0x32')];if(_0x241929['query'][_0x9edd('0x41')]){_0x10d41e[_0x9edd('0x42')]=[{'all':!![]}];}_0x10d41e=_['merge']({},_0x10d41e,_0x241929[_0x9edd('0x40')]);return db[_0x9edd('0x2d')][_0x9edd('0x48')](_0x10d41e)['then'](handleEntityNotFound(_0x3ecdfd,null))[_0x9edd('0x24')](respondWithResult(_0x3ecdfd,null))[_0x9edd('0x1c')](handleError(_0x3ecdfd,null));};exports[_0x9edd('0x23')]=function(_0x28c7bd,_0x53f6e3){if(_0x28c7bd[_0x9edd('0x49')]['id']){delete _0x28c7bd[_0x9edd('0x49')]['id'];}return db[_0x9edd('0x2d')]['find']({'where':{'id':_0x28c7bd[_0x9edd('0x4a')]['id']}})[_0x9edd('0x24')](handleEntityNotFound(_0x53f6e3,null))['then'](saveUpdates(_0x28c7bd[_0x9edd('0x49')],null))['then'](respondWithResult(_0x53f6e3,null))[_0x9edd('0x1c')](handleError(_0x53f6e3,null));};exports[_0x9edd('0x25')]=function(_0x24245f,_0x3fcdf5){return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0x24245f[_0x9edd('0x4a')]['id']}})[_0x9edd('0x24')](handleEntityNotFound(_0x3fcdf5,null))[_0x9edd('0x24')](removeEntity(_0x3fcdf5,null))[_0x9edd('0x1c')](handleError(_0x3fcdf5,null));};exports[_0x9edd('0x4b')]=function(_0x5a3b1d,_0x161bea){return db[_0x9edd('0x2d')][_0x9edd('0x4b')]()['then'](respondWithResult(_0x161bea,null))[_0x9edd('0x1c')](handleError(_0x161bea,null));};exports['create']=function(_0x54d83d,_0x54ecfa){return db[_0x9edd('0x2d')][_0x9edd('0x4c')](_0x54d83d[_0x9edd('0x49')])[_0x9edd('0x24')](function(_0x48a900){if(_0x48a900){if(_0x48a900['direction']==='out'&&!_0x48a900[_0x9edd('0x4d')]){var _0x5f666b,_0xd5090a,_0x1091ff;if(_0x54d83d[_0x9edd('0x49')]['to']){_0xd5090a=_0x54d83d[_0x9edd('0x49')]['to'][_0x9edd('0x4e')](',')[0x0];}return db[_0x9edd('0x4f')]['findOne']({'where':{'id':_0x48a900[_0x9edd('0x50')]},'include':[{'model':db['CmList'],'as':_0x9edd('0x51'),'include':[{'model':db[_0x9edd('0x52')],'as':'Contacts','where':{'email':_0xd5090a},'limit':0x1,'order':[[_0x9edd('0x53'),_0x9edd('0x54')]]}]},{'model':db[_0x9edd('0x55')],'as':'Smtp','raw':!![]}]})[_0x9edd('0x24')](function(_0x2e1ce3){_0x5f666b=_0x2e1ce3;if(_0x5f666b&&_0x5f666b[_0x9edd('0x56')]){var _0x15ebfa={'tls':{'rejectUnauthorized':![]}};if(_[_0x9edd('0x57')](_0x5f666b[_0x9edd('0x56')]['service'])){_0x15ebfa['host']=_0x5f666b[_0x9edd('0x56')]['host'];_0x15ebfa[_0x9edd('0x58')]=_0x5f666b[_0x9edd('0x56')][_0x9edd('0x58')];_0x15ebfa[_0x9edd('0x59')]=_0x5f666b['Smtp'][_0x9edd('0x59')];if(_0x5f666b['Smtp'][_0x9edd('0x5a')]){_0x15ebfa[_0x9edd('0x5b')]={'user':_0x5f666b[_0x9edd('0x56')]['user'],'pass':_0x5f666b[_0x9edd('0x56')]['pass']};}}else{_0x15ebfa[_0x9edd('0x5c')]=_0x5f666b[_0x9edd('0x56')]['service'];_0x15ebfa[_0x9edd('0x5b')]={'user':_0x5f666b['Smtp'][_0x9edd('0x5d')],'pass':_0x5f666b[_0x9edd('0x56')][_0x9edd('0x5e')]};_0x15ebfa['secure']=_0x5f666b[_0x9edd('0x56')][_0x9edd('0x59')];}if(_0x54d83d[_0x9edd('0x49')][_0x9edd('0x5f')]&&_0x54d83d[_0x9edd('0x49')]['attachments']['length']){for(var _0x2e1a96=0x0;_0x2e1a96<_0x54d83d[_0x9edd('0x49')]['attachments']['length'];_0x2e1a96+=0x1){_0x54d83d['body'][_0x9edd('0x5f')][_0x2e1a96]={'filename':_0x54d83d['body']['attachments'][_0x2e1a96][_0x9edd('0x2a')],'path':path[_0x9edd('0x60')](config['root'],_0x9edd('0x61'),_0x54d83d[_0x9edd('0x49')][_0x9edd('0x5f')][_0x2e1a96]['basename'])};}}_0x1091ff={'account':_0x15ebfa,'message':_0x54d83d[_0x9edd('0x49')]};return;}})['then'](function(){if(_0x5f666b[_0x9edd('0x51')]){if(_0x5f666b[_0x9edd('0x51')]['Contacts'][_0x9edd('0x37')]){return _0x5f666b[_0x9edd('0x51')]['Contacts'][0x0];}else{return db[_0x9edd('0x52')][_0x9edd('0x4c')](_[_0x9edd('0x62')](_0x54d83d[_0x9edd('0x49')],{'firstName':_0x54d83d['body']['to'],'email':_0x54d83d[_0x9edd('0x49')]['to'],'phone':_0x54d83d['body']['to'],'ListId':_0x5f666b[_0x9edd('0x63')]}));}}else{throw new Error(_0x9edd('0x64'));}})[_0x9edd('0x24')](function(){if(_0x1091ff){return respondWithRpcPromise('SendMail',_0x9edd('0x65'),_0x1091ff,client9003)[_0x9edd('0x24')](function(_0x130dba){return _0x48a900[_0x9edd('0x23')]({'read':!![],'messageId':_0x130dba[_0x9edd('0x66')],'sentAt':moment()[_0x9edd('0x67')](_0x9edd('0x68'))});})['catch'](function(_0x5e29d0){logger[_0x9edd('0x19')]('%s',JSON[_0x9edd('0x18')](_0x5e29d0));return _0x48a900;});}return _0x48a900;});}return _0x48a900;}})[_0x9edd('0x24')](respondWithResult(_0x54ecfa,0xc9))[_0x9edd('0x1c')](handleError(_0x54ecfa,null));};exports[_0x9edd('0x69')]=function(_0x52f6f3,_0x2e40c8){var _0x5d56a={'agent':{},'channel':_0x9edd('0x6a')};if(_0x52f6f3['body']['id']){delete _0x52f6f3[_0x9edd('0x49')]['id'];}_0x52f6f3[_0x9edd('0x49')]['read']=!![];_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6b')]=moment()['format'](_0x9edd('0x68'));_0x52f6f3[_0x9edd('0x49')]['UserId']=_0x52f6f3[_0x9edd('0x49')]['UserId']||_0x52f6f3['user']['id'];_0x5d56a[_0x9edd('0x6c')]['id']=_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')];return db['MailMessage'][_0x9edd('0x48')]({'where':{'id':_0x52f6f3[_0x9edd('0x4a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2e40c8,null))[_0x9edd('0x24')](saveUpdates(_0x52f6f3[_0x9edd('0x49')],null))[_0x9edd('0x24')](function(_0x1ad198){if(_0x1ad198){_0x5d56a['message']=_0x1ad198['get']({'plain':!![]});return db[_0x9edd('0x6e')]['find']({'where':{'id':_0x1ad198[_0x9edd('0x6f')]}});}return null;})[_0x9edd('0x24')](handleEntityNotFound(_0x2e40c8,null))[_0x9edd('0x24')](function(_0x3cfd35){if(_0x3cfd35){return _0x3cfd35[_0x9edd('0x23')]({'UserId':_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')],'read1stAt':_[_0x9edd('0x57')](_0x3cfd35[_0x9edd('0x70')])?moment()['format'](_0x9edd('0x68')):undefined});}return null;})[_0x9edd('0x24')](function(_0x2c7562){if(_0x2c7562){_0x5d56a[_0x9edd('0x71')]=_0x2c7562[_0x9edd('0x72')]({'plain':!![]});interaction_log[_0x9edd('0x13')](_0x9edd('0x73'),_0x52f6f3['user']['id'],_0x52f6f3[_0x9edd('0x5d')][_0x9edd('0x2a')],_0x52f6f3['user'][_0x9edd('0x74')],_0x5d56a[_0x9edd('0x71')]['id'],_0x52f6f3['body']?JSON[_0x9edd('0x18')](_0x52f6f3[_0x9edd('0x49')]):_0x9edd('0x75'));return respondWithRpcPromise('AcceptMessage',_0x9edd('0x76'),_0x5d56a);}return null;})[_0x9edd('0x24')](function(_0x3f04d3){var _0x5a7de3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3f04d3['message']['ContactId'];return db[_0x9edd('0x77')][_0x9edd('0x33')](_0x5a7de3,{'type':db[_0x9edd('0x78')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x56d794){return _0x56d794;});})[_0x9edd('0x24')](function(_0x20762d){if(_0x20762d){_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x79')]=_0x20762d[0x0];if(!_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')])return;return db[_0x9edd('0x7a')][_0x9edd('0x48')]({'where':{'id':_0x52f6f3[_0x9edd('0x49')][_0x9edd('0x6d')],'role':_0x9edd('0x6c')},'attributes':['id','name',_0x9edd('0x7b'),_0x9edd('0x7c'),_0x9edd('0x7d')],'raw':!![]});}return null;})[_0x9edd('0x24')](function(_0x104afc){if(!_0x104afc)return null;_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x6c')]=_0x104afc;return _0x5d56a;})[_0x9edd('0x24')](function(_0x4a7889){if(_0x4a7889){if(_0x52f6f3['body'][_0x9edd('0x7e')]){_0x5d56a['message'][_0x9edd('0x7f')]=util['format'](_0x9edd('0x80'),_0x52f6f3[_0x9edd('0x5d')]['name']);_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x81')]=_0x5d56a['channel'];_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x82')]=_0x9edd('0x69');_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x49')]=htmlToText['fromString'](_0x5d56a[_0x9edd('0x1b')][_0x9edd('0x49')]);return respondWithRpcPromise(_0x9edd('0x83'),_0x9edd('0x83'),{'event':_0x9edd('0x84'),'message':_0x5d56a['message']},client9002)['then'](function(){return _0x5d56a;});}return _0x5d56a;}return null;})['then'](respondWithResult(_0x2e40c8,null))['catch'](handleError(_0x2e40c8,null));};exports['reject']=function(_0x2da088,_0x5d566e){var _0x58cb3f={'agent':{},'channel':_0x9edd('0x6a')};if(_0x2da088[_0x9edd('0x49')]['id']){delete _0x2da088[_0x9edd('0x49')]['id'];}_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')]=_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')]||_0x2da088[_0x9edd('0x5d')]['id'];_0x58cb3f[_0x9edd('0x6c')]['id']=_0x2da088[_0x9edd('0x49')]['UserId'];return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0x2da088[_0x9edd('0x4a')]['id'],'UserId':null}})[_0x9edd('0x24')](handleEntityNotFound(_0x5d566e,null))[_0x9edd('0x24')](function(_0x23e925){if(_0x23e925){_0x58cb3f[_0x9edd('0x1b')]=_0x23e925[_0x9edd('0x72')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x23e925[_0x9edd('0x6f')]}});}return null;})[_0x9edd('0x24')](handleEntityNotFound(_0x5d566e,null))[_0x9edd('0x24')](function(_0x120d0f){if(_0x120d0f){_0x58cb3f[_0x9edd('0x71')]=_0x120d0f[_0x9edd('0x72')]({'plain':!![]});interaction_log[_0x9edd('0x13')](_0x9edd('0x85'),_0x2da088[_0x9edd('0x5d')]['id'],_0x2da088[_0x9edd('0x5d')][_0x9edd('0x2a')],_0x2da088[_0x9edd('0x5d')][_0x9edd('0x74')],_0x58cb3f[_0x9edd('0x71')]['id'],_0x2da088['body']?JSON[_0x9edd('0x18')](_0x2da088[_0x9edd('0x49')]):'null');return respondWithRpcPromise(_0x9edd('0x86'),_0x9edd('0x87'),_0x58cb3f);}return null;})[_0x9edd('0x24')](function(_0x2b4d4c){var _0x559503=_0x9edd('0x88')+_0x2b4d4c[_0x9edd('0x1b')][_0x9edd('0x89')];return db[_0x9edd('0x77')][_0x9edd('0x33')](_0x559503,{'type':db['Sequelize'][_0x9edd('0x8a')][_0x9edd('0x8b')],'raw':!![]})[_0x9edd('0x24')](function(_0x4633eb){return _0x4633eb;});})[_0x9edd('0x24')](function(_0x59927d){if(_0x59927d){_0x58cb3f['message'][_0x9edd('0x79')]=_0x59927d[0x0];if(!_0x2da088['body'][_0x9edd('0x6d')])return;return db['User'][_0x9edd('0x48')]({'where':{'id':_0x2da088[_0x9edd('0x49')][_0x9edd('0x6d')],'role':_0x9edd('0x6c')},'attributes':['id',_0x9edd('0x2a'),_0x9edd('0x7b'),'email',_0x9edd('0x7d')],'raw':!![]});}return null;})[_0x9edd('0x24')](function(_0x3aae72){if(!_0x3aae72)return null;_0x58cb3f[_0x9edd('0x1b')][_0x9edd('0x6c')]=_0x3aae72;return _0x58cb3f;})[_0x9edd('0x24')](function(_0x2f8fb6){if(_0x2f8fb6){_0x2f8fb6[_0x9edd('0x1b')]['interface']=util[_0x9edd('0x67')](_0x9edd('0x80'),_0x2da088[_0x9edd('0x5d')][_0x9edd('0x2a')]);_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x81')]=_0x58cb3f[_0x9edd('0x81')];_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x82')]=_0x9edd('0x8c');_0x2f8fb6[_0x9edd('0x1b')][_0x9edd('0x49')]=htmlToText[_0x9edd('0x8d')](_0x58cb3f[_0x9edd('0x1b')][_0x9edd('0x49')]);respondWithRpcPromise(_0x9edd('0x83'),_0x9edd('0x83'),{'event':_0x9edd('0x8e'),'message':_0x2f8fb6[_0x9edd('0x1b')]},client9002);return _0x58cb3f;}return null;})[_0x9edd('0x24')](respondWithResult(_0x5d566e,null))[_0x9edd('0x1c')](handleError(_0x5d566e,null));};exports['download']=function(_0xa704eb,_0x553018){var _0x4ca7e4=moment()[_0x9edd('0x8f')]()[_0x9edd('0x90')]();var _0x220c00=path[_0x9edd('0x60')](config[_0x9edd('0x91')],_0x9edd('0x92'),_0x9edd('0x93'),_0x9edd('0x94'));var _0x3e5a45=path[_0x9edd('0x60')](config['root'],_0x9edd('0x92'),_0x9edd('0x93'),'attachments');var _0x568067=util[_0x9edd('0x67')](_0x9edd('0x95'),_0x4ca7e4);return db[_0x9edd('0x2d')][_0x9edd('0x48')]({'where':{'id':_0xa704eb['params']['id']},'attributes':['id','body',_0x9edd('0x96'),'to','cc','bcc',_0x9edd('0x97'),_0x9edd('0x98')],'include':_0xa704eb[_0x9edd('0x33')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x9edd('0x24')](handleEntityNotFound(_0x553018,null))[_0x9edd('0x24')](function(_0x7b0fc8){if(_0x7b0fc8){var _0x5bfbfd=_0x7b0fc8;var _0xb2e72={'from':_0x5bfbfd[_0x9edd('0x96')],'to':_0x5bfbfd['to'],'subject':_0x5bfbfd['subject'],'html':_0x5bfbfd[_0x9edd('0x49')],'headers':{'Date':moment(_0x5bfbfd[_0x9edd('0x98')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x7b0fc8['cc']){_0xb2e72[_0x9edd('0x99')]['Cc']=_0x7b0fc8['cc'];}if(_0x7b0fc8[_0x9edd('0x9a')]){_0xb2e72['headers'][_0x9edd('0x9b')]=_0x7b0fc8[_0x9edd('0x9a')];}return new BPromise(function(_0x54c6a0,_0x201d76){if(_0x7b0fc8['Attachments']){for(var _0x308a0f=0x0;_0x308a0f<_0x7b0fc8[_0x9edd('0x9c')][_0x9edd('0x37')];_0x308a0f++){var _0x742e13=_0x7b0fc8[_0x9edd('0x9c')][_0x308a0f];var _0x3e6426=path['join'](_0x3e5a45,_0x742e13[_0x9edd('0x9d')]);if(fs[_0x9edd('0x9e')](_0x3e6426)){_0xb2e72[_0x9edd('0x5f')]['push']({'name':_0x742e13[_0x9edd('0x2a')],'contentType':_0x742e13['type'],'data':fs[_0x9edd('0x9f')](_0x3e6426)});}}}emlformat[_0x9edd('0xa0')](_0xb2e72,function(_0x25da04,_0x41b0ea){if(_0x25da04)return _0x201d76(_0x25da04);fs['writeFileSync'](path['join'](_0x220c00,_0x568067),_0x41b0ea);return _0x54c6a0(_0x41b0ea);});});}})['then'](function(_0x12dcfa){if(_0x12dcfa){return _0x553018[_0x9edd('0xa1')](path[_0x9edd('0x60')](_0x220c00,_0x568067),_0x568067,function(_0x50af78){if(!_0x50af78)fs[_0x9edd('0xa2')](path[_0x9edd('0x60')](_0x220c00,_0x568067));});}})[_0x9edd('0x1c')](handleError(_0x553018,null));};
\ No newline at end of file
+var _0x55ca=['offset','limit','Content-Range','then','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','fieldName','type','key','model','query','keys','attributes','length','nolimit','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','fields','include','options','find','update','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','user','pass','service','auth','attachments','join','root','server/files/attachments','basename','CmContact','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','get','MailInteractionId','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','channel','event','fromString','EventManager','acceptmessage','reject','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','interface','SIP/%s','rejectmessage','unix','server','files','message-%s.eml','from','bcc','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Attachments','existsSync','push','readFileSync','build','writeFileSync','download','eml-format','moment','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','jayson/promise','client','http','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','undefined','count'];(function(_0xd1c128,_0x1f20ef){var _0x510c2a=function(_0x518458){while(--_0x518458){_0xd1c128['push'](_0xd1c128['shift']());}};_0x510c2a(++_0x1f20ef);}(_0x55ca,0x126));var _0xa55c=function(_0x5db313,_0x3c8f0c){_0x5db313=_0x5db313-0x0;var _0x36d503=_0x55ca[_0x5db313];return _0x36d503;};'use strict';var emlformat=require(_0xa55c('0x0'));var moment=require(_0xa55c('0x1'));var BPromise=require('bluebird');var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0xa55c('0x2'));var Redis=require(_0xa55c('0x3'));var htmlToText=require('html-to-text');var qs=require(_0xa55c('0x4'));var logger=require(_0xa55c('0x5'))(_0xa55c('0x6'));var interaction_log=require(_0xa55c('0x5'))(_0xa55c('0x7'));var config=require(_0xa55c('0x8'));var db=require(_0xa55c('0x9'))['db'];config['redis']=_[_0xa55c('0xa')](config[_0xa55c('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa55c('0xc'))(new Redis(config[_0xa55c('0xb')]));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xa55c('0xd'));var client=jayson[_0xa55c('0xe')][_0xa55c('0xf')]({'port':0x232c});var client9003=jayson[_0xa55c('0xe')][_0xa55c('0xf')]({'port':0x232b});var client9002=jayson[_0xa55c('0xe')][_0xa55c('0xf')]({'port':0x232a});function respondWithRpcPromise(_0x70c2de,_0x3998f7,_0x15eec8,_0x5d47ff){return new BPromise(function(_0x59d84a,_0x2a35be){var _0x576044=_0x5d47ff||client;return _0x576044['request'](_0x70c2de,_0x15eec8)['then'](function(_0x18ee85){logger[_0xa55c('0x10')](_0xa55c('0x11'),_0x3998f7,_0xa55c('0x12'));logger[_0xa55c('0x13')](_0xa55c('0x14'),_0x3998f7,'request\x20sent',JSON[_0xa55c('0x15')](_0x18ee85));if(_0x18ee85[_0xa55c('0x16')]){if(_0x18ee85[_0xa55c('0x16')][_0xa55c('0x17')]===0x1f4){logger[_0xa55c('0x16')](_0xa55c('0x11'),_0x3998f7,_0x18ee85[_0xa55c('0x16')][_0xa55c('0x18')]);return _0x2a35be(_0x18ee85[_0xa55c('0x16')]['message']);}logger[_0xa55c('0x16')](_0xa55c('0x11'),_0x3998f7,_0x18ee85[_0xa55c('0x16')][_0xa55c('0x18')]);return _0x59d84a(_0x18ee85[_0xa55c('0x16')][_0xa55c('0x18')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x3998f7,_0xa55c('0x12'));_0x59d84a(_0x18ee85[_0xa55c('0x19')][_0xa55c('0x18')]);}})['catch'](function(_0x383d92){logger[_0xa55c('0x16')]('MailMessage,\x20%s,\x20%s',_0x3998f7,_0x383d92);_0x2a35be(_0x383d92);});});}function respondWithResult(_0x187a87,_0x133096){_0x133096=_0x133096||0xc8;return function(_0x940f28){if(_0x940f28){return _0x187a87[_0xa55c('0x1a')](_0x133096)[_0xa55c('0x1b')](_0x940f28);}};}function respondWithFilteredResult(_0x49ed04,_0x1fc828){return function(_0x504c24){if(_0x504c24){var _0x5ba836=typeof _0x1fc828['offset']===_0xa55c('0x1c')&&typeof _0x1fc828['limit']===_0xa55c('0x1c');var _0x190757=_0x504c24[_0xa55c('0x1d')];var _0xf0e574=_0x5ba836?0x0:_0x1fc828[_0xa55c('0x1e')];var _0x170ba4=_0x5ba836?_0x504c24[_0xa55c('0x1d')]:_0x1fc828[_0xa55c('0x1e')]+_0x1fc828[_0xa55c('0x1f')];var _0x3cd152;if(_0x170ba4>=_0x190757){_0x170ba4=_0x190757;_0x3cd152=0xc8;}else{_0x3cd152=0xce;}_0x49ed04[_0xa55c('0x1a')](_0x3cd152);return _0x49ed04['set'](_0xa55c('0x20'),_0xf0e574+'-'+_0x170ba4+'/'+_0x190757)[_0xa55c('0x1b')](_0x504c24);}return null;};}function saveUpdates(_0x1c9f6b){return function(_0x906caa){if(_0x906caa){return _0x906caa['update'](_0x1c9f6b)[_0xa55c('0x21')](function(_0x22f6b6){return _0x22f6b6;});}return null;};}function removeEntity(_0x1b8388){return function(_0x201941){if(_0x201941){return _0x201941[_0xa55c('0x22')]()[_0xa55c('0x21')](function(){_0x1b8388['status'](0xcc)[_0xa55c('0x23')]();});}};}function handleEntityNotFound(_0x490b7d){return function(_0x35c9c2){if(!_0x35c9c2){_0x490b7d[_0xa55c('0x24')](0x194);}return _0x35c9c2;};}function handleError(_0x1cc53e,_0x223813){_0x223813=_0x223813||0x1f4;return function(_0x4d8416){logger[_0xa55c('0x16')](_0x4d8416[_0xa55c('0x25')]);if(_0x4d8416[_0xa55c('0x26')]){delete _0x4d8416[_0xa55c('0x26')];}_0x1cc53e[_0xa55c('0x1a')](_0x223813)[_0xa55c('0x27')](_0x4d8416);};}exports[_0xa55c('0x28')]=function(_0x24d44d,_0x2808e9){var _0xcbaf2e={},_0x197099={},_0x4eb7c4={'count':0x0,'rows':[]};var _0x54ca97=_[_0xa55c('0x29')](db[_0xa55c('0x2a')]['rawAttributes'],function(_0x30fadd){return{'name':_0x30fadd[_0xa55c('0x2b')],'type':_0x30fadd[_0xa55c('0x2c')][_0xa55c('0x2d')]};});_0x197099[_0xa55c('0x2e')]=_[_0xa55c('0x29')](_0x54ca97,_0xa55c('0x26'));_0x197099[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x24d44d['query']);_0x197099['filters']=_['intersection'](_0x197099[_0xa55c('0x2e')],_0x197099[_0xa55c('0x2f')]);_0xcbaf2e[_0xa55c('0x31')]=_['intersection'](_0x197099[_0xa55c('0x2e')],qs['fields'](_0x24d44d[_0xa55c('0x2f')]['fields']));_0xcbaf2e[_0xa55c('0x31')]=_0xcbaf2e[_0xa55c('0x31')][_0xa55c('0x32')]?_0xcbaf2e['attributes']:_0x197099[_0xa55c('0x2e')];if(!_0x24d44d[_0xa55c('0x2f')]['hasOwnProperty'](_0xa55c('0x33'))){_0xcbaf2e[_0xa55c('0x1f')]=qs['limit'](_0x24d44d['query'][_0xa55c('0x1f')]);_0xcbaf2e['offset']=qs[_0xa55c('0x1e')](_0x24d44d[_0xa55c('0x2f')]['offset']);}_0xcbaf2e['order']=qs['sort'](_0x24d44d['query'][_0xa55c('0x34')]);_0xcbaf2e[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_[_0xa55c('0x37')](_0x24d44d[_0xa55c('0x2f')],_0x197099['filters']),_0x54ca97);if(_0x24d44d[_0xa55c('0x2f')][_0xa55c('0x38')]){_0xcbaf2e[_0xa55c('0x35')]=_[_0xa55c('0x39')](_0xcbaf2e[_0xa55c('0x35')],{'$or':_[_0xa55c('0x29')](_0x54ca97,function(_0x554620){if(_0x554620[_0xa55c('0x2c')]!=='VIRTUAL'){var _0x57a972={};_0x57a972[_0x554620[_0xa55c('0x26')]]={'$like':'%'+_0x24d44d[_0xa55c('0x2f')]['filter']+'%'};return _0x57a972;}})});}_0xcbaf2e=_[_0xa55c('0x39')]({},_0xcbaf2e,_0x24d44d['options']);var _0x5f25f7={'where':_0xcbaf2e[_0xa55c('0x35')]};return db[_0xa55c('0x2a')][_0xa55c('0x1d')](_0x5f25f7)['then'](function(_0x1b2708){_0x4eb7c4[_0xa55c('0x1d')]=_0x1b2708;if(_0x24d44d['query'][_0xa55c('0x3a')]){_0xcbaf2e['include']=[{'all':!![]}];}return db[_0xa55c('0x2a')][_0xa55c('0x3b')](_0xcbaf2e);})['then'](function(_0x66d1de){_0x4eb7c4[_0xa55c('0x3c')]=_0x66d1de;return _0x4eb7c4;})['then'](respondWithFilteredResult(_0x2808e9,_0xcbaf2e))[_0xa55c('0x3d')](handleError(_0x2808e9,null));};exports[_0xa55c('0x3e')]=function(_0x204767,_0x59a6c8){var _0x334f52={'raw':!![],'where':{'id':_0x204767[_0xa55c('0x3f')]['id']}},_0x582901={};_0x582901[_0xa55c('0x2e')]=_[_0xa55c('0x30')](db['MailMessage'][_0xa55c('0x40')]);_0x582901[_0xa55c('0x2f')]=_['keys'](_0x204767[_0xa55c('0x2f')]);_0x582901[_0xa55c('0x36')]=_['intersection'](_0x582901[_0xa55c('0x2e')],_0x582901[_0xa55c('0x2f')]);_0x334f52['attributes']=_[_0xa55c('0x41')](_0x582901[_0xa55c('0x2e')],qs[_0xa55c('0x42')](_0x204767[_0xa55c('0x2f')]['fields']));_0x334f52[_0xa55c('0x31')]=_0x334f52['attributes'][_0xa55c('0x32')]?_0x334f52[_0xa55c('0x31')]:_0x582901[_0xa55c('0x2e')];if(_0x204767['query'][_0xa55c('0x3a')]){_0x334f52[_0xa55c('0x43')]=[{'all':!![]}];}_0x334f52=_['merge']({},_0x334f52,_0x204767[_0xa55c('0x44')]);return db[_0xa55c('0x2a')][_0xa55c('0x45')](_0x334f52)[_0xa55c('0x21')](handleEntityNotFound(_0x59a6c8,null))[_0xa55c('0x21')](respondWithResult(_0x59a6c8,null))[_0xa55c('0x3d')](handleError(_0x59a6c8,null));};exports[_0xa55c('0x46')]=function(_0x129626,_0x3c147b){if(_0x129626[_0xa55c('0x47')]['id']){delete _0x129626['body']['id'];}return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x129626[_0xa55c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3c147b,null))[_0xa55c('0x21')](saveUpdates(_0x129626[_0xa55c('0x47')],null))['then'](respondWithResult(_0x3c147b,null))[_0xa55c('0x3d')](handleError(_0x3c147b,null));};exports['destroy']=function(_0x2b6a0e,_0x228df4){return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x2b6a0e[_0xa55c('0x3f')]['id']}})['then'](handleEntityNotFound(_0x228df4,null))[_0xa55c('0x21')](removeEntity(_0x228df4,null))[_0xa55c('0x3d')](handleError(_0x228df4,null));};exports['describe']=function(_0x3929a6,_0x2291e0){return db[_0xa55c('0x2a')][_0xa55c('0x48')]()['then'](respondWithResult(_0x2291e0,null))['catch'](handleError(_0x2291e0,null));};exports[_0xa55c('0x49')]=function(_0x250dea,_0x3ca5b8){return db[_0xa55c('0x2a')]['create'](_0x250dea[_0xa55c('0x47')])['then'](function(_0x2742e4){if(_0x2742e4){if(_0x2742e4[_0xa55c('0x4a')]===_0xa55c('0x4b')&&!_0x2742e4[_0xa55c('0x4c')]){var _0xec640,_0x53b2f7,_0x1cb73b;if(_0x250dea['body']['to']){_0x53b2f7=_0x250dea[_0xa55c('0x47')]['to'][_0xa55c('0x4d')](',')[0x0];}return db[_0xa55c('0x4e')][_0xa55c('0x4f')]({'where':{'id':_0x2742e4[_0xa55c('0x50')]},'include':[{'model':db[_0xa55c('0x51')],'as':_0xa55c('0x52'),'include':[{'model':db['CmContact'],'as':_0xa55c('0x53'),'where':{'email':_0x53b2f7},'limit':0x1,'order':[[_0xa55c('0x54'),_0xa55c('0x55')]]}]},{'model':db[_0xa55c('0x56')],'as':_0xa55c('0x57'),'raw':!![]}]})['then'](function(_0xa72718){_0xec640=_0xa72718;if(_0xec640&&_0xec640[_0xa55c('0x57')]){var _0x28bac4={'tls':{'rejectUnauthorized':![]}};if(_[_0xa55c('0x58')](_0xec640[_0xa55c('0x57')]['service'])){_0x28bac4[_0xa55c('0x59')]=_0xec640[_0xa55c('0x57')][_0xa55c('0x59')];_0x28bac4[_0xa55c('0x5a')]=_0xec640[_0xa55c('0x57')]['port'];_0x28bac4[_0xa55c('0x5b')]=_0xec640['Smtp'][_0xa55c('0x5b')];if(_0xec640['Smtp'][_0xa55c('0x5c')]){_0x28bac4['auth']={'user':_0xec640[_0xa55c('0x57')][_0xa55c('0x5d')],'pass':_0xec640[_0xa55c('0x57')][_0xa55c('0x5e')]};}}else{_0x28bac4[_0xa55c('0x5f')]=_0xec640[_0xa55c('0x57')][_0xa55c('0x5f')];_0x28bac4[_0xa55c('0x60')]={'user':_0xec640[_0xa55c('0x57')][_0xa55c('0x5d')],'pass':_0xec640['Smtp'][_0xa55c('0x5e')]};_0x28bac4[_0xa55c('0x5b')]=_0xec640['Smtp'][_0xa55c('0x5b')];}if(_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')]&&_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')][_0xa55c('0x32')]){for(var _0x3cef1f=0x0;_0x3cef1f<_0x250dea[_0xa55c('0x47')]['attachments'][_0xa55c('0x32')];_0x3cef1f+=0x1){_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')][_0x3cef1f]={'filename':_0x250dea[_0xa55c('0x47')][_0xa55c('0x61')][_0x3cef1f][_0xa55c('0x26')],'path':path[_0xa55c('0x62')](config[_0xa55c('0x63')],_0xa55c('0x64'),_0x250dea['body'][_0xa55c('0x61')][_0x3cef1f][_0xa55c('0x65')])};}}_0x1cb73b={'account':_0x28bac4,'message':_0x250dea[_0xa55c('0x47')]};return;}})[_0xa55c('0x21')](function(){if(_0xec640[_0xa55c('0x52')]){if(_0xec640[_0xa55c('0x52')][_0xa55c('0x53')][_0xa55c('0x32')]){return _0xec640[_0xa55c('0x52')][_0xa55c('0x53')][0x0];}else{return db[_0xa55c('0x66')]['create'](_[_0xa55c('0xa')](_0x250dea['body'],{'firstName':_0x250dea[_0xa55c('0x47')]['to'],'email':_0x250dea[_0xa55c('0x47')]['to'],'phone':_0x250dea[_0xa55c('0x47')]['to'],'ListId':_0xec640['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0xa55c('0x21')](function(){if(_0x1cb73b){return respondWithRpcPromise(_0xa55c('0x67'),_0xa55c('0x68'),_0x1cb73b,client9003)[_0xa55c('0x21')](function(_0x4c7ee1){return _0x2742e4[_0xa55c('0x46')]({'read':!![],'messageId':_0x4c7ee1[_0xa55c('0x69')],'sentAt':moment()[_0xa55c('0x6a')](_0xa55c('0x6b'))});})[_0xa55c('0x3d')](function(_0x500968){logger['error']('%s',JSON[_0xa55c('0x15')](_0x500968));return _0x2742e4;});}return _0x2742e4;});}return _0x2742e4;}})[_0xa55c('0x21')](respondWithResult(_0x3ca5b8,0xc9))[_0xa55c('0x3d')](handleError(_0x3ca5b8,null));};exports[_0xa55c('0x6c')]=function(_0x1af9d5,_0x4b2032){var _0x14febc={'agent':{},'channel':_0xa55c('0x6d')};if(_0x1af9d5['body']['id']){delete _0x1af9d5[_0xa55c('0x47')]['id'];}_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x6e')]=!![];_0x1af9d5['body'][_0xa55c('0x6f')]=moment()[_0xa55c('0x6a')](_0xa55c('0x6b'));_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')]=_0x1af9d5['body'][_0xa55c('0x70')]||_0x1af9d5[_0xa55c('0x5d')]['id'];_0x14febc['agent']['id']=_0x1af9d5['body'][_0xa55c('0x70')];return db['MailMessage'][_0xa55c('0x45')]({'where':{'id':_0x1af9d5[_0xa55c('0x3f')]['id'],'UserId':null}})[_0xa55c('0x21')](handleEntityNotFound(_0x4b2032,null))[_0xa55c('0x21')](saveUpdates(_0x1af9d5[_0xa55c('0x47')],null))[_0xa55c('0x21')](function(_0x22b06f){if(_0x22b06f){_0x14febc[_0xa55c('0x18')]=_0x22b06f[_0xa55c('0x71')]({'plain':!![]});return db['MailInteraction'][_0xa55c('0x45')]({'where':{'id':_0x22b06f[_0xa55c('0x72')]}});}return null;})[_0xa55c('0x21')](handleEntityNotFound(_0x4b2032,null))[_0xa55c('0x21')](function(_0x4f0a26){if(_0x4f0a26){return _0x4f0a26[_0xa55c('0x46')]({'UserId':_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')],'read1stAt':_[_0xa55c('0x58')](_0x4f0a26['read1stAt'])?moment()['format'](_0xa55c('0x6b')):undefined});}return null;})[_0xa55c('0x21')](function(_0x12e3a8){if(_0x12e3a8){_0x14febc[_0xa55c('0x73')]=_0x12e3a8['get']({'plain':!![]});interaction_log['info'](_0xa55c('0x74'),_0x1af9d5[_0xa55c('0x5d')]['id'],_0x1af9d5[_0xa55c('0x5d')][_0xa55c('0x26')],_0x1af9d5[_0xa55c('0x5d')][_0xa55c('0x75')],_0x14febc[_0xa55c('0x73')]['id'],_0x1af9d5['body']?JSON[_0xa55c('0x15')](_0x1af9d5['body']):_0xa55c('0x76'));return respondWithRpcPromise('AcceptMessage',_0xa55c('0x77'),_0x14febc);}return null;})[_0xa55c('0x21')](function(_0x441c11){var _0xcc187f=_0xa55c('0x78')+_0x441c11[_0xa55c('0x18')][_0xa55c('0x79')];return db[_0xa55c('0x7a')]['query'](_0xcc187f,{'type':db['Sequelize'][_0xa55c('0x7b')][_0xa55c('0x7c')],'raw':!![]})[_0xa55c('0x21')](function(_0x256db0){return _0x256db0;});})[_0xa55c('0x21')](function(_0x137728){if(_0x137728){_0x14febc['message'][_0xa55c('0x7d')]=_0x137728[0x0];if(!_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')])return;return db[_0xa55c('0x7e')][_0xa55c('0x45')]({'where':{'id':_0x1af9d5[_0xa55c('0x47')][_0xa55c('0x70')],'role':_0xa55c('0x7f')},'attributes':['id','name',_0xa55c('0x80'),_0xa55c('0x81'),_0xa55c('0x82')],'raw':!![]});}return null;})[_0xa55c('0x21')](function(_0xa957ad){if(!_0xa957ad)return null;_0x14febc['message'][_0xa55c('0x7f')]=_0xa957ad;return _0x14febc;})[_0xa55c('0x21')](function(_0x58296a){if(_0x58296a){if(_0x1af9d5['body'][_0xa55c('0x83')]){_0x14febc[_0xa55c('0x18')]['interface']=util['format']('SIP/%s',_0x1af9d5['user'][_0xa55c('0x26')]);_0x14febc[_0xa55c('0x18')][_0xa55c('0x84')]=_0x14febc[_0xa55c('0x84')];_0x14febc[_0xa55c('0x18')][_0xa55c('0x85')]='accept';_0x14febc[_0xa55c('0x18')][_0xa55c('0x47')]=htmlToText[_0xa55c('0x86')](_0x14febc[_0xa55c('0x18')]['body']);return respondWithRpcPromise(_0xa55c('0x87'),_0xa55c('0x87'),{'event':_0xa55c('0x88'),'message':_0x14febc['message']},client9002)[_0xa55c('0x21')](function(){return _0x14febc;});}return _0x14febc;}return null;})['then'](respondWithResult(_0x4b2032,null))['catch'](handleError(_0x4b2032,null));};exports[_0xa55c('0x89')]=function(_0x413b45,_0x1e298d){var _0x249b0c={'agent':{},'channel':_0xa55c('0x6d')};if(_0x413b45[_0xa55c('0x47')]['id']){delete _0x413b45[_0xa55c('0x47')]['id'];}_0x413b45['body']['UserId']=_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')]||_0x413b45[_0xa55c('0x5d')]['id'];_0x249b0c[_0xa55c('0x7f')]['id']=_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')];return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x413b45[_0xa55c('0x3f')]['id'],'UserId':null}})[_0xa55c('0x21')](handleEntityNotFound(_0x1e298d,null))['then'](function(_0xc9c3fa){if(_0xc9c3fa){_0x249b0c[_0xa55c('0x18')]=_0xc9c3fa['get']({'plain':!![]});return db[_0xa55c('0x8a')]['find']({'where':{'id':_0xc9c3fa[_0xa55c('0x72')]}});}return null;})[_0xa55c('0x21')](handleEntityNotFound(_0x1e298d,null))[_0xa55c('0x21')](function(_0x314205){if(_0x314205){_0x249b0c[_0xa55c('0x73')]=_0x314205['get']({'plain':!![]});interaction_log[_0xa55c('0x10')](_0xa55c('0x8b'),_0x413b45[_0xa55c('0x5d')]['id'],_0x413b45[_0xa55c('0x5d')][_0xa55c('0x26')],_0x413b45[_0xa55c('0x5d')][_0xa55c('0x75')],_0x249b0c['interaction']['id'],_0x413b45['body']?JSON['stringify'](_0x413b45[_0xa55c('0x47')]):'null');return respondWithRpcPromise(_0xa55c('0x8c'),_0xa55c('0x8d'),_0x249b0c);}return null;})[_0xa55c('0x21')](function(_0x73162a){var _0x26ca90='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x73162a[_0xa55c('0x18')]['ContactId'];return db[_0xa55c('0x7a')][_0xa55c('0x2f')](_0x26ca90,{'type':db[_0xa55c('0x8e')][_0xa55c('0x7b')]['SELECT'],'raw':!![]})[_0xa55c('0x21')](function(_0x46f8ab){return _0x46f8ab;});})[_0xa55c('0x21')](function(_0x17a36c){if(_0x17a36c){_0x249b0c[_0xa55c('0x18')][_0xa55c('0x7d')]=_0x17a36c[0x0];if(!_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')])return;return db['User'][_0xa55c('0x45')]({'where':{'id':_0x413b45[_0xa55c('0x47')][_0xa55c('0x70')],'role':_0xa55c('0x7f')},'attributes':['id',_0xa55c('0x26'),_0xa55c('0x80'),'email',_0xa55c('0x82')],'raw':!![]});}return null;})['then'](function(_0x3b9712){if(!_0x3b9712)return null;_0x249b0c['message'][_0xa55c('0x7f')]=_0x3b9712;return _0x249b0c;})[_0xa55c('0x21')](function(_0x17312b){if(_0x17312b){_0x17312b['message'][_0xa55c('0x8f')]=util[_0xa55c('0x6a')](_0xa55c('0x90'),_0x413b45['user'][_0xa55c('0x26')]);_0x17312b['message'][_0xa55c('0x84')]=_0x249b0c[_0xa55c('0x84')];_0x17312b['message'][_0xa55c('0x85')]='reject';_0x17312b[_0xa55c('0x18')][_0xa55c('0x47')]=htmlToText['fromString'](_0x249b0c[_0xa55c('0x18')][_0xa55c('0x47')]);respondWithRpcPromise('EventManager',_0xa55c('0x87'),{'event':_0xa55c('0x91'),'message':_0x17312b['message']},client9002);return _0x249b0c;}return null;})[_0xa55c('0x21')](respondWithResult(_0x1e298d,null))['catch'](handleError(_0x1e298d,null));};exports['download']=function(_0x28a26d,_0x3113b9){var _0x28a71e=moment()[_0xa55c('0x92')]()['toString']();var _0x307895=path['join'](config[_0xa55c('0x63')],'server','files','tmp');var _0x999114=path['join'](config['root'],_0xa55c('0x93'),_0xa55c('0x94'),_0xa55c('0x61'));var _0x4046ae=util[_0xa55c('0x6a')](_0xa55c('0x95'),_0x28a71e);return db[_0xa55c('0x2a')][_0xa55c('0x45')]({'where':{'id':_0x28a26d[_0xa55c('0x3f')]['id']},'attributes':['id',_0xa55c('0x47'),_0xa55c('0x96'),'to','cc',_0xa55c('0x97'),_0xa55c('0x98'),'createdAt'],'include':_0x28a26d[_0xa55c('0x2f')]['attachments']?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0xa55c('0x21')](handleEntityNotFound(_0x3113b9,null))['then'](function(_0xd5a27a){if(_0xd5a27a){var _0x55e447=_0xd5a27a;var _0x3169dd={'from':_0x55e447['from'],'to':_0x55e447['to'],'subject':_0x55e447['subject'],'html':_0x55e447[_0xa55c('0x47')],'headers':{'Date':moment(_0x55e447['createdAt'])['format'](_0xa55c('0x99'))},'attachments':[]};if(_0xd5a27a['cc']){_0x3169dd[_0xa55c('0x9a')]['Cc']=_0xd5a27a['cc'];}if(_0xd5a27a['bcc']){_0x3169dd[_0xa55c('0x9a')]['Bcc']=_0xd5a27a[_0xa55c('0x97')];}return new BPromise(function(_0x403dff,_0x1dcd8a){if(_0xd5a27a['Attachments']){for(var _0x50df67=0x0;_0x50df67<_0xd5a27a[_0xa55c('0x9b')][_0xa55c('0x32')];_0x50df67++){var _0x36064f=_0xd5a27a[_0xa55c('0x9b')][_0x50df67];var _0x4297bf=path[_0xa55c('0x62')](_0x999114,_0x36064f[_0xa55c('0x65')]);if(fs[_0xa55c('0x9c')](_0x4297bf)){_0x3169dd['attachments'][_0xa55c('0x9d')]({'name':_0x36064f[_0xa55c('0x26')],'contentType':_0x36064f[_0xa55c('0x2c')],'data':fs[_0xa55c('0x9e')](_0x4297bf)});}}}emlformat[_0xa55c('0x9f')](_0x3169dd,function(_0x1a01de,_0x2fa186){if(_0x1a01de)return _0x1dcd8a(_0x1a01de);fs[_0xa55c('0xa0')](path[_0xa55c('0x62')](_0x307895,_0x4046ae),_0x2fa186);return _0x403dff(_0x2fa186);});});}})['then'](function(_0x19ebd5){if(_0x19ebd5){return _0x3113b9[_0xa55c('0xa1')](path[_0xa55c('0x62')](_0x307895,_0x4046ae),_0x4046ae,function(_0x5ea9c8){if(!_0x5ea9c8)fs['unlinkSync'](path['join'](_0x307895,_0x4046ae));});}})[_0xa55c('0x3d')](handleError(_0x3113b9,null));};
\ No newline at end of file
index d02ac11..8e34f98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4835=['emit','hasOwnProperty','hook','events','MailMessage','save'];(function(_0x3cb0cf,_0x3aecb3){var _0xfdd033=function(_0x27dcfe){while(--_0x27dcfe){_0x3cb0cf['push'](_0x3cb0cf['shift']());}};_0xfdd033(++_0x3aecb3);}(_0x4835,0x195));var _0x5483=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x4835[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0x5483('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x5483('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5483('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xe3d379){return function(_0x4e0f1e,_0x1b1cb1,_0x4f65d5){MailMessageEvents[_0x5483('0x3')](_0xe3d379+':'+_0x4e0f1e['id'],_0x4e0f1e);MailMessageEvents[_0x5483('0x3')](_0xe3d379,_0x4e0f1e);_0x4f65d5(null);};}for(var e in events){if(events[_0x5483('0x4')](e)){var event=events[e];MailMessage[_0x5483('0x5')](e,emitEvent(event));}}module['exports']=MailMessageEvents;
\ No newline at end of file
+var _0x7abf=['emit','hasOwnProperty','hook','exports','events','save','update','remove'];(function(_0x358e87,_0x14d9d3){var _0x452ca1=function(_0x5321f9){while(--_0x5321f9){_0x358e87['push'](_0x358e87['shift']());}};_0x452ca1(++_0x14d9d3);}(_0x7abf,0xfc));var _0xf7ab=function(_0x4996d2,_0xe42b4){_0x4996d2=_0x4996d2-0x0;var _0x5f506a=_0x7abf[_0x4996d2];return _0x5f506a;};'use strict';var EventEmitter=require(_0xf7ab('0x0'));var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf7ab('0x1'),'afterUpdate':_0xf7ab('0x2'),'afterDestroy':_0xf7ab('0x3')};function emitEvent(_0x3175eb){return function(_0x22765f,_0x117991,_0x5a2377){MailMessageEvents[_0xf7ab('0x4')](_0x3175eb+':'+_0x22765f['id'],_0x22765f);MailMessageEvents[_0xf7ab('0x4')](_0x3175eb,_0x22765f);_0x5a2377(null);};}for(var e in events){if(events[_0xf7ab('0x5')](e)){var event=events[e];MailMessage[_0xf7ab('0x6')](e,emitEvent(event));}}module[_0xf7ab('0x7')]=MailMessageEvents;
\ No newline at end of file
index 9d5c01a..11bab79 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbc2=['secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out'];(function(_0x9548e1,_0xdde7b){var _0x538e11=function(_0x194e68){while(--_0x194e68){_0x9548e1['push'](_0x9548e1['shift']());}};_0x538e11(++_0xdde7b);}(_0xdbc2,0x198));var _0x2dbc=function(_0x49b78f,_0x1ccdf7){_0x49b78f=_0x49b78f-0x0;var _0x544d2=_0xdbc2[_0x49b78f];return _0x544d2;};'use strict';var _=require(_0x2dbc('0x0'));var util=require(_0x2dbc('0x1'));var logger=require(_0x2dbc('0x2'))(_0x2dbc('0x3'));var moment=require(_0x2dbc('0x4'));var BPromise=require('bluebird');var rp=require(_0x2dbc('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x2dbc('0x6'));var rimraf=require(_0x2dbc('0x7'));var config=require(_0x2dbc('0x8'));var attributes=require(_0x2dbc('0x9'));module[_0x2dbc('0xa')]=function(_0xa4c05b,_0x4bad9b){return _0xa4c05b['define'](_0x2dbc('0xb'),attributes,{'tableName':_0x2dbc('0xc'),'paranoid':![],'indexes':[{'name':_0x2dbc('0xd'),'fields':[_0x2dbc('0xd')]},{'name':_0x2dbc('0xe'),'fields':[_0x2dbc('0xf'),'subject'],'type':_0x2dbc('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x257483,_0x2c0479,_0x4c590b){if(_0x257483[_0x2dbc('0x11')]){_0x257483['plainBody']=htmlToText[_0x2dbc('0x12')](_0x257483['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x4c590b(null,_0x2c0479);},'afterCreate':function(_0x44d054,_0x1d7d42,_0x4c7647){var _0x56cea5=_0xa4c05b[_0x2dbc('0x13')];var _0x3eac3d=_0x44d054[_0x2dbc('0x14')]({'plain':!![]});if(_0x3eac3d[_0x2dbc('0x15')]['toLowerCase']()==='in'||_0x3eac3d[_0x2dbc('0x15')][_0x2dbc('0x16')]()===_0x2dbc('0x17')&&!_0x3eac3d[_0x2dbc('0x18')]&&!_[_0x2dbc('0x19')](_0x3eac3d[_0x2dbc('0x1a')])){_0x56cea5[_0x2dbc('0x1b')][_0x2dbc('0x1c')]({'where':{'id':_0x3eac3d[_0x2dbc('0x1d')]}})[_0x2dbc('0x1e')](function(_0x45509e){if(_0x45509e){_0x45509e[_0x2dbc('0x1f')]({'lastMsgAt':_0x3eac3d[_0x2dbc('0x20')],'lastMsgDirection':_0x3eac3d[_0x2dbc('0x15')][_0x2dbc('0x16')]()});}})[_0x2dbc('0x21')](function(_0x186a23){console['error'](_0x186a23);});}_0x4c7647();}},'charset':_0x2dbc('0x22'),'collate':_0x2dbc('0x23')});};
\ No newline at end of file
+var _0x0b85=['plainBody','subject','FULLTEXT','body','get','direction','toLowerCase','out','secret','MailInteraction','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','./mailMessage.attributes','define','MailMessage','messageId','fti_mail_messages'];(function(_0x4f646e,_0x1d1b25){var _0x459c10=function(_0x3d60a5){while(--_0x3d60a5){_0x4f646e['push'](_0x4f646e['shift']());}};_0x459c10(++_0x1d1b25);}(_0x0b85,0x92));var _0x50b8=function(_0x5f1341,_0x18f3e9){_0x5f1341=_0x5f1341-0x0;var _0x52a405=_0x0b85[_0x5f1341];return _0x52a405;};'use strict';var _=require(_0x50b8('0x0'));var util=require(_0x50b8('0x1'));var logger=require(_0x50b8('0x2'))(_0x50b8('0x3'));var moment=require(_0x50b8('0x4'));var BPromise=require(_0x50b8('0x5'));var rp=require('request-promise');var htmlToText=require(_0x50b8('0x6'));var fs=require('fs');var path=require(_0x50b8('0x7'));var rimraf=require(_0x50b8('0x8'));var config=require('../../config/environment');var attributes=require(_0x50b8('0x9'));module['exports']=function(_0x25992e,_0x3fa860){return _0x25992e[_0x50b8('0xa')](_0x50b8('0xb'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x50b8('0xc'),'fields':['messageId']},{'name':_0x50b8('0xd'),'fields':[_0x50b8('0xe'),_0x50b8('0xf')],'type':_0x50b8('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x20fb8f,_0x56db27,_0x452d25){if(_0x20fb8f[_0x50b8('0x11')]){_0x20fb8f[_0x50b8('0xe')]=htmlToText['fromString'](_0x20fb8f[_0x50b8('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x452d25(null,_0x56db27);},'afterCreate':function(_0x563982,_0x1d0d39,_0x1d33a7){var _0x540075=_0x25992e['models'];var _0x1a840e=_0x563982[_0x50b8('0x12')]({'plain':!![]});if(_0x1a840e[_0x50b8('0x13')][_0x50b8('0x14')]()==='in'||_0x1a840e[_0x50b8('0x13')][_0x50b8('0x14')]()===_0x50b8('0x15')&&!_0x1a840e[_0x50b8('0x16')]&&!_['isNil'](_0x1a840e['UserId'])){_0x540075[_0x50b8('0x17')][_0x50b8('0x18')]({'where':{'id':_0x1a840e['MailInteractionId']}})[_0x50b8('0x19')](function(_0x5a978a){if(_0x5a978a){_0x5a978a[_0x50b8('0x1a')]({'lastMsgAt':_0x1a840e[_0x50b8('0x1b')],'lastMsgDirection':_0x1a840e[_0x50b8('0x13')][_0x50b8('0x14')]()});}})[_0x50b8('0x1c')](function(_0x14d41f){console[_0x50b8('0x1d')](_0x14d41f);});}_0x1d33a7();}},'charset':_0x50b8('0x1e'),'collate':_0x50b8('0x1f')});};
\ No newline at end of file
index d69e0fd..b2cf70c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0120=['then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','body','options','raw','CreateMailMessage','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','register'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0120,0x6f));var _0x0012=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x0120[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var moment=require(_0x0012('0x2'));var BPromise=require(_0x0012('0x3'));var rs=require(_0x0012('0x4'));var fs=require('fs');var Redis=require(_0x0012('0x5'));var db=require(_0x0012('0x6'))['db'];var utils=require(_0x0012('0x7'));var logger=require(_0x0012('0x8'))(_0x0012('0x9'));var config=require(_0x0012('0xa'));var jayson=require(_0x0012('0xb'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x0012('0xc')](config[_0x0012('0xd')],{'host':_0x0012('0xe'),'port':0x18eb});var socket=require(_0x0012('0xf'))(new Redis(config[_0x0012('0xd')]));require('./mailMessage.socket')[_0x0012('0x10')](socket);function respondWithRpcPromise(_0x2d484c,_0x1dc1b2,_0x323282){return new BPromise(function(_0x520171,_0x2d4674){return client['request'](_0x2d484c,_0x323282)[_0x0012('0x11')](function(_0x1d1c02){logger[_0x0012('0x12')](_0x0012('0x13'),_0x1dc1b2,_0x0012('0x14'));logger['debug'](_0x0012('0x15'),_0x1dc1b2,'request\x20sent',JSON['stringify'](_0x1d1c02));if(_0x1d1c02['error']){if(_0x1d1c02['error'][_0x0012('0x16')]===0x1f4){logger['error'](_0x0012('0x13'),_0x1dc1b2,_0x1d1c02[_0x0012('0x17')]['message']);return _0x2d4674(_0x1d1c02[_0x0012('0x17')][_0x0012('0x18')]);}logger[_0x0012('0x17')](_0x0012('0x13'),_0x1dc1b2,_0x1d1c02['error']['message']);return _0x520171(_0x1d1c02[_0x0012('0x17')][_0x0012('0x18')]);}else{logger[_0x0012('0x12')](_0x0012('0x13'),_0x1dc1b2,_0x0012('0x14'));_0x520171(_0x1d1c02[_0x0012('0x19')][_0x0012('0x18')]);}})[_0x0012('0x1a')](function(_0x5b236f){logger[_0x0012('0x17')](_0x0012('0x13'),_0x1dc1b2,_0x5b236f);_0x2d4674(_0x5b236f);});});}exports['CreateMailMessage']=function(_0x45d00b){var _0x1f54fc=this;return new Promise(function(_0xa2e623,_0x2c837e){return db['MailMessage']['create'](_0x45d00b[_0x0012('0x1b')],{'raw':_0x45d00b[_0x0012('0x1c')]?_0x45d00b[_0x0012('0x1c')][_0x0012('0x1d')]===undefined?!![]:![]:!![]})[_0x0012('0x11')](function(_0x2e6a2c){logger[_0x0012('0x12')](_0x0012('0x1e'),_0x45d00b);logger['debug'](_0x0012('0x1e'),_0x45d00b,JSON[_0x0012('0x1f')](_0x2e6a2c));_0xa2e623(_0x2e6a2c);})['catch'](function(_0x36cf42){logger[_0x0012('0x17')](_0x0012('0x1e'),_0x36cf42[_0x0012('0x18')],_0x45d00b);_0x2c837e(_0x1f54fc[_0x0012('0x17')](0x1f4,_0x36cf42['message']));});});};
\ No newline at end of file
+var _0xab40=['raw','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','register','request','then','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateMailMessage','MailMessage','create','options'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0xab40,0xcd));var _0x0ab4=function(_0x288ab0,_0x5d8823){_0x288ab0=_0x288ab0-0x0;var _0x4f0a2c=_0xab40[_0x288ab0];return _0x4f0a2c;};'use strict';var _=require(_0x0ab4('0x0'));var util=require(_0x0ab4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ab4('0x2'));var db=require(_0x0ab4('0x3'))['db'];var utils=require(_0x0ab4('0x4'));var logger=require(_0x0ab4('0x5'))(_0x0ab4('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ab4('0x7')]['http']({'port':0x232a});config[_0x0ab4('0x8')]=_[_0x0ab4('0x9')](config[_0x0ab4('0x8')],{'host':_0x0ab4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0x0ab4('0xb')](socket);function respondWithRpcPromise(_0x30e726,_0x40e4d1,_0x464f7e){return new BPromise(function(_0x413d9b,_0x24c6c1){return client[_0x0ab4('0xc')](_0x30e726,_0x464f7e)[_0x0ab4('0xd')](function(_0x4e1708){logger['info'](_0x0ab4('0xe'),_0x40e4d1,'request\x20sent');logger[_0x0ab4('0xf')](_0x0ab4('0x10'),_0x40e4d1,_0x0ab4('0x11'),JSON[_0x0ab4('0x12')](_0x4e1708));if(_0x4e1708[_0x0ab4('0x13')]){if(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x14')]===0x1f4){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x24c6c1(_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);}logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x4e1708[_0x0ab4('0x13')][_0x0ab4('0x15')]);return _0x413d9b(_0x4e1708[_0x0ab4('0x13')]['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x40e4d1,_0x0ab4('0x11'));_0x413d9b(_0x4e1708[_0x0ab4('0x16')][_0x0ab4('0x15')]);}})['catch'](function(_0x1e3fe2){logger[_0x0ab4('0x13')](_0x0ab4('0xe'),_0x40e4d1,_0x1e3fe2);_0x24c6c1(_0x1e3fe2);});});}exports[_0x0ab4('0x17')]=function(_0x4e7852){var _0x4ff836=this;return new Promise(function(_0xdb0797,_0x5b1ed5){return db[_0x0ab4('0x18')][_0x0ab4('0x19')](_0x4e7852['body'],{'raw':_0x4e7852[_0x0ab4('0x1a')]?_0x4e7852[_0x0ab4('0x1a')][_0x0ab4('0x1b')]===undefined?!![]:![]:!![]})[_0x0ab4('0xd')](function(_0x12d06d){logger['info']('CreateMailMessage',_0x4e7852);logger[_0x0ab4('0xf')](_0x0ab4('0x17'),_0x4e7852,JSON[_0x0ab4('0x12')](_0x12d06d));_0xdb0797(_0x12d06d);})[_0x0ab4('0x1c')](function(_0x4e4b80){logger[_0x0ab4('0x13')](_0x0ab4('0x17'),_0x4e4b80[_0x0ab4('0x15')],_0x4e7852);_0x5b1ed5(_0x4ff836['error'](0x1f4,_0x4e4b80['message']));});});};
\ No newline at end of file
index 67c67b3..723c11d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5169=['save','remove','update','emit','removeListener','register'];(function(_0x32144d,_0x3bf972){var _0x47a0bf=function(_0x186ca9){while(--_0x186ca9){_0x32144d['push'](_0x32144d['shift']());}};_0x47a0bf(++_0x3bf972);}(_0x5169,0x180));var _0x9516=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x5169[_0x4b055c];return _0x4b62bb;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x9516('0x0'),_0x9516('0x1'),_0x9516('0x2')];function createListener(_0x56982d,_0x23380f){return function(_0x3b5332){_0x23380f[_0x9516('0x3')](_0x56982d,_0x3b5332);};}function removeListener(_0x199986,_0x41885b){return function(){MailMessageEvents[_0x9516('0x4')](_0x199986,_0x41885b);};}exports[_0x9516('0x5')]=function(_0x115488){for(var _0x43cc39=0x0,_0x4956a0=events['length'];_0x43cc39<_0x4956a0;_0x43cc39++){var _0x42c783=events[_0x43cc39];var _0x4ed0ef=createListener('mailMessage:'+_0x42c783,_0x115488);MailMessageEvents['on'](_0x42c783,_0x4ed0ef);}};
\ No newline at end of file
+var _0xb6a5=['removeListener','register','length','save','remove','emit'];(function(_0x4bccd7,_0x213c94){var _0x196ceb=function(_0x2accb0){while(--_0x2accb0){_0x4bccd7['push'](_0x4bccd7['shift']());}};_0x196ceb(++_0x213c94);}(_0xb6a5,0x7b));var _0x5b6a=function(_0x55642e,_0x3f7ab6){_0x55642e=_0x55642e-0x0;var _0x3e5fc9=_0xb6a5[_0x55642e];return _0x3e5fc9;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x5b6a('0x0'),_0x5b6a('0x1'),'update'];function createListener(_0x4b9d28,_0x5b681f){return function(_0x40d255){_0x5b681f[_0x5b6a('0x2')](_0x4b9d28,_0x40d255);};}function removeListener(_0x4dcab0,_0x5e2451){return function(){MailMessageEvents[_0x5b6a('0x3')](_0x4dcab0,_0x5e2451);};}exports[_0x5b6a('0x4')]=function(_0x1c8ad1){for(var _0x35633d=0x0,_0x28223e=events[_0x5b6a('0x5')];_0x35633d<_0x28223e;_0x35633d++){var _0xcc3db=events[_0x35633d];var _0x812619=createListener('mailMessage:'+_0xcc3db,_0x1c8ad1);MailMessageEvents['on'](_0xcc3db,_0x812619);}};
\ No newline at end of file
index 07d8a59..bcf1d1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5e26=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','get','/describe','describe','/:id','show','/:id/members','isAuthenticated','/:id/teams','getTeams','getAgents','create','post','addTeams','addAgents','put','update','delete','removeTeams','/:id/users','exports'];(function(_0x47e307,_0x25e36f){var _0x5d294e=function(_0x2d209c){while(--_0x2d209c){_0x47e307['push'](_0x47e307['shift']());}};_0x5d294e(++_0x25e36f);}(_0x5e26,0x74));var _0x65e2=function(_0x880aed,_0x16597b){_0x880aed=_0x880aed-0x0;var _0x40df37=_0x5e26[_0x880aed];return _0x40df37;};'use strict';var multer=require(_0x65e2('0x0'));var util=require(_0x65e2('0x1'));var path=require(_0x65e2('0x2'));var timeout=require(_0x65e2('0x3'));var express=require(_0x65e2('0x4'));var router=express[_0x65e2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x65e2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x65e2('0x7'));var controller=require(_0x65e2('0x8'));router[_0x65e2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x65e2('0x9')](_0x65e2('0xa'),auth['isAuthenticated'](),controller[_0x65e2('0xb')]);router[_0x65e2('0x9')](_0x65e2('0xc'),auth['isAuthenticated'](),controller[_0x65e2('0xd')]);router[_0x65e2('0x9')](_0x65e2('0xe'),auth[_0x65e2('0xf')](),controller['getMembers']);router[_0x65e2('0x9')](_0x65e2('0x10'),auth[_0x65e2('0xf')](),controller[_0x65e2('0x11')]);router['get']('/:id/users',auth[_0x65e2('0xf')](),controller[_0x65e2('0x12')]);router['post']('/',auth[_0x65e2('0xf')](),controller[_0x65e2('0x13')]);router[_0x65e2('0x14')](_0x65e2('0x10'),auth[_0x65e2('0xf')](),controller[_0x65e2('0x15')]);router['post']('/:id/users',auth[_0x65e2('0xf')](),controller[_0x65e2('0x16')]);router[_0x65e2('0x17')](_0x65e2('0xc'),auth[_0x65e2('0xf')](),controller[_0x65e2('0x18')]);router['delete']('/:id',auth[_0x65e2('0xf')](),controller['destroy']);router[_0x65e2('0x19')](_0x65e2('0x10'),auth[_0x65e2('0xf')](),controller[_0x65e2('0x1a')]);router['delete'](_0x65e2('0x1b'),auth[_0x65e2('0xf')](),controller['removeAgents']);module[_0x65e2('0x1c')]=router;
\ No newline at end of file
+var _0xddf5=['getAgents','post','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','isAuthenticated','index','describe','get','/:id','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xddf5,0xa6));var _0x5ddf=function(_0x5a36d9,_0x5b6735){_0x5a36d9=_0x5a36d9-0x0;var _0x3ea031=_0xddf5[_0x5a36d9];return _0x3ea031;};'use strict';var multer=require('multer');var util=require(_0x5ddf('0x0'));var path=require('path');var timeout=require(_0x5ddf('0x1'));var express=require(_0x5ddf('0x2'));var router=express[_0x5ddf('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5ddf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5ddf('0x5'));var controller=require(_0x5ddf('0x6'));router['get']('/',auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5ddf('0x9')]);router[_0x5ddf('0xa')](_0x5ddf('0xb'),auth[_0x5ddf('0x7')](),controller['show']);router[_0x5ddf('0xa')](_0x5ddf('0xc'),auth[_0x5ddf('0x7')](),controller['getMembers']);router[_0x5ddf('0xa')](_0x5ddf('0xd'),auth[_0x5ddf('0x7')](),controller[_0x5ddf('0xe')]);router[_0x5ddf('0xa')](_0x5ddf('0xf'),auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x10')]);router[_0x5ddf('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5ddf('0x11')](_0x5ddf('0xd'),auth[_0x5ddf('0x7')](),controller['addTeams']);router['post'](_0x5ddf('0xf'),auth['isAuthenticated'](),controller[_0x5ddf('0x12')]);router[_0x5ddf('0x13')](_0x5ddf('0xb'),auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x14')]);router[_0x5ddf('0x15')]('/:id',auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x16')]);router[_0x5ddf('0x15')](_0x5ddf('0xd'),auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x17')]);router['delete'](_0x5ddf('0xf'),auth[_0x5ddf('0x7')](),controller[_0x5ddf('0x18')]);module[_0x5ddf('0x19')]=router;
\ No newline at end of file
index 12ca7a0..f637056 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e53=['ENUM','rrmemory','STRING','name'];(function(_0x199ce5,_0x1280eb){var _0x4cf969=function(_0x3d14b0){while(--_0x3d14b0){_0x199ce5['push'](_0x199ce5['shift']());}};_0x4cf969(++_0x1280eb);}(_0x0e53,0xe2));var _0x30e5=function(_0x5e0006,_0x4fa05c){_0x5e0006=_0x5e0006-0x0;var _0x3292b2=_0x0e53[_0x5e0006];return _0x3292b2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x30e5('0x0')],'unique':_0x30e5('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x30e5('0x0')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x30e5('0x2')](_0x30e5('0x3'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0xb510=['ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','INTEGER'];(function(_0x29766f,_0x3d6aa8){var _0x3a23a0=function(_0x8a0df2){while(--_0x8a0df2){_0x29766f['push'](_0x29766f['shift']());}};_0x3a23a0(++_0x3d6aa8);}(_0xb510,0x16c));var _0x0b51=function(_0x4ae13b,_0x45e85e){_0x4ae13b=_0x4ae13b-0x0;var _0x427906=_0xb510[_0x4ae13b];return _0x427906;};'use strict';var Sequelize=require(_0x0b51('0x0'));module[_0x0b51('0x1')]={'name':{'type':Sequelize[_0x0b51('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0b51('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b51('0x4')](_0x0b51('0x5'),_0x0b51('0x6'),_0x0b51('0x7'))}};
\ No newline at end of file
index b5ceb93..a7ae979 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f42=['getAgents','eml-format','rimraf','zip-dir','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','error','stack','send','index','map','rawAttributes','type','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','MailQueue','findAll','catch','show','params','includeAll','include','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','describe','getMembers','findOne','keys','UserMailQueue','length','MailQueueId','filter','User','findAndCountAll','UserId','agent','mailPause','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','includes','all','union','value','isEmpty','emit','userMailQueue:remove','addAgents','spread','removeAgents'];(function(_0x2fa709,_0x3eb06a){var _0x2986a2=function(_0x1ce793){while(--_0x1ce793){_0x2fa709['push'](_0x2fa709['shift']());}};_0x2986a2(++_0x3eb06a);}(_0x5f42,0x10f));var _0x25f4=function(_0x24895b,_0x52d24d){_0x24895b=_0x24895b-0x0;var _0x345b01=_0x5f42[_0x24895b];return _0x345b01;};'use strict';var emlformat=require(_0x25f4('0x0'));var rimraf=require(_0x25f4('0x1'));var zipdir=require(_0x25f4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x25f4('0x3'));var Mustache=require('mustache');var util=require(_0x25f4('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x25f4('0x5'));var ejs=require(_0x25f4('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x25f4('0x7'));var squel=require(_0x25f4('0x8'));var crypto=require(_0x25f4('0x9'));var jsforce=require(_0x25f4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x25f4('0x5'));var querystring=require('querystring');var Papa=require(_0x25f4('0xb'));var Redis=require(_0x25f4('0xc'));var authService=require(_0x25f4('0xd'));var qs=require(_0x25f4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x25f4('0xf'));var logger=require(_0x25f4('0x10'))(_0x25f4('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x25f4('0x12'));var db=require('../../mysqldb')['db'];config[_0x25f4('0x13')]=_[_0x25f4('0x14')](config[_0x25f4('0x13')],{'host':_0x25f4('0x15'),'port':0x18eb});var socket=require(_0x25f4('0x16'))(new Redis(config[_0x25f4('0x13')]));require(_0x25f4('0x17'))['register'](socket);function respondWithStatusCode(_0x4505e5,_0x4780a9){_0x4780a9=_0x4780a9||0xcc;return function(_0x77f46e){if(_0x77f46e){return _0x4505e5[_0x25f4('0x18')](_0x4780a9);}return _0x4505e5[_0x25f4('0x19')](_0x4780a9)[_0x25f4('0x1a')]();};}function respondWithResult(_0x59c5d9,_0x103946){_0x103946=_0x103946||0xc8;return function(_0x32f083){if(_0x32f083){return _0x59c5d9['status'](_0x103946)[_0x25f4('0x1b')](_0x32f083);}};}function respondWithFilteredResult(_0x22b213,_0x197e61){return function(_0x66d7de){if(_0x66d7de){var _0x395e84=typeof _0x197e61[_0x25f4('0x1c')]===_0x25f4('0x1d')&&typeof _0x197e61[_0x25f4('0x1e')]===_0x25f4('0x1d');var _0xcfd6cc=_0x66d7de[_0x25f4('0x1f')];var _0x38847a=_0x395e84?0x0:_0x197e61[_0x25f4('0x1c')];var _0x5b3e64=_0x395e84?_0x66d7de['count']:_0x197e61[_0x25f4('0x1c')]+_0x197e61['limit'];var _0x38f417;if(_0x5b3e64>=_0xcfd6cc){_0x5b3e64=_0xcfd6cc;_0x38f417=0xc8;}else{_0x38f417=0xce;}_0x22b213[_0x25f4('0x19')](_0x38f417);return _0x22b213[_0x25f4('0x20')](_0x25f4('0x21'),_0x38847a+'-'+_0x5b3e64+'/'+_0xcfd6cc)['json'](_0x66d7de);}return null;};}function patchUpdates(_0x5d2b72){return function(_0x13fcf6){try{jsonpatch[_0x25f4('0x22')](_0x13fcf6,_0x5d2b72,!![]);}catch(_0x2a3585){return BPromise[_0x25f4('0x23')](_0x2a3585);}return _0x13fcf6[_0x25f4('0x24')]();};}function saveUpdates(_0x284f63,_0x52b7b7){return function(_0x54b81b){if(_0x54b81b){return _0x54b81b['update'](_0x284f63)[_0x25f4('0x25')](function(_0xa3c255){return _0xa3c255;});}return null;};}function removeEntity(_0x3d9546,_0x59f6cd){return function(_0xfd265f){if(_0xfd265f){return _0xfd265f[_0x25f4('0x26')]()[_0x25f4('0x25')](function(){var _0x11d367=_0xfd265f[_0x25f4('0x27')]({'plain':!![]});var _0x1d60df=_0x25f4('0x28');return db[_0x25f4('0x29')][_0x25f4('0x26')]({'where':{'type':_0x1d60df,'resourceId':_0x11d367['id']}})[_0x25f4('0x25')](function(){return _0xfd265f;});})[_0x25f4('0x25')](function(){_0x3d9546[_0x25f4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54eadb,_0x1bcd1a){return function(_0x406280){if(!_0x406280){_0x54eadb[_0x25f4('0x18')](0x194);}return _0x406280;};}function handleError(_0x222b21,_0x2e6122){_0x2e6122=_0x2e6122||0x1f4;return function(_0x582237){logger[_0x25f4('0x2a')](_0x582237[_0x25f4('0x2b')]);if(_0x582237['name']){delete _0x582237['name'];}_0x222b21[_0x25f4('0x19')](_0x2e6122)[_0x25f4('0x2c')](_0x582237);};}exports[_0x25f4('0x2d')]=function(_0x1e3b97,_0x5c2d14){var _0x393f1f={},_0x5be5d4={},_0x109166={'count':0x0,'rows':[]};var _0x53d467=_[_0x25f4('0x2e')](db['MailQueue'][_0x25f4('0x2f')],function(_0x4f9f0c){return{'name':_0x4f9f0c['fieldName'],'type':_0x4f9f0c[_0x25f4('0x30')]['key']};});_0x5be5d4[_0x25f4('0x31')]=_[_0x25f4('0x2e')](_0x53d467,_0x25f4('0x32'));_0x5be5d4[_0x25f4('0x33')]=_['keys'](_0x1e3b97[_0x25f4('0x33')]);_0x5be5d4[_0x25f4('0x34')]=_[_0x25f4('0x35')](_0x5be5d4[_0x25f4('0x31')],_0x5be5d4[_0x25f4('0x33')]);_0x393f1f[_0x25f4('0x36')]=_[_0x25f4('0x35')](_0x5be5d4[_0x25f4('0x31')],qs[_0x25f4('0x37')](_0x1e3b97[_0x25f4('0x33')]['fields']));_0x393f1f[_0x25f4('0x36')]=_0x393f1f['attributes']['length']?_0x393f1f[_0x25f4('0x36')]:_0x5be5d4[_0x25f4('0x31')];if(!_0x1e3b97['query'][_0x25f4('0x38')](_0x25f4('0x39'))){_0x393f1f[_0x25f4('0x1e')]=qs[_0x25f4('0x1e')](_0x1e3b97[_0x25f4('0x33')]['limit']);_0x393f1f[_0x25f4('0x1c')]=qs['offset'](_0x1e3b97[_0x25f4('0x33')][_0x25f4('0x1c')]);}_0x393f1f[_0x25f4('0x3a')]=qs[_0x25f4('0x3b')](_0x1e3b97[_0x25f4('0x33')][_0x25f4('0x3b')]);_0x393f1f[_0x25f4('0x3c')]=qs['filters'](_[_0x25f4('0x3d')](_0x1e3b97[_0x25f4('0x33')],_0x5be5d4[_0x25f4('0x34')]),_0x53d467);if(_0x1e3b97[_0x25f4('0x33')]['filter']){_0x393f1f[_0x25f4('0x3c')]=_['merge'](_0x393f1f[_0x25f4('0x3c')],{'$or':_[_0x25f4('0x2e')](_0x53d467,function(_0x4ca6a7){if(_0x4ca6a7[_0x25f4('0x30')]!=='VIRTUAL'){var _0xc056e4={};_0xc056e4[_0x4ca6a7[_0x25f4('0x32')]]={'$like':'%'+_0x1e3b97[_0x25f4('0x33')]['filter']+'%'};return _0xc056e4;}})});}_0x393f1f=_[_0x25f4('0x3e')]({},_0x393f1f,_0x1e3b97[_0x25f4('0x3f')]);var _0x33fa64={'where':_0x393f1f[_0x25f4('0x3c')]};return db[_0x25f4('0x40')][_0x25f4('0x1f')](_0x33fa64)[_0x25f4('0x25')](function(_0x5a3295){_0x109166[_0x25f4('0x1f')]=_0x5a3295;if(_0x1e3b97['query']['includeAll']){_0x393f1f['include']=[{'all':!![]}];}return db[_0x25f4('0x40')][_0x25f4('0x41')](_0x393f1f);})[_0x25f4('0x25')](function(_0x394462){_0x109166['rows']=_0x394462;return _0x109166;})[_0x25f4('0x25')](respondWithFilteredResult(_0x5c2d14,_0x393f1f))[_0x25f4('0x42')](handleError(_0x5c2d14,null));};exports[_0x25f4('0x43')]=function(_0x4b19c0,_0x10dd2f){var _0x4034c7={'raw':!![],'where':{'id':_0x4b19c0[_0x25f4('0x44')]['id']}},_0x1c2368={};_0x1c2368['model']=_['keys'](db['MailQueue'][_0x25f4('0x2f')]);_0x1c2368[_0x25f4('0x33')]=_['keys'](_0x4b19c0[_0x25f4('0x33')]);_0x1c2368[_0x25f4('0x34')]=_[_0x25f4('0x35')](_0x1c2368[_0x25f4('0x31')],_0x1c2368[_0x25f4('0x33')]);_0x4034c7[_0x25f4('0x36')]=_[_0x25f4('0x35')](_0x1c2368[_0x25f4('0x31')],qs[_0x25f4('0x37')](_0x4b19c0[_0x25f4('0x33')][_0x25f4('0x37')]));_0x4034c7[_0x25f4('0x36')]=_0x4034c7[_0x25f4('0x36')]['length']?_0x4034c7[_0x25f4('0x36')]:_0x1c2368['model'];if(_0x4b19c0[_0x25f4('0x33')][_0x25f4('0x45')]){_0x4034c7[_0x25f4('0x46')]=[{'all':!![]}];}_0x4034c7=_[_0x25f4('0x3e')]({},_0x4034c7,_0x4b19c0['options']);return db['MailQueue']['find'](_0x4034c7)['then'](handleEntityNotFound(_0x10dd2f,null))[_0x25f4('0x25')](respondWithResult(_0x10dd2f,null))[_0x25f4('0x42')](handleError(_0x10dd2f,null));};exports[_0x25f4('0x47')]=function(_0x1cf7e8,_0x25f2e0){return db[_0x25f4('0x40')][_0x25f4('0x47')](_0x1cf7e8[_0x25f4('0x48')],{})['then'](function(_0x48bd0c){var _0x4f2bfe=_0x1cf7e8[_0x25f4('0x49')][_0x25f4('0x27')]({'plain':!![]});if(!_0x4f2bfe)throw new Error(_0x25f4('0x4a'));if(_0x4f2bfe[_0x25f4('0x4b')]==='user'){var _0xfc82ec=_0x48bd0c[_0x25f4('0x27')]({'plain':!![]});var _0x23400c=_0x25f4('0x28');return db[_0x25f4('0x4c')]['find']({'where':{'name':_0x23400c,'userProfileId':_0x4f2bfe[_0x25f4('0x4d')]},'raw':!![]})[_0x25f4('0x25')](function(_0x19d805){if(_0x19d805&&_0x19d805[_0x25f4('0x4e')]===0x0){return db['UserProfileResource'][_0x25f4('0x47')]({'name':_0xfc82ec[_0x25f4('0x32')],'resourceId':_0xfc82ec['id'],'type':_0x19d805[_0x25f4('0x32')],'sectionId':_0x19d805['id']},{})['then'](function(){return _0x48bd0c;});}else{return _0x48bd0c;}})['catch'](function(_0x1f9953){logger['error'](_0x25f4('0x4f'),_0x1f9953);throw _0x1f9953;});}return _0x48bd0c;})[_0x25f4('0x25')](respondWithResult(_0x25f2e0,0xc9))[_0x25f4('0x42')](handleError(_0x25f2e0,null));};exports['update']=function(_0x4bf99b,_0x1c5b43){if(_0x4bf99b[_0x25f4('0x48')]['id']){delete _0x4bf99b[_0x25f4('0x48')]['id'];}return db[_0x25f4('0x40')][_0x25f4('0x50')]({'where':{'id':_0x4bf99b[_0x25f4('0x44')]['id']}})[_0x25f4('0x25')](handleEntityNotFound(_0x1c5b43,null))[_0x25f4('0x25')](saveUpdates(_0x4bf99b['body'],null))[_0x25f4('0x25')](respondWithResult(_0x1c5b43,null))[_0x25f4('0x42')](handleError(_0x1c5b43,null));};exports['destroy']=function(_0x556cd0,_0x45cec0){return db[_0x25f4('0x40')][_0x25f4('0x50')]({'where':{'id':_0x556cd0[_0x25f4('0x44')]['id']}})['then'](handleEntityNotFound(_0x45cec0,null))[_0x25f4('0x25')](removeEntity(_0x45cec0,null))[_0x25f4('0x42')](handleError(_0x45cec0,null));};exports['describe']=function(_0x4f850a,_0x535c78){return db[_0x25f4('0x40')][_0x25f4('0x51')]()['then'](respondWithResult(_0x535c78,null))[_0x25f4('0x42')](handleError(_0x535c78,null));};exports[_0x25f4('0x52')]=function(_0x3adaae,_0x39faef,_0x42ed57){var _0x25dd8f={'raw':!![],'where':{}},_0x22f912={},_0x3be035;return db['MailQueue'][_0x25f4('0x53')]({'where':{'id':_0x3adaae[_0x25f4('0x44')]['id']}})[_0x25f4('0x25')](handleEntityNotFound(_0x39faef,null))[_0x25f4('0x25')](function(_0x249412){if(_0x249412){_0x3be035=_0x249412[_0x25f4('0x27')]({'plain':!![]});_0x22f912[_0x25f4('0x31')]=_[_0x25f4('0x54')](db[_0x25f4('0x55')][_0x25f4('0x2f')]);_0x22f912['query']=_[_0x25f4('0x54')](_0x3adaae[_0x25f4('0x33')]);_0x22f912[_0x25f4('0x34')]=_[_0x25f4('0x35')](_0x22f912[_0x25f4('0x31')],_0x22f912[_0x25f4('0x33')]);_0x25dd8f[_0x25f4('0x36')]=_[_0x25f4('0x35')](_0x22f912['model'],qs['fields'](_0x3adaae['query']['fields']));_0x25dd8f[_0x25f4('0x36')]=_0x25dd8f['attributes'][_0x25f4('0x56')]?_0x25dd8f['attributes']:_0x22f912[_0x25f4('0x31')];if(!_0x3adaae[_0x25f4('0x33')]['hasOwnProperty'](_0x25f4('0x39'))){_0x25dd8f[_0x25f4('0x1e')]=qs['limit'](_0x3adaae[_0x25f4('0x33')][_0x25f4('0x1e')]);_0x25dd8f['offset']=qs[_0x25f4('0x1c')](_0x3adaae[_0x25f4('0x33')][_0x25f4('0x1c')]);}_0x25dd8f['order']=qs['sort'](_0x3adaae[_0x25f4('0x33')][_0x25f4('0x3b')]);_0x25dd8f[_0x25f4('0x3c')]=qs['filters'](_[_0x25f4('0x3d')](_0x3adaae[_0x25f4('0x33')],_0x22f912[_0x25f4('0x34')]));_0x25dd8f[_0x25f4('0x3c')][_0x25f4('0x57')]=_0x249412['id'];if(_0x3adaae['query'][_0x25f4('0x58')]){_0x25dd8f[_0x25f4('0x3c')]=_[_0x25f4('0x3e')](_0x25dd8f[_0x25f4('0x3c')],{'$or':_['map'](_0x25dd8f[_0x25f4('0x36')],function(_0x26d032){var _0x512238={};_0x512238[_0x26d032]={'$like':'%'+_0x3adaae[_0x25f4('0x33')][_0x25f4('0x58')]+'%'};return _0x512238;})});}_0x25dd8f=_['merge']({},_0x25dd8f,_0x3adaae[_0x25f4('0x3f')]);return db[_0x25f4('0x55')][_0x25f4('0x41')](_0x25dd8f);}})[_0x25f4('0x25')](function(_0x257cd8){if(_0x257cd8){return db[_0x25f4('0x59')][_0x25f4('0x5a')]({'where':{'id':_['map'](_0x257cd8,_0x25f4('0x5b')),'role':_0x25f4('0x5c')},'attributes':['id','name',_0x25f4('0x5d'),'updatedAt','createdAt']});}})['then'](function(_0x403a1e){if(_0x403a1e){return{'count':_0x403a1e['count'],'rows':_[_0x25f4('0x2e')](_0x403a1e['rows'],function(_0x2818c2){return{'membername':_0x2818c2[_0x25f4('0x32')],'UserId':_0x2818c2['id'],'queue_name':_0x3be035['name'],'MailQueueId':_0x3be035['id'],'interface':util['format'](_0x25f4('0x5e'),_0x25f4('0x5f'),_0x2818c2[_0x25f4('0x32')]),'penalty':0x0,'paused':_0x2818c2[_0x25f4('0x5d')],'createdAt':_0x2818c2[_0x25f4('0x60')],'updatedAt':_0x2818c2[_0x25f4('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x25f4('0x25')](respondWithFilteredResult(_0x39faef,_0x25dd8f))[_0x25f4('0x42')](handleError(_0x39faef,null));};exports[_0x25f4('0x62')]=function(_0x121758,_0x2d750f,_0x3fe8b1){var _0x19f9b0={};var _0x1c4c95={};var _0x3caeb7;var _0x57148c;return db[_0x25f4('0x40')][_0x25f4('0x53')]({'where':{'id':_0x121758[_0x25f4('0x44')]['id']}})[_0x25f4('0x25')](handleEntityNotFound(_0x2d750f,null))[_0x25f4('0x25')](function(_0x4da74b){if(_0x4da74b){_0x3caeb7=_0x4da74b;_0x1c4c95[_0x25f4('0x31')]=_[_0x25f4('0x54')](db[_0x25f4('0x63')][_0x25f4('0x2f')]);_0x1c4c95[_0x25f4('0x33')]=_[_0x25f4('0x54')](_0x121758[_0x25f4('0x33')]);_0x1c4c95['filters']=_[_0x25f4('0x35')](_0x1c4c95[_0x25f4('0x31')],_0x1c4c95[_0x25f4('0x33')]);_0x19f9b0[_0x25f4('0x36')]=_[_0x25f4('0x35')](_0x1c4c95['model'],qs[_0x25f4('0x37')](_0x121758[_0x25f4('0x33')][_0x25f4('0x37')]));_0x19f9b0[_0x25f4('0x36')]=_0x19f9b0['attributes']['length']?_0x19f9b0[_0x25f4('0x36')]:_0x1c4c95['model'];_0x19f9b0[_0x25f4('0x3a')]=qs[_0x25f4('0x3b')](_0x121758[_0x25f4('0x33')][_0x25f4('0x3b')]);_0x19f9b0[_0x25f4('0x3c')]=qs[_0x25f4('0x34')](_[_0x25f4('0x3d')](_0x121758[_0x25f4('0x33')],_0x1c4c95[_0x25f4('0x34')]));if(_0x121758[_0x25f4('0x33')][_0x25f4('0x58')]){_0x19f9b0[_0x25f4('0x3c')]=_[_0x25f4('0x3e')](_0x19f9b0['where'],{'$or':_[_0x25f4('0x2e')](_0x19f9b0[_0x25f4('0x36')],function(_0x129505){var _0x52c664={};_0x52c664[_0x129505]={'$like':'%'+_0x121758[_0x25f4('0x33')][_0x25f4('0x58')]+'%'};return _0x52c664;})});}_0x19f9b0=_['merge']({},_0x19f9b0,_0x121758['options']);return _0x3caeb7[_0x25f4('0x62')](_0x19f9b0);}})[_0x25f4('0x25')](function(_0x39aa19){if(_0x39aa19){_0x57148c=_0x39aa19[_0x25f4('0x56')];if(!_0x121758[_0x25f4('0x33')][_0x25f4('0x38')](_0x25f4('0x39'))){_0x19f9b0['limit']=qs['limit'](_0x121758[_0x25f4('0x33')][_0x25f4('0x1e')]);_0x19f9b0['offset']=qs[_0x25f4('0x1c')](_0x121758['query'][_0x25f4('0x1c')]);}return _0x3caeb7[_0x25f4('0x62')](_0x19f9b0);}})['then'](function(_0x22e1fb){if(_0x22e1fb){return _0x22e1fb?{'count':_0x57148c,'rows':_0x22e1fb}:null;}})['then'](respondWithResult(_0x2d750f,null))[_0x25f4('0x42')](handleError(_0x2d750f,null));};exports[_0x25f4('0x64')]=function(_0x21acc5,_0x4ce2b6,_0xd6c6e3){var _0x4cf183=_0x21acc5[_0x25f4('0x48')][_0x25f4('0x65')];return db[_0x25f4('0x63')]['findAll']({'where':{'id':_0x4cf183},'attributes':['id'],'include':[{'model':db[_0x25f4('0x59')],'as':_0x25f4('0x66'),'attributes':['id',_0x25f4('0x32'),_0x25f4('0x67'),_0x25f4('0x68'),_0x25f4('0x69')],'raw':!![]}]})[_0x25f4('0x25')](function(_0x241a15){if(_0x241a15){var _0x2881e5=_[_0x25f4('0x6a')](_0x241a15,function(_0x10abf1){var _0x327e41=_0x10abf1[_0x25f4('0x27')]({'plain':!![]});return _0x327e41[_0x25f4('0x66')];});return db[_0x25f4('0x40')]['find']({'where':{'id':_0x21acc5[_0x25f4('0x44')]['id']}})[_0x25f4('0x25')](function(_0x1afb65){return db[_0x25f4('0x6b')][_0x25f4('0x6c')](function(_0x2b1dc4){return _0x1afb65[_0x25f4('0x64')](_0x4cf183,{'transaction':_0x2b1dc4})['then'](function(){return BPromise[_0x25f4('0x6d')](_0x2881e5,function(_0x12d59c){return db[_0x25f4('0x55')][_0x25f4('0x6e')]({'where':{'UserId':_0x12d59c['id'],'MailQueueId':_0x21acc5[_0x25f4('0x44')]['id']},'transaction':_0x2b1dc4});});})['then'](function(){_0x2881e5[_0x25f4('0x6f')](function(_0x5e1966){socket['emit'](_0x25f4('0x70'),{'UserId':_0x5e1966['id'],'MailQueueId':_0x1afb65['id']});});});});});}})[_0x25f4('0x25')](respondWithStatusCode(_0x4ce2b6,null))[_0x25f4('0x42')](handleError(_0x4ce2b6,null));};exports[_0x25f4('0x71')]=function(_0x2eb55d,_0xfa22dd,_0x2199e2){return db[_0x25f4('0x63')][_0x25f4('0x41')]({'where':{'id':_0x2eb55d[_0x25f4('0x33')]['ids']},'attributes':['id'],'include':[{'model':db[_0x25f4('0x59')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x25f4('0x25')](handleEntityNotFound(_0xfa22dd,null))[_0x25f4('0x25')](function(_0x328eba){var _0x20938f=_[_0x25f4('0x2e')](_0x328eba,'id');var _0x349cbf=[];var _0x5a0ea5=[];var _0x459375=squel[_0x25f4('0x72')]();_0x459375[_0x25f4('0x73')](_0x25f4('0x74'))['from'](_0x25f4('0x75'),'tq')[_0x25f4('0x76')](_0x25f4('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x25f4('0x3c')]('MailQueueId\x20=\x20?',_0x2eb55d[_0x25f4('0x44')]['id']);for(var _0x5f51b6=0x0;_0x5f51b6<_0x328eba[_0x25f4('0x56')];_0x5f51b6+=0x1){let _0x3b2cc4=_0x328eba[_0x5f51b6];for(var _0x506222=0x0;_0x506222<_0x3b2cc4[_0x25f4('0x66')][_0x25f4('0x56')];_0x506222+=0x1){let _0x2cbf6f=_0x3b2cc4[_0x25f4('0x66')][_0x506222];var _0x4aae2d=_0x459375['clone']();_0x4aae2d['where'](_0x25f4('0x78'),_0x2cbf6f['id']);_0x5a0ea5['push'](db[_0x25f4('0x6b')][_0x25f4('0x33')](_0x4aae2d['toString'](),{'type':db[_0x25f4('0x6b')][_0x25f4('0x79')][_0x25f4('0x7a')]})[_0x25f4('0x25')](function(_0xbd8287){if(_0xbd8287['length']===0x1){return _0x2cbf6f['id'];}else{var _0x47cd77=_[_0x25f4('0x7b')](_[_0x25f4('0x2e')](_0xbd8287,'TeamId'),function(_0x336b57){return _[_0x25f4('0x7c')](_0x20938f,_0x336b57);});if(_0x47cd77){return _0x2cbf6f['id'];}}}));}}return BPromise[_0x25f4('0x7d')](_0x5a0ea5)[_0x25f4('0x25')](function(_0x3b6f06){_0x349cbf=_(_0x349cbf)[_0x25f4('0x7e')](_0x3b6f06)['compact']()[_0x25f4('0x7f')]();return db[_0x25f4('0x40')]['find']({'where':{'id':_0x2eb55d[_0x25f4('0x44')]['id']}})[_0x25f4('0x25')](function(_0x4db094){return db['sequelize'][_0x25f4('0x6c')](function(_0x80e4ff){return _0x4db094[_0x25f4('0x71')](_0x2eb55d[_0x25f4('0x33')][_0x25f4('0x65')],{'transaction':_0x80e4ff})[_0x25f4('0x25')](function(){if(!_[_0x25f4('0x80')](_0x349cbf)){return _0x4db094['removeAgents'](_0x349cbf,{'transaction':_0x80e4ff});}})['then'](function(){_0x349cbf[_0x25f4('0x6f')](function(_0x40fccd){socket[_0x25f4('0x81')](_0x25f4('0x82'),{'UserId':_0x40fccd,'MailQueueId':_0x4db094['id']});});});});});});})[_0x25f4('0x25')](respondWithStatusCode(_0xfa22dd,null))['catch'](handleError(_0xfa22dd,null));};exports[_0x25f4('0x83')]=function(_0x1eac4c,_0x5095a8,_0x8355c6){return db[_0x25f4('0x40')][_0x25f4('0x50')]({'where':{'id':_0x1eac4c[_0x25f4('0x44')]['id']}})[_0x25f4('0x25')](handleEntityNotFound(_0x5095a8,null))[_0x25f4('0x25')](function(_0x1a640e){if(_0x1a640e){return _0x1a640e['addAgents'](_0x1eac4c['body'][_0x25f4('0x65')],_['omit'](_0x1eac4c['body'],[_0x25f4('0x65'),'id'])||{})[_0x25f4('0x84')](function(_0x138ae2){for(var _0x487074=0x0;_0x487074<_0x1eac4c[_0x25f4('0x48')]['ids'][_0x25f4('0x56')];_0x487074+=0x1){socket[_0x25f4('0x81')](_0x25f4('0x70'),{'UserId':Number(_0x1eac4c[_0x25f4('0x48')]['ids'][_0x487074]),'MailQueueId':Number(_0x1eac4c[_0x25f4('0x44')]['id'])});}return _0x138ae2;});}})[_0x25f4('0x25')](respondWithResult(_0x5095a8,null))[_0x25f4('0x42')](handleError(_0x5095a8,null));};exports[_0x25f4('0x85')]=function(_0xd30b7e,_0xd4c4fa,_0xfab804){return db[_0x25f4('0x40')][_0x25f4('0x50')]({'where':{'id':_0xd30b7e[_0x25f4('0x44')]['id']}})['then'](handleEntityNotFound(_0xd4c4fa,null))[_0x25f4('0x25')](function(_0x2ead80){if(_0x2ead80){return _0x2ead80[_0x25f4('0x85')](_0xd30b7e[_0x25f4('0x33')][_0x25f4('0x65')])[_0x25f4('0x25')](function(){if(_['isArray'](_0xd30b7e[_0x25f4('0x33')][_0x25f4('0x65')])){for(var _0x590774=0x0;_0x590774<_0xd30b7e[_0x25f4('0x33')][_0x25f4('0x65')][_0x25f4('0x56')];_0x590774+=0x1){socket[_0x25f4('0x81')](_0x25f4('0x82'),{'UserId':Number(_0xd30b7e[_0x25f4('0x33')]['ids'][_0x590774]),'MailQueueId':Number(_0xd30b7e[_0x25f4('0x44')]['id'])});}}else{socket['emit'](_0x25f4('0x82'),{'UserId':Number(_0xd30b7e['query'][_0x25f4('0x65')]),'MailQueueId':Number(_0xd30b7e[_0x25f4('0x44')]['id'])});}});}})[_0x25f4('0x25')](respondWithStatusCode(_0xd4c4fa,null))[_0x25f4('0x42')](handleError(_0xd4c4fa,null));};exports[_0x25f4('0x86')]=function(_0x52f53c,_0x2d961f,_0x3992d8){var _0x5cdbc0={};var _0x42ce82={};var _0x5cb394;var _0x5d2609;return db[_0x25f4('0x40')]['findOne']({'where':{'id':_0x52f53c[_0x25f4('0x44')]['id']}})[_0x25f4('0x25')](handleEntityNotFound(_0x2d961f,null))['then'](function(_0x4a6640){if(_0x4a6640){_0x5cb394=_0x4a6640;_0x42ce82[_0x25f4('0x31')]=_['keys'](db[_0x25f4('0x59')][_0x25f4('0x2f')]);_0x42ce82[_0x25f4('0x33')]=_['keys'](_0x52f53c[_0x25f4('0x33')]);_0x42ce82['filters']=_[_0x25f4('0x35')](_0x42ce82[_0x25f4('0x31')],_0x42ce82['query']);_0x5cdbc0[_0x25f4('0x36')]=_[_0x25f4('0x35')](_0x42ce82[_0x25f4('0x31')],qs[_0x25f4('0x37')](_0x52f53c['query'][_0x25f4('0x37')]));_0x5cdbc0[_0x25f4('0x36')]=_0x5cdbc0['attributes'][_0x25f4('0x56')]?_0x5cdbc0['attributes']:_0x42ce82[_0x25f4('0x31')];_0x5cdbc0[_0x25f4('0x3a')]=qs[_0x25f4('0x3b')](_0x52f53c[_0x25f4('0x33')]['sort']);_0x5cdbc0[_0x25f4('0x3c')]=qs[_0x25f4('0x34')](_[_0x25f4('0x3d')](_0x52f53c[_0x25f4('0x33')],_0x42ce82['filters']));if(_0x52f53c['query'][_0x25f4('0x58')]){_0x5cdbc0[_0x25f4('0x3c')]=_[_0x25f4('0x3e')](_0x5cdbc0[_0x25f4('0x3c')],{'$or':_[_0x25f4('0x2e')](_0x5cdbc0[_0x25f4('0x36')],function(_0x32b31f){var _0x331050={};_0x331050[_0x32b31f]={'$like':'%'+_0x52f53c[_0x25f4('0x33')]['filter']+'%'};return _0x331050;})});}_0x5cdbc0=_['merge']({},_0x5cdbc0,_0x52f53c[_0x25f4('0x3f')]);return _0x5cb394[_0x25f4('0x86')](_0x5cdbc0);}})[_0x25f4('0x25')](function(_0x364f9d){if(_0x364f9d){_0x5d2609=_0x364f9d[_0x25f4('0x56')];if(!_0x52f53c['query'][_0x25f4('0x38')]('nolimit')){_0x5cdbc0[_0x25f4('0x1e')]=qs['limit'](_0x52f53c['query'][_0x25f4('0x1e')]);_0x5cdbc0[_0x25f4('0x1c')]=qs[_0x25f4('0x1c')](_0x52f53c[_0x25f4('0x33')][_0x25f4('0x1c')]);}return _0x5cb394[_0x25f4('0x86')](_0x5cdbc0);}})[_0x25f4('0x25')](function(_0x355cd9){if(_0x355cd9){return _0x355cd9?{'count':_0x5d2609,'rows':_0x355cd9}:null;}})[_0x25f4('0x25')](respondWithResult(_0x2d961f,null))[_0x25f4('0x42')](handleError(_0x2d961f,null));};
\ No newline at end of file
+var _0x6690=['../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','end','error','name','send','index','map','MailQueue','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','body','describe','getMembers','findOne','UserMailQueue','order','pick','MailQueueId','User','findAndCountAll','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','userMailQueue:remove','addAgents','omit','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x6690,0x7a));var _0x0669=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x6690[_0x46aff0];return _0x9d78cf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0669('0x0'));var zipdir=require(_0x0669('0x1'));var jsonpatch=require(_0x0669('0x2'));var rp=require(_0x0669('0x3'));var moment=require('moment');var BPromise=require(_0x0669('0x4'));var Mustache=require(_0x0669('0x5'));var util=require(_0x0669('0x6'));var path=require(_0x0669('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0669('0x8'));var _=require(_0x0669('0x9'));var squel=require(_0x0669('0xa'));var crypto=require('crypto');var jsforce=require(_0x0669('0xb'));var deskjs=require(_0x0669('0xc'));var toCsv=require(_0x0669('0xd'));var querystring=require('querystring');var Papa=require(_0x0669('0xe'));var Redis=require('ioredis');var authService=require(_0x0669('0xf'));var qs=require(_0x0669('0x10'));var as=require(_0x0669('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0669('0x12'))('api');var utils=require(_0x0669('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0669('0x14'))['db'];config[_0x0669('0x15')]=_['defaults'](config[_0x0669('0x15')],{'host':_0x0669('0x16'),'port':0x18eb});var socket=require(_0x0669('0x17'))(new Redis(config[_0x0669('0x15')]));require(_0x0669('0x18'))[_0x0669('0x19')](socket);function respondWithStatusCode(_0x382ad1,_0x24ee8b){_0x24ee8b=_0x24ee8b||0xcc;return function(_0x124daf){if(_0x124daf){return _0x382ad1['sendStatus'](_0x24ee8b);}return _0x382ad1[_0x0669('0x1a')](_0x24ee8b)['end']();};}function respondWithResult(_0x3f1a35,_0x27d3aa){_0x27d3aa=_0x27d3aa||0xc8;return function(_0x5ddef6){if(_0x5ddef6){return _0x3f1a35[_0x0669('0x1a')](_0x27d3aa)[_0x0669('0x1b')](_0x5ddef6);}};}function respondWithFilteredResult(_0x437849,_0x848712){return function(_0x599c45){if(_0x599c45){var _0x21fd18=typeof _0x848712['offset']===_0x0669('0x1c')&&typeof _0x848712[_0x0669('0x1d')]===_0x0669('0x1c');var _0x9e6d41=_0x599c45[_0x0669('0x1e')];var _0x489ad3=_0x21fd18?0x0:_0x848712['offset'];var _0x23abc1=_0x21fd18?_0x599c45['count']:_0x848712[_0x0669('0x1f')]+_0x848712[_0x0669('0x1d')];var _0xdf95f2;if(_0x23abc1>=_0x9e6d41){_0x23abc1=_0x9e6d41;_0xdf95f2=0xc8;}else{_0xdf95f2=0xce;}_0x437849[_0x0669('0x1a')](_0xdf95f2);return _0x437849[_0x0669('0x20')]('Content-Range',_0x489ad3+'-'+_0x23abc1+'/'+_0x9e6d41)['json'](_0x599c45);}return null;};}function patchUpdates(_0x31d1df){return function(_0x312e4a){try{jsonpatch[_0x0669('0x21')](_0x312e4a,_0x31d1df,!![]);}catch(_0x30cb44){return BPromise[_0x0669('0x22')](_0x30cb44);}return _0x312e4a[_0x0669('0x23')]();};}function saveUpdates(_0x557d33,_0x276b45){return function(_0x2dfeb8){if(_0x2dfeb8){return _0x2dfeb8['update'](_0x557d33)[_0x0669('0x24')](function(_0x184cbf){return _0x184cbf;});}return null;};}function removeEntity(_0xe21283,_0x4a9416){return function(_0x4fc05a){if(_0x4fc05a){return _0x4fc05a[_0x0669('0x25')]()[_0x0669('0x24')](function(){var _0x2757f7=_0x4fc05a[_0x0669('0x26')]({'plain':!![]});var _0x52aa83=_0x0669('0x27');return db[_0x0669('0x28')][_0x0669('0x25')]({'where':{'type':_0x52aa83,'resourceId':_0x2757f7['id']}})[_0x0669('0x24')](function(){return _0x4fc05a;});})[_0x0669('0x24')](function(){_0xe21283['status'](0xcc)[_0x0669('0x29')]();});}};}function handleEntityNotFound(_0x3a2c24,_0x250997){return function(_0x149636){if(!_0x149636){_0x3a2c24['sendStatus'](0x194);}return _0x149636;};}function handleError(_0x3c3a80,_0x3bfbea){_0x3bfbea=_0x3bfbea||0x1f4;return function(_0x1f82b2){logger[_0x0669('0x2a')](_0x1f82b2['stack']);if(_0x1f82b2[_0x0669('0x2b')]){delete _0x1f82b2['name'];}_0x3c3a80[_0x0669('0x1a')](_0x3bfbea)[_0x0669('0x2c')](_0x1f82b2);};}exports[_0x0669('0x2d')]=function(_0x4c50af,_0x24787b){var _0x39f7af={},_0x53b5d1={},_0x28ef2e={'count':0x0,'rows':[]};var _0x3dea96=_[_0x0669('0x2e')](db[_0x0669('0x2f')][_0x0669('0x30')],function(_0xc9a34){return{'name':_0xc9a34['fieldName'],'type':_0xc9a34['type'][_0x0669('0x31')]};});_0x53b5d1[_0x0669('0x32')]=_[_0x0669('0x2e')](_0x3dea96,_0x0669('0x2b'));_0x53b5d1[_0x0669('0x33')]=_[_0x0669('0x34')](_0x4c50af['query']);_0x53b5d1[_0x0669('0x35')]=_['intersection'](_0x53b5d1['model'],_0x53b5d1[_0x0669('0x33')]);_0x39f7af['attributes']=_[_0x0669('0x36')](_0x53b5d1['model'],qs[_0x0669('0x37')](_0x4c50af[_0x0669('0x33')][_0x0669('0x37')]));_0x39f7af[_0x0669('0x38')]=_0x39f7af[_0x0669('0x38')][_0x0669('0x39')]?_0x39f7af[_0x0669('0x38')]:_0x53b5d1[_0x0669('0x32')];if(!_0x4c50af['query'][_0x0669('0x3a')](_0x0669('0x3b'))){_0x39f7af[_0x0669('0x1d')]=qs[_0x0669('0x1d')](_0x4c50af[_0x0669('0x33')][_0x0669('0x1d')]);_0x39f7af[_0x0669('0x1f')]=qs[_0x0669('0x1f')](_0x4c50af[_0x0669('0x33')]['offset']);}_0x39f7af['order']=qs[_0x0669('0x3c')](_0x4c50af[_0x0669('0x33')][_0x0669('0x3c')]);_0x39f7af['where']=qs['filters'](_['pick'](_0x4c50af[_0x0669('0x33')],_0x53b5d1[_0x0669('0x35')]),_0x3dea96);if(_0x4c50af[_0x0669('0x33')][_0x0669('0x3d')]){_0x39f7af[_0x0669('0x3e')]=_[_0x0669('0x3f')](_0x39f7af[_0x0669('0x3e')],{'$or':_[_0x0669('0x2e')](_0x3dea96,function(_0x4215a0){if(_0x4215a0[_0x0669('0x40')]!==_0x0669('0x41')){var _0x3fcd4f={};_0x3fcd4f[_0x4215a0[_0x0669('0x2b')]]={'$like':'%'+_0x4c50af[_0x0669('0x33')]['filter']+'%'};return _0x3fcd4f;}})});}_0x39f7af=_[_0x0669('0x3f')]({},_0x39f7af,_0x4c50af['options']);var _0x3e87b1={'where':_0x39f7af[_0x0669('0x3e')]};return db[_0x0669('0x2f')][_0x0669('0x1e')](_0x3e87b1)[_0x0669('0x24')](function(_0x3a7690){_0x28ef2e['count']=_0x3a7690;if(_0x4c50af['query']['includeAll']){_0x39f7af[_0x0669('0x42')]=[{'all':!![]}];}return db[_0x0669('0x2f')][_0x0669('0x43')](_0x39f7af);})[_0x0669('0x24')](function(_0x31ca7e){_0x28ef2e[_0x0669('0x44')]=_0x31ca7e;return _0x28ef2e;})[_0x0669('0x24')](respondWithFilteredResult(_0x24787b,_0x39f7af))[_0x0669('0x45')](handleError(_0x24787b,null));};exports[_0x0669('0x46')]=function(_0xd89bd5,_0x5d3d38){var _0x49e854={'raw':!![],'where':{'id':_0xd89bd5[_0x0669('0x47')]['id']}},_0x80caef={};_0x80caef['model']=_[_0x0669('0x34')](db[_0x0669('0x2f')][_0x0669('0x30')]);_0x80caef[_0x0669('0x33')]=_[_0x0669('0x34')](_0xd89bd5[_0x0669('0x33')]);_0x80caef[_0x0669('0x35')]=_[_0x0669('0x36')](_0x80caef[_0x0669('0x32')],_0x80caef['query']);_0x49e854[_0x0669('0x38')]=_[_0x0669('0x36')](_0x80caef[_0x0669('0x32')],qs[_0x0669('0x37')](_0xd89bd5[_0x0669('0x33')][_0x0669('0x37')]));_0x49e854[_0x0669('0x38')]=_0x49e854[_0x0669('0x38')][_0x0669('0x39')]?_0x49e854[_0x0669('0x38')]:_0x80caef[_0x0669('0x32')];if(_0xd89bd5[_0x0669('0x33')][_0x0669('0x48')]){_0x49e854[_0x0669('0x42')]=[{'all':!![]}];}_0x49e854=_[_0x0669('0x3f')]({},_0x49e854,_0xd89bd5[_0x0669('0x49')]);return db['MailQueue'][_0x0669('0x4a')](_0x49e854)[_0x0669('0x24')](handleEntityNotFound(_0x5d3d38,null))[_0x0669('0x24')](respondWithResult(_0x5d3d38,null))[_0x0669('0x45')](handleError(_0x5d3d38,null));};exports[_0x0669('0x4b')]=function(_0x4963dd,_0x4a36ea){return db[_0x0669('0x2f')]['create'](_0x4963dd['body'],{})['then'](function(_0x30124c){var _0x3a8279=_0x4963dd[_0x0669('0x4c')][_0x0669('0x26')]({'plain':!![]});if(!_0x3a8279)throw new Error(_0x0669('0x4d'));if(_0x3a8279[_0x0669('0x4e')]===_0x0669('0x4c')){var _0x40a33f=_0x30124c[_0x0669('0x26')]({'plain':!![]});var _0x25d254=_0x0669('0x27');return db[_0x0669('0x4f')][_0x0669('0x4a')]({'where':{'name':_0x25d254,'userProfileId':_0x3a8279[_0x0669('0x50')]},'raw':!![]})[_0x0669('0x24')](function(_0x2f0eeb){if(_0x2f0eeb&&_0x2f0eeb[_0x0669('0x51')]===0x0){return db[_0x0669('0x28')][_0x0669('0x4b')]({'name':_0x40a33f['name'],'resourceId':_0x40a33f['id'],'type':_0x2f0eeb['name'],'sectionId':_0x2f0eeb['id']},{})[_0x0669('0x24')](function(){return _0x30124c;});}else{return _0x30124c;}})['catch'](function(_0x2e05dc){logger[_0x0669('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2e05dc);throw _0x2e05dc;});}return _0x30124c;})[_0x0669('0x24')](respondWithResult(_0x4a36ea,0xc9))['catch'](handleError(_0x4a36ea,null));};exports[_0x0669('0x52')]=function(_0x3f3125,_0x3e3bdb){if(_0x3f3125[_0x0669('0x53')]['id']){delete _0x3f3125['body']['id'];}return db[_0x0669('0x2f')][_0x0669('0x4a')]({'where':{'id':_0x3f3125[_0x0669('0x47')]['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x3e3bdb,null))[_0x0669('0x24')](saveUpdates(_0x3f3125[_0x0669('0x53')],null))[_0x0669('0x24')](respondWithResult(_0x3e3bdb,null))[_0x0669('0x45')](handleError(_0x3e3bdb,null));};exports[_0x0669('0x25')]=function(_0x228661,_0x45a73a){return db[_0x0669('0x2f')][_0x0669('0x4a')]({'where':{'id':_0x228661[_0x0669('0x47')]['id']}})['then'](handleEntityNotFound(_0x45a73a,null))[_0x0669('0x24')](removeEntity(_0x45a73a,null))[_0x0669('0x45')](handleError(_0x45a73a,null));};exports[_0x0669('0x54')]=function(_0x353c77,_0x1b3b9f){return db[_0x0669('0x2f')][_0x0669('0x54')]()[_0x0669('0x24')](respondWithResult(_0x1b3b9f,null))[_0x0669('0x45')](handleError(_0x1b3b9f,null));};exports[_0x0669('0x55')]=function(_0x4d2db8,_0x4648e3,_0x1850ae){var _0x36a9f1={'raw':!![],'where':{}},_0x5c729e={},_0x10bdd8;return db[_0x0669('0x2f')][_0x0669('0x56')]({'where':{'id':_0x4d2db8['params']['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x4648e3,null))['then'](function(_0x32ad3c){if(_0x32ad3c){_0x10bdd8=_0x32ad3c['get']({'plain':!![]});_0x5c729e[_0x0669('0x32')]=_[_0x0669('0x34')](db[_0x0669('0x57')][_0x0669('0x30')]);_0x5c729e[_0x0669('0x33')]=_[_0x0669('0x34')](_0x4d2db8[_0x0669('0x33')]);_0x5c729e['filters']=_[_0x0669('0x36')](_0x5c729e[_0x0669('0x32')],_0x5c729e[_0x0669('0x33')]);_0x36a9f1[_0x0669('0x38')]=_[_0x0669('0x36')](_0x5c729e[_0x0669('0x32')],qs[_0x0669('0x37')](_0x4d2db8[_0x0669('0x33')][_0x0669('0x37')]));_0x36a9f1[_0x0669('0x38')]=_0x36a9f1['attributes'][_0x0669('0x39')]?_0x36a9f1['attributes']:_0x5c729e['model'];if(!_0x4d2db8[_0x0669('0x33')][_0x0669('0x3a')](_0x0669('0x3b'))){_0x36a9f1[_0x0669('0x1d')]=qs[_0x0669('0x1d')](_0x4d2db8[_0x0669('0x33')][_0x0669('0x1d')]);_0x36a9f1[_0x0669('0x1f')]=qs[_0x0669('0x1f')](_0x4d2db8['query'][_0x0669('0x1f')]);}_0x36a9f1[_0x0669('0x58')]=qs['sort'](_0x4d2db8['query']['sort']);_0x36a9f1[_0x0669('0x3e')]=qs[_0x0669('0x35')](_[_0x0669('0x59')](_0x4d2db8['query'],_0x5c729e[_0x0669('0x35')]));_0x36a9f1[_0x0669('0x3e')][_0x0669('0x5a')]=_0x32ad3c['id'];if(_0x4d2db8[_0x0669('0x33')]['filter']){_0x36a9f1[_0x0669('0x3e')]=_[_0x0669('0x3f')](_0x36a9f1[_0x0669('0x3e')],{'$or':_['map'](_0x36a9f1['attributes'],function(_0x218b4c){var _0x11a4c3={};_0x11a4c3[_0x218b4c]={'$like':'%'+_0x4d2db8[_0x0669('0x33')][_0x0669('0x3d')]+'%'};return _0x11a4c3;})});}_0x36a9f1=_[_0x0669('0x3f')]({},_0x36a9f1,_0x4d2db8[_0x0669('0x49')]);return db[_0x0669('0x57')][_0x0669('0x43')](_0x36a9f1);}})[_0x0669('0x24')](function(_0x19a807){if(_0x19a807){return db[_0x0669('0x5b')][_0x0669('0x5c')]({'where':{'id':_[_0x0669('0x2e')](_0x19a807,'UserId'),'role':_0x0669('0x5d')},'attributes':['id',_0x0669('0x2b'),_0x0669('0x5e'),_0x0669('0x5f'),_0x0669('0x60')]});}})[_0x0669('0x24')](function(_0x1dbdaa){if(_0x1dbdaa){return{'count':_0x1dbdaa[_0x0669('0x1e')],'rows':_[_0x0669('0x2e')](_0x1dbdaa[_0x0669('0x44')],function(_0x319d13){return{'membername':_0x319d13['name'],'UserId':_0x319d13['id'],'queue_name':_0x10bdd8[_0x0669('0x2b')],'MailQueueId':_0x10bdd8['id'],'interface':util[_0x0669('0x61')](_0x0669('0x62'),_0x0669('0x63'),_0x319d13[_0x0669('0x2b')]),'penalty':0x0,'paused':_0x319d13[_0x0669('0x5e')],'createdAt':_0x319d13['createdAt'],'updatedAt':_0x319d13[_0x0669('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0669('0x24')](respondWithFilteredResult(_0x4648e3,_0x36a9f1))['catch'](handleError(_0x4648e3,null));};exports[_0x0669('0x64')]=function(_0xb5580,_0x53f64b,_0x26da00){var _0xd4e881={};var _0x52a6b8={};var _0x597976;var _0x2c995d;return db[_0x0669('0x2f')][_0x0669('0x56')]({'where':{'id':_0xb5580['params']['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x53f64b,null))['then'](function(_0x534c00){if(_0x534c00){_0x597976=_0x534c00;_0x52a6b8[_0x0669('0x32')]=_[_0x0669('0x34')](db['Team'][_0x0669('0x30')]);_0x52a6b8[_0x0669('0x33')]=_[_0x0669('0x34')](_0xb5580[_0x0669('0x33')]);_0x52a6b8[_0x0669('0x35')]=_[_0x0669('0x36')](_0x52a6b8[_0x0669('0x32')],_0x52a6b8[_0x0669('0x33')]);_0xd4e881[_0x0669('0x38')]=_[_0x0669('0x36')](_0x52a6b8[_0x0669('0x32')],qs['fields'](_0xb5580[_0x0669('0x33')][_0x0669('0x37')]));_0xd4e881['attributes']=_0xd4e881[_0x0669('0x38')][_0x0669('0x39')]?_0xd4e881[_0x0669('0x38')]:_0x52a6b8[_0x0669('0x32')];_0xd4e881[_0x0669('0x58')]=qs['sort'](_0xb5580[_0x0669('0x33')]['sort']);_0xd4e881[_0x0669('0x3e')]=qs['filters'](_[_0x0669('0x59')](_0xb5580[_0x0669('0x33')],_0x52a6b8['filters']));if(_0xb5580[_0x0669('0x33')][_0x0669('0x3d')]){_0xd4e881[_0x0669('0x3e')]=_[_0x0669('0x3f')](_0xd4e881[_0x0669('0x3e')],{'$or':_[_0x0669('0x2e')](_0xd4e881[_0x0669('0x38')],function(_0x1fe83a){var _0x30ed62={};_0x30ed62[_0x1fe83a]={'$like':'%'+_0xb5580[_0x0669('0x33')][_0x0669('0x3d')]+'%'};return _0x30ed62;})});}_0xd4e881=_['merge']({},_0xd4e881,_0xb5580[_0x0669('0x49')]);return _0x597976[_0x0669('0x64')](_0xd4e881);}})[_0x0669('0x24')](function(_0x54e4cb){if(_0x54e4cb){_0x2c995d=_0x54e4cb[_0x0669('0x39')];if(!_0xb5580[_0x0669('0x33')][_0x0669('0x3a')]('nolimit')){_0xd4e881['limit']=qs[_0x0669('0x1d')](_0xb5580[_0x0669('0x33')][_0x0669('0x1d')]);_0xd4e881[_0x0669('0x1f')]=qs[_0x0669('0x1f')](_0xb5580[_0x0669('0x33')]['offset']);}return _0x597976[_0x0669('0x64')](_0xd4e881);}})[_0x0669('0x24')](function(_0x354eb7){if(_0x354eb7){return _0x354eb7?{'count':_0x2c995d,'rows':_0x354eb7}:null;}})['then'](respondWithResult(_0x53f64b,null))[_0x0669('0x45')](handleError(_0x53f64b,null));};exports['addTeams']=function(_0x15a6eb,_0x566e96,_0x1952b0){var _0x3243ff=_0x15a6eb[_0x0669('0x53')][_0x0669('0x65')];return db[_0x0669('0x66')][_0x0669('0x43')]({'where':{'id':_0x3243ff},'attributes':['id'],'include':[{'model':db[_0x0669('0x5b')],'as':_0x0669('0x67'),'attributes':['id','name',_0x0669('0x68'),_0x0669('0x69'),_0x0669('0x6a')],'raw':!![]}]})[_0x0669('0x24')](function(_0x1311dc){if(_0x1311dc){var _0x55b1bb=_[_0x0669('0x6b')](_0x1311dc,function(_0x57f077){var _0xf78b5=_0x57f077['get']({'plain':!![]});return _0xf78b5[_0x0669('0x67')];});return db[_0x0669('0x2f')]['find']({'where':{'id':_0x15a6eb[_0x0669('0x47')]['id']}})[_0x0669('0x24')](function(_0x44093e){return db[_0x0669('0x6c')][_0x0669('0x6d')](function(_0x5511f0){return _0x44093e[_0x0669('0x6e')](_0x3243ff,{'transaction':_0x5511f0})['then'](function(){return BPromise['each'](_0x55b1bb,function(_0x2eac2c){return db[_0x0669('0x57')][_0x0669('0x6f')]({'where':{'UserId':_0x2eac2c['id'],'MailQueueId':_0x15a6eb[_0x0669('0x47')]['id']},'transaction':_0x5511f0});});})[_0x0669('0x24')](function(){_0x55b1bb['forEach'](function(_0x47b16e){socket[_0x0669('0x70')](_0x0669('0x71'),{'UserId':_0x47b16e['id'],'MailQueueId':_0x44093e['id']});});});});});}})[_0x0669('0x24')](respondWithStatusCode(_0x566e96,null))['catch'](handleError(_0x566e96,null));};exports[_0x0669('0x72')]=function(_0x47bdba,_0x59878b,_0x25e970){return db[_0x0669('0x66')]['findAll']({'where':{'id':_0x47bdba[_0x0669('0x33')][_0x0669('0x65')]},'attributes':['id'],'include':[{'model':db[_0x0669('0x5b')],'as':_0x0669('0x67'),'attributes':['id'],'raw':!![]}]})[_0x0669('0x24')](handleEntityNotFound(_0x59878b,null))[_0x0669('0x24')](function(_0xcdd208){var _0x7a5a19=_[_0x0669('0x2e')](_0xcdd208,'id');var _0x663b6e=[];var _0x2d4330=[];var _0x59132b=squel[_0x0669('0x73')]();_0x59132b[_0x0669('0x74')](_0x0669('0x75'))[_0x0669('0x76')]('team_has_mail_queues','tq')['join'](_0x0669('0x77'),'ut',_0x0669('0x78'))[_0x0669('0x3e')](_0x0669('0x79'),_0x47bdba['params']['id']);for(var _0x4d6397=0x0;_0x4d6397<_0xcdd208['length'];_0x4d6397+=0x1){let _0x21a377=_0xcdd208[_0x4d6397];for(var _0x488fa8=0x0;_0x488fa8<_0x21a377[_0x0669('0x67')][_0x0669('0x39')];_0x488fa8+=0x1){let _0x36f1e5=_0x21a377[_0x0669('0x67')][_0x488fa8];var _0x6eb66b=_0x59132b[_0x0669('0x7a')]();_0x6eb66b[_0x0669('0x3e')]('ut.UserId\x20=\x20?',_0x36f1e5['id']);_0x2d4330[_0x0669('0x7b')](db[_0x0669('0x6c')][_0x0669('0x33')](_0x6eb66b['toString'](),{'type':db['sequelize'][_0x0669('0x7c')][_0x0669('0x7d')]})[_0x0669('0x24')](function(_0x6a31ff){if(_0x6a31ff['length']===0x1){return _0x36f1e5['id'];}else{var _0x5ec32c=_[_0x0669('0x7e')](_[_0x0669('0x2e')](_0x6a31ff,_0x0669('0x7f')),function(_0x138ca4){return _[_0x0669('0x80')](_0x7a5a19,_0x138ca4);});if(_0x5ec32c){return _0x36f1e5['id'];}}}));}}return BPromise[_0x0669('0x81')](_0x2d4330)[_0x0669('0x24')](function(_0x31e9ed){_0x663b6e=_(_0x663b6e)[_0x0669('0x82')](_0x31e9ed)[_0x0669('0x83')]()[_0x0669('0x84')]();return db['MailQueue'][_0x0669('0x4a')]({'where':{'id':_0x47bdba[_0x0669('0x47')]['id']}})[_0x0669('0x24')](function(_0x1ce38b){return db[_0x0669('0x6c')][_0x0669('0x6d')](function(_0x4090df){return _0x1ce38b[_0x0669('0x72')](_0x47bdba[_0x0669('0x33')]['ids'],{'transaction':_0x4090df})[_0x0669('0x24')](function(){if(!_[_0x0669('0x85')](_0x663b6e)){return _0x1ce38b[_0x0669('0x86')](_0x663b6e,{'transaction':_0x4090df});}})['then'](function(){_0x663b6e[_0x0669('0x87')](function(_0x2e852b){socket[_0x0669('0x70')](_0x0669('0x88'),{'UserId':_0x2e852b,'MailQueueId':_0x1ce38b['id']});});});});});});})['then'](respondWithStatusCode(_0x59878b,null))[_0x0669('0x45')](handleError(_0x59878b,null));};exports[_0x0669('0x89')]=function(_0x10fc0f,_0x293a86,_0x3eb990){return db[_0x0669('0x2f')][_0x0669('0x4a')]({'where':{'id':_0x10fc0f[_0x0669('0x47')]['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x293a86,null))[_0x0669('0x24')](function(_0x88cef1){if(_0x88cef1){return _0x88cef1[_0x0669('0x89')](_0x10fc0f['body'][_0x0669('0x65')],_[_0x0669('0x8a')](_0x10fc0f['body'],[_0x0669('0x65'),'id'])||{})['spread'](function(_0x5d6104){for(var _0x4a05b9=0x0;_0x4a05b9<_0x10fc0f[_0x0669('0x53')]['ids'][_0x0669('0x39')];_0x4a05b9+=0x1){socket['emit'](_0x0669('0x71'),{'UserId':Number(_0x10fc0f[_0x0669('0x53')][_0x0669('0x65')][_0x4a05b9]),'MailQueueId':Number(_0x10fc0f['params']['id'])});}return _0x5d6104;});}})[_0x0669('0x24')](respondWithResult(_0x293a86,null))[_0x0669('0x45')](handleError(_0x293a86,null));};exports[_0x0669('0x86')]=function(_0xf5a792,_0x33f271,_0x964b05){return db[_0x0669('0x2f')]['find']({'where':{'id':_0xf5a792[_0x0669('0x47')]['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x33f271,null))[_0x0669('0x24')](function(_0x59e4b9){if(_0x59e4b9){return _0x59e4b9[_0x0669('0x86')](_0xf5a792[_0x0669('0x33')]['ids'])['then'](function(){if(_[_0x0669('0x8b')](_0xf5a792[_0x0669('0x33')][_0x0669('0x65')])){for(var _0x429c70=0x0;_0x429c70<_0xf5a792['query'][_0x0669('0x65')][_0x0669('0x39')];_0x429c70+=0x1){socket[_0x0669('0x70')](_0x0669('0x88'),{'UserId':Number(_0xf5a792[_0x0669('0x33')]['ids'][_0x429c70]),'MailQueueId':Number(_0xf5a792[_0x0669('0x47')]['id'])});}}else{socket['emit'](_0x0669('0x88'),{'UserId':Number(_0xf5a792[_0x0669('0x33')][_0x0669('0x65')]),'MailQueueId':Number(_0xf5a792[_0x0669('0x47')]['id'])});}});}})[_0x0669('0x24')](respondWithStatusCode(_0x33f271,null))[_0x0669('0x45')](handleError(_0x33f271,null));};exports[_0x0669('0x8c')]=function(_0x1986b8,_0x135f38,_0x35d4fe){var _0x3ec358={};var _0x49af65={};var _0x5ab0f0;var _0x5707b8;return db[_0x0669('0x2f')][_0x0669('0x56')]({'where':{'id':_0x1986b8[_0x0669('0x47')]['id']}})[_0x0669('0x24')](handleEntityNotFound(_0x135f38,null))[_0x0669('0x24')](function(_0x4a2ee0){if(_0x4a2ee0){_0x5ab0f0=_0x4a2ee0;_0x49af65[_0x0669('0x32')]=_['keys'](db[_0x0669('0x5b')][_0x0669('0x30')]);_0x49af65['query']=_[_0x0669('0x34')](_0x1986b8[_0x0669('0x33')]);_0x49af65[_0x0669('0x35')]=_[_0x0669('0x36')](_0x49af65[_0x0669('0x32')],_0x49af65[_0x0669('0x33')]);_0x3ec358[_0x0669('0x38')]=_[_0x0669('0x36')](_0x49af65[_0x0669('0x32')],qs['fields'](_0x1986b8[_0x0669('0x33')][_0x0669('0x37')]));_0x3ec358[_0x0669('0x38')]=_0x3ec358[_0x0669('0x38')][_0x0669('0x39')]?_0x3ec358['attributes']:_0x49af65[_0x0669('0x32')];_0x3ec358['order']=qs[_0x0669('0x3c')](_0x1986b8[_0x0669('0x33')]['sort']);_0x3ec358[_0x0669('0x3e')]=qs[_0x0669('0x35')](_['pick'](_0x1986b8[_0x0669('0x33')],_0x49af65[_0x0669('0x35')]));if(_0x1986b8['query']['filter']){_0x3ec358['where']=_[_0x0669('0x3f')](_0x3ec358[_0x0669('0x3e')],{'$or':_['map'](_0x3ec358['attributes'],function(_0x449854){var _0x90473a={};_0x90473a[_0x449854]={'$like':'%'+_0x1986b8[_0x0669('0x33')][_0x0669('0x3d')]+'%'};return _0x90473a;})});}_0x3ec358=_[_0x0669('0x3f')]({},_0x3ec358,_0x1986b8[_0x0669('0x49')]);return _0x5ab0f0[_0x0669('0x8c')](_0x3ec358);}})[_0x0669('0x24')](function(_0x24ad9f){if(_0x24ad9f){_0x5707b8=_0x24ad9f['length'];if(!_0x1986b8[_0x0669('0x33')]['hasOwnProperty'](_0x0669('0x3b'))){_0x3ec358[_0x0669('0x1d')]=qs[_0x0669('0x1d')](_0x1986b8['query']['limit']);_0x3ec358[_0x0669('0x1f')]=qs[_0x0669('0x1f')](_0x1986b8[_0x0669('0x33')][_0x0669('0x1f')]);}return _0x5ab0f0[_0x0669('0x8c')](_0x3ec358);}})['then'](function(_0x1ae9a6){if(_0x1ae9a6){return _0x1ae9a6?{'count':_0x5707b8,'rows':_0x1ae9a6}:null;}})[_0x0669('0x24')](respondWithResult(_0x135f38,null))[_0x0669('0x45')](handleError(_0x135f38,null));};
\ No newline at end of file
index 676c55c..2048a1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6929=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x5cc65d,_0xf1c881){var _0x5955e3=function(_0x54d0ae){while(--_0x54d0ae){_0x5cc65d['push'](_0x5cc65d['shift']());}};_0x5955e3(++_0xf1c881);}(_0x6929,0x197));var _0x9692=function(_0x3e2556,_0x591035){_0x3e2556=_0x3e2556-0x0;var _0x348780=_0x6929[_0x3e2556];return _0x348780;};'use strict';var EventEmitter=require(_0x9692('0x0'));var MailQueue=require(_0x9692('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x9692('0x2')](0x0);var events={'afterCreate':_0x9692('0x3'),'afterUpdate':_0x9692('0x4'),'afterDestroy':_0x9692('0x5')};function emitEvent(_0xd3d316){return function(_0x4e3621,_0x4a9792,_0x8da125){MailQueueEvents[_0x9692('0x6')](_0xd3d316+':'+_0x4e3621['id'],_0x4e3621);MailQueueEvents[_0x9692('0x6')](_0xd3d316,_0x4e3621);_0x8da125(null);};}for(var e in events){if(events[_0x9692('0x7')](e)){var event=events[e];MailQueue[_0x9692('0x8')](e,emitEvent(event));}}module[_0x9692('0x9')]=MailQueueEvents;
\ No newline at end of file
+var _0xecd8=['hook','exports','events','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x231e16,_0x67347b){var _0x570a7c=function(_0x2c35b4){while(--_0x2c35b4){_0x231e16['push'](_0x231e16['shift']());}};_0x570a7c(++_0x67347b);}(_0xecd8,0x183));var _0x8ecd=function(_0x2c6ad1,_0x391436){_0x2c6ad1=_0x2c6ad1-0x0;var _0x243d0c=_0xecd8[_0x2c6ad1];return _0x243d0c;};'use strict';var EventEmitter=require(_0x8ecd('0x0'));var MailQueue=require(_0x8ecd('0x1'))['db'][_0x8ecd('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x8ecd('0x3')](0x0);var events={'afterCreate':_0x8ecd('0x4'),'afterUpdate':_0x8ecd('0x5'),'afterDestroy':_0x8ecd('0x6')};function emitEvent(_0x226184){return function(_0x285642,_0x22afdd,_0x2e9f6f){MailQueueEvents[_0x8ecd('0x7')](_0x226184+':'+_0x285642['id'],_0x285642);MailQueueEvents[_0x8ecd('0x7')](_0x226184,_0x285642);_0x2e9f6f(null);};}for(var e in events){if(events[_0x8ecd('0x8')](e)){var event=events[e];MailQueue[_0x8ecd('0x9')](e,emitEvent(event));}}module[_0x8ecd('0xa')]=MailQueueEvents;
\ No newline at end of file
index d3c7792..1a83af5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3629=['define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./mailQueue.attributes','exports'];(function(_0x272638,_0x42b993){var _0x19d027=function(_0x27ac44){while(--_0x27ac44){_0x272638['push'](_0x272638['shift']());}};_0x19d027(++_0x42b993);}(_0x3629,0x148));var _0x9362=function(_0x243c55,_0x16f9e4){_0x243c55=_0x243c55-0x0;var _0x3d51ae=_0x3629[_0x243c55];return _0x3d51ae;};'use strict';var _=require(_0x9362('0x0'));var util=require(_0x9362('0x1'));var logger=require(_0x9362('0x2'))(_0x9362('0x3'));var moment=require(_0x9362('0x4'));var BPromise=require(_0x9362('0x5'));var rp=require(_0x9362('0x6'));var fs=require('fs');var path=require(_0x9362('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9362('0x8'));module[_0x9362('0x9')]=function(_0x38befb,_0xb5867d){return _0x38befb[_0x9362('0xa')](_0x9362('0xb'),attributes,{'tableName':_0x9362('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfc7a=['path','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x44e4ad,_0x40710b){var _0xb2d6b6=function(_0x413449){while(--_0x413449){_0x44e4ad['push'](_0x44e4ad['shift']());}};_0xb2d6b6(++_0x40710b);}(_0xfc7a,0xf0));var _0xafc7=function(_0x4214da,_0x586705){_0x4214da=_0x4214da-0x0;var _0x64da0=_0xfc7a[_0x4214da];return _0x64da0;};'use strict';var _=require(_0xafc7('0x0'));var util=require(_0xafc7('0x1'));var logger=require(_0xafc7('0x2'))(_0xafc7('0x3'));var moment=require(_0xafc7('0x4'));var BPromise=require(_0xafc7('0x5'));var rp=require(_0xafc7('0x6'));var fs=require('fs');var path=require(_0xafc7('0x7'));var rimraf=require('rimraf');var config=require(_0xafc7('0x8'));var attributes=require(_0xafc7('0x9'));module[_0xafc7('0xa')]=function(_0x2f6fba,_0x1a34eb){return _0x2f6fba[_0xafc7('0xb')](_0xafc7('0xc'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f876a04..e45eef7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c26=['info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','attributes','limit','include','model','map','ShowMailQueue','find','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','request','then'];(function(_0x4fc870,_0x56c114){var _0x20fd76=function(_0x417136){while(--_0x417136){_0x4fc870['push'](_0x4fc870['shift']());}};_0x20fd76(++_0x56c114);}(_0x7c26,0x127));var _0x67c2=function(_0x30c73d,_0x508729){_0x30c73d=_0x30c73d-0x0;var _0x1f6fc2=_0x7c26[_0x30c73d];return _0x1f6fc2;};'use strict';var _=require('lodash');var util=require(_0x67c2('0x0'));var moment=require(_0x67c2('0x1'));var BPromise=require(_0x67c2('0x2'));var rs=require(_0x67c2('0x3'));var fs=require('fs');var Redis=require(_0x67c2('0x4'));var db=require(_0x67c2('0x5'))['db'];var utils=require(_0x67c2('0x6'));var logger=require('../../config/logger')(_0x67c2('0x7'));var config=require('../../config/environment');var jayson=require(_0x67c2('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x67c2('0x9')]=_[_0x67c2('0xa')](config[_0x67c2('0x9')],{'host':_0x67c2('0xb'),'port':0x18eb});var socket=require(_0x67c2('0xc'))(new Redis(config[_0x67c2('0x9')]));require(_0x67c2('0xd'))[_0x67c2('0xe')](socket);function respondWithRpcPromise(_0x1c96c0,_0x565968,_0x17b601){return new BPromise(function(_0x22ee0b,_0x35184a){return client[_0x67c2('0xf')](_0x1c96c0,_0x17b601)[_0x67c2('0x10')](function(_0x1ed112){logger[_0x67c2('0x11')](_0x67c2('0x12'),_0x565968,_0x67c2('0x13'));logger['debug'](_0x67c2('0x14'),_0x565968,_0x67c2('0x13'),JSON[_0x67c2('0x15')](_0x1ed112));if(_0x1ed112[_0x67c2('0x16')]){if(_0x1ed112[_0x67c2('0x16')][_0x67c2('0x17')]===0x1f4){logger[_0x67c2('0x16')]('MailQueue,\x20%s,\x20%s',_0x565968,_0x1ed112[_0x67c2('0x16')]['message']);return _0x35184a(_0x1ed112[_0x67c2('0x16')]['message']);}logger[_0x67c2('0x16')](_0x67c2('0x12'),_0x565968,_0x1ed112[_0x67c2('0x16')]['message']);return _0x22ee0b(_0x1ed112[_0x67c2('0x16')][_0x67c2('0x18')]);}else{logger[_0x67c2('0x11')](_0x67c2('0x12'),_0x565968,_0x67c2('0x13'));_0x22ee0b(_0x1ed112[_0x67c2('0x19')][_0x67c2('0x18')]);}})[_0x67c2('0x1a')](function(_0xdc6f75){logger['error'](_0x67c2('0x12'),_0x565968,_0xdc6f75);_0x35184a(_0xdc6f75);});});}exports[_0x67c2('0x1b')]=function(_0x16f42f){var _0x477ae0=this;return new Promise(function(_0x301bbb,_0x431223){return db[_0x67c2('0x1c')][_0x67c2('0x1d')]({'raw':_0x16f42f[_0x67c2('0x1e')]?_0x16f42f[_0x67c2('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x16f42f[_0x67c2('0x1e')]?_0x16f42f[_0x67c2('0x1e')]['where']||null:null,'attributes':_0x16f42f['options']?_0x16f42f[_0x67c2('0x1e')][_0x67c2('0x1f')]||null:null,'limit':_0x16f42f[_0x67c2('0x1e')]?_0x16f42f['options'][_0x67c2('0x20')]||null:null,'include':_0x16f42f[_0x67c2('0x1e')]?_0x16f42f[_0x67c2('0x1e')][_0x67c2('0x21')]?_['map'](_0x16f42f[_0x67c2('0x1e')][_0x67c2('0x21')],function(_0x2a5370){return{'model':db[_0x2a5370[_0x67c2('0x22')]],'as':_0x2a5370['as'],'attributes':_0x2a5370[_0x67c2('0x1f')],'include':_0x2a5370['include']?_[_0x67c2('0x23')](_0x2a5370[_0x67c2('0x21')],function(_0x3c5c9f){return{'model':db[_0x3c5c9f[_0x67c2('0x22')]],'as':_0x3c5c9f['as'],'attributes':_0x3c5c9f[_0x67c2('0x1f')],'include':_0x3c5c9f[_0x67c2('0x21')]?_[_0x67c2('0x23')](_0x3c5c9f[_0x67c2('0x21')],function(_0x414324){return{'model':db[_0x414324['model']],'as':_0x414324['as'],'attributes':_0x414324[_0x67c2('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x36c2ef){logger[_0x67c2('0x11')](_0x67c2('0x1b'),_0x16f42f);logger['debug'](_0x67c2('0x1b'),_0x16f42f,JSON[_0x67c2('0x15')](_0x36c2ef));_0x301bbb(_0x36c2ef);})[_0x67c2('0x1a')](function(_0xd31250){logger[_0x67c2('0x16')](_0x67c2('0x1b'),_0xd31250[_0x67c2('0x18')],_0x16f42f);_0x431223(_0x477ae0[_0x67c2('0x16')](0x1f4,_0xd31250[_0x67c2('0x18')]));});});};exports[_0x67c2('0x24')]=function(_0x402da6){var _0xde5fdc=this;return new Promise(function(_0x3f5932,_0x1943bf){return db[_0x67c2('0x1c')][_0x67c2('0x25')]({'raw':_0x402da6[_0x67c2('0x1e')]?_0x402da6[_0x67c2('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x402da6['options']?_0x402da6[_0x67c2('0x1e')][_0x67c2('0x26')]||null:null,'attributes':_0x402da6['options']?_0x402da6[_0x67c2('0x1e')][_0x67c2('0x1f')]||null:null,'include':_0x402da6['options']?_0x402da6[_0x67c2('0x1e')][_0x67c2('0x21')]?_[_0x67c2('0x23')](_0x402da6['options'][_0x67c2('0x21')],function(_0x5d8e05){return{'model':db[_0x5d8e05[_0x67c2('0x22')]],'as':_0x5d8e05['as'],'attributes':_0x5d8e05['attributes'],'include':_0x5d8e05[_0x67c2('0x21')]?_[_0x67c2('0x23')](_0x5d8e05[_0x67c2('0x21')],function(_0x3698e7){return{'model':db[_0x3698e7[_0x67c2('0x22')]],'as':_0x3698e7['as'],'attributes':_0x3698e7[_0x67c2('0x1f')],'include':_0x3698e7[_0x67c2('0x21')]?_[_0x67c2('0x23')](_0x3698e7[_0x67c2('0x21')],function(_0xb181c){return{'model':db[_0xb181c[_0x67c2('0x22')]],'as':_0xb181c['as'],'attributes':_0xb181c['attributes']};}):[]};}):[]};}):[]:[]})[_0x67c2('0x10')](function(_0x53896c){logger[_0x67c2('0x11')](_0x67c2('0x24'),_0x402da6);logger['debug'](_0x67c2('0x24'),_0x402da6,JSON[_0x67c2('0x15')](_0x53896c));_0x3f5932(_0x53896c);})[_0x67c2('0x1a')](function(_0x209f27){logger[_0x67c2('0x16')](_0x67c2('0x24'),_0x209f27[_0x67c2('0x18')],_0x402da6);_0x1943bf(_0xde5fdc['error'](0x1f4,_0x209f27[_0x67c2('0x18')]));});});};
\ No newline at end of file
+var _0xfb3f=['MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','where','attributes','limit','include','map','model','GetMailQueue','ShowMailQueue','MailQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x492af5,_0xd51471){var _0x59f529=function(_0x40c9aa){while(--_0x40c9aa){_0x492af5['push'](_0x492af5['shift']());}};_0x59f529(++_0xd51471);}(_0xfb3f,0xb2));var _0xffb3=function(_0x2e627a,_0x582afe){_0x2e627a=_0x2e627a-0x0;var _0x2ecc48=_0xfb3f[_0x2e627a];return _0x2ecc48;};'use strict';var _=require(_0xffb3('0x0'));var util=require(_0xffb3('0x1'));var moment=require(_0xffb3('0x2'));var BPromise=require(_0xffb3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffb3('0x4'));var db=require(_0xffb3('0x5'))['db'];var utils=require(_0xffb3('0x6'));var logger=require(_0xffb3('0x7'))('rpc');var config=require(_0xffb3('0x8'));var jayson=require(_0xffb3('0x9'));var client=jayson['client'][_0xffb3('0xa')]({'port':0x232a});config[_0xffb3('0xb')]=_[_0xffb3('0xc')](config['redis'],{'host':_0xffb3('0xd'),'port':0x18eb});var socket=require(_0xffb3('0xe'))(new Redis(config[_0xffb3('0xb')]));require(_0xffb3('0xf'))['register'](socket);function respondWithRpcPromise(_0x2bfa0d,_0x670db7,_0x256512){return new BPromise(function(_0x5410b8,_0x10a86e){return client[_0xffb3('0x10')](_0x2bfa0d,_0x256512)[_0xffb3('0x11')](function(_0x5ccc80){logger[_0xffb3('0x12')](_0xffb3('0x13'),_0x670db7,_0xffb3('0x14'));logger[_0xffb3('0x15')](_0xffb3('0x16'),_0x670db7,_0xffb3('0x14'),JSON[_0xffb3('0x17')](_0x5ccc80));if(_0x5ccc80[_0xffb3('0x18')]){if(_0x5ccc80[_0xffb3('0x18')][_0xffb3('0x19')]===0x1f4){logger['error'](_0xffb3('0x13'),_0x670db7,_0x5ccc80[_0xffb3('0x18')][_0xffb3('0x1a')]);return _0x10a86e(_0x5ccc80['error'][_0xffb3('0x1a')]);}logger[_0xffb3('0x18')](_0xffb3('0x13'),_0x670db7,_0x5ccc80[_0xffb3('0x18')][_0xffb3('0x1a')]);return _0x5410b8(_0x5ccc80[_0xffb3('0x18')][_0xffb3('0x1a')]);}else{logger[_0xffb3('0x12')](_0xffb3('0x13'),_0x670db7,_0xffb3('0x14'));_0x5410b8(_0x5ccc80[_0xffb3('0x1b')][_0xffb3('0x1a')]);}})[_0xffb3('0x1c')](function(_0x445db8){logger[_0xffb3('0x18')](_0xffb3('0x13'),_0x670db7,_0x445db8);_0x10a86e(_0x445db8);});});}exports['GetMailQueue']=function(_0x3a2793){var _0x13c5cf=this;return new Promise(function(_0x1123fa,_0x9a3f54){return db['MailQueue']['findAll']({'raw':_0x3a2793[_0xffb3('0x1d')]?_0x3a2793['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a2793[_0xffb3('0x1d')]?_0x3a2793[_0xffb3('0x1d')][_0xffb3('0x1e')]||null:null,'attributes':_0x3a2793[_0xffb3('0x1d')]?_0x3a2793[_0xffb3('0x1d')][_0xffb3('0x1f')]||null:null,'limit':_0x3a2793[_0xffb3('0x1d')]?_0x3a2793[_0xffb3('0x1d')][_0xffb3('0x20')]||null:null,'include':_0x3a2793[_0xffb3('0x1d')]?_0x3a2793[_0xffb3('0x1d')][_0xffb3('0x21')]?_[_0xffb3('0x22')](_0x3a2793[_0xffb3('0x1d')]['include'],function(_0x4f4bb9){return{'model':db[_0x4f4bb9['model']],'as':_0x4f4bb9['as'],'attributes':_0x4f4bb9['attributes'],'include':_0x4f4bb9[_0xffb3('0x21')]?_['map'](_0x4f4bb9[_0xffb3('0x21')],function(_0x1edc06){return{'model':db[_0x1edc06['model']],'as':_0x1edc06['as'],'attributes':_0x1edc06[_0xffb3('0x1f')],'include':_0x1edc06['include']?_[_0xffb3('0x22')](_0x1edc06['include'],function(_0xec3f80){return{'model':db[_0xec3f80[_0xffb3('0x23')]],'as':_0xec3f80['as'],'attributes':_0xec3f80[_0xffb3('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xffb3('0x11')](function(_0x50e6ab){logger[_0xffb3('0x12')](_0xffb3('0x24'),_0x3a2793);logger[_0xffb3('0x15')](_0xffb3('0x24'),_0x3a2793,JSON[_0xffb3('0x17')](_0x50e6ab));_0x1123fa(_0x50e6ab);})[_0xffb3('0x1c')](function(_0x5c81fd){logger[_0xffb3('0x18')](_0xffb3('0x24'),_0x5c81fd[_0xffb3('0x1a')],_0x3a2793);_0x9a3f54(_0x13c5cf['error'](0x1f4,_0x5c81fd['message']));});});};exports[_0xffb3('0x25')]=function(_0x2a3119){var _0x56a4d9=this;return new Promise(function(_0x446722,_0x31b0f3){return db[_0xffb3('0x26')][_0xffb3('0x27')]({'raw':_0x2a3119[_0xffb3('0x1d')]?_0x2a3119[_0xffb3('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2a3119[_0xffb3('0x1d')]?_0x2a3119['options'][_0xffb3('0x1e')]||null:null,'attributes':_0x2a3119[_0xffb3('0x1d')]?_0x2a3119[_0xffb3('0x1d')][_0xffb3('0x1f')]||null:null,'include':_0x2a3119[_0xffb3('0x1d')]?_0x2a3119[_0xffb3('0x1d')]['include']?_[_0xffb3('0x22')](_0x2a3119['options']['include'],function(_0x48779b){return{'model':db[_0x48779b['model']],'as':_0x48779b['as'],'attributes':_0x48779b['attributes'],'include':_0x48779b[_0xffb3('0x21')]?_[_0xffb3('0x22')](_0x48779b[_0xffb3('0x21')],function(_0x7fcf4e){return{'model':db[_0x7fcf4e[_0xffb3('0x23')]],'as':_0x7fcf4e['as'],'attributes':_0x7fcf4e['attributes'],'include':_0x7fcf4e['include']?_[_0xffb3('0x22')](_0x7fcf4e[_0xffb3('0x21')],function(_0x4e2786){return{'model':db[_0x4e2786[_0xffb3('0x23')]],'as':_0x4e2786['as'],'attributes':_0x4e2786[_0xffb3('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1645a5){logger[_0xffb3('0x12')](_0xffb3('0x25'),_0x2a3119);logger['debug'](_0xffb3('0x25'),_0x2a3119,JSON[_0xffb3('0x17')](_0x1645a5));_0x446722(_0x1645a5);})[_0xffb3('0x1c')](function(_0x36201f){logger[_0xffb3('0x18')](_0xffb3('0x25'),_0x36201f['message'],_0x2a3119);_0x31b0f3(_0x56a4d9[_0xffb3('0x18')](0x1f4,_0x36201f[_0xffb3('0x1a')]));});});};
\ No newline at end of file
index b4fad28..96b1d60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdba6=['emit','removeListener','register','mailQueue:','./mailQueue.events','remove','update'];(function(_0x5dd8b5,_0x149e6a){var _0x49a1e9=function(_0x24880c){while(--_0x24880c){_0x5dd8b5['push'](_0x5dd8b5['shift']());}};_0x49a1e9(++_0x149e6a);}(_0xdba6,0x14d));var _0x6dba=function(_0x30ec1a,_0xc151d8){_0x30ec1a=_0x30ec1a-0x0;var _0x26d00c=_0xdba6[_0x30ec1a];return _0x26d00c;};'use strict';var MailQueueEvents=require(_0x6dba('0x0'));var events=['save',_0x6dba('0x1'),_0x6dba('0x2')];function createListener(_0x421806,_0x4cd955){return function(_0x35ee4c){_0x4cd955[_0x6dba('0x3')](_0x421806,_0x35ee4c);};}function removeListener(_0x837508,_0x5c54d6){return function(){MailQueueEvents[_0x6dba('0x4')](_0x837508,_0x5c54d6);};}exports[_0x6dba('0x5')]=function(_0x29c449){for(var _0x4d10ae=0x0,_0x38c5c9=events['length'];_0x4d10ae<_0x38c5c9;_0x4d10ae++){var _0x41ae79=events[_0x4d10ae];var _0x1384cd=createListener(_0x6dba('0x6')+_0x41ae79,_0x29c449);MailQueueEvents['on'](_0x41ae79,_0x1384cd);}};
\ No newline at end of file
+var _0x071d=['removeListener','register','length','mailQueue:','remove','update','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x071d,0x82));var _0xd071=function(_0xa30766,_0x6f613e){_0xa30766=_0xa30766-0x0;var _0x24e780=_0x071d[_0xa30766];return _0x24e780;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save',_0xd071('0x0'),_0xd071('0x1')];function createListener(_0xcc3d6,_0x25d637){return function(_0x4a7fba){_0x25d637[_0xd071('0x2')](_0xcc3d6,_0x4a7fba);};}function removeListener(_0x1a29a3,_0x54d8f0){return function(){MailQueueEvents[_0xd071('0x3')](_0x1a29a3,_0x54d8f0);};}exports[_0xd071('0x4')]=function(_0x187756){for(var _0x12025a=0x0,_0x30216a=events[_0xd071('0x5')];_0x12025a<_0x30216a;_0x12025a++){var _0x80236a=events[_0x12025a];var _0x3f09fb=createListener(_0xd071('0x6')+_0x80236a,_0x187756);MailQueueEvents['on'](_0x80236a,_0x3f09fb);}};
\ No newline at end of file
index 0aa97ef..c24cd28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1174=['index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated'];(function(_0xcb6d2b,_0x1a56ac){var _0x2c3687=function(_0x1b6ed0){while(--_0x1b6ed0){_0xcb6d2b['push'](_0xcb6d2b['shift']());}};_0x2c3687(++_0x1a56ac);}(_0x1174,0x124));var _0x4117=function(_0x1a581f,_0x543aa4){_0x1a581f=_0x1a581f-0x0;var _0x42850e=_0x1174[_0x1a581f];return _0x42850e;};'use strict';var multer=require(_0x4117('0x0'));var util=require(_0x4117('0x1'));var path=require(_0x4117('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4117('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4117('0x4'));var config=require(_0x4117('0x5'));var controller=require(_0x4117('0x6'));router['get']('/',auth[_0x4117('0x7')](),controller[_0x4117('0x8')]);router[_0x4117('0x9')](_0x4117('0xa'),auth[_0x4117('0x7')](),controller[_0x4117('0xb')]);router[_0x4117('0x9')](_0x4117('0xc'),auth[_0x4117('0x7')](),controller[_0x4117('0xd')]);router[_0x4117('0xe')]('/',auth[_0x4117('0x7')](),controller[_0x4117('0xf')]);router[_0x4117('0x10')](_0x4117('0xc'),auth[_0x4117('0x7')](),controller[_0x4117('0x11')]);router[_0x4117('0x12')]('/:id',auth[_0x4117('0x7')](),controller[_0x4117('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x37a0=['get','index','/describe','isAuthenticated','describe','/:id','show','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment'];(function(_0x65e618,_0x4883d8){var _0x2f627=function(_0x426720){while(--_0x426720){_0x65e618['push'](_0x65e618['shift']());}};_0x2f627(++_0x4883d8);}(_0x37a0,0xb7));var _0x037a=function(_0x2155bb,_0x204d49){_0x2155bb=_0x2155bb-0x0;var _0x5cb3cc=_0x37a0[_0x2155bb];return _0x5cb3cc;};'use strict';var multer=require(_0x037a('0x0'));var util=require(_0x037a('0x1'));var path=require(_0x037a('0x2'));var timeout=require(_0x037a('0x3'));var express=require(_0x037a('0x4'));var router=express['Router']();var fs_extra=require(_0x037a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x037a('0x6'));var controller=require('./mailQueueReport.controller');router[_0x037a('0x7')]('/',auth['isAuthenticated'](),controller[_0x037a('0x8')]);router[_0x037a('0x7')](_0x037a('0x9'),auth[_0x037a('0xa')](),controller[_0x037a('0xb')]);router['get'](_0x037a('0xc'),auth[_0x037a('0xa')](),controller[_0x037a('0xd')]);router['post']('/',auth[_0x037a('0xa')](),controller[_0x037a('0xe')]);router[_0x037a('0xf')](_0x037a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x037a('0x10')](_0x037a('0xc'),auth['isAuthenticated'](),controller[_0x037a('0x11')]);module[_0x037a('0x12')]=router;
\ No newline at end of file
index bca7e4f..7dfed83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc911=['moment','sequelize','exports','STRING','DATE'];(function(_0x54ea51,_0x579bcd){var _0x30648d=function(_0x44d0a6){while(--_0x44d0a6){_0x54ea51['push'](_0x54ea51['shift']());}};_0x30648d(++_0x579bcd);}(_0xc911,0x1ea));var _0x1c91=function(_0x1b2216,_0x250241){_0x1b2216=_0x1b2216-0x0;var _0x21a366=_0xc911[_0x1b2216];return _0x21a366;};'use strict';var moment=require(_0x1c91('0x0'));var Sequelize=require(_0x1c91('0x1'));module[_0x1c91('0x2')]={'uniqueid':{'type':Sequelize[_0x1c91('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1c91('0x3')]},'joinAt':{'type':Sequelize[_0x1c91('0x4')]},'leaveAt':{'type':Sequelize[_0x1c91('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x1c91('0x3')]}};
\ No newline at end of file
+var _0x9bf7=['DATE','sequelize','exports','STRING'];(function(_0x38e09f,_0x490e2a){var _0x3e820f=function(_0x18dc6d){while(--_0x18dc6d){_0x38e09f['push'](_0x38e09f['shift']());}};_0x3e820f(++_0x490e2a);}(_0x9bf7,0x11d));var _0x79bf=function(_0x24979d,_0x44b374){_0x24979d=_0x24979d-0x0;var _0x2533c4=_0x9bf7[_0x24979d];return _0x2533c4;};'use strict';var moment=require('moment');var Sequelize=require(_0x79bf('0x0'));module[_0x79bf('0x1')]={'uniqueid':{'type':Sequelize[_0x79bf('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x79bf('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x79bf('0x3')]},'acceptAt':{'type':Sequelize[_0x79bf('0x3')]},'exitAt':{'type':Sequelize[_0x79bf('0x3')]},'reason':{'type':Sequelize[_0x79bf('0x2')]}};
\ No newline at end of file
index c42b485..2a016fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1c6=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','MailQueueReport','rawAttributes','type','key','model','query'];(function(_0x3643cd,_0x1dde39){var _0x294556=function(_0x27216a){while(--_0x27216a){_0x3643cd['push'](_0x3643cd['shift']());}};_0x294556(++_0x1dde39);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x32a432,_0x1bcd75){_0x32a432=_0x32a432-0x0;var _0x23b513=_0xc1c6[_0x32a432];return _0x23b513;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['MailQueueReport']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['MailQueueReport'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':!![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['MailQueueReport'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['MailQueueReport']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));};exports[_0x6c1c('0x49')]=function(_0x2450ab,_0x5489ac){return db['MailQueueReport'][_0x6c1c('0x49')]()[_0x6c1c('0x25')](respondWithResult(_0x5489ac,null))['catch'](handleError(_0x5489ac,null));};
\ No newline at end of file
+var _0x0120=['name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','stack'];(function(_0x2097f5,_0x360195){var _0x3b5f3f=function(_0xc554ac){while(--_0xc554ac){_0x2097f5['push'](_0x2097f5['shift']());}};_0x3b5f3f(++_0x360195);}(_0x0120,0x6f));var _0x0012=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0120[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x0012('0x0'));var rimraf=require(_0x0012('0x1'));var zipdir=require(_0x0012('0x2'));var jsonpatch=require(_0x0012('0x3'));var rp=require(_0x0012('0x4'));var moment=require(_0x0012('0x5'));var BPromise=require(_0x0012('0x6'));var Mustache=require(_0x0012('0x7'));var util=require(_0x0012('0x8'));var path=require(_0x0012('0x9'));var sox=require(_0x0012('0xa'));var csv=require(_0x0012('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0012('0xc'));var crypto=require(_0x0012('0xd'));var jsforce=require(_0x0012('0xe'));var deskjs=require(_0x0012('0xf'));var toCsv=require(_0x0012('0xb'));var querystring=require('querystring');var Papa=require(_0x0012('0x10'));var Redis=require(_0x0012('0x11'));var authService=require(_0x0012('0x12'));var qs=require(_0x0012('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0012('0x14'));var logger=require('../../config/logger')(_0x0012('0x15'));var utils=require(_0x0012('0x16'));var config=require(_0x0012('0x17'));var licenseUtil=require(_0x0012('0x18'));var db=require(_0x0012('0x19'))['db'];function respondWithStatusCode(_0x4d3e7a,_0x6d4a1a){_0x6d4a1a=_0x6d4a1a||0xcc;return function(_0x4f0ee1){if(_0x4f0ee1){return _0x4d3e7a['sendStatus'](_0x6d4a1a);}return _0x4d3e7a['status'](_0x6d4a1a)['end']();};}function respondWithResult(_0x3a7d50,_0x496a2b){_0x496a2b=_0x496a2b||0xc8;return function(_0x3995fd){if(_0x3995fd){return _0x3a7d50[_0x0012('0x1a')](_0x496a2b)['json'](_0x3995fd);}};}function respondWithFilteredResult(_0x24f4ed,_0x1a0c0d){return function(_0x348810){if(_0x348810){var _0x3b8dfc=typeof _0x1a0c0d['offset']==='undefined'&&typeof _0x1a0c0d[_0x0012('0x1b')]===_0x0012('0x1c');var _0x3948bf=_0x348810[_0x0012('0x1d')];var _0x1d0423=_0x3b8dfc?0x0:_0x1a0c0d[_0x0012('0x1e')];var _0x1e78ee=_0x3b8dfc?_0x348810[_0x0012('0x1d')]:_0x1a0c0d['offset']+_0x1a0c0d[_0x0012('0x1b')];var _0x56b0e1;if(_0x1e78ee>=_0x3948bf){_0x1e78ee=_0x3948bf;_0x56b0e1=0xc8;}else{_0x56b0e1=0xce;}_0x24f4ed['status'](_0x56b0e1);return _0x24f4ed[_0x0012('0x1f')](_0x0012('0x20'),_0x1d0423+'-'+_0x1e78ee+'/'+_0x3948bf)[_0x0012('0x21')](_0x348810);}return null;};}function patchUpdates(_0x2c837e){return function(_0x53ac2d){try{jsonpatch['apply'](_0x53ac2d,_0x2c837e,!![]);}catch(_0x460d82){return BPromise[_0x0012('0x22')](_0x460d82);}return _0x53ac2d[_0x0012('0x23')]();};}function saveUpdates(_0x7177bc,_0x190f07){return function(_0x2e6a2c){if(_0x2e6a2c){return _0x2e6a2c[_0x0012('0x24')](_0x7177bc)[_0x0012('0x25')](function(_0x57487e){return _0x57487e;});}return null;};}function removeEntity(_0x24674c,_0x24a280){return function(_0x4cf4bd){if(_0x4cf4bd){return _0x4cf4bd[_0x0012('0x26')]()[_0x0012('0x25')](function(){_0x24674c[_0x0012('0x1a')](0xcc)[_0x0012('0x27')]();});}};}function handleEntityNotFound(_0x42bcd7,_0x5e820b){return function(_0x351ffd){if(!_0x351ffd){_0x42bcd7[_0x0012('0x28')](0x194);}return _0x351ffd;};}function handleError(_0xbb5b55,_0x2a0302){_0x2a0302=_0x2a0302||0x1f4;return function(_0x173cb3){logger[_0x0012('0x29')](_0x173cb3[_0x0012('0x2a')]);if(_0x173cb3[_0x0012('0x2b')]){delete _0x173cb3[_0x0012('0x2b')];}_0xbb5b55[_0x0012('0x1a')](_0x2a0302)[_0x0012('0x2c')](_0x173cb3);};}exports[_0x0012('0x2d')]=function(_0x45c3ca,_0x3ce788){var _0x1282bb={},_0x276389={},_0x1b676d={'count':0x0,'rows':[]};var _0x1f4a0a=_[_0x0012('0x2e')](db[_0x0012('0x2f')][_0x0012('0x30')],function(_0x4d0998){return{'name':_0x4d0998[_0x0012('0x31')],'type':_0x4d0998[_0x0012('0x32')]['key']};});_0x276389[_0x0012('0x33')]=_[_0x0012('0x2e')](_0x1f4a0a,_0x0012('0x2b'));_0x276389[_0x0012('0x34')]=_[_0x0012('0x35')](_0x45c3ca['query']);_0x276389[_0x0012('0x36')]=_[_0x0012('0x37')](_0x276389[_0x0012('0x33')],_0x276389['query']);_0x1282bb[_0x0012('0x38')]=_[_0x0012('0x37')](_0x276389[_0x0012('0x33')],qs[_0x0012('0x39')](_0x45c3ca[_0x0012('0x34')][_0x0012('0x39')]));_0x1282bb['attributes']=_0x1282bb[_0x0012('0x38')][_0x0012('0x3a')]?_0x1282bb[_0x0012('0x38')]:_0x276389[_0x0012('0x33')];if(!_0x45c3ca['query']['hasOwnProperty'](_0x0012('0x3b'))){_0x1282bb[_0x0012('0x1b')]=qs[_0x0012('0x1b')](_0x45c3ca[_0x0012('0x34')][_0x0012('0x1b')]);_0x1282bb[_0x0012('0x1e')]=qs[_0x0012('0x1e')](_0x45c3ca['query'][_0x0012('0x1e')]);}_0x1282bb[_0x0012('0x3c')]=qs['sort'](_0x45c3ca[_0x0012('0x34')][_0x0012('0x3d')]);_0x1282bb[_0x0012('0x3e')]=qs[_0x0012('0x36')](_[_0x0012('0x3f')](_0x45c3ca[_0x0012('0x34')],_0x276389[_0x0012('0x36')]),_0x1f4a0a);if(_0x45c3ca['query'][_0x0012('0x40')]){_0x1282bb['where']=_[_0x0012('0x41')](_0x1282bb['where'],{'$or':_['map'](_0x1f4a0a,function(_0x1c35aa){if(_0x1c35aa[_0x0012('0x32')]!==_0x0012('0x42')){var _0x4e4424={};_0x4e4424[_0x1c35aa[_0x0012('0x2b')]]={'$like':'%'+_0x45c3ca[_0x0012('0x34')][_0x0012('0x40')]+'%'};return _0x4e4424;}})});}_0x1282bb=_[_0x0012('0x41')]({},_0x1282bb,_0x45c3ca[_0x0012('0x43')]);var _0x379780={'where':_0x1282bb[_0x0012('0x3e')]};return db[_0x0012('0x2f')]['count'](_0x379780)[_0x0012('0x25')](function(_0x25aff1){_0x1b676d[_0x0012('0x1d')]=_0x25aff1;if(_0x45c3ca[_0x0012('0x34')][_0x0012('0x44')]){_0x1282bb[_0x0012('0x45')]=[{'all':!![]}];}return db[_0x0012('0x2f')]['findAll'](_0x1282bb);})['then'](function(_0x1c54de){_0x1b676d['rows']=_0x1c54de;return _0x1b676d;})[_0x0012('0x25')](respondWithFilteredResult(_0x3ce788,_0x1282bb))[_0x0012('0x46')](handleError(_0x3ce788,null));};exports[_0x0012('0x47')]=function(_0x40f80d,_0x32c1f9){var _0x5348a2={'raw':!![],'where':{'id':_0x40f80d[_0x0012('0x48')]['id']}},_0x1bd93a={};_0x1bd93a['model']=_[_0x0012('0x35')](db[_0x0012('0x2f')][_0x0012('0x30')]);_0x1bd93a[_0x0012('0x34')]=_['keys'](_0x40f80d['query']);_0x1bd93a[_0x0012('0x36')]=_['intersection'](_0x1bd93a[_0x0012('0x33')],_0x1bd93a['query']);_0x5348a2[_0x0012('0x38')]=_[_0x0012('0x37')](_0x1bd93a[_0x0012('0x33')],qs[_0x0012('0x39')](_0x40f80d['query'][_0x0012('0x39')]));_0x5348a2['attributes']=_0x5348a2[_0x0012('0x38')][_0x0012('0x3a')]?_0x5348a2[_0x0012('0x38')]:_0x1bd93a[_0x0012('0x33')];if(_0x40f80d[_0x0012('0x34')][_0x0012('0x44')]){_0x5348a2[_0x0012('0x45')]=[{'all':!![]}];}_0x5348a2=_['merge']({},_0x5348a2,_0x40f80d[_0x0012('0x43')]);return db[_0x0012('0x2f')][_0x0012('0x49')](_0x5348a2)[_0x0012('0x25')](handleEntityNotFound(_0x32c1f9,null))[_0x0012('0x25')](respondWithResult(_0x32c1f9,null))[_0x0012('0x46')](handleError(_0x32c1f9,null));};exports['create']=function(_0x5894ee,_0x48de64){return db['MailQueueReport'][_0x0012('0x4a')](_0x5894ee[_0x0012('0x4b')],{})[_0x0012('0x25')](respondWithResult(_0x48de64,0xc9))[_0x0012('0x46')](handleError(_0x48de64,null));};exports[_0x0012('0x24')]=function(_0x53d552,_0x44ffaf){if(_0x53d552[_0x0012('0x4b')]['id']){delete _0x53d552[_0x0012('0x4b')]['id'];}return db[_0x0012('0x2f')][_0x0012('0x49')]({'where':{'id':_0x53d552[_0x0012('0x48')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x44ffaf,null))[_0x0012('0x25')](saveUpdates(_0x53d552[_0x0012('0x4b')],null))[_0x0012('0x25')](respondWithResult(_0x44ffaf,null))[_0x0012('0x46')](handleError(_0x44ffaf,null));};exports['destroy']=function(_0x2389cd,_0x12cb8f){return db[_0x0012('0x2f')]['find']({'where':{'id':_0x2389cd[_0x0012('0x48')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x12cb8f,null))[_0x0012('0x25')](removeEntity(_0x12cb8f,null))[_0x0012('0x46')](handleError(_0x12cb8f,null));};exports[_0x0012('0x4c')]=function(_0x5f283f,_0xd11428){return db['MailQueueReport'][_0x0012('0x4c')]()[_0x0012('0x25')](respondWithResult(_0xd11428,null))['catch'](handleError(_0xd11428,null));};
\ No newline at end of file
index 0382a38..8b83eaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2539=['util','request-promise','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid'];(function(_0x4108f7,_0x51d271){var _0x4c394c=function(_0x2725ef){while(--_0x2725ef){_0x4108f7['push'](_0x4108f7['shift']());}};_0x4c394c(++_0x51d271);}(_0x2539,0x1e6));var _0x9253=function(_0x528a94,_0x421cae){_0x528a94=_0x528a94-0x0;var _0x112045=_0x2539[_0x528a94];return _0x112045;};'use strict';var _=require('lodash');var util=require(_0x9253('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9253('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9253('0x2'));var attributes=require(_0x9253('0x3'));module[_0x9253('0x4')]=function(_0xe6e39b,_0x48f983){return _0xe6e39b[_0x9253('0x5')](_0x9253('0x6'),attributes,{'tableName':_0x9253('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9253('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x091a=['moment','bluebird','request-promise','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','../../config/logger','api'];(function(_0x3e5d32,_0x19ce13){var _0x3e7822=function(_0x5c192c){while(--_0x5c192c){_0x3e5d32['push'](_0x3e5d32['shift']());}};_0x3e7822(++_0x19ce13);}(_0x091a,0x76));var _0xa091=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x091a[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xa091('0x0'));var util=require('util');var logger=require(_0xa091('0x1'))(_0xa091('0x2'));var moment=require(_0xa091('0x3'));var BPromise=require(_0xa091('0x4'));var rp=require(_0xa091('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module[_0xa091('0x6')]=function(_0x6cabfd,_0x1aa57d){return _0x6cabfd[_0xa091('0x7')](_0xa091('0x8'),attributes,{'tableName':_0xa091('0x9'),'paranoid':![],'indexes':[{'name':_0xa091('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 9e24c01..3f764be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x2acedd,_0x4f83d1){var _0x1861e9=function(_0x4ddba1){while(--_0x4ddba1){_0x2acedd['push'](_0x2acedd['shift']());}};_0x1861e9(++_0x4f83d1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});};
\ No newline at end of file
+var _0x326f=['error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','options','raw','stringify','UpdateMailQueueReport','body','attributes','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2b90b4,_0x1d72e4){var _0x32eafe=function(_0x157e2b){while(--_0x157e2b){_0x2b90b4['push'](_0x2b90b4['shift']());}};_0x32eafe(++_0x1d72e4);}(_0x326f,0xd1));var _0xf326=function(_0x4d1ae1,_0x31ae71){_0x4d1ae1=_0x4d1ae1-0x0;var _0x21f9d4=_0x326f[_0x4d1ae1];return _0x21f9d4;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['create'](_0x453100['body'],{'raw':_0x453100['options']?_0x453100[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4cabce){logger[_0xf326('0xb')]('CreateMailQueueReport',_0x453100);logger['debug'](_0xf326('0x14'),_0x453100,JSON[_0xf326('0x18')](_0x4cabce));_0x31ffb9(_0x4cabce);})['catch'](function(_0x5aa184){logger[_0xf326('0xf')](_0xf326('0x14'),_0x5aa184['message'],_0x453100);_0xcef2b5(_0x18bee3[_0xf326('0xf')](0x1f4,_0x5aa184[_0xf326('0x11')]));});});};exports[_0xf326('0x19')]=function(_0x295752){var _0x17c157=this;return new Promise(function(_0x2049ec,_0x5ce532){return db['MailQueueReport']['update'](_0x295752[_0xf326('0x1a')],{'raw':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')]['where']||null:null,'attributes':_0x295752[_0xf326('0x16')]?_0x295752[_0xf326('0x16')][_0xf326('0x1b')]||null:null,'limit':_0x295752['options']?_0x295752[_0xf326('0x16')]['limit']||null:null})['then'](function(_0x6a8e89){logger[_0xf326('0xb')](_0xf326('0x19'),_0x295752);logger['debug'](_0xf326('0x19'),_0x295752,JSON[_0xf326('0x18')](_0x6a8e89));_0x2049ec(_0x6a8e89);})['catch'](function(_0x225776){logger[_0xf326('0xf')](_0xf326('0x19'),_0x225776[_0xf326('0x11')],_0x295752);_0x5ce532(_0x17c157[_0xf326('0xf')](0x1f4,_0x225776[_0xf326('0x11')]));});});};
\ No newline at end of file
index a5302b8..710d14f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x3e2ecb,_0x5b2b0b){var _0xbce2f8=function(_0x15e1b0){while(--_0x15e1b0){_0x3e2ecb['push'](_0x3e2ecb['shift']());}};_0xbce2f8(++_0x5b2b0b);}(_0xedd9,0xfc));var _0x9edd=function(_0x186339,_0x2a828a){_0x186339=_0x186339-0x0;var _0x128945=_0xedd9[_0x186339];return _0x128945;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x8ee03d,_0x5b9f25){var _0x33f72b=function(_0xffd67b){while(--_0xffd67b){_0x8ee03d['push'](_0x8ee03d['shift']());}};_0x33f72b(++_0x5b9f25);}(_0xe706,0xa3));var _0x6e70=function(_0x3fbb91,_0x5ec106){_0x3fbb91=_0x3fbb91-0x0;var _0x3eb213=_0xe706[_0x3fbb91];return _0x3eb213;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
index d09e3f7..ebf875b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bde=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x55f403,_0x157f34){var _0x5ea7b9=function(_0x249f53){while(--_0x249f53){_0x55f403['push'](_0x55f403['shift']());}};_0x5ea7b9(++_0x157f34);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x56da6c,_0x258859){_0x56da6c=_0x56da6c-0x0;var _0x309fe8=_0x4bde[_0x56da6c];return _0x309fe8;};'use strict';var Sequelize=require(_0xe4bd('0x0'));module[_0xe4bd('0x1')]={'description':{'type':Sequelize[_0xe4bd('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xe4bd('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xe4bd('0x2')]},'password':{'type':Sequelize[_0xe4bd('0x2')]},'port':{'type':Sequelize[_0xe4bd('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xe4bd('0x2')],'defaultValue':_0xe4bd('0x5')},'connTimeout':{'type':Sequelize[_0xe4bd('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xe4bd('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xe4bd('0x2')]}};
\ No newline at end of file
+var _0xd547=['INTEGER','STRING','BOOLEAN','INBOX'];(function(_0x554203,_0x461a63){var _0x7cb135=function(_0x27873b){while(--_0x27873b){_0x554203['push'](_0x554203['shift']());}};_0x7cb135(++_0x461a63);}(_0xd547,0x1c1));var _0x7d54=function(_0x5d5ab2,_0x1d3681){_0x5d5ab2=_0x5d5ab2-0x0;var _0xb8fe37=_0xd547[_0x5d5ab2];return _0xb8fe37;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x7d54('0x0')]},'host':{'type':Sequelize[_0x7d54('0x0')]},'authentication':{'type':Sequelize[_0x7d54('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0x7d54('0x0')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x7d54('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x7d54('0x2')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x7d54('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x7d54('0x0')]}};
\ No newline at end of file
index bb99ede..8620ee3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9289=['rimraf','./mailServerIn.attributes','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5aa2ad,_0x562257){var _0x5853d1=function(_0x426ad2){while(--_0x426ad2){_0x5aa2ad['push'](_0x5aa2ad['shift']());}};_0x5853d1(++_0x562257);}(_0x9289,0x6d));var _0x9928=function(_0x260d3a,_0x1ef479){_0x260d3a=_0x260d3a-0x0;var _0x488f2a=_0x9289[_0x260d3a];return _0x488f2a;};'use strict';var _=require(_0x9928('0x0'));var util=require(_0x9928('0x1'));var logger=require(_0x9928('0x2'))(_0x9928('0x3'));var moment=require(_0x9928('0x4'));var BPromise=require(_0x9928('0x5'));var rp=require(_0x9928('0x6'));var fs=require('fs');var path=require(_0x9928('0x7'));var rimraf=require(_0x9928('0x8'));var config=require('../../config/environment');var attributes=require(_0x9928('0x9'));module['exports']=function(_0x59c508,_0x142df0){return _0x59c508[_0x9928('0xa')](_0x9928('0xb'),attributes,{'tableName':_0x9928('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb8d5=['MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3cef5f,_0x3e71b2){var _0x26f6f1=function(_0x34c676){while(--_0x34c676){_0x3cef5f['push'](_0x3cef5f['shift']());}};_0x26f6f1(++_0x3e71b2);}(_0xb8d5,0x160));var _0x5b8d=function(_0x5f263e,_0x3f4194){_0x5f263e=_0x5f263e-0x0;var _0xc69fb1=_0xb8d5[_0x5f263e];return _0xc69fb1;};'use strict';var _=require(_0x5b8d('0x0'));var util=require(_0x5b8d('0x1'));var logger=require(_0x5b8d('0x2'))(_0x5b8d('0x3'));var moment=require('moment');var BPromise=require(_0x5b8d('0x4'));var rp=require(_0x5b8d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5b8d('0x6'));var config=require(_0x5b8d('0x7'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x498fa1,_0x395dd0){return _0x498fa1['define'](_0x5b8d('0x8'),attributes,{'tableName':_0x5b8d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5b5a301..1553f9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefe3=['map','model','attributes','include','stringify','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailServerIn','findAll','options','raw','where','limit'];(function(_0x3ae233,_0x2fc8ef){var _0x459d25=function(_0x43cd9f){while(--_0x43cd9f){_0x3ae233['push'](_0x3ae233['shift']());}};_0x459d25(++_0x2fc8ef);}(_0xefe3,0xf5));var _0x3efe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xefe3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3efe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3efe('0x1'));var fs=require('fs');var Redis=require(_0x3efe('0x2'));var db=require(_0x3efe('0x3'))['db'];var utils=require(_0x3efe('0x4'));var logger=require('../../config/logger')(_0x3efe('0x5'));var config=require('../../config/environment');var jayson=require(_0x3efe('0x6'));var client=jayson['client'][_0x3efe('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x60487e,_0x1f697b,_0x195d5d){return new BPromise(function(_0x30d2e8,_0x474c9a){return client['request'](_0x60487e,_0x195d5d)[_0x3efe('0x8')](function(_0x54fec1){logger[_0x3efe('0x9')](_0x3efe('0xa'),_0x1f697b,_0x3efe('0xb'));logger[_0x3efe('0xc')](_0x3efe('0xd'),_0x1f697b,_0x3efe('0xb'),JSON['stringify'](_0x54fec1));if(_0x54fec1['error']){if(_0x54fec1[_0x3efe('0xe')][_0x3efe('0xf')]===0x1f4){logger[_0x3efe('0xe')](_0x3efe('0xa'),_0x1f697b,_0x54fec1[_0x3efe('0xe')][_0x3efe('0x10')]);return _0x474c9a(_0x54fec1[_0x3efe('0xe')][_0x3efe('0x10')]);}logger[_0x3efe('0xe')](_0x3efe('0xa'),_0x1f697b,_0x54fec1[_0x3efe('0xe')]['message']);return _0x30d2e8(_0x54fec1[_0x3efe('0xe')][_0x3efe('0x10')]);}else{logger[_0x3efe('0x9')](_0x3efe('0xa'),_0x1f697b,'request\x20sent');_0x30d2e8(_0x54fec1[_0x3efe('0x11')][_0x3efe('0x10')]);}})[_0x3efe('0x12')](function(_0x515e1b){logger['error'](_0x3efe('0xa'),_0x1f697b,_0x515e1b);_0x474c9a(_0x515e1b);});});}exports[_0x3efe('0x13')]=function(_0x26a8c4){var _0x3dc51b=this;return new Promise(function(_0x433c53,_0x14e2ba){return db['MailServerIn'][_0x3efe('0x14')]({'raw':_0x26a8c4[_0x3efe('0x15')]?_0x26a8c4[_0x3efe('0x15')][_0x3efe('0x16')]===undefined?!![]:![]:!![],'where':_0x26a8c4[_0x3efe('0x15')]?_0x26a8c4[_0x3efe('0x15')][_0x3efe('0x17')]||null:null,'attributes':_0x26a8c4[_0x3efe('0x15')]?_0x26a8c4[_0x3efe('0x15')]['attributes']||null:null,'limit':_0x26a8c4[_0x3efe('0x15')]?_0x26a8c4[_0x3efe('0x15')][_0x3efe('0x18')]||null:null,'include':_0x26a8c4[_0x3efe('0x15')]?_0x26a8c4['options']['include']?_[_0x3efe('0x19')](_0x26a8c4[_0x3efe('0x15')]['include'],function(_0x5c8b1d){return{'model':db[_0x5c8b1d[_0x3efe('0x1a')]],'as':_0x5c8b1d['as'],'attributes':_0x5c8b1d[_0x3efe('0x1b')],'include':_0x5c8b1d[_0x3efe('0x1c')]?_[_0x3efe('0x19')](_0x5c8b1d[_0x3efe('0x1c')],function(_0x39fc88){return{'model':db[_0x39fc88[_0x3efe('0x1a')]],'as':_0x39fc88['as'],'attributes':_0x39fc88[_0x3efe('0x1b')],'include':_0x39fc88[_0x3efe('0x1c')]?_['map'](_0x39fc88[_0x3efe('0x1c')],function(_0x56747e){return{'model':db[_0x56747e[_0x3efe('0x1a')]],'as':_0x56747e['as'],'attributes':_0x56747e[_0x3efe('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x25bf85){logger[_0x3efe('0x9')](_0x3efe('0x13'),_0x26a8c4);logger['debug'](_0x3efe('0x13'),_0x26a8c4,JSON[_0x3efe('0x1d')](_0x25bf85));_0x433c53(_0x25bf85);})['catch'](function(_0x730e5c){logger[_0x3efe('0xe')](_0x3efe('0x13'),_0x730e5c['message'],_0x26a8c4);_0x14e2ba(_0x3dc51b['error'](0x1f4,_0x730e5c[_0x3efe('0x10')]));});});};
\ No newline at end of file
+var _0xc737=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','then','info','request\x20sent','debug','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','MailServerIn','findAll','options','where','limit','include','map','model','attributes','GetMailServerIn','stringify','lodash'];(function(_0x59175d,_0x431b73){var _0x372dcf=function(_0x32621c){while(--_0x32621c){_0x59175d['push'](_0x59175d['shift']());}};_0x372dcf(++_0x431b73);}(_0xc737,0x154));var _0x7c73=function(_0x10afae,_0x3a08d4){_0x10afae=_0x10afae-0x0;var _0x5c2718=_0xc737[_0x10afae];return _0x5c2718;};'use strict';var _=require(_0x7c73('0x0'));var util=require(_0x7c73('0x1'));var moment=require(_0x7c73('0x2'));var BPromise=require(_0x7c73('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c73('0x4'));var db=require(_0x7c73('0x5'))['db'];var utils=require(_0x7c73('0x6'));var logger=require('../../config/logger')(_0x7c73('0x7'));var config=require(_0x7c73('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7c73('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f6f81,_0x57e442,_0x9264a9){return new BPromise(function(_0x3281fe,_0x5bf225){return client['request'](_0x3f6f81,_0x9264a9)[_0x7c73('0xa')](function(_0x8237f){logger[_0x7c73('0xb')]('MailServerIn,\x20%s,\x20%s',_0x57e442,_0x7c73('0xc'));logger[_0x7c73('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x57e442,_0x7c73('0xc'),JSON['stringify'](_0x8237f));if(_0x8237f[_0x7c73('0xe')]){if(_0x8237f[_0x7c73('0xe')][_0x7c73('0xf')]===0x1f4){logger['error'](_0x7c73('0x10'),_0x57e442,_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);return _0x5bf225(_0x8237f[_0x7c73('0xe')]['message']);}logger[_0x7c73('0xe')]('MailServerIn,\x20%s,\x20%s',_0x57e442,_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);return _0x3281fe(_0x8237f[_0x7c73('0xe')][_0x7c73('0x11')]);}else{logger[_0x7c73('0xb')](_0x7c73('0x10'),_0x57e442,_0x7c73('0xc'));_0x3281fe(_0x8237f[_0x7c73('0x12')]['message']);}})[_0x7c73('0x13')](function(_0x562b50){logger[_0x7c73('0xe')](_0x7c73('0x10'),_0x57e442,_0x562b50);_0x5bf225(_0x562b50);});});}exports['GetMailServerIn']=function(_0x534a39){var _0x1932c2=this;return new Promise(function(_0x4a2ebc,_0x5cc261){return db[_0x7c73('0x14')][_0x7c73('0x15')]({'raw':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x17')]||null:null,'attributes':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')]['attributes']||null:null,'limit':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x18')]||null:null,'include':_0x534a39[_0x7c73('0x16')]?_0x534a39[_0x7c73('0x16')][_0x7c73('0x19')]?_[_0x7c73('0x1a')](_0x534a39[_0x7c73('0x16')][_0x7c73('0x19')],function(_0x4c8933){return{'model':db[_0x4c8933[_0x7c73('0x1b')]],'as':_0x4c8933['as'],'attributes':_0x4c8933['attributes'],'include':_0x4c8933[_0x7c73('0x19')]?_['map'](_0x4c8933[_0x7c73('0x19')],function(_0x57dd84){return{'model':db[_0x57dd84[_0x7c73('0x1b')]],'as':_0x57dd84['as'],'attributes':_0x57dd84['attributes'],'include':_0x57dd84[_0x7c73('0x19')]?_[_0x7c73('0x1a')](_0x57dd84[_0x7c73('0x19')],function(_0x5b8bc9){return{'model':db[_0x5b8bc9[_0x7c73('0x1b')]],'as':_0x5b8bc9['as'],'attributes':_0x5b8bc9[_0x7c73('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7c73('0xa')](function(_0x5ad41e){logger[_0x7c73('0xb')](_0x7c73('0x1d'),_0x534a39);logger[_0x7c73('0xd')](_0x7c73('0x1d'),_0x534a39,JSON[_0x7c73('0x1e')](_0x5ad41e));_0x4a2ebc(_0x5ad41e);})[_0x7c73('0x13')](function(_0x5800eb){logger['error']('GetMailServerIn',_0x5800eb[_0x7c73('0x11')],_0x534a39);_0x5cc261(_0x1932c2[_0x7c73('0xe')](0x1f4,_0x5800eb[_0x7c73('0x11')]));});});};
\ No newline at end of file
index fa3148d..db80a14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x7a54,0x106));var _0x47a5=function(_0x48af46,_0x49d9a9){_0x48af46=_0x48af46-0x0;var _0x15a1ce=_0x7a54[_0x48af46];return _0x15a1ce;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router;
\ No newline at end of file
+var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
index 0809680..0645132 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c45=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x5a1afd,_0x2e51f9){var _0x20b493=function(_0x39bb0){while(--_0x39bb0){_0x5a1afd['push'](_0x5a1afd['shift']());}};_0x20b493(++_0x2e51f9);}(_0x9c45,0xb6));var _0x59c4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9c45[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x59c4('0x0'));module[_0x59c4('0x1')]={'description':{'type':Sequelize[_0x59c4('0x2')]},'host':{'type':Sequelize[_0x59c4('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x59c4('0x2')]},'port':{'type':Sequelize[_0x59c4('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x59c4('0x2')]},'authentication':{'type':Sequelize[_0x59c4('0x4')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1c6c=['STRING','INTEGER','BOOLEAN','sequelize'];(function(_0x240b0a,_0x50335f){var _0x35346a=function(_0x56d904){while(--_0x56d904){_0x240b0a['push'](_0x240b0a['shift']());}};_0x35346a(++_0x50335f);}(_0x1c6c,0x13f));var _0xc1c6=function(_0x27f941,_0x3a82cc){_0x27f941=_0x27f941-0x0;var _0x14bc85=_0x1c6c[_0x27f941];return _0x14bc85;};'use strict';var Sequelize=require(_0xc1c6('0x0'));module['exports']={'description':{'type':Sequelize[_0xc1c6('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0xc1c6('0x1')]},'pass':{'type':Sequelize[_0xc1c6('0x1')]},'port':{'type':Sequelize[_0xc1c6('0x2')]},'secure':{'type':Sequelize[_0xc1c6('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 44f5c8c..d8ba8ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bc0=['then','destroy','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update'];(function(_0x4e9fdd,_0x38ce42){var _0x1b5d59=function(_0x49068c){while(--_0x49068c){_0x4e9fdd['push'](_0x4e9fdd['shift']());}};_0x1b5d59(++_0x38ce42);}(_0x2bc0,0xbc));var _0x02bc=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x2bc0[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x02bc('0x0'));var rimraf=require(_0x02bc('0x1'));var zipdir=require(_0x02bc('0x2'));var jsonpatch=require(_0x02bc('0x3'));var rp=require(_0x02bc('0x4'));var moment=require(_0x02bc('0x5'));var BPromise=require(_0x02bc('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x02bc('0x7'));var sox=require(_0x02bc('0x8'));var csv=require(_0x02bc('0x9'));var ejs=require(_0x02bc('0xa'));var fs=require('fs');var fs_extra=require(_0x02bc('0xb'));var _=require(_0x02bc('0xc'));var squel=require(_0x02bc('0xd'));var crypto=require('crypto');var jsforce=require(_0x02bc('0xe'));var deskjs=require(_0x02bc('0xf'));var toCsv=require(_0x02bc('0x9'));var querystring=require(_0x02bc('0x10'));var Papa=require(_0x02bc('0x11'));var Redis=require(_0x02bc('0x12'));var authService=require(_0x02bc('0x13'));var qs=require(_0x02bc('0x14'));var as=require(_0x02bc('0x15'));var hardwareService=require(_0x02bc('0x16'));var logger=require('../../config/logger')(_0x02bc('0x17'));var utils=require(_0x02bc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x02bc('0x19'));var db=require(_0x02bc('0x1a'))['db'];function respondWithStatusCode(_0x498293,_0x5b35f5){_0x5b35f5=_0x5b35f5||0xcc;return function(_0x51ebc9){if(_0x51ebc9){return _0x498293[_0x02bc('0x1b')](_0x5b35f5);}return _0x498293[_0x02bc('0x1c')](_0x5b35f5)[_0x02bc('0x1d')]();};}function respondWithResult(_0x5bb5db,_0x4fa1ab){_0x4fa1ab=_0x4fa1ab||0xc8;return function(_0x1371b5){if(_0x1371b5){return _0x5bb5db[_0x02bc('0x1c')](_0x4fa1ab)[_0x02bc('0x1e')](_0x1371b5);}};}function respondWithFilteredResult(_0x5c6962,_0x3a208a){return function(_0x45bd18){if(_0x45bd18){var _0xe6ec93=typeof _0x3a208a[_0x02bc('0x1f')]===_0x02bc('0x20')&&typeof _0x3a208a[_0x02bc('0x21')]===_0x02bc('0x20');var _0x493292=_0x45bd18[_0x02bc('0x22')];var _0x376b12=_0xe6ec93?0x0:_0x3a208a[_0x02bc('0x1f')];var _0x404179=_0xe6ec93?_0x45bd18[_0x02bc('0x22')]:_0x3a208a[_0x02bc('0x1f')]+_0x3a208a[_0x02bc('0x21')];var _0x4975bc;if(_0x404179>=_0x493292){_0x404179=_0x493292;_0x4975bc=0xc8;}else{_0x4975bc=0xce;}_0x5c6962[_0x02bc('0x1c')](_0x4975bc);return _0x5c6962[_0x02bc('0x23')](_0x02bc('0x24'),_0x376b12+'-'+_0x404179+'/'+_0x493292)[_0x02bc('0x1e')](_0x45bd18);}return null;};}function patchUpdates(_0x28258e){return function(_0x4c0dc2){try{jsonpatch['apply'](_0x4c0dc2,_0x28258e,!![]);}catch(_0x70e8a9){return BPromise[_0x02bc('0x25')](_0x70e8a9);}return _0x4c0dc2[_0x02bc('0x26')]();};}function saveUpdates(_0x350589,_0x2c72a3){return function(_0x5d45c3){if(_0x5d45c3){return _0x5d45c3[_0x02bc('0x27')](_0x350589)[_0x02bc('0x28')](function(_0x480206){return _0x480206;});}return null;};}function removeEntity(_0x595af6,_0x140881){return function(_0x3b026d){if(_0x3b026d){return _0x3b026d[_0x02bc('0x29')]()['then'](function(){_0x595af6[_0x02bc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42fb5e,_0x42cc2e){return function(_0x6648a9){if(!_0x6648a9){_0x42fb5e[_0x02bc('0x1b')](0x194);}return _0x6648a9;};}function handleError(_0x5cb6dc,_0xe98a82){_0xe98a82=_0xe98a82||0x1f4;return function(_0x1d93fc){logger[_0x02bc('0x2a')](_0x1d93fc[_0x02bc('0x2b')]);if(_0x1d93fc['name']){delete _0x1d93fc[_0x02bc('0x2c')];}_0x5cb6dc[_0x02bc('0x1c')](_0xe98a82)['send'](_0x1d93fc);};}exports[_0x02bc('0x2d')]=function(_0x3908a6,_0x577525){var _0x1e72d1={},_0x4fcdd3={},_0x3612d1={'count':0x0,'rows':[]};var _0x4d6823=_[_0x02bc('0x2e')](db[_0x02bc('0x2f')][_0x02bc('0x30')],function(_0x2f5834){return{'name':_0x2f5834[_0x02bc('0x31')],'type':_0x2f5834[_0x02bc('0x32')][_0x02bc('0x33')]};});_0x4fcdd3['model']=_[_0x02bc('0x2e')](_0x4d6823,'name');_0x4fcdd3[_0x02bc('0x34')]=_[_0x02bc('0x35')](_0x3908a6[_0x02bc('0x34')]);_0x4fcdd3[_0x02bc('0x36')]=_['intersection'](_0x4fcdd3[_0x02bc('0x37')],_0x4fcdd3['query']);_0x1e72d1[_0x02bc('0x38')]=_[_0x02bc('0x39')](_0x4fcdd3['model'],qs[_0x02bc('0x3a')](_0x3908a6[_0x02bc('0x34')][_0x02bc('0x3a')]));_0x1e72d1['attributes']=_0x1e72d1['attributes'][_0x02bc('0x3b')]?_0x1e72d1[_0x02bc('0x38')]:_0x4fcdd3[_0x02bc('0x37')];if(!_0x3908a6[_0x02bc('0x34')][_0x02bc('0x3c')]('nolimit')){_0x1e72d1[_0x02bc('0x21')]=qs[_0x02bc('0x21')](_0x3908a6[_0x02bc('0x34')]['limit']);_0x1e72d1[_0x02bc('0x1f')]=qs[_0x02bc('0x1f')](_0x3908a6[_0x02bc('0x34')]['offset']);}_0x1e72d1['order']=qs[_0x02bc('0x3d')](_0x3908a6[_0x02bc('0x34')][_0x02bc('0x3d')]);_0x1e72d1['where']=qs[_0x02bc('0x36')](_[_0x02bc('0x3e')](_0x3908a6[_0x02bc('0x34')],_0x4fcdd3['filters']),_0x4d6823);if(_0x3908a6[_0x02bc('0x34')]['filter']){_0x1e72d1[_0x02bc('0x3f')]=_[_0x02bc('0x40')](_0x1e72d1[_0x02bc('0x3f')],{'$or':_[_0x02bc('0x2e')](_0x4d6823,function(_0x3582da){if(_0x3582da['type']!==_0x02bc('0x41')){var _0x4472c5={};_0x4472c5[_0x3582da[_0x02bc('0x2c')]]={'$like':'%'+_0x3908a6[_0x02bc('0x34')][_0x02bc('0x42')]+'%'};return _0x4472c5;}})});}_0x1e72d1=_[_0x02bc('0x40')]({},_0x1e72d1,_0x3908a6[_0x02bc('0x43')]);var _0x4b95a6={'where':_0x1e72d1[_0x02bc('0x3f')]};return db[_0x02bc('0x2f')][_0x02bc('0x22')](_0x4b95a6)[_0x02bc('0x28')](function(_0x13c326){_0x3612d1['count']=_0x13c326;if(_0x3908a6[_0x02bc('0x34')][_0x02bc('0x44')]){_0x1e72d1[_0x02bc('0x45')]=[{'all':!![]}];}return db[_0x02bc('0x2f')]['findAll'](_0x1e72d1);})['then'](function(_0x2e77f5){_0x3612d1[_0x02bc('0x46')]=_0x2e77f5;return _0x3612d1;})[_0x02bc('0x28')](respondWithFilteredResult(_0x577525,_0x1e72d1))[_0x02bc('0x47')](handleError(_0x577525,null));};exports[_0x02bc('0x48')]=function(_0x8cac79,_0x3f9b22){var _0x1f4cf7={'raw':!![],'where':{'id':_0x8cac79[_0x02bc('0x49')]['id']}},_0x2b50e5={};_0x2b50e5['model']=_['keys'](db['MailServerOut'][_0x02bc('0x30')]);_0x2b50e5[_0x02bc('0x34')]=_[_0x02bc('0x35')](_0x8cac79[_0x02bc('0x34')]);_0x2b50e5['filters']=_[_0x02bc('0x39')](_0x2b50e5[_0x02bc('0x37')],_0x2b50e5[_0x02bc('0x34')]);_0x1f4cf7['attributes']=_['intersection'](_0x2b50e5[_0x02bc('0x37')],qs[_0x02bc('0x3a')](_0x8cac79[_0x02bc('0x34')]['fields']));_0x1f4cf7[_0x02bc('0x38')]=_0x1f4cf7[_0x02bc('0x38')]['length']?_0x1f4cf7['attributes']:_0x2b50e5[_0x02bc('0x37')];if(_0x8cac79['query']['includeAll']){_0x1f4cf7[_0x02bc('0x45')]=[{'all':!![]}];}_0x1f4cf7=_[_0x02bc('0x40')]({},_0x1f4cf7,_0x8cac79[_0x02bc('0x43')]);return db[_0x02bc('0x2f')]['find'](_0x1f4cf7)[_0x02bc('0x28')](handleEntityNotFound(_0x3f9b22,null))[_0x02bc('0x28')](respondWithResult(_0x3f9b22,null))[_0x02bc('0x47')](handleError(_0x3f9b22,null));};exports['create']=function(_0x4889bd,_0x3ee64c){return db['MailServerOut']['create'](_0x4889bd[_0x02bc('0x4a')],{})[_0x02bc('0x28')](respondWithResult(_0x3ee64c,0xc9))[_0x02bc('0x47')](handleError(_0x3ee64c,null));};exports[_0x02bc('0x27')]=function(_0x1968d8,_0x446fc0){if(_0x1968d8[_0x02bc('0x4a')]['id']){delete _0x1968d8[_0x02bc('0x4a')]['id'];}return db[_0x02bc('0x2f')][_0x02bc('0x4b')]({'where':{'id':_0x1968d8['params']['id']}})['then'](handleEntityNotFound(_0x446fc0,null))['then'](saveUpdates(_0x1968d8[_0x02bc('0x4a')],null))[_0x02bc('0x28')](respondWithResult(_0x446fc0,null))[_0x02bc('0x47')](handleError(_0x446fc0,null));};exports[_0x02bc('0x29')]=function(_0x2b576e,_0x48d119){return db['MailServerOut'][_0x02bc('0x4b')]({'where':{'id':_0x2b576e[_0x02bc('0x49')]['id']}})['then'](handleEntityNotFound(_0x48d119,null))[_0x02bc('0x28')](removeEntity(_0x48d119,null))['catch'](handleError(_0x48d119,null));};
\ No newline at end of file
+var _0x87a3=['then','destroy','error','stack','name','index','map','MailServerOut','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','keys','include','options','catch','create','body','find','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update'];(function(_0x40a9c2,_0x449c0e){var _0x4c1cf9=function(_0x2548f5){while(--_0x2548f5){_0x40a9c2['push'](_0x40a9c2['shift']());}};_0x4c1cf9(++_0x449c0e);}(_0x87a3,0x1e9));var _0x387a=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x87a3[_0x55f8b4];return _0x2475f9;};'use strict';var emlformat=require(_0x387a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x387a('0x1'));var moment=require(_0x387a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x387a('0x3'));var util=require(_0x387a('0x4'));var path=require(_0x387a('0x5'));var sox=require(_0x387a('0x6'));var csv=require(_0x387a('0x7'));var ejs=require(_0x387a('0x8'));var fs=require('fs');var fs_extra=require(_0x387a('0x9'));var _=require(_0x387a('0xa'));var squel=require(_0x387a('0xb'));var crypto=require('crypto');var jsforce=require(_0x387a('0xc'));var deskjs=require(_0x387a('0xd'));var toCsv=require(_0x387a('0x7'));var querystring=require(_0x387a('0xe'));var Papa=require(_0x387a('0xf'));var Redis=require(_0x387a('0x10'));var authService=require(_0x387a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x387a('0x12'));var logger=require(_0x387a('0x13'))(_0x387a('0x14'));var utils=require('../../config/utils');var config=require(_0x387a('0x15'));var licenseUtil=require(_0x387a('0x16'));var db=require(_0x387a('0x17'))['db'];function respondWithStatusCode(_0x8d6ff8,_0x8d4e38){_0x8d4e38=_0x8d4e38||0xcc;return function(_0x4f9478){if(_0x4f9478){return _0x8d6ff8[_0x387a('0x18')](_0x8d4e38);}return _0x8d6ff8[_0x387a('0x19')](_0x8d4e38)[_0x387a('0x1a')]();};}function respondWithResult(_0x4b7577,_0x15932f){_0x15932f=_0x15932f||0xc8;return function(_0x4a74ff){if(_0x4a74ff){return _0x4b7577[_0x387a('0x19')](_0x15932f)[_0x387a('0x1b')](_0x4a74ff);}};}function respondWithFilteredResult(_0x5e2eef,_0x1025a5){return function(_0x1936b9){if(_0x1936b9){var _0x374a75=typeof _0x1025a5[_0x387a('0x1c')]==='undefined'&&typeof _0x1025a5[_0x387a('0x1d')]===_0x387a('0x1e');var _0x4c49bf=_0x1936b9[_0x387a('0x1f')];var _0x433ac6=_0x374a75?0x0:_0x1025a5[_0x387a('0x1c')];var _0x591dbf=_0x374a75?_0x1936b9[_0x387a('0x1f')]:_0x1025a5[_0x387a('0x1c')]+_0x1025a5[_0x387a('0x1d')];var _0x54fab2;if(_0x591dbf>=_0x4c49bf){_0x591dbf=_0x4c49bf;_0x54fab2=0xc8;}else{_0x54fab2=0xce;}_0x5e2eef[_0x387a('0x19')](_0x54fab2);return _0x5e2eef['set']('Content-Range',_0x433ac6+'-'+_0x591dbf+'/'+_0x4c49bf)['json'](_0x1936b9);}return null;};}function patchUpdates(_0x4f7c9e){return function(_0x45e983){try{jsonpatch[_0x387a('0x20')](_0x45e983,_0x4f7c9e,!![]);}catch(_0x5e3a85){return BPromise[_0x387a('0x21')](_0x5e3a85);}return _0x45e983[_0x387a('0x22')]();};}function saveUpdates(_0x58e5d7,_0x83cd35){return function(_0x1a015a){if(_0x1a015a){return _0x1a015a[_0x387a('0x23')](_0x58e5d7)[_0x387a('0x24')](function(_0x29aae1){return _0x29aae1;});}return null;};}function removeEntity(_0x231db0,_0x2df3ee){return function(_0x262b4e){if(_0x262b4e){return _0x262b4e[_0x387a('0x25')]()[_0x387a('0x24')](function(){_0x231db0[_0x387a('0x19')](0xcc)[_0x387a('0x1a')]();});}};}function handleEntityNotFound(_0xc79057,_0x31fae3){return function(_0x190028){if(!_0x190028){_0xc79057[_0x387a('0x18')](0x194);}return _0x190028;};}function handleError(_0x41a770,_0xe46590){_0xe46590=_0xe46590||0x1f4;return function(_0x492a12){logger[_0x387a('0x26')](_0x492a12[_0x387a('0x27')]);if(_0x492a12['name']){delete _0x492a12[_0x387a('0x28')];}_0x41a770[_0x387a('0x19')](_0xe46590)['send'](_0x492a12);};}exports[_0x387a('0x29')]=function(_0x6aaafc,_0xa738b8){var _0xf4c6d2={},_0x5118ce={},_0x682332={'count':0x0,'rows':[]};var _0x578b95=_[_0x387a('0x2a')](db[_0x387a('0x2b')][_0x387a('0x2c')],function(_0x3b3a6e){return{'name':_0x3b3a6e['fieldName'],'type':_0x3b3a6e[_0x387a('0x2d')][_0x387a('0x2e')]};});_0x5118ce['model']=_[_0x387a('0x2a')](_0x578b95,'name');_0x5118ce[_0x387a('0x2f')]=_['keys'](_0x6aaafc[_0x387a('0x2f')]);_0x5118ce[_0x387a('0x30')]=_[_0x387a('0x31')](_0x5118ce[_0x387a('0x32')],_0x5118ce['query']);_0xf4c6d2[_0x387a('0x33')]=_[_0x387a('0x31')](_0x5118ce['model'],qs[_0x387a('0x34')](_0x6aaafc['query'][_0x387a('0x34')]));_0xf4c6d2[_0x387a('0x33')]=_0xf4c6d2[_0x387a('0x33')][_0x387a('0x35')]?_0xf4c6d2[_0x387a('0x33')]:_0x5118ce[_0x387a('0x32')];if(!_0x6aaafc[_0x387a('0x2f')][_0x387a('0x36')](_0x387a('0x37'))){_0xf4c6d2[_0x387a('0x1d')]=qs[_0x387a('0x1d')](_0x6aaafc['query'][_0x387a('0x1d')]);_0xf4c6d2[_0x387a('0x1c')]=qs[_0x387a('0x1c')](_0x6aaafc[_0x387a('0x2f')][_0x387a('0x1c')]);}_0xf4c6d2[_0x387a('0x38')]=qs['sort'](_0x6aaafc[_0x387a('0x2f')][_0x387a('0x39')]);_0xf4c6d2[_0x387a('0x3a')]=qs['filters'](_[_0x387a('0x3b')](_0x6aaafc[_0x387a('0x2f')],_0x5118ce[_0x387a('0x30')]),_0x578b95);if(_0x6aaafc[_0x387a('0x2f')][_0x387a('0x3c')]){_0xf4c6d2[_0x387a('0x3a')]=_[_0x387a('0x3d')](_0xf4c6d2[_0x387a('0x3a')],{'$or':_['map'](_0x578b95,function(_0x5170f5){if(_0x5170f5[_0x387a('0x2d')]!==_0x387a('0x3e')){var _0x1cb7ca={};_0x1cb7ca[_0x5170f5['name']]={'$like':'%'+_0x6aaafc[_0x387a('0x2f')]['filter']+'%'};return _0x1cb7ca;}})});}_0xf4c6d2=_[_0x387a('0x3d')]({},_0xf4c6d2,_0x6aaafc['options']);var _0x20df07={'where':_0xf4c6d2[_0x387a('0x3a')]};return db[_0x387a('0x2b')][_0x387a('0x1f')](_0x20df07)['then'](function(_0x362083){_0x682332['count']=_0x362083;if(_0x6aaafc[_0x387a('0x2f')][_0x387a('0x3f')]){_0xf4c6d2['include']=[{'all':!![]}];}return db['MailServerOut'][_0x387a('0x40')](_0xf4c6d2);})[_0x387a('0x24')](function(_0x5a45b5){_0x682332[_0x387a('0x41')]=_0x5a45b5;return _0x682332;})[_0x387a('0x24')](respondWithFilteredResult(_0xa738b8,_0xf4c6d2))['catch'](handleError(_0xa738b8,null));};exports[_0x387a('0x42')]=function(_0xf7f2e7,_0x4e6614){var _0x233a50={'raw':!![],'where':{'id':_0xf7f2e7[_0x387a('0x43')]['id']}},_0x20461a={};_0x20461a['model']=_[_0x387a('0x44')](db['MailServerOut']['rawAttributes']);_0x20461a[_0x387a('0x2f')]=_[_0x387a('0x44')](_0xf7f2e7[_0x387a('0x2f')]);_0x20461a['filters']=_[_0x387a('0x31')](_0x20461a[_0x387a('0x32')],_0x20461a[_0x387a('0x2f')]);_0x233a50[_0x387a('0x33')]=_[_0x387a('0x31')](_0x20461a['model'],qs[_0x387a('0x34')](_0xf7f2e7[_0x387a('0x2f')][_0x387a('0x34')]));_0x233a50[_0x387a('0x33')]=_0x233a50[_0x387a('0x33')][_0x387a('0x35')]?_0x233a50['attributes']:_0x20461a[_0x387a('0x32')];if(_0xf7f2e7['query'][_0x387a('0x3f')]){_0x233a50[_0x387a('0x45')]=[{'all':!![]}];}_0x233a50=_[_0x387a('0x3d')]({},_0x233a50,_0xf7f2e7[_0x387a('0x46')]);return db['MailServerOut']['find'](_0x233a50)['then'](handleEntityNotFound(_0x4e6614,null))[_0x387a('0x24')](respondWithResult(_0x4e6614,null))[_0x387a('0x47')](handleError(_0x4e6614,null));};exports[_0x387a('0x48')]=function(_0x4ba864,_0x4f2046){return db[_0x387a('0x2b')][_0x387a('0x48')](_0x4ba864['body'],{})['then'](respondWithResult(_0x4f2046,0xc9))[_0x387a('0x47')](handleError(_0x4f2046,null));};exports['update']=function(_0x136c39,_0x495298){if(_0x136c39[_0x387a('0x49')]['id']){delete _0x136c39[_0x387a('0x49')]['id'];}return db[_0x387a('0x2b')][_0x387a('0x4a')]({'where':{'id':_0x136c39[_0x387a('0x43')]['id']}})[_0x387a('0x24')](handleEntityNotFound(_0x495298,null))[_0x387a('0x24')](saveUpdates(_0x136c39['body'],null))['then'](respondWithResult(_0x495298,null))['catch'](handleError(_0x495298,null));};exports[_0x387a('0x25')]=function(_0x4b7379,_0x45ad13){return db[_0x387a('0x2b')][_0x387a('0x4a')]({'where':{'id':_0x4b7379[_0x387a('0x43')]['id']}})['then'](handleEntityNotFound(_0x45ad13,null))[_0x387a('0x24')](removeEntity(_0x45ad13,null))[_0x387a('0x47')](handleError(_0x45ad13,null));};
\ No newline at end of file
index a5805cd..146a773 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f1e=['moment','bluebird','request-promise','path','rimraf','./mailServerOut.attributes','exports','define','mail_servers_out','lodash','util','../../config/logger','api'];(function(_0x146fd1,_0x5a02d2){var _0x3c755d=function(_0x53e711){while(--_0x53e711){_0x146fd1['push'](_0x146fd1['shift']());}};_0x3c755d(++_0x5a02d2);}(_0x4f1e,0x14e));var _0xe4f1=function(_0x18ddc4,_0x791e34){_0x18ddc4=_0x18ddc4-0x0;var _0x36264b=_0x4f1e[_0x18ddc4];return _0x36264b;};'use strict';var _=require(_0xe4f1('0x0'));var util=require(_0xe4f1('0x1'));var logger=require(_0xe4f1('0x2'))(_0xe4f1('0x3'));var moment=require(_0xe4f1('0x4'));var BPromise=require(_0xe4f1('0x5'));var rp=require(_0xe4f1('0x6'));var fs=require('fs');var path=require(_0xe4f1('0x7'));var rimraf=require(_0xe4f1('0x8'));var config=require('../../config/environment');var attributes=require(_0xe4f1('0x9'));module[_0xe4f1('0xa')]=function(_0x29c860,_0x344d42){return _0x29c860[_0xe4f1('0xb')]('MailServerOut',attributes,{'tableName':_0xe4f1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x840f=['exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x29ab1e,_0x398ec2){var _0x1bffd8=function(_0x26621c){while(--_0x26621c){_0x29ab1e['push'](_0x29ab1e['shift']());}};_0x1bffd8(++_0x398ec2);}(_0x840f,0x1cc));var _0xf840=function(_0x8e1ff1,_0x24381a){_0x8e1ff1=_0x8e1ff1-0x0;var _0xe5d601=_0x840f[_0x8e1ff1];return _0xe5d601;};'use strict';var _=require(_0xf840('0x0'));var util=require(_0xf840('0x1'));var logger=require(_0xf840('0x2'))(_0xf840('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf840('0x4'));var fs=require('fs');var path=require(_0xf840('0x5'));var rimraf=require(_0xf840('0x6'));var config=require(_0xf840('0x7'));var attributes=require('./mailServerOut.attributes');module[_0xf840('0x8')]=function(_0x11567b,_0x1ffef2){return _0x11567b[_0xf840('0x9')](_0xf840('0xa'),attributes,{'tableName':_0xf840('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2348bb5..03bcef0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x3ca71f,_0x384780){var _0x84604=function(_0x2f9059){while(--_0x2f9059){_0x3ca71f['push'](_0x3ca71f['shift']());}};_0x84604(++_0x384780);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4aa[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x18d48d,_0x2ff7ab){var _0x4ce6a3=function(_0x5e32f3){while(--_0x5e32f3){_0x18d48d['push'](_0x18d48d['shift']());}};_0x4ce6a3(++_0x2ff7ab);}(_0x5f2f,0x73));var _0xf5f2=function(_0xbbce8,_0x1b0c1d){_0xbbce8=_0xbbce8-0x0;var _0x4c6b0f=_0x5f2f[_0xbbce8];return _0x4c6b0f;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
index 5dcfe2e..1545ca5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf690=['delete','destroy','path','connect-timeout','Router','fs-extra','../../config/environment','index','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x5a6f58,_0x1b175e){var _0x6e4e0f=function(_0x55ccc0){while(--_0x55ccc0){_0x5a6f58['push'](_0x5a6f58['shift']());}};_0x6e4e0f(++_0x1b175e);}(_0xf690,0x146));var _0x0f69=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0xf690[_0x2b55b5];return _0x103d28;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0f69('0x0'));var timeout=require(_0x0f69('0x1'));var express=require('express');var router=express[_0x0f69('0x2')]();var fs_extra=require(_0x0f69('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0f69('0x4'));var controller=require('./mailSubstatus.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0f69('0x5')]);router[_0x0f69('0x6')](_0x0f69('0x7'),auth['isAuthenticated'](),controller[_0x0f69('0x8')]);router['get'](_0x0f69('0x9'),auth[_0x0f69('0xa')](),controller[_0x0f69('0xb')]);router[_0x0f69('0xc')]('/',auth[_0x0f69('0xa')](),controller[_0x0f69('0xd')]);router[_0x0f69('0xe')]('/:id',auth[_0x0f69('0xa')](),controller[_0x0f69('0xf')]);router[_0x0f69('0x10')](_0x0f69('0x9'),auth['isAuthenticated'](),controller[_0x0f69('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xb966=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/:id','show','post','create','put','exports','multer','path','connect-timeout'];(function(_0x66b9f9,_0x32d667){var _0x241ce9=function(_0x2b3426){while(--_0x2b3426){_0x66b9f9['push'](_0x66b9f9['shift']());}};_0x241ce9(++_0x32d667);}(_0xb966,0xc3));var _0x6b96=function(_0x3d6011,_0x10fbc7){_0x3d6011=_0x3d6011-0x0;var _0x181b1a=_0xb966[_0x3d6011];return _0x181b1a;};'use strict';var multer=require(_0x6b96('0x0'));var util=require('util');var path=require(_0x6b96('0x1'));var timeout=require(_0x6b96('0x2'));var express=require(_0x6b96('0x3'));var router=express[_0x6b96('0x4')]();var fs_extra=require(_0x6b96('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6b96('0x6'));var config=require(_0x6b96('0x7'));var controller=require(_0x6b96('0x8'));router[_0x6b96('0x9')]('/',auth[_0x6b96('0xa')](),controller[_0x6b96('0xb')]);router[_0x6b96('0x9')]('/describe',auth[_0x6b96('0xa')](),controller['describe']);router[_0x6b96('0x9')](_0x6b96('0xc'),auth[_0x6b96('0xa')](),controller[_0x6b96('0xd')]);router[_0x6b96('0xe')]('/',auth[_0x6b96('0xa')](),controller[_0x6b96('0xf')]);router[_0x6b96('0x10')](_0x6b96('0xc'),auth[_0x6b96('0xa')](),controller['update']);router['delete'](_0x6b96('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x6b96('0x11')]=router;
\ No newline at end of file
index 269e168..627bfab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a5a=['sequelize','exports','STRING','name'];(function(_0x2a4d83,_0x2f548c){var _0x1f223d=function(_0x513327){while(--_0x513327){_0x2a4d83['push'](_0x2a4d83['shift']());}};_0x1f223d(++_0x2f548c);}(_0x9a5a,0x194));var _0xa9a5=function(_0x3a2b83,_0x575de7){_0x3a2b83=_0x3a2b83-0x0;var _0x2c727a=_0x9a5a[_0x3a2b83];return _0x2c727a;};'use strict';var Sequelize=require(_0xa9a5('0x0'));module[_0xa9a5('0x1')]={'name':{'type':Sequelize[_0xa9a5('0x2')],'unique':_0xa9a5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa9a5('0x2')]}};
\ No newline at end of file
+var _0x323f=['name','STRING','exports'];(function(_0x2f4311,_0xd2d511){var _0x309ccb=function(_0x3ddf5c){while(--_0x3ddf5c){_0x2f4311['push'](_0x2f4311['shift']());}};_0x309ccb(++_0xd2d511);}(_0x323f,0x1ee));var _0xf323=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x323f[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require('sequelize');module[_0xf323('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf323('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf323('0x2')]}};
\ No newline at end of file
index 442518c..ca7d453 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dff=['save','update','then','destroy','error','stack','name','send','index','MailSubstatus','rawAttributes','fieldName','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','options','includeAll','include','findAll','rows','show','merge','find','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject'];(function(_0x4b50df,_0x6a03a0){var _0x1e951e=function(_0x2a9266){while(--_0x2a9266){_0x4b50df['push'](_0x4b50df['shift']());}};_0x1e951e(++_0x6a03a0);}(_0x4dff,0x103));var _0xf4df=function(_0x4839f1,_0x505613){_0x4839f1=_0x4839f1-0x0;var _0xa62ee5=_0x4dff[_0x4839f1];return _0xa62ee5;};'use strict';var emlformat=require(_0xf4df('0x0'));var rimraf=require(_0xf4df('0x1'));var zipdir=require(_0xf4df('0x2'));var jsonpatch=require(_0xf4df('0x3'));var rp=require(_0xf4df('0x4'));var moment=require('moment');var BPromise=require(_0xf4df('0x5'));var Mustache=require(_0xf4df('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf4df('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf4df('0x8'));var squel=require(_0xf4df('0x9'));var crypto=require('crypto');var jsforce=require(_0xf4df('0xa'));var deskjs=require(_0xf4df('0xb'));var toCsv=require(_0xf4df('0xc'));var querystring=require(_0xf4df('0xd'));var Papa=require(_0xf4df('0xe'));var Redis=require(_0xf4df('0xf'));var authService=require(_0xf4df('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf4df('0x11'));var logger=require('../../config/logger')(_0xf4df('0x12'));var utils=require(_0xf4df('0x13'));var config=require(_0xf4df('0x14'));var licenseUtil=require(_0xf4df('0x15'));var db=require(_0xf4df('0x16'))['db'];function respondWithStatusCode(_0x4bc975,_0x3846ab){_0x3846ab=_0x3846ab||0xcc;return function(_0xd0db62){if(_0xd0db62){return _0x4bc975['sendStatus'](_0x3846ab);}return _0x4bc975[_0xf4df('0x17')](_0x3846ab)[_0xf4df('0x18')]();};}function respondWithResult(_0x3a5634,_0x15fdf1){_0x15fdf1=_0x15fdf1||0xc8;return function(_0x36bc6b){if(_0x36bc6b){return _0x3a5634[_0xf4df('0x17')](_0x15fdf1)[_0xf4df('0x19')](_0x36bc6b);}};}function respondWithFilteredResult(_0x13ae8f,_0xd62b0e){return function(_0x411291){if(_0x411291){var _0x5beb37=typeof _0xd62b0e['offset']===_0xf4df('0x1a')&&typeof _0xd62b0e[_0xf4df('0x1b')]===_0xf4df('0x1a');var _0x580c3b=_0x411291[_0xf4df('0x1c')];var _0x58c1e4=_0x5beb37?0x0:_0xd62b0e[_0xf4df('0x1d')];var _0xb73c4e=_0x5beb37?_0x411291['count']:_0xd62b0e[_0xf4df('0x1d')]+_0xd62b0e['limit'];var _0x3fdabf;if(_0xb73c4e>=_0x580c3b){_0xb73c4e=_0x580c3b;_0x3fdabf=0xc8;}else{_0x3fdabf=0xce;}_0x13ae8f[_0xf4df('0x17')](_0x3fdabf);return _0x13ae8f[_0xf4df('0x1e')]('Content-Range',_0x58c1e4+'-'+_0xb73c4e+'/'+_0x580c3b)[_0xf4df('0x19')](_0x411291);}return null;};}function patchUpdates(_0x1b6ab0){return function(_0x305461){try{jsonpatch[_0xf4df('0x1f')](_0x305461,_0x1b6ab0,!![]);}catch(_0x53041e){return BPromise[_0xf4df('0x20')](_0x53041e);}return _0x305461[_0xf4df('0x21')]();};}function saveUpdates(_0xfc594,_0x2b7a4a){return function(_0x31b069){if(_0x31b069){return _0x31b069[_0xf4df('0x22')](_0xfc594)[_0xf4df('0x23')](function(_0x116b33){return _0x116b33;});}return null;};}function removeEntity(_0x3b697f,_0x171c7d){return function(_0x5a21eb){if(_0x5a21eb){return _0x5a21eb[_0xf4df('0x24')]()[_0xf4df('0x23')](function(){_0x3b697f[_0xf4df('0x17')](0xcc)[_0xf4df('0x18')]();});}};}function handleEntityNotFound(_0x36c42b,_0x3554dd){return function(_0x283255){if(!_0x283255){_0x36c42b['sendStatus'](0x194);}return _0x283255;};}function handleError(_0x3334fc,_0xf1cbe6){_0xf1cbe6=_0xf1cbe6||0x1f4;return function(_0x52c70c){logger[_0xf4df('0x25')](_0x52c70c[_0xf4df('0x26')]);if(_0x52c70c[_0xf4df('0x27')]){delete _0x52c70c[_0xf4df('0x27')];}_0x3334fc[_0xf4df('0x17')](_0xf1cbe6)[_0xf4df('0x28')](_0x52c70c);};}exports[_0xf4df('0x29')]=function(_0x112ad3,_0x5853fe){var _0x1d9bb4={},_0x59f5fa={},_0x550a71={'count':0x0,'rows':[]};var _0xf5e56=_['map'](db[_0xf4df('0x2a')][_0xf4df('0x2b')],function(_0x4f8c95){return{'name':_0x4f8c95[_0xf4df('0x2c')],'type':_0x4f8c95['type'][_0xf4df('0x2d')]};});_0x59f5fa[_0xf4df('0x2e')]=_['map'](_0xf5e56,_0xf4df('0x27'));_0x59f5fa['query']=_[_0xf4df('0x2f')](_0x112ad3[_0xf4df('0x30')]);_0x59f5fa['filters']=_['intersection'](_0x59f5fa['model'],_0x59f5fa[_0xf4df('0x30')]);_0x1d9bb4[_0xf4df('0x31')]=_[_0xf4df('0x32')](_0x59f5fa[_0xf4df('0x2e')],qs[_0xf4df('0x33')](_0x112ad3[_0xf4df('0x30')][_0xf4df('0x33')]));_0x1d9bb4['attributes']=_0x1d9bb4['attributes'][_0xf4df('0x34')]?_0x1d9bb4[_0xf4df('0x31')]:_0x59f5fa[_0xf4df('0x2e')];if(!_0x112ad3[_0xf4df('0x30')][_0xf4df('0x35')](_0xf4df('0x36'))){_0x1d9bb4[_0xf4df('0x1b')]=qs[_0xf4df('0x1b')](_0x112ad3[_0xf4df('0x30')][_0xf4df('0x1b')]);_0x1d9bb4[_0xf4df('0x1d')]=qs['offset'](_0x112ad3[_0xf4df('0x30')][_0xf4df('0x1d')]);}_0x1d9bb4['order']=qs[_0xf4df('0x37')](_0x112ad3[_0xf4df('0x30')][_0xf4df('0x37')]);_0x1d9bb4[_0xf4df('0x38')]=qs[_0xf4df('0x39')](_[_0xf4df('0x3a')](_0x112ad3[_0xf4df('0x30')],_0x59f5fa[_0xf4df('0x39')]),_0xf5e56);if(_0x112ad3[_0xf4df('0x30')][_0xf4df('0x3b')]){_0x1d9bb4[_0xf4df('0x38')]=_['merge'](_0x1d9bb4[_0xf4df('0x38')],{'$or':_['map'](_0xf5e56,function(_0x237ac0){if(_0x237ac0[_0xf4df('0x3c')]!=='VIRTUAL'){var _0x4ea761={};_0x4ea761[_0x237ac0['name']]={'$like':'%'+_0x112ad3[_0xf4df('0x30')][_0xf4df('0x3b')]+'%'};return _0x4ea761;}})});}_0x1d9bb4=_['merge']({},_0x1d9bb4,_0x112ad3[_0xf4df('0x3d')]);var _0xec5dc1={'where':_0x1d9bb4['where']};return db[_0xf4df('0x2a')][_0xf4df('0x1c')](_0xec5dc1)[_0xf4df('0x23')](function(_0x2bd666){_0x550a71[_0xf4df('0x1c')]=_0x2bd666;if(_0x112ad3[_0xf4df('0x30')][_0xf4df('0x3e')]){_0x1d9bb4[_0xf4df('0x3f')]=[{'all':!![]}];}return db[_0xf4df('0x2a')][_0xf4df('0x40')](_0x1d9bb4);})[_0xf4df('0x23')](function(_0xd63e7c){_0x550a71[_0xf4df('0x41')]=_0xd63e7c;return _0x550a71;})[_0xf4df('0x23')](respondWithFilteredResult(_0x5853fe,_0x1d9bb4))['catch'](handleError(_0x5853fe,null));};exports[_0xf4df('0x42')]=function(_0x58d908,_0x50ad2f){var _0xe41318={'raw':!![],'where':{'id':_0x58d908['params']['id']}},_0x4a28aa={};_0x4a28aa['model']=_[_0xf4df('0x2f')](db[_0xf4df('0x2a')][_0xf4df('0x2b')]);_0x4a28aa[_0xf4df('0x30')]=_[_0xf4df('0x2f')](_0x58d908[_0xf4df('0x30')]);_0x4a28aa[_0xf4df('0x39')]=_[_0xf4df('0x32')](_0x4a28aa[_0xf4df('0x2e')],_0x4a28aa[_0xf4df('0x30')]);_0xe41318[_0xf4df('0x31')]=_[_0xf4df('0x32')](_0x4a28aa[_0xf4df('0x2e')],qs[_0xf4df('0x33')](_0x58d908['query'][_0xf4df('0x33')]));_0xe41318[_0xf4df('0x31')]=_0xe41318[_0xf4df('0x31')]['length']?_0xe41318[_0xf4df('0x31')]:_0x4a28aa[_0xf4df('0x2e')];if(_0x58d908[_0xf4df('0x30')][_0xf4df('0x3e')]){_0xe41318[_0xf4df('0x3f')]=[{'all':!![]}];}_0xe41318=_[_0xf4df('0x43')]({},_0xe41318,_0x58d908['options']);return db[_0xf4df('0x2a')][_0xf4df('0x44')](_0xe41318)[_0xf4df('0x23')](handleEntityNotFound(_0x50ad2f,null))[_0xf4df('0x23')](respondWithResult(_0x50ad2f,null))[_0xf4df('0x45')](handleError(_0x50ad2f,null));};exports['create']=function(_0x2af096,_0x224f7b){return db['MailSubstatus']['create'](_0x2af096[_0xf4df('0x46')],{})[_0xf4df('0x23')](respondWithResult(_0x224f7b,0xc9))[_0xf4df('0x45')](handleError(_0x224f7b,null));};exports[_0xf4df('0x22')]=function(_0x40f665,_0x4cae98){if(_0x40f665['body']['id']){delete _0x40f665[_0xf4df('0x46')]['id'];}return db[_0xf4df('0x2a')][_0xf4df('0x44')]({'where':{'id':_0x40f665[_0xf4df('0x47')]['id']}})[_0xf4df('0x23')](handleEntityNotFound(_0x4cae98,null))[_0xf4df('0x23')](saveUpdates(_0x40f665[_0xf4df('0x46')],null))[_0xf4df('0x23')](respondWithResult(_0x4cae98,null))[_0xf4df('0x45')](handleError(_0x4cae98,null));};exports[_0xf4df('0x24')]=function(_0xf12178,_0xf6af56){return db[_0xf4df('0x2a')][_0xf4df('0x44')]({'where':{'id':_0xf12178[_0xf4df('0x47')]['id']}})['then'](handleEntityNotFound(_0xf6af56,null))[_0xf4df('0x23')](removeEntity(_0xf6af56,null))['catch'](handleError(_0xf6af56,null));};exports[_0xf4df('0x48')]=function(_0x4f84f3,_0x56c254){return db[_0xf4df('0x2a')][_0xf4df('0x48')]()[_0xf4df('0x23')](respondWithResult(_0x56c254,null))['catch'](handleError(_0x56c254,null));};
\ No newline at end of file
+var _0x9214=['sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','fields','includeAll','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path'];(function(_0xd739b,_0x1b7978){var _0x2391ed=function(_0x2e6f74){while(--_0x2e6f74){_0xd739b['push'](_0xd739b['shift']());}};_0x2391ed(++_0x1b7978);}(_0x9214,0x8c));var _0x4921=function(_0x682183,_0x278f1b){_0x682183=_0x682183-0x0;var _0x20682d=_0x9214[_0x682183];return _0x20682d;};'use strict';var emlformat=require(_0x4921('0x0'));var rimraf=require(_0x4921('0x1'));var zipdir=require(_0x4921('0x2'));var jsonpatch=require(_0x4921('0x3'));var rp=require('request-promise');var moment=require(_0x4921('0x4'));var BPromise=require(_0x4921('0x5'));var Mustache=require('mustache');var util=require(_0x4921('0x6'));var path=require(_0x4921('0x7'));var sox=require(_0x4921('0x8'));var csv=require('to-csv');var ejs=require(_0x4921('0x9'));var fs=require('fs');var fs_extra=require(_0x4921('0xa'));var _=require(_0x4921('0xb'));var squel=require(_0x4921('0xc'));var crypto=require(_0x4921('0xd'));var jsforce=require(_0x4921('0xe'));var deskjs=require(_0x4921('0xf'));var toCsv=require(_0x4921('0x10'));var querystring=require('querystring');var Papa=require(_0x4921('0x11'));var Redis=require(_0x4921('0x12'));var authService=require(_0x4921('0x13'));var qs=require(_0x4921('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4921('0x15'));var logger=require(_0x4921('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x4921('0x17'));var licenseUtil=require(_0x4921('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcafa32,_0x507c89){_0x507c89=_0x507c89||0xcc;return function(_0x28563f){if(_0x28563f){return _0xcafa32[_0x4921('0x19')](_0x507c89);}return _0xcafa32[_0x4921('0x1a')](_0x507c89)[_0x4921('0x1b')]();};}function respondWithResult(_0x4488d4,_0x194e0e){_0x194e0e=_0x194e0e||0xc8;return function(_0x586a5e){if(_0x586a5e){return _0x4488d4[_0x4921('0x1a')](_0x194e0e)[_0x4921('0x1c')](_0x586a5e);}};}function respondWithFilteredResult(_0x4b3715,_0x4aa7c1){return function(_0x5dbee4){if(_0x5dbee4){var _0x18f35a=typeof _0x4aa7c1[_0x4921('0x1d')]===_0x4921('0x1e')&&typeof _0x4aa7c1[_0x4921('0x1f')]==='undefined';var _0x1c1e3d=_0x5dbee4[_0x4921('0x20')];var _0x128ab4=_0x18f35a?0x0:_0x4aa7c1[_0x4921('0x1d')];var _0x2e08fb=_0x18f35a?_0x5dbee4[_0x4921('0x20')]:_0x4aa7c1[_0x4921('0x1d')]+_0x4aa7c1[_0x4921('0x1f')];var _0x121b79;if(_0x2e08fb>=_0x1c1e3d){_0x2e08fb=_0x1c1e3d;_0x121b79=0xc8;}else{_0x121b79=0xce;}_0x4b3715[_0x4921('0x1a')](_0x121b79);return _0x4b3715[_0x4921('0x21')](_0x4921('0x22'),_0x128ab4+'-'+_0x2e08fb+'/'+_0x1c1e3d)['json'](_0x5dbee4);}return null;};}function patchUpdates(_0x385d3c){return function(_0x28bee8){try{jsonpatch['apply'](_0x28bee8,_0x385d3c,!![]);}catch(_0x1f6ce1){return BPromise[_0x4921('0x23')](_0x1f6ce1);}return _0x28bee8['save']();};}function saveUpdates(_0x32c437,_0x456f5f){return function(_0x1587e7){if(_0x1587e7){return _0x1587e7['update'](_0x32c437)[_0x4921('0x24')](function(_0xab9996){return _0xab9996;});}return null;};}function removeEntity(_0x4bd9b0,_0x93c0b){return function(_0x28ab04){if(_0x28ab04){return _0x28ab04[_0x4921('0x25')]()['then'](function(){_0x4bd9b0[_0x4921('0x1a')](0xcc)[_0x4921('0x1b')]();});}};}function handleEntityNotFound(_0x2d60c9,_0x148615){return function(_0x4128b9){if(!_0x4128b9){_0x2d60c9[_0x4921('0x19')](0x194);}return _0x4128b9;};}function handleError(_0x26488f,_0xaef70d){_0xaef70d=_0xaef70d||0x1f4;return function(_0x586fc1){logger['error'](_0x586fc1['stack']);if(_0x586fc1[_0x4921('0x26')]){delete _0x586fc1[_0x4921('0x26')];}_0x26488f[_0x4921('0x1a')](_0xaef70d)['send'](_0x586fc1);};}exports[_0x4921('0x27')]=function(_0x5a76d2,_0xe92fab){var _0x2c83d7={},_0x37d8bd={},_0x4176de={'count':0x0,'rows':[]};var _0x534762=_[_0x4921('0x28')](db[_0x4921('0x29')][_0x4921('0x2a')],function(_0x293591){return{'name':_0x293591[_0x4921('0x2b')],'type':_0x293591[_0x4921('0x2c')][_0x4921('0x2d')]};});_0x37d8bd['model']=_[_0x4921('0x28')](_0x534762,_0x4921('0x26'));_0x37d8bd[_0x4921('0x2e')]=_['keys'](_0x5a76d2[_0x4921('0x2e')]);_0x37d8bd[_0x4921('0x2f')]=_[_0x4921('0x30')](_0x37d8bd[_0x4921('0x31')],_0x37d8bd[_0x4921('0x2e')]);_0x2c83d7[_0x4921('0x32')]=_[_0x4921('0x30')](_0x37d8bd['model'],qs['fields'](_0x5a76d2[_0x4921('0x2e')]['fields']));_0x2c83d7[_0x4921('0x32')]=_0x2c83d7[_0x4921('0x32')][_0x4921('0x33')]?_0x2c83d7['attributes']:_0x37d8bd['model'];if(!_0x5a76d2[_0x4921('0x2e')]['hasOwnProperty'](_0x4921('0x34'))){_0x2c83d7[_0x4921('0x1f')]=qs[_0x4921('0x1f')](_0x5a76d2[_0x4921('0x2e')][_0x4921('0x1f')]);_0x2c83d7[_0x4921('0x1d')]=qs['offset'](_0x5a76d2[_0x4921('0x2e')][_0x4921('0x1d')]);}_0x2c83d7[_0x4921('0x35')]=qs[_0x4921('0x36')](_0x5a76d2[_0x4921('0x2e')]['sort']);_0x2c83d7[_0x4921('0x37')]=qs[_0x4921('0x2f')](_[_0x4921('0x38')](_0x5a76d2[_0x4921('0x2e')],_0x37d8bd[_0x4921('0x2f')]),_0x534762);if(_0x5a76d2[_0x4921('0x2e')][_0x4921('0x39')]){_0x2c83d7[_0x4921('0x37')]=_[_0x4921('0x3a')](_0x2c83d7[_0x4921('0x37')],{'$or':_[_0x4921('0x28')](_0x534762,function(_0x4eff45){if(_0x4eff45[_0x4921('0x2c')]!==_0x4921('0x3b')){var _0x4c59b1={};_0x4c59b1[_0x4eff45[_0x4921('0x26')]]={'$like':'%'+_0x5a76d2[_0x4921('0x2e')][_0x4921('0x39')]+'%'};return _0x4c59b1;}})});}_0x2c83d7=_['merge']({},_0x2c83d7,_0x5a76d2[_0x4921('0x3c')]);var _0x3ab455={'where':_0x2c83d7[_0x4921('0x37')]};return db['MailSubstatus']['count'](_0x3ab455)['then'](function(_0x453002){_0x4176de['count']=_0x453002;if(_0x5a76d2['query']['includeAll']){_0x2c83d7[_0x4921('0x3d')]=[{'all':!![]}];}return db['MailSubstatus'][_0x4921('0x3e')](_0x2c83d7);})[_0x4921('0x24')](function(_0x42f909){_0x4176de[_0x4921('0x3f')]=_0x42f909;return _0x4176de;})[_0x4921('0x24')](respondWithFilteredResult(_0xe92fab,_0x2c83d7))[_0x4921('0x40')](handleError(_0xe92fab,null));};exports[_0x4921('0x41')]=function(_0x519cf0,_0x2faa74){var _0x2e9801={'raw':!![],'where':{'id':_0x519cf0[_0x4921('0x42')]['id']}},_0x96fb02={};_0x96fb02['model']=_[_0x4921('0x43')](db['MailSubstatus'][_0x4921('0x2a')]);_0x96fb02['query']=_['keys'](_0x519cf0[_0x4921('0x2e')]);_0x96fb02[_0x4921('0x2f')]=_[_0x4921('0x30')](_0x96fb02[_0x4921('0x31')],_0x96fb02[_0x4921('0x2e')]);_0x2e9801[_0x4921('0x32')]=_[_0x4921('0x30')](_0x96fb02[_0x4921('0x31')],qs[_0x4921('0x44')](_0x519cf0['query'][_0x4921('0x44')]));_0x2e9801[_0x4921('0x32')]=_0x2e9801[_0x4921('0x32')][_0x4921('0x33')]?_0x2e9801[_0x4921('0x32')]:_0x96fb02[_0x4921('0x31')];if(_0x519cf0[_0x4921('0x2e')][_0x4921('0x45')]){_0x2e9801[_0x4921('0x3d')]=[{'all':!![]}];}_0x2e9801=_[_0x4921('0x3a')]({},_0x2e9801,_0x519cf0[_0x4921('0x3c')]);return db['MailSubstatus']['find'](_0x2e9801)[_0x4921('0x24')](handleEntityNotFound(_0x2faa74,null))[_0x4921('0x24')](respondWithResult(_0x2faa74,null))[_0x4921('0x40')](handleError(_0x2faa74,null));};exports[_0x4921('0x46')]=function(_0x33107b,_0x136959){return db[_0x4921('0x29')][_0x4921('0x46')](_0x33107b[_0x4921('0x47')],{})[_0x4921('0x24')](respondWithResult(_0x136959,0xc9))[_0x4921('0x40')](handleError(_0x136959,null));};exports['update']=function(_0x391909,_0x589802){if(_0x391909[_0x4921('0x47')]['id']){delete _0x391909['body']['id'];}return db[_0x4921('0x29')][_0x4921('0x48')]({'where':{'id':_0x391909['params']['id']}})[_0x4921('0x24')](handleEntityNotFound(_0x589802,null))['then'](saveUpdates(_0x391909[_0x4921('0x47')],null))[_0x4921('0x24')](respondWithResult(_0x589802,null))['catch'](handleError(_0x589802,null));};exports[_0x4921('0x25')]=function(_0x3d6b7e,_0x3e5aae){return db[_0x4921('0x29')]['find']({'where':{'id':_0x3d6b7e[_0x4921('0x42')]['id']}})[_0x4921('0x24')](handleEntityNotFound(_0x3e5aae,null))['then'](removeEntity(_0x3e5aae,null))['catch'](handleError(_0x3e5aae,null));};exports[_0x4921('0x49')]=function(_0x17366c,_0x3cf888){return db[_0x4921('0x29')][_0x4921('0x49')]()[_0x4921('0x24')](respondWithResult(_0x3cf888,null))[_0x4921('0x40')](handleError(_0x3cf888,null));};
\ No newline at end of file
index e3f7eb3..eb0f51a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f3e=['path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger','api','bluebird'];(function(_0x2942ca,_0x4e11b4){var _0x4addf8=function(_0x373763){while(--_0x373763){_0x2942ca['push'](_0x2942ca['shift']());}};_0x4addf8(++_0x4e11b4);}(_0x2f3e,0x1b5));var _0xe2f3=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0x2f3e[_0x54ccd7];return _0x4e667b;};'use strict';var _=require(_0xe2f3('0x0'));var util=require(_0xe2f3('0x1'));var logger=require(_0xe2f3('0x2'))(_0xe2f3('0x3'));var moment=require('moment');var BPromise=require(_0xe2f3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2f3('0x5'));var rimraf=require(_0xe2f3('0x6'));var config=require(_0xe2f3('0x7'));var attributes=require(_0xe2f3('0x8'));module[_0xe2f3('0x9')]=function(_0x5e13a2,_0x331957){return _0x5e13a2[_0xe2f3('0xa')](_0xe2f3('0xb'),attributes,{'tableName':_0xe2f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xee0e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','mail_substatuses','lodash','util','api'];(function(_0x5e4d07,_0x3cadfb){var _0x2758c8=function(_0x56737e){while(--_0x56737e){_0x5e4d07['push'](_0x5e4d07['shift']());}};_0x2758c8(++_0x3cadfb);}(_0xee0e,0x1d1));var _0xeee0=function(_0x136619,_0x31c9b2){_0x136619=_0x136619-0x0;var _0x38c4a5=_0xee0e[_0x136619];return _0x38c4a5;};'use strict';var _=require(_0xeee0('0x0'));var util=require(_0xeee0('0x1'));var logger=require('../../config/logger')(_0xeee0('0x2'));var moment=require(_0xeee0('0x3'));var BPromise=require(_0xeee0('0x4'));var rp=require(_0xeee0('0x5'));var fs=require('fs');var path=require(_0xeee0('0x6'));var rimraf=require(_0xeee0('0x7'));var config=require(_0xeee0('0x8'));var attributes=require(_0xeee0('0x9'));module[_0xeee0('0xa')]=function(_0x3703fb,_0x134c1a){return _0x3703fb[_0xeee0('0xb')]('MailSubstatus',attributes,{'tableName':_0xeee0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9c60389..874db29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3718=['debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','MailSubstatus,\x20%s,\x20%s','message','info','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','request\x20sent'];(function(_0x2d9bb7,_0x517f04){var _0x1c799e=function(_0x593f40){while(--_0x593f40){_0x2d9bb7['push'](_0x2d9bb7['shift']());}};_0x1c799e(++_0x517f04);}(_0x3718,0xb2));var _0x8371=function(_0x2c3e37,_0x209572){_0x2c3e37=_0x2c3e37-0x0;var _0x20f307=_0x3718[_0x2c3e37];return _0x20f307;};'use strict';var _=require(_0x8371('0x0'));var util=require(_0x8371('0x1'));var moment=require(_0x8371('0x2'));var BPromise=require('bluebird');var rs=require(_0x8371('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8371('0x4'))['db'];var utils=require(_0x8371('0x5'));var logger=require('../../config/logger')(_0x8371('0x6'));var config=require('../../config/environment');var jayson=require(_0x8371('0x7'));var client=jayson['client'][_0x8371('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x516885,_0x5eebe2,_0x4389c7){return new BPromise(function(_0x3898bc,_0x3cf639){return client[_0x8371('0x9')](_0x516885,_0x4389c7)[_0x8371('0xa')](function(_0x200daa){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x5eebe2,_0x8371('0xb'));logger[_0x8371('0xc')](_0x8371('0xd'),_0x5eebe2,_0x8371('0xb'),JSON[_0x8371('0xe')](_0x200daa));if(_0x200daa[_0x8371('0xf')]){if(_0x200daa[_0x8371('0xf')]['code']===0x1f4){logger[_0x8371('0xf')](_0x8371('0x10'),_0x5eebe2,_0x200daa[_0x8371('0xf')]['message']);return _0x3cf639(_0x200daa[_0x8371('0xf')][_0x8371('0x11')]);}logger['error'](_0x8371('0x10'),_0x5eebe2,_0x200daa['error'][_0x8371('0x11')]);return _0x3898bc(_0x200daa[_0x8371('0xf')][_0x8371('0x11')]);}else{logger[_0x8371('0x12')](_0x8371('0x10'),_0x5eebe2,_0x8371('0xb'));_0x3898bc(_0x200daa['result'][_0x8371('0x11')]);}})['catch'](function(_0x399207){logger[_0x8371('0xf')](_0x8371('0x10'),_0x5eebe2,_0x399207);_0x3cf639(_0x399207);});});}
\ No newline at end of file
+var _0x3285=['MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2c094f,_0xe5a1b0){var _0x2f7176=function(_0x28e5f5){while(--_0x28e5f5){_0x2c094f['push'](_0x2c094f['shift']());}};_0x2f7176(++_0xe5a1b0);}(_0x3285,0x11c));var _0x5328=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x3285[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0x5328('0x0'));var util=require(_0x5328('0x1'));var moment=require(_0x5328('0x2'));var BPromise=require(_0x5328('0x3'));var rs=require(_0x5328('0x4'));var fs=require('fs');var Redis=require(_0x5328('0x5'));var db=require(_0x5328('0x6'))['db'];var utils=require(_0x5328('0x7'));var logger=require(_0x5328('0x8'))('rpc');var config=require(_0x5328('0x9'));var jayson=require(_0x5328('0xa'));var client=jayson[_0x5328('0xb')][_0x5328('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4aeda0,_0x5cd34c,_0x1380ca){return new BPromise(function(_0x20d845,_0x372549){return client[_0x5328('0xd')](_0x4aeda0,_0x1380ca)[_0x5328('0xe')](function(_0x5af796){logger[_0x5328('0xf')](_0x5328('0x10'),_0x5cd34c,_0x5328('0x11'));logger['debug'](_0x5328('0x12'),_0x5cd34c,_0x5328('0x11'),JSON[_0x5328('0x13')](_0x5af796));if(_0x5af796[_0x5328('0x14')]){if(_0x5af796[_0x5328('0x14')][_0x5328('0x15')]===0x1f4){logger[_0x5328('0x14')](_0x5328('0x10'),_0x5cd34c,_0x5af796[_0x5328('0x14')][_0x5328('0x16')]);return _0x372549(_0x5af796[_0x5328('0x14')][_0x5328('0x16')]);}logger[_0x5328('0x14')](_0x5328('0x10'),_0x5cd34c,_0x5af796[_0x5328('0x14')]['message']);return _0x20d845(_0x5af796[_0x5328('0x14')][_0x5328('0x16')]);}else{logger[_0x5328('0xf')](_0x5328('0x10'),_0x5cd34c,_0x5328('0x11'));_0x20d845(_0x5af796[_0x5328('0x17')][_0x5328('0x16')]);}})[_0x5328('0x18')](function(_0x2ddb1){logger['error'](_0x5328('0x10'),_0x5cd34c,_0x2ddb1);_0x372549(_0x2ddb1);});});}
\ No newline at end of file
index da1607e..f6e2007 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd789=['put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd789,0x174));var _0x9d78=function(_0x16972f,_0x24951d){_0x16972f=_0x16972f-0x0;var _0x3e2509=_0xd789[_0x16972f];return _0x3e2509;};'use strict';var multer=require(_0x9d78('0x0'));var util=require(_0x9d78('0x1'));var path=require(_0x9d78('0x2'));var timeout=require(_0x9d78('0x3'));var express=require('express');var router=express[_0x9d78('0x4')]();var fs_extra=require(_0x9d78('0x5'));var auth=require(_0x9d78('0x6'));var interaction=require(_0x9d78('0x7'));var config=require(_0x9d78('0x8'));var controller=require(_0x9d78('0x9'));router[_0x9d78('0xa')]('/',auth[_0x9d78('0xb')](),controller[_0x9d78('0xc')]);router[_0x9d78('0xa')](_0x9d78('0xd'),auth[_0x9d78('0xb')](),controller[_0x9d78('0xe')]);router[_0x9d78('0xa')](_0x9d78('0xf'),auth[_0x9d78('0xb')](),controller[_0x9d78('0x10')]);router[_0x9d78('0x11')]('/',auth[_0x9d78('0xb')](),controller[_0x9d78('0x12')]);router[_0x9d78('0x13')]('/:id',auth[_0x9d78('0xb')](),controller['update']);router[_0x9d78('0x14')](_0x9d78('0xf'),auth['isAuthenticated'](),controller[_0x9d78('0x15')]);module[_0x9d78('0x16')]=router;
\ No newline at end of file
+var _0x6b7a=['Router','fs-extra','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','/describe','describe','get','/:id','show','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x6b7a,0x87));var _0xa6b7=function(_0x255ac0,_0x3f6645){_0x255ac0=_0x255ac0-0x0;var _0x437bf1=_0x6b7a[_0x255ac0];return _0x437bf1;};'use strict';var multer=require(_0xa6b7('0x0'));var util=require(_0xa6b7('0x1'));var path=require(_0xa6b7('0x2'));var timeout=require(_0xa6b7('0x3'));var express=require(_0xa6b7('0x4'));var router=express[_0xa6b7('0x5')]();var fs_extra=require(_0xa6b7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa6b7('0x7'));var config=require(_0xa6b7('0x8'));var controller=require(_0xa6b7('0x9'));router['get']('/',auth[_0xa6b7('0xa')](),controller['index']);router['get'](_0xa6b7('0xb'),auth[_0xa6b7('0xa')](),controller[_0xa6b7('0xc')]);router[_0xa6b7('0xd')](_0xa6b7('0xe'),auth[_0xa6b7('0xa')](),controller[_0xa6b7('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa6b7('0x10')](_0xa6b7('0xe'),auth[_0xa6b7('0xa')](),controller[_0xa6b7('0x11')]);router[_0xa6b7('0x12')](_0xa6b7('0xe'),auth[_0xa6b7('0xa')](),controller[_0xa6b7('0x13')]);module['exports']=router;
\ No newline at end of file
index 26cc55b..b2aec9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x4d8dc3,_0x585fd1){var _0x9b03d9=function(_0x7a31d5){while(--_0x7a31d5){_0x4d8dc3['push'](_0x4d8dc3['shift']());}};_0x9b03d9(++_0x585fd1);}(_0xb43b,0x1b2));var _0xbb43=function(_0x1f1ce6,_0x5486e8){_0x1f1ce6=_0x1f1ce6-0x0;var _0x24f380=_0xb43b[_0x1f1ce6];return _0x24f380;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0xac8c2f,_0x3959f8){var _0x287723=function(_0x37b49c){while(--_0x37b49c){_0xac8c2f['push'](_0xac8c2f['shift']());}};_0x287723(++_0x3959f8);}(_0xedd9,0xfc));var _0x9edd=function(_0x143cfd,_0x2912b3){_0x143cfd=_0x143cfd-0x0;var _0x4355a6=_0xedd9[_0x143cfd];return _0x4355a6;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
index bbab6ee..72192bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x099c=['pick','filter','merge','options','where','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','find','body','params','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','json','undefined','limit','count','offset','status','set','Content-Range','apply','reject','update','then','end','sendStatus','error','name','send','index','map','MailTransferReport','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','order','sort'];(function(_0x4fa05e,_0x40718f){var _0x46b199=function(_0x3d6539){while(--_0x3d6539){_0x4fa05e['push'](_0x4fa05e['shift']());}};_0x46b199(++_0x40718f);}(_0x099c,0x175));var _0xc099=function(_0x52ece1,_0x425dc5){_0x52ece1=_0x52ece1-0x0;var _0x329205=_0x099c[_0x52ece1];return _0x329205;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc099('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc099('0x1'));var rp=require(_0xc099('0x2'));var moment=require(_0xc099('0x3'));var BPromise=require(_0xc099('0x4'));var Mustache=require('mustache');var util=require(_0xc099('0x5'));var path=require('path');var sox=require(_0xc099('0x6'));var csv=require('to-csv');var ejs=require(_0xc099('0x7'));var fs=require('fs');var fs_extra=require(_0xc099('0x8'));var _=require(_0xc099('0x9'));var squel=require('squel');var crypto=require(_0xc099('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc099('0xb'));var toCsv=require(_0xc099('0xc'));var querystring=require(_0xc099('0xd'));var Papa=require(_0xc099('0xe'));var Redis=require('ioredis');var authService=require(_0xc099('0xf'));var qs=require(_0xc099('0x10'));var as=require(_0xc099('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc099('0x12'));var utils=require(_0xc099('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc099('0x14'))['db'];function respondWithStatusCode(_0x5e543b,_0xdc7636){_0xdc7636=_0xdc7636||0xcc;return function(_0x136b3a){if(_0x136b3a){return _0x5e543b['sendStatus'](_0xdc7636);}return _0x5e543b['status'](_0xdc7636)['end']();};}function respondWithResult(_0x5c26b9,_0x1ffa9e){_0x1ffa9e=_0x1ffa9e||0xc8;return function(_0x1c55bb){if(_0x1c55bb){return _0x5c26b9['status'](_0x1ffa9e)[_0xc099('0x15')](_0x1c55bb);}};}function respondWithFilteredResult(_0x523f32,_0x22f37f){return function(_0x2b6046){if(_0x2b6046){var _0x5351c8=typeof _0x22f37f['offset']===_0xc099('0x16')&&typeof _0x22f37f[_0xc099('0x17')]==='undefined';var _0x562562=_0x2b6046[_0xc099('0x18')];var _0x2c8c31=_0x5351c8?0x0:_0x22f37f[_0xc099('0x19')];var _0x31a4ca=_0x5351c8?_0x2b6046[_0xc099('0x18')]:_0x22f37f['offset']+_0x22f37f[_0xc099('0x17')];var _0x2dddae;if(_0x31a4ca>=_0x562562){_0x31a4ca=_0x562562;_0x2dddae=0xc8;}else{_0x2dddae=0xce;}_0x523f32[_0xc099('0x1a')](_0x2dddae);return _0x523f32[_0xc099('0x1b')](_0xc099('0x1c'),_0x2c8c31+'-'+_0x31a4ca+'/'+_0x562562)[_0xc099('0x15')](_0x2b6046);}return null;};}function patchUpdates(_0x33305c){return function(_0x32a2e7){try{jsonpatch[_0xc099('0x1d')](_0x32a2e7,_0x33305c,!![]);}catch(_0x52efaf){return BPromise[_0xc099('0x1e')](_0x52efaf);}return _0x32a2e7['save']();};}function saveUpdates(_0x40c5b3,_0x4ded20){return function(_0x5b36b0){if(_0x5b36b0){return _0x5b36b0[_0xc099('0x1f')](_0x40c5b3)['then'](function(_0x5761f9){return _0x5761f9;});}return null;};}function removeEntity(_0xc00ae1,_0x1b3259){return function(_0x25eccc){if(_0x25eccc){return _0x25eccc['destroy']()[_0xc099('0x20')](function(){_0xc00ae1[_0xc099('0x1a')](0xcc)[_0xc099('0x21')]();});}};}function handleEntityNotFound(_0xa1b58,_0x394553){return function(_0x70f39d){if(!_0x70f39d){_0xa1b58[_0xc099('0x22')](0x194);}return _0x70f39d;};}function handleError(_0x76e8d4,_0x1cb094){_0x1cb094=_0x1cb094||0x1f4;return function(_0x25aa39){logger[_0xc099('0x23')](_0x25aa39['stack']);if(_0x25aa39[_0xc099('0x24')]){delete _0x25aa39[_0xc099('0x24')];}_0x76e8d4[_0xc099('0x1a')](_0x1cb094)[_0xc099('0x25')](_0x25aa39);};}exports[_0xc099('0x26')]=function(_0x240192,_0x477acc){var _0x1250ba={},_0x5de429={},_0x504208={'count':0x0,'rows':[]};var _0x727e08=_[_0xc099('0x27')](db[_0xc099('0x28')]['rawAttributes'],function(_0x29f9e2){return{'name':_0x29f9e2[_0xc099('0x29')],'type':_0x29f9e2[_0xc099('0x2a')][_0xc099('0x2b')]};});_0x5de429[_0xc099('0x2c')]=_['map'](_0x727e08,_0xc099('0x24'));_0x5de429[_0xc099('0x2d')]=_['keys'](_0x240192[_0xc099('0x2d')]);_0x5de429[_0xc099('0x2e')]=_['intersection'](_0x5de429['model'],_0x5de429[_0xc099('0x2d')]);_0x1250ba[_0xc099('0x2f')]=_[_0xc099('0x30')](_0x5de429[_0xc099('0x2c')],qs[_0xc099('0x31')](_0x240192[_0xc099('0x2d')]['fields']));_0x1250ba[_0xc099('0x2f')]=_0x1250ba[_0xc099('0x2f')][_0xc099('0x32')]?_0x1250ba[_0xc099('0x2f')]:_0x5de429[_0xc099('0x2c')];if(!_0x240192[_0xc099('0x2d')]['hasOwnProperty']('nolimit')){_0x1250ba['limit']=qs['limit'](_0x240192[_0xc099('0x2d')][_0xc099('0x17')]);_0x1250ba['offset']=qs[_0xc099('0x19')](_0x240192[_0xc099('0x2d')][_0xc099('0x19')]);}_0x1250ba[_0xc099('0x33')]=qs['sort'](_0x240192[_0xc099('0x2d')][_0xc099('0x34')]);_0x1250ba['where']=qs[_0xc099('0x2e')](_[_0xc099('0x35')](_0x240192['query'],_0x5de429['filters']),_0x727e08);if(_0x240192[_0xc099('0x2d')][_0xc099('0x36')]){_0x1250ba['where']=_[_0xc099('0x37')](_0x1250ba['where'],{'$or':_['map'](_0x727e08,function(_0x64b9a2){if(_0x64b9a2['type']!=='VIRTUAL'){var _0x5b8a20={};_0x5b8a20[_0x64b9a2[_0xc099('0x24')]]={'$like':'%'+_0x240192[_0xc099('0x2d')][_0xc099('0x36')]+'%'};return _0x5b8a20;}})});}_0x1250ba=_[_0xc099('0x37')]({},_0x1250ba,_0x240192[_0xc099('0x38')]);var _0x46ac22={'where':_0x1250ba[_0xc099('0x39')]};return db[_0xc099('0x28')][_0xc099('0x18')](_0x46ac22)[_0xc099('0x20')](function(_0xb7d4d7){_0x504208[_0xc099('0x18')]=_0xb7d4d7;if(_0x240192[_0xc099('0x2d')][_0xc099('0x3a')]){_0x1250ba['include']=[{'all':!![]}];}return db[_0xc099('0x28')][_0xc099('0x3b')](_0x1250ba);})[_0xc099('0x20')](function(_0x52cd78){_0x504208[_0xc099('0x3c')]=_0x52cd78;return _0x504208;})[_0xc099('0x20')](respondWithFilteredResult(_0x477acc,_0x1250ba))[_0xc099('0x3d')](handleError(_0x477acc,null));};exports[_0xc099('0x3e')]=function(_0x1fe8eb,_0x13848b){var _0x396a09={'raw':!![],'where':{'id':_0x1fe8eb['params']['id']}},_0x4a2402={};_0x4a2402['model']=_[_0xc099('0x3f')](db[_0xc099('0x28')][_0xc099('0x40')]);_0x4a2402[_0xc099('0x2d')]=_[_0xc099('0x3f')](_0x1fe8eb[_0xc099('0x2d')]);_0x4a2402[_0xc099('0x2e')]=_[_0xc099('0x30')](_0x4a2402[_0xc099('0x2c')],_0x4a2402[_0xc099('0x2d')]);_0x396a09[_0xc099('0x2f')]=_[_0xc099('0x30')](_0x4a2402['model'],qs[_0xc099('0x31')](_0x1fe8eb[_0xc099('0x2d')][_0xc099('0x31')]));_0x396a09[_0xc099('0x2f')]=_0x396a09[_0xc099('0x2f')][_0xc099('0x32')]?_0x396a09['attributes']:_0x4a2402[_0xc099('0x2c')];if(_0x1fe8eb[_0xc099('0x2d')][_0xc099('0x3a')]){_0x396a09[_0xc099('0x41')]=[{'all':!![]}];}_0x396a09=_[_0xc099('0x37')]({},_0x396a09,_0x1fe8eb[_0xc099('0x38')]);return db[_0xc099('0x28')][_0xc099('0x42')](_0x396a09)[_0xc099('0x20')](handleEntityNotFound(_0x13848b,null))[_0xc099('0x20')](respondWithResult(_0x13848b,null))[_0xc099('0x3d')](handleError(_0x13848b,null));};exports['create']=function(_0x2ace61,_0xf160d0){return db[_0xc099('0x28')]['create'](_0x2ace61[_0xc099('0x43')],{})[_0xc099('0x20')](respondWithResult(_0xf160d0,0xc9))['catch'](handleError(_0xf160d0,null));};exports[_0xc099('0x1f')]=function(_0x70c47d,_0x47315f){if(_0x70c47d['body']['id']){delete _0x70c47d[_0xc099('0x43')]['id'];}return db[_0xc099('0x28')][_0xc099('0x42')]({'where':{'id':_0x70c47d[_0xc099('0x44')]['id']}})[_0xc099('0x20')](handleEntityNotFound(_0x47315f,null))[_0xc099('0x20')](saveUpdates(_0x70c47d[_0xc099('0x43')],null))[_0xc099('0x20')](respondWithResult(_0x47315f,null))[_0xc099('0x3d')](handleError(_0x47315f,null));};exports[_0xc099('0x45')]=function(_0x3dade6,_0x2b7a11){return db[_0xc099('0x28')][_0xc099('0x42')]({'where':{'id':_0x3dade6[_0xc099('0x44')]['id']}})[_0xc099('0x20')](handleEntityNotFound(_0x2b7a11,null))[_0xc099('0x20')](removeEntity(_0x2b7a11,null))[_0xc099('0x3d')](handleError(_0x2b7a11,null));};exports[_0xc099('0x46')]=function(_0xbdb310,_0x355de7){return db['MailTransferReport'][_0xc099('0x46')]()[_0xc099('0x20')](respondWithResult(_0x355de7,null))['catch'](handleError(_0x355de7,null));};
\ No newline at end of file
+var _0x4789=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','limit','status','set','apply','reject','save','update','then','destroy','error','name','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','include','catch','show','params','length','create','body','find','describe','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service'];(function(_0x186496,_0x52bcd2){var _0x2a98aa=function(_0x149939){while(--_0x149939){_0x186496['push'](_0x186496['shift']());}};_0x2a98aa(++_0x52bcd2);}(_0x4789,0x10e));var _0x9478=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x4789[_0x39e84d];return _0x1991bc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9478('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9478('0x1'));var moment=require(_0x9478('0x2'));var BPromise=require(_0x9478('0x3'));var Mustache=require('mustache');var util=require(_0x9478('0x4'));var path=require(_0x9478('0x5'));var sox=require(_0x9478('0x6'));var csv=require(_0x9478('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9478('0x8'));var _=require('lodash');var squel=require(_0x9478('0x9'));var crypto=require(_0x9478('0xa'));var jsforce=require(_0x9478('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9478('0x7'));var querystring=require('querystring');var Papa=require(_0x9478('0xc'));var Redis=require('ioredis');var authService=require(_0x9478('0xd'));var qs=require(_0x9478('0xe'));var as=require(_0x9478('0xf'));var hardwareService=require(_0x9478('0x10'));var logger=require(_0x9478('0x11'))(_0x9478('0x12'));var utils=require(_0x9478('0x13'));var config=require(_0x9478('0x14'));var licenseUtil=require(_0x9478('0x15'));var db=require(_0x9478('0x16'))['db'];function respondWithStatusCode(_0x1db250,_0x114a1e){_0x114a1e=_0x114a1e||0xcc;return function(_0x42b819){if(_0x42b819){return _0x1db250[_0x9478('0x17')](_0x114a1e);}return _0x1db250['status'](_0x114a1e)[_0x9478('0x18')]();};}function respondWithResult(_0x3e6e7b,_0x5a82f1){_0x5a82f1=_0x5a82f1||0xc8;return function(_0x3eeda2){if(_0x3eeda2){return _0x3e6e7b['status'](_0x5a82f1)[_0x9478('0x19')](_0x3eeda2);}};}function respondWithFilteredResult(_0x362b6c,_0x5dc976){return function(_0x5b2c4a){if(_0x5b2c4a){var _0x339aae=typeof _0x5dc976['offset']===_0x9478('0x1a')&&typeof _0x5dc976['limit']==='undefined';var _0x51fca0=_0x5b2c4a[_0x9478('0x1b')];var _0x2e4bc9=_0x339aae?0x0:_0x5dc976[_0x9478('0x1c')];var _0x59a7bc=_0x339aae?_0x5b2c4a[_0x9478('0x1b')]:_0x5dc976[_0x9478('0x1c')]+_0x5dc976[_0x9478('0x1d')];var _0x5e1570;if(_0x59a7bc>=_0x51fca0){_0x59a7bc=_0x51fca0;_0x5e1570=0xc8;}else{_0x5e1570=0xce;}_0x362b6c[_0x9478('0x1e')](_0x5e1570);return _0x362b6c[_0x9478('0x1f')]('Content-Range',_0x2e4bc9+'-'+_0x59a7bc+'/'+_0x51fca0)[_0x9478('0x19')](_0x5b2c4a);}return null;};}function patchUpdates(_0x3ac261){return function(_0x157f99){try{jsonpatch[_0x9478('0x20')](_0x157f99,_0x3ac261,!![]);}catch(_0x455e77){return BPromise[_0x9478('0x21')](_0x455e77);}return _0x157f99[_0x9478('0x22')]();};}function saveUpdates(_0x29a3f1,_0x135397){return function(_0x41a770){if(_0x41a770){return _0x41a770[_0x9478('0x23')](_0x29a3f1)[_0x9478('0x24')](function(_0x16f562){return _0x16f562;});}return null;};}function removeEntity(_0x447121,_0xb764b2){return function(_0x1f270f){if(_0x1f270f){return _0x1f270f[_0x9478('0x25')]()['then'](function(){_0x447121[_0x9478('0x1e')](0xcc)[_0x9478('0x18')]();});}};}function handleEntityNotFound(_0x3b0fa0,_0x491120){return function(_0x5249a9){if(!_0x5249a9){_0x3b0fa0[_0x9478('0x17')](0x194);}return _0x5249a9;};}function handleError(_0x2b5cd3,_0x22e14){_0x22e14=_0x22e14||0x1f4;return function(_0x5e140a){logger[_0x9478('0x26')](_0x5e140a['stack']);if(_0x5e140a['name']){delete _0x5e140a[_0x9478('0x27')];}_0x2b5cd3[_0x9478('0x1e')](_0x22e14)['send'](_0x5e140a);};}exports[_0x9478('0x28')]=function(_0x166058,_0x4e5391){var _0x118673={},_0x1a0905={},_0x412a79={'count':0x0,'rows':[]};var _0x59d179=_[_0x9478('0x29')](db[_0x9478('0x2a')][_0x9478('0x2b')],function(_0x2f20c5){return{'name':_0x2f20c5[_0x9478('0x2c')],'type':_0x2f20c5[_0x9478('0x2d')][_0x9478('0x2e')]};});_0x1a0905[_0x9478('0x2f')]=_['map'](_0x59d179,'name');_0x1a0905[_0x9478('0x30')]=_[_0x9478('0x31')](_0x166058[_0x9478('0x30')]);_0x1a0905[_0x9478('0x32')]=_['intersection'](_0x1a0905['model'],_0x1a0905[_0x9478('0x30')]);_0x118673['attributes']=_[_0x9478('0x33')](_0x1a0905[_0x9478('0x2f')],qs[_0x9478('0x34')](_0x166058[_0x9478('0x30')]['fields']));_0x118673[_0x9478('0x35')]=_0x118673[_0x9478('0x35')]['length']?_0x118673[_0x9478('0x35')]:_0x1a0905[_0x9478('0x2f')];if(!_0x166058[_0x9478('0x30')][_0x9478('0x36')]('nolimit')){_0x118673[_0x9478('0x1d')]=qs['limit'](_0x166058[_0x9478('0x30')][_0x9478('0x1d')]);_0x118673[_0x9478('0x1c')]=qs[_0x9478('0x1c')](_0x166058['query']['offset']);}_0x118673['order']=qs[_0x9478('0x37')](_0x166058['query'][_0x9478('0x37')]);_0x118673[_0x9478('0x38')]=qs['filters'](_[_0x9478('0x39')](_0x166058[_0x9478('0x30')],_0x1a0905[_0x9478('0x32')]),_0x59d179);if(_0x166058[_0x9478('0x30')][_0x9478('0x3a')]){_0x118673[_0x9478('0x38')]=_[_0x9478('0x3b')](_0x118673[_0x9478('0x38')],{'$or':_[_0x9478('0x29')](_0x59d179,function(_0x24baec){if(_0x24baec['type']!==_0x9478('0x3c')){var _0x25bc87={};_0x25bc87[_0x24baec[_0x9478('0x27')]]={'$like':'%'+_0x166058[_0x9478('0x30')][_0x9478('0x3a')]+'%'};return _0x25bc87;}})});}_0x118673=_['merge']({},_0x118673,_0x166058[_0x9478('0x3d')]);var _0x57690a={'where':_0x118673[_0x9478('0x38')]};return db[_0x9478('0x2a')]['count'](_0x57690a)['then'](function(_0x55e460){_0x412a79['count']=_0x55e460;if(_0x166058[_0x9478('0x30')]['includeAll']){_0x118673[_0x9478('0x3e')]=[{'all':!![]}];}return db['MailTransferReport']['findAll'](_0x118673);})['then'](function(_0x3b5703){_0x412a79['rows']=_0x3b5703;return _0x412a79;})[_0x9478('0x24')](respondWithFilteredResult(_0x4e5391,_0x118673))[_0x9478('0x3f')](handleError(_0x4e5391,null));};exports[_0x9478('0x40')]=function(_0x1452ea,_0x4e0b32){var _0x27da97={'raw':!![],'where':{'id':_0x1452ea[_0x9478('0x41')]['id']}},_0x5288c2={};_0x5288c2['model']=_[_0x9478('0x31')](db[_0x9478('0x2a')]['rawAttributes']);_0x5288c2[_0x9478('0x30')]=_['keys'](_0x1452ea[_0x9478('0x30')]);_0x5288c2[_0x9478('0x32')]=_['intersection'](_0x5288c2[_0x9478('0x2f')],_0x5288c2['query']);_0x27da97['attributes']=_[_0x9478('0x33')](_0x5288c2['model'],qs[_0x9478('0x34')](_0x1452ea['query']['fields']));_0x27da97[_0x9478('0x35')]=_0x27da97['attributes'][_0x9478('0x42')]?_0x27da97['attributes']:_0x5288c2['model'];if(_0x1452ea[_0x9478('0x30')]['includeAll']){_0x27da97[_0x9478('0x3e')]=[{'all':!![]}];}_0x27da97=_[_0x9478('0x3b')]({},_0x27da97,_0x1452ea[_0x9478('0x3d')]);return db[_0x9478('0x2a')]['find'](_0x27da97)[_0x9478('0x24')](handleEntityNotFound(_0x4e0b32,null))[_0x9478('0x24')](respondWithResult(_0x4e0b32,null))[_0x9478('0x3f')](handleError(_0x4e0b32,null));};exports[_0x9478('0x43')]=function(_0x2f0462,_0x391572){return db[_0x9478('0x2a')][_0x9478('0x43')](_0x2f0462[_0x9478('0x44')],{})['then'](respondWithResult(_0x391572,0xc9))[_0x9478('0x3f')](handleError(_0x391572,null));};exports[_0x9478('0x23')]=function(_0x400c47,_0x56c09a){if(_0x400c47[_0x9478('0x44')]['id']){delete _0x400c47['body']['id'];}return db[_0x9478('0x2a')][_0x9478('0x45')]({'where':{'id':_0x400c47[_0x9478('0x41')]['id']}})['then'](handleEntityNotFound(_0x56c09a,null))[_0x9478('0x24')](saveUpdates(_0x400c47[_0x9478('0x44')],null))[_0x9478('0x24')](respondWithResult(_0x56c09a,null))[_0x9478('0x3f')](handleError(_0x56c09a,null));};exports[_0x9478('0x25')]=function(_0x1439c8,_0x1bbe4c){return db[_0x9478('0x2a')]['find']({'where':{'id':_0x1439c8[_0x9478('0x41')]['id']}})[_0x9478('0x24')](handleEntityNotFound(_0x1bbe4c,null))[_0x9478('0x24')](removeEntity(_0x1bbe4c,null))[_0x9478('0x3f')](handleError(_0x1bbe4c,null));};exports[_0x9478('0x46')]=function(_0x27501a,_0x5a1a4f){return db[_0x9478('0x2a')][_0x9478('0x46')]()['then'](respondWithResult(_0x5a1a4f,null))[_0x9478('0x3f')](handleError(_0x5a1a4f,null));};
\ No newline at end of file
index 33ddc23..543547d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf874=['bluebird','request-promise','path','../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','../../config/logger','api','moment'];(function(_0x4a4c96,_0x3e00e0){var _0x2d7462=function(_0xb8324){while(--_0xb8324){_0x4a4c96['push'](_0x4a4c96['shift']());}};_0x2d7462(++_0x3e00e0);}(_0xf874,0xed));var _0x4f87=function(_0x26a0f9,_0xce33e4){_0x26a0f9=_0x26a0f9-0x0;var _0x373849=_0xf874[_0x26a0f9];return _0x373849;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4f87('0x0'))(_0x4f87('0x1'));var moment=require(_0x4f87('0x2'));var BPromise=require(_0x4f87('0x3'));var rp=require(_0x4f87('0x4'));var fs=require('fs');var path=require(_0x4f87('0x5'));var rimraf=require('rimraf');var config=require(_0x4f87('0x6'));var attributes=require(_0x4f87('0x7'));module[_0x4f87('0x8')]=function(_0xf0ffb3,_0x104682){return _0xf0ffb3[_0x4f87('0x9')]('MailTransferReport',attributes,{'tableName':_0x4f87('0xa'),'paranoid':![],'indexes':[{'name':_0x4f87('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8524=['MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define'];(function(_0x5032fd,_0x4a84b4){var _0x3d9d94=function(_0x6366c4){while(--_0x6366c4){_0x5032fd['push'](_0x5032fd['shift']());}};_0x3d9d94(++_0x4a84b4);}(_0x8524,0x1d4));var _0x4852=function(_0x2fab49,_0x11c590){_0x2fab49=_0x2fab49-0x0;var _0x5da65a=_0x8524[_0x2fab49];return _0x5da65a;};'use strict';var _=require(_0x4852('0x0'));var util=require(_0x4852('0x1'));var logger=require(_0x4852('0x2'))(_0x4852('0x3'));var moment=require(_0x4852('0x4'));var BPromise=require(_0x4852('0x5'));var rp=require(_0x4852('0x6'));var fs=require('fs');var path=require(_0x4852('0x7'));var rimraf=require(_0x4852('0x8'));var config=require(_0x4852('0x9'));var attributes=require(_0x4852('0xa'));module['exports']=function(_0x45089f,_0x3f70eb){return _0x45089f[_0x4852('0xb')](_0x4852('0xc'),attributes,{'tableName':_0x4852('0xd'),'paranoid':![],'indexes':[{'name':_0x4852('0xe'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index c069182..fdb4087 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5a1=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x3b719f,_0xf8ccfb){var _0x5e1079=function(_0x54b378){while(--_0x54b378){_0x3b719f['push'](_0x3b719f['shift']());}};_0x5e1079(++_0xf8ccfb);}(_0xd5a1,0x164));var _0x1d5a=function(_0x2f1651,_0x10b559){_0x2f1651=_0x2f1651-0x0;var _0xedeb1=_0xd5a1[_0x2f1651];return _0xedeb1;};'use strict';var _=require('lodash');var util=require(_0x1d5a('0x0'));var moment=require('moment');var BPromise=require(_0x1d5a('0x1'));var rs=require(_0x1d5a('0x2'));var fs=require('fs');var Redis=require(_0x1d5a('0x3'));var db=require(_0x1d5a('0x4'))['db'];var utils=require(_0x1d5a('0x5'));var logger=require(_0x1d5a('0x6'))(_0x1d5a('0x7'));var config=require(_0x1d5a('0x8'));var jayson=require(_0x1d5a('0x9'));var client=jayson[_0x1d5a('0xa')][_0x1d5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10bc60,_0x31841f,_0x361a08){return new BPromise(function(_0x2ecadc,_0x2d0594){return client['request'](_0x10bc60,_0x361a08)[_0x1d5a('0xc')](function(_0x5f512d){logger[_0x1d5a('0xd')](_0x1d5a('0xe'),_0x31841f,_0x1d5a('0xf'));logger[_0x1d5a('0x10')](_0x1d5a('0x11'),_0x31841f,'request\x20sent',JSON[_0x1d5a('0x12')](_0x5f512d));if(_0x5f512d[_0x1d5a('0x13')]){if(_0x5f512d[_0x1d5a('0x13')][_0x1d5a('0x14')]===0x1f4){logger[_0x1d5a('0x13')](_0x1d5a('0xe'),_0x31841f,_0x5f512d[_0x1d5a('0x13')][_0x1d5a('0x15')]);return _0x2d0594(_0x5f512d[_0x1d5a('0x13')]['message']);}logger['error'](_0x1d5a('0xe'),_0x31841f,_0x5f512d[_0x1d5a('0x13')][_0x1d5a('0x15')]);return _0x2ecadc(_0x5f512d[_0x1d5a('0x13')][_0x1d5a('0x15')]);}else{logger['info'](_0x1d5a('0xe'),_0x31841f,'request\x20sent');_0x2ecadc(_0x5f512d[_0x1d5a('0x16')]['message']);}})[_0x1d5a('0x17')](function(_0x4ee9f0){logger['error'](_0x1d5a('0xe'),_0x31841f,_0x4ee9f0);_0x2d0594(_0x4ee9f0);});});}
\ No newline at end of file
+var _0x4806=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util'];(function(_0x4c34c1,_0x558eb0){var _0x1ed2f2=function(_0x320209){while(--_0x320209){_0x4c34c1['push'](_0x4c34c1['shift']());}};_0x1ed2f2(++_0x558eb0);}(_0x4806,0x112));var _0x6480=function(_0x3c56b7,_0x4def2f){_0x3c56b7=_0x3c56b7-0x0;var _0x800221=_0x4806[_0x3c56b7];return _0x800221;};'use strict';var _=require(_0x6480('0x0'));var util=require(_0x6480('0x1'));var moment=require(_0x6480('0x2'));var BPromise=require(_0x6480('0x3'));var rs=require(_0x6480('0x4'));var fs=require('fs');var Redis=require(_0x6480('0x5'));var db=require(_0x6480('0x6'))['db'];var utils=require(_0x6480('0x7'));var logger=require(_0x6480('0x8'))(_0x6480('0x9'));var config=require(_0x6480('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6480('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c9d18,_0x426f3e,_0x3ef913){return new BPromise(function(_0x3d22b0,_0x37b42d){return client[_0x6480('0xc')](_0x1c9d18,_0x3ef913)[_0x6480('0xd')](function(_0x29afed){logger['info'](_0x6480('0xe'),_0x426f3e,_0x6480('0xf'));logger[_0x6480('0x10')](_0x6480('0x11'),_0x426f3e,_0x6480('0xf'),JSON['stringify'](_0x29afed));if(_0x29afed[_0x6480('0x12')]){if(_0x29afed[_0x6480('0x12')][_0x6480('0x13')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x426f3e,_0x29afed[_0x6480('0x12')][_0x6480('0x14')]);return _0x37b42d(_0x29afed['error'][_0x6480('0x14')]);}logger['error'](_0x6480('0xe'),_0x426f3e,_0x29afed['error'][_0x6480('0x14')]);return _0x3d22b0(_0x29afed[_0x6480('0x12')][_0x6480('0x14')]);}else{logger[_0x6480('0x15')]('MailTransferReport,\x20%s,\x20%s',_0x426f3e,_0x6480('0xf'));_0x3d22b0(_0x29afed[_0x6480('0x16')]['message']);}})['catch'](function(_0x1f9ab0){logger[_0x6480('0x12')](_0x6480('0xe'),_0x426f3e,_0x1f9ab0);_0x37b42d(_0x1f9ab0);});});}
\ No newline at end of file
index 37723b3..4c0b81c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb99a=['../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x457647,_0x49e6d5){var _0x35f029=function(_0x393bb8){while(--_0x393bb8){_0x457647['push'](_0x457647['shift']());}};_0x35f029(++_0x49e6d5);}(_0xb99a,0x152));var _0xab99=function(_0x141817,_0x542c6c){_0x141817=_0x141817-0x0;var _0x3de994=_0xb99a[_0x141817];return _0x3de994;};'use strict';var multer=require(_0xab99('0x0'));var util=require(_0xab99('0x1'));var path=require(_0xab99('0x2'));var timeout=require(_0xab99('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xab99('0x4'));var auth=require(_0xab99('0x5'));var interaction=require(_0xab99('0x6'));var config=require(_0xab99('0x7'));var controller=require(_0xab99('0x8'));router[_0xab99('0x9')]('/',auth[_0xab99('0xa')](),controller[_0xab99('0xb')]);router['get'](_0xab99('0xc'),auth['isAuthenticated'](),controller[_0xab99('0xd')]);router[_0xab99('0x9')](_0xab99('0xe'),auth[_0xab99('0xa')](),controller[_0xab99('0xf')]);router[_0xab99('0x10')]('/',auth['isAuthenticated'](),controller[_0xab99('0x11')]);router[_0xab99('0x12')](_0xab99('0xe'),auth['isAuthenticated'](),controller[_0xab99('0x13')]);router[_0xab99('0x14')](_0xab99('0xe'),auth[_0xab99('0xa')](),controller[_0xab99('0x15')]);module[_0xab99('0x16')]=router;
\ No newline at end of file
+var _0x001d=['put','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post'];(function(_0x188002,_0x29395a){var _0x47fa4d=function(_0x36c2f5){while(--_0x36c2f5){_0x188002['push'](_0x188002['shift']());}};_0x47fa4d(++_0x29395a);}(_0x001d,0x1c5));var _0xd001=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x001d[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0xd001('0x0'));var util=require(_0xd001('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd001('0x2'));var router=express[_0xd001('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd001('0x4'));var interaction=require(_0xd001('0x5'));var config=require(_0xd001('0x6'));var controller=require(_0xd001('0x7'));router[_0xd001('0x8')]('/',auth[_0xd001('0x9')](),controller['index']);router[_0xd001('0x8')](_0xd001('0xa'),auth[_0xd001('0x9')](),controller[_0xd001('0xb')]);router[_0xd001('0x8')](_0xd001('0xc'),auth[_0xd001('0x9')](),controller[_0xd001('0xd')]);router[_0xd001('0xe')]('/',auth[_0xd001('0x9')](),controller['create']);router[_0xd001('0xf')](_0xd001('0xc'),auth[_0xd001('0x9')](),controller['update']);router[_0xd001('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xd001('0x11')]);module['exports']=router;
\ No newline at end of file
index cf88828..b39f4f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1da1=['talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','seconds','setDataValue','duration'];(function(_0x55930f,_0x485123){var _0x2c6ed8=function(_0x3b789b){while(--_0x3b789b){_0x55930f['push'](_0x55930f['shift']());}};_0x2c6ed8(++_0x485123);}(_0x1da1,0x1a4));var _0x11da=function(_0xdd17da,_0x16ab45){_0xdd17da=_0xdd17da-0x0;var _0x6af95b=_0x1da1[_0xdd17da];return _0x6af95b;};'use strict';var Sequelize=require(_0x11da('0x0'));var moment=require(_0x11da('0x1'));module[_0x11da('0x2')]={'channel':{'type':Sequelize[_0x11da('0x3')]},'membername':{'type':Sequelize[_0x11da('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0x11da('0x4'),'comment':_0x11da('0x5')},'duration':{'type':Sequelize[_0x11da('0x6')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x11da('0x7')],'set':function(_0x209cbb){var _0x15c324=moment(_0x209cbb);var _0x5ecc27=moment(this['getDataValue'](_0x11da('0x8')));var _0x109f4b=_0x15c324['diff'](_0x5ecc27,_0x11da('0x9'));this[_0x11da('0xa')]('exitAt',_0x209cbb);this[_0x11da('0xa')](_0x11da('0xb'),_0x109f4b||null);}},'data1':{'type':Sequelize[_0x11da('0x3')],'comment':_0x11da('0xc')},'data2':{'type':Sequelize[_0x11da('0x3')],'comment':_0x11da('0xd')},'data3':{'type':Sequelize[_0x11da('0x3')],'comment':_0x11da('0xe')},'data4':{'type':Sequelize[_0x11da('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x11da('0x3')],'comment':_0x11da('0xf')},'role':{'type':Sequelize[_0x11da('0x3')]},'internal':{'type':Sequelize[_0x11da('0x6')]},'uniqueid':{'type':Sequelize[_0x11da('0x3')]}};
\ No newline at end of file
+var _0x9181=['INTEGER','DATE','getDataValue','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x1c922e,_0x26d9e1){var _0x4af09b=function(_0x368598){while(--_0x368598){_0x1c922e['push'](_0x1c922e['shift']());}};_0x4af09b(++_0x26d9e1);}(_0x9181,0x182));var _0x1918=function(_0x295e48,_0x2e23ca){_0x295e48=_0x295e48-0x0;var _0x2ef9a7=_0x9181[_0x295e48];return _0x2ef9a7;};'use strict';var Sequelize=require(_0x1918('0x0'));var moment=require(_0x1918('0x1'));module[_0x1918('0x2')]={'channel':{'type':Sequelize[_0x1918('0x3')]},'membername':{'type':Sequelize[_0x1918('0x3')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1918('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x1918('0x4')},'duration':{'type':Sequelize[_0x1918('0x5')]},'enterAt':{'type':Sequelize[_0x1918('0x6')]},'exitAt':{'type':Sequelize[_0x1918('0x6')],'set':function(_0x424951){var _0x4106d7=moment(_0x424951);var _0x4cf696=moment(this[_0x1918('0x7')]('enterAt'));var _0x434acb=_0x4106d7['diff'](_0x4cf696,_0x1918('0x8'));this[_0x1918('0x9')](_0x1918('0xa'),_0x424951);this[_0x1918('0x9')](_0x1918('0xb'),_0x434acb||null);}},'data1':{'type':Sequelize[_0x1918('0x3')],'comment':_0x1918('0xc')},'data2':{'type':Sequelize[_0x1918('0x3')],'comment':_0x1918('0xd')},'data3':{'type':Sequelize[_0x1918('0x3')],'comment':_0x1918('0xe')},'data4':{'type':Sequelize[_0x1918('0x3')],'comment':_0x1918('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0x1918('0x10')},'role':{'type':Sequelize[_0x1918('0x3')]},'internal':{'type':Sequelize[_0x1918('0x5')]},'uniqueid':{'type':Sequelize[_0x1918('0x3')]}};
\ No newline at end of file
index bdaaf29..633d827 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xedd9,0xfc));var _0x9edd=function(_0x4bf4b0,_0xbdf90d){_0x4bf4b0=_0x4bf4b0-0x0;var _0x3b4c25=_0xedd9[_0x4bf4b0];return _0x3b4c25;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));};
\ No newline at end of file
+var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0xedd9,0xfc));var _0x9edd=function(_0x46aa71,_0x38ed7f){_0x46aa71=_0x46aa71-0x0;var _0x27798c=_0xedd9[_0x46aa71];return _0x27798c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));};
\ No newline at end of file
index 9287104..bff26c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaefe=['membername','interface','lodash','util','../../config/logger','api','moment','request-promise','path','./memberReport.attributes','exports','define','MemberReport'];(function(_0x19dd7a,_0x51de21){var _0x3feb6a=function(_0x4a3c84){while(--_0x4a3c84){_0x19dd7a['push'](_0x19dd7a['shift']());}};_0x3feb6a(++_0x51de21);}(_0xaefe,0x91));var _0xeaef=function(_0x4dd479,_0x26d87a){_0x4dd479=_0x4dd479-0x0;var _0x1b6807=_0xaefe[_0x4dd479];return _0x1b6807;};'use strict';var _=require(_0xeaef('0x0'));var util=require(_0xeaef('0x1'));var logger=require(_0xeaef('0x2'))(_0xeaef('0x3'));var moment=require(_0xeaef('0x4'));var BPromise=require('bluebird');var rp=require(_0xeaef('0x5'));var fs=require('fs');var path=require(_0xeaef('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeaef('0x7'));module[_0xeaef('0x8')]=function(_0x52b151,_0x42d583){return _0x52b151[_0xeaef('0x9')](_0xeaef('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xeaef('0xb'),_0xeaef('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7097=['path','rimraf','../../config/environment','exports','MemberReport','report_member','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x5314c9,_0x232b58){var _0x54b066=function(_0x258713){while(--_0x258713){_0x5314c9['push'](_0x5314c9['shift']());}};_0x54b066(++_0x232b58);}(_0x7097,0x1be));var _0x7709=function(_0x51e5ce,_0xff47ae){_0x51e5ce=_0x51e5ce-0x0;var _0x146167=_0x7097[_0x51e5ce];return _0x146167;};'use strict';var _=require(_0x7709('0x0'));var util=require(_0x7709('0x1'));var logger=require(_0x7709('0x2'))('api');var moment=require('moment');var BPromise=require(_0x7709('0x3'));var rp=require(_0x7709('0x4'));var fs=require('fs');var path=require(_0x7709('0x5'));var rimraf=require(_0x7709('0x6'));var config=require(_0x7709('0x7'));var attributes=require('./memberReport.attributes');module[_0x7709('0x8')]=function(_0x5811bf,_0xa77e55){return _0x5811bf['define'](_0x7709('0x9'),attributes,{'tableName':_0x7709('0xa'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername','interface']}],'timestamps':!![]});};
\ No newline at end of file
index f705532..f3f6357 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1134=['rpc','jayson/promise','http','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','create','body','CreateMemberReport','UpdateMemberReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0xa4f636,_0xaca1b6){var _0x37e02a=function(_0x49bd47){while(--_0x49bd47){_0xa4f636['push'](_0xa4f636['shift']());}};_0x37e02a(++_0xaca1b6);}(_0x1134,0x19c));var _0x4113=function(_0x4a3704,_0x1f34a3){_0x4a3704=_0x4a3704-0x0;var _0x1912cb=_0x1134[_0x4a3704];return _0x1912cb;};'use strict';var _=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var moment=require('moment');var BPromise=require(_0x4113('0x2'));var rs=require(_0x4113('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4113('0x4'))['db'];var utils=require(_0x4113('0x5'));var logger=require('../../config/logger')(_0x4113('0x6'));var config=require('../../config/environment');var jayson=require(_0x4113('0x7'));var client=jayson['client'][_0x4113('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x493b42,_0xb1cea2,_0x28520f){return new BPromise(function(_0x3b6cc4,_0x11153c){return client[_0x4113('0x9')](_0x493b42,_0x28520f)[_0x4113('0xa')](function(_0x19c657){logger[_0x4113('0xb')]('MemberReport,\x20%s,\x20%s',_0xb1cea2,_0x4113('0xc'));logger[_0x4113('0xd')](_0x4113('0xe'),_0xb1cea2,_0x4113('0xc'),JSON[_0x4113('0xf')](_0x19c657));if(_0x19c657[_0x4113('0x10')]){if(_0x19c657[_0x4113('0x10')][_0x4113('0x11')]===0x1f4){logger[_0x4113('0x10')](_0x4113('0x12'),_0xb1cea2,_0x19c657['error']['message']);return _0x11153c(_0x19c657['error'][_0x4113('0x13')]);}logger[_0x4113('0x10')]('MemberReport,\x20%s,\x20%s',_0xb1cea2,_0x19c657['error'][_0x4113('0x13')]);return _0x3b6cc4(_0x19c657['error'][_0x4113('0x13')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0xb1cea2,_0x4113('0xc'));_0x3b6cc4(_0x19c657[_0x4113('0x14')][_0x4113('0x13')]);}})[_0x4113('0x15')](function(_0x21d732){logger[_0x4113('0x10')](_0x4113('0x12'),_0xb1cea2,_0x21d732);_0x11153c(_0x21d732);});});}exports[_0x4113('0x16')]=function(_0x1051d4){var _0x1cd9ae=this;return new Promise(function(_0x59b821,_0x41d58b){return db[_0x4113('0x17')][_0x4113('0x18')]({'raw':_0x1051d4[_0x4113('0x19')]?_0x1051d4[_0x4113('0x19')][_0x4113('0x1a')]===undefined?!![]:![]:!![],'where':_0x1051d4[_0x4113('0x19')]?_0x1051d4[_0x4113('0x19')][_0x4113('0x1b')]||null:null,'attributes':_0x1051d4['options']?_0x1051d4[_0x4113('0x19')][_0x4113('0x1c')]||null:null,'limit':_0x1051d4['options']?_0x1051d4['options'][_0x4113('0x1d')]||null:null,'include':_0x1051d4['options']?_0x1051d4[_0x4113('0x19')][_0x4113('0x1e')]?_[_0x4113('0x1f')](_0x1051d4['options'][_0x4113('0x1e')],function(_0x16b16c){return{'model':db[_0x16b16c[_0x4113('0x20')]],'as':_0x16b16c['as'],'attributes':_0x16b16c[_0x4113('0x1c')],'include':_0x16b16c[_0x4113('0x1e')]?_[_0x4113('0x1f')](_0x16b16c[_0x4113('0x1e')],function(_0x1c498a){return{'model':db[_0x1c498a[_0x4113('0x20')]],'as':_0x1c498a['as'],'attributes':_0x1c498a[_0x4113('0x1c')],'include':_0x1c498a[_0x4113('0x1e')]?_[_0x4113('0x1f')](_0x1c498a['include'],function(_0x44b317){return{'model':db[_0x44b317[_0x4113('0x20')]],'as':_0x44b317['as'],'attributes':_0x44b317['attributes']};}):[]};}):[]};}):[]:[]})[_0x4113('0xa')](function(_0x98d652){logger[_0x4113('0xb')](_0x4113('0x16'),_0x1051d4);logger[_0x4113('0xd')](_0x4113('0x16'),_0x1051d4,JSON[_0x4113('0xf')](_0x98d652));_0x59b821(_0x98d652);})[_0x4113('0x15')](function(_0x3f063f){logger[_0x4113('0x10')](_0x4113('0x16'),_0x3f063f[_0x4113('0x13')],_0x1051d4);_0x41d58b(_0x1cd9ae[_0x4113('0x10')](0x1f4,_0x3f063f[_0x4113('0x13')]));});});};exports['CreateMemberReport']=function(_0x1607a6){var _0xfeabfd=this;return new Promise(function(_0x4ecf29,_0x201966){return db[_0x4113('0x17')][_0x4113('0x21')](_0x1607a6[_0x4113('0x22')],{'raw':_0x1607a6['options']?_0x1607a6[_0x4113('0x19')][_0x4113('0x1a')]===undefined?!![]:![]:!![]})[_0x4113('0xa')](function(_0x2327db){logger[_0x4113('0xb')](_0x4113('0x23'),_0x1607a6);logger[_0x4113('0xd')](_0x4113('0x23'),_0x1607a6,JSON[_0x4113('0xf')](_0x2327db));_0x4ecf29(_0x2327db);})['catch'](function(_0x3ff5c9){logger['error'](_0x4113('0x23'),_0x3ff5c9[_0x4113('0x13')],_0x1607a6);_0x201966(_0xfeabfd[_0x4113('0x10')](0x1f4,_0x3ff5c9[_0x4113('0x13')]));});});};exports[_0x4113('0x24')]=function(_0x453d70){var _0x4bbda1=this;return new Promise(function(_0x1f63ec,_0x56ad93){return db[_0x4113('0x17')][_0x4113('0x25')](_0x453d70[_0x4113('0x22')],{'raw':_0x453d70['options']?_0x453d70[_0x4113('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x453d70[_0x4113('0x19')]?_0x453d70['options'][_0x4113('0x1b')]||null:null,'attributes':_0x453d70[_0x4113('0x19')]?_0x453d70['options']['attributes']||null:null,'limit':_0x453d70[_0x4113('0x19')]?_0x453d70[_0x4113('0x19')][_0x4113('0x1d')]||null:null})['then'](function(_0x590ef7){logger[_0x4113('0xb')](_0x4113('0x24'),_0x453d70);logger[_0x4113('0xd')](_0x4113('0x24'),_0x453d70,JSON[_0x4113('0xf')](_0x590ef7));_0x1f63ec(_0x590ef7);})['catch'](function(_0x407b01){logger[_0x4113('0x10')](_0x4113('0x24'),_0x407b01['message'],_0x453d70);_0x56ad93(_0x4bbda1[_0x4113('0x10')](0x1f4,_0x407b01[_0x4113('0x13')]));});});};
\ No newline at end of file
+var _0x6003=['info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetMemberReport','MemberReport','create','CreateMemberReport','UpdateMemberReport','body','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x6d8628,_0x435cca){var _0x220d1a=function(_0x356d50){while(--_0x356d50){_0x6d8628['push'](_0x6d8628['shift']());}};_0x220d1a(++_0x435cca);}(_0x6003,0xae));var _0x3600=function(_0x4b719f,_0x25d358){_0x4b719f=_0x4b719f-0x0;var _0x47d18b=_0x6003[_0x4b719f];return _0x47d18b;};'use strict';var _=require(_0x3600('0x0'));var util=require(_0x3600('0x1'));var moment=require(_0x3600('0x2'));var BPromise=require(_0x3600('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3600('0x4'))['db'];var utils=require(_0x3600('0x5'));var logger=require(_0x3600('0x6'))('rpc');var config=require(_0x3600('0x7'));var jayson=require(_0x3600('0x8'));var client=jayson['client'][_0x3600('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f4130,_0x4880c7,_0x177f11){return new BPromise(function(_0x4a5962,_0x145243){return client['request'](_0x4f4130,_0x177f11)[_0x3600('0xa')](function(_0x22f1b3){logger[_0x3600('0xb')](_0x3600('0xc'),_0x4880c7,'request\x20sent');logger[_0x3600('0xd')](_0x3600('0xe'),_0x4880c7,_0x3600('0xf'),JSON[_0x3600('0x10')](_0x22f1b3));if(_0x22f1b3[_0x3600('0x11')]){if(_0x22f1b3[_0x3600('0x11')][_0x3600('0x12')]===0x1f4){logger[_0x3600('0x11')](_0x3600('0xc'),_0x4880c7,_0x22f1b3[_0x3600('0x11')][_0x3600('0x13')]);return _0x145243(_0x22f1b3[_0x3600('0x11')]['message']);}logger[_0x3600('0x11')]('MemberReport,\x20%s,\x20%s',_0x4880c7,_0x22f1b3['error'][_0x3600('0x13')]);return _0x4a5962(_0x22f1b3[_0x3600('0x11')][_0x3600('0x13')]);}else{logger['info'](_0x3600('0xc'),_0x4880c7,'request\x20sent');_0x4a5962(_0x22f1b3[_0x3600('0x14')]['message']);}})[_0x3600('0x15')](function(_0xb11c9d){logger[_0x3600('0x11')]('MemberReport,\x20%s,\x20%s',_0x4880c7,_0xb11c9d);_0x145243(_0xb11c9d);});});}exports['GetMemberReport']=function(_0x680b80){var _0x274012=this;return new Promise(function(_0xcb98b5,_0x2d8f10){return db['MemberReport'][_0x3600('0x16')]({'raw':_0x680b80['options']?_0x680b80[_0x3600('0x17')][_0x3600('0x18')]===undefined?!![]:![]:!![],'where':_0x680b80[_0x3600('0x17')]?_0x680b80['options'][_0x3600('0x19')]||null:null,'attributes':_0x680b80['options']?_0x680b80[_0x3600('0x17')][_0x3600('0x1a')]||null:null,'limit':_0x680b80[_0x3600('0x17')]?_0x680b80[_0x3600('0x17')][_0x3600('0x1b')]||null:null,'include':_0x680b80['options']?_0x680b80[_0x3600('0x17')][_0x3600('0x1c')]?_[_0x3600('0x1d')](_0x680b80[_0x3600('0x17')][_0x3600('0x1c')],function(_0x148155){return{'model':db[_0x148155[_0x3600('0x1e')]],'as':_0x148155['as'],'attributes':_0x148155[_0x3600('0x1a')],'include':_0x148155[_0x3600('0x1c')]?_[_0x3600('0x1d')](_0x148155[_0x3600('0x1c')],function(_0x51bdb8){return{'model':db[_0x51bdb8[_0x3600('0x1e')]],'as':_0x51bdb8['as'],'attributes':_0x51bdb8['attributes'],'include':_0x51bdb8[_0x3600('0x1c')]?_['map'](_0x51bdb8[_0x3600('0x1c')],function(_0x1c6b74){return{'model':db[_0x1c6b74[_0x3600('0x1e')]],'as':_0x1c6b74['as'],'attributes':_0x1c6b74[_0x3600('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3600('0xa')](function(_0x20c68d){logger['info'](_0x3600('0x1f'),_0x680b80);logger[_0x3600('0xd')]('GetMemberReport',_0x680b80,JSON[_0x3600('0x10')](_0x20c68d));_0xcb98b5(_0x20c68d);})[_0x3600('0x15')](function(_0x2854cd){logger[_0x3600('0x11')](_0x3600('0x1f'),_0x2854cd[_0x3600('0x13')],_0x680b80);_0x2d8f10(_0x274012[_0x3600('0x11')](0x1f4,_0x2854cd[_0x3600('0x13')]));});});};exports['CreateMemberReport']=function(_0x5cc2d9){var _0x386e47=this;return new Promise(function(_0x531845,_0x12b841){return db[_0x3600('0x20')][_0x3600('0x21')](_0x5cc2d9['body'],{'raw':_0x5cc2d9['options']?_0x5cc2d9[_0x3600('0x17')][_0x3600('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4511b4){logger[_0x3600('0xb')](_0x3600('0x22'),_0x5cc2d9);logger['debug'](_0x3600('0x22'),_0x5cc2d9,JSON[_0x3600('0x10')](_0x4511b4));_0x531845(_0x4511b4);})[_0x3600('0x15')](function(_0x16325c){logger[_0x3600('0x11')](_0x3600('0x22'),_0x16325c[_0x3600('0x13')],_0x5cc2d9);_0x12b841(_0x386e47[_0x3600('0x11')](0x1f4,_0x16325c[_0x3600('0x13')]));});});};exports[_0x3600('0x23')]=function(_0x13615){var _0x174b0b=this;return new Promise(function(_0x45380a,_0x5237ee){return db[_0x3600('0x20')]['update'](_0x13615[_0x3600('0x24')],{'raw':_0x13615['options']?_0x13615[_0x3600('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13615[_0x3600('0x17')]?_0x13615[_0x3600('0x17')][_0x3600('0x19')]||null:null,'attributes':_0x13615[_0x3600('0x17')]?_0x13615[_0x3600('0x17')][_0x3600('0x1a')]||null:null,'limit':_0x13615[_0x3600('0x17')]?_0x13615[_0x3600('0x17')]['limit']||null:null})['then'](function(_0x4189e0){logger[_0x3600('0xb')](_0x3600('0x23'),_0x13615);logger['debug'](_0x3600('0x23'),_0x13615,JSON['stringify'](_0x4189e0));_0x45380a(_0x4189e0);})[_0x3600('0x15')](function(_0x4232b0){logger['error'](_0x3600('0x23'),_0x4232b0[_0x3600('0x13')],_0x13615);_0x5237ee(_0x174b0b[_0x3600('0x11')](0x1f4,_0x4232b0[_0x3600('0x13')]));});});};
\ No newline at end of file
index f90961a..382b535 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2777=['../../components/auth/service','../../components/interaction/service','get','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2777,0x130));var _0x7277=function(_0x4f7007,_0x462b95){_0x4f7007=_0x4f7007-0x0;var _0x1f5de7=_0x2777[_0x4f7007];return _0x1f5de7;};'use strict';var multer=require(_0x7277('0x0'));var util=require('util');var path=require(_0x7277('0x1'));var timeout=require(_0x7277('0x2'));var express=require(_0x7277('0x3'));var router=express[_0x7277('0x4')]();var fs_extra=require(_0x7277('0x5'));var auth=require(_0x7277('0x6'));var interaction=require(_0x7277('0x7'));var config=require('../../config/environment');var controller=require('./migration.controller');router[_0x7277('0x8')]('/',controller['index']);module[_0x7277('0x9')]=router;
\ No newline at end of file
+var _0xb33b=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./migration.controller','get','index','exports'];(function(_0x202b05,_0x5a246c){var _0x22a0a7=function(_0x5157f2){while(--_0x5157f2){_0x202b05['push'](_0x202b05['shift']());}};_0x22a0a7(++_0x5a246c);}(_0xb33b,0x1a2));var _0xbb33=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb33b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xbb33('0x0'));var path=require(_0xbb33('0x1'));var timeout=require(_0xbb33('0x2'));var express=require(_0xbb33('0x3'));var router=express[_0xbb33('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbb33('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbb33('0x6'));var controller=require(_0xbb33('0x7'));router[_0xbb33('0x8')]('/',controller[_0xbb33('0x9')]);module[_0xbb33('0xa')]=router;
\ No newline at end of file
index 60d3b3d..87449b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3235=['exports','STRING','version','sequelize'];(function(_0x413d8c,_0x4c8811){var _0x16dfb6=function(_0x384d37){while(--_0x384d37){_0x413d8c['push'](_0x413d8c['shift']());}};_0x16dfb6(++_0x4c8811);}(_0x3235,0x107));var _0x5323=function(_0x2b69b4,_0x3e1603){_0x2b69b4=_0x2b69b4-0x0;var _0x4865bd=_0x3235[_0x2b69b4];return _0x4865bd;};'use strict';var Sequelize=require(_0x5323('0x0'));module[_0x5323('0x1')]={'version':{'type':Sequelize[_0x5323('0x2')],'unique':_0x5323('0x3')}};
\ No newline at end of file
+var _0xf46c=['exports','STRING','sequelize'];(function(_0x3238ea,_0x91809d){var _0x4aaac2=function(_0xc5b102){while(--_0xc5b102){_0x3238ea['push'](_0x3238ea['shift']());}};_0x4aaac2(++_0x91809d);}(_0xf46c,0x16d));var _0xcf46=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf46c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xcf46('0x0'));module[_0xcf46('0x1')]={'version':{'type':Sequelize[_0xcf46('0x2')],'unique':'version'}};
\ No newline at end of file
index e0805d4..5c432d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee0c=['nolimit','sort','where','merge','VIRTUAL','filter','options','findAll','rows','catch','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','map','Migration','rawAttributes','type','keys','query','filters','model','attributes','intersection','fields','length'];(function(_0x18179c,_0x19597a){var _0x4f4768=function(_0x5c5d38){while(--_0x5c5d38){_0x18179c['push'](_0x18179c['shift']());}};_0x4f4768(++_0x19597a);}(_0xee0c,0x10e));var _0xcee0=function(_0x3446a8,_0x3cb239){_0x3446a8=_0x3446a8-0x0;var _0x1021bf=_0xee0c[_0x3446a8];return _0x1021bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcee0('0x0'));var zipdir=require(_0xcee0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcee0('0x2'));var moment=require(_0xcee0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcee0('0x4'));var util=require(_0xcee0('0x5'));var path=require('path');var sox=require(_0xcee0('0x6'));var csv=require('to-csv');var ejs=require(_0xcee0('0x7'));var fs=require('fs');var fs_extra=require(_0xcee0('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xcee0('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcee0('0xa'));var querystring=require(_0xcee0('0xb'));var Papa=require(_0xcee0('0xc'));var Redis=require(_0xcee0('0xd'));var authService=require(_0xcee0('0xe'));var qs=require(_0xcee0('0xf'));var as=require(_0xcee0('0x10'));var hardwareService=require(_0xcee0('0x11'));var logger=require(_0xcee0('0x12'))(_0xcee0('0x13'));var utils=require(_0xcee0('0x14'));var config=require(_0xcee0('0x15'));var licenseUtil=require(_0xcee0('0x16'));var db=require(_0xcee0('0x17'))['db'];function respondWithStatusCode(_0x1629d3,_0x5b9fd4){_0x5b9fd4=_0x5b9fd4||0xcc;return function(_0x340bc1){if(_0x340bc1){return _0x1629d3['sendStatus'](_0x5b9fd4);}return _0x1629d3[_0xcee0('0x18')](_0x5b9fd4)[_0xcee0('0x19')]();};}function respondWithResult(_0x389049,_0x20d376){_0x20d376=_0x20d376||0xc8;return function(_0x25d1d1){if(_0x25d1d1){return _0x389049[_0xcee0('0x18')](_0x20d376)['json'](_0x25d1d1);}};}function respondWithFilteredResult(_0x57ee2a,_0x4bf3f9){return function(_0x3bfda4){if(_0x3bfda4){var _0x19a44b=typeof _0x4bf3f9[_0xcee0('0x1a')]===_0xcee0('0x1b')&&typeof _0x4bf3f9[_0xcee0('0x1c')]==='undefined';var _0x21471e=_0x3bfda4[_0xcee0('0x1d')];var _0x5568b6=_0x19a44b?0x0:_0x4bf3f9[_0xcee0('0x1a')];var _0x518dc3=_0x19a44b?_0x3bfda4[_0xcee0('0x1d')]:_0x4bf3f9['offset']+_0x4bf3f9[_0xcee0('0x1c')];var _0x5ca3b0;if(_0x518dc3>=_0x21471e){_0x518dc3=_0x21471e;_0x5ca3b0=0xc8;}else{_0x5ca3b0=0xce;}_0x57ee2a[_0xcee0('0x18')](_0x5ca3b0);return _0x57ee2a[_0xcee0('0x1e')](_0xcee0('0x1f'),_0x5568b6+'-'+_0x518dc3+'/'+_0x21471e)[_0xcee0('0x20')](_0x3bfda4);}return null;};}function patchUpdates(_0xa9362){return function(_0x57a9aa){try{jsonpatch[_0xcee0('0x21')](_0x57a9aa,_0xa9362,!![]);}catch(_0x191e52){return BPromise[_0xcee0('0x22')](_0x191e52);}return _0x57a9aa[_0xcee0('0x23')]();};}function saveUpdates(_0x29bc23,_0x4a1282){return function(_0x13eaf9){if(_0x13eaf9){return _0x13eaf9['update'](_0x29bc23)[_0xcee0('0x24')](function(_0x573c6f){return _0x573c6f;});}return null;};}function removeEntity(_0x565c3d,_0x48d89c){return function(_0x5c156f){if(_0x5c156f){return _0x5c156f[_0xcee0('0x25')]()[_0xcee0('0x24')](function(){_0x565c3d[_0xcee0('0x18')](0xcc)[_0xcee0('0x19')]();});}};}function handleEntityNotFound(_0x2b11ed,_0x378cc8){return function(_0x5ace48){if(!_0x5ace48){_0x2b11ed[_0xcee0('0x26')](0x194);}return _0x5ace48;};}function handleError(_0x172ab7,_0x1f6736){_0x1f6736=_0x1f6736||0x1f4;return function(_0x49b0a8){logger[_0xcee0('0x27')](_0x49b0a8[_0xcee0('0x28')]);if(_0x49b0a8[_0xcee0('0x29')]){delete _0x49b0a8[_0xcee0('0x29')];}_0x172ab7[_0xcee0('0x18')](_0x1f6736)['send'](_0x49b0a8);};}exports[_0xcee0('0x2a')]=function(_0xa143e7,_0x319eb3){var _0x545f5c={},_0x4805b2={},_0xea8b8={'count':0x0,'rows':[]};var _0x2508d4=_[_0xcee0('0x2b')](db[_0xcee0('0x2c')][_0xcee0('0x2d')],function(_0x5eb0c0){return{'name':_0x5eb0c0['fieldName'],'type':_0x5eb0c0[_0xcee0('0x2e')]['key']};});_0x4805b2['model']=_['map'](_0x2508d4,_0xcee0('0x29'));_0x4805b2['query']=_[_0xcee0('0x2f')](_0xa143e7[_0xcee0('0x30')]);_0x4805b2[_0xcee0('0x31')]=_['intersection'](_0x4805b2[_0xcee0('0x32')],_0x4805b2[_0xcee0('0x30')]);_0x545f5c[_0xcee0('0x33')]=_[_0xcee0('0x34')](_0x4805b2[_0xcee0('0x32')],qs[_0xcee0('0x35')](_0xa143e7[_0xcee0('0x30')][_0xcee0('0x35')]));_0x545f5c[_0xcee0('0x33')]=_0x545f5c['attributes'][_0xcee0('0x36')]?_0x545f5c['attributes']:_0x4805b2['model'];if(!_0xa143e7[_0xcee0('0x30')]['hasOwnProperty'](_0xcee0('0x37'))){_0x545f5c[_0xcee0('0x1c')]=qs[_0xcee0('0x1c')](_0xa143e7['query'][_0xcee0('0x1c')]);_0x545f5c['offset']=qs[_0xcee0('0x1a')](_0xa143e7[_0xcee0('0x30')][_0xcee0('0x1a')]);}_0x545f5c['order']=qs[_0xcee0('0x38')](_0xa143e7[_0xcee0('0x30')]['sort']);_0x545f5c[_0xcee0('0x39')]=qs[_0xcee0('0x31')](_['pick'](_0xa143e7['query'],_0x4805b2['filters']),_0x2508d4);if(_0xa143e7[_0xcee0('0x30')]['filter']){_0x545f5c[_0xcee0('0x39')]=_[_0xcee0('0x3a')](_0x545f5c['where'],{'$or':_[_0xcee0('0x2b')](_0x2508d4,function(_0x4f9992){if(_0x4f9992[_0xcee0('0x2e')]!==_0xcee0('0x3b')){var _0x37e412={};_0x37e412[_0x4f9992[_0xcee0('0x29')]]={'$like':'%'+_0xa143e7[_0xcee0('0x30')][_0xcee0('0x3c')]+'%'};return _0x37e412;}})});}_0x545f5c=_['merge']({},_0x545f5c,_0xa143e7[_0xcee0('0x3d')]);var _0x5d9868={'where':_0x545f5c['where']};return db[_0xcee0('0x2c')][_0xcee0('0x1d')](_0x5d9868)[_0xcee0('0x24')](function(_0xa287a9){_0xea8b8['count']=_0xa287a9;if(_0xa143e7[_0xcee0('0x30')]['includeAll']){_0x545f5c['include']=[{'all':!![]}];}return db[_0xcee0('0x2c')][_0xcee0('0x3e')](_0x545f5c);})['then'](function(_0x551cc2){_0xea8b8[_0xcee0('0x3f')]=_0x551cc2;return _0xea8b8;})[_0xcee0('0x24')](respondWithFilteredResult(_0x319eb3,_0x545f5c))[_0xcee0('0x40')](handleError(_0x319eb3,null));};
\ No newline at end of file
+var _0xc672=['reject','save','update','then','destroy','error','name','send','index','Migration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0xfaca81,_0x8971df){var _0x2ecdb4=function(_0xf4ff0b){while(--_0xf4ff0b){_0xfaca81['push'](_0xfaca81['shift']());}};_0x2ecdb4(++_0x8971df);}(_0xc672,0xf8));var _0x2c67=function(_0x283f84,_0x14b54f){_0x283f84=_0x283f84-0x0;var _0x50372f=_0xc672[_0x283f84];return _0x50372f;};'use strict';var emlformat=require(_0x2c67('0x0'));var rimraf=require(_0x2c67('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c67('0x2'));var rp=require(_0x2c67('0x3'));var moment=require('moment');var BPromise=require(_0x2c67('0x4'));var Mustache=require(_0x2c67('0x5'));var util=require(_0x2c67('0x6'));var path=require(_0x2c67('0x7'));var sox=require('sox');var csv=require(_0x2c67('0x8'));var ejs=require(_0x2c67('0x9'));var fs=require('fs');var fs_extra=require(_0x2c67('0xa'));var _=require(_0x2c67('0xb'));var squel=require(_0x2c67('0xc'));var crypto=require('crypto');var jsforce=require(_0x2c67('0xd'));var deskjs=require(_0x2c67('0xe'));var toCsv=require(_0x2c67('0x8'));var querystring=require(_0x2c67('0xf'));var Papa=require(_0x2c67('0x10'));var Redis=require(_0x2c67('0x11'));var authService=require(_0x2c67('0x12'));var qs=require(_0x2c67('0x13'));var as=require(_0x2c67('0x14'));var hardwareService=require(_0x2c67('0x15'));var logger=require(_0x2c67('0x16'))(_0x2c67('0x17'));var utils=require(_0x2c67('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2c67('0x19'));var db=require(_0x2c67('0x1a'))['db'];function respondWithStatusCode(_0x3919d9,_0x54bf6c){_0x54bf6c=_0x54bf6c||0xcc;return function(_0x6d5615){if(_0x6d5615){return _0x3919d9[_0x2c67('0x1b')](_0x54bf6c);}return _0x3919d9[_0x2c67('0x1c')](_0x54bf6c)[_0x2c67('0x1d')]();};}function respondWithResult(_0x570be3,_0x220f6b){_0x220f6b=_0x220f6b||0xc8;return function(_0x335dbb){if(_0x335dbb){return _0x570be3['status'](_0x220f6b)[_0x2c67('0x1e')](_0x335dbb);}};}function respondWithFilteredResult(_0x1b25f2,_0x532df4){return function(_0x1e08b5){if(_0x1e08b5){var _0x363000=typeof _0x532df4['offset']===_0x2c67('0x1f')&&typeof _0x532df4[_0x2c67('0x20')]===_0x2c67('0x1f');var _0x4e3e63=_0x1e08b5[_0x2c67('0x21')];var _0x2a3971=_0x363000?0x0:_0x532df4[_0x2c67('0x22')];var _0x5bda50=_0x363000?_0x1e08b5[_0x2c67('0x21')]:_0x532df4[_0x2c67('0x22')]+_0x532df4[_0x2c67('0x20')];var _0x52f4fb;if(_0x5bda50>=_0x4e3e63){_0x5bda50=_0x4e3e63;_0x52f4fb=0xc8;}else{_0x52f4fb=0xce;}_0x1b25f2[_0x2c67('0x1c')](_0x52f4fb);return _0x1b25f2[_0x2c67('0x23')]('Content-Range',_0x2a3971+'-'+_0x5bda50+'/'+_0x4e3e63)['json'](_0x1e08b5);}return null;};}function patchUpdates(_0x4338f3){return function(_0x43f5e6){try{jsonpatch['apply'](_0x43f5e6,_0x4338f3,!![]);}catch(_0x2494bc){return BPromise[_0x2c67('0x24')](_0x2494bc);}return _0x43f5e6[_0x2c67('0x25')]();};}function saveUpdates(_0x19ae9f,_0x35f023){return function(_0x1a9623){if(_0x1a9623){return _0x1a9623[_0x2c67('0x26')](_0x19ae9f)[_0x2c67('0x27')](function(_0x314ff1){return _0x314ff1;});}return null;};}function removeEntity(_0x241b54,_0x3c3d97){return function(_0x439c5b){if(_0x439c5b){return _0x439c5b[_0x2c67('0x28')]()['then'](function(){_0x241b54['status'](0xcc)[_0x2c67('0x1d')]();});}};}function handleEntityNotFound(_0x41e1ed,_0x879d10){return function(_0x5b60e7){if(!_0x5b60e7){_0x41e1ed[_0x2c67('0x1b')](0x194);}return _0x5b60e7;};}function handleError(_0x52816c,_0x4b0312){_0x4b0312=_0x4b0312||0x1f4;return function(_0x56c06d){logger[_0x2c67('0x29')](_0x56c06d['stack']);if(_0x56c06d[_0x2c67('0x2a')]){delete _0x56c06d[_0x2c67('0x2a')];}_0x52816c[_0x2c67('0x1c')](_0x4b0312)[_0x2c67('0x2b')](_0x56c06d);};}exports[_0x2c67('0x2c')]=function(_0x58c379,_0x599cab){var _0x1be52b={},_0x567408={},_0x2df18f={'count':0x0,'rows':[]};var _0x26f4e3=_['map'](db[_0x2c67('0x2d')][_0x2c67('0x2e')],function(_0x5f8c92){return{'name':_0x5f8c92[_0x2c67('0x2f')],'type':_0x5f8c92[_0x2c67('0x30')][_0x2c67('0x31')]};});_0x567408[_0x2c67('0x32')]=_[_0x2c67('0x33')](_0x26f4e3,_0x2c67('0x2a'));_0x567408[_0x2c67('0x34')]=_[_0x2c67('0x35')](_0x58c379[_0x2c67('0x34')]);_0x567408[_0x2c67('0x36')]=_[_0x2c67('0x37')](_0x567408['model'],_0x567408[_0x2c67('0x34')]);_0x1be52b[_0x2c67('0x38')]=_['intersection'](_0x567408['model'],qs[_0x2c67('0x39')](_0x58c379['query'][_0x2c67('0x39')]));_0x1be52b[_0x2c67('0x38')]=_0x1be52b[_0x2c67('0x38')][_0x2c67('0x3a')]?_0x1be52b['attributes']:_0x567408[_0x2c67('0x32')];if(!_0x58c379[_0x2c67('0x34')][_0x2c67('0x3b')]('nolimit')){_0x1be52b[_0x2c67('0x20')]=qs[_0x2c67('0x20')](_0x58c379['query'][_0x2c67('0x20')]);_0x1be52b[_0x2c67('0x22')]=qs[_0x2c67('0x22')](_0x58c379[_0x2c67('0x34')][_0x2c67('0x22')]);}_0x1be52b['order']=qs[_0x2c67('0x3c')](_0x58c379['query']['sort']);_0x1be52b[_0x2c67('0x3d')]=qs[_0x2c67('0x36')](_[_0x2c67('0x3e')](_0x58c379[_0x2c67('0x34')],_0x567408[_0x2c67('0x36')]),_0x26f4e3);if(_0x58c379[_0x2c67('0x34')][_0x2c67('0x3f')]){_0x1be52b['where']=_[_0x2c67('0x40')](_0x1be52b[_0x2c67('0x3d')],{'$or':_[_0x2c67('0x33')](_0x26f4e3,function(_0x108cf4){if(_0x108cf4['type']!==_0x2c67('0x41')){var _0x5b5d35={};_0x5b5d35[_0x108cf4[_0x2c67('0x2a')]]={'$like':'%'+_0x58c379['query'][_0x2c67('0x3f')]+'%'};return _0x5b5d35;}})});}_0x1be52b=_[_0x2c67('0x40')]({},_0x1be52b,_0x58c379['options']);var _0x51547f={'where':_0x1be52b[_0x2c67('0x3d')]};return db['Migration'][_0x2c67('0x21')](_0x51547f)['then'](function(_0x103212){_0x2df18f[_0x2c67('0x21')]=_0x103212;if(_0x58c379[_0x2c67('0x34')][_0x2c67('0x42')]){_0x1be52b[_0x2c67('0x43')]=[{'all':!![]}];}return db[_0x2c67('0x2d')][_0x2c67('0x44')](_0x1be52b);})[_0x2c67('0x27')](function(_0x2a7416){_0x2df18f[_0x2c67('0x45')]=_0x2a7416;return _0x2df18f;})[_0x2c67('0x27')](respondWithFilteredResult(_0x599cab,_0x1be52b))[_0x2c67('0x46')](handleError(_0x599cab,null));};
\ No newline at end of file
index 4eebd92..b65f289 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c29=['define','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5c29,0x86));var _0x95c2=function(_0x333985,_0x553f54){_0x333985=_0x333985-0x0;var _0x59091c=_0x5c29[_0x333985];return _0x59091c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x95c2('0x0'))('api');var moment=require(_0x95c2('0x1'));var BPromise=require('bluebird');var rp=require(_0x95c2('0x2'));var fs=require('fs');var path=require(_0x95c2('0x3'));var rimraf=require(_0x95c2('0x4'));var config=require(_0x95c2('0x5'));var attributes=require('./migration.attributes');module['exports']=function(_0x505865,_0x38bbe4){return _0x505865[_0x95c2('0x6')]('Migration',attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x03dc=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','Migration','migrations','util'];(function(_0x47b0d9,_0x41b561){var _0x599df3=function(_0x4c0c30){while(--_0x4c0c30){_0x47b0d9['push'](_0x47b0d9['shift']());}};_0x599df3(++_0x41b561);}(_0x03dc,0x13e));var _0xc03d=function(_0x58ee87,_0x479193){_0x58ee87=_0x58ee87-0x0;var _0x3ca144=_0x03dc[_0x58ee87];return _0x3ca144;};'use strict';var _=require('lodash');var util=require(_0xc03d('0x0'));var logger=require(_0xc03d('0x1'))(_0xc03d('0x2'));var moment=require(_0xc03d('0x3'));var BPromise=require('bluebird');var rp=require(_0xc03d('0x4'));var fs=require('fs');var path=require(_0xc03d('0x5'));var rimraf=require(_0xc03d('0x6'));var config=require(_0xc03d('0x7'));var attributes=require('./migration.attributes');module['exports']=function(_0x3adcd5,_0xfcb261){return _0x3adcd5[_0xc03d('0x8')](_0xc03d('0x9'),attributes,{'tableName':_0xc03d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ea2072f..3b7d2fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cfb=['debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Migration,\x20%s,\x20%s','request\x20sent'];(function(_0x2229e1,_0x70f308){var _0x2445a9=function(_0x36f467){while(--_0x36f467){_0x2229e1['push'](_0x2229e1['shift']());}};_0x2445a9(++_0x70f308);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x505d3c,_0x52c64b){_0x505d3c=_0x505d3c-0x0;var _0x23e0ac=_0x3cfb[_0x505d3c];return _0x23e0ac;};'use strict';var _=require(_0xb3cf('0x0'));var util=require(_0xb3cf('0x1'));var moment=require(_0xb3cf('0x2'));var BPromise=require(_0xb3cf('0x3'));var rs=require(_0xb3cf('0x4'));var fs=require('fs');var Redis=require(_0xb3cf('0x5'));var db=require(_0xb3cf('0x6'))['db'];var utils=require(_0xb3cf('0x7'));var logger=require('../../config/logger')(_0xb3cf('0x8'));var config=require(_0xb3cf('0x9'));var jayson=require(_0xb3cf('0xa'));var client=jayson['client'][_0xb3cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b7131,_0x42ce15,_0x53be8c){return new BPromise(function(_0x19ed7d,_0x4e4cc8){return client['request'](_0x1b7131,_0x53be8c)[_0xb3cf('0xc')](function(_0x44a55d){logger[_0xb3cf('0xd')](_0xb3cf('0xe'),_0x42ce15,_0xb3cf('0xf'));logger[_0xb3cf('0x10')](_0xb3cf('0x11'),_0x42ce15,_0xb3cf('0xf'),JSON[_0xb3cf('0x12')](_0x44a55d));if(_0x44a55d[_0xb3cf('0x13')]){if(_0x44a55d[_0xb3cf('0x13')][_0xb3cf('0x14')]===0x1f4){logger[_0xb3cf('0x13')](_0xb3cf('0xe'),_0x42ce15,_0x44a55d[_0xb3cf('0x13')]['message']);return _0x4e4cc8(_0x44a55d['error'][_0xb3cf('0x15')]);}logger[_0xb3cf('0x13')]('Migration,\x20%s,\x20%s',_0x42ce15,_0x44a55d[_0xb3cf('0x13')]['message']);return _0x19ed7d(_0x44a55d['error'][_0xb3cf('0x15')]);}else{logger[_0xb3cf('0xd')](_0xb3cf('0xe'),_0x42ce15,'request\x20sent');_0x19ed7d(_0x44a55d[_0xb3cf('0x16')][_0xb3cf('0x15')]);}})[_0xb3cf('0x17')](function(_0x442fd6){logger[_0xb3cf('0x13')](_0xb3cf('0xe'),_0x42ce15,_0x442fd6);_0x4e4cc8(_0x442fd6);});});}
\ No newline at end of file
+var _0xbf5c=['request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s'];(function(_0x3638d9,_0x3e1868){var _0x17dd0f=function(_0x58b69f){while(--_0x58b69f){_0x3638d9['push'](_0x3638d9['shift']());}};_0x17dd0f(++_0x3e1868);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x27158d,_0x19ed77){_0x27158d=_0x27158d-0x0;var _0xb8f43f=_0xbf5c[_0x27158d];return _0xb8f43f;};'use strict';var _=require(_0xcbf5('0x0'));var util=require(_0xcbf5('0x1'));var moment=require(_0xcbf5('0x2'));var BPromise=require('bluebird');var rs=require(_0xcbf5('0x3'));var fs=require('fs');var Redis=require(_0xcbf5('0x4'));var db=require(_0xcbf5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcbf5('0x6'))(_0xcbf5('0x7'));var config=require('../../config/environment');var jayson=require(_0xcbf5('0x8'));var client=jayson[_0xcbf5('0x9')][_0xcbf5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x522014,_0x4504dd,_0x31b6d1){return new BPromise(function(_0x54d2d4,_0x52f784){return client[_0xcbf5('0xb')](_0x522014,_0x31b6d1)[_0xcbf5('0xc')](function(_0x230a6c){logger['info'](_0xcbf5('0xd'),_0x4504dd,_0xcbf5('0xe'));logger[_0xcbf5('0xf')](_0xcbf5('0x10'),_0x4504dd,_0xcbf5('0xe'),JSON[_0xcbf5('0x11')](_0x230a6c));if(_0x230a6c['error']){if(_0x230a6c[_0xcbf5('0x12')][_0xcbf5('0x13')]===0x1f4){logger[_0xcbf5('0x12')]('Migration,\x20%s,\x20%s',_0x4504dd,_0x230a6c['error'][_0xcbf5('0x14')]);return _0x52f784(_0x230a6c['error'][_0xcbf5('0x14')]);}logger[_0xcbf5('0x12')](_0xcbf5('0xd'),_0x4504dd,_0x230a6c[_0xcbf5('0x12')]['message']);return _0x54d2d4(_0x230a6c['error'][_0xcbf5('0x14')]);}else{logger['info'](_0xcbf5('0xd'),_0x4504dd,'request\x20sent');_0x54d2d4(_0x230a6c['result'][_0xcbf5('0x14')]);}})[_0xcbf5('0x15')](function(_0x18753e){logger[_0xcbf5('0x12')](_0xcbf5('0xd'),_0x4504dd,_0x18753e);_0x52f784(_0x18753e);});});}
\ No newline at end of file
index d27c634..7d5931f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52a1=['show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./network.controller','get','isAuthenticated'];(function(_0x49e859,_0x257601){var _0x60bc66=function(_0xa7c5c7){while(--_0xa7c5c7){_0x49e859['push'](_0x49e859['shift']());}};_0x60bc66(++_0x257601);}(_0x52a1,0x1b7));var _0x152a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x52a1[_0x4565bf];return _0x5610ba;};'use strict';var multer=require(_0x152a('0x0'));var util=require(_0x152a('0x1'));var path=require(_0x152a('0x2'));var timeout=require(_0x152a('0x3'));var express=require(_0x152a('0x4'));var router=express[_0x152a('0x5')]();var fs_extra=require(_0x152a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x152a('0x7'));var config=require('../../config/environment');var controller=require(_0x152a('0x8'));router[_0x152a('0x9')]('/',auth[_0x152a('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x152a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x152a('0xc')]);router[_0x152a('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x152a('0xe')]);router[_0x152a('0xf')]('/:id',auth[_0x152a('0xa')](),controller[_0x152a('0x10')]);module[_0x152a('0x11')]=router;
\ No newline at end of file
+var _0xf1d4=['path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0xe8fd96,_0x16f429){var _0x2a0568=function(_0x581f60){while(--_0x581f60){_0xe8fd96['push'](_0xe8fd96['shift']());}};_0x2a0568(++_0x16f429);}(_0xf1d4,0x158));var _0x4f1d=function(_0x4a8226,_0x3dc1a5){_0x4a8226=_0x4a8226-0x0;var _0x1cbb1b=_0xf1d4[_0x4a8226];return _0x1cbb1b;};'use strict';var multer=require(_0x4f1d('0x0'));var util=require('util');var path=require(_0x4f1d('0x1'));var timeout=require('connect-timeout');var express=require(_0x4f1d('0x2'));var router=express[_0x4f1d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4f1d('0x4'));var interaction=require(_0x4f1d('0x5'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x4f1d('0x6')]('/',auth[_0x4f1d('0x7')](),controller['index']);router[_0x4f1d('0x6')](_0x4f1d('0x8'),auth[_0x4f1d('0x7')](),controller[_0x4f1d('0x9')]);router[_0x4f1d('0xa')]('/',auth[_0x4f1d('0x7')](),controller[_0x4f1d('0xb')]);router['put']('/:id',auth[_0x4f1d('0x7')](),controller['update']);router[_0x4f1d('0xc')](_0x4f1d('0x8'),auth['isAuthenticated'](),controller[_0x4f1d('0xd')]);module[_0x4f1d('0xe')]=router;
\ No newline at end of file
index ee1d4c8..cdf6848 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36f7=['externip','stun','turn','STRING','sequelize','exports','ENUM','localnet'];(function(_0x4fc333,_0x2e969b){var _0x376a8a=function(_0x12d129){while(--_0x12d129){_0x4fc333['push'](_0x4fc333['shift']());}};_0x376a8a(++_0x2e969b);}(_0x36f7,0xd4));var _0x736f=function(_0x421f4d,_0x25ebc1){_0x421f4d=_0x421f4d-0x0;var _0x32eced=_0x36f7[_0x421f4d];return _0x32eced;};'use strict';var Sequelize=require(_0x736f('0x0'));module[_0x736f('0x1')]={'type':{'type':Sequelize[_0x736f('0x2')](_0x736f('0x3'),_0x736f('0x4'),_0x736f('0x5'),_0x736f('0x6'))},'value':{'type':Sequelize[_0x736f('0x7')]},'username':{'type':Sequelize[_0x736f('0x7')]},'password':{'type':Sequelize[_0x736f('0x7')]}};
\ No newline at end of file
+var _0x968f=['STRING','sequelize','exports','localnet','stun','turn'];(function(_0xa89d9c,_0x375f83){var _0x2cfe5e=function(_0x29fe06){while(--_0x29fe06){_0xa89d9c['push'](_0xa89d9c['shift']());}};_0x2cfe5e(++_0x375f83);}(_0x968f,0x181));var _0xf968=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x968f[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xf968('0x0'));module[_0xf968('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf968('0x2'),'externip',_0xf968('0x3'),_0xf968('0x4'))},'value':{'type':Sequelize[_0xf968('0x5')]},'username':{'type':Sequelize[_0xf968('0x5')]},'password':{'type':Sequelize['STRING']}};
\ No newline at end of file
index a19a2f8..4b0acd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58a0=['status','end','json','offset','limit','count','Content-Range','apply','save','destroy','name','index','Network','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','filter','where','merge','options','includeAll','findAll','show','params','include','find','sequelize','transaction','create','body','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','TURN','readFileSync','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','server/files/templates/turn_multiple.ejs','format','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus'];(function(_0x50e25f,_0x49bec5){var _0x31eba0=function(_0x3513aa){while(--_0x3513aa){_0x50e25f['push'](_0x50e25f['shift']());}};_0x31eba0(++_0x49bec5);}(_0x58a0,0xa6));var _0x058a=function(_0x577acd,_0x2dddb2){_0x577acd=_0x577acd-0x0;var _0x2bfd74=_0x58a0[_0x577acd];return _0x2bfd74;};'use strict';var emlformat=require(_0x058a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x058a('0x1'));var moment=require(_0x058a('0x2'));var BPromise=require(_0x058a('0x3'));var Mustache=require(_0x058a('0x4'));var util=require(_0x058a('0x5'));var path=require(_0x058a('0x6'));var sox=require(_0x058a('0x7'));var csv=require(_0x058a('0x8'));var ejs=require(_0x058a('0x9'));var fs=require('fs');var fs_extra=require(_0x058a('0xa'));var _=require(_0x058a('0xb'));var squel=require(_0x058a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x058a('0x8'));var querystring=require(_0x058a('0xd'));var Papa=require(_0x058a('0xe'));var Redis=require(_0x058a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x058a('0x10'));var as=require(_0x058a('0x11'));var hardwareService=require(_0x058a('0x12'));var logger=require(_0x058a('0x13'))(_0x058a('0x14'));var utils=require(_0x058a('0x15'));var config=require(_0x058a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x058a('0x17'))['db'];var jayson=require(_0x058a('0x18'));var client=jayson[_0x058a('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x48a807,_0x1d141b,_0x5b13ec,_0x48fcff){return new BPromise(function(_0x55bb87,_0x2edf01){var _0x2e7a81=_0x48fcff||client;return _0x2e7a81[_0x058a('0x1a')](_0x48a807,_0x5b13ec)[_0x058a('0x1b')](function(_0x749fa9){logger[_0x058a('0x1c')](_0x058a('0x1d'),_0x1d141b,'request\x20sent');logger[_0x058a('0x1e')](_0x058a('0x1f'),_0x1d141b,'request\x20sent',JSON[_0x058a('0x20')](_0x749fa9));if(_0x749fa9[_0x058a('0x21')]){if(_0x749fa9[_0x058a('0x21')][_0x058a('0x22')]===0x1f4){logger[_0x058a('0x21')](_0x058a('0x1d'),_0x1d141b,_0x749fa9[_0x058a('0x21')][_0x058a('0x23')]);return _0x2edf01(_0x749fa9[_0x058a('0x21')][_0x058a('0x23')]);}logger[_0x058a('0x21')](_0x058a('0x1d'),_0x1d141b,_0x749fa9['error'][_0x058a('0x23')]);return _0x55bb87(_0x749fa9[_0x058a('0x21')]['message']);}else{logger[_0x058a('0x1c')](_0x058a('0x1d'),_0x1d141b,_0x058a('0x24'));_0x55bb87(_0x749fa9[_0x058a('0x25')][_0x058a('0x23')]);}})[_0x058a('0x26')](function(_0x2dbf8e){logger[_0x058a('0x21')](_0x058a('0x1d'),_0x1d141b,_0x2dbf8e);_0x2edf01(_0x2dbf8e);});});}function respondWithStatusCode(_0x162613,_0x2a1d3e){_0x2a1d3e=_0x2a1d3e||0xcc;return function(_0x37c48a){if(_0x37c48a){return _0x162613[_0x058a('0x27')](_0x2a1d3e);}return _0x162613[_0x058a('0x28')](_0x2a1d3e)[_0x058a('0x29')]();};}function respondWithResult(_0x256dff,_0x595cf0){_0x595cf0=_0x595cf0||0xc8;return function(_0x3860b4){if(_0x3860b4){return _0x256dff['status'](_0x595cf0)[_0x058a('0x2a')](_0x3860b4);}};}function respondWithFilteredResult(_0x2cb515,_0x3dea05){return function(_0x38cc5f){if(_0x38cc5f){var _0x3366ad=typeof _0x3dea05[_0x058a('0x2b')]==='undefined'&&typeof _0x3dea05[_0x058a('0x2c')]==='undefined';var _0x5849d1=_0x38cc5f[_0x058a('0x2d')];var _0x5f21e8=_0x3366ad?0x0:_0x3dea05['offset'];var _0x40bf9d=_0x3366ad?_0x38cc5f[_0x058a('0x2d')]:_0x3dea05[_0x058a('0x2b')]+_0x3dea05[_0x058a('0x2c')];var _0x1bbd12;if(_0x40bf9d>=_0x5849d1){_0x40bf9d=_0x5849d1;_0x1bbd12=0xc8;}else{_0x1bbd12=0xce;}_0x2cb515[_0x058a('0x28')](_0x1bbd12);return _0x2cb515['set'](_0x058a('0x2e'),_0x5f21e8+'-'+_0x40bf9d+'/'+_0x5849d1)[_0x058a('0x2a')](_0x38cc5f);}return null;};}function patchUpdates(_0x2084de){return function(_0xcb631f){try{jsonpatch[_0x058a('0x2f')](_0xcb631f,_0x2084de,!![]);}catch(_0x553d4e){return BPromise['reject'](_0x553d4e);}return _0xcb631f[_0x058a('0x30')]();};}function saveUpdates(_0x53b1db,_0x15149b){return function(_0x2a0459){if(_0x2a0459){return _0x2a0459['update'](_0x53b1db)[_0x058a('0x1b')](function(_0x777a7b){return _0x777a7b;});}return null;};}function removeEntity(_0x4faa21,_0x544a92){return function(_0x5afefa){if(_0x5afefa){return _0x5afefa[_0x058a('0x31')]()[_0x058a('0x1b')](function(){_0x4faa21[_0x058a('0x28')](0xcc)[_0x058a('0x29')]();});}};}function handleEntityNotFound(_0x2ce2e2,_0x1516c8){return function(_0x22981a){if(!_0x22981a){_0x2ce2e2['sendStatus'](0x194);}return _0x22981a;};}function handleError(_0x2fb049,_0x4e59b5){_0x4e59b5=_0x4e59b5||0x1f4;return function(_0x4228cd){logger['error'](_0x4228cd['stack']);if(_0x4228cd['name']){delete _0x4228cd[_0x058a('0x32')];}_0x2fb049[_0x058a('0x28')](_0x4e59b5)['send'](_0x4228cd);};}exports[_0x058a('0x33')]=function(_0x32f628,_0x16150a){var _0x5182e7={},_0x1d0745={},_0x1a2a5b={'count':0x0,'rows':[]};var _0x17b9cd=_['map'](db[_0x058a('0x34')][_0x058a('0x35')],function(_0x41f986){return{'name':_0x41f986['fieldName'],'type':_0x41f986[_0x058a('0x36')][_0x058a('0x37')]};});_0x1d0745['model']=_[_0x058a('0x38')](_0x17b9cd,'name');_0x1d0745[_0x058a('0x39')]=_[_0x058a('0x3a')](_0x32f628[_0x058a('0x39')]);_0x1d0745[_0x058a('0x3b')]=_[_0x058a('0x3c')](_0x1d0745[_0x058a('0x3d')],_0x1d0745['query']);_0x5182e7[_0x058a('0x3e')]=_[_0x058a('0x3c')](_0x1d0745[_0x058a('0x3d')],qs[_0x058a('0x3f')](_0x32f628['query'][_0x058a('0x3f')]));_0x5182e7[_0x058a('0x3e')]=_0x5182e7['attributes'][_0x058a('0x40')]?_0x5182e7['attributes']:_0x1d0745[_0x058a('0x3d')];if(!_0x32f628[_0x058a('0x39')]['hasOwnProperty'](_0x058a('0x41'))){_0x5182e7['limit']=qs['limit'](_0x32f628[_0x058a('0x39')][_0x058a('0x2c')]);_0x5182e7[_0x058a('0x2b')]=qs[_0x058a('0x2b')](_0x32f628[_0x058a('0x39')][_0x058a('0x2b')]);}_0x5182e7['order']=qs[_0x058a('0x42')](_0x32f628[_0x058a('0x39')][_0x058a('0x42')]);_0x5182e7['where']=qs[_0x058a('0x3b')](_[_0x058a('0x43')](_0x32f628[_0x058a('0x39')],_0x1d0745[_0x058a('0x3b')]),_0x17b9cd);if(_0x32f628[_0x058a('0x39')][_0x058a('0x44')]){_0x5182e7[_0x058a('0x45')]=_['merge'](_0x5182e7[_0x058a('0x45')],{'$or':_[_0x058a('0x38')](_0x17b9cd,function(_0x1b3751){if(_0x1b3751[_0x058a('0x36')]!=='VIRTUAL'){var _0x27f120={};_0x27f120[_0x1b3751[_0x058a('0x32')]]={'$like':'%'+_0x32f628[_0x058a('0x39')][_0x058a('0x44')]+'%'};return _0x27f120;}})});}_0x5182e7=_[_0x058a('0x46')]({},_0x5182e7,_0x32f628[_0x058a('0x47')]);var _0x3f8314={'where':_0x5182e7[_0x058a('0x45')]};return db[_0x058a('0x34')]['count'](_0x3f8314)[_0x058a('0x1b')](function(_0x56dc98){_0x1a2a5b[_0x058a('0x2d')]=_0x56dc98;if(_0x32f628[_0x058a('0x39')][_0x058a('0x48')]){_0x5182e7['include']=[{'all':!![]}];}return db[_0x058a('0x34')][_0x058a('0x49')](_0x5182e7);})['then'](function(_0x4a560d){_0x1a2a5b['rows']=_0x4a560d;return _0x1a2a5b;})['then'](respondWithFilteredResult(_0x16150a,_0x5182e7))[_0x058a('0x26')](handleError(_0x16150a,null));};exports[_0x058a('0x4a')]=function(_0x280fd5,_0x1f2127){var _0x5ce2ec={'raw':!![],'where':{'id':_0x280fd5[_0x058a('0x4b')]['id']}},_0x321a59={};_0x321a59['model']=_[_0x058a('0x3a')](db[_0x058a('0x34')][_0x058a('0x35')]);_0x321a59['query']=_[_0x058a('0x3a')](_0x280fd5[_0x058a('0x39')]);_0x321a59['filters']=_[_0x058a('0x3c')](_0x321a59[_0x058a('0x3d')],_0x321a59[_0x058a('0x39')]);_0x5ce2ec[_0x058a('0x3e')]=_[_0x058a('0x3c')](_0x321a59[_0x058a('0x3d')],qs['fields'](_0x280fd5[_0x058a('0x39')][_0x058a('0x3f')]));_0x5ce2ec[_0x058a('0x3e')]=_0x5ce2ec[_0x058a('0x3e')][_0x058a('0x40')]?_0x5ce2ec[_0x058a('0x3e')]:_0x321a59[_0x058a('0x3d')];if(_0x280fd5[_0x058a('0x39')][_0x058a('0x48')]){_0x5ce2ec[_0x058a('0x4c')]=[{'all':!![]}];}_0x5ce2ec=_[_0x058a('0x46')]({},_0x5ce2ec,_0x280fd5[_0x058a('0x47')]);return db[_0x058a('0x34')][_0x058a('0x4d')](_0x5ce2ec)[_0x058a('0x1b')](handleEntityNotFound(_0x1f2127,null))[_0x058a('0x1b')](respondWithResult(_0x1f2127,null))[_0x058a('0x26')](handleError(_0x1f2127,null));};exports['create']=function(_0x15b2a5,_0x543050,_0x583bd6){var _0x398507;return db[_0x058a('0x4e')][_0x058a('0x4f')](function(_0x26f845){return db[_0x058a('0x34')][_0x058a('0x50')](_0x15b2a5[_0x058a('0x51')],{'raw':!![]})[_0x058a('0x1b')](function(_0x453dd3){_0x398507=_0x453dd3;return db[_0x058a('0x34')][_0x058a('0x49')]({'where':{'type':_0x15b2a5[_0x058a('0x51')][_0x058a('0x36')]},'raw':!![]});})[_0x058a('0x1b')](function(_0x545f0f){if(_0x398507['type'][_0x058a('0x52')]()==_0x058a('0x53')){var _0x53bbfe=fs['readFileSync'](path[_0x058a('0x54')](config[_0x058a('0x55')],_0x058a('0x56')),_0x058a('0x57'));var _0x2ac2ef=ejs[_0x058a('0x58')](_0x53bbfe,{'networks':_0x545f0f||[]});fs['writeFileSync'](_0x058a('0x59'),_0x2ac2ef);return respondWithRpcPromise(_0x058a('0x5a'),_0x058a('0x50'),{'module':'res_stun_monitor.so'});}else if(_0x398507['type']['toUpperCase']()==_0x058a('0x5b')){var _0x1308dd=fs[_0x058a('0x5c')](path[_0x058a('0x54')](config[_0x058a('0x55')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x432106=ejs[_0x058a('0x58')](_0x1308dd,{'networks':_0x545f0f||[]});fs[_0x058a('0x5d')](_0x058a('0x5e'),_0x432106);return respondWithRpcPromise('Reload','create',{'module':_0x058a('0x5f')});}else{var _0x5b5623=fs[_0x058a('0x5c')](path[_0x058a('0x54')](config[_0x058a('0x55')],_0x058a('0x60')),_0x058a('0x57'));var _0x116c2a=ejs[_0x058a('0x58')](_0x5b5623,{'networks':_0x545f0f||[]});fs[_0x058a('0x5d')](util['format'](_0x058a('0x61'),_0x15b2a5['body'][_0x058a('0x36')][_0x058a('0x62')]()),_0x116c2a);return respondWithRpcPromise('Reload',_0x058a('0x50'),{'module':_0x058a('0x63')});}return null;})['then'](function(){return _0x398507;});})['then'](respondWithResult(_0x543050,0xc9))[_0x058a('0x26')](handleError(_0x543050,null));};exports[_0x058a('0x64')]=function(_0x2a9460,_0x350c76,_0x2ed76c){var _0x2117ee;return db[_0x058a('0x4e')][_0x058a('0x4f')](function(_0x5be431){return db[_0x058a('0x34')][_0x058a('0x4d')]({'where':{'id':_0x2a9460[_0x058a('0x4b')]['id']}})[_0x058a('0x1b')](handleEntityNotFound(_0x350c76,null))[_0x058a('0x1b')](saveUpdates(_0x2a9460[_0x058a('0x51')],null))[_0x058a('0x1b')](function(_0x49db33){if(_0x49db33){_0x2117ee=_0x49db33;return db[_0x058a('0x34')]['findAll']({'where':{'type':_0x2117ee[_0x058a('0x36')]},'raw':!![]});}return null;})['then'](function(_0x1daf29){if(_0x2117ee[_0x058a('0x36')][_0x058a('0x52')]()==_0x058a('0x53')){var _0x210db6=fs[_0x058a('0x5c')](path[_0x058a('0x54')](config[_0x058a('0x55')],_0x058a('0x56')),_0x058a('0x57'));var _0x14c71f=ejs['render'](_0x210db6,{'networks':_0x1daf29||[]});fs[_0x058a('0x5d')]('/etc/asterisk/stun_xcally.conf',_0x14c71f);return respondWithRpcPromise(_0x058a('0x5a'),_0x058a('0x64'),{'module':_0x058a('0x5f')});}else if(_0x2117ee[_0x058a('0x36')][_0x058a('0x52')]()==_0x058a('0x5b')){var _0x25a354=fs[_0x058a('0x5c')](path['join'](config[_0x058a('0x55')],_0x058a('0x65')),_0x058a('0x57'));var _0x3775ef=ejs[_0x058a('0x58')](_0x25a354,{'networks':_0x1daf29||[]});fs[_0x058a('0x5d')](_0x058a('0x5e'),_0x3775ef);return respondWithRpcPromise(_0x058a('0x5a'),_0x058a('0x64'),{'module':'res_stun_monitor.so'});}else{var _0xd375b3=fs[_0x058a('0x5c')](path[_0x058a('0x54')](config[_0x058a('0x55')],_0x058a('0x60')),_0x058a('0x57'));var _0x57f06f=ejs[_0x058a('0x58')](_0xd375b3,{'networks':_0x1daf29||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x2a9460[_0x058a('0x51')][_0x058a('0x36')][_0x058a('0x62')]()),_0x57f06f);return respondWithRpcPromise('Reload','update',{'module':'chan_sip.so'});}return null;})[_0x058a('0x1b')](function(_0x97b6e7){if(_0x97b6e7){return _0x2117ee;}return null;});})['then'](respondWithResult(_0x350c76,null))[_0x058a('0x26')](handleError(_0x350c76,null));};exports['destroy']=function(_0x17d4e0,_0x349dde,_0x4c1244){var _0xb298c;return db[_0x058a('0x34')][_0x058a('0x4d')]({'where':{'id':_0x17d4e0[_0x058a('0x4b')]['id']}})[_0x058a('0x1b')](function(_0x32f612){_0xb298c=_0x32f612;return _0x32f612;})[_0x058a('0x1b')](handleEntityNotFound(_0x349dde,null))['then'](removeEntity(_0x349dde,null))[_0x058a('0x1b')](function(){if(_0xb298c){return db[_0x058a('0x34')][_0x058a('0x49')]({'where':{'type':_0xb298c[_0x058a('0x36')]},'raw':!![]});}})[_0x058a('0x1b')](function(_0x1fbc54){if(_0xb298c[_0x058a('0x36')][_0x058a('0x52')]()==_0x058a('0x53')){var _0x3889de=fs['readFileSync'](path[_0x058a('0x54')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x058a('0x57'));var _0x3b715d=ejs[_0x058a('0x58')](_0x3889de,{'networks':_0x1fbc54||[]});fs[_0x058a('0x5d')](_0x058a('0x59'),_0x3b715d);return respondWithRpcPromise('Reload',_0x058a('0x31'),{'module':_0x058a('0x5f')});}else if(_0xb298c['type'][_0x058a('0x52')]()==_0x058a('0x5b')){var _0x537906=fs[_0x058a('0x5c')](path['join'](config['root'],_0x058a('0x65')),'utf8');var _0x26a5bb=ejs['render'](_0x537906,{'networks':_0x1fbc54||[]});fs[_0x058a('0x5d')](_0x058a('0x5e'),_0x26a5bb);return respondWithRpcPromise('Reload',_0x058a('0x31'),{'module':_0x058a('0x5f')});}else{var _0x50939a=fs[_0x058a('0x5c')](path[_0x058a('0x54')](config[_0x058a('0x55')],'server/files/templates/network.ejs'),_0x058a('0x57'));var _0x193ab8=ejs[_0x058a('0x58')](_0x50939a,{'networks':_0x1fbc54||[]});fs[_0x058a('0x5d')](util[_0x058a('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x17d4e0[_0x058a('0x51')][_0x058a('0x36')]['toLowerCase']()),_0x193ab8);return respondWithRpcPromise(_0x058a('0x5a'),'destroy',{'module':_0x058a('0x63')});}return null;})['catch'](handleError(_0x349dde,null));};
\ No newline at end of file
+var _0x521a=['json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','stack','send','index','map','Network','fieldName','type','key','model','name','query','filters','attributes','intersection','length','nolimit','order','sort','where','pick','options','include','findAll','rows','catch','show','keys','rawAttributes','fields','includeAll','merge','create','transaction','toUpperCase','STUN','join','server/files/templates/stun_multiple.ejs','render','Reload','res_stun_monitor.so','TURN','readFileSync','root','server/files/templates/turn_multiple.ejs','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','body','toLowerCase','chan_sip.so','sequelize','find','params','/etc/asterisk/stun_xcally.conf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','error','message','result','status','end'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x521a,0x184));var _0xa521=function(_0x39004d,_0x36de7d){_0x39004d=_0x39004d-0x0;var _0x569966=_0x521a[_0x39004d];return _0x569966;};'use strict';var emlformat=require(_0xa521('0x0'));var rimraf=require(_0xa521('0x1'));var zipdir=require(_0xa521('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa521('0x3'));var moment=require(_0xa521('0x4'));var BPromise=require(_0xa521('0x5'));var Mustache=require(_0xa521('0x6'));var util=require(_0xa521('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa521('0x8'));var fs=require('fs');var fs_extra=require(_0xa521('0x9'));var _=require(_0xa521('0xa'));var squel=require(_0xa521('0xb'));var crypto=require(_0xa521('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa521('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa521('0xe'));var Papa=require(_0xa521('0xf'));var Redis=require(_0xa521('0x10'));var authService=require(_0xa521('0x11'));var qs=require(_0xa521('0x12'));var as=require(_0xa521('0x13'));var hardwareService=require(_0xa521('0x14'));var logger=require(_0xa521('0x15'))(_0xa521('0x16'));var utils=require(_0xa521('0x17'));var config=require(_0xa521('0x18'));var licenseUtil=require(_0xa521('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa521('0x1a'));var client=jayson[_0xa521('0x1b')][_0xa521('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5b4f14,_0x4d7003,_0x1300d4,_0x48ea53){return new BPromise(function(_0x9537a3,_0x1ff4a8){var _0x2f0ccb=_0x48ea53||client;return _0x2f0ccb[_0xa521('0x1d')](_0x5b4f14,_0x1300d4)[_0xa521('0x1e')](function(_0x2683d7){logger[_0xa521('0x1f')](_0xa521('0x20'),_0x4d7003,_0xa521('0x21'));logger['debug'](_0xa521('0x22'),_0x4d7003,_0xa521('0x21'),JSON['stringify'](_0x2683d7));if(_0x2683d7[_0xa521('0x23')]){if(_0x2683d7[_0xa521('0x23')]['code']===0x1f4){logger['error'](_0xa521('0x20'),_0x4d7003,_0x2683d7['error'][_0xa521('0x24')]);return _0x1ff4a8(_0x2683d7['error']['message']);}logger[_0xa521('0x23')](_0xa521('0x20'),_0x4d7003,_0x2683d7[_0xa521('0x23')][_0xa521('0x24')]);return _0x9537a3(_0x2683d7[_0xa521('0x23')][_0xa521('0x24')]);}else{logger[_0xa521('0x1f')](_0xa521('0x20'),_0x4d7003,'request\x20sent');_0x9537a3(_0x2683d7[_0xa521('0x25')][_0xa521('0x24')]);}})['catch'](function(_0x2c13a8){logger[_0xa521('0x23')](_0xa521('0x20'),_0x4d7003,_0x2c13a8);_0x1ff4a8(_0x2c13a8);});});}function respondWithStatusCode(_0x28b6b7,_0x3b08cf){_0x3b08cf=_0x3b08cf||0xcc;return function(_0x22d475){if(_0x22d475){return _0x28b6b7['sendStatus'](_0x3b08cf);}return _0x28b6b7[_0xa521('0x26')](_0x3b08cf)[_0xa521('0x27')]();};}function respondWithResult(_0x45098f,_0x3507cc){_0x3507cc=_0x3507cc||0xc8;return function(_0x4ae9fa){if(_0x4ae9fa){return _0x45098f[_0xa521('0x26')](_0x3507cc)[_0xa521('0x28')](_0x4ae9fa);}};}function respondWithFilteredResult(_0x468182,_0x55b993){return function(_0x1087ef){if(_0x1087ef){var _0xc24686=typeof _0x55b993[_0xa521('0x29')]===_0xa521('0x2a')&&typeof _0x55b993[_0xa521('0x2b')]===_0xa521('0x2a');var _0x48f434=_0x1087ef[_0xa521('0x2c')];var _0x36f9ef=_0xc24686?0x0:_0x55b993[_0xa521('0x29')];var _0x30ea3e=_0xc24686?_0x1087ef['count']:_0x55b993['offset']+_0x55b993['limit'];var _0x138c9c;if(_0x30ea3e>=_0x48f434){_0x30ea3e=_0x48f434;_0x138c9c=0xc8;}else{_0x138c9c=0xce;}_0x468182[_0xa521('0x26')](_0x138c9c);return _0x468182['set'](_0xa521('0x2d'),_0x36f9ef+'-'+_0x30ea3e+'/'+_0x48f434)[_0xa521('0x28')](_0x1087ef);}return null;};}function patchUpdates(_0x277df6){return function(_0xf8c2de){try{jsonpatch[_0xa521('0x2e')](_0xf8c2de,_0x277df6,!![]);}catch(_0xf55e89){return BPromise['reject'](_0xf55e89);}return _0xf8c2de[_0xa521('0x2f')]();};}function saveUpdates(_0x4b3f56,_0x2d145f){return function(_0x56b1a4){if(_0x56b1a4){return _0x56b1a4[_0xa521('0x30')](_0x4b3f56)[_0xa521('0x1e')](function(_0x11dfdc){return _0x11dfdc;});}return null;};}function removeEntity(_0x3cb9af,_0xe7eb07){return function(_0x5c7a11){if(_0x5c7a11){return _0x5c7a11[_0xa521('0x31')]()[_0xa521('0x1e')](function(){_0x3cb9af[_0xa521('0x26')](0xcc)[_0xa521('0x27')]();});}};}function handleEntityNotFound(_0x32bd91,_0x2d6b49){return function(_0x5cacc4){if(!_0x5cacc4){_0x32bd91['sendStatus'](0x194);}return _0x5cacc4;};}function handleError(_0x29ed30,_0x1fd9ed){_0x1fd9ed=_0x1fd9ed||0x1f4;return function(_0x59ac41){logger[_0xa521('0x23')](_0x59ac41[_0xa521('0x32')]);if(_0x59ac41['name']){delete _0x59ac41['name'];}_0x29ed30[_0xa521('0x26')](_0x1fd9ed)[_0xa521('0x33')](_0x59ac41);};}exports[_0xa521('0x34')]=function(_0x352d60,_0x160de0){var _0x2638ff={},_0x2b9c3b={},_0x1fb063={'count':0x0,'rows':[]};var _0xfe36af=_[_0xa521('0x35')](db[_0xa521('0x36')]['rawAttributes'],function(_0x373019){return{'name':_0x373019[_0xa521('0x37')],'type':_0x373019[_0xa521('0x38')][_0xa521('0x39')]};});_0x2b9c3b[_0xa521('0x3a')]=_[_0xa521('0x35')](_0xfe36af,_0xa521('0x3b'));_0x2b9c3b[_0xa521('0x3c')]=_['keys'](_0x352d60['query']);_0x2b9c3b[_0xa521('0x3d')]=_['intersection'](_0x2b9c3b[_0xa521('0x3a')],_0x2b9c3b[_0xa521('0x3c')]);_0x2638ff[_0xa521('0x3e')]=_[_0xa521('0x3f')](_0x2b9c3b['model'],qs['fields'](_0x352d60[_0xa521('0x3c')]['fields']));_0x2638ff[_0xa521('0x3e')]=_0x2638ff['attributes'][_0xa521('0x40')]?_0x2638ff[_0xa521('0x3e')]:_0x2b9c3b[_0xa521('0x3a')];if(!_0x352d60['query']['hasOwnProperty'](_0xa521('0x41'))){_0x2638ff[_0xa521('0x2b')]=qs['limit'](_0x352d60[_0xa521('0x3c')][_0xa521('0x2b')]);_0x2638ff[_0xa521('0x29')]=qs[_0xa521('0x29')](_0x352d60['query'][_0xa521('0x29')]);}_0x2638ff[_0xa521('0x42')]=qs[_0xa521('0x43')](_0x352d60['query'][_0xa521('0x43')]);_0x2638ff[_0xa521('0x44')]=qs['filters'](_[_0xa521('0x45')](_0x352d60[_0xa521('0x3c')],_0x2b9c3b[_0xa521('0x3d')]),_0xfe36af);if(_0x352d60[_0xa521('0x3c')]['filter']){_0x2638ff[_0xa521('0x44')]=_['merge'](_0x2638ff[_0xa521('0x44')],{'$or':_['map'](_0xfe36af,function(_0x17a220){if(_0x17a220[_0xa521('0x38')]!=='VIRTUAL'){var _0x26d1e9={};_0x26d1e9[_0x17a220[_0xa521('0x3b')]]={'$like':'%'+_0x352d60[_0xa521('0x3c')]['filter']+'%'};return _0x26d1e9;}})});}_0x2638ff=_['merge']({},_0x2638ff,_0x352d60[_0xa521('0x46')]);var _0x3e6684={'where':_0x2638ff[_0xa521('0x44')]};return db[_0xa521('0x36')]['count'](_0x3e6684)[_0xa521('0x1e')](function(_0x1bee15){_0x1fb063[_0xa521('0x2c')]=_0x1bee15;if(_0x352d60[_0xa521('0x3c')]['includeAll']){_0x2638ff[_0xa521('0x47')]=[{'all':!![]}];}return db[_0xa521('0x36')][_0xa521('0x48')](_0x2638ff);})[_0xa521('0x1e')](function(_0x23077e){_0x1fb063[_0xa521('0x49')]=_0x23077e;return _0x1fb063;})[_0xa521('0x1e')](respondWithFilteredResult(_0x160de0,_0x2638ff))[_0xa521('0x4a')](handleError(_0x160de0,null));};exports[_0xa521('0x4b')]=function(_0x281215,_0x58ef7f){var _0x4cb8d1={'raw':!![],'where':{'id':_0x281215['params']['id']}},_0x1eb5e0={};_0x1eb5e0[_0xa521('0x3a')]=_[_0xa521('0x4c')](db['Network'][_0xa521('0x4d')]);_0x1eb5e0[_0xa521('0x3c')]=_[_0xa521('0x4c')](_0x281215[_0xa521('0x3c')]);_0x1eb5e0[_0xa521('0x3d')]=_[_0xa521('0x3f')](_0x1eb5e0[_0xa521('0x3a')],_0x1eb5e0[_0xa521('0x3c')]);_0x4cb8d1[_0xa521('0x3e')]=_[_0xa521('0x3f')](_0x1eb5e0['model'],qs[_0xa521('0x4e')](_0x281215[_0xa521('0x3c')]['fields']));_0x4cb8d1[_0xa521('0x3e')]=_0x4cb8d1[_0xa521('0x3e')]['length']?_0x4cb8d1[_0xa521('0x3e')]:_0x1eb5e0[_0xa521('0x3a')];if(_0x281215[_0xa521('0x3c')][_0xa521('0x4f')]){_0x4cb8d1[_0xa521('0x47')]=[{'all':!![]}];}_0x4cb8d1=_[_0xa521('0x50')]({},_0x4cb8d1,_0x281215[_0xa521('0x46')]);return db[_0xa521('0x36')]['find'](_0x4cb8d1)['then'](handleEntityNotFound(_0x58ef7f,null))[_0xa521('0x1e')](respondWithResult(_0x58ef7f,null))[_0xa521('0x4a')](handleError(_0x58ef7f,null));};exports[_0xa521('0x51')]=function(_0x36d00c,_0xc6134e,_0x4ac93d){var _0x4407a8;return db['sequelize'][_0xa521('0x52')](function(_0x374a7e){return db[_0xa521('0x36')][_0xa521('0x51')](_0x36d00c['body'],{'raw':!![]})[_0xa521('0x1e')](function(_0x131663){_0x4407a8=_0x131663;return db[_0xa521('0x36')][_0xa521('0x48')]({'where':{'type':_0x36d00c['body'][_0xa521('0x38')]},'raw':!![]});})[_0xa521('0x1e')](function(_0x21d78e){if(_0x4407a8[_0xa521('0x38')][_0xa521('0x53')]()==_0xa521('0x54')){var _0x2bfc6c=fs['readFileSync'](path[_0xa521('0x55')](config['root'],_0xa521('0x56')),'utf8');var _0x572257=ejs[_0xa521('0x57')](_0x2bfc6c,{'networks':_0x21d78e||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x572257);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x51'),{'module':_0xa521('0x59')});}else if(_0x4407a8[_0xa521('0x38')][_0xa521('0x53')]()==_0xa521('0x5a')){var _0x247193=fs[_0xa521('0x5b')](path[_0xa521('0x55')](config[_0xa521('0x5c')],_0xa521('0x5d')),_0xa521('0x5e'));var _0x5b16aa=ejs['render'](_0x247193,{'networks':_0x21d78e||[]});fs[_0xa521('0x5f')](_0xa521('0x60'),_0x5b16aa);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x51'),{'module':_0xa521('0x59')});}else{var _0x49a47b=fs[_0xa521('0x5b')](path[_0xa521('0x55')](config['root'],_0xa521('0x61')),_0xa521('0x5e'));var _0x46d4e4=ejs[_0xa521('0x57')](_0x49a47b,{'networks':_0x21d78e||[]});fs[_0xa521('0x5f')](util[_0xa521('0x62')](_0xa521('0x63'),_0x36d00c[_0xa521('0x64')]['type'][_0xa521('0x65')]()),_0x46d4e4);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x51'),{'module':_0xa521('0x66')});}return null;})[_0xa521('0x1e')](function(){return _0x4407a8;});})[_0xa521('0x1e')](respondWithResult(_0xc6134e,0xc9))[_0xa521('0x4a')](handleError(_0xc6134e,null));};exports['update']=function(_0x46f9fe,_0x1b186a,_0x165650){var _0x5d9943;return db[_0xa521('0x67')][_0xa521('0x52')](function(_0x53c2a0){return db[_0xa521('0x36')][_0xa521('0x68')]({'where':{'id':_0x46f9fe[_0xa521('0x69')]['id']}})[_0xa521('0x1e')](handleEntityNotFound(_0x1b186a,null))[_0xa521('0x1e')](saveUpdates(_0x46f9fe[_0xa521('0x64')],null))['then'](function(_0x3966e7){if(_0x3966e7){_0x5d9943=_0x3966e7;return db[_0xa521('0x36')]['findAll']({'where':{'type':_0x5d9943['type']},'raw':!![]});}return null;})[_0xa521('0x1e')](function(_0x47dc63){if(_0x5d9943[_0xa521('0x38')][_0xa521('0x53')]()==_0xa521('0x54')){var _0x29c9dc=fs[_0xa521('0x5b')](path[_0xa521('0x55')](config[_0xa521('0x5c')],_0xa521('0x56')),_0xa521('0x5e'));var _0x5a5978=ejs[_0xa521('0x57')](_0x29c9dc,{'networks':_0x47dc63||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x5a5978);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x30'),{'module':_0xa521('0x59')});}else if(_0x5d9943[_0xa521('0x38')][_0xa521('0x53')]()==_0xa521('0x5a')){var _0x330b8f=fs['readFileSync'](path[_0xa521('0x55')](config[_0xa521('0x5c')],_0xa521('0x5d')),_0xa521('0x5e'));var _0xe76ae=ejs['render'](_0x330b8f,{'networks':_0x47dc63||[]});fs[_0xa521('0x5f')](_0xa521('0x60'),_0xe76ae);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x30'),{'module':_0xa521('0x59')});}else{var _0x539231=fs[_0xa521('0x5b')](path['join'](config['root'],'server/files/templates/network.ejs'),'utf8');var _0x12f749=ejs[_0xa521('0x57')](_0x539231,{'networks':_0x47dc63||[]});fs[_0xa521('0x5f')](util[_0xa521('0x62')](_0xa521('0x63'),_0x46f9fe[_0xa521('0x64')][_0xa521('0x38')][_0xa521('0x65')]()),_0x12f749);return respondWithRpcPromise(_0xa521('0x58'),'update',{'module':_0xa521('0x66')});}return null;})['then'](function(_0x188466){if(_0x188466){return _0x5d9943;}return null;});})['then'](respondWithResult(_0x1b186a,null))[_0xa521('0x4a')](handleError(_0x1b186a,null));};exports[_0xa521('0x31')]=function(_0xca72b,_0x1d20c0,_0x25ec21){var _0x2d084c;return db[_0xa521('0x36')][_0xa521('0x68')]({'where':{'id':_0xca72b[_0xa521('0x69')]['id']}})[_0xa521('0x1e')](function(_0x3700ba){_0x2d084c=_0x3700ba;return _0x3700ba;})[_0xa521('0x1e')](handleEntityNotFound(_0x1d20c0,null))[_0xa521('0x1e')](removeEntity(_0x1d20c0,null))['then'](function(){if(_0x2d084c){return db['Network'][_0xa521('0x48')]({'where':{'type':_0x2d084c[_0xa521('0x38')]},'raw':!![]});}})[_0xa521('0x1e')](function(_0x22290c){if(_0x2d084c['type']['toUpperCase']()==_0xa521('0x54')){var _0x163401=fs[_0xa521('0x5b')](path['join'](config[_0xa521('0x5c')],_0xa521('0x56')),_0xa521('0x5e'));var _0x457efc=ejs[_0xa521('0x57')](_0x163401,{'networks':_0x22290c||[]});fs[_0xa521('0x5f')](_0xa521('0x6a'),_0x457efc);return respondWithRpcPromise(_0xa521('0x58'),'destroy',{'module':_0xa521('0x59')});}else if(_0x2d084c[_0xa521('0x38')]['toUpperCase']()=='TURN'){var _0x5822e7=fs['readFileSync'](path[_0xa521('0x55')](config[_0xa521('0x5c')],_0xa521('0x5d')),_0xa521('0x5e'));var _0x3b36da=ejs['render'](_0x5822e7,{'networks':_0x22290c||[]});fs['writeFileSync'](_0xa521('0x60'),_0x3b36da);return respondWithRpcPromise(_0xa521('0x58'),'destroy',{'module':_0xa521('0x59')});}else{var _0x14230d=fs['readFileSync'](path[_0xa521('0x55')](config[_0xa521('0x5c')],'server/files/templates/network.ejs'),'utf8');var _0x50dc27=ejs[_0xa521('0x57')](_0x14230d,{'networks':_0x22290c||[]});fs['writeFileSync'](util['format'](_0xa521('0x63'),_0xca72b[_0xa521('0x64')]['type'][_0xa521('0x65')]()),_0x50dc27);return respondWithRpcPromise(_0xa521('0x58'),_0xa521('0x31'),{'module':_0xa521('0x66')});}return null;})[_0xa521('0x4a')](handleError(_0x1d20c0,null));};
\ No newline at end of file
index c0764a1..9f8f46e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f7a=['Network','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x3908df,_0x288e1d){_0x3908df=_0x3908df-0x0;var _0x660a87=_0x6f7a[_0x3908df];return _0x660a87;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var logger=require(_0xa6f7('0x2'))(_0xa6f7('0x3'));var moment=require('moment');var BPromise=require(_0xa6f7('0x4'));var rp=require(_0xa6f7('0x5'));var fs=require('fs');var path=require(_0xa6f7('0x6'));var rimraf=require(_0xa6f7('0x7'));var config=require(_0xa6f7('0x8'));var attributes=require(_0xa6f7('0x9'));module[_0xa6f7('0xa')]=function(_0x20cccd,_0x1fdd5f){return _0x20cccd[_0xa6f7('0xb')](_0xa6f7('0xc'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbec5=['request-promise','path','../../config/environment','./network.attributes','exports','define','Network','network','lodash','util','api','moment','bluebird'];(function(_0x3a990c,_0x270fce){var _0x50ca11=function(_0x36ead1){while(--_0x36ead1){_0x3a990c['push'](_0x3a990c['shift']());}};_0x50ca11(++_0x270fce);}(_0xbec5,0xe5));var _0x5bec=function(_0x5a7e78,_0x400b57){_0x5a7e78=_0x5a7e78-0x0;var _0xa8d4a1=_0xbec5[_0x5a7e78];return _0xa8d4a1;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var logger=require('../../config/logger')(_0x5bec('0x2'));var moment=require(_0x5bec('0x3'));var BPromise=require(_0x5bec('0x4'));var rp=require(_0x5bec('0x5'));var fs=require('fs');var path=require(_0x5bec('0x6'));var rimraf=require('rimraf');var config=require(_0x5bec('0x7'));var attributes=require(_0x5bec('0x8'));module[_0x5bec('0x9')]=function(_0x4aaac6,_0x3ed67a){return _0x4aaac6[_0x5bec('0xa')](_0x5bec('0xb'),attributes,{'tableName':_0x5bec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b7f5c89..db3893f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x2080c3,_0x431831){_0x2080c3=_0x2080c3-0x0;var _0x26a38a=_0x7a54[_0x2080c3];return _0x26a38a;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x1dfb19,_0x1bd5e4){_0x1dfb19=_0x1dfb19-0x0;var _0x315e23=_0x7a54[_0x1dfb19];return _0x315e23;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
index d438d7b..712708e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b3d=['addAgents','/:id/send','send','put','delete','destroy','removeAnswers','removeAgents','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','create','addAnswer','/:id/notify','notify','addApplications'];(function(_0x37ba7a,_0x3e5935){var _0x200c10=function(_0x291776){while(--_0x291776){_0x37ba7a['push'](_0x37ba7a['shift']());}};_0x200c10(++_0x3e5935);}(_0x0b3d,0xfd));var _0xd0b3=function(_0x445d20,_0x39643f){_0x445d20=_0x445d20-0x0;var _0x26e5f2=_0x0b3d[_0x445d20];return _0x26e5f2;};'use strict';var multer=require(_0xd0b3('0x0'));var util=require('util');var path=require(_0xd0b3('0x1'));var timeout=require(_0xd0b3('0x2'));var express=require(_0xd0b3('0x3'));var router=express[_0xd0b3('0x4')]();var fs_extra=require(_0xd0b3('0x5'));var auth=require(_0xd0b3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd0b3('0x7'));var controller=require(_0xd0b3('0x8'));router[_0xd0b3('0x9')]('/',auth[_0xd0b3('0xa')](),controller['index']);router['get']('/describe',auth[_0xd0b3('0xa')](),controller[_0xd0b3('0xb')]);router[_0xd0b3('0x9')](_0xd0b3('0xc'),auth[_0xd0b3('0xa')](),controller['show']);router['get'](_0xd0b3('0xd'),auth[_0xd0b3('0xa')](),controller[_0xd0b3('0xe')]);router[_0xd0b3('0x9')](_0xd0b3('0xf'),auth[_0xd0b3('0xa')](),controller['getAnswers']);router[_0xd0b3('0x9')](_0xd0b3('0x10'),auth['isAuthenticated'](),controller[_0xd0b3('0x11')]);router[_0xd0b3('0x9')]('/:id/interactions',auth[_0xd0b3('0xa')](),controller[_0xd0b3('0x12')]);router[_0xd0b3('0x9')](_0xd0b3('0x13'),auth[_0xd0b3('0xa')](),controller[_0xd0b3('0x14')]);router[_0xd0b3('0x15')]('/',auth[_0xd0b3('0xa')](),controller[_0xd0b3('0x16')]);router[_0xd0b3('0x15')](_0xd0b3('0xd'),auth[_0xd0b3('0xa')](),controller['addDisposition']);router[_0xd0b3('0x15')](_0xd0b3('0xf'),auth['isAuthenticated'](),controller[_0xd0b3('0x17')]);router[_0xd0b3('0x15')](_0xd0b3('0x18'),controller[_0xd0b3('0x19')]);router[_0xd0b3('0x15')]('/:id/applications',auth[_0xd0b3('0xa')](),controller[_0xd0b3('0x1a')]);router['post'](_0xd0b3('0x13'),auth[_0xd0b3('0xa')](),controller[_0xd0b3('0x1b')]);router[_0xd0b3('0x15')](_0xd0b3('0x1c'),auth[_0xd0b3('0xa')](),controller[_0xd0b3('0x1d')]);router[_0xd0b3('0x1e')](_0xd0b3('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd0b3('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0xd0b3('0x20')]);router['delete']('/:id/dispositions',auth[_0xd0b3('0xa')](),controller['removeDispositions']);router[_0xd0b3('0x1f')](_0xd0b3('0xf'),auth[_0xd0b3('0xa')](),controller[_0xd0b3('0x21')]);router['delete'](_0xd0b3('0x13'),auth['isAuthenticated'](),controller[_0xd0b3('0x22')]);module['exports']=router;
\ No newline at end of file
+var _0x65ca=['../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','addAnswer','/:id/notify','notify','addAgents','/:id','update','removeDispositions','delete','removeAnswers','exports','multer','util','path','Router','fs-extra'];(function(_0x42cc1f,_0xe9eb20){var _0x175df5=function(_0x2f3e22){while(--_0x2f3e22){_0x42cc1f['push'](_0x42cc1f['shift']());}};_0x175df5(++_0xe9eb20);}(_0x65ca,0x1c9));var _0xa65c=function(_0x4d3b77,_0x3c789c){_0x4d3b77=_0x4d3b77-0x0;var _0x1a716a=_0x65ca[_0x4d3b77];return _0x1a716a;};'use strict';var multer=require(_0xa65c('0x0'));var util=require(_0xa65c('0x1'));var path=require(_0xa65c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa65c('0x3')]();var fs_extra=require(_0xa65c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa65c('0x5'));var config=require(_0xa65c('0x6'));var controller=require(_0xa65c('0x7'));router[_0xa65c('0x8')]('/',auth[_0xa65c('0x9')](),controller[_0xa65c('0xa')]);router[_0xa65c('0x8')]('/describe',auth[_0xa65c('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa65c('0x8')](_0xa65c('0xb'),auth[_0xa65c('0x9')](),controller[_0xa65c('0xc')]);router[_0xa65c('0x8')](_0xa65c('0xd'),auth[_0xa65c('0x9')](),controller[_0xa65c('0xe')]);router[_0xa65c('0x8')](_0xa65c('0xf'),auth['isAuthenticated'](),controller[_0xa65c('0x10')]);router[_0xa65c('0x8')](_0xa65c('0x11'),auth['isAuthenticated'](),controller[_0xa65c('0x12')]);router['get'](_0xa65c('0x13'),auth[_0xa65c('0x9')](),controller['getAgents']);router[_0xa65c('0x14')]('/',auth[_0xa65c('0x9')](),controller[_0xa65c('0x15')]);router['post'](_0xa65c('0xb'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x16')]);router[_0xa65c('0x14')](_0xa65c('0xd'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x17')]);router['post'](_0xa65c('0x18'),controller[_0xa65c('0x19')]);router[_0xa65c('0x14')](_0xa65c('0xf'),auth[_0xa65c('0x9')](),controller['addApplications']);router[_0xa65c('0x14')](_0xa65c('0x13'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x1a')]);router[_0xa65c('0x14')]('/:id/send',auth[_0xa65c('0x9')](),controller['send']);router['put'](_0xa65c('0x1b'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x1c')]);router['delete'](_0xa65c('0x1b'),auth[_0xa65c('0x9')](),controller['destroy']);router['delete'](_0xa65c('0xb'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x1d')]);router[_0xa65c('0x1e')](_0xa65c('0xd'),auth[_0xa65c('0x9')](),controller[_0xa65c('0x1f')]);router[_0xa65c('0x1e')](_0xa65c('0x13'),auth[_0xa65c('0x9')](),controller['removeAgents']);module[_0xa65c('0x20')]=router;
\ No newline at end of file
index a24e487..0d73500 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5df=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','STRING','generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}'];(function(_0x500dc1,_0x4f34db){var _0x38c633=function(_0x24e1ac){while(--_0x24e1ac){_0x500dc1['push'](_0x500dc1['shift']());}};_0x38c633(++_0x4f34db);}(_0xc5df,0x1ce));var _0xfc5d=function(_0x1ddfa5,_0x5700f5){_0x1ddfa5=_0x1ddfa5-0x0;var _0xa31ea9=_0xc5df[_0x1ddfa5];return _0xa31ea9;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xfc5d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xfc5d('0x1'),'allowNull':![]},'description':{'type':Sequelize[_0xfc5d('0x2')]},'token':{'type':Sequelize[_0xfc5d('0x2')],'defaultValue':function(){return rs[_0xfc5d('0x3')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfc5d('0x4')],'defaultValue':function(){return _0xfc5d('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfc5d('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfc5d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xfc5d('0x2')]},'queueTransfer':{'type':Sequelize[_0xfc5d('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfc5d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xfc5d('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfc5d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xfc5d('0x8')},'mandatoryDisposition':{'type':Sequelize[_0xfc5d('0x6')],'defaultValue':![],'comment':_0xfc5d('0x9'),'set':function(_0x30f97c){if(!_0x30f97c)this[_0xfc5d('0xa')](_0xfc5d('0xb'),null);this['setDataValue'](_0xfc5d('0xc'),_0x30f97c);}}};
\ No newline at end of file
+var _0x516f=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT','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','setDataValue','mandatoryDispositionPauseId'];(function(_0xb093,_0x5403c4){var _0x516bac=function(_0x4564cb){while(--_0x4564cb){_0xb093['push'](_0xb093['shift']());}};_0x516bac(++_0x5403c4);}(_0x516f,0xef));var _0xf516=function(_0x4407bf,_0x5aff82){_0x4407bf=_0x4407bf-0x0;var _0x3ff276=_0x516f[_0x4407bf];return _0x3ff276;};'use strict';var Sequelize=require(_0xf516('0x0'));var rs=require(_0xf516('0x1'));module[_0xf516('0x2')]={'name':{'type':Sequelize[_0xf516('0x3')],'unique':_0xf516('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xf516('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xf516('0x5')]();}},'replyUri':{'type':Sequelize[_0xf516('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xf516('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xf516('0x6')],'defaultValue':function(){return _0xf516('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf516('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf516('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xf516('0x3')]},'queueTransfer':{'type':Sequelize[_0xf516('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf516('0x9')],'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['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xf516('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xf516('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xb3ed6){if(!_0xb3ed6)this[_0xf516('0xb')](_0xf516('0xc'),null);this[_0xf516('0xb')](_0xf516('0xd'),_0xb3ed6);}}};
\ No newline at end of file
index 838bc0c..324d851 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x052d=['status','undefined','limit','offset','count','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','getDispositions','findOne','Disposition','OpenchannelAccountId','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','notify','CmContact','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','priority','asc','contact','lastName','threadId','externalUrl','OpenchannelInteraction','spread','firstName','messageId','interaction','get','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','startRouting','Start','EventManager','sequelize','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','sendStatus'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x052d,0x90));var _0xd052=function(_0x2b92de,_0x4d4856){_0x2b92de=_0x2b92de-0x0;var _0x8cb5c7=_0x052d[_0x2b92de];return _0x8cb5c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd052('0x0'));var zipdir=require(_0xd052('0x1'));var jsonpatch=require(_0xd052('0x2'));var rp=require(_0xd052('0x3'));var moment=require(_0xd052('0x4'));var BPromise=require(_0xd052('0x5'));var Mustache=require(_0xd052('0x6'));var util=require(_0xd052('0x7'));var path=require(_0xd052('0x8'));var sox=require(_0xd052('0x9'));var csv=require(_0xd052('0xa'));var ejs=require(_0xd052('0xb'));var fs=require('fs');var fs_extra=require(_0xd052('0xc'));var _=require(_0xd052('0xd'));var squel=require('squel');var crypto=require(_0xd052('0xe'));var jsforce=require(_0xd052('0xf'));var deskjs=require(_0xd052('0x10'));var toCsv=require(_0xd052('0xa'));var querystring=require(_0xd052('0x11'));var Papa=require(_0xd052('0x12'));var Redis=require('ioredis');var authService=require(_0xd052('0x13'));var qs=require(_0xd052('0x14'));var as=require(_0xd052('0x15'));var hardwareService=require(_0xd052('0x16'));var logger=require(_0xd052('0x17'))(_0xd052('0x18'));var utils=require(_0xd052('0x19'));var config=require(_0xd052('0x1a'));var licenseUtil=require(_0xd052('0x1b'));var db=require(_0xd052('0x1c'))['db'];config[_0xd052('0x1d')]=_[_0xd052('0x1e')](config[_0xd052('0x1d')],{'host':_0xd052('0x1f'),'port':0x18eb});var socket=require(_0xd052('0x20'))(new Redis(config[_0xd052('0x1d')]));require(_0xd052('0x21'))['register'](socket);var jayson=require(_0xd052('0x22'));var client=jayson[_0xd052('0x23')][_0xd052('0x24')]({'port':0x232c});var client9002=jayson[_0xd052('0x23')][_0xd052('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x3718c2,_0xd91b68,_0x3b7d6e,_0x32e1db){return new BPromise(function(_0xf97bfe,_0x578457){var _0x11cd86=_0x32e1db||client;return _0x11cd86[_0xd052('0x25')](_0x3718c2,_0x3b7d6e)[_0xd052('0x26')](function(_0x6efa3e){logger[_0xd052('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0xd91b68,_0xd052('0x28'));logger[_0xd052('0x29')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0xd91b68,'request\x20sent',JSON[_0xd052('0x2a')](_0x6efa3e));if(_0x6efa3e[_0xd052('0x2b')]){if(_0x6efa3e[_0xd052('0x2b')][_0xd052('0x2c')]===0x1f4){logger[_0xd052('0x2b')](_0xd052('0x2d'),_0xd91b68,_0x6efa3e[_0xd052('0x2b')][_0xd052('0x2e')]);return _0x578457(_0x6efa3e[_0xd052('0x2b')][_0xd052('0x2e')]);}logger[_0xd052('0x2b')](_0xd052('0x2d'),_0xd91b68,_0x6efa3e[_0xd052('0x2b')][_0xd052('0x2e')]);return _0xf97bfe(_0x6efa3e['error']['message']);}else{logger[_0xd052('0x27')](_0xd052('0x2d'),_0xd91b68,_0xd052('0x28'));_0xf97bfe(_0x6efa3e[_0xd052('0x2f')][_0xd052('0x2e')]);}})[_0xd052('0x30')](function(_0xf8516a){logger[_0xd052('0x2b')](_0xd052('0x2d'),_0xd91b68,_0xf8516a);_0x578457(_0xf8516a);});});}function respondWithStatusCode(_0x44b328,_0x4a3403){_0x4a3403=_0x4a3403||0xcc;return function(_0x236198){if(_0x236198){return _0x44b328[_0xd052('0x31')](_0x4a3403);}return _0x44b328[_0xd052('0x32')](_0x4a3403)['end']();};}function respondWithResult(_0x7aba54,_0x31eb80){_0x31eb80=_0x31eb80||0xc8;return function(_0x31baa9){if(_0x31baa9){return _0x7aba54[_0xd052('0x32')](_0x31eb80)['json'](_0x31baa9);}};}function respondWithFilteredResult(_0x3fd2c8,_0x10831c){return function(_0x39364b){if(_0x39364b){var _0x4c51a0=typeof _0x10831c['offset']===_0xd052('0x33')&&typeof _0x10831c[_0xd052('0x34')]===_0xd052('0x33');var _0x3a1636=_0x39364b['count'];var _0x3ebf38=_0x4c51a0?0x0:_0x10831c[_0xd052('0x35')];var _0x3d9b94=_0x4c51a0?_0x39364b[_0xd052('0x36')]:_0x10831c[_0xd052('0x35')]+_0x10831c[_0xd052('0x34')];var _0x2fc579;if(_0x3d9b94>=_0x3a1636){_0x3d9b94=_0x3a1636;_0x2fc579=0xc8;}else{_0x2fc579=0xce;}_0x3fd2c8[_0xd052('0x32')](_0x2fc579);return _0x3fd2c8[_0xd052('0x37')](_0xd052('0x38'),_0x3ebf38+'-'+_0x3d9b94+'/'+_0x3a1636)['json'](_0x39364b);}return null;};}function patchUpdates(_0xfce7c4){return function(_0x37ff38){try{jsonpatch[_0xd052('0x39')](_0x37ff38,_0xfce7c4,!![]);}catch(_0x4c93d4){return BPromise[_0xd052('0x3a')](_0x4c93d4);}return _0x37ff38['save']();};}function saveUpdates(_0x1fc934,_0x5aa90f){return function(_0x5472b4){if(_0x5472b4){return _0x5472b4[_0xd052('0x3b')](_0x1fc934)['then'](function(_0x537076){return _0x537076;});}return null;};}function removeEntity(_0x3f5c75,_0x2efcf2){return function(_0x205371){if(_0x205371){return _0x205371[_0xd052('0x3c')]()['then'](function(){var _0x37d376=_0x205371['get']({'plain':!![]});var _0xb986ab='OpenchannelAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0xb986ab,'resourceId':_0x37d376['id']}})['then'](function(){return _0x205371;});})[_0xd052('0x26')](function(){_0x3f5c75[_0xd052('0x32')](0xcc)[_0xd052('0x3d')]();});}};}function handleEntityNotFound(_0x235bab,_0x445e48){return function(_0xd6ab45){if(!_0xd6ab45){_0x235bab[_0xd052('0x31')](0x194);}return _0xd6ab45;};}function handleError(_0xad89f2,_0x399cd7){_0x399cd7=_0x399cd7||0x1f4;return function(_0x426883){logger[_0xd052('0x2b')](_0x426883[_0xd052('0x3e')]);if(_0x426883[_0xd052('0x3f')]){delete _0x426883[_0xd052('0x3f')];}_0xad89f2['status'](_0x399cd7)[_0xd052('0x40')](_0x426883);};}exports[_0xd052('0x41')]=function(_0x288b58,_0x43f736){var _0x40304b={'include':[{'model':db[_0xd052('0x42')],'as':_0xd052('0x43')}]},_0x3312c7={},_0x571933={'count':0x0,'rows':[]};var _0x4d4b5d=_[_0xd052('0x44')](db[_0xd052('0x45')][_0xd052('0x46')],function(_0x1dc25b){return{'name':_0x1dc25b[_0xd052('0x47')],'type':_0x1dc25b[_0xd052('0x48')][_0xd052('0x49')]};});_0x3312c7[_0xd052('0x4a')]=_[_0xd052('0x44')](_0x4d4b5d,'name');_0x3312c7[_0xd052('0x4b')]=_[_0xd052('0x4c')](_0x288b58['query']);_0x3312c7['filters']=_['intersection'](_0x3312c7[_0xd052('0x4a')],_0x3312c7[_0xd052('0x4b')]);_0x40304b['attributes']=_[_0xd052('0x4d')](_0x3312c7[_0xd052('0x4a')],qs[_0xd052('0x4e')](_0x288b58[_0xd052('0x4b')][_0xd052('0x4e')]));_0x40304b[_0xd052('0x4f')]=_0x40304b[_0xd052('0x4f')]['length']?_0x40304b[_0xd052('0x4f')]:_0x3312c7[_0xd052('0x4a')];if(!_0x288b58[_0xd052('0x4b')][_0xd052('0x50')](_0xd052('0x51'))){_0x40304b[_0xd052('0x34')]=qs['limit'](_0x288b58['query'][_0xd052('0x34')]);_0x40304b[_0xd052('0x35')]=qs[_0xd052('0x35')](_0x288b58[_0xd052('0x4b')][_0xd052('0x35')]);}_0x40304b[_0xd052('0x52')]=qs[_0xd052('0x53')](_0x288b58[_0xd052('0x4b')][_0xd052('0x53')]);_0x40304b['where']=qs['filters'](_[_0xd052('0x54')](_0x288b58[_0xd052('0x4b')],_0x3312c7[_0xd052('0x55')]),_0x4d4b5d);if(_0x288b58[_0xd052('0x4b')][_0xd052('0x56')]){_0x40304b[_0xd052('0x57')]=_[_0xd052('0x58')](_0x40304b['where'],{'$or':_[_0xd052('0x44')](_0x4d4b5d,function(_0x5c55e7){if(_0x5c55e7[_0xd052('0x48')]!==_0xd052('0x59')){var _0x195075={};_0x195075[_0x5c55e7[_0xd052('0x3f')]]={'$like':'%'+_0x288b58[_0xd052('0x4b')][_0xd052('0x56')]+'%'};return _0x195075;}})});}_0x40304b=_['merge']({},_0x40304b,_0x288b58['options']);var _0x5ed641={'where':_0x40304b['where']};return db[_0xd052('0x45')][_0xd052('0x36')](_0x5ed641)['then'](function(_0x449c80){_0x571933[_0xd052('0x36')]=_0x449c80;if(_0x288b58[_0xd052('0x4b')][_0xd052('0x5a')]){_0x40304b[_0xd052('0x5b')]=[{'all':!![]}];}return db[_0xd052('0x45')][_0xd052('0x5c')](_0x40304b);})['then'](function(_0x439763){_0x571933[_0xd052('0x5d')]=_0x439763;return _0x571933;})[_0xd052('0x26')](respondWithFilteredResult(_0x43f736,_0x40304b))[_0xd052('0x30')](handleError(_0x43f736,null));};exports[_0xd052('0x5e')]=function(_0x1a8495,_0x408d98){var _0x230aaa={'raw':![],'where':{'id':_0x1a8495[_0xd052('0x5f')]['id']},'include':[{'model':db[_0xd052('0x42')],'as':_0xd052('0x43')}]},_0x4c8ec7={};_0x4c8ec7['model']=_[_0xd052('0x4c')](db[_0xd052('0x45')][_0xd052('0x46')]);_0x4c8ec7[_0xd052('0x4b')]=_[_0xd052('0x4c')](_0x1a8495[_0xd052('0x4b')]);_0x4c8ec7[_0xd052('0x55')]=_[_0xd052('0x4d')](_0x4c8ec7[_0xd052('0x4a')],_0x4c8ec7[_0xd052('0x4b')]);_0x230aaa[_0xd052('0x4f')]=_[_0xd052('0x4d')](_0x4c8ec7[_0xd052('0x4a')],qs['fields'](_0x1a8495['query']['fields']));_0x230aaa[_0xd052('0x4f')]=_0x230aaa[_0xd052('0x4f')][_0xd052('0x60')]?_0x230aaa['attributes']:_0x4c8ec7[_0xd052('0x4a')];if(_0x1a8495[_0xd052('0x4b')][_0xd052('0x5a')]){_0x230aaa['include']=[{'all':!![]}];}_0x230aaa=_[_0xd052('0x58')]({},_0x230aaa,_0x1a8495[_0xd052('0x61')]);return db[_0xd052('0x45')][_0xd052('0x62')](_0x230aaa)[_0xd052('0x26')](handleEntityNotFound(_0x408d98,null))['then'](respondWithResult(_0x408d98,null))[_0xd052('0x30')](handleError(_0x408d98,null));};exports[_0xd052('0x63')]=function(_0x49722,_0x15805d){return db[_0xd052('0x45')]['create'](_0x49722['body'],{})['then'](function(_0x20b922){var _0x2d388a=_0x49722[_0xd052('0x64')]['get']({'plain':!![]});if(!_0x2d388a)throw new Error(_0xd052('0x65'));if(_0x2d388a['role']===_0xd052('0x64')){var _0x49adcd=_0x20b922['get']({'plain':!![]});var _0x55f652='OpenchannelAccounts';return db[_0xd052('0x66')][_0xd052('0x62')]({'where':{'name':_0x55f652,'userProfileId':_0x2d388a[_0xd052('0x67')]},'raw':!![]})['then'](function(_0x20a634){if(_0x20a634&&_0x20a634[_0xd052('0x68')]===0x0){return db[_0xd052('0x69')][_0xd052('0x63')]({'name':_0x49adcd['name'],'resourceId':_0x49adcd['id'],'type':_0x20a634[_0xd052('0x3f')],'sectionId':_0x20a634['id']},{})[_0xd052('0x26')](function(){return _0x20b922;});}else{return _0x20b922;}})[_0xd052('0x30')](function(_0x3fbcc9){logger['error'](_0xd052('0x6a'),_0x3fbcc9);throw _0x3fbcc9;});}return _0x20b922;})[_0xd052('0x26')](respondWithResult(_0x15805d,0xc9))[_0xd052('0x30')](handleError(_0x15805d,null));};exports['update']=function(_0x2cca62,_0xfd9eb9){if(_0x2cca62['body']['id']){delete _0x2cca62[_0xd052('0x6b')]['id'];}return db[_0xd052('0x45')][_0xd052('0x62')]({'where':{'id':_0x2cca62[_0xd052('0x5f')]['id']},'include':[{'model':db[_0xd052('0x42')],'as':_0xd052('0x43')}]})[_0xd052('0x26')](handleEntityNotFound(_0xfd9eb9,null))['then'](saveUpdates(_0x2cca62[_0xd052('0x6b')],null))[_0xd052('0x26')](respondWithResult(_0xfd9eb9,null))[_0xd052('0x30')](handleError(_0xfd9eb9,null));};exports['destroy']=function(_0x33d6ce,_0x227e5b){return db[_0xd052('0x45')][_0xd052('0x62')]({'where':{'id':_0x33d6ce[_0xd052('0x5f')]['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x227e5b,null))['then'](removeEntity(_0x227e5b,null))[_0xd052('0x30')](handleError(_0x227e5b,null));};exports['describe']=function(_0x30e546,_0x1e56f9){return db[_0xd052('0x45')][_0xd052('0x6c')]()[_0xd052('0x26')](respondWithResult(_0x1e56f9,null))[_0xd052('0x30')](handleError(_0x1e56f9,null));};exports[_0xd052('0x6d')]=function(_0x30d780,_0x58c323,_0x3cbc12){if(_0x30d780[_0xd052('0x6b')]['id']){delete _0x30d780['body']['id'];}return db[_0xd052('0x45')]['find']({'where':{'id':_0x30d780['params']['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x58c323,null))[_0xd052('0x26')](function(_0xe7fb08){if(_0xe7fb08){_0x30d780[_0xd052('0x6b')]['OpenchannelAccountId']=_0xe7fb08['id'];return db['Disposition']['create'](_0x30d780[_0xd052('0x6b')]);}})[_0xd052('0x26')](respondWithResult(_0x58c323,null))[_0xd052('0x30')](handleError(_0x58c323,null));};exports[_0xd052('0x6e')]=function(_0x40423f,_0x8a50d3,_0x125431){var _0x1f8ddc={'raw':![],'where':{}};var _0x1c0b84={};var _0x57c06c={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xd052('0x6f')]({'where':{'id':_0x40423f['params']['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x8a50d3,null))['then'](function(_0x3bd37d){if(_0x3bd37d){_0x1c0b84[_0xd052('0x4a')]=_[_0xd052('0x4c')](db[_0xd052('0x70')][_0xd052('0x46')]);_0x1c0b84[_0xd052('0x4b')]=_[_0xd052('0x4c')](_0x40423f[_0xd052('0x4b')]);_0x1c0b84[_0xd052('0x55')]=_[_0xd052('0x4d')](_0x1c0b84['model'],_0x1c0b84[_0xd052('0x4b')]);_0x1f8ddc[_0xd052('0x4f')]=_['intersection'](_0x1c0b84[_0xd052('0x4a')],qs[_0xd052('0x4e')](_0x40423f[_0xd052('0x4b')]['fields']));_0x1f8ddc['attributes']=_0x1f8ddc['attributes'][_0xd052('0x60')]?_0x1f8ddc[_0xd052('0x4f')]:_0x1c0b84[_0xd052('0x4a')];if(!_0x40423f['query'][_0xd052('0x50')](_0xd052('0x51'))){_0x1f8ddc[_0xd052('0x34')]=qs[_0xd052('0x34')](_0x40423f['query'][_0xd052('0x34')]);_0x1f8ddc[_0xd052('0x35')]=qs[_0xd052('0x35')](_0x40423f[_0xd052('0x4b')][_0xd052('0x35')]);}_0x1f8ddc[_0xd052('0x52')]=qs[_0xd052('0x53')](_0x40423f[_0xd052('0x4b')]['sort']);_0x1f8ddc[_0xd052('0x57')]=qs[_0xd052('0x55')](_[_0xd052('0x54')](_0x40423f[_0xd052('0x4b')],_0x1c0b84[_0xd052('0x55')]));_0x1f8ddc[_0xd052('0x57')][_0xd052('0x71')]=_0x3bd37d['id'];if(_0x40423f['query'][_0xd052('0x56')]){_0x1f8ddc[_0xd052('0x57')]=_['merge'](_0x1f8ddc[_0xd052('0x57')],{'$or':_[_0xd052('0x44')](_0x1f8ddc[_0xd052('0x4f')],function(_0x44900f){var _0x1c9b6b={};_0x1c9b6b[_0x44900f]={'$like':'%'+_0x40423f[_0xd052('0x4b')][_0xd052('0x56')]+'%'};return _0x1c9b6b;})});}_0x1f8ddc=_['merge']({},_0x1f8ddc,_0x40423f[_0xd052('0x61')]);return db['Disposition']['count']({'where':_0x1f8ddc['where']})[_0xd052('0x26')](function(_0x4c6af7){_0x57c06c['count']=_0x4c6af7;if(_0x40423f[_0xd052('0x4b')][_0xd052('0x5a')]){_0x1f8ddc[_0xd052('0x5b')]=[{'all':!![]}];}return db[_0xd052('0x70')][_0xd052('0x5c')](_0x1f8ddc);})[_0xd052('0x26')](function(_0x15f3d2){_0x57c06c[_0xd052('0x5d')]=_0x15f3d2;return _0x57c06c;});}})[_0xd052('0x26')](respondWithFilteredResult(_0x8a50d3,_0x1f8ddc))[_0xd052('0x30')](handleError(_0x8a50d3,null));};exports[_0xd052('0x72')]=function(_0x4d7e15,_0x33e45f,_0x38181f){return db['OpenchannelAccount'][_0xd052('0x62')]({'where':{'id':_0x4d7e15[_0xd052('0x5f')]['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x33e45f,null))[_0xd052('0x26')](function(_0x1c0050){if(_0x1c0050){return _0x1c0050[_0xd052('0x72')](_0x4d7e15[_0xd052('0x4b')][_0xd052('0x73')]);}})[_0xd052('0x26')](respondWithStatusCode(_0x33e45f,null))[_0xd052('0x30')](handleError(_0x33e45f,null));};exports['addAnswer']=function(_0x251c3b,_0x3f4146,_0x318dac){if(_0x251c3b['body']['id']){delete _0x251c3b[_0xd052('0x6b')]['id'];}return db[_0xd052('0x45')][_0xd052('0x62')]({'where':{'id':_0x251c3b[_0xd052('0x5f')]['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x3f4146,null))['then'](function(_0x46fcac){if(_0x46fcac){_0x251c3b['body'][_0xd052('0x71')]=_0x46fcac['id'];return db['CannedAnswer'][_0xd052('0x63')](_0x251c3b[_0xd052('0x6b')]);}})[_0xd052('0x26')](respondWithResult(_0x3f4146,null))['catch'](handleError(_0x3f4146,null));};exports[_0xd052('0x74')]=function(_0x47e372,_0x26b11c,_0x3c4e7b){var _0x3976e2={'raw':![],'where':{}};var _0x30de97={};var _0x4ba0ea={'count':0x0,'rows':[]};return db[_0xd052('0x45')][_0xd052('0x6f')]({'where':{'id':_0x47e372[_0xd052('0x5f')]['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x26b11c,null))['then'](function(_0x253d80){if(_0x253d80){_0x30de97[_0xd052('0x4a')]=_['keys'](db[_0xd052('0x75')]['rawAttributes']);_0x30de97[_0xd052('0x4b')]=_[_0xd052('0x4c')](_0x47e372[_0xd052('0x4b')]);_0x30de97[_0xd052('0x55')]=_[_0xd052('0x4d')](_0x30de97[_0xd052('0x4a')],_0x30de97['query']);_0x3976e2[_0xd052('0x4f')]=_[_0xd052('0x4d')](_0x30de97[_0xd052('0x4a')],qs[_0xd052('0x4e')](_0x47e372[_0xd052('0x4b')]['fields']));_0x3976e2['attributes']=_0x3976e2[_0xd052('0x4f')]['length']?_0x3976e2['attributes']:_0x30de97[_0xd052('0x4a')];if(!_0x47e372[_0xd052('0x4b')][_0xd052('0x50')]('nolimit')){_0x3976e2[_0xd052('0x34')]=qs[_0xd052('0x34')](_0x47e372[_0xd052('0x4b')]['limit']);_0x3976e2['offset']=qs[_0xd052('0x35')](_0x47e372[_0xd052('0x4b')][_0xd052('0x35')]);}_0x3976e2[_0xd052('0x52')]=qs['sort'](_0x47e372['query'][_0xd052('0x53')]);_0x3976e2['where']=qs[_0xd052('0x55')](_['pick'](_0x47e372['query'],_0x30de97['filters']));_0x3976e2['where'][_0xd052('0x71')]=_0x253d80['id'];if(_0x47e372[_0xd052('0x4b')][_0xd052('0x56')]){_0x3976e2['where']=_[_0xd052('0x58')](_0x3976e2['where'],{'$or':_['map'](_0x3976e2[_0xd052('0x4f')],function(_0xb39fda){var _0x229e6d={};_0x229e6d[_0xb39fda]={'$like':'%'+_0x47e372[_0xd052('0x4b')][_0xd052('0x56')]+'%'};return _0x229e6d;})});}_0x3976e2=_[_0xd052('0x58')]({},_0x3976e2,_0x47e372[_0xd052('0x61')]);return db[_0xd052('0x75')][_0xd052('0x36')]({'where':_0x3976e2[_0xd052('0x57')]})['then'](function(_0x4e7d92){_0x4ba0ea[_0xd052('0x36')]=_0x4e7d92;if(_0x47e372['query'][_0xd052('0x5a')]){_0x3976e2[_0xd052('0x5b')]=[{'all':!![]}];}return db[_0xd052('0x75')][_0xd052('0x5c')](_0x3976e2);})['then'](function(_0x158101){_0x4ba0ea[_0xd052('0x5d')]=_0x158101;return _0x4ba0ea;});}})[_0xd052('0x26')](respondWithFilteredResult(_0x26b11c,_0x3976e2))[_0xd052('0x30')](handleError(_0x26b11c,null));};exports[_0xd052('0x76')]=function(_0x21afc2,_0x187950,_0x130067){return db[_0xd052('0x45')][_0xd052('0x62')]({'where':{'id':_0x21afc2[_0xd052('0x5f')]['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x187950,null))[_0xd052('0x26')](function(_0x252f55){if(_0x252f55){return _0x252f55[_0xd052('0x76')](_0x21afc2['query'][_0xd052('0x73')]);}})[_0xd052('0x26')](respondWithStatusCode(_0x187950,null))[_0xd052('0x30')](handleError(_0x187950,null));};exports[_0xd052('0x77')]=function(_0x445479,_0x42dc3a,_0x15b872){var _0x1d9b12={'body':_0x445479['body'],'channel':'openchannel'};var _0x11d2d0=[];var _0x5a3a1c=[];var _0x954b0d={};var _0x2f69c6=![];return db[_0xd052('0x78')][_0xd052('0x6c')]()[_0xd052('0x26')](function(_0x5b1e5e){if(!_0x5b1e5e){throw new db['Sequelize'][(_0xd052('0x79'))](_0xd052('0x7a'));}_0x11d2d0=_['difference'](_[_0xd052('0x4c')](_0x5b1e5e),[_0xd052('0x7b'),_0xd052('0x7c')]);_0x5a3a1c=_[_0xd052('0x7d')](_[_0xd052('0x4c')](_0x5b1e5e),[_0xd052('0x7b'),_0xd052('0x7c'),_0xd052('0x7e'),_0xd052('0x7f')]);if(_0x445479[_0xd052('0x6b')]['id']){delete _0x445479[_0xd052('0x6b')]['id'];}if(_[_0xd052('0x80')](_0x445479['body'][_0xd052('0x81')])){throw new db['Sequelize']['ValidationError'](_0xd052('0x82'));}if(_[_0xd052('0x80')](_0x445479[_0xd052('0x6b')]['body'])||_0x445479['body']['body']===''){throw new db[(_0xd052('0x83'))][(_0xd052('0x79'))](_0xd052('0x84'));}if(_[_0xd052('0x80')](_0x445479[_0xd052('0x6b')][_0xd052('0x85')])){throw new db[(_0xd052('0x83'))][(_0xd052('0x79'))](_0xd052('0x86')+_0x5a3a1c);}if(!_[_0xd052('0x87')](_0x5a3a1c,_0x445479['body'][_0xd052('0x85')])){throw new db[(_0xd052('0x83'))][(_0xd052('0x79'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a3a1c);}_0x954b0d[_0x445479[_0xd052('0x6b')][_0xd052('0x85')]]=_0x445479[_0xd052('0x6b')][_0xd052('0x81')];})['then'](function(){return db[_0xd052('0x45')]['find']({'where':{'id':_0x445479[_0xd052('0x5f')]['id']},'include':[{'model':db[_0xd052('0x88')],'as':_0xd052('0x89'),'include':[{'model':db['CmContact'],'as':_0xd052('0x8a'),'where':_0x954b0d,'limit':0x1,'order':[[_0xd052('0x7c'),_0xd052('0x8b')]]}]},{'model':db['OpenchannelApplication'],'as':_0xd052('0x8c')}]});})[_0xd052('0x26')](handleEntityNotFound(_0x42dc3a,null))[_0xd052('0x26')](function(_0x24bd9e){if(_0x24bd9e&&_0x24bd9e['List']){_0x1d9b12[_0xd052('0x8d')]=_0x24bd9e;_0x1d9b12[_0xd052('0x8e')]=_0x24bd9e[_0xd052('0x8c')];_0x1d9b12[_0xd052('0x8f')]=_0x24bd9e[_0xd052('0x89')];_0x1d9b12[_0xd052('0x8e')]=_[_0xd052('0x90')](_0x1d9b12[_0xd052('0x8e')],[_0xd052('0x91')],[_0xd052('0x92')]);if(_0x1d9b12[_0xd052('0x8d')]['Applications']){delete _0x1d9b12[_0xd052('0x8d')][_0xd052('0x8c')];}if(_0x1d9b12[_0xd052('0x8d')][_0xd052('0x89')]&&_0x1d9b12[_0xd052('0x8d')]['List'][_0xd052('0x8a')][_0xd052('0x60')]){return _0x1d9b12[_0xd052('0x8d')]['List'][_0xd052('0x8a')][0x0];}var _0x174035=_[_0xd052('0x1e')](_0x445479['body'],{'firstName':_0x445479[_0xd052('0x6b')][_0xd052('0x81')],'ListId':_0x24bd9e[_0xd052('0x7f')]});_0x174035[_0x445479[_0xd052('0x6b')][_0xd052('0x85')]]=_0x445479['body']['from'];return db[_0xd052('0x78')][_0xd052('0x63')](_0x174035,{'fields':_0x11d2d0,'raw':!![]});}})[_0xd052('0x26')](handleEntityNotFound(_0x42dc3a,null))[_0xd052('0x26')](function(_0x3fdc48){_0x1d9b12[_0xd052('0x93')]=_0x3fdc48;if(_0x3fdc48){var _0x3e67dc={'ContactId':_0x3fdc48['id'],'OpenchannelAccountId':_0x445479[_0xd052('0x5f')]['id'],'from':(_0x3fdc48['firstName']||'')+'\x20'+(_0x3fdc48[_0xd052('0x94')]||'')};var _0x1eb662={'OpenchannelAccountId':_0x445479['params']['id'],'closed':![]};if(_0x445479[_0xd052('0x6b')][_0xd052('0x95')]){_0x1eb662['threadId']=_0x445479[_0xd052('0x6b')][_0xd052('0x95')];return db['OpenchannelInteraction']['find']({'where':_0x1eb662})['then'](function(_0x1dc8ee){if(_0x1dc8ee){return[_0x1dc8ee,![]];}_0x3e67dc[_0xd052('0x95')]=_0x445479[_0xd052('0x6b')][_0xd052('0x95')];_0x3e67dc[_0xd052('0x96')]=_0x445479[_0xd052('0x6b')][_0xd052('0x96')];return db[_0xd052('0x97')][_0xd052('0x63')](_0x3e67dc)[_0xd052('0x26')](function(_0x3c5c39){return[_0x3c5c39,!![]];});});}else{_0x1eb662[_0xd052('0x95')]=null;}_0x1eb662['ContactId']=_0x3fdc48['id'];return db[_0xd052('0x97')][_0xd052('0x62')]({'where':_0x1eb662})[_0xd052('0x26')](function(_0x27c8b3){if(_0x27c8b3){return[_0x27c8b3,![]];}return db[_0xd052('0x97')][_0xd052('0x63')](_0x3e67dc)[_0xd052('0x26')](function(_0x5bde7c){return[_0x5bde7c,!![]];});});}})[_0xd052('0x98')](function(_0x5db3c4,_0x18a2c2){if(_0x5db3c4){_0x2f69c6=_0x18a2c2;if(!_0x18a2c2){var _0x1465ea={'from':(_0x1d9b12['contact'][_0xd052('0x99')]||'')+'\x20'+(_0x1d9b12[_0xd052('0x93')][_0xd052('0x94')]||'')};if(_0x445479[_0xd052('0x6b')][_0xd052('0x95')]&&_0x445479['body']['messageId']&&_0x445479[_0xd052('0x6b')][_0xd052('0x95')]!=_0x445479['body'][_0xd052('0x9a')]){_0x1465ea[_0xd052('0x95')]=_0x445479['body'][_0xd052('0x9a')];}return _0x5db3c4[_0xd052('0x3b')](_0x1465ea);}else{return _0x5db3c4;}}})[_0xd052('0x26')](function(_0x549b2e){_0x1d9b12[_0xd052('0x9b')]=_0x549b2e[_0xd052('0x9c')]({'plain':!![]});_0x1d9b12['interaction'][_0xd052('0x9d')]=_0x2f69c6;if(_0x1d9b12[_0xd052('0x9b')][_0xd052('0x9d')]){if(_0x1d9b12['account'][_0xd052('0x9e')]){_0x1d9b12[_0xd052('0x8e')][_0xd052('0x9f')]({'id':0x0,'priority':_0x1d9b12[_0xd052('0x8e')][_0xd052('0x60')]+0x1,'app':_0xd052('0xa0'),'appdata':_0xd052('0xa1'),'interval':_0xd052('0xa2')});}}return db[_0xd052('0xa3')][_0xd052('0x63')]({'body':_0x445479[_0xd052('0x6b')][_0xd052('0x6b')],'OpenchannelAccountId':_0x445479[_0xd052('0x5f')]['id'],'OpenchannelInteractionId':_0x549b2e['id'],'direction':'in','ContactId':_0x1d9b12[_0xd052('0x93')]['id'],'AttachmentId':_0x445479[_0xd052('0x6b')][_0xd052('0xa4')]});})[_0xd052('0x26')](function(_0x2d62ea){_0x1d9b12[_0xd052('0x2e')]=_0x2d62ea;if(_0x1d9b12[_0xd052('0x9b')][_0xd052('0xa5')]){return db[_0xd052('0xa6')][_0xd052('0x62')]({'attributes':['id',_0xd052('0x3f')],'where':{'id':_0x1d9b12['interaction']['UserId']}})[_0xd052('0x26')](function(_0x7d87d5){if(_0x7d87d5){_0x1d9b12['applications'][_0xd052('0xa7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x7d87d5[_0xd052('0x3f')]+','+(_0x1d9b12[_0xd052('0x8d')][_0xd052('0xa8')]||0xa),'interval':'*,*,*,*'});_0x1d9b12[_0xd052('0xa9')]=![];}return respondWithRpcPromise('Start',_0xd052('0xaa'),_0x1d9b12);});}return respondWithRpcPromise(_0xd052('0xab'),_0xd052('0xaa'),_0x1d9b12);})['then'](function(_0x136f31){respondWithRpcPromise(_0xd052('0xac'),_0xd052('0xac'),{'event':_0xd052('0x77'),'message':_0x136f31},client9002);return _0x136f31;})['then'](respondWithResult(_0x42dc3a,null))[_0xd052('0x30')](handleError(_0x42dc3a,null));};exports['addApplications']=function(_0xe08c16,_0x22f35c,_0x36d629){return db[_0xd052('0x45')][_0xd052('0x6f')]({'where':{'id':_0xe08c16['params']['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x22f35c,null))[_0xd052('0x26')](function(_0x3b9a6e){if(_0x3b9a6e){return db[_0xd052('0xad')]['transaction'](function(_0x289ae5){return db[_0xd052('0xae')][_0xd052('0x3c')]({'where':{'OpenchannelAccountId':_0xe08c16[_0xd052('0x5f')]['id']},'transaction':_0x289ae5})[_0xd052('0x26')](function(_0x3ab912){var _0x73efa3=_['map'](_0xe08c16[_0xd052('0x6b')],function(_0x1f8b6e){_0x1f8b6e[_0xd052('0x71')]=_0xe08c16[_0xd052('0x5f')]['id'];return _0x1f8b6e;});return db[_0xd052('0xae')][_0xd052('0xaf')](_0x73efa3,{'transaction':_0x289ae5});});})[_0xd052('0x26')](function(){return db[_0xd052('0xae')][_0xd052('0xb0')]({'where':{'OpenchannelAccountId':_0xe08c16[_0xd052('0x5f')]['id']},'order':_0xd052('0x91')});});}})[_0xd052('0x26')](respondWithResult(_0x22f35c,null))['catch'](handleError(_0x22f35c,null));};exports[_0xd052('0xb1')]=function(_0x1f9384,_0x5b7561,_0x471775){var _0x8e29c2={};var _0x1843cb={};var _0x2a5b33;var _0x541300;return db[_0xd052('0x45')]['findOne']({'where':{'id':_0x1f9384[_0xd052('0x5f')]['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x5b7561,null))[_0xd052('0x26')](function(_0xb3657f){if(_0xb3657f){_0x2a5b33=_0xb3657f;_0x1843cb[_0xd052('0x4a')]=_['keys'](db[_0xd052('0xae')][_0xd052('0x46')]);_0x1843cb[_0xd052('0x4b')]=_[_0xd052('0x4c')](_0x1f9384[_0xd052('0x4b')]);_0x1843cb[_0xd052('0x55')]=_[_0xd052('0x4d')](_0x1843cb[_0xd052('0x4a')],_0x1843cb[_0xd052('0x4b')]);_0x8e29c2[_0xd052('0x4f')]=_[_0xd052('0x4d')](_0x1843cb['model'],qs[_0xd052('0x4e')](_0x1f9384['query'][_0xd052('0x4e')]));_0x8e29c2[_0xd052('0x4f')]=_0x8e29c2[_0xd052('0x4f')][_0xd052('0x60')]?_0x8e29c2[_0xd052('0x4f')]:_0x1843cb[_0xd052('0x4a')];_0x8e29c2[_0xd052('0x52')]=qs[_0xd052('0x53')](_0x1f9384[_0xd052('0x4b')]['sort']);_0x8e29c2[_0xd052('0x57')]=qs[_0xd052('0x55')](_[_0xd052('0x54')](_0x1f9384[_0xd052('0x4b')],_0x1843cb[_0xd052('0x55')]));if(_0x1f9384[_0xd052('0x4b')]['filter']){_0x8e29c2[_0xd052('0x57')]=_[_0xd052('0x58')](_0x8e29c2[_0xd052('0x57')],{'$or':_[_0xd052('0x44')](_0x8e29c2['attributes'],function(_0x5b541e){var _0x345c53={};_0x345c53[_0x5b541e]={'$like':'%'+_0x1f9384[_0xd052('0x4b')][_0xd052('0x56')]+'%'};return _0x345c53;})});}_0x8e29c2=_[_0xd052('0x58')]({},_0x8e29c2,_0x1f9384['options']);return _0x2a5b33[_0xd052('0xb1')](_0x8e29c2);}})['then'](function(_0x436e61){if(_0x436e61){_0x541300=_0x436e61[_0xd052('0x60')];if(!_0x1f9384[_0xd052('0x4b')]['hasOwnProperty'](_0xd052('0x51'))){_0x8e29c2[_0xd052('0x34')]=qs[_0xd052('0x34')](_0x1f9384[_0xd052('0x4b')]['limit']);_0x8e29c2[_0xd052('0x35')]=qs['offset'](_0x1f9384[_0xd052('0x4b')][_0xd052('0x35')]);}return _0x2a5b33['getApplications'](_0x8e29c2);}})[_0xd052('0x26')](function(_0x446ff5){if(_0x446ff5){return _0x446ff5?{'count':_0x541300,'rows':_0x446ff5}:null;}})[_0xd052('0x26')](respondWithResult(_0x5b7561,null))[_0xd052('0x30')](handleError(_0x5b7561,null));};exports['getInteractions']=function(_0x435d3d,_0x48097a,_0x526140){var _0xab0725={'raw':![],'where':{}};var _0x161403={};var _0x19f35d={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x435d3d[_0xd052('0x5f')]['id']}})['then'](handleEntityNotFound(_0x48097a,null))[_0xd052('0x26')](function(_0x8119e8){if(_0x8119e8){_0x161403[_0xd052('0x4a')]=_[_0xd052('0x4c')](db['OpenchannelInteraction'][_0xd052('0x46')]);_0x161403[_0xd052('0x4b')]=_[_0xd052('0x4c')](_0x435d3d[_0xd052('0x4b')]);_0x161403[_0xd052('0x55')]=_['intersection'](_0x161403[_0xd052('0x4a')],_0x161403[_0xd052('0x4b')]);_0xab0725[_0xd052('0x4f')]=_[_0xd052('0x4d')](_0x161403[_0xd052('0x4a')],qs['fields'](_0x435d3d[_0xd052('0x4b')][_0xd052('0x4e')]));_0xab0725['attributes']=_0xab0725[_0xd052('0x4f')]['length']?_0xab0725['attributes']:_0x161403[_0xd052('0x4a')];if(!_0x435d3d[_0xd052('0x4b')][_0xd052('0x50')](_0xd052('0x51'))){_0xab0725[_0xd052('0x34')]=qs['limit'](_0x435d3d[_0xd052('0x4b')]['limit']);_0xab0725[_0xd052('0x35')]=qs[_0xd052('0x35')](_0x435d3d['query'][_0xd052('0x35')]);}_0xab0725[_0xd052('0x52')]=qs[_0xd052('0x53')](_0x435d3d[_0xd052('0x4b')][_0xd052('0x53')]);_0xab0725[_0xd052('0x57')]=qs[_0xd052('0x55')](_['pick'](_0x435d3d['query'],_0x161403[_0xd052('0x55')]));_0xab0725[_0xd052('0x57')][_0xd052('0x71')]=_0x8119e8['id'];if(_0x435d3d[_0xd052('0x4b')]['filter']){_0xab0725[_0xd052('0x57')]=_['merge'](_0xab0725['where'],{'$or':_[_0xd052('0x44')](_0xab0725['attributes'],function(_0x58a842){var _0x5ee71a={};_0x5ee71a[_0x58a842]={'$like':'%'+_0x435d3d['query']['filter']+'%'};return _0x5ee71a;})});}_0xab0725=_[_0xd052('0x58')]({},_0xab0725,_0x435d3d[_0xd052('0x61')]);return db[_0xd052('0x97')]['count']({'where':_0xab0725[_0xd052('0x57')]})[_0xd052('0x26')](function(_0x2ca9bd){_0x19f35d[_0xd052('0x36')]=_0x2ca9bd;if(_0x435d3d['query'][_0xd052('0x5a')]){_0xab0725[_0xd052('0x5b')]=[{'model':db[_0xd052('0x78')],'as':_0xd052('0xb2'),'required':![]},{'model':db[_0xd052('0xa6')],'as':_0xd052('0xb3'),'attributes':[_0xd052('0x3f'),_0xd052('0xb4'),_0xd052('0xb5')],'required':![]},{'model':db[_0xd052('0xb6')],'as':'Tags','attributes':['id',_0xd052('0x3f'),_0xd052('0xb7')],'where':_0x435d3d[_0xd052('0x4b')][_0xd052('0xb8')]?{'id':_0x435d3d['query'][_0xd052('0xb8')]}:undefined,'required':_0x435d3d['query'][_0xd052('0xb8')]?!![]:![]}];}return db[_0xd052('0x97')][_0xd052('0x5c')](_0xab0725);})[_0xd052('0x26')](function(_0x35c829){_0x19f35d['rows']=_0x35c829;return _0x19f35d;});}})[_0xd052('0x26')](respondWithFilteredResult(_0x48097a,_0xab0725))[_0xd052('0x30')](handleError(_0x48097a,null));};exports[_0xd052('0xb9')]=function(_0xf7366b,_0x161332,_0x13c0fa){return db[_0xd052('0x45')][_0xd052('0x62')]({'where':{'id':_0xf7366b[_0xd052('0x5f')]['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x161332,null))[_0xd052('0x26')](function(_0x27d206){if(_0x27d206){return _0x27d206[_0xd052('0xb9')](_0xf7366b[_0xd052('0x6b')][_0xd052('0x73')],_['omit'](_0xf7366b[_0xd052('0x6b')],['ids','id'])||{})[_0xd052('0x98')](function(_0x56bf8b){for(var _0x162348=0x0;_0x162348<_0xf7366b[_0xd052('0x6b')]['ids'][_0xd052('0x60')];_0x162348+=0x1){socket[_0xd052('0xba')]('userOpenchannelAccount:save',{'UserId':Number(_0xf7366b[_0xd052('0x6b')][_0xd052('0x73')][_0x162348]),'OpenchannelAccountId':Number(_0xf7366b['params']['id'])});}return _0x56bf8b;});}})[_0xd052('0x26')](respondWithResult(_0x161332,null))[_0xd052('0x30')](handleError(_0x161332,null));};exports[_0xd052('0xbb')]=function(_0x54377f,_0xa19f4,_0x4a12b3){return db[_0xd052('0x45')][_0xd052('0x62')]({'where':{'id':_0x54377f[_0xd052('0x5f')]['id']}})[_0xd052('0x26')](handleEntityNotFound(_0xa19f4,null))[_0xd052('0x26')](function(_0x53e771){if(_0x53e771){return _0x53e771[_0xd052('0xbb')](_0x54377f[_0xd052('0x4b')][_0xd052('0x73')])['then'](function(){if(_[_0xd052('0xbc')](_0x54377f[_0xd052('0x4b')][_0xd052('0x73')])){for(var _0x1204d7=0x0;_0x1204d7<_0x54377f['query'][_0xd052('0x73')][_0xd052('0x60')];_0x1204d7+=0x1){socket[_0xd052('0xba')](_0xd052('0xbd'),{'UserId':Number(_0x54377f['query']['ids'][_0x1204d7]),'OpenchannelAccountId':Number(_0x54377f['params']['id'])});}}else{socket[_0xd052('0xba')](_0xd052('0xbd'),{'UserId':Number(_0x54377f[_0xd052('0x4b')][_0xd052('0x73')]),'OpenchannelAccountId':Number(_0x54377f['params']['id'])});}});}})[_0xd052('0x26')](respondWithStatusCode(_0xa19f4,null))[_0xd052('0x30')](handleError(_0xa19f4,null));};exports['getAgents']=function(_0x37fcce,_0x55a240,_0x56dbb4){var _0x4eddc3={};var _0x35753c={};var _0x5e0cc4;var _0x136929;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x37fcce[_0xd052('0x5f')]['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x55a240,null))['then'](function(_0x1fb092){if(_0x1fb092){_0x5e0cc4=_0x1fb092;_0x35753c[_0xd052('0x4a')]=_[_0xd052('0x4c')](db['User'][_0xd052('0x46')]);_0x35753c[_0xd052('0x4b')]=_['keys'](_0x37fcce['query']);_0x35753c[_0xd052('0x55')]=_[_0xd052('0x4d')](_0x35753c[_0xd052('0x4a')],_0x35753c['query']);_0x4eddc3[_0xd052('0x4f')]=_[_0xd052('0x4d')](_0x35753c[_0xd052('0x4a')],qs[_0xd052('0x4e')](_0x37fcce['query']['fields']));_0x4eddc3[_0xd052('0x4f')]=_0x4eddc3['attributes'][_0xd052('0x60')]?_0x4eddc3['attributes']:_0x35753c[_0xd052('0x4a')];_0x4eddc3[_0xd052('0x52')]=qs[_0xd052('0x53')](_0x37fcce[_0xd052('0x4b')][_0xd052('0x53')]);_0x4eddc3[_0xd052('0x57')]=qs['filters'](_[_0xd052('0x54')](_0x37fcce['query'],_0x35753c['filters']));if(_0x37fcce[_0xd052('0x4b')][_0xd052('0x56')]){_0x4eddc3[_0xd052('0x57')]=_['merge'](_0x4eddc3['where'],{'$or':_['map'](_0x4eddc3[_0xd052('0x4f')],function(_0x54f806){var _0x3547d8={};_0x3547d8[_0x54f806]={'$like':'%'+_0x37fcce[_0xd052('0x4b')]['filter']+'%'};return _0x3547d8;})});}_0x4eddc3=_[_0xd052('0x58')]({},_0x4eddc3,_0x37fcce[_0xd052('0x61')]);return _0x5e0cc4['getAgents'](_0x4eddc3);}})[_0xd052('0x26')](function(_0x582da6){if(_0x582da6){_0x136929=_0x582da6[_0xd052('0x60')];if(!_0x37fcce[_0xd052('0x4b')]['hasOwnProperty'](_0xd052('0x51'))){_0x4eddc3[_0xd052('0x34')]=qs[_0xd052('0x34')](_0x37fcce['query'][_0xd052('0x34')]);_0x4eddc3[_0xd052('0x35')]=qs[_0xd052('0x35')](_0x37fcce[_0xd052('0x4b')][_0xd052('0x35')]);}return _0x5e0cc4[_0xd052('0xbe')](_0x4eddc3);}})[_0xd052('0x26')](function(_0x1e24ec){if(_0x1e24ec){return _0x1e24ec?{'count':_0x136929,'rows':_0x1e24ec}:null;}})['then'](respondWithResult(_0x55a240,null))[_0xd052('0x30')](handleError(_0x55a240,null));};exports[_0xd052('0x40')]=function(_0x137443,_0x3f7f93,_0x4eb9e2){var _0x3853ac,_0x324ce4,_0x190d3c;if(_['isNil'](_0x137443[_0xd052('0x6b')][_0xd052('0x6b')])||_0x137443[_0xd052('0x6b')]['body']===''){throw new db[(_0xd052('0x83'))][(_0xd052('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd052('0x80')](_0x137443[_0xd052('0x6b')]['to'])){}_0x3853ac=_0x137443[_0xd052('0x6b')]['to'];return db['OpenchannelAccount'][_0xd052('0x6f')]({'where':{'id':_0x137443[_0xd052('0x5f')]['id']}})[_0xd052('0x26')](handleEntityNotFound(_0x3f7f93,null))['then'](function(_0x1ae7d4){if(_0x1ae7d4){return db['OpenchannelAccount'][_0xd052('0x62')]({'where':{'id':_0x1ae7d4['id']},'include':[{'model':db[_0xd052('0x88')],'as':'List','include':[{'model':db[_0xd052('0x78')],'as':'Contacts','where':{[_0x1ae7d4['mapKey']]:_0x3853ac},'limit':0x1,'order':[[_0xd052('0x7c'),_0xd052('0x8b')]]}]}]})['then'](handleEntityNotFound(_0x3f7f93,null))[_0xd052('0x26')](function(_0x57f5af){if(_0x57f5af&&_0x57f5af['List']){_0x324ce4=_0x57f5af[_0xd052('0x9c')]({'plain':!![]});if(_0x324ce4[_0xd052('0x89')]&&_0x324ce4[_0xd052('0x89')][_0xd052('0x8a')]['length']){return _0x324ce4[_0xd052('0x89')][_0xd052('0x8a')][0x0];}return db[_0xd052('0x78')][_0xd052('0x63')](_[_0xd052('0x1e')](_0x137443['body'],{'firstName':_0x3853ac,[_0x57f5af[_0xd052('0x85')]]:_0x3853ac,'phone':_0x3853ac,'ListId':_0x324ce4['ListId']}));}})[_0xd052('0x26')](handleEntityNotFound(_0x3f7f93,null))[_0xd052('0x26')](function(_0x332c64){if(_0x332c64){_0x190d3c=_0x332c64;return db[_0xd052('0x97')][_0xd052('0x62')]({'where':{'ContactId':_0x190d3c['id'],'closed':![],'OpenchannelAccountId':_0x324ce4['id']}})[_0xd052('0x26')](function(_0xb1bbc8){if(_0xb1bbc8){return[_0xb1bbc8,![]];}return db[_0xd052('0x97')]['create']({'UserId':_0x137443[_0xd052('0x64')]['id'],'ContactId':_0x190d3c['id'],'OpenchannelAccountId':_0x324ce4['id'],'lastMsgDirection':_0xd052('0xbf'),'Messages':[_[_0xd052('0x58')](_0x137443[_0xd052('0x6b')],{'read':![],'body':_0x137443[_0xd052('0x6b')][_0xd052('0x6b')],'OpenchannelAccountId':_0x324ce4['id'],'UserId':_0x137443[_0xd052('0x64')]['id'],'ContactId':_0x190d3c['id']})]},{'include':[{'model':db[_0xd052('0xa3')],'as':'Messages'}]})[_0xd052('0x26')](function(_0x47dd42){return[_0x47dd42,!![]];});});}})[_0xd052('0x98')](function(_0x506237,_0x34532a){if(_0x34532a){return _0x506237;}return db[_0xd052('0xa3')][_0xd052('0x63')](_[_0xd052('0x58')](_0x137443['body'],{'read':![],'body':_0x137443[_0xd052('0x6b')][_0xd052('0x6b')],'OpenchannelAccountId':_0x324ce4['id'],'OpenchannelInteractionId':_0x506237['id'],'UserId':_0x137443[_0xd052('0x64')]['id'],'ContactId':_0x190d3c['id']}))[_0xd052('0x26')](function(_0x63f424){_0x506237['dataValues'][_0xd052('0xc0')]=[];_0x506237[_0xd052('0xc1')][_0xd052('0xc0')]['push'](_0x63f424[_0xd052('0xc1')]);return _0x506237;});});}})[_0xd052('0x26')](respondWithResult(_0x3f7f93,null))[_0xd052('0x30')](handleError(_0x3f7f93,null));};
\ No newline at end of file
+var _0x0035=['Tag','color','tag','addAgents','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','DESC','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','ejs','fs-extra','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','request','then','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','Pause','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','OpenchannelAccount','includeAll','include','rows','show','rawAttributes','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','mandatoryDispositionPause','describe','addDisposition','OpenchannelAccountId','getDispositions','findOne','Disposition','sort','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','Contacts','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','contact','threadId','externalUrl','ContactId','OpenchannelInteraction','spread','firstName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','sequelize','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal'];(function(_0x47a2d7,_0x1637ef){var _0x3dfeef=function(_0x14b8db){while(--_0x14b8db){_0x47a2d7['push'](_0x47a2d7['shift']());}};_0x3dfeef(++_0x1637ef);}(_0x0035,0xc6));var _0x5003=function(_0x59cda9,_0x47d4c4){_0x59cda9=_0x59cda9-0x0;var _0x26c18f=_0x0035[_0x59cda9];return _0x26c18f;};'use strict';var emlformat=require(_0x5003('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5003('0x1'));var jsonpatch=require(_0x5003('0x2'));var rp=require(_0x5003('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5003('0x4'));var util=require(_0x5003('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5003('0x6'));var fs=require('fs');var fs_extra=require(_0x5003('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5003('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x5003('0x9'));var querystring=require(_0x5003('0xa'));var Papa=require(_0x5003('0xb'));var Redis=require(_0x5003('0xc'));var authService=require(_0x5003('0xd'));var qs=require(_0x5003('0xe'));var as=require(_0x5003('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5003('0x10'));var config=require(_0x5003('0x11'));var licenseUtil=require(_0x5003('0x12'));var db=require(_0x5003('0x13'))['db'];config[_0x5003('0x14')]=_[_0x5003('0x15')](config[_0x5003('0x14')],{'host':_0x5003('0x16'),'port':0x18eb});var socket=require(_0x5003('0x17'))(new Redis(config[_0x5003('0x14')]));require(_0x5003('0x18'))[_0x5003('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5003('0x1a')][_0x5003('0x1b')]({'port':0x232c});var client9002=jayson[_0x5003('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x537eac,_0x21dfe0,_0x378c8e,_0x5c9c15){return new BPromise(function(_0x590f8c,_0x20c231){var _0x31eaa0=_0x5c9c15||client;return _0x31eaa0[_0x5003('0x1c')](_0x537eac,_0x378c8e)[_0x5003('0x1d')](function(_0x153323){logger[_0x5003('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x21dfe0,_0x5003('0x1f'));logger['debug'](_0x5003('0x20'),_0x21dfe0,_0x5003('0x1f'),JSON[_0x5003('0x21')](_0x153323));if(_0x153323['error']){if(_0x153323[_0x5003('0x22')]['code']===0x1f4){logger[_0x5003('0x22')](_0x5003('0x23'),_0x21dfe0,_0x153323[_0x5003('0x22')]['message']);return _0x20c231(_0x153323[_0x5003('0x22')]['message']);}logger[_0x5003('0x22')](_0x5003('0x23'),_0x21dfe0,_0x153323[_0x5003('0x22')][_0x5003('0x24')]);return _0x590f8c(_0x153323[_0x5003('0x22')]['message']);}else{logger[_0x5003('0x1e')]('OpenchannelAccount,\x20%s,\x20%s',_0x21dfe0,'request\x20sent');_0x590f8c(_0x153323['result']['message']);}})[_0x5003('0x25')](function(_0x1aaca8){logger[_0x5003('0x22')](_0x5003('0x23'),_0x21dfe0,_0x1aaca8);_0x20c231(_0x1aaca8);});});}function respondWithStatusCode(_0x53fbf3,_0x211748){_0x211748=_0x211748||0xcc;return function(_0x19154e){if(_0x19154e){return _0x53fbf3[_0x5003('0x26')](_0x211748);}return _0x53fbf3[_0x5003('0x27')](_0x211748)[_0x5003('0x28')]();};}function respondWithResult(_0x223a72,_0x5bf695){_0x5bf695=_0x5bf695||0xc8;return function(_0x3f2227){if(_0x3f2227){return _0x223a72[_0x5003('0x27')](_0x5bf695)[_0x5003('0x29')](_0x3f2227);}};}function respondWithFilteredResult(_0x56764f,_0x16e30c){return function(_0x3b5cb9){if(_0x3b5cb9){var _0x10932d=typeof _0x16e30c[_0x5003('0x2a')]===_0x5003('0x2b')&&typeof _0x16e30c[_0x5003('0x2c')]==='undefined';var _0xdd4b8e=_0x3b5cb9[_0x5003('0x2d')];var _0x472412=_0x10932d?0x0:_0x16e30c['offset'];var _0x2f915c=_0x10932d?_0x3b5cb9[_0x5003('0x2d')]:_0x16e30c[_0x5003('0x2a')]+_0x16e30c[_0x5003('0x2c')];var _0x29a41a;if(_0x2f915c>=_0xdd4b8e){_0x2f915c=_0xdd4b8e;_0x29a41a=0xc8;}else{_0x29a41a=0xce;}_0x56764f[_0x5003('0x27')](_0x29a41a);return _0x56764f[_0x5003('0x2e')](_0x5003('0x2f'),_0x472412+'-'+_0x2f915c+'/'+_0xdd4b8e)[_0x5003('0x29')](_0x3b5cb9);}return null;};}function patchUpdates(_0x6faea1){return function(_0x13634b){try{jsonpatch[_0x5003('0x30')](_0x13634b,_0x6faea1,!![]);}catch(_0x5bcb2d){return BPromise[_0x5003('0x31')](_0x5bcb2d);}return _0x13634b['save']();};}function saveUpdates(_0x8d3f91,_0x257edf){return function(_0x17e121){if(_0x17e121){return _0x17e121[_0x5003('0x32')](_0x8d3f91)['then'](function(_0x3d44a6){return _0x3d44a6;});}return null;};}function removeEntity(_0x12e571,_0x24f6a5){return function(_0x3fbdd9){if(_0x3fbdd9){return _0x3fbdd9[_0x5003('0x33')]()['then'](function(){var _0x441f78=_0x3fbdd9[_0x5003('0x34')]({'plain':!![]});var _0x222e0c=_0x5003('0x35');return db[_0x5003('0x36')][_0x5003('0x33')]({'where':{'type':_0x222e0c,'resourceId':_0x441f78['id']}})[_0x5003('0x1d')](function(){return _0x3fbdd9;});})['then'](function(){_0x12e571[_0x5003('0x27')](0xcc)[_0x5003('0x28')]();});}};}function handleEntityNotFound(_0x3d63cc,_0x59699c){return function(_0x3e8b9b){if(!_0x3e8b9b){_0x3d63cc[_0x5003('0x26')](0x194);}return _0x3e8b9b;};}function handleError(_0x15bc9a,_0x42001e){_0x42001e=_0x42001e||0x1f4;return function(_0x4298e2){logger[_0x5003('0x22')](_0x4298e2[_0x5003('0x37')]);if(_0x4298e2[_0x5003('0x38')]){delete _0x4298e2[_0x5003('0x38')];}_0x15bc9a['status'](_0x42001e)[_0x5003('0x39')](_0x4298e2);};}exports['index']=function(_0x24a47b,_0x56ba5f){var _0x31379c={'include':[{'model':db[_0x5003('0x3a')],'as':'mandatoryDispositionPause'}]},_0x595b30={},_0x5ceb7b={'count':0x0,'rows':[]};var _0x59445f=_[_0x5003('0x3b')](db['OpenchannelAccount']['rawAttributes'],function(_0x5d9a56){return{'name':_0x5d9a56[_0x5003('0x3c')],'type':_0x5d9a56[_0x5003('0x3d')]['key']};});_0x595b30[_0x5003('0x3e')]=_[_0x5003('0x3b')](_0x59445f,_0x5003('0x38'));_0x595b30[_0x5003('0x3f')]=_[_0x5003('0x40')](_0x24a47b[_0x5003('0x3f')]);_0x595b30[_0x5003('0x41')]=_[_0x5003('0x42')](_0x595b30[_0x5003('0x3e')],_0x595b30[_0x5003('0x3f')]);_0x31379c[_0x5003('0x43')]=_[_0x5003('0x42')](_0x595b30[_0x5003('0x3e')],qs['fields'](_0x24a47b[_0x5003('0x3f')][_0x5003('0x44')]));_0x31379c[_0x5003('0x43')]=_0x31379c[_0x5003('0x43')][_0x5003('0x45')]?_0x31379c[_0x5003('0x43')]:_0x595b30[_0x5003('0x3e')];if(!_0x24a47b[_0x5003('0x3f')][_0x5003('0x46')](_0x5003('0x47'))){_0x31379c[_0x5003('0x2c')]=qs[_0x5003('0x2c')](_0x24a47b['query'][_0x5003('0x2c')]);_0x31379c['offset']=qs[_0x5003('0x2a')](_0x24a47b[_0x5003('0x3f')]['offset']);}_0x31379c[_0x5003('0x48')]=qs['sort'](_0x24a47b[_0x5003('0x3f')]['sort']);_0x31379c[_0x5003('0x49')]=qs[_0x5003('0x41')](_[_0x5003('0x4a')](_0x24a47b[_0x5003('0x3f')],_0x595b30[_0x5003('0x41')]),_0x59445f);if(_0x24a47b['query'][_0x5003('0x4b')]){_0x31379c[_0x5003('0x49')]=_[_0x5003('0x4c')](_0x31379c[_0x5003('0x49')],{'$or':_[_0x5003('0x3b')](_0x59445f,function(_0x6ee620){if(_0x6ee620[_0x5003('0x3d')]!==_0x5003('0x4d')){var _0x326017={};_0x326017[_0x6ee620['name']]={'$like':'%'+_0x24a47b[_0x5003('0x3f')][_0x5003('0x4b')]+'%'};return _0x326017;}})});}_0x31379c=_[_0x5003('0x4c')]({},_0x31379c,_0x24a47b[_0x5003('0x4e')]);var _0x2d0cb0={'where':_0x31379c[_0x5003('0x49')]};return db[_0x5003('0x4f')][_0x5003('0x2d')](_0x2d0cb0)[_0x5003('0x1d')](function(_0x447032){_0x5ceb7b['count']=_0x447032;if(_0x24a47b[_0x5003('0x3f')][_0x5003('0x50')]){_0x31379c[_0x5003('0x51')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x31379c);})[_0x5003('0x1d')](function(_0xefd9f6){_0x5ceb7b[_0x5003('0x52')]=_0xefd9f6;return _0x5ceb7b;})[_0x5003('0x1d')](respondWithFilteredResult(_0x56ba5f,_0x31379c))[_0x5003('0x25')](handleError(_0x56ba5f,null));};exports[_0x5003('0x53')]=function(_0xebe26,_0x15c030){var _0x427eee={'raw':![],'where':{'id':_0xebe26['params']['id']},'include':[{'model':db[_0x5003('0x3a')],'as':'mandatoryDispositionPause'}]},_0x1a1ac8={};_0x1a1ac8[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x4f')][_0x5003('0x54')]);_0x1a1ac8['query']=_['keys'](_0xebe26[_0x5003('0x3f')]);_0x1a1ac8[_0x5003('0x41')]=_[_0x5003('0x42')](_0x1a1ac8['model'],_0x1a1ac8['query']);_0x427eee['attributes']=_[_0x5003('0x42')](_0x1a1ac8[_0x5003('0x3e')],qs[_0x5003('0x44')](_0xebe26['query'][_0x5003('0x44')]));_0x427eee['attributes']=_0x427eee['attributes'][_0x5003('0x45')]?_0x427eee[_0x5003('0x43')]:_0x1a1ac8[_0x5003('0x3e')];if(_0xebe26[_0x5003('0x3f')][_0x5003('0x50')]){_0x427eee[_0x5003('0x51')]=[{'all':!![]}];}_0x427eee=_[_0x5003('0x4c')]({},_0x427eee,_0xebe26[_0x5003('0x4e')]);return db[_0x5003('0x4f')]['find'](_0x427eee)[_0x5003('0x1d')](handleEntityNotFound(_0x15c030,null))[_0x5003('0x1d')](respondWithResult(_0x15c030,null))[_0x5003('0x25')](handleError(_0x15c030,null));};exports[_0x5003('0x55')]=function(_0x36e24f,_0x513dbd){return db['OpenchannelAccount'][_0x5003('0x55')](_0x36e24f[_0x5003('0x56')],{})[_0x5003('0x1d')](function(_0x3f0051){var _0x5c8e19=_0x36e24f[_0x5003('0x57')][_0x5003('0x34')]({'plain':!![]});if(!_0x5c8e19)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c8e19['role']==='user'){var _0x287867=_0x3f0051[_0x5003('0x34')]({'plain':!![]});var _0x487eed=_0x5003('0x35');return db[_0x5003('0x58')][_0x5003('0x59')]({'where':{'name':_0x487eed,'userProfileId':_0x5c8e19[_0x5003('0x5a')]},'raw':!![]})[_0x5003('0x1d')](function(_0x517f4b){if(_0x517f4b&&_0x517f4b[_0x5003('0x5b')]===0x0){return db[_0x5003('0x36')][_0x5003('0x55')]({'name':_0x287867['name'],'resourceId':_0x287867['id'],'type':_0x517f4b[_0x5003('0x38')],'sectionId':_0x517f4b['id']},{})['then'](function(){return _0x3f0051;});}else{return _0x3f0051;}})[_0x5003('0x25')](function(_0x321327){logger['error'](_0x5003('0x5c'),_0x321327);throw _0x321327;});}return _0x3f0051;})[_0x5003('0x1d')](respondWithResult(_0x513dbd,0xc9))[_0x5003('0x25')](handleError(_0x513dbd,null));};exports[_0x5003('0x32')]=function(_0x256dbd,_0x38e0aa){if(_0x256dbd[_0x5003('0x56')]['id']){delete _0x256dbd['body']['id'];}return db[_0x5003('0x4f')]['find']({'where':{'id':_0x256dbd[_0x5003('0x5d')]['id']},'include':[{'model':db[_0x5003('0x3a')],'as':_0x5003('0x5e')}]})[_0x5003('0x1d')](handleEntityNotFound(_0x38e0aa,null))['then'](saveUpdates(_0x256dbd[_0x5003('0x56')],null))['then'](respondWithResult(_0x38e0aa,null))[_0x5003('0x25')](handleError(_0x38e0aa,null));};exports[_0x5003('0x33')]=function(_0x13f72c,_0x277e54){return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x13f72c[_0x5003('0x5d')]['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x277e54,null))[_0x5003('0x1d')](removeEntity(_0x277e54,null))[_0x5003('0x25')](handleError(_0x277e54,null));};exports[_0x5003('0x5f')]=function(_0x47da7c,_0x3a81a3){return db[_0x5003('0x4f')][_0x5003('0x5f')]()['then'](respondWithResult(_0x3a81a3,null))[_0x5003('0x25')](handleError(_0x3a81a3,null));};exports[_0x5003('0x60')]=function(_0x576760,_0x342a13,_0x329beb){if(_0x576760[_0x5003('0x56')]['id']){delete _0x576760[_0x5003('0x56')]['id'];}return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x576760[_0x5003('0x5d')]['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x342a13,null))[_0x5003('0x1d')](function(_0x5a8033){if(_0x5a8033){_0x576760[_0x5003('0x56')][_0x5003('0x61')]=_0x5a8033['id'];return db['Disposition'][_0x5003('0x55')](_0x576760[_0x5003('0x56')]);}})[_0x5003('0x1d')](respondWithResult(_0x342a13,null))[_0x5003('0x25')](handleError(_0x342a13,null));};exports[_0x5003('0x62')]=function(_0x38cc9a,_0x3be448,_0x313704){var _0x3b398c={'raw':![],'where':{}};var _0x331ea5={};var _0x1cca21={'count':0x0,'rows':[]};return db[_0x5003('0x4f')][_0x5003('0x63')]({'where':{'id':_0x38cc9a[_0x5003('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3be448,null))[_0x5003('0x1d')](function(_0x2c5a2f){if(_0x2c5a2f){_0x331ea5[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x64')][_0x5003('0x54')]);_0x331ea5[_0x5003('0x3f')]=_[_0x5003('0x40')](_0x38cc9a[_0x5003('0x3f')]);_0x331ea5['filters']=_[_0x5003('0x42')](_0x331ea5[_0x5003('0x3e')],_0x331ea5[_0x5003('0x3f')]);_0x3b398c['attributes']=_[_0x5003('0x42')](_0x331ea5[_0x5003('0x3e')],qs[_0x5003('0x44')](_0x38cc9a['query']['fields']));_0x3b398c[_0x5003('0x43')]=_0x3b398c[_0x5003('0x43')][_0x5003('0x45')]?_0x3b398c[_0x5003('0x43')]:_0x331ea5[_0x5003('0x3e')];if(!_0x38cc9a['query']['hasOwnProperty']('nolimit')){_0x3b398c['limit']=qs[_0x5003('0x2c')](_0x38cc9a[_0x5003('0x3f')][_0x5003('0x2c')]);_0x3b398c[_0x5003('0x2a')]=qs[_0x5003('0x2a')](_0x38cc9a[_0x5003('0x3f')]['offset']);}_0x3b398c[_0x5003('0x48')]=qs['sort'](_0x38cc9a[_0x5003('0x3f')][_0x5003('0x65')]);_0x3b398c['where']=qs[_0x5003('0x41')](_['pick'](_0x38cc9a[_0x5003('0x3f')],_0x331ea5['filters']));_0x3b398c[_0x5003('0x49')][_0x5003('0x61')]=_0x2c5a2f['id'];if(_0x38cc9a[_0x5003('0x3f')][_0x5003('0x4b')]){_0x3b398c[_0x5003('0x49')]=_[_0x5003('0x4c')](_0x3b398c[_0x5003('0x49')],{'$or':_[_0x5003('0x3b')](_0x3b398c[_0x5003('0x43')],function(_0xde5275){var _0x36370e={};_0x36370e[_0xde5275]={'$like':'%'+_0x38cc9a[_0x5003('0x3f')][_0x5003('0x4b')]+'%'};return _0x36370e;})});}_0x3b398c=_[_0x5003('0x4c')]({},_0x3b398c,_0x38cc9a['options']);return db[_0x5003('0x64')][_0x5003('0x2d')]({'where':_0x3b398c[_0x5003('0x49')]})[_0x5003('0x1d')](function(_0x4c81bb){_0x1cca21[_0x5003('0x2d')]=_0x4c81bb;if(_0x38cc9a[_0x5003('0x3f')][_0x5003('0x50')]){_0x3b398c[_0x5003('0x51')]=[{'all':!![]}];}return db[_0x5003('0x64')]['findAll'](_0x3b398c);})[_0x5003('0x1d')](function(_0x5d583a){_0x1cca21[_0x5003('0x52')]=_0x5d583a;return _0x1cca21;});}})[_0x5003('0x1d')](respondWithFilteredResult(_0x3be448,_0x3b398c))['catch'](handleError(_0x3be448,null));};exports[_0x5003('0x66')]=function(_0x19aba6,_0x24b0ce,_0xc101bd){return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x19aba6[_0x5003('0x5d')]['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x24b0ce,null))['then'](function(_0x44d8ff){if(_0x44d8ff){return _0x44d8ff['removeDispositions'](_0x19aba6[_0x5003('0x3f')][_0x5003('0x67')]);}})[_0x5003('0x1d')](respondWithStatusCode(_0x24b0ce,null))[_0x5003('0x25')](handleError(_0x24b0ce,null));};exports[_0x5003('0x68')]=function(_0x14c10f,_0x12f776,_0x4837c4){if(_0x14c10f[_0x5003('0x56')]['id']){delete _0x14c10f[_0x5003('0x56')]['id'];}return db[_0x5003('0x4f')]['find']({'where':{'id':_0x14c10f['params']['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x12f776,null))[_0x5003('0x1d')](function(_0x74d915){if(_0x74d915){_0x14c10f[_0x5003('0x56')][_0x5003('0x61')]=_0x74d915['id'];return db[_0x5003('0x69')][_0x5003('0x55')](_0x14c10f[_0x5003('0x56')]);}})['then'](respondWithResult(_0x12f776,null))[_0x5003('0x25')](handleError(_0x12f776,null));};exports[_0x5003('0x6a')]=function(_0x41ec35,_0x19dc5b,_0x18f545){var _0xd43ead={'raw':![],'where':{}};var _0x4ccbc5={};var _0xe9693a={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x5003('0x63')]({'where':{'id':_0x41ec35['params']['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x19dc5b,null))[_0x5003('0x1d')](function(_0x544ccd){if(_0x544ccd){_0x4ccbc5[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x69')]['rawAttributes']);_0x4ccbc5[_0x5003('0x3f')]=_[_0x5003('0x40')](_0x41ec35[_0x5003('0x3f')]);_0x4ccbc5['filters']=_[_0x5003('0x42')](_0x4ccbc5[_0x5003('0x3e')],_0x4ccbc5[_0x5003('0x3f')]);_0xd43ead[_0x5003('0x43')]=_[_0x5003('0x42')](_0x4ccbc5['model'],qs[_0x5003('0x44')](_0x41ec35[_0x5003('0x3f')]['fields']));_0xd43ead['attributes']=_0xd43ead[_0x5003('0x43')][_0x5003('0x45')]?_0xd43ead[_0x5003('0x43')]:_0x4ccbc5['model'];if(!_0x41ec35[_0x5003('0x3f')]['hasOwnProperty'](_0x5003('0x47'))){_0xd43ead[_0x5003('0x2c')]=qs[_0x5003('0x2c')](_0x41ec35[_0x5003('0x3f')][_0x5003('0x2c')]);_0xd43ead[_0x5003('0x2a')]=qs[_0x5003('0x2a')](_0x41ec35[_0x5003('0x3f')]['offset']);}_0xd43ead[_0x5003('0x48')]=qs['sort'](_0x41ec35[_0x5003('0x3f')][_0x5003('0x65')]);_0xd43ead[_0x5003('0x49')]=qs[_0x5003('0x41')](_[_0x5003('0x4a')](_0x41ec35[_0x5003('0x3f')],_0x4ccbc5['filters']));_0xd43ead['where'][_0x5003('0x61')]=_0x544ccd['id'];if(_0x41ec35[_0x5003('0x3f')][_0x5003('0x4b')]){_0xd43ead[_0x5003('0x49')]=_['merge'](_0xd43ead[_0x5003('0x49')],{'$or':_[_0x5003('0x3b')](_0xd43ead['attributes'],function(_0xcb3af2){var _0x303eb4={};_0x303eb4[_0xcb3af2]={'$like':'%'+_0x41ec35[_0x5003('0x3f')][_0x5003('0x4b')]+'%'};return _0x303eb4;})});}_0xd43ead=_[_0x5003('0x4c')]({},_0xd43ead,_0x41ec35[_0x5003('0x4e')]);return db[_0x5003('0x69')][_0x5003('0x2d')]({'where':_0xd43ead['where']})[_0x5003('0x1d')](function(_0x55bc87){_0xe9693a[_0x5003('0x2d')]=_0x55bc87;if(_0x41ec35[_0x5003('0x3f')][_0x5003('0x50')]){_0xd43ead[_0x5003('0x51')]=[{'all':!![]}];}return db[_0x5003('0x69')][_0x5003('0x6b')](_0xd43ead);})[_0x5003('0x1d')](function(_0x145dba){_0xe9693a['rows']=_0x145dba;return _0xe9693a;});}})[_0x5003('0x1d')](respondWithFilteredResult(_0x19dc5b,_0xd43ead))[_0x5003('0x25')](handleError(_0x19dc5b,null));};exports[_0x5003('0x6c')]=function(_0x5e65f4,_0x4f7741,_0x14d2f5){return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x5e65f4[_0x5003('0x5d')]['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x4f7741,null))[_0x5003('0x1d')](function(_0x3ac144){if(_0x3ac144){return _0x3ac144[_0x5003('0x6c')](_0x5e65f4[_0x5003('0x3f')][_0x5003('0x67')]);}})[_0x5003('0x1d')](respondWithStatusCode(_0x4f7741,null))[_0x5003('0x25')](handleError(_0x4f7741,null));};exports['notify']=function(_0x3272f2,_0xb67a69,_0x34e22c){var _0x2a9d81={'body':_0x3272f2[_0x5003('0x56')],'channel':_0x5003('0x6d')};var _0x19ed15=[];var _0x5d7f5f=[];var _0x16caa4={};var _0x350fbd=![];return db[_0x5003('0x6e')][_0x5003('0x5f')]()['then'](function(_0x46c8d8){if(!_0x46c8d8){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))](_0x5003('0x71'));}_0x19ed15=_[_0x5003('0x72')](_[_0x5003('0x40')](_0x46c8d8),[_0x5003('0x73'),_0x5003('0x74')]);_0x5d7f5f=_[_0x5003('0x72')](_['keys'](_0x46c8d8),['createdAt',_0x5003('0x74'),_0x5003('0x75'),_0x5003('0x76')]);if(_0x3272f2[_0x5003('0x56')]['id']){delete _0x3272f2[_0x5003('0x56')]['id'];}if(_['isNil'](_0x3272f2['body']['from'])){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))](_0x5003('0x77'));}if(_['isNil'](_0x3272f2[_0x5003('0x56')][_0x5003('0x56')])||_0x3272f2[_0x5003('0x56')][_0x5003('0x56')]===''){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5003('0x78')](_0x3272f2[_0x5003('0x56')][_0x5003('0x79')])){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))](_0x5003('0x7a')+_0x5d7f5f);}if(!_[_0x5003('0x7b')](_0x5d7f5f,_0x3272f2[_0x5003('0x56')]['mapKey'])){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5d7f5f);}_0x16caa4[_0x3272f2[_0x5003('0x56')]['mapKey']]=_0x3272f2[_0x5003('0x56')][_0x5003('0x7c')];})[_0x5003('0x1d')](function(){return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x3272f2[_0x5003('0x5d')]['id']},'include':[{'model':db[_0x5003('0x7d')],'as':_0x5003('0x7e'),'include':[{'model':db[_0x5003('0x6e')],'as':_0x5003('0x7f'),'where':_0x16caa4,'limit':0x1,'order':[[_0x5003('0x74'),'DESC']]}]},{'model':db[_0x5003('0x80')],'as':_0x5003('0x81')}]});})[_0x5003('0x1d')](handleEntityNotFound(_0xb67a69,null))[_0x5003('0x1d')](function(_0x18c8d0){if(_0x18c8d0&&_0x18c8d0['List']){_0x2a9d81[_0x5003('0x82')]=_0x18c8d0;_0x2a9d81[_0x5003('0x83')]=_0x18c8d0[_0x5003('0x81')];_0x2a9d81[_0x5003('0x84')]=_0x18c8d0[_0x5003('0x7e')];_0x2a9d81[_0x5003('0x83')]=_[_0x5003('0x85')](_0x2a9d81[_0x5003('0x83')],[_0x5003('0x86')],['asc']);if(_0x2a9d81['account'][_0x5003('0x81')]){delete _0x2a9d81['account'][_0x5003('0x81')];}if(_0x2a9d81[_0x5003('0x82')][_0x5003('0x7e')]&&_0x2a9d81[_0x5003('0x82')][_0x5003('0x7e')][_0x5003('0x7f')]['length']){return _0x2a9d81[_0x5003('0x82')][_0x5003('0x7e')][_0x5003('0x7f')][0x0];}var _0x5e122d=_[_0x5003('0x15')](_0x3272f2['body'],{'firstName':_0x3272f2[_0x5003('0x56')][_0x5003('0x7c')],'ListId':_0x18c8d0[_0x5003('0x76')]});_0x5e122d[_0x3272f2[_0x5003('0x56')][_0x5003('0x79')]]=_0x3272f2[_0x5003('0x56')][_0x5003('0x7c')];return db['CmContact'][_0x5003('0x55')](_0x5e122d,{'fields':_0x19ed15,'raw':!![]});}})['then'](handleEntityNotFound(_0xb67a69,null))['then'](function(_0x8e9e08){_0x2a9d81[_0x5003('0x87')]=_0x8e9e08;if(_0x8e9e08){var _0x265305={'ContactId':_0x8e9e08['id'],'OpenchannelAccountId':_0x3272f2[_0x5003('0x5d')]['id'],'from':(_0x8e9e08['firstName']||'')+'\x20'+(_0x8e9e08['lastName']||'')};var _0x5ad027={'OpenchannelAccountId':_0x3272f2[_0x5003('0x5d')]['id'],'closed':![]};if(_0x3272f2[_0x5003('0x56')][_0x5003('0x88')]){_0x5ad027['threadId']=_0x3272f2[_0x5003('0x56')][_0x5003('0x88')];return db['OpenchannelInteraction'][_0x5003('0x59')]({'where':_0x5ad027})[_0x5003('0x1d')](function(_0x6de58e){if(_0x6de58e){return[_0x6de58e,![]];}_0x265305['threadId']=_0x3272f2[_0x5003('0x56')][_0x5003('0x88')];_0x265305[_0x5003('0x89')]=_0x3272f2[_0x5003('0x56')][_0x5003('0x89')];return db['OpenchannelInteraction'][_0x5003('0x55')](_0x265305)[_0x5003('0x1d')](function(_0x560c4d){return[_0x560c4d,!![]];});});}else{_0x5ad027[_0x5003('0x88')]=null;}_0x5ad027[_0x5003('0x8a')]=_0x8e9e08['id'];return db[_0x5003('0x8b')][_0x5003('0x59')]({'where':_0x5ad027})[_0x5003('0x1d')](function(_0x4e94eb){if(_0x4e94eb){return[_0x4e94eb,![]];}return db[_0x5003('0x8b')][_0x5003('0x55')](_0x265305)[_0x5003('0x1d')](function(_0x1f1b01){return[_0x1f1b01,!![]];});});}})[_0x5003('0x8c')](function(_0x45a430,_0x42a3b4){if(_0x45a430){_0x350fbd=_0x42a3b4;if(!_0x42a3b4){var _0x2d3f3d={'from':(_0x2a9d81['contact'][_0x5003('0x8d')]||'')+'\x20'+(_0x2a9d81['contact']['lastName']||'')};if(_0x3272f2['body'][_0x5003('0x88')]&&_0x3272f2[_0x5003('0x56')]['messageId']&&_0x3272f2[_0x5003('0x56')][_0x5003('0x88')]!=_0x3272f2[_0x5003('0x56')]['messageId']){_0x2d3f3d[_0x5003('0x88')]=_0x3272f2[_0x5003('0x56')][_0x5003('0x8e')];}return _0x45a430[_0x5003('0x32')](_0x2d3f3d);}else{return _0x45a430;}}})[_0x5003('0x1d')](function(_0x317f11){_0x2a9d81['interaction']=_0x317f11[_0x5003('0x34')]({'plain':!![]});_0x2a9d81[_0x5003('0x8f')][_0x5003('0x90')]=_0x350fbd;if(_0x2a9d81[_0x5003('0x8f')][_0x5003('0x90')]){if(_0x2a9d81[_0x5003('0x82')][_0x5003('0x91')]){_0x2a9d81[_0x5003('0x83')][_0x5003('0x92')]({'id':0x0,'priority':_0x2a9d81[_0x5003('0x83')][_0x5003('0x45')]+0x1,'app':_0x5003('0x93'),'appdata':_0x5003('0x94'),'interval':_0x5003('0x95')});}}return db[_0x5003('0x96')][_0x5003('0x55')]({'body':_0x3272f2[_0x5003('0x56')][_0x5003('0x56')],'OpenchannelAccountId':_0x3272f2[_0x5003('0x5d')]['id'],'OpenchannelInteractionId':_0x317f11['id'],'direction':'in','ContactId':_0x2a9d81[_0x5003('0x87')]['id'],'AttachmentId':_0x3272f2[_0x5003('0x56')][_0x5003('0x97')]});})[_0x5003('0x1d')](function(_0x53bd95){_0x2a9d81[_0x5003('0x24')]=_0x53bd95;if(_0x2a9d81['interaction'][_0x5003('0x98')]){return db[_0x5003('0x99')][_0x5003('0x59')]({'attributes':['id',_0x5003('0x38')],'where':{'id':_0x2a9d81[_0x5003('0x8f')][_0x5003('0x98')]}})[_0x5003('0x1d')](function(_0x2676b5){if(_0x2676b5){_0x2a9d81[_0x5003('0x83')][_0x5003('0x9a')]({'id':0x0,'priority':0x0,'app':_0x5003('0x9b'),'appdata':_0x2676b5['name']+','+(_0x2a9d81[_0x5003('0x82')][_0x5003('0x9c')]||0xa),'interval':'*,*,*,*'});_0x2a9d81[_0x5003('0x9d')]=![];}return respondWithRpcPromise(_0x5003('0x9e'),_0x5003('0x9f'),_0x2a9d81);});}return respondWithRpcPromise(_0x5003('0x9e'),_0x5003('0x9f'),_0x2a9d81);})[_0x5003('0x1d')](function(_0x5201f1){respondWithRpcPromise(_0x5003('0xa0'),_0x5003('0xa0'),{'event':_0x5003('0xa1'),'message':_0x5201f1},client9002);return _0x5201f1;})['then'](respondWithResult(_0xb67a69,null))[_0x5003('0x25')](handleError(_0xb67a69,null));};exports[_0x5003('0xa2')]=function(_0x30af5b,_0x444b4c,_0xe57311){return db[_0x5003('0x4f')][_0x5003('0x63')]({'where':{'id':_0x30af5b[_0x5003('0x5d')]['id']}})['then'](handleEntityNotFound(_0x444b4c,null))['then'](function(_0x57d04f){if(_0x57d04f){return db[_0x5003('0xa3')]['transaction'](function(_0x276117){return db[_0x5003('0x80')]['destroy']({'where':{'OpenchannelAccountId':_0x30af5b['params']['id']},'transaction':_0x276117})[_0x5003('0x1d')](function(_0x59d08f){var _0x16ccae=_[_0x5003('0x3b')](_0x30af5b[_0x5003('0x56')],function(_0x300578){_0x300578[_0x5003('0x61')]=_0x30af5b[_0x5003('0x5d')]['id'];return _0x300578;});return db[_0x5003('0x80')][_0x5003('0xa4')](_0x16ccae,{'transaction':_0x276117});});})[_0x5003('0x1d')](function(){return db[_0x5003('0x80')][_0x5003('0xa5')]({'where':{'OpenchannelAccountId':_0x30af5b[_0x5003('0x5d')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x444b4c,null))[_0x5003('0x25')](handleError(_0x444b4c,null));};exports['getApplications']=function(_0x455694,_0x1f5bcf,_0x393fbe){var _0x5c0e95={};var _0x55601f={};var _0x23d6fc;var _0x56e61d;return db[_0x5003('0x4f')][_0x5003('0x63')]({'where':{'id':_0x455694['params']['id']}})['then'](handleEntityNotFound(_0x1f5bcf,null))[_0x5003('0x1d')](function(_0x1c544c){if(_0x1c544c){_0x23d6fc=_0x1c544c;_0x55601f[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x80')]['rawAttributes']);_0x55601f[_0x5003('0x3f')]=_[_0x5003('0x40')](_0x455694[_0x5003('0x3f')]);_0x55601f[_0x5003('0x41')]=_['intersection'](_0x55601f[_0x5003('0x3e')],_0x55601f[_0x5003('0x3f')]);_0x5c0e95['attributes']=_[_0x5003('0x42')](_0x55601f[_0x5003('0x3e')],qs[_0x5003('0x44')](_0x455694['query']['fields']));_0x5c0e95['attributes']=_0x5c0e95[_0x5003('0x43')]['length']?_0x5c0e95[_0x5003('0x43')]:_0x55601f[_0x5003('0x3e')];_0x5c0e95[_0x5003('0x48')]=qs[_0x5003('0x65')](_0x455694[_0x5003('0x3f')][_0x5003('0x65')]);_0x5c0e95[_0x5003('0x49')]=qs[_0x5003('0x41')](_[_0x5003('0x4a')](_0x455694[_0x5003('0x3f')],_0x55601f[_0x5003('0x41')]));if(_0x455694['query'][_0x5003('0x4b')]){_0x5c0e95[_0x5003('0x49')]=_[_0x5003('0x4c')](_0x5c0e95['where'],{'$or':_[_0x5003('0x3b')](_0x5c0e95[_0x5003('0x43')],function(_0x4c940a){var _0x4f2fbc={};_0x4f2fbc[_0x4c940a]={'$like':'%'+_0x455694[_0x5003('0x3f')][_0x5003('0x4b')]+'%'};return _0x4f2fbc;})});}_0x5c0e95=_[_0x5003('0x4c')]({},_0x5c0e95,_0x455694[_0x5003('0x4e')]);return _0x23d6fc[_0x5003('0xa6')](_0x5c0e95);}})[_0x5003('0x1d')](function(_0x415cc1){if(_0x415cc1){_0x56e61d=_0x415cc1[_0x5003('0x45')];if(!_0x455694[_0x5003('0x3f')]['hasOwnProperty']('nolimit')){_0x5c0e95[_0x5003('0x2c')]=qs[_0x5003('0x2c')](_0x455694['query']['limit']);_0x5c0e95[_0x5003('0x2a')]=qs[_0x5003('0x2a')](_0x455694[_0x5003('0x3f')]['offset']);}return _0x23d6fc[_0x5003('0xa6')](_0x5c0e95);}})[_0x5003('0x1d')](function(_0x87017e){if(_0x87017e){return _0x87017e?{'count':_0x56e61d,'rows':_0x87017e}:null;}})[_0x5003('0x1d')](respondWithResult(_0x1f5bcf,null))[_0x5003('0x25')](handleError(_0x1f5bcf,null));};exports[_0x5003('0xa7')]=function(_0x18756b,_0x23d0dd,_0x11d161){var _0x102989={'raw':![],'where':{}};var _0x56c551={};var _0x3fd016={'count':0x0,'rows':[]};return db[_0x5003('0x4f')][_0x5003('0x63')]({'where':{'id':_0x18756b[_0x5003('0x5d')]['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x23d0dd,null))[_0x5003('0x1d')](function(_0x17cfaa){if(_0x17cfaa){_0x56c551[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x8b')][_0x5003('0x54')]);_0x56c551['query']=_['keys'](_0x18756b[_0x5003('0x3f')]);_0x56c551[_0x5003('0x41')]=_[_0x5003('0x42')](_0x56c551[_0x5003('0x3e')],_0x56c551[_0x5003('0x3f')]);_0x102989[_0x5003('0x43')]=_[_0x5003('0x42')](_0x56c551['model'],qs['fields'](_0x18756b[_0x5003('0x3f')][_0x5003('0x44')]));_0x102989['attributes']=_0x102989[_0x5003('0x43')]['length']?_0x102989['attributes']:_0x56c551['model'];if(!_0x18756b[_0x5003('0x3f')][_0x5003('0x46')](_0x5003('0x47'))){_0x102989['limit']=qs[_0x5003('0x2c')](_0x18756b['query']['limit']);_0x102989['offset']=qs[_0x5003('0x2a')](_0x18756b['query'][_0x5003('0x2a')]);}_0x102989[_0x5003('0x48')]=qs[_0x5003('0x65')](_0x18756b[_0x5003('0x3f')][_0x5003('0x65')]);_0x102989[_0x5003('0x49')]=qs[_0x5003('0x41')](_[_0x5003('0x4a')](_0x18756b[_0x5003('0x3f')],_0x56c551[_0x5003('0x41')]));_0x102989[_0x5003('0x49')][_0x5003('0x61')]=_0x17cfaa['id'];if(_0x18756b[_0x5003('0x3f')][_0x5003('0x4b')]){_0x102989[_0x5003('0x49')]=_[_0x5003('0x4c')](_0x102989[_0x5003('0x49')],{'$or':_[_0x5003('0x3b')](_0x102989[_0x5003('0x43')],function(_0x526f45){var _0xe5ab0f={};_0xe5ab0f[_0x526f45]={'$like':'%'+_0x18756b[_0x5003('0x3f')][_0x5003('0x4b')]+'%'};return _0xe5ab0f;})});}_0x102989=_['merge']({},_0x102989,_0x18756b[_0x5003('0x4e')]);return db[_0x5003('0x8b')][_0x5003('0x2d')]({'where':_0x102989['where']})[_0x5003('0x1d')](function(_0x53dc86){_0x3fd016[_0x5003('0x2d')]=_0x53dc86;if(_0x18756b[_0x5003('0x3f')][_0x5003('0x50')]){_0x102989[_0x5003('0x51')]=[{'model':db[_0x5003('0x6e')],'as':_0x5003('0xa8'),'required':![]},{'model':db['User'],'as':_0x5003('0xa9'),'attributes':['name',_0x5003('0xaa'),_0x5003('0xab')],'required':![]},{'model':db[_0x5003('0xac')],'as':'Tags','attributes':['id',_0x5003('0x38'),_0x5003('0xad')],'where':_0x18756b[_0x5003('0x3f')][_0x5003('0xae')]?{'id':_0x18756b['query'][_0x5003('0xae')]}:undefined,'required':_0x18756b['query'][_0x5003('0xae')]?!![]:![]}];}return db[_0x5003('0x8b')][_0x5003('0x6b')](_0x102989);})[_0x5003('0x1d')](function(_0x35b5e3){_0x3fd016[_0x5003('0x52')]=_0x35b5e3;return _0x3fd016;});}})[_0x5003('0x1d')](respondWithFilteredResult(_0x23d0dd,_0x102989))[_0x5003('0x25')](handleError(_0x23d0dd,null));};exports[_0x5003('0xaf')]=function(_0x2dc002,_0x2a3b62,_0x365802){return db[_0x5003('0x4f')][_0x5003('0x59')]({'where':{'id':_0x2dc002['params']['id']}})['then'](handleEntityNotFound(_0x2a3b62,null))['then'](function(_0x5ad8a3){if(_0x5ad8a3){return _0x5ad8a3[_0x5003('0xaf')](_0x2dc002[_0x5003('0x56')][_0x5003('0x67')],_['omit'](_0x2dc002[_0x5003('0x56')],[_0x5003('0x67'),'id'])||{})[_0x5003('0x8c')](function(_0x550213){for(var _0x4ddd46=0x0;_0x4ddd46<_0x2dc002[_0x5003('0x56')][_0x5003('0x67')][_0x5003('0x45')];_0x4ddd46+=0x1){socket[_0x5003('0xb0')]('userOpenchannelAccount:save',{'UserId':Number(_0x2dc002[_0x5003('0x56')][_0x5003('0x67')][_0x4ddd46]),'OpenchannelAccountId':Number(_0x2dc002[_0x5003('0x5d')]['id'])});}return _0x550213;});}})[_0x5003('0x1d')](respondWithResult(_0x2a3b62,null))[_0x5003('0x25')](handleError(_0x2a3b62,null));};exports[_0x5003('0xb1')]=function(_0x153a8e,_0x561c88,_0x561310){return db['OpenchannelAccount'][_0x5003('0x59')]({'where':{'id':_0x153a8e['params']['id']}})[_0x5003('0x1d')](handleEntityNotFound(_0x561c88,null))['then'](function(_0x1be0c6){if(_0x1be0c6){return _0x1be0c6[_0x5003('0xb1')](_0x153a8e[_0x5003('0x3f')][_0x5003('0x67')])[_0x5003('0x1d')](function(){if(_[_0x5003('0xb2')](_0x153a8e[_0x5003('0x3f')][_0x5003('0x67')])){for(var _0x584601=0x0;_0x584601<_0x153a8e[_0x5003('0x3f')][_0x5003('0x67')][_0x5003('0x45')];_0x584601+=0x1){socket['emit'](_0x5003('0xb3'),{'UserId':Number(_0x153a8e[_0x5003('0x3f')][_0x5003('0x67')][_0x584601]),'OpenchannelAccountId':Number(_0x153a8e['params']['id'])});}}else{socket[_0x5003('0xb0')](_0x5003('0xb3'),{'UserId':Number(_0x153a8e[_0x5003('0x3f')][_0x5003('0x67')]),'OpenchannelAccountId':Number(_0x153a8e[_0x5003('0x5d')]['id'])});}});}})['then'](respondWithStatusCode(_0x561c88,null))[_0x5003('0x25')](handleError(_0x561c88,null));};exports['getAgents']=function(_0x181a8e,_0x25a859,_0x27cff1){var _0x294007={};var _0xc297e7={};var _0x118271;var _0x5f0635;return db['OpenchannelAccount'][_0x5003('0x63')]({'where':{'id':_0x181a8e[_0x5003('0x5d')]['id']}})['then'](handleEntityNotFound(_0x25a859,null))[_0x5003('0x1d')](function(_0x8d8d60){if(_0x8d8d60){_0x118271=_0x8d8d60;_0xc297e7[_0x5003('0x3e')]=_[_0x5003('0x40')](db[_0x5003('0x99')][_0x5003('0x54')]);_0xc297e7[_0x5003('0x3f')]=_[_0x5003('0x40')](_0x181a8e[_0x5003('0x3f')]);_0xc297e7[_0x5003('0x41')]=_[_0x5003('0x42')](_0xc297e7[_0x5003('0x3e')],_0xc297e7[_0x5003('0x3f')]);_0x294007[_0x5003('0x43')]=_['intersection'](_0xc297e7[_0x5003('0x3e')],qs[_0x5003('0x44')](_0x181a8e[_0x5003('0x3f')][_0x5003('0x44')]));_0x294007[_0x5003('0x43')]=_0x294007[_0x5003('0x43')]['length']?_0x294007[_0x5003('0x43')]:_0xc297e7[_0x5003('0x3e')];_0x294007[_0x5003('0x48')]=qs['sort'](_0x181a8e[_0x5003('0x3f')][_0x5003('0x65')]);_0x294007[_0x5003('0x49')]=qs['filters'](_['pick'](_0x181a8e[_0x5003('0x3f')],_0xc297e7[_0x5003('0x41')]));if(_0x181a8e[_0x5003('0x3f')][_0x5003('0x4b')]){_0x294007[_0x5003('0x49')]=_[_0x5003('0x4c')](_0x294007[_0x5003('0x49')],{'$or':_[_0x5003('0x3b')](_0x294007[_0x5003('0x43')],function(_0x2c39b2){var _0x25df5f={};_0x25df5f[_0x2c39b2]={'$like':'%'+_0x181a8e['query'][_0x5003('0x4b')]+'%'};return _0x25df5f;})});}_0x294007=_[_0x5003('0x4c')]({},_0x294007,_0x181a8e[_0x5003('0x4e')]);return _0x118271[_0x5003('0xb4')](_0x294007);}})[_0x5003('0x1d')](function(_0x1ecb27){if(_0x1ecb27){_0x5f0635=_0x1ecb27['length'];if(!_0x181a8e[_0x5003('0x3f')][_0x5003('0x46')](_0x5003('0x47'))){_0x294007[_0x5003('0x2c')]=qs[_0x5003('0x2c')](_0x181a8e[_0x5003('0x3f')][_0x5003('0x2c')]);_0x294007[_0x5003('0x2a')]=qs[_0x5003('0x2a')](_0x181a8e[_0x5003('0x3f')][_0x5003('0x2a')]);}return _0x118271['getAgents'](_0x294007);}})[_0x5003('0x1d')](function(_0x35b162){if(_0x35b162){return _0x35b162?{'count':_0x5f0635,'rows':_0x35b162}:null;}})['then'](respondWithResult(_0x25a859,null))[_0x5003('0x25')](handleError(_0x25a859,null));};exports['send']=function(_0x41ed0f,_0x477573,_0x2f395d){var _0x5c0eab,_0x16f871,_0xa39a47;if(_[_0x5003('0x78')](_0x41ed0f['body'][_0x5003('0x56')])||_0x41ed0f[_0x5003('0x56')]['body']===''){throw new db[(_0x5003('0x6f'))][(_0x5003('0x70'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5003('0x78')](_0x41ed0f[_0x5003('0x56')]['to'])){}_0x5c0eab=_0x41ed0f[_0x5003('0x56')]['to'];return db[_0x5003('0x4f')]['findOne']({'where':{'id':_0x41ed0f[_0x5003('0x5d')]['id']}})['then'](handleEntityNotFound(_0x477573,null))[_0x5003('0x1d')](function(_0x166d56){if(_0x166d56){return db[_0x5003('0x4f')]['find']({'where':{'id':_0x166d56['id']},'include':[{'model':db[_0x5003('0x7d')],'as':'List','include':[{'model':db[_0x5003('0x6e')],'as':_0x5003('0x7f'),'where':{[_0x166d56[_0x5003('0x79')]]:_0x5c0eab},'limit':0x1,'order':[[_0x5003('0x74'),_0x5003('0xb5')]]}]}]})['then'](handleEntityNotFound(_0x477573,null))[_0x5003('0x1d')](function(_0x4f8413){if(_0x4f8413&&_0x4f8413['List']){_0x16f871=_0x4f8413[_0x5003('0x34')]({'plain':!![]});if(_0x16f871[_0x5003('0x7e')]&&_0x16f871[_0x5003('0x7e')][_0x5003('0x7f')][_0x5003('0x45')]){return _0x16f871['List'][_0x5003('0x7f')][0x0];}return db['CmContact'][_0x5003('0x55')](_[_0x5003('0x15')](_0x41ed0f['body'],{'firstName':_0x5c0eab,[_0x4f8413[_0x5003('0x79')]]:_0x5c0eab,'phone':_0x5c0eab,'ListId':_0x16f871[_0x5003('0x76')]}));}})['then'](handleEntityNotFound(_0x477573,null))[_0x5003('0x1d')](function(_0x5f3879){if(_0x5f3879){_0xa39a47=_0x5f3879;return db['OpenchannelInteraction'][_0x5003('0x59')]({'where':{'ContactId':_0xa39a47['id'],'closed':![],'OpenchannelAccountId':_0x16f871['id']}})['then'](function(_0x12eba9){if(_0x12eba9){return[_0x12eba9,![]];}return db[_0x5003('0x8b')][_0x5003('0x55')]({'UserId':_0x41ed0f[_0x5003('0x57')]['id'],'ContactId':_0xa39a47['id'],'OpenchannelAccountId':_0x16f871['id'],'lastMsgDirection':_0x5003('0xb6'),'Messages':[_[_0x5003('0x4c')](_0x41ed0f[_0x5003('0x56')],{'read':![],'body':_0x41ed0f['body'][_0x5003('0x56')],'OpenchannelAccountId':_0x16f871['id'],'UserId':_0x41ed0f['user']['id'],'ContactId':_0xa39a47['id']})]},{'include':[{'model':db[_0x5003('0x96')],'as':_0x5003('0xb7')}]})[_0x5003('0x1d')](function(_0x268d5e){return[_0x268d5e,!![]];});});}})[_0x5003('0x8c')](function(_0x2e4b1c,_0x1c6760){if(_0x1c6760){return _0x2e4b1c;}return db[_0x5003('0x96')][_0x5003('0x55')](_[_0x5003('0x4c')](_0x41ed0f[_0x5003('0x56')],{'read':![],'body':_0x41ed0f[_0x5003('0x56')][_0x5003('0x56')],'OpenchannelAccountId':_0x16f871['id'],'OpenchannelInteractionId':_0x2e4b1c['id'],'UserId':_0x41ed0f[_0x5003('0x57')]['id'],'ContactId':_0xa39a47['id']}))[_0x5003('0x1d')](function(_0x5e5a1a){_0x2e4b1c['dataValues'][_0x5003('0xb7')]=[];_0x2e4b1c['dataValues'][_0x5003('0xb7')]['push'](_0x5e5a1a[_0x5003('0xb8')]);return _0x2e4b1c;});});}})[_0x5003('0x1d')](respondWithResult(_0x477573,null))[_0x5003('0x25')](handleError(_0x477573,null));};
\ No newline at end of file
index fc8839a..fefe745 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb903=['setMaxListeners','update','remove','emit','hasOwnProperty','events','../../mysqldb','OpenchannelAccount'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xb903,0x185));var _0x3b90=function(_0x5b9e84,_0x4a8440){_0x5b9e84=_0x5b9e84-0x0;var _0x370ff0=_0xb903[_0x5b9e84];return _0x370ff0;};'use strict';var EventEmitter=require(_0x3b90('0x0'));var OpenchannelAccount=require(_0x3b90('0x1'))['db'][_0x3b90('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x3b90('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3b90('0x4'),'afterDestroy':_0x3b90('0x5')};function emitEvent(_0x3b024a){return function(_0x1cd5d8,_0x30d8db,_0x40f726){OpenchannelAccountEvents[_0x3b90('0x6')](_0x3b024a+':'+_0x1cd5d8['id'],_0x1cd5d8);OpenchannelAccountEvents['emit'](_0x3b024a,_0x1cd5d8);_0x40f726(null);};}for(var e in events){if(events[_0x3b90('0x7')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x1339=['update','remove','emit','hasOwnProperty','exports','OpenchannelAccount','setMaxListeners','save'];(function(_0x31d1c0,_0x144a26){var _0x45e84d=function(_0x5e6860){while(--_0x5e6860){_0x31d1c0['push'](_0x31d1c0['shift']());}};_0x45e84d(++_0x144a26);}(_0x1339,0x1ed));var _0x9133=function(_0x5322ec,_0x25b7f4){_0x5322ec=_0x5322ec-0x0;var _0x3164ca=_0x1339[_0x5322ec];return _0x3164ca;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x9133('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x9133('0x1')](0x0);var events={'afterCreate':_0x9133('0x2'),'afterUpdate':_0x9133('0x3'),'afterDestroy':_0x9133('0x4')};function emitEvent(_0x192d48){return function(_0x176e80,_0x110c51,_0x558345){OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48+':'+_0x176e80['id'],_0x176e80);OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48,_0x176e80);_0x558345(null);};}for(var e in events){if(events[_0x9133('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x9133('0x7')]=OpenchannelAccountEvents;
\ No newline at end of file
index 4583aca..a9a1e3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x4c430c,_0x59222f){var _0x370429=function(_0x5434f5){while(--_0x5434f5){_0x4c430c['push'](_0x4c430c['shift']());}};_0x370429(++_0x59222f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1ee5d7,_0x2f88b0){var _0x3827ef=function(_0x3f5272){while(--_0x3f5272){_0x1ee5d7['push'](_0x1ee5d7['shift']());}};_0x3827ef(++_0x2f88b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4f42bfb..f826937 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4058=['request','then','debug','code','error','message','OpenchannelAccount,\x20%s,\x20%s','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket'];(function(_0x32bea2,_0x18025c){var _0x369744=function(_0x29b1fe){while(--_0x29b1fe){_0x32bea2['push'](_0x32bea2['shift']());}};_0x369744(++_0x18025c);}(_0x4058,0x129));var _0x8405=function(_0x39fc81,_0x348b3f){_0x39fc81=_0x39fc81-0x0;var _0x23e041=_0x4058[_0x39fc81];return _0x23e041;};'use strict';var _=require(_0x8405('0x0'));var util=require(_0x8405('0x1'));var moment=require(_0x8405('0x2'));var BPromise=require(_0x8405('0x3'));var rs=require(_0x8405('0x4'));var fs=require('fs');var Redis=require(_0x8405('0x5'));var db=require(_0x8405('0x6'))['db'];var utils=require(_0x8405('0x7'));var logger=require(_0x8405('0x8'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8405('0x9')][_0x8405('0xa')]({'port':0x232a});config[_0x8405('0xb')]=_[_0x8405('0xc')](config[_0x8405('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8405('0xd'))(new Redis(config[_0x8405('0xb')]));require(_0x8405('0xe'))['register'](socket);function respondWithRpcPromise(_0x30705f,_0x5e132b,_0x6979fd){return new BPromise(function(_0xb442,_0x50344e){return client[_0x8405('0xf')](_0x30705f,_0x6979fd)[_0x8405('0x10')](function(_0x5b94d5){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x5e132b,'request\x20sent');logger[_0x8405('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x5e132b,'request\x20sent',JSON['stringify'](_0x5b94d5));if(_0x5b94d5['error']){if(_0x5b94d5['error'][_0x8405('0x12')]===0x1f4){logger[_0x8405('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x5e132b,_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);return _0x50344e(_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);}logger['error'](_0x8405('0x15'),_0x5e132b,_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);return _0xb442(_0x5b94d5[_0x8405('0x13')][_0x8405('0x14')]);}else{logger[_0x8405('0x16')](_0x8405('0x15'),_0x5e132b,_0x8405('0x17'));_0xb442(_0x5b94d5[_0x8405('0x18')][_0x8405('0x14')]);}})[_0x8405('0x19')](function(_0x21376d){logger[_0x8405('0x13')](_0x8405('0x15'),_0x5e132b,_0x21376d);_0x50344e(_0x21376d);});});}
\ No newline at end of file
+var _0x4483=['defaults','localhost','./openchannelAccount.socket','register','request','then','info','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','request\x20sent','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x51e2eb,_0x4a9973){var _0x517eaa=function(_0x36f2e3){while(--_0x36f2e3){_0x51e2eb['push'](_0x51e2eb['shift']());}};_0x517eaa(++_0x4a9973);}(_0x4483,0x1a3));var _0x3448=function(_0x510ec1,_0x3ad15f){_0x510ec1=_0x510ec1-0x0;var _0x1aa319=_0x4483[_0x510ec1];return _0x1aa319;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});config[_0x3448('0xc')]=_[_0x3448('0xd')](config[_0x3448('0xc')],{'host':_0x3448('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x3448('0xf'))[_0x3448('0x10')](socket);function respondWithRpcPromise(_0xc36409,_0x6f82ca,_0x3f4364){return new BPromise(function(_0x1e645a,_0x2bdf02){return client[_0x3448('0x11')](_0xc36409,_0x3f4364)[_0x3448('0x12')](function(_0x35bb7b){logger[_0x3448('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x6f82ca,'request\x20sent');logger[_0x3448('0x14')](_0x3448('0x15'),_0x6f82ca,'request\x20sent',JSON[_0x3448('0x16')](_0x35bb7b));if(_0x35bb7b[_0x3448('0x17')]){if(_0x35bb7b[_0x3448('0x17')]['code']===0x1f4){logger[_0x3448('0x17')](_0x3448('0x18'),_0x6f82ca,_0x35bb7b['error'][_0x3448('0x19')]);return _0x2bdf02(_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);}logger['error'](_0x3448('0x18'),_0x6f82ca,_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);return _0x1e645a(_0x35bb7b[_0x3448('0x17')][_0x3448('0x19')]);}else{logger[_0x3448('0x13')](_0x3448('0x18'),_0x6f82ca,_0x3448('0x1a'));_0x1e645a(_0x35bb7b['result'][_0x3448('0x19')]);}})['catch'](function(_0x48f94a){logger['error'](_0x3448('0x18'),_0x6f82ca,_0x48f94a);_0x2bdf02(_0x48f94a);});});}
\ No newline at end of file
index 467fbbd..223a438 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4198=['openchannelAccount:','./openchannelAccount.events','remove','update','emit','removeListener','register','length'];(function(_0x678c93,_0x31190c){var _0x36b27b=function(_0x281ddc){while(--_0x281ddc){_0x678c93['push'](_0x678c93['shift']());}};_0x36b27b(++_0x31190c);}(_0x4198,0x69));var _0x8419=function(_0x59ae28,_0x361297){_0x59ae28=_0x59ae28-0x0;var _0x3fbf55=_0x4198[_0x59ae28];return _0x3fbf55;};'use strict';var OpenchannelAccountEvents=require(_0x8419('0x0'));var events=['save',_0x8419('0x1'),_0x8419('0x2')];function createListener(_0x29612a,_0x1e7a2f){return function(_0x182359){_0x1e7a2f[_0x8419('0x3')](_0x29612a,_0x182359);};}function removeListener(_0x1eaff0,_0xc19396){return function(){OpenchannelAccountEvents[_0x8419('0x4')](_0x1eaff0,_0xc19396);};}exports[_0x8419('0x5')]=function(_0x502e00){for(var _0x1f5bfe=0x0,_0x839abf=events[_0x8419('0x6')];_0x1f5bfe<_0x839abf;_0x1f5bfe++){var _0x2043cd=events[_0x1f5bfe];var _0x45c2b5=createListener(_0x8419('0x7')+_0x2043cd,_0x502e00);OpenchannelAccountEvents['on'](_0x2043cd,_0x45c2b5);}};
\ No newline at end of file
+var _0x477a=['length','openchannelAccount:','./openchannelAccount.events','remove','update','removeListener'];(function(_0x1cb40e,_0x58e8c6){var _0x2d2e57=function(_0x2a5e40){while(--_0x2a5e40){_0x1cb40e['push'](_0x1cb40e['shift']());}};_0x2d2e57(++_0x58e8c6);}(_0x477a,0x1e2));var _0xa477=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x477a[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelAccountEvents=require(_0xa477('0x0'));var events=['save',_0xa477('0x1'),_0xa477('0x2')];function createListener(_0x4d9a0f,_0x3fbed2){return function(_0x3fae2d){_0x3fbed2['emit'](_0x4d9a0f,_0x3fae2d);};}function removeListener(_0x5b9d1c,_0x111534){return function(){OpenchannelAccountEvents[_0xa477('0x3')](_0x5b9d1c,_0x111534);};}exports['register']=function(_0x1e75a5){for(var _0x819ac9=0x0,_0x203871=events[_0xa477('0x4')];_0x819ac9<_0x203871;_0x819ac9++){var _0x422a5d=events[_0x819ac9];var _0x788380=createListener(_0xa477('0x5')+_0x422a5d,_0x1e75a5);OpenchannelAccountEvents['on'](_0x422a5d,_0x788380);}};
\ No newline at end of file
index 266d488..fd87284 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe702=['../../components/auth/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0xe702,0xd9));var _0x2e70=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xe702[_0x4e9628];return _0x27bc8c;};'use strict';var multer=require(_0x2e70('0x0'));var util=require('util');var path=require(_0x2e70('0x1'));var timeout=require(_0x2e70('0x2'));var express=require('express');var router=express[_0x2e70('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x2e70('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x2e70('0x5')]('/',auth[_0x2e70('0x6')](),controller[_0x2e70('0x7')]);router[_0x2e70('0x5')](_0x2e70('0x8'),auth[_0x2e70('0x6')](),controller[_0x2e70('0x9')]);router[_0x2e70('0xa')]('/',auth['isAuthenticated'](),controller[_0x2e70('0xb')]);router[_0x2e70('0xc')](_0x2e70('0x8'),auth[_0x2e70('0x6')](),controller[_0x2e70('0xd')]);router[_0x2e70('0xe')](_0x2e70('0x8'),auth['isAuthenticated'](),controller[_0x2e70('0xf')]);module[_0x2e70('0x10')]=router;
\ No newline at end of file
+var _0xc098=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','post','create','/:id','destroy','exports','multer'];(function(_0x5895dc,_0x4c3b31){var _0x458e58=function(_0x193a6c){while(--_0x193a6c){_0x5895dc['push'](_0x5895dc['shift']());}};_0x458e58(++_0x4c3b31);}(_0xc098,0xfb));var _0x8c09=function(_0x2b65f4,_0x4a5622){_0x2b65f4=_0x2b65f4-0x0;var _0x56383b=_0xc098[_0x2b65f4];return _0x56383b;};'use strict';var multer=require(_0x8c09('0x0'));var util=require(_0x8c09('0x1'));var path=require(_0x8c09('0x2'));var timeout=require(_0x8c09('0x3'));var express=require(_0x8c09('0x4'));var router=express[_0x8c09('0x5')]();var fs_extra=require(_0x8c09('0x6'));var auth=require(_0x8c09('0x7'));var interaction=require(_0x8c09('0x8'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0x8c09('0x9')]('/',auth[_0x8c09('0xa')](),controller[_0x8c09('0xb')]);router[_0x8c09('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x8c09('0xc')]);router[_0x8c09('0xd')]('/',auth[_0x8c09('0xa')](),controller[_0x8c09('0xe')]);router['put']('/:id',auth[_0x8c09('0xa')](),controller['update']);router['delete'](_0x8c09('0xf'),auth[_0x8c09('0xa')](),controller[_0x8c09('0x10')]);module[_0x8c09('0x11')]=router;
\ No newline at end of file
index 258c2b9..f8d2cc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c53=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x382253,_0x5ece62){var _0x2c178e=function(_0x1500f9){while(--_0x1500f9){_0x382253['push'](_0x382253['shift']());}};_0x2c178e(++_0x5ece62);}(_0x8c53,0x138));var _0x38c5=function(_0x1d334f,_0x498ac8){_0x1d334f=_0x1d334f-0x0;var _0x2177c3=_0x8c53[_0x1d334f];return _0x2177c3;};'use strict';var Sequelize=require(_0x38c5('0x0'));module[_0x38c5('0x1')]={'priority':{'type':Sequelize[_0x38c5('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x38c5('0x3')],'allowNull':![],'defaultValue':_0x38c5('0x4')},'appdata':{'type':Sequelize[_0x38c5('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x38c5('0x3')],'defaultValue':_0x38c5('0x6')}};
\ No newline at end of file
+var _0xb8ef=['STRING','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x165c8a,_0x5bbdee){var _0x44d715=function(_0x3f7335){while(--_0x3f7335){_0x165c8a['push'](_0x165c8a['shift']());}};_0x44d715(++_0x5bbdee);}(_0xb8ef,0x1dd));var _0xfb8e=function(_0xf9ece9,_0x5e367b){_0xf9ece9=_0xf9ece9-0x0;var _0x5a3665=_0xb8ef[_0xf9ece9];return _0x5a3665;};'use strict';var Sequelize=require(_0xfb8e('0x0'));module[_0xfb8e('0x1')]={'priority':{'type':Sequelize[_0xfb8e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xfb8e('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xfb8e('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfb8e('0x3')],'defaultValue':_0xfb8e('0x5')}};
\ No newline at end of file
index 61a9fca..35be6ef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1854=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','set','save','update','then','destroy','stack','name','send','index','map','OpenchannelApplication','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','pick','filters','filter','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring'];(function(_0x5f0436,_0x366d4c){var _0x4ddeef=function(_0x353775){while(--_0x353775){_0x5f0436['push'](_0x5f0436['shift']());}};_0x4ddeef(++_0x366d4c);}(_0x1854,0x1ee));var _0x4185=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0x1854[_0x35fabd];return _0x61a8ee;};'use strict';var emlformat=require(_0x4185('0x0'));var rimraf=require(_0x4185('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4185('0x2'));var rp=require(_0x4185('0x3'));var moment=require(_0x4185('0x4'));var BPromise=require(_0x4185('0x5'));var Mustache=require(_0x4185('0x6'));var util=require(_0x4185('0x7'));var path=require(_0x4185('0x8'));var sox=require(_0x4185('0x9'));var csv=require(_0x4185('0xa'));var ejs=require(_0x4185('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4185('0xc'));var squel=require('squel');var crypto=require(_0x4185('0xd'));var jsforce=require(_0x4185('0xe'));var deskjs=require(_0x4185('0xf'));var toCsv=require(_0x4185('0xa'));var querystring=require(_0x4185('0x10'));var Papa=require(_0x4185('0x11'));var Redis=require(_0x4185('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4185('0x13'));var as=require(_0x4185('0x14'));var hardwareService=require(_0x4185('0x15'));var logger=require(_0x4185('0x16'))('api');var utils=require(_0x4185('0x17'));var config=require(_0x4185('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d2f22,_0x2444bc){_0x2444bc=_0x2444bc||0xcc;return function(_0xf4a4a0){if(_0xf4a4a0){return _0x5d2f22[_0x4185('0x19')](_0x2444bc);}return _0x5d2f22[_0x4185('0x1a')](_0x2444bc)[_0x4185('0x1b')]();};}function respondWithResult(_0x234f2f,_0x883799){_0x883799=_0x883799||0xc8;return function(_0x4658d7){if(_0x4658d7){return _0x234f2f['status'](_0x883799)[_0x4185('0x1c')](_0x4658d7);}};}function respondWithFilteredResult(_0x413dd3,_0x55f15e){return function(_0xbe9455){if(_0xbe9455){var _0x5a3855=typeof _0x55f15e[_0x4185('0x1d')]===_0x4185('0x1e')&&typeof _0x55f15e['limit']==='undefined';var _0x75660e=_0xbe9455[_0x4185('0x1f')];var _0x45f369=_0x5a3855?0x0:_0x55f15e['offset'];var _0x5db73d=_0x5a3855?_0xbe9455[_0x4185('0x1f')]:_0x55f15e[_0x4185('0x1d')]+_0x55f15e['limit'];var _0x1f5cc6;if(_0x5db73d>=_0x75660e){_0x5db73d=_0x75660e;_0x1f5cc6=0xc8;}else{_0x1f5cc6=0xce;}_0x413dd3[_0x4185('0x1a')](_0x1f5cc6);return _0x413dd3[_0x4185('0x20')]('Content-Range',_0x45f369+'-'+_0x5db73d+'/'+_0x75660e)[_0x4185('0x1c')](_0xbe9455);}return null;};}function patchUpdates(_0x3eff1b){return function(_0xfc069d){try{jsonpatch['apply'](_0xfc069d,_0x3eff1b,!![]);}catch(_0x3291ca){return BPromise['reject'](_0x3291ca);}return _0xfc069d[_0x4185('0x21')]();};}function saveUpdates(_0x358258,_0x16167b){return function(_0x4bf124){if(_0x4bf124){return _0x4bf124[_0x4185('0x22')](_0x358258)[_0x4185('0x23')](function(_0x147b31){return _0x147b31;});}return null;};}function removeEntity(_0x458839,_0x50aa22){return function(_0x1bb280){if(_0x1bb280){return _0x1bb280[_0x4185('0x24')]()[_0x4185('0x23')](function(){_0x458839[_0x4185('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38f49f,_0x5a2d25){return function(_0x1a1b9c){if(!_0x1a1b9c){_0x38f49f['sendStatus'](0x194);}return _0x1a1b9c;};}function handleError(_0x45104c,_0x48c9d8){_0x48c9d8=_0x48c9d8||0x1f4;return function(_0x5e618f){logger['error'](_0x5e618f[_0x4185('0x25')]);if(_0x5e618f[_0x4185('0x26')]){delete _0x5e618f[_0x4185('0x26')];}_0x45104c[_0x4185('0x1a')](_0x48c9d8)[_0x4185('0x27')](_0x5e618f);};}exports[_0x4185('0x28')]=function(_0x46b6bd,_0x42c241){var _0x2491e8={},_0x4c3456={},_0x1dd312={'count':0x0,'rows':[]};var _0x57eb09=_[_0x4185('0x29')](db[_0x4185('0x2a')]['rawAttributes'],function(_0x3f8007){return{'name':_0x3f8007[_0x4185('0x2b')],'type':_0x3f8007[_0x4185('0x2c')][_0x4185('0x2d')]};});_0x4c3456['model']=_['map'](_0x57eb09,_0x4185('0x26'));_0x4c3456[_0x4185('0x2e')]=_[_0x4185('0x2f')](_0x46b6bd[_0x4185('0x2e')]);_0x4c3456['filters']=_[_0x4185('0x30')](_0x4c3456[_0x4185('0x31')],_0x4c3456[_0x4185('0x2e')]);_0x2491e8[_0x4185('0x32')]=_[_0x4185('0x30')](_0x4c3456[_0x4185('0x31')],qs[_0x4185('0x33')](_0x46b6bd[_0x4185('0x2e')]['fields']));_0x2491e8['attributes']=_0x2491e8['attributes'][_0x4185('0x34')]?_0x2491e8[_0x4185('0x32')]:_0x4c3456[_0x4185('0x31')];if(!_0x46b6bd[_0x4185('0x2e')][_0x4185('0x35')](_0x4185('0x36'))){_0x2491e8[_0x4185('0x37')]=qs[_0x4185('0x37')](_0x46b6bd[_0x4185('0x2e')][_0x4185('0x37')]);_0x2491e8[_0x4185('0x1d')]=qs[_0x4185('0x1d')](_0x46b6bd['query']['offset']);}_0x2491e8[_0x4185('0x38')]=qs['sort'](_0x46b6bd[_0x4185('0x2e')]['sort']);_0x2491e8['where']=qs['filters'](_[_0x4185('0x39')](_0x46b6bd[_0x4185('0x2e')],_0x4c3456[_0x4185('0x3a')]),_0x57eb09);if(_0x46b6bd[_0x4185('0x2e')][_0x4185('0x3b')]){_0x2491e8[_0x4185('0x3c')]=_[_0x4185('0x3d')](_0x2491e8['where'],{'$or':_['map'](_0x57eb09,function(_0x453edf){if(_0x453edf['type']!==_0x4185('0x3e')){var _0x51fbee={};_0x51fbee[_0x453edf[_0x4185('0x26')]]={'$like':'%'+_0x46b6bd[_0x4185('0x2e')][_0x4185('0x3b')]+'%'};return _0x51fbee;}})});}_0x2491e8=_[_0x4185('0x3d')]({},_0x2491e8,_0x46b6bd[_0x4185('0x3f')]);var _0x4e671e={'where':_0x2491e8[_0x4185('0x3c')]};return db[_0x4185('0x2a')][_0x4185('0x1f')](_0x4e671e)[_0x4185('0x23')](function(_0xcfda85){_0x1dd312[_0x4185('0x1f')]=_0xcfda85;if(_0x46b6bd[_0x4185('0x2e')][_0x4185('0x40')]){_0x2491e8[_0x4185('0x41')]=[{'all':!![]}];}return db[_0x4185('0x2a')]['findAll'](_0x2491e8);})[_0x4185('0x23')](function(_0x241ee9){_0x1dd312['rows']=_0x241ee9;return _0x1dd312;})[_0x4185('0x23')](respondWithFilteredResult(_0x42c241,_0x2491e8))[_0x4185('0x42')](handleError(_0x42c241,null));};exports[_0x4185('0x43')]=function(_0x4e6778,_0x45ec63){var _0x5895be={'raw':!![],'where':{'id':_0x4e6778[_0x4185('0x44')]['id']}},_0x2478ac={};_0x2478ac['model']=_[_0x4185('0x2f')](db[_0x4185('0x2a')][_0x4185('0x45')]);_0x2478ac[_0x4185('0x2e')]=_['keys'](_0x4e6778['query']);_0x2478ac['filters']=_[_0x4185('0x30')](_0x2478ac['model'],_0x2478ac[_0x4185('0x2e')]);_0x5895be['attributes']=_[_0x4185('0x30')](_0x2478ac[_0x4185('0x31')],qs[_0x4185('0x33')](_0x4e6778[_0x4185('0x2e')][_0x4185('0x33')]));_0x5895be[_0x4185('0x32')]=_0x5895be[_0x4185('0x32')][_0x4185('0x34')]?_0x5895be['attributes']:_0x2478ac[_0x4185('0x31')];if(_0x4e6778[_0x4185('0x2e')][_0x4185('0x40')]){_0x5895be[_0x4185('0x41')]=[{'all':!![]}];}_0x5895be=_['merge']({},_0x5895be,_0x4e6778[_0x4185('0x3f')]);return db[_0x4185('0x2a')][_0x4185('0x46')](_0x5895be)[_0x4185('0x23')](handleEntityNotFound(_0x45ec63,null))[_0x4185('0x23')](respondWithResult(_0x45ec63,null))[_0x4185('0x42')](handleError(_0x45ec63,null));};exports[_0x4185('0x47')]=function(_0x593c38,_0x3a018c){return db[_0x4185('0x2a')][_0x4185('0x47')](_0x593c38[_0x4185('0x48')],{})['then'](respondWithResult(_0x3a018c,0xc9))['catch'](handleError(_0x3a018c,null));};exports[_0x4185('0x22')]=function(_0xcede7e,_0x56ad23){if(_0xcede7e['body']['id']){delete _0xcede7e['body']['id'];}return db[_0x4185('0x2a')]['find']({'where':{'id':_0xcede7e[_0x4185('0x44')]['id']}})[_0x4185('0x23')](handleEntityNotFound(_0x56ad23,null))[_0x4185('0x23')](saveUpdates(_0xcede7e[_0x4185('0x48')],null))[_0x4185('0x23')](respondWithResult(_0x56ad23,null))[_0x4185('0x42')](handleError(_0x56ad23,null));};exports['destroy']=function(_0x14f0b5,_0x1537a4){return db[_0x4185('0x2a')][_0x4185('0x46')]({'where':{'id':_0x14f0b5[_0x4185('0x44')]['id']}})['then'](handleEntityNotFound(_0x1537a4,null))[_0x4185('0x23')](removeEntity(_0x1537a4,null))[_0x4185('0x42')](handleError(_0x1537a4,null));};
\ No newline at end of file
+var _0xf622=['rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x1d2cb4,_0x313244){var _0x1a6b7b=function(_0x1c84c2){while(--_0x1c84c2){_0x1d2cb4['push'](_0x1d2cb4['shift']());}};_0x1a6b7b(++_0x313244);}(_0xf622,0x144));var _0x2f62=function(_0x3a702e,_0x489d6a){_0x3a702e=_0x3a702e-0x0;var _0x1779f7=_0xf622[_0x3a702e];return _0x1779f7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f62('0x0'));var zipdir=require(_0x2f62('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2f62('0x2'));var moment=require(_0x2f62('0x3'));var BPromise=require(_0x2f62('0x4'));var Mustache=require(_0x2f62('0x5'));var util=require(_0x2f62('0x6'));var path=require(_0x2f62('0x7'));var sox=require(_0x2f62('0x8'));var csv=require(_0x2f62('0x9'));var ejs=require(_0x2f62('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2f62('0xb'));var squel=require(_0x2f62('0xc'));var crypto=require(_0x2f62('0xd'));var jsforce=require(_0x2f62('0xe'));var deskjs=require(_0x2f62('0xf'));var toCsv=require(_0x2f62('0x9'));var querystring=require('querystring');var Papa=require(_0x2f62('0x10'));var Redis=require(_0x2f62('0x11'));var authService=require(_0x2f62('0x12'));var qs=require(_0x2f62('0x13'));var as=require(_0x2f62('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2f62('0x15'))(_0x2f62('0x16'));var utils=require(_0x2f62('0x17'));var config=require(_0x2f62('0x18'));var licenseUtil=require(_0x2f62('0x19'));var db=require(_0x2f62('0x1a'))['db'];function respondWithStatusCode(_0x16def2,_0x257ed2){_0x257ed2=_0x257ed2||0xcc;return function(_0x5dd178){if(_0x5dd178){return _0x16def2['sendStatus'](_0x257ed2);}return _0x16def2[_0x2f62('0x1b')](_0x257ed2)['end']();};}function respondWithResult(_0x32625a,_0x40869c){_0x40869c=_0x40869c||0xc8;return function(_0x151577){if(_0x151577){return _0x32625a[_0x2f62('0x1b')](_0x40869c)[_0x2f62('0x1c')](_0x151577);}};}function respondWithFilteredResult(_0x2c180b,_0x2ab4f8){return function(_0x33263a){if(_0x33263a){var _0x32c6d2=typeof _0x2ab4f8[_0x2f62('0x1d')]==='undefined'&&typeof _0x2ab4f8[_0x2f62('0x1e')]===_0x2f62('0x1f');var _0x41a4e8=_0x33263a[_0x2f62('0x20')];var _0x3b15d0=_0x32c6d2?0x0:_0x2ab4f8[_0x2f62('0x1d')];var _0x3a0227=_0x32c6d2?_0x33263a[_0x2f62('0x20')]:_0x2ab4f8[_0x2f62('0x1d')]+_0x2ab4f8[_0x2f62('0x1e')];var _0x2518cd;if(_0x3a0227>=_0x41a4e8){_0x3a0227=_0x41a4e8;_0x2518cd=0xc8;}else{_0x2518cd=0xce;}_0x2c180b['status'](_0x2518cd);return _0x2c180b[_0x2f62('0x21')]('Content-Range',_0x3b15d0+'-'+_0x3a0227+'/'+_0x41a4e8)[_0x2f62('0x1c')](_0x33263a);}return null;};}function patchUpdates(_0x473163){return function(_0x1bd019){try{jsonpatch[_0x2f62('0x22')](_0x1bd019,_0x473163,!![]);}catch(_0x280987){return BPromise[_0x2f62('0x23')](_0x280987);}return _0x1bd019[_0x2f62('0x24')]();};}function saveUpdates(_0x25c264,_0x3a763f){return function(_0x327c9e){if(_0x327c9e){return _0x327c9e[_0x2f62('0x25')](_0x25c264)[_0x2f62('0x26')](function(_0x59016b){return _0x59016b;});}return null;};}function removeEntity(_0x5383a6,_0x3ad061){return function(_0x426b24){if(_0x426b24){return _0x426b24[_0x2f62('0x27')]()[_0x2f62('0x26')](function(){_0x5383a6[_0x2f62('0x1b')](0xcc)[_0x2f62('0x28')]();});}};}function handleEntityNotFound(_0x11783f,_0x38ebd1){return function(_0x505352){if(!_0x505352){_0x11783f[_0x2f62('0x29')](0x194);}return _0x505352;};}function handleError(_0x1190d4,_0x515ab4){_0x515ab4=_0x515ab4||0x1f4;return function(_0x24244c){logger[_0x2f62('0x2a')](_0x24244c[_0x2f62('0x2b')]);if(_0x24244c[_0x2f62('0x2c')]){delete _0x24244c[_0x2f62('0x2c')];}_0x1190d4[_0x2f62('0x1b')](_0x515ab4)['send'](_0x24244c);};}exports[_0x2f62('0x2d')]=function(_0x23c535,_0x375e9e){var _0x4f8008={},_0x5df546={},_0x4d8252={'count':0x0,'rows':[]};var _0x246686=_[_0x2f62('0x2e')](db[_0x2f62('0x2f')][_0x2f62('0x30')],function(_0x254f01){return{'name':_0x254f01[_0x2f62('0x31')],'type':_0x254f01[_0x2f62('0x32')][_0x2f62('0x33')]};});_0x5df546[_0x2f62('0x34')]=_[_0x2f62('0x2e')](_0x246686,'name');_0x5df546[_0x2f62('0x35')]=_['keys'](_0x23c535['query']);_0x5df546[_0x2f62('0x36')]=_[_0x2f62('0x37')](_0x5df546[_0x2f62('0x34')],_0x5df546[_0x2f62('0x35')]);_0x4f8008[_0x2f62('0x38')]=_['intersection'](_0x5df546[_0x2f62('0x34')],qs[_0x2f62('0x39')](_0x23c535[_0x2f62('0x35')][_0x2f62('0x39')]));_0x4f8008[_0x2f62('0x38')]=_0x4f8008[_0x2f62('0x38')][_0x2f62('0x3a')]?_0x4f8008[_0x2f62('0x38')]:_0x5df546[_0x2f62('0x34')];if(!_0x23c535[_0x2f62('0x35')][_0x2f62('0x3b')](_0x2f62('0x3c'))){_0x4f8008['limit']=qs[_0x2f62('0x1e')](_0x23c535['query'][_0x2f62('0x1e')]);_0x4f8008[_0x2f62('0x1d')]=qs[_0x2f62('0x1d')](_0x23c535[_0x2f62('0x35')][_0x2f62('0x1d')]);}_0x4f8008['order']=qs[_0x2f62('0x3d')](_0x23c535['query']['sort']);_0x4f8008[_0x2f62('0x3e')]=qs[_0x2f62('0x36')](_[_0x2f62('0x3f')](_0x23c535[_0x2f62('0x35')],_0x5df546[_0x2f62('0x36')]),_0x246686);if(_0x23c535[_0x2f62('0x35')][_0x2f62('0x40')]){_0x4f8008['where']=_[_0x2f62('0x41')](_0x4f8008[_0x2f62('0x3e')],{'$or':_[_0x2f62('0x2e')](_0x246686,function(_0x5eb54e){if(_0x5eb54e[_0x2f62('0x32')]!==_0x2f62('0x42')){var _0x5b41d8={};_0x5b41d8[_0x5eb54e[_0x2f62('0x2c')]]={'$like':'%'+_0x23c535[_0x2f62('0x35')][_0x2f62('0x40')]+'%'};return _0x5b41d8;}})});}_0x4f8008=_[_0x2f62('0x41')]({},_0x4f8008,_0x23c535[_0x2f62('0x43')]);var _0x19def3={'where':_0x4f8008[_0x2f62('0x3e')]};return db[_0x2f62('0x2f')][_0x2f62('0x20')](_0x19def3)['then'](function(_0x399b27){_0x4d8252['count']=_0x399b27;if(_0x23c535[_0x2f62('0x35')][_0x2f62('0x44')]){_0x4f8008[_0x2f62('0x45')]=[{'all':!![]}];}return db[_0x2f62('0x2f')][_0x2f62('0x46')](_0x4f8008);})['then'](function(_0x5bb71e){_0x4d8252[_0x2f62('0x47')]=_0x5bb71e;return _0x4d8252;})[_0x2f62('0x26')](respondWithFilteredResult(_0x375e9e,_0x4f8008))[_0x2f62('0x48')](handleError(_0x375e9e,null));};exports[_0x2f62('0x49')]=function(_0x16904c,_0x1a0ca9){var _0x4818c8={'raw':!![],'where':{'id':_0x16904c[_0x2f62('0x4a')]['id']}},_0x2f4942={};_0x2f4942[_0x2f62('0x34')]=_[_0x2f62('0x4b')](db[_0x2f62('0x2f')][_0x2f62('0x30')]);_0x2f4942[_0x2f62('0x35')]=_[_0x2f62('0x4b')](_0x16904c[_0x2f62('0x35')]);_0x2f4942[_0x2f62('0x36')]=_[_0x2f62('0x37')](_0x2f4942[_0x2f62('0x34')],_0x2f4942[_0x2f62('0x35')]);_0x4818c8[_0x2f62('0x38')]=_[_0x2f62('0x37')](_0x2f4942[_0x2f62('0x34')],qs[_0x2f62('0x39')](_0x16904c[_0x2f62('0x35')]['fields']));_0x4818c8[_0x2f62('0x38')]=_0x4818c8[_0x2f62('0x38')][_0x2f62('0x3a')]?_0x4818c8[_0x2f62('0x38')]:_0x2f4942[_0x2f62('0x34')];if(_0x16904c[_0x2f62('0x35')][_0x2f62('0x44')]){_0x4818c8[_0x2f62('0x45')]=[{'all':!![]}];}_0x4818c8=_[_0x2f62('0x41')]({},_0x4818c8,_0x16904c[_0x2f62('0x43')]);return db[_0x2f62('0x2f')][_0x2f62('0x4c')](_0x4818c8)['then'](handleEntityNotFound(_0x1a0ca9,null))[_0x2f62('0x26')](respondWithResult(_0x1a0ca9,null))['catch'](handleError(_0x1a0ca9,null));};exports['create']=function(_0x3a057e,_0x2d2b8b){return db[_0x2f62('0x2f')][_0x2f62('0x4d')](_0x3a057e[_0x2f62('0x4e')],{})['then'](respondWithResult(_0x2d2b8b,0xc9))[_0x2f62('0x48')](handleError(_0x2d2b8b,null));};exports[_0x2f62('0x25')]=function(_0x50ec46,_0x2b41c5){if(_0x50ec46[_0x2f62('0x4e')]['id']){delete _0x50ec46[_0x2f62('0x4e')]['id'];}return db[_0x2f62('0x2f')]['find']({'where':{'id':_0x50ec46[_0x2f62('0x4a')]['id']}})[_0x2f62('0x26')](handleEntityNotFound(_0x2b41c5,null))['then'](saveUpdates(_0x50ec46[_0x2f62('0x4e')],null))[_0x2f62('0x26')](respondWithResult(_0x2b41c5,null))[_0x2f62('0x48')](handleError(_0x2b41c5,null));};exports[_0x2f62('0x27')]=function(_0xc9d48b,_0x21e078){return db[_0x2f62('0x2f')]['find']({'where':{'id':_0xc9d48b['params']['id']}})[_0x2f62('0x26')](handleEntityNotFound(_0x21e078,null))['then'](removeEntity(_0x21e078,null))[_0x2f62('0x48')](handleError(_0x21e078,null));};
\ No newline at end of file
index c95def3..e297c15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26ea=['../../config/logger','api','moment','request-promise','path','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','util'];(function(_0x3414e8,_0x50f334){var _0x24415a=function(_0x542dbd){while(--_0x542dbd){_0x3414e8['push'](_0x3414e8['shift']());}};_0x24415a(++_0x50f334);}(_0x26ea,0x11d));var _0xa26e=function(_0x7176c4,_0x1eaa50){_0x7176c4=_0x7176c4-0x0;var _0xf7f0bf=_0x26ea[_0x7176c4];return _0xf7f0bf;};'use strict';var _=require('lodash');var util=require(_0xa26e('0x0'));var logger=require(_0xa26e('0x1'))(_0xa26e('0x2'));var moment=require(_0xa26e('0x3'));var BPromise=require('bluebird');var rp=require(_0xa26e('0x4'));var fs=require('fs');var path=require(_0xa26e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelApplication.attributes');module[_0xa26e('0x6')]=function(_0x424be9,_0x20306d){return _0x424be9[_0xa26e('0x7')](_0xa26e('0x8'),attributes,{'tableName':_0xa26e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa26e('0xa')});};
\ No newline at end of file
+var _0x181f=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x181f,0x97));var _0xf181=function(_0xc52f0f,_0x47602e){_0xc52f0f=_0xc52f0f-0x0;var _0x13d6f6=_0x181f[_0xc52f0f];return _0x13d6f6;};'use strict';var _=require('lodash');var util=require(_0xf181('0x0'));var logger=require(_0xf181('0x1'))(_0xf181('0x2'));var moment=require(_0xf181('0x3'));var BPromise=require(_0xf181('0x4'));var rp=require(_0xf181('0x5'));var fs=require('fs');var path=require(_0xf181('0x6'));var rimraf=require(_0xf181('0x7'));var config=require(_0xf181('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0xf181('0x9')]=function(_0x2e10a5,_0x16f0f8){return _0x2e10a5[_0xf181('0xa')](_0xf181('0xb'),attributes,{'tableName':_0xf181('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf181('0xd'),'collate':_0xf181('0xe')});};
\ No newline at end of file
index a9dde8e..2e97684 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48bd=['client','http','request','then','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelApplication,\x20%s,\x20%s','message','catch','OpenchannelApplication','update','body','options','raw','where','attributes','limit','UpdateOpenchannelApplication','lodash','util','moment','bluebird','ioredis','../../config/logger','jayson/promise'];(function(_0x1ba8ed,_0x38ac08){var _0x181793=function(_0x4a1a82){while(--_0x4a1a82){_0x1ba8ed['push'](_0x1ba8ed['shift']());}};_0x181793(++_0x38ac08);}(_0x48bd,0x1bb));var _0xd48b=function(_0x168a1c,_0xb59350){_0x168a1c=_0x168a1c-0x0;var _0x2cc8e2=_0x48bd[_0x168a1c];return _0x2cc8e2;};'use strict';var _=require(_0xd48b('0x0'));var util=require(_0xd48b('0x1'));var moment=require(_0xd48b('0x2'));var BPromise=require(_0xd48b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd48b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd48b('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd48b('0x6'));var client=jayson[_0xd48b('0x7')][_0xd48b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x108d37,_0x2e98fd,_0x48497e){return new BPromise(function(_0x32afed,_0x3f55b2){return client[_0xd48b('0x9')](_0x108d37,_0x48497e)[_0xd48b('0xa')](function(_0x42e710){logger[_0xd48b('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x2e98fd,'request\x20sent');logger[_0xd48b('0xc')](_0xd48b('0xd'),_0x2e98fd,_0xd48b('0xe'),JSON[_0xd48b('0xf')](_0x42e710));if(_0x42e710[_0xd48b('0x10')]){if(_0x42e710[_0xd48b('0x10')][_0xd48b('0x11')]===0x1f4){logger['error'](_0xd48b('0x12'),_0x2e98fd,_0x42e710[_0xd48b('0x10')][_0xd48b('0x13')]);return _0x3f55b2(_0x42e710[_0xd48b('0x10')]['message']);}logger[_0xd48b('0x10')](_0xd48b('0x12'),_0x2e98fd,_0x42e710[_0xd48b('0x10')][_0xd48b('0x13')]);return _0x32afed(_0x42e710['error'][_0xd48b('0x13')]);}else{logger[_0xd48b('0xb')](_0xd48b('0x12'),_0x2e98fd,_0xd48b('0xe'));_0x32afed(_0x42e710['result'][_0xd48b('0x13')]);}})[_0xd48b('0x14')](function(_0x40cfcc){logger[_0xd48b('0x10')](_0xd48b('0x12'),_0x2e98fd,_0x40cfcc);_0x3f55b2(_0x40cfcc);});});}exports['UpdateOpenchannelApplication']=function(_0x1b2468){var _0x5c359f=this;return new Promise(function(_0x5096b6,_0x350605){return db[_0xd48b('0x15')][_0xd48b('0x16')](_0x1b2468[_0xd48b('0x17')],{'raw':_0x1b2468[_0xd48b('0x18')]?_0x1b2468[_0xd48b('0x18')][_0xd48b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b2468[_0xd48b('0x18')]?_0x1b2468['options'][_0xd48b('0x1a')]||null:null,'attributes':_0x1b2468['options']?_0x1b2468['options'][_0xd48b('0x1b')]||null:null,'limit':_0x1b2468[_0xd48b('0x18')]?_0x1b2468['options'][_0xd48b('0x1c')]||null:null})[_0xd48b('0xa')](function(_0x314e3b){logger[_0xd48b('0xb')](_0xd48b('0x1d'),_0x1b2468);logger[_0xd48b('0xc')]('UpdateOpenchannelApplication',_0x1b2468,JSON[_0xd48b('0xf')](_0x314e3b));_0x5096b6(_0x314e3b);})[_0xd48b('0x14')](function(_0x4fc2f5){logger[_0xd48b('0x10')](_0xd48b('0x1d'),_0x4fc2f5['message'],_0x1b2468);_0x350605(_0x5c359f[_0xd48b('0x10')](0x1f4,_0x4fc2f5[_0xd48b('0x13')]));});});};
\ No newline at end of file
+var _0x1ba8=['code','message','info','result','catch','OpenchannelApplication','update','body','options','raw','attributes','limit','UpdateOpenchannelApplication','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x1ba8,0x1cd));var _0x81ba=function(_0x8fb951,_0x1a3a8c){_0x8fb951=_0x8fb951-0x0;var _0x3368f6=_0x1ba8[_0x8fb951];return _0x3368f6;};'use strict';var _=require(_0x81ba('0x0'));var util=require(_0x81ba('0x1'));var moment=require('moment');var BPromise=require(_0x81ba('0x2'));var rs=require(_0x81ba('0x3'));var fs=require('fs');var Redis=require(_0x81ba('0x4'));var db=require(_0x81ba('0x5'))['db'];var utils=require(_0x81ba('0x6'));var logger=require(_0x81ba('0x7'))('rpc');var config=require(_0x81ba('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x81ba('0x9')][_0x81ba('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21f07d,_0xf40e56,_0x313f8a){return new BPromise(function(_0x42a781,_0x460764){return client[_0x81ba('0xb')](_0x21f07d,_0x313f8a)[_0x81ba('0xc')](function(_0x49780a){logger['info'](_0x81ba('0xd'),_0xf40e56,_0x81ba('0xe'));logger[_0x81ba('0xf')](_0x81ba('0x10'),_0xf40e56,_0x81ba('0xe'),JSON[_0x81ba('0x11')](_0x49780a));if(_0x49780a[_0x81ba('0x12')]){if(_0x49780a['error'][_0x81ba('0x13')]===0x1f4){logger['error'](_0x81ba('0xd'),_0xf40e56,_0x49780a['error'][_0x81ba('0x14')]);return _0x460764(_0x49780a['error']['message']);}logger[_0x81ba('0x12')](_0x81ba('0xd'),_0xf40e56,_0x49780a['error'][_0x81ba('0x14')]);return _0x42a781(_0x49780a[_0x81ba('0x12')]['message']);}else{logger[_0x81ba('0x15')]('OpenchannelApplication,\x20%s,\x20%s',_0xf40e56,_0x81ba('0xe'));_0x42a781(_0x49780a[_0x81ba('0x16')][_0x81ba('0x14')]);}})[_0x81ba('0x17')](function(_0x13481b){logger[_0x81ba('0x12')](_0x81ba('0xd'),_0xf40e56,_0x13481b);_0x460764(_0x13481b);});});}exports['UpdateOpenchannelApplication']=function(_0x1bff0b){var _0x3e3017=this;return new Promise(function(_0x57812f,_0x50f429){return db[_0x81ba('0x18')][_0x81ba('0x19')](_0x1bff0b[_0x81ba('0x1a')],{'raw':_0x1bff0b[_0x81ba('0x1b')]?_0x1bff0b[_0x81ba('0x1b')][_0x81ba('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bff0b[_0x81ba('0x1b')]?_0x1bff0b[_0x81ba('0x1b')]['where']||null:null,'attributes':_0x1bff0b[_0x81ba('0x1b')]?_0x1bff0b[_0x81ba('0x1b')][_0x81ba('0x1d')]||null:null,'limit':_0x1bff0b[_0x81ba('0x1b')]?_0x1bff0b[_0x81ba('0x1b')][_0x81ba('0x1e')]||null:null})[_0x81ba('0xc')](function(_0x1719b7){logger[_0x81ba('0x15')](_0x81ba('0x1f'),_0x1bff0b);logger[_0x81ba('0xf')](_0x81ba('0x1f'),_0x1bff0b,JSON[_0x81ba('0x11')](_0x1719b7));_0x57812f(_0x1719b7);})[_0x81ba('0x17')](function(_0x5ee451){logger[_0x81ba('0x12')]('UpdateOpenchannelApplication',_0x5ee451[_0x81ba('0x14')],_0x1bff0b);_0x50f429(_0x3e3017[_0x81ba('0x12')](0x1f4,_0x5ee451[_0x81ba('0x14')]));});});};
\ No newline at end of file
index 8850eb5..485cd00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ed1=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','addTags','openchannelinteraction:update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','util'];(function(_0x2300c7,_0x255f74){var _0x23f720=function(_0x3fea57){while(--_0x3fea57){_0x2300c7['push'](_0x2300c7['shift']());}};_0x23f720(++_0x255f74);}(_0x8ed1,0x8b));var _0x18ed=function(_0x46c549,_0x4df54b){_0x46c549=_0x46c549-0x0;var _0x2dae67=_0x8ed1[_0x46c549];return _0x2dae67;};'use strict';var multer=require('multer');var util=require(_0x18ed('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x18ed('0x1'));var router=express[_0x18ed('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x18ed('0x3'));var interaction=require(_0x18ed('0x4'));var config=require(_0x18ed('0x5'));var controller=require(_0x18ed('0x6'));router[_0x18ed('0x7')]('/',auth[_0x18ed('0x8')](),controller[_0x18ed('0x9')]);router[_0x18ed('0x7')](_0x18ed('0xa'),auth[_0x18ed('0x8')](),controller[_0x18ed('0xb')]);router[_0x18ed('0x7')](_0x18ed('0xc'),auth[_0x18ed('0x8')](),controller['show']);router[_0x18ed('0x7')](_0x18ed('0xd'),auth[_0x18ed('0x8')](),controller['getMessages']);router['get'](_0x18ed('0xe'),auth[_0x18ed('0x8')](),controller[_0x18ed('0xf')]);router[_0x18ed('0x10')]('/',auth[_0x18ed('0x8')](),controller['create']);router[_0x18ed('0x10')](_0x18ed('0xd'),auth[_0x18ed('0x8')](),controller[_0x18ed('0x11')]);router[_0x18ed('0x10')](_0x18ed('0x12'),auth['isAuthenticated'](),interaction[_0x18ed('0x13')](_0x18ed('0x14'),'openchannelinteraction:addtags'),controller[_0x18ed('0x15')]);router['put'](_0x18ed('0xc'),auth[_0x18ed('0x8')](),interaction['tracked'](_0x18ed('0x14'),_0x18ed('0x16')),controller['update']);router[_0x18ed('0x17')](_0x18ed('0xc'),auth['isAuthenticated'](),interaction[_0x18ed('0x13')]('openchannel',_0x18ed('0x18')),controller[_0x18ed('0x19')]);router[_0x18ed('0x17')](_0x18ed('0x12'),auth[_0x18ed('0x8')](),controller[_0x18ed('0x1a')]);module[_0x18ed('0x1b')]=router;
\ No newline at end of file
+var _0xdb2d=['post','/:id/messages','addMessage','/:id/tags','openchannelinteraction:update','update','delete','tracked','openchannel','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','getMessages','/:id/download','create'];(function(_0x20dfe7,_0x3847dc){var _0x1375d8=function(_0x4d1bff){while(--_0x4d1bff){_0x20dfe7['push'](_0x20dfe7['shift']());}};_0x1375d8(++_0x3847dc);}(_0xdb2d,0xa7));var _0xddb2=function(_0x4b6a07,_0x661c52){_0x4b6a07=_0x4b6a07-0x0;var _0x3996b3=_0xdb2d[_0x4b6a07];return _0x3996b3;};'use strict';var multer=require(_0xddb2('0x0'));var util=require(_0xddb2('0x1'));var path=require(_0xddb2('0x2'));var timeout=require(_0xddb2('0x3'));var express=require('express');var router=express[_0xddb2('0x4')]();var fs_extra=require(_0xddb2('0x5'));var auth=require(_0xddb2('0x6'));var interaction=require(_0xddb2('0x7'));var config=require(_0xddb2('0x8'));var controller=require(_0xddb2('0x9'));router[_0xddb2('0xa')]('/',auth[_0xddb2('0xb')](),controller[_0xddb2('0xc')]);router[_0xddb2('0xa')](_0xddb2('0xd'),auth[_0xddb2('0xb')](),controller[_0xddb2('0xe')]);router[_0xddb2('0xa')](_0xddb2('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xddb2('0xa')]('/:id/messages',auth[_0xddb2('0xb')](),controller[_0xddb2('0x10')]);router[_0xddb2('0xa')](_0xddb2('0x11'),auth[_0xddb2('0xb')](),controller['download']);router['post']('/',auth[_0xddb2('0xb')](),controller[_0xddb2('0x12')]);router[_0xddb2('0x13')](_0xddb2('0x14'),auth[_0xddb2('0xb')](),controller[_0xddb2('0x15')]);router[_0xddb2('0x13')](_0xddb2('0x16'),auth[_0xddb2('0xb')](),interaction['tracked']('openchannel','openchannelinteraction:addtags'),controller['addTags']);router['put'](_0xddb2('0xf'),auth[_0xddb2('0xb')](),interaction['tracked']('openchannel',_0xddb2('0x17')),controller[_0xddb2('0x18')]);router[_0xddb2('0x19')](_0xddb2('0xf'),auth[_0xddb2('0xb')](),interaction[_0xddb2('0x1a')](_0xddb2('0x1b'),_0xddb2('0x1c')),controller[_0xddb2('0x1d')]);router[_0xddb2('0x19')](_0xddb2('0x16'),auth['isAuthenticated'](),controller[_0xddb2('0x1e')]);module['exports']=router;
\ No newline at end of file
index 307cb23..8461dee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2297=['STRING','ENUM','out','BOOLEAN','sequelize','exports','DATE'];(function(_0xd98b96,_0xbff466){var _0x37e055=function(_0x4a1746){while(--_0x4a1746){_0xd98b96['push'](_0xd98b96['shift']());}};_0x37e055(++_0xbff466);}(_0x2297,0x100));var _0x7229=function(_0x353a69,_0x741fa6){_0x353a69=_0x353a69-0x0;var _0x332d59=_0x2297[_0x353a69];return _0x332d59;};'use strict';var Sequelize=require(_0x7229('0x0'));module[_0x7229('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7229('0x2')]},'disposition':{'type':Sequelize[_0x7229('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x7229('0x3')]},'note':{'type':Sequelize[_0x7229('0x3')]},'read1stAt':{'type':Sequelize[_0x7229('0x2')]},'threadId':{'type':Sequelize[_0x7229('0x3')]},'externalUrl':{'type':Sequelize[_0x7229('0x3')]},'lastMsgAt':{'type':Sequelize[_0x7229('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x7229('0x4')]('in',_0x7229('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x7229('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x7229('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x2dab=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0x2dab,0x120));var _0xb2da=function(_0x191ff6,_0x497a69){_0x191ff6=_0x191ff6-0x0;var _0x15dd12=_0x2dab[_0x191ff6];return _0x15dd12;};'use strict';var Sequelize=require(_0xb2da('0x0'));module[_0xb2da('0x1')]={'closed':{'type':Sequelize[_0xb2da('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb2da('0x3')]},'disposition':{'type':Sequelize[_0xb2da('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb2da('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xb2da('0x3')]},'threadId':{'type':Sequelize[_0xb2da('0x4')]},'externalUrl':{'type':Sequelize[_0xb2da('0x4')]},'lastMsgAt':{'type':Sequelize[_0xb2da('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb2da('0x5')]('in',_0xb2da('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xb2da('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index fbdf20e..5a7838d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13b5=['users','u.id\x20=\x20ui.UserId','openchannel_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','buildExpression','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','text','body','start','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','DESC','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','fields','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','catch','show','params','includeAll','options','create','update','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','pick','format','include','findAll','addTags','setTags','omit','spread','color','emit','openchannelInteractionTags:save','removeTags','download','join','root','files','transcript-%d-%s.zip','fullname','CmContact','firstName','Attachment','Messages','OpenchannelAccount','Owner','mkdirSync','Openchannel','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','lastName','basename','secret','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','error','stack','name','Users','map','split','forEach','push','TagIds','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','from','tools_tags','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join'];(function(_0x122c13,_0xafe7bd){var _0x33a525=function(_0x1af177){while(--_0x1af177){_0x122c13['push'](_0x122c13['shift']());}};_0x33a525(++_0xafe7bd);}(_0x13b5,0x18a));var _0x513b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x13b5[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0x513b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x513b('0x1'));var jsonpatch=require(_0x513b('0x2'));var rp=require(_0x513b('0x3'));var moment=require('moment');var BPromise=require(_0x513b('0x4'));var Mustache=require(_0x513b('0x5'));var util=require(_0x513b('0x6'));var path=require(_0x513b('0x7'));var sox=require(_0x513b('0x8'));var csv=require(_0x513b('0x9'));var ejs=require(_0x513b('0xa'));var fs=require('fs');var fs_extra=require(_0x513b('0xb'));var _=require('lodash');var squel=require(_0x513b('0xc'));var crypto=require('crypto');var jsforce=require(_0x513b('0xd'));var deskjs=require(_0x513b('0xe'));var toCsv=require(_0x513b('0x9'));var querystring=require(_0x513b('0xf'));var Papa=require(_0x513b('0x10'));var Redis=require(_0x513b('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x513b('0x12'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x513b('0x13'));var logger=require(_0x513b('0x14'))(_0x513b('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x513b('0x16'))['db'];config[_0x513b('0x17')]=_['defaults'](config[_0x513b('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x513b('0x18'))(new Redis(config['redis']));require(_0x513b('0x19'))[_0x513b('0x1a')](socket);function respondWithStatusCode(_0x5114d4,_0xbad75){_0xbad75=_0xbad75||0xcc;return function(_0x52b4de){if(_0x52b4de){return _0x5114d4[_0x513b('0x1b')](_0xbad75);}return _0x5114d4[_0x513b('0x1c')](_0xbad75)[_0x513b('0x1d')]();};}function respondWithResult(_0x1aaf31,_0x225c78){_0x225c78=_0x225c78||0xc8;return function(_0x372fb3){if(_0x372fb3){return _0x1aaf31[_0x513b('0x1c')](_0x225c78)[_0x513b('0x1e')](_0x372fb3);}};}function respondWithFilteredResult(_0x209841,_0x21f212){return function(_0x242a06){if(_0x242a06){var _0x42c3fe=typeof _0x21f212[_0x513b('0x1f')]==='undefined'&&typeof _0x21f212[_0x513b('0x20')]===_0x513b('0x21');var _0x3bd3e1=_0x242a06[_0x513b('0x22')];var _0x3d72e4=_0x42c3fe?0x0:_0x21f212[_0x513b('0x1f')];var _0x47457d=_0x42c3fe?_0x242a06[_0x513b('0x22')]:_0x21f212['offset']+_0x21f212[_0x513b('0x20')];var _0x3cd1f6;if(_0x47457d>=_0x3bd3e1){_0x47457d=_0x3bd3e1;_0x3cd1f6=0xc8;}else{_0x3cd1f6=0xce;}_0x209841[_0x513b('0x1c')](_0x3cd1f6);return _0x209841[_0x513b('0x23')]('Content-Range',_0x3d72e4+'-'+_0x47457d+'/'+_0x3bd3e1)[_0x513b('0x1e')](_0x242a06);}return null;};}function patchUpdates(_0x5ef607){return function(_0x5f01e6){try{jsonpatch[_0x513b('0x24')](_0x5f01e6,_0x5ef607,!![]);}catch(_0x3388c5){return BPromise[_0x513b('0x25')](_0x3388c5);}return _0x5f01e6[_0x513b('0x26')]();};}function saveUpdates(_0x1f32db,_0x3232fa){return function(_0x4b8efd){if(_0x4b8efd){return _0x4b8efd['update'](_0x1f32db)[_0x513b('0x27')](function(_0x1cbd94){return _0x1cbd94;});}return null;};}function removeEntity(_0x2e864a,_0x20a5e2){return function(_0x267ada){if(_0x267ada){return _0x267ada[_0x513b('0x28')]()[_0x513b('0x27')](function(){_0x2e864a[_0x513b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb2ec3a,_0x4491cc){return function(_0x35b2c8){if(!_0x35b2c8){_0xb2ec3a['sendStatus'](0x194);}return _0x35b2c8;};}function handleError(_0x248741,_0x1af861){_0x1af861=_0x1af861||0x1f4;return function(_0x2132c4){logger[_0x513b('0x29')](_0x2132c4[_0x513b('0x2a')]);if(_0x2132c4['name']){delete _0x2132c4[_0x513b('0x2b')];}_0x248741['status'](_0x1af861)['send'](_0x2132c4);};}function getInteractionUsers(_0x3dd9f4,_0x5280eb){return new BPromise(function(_0x1ce579,_0x25bc84){try{if(_0x5280eb[_0x3dd9f4['id']]){_0x3dd9f4[_0x513b('0x2c')]=_[_0x513b('0x2d')](_0x5280eb[_0x3dd9f4['id']],function(_0x1bdcb5){return{'id':_0x1bdcb5['id'],'fullname':_0x1bdcb5['fullname']};});}}catch(_0x287ceb){_0x25bc84(_0x287ceb);}_0x1ce579(_0x3dd9f4);});}function getInteractionTags(_0x27b922,_0xe7c0f5){return new BPromise(function(_0x26cc04,_0x1ada09){try{if(_0x27b922['TagIds']){_0x27b922['Tags']=[];_0x27b922['TagIds'][_0x513b('0x2e')](',')[_0x513b('0x2f')](function(_0x4c4837){_0x27b922['Tags'][_0x513b('0x30')](_0xe7c0f5[_0x4c4837]);});}delete _0x27b922[_0x513b('0x31')];}catch(_0x500989){_0x1ada09(_0x500989);}_0x26cc04(_0x27b922);});}function updateOpenchannelInteraction(_0x1ae315,_0x2f0016,_0x49ece1){return new BPromise(function(_0x4e48d6,_0x48b997){return getInteractionUsers(_0x1ae315,_0x49ece1)[_0x513b('0x27')](function(_0x375d49){return getInteractionTags(_0x375d49,_0x2f0016);})[_0x513b('0x27')](function(_0x5bbd78){_0x4e48d6(_0x5bbd78);})['catch'](function(_0x2b79ef){_0x48b997(_0x2b79ef);});});}exports[_0x513b('0x32')]=function(_0xb95e4e,_0x5d8504){var _0xbb5ab2={},_0xe99fa={},_0x276229={'count':0x0,'rows':[]};var _0x3336e3=_[_0x513b('0x2d')](db[_0x513b('0x33')][_0x513b('0x34')],function(_0x51b6b2){return{'name':_0x51b6b2[_0x513b('0x35')],'type':_0x51b6b2[_0x513b('0x36')][_0x513b('0x37')]};});_0xe99fa['model']=_[_0x513b('0x2d')](_0x3336e3,_0x513b('0x2b'));_0xe99fa[_0x513b('0x38')]=_[_0x513b('0x39')](_0xb95e4e[_0x513b('0x38')]);_0xe99fa['filters']=_[_0x513b('0x3a')](_0xe99fa[_0x513b('0x3b')],_0xe99fa[_0x513b('0x38')]);_0xbb5ab2[_0x513b('0x3c')]=_['intersection'](_0xe99fa[_0x513b('0x3b')],qs['fields'](_0xb95e4e[_0x513b('0x38')]['fields']));_0xbb5ab2['attributes']=_0xbb5ab2[_0x513b('0x3c')][_0x513b('0x3d')]?_0xbb5ab2['attributes']:_0xe99fa[_0x513b('0x3b')];if(!_0xb95e4e[_0x513b('0x38')][_0x513b('0x3e')](_0x513b('0x3f'))){_0xbb5ab2['limit']=qs['limit'](_0xb95e4e['query'][_0x513b('0x20')]);_0xbb5ab2[_0x513b('0x1f')]=qs[_0x513b('0x1f')](_0xb95e4e[_0x513b('0x38')]['offset']);}_0xbb5ab2[_0x513b('0x40')]=qs[_0x513b('0x41')](_0xb95e4e[_0x513b('0x38')][_0x513b('0x41')]);_0xbb5ab2[_0x513b('0x42')]=qs[_0x513b('0x43')](_['pick'](_0xb95e4e[_0x513b('0x38')],_0xe99fa[_0x513b('0x43')]),_0x3336e3);var _0x28ca31=[];var _0x50b018=squel[_0x513b('0x44')]()['field']('id')[_0x513b('0x45')](_0x513b('0x2b'))['field']('color')[_0x513b('0x46')](_0x513b('0x47'));var _0x25aee0=squel[_0x513b('0x44')]()['field'](_0x513b('0x48'))['field']('u.fullname')[_0x513b('0x45')](_0x513b('0x49'))[_0x513b('0x46')](_0x513b('0x4a'),'ui')[_0x513b('0x4b')](_0x513b('0x4c'),'u',_0x513b('0x4d'));var _0x54ff1e=squel[_0x513b('0x44')]()[_0x513b('0x46')](_0x513b('0x4e'),'i')[_0x513b('0x4b')]('cm_contacts','c',_0x513b('0x4f'))[_0x513b('0x4b')](_0x513b('0x4c'),'o',_0x513b('0x50'))[_0x513b('0x4b')]('openchannel_accounts','a',_0x513b('0x51'))[_0x513b('0x4b')](_0x513b('0x52'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x513b('0x4b')]('openchannel_interaction_has_tags','it',_0x513b('0x53'))[_0x513b('0x4b')](_0x513b('0x47'),'t','t.id\x20=\x20it.TagId');var _0x4589b5=squel[_0x513b('0x54')]();var _0xc63553=[];var _0x299fa6=squel[_0x513b('0x54')]();var _0x303e3d;if(_0xb95e4e[_0x513b('0x38')][_0x513b('0x55')]){_0x303e3d=as[_0x513b('0x56')](_0xb95e4e[_0x513b('0x38')][_0x513b('0x55')]);var _0x40776a=_0x303e3d[_0x513b('0x57')];for(var _0x4985b4=0x0;_0x4985b4<_0x303e3d[_0x513b('0x58')]['length'];_0x4985b4++){var _0x140c79=_0x303e3d[_0x513b('0x58')][_0x4985b4];var _0x147c0c='i';var _0x4700a8=_['find'](_0x3336e3,[_0x513b('0x2b'),_0x140c79[_0x513b('0x45')]]);if(!_0x4700a8){switch(_0x140c79[_0x513b('0x45')]){case _0x513b('0x59'):if(_0x140c79[_0x513b('0x5a')]==0x1){_0x54ff1e[_0x513b('0x5b')]('`'+_0x140c79['field']+'`\x20=\x200');}else{_0x54ff1e[_0x513b('0x5b')]('`'+_0x140c79[_0x513b('0x45')]+_0x513b('0x5c'));}break;case _0x513b('0x5d'):if(_0x140c79[_0x513b('0x5e')]===_0x513b('0x5f')){if(_0x140c79['value'][_0x513b('0x2e')]('\x20')['length']>0x1){_0x4589b5[_0x40776a](_0x513b('0x60'),qs[_0x513b('0x61')](_0x140c79['value']),null);}else{var _0x5e4b12='%'+_0x140c79[_0x513b('0x5a')]+'%';_0x4589b5[_0x40776a](_0x513b('0x62'),_0x5e4b12,_0x5e4b12,_0x5e4b12);}}else{_0x4700a8=_[_0x513b('0x63')](_0x3336e3,[_0x513b('0x2b'),'ContactId']);_0x140c79['field']='ContactId';_0x94e4a4=as[_0x513b('0x64')](_0x147c0c,_0x4700a8[_0x513b('0x36')],_0x140c79);_0x4589b5[_0x40776a](_0x94e4a4['text'],_0x94e4a4[_0x513b('0x5a')]['start'],_0x94e4a4[_0x513b('0x5a')][_0x513b('0x1d')]);}break;case _0x513b('0x65'):var _0x542c31=_0x140c79[_0x513b('0x5a')]['split'](',')['map'](function(_0xaa519){return Number(_0xaa519);});_0x542c31[_0x513b('0x2f')](function(_0x4964b7){_0x299fa6['or'](_0x513b('0x66'),'%,'+_0x4964b7+',%');});_0xc63553=_[_0x513b('0x67')](_0xc63553,_0x542c31);break;case _0x513b('0x68'):if(_0x140c79['operator']===_0x513b('0x5f')){_0x4589b5[_0x40776a]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x140c79[_0x513b('0x5a')]+'%',null);}else{_0x4700a8=_[_0x513b('0x63')](_0x3336e3,[_0x513b('0x2b'),_0x513b('0x69')]);_0x140c79['field']='UserId';_0x94e4a4=as[_0x513b('0x64')](_0x147c0c,_0x4700a8['type'],_0x140c79);_0x4589b5[_0x40776a](_0x94e4a4[_0x513b('0x6a')],_0x94e4a4[_0x513b('0x5a')]['start'],_0x94e4a4[_0x513b('0x5a')][_0x513b('0x1d')]);}break;case _0x513b('0x6b'):_0x94e4a4=as[_0x513b('0x64')]('me',null,_0x140c79);_0x4589b5[_0x40776a](_0x94e4a4[_0x513b('0x6a')],_0x94e4a4[_0x513b('0x5a')]['start'],_0x94e4a4['value']['end']);break;}}else{var _0x94e4a4=as[_0x513b('0x64')](_0x147c0c,_0x4700a8[_0x513b('0x36')],_0x140c79);_0x4589b5[_0x40776a](_0x94e4a4[_0x513b('0x6a')],_0x94e4a4['value'][_0x513b('0x6c')],_0x94e4a4['value'][_0x513b('0x1d')]);}}}else{var _0x30f7c9=_(_0xb95e4e[_0x513b('0x38')])['keys']()[_0x513b('0x2d')](function(_0x4cad4e){return _['some'](_0x3336e3,[_0x513b('0x2b'),_0x4cad4e])?_0x4cad4e:undefined;})[_0x513b('0x6d')]()[_0x513b('0x5a')]();if(!_[_0x513b('0x6e')](_0x30f7c9)){_0x30f7c9[_0x513b('0x2f')](function(_0x5958f9){if(_0x5958f9===_0x513b('0x6f')){_0x54ff1e['where'](_0x513b('0x70'),[]['concat'](_0xb95e4e[_0x513b('0x38')][_0x5958f9]));}else if(_0x5958f9===_0x513b('0x71')){var _0x596b9c=JSON[_0x513b('0x72')](_0xb95e4e[_0x513b('0x38')][_0x5958f9])[_0x513b('0x73')];var _0xb540d3=JSON['parse'](_0xb95e4e[_0x513b('0x38')][_0x5958f9])['$lte'];_0x54ff1e[_0x513b('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x596b9c,_0xb540d3);}else{if(_0xb95e4e[_0x513b('0x38')][_0x5958f9]===_0x513b('0x74')){_0x54ff1e['where']('i.'+_0x5958f9+'\x20IS\x20NULL');}else{_0x54ff1e['where']('i.'+_0x5958f9+'\x20=\x20?',_0xb95e4e[_0x513b('0x38')][_0x5958f9]);}}});}if(_0xb95e4e[_0x513b('0x38')][_0x513b('0x75')]){if(_0xb95e4e[_0x513b('0x38')][_0x513b('0x75')]==0x1){_0x54ff1e[_0x513b('0x5b')](_0x513b('0x76'));}else{_0x54ff1e[_0x513b('0x5b')](_0x513b('0x77'));}}if(_0xb95e4e['query'][_0x513b('0x78')]){_0xc63553=_[_0x513b('0x79')](_0xb95e4e['query'][_0x513b('0x78')])?_0xb95e4e[_0x513b('0x38')]['tag']:new Array(_0xb95e4e[_0x513b('0x38')][_0x513b('0x78')]);_0xc63553['forEach'](function(_0x49a5a4){_0x299fa6['or'](_0x513b('0x66'),'%,'+_0x49a5a4+',%');});}if(_0xb95e4e[_0x513b('0x38')][_0x513b('0x7a')]){var _0x3ca057=_0xb95e4e[_0x513b('0x38')][_0x513b('0x7a')]['replace']('\x5c','\x5c\x5c')[_0x513b('0x7b')](/'/g,'\x27\x27');if(qs[_0x513b('0x7c')](_0x3ca057)){_0x4589b5['or'](_0x513b('0x7d'),_0x3ca057+'%');}else{_0x4589b5['or'](_0x513b('0x7e'),qs['getFullTextValue'](_0x3ca057))['or'](_0x513b('0x7f'),_0x3ca057+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x3ca057+'%');}}}_0x54ff1e[_0x513b('0x42')](_0x4589b5);_0x54ff1e[_0x513b('0x80')](_0x513b('0x81'));var _0x2fe7d1={'type':db[_0x513b('0x82')][_0x513b('0x83')][_0x513b('0x84')],'raw':!![]};var _0x184c60=_0x54ff1e['clone']();_0x184c60[_0x513b('0x45')](_0x513b('0x81'));_0x184c60[_0x513b('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x513b('0x59'));if(_0xbb5ab2[_0x513b('0x40')]){_0xbb5ab2[_0x513b('0x40')][_0x513b('0x2f')](function(_0x3ee233){var _0x28b361=_0x3ee233[0x0]==='contactName'?_0x3ee233[0x0]:'i.'+_0x3ee233[0x0];_0x54ff1e[_0x513b('0x40')](_0x28b361,_0x3ee233[0x1]===_0x513b('0x85')?![]:!![]);});}if(!_[_0x513b('0x6e')](_0xc63553)){_0x54ff1e[_0x513b('0x5b')](_0x299fa6);_0x184c60[_0x513b('0x42')]('t.id\x20IN\x20?',_0xc63553);}BPromise[_0x513b('0x86')]()[_0x513b('0x27')](function(){if(!_0x303e3d){if(_0xb95e4e[_0x513b('0x38')][_0x513b('0x6f')])return;_0x184c60[_0x513b('0x42')](_0x513b('0x87'));_0x54ff1e[_0x513b('0x42')](_0x513b('0x87'));return;}if(_0xb95e4e[_0x513b('0x88')][_0x513b('0x89')]!==_0x513b('0x8a'))return;return _0xb95e4e[_0x513b('0x88')][_0x513b('0x8b')]({'attributes':['id'],'raw':!![]})[_0x513b('0x27')](function(_0x1c603d){if(_[_0x513b('0x6e')](_0x1c603d)){_0x184c60['where'](_0x513b('0x8c'));_0x54ff1e[_0x513b('0x42')](_0x513b('0x8c'));}else{_0x184c60[_0x513b('0x42')](_0x513b('0x70'),_[_0x513b('0x2d')](_0x1c603d,'id'));_0x54ff1e['where'](_0x513b('0x70'),_[_0x513b('0x2d')](_0x1c603d,'id'));}});})[_0x513b('0x27')](function(){if(_0xb95e4e[_0x513b('0x88')]['role']===_0x513b('0x8a')&&!_0x303e3d&&!_0xb95e4e['query'][_0x513b('0x6f')])return[];return db[_0x513b('0x8d')][_0x513b('0x38')](_0x184c60[_0x513b('0x8e')](),_0x2fe7d1);})[_0x513b('0x27')](function(_0x1111f6){_0x276229[_0x513b('0x22')]=_0x1111f6['length'];if(_0x276229['count']===0x0)return[];return db['sequelize'][_0x513b('0x38')](_0x50b018['toString'](),_0x2fe7d1)['then'](function(_0x3c707a){_0x28ca31=_['keyBy'](_0x3c707a,'id');_0x2fe7d1=_[_0x513b('0x8f')](_0x2fe7d1,{'model':db[_0x513b('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xb95e4e[_0x513b('0x38')][_0x513b('0x90')]){_0xbb5ab2[_0x513b('0x3c')][_0x513b('0x2f')](function(_0x1e5ab6){_0x54ff1e['field']('i.'+_0x1e5ab6);});}else{_0x54ff1e['field'](_0x513b('0x91'),_0x513b('0x59'));_0x54ff1e['field'](_0x513b('0x92'),_0x513b('0x93'));_0x54ff1e['field'](_0x513b('0x94'),_0x513b('0x95'));_0x54ff1e[_0x513b('0x45')](_0x513b('0x96'),_0x513b('0x97'));_0x54ff1e[_0x513b('0x45')]('i.*');_0x54ff1e[_0x513b('0x45')]('c.firstName','Contact.firstName');_0x54ff1e[_0x513b('0x45')](_0x513b('0x98'),_0x513b('0x99'));_0x54ff1e['field'](_0x513b('0x9a'),_0x513b('0x9b'));_0x54ff1e['field']('c.phone',_0x513b('0x9c'));_0x54ff1e[_0x513b('0x45')](_0x513b('0x9d'),_0x513b('0x9e'));_0x54ff1e[_0x513b('0x45')](_0x513b('0x9f'),_0x513b('0xa0'));_0x54ff1e[_0x513b('0x45')](_0x513b('0xa1'),_0x513b('0xa2'));_0x54ff1e[_0x513b('0x45')](_0x513b('0xa3'),_0x513b('0xa4'));_0x54ff1e[_0x513b('0x45')](_0x513b('0xa5'),_0x513b('0x31'));}if(_0xbb5ab2[_0x513b('0x20')])_0x54ff1e[_0x513b('0x20')](_0xbb5ab2['limit']);if(_0xbb5ab2[_0x513b('0x1f')])_0x54ff1e['offset'](_0xbb5ab2[_0x513b('0x1f')]);return db[_0x513b('0x8d')]['query'](_0x54ff1e['toString'](),_0x2fe7d1);})['then'](function(_0x328f2d){if(_0x328f2d[_0x513b('0x3d')]>0x0)_0x25aee0[_0x513b('0x42')](_0x513b('0xa6'),_[_0x513b('0x2d')](_0x328f2d,'id'));return db[_0x513b('0x8d')][_0x513b('0x38')](_0x25aee0[_0x513b('0x8e')](),_0x2fe7d1)[_0x513b('0x27')](function(_0x47dab0){var _0x3c54f5=_[_0x513b('0xa7')](_0x47dab0,_0x513b('0xa8'));var _0x45cd8d=[];_0x328f2d[_0x513b('0x2f')](function(_0x2c4120){_0x45cd8d['push'](updateOpenchannelInteraction(_0x2c4120,_0x28ca31,_0x3c54f5));});return BPromise[_0x513b('0xa9')](_0x45cd8d);});});})[_0x513b('0x27')](function(_0x8efc14){_0x276229[_0x513b('0xaa')]=_0x8efc14;return _0x276229;})[_0x513b('0x27')](respondWithFilteredResult(_0x5d8504,_0xbb5ab2))[_0x513b('0xab')](handleError(_0x5d8504,null));};exports[_0x513b('0xac')]=function(_0x5998ab,_0x1ed19d){var _0x70f2ea={};if(_0x5998ab[_0x513b('0x38')][_0x513b('0x36')]&&_0x5998ab[_0x513b('0x38')][_0x513b('0x36')]===_0x513b('0x46')){_0x70f2ea[_0x513b('0x46')]=_0x5998ab['params']['id'];}else{_0x70f2ea['id']=_0x5998ab[_0x513b('0xad')]['id'];}var _0x2173e3={'raw':![],'where':_0x70f2ea},_0x1360c3={};_0x1360c3[_0x513b('0x3b')]=_[_0x513b('0x39')](db['OpenchannelInteraction']['rawAttributes']);_0x1360c3[_0x513b('0x38')]=_[_0x513b('0x39')](_0x5998ab[_0x513b('0x38')]);_0x1360c3[_0x513b('0x43')]=_[_0x513b('0x3a')](_0x1360c3['model'],_0x1360c3['query']);_0x2173e3['attributes']=_[_0x513b('0x3a')](_0x1360c3[_0x513b('0x3b')],qs[_0x513b('0x90')](_0x5998ab['query']['fields']));_0x2173e3[_0x513b('0x3c')]=_0x2173e3[_0x513b('0x3c')]['length']?_0x2173e3[_0x513b('0x3c')]:_0x1360c3['model'];if(_0x5998ab['query'][_0x513b('0xae')]){_0x2173e3['include']=[{'all':!![]}];}_0x2173e3=_['merge']({},_0x2173e3,_0x5998ab[_0x513b('0xaf')]);return db[_0x513b('0x33')][_0x513b('0x63')](_0x2173e3)[_0x513b('0x27')](handleEntityNotFound(_0x1ed19d,null))['then'](respondWithResult(_0x1ed19d,null))[_0x513b('0xab')](handleError(_0x1ed19d,null));};exports[_0x513b('0xb0')]=function(_0x22282c,_0x3adb30){return db['OpenchannelInteraction'][_0x513b('0xb0')](_0x22282c['body'],{})[_0x513b('0x27')](respondWithResult(_0x3adb30,0xc9))[_0x513b('0xab')](handleError(_0x3adb30,null));};exports[_0x513b('0xb1')]=function(_0x4cfeea,_0x25fc10){if(_0x4cfeea['body']['id']){delete _0x4cfeea[_0x513b('0x6b')]['id'];}return db[_0x513b('0x33')][_0x513b('0x63')]({'where':{'id':_0x4cfeea[_0x513b('0xad')]['id']}})[_0x513b('0x27')](handleEntityNotFound(_0x25fc10,null))[_0x513b('0x27')](saveUpdates(_0x4cfeea['body'],null))[_0x513b('0x27')](respondWithResult(_0x25fc10,null))[_0x513b('0xab')](handleError(_0x25fc10,null));};exports['destroy']=function(_0x4c559e,_0x4b2a8e){return db[_0x513b('0x33')][_0x513b('0x63')]({'where':{'id':_0x4c559e['params']['id']}})[_0x513b('0x27')](handleEntityNotFound(_0x4b2a8e,null))[_0x513b('0x27')](removeEntity(_0x4b2a8e,null))[_0x513b('0xab')](handleError(_0x4b2a8e,null));};exports[_0x513b('0xb2')]=function(_0x2a3359,_0x80a535){return db[_0x513b('0x33')]['describe']()['then'](respondWithResult(_0x80a535,null))[_0x513b('0xab')](handleError(_0x80a535,null));};exports[_0x513b('0xb3')]=function(_0x1588b6,_0x137b63,_0x45d922){return db['OpenchannelMessage']['find']({'where':{'id':_0x1588b6['params']['id']}})[_0x513b('0x27')](handleEntityNotFound(_0x137b63,null))[_0x513b('0x27')](function(_0x182027){if(_0x182027){return _0x182027['addMessage'](_0x1588b6[_0x513b('0x6b')][_0x513b('0xb4')],_['omit'](_0x1588b6['body'],[_0x513b('0xb4'),'id'])||{});}})[_0x513b('0x27')](respondWithResult(_0x137b63,null))[_0x513b('0xab')](handleError(_0x137b63,null));};exports[_0x513b('0xb5')]=function(_0x2b30e5,_0x1cf316,_0x15dd4e){var _0x54fd77={'raw':![],'where':{}};var _0x19f00c={};var _0x20b9f8={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x513b('0xb6')]({'where':{'id':_0x2b30e5[_0x513b('0xad')]['id']}})[_0x513b('0x27')](handleEntityNotFound(_0x1cf316,null))[_0x513b('0x27')](function(_0x4ba3a9){if(_0x4ba3a9){_0x19f00c[_0x513b('0x3b')]=_['keys'](db[_0x513b('0xb7')][_0x513b('0x34')]);_0x19f00c['query']=_[_0x513b('0x39')](_0x2b30e5[_0x513b('0x38')]);_0x19f00c['filters']=_[_0x513b('0x3a')](_0x19f00c[_0x513b('0x3b')],_0x19f00c[_0x513b('0x38')]);_0x54fd77['attributes']=_[_0x513b('0x3a')](_0x19f00c[_0x513b('0x3b')],qs['fields'](_0x2b30e5[_0x513b('0x38')]['fields']));_0x54fd77[_0x513b('0x3c')]=_0x54fd77[_0x513b('0x3c')][_0x513b('0x3d')]?_0x54fd77['attributes']:_0x19f00c['model'];if(!_0x2b30e5['query'][_0x513b('0x3e')](_0x513b('0x3f'))){_0x54fd77[_0x513b('0x20')]=qs['limit'](_0x2b30e5['query'][_0x513b('0x20')]);_0x54fd77[_0x513b('0x1f')]=qs[_0x513b('0x1f')](_0x2b30e5[_0x513b('0x38')][_0x513b('0x1f')]);}_0x54fd77[_0x513b('0x40')]=qs[_0x513b('0x41')](_0x2b30e5[_0x513b('0x38')][_0x513b('0x41')]);_0x54fd77[_0x513b('0x42')]=qs[_0x513b('0x43')](_[_0x513b('0xb8')](_0x2b30e5[_0x513b('0x38')],_0x19f00c[_0x513b('0x43')]));_0x54fd77['where']['OpenchannelInteractionId']=_0x4ba3a9['id'];if(_0x2b30e5[_0x513b('0x38')][_0x513b('0x7a')]){_0x54fd77[_0x513b('0x42')]=_[_0x513b('0x8f')](_0x54fd77['where'],{'$or':_[_0x513b('0x2d')](_0x54fd77[_0x513b('0x3c')],function(_0x21eb0f){var _0x39d82d={};_0x39d82d[_0x21eb0f]={'$like':'%'+_0x2b30e5[_0x513b('0x38')]['filter']+'%'};return _0x39d82d;})});}if(_0x2b30e5['query'][_0x513b('0x73')]){var _0xe7a6ef=_0x2b30e5[_0x513b('0x38')]['$gte'][_0x513b('0x2e')](',');var _0x2eda09={};_0x2eda09[_0xe7a6ef[0x0]]={'$gte':moment(_0xe7a6ef[0x1])[_0x513b('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')};_0x54fd77[_0x513b('0x42')]=_[_0x513b('0x8f')](_0x54fd77['where'],_0x2eda09);}_0x54fd77=_[_0x513b('0x8f')]({},_0x54fd77,_0x2b30e5[_0x513b('0xaf')]);return db[_0x513b('0xb7')][_0x513b('0x22')]({'where':_0x54fd77[_0x513b('0x42')]})[_0x513b('0x27')](function(_0x16caa3){_0x20b9f8[_0x513b('0x22')]=_0x16caa3;if(_0x2b30e5[_0x513b('0x38')][_0x513b('0xae')]){_0x54fd77[_0x513b('0xba')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x513b('0xbb')](_0x54fd77);})['then'](function(_0xb3ee17){_0x20b9f8[_0x513b('0xaa')]=_0xb3ee17;return _0x20b9f8;});}})['then'](respondWithFilteredResult(_0x1cf316,_0x54fd77))[_0x513b('0xab')](handleError(_0x1cf316,null));};exports[_0x513b('0xbc')]=function(_0x39a77e,_0x4fd67e,_0x15ea77){return db['OpenchannelInteraction'][_0x513b('0x63')]({'where':{'id':_0x39a77e[_0x513b('0xad')]['id']}})['then'](handleEntityNotFound(_0x4fd67e,null))['then'](function(_0x2ad734){if(_0x2ad734){return _0x2ad734[_0x513b('0xbd')](_0x39a77e[_0x513b('0x6b')][_0x513b('0xb4')],_[_0x513b('0xbe')](_0x39a77e[_0x513b('0x6b')],[_0x513b('0xb4'),'id'])||{})[_0x513b('0xbf')](function(){return db[_0x513b('0x65')][_0x513b('0xbb')]({'attributes':['id',_0x513b('0x2b'),_0x513b('0xc0')],'where':{'id':_0x39a77e[_0x513b('0x6b')][_0x513b('0xb4')]}});})[_0x513b('0x27')](function(_0x2a7d24){socket[_0x513b('0xc1')](_0x513b('0xc2'),{'id':Number(_0x39a77e[_0x513b('0xad')]['id']),'tags':_0x2a7d24||[]});return{'id':Number(_0x39a77e[_0x513b('0xad')]['id']),'tags':_0x2a7d24||[]};});}})['then'](respondWithResult(_0x4fd67e,null))[_0x513b('0xab')](handleError(_0x4fd67e,null));};exports[_0x513b('0xc3')]=function(_0x3f2f04,_0x275972,_0x4ed598){return db[_0x513b('0x33')]['find']({'where':{'id':_0x3f2f04[_0x513b('0xad')]['id']}})[_0x513b('0x27')](handleEntityNotFound(_0x275972,null))['then'](function(_0x3d3dd8){if(_0x3d3dd8){return _0x3d3dd8[_0x513b('0xc3')](_0x3f2f04[_0x513b('0x38')][_0x513b('0xb4')]);}})['then'](respondWithStatusCode(_0x275972,null))['catch'](handleError(_0x275972,null));};exports[_0x513b('0xc4')]=function(_0x47f71f,_0x554f50){var _0x47f46f=moment()['unix']()[_0x513b('0x8e')]();var _0xe7e213=path[_0x513b('0xc5')](config[_0x513b('0xc6')],'server',_0x513b('0xc7'),'tmp');var _0x3057bb=path[_0x513b('0xc5')](config[_0x513b('0xc6')],'server','files','attachments');var _0x45ac30=path[_0x513b('0xc5')](_0xe7e213,_0x47f46f);var _0xd1c457=util['format'](_0x513b('0xc8'),_0x47f71f[_0x513b('0xad')]['id'],_0x47f46f);var _0x49ef08=path[_0x513b('0xc5')](_0xe7e213,_0xd1c457);var _0x4aea89=[];_0x4aea89[_0x513b('0x30')]({'model':db['User'],'as':_0x513b('0x68'),'attributes':['id',_0x513b('0xc9')],'raw':!![]});_0x4aea89['push']({'model':db[_0x513b('0xca')],'as':_0x513b('0x5d'),'attributes':['id',_0x513b('0xcb'),'lastName'],'raw':!![]});if(_0x47f71f[_0x513b('0x38')]['attachments']){_0x4aea89['push']({'model':db['Attachment'],'as':_0x513b('0xcc'),'raw':!![]});}var _0x16db3c=[{'model':db[_0x513b('0xb7')],'as':_0x513b('0xcd'),'attributes':['id',_0x513b('0x6b'),_0x513b('0x71'),'direction','secret','read'],'include':_0x4aea89}];_0x16db3c[_0x513b('0x30')]({'model':db[_0x513b('0xce')],'as':'Account','attributes':['id',_0x513b('0x2b')]});_0x16db3c[_0x513b('0x30')]({'model':db['User'],'as':_0x513b('0xcf'),'attributes':['id',_0x513b('0xc9')]});return db[_0x513b('0x33')][_0x513b('0x63')]({'where':{'id':_0x47f71f[_0x513b('0xad')]['id']},'include':_0x16db3c})[_0x513b('0x27')](handleEntityNotFound(_0x554f50,null))[_0x513b('0x27')](function(_0x234fbe){if(_0x234fbe){var _0x209c7a=_0x234fbe['get']({'plain':!![]});fs[_0x513b('0xd0')](_0x45ac30);var _0x2d4fae={'channel':_0x513b('0xd1'),'account':_0x209c7a[_0x513b('0xd2')]['name'],'agent':_0x209c7a[_0x513b('0xcf')]?_0x209c7a[_0x513b('0xcf')][_0x513b('0xc9')]:_0x513b('0xd3'),'createdAt':moment(_0x209c7a[_0x513b('0x71')])[_0x513b('0xb9')](_0x513b('0xd4'))[_0x513b('0x8e')](),'closedAt':_0x209c7a[_0x513b('0xd5')]?moment(_0x209c7a[_0x513b('0xd6')])[_0x513b('0xb9')](_0x513b('0xd4'))[_0x513b('0x8e')]():'','disposition':_0x209c7a['disposition'],'visibility':_0x209c7a[_0x513b('0xd7')]?_0x513b('0xd8'):_0x513b('0xd9'),'messages':_(_0x209c7a['Messages'])[_0x513b('0x7a')]({'secret':![]})[_0x513b('0x2d')](function(_0x3568ef){if(_0x3568ef['Attachment']){var _0x1112a5=path['join'](_0x3057bb,_0x3568ef[_0x513b('0xcc')]['basename']);if(fs[_0x513b('0xda')](_0x1112a5)){fs[_0x513b('0xdb')](_0x1112a5)[_0x513b('0xdc')](fs[_0x513b('0xdd')](path[_0x513b('0xc5')](_0x45ac30,_0x3568ef[_0x513b('0xcc')]['basename'])));}}return{'date':moment(_0x3568ef[_0x513b('0x71')])[_0x513b('0xb9')](_0x513b('0xd4'))['toString'](),'sender':_0x3568ef[_0x513b('0xde')]===_0x513b('0xdf')?_0x3568ef[_0x513b('0x68')]?_0x3568ef[_0x513b('0x68')]['fullname']:_0x513b('0xe0'):_0x3568ef[_0x513b('0x5d')][_0x513b('0xcb')]+(_0x3568ef[_0x513b('0x5d')][_0x513b('0xe1')]?'\x20'+_0x3568ef[_0x513b('0x5d')][_0x513b('0xe1')]:''),'body':_0x3568ef[_0x513b('0xcc')]?_0x3568ef['Attachment'][_0x513b('0xe2')]:_0x3568ef['body'],'direction':_0x3568ef[_0x513b('0xde')]==='out'?'A':'C','secret':_0x3568ef[_0x513b('0xe3')],'read':_0x3568ef[_0x513b('0x75')],'attachment':_0x3568ef['Attachment']};})[_0x513b('0x5a')]()};return ejs[_0x513b('0xe4')](path['join'](config[_0x513b('0xc6')],'server',_0x513b('0xe5'),'downloadInteraction.ejs'),{'interaction':_0x2d4fae})[_0x513b('0x27')](function(_0x568ea9){var _0x60bac1=path[_0x513b('0xc5')](_0x45ac30,_0x513b('0xe6')+_0x209c7a['id']+'-'+_0x47f46f+_0x513b('0xe7'));var _0x321663={'path':_0x60bac1,'channel':_0x513b('0xd1'),'interactionId':_0x209c7a['id']};return pdf[_0x513b('0xe8')](_0x568ea9,_0x321663);})[_0x513b('0x27')](function(){return new BPromise(function(_0x396831,_0x59e3a0){zipdir(_0x45ac30,{'saveTo':_0x49ef08},function(_0x5501b8,_0x5cded9){if(_0x5501b8)return _0x59e3a0(_0x5501b8);return _0x396831(_0x5cded9);});})[_0x513b('0x27')](function(){return new BPromise(function(_0x198991,_0x25efa8){rimraf(_0x45ac30,function(_0x5711ec){if(_0x5711ec)_0x25efa8(_0x5711ec);return _0x198991();});});})[_0x513b('0x27')](function(){return _0x554f50['download'](_0x49ef08,_0xd1c457,function(_0x5dc553){if(_0x5dc553){console['log'](_0x513b('0xe9'),_0x5dc553);}else{fs[_0x513b('0xea')](_0x49ef08);}});});});}else{return _0x554f50[_0x513b('0x1b')](0xc8);}})[_0x513b('0xab')](handleError(_0x554f50,null));};
\ No newline at end of file
+var _0x416b=['field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','users','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','OpenchannelAccountId','createdAt','$gte','$lte','where','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','QueryTypes','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','Contact.lastName','c.phone','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','push','rows','show','params','includeAll','create','describe','addMessage','omit','ids','findOne','OpenchannelMessage','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','download','unix','root','server','files','join','fullname','CmContact','firstName','lastName','attachments','Attachment','Messages','secret','OpenchannelAccount','Openchannel','Account','Owner','N.A.','closed','closedAt','disposition','threadId','Public','Private','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','stack','name','send','Users','map','Tags','TagIds','split','forEach','catch','index','OpenchannelInteraction','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','select'];(function(_0x5ae702,_0x5b70a9){var _0x3a12ad=function(_0x2e3989){while(--_0x2e3989){_0x5ae702['push'](_0x5ae702['shift']());}};_0x3a12ad(++_0x5b70a9);}(_0x416b,0x9f));var _0xb416=function(_0x74895e,_0x298c35){_0x74895e=_0x74895e-0x0;var _0x40bc2a=_0x416b[_0x74895e];return _0x40bc2a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb416('0x0'));var zipdir=require(_0xb416('0x1'));var jsonpatch=require(_0xb416('0x2'));var rp=require(_0xb416('0x3'));var moment=require(_0xb416('0x4'));var BPromise=require(_0xb416('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb416('0x6'));var sox=require(_0xb416('0x7'));var csv=require(_0xb416('0x8'));var ejs=require(_0xb416('0x9'));var fs=require('fs');var fs_extra=require(_0xb416('0xa'));var _=require(_0xb416('0xb'));var squel=require(_0xb416('0xc'));var crypto=require(_0xb416('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb416('0xe'));var toCsv=require(_0xb416('0x8'));var querystring=require(_0xb416('0xf'));var Papa=require(_0xb416('0x10'));var Redis=require(_0xb416('0x11'));var authService=require(_0xb416('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb416('0x13'));var pdf=require(_0xb416('0x14'));var hardwareService=require(_0xb416('0x15'));var logger=require(_0xb416('0x16'))(_0xb416('0x17'));var utils=require('../../config/utils');var config=require(_0xb416('0x18'));var licenseUtil=require(_0xb416('0x19'));var db=require(_0xb416('0x1a'))['db'];config[_0xb416('0x1b')]=_[_0xb416('0x1c')](config[_0xb416('0x1b')],{'host':_0xb416('0x1d'),'port':0x18eb});var socket=require(_0xb416('0x1e'))(new Redis(config[_0xb416('0x1b')]));require(_0xb416('0x1f'))['register'](socket);function respondWithStatusCode(_0x1f4b30,_0x5820d0){_0x5820d0=_0x5820d0||0xcc;return function(_0x7dbf6){if(_0x7dbf6){return _0x1f4b30[_0xb416('0x20')](_0x5820d0);}return _0x1f4b30[_0xb416('0x21')](_0x5820d0)[_0xb416('0x22')]();};}function respondWithResult(_0xdc5d50,_0x368fe9){_0x368fe9=_0x368fe9||0xc8;return function(_0x4201bf){if(_0x4201bf){return _0xdc5d50[_0xb416('0x21')](_0x368fe9)[_0xb416('0x23')](_0x4201bf);}};}function respondWithFilteredResult(_0x103561,_0x21c19a){return function(_0x51b65b){if(_0x51b65b){var _0x2b9494=typeof _0x21c19a[_0xb416('0x24')]===_0xb416('0x25')&&typeof _0x21c19a[_0xb416('0x26')]==='undefined';var _0x588406=_0x51b65b['count'];var _0x36e780=_0x2b9494?0x0:_0x21c19a[_0xb416('0x24')];var _0x5c722a=_0x2b9494?_0x51b65b[_0xb416('0x27')]:_0x21c19a[_0xb416('0x24')]+_0x21c19a[_0xb416('0x26')];var _0x255d52;if(_0x5c722a>=_0x588406){_0x5c722a=_0x588406;_0x255d52=0xc8;}else{_0x255d52=0xce;}_0x103561[_0xb416('0x21')](_0x255d52);return _0x103561[_0xb416('0x28')](_0xb416('0x29'),_0x36e780+'-'+_0x5c722a+'/'+_0x588406)[_0xb416('0x23')](_0x51b65b);}return null;};}function patchUpdates(_0x15cb00){return function(_0xa7ff0){try{jsonpatch['apply'](_0xa7ff0,_0x15cb00,!![]);}catch(_0x543df7){return BPromise['reject'](_0x543df7);}return _0xa7ff0[_0xb416('0x2a')]();};}function saveUpdates(_0x301913,_0x143380){return function(_0x2568c3){if(_0x2568c3){return _0x2568c3[_0xb416('0x2b')](_0x301913)['then'](function(_0x395e83){return _0x395e83;});}return null;};}function removeEntity(_0x5bfd91,_0x3da35f){return function(_0x4870e0){if(_0x4870e0){return _0x4870e0[_0xb416('0x2c')]()[_0xb416('0x2d')](function(){_0x5bfd91[_0xb416('0x21')](0xcc)[_0xb416('0x22')]();});}};}function handleEntityNotFound(_0x53eb01,_0xb0ec9){return function(_0xf62124){if(!_0xf62124){_0x53eb01['sendStatus'](0x194);}return _0xf62124;};}function handleError(_0x1ce502,_0x478fa7){_0x478fa7=_0x478fa7||0x1f4;return function(_0x32eb3c){logger[_0xb416('0x2e')](_0x32eb3c[_0xb416('0x2f')]);if(_0x32eb3c[_0xb416('0x30')]){delete _0x32eb3c[_0xb416('0x30')];}_0x1ce502[_0xb416('0x21')](_0x478fa7)[_0xb416('0x31')](_0x32eb3c);};}function getInteractionUsers(_0xec7282,_0x39fcc3){return new BPromise(function(_0x1aacb0,_0x482328){try{if(_0x39fcc3[_0xec7282['id']]){_0xec7282[_0xb416('0x32')]=_[_0xb416('0x33')](_0x39fcc3[_0xec7282['id']],function(_0xb83073){return{'id':_0xb83073['id'],'fullname':_0xb83073['fullname']};});}}catch(_0x29877f){_0x482328(_0x29877f);}_0x1aacb0(_0xec7282);});}function getInteractionTags(_0x4a44f0,_0x372315){return new BPromise(function(_0x475429,_0x4368f8){try{if(_0x4a44f0['TagIds']){_0x4a44f0[_0xb416('0x34')]=[];_0x4a44f0[_0xb416('0x35')][_0xb416('0x36')](',')[_0xb416('0x37')](function(_0x591063){_0x4a44f0[_0xb416('0x34')]['push'](_0x372315[_0x591063]);});}delete _0x4a44f0['TagIds'];}catch(_0x226460){_0x4368f8(_0x226460);}_0x475429(_0x4a44f0);});}function updateOpenchannelInteraction(_0x2f96bf,_0x46fa91,_0x3c7e34){return new BPromise(function(_0x2480f7,_0x4c4226){return getInteractionUsers(_0x2f96bf,_0x3c7e34)[_0xb416('0x2d')](function(_0x297b13){return getInteractionTags(_0x297b13,_0x46fa91);})['then'](function(_0x198a41){_0x2480f7(_0x198a41);})[_0xb416('0x38')](function(_0x31dbe8){_0x4c4226(_0x31dbe8);});});}exports[_0xb416('0x39')]=function(_0x2f76a5,_0x57b453){var _0x11a8a6={},_0x21b2a5={},_0x1b60bd={'count':0x0,'rows':[]};var _0x17c958=_['map'](db[_0xb416('0x3a')][_0xb416('0x3b')],function(_0x2ff794){return{'name':_0x2ff794[_0xb416('0x3c')],'type':_0x2ff794['type']['key']};});_0x21b2a5[_0xb416('0x3d')]=_[_0xb416('0x33')](_0x17c958,'name');_0x21b2a5['query']=_[_0xb416('0x3e')](_0x2f76a5[_0xb416('0x3f')]);_0x21b2a5[_0xb416('0x40')]=_[_0xb416('0x41')](_0x21b2a5[_0xb416('0x3d')],_0x21b2a5[_0xb416('0x3f')]);_0x11a8a6[_0xb416('0x42')]=_[_0xb416('0x41')](_0x21b2a5['model'],qs['fields'](_0x2f76a5['query'][_0xb416('0x43')]));_0x11a8a6[_0xb416('0x42')]=_0x11a8a6[_0xb416('0x42')][_0xb416('0x44')]?_0x11a8a6[_0xb416('0x42')]:_0x21b2a5[_0xb416('0x3d')];if(!_0x2f76a5[_0xb416('0x3f')][_0xb416('0x45')](_0xb416('0x46'))){_0x11a8a6[_0xb416('0x26')]=qs[_0xb416('0x26')](_0x2f76a5[_0xb416('0x3f')]['limit']);_0x11a8a6[_0xb416('0x24')]=qs[_0xb416('0x24')](_0x2f76a5['query'][_0xb416('0x24')]);}_0x11a8a6[_0xb416('0x47')]=qs[_0xb416('0x48')](_0x2f76a5[_0xb416('0x3f')]['sort']);_0x11a8a6['where']=qs['filters'](_['pick'](_0x2f76a5[_0xb416('0x3f')],_0x21b2a5[_0xb416('0x40')]),_0x17c958);var _0x36d825=[];var _0x33eace=squel[_0xb416('0x49')]()['field']('id')[_0xb416('0x4a')](_0xb416('0x30'))['field']('color')[_0xb416('0x4b')](_0xb416('0x4c'));var _0x22084f=squel['select']()[_0xb416('0x4a')](_0xb416('0x4d'))[_0xb416('0x4a')](_0xb416('0x4e'))['field'](_0xb416('0x4f'))[_0xb416('0x4b')]('user_has_openchannel_interactions','ui')['left_join']('users','u',_0xb416('0x50'));var _0x50fd57=squel[_0xb416('0x49')]()[_0xb416('0x4b')](_0xb416('0x51'),'i')['left_join']('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xb416('0x52')](_0xb416('0x53'),'o',_0xb416('0x54'))[_0xb416('0x52')](_0xb416('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xb416('0x52')](_0xb416('0x56'),'me','me.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xb416('0x57'),'it',_0xb416('0x58'))[_0xb416('0x52')](_0xb416('0x4c'),'t',_0xb416('0x59'));var _0x180de6=squel[_0xb416('0x5a')]();var _0x4989b8=[];var _0x760cf8=squel[_0xb416('0x5a')]();var _0xf4ad25;if(_0x2f76a5['query']['search']){_0xf4ad25=as[_0xb416('0x5b')](_0x2f76a5[_0xb416('0x3f')][_0xb416('0x5c')]);var _0xc86bf1=_0xf4ad25[_0xb416('0x5d')];for(var _0x229e4f=0x0;_0x229e4f<_0xf4ad25['conditions'][_0xb416('0x44')];_0x229e4f++){var _0x517ead=_0xf4ad25[_0xb416('0x5e')][_0x229e4f];var _0xbe2d53='i';var _0x146394=_[_0xb416('0x5f')](_0x17c958,[_0xb416('0x30'),_0x517ead['field']]);if(!_0x146394){switch(_0x517ead[_0xb416('0x4a')]){case _0xb416('0x60'):if(_0x517ead[_0xb416('0x61')]==0x1){_0x50fd57[_0xb416('0x62')]('`'+_0x517ead['field']+_0xb416('0x63'));}else{_0x50fd57[_0xb416('0x62')]('`'+_0x517ead[_0xb416('0x4a')]+'`\x20>\x200');}break;case _0xb416('0x64'):if(_0x517ead[_0xb416('0x65')]===_0xb416('0x66')){if(_0x517ead[_0xb416('0x61')][_0xb416('0x36')]('\x20')[_0xb416('0x44')]>0x1){_0x180de6[_0xc86bf1](_0xb416('0x67'),qs[_0xb416('0x68')](_0x517ead[_0xb416('0x61')]),null);}else{var _0x2b155e='%'+_0x517ead['value']+'%';_0x180de6[_0xc86bf1]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x2b155e,_0x2b155e,_0x2b155e);}}else{_0x146394=_[_0xb416('0x5f')](_0x17c958,['name',_0xb416('0x69')]);_0x517ead[_0xb416('0x4a')]=_0xb416('0x69');_0x3a0103=as[_0xb416('0x6a')](_0xbe2d53,_0x146394[_0xb416('0x6b')],_0x517ead);_0x180de6[_0xc86bf1](_0x3a0103[_0xb416('0x6c')],_0x3a0103['value'][_0xb416('0x6d')],_0x3a0103[_0xb416('0x61')][_0xb416('0x22')]);}break;case _0xb416('0x6e'):var _0x22f297=_0x517ead[_0xb416('0x61')][_0xb416('0x36')](',')[_0xb416('0x33')](function(_0x1748f7){return Number(_0x1748f7);});_0x22f297[_0xb416('0x37')](function(_0x1fc3d7){_0x760cf8['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1fc3d7+',%');});_0x4989b8=_[_0xb416('0x6f')](_0x4989b8,_0x22f297);break;case _0xb416('0x70'):if(_0x517ead[_0xb416('0x65')]===_0xb416('0x66')){_0x180de6[_0xc86bf1](_0xb416('0x71'),'%'+_0x517ead['value']+'%',null);}else{_0x146394=_[_0xb416('0x5f')](_0x17c958,[_0xb416('0x30'),'UserId']);_0x517ead['field']='UserId';_0x3a0103=as[_0xb416('0x6a')](_0xbe2d53,_0x146394['type'],_0x517ead);_0x180de6[_0xc86bf1](_0x3a0103[_0xb416('0x6c')],_0x3a0103[_0xb416('0x61')][_0xb416('0x6d')],_0x3a0103[_0xb416('0x61')]['end']);}break;case _0xb416('0x72'):_0x3a0103=as[_0xb416('0x6a')]('me',null,_0x517ead);_0x180de6[_0xc86bf1](_0x3a0103[_0xb416('0x6c')],_0x3a0103['value'][_0xb416('0x6d')],_0x3a0103[_0xb416('0x61')][_0xb416('0x22')]);break;}}else{var _0x3a0103=as[_0xb416('0x6a')](_0xbe2d53,_0x146394[_0xb416('0x6b')],_0x517ead);_0x180de6[_0xc86bf1](_0x3a0103[_0xb416('0x6c')],_0x3a0103[_0xb416('0x61')]['start'],_0x3a0103[_0xb416('0x61')][_0xb416('0x22')]);}}}else{var _0xc42d3d=_(_0x2f76a5[_0xb416('0x3f')])['keys']()[_0xb416('0x33')](function(_0x46749e){return _[_0xb416('0x73')](_0x17c958,[_0xb416('0x30'),_0x46749e])?_0x46749e:undefined;})[_0xb416('0x74')]()[_0xb416('0x61')]();if(!_['isEmpty'](_0xc42d3d)){_0xc42d3d[_0xb416('0x37')](function(_0x5348eb){if(_0x5348eb===_0xb416('0x75')){_0x50fd57['where']('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x2f76a5[_0xb416('0x3f')][_0x5348eb]));}else if(_0x5348eb===_0xb416('0x76')){var _0x118da7=JSON['parse'](_0x2f76a5[_0xb416('0x3f')][_0x5348eb])[_0xb416('0x77')];var _0x5d41a7=JSON['parse'](_0x2f76a5['query'][_0x5348eb])[_0xb416('0x78')];_0x50fd57[_0xb416('0x79')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x118da7,_0x5d41a7);}else{if(_0x2f76a5['query'][_0x5348eb]===_0xb416('0x7a')){_0x50fd57[_0xb416('0x79')]('i.'+_0x5348eb+_0xb416('0x7b'));}else{_0x50fd57['where']('i.'+_0x5348eb+'\x20=\x20?',_0x2f76a5[_0xb416('0x3f')][_0x5348eb]);}}});}if(_0x2f76a5[_0xb416('0x3f')]['read']){if(_0x2f76a5[_0xb416('0x3f')][_0xb416('0x7c')]==0x1){_0x50fd57[_0xb416('0x62')](_0xb416('0x7d'));}else{_0x50fd57[_0xb416('0x62')](_0xb416('0x7e'));}}if(_0x2f76a5['query']['tag']){_0x4989b8=_[_0xb416('0x7f')](_0x2f76a5[_0xb416('0x3f')][_0xb416('0x80')])?_0x2f76a5['query'][_0xb416('0x80')]:new Array(_0x2f76a5[_0xb416('0x3f')][_0xb416('0x80')]);_0x4989b8[_0xb416('0x37')](function(_0x23d5e0){_0x760cf8['or'](_0xb416('0x81'),'%,'+_0x23d5e0+',%');});}if(_0x2f76a5[_0xb416('0x3f')]['filter']){var _0x1a487e=_0x2f76a5[_0xb416('0x3f')][_0xb416('0x82')][_0xb416('0x83')]('\x5c','\x5c\x5c')[_0xb416('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x1a487e)){_0x180de6['or']('i.id\x20LIKE\x20?',_0x1a487e+'%');}else{_0x180de6['or'](_0xb416('0x84'),qs['getFullTextValue'](_0x1a487e))['or'](_0xb416('0x85'),_0x1a487e+'%')['or'](_0xb416('0x86'),_0x1a487e+'%');}}}_0x50fd57[_0xb416('0x79')](_0x180de6);_0x50fd57['group']('i.id');var _0x3af0fa={'type':db[_0xb416('0x87')][_0xb416('0x88')][_0xb416('0x89')],'raw':!![]};var _0xa33fec=_0x50fd57[_0xb416('0x8a')]();_0xa33fec['field'](_0xb416('0x8b'));_0xa33fec[_0xb416('0x4a')](_0xb416('0x8c'),_0xb416('0x60'));if(_0x11a8a6['order']){_0x11a8a6[_0xb416('0x47')][_0xb416('0x37')](function(_0x57f892){var _0xd10032=_0x57f892[0x0]===_0xb416('0x8d')?_0x57f892[0x0]:'i.'+_0x57f892[0x0];_0x50fd57['order'](_0xd10032,_0x57f892[0x1]===_0xb416('0x8e')?![]:!![]);});}if(!_[_0xb416('0x8f')](_0x4989b8)){_0x50fd57[_0xb416('0x62')](_0x760cf8);_0xa33fec[_0xb416('0x79')](_0xb416('0x90'),_0x4989b8);}BPromise['resolve']()['then'](function(){if(!_0xf4ad25){if(_0x2f76a5[_0xb416('0x3f')][_0xb416('0x75')])return;_0xa33fec[_0xb416('0x79')](_0xb416('0x91'));_0x50fd57['where'](_0xb416('0x91'));return;}if(_0x2f76a5[_0xb416('0x92')][_0xb416('0x93')]!==_0xb416('0x94'))return;return _0x2f76a5['user'][_0xb416('0x95')]({'attributes':['id'],'raw':!![]})[_0xb416('0x2d')](function(_0x3792e5){if(_[_0xb416('0x8f')](_0x3792e5)){_0xa33fec[_0xb416('0x79')](_0xb416('0x96'));_0x50fd57[_0xb416('0x79')](_0xb416('0x96'));}else{_0xa33fec[_0xb416('0x79')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xb416('0x33')](_0x3792e5,'id'));_0x50fd57[_0xb416('0x79')](_0xb416('0x97'),_[_0xb416('0x33')](_0x3792e5,'id'));}});})[_0xb416('0x2d')](function(){if(_0x2f76a5[_0xb416('0x92')][_0xb416('0x93')]==='agent'&&!_0xf4ad25&&!_0x2f76a5[_0xb416('0x3f')][_0xb416('0x75')])return[];return db['sequelize'][_0xb416('0x3f')](_0xa33fec[_0xb416('0x98')](),_0x3af0fa);})[_0xb416('0x2d')](function(_0x7e55cb){_0x1b60bd[_0xb416('0x27')]=_0x7e55cb[_0xb416('0x44')];if(_0x1b60bd[_0xb416('0x27')]===0x0)return[];return db[_0xb416('0x99')][_0xb416('0x3f')](_0x33eace[_0xb416('0x98')](),_0x3af0fa)['then'](function(_0x3b39b7){_0x36d825=_[_0xb416('0x9a')](_0x3b39b7,'id');_0x3af0fa=_[_0xb416('0x9b')](_0x3af0fa,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2f76a5[_0xb416('0x3f')][_0xb416('0x43')]){_0x11a8a6['attributes'][_0xb416('0x37')](function(_0x3744b1){_0x50fd57[_0xb416('0x4a')]('i.'+_0x3744b1);});}else{_0x50fd57[_0xb416('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb416('0x60'));_0x50fd57[_0xb416('0x4a')]('a.key',_0xb416('0x9c'));_0x50fd57[_0xb416('0x4a')](_0xb416('0x9d'),'Account.mandatoryDisposition');_0x50fd57[_0xb416('0x4a')](_0xb416('0x9e'),_0xb416('0x8d'));_0x50fd57[_0xb416('0x4a')](_0xb416('0x9f'));_0x50fd57[_0xb416('0x4a')](_0xb416('0xa0'),'Contact.firstName');_0x50fd57[_0xb416('0x4a')](_0xb416('0xa1'),_0xb416('0xa2'));_0x50fd57[_0xb416('0x4a')]('c.email','Contact.email');_0x50fd57['field'](_0xb416('0xa3'),'Contact.phone');_0x50fd57[_0xb416('0x4a')](_0xb416('0xa4'),'Contact.mobile');_0x50fd57[_0xb416('0x4a')](_0xb416('0xa5'),_0xb416('0xa6'));_0x50fd57[_0xb416('0x4a')]('o.fullname',_0xb416('0xa7'));_0x50fd57['field'](_0xb416('0xa8'),'Owner.internal');_0x50fd57[_0xb416('0x4a')](_0xb416('0xa9'),_0xb416('0x35'));}if(_0x11a8a6['limit'])_0x50fd57[_0xb416('0x26')](_0x11a8a6[_0xb416('0x26')]);if(_0x11a8a6['offset'])_0x50fd57['offset'](_0x11a8a6[_0xb416('0x24')]);return db[_0xb416('0x99')]['query'](_0x50fd57[_0xb416('0x98')](),_0x3af0fa);})[_0xb416('0x2d')](function(_0x429a12){if(_0x429a12['length']>0x0)_0x22084f[_0xb416('0x79')]('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x429a12,'id'));return db['sequelize'][_0xb416('0x3f')](_0x22084f[_0xb416('0x98')](),_0x3af0fa)['then'](function(_0x5b325c){var _0x2524da=_[_0xb416('0xaa')](_0x5b325c,'OpenchannelInteractionId');var _0x533395=[];_0x429a12['forEach'](function(_0x4791aa){_0x533395[_0xb416('0xab')](updateOpenchannelInteraction(_0x4791aa,_0x36d825,_0x2524da));});return BPromise['all'](_0x533395);});});})['then'](function(_0x519d3c){_0x1b60bd[_0xb416('0xac')]=_0x519d3c;return _0x1b60bd;})[_0xb416('0x2d')](respondWithFilteredResult(_0x57b453,_0x11a8a6))[_0xb416('0x38')](handleError(_0x57b453,null));};exports[_0xb416('0xad')]=function(_0x509136,_0x1b8271){var _0x4f8ed4={};if(_0x509136[_0xb416('0x3f')][_0xb416('0x6b')]&&_0x509136['query'][_0xb416('0x6b')]===_0xb416('0x4b')){_0x4f8ed4[_0xb416('0x4b')]=_0x509136[_0xb416('0xae')]['id'];}else{_0x4f8ed4['id']=_0x509136[_0xb416('0xae')]['id'];}var _0x4422c1={'raw':![],'where':_0x4f8ed4},_0x4bc674={};_0x4bc674[_0xb416('0x3d')]=_[_0xb416('0x3e')](db['OpenchannelInteraction'][_0xb416('0x3b')]);_0x4bc674[_0xb416('0x3f')]=_[_0xb416('0x3e')](_0x509136[_0xb416('0x3f')]);_0x4bc674[_0xb416('0x40')]=_[_0xb416('0x41')](_0x4bc674[_0xb416('0x3d')],_0x4bc674[_0xb416('0x3f')]);_0x4422c1[_0xb416('0x42')]=_[_0xb416('0x41')](_0x4bc674[_0xb416('0x3d')],qs[_0xb416('0x43')](_0x509136[_0xb416('0x3f')][_0xb416('0x43')]));_0x4422c1['attributes']=_0x4422c1[_0xb416('0x42')][_0xb416('0x44')]?_0x4422c1[_0xb416('0x42')]:_0x4bc674[_0xb416('0x3d')];if(_0x509136[_0xb416('0x3f')][_0xb416('0xaf')]){_0x4422c1['include']=[{'all':!![]}];}_0x4422c1=_['merge']({},_0x4422c1,_0x509136['options']);return db[_0xb416('0x3a')][_0xb416('0x5f')](_0x4422c1)['then'](handleEntityNotFound(_0x1b8271,null))['then'](respondWithResult(_0x1b8271,null))['catch'](handleError(_0x1b8271,null));};exports['create']=function(_0x4764cf,_0x450aa5){return db[_0xb416('0x3a')][_0xb416('0xb0')](_0x4764cf[_0xb416('0x72')],{})[_0xb416('0x2d')](respondWithResult(_0x450aa5,0xc9))['catch'](handleError(_0x450aa5,null));};exports[_0xb416('0x2b')]=function(_0x4e1563,_0x33c9b3){if(_0x4e1563[_0xb416('0x72')]['id']){delete _0x4e1563[_0xb416('0x72')]['id'];}return db['OpenchannelInteraction'][_0xb416('0x5f')]({'where':{'id':_0x4e1563[_0xb416('0xae')]['id']}})['then'](handleEntityNotFound(_0x33c9b3,null))[_0xb416('0x2d')](saveUpdates(_0x4e1563[_0xb416('0x72')],null))[_0xb416('0x2d')](respondWithResult(_0x33c9b3,null))['catch'](handleError(_0x33c9b3,null));};exports[_0xb416('0x2c')]=function(_0x206127,_0x17ed2e){return db[_0xb416('0x3a')][_0xb416('0x5f')]({'where':{'id':_0x206127[_0xb416('0xae')]['id']}})[_0xb416('0x2d')](handleEntityNotFound(_0x17ed2e,null))[_0xb416('0x2d')](removeEntity(_0x17ed2e,null))[_0xb416('0x38')](handleError(_0x17ed2e,null));};exports[_0xb416('0xb1')]=function(_0x4ce050,_0x5161d7){return db[_0xb416('0x3a')][_0xb416('0xb1')]()['then'](respondWithResult(_0x5161d7,null))[_0xb416('0x38')](handleError(_0x5161d7,null));};exports[_0xb416('0xb2')]=function(_0x42ea76,_0x1f7e3a,_0x3bac10){return db['OpenchannelMessage'][_0xb416('0x5f')]({'where':{'id':_0x42ea76['params']['id']}})[_0xb416('0x2d')](handleEntityNotFound(_0x1f7e3a,null))[_0xb416('0x2d')](function(_0x2a6b32){if(_0x2a6b32){return _0x2a6b32['addMessage'](_0x42ea76['body']['ids'],_[_0xb416('0xb3')](_0x42ea76[_0xb416('0x72')],[_0xb416('0xb4'),'id'])||{});}})[_0xb416('0x2d')](respondWithResult(_0x1f7e3a,null))[_0xb416('0x38')](handleError(_0x1f7e3a,null));};exports['getMessages']=function(_0x1bc7aa,_0x19c6be,_0xe23f8){var _0x4db59e={'raw':![],'where':{}};var _0x32e178={};var _0x44dc9b={'count':0x0,'rows':[]};return db[_0xb416('0x3a')][_0xb416('0xb5')]({'where':{'id':_0x1bc7aa[_0xb416('0xae')]['id']}})[_0xb416('0x2d')](handleEntityNotFound(_0x19c6be,null))[_0xb416('0x2d')](function(_0x1ddc55){if(_0x1ddc55){_0x32e178[_0xb416('0x3d')]=_['keys'](db[_0xb416('0xb6')]['rawAttributes']);_0x32e178[_0xb416('0x3f')]=_[_0xb416('0x3e')](_0x1bc7aa['query']);_0x32e178['filters']=_[_0xb416('0x41')](_0x32e178['model'],_0x32e178[_0xb416('0x3f')]);_0x4db59e[_0xb416('0x42')]=_[_0xb416('0x41')](_0x32e178[_0xb416('0x3d')],qs[_0xb416('0x43')](_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x43')]));_0x4db59e[_0xb416('0x42')]=_0x4db59e['attributes'][_0xb416('0x44')]?_0x4db59e[_0xb416('0x42')]:_0x32e178[_0xb416('0x3d')];if(!_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x45')](_0xb416('0x46'))){_0x4db59e[_0xb416('0x26')]=qs[_0xb416('0x26')](_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x26')]);_0x4db59e[_0xb416('0x24')]=qs['offset'](_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x24')]);}_0x4db59e[_0xb416('0x47')]=qs[_0xb416('0x48')](_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x48')]);_0x4db59e[_0xb416('0x79')]=qs[_0xb416('0x40')](_['pick'](_0x1bc7aa[_0xb416('0x3f')],_0x32e178['filters']));_0x4db59e[_0xb416('0x79')][_0xb416('0xb7')]=_0x1ddc55['id'];if(_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x82')]){_0x4db59e[_0xb416('0x79')]=_['merge'](_0x4db59e[_0xb416('0x79')],{'$or':_[_0xb416('0x33')](_0x4db59e[_0xb416('0x42')],function(_0x292c80){var _0x309e82={};_0x309e82[_0x292c80]={'$like':'%'+_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x82')]+'%'};return _0x309e82;})});}if(_0x1bc7aa[_0xb416('0x3f')][_0xb416('0x77')]){var _0x48f072=_0x1bc7aa[_0xb416('0x3f')]['$gte'][_0xb416('0x36')](',');var _0x566505={};_0x566505[_0x48f072[0x0]]={'$gte':moment(_0x48f072[0x1])[_0xb416('0xb8')](_0xb416('0xb9'))};_0x4db59e[_0xb416('0x79')]=_[_0xb416('0x9b')](_0x4db59e[_0xb416('0x79')],_0x566505);}_0x4db59e=_[_0xb416('0x9b')]({},_0x4db59e,_0x1bc7aa[_0xb416('0xba')]);return db[_0xb416('0xb6')][_0xb416('0x27')]({'where':_0x4db59e[_0xb416('0x79')]})[_0xb416('0x2d')](function(_0x1a2a7b){_0x44dc9b[_0xb416('0x27')]=_0x1a2a7b;if(_0x1bc7aa[_0xb416('0x3f')]['includeAll']){_0x4db59e['include']=[{'all':!![]}];}return db[_0xb416('0xb6')][_0xb416('0xbb')](_0x4db59e);})[_0xb416('0x2d')](function(_0x4d20fd){_0x44dc9b[_0xb416('0xac')]=_0x4d20fd;return _0x44dc9b;});}})['then'](respondWithFilteredResult(_0x19c6be,_0x4db59e))[_0xb416('0x38')](handleError(_0x19c6be,null));};exports['addTags']=function(_0x3d5504,_0x29df9b,_0x1d50b5){return db[_0xb416('0x3a')][_0xb416('0x5f')]({'where':{'id':_0x3d5504[_0xb416('0xae')]['id']}})['then'](handleEntityNotFound(_0x29df9b,null))[_0xb416('0x2d')](function(_0x198901){if(_0x198901){return _0x198901[_0xb416('0xbc')](_0x3d5504[_0xb416('0x72')][_0xb416('0xb4')],_[_0xb416('0xb3')](_0x3d5504[_0xb416('0x72')],[_0xb416('0xb4'),'id'])||{})[_0xb416('0xbd')](function(){return db['Tag'][_0xb416('0xbb')]({'attributes':['id','name',_0xb416('0xbe')],'where':{'id':_0x3d5504[_0xb416('0x72')][_0xb416('0xb4')]}});})[_0xb416('0x2d')](function(_0x4d5d44){socket[_0xb416('0xbf')](_0xb416('0xc0'),{'id':Number(_0x3d5504[_0xb416('0xae')]['id']),'tags':_0x4d5d44||[]});return{'id':Number(_0x3d5504['params']['id']),'tags':_0x4d5d44||[]};});}})[_0xb416('0x2d')](respondWithResult(_0x29df9b,null))[_0xb416('0x38')](handleError(_0x29df9b,null));};exports[_0xb416('0xc1')]=function(_0x2ae362,_0xfe31b1,_0xd9b563){return db[_0xb416('0x3a')][_0xb416('0x5f')]({'where':{'id':_0x2ae362['params']['id']}})[_0xb416('0x2d')](handleEntityNotFound(_0xfe31b1,null))[_0xb416('0x2d')](function(_0x586237){if(_0x586237){return _0x586237[_0xb416('0xc1')](_0x2ae362[_0xb416('0x3f')][_0xb416('0xb4')]);}})[_0xb416('0x2d')](respondWithStatusCode(_0xfe31b1,null))[_0xb416('0x38')](handleError(_0xfe31b1,null));};exports[_0xb416('0xc2')]=function(_0x3fe722,_0x5b1983){var _0x47cf14=moment()[_0xb416('0xc3')]()['toString']();var _0x5e3efc=path['join'](config[_0xb416('0xc4')],_0xb416('0xc5'),_0xb416('0xc6'),'tmp');var _0x119b9c=path[_0xb416('0xc7')](config[_0xb416('0xc4')],_0xb416('0xc5'),_0xb416('0xc6'),'attachments');var _0x4e870f=path[_0xb416('0xc7')](_0x5e3efc,_0x47cf14);var _0x3995a4=util[_0xb416('0xb8')]('transcript-%d-%s.zip',_0x3fe722[_0xb416('0xae')]['id'],_0x47cf14);var _0x30644e=path[_0xb416('0xc7')](_0x5e3efc,_0x3995a4);var _0x2cb85e=[];_0x2cb85e[_0xb416('0xab')]({'model':db['User'],'as':_0xb416('0x70'),'attributes':['id',_0xb416('0xc8')],'raw':!![]});_0x2cb85e[_0xb416('0xab')]({'model':db[_0xb416('0xc9')],'as':_0xb416('0x64'),'attributes':['id',_0xb416('0xca'),_0xb416('0xcb')],'raw':!![]});if(_0x3fe722['query'][_0xb416('0xcc')]){_0x2cb85e[_0xb416('0xab')]({'model':db[_0xb416('0xcd')],'as':_0xb416('0xcd'),'raw':!![]});}var _0xf53048=[{'model':db[_0xb416('0xb6')],'as':_0xb416('0xce'),'attributes':['id','body','createdAt','direction',_0xb416('0xcf'),_0xb416('0x7c')],'include':_0x2cb85e}];_0xf53048['push']({'model':db[_0xb416('0xd0')],'as':'Account','attributes':['id',_0xb416('0x30')]});_0xf53048[_0xb416('0xab')]({'model':db[_0xb416('0x70')],'as':'Owner','attributes':['id',_0xb416('0xc8')]});return db[_0xb416('0x3a')][_0xb416('0x5f')]({'where':{'id':_0x3fe722[_0xb416('0xae')]['id']},'include':_0xf53048})[_0xb416('0x2d')](handleEntityNotFound(_0x5b1983,null))['then'](function(_0x2d28f5){if(_0x2d28f5){var _0x14d5d8=_0x2d28f5['get']({'plain':!![]});fs['mkdirSync'](_0x4e870f);var _0x181c36={'channel':_0xb416('0xd1'),'account':_0x14d5d8[_0xb416('0xd2')][_0xb416('0x30')],'agent':_0x14d5d8[_0xb416('0xd3')]?_0x14d5d8[_0xb416('0xd3')][_0xb416('0xc8')]:_0xb416('0xd4'),'createdAt':moment(_0x14d5d8[_0xb416('0x76')])[_0xb416('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb416('0x98')](),'closedAt':_0x14d5d8[_0xb416('0xd5')]?moment(_0x14d5d8[_0xb416('0xd6')])[_0xb416('0xb8')](_0xb416('0xb9'))[_0xb416('0x98')]():'','disposition':_0x14d5d8[_0xb416('0xd7')],'visibility':_0x14d5d8[_0xb416('0xd8')]?_0xb416('0xd9'):_0xb416('0xda'),'messages':_(_0x14d5d8['Messages'])['filter']({'secret':![]})['map'](function(_0x5d60a9){if(_0x5d60a9[_0xb416('0xcd')]){var _0x187915=path[_0xb416('0xc7')](_0x119b9c,_0x5d60a9[_0xb416('0xcd')]['basename']);if(fs[_0xb416('0xdb')](_0x187915)){fs[_0xb416('0xdc')](_0x187915)[_0xb416('0xdd')](fs[_0xb416('0xde')](path[_0xb416('0xc7')](_0x4e870f,_0x5d60a9[_0xb416('0xcd')]['basename'])));}}return{'date':moment(_0x5d60a9[_0xb416('0x76')])[_0xb416('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb416('0x98')](),'sender':_0x5d60a9[_0xb416('0xdf')]===_0xb416('0xe0')?_0x5d60a9[_0xb416('0x70')]?_0x5d60a9[_0xb416('0x70')]['fullname']:_0xb416('0xe1'):_0x5d60a9['Contact'][_0xb416('0xca')]+(_0x5d60a9[_0xb416('0x64')][_0xb416('0xcb')]?'\x20'+_0x5d60a9['Contact'][_0xb416('0xcb')]:''),'body':_0x5d60a9[_0xb416('0xcd')]?_0x5d60a9[_0xb416('0xcd')]['basename']:_0x5d60a9[_0xb416('0x72')],'direction':_0x5d60a9[_0xb416('0xdf')]===_0xb416('0xe0')?'A':'C','secret':_0x5d60a9[_0xb416('0xcf')],'read':_0x5d60a9['read'],'attachment':_0x5d60a9[_0xb416('0xcd')]};})[_0xb416('0x61')]()};return ejs['renderFile'](path['join'](config['root'],_0xb416('0xc5'),_0xb416('0xe2'),_0xb416('0xe3')),{'interaction':_0x181c36})[_0xb416('0x2d')](function(_0x135094){var _0x3593f5=path[_0xb416('0xc7')](_0x4e870f,_0xb416('0xe4')+_0x14d5d8['id']+'-'+_0x47cf14+'.pdf');var _0x18fe72={'path':_0x3593f5,'channel':'Openchannel','interactionId':_0x14d5d8['id']};return pdf[_0xb416('0xe5')](_0x135094,_0x18fe72);})[_0xb416('0x2d')](function(){return new BPromise(function(_0x404cff,_0x260445){zipdir(_0x4e870f,{'saveTo':_0x30644e},function(_0x265b95,_0x3a7a4c){if(_0x265b95)return _0x260445(_0x265b95);return _0x404cff(_0x3a7a4c);});})[_0xb416('0x2d')](function(){return new BPromise(function(_0x4a69dc,_0x3396cc){rimraf(_0x4e870f,function(_0x316b80){if(_0x316b80)_0x3396cc(_0x316b80);return _0x4a69dc();});});})[_0xb416('0x2d')](function(){return _0x5b1983[_0xb416('0xc2')](_0x30644e,_0x3995a4,function(_0x586aad){if(_0x586aad){console[_0xb416('0xe6')](_0xb416('0xe7'),_0x586aad);}else{fs[_0xb416('0xe8')](_0x30644e);}});});});}else{return _0x5b1983['sendStatus'](0xc8);}})[_0xb416('0x38')](handleError(_0x5b1983,null));};
\ No newline at end of file
index be903e2..48f72a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b14=['exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','map','findAll','length','emit','hasOwnProperty','hook'];(function(_0x9e0616,_0x181c01){var _0x3d0e45=function(_0x38f475){while(--_0x38f475){_0x9e0616['push'](_0x9e0616['shift']());}};_0x3d0e45(++_0x181c01);}(_0x0b14,0x121));var _0x40b1=function(_0x149af8,_0x1343b0){_0x149af8=_0x149af8-0x0;var _0x12a468=_0x0b14[_0x149af8];return _0x12a468;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x40b1('0x0'))['db'][_0x40b1('0x1')];var OpenchannelMessage=require(_0x40b1('0x0'))['db'][_0x40b1('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x40b1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x40b1('0x4'),'afterDestroy':_0x40b1('0x5')};function emitEvent(_0x3cbcca){return function(_0x11dd46,_0x446d75,_0x3859af){_0x11dd46[_0x40b1('0x6')]({'attributes':['id'],'raw':!![]})[_0x40b1('0x7')](function(_0x5ebd44){_0x11dd46[_0x40b1('0x8')]('Users',_0x5ebd44[_0x40b1('0x9')](function(_0x3b5dde){return{'id':_0x3b5dde['id']};}));return OpenchannelMessage[_0x40b1('0xa')]({'where':{'OpenchannelInteractionId':_0x11dd46['id'],'direction':'in','read':![]},'raw':!![]});})[_0x40b1('0x7')](function(_0x125b70){_0x11dd46[_0x40b1('0x8')]('unreadMessages',_0x125b70[_0x40b1('0xb')]);OpenchannelInteractionEvents['emit'](_0x3cbcca+':'+_0x11dd46['id'],_0x11dd46);OpenchannelInteractionEvents[_0x40b1('0xc')](_0x3cbcca,_0x11dd46);_0x3859af(null);})['catch'](_0x3859af(null));};}for(var e in events){if(events[_0x40b1('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x40b1('0xe')](e,emitEvent(event));}}module[_0x40b1('0xf')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x72da=['hasOwnProperty','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','getUsers','setDataValue','Users','map','findAll','emit','catch'];(function(_0x2e3187,_0x3f2412){var _0x163bcb=function(_0x4ebdc5){while(--_0x4ebdc5){_0x2e3187['push'](_0x2e3187['shift']());}};_0x163bcb(++_0x3f2412);}(_0x72da,0x189));var _0xa72d=function(_0x152678,_0x11e0ac){_0x152678=_0x152678-0x0;var _0x311a9=_0x72da[_0x152678];return _0x311a9;};'use strict';var EventEmitter=require(_0xa72d('0x0'));var OpenchannelInteraction=require(_0xa72d('0x1'))['db'][_0xa72d('0x2')];var OpenchannelMessage=require(_0xa72d('0x1'))['db'][_0xa72d('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xa72d('0x4')](0x0);var events={'afterCreate':_0xa72d('0x5'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c2aa9){return function(_0x244bf7,_0x11f9ae,_0x53ed8c){_0x244bf7[_0xa72d('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x170e3d){_0x244bf7[_0xa72d('0x7')](_0xa72d('0x8'),_0x170e3d[_0xa72d('0x9')](function(_0x20d9fc){return{'id':_0x20d9fc['id']};}));return OpenchannelMessage[_0xa72d('0xa')]({'where':{'OpenchannelInteractionId':_0x244bf7['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x47045d){_0x244bf7[_0xa72d('0x7')]('unreadMessages',_0x47045d['length']);OpenchannelInteractionEvents[_0xa72d('0xb')](_0x1c2aa9+':'+_0x244bf7['id'],_0x244bf7);OpenchannelInteractionEvents[_0xa72d('0xb')](_0x1c2aa9,_0x244bf7);_0x53ed8c(null);})[_0xa72d('0xc')](_0x53ed8c(null));};}for(var e in events){if(events[_0xa72d('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents;
\ No newline at end of file
index c5a642a..f6e5cd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d7d=['closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','openchannel_interactions','utf8mb4','changed'];(function(_0x399869,_0x11b444){var _0x4ff731=function(_0x1a0cc2){while(--_0x1a0cc2){_0x399869['push'](_0x399869['shift']());}};_0x4ff731(++_0x11b444);}(_0x5d7d,0xc6));var _0xd5d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d7d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd5d7('0x0'));var util=require(_0xd5d7('0x1'));var logger=require('../../config/logger')(_0xd5d7('0x2'));var moment=require(_0xd5d7('0x3'));var BPromise=require(_0xd5d7('0x4'));var rp=require(_0xd5d7('0x5'));var fs=require('fs');var path=require(_0xd5d7('0x6'));var rimraf=require('rimraf');var config=require(_0xd5d7('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0xd5d7('0x8')]=function(_0x29c89a,_0x14ce0f){return _0x29c89a['define']('OpenchannelInteraction',attributes,{'tableName':_0xd5d7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd5d7('0xa'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x18cdcc,_0x53adf9,_0x1643a3){if(_0x18cdcc[_0xd5d7('0xb')]('closed')){_0x18cdcc[_0xd5d7('0xc')]=moment()['format'](_0xd5d7('0xd'));}_0x1643a3(null,_0x18cdcc);}}});};
\ No newline at end of file
+var _0x9a96=['define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','exports'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0x9a96,0xd0));var _0x69a9=function(_0x55c374,_0x38cffb){_0x55c374=_0x55c374-0x0;var _0x5aa9d2=_0x9a96[_0x55c374];return _0x5aa9d2;};'use strict';var _=require(_0x69a9('0x0'));var util=require(_0x69a9('0x1'));var logger=require(_0x69a9('0x2'))(_0x69a9('0x3'));var moment=require(_0x69a9('0x4'));var BPromise=require(_0x69a9('0x5'));var rp=require(_0x69a9('0x6'));var fs=require('fs');var path=require(_0x69a9('0x7'));var rimraf=require(_0x69a9('0x8'));var config=require(_0x69a9('0x9'));var attributes=require(_0x69a9('0xa'));module[_0x69a9('0xb')]=function(_0x5a48bf,_0x245072){return _0x5a48bf[_0x69a9('0xc')](_0x69a9('0xd'),attributes,{'tableName':_0x69a9('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x69a9('0xf'),'hooks':{'beforeUpdate':function(_0x2f4be6,_0x357e7b,_0x2587ef){if(_0x2f4be6[_0x69a9('0x10')](_0x69a9('0x11'))){_0x2f4be6[_0x69a9('0x12')]=moment()['format'](_0x69a9('0x13'));}_0x2587ef(null,_0x2f4be6);}}});};
\ No newline at end of file
index d0a997a..77d6c8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb10=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./openchannelInteraction.socket','register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','code','error','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','options','raw','where','attributes','limit','stringify','AddTagsToOpenchannelInteraction','addTags','body','omit','ids','AddTags','lodash','util','moment','randomstring','ioredis','../../config/utils'];(function(_0x4caf10,_0x261e88){var _0x29fe92=function(_0x175d9a){while(--_0x175d9a){_0x4caf10['push'](_0x4caf10['shift']());}};_0x29fe92(++_0x261e88);}(_0xbb10,0xcc));var _0x0bb1=function(_0x4810f7,_0x8d1c8a){_0x4810f7=_0x4810f7-0x0;var _0x31f387=_0xbb10[_0x4810f7];return _0x31f387;};'use strict';var _=require(_0x0bb1('0x0'));var util=require(_0x0bb1('0x1'));var moment=require(_0x0bb1('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bb1('0x3'));var fs=require('fs');var Redis=require(_0x0bb1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0bb1('0x5'));var logger=require(_0x0bb1('0x6'))(_0x0bb1('0x7'));var config=require(_0x0bb1('0x8'));var jayson=require(_0x0bb1('0x9'));var client=jayson[_0x0bb1('0xa')]['http']({'port':0x232a});config[_0x0bb1('0xb')]=_[_0x0bb1('0xc')](config[_0x0bb1('0xb')],{'host':_0x0bb1('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0bb1('0xe'))[_0x0bb1('0xf')](socket);function respondWithRpcPromise(_0x42efb7,_0x22ebc7,_0x16e83d){return new BPromise(function(_0x964b76,_0x5422be){return client[_0x0bb1('0x10')](_0x42efb7,_0x16e83d)[_0x0bb1('0x11')](function(_0x5440c4){logger[_0x0bb1('0x12')](_0x0bb1('0x13'),_0x22ebc7,_0x0bb1('0x14'));logger[_0x0bb1('0x15')](_0x0bb1('0x16'),_0x22ebc7,'request\x20sent',JSON['stringify'](_0x5440c4));if(_0x5440c4['error']){if(_0x5440c4['error'][_0x0bb1('0x17')]===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x22ebc7,_0x5440c4[_0x0bb1('0x18')]['message']);return _0x5422be(_0x5440c4[_0x0bb1('0x18')][_0x0bb1('0x19')]);}logger[_0x0bb1('0x18')](_0x0bb1('0x13'),_0x22ebc7,_0x5440c4[_0x0bb1('0x18')][_0x0bb1('0x19')]);return _0x964b76(_0x5440c4[_0x0bb1('0x18')]['message']);}else{logger[_0x0bb1('0x12')](_0x0bb1('0x13'),_0x22ebc7,_0x0bb1('0x14'));_0x964b76(_0x5440c4['result'][_0x0bb1('0x19')]);}})[_0x0bb1('0x1a')](function(_0x3ac336){logger[_0x0bb1('0x18')](_0x0bb1('0x13'),_0x22ebc7,_0x3ac336);_0x5422be(_0x3ac336);});});}exports[_0x0bb1('0x1b')]=function(_0x33d3fc){var _0x173301=this;return new Promise(function(_0x44b907,_0x349173){return db[_0x0bb1('0x1c')][_0x0bb1('0x1d')](_0x33d3fc['body'],{'raw':_0x33d3fc['options']?_0x33d3fc[_0x0bb1('0x1e')][_0x0bb1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33d3fc[_0x0bb1('0x1e')]?_0x33d3fc['options'][_0x0bb1('0x20')]||null:null,'attributes':_0x33d3fc[_0x0bb1('0x1e')]?_0x33d3fc[_0x0bb1('0x1e')][_0x0bb1('0x21')]||null:null,'limit':_0x33d3fc['options']?_0x33d3fc[_0x0bb1('0x1e')][_0x0bb1('0x22')]||null:null})[_0x0bb1('0x11')](function(_0x4a3b04){logger[_0x0bb1('0x12')](_0x0bb1('0x1b'),_0x33d3fc);logger['debug'](_0x0bb1('0x1b'),_0x33d3fc,JSON[_0x0bb1('0x23')](_0x4a3b04));_0x44b907(_0x4a3b04);})[_0x0bb1('0x1a')](function(_0x50982d){logger[_0x0bb1('0x18')](_0x0bb1('0x1b'),_0x50982d['message'],_0x33d3fc);_0x349173(_0x173301[_0x0bb1('0x18')](0x1f4,_0x50982d[_0x0bb1('0x19')]));});});};exports[_0x0bb1('0x24')]=function(_0x48a2c0){return new Promise(function(_0x375cad,_0x1a8d9c){return db[_0x0bb1('0x1c')]['find']({'where':_0x48a2c0['options']?_0x48a2c0[_0x0bb1('0x1e')]['where']||null:null})[_0x0bb1('0x11')](function(_0x978254){if(_0x978254){return _0x978254[_0x0bb1('0x25')](_0x48a2c0[_0x0bb1('0x26')]['ids'],_[_0x0bb1('0x27')](_0x48a2c0[_0x0bb1('0x26')],[_0x0bb1('0x28'),'id'])||{});}})['spread'](function(_0x4524c5){logger[_0x0bb1('0x12')]('AddTags',_0x48a2c0);logger[_0x0bb1('0x15')](_0x0bb1('0x29'),_0x48a2c0,JSON['stringify'](_0x4524c5));_0x375cad(_0x4524c5);})['catch'](function(_0x454a45){logger[_0x0bb1('0x18')](_0x0bb1('0x29'),_0x454a45[_0x0bb1('0x19')],_0x48a2c0);_0x1a8d9c(_this[_0x0bb1('0x18')](0x1f4,_0x454a45[_0x0bb1('0x19')]));});});};
\ No newline at end of file
+var _0x0509=['http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','limit','debug','AddTagsToOpenchannelInteraction','find','where','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x35fc19,_0x4d538f){var _0x52233f=function(_0x46f60b){while(--_0x46f60b){_0x35fc19['push'](_0x35fc19['shift']());}};_0x52233f(++_0x4d538f);}(_0x0509,0x1e2));var _0x9050=function(_0x4ed239,_0x3bb2d8){_0x4ed239=_0x4ed239-0x0;var _0x19b898=_0x0509[_0x4ed239];return _0x19b898;};'use strict';var _=require(_0x9050('0x0'));var util=require(_0x9050('0x1'));var moment=require(_0x9050('0x2'));var BPromise=require(_0x9050('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9050('0x4'))['db'];var utils=require(_0x9050('0x5'));var logger=require(_0x9050('0x6'))('rpc');var config=require(_0x9050('0x7'));var jayson=require(_0x9050('0x8'));var client=jayson[_0x9050('0x9')][_0x9050('0xa')]({'port':0x232a});config[_0x9050('0xb')]=_[_0x9050('0xc')](config['redis'],{'host':_0x9050('0xd'),'port':0x18eb});var socket=require(_0x9050('0xe'))(new Redis(config[_0x9050('0xb')]));require(_0x9050('0xf'))[_0x9050('0x10')](socket);function respondWithRpcPromise(_0x12245f,_0x61ec9b,_0x31afb3){return new BPromise(function(_0x291c8f,_0x3e0a47){return client['request'](_0x12245f,_0x31afb3)[_0x9050('0x11')](function(_0x54ab78){logger[_0x9050('0x12')](_0x9050('0x13'),_0x61ec9b,_0x9050('0x14'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x61ec9b,_0x9050('0x14'),JSON[_0x9050('0x15')](_0x54ab78));if(_0x54ab78[_0x9050('0x16')]){if(_0x54ab78[_0x9050('0x16')][_0x9050('0x17')]===0x1f4){logger[_0x9050('0x16')](_0x9050('0x13'),_0x61ec9b,_0x54ab78[_0x9050('0x16')]['message']);return _0x3e0a47(_0x54ab78[_0x9050('0x16')][_0x9050('0x18')]);}logger['error'](_0x9050('0x13'),_0x61ec9b,_0x54ab78['error'][_0x9050('0x18')]);return _0x291c8f(_0x54ab78[_0x9050('0x16')][_0x9050('0x18')]);}else{logger[_0x9050('0x12')](_0x9050('0x13'),_0x61ec9b,_0x9050('0x14'));_0x291c8f(_0x54ab78['result'][_0x9050('0x18')]);}})[_0x9050('0x19')](function(_0x51db73){logger[_0x9050('0x16')](_0x9050('0x13'),_0x61ec9b,_0x51db73);_0x3e0a47(_0x51db73);});});}exports[_0x9050('0x1a')]=function(_0x3c9c48){var _0x3c52a9=this;return new Promise(function(_0x4560c7,_0xc684a0){return db[_0x9050('0x1b')][_0x9050('0x1c')](_0x3c9c48[_0x9050('0x1d')],{'raw':_0x3c9c48[_0x9050('0x1e')]?_0x3c9c48[_0x9050('0x1e')][_0x9050('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c9c48['options']?_0x3c9c48[_0x9050('0x1e')]['where']||null:null,'attributes':_0x3c9c48[_0x9050('0x1e')]?_0x3c9c48[_0x9050('0x1e')]['attributes']||null:null,'limit':_0x3c9c48[_0x9050('0x1e')]?_0x3c9c48[_0x9050('0x1e')][_0x9050('0x20')]||null:null})[_0x9050('0x11')](function(_0xb8f399){logger[_0x9050('0x12')]('UpdateOpenchannelInteraction',_0x3c9c48);logger[_0x9050('0x21')](_0x9050('0x1a'),_0x3c9c48,JSON['stringify'](_0xb8f399));_0x4560c7(_0xb8f399);})[_0x9050('0x19')](function(_0x48487a){logger[_0x9050('0x16')](_0x9050('0x1a'),_0x48487a[_0x9050('0x18')],_0x3c9c48);_0xc684a0(_0x3c52a9['error'](0x1f4,_0x48487a[_0x9050('0x18')]));});});};exports[_0x9050('0x22')]=function(_0x16f776){return new Promise(function(_0x5f7f94,_0x3b28bd){return db[_0x9050('0x1b')][_0x9050('0x23')]({'where':_0x16f776[_0x9050('0x1e')]?_0x16f776['options'][_0x9050('0x24')]||null:null})[_0x9050('0x11')](function(_0x42caa8){if(_0x42caa8){return _0x42caa8[_0x9050('0x25')](_0x16f776['body'][_0x9050('0x26')],_['omit'](_0x16f776[_0x9050('0x1d')],[_0x9050('0x26'),'id'])||{});}})[_0x9050('0x27')](function(_0x23abc0){logger[_0x9050('0x12')]('AddTags',_0x16f776);logger[_0x9050('0x21')](_0x9050('0x28'),_0x16f776,JSON[_0x9050('0x15')](_0x23abc0));_0x5f7f94(_0x23abc0);})[_0x9050('0x19')](function(_0x383079){logger[_0x9050('0x16')](_0x9050('0x28'),_0x383079[_0x9050('0x18')],_0x16f776);_0x3b28bd(_this[_0x9050('0x16')](0x1f4,_0x383079[_0x9050('0x18')]));});});};
\ No newline at end of file
index ae4016f..8794715 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdc8=['removeListener','length','openchannelInteraction:','./openchannelInteraction.events','update'];(function(_0x35cc3c,_0x514401){var _0x2ca231=function(_0x5052ce){while(--_0x5052ce){_0x35cc3c['push'](_0x35cc3c['shift']());}};_0x2ca231(++_0x514401);}(_0xfdc8,0x80));var _0x8fdc=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xfdc8[_0x5cb1af];return _0x8d7940;};'use strict';var OpenchannelInteractionEvents=require(_0x8fdc('0x0'));var events=['save','remove',_0x8fdc('0x1')];function createListener(_0x1d2297,_0x1e6b54){return function(_0x53fe6e){_0x1e6b54['emit'](_0x1d2297,_0x53fe6e);};}function removeListener(_0x501b1c,_0x18b328){return function(){OpenchannelInteractionEvents[_0x8fdc('0x2')](_0x501b1c,_0x18b328);};}exports['register']=function(_0xc3346a){for(var _0x291bd7=0x0,_0x2f42db=events[_0x8fdc('0x3')];_0x291bd7<_0x2f42db;_0x291bd7++){var _0x3b0c16=events[_0x291bd7];var _0x494db1=createListener(_0x8fdc('0x4')+_0x3b0c16,_0xc3346a);OpenchannelInteractionEvents['on'](_0x3b0c16,_0x494db1);}};
\ No newline at end of file
+var _0xa752=['openchannelInteraction:','./openchannelInteraction.events','remove','update','removeListener','length'];(function(_0x466c43,_0x35e257){var _0x43a795=function(_0x58509a){while(--_0x58509a){_0x466c43['push'](_0x466c43['shift']());}};_0x43a795(++_0x35e257);}(_0xa752,0x14b));var _0x2a75=function(_0x4057aa,_0x1657ac){_0x4057aa=_0x4057aa-0x0;var _0x31343a=_0xa752[_0x4057aa];return _0x31343a;};'use strict';var OpenchannelInteractionEvents=require(_0x2a75('0x0'));var events=['save',_0x2a75('0x1'),_0x2a75('0x2')];function createListener(_0x5dc1b3,_0x5d3662){return function(_0xbb699b){_0x5d3662['emit'](_0x5dc1b3,_0xbb699b);};}function removeListener(_0x300276,_0x313610){return function(){OpenchannelInteractionEvents[_0x2a75('0x3')](_0x300276,_0x313610);};}exports['register']=function(_0x45b071){for(var _0x2f92e7=0x0,_0x48725b=events[_0x2a75('0x4')];_0x2f92e7<_0x48725b;_0x2f92e7++){var _0x4da3f2=events[_0x2f92e7];var _0x1916c4=createListener(_0x2a75('0x5')+_0x4da3f2,_0x45b071);OpenchannelInteractionEvents['on'](_0x4da3f2,_0x1916c4);}};
\ No newline at end of file
index e72f586..f3c568d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x5d225a,_0x2debe9){var _0x1e7761=function(_0x491dc2){while(--_0x491dc2){_0x5d225a['push'](_0x5d225a['shift']());}};_0x1e7761(++_0x2debe9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58db4e,_0x439d8d){_0x58db4e=_0x58db4e-0x0;var _0x40139a=_0xcb91[_0x58db4e];return _0x40139a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router;
\ No newline at end of file
+var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x1a80c2,_0x25e82d){_0x1a80c2=_0x1a80c2-0x0;var _0x58dee5=_0x70e0[_0x1a80c2];return _0x58dee5;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router;
\ No newline at end of file
index 0359560..9b259c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43c8=['exports','medium','BOOLEAN','ENUM','out','DATE','TEXT'];(function(_0x13ce0c,_0x3f2a0d){var _0x4388fb=function(_0x27db4b){while(--_0x27db4b){_0x13ce0c['push'](_0x13ce0c['shift']());}};_0x4388fb(++_0x3f2a0d);}(_0x43c8,0xaf));var _0x843c=function(_0x2210fb,_0x91cd97){_0x2210fb=_0x2210fb-0x0;var _0x7f76eb=_0x43c8[_0x2210fb];return _0x7f76eb;};'use strict';var Sequelize=require('sequelize');module[_0x843c('0x0')]={'body':{'type':Sequelize['TEXT'](_0x843c('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x843c('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x843c('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x843c('0x3')]('in',_0x843c('0x4')),'defaultValue':_0x843c('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x843c('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x843c('0x6')]}};
\ No newline at end of file
+var _0x0c1a=['STRING','sequelize','exports','TEXT','BOOLEAN','out','DATE'];(function(_0x42aa5c,_0x4061a4){var _0x565b5e=function(_0x381643){while(--_0x381643){_0x42aa5c['push'](_0x42aa5c['shift']());}};_0x565b5e(++_0x4061a4);}(_0x0c1a,0x127));var _0xa0c1=function(_0x43b019,_0x490d48){_0x43b019=_0x43b019-0x0;var _0x28021a=_0x0c1a[_0x43b019];return _0x28021a;};'use strict';var Sequelize=require(_0xa0c1('0x0'));module[_0xa0c1('0x1')]={'body':{'type':Sequelize[_0xa0c1('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xa0c1('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa0c1('0x4')),'defaultValue':_0xa0c1('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa0c1('0x5')]},'providerName':{'type':Sequelize[_0xa0c1('0x6')]},'providerResponse':{'type':Sequelize[_0xa0c1('0x2')]}};
\ No newline at end of file
index 37372f9..276ea66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64c4=['OpenchannelInteraction','OpenchannelInteractionId','isNil','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','email','internal','manual','interface','channel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','SELECT','User','fullname','SIP/%s','rejectmessage','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','sendStatus','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','findAll','rows','params','include','find','body','update','destroy','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get'];(function(_0x5231a1,_0x2221f5){var _0x346d46=function(_0x150791){while(--_0x150791){_0x5231a1['push'](_0x5231a1['shift']());}};_0x346d46(++_0x2221f5);}(_0x64c4,0xa5));var _0x464c=function(_0x359030,_0x4b3a98){_0x359030=_0x359030-0x0;var _0x5cded8=_0x64c4[_0x359030];return _0x5cded8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x464c('0x0'));var zipdir=require(_0x464c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x464c('0x2'));var moment=require(_0x464c('0x3'));var BPromise=require(_0x464c('0x4'));var Mustache=require(_0x464c('0x5'));var util=require(_0x464c('0x6'));var path=require(_0x464c('0x7'));var sox=require('sox');var csv=require(_0x464c('0x8'));var ejs=require(_0x464c('0x9'));var fs=require('fs');var fs_extra=require(_0x464c('0xa'));var _=require('lodash');var squel=require(_0x464c('0xb'));var crypto=require(_0x464c('0xc'));var jsforce=require(_0x464c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x464c('0x8'));var querystring=require(_0x464c('0xe'));var Papa=require(_0x464c('0xf'));var Redis=require(_0x464c('0x10'));var authService=require(_0x464c('0x11'));var qs=require(_0x464c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x464c('0x13'));var logger=require('../../config/logger')(_0x464c('0x14'));var utils=require(_0x464c('0x15'));var config=require(_0x464c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x464c('0x17'))['db'];config[_0x464c('0x18')]=_[_0x464c('0x19')](config[_0x464c('0x18')],{'host':_0x464c('0x1a'),'port':0x18eb});var socket=require(_0x464c('0x1b'))(new Redis(config[_0x464c('0x18')]));require('./openchannelMessage.socket')[_0x464c('0x1c')](socket);var jayson=require(_0x464c('0x1d'));var client=jayson['client'][_0x464c('0x1e')]({'port':0x232c});var client9002=jayson[_0x464c('0x1f')][_0x464c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x211ef3,_0x4b8caa,_0x4a1828,_0x2f5eda){return new BPromise(function(_0x32c84b,_0x284469){var _0x1db399=_0x2f5eda||client;return _0x1db399[_0x464c('0x20')](_0x211ef3,_0x4a1828)[_0x464c('0x21')](function(_0x597275){logger[_0x464c('0x22')](_0x464c('0x23'),_0x4b8caa,_0x464c('0x24'));logger[_0x464c('0x25')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x4b8caa,_0x464c('0x24'),JSON[_0x464c('0x26')](_0x597275));if(_0x597275[_0x464c('0x27')]){if(_0x597275[_0x464c('0x27')][_0x464c('0x28')]===0x1f4){logger[_0x464c('0x27')](_0x464c('0x23'),_0x4b8caa,_0x597275[_0x464c('0x27')][_0x464c('0x29')]);return _0x284469(_0x597275[_0x464c('0x27')][_0x464c('0x29')]);}logger['error'](_0x464c('0x23'),_0x4b8caa,_0x597275[_0x464c('0x27')][_0x464c('0x29')]);return _0x32c84b(_0x597275[_0x464c('0x27')]['message']);}else{logger[_0x464c('0x22')](_0x464c('0x23'),_0x4b8caa,'request\x20sent');_0x32c84b(_0x597275[_0x464c('0x2a')]['message']);}})[_0x464c('0x2b')](function(_0x4e7850){logger[_0x464c('0x27')](_0x464c('0x23'),_0x4b8caa,_0x4e7850);_0x284469(_0x4e7850);});});}function respondWithStatusCode(_0x56a14f,_0x44fbd1){_0x44fbd1=_0x44fbd1||0xcc;return function(_0x4226c4){if(_0x4226c4){return _0x56a14f['sendStatus'](_0x44fbd1);}return _0x56a14f[_0x464c('0x2c')](_0x44fbd1)[_0x464c('0x2d')]();};}function respondWithResult(_0x3c73d5,_0x145cad){_0x145cad=_0x145cad||0xc8;return function(_0x13164d){if(_0x13164d){return _0x3c73d5['status'](_0x145cad)['json'](_0x13164d);}};}function respondWithFilteredResult(_0x5660b5,_0x152cf){return function(_0x58aae5){if(_0x58aae5){var _0x28489d=typeof _0x152cf['offset']===_0x464c('0x2e')&&typeof _0x152cf[_0x464c('0x2f')]===_0x464c('0x2e');var _0x2a1639=_0x58aae5['count'];var _0x58cb26=_0x28489d?0x0:_0x152cf[_0x464c('0x30')];var _0x581cb5=_0x28489d?_0x58aae5[_0x464c('0x31')]:_0x152cf['offset']+_0x152cf[_0x464c('0x2f')];var _0x400dc1;if(_0x581cb5>=_0x2a1639){_0x581cb5=_0x2a1639;_0x400dc1=0xc8;}else{_0x400dc1=0xce;}_0x5660b5[_0x464c('0x2c')](_0x400dc1);return _0x5660b5[_0x464c('0x32')](_0x464c('0x33'),_0x58cb26+'-'+_0x581cb5+'/'+_0x2a1639)[_0x464c('0x34')](_0x58aae5);}return null;};}function patchUpdates(_0x122b4c){return function(_0x337066){try{jsonpatch[_0x464c('0x35')](_0x337066,_0x122b4c,!![]);}catch(_0x51ba05){return BPromise[_0x464c('0x36')](_0x51ba05);}return _0x337066[_0x464c('0x37')]();};}function saveUpdates(_0xf8dacf,_0x4a4f50){return function(_0x466a38){if(_0x466a38){return _0x466a38['update'](_0xf8dacf)[_0x464c('0x21')](function(_0x31a3b8){return _0x31a3b8;});}return null;};}function removeEntity(_0x526549,_0x2a708e){return function(_0x2a6ad1){if(_0x2a6ad1){return _0x2a6ad1['destroy']()[_0x464c('0x21')](function(){_0x526549['status'](0xcc)[_0x464c('0x2d')]();});}};}function handleEntityNotFound(_0x2e80c3,_0x1855e0){return function(_0x337ce1){if(!_0x337ce1){_0x2e80c3[_0x464c('0x38')](0x194);}return _0x337ce1;};}function handleError(_0x35cb3b,_0x25eeac){_0x25eeac=_0x25eeac||0x1f4;return function(_0x387f52){logger[_0x464c('0x27')](_0x387f52[_0x464c('0x39')]);if(_0x387f52[_0x464c('0x3a')]){delete _0x387f52[_0x464c('0x3a')];}_0x35cb3b['status'](_0x25eeac)['send'](_0x387f52);};}exports[_0x464c('0x3b')]=function(_0x43f905,_0x1f073){var _0xb3a13d={},_0x2e870d={},_0x306ffa={'count':0x0,'rows':[]};var _0x157158=_[_0x464c('0x3c')](db[_0x464c('0x3d')][_0x464c('0x3e')],function(_0x3e1f1c){return{'name':_0x3e1f1c[_0x464c('0x3f')],'type':_0x3e1f1c[_0x464c('0x40')][_0x464c('0x41')]};});_0x2e870d[_0x464c('0x42')]=_[_0x464c('0x3c')](_0x157158,_0x464c('0x3a'));_0x2e870d[_0x464c('0x43')]=_[_0x464c('0x44')](_0x43f905[_0x464c('0x43')]);_0x2e870d[_0x464c('0x45')]=_[_0x464c('0x46')](_0x2e870d[_0x464c('0x42')],_0x2e870d['query']);_0xb3a13d[_0x464c('0x47')]=_[_0x464c('0x46')](_0x2e870d[_0x464c('0x42')],qs['fields'](_0x43f905[_0x464c('0x43')][_0x464c('0x48')]));_0xb3a13d[_0x464c('0x47')]=_0xb3a13d['attributes'][_0x464c('0x49')]?_0xb3a13d[_0x464c('0x47')]:_0x2e870d['model'];if(!_0x43f905['query'][_0x464c('0x4a')](_0x464c('0x4b'))){_0xb3a13d[_0x464c('0x2f')]=qs[_0x464c('0x2f')](_0x43f905[_0x464c('0x43')][_0x464c('0x2f')]);_0xb3a13d[_0x464c('0x30')]=qs[_0x464c('0x30')](_0x43f905[_0x464c('0x43')][_0x464c('0x30')]);}_0xb3a13d['order']=qs[_0x464c('0x4c')](_0x43f905[_0x464c('0x43')]['sort']);_0xb3a13d['where']=qs['filters'](_[_0x464c('0x4d')](_0x43f905[_0x464c('0x43')],_0x2e870d[_0x464c('0x45')]),_0x157158);if(_0x43f905[_0x464c('0x43')][_0x464c('0x4e')]){_0xb3a13d[_0x464c('0x4f')]=_[_0x464c('0x50')](_0xb3a13d[_0x464c('0x4f')],{'$or':_['map'](_0x157158,function(_0x1ae24e){if(_0x1ae24e['type']!=='VIRTUAL'){var _0x4048f6={};_0x4048f6[_0x1ae24e[_0x464c('0x3a')]]={'$like':'%'+_0x43f905[_0x464c('0x43')][_0x464c('0x4e')]+'%'};return _0x4048f6;}})});}_0xb3a13d=_['merge']({},_0xb3a13d,_0x43f905[_0x464c('0x51')]);var _0x388b9c={'where':_0xb3a13d[_0x464c('0x4f')]};return db[_0x464c('0x3d')]['count'](_0x388b9c)['then'](function(_0x173ee8){_0x306ffa[_0x464c('0x31')]=_0x173ee8;if(_0x43f905['query'][_0x464c('0x52')]){_0xb3a13d['include']=[{'all':!![]}];}return db[_0x464c('0x3d')][_0x464c('0x53')](_0xb3a13d);})['then'](function(_0x284909){_0x306ffa[_0x464c('0x54')]=_0x284909;return _0x306ffa;})['then'](respondWithFilteredResult(_0x1f073,_0xb3a13d))[_0x464c('0x2b')](handleError(_0x1f073,null));};exports['show']=function(_0xed427d,_0x370c34){var _0x1fb6ad={'raw':!![],'where':{'id':_0xed427d[_0x464c('0x55')]['id']}},_0x5a984a={};_0x5a984a['model']=_[_0x464c('0x44')](db[_0x464c('0x3d')][_0x464c('0x3e')]);_0x5a984a[_0x464c('0x43')]=_[_0x464c('0x44')](_0xed427d['query']);_0x5a984a[_0x464c('0x45')]=_[_0x464c('0x46')](_0x5a984a['model'],_0x5a984a['query']);_0x1fb6ad[_0x464c('0x47')]=_[_0x464c('0x46')](_0x5a984a['model'],qs['fields'](_0xed427d[_0x464c('0x43')][_0x464c('0x48')]));_0x1fb6ad[_0x464c('0x47')]=_0x1fb6ad['attributes'][_0x464c('0x49')]?_0x1fb6ad[_0x464c('0x47')]:_0x5a984a['model'];if(_0xed427d[_0x464c('0x43')][_0x464c('0x52')]){_0x1fb6ad[_0x464c('0x56')]=[{'all':!![]}];}_0x1fb6ad=_['merge']({},_0x1fb6ad,_0xed427d['options']);return db[_0x464c('0x3d')][_0x464c('0x57')](_0x1fb6ad)[_0x464c('0x21')](handleEntityNotFound(_0x370c34,null))[_0x464c('0x21')](respondWithResult(_0x370c34,null))[_0x464c('0x2b')](handleError(_0x370c34,null));};exports['create']=function(_0x48410e,_0x290707){return db[_0x464c('0x3d')]['create'](_0x48410e[_0x464c('0x58')],{})[_0x464c('0x21')](respondWithResult(_0x290707,0xc9))[_0x464c('0x2b')](handleError(_0x290707,null));};exports[_0x464c('0x59')]=function(_0x1c5b08,_0x31dd34){if(_0x1c5b08[_0x464c('0x58')]['id']){delete _0x1c5b08['body']['id'];}return db[_0x464c('0x3d')][_0x464c('0x57')]({'where':{'id':_0x1c5b08['params']['id']}})['then'](handleEntityNotFound(_0x31dd34,null))['then'](saveUpdates(_0x1c5b08[_0x464c('0x58')],null))[_0x464c('0x21')](respondWithResult(_0x31dd34,null))[_0x464c('0x2b')](handleError(_0x31dd34,null));};exports[_0x464c('0x5a')]=function(_0x5d3beb,_0x58a835){return db[_0x464c('0x3d')][_0x464c('0x57')]({'where':{'id':_0x5d3beb[_0x464c('0x55')]['id']}})[_0x464c('0x21')](handleEntityNotFound(_0x58a835,null))[_0x464c('0x21')](removeEntity(_0x58a835,null))[_0x464c('0x2b')](handleError(_0x58a835,null));};exports[_0x464c('0x5b')]=function(_0x2c9270,_0x42adc6){return db[_0x464c('0x3d')]['describe']()[_0x464c('0x21')](respondWithResult(_0x42adc6,null))['catch'](handleError(_0x42adc6,null));};var interaction_log=require(_0x464c('0x5c'))(_0x464c('0x5d'));exports[_0x464c('0x5e')]=function(_0x36abad,_0x4b7667,_0x3cdbf5){var _0xa2aa56={'agent':{},'channel':_0x464c('0x5f')};if(_0x36abad[_0x464c('0x58')]['id']){delete _0x36abad['body']['id'];}_0x36abad[_0x464c('0x58')][_0x464c('0x60')]=!![];_0x36abad['body'][_0x464c('0x61')]=moment()['format'](_0x464c('0x62'));_0x36abad[_0x464c('0x58')][_0x464c('0x63')]=_0x36abad[_0x464c('0x58')]['UserId']||_0x36abad[_0x464c('0x64')]['id'];_0xa2aa56[_0x464c('0x65')]['id']=_0x36abad[_0x464c('0x58')]['UserId'];return db[_0x464c('0x3d')]['find']({'where':{'id':_0x36abad[_0x464c('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4b7667,null))[_0x464c('0x21')](saveUpdates(_0x36abad[_0x464c('0x58')],null))[_0x464c('0x21')](function(_0x443c63){if(_0x443c63){_0xa2aa56[_0x464c('0x29')]=_0x443c63[_0x464c('0x66')]({'plain':!![]});return db[_0x464c('0x67')]['find']({'where':{'id':_0x443c63[_0x464c('0x68')]}});}return null;})[_0x464c('0x21')](handleEntityNotFound(_0x4b7667,null))[_0x464c('0x21')](function(_0x2e2d5a){if(_0x2e2d5a){return _0x2e2d5a['update']({'UserId':_0x36abad[_0x464c('0x58')][_0x464c('0x63')],'read1stAt':_[_0x464c('0x69')](_0x2e2d5a['read1stAt'])?moment()[_0x464c('0x6a')](_0x464c('0x62')):undefined});}return null;})[_0x464c('0x21')](function(_0x20cf14){if(_0x20cf14){_0xa2aa56[_0x464c('0x6b')]=_0x20cf14['get']({'plain':!![]});interaction_log[_0x464c('0x22')](_0x464c('0x6c'),_0x36abad[_0x464c('0x64')]['id'],_0x36abad[_0x464c('0x64')][_0x464c('0x3a')],_0x36abad[_0x464c('0x64')][_0x464c('0x6d')],_0xa2aa56[_0x464c('0x6b')]['id'],_0x36abad[_0x464c('0x58')]?JSON['stringify'](_0x36abad[_0x464c('0x58')]):_0x464c('0x6e'));return respondWithRpcPromise(_0x464c('0x6f'),_0x464c('0x70'),_0xa2aa56);}return null;})['then'](function(_0x1d6e5a){var _0x100bf1=_0x464c('0x71')+_0x1d6e5a[_0x464c('0x29')][_0x464c('0x72')];return db[_0x464c('0x73')][_0x464c('0x43')](_0x100bf1,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x4f0277){return _0x4f0277;});})[_0x464c('0x21')](function(_0x173f9d){if(_0x173f9d){_0xa2aa56[_0x464c('0x29')][_0x464c('0x74')]=_0x173f9d[0x0];if(!_0x36abad[_0x464c('0x58')][_0x464c('0x63')])return;return db['User'][_0x464c('0x57')]({'where':{'id':_0x36abad['body']['UserId'],'role':_0x464c('0x65')},'attributes':['id',_0x464c('0x3a'),'fullname',_0x464c('0x75'),_0x464c('0x76')],'raw':!![]});}return null;})[_0x464c('0x21')](function(_0x339b56){if(!_0x339b56)return null;_0xa2aa56[_0x464c('0x29')][_0x464c('0x65')]=_0x339b56;return _0xa2aa56;})[_0x464c('0x21')](function(_0x479c76){if(_0x479c76){if(_0x36abad[_0x464c('0x58')][_0x464c('0x77')]){_0xa2aa56[_0x464c('0x29')][_0x464c('0x78')]=util['format']('SIP/%s',_0x36abad[_0x464c('0x64')][_0x464c('0x3a')]);_0xa2aa56[_0x464c('0x29')]['channel']=_0xa2aa56[_0x464c('0x79')];_0xa2aa56['message'][_0x464c('0x7a')]=_0x464c('0x5e');return respondWithRpcPromise('EventManager',_0x464c('0x7b'),{'event':_0x464c('0x7c'),'message':_0xa2aa56[_0x464c('0x29')]},client9002)[_0x464c('0x21')](function(){return _0xa2aa56;});}return _0xa2aa56;}return null;})['then'](respondWithResult(_0x4b7667,null))[_0x464c('0x2b')](handleError(_0x4b7667,null));};var interaction_log=require(_0x464c('0x5c'))(_0x464c('0x5d'));exports[_0x464c('0x36')]=function(_0x10cec0,_0x35e62d,_0x2f9226){var _0x129507={'agent':{},'channel':_0x464c('0x5f')};if(_0x10cec0[_0x464c('0x58')]['id']){delete _0x10cec0['body']['id'];}_0x10cec0[_0x464c('0x58')][_0x464c('0x63')]=_0x10cec0[_0x464c('0x58')][_0x464c('0x63')]||_0x10cec0[_0x464c('0x64')]['id'];_0x129507[_0x464c('0x65')]['id']=_0x10cec0[_0x464c('0x58')][_0x464c('0x63')];return db[_0x464c('0x3d')][_0x464c('0x57')]({'where':{'id':_0x10cec0[_0x464c('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x35e62d,null))[_0x464c('0x21')](function(_0x31fc0a){if(_0x31fc0a){_0x129507[_0x464c('0x29')]=_0x31fc0a['get']({'plain':!![]});return db[_0x464c('0x67')]['find']({'where':{'id':_0x31fc0a['OpenchannelInteractionId']}});}return null;})[_0x464c('0x21')](handleEntityNotFound(_0x35e62d,null))[_0x464c('0x21')](function(_0x533792){if(_0x533792){_0x129507[_0x464c('0x6b')]=_0x533792[_0x464c('0x66')]({'plain':!![]});interaction_log['info'](_0x464c('0x7d'),_0x10cec0[_0x464c('0x64')]['id'],_0x10cec0[_0x464c('0x64')][_0x464c('0x3a')],_0x10cec0[_0x464c('0x64')][_0x464c('0x6d')],_0x129507[_0x464c('0x6b')]['id'],_0x10cec0[_0x464c('0x58')]?JSON[_0x464c('0x26')](_0x10cec0['body']):'null');return respondWithRpcPromise(_0x464c('0x7e'),_0x464c('0x7f'),_0x129507);}return null;})[_0x464c('0x21')](function(_0x557d13){var _0x57bba5=_0x464c('0x71')+_0x557d13['message'][_0x464c('0x72')];return db['sequelize'][_0x464c('0x43')](_0x57bba5,{'type':db['Sequelize'][_0x464c('0x80')][_0x464c('0x81')],'raw':!![]})['then'](function(_0x3ac404){return _0x3ac404;});})[_0x464c('0x21')](function(_0x4862e3){if(_0x4862e3){_0x129507[_0x464c('0x29')][_0x464c('0x74')]=_0x4862e3[0x0];if(!_0x10cec0['body']['UserId'])return;return db[_0x464c('0x82')]['find']({'where':{'id':_0x10cec0[_0x464c('0x58')][_0x464c('0x63')],'role':_0x464c('0x65')},'attributes':['id','name',_0x464c('0x83'),'email','internal'],'raw':!![]});}return null;})[_0x464c('0x21')](function(_0x52ab01){if(!_0x52ab01)return null;_0x129507[_0x464c('0x29')][_0x464c('0x65')]=_0x52ab01;return _0x129507;})[_0x464c('0x21')](function(_0x67cdad){if(_0x67cdad){_0x67cdad[_0x464c('0x29')][_0x464c('0x78')]=util['format'](_0x464c('0x84'),_0x10cec0['user']['name']);_0x67cdad['message']['channel']=_0x129507[_0x464c('0x79')];_0x67cdad[_0x464c('0x29')][_0x464c('0x7a')]=_0x464c('0x36');respondWithRpcPromise(_0x464c('0x7b'),_0x464c('0x7b'),{'event':_0x464c('0x85'),'message':_0x67cdad[_0x464c('0x29')]},client9002);return _0x129507;}return null;})[_0x464c('0x21')](respondWithResult(_0x35e62d,null))[_0x464c('0x2b')](handleError(_0x35e62d,null));};
\ No newline at end of file
+var _0xeb26=['nolimit','order','sort','where','pick','filter','merge','options','OpenchannelMessage','includeAll','findAll','rows','show','params','rawAttributes','include','create','body','find','destroy','describe','openchannel-interactions','accept','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','EventManager','acceptmessage','../../config/logger','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','event','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','sendStatus','stack','send','index','map','key','model','name','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x24b7d9,_0x2808e8){var _0x549b61=function(_0x1fddcd){while(--_0x1fddcd){_0x24b7d9['push'](_0x24b7d9['shift']());}};_0x549b61(++_0x2808e8);}(_0xeb26,0x14b));var _0x6eb2=function(_0x480885,_0x431637){_0x480885=_0x480885-0x0;var _0x323f19=_0xeb26[_0x480885];return _0x323f19;};'use strict';var emlformat=require(_0x6eb2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6eb2('0x1'));var jsonpatch=require(_0x6eb2('0x2'));var rp=require(_0x6eb2('0x3'));var moment=require(_0x6eb2('0x4'));var BPromise=require(_0x6eb2('0x5'));var Mustache=require(_0x6eb2('0x6'));var util=require('util');var path=require(_0x6eb2('0x7'));var sox=require(_0x6eb2('0x8'));var csv=require(_0x6eb2('0x9'));var ejs=require(_0x6eb2('0xa'));var fs=require('fs');var fs_extra=require(_0x6eb2('0xb'));var _=require(_0x6eb2('0xc'));var squel=require(_0x6eb2('0xd'));var crypto=require(_0x6eb2('0xe'));var jsforce=require(_0x6eb2('0xf'));var deskjs=require(_0x6eb2('0x10'));var toCsv=require(_0x6eb2('0x9'));var querystring=require(_0x6eb2('0x11'));var Papa=require(_0x6eb2('0x12'));var Redis=require('ioredis');var authService=require(_0x6eb2('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6eb2('0x14'));var hardwareService=require(_0x6eb2('0x15'));var logger=require('../../config/logger')(_0x6eb2('0x16'));var utils=require(_0x6eb2('0x17'));var config=require(_0x6eb2('0x18'));var licenseUtil=require(_0x6eb2('0x19'));var db=require(_0x6eb2('0x1a'))['db'];config[_0x6eb2('0x1b')]=_[_0x6eb2('0x1c')](config['redis'],{'host':_0x6eb2('0x1d'),'port':0x18eb});var socket=require(_0x6eb2('0x1e'))(new Redis(config[_0x6eb2('0x1b')]));require(_0x6eb2('0x1f'))[_0x6eb2('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6eb2('0x21')][_0x6eb2('0x22')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x211920,_0x288bbf,_0x185e65,_0x5f1849){return new BPromise(function(_0x4a70ea,_0x39b9fb){var _0x1eb270=_0x5f1849||client;return _0x1eb270[_0x6eb2('0x23')](_0x211920,_0x185e65)['then'](function(_0xcea0da){logger['info'](_0x6eb2('0x24'),_0x288bbf,_0x6eb2('0x25'));logger[_0x6eb2('0x26')](_0x6eb2('0x27'),_0x288bbf,_0x6eb2('0x25'),JSON[_0x6eb2('0x28')](_0xcea0da));if(_0xcea0da[_0x6eb2('0x29')]){if(_0xcea0da[_0x6eb2('0x29')]['code']===0x1f4){logger[_0x6eb2('0x29')](_0x6eb2('0x24'),_0x288bbf,_0xcea0da[_0x6eb2('0x29')]['message']);return _0x39b9fb(_0xcea0da[_0x6eb2('0x29')][_0x6eb2('0x2a')]);}logger['error'](_0x6eb2('0x24'),_0x288bbf,_0xcea0da[_0x6eb2('0x29')][_0x6eb2('0x2a')]);return _0x4a70ea(_0xcea0da[_0x6eb2('0x29')][_0x6eb2('0x2a')]);}else{logger[_0x6eb2('0x2b')](_0x6eb2('0x24'),_0x288bbf,'request\x20sent');_0x4a70ea(_0xcea0da['result'][_0x6eb2('0x2a')]);}})[_0x6eb2('0x2c')](function(_0xc64b27){logger[_0x6eb2('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x288bbf,_0xc64b27);_0x39b9fb(_0xc64b27);});});}function respondWithStatusCode(_0x2aebcd,_0x492fb6){_0x492fb6=_0x492fb6||0xcc;return function(_0x2754bc){if(_0x2754bc){return _0x2aebcd['sendStatus'](_0x492fb6);}return _0x2aebcd[_0x6eb2('0x2d')](_0x492fb6)[_0x6eb2('0x2e')]();};}function respondWithResult(_0xe0c6fb,_0x10d32c){_0x10d32c=_0x10d32c||0xc8;return function(_0xcc06c5){if(_0xcc06c5){return _0xe0c6fb[_0x6eb2('0x2d')](_0x10d32c)[_0x6eb2('0x2f')](_0xcc06c5);}};}function respondWithFilteredResult(_0x38020f,_0xf90a0){return function(_0x22e7b0){if(_0x22e7b0){var _0x22865f=typeof _0xf90a0[_0x6eb2('0x30')]===_0x6eb2('0x31')&&typeof _0xf90a0[_0x6eb2('0x32')]==='undefined';var _0xf2fd35=_0x22e7b0[_0x6eb2('0x33')];var _0x3bdd75=_0x22865f?0x0:_0xf90a0[_0x6eb2('0x30')];var _0x3ffeb2=_0x22865f?_0x22e7b0[_0x6eb2('0x33')]:_0xf90a0[_0x6eb2('0x30')]+_0xf90a0[_0x6eb2('0x32')];var _0xb97f05;if(_0x3ffeb2>=_0xf2fd35){_0x3ffeb2=_0xf2fd35;_0xb97f05=0xc8;}else{_0xb97f05=0xce;}_0x38020f['status'](_0xb97f05);return _0x38020f[_0x6eb2('0x34')](_0x6eb2('0x35'),_0x3bdd75+'-'+_0x3ffeb2+'/'+_0xf2fd35)[_0x6eb2('0x2f')](_0x22e7b0);}return null;};}function patchUpdates(_0x283f5a){return function(_0x166a27){try{jsonpatch[_0x6eb2('0x36')](_0x166a27,_0x283f5a,!![]);}catch(_0x578524){return BPromise['reject'](_0x578524);}return _0x166a27[_0x6eb2('0x37')]();};}function saveUpdates(_0x426dc4,_0x154676){return function(_0x2ebb96){if(_0x2ebb96){return _0x2ebb96[_0x6eb2('0x38')](_0x426dc4)[_0x6eb2('0x39')](function(_0x2109b1){return _0x2109b1;});}return null;};}function removeEntity(_0x1de83b,_0xa84719){return function(_0x35d893){if(_0x35d893){return _0x35d893['destroy']()['then'](function(){_0x1de83b['status'](0xcc)[_0x6eb2('0x2e')]();});}};}function handleEntityNotFound(_0x2a7bfe,_0x4d9909){return function(_0x417e64){if(!_0x417e64){_0x2a7bfe[_0x6eb2('0x3a')](0x194);}return _0x417e64;};}function handleError(_0x5cd6ee,_0x24d9cb){_0x24d9cb=_0x24d9cb||0x1f4;return function(_0x432458){logger[_0x6eb2('0x29')](_0x432458[_0x6eb2('0x3b')]);if(_0x432458['name']){delete _0x432458['name'];}_0x5cd6ee[_0x6eb2('0x2d')](_0x24d9cb)[_0x6eb2('0x3c')](_0x432458);};}exports[_0x6eb2('0x3d')]=function(_0xe642bd,_0x20ee5b){var _0x3b1972={},_0x505011={},_0x1fd64c={'count':0x0,'rows':[]};var _0x12874d=_[_0x6eb2('0x3e')](db['OpenchannelMessage']['rawAttributes'],function(_0x52e331){return{'name':_0x52e331['fieldName'],'type':_0x52e331['type'][_0x6eb2('0x3f')]};});_0x505011[_0x6eb2('0x40')]=_[_0x6eb2('0x3e')](_0x12874d,_0x6eb2('0x41'));_0x505011['query']=_[_0x6eb2('0x42')](_0xe642bd[_0x6eb2('0x43')]);_0x505011[_0x6eb2('0x44')]=_[_0x6eb2('0x45')](_0x505011['model'],_0x505011[_0x6eb2('0x43')]);_0x3b1972[_0x6eb2('0x46')]=_[_0x6eb2('0x45')](_0x505011[_0x6eb2('0x40')],qs[_0x6eb2('0x47')](_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x47')]));_0x3b1972[_0x6eb2('0x46')]=_0x3b1972['attributes'][_0x6eb2('0x48')]?_0x3b1972[_0x6eb2('0x46')]:_0x505011[_0x6eb2('0x40')];if(!_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x49')](_0x6eb2('0x4a'))){_0x3b1972[_0x6eb2('0x32')]=qs['limit'](_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x32')]);_0x3b1972[_0x6eb2('0x30')]=qs['offset'](_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x30')]);}_0x3b1972[_0x6eb2('0x4b')]=qs[_0x6eb2('0x4c')](_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x4c')]);_0x3b1972[_0x6eb2('0x4d')]=qs[_0x6eb2('0x44')](_[_0x6eb2('0x4e')](_0xe642bd['query'],_0x505011[_0x6eb2('0x44')]),_0x12874d);if(_0xe642bd['query'][_0x6eb2('0x4f')]){_0x3b1972[_0x6eb2('0x4d')]=_[_0x6eb2('0x50')](_0x3b1972[_0x6eb2('0x4d')],{'$or':_[_0x6eb2('0x3e')](_0x12874d,function(_0x381a0b){if(_0x381a0b['type']!=='VIRTUAL'){var _0x1d091c={};_0x1d091c[_0x381a0b[_0x6eb2('0x41')]]={'$like':'%'+_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x4f')]+'%'};return _0x1d091c;}})});}_0x3b1972=_[_0x6eb2('0x50')]({},_0x3b1972,_0xe642bd[_0x6eb2('0x51')]);var _0x2f2476={'where':_0x3b1972[_0x6eb2('0x4d')]};return db[_0x6eb2('0x52')]['count'](_0x2f2476)[_0x6eb2('0x39')](function(_0x33566e){_0x1fd64c['count']=_0x33566e;if(_0xe642bd[_0x6eb2('0x43')][_0x6eb2('0x53')]){_0x3b1972['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6eb2('0x54')](_0x3b1972);})[_0x6eb2('0x39')](function(_0x948f62){_0x1fd64c[_0x6eb2('0x55')]=_0x948f62;return _0x1fd64c;})[_0x6eb2('0x39')](respondWithFilteredResult(_0x20ee5b,_0x3b1972))[_0x6eb2('0x2c')](handleError(_0x20ee5b,null));};exports[_0x6eb2('0x56')]=function(_0x4d2a8f,_0x4a7cfc){var _0x495e90={'raw':!![],'where':{'id':_0x4d2a8f[_0x6eb2('0x57')]['id']}},_0x2adbb9={};_0x2adbb9[_0x6eb2('0x40')]=_[_0x6eb2('0x42')](db['OpenchannelMessage'][_0x6eb2('0x58')]);_0x2adbb9[_0x6eb2('0x43')]=_[_0x6eb2('0x42')](_0x4d2a8f[_0x6eb2('0x43')]);_0x2adbb9[_0x6eb2('0x44')]=_[_0x6eb2('0x45')](_0x2adbb9[_0x6eb2('0x40')],_0x2adbb9[_0x6eb2('0x43')]);_0x495e90[_0x6eb2('0x46')]=_[_0x6eb2('0x45')](_0x2adbb9[_0x6eb2('0x40')],qs[_0x6eb2('0x47')](_0x4d2a8f[_0x6eb2('0x43')][_0x6eb2('0x47')]));_0x495e90[_0x6eb2('0x46')]=_0x495e90[_0x6eb2('0x46')][_0x6eb2('0x48')]?_0x495e90['attributes']:_0x2adbb9[_0x6eb2('0x40')];if(_0x4d2a8f[_0x6eb2('0x43')][_0x6eb2('0x53')]){_0x495e90[_0x6eb2('0x59')]=[{'all':!![]}];}_0x495e90=_[_0x6eb2('0x50')]({},_0x495e90,_0x4d2a8f['options']);return db[_0x6eb2('0x52')]['find'](_0x495e90)[_0x6eb2('0x39')](handleEntityNotFound(_0x4a7cfc,null))['then'](respondWithResult(_0x4a7cfc,null))[_0x6eb2('0x2c')](handleError(_0x4a7cfc,null));};exports[_0x6eb2('0x5a')]=function(_0x2618dc,_0x1d55a2){return db[_0x6eb2('0x52')][_0x6eb2('0x5a')](_0x2618dc[_0x6eb2('0x5b')],{})[_0x6eb2('0x39')](respondWithResult(_0x1d55a2,0xc9))[_0x6eb2('0x2c')](handleError(_0x1d55a2,null));};exports[_0x6eb2('0x38')]=function(_0x58212e,_0x36c9bc){if(_0x58212e[_0x6eb2('0x5b')]['id']){delete _0x58212e[_0x6eb2('0x5b')]['id'];}return db['OpenchannelMessage'][_0x6eb2('0x5c')]({'where':{'id':_0x58212e[_0x6eb2('0x57')]['id']}})[_0x6eb2('0x39')](handleEntityNotFound(_0x36c9bc,null))[_0x6eb2('0x39')](saveUpdates(_0x58212e[_0x6eb2('0x5b')],null))[_0x6eb2('0x39')](respondWithResult(_0x36c9bc,null))[_0x6eb2('0x2c')](handleError(_0x36c9bc,null));};exports[_0x6eb2('0x5d')]=function(_0x4ac66b,_0x4995b9){return db[_0x6eb2('0x52')][_0x6eb2('0x5c')]({'where':{'id':_0x4ac66b[_0x6eb2('0x57')]['id']}})[_0x6eb2('0x39')](handleEntityNotFound(_0x4995b9,null))[_0x6eb2('0x39')](removeEntity(_0x4995b9,null))['catch'](handleError(_0x4995b9,null));};exports[_0x6eb2('0x5e')]=function(_0x580ec2,_0x543266){return db[_0x6eb2('0x52')][_0x6eb2('0x5e')]()[_0x6eb2('0x39')](respondWithResult(_0x543266,null))['catch'](handleError(_0x543266,null));};var interaction_log=require('../../config/logger')(_0x6eb2('0x5f'));exports[_0x6eb2('0x60')]=function(_0x37aa7d,_0x1bbbee,_0x2e3ec6){var _0x5f0734={'agent':{},'channel':_0x6eb2('0x61')};if(_0x37aa7d['body']['id']){delete _0x37aa7d[_0x6eb2('0x5b')]['id'];}_0x37aa7d[_0x6eb2('0x5b')]['read']=!![];_0x37aa7d[_0x6eb2('0x5b')][_0x6eb2('0x62')]=moment()[_0x6eb2('0x63')](_0x6eb2('0x64'));_0x37aa7d[_0x6eb2('0x5b')][_0x6eb2('0x65')]=_0x37aa7d['body']['UserId']||_0x37aa7d[_0x6eb2('0x66')]['id'];_0x5f0734[_0x6eb2('0x67')]['id']=_0x37aa7d[_0x6eb2('0x5b')][_0x6eb2('0x65')];return db[_0x6eb2('0x52')][_0x6eb2('0x5c')]({'where':{'id':_0x37aa7d[_0x6eb2('0x57')]['id'],'UserId':null}})[_0x6eb2('0x39')](handleEntityNotFound(_0x1bbbee,null))[_0x6eb2('0x39')](saveUpdates(_0x37aa7d[_0x6eb2('0x5b')],null))['then'](function(_0x453f78){if(_0x453f78){_0x5f0734[_0x6eb2('0x2a')]=_0x453f78[_0x6eb2('0x68')]({'plain':!![]});return db[_0x6eb2('0x69')]['find']({'where':{'id':_0x453f78[_0x6eb2('0x6a')]}});}return null;})['then'](handleEntityNotFound(_0x1bbbee,null))[_0x6eb2('0x39')](function(_0x163c08){if(_0x163c08){return _0x163c08['update']({'UserId':_0x37aa7d[_0x6eb2('0x5b')]['UserId'],'read1stAt':_[_0x6eb2('0x6b')](_0x163c08[_0x6eb2('0x6c')])?moment()[_0x6eb2('0x63')](_0x6eb2('0x64')):undefined});}return null;})['then'](function(_0x56568b){if(_0x56568b){_0x5f0734[_0x6eb2('0x6d')]=_0x56568b[_0x6eb2('0x68')]({'plain':!![]});interaction_log[_0x6eb2('0x2b')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x37aa7d[_0x6eb2('0x66')]['id'],_0x37aa7d[_0x6eb2('0x66')][_0x6eb2('0x41')],_0x37aa7d[_0x6eb2('0x66')][_0x6eb2('0x6e')],_0x5f0734['interaction']['id'],_0x37aa7d[_0x6eb2('0x5b')]?JSON[_0x6eb2('0x28')](_0x37aa7d[_0x6eb2('0x5b')]):_0x6eb2('0x6f'));return respondWithRpcPromise(_0x6eb2('0x70'),'acceptMessage',_0x5f0734);}return null;})[_0x6eb2('0x39')](function(_0x39fcdf){var _0x1d1ac0=_0x6eb2('0x71')+_0x39fcdf['message']['ContactId'];return db[_0x6eb2('0x72')]['query'](_0x1d1ac0,{'type':db[_0x6eb2('0x73')][_0x6eb2('0x74')][_0x6eb2('0x75')],'raw':!![]})[_0x6eb2('0x39')](function(_0x45f6c8){return _0x45f6c8;});})[_0x6eb2('0x39')](function(_0x582c6b){if(_0x582c6b){_0x5f0734[_0x6eb2('0x2a')][_0x6eb2('0x76')]=_0x582c6b[0x0];if(!_0x37aa7d[_0x6eb2('0x5b')][_0x6eb2('0x65')])return;return db[_0x6eb2('0x77')][_0x6eb2('0x5c')]({'where':{'id':_0x37aa7d[_0x6eb2('0x5b')][_0x6eb2('0x65')],'role':_0x6eb2('0x67')},'attributes':['id',_0x6eb2('0x41'),_0x6eb2('0x78'),_0x6eb2('0x79'),_0x6eb2('0x7a')],'raw':!![]});}return null;})[_0x6eb2('0x39')](function(_0xf8d7d4){if(!_0xf8d7d4)return null;_0x5f0734[_0x6eb2('0x2a')][_0x6eb2('0x67')]=_0xf8d7d4;return _0x5f0734;})[_0x6eb2('0x39')](function(_0x561c35){if(_0x561c35){if(_0x37aa7d[_0x6eb2('0x5b')]['manual']){_0x5f0734[_0x6eb2('0x2a')][_0x6eb2('0x7b')]=util[_0x6eb2('0x63')](_0x6eb2('0x7c'),_0x37aa7d[_0x6eb2('0x66')][_0x6eb2('0x41')]);_0x5f0734[_0x6eb2('0x2a')][_0x6eb2('0x7d')]=_0x5f0734[_0x6eb2('0x7d')];_0x5f0734[_0x6eb2('0x2a')]['event']='accept';return respondWithRpcPromise(_0x6eb2('0x7e'),_0x6eb2('0x7e'),{'event':_0x6eb2('0x7f'),'message':_0x5f0734['message']},client9002)[_0x6eb2('0x39')](function(){return _0x5f0734;});}return _0x5f0734;}return null;})[_0x6eb2('0x39')](respondWithResult(_0x1bbbee,null))[_0x6eb2('0x2c')](handleError(_0x1bbbee,null));};var interaction_log=require(_0x6eb2('0x80'))('openchannel-interactions');exports[_0x6eb2('0x81')]=function(_0x53264f,_0x149dc5,_0x12e029){var _0x1dc908={'agent':{},'channel':_0x6eb2('0x61')};if(_0x53264f[_0x6eb2('0x5b')]['id']){delete _0x53264f[_0x6eb2('0x5b')]['id'];}_0x53264f[_0x6eb2('0x5b')][_0x6eb2('0x65')]=_0x53264f[_0x6eb2('0x5b')]['UserId']||_0x53264f[_0x6eb2('0x66')]['id'];_0x1dc908[_0x6eb2('0x67')]['id']=_0x53264f[_0x6eb2('0x5b')]['UserId'];return db[_0x6eb2('0x52')][_0x6eb2('0x5c')]({'where':{'id':_0x53264f['params']['id'],'UserId':null}})[_0x6eb2('0x39')](handleEntityNotFound(_0x149dc5,null))['then'](function(_0x4a599e){if(_0x4a599e){_0x1dc908[_0x6eb2('0x2a')]=_0x4a599e[_0x6eb2('0x68')]({'plain':!![]});return db[_0x6eb2('0x69')]['find']({'where':{'id':_0x4a599e[_0x6eb2('0x6a')]}});}return null;})[_0x6eb2('0x39')](handleEntityNotFound(_0x149dc5,null))[_0x6eb2('0x39')](function(_0x18b7ff){if(_0x18b7ff){_0x1dc908[_0x6eb2('0x6d')]=_0x18b7ff[_0x6eb2('0x68')]({'plain':!![]});interaction_log[_0x6eb2('0x2b')](_0x6eb2('0x82'),_0x53264f[_0x6eb2('0x66')]['id'],_0x53264f[_0x6eb2('0x66')][_0x6eb2('0x41')],_0x53264f[_0x6eb2('0x66')]['role'],_0x1dc908[_0x6eb2('0x6d')]['id'],_0x53264f[_0x6eb2('0x5b')]?JSON[_0x6eb2('0x28')](_0x53264f['body']):_0x6eb2('0x6f'));return respondWithRpcPromise(_0x6eb2('0x83'),_0x6eb2('0x84'),_0x1dc908);}return null;})[_0x6eb2('0x39')](function(_0x23a1bf){var _0x561c72=_0x6eb2('0x71')+_0x23a1bf['message'][_0x6eb2('0x85')];return db['sequelize']['query'](_0x561c72,{'type':db[_0x6eb2('0x73')][_0x6eb2('0x74')][_0x6eb2('0x75')],'raw':!![]})[_0x6eb2('0x39')](function(_0x2177b1){return _0x2177b1;});})['then'](function(_0x1b0e90){if(_0x1b0e90){_0x1dc908[_0x6eb2('0x2a')]['contact']=_0x1b0e90[0x0];if(!_0x53264f[_0x6eb2('0x5b')][_0x6eb2('0x65')])return;return db[_0x6eb2('0x77')][_0x6eb2('0x5c')]({'where':{'id':_0x53264f['body'][_0x6eb2('0x65')],'role':_0x6eb2('0x67')},'attributes':['id',_0x6eb2('0x41'),_0x6eb2('0x78'),_0x6eb2('0x79'),_0x6eb2('0x7a')],'raw':!![]});}return null;})['then'](function(_0x832416){if(!_0x832416)return null;_0x1dc908['message'][_0x6eb2('0x67')]=_0x832416;return _0x1dc908;})[_0x6eb2('0x39')](function(_0x159de2){if(_0x159de2){_0x159de2[_0x6eb2('0x2a')][_0x6eb2('0x7b')]=util['format'](_0x6eb2('0x7c'),_0x53264f[_0x6eb2('0x66')]['name']);_0x159de2['message'][_0x6eb2('0x7d')]=_0x1dc908['channel'];_0x159de2[_0x6eb2('0x2a')][_0x6eb2('0x86')]=_0x6eb2('0x81');respondWithRpcPromise('EventManager',_0x6eb2('0x7e'),{'event':'rejectmessage','message':_0x159de2['message']},client9002);return _0x1dc908;}return null;})[_0x6eb2('0x39')](respondWithResult(_0x149dc5,null))[_0x6eb2('0x2c')](handleError(_0x149dc5,null));};
\ No newline at end of file
index 4439f3f..8d69063 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73f8=['events','../../mysqldb','save','emit','hasOwnProperty','exports'];(function(_0x2b3c76,_0x56d99a){var _0x108e68=function(_0x49d7b2){while(--_0x49d7b2){_0x2b3c76['push'](_0x2b3c76['shift']());}};_0x108e68(++_0x56d99a);}(_0x73f8,0x18c));var _0x873f=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x73f8[_0x33032e];return _0x13316b;};'use strict';var EventEmitter=require(_0x873f('0x0'));var OpenchannelMessage=require(_0x873f('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x873f('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x29a269){return function(_0x522671,_0x5d29a1,_0x565aca){OpenchannelMessageEvents[_0x873f('0x3')](_0x29a269+':'+_0x522671['id'],_0x522671);OpenchannelMessageEvents['emit'](_0x29a269,_0x522671);_0x565aca(null);};}for(var e in events){if(events[_0x873f('0x4')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x873f('0x5')]=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xe4c5=['update','hasOwnProperty','hook','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0xcfeda9,_0xd418ae){var _0x4826c7=function(_0x45dc9d){while(--_0x45dc9d){_0xcfeda9['push'](_0xcfeda9['shift']());}};_0x4826c7(++_0xd418ae);}(_0xe4c5,0x12b));var _0x5e4c=function(_0x46d196,_0x1b5903){_0x46d196=_0x46d196-0x0;var _0x3039e3=_0xe4c5[_0x46d196];return _0x3039e3;};'use strict';var EventEmitter=require(_0x5e4c('0x0'));var OpenchannelMessage=require(_0x5e4c('0x1'))['db'][_0x5e4c('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x5e4c('0x3')](0x0);var events={'afterCreate':_0x5e4c('0x4'),'afterUpdate':_0x5e4c('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1ca565){return function(_0xf6ad02,_0x383ac9,_0x471128){OpenchannelMessageEvents['emit'](_0x1ca565+':'+_0xf6ad02['id'],_0xf6ad02);OpenchannelMessageEvents['emit'](_0x1ca565,_0xf6ad02);_0x471128(null);};}for(var e in events){if(events[_0x5e4c('0x6')](e)){var event=events[e];OpenchannelMessage[_0x5e4c('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
index c68480e..ddce6c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4024=['request-promise','rimraf','../../config/environment','define','openchannel_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccountId','keys','replyUri','info','afterCreate','Interactions','length','Interaction','omit','Contact','POST','method','GET','body','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','lodash','util','api','moment'];(function(_0x40ea21,_0x352839){var _0x52d643=function(_0x317a50){while(--_0x317a50){_0x40ea21['push'](_0x40ea21['shift']());}};_0x52d643(++_0x352839);}(_0x4024,0x89));var _0x4402=function(_0x6bf923,_0x443f6e){_0x6bf923=_0x6bf923-0x0;var _0xbb88c5=_0x4024[_0x6bf923];return _0xbb88c5;};'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('./openchannelMessage.attributes');module['exports']=function(_0x17699b,_0x346ddc){return _0x17699b[_0x4402('0x7')]('OpenchannelMessage',attributes,{'tableName':_0x4402('0x8'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0x4402('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c6ca4,_0x4d2882,_0x30fd34){var _0x4f56aa=_0x17699b[_0x4402('0xa')];var _0x4e1a7e=_0x4c6ca4[_0x4402('0xb')]({'plain':!![]});if(_0x4e1a7e['direction'][_0x4402('0xc')]()==='in'||_0x4e1a7e[_0x4402('0xd')]['toLowerCase']()===_0x4402('0xe')&&!_0x4e1a7e[_0x4402('0xf')]&&!_[_0x4402('0x10')](_0x4e1a7e['UserId'])){_0x4f56aa[_0x4402('0x11')][_0x4402('0x12')]({'where':{'id':_0x4e1a7e[_0x4402('0x13')]}})[_0x4402('0x14')](function(_0x248ad9){if(_0x248ad9){_0x248ad9[_0x4402('0x15')]({'lastMsgAt':_0x4e1a7e[_0x4402('0x16')],'lastMsgDirection':_0x4e1a7e[_0x4402('0xd')][_0x4402('0xc')]()});}})[_0x4402('0x17')](function(_0x375166){console[_0x4402('0x18')](_0x375166);});}if(_0x4e1a7e[_0x4402('0xd')]===_0x4402('0xe')&&!_0x4e1a7e[_0x4402('0xf')]){var _0x30c390;_0x4f56aa[_0x4402('0x19')][_0x4402('0x1a')]()[_0x4402('0x14')](function(_0x231382){return _0x4f56aa['OpenchannelAccount']['find']({'where':{'id':_0x4e1a7e[_0x4402('0x1b')]},'include':[{'model':_0x4f56aa[_0x4402('0x11')],'as':'Interactions','where':{'id':_0x4e1a7e[_0x4402('0x13')]},'limit':0x1,'include':[{'model':_0x4f56aa[_0x4402('0x19')],'as':'Contact','attributes':_[_0x4402('0x1c')](_0x231382)}]}]});})['then'](function(_0x55cc8c){_0x30c390=_0x55cc8c[_0x4402('0xb')]({'plain':!![]});if(_0x30c390&&_0x30c390[_0x4402('0x1d')]){logger[_0x4402('0x1e')]('OpenchannelMessage,\x20%s,\x20%s',_0x4402('0x1f'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0x4e1a7e['id'],_0x30c390[_0x4402('0x1d')]));if(_0x30c390[_0x4402('0x20')]&&_0x30c390[_0x4402('0x20')][_0x4402('0x21')]){_0x4e1a7e[_0x4402('0x22')]=_[_0x4402('0x23')](_0x30c390[_0x4402('0x20')][0x0],_0x4402('0x24'));_0x4e1a7e[_0x4402('0x24')]=_0x30c390['Interactions'][0x0][_0x4402('0x24')];}var _0x4d2882={'method':_0x4402('0x25'),'uri':encodeURI(_0x30c390[_0x4402('0x1d')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4d2882[_0x4402('0x26')]){case _0x4402('0x27'):_0x4d2882['qs']=_0x4e1a7e;break;case'POST':_0x4d2882[_0x4402('0x28')]=_0x4e1a7e;break;}return rp(_0x4d2882)['then'](function(_0x59d52f){logger[_0x4402('0x1e')](_0x4402('0x29'),_0x4402('0x1f'),util[_0x4402('0x2a')](_0x4402('0x2b'),_0x4e1a7e['id'],_0x30c390['replyUri']));if(_0x59d52f[_0x4402('0x28')]['threadId']&&_0x59d52f[_0x4402('0x28')][_0x4402('0x2c')]!=_0x4e1a7e[_0x4402('0x22')]['threadId']){return _0x4f56aa[_0x4402('0x11')][_0x4402('0x15')]({'threadId':_0x59d52f[_0x4402('0x28')][_0x4402('0x2c')]},{'logging':!![],'where':{'id':_0x4e1a7e[_0x4402('0x22')]['id']}});}else{return;}})[_0x4402('0x14')](function(){return _0x4c6ca4[_0x4402('0x15')]({'read':!![]});})[_0x4402('0x17')](function(_0x16a9f5){logger[_0x4402('0x18')](_0x4402('0x29'),'afterCreate',util[_0x4402('0x2d')](_0x16a9f5,{'showHidden':![],'depth':null}));_0x30fd34();});}else{_0x30fd34();}})['finally'](function(){_0x30fd34();});}else{_0x30fd34();}}},'charset':_0x4402('0x2e'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd7d1=['OpenchannelMessage,\x20%s,\x20%s','inspect','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','isNil','findOne','OpenchannelInteractionId','update','createdAt','catch','error','secret','CmContact','describe','then','OpenchannelAccount','find','Interactions','Contact','keys','replyUri','info','afterCreate','format','length','omit','method','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','OpenchannelInteraction','Interaction'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0xb2c6d5,_0x243efa){_0xb2c6d5=_0xb2c6d5-0x0;var _0x4d77be=_0xd7d1[_0xb2c6d5];return _0x4d77be;};'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':[{'name':_0x1d7d('0xf'),'fields':[_0x1d7d('0x10')],'type':_0x1d7d('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x155bfb,_0xa44223,_0x1ad06f){var _0x8b258b=_0x14b2b9[_0x1d7d('0x12')];var _0x547f7b=_0x155bfb[_0x1d7d('0x13')]({'plain':!![]});if(_0x547f7b['direction'][_0x1d7d('0x14')]()==='in'||_0x547f7b[_0x1d7d('0x15')][_0x1d7d('0x14')]()===_0x1d7d('0x16')&&!_0x547f7b['secret']&&!_[_0x1d7d('0x17')](_0x547f7b['UserId'])){_0x8b258b['OpenchannelInteraction'][_0x1d7d('0x18')]({'where':{'id':_0x547f7b[_0x1d7d('0x19')]}})['then'](function(_0x55dba7){if(_0x55dba7){_0x55dba7[_0x1d7d('0x1a')]({'lastMsgAt':_0x547f7b[_0x1d7d('0x1b')],'lastMsgDirection':_0x547f7b[_0x1d7d('0x15')][_0x1d7d('0x14')]()});}})[_0x1d7d('0x1c')](function(_0x53423f){console[_0x1d7d('0x1d')](_0x53423f);});}if(_0x547f7b[_0x1d7d('0x15')]==='out'&&!_0x547f7b[_0x1d7d('0x1e')]){var _0x162c3a;_0x8b258b[_0x1d7d('0x1f')][_0x1d7d('0x20')]()[_0x1d7d('0x21')](function(_0x4db4f2){return _0x8b258b[_0x1d7d('0x22')][_0x1d7d('0x23')]({'where':{'id':_0x547f7b['OpenchannelAccountId']},'include':[{'model':_0x8b258b['OpenchannelInteraction'],'as':_0x1d7d('0x24'),'where':{'id':_0x547f7b[_0x1d7d('0x19')]},'limit':0x1,'include':[{'model':_0x8b258b[_0x1d7d('0x1f')],'as':_0x1d7d('0x25'),'attributes':_[_0x1d7d('0x26')](_0x4db4f2)}]}]});})[_0x1d7d('0x21')](function(_0x54d401){_0x162c3a=_0x54d401[_0x1d7d('0x13')]({'plain':!![]});if(_0x162c3a&&_0x162c3a[_0x1d7d('0x27')]){logger[_0x1d7d('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d7d('0x29'),util[_0x1d7d('0x2a')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x547f7b['id'],_0x162c3a['replyUri']));if(_0x162c3a[_0x1d7d('0x24')]&&_0x162c3a[_0x1d7d('0x24')][_0x1d7d('0x2b')]){_0x547f7b['Interaction']=_[_0x1d7d('0x2c')](_0x162c3a[_0x1d7d('0x24')][0x0],_0x1d7d('0x25'));_0x547f7b[_0x1d7d('0x25')]=_0x162c3a['Interactions'][0x0][_0x1d7d('0x25')];}var _0xa44223={'method':'POST','uri':encodeURI(_0x162c3a['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0xa44223[_0x1d7d('0x2d')]){case'GET':_0xa44223['qs']=_0x547f7b;break;case _0x1d7d('0x2e'):_0xa44223[_0x1d7d('0x10')]=_0x547f7b;break;}return rp(_0xa44223)[_0x1d7d('0x21')](function(_0x22c40d){logger[_0x1d7d('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x1d7d('0x29'),util[_0x1d7d('0x2a')](_0x1d7d('0x2f'),_0x547f7b['id'],_0x162c3a['replyUri']));if(_0x22c40d[_0x1d7d('0x10')][_0x1d7d('0x30')]&&_0x22c40d[_0x1d7d('0x10')]['threadId']!=_0x547f7b['Interaction']['threadId']){return _0x8b258b[_0x1d7d('0x31')][_0x1d7d('0x1a')]({'threadId':_0x22c40d['body'][_0x1d7d('0x30')]},{'logging':!![],'where':{'id':_0x547f7b[_0x1d7d('0x32')]['id']}});}else{return;}})[_0x1d7d('0x21')](function(){return _0x155bfb[_0x1d7d('0x1a')]({'read':!![]});})[_0x1d7d('0x1c')](function(_0x22fec9){logger[_0x1d7d('0x1d')](_0x1d7d('0x33'),_0x1d7d('0x29'),util[_0x1d7d('0x34')](_0x22fec9,{'showHidden':![],'depth':null}));_0x1ad06f();});}else{_0x1ad06f();}})['finally'](function(){_0x1ad06f();});}else{_0x1ad06f();}}},'charset':'utf8mb4','collate':_0x1d7d('0x35')});};
\ No newline at end of file
index 6ac3d48..e15d45e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x255b94,_0x352b45){var _0xc5806b=function(_0x530e79){while(--_0x530e79){_0x255b94['push'](_0x255b94['shift']());}};_0xc5806b(++_0x352b45);}(_0x1261,0x144));var _0x1126=function(_0x2ae2bc,_0x177514){_0x2ae2bc=_0x2ae2bc-0x0;var _0x53c290=_0x1261[_0x2ae2bc];return _0x53c290;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});};
\ No newline at end of file
+var _0x5f66=['stringify','error','code','message','info','result','OpenchannelMessage','create','body','options','raw','CreateOpenchannelMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x3f7405,_0x146e08){var _0x4c5cb0=function(_0x22f07b){while(--_0x22f07b){_0x3f7405['push'](_0x3f7405['shift']());}};_0x4c5cb0(++_0x146e08);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('OpenchannelMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateOpenchannelMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateOpenchannelMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});};
\ No newline at end of file
index 069b4b1..e4ae430 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5bb=['length','openchannelMessage:','./openchannelMessage.events','save','remove'];(function(_0x1107ac,_0x45de13){var _0xe10cd=function(_0x5844a8){while(--_0x5844a8){_0x1107ac['push'](_0x1107ac['shift']());}};_0xe10cd(++_0x45de13);}(_0xb5bb,0x1ba));var _0xbb5b=function(_0x200088,_0x2c66ab){_0x200088=_0x200088-0x0;var _0x387aa0=_0xb5bb[_0x200088];return _0x387aa0;};'use strict';var OpenchannelMessageEvents=require(_0xbb5b('0x0'));var events=[_0xbb5b('0x1'),_0xbb5b('0x2'),'update'];function createListener(_0x32e297,_0x21f8de){return function(_0x5cc451){_0x21f8de['emit'](_0x32e297,_0x5cc451);};}function removeListener(_0x51fd39,_0x5dfa85){return function(){OpenchannelMessageEvents['removeListener'](_0x51fd39,_0x5dfa85);};}exports['register']=function(_0x1c9622){for(var _0x161047=0x0,_0x5b03cd=events[_0xbb5b('0x3')];_0x161047<_0x5b03cd;_0x161047++){var _0x10d8fb=events[_0x161047];var _0x31eaa6=createListener(_0xbb5b('0x4')+_0x10d8fb,_0x1c9622);OpenchannelMessageEvents['on'](_0x10d8fb,_0x31eaa6);}};
\ No newline at end of file
+var _0x234f=['./openchannelMessage.events','save','remove','update','removeListener','register','openchannelMessage:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x234f,0xb6));var _0xf234=function(_0x568436,_0x20e511){_0x568436=_0x568436-0x0;var _0x418aed=_0x234f[_0x568436];return _0x418aed;};'use strict';var OpenchannelMessageEvents=require(_0xf234('0x0'));var events=[_0xf234('0x1'),_0xf234('0x2'),_0xf234('0x3')];function createListener(_0x3fa40d,_0x4aa60c){return function(_0x4ca67f){_0x4aa60c['emit'](_0x3fa40d,_0x4ca67f);};}function removeListener(_0x57b4f1,_0x2d3ec1){return function(){OpenchannelMessageEvents[_0xf234('0x4')](_0x57b4f1,_0x2d3ec1);};}exports[_0xf234('0x5')]=function(_0x3bfa94){for(var _0x334f1c=0x0,_0x508303=events['length'];_0x334f1c<_0x508303;_0x334f1c++){var _0x53fc91=events[_0x334f1c];var _0x2f08f3=createListener(_0xf234('0x6')+_0x53fc91,_0x3bfa94);OpenchannelMessageEvents['on'](_0x53fc91,_0x2f08f3);}};
\ No newline at end of file
index 95f4920..535d253 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe753=['show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','describe','/:id'];(function(_0x20c358,_0x2933d2){var _0x3972cd=function(_0x45f3db){while(--_0x45f3db){_0x20c358['push'](_0x20c358['shift']());}};_0x3972cd(++_0x2933d2);}(_0xe753,0x1df));var _0x3e75=function(_0xe8863f,_0x266db7){_0xe8863f=_0xe8863f-0x0;var _0x556de2=_0xe753[_0xe8863f];return _0x556de2;};'use strict';var multer=require(_0x3e75('0x0'));var util=require(_0x3e75('0x1'));var path=require(_0x3e75('0x2'));var timeout=require(_0x3e75('0x3'));var express=require(_0x3e75('0x4'));var router=express[_0x3e75('0x5')]();var fs_extra=require(_0x3e75('0x6'));var auth=require(_0x3e75('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3e75('0x8'));var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0x3e75('0x9')](),controller[_0x3e75('0xa')]);router[_0x3e75('0xb')]('/describe',auth[_0x3e75('0x9')](),controller[_0x3e75('0xc')]);router[_0x3e75('0xb')](_0x3e75('0xd'),auth['isAuthenticated'](),controller[_0x3e75('0xe')]);router[_0x3e75('0xb')](_0x3e75('0xf'),auth[_0x3e75('0x9')](),controller[_0x3e75('0x10')]);router[_0x3e75('0xb')](_0x3e75('0x11'),auth[_0x3e75('0x9')](),controller['getTeams']);router[_0x3e75('0xb')](_0x3e75('0x12'),auth[_0x3e75('0x9')](),controller[_0x3e75('0x13')]);router['post']('/',auth[_0x3e75('0x9')](),controller[_0x3e75('0x14')]);router[_0x3e75('0x15')]('/:id/teams',auth[_0x3e75('0x9')](),controller[_0x3e75('0x16')]);router[_0x3e75('0x15')](_0x3e75('0x12'),auth['isAuthenticated'](),controller[_0x3e75('0x17')]);router['put'](_0x3e75('0xd'),auth[_0x3e75('0x9')](),controller[_0x3e75('0x18')]);router[_0x3e75('0x19')]('/:id',auth[_0x3e75('0x9')](),controller[_0x3e75('0x1a')]);router[_0x3e75('0x19')](_0x3e75('0x11'),auth[_0x3e75('0x9')](),controller[_0x3e75('0x1b')]);router[_0x3e75('0x19')](_0x3e75('0x12'),auth['isAuthenticated'](),controller[_0x3e75('0x1c')]);module['exports']=router;
\ No newline at end of file
+var _0x795a=['get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','/:id/users','post','addTeams','put','/:id','delete','destroy','removeAgents','exports','util','path','express','fs-extra','../../components/auth/service','./openchannelQueue.controller'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x795a,0xa2));var _0xa795=function(_0x4ca11a,_0x45ed73){_0x4ca11a=_0x4ca11a-0x0;var _0xcd528c=_0x795a[_0x4ca11a];return _0xcd528c;};'use strict';var multer=require('multer');var util=require(_0xa795('0x0'));var path=require(_0xa795('0x1'));var timeout=require('connect-timeout');var express=require(_0xa795('0x2'));var router=express['Router']();var fs_extra=require(_0xa795('0x3'));var auth=require(_0xa795('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa795('0x5'));router[_0xa795('0x6')]('/',auth[_0xa795('0x7')](),controller[_0xa795('0x8')]);router['get'](_0xa795('0x9'),auth['isAuthenticated'](),controller[_0xa795('0xa')]);router['get']('/:id',auth[_0xa795('0x7')](),controller[_0xa795('0xb')]);router[_0xa795('0x6')](_0xa795('0xc'),auth[_0xa795('0x7')](),controller[_0xa795('0xd')]);router[_0xa795('0x6')](_0xa795('0xe'),auth['isAuthenticated'](),controller['getTeams']);router[_0xa795('0x6')](_0xa795('0xf'),auth[_0xa795('0x7')](),controller['getAgents']);router[_0xa795('0x10')]('/',auth[_0xa795('0x7')](),controller['create']);router[_0xa795('0x10')](_0xa795('0xe'),auth[_0xa795('0x7')](),controller[_0xa795('0x11')]);router[_0xa795('0x10')](_0xa795('0xf'),auth[_0xa795('0x7')](),controller['addAgents']);router[_0xa795('0x12')](_0xa795('0x13'),auth['isAuthenticated'](),controller['update']);router[_0xa795('0x14')]('/:id',auth[_0xa795('0x7')](),controller[_0xa795('0x15')]);router[_0xa795('0x14')](_0xa795('0xe'),auth[_0xa795('0x7')](),controller['removeTeams']);router[_0xa795('0x14')](_0xa795('0xf'),auth[_0xa795('0x7')](),controller[_0xa795('0x16')]);module[_0xa795('0x17')]=router;
\ No newline at end of file
index c4b1ec9..2ec6e6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0c2=['roundrobin','sequelize','exports','STRING','INTEGER','rrmemory','beepall'];(function(_0x41de94,_0x1a753d){var _0x113be1=function(_0x1b30c4){while(--_0x1b30c4){_0x41de94['push'](_0x41de94['shift']());}};_0x113be1(++_0x1a753d);}(_0xa0c2,0x12e));var _0x2a0c=function(_0x2e0df3,_0x46ef93){_0x2e0df3=_0x2e0df3-0x0;var _0xc10d93=_0xa0c2[_0x2e0df3];return _0xc10d93;};'use strict';var Sequelize=require(_0x2a0c('0x0'));module[_0x2a0c('0x1')]={'name':{'type':Sequelize[_0x2a0c('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2a0c('0x2')]},'timeout':{'type':Sequelize[_0x2a0c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2a0c('0x4'),_0x2a0c('0x5'),_0x2a0c('0x6'))}};
\ No newline at end of file
+var _0x85e1=['roundrobin','STRING','name','INTEGER','rrmemory'];(function(_0x57d8c7,_0x11acde){var _0x4d9bca=function(_0x4f494b){while(--_0x4f494b){_0x57d8c7['push'](_0x57d8c7['shift']());}};_0x4d9bca(++_0x11acde);}(_0x85e1,0x173));var _0x185e=function(_0xf781cd,_0x353cc2){_0xf781cd=_0xf781cd-0x0;var _0x4d2b92=_0x85e1[_0xf781cd];return _0x4d2b92;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x185e('0x0')],'unique':_0x185e('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x185e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x185e('0x3'),'beepall',_0x185e('0x4'))}};
\ No newline at end of file
index 54bf40e..5fdd6f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51ce=['include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserOpenchannelQueue','intersection','OpenchannelQueueId','User','findAndCountAll','updatedAt','createdAt','SIP','openchannelPause','findOne','Team','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','emit','userOpenchannelQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','OpenchannelQueue','includeAll'];(function(_0x35fa33,_0x5cee15){var _0x39de35=function(_0x3abff7){while(--_0x3abff7){_0x35fa33['push'](_0x35fa33['shift']());}};_0x39de35(++_0x5cee15);}(_0x51ce,0xce));var _0xe51c=function(_0x4599b6,_0x40c254){_0x4599b6=_0x4599b6-0x0;var _0x2e014c=_0x51ce[_0x4599b6];return _0x2e014c;};'use strict';var emlformat=require(_0xe51c('0x0'));var rimraf=require(_0xe51c('0x1'));var zipdir=require(_0xe51c('0x2'));var jsonpatch=require(_0xe51c('0x3'));var rp=require('request-promise');var moment=require(_0xe51c('0x4'));var BPromise=require(_0xe51c('0x5'));var Mustache=require(_0xe51c('0x6'));var util=require('util');var path=require(_0xe51c('0x7'));var sox=require('sox');var csv=require(_0xe51c('0x8'));var ejs=require(_0xe51c('0x9'));var fs=require('fs');var fs_extra=require(_0xe51c('0xa'));var _=require(_0xe51c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe51c('0xc'));var toCsv=require(_0xe51c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe51c('0xd'));var authService=require(_0xe51c('0xe'));var qs=require(_0xe51c('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe51c('0x10'))(_0xe51c('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe51c('0x12'));var db=require('../../mysqldb')['db'];config[_0xe51c('0x13')]=_[_0xe51c('0x14')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe51c('0x15'))(new Redis(config[_0xe51c('0x13')]));require(_0xe51c('0x16'))[_0xe51c('0x17')](socket);function respondWithStatusCode(_0x5ac3a9,_0x549619){_0x549619=_0x549619||0xcc;return function(_0x5d22df){if(_0x5d22df){return _0x5ac3a9[_0xe51c('0x18')](_0x549619);}return _0x5ac3a9['status'](_0x549619)[_0xe51c('0x19')]();};}function respondWithResult(_0x249b3b,_0x29dc28){_0x29dc28=_0x29dc28||0xc8;return function(_0x2a1bae){if(_0x2a1bae){return _0x249b3b[_0xe51c('0x1a')](_0x29dc28)[_0xe51c('0x1b')](_0x2a1bae);}};}function respondWithFilteredResult(_0xdc81,_0x1a5f09){return function(_0x2a43e2){if(_0x2a43e2){var _0x458815=typeof _0x1a5f09[_0xe51c('0x1c')]==='undefined'&&typeof _0x1a5f09[_0xe51c('0x1d')]===_0xe51c('0x1e');var _0x4b9208=_0x2a43e2[_0xe51c('0x1f')];var _0x279bb0=_0x458815?0x0:_0x1a5f09[_0xe51c('0x1c')];var _0x4427be=_0x458815?_0x2a43e2[_0xe51c('0x1f')]:_0x1a5f09['offset']+_0x1a5f09[_0xe51c('0x1d')];var _0x3eb84e;if(_0x4427be>=_0x4b9208){_0x4427be=_0x4b9208;_0x3eb84e=0xc8;}else{_0x3eb84e=0xce;}_0xdc81['status'](_0x3eb84e);return _0xdc81[_0xe51c('0x20')]('Content-Range',_0x279bb0+'-'+_0x4427be+'/'+_0x4b9208)[_0xe51c('0x1b')](_0x2a43e2);}return null;};}function patchUpdates(_0x4f719d){return function(_0x467cf1){try{jsonpatch[_0xe51c('0x21')](_0x467cf1,_0x4f719d,!![]);}catch(_0x38a0b7){return BPromise[_0xe51c('0x22')](_0x38a0b7);}return _0x467cf1[_0xe51c('0x23')]();};}function saveUpdates(_0x42d28e,_0x3397ac){return function(_0x52d51c){if(_0x52d51c){return _0x52d51c[_0xe51c('0x24')](_0x42d28e)['then'](function(_0x29051a){return _0x29051a;});}return null;};}function removeEntity(_0x4337e7,_0x269bb0){return function(_0x112a13){if(_0x112a13){return _0x112a13['destroy']()[_0xe51c('0x25')](function(){var _0x225be7=_0x112a13[_0xe51c('0x26')]({'plain':!![]});var _0x354396=_0xe51c('0x27');return db[_0xe51c('0x28')][_0xe51c('0x29')]({'where':{'type':_0x354396,'resourceId':_0x225be7['id']}})[_0xe51c('0x25')](function(){return _0x112a13;});})[_0xe51c('0x25')](function(){_0x4337e7[_0xe51c('0x1a')](0xcc)[_0xe51c('0x19')]();});}};}function handleEntityNotFound(_0x115896,_0x50c2c2){return function(_0x457ee8){if(!_0x457ee8){_0x115896[_0xe51c('0x18')](0x194);}return _0x457ee8;};}function handleError(_0x2e04bc,_0x37a991){_0x37a991=_0x37a991||0x1f4;return function(_0x5ed847){logger[_0xe51c('0x2a')](_0x5ed847[_0xe51c('0x2b')]);if(_0x5ed847[_0xe51c('0x2c')]){delete _0x5ed847[_0xe51c('0x2c')];}_0x2e04bc['status'](_0x37a991)['send'](_0x5ed847);};}exports[_0xe51c('0x2d')]=function(_0x3f0bce,_0x8889ea){var _0x4ffc68={},_0x5a01c3={},_0x1ccf6a={'count':0x0,'rows':[]};var _0x3613b7=_[_0xe51c('0x2e')](db['OpenchannelQueue'][_0xe51c('0x2f')],function(_0x12c2e0){return{'name':_0x12c2e0[_0xe51c('0x30')],'type':_0x12c2e0[_0xe51c('0x31')][_0xe51c('0x32')]};});_0x5a01c3[_0xe51c('0x33')]=_['map'](_0x3613b7,_0xe51c('0x2c'));_0x5a01c3[_0xe51c('0x34')]=_[_0xe51c('0x35')](_0x3f0bce[_0xe51c('0x34')]);_0x5a01c3[_0xe51c('0x36')]=_['intersection'](_0x5a01c3[_0xe51c('0x33')],_0x5a01c3[_0xe51c('0x34')]);_0x4ffc68['attributes']=_['intersection'](_0x5a01c3[_0xe51c('0x33')],qs[_0xe51c('0x37')](_0x3f0bce[_0xe51c('0x34')]['fields']));_0x4ffc68[_0xe51c('0x38')]=_0x4ffc68['attributes'][_0xe51c('0x39')]?_0x4ffc68[_0xe51c('0x38')]:_0x5a01c3[_0xe51c('0x33')];if(!_0x3f0bce[_0xe51c('0x34')][_0xe51c('0x3a')](_0xe51c('0x3b'))){_0x4ffc68['limit']=qs[_0xe51c('0x1d')](_0x3f0bce[_0xe51c('0x34')][_0xe51c('0x1d')]);_0x4ffc68['offset']=qs['offset'](_0x3f0bce[_0xe51c('0x34')][_0xe51c('0x1c')]);}_0x4ffc68[_0xe51c('0x3c')]=qs[_0xe51c('0x3d')](_0x3f0bce[_0xe51c('0x34')][_0xe51c('0x3d')]);_0x4ffc68['where']=qs[_0xe51c('0x36')](_[_0xe51c('0x3e')](_0x3f0bce['query'],_0x5a01c3[_0xe51c('0x36')]),_0x3613b7);if(_0x3f0bce[_0xe51c('0x34')][_0xe51c('0x3f')]){_0x4ffc68[_0xe51c('0x40')]=_[_0xe51c('0x41')](_0x4ffc68[_0xe51c('0x40')],{'$or':_[_0xe51c('0x2e')](_0x3613b7,function(_0x23cda4){if(_0x23cda4[_0xe51c('0x31')]!==_0xe51c('0x42')){var _0x71d2bd={};_0x71d2bd[_0x23cda4[_0xe51c('0x2c')]]={'$like':'%'+_0x3f0bce['query'][_0xe51c('0x3f')]+'%'};return _0x71d2bd;}})});}_0x4ffc68=_['merge']({},_0x4ffc68,_0x3f0bce[_0xe51c('0x43')]);var _0x26d40a={'where':_0x4ffc68[_0xe51c('0x40')]};return db[_0xe51c('0x44')][_0xe51c('0x1f')](_0x26d40a)[_0xe51c('0x25')](function(_0x5d3a54){_0x1ccf6a[_0xe51c('0x1f')]=_0x5d3a54;if(_0x3f0bce[_0xe51c('0x34')][_0xe51c('0x45')]){_0x4ffc68[_0xe51c('0x46')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0xe51c('0x47')](_0x4ffc68);})[_0xe51c('0x25')](function(_0x1f1cd8){_0x1ccf6a[_0xe51c('0x48')]=_0x1f1cd8;return _0x1ccf6a;})[_0xe51c('0x25')](respondWithFilteredResult(_0x8889ea,_0x4ffc68))[_0xe51c('0x49')](handleError(_0x8889ea,null));};exports[_0xe51c('0x4a')]=function(_0x4854d8,_0x2d7a7a){var _0x4e236e={'raw':!![],'where':{'id':_0x4854d8[_0xe51c('0x4b')]['id']}},_0x1399b7={};_0x1399b7['model']=_['keys'](db[_0xe51c('0x44')][_0xe51c('0x2f')]);_0x1399b7[_0xe51c('0x34')]=_[_0xe51c('0x35')](_0x4854d8[_0xe51c('0x34')]);_0x1399b7[_0xe51c('0x36')]=_['intersection'](_0x1399b7[_0xe51c('0x33')],_0x1399b7[_0xe51c('0x34')]);_0x4e236e[_0xe51c('0x38')]=_['intersection'](_0x1399b7[_0xe51c('0x33')],qs[_0xe51c('0x37')](_0x4854d8[_0xe51c('0x34')][_0xe51c('0x37')]));_0x4e236e[_0xe51c('0x38')]=_0x4e236e[_0xe51c('0x38')][_0xe51c('0x39')]?_0x4e236e[_0xe51c('0x38')]:_0x1399b7[_0xe51c('0x33')];if(_0x4854d8[_0xe51c('0x34')][_0xe51c('0x45')]){_0x4e236e[_0xe51c('0x46')]=[{'all':!![]}];}_0x4e236e=_[_0xe51c('0x41')]({},_0x4e236e,_0x4854d8['options']);return db[_0xe51c('0x44')][_0xe51c('0x4c')](_0x4e236e)[_0xe51c('0x25')](handleEntityNotFound(_0x2d7a7a,null))[_0xe51c('0x25')](respondWithResult(_0x2d7a7a,null))[_0xe51c('0x49')](handleError(_0x2d7a7a,null));};exports['create']=function(_0x192a75,_0x1bfcc7){return db['OpenchannelQueue'][_0xe51c('0x4d')](_0x192a75[_0xe51c('0x4e')],{})['then'](function(_0x12fb83){var _0x3bcd68=_0x192a75[_0xe51c('0x4f')]['get']({'plain':!![]});if(!_0x3bcd68)throw new Error(_0xe51c('0x50'));if(_0x3bcd68[_0xe51c('0x51')]===_0xe51c('0x4f')){var _0x42213a=_0x12fb83['get']({'plain':!![]});var _0x5d256c=_0xe51c('0x27');return db[_0xe51c('0x52')][_0xe51c('0x4c')]({'where':{'name':_0x5d256c,'userProfileId':_0x3bcd68[_0xe51c('0x53')]},'raw':!![]})[_0xe51c('0x25')](function(_0x5c088b){if(_0x5c088b&&_0x5c088b[_0xe51c('0x54')]===0x0){return db[_0xe51c('0x28')][_0xe51c('0x4d')]({'name':_0x42213a['name'],'resourceId':_0x42213a['id'],'type':_0x5c088b[_0xe51c('0x2c')],'sectionId':_0x5c088b['id']},{})['then'](function(){return _0x12fb83;});}else{return _0x12fb83;}})[_0xe51c('0x49')](function(_0x5b7ed5){logger['error'](_0xe51c('0x55'),_0x5b7ed5);throw _0x5b7ed5;});}return _0x12fb83;})[_0xe51c('0x25')](respondWithResult(_0x1bfcc7,0xc9))[_0xe51c('0x49')](handleError(_0x1bfcc7,null));};exports[_0xe51c('0x24')]=function(_0x69538a,_0x1dedbe){if(_0x69538a['body']['id']){delete _0x69538a[_0xe51c('0x4e')]['id'];}return db['OpenchannelQueue'][_0xe51c('0x4c')]({'where':{'id':_0x69538a['params']['id']}})[_0xe51c('0x25')](handleEntityNotFound(_0x1dedbe,null))[_0xe51c('0x25')](saveUpdates(_0x69538a[_0xe51c('0x4e')],null))[_0xe51c('0x25')](respondWithResult(_0x1dedbe,null))[_0xe51c('0x49')](handleError(_0x1dedbe,null));};exports[_0xe51c('0x29')]=function(_0x48c468,_0x4459b0){return db[_0xe51c('0x44')][_0xe51c('0x4c')]({'where':{'id':_0x48c468[_0xe51c('0x4b')]['id']}})[_0xe51c('0x25')](handleEntityNotFound(_0x4459b0,null))[_0xe51c('0x25')](removeEntity(_0x4459b0,null))[_0xe51c('0x49')](handleError(_0x4459b0,null));};exports['describe']=function(_0x19b806,_0x4cd8e9){return db[_0xe51c('0x44')][_0xe51c('0x56')]()[_0xe51c('0x25')](respondWithResult(_0x4cd8e9,null))[_0xe51c('0x49')](handleError(_0x4cd8e9,null));};exports['getMembers']=function(_0x4c901d,_0x206d67,_0x1905b0){var _0x44b299={'raw':!![],'where':{}},_0x3cda38={},_0x4176ed;return db[_0xe51c('0x44')]['findOne']({'where':{'id':_0x4c901d[_0xe51c('0x4b')]['id']}})[_0xe51c('0x25')](handleEntityNotFound(_0x206d67,null))[_0xe51c('0x25')](function(_0x587f6e){if(_0x587f6e){_0x4176ed=_0x587f6e['get']({'plain':!![]});_0x3cda38['model']=_[_0xe51c('0x35')](db[_0xe51c('0x57')][_0xe51c('0x2f')]);_0x3cda38[_0xe51c('0x34')]=_[_0xe51c('0x35')](_0x4c901d[_0xe51c('0x34')]);_0x3cda38['filters']=_[_0xe51c('0x58')](_0x3cda38[_0xe51c('0x33')],_0x3cda38[_0xe51c('0x34')]);_0x44b299[_0xe51c('0x38')]=_[_0xe51c('0x58')](_0x3cda38[_0xe51c('0x33')],qs[_0xe51c('0x37')](_0x4c901d['query'][_0xe51c('0x37')]));_0x44b299[_0xe51c('0x38')]=_0x44b299[_0xe51c('0x38')][_0xe51c('0x39')]?_0x44b299[_0xe51c('0x38')]:_0x3cda38['model'];if(!_0x4c901d['query']['hasOwnProperty'](_0xe51c('0x3b'))){_0x44b299[_0xe51c('0x1d')]=qs[_0xe51c('0x1d')](_0x4c901d[_0xe51c('0x34')][_0xe51c('0x1d')]);_0x44b299[_0xe51c('0x1c')]=qs[_0xe51c('0x1c')](_0x4c901d['query'][_0xe51c('0x1c')]);}_0x44b299['order']=qs['sort'](_0x4c901d[_0xe51c('0x34')][_0xe51c('0x3d')]);_0x44b299[_0xe51c('0x40')]=qs[_0xe51c('0x36')](_['pick'](_0x4c901d[_0xe51c('0x34')],_0x3cda38[_0xe51c('0x36')]));_0x44b299['where'][_0xe51c('0x59')]=_0x587f6e['id'];if(_0x4c901d[_0xe51c('0x34')]['filter']){_0x44b299['where']=_['merge'](_0x44b299[_0xe51c('0x40')],{'$or':_[_0xe51c('0x2e')](_0x44b299['attributes'],function(_0x1d8b0d){var _0x42cf81={};_0x42cf81[_0x1d8b0d]={'$like':'%'+_0x4c901d[_0xe51c('0x34')][_0xe51c('0x3f')]+'%'};return _0x42cf81;})});}_0x44b299=_[_0xe51c('0x41')]({},_0x44b299,_0x4c901d['options']);return db[_0xe51c('0x57')][_0xe51c('0x47')](_0x44b299);}})[_0xe51c('0x25')](function(_0x2aeffc){if(_0x2aeffc){return db[_0xe51c('0x5a')][_0xe51c('0x5b')]({'where':{'id':_['map'](_0x2aeffc,'UserId'),'role':'agent'},'attributes':['id',_0xe51c('0x2c'),'openchannelPause',_0xe51c('0x5c'),_0xe51c('0x5d')]});}})[_0xe51c('0x25')](function(_0x2c9b10){if(_0x2c9b10){return{'count':_0x2c9b10['count'],'rows':_[_0xe51c('0x2e')](_0x2c9b10[_0xe51c('0x48')],function(_0x2d44d9){return{'membername':_0x2d44d9[_0xe51c('0x2c')],'UserId':_0x2d44d9['id'],'queue_name':_0x4176ed[_0xe51c('0x2c')],'OpenchannelQueueId':_0x4176ed['id'],'interface':util['format']('%s/%s',_0xe51c('0x5e'),_0x2d44d9[_0xe51c('0x2c')]),'penalty':0x0,'paused':_0x2d44d9[_0xe51c('0x5f')],'createdAt':_0x2d44d9['createdAt'],'updatedAt':_0x2d44d9[_0xe51c('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x206d67,_0x44b299))[_0xe51c('0x49')](handleError(_0x206d67,null));};exports['getTeams']=function(_0x35ba47,_0x2dcadc,_0x251b6a){var _0x369624={};var _0x2e5a0a={};var _0x5b54d4;var _0x4c12dc;return db[_0xe51c('0x44')][_0xe51c('0x60')]({'where':{'id':_0x35ba47[_0xe51c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2dcadc,null))[_0xe51c('0x25')](function(_0x219132){if(_0x219132){_0x5b54d4=_0x219132;_0x2e5a0a[_0xe51c('0x33')]=_[_0xe51c('0x35')](db[_0xe51c('0x61')][_0xe51c('0x2f')]);_0x2e5a0a[_0xe51c('0x34')]=_['keys'](_0x35ba47[_0xe51c('0x34')]);_0x2e5a0a['filters']=_['intersection'](_0x2e5a0a[_0xe51c('0x33')],_0x2e5a0a[_0xe51c('0x34')]);_0x369624[_0xe51c('0x38')]=_[_0xe51c('0x58')](_0x2e5a0a[_0xe51c('0x33')],qs[_0xe51c('0x37')](_0x35ba47[_0xe51c('0x34')][_0xe51c('0x37')]));_0x369624[_0xe51c('0x38')]=_0x369624['attributes'][_0xe51c('0x39')]?_0x369624[_0xe51c('0x38')]:_0x2e5a0a[_0xe51c('0x33')];_0x369624[_0xe51c('0x3c')]=qs[_0xe51c('0x3d')](_0x35ba47[_0xe51c('0x34')][_0xe51c('0x3d')]);_0x369624['where']=qs[_0xe51c('0x36')](_[_0xe51c('0x3e')](_0x35ba47['query'],_0x2e5a0a[_0xe51c('0x36')]));if(_0x35ba47[_0xe51c('0x34')][_0xe51c('0x3f')]){_0x369624[_0xe51c('0x40')]=_[_0xe51c('0x41')](_0x369624[_0xe51c('0x40')],{'$or':_[_0xe51c('0x2e')](_0x369624[_0xe51c('0x38')],function(_0x3972f5){var _0x3dd860={};_0x3dd860[_0x3972f5]={'$like':'%'+_0x35ba47[_0xe51c('0x34')][_0xe51c('0x3f')]+'%'};return _0x3dd860;})});}_0x369624=_[_0xe51c('0x41')]({},_0x369624,_0x35ba47['options']);return _0x5b54d4['getTeams'](_0x369624);}})['then'](function(_0x863351){if(_0x863351){_0x4c12dc=_0x863351['length'];if(!_0x35ba47[_0xe51c('0x34')][_0xe51c('0x3a')](_0xe51c('0x3b'))){_0x369624[_0xe51c('0x1d')]=qs['limit'](_0x35ba47[_0xe51c('0x34')][_0xe51c('0x1d')]);_0x369624[_0xe51c('0x1c')]=qs[_0xe51c('0x1c')](_0x35ba47['query'][_0xe51c('0x1c')]);}return _0x5b54d4['getTeams'](_0x369624);}})[_0xe51c('0x25')](function(_0x25b771){if(_0x25b771){return _0x25b771?{'count':_0x4c12dc,'rows':_0x25b771}:null;}})[_0xe51c('0x25')](respondWithResult(_0x2dcadc,null))['catch'](handleError(_0x2dcadc,null));};exports['addTeams']=function(_0x5af453,_0x35067f,_0x57f469){var _0x1905d2=_0x5af453['body'][_0xe51c('0x62')];return db[_0xe51c('0x61')]['findAll']({'where':{'id':_0x1905d2},'attributes':['id'],'include':[{'model':db[_0xe51c('0x5a')],'as':_0xe51c('0x63'),'attributes':['id',_0xe51c('0x2c'),_0xe51c('0x64'),_0xe51c('0x65'),_0xe51c('0x66')],'raw':!![]}]})[_0xe51c('0x25')](function(_0x3126a6){if(_0x3126a6){var _0x498088=_[_0xe51c('0x67')](_0x3126a6,function(_0x2c107e){var _0x42360c=_0x2c107e['get']({'plain':!![]});return _0x42360c['Agents'];});return db[_0xe51c('0x44')][_0xe51c('0x4c')]({'where':{'id':_0x5af453[_0xe51c('0x4b')]['id']}})['then'](function(_0x53390){return db[_0xe51c('0x68')][_0xe51c('0x69')](function(_0xacf373){return _0x53390[_0xe51c('0x6a')](_0x1905d2,{'transaction':_0xacf373})[_0xe51c('0x25')](function(){return BPromise['each'](_0x498088,function(_0x368ae3){return db[_0xe51c('0x57')][_0xe51c('0x6b')]({'where':{'UserId':_0x368ae3['id'],'OpenchannelQueueId':_0x5af453[_0xe51c('0x4b')]['id']},'transaction':_0xacf373});});})[_0xe51c('0x25')](function(){_0x498088[_0xe51c('0x6c')](function(_0x535c05){socket['emit'](_0xe51c('0x6d'),{'UserId':_0x535c05['id'],'OpenchannelQueueId':_0x53390['id']});});});});});}})['then'](respondWithStatusCode(_0x35067f,null))['catch'](handleError(_0x35067f,null));};exports['removeTeams']=function(_0x3baa42,_0x1e78ec,_0x502a54){return db[_0xe51c('0x61')]['findAll']({'where':{'id':_0x3baa42[_0xe51c('0x34')][_0xe51c('0x62')]},'attributes':['id'],'include':[{'model':db[_0xe51c('0x5a')],'as':_0xe51c('0x63'),'attributes':['id'],'raw':!![]}]})[_0xe51c('0x25')](handleEntityNotFound(_0x1e78ec,null))['then'](function(_0x52e600){var _0x6fb7e4=_[_0xe51c('0x2e')](_0x52e600,'id');var _0x3045b3=[];var _0x286644=[];var _0x24d115=squel[_0xe51c('0x6e')]();_0x24d115[_0xe51c('0x6f')](_0xe51c('0x70'))[_0xe51c('0x71')](_0xe51c('0x72'),'tq')[_0xe51c('0x73')]('user_has_teams','ut',_0xe51c('0x74'))[_0xe51c('0x40')](_0xe51c('0x75'),_0x3baa42[_0xe51c('0x4b')]['id']);for(var _0x449d8f=0x0;_0x449d8f<_0x52e600[_0xe51c('0x39')];_0x449d8f+=0x1){let _0x3fe6a0=_0x52e600[_0x449d8f];for(var _0x237a49=0x0;_0x237a49<_0x3fe6a0[_0xe51c('0x63')][_0xe51c('0x39')];_0x237a49+=0x1){let _0x489070=_0x3fe6a0[_0xe51c('0x63')][_0x237a49];var _0x5cc295=_0x24d115[_0xe51c('0x76')]();_0x5cc295[_0xe51c('0x40')](_0xe51c('0x77'),_0x489070['id']);_0x286644['push'](db[_0xe51c('0x68')][_0xe51c('0x34')](_0x5cc295[_0xe51c('0x78')](),{'type':db[_0xe51c('0x68')]['QueryTypes'][_0xe51c('0x79')]})[_0xe51c('0x25')](function(_0x434c2c){if(_0x434c2c[_0xe51c('0x39')]===0x1){return _0x489070['id'];}else{var _0x2bc68a=_[_0xe51c('0x7a')](_[_0xe51c('0x2e')](_0x434c2c,_0xe51c('0x7b')),function(_0x4d1547){return _[_0xe51c('0x7c')](_0x6fb7e4,_0x4d1547);});if(_0x2bc68a){return _0x489070['id'];}}}));}}return BPromise[_0xe51c('0x7d')](_0x286644)[_0xe51c('0x25')](function(_0x16c8b6){_0x3045b3=_(_0x3045b3)[_0xe51c('0x7e')](_0x16c8b6)[_0xe51c('0x7f')]()[_0xe51c('0x80')]();return db[_0xe51c('0x44')][_0xe51c('0x4c')]({'where':{'id':_0x3baa42[_0xe51c('0x4b')]['id']}})[_0xe51c('0x25')](function(_0x520e6f){return db['sequelize']['transaction'](function(_0x2a43eb){return _0x520e6f[_0xe51c('0x81')](_0x3baa42[_0xe51c('0x34')][_0xe51c('0x62')],{'transaction':_0x2a43eb})[_0xe51c('0x25')](function(){if(!_[_0xe51c('0x82')](_0x3045b3)){return _0x520e6f['removeAgents'](_0x3045b3,{'transaction':_0x2a43eb});}})[_0xe51c('0x25')](function(){_0x3045b3[_0xe51c('0x6c')](function(_0x5acc50){socket[_0xe51c('0x83')](_0xe51c('0x84'),{'UserId':_0x5acc50,'OpenchannelQueueId':_0x520e6f['id']});});});});});});})['then'](respondWithStatusCode(_0x1e78ec,null))[_0xe51c('0x49')](handleError(_0x1e78ec,null));};exports[_0xe51c('0x85')]=function(_0x3462d6,_0x529367,_0xbf92d0){return db[_0xe51c('0x44')][_0xe51c('0x4c')]({'where':{'id':_0x3462d6['params']['id']}})[_0xe51c('0x25')](handleEntityNotFound(_0x529367,null))[_0xe51c('0x25')](function(_0x10ecf9){if(_0x10ecf9){return _0x10ecf9[_0xe51c('0x85')](_0x3462d6[_0xe51c('0x4e')][_0xe51c('0x62')],_[_0xe51c('0x86')](_0x3462d6['body'],[_0xe51c('0x62'),'id'])||{})['spread'](function(_0x4ac019){for(var _0x557a35=0x0;_0x557a35<_0x3462d6[_0xe51c('0x4e')][_0xe51c('0x62')][_0xe51c('0x39')];_0x557a35+=0x1){socket['emit'](_0xe51c('0x6d'),{'UserId':Number(_0x3462d6[_0xe51c('0x4e')][_0xe51c('0x62')][_0x557a35]),'OpenchannelQueueId':Number(_0x3462d6[_0xe51c('0x4b')]['id'])});}return _0x4ac019;});}})[_0xe51c('0x25')](respondWithResult(_0x529367,null))[_0xe51c('0x49')](handleError(_0x529367,null));};exports['removeAgents']=function(_0x233d76,_0xe024dd,_0x553604){return db[_0xe51c('0x44')][_0xe51c('0x4c')]({'where':{'id':_0x233d76[_0xe51c('0x4b')]['id']}})[_0xe51c('0x25')](handleEntityNotFound(_0xe024dd,null))['then'](function(_0x24ef8d){if(_0x24ef8d){return _0x24ef8d[_0xe51c('0x87')](_0x233d76['query'][_0xe51c('0x62')])[_0xe51c('0x25')](function(){if(_[_0xe51c('0x88')](_0x233d76[_0xe51c('0x34')][_0xe51c('0x62')])){for(var _0x36cd4a=0x0;_0x36cd4a<_0x233d76['query'][_0xe51c('0x62')]['length'];_0x36cd4a+=0x1){socket[_0xe51c('0x83')]('userOpenchannelQueue:remove',{'UserId':Number(_0x233d76[_0xe51c('0x34')]['ids'][_0x36cd4a]),'OpenchannelQueueId':Number(_0x233d76[_0xe51c('0x4b')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x233d76[_0xe51c('0x34')]['ids']),'OpenchannelQueueId':Number(_0x233d76[_0xe51c('0x4b')]['id'])});}});}})[_0xe51c('0x25')](respondWithStatusCode(_0xe024dd,null))['catch'](handleError(_0xe024dd,null));};exports['getAgents']=function(_0xce0c0e,_0x153075,_0x2e2703){var _0x340d04={};var _0x5c84ba={};var _0x2a7f52;var _0x4792f3;return db[_0xe51c('0x44')][_0xe51c('0x60')]({'where':{'id':_0xce0c0e[_0xe51c('0x4b')]['id']}})[_0xe51c('0x25')](handleEntityNotFound(_0x153075,null))['then'](function(_0x3986af){if(_0x3986af){_0x2a7f52=_0x3986af;_0x5c84ba[_0xe51c('0x33')]=_[_0xe51c('0x35')](db[_0xe51c('0x5a')][_0xe51c('0x2f')]);_0x5c84ba['query']=_[_0xe51c('0x35')](_0xce0c0e[_0xe51c('0x34')]);_0x5c84ba[_0xe51c('0x36')]=_[_0xe51c('0x58')](_0x5c84ba[_0xe51c('0x33')],_0x5c84ba[_0xe51c('0x34')]);_0x340d04['attributes']=_[_0xe51c('0x58')](_0x5c84ba[_0xe51c('0x33')],qs['fields'](_0xce0c0e[_0xe51c('0x34')][_0xe51c('0x37')]));_0x340d04[_0xe51c('0x38')]=_0x340d04[_0xe51c('0x38')]['length']?_0x340d04['attributes']:_0x5c84ba[_0xe51c('0x33')];_0x340d04[_0xe51c('0x3c')]=qs[_0xe51c('0x3d')](_0xce0c0e[_0xe51c('0x34')][_0xe51c('0x3d')]);_0x340d04[_0xe51c('0x40')]=qs[_0xe51c('0x36')](_[_0xe51c('0x3e')](_0xce0c0e[_0xe51c('0x34')],_0x5c84ba[_0xe51c('0x36')]));if(_0xce0c0e['query'][_0xe51c('0x3f')]){_0x340d04[_0xe51c('0x40')]=_['merge'](_0x340d04[_0xe51c('0x40')],{'$or':_[_0xe51c('0x2e')](_0x340d04[_0xe51c('0x38')],function(_0x1eca1c){var _0x548174={};_0x548174[_0x1eca1c]={'$like':'%'+_0xce0c0e[_0xe51c('0x34')][_0xe51c('0x3f')]+'%'};return _0x548174;})});}_0x340d04=_[_0xe51c('0x41')]({},_0x340d04,_0xce0c0e['options']);return _0x2a7f52[_0xe51c('0x89')](_0x340d04);}})[_0xe51c('0x25')](function(_0x5312e1){if(_0x5312e1){_0x4792f3=_0x5312e1['length'];if(!_0xce0c0e[_0xe51c('0x34')][_0xe51c('0x3a')](_0xe51c('0x3b'))){_0x340d04[_0xe51c('0x1d')]=qs[_0xe51c('0x1d')](_0xce0c0e[_0xe51c('0x34')]['limit']);_0x340d04[_0xe51c('0x1c')]=qs['offset'](_0xce0c0e[_0xe51c('0x34')]['offset']);}return _0x2a7f52[_0xe51c('0x89')](_0x340d04);}})[_0xe51c('0x25')](function(_0x1d4d21){if(_0x1d4d21){return _0x1d4d21?{'count':_0x4792f3,'rows':_0x1d4d21}:null;}})[_0xe51c('0x25')](respondWithResult(_0x153075,null))[_0xe51c('0x49')](handleError(_0x153075,null));};
\ No newline at end of file
+var _0x9acc=['body','get','role','user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserOpenchannelQueue','length','hasOwnProperty','nolimit','OpenchannelQueueId','User','findAndCountAll','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','transaction','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','includes','all','value','removeTeams','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','order','sort','pick','filter','where','VIRTUAL','merge','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','keys','find','create'];(function(_0x392886,_0x56f1d5){var _0x2bc44e=function(_0x209ae){while(--_0x209ae){_0x392886['push'](_0x392886['shift']());}};_0x2bc44e(++_0x56f1d5);}(_0x9acc,0x157));var _0xc9ac=function(_0x193b86,_0x47c614){_0x193b86=_0x193b86-0x0;var _0x1a20f0=_0x9acc[_0x193b86];return _0x1a20f0;};'use strict';var emlformat=require(_0xc9ac('0x0'));var rimraf=require(_0xc9ac('0x1'));var zipdir=require(_0xc9ac('0x2'));var jsonpatch=require(_0xc9ac('0x3'));var rp=require('request-promise');var moment=require(_0xc9ac('0x4'));var BPromise=require(_0xc9ac('0x5'));var Mustache=require(_0xc9ac('0x6'));var util=require(_0xc9ac('0x7'));var path=require(_0xc9ac('0x8'));var sox=require(_0xc9ac('0x9'));var csv=require(_0xc9ac('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc9ac('0xb'));var _=require('lodash');var squel=require(_0xc9ac('0xc'));var crypto=require(_0xc9ac('0xd'));var jsforce=require(_0xc9ac('0xe'));var deskjs=require(_0xc9ac('0xf'));var toCsv=require(_0xc9ac('0xa'));var querystring=require(_0xc9ac('0x10'));var Papa=require('papaparse');var Redis=require(_0xc9ac('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc9ac('0x12'));var as=require(_0xc9ac('0x13'));var hardwareService=require(_0xc9ac('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc9ac('0x15'));var config=require(_0xc9ac('0x16'));var licenseUtil=require(_0xc9ac('0x17'));var db=require(_0xc9ac('0x18'))['db'];config[_0xc9ac('0x19')]=_[_0xc9ac('0x1a')](config[_0xc9ac('0x19')],{'host':_0xc9ac('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc9ac('0x1c'))['register'](socket);function respondWithStatusCode(_0x3b396d,_0x59d3f9){_0x59d3f9=_0x59d3f9||0xcc;return function(_0x24326f){if(_0x24326f){return _0x3b396d[_0xc9ac('0x1d')](_0x59d3f9);}return _0x3b396d['status'](_0x59d3f9)[_0xc9ac('0x1e')]();};}function respondWithResult(_0x573b6a,_0x2fa708){_0x2fa708=_0x2fa708||0xc8;return function(_0x3e0101){if(_0x3e0101){return _0x573b6a[_0xc9ac('0x1f')](_0x2fa708)[_0xc9ac('0x20')](_0x3e0101);}};}function respondWithFilteredResult(_0x2df29e,_0x50c054){return function(_0x1e0169){if(_0x1e0169){var _0x58ce17=typeof _0x50c054[_0xc9ac('0x21')]===_0xc9ac('0x22')&&typeof _0x50c054[_0xc9ac('0x23')]==='undefined';var _0x29056d=_0x1e0169[_0xc9ac('0x24')];var _0x24f42b=_0x58ce17?0x0:_0x50c054['offset'];var _0x45bedf=_0x58ce17?_0x1e0169[_0xc9ac('0x24')]:_0x50c054[_0xc9ac('0x21')]+_0x50c054[_0xc9ac('0x23')];var _0x4c12a2;if(_0x45bedf>=_0x29056d){_0x45bedf=_0x29056d;_0x4c12a2=0xc8;}else{_0x4c12a2=0xce;}_0x2df29e[_0xc9ac('0x1f')](_0x4c12a2);return _0x2df29e[_0xc9ac('0x25')]('Content-Range',_0x24f42b+'-'+_0x45bedf+'/'+_0x29056d)['json'](_0x1e0169);}return null;};}function patchUpdates(_0x142dd5){return function(_0x62d3eb){try{jsonpatch[_0xc9ac('0x26')](_0x62d3eb,_0x142dd5,!![]);}catch(_0x1cdcef){return BPromise[_0xc9ac('0x27')](_0x1cdcef);}return _0x62d3eb[_0xc9ac('0x28')]();};}function saveUpdates(_0x40f803,_0x18b595){return function(_0x213fbc){if(_0x213fbc){return _0x213fbc[_0xc9ac('0x29')](_0x40f803)[_0xc9ac('0x2a')](function(_0x5dbd41){return _0x5dbd41;});}return null;};}function removeEntity(_0x2f49b5,_0x233965){return function(_0x32857e){if(_0x32857e){return _0x32857e[_0xc9ac('0x2b')]()[_0xc9ac('0x2a')](function(){var _0x4bb7aa=_0x32857e['get']({'plain':!![]});var _0x2327dd=_0xc9ac('0x2c');return db[_0xc9ac('0x2d')][_0xc9ac('0x2b')]({'where':{'type':_0x2327dd,'resourceId':_0x4bb7aa['id']}})[_0xc9ac('0x2a')](function(){return _0x32857e;});})[_0xc9ac('0x2a')](function(){_0x2f49b5[_0xc9ac('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x94dea0,_0x310dee){return function(_0x279d3e){if(!_0x279d3e){_0x94dea0[_0xc9ac('0x1d')](0x194);}return _0x279d3e;};}function handleError(_0x4cf0bb,_0x319542){_0x319542=_0x319542||0x1f4;return function(_0x589589){logger[_0xc9ac('0x2e')](_0x589589[_0xc9ac('0x2f')]);if(_0x589589[_0xc9ac('0x30')]){delete _0x589589[_0xc9ac('0x30')];}_0x4cf0bb[_0xc9ac('0x1f')](_0x319542)[_0xc9ac('0x31')](_0x589589);};}exports[_0xc9ac('0x32')]=function(_0x2b04bf,_0x254140){var _0x5aea09={},_0x13f6cf={},_0x1c01fd={'count':0x0,'rows':[]};var _0xa1fea1=_[_0xc9ac('0x33')](db['OpenchannelQueue'][_0xc9ac('0x34')],function(_0x2790fa){return{'name':_0x2790fa[_0xc9ac('0x35')],'type':_0x2790fa[_0xc9ac('0x36')]['key']};});_0x13f6cf[_0xc9ac('0x37')]=_['map'](_0xa1fea1,_0xc9ac('0x30'));_0x13f6cf[_0xc9ac('0x38')]=_['keys'](_0x2b04bf[_0xc9ac('0x38')]);_0x13f6cf[_0xc9ac('0x39')]=_[_0xc9ac('0x3a')](_0x13f6cf[_0xc9ac('0x37')],_0x13f6cf[_0xc9ac('0x38')]);_0x5aea09[_0xc9ac('0x3b')]=_[_0xc9ac('0x3a')](_0x13f6cf[_0xc9ac('0x37')],qs[_0xc9ac('0x3c')](_0x2b04bf['query']['fields']));_0x5aea09[_0xc9ac('0x3b')]=_0x5aea09[_0xc9ac('0x3b')]['length']?_0x5aea09['attributes']:_0x13f6cf[_0xc9ac('0x37')];if(!_0x2b04bf['query']['hasOwnProperty']('nolimit')){_0x5aea09[_0xc9ac('0x23')]=qs['limit'](_0x2b04bf[_0xc9ac('0x38')][_0xc9ac('0x23')]);_0x5aea09[_0xc9ac('0x21')]=qs[_0xc9ac('0x21')](_0x2b04bf[_0xc9ac('0x38')]['offset']);}_0x5aea09[_0xc9ac('0x3d')]=qs[_0xc9ac('0x3e')](_0x2b04bf[_0xc9ac('0x38')][_0xc9ac('0x3e')]);_0x5aea09['where']=qs[_0xc9ac('0x39')](_[_0xc9ac('0x3f')](_0x2b04bf[_0xc9ac('0x38')],_0x13f6cf[_0xc9ac('0x39')]),_0xa1fea1);if(_0x2b04bf[_0xc9ac('0x38')][_0xc9ac('0x40')]){_0x5aea09[_0xc9ac('0x41')]=_['merge'](_0x5aea09[_0xc9ac('0x41')],{'$or':_[_0xc9ac('0x33')](_0xa1fea1,function(_0x364d96){if(_0x364d96[_0xc9ac('0x36')]!==_0xc9ac('0x42')){var _0x519c6a={};_0x519c6a[_0x364d96[_0xc9ac('0x30')]]={'$like':'%'+_0x2b04bf[_0xc9ac('0x38')][_0xc9ac('0x40')]+'%'};return _0x519c6a;}})});}_0x5aea09=_[_0xc9ac('0x43')]({},_0x5aea09,_0x2b04bf[_0xc9ac('0x44')]);var _0xabe6ca={'where':_0x5aea09[_0xc9ac('0x41')]};return db[_0xc9ac('0x45')][_0xc9ac('0x24')](_0xabe6ca)[_0xc9ac('0x2a')](function(_0x288b23){_0x1c01fd[_0xc9ac('0x24')]=_0x288b23;if(_0x2b04bf[_0xc9ac('0x38')][_0xc9ac('0x46')]){_0x5aea09[_0xc9ac('0x47')]=[{'all':!![]}];}return db[_0xc9ac('0x45')][_0xc9ac('0x48')](_0x5aea09);})[_0xc9ac('0x2a')](function(_0x3d4a71){_0x1c01fd[_0xc9ac('0x49')]=_0x3d4a71;return _0x1c01fd;})[_0xc9ac('0x2a')](respondWithFilteredResult(_0x254140,_0x5aea09))[_0xc9ac('0x4a')](handleError(_0x254140,null));};exports[_0xc9ac('0x4b')]=function(_0x1b7696,_0x6c0dcd){var _0x1c9136={'raw':!![],'where':{'id':_0x1b7696[_0xc9ac('0x4c')]['id']}},_0x1fae3d={};_0x1fae3d[_0xc9ac('0x37')]=_[_0xc9ac('0x4d')](db[_0xc9ac('0x45')][_0xc9ac('0x34')]);_0x1fae3d[_0xc9ac('0x38')]=_[_0xc9ac('0x4d')](_0x1b7696[_0xc9ac('0x38')]);_0x1fae3d['filters']=_[_0xc9ac('0x3a')](_0x1fae3d[_0xc9ac('0x37')],_0x1fae3d[_0xc9ac('0x38')]);_0x1c9136['attributes']=_[_0xc9ac('0x3a')](_0x1fae3d['model'],qs[_0xc9ac('0x3c')](_0x1b7696[_0xc9ac('0x38')][_0xc9ac('0x3c')]));_0x1c9136[_0xc9ac('0x3b')]=_0x1c9136[_0xc9ac('0x3b')]['length']?_0x1c9136[_0xc9ac('0x3b')]:_0x1fae3d[_0xc9ac('0x37')];if(_0x1b7696[_0xc9ac('0x38')][_0xc9ac('0x46')]){_0x1c9136['include']=[{'all':!![]}];}_0x1c9136=_['merge']({},_0x1c9136,_0x1b7696[_0xc9ac('0x44')]);return db[_0xc9ac('0x45')][_0xc9ac('0x4e')](_0x1c9136)['then'](handleEntityNotFound(_0x6c0dcd,null))['then'](respondWithResult(_0x6c0dcd,null))[_0xc9ac('0x4a')](handleError(_0x6c0dcd,null));};exports[_0xc9ac('0x4f')]=function(_0x3f590f,_0x398eac){return db[_0xc9ac('0x45')][_0xc9ac('0x4f')](_0x3f590f[_0xc9ac('0x50')],{})[_0xc9ac('0x2a')](function(_0x55c90a){var _0x184453=_0x3f590f['user'][_0xc9ac('0x51')]({'plain':!![]});if(!_0x184453)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x184453[_0xc9ac('0x52')]===_0xc9ac('0x53')){var _0x471194=_0x55c90a[_0xc9ac('0x51')]({'plain':!![]});var _0x1321e6=_0xc9ac('0x2c');return db[_0xc9ac('0x54')][_0xc9ac('0x4e')]({'where':{'name':_0x1321e6,'userProfileId':_0x184453[_0xc9ac('0x55')]},'raw':!![]})[_0xc9ac('0x2a')](function(_0x1dac85){if(_0x1dac85&&_0x1dac85[_0xc9ac('0x56')]===0x0){return db[_0xc9ac('0x2d')][_0xc9ac('0x4f')]({'name':_0x471194[_0xc9ac('0x30')],'resourceId':_0x471194['id'],'type':_0x1dac85[_0xc9ac('0x30')],'sectionId':_0x1dac85['id']},{})[_0xc9ac('0x2a')](function(){return _0x55c90a;});}else{return _0x55c90a;}})['catch'](function(_0xa5671f){logger[_0xc9ac('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa5671f);throw _0xa5671f;});}return _0x55c90a;})['then'](respondWithResult(_0x398eac,0xc9))[_0xc9ac('0x4a')](handleError(_0x398eac,null));};exports[_0xc9ac('0x29')]=function(_0x499daa,_0x2c932d){if(_0x499daa['body']['id']){delete _0x499daa[_0xc9ac('0x50')]['id'];}return db[_0xc9ac('0x45')]['find']({'where':{'id':_0x499daa[_0xc9ac('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c932d,null))['then'](saveUpdates(_0x499daa[_0xc9ac('0x50')],null))[_0xc9ac('0x2a')](respondWithResult(_0x2c932d,null))['catch'](handleError(_0x2c932d,null));};exports['destroy']=function(_0x261f21,_0x383bf7){return db['OpenchannelQueue'][_0xc9ac('0x4e')]({'where':{'id':_0x261f21[_0xc9ac('0x4c')]['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x383bf7,null))[_0xc9ac('0x2a')](removeEntity(_0x383bf7,null))[_0xc9ac('0x4a')](handleError(_0x383bf7,null));};exports['describe']=function(_0x3d52e2,_0x15adc5){return db['OpenchannelQueue'][_0xc9ac('0x57')]()[_0xc9ac('0x2a')](respondWithResult(_0x15adc5,null))[_0xc9ac('0x4a')](handleError(_0x15adc5,null));};exports[_0xc9ac('0x58')]=function(_0x2bfcca,_0x4fe09b,_0x1a34fb){var _0xd11fab={'raw':!![],'where':{}},_0x4e874a={},_0x1fdfd3;return db['OpenchannelQueue'][_0xc9ac('0x59')]({'where':{'id':_0x2bfcca['params']['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x4fe09b,null))[_0xc9ac('0x2a')](function(_0x5de8e1){if(_0x5de8e1){_0x1fdfd3=_0x5de8e1[_0xc9ac('0x51')]({'plain':!![]});_0x4e874a[_0xc9ac('0x37')]=_[_0xc9ac('0x4d')](db[_0xc9ac('0x5a')]['rawAttributes']);_0x4e874a[_0xc9ac('0x38')]=_[_0xc9ac('0x4d')](_0x2bfcca['query']);_0x4e874a[_0xc9ac('0x39')]=_[_0xc9ac('0x3a')](_0x4e874a[_0xc9ac('0x37')],_0x4e874a[_0xc9ac('0x38')]);_0xd11fab[_0xc9ac('0x3b')]=_['intersection'](_0x4e874a[_0xc9ac('0x37')],qs['fields'](_0x2bfcca[_0xc9ac('0x38')][_0xc9ac('0x3c')]));_0xd11fab[_0xc9ac('0x3b')]=_0xd11fab[_0xc9ac('0x3b')][_0xc9ac('0x5b')]?_0xd11fab['attributes']:_0x4e874a[_0xc9ac('0x37')];if(!_0x2bfcca['query'][_0xc9ac('0x5c')](_0xc9ac('0x5d'))){_0xd11fab[_0xc9ac('0x23')]=qs[_0xc9ac('0x23')](_0x2bfcca[_0xc9ac('0x38')][_0xc9ac('0x23')]);_0xd11fab[_0xc9ac('0x21')]=qs[_0xc9ac('0x21')](_0x2bfcca[_0xc9ac('0x38')][_0xc9ac('0x21')]);}_0xd11fab[_0xc9ac('0x3d')]=qs[_0xc9ac('0x3e')](_0x2bfcca['query']['sort']);_0xd11fab['where']=qs['filters'](_['pick'](_0x2bfcca[_0xc9ac('0x38')],_0x4e874a[_0xc9ac('0x39')]));_0xd11fab[_0xc9ac('0x41')][_0xc9ac('0x5e')]=_0x5de8e1['id'];if(_0x2bfcca[_0xc9ac('0x38')][_0xc9ac('0x40')]){_0xd11fab[_0xc9ac('0x41')]=_[_0xc9ac('0x43')](_0xd11fab[_0xc9ac('0x41')],{'$or':_[_0xc9ac('0x33')](_0xd11fab[_0xc9ac('0x3b')],function(_0x2cbfd0){var _0x26540a={};_0x26540a[_0x2cbfd0]={'$like':'%'+_0x2bfcca[_0xc9ac('0x38')][_0xc9ac('0x40')]+'%'};return _0x26540a;})});}_0xd11fab=_[_0xc9ac('0x43')]({},_0xd11fab,_0x2bfcca[_0xc9ac('0x44')]);return db['UserOpenchannelQueue']['findAll'](_0xd11fab);}})[_0xc9ac('0x2a')](function(_0x426585){if(_0x426585){return db[_0xc9ac('0x5f')][_0xc9ac('0x60')]({'where':{'id':_[_0xc9ac('0x33')](_0x426585,'UserId'),'role':_0xc9ac('0x61')},'attributes':['id',_0xc9ac('0x30'),_0xc9ac('0x62'),_0xc9ac('0x63'),_0xc9ac('0x64')]});}})[_0xc9ac('0x2a')](function(_0x5b0f34){if(_0x5b0f34){return{'count':_0x5b0f34[_0xc9ac('0x24')],'rows':_[_0xc9ac('0x33')](_0x5b0f34[_0xc9ac('0x49')],function(_0x12485e){return{'membername':_0x12485e[_0xc9ac('0x30')],'UserId':_0x12485e['id'],'queue_name':_0x1fdfd3['name'],'OpenchannelQueueId':_0x1fdfd3['id'],'interface':util[_0xc9ac('0x65')](_0xc9ac('0x66'),_0xc9ac('0x67'),_0x12485e[_0xc9ac('0x30')]),'penalty':0x0,'paused':_0x12485e[_0xc9ac('0x62')],'createdAt':_0x12485e[_0xc9ac('0x64')],'updatedAt':_0x12485e[_0xc9ac('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc9ac('0x2a')](respondWithFilteredResult(_0x4fe09b,_0xd11fab))[_0xc9ac('0x4a')](handleError(_0x4fe09b,null));};exports[_0xc9ac('0x68')]=function(_0x55c0bb,_0x20f063,_0x21c07a){var _0x223330={};var _0x1121dc={};var _0x5218ef;var _0x125e12;return db[_0xc9ac('0x45')]['findOne']({'where':{'id':_0x55c0bb['params']['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x20f063,null))['then'](function(_0x56610e){if(_0x56610e){_0x5218ef=_0x56610e;_0x1121dc[_0xc9ac('0x37')]=_[_0xc9ac('0x4d')](db[_0xc9ac('0x69')][_0xc9ac('0x34')]);_0x1121dc[_0xc9ac('0x38')]=_[_0xc9ac('0x4d')](_0x55c0bb['query']);_0x1121dc[_0xc9ac('0x39')]=_['intersection'](_0x1121dc[_0xc9ac('0x37')],_0x1121dc[_0xc9ac('0x38')]);_0x223330[_0xc9ac('0x3b')]=_[_0xc9ac('0x3a')](_0x1121dc[_0xc9ac('0x37')],qs['fields'](_0x55c0bb[_0xc9ac('0x38')][_0xc9ac('0x3c')]));_0x223330[_0xc9ac('0x3b')]=_0x223330[_0xc9ac('0x3b')][_0xc9ac('0x5b')]?_0x223330[_0xc9ac('0x3b')]:_0x1121dc['model'];_0x223330['order']=qs[_0xc9ac('0x3e')](_0x55c0bb[_0xc9ac('0x38')]['sort']);_0x223330['where']=qs[_0xc9ac('0x39')](_['pick'](_0x55c0bb[_0xc9ac('0x38')],_0x1121dc[_0xc9ac('0x39')]));if(_0x55c0bb[_0xc9ac('0x38')][_0xc9ac('0x40')]){_0x223330['where']=_[_0xc9ac('0x43')](_0x223330['where'],{'$or':_[_0xc9ac('0x33')](_0x223330['attributes'],function(_0x1a3e25){var _0x2d8603={};_0x2d8603[_0x1a3e25]={'$like':'%'+_0x55c0bb['query'][_0xc9ac('0x40')]+'%'};return _0x2d8603;})});}_0x223330=_[_0xc9ac('0x43')]({},_0x223330,_0x55c0bb[_0xc9ac('0x44')]);return _0x5218ef['getTeams'](_0x223330);}})[_0xc9ac('0x2a')](function(_0x14e3f7){if(_0x14e3f7){_0x125e12=_0x14e3f7[_0xc9ac('0x5b')];if(!_0x55c0bb[_0xc9ac('0x38')][_0xc9ac('0x5c')](_0xc9ac('0x5d'))){_0x223330[_0xc9ac('0x23')]=qs['limit'](_0x55c0bb['query'][_0xc9ac('0x23')]);_0x223330['offset']=qs[_0xc9ac('0x21')](_0x55c0bb[_0xc9ac('0x38')][_0xc9ac('0x21')]);}return _0x5218ef[_0xc9ac('0x68')](_0x223330);}})['then'](function(_0x477e50){if(_0x477e50){return _0x477e50?{'count':_0x125e12,'rows':_0x477e50}:null;}})[_0xc9ac('0x2a')](respondWithResult(_0x20f063,null))[_0xc9ac('0x4a')](handleError(_0x20f063,null));};exports[_0xc9ac('0x6a')]=function(_0x12a03d,_0x5d5d4e,_0x82ab5f){var _0x327bf2=_0x12a03d[_0xc9ac('0x50')][_0xc9ac('0x6b')];return db[_0xc9ac('0x69')][_0xc9ac('0x48')]({'where':{'id':_0x327bf2},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc9ac('0x6c'),'attributes':['id',_0xc9ac('0x30'),_0xc9ac('0x6d'),_0xc9ac('0x6e'),_0xc9ac('0x6f')],'raw':!![]}]})[_0xc9ac('0x2a')](function(_0x5de12a){if(_0x5de12a){var _0x4297dc=_['flatMap'](_0x5de12a,function(_0x1dabb5){var _0x5aac4c=_0x1dabb5['get']({'plain':!![]});return _0x5aac4c[_0xc9ac('0x6c')];});return db[_0xc9ac('0x45')][_0xc9ac('0x4e')]({'where':{'id':_0x12a03d[_0xc9ac('0x4c')]['id']}})[_0xc9ac('0x2a')](function(_0x136924){return db['sequelize'][_0xc9ac('0x70')](function(_0x1039ee){return _0x136924[_0xc9ac('0x6a')](_0x327bf2,{'transaction':_0x1039ee})[_0xc9ac('0x2a')](function(){return BPromise['each'](_0x4297dc,function(_0x32c3f3){return db[_0xc9ac('0x5a')]['findOrCreate']({'where':{'UserId':_0x32c3f3['id'],'OpenchannelQueueId':_0x12a03d[_0xc9ac('0x4c')]['id']},'transaction':_0x1039ee});});})[_0xc9ac('0x2a')](function(){_0x4297dc[_0xc9ac('0x71')](function(_0x59539e){socket[_0xc9ac('0x72')](_0xc9ac('0x73'),{'UserId':_0x59539e['id'],'OpenchannelQueueId':_0x136924['id']});});});});});}})[_0xc9ac('0x2a')](respondWithStatusCode(_0x5d5d4e,null))[_0xc9ac('0x4a')](handleError(_0x5d5d4e,null));};exports['removeTeams']=function(_0x3fdda8,_0x502614,_0x254fa5){return db[_0xc9ac('0x69')][_0xc9ac('0x48')]({'where':{'id':_0x3fdda8['query'][_0xc9ac('0x6b')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc9ac('0x6c'),'attributes':['id'],'raw':!![]}]})[_0xc9ac('0x2a')](handleEntityNotFound(_0x502614,null))[_0xc9ac('0x2a')](function(_0x4250ff){var _0x521b00=_[_0xc9ac('0x33')](_0x4250ff,'id');var _0x4442c7=[];var _0x5ad16c=[];var _0x5add6a=squel[_0xc9ac('0x74')]();_0x5add6a[_0xc9ac('0x75')](_0xc9ac('0x76'))['from'](_0xc9ac('0x77'),'tq')[_0xc9ac('0x78')]('user_has_teams','ut',_0xc9ac('0x79'))['where']('OpenchannelQueueId\x20=\x20?',_0x3fdda8[_0xc9ac('0x4c')]['id']);for(var _0x21a16a=0x0;_0x21a16a<_0x4250ff['length'];_0x21a16a+=0x1){let _0x33e5a6=_0x4250ff[_0x21a16a];for(var _0x1c4390=0x0;_0x1c4390<_0x33e5a6[_0xc9ac('0x6c')][_0xc9ac('0x5b')];_0x1c4390+=0x1){let _0x51ef75=_0x33e5a6[_0xc9ac('0x6c')][_0x1c4390];var _0x336925=_0x5add6a['clone']();_0x336925[_0xc9ac('0x41')](_0xc9ac('0x7a'),_0x51ef75['id']);_0x5ad16c[_0xc9ac('0x7b')](db[_0xc9ac('0x7c')][_0xc9ac('0x38')](_0x336925[_0xc9ac('0x7d')](),{'type':db[_0xc9ac('0x7c')][_0xc9ac('0x7e')][_0xc9ac('0x7f')]})[_0xc9ac('0x2a')](function(_0x5e2d0c){if(_0x5e2d0c[_0xc9ac('0x5b')]===0x1){return _0x51ef75['id'];}else{var _0x19122e=_[_0xc9ac('0x80')](_[_0xc9ac('0x33')](_0x5e2d0c,'TeamId'),function(_0x1f47ce){return _[_0xc9ac('0x81')](_0x521b00,_0x1f47ce);});if(_0x19122e){return _0x51ef75['id'];}}}));}}return BPromise[_0xc9ac('0x82')](_0x5ad16c)[_0xc9ac('0x2a')](function(_0x24c695){_0x4442c7=_(_0x4442c7)['union'](_0x24c695)['compact']()[_0xc9ac('0x83')]();return db[_0xc9ac('0x45')][_0xc9ac('0x4e')]({'where':{'id':_0x3fdda8[_0xc9ac('0x4c')]['id']}})[_0xc9ac('0x2a')](function(_0x479233){return db[_0xc9ac('0x7c')][_0xc9ac('0x70')](function(_0x272e94){return _0x479233[_0xc9ac('0x84')](_0x3fdda8['query'][_0xc9ac('0x6b')],{'transaction':_0x272e94})['then'](function(){if(!_[_0xc9ac('0x85')](_0x4442c7)){return _0x479233['removeAgents'](_0x4442c7,{'transaction':_0x272e94});}})[_0xc9ac('0x2a')](function(){_0x4442c7[_0xc9ac('0x71')](function(_0x58a1fb){socket[_0xc9ac('0x72')](_0xc9ac('0x86'),{'UserId':_0x58a1fb,'OpenchannelQueueId':_0x479233['id']});});});});});});})['then'](respondWithStatusCode(_0x502614,null))[_0xc9ac('0x4a')](handleError(_0x502614,null));};exports[_0xc9ac('0x87')]=function(_0x6daa2d,_0x2e73fb,_0x5b5f35){return db[_0xc9ac('0x45')][_0xc9ac('0x4e')]({'where':{'id':_0x6daa2d[_0xc9ac('0x4c')]['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x2e73fb,null))[_0xc9ac('0x2a')](function(_0x29d345){if(_0x29d345){return _0x29d345['addAgents'](_0x6daa2d[_0xc9ac('0x50')]['ids'],_[_0xc9ac('0x88')](_0x6daa2d[_0xc9ac('0x50')],[_0xc9ac('0x6b'),'id'])||{})[_0xc9ac('0x89')](function(_0x2d9e17){for(var _0x17c379=0x0;_0x17c379<_0x6daa2d['body'][_0xc9ac('0x6b')][_0xc9ac('0x5b')];_0x17c379+=0x1){socket['emit']('userOpenchannelQueue:save',{'UserId':Number(_0x6daa2d[_0xc9ac('0x50')][_0xc9ac('0x6b')][_0x17c379]),'OpenchannelQueueId':Number(_0x6daa2d[_0xc9ac('0x4c')]['id'])});}return _0x2d9e17;});}})[_0xc9ac('0x2a')](respondWithResult(_0x2e73fb,null))[_0xc9ac('0x4a')](handleError(_0x2e73fb,null));};exports['removeAgents']=function(_0x2ecc13,_0x300bb0,_0x36090c){return db[_0xc9ac('0x45')][_0xc9ac('0x4e')]({'where':{'id':_0x2ecc13[_0xc9ac('0x4c')]['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x300bb0,null))['then'](function(_0x41848e){if(_0x41848e){return _0x41848e[_0xc9ac('0x8a')](_0x2ecc13[_0xc9ac('0x38')][_0xc9ac('0x6b')])[_0xc9ac('0x2a')](function(){if(_[_0xc9ac('0x8b')](_0x2ecc13['query'][_0xc9ac('0x6b')])){for(var _0x44e413=0x0;_0x44e413<_0x2ecc13[_0xc9ac('0x38')][_0xc9ac('0x6b')]['length'];_0x44e413+=0x1){socket['emit'](_0xc9ac('0x86'),{'UserId':Number(_0x2ecc13[_0xc9ac('0x38')][_0xc9ac('0x6b')][_0x44e413]),'OpenchannelQueueId':Number(_0x2ecc13[_0xc9ac('0x4c')]['id'])});}}else{socket[_0xc9ac('0x72')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2ecc13['query']['ids']),'OpenchannelQueueId':Number(_0x2ecc13[_0xc9ac('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x300bb0,null))['catch'](handleError(_0x300bb0,null));};exports[_0xc9ac('0x8c')]=function(_0x16a166,_0x5daa3e,_0x232e5b){var _0x440e90={};var _0x5b8011={};var _0x152cd0;var _0x4b3a05;return db[_0xc9ac('0x45')][_0xc9ac('0x59')]({'where':{'id':_0x16a166['params']['id']}})[_0xc9ac('0x2a')](handleEntityNotFound(_0x5daa3e,null))[_0xc9ac('0x2a')](function(_0x4217ee){if(_0x4217ee){_0x152cd0=_0x4217ee;_0x5b8011[_0xc9ac('0x37')]=_['keys'](db[_0xc9ac('0x5f')][_0xc9ac('0x34')]);_0x5b8011[_0xc9ac('0x38')]=_[_0xc9ac('0x4d')](_0x16a166['query']);_0x5b8011[_0xc9ac('0x39')]=_[_0xc9ac('0x3a')](_0x5b8011[_0xc9ac('0x37')],_0x5b8011['query']);_0x440e90[_0xc9ac('0x3b')]=_[_0xc9ac('0x3a')](_0x5b8011[_0xc9ac('0x37')],qs[_0xc9ac('0x3c')](_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x3c')]));_0x440e90[_0xc9ac('0x3b')]=_0x440e90[_0xc9ac('0x3b')][_0xc9ac('0x5b')]?_0x440e90['attributes']:_0x5b8011['model'];_0x440e90['order']=qs[_0xc9ac('0x3e')](_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x3e')]);_0x440e90[_0xc9ac('0x41')]=qs[_0xc9ac('0x39')](_['pick'](_0x16a166['query'],_0x5b8011[_0xc9ac('0x39')]));if(_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x40')]){_0x440e90[_0xc9ac('0x41')]=_[_0xc9ac('0x43')](_0x440e90['where'],{'$or':_[_0xc9ac('0x33')](_0x440e90[_0xc9ac('0x3b')],function(_0x393e5b){var _0xec61e5={};_0xec61e5[_0x393e5b]={'$like':'%'+_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x40')]+'%'};return _0xec61e5;})});}_0x440e90=_[_0xc9ac('0x43')]({},_0x440e90,_0x16a166[_0xc9ac('0x44')]);return _0x152cd0[_0xc9ac('0x8c')](_0x440e90);}})[_0xc9ac('0x2a')](function(_0x4c3e1c){if(_0x4c3e1c){_0x4b3a05=_0x4c3e1c[_0xc9ac('0x5b')];if(!_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x5c')](_0xc9ac('0x5d'))){_0x440e90['limit']=qs[_0xc9ac('0x23')](_0x16a166['query']['limit']);_0x440e90[_0xc9ac('0x21')]=qs[_0xc9ac('0x21')](_0x16a166[_0xc9ac('0x38')][_0xc9ac('0x21')]);}return _0x152cd0[_0xc9ac('0x8c')](_0x440e90);}})[_0xc9ac('0x2a')](function(_0x233599){if(_0x233599){return _0x233599?{'count':_0x4b3a05,'rows':_0x233599}:null;}})[_0xc9ac('0x2a')](respondWithResult(_0x5daa3e,null))[_0xc9ac('0x4a')](handleError(_0x5daa3e,null));};
\ No newline at end of file
index 23c29e7..d965371 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa750=['emit','exports','events','../../mysqldb','OpenchannelQueue','save','update','remove'];(function(_0x24618a,_0x2cd0f4){var _0x2e3d64=function(_0x28c59c){while(--_0x28c59c){_0x24618a['push'](_0x24618a['shift']());}};_0x2e3d64(++_0x2cd0f4);}(_0xa750,0xaa));var _0x0a75=function(_0x15cdaa,_0x1ac074){_0x15cdaa=_0x15cdaa-0x0;var _0x48128c=_0xa750[_0x15cdaa];return _0x48128c;};'use strict';var EventEmitter=require(_0x0a75('0x0'));var OpenchannelQueue=require(_0x0a75('0x1'))['db'][_0x0a75('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0a75('0x3'),'afterUpdate':_0x0a75('0x4'),'afterDestroy':_0x0a75('0x5')};function emitEvent(_0x3cde3e){return function(_0x330a18,_0x2ab3b8,_0x3b02df){OpenchannelQueueEvents[_0x0a75('0x6')](_0x3cde3e+':'+_0x330a18['id'],_0x330a18);OpenchannelQueueEvents[_0x0a75('0x6')](_0x3cde3e,_0x330a18);_0x3b02df(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x0a75('0x7')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x7478=['setMaxListeners','save','update','remove','emit','../../mysqldb','OpenchannelQueue'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7478,0xf3));var _0x8747=function(_0x4c4ed0,_0x5bc06d){_0x4c4ed0=_0x4c4ed0-0x0;var _0x55d61e=_0x7478[_0x4c4ed0];return _0x55d61e;};'use strict';var EventEmitter=require('events');var OpenchannelQueue=require(_0x8747('0x0'))['db'][_0x8747('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x8747('0x2')](0x0);var events={'afterCreate':_0x8747('0x3'),'afterUpdate':_0x8747('0x4'),'afterDestroy':_0x8747('0x5')};function emitEvent(_0x46a3ee){return function(_0x354300,_0x5e6ae1,_0x5d92c2){OpenchannelQueueEvents[_0x8747('0x6')](_0x46a3ee+':'+_0x354300['id'],_0x354300);OpenchannelQueueEvents[_0x8747('0x6')](_0x46a3ee,_0x354300);_0x5d92c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents;
\ No newline at end of file
index 028d792..46ebc06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2635=['lodash','util','../../config/logger','moment','bluebird','rimraf','exports','OpenchannelQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2635,0xd8));var _0x5263=function(_0x2d95f7,_0x1fad09){_0x2d95f7=_0x2d95f7-0x0;var _0x3784c4=_0x2635[_0x2d95f7];return _0x3784c4;};'use strict';var _=require(_0x5263('0x0'));var util=require(_0x5263('0x1'));var logger=require(_0x5263('0x2'))('api');var moment=require(_0x5263('0x3'));var BPromise=require(_0x5263('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5263('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module[_0x5263('0x6')]=function(_0x47a5de,_0xd930d0){return _0x47a5de['define'](_0x5263('0x7'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x25d4=['moment','bluebird','path','rimraf','../../config/environment','exports','define','util','api'];(function(_0x2cbac9,_0x5ed58a){var _0x36fa22=function(_0x5a84da){while(--_0x5a84da){_0x2cbac9['push'](_0x2cbac9['shift']());}};_0x36fa22(++_0x5ed58a);}(_0x25d4,0x103));var _0x425d=function(_0x295ce7,_0x1545d3){_0x295ce7=_0x295ce7-0x0;var _0x359d04=_0x25d4[_0x295ce7];return _0x359d04;};'use strict';var _=require('lodash');var util=require(_0x425d('0x0'));var logger=require('../../config/logger')(_0x425d('0x1'));var moment=require(_0x425d('0x2'));var BPromise=require(_0x425d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x425d('0x4'));var rimraf=require(_0x425d('0x5'));var config=require(_0x425d('0x6'));var attributes=require('./openchannelQueue.attributes');module[_0x425d('0x7')]=function(_0x200112,_0x3cda77){return _0x200112[_0x425d('0x8')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 39cfc80..cd816bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4091=['attributes','info','stringify','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','OpenchannelQueue,\x20%s,\x20%s','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','include','map','model'];(function(_0x23f12d,_0x106986){var _0xf5d897=function(_0x48a3c3){while(--_0x48a3c3){_0x23f12d['push'](_0x23f12d['shift']());}};_0xf5d897(++_0x106986);}(_0x4091,0x107));var _0x1409=function(_0x20ee5a,_0x409903){_0x20ee5a=_0x20ee5a-0x0;var _0x4573bf=_0x4091[_0x20ee5a];return _0x4573bf;};'use strict';var _=require(_0x1409('0x0'));var util=require(_0x1409('0x1'));var moment=require(_0x1409('0x2'));var BPromise=require(_0x1409('0x3'));var rs=require(_0x1409('0x4'));var fs=require('fs');var Redis=require(_0x1409('0x5'));var db=require(_0x1409('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1409('0x7'))(_0x1409('0x8'));var config=require('../../config/environment');var jayson=require(_0x1409('0x9'));var client=jayson[_0x1409('0xa')][_0x1409('0xb')]({'port':0x232a});config[_0x1409('0xc')]=_[_0x1409('0xd')](config[_0x1409('0xc')],{'host':_0x1409('0xe'),'port':0x18eb});var socket=require(_0x1409('0xf'))(new Redis(config[_0x1409('0xc')]));require(_0x1409('0x10'))[_0x1409('0x11')](socket);function respondWithRpcPromise(_0x3b2f33,_0x8e5137,_0x2f3e2d){return new BPromise(function(_0x13b60e,_0x139f30){return client[_0x1409('0x12')](_0x3b2f33,_0x2f3e2d)[_0x1409('0x13')](function(_0x8a92aa){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x8e5137,_0x1409('0x14'));logger[_0x1409('0x15')](_0x1409('0x16'),_0x8e5137,_0x1409('0x14'),JSON['stringify'](_0x8a92aa));if(_0x8a92aa['error']){if(_0x8a92aa[_0x1409('0x17')][_0x1409('0x18')]===0x1f4){logger[_0x1409('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x8e5137,_0x8a92aa[_0x1409('0x17')][_0x1409('0x19')]);return _0x139f30(_0x8a92aa[_0x1409('0x17')][_0x1409('0x19')]);}logger[_0x1409('0x17')](_0x1409('0x1a'),_0x8e5137,_0x8a92aa[_0x1409('0x17')]['message']);return _0x13b60e(_0x8a92aa[_0x1409('0x17')][_0x1409('0x19')]);}else{logger['info'](_0x1409('0x1a'),_0x8e5137,_0x1409('0x14'));_0x13b60e(_0x8a92aa[_0x1409('0x1b')][_0x1409('0x19')]);}})[_0x1409('0x1c')](function(_0x36344c){logger[_0x1409('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x8e5137,_0x36344c);_0x139f30(_0x36344c);});});}exports[_0x1409('0x1d')]=function(_0x320432){var _0x2e86a4=this;return new Promise(function(_0xa40c3b,_0x352f1e){return db[_0x1409('0x1e')][_0x1409('0x1f')]({'raw':_0x320432[_0x1409('0x20')]?_0x320432['options'][_0x1409('0x21')]===undefined?!![]:![]:!![],'where':_0x320432['options']?_0x320432[_0x1409('0x20')][_0x1409('0x22')]||null:null,'attributes':_0x320432[_0x1409('0x20')]?_0x320432[_0x1409('0x20')]['attributes']||null:null,'limit':_0x320432[_0x1409('0x20')]?_0x320432[_0x1409('0x20')]['limit']||null:null,'include':_0x320432['options']?_0x320432[_0x1409('0x20')][_0x1409('0x23')]?_['map'](_0x320432[_0x1409('0x20')]['include'],function(_0x3a8e5e){return{'model':db[_0x3a8e5e['model']],'as':_0x3a8e5e['as'],'attributes':_0x3a8e5e['attributes'],'include':_0x3a8e5e[_0x1409('0x23')]?_[_0x1409('0x24')](_0x3a8e5e['include'],function(_0x229c18){return{'model':db[_0x229c18[_0x1409('0x25')]],'as':_0x229c18['as'],'attributes':_0x229c18[_0x1409('0x26')],'include':_0x229c18[_0x1409('0x23')]?_[_0x1409('0x24')](_0x229c18['include'],function(_0x2445b9){return{'model':db[_0x2445b9[_0x1409('0x25')]],'as':_0x2445b9['as'],'attributes':_0x2445b9['attributes']};}):[]};}):[]};}):[]:[]})[_0x1409('0x13')](function(_0x2bc6b3){logger[_0x1409('0x27')](_0x1409('0x1d'),_0x320432);logger[_0x1409('0x15')]('GetOpenchannelQueue',_0x320432,JSON[_0x1409('0x28')](_0x2bc6b3));_0xa40c3b(_0x2bc6b3);})['catch'](function(_0x2a7418){logger[_0x1409('0x17')]('GetOpenchannelQueue',_0x2a7418[_0x1409('0x19')],_0x320432);_0x352f1e(_0x2e86a4[_0x1409('0x17')](0x1f4,_0x2a7418[_0x1409('0x19')]));});});};exports[_0x1409('0x29')]=function(_0x4f51ac){var _0x41912d=this;return new Promise(function(_0x1e577d,_0x225239){return db['OpenchannelQueue'][_0x1409('0x2a')]({'raw':_0x4f51ac['options']?_0x4f51ac[_0x1409('0x20')][_0x1409('0x21')]===undefined?!![]:![]:!![],'where':_0x4f51ac['options']?_0x4f51ac['options'][_0x1409('0x22')]||null:null,'attributes':_0x4f51ac[_0x1409('0x20')]?_0x4f51ac[_0x1409('0x20')][_0x1409('0x26')]||null:null,'include':_0x4f51ac['options']?_0x4f51ac[_0x1409('0x20')]['include']?_['map'](_0x4f51ac[_0x1409('0x20')][_0x1409('0x23')],function(_0x42c9d8){return{'model':db[_0x42c9d8[_0x1409('0x25')]],'as':_0x42c9d8['as'],'attributes':_0x42c9d8[_0x1409('0x26')],'include':_0x42c9d8[_0x1409('0x23')]?_[_0x1409('0x24')](_0x42c9d8['include'],function(_0x332780){return{'model':db[_0x332780[_0x1409('0x25')]],'as':_0x332780['as'],'attributes':_0x332780[_0x1409('0x26')],'include':_0x332780[_0x1409('0x23')]?_[_0x1409('0x24')](_0x332780[_0x1409('0x23')],function(_0x5b468b){return{'model':db[_0x5b468b[_0x1409('0x25')]],'as':_0x5b468b['as'],'attributes':_0x5b468b['attributes']};}):[]};}):[]};}):[]:[]})[_0x1409('0x13')](function(_0x3b4ff6){logger[_0x1409('0x27')](_0x1409('0x29'),_0x4f51ac);logger[_0x1409('0x15')]('ShowOpenchannelQueue',_0x4f51ac,JSON[_0x1409('0x28')](_0x3b4ff6));_0x1e577d(_0x3b4ff6);})[_0x1409('0x1c')](function(_0x3ad3fa){logger[_0x1409('0x17')]('ShowOpenchannelQueue',_0x3ad3fa[_0x1409('0x19')],_0x4f51ac);_0x225239(_0x41912d['error'](0x1f4,_0x3ad3fa[_0x1409('0x19')]));});});};
\ No newline at end of file
+var _0x3cc4=['../../config/environment','jayson/promise','http','redis','localhost','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','OpenchannelQueue','findAll','options','where','attributes','limit','map','include','model','GetOpenchannelQueue','debug','catch','ShowOpenchannelQueue','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4fc3aa,_0x39ce2a){var _0x46e4fd=function(_0x3fffb9){while(--_0x3fffb9){_0x4fc3aa['push'](_0x4fc3aa['shift']());}};_0x46e4fd(++_0x39ce2a);}(_0x3cc4,0xdc));var _0x43cc=function(_0x3f4291,_0x20cf4c){_0x3f4291=_0x3f4291-0x0;var _0x359641=_0x3cc4[_0x3f4291];return _0x359641;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x43cc('0x0'));var BPromise=require(_0x43cc('0x1'));var rs=require(_0x43cc('0x2'));var fs=require('fs');var Redis=require(_0x43cc('0x3'));var db=require(_0x43cc('0x4'))['db'];var utils=require(_0x43cc('0x5'));var logger=require(_0x43cc('0x6'))(_0x43cc('0x7'));var config=require(_0x43cc('0x8'));var jayson=require(_0x43cc('0x9'));var client=jayson['client'][_0x43cc('0xa')]({'port':0x232a});config[_0x43cc('0xb')]=_['defaults'](config['redis'],{'host':_0x43cc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x43cc('0xb')]));require(_0x43cc('0xd'))[_0x43cc('0xe')](socket);function respondWithRpcPromise(_0x205a12,_0x34d9f1,_0x5a79ba){return new BPromise(function(_0x5a9095,_0x402b4b){return client[_0x43cc('0xf')](_0x205a12,_0x5a79ba)[_0x43cc('0x10')](function(_0xbfe09){logger[_0x43cc('0x11')](_0x43cc('0x12'),_0x34d9f1,_0x43cc('0x13'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x34d9f1,'request\x20sent',JSON[_0x43cc('0x14')](_0xbfe09));if(_0xbfe09[_0x43cc('0x15')]){if(_0xbfe09[_0x43cc('0x15')][_0x43cc('0x16')]===0x1f4){logger[_0x43cc('0x15')](_0x43cc('0x12'),_0x34d9f1,_0xbfe09[_0x43cc('0x15')]['message']);return _0x402b4b(_0xbfe09[_0x43cc('0x15')][_0x43cc('0x17')]);}logger[_0x43cc('0x15')](_0x43cc('0x12'),_0x34d9f1,_0xbfe09['error']['message']);return _0x5a9095(_0xbfe09[_0x43cc('0x15')][_0x43cc('0x17')]);}else{logger[_0x43cc('0x11')](_0x43cc('0x12'),_0x34d9f1,_0x43cc('0x13'));_0x5a9095(_0xbfe09['result'][_0x43cc('0x17')]);}})['catch'](function(_0x15661c){logger[_0x43cc('0x15')](_0x43cc('0x12'),_0x34d9f1,_0x15661c);_0x402b4b(_0x15661c);});});}exports['GetOpenchannelQueue']=function(_0x22eee9){var _0x561456=this;return new Promise(function(_0x48a09c,_0x5aa25a){return db[_0x43cc('0x18')][_0x43cc('0x19')]({'raw':_0x22eee9[_0x43cc('0x1a')]?_0x22eee9[_0x43cc('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x22eee9[_0x43cc('0x1a')]?_0x22eee9[_0x43cc('0x1a')][_0x43cc('0x1b')]||null:null,'attributes':_0x22eee9[_0x43cc('0x1a')]?_0x22eee9[_0x43cc('0x1a')][_0x43cc('0x1c')]||null:null,'limit':_0x22eee9['options']?_0x22eee9[_0x43cc('0x1a')][_0x43cc('0x1d')]||null:null,'include':_0x22eee9[_0x43cc('0x1a')]?_0x22eee9[_0x43cc('0x1a')]['include']?_[_0x43cc('0x1e')](_0x22eee9[_0x43cc('0x1a')][_0x43cc('0x1f')],function(_0xf156ba){return{'model':db[_0xf156ba['model']],'as':_0xf156ba['as'],'attributes':_0xf156ba[_0x43cc('0x1c')],'include':_0xf156ba[_0x43cc('0x1f')]?_['map'](_0xf156ba[_0x43cc('0x1f')],function(_0x14613e){return{'model':db[_0x14613e[_0x43cc('0x20')]],'as':_0x14613e['as'],'attributes':_0x14613e[_0x43cc('0x1c')],'include':_0x14613e[_0x43cc('0x1f')]?_[_0x43cc('0x1e')](_0x14613e[_0x43cc('0x1f')],function(_0x3e771c){return{'model':db[_0x3e771c[_0x43cc('0x20')]],'as':_0x3e771c['as'],'attributes':_0x3e771c['attributes']};}):[]};}):[]};}):[]:[]})[_0x43cc('0x10')](function(_0x2c855a){logger[_0x43cc('0x11')](_0x43cc('0x21'),_0x22eee9);logger[_0x43cc('0x22')](_0x43cc('0x21'),_0x22eee9,JSON[_0x43cc('0x14')](_0x2c855a));_0x48a09c(_0x2c855a);})[_0x43cc('0x23')](function(_0x21a9b0){logger[_0x43cc('0x15')](_0x43cc('0x21'),_0x21a9b0['message'],_0x22eee9);_0x5aa25a(_0x561456['error'](0x1f4,_0x21a9b0[_0x43cc('0x17')]));});});};exports[_0x43cc('0x24')]=function(_0x3df303){var _0x1b4bf9=this;return new Promise(function(_0x9de7de,_0x41546d){return db[_0x43cc('0x18')][_0x43cc('0x25')]({'raw':_0x3df303[_0x43cc('0x1a')]?_0x3df303[_0x43cc('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3df303['options']?_0x3df303['options']['where']||null:null,'attributes':_0x3df303[_0x43cc('0x1a')]?_0x3df303[_0x43cc('0x1a')]['attributes']||null:null,'include':_0x3df303[_0x43cc('0x1a')]?_0x3df303['options'][_0x43cc('0x1f')]?_['map'](_0x3df303[_0x43cc('0x1a')][_0x43cc('0x1f')],function(_0x4fbb02){return{'model':db[_0x4fbb02[_0x43cc('0x20')]],'as':_0x4fbb02['as'],'attributes':_0x4fbb02[_0x43cc('0x1c')],'include':_0x4fbb02[_0x43cc('0x1f')]?_['map'](_0x4fbb02['include'],function(_0x4a2bc5){return{'model':db[_0x4a2bc5[_0x43cc('0x20')]],'as':_0x4a2bc5['as'],'attributes':_0x4a2bc5[_0x43cc('0x1c')],'include':_0x4a2bc5[_0x43cc('0x1f')]?_[_0x43cc('0x1e')](_0x4a2bc5[_0x43cc('0x1f')],function(_0x325bda){return{'model':db[_0x325bda[_0x43cc('0x20')]],'as':_0x325bda['as'],'attributes':_0x325bda['attributes']};}):[]};}):[]};}):[]:[]})[_0x43cc('0x10')](function(_0x1c1786){logger[_0x43cc('0x11')](_0x43cc('0x24'),_0x3df303);logger[_0x43cc('0x22')](_0x43cc('0x24'),_0x3df303,JSON[_0x43cc('0x14')](_0x1c1786));_0x9de7de(_0x1c1786);})[_0x43cc('0x23')](function(_0x10318b){logger[_0x43cc('0x15')]('ShowOpenchannelQueue',_0x10318b[_0x43cc('0x17')],_0x3df303);_0x41546d(_0x1b4bf9[_0x43cc('0x15')](0x1f4,_0x10318b[_0x43cc('0x17')]));});});};
\ No newline at end of file
index 1b3d183..b707b24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6792=['emit','removeListener','register','length','openchannelQueue:','save','remove','update'];(function(_0x338830,_0x11d13c){var _0x58885d=function(_0x2e0fe2){while(--_0x2e0fe2){_0x338830['push'](_0x338830['shift']());}};_0x58885d(++_0x11d13c);}(_0x6792,0xcd));var _0x2679=function(_0x3339a9,_0x23a3da){_0x3339a9=_0x3339a9-0x0;var _0x4ab9d5=_0x6792[_0x3339a9];return _0x4ab9d5;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x2679('0x0'),_0x2679('0x1'),_0x2679('0x2')];function createListener(_0x46ae2d,_0x5f1dfb){return function(_0x34e822){_0x5f1dfb[_0x2679('0x3')](_0x46ae2d,_0x34e822);};}function removeListener(_0x913d7c,_0x176ebd){return function(){OpenchannelQueueEvents[_0x2679('0x4')](_0x913d7c,_0x176ebd);};}exports[_0x2679('0x5')]=function(_0x6ffa28){for(var _0x22ac18=0x0,_0x5a354e=events[_0x2679('0x6')];_0x22ac18<_0x5a354e;_0x22ac18++){var _0x2a7fe8=events[_0x22ac18];var _0x275e7a=createListener(_0x2679('0x7')+_0x2a7fe8,_0x6ffa28);OpenchannelQueueEvents['on'](_0x2a7fe8,_0x275e7a);}};
\ No newline at end of file
+var _0x0d64=['openchannelQueue:','./openchannelQueue.events','save','remove','update','removeListener','register'];(function(_0x291f8b,_0x3b5591){var _0x275171=function(_0xb33d67){while(--_0xb33d67){_0x291f8b['push'](_0x291f8b['shift']());}};_0x275171(++_0x3b5591);}(_0x0d64,0xbe));var _0x40d6=function(_0x3774c7,_0x361f2b){_0x3774c7=_0x3774c7-0x0;var _0x1db61e=_0x0d64[_0x3774c7];return _0x1db61e;};'use strict';var OpenchannelQueueEvents=require(_0x40d6('0x0'));var events=[_0x40d6('0x1'),_0x40d6('0x2'),_0x40d6('0x3')];function createListener(_0x126bdc,_0x461695){return function(_0x2ad898){_0x461695['emit'](_0x126bdc,_0x2ad898);};}function removeListener(_0x5c2c9b,_0xbea058){return function(){OpenchannelQueueEvents[_0x40d6('0x4')](_0x5c2c9b,_0xbea058);};}exports[_0x40d6('0x5')]=function(_0x514b90){for(var _0x387b67=0x0,_0x235418=events['length'];_0x387b67<_0x235418;_0x387b67++){var _0x25de51=events[_0x387b67];var _0x3519ae=createListener(_0x40d6('0x6')+_0x25de51,_0x514b90);OpenchannelQueueEvents['on'](_0x25de51,_0x3519ae);}};
\ No newline at end of file
index e2eda92..55e2a5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7663=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','delete','destroy','multer','util','path'];(function(_0x5abd52,_0x2d2883){var _0x3e0f85=function(_0x241718){while(--_0x241718){_0x5abd52['push'](_0x5abd52['shift']());}};_0x3e0f85(++_0x2d2883);}(_0x7663,0x89));var _0x3766=function(_0x435d33,_0x24048b){_0x435d33=_0x435d33-0x0;var _0x1c85c0=_0x7663[_0x435d33];return _0x1c85c0;};'use strict';var multer=require(_0x3766('0x0'));var util=require(_0x3766('0x1'));var path=require(_0x3766('0x2'));var timeout=require(_0x3766('0x3'));var express=require(_0x3766('0x4'));var router=express[_0x3766('0x5')]();var fs_extra=require(_0x3766('0x6'));var auth=require(_0x3766('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3766('0x8'));var controller=require(_0x3766('0x9'));router[_0x3766('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3766('0xa')](_0x3766('0xb'),auth[_0x3766('0xc')](),controller[_0x3766('0xd')]);router[_0x3766('0xa')](_0x3766('0xe'),auth['isAuthenticated'](),controller[_0x3766('0xf')]);router[_0x3766('0x10')]('/',auth['isAuthenticated'](),controller[_0x3766('0x11')]);router['put']('/:id',auth[_0x3766('0xc')](),controller['update']);router[_0x3766('0x12')](_0x3766('0xe'),auth[_0x3766('0xc')](),controller[_0x3766('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xa626=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x32fb8d,_0x567a64){var _0x37cf13=function(_0x28bf81){while(--_0x28bf81){_0x32fb8d['push'](_0x32fb8d['shift']());}};_0x37cf13(++_0x567a64);}(_0xa626,0x90));var _0x6a62=function(_0x2d3b8c,_0x21aeb5){_0x2d3b8c=_0x2d3b8c-0x0;var _0x47e80c=_0xa626[_0x2d3b8c];return _0x47e80c;};'use strict';var multer=require(_0x6a62('0x0'));var util=require(_0x6a62('0x1'));var path=require(_0x6a62('0x2'));var timeout=require(_0x6a62('0x3'));var express=require(_0x6a62('0x4'));var router=express[_0x6a62('0x5')]();var fs_extra=require(_0x6a62('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6a62('0x7'));var config=require(_0x6a62('0x8'));var controller=require(_0x6a62('0x9'));router[_0x6a62('0xa')]('/',auth[_0x6a62('0xb')](),controller[_0x6a62('0xc')]);router['get'](_0x6a62('0xd'),auth['isAuthenticated'](),controller[_0x6a62('0xe')]);router[_0x6a62('0xa')](_0x6a62('0xf'),auth[_0x6a62('0xb')](),controller[_0x6a62('0x10')]);router[_0x6a62('0x11')]('/',auth['isAuthenticated'](),controller[_0x6a62('0x12')]);router[_0x6a62('0x13')](_0x6a62('0xf'),auth['isAuthenticated'](),controller[_0x6a62('0x14')]);router[_0x6a62('0x15')](_0x6a62('0xf'),auth[_0x6a62('0xb')](),controller['destroy']);module[_0x6a62('0x16')]=router;
\ No newline at end of file
index e05e159..3a1588b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fc0=['sequelize','exports','STRING','DATE','moment'];(function(_0x16848a,_0x2cb0b7){var _0x35b9f6=function(_0xa2553d){while(--_0xa2553d){_0x16848a['push'](_0x16848a['shift']());}};_0x35b9f6(++_0x2cb0b7);}(_0x0fc0,0x13a));var _0x00fc=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0fc0[_0x46e363];return _0x3fb059;};'use strict';var moment=require(_0x00fc('0x0'));var Sequelize=require(_0x00fc('0x1'));module[_0x00fc('0x2')]={'uniqueid':{'type':Sequelize[_0x00fc('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x00fc('0x3')]},'joinAt':{'type':Sequelize[_0x00fc('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x00fc('0x4')]},'exitAt':{'type':Sequelize[_0x00fc('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x54f1=['DATE','STRING'];(function(_0x2381d0,_0xbc9b99){var _0xdea626=function(_0x49bdf7){while(--_0x49bdf7){_0x2381d0['push'](_0x2381d0['shift']());}};_0xdea626(++_0xbc9b99);}(_0x54f1,0x159));var _0x154f=function(_0x15c5cc,_0x2b0ca5){_0x15c5cc=_0x15c5cc-0x0;var _0x4b0ce6=_0x54f1[_0x15c5cc];return _0x4b0ce6;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x154f('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x154f('0x0')]},'joinAt':{'type':Sequelize[_0x154f('0x1')]},'leaveAt':{'type':Sequelize[_0x154f('0x1')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x154f('0x1')]},'reason':{'type':Sequelize[_0x154f('0x0')]}};
\ No newline at end of file
index bd26b15..0caa343 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb333=['describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','update','destroy','then','sendStatus','stack','name','send','index','map','OpenchannelQueueReport','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body'];(function(_0x3077fb,_0x1a131f){var _0x35893c=function(_0x3a5a8f){while(--_0x3a5a8f){_0x3077fb['push'](_0x3077fb['shift']());}};_0x35893c(++_0x1a131f);}(_0xb333,0x95));var _0x3b33=function(_0xe6c7ba,_0x34d503){_0xe6c7ba=_0xe6c7ba-0x0;var _0x219820=_0xb333[_0xe6c7ba];return _0x219820;};'use strict';var emlformat=require(_0x3b33('0x0'));var rimraf=require(_0x3b33('0x1'));var zipdir=require(_0x3b33('0x2'));var jsonpatch=require(_0x3b33('0x3'));var rp=require('request-promise');var moment=require(_0x3b33('0x4'));var BPromise=require(_0x3b33('0x5'));var Mustache=require(_0x3b33('0x6'));var util=require('util');var path=require(_0x3b33('0x7'));var sox=require(_0x3b33('0x8'));var csv=require(_0x3b33('0x9'));var ejs=require(_0x3b33('0xa'));var fs=require('fs');var fs_extra=require(_0x3b33('0xb'));var _=require(_0x3b33('0xc'));var squel=require('squel');var crypto=require(_0x3b33('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3b33('0x9'));var querystring=require(_0x3b33('0xe'));var Papa=require('papaparse');var Redis=require(_0x3b33('0xf'));var authService=require(_0x3b33('0x10'));var qs=require(_0x3b33('0x11'));var as=require(_0x3b33('0x12'));var hardwareService=require(_0x3b33('0x13'));var logger=require(_0x3b33('0x14'))(_0x3b33('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3b33('0x16'));var db=require(_0x3b33('0x17'))['db'];function respondWithStatusCode(_0x59ca01,_0x52493d){_0x52493d=_0x52493d||0xcc;return function(_0x1ba3fa){if(_0x1ba3fa){return _0x59ca01['sendStatus'](_0x52493d);}return _0x59ca01[_0x3b33('0x18')](_0x52493d)[_0x3b33('0x19')]();};}function respondWithResult(_0x5f4940,_0x1fb793){_0x1fb793=_0x1fb793||0xc8;return function(_0x5f294f){if(_0x5f294f){return _0x5f4940['status'](_0x1fb793)['json'](_0x5f294f);}};}function respondWithFilteredResult(_0x41b07b,_0x2608d0){return function(_0x4e27dc){if(_0x4e27dc){var _0x3aab58=typeof _0x2608d0[_0x3b33('0x1a')]==='undefined'&&typeof _0x2608d0[_0x3b33('0x1b')]===_0x3b33('0x1c');var _0x29e18a=_0x4e27dc['count'];var _0x1e3f7b=_0x3aab58?0x0:_0x2608d0[_0x3b33('0x1a')];var _0x1a6759=_0x3aab58?_0x4e27dc[_0x3b33('0x1d')]:_0x2608d0['offset']+_0x2608d0[_0x3b33('0x1b')];var _0x3f0e26;if(_0x1a6759>=_0x29e18a){_0x1a6759=_0x29e18a;_0x3f0e26=0xc8;}else{_0x3f0e26=0xce;}_0x41b07b['status'](_0x3f0e26);return _0x41b07b[_0x3b33('0x1e')](_0x3b33('0x1f'),_0x1e3f7b+'-'+_0x1a6759+'/'+_0x29e18a)[_0x3b33('0x20')](_0x4e27dc);}return null;};}function patchUpdates(_0x42aafc){return function(_0x1006e6){try{jsonpatch['apply'](_0x1006e6,_0x42aafc,!![]);}catch(_0x755736){return BPromise['reject'](_0x755736);}return _0x1006e6['save']();};}function saveUpdates(_0x4c7e02,_0x5c1422){return function(_0x290cc1){if(_0x290cc1){return _0x290cc1[_0x3b33('0x21')](_0x4c7e02)['then'](function(_0x4c9f03){return _0x4c9f03;});}return null;};}function removeEntity(_0x48afe6,_0x18035e){return function(_0xd4c807){if(_0xd4c807){return _0xd4c807[_0x3b33('0x22')]()[_0x3b33('0x23')](function(){_0x48afe6[_0x3b33('0x18')](0xcc)[_0x3b33('0x19')]();});}};}function handleEntityNotFound(_0x360b2f,_0x4e0a43){return function(_0x131aa9){if(!_0x131aa9){_0x360b2f[_0x3b33('0x24')](0x194);}return _0x131aa9;};}function handleError(_0x2215d5,_0xe755d){_0xe755d=_0xe755d||0x1f4;return function(_0x1b80af){logger['error'](_0x1b80af[_0x3b33('0x25')]);if(_0x1b80af[_0x3b33('0x26')]){delete _0x1b80af['name'];}_0x2215d5[_0x3b33('0x18')](_0xe755d)[_0x3b33('0x27')](_0x1b80af);};}exports[_0x3b33('0x28')]=function(_0x505aec,_0x1bff73){var _0x14503f={},_0x3197ec={},_0x52100c={'count':0x0,'rows':[]};var _0x54c2e8=_[_0x3b33('0x29')](db[_0x3b33('0x2a')]['rawAttributes'],function(_0x23baa0){return{'name':_0x23baa0[_0x3b33('0x2b')],'type':_0x23baa0[_0x3b33('0x2c')][_0x3b33('0x2d')]};});_0x3197ec[_0x3b33('0x2e')]=_[_0x3b33('0x29')](_0x54c2e8,'name');_0x3197ec[_0x3b33('0x2f')]=_['keys'](_0x505aec['query']);_0x3197ec['filters']=_[_0x3b33('0x30')](_0x3197ec['model'],_0x3197ec[_0x3b33('0x2f')]);_0x14503f[_0x3b33('0x31')]=_[_0x3b33('0x30')](_0x3197ec[_0x3b33('0x2e')],qs[_0x3b33('0x32')](_0x505aec[_0x3b33('0x2f')][_0x3b33('0x32')]));_0x14503f['attributes']=_0x14503f[_0x3b33('0x31')][_0x3b33('0x33')]?_0x14503f[_0x3b33('0x31')]:_0x3197ec['model'];if(!_0x505aec['query'][_0x3b33('0x34')](_0x3b33('0x35'))){_0x14503f[_0x3b33('0x1b')]=qs[_0x3b33('0x1b')](_0x505aec[_0x3b33('0x2f')][_0x3b33('0x1b')]);_0x14503f['offset']=qs[_0x3b33('0x1a')](_0x505aec[_0x3b33('0x2f')][_0x3b33('0x1a')]);}_0x14503f[_0x3b33('0x36')]=qs[_0x3b33('0x37')](_0x505aec[_0x3b33('0x2f')][_0x3b33('0x37')]);_0x14503f[_0x3b33('0x38')]=qs[_0x3b33('0x39')](_['pick'](_0x505aec[_0x3b33('0x2f')],_0x3197ec[_0x3b33('0x39')]),_0x54c2e8);if(_0x505aec[_0x3b33('0x2f')][_0x3b33('0x3a')]){_0x14503f[_0x3b33('0x38')]=_[_0x3b33('0x3b')](_0x14503f[_0x3b33('0x38')],{'$or':_[_0x3b33('0x29')](_0x54c2e8,function(_0x5e4541){if(_0x5e4541[_0x3b33('0x2c')]!=='VIRTUAL'){var _0x2cf0af={};_0x2cf0af[_0x5e4541['name']]={'$like':'%'+_0x505aec[_0x3b33('0x2f')][_0x3b33('0x3a')]+'%'};return _0x2cf0af;}})});}_0x14503f=_[_0x3b33('0x3b')]({},_0x14503f,_0x505aec[_0x3b33('0x3c')]);var _0x172dbf={'where':_0x14503f[_0x3b33('0x38')]};return db[_0x3b33('0x2a')][_0x3b33('0x1d')](_0x172dbf)['then'](function(_0x5b62a){_0x52100c['count']=_0x5b62a;if(_0x505aec['query'][_0x3b33('0x3d')]){_0x14503f['include']=[{'all':!![]}];}return db[_0x3b33('0x2a')][_0x3b33('0x3e')](_0x14503f);})[_0x3b33('0x23')](function(_0x10b968){_0x52100c[_0x3b33('0x3f')]=_0x10b968;return _0x52100c;})[_0x3b33('0x23')](respondWithFilteredResult(_0x1bff73,_0x14503f))[_0x3b33('0x40')](handleError(_0x1bff73,null));};exports[_0x3b33('0x41')]=function(_0x303de5,_0xef3b70){var _0xfe6a3={'raw':!![],'where':{'id':_0x303de5[_0x3b33('0x42')]['id']}},_0x4be89b={};_0x4be89b[_0x3b33('0x2e')]=_[_0x3b33('0x43')](db[_0x3b33('0x2a')][_0x3b33('0x44')]);_0x4be89b[_0x3b33('0x2f')]=_[_0x3b33('0x43')](_0x303de5[_0x3b33('0x2f')]);_0x4be89b['filters']=_['intersection'](_0x4be89b['model'],_0x4be89b['query']);_0xfe6a3[_0x3b33('0x31')]=_[_0x3b33('0x30')](_0x4be89b[_0x3b33('0x2e')],qs[_0x3b33('0x32')](_0x303de5[_0x3b33('0x2f')][_0x3b33('0x32')]));_0xfe6a3['attributes']=_0xfe6a3[_0x3b33('0x31')][_0x3b33('0x33')]?_0xfe6a3['attributes']:_0x4be89b['model'];if(_0x303de5[_0x3b33('0x2f')]['includeAll']){_0xfe6a3[_0x3b33('0x45')]=[{'all':!![]}];}_0xfe6a3=_[_0x3b33('0x3b')]({},_0xfe6a3,_0x303de5[_0x3b33('0x3c')]);return db['OpenchannelQueueReport'][_0x3b33('0x46')](_0xfe6a3)[_0x3b33('0x23')](handleEntityNotFound(_0xef3b70,null))[_0x3b33('0x23')](respondWithResult(_0xef3b70,null))[_0x3b33('0x40')](handleError(_0xef3b70,null));};exports['create']=function(_0x2e38b1,_0x2567b0){return db['OpenchannelQueueReport'][_0x3b33('0x47')](_0x2e38b1[_0x3b33('0x48')],{})[_0x3b33('0x23')](respondWithResult(_0x2567b0,0xc9))[_0x3b33('0x40')](handleError(_0x2567b0,null));};exports[_0x3b33('0x21')]=function(_0x502133,_0x266010){if(_0x502133[_0x3b33('0x48')]['id']){delete _0x502133[_0x3b33('0x48')]['id'];}return db[_0x3b33('0x2a')]['find']({'where':{'id':_0x502133[_0x3b33('0x42')]['id']}})[_0x3b33('0x23')](handleEntityNotFound(_0x266010,null))[_0x3b33('0x23')](saveUpdates(_0x502133[_0x3b33('0x48')],null))[_0x3b33('0x23')](respondWithResult(_0x266010,null))[_0x3b33('0x40')](handleError(_0x266010,null));};exports[_0x3b33('0x22')]=function(_0x484621,_0x480e9e){return db[_0x3b33('0x2a')]['find']({'where':{'id':_0x484621[_0x3b33('0x42')]['id']}})['then'](handleEntityNotFound(_0x480e9e,null))[_0x3b33('0x23')](removeEntity(_0x480e9e,null))[_0x3b33('0x40')](handleError(_0x480e9e,null));};exports[_0x3b33('0x49')]=function(_0x4687eb,_0x2ecee0){return db[_0x3b33('0x2a')][_0x3b33('0x49')]()[_0x3b33('0x23')](respondWithResult(_0x2ecee0,null))['catch'](handleError(_0x2ecee0,null));};
\ No newline at end of file
+var _0x8bd6=['path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','count','limit','set','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','OpenchannelQueueReport','rawAttributes','fieldName','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x3af40d,_0x5f38f6){var _0x363acb=function(_0x2ed0f8){while(--_0x2ed0f8){_0x3af40d['push'](_0x3af40d['shift']());}};_0x363acb(++_0x5f38f6);}(_0x8bd6,0x18c));var _0x68bd=function(_0x30b6b1,_0x36d020){_0x30b6b1=_0x30b6b1-0x0;var _0x35f27d=_0x8bd6[_0x30b6b1];return _0x35f27d;};'use strict';var emlformat=require(_0x68bd('0x0'));var rimraf=require(_0x68bd('0x1'));var zipdir=require(_0x68bd('0x2'));var jsonpatch=require(_0x68bd('0x3'));var rp=require(_0x68bd('0x4'));var moment=require(_0x68bd('0x5'));var BPromise=require(_0x68bd('0x6'));var Mustache=require(_0x68bd('0x7'));var util=require(_0x68bd('0x8'));var path=require(_0x68bd('0x9'));var sox=require(_0x68bd('0xa'));var csv=require(_0x68bd('0xb'));var ejs=require(_0x68bd('0xc'));var fs=require('fs');var fs_extra=require(_0x68bd('0xd'));var _=require(_0x68bd('0xe'));var squel=require(_0x68bd('0xf'));var crypto=require('crypto');var jsforce=require(_0x68bd('0x10'));var deskjs=require(_0x68bd('0x11'));var toCsv=require(_0x68bd('0xb'));var querystring=require(_0x68bd('0x12'));var Papa=require(_0x68bd('0x13'));var Redis=require(_0x68bd('0x14'));var authService=require(_0x68bd('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x68bd('0x16'));var utils=require(_0x68bd('0x17'));var config=require(_0x68bd('0x18'));var licenseUtil=require(_0x68bd('0x19'));var db=require(_0x68bd('0x1a'))['db'];function respondWithStatusCode(_0xd79db7,_0x3bc19d){_0x3bc19d=_0x3bc19d||0xcc;return function(_0x4d0bc0){if(_0x4d0bc0){return _0xd79db7['sendStatus'](_0x3bc19d);}return _0xd79db7['status'](_0x3bc19d)[_0x68bd('0x1b')]();};}function respondWithResult(_0x46ead6,_0xf4f5fc){_0xf4f5fc=_0xf4f5fc||0xc8;return function(_0x558297){if(_0x558297){return _0x46ead6[_0x68bd('0x1c')](_0xf4f5fc)['json'](_0x558297);}};}function respondWithFilteredResult(_0x48b69e,_0x46d412){return function(_0x1ab51f){if(_0x1ab51f){var _0x1f793b=typeof _0x46d412[_0x68bd('0x1d')]===_0x68bd('0x1e')&&typeof _0x46d412['limit']===_0x68bd('0x1e');var _0xce460d=_0x1ab51f[_0x68bd('0x1f')];var _0x2ef4e1=_0x1f793b?0x0:_0x46d412[_0x68bd('0x1d')];var _0x389a26=_0x1f793b?_0x1ab51f['count']:_0x46d412[_0x68bd('0x1d')]+_0x46d412[_0x68bd('0x20')];var _0xde4306;if(_0x389a26>=_0xce460d){_0x389a26=_0xce460d;_0xde4306=0xc8;}else{_0xde4306=0xce;}_0x48b69e['status'](_0xde4306);return _0x48b69e[_0x68bd('0x21')]('Content-Range',_0x2ef4e1+'-'+_0x389a26+'/'+_0xce460d)[_0x68bd('0x22')](_0x1ab51f);}return null;};}function patchUpdates(_0x36817c){return function(_0x309c3e){try{jsonpatch[_0x68bd('0x23')](_0x309c3e,_0x36817c,!![]);}catch(_0x4b2e83){return BPromise[_0x68bd('0x24')](_0x4b2e83);}return _0x309c3e[_0x68bd('0x25')]();};}function saveUpdates(_0x4b69a4,_0x2652e5){return function(_0x1dc845){if(_0x1dc845){return _0x1dc845['update'](_0x4b69a4)[_0x68bd('0x26')](function(_0x42bde){return _0x42bde;});}return null;};}function removeEntity(_0x3c89c7,_0x435435){return function(_0x2115ef){if(_0x2115ef){return _0x2115ef[_0x68bd('0x27')]()[_0x68bd('0x26')](function(){_0x3c89c7[_0x68bd('0x1c')](0xcc)[_0x68bd('0x1b')]();});}};}function handleEntityNotFound(_0x5d1ed0,_0x2d6255){return function(_0x3a1b51){if(!_0x3a1b51){_0x5d1ed0[_0x68bd('0x28')](0x194);}return _0x3a1b51;};}function handleError(_0x229bbc,_0x2b1ec4){_0x2b1ec4=_0x2b1ec4||0x1f4;return function(_0x38846e){logger[_0x68bd('0x29')](_0x38846e[_0x68bd('0x2a')]);if(_0x38846e[_0x68bd('0x2b')]){delete _0x38846e[_0x68bd('0x2b')];}_0x229bbc[_0x68bd('0x1c')](_0x2b1ec4)[_0x68bd('0x2c')](_0x38846e);};}exports[_0x68bd('0x2d')]=function(_0x35225d,_0x2c5473){var _0x370285={},_0x2a8a77={},_0x44c7ef={'count':0x0,'rows':[]};var _0x23f7e6=_['map'](db[_0x68bd('0x2e')][_0x68bd('0x2f')],function(_0x2cd458){return{'name':_0x2cd458[_0x68bd('0x30')],'type':_0x2cd458['type']['key']};});_0x2a8a77['model']=_[_0x68bd('0x31')](_0x23f7e6,_0x68bd('0x2b'));_0x2a8a77[_0x68bd('0x32')]=_[_0x68bd('0x33')](_0x35225d[_0x68bd('0x32')]);_0x2a8a77[_0x68bd('0x34')]=_[_0x68bd('0x35')](_0x2a8a77[_0x68bd('0x36')],_0x2a8a77[_0x68bd('0x32')]);_0x370285[_0x68bd('0x37')]=_[_0x68bd('0x35')](_0x2a8a77[_0x68bd('0x36')],qs[_0x68bd('0x38')](_0x35225d['query'][_0x68bd('0x38')]));_0x370285[_0x68bd('0x37')]=_0x370285['attributes'][_0x68bd('0x39')]?_0x370285[_0x68bd('0x37')]:_0x2a8a77[_0x68bd('0x36')];if(!_0x35225d[_0x68bd('0x32')][_0x68bd('0x3a')](_0x68bd('0x3b'))){_0x370285['limit']=qs['limit'](_0x35225d[_0x68bd('0x32')][_0x68bd('0x20')]);_0x370285[_0x68bd('0x1d')]=qs[_0x68bd('0x1d')](_0x35225d[_0x68bd('0x32')][_0x68bd('0x1d')]);}_0x370285[_0x68bd('0x3c')]=qs[_0x68bd('0x3d')](_0x35225d['query'][_0x68bd('0x3d')]);_0x370285[_0x68bd('0x3e')]=qs['filters'](_[_0x68bd('0x3f')](_0x35225d['query'],_0x2a8a77[_0x68bd('0x34')]),_0x23f7e6);if(_0x35225d[_0x68bd('0x32')][_0x68bd('0x40')]){_0x370285['where']=_[_0x68bd('0x41')](_0x370285[_0x68bd('0x3e')],{'$or':_[_0x68bd('0x31')](_0x23f7e6,function(_0x5f65e7){if(_0x5f65e7[_0x68bd('0x42')]!==_0x68bd('0x43')){var _0x40f364={};_0x40f364[_0x5f65e7[_0x68bd('0x2b')]]={'$like':'%'+_0x35225d[_0x68bd('0x32')][_0x68bd('0x40')]+'%'};return _0x40f364;}})});}_0x370285=_[_0x68bd('0x41')]({},_0x370285,_0x35225d[_0x68bd('0x44')]);var _0x2b88fa={'where':_0x370285[_0x68bd('0x3e')]};return db[_0x68bd('0x2e')][_0x68bd('0x1f')](_0x2b88fa)[_0x68bd('0x26')](function(_0x74a60c){_0x44c7ef[_0x68bd('0x1f')]=_0x74a60c;if(_0x35225d[_0x68bd('0x32')][_0x68bd('0x45')]){_0x370285[_0x68bd('0x46')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0x68bd('0x47')](_0x370285);})[_0x68bd('0x26')](function(_0x39755a){_0x44c7ef[_0x68bd('0x48')]=_0x39755a;return _0x44c7ef;})['then'](respondWithFilteredResult(_0x2c5473,_0x370285))[_0x68bd('0x49')](handleError(_0x2c5473,null));};exports[_0x68bd('0x4a')]=function(_0x2a8e10,_0x39c612){var _0x52034f={'raw':!![],'where':{'id':_0x2a8e10[_0x68bd('0x4b')]['id']}},_0x54f874={};_0x54f874[_0x68bd('0x36')]=_[_0x68bd('0x33')](db['OpenchannelQueueReport'][_0x68bd('0x2f')]);_0x54f874[_0x68bd('0x32')]=_[_0x68bd('0x33')](_0x2a8e10[_0x68bd('0x32')]);_0x54f874[_0x68bd('0x34')]=_['intersection'](_0x54f874['model'],_0x54f874[_0x68bd('0x32')]);_0x52034f[_0x68bd('0x37')]=_[_0x68bd('0x35')](_0x54f874['model'],qs[_0x68bd('0x38')](_0x2a8e10[_0x68bd('0x32')][_0x68bd('0x38')]));_0x52034f[_0x68bd('0x37')]=_0x52034f['attributes'][_0x68bd('0x39')]?_0x52034f[_0x68bd('0x37')]:_0x54f874[_0x68bd('0x36')];if(_0x2a8e10[_0x68bd('0x32')]['includeAll']){_0x52034f[_0x68bd('0x46')]=[{'all':!![]}];}_0x52034f=_[_0x68bd('0x41')]({},_0x52034f,_0x2a8e10[_0x68bd('0x44')]);return db[_0x68bd('0x2e')][_0x68bd('0x4c')](_0x52034f)[_0x68bd('0x26')](handleEntityNotFound(_0x39c612,null))['then'](respondWithResult(_0x39c612,null))[_0x68bd('0x49')](handleError(_0x39c612,null));};exports[_0x68bd('0x4d')]=function(_0x434821,_0x609da8){return db['OpenchannelQueueReport'][_0x68bd('0x4d')](_0x434821[_0x68bd('0x4e')],{})['then'](respondWithResult(_0x609da8,0xc9))[_0x68bd('0x49')](handleError(_0x609da8,null));};exports[_0x68bd('0x4f')]=function(_0xe5e245,_0x39cc4a){if(_0xe5e245['body']['id']){delete _0xe5e245[_0x68bd('0x4e')]['id'];}return db[_0x68bd('0x2e')][_0x68bd('0x4c')]({'where':{'id':_0xe5e245[_0x68bd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39cc4a,null))[_0x68bd('0x26')](saveUpdates(_0xe5e245[_0x68bd('0x4e')],null))[_0x68bd('0x26')](respondWithResult(_0x39cc4a,null))[_0x68bd('0x49')](handleError(_0x39cc4a,null));};exports[_0x68bd('0x27')]=function(_0x45f2d5,_0x4a8203){return db[_0x68bd('0x2e')][_0x68bd('0x4c')]({'where':{'id':_0x45f2d5[_0x68bd('0x4b')]['id']}})[_0x68bd('0x26')](handleEntityNotFound(_0x4a8203,null))[_0x68bd('0x26')](removeEntity(_0x4a8203,null))[_0x68bd('0x49')](handleError(_0x4a8203,null));};exports[_0x68bd('0x50')]=function(_0x429701,_0x2b4786){return db[_0x68bd('0x2e')][_0x68bd('0x50')]()[_0x68bd('0x26')](respondWithResult(_0x2b4786,null))['catch'](handleError(_0x2b4786,null));};
\ No newline at end of file
index fe3ef3d..6055c27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x58fa29,_0x1135f2){var _0x59044e=function(_0x486470){while(--_0x486470){_0x58fa29['push'](_0x58fa29['shift']());}};_0x59044e(++_0x1135f2);}(_0x2ef3,0xba));var _0x32ef=function(_0x5da5f4,_0x43c382){_0x5da5f4=_0x5da5f4-0x0;var _0x16ff05=_0x2ef3[_0x5da5f4];return _0x16ff05;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x2b8349,_0x369931){var _0x406af3=function(_0x444b03){while(--_0x444b03){_0x2b8349['push'](_0x2b8349['shift']());}};_0x406af3(++_0x369931);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xc4aa[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 2048c31..9acac58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51c5=['attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','debug','request\x20sent','stringify','error','code','message','OpenchannelQueueReport,\x20%s,\x20%s','info','catch','CreateOpenchannelQueueReport','create','options','raw','then','OpenchannelQueueReport','update','body','where'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x51c5,0x8f));var _0x551c=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0x51c5[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rs=require(_0x551c('0x4'));var fs=require('fs');var Redis=require(_0x551c('0x5'));var db=require(_0x551c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x551c('0x7'))(_0x551c('0x8'));var config=require(_0x551c('0x9'));var jayson=require(_0x551c('0xa'));var client=jayson[_0x551c('0xb')][_0x551c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x21dfa1,_0x196955,_0x4f3a0a){return new BPromise(function(_0x414edb,_0x15f4f8){return client[_0x551c('0xd')](_0x21dfa1,_0x4f3a0a)['then'](function(_0x17683c){logger['info']('OpenchannelQueueReport,\x20%s,\x20%s',_0x196955,'request\x20sent');logger[_0x551c('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x196955,_0x551c('0xf'),JSON[_0x551c('0x10')](_0x17683c));if(_0x17683c[_0x551c('0x11')]){if(_0x17683c[_0x551c('0x11')][_0x551c('0x12')]===0x1f4){logger[_0x551c('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x196955,_0x17683c[_0x551c('0x11')][_0x551c('0x13')]);return _0x15f4f8(_0x17683c[_0x551c('0x11')]['message']);}logger[_0x551c('0x11')](_0x551c('0x14'),_0x196955,_0x17683c['error'][_0x551c('0x13')]);return _0x414edb(_0x17683c['error'][_0x551c('0x13')]);}else{logger[_0x551c('0x15')](_0x551c('0x14'),_0x196955,_0x551c('0xf'));_0x414edb(_0x17683c['result']['message']);}})[_0x551c('0x16')](function(_0xcdf011){logger['error'](_0x551c('0x14'),_0x196955,_0xcdf011);_0x15f4f8(_0xcdf011);});});}exports[_0x551c('0x17')]=function(_0x274432){var _0x2a0b55=this;return new Promise(function(_0x4c8dba,_0x4fcaf3){return db['OpenchannelQueueReport'][_0x551c('0x18')](_0x274432['body'],{'raw':_0x274432['options']?_0x274432[_0x551c('0x19')][_0x551c('0x1a')]===undefined?!![]:![]:!![]})[_0x551c('0x1b')](function(_0x1927e7){logger[_0x551c('0x15')](_0x551c('0x17'),_0x274432);logger['debug']('CreateOpenchannelQueueReport',_0x274432,JSON[_0x551c('0x10')](_0x1927e7));_0x4c8dba(_0x1927e7);})['catch'](function(_0x330160){logger[_0x551c('0x11')](_0x551c('0x17'),_0x330160[_0x551c('0x13')],_0x274432);_0x4fcaf3(_0x2a0b55[_0x551c('0x11')](0x1f4,_0x330160['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x194a1d){var _0x52cea5=this;return new Promise(function(_0x164343,_0x30f639){return db[_0x551c('0x1c')][_0x551c('0x1d')](_0x194a1d[_0x551c('0x1e')],{'raw':_0x194a1d[_0x551c('0x19')]?_0x194a1d[_0x551c('0x19')][_0x551c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x1f')]||null:null,'attributes':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x20')]||null:null,'limit':_0x194a1d['options']?_0x194a1d[_0x551c('0x19')][_0x551c('0x21')]||null:null})[_0x551c('0x1b')](function(_0x1600b5){logger[_0x551c('0x15')]('UpdateOpenchannelQueueReport',_0x194a1d);logger[_0x551c('0xe')](_0x551c('0x22'),_0x194a1d,JSON[_0x551c('0x10')](_0x1600b5));_0x164343(_0x1600b5);})['catch'](function(_0x3aa0c0){logger[_0x551c('0x11')]('UpdateOpenchannelQueueReport',_0x3aa0c0['message'],_0x194a1d);_0x30f639(_0x52cea5[_0x551c('0x11')](0x1f4,_0x3aa0c0[_0x551c('0x13')]));});});};
\ No newline at end of file
+var _0xbb59=['then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateOpenchannelQueueReport','body','options','catch','UpdateOpenchannelQueueReport','update','where','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0xbb59,0xec));var _0x9bb5=function(_0x20266d,_0x5ae2f1){_0x20266d=_0x20266d-0x0;var _0x3a35c7=_0xbb59[_0x20266d];return _0x3a35c7;};'use strict';var _=require(_0x9bb5('0x0'));var util=require(_0x9bb5('0x1'));var moment=require(_0x9bb5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9bb5('0x3'));var db=require(_0x9bb5('0x4'))['db'];var utils=require(_0x9bb5('0x5'));var logger=require(_0x9bb5('0x6'))(_0x9bb5('0x7'));var config=require('../../config/environment');var jayson=require(_0x9bb5('0x8'));var client=jayson[_0x9bb5('0x9')][_0x9bb5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2df722,_0xe362e0,_0x83fd10){return new BPromise(function(_0x2d6cce,_0x4e3857){return client[_0x9bb5('0xb')](_0x2df722,_0x83fd10)[_0x9bb5('0xc')](function(_0x2fdbcb){logger[_0x9bb5('0xd')](_0x9bb5('0xe'),_0xe362e0,'request\x20sent');logger[_0x9bb5('0xf')](_0x9bb5('0x10'),_0xe362e0,_0x9bb5('0x11'),JSON[_0x9bb5('0x12')](_0x2fdbcb));if(_0x2fdbcb[_0x9bb5('0x13')]){if(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x14')]===0x1f4){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);return _0x4e3857(_0x2fdbcb[_0x9bb5('0x13')][_0x9bb5('0x15')]);}logger[_0x9bb5('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe362e0,_0x2fdbcb['error'][_0x9bb5('0x15')]);return _0x2d6cce(_0x2fdbcb['error']['message']);}else{logger[_0x9bb5('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xe362e0,_0x9bb5('0x11'));_0x2d6cce(_0x2fdbcb[_0x9bb5('0x16')][_0x9bb5('0x15')]);}})['catch'](function(_0xb471e){logger[_0x9bb5('0x13')](_0x9bb5('0xe'),_0xe362e0,_0xb471e);_0x4e3857(_0xb471e);});});}exports[_0x9bb5('0x17')]=function(_0xba8392){var _0x19d1e9=this;return new Promise(function(_0x162815,_0xe44bdd){return db['OpenchannelQueueReport']['create'](_0xba8392[_0x9bb5('0x18')],{'raw':_0xba8392[_0x9bb5('0x19')]?_0xba8392['options']['raw']===undefined?!![]:![]:!![]})[_0x9bb5('0xc')](function(_0x182966){logger[_0x9bb5('0xd')]('CreateOpenchannelQueueReport',_0xba8392);logger[_0x9bb5('0xf')](_0x9bb5('0x17'),_0xba8392,JSON[_0x9bb5('0x12')](_0x182966));_0x162815(_0x182966);})[_0x9bb5('0x1a')](function(_0x51fa34){logger[_0x9bb5('0x13')](_0x9bb5('0x17'),_0x51fa34['message'],_0xba8392);_0xe44bdd(_0x19d1e9[_0x9bb5('0x13')](0x1f4,_0x51fa34['message']));});});};exports[_0x9bb5('0x1b')]=function(_0x5357e9){var _0x4be52b=this;return new Promise(function(_0x1d7195,_0x16db23){return db['OpenchannelQueueReport'][_0x9bb5('0x1c')](_0x5357e9[_0x9bb5('0x18')],{'raw':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9[_0x9bb5('0x19')][_0x9bb5('0x1d')]||null:null,'attributes':_0x5357e9['options']?_0x5357e9[_0x9bb5('0x19')][_0x9bb5('0x1e')]||null:null,'limit':_0x5357e9[_0x9bb5('0x19')]?_0x5357e9['options']['limit']||null:null})['then'](function(_0x1ad67b){logger[_0x9bb5('0xd')](_0x9bb5('0x1b'),_0x5357e9);logger[_0x9bb5('0xf')](_0x9bb5('0x1b'),_0x5357e9,JSON['stringify'](_0x1ad67b));_0x1d7195(_0x1ad67b);})['catch'](function(_0x59ef00){logger[_0x9bb5('0x13')](_0x9bb5('0x1b'),_0x59ef00[_0x9bb5('0x15')],_0x5357e9);_0x16db23(_0x4be52b['error'](0x1f4,_0x59ef00['message']));});});};
\ No newline at end of file
index 020673c..ff7eed2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc09=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','destroy','exports','multer','path','express','fs-extra','../../components/auth/service'];(function(_0x1b33b5,_0x2e815f){var _0x48429e=function(_0x3e9efb){while(--_0x3e9efb){_0x1b33b5['push'](_0x1b33b5['shift']());}};_0x48429e(++_0x2e815f);}(_0xdc09,0x93));var _0x9dc0=function(_0x513f27,_0x1cbc87){_0x513f27=_0x513f27-0x0;var _0xa316b7=_0xdc09[_0x513f27];return _0xa316b7;};'use strict';var multer=require(_0x9dc0('0x0'));var util=require('util');var path=require(_0x9dc0('0x1'));var timeout=require('connect-timeout');var express=require(_0x9dc0('0x2'));var router=express['Router']();var fs_extra=require(_0x9dc0('0x3'));var auth=require(_0x9dc0('0x4'));var interaction=require(_0x9dc0('0x5'));var config=require(_0x9dc0('0x6'));var controller=require('./openchannelTransferReport.controller');router[_0x9dc0('0x7')]('/',auth[_0x9dc0('0x8')](),controller[_0x9dc0('0x9')]);router['get'](_0x9dc0('0xa'),auth[_0x9dc0('0x8')](),controller[_0x9dc0('0xb')]);router[_0x9dc0('0x7')](_0x9dc0('0xc'),auth['isAuthenticated'](),controller[_0x9dc0('0xd')]);router[_0x9dc0('0xe')]('/',auth[_0x9dc0('0x8')](),controller[_0x9dc0('0xf')]);router['put'](_0x9dc0('0xc'),auth[_0x9dc0('0x8')](),controller[_0x9dc0('0x10')]);router['delete'](_0x9dc0('0xc'),auth[_0x9dc0('0x8')](),controller[_0x9dc0('0x11')]);module[_0x9dc0('0x12')]=router;
\ No newline at end of file
+var _0x539f=['put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x215393,_0x4c406d){var _0x595198=function(_0x5d641f){while(--_0x5d641f){_0x215393['push'](_0x215393['shift']());}};_0x595198(++_0x4c406d);}(_0x539f,0x1e8));var _0xf539=function(_0x57cfad,_0x584dab){_0x57cfad=_0x57cfad-0x0;var _0x5ad0cf=_0x539f[_0x57cfad];return _0x5ad0cf;};'use strict';var multer=require('multer');var util=require(_0xf539('0x0'));var path=require(_0xf539('0x1'));var timeout=require(_0xf539('0x2'));var express=require('express');var router=express[_0xf539('0x3')]();var fs_extra=require(_0xf539('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf539('0x5'));var config=require(_0xf539('0x6'));var controller=require(_0xf539('0x7'));router[_0xf539('0x8')]('/',auth[_0xf539('0x9')](),controller[_0xf539('0xa')]);router[_0xf539('0x8')](_0xf539('0xb'),auth[_0xf539('0x9')](),controller[_0xf539('0xc')]);router[_0xf539('0x8')](_0xf539('0xd'),auth[_0xf539('0x9')](),controller[_0xf539('0xe')]);router['post']('/',auth[_0xf539('0x9')](),controller[_0xf539('0xf')]);router[_0xf539('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf539('0x11')]);router[_0xf539('0x12')](_0xf539('0xd'),auth[_0xf539('0x9')](),controller[_0xf539('0x13')]);module[_0xf539('0x14')]=router;
\ No newline at end of file
index 80a43e6..2b05898 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x4347ec,_0x41c4b8){var _0x4c8314=function(_0x583acd){while(--_0x583acd){_0x4347ec['push'](_0x4347ec['shift']());}};_0x4c8314(++_0x41c4b8);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5b5882,_0x5457ac){_0x5b5882=_0x5b5882-0x0;var _0x481826=_0x9bde[_0x5b5882];return _0x481826;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x26b20c,_0x51238c){var _0x5b3fde=function(_0x37a5df){while(--_0x37a5df){_0x26b20c['push'](_0x26b20c['shift']());}};_0x5b3fde(++_0x51238c);}(_0xedd9,0xfc));var _0x9edd=function(_0x2bda6f,_0x2ac96c){_0x2bda6f=_0x2bda6f-0x0;var _0x139a57=_0xedd9[_0x2bda6f];return _0x139a57;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
index 87ecbd0..9236efc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f5f=['describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','rawAttributes','fieldName','type','key','map','keys','filters','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','OpenchannelTransferReport','includeAll','include','findAll','rows','show','merge','catch','create','body','update','params','find'];(function(_0x4e743f,_0x5aef49){var _0x1b7f56=function(_0x16434d){while(--_0x16434d){_0x4e743f['push'](_0x4e743f['shift']());}};_0x1b7f56(++_0x5aef49);}(_0x0f5f,0x135));var _0xf0f5=function(_0x5f4ae5,_0x4e70f1){_0x5f4ae5=_0x5f4ae5-0x0;var _0x98b3fc=_0x0f5f[_0x5f4ae5];return _0x98b3fc;};'use strict';var emlformat=require(_0xf0f5('0x0'));var rimraf=require(_0xf0f5('0x1'));var zipdir=require(_0xf0f5('0x2'));var jsonpatch=require(_0xf0f5('0x3'));var rp=require('request-promise');var moment=require(_0xf0f5('0x4'));var BPromise=require(_0xf0f5('0x5'));var Mustache=require(_0xf0f5('0x6'));var util=require(_0xf0f5('0x7'));var path=require('path');var sox=require(_0xf0f5('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0f5('0x9'));var _=require(_0xf0f5('0xa'));var squel=require(_0xf0f5('0xb'));var crypto=require(_0xf0f5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf0f5('0xd'));var toCsv=require(_0xf0f5('0xe'));var querystring=require(_0xf0f5('0xf'));var Papa=require(_0xf0f5('0x10'));var Redis=require(_0xf0f5('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf0f5('0x12'));var hardwareService=require(_0xf0f5('0x13'));var logger=require(_0xf0f5('0x14'))(_0xf0f5('0x15'));var utils=require(_0xf0f5('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf0f5('0x17'));var db=require(_0xf0f5('0x18'))['db'];function respondWithStatusCode(_0xd27f24,_0x372d17){_0x372d17=_0x372d17||0xcc;return function(_0x40acdb){if(_0x40acdb){return _0xd27f24[_0xf0f5('0x19')](_0x372d17);}return _0xd27f24['status'](_0x372d17)[_0xf0f5('0x1a')]();};}function respondWithResult(_0x1fc1a7,_0x28dd58){_0x28dd58=_0x28dd58||0xc8;return function(_0x3ef156){if(_0x3ef156){return _0x1fc1a7['status'](_0x28dd58)['json'](_0x3ef156);}};}function respondWithFilteredResult(_0x1463f8,_0x40df94){return function(_0x17164e){if(_0x17164e){var _0x3df4e9=typeof _0x40df94[_0xf0f5('0x1b')]===_0xf0f5('0x1c')&&typeof _0x40df94[_0xf0f5('0x1d')]===_0xf0f5('0x1c');var _0x3f3c4e=_0x17164e[_0xf0f5('0x1e')];var _0x409818=_0x3df4e9?0x0:_0x40df94['offset'];var _0x44b2c3=_0x3df4e9?_0x17164e[_0xf0f5('0x1e')]:_0x40df94[_0xf0f5('0x1b')]+_0x40df94[_0xf0f5('0x1d')];var _0x5adbff;if(_0x44b2c3>=_0x3f3c4e){_0x44b2c3=_0x3f3c4e;_0x5adbff=0xc8;}else{_0x5adbff=0xce;}_0x1463f8[_0xf0f5('0x1f')](_0x5adbff);return _0x1463f8[_0xf0f5('0x20')](_0xf0f5('0x21'),_0x409818+'-'+_0x44b2c3+'/'+_0x3f3c4e)['json'](_0x17164e);}return null;};}function patchUpdates(_0x11f151){return function(_0x14e18d){try{jsonpatch[_0xf0f5('0x22')](_0x14e18d,_0x11f151,!![]);}catch(_0x5818d5){return BPromise[_0xf0f5('0x23')](_0x5818d5);}return _0x14e18d[_0xf0f5('0x24')]();};}function saveUpdates(_0x3b9d9d,_0x3f1c95){return function(_0x37d2d1){if(_0x37d2d1){return _0x37d2d1['update'](_0x3b9d9d)['then'](function(_0x15252f){return _0x15252f;});}return null;};}function removeEntity(_0x4726c4,_0x5a5059){return function(_0x223dca){if(_0x223dca){return _0x223dca[_0xf0f5('0x25')]()[_0xf0f5('0x26')](function(){_0x4726c4[_0xf0f5('0x1f')](0xcc)[_0xf0f5('0x1a')]();});}};}function handleEntityNotFound(_0x1e1087,_0x12f05e){return function(_0x3a217e){if(!_0x3a217e){_0x1e1087[_0xf0f5('0x19')](0x194);}return _0x3a217e;};}function handleError(_0x1d4388,_0x5ca5ce){_0x5ca5ce=_0x5ca5ce||0x1f4;return function(_0x5a6544){logger['error'](_0x5a6544[_0xf0f5('0x27')]);if(_0x5a6544[_0xf0f5('0x28')]){delete _0x5a6544[_0xf0f5('0x28')];}_0x1d4388[_0xf0f5('0x1f')](_0x5ca5ce)[_0xf0f5('0x29')](_0x5a6544);};}exports['index']=function(_0x3a949d,_0x5e0b54){var _0x179515={},_0x2ba1a4={},_0x4db656={'count':0x0,'rows':[]};var _0x386e93=_['map'](db['OpenchannelTransferReport'][_0xf0f5('0x2a')],function(_0x3b14ef){return{'name':_0x3b14ef[_0xf0f5('0x2b')],'type':_0x3b14ef[_0xf0f5('0x2c')][_0xf0f5('0x2d')]};});_0x2ba1a4['model']=_[_0xf0f5('0x2e')](_0x386e93,'name');_0x2ba1a4['query']=_[_0xf0f5('0x2f')](_0x3a949d['query']);_0x2ba1a4[_0xf0f5('0x30')]=_['intersection'](_0x2ba1a4['model'],_0x2ba1a4[_0xf0f5('0x31')]);_0x179515[_0xf0f5('0x32')]=_[_0xf0f5('0x33')](_0x2ba1a4[_0xf0f5('0x34')],qs[_0xf0f5('0x35')](_0x3a949d['query'][_0xf0f5('0x35')]));_0x179515[_0xf0f5('0x32')]=_0x179515[_0xf0f5('0x32')][_0xf0f5('0x36')]?_0x179515[_0xf0f5('0x32')]:_0x2ba1a4['model'];if(!_0x3a949d['query'][_0xf0f5('0x37')](_0xf0f5('0x38'))){_0x179515[_0xf0f5('0x1d')]=qs['limit'](_0x3a949d[_0xf0f5('0x31')][_0xf0f5('0x1d')]);_0x179515[_0xf0f5('0x1b')]=qs[_0xf0f5('0x1b')](_0x3a949d['query'][_0xf0f5('0x1b')]);}_0x179515['order']=qs[_0xf0f5('0x39')](_0x3a949d[_0xf0f5('0x31')][_0xf0f5('0x39')]);_0x179515[_0xf0f5('0x3a')]=qs[_0xf0f5('0x30')](_[_0xf0f5('0x3b')](_0x3a949d[_0xf0f5('0x31')],_0x2ba1a4[_0xf0f5('0x30')]),_0x386e93);if(_0x3a949d['query'][_0xf0f5('0x3c')]){_0x179515['where']=_['merge'](_0x179515[_0xf0f5('0x3a')],{'$or':_[_0xf0f5('0x2e')](_0x386e93,function(_0x4fc2ce){if(_0x4fc2ce[_0xf0f5('0x2c')]!==_0xf0f5('0x3d')){var _0x4688c1={};_0x4688c1[_0x4fc2ce[_0xf0f5('0x28')]]={'$like':'%'+_0x3a949d[_0xf0f5('0x31')]['filter']+'%'};return _0x4688c1;}})});}_0x179515=_['merge']({},_0x179515,_0x3a949d[_0xf0f5('0x3e')]);var _0x4f1bd8={'where':_0x179515['where']};return db[_0xf0f5('0x3f')][_0xf0f5('0x1e')](_0x4f1bd8)[_0xf0f5('0x26')](function(_0x31bdb9){_0x4db656['count']=_0x31bdb9;if(_0x3a949d['query'][_0xf0f5('0x40')]){_0x179515[_0xf0f5('0x41')]=[{'all':!![]}];}return db[_0xf0f5('0x3f')][_0xf0f5('0x42')](_0x179515);})['then'](function(_0x89ab34){_0x4db656[_0xf0f5('0x43')]=_0x89ab34;return _0x4db656;})[_0xf0f5('0x26')](respondWithFilteredResult(_0x5e0b54,_0x179515))['catch'](handleError(_0x5e0b54,null));};exports[_0xf0f5('0x44')]=function(_0xbddb6f,_0x154c90){var _0x1d3861={'raw':!![],'where':{'id':_0xbddb6f['params']['id']}},_0x528725={};_0x528725[_0xf0f5('0x34')]=_[_0xf0f5('0x2f')](db[_0xf0f5('0x3f')][_0xf0f5('0x2a')]);_0x528725[_0xf0f5('0x31')]=_[_0xf0f5('0x2f')](_0xbddb6f[_0xf0f5('0x31')]);_0x528725['filters']=_['intersection'](_0x528725[_0xf0f5('0x34')],_0x528725[_0xf0f5('0x31')]);_0x1d3861['attributes']=_[_0xf0f5('0x33')](_0x528725['model'],qs[_0xf0f5('0x35')](_0xbddb6f[_0xf0f5('0x31')][_0xf0f5('0x35')]));_0x1d3861[_0xf0f5('0x32')]=_0x1d3861['attributes'][_0xf0f5('0x36')]?_0x1d3861[_0xf0f5('0x32')]:_0x528725['model'];if(_0xbddb6f['query'][_0xf0f5('0x40')]){_0x1d3861[_0xf0f5('0x41')]=[{'all':!![]}];}_0x1d3861=_[_0xf0f5('0x45')]({},_0x1d3861,_0xbddb6f[_0xf0f5('0x3e')]);return db['OpenchannelTransferReport']['find'](_0x1d3861)[_0xf0f5('0x26')](handleEntityNotFound(_0x154c90,null))[_0xf0f5('0x26')](respondWithResult(_0x154c90,null))[_0xf0f5('0x46')](handleError(_0x154c90,null));};exports['create']=function(_0x2cbd1e,_0x106748){return db[_0xf0f5('0x3f')][_0xf0f5('0x47')](_0x2cbd1e[_0xf0f5('0x48')],{})[_0xf0f5('0x26')](respondWithResult(_0x106748,0xc9))[_0xf0f5('0x46')](handleError(_0x106748,null));};exports[_0xf0f5('0x49')]=function(_0x34bf6d,_0x208c17){if(_0x34bf6d[_0xf0f5('0x48')]['id']){delete _0x34bf6d[_0xf0f5('0x48')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x34bf6d[_0xf0f5('0x4a')]['id']}})[_0xf0f5('0x26')](handleEntityNotFound(_0x208c17,null))[_0xf0f5('0x26')](saveUpdates(_0x34bf6d[_0xf0f5('0x48')],null))[_0xf0f5('0x26')](respondWithResult(_0x208c17,null))['catch'](handleError(_0x208c17,null));};exports[_0xf0f5('0x25')]=function(_0x2ef3a7,_0x1b10e9){return db[_0xf0f5('0x3f')][_0xf0f5('0x4b')]({'where':{'id':_0x2ef3a7[_0xf0f5('0x4a')]['id']}})[_0xf0f5('0x26')](handleEntityNotFound(_0x1b10e9,null))[_0xf0f5('0x26')](removeEntity(_0x1b10e9,null))['catch'](handleError(_0x1b10e9,null));};exports[_0xf0f5('0x4c')]=function(_0x4a7ad8,_0x358081){return db[_0xf0f5('0x3f')][_0xf0f5('0x4c')]()[_0xf0f5('0x26')](respondWithResult(_0x358081,null))['catch'](handleError(_0x358081,null));};
\ No newline at end of file
+var _0x9851=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','json','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','OpenchannelTransferReport','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x837fbc,_0x2b72a6){var _0x919229=function(_0x5155cf){while(--_0x5155cf){_0x837fbc['push'](_0x837fbc['shift']());}};_0x919229(++_0x2b72a6);}(_0x9851,0x169));var _0x1985=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9851[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1985('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1985('0x1'));var moment=require(_0x1985('0x2'));var BPromise=require(_0x1985('0x3'));var Mustache=require(_0x1985('0x4'));var util=require(_0x1985('0x5'));var path=require(_0x1985('0x6'));var sox=require(_0x1985('0x7'));var csv=require(_0x1985('0x8'));var ejs=require(_0x1985('0x9'));var fs=require('fs');var fs_extra=require(_0x1985('0xa'));var _=require('lodash');var squel=require(_0x1985('0xb'));var crypto=require(_0x1985('0xc'));var jsforce=require(_0x1985('0xd'));var deskjs=require(_0x1985('0xe'));var toCsv=require(_0x1985('0x8'));var querystring=require(_0x1985('0xf'));var Papa=require(_0x1985('0x10'));var Redis=require(_0x1985('0x11'));var authService=require(_0x1985('0x12'));var qs=require(_0x1985('0x13'));var as=require(_0x1985('0x14'));var hardwareService=require(_0x1985('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x1985('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1985('0x17'))['db'];function respondWithStatusCode(_0xa1da2a,_0x2c6b0b){_0x2c6b0b=_0x2c6b0b||0xcc;return function(_0x1acea){if(_0x1acea){return _0xa1da2a[_0x1985('0x18')](_0x2c6b0b);}return _0xa1da2a[_0x1985('0x19')](_0x2c6b0b)[_0x1985('0x1a')]();};}function respondWithResult(_0x1c7d87,_0x2d84d6){_0x2d84d6=_0x2d84d6||0xc8;return function(_0x747aa){if(_0x747aa){return _0x1c7d87[_0x1985('0x19')](_0x2d84d6)['json'](_0x747aa);}};}function respondWithFilteredResult(_0x5c38c3,_0x553625){return function(_0x4da5ac){if(_0x4da5ac){var _0xa10721=typeof _0x553625[_0x1985('0x1b')]===_0x1985('0x1c')&&typeof _0x553625[_0x1985('0x1d')]===_0x1985('0x1c');var _0x57d96e=_0x4da5ac['count'];var _0x19bbaf=_0xa10721?0x0:_0x553625['offset'];var _0x1d063b=_0xa10721?_0x4da5ac['count']:_0x553625[_0x1985('0x1b')]+_0x553625[_0x1985('0x1d')];var _0x41766e;if(_0x1d063b>=_0x57d96e){_0x1d063b=_0x57d96e;_0x41766e=0xc8;}else{_0x41766e=0xce;}_0x5c38c3[_0x1985('0x19')](_0x41766e);return _0x5c38c3[_0x1985('0x1e')]('Content-Range',_0x19bbaf+'-'+_0x1d063b+'/'+_0x57d96e)[_0x1985('0x1f')](_0x4da5ac);}return null;};}function patchUpdates(_0x5ea25b){return function(_0x387ab1){try{jsonpatch['apply'](_0x387ab1,_0x5ea25b,!![]);}catch(_0x4fce29){return BPromise['reject'](_0x4fce29);}return _0x387ab1[_0x1985('0x20')]();};}function saveUpdates(_0xfaab0b,_0xa8f092){return function(_0x5b953f){if(_0x5b953f){return _0x5b953f[_0x1985('0x21')](_0xfaab0b)[_0x1985('0x22')](function(_0x469c4b){return _0x469c4b;});}return null;};}function removeEntity(_0x531ebf,_0x4c7f50){return function(_0x3f2ac8){if(_0x3f2ac8){return _0x3f2ac8[_0x1985('0x23')]()[_0x1985('0x22')](function(){_0x531ebf[_0x1985('0x19')](0xcc)[_0x1985('0x1a')]();});}};}function handleEntityNotFound(_0x19c2a2,_0xe63c7d){return function(_0x3b6e4f){if(!_0x3b6e4f){_0x19c2a2[_0x1985('0x18')](0x194);}return _0x3b6e4f;};}function handleError(_0x28fce1,_0x47fecc){_0x47fecc=_0x47fecc||0x1f4;return function(_0x3a3e87){logger['error'](_0x3a3e87[_0x1985('0x24')]);if(_0x3a3e87[_0x1985('0x25')]){delete _0x3a3e87[_0x1985('0x25')];}_0x28fce1[_0x1985('0x19')](_0x47fecc)[_0x1985('0x26')](_0x3a3e87);};}exports[_0x1985('0x27')]=function(_0x266c6e,_0x5e99be){var _0x1a5901={},_0x5ab605={},_0x582658={'count':0x0,'rows':[]};var _0x400c07=_['map'](db['OpenchannelTransferReport'][_0x1985('0x28')],function(_0x852426){return{'name':_0x852426[_0x1985('0x29')],'type':_0x852426[_0x1985('0x2a')][_0x1985('0x2b')]};});_0x5ab605['model']=_[_0x1985('0x2c')](_0x400c07,_0x1985('0x25'));_0x5ab605[_0x1985('0x2d')]=_[_0x1985('0x2e')](_0x266c6e[_0x1985('0x2d')]);_0x5ab605[_0x1985('0x2f')]=_[_0x1985('0x30')](_0x5ab605[_0x1985('0x31')],_0x5ab605[_0x1985('0x2d')]);_0x1a5901[_0x1985('0x32')]=_[_0x1985('0x30')](_0x5ab605[_0x1985('0x31')],qs[_0x1985('0x33')](_0x266c6e['query']['fields']));_0x1a5901[_0x1985('0x32')]=_0x1a5901[_0x1985('0x32')][_0x1985('0x34')]?_0x1a5901['attributes']:_0x5ab605[_0x1985('0x31')];if(!_0x266c6e[_0x1985('0x2d')][_0x1985('0x35')](_0x1985('0x36'))){_0x1a5901[_0x1985('0x1d')]=qs[_0x1985('0x1d')](_0x266c6e[_0x1985('0x2d')][_0x1985('0x1d')]);_0x1a5901[_0x1985('0x1b')]=qs[_0x1985('0x1b')](_0x266c6e[_0x1985('0x2d')][_0x1985('0x1b')]);}_0x1a5901[_0x1985('0x37')]=qs[_0x1985('0x38')](_0x266c6e[_0x1985('0x2d')][_0x1985('0x38')]);_0x1a5901[_0x1985('0x39')]=qs['filters'](_[_0x1985('0x3a')](_0x266c6e[_0x1985('0x2d')],_0x5ab605[_0x1985('0x2f')]),_0x400c07);if(_0x266c6e['query'][_0x1985('0x3b')]){_0x1a5901[_0x1985('0x39')]=_['merge'](_0x1a5901[_0x1985('0x39')],{'$or':_[_0x1985('0x2c')](_0x400c07,function(_0x3c946c){if(_0x3c946c[_0x1985('0x2a')]!==_0x1985('0x3c')){var _0xbc5367={};_0xbc5367[_0x3c946c[_0x1985('0x25')]]={'$like':'%'+_0x266c6e[_0x1985('0x2d')][_0x1985('0x3b')]+'%'};return _0xbc5367;}})});}_0x1a5901=_[_0x1985('0x3d')]({},_0x1a5901,_0x266c6e['options']);var _0x12aa52={'where':_0x1a5901[_0x1985('0x39')]};return db[_0x1985('0x3e')][_0x1985('0x3f')](_0x12aa52)[_0x1985('0x22')](function(_0x3d6e89){_0x582658['count']=_0x3d6e89;if(_0x266c6e[_0x1985('0x2d')][_0x1985('0x40')]){_0x1a5901[_0x1985('0x41')]=[{'all':!![]}];}return db[_0x1985('0x3e')][_0x1985('0x42')](_0x1a5901);})[_0x1985('0x22')](function(_0x109575){_0x582658[_0x1985('0x43')]=_0x109575;return _0x582658;})[_0x1985('0x22')](respondWithFilteredResult(_0x5e99be,_0x1a5901))[_0x1985('0x44')](handleError(_0x5e99be,null));};exports[_0x1985('0x45')]=function(_0x508249,_0x44e121){var _0x3e5213={'raw':!![],'where':{'id':_0x508249[_0x1985('0x46')]['id']}},_0x5bea23={};_0x5bea23[_0x1985('0x31')]=_['keys'](db['OpenchannelTransferReport'][_0x1985('0x28')]);_0x5bea23[_0x1985('0x2d')]=_[_0x1985('0x2e')](_0x508249['query']);_0x5bea23[_0x1985('0x2f')]=_[_0x1985('0x30')](_0x5bea23[_0x1985('0x31')],_0x5bea23[_0x1985('0x2d')]);_0x3e5213[_0x1985('0x32')]=_['intersection'](_0x5bea23[_0x1985('0x31')],qs[_0x1985('0x33')](_0x508249[_0x1985('0x2d')][_0x1985('0x33')]));_0x3e5213[_0x1985('0x32')]=_0x3e5213[_0x1985('0x32')][_0x1985('0x34')]?_0x3e5213[_0x1985('0x32')]:_0x5bea23[_0x1985('0x31')];if(_0x508249[_0x1985('0x2d')][_0x1985('0x40')]){_0x3e5213[_0x1985('0x41')]=[{'all':!![]}];}_0x3e5213=_[_0x1985('0x3d')]({},_0x3e5213,_0x508249[_0x1985('0x47')]);return db['OpenchannelTransferReport'][_0x1985('0x48')](_0x3e5213)[_0x1985('0x22')](handleEntityNotFound(_0x44e121,null))[_0x1985('0x22')](respondWithResult(_0x44e121,null))[_0x1985('0x44')](handleError(_0x44e121,null));};exports[_0x1985('0x49')]=function(_0x5c7427,_0xcd28ae){return db[_0x1985('0x3e')][_0x1985('0x49')](_0x5c7427[_0x1985('0x4a')],{})[_0x1985('0x22')](respondWithResult(_0xcd28ae,0xc9))[_0x1985('0x44')](handleError(_0xcd28ae,null));};exports[_0x1985('0x21')]=function(_0x59af03,_0x348c8b){if(_0x59af03[_0x1985('0x4a')]['id']){delete _0x59af03['body']['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x59af03[_0x1985('0x46')]['id']}})[_0x1985('0x22')](handleEntityNotFound(_0x348c8b,null))[_0x1985('0x22')](saveUpdates(_0x59af03[_0x1985('0x4a')],null))[_0x1985('0x22')](respondWithResult(_0x348c8b,null))[_0x1985('0x44')](handleError(_0x348c8b,null));};exports[_0x1985('0x23')]=function(_0x2fb9a4,_0x10c68a){return db['OpenchannelTransferReport'][_0x1985('0x48')]({'where':{'id':_0x2fb9a4['params']['id']}})[_0x1985('0x22')](handleEntityNotFound(_0x10c68a,null))[_0x1985('0x22')](removeEntity(_0x10c68a,null))[_0x1985('0x44')](handleError(_0x10c68a,null));};exports['describe']=function(_0xfbf5b7,_0x65c7df){return db[_0x1985('0x3e')][_0x1985('0x4b')]()[_0x1985('0x22')](respondWithResult(_0x65c7df,null))[_0x1985('0x44')](handleError(_0x65c7df,null));};
\ No newline at end of file
index 0ccd5d3..6f489e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67af=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','moment'];(function(_0x35ed46,_0x302ee8){var _0x21c831=function(_0xb1b2e7){while(--_0xb1b2e7){_0x35ed46['push'](_0x35ed46['shift']());}};_0x21c831(++_0x302ee8);}(_0x67af,0x123));var _0xf67a=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x67af[_0x2cde0a];return _0x260610;};'use strict';var _=require(_0xf67a('0x0'));var util=require(_0xf67a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf67a('0x2'));var BPromise=require(_0xf67a('0x3'));var rp=require(_0xf67a('0x4'));var fs=require('fs');var path=require(_0xf67a('0x5'));var rimraf=require(_0xf67a('0x6'));var config=require(_0xf67a('0x7'));var attributes=require(_0xf67a('0x8'));module[_0xf67a('0x9')]=function(_0x267213,_0x210569){return _0x267213[_0xf67a('0xa')](_0xf67a('0xb'),attributes,{'tableName':_0xf67a('0xc'),'paranoid':![],'indexes':[{'name':_0xf67a('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4db7=['util','../../config/logger','api','moment','path','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','lodash'];(function(_0x4ba86d,_0x28c896){var _0x52d473=function(_0x4c715a){while(--_0x4c715a){_0x4ba86d['push'](_0x4ba86d['shift']());}};_0x52d473(++_0x28c896);}(_0x4db7,0x1ee));var _0x74db=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x4db7[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0x74db('0x0'));var util=require(_0x74db('0x1'));var logger=require(_0x74db('0x2'))(_0x74db('0x3'));var moment=require(_0x74db('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x74db('0x5'));var rimraf=require('rimraf');var config=require(_0x74db('0x6'));var attributes=require(_0x74db('0x7'));module[_0x74db('0x8')]=function(_0x23e803,_0x4214e5){return _0x23e803[_0x74db('0x9')](_0x74db('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 7d8d3a8..96b4dcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bde=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x46fc6c,_0x297637){var _0x18694f=function(_0x34e1e0){while(--_0x34e1e0){_0x46fc6c['push'](_0x46fc6c['shift']());}};_0x18694f(++_0x297637);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe0bd('0x0'));var util=require('util');var moment=require(_0xe0bd('0x1'));var BPromise=require(_0xe0bd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];var utils=require(_0xe0bd('0x5'));var logger=require('../../config/logger')(_0xe0bd('0x6'));var config=require(_0xe0bd('0x7'));var jayson=require(_0xe0bd('0x8'));var client=jayson[_0xe0bd('0x9')][_0xe0bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1c8892,_0x29faee,_0x1b75c1){return new BPromise(function(_0xf790d6,_0x54d27f){return client[_0xe0bd('0xb')](_0x1c8892,_0x1b75c1)[_0xe0bd('0xc')](function(_0x12a5f1){logger['info'](_0xe0bd('0xd'),_0x29faee,_0xe0bd('0xe'));logger['debug'](_0xe0bd('0xf'),_0x29faee,'request\x20sent',JSON[_0xe0bd('0x10')](_0x12a5f1));if(_0x12a5f1[_0xe0bd('0x11')]){if(_0x12a5f1[_0xe0bd('0x11')][_0xe0bd('0x12')]===0x1f4){logger[_0xe0bd('0x11')](_0xe0bd('0xd'),_0x29faee,_0x12a5f1[_0xe0bd('0x11')]['message']);return _0x54d27f(_0x12a5f1[_0xe0bd('0x11')][_0xe0bd('0x13')]);}logger[_0xe0bd('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x29faee,_0x12a5f1[_0xe0bd('0x11')]['message']);return _0xf790d6(_0x12a5f1[_0xe0bd('0x11')][_0xe0bd('0x13')]);}else{logger[_0xe0bd('0x14')](_0xe0bd('0xd'),_0x29faee,_0xe0bd('0xe'));_0xf790d6(_0x12a5f1[_0xe0bd('0x15')][_0xe0bd('0x13')]);}})[_0xe0bd('0x16')](function(_0x4ea791){logger['error'](_0xe0bd('0xd'),_0x29faee,_0x4ea791);_0x54d27f(_0x4ea791);});});}
\ No newline at end of file
+var _0x55d2=['OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','OpenchannelTransferReport,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','request\x20sent'];(function(_0x18fd21,_0x4af3d1){var _0x113f67=function(_0x45b480){while(--_0x45b480){_0x18fd21['push'](_0x18fd21['shift']());}};_0x113f67(++_0x4af3d1);}(_0x55d2,0x9f));var _0x255d=function(_0x8a7bcb,_0x2cf7d1){_0x8a7bcb=_0x8a7bcb-0x0;var _0x23ccc0=_0x55d2[_0x8a7bcb];return _0x23ccc0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x255d('0x0'));var BPromise=require(_0x255d('0x1'));var rs=require(_0x255d('0x2'));var fs=require('fs');var Redis=require(_0x255d('0x3'));var db=require(_0x255d('0x4'))['db'];var utils=require(_0x255d('0x5'));var logger=require('../../config/logger')(_0x255d('0x6'));var config=require(_0x255d('0x7'));var jayson=require(_0x255d('0x8'));var client=jayson[_0x255d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f93b4,_0x15469e,_0xcf66a2){return new BPromise(function(_0x253ac9,_0xdb6ea7){return client[_0x255d('0xa')](_0x4f93b4,_0xcf66a2)['then'](function(_0x5198d7){logger['info']('OpenchannelTransferReport,\x20%s,\x20%s',_0x15469e,_0x255d('0xb'));logger['debug'](_0x255d('0xc'),_0x15469e,_0x255d('0xb'),JSON[_0x255d('0xd')](_0x5198d7));if(_0x5198d7['error']){if(_0x5198d7['error'][_0x255d('0xe')]===0x1f4){logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);return _0xdb6ea7(_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);}logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);return _0x253ac9(_0x5198d7[_0x255d('0xf')][_0x255d('0x11')]);}else{logger['info'](_0x255d('0x10'),_0x15469e,_0x255d('0xb'));_0x253ac9(_0x5198d7['result'][_0x255d('0x11')]);}})[_0x255d('0x12')](function(_0x37c217){logger[_0x255d('0xf')](_0x255d('0x10'),_0x15469e,_0x37c217);_0xdb6ea7(_0x37c217);});});}
\ No newline at end of file
index fbb1659..434b132 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d56=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','./pause.controller','get','/:id','isAuthenticated','show','post','update'];(function(_0x2490ac,_0x5401a5){var _0x200d1f=function(_0x2fdc37){while(--_0x2fdc37){_0x2490ac['push'](_0x2490ac['shift']());}};_0x200d1f(++_0x5401a5);}(_0x3d56,0xd3));var _0x63d5=function(_0x59824d,_0x3652c4){_0x59824d=_0x59824d-0x0;var _0x324fd2=_0x3d56[_0x59824d];return _0x324fd2;};'use strict';var multer=require(_0x63d5('0x0'));var util=require('util');var path=require(_0x63d5('0x1'));var timeout=require('connect-timeout');var express=require(_0x63d5('0x2'));var router=express[_0x63d5('0x3')]();var fs_extra=require(_0x63d5('0x4'));var auth=require(_0x63d5('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x63d5('0x6'));router[_0x63d5('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x63d5('0x7')](_0x63d5('0x8'),auth[_0x63d5('0x9')](),controller[_0x63d5('0xa')]);router[_0x63d5('0xb')]('/',auth[_0x63d5('0x9')](),controller['create']);router['put'](_0x63d5('0x8'),auth[_0x63d5('0x9')](),controller[_0x63d5('0xc')]);router[_0x63d5('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x63d5('0xe')]);module[_0x63d5('0xf')]=router;
\ No newline at end of file
+var _0x276e=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./pause.controller','index','get','/:id','isAuthenticated','post','create','put','update'];(function(_0x3c28c6,_0x2afbc3){var _0x586708=function(_0x18d4e9){while(--_0x18d4e9){_0x3c28c6['push'](_0x3c28c6['shift']());}};_0x586708(++_0x2afbc3);}(_0x276e,0xec));var _0xe276=function(_0x4ffa64,_0x271035){_0x4ffa64=_0x4ffa64-0x0;var _0x5da001=_0x276e[_0x4ffa64];return _0x5da001;};'use strict';var multer=require(_0xe276('0x0'));var util=require(_0xe276('0x1'));var path=require(_0xe276('0x2'));var timeout=require('connect-timeout');var express=require(_0xe276('0x3'));var router=express[_0xe276('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe276('0x5'));var interaction=require(_0xe276('0x6'));var config=require('../../config/environment');var controller=require(_0xe276('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe276('0x8')]);router[_0xe276('0x9')](_0xe276('0xa'),auth[_0xe276('0xb')](),controller['show']);router[_0xe276('0xc')]('/',auth[_0xe276('0xb')](),controller[_0xe276('0xd')]);router[_0xe276('0xe')](_0xe276('0xa'),auth['isAuthenticated'](),controller[_0xe276('0xf')]);router['delete'](_0xe276('0xa'),auth['isAuthenticated'](),controller[_0xe276('0x10')]);module[_0xe276('0x11')]=router;
\ No newline at end of file
index 28d3b17..402ab12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77c3=['name','STRING'];(function(_0x1581cd,_0xd89689){var _0x358f74=function(_0x50aeb4){while(--_0x50aeb4){_0x1581cd['push'](_0x1581cd['shift']());}};_0x358f74(++_0xd89689);}(_0x77c3,0x19f));var _0x377c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x77c3[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x377c('0x0')],'unique':_0x377c('0x1'),'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0cc0=['STRING','sequelize','exports'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x0cc0,0x15a));var _0x00cc=function(_0x487e8e,_0x452414){_0x487e8e=_0x487e8e-0x0;var _0x4678db=_0x0cc0[_0x487e8e];return _0x4678db;};'use strict';var Sequelize=require(_0x00cc('0x0'));module[_0x00cc('0x1')]={'name':{'type':Sequelize[_0x00cc('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index f2539c6..08540c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf88=['UserProfileSection','userProfileId','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','Pauses','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','Pause','includeAll','include','rows','catch','show','params','keys','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get'];(function(_0x4164f2,_0x38669f){var _0x2575c7=function(_0x24dca1){while(--_0x24dca1){_0x4164f2['push'](_0x4164f2['shift']());}};_0x2575c7(++_0x38669f);}(_0xaf88,0x102));var _0x8af8=function(_0x3ac541,_0x566683){_0x3ac541=_0x3ac541-0x0;var _0x3f4239=_0xaf88[_0x3ac541];return _0x3f4239;};'use strict';var emlformat=require(_0x8af8('0x0'));var rimraf=require(_0x8af8('0x1'));var zipdir=require(_0x8af8('0x2'));var jsonpatch=require(_0x8af8('0x3'));var rp=require('request-promise');var moment=require(_0x8af8('0x4'));var BPromise=require(_0x8af8('0x5'));var Mustache=require(_0x8af8('0x6'));var util=require(_0x8af8('0x7'));var path=require(_0x8af8('0x8'));var sox=require(_0x8af8('0x9'));var csv=require(_0x8af8('0xa'));var ejs=require(_0x8af8('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8af8('0xc'));var squel=require(_0x8af8('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8af8('0xe'));var toCsv=require(_0x8af8('0xa'));var querystring=require(_0x8af8('0xf'));var Papa=require(_0x8af8('0x10'));var Redis=require('ioredis');var authService=require(_0x8af8('0x11'));var qs=require(_0x8af8('0x12'));var as=require(_0x8af8('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8af8('0x14'))(_0x8af8('0x15'));var utils=require('../../config/utils');var config=require(_0x8af8('0x16'));var licenseUtil=require(_0x8af8('0x17'));var db=require(_0x8af8('0x18'))['db'];function respondWithStatusCode(_0x3ce7ed,_0x1bd35f){_0x1bd35f=_0x1bd35f||0xcc;return function(_0x259005){if(_0x259005){return _0x3ce7ed[_0x8af8('0x19')](_0x1bd35f);}return _0x3ce7ed[_0x8af8('0x1a')](_0x1bd35f)[_0x8af8('0x1b')]();};}function respondWithResult(_0x4be1c4,_0x3aae3d){_0x3aae3d=_0x3aae3d||0xc8;return function(_0x40d1ef){if(_0x40d1ef){return _0x4be1c4['status'](_0x3aae3d)[_0x8af8('0x1c')](_0x40d1ef);}};}function respondWithFilteredResult(_0x47dcb6,_0x1d3d9f){return function(_0xddde29){if(_0xddde29){var _0x5ad0d9=typeof _0x1d3d9f[_0x8af8('0x1d')]==='undefined'&&typeof _0x1d3d9f[_0x8af8('0x1e')]==='undefined';var _0x8d5be5=_0xddde29[_0x8af8('0x1f')];var _0x40b27e=_0x5ad0d9?0x0:_0x1d3d9f[_0x8af8('0x1d')];var _0x392111=_0x5ad0d9?_0xddde29['count']:_0x1d3d9f['offset']+_0x1d3d9f[_0x8af8('0x1e')];var _0x2fc753;if(_0x392111>=_0x8d5be5){_0x392111=_0x8d5be5;_0x2fc753=0xc8;}else{_0x2fc753=0xce;}_0x47dcb6[_0x8af8('0x1a')](_0x2fc753);return _0x47dcb6[_0x8af8('0x20')](_0x8af8('0x21'),_0x40b27e+'-'+_0x392111+'/'+_0x8d5be5)[_0x8af8('0x1c')](_0xddde29);}return null;};}function patchUpdates(_0xfdf693){return function(_0x193063){try{jsonpatch[_0x8af8('0x22')](_0x193063,_0xfdf693,!![]);}catch(_0x25e8ad){return BPromise[_0x8af8('0x23')](_0x25e8ad);}return _0x193063[_0x8af8('0x24')]();};}function saveUpdates(_0xb0b3af,_0x18c5cc){return function(_0x55c3d4){if(_0x55c3d4){return _0x55c3d4['update'](_0xb0b3af)[_0x8af8('0x25')](function(_0x3527e9){return _0x3527e9;});}return null;};}function removeEntity(_0x58e287,_0x27b377){return function(_0x2a9724){if(_0x2a9724){return _0x2a9724[_0x8af8('0x26')]()['then'](function(){var _0x3346c9=_0x2a9724['get']({'plain':!![]});var _0x141bb3=_0x8af8('0x27');return db[_0x8af8('0x28')][_0x8af8('0x26')]({'where':{'type':_0x141bb3,'resourceId':_0x3346c9['id']}})['then'](function(){return _0x2a9724;});})[_0x8af8('0x25')](function(){_0x58e287[_0x8af8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20727b,_0x347103){return function(_0xae36e9){if(!_0xae36e9){_0x20727b[_0x8af8('0x19')](0x194);}return _0xae36e9;};}function handleError(_0x3fb80d,_0x37100b){_0x37100b=_0x37100b||0x1f4;return function(_0x1fabf2){logger[_0x8af8('0x29')](_0x1fabf2[_0x8af8('0x2a')]);if(_0x1fabf2['name']){delete _0x1fabf2[_0x8af8('0x2b')];}_0x3fb80d[_0x8af8('0x1a')](_0x37100b)[_0x8af8('0x2c')](_0x1fabf2);};}exports[_0x8af8('0x2d')]=function(_0x2aa781,_0x3e3c5a){var _0x5dc6a5={},_0x5466b5={},_0x32a318={'count':0x0,'rows':[]};var _0x4d77c8=_[_0x8af8('0x2e')](db['Pause'][_0x8af8('0x2f')],function(_0x5482e9){return{'name':_0x5482e9[_0x8af8('0x30')],'type':_0x5482e9['type'][_0x8af8('0x31')]};});_0x5466b5[_0x8af8('0x32')]=_[_0x8af8('0x2e')](_0x4d77c8,_0x8af8('0x2b'));_0x5466b5['query']=_['keys'](_0x2aa781[_0x8af8('0x33')]);_0x5466b5['filters']=_[_0x8af8('0x34')](_0x5466b5['model'],_0x5466b5['query']);_0x5dc6a5[_0x8af8('0x35')]=_['intersection'](_0x5466b5[_0x8af8('0x32')],qs[_0x8af8('0x36')](_0x2aa781[_0x8af8('0x33')][_0x8af8('0x36')]));_0x5dc6a5[_0x8af8('0x35')]=_0x5dc6a5['attributes']['length']?_0x5dc6a5['attributes']:_0x5466b5[_0x8af8('0x32')];if(!_0x2aa781[_0x8af8('0x33')][_0x8af8('0x37')](_0x8af8('0x38'))){_0x5dc6a5[_0x8af8('0x1e')]=qs['limit'](_0x2aa781[_0x8af8('0x33')][_0x8af8('0x1e')]);_0x5dc6a5[_0x8af8('0x1d')]=qs[_0x8af8('0x1d')](_0x2aa781[_0x8af8('0x33')][_0x8af8('0x1d')]);}_0x5dc6a5[_0x8af8('0x39')]=qs['sort'](_0x2aa781[_0x8af8('0x33')][_0x8af8('0x3a')]);_0x5dc6a5[_0x8af8('0x3b')]=qs[_0x8af8('0x3c')](_[_0x8af8('0x3d')](_0x2aa781[_0x8af8('0x33')],_0x5466b5[_0x8af8('0x3c')]),_0x4d77c8);if(_0x2aa781[_0x8af8('0x33')][_0x8af8('0x3e')]){_0x5dc6a5[_0x8af8('0x3b')]=_[_0x8af8('0x3f')](_0x5dc6a5[_0x8af8('0x3b')],{'$or':_[_0x8af8('0x2e')](_0x4d77c8,function(_0x5833bd){if(_0x5833bd[_0x8af8('0x40')]!==_0x8af8('0x41')){var _0xbac054={};_0xbac054[_0x5833bd[_0x8af8('0x2b')]]={'$like':'%'+_0x2aa781[_0x8af8('0x33')][_0x8af8('0x3e')]+'%'};return _0xbac054;}})});}_0x5dc6a5=_[_0x8af8('0x3f')]({},_0x5dc6a5,_0x2aa781[_0x8af8('0x42')]);var _0x47000e={'where':_0x5dc6a5[_0x8af8('0x3b')]};return db[_0x8af8('0x43')][_0x8af8('0x1f')](_0x47000e)[_0x8af8('0x25')](function(_0x27ae8d){_0x32a318['count']=_0x27ae8d;if(_0x2aa781[_0x8af8('0x33')][_0x8af8('0x44')]){_0x5dc6a5[_0x8af8('0x45')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x5dc6a5);})[_0x8af8('0x25')](function(_0x2cccdd){_0x32a318[_0x8af8('0x46')]=_0x2cccdd;return _0x32a318;})[_0x8af8('0x25')](respondWithFilteredResult(_0x3e3c5a,_0x5dc6a5))[_0x8af8('0x47')](handleError(_0x3e3c5a,null));};exports[_0x8af8('0x48')]=function(_0xdd4238,_0xfde112){var _0x27c8be={'raw':!![],'where':{'id':_0xdd4238[_0x8af8('0x49')]['id']}},_0x332f8a={};_0x332f8a[_0x8af8('0x32')]=_[_0x8af8('0x4a')](db['Pause']['rawAttributes']);_0x332f8a[_0x8af8('0x33')]=_[_0x8af8('0x4a')](_0xdd4238[_0x8af8('0x33')]);_0x332f8a[_0x8af8('0x3c')]=_[_0x8af8('0x34')](_0x332f8a[_0x8af8('0x32')],_0x332f8a[_0x8af8('0x33')]);_0x27c8be[_0x8af8('0x35')]=_[_0x8af8('0x34')](_0x332f8a[_0x8af8('0x32')],qs[_0x8af8('0x36')](_0xdd4238['query'][_0x8af8('0x36')]));_0x27c8be['attributes']=_0x27c8be[_0x8af8('0x35')][_0x8af8('0x4b')]?_0x27c8be['attributes']:_0x332f8a[_0x8af8('0x32')];if(_0xdd4238[_0x8af8('0x33')][_0x8af8('0x44')]){_0x27c8be[_0x8af8('0x45')]=[{'all':!![]}];}_0x27c8be=_['merge']({},_0x27c8be,_0xdd4238['options']);return db['Pause']['find'](_0x27c8be)[_0x8af8('0x25')](handleEntityNotFound(_0xfde112,null))[_0x8af8('0x25')](respondWithResult(_0xfde112,null))['catch'](handleError(_0xfde112,null));};exports[_0x8af8('0x4c')]=function(_0x48280a,_0x856c3){return db['Pause'][_0x8af8('0x4c')](_0x48280a[_0x8af8('0x4d')],{})[_0x8af8('0x25')](function(_0x2426ad){var _0x5a83fa=_0x48280a[_0x8af8('0x4e')]['get']({'plain':!![]});if(!_0x5a83fa)throw new Error(_0x8af8('0x4f'));if(_0x5a83fa[_0x8af8('0x50')]===_0x8af8('0x4e')){var _0x327664=_0x2426ad[_0x8af8('0x51')]({'plain':!![]});var _0x23dc74=_0x8af8('0x27');return db[_0x8af8('0x52')]['find']({'where':{'name':_0x23dc74,'userProfileId':_0x5a83fa[_0x8af8('0x53')]},'raw':!![]})[_0x8af8('0x25')](function(_0x5e5a60){if(_0x5e5a60&&_0x5e5a60['autoAssociation']===0x0){return db[_0x8af8('0x28')]['create']({'name':_0x327664[_0x8af8('0x2b')],'resourceId':_0x327664['id'],'type':_0x5e5a60['name'],'sectionId':_0x5e5a60['id']},{})[_0x8af8('0x25')](function(){return _0x2426ad;});}else{return _0x2426ad;}})['catch'](function(_0x4d61ff){logger[_0x8af8('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d61ff);throw _0x4d61ff;});}return _0x2426ad;})[_0x8af8('0x25')](respondWithResult(_0x856c3,0xc9))[_0x8af8('0x47')](handleError(_0x856c3,null));};exports['update']=function(_0x12bad2,_0x3e82a3){if(_0x12bad2[_0x8af8('0x4d')]['id']){delete _0x12bad2[_0x8af8('0x4d')]['id'];}return db['Pause'][_0x8af8('0x54')]({'where':{'id':_0x12bad2[_0x8af8('0x49')]['id']}})['then'](handleEntityNotFound(_0x3e82a3,null))[_0x8af8('0x25')](saveUpdates(_0x12bad2[_0x8af8('0x4d')],null))[_0x8af8('0x25')](respondWithResult(_0x3e82a3,null))[_0x8af8('0x47')](handleError(_0x3e82a3,null));};exports[_0x8af8('0x26')]=function(_0x4a114d,_0x181f66){return db[_0x8af8('0x43')][_0x8af8('0x54')]({'where':{'id':_0x4a114d[_0x8af8('0x49')]['id']}})[_0x8af8('0x25')](handleEntityNotFound(_0x181f66,null))[_0x8af8('0x25')](removeEntity(_0x181f66,null))['catch'](handleError(_0x181f66,null));};
\ No newline at end of file
+var _0x6617=['model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Pauses','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','sendStatus','stack','name','send','index','map','Pause','rawAttributes','fieldName','type'];(function(_0x48a458,_0x2c08c2){var _0x4c5f26=function(_0x67fcdf){while(--_0x67fcdf){_0x48a458['push'](_0x48a458['shift']());}};_0x4c5f26(++_0x2c08c2);}(_0x6617,0x129));var _0x7661=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x6617[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x7661('0x0'));var rimraf=require(_0x7661('0x1'));var zipdir=require(_0x7661('0x2'));var jsonpatch=require(_0x7661('0x3'));var rp=require(_0x7661('0x4'));var moment=require(_0x7661('0x5'));var BPromise=require(_0x7661('0x6'));var Mustache=require(_0x7661('0x7'));var util=require(_0x7661('0x8'));var path=require(_0x7661('0x9'));var sox=require(_0x7661('0xa'));var csv=require('to-csv');var ejs=require(_0x7661('0xb'));var fs=require('fs');var fs_extra=require(_0x7661('0xc'));var _=require(_0x7661('0xd'));var squel=require(_0x7661('0xe'));var crypto=require(_0x7661('0xf'));var jsforce=require(_0x7661('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x7661('0x11'));var querystring=require('querystring');var Papa=require(_0x7661('0x12'));var Redis=require('ioredis');var authService=require(_0x7661('0x13'));var qs=require(_0x7661('0x14'));var as=require(_0x7661('0x15'));var hardwareService=require(_0x7661('0x16'));var logger=require(_0x7661('0x17'))(_0x7661('0x18'));var utils=require(_0x7661('0x19'));var config=require(_0x7661('0x1a'));var licenseUtil=require(_0x7661('0x1b'));var db=require(_0x7661('0x1c'))['db'];function respondWithStatusCode(_0x2d766d,_0x5cb403){_0x5cb403=_0x5cb403||0xcc;return function(_0x4f2ad9){if(_0x4f2ad9){return _0x2d766d['sendStatus'](_0x5cb403);}return _0x2d766d[_0x7661('0x1d')](_0x5cb403)[_0x7661('0x1e')]();};}function respondWithResult(_0x5dfec8,_0x2e134d){_0x2e134d=_0x2e134d||0xc8;return function(_0x16cd3c){if(_0x16cd3c){return _0x5dfec8[_0x7661('0x1d')](_0x2e134d)['json'](_0x16cd3c);}};}function respondWithFilteredResult(_0x264de4,_0x37170a){return function(_0x112bb6){if(_0x112bb6){var _0xf3dbe9=typeof _0x37170a[_0x7661('0x1f')]==='undefined'&&typeof _0x37170a[_0x7661('0x20')]===_0x7661('0x21');var _0x34fb0c=_0x112bb6[_0x7661('0x22')];var _0x5a4dbb=_0xf3dbe9?0x0:_0x37170a[_0x7661('0x1f')];var _0x5afe43=_0xf3dbe9?_0x112bb6[_0x7661('0x22')]:_0x37170a[_0x7661('0x1f')]+_0x37170a['limit'];var _0x464b23;if(_0x5afe43>=_0x34fb0c){_0x5afe43=_0x34fb0c;_0x464b23=0xc8;}else{_0x464b23=0xce;}_0x264de4[_0x7661('0x1d')](_0x464b23);return _0x264de4[_0x7661('0x23')](_0x7661('0x24'),_0x5a4dbb+'-'+_0x5afe43+'/'+_0x34fb0c)[_0x7661('0x25')](_0x112bb6);}return null;};}function patchUpdates(_0x44df91){return function(_0x507be5){try{jsonpatch[_0x7661('0x26')](_0x507be5,_0x44df91,!![]);}catch(_0x4e49c6){return BPromise[_0x7661('0x27')](_0x4e49c6);}return _0x507be5[_0x7661('0x28')]();};}function saveUpdates(_0x1abe72,_0x5e79fc){return function(_0x5b15eb){if(_0x5b15eb){return _0x5b15eb[_0x7661('0x29')](_0x1abe72)[_0x7661('0x2a')](function(_0x57bbe0){return _0x57bbe0;});}return null;};}function removeEntity(_0x3331f3,_0x22de48){return function(_0x255f7b){if(_0x255f7b){return _0x255f7b[_0x7661('0x2b')]()[_0x7661('0x2a')](function(){var _0x2c40db=_0x255f7b[_0x7661('0x2c')]({'plain':!![]});var _0x2b5679='Pauses';return db['UserProfileResource']['destroy']({'where':{'type':_0x2b5679,'resourceId':_0x2c40db['id']}})[_0x7661('0x2a')](function(){return _0x255f7b;});})['then'](function(){_0x3331f3[_0x7661('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e8fda,_0x47933e){return function(_0x933349){if(!_0x933349){_0x1e8fda[_0x7661('0x2d')](0x194);}return _0x933349;};}function handleError(_0x8a500,_0x4f0560){_0x4f0560=_0x4f0560||0x1f4;return function(_0x2a35e0){logger['error'](_0x2a35e0[_0x7661('0x2e')]);if(_0x2a35e0[_0x7661('0x2f')]){delete _0x2a35e0[_0x7661('0x2f')];}_0x8a500[_0x7661('0x1d')](_0x4f0560)[_0x7661('0x30')](_0x2a35e0);};}exports[_0x7661('0x31')]=function(_0x130ed9,_0x1a4aac){var _0x482098={},_0x51cf09={},_0x381631={'count':0x0,'rows':[]};var _0x401306=_[_0x7661('0x32')](db[_0x7661('0x33')][_0x7661('0x34')],function(_0x1b1225){return{'name':_0x1b1225[_0x7661('0x35')],'type':_0x1b1225[_0x7661('0x36')]['key']};});_0x51cf09[_0x7661('0x37')]=_[_0x7661('0x32')](_0x401306,'name');_0x51cf09[_0x7661('0x38')]=_[_0x7661('0x39')](_0x130ed9['query']);_0x51cf09['filters']=_['intersection'](_0x51cf09[_0x7661('0x37')],_0x51cf09[_0x7661('0x38')]);_0x482098[_0x7661('0x3a')]=_[_0x7661('0x3b')](_0x51cf09['model'],qs[_0x7661('0x3c')](_0x130ed9[_0x7661('0x38')][_0x7661('0x3c')]));_0x482098['attributes']=_0x482098['attributes'][_0x7661('0x3d')]?_0x482098[_0x7661('0x3a')]:_0x51cf09['model'];if(!_0x130ed9[_0x7661('0x38')][_0x7661('0x3e')]('nolimit')){_0x482098[_0x7661('0x20')]=qs[_0x7661('0x20')](_0x130ed9[_0x7661('0x38')]['limit']);_0x482098[_0x7661('0x1f')]=qs[_0x7661('0x1f')](_0x130ed9['query']['offset']);}_0x482098[_0x7661('0x3f')]=qs[_0x7661('0x40')](_0x130ed9['query'][_0x7661('0x40')]);_0x482098[_0x7661('0x41')]=qs[_0x7661('0x42')](_[_0x7661('0x43')](_0x130ed9['query'],_0x51cf09['filters']),_0x401306);if(_0x130ed9[_0x7661('0x38')][_0x7661('0x44')]){_0x482098['where']=_[_0x7661('0x45')](_0x482098['where'],{'$or':_[_0x7661('0x32')](_0x401306,function(_0x8f62d3){if(_0x8f62d3['type']!=='VIRTUAL'){var _0x435a43={};_0x435a43[_0x8f62d3[_0x7661('0x2f')]]={'$like':'%'+_0x130ed9[_0x7661('0x38')][_0x7661('0x44')]+'%'};return _0x435a43;}})});}_0x482098=_[_0x7661('0x45')]({},_0x482098,_0x130ed9['options']);var _0x1d1fd1={'where':_0x482098[_0x7661('0x41')]};return db['Pause'][_0x7661('0x22')](_0x1d1fd1)['then'](function(_0x7617c3){_0x381631['count']=_0x7617c3;if(_0x130ed9['query'][_0x7661('0x46')]){_0x482098[_0x7661('0x47')]=[{'all':!![]}];}return db[_0x7661('0x33')][_0x7661('0x48')](_0x482098);})[_0x7661('0x2a')](function(_0x351807){_0x381631[_0x7661('0x49')]=_0x351807;return _0x381631;})['then'](respondWithFilteredResult(_0x1a4aac,_0x482098))[_0x7661('0x4a')](handleError(_0x1a4aac,null));};exports[_0x7661('0x4b')]=function(_0x3bdc02,_0x3d0809){var _0xca6522={'raw':!![],'where':{'id':_0x3bdc02[_0x7661('0x4c')]['id']}},_0x49e47b={};_0x49e47b[_0x7661('0x37')]=_[_0x7661('0x39')](db['Pause']['rawAttributes']);_0x49e47b[_0x7661('0x38')]=_[_0x7661('0x39')](_0x3bdc02[_0x7661('0x38')]);_0x49e47b[_0x7661('0x42')]=_[_0x7661('0x3b')](_0x49e47b[_0x7661('0x37')],_0x49e47b[_0x7661('0x38')]);_0xca6522['attributes']=_['intersection'](_0x49e47b['model'],qs['fields'](_0x3bdc02['query'][_0x7661('0x3c')]));_0xca6522[_0x7661('0x3a')]=_0xca6522[_0x7661('0x3a')][_0x7661('0x3d')]?_0xca6522[_0x7661('0x3a')]:_0x49e47b['model'];if(_0x3bdc02['query'][_0x7661('0x46')]){_0xca6522['include']=[{'all':!![]}];}_0xca6522=_[_0x7661('0x45')]({},_0xca6522,_0x3bdc02[_0x7661('0x4d')]);return db[_0x7661('0x33')][_0x7661('0x4e')](_0xca6522)[_0x7661('0x2a')](handleEntityNotFound(_0x3d0809,null))[_0x7661('0x2a')](respondWithResult(_0x3d0809,null))[_0x7661('0x4a')](handleError(_0x3d0809,null));};exports[_0x7661('0x4f')]=function(_0x2e3462,_0x3223eb){return db['Pause']['create'](_0x2e3462['body'],{})[_0x7661('0x2a')](function(_0x2c6d41){var _0x88f627=_0x2e3462['user']['get']({'plain':!![]});if(!_0x88f627)throw new Error(_0x7661('0x50'));if(_0x88f627['role']===_0x7661('0x51')){var _0x29e864=_0x2c6d41[_0x7661('0x2c')]({'plain':!![]});var _0x45bf3e=_0x7661('0x52');return db[_0x7661('0x53')]['find']({'where':{'name':_0x45bf3e,'userProfileId':_0x88f627['userProfileId']},'raw':!![]})[_0x7661('0x2a')](function(_0x5eeffc){if(_0x5eeffc&&_0x5eeffc[_0x7661('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x29e864[_0x7661('0x2f')],'resourceId':_0x29e864['id'],'type':_0x5eeffc['name'],'sectionId':_0x5eeffc['id']},{})[_0x7661('0x2a')](function(){return _0x2c6d41;});}else{return _0x2c6d41;}})[_0x7661('0x4a')](function(_0x1aad84){logger[_0x7661('0x55')](_0x7661('0x56'),_0x1aad84);throw _0x1aad84;});}return _0x2c6d41;})[_0x7661('0x2a')](respondWithResult(_0x3223eb,0xc9))[_0x7661('0x4a')](handleError(_0x3223eb,null));};exports[_0x7661('0x29')]=function(_0xe03a67,_0x88eb88){if(_0xe03a67[_0x7661('0x57')]['id']){delete _0xe03a67['body']['id'];}return db['Pause'][_0x7661('0x4e')]({'where':{'id':_0xe03a67[_0x7661('0x4c')]['id']}})[_0x7661('0x2a')](handleEntityNotFound(_0x88eb88,null))['then'](saveUpdates(_0xe03a67['body'],null))[_0x7661('0x2a')](respondWithResult(_0x88eb88,null))[_0x7661('0x4a')](handleError(_0x88eb88,null));};exports[_0x7661('0x2b')]=function(_0x2a6f99,_0x504c01){return db[_0x7661('0x33')]['find']({'where':{'id':_0x2a6f99[_0x7661('0x4c')]['id']}})[_0x7661('0x2a')](handleEntityNotFound(_0x504c01,null))[_0x7661('0x2a')](removeEntity(_0x504c01,null))[_0x7661('0x4a')](handleError(_0x504c01,null));};
\ No newline at end of file
index 54dee20..f61815a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./pause.attributes'];(function(_0x2bd1ec,_0x3fe65f){var _0x2f7577=function(_0x5234fb){while(--_0x5234fb){_0x2bd1ec['push'](_0x2bd1ec['shift']());}};_0x2f7577(++_0x3fe65f);}(_0x8ef6,0xf2));var _0x68ef=function(_0x12bb4b,_0x4cd2d1){_0x12bb4b=_0x12bb4b-0x0;var _0x569da3=_0x8ef6[_0x12bb4b];return _0x569da3;};'use strict';var _=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var logger=require(_0x68ef('0x2'))(_0x68ef('0x3'));var moment=require(_0x68ef('0x4'));var BPromise=require(_0x68ef('0x5'));var rp=require(_0x68ef('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var attributes=require(_0x68ef('0x9'));module[_0x68ef('0xa')]=function(_0x4d26e3,_0x4f77f3){return _0x4d26e3[_0x68ef('0xb')](_0x68ef('0xc'),attributes,{'tableName':_0x68ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf494=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','lodash','util'];(function(_0x2cff36,_0x17552f){var _0x145315=function(_0x3f1d65){while(--_0x3f1d65){_0x2cff36['push'](_0x2cff36['shift']());}};_0x145315(++_0x17552f);}(_0xf494,0x1c6));var _0x4f49=function(_0x5a1a68,_0x39cb7a){_0x5a1a68=_0x5a1a68-0x0;var _0x584e5d=_0xf494[_0x5a1a68];return _0x584e5d;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));module[_0x4f49('0xa')]=function(_0xc5e778,_0x413530){return _0xc5e778[_0x4f49('0xb')]('Pause',attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5002d66..8c58e92 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x2cf642,_0x35bedf){var _0x50b512=function(_0x37d74d){while(--_0x37d74d){_0x2cf642['push'](_0x2cf642['shift']());}};_0x50b512(++_0x35bedf);}(_0xb10b,0x12a));var _0xbb10=function(_0x3bacf8,_0x315aaa){_0x3bacf8=_0x3bacf8-0x0;var _0x53d999=_0xb10b[_0x3bacf8];return _0x53d999;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x347435,_0x1dae06){var _0x39ebc4=function(_0x5afbe0){while(--_0x5afbe0){_0x347435['push'](_0x347435['shift']());}};_0x39ebc4(++_0x1dae06);}(_0x7a54,0x106));var _0x47a5=function(_0x166b8f,_0x3d8204){_0x166b8f=_0x166b8f-0x0;var _0x3afd1f=_0x7a54[_0x166b8f];return _0x3afd1f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});};
\ No newline at end of file
index 1043cbe..a34b8dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c12=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/:id','show','download','diskStorage','join','root','originalname','basename','extname','now','upload','post','put','update','delete','exports'];(function(_0x3e8d34,_0xa3d07){var _0x1caa32=function(_0x5a2b94){while(--_0x5a2b94){_0x3e8d34['push'](_0x3e8d34['shift']());}};_0x1caa32(++_0xa3d07);}(_0x5c12,0x188));var _0x25c1=function(_0x64aff8,_0x106082){_0x64aff8=_0x64aff8-0x0;var _0x5488a3=_0x5c12[_0x64aff8];return _0x5488a3;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var fs_extra=require(_0x25c1('0x4'));var auth=require(_0x25c1('0x5'));var interaction=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var controller=require(_0x25c1('0x8'));router['get']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xa')]);router[_0x25c1('0xb')]('/webhook',controller['webhookGet']);router[_0x25c1('0xb')](_0x25c1('0xc'),auth[_0x25c1('0x9')](),controller[_0x25c1('0xd')]);router[_0x25c1('0xb')]('/:id/download',auth[_0x25c1('0x9')](),controller[_0x25c1('0xe')]);var upload=multer({'storage':multer[_0x25c1('0xf')]({'destination':function(_0x81f0f4,_0x2872b2,_0x5e44e2){_0x5e44e2(null,path[_0x25c1('0x10')](config[_0x25c1('0x11')],'server/files/plugins'));},'filename':function(_0x256ecd,_0x209af5,_0x323d3c){_0x209af5[_0x25c1('0x12')]=_0x209af5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x323d3c(null,util['format']('%s-%s%s',path[_0x25c1('0x13')](_0x209af5[_0x25c1('0x12')],path[_0x25c1('0x14')](_0x209af5[_0x25c1('0x12')])),Date[_0x25c1('0x15')](),path['extname'](_0x209af5[_0x25c1('0x12')])));}})});router['post']('/',upload['single']('file'),controller[_0x25c1('0x16')]);router[_0x25c1('0x17')]('/webhook',controller['webhookPost']);router[_0x25c1('0x18')]('/:id',auth[_0x25c1('0x9')](),controller[_0x25c1('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x25c1('0x1a')]);module[_0x25c1('0x1b')]=router;
\ No newline at end of file
+var _0x9f62=['extname','now','post','single','file','upload','put','/:id','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','webhookGet','/:id/download','isAuthenticated','join','root','originalname','replace','format','%s-%s%s','basename'];(function(_0x27f67d,_0x253765){var _0x4cfa37=function(_0x173454){while(--_0x173454){_0x27f67d['push'](_0x27f67d['shift']());}};_0x4cfa37(++_0x253765);}(_0x9f62,0x154));var _0x29f6=function(_0x1256b3,_0x1c6043){_0x1256b3=_0x1256b3-0x0;var _0x23e2fa=_0x9f62[_0x1256b3];return _0x23e2fa;};'use strict';var multer=require('multer');var util=require(_0x29f6('0x0'));var path=require('path');var timeout=require(_0x29f6('0x1'));var express=require(_0x29f6('0x2'));var router=express[_0x29f6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x29f6('0x4'));var config=require(_0x29f6('0x5'));var controller=require(_0x29f6('0x6'));router[_0x29f6('0x7')]('/',auth['isAuthenticated'](),controller[_0x29f6('0x8')]);router[_0x29f6('0x7')](_0x29f6('0x9'),controller[_0x29f6('0xa')]);router[_0x29f6('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x29f6('0xb'),auth[_0x29f6('0xc')](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x29b3f5,_0x442623,_0x4909e0){_0x4909e0(null,path[_0x29f6('0xd')](config[_0x29f6('0xe')],'server/files/plugins'));},'filename':function(_0x5b9b6a,_0x559585,_0x57b2d2){_0x559585[_0x29f6('0xf')]=_0x559585[_0x29f6('0xf')][_0x29f6('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x57b2d2(null,util[_0x29f6('0x11')](_0x29f6('0x12'),path[_0x29f6('0x13')](_0x559585[_0x29f6('0xf')],path[_0x29f6('0x14')](_0x559585[_0x29f6('0xf')])),Date[_0x29f6('0x15')](),path[_0x29f6('0x14')](_0x559585[_0x29f6('0xf')])));}})});router[_0x29f6('0x16')]('/',upload[_0x29f6('0x17')](_0x29f6('0x18')),controller[_0x29f6('0x19')]);router[_0x29f6('0x16')]('/webhook',controller['webhookPost']);router[_0x29f6('0x1a')](_0x29f6('0x1b'),auth[_0x29f6('0xc')](),controller['update']);router[_0x29f6('0x1c')](_0x29f6('0x1b'),auth['isAuthenticated'](),controller[_0x29f6('0x1c')]);module[_0x29f6('0x1d')]=router;
\ No newline at end of file
index da5ed88..fcee757 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb665=['STRING','ENUM','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports'];(function(_0x11db34,_0x81a13d){var _0x1a4c4c=function(_0x469dbd){while(--_0x469dbd){_0x11db34['push'](_0x11db34['shift']());}};_0x1a4c4c(++_0x81a13d);}(_0xb665,0x177));var _0x5b66=function(_0x18c0fc,_0x4acb01){_0x18c0fc=_0x18c0fc-0x0;var _0x45cc0c=_0xb665[_0x18c0fc];return _0x45cc0c;};'use strict';var Sequelize=require(_0x5b66('0x0'));module[_0x5b66('0x1')]={'name':{'type':Sequelize[_0x5b66('0x2')]},'type':{'type':Sequelize[_0x5b66('0x3')]('html',_0x5b66('0x4'))},'description':{'type':Sequelize[_0x5b66('0x5')]},'version':{'type':Sequelize[_0x5b66('0x5')]},'path':{'type':Sequelize[_0x5b66('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x5b66('0x6')],'defaultValue':0x0,'comment':_0x5b66('0x7')},'sidebar':{'type':Sequelize[_0x5b66('0x3')](_0x5b66('0x8'),_0x5b66('0x9'),_0x5b66('0xa'),_0x5b66('0xb')),'defaultValue':'always','comment':_0x5b66('0xc')},'icon':{'type':Sequelize[_0x5b66('0x2')]},'adminUrl':{'type':Sequelize[_0x5b66('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x5b66('0x2')]},'scriptPath':{'type':Sequelize[_0x5b66('0x2')]}};
\ No newline at end of file
+var _0xfa04=['never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly'];(function(_0xb416ba,_0x2edaf9){var _0x32ce6d=function(_0x543644){while(--_0x543644){_0xb416ba['push'](_0xb416ba['shift']());}};_0x32ce6d(++_0x2edaf9);}(_0xfa04,0x93));var _0x4fa0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfa04[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x4fa0('0x0'));module[_0x4fa0('0x1')]={'name':{'type':Sequelize[_0x4fa0('0x2')]},'type':{'type':Sequelize[_0x4fa0('0x3')](_0x4fa0('0x4'),'script')},'description':{'type':Sequelize[_0x4fa0('0x5')]},'version':{'type':Sequelize[_0x4fa0('0x5')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x4fa0('0x6')],'defaultValue':0x0,'comment':_0x4fa0('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0x4fa0('0x8'),'agentOnly','always',_0x4fa0('0x9')),'defaultValue':_0x4fa0('0xa'),'comment':_0x4fa0('0xb')},'icon':{'type':Sequelize[_0x4fa0('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x4fa0('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x4fa0('0x2')]}};
\ No newline at end of file
index 95fc06f..98da15e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc089=['defaults','localhost','./plugin.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','Plugins','UserProfileResource','destroy','stack','name','send','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','merge','where','map','type','VIRTUAL','filter','options','Plugin','includeAll','include','findAll','rows','show','keys','catch','download','find','params','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','dirname','node_modules/**/*','finalize','close','existsSync','Error','unlinkSync','info','Download\x20completed','upload','file','filename','extname','join','Plugin\x20upload\x20destination:\x20%s','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','plugins','Warning:\x20admin\x20view\x20not\x20specified','agent','test','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','scriptPath','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','webhookGet','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','rimraf','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc089,0x95));var _0x9c08=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc089[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0x9c08('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9c08('0x1'));var jsonpatch=require(_0x9c08('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9c08('0x3'));var Mustache=require(_0x9c08('0x4'));var util=require('util');var path=require(_0x9c08('0x5'));var sox=require(_0x9c08('0x6'));var csv=require(_0x9c08('0x7'));var ejs=require(_0x9c08('0x8'));var fs=require('fs');var fs_extra=require(_0x9c08('0x9'));var _=require('lodash');var squel=require(_0x9c08('0xa'));var crypto=require(_0x9c08('0xb'));var jsforce=require(_0x9c08('0xc'));var deskjs=require(_0x9c08('0xd'));var toCsv=require(_0x9c08('0x7'));var querystring=require(_0x9c08('0xe'));var Papa=require(_0x9c08('0xf'));var extract=require(_0x9c08('0x10'));var rimraf=require(_0x9c08('0x11'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x9c08('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9c08('0x13'));var hardwareService=require(_0x9c08('0x14'));var logger=require('../../config/logger')(_0x9c08('0x15'));var utils=require(_0x9c08('0x16'));var config=require(_0x9c08('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c08('0x18'))['db'];config[_0x9c08('0x19')]=_[_0x9c08('0x1a')](config[_0x9c08('0x19')],{'host':_0x9c08('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9c08('0x19')]));require(_0x9c08('0x1c'))[_0x9c08('0x1d')](socket);function respondWithStatusCode(_0x5f404c,_0x406d52){_0x406d52=_0x406d52||0xcc;return function(_0x30df78){if(_0x30df78){return _0x5f404c[_0x9c08('0x1e')](_0x406d52);}return _0x5f404c[_0x9c08('0x1f')](_0x406d52)[_0x9c08('0x20')]();};}function respondWithResult(_0xd100ac,_0x38b94c){_0x38b94c=_0x38b94c||0xc8;return function(_0x1eb13e){if(_0x1eb13e){return _0xd100ac[_0x9c08('0x1f')](_0x38b94c)[_0x9c08('0x21')](_0x1eb13e);}};}function respondWithFilteredResult(_0x1e8072,_0x4c26e9){return function(_0xcebf05){if(_0xcebf05){var _0x285715=typeof _0x4c26e9[_0x9c08('0x22')]===_0x9c08('0x23')&&typeof _0x4c26e9['limit']===_0x9c08('0x23');var _0x15be65=_0xcebf05['count'];var _0x329ef9=_0x285715?0x0:_0x4c26e9[_0x9c08('0x22')];var _0x41caff=_0x285715?_0xcebf05[_0x9c08('0x24')]:_0x4c26e9[_0x9c08('0x22')]+_0x4c26e9[_0x9c08('0x25')];var _0x22803d;if(_0x41caff>=_0x15be65){_0x41caff=_0x15be65;_0x22803d=0xc8;}else{_0x22803d=0xce;}_0x1e8072[_0x9c08('0x1f')](_0x22803d);return _0x1e8072[_0x9c08('0x26')](_0x9c08('0x27'),_0x329ef9+'-'+_0x41caff+'/'+_0x15be65)[_0x9c08('0x21')](_0xcebf05);}return null;};}function patchUpdates(_0x19e8a6){return function(_0x4448c7){try{jsonpatch[_0x9c08('0x28')](_0x4448c7,_0x19e8a6,!![]);}catch(_0x46e24e){return BPromise[_0x9c08('0x29')](_0x46e24e);}return _0x4448c7[_0x9c08('0x2a')]();};}function saveUpdates(_0x5af493,_0x26a639){return function(_0x40c9e5){if(_0x40c9e5){return _0x40c9e5[_0x9c08('0x2b')](_0x5af493)[_0x9c08('0x2c')](function(_0x4d34e1){return _0x4d34e1;});}return null;};}function removeEntity(_0x30e1ec,_0x230689){return function(_0x32d43e){if(_0x32d43e){return _0x32d43e['destroy']()['then'](function(){var _0x4070e4=_0x32d43e[_0x9c08('0x2d')]({'plain':!![]});var _0x2f69dc=_0x9c08('0x2e');return db[_0x9c08('0x2f')][_0x9c08('0x30')]({'where':{'type':_0x2f69dc,'resourceId':_0x4070e4['id']}})[_0x9c08('0x2c')](function(){return _0x32d43e;});})[_0x9c08('0x2c')](function(){_0x30e1ec[_0x9c08('0x1f')](0xcc)[_0x9c08('0x20')]();});}};}function handleEntityNotFound(_0x2181d8,_0x5afc0e){return function(_0x21e5b0){if(!_0x21e5b0){_0x2181d8[_0x9c08('0x1e')](0x194);}return _0x21e5b0;};}function handleError(_0xc2abe4,_0x4e137d){_0x4e137d=_0x4e137d||0x1f4;return function(_0x23a197){logger['error'](_0x23a197[_0x9c08('0x31')]);if(_0x23a197[_0x9c08('0x32')]){delete _0x23a197[_0x9c08('0x32')];}_0xc2abe4[_0x9c08('0x1f')](_0x4e137d)[_0x9c08('0x33')](_0x23a197);};}exports['index']=function(_0x23bbec,_0x1d5765){var _0x1384fd={},_0x41f2d2={},_0x24cd5e={'count':0x0,'rows':[]};var _0x5b36b6=_['map'](db['Plugin'][_0x9c08('0x34')],function(_0x1e4dd8){return{'name':_0x1e4dd8[_0x9c08('0x35')],'type':_0x1e4dd8['type'][_0x9c08('0x36')]};});_0x41f2d2[_0x9c08('0x37')]=_['map'](_0x5b36b6,_0x9c08('0x32'));_0x41f2d2['query']=_['keys'](_0x23bbec[_0x9c08('0x38')]);_0x41f2d2[_0x9c08('0x39')]=_['intersection'](_0x41f2d2[_0x9c08('0x37')],_0x41f2d2[_0x9c08('0x38')]);_0x1384fd[_0x9c08('0x3a')]=_[_0x9c08('0x3b')](_0x41f2d2['model'],qs[_0x9c08('0x3c')](_0x23bbec['query'][_0x9c08('0x3c')]));_0x1384fd['attributes']=_0x1384fd[_0x9c08('0x3a')][_0x9c08('0x3d')]?_0x1384fd['attributes']:_0x41f2d2[_0x9c08('0x37')];if(!_0x23bbec[_0x9c08('0x38')]['hasOwnProperty'](_0x9c08('0x3e'))){_0x1384fd[_0x9c08('0x25')]=qs['limit'](_0x23bbec[_0x9c08('0x38')][_0x9c08('0x25')]);_0x1384fd[_0x9c08('0x22')]=qs['offset'](_0x23bbec[_0x9c08('0x38')][_0x9c08('0x22')]);}_0x1384fd[_0x9c08('0x3f')]=qs[_0x9c08('0x40')](_0x23bbec['query']['sort']);_0x1384fd['where']=qs[_0x9c08('0x39')](_[_0x9c08('0x41')](_0x23bbec[_0x9c08('0x38')],_0x41f2d2[_0x9c08('0x39')]),_0x5b36b6);if(_0x23bbec[_0x9c08('0x38')]['filter']){_0x1384fd['where']=_[_0x9c08('0x42')](_0x1384fd[_0x9c08('0x43')],{'$or':_[_0x9c08('0x44')](_0x5b36b6,function(_0x584fc4){if(_0x584fc4[_0x9c08('0x45')]!==_0x9c08('0x46')){var _0x41ee9b={};_0x41ee9b[_0x584fc4['name']]={'$like':'%'+_0x23bbec[_0x9c08('0x38')][_0x9c08('0x47')]+'%'};return _0x41ee9b;}})});}_0x1384fd=_[_0x9c08('0x42')]({},_0x1384fd,_0x23bbec[_0x9c08('0x48')]);var _0x381ae4={'where':_0x1384fd[_0x9c08('0x43')]};return db[_0x9c08('0x49')][_0x9c08('0x24')](_0x381ae4)[_0x9c08('0x2c')](function(_0x132705){_0x24cd5e['count']=_0x132705;if(_0x23bbec[_0x9c08('0x38')][_0x9c08('0x4a')]){_0x1384fd[_0x9c08('0x4b')]=[{'all':!![]}];}return db[_0x9c08('0x49')][_0x9c08('0x4c')](_0x1384fd);})[_0x9c08('0x2c')](function(_0x18dbc0){_0x24cd5e[_0x9c08('0x4d')]=_0x18dbc0;return _0x24cd5e;})[_0x9c08('0x2c')](respondWithFilteredResult(_0x1d5765,_0x1384fd))['catch'](handleError(_0x1d5765,null));};exports[_0x9c08('0x4e')]=function(_0x28fa73,_0x5d8e6f){var _0x4c52fa={'raw':!![],'where':{'id':_0x28fa73['params']['id']}},_0x6c8be2={};_0x6c8be2[_0x9c08('0x37')]=_[_0x9c08('0x4f')](db[_0x9c08('0x49')][_0x9c08('0x34')]);_0x6c8be2[_0x9c08('0x38')]=_[_0x9c08('0x4f')](_0x28fa73[_0x9c08('0x38')]);_0x6c8be2['filters']=_[_0x9c08('0x3b')](_0x6c8be2[_0x9c08('0x37')],_0x6c8be2[_0x9c08('0x38')]);_0x4c52fa['attributes']=_[_0x9c08('0x3b')](_0x6c8be2[_0x9c08('0x37')],qs[_0x9c08('0x3c')](_0x28fa73[_0x9c08('0x38')][_0x9c08('0x3c')]));_0x4c52fa[_0x9c08('0x3a')]=_0x4c52fa[_0x9c08('0x3a')][_0x9c08('0x3d')]?_0x4c52fa[_0x9c08('0x3a')]:_0x6c8be2[_0x9c08('0x37')];if(_0x28fa73[_0x9c08('0x38')]['includeAll']){_0x4c52fa['include']=[{'all':!![]}];}_0x4c52fa=_[_0x9c08('0x42')]({},_0x4c52fa,_0x28fa73[_0x9c08('0x48')]);return db['Plugin']['find'](_0x4c52fa)['then'](handleEntityNotFound(_0x5d8e6f,null))['then'](respondWithResult(_0x5d8e6f,null))[_0x9c08('0x50')](handleError(_0x5d8e6f,null));};exports[_0x9c08('0x51')]=function(_0x38500b,_0x1a2296,_0x48bb8c){return db['Plugin'][_0x9c08('0x52')]({'where':{'id':_0x38500b[_0x9c08('0x53')]['id']},'attributes':[_0x9c08('0x32'),_0x9c08('0x5')],'raw':!![]})['then'](handleEntityNotFound(_0x1a2296,null))[_0x9c08('0x2c')](function(_0x40024b){if(_0x40024b){var _0x3cb042=path['join'](config[_0x9c08('0x54')],_0x9c08('0x55'),util[_0x9c08('0x56')](_0x9c08('0x57'),path[_0x9c08('0x58')](_0x40024b[_0x9c08('0x5')])));var _0x16d18d=fs[_0x9c08('0x59')](_0x3cb042);var _0x5af4e3=archiver(_0x9c08('0x5a'),{'zlib':{'level':0x9}});_0x5af4e3['on'](_0x9c08('0x5b'),function(_0x876770){if(_0x876770[_0x9c08('0x5c')]===_0x9c08('0x5d')){logger[_0x9c08('0x5e')](_0x876770);}else{throw new db[(_0x9c08('0x5f'))]['Error'](_0x9c08('0x60'));}});_0x5af4e3['on'](_0x9c08('0x5e'),function(_0x29dd5c){throw new db[(_0x9c08('0x5f'))]['Error'](_0x9c08('0x60'));});_0x5af4e3[_0x9c08('0x61')](_0x16d18d);_0x5af4e3[_0x9c08('0x62')]('**/*',{'cwd':path['join'](config['root'],_0x9c08('0x55'),path[_0x9c08('0x63')](_0x40024b[_0x9c08('0x5')])),'ignore':[path['join'](path['basename'](_0x40024b[_0x9c08('0x5')]),_0x9c08('0x64')),path['join'](path[_0x9c08('0x58')](_0x40024b[_0x9c08('0x5')]),'attachments/**/*')],'nodir':!![]})[_0x9c08('0x65')]();_0x16d18d['on'](_0x9c08('0x66'),function(){if(!fs[_0x9c08('0x67')](_0x3cb042)){throw new db['Sequelize']['Error']('Plugin\x20not\x20found');}return _0x1a2296[_0x9c08('0x51')](_0x3cb042,util['format'](_0x9c08('0x57'),path[_0x9c08('0x58')](_0x40024b[_0x9c08('0x5')])),function(_0x287a9a){if(_0x287a9a){throw new db[(_0x9c08('0x5f'))][(_0x9c08('0x68'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x9c08('0x69')](_0x3cb042);logger[_0x9c08('0x6a')](_0x9c08('0x6b'));logger[_0x9c08('0x6a')]('Temporary\x20file\x20removed');});});}return null;})[_0x9c08('0x50')](handleError(_0x1a2296,null));};exports[_0x9c08('0x6c')]=function(_0x453a92,_0x4eea7f,_0x26fd2d){var _0x3c2674=path['basename'](_0x453a92[_0x9c08('0x6d')][_0x9c08('0x6e')],path[_0x9c08('0x6f')](_0x453a92[_0x9c08('0x6d')][_0x9c08('0x6e')]));var _0x2595e3=path[_0x9c08('0x70')](config[_0x9c08('0x54')],_0x9c08('0x55'),_0x453a92['file'][_0x9c08('0x6e')]);var _0x49cc29=path['join'](config[_0x9c08('0x54')],_0x9c08('0x55'),_0x3c2674);logger['info']('Plugin\x20upload\x20filepath:\x20%s',_0x2595e3);logger[_0x9c08('0x6a')](_0x9c08('0x71'),_0x49cc29);try{fs['chmodSync'](_0x2595e3,parseInt(_0x9c08('0x72'),0x8));extract(_0x2595e3,{'dir':_0x49cc29},function(_0xe8156a){if(_0xe8156a){logger[_0x9c08('0x5e')](_0xe8156a);handleError(_0xe8156a,!![]);};var _0x5a7cee=fs[_0x9c08('0x73')](_0x49cc29);if(_0x5a7cee[_0x9c08('0x3d')]>0x1){removeReferences(_0x2595e3,_0x49cc29);logger[_0x9c08('0x5e')]('Invalid\x20plugin\x20structure');return _0x26fd2d(new Error(_0x9c08('0x74')));}var _0xdfc5b0=fs[_0x9c08('0x75')](path['join'](_0x49cc29,_0x5a7cee[0x0]));if(_0xdfc5b0[_0x9c08('0x76')]()){removeReferences(_0x2595e3,_0x49cc29);logger[_0x9c08('0x5e')](_0x9c08('0x74'));return _0x26fd2d(new Error(_0x9c08('0x74')));}if(_0xdfc5b0[_0x9c08('0x77')]()){var _0xb88254=fs[_0x9c08('0x73')](path[_0x9c08('0x70')](_0x49cc29,_0x5a7cee[0x0]));if(_0xb88254[_0x9c08('0x3d')]===0x0){removeReferences(_0x2595e3,_0x49cc29);logger[_0x9c08('0x5e')](_0x9c08('0x74'));return _0x26fd2d(new Error('Invalid\x20plugin\x20structure'));}var _0x1ac5cc=_0xb88254[_0x9c08('0x78')](function(_0x1786a5){return _0x1786a5===_0x9c08('0x79');});if(!_0x1ac5cc){return _0x26fd2d(new Error(_0x9c08('0x7a')));}var _0x24b646=fs[_0x9c08('0x7b')](path[_0x9c08('0x70')](_0x49cc29,_0x5a7cee[0x0],_0x9c08('0x79')));var _0x21c223=JSON[_0x9c08('0x7c')](_0x24b646);if(_0x9c08('0x23')==typeof _0x21c223[_0x9c08('0x32')]){return _0x26fd2d(new Error(_0x9c08('0x7d')));}if(_0x9c08('0x23')==typeof _0x21c223[_0x9c08('0x45')]){return _0x26fd2d(new Error(_0x9c08('0x7e')));}if(_0x9c08('0x23')==typeof _0x21c223[_0x9c08('0x7f')]){return _0x26fd2d(new Error(_0x9c08('0x80')));}if(_0x9c08('0x23')==typeof _0x21c223[_0x9c08('0x81')]){return _0x26fd2d(new Error(_0x9c08('0x82')));}if(_0x21c223[_0x9c08('0x45')]==='html'){if(_0x9c08('0x23')==typeof _0x21c223[_0x9c08('0x81')][_0x9c08('0x83')]){return _0x26fd2d(new Error(_0x9c08('0x84')));}if('undefined'==typeof _0x21c223[_0x9c08('0x81')]['views'][_0x9c08('0x85')]&&_0x9c08('0x23')==typeof _0x21c223[_0x9c08('0x81')][_0x9c08('0x83')]['agent']){return _0x26fd2d(new Error(_0x9c08('0x86')));}}else if(_0x21c223[_0x9c08('0x45')]==='script'){if(_0x9c08('0x23')==typeof _0x21c223[_0x9c08('0x81')]['scriptName']){return _0x26fd2d(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0x9c08('0x23')==typeof _0x21c223[_0x9c08('0x81')]['scriptPath']){return _0x26fd2d(new Error(_0x9c08('0x87')));}}else{return _0x26fd2d(new Error(_0x9c08('0x88')));}var _0x32f693=_0x21c223[_0x9c08('0x32')];var _0x54c25b=_0x21c223[_0x9c08('0x89')];var _0x1f1542=_0x21c223[_0x9c08('0x45')];var _0x2d81a6=_0x21c223[_0x9c08('0x8a')]?_0x21c223[_0x9c08('0x8a')]:_0x9c08('0x8b');var _0x2f5dc6=_0x21c223[_0x9c08('0x8c')]?_0x21c223['icon']:_0x9c08('0x8d');var _0x28da37='';var _0x173da9='';var _0x388ba1='';var _0x3276a1='';var _0x3dde46=_0x21c223[_0x9c08('0x7f')];if(_0x1f1542===_0x9c08('0x8e')){if(_0x9c08('0x23')!=typeof _0x21c223[_0x9c08('0x81')][_0x9c08('0x83')][_0x9c08('0x85')]){var _0x5ac109=_0x21c223[_0x9c08('0x81')][_0x9c08('0x83')][_0x9c08('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5ac109)){_0x28da37=path[_0x9c08('0x70')](_0x9c08('0x8f'),_0x3c2674,_0x5a7cee[0x0],_0x5ac109);}else{_0x28da37=_0x5ac109;}}else{logger[_0x9c08('0x6a')](_0x9c08('0x90'));}if(_0x9c08('0x23')!=typeof _0x21c223[_0x9c08('0x81')]['views'][_0x9c08('0x91')]){var _0x2d7e2c=_0x21c223[_0x9c08('0x81')][_0x9c08('0x83')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x9c08('0x92')](_0x2d7e2c)){_0x173da9=path['join'](_0x9c08('0x8f'),_0x3c2674,_0x5a7cee[0x0],_0x2d7e2c);}else{_0x173da9=_0x2d7e2c;}}else{logger['info'](_0x9c08('0x93'));}}else if(_0x1f1542===_0x9c08('0x94')){_0x388ba1=_0x21c223[_0x9c08('0x81')][_0x9c08('0x95')];_0x3276a1=_0x21c223[_0x9c08('0x81')][_0x9c08('0x96')];if(_0x9c08('0x23')!=typeof _0x21c223[_0x9c08('0x81')]['views']){if('undefined'!=typeof _0x21c223['parameters'][_0x9c08('0x83')]['admin']){var _0x5ac109=_0x21c223[_0x9c08('0x81')][_0x9c08('0x83')][_0x9c08('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5ac109)){_0x28da37=path['join'](_0x9c08('0x8f'),_0x3c2674,_0x5a7cee[0x0],_0x5ac109);}else{_0x28da37=_0x5ac109;}}if(_0x9c08('0x23')!=typeof _0x21c223[_0x9c08('0x81')][_0x9c08('0x83')][_0x9c08('0x91')]){var _0x2d7e2c=_0x21c223[_0x9c08('0x81')][_0x9c08('0x83')][_0x9c08('0x91')];if(!/^(f|ht)tps?:\/\//i[_0x9c08('0x92')](_0x2d7e2c)){_0x173da9=path[_0x9c08('0x70')](_0x9c08('0x8f'),_0x3c2674,_0x5a7cee[0x0],_0x2d7e2c);}else{_0x173da9=_0x2d7e2c;}}}}var _0x2782e9={'name':_0x32f693,'description':_0x54c25b,'path':path[_0x9c08('0x70')](_0x3c2674,_0x5a7cee[0x0]),'type':_0x1f1542,'sidebar':_0x2d81a6,'icon':_0x2f5dc6,'adminUrl':_0x28da37,'agentUrl':_0x173da9,'scriptName':_0x388ba1,'scriptPath':_0x3276a1,'version':_0x3dde46};removeReferences(_0x2595e3,null);return db[_0x9c08('0x49')][_0x9c08('0x97')](_0x2782e9)[_0x9c08('0x2c')](function(_0x393d51){var _0x917fef={'role':_0x453a92[_0x9c08('0x98')][_0x9c08('0x99')],'userProfileId':_0x453a92[_0x9c08('0x98')]['userProfileId']};if(!_0x917fef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x917fef[_0x9c08('0x99')]===_0x9c08('0x9a')){var _0x176d10=_0x393d51['get']({'plain':!![]});return db[_0x9c08('0x9b')]['find']({'where':{'name':_0x9c08('0x2e'),'userProfileId':_0x917fef[_0x9c08('0x9c')]},'raw':!![]})[_0x9c08('0x2c')](function(_0x46d5ce){if(_0x46d5ce&&_0x46d5ce[_0x9c08('0x9d')]===0x0){return db['UserProfileResource'][_0x9c08('0x97')]({'name':_0x176d10[_0x9c08('0x32')],'resourceId':_0x176d10['id'],'type':_0x46d5ce['name'],'sectionId':_0x46d5ce['id']},{})[_0x9c08('0x2c')](function(){return _0x393d51;});}else{return _0x393d51;}})[_0x9c08('0x50')](function(_0x3a65b8){logger['error'](_0x9c08('0x9e'),_0x3a65b8);throw _0x3a65b8;});}return _0x393d51;})[_0x9c08('0x2c')](respondWithResult(_0x4eea7f,null))[_0x9c08('0x50')](handleError(_0x4eea7f,null));}});}catch(_0x201193){_0x4eea7f[_0x9c08('0x1f')](0x1f4)[_0x9c08('0x33')](_0x201193);}};function removeReferences(_0x40c140,_0x601fc6){try{if(_0x40c140){fs[_0x9c08('0x69')](_0x40c140);logger['info']('Zip\x20archive\x20removed');}if(_0x601fc6){rimraf(_0x601fc6,function(){});logger[_0x9c08('0x6a')](_0x9c08('0x9f'));}}catch(_0x1d0afd){logger[_0x9c08('0x5e')](_0x1d0afd);}}exports['update']=function(_0x390bb9,_0x3082a2,_0x411e7e){return db[_0x9c08('0x49')]['find']({'where':{'id':_0x390bb9['params']['id']}})['then'](handleEntityNotFound(_0x3082a2,null))[_0x9c08('0x2c')](saveUpdates(_0x390bb9[_0x9c08('0x98')],null))['then'](respondWithResult(_0x3082a2,null))[_0x9c08('0x50')](handleError(_0x3082a2,null));};exports['delete']=function(_0x469d7d,_0x53d3d6,_0x4e397b){return db[_0x9c08('0x49')][_0x9c08('0x52')]({'where':{'id':_0x469d7d[_0x9c08('0x53')]['id']}})[_0x9c08('0x2c')](function(_0x54a3be){if(_0x54a3be){return _0x54a3be['destroy']();}})[_0x9c08('0x2c')](function(_0x2abd37){rimraf(path[_0x9c08('0x70')](config[_0x9c08('0x54')],_0x9c08('0x55'),path[_0x9c08('0x63')](_0x2abd37[_0x9c08('0x5')])),function(){});return _0x2abd37;})[_0x9c08('0x2c')](handleEntityNotFound(_0x53d3d6,null))['then'](respondWithStatusCode(_0x53d3d6,null))[_0x9c08('0x50')](handleError(_0x53d3d6,null));};exports[_0x9c08('0xa0')]=function(_0x3314c6,_0x38dc73,_0x145ba2){return BPromise['resolve']()[_0x9c08('0x2c')](function(){if(!_0x3314c6[_0x9c08('0x38')][_0x9c08('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x3314c6[_0x9c08('0x38')][_0x9c08('0xa1')]){throw new Error(_0x9c08('0xa2'));}var _0x11a594=_0x3314c6[_0x9c08('0x38')][_0x9c08('0xa3')]?_0x3314c6[_0x9c08('0x38')][_0x9c08('0xa3')]+':'+_0x3314c6['query'][_0x9c08('0xa1')]:_0x9c08('0xa4')+_0x3314c6[_0x9c08('0x38')][_0x9c08('0xa1')];var _0x331f1a=_0x3314c6['query'][_0x9c08('0x21')]?_0x3314c6['query'][_0x9c08('0x21')]:!![];var _0x28c063=_0x3314c6[_0x9c08('0x38')]['encoding']?_0x3314c6[_0x9c08('0x38')][_0x9c08('0xa5')]:null;var _0xd425c1={'method':_0x3314c6[_0x9c08('0xa6')],'uri':util[_0x9c08('0x56')](_0x9c08('0xa7'),_0x11a594,_0x3314c6[_0x9c08('0x38')]['path']),'json':_0x331f1a,'resolveWithFullResponse':!![],'encoding':_0x28c063,'qs':_0x3314c6[_0x9c08('0x38')]};if(_0x3314c6[_0x9c08('0xa8')]){_0xd425c1['headers']=_0x3314c6[_0x9c08('0xa8')];if(_0xd425c1[_0x9c08('0xa8')][_0x9c08('0xa9')]){delete _0xd425c1[_0x9c08('0xa8')]['content-length'];}}if(_0xd425c1['headers'][_0x9c08('0xaa')]){delete _0xd425c1[_0x9c08('0xa8')][_0x9c08('0xaa')];}return rp(_0xd425c1);})[_0x9c08('0x2c')](function(_0x476a3e){if(_0x476a3e){_0x38dc73[_0x9c08('0x26')](_0x476a3e['headers']);logger['info'](_0x476a3e['body']);if(_['endsWith'](_0x3314c6[_0x9c08('0x38')][_0x9c08('0x5')],'download')&&_0x476a3e[_0x9c08('0xab')]==0x1f4){return _0x38dc73[_0x9c08('0x1e')](_0x476a3e['statusCode']);}else{return _0x38dc73[_0x9c08('0x1f')](_0x476a3e[_0x9c08('0xab')])[_0x9c08('0x33')](_0x476a3e[_0x9c08('0x98')]);}}else{return _0x38dc73[_0x9c08('0x1e')](0xc8);}})[_0x9c08('0x50')](handleError(_0x38dc73,null));};exports[_0x9c08('0xac')]=function(_0x1e935e,_0xf3d36b,_0x22a3c3){return BPromise[_0x9c08('0xad')]()[_0x9c08('0x2c')](function(){if(!_0x1e935e[_0x9c08('0x38')][_0x9c08('0x5')]){throw new Error(_0x9c08('0xae'));}if(!_0x1e935e['query'][_0x9c08('0xa1')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x5703e0=_0x1e935e[_0x9c08('0x38')][_0x9c08('0xa3')]?_0x1e935e[_0x9c08('0x38')][_0x9c08('0xa3')]+':'+_0x1e935e['query'][_0x9c08('0xa1')]:'http://localhost:'+_0x1e935e[_0x9c08('0x38')][_0x9c08('0xa1')];var _0x321a3d=_0x1e935e[_0x9c08('0x38')][_0x9c08('0x21')]?_0x1e935e[_0x9c08('0x38')]['json']:!![];var _0x5f84d=_0x1e935e[_0x9c08('0x38')][_0x9c08('0xa5')]?_0x1e935e['query'][_0x9c08('0xa5')]:null;var _0x34e742={'method':_0x1e935e[_0x9c08('0xa6')],'uri':util[_0x9c08('0x56')]('%s%s',_0x5703e0,_0x1e935e['query'][_0x9c08('0x5')]),'json':_0x321a3d,'resolveWithFullResponse':!![],'encoding':_0x5f84d,'body':_0x1e935e[_0x9c08('0x98')]};if(_0x1e935e['headers']){_0x34e742[_0x9c08('0xa8')]=_0x1e935e['headers'];if(_0x34e742[_0x9c08('0xa8')]['content-length']){delete _0x34e742[_0x9c08('0xa8')]['content-length'];}}if(_0x34e742[_0x9c08('0xa8')][_0x9c08('0xaa')]){delete _0x34e742[_0x9c08('0xa8')][_0x9c08('0xaa')];}return rp(_0x34e742);})[_0x9c08('0x2c')](function(_0x576687){if(_0x576687){_0xf3d36b['set'](_0x576687['headers']);logger['info'](_0x576687[_0x9c08('0x98')]);return _0xf3d36b[_0x9c08('0x1f')](_0x576687[_0x9c08('0xab')])['send'](_0x576687[_0x9c08('0x98')]);}else{return _0xf3d36b[_0x9c08('0x1e')](0xc8);}})[_0x9c08('0x50')](handleError(_0xf3d36b,null));};
\ No newline at end of file
+var _0x8d64=['content-length','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','json','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','Plugin','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','download','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','join','dirname','node_modules/**/*','attachments/**/*','existsSync','Plugin\x20not\x20found','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','body','userProfileId','role','user','UserProfileSection','autoAssociation','create','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-type','endsWith','statusCode','\x27PATH\x27\x20parameter\x20not\x20specified'];(function(_0x2c9c6e,_0x107806){var _0x35f387=function(_0x107c46){while(--_0x107c46){_0x2c9c6e['push'](_0x2c9c6e['shift']());}};_0x35f387(++_0x107806);}(_0x8d64,0x15d));var _0x48d6=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0x8d64[_0x18abd2];return _0x1dcad6;};'use strict';var emlformat=require(_0x48d6('0x0'));var rimraf=require(_0x48d6('0x1'));var zipdir=require(_0x48d6('0x2'));var jsonpatch=require(_0x48d6('0x3'));var rp=require(_0x48d6('0x4'));var moment=require(_0x48d6('0x5'));var BPromise=require(_0x48d6('0x6'));var Mustache=require(_0x48d6('0x7'));var util=require(_0x48d6('0x8'));var path=require(_0x48d6('0x9'));var sox=require(_0x48d6('0xa'));var csv=require(_0x48d6('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x48d6('0xc'));var _=require(_0x48d6('0xd'));var squel=require(_0x48d6('0xe'));var crypto=require(_0x48d6('0xf'));var jsforce=require(_0x48d6('0x10'));var deskjs=require(_0x48d6('0x11'));var toCsv=require(_0x48d6('0xb'));var querystring=require(_0x48d6('0x12'));var Papa=require(_0x48d6('0x13'));var extract=require(_0x48d6('0x14'));var rimraf=require(_0x48d6('0x1'));var archiver=require('archiver');var Redis=require('ioredis');var authService=require(_0x48d6('0x15'));var qs=require(_0x48d6('0x16'));var as=require(_0x48d6('0x17'));var hardwareService=require(_0x48d6('0x18'));var logger=require(_0x48d6('0x19'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x48d6('0x1a'));var db=require(_0x48d6('0x1b'))['db'];config[_0x48d6('0x1c')]=_[_0x48d6('0x1d')](config[_0x48d6('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x48d6('0x1e'))(new Redis(config[_0x48d6('0x1c')]));require(_0x48d6('0x1f'))[_0x48d6('0x20')](socket);function respondWithStatusCode(_0x417880,_0x2f2d0c){_0x2f2d0c=_0x2f2d0c||0xcc;return function(_0x571a03){if(_0x571a03){return _0x417880[_0x48d6('0x21')](_0x2f2d0c);}return _0x417880[_0x48d6('0x22')](_0x2f2d0c)[_0x48d6('0x23')]();};}function respondWithResult(_0x5461b5,_0x5f0451){_0x5f0451=_0x5f0451||0xc8;return function(_0x1693c3){if(_0x1693c3){return _0x5461b5[_0x48d6('0x22')](_0x5f0451)[_0x48d6('0x24')](_0x1693c3);}};}function respondWithFilteredResult(_0x40018b,_0x13337c){return function(_0x1cbce5){if(_0x1cbce5){var _0x151add=typeof _0x13337c['offset']==='undefined'&&typeof _0x13337c['limit']===_0x48d6('0x25');var _0x43d255=_0x1cbce5[_0x48d6('0x26')];var _0x273c0d=_0x151add?0x0:_0x13337c['offset'];var _0x48f535=_0x151add?_0x1cbce5[_0x48d6('0x26')]:_0x13337c['offset']+_0x13337c[_0x48d6('0x27')];var _0x268c97;if(_0x48f535>=_0x43d255){_0x48f535=_0x43d255;_0x268c97=0xc8;}else{_0x268c97=0xce;}_0x40018b[_0x48d6('0x22')](_0x268c97);return _0x40018b[_0x48d6('0x28')](_0x48d6('0x29'),_0x273c0d+'-'+_0x48f535+'/'+_0x43d255)[_0x48d6('0x24')](_0x1cbce5);}return null;};}function patchUpdates(_0x53f05b){return function(_0x9b9744){try{jsonpatch[_0x48d6('0x2a')](_0x9b9744,_0x53f05b,!![]);}catch(_0x1fc6b6){return BPromise[_0x48d6('0x2b')](_0x1fc6b6);}return _0x9b9744[_0x48d6('0x2c')]();};}function saveUpdates(_0x30ab5f,_0x345faf){return function(_0x595854){if(_0x595854){return _0x595854[_0x48d6('0x2d')](_0x30ab5f)[_0x48d6('0x2e')](function(_0x560371){return _0x560371;});}return null;};}function removeEntity(_0x5361d9,_0x5f0649){return function(_0x2d0795){if(_0x2d0795){return _0x2d0795['destroy']()['then'](function(){var _0x57996b=_0x2d0795[_0x48d6('0x2f')]({'plain':!![]});var _0x4bb37a='Plugins';return db[_0x48d6('0x30')][_0x48d6('0x31')]({'where':{'type':_0x4bb37a,'resourceId':_0x57996b['id']}})['then'](function(){return _0x2d0795;});})['then'](function(){_0x5361d9[_0x48d6('0x22')](0xcc)[_0x48d6('0x23')]();});}};}function handleEntityNotFound(_0x1b7677,_0x2cfdcd){return function(_0x51025c){if(!_0x51025c){_0x1b7677[_0x48d6('0x21')](0x194);}return _0x51025c;};}function handleError(_0x11ed8d,_0x852bbc){_0x852bbc=_0x852bbc||0x1f4;return function(_0x34ed80){logger[_0x48d6('0x32')](_0x34ed80[_0x48d6('0x33')]);if(_0x34ed80[_0x48d6('0x34')]){delete _0x34ed80[_0x48d6('0x34')];}_0x11ed8d[_0x48d6('0x22')](_0x852bbc)['send'](_0x34ed80);};}exports[_0x48d6('0x35')]=function(_0x3f31df,_0x5a8831){var _0x46c32a={},_0x49dff4={},_0x526c3d={'count':0x0,'rows':[]};var _0x2e9b7e=_['map'](db[_0x48d6('0x36')]['rawAttributes'],function(_0x87f87d){return{'name':_0x87f87d[_0x48d6('0x37')],'type':_0x87f87d[_0x48d6('0x38')]['key']};});_0x49dff4[_0x48d6('0x39')]=_[_0x48d6('0x3a')](_0x2e9b7e,_0x48d6('0x34'));_0x49dff4[_0x48d6('0x3b')]=_[_0x48d6('0x3c')](_0x3f31df[_0x48d6('0x3b')]);_0x49dff4[_0x48d6('0x3d')]=_[_0x48d6('0x3e')](_0x49dff4[_0x48d6('0x39')],_0x49dff4[_0x48d6('0x3b')]);_0x46c32a[_0x48d6('0x3f')]=_[_0x48d6('0x3e')](_0x49dff4[_0x48d6('0x39')],qs[_0x48d6('0x40')](_0x3f31df[_0x48d6('0x3b')]['fields']));_0x46c32a[_0x48d6('0x3f')]=_0x46c32a['attributes'][_0x48d6('0x41')]?_0x46c32a[_0x48d6('0x3f')]:_0x49dff4[_0x48d6('0x39')];if(!_0x3f31df[_0x48d6('0x3b')][_0x48d6('0x42')]('nolimit')){_0x46c32a[_0x48d6('0x27')]=qs[_0x48d6('0x27')](_0x3f31df[_0x48d6('0x3b')]['limit']);_0x46c32a[_0x48d6('0x43')]=qs[_0x48d6('0x43')](_0x3f31df[_0x48d6('0x3b')]['offset']);}_0x46c32a[_0x48d6('0x44')]=qs[_0x48d6('0x45')](_0x3f31df[_0x48d6('0x3b')][_0x48d6('0x45')]);_0x46c32a[_0x48d6('0x46')]=qs['filters'](_[_0x48d6('0x47')](_0x3f31df[_0x48d6('0x3b')],_0x49dff4[_0x48d6('0x3d')]),_0x2e9b7e);if(_0x3f31df['query'][_0x48d6('0x48')]){_0x46c32a[_0x48d6('0x46')]=_[_0x48d6('0x49')](_0x46c32a[_0x48d6('0x46')],{'$or':_[_0x48d6('0x3a')](_0x2e9b7e,function(_0x4d5576){if(_0x4d5576[_0x48d6('0x38')]!==_0x48d6('0x4a')){var _0x3dfc80={};_0x3dfc80[_0x4d5576['name']]={'$like':'%'+_0x3f31df[_0x48d6('0x3b')]['filter']+'%'};return _0x3dfc80;}})});}_0x46c32a=_[_0x48d6('0x49')]({},_0x46c32a,_0x3f31df[_0x48d6('0x4b')]);var _0x4f1816={'where':_0x46c32a[_0x48d6('0x46')]};return db[_0x48d6('0x36')][_0x48d6('0x26')](_0x4f1816)[_0x48d6('0x2e')](function(_0x5ab73b){_0x526c3d[_0x48d6('0x26')]=_0x5ab73b;if(_0x3f31df[_0x48d6('0x3b')][_0x48d6('0x4c')]){_0x46c32a[_0x48d6('0x4d')]=[{'all':!![]}];}return db['Plugin'][_0x48d6('0x4e')](_0x46c32a);})[_0x48d6('0x2e')](function(_0x3cbaaf){_0x526c3d[_0x48d6('0x4f')]=_0x3cbaaf;return _0x526c3d;})[_0x48d6('0x2e')](respondWithFilteredResult(_0x5a8831,_0x46c32a))['catch'](handleError(_0x5a8831,null));};exports['show']=function(_0x5848bf,_0x2da456){var _0x512708={'raw':!![],'where':{'id':_0x5848bf[_0x48d6('0x50')]['id']}},_0x2d894e={};_0x2d894e[_0x48d6('0x39')]=_[_0x48d6('0x3c')](db[_0x48d6('0x36')][_0x48d6('0x51')]);_0x2d894e[_0x48d6('0x3b')]=_[_0x48d6('0x3c')](_0x5848bf[_0x48d6('0x3b')]);_0x2d894e[_0x48d6('0x3d')]=_['intersection'](_0x2d894e[_0x48d6('0x39')],_0x2d894e[_0x48d6('0x3b')]);_0x512708[_0x48d6('0x3f')]=_[_0x48d6('0x3e')](_0x2d894e[_0x48d6('0x39')],qs[_0x48d6('0x40')](_0x5848bf[_0x48d6('0x3b')]['fields']));_0x512708[_0x48d6('0x3f')]=_0x512708['attributes']['length']?_0x512708[_0x48d6('0x3f')]:_0x2d894e[_0x48d6('0x39')];if(_0x5848bf[_0x48d6('0x3b')][_0x48d6('0x4c')]){_0x512708[_0x48d6('0x4d')]=[{'all':!![]}];}_0x512708=_['merge']({},_0x512708,_0x5848bf[_0x48d6('0x4b')]);return db[_0x48d6('0x36')][_0x48d6('0x52')](_0x512708)[_0x48d6('0x2e')](handleEntityNotFound(_0x2da456,null))[_0x48d6('0x2e')](respondWithResult(_0x2da456,null))[_0x48d6('0x53')](handleError(_0x2da456,null));};exports[_0x48d6('0x54')]=function(_0x4b89f3,_0x5ed58b,_0x5f819c){return db[_0x48d6('0x36')]['find']({'where':{'id':_0x4b89f3['params']['id']},'attributes':[_0x48d6('0x34'),'path'],'raw':!![]})[_0x48d6('0x2e')](handleEntityNotFound(_0x5ed58b,null))[_0x48d6('0x2e')](function(_0x52b092){if(_0x52b092){var _0x8471c2=path['join'](config[_0x48d6('0x55')],_0x48d6('0x56'),util[_0x48d6('0x57')](_0x48d6('0x58'),path[_0x48d6('0x59')](_0x52b092[_0x48d6('0x9')])));var _0x52ebcf=fs[_0x48d6('0x5a')](_0x8471c2);var _0x5ea62f=archiver(_0x48d6('0x5b'),{'zlib':{'level':0x9}});_0x5ea62f['on'](_0x48d6('0x5c'),function(_0x456410){if(_0x456410[_0x48d6('0x5d')]===_0x48d6('0x5e')){logger[_0x48d6('0x32')](_0x456410);}else{throw new db[(_0x48d6('0x5f'))][(_0x48d6('0x60'))](_0x48d6('0x61'));}});_0x5ea62f['on'](_0x48d6('0x32'),function(_0x97a682){throw new db['Sequelize']['Error'](_0x48d6('0x61'));});_0x5ea62f[_0x48d6('0x62')](_0x52ebcf);_0x5ea62f[_0x48d6('0x63')](_0x48d6('0x64'),{'cwd':path[_0x48d6('0x65')](config['root'],_0x48d6('0x56'),path[_0x48d6('0x66')](_0x52b092[_0x48d6('0x9')])),'ignore':[path[_0x48d6('0x65')](path[_0x48d6('0x59')](_0x52b092[_0x48d6('0x9')]),_0x48d6('0x67')),path[_0x48d6('0x65')](path[_0x48d6('0x59')](_0x52b092[_0x48d6('0x9')]),_0x48d6('0x68'))],'nodir':!![]})['finalize']();_0x52ebcf['on']('close',function(){if(!fs[_0x48d6('0x69')](_0x8471c2)){throw new db[(_0x48d6('0x5f'))][(_0x48d6('0x60'))](_0x48d6('0x6a'));}return _0x5ed58b[_0x48d6('0x54')](_0x8471c2,util[_0x48d6('0x57')](_0x48d6('0x58'),path[_0x48d6('0x59')](_0x52b092[_0x48d6('0x9')])),function(_0x17e363){if(_0x17e363){throw new db[(_0x48d6('0x5f'))][(_0x48d6('0x60'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x8471c2);logger[_0x48d6('0x6b')](_0x48d6('0x6c'));logger['info'](_0x48d6('0x6d'));});});}return null;})[_0x48d6('0x53')](handleError(_0x5ed58b,null));};exports[_0x48d6('0x6e')]=function(_0x86e6a,_0x3b5a00,_0x5e5601){var _0x5ddbf4=path[_0x48d6('0x59')](_0x86e6a[_0x48d6('0x6f')][_0x48d6('0x70')],path[_0x48d6('0x71')](_0x86e6a[_0x48d6('0x6f')][_0x48d6('0x70')]));var _0x5f0903=path['join'](config['root'],_0x48d6('0x56'),_0x86e6a[_0x48d6('0x6f')][_0x48d6('0x70')]);var _0x23582f=path[_0x48d6('0x65')](config['root'],_0x48d6('0x56'),_0x5ddbf4);logger[_0x48d6('0x6b')](_0x48d6('0x72'),_0x5f0903);logger[_0x48d6('0x6b')]('Plugin\x20upload\x20destination:\x20%s',_0x23582f);try{fs[_0x48d6('0x73')](_0x5f0903,parseInt(_0x48d6('0x74'),0x8));extract(_0x5f0903,{'dir':_0x23582f},function(_0x4863b4){if(_0x4863b4){logger[_0x48d6('0x32')](_0x4863b4);handleError(_0x4863b4,!![]);};var _0x537d9e=fs[_0x48d6('0x75')](_0x23582f);if(_0x537d9e[_0x48d6('0x41')]>0x1){removeReferences(_0x5f0903,_0x23582f);logger[_0x48d6('0x32')]('Invalid\x20plugin\x20structure');return _0x5e5601(new Error(_0x48d6('0x76')));}var _0x592a84=fs[_0x48d6('0x77')](path[_0x48d6('0x65')](_0x23582f,_0x537d9e[0x0]));if(_0x592a84['isFile']()){removeReferences(_0x5f0903,_0x23582f);logger['error'](_0x48d6('0x76'));return _0x5e5601(new Error(_0x48d6('0x76')));}if(_0x592a84[_0x48d6('0x78')]()){var _0x3b8388=fs[_0x48d6('0x75')](path[_0x48d6('0x65')](_0x23582f,_0x537d9e[0x0]));if(_0x3b8388[_0x48d6('0x41')]===0x0){removeReferences(_0x5f0903,_0x23582f);logger[_0x48d6('0x32')](_0x48d6('0x76'));return _0x5e5601(new Error(_0x48d6('0x76')));}var _0x543173=_0x3b8388['some'](function(_0x2ea0e3){return _0x2ea0e3===_0x48d6('0x79');});if(!_0x543173){return _0x5e5601(new Error('Plugin\x20manifest\x20missing'));}var _0x24edb8=fs[_0x48d6('0x7a')](path['join'](_0x23582f,_0x537d9e[0x0],_0x48d6('0x79')));var _0x4ccfec=JSON[_0x48d6('0x7b')](_0x24edb8);if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x34')]){return _0x5e5601(new Error(_0x48d6('0x7c')));}if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x38')]){return _0x5e5601(new Error(_0x48d6('0x7d')));}if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x7e')]){return _0x5e5601(new Error(_0x48d6('0x7f')));}if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x80')]){return _0x5e5601(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4ccfec[_0x48d6('0x38')]===_0x48d6('0x81')){if(_0x48d6('0x25')==typeof _0x4ccfec['parameters'][_0x48d6('0x82')]){return _0x5e5601(new Error(_0x48d6('0x83')));}if('undefined'==typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')][_0x48d6('0x84')]&&_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')][_0x48d6('0x85')]){return _0x5e5601(new Error(_0x48d6('0x86')));}}else if(_0x4ccfec['type']===_0x48d6('0x87')){if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x88')]){return _0x5e5601(new Error(_0x48d6('0x89')));}if(_0x48d6('0x25')==typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x8a')]){return _0x5e5601(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x5e5601(new Error(_0x48d6('0x8b')));}var _0x2b590d=_0x4ccfec['name'];var _0x5e8d23=_0x4ccfec['description'];var _0x2c5be2=_0x4ccfec[_0x48d6('0x38')];var _0x464c07=_0x4ccfec[_0x48d6('0x8c')]?_0x4ccfec[_0x48d6('0x8c')]:_0x48d6('0x8d');var _0x5352a6=_0x4ccfec[_0x48d6('0x8e')]?_0x4ccfec['icon']:_0x48d6('0x8f');var _0x223240='';var _0x4eb647='';var _0x3ebfc7='';var _0x1b0ae3='';var _0x5a6c87=_0x4ccfec[_0x48d6('0x7e')];if(_0x2c5be2===_0x48d6('0x81')){if(_0x48d6('0x25')!=typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')][_0x48d6('0x84')]){var _0x5a1aa0=_0x4ccfec[_0x48d6('0x80')]['views'][_0x48d6('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x48d6('0x90')](_0x5a1aa0)){_0x223240=path[_0x48d6('0x65')]('plugins',_0x5ddbf4,_0x537d9e[0x0],_0x5a1aa0);}else{_0x223240=_0x5a1aa0;}}else{logger[_0x48d6('0x6b')](_0x48d6('0x91'));}if(_0x48d6('0x25')!=typeof _0x4ccfec['parameters'][_0x48d6('0x82')][_0x48d6('0x85')]){var _0x1fb928=_0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x48d6('0x90')](_0x1fb928)){_0x4eb647=path['join'](_0x48d6('0x92'),_0x5ddbf4,_0x537d9e[0x0],_0x1fb928);}else{_0x4eb647=_0x1fb928;}}else{logger[_0x48d6('0x6b')](_0x48d6('0x93'));}}else if(_0x2c5be2===_0x48d6('0x87')){_0x3ebfc7=_0x4ccfec['parameters'][_0x48d6('0x88')];_0x1b0ae3=_0x4ccfec[_0x48d6('0x80')][_0x48d6('0x8a')];if(_0x48d6('0x25')!=typeof _0x4ccfec['parameters'][_0x48d6('0x82')]){if(_0x48d6('0x25')!=typeof _0x4ccfec['parameters']['views'][_0x48d6('0x84')]){var _0x5a1aa0=_0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')][_0x48d6('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x48d6('0x90')](_0x5a1aa0)){_0x223240=path['join'](_0x48d6('0x92'),_0x5ddbf4,_0x537d9e[0x0],_0x5a1aa0);}else{_0x223240=_0x5a1aa0;}}if(_0x48d6('0x25')!=typeof _0x4ccfec[_0x48d6('0x80')][_0x48d6('0x82')][_0x48d6('0x85')]){var _0x1fb928=_0x4ccfec['parameters'][_0x48d6('0x82')][_0x48d6('0x85')];if(!/^(f|ht)tps?:\/\//i['test'](_0x1fb928)){_0x4eb647=path['join'](_0x48d6('0x92'),_0x5ddbf4,_0x537d9e[0x0],_0x1fb928);}else{_0x4eb647=_0x1fb928;}}}}var _0x2a397b={'name':_0x2b590d,'description':_0x5e8d23,'path':path['join'](_0x5ddbf4,_0x537d9e[0x0]),'type':_0x2c5be2,'sidebar':_0x464c07,'icon':_0x5352a6,'adminUrl':_0x223240,'agentUrl':_0x4eb647,'scriptName':_0x3ebfc7,'scriptPath':_0x1b0ae3,'version':_0x5a6c87};removeReferences(_0x5f0903,null);return db[_0x48d6('0x36')]['create'](_0x2a397b)['then'](function(_0x273285){var _0xb7075b={'role':_0x86e6a[_0x48d6('0x94')]['role'],'userProfileId':_0x86e6a[_0x48d6('0x94')][_0x48d6('0x95')]};if(!_0xb7075b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb7075b[_0x48d6('0x96')]===_0x48d6('0x97')){var _0x176d3b=_0x273285['get']({'plain':!![]});return db[_0x48d6('0x98')][_0x48d6('0x52')]({'where':{'name':'Plugins','userProfileId':_0xb7075b[_0x48d6('0x95')]},'raw':!![]})[_0x48d6('0x2e')](function(_0x4c258b){if(_0x4c258b&&_0x4c258b[_0x48d6('0x99')]===0x0){return db[_0x48d6('0x30')][_0x48d6('0x9a')]({'name':_0x176d3b[_0x48d6('0x34')],'resourceId':_0x176d3b['id'],'type':_0x4c258b[_0x48d6('0x34')],'sectionId':_0x4c258b['id']},{})[_0x48d6('0x2e')](function(){return _0x273285;});}else{return _0x273285;}})[_0x48d6('0x53')](function(_0x5159c4){logger['error'](_0x48d6('0x9b'),_0x5159c4);throw _0x5159c4;});}return _0x273285;})[_0x48d6('0x2e')](respondWithResult(_0x3b5a00,null))[_0x48d6('0x53')](handleError(_0x3b5a00,null));}});}catch(_0x370dd0){_0x3b5a00[_0x48d6('0x22')](0x1f4)[_0x48d6('0x9c')](_0x370dd0);}};function removeReferences(_0x2abeb2,_0x45d9bf){try{if(_0x2abeb2){fs['unlinkSync'](_0x2abeb2);logger[_0x48d6('0x6b')](_0x48d6('0x9d'));}if(_0x45d9bf){rimraf(_0x45d9bf,function(){});logger['info'](_0x48d6('0x9e'));}}catch(_0x5caa60){logger[_0x48d6('0x32')](_0x5caa60);}}exports[_0x48d6('0x2d')]=function(_0xee1db7,_0x44e41e,_0x14ba82){return db[_0x48d6('0x36')][_0x48d6('0x52')]({'where':{'id':_0xee1db7[_0x48d6('0x50')]['id']}})[_0x48d6('0x2e')](handleEntityNotFound(_0x44e41e,null))[_0x48d6('0x2e')](saveUpdates(_0xee1db7[_0x48d6('0x94')],null))[_0x48d6('0x2e')](respondWithResult(_0x44e41e,null))['catch'](handleError(_0x44e41e,null));};exports[_0x48d6('0x9f')]=function(_0x14ee21,_0x2e56ac,_0x561eff){return db[_0x48d6('0x36')][_0x48d6('0x52')]({'where':{'id':_0x14ee21[_0x48d6('0x50')]['id']}})['then'](function(_0x3d1c96){if(_0x3d1c96){return _0x3d1c96[_0x48d6('0x31')]();}})[_0x48d6('0x2e')](function(_0x5ed174){rimraf(path[_0x48d6('0x65')](config[_0x48d6('0x55')],_0x48d6('0x56'),path[_0x48d6('0x66')](_0x5ed174[_0x48d6('0x9')])),function(){});return _0x5ed174;})[_0x48d6('0x2e')](handleEntityNotFound(_0x2e56ac,null))['then'](respondWithStatusCode(_0x2e56ac,null))['catch'](handleError(_0x2e56ac,null));};exports['webhookGet']=function(_0x51f636,_0x4ed075,_0x3035ed){return BPromise[_0x48d6('0xa0')]()['then'](function(){if(!_0x51f636[_0x48d6('0x3b')][_0x48d6('0x9')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x51f636['query'][_0x48d6('0xa1')]){throw new Error(_0x48d6('0xa2'));}var _0x2938ea=_0x51f636['query'][_0x48d6('0xa3')]?_0x51f636[_0x48d6('0x3b')][_0x48d6('0xa3')]+':'+_0x51f636[_0x48d6('0x3b')]['port']:_0x48d6('0xa4')+_0x51f636['query'][_0x48d6('0xa1')];var _0xb52b97=_0x51f636[_0x48d6('0x3b')][_0x48d6('0x24')]?_0x51f636[_0x48d6('0x3b')][_0x48d6('0x24')]:!![];var _0x2bbc11=_0x51f636[_0x48d6('0x3b')]['encoding']?_0x51f636[_0x48d6('0x3b')][_0x48d6('0xa5')]:null;var _0x5798b1={'method':_0x51f636[_0x48d6('0xa6')],'uri':util['format'](_0x48d6('0xa7'),_0x2938ea,_0x51f636['query'][_0x48d6('0x9')]),'json':_0xb52b97,'resolveWithFullResponse':!![],'encoding':_0x2bbc11,'qs':_0x51f636[_0x48d6('0x3b')]};if(_0x51f636[_0x48d6('0xa8')]){_0x5798b1[_0x48d6('0xa8')]=_0x51f636[_0x48d6('0xa8')];if(_0x5798b1[_0x48d6('0xa8')]['content-length']){delete _0x5798b1[_0x48d6('0xa8')]['content-length'];}}if(_0x5798b1[_0x48d6('0xa8')][_0x48d6('0xa9')]){delete _0x5798b1[_0x48d6('0xa8')][_0x48d6('0xa9')];}return rp(_0x5798b1);})[_0x48d6('0x2e')](function(_0x105711){if(_0x105711){_0x4ed075[_0x48d6('0x28')](_0x105711[_0x48d6('0xa8')]);logger['info'](_0x105711[_0x48d6('0x94')]);if(_[_0x48d6('0xaa')](_0x51f636['query'][_0x48d6('0x9')],'download')&&_0x105711[_0x48d6('0xab')]==0x1f4){return _0x4ed075[_0x48d6('0x21')](_0x105711[_0x48d6('0xab')]);}else{return _0x4ed075[_0x48d6('0x22')](_0x105711[_0x48d6('0xab')])[_0x48d6('0x9c')](_0x105711[_0x48d6('0x94')]);}}else{return _0x4ed075[_0x48d6('0x21')](0xc8);}})[_0x48d6('0x53')](handleError(_0x4ed075,null));};exports['webhookPost']=function(_0x5f0da8,_0x17bb7d,_0x42e39c){return BPromise[_0x48d6('0xa0')]()[_0x48d6('0x2e')](function(){if(!_0x5f0da8['query'][_0x48d6('0x9')]){throw new Error(_0x48d6('0xac'));}if(!_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0xa1')]){throw new Error(_0x48d6('0xa2'));}var _0x481563=_0x5f0da8['query'][_0x48d6('0xa3')]?_0x5f0da8[_0x48d6('0x3b')]['hostname']+':'+_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0xa1')]:_0x48d6('0xa4')+_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0xa1')];var _0x393cd6=_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0x24')]?_0x5f0da8['query'][_0x48d6('0x24')]:!![];var _0x895585=_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0xa5')]?_0x5f0da8['query'][_0x48d6('0xa5')]:null;var _0x1501f0={'method':_0x5f0da8['method'],'uri':util['format'](_0x48d6('0xa7'),_0x481563,_0x5f0da8[_0x48d6('0x3b')][_0x48d6('0x9')]),'json':_0x393cd6,'resolveWithFullResponse':!![],'encoding':_0x895585,'body':_0x5f0da8['body']};if(_0x5f0da8[_0x48d6('0xa8')]){_0x1501f0['headers']=_0x5f0da8[_0x48d6('0xa8')];if(_0x1501f0[_0x48d6('0xa8')][_0x48d6('0xad')]){delete _0x1501f0[_0x48d6('0xa8')][_0x48d6('0xad')];}}if(_0x1501f0['headers']['content-type']){delete _0x1501f0[_0x48d6('0xa8')][_0x48d6('0xa9')];}return rp(_0x1501f0);})[_0x48d6('0x2e')](function(_0x239f83){if(_0x239f83){_0x17bb7d[_0x48d6('0x28')](_0x239f83['headers']);logger[_0x48d6('0x6b')](_0x239f83[_0x48d6('0x94')]);return _0x17bb7d['status'](_0x239f83[_0x48d6('0xab')])[_0x48d6('0x9c')](_0x239f83['body']);}else{return _0x17bb7d[_0x48d6('0x21')](0xc8);}})[_0x48d6('0x53')](handleError(_0x17bb7d,null));};
\ No newline at end of file
index 45317ae..c50eb61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33ac=['../../mysqldb','save','update','remove','emit','exports'];(function(_0x1149a4,_0x4236dd){var _0x1ffcea=function(_0x2458e2){while(--_0x2458e2){_0x1149a4['push'](_0x1149a4['shift']());}};_0x1ffcea(++_0x4236dd);}(_0x33ac,0x1f2));var _0xc33a=function(_0x8e97f3,_0x3cfba9){_0x8e97f3=_0x8e97f3-0x0;var _0x286c97=_0x33ac[_0x8e97f3];return _0x286c97;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xc33a('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc33a('0x1'),'afterUpdate':_0xc33a('0x2'),'afterDestroy':_0xc33a('0x3')};function emitEvent(_0x2b7f66){return function(_0x380461,_0xf33498,_0x477d0b){PluginEvents[_0xc33a('0x4')](_0x2b7f66+':'+_0x380461['id'],_0x380461);PluginEvents[_0xc33a('0x4')](_0x2b7f66,_0x380461);_0x477d0b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0xc33a('0x5')]=PluginEvents;
\ No newline at end of file
+var _0x8efc=['hasOwnProperty','hook','exports','Plugin','save','remove','emit'];(function(_0x1099d5,_0xc7ebe8){var _0x466bc1=function(_0x84e2da){while(--_0x84e2da){_0x1099d5['push'](_0x1099d5['shift']());}};_0x466bc1(++_0xc7ebe8);}(_0x8efc,0x8f));var _0xc8ef=function(_0x119e7a,_0x3949d3){_0x119e7a=_0x119e7a-0x0;var _0x1fb90a=_0x8efc[_0x119e7a];return _0x1fb90a;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0xc8ef('0x0')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc8ef('0x1'),'afterUpdate':'update','afterDestroy':_0xc8ef('0x2')};function emitEvent(_0xb39bee){return function(_0x4dbf24,_0x4ee0cc,_0x13b577){PluginEvents['emit'](_0xb39bee+':'+_0x4dbf24['id'],_0x4dbf24);PluginEvents[_0xc8ef('0x3')](_0xb39bee,_0x4dbf24);_0x13b577(null);};}for(var e in events){if(events[_0xc8ef('0x4')](e)){var event=events[e];Plugin[_0xc8ef('0x5')](e,emitEvent(event));}}module[_0xc8ef('0x6')]=PluginEvents;
\ No newline at end of file
index 64aa589..9706e94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf46=['rimraf','exports','define','Plugin','lodash','moment','path'];(function(_0x9489f0,_0x23eb38){var _0x845027=function(_0x57fbd2){while(--_0x57fbd2){_0x9489f0['push'](_0x9489f0['shift']());}};_0x845027(++_0x23eb38);}(_0xbf46,0x107));var _0x6bf4=function(_0x5b9598,_0x135d60){_0x5b9598=_0x5b9598-0x0;var _0x57bec1=_0xbf46[_0x5b9598];return _0x57bec1;};'use strict';var _=require(_0x6bf4('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6bf4('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6bf4('0x2'));var rimraf=require(_0x6bf4('0x3'));var config=require('../../config/environment');var attributes=require('./plugin.attributes');module[_0x6bf4('0x4')]=function(_0x89c53b,_0x3d0ae5){return _0x89c53b[_0x6bf4('0x5')](_0x6bf4('0x6'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0993=['./plugin.attributes','exports','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0x0993,0x13c));var _0x3099=function(_0x31e2b1,_0x3e6a08){_0x31e2b1=_0x31e2b1-0x0;var _0x10c4fc=_0x0993[_0x31e2b1];return _0x10c4fc;};'use strict';var _=require(_0x3099('0x0'));var util=require(_0x3099('0x1'));var logger=require(_0x3099('0x2'))(_0x3099('0x3'));var moment=require(_0x3099('0x4'));var BPromise=require(_0x3099('0x5'));var rp=require(_0x3099('0x6'));var fs=require('fs');var path=require(_0x3099('0x7'));var rimraf=require('rimraf');var config=require(_0x3099('0x8'));var attributes=require(_0x3099('0x9'));module[_0x3099('0xa')]=function(_0x562d2c,_0x479e3a){return _0x562d2c['define'](_0x3099('0xb'),attributes,{'tableName':_0x3099('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 03a8a4c..1524159 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb1f=['result','catch','CreatePlugin','Plugin','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xfb1f,0x152));var _0xffb1=function(_0x5cff70,_0x537d97){_0x5cff70=_0x5cff70-0x0;var _0xaee127=_0xfb1f[_0x5cff70];return _0xaee127;};'use strict';var _=require(_0xffb1('0x0'));var util=require(_0xffb1('0x1'));var moment=require(_0xffb1('0x2'));var BPromise=require(_0xffb1('0x3'));var rs=require(_0xffb1('0x4'));var fs=require('fs');var Redis=require(_0xffb1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xffb1('0x6'));var logger=require(_0xffb1('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xffb1('0x8'));var client=jayson[_0xffb1('0x9')][_0xffb1('0xa')]({'port':0x232a});config[_0xffb1('0xb')]=_[_0xffb1('0xc')](config[_0xffb1('0xb')],{'host':_0xffb1('0xd'),'port':0x18eb});var socket=require(_0xffb1('0xe'))(new Redis(config[_0xffb1('0xb')]));require(_0xffb1('0xf'))[_0xffb1('0x10')](socket);function respondWithRpcPromise(_0x2a7236,_0x17ab13,_0x3dbf12){return new BPromise(function(_0x2557e2,_0xb4ce52){return client['request'](_0x2a7236,_0x3dbf12)[_0xffb1('0x11')](function(_0x4238be){logger[_0xffb1('0x12')](_0xffb1('0x13'),_0x17ab13,_0xffb1('0x14'));logger[_0xffb1('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x17ab13,_0xffb1('0x14'),JSON['stringify'](_0x4238be));if(_0x4238be[_0xffb1('0x16')]){if(_0x4238be[_0xffb1('0x16')][_0xffb1('0x17')]===0x1f4){logger[_0xffb1('0x16')]('Plugin,\x20%s,\x20%s',_0x17ab13,_0x4238be[_0xffb1('0x16')]['message']);return _0xb4ce52(_0x4238be['error'][_0xffb1('0x18')]);}logger['error']('Plugin,\x20%s,\x20%s',_0x17ab13,_0x4238be['error'][_0xffb1('0x18')]);return _0x2557e2(_0x4238be['error'][_0xffb1('0x18')]);}else{logger[_0xffb1('0x12')]('Plugin,\x20%s,\x20%s',_0x17ab13,_0xffb1('0x14'));_0x2557e2(_0x4238be[_0xffb1('0x19')]['message']);}})[_0xffb1('0x1a')](function(_0x33255e){logger['error'](_0xffb1('0x13'),_0x17ab13,_0x33255e);_0xb4ce52(_0x33255e);});});}exports[_0xffb1('0x1b')]=function(_0x2ea8ba){var _0x5f28d7=this;return new Promise(function(_0x1e45a3,_0x3b218f){return db[_0xffb1('0x1c')]['create'](_0x2ea8ba[_0xffb1('0x1d')],{'raw':_0x2ea8ba[_0xffb1('0x1e')]?_0x2ea8ba[_0xffb1('0x1e')][_0xffb1('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x3156ee){logger[_0xffb1('0x12')](_0xffb1('0x1b'),_0x2ea8ba);logger[_0xffb1('0x15')](_0xffb1('0x1b'),_0x2ea8ba,JSON[_0xffb1('0x20')](_0x3156ee));_0x1e45a3(_0x3156ee);})[_0xffb1('0x1a')](function(_0x580f81){logger[_0xffb1('0x16')]('CreatePlugin',_0x580f81[_0xffb1('0x18')],_0x2ea8ba);_0x3b218f(_0x5f28d7[_0xffb1('0x16')](0x1f4,_0x580f81[_0xffb1('0x18')]));});});};
\ No newline at end of file
+var _0x910d=['body','raw','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./plugin.socket','register','request','then','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','Plugin,\x20%s,\x20%s','result','catch','CreatePlugin','Plugin','create'];(function(_0x4699d4,_0x1f20d1){var _0x27ca3e=function(_0x3a9c65){while(--_0x3a9c65){_0x4699d4['push'](_0x4699d4['shift']());}};_0x27ca3e(++_0x1f20d1);}(_0x910d,0x179));var _0xd910=function(_0x499549,_0x2e069b){_0x499549=_0x499549-0x0;var _0x51f5ff=_0x910d[_0x499549];return _0x51f5ff;};'use strict';var _=require(_0xd910('0x0'));var util=require('util');var moment=require(_0xd910('0x1'));var BPromise=require('bluebird');var rs=require(_0xd910('0x2'));var fs=require('fs');var Redis=require(_0xd910('0x3'));var db=require(_0xd910('0x4'))['db'];var utils=require(_0xd910('0x5'));var logger=require(_0xd910('0x6'))(_0xd910('0x7'));var config=require(_0xd910('0x8'));var jayson=require(_0xd910('0x9'));var client=jayson[_0xd910('0xa')][_0xd910('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd910('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xd910('0xd'))(new Redis(config[_0xd910('0xc')]));require(_0xd910('0xe'))[_0xd910('0xf')](socket);function respondWithRpcPromise(_0x1c52d9,_0x207651,_0xd4c742){return new BPromise(function(_0x563fd7,_0x83b2fb){return client[_0xd910('0x10')](_0x1c52d9,_0xd4c742)[_0xd910('0x11')](function(_0x3717ac){logger['info']('Plugin,\x20%s,\x20%s',_0x207651,_0xd910('0x12'));logger['debug'](_0xd910('0x13'),_0x207651,_0xd910('0x12'),JSON[_0xd910('0x14')](_0x3717ac));if(_0x3717ac[_0xd910('0x15')]){if(_0x3717ac[_0xd910('0x15')][_0xd910('0x16')]===0x1f4){logger[_0xd910('0x15')]('Plugin,\x20%s,\x20%s',_0x207651,_0x3717ac['error'][_0xd910('0x17')]);return _0x83b2fb(_0x3717ac[_0xd910('0x15')][_0xd910('0x17')]);}logger[_0xd910('0x15')]('Plugin,\x20%s,\x20%s',_0x207651,_0x3717ac['error'][_0xd910('0x17')]);return _0x563fd7(_0x3717ac['error'][_0xd910('0x17')]);}else{logger[_0xd910('0x18')](_0xd910('0x19'),_0x207651,'request\x20sent');_0x563fd7(_0x3717ac[_0xd910('0x1a')]['message']);}})[_0xd910('0x1b')](function(_0x535f7b){logger[_0xd910('0x15')](_0xd910('0x19'),_0x207651,_0x535f7b);_0x83b2fb(_0x535f7b);});});}exports[_0xd910('0x1c')]=function(_0x20252){var _0x114a51=this;return new Promise(function(_0x1d68c8,_0x5293ed){return db[_0xd910('0x1d')][_0xd910('0x1e')](_0x20252[_0xd910('0x1f')],{'raw':_0x20252['options']?_0x20252['options'][_0xd910('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x144924){logger[_0xd910('0x18')](_0xd910('0x1c'),_0x20252);logger[_0xd910('0x21')](_0xd910('0x1c'),_0x20252,JSON[_0xd910('0x14')](_0x144924));_0x1d68c8(_0x144924);})[_0xd910('0x1b')](function(_0x39711c){logger['error'](_0xd910('0x1c'),_0x39711c[_0xd910('0x17')],_0x20252);_0x5293ed(_0x114a51[_0xd910('0x15')](0x1f4,_0x39711c[_0xd910('0x17')]));});});};
\ No newline at end of file
index 52e0cf2..7ec5ec1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ccd=['removeListener','register','plugin:','./plugin.events','save','update','emit'];(function(_0x373d0d,_0x292405){var _0x3b2f68=function(_0x2bc02f){while(--_0x2bc02f){_0x373d0d['push'](_0x373d0d['shift']());}};_0x3b2f68(++_0x292405);}(_0x7ccd,0x1d1));var _0xd7cc=function(_0x445f07,_0x18cda1){_0x445f07=_0x445f07-0x0;var _0x2375cd=_0x7ccd[_0x445f07];return _0x2375cd;};'use strict';var PluginEvents=require(_0xd7cc('0x0'));var events=[_0xd7cc('0x1'),'remove',_0xd7cc('0x2')];function createListener(_0x2fe382,_0x2844fa){return function(_0x2342e7){_0x2844fa[_0xd7cc('0x3')](_0x2fe382,_0x2342e7);};}function removeListener(_0x159a48,_0x821ac2){return function(){PluginEvents[_0xd7cc('0x4')](_0x159a48,_0x821ac2);};}exports[_0xd7cc('0x5')]=function(_0xd25545){for(var _0x431ee3=0x0,_0xbb835d=events['length'];_0x431ee3<_0xbb835d;_0x431ee3++){var _0x543358=events[_0x431ee3];var _0x59f1f8=createListener(_0xd7cc('0x6')+_0x543358,_0xd25545);PluginEvents['on'](_0x543358,_0x59f1f8);}};
\ No newline at end of file
+var _0xcd1c=['update','emit','removeListener','length','./plugin.events','save'];(function(_0x262bdf,_0x48e13c){var _0x54744d=function(_0x2e867a){while(--_0x2e867a){_0x262bdf['push'](_0x262bdf['shift']());}};_0x54744d(++_0x48e13c);}(_0xcd1c,0x124));var _0xccd1=function(_0x255dd7,_0x502dd6){_0x255dd7=_0x255dd7-0x0;var _0x1feee3=_0xcd1c[_0x255dd7];return _0x1feee3;};'use strict';var PluginEvents=require(_0xccd1('0x0'));var events=[_0xccd1('0x1'),'remove',_0xccd1('0x2')];function createListener(_0x12ff5e,_0x4492c8){return function(_0x3244cc){_0x4492c8[_0xccd1('0x3')](_0x12ff5e,_0x3244cc);};}function removeListener(_0x33eab7,_0x2abcc4){return function(){PluginEvents[_0xccd1('0x4')](_0x33eab7,_0x2abcc4);};}exports['register']=function(_0x190dfd){for(var _0x45a842=0x0,_0xcda4b9=events[_0xccd1('0x5')];_0x45a842<_0xcda4b9;_0x45a842++){var _0x66ae8=events[_0x45a842];var _0x5e76e8=createListener('plugin:'+_0x66ae8,_0x190dfd);PluginEvents['on'](_0x66ae8,_0x5e76e8);}};
\ No newline at end of file
index 00f96d5..244ff85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x534cb4,_0x2532ef){var _0x5cdd6f=function(_0x4a06e9){while(--_0x4a06e9){_0x534cb4['push'](_0x534cb4['shift']());}};_0x5cdd6f(++_0x2532ef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
+var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x43400d,_0xa36a10){var _0xd304cf=function(_0x1a9ccb){while(--_0x1a9ccb){_0x43400d['push'](_0x43400d['shift']());}};_0xd304cf(++_0xa36a10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router;
\ No newline at end of file
index 9bd354b..3543aed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2750=['exec','bluebird','sendStatus','status','json','error','name','send','npm\x20install','info','list','then','motion2','catch','body','script','../../files/plugins','cwd','dirname','chdir','dump','Missing\x20name\x20and/or\x20path','stop','hasOwnProperty','params','Unknown\x20status','destroy','lodash','../../config/logger','api','path','child_process'];(function(_0x5e35e1,_0x164e73){var _0x462511=function(_0x4c0447){while(--_0x4c0447){_0x5e35e1['push'](_0x5e35e1['shift']());}};_0x462511(++_0x164e73);}(_0x2750,0x13b));var _0x0275=function(_0x17782c,_0x59614f){_0x17782c=_0x17782c-0x0;var _0x2a77a4=_0x2750[_0x17782c];return _0x2a77a4;};'use strict';var _=require(_0x0275('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x0275('0x1'))(_0x0275('0x2'));var path=require(_0x0275('0x3'));var exec=require(_0x0275('0x4'))[_0x0275('0x5')];var BPromise=require(_0x0275('0x6'));function handleEntityNotFound(_0x20273d,_0x4960){return function(_0x3d0c9c){if(!_0x3d0c9c){_0x20273d[_0x0275('0x7')](0x194);;}return _0x3d0c9c;};}function respondWithResult(_0x5953f9,_0x3f645f){_0x3f645f=_0x3f645f||0xc8;return function(_0x2421fd){if(_0x2421fd){return _0x5953f9[_0x0275('0x8')](_0x3f645f)[_0x0275('0x9')](_0x2421fd);}return null;};}function handleError(_0x4dffd1,_0x1f7c4a){_0x1f7c4a=_0x1f7c4a||0x1f4;return function(_0x30632d){logger[_0x0275('0xa')](_0x30632d['stack']);if(_0x30632d['name']){delete _0x30632d[_0x0275('0xb')];}_0x4dffd1['status'](_0x1f7c4a)[_0x0275('0xc')](_0x30632d);};}function execChildProcess(){return new BPromise(function(_0x377087,_0x14f68c){exec(_0x0275('0xd'),function(_0x14bc3e,_0x5ae208,_0x2e8723){logger[_0x0275('0xe')](_0x5ae208);logger[_0x0275('0xe')](_0x2e8723);if(_0x14bc3e){logger['error'](_0x14bc3e);return _0x14f68c(_0x14bc3e);}return _0x377087(_0x5ae208);});});}exports['index']=function(_0x292f93,_0x395398){return pm2[_0x0275('0xf')]()[_0x0275('0x10')](function(_0x28827b){if(_0x28827b){var _0x36921c=_['reject'](_0x28827b,function(_0x3e0791){return _0x3e0791[_0x0275('0xb')]==='express'||_0x3e0791[_0x0275('0xb')]===_0x0275('0x11');});return{'rows':_0x36921c,'count':_0x36921c['length']};}return null;})[_0x0275('0x10')](respondWithResult(_0x395398,null))[_0x0275('0x12')](handleError(_0x395398,null));};exports['show']=function(_0x5e7466,_0x56e719){return pm2['describe'](_0x5e7466['params']['id'])[_0x0275('0x10')](respondWithResult(_0x56e719,null))[_0x0275('0x10')](handleEntityNotFound(_0x56e719,null))[_0x0275('0x12')](handleError(_0x56e719,null));};exports['create']=function(_0x7075c9,_0x30730a){if(_0x7075c9[_0x0275('0x13')]['name']&&_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]){var _0x575786=path['join'](__dirname,_0x0275('0x15'),_0x7075c9[_0x0275('0x13')][_0x0275('0x14')]);var _0x592a53=process[_0x0275('0x16')]();process['chdir'](path[_0x0275('0x17')](_0x575786));return execChildProcess()['then'](function(_0x26f2c2){process[_0x0275('0x18')](_0x592a53);return pm2['start']({'name':_0x7075c9[_0x0275('0x13')][_0x0275('0xb')],'script':_0x575786});})[_0x0275('0x10')](function(_0x52946b){pm2[_0x0275('0x19')]();return _0x52946b[0x0];})[_0x0275('0x10')](respondWithResult(_0x30730a,0xc9))[_0x0275('0x12')](handleError(_0x30730a,null));}else{return _0x30730a[_0x0275('0x8')](0x1f4)[_0x0275('0xc')]({'message':_0x0275('0x1a')});}};exports['update']=function(_0x35343c,_0x14d7d8){if(_0x35343c[_0x0275('0x13')]['id']){delete _0x35343c[_0x0275('0x13')]['id'];}var _0x4689a3={'online':'restart','stopped':_0x0275('0x1b')};if(_0x4689a3[_0x0275('0x1c')](_0x35343c[_0x0275('0x13')][_0x0275('0x8')])){return pm2[_0x4689a3[_0x35343c[_0x0275('0x13')]['status']]](_0x35343c[_0x0275('0x1d')]['id'])[_0x0275('0x10')](respondWithResult(_0x14d7d8,0xc8))[_0x0275('0x12')](handleError(_0x14d7d8,null));}else{return _0x14d7d8['status'](0x1f4)['send']({'message':_0x0275('0x1e')});}};exports[_0x0275('0x1f')]=function(_0x5dc2bc,_0x7eff96){if(_0x5dc2bc[_0x0275('0x13')]['id']){delete _0x5dc2bc[_0x0275('0x13')]['id'];}if(_0x5dc2bc[_0x0275('0x1d')]['id']){return pm2['delete'](_0x5dc2bc[_0x0275('0x1d')]['id'])[_0x0275('0x10')](function(_0x3bba47){pm2[_0x0275('0x19')]();return _0x3bba47[0x0];})['then'](respondWithResult(_0x7eff96,null))[_0x0275('0x12')](handleError(_0x7eff96,null));}else{return _0x7eff96['status'](0x1f4)[_0x0275('0xc')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
+var _0x99e9=['../../config/pm2','../../config/logger','api','path','exec','bluebird','status','error','stack','name','send','npm\x20install','info','index','list','then','motion2','length','catch','show','params','create','body','script','join','../../files/plugins','cwd','chdir','dump','Missing\x20name\x20and/or\x20path','update','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id'];(function(_0x584c54,_0x2a2f73){var _0x207b05=function(_0x3911f7){while(--_0x3911f7){_0x584c54['push'](_0x584c54['shift']());}};_0x207b05(++_0x2a2f73);}(_0x99e9,0xb4));var _0x999e=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0x99e9[_0x158da6];return _0x429c30;};'use strict';var _=require('lodash');var pm2=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var path=require(_0x999e('0x3'));var exec=require('child_process')[_0x999e('0x4')];var BPromise=require(_0x999e('0x5'));function handleEntityNotFound(_0x3aac27,_0x4e2112){return function(_0x296411){if(!_0x296411){_0x3aac27['sendStatus'](0x194);;}return _0x296411;};}function respondWithResult(_0x25421f,_0x1bda0a){_0x1bda0a=_0x1bda0a||0xc8;return function(_0x100330){if(_0x100330){return _0x25421f[_0x999e('0x6')](_0x1bda0a)['json'](_0x100330);}return null;};}function handleError(_0x46aeae,_0x38a692){_0x38a692=_0x38a692||0x1f4;return function(_0x343a12){logger[_0x999e('0x7')](_0x343a12[_0x999e('0x8')]);if(_0x343a12[_0x999e('0x9')]){delete _0x343a12[_0x999e('0x9')];}_0x46aeae[_0x999e('0x6')](_0x38a692)[_0x999e('0xa')](_0x343a12);};}function execChildProcess(){return new BPromise(function(_0xf40130,_0x9368cf){exec(_0x999e('0xb'),function(_0x4246b1,_0x188d02,_0x3dfe2d){logger[_0x999e('0xc')](_0x188d02);logger[_0x999e('0xc')](_0x3dfe2d);if(_0x4246b1){logger['error'](_0x4246b1);return _0x9368cf(_0x4246b1);}return _0xf40130(_0x188d02);});});}exports[_0x999e('0xd')]=function(_0x54afad,_0x3e6f5a){return pm2[_0x999e('0xe')]()[_0x999e('0xf')](function(_0x538a92){if(_0x538a92){var _0x28bdd1=_['reject'](_0x538a92,function(_0xa44e4c){return _0xa44e4c['name']==='express'||_0xa44e4c[_0x999e('0x9')]===_0x999e('0x10');});return{'rows':_0x28bdd1,'count':_0x28bdd1[_0x999e('0x11')]};}return null;})[_0x999e('0xf')](respondWithResult(_0x3e6f5a,null))[_0x999e('0x12')](handleError(_0x3e6f5a,null));};exports[_0x999e('0x13')]=function(_0x4aac66,_0x5bb27e){return pm2['describe'](_0x4aac66[_0x999e('0x14')]['id'])[_0x999e('0xf')](respondWithResult(_0x5bb27e,null))[_0x999e('0xf')](handleEntityNotFound(_0x5bb27e,null))[_0x999e('0x12')](handleError(_0x5bb27e,null));};exports[_0x999e('0x15')]=function(_0x3ece5e,_0x5af4c3){if(_0x3ece5e['body'][_0x999e('0x9')]&&_0x3ece5e[_0x999e('0x16')][_0x999e('0x17')]){var _0x510fa2=path[_0x999e('0x18')](__dirname,_0x999e('0x19'),_0x3ece5e[_0x999e('0x16')][_0x999e('0x17')]);var _0x373b80=process[_0x999e('0x1a')]();process[_0x999e('0x1b')](path['dirname'](_0x510fa2));return execChildProcess()['then'](function(_0x11a6bf){process[_0x999e('0x1b')](_0x373b80);return pm2['start']({'name':_0x3ece5e[_0x999e('0x16')][_0x999e('0x9')],'script':_0x510fa2});})[_0x999e('0xf')](function(_0x13027c){pm2[_0x999e('0x1c')]();return _0x13027c[0x0];})[_0x999e('0xf')](respondWithResult(_0x5af4c3,0xc9))['catch'](handleError(_0x5af4c3,null));}else{return _0x5af4c3[_0x999e('0x6')](0x1f4)[_0x999e('0xa')]({'message':_0x999e('0x1d')});}};exports[_0x999e('0x1e')]=function(_0x1b7adb,_0x1d2dc6){if(_0x1b7adb[_0x999e('0x16')]['id']){delete _0x1b7adb['body']['id'];}var _0x28f803={'online':'restart','stopped':'stop'};if(_0x28f803[_0x999e('0x1f')](_0x1b7adb[_0x999e('0x16')][_0x999e('0x6')])){return pm2[_0x28f803[_0x1b7adb['body'][_0x999e('0x6')]]](_0x1b7adb[_0x999e('0x14')]['id'])[_0x999e('0xf')](respondWithResult(_0x1d2dc6,0xc8))[_0x999e('0x12')](handleError(_0x1d2dc6,null));}else{return _0x1d2dc6[_0x999e('0x6')](0x1f4)[_0x999e('0xa')]({'message':_0x999e('0x20')});}};exports[_0x999e('0x21')]=function(_0x27102b,_0x3ddacb){if(_0x27102b['body']['id']){delete _0x27102b[_0x999e('0x16')]['id'];}if(_0x27102b[_0x999e('0x14')]['id']){return pm2[_0x999e('0x22')](_0x27102b['params']['id'])[_0x999e('0xf')](function(_0x5af72c){pm2['dump']();return _0x5af72c[0x0];})[_0x999e('0xf')](respondWithResult(_0x3ddacb,null))[_0x999e('0x12')](handleError(_0x3ddacb,null));}else{return _0x3ddacb['status'](0x1f4)['send']({'message':_0x999e('0x23')});}};
\ No newline at end of file
index 16ecee6..caf0a44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f98=['../../components/auth/service','./realtime.controller','get','/queues','isAuthenticated','exports','express','Router'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0x4f98,0x196));var _0x84f9=function(_0x15ca1a,_0x30fc82){_0x15ca1a=_0x15ca1a-0x0;var _0x507626=_0x4f98[_0x15ca1a];return _0x507626;};'use strict';var express=require(_0x84f9('0x0'));var router=express[_0x84f9('0x1')]();var auth=require(_0x84f9('0x2'));var controller=require(_0x84f9('0x3'));router[_0x84f9('0x4')](_0x84f9('0x5'),auth[_0x84f9('0x6')](),controller['getQueues']);module[_0x84f9('0x7')]=router;
\ No newline at end of file
+var _0x431b=['get','/queues','isAuthenticated','getQueues','exports','express','Router','../../components/auth/service'];(function(_0xe43bdd,_0x19de11){var _0x55a390=function(_0x44204f){while(--_0x44204f){_0xe43bdd['push'](_0xe43bdd['shift']());}};_0x55a390(++_0x19de11);}(_0x431b,0x18d));var _0xb431=function(_0x2f7c3c,_0x52b503){_0x2f7c3c=_0x2f7c3c-0x0;var _0x56ea57=_0x431b[_0x2f7c3c];return _0x56ea57;};'use strict';var express=require(_0xb431('0x0'));var router=express[_0xb431('0x1')]();var auth=require(_0xb431('0x2'));var controller=require('./realtime.controller');router[_0xb431('0x3')](_0xb431('0x4'),auth[_0xb431('0x5')](),controller[_0xb431('0x6')]);module[_0xb431('0x7')]=router;
\ No newline at end of file
index 6f09676..74b54d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['getMembers','length','find','UserId','User','Pause','QueueId','findAll','agent','all','catch','lodash','../../components/parsers/qs','api','../../mysqldb','client','http','offset','undefined','limit','count','status','Content-Range','error','stack','name','mail','chat','sms','openchannel','fax','whatsapp','resolve','then','query','channel','includes','toLowerCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','user','userProfileId','voice','outbound','QueueCampaigns','startCase','Queues','filter','UserProfile','getResources','findAndCountAll','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','talking','paused','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','get','loggedInDb','waiting','agents','pick','getAgents','online'];(function(_0x4b4623,_0x54cab8){var _0x5cc51a=function(_0x122795){while(--_0x122795){_0x4b4623['push'](_0x4b4623['shift']());}};_0x5cc51a(++_0x54cab8);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var util=require('util');var _=require(_0xb71a('0x0'));var jayson=require('jayson/promise');var qs=require(_0xb71a('0x1'));var logger=require('../../config/logger')(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var client=jayson[_0xb71a('0x4')][_0xb71a('0x5')]({'port':0x232a});var routingClient=jayson[_0xb71a('0x4')][_0xb71a('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x2192e8,_0x38d931){return function(_0x22c072){if(_0x22c072){var _0x35a84e=typeof _0x38d931[_0xb71a('0x6')]===_0xb71a('0x7')&&typeof _0x38d931[_0xb71a('0x8')]===_0xb71a('0x7');var _0x18c7a6=_0x22c072[_0xb71a('0x9')];var _0x378c96=_0x35a84e?0x0:_0x38d931[_0xb71a('0x6')];var _0x517eed=_0x35a84e?_0x22c072[_0xb71a('0x9')]:_0x38d931['offset']+_0x38d931[_0xb71a('0x8')];var _0x343d2f;if(_0x517eed>=_0x18c7a6){_0x517eed=_0x18c7a6;_0x343d2f=0xc8;}else{_0x343d2f=0xce;}_0x2192e8[_0xb71a('0xa')](_0x343d2f);return _0x2192e8['set'](_0xb71a('0xb'),_0x378c96+'-'+_0x517eed+'/'+_0x18c7a6)['json'](_0x22c072);}return null;};}function handleError(_0x2a2d75,_0x50030d){_0x50030d=_0x50030d||0x1f4;return function(_0x50b43b){logger[_0xb71a('0xc')](_0x50b43b[_0xb71a('0xd')]);if(_0x50b43b[_0xb71a('0xe')]){delete _0x50b43b[_0xb71a('0xe')];}_0x2a2d75['status'](_0x50030d)['send'](_0x50b43b);};}exports['getQueues']=function(_0x12900a,_0xc189cd){var _0x15252a=[_0xb71a('0xf'),_0xb71a('0x10'),_0xb71a('0x11'),_0xb71a('0x12'),_0xb71a('0x13'),_0xb71a('0x14'),'voice'];var _0x1ca65e={'count':0x0,'rows':[]},_0x2d6369={},_0x374c8c;Promise[_0xb71a('0x15')]()[_0xb71a('0x16')](function(){if(_0x12900a[_0xb71a('0x17')][_0xb71a('0x18')]){if(!_[_0xb71a('0x19')](_0x15252a,_0x12900a[_0xb71a('0x17')][_0xb71a('0x18')][_0xb71a('0x1a')]()))throw new Error('Invalid\x20channel');_0x374c8c=_0x12900a['query'][_0xb71a('0x18')][_0xb71a('0x1a')]();}var _0x4a4f4e=_['startCase'](_0x374c8c)+_0xb71a('0x1b');var _0x4fe4fb=_[_0xb71a('0x1c')](db[_0x4a4f4e][_0xb71a('0x1d')],function(_0x3ac77b){return{'name':_0x3ac77b[_0xb71a('0x1e')],'type':_0x3ac77b[_0xb71a('0x1f')][_0xb71a('0x20')]};});_0x2d6369=qs[_0xb71a('0x21')](_0x4fe4fb,_0x12900a);if(_0x12900a[_0xb71a('0x22')]['role']===_0xb71a('0x22')){var _0x2c15bc={'params':{'id':_0x12900a[_0xb71a('0x22')][_0xb71a('0x23')]},'query':{'section':_0x374c8c===_0xb71a('0x24')&&_0x12900a[_0xb71a('0x17')][_0xb71a('0x1f')]===_0xb71a('0x25')?_0xb71a('0x26'):_[_0xb71a('0x27')](_0x374c8c)+_0xb71a('0x28'),'type':_0x12900a[_0xb71a('0x17')][_0xb71a('0x1f')],'nolimit':!![],'sort':'name','filter':_0x12900a[_0xb71a('0x17')][_0xb71a('0x29')]}};return db[_0xb71a('0x2a')][_0xb71a('0x2b')](_0x2c15bc);}return db[_0x4a4f4e][_0xb71a('0x2c')](_0x2d6369);})[_0xb71a('0x16')](function(_0x44826e){_0x1ca65e[_0xb71a('0x9')]=_0x44826e[_0xb71a('0x9')];var _0x421fcf=_0x374c8c===_0xb71a('0x24')?client:routingClient;return _0x421fcf['request'](_['startCase'](_0x374c8c)+_0xb71a('0x28'),_0x12900a)['then'](function(_0x70299a){if(_0x70299a[_0xb71a('0xc')])throw new Error(util['format'](_0xb71a('0x2d'),_0x374c8c));var _0xa42f25=_0x70299a[_0xb71a('0x2e')];var _0x251d82=[_0xb71a('0x2f'),_0xb71a('0x30'),'waiting',_0xb71a('0x31'),_0xb71a('0x32')];if(_0x374c8c===_0xb71a('0x24')&&_0x12900a[_0xb71a('0x17')]['type']===_0xb71a('0x25')){_0x251d82[_0xb71a('0x33')](_0xb71a('0x34'),_0xb71a('0x35'),_0xb71a('0x36'),_0xb71a('0x37'),_0xb71a('0x38'),_0xb71a('0x39'),_0xb71a('0x3a'),_0xb71a('0x3b'),'erlangCalls','erlangCallToSecond',_0xb71a('0x3c'),_0xb71a('0x3d'),_0xb71a('0x3e'),_0xb71a('0x3f'),_0xb71a('0x40'),_0xb71a('0x41'),_0xb71a('0x42'),'predictiveIntervalAnsweredCalls',_0xb71a('0x43'),'predictiveIntervalDroppedCallsCallersExit',_0xb71a('0x44'),_0xb71a('0x45'));}var _0x147002=_0x44826e[_0xb71a('0x46')]['map'](function(_0x39d12c){var _0x3ff4ed=_0x39d12c[_0xb71a('0x47')]({'plain':!![]});_0x3ff4ed[_0xb71a('0x32')]=0x0;_0x3ff4ed[_0xb71a('0x48')]=0x0;_0x3ff4ed[_0xb71a('0x2f')]=0x0;_0x3ff4ed[_0xb71a('0x30')]=0x0;_0x3ff4ed[_0xb71a('0x32')]=0x0;_0x3ff4ed[_0xb71a('0x49')]=0x0;if(_0x374c8c==='voice'){_0x3ff4ed[_0xb71a('0x31')]=0x0;if(_0x12900a['query'][_0xb71a('0x1f')]===_0xb71a('0x25')){_0x3ff4ed[_0xb71a('0x34')]=0x0;_0x3ff4ed[_0xb71a('0x35')]=0x0;}}_0x3ff4ed[_0xb71a('0x4a')]=[];var _0x18872b=_['find'](_0xa42f25['rows'],['id',_0x3ff4ed['id']]);if(_0x18872b)_['merge'](_0x3ff4ed,_[_0xb71a('0x4b')](_0x18872b,_0x251d82));if(_0x374c8c==='voice'){return _0x39d12c[_0xb71a('0x4c')]({'attributes':['id',_0xb71a('0xe'),_0xb71a('0x4d')],'joinTableAttributes':[],'raw':!![]})[_0xb71a('0x16')](function(_0x1cb355){return _0x39d12c[_0xb71a('0x4e')]({'raw':!![]})['then'](function(_0x29985a){for(var _0x7b5cc4=0x0;_0x7b5cc4<_0x1cb355[_0xb71a('0x4f')];_0x7b5cc4++){var _0x8bf582=_[_0xb71a('0x50')](_0x29985a,[_0xb71a('0x51'),_0x1cb355[_0x7b5cc4]['id']]);var _0x55cbca={'id':_0x1cb355[_0x7b5cc4]['id'],'name':_0x1cb355[_0x7b5cc4][_0xb71a('0xe')],'online':Boolean(_0x1cb355[_0x7b5cc4][_0xb71a('0x4d')]),'paused':_0x8bf582?Boolean(_0x8bf582[_0xb71a('0x32')]):![]};if(_0x55cbca[_0xb71a('0x4d')])_0x3ff4ed[_0xb71a('0x48')]++;if(_0x55cbca[_0xb71a('0x32')])_0x3ff4ed[_0xb71a('0x32')]++;_0x3ff4ed['agents']['push'](_0x55cbca);}return _0x3ff4ed;});});}else{var _0x2442f5=_0xb71a('0x52')+_[_0xb71a('0x27')](_0x374c8c)+_0xb71a('0x1b');var _0x4a763c=_0x374c8c+_0xb71a('0x53');return db[_0x2442f5]['findAll']({'where':{[_[_0xb71a('0x27')](_0x374c8c)+_0xb71a('0x54')]:_0x39d12c['id']},'raw':!![]})['then'](function(_0x437287){return db[_0xb71a('0x52')][_0xb71a('0x55')]({'attributes':['id',_0xb71a('0xe'),'online',_0x4a763c],'where':{'id':_[_0xb71a('0x1c')](_0x437287,_0xb71a('0x51')),'role':_0xb71a('0x56')},'raw':!![]});})['then'](function(_0x350c89){for(var _0x1cd434=0x0;_0x1cd434<_0x350c89[_0xb71a('0x4f')];_0x1cd434++){var _0x5e9eea={'id':_0x350c89[_0x1cd434]['id'],'name':_0x350c89[_0x1cd434][_0xb71a('0xe')],'online':Boolean(_0x350c89[_0x1cd434][_0xb71a('0x4d')]),'paused':Boolean(_0x350c89[_0x1cd434][_0x4a763c])};if(_0x5e9eea[_0xb71a('0x4d')])_0x3ff4ed[_0xb71a('0x48')]++;if(_0x5e9eea[_0xb71a('0x32')])_0x3ff4ed['paused']++;_0x3ff4ed[_0xb71a('0x4a')][_0xb71a('0x33')](_0x5e9eea);}return _0x3ff4ed;});}});return Promise[_0xb71a('0x57')](_0x147002);});})[_0xb71a('0x16')](function(_0x489c1f){_0x1ca65e['rows']=_0x489c1f;return _0x1ca65e;})[_0xb71a('0x16')](respondWithFilteredResult(_0xc189cd,_0x2d6369))[_0xb71a('0x58')](handleError(_0xc189cd,null));};
\ No newline at end of file
+var _0x81c6=['rawAttributes','fieldName','type','key','getOptions','user','role','userProfileId','QueueCampaigns','Queues','filter','UserProfile','findAndCountAll','startCase','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','available','waiting','talking','originated','message','dialMethod','startProgressive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','get','paused','outbound','pTalking','agents','find','rows','merge','pick','getAgents','online','getMembers','length','loggedInDb','User','Queue','Pause','findAll','QueueId','push','catch','lodash','api','../../mysqldb','client','http','offset','undefined','count','limit','status','json','error','name','send','getQueues','chat','sms','openchannel','fax','whatsapp','voice','resolve','then','channel','includes','Invalid\x20channel','query','toLowerCase','map'];(function(_0x363bb0,_0x2b4322){var _0x2773ea=function(_0x5660fe){while(--_0x5660fe){_0x363bb0['push'](_0x363bb0['shift']());}};_0x2773ea(++_0x2b4322);}(_0x81c6,0x1d5));var _0x681c=function(_0x1eff7c,_0x357ad0){_0x1eff7c=_0x1eff7c-0x0;var _0x304854=_0x81c6[_0x1eff7c];return _0x304854;};'use strict';var util=require('util');var _=require(_0x681c('0x0'));var jayson=require('jayson/promise');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var client=jayson[_0x681c('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0x681c('0x3')][_0x681c('0x4')]({'port':0x232c});function respondWithFilteredResult(_0x1f2032,_0x1d31c8){return function(_0x4ea522){if(_0x4ea522){var _0x45331=typeof _0x1d31c8[_0x681c('0x5')]==='undefined'&&typeof _0x1d31c8['limit']===_0x681c('0x6');var _0x3fac39=_0x4ea522[_0x681c('0x7')];var _0x5de78e=_0x45331?0x0:_0x1d31c8['offset'];var _0x3e3770=_0x45331?_0x4ea522['count']:_0x1d31c8[_0x681c('0x5')]+_0x1d31c8[_0x681c('0x8')];var _0x2ac84d;if(_0x3e3770>=_0x3fac39){_0x3e3770=_0x3fac39;_0x2ac84d=0xc8;}else{_0x2ac84d=0xce;}_0x1f2032[_0x681c('0x9')](_0x2ac84d);return _0x1f2032['set']('Content-Range',_0x5de78e+'-'+_0x3e3770+'/'+_0x3fac39)[_0x681c('0xa')](_0x4ea522);}return null;};}function handleError(_0x1d1d5d,_0x2d379b){_0x2d379b=_0x2d379b||0x1f4;return function(_0x50cae8){logger[_0x681c('0xb')](_0x50cae8['stack']);if(_0x50cae8[_0x681c('0xc')]){delete _0x50cae8['name'];}_0x1d1d5d[_0x681c('0x9')](_0x2d379b)[_0x681c('0xd')](_0x50cae8);};}exports[_0x681c('0xe')]=function(_0x416723,_0x402aa2){var _0x2bc3fb=['mail',_0x681c('0xf'),_0x681c('0x10'),_0x681c('0x11'),_0x681c('0x12'),_0x681c('0x13'),_0x681c('0x14')];var _0x4e7df2={'count':0x0,'rows':[]},_0xf3c042={},_0x42f506;Promise[_0x681c('0x15')]()[_0x681c('0x16')](function(){if(_0x416723['query'][_0x681c('0x17')]){if(!_[_0x681c('0x18')](_0x2bc3fb,_0x416723['query'][_0x681c('0x17')]['toLowerCase']()))throw new Error(_0x681c('0x19'));_0x42f506=_0x416723[_0x681c('0x1a')][_0x681c('0x17')][_0x681c('0x1b')]();}var _0x4169b9=_['startCase'](_0x42f506)+'Queue';var _0x57772d=_[_0x681c('0x1c')](db[_0x4169b9][_0x681c('0x1d')],function(_0x3adfe3){return{'name':_0x3adfe3[_0x681c('0x1e')],'type':_0x3adfe3[_0x681c('0x1f')][_0x681c('0x20')]};});_0xf3c042=qs[_0x681c('0x21')](_0x57772d,_0x416723);if(_0x416723[_0x681c('0x22')][_0x681c('0x23')]===_0x681c('0x22')){var _0x2be552={'params':{'id':_0x416723[_0x681c('0x22')][_0x681c('0x24')]},'query':{'section':_0x42f506===_0x681c('0x14')&&_0x416723[_0x681c('0x1a')][_0x681c('0x1f')]==='outbound'?_0x681c('0x25'):_['startCase'](_0x42f506)+_0x681c('0x26'),'type':_0x416723['query']['type'],'nolimit':!![],'sort':_0x681c('0xc'),'filter':_0x416723[_0x681c('0x1a')][_0x681c('0x27')]}};return db[_0x681c('0x28')]['getResources'](_0x2be552);}return db[_0x4169b9][_0x681c('0x29')](_0xf3c042);})[_0x681c('0x16')](function(_0x2fde4b){_0x4e7df2[_0x681c('0x7')]=_0x2fde4b[_0x681c('0x7')];var _0x204006=_0x42f506===_0x681c('0x14')?client:routingClient;return _0x204006['request'](_[_0x681c('0x2a')](_0x42f506)+_0x681c('0x26'),_0x416723)[_0x681c('0x16')](function(_0x4af6aa){if(_0x4af6aa[_0x681c('0xb')])throw new Error(util[_0x681c('0x2b')](_0x681c('0x2c'),_0x42f506));var _0x5e8f58=_0x4af6aa[_0x681c('0x2d')];var _0x574ce7=['loggedIn',_0x681c('0x2e'),_0x681c('0x2f'),_0x681c('0x30'),'paused'];if(_0x42f506===_0x681c('0x14')&&_0x416723['query'][_0x681c('0x1f')]==='outbound'){_0x574ce7['push']('pTalking',_0x681c('0x31'),_0x681c('0x32'),'dialActive',_0x681c('0x33'),'Trunk','startPredictive',_0x681c('0x34'),'erlangCalls',_0x681c('0x35'),_0x681c('0x36'),_0x681c('0x37'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0x681c('0x38'),_0x681c('0x39'),'predictiveIntervalTotalCalls',_0x681c('0x3a'),_0x681c('0x3b'),_0x681c('0x3c'),'predictiveIntervalAvgHoldtime',_0x681c('0x3d'));}var _0x147729=_0x2fde4b['rows'][_0x681c('0x1c')](function(_0x3c6851){var _0x83953c=_0x3c6851[_0x681c('0x3e')]({'plain':!![]});_0x83953c[_0x681c('0x3f')]=0x0;_0x83953c['loggedInDb']=0x0;_0x83953c['loggedIn']=0x0;_0x83953c[_0x681c('0x2e')]=0x0;_0x83953c[_0x681c('0x3f')]=0x0;_0x83953c['waiting']=0x0;if(_0x42f506===_0x681c('0x14')){_0x83953c[_0x681c('0x30')]=0x0;if(_0x416723['query'][_0x681c('0x1f')]===_0x681c('0x40')){_0x83953c[_0x681c('0x41')]=0x0;_0x83953c[_0x681c('0x31')]=0x0;}}_0x83953c[_0x681c('0x42')]=[];var _0x42c6bf=_[_0x681c('0x43')](_0x5e8f58[_0x681c('0x44')],['id',_0x83953c['id']]);if(_0x42c6bf)_[_0x681c('0x45')](_0x83953c,_[_0x681c('0x46')](_0x42c6bf,_0x574ce7));if(_0x42f506==='voice'){return _0x3c6851[_0x681c('0x47')]({'attributes':['id',_0x681c('0xc'),_0x681c('0x48')],'joinTableAttributes':[],'raw':!![]})[_0x681c('0x16')](function(_0x174f86){return _0x3c6851[_0x681c('0x49')]({'raw':!![]})[_0x681c('0x16')](function(_0x465083){for(var _0x2b8e6d=0x0;_0x2b8e6d<_0x174f86[_0x681c('0x4a')];_0x2b8e6d++){var _0x440f98=_[_0x681c('0x43')](_0x465083,['UserId',_0x174f86[_0x2b8e6d]['id']]);var _0x2143a9={'id':_0x174f86[_0x2b8e6d]['id'],'name':_0x174f86[_0x2b8e6d]['name'],'online':Boolean(_0x174f86[_0x2b8e6d]['online']),'paused':_0x440f98?Boolean(_0x440f98[_0x681c('0x3f')]):![]};if(_0x2143a9[_0x681c('0x48')])_0x83953c[_0x681c('0x4b')]++;if(_0x2143a9[_0x681c('0x3f')])_0x83953c['paused']++;_0x83953c[_0x681c('0x42')]['push'](_0x2143a9);}return _0x83953c;});});}else{var _0x4e72e4=_0x681c('0x4c')+_[_0x681c('0x2a')](_0x42f506)+_0x681c('0x4d');var _0x3912f2=_0x42f506+_0x681c('0x4e');return db[_0x4e72e4][_0x681c('0x4f')]({'where':{[_['startCase'](_0x42f506)+_0x681c('0x50')]:_0x3c6851['id']},'raw':!![]})[_0x681c('0x16')](function(_0x4e2705){return db['User'][_0x681c('0x4f')]({'attributes':['id','name',_0x681c('0x48'),_0x3912f2],'where':{'id':_['map'](_0x4e2705,'UserId'),'role':'agent'},'raw':!![]});})[_0x681c('0x16')](function(_0x41f2a2){for(var _0x8043a9=0x0;_0x8043a9<_0x41f2a2['length'];_0x8043a9++){var _0x3a9b26={'id':_0x41f2a2[_0x8043a9]['id'],'name':_0x41f2a2[_0x8043a9][_0x681c('0xc')],'online':Boolean(_0x41f2a2[_0x8043a9]['online']),'paused':Boolean(_0x41f2a2[_0x8043a9][_0x3912f2])};if(_0x3a9b26[_0x681c('0x48')])_0x83953c[_0x681c('0x4b')]++;if(_0x3a9b26[_0x681c('0x3f')])_0x83953c[_0x681c('0x3f')]++;_0x83953c['agents'][_0x681c('0x51')](_0x3a9b26);}return _0x83953c;});}});return Promise['all'](_0x147729);});})[_0x681c('0x16')](function(_0x29141d){_0x4e7df2[_0x681c('0x44')]=_0x29141d;return _0x4e7df2;})['then'](respondWithFilteredResult(_0x402aa2,_0xf3c042))[_0x681c('0x52')](handleError(_0x402aa2,null));};
\ No newline at end of file
index 4061dab..660fe1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x411010,_0x356fba){var _0x3c91a7=function(_0x1739fc){while(--_0x1739fc){_0x411010['push'](_0x411010['shift']());}};_0x3c91a7(++_0x356fba);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x31abee,_0x11ff0c){_0x31abee=_0x31abee-0x0;var _0x3c1761=_0xcb91[_0x31abee];return _0x3c1761;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x36e8bb,_0x20e767){var _0x40f797=function(_0x81cab4){while(--_0x81cab4){_0x36e8bb['push'](_0x36e8bb['shift']());}};_0x40f797(++_0x20e767);}(_0xedd9,0xfc));var _0x9edd=function(_0x3049ae,_0x462eec){_0x3049ae=_0x3049ae-0x0;var _0x3b9910=_0xedd9[_0x3049ae];return _0x3b9910;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router;
\ No newline at end of file
index 75603a5..6c2c7fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3f27=['sequelize','exports','INTEGER','STRING','DATE'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3f27,0x1f4));var _0x73f2=function(_0x55cf27,_0x568043){_0x55cf27=_0x55cf27-0x0;var _0x468779=_0x3f27[_0x55cf27];return _0x468779;};'use strict';var Sequelize=require(_0x73f2('0x0'));module[_0x73f2('0x1')]={'state':{'type':Sequelize[_0x73f2('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x73f2('0x3')]},'scheduledat':{'type':Sequelize[_0x73f2('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x73f2('0x4')]},'responsetime':{'type':Sequelize[_0x73f2('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x73f2('0x3')]}};
\ No newline at end of file
+var _0xca84=['sequelize','exports','INTEGER','DATE','STRING'];(function(_0x13078b,_0x3bdc58){var _0x4605cf=function(_0x4025d9){while(--_0x4025d9){_0x13078b['push'](_0x13078b['shift']());}};_0x4605cf(++_0x3bdc58);}(_0xca84,0xf5));var _0x4ca8=function(_0x302f4e,_0x399ac7){_0x302f4e=_0x302f4e-0x0;var _0x887dc5=_0xca84[_0x302f4e];return _0x887dc5;};'use strict';var Sequelize=require(_0x4ca8('0x0'));module[_0x4ca8('0x1')]={'state':{'type':Sequelize[_0x4ca8('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x4ca8('0x3')]},'uniqueid':{'type':Sequelize[_0x4ca8('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x4ca8('0x3')]},'ringtime':{'type':Sequelize[_0x4ca8('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x4ca8('0x4')]},'campaigntype':{'type':Sequelize[_0x4ca8('0x4')]},'membername':{'type':Sequelize[_0x4ca8('0x4')]}};
\ No newline at end of file
index 22fc4d3..ba5cdfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86a9=['ReportAgentPreview','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports'];(function(_0x50922c,_0x4d29d6){var _0x523b1c=function(_0x481791){while(--_0x481791){_0x50922c['push'](_0x50922c['shift']());}};_0x523b1c(++_0x4d29d6);}(_0x86a9,0xfe));var _0x986a=function(_0x2f3906,_0x44b523){_0x2f3906=_0x2f3906-0x0;var _0x1ca345=_0x86a9[_0x2f3906];return _0x1ca345;};'use strict';var _=require(_0x986a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x986a('0x1'));var moment=require(_0x986a('0x2'));var BPromise=require(_0x986a('0x3'));var rp=require(_0x986a('0x4'));var fs=require('fs');var path=require(_0x986a('0x5'));var rimraf=require(_0x986a('0x6'));var config=require(_0x986a('0x7'));var attributes=require(_0x986a('0x8'));module[_0x986a('0x9')]=function(_0x5cc681,_0x1b5b6f){return _0x5cc681['define'](_0x986a('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0aff=['../../config/logger','api','moment','path','rimraf','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0xff1756,_0x11edb1){var _0x49d43f=function(_0x538068){while(--_0x538068){_0xff1756['push'](_0xff1756['shift']());}};_0x49d43f(++_0x11edb1);}(_0x0aff,0x132));var _0xf0af=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x0aff[_0x4c6d6f];return _0x2d4478;};'use strict';var _=require(_0xf0af('0x0'));var util=require(_0xf0af('0x1'));var logger=require(_0xf0af('0x2'))(_0xf0af('0x3'));var moment=require(_0xf0af('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0af('0x5'));var rimraf=require(_0xf0af('0x6'));var config=require('../../config/environment');var attributes=require(_0xf0af('0x7'));module['exports']=function(_0x2abeed,_0x3413d2){return _0x2abeed[_0xf0af('0x8')](_0xf0af('0x9'),attributes,{'tableName':_0xf0af('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6bb212e..7b65607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe729=['jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','raw','CreateReportAgentPreview','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x401ccd,_0x140815){var _0x5a57ad=function(_0x8ad698){while(--_0x8ad698){_0x401ccd['push'](_0x401ccd['shift']());}};_0x5a57ad(++_0x140815);}(_0xe729,0x11a));var _0x9e72=function(_0xd08be4,_0x23b48c){_0xd08be4=_0xd08be4-0x0;var _0x3f68f3=_0xe729[_0xd08be4];return _0x3f68f3;};'use strict';var _=require('lodash');var util=require(_0x9e72('0x0'));var moment=require(_0x9e72('0x1'));var BPromise=require(_0x9e72('0x2'));var rs=require(_0x9e72('0x3'));var fs=require('fs');var Redis=require(_0x9e72('0x4'));var db=require(_0x9e72('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e72('0x6'))(_0x9e72('0x7'));var config=require('../../config/environment');var jayson=require(_0x9e72('0x8'));var client=jayson[_0x9e72('0x9')][_0x9e72('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c3aab,_0xdb6e70,_0x3eadd0){return new BPromise(function(_0x23bff7,_0x655fe5){return client[_0x9e72('0xb')](_0x4c3aab,_0x3eadd0)[_0x9e72('0xc')](function(_0x4d7457){logger[_0x9e72('0xd')](_0x9e72('0xe'),_0xdb6e70,_0x9e72('0xf'));logger['debug'](_0x9e72('0x10'),_0xdb6e70,'request\x20sent',JSON[_0x9e72('0x11')](_0x4d7457));if(_0x4d7457[_0x9e72('0x12')]){if(_0x4d7457[_0x9e72('0x12')][_0x9e72('0x13')]===0x1f4){logger[_0x9e72('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0xdb6e70,_0x4d7457[_0x9e72('0x12')]['message']);return _0x655fe5(_0x4d7457[_0x9e72('0x12')][_0x9e72('0x14')]);}logger[_0x9e72('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0xdb6e70,_0x4d7457[_0x9e72('0x12')][_0x9e72('0x14')]);return _0x23bff7(_0x4d7457[_0x9e72('0x12')][_0x9e72('0x14')]);}else{logger[_0x9e72('0xd')](_0x9e72('0xe'),_0xdb6e70,_0x9e72('0xf'));_0x23bff7(_0x4d7457[_0x9e72('0x15')]['message']);}})[_0x9e72('0x16')](function(_0x448295){logger[_0x9e72('0x12')](_0x9e72('0xe'),_0xdb6e70,_0x448295);_0x655fe5(_0x448295);});});}exports['CreateReportAgentPreview']=function(_0x4aa3b2){var _0x20ab38=this;return new Promise(function(_0x12ddb4,_0x3e6984){return db['ReportAgentPreview'][_0x9e72('0x17')](_0x4aa3b2[_0x9e72('0x18')],{'raw':_0x4aa3b2[_0x9e72('0x19')]?_0x4aa3b2['options'][_0x9e72('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0xe2665e){logger[_0x9e72('0xd')](_0x9e72('0x1b'),_0x4aa3b2);logger[_0x9e72('0x1c')](_0x9e72('0x1b'),_0x4aa3b2,JSON[_0x9e72('0x11')](_0xe2665e));_0x12ddb4(_0xe2665e);})[_0x9e72('0x16')](function(_0x22803e){logger[_0x9e72('0x12')](_0x9e72('0x1b'),_0x22803e[_0x9e72('0x14')],_0x4aa3b2);_0x3e6984(_0x20ab38[_0x9e72('0x12')](0x1f4,_0x22803e['message']));});});};
\ No newline at end of file
+var _0x8d91=['request','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateReportAgentPreview','ReportAgentPreview','body','options','raw','then','debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x2586a2,_0x69eb21){var _0x4a29bf=function(_0x2503be){while(--_0x2503be){_0x2586a2['push'](_0x2586a2['shift']());}};_0x4a29bf(++_0x69eb21);}(_0x8d91,0x1e4));var _0x18d9=function(_0x2718c9,_0x55ad41){_0x2718c9=_0x2718c9-0x0;var _0x59fdeb=_0x8d91[_0x2718c9];return _0x59fdeb;};'use strict';var _=require(_0x18d9('0x0'));var util=require('util');var moment=require(_0x18d9('0x1'));var BPromise=require(_0x18d9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x18d9('0x3'));var db=require(_0x18d9('0x4'))['db'];var utils=require(_0x18d9('0x5'));var logger=require(_0x18d9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x18d9('0x7'));var client=jayson[_0x18d9('0x8')][_0x18d9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55a238,_0x142112,_0x36c9d0){return new BPromise(function(_0x32a41e,_0x458aef){return client[_0x18d9('0xa')](_0x55a238,_0x36c9d0)['then'](function(_0x448e93){logger[_0x18d9('0xb')](_0x18d9('0xc'),_0x142112,'request\x20sent');logger['debug'](_0x18d9('0xd'),_0x142112,_0x18d9('0xe'),JSON[_0x18d9('0xf')](_0x448e93));if(_0x448e93[_0x18d9('0x10')]){if(_0x448e93[_0x18d9('0x10')]['code']===0x1f4){logger[_0x18d9('0x10')](_0x18d9('0xc'),_0x142112,_0x448e93[_0x18d9('0x10')][_0x18d9('0x11')]);return _0x458aef(_0x448e93[_0x18d9('0x10')]['message']);}logger[_0x18d9('0x10')](_0x18d9('0xc'),_0x142112,_0x448e93[_0x18d9('0x10')][_0x18d9('0x11')]);return _0x32a41e(_0x448e93[_0x18d9('0x10')]['message']);}else{logger[_0x18d9('0xb')](_0x18d9('0xc'),_0x142112,'request\x20sent');_0x32a41e(_0x448e93['result'][_0x18d9('0x11')]);}})[_0x18d9('0x12')](function(_0x39c74d){logger[_0x18d9('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x142112,_0x39c74d);_0x458aef(_0x39c74d);});});}exports[_0x18d9('0x13')]=function(_0x4f71a6){var _0x2880f9=this;return new Promise(function(_0x47cb89,_0xc5ad9d){return db[_0x18d9('0x14')]['create'](_0x4f71a6[_0x18d9('0x15')],{'raw':_0x4f71a6[_0x18d9('0x16')]?_0x4f71a6[_0x18d9('0x16')][_0x18d9('0x17')]===undefined?!![]:![]:!![]})[_0x18d9('0x18')](function(_0x3d4c8c){logger['info'](_0x18d9('0x13'),_0x4f71a6);logger[_0x18d9('0x19')]('CreateReportAgentPreview',_0x4f71a6,JSON[_0x18d9('0xf')](_0x3d4c8c));_0x47cb89(_0x3d4c8c);})[_0x18d9('0x12')](function(_0x1f3c25){logger['error'](_0x18d9('0x13'),_0x1f3c25[_0x18d9('0x11')],_0x4f71a6);_0xc5ad9d(_0x2880f9[_0x18d9('0x10')](0x1f4,_0x1f3c25[_0x18d9('0x11')]));});});};
\ No newline at end of file
index 91bd0ac..39077b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3eba=['showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','util','express','Router','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','outbound','/outbound/channels','outboundChannels','/agents','agentCapacity','/telephones','telephones','trunks','/campaigns','campaigns','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','chat','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x3eba,0x181));var _0xa3eb=function(_0x25fdc5,_0x2b42ed){_0x25fdc5=_0x25fdc5-0x0;var _0x3897e2=_0x3eba[_0x25fdc5];return _0x3897e2;};'use strict';var multer=require('multer');var util=require(_0xa3eb('0x0'));var path=require('path');var express=require(_0xa3eb('0x1'));var router=express[_0xa3eb('0x2')]();var auth=require('../../components/auth/service');var controller=require(_0xa3eb('0x3'));router[_0xa3eb('0x4')](_0xa3eb('0x5'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x7')]);router[_0xa3eb('0x4')](_0xa3eb('0x8'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x9')]);router[_0xa3eb('0x4')](_0xa3eb('0xa'),auth['isAuthenticated'](),controller[_0xa3eb('0xb')]);router[_0xa3eb('0x4')](_0xa3eb('0xc'),auth['isAuthenticated'](),controller[_0xa3eb('0xd')]);router['get'](_0xa3eb('0xe'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0xf')]);router[_0xa3eb('0x4')](_0xa3eb('0x10'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x11')]);router[_0xa3eb('0x4')]('/mail/accounts',auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x12')]);router['get'](_0xa3eb('0x13'),auth['isAuthenticated'](),controller[_0xa3eb('0x14')]);router['get'](_0xa3eb('0x15'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x16')]);router[_0xa3eb('0x4')]('/whatsapp/queues',auth[_0xa3eb('0x6')](),controller['whatsappQueues']);router['get'](_0xa3eb('0x17'),auth[_0xa3eb('0x6')](),controller['faxQueues']);router[_0xa3eb('0x4')](_0xa3eb('0x18'),auth[_0xa3eb('0x6')](),controller['voiceQueuesPreview']);router[_0xa3eb('0x4')](_0xa3eb('0x19'),auth[_0xa3eb('0x6')](),controller['voiceQueuesChannels']);router[_0xa3eb('0x4')](_0xa3eb('0x1a'),auth[_0xa3eb('0x6')](),controller['voiceQueuesChannel']);router[_0xa3eb('0x4')](_0xa3eb('0x1b'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x1c')]);router[_0xa3eb('0x4')](_0xa3eb('0x1d'),auth['isAuthenticated'](),controller[_0xa3eb('0x1e')]);router['get'](_0xa3eb('0x1f'),auth['isAuthenticated'](),controller[_0xa3eb('0x20')]);router[_0xa3eb('0x21')](_0xa3eb('0x1f'),auth[_0xa3eb('0x6')](),controller['updateVoiceQueue']);router['get']('/outbound',auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x22')]);router['get'](_0xa3eb('0x23'),auth['isAuthenticated'](),controller[_0xa3eb('0x24')]);router[_0xa3eb('0x4')](_0xa3eb('0x25'),auth['isAuthenticated'](),controller['agents']);router[_0xa3eb('0x21')]('/agents/:id/capacity',auth['isAuthenticated'](),controller[_0xa3eb('0x26')]);router[_0xa3eb('0x4')](_0xa3eb('0x27'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x28')]);router[_0xa3eb('0x4')]('/trunks',auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x29')]);router['get'](_0xa3eb('0x2a'),auth['isAuthenticated'](),controller[_0xa3eb('0x2b')]);router[_0xa3eb('0x4')]('/fax/accounts',auth[_0xa3eb('0x6')](),controller['faxAccounts']);router[_0xa3eb('0x4')]('/chat/queues/waitinginteractions',auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x2c')]);router['get']('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xa3eb('0x2d')]);router['get'](_0xa3eb('0x2e'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x2f')]);router[_0xa3eb('0x4')](_0xa3eb('0x30'),auth[_0xa3eb('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xa3eb('0x4')](_0xa3eb('0x31'),auth[_0xa3eb('0x6')](),controller['smsQueuesWaitingInteractions']);router[_0xa3eb('0x4')](_0xa3eb('0x32'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x33')]);router[_0xa3eb('0x4')](_0xa3eb('0x34'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x35')]);router[_0xa3eb('0x36')](_0xa3eb('0x37'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x38')](_0xa3eb('0x39')));router[_0xa3eb('0x4')](_0xa3eb('0x3a'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0xa3eb('0x36')]('/chat/queues/:id/notify',auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x38')](_0xa3eb('0x3b')));router[_0xa3eb('0x4')](_0xa3eb('0x3c'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x3d')]);router['post']('/fax/queues/:id/notify',auth[_0xa3eb('0x6')](),controller['queueNotify'](_0xa3eb('0x3e')));router[_0xa3eb('0x4')](_0xa3eb('0x3f'),auth['isAuthenticated'](),controller[_0xa3eb('0x40')]);router[_0xa3eb('0x36')](_0xa3eb('0x41'),auth['isAuthenticated'](),controller['queueNotify'](_0xa3eb('0x42')));router[_0xa3eb('0x4')](_0xa3eb('0x43'),auth[_0xa3eb('0x6')](),controller['showOpenchannelQueues']);router['post'](_0xa3eb('0x44'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x38')]('sms'));router[_0xa3eb('0x36')](_0xa3eb('0x45'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x38')](_0xa3eb('0x46')));router[_0xa3eb('0x4')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0xa3eb('0x47')]);router[_0xa3eb('0x4')](_0xa3eb('0x48'),auth[_0xa3eb('0x6')](),controller['showWhatsappQueues']);router['post'](_0xa3eb('0x49'),auth[_0xa3eb('0x6')](),controller[_0xa3eb('0x4a')]);module[_0xa3eb('0x4b')]=router;
\ No newline at end of file
+var _0xcf33=['openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','Router','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','mailQueues','/mail/accounts','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','showVoiceQueues','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions'];(function(_0x34d003,_0x1c6826){var _0x401183=function(_0x17dd6f){while(--_0x17dd6f){_0x34d003['push'](_0x34d003['shift']());}};_0x401183(++_0x1c6826);}(_0xcf33,0x114));var _0x3cf3=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xcf33[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x3cf3('0x0'));var util=require(_0x3cf3('0x1'));var path=require(_0x3cf3('0x2'));var express=require('express');var router=express[_0x3cf3('0x3')]();var auth=require('../../components/auth/service');var controller=require(_0x3cf3('0x4'));router[_0x3cf3('0x5')](_0x3cf3('0x6'),auth['isAuthenticated'](),controller[_0x3cf3('0x7')]);router['get'](_0x3cf3('0x8'),auth[_0x3cf3('0x9')](),controller['voiceChannelMixMonitor']);router[_0x3cf3('0x5')](_0x3cf3('0xa'),auth[_0x3cf3('0x9')](),controller['voiceChannelStopMixMonitor']);router[_0x3cf3('0x5')](_0x3cf3('0xb'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0xc')]);router[_0x3cf3('0x5')](_0x3cf3('0xd'),auth['isAuthenticated'](),controller['chatQueues']);router[_0x3cf3('0x5')](_0x3cf3('0xe'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0xf')]);router[_0x3cf3('0x5')](_0x3cf3('0x10'),auth['isAuthenticated'](),controller['mailAccounts']);router[_0x3cf3('0x5')]('/openchannel/queues',auth[_0x3cf3('0x9')](),controller['openchannelQueues']);router[_0x3cf3('0x5')](_0x3cf3('0x11'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x12')]);router[_0x3cf3('0x5')](_0x3cf3('0x13'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x14')]);router[_0x3cf3('0x5')](_0x3cf3('0x15'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x16')]);router[_0x3cf3('0x5')](_0x3cf3('0x17'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x18')]);router[_0x3cf3('0x5')](_0x3cf3('0x19'),auth[_0x3cf3('0x9')](),controller['voiceQueuesChannels']);router[_0x3cf3('0x5')](_0x3cf3('0x1a'),auth[_0x3cf3('0x9')](),controller['voiceQueuesChannel']);router['get'](_0x3cf3('0x1b'),auth['isAuthenticated'](),controller[_0x3cf3('0x1c')]);router[_0x3cf3('0x5')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1d')]);router[_0x3cf3('0x5')]('/voice/queues/:id',auth['isAuthenticated'](),controller[_0x3cf3('0x1e')]);router['put']('/voice/queues/:id',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x1f')]);router['get']('/outbound',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x20')]);router[_0x3cf3('0x5')](_0x3cf3('0x21'),auth['isAuthenticated'](),controller[_0x3cf3('0x22')]);router[_0x3cf3('0x5')]('/agents',auth['isAuthenticated'](),controller[_0x3cf3('0x23')]);router[_0x3cf3('0x24')](_0x3cf3('0x25'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x26')]);router[_0x3cf3('0x5')](_0x3cf3('0x27'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x28')]);router[_0x3cf3('0x5')](_0x3cf3('0x29'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x2a')]);router[_0x3cf3('0x5')](_0x3cf3('0x2b'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x2c')]);router[_0x3cf3('0x5')](_0x3cf3('0x2d'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x2e')]);router['get'](_0x3cf3('0x2f'),auth['isAuthenticated'](),controller[_0x3cf3('0x30')]);router[_0x3cf3('0x5')](_0x3cf3('0x31'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x32')]);router[_0x3cf3('0x5')](_0x3cf3('0x33'),auth['isAuthenticated'](),controller[_0x3cf3('0x34')]);router['get']('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router['get'](_0x3cf3('0x35'),auth['isAuthenticated'](),controller['smsQueuesWaitingInteractions']);router[_0x3cf3('0x5')]('/whatsapp/queues/waitinginteractions',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x36')]);router[_0x3cf3('0x5')](_0x3cf3('0x37'),auth['isAuthenticated'](),controller[_0x3cf3('0x38')]);router[_0x3cf3('0x39')]('/mail/queues/:id/notify',auth['isAuthenticated'](),controller[_0x3cf3('0x3a')](_0x3cf3('0x3b')));router[_0x3cf3('0x5')](_0x3cf3('0x3c'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3d')]);router[_0x3cf3('0x39')](_0x3cf3('0x3e'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3a')]('chat'));router[_0x3cf3('0x5')]('/chat/queues/:id',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3f')]);router[_0x3cf3('0x39')](_0x3cf3('0x40'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3a')](_0x3cf3('0x41')));router['get'](_0x3cf3('0x42'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x43')]);router[_0x3cf3('0x39')](_0x3cf3('0x44'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3a')](_0x3cf3('0x45')));router['get'](_0x3cf3('0x46'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x47')]);router['post'](_0x3cf3('0x48'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x3a')](_0x3cf3('0x49')));router[_0x3cf3('0x39')](_0x3cf3('0x4a'),auth['isAuthenticated'](),controller[_0x3cf3('0x3a')](_0x3cf3('0x4b')));router[_0x3cf3('0x5')](_0x3cf3('0x4c'),auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x4d')]);router[_0x3cf3('0x5')](_0x3cf3('0x4e'),auth['isAuthenticated'](),controller[_0x3cf3('0x4f')]);router['post']('/agents/:id/notify',auth[_0x3cf3('0x9')](),controller[_0x3cf3('0x50')]);module[_0x3cf3('0x51')]=router;
\ No newline at end of file
index f37b51e..7fda0e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d17=['jayson/promise','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','name','send','isNil','find','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','params','voiceQueues','VoiceQueues','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','user','body','MemberReport','findAll','length','findOrCreate','INTERACTION','interface','SIP/%s','format','YYYY-MM-DD\x20HH:mm:ss','internal','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','\x20Message\x20not\x20found','update','queue','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Website','User','agent','Agent\x20not\x20found','Message','agentTransferTimeout','bluebird','moment','util','../../mysqldb','api'];(function(_0x3daf0e,_0x567d0f){var _0x370959=function(_0x27189c){while(--_0x27189c){_0x3daf0e['push'](_0x3daf0e['shift']());}};_0x370959(++_0x567d0f);}(_0x2d17,0x17e));var _0x72d1=function(_0x16e98a,_0x4f2b69){_0x16e98a=_0x16e98a-0x0;var _0x1adf09=_0x2d17[_0x16e98a];return _0x1adf09;};'use strict';var BPromise=require(_0x72d1('0x0'));var moment=require(_0x72d1('0x1'));var _=require('lodash');var util=require(_0x72d1('0x2'));var db=require(_0x72d1('0x3'))['db'];var logger=require('../../config/logger')(_0x72d1('0x4'));var jayson=require(_0x72d1('0x5'));var amiClient=jayson['client'][_0x72d1('0x6')]({'port':0x232a});var mailClient=jayson['client'][_0x72d1('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x72d1('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x239d1f,_0x5b40a9,_0x477264){return new BPromise(function(_0x422f5a,_0x19e248){var _0x4e7f3e=_0x477264?_0x477264:amiClient;return _0x4e7f3e[_0x72d1('0x7')](_0x239d1f,_0x5b40a9)[_0x72d1('0x8')](function(_0x283775){if(_0x283775['error']){if(_0x283775[_0x72d1('0x9')][_0x72d1('0xa')]===0x1f4){return _0x19e248(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}return _0x422f5a(_0x283775[_0x72d1('0x9')][_0x72d1('0xb')]);}else{_0x422f5a(_0x283775[_0x72d1('0xc')]);}})[_0x72d1('0xd')](function(_0x273ccf){_0x19e248(_0x273ccf);});});}function respondWithResult(_0x2f5a78,_0x5ad4df){_0x5ad4df=_0x5ad4df||0xc8;return function(_0x3cd1ae){if(_0x3cd1ae){return _0x2f5a78[_0x72d1('0xe')](_0x5ad4df)[_0x72d1('0xf')](_0x3cd1ae);}return _0x2f5a78[_0x72d1('0x10')](0x194);};}function handleError(_0x22ac6f,_0x685a27){_0x685a27=_0x685a27||0x1f4;return function(_0x143718){logger[_0x72d1('0x9')](_0x143718[_0x72d1('0x11')]);if(_0x143718[_0x72d1('0x12')]){delete _0x143718[_0x72d1('0x12')];}_0x22ac6f[_0x72d1('0xe')](_0x685a27)[_0x72d1('0x13')](_0x143718);};}function findById(_0x491af4){return function(_0x46fa3d){if(!_['isNil'](_0x491af4)&&!_[_0x72d1('0x14')](_0x46fa3d)&&!_[_0x72d1('0x14')](_0x46fa3d['rows'])){return _[_0x72d1('0x15')](_0x46fa3d[_0x72d1('0x16')],function(_0x1ca18d){return _0x1ca18d['id']==_0x491af4;});}return null;};}exports['voiceChannels']=function(_0x4925f6,_0x313d7b){return respondWithRpcPromise(_0x72d1('0x17'),_0x4925f6[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x313d7b,null))[_0x72d1('0xd')](handleError(_0x313d7b,null));};exports[_0x72d1('0x19')]=function(_0x1e2411,_0x5c7982){return respondWithRpcPromise(_0x72d1('0x1a'),_['merge'](_0x1e2411['query'],_0x1e2411['params']))['then'](respondWithResult(_0x5c7982,null))[_0x72d1('0xd')](handleError(_0x5c7982,null));};exports[_0x72d1('0x1b')]=function(_0x573c98,_0x2a421a){return respondWithRpcPromise(_0x72d1('0x1c'),_[_0x72d1('0x1d')](_0x573c98[_0x72d1('0x18')],_0x573c98[_0x72d1('0x1e')]))['then'](respondWithResult(_0x2a421a,null))['catch'](handleError(_0x2a421a,null));};exports[_0x72d1('0x1f')]=function(_0x36bc65,_0x2f661){return respondWithRpcPromise(_0x72d1('0x20'),_0x36bc65[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x2f661,null))[_0x72d1('0xd')](handleError(_0x2f661,null));};exports['showVoiceQueues']=function(_0x57ec9e,_0x1ba258){return respondWithRpcPromise('VoiceQueues',_0x57ec9e[_0x72d1('0x18')])[_0x72d1('0x8')](findById(_0x57ec9e[_0x72d1('0x1e')]['id']))['then'](respondWithResult(_0x1ba258,null))[_0x72d1('0xd')](handleError(_0x1ba258,null));};exports['updateVoiceQueue']=function(_0x707cd0,_0x20055f){return respondWithRpcPromise(_0x72d1('0x21'),_[_0x72d1('0x1d')](_0x707cd0['body'],_0x707cd0[_0x72d1('0x1e')]))['then'](respondWithResult(_0x20055f,null))[_0x72d1('0xd')](handleError(_0x20055f,null));};exports[_0x72d1('0x22')]=function(_0x5cec3f,_0x14d653){return respondWithRpcPromise(_0x72d1('0x23'),_[_0x72d1('0x1d')](_0x5cec3f[_0x72d1('0x18')],_0x5cec3f[_0x72d1('0x1e')]))['then'](respondWithResult(_0x14d653,null))[_0x72d1('0xd')](handleError(_0x14d653,null));};exports[_0x72d1('0x24')]=function(_0x9efc2f,_0x482033){return respondWithRpcPromise(_0x72d1('0x25'),_0x9efc2f[_0x72d1('0x18')])['then'](respondWithResult(_0x482033,null))[_0x72d1('0xd')](handleError(_0x482033,null));};exports[_0x72d1('0x26')]=function(_0x437d79,_0x5a63d9){return respondWithRpcPromise(_0x72d1('0x27'),_['merge'](_0x437d79[_0x72d1('0x18')],_0x437d79[_0x72d1('0x1e')]))[_0x72d1('0x8')](respondWithResult(_0x5a63d9,null))[_0x72d1('0xd')](handleError(_0x5a63d9,null));};exports[_0x72d1('0x28')]=function(_0xc9798a,_0x3ed5de){return respondWithRpcPromise(_0x72d1('0x29'),_[_0x72d1('0x1d')](_0xc9798a[_0x72d1('0x18')],_0xc9798a[_0x72d1('0x1e')]))['then'](respondWithResult(_0x3ed5de,null))[_0x72d1('0xd')](handleError(_0x3ed5de,null));};exports[_0x72d1('0x2a')]=function(_0x4acab,_0x325209){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x72d1('0x1d')](_0x4acab[_0x72d1('0x18')],_0x4acab[_0x72d1('0x1e')]))['then'](respondWithResult(_0x325209,null))[_0x72d1('0xd')](handleError(_0x325209,null));};exports[_0x72d1('0x2b')]=function(_0x163538,_0x5b897f){return respondWithRpcPromise(_0x72d1('0x2c'),_0x163538[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x5b897f,null))['catch'](handleError(_0x5b897f,null));};exports[_0x72d1('0x2d')]=function(_0x40cdbd,_0x1e083e){return respondWithRpcPromise(_0x72d1('0x2e'),_0x40cdbd[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x1e083e,null))[_0x72d1('0xd')](handleError(_0x1e083e,null));};exports['agents']=function(_0x12646c,_0x3ae4b5){var _0x440ac5;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c[_0x72d1('0x18')])[_0x72d1('0x8')](function(_0x2f3080){_0x440ac5=_0x2f3080;return respondWithRpcPromise(_0x72d1('0x2f'),_0x12646c['query'],routingClient);})[_0x72d1('0x8')](function(_0x1a6dd4){return _[_0x72d1('0x1d')]({},_0x1a6dd4,_0x440ac5);})[_0x72d1('0x8')](respondWithResult(_0x3ae4b5,null))[_0x72d1('0xd')](handleError(_0x3ae4b5,null));};exports[_0x72d1('0x30')]=function(_0xb911fa,_0x3620df){if(_0xb911fa['body']&&_0xb911fa['body'][_0x72d1('0x31')]&&_0xb911fa[_0x72d1('0x32')]&&_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]){for(var _0x5a6bc4 in _0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')]){if(_0xb911fa['body'][_0x72d1('0x31')]['hasOwnProperty'](_0x5a6bc4)){db[_0x72d1('0x34')][_0x72d1('0x35')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa['user'][_0x72d1('0x12')],'type':'INTERACTION','exitAt':null,'uniqueid':_0xb911fa['body']['interaction'][_0x5a6bc4]&&_0xb911fa[_0x72d1('0x33')]['interaction'][_0x5a6bc4][_0x72d1('0x36')]?{'$notIn':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4]}:{'$ne':null}}})['then'](function(_0x4a5c1c){var _0x263fcb=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2cb03d=0x0,_0x397f31=_0x4a5c1c[_0x72d1('0x36')];_0x2cb03d<_0x397f31;_0x2cb03d+=0x1){_0x4a5c1c[_0x2cb03d]['updateAttributes']({'exitAt':_0x263fcb});}});for(var _0x4f772d=0x0;_0x4f772d<_0xb911fa['body']['interaction'][_0x5a6bc4][_0x72d1('0x36')];_0x4f772d+=0x1){db[_0x72d1('0x34')][_0x72d1('0x37')]({'where':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')],'type':_0x72d1('0x38'),'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d],'exitAt':null},'defaults':{'channel':_0x5a6bc4,'membername':_0xb911fa[_0x72d1('0x32')]['name'],'interface':_[_0x72d1('0x14')](_0xb911fa[_0x72d1('0x32')][_0x72d1('0x39')])?util['format'](_0x72d1('0x3a'),_0xb911fa[_0x72d1('0x32')][_0x72d1('0x12')]):_0xb911fa['user'][_0x72d1('0x39')],'type':_0x72d1('0x38'),'enterAt':moment()[_0x72d1('0x3b')](_0x72d1('0x3c')),'role':'agent','internal':_0xb911fa['user'][_0x72d1('0x3d')],'uniqueid':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x31')][_0x5a6bc4][_0x4f772d]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0xb911fa[_0x72d1('0x1e')]['id'],'capacity':_0xb911fa[_0x72d1('0x33')][_0x72d1('0x3e')]},routingClient)[_0x72d1('0x8')](respondWithResult(_0x3620df,null))[_0x72d1('0xd')](handleError(_0x3620df,null));};exports[_0x72d1('0x3f')]=function(_0x3146cf,_0xebe855){return respondWithRpcPromise(_0x72d1('0x40'),_0x3146cf[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0xebe855,null))['catch'](handleError(_0xebe855,null));};exports[_0x72d1('0x41')]=function(_0x50d4d4,_0x5dd7b0){return respondWithRpcPromise(_0x72d1('0x42'),_0x50d4d4['query'])[_0x72d1('0x8')](respondWithResult(_0x5dd7b0,null))[_0x72d1('0xd')](handleError(_0x5dd7b0,null));};exports[_0x72d1('0x43')]=function(_0x162248,_0x473a7b){return respondWithRpcPromise(_0x72d1('0x44'),_0x162248[_0x72d1('0x18')])[_0x72d1('0x8')](respondWithResult(_0x473a7b,null))[_0x72d1('0xd')](handleError(_0x473a7b,null));};exports[_0x72d1('0x45')]=function(_0x14f9de,_0x52102e){return respondWithRpcPromise(_0x72d1('0x46'),_0x14f9de[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x52102e,null))['catch'](handleError(_0x52102e,null));};exports['showChatQueues']=function(_0x32f1ea,_0x140f0b){return respondWithRpcPromise(_0x72d1('0x46'),_0x32f1ea[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x32f1ea['params']['id']))[_0x72d1('0x8')](respondWithResult(_0x140f0b,null))['catch'](handleError(_0x140f0b,null));};exports[_0x72d1('0x47')]=function(_0x41c6a6,_0x20daf0){return respondWithRpcPromise(_0x72d1('0x48'),_0x41c6a6[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x20daf0,null))[_0x72d1('0xd')](handleError(_0x20daf0,null));};exports[_0x72d1('0x49')]=function(_0x384f0a,_0x3a2dfe){return respondWithRpcPromise(_0x72d1('0x48'),_0x384f0a[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x384f0a[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x3a2dfe,null))[_0x72d1('0xd')](handleError(_0x3a2dfe,null));};exports[_0x72d1('0x4a')]=function(_0x5e63cc,_0x1b40e8){return respondWithRpcPromise(_0x72d1('0x4b'),_0x5e63cc[_0x72d1('0x18')],mailClient)[_0x72d1('0x8')](respondWithResult(_0x1b40e8,null))[_0x72d1('0xd')](handleError(_0x1b40e8,null));};exports[_0x72d1('0x4c')]=function(_0x4e2d85,_0x1aec3d){return respondWithRpcPromise(_0x72d1('0x4d'),_0x4e2d85[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1aec3d,null))['catch'](handleError(_0x1aec3d,null));};exports[_0x72d1('0x4e')]=function(_0x5f4614,_0x28896f){return respondWithRpcPromise(_0x72d1('0x4d'),_0x5f4614[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x5f4614[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x28896f,null))[_0x72d1('0xd')](handleError(_0x28896f,null));};exports[_0x72d1('0x4f')]=function(_0x28e42b,_0x48cd1e){return respondWithRpcPromise('SmsQueues',_0x28e42b[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x48cd1e,null))[_0x72d1('0xd')](handleError(_0x48cd1e,null));};exports['showSmsQueues']=function(_0x31bfda,_0x333671){return respondWithRpcPromise('SmsQueues',_0x31bfda[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x31bfda[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x333671,null))[_0x72d1('0xd')](handleError(_0x333671,null));};exports[_0x72d1('0x50')]=function(_0x102574,_0x7925ec){return respondWithRpcPromise(_0x72d1('0x51'),_0x102574[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x7925ec,null))[_0x72d1('0xd')](handleError(_0x7925ec,null));};exports['showWhatsappQueues']=function(_0x55f49f,_0x15e0e0){return respondWithRpcPromise(_0x72d1('0x51'),_0x55f49f[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0x55f49f[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x15e0e0,null))[_0x72d1('0xd')](handleError(_0x15e0e0,null));};exports[_0x72d1('0x52')]=function(_0x488a14,_0x837b6b){return respondWithRpcPromise('FaxQueues',_0x488a14[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x837b6b,null))['catch'](handleError(_0x837b6b,null));};exports['showFaxQueues']=function(_0xfd39ab,_0x14d59b){return respondWithRpcPromise(_0x72d1('0x53'),_0xfd39ab[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](findById(_0xfd39ab[_0x72d1('0x1e')]['id']))[_0x72d1('0x8')](respondWithResult(_0x14d59b,null))['catch'](handleError(_0x14d59b,null));};exports[_0x72d1('0x54')]=function(_0x24bd82,_0x336ca3){return respondWithRpcPromise('FaxAccounts',_0x24bd82[_0x72d1('0x18')])['then'](respondWithResult(_0x336ca3,null))[_0x72d1('0xd')](handleError(_0x336ca3,null));};exports[_0x72d1('0x55')]=function(_0x5158ff,_0x3c0a7e){return respondWithRpcPromise(_0x72d1('0x56'),_0x5158ff['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3c0a7e,null))[_0x72d1('0xd')](handleError(_0x3c0a7e,null));};exports[_0x72d1('0x57')]=function(_0x132a43,_0x4a52ec){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x132a43['query'],routingClient)[_0x72d1('0x8')](respondWithResult(_0x4a52ec,null))[_0x72d1('0xd')](handleError(_0x4a52ec,null));};exports[_0x72d1('0x58')]=function(_0x240159,_0x146b06){return respondWithRpcPromise(_0x72d1('0x59'),_0x240159['query'],routingClient)['then'](respondWithResult(_0x146b06,null))[_0x72d1('0xd')](handleError(_0x146b06,null));};exports[_0x72d1('0x5a')]=function(_0x36827e,_0x3ef7a3){return respondWithRpcPromise(_0x72d1('0x59'),_0x36827e[_0x72d1('0x18')],routingClient)['then'](function(_0x23f0e3){if(_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')]!==undefined){var _0x53e57b=_(_0x23f0e3[_0x72d1('0x16')])[_0x72d1('0x5c')]([_0x36827e[_0x72d1('0x18')][_0x72d1('0x5b')],_0x36827e[_0x72d1('0x1e')]['id']])[_0x72d1('0x5d')](_0x72d1('0x5e'))[_0x72d1('0x5f')]()['value']();return _0x23f0e3[_0x72d1('0x16')][_0x72d1('0x5c')](function(_0x24f5eb){return _0x53e57b[_0x72d1('0x60')](_0x24f5eb['queue_id'])>-0x1;});}else{return _0x23f0e3['rows'][_0x72d1('0x5c')](function(_0x2932bb){return _0x2932bb['queue_id']===parseInt(_0x36827e[_0x72d1('0x1e')]['id']);});}})[_0x72d1('0x8')](respondWithResult(_0x3ef7a3,null))[_0x72d1('0xd')](handleError(_0x3ef7a3,null));};exports[_0x72d1('0x61')]=function(_0x35b9bb,_0x1d1e22){return respondWithRpcPromise(_0x72d1('0x62'),_0x35b9bb[_0x72d1('0x18')],routingClient)['then'](respondWithResult(_0x1d1e22,null))[_0x72d1('0xd')](handleError(_0x1d1e22,null));};exports[_0x72d1('0x63')]=function(_0x38bfd3,_0x3cbe00){return respondWithRpcPromise(_0x72d1('0x64'),_0x38bfd3[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x3cbe00,null))[_0x72d1('0xd')](handleError(_0x3cbe00,null));};exports['faxQueuesWaitingInteractions']=function(_0x47585e,_0x466634){return respondWithRpcPromise(_0x72d1('0x65'),_0x47585e[_0x72d1('0x18')],routingClient)[_0x72d1('0x8')](respondWithResult(_0x466634,null))[_0x72d1('0xd')](handleError(_0x466634,null));};exports['queueNotify']=function(_0x1c6547){return function(_0x369153,_0x4a6607){var _0x266fbc,_0x4057ec;var _0x239cdb=_[_0x72d1('0x66')](_0x1c6547);var _0x27c651=_0x1c6547===_0x72d1('0x67')?'Website':_0x72d1('0x68');return db[_0x239cdb+_0x72d1('0x69')]['findOne']({'raw':!![],'where':{'id':_0x369153['params']['id']}})[_0x72d1('0x8')](function(_0x291b67){if(_[_0x72d1('0x14')](_0x291b67)){throw new Error(_0x239cdb+_0x72d1('0x6a'));}_0x266fbc=_0x291b67;return db[_0x239cdb+'Message'][_0x72d1('0x6b')]({'where':{'id':_0x369153[_0x72d1('0x33')][_0x72d1('0x6c')]},'include':[{'model':db[_0x239cdb+_0x72d1('0x6d')],'as':_0x72d1('0x6d')},{'model':db[_0x239cdb+_0x27c651],'as':_0x72d1('0x68')}]});})[_0x72d1('0x8')](function(_0x14a215){if(_['isNil'](_0x14a215)){throw new Error(_0x239cdb+_0x72d1('0x6e'));}_0x4057ec=_0x14a215;return _0x14a215[_0x72d1('0x6f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x1b06f3={'uniqueid':_0x1c6547+'.'+_0x4057ec['id']+'.'+_0x4057ec['Interaction']['id'],'FromUserId':_0x369153[_0x72d1('0x32')]['id'],'type':_0x72d1('0x70')};_0x1b06f3[_0x239cdb+'MessageId']=_0x4057ec['id'];_0x1b06f3[_0x239cdb+_0x72d1('0x71')]=_0x4057ec['Interaction']['id'];_0x1b06f3[_0x72d1('0x72')+_0x239cdb+_0x27c651+'Id']=_0x4057ec['Account']['id'];_0x1b06f3['To'+_0x239cdb+_0x72d1('0x73')]=_0x266fbc['id'];return db[_0x239cdb+_0x72d1('0x74')][_0x72d1('0x75')](_0x1b06f3);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x1c6547,'interaction':_0x4057ec['Interaction'],'message':_0x4057ec,'account':_0x4057ec[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x70'),'appdata':_0x266fbc[_0x72d1('0x12')]+','+(_0x4057ec['Account'][_0x72d1('0x77')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x4a6607,null))[_0x72d1('0xd')](handleError(_0x4a6607,null));};};exports[_0x72d1('0x79')]=function(_0x8d4f0d,_0x5c262e){var _0x1d0db0,_0x39d961;if(_[_0x72d1('0x14')](_0x8d4f0d['body'][_0x72d1('0x7a')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x38a32c=_0x8d4f0d['body'][_0x72d1('0x7a')];var _0x2d45c9=_[_0x72d1('0x66')](_0x38a32c);var _0x21ad86=_0x38a32c==='chat'?_0x72d1('0x7b'):_0x72d1('0x68');return db[_0x72d1('0x7c')][_0x72d1('0x6b')]({'raw':!![],'where':{'id':_0x8d4f0d['params']['id'],'role':_0x72d1('0x7d')}})[_0x72d1('0x8')](function(_0x430905){if(_[_0x72d1('0x14')](_0x430905)){throw new Error(_0x72d1('0x7e'));}_0x1d0db0=_0x430905;return db[_0x2d45c9+_0x72d1('0x7f')][_0x72d1('0x6b')]({'where':{'id':_0x8d4f0d['body']['messageId']},'include':[{'model':db[_0x2d45c9+'Interaction'],'as':_0x72d1('0x6d')},{'model':db[_0x2d45c9+_0x21ad86],'as':'Account'}]});})[_0x72d1('0x8')](function(_0x8f4603){if(_['isNil'](_0x8f4603)){throw new Error(_0x2d45c9+_0x72d1('0x6e'));}_0x39d961=_0x8f4603;return _0x8f4603['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x72d1('0x8')](function(){var _0x378cf0={'uniqueid':_0x38a32c+'.'+_0x39d961['id']+'.'+_0x39d961[_0x72d1('0x6d')]['id'],'FromUserId':_0x8d4f0d[_0x72d1('0x32')]['id'],'type':'queue','ToUserId':_0x1d0db0['id']};_0x378cf0[_0x2d45c9+'MessageId']=_0x39d961['id'];_0x378cf0[_0x2d45c9+_0x72d1('0x71')]=_0x39d961['Interaction']['id'];_0x378cf0['From'+_0x2d45c9+_0x21ad86+'Id']=_0x39d961['Account']['id'];return db[_0x2d45c9+_0x72d1('0x74')][_0x72d1('0x75')](_0x378cf0);})[_0x72d1('0x8')](function(){return respondWithRpcPromise(_0x72d1('0x76'),{'channel':_0x38a32c,'interaction':_0x39d961[_0x72d1('0x6d')],'message':_0x39d961,'account':_0x39d961[_0x72d1('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x72d1('0x7d'),'appdata':_0x1d0db0['name']+','+(_0x39d961['Account'][_0x72d1('0x80')]||0x12c),'interval':_0x72d1('0x78')}]},routingClient);})['then'](respondWithResult(_0x5c262e,null))[_0x72d1('0xd')](handleError(_0x5c262e,null));};
\ No newline at end of file
+var _0xa630=['user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','update','agentTransferTimeout','bluebird','moment','../../mysqldb','api','client','http','then','error','code','message','result','json','stack','name','status','isNil','rows','find','voiceChannels','VoiceChannels','catch','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity'];(function(_0x53273a,_0x5ed978){var _0x3c41db=function(_0x491a57){while(--_0x491a57){_0x53273a['push'](_0x53273a['shift']());}};_0x3c41db(++_0x5ed978);}(_0xa630,0xbe));var _0x0a63=function(_0xf6e574,_0x457137){_0xf6e574=_0xf6e574-0x0;var _0x1e13cd=_0xa630[_0xf6e574];return _0x1e13cd;};'use strict';var BPromise=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x0a63('0x2'))['db'];var logger=require('../../config/logger')(_0x0a63('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232a});var mailClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232b});var routingClient=jayson[_0x0a63('0x4')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2760b0,_0x3d5f0b,_0xc2dcd7){return new BPromise(function(_0x41d21d,_0x12a7df){var _0x2a1bd7=_0xc2dcd7?_0xc2dcd7:amiClient;return _0x2a1bd7['request'](_0x2760b0,_0x3d5f0b)[_0x0a63('0x6')](function(_0xb714c7){if(_0xb714c7[_0x0a63('0x7')]){if(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x8')]===0x1f4){return _0x12a7df(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}return _0x41d21d(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}else{_0x41d21d(_0xb714c7[_0x0a63('0xa')]);}})['catch'](function(_0x345f56){_0x12a7df(_0x345f56);});});}function respondWithResult(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xc8;return function(_0x3d6323){if(_0x3d6323){return _0x420043['status'](_0x2fce86)[_0x0a63('0xb')](_0x3d6323);}return _0x420043['sendStatus'](0x194);};}function handleError(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0x1f4;return function(_0x26b2bc){logger[_0x0a63('0x7')](_0x26b2bc[_0x0a63('0xc')]);if(_0x26b2bc[_0x0a63('0xd')]){delete _0x26b2bc[_0x0a63('0xd')];}_0x331e99[_0x0a63('0xe')](_0x19e922)['send'](_0x26b2bc);};}function findById(_0x47788e){return function(_0x56b314){if(!_[_0x0a63('0xf')](_0x47788e)&&!_[_0x0a63('0xf')](_0x56b314)&&!_[_0x0a63('0xf')](_0x56b314[_0x0a63('0x10')])){return _[_0x0a63('0x11')](_0x56b314[_0x0a63('0x10')],function(_0x30f292){return _0x30f292['id']==_0x47788e;});}return null;};}exports[_0x0a63('0x12')]=function(_0x2fd06c,_0x3cc74d){return respondWithRpcPromise(_0x0a63('0x13'),_0x2fd06c['query'])['then'](respondWithResult(_0x3cc74d,null))[_0x0a63('0x14')](handleError(_0x3cc74d,null));};exports['voiceChannelMixMonitor']=function(_0x2fc87c,_0x5937df){return respondWithRpcPromise(_0x0a63('0x15'),_[_0x0a63('0x16')](_0x2fc87c[_0x0a63('0x17')],_0x2fc87c[_0x0a63('0x18')]))['then'](respondWithResult(_0x5937df,null))[_0x0a63('0x14')](handleError(_0x5937df,null));};exports['voiceChannelStopMixMonitor']=function(_0x3a7f9d,_0x11fe64){return respondWithRpcPromise(_0x0a63('0x19'),_[_0x0a63('0x16')](_0x3a7f9d[_0x0a63('0x17')],_0x3a7f9d[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x11fe64,null))[_0x0a63('0x14')](handleError(_0x11fe64,null));};exports['voiceQueues']=function(_0x5e5987,_0x55fb70){return respondWithRpcPromise('VoiceQueues',_0x5e5987[_0x0a63('0x17')])['then'](respondWithResult(_0x55fb70,null))['catch'](handleError(_0x55fb70,null));};exports[_0x0a63('0x1a')]=function(_0x1d5448,_0x362d6a){return respondWithRpcPromise(_0x0a63('0x1b'),_0x1d5448['query'])[_0x0a63('0x6')](findById(_0x1d5448[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x362d6a,null))['catch'](handleError(_0x362d6a,null));};exports[_0x0a63('0x1c')]=function(_0xcf409,_0x1b7bdb){return respondWithRpcPromise(_0x0a63('0x1d'),_[_0x0a63('0x16')](_0xcf409[_0x0a63('0x1e')],_0xcf409[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x1b7bdb,null))['catch'](handleError(_0x1b7bdb,null));};exports[_0x0a63('0x1f')]=function(_0x574c06,_0x151cb6){return respondWithRpcPromise(_0x0a63('0x20'),_[_0x0a63('0x16')](_0x574c06[_0x0a63('0x17')],_0x574c06[_0x0a63('0x18')]))['then'](respondWithResult(_0x151cb6,null))[_0x0a63('0x14')](handleError(_0x151cb6,null));};exports[_0x0a63('0x21')]=function(_0x33a717,_0x46fb40){return respondWithRpcPromise('VoiceQueuesChannels',_0x33a717[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x46fb40,null))['catch'](handleError(_0x46fb40,null));};exports['voiceQueuesChannel']=function(_0x34a170,_0x51d959){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0a63('0x16')](_0x34a170[_0x0a63('0x17')],_0x34a170['params']))[_0x0a63('0x6')](respondWithResult(_0x51d959,null))[_0x0a63('0x14')](handleError(_0x51d959,null));};exports[_0x0a63('0x22')]=function(_0x333130,_0x395cce){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x333130[_0x0a63('0x17')],_0x333130[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x395cce,null))[_0x0a63('0x14')](handleError(_0x395cce,null));};exports[_0x0a63('0x23')]=function(_0x273bcf,_0x59912d){return respondWithRpcPromise(_0x0a63('0x24'),_[_0x0a63('0x16')](_0x273bcf['query'],_0x273bcf[_0x0a63('0x18')]))['then'](respondWithResult(_0x59912d,null))['catch'](handleError(_0x59912d,null));};exports[_0x0a63('0x25')]=function(_0x232388,_0xdc602c){return respondWithRpcPromise('Outbound',_0x232388[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0xdc602c,null))[_0x0a63('0x14')](handleError(_0xdc602c,null));};exports[_0x0a63('0x26')]=function(_0x3f88a1,_0x876bc6){return respondWithRpcPromise(_0x0a63('0x27'),_0x3f88a1['query'])[_0x0a63('0x6')](respondWithResult(_0x876bc6,null))[_0x0a63('0x14')](handleError(_0x876bc6,null));};exports[_0x0a63('0x28')]=function(_0x53d034,_0x5d9952){var _0x28f904;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')])[_0x0a63('0x6')](function(_0x128e9e){_0x28f904=_0x128e9e;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')],routingClient);})[_0x0a63('0x6')](function(_0x46b6ee){return _[_0x0a63('0x16')]({},_0x46b6ee,_0x28f904);})['then'](respondWithResult(_0x5d9952,null))[_0x0a63('0x14')](handleError(_0x5d9952,null));};exports[_0x0a63('0x29')]=function(_0x4234cd,_0x2ccd99){if(_0x4234cd[_0x0a63('0x1e')]&&_0x4234cd[_0x0a63('0x1e')]['interaction']&&_0x4234cd[_0x0a63('0x2a')]&&_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')]){for(var _0x793502 in _0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')]){if(_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x0a63('0x2c')](_0x793502)){db[_0x0a63('0x2d')][_0x0a63('0x2e')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'exitAt':null,'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]&&_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]['length']?{'$notIn':_0x4234cd[_0x0a63('0x1e')]['interaction'][_0x793502]}:{'$ne':null}}})['then'](function(_0xd9eddc){var _0x223ecf=moment()[_0x0a63('0x30')](_0x0a63('0x31'));for(var _0xd9149d=0x0,_0x9c89ed=_0xd9eddc[_0x0a63('0x32')];_0xd9149d<_0x9c89ed;_0xd9149d+=0x1){_0xd9eddc[_0xd9149d][_0x0a63('0x33')]({'exitAt':_0x223ecf});}});for(var _0x3d0667=0x0;_0x3d0667<_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x0a63('0x32')];_0x3d0667+=0x1){db[_0x0a63('0x2d')][_0x0a63('0x34')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x3d0667],'exitAt':null},'defaults':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')]['name'],'interface':_[_0x0a63('0xf')](_0x4234cd[_0x0a63('0x2a')]['interface'])?util['format']('SIP/%s',_0x4234cd['user'][_0x0a63('0xd')]):_0x4234cd[_0x0a63('0x2a')]['interface'],'type':_0x0a63('0x2f'),'enterAt':moment()['format'](_0x0a63('0x31')),'role':_0x0a63('0x35'),'internal':_0x4234cd['user']['internal'],'uniqueid':_0x4234cd['body'][_0x0a63('0x2b')][_0x793502][_0x3d0667]}});}}}}return respondWithRpcPromise(_0x0a63('0x36'),{'id':_0x4234cd[_0x0a63('0x18')]['id'],'capacity':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x37')]},routingClient)['then'](respondWithResult(_0x2ccd99,null))[_0x0a63('0x14')](handleError(_0x2ccd99,null));};exports[_0x0a63('0x38')]=function(_0x22b3ea,_0x10adf1){return respondWithRpcPromise(_0x0a63('0x39'),_0x22b3ea['query'])[_0x0a63('0x6')](respondWithResult(_0x10adf1,null))[_0x0a63('0x14')](handleError(_0x10adf1,null));};exports[_0x0a63('0x3a')]=function(_0x1fbd2b,_0x4f3414){return respondWithRpcPromise(_0x0a63('0x3b'),_0x1fbd2b[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4f3414,null))[_0x0a63('0x14')](handleError(_0x4f3414,null));};exports[_0x0a63('0x3c')]=function(_0x258ed3,_0x4d4e20){return respondWithRpcPromise(_0x0a63('0x3d'),_0x258ed3[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4d4e20,null))[_0x0a63('0x14')](handleError(_0x4d4e20,null));};exports['chatQueues']=function(_0x4c1e34,_0x2ac98b){return respondWithRpcPromise(_0x0a63('0x3e'),_0x4c1e34[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x2ac98b,null))[_0x0a63('0x14')](handleError(_0x2ac98b,null));};exports['showChatQueues']=function(_0x5e6aae,_0x58b3a8){return respondWithRpcPromise(_0x0a63('0x3e'),_0x5e6aae['query'],routingClient)[_0x0a63('0x6')](findById(_0x5e6aae[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x58b3a8,null))['catch'](handleError(_0x58b3a8,null));};exports['mailQueues']=function(_0x2d63c6,_0x226279){return respondWithRpcPromise(_0x0a63('0x3f'),_0x2d63c6[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x226279,null))[_0x0a63('0x14')](handleError(_0x226279,null));};exports[_0x0a63('0x40')]=function(_0xc3415c,_0xe454ef){return respondWithRpcPromise(_0x0a63('0x3f'),_0xc3415c[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0xc3415c[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0xe454ef,null))['catch'](handleError(_0xe454ef,null));};exports['mailAccounts']=function(_0x1adea6,_0x24c9e0){return respondWithRpcPromise('MailAccounts',_0x1adea6[_0x0a63('0x17')],mailClient)[_0x0a63('0x6')](respondWithResult(_0x24c9e0,null))['catch'](handleError(_0x24c9e0,null));};exports[_0x0a63('0x41')]=function(_0x3053e4,_0x5e5495){return respondWithRpcPromise('OpenchannelQueues',_0x3053e4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5e5495,null))[_0x0a63('0x14')](handleError(_0x5e5495,null));};exports['showOpenchannelQueues']=function(_0x116e05,_0x375acd){return respondWithRpcPromise(_0x0a63('0x42'),_0x116e05[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x116e05['params']['id']))[_0x0a63('0x6')](respondWithResult(_0x375acd,null))[_0x0a63('0x14')](handleError(_0x375acd,null));};exports[_0x0a63('0x43')]=function(_0x1fa9cd,_0x295c06){return respondWithRpcPromise(_0x0a63('0x44'),_0x1fa9cd[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x295c06,null))[_0x0a63('0x14')](handleError(_0x295c06,null));};exports[_0x0a63('0x45')]=function(_0x252f70,_0x1155f1){return respondWithRpcPromise(_0x0a63('0x44'),_0x252f70[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x252f70[_0x0a63('0x18')]['id']))['then'](respondWithResult(_0x1155f1,null))['catch'](handleError(_0x1155f1,null));};exports[_0x0a63('0x46')]=function(_0x30e5f0,_0x4137bc){return respondWithRpcPromise(_0x0a63('0x47'),_0x30e5f0[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x4137bc,null))[_0x0a63('0x14')](handleError(_0x4137bc,null));};exports[_0x0a63('0x48')]=function(_0x1aefc4,_0x2a2f1b){return respondWithRpcPromise(_0x0a63('0x47'),_0x1aefc4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x1aefc4[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x2a2f1b,null))[_0x0a63('0x14')](handleError(_0x2a2f1b,null));};exports[_0x0a63('0x49')]=function(_0x485969,_0x25276f){return respondWithRpcPromise('FaxQueues',_0x485969[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x25276f,null))['catch'](handleError(_0x25276f,null));};exports['showFaxQueues']=function(_0x480acb,_0x31481f){return respondWithRpcPromise(_0x0a63('0x4a'),_0x480acb[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x480acb[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x31481f,null))['catch'](handleError(_0x31481f,null));};exports['faxAccounts']=function(_0x5cb325,_0x1213a5){return respondWithRpcPromise(_0x0a63('0x4b'),_0x5cb325[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x1213a5,null))['catch'](handleError(_0x1213a5,null));};exports[_0x0a63('0x4c')]=function(_0x5ed2db,_0x5de3de){return respondWithRpcPromise(_0x0a63('0x4d'),_0x5ed2db['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5de3de,null))[_0x0a63('0x14')](handleError(_0x5de3de,null));};exports['mailQueuesWaitingInteractions']=function(_0x267583,_0x4d1e35){return respondWithRpcPromise(_0x0a63('0x4e'),_0x267583['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x4d1e35,null))[_0x0a63('0x14')](handleError(_0x4d1e35,null));};exports[_0x0a63('0x4f')]=function(_0x4fba49,_0x3b8442){return respondWithRpcPromise(_0x0a63('0x50'),_0x4fba49[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x3b8442,null))[_0x0a63('0x14')](handleError(_0x3b8442,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x55174c,_0x550dbb){return respondWithRpcPromise(_0x0a63('0x50'),_0x55174c['query'],routingClient)[_0x0a63('0x6')](function(_0xa27da4){if(_0x55174c[_0x0a63('0x17')][_0x0a63('0x51')]!==undefined){var _0x5540c6=_(_0xa27da4[_0x0a63('0x10')])[_0x0a63('0x52')]([_0x55174c['query'][_0x0a63('0x51')],_0x55174c[_0x0a63('0x18')]['id']])[_0x0a63('0x53')](_0x0a63('0x54'))[_0x0a63('0x55')]()['value']();return _0xa27da4[_0x0a63('0x10')][_0x0a63('0x52')](function(_0x3941f6){return _0x5540c6['indexOf'](_0x3941f6['queue_id'])>-0x1;});}else{return _0xa27da4['rows'][_0x0a63('0x52')](function(_0x3b94ae){return _0x3b94ae[_0x0a63('0x54')]===parseInt(_0x55174c[_0x0a63('0x18')]['id']);});}})[_0x0a63('0x6')](respondWithResult(_0x550dbb,null))[_0x0a63('0x14')](handleError(_0x550dbb,null));};exports[_0x0a63('0x56')]=function(_0x37255d,_0x1dc593){return respondWithRpcPromise(_0x0a63('0x57'),_0x37255d['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x1dc593,null))[_0x0a63('0x14')](handleError(_0x1dc593,null));};exports[_0x0a63('0x58')]=function(_0x229954,_0x3d62ca){return respondWithRpcPromise(_0x0a63('0x59'),_0x229954['query'],routingClient)['then'](respondWithResult(_0x3d62ca,null))[_0x0a63('0x14')](handleError(_0x3d62ca,null));};exports[_0x0a63('0x5a')]=function(_0x425c8c,_0x3caea6){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x425c8c[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x3caea6,null))[_0x0a63('0x14')](handleError(_0x3caea6,null));};exports[_0x0a63('0x5b')]=function(_0x1e256e){return function(_0xee586,_0x486ffc){var _0x3710fa,_0x2173ee;var _0x430065=_[_0x0a63('0x5c')](_0x1e256e);var _0x540953=_0x1e256e==='chat'?_0x0a63('0x5d'):'Account';return db[_0x430065+_0x0a63('0x5e')][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0xee586[_0x0a63('0x18')]['id']}})[_0x0a63('0x6')](function(_0x65a390){if(_['isNil'](_0x65a390)){throw new Error(_0x430065+_0x0a63('0x60'));}_0x3710fa=_0x65a390;return db[_0x430065+_0x0a63('0x61')][_0x0a63('0x5f')]({'where':{'id':_0xee586[_0x0a63('0x1e')][_0x0a63('0x62')]},'include':[{'model':db[_0x430065+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x430065+_0x540953],'as':'Account'}]});})[_0x0a63('0x6')](function(_0x1a329c){if(_[_0x0a63('0xf')](_0x1a329c)){throw new Error(_0x430065+_0x0a63('0x64'));}_0x2173ee=_0x1a329c;return _0x1a329c['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0a63('0x6')](function(){var _0x148bbd={'uniqueid':_0x1e256e+'.'+_0x2173ee['id']+'.'+_0x2173ee[_0x0a63('0x63')]['id'],'FromUserId':_0xee586['user']['id'],'type':_0x0a63('0x65')};_0x148bbd[_0x430065+_0x0a63('0x66')]=_0x2173ee['id'];_0x148bbd[_0x430065+_0x0a63('0x67')]=_0x2173ee['Interaction']['id'];_0x148bbd[_0x0a63('0x68')+_0x430065+_0x540953+'Id']=_0x2173ee[_0x0a63('0x69')]['id'];_0x148bbd['To'+_0x430065+_0x0a63('0x6a')]=_0x3710fa['id'];return db[_0x430065+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x148bbd);})[_0x0a63('0x6')](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x1e256e,'interaction':_0x2173ee[_0x0a63('0x63')],'message':_0x2173ee,'account':_0x2173ee[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x65'),'appdata':_0x3710fa[_0x0a63('0xd')]+','+(_0x2173ee[_0x0a63('0x69')][_0x0a63('0x6e')]||0x12c),'interval':_0x0a63('0x6f')}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x486ffc,null))[_0x0a63('0x14')](handleError(_0x486ffc,null));};};exports['agentNotify']=function(_0x3ddf5e,_0x5f0510){var _0x19a46f,_0x36fd48;if(_['isNil'](_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')])){throw new Error(_0x0a63('0x71'));}var _0x2e1dc6=_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')];var _0x1030f7=_[_0x0a63('0x5c')](_0x2e1dc6);var _0x393399=_0x2e1dc6==='chat'?_0x0a63('0x5d'):'Account';return db['User'][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0x3ddf5e[_0x0a63('0x18')]['id'],'role':_0x0a63('0x35')}})[_0x0a63('0x6')](function(_0x5e1f76){if(_[_0x0a63('0xf')](_0x5e1f76)){throw new Error('Agent\x20not\x20found');}_0x19a46f=_0x5e1f76;return db[_0x1030f7+'Message'][_0x0a63('0x5f')]({'where':{'id':_0x3ddf5e['body']['messageId']},'include':[{'model':db[_0x1030f7+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x1030f7+_0x393399],'as':_0x0a63('0x69')}]});})[_0x0a63('0x6')](function(_0x52488a){if(_[_0x0a63('0xf')](_0x52488a)){throw new Error(_0x1030f7+'\x20Message\x20not\x20found');}_0x36fd48=_0x52488a;return _0x52488a[_0x0a63('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x11dd21={'uniqueid':_0x2e1dc6+'.'+_0x36fd48['id']+'.'+_0x36fd48['Interaction']['id'],'FromUserId':_0x3ddf5e[_0x0a63('0x2a')]['id'],'type':_0x0a63('0x65'),'ToUserId':_0x19a46f['id']};_0x11dd21[_0x1030f7+_0x0a63('0x66')]=_0x36fd48['id'];_0x11dd21[_0x1030f7+_0x0a63('0x67')]=_0x36fd48[_0x0a63('0x63')]['id'];_0x11dd21[_0x0a63('0x68')+_0x1030f7+_0x393399+'Id']=_0x36fd48[_0x0a63('0x69')]['id'];return db[_0x1030f7+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x11dd21);})['then'](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x2e1dc6,'interaction':_0x36fd48['Interaction'],'message':_0x36fd48,'account':_0x36fd48[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x35'),'appdata':_0x19a46f[_0x0a63('0xd')]+','+(_0x36fd48[_0x0a63('0x69')][_0x0a63('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x5f0510,null))[_0x0a63('0x14')](handleError(_0x5f0510,null));};
\ No newline at end of file
index 4914ae2..4d5a733 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb3c=['../../components/interaction/service','./schedule.controller','get','index','/:id','isAuthenticated','show','/:id/run','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x47c882,_0x8a92aa){var _0x205ede=function(_0x2bf8ae){while(--_0x2bf8ae){_0x47c882['push'](_0x47c882['shift']());}};_0x205ede(++_0x8a92aa);}(_0xeb3c,0x13e));var _0xceb3=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xeb3c[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0xceb3('0x0'));var util=require(_0xceb3('0x1'));var path=require(_0xceb3('0x2'));var timeout=require(_0xceb3('0x3'));var express=require(_0xceb3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xceb3('0x5'));var config=require('../../config/environment');var controller=require(_0xceb3('0x6'));router[_0xceb3('0x7')]('/',auth['isAuthenticated'](),controller[_0xceb3('0x8')]);router[_0xceb3('0x7')](_0xceb3('0x9'),auth[_0xceb3('0xa')](),controller[_0xceb3('0xb')]);router['get'](_0xceb3('0xc'),auth['isAuthenticated'](),controller['run']);router[_0xceb3('0xd')]('/',auth[_0xceb3('0xa')](),controller[_0xceb3('0xe')]);router[_0xceb3('0xf')](_0xceb3('0x9'),auth[_0xceb3('0xa')](),controller[_0xceb3('0x10')]);router[_0xceb3('0x11')](_0xceb3('0x9'),auth[_0xceb3('0xa')](),controller['destroy']);module[_0xceb3('0x12')]=router;
\ No newline at end of file
+var _0x9009=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','create','put','update','delete','destroy','exports'];(function(_0x475ed7,_0x401974){var _0x2c31ce=function(_0x31f03b){while(--_0x31f03b){_0x475ed7['push'](_0x475ed7['shift']());}};_0x2c31ce(++_0x401974);}(_0x9009,0x1cc));var _0x9900=function(_0x42e3d4,_0x19b941){_0x42e3d4=_0x42e3d4-0x0;var _0x173850=_0x9009[_0x42e3d4];return _0x173850;};'use strict';var multer=require(_0x9900('0x0'));var util=require(_0x9900('0x1'));var path=require(_0x9900('0x2'));var timeout=require(_0x9900('0x3'));var express=require(_0x9900('0x4'));var router=express[_0x9900('0x5')]();var fs_extra=require(_0x9900('0x6'));var auth=require(_0x9900('0x7'));var interaction=require(_0x9900('0x8'));var config=require('../../config/environment');var controller=require(_0x9900('0x9'));router[_0x9900('0xa')]('/',auth[_0x9900('0xb')](),controller[_0x9900('0xc')]);router['get'](_0x9900('0xd'),auth[_0x9900('0xb')](),controller[_0x9900('0xe')]);router[_0x9900('0xa')](_0x9900('0xf'),auth['isAuthenticated'](),controller[_0x9900('0x10')]);router['post']('/',auth[_0x9900('0xb')](),controller[_0x9900('0x11')]);router[_0x9900('0x12')](_0x9900('0xd'),auth['isAuthenticated'](),controller[_0x9900('0x13')]);router[_0x9900('0x14')](_0x9900('0xd'),auth['isAuthenticated'](),controller[_0x9900('0x15')]);module[_0x9900('0x16')]=router;
\ No newline at end of file
index f2d30dc..182b005 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x456c=['ENUM','years','months','weeks','days','hours','minutes','pdf','xlsx','csv','custom','default','TEXT','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER'];(function(_0x37362d,_0x127abe){var _0x384987=function(_0x21c58d){while(--_0x21c58d){_0x37362d['push'](_0x37362d['shift']());}};_0x384987(++_0x127abe);}(_0x456c,0x1ac));var _0xc456=function(_0x5ed8e2,_0x4d1edf){_0x5ed8e2=_0x5ed8e2-0x0;var _0x5056fd=_0x456c[_0x5ed8e2];return _0x5056fd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xc456('0x0')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xc456('0x0')],'allowNull':![],'defaultValue':_0xc456('0x1')},'startAt':{'type':Sequelize[_0xc456('0x2')],'allowNull':![]},'endAt':{'type':Sequelize[_0xc456('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xc456('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xc456('0x4')](_0xc456('0x5'),'quarters',_0xc456('0x6'),_0xc456('0x7'),_0xc456('0x8'),_0xc456('0x9'),_0xc456('0xa')),'allowNull':![],'defaultValue':_0xc456('0x8')},'output':{'type':Sequelize['ENUM']('csv',_0xc456('0xb'),_0xc456('0xc')),'allowNull':![],'defaultValue':_0xc456('0xd')},'type':{'type':Sequelize['ENUM'](_0xc456('0xe'),_0xc456('0xf')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xc456('0x0')]},'cc':{'type':Sequelize[_0xc456('0x10')]},'bcc':{'type':Sequelize[_0xc456('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xc456('0x11')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xc1f9=['quarters','months','weeks','days','csv','pdf','xlsx','ENUM','custom','default','TEXT','BOOLEAN','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years'];(function(_0x49fdd5,_0x1004de){var _0x44f982=function(_0x20d97b){while(--_0x20d97b){_0x49fdd5['push'](_0x49fdd5['shift']());}};_0x44f982(++_0x1004de);}(_0xc1f9,0x91));var _0x9c1f=function(_0x42b953,_0x5ca10c){_0x42b953=_0x42b953-0x0;var _0x31bda6=_0xc1f9[_0x42b953];return _0x31bda6;};'use strict';var Sequelize=require(_0x9c1f('0x0'));module[_0x9c1f('0x1')]={'name':{'type':Sequelize[_0x9c1f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9c1f('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9c1f('0x2')],'allowNull':![],'defaultValue':_0x9c1f('0x3')},'startAt':{'type':Sequelize[_0x9c1f('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x9c1f('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9c1f('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x9c1f('0x6'),_0x9c1f('0x7'),_0x9c1f('0x8'),_0x9c1f('0x9'),'days','hours','minutes'),'allowNull':![],'defaultValue':_0x9c1f('0xa')},'output':{'type':Sequelize['ENUM'](_0x9c1f('0xb'),_0x9c1f('0xc'),_0x9c1f('0xd')),'allowNull':![],'defaultValue':_0x9c1f('0xb')},'type':{'type':Sequelize[_0x9c1f('0xe')](_0x9c1f('0xf'),_0x9c1f('0x10')),'allowNull':![],'defaultValue':_0x9c1f('0xf')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x9c1f('0x2')]},'cc':{'type':Sequelize[_0x9c1f('0x11')]},'bcc':{'type':Sequelize[_0x9c1f('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x9c1f('0x12')],'defaultValue':!![]}};
\ No newline at end of file
index 44817fe..9dd11e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3123=['sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../config/schedule','run','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','destroy','then','get','Scheduler','UserProfileResource','error','stack','name','send','index','Schedule','rawAttributes','fieldName','type','key','map','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3123,0x1dc));var _0x3312=function(_0x10f86f,_0x2ae0e4){_0x10f86f=_0x10f86f-0x0;var _0x18023f=_0x3123[_0x10f86f];return _0x18023f;};'use strict';var emlformat=require(_0x3312('0x0'));var rimraf=require(_0x3312('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3312('0x2'));var BPromise=require(_0x3312('0x3'));var Mustache=require(_0x3312('0x4'));var util=require(_0x3312('0x5'));var path=require(_0x3312('0x6'));var sox=require(_0x3312('0x7'));var csv=require(_0x3312('0x8'));var ejs=require(_0x3312('0x9'));var fs=require('fs');var fs_extra=require(_0x3312('0xa'));var _=require('lodash');var squel=require(_0x3312('0xb'));var crypto=require(_0x3312('0xc'));var jsforce=require(_0x3312('0xd'));var deskjs=require(_0x3312('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3312('0xf'));var Papa=require(_0x3312('0x10'));var Redis=require('ioredis');var authService=require(_0x3312('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3312('0x12'));var logger=require(_0x3312('0x13'))(_0x3312('0x14'));var utils=require(_0x3312('0x15'));var config=require(_0x3312('0x16'));var licenseUtil=require(_0x3312('0x17'));var db=require(_0x3312('0x18'))['db'];function respondWithStatusCode(_0x2de7dd,_0xa18435){_0xa18435=_0xa18435||0xcc;return function(_0x3898e1){if(_0x3898e1){return _0x2de7dd[_0x3312('0x19')](_0xa18435);}return _0x2de7dd[_0x3312('0x1a')](_0xa18435)[_0x3312('0x1b')]();};}function respondWithResult(_0xf25dff,_0x5529c1){_0x5529c1=_0x5529c1||0xc8;return function(_0x47e4bf){if(_0x47e4bf){return _0xf25dff[_0x3312('0x1a')](_0x5529c1)['json'](_0x47e4bf);}};}function respondWithFilteredResult(_0x5a418a,_0x3e4afa){return function(_0x2b4cfb){if(_0x2b4cfb){var _0x1a7d92=typeof _0x3e4afa[_0x3312('0x1c')]===_0x3312('0x1d')&&typeof _0x3e4afa[_0x3312('0x1e')]==='undefined';var _0x4778ce=_0x2b4cfb[_0x3312('0x1f')];var _0x7dceee=_0x1a7d92?0x0:_0x3e4afa[_0x3312('0x1c')];var _0x5cc22f=_0x1a7d92?_0x2b4cfb['count']:_0x3e4afa[_0x3312('0x1c')]+_0x3e4afa[_0x3312('0x1e')];var _0x1cf050;if(_0x5cc22f>=_0x4778ce){_0x5cc22f=_0x4778ce;_0x1cf050=0xc8;}else{_0x1cf050=0xce;}_0x5a418a[_0x3312('0x1a')](_0x1cf050);return _0x5a418a['set'](_0x3312('0x20'),_0x7dceee+'-'+_0x5cc22f+'/'+_0x4778ce)[_0x3312('0x21')](_0x2b4cfb);}return null;};}function patchUpdates(_0x99372){return function(_0x10828c){try{jsonpatch[_0x3312('0x22')](_0x10828c,_0x99372,!![]);}catch(_0x5042f5){return BPromise[_0x3312('0x23')](_0x5042f5);}return _0x10828c[_0x3312('0x24')]();};}function saveUpdates(_0x352987,_0x6ff959){return function(_0xb0b11e){if(_0xb0b11e){return _0xb0b11e[_0x3312('0x25')](_0x352987)['then'](function(_0x48de2b){return _0x48de2b;});}return null;};}function removeEntity(_0x4f87b3,_0x285b29){return function(_0x227d52){if(_0x227d52){return _0x227d52[_0x3312('0x26')]()[_0x3312('0x27')](function(){var _0x1a8d6b=_0x227d52[_0x3312('0x28')]({'plain':!![]});var _0x36f62e=_0x3312('0x29');return db[_0x3312('0x2a')]['destroy']({'where':{'type':_0x36f62e,'resourceId':_0x1a8d6b['id']}})[_0x3312('0x27')](function(){return _0x227d52;});})[_0x3312('0x27')](function(){_0x4f87b3[_0x3312('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d9468,_0x17ef54){return function(_0xc2b028){if(!_0xc2b028){_0x2d9468[_0x3312('0x19')](0x194);}return _0xc2b028;};}function handleError(_0x109c2f,_0x4eb42d){_0x4eb42d=_0x4eb42d||0x1f4;return function(_0x18b07b){logger[_0x3312('0x2b')](_0x18b07b[_0x3312('0x2c')]);if(_0x18b07b['name']){delete _0x18b07b[_0x3312('0x2d')];}_0x109c2f[_0x3312('0x1a')](_0x4eb42d)[_0x3312('0x2e')](_0x18b07b);};}exports[_0x3312('0x2f')]=function(_0x4341f3,_0x391983){var _0x5c92c9={},_0x33adb7={},_0xa59325={'count':0x0,'rows':[]};var _0x1d266b=_['map'](db[_0x3312('0x30')][_0x3312('0x31')],function(_0x4b259e){return{'name':_0x4b259e[_0x3312('0x32')],'type':_0x4b259e[_0x3312('0x33')][_0x3312('0x34')]};});_0x33adb7['model']=_[_0x3312('0x35')](_0x1d266b,'name');_0x33adb7[_0x3312('0x36')]=_[_0x3312('0x37')](_0x4341f3[_0x3312('0x36')]);_0x33adb7[_0x3312('0x38')]=_['intersection'](_0x33adb7[_0x3312('0x39')],_0x33adb7[_0x3312('0x36')]);_0x5c92c9['attributes']=_['intersection'](_0x33adb7[_0x3312('0x39')],qs['fields'](_0x4341f3[_0x3312('0x36')][_0x3312('0x3a')]));_0x5c92c9[_0x3312('0x3b')]=_0x5c92c9[_0x3312('0x3b')][_0x3312('0x3c')]?_0x5c92c9[_0x3312('0x3b')]:_0x33adb7[_0x3312('0x39')];if(!_0x4341f3[_0x3312('0x36')][_0x3312('0x3d')](_0x3312('0x3e'))){_0x5c92c9[_0x3312('0x1e')]=qs[_0x3312('0x1e')](_0x4341f3[_0x3312('0x36')][_0x3312('0x1e')]);_0x5c92c9[_0x3312('0x1c')]=qs[_0x3312('0x1c')](_0x4341f3['query'][_0x3312('0x1c')]);}_0x5c92c9[_0x3312('0x3f')]=qs[_0x3312('0x40')](_0x4341f3[_0x3312('0x36')][_0x3312('0x40')]);_0x5c92c9[_0x3312('0x41')]=qs[_0x3312('0x38')](_[_0x3312('0x42')](_0x4341f3['query'],_0x33adb7['filters']),_0x1d266b);if(_0x4341f3[_0x3312('0x36')][_0x3312('0x43')]){_0x5c92c9['where']=_[_0x3312('0x44')](_0x5c92c9[_0x3312('0x41')],{'$or':_[_0x3312('0x35')](_0x1d266b,function(_0x22c2f7){if(_0x22c2f7['type']!==_0x3312('0x45')){var _0x34f6cd={};_0x34f6cd[_0x22c2f7[_0x3312('0x2d')]]={'$like':'%'+_0x4341f3[_0x3312('0x36')][_0x3312('0x43')]+'%'};return _0x34f6cd;}})});}_0x5c92c9=_[_0x3312('0x44')]({},_0x5c92c9,_0x4341f3[_0x3312('0x46')]);var _0x2a799c={'where':_0x5c92c9[_0x3312('0x41')]};return db['Schedule'][_0x3312('0x1f')](_0x2a799c)['then'](function(_0x28d35a){_0xa59325[_0x3312('0x1f')]=_0x28d35a;if(_0x4341f3['query'][_0x3312('0x47')]){_0x5c92c9[_0x3312('0x48')]=[{'all':!![]}];}return db[_0x3312('0x30')][_0x3312('0x49')](_0x5c92c9);})[_0x3312('0x27')](function(_0x383e0){_0xa59325[_0x3312('0x4a')]=_0x383e0;return _0xa59325;})['then'](respondWithFilteredResult(_0x391983,_0x5c92c9))[_0x3312('0x4b')](handleError(_0x391983,null));};exports[_0x3312('0x4c')]=function(_0x13b4e6,_0x251763){var _0x5acaab={'raw':![],'where':{'id':_0x13b4e6[_0x3312('0x4d')]['id']}},_0x47127d={};_0x47127d[_0x3312('0x39')]=_[_0x3312('0x37')](db[_0x3312('0x30')]['rawAttributes']);_0x47127d[_0x3312('0x36')]=_[_0x3312('0x37')](_0x13b4e6[_0x3312('0x36')]);_0x47127d[_0x3312('0x38')]=_['intersection'](_0x47127d['model'],_0x47127d['query']);_0x5acaab['attributes']=_[_0x3312('0x4e')](_0x47127d[_0x3312('0x39')],qs[_0x3312('0x3a')](_0x13b4e6[_0x3312('0x36')]['fields']));_0x5acaab['attributes']=_0x5acaab['attributes'][_0x3312('0x3c')]?_0x5acaab['attributes']:_0x47127d[_0x3312('0x39')];if(_0x13b4e6['query'][_0x3312('0x47')]){_0x5acaab['include']=[{'all':!![]}];}_0x5acaab=_['merge']({},_0x5acaab,_0x13b4e6[_0x3312('0x46')]);return db[_0x3312('0x30')][_0x3312('0x4f')](_0x5acaab)[_0x3312('0x27')](handleEntityNotFound(_0x251763,null))[_0x3312('0x27')](respondWithResult(_0x251763,null))[_0x3312('0x4b')](handleError(_0x251763,null));};exports[_0x3312('0x50')]=function(_0x1168bd,_0x533237){return db[_0x3312('0x30')]['create'](_0x1168bd[_0x3312('0x51')],{})['then'](function(_0x56ab37){var _0x3b722e=_0x1168bd['user'][_0x3312('0x28')]({'plain':!![]});if(!_0x3b722e)throw new Error(_0x3312('0x52'));if(_0x3b722e[_0x3312('0x53')]===_0x3312('0x54')){var _0xceb3cb=_0x56ab37[_0x3312('0x28')]({'plain':!![]});var _0x4a928a=_0x3312('0x29');return db[_0x3312('0x55')][_0x3312('0x4f')]({'where':{'name':_0x4a928a,'userProfileId':_0x3b722e[_0x3312('0x56')]},'raw':!![]})['then'](function(_0x33f458){if(_0x33f458&&_0x33f458['autoAssociation']===0x0){return db[_0x3312('0x2a')][_0x3312('0x50')]({'name':_0xceb3cb[_0x3312('0x2d')],'resourceId':_0xceb3cb['id'],'type':_0x33f458[_0x3312('0x2d')],'sectionId':_0x33f458['id']},{})[_0x3312('0x27')](function(){return _0x56ab37;});}else{return _0x56ab37;}})[_0x3312('0x4b')](function(_0x1494fc){logger[_0x3312('0x2b')](_0x3312('0x57'),_0x1494fc);throw _0x1494fc;});}return _0x56ab37;})[_0x3312('0x27')](respondWithResult(_0x533237,0xc9))['catch'](handleError(_0x533237,null));};exports[_0x3312('0x25')]=function(_0x205786,_0x2ba9cd){if(_0x205786['body']['id']){delete _0x205786[_0x3312('0x51')]['id'];}return db['Schedule'][_0x3312('0x4f')]({'where':{'id':_0x205786['params']['id']}})[_0x3312('0x27')](handleEntityNotFound(_0x2ba9cd,null))['then'](saveUpdates(_0x205786[_0x3312('0x51')],null))[_0x3312('0x27')](respondWithResult(_0x2ba9cd,null))[_0x3312('0x4b')](handleError(_0x2ba9cd,null));};exports['destroy']=function(_0x126af7,_0x52c64f){return db['Schedule'][_0x3312('0x4f')]({'where':{'id':_0x126af7[_0x3312('0x4d')]['id']}})[_0x3312('0x27')](handleEntityNotFound(_0x52c64f,null))[_0x3312('0x27')](removeEntity(_0x52c64f,null))[_0x3312('0x4b')](handleError(_0x52c64f,null));};exports['run']=function(_0x25ef27,_0x3529f4,_0x2f167e){var _0x2c8b5c=require(_0x3312('0x58'));return db[_0x3312('0x30')][_0x3312('0x4f')]({'where':{'id':_0x25ef27['params']['id']},'raw':!![]})[_0x3312('0x27')](handleEntityNotFound(_0x3529f4,null))[_0x3312('0x27')](function(){_0x2c8b5c[_0x3312('0x59')](_0x25ef27[_0x3312('0x4d')]['id']);})[_0x3312('0x27')](respondWithStatusCode(_0x3529f4,null))[_0x3312('0x4b')](handleError(_0x3529f4,null));};
\ No newline at end of file
+var _0x1daf=['index','Schedule','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','role','UserProfileSection','userProfileId','update','../../config/schedule','run','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','limit','set','apply','reject','then','destroy','get','Scheduler','UserProfileResource','error','stack','name'];(function(_0xf75aa8,_0x156e9f){var _0xe3b4da=function(_0x330cc6){while(--_0x330cc6){_0xf75aa8['push'](_0xf75aa8['shift']());}};_0xe3b4da(++_0x156e9f);}(_0x1daf,0x17a));var _0xf1da=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x1daf[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xf1da('0x0'));var rimraf=require(_0xf1da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1da('0x2'));var rp=require(_0xf1da('0x3'));var moment=require('moment');var BPromise=require(_0xf1da('0x4'));var Mustache=require(_0xf1da('0x5'));var util=require(_0xf1da('0x6'));var path=require(_0xf1da('0x7'));var sox=require('sox');var csv=require(_0xf1da('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf1da('0x9'));var squel=require(_0xf1da('0xa'));var crypto=require(_0xf1da('0xb'));var jsforce=require(_0xf1da('0xc'));var deskjs=require(_0xf1da('0xd'));var toCsv=require(_0xf1da('0x8'));var querystring=require(_0xf1da('0xe'));var Papa=require(_0xf1da('0xf'));var Redis=require(_0xf1da('0x10'));var authService=require(_0xf1da('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf1da('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1da('0x13'))(_0xf1da('0x14'));var utils=require(_0xf1da('0x15'));var config=require(_0xf1da('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf1da('0x17'))['db'];function respondWithStatusCode(_0xf7348b,_0x360aa8){_0x360aa8=_0x360aa8||0xcc;return function(_0x4dc8c3){if(_0x4dc8c3){return _0xf7348b[_0xf1da('0x18')](_0x360aa8);}return _0xf7348b[_0xf1da('0x19')](_0x360aa8)[_0xf1da('0x1a')]();};}function respondWithResult(_0x2a3d3e,_0x59041d){_0x59041d=_0x59041d||0xc8;return function(_0x5619db){if(_0x5619db){return _0x2a3d3e[_0xf1da('0x19')](_0x59041d)[_0xf1da('0x1b')](_0x5619db);}};}function respondWithFilteredResult(_0x5e89c9,_0x3385f4){return function(_0x4afb79){if(_0x4afb79){var _0x253f86=typeof _0x3385f4['offset']==='undefined'&&typeof _0x3385f4['limit']===_0xf1da('0x1c');var _0x413e6d=_0x4afb79['count'];var _0x576f2f=_0x253f86?0x0:_0x3385f4['offset'];var _0x5a604a=_0x253f86?_0x4afb79[_0xf1da('0x1d')]:_0x3385f4['offset']+_0x3385f4[_0xf1da('0x1e')];var _0x4ee9c1;if(_0x5a604a>=_0x413e6d){_0x5a604a=_0x413e6d;_0x4ee9c1=0xc8;}else{_0x4ee9c1=0xce;}_0x5e89c9[_0xf1da('0x19')](_0x4ee9c1);return _0x5e89c9[_0xf1da('0x1f')]('Content-Range',_0x576f2f+'-'+_0x5a604a+'/'+_0x413e6d)['json'](_0x4afb79);}return null;};}function patchUpdates(_0x413aab){return function(_0x22e5ed){try{jsonpatch[_0xf1da('0x20')](_0x22e5ed,_0x413aab,!![]);}catch(_0x2ae001){return BPromise[_0xf1da('0x21')](_0x2ae001);}return _0x22e5ed['save']();};}function saveUpdates(_0x408e0e,_0x5f3418){return function(_0x12e7f3){if(_0x12e7f3){return _0x12e7f3['update'](_0x408e0e)[_0xf1da('0x22')](function(_0x22ef3c){return _0x22ef3c;});}return null;};}function removeEntity(_0x1789c2,_0x38fe75){return function(_0x38c3f4){if(_0x38c3f4){return _0x38c3f4[_0xf1da('0x23')]()[_0xf1da('0x22')](function(){var _0xad1782=_0x38c3f4[_0xf1da('0x24')]({'plain':!![]});var _0x19a932=_0xf1da('0x25');return db[_0xf1da('0x26')][_0xf1da('0x23')]({'where':{'type':_0x19a932,'resourceId':_0xad1782['id']}})['then'](function(){return _0x38c3f4;});})['then'](function(){_0x1789c2['status'](0xcc)[_0xf1da('0x1a')]();});}};}function handleEntityNotFound(_0x430cf4,_0x2de621){return function(_0x4625d3){if(!_0x4625d3){_0x430cf4[_0xf1da('0x18')](0x194);}return _0x4625d3;};}function handleError(_0x20080d,_0x825d59){_0x825d59=_0x825d59||0x1f4;return function(_0x2ec752){logger[_0xf1da('0x27')](_0x2ec752[_0xf1da('0x28')]);if(_0x2ec752[_0xf1da('0x29')]){delete _0x2ec752[_0xf1da('0x29')];}_0x20080d[_0xf1da('0x19')](_0x825d59)['send'](_0x2ec752);};}exports[_0xf1da('0x2a')]=function(_0xaaee72,_0x10d305){var _0xd37d8b={},_0x736818={},_0x233bd2={'count':0x0,'rows':[]};var _0x2778d6=_['map'](db[_0xf1da('0x2b')][_0xf1da('0x2c')],function(_0x3197b1){return{'name':_0x3197b1[_0xf1da('0x2d')],'type':_0x3197b1[_0xf1da('0x2e')][_0xf1da('0x2f')]};});_0x736818[_0xf1da('0x30')]=_[_0xf1da('0x31')](_0x2778d6,'name');_0x736818[_0xf1da('0x32')]=_[_0xf1da('0x33')](_0xaaee72[_0xf1da('0x32')]);_0x736818[_0xf1da('0x34')]=_[_0xf1da('0x35')](_0x736818['model'],_0x736818['query']);_0xd37d8b['attributes']=_['intersection'](_0x736818[_0xf1da('0x30')],qs[_0xf1da('0x36')](_0xaaee72[_0xf1da('0x32')][_0xf1da('0x36')]));_0xd37d8b[_0xf1da('0x37')]=_0xd37d8b[_0xf1da('0x37')][_0xf1da('0x38')]?_0xd37d8b[_0xf1da('0x37')]:_0x736818[_0xf1da('0x30')];if(!_0xaaee72[_0xf1da('0x32')][_0xf1da('0x39')](_0xf1da('0x3a'))){_0xd37d8b[_0xf1da('0x1e')]=qs[_0xf1da('0x1e')](_0xaaee72[_0xf1da('0x32')][_0xf1da('0x1e')]);_0xd37d8b['offset']=qs[_0xf1da('0x3b')](_0xaaee72['query']['offset']);}_0xd37d8b[_0xf1da('0x3c')]=qs[_0xf1da('0x3d')](_0xaaee72[_0xf1da('0x32')][_0xf1da('0x3d')]);_0xd37d8b[_0xf1da('0x3e')]=qs[_0xf1da('0x34')](_[_0xf1da('0x3f')](_0xaaee72['query'],_0x736818[_0xf1da('0x34')]),_0x2778d6);if(_0xaaee72['query']['filter']){_0xd37d8b[_0xf1da('0x3e')]=_[_0xf1da('0x40')](_0xd37d8b[_0xf1da('0x3e')],{'$or':_['map'](_0x2778d6,function(_0x52a2a5){if(_0x52a2a5[_0xf1da('0x2e')]!=='VIRTUAL'){var _0x444580={};_0x444580[_0x52a2a5[_0xf1da('0x29')]]={'$like':'%'+_0xaaee72[_0xf1da('0x32')][_0xf1da('0x41')]+'%'};return _0x444580;}})});}_0xd37d8b=_[_0xf1da('0x40')]({},_0xd37d8b,_0xaaee72['options']);var _0x456402={'where':_0xd37d8b[_0xf1da('0x3e')]};return db[_0xf1da('0x2b')][_0xf1da('0x1d')](_0x456402)[_0xf1da('0x22')](function(_0x2614c4){_0x233bd2[_0xf1da('0x1d')]=_0x2614c4;if(_0xaaee72[_0xf1da('0x32')][_0xf1da('0x42')]){_0xd37d8b[_0xf1da('0x43')]=[{'all':!![]}];}return db[_0xf1da('0x2b')][_0xf1da('0x44')](_0xd37d8b);})['then'](function(_0x5161d3){_0x233bd2[_0xf1da('0x45')]=_0x5161d3;return _0x233bd2;})['then'](respondWithFilteredResult(_0x10d305,_0xd37d8b))[_0xf1da('0x46')](handleError(_0x10d305,null));};exports[_0xf1da('0x47')]=function(_0x234ca9,_0x4fa51a){var _0x8e6364={'raw':![],'where':{'id':_0x234ca9[_0xf1da('0x48')]['id']}},_0x358a90={};_0x358a90[_0xf1da('0x30')]=_[_0xf1da('0x33')](db['Schedule'][_0xf1da('0x2c')]);_0x358a90['query']=_[_0xf1da('0x33')](_0x234ca9[_0xf1da('0x32')]);_0x358a90[_0xf1da('0x34')]=_[_0xf1da('0x35')](_0x358a90[_0xf1da('0x30')],_0x358a90['query']);_0x8e6364[_0xf1da('0x37')]=_[_0xf1da('0x35')](_0x358a90[_0xf1da('0x30')],qs[_0xf1da('0x36')](_0x234ca9[_0xf1da('0x32')]['fields']));_0x8e6364[_0xf1da('0x37')]=_0x8e6364[_0xf1da('0x37')][_0xf1da('0x38')]?_0x8e6364[_0xf1da('0x37')]:_0x358a90[_0xf1da('0x30')];if(_0x234ca9[_0xf1da('0x32')][_0xf1da('0x42')]){_0x8e6364[_0xf1da('0x43')]=[{'all':!![]}];}_0x8e6364=_['merge']({},_0x8e6364,_0x234ca9[_0xf1da('0x49')]);return db[_0xf1da('0x2b')][_0xf1da('0x4a')](_0x8e6364)[_0xf1da('0x22')](handleEntityNotFound(_0x4fa51a,null))[_0xf1da('0x22')](respondWithResult(_0x4fa51a,null))[_0xf1da('0x46')](handleError(_0x4fa51a,null));};exports[_0xf1da('0x4b')]=function(_0x459fd1,_0x281d74){return db[_0xf1da('0x2b')][_0xf1da('0x4b')](_0x459fd1[_0xf1da('0x4c')],{})['then'](function(_0xee6fe0){var _0x9d8de5=_0x459fd1[_0xf1da('0x4d')]['get']({'plain':!![]});if(!_0x9d8de5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9d8de5[_0xf1da('0x4e')]===_0xf1da('0x4d')){var _0x3c9074=_0xee6fe0['get']({'plain':!![]});var _0x38adb3=_0xf1da('0x25');return db[_0xf1da('0x4f')][_0xf1da('0x4a')]({'where':{'name':_0x38adb3,'userProfileId':_0x9d8de5[_0xf1da('0x50')]},'raw':!![]})['then'](function(_0x16dc7c){if(_0x16dc7c&&_0x16dc7c['autoAssociation']===0x0){return db[_0xf1da('0x26')][_0xf1da('0x4b')]({'name':_0x3c9074[_0xf1da('0x29')],'resourceId':_0x3c9074['id'],'type':_0x16dc7c[_0xf1da('0x29')],'sectionId':_0x16dc7c['id']},{})[_0xf1da('0x22')](function(){return _0xee6fe0;});}else{return _0xee6fe0;}})['catch'](function(_0x560569){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560569);throw _0x560569;});}return _0xee6fe0;})[_0xf1da('0x22')](respondWithResult(_0x281d74,0xc9))[_0xf1da('0x46')](handleError(_0x281d74,null));};exports[_0xf1da('0x51')]=function(_0x25148d,_0x8f7650){if(_0x25148d[_0xf1da('0x4c')]['id']){delete _0x25148d[_0xf1da('0x4c')]['id'];}return db['Schedule'][_0xf1da('0x4a')]({'where':{'id':_0x25148d['params']['id']}})[_0xf1da('0x22')](handleEntityNotFound(_0x8f7650,null))[_0xf1da('0x22')](saveUpdates(_0x25148d[_0xf1da('0x4c')],null))['then'](respondWithResult(_0x8f7650,null))[_0xf1da('0x46')](handleError(_0x8f7650,null));};exports[_0xf1da('0x23')]=function(_0x3d8905,_0x1b2eb8){return db[_0xf1da('0x2b')]['find']({'where':{'id':_0x3d8905[_0xf1da('0x48')]['id']}})[_0xf1da('0x22')](handleEntityNotFound(_0x1b2eb8,null))[_0xf1da('0x22')](removeEntity(_0x1b2eb8,null))[_0xf1da('0x46')](handleError(_0x1b2eb8,null));};exports['run']=function(_0x2c3802,_0x4d4257,_0x1c0efc){var _0x4f9151=require(_0xf1da('0x52'));return db[_0xf1da('0x2b')]['find']({'where':{'id':_0x2c3802[_0xf1da('0x48')]['id']},'raw':!![]})[_0xf1da('0x22')](handleEntityNotFound(_0x4d4257,null))[_0xf1da('0x22')](function(){_0x4f9151[_0xf1da('0x53')](_0x2c3802[_0xf1da('0x48')]['id']);})[_0xf1da('0x22')](respondWithStatusCode(_0x4d4257,null))['catch'](handleError(_0x4d4257,null));};
\ No newline at end of file
index 3514b91..b3a69a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6212=['Schedule','tools_schedules','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define'];(function(_0x2d6f29,_0x2f6366){var _0x291f5a=function(_0x36b6bd){while(--_0x36b6bd){_0x2d6f29['push'](_0x2d6f29['shift']());}};_0x291f5a(++_0x2f6366);}(_0x6212,0x89));var _0x2621=function(_0x2535f9,_0x5be119){_0x2535f9=_0x2535f9-0x0;var _0x244496=_0x6212[_0x2535f9];return _0x244496;};'use strict';var _=require(_0x2621('0x0'));var util=require(_0x2621('0x1'));var logger=require(_0x2621('0x2'))(_0x2621('0x3'));var moment=require(_0x2621('0x4'));var BPromise=require(_0x2621('0x5'));var rp=require(_0x2621('0x6'));var fs=require('fs');var path=require(_0x2621('0x7'));var rimraf=require(_0x2621('0x8'));var config=require(_0x2621('0x9'));var attributes=require(_0x2621('0xa'));module[_0x2621('0xb')]=function(_0xec6c10,_0x1b2ae2){return _0xec6c10[_0x2621('0xc')](_0x2621('0xd'),attributes,{'tableName':_0x2621('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8cfd=['util','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8cfd,0x1c1));var _0xd8cf=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0x8cfd[_0x3bd52b];return _0x1e5b89;};'use strict';var _=require(_0xd8cf('0x0'));var util=require(_0xd8cf('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd8cf('0x2'));var rp=require(_0xd8cf('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd8cf('0x4'));var config=require(_0xd8cf('0x5'));var attributes=require(_0xd8cf('0x6'));module[_0xd8cf('0x7')]=function(_0x427ace,_0x580928){return _0x427ace[_0xd8cf('0x8')](_0xd8cf('0x9'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fa6b5df..fece990 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd34=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util'];(function(_0x2416b2,_0x134439){var _0x159c30=function(_0x2e335c){while(--_0x2e335c){_0x2416b2['push'](_0x2416b2['shift']());}};_0x159c30(++_0x134439);}(_0xcd34,0x76));var _0x4cd3=function(_0x32e101,_0x4c2036){_0x32e101=_0x32e101-0x0;var _0x3f439f=_0xcd34[_0x32e101];return _0x3f439f;};'use strict';var _=require(_0x4cd3('0x0'));var util=require(_0x4cd3('0x1'));var moment=require(_0x4cd3('0x2'));var BPromise=require('bluebird');var rs=require(_0x4cd3('0x3'));var fs=require('fs');var Redis=require(_0x4cd3('0x4'));var db=require(_0x4cd3('0x5'))['db'];var utils=require(_0x4cd3('0x6'));var logger=require('../../config/logger')(_0x4cd3('0x7'));var config=require(_0x4cd3('0x8'));var jayson=require(_0x4cd3('0x9'));var client=jayson['client'][_0x4cd3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3797ce,_0x22a3ab,_0x593bb6){return new BPromise(function(_0x2c6e93,_0x26d7fd){return client[_0x4cd3('0xb')](_0x3797ce,_0x593bb6)[_0x4cd3('0xc')](function(_0x406501){logger['info'](_0x4cd3('0xd'),_0x22a3ab,_0x4cd3('0xe'));logger[_0x4cd3('0xf')](_0x4cd3('0x10'),_0x22a3ab,_0x4cd3('0xe'),JSON[_0x4cd3('0x11')](_0x406501));if(_0x406501['error']){if(_0x406501['error'][_0x4cd3('0x12')]===0x1f4){logger[_0x4cd3('0x13')](_0x4cd3('0xd'),_0x22a3ab,_0x406501[_0x4cd3('0x13')]['message']);return _0x26d7fd(_0x406501['error'][_0x4cd3('0x14')]);}logger['error']('Schedule,\x20%s,\x20%s',_0x22a3ab,_0x406501[_0x4cd3('0x13')]['message']);return _0x2c6e93(_0x406501[_0x4cd3('0x13')][_0x4cd3('0x14')]);}else{logger[_0x4cd3('0x15')](_0x4cd3('0xd'),_0x22a3ab,'request\x20sent');_0x2c6e93(_0x406501[_0x4cd3('0x16')]['message']);}})[_0x4cd3('0x17')](function(_0x5402df){logger[_0x4cd3('0x13')](_0x4cd3('0xd'),_0x22a3ab,_0x5402df);_0x26d7fd(_0x5402df);});});}
\ No newline at end of file
+var _0x3bfe=['../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3e6b2f,_0x1ffa07){var _0x323215=function(_0x5c4d82){while(--_0x5c4d82){_0x3e6b2f['push'](_0x3e6b2f['shift']());}};_0x323215(++_0x1ffa07);}(_0x3bfe,0x100));var _0xe3bf=function(_0x456f70,_0x66f4e5){_0x456f70=_0x456f70-0x0;var _0x12c9e8=_0x3bfe[_0x456f70];return _0x12c9e8;};'use strict';var _=require(_0xe3bf('0x0'));var util=require(_0xe3bf('0x1'));var moment=require(_0xe3bf('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3bf('0x3'));var fs=require('fs');var Redis=require(_0xe3bf('0x4'));var db=require(_0xe3bf('0x5'))['db'];var utils=require(_0xe3bf('0x6'));var logger=require('../../config/logger')(_0xe3bf('0x7'));var config=require(_0xe3bf('0x8'));var jayson=require(_0xe3bf('0x9'));var client=jayson[_0xe3bf('0xa')][_0xe3bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x487175,_0x355b6f,_0x1e2eee){return new BPromise(function(_0x394848,_0x49194a){return client[_0xe3bf('0xc')](_0x487175,_0x1e2eee)[_0xe3bf('0xd')](function(_0x30250f){logger[_0xe3bf('0xe')](_0xe3bf('0xf'),_0x355b6f,_0xe3bf('0x10'));logger[_0xe3bf('0x11')](_0xe3bf('0x12'),_0x355b6f,_0xe3bf('0x10'),JSON[_0xe3bf('0x13')](_0x30250f));if(_0x30250f[_0xe3bf('0x14')]){if(_0x30250f[_0xe3bf('0x14')]['code']===0x1f4){logger[_0xe3bf('0x14')](_0xe3bf('0xf'),_0x355b6f,_0x30250f[_0xe3bf('0x14')]['message']);return _0x49194a(_0x30250f['error'][_0xe3bf('0x15')]);}logger[_0xe3bf('0x14')](_0xe3bf('0xf'),_0x355b6f,_0x30250f[_0xe3bf('0x14')][_0xe3bf('0x15')]);return _0x394848(_0x30250f[_0xe3bf('0x14')]['message']);}else{logger[_0xe3bf('0xe')](_0xe3bf('0xf'),_0x355b6f,_0xe3bf('0x10'));_0x394848(_0x30250f[_0xe3bf('0x16')][_0xe3bf('0x15')]);}})[_0xe3bf('0x17')](function(_0x2ffe99){logger['error']('Schedule,\x20%s,\x20%s',_0x355b6f,_0x2ffe99);_0x49194a(_0x2ffe99);});});}
\ No newline at end of file
index e1919d5..2e35918 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb033=['../../config/environment','./screenRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xf7d77f,_0x566a20){var _0x388dda=function(_0x48da92){while(--_0x48da92){_0xf7d77f['push'](_0xf7d77f['shift']());}};_0x388dda(++_0x566a20);}(_0xb033,0x9f));var _0x3b03=function(_0x29ac01,_0x3059eb){_0x29ac01=_0x29ac01-0x0;var _0x29ce40=_0xb033[_0x29ac01];return _0x29ce40;};'use strict';var multer=require(_0x3b03('0x0'));var util=require(_0x3b03('0x1'));var path=require(_0x3b03('0x2'));var timeout=require(_0x3b03('0x3'));var express=require(_0x3b03('0x4'));var router=express[_0x3b03('0x5')]();var fs_extra=require(_0x3b03('0x6'));var auth=require(_0x3b03('0x7'));var interaction=require(_0x3b03('0x8'));var config=require(_0x3b03('0x9'));var controller=require(_0x3b03('0xa'));router[_0x3b03('0xb')]('/',auth[_0x3b03('0xc')](),controller['index']);router[_0x3b03('0xb')](_0x3b03('0xd'),auth['isAuthenticated'](),controller[_0x3b03('0xe')]);router['get'](_0x3b03('0xf'),auth[_0x3b03('0xc')](),controller[_0x3b03('0x10')]);router[_0x3b03('0xb')](_0x3b03('0x11'),auth['isAuthenticated'](),controller[_0x3b03('0x12')]);router[_0x3b03('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3b03('0x14')]('/:id',auth[_0x3b03('0xc')](),controller[_0x3b03('0x15')]);router['delete'](_0x3b03('0xf'),auth[_0x3b03('0xc')](),controller[_0x3b03('0x16')]);module[_0x3b03('0x17')]=router;
\ No newline at end of file
+var _0xe54e=['create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index','/describe','/:id','show','download'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0xe54e,0x1e8));var _0xee54=function(_0xa46df1,_0x5135fa){_0xa46df1=_0xa46df1-0x0;var _0x9ba134=_0xe54e[_0xa46df1];return _0x9ba134;};'use strict';var multer=require(_0xee54('0x0'));var util=require(_0xee54('0x1'));var path=require(_0xee54('0x2'));var timeout=require(_0xee54('0x3'));var express=require(_0xee54('0x4'));var router=express[_0xee54('0x5')]();var fs_extra=require(_0xee54('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xee54('0x7'));var config=require('../../config/environment');var controller=require(_0xee54('0x8'));router[_0xee54('0x9')]('/',auth[_0xee54('0xa')](),controller[_0xee54('0xb')]);router[_0xee54('0x9')](_0xee54('0xc'),auth[_0xee54('0xa')](),controller['describe']);router[_0xee54('0x9')](_0xee54('0xd'),auth[_0xee54('0xa')](),controller[_0xee54('0xe')]);router[_0xee54('0x9')]('/:id/download',auth[_0xee54('0xa')](),controller[_0xee54('0xf')]);router['post']('/',auth[_0xee54('0xa')](),controller[_0xee54('0x10')]);router[_0xee54('0x11')]('/:id',auth[_0xee54('0xa')](),controller[_0xee54('0x12')]);router['delete']('/:id',auth[_0xee54('0xa')](),controller[_0xee54('0x13')]);module[_0xee54('0x14')]=router;
\ No newline at end of file
index 742451a..e80c5e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa413=['createdAt','updatedAt','sequelize','path','exports','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString'];(function(_0x49aa7d,_0x5d46d8){var _0xdd0d26=function(_0x159df7){while(--_0x159df7){_0x49aa7d['push'](_0x49aa7d['shift']());}};_0xdd0d26(++_0x5d46d8);}(_0xa413,0x1e5));var _0x3a41=function(_0x317a08,_0x574a44){_0x317a08=_0x317a08-0x0;var _0x4e93c5=_0xa413[_0x317a08];return _0x4e93c5;};'use strict';var Sequelize=require(_0x3a41('0x0'));var moment=require('moment');var path=require(_0x3a41('0x1'));var config=require('../../config/environment');module[_0x3a41('0x2')]={'format':{'type':Sequelize[_0x3a41('0x3')],'get':function(){return this['getDataValue']('value')?path[_0x3a41('0x4')](this[_0x3a41('0x5')](_0x3a41('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x3a41('0x7')]},'channel':{'type':Sequelize[_0x3a41('0x7')]},'value':{'type':Sequelize[_0x3a41('0x7')],'set':function(_0x45f6d2){var _0x407d52=_0x45f6d2[_0x3a41('0x8')](/\\/g,'/');this[_0x3a41('0x9')](_0x3a41('0x6'),_0x407d52);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x3a41('0xa')],'set':function(_0x570304){this['setDataValue']('startedAt',moment()[_0x3a41('0xb')](_0x570304,'ms'));this['setDataValue'](_0x3a41('0xc'),moment());this['setDataValue'](_0x3a41('0xd'),_0x570304);}},'startedAt':{'type':Sequelize[_0x3a41('0xe')],'get':function(){return moment(this['getDataValue'](_0x3a41('0xf')))[_0x3a41('0x10')](_0x3a41('0x11'))[_0x3a41('0x12')]();}},'closedAt':{'type':Sequelize[_0x3a41('0xe')],'get':function(){return moment(this['getDataValue'](_0x3a41('0xc')))[_0x3a41('0x10')](_0x3a41('0x11'))[_0x3a41('0x12')]();}},'createdAt':{'type':Sequelize[_0x3a41('0xe')],'get':function(){return moment(this[_0x3a41('0x5')](_0x3a41('0x13')))[_0x3a41('0x10')](_0x3a41('0x11'))[_0x3a41('0x12')]();}},'updatedAt':{'type':Sequelize[_0x3a41('0xe')],'get':function(){return moment(this['getDataValue'](_0x3a41('0x14')))[_0x3a41('0x10')]('MM-DD-YYYY\x20HH:mm')['toString']();}}};
\ No newline at end of file
+var _0xd070=['startedAt','subtract','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','closedAt','format','createdAt','updatedAt','sequelize','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER'];(function(_0x3d3e50,_0x67882c){var _0x4273cb=function(_0x2382b5){while(--_0x2382b5){_0x3d3e50['push'](_0x3d3e50['shift']());}};_0x4273cb(++_0x67882c);}(_0xd070,0x8e));var _0x0d07=function(_0xd14d39,_0x23b26c){_0xd14d39=_0xd14d39-0x0;var _0x5c727c=_0xd070[_0xd14d39];return _0x5c727c;};'use strict';var Sequelize=require(_0x0d07('0x0'));var moment=require('moment');var path=require(_0x0d07('0x1'));var config=require(_0x0d07('0x2'));module[_0x0d07('0x3')]={'format':{'type':Sequelize[_0x0d07('0x4')],'get':function(){return this[_0x0d07('0x5')](_0x0d07('0x6'))?path[_0x0d07('0x7')](this[_0x0d07('0x5')](_0x0d07('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x0d07('0x8')]},'channel':{'type':Sequelize[_0x0d07('0x8')]},'value':{'type':Sequelize['STRING'],'set':function(_0x13d75a){var _0x5a4366=_0x13d75a[_0x0d07('0x9')](/\\/g,'/');this[_0x0d07('0xa')](_0x0d07('0x6'),_0x5a4366);}},'rating':{'type':Sequelize[_0x0d07('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x0d07('0xb')],'set':function(_0xc5b04d){this[_0x0d07('0xa')](_0x0d07('0xc'),moment()[_0x0d07('0xd')](_0xc5b04d,'ms'));this[_0x0d07('0xa')]('closedAt',moment());this['setDataValue'](_0x0d07('0xe'),_0xc5b04d);}},'startedAt':{'type':Sequelize[_0x0d07('0xf')],'get':function(){return moment(this['getDataValue'](_0x0d07('0xc')))['format'](_0x0d07('0x10'))[_0x0d07('0x11')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0d07('0x5')](_0x0d07('0x12')))[_0x0d07('0x13')](_0x0d07('0x10'))[_0x0d07('0x11')]();}},'createdAt':{'type':Sequelize[_0x0d07('0xf')],'get':function(){return moment(this['getDataValue'](_0x0d07('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0x0d07('0x11')]();}},'updatedAt':{'type':Sequelize[_0x0d07('0xf')],'get':function(){return moment(this[_0x0d07('0x5')](_0x0d07('0x15')))[_0x0d07('0x13')]('MM-DD-YYYY\x20HH:mm')['toString']();}}};
\ No newline at end of file
index f4f9881..ba3fe3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','save','update','then','destroy','sendStatus','send','index','ScreenRecording','rawAttributes','key','model','differenceBy','map','name','format','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','type','VIRTUAL','filter','merge','options','include','findAll','catch','show','params','includeAll','find','create','body','duration','createdAt','closedAt','describe','../../components/encryptor','uniqueid','value','join','root','server/files/screen_recordings','decryptFile','secrets','recording','existsSync','ValidationError','filename','download','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x008c,0x188));var _0xc008=function(_0x19c788,_0x2cf31d){_0x19c788=_0x19c788-0x0;var _0x364e70=_0x008c[_0x19c788];return _0x364e70;};'use strict';var emlformat=require(_0xc008('0x0'));var rimraf=require(_0xc008('0x1'));var zipdir=require(_0xc008('0x2'));var jsonpatch=require(_0xc008('0x3'));var rp=require(_0xc008('0x4'));var moment=require('moment');var BPromise=require(_0xc008('0x5'));var Mustache=require(_0xc008('0x6'));var util=require(_0xc008('0x7'));var path=require(_0xc008('0x8'));var sox=require(_0xc008('0x9'));var csv=require(_0xc008('0xa'));var ejs=require(_0xc008('0xb'));var fs=require('fs');var fs_extra=require(_0xc008('0xc'));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 licenseUtil=require(_0xc008('0x16'));var db=require(_0xc008('0x17'))['db'];function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=typeof _0x5ee00b[_0xc008('0x1b')]===_0xc008('0x1c')&&typeof _0x5ee00b[_0xc008('0x1d')]===_0xc008('0x1c');var _0x4fe771=_0x5e894e['count'];var _0x540e45=_0x4bd0f4?0x0:_0x5ee00b['offset'];var _0x46042b=_0x4bd0f4?_0x5e894e[_0xc008('0x1e')]:_0x5ee00b['offset']+_0x5ee00b[_0xc008('0x1d')];var _0x5906e6;if(_0x46042b>=_0x4fe771){_0x46042b=_0x4fe771;_0x5906e6=0xc8;}else{_0x5906e6=0xce;}_0x3f0ecf['status'](_0x5906e6);return _0x3f0ecf['set']('Content-Range',_0x540e45+'-'+_0x46042b+'/'+_0x4fe771)[_0xc008('0x1a')](_0x5e894e);}return null;};}function patchUpdates(_0x4b9726){return function(_0x5560b1){try{jsonpatch['apply'](_0x5560b1,_0x4b9726,!![]);}catch(_0x4a582d){return BPromise['reject'](_0x4a582d);}return _0x5560b1[_0xc008('0x1f')]();};}function saveUpdates(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x20')](_0x4777a6)[_0xc008('0x21')](function(_0x4f43e2){return _0x4f43e2;});}return null;};}function removeEntity(_0x459fd9,_0x5c85f2){return function(_0x58a6ea){if(_0x58a6ea){return _0x58a6ea[_0xc008('0x22')]()[_0xc008('0x21')](function(){_0x459fd9[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();});}};}function handleEntityNotFound(_0x5410f5,_0x48582b){return function(_0x5de1e9){if(!_0x5de1e9){_0x5410f5[_0xc008('0x23')](0x194);}return _0x5de1e9;};}function handleError(_0x15dade,_0x92c582){_0x92c582=_0x92c582||0x1f4;return function(_0x2e31c2){logger['error'](_0x2e31c2['stack']);if(_0x2e31c2['name']){delete _0x2e31c2['name'];}_0x15dade['status'](_0x92c582)[_0xc008('0x24')](_0x2e31c2);};}exports[_0xc008('0x25')]=function(_0x25eae4,_0x529961){var _0x24c14c={},_0x32390d={},_0x209591={'count':0x0,'rows':[]};var _0x2a7d4f=_['map'](db[_0xc008('0x26')][_0xc008('0x27')],function(_0x53ed35){return{'name':_0x53ed35['fieldName'],'type':_0x53ed35['type'][_0xc008('0x28')]};});_0x32390d[_0xc008('0x29')]=_[_0xc008('0x2a')](_[_0xc008('0x2b')](_0x2a7d4f,_0xc008('0x2c')),[_0xc008('0x2d')]);_0x32390d[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x25eae4[_0xc008('0x2e')]);_0x32390d[_0xc008('0x30')]=_[_0xc008('0x31')](_0x32390d[_0xc008('0x29')],_0x32390d['query']);_0x24c14c[_0xc008('0x32')]=_[_0xc008('0x31')](_0x32390d['model'],qs[_0xc008('0x33')](_0x25eae4[_0xc008('0x2e')][_0xc008('0x33')]));_0x24c14c[_0xc008('0x32')]=_0x24c14c[_0xc008('0x32')][_0xc008('0x34')]?_0x24c14c[_0xc008('0x32')]:_0x32390d[_0xc008('0x29')];if(!_0x25eae4[_0xc008('0x2e')]['hasOwnProperty'](_0xc008('0x35'))){_0x24c14c[_0xc008('0x1d')]=qs[_0xc008('0x1d')](_0x25eae4[_0xc008('0x2e')][_0xc008('0x1d')]);_0x24c14c[_0xc008('0x1b')]=qs[_0xc008('0x1b')](_0x25eae4['query'][_0xc008('0x1b')]);}_0x24c14c[_0xc008('0x36')]=qs['sort'](_0x25eae4[_0xc008('0x2e')][_0xc008('0x37')]);_0x24c14c['where']=qs[_0xc008('0x30')](_[_0xc008('0x38')](_0x25eae4[_0xc008('0x2e')],_0x32390d['filters']),_0x2a7d4f);if(_0x25eae4['query']['filter']){_0x24c14c[_0xc008('0x39')]=_['merge'](_0x24c14c[_0xc008('0x39')],{'$or':_[_0xc008('0x2b')](_0x2a7d4f,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x3a')]!==_0xc008('0x3b')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x2c')]]={'$like':'%'+_0x25eae4[_0xc008('0x2e')][_0xc008('0x3c')]+'%'};return _0xa381d1;}})});}_0x24c14c=_[_0xc008('0x3d')]({},_0x24c14c,_0x25eae4[_0xc008('0x3e')]);var _0xdfca2e={'where':_0x24c14c[_0xc008('0x39')]};return db[_0xc008('0x26')]['count'](_0xdfca2e)[_0xc008('0x21')](function(_0x23c4db){_0x209591[_0xc008('0x1e')]=_0x23c4db;if(_0x25eae4[_0xc008('0x2e')]['includeAll']){_0x24c14c[_0xc008('0x3f')]=[{'all':!![]}];}return db[_0xc008('0x26')][_0xc008('0x40')](_0x24c14c);})[_0xc008('0x21')](function(_0x2d142d){_0x209591['rows']=_0x2d142d;return _0x209591;})[_0xc008('0x21')](respondWithFilteredResult(_0x529961,_0x24c14c))[_0xc008('0x41')](handleError(_0x529961,null));};exports[_0xc008('0x42')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':![],'where':{'id':_0x3e9a99[_0xc008('0x43')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x29')]=_[_0xc008('0x2f')](db['ScreenRecording'][_0xc008('0x27')]);_0xf4cc4b[_0xc008('0x2e')]=_[_0xc008('0x2f')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x30')]=_['intersection'](_0xf4cc4b[_0xc008('0x29')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x32')]=_[_0xc008('0x31')](_0xf4cc4b['model'],qs[_0xc008('0x33')](_0x3e9a99[_0xc008('0x2e')][_0xc008('0x33')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x32')][_0xc008('0x34')]?_0x4f93a4[_0xc008('0x32')]:_0xf4cc4b[_0xc008('0x29')];if(_0x3e9a99[_0xc008('0x2e')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x26')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x21')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x21')](respondWithResult(_0x7279e8,null))[_0xc008('0x41')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['ScreenRecording']['create'](_0x2cf641['body'],{})[_0xc008('0x21')](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x41')](handleError(_0x33be4f,null));};exports[_0xc008('0x20')]=function(_0x511383,_0x28bc33){if(_0x511383[_0xc008('0x47')]['id']){delete _0x511383[_0xc008('0x47')]['id'];}delete _0x511383[_0xc008('0x47')][_0xc008('0x48')];delete _0x511383[_0xc008('0x47')][_0xc008('0x49')];delete _0x511383[_0xc008('0x47')][_0xc008('0x4a')];delete _0x511383[_0xc008('0x47')]['value'];return db['ScreenRecording'][_0xc008('0x45')]({'where':{'id':_0x511383['params']['id']}})[_0xc008('0x21')](handleEntityNotFound(_0x28bc33,null))[_0xc008('0x21')](saveUpdates(_0x511383[_0xc008('0x47')],null))['then'](respondWithResult(_0x28bc33,null))[_0xc008('0x41')](handleError(_0x28bc33,null));};exports[_0xc008('0x4b')]=function(_0xee64,_0x8b9775){return db[_0xc008('0x26')]['describe']()[_0xc008('0x21')](respondWithResult(_0x8b9775,null))[_0xc008('0x41')](handleError(_0x8b9775,null));};exports['download']=function(_0x24f775,_0xfd6d1d,_0x5b5fbf){var _0x51d3dc=require(_0xc008('0x4c'));var _0xd47b74=![];var _0x20947b={};if(_0x24f775[_0xc008('0x2e')][_0xc008('0x3a')]&&_0x24f775['query']['type']===_0xc008('0x4d')){_0x20947b['uniqueid']=_0x24f775[_0xc008('0x43')]['id'];}else{_0x20947b['id']=_0x24f775[_0xc008('0x43')]['id'];}return db[_0xc008('0x26')][_0xc008('0x45')]({'where':_0x20947b,'attributes':['id',_0xc008('0x4e')],'raw':!![]})[_0xc008('0x21')](handleEntityNotFound(_0xfd6d1d,null))['then'](function(_0x2ea742){if(_0x2ea742){var _0xbd7422=path[_0xc008('0x4f')](config[_0xc008('0x50')],_0xc008('0x51'),_0x2ea742['value']);var _0x41fae3=util['format']('%s.cypher',_0xbd7422);if(fs['existsSync'](_0x41fae3)){_0xd47b74=!![];return _0x51d3dc[_0xc008('0x52')](_0x41fae3,_0xbd7422,config[_0xc008('0x53')][_0xc008('0x54')])['then'](function(){return _0x2ea742;});}return _0x2ea742;}})[_0xc008('0x21')](function(_0x2d8361){if(_0x2d8361){var _0x3dda82=path['join'](config[_0xc008('0x50')],_0xc008('0x51'),_0x2d8361[_0xc008('0x4e')]);if(!fs[_0xc008('0x55')](_0x3dda82)){throw new db['Sequelize'][(_0xc008('0x56'))]('ScreenRecording\x20not\x20found');}if(_0x2d8361[_0xc008('0x57')]){return _0xfd6d1d[_0xc008('0x58')](_0x3dda82,_0x2d8361[_0xc008('0x57')]+path[_0xc008('0x59')](_0x3dda82),function(){if(_0xd47b74){fs[_0xc008('0x5a')](_0x3dda82);}});}else{return _0xfd6d1d[_0xc008('0x58')](_0x3dda82,function(_0x4818c7){if(_0xd47b74){fs[_0xc008('0x5a')](_0x3dda82);}});}}})['catch'](function(_0x5bf4a9){if(_0x5bf4a9[_0xc008('0x5b')]===_0xc008('0x5c')){_0xfd6d1d['status'](0x194)[_0xc008('0x24')](_0xc008('0x5d'));}else{return handleError(_0xfd6d1d,null);}});};exports[_0xc008('0x22')]=function(_0x4517c0,_0x21ee6d){return db[_0xc008('0x26')][_0xc008('0x45')]({'where':{'id':_0x4517c0['params']['id']}})[_0xc008('0x21')](function(_0x462e1e){if(_[_0xc008('0x5e')](_0x462e1e)){throw new ReferenceError(_0xc008('0x5f'));}return _0x462e1e;})[_0xc008('0x21')](function(_0x167425){var _0x249898=path[_0xc008('0x4f')](config[_0xc008('0x50')],_0xc008('0x51'),_0x167425[_0xc008('0x4e')]);logger[_0xc008('0x60')](_0xc008('0x61'),_0x249898);if(!_[_0xc008('0x5e')](_0x167425['value'])&&fs[_0xc008('0x55')](_0x249898)){logger[_0xc008('0x60')](_0xc008('0x62')+_0x249898+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xc008('0x63')](_0x249898);}_0x249898=_0x249898+_0xc008('0x64');if(!_['isNil'](_0x167425['value'])&&fs[_0xc008('0x55')](_0x249898)){logger[_0xc008('0x60')](_0xc008('0x62')+_0x249898+_0xc008('0x65'));fs[_0xc008('0x63')](_0x249898);}return _0x167425;})[_0xc008('0x21')](function(_0x238852){if(!_0x238852)throw new InternalError();return _0x238852[_0xc008('0x22')]();})[_0xc008('0x21')](function(){_0x21ee6d[_0xc008('0x19')](0xcc)[_0xc008('0x18')]();})['catch'](handleError(_0x21ee6d,null));};
\ No newline at end of file
+var _0x032e=['status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','type','model','differenceBy','map','format','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ScreenRecording','rows','catch','show','find','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','destroy','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x579335,_0x51b314){var _0x367429=function(_0x2670b7){while(--_0x2670b7){_0x579335['push'](_0x579335['shift']());}};_0x367429(++_0x51b314);}(_0x032e,0x124));var _0xe032=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x032e[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['index']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={},_0x469290={},_0xae116e={'count':0x0,'rows':[]};var _0x4e8b72=_['map'](db['ScreenRecording'][_0xe032('0x2b')],function(_0x1dd34f){return{'name':_0x1dd34f[_0xe032('0x2c')],'type':_0x1dd34f[_0xe032('0x2d')]['key']};});_0x469290[_0xe032('0x2e')]=_[_0xe032('0x2f')](_[_0xe032('0x30')](_0x4e8b72,_0xe032('0x29')),[_0xe032('0x31')]);_0x469290['query']=_[_0xe032('0x32')](_0x5573e4[_0xe032('0x33')]);_0x469290[_0xe032('0x34')]=_[_0xe032('0x35')](_0x469290['model'],_0x469290[_0xe032('0x33')]);_0x38e7ea['attributes']=_[_0xe032('0x35')](_0x469290['model'],qs[_0xe032('0x36')](_0x5573e4['query'][_0xe032('0x36')]));_0x38e7ea['attributes']=_0x38e7ea[_0xe032('0x37')][_0xe032('0x38')]?_0x38e7ea['attributes']:_0x469290[_0xe032('0x2e')];if(!_0x5573e4[_0xe032('0x33')][_0xe032('0x39')](_0xe032('0x3a'))){_0x38e7ea['limit']=qs[_0xe032('0x21')](_0x5573e4['query'][_0xe032('0x21')]);_0x38e7ea[_0xe032('0x1f')]=qs['offset'](_0x5573e4[_0xe032('0x33')][_0xe032('0x1f')]);}_0x38e7ea['order']=qs[_0xe032('0x3b')](_0x5573e4[_0xe032('0x33')][_0xe032('0x3b')]);_0x38e7ea[_0xe032('0x3c')]=qs[_0xe032('0x34')](_[_0xe032('0x3d')](_0x5573e4[_0xe032('0x33')],_0x469290[_0xe032('0x34')]),_0x4e8b72);if(_0x5573e4[_0xe032('0x33')][_0xe032('0x3e')]){_0x38e7ea[_0xe032('0x3c')]=_[_0xe032('0x3f')](_0x38e7ea[_0xe032('0x3c')],{'$or':_[_0xe032('0x30')](_0x4e8b72,function(_0x39af44){if(_0x39af44[_0xe032('0x2d')]!==_0xe032('0x40')){var _0x555914={};_0x555914[_0x39af44[_0xe032('0x29')]]={'$like':'%'+_0x5573e4['query'][_0xe032('0x3e')]+'%'};return _0x555914;}})});}_0x38e7ea=_[_0xe032('0x3f')]({},_0x38e7ea,_0x5573e4[_0xe032('0x41')]);var _0x119790={'where':_0x38e7ea[_0xe032('0x3c')]};return db['ScreenRecording'][_0xe032('0x22')](_0x119790)['then'](function(_0x46ea84){_0xae116e['count']=_0x46ea84;if(_0x5573e4[_0xe032('0x33')][_0xe032('0x42')]){_0x38e7ea[_0xe032('0x43')]=[{'all':!![]}];}return db[_0xe032('0x44')]['findAll'](_0x38e7ea);})[_0xe032('0x27')](function(_0x5a6450){_0xae116e[_0xe032('0x45')]=_0x5a6450;return _0xae116e;})[_0xe032('0x27')](respondWithFilteredResult(_0x3e2575,_0x38e7ea))[_0xe032('0x46')](handleError(_0x3e2575,null));};exports[_0xe032('0x47')]=function(_0x4b58eb,_0x513b0c){var _0x45345d={'raw':![],'where':{'id':_0x4b58eb['params']['id']}},_0x203021={};_0x203021[_0xe032('0x2e')]=_[_0xe032('0x32')](db[_0xe032('0x44')][_0xe032('0x2b')]);_0x203021[_0xe032('0x33')]=_['keys'](_0x4b58eb[_0xe032('0x33')]);_0x203021[_0xe032('0x34')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],_0x203021[_0xe032('0x33')]);_0x45345d[_0xe032('0x37')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],qs['fields'](_0x4b58eb['query'][_0xe032('0x36')]));_0x45345d['attributes']=_0x45345d[_0xe032('0x37')][_0xe032('0x38')]?_0x45345d[_0xe032('0x37')]:_0x203021[_0xe032('0x2e')];if(_0x4b58eb[_0xe032('0x33')][_0xe032('0x42')]){_0x45345d[_0xe032('0x43')]=[{'all':!![]}];}_0x45345d=_[_0xe032('0x3f')]({},_0x45345d,_0x4b58eb[_0xe032('0x41')]);return db['ScreenRecording'][_0xe032('0x48')](_0x45345d)['then'](handleEntityNotFound(_0x513b0c,null))['then'](respondWithResult(_0x513b0c,null))[_0xe032('0x46')](handleError(_0x513b0c,null));};exports[_0xe032('0x49')]=function(_0x62bfc8,_0x1e54d3){return db['ScreenRecording'][_0xe032('0x49')](_0x62bfc8[_0xe032('0x4a')],{})[_0xe032('0x27')](respondWithResult(_0x1e54d3,0xc9))[_0xe032('0x46')](handleError(_0x1e54d3,null));};exports[_0xe032('0x26')]=function(_0x233d9e,_0x3774bc){if(_0x233d9e['body']['id']){delete _0x233d9e[_0xe032('0x4a')]['id'];}delete _0x233d9e[_0xe032('0x4a')]['duration'];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4b')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4c')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4d')];return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x233d9e[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x3774bc,null))[_0xe032('0x27')](saveUpdates(_0x233d9e[_0xe032('0x4a')],null))[_0xe032('0x27')](respondWithResult(_0x3774bc,null))[_0xe032('0x46')](handleError(_0x3774bc,null));};exports['describe']=function(_0x1c8b32,_0x53c8b2){return db[_0xe032('0x44')][_0xe032('0x4f')]()[_0xe032('0x27')](respondWithResult(_0x53c8b2,null))[_0xe032('0x46')](handleError(_0x53c8b2,null));};exports[_0xe032('0x50')]=function(_0x1b7a91,_0x2e29d3,_0xa98ee6){var _0x16c91e=require(_0xe032('0x51'));var _0x1b9012=![];var _0x564fe0={};if(_0x1b7a91[_0xe032('0x33')][_0xe032('0x2d')]&&_0x1b7a91['query'][_0xe032('0x2d')]==='uniqueid'){_0x564fe0[_0xe032('0x52')]=_0x1b7a91[_0xe032('0x4e')]['id'];}else{_0x564fe0['id']=_0x1b7a91[_0xe032('0x4e')]['id'];}return db[_0xe032('0x44')][_0xe032('0x48')]({'where':_0x564fe0,'attributes':['id','value'],'raw':!![]})[_0xe032('0x27')](handleEntityNotFound(_0x2e29d3,null))[_0xe032('0x27')](function(_0x1e1277){if(_0x1e1277){var _0x21a32f=path[_0xe032('0x53')](config[_0xe032('0x54')],_0xe032('0x55'),_0x1e1277['value']);var _0x3f46c0=util[_0xe032('0x31')](_0xe032('0x56'),_0x21a32f);if(fs[_0xe032('0x57')](_0x3f46c0)){_0x1b9012=!![];return _0x16c91e[_0xe032('0x58')](_0x3f46c0,_0x21a32f,config[_0xe032('0x59')][_0xe032('0x5a')])[_0xe032('0x27')](function(){return _0x1e1277;});}return _0x1e1277;}})[_0xe032('0x27')](function(_0x54c0b0){if(_0x54c0b0){var _0x795a58=path[_0xe032('0x53')](config[_0xe032('0x54')],'server/files/screen_recordings',_0x54c0b0[_0xe032('0x4d')]);if(!fs[_0xe032('0x57')](_0x795a58)){throw new db['Sequelize'][(_0xe032('0x5b'))](_0xe032('0x5c'));}if(_0x54c0b0[_0xe032('0x5d')]){return _0x2e29d3[_0xe032('0x50')](_0x795a58,_0x54c0b0[_0xe032('0x5d')]+path[_0xe032('0x5e')](_0x795a58),function(){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}else{return _0x2e29d3[_0xe032('0x50')](_0x795a58,function(_0x1aa18e){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}}})[_0xe032('0x46')](function(_0x505986){if(_0x505986[_0xe032('0x60')]===_0xe032('0x5c')){_0x2e29d3[_0xe032('0x1d')](0x194)[_0xe032('0x2a')](_0xe032('0x61'));}else{return handleError(_0x2e29d3,null);}});};exports['destroy']=function(_0x2b6ef8,_0x55e6b0){return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x2b6ef8[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](function(_0x3c5eb8){if(_[_0xe032('0x62')](_0x3c5eb8)){throw new ReferenceError(_0xe032('0x63'));}return _0x3c5eb8;})[_0xe032('0x27')](function(_0x22fd01){var _0x536510=path['join'](config['root'],_0xe032('0x55'),_0x22fd01[_0xe032('0x4d')]);logger[_0xe032('0x64')](_0xe032('0x65'),_0x536510);if(!_[_0xe032('0x62')](_0x22fd01[_0xe032('0x4d')])&&fs['existsSync'](_0x536510)){logger[_0xe032('0x64')](_0xe032('0x66')+_0x536510+_0xe032('0x67'));fs['unlinkSync'](_0x536510);}_0x536510=_0x536510+_0xe032('0x68');if(!_['isNil'](_0x22fd01[_0xe032('0x4d')])&&fs[_0xe032('0x57')](_0x536510)){logger['info']('File:\x20\x22'+_0x536510+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe032('0x69')](_0x536510);}return _0x22fd01;})['then'](function(_0x5157f7){if(!_0x5157f7)throw new InternalError();return _0x5157f7[_0xe032('0x6a')]();})[_0xe032('0x27')](function(){_0x55e6b0[_0xe032('0x1d')](0xcc)['end']();})[_0xe032('0x46')](handleError(_0x55e6b0,null));};
\ No newline at end of file
index bad955a..3c9fc52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7191=['ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports'];(function(_0x21bfe4,_0x20ffba){var _0x5bef31=function(_0x3683fb){while(--_0x3683fb){_0x21bfe4['push'](_0x21bfe4['shift']());}};_0x5bef31(++_0x20ffba);}(_0x7191,0xfa));var _0x1719=function(_0x4bf1e7,_0x31069d){_0x4bf1e7=_0x4bf1e7-0x0;var _0x29c5e5=_0x7191[_0x4bf1e7];return _0x29c5e5;};'use strict';var _=require(_0x1719('0x0'));var util=require(_0x1719('0x1'));var logger=require(_0x1719('0x2'))('api');var moment=require(_0x1719('0x3'));var BPromise=require(_0x1719('0x4'));var rp=require(_0x1719('0x5'));var fs=require('fs');var path=require(_0x1719('0x6'));var rimraf=require('rimraf');var config=require(_0x1719('0x7'));var attributes=require(_0x1719('0x8'));module[_0x1719('0x9')]=function(_0x39a52a,_0x3fded1){return _0x39a52a['define'](_0x1719('0xa'),attributes,{'tableName':_0x1719('0xb'),'paranoid':![],'indexes':[{'name':_0x1719('0xc'),'fields':['interactionid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x032f=['interactionid','lodash','../../config/logger','api','bluebird','path','rimraf','./screenRecording.attributes','screen_recordings'];(function(_0x4f57db,_0x7373a9){var _0x3929fd=function(_0x2fdd06){while(--_0x2fdd06){_0x4f57db['push'](_0x4f57db['shift']());}};_0x3929fd(++_0x7373a9);}(_0x032f,0xb5));var _0xf032=function(_0x31724d,_0x386e5f){_0x31724d=_0x31724d-0x0;var _0x7473d5=_0x032f[_0x31724d];return _0x7473d5;};'use strict';var _=require(_0xf032('0x0'));var util=require('util');var logger=require(_0xf032('0x1'))(_0xf032('0x2'));var moment=require('moment');var BPromise=require(_0xf032('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf032('0x4'));var rimraf=require(_0xf032('0x5'));var config=require('../../config/environment');var attributes=require(_0xf032('0x6'));module['exports']=function(_0x29290b,_0x2bc1a3){return _0x29290b['define']('ScreenRecording',attributes,{'tableName':_0xf032('0x7'),'paranoid':![],'indexes':[{'name':_0xf032('0x8'),'fields':[_0xf032('0x8')]}],'timestamps':!![]});};
\ No newline at end of file
index 62bac99..f56a206 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x528e=['randomstring','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','code','error','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x390489,_0x7bebec){var _0x28237a=function(_0x1fc0f2){while(--_0x1fc0f2){_0x390489['push'](_0x390489['shift']());}};_0x28237a(++_0x7bebec);}(_0x528e,0x105));var _0xe528=function(_0x3cd961,_0x52a6e9){_0x3cd961=_0x3cd961-0x0;var _0x53232e=_0x528e[_0x3cd961];return _0x53232e;};'use strict';var _=require(_0xe528('0x0'));var util=require('util');var moment=require(_0xe528('0x1'));var BPromise=require(_0xe528('0x2'));var rs=require(_0xe528('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe528('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe528('0x5'));var config=require(_0xe528('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe528('0x7')][_0xe528('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2234a4,_0x31034b,_0x379e88){return new BPromise(function(_0x40a8f3,_0x500e91){return client[_0xe528('0x9')](_0x2234a4,_0x379e88)[_0xe528('0xa')](function(_0x1519ae){logger[_0xe528('0xb')]('ScreenRecording,\x20%s,\x20%s',_0x31034b,_0xe528('0xc'));logger[_0xe528('0xd')](_0xe528('0xe'),_0x31034b,_0xe528('0xc'),JSON[_0xe528('0xf')](_0x1519ae));if(_0x1519ae['error']){if(_0x1519ae['error'][_0xe528('0x10')]===0x1f4){logger[_0xe528('0x11')](_0xe528('0x12'),_0x31034b,_0x1519ae['error'][_0xe528('0x13')]);return _0x500e91(_0x1519ae[_0xe528('0x11')][_0xe528('0x13')]);}logger['error'](_0xe528('0x12'),_0x31034b,_0x1519ae['error'][_0xe528('0x13')]);return _0x40a8f3(_0x1519ae[_0xe528('0x11')][_0xe528('0x13')]);}else{logger['info'](_0xe528('0x12'),_0x31034b,_0xe528('0xc'));_0x40a8f3(_0x1519ae[_0xe528('0x14')][_0xe528('0x13')]);}})[_0xe528('0x15')](function(_0x2416ad){logger['error'](_0xe528('0x12'),_0x31034b,_0x2416ad);_0x500e91(_0x2416ad);});});}
\ No newline at end of file
+var _0xb6d5=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x1e6fd1,_0x333352){var _0xcd8de1=function(_0x3a9e1f){while(--_0x3a9e1f){_0x1e6fd1['push'](_0x1e6fd1['shift']());}};_0xcd8de1(++_0x333352);}(_0xb6d5,0x67));var _0x5b6d=function(_0x165c96,_0x2269de){_0x165c96=_0x165c96-0x0;var _0x5c2420=_0xb6d5[_0x165c96];return _0x5c2420;};'use strict';var _=require(_0x5b6d('0x0'));var util=require(_0x5b6d('0x1'));var moment=require(_0x5b6d('0x2'));var BPromise=require(_0x5b6d('0x3'));var rs=require(_0x5b6d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b6d('0x5'))['db'];var utils=require(_0x5b6d('0x6'));var logger=require(_0x5b6d('0x7'))(_0x5b6d('0x8'));var config=require(_0x5b6d('0x9'));var jayson=require(_0x5b6d('0xa'));var client=jayson[_0x5b6d('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x310a98,_0x58e636,_0x4056ba){return new BPromise(function(_0x1bc53c,_0xb565c8){return client[_0x5b6d('0xc')](_0x310a98,_0x4056ba)[_0x5b6d('0xd')](function(_0x24a70d){logger[_0x5b6d('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x58e636,_0x5b6d('0xf'));logger[_0x5b6d('0x10')](_0x5b6d('0x11'),_0x58e636,'request\x20sent',JSON[_0x5b6d('0x12')](_0x24a70d));if(_0x24a70d[_0x5b6d('0x13')]){if(_0x24a70d[_0x5b6d('0x13')]['code']===0x1f4){logger[_0x5b6d('0x13')](_0x5b6d('0x14'),_0x58e636,_0x24a70d['error']['message']);return _0xb565c8(_0x24a70d[_0x5b6d('0x13')][_0x5b6d('0x15')]);}logger['error'](_0x5b6d('0x14'),_0x58e636,_0x24a70d[_0x5b6d('0x13')][_0x5b6d('0x15')]);return _0x1bc53c(_0x24a70d[_0x5b6d('0x13')][_0x5b6d('0x15')]);}else{logger['info'](_0x5b6d('0x14'),_0x58e636,_0x5b6d('0xf'));_0x1bc53c(_0x24a70d[_0x5b6d('0x16')][_0x5b6d('0x15')]);}})[_0x5b6d('0x17')](function(_0x2fc4d0){logger[_0x5b6d('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x58e636,_0x2fc4d0);_0xb565c8(_0x2fc4d0);});});}
\ No newline at end of file
index 54a7add..51d17dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c7b=['../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','getDate','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','/:id/logo','file','join','originalname','post','preferred','single','addPreferred','put','/:id','update','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x4a3cae,_0x216eca){var _0x5d94ae=function(_0x1be1b2){while(--_0x1be1b2){_0x4a3cae['push'](_0x4a3cae['shift']());}};_0x5d94ae(++_0x216eca);}(_0x2c7b,0x1b2));var _0xb2c7=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x2c7b[_0x3ff085];return _0x2b68c3;};'use strict';var multer=require(_0xb2c7('0x0'));var util=require(_0xb2c7('0x1'));var path=require(_0xb2c7('0x2'));var timeout=require(_0xb2c7('0x3'));var express=require(_0xb2c7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb2c7('0x5'));var interaction=require(_0xb2c7('0x6'));var config=require('../../config/environment');var controller=require(_0xb2c7('0x7'));router[_0xb2c7('0x8')]('/',auth[_0xb2c7('0x9')](),controller[_0xb2c7('0xa')]);router['get'](_0xb2c7('0xb'),controller[_0xb2c7('0xc')]);router[_0xb2c7('0x8')]('/:id',controller[_0xb2c7('0xd')]);router['get']('/:id/logo',controller[_0xb2c7('0xe')]);router[_0xb2c7('0x8')](_0xb2c7('0xf'),controller[_0xb2c7('0x10')]);router['get'](_0xb2c7('0x11'),controller['gdpr']);router[_0xb2c7('0x8')](_0xb2c7('0x12'),controller[_0xb2c7('0x13')]);router[_0xb2c7('0x8')](_0xb2c7('0x14'),controller[_0xb2c7('0x15')]);var upload=multer({'storage':multer[_0xb2c7('0x16')]({'destination':function(_0x45688f,_0x2fcd03,_0x1f5fbf){_0x1f5fbf(null,path['join'](config[_0xb2c7('0x17')],_0xb2c7('0x18')));},'filename':function(_0x485783,_0x2968d4,_0x26f195){_0x26f195(null,util[_0xb2c7('0x19')](_0xb2c7('0x1a'),_0xb2c7('0x1b'),path[_0xb2c7('0x1c')](_0x2968d4['originalname'])));}})});router['post'](_0xb2c7('0x1d'),upload['single'](_0xb2c7('0x1e')),controller['addLogo']);var upload=multer({'storage':multer[_0xb2c7('0x16')]({'destination':function(_0x55fb46,_0x2c765e,_0x110df9){_0x110df9(null,path[_0xb2c7('0x1f')](config['root'],_0xb2c7('0x18')));},'filename':function(_0x182a9c,_0x550bab,_0x376e2f){_0x376e2f(null,util[_0xb2c7('0x19')](_0xb2c7('0x1a'),'logologin',path[_0xb2c7('0x1c')](_0x550bab[_0xb2c7('0x20')])));}})});router[_0xb2c7('0x21')](_0xb2c7('0xf'),upload['single'](_0xb2c7('0x1e')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xb2c7('0x16')]({'destination':function(_0x4e2cbe,_0x40c086,_0x21d60e){_0x21d60e(null,path[_0xb2c7('0x1f')](config['root'],_0xb2c7('0x18')));},'filename':function(_0x118c3d,_0x5d2961,_0x37e499){_0x37e499(null,util[_0xb2c7('0x19')](_0xb2c7('0x1a'),_0xb2c7('0x22'),path[_0xb2c7('0x1c')](_0x5d2961[_0xb2c7('0x20')])));}})});router[_0xb2c7('0x21')]('/:id/preferred',upload[_0xb2c7('0x23')](_0xb2c7('0x1e')),controller[_0xb2c7('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x33c929,_0x5965c6,_0x5eaccf){_0x5eaccf(null,path[_0xb2c7('0x1f')](config[_0xb2c7('0x17')],_0xb2c7('0x18')));},'filename':function(_0x3a8fd9,_0xe1438f,_0x5d521a){_0x5d521a(null,util[_0xb2c7('0x19')]('%s%s','favicon',path[_0xb2c7('0x1c')](_0xe1438f[_0xb2c7('0x20')])));}})});router[_0xb2c7('0x21')]('/:id/favicon',upload[_0xb2c7('0x23')]('file'),controller['addFavicon']);router[_0xb2c7('0x25')](_0xb2c7('0x26'),auth[_0xb2c7('0x9')](),controller[_0xb2c7('0x27')]);module['exports']=router;
\ No newline at end of file
+var _0xa5f7=['file','join','/:id/logo_login','addLogoLogin','addPreferred','addFavicon','update','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','isAuthenticated','index','get','/:id','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','extname','originalname','post','single'];(function(_0x3e1051,_0xe89bca){var _0x57bf77=function(_0x374cd5){while(--_0x374cd5){_0x3e1051['push'](_0x3e1051['shift']());}};_0x57bf77(++_0xe89bca);}(_0xa5f7,0x10f));var _0x7a5f=function(_0x368bba,_0x1f625b){_0x368bba=_0x368bba-0x0;var _0x409f8f=_0xa5f7[_0x368bba];return _0x409f8f;};'use strict';var multer=require(_0x7a5f('0x0'));var util=require(_0x7a5f('0x1'));var path=require(_0x7a5f('0x2'));var timeout=require(_0x7a5f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7a5f('0x4'));var interaction=require(_0x7a5f('0x5'));var config=require(_0x7a5f('0x6'));var controller=require(_0x7a5f('0x7'));router['get']('/',auth[_0x7a5f('0x8')](),controller[_0x7a5f('0x9')]);router[_0x7a5f('0xa')]('/now',controller['getDate']);router[_0x7a5f('0xa')](_0x7a5f('0xb'),controller['show']);router[_0x7a5f('0xa')]('/:id/logo',controller['getLogo']);router[_0x7a5f('0xa')]('/:id/logo_login',controller['getLogoLogin']);router[_0x7a5f('0xa')](_0x7a5f('0xc'),controller['gdpr']);router[_0x7a5f('0xa')](_0x7a5f('0xd'),controller[_0x7a5f('0xe')]);router[_0x7a5f('0xa')](_0x7a5f('0xf'),controller[_0x7a5f('0x10')]);var upload=multer({'storage':multer[_0x7a5f('0x11')]({'destination':function(_0x548fb0,_0x382f5c,_0x352166){_0x352166(null,path['join'](config[_0x7a5f('0x12')],_0x7a5f('0x13')));},'filename':function(_0x1e6c9f,_0x4accac,_0x406e07){_0x406e07(null,util[_0x7a5f('0x14')](_0x7a5f('0x15'),'logo',path[_0x7a5f('0x16')](_0x4accac[_0x7a5f('0x17')])));}})});router[_0x7a5f('0x18')]('/:id/logo',upload[_0x7a5f('0x19')](_0x7a5f('0x1a')),controller['addLogo']);var upload=multer({'storage':multer[_0x7a5f('0x11')]({'destination':function(_0x17235d,_0x4b81e6,_0x237eed){_0x237eed(null,path[_0x7a5f('0x1b')](config[_0x7a5f('0x12')],_0x7a5f('0x13')));},'filename':function(_0x8be8c9,_0x40f11a,_0x5f3ae8){_0x5f3ae8(null,util['format']('%s%s','logologin',path[_0x7a5f('0x16')](_0x40f11a['originalname'])));}})});router[_0x7a5f('0x18')](_0x7a5f('0x1c'),upload[_0x7a5f('0x19')](_0x7a5f('0x1a')),controller[_0x7a5f('0x1d')]);var upload=multer({'storage':multer[_0x7a5f('0x11')]({'destination':function(_0x216d9e,_0x510033,_0x349936){_0x349936(null,path[_0x7a5f('0x1b')](config[_0x7a5f('0x12')],_0x7a5f('0x13')));},'filename':function(_0x24395f,_0x7aa4b0,_0x21f6c4){_0x21f6c4(null,util[_0x7a5f('0x14')](_0x7a5f('0x15'),'preferred',path[_0x7a5f('0x16')](_0x7aa4b0['originalname'])));}})});router['post'](_0x7a5f('0xd'),upload['single']('file'),controller[_0x7a5f('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x33996b,_0x994835,_0x369dd9){_0x369dd9(null,path[_0x7a5f('0x1b')](config[_0x7a5f('0x12')],'server/files/images/logos/'));},'filename':function(_0x254602,_0x2e491e,_0x47c6d2){_0x47c6d2(null,util[_0x7a5f('0x14')](_0x7a5f('0x15'),'favicon',path[_0x7a5f('0x16')](_0x2e491e[_0x7a5f('0x17')])));}})});router[_0x7a5f('0x18')]('/:id/favicon',upload[_0x7a5f('0x19')](_0x7a5f('0x1a')),controller[_0x7a5f('0x1f')]);router['put']('/:id',auth[_0x7a5f('0x8')](),controller[_0x7a5f('0x20')]);module['exports']=router;
\ No newline at end of file
index 764943d..f87307a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0x164230,_0x4192f8){var _0x34153e=function(_0x85df3c){while(--_0x85df3c){_0x164230['push'](_0x164230['shift']());}};_0x34153e(++_0x4192f8);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3a2632,_0x96f102){_0x3a2632=_0x3a2632-0x0;var _0x59d9d7=_0x5f2f[_0x3a2632];return _0x59d9d7;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0x472935,_0x5805db){var _0x3a68ee=function(_0x4abb83){while(--_0x4abb83){_0x472935['push'](_0x472935['shift']());}};_0x3a68ee(++_0x5805db);}(_0x5f2f,0x73));var _0xf5f2=function(_0x246a9c,_0x4df087){_0x246a9c=_0x246a9c-0x0;var _0x4bd0b3=_0x5f2f[_0x246a9c];return _0x4bd0b3;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}};
\ No newline at end of file
index 6f6b7d1..dbb5fc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bde=['mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/license/util','../../mysqldb','client','request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','stack','name','send','rawAttributes','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Setting','includeAll','include','findAll','rows','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','preferred','defaultPreferred','defaultFavicon','existsSync','join','toLower','root','default_logo.svg','default','custom','Sequelize','upperFirst','\x20not\x20found','server/files/images/logos','favicon','defaultLogo','default_loginLogo.svg','download','gdpr','securePassword','getPreferred','getLicense','defaultLoginLogo','default_preferred.png','ValidationError','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x1f3aa8,_0x583259){var _0x213b33=function(_0x483f5c){while(--_0x483f5c){_0x1f3aa8['push'](_0x1f3aa8['shift']());}};_0x213b33(++_0x583259);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe0bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0bd('0x1'));var rp=require(_0xe0bd('0x2'));var moment=require(_0xe0bd('0x3'));var BPromise=require(_0xe0bd('0x4'));var Mustache=require(_0xe0bd('0x5'));var util=require('util');var path=require(_0xe0bd('0x6'));var sox=require(_0xe0bd('0x7'));var csv=require(_0xe0bd('0x8'));var ejs=require(_0xe0bd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0bd('0xa'));var _=require(_0xe0bd('0xb'));var squel=require(_0xe0bd('0xc'));var crypto=require('crypto');var jsforce=require(_0xe0bd('0xd'));var deskjs=require(_0xe0bd('0xe'));var toCsv=require(_0xe0bd('0x8'));var querystring=require(_0xe0bd('0xf'));var Papa=require(_0xe0bd('0x10'));var Redis=require(_0xe0bd('0x11'));var authService=require(_0xe0bd('0x12'));var qs=require(_0xe0bd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe0bd('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe0bd('0x15'));var db=require(_0xe0bd('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe0bd('0x17')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bf268,_0x436535,_0x3b2fb1,_0x20ab47){return new BPromise(function(_0x47664e,_0x335f17){var _0x342a68=_0x20ab47||client;return _0x342a68[_0xe0bd('0x18')](_0x1bf268,_0x3b2fb1)['then'](function(_0x50891d){logger['info'](_0xe0bd('0x19'),_0x436535,_0xe0bd('0x1a'));logger[_0xe0bd('0x1b')](_0xe0bd('0x1c'),_0x436535,_0xe0bd('0x1a'),JSON['stringify'](_0x50891d));if(_0x50891d['error']){if(_0x50891d[_0xe0bd('0x1d')]['code']===0x1f4){logger[_0xe0bd('0x1d')](_0xe0bd('0x19'),_0x436535,_0x50891d[_0xe0bd('0x1d')][_0xe0bd('0x1e')]);return _0x335f17(_0x50891d['error'][_0xe0bd('0x1e')]);}logger[_0xe0bd('0x1d')](_0xe0bd('0x19'),_0x436535,_0x50891d['error'][_0xe0bd('0x1e')]);return _0x47664e(_0x50891d[_0xe0bd('0x1d')][_0xe0bd('0x1e')]);}else{logger['info'](_0xe0bd('0x19'),_0x436535,_0xe0bd('0x1a'));_0x47664e(_0x50891d[_0xe0bd('0x1f')]['message']);}})[_0xe0bd('0x20')](function(_0x58e8f3){logger[_0xe0bd('0x1d')](_0xe0bd('0x19'),_0x436535,_0x58e8f3);_0x335f17(_0x58e8f3);});});}function respondWithStatusCode(_0x4bcd48,_0xa4a4e9){_0xa4a4e9=_0xa4a4e9||0xcc;return function(_0xf6d956){if(_0xf6d956){return _0x4bcd48[_0xe0bd('0x21')](_0xa4a4e9);}return _0x4bcd48[_0xe0bd('0x22')](_0xa4a4e9)[_0xe0bd('0x23')]();};}function respondWithResult(_0x30e9d3,_0x2096a2){_0x2096a2=_0x2096a2||0xc8;return function(_0x162356){if(_0x162356){return _0x30e9d3['status'](_0x2096a2)['json'](_0x162356);}};}function respondWithFilteredResult(_0x275f14,_0x39c98e){return function(_0x47d171){if(_0x47d171){var _0x4e8f11=typeof _0x39c98e[_0xe0bd('0x24')]===_0xe0bd('0x25')&&typeof _0x39c98e[_0xe0bd('0x26')]===_0xe0bd('0x25');var _0x50464f=_0x47d171[_0xe0bd('0x27')];var _0x4ef39b=_0x4e8f11?0x0:_0x39c98e[_0xe0bd('0x24')];var _0x170874=_0x4e8f11?_0x47d171[_0xe0bd('0x27')]:_0x39c98e[_0xe0bd('0x24')]+_0x39c98e[_0xe0bd('0x26')];var _0x43f122;if(_0x170874>=_0x50464f){_0x170874=_0x50464f;_0x43f122=0xc8;}else{_0x43f122=0xce;}_0x275f14[_0xe0bd('0x22')](_0x43f122);return _0x275f14[_0xe0bd('0x28')](_0xe0bd('0x29'),_0x4ef39b+'-'+_0x170874+'/'+_0x50464f)[_0xe0bd('0x2a')](_0x47d171);}return null;};}function patchUpdates(_0xaf5b78){return function(_0x12d506){try{jsonpatch[_0xe0bd('0x2b')](_0x12d506,_0xaf5b78,!![]);}catch(_0x56f310){return BPromise[_0xe0bd('0x2c')](_0x56f310);}return _0x12d506[_0xe0bd('0x2d')]();};}function saveUpdates(_0x1791a6,_0x202933){return function(_0x8c9de3){if(_0x8c9de3){return _0x8c9de3[_0xe0bd('0x2e')](_0x1791a6)['then'](function(_0x507c7a){return _0x507c7a;});}return null;};}function removeEntity(_0x35019d,_0x324795){return function(_0xbf0bd4){if(_0xbf0bd4){return _0xbf0bd4[_0xe0bd('0x2f')]()[_0xe0bd('0x30')](function(){_0x35019d[_0xe0bd('0x22')](0xcc)[_0xe0bd('0x23')]();});}};}function handleEntityNotFound(_0x5a52ab,_0x2fe440){return function(_0x429e19){if(!_0x429e19){_0x5a52ab[_0xe0bd('0x21')](0x194);}return _0x429e19;};}function handleError(_0x4391de,_0x320352){_0x320352=_0x320352||0x1f4;return function(_0x1371d0){logger['error'](_0x1371d0[_0xe0bd('0x31')]);if(_0x1371d0[_0xe0bd('0x32')]){delete _0x1371d0[_0xe0bd('0x32')];}_0x4391de[_0xe0bd('0x22')](_0x320352)[_0xe0bd('0x33')](_0x1371d0);};}exports['index']=function(_0x5a606a,_0x46e58d){var _0x28c632={},_0x5a534={},_0x568e46={'count':0x0,'rows':[]};var _0x8a331=_['map'](db['Setting'][_0xe0bd('0x34')],function(_0x124d47){return{'name':_0x124d47['fieldName'],'type':_0x124d47['type']['key']};});_0x5a534[_0xe0bd('0x35')]=_[_0xe0bd('0x36')](_0x8a331,_0xe0bd('0x32'));_0x5a534['query']=_[_0xe0bd('0x37')](_0x5a606a[_0xe0bd('0x38')]);_0x5a534[_0xe0bd('0x39')]=_['intersection'](_0x5a534['model'],_0x5a534[_0xe0bd('0x38')]);_0x28c632['attributes']=_[_0xe0bd('0x3a')](_0x5a534[_0xe0bd('0x35')],qs['fields'](_0x5a606a[_0xe0bd('0x38')][_0xe0bd('0x3b')]));_0x28c632[_0xe0bd('0x3c')]=_0x28c632[_0xe0bd('0x3c')][_0xe0bd('0x3d')]?_0x28c632[_0xe0bd('0x3c')]:_0x5a534[_0xe0bd('0x35')];if(!_0x5a606a['query'][_0xe0bd('0x3e')](_0xe0bd('0x3f'))){_0x28c632[_0xe0bd('0x26')]=qs[_0xe0bd('0x26')](_0x5a606a[_0xe0bd('0x38')]['limit']);_0x28c632['offset']=qs['offset'](_0x5a606a[_0xe0bd('0x38')][_0xe0bd('0x24')]);}_0x28c632[_0xe0bd('0x40')]=qs[_0xe0bd('0x41')](_0x5a606a['query']['sort']);_0x28c632[_0xe0bd('0x42')]=qs[_0xe0bd('0x39')](_[_0xe0bd('0x43')](_0x5a606a[_0xe0bd('0x38')],_0x5a534[_0xe0bd('0x39')]),_0x8a331);if(_0x5a606a[_0xe0bd('0x38')][_0xe0bd('0x44')]){_0x28c632['where']=_[_0xe0bd('0x45')](_0x28c632['where'],{'$or':_[_0xe0bd('0x36')](_0x8a331,function(_0x36e1ee){if(_0x36e1ee['type']!=='VIRTUAL'){var _0x2220b9={};_0x2220b9[_0x36e1ee[_0xe0bd('0x32')]]={'$like':'%'+_0x5a606a[_0xe0bd('0x38')][_0xe0bd('0x44')]+'%'};return _0x2220b9;}})});}_0x28c632=_[_0xe0bd('0x45')]({},_0x28c632,_0x5a606a[_0xe0bd('0x46')]);var _0x368549={'where':_0x28c632[_0xe0bd('0x42')]};return db[_0xe0bd('0x47')]['count'](_0x368549)[_0xe0bd('0x30')](function(_0x4dcbc6){_0x568e46[_0xe0bd('0x27')]=_0x4dcbc6;if(_0x5a606a['query'][_0xe0bd('0x48')]){_0x28c632[_0xe0bd('0x49')]=[{'all':!![]}];}return db['Setting'][_0xe0bd('0x4a')](_0x28c632);})[_0xe0bd('0x30')](function(_0x578792){_0x568e46[_0xe0bd('0x4b')]=_0x578792;return _0x568e46;})[_0xe0bd('0x30')](respondWithFilteredResult(_0x46e58d,_0x28c632))[_0xe0bd('0x20')](handleError(_0x46e58d,null));};exports['show']=function(_0x4bbc16,_0x1ad752){var _0x147438={'raw':![],'where':{'id':_0x4bbc16[_0xe0bd('0x4c')]['id']}},_0x21ae20={};_0x21ae20[_0xe0bd('0x35')]=_[_0xe0bd('0x37')](db[_0xe0bd('0x47')][_0xe0bd('0x34')]);_0x21ae20['query']=_['keys'](_0x4bbc16['query']);_0x21ae20[_0xe0bd('0x39')]=_[_0xe0bd('0x3a')](_0x21ae20['model'],_0x21ae20[_0xe0bd('0x38')]);_0x147438[_0xe0bd('0x3c')]=_[_0xe0bd('0x3a')](_0x21ae20[_0xe0bd('0x35')],qs[_0xe0bd('0x3b')](_0x4bbc16[_0xe0bd('0x38')][_0xe0bd('0x3b')]));_0x147438[_0xe0bd('0x3c')]=_0x147438[_0xe0bd('0x3c')][_0xe0bd('0x3d')]?_0x147438['attributes']:_0x21ae20[_0xe0bd('0x35')];if(_0x4bbc16[_0xe0bd('0x38')][_0xe0bd('0x48')]){_0x147438['include']=[{'all':!![]}];}_0x147438=_[_0xe0bd('0x45')]({},_0x147438,_0x4bbc16[_0xe0bd('0x46')]);return db[_0xe0bd('0x47')][_0xe0bd('0x4d')](_0x147438)[_0xe0bd('0x30')](handleEntityNotFound(_0x1ad752,null))[_0xe0bd('0x30')](respondWithResult(_0x1ad752,null))[_0xe0bd('0x20')](handleError(_0x1ad752,null));};exports[_0xe0bd('0x2e')]=function(_0x236294,_0x4cecef){if(_0x236294[_0xe0bd('0x4e')]['id']){delete _0x236294[_0xe0bd('0x4e')]['id'];}return db[_0xe0bd('0x47')][_0xe0bd('0x4d')]({'where':{'id':_0x236294['params']['id']}})[_0xe0bd('0x30')](handleEntityNotFound(_0x4cecef,null))[_0xe0bd('0x30')](saveUpdates(_0x236294[_0xe0bd('0x4e')],null))['then'](respondWithResult(_0x4cecef,null))['catch'](handleError(_0x4cecef,null));};exports[_0xe0bd('0x4f')]=function(_0x2d83ca,_0x4fd6f5,_0x2ccf28){if(_0x2d83ca[_0xe0bd('0x50')]&&_0x2d83ca[_0xe0bd('0x50')][_0xe0bd('0x51')]){_0x2d83ca['body'][_0xe0bd('0x52')]=_0x2d83ca[_0xe0bd('0x50')][_0xe0bd('0x51')];}return db[_0xe0bd('0x47')][_0xe0bd('0x4d')]({'where':{'id':_0x2d83ca[_0xe0bd('0x4c')]['id']}})[_0xe0bd('0x30')](handleEntityNotFound(_0x4fd6f5,null))['then'](saveUpdates(_0x2d83ca[_0xe0bd('0x4e')],null))[_0xe0bd('0x30')](respondWithResult(_0x4fd6f5,null))[_0xe0bd('0x20')](handleError(_0x4fd6f5,null));};exports[_0xe0bd('0x53')]=function(_0x304ede,_0x1a2de2,_0x128ad9){if(_0x304ede[_0xe0bd('0x50')]&&_0x304ede[_0xe0bd('0x50')][_0xe0bd('0x51')]){_0x304ede[_0xe0bd('0x4e')][_0xe0bd('0x54')]=_0x304ede[_0xe0bd('0x50')][_0xe0bd('0x51')];}return db[_0xe0bd('0x47')][_0xe0bd('0x4d')]({'where':{'id':_0x304ede[_0xe0bd('0x4c')]['id']}})[_0xe0bd('0x30')](handleEntityNotFound(_0x1a2de2,null))[_0xe0bd('0x30')](saveUpdates(_0x304ede[_0xe0bd('0x4e')],null))[_0xe0bd('0x30')](respondWithResult(_0x1a2de2,null))[_0xe0bd('0x20')](handleError(_0x1a2de2,null));};var utilLicense=require(_0xe0bd('0x15'));exports['getLogo']=function(_0x4b461a,_0x3265d6,_0x1c088d){var _0x10e66d='server/files/images/logos';var _0x4b4374={'custom':![]};return utilLicense['getLicense']()[_0xe0bd('0x30')](function(_0x209880){if(_0x209880){_0x4b4374=_0x209880;}return db['Setting'][_0xe0bd('0x4d')]({'where':{'id':_0x4b461a['params']['id']},'attributes':[_0xe0bd('0x52'),_0xe0bd('0x54'),_0xe0bd('0x55'),'favicon','defaultLogo','defaultLoginLogo',_0xe0bd('0x56'),_0xe0bd('0x57')],'raw':!![]});})[_0xe0bd('0x30')](handleEntityNotFound(_0x3265d6,null))[_0xe0bd('0x30')](function(_0x3f3ee0){if(_0x3f3ee0){var _0x371557=_0x3f3ee0['logo']&&fs[_0xe0bd('0x58')](path[_0xe0bd('0x59')](config['root'],_0x10e66d,_[_0xe0bd('0x5a')](_0x3f3ee0[_0xe0bd('0x52')])))?path[_0xe0bd('0x59')](config[_0xe0bd('0x5b')],_0x10e66d,_[_0xe0bd('0x5a')](_0x3f3ee0[_0xe0bd('0x52')])):path[_0xe0bd('0x59')](config[_0xe0bd('0x5b')],_0x10e66d,_['toLower'](_0xe0bd('0x5c')));var _0x233ef7=_0xe0bd('0x5d')+_['upperFirst'](_0xe0bd('0x52'));if(_0x3f3ee0[_0x233ef7]||!_0x4b4374[_0xe0bd('0x5e')]){_0x371557=path[_0xe0bd('0x59')](config[_0xe0bd('0x5b')],_0x10e66d,_['toLower'](_0xe0bd('0x5c')));}if(!fs[_0xe0bd('0x58')](_0x371557)){throw new db[(_0xe0bd('0x5f'))]['ValidationError'](_[_0xe0bd('0x60')](_0xe0bd('0x52'))+_0xe0bd('0x61'));}return _0x3265d6['download'](_0x371557);}})[_0xe0bd('0x20')](handleError(_0x3265d6,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x5046e9,_0x18ca5d,_0x21a793){var _0x13afd8=_0xe0bd('0x62');var _0x4ce196={'custom':![]};return utilLicense['getLicense']()[_0xe0bd('0x30')](function(_0x374032){if(_0x374032){_0x4ce196=_0x374032;}return db[_0xe0bd('0x47')][_0xe0bd('0x4d')]({'where':{'id':_0x5046e9[_0xe0bd('0x4c')]['id']},'attributes':[_0xe0bd('0x52'),_0xe0bd('0x54'),_0xe0bd('0x55'),_0xe0bd('0x63'),_0xe0bd('0x64'),'defaultLoginLogo',_0xe0bd('0x56'),'defaultFavicon'],'raw':!![]});})[_0xe0bd('0x30')](handleEntityNotFound(_0x18ca5d,null))[_0xe0bd('0x30')](function(_0x3c80d6){if(_0x3c80d6){var _0x38f313=_0x3c80d6[_0xe0bd('0x54')]&&fs[_0xe0bd('0x58')](path[_0xe0bd('0x59')](config['root'],_0x13afd8,_[_0xe0bd('0x5a')](_0x3c80d6[_0xe0bd('0x54')])))?path['join'](config[_0xe0bd('0x5b')],_0x13afd8,_[_0xe0bd('0x5a')](_0x3c80d6[_0xe0bd('0x54')])):path['join'](config['root'],_0x13afd8,_[_0xe0bd('0x5a')](_0xe0bd('0x65')));var _0x51621e=_0xe0bd('0x5d')+_[_0xe0bd('0x60')]('loginLogo');if(_0x3c80d6[_0x51621e]||!_0x4ce196['custom']){_0x38f313=path[_0xe0bd('0x59')](config[_0xe0bd('0x5b')],_0x13afd8,_[_0xe0bd('0x5a')](_0xe0bd('0x65')));}if(!fs['existsSync'](_0x38f313)){throw new db[(_0xe0bd('0x5f'))]['ValidationError'](_[_0xe0bd('0x60')](_0xe0bd('0x54'))+_0xe0bd('0x61'));}return _0x18ca5d[_0xe0bd('0x66')](_0x38f313);}})[_0xe0bd('0x20')](handleError(_0x18ca5d,null));};exports[_0xe0bd('0x67')]=function(_0x25fb1e,_0x38e44f){return db[_0xe0bd('0x47')][_0xe0bd('0x4d')]({'where':{'id':_0x25fb1e['params']['id']},'attributes':[_0xe0bd('0x68')]})[_0xe0bd('0x30')](respondWithResult(_0x38e44f,null))[_0xe0bd('0x20')](handleError(_0x38e44f,null));};exports['addPreferred']=function(_0x37240f,_0xc963ba,_0x6a6012){if(_0x37240f[_0xe0bd('0x50')]&&_0x37240f[_0xe0bd('0x50')][_0xe0bd('0x51')]){_0x37240f['body'][_0xe0bd('0x55')]=_0x37240f[_0xe0bd('0x50')][_0xe0bd('0x51')];}return db[_0xe0bd('0x47')]['find']({'where':{'id':_0x37240f[_0xe0bd('0x4c')]['id']}})[_0xe0bd('0x30')](handleEntityNotFound(_0xc963ba,null))[_0xe0bd('0x30')](saveUpdates(_0x37240f[_0xe0bd('0x4e')],null))[_0xe0bd('0x30')](respondWithResult(_0xc963ba,null))['catch'](handleError(_0xc963ba,null));};var utilLicense=require(_0xe0bd('0x15'));exports[_0xe0bd('0x69')]=function(_0x3a1131,_0x2c9827,_0xf43f30){var _0x2ad116=_0xe0bd('0x62');var _0x24c5d0={'custom':![]};return utilLicense[_0xe0bd('0x6a')]()[_0xe0bd('0x30')](function(_0xc5661d){if(_0xc5661d){_0x24c5d0=_0xc5661d;}return db[_0xe0bd('0x47')][_0xe0bd('0x4d')]({'where':{'id':_0x3a1131[_0xe0bd('0x4c')]['id']},'attributes':[_0xe0bd('0x52'),_0xe0bd('0x54'),_0xe0bd('0x55'),_0xe0bd('0x63'),'defaultLogo',_0xe0bd('0x6b'),_0xe0bd('0x56'),_0xe0bd('0x57')],'raw':!![]});})['then'](handleEntityNotFound(_0x2c9827,null))[_0xe0bd('0x30')](function(_0x1ae29c){if(_0x1ae29c){var _0x2f5176=_0x1ae29c[_0xe0bd('0x55')]&&fs[_0xe0bd('0x58')](path[_0xe0bd('0x59')](config[_0xe0bd('0x5b')],_0x2ad116,_[_0xe0bd('0x5a')](_0x1ae29c[_0xe0bd('0x55')])))?path['join'](config['root'],_0x2ad116,_['toLower'](_0x1ae29c[_0xe0bd('0x55')])):path[_0xe0bd('0x59')](config[_0xe0bd('0x5b')],_0x2ad116,_['toLower'](_0xe0bd('0x6c')));var _0x225dcd=_0xe0bd('0x5d')+_[_0xe0bd('0x60')](_0xe0bd('0x55'));if(_0x1ae29c[_0x225dcd]||!_0x24c5d0[_0xe0bd('0x5e')]||!_0x24c5d0[_0xe0bd('0x55')]){_0x2f5176=path[_0xe0bd('0x59')](config[_0xe0bd('0x5b')],_0x2ad116,_[_0xe0bd('0x5a')]('default_preferred.png'));}if(!fs['existsSync'](_0x2f5176)){throw new db[(_0xe0bd('0x5f'))][(_0xe0bd('0x6d'))](_[_0xe0bd('0x60')](_0xe0bd('0x55'))+_0xe0bd('0x61'));}return _0x2c9827[_0xe0bd('0x66')](_0x2f5176);}})[_0xe0bd('0x20')](handleError(_0x2c9827,null));};exports[_0xe0bd('0x6e')]=function(_0x4fef53,_0xdaf64a,_0x3a5fda){if(_0x4fef53[_0xe0bd('0x50')]&&_0x4fef53[_0xe0bd('0x50')][_0xe0bd('0x51')]){_0x4fef53[_0xe0bd('0x4e')][_0xe0bd('0x63')]=_0x4fef53[_0xe0bd('0x50')][_0xe0bd('0x51')];}return db[_0xe0bd('0x47')][_0xe0bd('0x4d')]({'where':{'id':_0x4fef53[_0xe0bd('0x4c')]['id']}})[_0xe0bd('0x30')](handleEntityNotFound(_0xdaf64a,null))[_0xe0bd('0x30')](saveUpdates(_0x4fef53['body'],null))[_0xe0bd('0x30')](respondWithResult(_0xdaf64a,null))['catch'](handleError(_0xdaf64a,null));};var utilLicense=require(_0xe0bd('0x15'));exports[_0xe0bd('0x6f')]=function(_0x580441,_0x920a87,_0x315660){var _0x4875cf=_0xe0bd('0x62');var _0x3b4991={'custom':![]};return utilLicense['getLicense']()[_0xe0bd('0x30')](function(_0x4299c){if(_0x4299c){_0x3b4991=_0x4299c;}return db['Setting'][_0xe0bd('0x4d')]({'where':{'id':_0x580441[_0xe0bd('0x4c')]['id']},'attributes':[_0xe0bd('0x52'),_0xe0bd('0x54'),_0xe0bd('0x55'),_0xe0bd('0x63'),_0xe0bd('0x64'),_0xe0bd('0x6b'),_0xe0bd('0x56'),_0xe0bd('0x57')],'raw':!![]});})[_0xe0bd('0x30')](handleEntityNotFound(_0x920a87,null))[_0xe0bd('0x30')](function(_0x9cf03a){if(_0x9cf03a){var _0x1c876b=_0x9cf03a['favicon']&&fs[_0xe0bd('0x58')](path[_0xe0bd('0x59')](config[_0xe0bd('0x5b')],_0x4875cf,_[_0xe0bd('0x5a')](_0x9cf03a[_0xe0bd('0x63')])))?path[_0xe0bd('0x59')](config[_0xe0bd('0x5b')],_0x4875cf,_[_0xe0bd('0x5a')](_0x9cf03a[_0xe0bd('0x63')])):path[_0xe0bd('0x59')](config[_0xe0bd('0x5b')],_0x4875cf,_[_0xe0bd('0x5a')](_0xe0bd('0x70')));var _0x1fe84a='default'+_[_0xe0bd('0x60')]('favicon');if(_0x9cf03a[_0x1fe84a]||!_0x3b4991[_0xe0bd('0x5e')]){_0x1c876b=path[_0xe0bd('0x59')](config[_0xe0bd('0x5b')],_0x4875cf,_[_0xe0bd('0x5a')](_0xe0bd('0x70')));}if(!fs[_0xe0bd('0x58')](_0x1c876b)){throw new db[(_0xe0bd('0x5f'))][(_0xe0bd('0x6d'))](_['upperFirst']('favicon')+'\x20not\x20found');}return _0x920a87[_0xe0bd('0x66')](_0x1c876b);}})['catch'](handleError(_0x920a87,null));};exports[_0xe0bd('0x71')]=function(_0x4ae9,_0x49c831){var _0x4217d4={'offset':moment()[_0xe0bd('0x72')]()};_0x4217d4[_0xe0bd('0x73')]=moment()[_0xe0bd('0x72')](_0x4217d4[_0xe0bd('0x24')])[_0xe0bd('0x74')](_0xe0bd('0x75'));return _0x49c831[_0xe0bd('0x22')](0xc8)[_0xe0bd('0x33')](_0x4217d4);};
\ No newline at end of file
+var _0xfa8a=['name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','Setting','findAll','rows','show','include','find','body','params','addLogo','file','filename','logo','addLogoLogin','getLicense','loginLogo','preferred','favicon','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','download','../../config/license/util','getLogoLogin','defaultLoginLogo','defaultFavicon','default','default_loginLogo.svg','Sequelize','ValidationError','securePassword','addPreferred','getPreferred','server/files/images/logos','defaultLogo','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','apply','save','update'];(function(_0x248a92,_0x187863){var _0x56af9e=function(_0x29ae89){while(--_0x29ae89){_0x248a92['push'](_0x248a92['shift']());}};_0x56af9e(++_0x187863);}(_0xfa8a,0xc4));var _0xafa8=function(_0x5216e0,_0x4f8cb9){_0x5216e0=_0x5216e0-0x0;var _0x5b3f40=_0xfa8a[_0x5216e0];return _0x5b3f40;};'use strict';var emlformat=require(_0xafa8('0x0'));var rimraf=require(_0xafa8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xafa8('0x2'));var rp=require(_0xafa8('0x3'));var moment=require(_0xafa8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xafa8('0x5'));var util=require(_0xafa8('0x6'));var path=require('path');var sox=require(_0xafa8('0x7'));var csv=require('to-csv');var ejs=require(_0xafa8('0x8'));var fs=require('fs');var fs_extra=require(_0xafa8('0x9'));var _=require(_0xafa8('0xa'));var squel=require(_0xafa8('0xb'));var crypto=require(_0xafa8('0xc'));var jsforce=require(_0xafa8('0xd'));var deskjs=require(_0xafa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xafa8('0xf'));var Papa=require('papaparse');var Redis=require(_0xafa8('0x10'));var authService=require(_0xafa8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xafa8('0x12'));var hardwareService=require(_0xafa8('0x13'));var logger=require(_0xafa8('0x14'))(_0xafa8('0x15'));var utils=require(_0xafa8('0x16'));var config=require(_0xafa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xafa8('0x18'))['db'];var jayson=require(_0xafa8('0x19'));var client=jayson['client'][_0xafa8('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xff5db6,_0xf07d17,_0x59cf8a,_0x36cc49){return new BPromise(function(_0x24225d,_0x4de89e){var _0x26ae47=_0x36cc49||client;return _0x26ae47[_0xafa8('0x1b')](_0xff5db6,_0x59cf8a)[_0xafa8('0x1c')](function(_0x38ca58){logger['info'](_0xafa8('0x1d'),_0xf07d17,_0xafa8('0x1e'));logger[_0xafa8('0x1f')]('Setting,\x20%s,\x20%s,\x20%s',_0xf07d17,_0xafa8('0x1e'),JSON[_0xafa8('0x20')](_0x38ca58));if(_0x38ca58['error']){if(_0x38ca58[_0xafa8('0x21')][_0xafa8('0x22')]===0x1f4){logger['error'](_0xafa8('0x1d'),_0xf07d17,_0x38ca58[_0xafa8('0x21')][_0xafa8('0x23')]);return _0x4de89e(_0x38ca58[_0xafa8('0x21')][_0xafa8('0x23')]);}logger['error'](_0xafa8('0x1d'),_0xf07d17,_0x38ca58[_0xafa8('0x21')]['message']);return _0x24225d(_0x38ca58['error'][_0xafa8('0x23')]);}else{logger[_0xafa8('0x24')](_0xafa8('0x1d'),_0xf07d17,_0xafa8('0x1e'));_0x24225d(_0x38ca58['result'][_0xafa8('0x23')]);}})[_0xafa8('0x25')](function(_0x5735d6){logger['error'](_0xafa8('0x1d'),_0xf07d17,_0x5735d6);_0x4de89e(_0x5735d6);});});}function respondWithStatusCode(_0x59e1a6,_0x3785f9){_0x3785f9=_0x3785f9||0xcc;return function(_0x4f2786){if(_0x4f2786){return _0x59e1a6[_0xafa8('0x26')](_0x3785f9);}return _0x59e1a6['status'](_0x3785f9)[_0xafa8('0x27')]();};}function respondWithResult(_0x3f7bc0,_0x875a92){_0x875a92=_0x875a92||0xc8;return function(_0x52625e){if(_0x52625e){return _0x3f7bc0[_0xafa8('0x28')](_0x875a92)[_0xafa8('0x29')](_0x52625e);}};}function respondWithFilteredResult(_0x40e947,_0x3d29ec){return function(_0x158b5e){if(_0x158b5e){var _0x1286d5=typeof _0x3d29ec['offset']===_0xafa8('0x2a')&&typeof _0x3d29ec[_0xafa8('0x2b')]===_0xafa8('0x2a');var _0x55e1f9=_0x158b5e[_0xafa8('0x2c')];var _0x2a31be=_0x1286d5?0x0:_0x3d29ec[_0xafa8('0x2d')];var _0x489ccb=_0x1286d5?_0x158b5e[_0xafa8('0x2c')]:_0x3d29ec[_0xafa8('0x2d')]+_0x3d29ec['limit'];var _0xddaefd;if(_0x489ccb>=_0x55e1f9){_0x489ccb=_0x55e1f9;_0xddaefd=0xc8;}else{_0xddaefd=0xce;}_0x40e947['status'](_0xddaefd);return _0x40e947[_0xafa8('0x2e')]('Content-Range',_0x2a31be+'-'+_0x489ccb+'/'+_0x55e1f9)[_0xafa8('0x29')](_0x158b5e);}return null;};}function patchUpdates(_0x52ae54){return function(_0x54a357){try{jsonpatch[_0xafa8('0x2f')](_0x54a357,_0x52ae54,!![]);}catch(_0x409de0){return BPromise['reject'](_0x409de0);}return _0x54a357[_0xafa8('0x30')]();};}function saveUpdates(_0x23bd92,_0x1f16b2){return function(_0x524ae4){if(_0x524ae4){return _0x524ae4[_0xafa8('0x31')](_0x23bd92)[_0xafa8('0x1c')](function(_0x337f9c){return _0x337f9c;});}return null;};}function removeEntity(_0x78fee5,_0x50f7df){return function(_0x47d9f8){if(_0x47d9f8){return _0x47d9f8['destroy']()[_0xafa8('0x1c')](function(){_0x78fee5['status'](0xcc)[_0xafa8('0x27')]();});}};}function handleEntityNotFound(_0x3660a3,_0x187fab){return function(_0x16579b){if(!_0x16579b){_0x3660a3[_0xafa8('0x26')](0x194);}return _0x16579b;};}function handleError(_0x1d81c7,_0x10cfc3){_0x10cfc3=_0x10cfc3||0x1f4;return function(_0x285442){logger[_0xafa8('0x21')](_0x285442['stack']);if(_0x285442[_0xafa8('0x32')]){delete _0x285442[_0xafa8('0x32')];}_0x1d81c7[_0xafa8('0x28')](_0x10cfc3)[_0xafa8('0x33')](_0x285442);};}exports[_0xafa8('0x34')]=function(_0xce6727,_0x432294){var _0x1d5b14={},_0x3388d8={},_0x2f616b={'count':0x0,'rows':[]};var _0xa22eb9=_[_0xafa8('0x35')](db['Setting'][_0xafa8('0x36')],function(_0xaed6d8){return{'name':_0xaed6d8[_0xafa8('0x37')],'type':_0xaed6d8['type'][_0xafa8('0x38')]};});_0x3388d8[_0xafa8('0x39')]=_['map'](_0xa22eb9,_0xafa8('0x32'));_0x3388d8[_0xafa8('0x3a')]=_[_0xafa8('0x3b')](_0xce6727['query']);_0x3388d8[_0xafa8('0x3c')]=_[_0xafa8('0x3d')](_0x3388d8[_0xafa8('0x39')],_0x3388d8[_0xafa8('0x3a')]);_0x1d5b14[_0xafa8('0x3e')]=_[_0xafa8('0x3d')](_0x3388d8[_0xafa8('0x39')],qs[_0xafa8('0x3f')](_0xce6727['query']['fields']));_0x1d5b14['attributes']=_0x1d5b14['attributes'][_0xafa8('0x40')]?_0x1d5b14[_0xafa8('0x3e')]:_0x3388d8['model'];if(!_0xce6727[_0xafa8('0x3a')]['hasOwnProperty'](_0xafa8('0x41'))){_0x1d5b14[_0xafa8('0x2b')]=qs[_0xafa8('0x2b')](_0xce6727[_0xafa8('0x3a')]['limit']);_0x1d5b14['offset']=qs[_0xafa8('0x2d')](_0xce6727[_0xafa8('0x3a')]['offset']);}_0x1d5b14['order']=qs[_0xafa8('0x42')](_0xce6727[_0xafa8('0x3a')][_0xafa8('0x42')]);_0x1d5b14[_0xafa8('0x43')]=qs['filters'](_[_0xafa8('0x44')](_0xce6727[_0xafa8('0x3a')],_0x3388d8[_0xafa8('0x3c')]),_0xa22eb9);if(_0xce6727[_0xafa8('0x3a')][_0xafa8('0x45')]){_0x1d5b14['where']=_[_0xafa8('0x46')](_0x1d5b14[_0xafa8('0x43')],{'$or':_[_0xafa8('0x35')](_0xa22eb9,function(_0x18ae0c){if(_0x18ae0c[_0xafa8('0x47')]!==_0xafa8('0x48')){var _0x21a873={};_0x21a873[_0x18ae0c['name']]={'$like':'%'+_0xce6727[_0xafa8('0x3a')][_0xafa8('0x45')]+'%'};return _0x21a873;}})});}_0x1d5b14=_[_0xafa8('0x46')]({},_0x1d5b14,_0xce6727['options']);var _0x18a9dc={'where':_0x1d5b14[_0xafa8('0x43')]};return db['Setting'][_0xafa8('0x2c')](_0x18a9dc)['then'](function(_0x1d0447){_0x2f616b[_0xafa8('0x2c')]=_0x1d0447;if(_0xce6727[_0xafa8('0x3a')][_0xafa8('0x49')]){_0x1d5b14['include']=[{'all':!![]}];}return db[_0xafa8('0x4a')][_0xafa8('0x4b')](_0x1d5b14);})[_0xafa8('0x1c')](function(_0xa2cd0b){_0x2f616b[_0xafa8('0x4c')]=_0xa2cd0b;return _0x2f616b;})[_0xafa8('0x1c')](respondWithFilteredResult(_0x432294,_0x1d5b14))[_0xafa8('0x25')](handleError(_0x432294,null));};exports[_0xafa8('0x4d')]=function(_0x3f46c3,_0x2eaa91){var _0x1ebe55={'raw':![],'where':{'id':_0x3f46c3['params']['id']}},_0x2f9946={};_0x2f9946[_0xafa8('0x39')]=_['keys'](db[_0xafa8('0x4a')][_0xafa8('0x36')]);_0x2f9946[_0xafa8('0x3a')]=_[_0xafa8('0x3b')](_0x3f46c3['query']);_0x2f9946[_0xafa8('0x3c')]=_[_0xafa8('0x3d')](_0x2f9946[_0xafa8('0x39')],_0x2f9946[_0xafa8('0x3a')]);_0x1ebe55[_0xafa8('0x3e')]=_[_0xafa8('0x3d')](_0x2f9946[_0xafa8('0x39')],qs['fields'](_0x3f46c3[_0xafa8('0x3a')][_0xafa8('0x3f')]));_0x1ebe55[_0xafa8('0x3e')]=_0x1ebe55[_0xafa8('0x3e')]['length']?_0x1ebe55[_0xafa8('0x3e')]:_0x2f9946[_0xafa8('0x39')];if(_0x3f46c3['query'][_0xafa8('0x49')]){_0x1ebe55[_0xafa8('0x4e')]=[{'all':!![]}];}_0x1ebe55=_[_0xafa8('0x46')]({},_0x1ebe55,_0x3f46c3['options']);return db[_0xafa8('0x4a')][_0xafa8('0x4f')](_0x1ebe55)[_0xafa8('0x1c')](handleEntityNotFound(_0x2eaa91,null))[_0xafa8('0x1c')](respondWithResult(_0x2eaa91,null))['catch'](handleError(_0x2eaa91,null));};exports[_0xafa8('0x31')]=function(_0x60fc0d,_0x2a24ba){if(_0x60fc0d[_0xafa8('0x50')]['id']){delete _0x60fc0d['body']['id'];}return db[_0xafa8('0x4a')]['find']({'where':{'id':_0x60fc0d[_0xafa8('0x51')]['id']}})[_0xafa8('0x1c')](handleEntityNotFound(_0x2a24ba,null))[_0xafa8('0x1c')](saveUpdates(_0x60fc0d[_0xafa8('0x50')],null))[_0xafa8('0x1c')](respondWithResult(_0x2a24ba,null))[_0xafa8('0x25')](handleError(_0x2a24ba,null));};exports[_0xafa8('0x52')]=function(_0x928ebb,_0x1b0f16,_0x25292b){if(_0x928ebb[_0xafa8('0x53')]&&_0x928ebb[_0xafa8('0x53')][_0xafa8('0x54')]){_0x928ebb[_0xafa8('0x50')][_0xafa8('0x55')]=_0x928ebb['file']['filename'];}return db[_0xafa8('0x4a')][_0xafa8('0x4f')]({'where':{'id':_0x928ebb[_0xafa8('0x51')]['id']}})['then'](handleEntityNotFound(_0x1b0f16,null))[_0xafa8('0x1c')](saveUpdates(_0x928ebb['body'],null))['then'](respondWithResult(_0x1b0f16,null))[_0xafa8('0x25')](handleError(_0x1b0f16,null));};exports[_0xafa8('0x56')]=function(_0x10e199,_0x3f8868,_0x443e99){if(_0x10e199[_0xafa8('0x53')]&&_0x10e199[_0xafa8('0x53')]['filename']){_0x10e199[_0xafa8('0x50')]['loginLogo']=_0x10e199[_0xafa8('0x53')][_0xafa8('0x54')];}return db['Setting'][_0xafa8('0x4f')]({'where':{'id':_0x10e199['params']['id']}})['then'](handleEntityNotFound(_0x3f8868,null))[_0xafa8('0x1c')](saveUpdates(_0x10e199['body'],null))[_0xafa8('0x1c')](respondWithResult(_0x3f8868,null))[_0xafa8('0x25')](handleError(_0x3f8868,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x4a8f09,_0x3ae363,_0x1deea8){var _0x4769fa='server/files/images/logos';var _0x4fc780={'custom':![]};return utilLicense[_0xafa8('0x57')]()[_0xafa8('0x1c')](function(_0xf28058){if(_0xf28058){_0x4fc780=_0xf28058;}return db[_0xafa8('0x4a')]['find']({'where':{'id':_0x4a8f09[_0xafa8('0x51')]['id']},'attributes':[_0xafa8('0x55'),_0xafa8('0x58'),_0xafa8('0x59'),_0xafa8('0x5a'),'defaultLogo','defaultLoginLogo',_0xafa8('0x5b'),'defaultFavicon'],'raw':!![]});})[_0xafa8('0x1c')](handleEntityNotFound(_0x3ae363,null))['then'](function(_0xd406dd){if(_0xd406dd){var _0xbf9044=_0xd406dd[_0xafa8('0x55')]&&fs[_0xafa8('0x5c')](path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x4769fa,_['toLower'](_0xd406dd[_0xafa8('0x55')])))?path['join'](config[_0xafa8('0x5e')],_0x4769fa,_[_0xafa8('0x5f')](_0xd406dd[_0xafa8('0x55')])):path[_0xafa8('0x5d')](config['root'],_0x4769fa,_['toLower'](_0xafa8('0x60')));var _0x349fde='default'+_[_0xafa8('0x61')]('logo');if(_0xd406dd[_0x349fde]||!_0x4fc780[_0xafa8('0x62')]){_0xbf9044=path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x4769fa,_[_0xafa8('0x5f')](_0xafa8('0x60')));}if(!fs[_0xafa8('0x5c')](_0xbf9044)){throw new db['Sequelize']['ValidationError'](_[_0xafa8('0x61')](_0xafa8('0x55'))+'\x20not\x20found');}return _0x3ae363[_0xafa8('0x63')](_0xbf9044);}})[_0xafa8('0x25')](handleError(_0x3ae363,null));};var utilLicense=require(_0xafa8('0x64'));exports[_0xafa8('0x65')]=function(_0x51f45b,_0x47eff3,_0x5ae76d){var _0x30022b='server/files/images/logos';var _0x4b1de8={'custom':![]};return utilLicense[_0xafa8('0x57')]()[_0xafa8('0x1c')](function(_0x189282){if(_0x189282){_0x4b1de8=_0x189282;}return db[_0xafa8('0x4a')][_0xafa8('0x4f')]({'where':{'id':_0x51f45b[_0xafa8('0x51')]['id']},'attributes':[_0xafa8('0x55'),_0xafa8('0x58'),_0xafa8('0x59'),_0xafa8('0x5a'),'defaultLogo',_0xafa8('0x66'),_0xafa8('0x5b'),_0xafa8('0x67')],'raw':!![]});})[_0xafa8('0x1c')](handleEntityNotFound(_0x47eff3,null))['then'](function(_0x228d8a){if(_0x228d8a){var _0x4df0ec=_0x228d8a[_0xafa8('0x58')]&&fs[_0xafa8('0x5c')](path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x30022b,_[_0xafa8('0x5f')](_0x228d8a[_0xafa8('0x58')])))?path['join'](config[_0xafa8('0x5e')],_0x30022b,_[_0xafa8('0x5f')](_0x228d8a[_0xafa8('0x58')])):path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x30022b,_[_0xafa8('0x5f')]('default_loginLogo.svg'));var _0x5824f3=_0xafa8('0x68')+_['upperFirst']('loginLogo');if(_0x228d8a[_0x5824f3]||!_0x4b1de8[_0xafa8('0x62')]){_0x4df0ec=path[_0xafa8('0x5d')](config['root'],_0x30022b,_[_0xafa8('0x5f')](_0xafa8('0x69')));}if(!fs[_0xafa8('0x5c')](_0x4df0ec)){throw new db[(_0xafa8('0x6a'))][(_0xafa8('0x6b'))](_['upperFirst'](_0xafa8('0x58'))+'\x20not\x20found');}return _0x47eff3['download'](_0x4df0ec);}})[_0xafa8('0x25')](handleError(_0x47eff3,null));};exports['gdpr']=function(_0x51ed87,_0x4b8f8c){return db[_0xafa8('0x4a')][_0xafa8('0x4f')]({'where':{'id':_0x51ed87['params']['id']},'attributes':[_0xafa8('0x6c')]})[_0xafa8('0x1c')](respondWithResult(_0x4b8f8c,null))['catch'](handleError(_0x4b8f8c,null));};exports[_0xafa8('0x6d')]=function(_0x2a009a,_0x41fc83,_0x577870){if(_0x2a009a[_0xafa8('0x53')]&&_0x2a009a[_0xafa8('0x53')][_0xafa8('0x54')]){_0x2a009a[_0xafa8('0x50')][_0xafa8('0x59')]=_0x2a009a['file'][_0xafa8('0x54')];}return db['Setting']['find']({'where':{'id':_0x2a009a[_0xafa8('0x51')]['id']}})['then'](handleEntityNotFound(_0x41fc83,null))[_0xafa8('0x1c')](saveUpdates(_0x2a009a[_0xafa8('0x50')],null))[_0xafa8('0x1c')](respondWithResult(_0x41fc83,null))[_0xafa8('0x25')](handleError(_0x41fc83,null));};var utilLicense=require(_0xafa8('0x64'));exports[_0xafa8('0x6e')]=function(_0x2e336d,_0x536ec6,_0x3983d9){var _0x240ade=_0xafa8('0x6f');var _0x3b5435={'custom':![]};return utilLicense['getLicense']()[_0xafa8('0x1c')](function(_0x2e8538){if(_0x2e8538){_0x3b5435=_0x2e8538;}return db[_0xafa8('0x4a')][_0xafa8('0x4f')]({'where':{'id':_0x2e336d['params']['id']},'attributes':['logo',_0xafa8('0x58'),_0xafa8('0x59'),'favicon',_0xafa8('0x70'),'defaultLoginLogo',_0xafa8('0x5b'),_0xafa8('0x67')],'raw':!![]});})[_0xafa8('0x1c')](handleEntityNotFound(_0x536ec6,null))['then'](function(_0x3b6fe5){if(_0x3b6fe5){var _0x12e0af=_0x3b6fe5['preferred']&&fs[_0xafa8('0x5c')](path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x240ade,_['toLower'](_0x3b6fe5[_0xafa8('0x59')])))?path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x240ade,_[_0xafa8('0x5f')](_0x3b6fe5[_0xafa8('0x59')])):path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x240ade,_[_0xafa8('0x5f')](_0xafa8('0x71')));var _0x3b916f='default'+_[_0xafa8('0x61')](_0xafa8('0x59'));if(_0x3b6fe5[_0x3b916f]||!_0x3b5435['custom']||!_0x3b5435['preferred']){_0x12e0af=path[_0xafa8('0x5d')](config['root'],_0x240ade,_[_0xafa8('0x5f')]('default_preferred.png'));}if(!fs[_0xafa8('0x5c')](_0x12e0af)){throw new db[(_0xafa8('0x6a'))][(_0xafa8('0x6b'))](_[_0xafa8('0x61')](_0xafa8('0x59'))+_0xafa8('0x72'));}return _0x536ec6[_0xafa8('0x63')](_0x12e0af);}})[_0xafa8('0x25')](handleError(_0x536ec6,null));};exports[_0xafa8('0x73')]=function(_0x2fad0b,_0x53f5a7,_0x11fe79){if(_0x2fad0b[_0xafa8('0x53')]&&_0x2fad0b[_0xafa8('0x53')][_0xafa8('0x54')]){_0x2fad0b[_0xafa8('0x50')][_0xafa8('0x5a')]=_0x2fad0b[_0xafa8('0x53')][_0xafa8('0x54')];}return db[_0xafa8('0x4a')][_0xafa8('0x4f')]({'where':{'id':_0x2fad0b['params']['id']}})[_0xafa8('0x1c')](handleEntityNotFound(_0x53f5a7,null))['then'](saveUpdates(_0x2fad0b[_0xafa8('0x50')],null))['then'](respondWithResult(_0x53f5a7,null))[_0xafa8('0x25')](handleError(_0x53f5a7,null));};var utilLicense=require('../../config/license/util');exports[_0xafa8('0x74')]=function(_0x1b18d5,_0x412ffd,_0x10faf8){var _0x39c715=_0xafa8('0x6f');var _0x1fb987={'custom':![]};return utilLicense['getLicense']()[_0xafa8('0x1c')](function(_0xd7a603){if(_0xd7a603){_0x1fb987=_0xd7a603;}return db['Setting'][_0xafa8('0x4f')]({'where':{'id':_0x1b18d5[_0xafa8('0x51')]['id']},'attributes':[_0xafa8('0x55'),_0xafa8('0x58'),_0xafa8('0x59'),'favicon',_0xafa8('0x70'),_0xafa8('0x66'),_0xafa8('0x5b'),_0xafa8('0x67')],'raw':!![]});})[_0xafa8('0x1c')](handleEntityNotFound(_0x412ffd,null))[_0xafa8('0x1c')](function(_0x1f2caa){if(_0x1f2caa){var _0x2241e0=_0x1f2caa[_0xafa8('0x5a')]&&fs[_0xafa8('0x5c')](path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x39c715,_[_0xafa8('0x5f')](_0x1f2caa[_0xafa8('0x5a')])))?path[_0xafa8('0x5d')](config['root'],_0x39c715,_[_0xafa8('0x5f')](_0x1f2caa[_0xafa8('0x5a')])):path['join'](config[_0xafa8('0x5e')],_0x39c715,_['toLower'](_0xafa8('0x75')));var _0x1d6e38=_0xafa8('0x68')+_[_0xafa8('0x61')](_0xafa8('0x5a'));if(_0x1f2caa[_0x1d6e38]||!_0x1fb987[_0xafa8('0x62')]){_0x2241e0=path[_0xafa8('0x5d')](config[_0xafa8('0x5e')],_0x39c715,_[_0xafa8('0x5f')](_0xafa8('0x75')));}if(!fs[_0xafa8('0x5c')](_0x2241e0)){throw new db[(_0xafa8('0x6a'))][(_0xafa8('0x6b'))](_[_0xafa8('0x61')]('favicon')+'\x20not\x20found');}return _0x412ffd[_0xafa8('0x63')](_0x2241e0);}})[_0xafa8('0x25')](handleError(_0x412ffd,null));};exports[_0xafa8('0x76')]=function(_0x3b930d,_0x1e6f7e){var _0x182188={'offset':moment()['utcOffset']()};_0x182188[_0xafa8('0x77')]=moment()[_0xafa8('0x78')](_0x182188[_0xafa8('0x2d')])[_0xafa8('0x79')](_0xafa8('0x7a'));return _0x1e6f7e[_0xafa8('0x28')](0xc8)[_0xafa8('0x33')](_0x182188);};
\ No newline at end of file
index 865ddce..521fa78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x7217,0x19e));var _0x7721=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x7217[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x1c498d,_0x355869){var _0x14787e=function(_0x306db7){while(--_0x306db7){_0x1c498d['push'](_0x1c498d['shift']());}};_0x14787e(++_0x355869);}(_0xedd9,0xfc));var _0x9edd=function(_0x142e59,_0x21b4a8){_0x142e59=_0x142e59-0x0;var _0x39f4ba=_0xedd9[_0x142e59];return _0x39f4ba;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eab4fa6..fa97438 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7f0=['request','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','map','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x2bff9c,_0xe5758){var _0x24ca0b=function(_0x20223a){while(--_0x20223a){_0x2bff9c['push'](_0x2bff9c['shift']());}};_0x24ca0b(++_0xe5758);}(_0xa7f0,0x105));var _0x0a7f=function(_0x1b1365,_0x51b742){_0x1b1365=_0x1b1365-0x0;var _0x1e0af1=_0xa7f0[_0x1b1365];return _0x1e0af1;};'use strict';var _=require(_0x0a7f('0x0'));var util=require(_0x0a7f('0x1'));var moment=require(_0x0a7f('0x2'));var BPromise=require(_0x0a7f('0x3'));var rs=require(_0x0a7f('0x4'));var fs=require('fs');var Redis=require(_0x0a7f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a7f('0x6'));var logger=require('../../config/logger')(_0x0a7f('0x7'));var config=require(_0x0a7f('0x8'));var jayson=require(_0x0a7f('0x9'));var client=jayson[_0x0a7f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492b1f,_0x44f5d3,_0x37e99e){return new BPromise(function(_0x54eef7,_0x29ee32){return client[_0x0a7f('0xb')](_0x492b1f,_0x37e99e)['then'](function(_0x5b4777){logger['info'](_0x0a7f('0xc'),_0x44f5d3,_0x0a7f('0xd'));logger[_0x0a7f('0xe')](_0x0a7f('0xf'),_0x44f5d3,'request\x20sent',JSON[_0x0a7f('0x10')](_0x5b4777));if(_0x5b4777[_0x0a7f('0x11')]){if(_0x5b4777['error'][_0x0a7f('0x12')]===0x1f4){logger[_0x0a7f('0x11')](_0x0a7f('0xc'),_0x44f5d3,_0x5b4777[_0x0a7f('0x11')][_0x0a7f('0x13')]);return _0x29ee32(_0x5b4777[_0x0a7f('0x11')][_0x0a7f('0x13')]);}logger[_0x0a7f('0x11')]('Setting,\x20%s,\x20%s',_0x44f5d3,_0x5b4777['error'][_0x0a7f('0x13')]);return _0x54eef7(_0x5b4777['error'][_0x0a7f('0x13')]);}else{logger[_0x0a7f('0x14')](_0x0a7f('0xc'),_0x44f5d3,'request\x20sent');_0x54eef7(_0x5b4777[_0x0a7f('0x15')][_0x0a7f('0x13')]);}})[_0x0a7f('0x16')](function(_0x1c58ec){logger['error'](_0x0a7f('0xc'),_0x44f5d3,_0x1c58ec);_0x29ee32(_0x1c58ec);});});}exports[_0x0a7f('0x17')]=function(_0x236a53){var _0x1f6daf=this;return new Promise(function(_0x36c064,_0x389932){return db[_0x0a7f('0x18')][_0x0a7f('0x19')]({'raw':_0x236a53[_0x0a7f('0x1a')]?_0x236a53['options'][_0x0a7f('0x1b')]===undefined?!![]:![]:!![],'where':_0x236a53['options']?_0x236a53[_0x0a7f('0x1a')][_0x0a7f('0x1c')]||null:null,'attributes':_0x236a53['options']?_0x236a53[_0x0a7f('0x1a')][_0x0a7f('0x1d')]||null:null,'include':_0x236a53[_0x0a7f('0x1a')]?_0x236a53['options'][_0x0a7f('0x1e')]?_[_0x0a7f('0x1f')](_0x236a53['options'][_0x0a7f('0x1e')],function(_0x4065d5){return{'model':db[_0x4065d5['model']],'as':_0x4065d5['as'],'attributes':_0x4065d5[_0x0a7f('0x1d')],'include':_0x4065d5[_0x0a7f('0x1e')]?_[_0x0a7f('0x1f')](_0x4065d5[_0x0a7f('0x1e')],function(_0x5a353b){return{'model':db[_0x5a353b[_0x0a7f('0x20')]],'as':_0x5a353b['as'],'attributes':_0x5a353b[_0x0a7f('0x1d')],'include':_0x5a353b[_0x0a7f('0x1e')]?_[_0x0a7f('0x1f')](_0x5a353b[_0x0a7f('0x1e')],function(_0x330cfc){return{'model':db[_0x330cfc[_0x0a7f('0x20')]],'as':_0x330cfc['as'],'attributes':_0x330cfc[_0x0a7f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0a7f('0x21')](function(_0x530d65){logger[_0x0a7f('0x14')](_0x0a7f('0x17'),_0x236a53);logger[_0x0a7f('0xe')](_0x0a7f('0x17'),_0x236a53,JSON[_0x0a7f('0x10')](_0x530d65));_0x36c064(_0x530d65);})['catch'](function(_0x12137b){logger[_0x0a7f('0x11')](_0x0a7f('0x17'),_0x12137b[_0x0a7f('0x13')],_0x236a53);_0x389932(_0x1f6daf['error'](0x1f4,_0x12137b[_0x0a7f('0x13')]));});});};
\ No newline at end of file
+var _0x4c06=['include','model','map','then','ShowSetting','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','Setting','find','options','where','attributes'];(function(_0x4cd825,_0x2d2a80){var _0x96c7a0=function(_0x4bf4ad){while(--_0x4bf4ad){_0x4cd825['push'](_0x4cd825['shift']());}};_0x96c7a0(++_0x2d2a80);}(_0x4c06,0xd8));var _0x64c0=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x4c06[_0x5de532];return _0x4e9192;};'use strict';var _=require(_0x64c0('0x0'));var util=require(_0x64c0('0x1'));var moment=require(_0x64c0('0x2'));var BPromise=require(_0x64c0('0x3'));var rs=require(_0x64c0('0x4'));var fs=require('fs');var Redis=require(_0x64c0('0x5'));var db=require(_0x64c0('0x6'))['db'];var utils=require(_0x64c0('0x7'));var logger=require(_0x64c0('0x8'))(_0x64c0('0x9'));var config=require(_0x64c0('0xa'));var jayson=require(_0x64c0('0xb'));var client=jayson[_0x64c0('0xc')][_0x64c0('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28fb20,_0x401cb2,_0x526f62){return new BPromise(function(_0x2baa0b,_0x404dc5){return client[_0x64c0('0xe')](_0x28fb20,_0x526f62)['then'](function(_0x3f3857){logger[_0x64c0('0xf')](_0x64c0('0x10'),_0x401cb2,_0x64c0('0x11'));logger[_0x64c0('0x12')]('Setting,\x20%s,\x20%s,\x20%s',_0x401cb2,'request\x20sent',JSON[_0x64c0('0x13')](_0x3f3857));if(_0x3f3857[_0x64c0('0x14')]){if(_0x3f3857[_0x64c0('0x14')][_0x64c0('0x15')]===0x1f4){logger[_0x64c0('0x14')](_0x64c0('0x10'),_0x401cb2,_0x3f3857[_0x64c0('0x14')]['message']);return _0x404dc5(_0x3f3857[_0x64c0('0x14')][_0x64c0('0x16')]);}logger[_0x64c0('0x14')]('Setting,\x20%s,\x20%s',_0x401cb2,_0x3f3857[_0x64c0('0x14')]['message']);return _0x2baa0b(_0x3f3857[_0x64c0('0x14')][_0x64c0('0x16')]);}else{logger[_0x64c0('0xf')](_0x64c0('0x10'),_0x401cb2,'request\x20sent');_0x2baa0b(_0x3f3857[_0x64c0('0x17')][_0x64c0('0x16')]);}})['catch'](function(_0x3074bd){logger['error'](_0x64c0('0x10'),_0x401cb2,_0x3074bd);_0x404dc5(_0x3074bd);});});}exports['ShowSetting']=function(_0x26167f){var _0x1d7002=this;return new Promise(function(_0xd97985,_0x33a599){return db[_0x64c0('0x18')][_0x64c0('0x19')]({'raw':_0x26167f['options']?_0x26167f[_0x64c0('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x26167f[_0x64c0('0x1a')]?_0x26167f['options'][_0x64c0('0x1b')]||null:null,'attributes':_0x26167f['options']?_0x26167f[_0x64c0('0x1a')][_0x64c0('0x1c')]||null:null,'include':_0x26167f[_0x64c0('0x1a')]?_0x26167f[_0x64c0('0x1a')]['include']?_['map'](_0x26167f[_0x64c0('0x1a')][_0x64c0('0x1d')],function(_0x2ac997){return{'model':db[_0x2ac997[_0x64c0('0x1e')]],'as':_0x2ac997['as'],'attributes':_0x2ac997['attributes'],'include':_0x2ac997[_0x64c0('0x1d')]?_[_0x64c0('0x1f')](_0x2ac997[_0x64c0('0x1d')],function(_0x4a20e0){return{'model':db[_0x4a20e0['model']],'as':_0x4a20e0['as'],'attributes':_0x4a20e0[_0x64c0('0x1c')],'include':_0x4a20e0[_0x64c0('0x1d')]?_[_0x64c0('0x1f')](_0x4a20e0[_0x64c0('0x1d')],function(_0x42a7a2){return{'model':db[_0x42a7a2['model']],'as':_0x42a7a2['as'],'attributes':_0x42a7a2[_0x64c0('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x64c0('0x20')](function(_0x18eb20){logger['info'](_0x64c0('0x21'),_0x26167f);logger[_0x64c0('0x12')]('ShowSetting',_0x26167f,JSON[_0x64c0('0x13')](_0x18eb20));_0xd97985(_0x18eb20);})[_0x64c0('0x22')](function(_0x61e9bd){logger[_0x64c0('0x14')](_0x64c0('0x21'),_0x61e9bd[_0x64c0('0x16')],_0x26167f);_0x33a599(_0x1d7002[_0x64c0('0x14')](0x1f4,_0x61e9bd['message']));});});};
\ No newline at end of file
index 4b242cf..5e9d26a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x1cee69,_0x7f7541){var _0x454299=function(_0x5ba0ee){while(--_0x5ba0ee){_0x1cee69['push'](_0x1cee69['shift']());}};_0x454299(++_0x7f7541);}(_0x53ec,0x192));var _0xc53e=function(_0x31c5fd,_0x33131f){_0x31c5fd=_0x31c5fd-0x0;var _0x3799ab=_0x53ec[_0x31c5fd];return _0x3799ab;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router;
\ No newline at end of file
+var _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x4cb086,_0x4cc048){var _0x10d1af=function(_0x296e16){while(--_0x296e16){_0x4cb086['push'](_0x4cb086['shift']());}};_0x10d1af(++_0x4cc048);}(_0x814b,0x1a2));var _0xb814=function(_0x4d40dd,_0x39592b){_0x4d40dd=_0x4d40dd-0x0;var _0x1c51f2=_0x814b[_0x4d40dd];return _0x1c51f2;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router;
\ No newline at end of file
index 6e68035..06dc0ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f0c=['name','ENUM','connectel','plivo','clickatell','bandwidth','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','randomstring','exports','STRING'];(function(_0x4f2d8f,_0x1b2d2e){var _0xb2ab77=function(_0x1b0c4a){while(--_0x1b0c4a){_0x4f2d8f['push'](_0x4f2d8f['shift']());}};_0xb2ab77(++_0x1b2d2e);}(_0x1f0c,0x95));var _0xc1f0=function(_0x51c7aa,_0x272a18){_0x51c7aa=_0x51c7aa-0x0;var _0x323072=_0x1f0c[_0x51c7aa];return _0x323072;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xc1f0('0x0'));module[_0xc1f0('0x1')]={'name':{'type':Sequelize[_0xc1f0('0x2')],'unique':_0xc1f0('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xc1f0('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xc1f0('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xc1f0('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0xc1f0('0x2')]},'type':{'type':Sequelize[_0xc1f0('0x4')]('twilio','skebby',_0xc1f0('0x5'),'clicksend',_0xc1f0('0x6'),_0xc1f0('0x7'),_0xc1f0('0x8'),'csc',_0xc1f0('0x9'),_0xc1f0('0xa'))},'accountSid':{'type':Sequelize[_0xc1f0('0x2')]},'authId':{'type':Sequelize[_0xc1f0('0x2')]},'authToken':{'type':Sequelize[_0xc1f0('0x2')]},'smsMethod':{'type':Sequelize[_0xc1f0('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xc1f0('0x2')]},'password':{'type':Sequelize[_0xc1f0('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0xc1f0('0x2')]},'accountId':{'type':Sequelize[_0xc1f0('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0xc1f0('0xb')],'defaultValue':![]},'description':{'type':Sequelize[_0xc1f0('0x2')]},'notificationTemplate':{'type':Sequelize[_0xc1f0('0xc')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc1f0('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc1f0('0xb')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc1f0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc1f0('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc1f0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc1f0('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc1f0('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xc1f0('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc1f0('0xe')},'mandatoryDisposition':{'type':Sequelize[_0xc1f0('0xb')],'defaultValue':![],'comment':_0xc1f0('0xf'),'set':function(_0x4c4e19){if(!_0x4c4e19)this['setDataValue'](_0xc1f0('0x10'),null);this[_0xc1f0('0x11')](_0xc1f0('0x12'),_0x4c4e19);}}};
\ No newline at end of file
+var _0x50b6=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','generate','twilio','skebby','plivo','bandwidth','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER'];(function(_0x252280,_0x1e7079){var _0x2fde19=function(_0x5eefbc){while(--_0x5eefbc){_0x252280['push'](_0x252280['shift']());}};_0x2fde19(++_0x1e7079);}(_0x50b6,0xa3));var _0x650b=function(_0x5dc980,_0xddcc83){_0x5dc980=_0x5dc980-0x0;var _0x3d6a8e=_0x50b6[_0x5dc980];return _0x3d6a8e;};'use strict';var Sequelize=require(_0x650b('0x0'));var rs=require(_0x650b('0x1'));module[_0x650b('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x650b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x650b('0x4')],'allowNull':![]},'remote':{'type':Sequelize[_0x650b('0x4')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x650b('0x5')]();}},'phone':{'type':Sequelize[_0x650b('0x4')]},'type':{'type':Sequelize['ENUM'](_0x650b('0x6'),_0x650b('0x7'),'connectel','clicksend',_0x650b('0x8'),'clickatell',_0x650b('0x9'),'csc',_0x650b('0xa'),_0x650b('0xb'))},'accountSid':{'type':Sequelize[_0x650b('0x4')]},'authId':{'type':Sequelize[_0x650b('0x4')]},'authToken':{'type':Sequelize[_0x650b('0x4')]},'smsMethod':{'type':Sequelize[_0x650b('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0x650b('0x4')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x650b('0x4')]},'applicationId':{'type':Sequelize[_0x650b('0x4')]},'accountId':{'type':Sequelize[_0x650b('0x4')]},'senderString':{'type':Sequelize[_0x650b('0x4')]},'deliveryReport':{'type':Sequelize[_0x650b('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x650b('0x4')]},'notificationTemplate':{'type':Sequelize[_0x650b('0xe')],'defaultValue':function(){return _0x650b('0xf');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x650b('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x650b('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x650b('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x650b('0xd')],'defaultValue':![],'comment':_0x650b('0x11'),'set':function(_0x33666c){if(!_0x33666c)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x650b('0x12')](_0x650b('0x13'),_0x33666c);}}};
\ No newline at end of file
index b951707..fa14c3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadfe=['removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','SmsApplication','applications','orderBy','Applications','priority','asc','account','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','sender','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','text','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','push','close','*,*,*,*','SmsMessage','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','set','Content-Type','text/xml','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','pick','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','tag','to\x20is\x20mandatory','List','Messages','dataValues','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','groupName','bandwidth','redif','connectel','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','state','message-id','addAgents','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','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','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','model','query','filters','fields','attributes','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','findAll','rows','show','rawAttributes','keys','intersection','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','describe','SmsAccountId','Disposition','findOne','order'];(function(_0x4b1760,_0x26c4e2){var _0x4f082d=function(_0xedb210){while(--_0xedb210){_0x4b1760['push'](_0x4b1760['shift']());}};_0x4f082d(++_0x26c4e2);}(_0xadfe,0x154));var _0xeadf=function(_0x58bc15,_0x48111f){_0x58bc15=_0x58bc15-0x0;var _0x48bd34=_0xadfe[_0x58bc15];return _0x48bd34;};'use strict';var emlformat=require(_0xeadf('0x0'));var rimraf=require(_0xeadf('0x1'));var zipdir=require(_0xeadf('0x2'));var jsonpatch=require(_0xeadf('0x3'));var rp=require(_0xeadf('0x4'));var moment=require(_0xeadf('0x5'));var BPromise=require(_0xeadf('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xeadf('0x7'));var sox=require(_0xeadf('0x8'));var csv=require(_0xeadf('0x9'));var ejs=require(_0xeadf('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeadf('0xb'));var squel=require('squel');var crypto=require(_0xeadf('0xc'));var jsforce=require(_0xeadf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xeadf('0x9'));var querystring=require(_0xeadf('0xe'));var Papa=require('papaparse');var Redis=require(_0xeadf('0xf'));var authService=require(_0xeadf('0x10'));var qs=require(_0xeadf('0x11'));var as=require(_0xeadf('0x12'));var hardwareService=require(_0xeadf('0x13'));var logger=require('../../config/logger')(_0xeadf('0x14'));var utils=require(_0xeadf('0x15'));var config=require(_0xeadf('0x16'));var licenseUtil=require(_0xeadf('0x17'));var db=require(_0xeadf('0x18'))['db'];config[_0xeadf('0x19')]=_['defaults'](config[_0xeadf('0x19')],{'host':_0xeadf('0x1a'),'port':0x18eb});var socket=require(_0xeadf('0x1b'))(new Redis(config[_0xeadf('0x19')]));require('./smsAccount.socket')[_0xeadf('0x1c')](socket);var jayson=require(_0xeadf('0x1d'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x3f616f,_0x1efe3e,_0x239c21,_0x3ec179){return new BPromise(function(_0x2041be,_0x43b383){var _0x185c3e=_0x3ec179||client;return _0x185c3e['request'](_0x3f616f,_0x239c21)[_0xeadf('0x1e')](function(_0x5a6d12){logger[_0xeadf('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x1efe3e,_0xeadf('0x20'));logger['debug'](_0xeadf('0x21'),_0x1efe3e,'request\x20sent',JSON[_0xeadf('0x22')](_0x5a6d12));if(_0x5a6d12[_0xeadf('0x23')]){if(_0x5a6d12[_0xeadf('0x23')][_0xeadf('0x24')]===0x1f4){logger['error'](_0xeadf('0x25'),_0x1efe3e,_0x5a6d12[_0xeadf('0x23')][_0xeadf('0x26')]);return _0x43b383(_0x5a6d12[_0xeadf('0x23')]['message']);}logger['error'](_0xeadf('0x25'),_0x1efe3e,_0x5a6d12[_0xeadf('0x23')][_0xeadf('0x26')]);return _0x2041be(_0x5a6d12[_0xeadf('0x23')][_0xeadf('0x26')]);}else{logger['info'](_0xeadf('0x25'),_0x1efe3e,_0xeadf('0x20'));_0x2041be(_0x5a6d12[_0xeadf('0x27')][_0xeadf('0x26')]);}})[_0xeadf('0x28')](function(_0x361dcb){logger[_0xeadf('0x23')](_0xeadf('0x25'),_0x1efe3e,_0x361dcb);_0x43b383(_0x361dcb);});});}function respondWithStatusCode(_0x1f2f52,_0x19f779){_0x19f779=_0x19f779||0xcc;return function(_0x504639){if(_0x504639){return _0x1f2f52[_0xeadf('0x29')](_0x19f779);}return _0x1f2f52[_0xeadf('0x2a')](_0x19f779)[_0xeadf('0x2b')]();};}function respondWithResult(_0x5ab87d,_0x4ffd78){_0x4ffd78=_0x4ffd78||0xc8;return function(_0x449273){if(_0x449273){return _0x5ab87d[_0xeadf('0x2a')](_0x4ffd78)[_0xeadf('0x2c')](_0x449273);}};}function respondWithFilteredResult(_0x63034c,_0x124afb){return function(_0x7edefe){if(_0x7edefe){var _0x262ead=typeof _0x124afb[_0xeadf('0x2d')]===_0xeadf('0x2e')&&typeof _0x124afb[_0xeadf('0x2f')]===_0xeadf('0x2e');var _0xaeac7f=_0x7edefe[_0xeadf('0x30')];var _0x3de00e=_0x262ead?0x0:_0x124afb[_0xeadf('0x2d')];var _0x22b6c9=_0x262ead?_0x7edefe[_0xeadf('0x30')]:_0x124afb[_0xeadf('0x2d')]+_0x124afb[_0xeadf('0x2f')];var _0x1c3e88;if(_0x22b6c9>=_0xaeac7f){_0x22b6c9=_0xaeac7f;_0x1c3e88=0xc8;}else{_0x1c3e88=0xce;}_0x63034c[_0xeadf('0x2a')](_0x1c3e88);return _0x63034c['set'](_0xeadf('0x31'),_0x3de00e+'-'+_0x22b6c9+'/'+_0xaeac7f)[_0xeadf('0x2c')](_0x7edefe);}return null;};}function patchUpdates(_0x5561f1){return function(_0x2250e4){try{jsonpatch[_0xeadf('0x32')](_0x2250e4,_0x5561f1,!![]);}catch(_0x48cc38){return BPromise[_0xeadf('0x33')](_0x48cc38);}return _0x2250e4[_0xeadf('0x34')]();};}function saveUpdates(_0x2ae8bc,_0x501407){return function(_0x6c7bbe){if(_0x6c7bbe){return _0x6c7bbe[_0xeadf('0x35')](_0x2ae8bc)['then'](function(_0x1accbf){return _0x1accbf;});}return null;};}function removeEntity(_0x278497,_0x16d25d){return function(_0x47e3a4){if(_0x47e3a4){return _0x47e3a4[_0xeadf('0x36')]()[_0xeadf('0x1e')](function(){var _0x58f7ef=_0x47e3a4[_0xeadf('0x37')]({'plain':!![]});var _0x19c2a7=_0xeadf('0x38');return db[_0xeadf('0x39')][_0xeadf('0x36')]({'where':{'type':_0x19c2a7,'resourceId':_0x58f7ef['id']}})[_0xeadf('0x1e')](function(){return _0x47e3a4;});})[_0xeadf('0x1e')](function(){_0x278497[_0xeadf('0x2a')](0xcc)[_0xeadf('0x2b')]();});}};}function handleEntityNotFound(_0x8ee580,_0x236c3a){return function(_0x5ee3ff){if(!_0x5ee3ff){_0x8ee580[_0xeadf('0x29')](0x194);}return _0x5ee3ff;};}function handleError(_0x14ddfd,_0x1e9018){_0x1e9018=_0x1e9018||0x1f4;return function(_0x13c383){logger[_0xeadf('0x23')](_0x13c383[_0xeadf('0x3a')]);if(_0x13c383[_0xeadf('0x3b')]){delete _0x13c383[_0xeadf('0x3b')];}_0x14ddfd['status'](_0x1e9018)[_0xeadf('0x3c')](_0x13c383);};}exports[_0xeadf('0x3d')]=function(_0x87824b,_0x2a2ae3){var _0x196b67={'include':[{'model':db[_0xeadf('0x3e')],'as':_0xeadf('0x3f')}]},_0x5157b9={},_0x1eb5a5={'count':0x0,'rows':[]};var _0x7c4618=_[_0xeadf('0x40')](db[_0xeadf('0x41')]['rawAttributes'],function(_0x23872c){return{'name':_0x23872c[_0xeadf('0x42')],'type':_0x23872c[_0xeadf('0x43')]['key']};});_0x5157b9[_0xeadf('0x44')]=_[_0xeadf('0x40')](_0x7c4618,_0xeadf('0x3b'));_0x5157b9[_0xeadf('0x45')]=_['keys'](_0x87824b['query']);_0x5157b9[_0xeadf('0x46')]=_['intersection'](_0x5157b9[_0xeadf('0x44')],_0x5157b9[_0xeadf('0x45')]);_0x196b67['attributes']=_['intersection'](_0x5157b9[_0xeadf('0x44')],qs[_0xeadf('0x47')](_0x87824b[_0xeadf('0x45')][_0xeadf('0x47')]));_0x196b67[_0xeadf('0x48')]=_0x196b67['attributes']['length']?_0x196b67[_0xeadf('0x48')]:_0x5157b9[_0xeadf('0x44')];if(!_0x87824b['query'][_0xeadf('0x49')](_0xeadf('0x4a'))){_0x196b67['limit']=qs['limit'](_0x87824b[_0xeadf('0x45')]['limit']);_0x196b67[_0xeadf('0x2d')]=qs[_0xeadf('0x2d')](_0x87824b['query']['offset']);}_0x196b67['order']=qs[_0xeadf('0x4b')](_0x87824b[_0xeadf('0x45')][_0xeadf('0x4b')]);_0x196b67[_0xeadf('0x4c')]=qs[_0xeadf('0x46')](_['pick'](_0x87824b[_0xeadf('0x45')],_0x5157b9[_0xeadf('0x46')]),_0x7c4618);if(_0x87824b[_0xeadf('0x45')][_0xeadf('0x4d')]){_0x196b67['where']=_[_0xeadf('0x4e')](_0x196b67[_0xeadf('0x4c')],{'$or':_[_0xeadf('0x40')](_0x7c4618,function(_0x3d923c){if(_0x3d923c[_0xeadf('0x43')]!=='VIRTUAL'){var _0x2ac3b1={};_0x2ac3b1[_0x3d923c[_0xeadf('0x3b')]]={'$like':'%'+_0x87824b['query']['filter']+'%'};return _0x2ac3b1;}})});}_0x196b67=_[_0xeadf('0x4e')]({},_0x196b67,_0x87824b[_0xeadf('0x4f')]);var _0x10d7d2={'where':_0x196b67['where']};return db[_0xeadf('0x41')]['count'](_0x10d7d2)['then'](function(_0x47f0db){_0x1eb5a5[_0xeadf('0x30')]=_0x47f0db;if(_0x87824b[_0xeadf('0x45')][_0xeadf('0x50')]){_0x196b67['include']=[{'all':!![]}];}return db[_0xeadf('0x41')][_0xeadf('0x51')](_0x196b67);})[_0xeadf('0x1e')](function(_0x360e5d){_0x1eb5a5[_0xeadf('0x52')]=_0x360e5d;return _0x1eb5a5;})['then'](respondWithFilteredResult(_0x2a2ae3,_0x196b67))[_0xeadf('0x28')](handleError(_0x2a2ae3,null));};exports[_0xeadf('0x53')]=function(_0x67326a,_0x35a730){var _0x178dea={'raw':![],'where':{'id':_0x67326a['params']['id']},'include':[{'model':db[_0xeadf('0x3e')],'as':_0xeadf('0x3f')}]},_0x2874b={};_0x2874b['model']=_['keys'](db[_0xeadf('0x41')][_0xeadf('0x54')]);_0x2874b[_0xeadf('0x45')]=_[_0xeadf('0x55')](_0x67326a[_0xeadf('0x45')]);_0x2874b[_0xeadf('0x46')]=_[_0xeadf('0x56')](_0x2874b[_0xeadf('0x44')],_0x2874b[_0xeadf('0x45')]);_0x178dea['attributes']=_[_0xeadf('0x56')](_0x2874b[_0xeadf('0x44')],qs['fields'](_0x67326a[_0xeadf('0x45')]['fields']));_0x178dea[_0xeadf('0x48')]=_0x178dea[_0xeadf('0x48')][_0xeadf('0x57')]?_0x178dea[_0xeadf('0x48')]:_0x2874b[_0xeadf('0x44')];if(_0x67326a[_0xeadf('0x45')][_0xeadf('0x50')]){_0x178dea[_0xeadf('0x58')]=[{'all':!![]}];}_0x178dea=_[_0xeadf('0x4e')]({},_0x178dea,_0x67326a[_0xeadf('0x4f')]);return db['SmsAccount'][_0xeadf('0x59')](_0x178dea)[_0xeadf('0x1e')](handleEntityNotFound(_0x35a730,null))[_0xeadf('0x1e')](respondWithResult(_0x35a730,null))[_0xeadf('0x28')](handleError(_0x35a730,null));};exports[_0xeadf('0x5a')]=function(_0x2e91f4,_0x36e11e){return db[_0xeadf('0x41')][_0xeadf('0x5a')](_0x2e91f4[_0xeadf('0x5b')],{})[_0xeadf('0x1e')](function(_0xec6b25){var _0x3a8f58=_0x2e91f4[_0xeadf('0x5c')][_0xeadf('0x37')]({'plain':!![]});if(!_0x3a8f58)throw new Error(_0xeadf('0x5d'));if(_0x3a8f58[_0xeadf('0x5e')]==='user'){var _0x146e91=_0xec6b25['get']({'plain':!![]});var _0x1beab0=_0xeadf('0x38');return db[_0xeadf('0x5f')]['find']({'where':{'name':_0x1beab0,'userProfileId':_0x3a8f58[_0xeadf('0x60')]},'raw':!![]})['then'](function(_0xcfea52){if(_0xcfea52&&_0xcfea52[_0xeadf('0x61')]===0x0){return db[_0xeadf('0x39')]['create']({'name':_0x146e91[_0xeadf('0x3b')],'resourceId':_0x146e91['id'],'type':_0xcfea52['name'],'sectionId':_0xcfea52['id']},{})[_0xeadf('0x1e')](function(){return _0xec6b25;});}else{return _0xec6b25;}})[_0xeadf('0x28')](function(_0x109ad7){logger[_0xeadf('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x109ad7);throw _0x109ad7;});}return _0xec6b25;})[_0xeadf('0x1e')](respondWithResult(_0x36e11e,0xc9))[_0xeadf('0x28')](handleError(_0x36e11e,null));};exports['update']=function(_0x49c4b0,_0x31c581){if(_0x49c4b0[_0xeadf('0x5b')]['id']){delete _0x49c4b0[_0xeadf('0x5b')]['id'];}return db['SmsAccount'][_0xeadf('0x59')]({'where':{'id':_0x49c4b0['params']['id']},'include':[{'model':db[_0xeadf('0x3e')],'as':_0xeadf('0x3f')}]})[_0xeadf('0x1e')](handleEntityNotFound(_0x31c581,null))[_0xeadf('0x1e')](saveUpdates(_0x49c4b0[_0xeadf('0x5b')],null))['then'](respondWithResult(_0x31c581,null))['catch'](handleError(_0x31c581,null));};exports[_0xeadf('0x36')]=function(_0x40145a,_0x5da8a0){return db[_0xeadf('0x41')][_0xeadf('0x59')]({'where':{'id':_0x40145a[_0xeadf('0x62')]['id']}})[_0xeadf('0x1e')](handleEntityNotFound(_0x5da8a0,null))[_0xeadf('0x1e')](removeEntity(_0x5da8a0,null))[_0xeadf('0x28')](handleError(_0x5da8a0,null));};exports['describe']=function(_0x49bcb9,_0x9cfd6e){return db[_0xeadf('0x41')][_0xeadf('0x63')]()[_0xeadf('0x1e')](respondWithResult(_0x9cfd6e,null))[_0xeadf('0x28')](handleError(_0x9cfd6e,null));};exports['addDisposition']=function(_0x234954,_0x1a2411,_0x2c6005){if(_0x234954[_0xeadf('0x5b')]['id']){delete _0x234954['body']['id'];}return db[_0xeadf('0x41')]['find']({'where':{'id':_0x234954[_0xeadf('0x62')]['id']}})[_0xeadf('0x1e')](handleEntityNotFound(_0x1a2411,null))[_0xeadf('0x1e')](function(_0x15bfc0){if(_0x15bfc0){_0x234954[_0xeadf('0x5b')][_0xeadf('0x64')]=_0x15bfc0['id'];return db[_0xeadf('0x65')]['create'](_0x234954[_0xeadf('0x5b')]);}})[_0xeadf('0x1e')](respondWithResult(_0x1a2411,null))[_0xeadf('0x28')](handleError(_0x1a2411,null));};exports['getDispositions']=function(_0x55f7c7,_0x526180,_0x123a87){var _0x228291={'raw':![],'where':{}};var _0x4f20e3={};var _0x3e58f6={'count':0x0,'rows':[]};return db[_0xeadf('0x41')][_0xeadf('0x66')]({'where':{'id':_0x55f7c7[_0xeadf('0x62')]['id']}})['then'](handleEntityNotFound(_0x526180,null))['then'](function(_0x5eef0d){if(_0x5eef0d){_0x4f20e3[_0xeadf('0x44')]=_[_0xeadf('0x55')](db[_0xeadf('0x65')][_0xeadf('0x54')]);_0x4f20e3[_0xeadf('0x45')]=_[_0xeadf('0x55')](_0x55f7c7[_0xeadf('0x45')]);_0x4f20e3[_0xeadf('0x46')]=_['intersection'](_0x4f20e3[_0xeadf('0x44')],_0x4f20e3['query']);_0x228291[_0xeadf('0x48')]=_[_0xeadf('0x56')](_0x4f20e3[_0xeadf('0x44')],qs[_0xeadf('0x47')](_0x55f7c7[_0xeadf('0x45')][_0xeadf('0x47')]));_0x228291[_0xeadf('0x48')]=_0x228291[_0xeadf('0x48')][_0xeadf('0x57')]?_0x228291[_0xeadf('0x48')]:_0x4f20e3[_0xeadf('0x44')];if(!_0x55f7c7[_0xeadf('0x45')][_0xeadf('0x49')](_0xeadf('0x4a'))){_0x228291[_0xeadf('0x2f')]=qs['limit'](_0x55f7c7[_0xeadf('0x45')]['limit']);_0x228291[_0xeadf('0x2d')]=qs[_0xeadf('0x2d')](_0x55f7c7[_0xeadf('0x45')][_0xeadf('0x2d')]);}_0x228291[_0xeadf('0x67')]=qs[_0xeadf('0x4b')](_0x55f7c7['query'][_0xeadf('0x4b')]);_0x228291[_0xeadf('0x4c')]=qs['filters'](_['pick'](_0x55f7c7['query'],_0x4f20e3[_0xeadf('0x46')]));_0x228291['where'][_0xeadf('0x64')]=_0x5eef0d['id'];if(_0x55f7c7[_0xeadf('0x45')][_0xeadf('0x4d')]){_0x228291[_0xeadf('0x4c')]=_[_0xeadf('0x4e')](_0x228291['where'],{'$or':_[_0xeadf('0x40')](_0x228291[_0xeadf('0x48')],function(_0x172666){var _0x2bfe67={};_0x2bfe67[_0x172666]={'$like':'%'+_0x55f7c7['query'][_0xeadf('0x4d')]+'%'};return _0x2bfe67;})});}_0x228291=_[_0xeadf('0x4e')]({},_0x228291,_0x55f7c7[_0xeadf('0x4f')]);return db[_0xeadf('0x65')][_0xeadf('0x30')]({'where':_0x228291[_0xeadf('0x4c')]})['then'](function(_0x5191fb){_0x3e58f6[_0xeadf('0x30')]=_0x5191fb;if(_0x55f7c7['query'][_0xeadf('0x50')]){_0x228291[_0xeadf('0x58')]=[{'all':!![]}];}return db[_0xeadf('0x65')]['findAll'](_0x228291);})[_0xeadf('0x1e')](function(_0x45cd09){_0x3e58f6[_0xeadf('0x52')]=_0x45cd09;return _0x3e58f6;});}})['then'](respondWithFilteredResult(_0x526180,_0x228291))[_0xeadf('0x28')](handleError(_0x526180,null));};exports[_0xeadf('0x68')]=function(_0x677fb7,_0x1dda74,_0x42038c){return db[_0xeadf('0x41')][_0xeadf('0x59')]({'where':{'id':_0x677fb7[_0xeadf('0x62')]['id']}})['then'](handleEntityNotFound(_0x1dda74,null))[_0xeadf('0x1e')](function(_0x30bdac){if(_0x30bdac){return _0x30bdac[_0xeadf('0x68')](_0x677fb7[_0xeadf('0x45')][_0xeadf('0x69')]);}})['then'](respondWithStatusCode(_0x1dda74,null))[_0xeadf('0x28')](handleError(_0x1dda74,null));};exports[_0xeadf('0x6a')]=function(_0x1eac0a,_0x413ebd,_0x42b54d){if(_0x1eac0a[_0xeadf('0x5b')]['id']){delete _0x1eac0a['body']['id'];}return db[_0xeadf('0x41')][_0xeadf('0x59')]({'where':{'id':_0x1eac0a[_0xeadf('0x62')]['id']}})[_0xeadf('0x1e')](handleEntityNotFound(_0x413ebd,null))['then'](function(_0x1dfd34){if(_0x1dfd34){_0x1eac0a['body']['SmsAccountId']=_0x1dfd34['id'];return db[_0xeadf('0x6b')][_0xeadf('0x5a')](_0x1eac0a[_0xeadf('0x5b')]);}})[_0xeadf('0x1e')](respondWithResult(_0x413ebd,null))[_0xeadf('0x28')](handleError(_0x413ebd,null));};exports[_0xeadf('0x6c')]=function(_0x45d4d9,_0x2e26d0,_0xac7919){var _0x17d6d0={'raw':![],'where':{}};var _0x352c00={};var _0x2fa4f8={'count':0x0,'rows':[]};return db['SmsAccount'][_0xeadf('0x66')]({'where':{'id':_0x45d4d9[_0xeadf('0x62')]['id']}})[_0xeadf('0x1e')](handleEntityNotFound(_0x2e26d0,null))['then'](function(_0x14bbae){if(_0x14bbae){_0x352c00['model']=_[_0xeadf('0x55')](db[_0xeadf('0x6b')][_0xeadf('0x54')]);_0x352c00[_0xeadf('0x45')]=_[_0xeadf('0x55')](_0x45d4d9[_0xeadf('0x45')]);_0x352c00[_0xeadf('0x46')]=_[_0xeadf('0x56')](_0x352c00[_0xeadf('0x44')],_0x352c00[_0xeadf('0x45')]);_0x17d6d0['attributes']=_[_0xeadf('0x56')](_0x352c00['model'],qs[_0xeadf('0x47')](_0x45d4d9[_0xeadf('0x45')]['fields']));_0x17d6d0[_0xeadf('0x48')]=_0x17d6d0[_0xeadf('0x48')][_0xeadf('0x57')]?_0x17d6d0[_0xeadf('0x48')]:_0x352c00[_0xeadf('0x44')];if(!_0x45d4d9[_0xeadf('0x45')][_0xeadf('0x49')](_0xeadf('0x4a'))){_0x17d6d0[_0xeadf('0x2f')]=qs[_0xeadf('0x2f')](_0x45d4d9['query']['limit']);_0x17d6d0[_0xeadf('0x2d')]=qs[_0xeadf('0x2d')](_0x45d4d9[_0xeadf('0x45')][_0xeadf('0x2d')]);}_0x17d6d0[_0xeadf('0x67')]=qs[_0xeadf('0x4b')](_0x45d4d9[_0xeadf('0x45')]['sort']);_0x17d6d0['where']=qs[_0xeadf('0x46')](_['pick'](_0x45d4d9[_0xeadf('0x45')],_0x352c00['filters']));_0x17d6d0[_0xeadf('0x4c')][_0xeadf('0x64')]=_0x14bbae['id'];if(_0x45d4d9[_0xeadf('0x45')][_0xeadf('0x4d')]){_0x17d6d0[_0xeadf('0x4c')]=_['merge'](_0x17d6d0[_0xeadf('0x4c')],{'$or':_['map'](_0x17d6d0[_0xeadf('0x48')],function(_0x573ed4){var _0x44261d={};_0x44261d[_0x573ed4]={'$like':'%'+_0x45d4d9[_0xeadf('0x45')][_0xeadf('0x4d')]+'%'};return _0x44261d;})});}_0x17d6d0=_['merge']({},_0x17d6d0,_0x45d4d9[_0xeadf('0x4f')]);return db['CannedAnswer'][_0xeadf('0x30')]({'where':_0x17d6d0['where']})[_0xeadf('0x1e')](function(_0x12f85d){_0x2fa4f8[_0xeadf('0x30')]=_0x12f85d;if(_0x45d4d9['query'][_0xeadf('0x50')]){_0x17d6d0[_0xeadf('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0xeadf('0x51')](_0x17d6d0);})[_0xeadf('0x1e')](function(_0x5804e5){_0x2fa4f8[_0xeadf('0x52')]=_0x5804e5;return _0x2fa4f8;});}})[_0xeadf('0x1e')](respondWithFilteredResult(_0x2e26d0,_0x17d6d0))[_0xeadf('0x28')](handleError(_0x2e26d0,null));};exports[_0xeadf('0x6d')]=function(_0x5575d6,_0x540de2,_0x2524e7){return db[_0xeadf('0x41')]['find']({'where':{'id':_0x5575d6['params']['id']}})[_0xeadf('0x1e')](handleEntityNotFound(_0x540de2,null))['then'](function(_0x12f21c){if(_0x12f21c){return _0x12f21c[_0xeadf('0x6d')](_0x5575d6[_0xeadf('0x45')][_0xeadf('0x69')]);}})['then'](respondWithStatusCode(_0x540de2,null))[_0xeadf('0x28')](handleError(_0x540de2,null));};exports['notify']=function(_0x4cdc64,_0x1dad72,_0x54e29e){var _0x2cfd33={'channel':'sms'};var _0x501801=[];var _0x599f94=[];var _0x327e3b={};return db[_0xeadf('0x41')][_0xeadf('0x59')]({'where':{'id':_0x4cdc64[_0xeadf('0x62')]['id']},'include':[{'model':db[_0xeadf('0x6e')],'as':'Applications'}]})[_0xeadf('0x1e')](handleEntityNotFound(_0x1dad72,null))['then'](function(_0x16cd42){_0x2cfd33['account']=_0x16cd42;_0x2cfd33[_0xeadf('0x6f')]=_[_0xeadf('0x70')](_0x16cd42[_0xeadf('0x71')],[_0xeadf('0x72')],[_0xeadf('0x73')]);if(_0x2cfd33['account']['Applications']){delete _0x2cfd33[_0xeadf('0x74')][_0xeadf('0x71')];}return db['CmContact'][_0xeadf('0x63')]();})['then'](function(_0x1ba013){if(!_0x1ba013){throw new db[(_0xeadf('0x75'))][(_0xeadf('0x76'))](_0xeadf('0x77'));}_0x501801=_[_0xeadf('0x78')](_[_0xeadf('0x55')](_0x1ba013),[_0xeadf('0x79'),'updatedAt']);_0x599f94=_[_0xeadf('0x78')](_[_0xeadf('0x55')](_0x1ba013),[_0xeadf('0x79'),_0xeadf('0x7a'),_0xeadf('0x7b'),_0xeadf('0x7c')]);_0x2cfd33[_0xeadf('0x5b')]={'mapKey':_0xeadf('0x7d')};if(_0x2cfd33['account']['type']){switch(_0x2cfd33[_0xeadf('0x74')][_0xeadf('0x43')]){case _0xeadf('0x7e'):_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x7f')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x80')];_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x5b')]=_0x4cdc64['body'][_0xeadf('0x81')];_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x82')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x83')];break;case'skebby':_0x2cfd33[_0xeadf('0x5b')]['from']='+'+_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x84')];_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x5b')]=_0x4cdc64[_0xeadf('0x5b')]['text'];break;case'connectel':_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x7f')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x7f')];_0x2cfd33['body'][_0xeadf('0x5b')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x26')];break;case _0xeadf('0x85'):_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x7f')]=_0x4cdc64['body']['from'];_0x2cfd33['body']['body']=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x5b')];_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x82')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x86')];break;case _0xeadf('0x87'):_0x2cfd33[_0xeadf('0x5b')]['from']=_0x4cdc64['body']['From'];_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x5b')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x88')];_0x2cfd33[_0xeadf('0x5b')]['messageId']=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x89')];break;case _0xeadf('0x8a'):_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x7f')]='+'+_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x8b')][0x0][_0xeadf('0x7f')];_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x5b')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x8b')][0x0][_0xeadf('0x8c')];_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x82')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x8b')][0x0][_0xeadf('0x82')];break;case _0xeadf('0x8d'):_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x7f')]=_0x4cdc64[_0xeadf('0x5b')]['originatingAddress'];_0x2cfd33['body'][_0xeadf('0x5b')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x8e')][_0xeadf('0x26')];break;case _0xeadf('0x8f'):_0x2cfd33[_0xeadf('0x5b')]['from']=_0x4cdc64['body'][_0xeadf('0x90')];_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x5b')]=_0x4cdc64[_0xeadf('0x5b')]['text'];_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x82')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x91')];break;case'bandwidth':_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x82')]=_0x4cdc64[_0xeadf('0x5b')][0x0]['message']['id'];_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x7f')]=_0x4cdc64[_0xeadf('0x5b')][0x0]['message'][_0xeadf('0x7f')];_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x5b')]=_0x4cdc64['body'][0x0][_0xeadf('0x26')][_0xeadf('0x8c')];break;case _0xeadf('0x92'):_0x2cfd33['body'][_0xeadf('0x7f')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x7f')];_0x2cfd33['body'][_0xeadf('0x5b')]=_0x4cdc64[_0xeadf('0x5b')][_0xeadf('0x26')];_0x2cfd33['body'][_0xeadf('0x82')]=_0x4cdc64['body'][_0xeadf('0x93')];break;}}if(_0x2cfd33[_0xeadf('0x5b')]['id']){delete _0x2cfd33[_0xeadf('0x5b')]['id'];}if(_[_0xeadf('0x94')](_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x7f')])){throw new db[(_0xeadf('0x75'))][(_0xeadf('0x76'))]('from\x20is\x20mandatory');}if(_[_0xeadf('0x94')](_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x5b')])||_0x2cfd33['body'][_0xeadf('0x5b')]===''){throw new db[(_0xeadf('0x75'))][(_0xeadf('0x76'))](_0xeadf('0x95'));}if(_['isNil'](_0x2cfd33['body'][_0xeadf('0x96')])){throw new db[(_0xeadf('0x75'))][(_0xeadf('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x599f94);}if(!_[_0xeadf('0x97')](_0x599f94,_0x2cfd33['body']['mapKey'])){throw new db[(_0xeadf('0x75'))][(_0xeadf('0x76'))](_0xeadf('0x98')+_0x599f94);}_0x327e3b[_0x2cfd33['body'][_0xeadf('0x96')]]=_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x7f')];return db[_0xeadf('0x99')]['find']({'where':{'id':_0x2cfd33[_0xeadf('0x74')][_0xeadf('0x7c')]},'include':[{'model':db['CmContact'],'as':_0xeadf('0x9a'),'where':_0x327e3b,'limit':0x1,'order':[[_0xeadf('0x7a'),_0xeadf('0x9b')]]}]});})['then'](handleEntityNotFound(_0x1dad72,null))['then'](function(_0x37430e){if(_0x37430e){_0x2cfd33[_0xeadf('0x9c')]=_['omit'](_0x37430e,[_0xeadf('0x9a')]);if(_0x37430e[_0xeadf('0x9a')][_0xeadf('0x57')]){return _0x37430e[_0xeadf('0x9a')][0x0];}var _0x489fd2=_[_0xeadf('0x9d')](_0x2cfd33[_0xeadf('0x5b')],{'firstName':_0x2cfd33[_0xeadf('0x5b')]['from'],'ListId':_0x37430e['id']});_0x489fd2[_0x2cfd33['body'][_0xeadf('0x96')]]=_0x2cfd33[_0xeadf('0x5b')][_0xeadf('0x7f')];return db['CmContact'][_0xeadf('0x5a')](_0x489fd2,{'fields':_0x501801,'raw':!![]});}})[_0xeadf('0x1e')](handleEntityNotFound(_0x1dad72,null))['then'](function(_0x3a94ab){if(_0x3a94ab){_0x2cfd33[_0xeadf('0x9e')]=_0x3a94ab;var _0x249112={'ContactId':_0x3a94ab['id'],'phone':_0x2cfd33['body'][_0xeadf('0x7f')],'SmsAccountId':_0x4cdc64[_0xeadf('0x62')]['id']};var _0x30ec57={'ContactId':_0x3a94ab['id'],'SmsAccountId':_0x4cdc64[_0xeadf('0x62')]['id'],'closed':![]};return db[_0xeadf('0x9f')][_0xeadf('0x59')]({'where':_0x30ec57})[_0xeadf('0x1e')](function(_0x45c876){if(_0x45c876){return[_0x45c876,![]];}return db[_0xeadf('0x9f')][_0xeadf('0x5a')](_0x249112)[_0xeadf('0x1e')](function(_0x50b32a){return[_0x50b32a,!![]];});});}})[_0xeadf('0xa0')](function(_0x1a6586,_0x348171){_0x2cfd33[_0xeadf('0xa1')]=_0x1a6586[_0xeadf('0x37')]({'plain':!![]});_0x2cfd33[_0xeadf('0xa1')][_0xeadf('0xa2')]=![];if(_0x348171){if(_0x2cfd33['account'][_0xeadf('0xa3')]){_0x2cfd33[_0xeadf('0x6f')][_0xeadf('0xa4')]({'id':0x0,'priority':_0x2cfd33[_0xeadf('0x6f')][_0xeadf('0x57')]+0x1,'app':_0xeadf('0xa5'),'appdata':'unmanaged','interval':_0xeadf('0xa6')});}_0x2cfd33['interaction'][_0xeadf('0xa2')]=!![];}return db[_0xeadf('0xa7')][_0xeadf('0x5a')]({'phone':_0x2cfd33[_0xeadf('0x5b')]['from'],'messageId':_0x2cfd33[_0xeadf('0x5b')]['messageId'],'body':_0x2cfd33['body'][_0xeadf('0x5b')],'SmsAccountId':_0x4cdc64['params']['id'],'SmsInteractionId':_0x1a6586['id'],'direction':'in','ContactId':_0x1a6586['ContactId'],'AttachmentId':_0x2cfd33[_0xeadf('0x5b')]['AttachmentId']});})[_0xeadf('0x1e')](function(_0x4f7328){_0x2cfd33[_0xeadf('0x26')]=_0x4f7328;if(_0x2cfd33[_0xeadf('0xa1')][_0xeadf('0xa8')]){return db['User'][_0xeadf('0x59')]({'attributes':['id',_0xeadf('0x3b')],'where':{'id':_0x2cfd33['interaction'][_0xeadf('0xa8')]}})[_0xeadf('0x1e')](function(_0x11ee06){if(_0x11ee06){_0x2cfd33['applications'][_0xeadf('0xa9')]({'id':0x0,'priority':0x0,'app':_0xeadf('0xaa'),'appdata':_0x11ee06[_0xeadf('0x3b')]+','+(_0x2cfd33['account'][_0xeadf('0xab')]||0xa),'interval':_0xeadf('0xa6')});}return respondWithRpcPromise('Start','startRouting',_0x2cfd33);});}return respondWithRpcPromise(_0xeadf('0xac'),_0xeadf('0xad'),_0x2cfd33);})[_0xeadf('0x1e')](function(_0x386e80){if(_0x386e80){var _0x59e716=0xc8;var _0x5e5699=_0xeadf('0xae');logger[_0xeadf('0x1f')](_0xeadf('0x21'),_0x5e5699,_0x59e716,'entity\x20found');logger[_0xeadf('0xaf')](_0xeadf('0xb0'),_0x5e5699,_0x59e716,_0xeadf('0xb1'),JSON[_0xeadf('0x22')](_0x386e80));if(_0x2cfd33[_0xeadf('0x74')][_0xeadf('0x43')]===_0xeadf('0x7e')){return _0x1dad72[_0xeadf('0x2a')](_0x59e716)[_0xeadf('0xb2')](_0xeadf('0xb3'),_0xeadf('0xb4'))[_0xeadf('0x3c')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x1dad72['status'](_0x59e716)[_0xeadf('0x2c')](_0x386e80);}}})[_0xeadf('0x28')](handleError(_0x1dad72,null));};exports[_0xeadf('0xb5')]=function(_0x1fd9fd,_0x3cd7be,_0x19675c){return db[_0xeadf('0x41')]['findOne']({'where':{'id':_0x1fd9fd[_0xeadf('0x62')]['id']}})[_0xeadf('0x1e')](handleEntityNotFound(_0x3cd7be,null))[_0xeadf('0x1e')](function(_0x3862fd){if(_0x3862fd){return db['sequelize'][_0xeadf('0xb6')](function(_0xdfd97b){return db['SmsApplication'][_0xeadf('0x36')]({'where':{'SmsAccountId':_0x1fd9fd[_0xeadf('0x62')]['id']},'transaction':_0xdfd97b})[_0xeadf('0x1e')](function(_0x3b0ebd){var _0x4d45e9=_[_0xeadf('0x40')](_0x1fd9fd[_0xeadf('0x5b')],function(_0xb7f5a1){_0xb7f5a1[_0xeadf('0x64')]=_0x1fd9fd[_0xeadf('0x62')]['id'];return _0xb7f5a1;});return db[_0xeadf('0x6e')][_0xeadf('0xb7')](_0x4d45e9,{'transaction':_0xdfd97b});});})[_0xeadf('0x1e')](function(){return db[_0xeadf('0x6e')][_0xeadf('0xb8')]({'where':{'SmsAccountId':_0x1fd9fd[_0xeadf('0x62')]['id']},'order':_0xeadf('0x72')});});}})[_0xeadf('0x1e')](respondWithResult(_0x3cd7be,null))[_0xeadf('0x28')](handleError(_0x3cd7be,null));};exports[_0xeadf('0xb9')]=function(_0x46656e,_0x5565c6,_0x180694){var _0x2b48c5={};var _0x2ea1bb={};var _0x8ced45;var _0x22612e;return db[_0xeadf('0x41')][_0xeadf('0x66')]({'where':{'id':_0x46656e[_0xeadf('0x62')]['id']}})['then'](handleEntityNotFound(_0x5565c6,null))[_0xeadf('0x1e')](function(_0x45ca4a){if(_0x45ca4a){_0x8ced45=_0x45ca4a;_0x2ea1bb['model']=_[_0xeadf('0x55')](db[_0xeadf('0x6e')][_0xeadf('0x54')]);_0x2ea1bb['query']=_[_0xeadf('0x55')](_0x46656e['query']);_0x2ea1bb[_0xeadf('0x46')]=_[_0xeadf('0x56')](_0x2ea1bb[_0xeadf('0x44')],_0x2ea1bb[_0xeadf('0x45')]);_0x2b48c5[_0xeadf('0x48')]=_['intersection'](_0x2ea1bb[_0xeadf('0x44')],qs['fields'](_0x46656e['query'][_0xeadf('0x47')]));_0x2b48c5[_0xeadf('0x48')]=_0x2b48c5[_0xeadf('0x48')][_0xeadf('0x57')]?_0x2b48c5['attributes']:_0x2ea1bb[_0xeadf('0x44')];_0x2b48c5[_0xeadf('0x67')]=qs[_0xeadf('0x4b')](_0x46656e[_0xeadf('0x45')]['sort']);_0x2b48c5[_0xeadf('0x4c')]=qs['filters'](_[_0xeadf('0xba')](_0x46656e[_0xeadf('0x45')],_0x2ea1bb[_0xeadf('0x46')]));if(_0x46656e['query']['filter']){_0x2b48c5[_0xeadf('0x4c')]=_[_0xeadf('0x4e')](_0x2b48c5[_0xeadf('0x4c')],{'$or':_['map'](_0x2b48c5[_0xeadf('0x48')],function(_0x5ae491){var _0x3b8a5d={};_0x3b8a5d[_0x5ae491]={'$like':'%'+_0x46656e[_0xeadf('0x45')]['filter']+'%'};return _0x3b8a5d;})});}_0x2b48c5=_[_0xeadf('0x4e')]({},_0x2b48c5,_0x46656e['options']);return _0x8ced45[_0xeadf('0xb9')](_0x2b48c5);}})['then'](function(_0x5b8577){if(_0x5b8577){_0x22612e=_0x5b8577[_0xeadf('0x57')];if(!_0x46656e['query']['hasOwnProperty']('nolimit')){_0x2b48c5[_0xeadf('0x2f')]=qs[_0xeadf('0x2f')](_0x46656e[_0xeadf('0x45')]['limit']);_0x2b48c5['offset']=qs['offset'](_0x46656e['query'][_0xeadf('0x2d')]);}return _0x8ced45[_0xeadf('0xb9')](_0x2b48c5);}})['then'](function(_0x5a5957){if(_0x5a5957){return _0x5a5957?{'count':_0x22612e,'rows':_0x5a5957}:null;}})['then'](respondWithResult(_0x5565c6,null))[_0xeadf('0x28')](handleError(_0x5565c6,null));};exports[_0xeadf('0xbb')]=function(_0x24b54e,_0x31557c,_0x448731){var _0x5bc573={'raw':![],'where':{}};var _0x4b9014={};var _0x13c576={'count':0x0,'rows':[]};return db['SmsAccount'][_0xeadf('0x66')]({'where':{'id':_0x24b54e[_0xeadf('0x62')]['id']}})[_0xeadf('0x1e')](handleEntityNotFound(_0x31557c,null))['then'](function(_0x3e0939){if(_0x3e0939){_0x4b9014[_0xeadf('0x44')]=_['keys'](db[_0xeadf('0x9f')][_0xeadf('0x54')]);_0x4b9014[_0xeadf('0x45')]=_[_0xeadf('0x55')](_0x24b54e[_0xeadf('0x45')]);_0x4b9014[_0xeadf('0x46')]=_[_0xeadf('0x56')](_0x4b9014[_0xeadf('0x44')],_0x4b9014[_0xeadf('0x45')]);_0x5bc573[_0xeadf('0x48')]=_[_0xeadf('0x56')](_0x4b9014[_0xeadf('0x44')],qs[_0xeadf('0x47')](_0x24b54e['query']['fields']));_0x5bc573['attributes']=_0x5bc573[_0xeadf('0x48')]['length']?_0x5bc573[_0xeadf('0x48')]:_0x4b9014[_0xeadf('0x44')];if(!_0x24b54e[_0xeadf('0x45')][_0xeadf('0x49')](_0xeadf('0x4a'))){_0x5bc573['limit']=qs[_0xeadf('0x2f')](_0x24b54e['query']['limit']);_0x5bc573[_0xeadf('0x2d')]=qs[_0xeadf('0x2d')](_0x24b54e[_0xeadf('0x45')][_0xeadf('0x2d')]);}_0x5bc573[_0xeadf('0x67')]=qs[_0xeadf('0x4b')](_0x24b54e[_0xeadf('0x45')][_0xeadf('0x4b')]);_0x5bc573['where']=qs[_0xeadf('0x46')](_[_0xeadf('0xba')](_0x24b54e[_0xeadf('0x45')],_0x4b9014['filters']));_0x5bc573[_0xeadf('0x4c')][_0xeadf('0x64')]=_0x3e0939['id'];if(_0x24b54e[_0xeadf('0x45')][_0xeadf('0x4d')]){_0x5bc573[_0xeadf('0x4c')]=_['merge'](_0x5bc573['where'],{'$or':_['map'](_0x5bc573[_0xeadf('0x48')],function(_0x51be94){var _0x15b457={};_0x15b457[_0x51be94]={'$like':'%'+_0x24b54e[_0xeadf('0x45')][_0xeadf('0x4d')]+'%'};return _0x15b457;})});}_0x5bc573=_[_0xeadf('0x4e')]({},_0x5bc573,_0x24b54e[_0xeadf('0x4f')]);return db['SmsInteraction'][_0xeadf('0x30')]({'where':_0x5bc573['where']})['then'](function(_0x588aa2){_0x13c576['count']=_0x588aa2;if(_0x24b54e[_0xeadf('0x45')][_0xeadf('0x50')]){_0x5bc573[_0xeadf('0x58')]=[{'model':db[_0xeadf('0xbc')],'as':_0xeadf('0xbd'),'required':![]},{'model':db[_0xeadf('0xbe')],'as':_0xeadf('0xbf'),'attributes':[_0xeadf('0x3b'),_0xeadf('0xc0'),_0xeadf('0xc1')],'required':![]},{'model':db[_0xeadf('0xc2')],'as':'Tags','attributes':['id',_0xeadf('0x3b'),'color'],'where':_0x24b54e['query'][_0xeadf('0xc3')]?{'id':_0x24b54e['query'][_0xeadf('0xc3')]}:undefined,'required':_0x24b54e[_0xeadf('0x45')][_0xeadf('0xc3')]?!![]:![]}];}return db[_0xeadf('0x9f')][_0xeadf('0x51')](_0x5bc573);})['then'](function(_0x1fb4a4){_0x13c576['rows']=_0x1fb4a4;return _0x13c576;});}})[_0xeadf('0x1e')](respondWithFilteredResult(_0x31557c,_0x5bc573))[_0xeadf('0x28')](handleError(_0x31557c,null));};exports[_0xeadf('0x3c')]=function(_0x1221d9,_0x213e15,_0x917d49){var _0xa04db8,_0xb328a7,_0x20d0a4;if(_[_0xeadf('0x94')](_0x1221d9[_0xeadf('0x5b')][_0xeadf('0x5b')])||_0x1221d9[_0xeadf('0x5b')]['body']===''){throw new db[(_0xeadf('0x75'))]['ValidationError'](_0xeadf('0x95'));}if(_['isNil'](_0x1221d9[_0xeadf('0x5b')]['to'])){throw new db['Sequelize'][(_0xeadf('0x76'))](_0xeadf('0xc4'));}_0xa04db8=_0x1221d9[_0xeadf('0x5b')]['to'];return db[_0xeadf('0x41')][_0xeadf('0x59')]({'where':{'id':_0x1221d9[_0xeadf('0x62')]['id']},'include':[{'model':db[_0xeadf('0x99')],'as':_0xeadf('0xc5'),'include':[{'model':db[_0xeadf('0xbc')],'as':'Contacts','where':{'mobile':_0xa04db8},'limit':0x1,'order':[[_0xeadf('0x7a'),_0xeadf('0x9b')]]}]}]})['then'](handleEntityNotFound(_0x213e15,null))[_0xeadf('0x1e')](function(_0x18cd7f){if(_0x18cd7f&&_0x18cd7f[_0xeadf('0xc5')]){_0xb328a7=_0x18cd7f['get']({'plain':!![]});if(_0xb328a7[_0xeadf('0xc5')]&&_0xb328a7[_0xeadf('0xc5')][_0xeadf('0x9a')][_0xeadf('0x57')]){return _0xb328a7[_0xeadf('0xc5')]['Contacts'][0x0];}return db[_0xeadf('0xbc')][_0xeadf('0x5a')](_[_0xeadf('0x9d')](_0x1221d9[_0xeadf('0x5b')],{'firstName':_0xa04db8,'mobile':_0xa04db8,'phone':_0xa04db8,'ListId':_0xb328a7[_0xeadf('0x7c')]}));}})[_0xeadf('0x1e')](handleEntityNotFound(_0x213e15,null))[_0xeadf('0x1e')](function(_0x2e337d){if(_0x2e337d){_0x20d0a4=_0x2e337d;return db['SmsInteraction'][_0xeadf('0x59')]({'where':{'ContactId':_0x20d0a4['id'],'closed':![],'SmsAccountId':_0xb328a7['id']}})[_0xeadf('0x1e')](function(_0x80d71c){if(_0x80d71c){return[_0x80d71c,![]];}return db['SmsInteraction'][_0xeadf('0x5a')]({'UserId':_0x1221d9[_0xeadf('0x5c')]['id'],'ContactId':_0x20d0a4['id'],'SmsAccountId':_0xb328a7['id'],'phone':_0xa04db8,'firstMsgDirection':'out','Messages':[_[_0xeadf('0x4e')](_0x1221d9[_0xeadf('0x5b')],{'read':![],'body':_0x1221d9[_0xeadf('0x5b')][_0xeadf('0x5b')],'phone':_0xa04db8,'SmsAccountId':_0xb328a7['id'],'UserId':_0x1221d9[_0xeadf('0x5c')]['id'],'ContactId':_0x20d0a4['id']})]},{'include':[{'model':db[_0xeadf('0xa7')],'as':'Messages'}]})['then'](function(_0x2eabd3){return[_0x2eabd3,!![]];});});}})['spread'](function(_0x4ba724,_0x4867e4){if(_0x4867e4){return _0x4ba724;}return db[_0xeadf('0xa7')][_0xeadf('0x5a')](_['merge'](_0x1221d9[_0xeadf('0x5b')],{'read':![],'body':_0x1221d9[_0xeadf('0x5b')]['body'],'phone':_0xa04db8,'SmsAccountId':_0xb328a7['id'],'SmsInteractionId':_0x4ba724['id'],'UserId':_0x1221d9[_0xeadf('0x5c')]['id'],'ContactId':_0x20d0a4['id']}))['then'](function(_0x23e8b8){_0x4ba724['dataValues'][_0xeadf('0xc6')]=[];_0x4ba724[_0xeadf('0xc7')][_0xeadf('0xc6')][_0xeadf('0xa4')](_0x23e8b8[_0xeadf('0xc7')]);return _0x4ba724;});})[_0xeadf('0x1e')](respondWithResult(_0x213e15,null))[_0xeadf('0x28')](handleError(_0x213e15,null));};exports[_0xeadf('0x2a')]=function(_0x1cccb0,_0x162f52,_0x5b6fe1){if(_0x1cccb0[_0xeadf('0x5b')]['id']){delete _0x1cccb0[_0xeadf('0x5b')]['id'];}var _0x618b82,_0xf8197c,_0x4c6cae;return db[_0xeadf('0x41')]['find']({'where':{'id':_0x1cccb0[_0xeadf('0x62')]['id']}})[_0xeadf('0x1e')](handleEntityNotFound(_0x162f52,null))[_0xeadf('0x1e')](function(_0x25a59a){if(_0x25a59a){_0x4c6cae=_0x25a59a;logger[_0xeadf('0xaf')](_0xeadf('0x21'),_0xeadf('0x2a'),'received\x20delivery\x20report\x20from',_0x25a59a[_0xeadf('0x43')],util[_0xeadf('0xc8')](_0x1cccb0[_0xeadf('0x5b')],{'showHidden':![],'depth':null}));switch(_0x25a59a[_0xeadf('0x43')]){case _0xeadf('0xc9'):if(_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0xca')]&&_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0x2a')]){_0xf8197c=_0x1cccb0[_0xeadf('0x5b')]['status'];return db[_0xeadf('0xa7')][_0xeadf('0x59')]({'where':{'messageId':_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0xca')]}});}break;case'connectel':if(_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0xcb')]&&_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0xcc')]){_0xf8197c=_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0xcc')];return db[_0xeadf('0xa7')][_0xeadf('0x59')]({'where':{'messageId':_0x1cccb0[_0xeadf('0x5b')]['requestid']}});}break;case _0xeadf('0x85'):if(_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0x86')]&&_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0xcd')]){_0xf8197c=_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0xcd')];return db[_0xeadf('0xa7')][_0xeadf('0x59')]({'where':{'messageId':_0x1cccb0[_0xeadf('0x5b')]['message_id']}});}break;case _0xeadf('0x8a'):var _0x255a4b=_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0x8b')][0x0];if(_0x255a4b[_0xeadf('0x82')]&&_0x255a4b['status']['groupName']===_0xeadf('0xce')){_0xf8197c=_0x255a4b[_0xeadf('0x2a')][_0xeadf('0xcf')];return db[_0xeadf('0xa7')][_0xeadf('0x59')]({'where':{'messageId':_0x255a4b['messageId']}});}break;case _0xeadf('0x8f'):if(_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0x82')]&&_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0x2a')]){_0xf8197c=_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0x2a')];return db[_0xeadf('0xa7')]['find']({'where':{'messageId':_0x1cccb0[_0xeadf('0x5b')]['messageId']}});}break;case _0xeadf('0xd0'):if(_0x1cccb0[_0xeadf('0x5b')][0x0][_0xeadf('0x26')]['id']){_0xf8197c=_0x1cccb0[_0xeadf('0x5b')][0x0][_0xeadf('0x43')];return db['SmsMessage']['find']({'where':{'messageId':_0x1cccb0[_0xeadf('0x5b')][0x0][_0xeadf('0x26')]['id']}});}break;case _0xeadf('0x92'):if(_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0xd1')]&&_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0x2a')]){_0xf8197c=_0x1cccb0[_0xeadf('0x5b')][_0xeadf('0x2a')];return db['SmsMessage'][_0xeadf('0x59')]({'where':{'messageId':_0x1cccb0[_0xeadf('0x5b')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x162f52,null))[_0xeadf('0x1e')](function(_0x5a4a3c){if(_0x5a4a3c){_0x618b82=_0x5a4a3c;switch(_0x4c6cae[_0xeadf('0x43')]){case _0xeadf('0xc9'):if(_0xf8197c==='DELIVERED'){return _0x618b82[_0xeadf('0x35')]({'read':!![]});}else{logger[_0xeadf('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xeadf('0x2a'),_0xeadf('0xc9'),util['inspect'](_0x1cccb0[_0xeadf('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xeadf('0xd2'):if(_0xf8197c==='1'){return _0x618b82[_0xeadf('0x35')]({'read':!![]});}else{logger[_0xeadf('0x23')](_0xeadf('0x21'),_0xeadf('0x2a'),'skebby',util[_0xeadf('0xc8')](_0x1cccb0['body'],{'showHidden':![],'depth':null}));}break;case _0xeadf('0x85'):if(!_0x1cccb0[_0xeadf('0x5b')]['error_code']&&_0xf8197c>=0xc8&&_0xf8197c<=0xce){return _0x618b82[_0xeadf('0x35')]({'read':!![]});}else{logger[_0xeadf('0x23')](_0xeadf('0x21'),_0xeadf('0x2a'),_0xeadf('0x85'),util[_0xeadf('0xc8')](_0x1cccb0[_0xeadf('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xeadf('0x8a'):var _0x43a234=_0x1cccb0[_0xeadf('0x5b')]['results'][0x0];if(_0x43a234[_0xeadf('0x2a')][_0xeadf('0xcf')]===_0xeadf('0xce')){return _0x618b82['update']({'read':!![]});}else{logger[_0xeadf('0x23')](_0xeadf('0x21'),_0xeadf('0x2a'),_0xeadf('0x8a'),util['inspect'](_0x1cccb0[_0xeadf('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xeadf('0x8f'):if(_0xf8197c=='DELIVERED_TO_GATEWAY'||_0xf8197c==_0xeadf('0xd3')){return _0x618b82['update']({'read':!![]});}else{logger[_0xeadf('0x23')](_0xeadf('0x21'),_0xeadf('0x2a'),_0xeadf('0x8f'),util['inspect'](_0x1cccb0['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0xf8197c=='message-delivered'){return _0x618b82[_0xeadf('0x35')]({'read':!![]});}else{logger['error'](_0xeadf('0x21'),_0xeadf('0x2a'),_0xeadf('0xd0'),util[_0xeadf('0xc8')](_0x1cccb0['body'],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0xf8197c===_0xeadf('0xd4')||_0xf8197c==='ACCEPTD'){return _0x618b82[_0xeadf('0x35')]({'read':!![]});}else{logger[_0xeadf('0x23')](_0xeadf('0x21'),'status',_0xeadf('0x92'),util['inspect'](_0x1cccb0['body'],{'showHidden':![],'depth':null}));}break;}return _0x618b82;}})[_0xeadf('0x1e')](respondWithResult(_0x162f52,null))[_0xeadf('0x28')](handleError(_0x162f52,null));};exports[_0xeadf('0xd5')]=function(_0x42b63e,_0x57c07c,_0x555db8){var _0x5e5812,_0x188e5e,_0x3bfd81;return db[_0xeadf('0x41')][_0xeadf('0x59')]({'where':{'id':_0x42b63e['params']['id']}})[_0xeadf('0x1e')](handleEntityNotFound(_0x57c07c,null))[_0xeadf('0x1e')](function(_0x4aab56){if(_0x4aab56){_0x3bfd81=_0x4aab56;logger[_0xeadf('0xaf')](_0xeadf('0x21'),_0xeadf('0x2a'),'received\x20delivery\x20report\x20from',_0x4aab56[_0xeadf('0x43')],util[_0xeadf('0xc8')](_0x42b63e[_0xeadf('0x45')],{'showHidden':![],'depth':null}));switch(_0x4aab56[_0xeadf('0x43')]){case _0xeadf('0x8d'):if(_0x42b63e['query']['message-id']&&_0x42b63e['query']['state']){_0x188e5e=_0x42b63e[_0xeadf('0x45')][_0xeadf('0xd6')];return db[_0xeadf('0xa7')]['find']({'where':{'messageId':_0x42b63e['query'][_0xeadf('0xd7')]}});}break;}}})[_0xeadf('0x1e')](handleEntityNotFound(_0x57c07c,null))[_0xeadf('0x1e')](function(_0x4f7f87){if(_0x4f7f87){_0x5e5812=_0x4f7f87;switch(_0x3bfd81[_0xeadf('0x43')]){case _0xeadf('0x8d'):if(_0x188e5e==='2'||_0x188e5e==='6'){return _0x5e5812['update']({'read':!![]});}else{logger[_0xeadf('0x23')](_0xeadf('0x21'),_0xeadf('0x2a'),_0xeadf('0x8d'),util[_0xeadf('0xc8')](_0x42b63e[_0xeadf('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x5e5812;}})['then'](respondWithResult(_0x57c07c,null))[_0xeadf('0x28')](handleError(_0x57c07c,null));};exports[_0xeadf('0xd8')]=function(_0x130f57,_0x5b36ae,_0x29b7c7){return db[_0xeadf('0x41')][_0xeadf('0x59')]({'where':{'id':_0x130f57[_0xeadf('0x62')]['id']}})[_0xeadf('0x1e')](handleEntityNotFound(_0x5b36ae,null))[_0xeadf('0x1e')](function(_0x358123){if(_0x358123){return _0x358123[_0xeadf('0xd8')](_0x130f57[_0xeadf('0x5b')][_0xeadf('0x69')],_['omit'](_0x130f57[_0xeadf('0x5b')],[_0xeadf('0x69'),'id'])||{})['spread'](function(_0x242618){for(var _0x422d78=0x0;_0x422d78<_0x130f57[_0xeadf('0x5b')][_0xeadf('0x69')][_0xeadf('0x57')];_0x422d78+=0x1){socket['emit']('userSmsAccount:save',{'UserId':Number(_0x130f57[_0xeadf('0x5b')][_0xeadf('0x69')][_0x422d78]),'SmsAccountId':Number(_0x130f57[_0xeadf('0x62')]['id'])});}return _0x242618;});}})[_0xeadf('0x1e')](respondWithResult(_0x5b36ae,null))[_0xeadf('0x28')](handleError(_0x5b36ae,null));};exports[_0xeadf('0xd9')]=function(_0x18b028,_0x20fb1a,_0x5d87f8){return db[_0xeadf('0x41')][_0xeadf('0x59')]({'where':{'id':_0x18b028[_0xeadf('0x62')]['id']}})[_0xeadf('0x1e')](handleEntityNotFound(_0x20fb1a,null))[_0xeadf('0x1e')](function(_0x3f85cc){if(_0x3f85cc){return _0x3f85cc[_0xeadf('0xd9')](_0x18b028[_0xeadf('0x45')][_0xeadf('0x69')])['then'](function(){if(_[_0xeadf('0xda')](_0x18b028['query'][_0xeadf('0x69')])){for(var _0x3d25e3=0x0;_0x3d25e3<_0x18b028['query'][_0xeadf('0x69')][_0xeadf('0x57')];_0x3d25e3+=0x1){socket[_0xeadf('0xdb')](_0xeadf('0xdc'),{'UserId':Number(_0x18b028[_0xeadf('0x45')][_0xeadf('0x69')][_0x3d25e3]),'SmsAccountId':Number(_0x18b028[_0xeadf('0x62')]['id'])});}}else{socket[_0xeadf('0xdb')](_0xeadf('0xdc'),{'UserId':Number(_0x18b028[_0xeadf('0x45')][_0xeadf('0x69')]),'SmsAccountId':Number(_0x18b028[_0xeadf('0x62')]['id'])});}});}})[_0xeadf('0x1e')](respondWithStatusCode(_0x20fb1a,null))[_0xeadf('0x28')](handleError(_0x20fb1a,null));};exports[_0xeadf('0xdd')]=function(_0xe58f2a,_0x467483,_0x5ae485){var _0x3fff7b={};var _0x3de151={};var _0x2cfa59;var _0x4e3c5d;return db[_0xeadf('0x41')][_0xeadf('0x66')]({'where':{'id':_0xe58f2a[_0xeadf('0x62')]['id']}})['then'](handleEntityNotFound(_0x467483,null))[_0xeadf('0x1e')](function(_0x267beb){if(_0x267beb){_0x2cfa59=_0x267beb;_0x3de151[_0xeadf('0x44')]=_['keys'](db['User'][_0xeadf('0x54')]);_0x3de151[_0xeadf('0x45')]=_[_0xeadf('0x55')](_0xe58f2a[_0xeadf('0x45')]);_0x3de151[_0xeadf('0x46')]=_[_0xeadf('0x56')](_0x3de151[_0xeadf('0x44')],_0x3de151[_0xeadf('0x45')]);_0x3fff7b[_0xeadf('0x48')]=_[_0xeadf('0x56')](_0x3de151['model'],qs['fields'](_0xe58f2a[_0xeadf('0x45')]['fields']));_0x3fff7b['attributes']=_0x3fff7b['attributes'][_0xeadf('0x57')]?_0x3fff7b['attributes']:_0x3de151[_0xeadf('0x44')];_0x3fff7b[_0xeadf('0x67')]=qs[_0xeadf('0x4b')](_0xe58f2a[_0xeadf('0x45')]['sort']);_0x3fff7b[_0xeadf('0x4c')]=qs[_0xeadf('0x46')](_[_0xeadf('0xba')](_0xe58f2a[_0xeadf('0x45')],_0x3de151['filters']));if(_0xe58f2a[_0xeadf('0x45')][_0xeadf('0x4d')]){_0x3fff7b[_0xeadf('0x4c')]=_[_0xeadf('0x4e')](_0x3fff7b[_0xeadf('0x4c')],{'$or':_[_0xeadf('0x40')](_0x3fff7b[_0xeadf('0x48')],function(_0x65bb29){var _0x416290={};_0x416290[_0x65bb29]={'$like':'%'+_0xe58f2a[_0xeadf('0x45')][_0xeadf('0x4d')]+'%'};return _0x416290;})});}_0x3fff7b=_['merge']({},_0x3fff7b,_0xe58f2a[_0xeadf('0x4f')]);return _0x2cfa59['getAgents'](_0x3fff7b);}})[_0xeadf('0x1e')](function(_0x45ce16){if(_0x45ce16){_0x4e3c5d=_0x45ce16[_0xeadf('0x57')];if(!_0xe58f2a[_0xeadf('0x45')][_0xeadf('0x49')](_0xeadf('0x4a'))){_0x3fff7b['limit']=qs[_0xeadf('0x2f')](_0xe58f2a[_0xeadf('0x45')][_0xeadf('0x2f')]);_0x3fff7b[_0xeadf('0x2d')]=qs['offset'](_0xe58f2a[_0xeadf('0x45')]['offset']);}return _0x2cfa59[_0xeadf('0xdd')](_0x3fff7b);}})[_0xeadf('0x1e')](function(_0xce13e9){if(_0xce13e9){return _0xce13e9?{'count':_0x4e3c5d,'rows':_0xce13e9}:null;}})[_0xeadf('0x1e')](respondWithResult(_0x467483,null))[_0xeadf('0x28')](handleError(_0x467483,null));};
\ No newline at end of file
+var _0x46d5=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','jayson/promise','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','options','SmsAccount','includeAll','include','findAll','rows','show','params','intersection','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','SmsAccountId','Disposition','findOne','order','merge','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','notify','SmsApplication','Applications','asc','account','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','text','connectel','clicksend','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','replyMessageId','bandwidth','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','ListId','Contacts','omit','contact','SmsInteraction','created','autoclose','applications','close','*,*,*,*','interaction','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','Start','startRouting','receiveMessage','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','Content-Type','text/xml','send','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','List','DESC','out','Messages','spread','dataValues','push','SmsAccount,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','message_id','groupName','DELIVERED','clickatell','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0xffd1b5,_0x1ede18){var _0x3176d6=function(_0xe9ba48){while(--_0xe9ba48){_0xffd1b5['push'](_0xffd1b5['shift']());}};_0x3176d6(++_0x1ede18);}(_0x46d5,0x1b9));var _0x546d=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x46d5[_0x1035c1];return _0x308d67;};'use strict';var emlformat=require(_0x546d('0x0'));var rimraf=require(_0x546d('0x1'));var zipdir=require(_0x546d('0x2'));var jsonpatch=require(_0x546d('0x3'));var rp=require(_0x546d('0x4'));var moment=require(_0x546d('0x5'));var BPromise=require(_0x546d('0x6'));var Mustache=require('mustache');var util=require(_0x546d('0x7'));var path=require('path');var sox=require(_0x546d('0x8'));var csv=require(_0x546d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x546d('0xa'));var squel=require(_0x546d('0xb'));var crypto=require(_0x546d('0xc'));var jsforce=require(_0x546d('0xd'));var deskjs=require(_0x546d('0xe'));var toCsv=require(_0x546d('0x9'));var querystring=require('querystring');var Papa=require(_0x546d('0xf'));var Redis=require(_0x546d('0x10'));var authService=require(_0x546d('0x11'));var qs=require(_0x546d('0x12'));var as=require(_0x546d('0x13'));var hardwareService=require(_0x546d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x546d('0x15'));var config=require(_0x546d('0x16'));var licenseUtil=require(_0x546d('0x17'));var db=require(_0x546d('0x18'))['db'];config[_0x546d('0x19')]=_[_0x546d('0x1a')](config[_0x546d('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x546d('0x1b'))(new Redis(config['redis']));require('./smsAccount.socket')[_0x546d('0x1c')](socket);var jayson=require(_0x546d('0x1d'));var client=jayson['client'][_0x546d('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x291e27,_0x20908d,_0x4dba21,_0x18dbc9){return new BPromise(function(_0x4cbf2e,_0x34f647){var _0x563892=_0x18dbc9||client;return _0x563892[_0x546d('0x1f')](_0x291e27,_0x4dba21)[_0x546d('0x20')](function(_0x423898){logger[_0x546d('0x21')](_0x546d('0x22'),_0x20908d,_0x546d('0x23'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x20908d,'request\x20sent',JSON[_0x546d('0x24')](_0x423898));if(_0x423898[_0x546d('0x25')]){if(_0x423898[_0x546d('0x25')]['code']===0x1f4){logger[_0x546d('0x25')]('SmsAccount,\x20%s,\x20%s',_0x20908d,_0x423898[_0x546d('0x25')]['message']);return _0x34f647(_0x423898[_0x546d('0x25')][_0x546d('0x26')]);}logger[_0x546d('0x25')]('SmsAccount,\x20%s,\x20%s',_0x20908d,_0x423898['error'][_0x546d('0x26')]);return _0x4cbf2e(_0x423898[_0x546d('0x25')][_0x546d('0x26')]);}else{logger[_0x546d('0x21')](_0x546d('0x22'),_0x20908d,_0x546d('0x23'));_0x4cbf2e(_0x423898[_0x546d('0x27')][_0x546d('0x26')]);}})[_0x546d('0x28')](function(_0xbf88fe){logger[_0x546d('0x25')](_0x546d('0x22'),_0x20908d,_0xbf88fe);_0x34f647(_0xbf88fe);});});}function respondWithStatusCode(_0x21331f,_0x33625d){_0x33625d=_0x33625d||0xcc;return function(_0x240e0f){if(_0x240e0f){return _0x21331f[_0x546d('0x29')](_0x33625d);}return _0x21331f['status'](_0x33625d)[_0x546d('0x2a')]();};}function respondWithResult(_0x3fa7e4,_0x159b4f){_0x159b4f=_0x159b4f||0xc8;return function(_0x3fb2cd){if(_0x3fb2cd){return _0x3fa7e4[_0x546d('0x2b')](_0x159b4f)[_0x546d('0x2c')](_0x3fb2cd);}};}function respondWithFilteredResult(_0x166f31,_0x1ca1d6){return function(_0x2d1b94){if(_0x2d1b94){var _0x2bf21e=typeof _0x1ca1d6['offset']===_0x546d('0x2d')&&typeof _0x1ca1d6[_0x546d('0x2e')]==='undefined';var _0x3cabe6=_0x2d1b94[_0x546d('0x2f')];var _0x3555e2=_0x2bf21e?0x0:_0x1ca1d6[_0x546d('0x30')];var _0x27bc0f=_0x2bf21e?_0x2d1b94[_0x546d('0x2f')]:_0x1ca1d6[_0x546d('0x30')]+_0x1ca1d6[_0x546d('0x2e')];var _0x3d3682;if(_0x27bc0f>=_0x3cabe6){_0x27bc0f=_0x3cabe6;_0x3d3682=0xc8;}else{_0x3d3682=0xce;}_0x166f31[_0x546d('0x2b')](_0x3d3682);return _0x166f31[_0x546d('0x31')](_0x546d('0x32'),_0x3555e2+'-'+_0x27bc0f+'/'+_0x3cabe6)[_0x546d('0x2c')](_0x2d1b94);}return null;};}function patchUpdates(_0x200056){return function(_0x20b4da){try{jsonpatch[_0x546d('0x33')](_0x20b4da,_0x200056,!![]);}catch(_0x51f2cd){return BPromise[_0x546d('0x34')](_0x51f2cd);}return _0x20b4da['save']();};}function saveUpdates(_0x54be57,_0x4d4109){return function(_0x54bbd0){if(_0x54bbd0){return _0x54bbd0['update'](_0x54be57)[_0x546d('0x20')](function(_0x45633c){return _0x45633c;});}return null;};}function removeEntity(_0x2f0ce0,_0x33e9d6){return function(_0x2fa2b5){if(_0x2fa2b5){return _0x2fa2b5[_0x546d('0x35')]()[_0x546d('0x20')](function(){var _0x232c90=_0x2fa2b5[_0x546d('0x36')]({'plain':!![]});var _0x5e834e=_0x546d('0x37');return db[_0x546d('0x38')][_0x546d('0x35')]({'where':{'type':_0x5e834e,'resourceId':_0x232c90['id']}})[_0x546d('0x20')](function(){return _0x2fa2b5;});})[_0x546d('0x20')](function(){_0x2f0ce0['status'](0xcc)[_0x546d('0x2a')]();});}};}function handleEntityNotFound(_0x40f632,_0x39e5fe){return function(_0x37deea){if(!_0x37deea){_0x40f632[_0x546d('0x29')](0x194);}return _0x37deea;};}function handleError(_0x29df39,_0x284cf4){_0x284cf4=_0x284cf4||0x1f4;return function(_0x376101){logger['error'](_0x376101[_0x546d('0x39')]);if(_0x376101[_0x546d('0x3a')]){delete _0x376101['name'];}_0x29df39[_0x546d('0x2b')](_0x284cf4)['send'](_0x376101);};}exports[_0x546d('0x3b')]=function(_0x3ebdbf,_0x154750){var _0x42f153={'include':[{'model':db[_0x546d('0x3c')],'as':_0x546d('0x3d')}]},_0x48e288={},_0x36f17c={'count':0x0,'rows':[]};var _0xe2ca44=_[_0x546d('0x3e')](db['SmsAccount'][_0x546d('0x3f')],function(_0x46cc4a){return{'name':_0x46cc4a['fieldName'],'type':_0x46cc4a['type'][_0x546d('0x40')]};});_0x48e288[_0x546d('0x41')]=_[_0x546d('0x3e')](_0xe2ca44,_0x546d('0x3a'));_0x48e288[_0x546d('0x42')]=_[_0x546d('0x43')](_0x3ebdbf[_0x546d('0x42')]);_0x48e288[_0x546d('0x44')]=_['intersection'](_0x48e288[_0x546d('0x41')],_0x48e288['query']);_0x42f153[_0x546d('0x45')]=_['intersection'](_0x48e288[_0x546d('0x41')],qs['fields'](_0x3ebdbf[_0x546d('0x42')][_0x546d('0x46')]));_0x42f153[_0x546d('0x45')]=_0x42f153[_0x546d('0x45')][_0x546d('0x47')]?_0x42f153['attributes']:_0x48e288[_0x546d('0x41')];if(!_0x3ebdbf[_0x546d('0x42')][_0x546d('0x48')](_0x546d('0x49'))){_0x42f153[_0x546d('0x2e')]=qs[_0x546d('0x2e')](_0x3ebdbf['query'][_0x546d('0x2e')]);_0x42f153[_0x546d('0x30')]=qs['offset'](_0x3ebdbf[_0x546d('0x42')]['offset']);}_0x42f153['order']=qs[_0x546d('0x4a')](_0x3ebdbf[_0x546d('0x42')][_0x546d('0x4a')]);_0x42f153['where']=qs[_0x546d('0x44')](_[_0x546d('0x4b')](_0x3ebdbf['query'],_0x48e288['filters']),_0xe2ca44);if(_0x3ebdbf[_0x546d('0x42')][_0x546d('0x4c')]){_0x42f153[_0x546d('0x4d')]=_['merge'](_0x42f153['where'],{'$or':_['map'](_0xe2ca44,function(_0x4da5e0){if(_0x4da5e0[_0x546d('0x4e')]!==_0x546d('0x4f')){var _0x46d44f={};_0x46d44f[_0x4da5e0[_0x546d('0x3a')]]={'$like':'%'+_0x3ebdbf[_0x546d('0x42')]['filter']+'%'};return _0x46d44f;}})});}_0x42f153=_['merge']({},_0x42f153,_0x3ebdbf[_0x546d('0x50')]);var _0x58fe2b={'where':_0x42f153[_0x546d('0x4d')]};return db[_0x546d('0x51')]['count'](_0x58fe2b)[_0x546d('0x20')](function(_0x246b07){_0x36f17c[_0x546d('0x2f')]=_0x246b07;if(_0x3ebdbf[_0x546d('0x42')][_0x546d('0x52')]){_0x42f153[_0x546d('0x53')]=[{'all':!![]}];}return db[_0x546d('0x51')][_0x546d('0x54')](_0x42f153);})[_0x546d('0x20')](function(_0x388a3c){_0x36f17c[_0x546d('0x55')]=_0x388a3c;return _0x36f17c;})[_0x546d('0x20')](respondWithFilteredResult(_0x154750,_0x42f153))[_0x546d('0x28')](handleError(_0x154750,null));};exports[_0x546d('0x56')]=function(_0x2c056d,_0x24ad7e){var _0x3bbedd={'raw':![],'where':{'id':_0x2c056d[_0x546d('0x57')]['id']},'include':[{'model':db[_0x546d('0x3c')],'as':_0x546d('0x3d')}]},_0x489201={};_0x489201[_0x546d('0x41')]=_[_0x546d('0x43')](db[_0x546d('0x51')][_0x546d('0x3f')]);_0x489201[_0x546d('0x42')]=_[_0x546d('0x43')](_0x2c056d[_0x546d('0x42')]);_0x489201[_0x546d('0x44')]=_[_0x546d('0x58')](_0x489201[_0x546d('0x41')],_0x489201[_0x546d('0x42')]);_0x3bbedd[_0x546d('0x45')]=_[_0x546d('0x58')](_0x489201['model'],qs[_0x546d('0x46')](_0x2c056d[_0x546d('0x42')][_0x546d('0x46')]));_0x3bbedd[_0x546d('0x45')]=_0x3bbedd[_0x546d('0x45')][_0x546d('0x47')]?_0x3bbedd[_0x546d('0x45')]:_0x489201[_0x546d('0x41')];if(_0x2c056d[_0x546d('0x42')]['includeAll']){_0x3bbedd[_0x546d('0x53')]=[{'all':!![]}];}_0x3bbedd=_['merge']({},_0x3bbedd,_0x2c056d[_0x546d('0x50')]);return db[_0x546d('0x51')][_0x546d('0x59')](_0x3bbedd)[_0x546d('0x20')](handleEntityNotFound(_0x24ad7e,null))[_0x546d('0x20')](respondWithResult(_0x24ad7e,null))[_0x546d('0x28')](handleError(_0x24ad7e,null));};exports[_0x546d('0x5a')]=function(_0x11e54a,_0x1bfae6){return db['SmsAccount']['create'](_0x11e54a[_0x546d('0x5b')],{})[_0x546d('0x20')](function(_0x25e173){var _0xef6198=_0x11e54a[_0x546d('0x5c')][_0x546d('0x36')]({'plain':!![]});if(!_0xef6198)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xef6198[_0x546d('0x5d')]===_0x546d('0x5c')){var _0x2f7158=_0x25e173[_0x546d('0x36')]({'plain':!![]});var _0x408909=_0x546d('0x37');return db[_0x546d('0x5e')]['find']({'where':{'name':_0x408909,'userProfileId':_0xef6198[_0x546d('0x5f')]},'raw':!![]})['then'](function(_0xbbfd49){if(_0xbbfd49&&_0xbbfd49['autoAssociation']===0x0){return db[_0x546d('0x38')][_0x546d('0x5a')]({'name':_0x2f7158['name'],'resourceId':_0x2f7158['id'],'type':_0xbbfd49['name'],'sectionId':_0xbbfd49['id']},{})[_0x546d('0x20')](function(){return _0x25e173;});}else{return _0x25e173;}})[_0x546d('0x28')](function(_0x1717ab){logger[_0x546d('0x25')](_0x546d('0x60'),_0x1717ab);throw _0x1717ab;});}return _0x25e173;})['then'](respondWithResult(_0x1bfae6,0xc9))['catch'](handleError(_0x1bfae6,null));};exports[_0x546d('0x61')]=function(_0x6ca0fe,_0x572e6b){if(_0x6ca0fe[_0x546d('0x5b')]['id']){delete _0x6ca0fe['body']['id'];}return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x6ca0fe[_0x546d('0x57')]['id']},'include':[{'model':db[_0x546d('0x3c')],'as':_0x546d('0x3d')}]})['then'](handleEntityNotFound(_0x572e6b,null))[_0x546d('0x20')](saveUpdates(_0x6ca0fe[_0x546d('0x5b')],null))['then'](respondWithResult(_0x572e6b,null))[_0x546d('0x28')](handleError(_0x572e6b,null));};exports[_0x546d('0x35')]=function(_0x1cdc45,_0x324408){return db['SmsAccount']['find']({'where':{'id':_0x1cdc45[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x324408,null))[_0x546d('0x20')](removeEntity(_0x324408,null))[_0x546d('0x28')](handleError(_0x324408,null));};exports[_0x546d('0x62')]=function(_0x5cab96,_0x2dec3a){return db[_0x546d('0x51')][_0x546d('0x62')]()[_0x546d('0x20')](respondWithResult(_0x2dec3a,null))[_0x546d('0x28')](handleError(_0x2dec3a,null));};exports[_0x546d('0x63')]=function(_0x132d74,_0x4a2154,_0x27d117){if(_0x132d74[_0x546d('0x5b')]['id']){delete _0x132d74[_0x546d('0x5b')]['id'];}return db['SmsAccount'][_0x546d('0x59')]({'where':{'id':_0x132d74[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x4a2154,null))[_0x546d('0x20')](function(_0x28ba34){if(_0x28ba34){_0x132d74[_0x546d('0x5b')][_0x546d('0x64')]=_0x28ba34['id'];return db[_0x546d('0x65')][_0x546d('0x5a')](_0x132d74[_0x546d('0x5b')]);}})[_0x546d('0x20')](respondWithResult(_0x4a2154,null))[_0x546d('0x28')](handleError(_0x4a2154,null));};exports['getDispositions']=function(_0x51851a,_0x331262,_0x334cea){var _0x160be3={'raw':![],'where':{}};var _0x21ae9f={};var _0x539ba1={'count':0x0,'rows':[]};return db['SmsAccount'][_0x546d('0x66')]({'where':{'id':_0x51851a['params']['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x331262,null))[_0x546d('0x20')](function(_0x4fd040){if(_0x4fd040){_0x21ae9f[_0x546d('0x41')]=_[_0x546d('0x43')](db[_0x546d('0x65')]['rawAttributes']);_0x21ae9f[_0x546d('0x42')]=_[_0x546d('0x43')](_0x51851a['query']);_0x21ae9f[_0x546d('0x44')]=_[_0x546d('0x58')](_0x21ae9f[_0x546d('0x41')],_0x21ae9f['query']);_0x160be3[_0x546d('0x45')]=_[_0x546d('0x58')](_0x21ae9f[_0x546d('0x41')],qs[_0x546d('0x46')](_0x51851a['query'][_0x546d('0x46')]));_0x160be3[_0x546d('0x45')]=_0x160be3[_0x546d('0x45')][_0x546d('0x47')]?_0x160be3[_0x546d('0x45')]:_0x21ae9f['model'];if(!_0x51851a['query'][_0x546d('0x48')]('nolimit')){_0x160be3[_0x546d('0x2e')]=qs[_0x546d('0x2e')](_0x51851a[_0x546d('0x42')][_0x546d('0x2e')]);_0x160be3[_0x546d('0x30')]=qs[_0x546d('0x30')](_0x51851a[_0x546d('0x42')]['offset']);}_0x160be3[_0x546d('0x67')]=qs['sort'](_0x51851a[_0x546d('0x42')][_0x546d('0x4a')]);_0x160be3[_0x546d('0x4d')]=qs[_0x546d('0x44')](_['pick'](_0x51851a['query'],_0x21ae9f[_0x546d('0x44')]));_0x160be3[_0x546d('0x4d')]['SmsAccountId']=_0x4fd040['id'];if(_0x51851a[_0x546d('0x42')][_0x546d('0x4c')]){_0x160be3[_0x546d('0x4d')]=_[_0x546d('0x68')](_0x160be3['where'],{'$or':_[_0x546d('0x3e')](_0x160be3[_0x546d('0x45')],function(_0x57c096){var _0x41d2dd={};_0x41d2dd[_0x57c096]={'$like':'%'+_0x51851a['query'][_0x546d('0x4c')]+'%'};return _0x41d2dd;})});}_0x160be3=_[_0x546d('0x68')]({},_0x160be3,_0x51851a[_0x546d('0x50')]);return db[_0x546d('0x65')][_0x546d('0x2f')]({'where':_0x160be3[_0x546d('0x4d')]})[_0x546d('0x20')](function(_0x3d3d26){_0x539ba1[_0x546d('0x2f')]=_0x3d3d26;if(_0x51851a[_0x546d('0x42')][_0x546d('0x52')]){_0x160be3['include']=[{'all':!![]}];}return db[_0x546d('0x65')][_0x546d('0x54')](_0x160be3);})['then'](function(_0x23b70e){_0x539ba1[_0x546d('0x55')]=_0x23b70e;return _0x539ba1;});}})[_0x546d('0x20')](respondWithFilteredResult(_0x331262,_0x160be3))[_0x546d('0x28')](handleError(_0x331262,null));};exports[_0x546d('0x69')]=function(_0x5790b7,_0x53ce16,_0x1458aa){return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x5790b7[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x53ce16,null))[_0x546d('0x20')](function(_0x4054f1){if(_0x4054f1){return _0x4054f1['removeDispositions'](_0x5790b7[_0x546d('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x53ce16,null))[_0x546d('0x28')](handleError(_0x53ce16,null));};exports[_0x546d('0x6a')]=function(_0x4b90e6,_0x466ff6,_0x2d32b5){if(_0x4b90e6[_0x546d('0x5b')]['id']){delete _0x4b90e6['body']['id'];}return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x4b90e6['params']['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x466ff6,null))[_0x546d('0x20')](function(_0x337aeb){if(_0x337aeb){_0x4b90e6['body'][_0x546d('0x64')]=_0x337aeb['id'];return db[_0x546d('0x6b')]['create'](_0x4b90e6['body']);}})[_0x546d('0x20')](respondWithResult(_0x466ff6,null))[_0x546d('0x28')](handleError(_0x466ff6,null));};exports['getAnswers']=function(_0x16b0c7,_0x445188,_0x446b81){var _0x77799d={'raw':![],'where':{}};var _0x50f045={};var _0x4d6c1d={'count':0x0,'rows':[]};return db[_0x546d('0x51')][_0x546d('0x66')]({'where':{'id':_0x16b0c7[_0x546d('0x57')]['id']}})['then'](handleEntityNotFound(_0x445188,null))['then'](function(_0x5f0470){if(_0x5f0470){_0x50f045[_0x546d('0x41')]=_[_0x546d('0x43')](db[_0x546d('0x6b')][_0x546d('0x3f')]);_0x50f045[_0x546d('0x42')]=_[_0x546d('0x43')](_0x16b0c7[_0x546d('0x42')]);_0x50f045['filters']=_['intersection'](_0x50f045[_0x546d('0x41')],_0x50f045[_0x546d('0x42')]);_0x77799d['attributes']=_[_0x546d('0x58')](_0x50f045[_0x546d('0x41')],qs[_0x546d('0x46')](_0x16b0c7['query'][_0x546d('0x46')]));_0x77799d[_0x546d('0x45')]=_0x77799d[_0x546d('0x45')][_0x546d('0x47')]?_0x77799d[_0x546d('0x45')]:_0x50f045['model'];if(!_0x16b0c7[_0x546d('0x42')]['hasOwnProperty'](_0x546d('0x49'))){_0x77799d[_0x546d('0x2e')]=qs[_0x546d('0x2e')](_0x16b0c7[_0x546d('0x42')][_0x546d('0x2e')]);_0x77799d['offset']=qs[_0x546d('0x30')](_0x16b0c7[_0x546d('0x42')][_0x546d('0x30')]);}_0x77799d[_0x546d('0x67')]=qs[_0x546d('0x4a')](_0x16b0c7[_0x546d('0x42')][_0x546d('0x4a')]);_0x77799d['where']=qs[_0x546d('0x44')](_[_0x546d('0x4b')](_0x16b0c7[_0x546d('0x42')],_0x50f045[_0x546d('0x44')]));_0x77799d['where'][_0x546d('0x64')]=_0x5f0470['id'];if(_0x16b0c7[_0x546d('0x42')]['filter']){_0x77799d[_0x546d('0x4d')]=_[_0x546d('0x68')](_0x77799d[_0x546d('0x4d')],{'$or':_[_0x546d('0x3e')](_0x77799d[_0x546d('0x45')],function(_0x3eec33){var _0x1ed68b={};_0x1ed68b[_0x3eec33]={'$like':'%'+_0x16b0c7['query'][_0x546d('0x4c')]+'%'};return _0x1ed68b;})});}_0x77799d=_[_0x546d('0x68')]({},_0x77799d,_0x16b0c7[_0x546d('0x50')]);return db['CannedAnswer'][_0x546d('0x2f')]({'where':_0x77799d[_0x546d('0x4d')]})[_0x546d('0x20')](function(_0x556f68){_0x4d6c1d[_0x546d('0x2f')]=_0x556f68;if(_0x16b0c7[_0x546d('0x42')][_0x546d('0x52')]){_0x77799d[_0x546d('0x53')]=[{'all':!![]}];}return db[_0x546d('0x6b')][_0x546d('0x54')](_0x77799d);})[_0x546d('0x20')](function(_0x551485){_0x4d6c1d[_0x546d('0x55')]=_0x551485;return _0x4d6c1d;});}})[_0x546d('0x20')](respondWithFilteredResult(_0x445188,_0x77799d))[_0x546d('0x28')](handleError(_0x445188,null));};exports['removeAnswers']=function(_0x410659,_0x45cc04,_0x1230f1){return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x410659['params']['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x45cc04,null))[_0x546d('0x20')](function(_0x334d22){if(_0x334d22){return _0x334d22[_0x546d('0x6c')](_0x410659[_0x546d('0x42')][_0x546d('0x6d')]);}})[_0x546d('0x20')](respondWithStatusCode(_0x45cc04,null))[_0x546d('0x28')](handleError(_0x45cc04,null));};exports[_0x546d('0x6e')]=function(_0x2c4383,_0x3d88e6,_0x454563){var _0x5704a8={'channel':'sms'};var _0xc65790=[];var _0x2a9687=[];var _0x391a02={};return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x2c4383['params']['id']},'include':[{'model':db[_0x546d('0x6f')],'as':_0x546d('0x70')}]})[_0x546d('0x20')](handleEntityNotFound(_0x3d88e6,null))[_0x546d('0x20')](function(_0x2bd42f){_0x5704a8['account']=_0x2bd42f;_0x5704a8['applications']=_['orderBy'](_0x2bd42f[_0x546d('0x70')],['priority'],[_0x546d('0x71')]);if(_0x5704a8['account'][_0x546d('0x70')]){delete _0x5704a8[_0x546d('0x72')]['Applications'];}return db[_0x546d('0x73')]['describe']();})['then'](function(_0x45ef0b){if(!_0x45ef0b){throw new db[(_0x546d('0x74'))]['ValidationError'](_0x546d('0x75'));}_0xc65790=_['difference'](_[_0x546d('0x43')](_0x45ef0b),[_0x546d('0x76'),_0x546d('0x77')]);_0x2a9687=_[_0x546d('0x78')](_[_0x546d('0x43')](_0x45ef0b),[_0x546d('0x76'),_0x546d('0x77'),_0x546d('0x79'),'ListId']);_0x5704a8['body']={'mapKey':_0x546d('0x7a')};if(_0x5704a8[_0x546d('0x72')][_0x546d('0x4e')]){switch(_0x5704a8[_0x546d('0x72')][_0x546d('0x4e')]){case _0x546d('0x7b'):_0x5704a8['body'][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x7d')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x7e')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x7f')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x80')];break;case _0x546d('0x81'):_0x5704a8[_0x546d('0x5b')]['from']='+'+_0x2c4383[_0x546d('0x5b')]['sender'];_0x5704a8['body'][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x82')];break;case _0x546d('0x83'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x7c')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x26')];break;case _0x546d('0x84'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x7c')];_0x5704a8[_0x546d('0x5b')]['body']=_0x2c4383[_0x546d('0x5b')][_0x546d('0x5b')];_0x5704a8['body']['messageId']=_0x2c4383[_0x546d('0x5b')]['message_id'];break;case _0x546d('0x85'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')]['From'];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x86')];_0x5704a8['body'][_0x546d('0x7f')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x87')];break;case _0x546d('0x88'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]='+'+_0x2c4383[_0x546d('0x5b')][_0x546d('0x89')][0x0][_0x546d('0x7c')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')]['results'][0x0][_0x546d('0x82')];_0x5704a8[_0x546d('0x5b')]['messageId']=_0x2c4383['body'][_0x546d('0x89')][0x0][_0x546d('0x7f')];break;case _0x546d('0x8a'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x8b')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383['body'][_0x546d('0x8c')][_0x546d('0x26')];break;case'clickatell':_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383[_0x546d('0x5b')]['fromNumber'];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x82')];_0x5704a8['body']['messageId']=_0x2c4383[_0x546d('0x5b')][_0x546d('0x8d')];break;case _0x546d('0x8e'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7f')]=_0x2c4383[_0x546d('0x5b')][0x0]['message']['id'];_0x5704a8[_0x546d('0x5b')]['from']=_0x2c4383['body'][0x0][_0x546d('0x26')]['from'];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383['body'][0x0][_0x546d('0x26')][_0x546d('0x82')];break;case _0x546d('0x8f'):_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')]=_0x2c4383['body'][_0x546d('0x7c')];_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]=_0x2c4383[_0x546d('0x5b')][_0x546d('0x26')];_0x5704a8[_0x546d('0x5b')]['messageId']=_0x2c4383[_0x546d('0x5b')][_0x546d('0x90')];break;}}if(_0x5704a8[_0x546d('0x5b')]['id']){delete _0x5704a8[_0x546d('0x5b')]['id'];}if(_[_0x546d('0x91')](_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')])){throw new db[(_0x546d('0x74'))][(_0x546d('0x92'))](_0x546d('0x93'));}if(_[_0x546d('0x91')](_0x5704a8['body'][_0x546d('0x5b')])||_0x5704a8[_0x546d('0x5b')][_0x546d('0x5b')]===''){throw new db[(_0x546d('0x74'))][(_0x546d('0x92'))](_0x546d('0x94'));}if(_[_0x546d('0x91')](_0x5704a8[_0x546d('0x5b')][_0x546d('0x95')])){throw new db[(_0x546d('0x74'))][(_0x546d('0x92'))](_0x546d('0x96')+_0x2a9687);}if(!_[_0x546d('0x97')](_0x2a9687,_0x5704a8[_0x546d('0x5b')]['mapKey'])){throw new db[(_0x546d('0x74'))][(_0x546d('0x92'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2a9687);}_0x391a02[_0x5704a8[_0x546d('0x5b')][_0x546d('0x95')]]=_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')];return db['CmList']['find']({'where':{'id':_0x5704a8[_0x546d('0x72')][_0x546d('0x98')]},'include':[{'model':db['CmContact'],'as':_0x546d('0x99'),'where':_0x391a02,'limit':0x1,'order':[[_0x546d('0x77'),'DESC']]}]});})[_0x546d('0x20')](handleEntityNotFound(_0x3d88e6,null))[_0x546d('0x20')](function(_0x101f19){if(_0x101f19){_0x5704a8['list']=_[_0x546d('0x9a')](_0x101f19,[_0x546d('0x99')]);if(_0x101f19[_0x546d('0x99')][_0x546d('0x47')]){return _0x101f19[_0x546d('0x99')][0x0];}var _0x55166b=_['defaults'](_0x5704a8['body'],{'firstName':_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')],'ListId':_0x101f19['id']});_0x55166b[_0x5704a8[_0x546d('0x5b')][_0x546d('0x95')]]=_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')];return db['CmContact'][_0x546d('0x5a')](_0x55166b,{'fields':_0xc65790,'raw':!![]});}})[_0x546d('0x20')](handleEntityNotFound(_0x3d88e6,null))[_0x546d('0x20')](function(_0xfb540e){if(_0xfb540e){_0x5704a8[_0x546d('0x9b')]=_0xfb540e;var _0x56693e={'ContactId':_0xfb540e['id'],'phone':_0x5704a8[_0x546d('0x5b')]['from'],'SmsAccountId':_0x2c4383[_0x546d('0x57')]['id']};var _0x38e30f={'ContactId':_0xfb540e['id'],'SmsAccountId':_0x2c4383[_0x546d('0x57')]['id'],'closed':![]};return db[_0x546d('0x9c')]['find']({'where':_0x38e30f})[_0x546d('0x20')](function(_0x1fb318){if(_0x1fb318){return[_0x1fb318,![]];}return db[_0x546d('0x9c')][_0x546d('0x5a')](_0x56693e)['then'](function(_0x322990){return[_0x322990,!![]];});});}})['spread'](function(_0x36bd67,_0x1a8087){_0x5704a8['interaction']=_0x36bd67[_0x546d('0x36')]({'plain':!![]});_0x5704a8['interaction'][_0x546d('0x9d')]=![];if(_0x1a8087){if(_0x5704a8['account'][_0x546d('0x9e')]){_0x5704a8[_0x546d('0x9f')]['push']({'id':0x0,'priority':_0x5704a8[_0x546d('0x9f')]['length']+0x1,'app':_0x546d('0xa0'),'appdata':'unmanaged','interval':_0x546d('0xa1')});}_0x5704a8[_0x546d('0xa2')][_0x546d('0x9d')]=!![];}return db[_0x546d('0xa3')][_0x546d('0x5a')]({'phone':_0x5704a8[_0x546d('0x5b')][_0x546d('0x7c')],'messageId':_0x5704a8[_0x546d('0x5b')][_0x546d('0x7f')],'body':_0x5704a8['body'][_0x546d('0x5b')],'SmsAccountId':_0x2c4383[_0x546d('0x57')]['id'],'SmsInteractionId':_0x36bd67['id'],'direction':'in','ContactId':_0x36bd67[_0x546d('0xa4')],'AttachmentId':_0x5704a8[_0x546d('0x5b')][_0x546d('0xa5')]});})['then'](function(_0x48009c){_0x5704a8[_0x546d('0x26')]=_0x48009c;if(_0x5704a8['interaction']['UserId']){return db['User']['find']({'attributes':['id',_0x546d('0x3a')],'where':{'id':_0x5704a8[_0x546d('0xa2')][_0x546d('0xa6')]}})['then'](function(_0x57b580){if(_0x57b580){_0x5704a8[_0x546d('0x9f')][_0x546d('0xa7')]({'id':0x0,'priority':0x0,'app':_0x546d('0xa8'),'appdata':_0x57b580['name']+','+(_0x5704a8[_0x546d('0x72')]['waitForTheAssignedAgent']||0xa),'interval':_0x546d('0xa1')});}return respondWithRpcPromise(_0x546d('0xa9'),_0x546d('0xaa'),_0x5704a8);});}return respondWithRpcPromise(_0x546d('0xa9'),_0x546d('0xaa'),_0x5704a8);})[_0x546d('0x20')](function(_0x479370){if(_0x479370){var _0x1eafc2=0xc8;var _0x5a6c79=_0x546d('0xab');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5a6c79,_0x1eafc2,'entity\x20found');logger[_0x546d('0xac')](_0x546d('0xad'),_0x5a6c79,_0x1eafc2,_0x546d('0xae'),JSON[_0x546d('0x24')](_0x479370));if(_0x5704a8['account'][_0x546d('0x4e')]===_0x546d('0x7b')){return _0x3d88e6['status'](_0x1eafc2)['set'](_0x546d('0xaf'),_0x546d('0xb0'))[_0x546d('0xb1')](_0x546d('0xb2'));}else{return _0x3d88e6[_0x546d('0x2b')](_0x1eafc2)['json'](_0x479370);}}})[_0x546d('0x28')](handleError(_0x3d88e6,null));};exports[_0x546d('0xb3')]=function(_0x1659e6,_0x3ea2e1,_0x2aca9e){return db[_0x546d('0x51')][_0x546d('0x66')]({'where':{'id':_0x1659e6['params']['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x3ea2e1,null))[_0x546d('0x20')](function(_0x529486){if(_0x529486){return db[_0x546d('0xb4')][_0x546d('0xb5')](function(_0x5a8edb){return db[_0x546d('0x6f')][_0x546d('0x35')]({'where':{'SmsAccountId':_0x1659e6[_0x546d('0x57')]['id']},'transaction':_0x5a8edb})['then'](function(_0x37d0ee){var _0x3c95c7=_[_0x546d('0x3e')](_0x1659e6['body'],function(_0x4c1ef1){_0x4c1ef1['SmsAccountId']=_0x1659e6[_0x546d('0x57')]['id'];return _0x4c1ef1;});return db['SmsApplication'][_0x546d('0xb6')](_0x3c95c7,{'transaction':_0x5a8edb});});})['then'](function(){return db[_0x546d('0x6f')][_0x546d('0xb7')]({'where':{'SmsAccountId':_0x1659e6[_0x546d('0x57')]['id']},'order':_0x546d('0xb8')});});}})['then'](respondWithResult(_0x3ea2e1,null))[_0x546d('0x28')](handleError(_0x3ea2e1,null));};exports[_0x546d('0xb9')]=function(_0x51efb5,_0x1cd0f0,_0xf431de){var _0x52c6e6={};var _0x5889b7={};var _0x15fb3f;var _0x4524cf;return db[_0x546d('0x51')][_0x546d('0x66')]({'where':{'id':_0x51efb5[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x1cd0f0,null))[_0x546d('0x20')](function(_0x3fff57){if(_0x3fff57){_0x15fb3f=_0x3fff57;_0x5889b7['model']=_[_0x546d('0x43')](db[_0x546d('0x6f')][_0x546d('0x3f')]);_0x5889b7[_0x546d('0x42')]=_[_0x546d('0x43')](_0x51efb5[_0x546d('0x42')]);_0x5889b7[_0x546d('0x44')]=_[_0x546d('0x58')](_0x5889b7[_0x546d('0x41')],_0x5889b7[_0x546d('0x42')]);_0x52c6e6[_0x546d('0x45')]=_[_0x546d('0x58')](_0x5889b7[_0x546d('0x41')],qs[_0x546d('0x46')](_0x51efb5[_0x546d('0x42')]['fields']));_0x52c6e6[_0x546d('0x45')]=_0x52c6e6[_0x546d('0x45')]['length']?_0x52c6e6[_0x546d('0x45')]:_0x5889b7[_0x546d('0x41')];_0x52c6e6['order']=qs[_0x546d('0x4a')](_0x51efb5[_0x546d('0x42')][_0x546d('0x4a')]);_0x52c6e6[_0x546d('0x4d')]=qs[_0x546d('0x44')](_[_0x546d('0x4b')](_0x51efb5[_0x546d('0x42')],_0x5889b7[_0x546d('0x44')]));if(_0x51efb5[_0x546d('0x42')][_0x546d('0x4c')]){_0x52c6e6['where']=_[_0x546d('0x68')](_0x52c6e6[_0x546d('0x4d')],{'$or':_[_0x546d('0x3e')](_0x52c6e6['attributes'],function(_0x4eab99){var _0x569aaf={};_0x569aaf[_0x4eab99]={'$like':'%'+_0x51efb5[_0x546d('0x42')][_0x546d('0x4c')]+'%'};return _0x569aaf;})});}_0x52c6e6=_[_0x546d('0x68')]({},_0x52c6e6,_0x51efb5[_0x546d('0x50')]);return _0x15fb3f[_0x546d('0xb9')](_0x52c6e6);}})[_0x546d('0x20')](function(_0xe383a){if(_0xe383a){_0x4524cf=_0xe383a[_0x546d('0x47')];if(!_0x51efb5[_0x546d('0x42')][_0x546d('0x48')](_0x546d('0x49'))){_0x52c6e6[_0x546d('0x2e')]=qs[_0x546d('0x2e')](_0x51efb5[_0x546d('0x42')][_0x546d('0x2e')]);_0x52c6e6[_0x546d('0x30')]=qs[_0x546d('0x30')](_0x51efb5[_0x546d('0x42')][_0x546d('0x30')]);}return _0x15fb3f['getApplications'](_0x52c6e6);}})['then'](function(_0x2099a7){if(_0x2099a7){return _0x2099a7?{'count':_0x4524cf,'rows':_0x2099a7}:null;}})[_0x546d('0x20')](respondWithResult(_0x1cd0f0,null))[_0x546d('0x28')](handleError(_0x1cd0f0,null));};exports[_0x546d('0xba')]=function(_0x1e75f2,_0x2536e3,_0x55f49c){var _0x2c60d7={'raw':![],'where':{}};var _0x22ec59={};var _0x2cba57={'count':0x0,'rows':[]};return db[_0x546d('0x51')]['findOne']({'where':{'id':_0x1e75f2[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x2536e3,null))['then'](function(_0x156e28){if(_0x156e28){_0x22ec59['model']=_[_0x546d('0x43')](db[_0x546d('0x9c')][_0x546d('0x3f')]);_0x22ec59[_0x546d('0x42')]=_[_0x546d('0x43')](_0x1e75f2[_0x546d('0x42')]);_0x22ec59['filters']=_[_0x546d('0x58')](_0x22ec59[_0x546d('0x41')],_0x22ec59[_0x546d('0x42')]);_0x2c60d7['attributes']=_[_0x546d('0x58')](_0x22ec59[_0x546d('0x41')],qs[_0x546d('0x46')](_0x1e75f2[_0x546d('0x42')][_0x546d('0x46')]));_0x2c60d7['attributes']=_0x2c60d7[_0x546d('0x45')]['length']?_0x2c60d7[_0x546d('0x45')]:_0x22ec59[_0x546d('0x41')];if(!_0x1e75f2[_0x546d('0x42')][_0x546d('0x48')]('nolimit')){_0x2c60d7[_0x546d('0x2e')]=qs[_0x546d('0x2e')](_0x1e75f2[_0x546d('0x42')][_0x546d('0x2e')]);_0x2c60d7[_0x546d('0x30')]=qs[_0x546d('0x30')](_0x1e75f2[_0x546d('0x42')][_0x546d('0x30')]);}_0x2c60d7[_0x546d('0x67')]=qs['sort'](_0x1e75f2[_0x546d('0x42')][_0x546d('0x4a')]);_0x2c60d7[_0x546d('0x4d')]=qs[_0x546d('0x44')](_[_0x546d('0x4b')](_0x1e75f2['query'],_0x22ec59['filters']));_0x2c60d7[_0x546d('0x4d')][_0x546d('0x64')]=_0x156e28['id'];if(_0x1e75f2[_0x546d('0x42')][_0x546d('0x4c')]){_0x2c60d7[_0x546d('0x4d')]=_['merge'](_0x2c60d7[_0x546d('0x4d')],{'$or':_['map'](_0x2c60d7[_0x546d('0x45')],function(_0x2e03bb){var _0x43a606={};_0x43a606[_0x2e03bb]={'$like':'%'+_0x1e75f2['query'][_0x546d('0x4c')]+'%'};return _0x43a606;})});}_0x2c60d7=_[_0x546d('0x68')]({},_0x2c60d7,_0x1e75f2['options']);return db[_0x546d('0x9c')]['count']({'where':_0x2c60d7[_0x546d('0x4d')]})[_0x546d('0x20')](function(_0x43dc89){_0x2cba57[_0x546d('0x2f')]=_0x43dc89;if(_0x1e75f2['query']['includeAll']){_0x2c60d7[_0x546d('0x53')]=[{'model':db[_0x546d('0x73')],'as':_0x546d('0xbb'),'required':![]},{'model':db['User'],'as':_0x546d('0xbc'),'attributes':[_0x546d('0x3a'),_0x546d('0xbd'),_0x546d('0xbe')],'required':![]},{'model':db[_0x546d('0xbf')],'as':_0x546d('0xc0'),'attributes':['id',_0x546d('0x3a'),_0x546d('0xc1')],'where':_0x1e75f2[_0x546d('0x42')][_0x546d('0xc2')]?{'id':_0x1e75f2[_0x546d('0x42')][_0x546d('0xc2')]}:undefined,'required':_0x1e75f2[_0x546d('0x42')][_0x546d('0xc2')]?!![]:![]}];}return db['SmsInteraction'][_0x546d('0x54')](_0x2c60d7);})['then'](function(_0x5aa4c6){_0x2cba57[_0x546d('0x55')]=_0x5aa4c6;return _0x2cba57;});}})[_0x546d('0x20')](respondWithFilteredResult(_0x2536e3,_0x2c60d7))['catch'](handleError(_0x2536e3,null));};exports[_0x546d('0xb1')]=function(_0x3c5e89,_0x458cb3,_0x18bb1a){var _0x49284c,_0x4a4110,_0x55bc6d;if(_[_0x546d('0x91')](_0x3c5e89[_0x546d('0x5b')][_0x546d('0x5b')])||_0x3c5e89[_0x546d('0x5b')][_0x546d('0x5b')]===''){throw new db[(_0x546d('0x74'))][(_0x546d('0x92'))](_0x546d('0x94'));}if(_[_0x546d('0x91')](_0x3c5e89[_0x546d('0x5b')]['to'])){throw new db['Sequelize']['ValidationError']('to\x20is\x20mandatory');}_0x49284c=_0x3c5e89[_0x546d('0x5b')]['to'];return db[_0x546d('0x51')]['find']({'where':{'id':_0x3c5e89['params']['id']},'include':[{'model':db['CmList'],'as':_0x546d('0xc3'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x49284c},'limit':0x1,'order':[['updatedAt',_0x546d('0xc4')]]}]}]})['then'](handleEntityNotFound(_0x458cb3,null))[_0x546d('0x20')](function(_0x4cc538){if(_0x4cc538&&_0x4cc538[_0x546d('0xc3')]){_0x4a4110=_0x4cc538[_0x546d('0x36')]({'plain':!![]});if(_0x4a4110[_0x546d('0xc3')]&&_0x4a4110[_0x546d('0xc3')][_0x546d('0x99')][_0x546d('0x47')]){return _0x4a4110[_0x546d('0xc3')][_0x546d('0x99')][0x0];}return db['CmContact']['create'](_['defaults'](_0x3c5e89[_0x546d('0x5b')],{'firstName':_0x49284c,'mobile':_0x49284c,'phone':_0x49284c,'ListId':_0x4a4110['ListId']}));}})[_0x546d('0x20')](handleEntityNotFound(_0x458cb3,null))[_0x546d('0x20')](function(_0x3cd3e3){if(_0x3cd3e3){_0x55bc6d=_0x3cd3e3;return db[_0x546d('0x9c')][_0x546d('0x59')]({'where':{'ContactId':_0x55bc6d['id'],'closed':![],'SmsAccountId':_0x4a4110['id']}})[_0x546d('0x20')](function(_0x140fec){if(_0x140fec){return[_0x140fec,![]];}return db[_0x546d('0x9c')][_0x546d('0x5a')]({'UserId':_0x3c5e89[_0x546d('0x5c')]['id'],'ContactId':_0x55bc6d['id'],'SmsAccountId':_0x4a4110['id'],'phone':_0x49284c,'firstMsgDirection':_0x546d('0xc5'),'Messages':[_[_0x546d('0x68')](_0x3c5e89[_0x546d('0x5b')],{'read':![],'body':_0x3c5e89['body'][_0x546d('0x5b')],'phone':_0x49284c,'SmsAccountId':_0x4a4110['id'],'UserId':_0x3c5e89[_0x546d('0x5c')]['id'],'ContactId':_0x55bc6d['id']})]},{'include':[{'model':db[_0x546d('0xa3')],'as':_0x546d('0xc6')}]})[_0x546d('0x20')](function(_0x136371){return[_0x136371,!![]];});});}})[_0x546d('0xc7')](function(_0x2ddfc3,_0x103c93){if(_0x103c93){return _0x2ddfc3;}return db[_0x546d('0xa3')]['create'](_['merge'](_0x3c5e89[_0x546d('0x5b')],{'read':![],'body':_0x3c5e89[_0x546d('0x5b')][_0x546d('0x5b')],'phone':_0x49284c,'SmsAccountId':_0x4a4110['id'],'SmsInteractionId':_0x2ddfc3['id'],'UserId':_0x3c5e89[_0x546d('0x5c')]['id'],'ContactId':_0x55bc6d['id']}))[_0x546d('0x20')](function(_0x447923){_0x2ddfc3['dataValues'][_0x546d('0xc6')]=[];_0x2ddfc3[_0x546d('0xc8')][_0x546d('0xc6')][_0x546d('0xc9')](_0x447923['dataValues']);return _0x2ddfc3;});})['then'](respondWithResult(_0x458cb3,null))[_0x546d('0x28')](handleError(_0x458cb3,null));};exports[_0x546d('0x2b')]=function(_0x438a73,_0x19a1f9,_0x55b9b3){if(_0x438a73[_0x546d('0x5b')]['id']){delete _0x438a73['body']['id'];}var _0xe04e04,_0x177546,_0x2cf78;return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x438a73[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x19a1f9,null))[_0x546d('0x20')](function(_0x25cd15){if(_0x25cd15){_0x2cf78=_0x25cd15;logger[_0x546d('0xac')](_0x546d('0xca'),'status',_0x546d('0xcb'),_0x25cd15[_0x546d('0x4e')],util[_0x546d('0xcc')](_0x438a73['body'],{'showHidden':![],'depth':null}));switch(_0x25cd15[_0x546d('0x4e')]){case _0x546d('0x81'):if(_0x438a73[_0x546d('0x5b')][_0x546d('0xcd')]&&_0x438a73['body'][_0x546d('0x2b')]){_0x177546=_0x438a73[_0x546d('0x5b')][_0x546d('0x2b')];return db[_0x546d('0xa3')][_0x546d('0x59')]({'where':{'messageId':_0x438a73[_0x546d('0x5b')]['skebby_dispatch_id']}});}break;case _0x546d('0x83'):if(_0x438a73[_0x546d('0x5b')]['requestid']&&_0x438a73['body'][_0x546d('0xce')]){_0x177546=_0x438a73[_0x546d('0x5b')][_0x546d('0xce')];return db[_0x546d('0xa3')][_0x546d('0x59')]({'where':{'messageId':_0x438a73['body'][_0x546d('0xcf')]}});}break;case'clicksend':if(_0x438a73[_0x546d('0x5b')]['message_id']&&_0x438a73['body']['status_code']){_0x177546=_0x438a73[_0x546d('0x5b')][_0x546d('0xd0')];return db[_0x546d('0xa3')][_0x546d('0x59')]({'where':{'messageId':_0x438a73[_0x546d('0x5b')][_0x546d('0xd1')]}});}break;case _0x546d('0x88'):var _0x165293=_0x438a73['body']['results'][0x0];if(_0x165293[_0x546d('0x7f')]&&_0x165293[_0x546d('0x2b')][_0x546d('0xd2')]===_0x546d('0xd3')){_0x177546=_0x165293[_0x546d('0x2b')]['groupName'];return db[_0x546d('0xa3')][_0x546d('0x59')]({'where':{'messageId':_0x165293[_0x546d('0x7f')]}});}break;case _0x546d('0xd4'):if(_0x438a73['body']['messageId']&&_0x438a73[_0x546d('0x5b')]['status']){_0x177546=_0x438a73[_0x546d('0x5b')][_0x546d('0x2b')];return db['SmsMessage'][_0x546d('0x59')]({'where':{'messageId':_0x438a73['body'][_0x546d('0x7f')]}});}break;case _0x546d('0x8e'):if(_0x438a73[_0x546d('0x5b')][0x0][_0x546d('0x26')]['id']){_0x177546=_0x438a73['body'][0x0][_0x546d('0x4e')];return db[_0x546d('0xa3')]['find']({'where':{'messageId':_0x438a73[_0x546d('0x5b')][0x0][_0x546d('0x26')]['id']}});}break;case _0x546d('0x8f'):if(_0x438a73[_0x546d('0x5b')][_0x546d('0xd5')]&&_0x438a73[_0x546d('0x5b')][_0x546d('0x2b')]){_0x177546=_0x438a73[_0x546d('0x5b')]['status'];return db[_0x546d('0xa3')][_0x546d('0x59')]({'where':{'messageId':_0x438a73[_0x546d('0x5b')][_0x546d('0xd5')]}});}break;}}})[_0x546d('0x20')](handleEntityNotFound(_0x19a1f9,null))[_0x546d('0x20')](function(_0x23a750){if(_0x23a750){_0xe04e04=_0x23a750;switch(_0x2cf78[_0x546d('0x4e')]){case'skebby':if(_0x177546===_0x546d('0xd3')){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger[_0x546d('0x25')](_0x546d('0xca'),_0x546d('0x2b'),_0x546d('0x81'),util['inspect'](_0x438a73['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x177546==='1'){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger[_0x546d('0x25')](_0x546d('0xca'),'status','skebby',util[_0x546d('0xcc')](_0x438a73['body'],{'showHidden':![],'depth':null}));}break;case _0x546d('0x84'):if(!_0x438a73[_0x546d('0x5b')][_0x546d('0xd6')]&&_0x177546>=0xc8&&_0x177546<=0xce){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger[_0x546d('0x25')](_0x546d('0xca'),_0x546d('0x2b'),_0x546d('0x84'),util['inspect'](_0x438a73[_0x546d('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x546d('0x88'):var _0x58d729=_0x438a73[_0x546d('0x5b')]['results'][0x0];if(_0x58d729[_0x546d('0x2b')][_0x546d('0xd2')]===_0x546d('0xd3')){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger[_0x546d('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x546d('0x2b'),_0x546d('0x88'),util[_0x546d('0xcc')](_0x438a73[_0x546d('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x546d('0xd4'):if(_0x177546==_0x546d('0xd7')||_0x177546==_0x546d('0xd8')){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger['error'](_0x546d('0xca'),_0x546d('0x2b'),_0x546d('0xd4'),util[_0x546d('0xcc')](_0x438a73[_0x546d('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x546d('0x8e'):if(_0x177546==_0x546d('0xd9')){return _0xe04e04['update']({'read':!![]});}else{logger[_0x546d('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x546d('0x2b'),_0x546d('0x8e'),util[_0x546d('0xcc')](_0x438a73[_0x546d('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x546d('0x8f'):if(_0x177546===_0x546d('0xda')||_0x177546===_0x546d('0xdb')){return _0xe04e04[_0x546d('0x61')]({'read':!![]});}else{logger[_0x546d('0x25')](_0x546d('0xca'),'status',_0x546d('0x8f'),util[_0x546d('0xcc')](_0x438a73[_0x546d('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0xe04e04;}})[_0x546d('0x20')](respondWithResult(_0x19a1f9,null))[_0x546d('0x28')](handleError(_0x19a1f9,null));};exports[_0x546d('0xdc')]=function(_0xa31d43,_0x135252,_0x27a7a6){var _0x481002,_0xa6a570,_0x175f9a;return db['SmsAccount']['find']({'where':{'id':_0xa31d43[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x135252,null))[_0x546d('0x20')](function(_0x19a5a9){if(_0x19a5a9){_0x175f9a=_0x19a5a9;logger[_0x546d('0xac')](_0x546d('0xca'),_0x546d('0x2b'),_0x546d('0xcb'),_0x19a5a9['type'],util[_0x546d('0xcc')](_0xa31d43[_0x546d('0x42')],{'showHidden':![],'depth':null}));switch(_0x19a5a9['type']){case _0x546d('0x8a'):if(_0xa31d43['query'][_0x546d('0xdd')]&&_0xa31d43[_0x546d('0x42')][_0x546d('0xde')]){_0xa6a570=_0xa31d43[_0x546d('0x42')][_0x546d('0xde')];return db['SmsMessage'][_0x546d('0x59')]({'where':{'messageId':_0xa31d43['query']['message-id']}});}break;}}})[_0x546d('0x20')](handleEntityNotFound(_0x135252,null))['then'](function(_0x438438){if(_0x438438){_0x481002=_0x438438;switch(_0x175f9a[_0x546d('0x4e')]){case'csc':if(_0xa6a570==='2'||_0xa6a570==='6'){return _0x481002['update']({'read':!![]});}else{logger[_0x546d('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x546d('0x2b'),_0x546d('0x8a'),util[_0x546d('0xcc')](_0xa31d43[_0x546d('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x481002;}})[_0x546d('0x20')](respondWithResult(_0x135252,null))[_0x546d('0x28')](handleError(_0x135252,null));};exports['addAgents']=function(_0x558d1f,_0x3514b9,_0x4a5940){return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x558d1f[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x3514b9,null))[_0x546d('0x20')](function(_0x39bfed){if(_0x39bfed){return _0x39bfed['addAgents'](_0x558d1f[_0x546d('0x5b')][_0x546d('0x6d')],_['omit'](_0x558d1f[_0x546d('0x5b')],['ids','id'])||{})[_0x546d('0xc7')](function(_0x520b55){for(var _0xd1cb95=0x0;_0xd1cb95<_0x558d1f[_0x546d('0x5b')]['ids'][_0x546d('0x47')];_0xd1cb95+=0x1){socket[_0x546d('0xdf')](_0x546d('0xe0'),{'UserId':Number(_0x558d1f[_0x546d('0x5b')][_0x546d('0x6d')][_0xd1cb95]),'SmsAccountId':Number(_0x558d1f[_0x546d('0x57')]['id'])});}return _0x520b55;});}})[_0x546d('0x20')](respondWithResult(_0x3514b9,null))[_0x546d('0x28')](handleError(_0x3514b9,null));};exports['removeAgents']=function(_0x31314c,_0x596306,_0x33837b){return db[_0x546d('0x51')][_0x546d('0x59')]({'where':{'id':_0x31314c[_0x546d('0x57')]['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x596306,null))[_0x546d('0x20')](function(_0xd20932){if(_0xd20932){return _0xd20932[_0x546d('0xe1')](_0x31314c['query'][_0x546d('0x6d')])[_0x546d('0x20')](function(){if(_[_0x546d('0xe2')](_0x31314c['query'][_0x546d('0x6d')])){for(var _0x16249c=0x0;_0x16249c<_0x31314c['query']['ids'][_0x546d('0x47')];_0x16249c+=0x1){socket[_0x546d('0xdf')](_0x546d('0xe3'),{'UserId':Number(_0x31314c[_0x546d('0x42')][_0x546d('0x6d')][_0x16249c]),'SmsAccountId':Number(_0x31314c[_0x546d('0x57')]['id'])});}}else{socket[_0x546d('0xdf')](_0x546d('0xe3'),{'UserId':Number(_0x31314c[_0x546d('0x42')][_0x546d('0x6d')]),'SmsAccountId':Number(_0x31314c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x596306,null))['catch'](handleError(_0x596306,null));};exports[_0x546d('0xe4')]=function(_0xe2831,_0x3581fa,_0x4b63e3){var _0xb77f47={};var _0x3f83ae={};var _0x51f728;var _0x1b8849;return db[_0x546d('0x51')][_0x546d('0x66')]({'where':{'id':_0xe2831['params']['id']}})[_0x546d('0x20')](handleEntityNotFound(_0x3581fa,null))[_0x546d('0x20')](function(_0x3eec0a){if(_0x3eec0a){_0x51f728=_0x3eec0a;_0x3f83ae[_0x546d('0x41')]=_[_0x546d('0x43')](db[_0x546d('0xe5')][_0x546d('0x3f')]);_0x3f83ae[_0x546d('0x42')]=_[_0x546d('0x43')](_0xe2831[_0x546d('0x42')]);_0x3f83ae[_0x546d('0x44')]=_[_0x546d('0x58')](_0x3f83ae[_0x546d('0x41')],_0x3f83ae[_0x546d('0x42')]);_0xb77f47[_0x546d('0x45')]=_['intersection'](_0x3f83ae[_0x546d('0x41')],qs['fields'](_0xe2831['query'][_0x546d('0x46')]));_0xb77f47[_0x546d('0x45')]=_0xb77f47[_0x546d('0x45')][_0x546d('0x47')]?_0xb77f47[_0x546d('0x45')]:_0x3f83ae[_0x546d('0x41')];_0xb77f47['order']=qs[_0x546d('0x4a')](_0xe2831[_0x546d('0x42')][_0x546d('0x4a')]);_0xb77f47[_0x546d('0x4d')]=qs[_0x546d('0x44')](_[_0x546d('0x4b')](_0xe2831[_0x546d('0x42')],_0x3f83ae[_0x546d('0x44')]));if(_0xe2831[_0x546d('0x42')][_0x546d('0x4c')]){_0xb77f47[_0x546d('0x4d')]=_['merge'](_0xb77f47[_0x546d('0x4d')],{'$or':_[_0x546d('0x3e')](_0xb77f47[_0x546d('0x45')],function(_0x428a49){var _0xa891c3={};_0xa891c3[_0x428a49]={'$like':'%'+_0xe2831[_0x546d('0x42')]['filter']+'%'};return _0xa891c3;})});}_0xb77f47=_[_0x546d('0x68')]({},_0xb77f47,_0xe2831[_0x546d('0x50')]);return _0x51f728['getAgents'](_0xb77f47);}})['then'](function(_0x51fe09){if(_0x51fe09){_0x1b8849=_0x51fe09['length'];if(!_0xe2831['query'][_0x546d('0x48')](_0x546d('0x49'))){_0xb77f47[_0x546d('0x2e')]=qs['limit'](_0xe2831[_0x546d('0x42')][_0x546d('0x2e')]);_0xb77f47[_0x546d('0x30')]=qs[_0x546d('0x30')](_0xe2831[_0x546d('0x42')][_0x546d('0x30')]);}return _0x51f728[_0x546d('0xe4')](_0xb77f47);}})['then'](function(_0x3562ec){if(_0x3562ec){return _0x3562ec?{'count':_0x1b8849,'rows':_0x3562ec}:null;}})[_0x546d('0x20')](respondWithResult(_0x3581fa,null))['catch'](handleError(_0x3581fa,null));};
\ No newline at end of file
index 6c9ca49..35d60f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x412a=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','save'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x412a,0x11d));var _0xa412=function(_0xc1bd0c,_0x4c0ee0){_0xc1bd0c=_0xc1bd0c-0x0;var _0x2ec13e=_0x412a[_0xc1bd0c];return _0x2ec13e;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xa412('0x0'))['db'][_0xa412('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa412('0x2'),'afterUpdate':_0xa412('0x3'),'afterDestroy':_0xa412('0x4')};function emitEvent(_0x139da2){return function(_0x2007ad,_0x1a3dfe,_0xd917f4){SmsAccountEvents[_0xa412('0x5')](_0x139da2+':'+_0x2007ad['id'],_0x2007ad);SmsAccountEvents[_0xa412('0x5')](_0x139da2,_0x2007ad);_0xd917f4(null);};}for(var e in events){if(events[_0xa412('0x6')](e)){var event=events[e];SmsAccount[_0xa412('0x7')](e,emitEvent(event));}}module[_0xa412('0x8')]=SmsAccountEvents;
\ No newline at end of file
+var _0x4220=['exports','events','../../mysqldb','SmsAccount','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x4220,0x169));var _0x0422=function(_0x98d4a7,_0x55746c){_0x98d4a7=_0x98d4a7-0x0;var _0x453fb6=_0x4220[_0x98d4a7];return _0x453fb6;};'use strict';var EventEmitter=require(_0x0422('0x0'));var SmsAccount=require(_0x0422('0x1'))['db'][_0x0422('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0422('0x3'),'afterUpdate':_0x0422('0x4'),'afterDestroy':_0x0422('0x5')};function emitEvent(_0x2d2207){return function(_0x33593e,_0x51cb0f,_0x1b2392){SmsAccountEvents['emit'](_0x2d2207+':'+_0x33593e['id'],_0x33593e);SmsAccountEvents[_0x0422('0x6')](_0x2d2207,_0x33593e);_0x1b2392(null);};}for(var e in events){if(events[_0x0422('0x7')](e)){var event=events[e];SmsAccount[_0x0422('0x8')](e,emitEvent(event));}}module[_0x0422('0x9')]=SmsAccountEvents;
\ No newline at end of file
index 39add07..aed7b5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c62=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./smsAccount.attributes','exports','define','sms_accounts','util'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x0c62,0x128));var _0x20c6=function(_0x258167,_0x147491){_0x258167=_0x258167-0x0;var _0x5c2e98=_0x0c62[_0x258167];return _0x5c2e98;};'use strict';var _=require('lodash');var util=require(_0x20c6('0x0'));var logger=require(_0x20c6('0x1'))('api');var moment=require(_0x20c6('0x2'));var BPromise=require(_0x20c6('0x3'));var rp=require(_0x20c6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20c6('0x5'));var config=require(_0x20c6('0x6'));var attributes=require(_0x20c6('0x7'));module[_0x20c6('0x8')]=function(_0x594f7b,_0x390ef2){return _0x594f7b[_0x20c6('0x9')]('SmsAccount',attributes,{'tableName':_0x20c6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdcec=['SmsAccount','sms_accounts','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./smsAccount.attributes','exports','define'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xdcec,0xf2));var _0xcdce=function(_0x4ec9e3,_0x15fbf4){_0x4ec9e3=_0x4ec9e3-0x0;var _0x2883ce=_0xdcec[_0x4ec9e3];return _0x2883ce;};'use strict';var _=require('lodash');var util=require(_0xcdce('0x0'));var logger=require(_0xcdce('0x1'))(_0xcdce('0x2'));var moment=require(_0xcdce('0x3'));var BPromise=require(_0xcdce('0x4'));var rp=require(_0xcdce('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xcdce('0x6'));var attributes=require(_0xcdce('0x7'));module[_0xcdce('0x8')]=function(_0x513bde,_0x559227){return _0x513bde[_0xcdce('0x9')](_0xcdce('0xa'),attributes,{'tableName':_0xcdce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1246346..7c0f82f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63c2=['then','ShowSmsAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','request','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','SmsAccount','find','options','raw','where','attributes','model','include','map'];(function(_0x4f115d,_0x1927c3){var _0x121374=function(_0x41fcb9){while(--_0x41fcb9){_0x4f115d['push'](_0x4f115d['shift']());}};_0x121374(++_0x1927c3);}(_0x63c2,0x1b2));var _0x263c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x63c2[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x263c('0x0'));var util=require(_0x263c('0x1'));var moment=require(_0x263c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x263c('0x3'));var db=require(_0x263c('0x4'))['db'];var utils=require(_0x263c('0x5'));var logger=require(_0x263c('0x6'))('rpc');var config=require(_0x263c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x263c('0x8')]({'port':0x232a});config[_0x263c('0x9')]=_[_0x263c('0xa')](config[_0x263c('0x9')],{'host':_0x263c('0xb'),'port':0x18eb});var socket=require(_0x263c('0xc'))(new Redis(config[_0x263c('0x9')]));require(_0x263c('0xd'))[_0x263c('0xe')](socket);function respondWithRpcPromise(_0x4e2981,_0x39655c,_0xa33775){return new BPromise(function(_0x3e5c90,_0x48d8c5){return client[_0x263c('0xf')](_0x4e2981,_0xa33775)['then'](function(_0x397414){logger['info'](_0x263c('0x10'),_0x39655c,'request\x20sent');logger[_0x263c('0x11')](_0x263c('0x12'),_0x39655c,'request\x20sent',JSON[_0x263c('0x13')](_0x397414));if(_0x397414[_0x263c('0x14')]){if(_0x397414[_0x263c('0x14')][_0x263c('0x15')]===0x1f4){logger['error'](_0x263c('0x10'),_0x39655c,_0x397414[_0x263c('0x14')][_0x263c('0x16')]);return _0x48d8c5(_0x397414['error']['message']);}logger[_0x263c('0x14')](_0x263c('0x10'),_0x39655c,_0x397414[_0x263c('0x14')]['message']);return _0x3e5c90(_0x397414[_0x263c('0x14')][_0x263c('0x16')]);}else{logger[_0x263c('0x17')](_0x263c('0x10'),_0x39655c,'request\x20sent');_0x3e5c90(_0x397414[_0x263c('0x18')][_0x263c('0x16')]);}})['catch'](function(_0x1be10c){logger[_0x263c('0x14')](_0x263c('0x10'),_0x39655c,_0x1be10c);_0x48d8c5(_0x1be10c);});});}exports['ShowSmsAccount']=function(_0x2e4fab){var _0x41ed2d=this;return new Promise(function(_0xe7ba25,_0xb1c02a){return db[_0x263c('0x19')][_0x263c('0x1a')]({'raw':_0x2e4fab['options']?_0x2e4fab[_0x263c('0x1b')][_0x263c('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e4fab['options']?_0x2e4fab[_0x263c('0x1b')][_0x263c('0x1d')]||null:null,'attributes':_0x2e4fab[_0x263c('0x1b')]?_0x2e4fab['options'][_0x263c('0x1e')]||null:null,'include':_0x2e4fab[_0x263c('0x1b')]?_0x2e4fab['options']['include']?_['map'](_0x2e4fab[_0x263c('0x1b')]['include'],function(_0x31cefe){return{'model':db[_0x31cefe[_0x263c('0x1f')]],'as':_0x31cefe['as'],'attributes':_0x31cefe[_0x263c('0x1e')],'include':_0x31cefe[_0x263c('0x20')]?_['map'](_0x31cefe['include'],function(_0x39c2d3){return{'model':db[_0x39c2d3['model']],'as':_0x39c2d3['as'],'attributes':_0x39c2d3[_0x263c('0x1e')],'include':_0x39c2d3[_0x263c('0x20')]?_[_0x263c('0x21')](_0x39c2d3[_0x263c('0x20')],function(_0xb85164){return{'model':db[_0xb85164[_0x263c('0x1f')]],'as':_0xb85164['as'],'attributes':_0xb85164[_0x263c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x263c('0x22')](function(_0x11511c){logger[_0x263c('0x17')]('ShowSmsAccount',_0x2e4fab);logger[_0x263c('0x11')](_0x263c('0x23'),_0x2e4fab,JSON[_0x263c('0x13')](_0x11511c));_0xe7ba25(_0x11511c);})['catch'](function(_0x3ea3c1){logger[_0x263c('0x14')](_0x263c('0x23'),_0x3ea3c1[_0x263c('0x16')],_0x2e4fab);_0xb1c02a(_0x41ed2d[_0x263c('0x14')](0x1f4,_0x3ea3c1[_0x263c('0x16')]));});});};
\ No newline at end of file
+var _0x7bf6=['code','message','request\x20sent','result','catch','SmsAccount','find','options','raw','where','attributes','include','model','map','ShowSmsAccount','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','register','request','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x23e926,_0x24d43d){var _0x1ffacf=function(_0x4fe707){while(--_0x4fe707){_0x23e926['push'](_0x23e926['shift']());}};_0x1ffacf(++_0x24d43d);}(_0x7bf6,0x177));var _0x67bf=function(_0x13cc75,_0x57fd07){_0x13cc75=_0x13cc75-0x0;var _0x5a595d=_0x7bf6[_0x13cc75];return _0x5a595d;};'use strict';var _=require(_0x67bf('0x0'));var util=require(_0x67bf('0x1'));var moment=require('moment');var BPromise=require(_0x67bf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67bf('0x3'))['db'];var utils=require(_0x67bf('0x4'));var logger=require(_0x67bf('0x5'))(_0x67bf('0x6'));var config=require('../../config/environment');var jayson=require(_0x67bf('0x7'));var client=jayson[_0x67bf('0x8')]['http']({'port':0x232a});config[_0x67bf('0x9')]=_[_0x67bf('0xa')](config['redis'],{'host':_0x67bf('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')[_0x67bf('0xc')](socket);function respondWithRpcPromise(_0x4fe26a,_0x11590d,_0x3e2edd){return new BPromise(function(_0x59e0b2,_0x205c05){return client[_0x67bf('0xd')](_0x4fe26a,_0x3e2edd)[_0x67bf('0xe')](function(_0x262a48){logger[_0x67bf('0xf')](_0x67bf('0x10'),_0x11590d,'request\x20sent');logger[_0x67bf('0x11')](_0x67bf('0x12'),_0x11590d,'request\x20sent',JSON[_0x67bf('0x13')](_0x262a48));if(_0x262a48[_0x67bf('0x14')]){if(_0x262a48[_0x67bf('0x14')][_0x67bf('0x15')]===0x1f4){logger[_0x67bf('0x14')](_0x67bf('0x10'),_0x11590d,_0x262a48[_0x67bf('0x14')][_0x67bf('0x16')]);return _0x205c05(_0x262a48[_0x67bf('0x14')][_0x67bf('0x16')]);}logger[_0x67bf('0x14')](_0x67bf('0x10'),_0x11590d,_0x262a48[_0x67bf('0x14')]['message']);return _0x59e0b2(_0x262a48['error'][_0x67bf('0x16')]);}else{logger[_0x67bf('0xf')](_0x67bf('0x10'),_0x11590d,_0x67bf('0x17'));_0x59e0b2(_0x262a48[_0x67bf('0x18')][_0x67bf('0x16')]);}})[_0x67bf('0x19')](function(_0x233746){logger[_0x67bf('0x14')](_0x67bf('0x10'),_0x11590d,_0x233746);_0x205c05(_0x233746);});});}exports['ShowSmsAccount']=function(_0x4c2964){var _0x19195a=this;return new Promise(function(_0x3fd621,_0x2a251f){return db[_0x67bf('0x1a')][_0x67bf('0x1b')]({'raw':_0x4c2964['options']?_0x4c2964[_0x67bf('0x1c')][_0x67bf('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c2964[_0x67bf('0x1c')]?_0x4c2964['options'][_0x67bf('0x1e')]||null:null,'attributes':_0x4c2964[_0x67bf('0x1c')]?_0x4c2964[_0x67bf('0x1c')][_0x67bf('0x1f')]||null:null,'include':_0x4c2964['options']?_0x4c2964[_0x67bf('0x1c')][_0x67bf('0x20')]?_['map'](_0x4c2964[_0x67bf('0x1c')][_0x67bf('0x20')],function(_0x45ecd0){return{'model':db[_0x45ecd0[_0x67bf('0x21')]],'as':_0x45ecd0['as'],'attributes':_0x45ecd0[_0x67bf('0x1f')],'include':_0x45ecd0[_0x67bf('0x20')]?_['map'](_0x45ecd0[_0x67bf('0x20')],function(_0x58aef1){return{'model':db[_0x58aef1[_0x67bf('0x21')]],'as':_0x58aef1['as'],'attributes':_0x58aef1[_0x67bf('0x1f')],'include':_0x58aef1['include']?_[_0x67bf('0x22')](_0x58aef1[_0x67bf('0x20')],function(_0x221259){return{'model':db[_0x221259[_0x67bf('0x21')]],'as':_0x221259['as'],'attributes':_0x221259[_0x67bf('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x67bf('0xe')](function(_0x18a366){logger[_0x67bf('0xf')](_0x67bf('0x23'),_0x4c2964);logger[_0x67bf('0x11')](_0x67bf('0x23'),_0x4c2964,JSON['stringify'](_0x18a366));_0x3fd621(_0x18a366);})[_0x67bf('0x19')](function(_0x124a36){logger[_0x67bf('0x14')](_0x67bf('0x23'),_0x124a36[_0x67bf('0x16')],_0x4c2964);_0x2a251f(_0x19195a[_0x67bf('0x14')](0x1f4,_0x124a36['message']));});});};
\ No newline at end of file
index 9eaa3e0..345b17f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index fc62096..f1dd674 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2b8651,_0x50a5cb){var _0x13e09b=function(_0x4aadd2){while(--_0x4aadd2){_0x2b8651['push'](_0x2b8651['shift']());}};_0x13e09b(++_0x50a5cb);}(_0xedd9,0xfc));var _0x9edd=function(_0x34fc32,_0x1b372f){_0x34fc32=_0x34fc32-0x0;var _0x567758=_0xedd9[_0x34fc32];return _0x567758;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x5ecb2c,_0x5e11fc){var _0x46efbe=function(_0x337eff){while(--_0x337eff){_0x5ecb2c['push'](_0x5ecb2c['shift']());}};_0x46efbe(++_0x5e11fc);}(_0x008c,0x188));var _0xc008=function(_0x2e986d,_0x4b6b63){_0x2e986d=_0x2e986d-0x0;var _0x351c79=_0x008c[_0x2e986d];return _0x351c79;};'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 fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router;
\ No newline at end of file
index dea0e36..469965b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f3e=['*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x4a6462,_0x61b1b5){var _0x122407=function(_0x42618b){while(--_0x42618b){_0x4a6462['push'](_0x4a6462['shift']());}};_0x122407(++_0x61b1b5);}(_0x0f3e,0x92));var _0xe0f3=function(_0x1ac8fe,_0xc0578f){_0x1ac8fe=_0x1ac8fe-0x0;var _0x4c6db2=_0x0f3e[_0x1ac8fe];return _0x4c6db2;};'use strict';var Sequelize=require('sequelize');module[_0xe0f3('0x0')]={'priority':{'type':Sequelize[_0xe0f3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe0f3('0x2')],'allowNull':![],'defaultValue':_0xe0f3('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe0f3('0x2')]},'interval':{'type':Sequelize[_0xe0f3('0x2')],'defaultValue':_0xe0f3('0x4')}};
\ No newline at end of file
+var _0x2f33=['sequelize','INTEGER','noop','STRING','*,*,*,*'];(function(_0x402125,_0x3546a9){var _0x183c8b=function(_0x732136){while(--_0x732136){_0x402125['push'](_0x402125['shift']());}};_0x183c8b(++_0x3546a9);}(_0x2f33,0xb4));var _0x32f3=function(_0x1d6505,_0x183c95){_0x1d6505=_0x1d6505-0x0;var _0x548fc1=_0x2f33[_0x1d6505];return _0x548fc1;};'use strict';var Sequelize=require(_0x32f3('0x0'));module['exports']={'priority':{'type':Sequelize[_0x32f3('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x32f3('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x32f3('0x3')],'defaultValue':_0x32f3('0x4')}};
\ No newline at end of file
index 7b16891..9f7e74d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf93=['intersection','options','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','SmsApplication','includeAll','include','findAll','rows','catch','params'];(function(_0x17b867,_0x5657bd){var _0x122967=function(_0x12a9e8){while(--_0x12a9e8){_0x17b867['push'](_0x17b867['shift']());}};_0x122967(++_0x5657bd);}(_0xcf93,0xec));var _0x3cf9=function(_0x49c4fc,_0x4558b8){_0x49c4fc=_0x49c4fc-0x0;var _0x4c36a8=_0xcf93[_0x49c4fc];return _0x4c36a8;};'use strict';var emlformat=require(_0x3cf9('0x0'));var rimraf=require(_0x3cf9('0x1'));var zipdir=require(_0x3cf9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3cf9('0x3'));var moment=require(_0x3cf9('0x4'));var BPromise=require(_0x3cf9('0x5'));var Mustache=require(_0x3cf9('0x6'));var util=require(_0x3cf9('0x7'));var path=require(_0x3cf9('0x8'));var sox=require(_0x3cf9('0x9'));var csv=require('to-csv');var ejs=require(_0x3cf9('0xa'));var fs=require('fs');var fs_extra=require(_0x3cf9('0xb'));var _=require(_0x3cf9('0xc'));var squel=require('squel');var crypto=require(_0x3cf9('0xd'));var jsforce=require(_0x3cf9('0xe'));var deskjs=require(_0x3cf9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3cf9('0x10'));var Papa=require(_0x3cf9('0x11'));var Redis=require(_0x3cf9('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3cf9('0x13'));var as=require(_0x3cf9('0x14'));var hardwareService=require(_0x3cf9('0x15'));var logger=require(_0x3cf9('0x16'))(_0x3cf9('0x17'));var utils=require(_0x3cf9('0x18'));var config=require(_0x3cf9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3cf9('0x1a'))['db'];function respondWithStatusCode(_0x5988b6,_0x4df994){_0x4df994=_0x4df994||0xcc;return function(_0x43b87d){if(_0x43b87d){return _0x5988b6[_0x3cf9('0x1b')](_0x4df994);}return _0x5988b6[_0x3cf9('0x1c')](_0x4df994)[_0x3cf9('0x1d')]();};}function respondWithResult(_0x147b23,_0x2a5feb){_0x2a5feb=_0x2a5feb||0xc8;return function(_0x4eebda){if(_0x4eebda){return _0x147b23[_0x3cf9('0x1c')](_0x2a5feb)['json'](_0x4eebda);}};}function respondWithFilteredResult(_0x43dcb1,_0x23290d){return function(_0x142465){if(_0x142465){var _0x4bb6f1=typeof _0x23290d[_0x3cf9('0x1e')]==='undefined'&&typeof _0x23290d[_0x3cf9('0x1f')]===_0x3cf9('0x20');var _0x52f9eb=_0x142465[_0x3cf9('0x21')];var _0x476059=_0x4bb6f1?0x0:_0x23290d[_0x3cf9('0x1e')];var _0x30e9a6=_0x4bb6f1?_0x142465[_0x3cf9('0x21')]:_0x23290d[_0x3cf9('0x1e')]+_0x23290d['limit'];var _0x340f03;if(_0x30e9a6>=_0x52f9eb){_0x30e9a6=_0x52f9eb;_0x340f03=0xc8;}else{_0x340f03=0xce;}_0x43dcb1[_0x3cf9('0x1c')](_0x340f03);return _0x43dcb1[_0x3cf9('0x22')]('Content-Range',_0x476059+'-'+_0x30e9a6+'/'+_0x52f9eb)['json'](_0x142465);}return null;};}function patchUpdates(_0x2473c2){return function(_0x1be0aa){try{jsonpatch['apply'](_0x1be0aa,_0x2473c2,!![]);}catch(_0x2dd375){return BPromise[_0x3cf9('0x23')](_0x2dd375);}return _0x1be0aa['save']();};}function saveUpdates(_0x199256,_0x419528){return function(_0x8b073c){if(_0x8b073c){return _0x8b073c[_0x3cf9('0x24')](_0x199256)[_0x3cf9('0x25')](function(_0x4b7092){return _0x4b7092;});}return null;};}function removeEntity(_0x35cfe7,_0xa1ab43){return function(_0x2e40c3){if(_0x2e40c3){return _0x2e40c3[_0x3cf9('0x26')]()[_0x3cf9('0x25')](function(){_0x35cfe7[_0x3cf9('0x1c')](0xcc)[_0x3cf9('0x1d')]();});}};}function handleEntityNotFound(_0x199021,_0x558599){return function(_0xbf690f){if(!_0xbf690f){_0x199021[_0x3cf9('0x1b')](0x194);}return _0xbf690f;};}function handleError(_0x4ef100,_0x17e5da){_0x17e5da=_0x17e5da||0x1f4;return function(_0x3eda9f){logger[_0x3cf9('0x27')](_0x3eda9f[_0x3cf9('0x28')]);if(_0x3eda9f[_0x3cf9('0x29')]){delete _0x3eda9f[_0x3cf9('0x29')];}_0x4ef100[_0x3cf9('0x1c')](_0x17e5da)[_0x3cf9('0x2a')](_0x3eda9f);};}exports[_0x3cf9('0x2b')]=function(_0x2b6bc1,_0x152454){var _0x12dea0={},_0x236375={},_0x395428={'count':0x0,'rows':[]};var _0x46da75=_[_0x3cf9('0x2c')](db['SmsApplication'][_0x3cf9('0x2d')],function(_0x7b5e66){return{'name':_0x7b5e66[_0x3cf9('0x2e')],'type':_0x7b5e66[_0x3cf9('0x2f')][_0x3cf9('0x30')]};});_0x236375[_0x3cf9('0x31')]=_[_0x3cf9('0x2c')](_0x46da75,_0x3cf9('0x29'));_0x236375[_0x3cf9('0x32')]=_[_0x3cf9('0x33')](_0x2b6bc1['query']);_0x236375[_0x3cf9('0x34')]=_['intersection'](_0x236375['model'],_0x236375[_0x3cf9('0x32')]);_0x12dea0[_0x3cf9('0x35')]=_['intersection'](_0x236375[_0x3cf9('0x31')],qs['fields'](_0x2b6bc1[_0x3cf9('0x32')][_0x3cf9('0x36')]));_0x12dea0[_0x3cf9('0x35')]=_0x12dea0[_0x3cf9('0x35')][_0x3cf9('0x37')]?_0x12dea0[_0x3cf9('0x35')]:_0x236375[_0x3cf9('0x31')];if(!_0x2b6bc1['query'][_0x3cf9('0x38')](_0x3cf9('0x39'))){_0x12dea0[_0x3cf9('0x1f')]=qs[_0x3cf9('0x1f')](_0x2b6bc1[_0x3cf9('0x32')][_0x3cf9('0x1f')]);_0x12dea0['offset']=qs[_0x3cf9('0x1e')](_0x2b6bc1[_0x3cf9('0x32')][_0x3cf9('0x1e')]);}_0x12dea0[_0x3cf9('0x3a')]=qs[_0x3cf9('0x3b')](_0x2b6bc1[_0x3cf9('0x32')][_0x3cf9('0x3b')]);_0x12dea0[_0x3cf9('0x3c')]=qs[_0x3cf9('0x34')](_[_0x3cf9('0x3d')](_0x2b6bc1[_0x3cf9('0x32')],_0x236375['filters']),_0x46da75);if(_0x2b6bc1['query']['filter']){_0x12dea0[_0x3cf9('0x3c')]=_[_0x3cf9('0x3e')](_0x12dea0[_0x3cf9('0x3c')],{'$or':_[_0x3cf9('0x2c')](_0x46da75,function(_0x3e9cc0){if(_0x3e9cc0[_0x3cf9('0x2f')]!==_0x3cf9('0x3f')){var _0x2bc4d={};_0x2bc4d[_0x3e9cc0[_0x3cf9('0x29')]]={'$like':'%'+_0x2b6bc1['query'][_0x3cf9('0x40')]+'%'};return _0x2bc4d;}})});}_0x12dea0=_['merge']({},_0x12dea0,_0x2b6bc1['options']);var _0x3ec16d={'where':_0x12dea0[_0x3cf9('0x3c')]};return db[_0x3cf9('0x41')][_0x3cf9('0x21')](_0x3ec16d)[_0x3cf9('0x25')](function(_0x44c26d){_0x395428['count']=_0x44c26d;if(_0x2b6bc1[_0x3cf9('0x32')][_0x3cf9('0x42')]){_0x12dea0[_0x3cf9('0x43')]=[{'all':!![]}];}return db[_0x3cf9('0x41')][_0x3cf9('0x44')](_0x12dea0);})[_0x3cf9('0x25')](function(_0x25ed8c){_0x395428[_0x3cf9('0x45')]=_0x25ed8c;return _0x395428;})[_0x3cf9('0x25')](respondWithFilteredResult(_0x152454,_0x12dea0))[_0x3cf9('0x46')](handleError(_0x152454,null));};exports['show']=function(_0xe59204,_0x7ab126){var _0xbd9744={'raw':!![],'where':{'id':_0xe59204[_0x3cf9('0x47')]['id']}},_0x48c2a0={};_0x48c2a0[_0x3cf9('0x31')]=_['keys'](db['SmsApplication'][_0x3cf9('0x2d')]);_0x48c2a0['query']=_[_0x3cf9('0x33')](_0xe59204[_0x3cf9('0x32')]);_0x48c2a0[_0x3cf9('0x34')]=_['intersection'](_0x48c2a0['model'],_0x48c2a0[_0x3cf9('0x32')]);_0xbd9744[_0x3cf9('0x35')]=_[_0x3cf9('0x48')](_0x48c2a0[_0x3cf9('0x31')],qs['fields'](_0xe59204[_0x3cf9('0x32')][_0x3cf9('0x36')]));_0xbd9744['attributes']=_0xbd9744[_0x3cf9('0x35')][_0x3cf9('0x37')]?_0xbd9744[_0x3cf9('0x35')]:_0x48c2a0[_0x3cf9('0x31')];if(_0xe59204[_0x3cf9('0x32')][_0x3cf9('0x42')]){_0xbd9744[_0x3cf9('0x43')]=[{'all':!![]}];}_0xbd9744=_[_0x3cf9('0x3e')]({},_0xbd9744,_0xe59204[_0x3cf9('0x49')]);return db[_0x3cf9('0x41')]['find'](_0xbd9744)[_0x3cf9('0x25')](handleEntityNotFound(_0x7ab126,null))['then'](respondWithResult(_0x7ab126,null))['catch'](handleError(_0x7ab126,null));};exports['create']=function(_0x4fc9e9,_0x3a643d){return db[_0x3cf9('0x41')][_0x3cf9('0x4a')](_0x4fc9e9[_0x3cf9('0x4b')],{})[_0x3cf9('0x25')](respondWithResult(_0x3a643d,0xc9))[_0x3cf9('0x46')](handleError(_0x3a643d,null));};exports[_0x3cf9('0x24')]=function(_0xfd7566,_0x5a4822){if(_0xfd7566['body']['id']){delete _0xfd7566[_0x3cf9('0x4b')]['id'];}return db[_0x3cf9('0x41')]['find']({'where':{'id':_0xfd7566[_0x3cf9('0x47')]['id']}})[_0x3cf9('0x25')](handleEntityNotFound(_0x5a4822,null))[_0x3cf9('0x25')](saveUpdates(_0xfd7566['body'],null))['then'](respondWithResult(_0x5a4822,null))[_0x3cf9('0x46')](handleError(_0x5a4822,null));};exports[_0x3cf9('0x26')]=function(_0x354ba2,_0x4ede11){return db[_0x3cf9('0x41')][_0x3cf9('0x4c')]({'where':{'id':_0x354ba2[_0x3cf9('0x47')]['id']}})['then'](handleEntityNotFound(_0x4ede11,null))[_0x3cf9('0x25')](removeEntity(_0x4ede11,null))[_0x3cf9('0x46')](handleError(_0x4ede11,null));};
\ No newline at end of file
+var _0x562b=['error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end'];(function(_0x8d001e,_0x4fa793){var _0x423818=function(_0x2258f7){while(--_0x2258f7){_0x8d001e['push'](_0x8d001e['shift']());}};_0x423818(++_0x4fa793);}(_0x562b,0x1b7));var _0xb562=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x562b[_0x422905];return _0x33dc6c;};'use strict';var emlformat=require(_0xb562('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb562('0x1'));var jsonpatch=require(_0xb562('0x2'));var rp=require(_0xb562('0x3'));var moment=require(_0xb562('0x4'));var BPromise=require(_0xb562('0x5'));var Mustache=require(_0xb562('0x6'));var util=require(_0xb562('0x7'));var path=require('path');var sox=require(_0xb562('0x8'));var csv=require(_0xb562('0x9'));var ejs=require(_0xb562('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb562('0xb'));var squel=require(_0xb562('0xc'));var crypto=require(_0xb562('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb562('0xe'));var toCsv=require(_0xb562('0x9'));var querystring=require(_0xb562('0xf'));var Papa=require(_0xb562('0x10'));var Redis=require(_0xb562('0x11'));var authService=require(_0xb562('0x12'));var qs=require(_0xb562('0x13'));var as=require(_0xb562('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb562('0x15'))(_0xb562('0x16'));var utils=require(_0xb562('0x17'));var config=require(_0xb562('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb562('0x19'))['db'];function respondWithStatusCode(_0x31ad19,_0x28effd){_0x28effd=_0x28effd||0xcc;return function(_0x5487c7){if(_0x5487c7){return _0x31ad19[_0xb562('0x1a')](_0x28effd);}return _0x31ad19[_0xb562('0x1b')](_0x28effd)['end']();};}function respondWithResult(_0x520e0d,_0x5d6bbd){_0x5d6bbd=_0x5d6bbd||0xc8;return function(_0x186c53){if(_0x186c53){return _0x520e0d['status'](_0x5d6bbd)[_0xb562('0x1c')](_0x186c53);}};}function respondWithFilteredResult(_0xa8cff7,_0x5292bb){return function(_0x499d4b){if(_0x499d4b){var _0x2d5a80=typeof _0x5292bb[_0xb562('0x1d')]===_0xb562('0x1e')&&typeof _0x5292bb[_0xb562('0x1f')]==='undefined';var _0x201a15=_0x499d4b[_0xb562('0x20')];var _0x36232f=_0x2d5a80?0x0:_0x5292bb[_0xb562('0x1d')];var _0x5de69d=_0x2d5a80?_0x499d4b[_0xb562('0x20')]:_0x5292bb['offset']+_0x5292bb[_0xb562('0x1f')];var _0x568cf9;if(_0x5de69d>=_0x201a15){_0x5de69d=_0x201a15;_0x568cf9=0xc8;}else{_0x568cf9=0xce;}_0xa8cff7[_0xb562('0x1b')](_0x568cf9);return _0xa8cff7[_0xb562('0x21')](_0xb562('0x22'),_0x36232f+'-'+_0x5de69d+'/'+_0x201a15)[_0xb562('0x1c')](_0x499d4b);}return null;};}function patchUpdates(_0x17116f){return function(_0x1bfc84){try{jsonpatch['apply'](_0x1bfc84,_0x17116f,!![]);}catch(_0x562d77){return BPromise[_0xb562('0x23')](_0x562d77);}return _0x1bfc84[_0xb562('0x24')]();};}function saveUpdates(_0x1b94d7,_0x44cb98){return function(_0x41c7fe){if(_0x41c7fe){return _0x41c7fe[_0xb562('0x25')](_0x1b94d7)[_0xb562('0x26')](function(_0x1e1e97){return _0x1e1e97;});}return null;};}function removeEntity(_0x24a7f1,_0x112724){return function(_0x5fa8d2){if(_0x5fa8d2){return _0x5fa8d2[_0xb562('0x27')]()[_0xb562('0x26')](function(){_0x24a7f1[_0xb562('0x1b')](0xcc)[_0xb562('0x28')]();});}};}function handleEntityNotFound(_0x46394a,_0x684563){return function(_0x4f4174){if(!_0x4f4174){_0x46394a[_0xb562('0x1a')](0x194);}return _0x4f4174;};}function handleError(_0x4817ed,_0x5e5165){_0x5e5165=_0x5e5165||0x1f4;return function(_0x1bd363){logger[_0xb562('0x29')](_0x1bd363[_0xb562('0x2a')]);if(_0x1bd363[_0xb562('0x2b')]){delete _0x1bd363[_0xb562('0x2b')];}_0x4817ed[_0xb562('0x1b')](_0x5e5165)[_0xb562('0x2c')](_0x1bd363);};}exports[_0xb562('0x2d')]=function(_0x14cf72,_0xa61eac){var _0x2eff23={},_0x29fc03={},_0x41b979={'count':0x0,'rows':[]};var _0x68b71e=_[_0xb562('0x2e')](db[_0xb562('0x2f')][_0xb562('0x30')],function(_0x3d84c6){return{'name':_0x3d84c6[_0xb562('0x31')],'type':_0x3d84c6[_0xb562('0x32')][_0xb562('0x33')]};});_0x29fc03[_0xb562('0x34')]=_[_0xb562('0x2e')](_0x68b71e,'name');_0x29fc03[_0xb562('0x35')]=_['keys'](_0x14cf72['query']);_0x29fc03[_0xb562('0x36')]=_[_0xb562('0x37')](_0x29fc03['model'],_0x29fc03['query']);_0x2eff23['attributes']=_[_0xb562('0x37')](_0x29fc03[_0xb562('0x34')],qs[_0xb562('0x38')](_0x14cf72[_0xb562('0x35')][_0xb562('0x38')]));_0x2eff23['attributes']=_0x2eff23[_0xb562('0x39')]['length']?_0x2eff23[_0xb562('0x39')]:_0x29fc03[_0xb562('0x34')];if(!_0x14cf72[_0xb562('0x35')][_0xb562('0x3a')](_0xb562('0x3b'))){_0x2eff23[_0xb562('0x1f')]=qs[_0xb562('0x1f')](_0x14cf72[_0xb562('0x35')][_0xb562('0x1f')]);_0x2eff23['offset']=qs[_0xb562('0x1d')](_0x14cf72['query'][_0xb562('0x1d')]);}_0x2eff23[_0xb562('0x3c')]=qs[_0xb562('0x3d')](_0x14cf72[_0xb562('0x35')][_0xb562('0x3d')]);_0x2eff23[_0xb562('0x3e')]=qs[_0xb562('0x36')](_[_0xb562('0x3f')](_0x14cf72[_0xb562('0x35')],_0x29fc03[_0xb562('0x36')]),_0x68b71e);if(_0x14cf72[_0xb562('0x35')][_0xb562('0x40')]){_0x2eff23['where']=_[_0xb562('0x41')](_0x2eff23[_0xb562('0x3e')],{'$or':_[_0xb562('0x2e')](_0x68b71e,function(_0x2569df){if(_0x2569df[_0xb562('0x32')]!==_0xb562('0x42')){var _0x841a93={};_0x841a93[_0x2569df[_0xb562('0x2b')]]={'$like':'%'+_0x14cf72[_0xb562('0x35')]['filter']+'%'};return _0x841a93;}})});}_0x2eff23=_[_0xb562('0x41')]({},_0x2eff23,_0x14cf72[_0xb562('0x43')]);var _0x325138={'where':_0x2eff23['where']};return db['SmsApplication'][_0xb562('0x20')](_0x325138)[_0xb562('0x26')](function(_0x3ed267){_0x41b979[_0xb562('0x20')]=_0x3ed267;if(_0x14cf72[_0xb562('0x35')][_0xb562('0x44')]){_0x2eff23[_0xb562('0x45')]=[{'all':!![]}];}return db['SmsApplication'][_0xb562('0x46')](_0x2eff23);})[_0xb562('0x26')](function(_0x41e1f3){_0x41b979[_0xb562('0x47')]=_0x41e1f3;return _0x41b979;})['then'](respondWithFilteredResult(_0xa61eac,_0x2eff23))['catch'](handleError(_0xa61eac,null));};exports[_0xb562('0x48')]=function(_0x31b329,_0x57ab70){var _0x28119a={'raw':!![],'where':{'id':_0x31b329[_0xb562('0x49')]['id']}},_0x59dcfb={};_0x59dcfb[_0xb562('0x34')]=_[_0xb562('0x4a')](db[_0xb562('0x2f')]['rawAttributes']);_0x59dcfb[_0xb562('0x35')]=_['keys'](_0x31b329[_0xb562('0x35')]);_0x59dcfb['filters']=_[_0xb562('0x37')](_0x59dcfb['model'],_0x59dcfb[_0xb562('0x35')]);_0x28119a[_0xb562('0x39')]=_[_0xb562('0x37')](_0x59dcfb[_0xb562('0x34')],qs[_0xb562('0x38')](_0x31b329['query'][_0xb562('0x38')]));_0x28119a[_0xb562('0x39')]=_0x28119a['attributes'][_0xb562('0x4b')]?_0x28119a[_0xb562('0x39')]:_0x59dcfb['model'];if(_0x31b329[_0xb562('0x35')][_0xb562('0x44')]){_0x28119a[_0xb562('0x45')]=[{'all':!![]}];}_0x28119a=_[_0xb562('0x41')]({},_0x28119a,_0x31b329['options']);return db[_0xb562('0x2f')][_0xb562('0x4c')](_0x28119a)['then'](handleEntityNotFound(_0x57ab70,null))['then'](respondWithResult(_0x57ab70,null))[_0xb562('0x4d')](handleError(_0x57ab70,null));};exports[_0xb562('0x4e')]=function(_0x5954e4,_0x5d87c9){return db['SmsApplication'][_0xb562('0x4e')](_0x5954e4['body'],{})[_0xb562('0x26')](respondWithResult(_0x5d87c9,0xc9))['catch'](handleError(_0x5d87c9,null));};exports[_0xb562('0x25')]=function(_0x5dff8c,_0x5a32bc){if(_0x5dff8c[_0xb562('0x4f')]['id']){delete _0x5dff8c['body']['id'];}return db['SmsApplication'][_0xb562('0x4c')]({'where':{'id':_0x5dff8c[_0xb562('0x49')]['id']}})[_0xb562('0x26')](handleEntityNotFound(_0x5a32bc,null))[_0xb562('0x26')](saveUpdates(_0x5dff8c[_0xb562('0x4f')],null))[_0xb562('0x26')](respondWithResult(_0x5a32bc,null))['catch'](handleError(_0x5a32bc,null));};exports[_0xb562('0x27')]=function(_0x198caa,_0xfe1409){return db['SmsApplication'][_0xb562('0x4c')]({'where':{'id':_0x198caa[_0xb562('0x49')]['id']}})[_0xb562('0x26')](handleEntityNotFound(_0xfe1409,null))[_0xb562('0x26')](removeEntity(_0xfe1409,null))[_0xb562('0x4d')](handleError(_0xfe1409,null));};
\ No newline at end of file
index 5985789..d22423e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fc2=['request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','exports','SmsApplication','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird'];(function(_0x37644a,_0x1a223a){var _0x48c516=function(_0x1fa32c){while(--_0x1fa32c){_0x37644a['push'](_0x37644a['shift']());}};_0x48c516(++_0x1a223a);}(_0x7fc2,0xb0));var _0x27fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7fc2[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x27fc('0x0'));var util=require('util');var logger=require(_0x27fc('0x1'))(_0x27fc('0x2'));var moment=require('moment');var BPromise=require(_0x27fc('0x3'));var rp=require(_0x27fc('0x4'));var fs=require('fs');var path=require(_0x27fc('0x5'));var rimraf=require(_0x27fc('0x6'));var config=require(_0x27fc('0x7'));var attributes=require(_0x27fc('0x8'));module[_0x27fc('0x9')]=function(_0x296900,_0x2ce54d){return _0x296900['define'](_0x27fc('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x27fc('0xb')});};
\ No newline at end of file
+var _0xe1bc=['../../config/environment','./smsApplication.attributes','exports','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x20fcf2,_0x32ca81){var _0x40d150=function(_0x123b5f){while(--_0x123b5f){_0x20fcf2['push'](_0x20fcf2['shift']());}};_0x40d150(++_0x32ca81);}(_0xe1bc,0xf4));var _0xce1b=function(_0xc3b481,_0x1398d1){_0xc3b481=_0xc3b481-0x0;var _0x827af7=_0xe1bc[_0xc3b481];return _0x827af7;};'use strict';var _=require('lodash');var util=require(_0xce1b('0x0'));var logger=require(_0xce1b('0x1'))(_0xce1b('0x2'));var moment=require(_0xce1b('0x3'));var BPromise=require(_0xce1b('0x4'));var rp=require(_0xce1b('0x5'));var fs=require('fs');var path=require(_0xce1b('0x6'));var rimraf=require(_0xce1b('0x7'));var config=require(_0xce1b('0x8'));var attributes=require(_0xce1b('0x9'));module[_0xce1b('0xa')]=function(_0x2700a0,_0x286300){return _0x2700a0['define']('SmsApplication',attributes,{'tableName':_0xce1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xce1b('0xc'),'collate':_0xce1b('0xd')});};
\ No newline at end of file
index 31be0a7..51659b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fad=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x6fad,0x17a));var _0xd6fa=function(_0x13518d,_0x5536b0){_0x13518d=_0x13518d-0x0;var _0x1fe3e8=_0x6fad[_0x13518d];return _0x1fe3e8;};'use strict';var _=require(_0xd6fa('0x0'));var util=require(_0xd6fa('0x1'));var moment=require(_0xd6fa('0x2'));var BPromise=require(_0xd6fa('0x3'));var rs=require(_0xd6fa('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6fa('0x6'))('rpc');var config=require(_0xd6fa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd6fa('0x8')][_0xd6fa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ed68a,_0x1d5e36,_0x2f17ae){return new BPromise(function(_0x147e16,_0x163481){return client['request'](_0x2ed68a,_0x2f17ae)[_0xd6fa('0xa')](function(_0x48092f){logger[_0xd6fa('0xb')](_0xd6fa('0xc'),_0x1d5e36,_0xd6fa('0xd'));logger[_0xd6fa('0xe')](_0xd6fa('0xf'),_0x1d5e36,'request\x20sent',JSON['stringify'](_0x48092f));if(_0x48092f[_0xd6fa('0x10')]){if(_0x48092f[_0xd6fa('0x10')][_0xd6fa('0x11')]===0x1f4){logger['error'](_0xd6fa('0xc'),_0x1d5e36,_0x48092f[_0xd6fa('0x10')][_0xd6fa('0x12')]);return _0x163481(_0x48092f[_0xd6fa('0x10')][_0xd6fa('0x12')]);}logger[_0xd6fa('0x10')](_0xd6fa('0xc'),_0x1d5e36,_0x48092f['error'][_0xd6fa('0x12')]);return _0x147e16(_0x48092f['error']['message']);}else{logger[_0xd6fa('0xb')](_0xd6fa('0xc'),_0x1d5e36,'request\x20sent');_0x147e16(_0x48092f[_0xd6fa('0x13')][_0xd6fa('0x12')]);}})['catch'](function(_0x3a9263){logger[_0xd6fa('0x10')](_0xd6fa('0xc'),_0x1d5e36,_0x3a9263);_0x163481(_0x3a9263);});});}
\ No newline at end of file
+var _0xee2c=['jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x814d30,_0x313f75){var _0x1a444c=function(_0x30ce15){while(--_0x30ce15){_0x814d30['push'](_0x814d30['shift']());}};_0x1a444c(++_0x313f75);}(_0xee2c,0x1c7));var _0xcee2=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xee2c[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xcee2('0x0'));var util=require('util');var moment=require(_0xcee2('0x1'));var BPromise=require(_0xcee2('0x2'));var rs=require(_0xcee2('0x3'));var fs=require('fs');var Redis=require(_0xcee2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xcee2('0x5'))(_0xcee2('0x6'));var config=require('../../config/environment');var jayson=require(_0xcee2('0x7'));var client=jayson[_0xcee2('0x8')][_0xcee2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d7611,_0x24ce33,_0x5a8219){return new BPromise(function(_0x52a4ac,_0xea6c3c){return client[_0xcee2('0xa')](_0x3d7611,_0x5a8219)[_0xcee2('0xb')](function(_0x23dd44){logger[_0xcee2('0xc')](_0xcee2('0xd'),_0x24ce33,_0xcee2('0xe'));logger[_0xcee2('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x24ce33,_0xcee2('0xe'),JSON[_0xcee2('0x10')](_0x23dd44));if(_0x23dd44[_0xcee2('0x11')]){if(_0x23dd44[_0xcee2('0x11')][_0xcee2('0x12')]===0x1f4){logger['error'](_0xcee2('0xd'),_0x24ce33,_0x23dd44['error']['message']);return _0xea6c3c(_0x23dd44['error'][_0xcee2('0x13')]);}logger[_0xcee2('0x11')](_0xcee2('0xd'),_0x24ce33,_0x23dd44[_0xcee2('0x11')]['message']);return _0x52a4ac(_0x23dd44[_0xcee2('0x11')][_0xcee2('0x13')]);}else{logger[_0xcee2('0xc')](_0xcee2('0xd'),_0x24ce33,_0xcee2('0xe'));_0x52a4ac(_0x23dd44[_0xcee2('0x14')][_0xcee2('0x13')]);}})[_0xcee2('0x15')](function(_0x45c680){logger['error'](_0xcee2('0xd'),_0x24ce33,_0x45c680);_0xea6c3c(_0x45c680);});});}
\ No newline at end of file
index 0565801..a702e3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4a2=['isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','download','create','post','addMessage','/:id/tags','sms','addTags','put','update','tracked','removeTags','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','get'];(function(_0x569f80,_0x15a43a){var _0x502b0c=function(_0x5cf6ca){while(--_0x5cf6ca){_0x569f80['push'](_0x569f80['shift']());}};_0x502b0c(++_0x15a43a);}(_0xd4a2,0x173));var _0x2d4a=function(_0x497c41,_0x1c0955){_0x497c41=_0x497c41-0x0;var _0x37e8b8=_0xd4a2[_0x497c41];return _0x37e8b8;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0x6')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0x6')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x2d4a('0xf')]);router['post']('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x10')]);router[_0x2d4a('0x11')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x12')]);router[_0x2d4a('0x11')](_0x2d4a('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x2d4a('0x14'),'smsinteraction:addtags'),controller[_0x2d4a('0x15')]);router[_0x2d4a('0x16')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),interaction['tracked'](_0x2d4a('0x14'),'smsinteraction:update'),controller[_0x2d4a('0x17')]);router['delete'](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),interaction[_0x2d4a('0x18')](_0x2d4a('0x14'),'smsinteraction:destroy'),controller['destroy']);router['delete'](_0x2d4a('0x13'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x19')]);module[_0x2d4a('0x1a')]=router;
\ No newline at end of file
+var _0x4fc2=['removeTags','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','tracked','smsinteraction:destroy','destroy'];(function(_0x44715f,_0x7e0407){var _0x43c903=function(_0x2921af){while(--_0x2921af){_0x44715f['push'](_0x44715f['shift']());}};_0x43c903(++_0x7e0407);}(_0x4fc2,0x111));var _0x24fc=function(_0x1182bd,_0x52ebf2){_0x1182bd=_0x1182bd-0x0;var _0x5c868b=_0x4fc2[_0x1182bd];return _0x5c868b;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['show']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0xd')](_0x24fc('0x11'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router['post']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x13')]);router['post'](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x14')]);router[_0x24fc('0x15')](_0x24fc('0x16'),auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x18')),controller[_0x24fc('0x19')]);router[_0x24fc('0x1a')]('/:id',auth[_0x24fc('0x9')](),interaction['tracked'](_0x24fc('0x17'),_0x24fc('0x1b')),controller[_0x24fc('0x1c')]);router[_0x24fc('0x1d')](_0x24fc('0xe'),auth['isAuthenticated'](),interaction[_0x24fc('0x1e')](_0x24fc('0x17'),_0x24fc('0x1f')),controller[_0x24fc('0x20')]);router['delete'](_0x24fc('0x16'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x21')]);module['exports']=router;
\ No newline at end of file
index c802eea..5d33787 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3148=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x3148,0x1d3));var _0x8314=function(_0x3e56f6,_0xa7a02d){_0x3e56f6=_0x3e56f6-0x0;var _0x3a32f=_0x3148[_0x3e56f6];return _0x3a32f;};'use strict';var Sequelize=require(_0x8314('0x0'));var moment=require(_0x8314('0x1'));module['exports']={'closed':{'type':Sequelize[_0x8314('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x8314('0x3')]},'disposition':{'type':Sequelize[_0x8314('0x4')]},'secondDisposition':{'type':Sequelize[_0x8314('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x8314('0x4')]},'phone':{'type':Sequelize[_0x8314('0x4')]},'read1stAt':{'type':Sequelize[_0x8314('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x8314('0x5')]('in',_0x8314('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x8314('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x8314('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x8314('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x37c5=['exports','BOOLEAN','DATE','STRING','out','ENUM','moment'];(function(_0x304770,_0x1cc7f6){var _0x78292d=function(_0x4f7a8d){while(--_0x4f7a8d){_0x304770['push'](_0x304770['shift']());}};_0x78292d(++_0x1cc7f6);}(_0x37c5,0xa7));var _0x537c=function(_0x1cc9c0,_0x5e32c3){_0x1cc9c0=_0x1cc9c0-0x0;var _0x1bd5a0=_0x37c5[_0x1cc9c0];return _0x1bd5a0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x537c('0x0'));module[_0x537c('0x1')]={'closed':{'type':Sequelize[_0x537c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x537c('0x3')]},'disposition':{'type':Sequelize[_0x537c('0x4')]},'secondDisposition':{'type':Sequelize[_0x537c('0x4')]},'thirdDisposition':{'type':Sequelize[_0x537c('0x4')]},'note':{'type':Sequelize[_0x537c('0x4')]},'phone':{'type':Sequelize[_0x537c('0x4')]},'read1stAt':{'type':Sequelize[_0x537c('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x537c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x537c('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x537c('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x537c('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 698eeae..6b13f9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1053=['mustache','sox','to-csv','ejs','fs-extra','squel','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','Users','map','fullname','TagIds','Tags','forEach','push','rawAttributes','fieldName','type','key','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','select','field','color','tools_tags','u.id','u.fullname','from','user_has_sms_interactions','users','u.id\x20=\x20ui.UserId','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','find','unreadMessages','value','`\x20=\x200','having','`\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?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','UserId','body','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','contactName','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','catch','show','params','model','include','options','create','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','download','unix','join','tmp','root','server','User','firstName','secret','SmsAccount','Account','Owner','get','Sms','closed','closedAt','disposition','Messages','direction','System','lastName','renderFile','views','downloadInteraction.ejs','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x4f8572,_0x4b0790){var _0x205cd3=function(_0x44747a){while(--_0x44747a){_0x4f8572['push'](_0x4f8572['shift']());}};_0x205cd3(++_0x4b0790);}(_0x1053,0xd5));var _0x3105=function(_0x187193,_0x24e49d){_0x187193=_0x187193-0x0;var _0x5002aa=_0x1053[_0x187193];return _0x5002aa;};'use strict';var emlformat=require(_0x3105('0x0'));var rimraf=require(_0x3105('0x1'));var zipdir=require(_0x3105('0x2'));var jsonpatch=require(_0x3105('0x3'));var rp=require(_0x3105('0x4'));var moment=require(_0x3105('0x5'));var BPromise=require(_0x3105('0x6'));var Mustache=require(_0x3105('0x7'));var util=require('util');var path=require('path');var sox=require(_0x3105('0x8'));var csv=require(_0x3105('0x9'));var ejs=require(_0x3105('0xa'));var fs=require('fs');var fs_extra=require(_0x3105('0xb'));var _=require('lodash');var squel=require(_0x3105('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3105('0x9'));var querystring=require('querystring');var Papa=require(_0x3105('0xd'));var Redis=require(_0x3105('0xe'));var authService=require(_0x3105('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require(_0x3105('0x10'));var logger=require('../../config/logger')(_0x3105('0x11'));var utils=require(_0x3105('0x12'));var config=require(_0x3105('0x13'));var licenseUtil=require(_0x3105('0x14'));var db=require(_0x3105('0x15'))['db'];config[_0x3105('0x16')]=_['defaults'](config['redis'],{'host':_0x3105('0x17'),'port':0x18eb});var socket=require(_0x3105('0x18'))(new Redis(config[_0x3105('0x16')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x238026,_0x1e868d){_0x1e868d=_0x1e868d||0xcc;return function(_0xb63460){if(_0xb63460){return _0x238026[_0x3105('0x19')](_0x1e868d);}return _0x238026[_0x3105('0x1a')](_0x1e868d)[_0x3105('0x1b')]();};}function respondWithResult(_0x51ef4e,_0x35f8a3){_0x35f8a3=_0x35f8a3||0xc8;return function(_0x2a3483){if(_0x2a3483){return _0x51ef4e[_0x3105('0x1a')](_0x35f8a3)[_0x3105('0x1c')](_0x2a3483);}};}function respondWithFilteredResult(_0x5a9747,_0x439617){return function(_0x1b73c2){if(_0x1b73c2){var _0x2dc7ce=typeof _0x439617[_0x3105('0x1d')]===_0x3105('0x1e')&&typeof _0x439617[_0x3105('0x1f')]===_0x3105('0x1e');var _0x4eb676=_0x1b73c2['count'];var _0x2e211c=_0x2dc7ce?0x0:_0x439617[_0x3105('0x1d')];var _0x47b22b=_0x2dc7ce?_0x1b73c2[_0x3105('0x20')]:_0x439617[_0x3105('0x1d')]+_0x439617['limit'];var _0x7f4ad3;if(_0x47b22b>=_0x4eb676){_0x47b22b=_0x4eb676;_0x7f4ad3=0xc8;}else{_0x7f4ad3=0xce;}_0x5a9747[_0x3105('0x1a')](_0x7f4ad3);return _0x5a9747[_0x3105('0x21')](_0x3105('0x22'),_0x2e211c+'-'+_0x47b22b+'/'+_0x4eb676)[_0x3105('0x1c')](_0x1b73c2);}return null;};}function patchUpdates(_0x5ed04d){return function(_0x9bce80){try{jsonpatch[_0x3105('0x23')](_0x9bce80,_0x5ed04d,!![]);}catch(_0x1265ac){return BPromise[_0x3105('0x24')](_0x1265ac);}return _0x9bce80['save']();};}function saveUpdates(_0x27ad20,_0xd2df17){return function(_0x3b568b){if(_0x3b568b){return _0x3b568b[_0x3105('0x25')](_0x27ad20)[_0x3105('0x26')](function(_0x31cab5){return _0x31cab5;});}return null;};}function removeEntity(_0x45d2ad,_0x4740cd){return function(_0x6cb5ae){if(_0x6cb5ae){return _0x6cb5ae[_0x3105('0x27')]()[_0x3105('0x26')](function(){_0x45d2ad[_0x3105('0x1a')](0xcc)[_0x3105('0x1b')]();});}};}function handleEntityNotFound(_0x46c6f8,_0x4b7764){return function(_0x41bfc4){if(!_0x41bfc4){_0x46c6f8['sendStatus'](0x194);}return _0x41bfc4;};}function handleError(_0x4ae747,_0x3d9391){_0x3d9391=_0x3d9391||0x1f4;return function(_0x7f0b9c){logger[_0x3105('0x28')](_0x7f0b9c[_0x3105('0x29')]);if(_0x7f0b9c[_0x3105('0x2a')]){delete _0x7f0b9c[_0x3105('0x2a')];}_0x4ae747['status'](_0x3d9391)['send'](_0x7f0b9c);};}function getInteractionUsers(_0x111430,_0x1856c2){return new BPromise(function(_0x35f718,_0x47a4be){try{if(_0x1856c2[_0x111430['id']]){_0x111430[_0x3105('0x2b')]=_[_0x3105('0x2c')](_0x1856c2[_0x111430['id']],function(_0x3bb309){return{'id':_0x3bb309['id'],'fullname':_0x3bb309[_0x3105('0x2d')]};});}}catch(_0x4d2e14){_0x47a4be(_0x4d2e14);}_0x35f718(_0x111430);});}function getInteractionTags(_0x1aa87e,_0x38b9fb){return new BPromise(function(_0x3d9ce7,_0x30bf14){try{if(_0x1aa87e[_0x3105('0x2e')]){_0x1aa87e[_0x3105('0x2f')]=[];_0x1aa87e[_0x3105('0x2e')]['split'](',')[_0x3105('0x30')](function(_0x1f4fbd){_0x1aa87e[_0x3105('0x2f')][_0x3105('0x31')](_0x38b9fb[_0x1f4fbd]);});}delete _0x1aa87e[_0x3105('0x2e')];}catch(_0x492de9){_0x30bf14(_0x492de9);}_0x3d9ce7(_0x1aa87e);});}function updateSmsInteraction(_0x34493f,_0x1f2347,_0x38bc21){return new BPromise(function(_0x3820f5,_0xa11a7b){return getInteractionUsers(_0x34493f,_0x38bc21)[_0x3105('0x26')](function(_0x5a41eb){return getInteractionTags(_0x5a41eb,_0x1f2347);})[_0x3105('0x26')](function(_0x2b7af7){_0x3820f5(_0x2b7af7);})['catch'](function(_0x2ed8ae){_0xa11a7b(_0x2ed8ae);});});}exports['index']=function(_0x362686,_0x1407b2){var _0x369464={},_0x43ec06={},_0x29a9b4={'count':0x0,'rows':[]};var _0x152685=_[_0x3105('0x2c')](db['SmsInteraction'][_0x3105('0x32')],function(_0x559643){return{'name':_0x559643[_0x3105('0x33')],'type':_0x559643[_0x3105('0x34')][_0x3105('0x35')]};});_0x43ec06['model']=_['map'](_0x152685,_0x3105('0x2a'));_0x43ec06[_0x3105('0x36')]=_[_0x3105('0x37')](_0x362686[_0x3105('0x36')]);_0x43ec06[_0x3105('0x38')]=_['intersection'](_0x43ec06['model'],_0x43ec06[_0x3105('0x36')]);_0x369464[_0x3105('0x39')]=_[_0x3105('0x3a')](_0x43ec06['model'],qs[_0x3105('0x3b')](_0x362686[_0x3105('0x36')][_0x3105('0x3b')]));_0x369464[_0x3105('0x39')]=_0x369464[_0x3105('0x39')][_0x3105('0x3c')]?_0x369464['attributes']:_0x43ec06['model'];if(!_0x362686[_0x3105('0x36')][_0x3105('0x3d')](_0x3105('0x3e'))){_0x369464[_0x3105('0x1f')]=qs[_0x3105('0x1f')](_0x362686[_0x3105('0x36')][_0x3105('0x1f')]);_0x369464[_0x3105('0x1d')]=qs['offset'](_0x362686[_0x3105('0x36')][_0x3105('0x1d')]);}_0x369464['order']=qs[_0x3105('0x3f')](_0x362686[_0x3105('0x36')][_0x3105('0x3f')]);_0x369464['where']=qs['filters'](_[_0x3105('0x40')](_0x362686['query'],_0x43ec06['filters']),_0x152685);var _0x3b1276=[];var _0x4e1b2e=squel[_0x3105('0x41')]()['field']('id')[_0x3105('0x42')](_0x3105('0x2a'))[_0x3105('0x42')](_0x3105('0x43'))['from'](_0x3105('0x44'));var _0x3d01db=squel['select']()[_0x3105('0x42')](_0x3105('0x45'))['field'](_0x3105('0x46'))[_0x3105('0x42')]('ui.SmsInteractionId')[_0x3105('0x47')](_0x3105('0x48'),'ui')['left_join'](_0x3105('0x49'),'u',_0x3105('0x4a'));var _0x3e1224=squel[_0x3105('0x41')]()[_0x3105('0x47')]('sms_interactions','i')[_0x3105('0x4b')](_0x3105('0x4c'),'c',_0x3105('0x4d'))[_0x3105('0x4b')](_0x3105('0x49'),'o',_0x3105('0x4e'))[_0x3105('0x4b')]('sms_accounts','a',_0x3105('0x4f'))[_0x3105('0x4b')]('sms_messages','me',_0x3105('0x50'))[_0x3105('0x4b')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')[_0x3105('0x4b')]('tools_tags','t',_0x3105('0x51'));var _0x260492=squel[_0x3105('0x52')]();var _0x29ae57=[];var _0x28a24a=squel[_0x3105('0x52')]();var _0x368575;if(_0x362686[_0x3105('0x36')][_0x3105('0x53')]){_0x368575=as[_0x3105('0x54')](_0x362686[_0x3105('0x36')][_0x3105('0x53')]);var _0x151615=_0x368575[_0x3105('0x55')];for(var _0x1045a9=0x0;_0x1045a9<_0x368575['conditions'][_0x3105('0x3c')];_0x1045a9++){var _0x4c4dee=_0x368575['conditions'][_0x1045a9];var _0x8c36c5='i';var _0x2f9b92=_[_0x3105('0x56')](_0x152685,[_0x3105('0x2a'),_0x4c4dee[_0x3105('0x42')]]);if(!_0x2f9b92){switch(_0x4c4dee[_0x3105('0x42')]){case _0x3105('0x57'):if(_0x4c4dee[_0x3105('0x58')]==0x1){_0x3e1224['having']('`'+_0x4c4dee[_0x3105('0x42')]+_0x3105('0x59'));}else{_0x3e1224[_0x3105('0x5a')]('`'+_0x4c4dee[_0x3105('0x42')]+_0x3105('0x5b'));}break;case _0x3105('0x5c'):if(_0x4c4dee[_0x3105('0x5d')]==='$substring'){if(_0x4c4dee[_0x3105('0x58')][_0x3105('0x5e')]('\x20')[_0x3105('0x3c')]>0x1){_0x260492[_0x151615](_0x3105('0x5f'),qs['getFullTextValue'](_0x4c4dee['value']),null);}else{var _0x3327ae='%'+_0x4c4dee['value']+'%';_0x260492[_0x151615](_0x3105('0x60'),_0x3327ae,_0x3327ae,_0x3327ae);}}else{_0x2f9b92=_[_0x3105('0x56')](_0x152685,[_0x3105('0x2a'),_0x3105('0x61')]);_0x4c4dee[_0x3105('0x42')]=_0x3105('0x61');_0x52dbec=as[_0x3105('0x62')](_0x8c36c5,_0x2f9b92[_0x3105('0x34')],_0x4c4dee);_0x260492[_0x151615](_0x52dbec[_0x3105('0x63')],_0x52dbec[_0x3105('0x58')][_0x3105('0x64')],_0x52dbec['value'][_0x3105('0x1b')]);}break;case'Tag':var _0x418eba=_0x4c4dee[_0x3105('0x58')][_0x3105('0x5e')](',')['map'](function(_0x3e5df1){return Number(_0x3e5df1);});_0x418eba[_0x3105('0x30')](function(_0x51e7ec){_0x28a24a['or'](_0x3105('0x65'),'%,'+_0x51e7ec+',%');});_0x29ae57=_[_0x3105('0x66')](_0x29ae57,_0x418eba);break;case'User':if(_0x4c4dee[_0x3105('0x5d')]===_0x3105('0x67')){_0x260492[_0x151615]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4c4dee[_0x3105('0x58')]+'%',null);}else{_0x2f9b92=_[_0x3105('0x56')](_0x152685,[_0x3105('0x2a'),_0x3105('0x68')]);_0x4c4dee[_0x3105('0x42')]='UserId';_0x52dbec=as[_0x3105('0x62')](_0x8c36c5,_0x2f9b92['type'],_0x4c4dee);_0x260492[_0x151615](_0x52dbec[_0x3105('0x63')],_0x52dbec[_0x3105('0x58')][_0x3105('0x64')],_0x52dbec[_0x3105('0x58')][_0x3105('0x1b')]);}break;case _0x3105('0x69'):_0x52dbec=as[_0x3105('0x62')]('me',null,_0x4c4dee);_0x260492[_0x151615](_0x52dbec[_0x3105('0x63')],_0x52dbec['value'][_0x3105('0x64')],_0x52dbec['value'][_0x3105('0x1b')]);break;}}else{var _0x52dbec=as['buildExpression'](_0x8c36c5,_0x2f9b92[_0x3105('0x34')],_0x4c4dee);_0x260492[_0x151615](_0x52dbec[_0x3105('0x63')],_0x52dbec[_0x3105('0x58')]['start'],_0x52dbec[_0x3105('0x58')][_0x3105('0x1b')]);}}}else{var _0x35b2ef=_(_0x362686['query'])[_0x3105('0x37')]()[_0x3105('0x2c')](function(_0x254f89){return _[_0x3105('0x6a')](_0x152685,[_0x3105('0x2a'),_0x254f89])?_0x254f89:undefined;})[_0x3105('0x6b')]()['value']();if(!_[_0x3105('0x6c')](_0x35b2ef)){_0x35b2ef['forEach'](function(_0xd4ac0f){if(_0xd4ac0f===_0x3105('0x6d')){_0x3e1224[_0x3105('0x6e')](_0x3105('0x6f'),[]['concat'](_0x362686[_0x3105('0x36')][_0xd4ac0f]));}else if(_0xd4ac0f===_0x3105('0x70')){var _0x411689=JSON[_0x3105('0x71')](_0x362686[_0x3105('0x36')][_0xd4ac0f])['$gte'];var _0x1d04b7=JSON['parse'](_0x362686[_0x3105('0x36')][_0xd4ac0f])[_0x3105('0x72')];_0x3e1224[_0x3105('0x6e')](_0x3105('0x73'),_0x411689,_0x1d04b7);}else{if(_0x362686['query'][_0xd4ac0f]==='null'){_0x3e1224[_0x3105('0x6e')]('i.'+_0xd4ac0f+_0x3105('0x74'));}else{_0x3e1224[_0x3105('0x6e')]('i.'+_0xd4ac0f+_0x3105('0x75'),_0x362686['query'][_0xd4ac0f]);}}});}if(_0x362686[_0x3105('0x36')][_0x3105('0x76')]){if(_0x362686[_0x3105('0x36')][_0x3105('0x76')]==0x1){_0x3e1224[_0x3105('0x5a')](_0x3105('0x77'));}else{_0x3e1224[_0x3105('0x5a')](_0x3105('0x78'));}}if(_0x362686[_0x3105('0x36')][_0x3105('0x79')]){_0x29ae57=_['isArray'](_0x362686['query']['tag'])?_0x362686[_0x3105('0x36')][_0x3105('0x79')]:new Array(_0x362686['query'][_0x3105('0x79')]);_0x29ae57[_0x3105('0x30')](function(_0x78c390){_0x28a24a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x78c390+',%');});}if(_0x362686['query']['filter']){var _0x479521=_0x362686['query'][_0x3105('0x7a')][_0x3105('0x7b')]('\x5c','\x5c\x5c')[_0x3105('0x7b')](/'/g,'\x27\x27');if(qs[_0x3105('0x7c')](_0x479521)){_0x260492['or'](_0x3105('0x7d'),_0x479521+'%')['or']('i.phone\x20LIKE\x20?',_0x479521+'%');}else{_0x260492['or'](_0x3105('0x7e'),qs['getFullTextValue'](_0x479521))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x479521+'%');}}}_0x3e1224[_0x3105('0x6e')](_0x260492);_0x3e1224[_0x3105('0x7f')](_0x3105('0x80'));var _0x19d293={'type':db[_0x3105('0x81')]['QueryTypes'][_0x3105('0x82')],'raw':!![]};var _0x45ca2f=_0x3e1224[_0x3105('0x83')]();_0x45ca2f[_0x3105('0x42')](_0x3105('0x80'));_0x45ca2f[_0x3105('0x42')](_0x3105('0x84'),_0x3105('0x57'));if(_0x369464[_0x3105('0x85')]){_0x369464['order'][_0x3105('0x30')](function(_0x563140){var _0x3aa7d8=_0x563140[0x0]==='contactName'?_0x563140[0x0]:'i.'+_0x563140[0x0];_0x3e1224[_0x3105('0x85')](_0x3aa7d8,_0x563140[0x1]===_0x3105('0x86')?![]:!![]);});}if(!_[_0x3105('0x6c')](_0x29ae57)){_0x3e1224[_0x3105('0x5a')](_0x28a24a);_0x45ca2f[_0x3105('0x6e')](_0x3105('0x87'),_0x29ae57);}BPromise[_0x3105('0x88')]()[_0x3105('0x26')](function(){if(!_0x368575){if(_0x362686[_0x3105('0x36')]['SmsAccountId'])return;_0x45ca2f[_0x3105('0x6e')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x3e1224['where'](_0x3105('0x89'));return;}if(_0x362686[_0x3105('0x8a')][_0x3105('0x8b')]!=='agent')return;return _0x362686[_0x3105('0x8a')][_0x3105('0x8c')]({'attributes':['id'],'raw':!![]})[_0x3105('0x26')](function(_0x54baab){if(_['isEmpty'](_0x54baab)){_0x45ca2f[_0x3105('0x6e')](_0x3105('0x8d'));_0x3e1224[_0x3105('0x6e')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x45ca2f['where'](_0x3105('0x6f'),_[_0x3105('0x2c')](_0x54baab,'id'));_0x3e1224[_0x3105('0x6e')](_0x3105('0x6f'),_[_0x3105('0x2c')](_0x54baab,'id'));}});})[_0x3105('0x26')](function(){if(_0x362686['user'][_0x3105('0x8b')]==='agent'&&!_0x368575&&!_0x362686[_0x3105('0x36')][_0x3105('0x6d')])return[];return db[_0x3105('0x8e')][_0x3105('0x36')](_0x45ca2f[_0x3105('0x8f')](),_0x19d293);})['then'](function(_0xfb396f){_0x29a9b4['count']=_0xfb396f[_0x3105('0x3c')];if(_0x29a9b4[_0x3105('0x20')]===0x0)return[];return db[_0x3105('0x8e')][_0x3105('0x36')](_0x4e1b2e[_0x3105('0x8f')](),_0x19d293)[_0x3105('0x26')](function(_0x34af0a){_0x3b1276=_[_0x3105('0x90')](_0x34af0a,'id');_0x19d293=_[_0x3105('0x91')](_0x19d293,{'model':db[_0x3105('0x92')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x362686[_0x3105('0x36')][_0x3105('0x3b')]){_0x369464[_0x3105('0x39')][_0x3105('0x30')](function(_0xf477f){_0x3e1224[_0x3105('0x42')]('i.'+_0xf477f);});}else{_0x3e1224['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x3105('0x57'));_0x3e1224[_0x3105('0x42')](_0x3105('0x93'),_0x3105('0x94'));_0x3e1224[_0x3105('0x42')](_0x3105('0x95'),'Account.mandatoryDisposition');_0x3e1224[_0x3105('0x42')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x3105('0x96'));_0x3e1224[_0x3105('0x42')]('i.*');_0x3e1224[_0x3105('0x42')](_0x3105('0x97'),'Contact.firstName');_0x3e1224[_0x3105('0x42')](_0x3105('0x98'),_0x3105('0x99'));_0x3e1224[_0x3105('0x42')]('c.email',_0x3105('0x9a'));_0x3e1224['field'](_0x3105('0x9b'),_0x3105('0x9c'));_0x3e1224[_0x3105('0x42')]('c.mobile','Contact.mobile');_0x3e1224[_0x3105('0x42')]('c.fax',_0x3105('0x9d'));_0x3e1224[_0x3105('0x42')](_0x3105('0x9e'),_0x3105('0x9f'));_0x3e1224[_0x3105('0x42')](_0x3105('0xa0'),_0x3105('0xa1'));_0x3e1224[_0x3105('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x3105('0x2e'));}if(_0x369464[_0x3105('0x1f')])_0x3e1224['limit'](_0x369464[_0x3105('0x1f')]);if(_0x369464['offset'])_0x3e1224[_0x3105('0x1d')](_0x369464[_0x3105('0x1d')]);return db[_0x3105('0x8e')][_0x3105('0x36')](_0x3e1224[_0x3105('0x8f')](),_0x19d293);})['then'](function(_0x34fd6c){if(_0x34fd6c[_0x3105('0x3c')]>0x0)_0x3d01db[_0x3105('0x6e')](_0x3105('0xa2'),_[_0x3105('0x2c')](_0x34fd6c,'id'));return db['sequelize'][_0x3105('0x36')](_0x3d01db[_0x3105('0x8f')](),_0x19d293)['then'](function(_0x3148b0){var _0x439beb=_[_0x3105('0xa3')](_0x3148b0,_0x3105('0xa4'));var _0x2e18ac=[];_0x34fd6c['forEach'](function(_0x340e9a){_0x2e18ac['push'](updateSmsInteraction(_0x340e9a,_0x3b1276,_0x439beb));});return BPromise[_0x3105('0xa5')](_0x2e18ac);});});})[_0x3105('0x26')](function(_0x7c8526){_0x29a9b4[_0x3105('0xa6')]=_0x7c8526;return _0x29a9b4;})[_0x3105('0x26')](respondWithFilteredResult(_0x1407b2,_0x369464))[_0x3105('0xa7')](handleError(_0x1407b2,null));};exports[_0x3105('0xa8')]=function(_0x127204,_0x35dfd8){var _0x3323f2={'raw':![],'where':{'id':_0x127204[_0x3105('0xa9')]['id']}},_0x21f46e={};_0x21f46e[_0x3105('0xaa')]=_[_0x3105('0x37')](db[_0x3105('0x92')][_0x3105('0x32')]);_0x21f46e[_0x3105('0x36')]=_[_0x3105('0x37')](_0x127204['query']);_0x21f46e[_0x3105('0x38')]=_['intersection'](_0x21f46e[_0x3105('0xaa')],_0x21f46e[_0x3105('0x36')]);_0x3323f2['attributes']=_[_0x3105('0x3a')](_0x21f46e['model'],qs[_0x3105('0x3b')](_0x127204[_0x3105('0x36')][_0x3105('0x3b')]));_0x3323f2[_0x3105('0x39')]=_0x3323f2['attributes'][_0x3105('0x3c')]?_0x3323f2[_0x3105('0x39')]:_0x21f46e[_0x3105('0xaa')];if(_0x127204['query']['includeAll']){_0x3323f2[_0x3105('0xab')]=[{'all':!![]}];}_0x3323f2=_[_0x3105('0x91')]({},_0x3323f2,_0x127204[_0x3105('0xac')]);return db[_0x3105('0x92')]['find'](_0x3323f2)[_0x3105('0x26')](handleEntityNotFound(_0x35dfd8,null))[_0x3105('0x26')](respondWithResult(_0x35dfd8,null))[_0x3105('0xa7')](handleError(_0x35dfd8,null));};exports[_0x3105('0xad')]=function(_0x54823f,_0x5d7d19){return db['SmsInteraction'][_0x3105('0xad')](_0x54823f[_0x3105('0x69')],{})['then'](respondWithResult(_0x5d7d19,0xc9))[_0x3105('0xa7')](handleError(_0x5d7d19,null));};exports[_0x3105('0x25')]=function(_0x19d5e7,_0x1c417b){if(_0x19d5e7['body']['id']){delete _0x19d5e7[_0x3105('0x69')]['id'];}return db[_0x3105('0x92')]['find']({'where':{'id':_0x19d5e7[_0x3105('0xa9')]['id']}})[_0x3105('0x26')](handleEntityNotFound(_0x1c417b,null))[_0x3105('0x26')](saveUpdates(_0x19d5e7[_0x3105('0x69')],null))[_0x3105('0x26')](respondWithResult(_0x1c417b,null))['catch'](handleError(_0x1c417b,null));};exports[_0x3105('0x27')]=function(_0x16bbff,_0x3a4b2f){return db[_0x3105('0x92')][_0x3105('0x56')]({'where':{'id':_0x16bbff[_0x3105('0xa9')]['id']}})['then'](handleEntityNotFound(_0x3a4b2f,null))['then'](removeEntity(_0x3a4b2f,null))['catch'](handleError(_0x3a4b2f,null));};exports['describe']=function(_0x17e49a,_0x2095d4){return db['SmsInteraction'][_0x3105('0xae')]()[_0x3105('0x26')](respondWithResult(_0x2095d4,null))[_0x3105('0xa7')](handleError(_0x2095d4,null));};exports[_0x3105('0xaf')]=function(_0x3b0f36,_0x5cdf57,_0x17932a){return db[_0x3105('0xb0')][_0x3105('0x56')]({'where':{'id':_0x3b0f36[_0x3105('0xa9')]['id']}})[_0x3105('0x26')](handleEntityNotFound(_0x5cdf57,null))[_0x3105('0x26')](function(_0x3c8801){if(_0x3c8801){return _0x3c8801[_0x3105('0xaf')](_0x3b0f36[_0x3105('0x69')][_0x3105('0xb1')],_[_0x3105('0xb2')](_0x3b0f36[_0x3105('0x69')],[_0x3105('0xb1'),'id'])||{});}})[_0x3105('0x26')](respondWithResult(_0x5cdf57,null))['catch'](handleError(_0x5cdf57,null));};exports[_0x3105('0xb3')]=function(_0x2949e1,_0x474ed5,_0xfc9938){var _0x30bb35={'raw':![],'where':{}};var _0x3f3aec={};var _0x5deeb1={'count':0x0,'rows':[]};return db[_0x3105('0x92')][_0x3105('0xb4')]({'where':{'id':_0x2949e1[_0x3105('0xa9')]['id']}})['then'](handleEntityNotFound(_0x474ed5,null))[_0x3105('0x26')](function(_0xacc844){if(_0xacc844){_0x3f3aec[_0x3105('0xaa')]=_[_0x3105('0x37')](db[_0x3105('0xb0')][_0x3105('0x32')]);_0x3f3aec['query']=_['keys'](_0x2949e1[_0x3105('0x36')]);_0x3f3aec[_0x3105('0x38')]=_[_0x3105('0x3a')](_0x3f3aec[_0x3105('0xaa')],_0x3f3aec[_0x3105('0x36')]);_0x30bb35[_0x3105('0x39')]=_[_0x3105('0x3a')](_0x3f3aec[_0x3105('0xaa')],qs[_0x3105('0x3b')](_0x2949e1[_0x3105('0x36')][_0x3105('0x3b')]));_0x30bb35[_0x3105('0x39')]=_0x30bb35['attributes'][_0x3105('0x3c')]?_0x30bb35[_0x3105('0x39')]:_0x3f3aec['model'];if(!_0x2949e1[_0x3105('0x36')][_0x3105('0x3d')](_0x3105('0x3e'))){_0x30bb35[_0x3105('0x1f')]=qs['limit'](_0x2949e1[_0x3105('0x36')][_0x3105('0x1f')]);_0x30bb35[_0x3105('0x1d')]=qs[_0x3105('0x1d')](_0x2949e1[_0x3105('0x36')]['offset']);}_0x30bb35[_0x3105('0x85')]=qs[_0x3105('0x3f')](_0x2949e1[_0x3105('0x36')][_0x3105('0x3f')]);_0x30bb35[_0x3105('0x6e')]=qs[_0x3105('0x38')](_[_0x3105('0x40')](_0x2949e1['query'],_0x3f3aec[_0x3105('0x38')]));_0x30bb35['where'][_0x3105('0xa4')]=_0xacc844['id'];if(_0x2949e1[_0x3105('0x36')]['filter']){_0x30bb35[_0x3105('0x6e')]=_[_0x3105('0x91')](_0x30bb35[_0x3105('0x6e')],{'$or':_[_0x3105('0x2c')](_0x30bb35['attributes'],function(_0x311b7b){var _0xc54c4={};_0xc54c4[_0x311b7b]={'$like':'%'+_0x2949e1[_0x3105('0x36')][_0x3105('0x7a')]+'%'};return _0xc54c4;})});}if(_0x2949e1[_0x3105('0x36')][_0x3105('0xb5')]){var _0x4a1740=_0x2949e1['query'][_0x3105('0xb5')][_0x3105('0x5e')](',');var _0xb508a5={};_0xb508a5[_0x4a1740[0x0]]={'$gte':moment(_0x4a1740[0x1])[_0x3105('0xb6')](_0x3105('0xb7'))};_0x30bb35[_0x3105('0x6e')]=_[_0x3105('0x91')](_0x30bb35[_0x3105('0x6e')],_0xb508a5);}_0x30bb35=_[_0x3105('0x91')]({},_0x30bb35,_0x2949e1[_0x3105('0xac')]);return db[_0x3105('0xb0')][_0x3105('0x20')]({'where':_0x30bb35['where']})[_0x3105('0x26')](function(_0x532238){_0x5deeb1[_0x3105('0x20')]=_0x532238;if(_0x2949e1['query']['includeAll']){_0x30bb35[_0x3105('0xab')]=[{'all':!![]}];}return db['SmsMessage'][_0x3105('0xb8')](_0x30bb35);})[_0x3105('0x26')](function(_0x16968e){_0x5deeb1[_0x3105('0xa6')]=_0x16968e;return _0x5deeb1;});}})[_0x3105('0x26')](respondWithFilteredResult(_0x474ed5,_0x30bb35))[_0x3105('0xa7')](handleError(_0x474ed5,null));};exports[_0x3105('0xb9')]=function(_0x459fa6,_0x22cec7,_0x987a0){return db['SmsInteraction']['find']({'where':{'id':_0x459fa6[_0x3105('0xa9')]['id']}})[_0x3105('0x26')](handleEntityNotFound(_0x22cec7,null))[_0x3105('0x26')](function(_0x3274e6){if(_0x3274e6){return _0x3274e6[_0x3105('0xba')](_0x459fa6[_0x3105('0x69')][_0x3105('0xb1')],_['omit'](_0x459fa6['body'],['ids','id'])||{})[_0x3105('0xbb')](function(){return db[_0x3105('0xbc')]['findAll']({'attributes':['id',_0x3105('0x2a'),_0x3105('0x43')],'where':{'id':_0x459fa6['body'][_0x3105('0xb1')]}});})[_0x3105('0x26')](function(_0x2b7f1f){socket[_0x3105('0xbd')](_0x3105('0xbe'),{'id':Number(_0x459fa6[_0x3105('0xa9')]['id']),'tags':_0x2b7f1f||[]});return{'id':Number(_0x459fa6['params']['id']),'tags':_0x2b7f1f||[]};});}})[_0x3105('0x26')](respondWithResult(_0x22cec7,null))[_0x3105('0xa7')](handleError(_0x22cec7,null));};exports[_0x3105('0xbf')]=function(_0x1374b0,_0x547d0a,_0x32bed4){return db[_0x3105('0x92')][_0x3105('0x56')]({'where':{'id':_0x1374b0[_0x3105('0xa9')]['id']}})[_0x3105('0x26')](handleEntityNotFound(_0x547d0a,null))['then'](function(_0x15ea11){if(_0x15ea11){return _0x15ea11[_0x3105('0xbf')](_0x1374b0['query']['ids']);}})['then'](respondWithStatusCode(_0x547d0a,null))['catch'](handleError(_0x547d0a,null));};exports[_0x3105('0xc0')]=function(_0x195c9e,_0x2e0694){var _0x176a9f=moment()[_0x3105('0xc1')]()[_0x3105('0x8f')]();var _0x415c3d=path[_0x3105('0xc2')](config['root'],'server','files',_0x3105('0xc3'));var _0x1441e9=path[_0x3105('0xc2')](config[_0x3105('0xc4')],_0x3105('0xc5'),'files','attachments');var _0x3d08a1=path[_0x3105('0xc2')](_0x415c3d,_0x176a9f);var _0x5a8d47=util[_0x3105('0xb6')]('transcript-%d-%s.zip',_0x195c9e[_0x3105('0xa9')]['id'],_0x176a9f);var _0x58e57b=path[_0x3105('0xc2')](_0x415c3d,_0x5a8d47);var _0x31da35=[];_0x31da35['push']({'model':db[_0x3105('0xc6')],'as':_0x3105('0xc6'),'attributes':['id',_0x3105('0x2d')],'raw':!![]});_0x31da35[_0x3105('0x31')]({'model':db['CmContact'],'as':_0x3105('0x5c'),'attributes':['id',_0x3105('0xc7'),'lastName'],'raw':!![]});var _0xf8e447=[{'model':db[_0x3105('0xb0')],'as':'Messages','attributes':['id',_0x3105('0x69'),_0x3105('0x70'),'direction',_0x3105('0xc8'),'read'],'include':_0x31da35}];_0xf8e447[_0x3105('0x31')]({'model':db[_0x3105('0xc9')],'as':_0x3105('0xca'),'attributes':['id',_0x3105('0x2a')]});_0xf8e447['push']({'model':db['User'],'as':_0x3105('0xcb'),'attributes':['id',_0x3105('0x2d')]});return db[_0x3105('0x92')][_0x3105('0x56')]({'where':{'id':_0x195c9e[_0x3105('0xa9')]['id']},'include':_0xf8e447})[_0x3105('0x26')](handleEntityNotFound(_0x2e0694,null))[_0x3105('0x26')](function(_0x1f4fe0){if(_0x1f4fe0){var _0x1ba437=_0x1f4fe0[_0x3105('0xcc')]({'plain':!![]});fs['mkdirSync'](_0x3d08a1);var _0xb2352f={'channel':_0x3105('0xcd'),'account':_0x1ba437[_0x3105('0xca')]['name'],'agent':_0x1ba437[_0x3105('0xcb')]?_0x1ba437[_0x3105('0xcb')]['fullname']:'N.A.','createdAt':moment(_0x1ba437['createdAt'])[_0x3105('0xb6')](_0x3105('0xb7'))['toString'](),'closedAt':_0x1ba437[_0x3105('0xce')]?moment(_0x1ba437[_0x3105('0xcf')])[_0x3105('0xb6')](_0x3105('0xb7'))[_0x3105('0x8f')]():'','disposition':_0x1ba437[_0x3105('0xd0')],'messages':_(_0x1ba437[_0x3105('0xd1')])[_0x3105('0x7a')]({'secret':![]})[_0x3105('0x2c')](function(_0x5595d0){return{'date':moment(_0x5595d0[_0x3105('0x70')])['format'](_0x3105('0xb7'))[_0x3105('0x8f')](),'sender':_0x5595d0[_0x3105('0xd2')]==='out'?_0x5595d0[_0x3105('0xc6')]?_0x5595d0[_0x3105('0xc6')][_0x3105('0x2d')]:_0x3105('0xd3'):_0x5595d0[_0x3105('0x5c')][_0x3105('0xc7')]+(_0x5595d0[_0x3105('0x5c')][_0x3105('0xd4')]?'\x20'+_0x5595d0[_0x3105('0x5c')][_0x3105('0xd4')]:''),'body':_0x5595d0[_0x3105('0x69')],'direction':_0x5595d0[_0x3105('0xd2')]==='out'?'A':'C','secret':_0x5595d0['secret'],'read':_0x5595d0[_0x3105('0x76')]};})[_0x3105('0x58')]()};return ejs[_0x3105('0xd5')](path[_0x3105('0xc2')](config[_0x3105('0xc4')],_0x3105('0xc5'),_0x3105('0xd6'),_0x3105('0xd7')),{'interaction':_0xb2352f})['then'](function(_0x304a51){var _0x232ae0=path['join'](_0x3d08a1,'transcript-'+_0x1ba437['id']+'-'+_0x176a9f+'.pdf');var _0x5c543c={'path':_0x232ae0,'channel':_0x3105('0xcd'),'interactionId':_0x1ba437['id']};return pdf[_0x3105('0xd8')](_0x304a51,_0x5c543c);})[_0x3105('0x26')](function(){return new BPromise(function(_0x3447b8,_0x466ca0){zipdir(_0x3d08a1,{'saveTo':_0x58e57b},function(_0xf84486,_0x39401a){if(_0xf84486)return _0x466ca0(_0xf84486);return _0x3447b8(_0x39401a);});})[_0x3105('0x26')](function(){return new BPromise(function(_0x49d597,_0x5e76ad){rimraf(_0x3d08a1,function(_0x51ae85){if(_0x51ae85)_0x5e76ad(_0x51ae85);return _0x49d597();});});})[_0x3105('0x26')](function(){return _0x2e0694['download'](_0x58e57b,_0x5a8d47,function(_0x26760c){if(_0x26760c){console[_0x3105('0xd9')](_0x3105('0xda'),_0x26760c);}else{fs[_0x3105('0xdb')](_0x58e57b);}});});});}else{return _0x2e0694['sendStatus'](0xc8);}})['catch'](handleError(_0x2e0694,null));};
\ No newline at end of file
+var _0xd452=['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','length','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','concat','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','a.key','a.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','includeAll','merge','options','create','params','addMessage','SmsMessage','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','ids','omit','spread','emit','smsInteractionTags:save','removeTags','unix','join','root','server','tmp','files','attachments','format','transcript-%d-%s.zip','CmContact','firstName','Messages','createdAt','secret','SmsAccount','Account','Owner','get','N.A.','closedAt','disposition','out','System','lastName','direction','renderFile','views','transcript-','.pdf','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','name','Users','map','fullname','TagIds','Tags','forEach','push','catch','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','select','field','color','from','tools_tags','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xd452,0x98));var _0x2d45=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xd452[_0x3430aa];return _0x2ac5c;};'use strict';var emlformat=require(_0x2d45('0x0'));var rimraf=require(_0x2d45('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d45('0x2'));var rp=require(_0x2d45('0x3'));var moment=require(_0x2d45('0x4'));var BPromise=require(_0x2d45('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x2d45('0x6'));var sox=require(_0x2d45('0x7'));var csv=require(_0x2d45('0x8'));var ejs=require(_0x2d45('0x9'));var fs=require('fs');var fs_extra=require(_0x2d45('0xa'));var _=require(_0x2d45('0xb'));var squel=require('squel');var crypto=require(_0x2d45('0xc'));var jsforce=require(_0x2d45('0xd'));var deskjs=require(_0x2d45('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2d45('0xf'));var Papa=require(_0x2d45('0x10'));var Redis=require(_0x2d45('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2d45('0x12'));var as=require(_0x2d45('0x13'));var pdf=require(_0x2d45('0x14'));var hardwareService=require(_0x2d45('0x15'));var logger=require(_0x2d45('0x16'))('api');var utils=require(_0x2d45('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2d45('0x18'));var db=require(_0x2d45('0x19'))['db'];config[_0x2d45('0x1a')]=_[_0x2d45('0x1b')](config[_0x2d45('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x2d45('0x1c'))(new Redis(config[_0x2d45('0x1a')]));require(_0x2d45('0x1d'))['register'](socket);function respondWithStatusCode(_0x23009d,_0x1df39b){_0x1df39b=_0x1df39b||0xcc;return function(_0x5c7937){if(_0x5c7937){return _0x23009d[_0x2d45('0x1e')](_0x1df39b);}return _0x23009d[_0x2d45('0x1f')](_0x1df39b)[_0x2d45('0x20')]();};}function respondWithResult(_0x3436fa,_0x14b3fa){_0x14b3fa=_0x14b3fa||0xc8;return function(_0x50753a){if(_0x50753a){return _0x3436fa[_0x2d45('0x1f')](_0x14b3fa)[_0x2d45('0x21')](_0x50753a);}};}function respondWithFilteredResult(_0x3735f6,_0x1d15d9){return function(_0x227cab){if(_0x227cab){var _0x1a33e1=typeof _0x1d15d9[_0x2d45('0x22')]===_0x2d45('0x23')&&typeof _0x1d15d9['limit']===_0x2d45('0x23');var _0xd19d72=_0x227cab['count'];var _0x29a324=_0x1a33e1?0x0:_0x1d15d9[_0x2d45('0x22')];var _0x18b9fa=_0x1a33e1?_0x227cab[_0x2d45('0x24')]:_0x1d15d9['offset']+_0x1d15d9[_0x2d45('0x25')];var _0x8065b1;if(_0x18b9fa>=_0xd19d72){_0x18b9fa=_0xd19d72;_0x8065b1=0xc8;}else{_0x8065b1=0xce;}_0x3735f6['status'](_0x8065b1);return _0x3735f6[_0x2d45('0x26')](_0x2d45('0x27'),_0x29a324+'-'+_0x18b9fa+'/'+_0xd19d72)[_0x2d45('0x21')](_0x227cab);}return null;};}function patchUpdates(_0x2ca070){return function(_0x5b9085){try{jsonpatch['apply'](_0x5b9085,_0x2ca070,!![]);}catch(_0x1c50ce){return BPromise[_0x2d45('0x28')](_0x1c50ce);}return _0x5b9085[_0x2d45('0x29')]();};}function saveUpdates(_0x50bf62,_0x344352){return function(_0x4a4a90){if(_0x4a4a90){return _0x4a4a90[_0x2d45('0x2a')](_0x50bf62)[_0x2d45('0x2b')](function(_0x330b35){return _0x330b35;});}return null;};}function removeEntity(_0x2bcffb,_0x33514c){return function(_0x5d0cb8){if(_0x5d0cb8){return _0x5d0cb8[_0x2d45('0x2c')]()[_0x2d45('0x2b')](function(){_0x2bcffb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x11eff9,_0x141ce5){return function(_0x4f902e){if(!_0x4f902e){_0x11eff9[_0x2d45('0x1e')](0x194);}return _0x4f902e;};}function handleError(_0x2a91a0,_0x1fa14b){_0x1fa14b=_0x1fa14b||0x1f4;return function(_0x3f3634){logger[_0x2d45('0x2d')](_0x3f3634['stack']);if(_0x3f3634[_0x2d45('0x2e')]){delete _0x3f3634[_0x2d45('0x2e')];}_0x2a91a0['status'](_0x1fa14b)['send'](_0x3f3634);};}function getInteractionUsers(_0x291441,_0x2229e3){return new BPromise(function(_0x4eb58a,_0x59dfd3){try{if(_0x2229e3[_0x291441['id']]){_0x291441[_0x2d45('0x2f')]=_[_0x2d45('0x30')](_0x2229e3[_0x291441['id']],function(_0x4347da){return{'id':_0x4347da['id'],'fullname':_0x4347da[_0x2d45('0x31')]};});}}catch(_0x2f9c78){_0x59dfd3(_0x2f9c78);}_0x4eb58a(_0x291441);});}function getInteractionTags(_0x1c60b1,_0x288b9e){return new BPromise(function(_0xef47ea,_0x2c613f){try{if(_0x1c60b1[_0x2d45('0x32')]){_0x1c60b1[_0x2d45('0x33')]=[];_0x1c60b1[_0x2d45('0x32')]['split'](',')[_0x2d45('0x34')](function(_0x105f82){_0x1c60b1[_0x2d45('0x33')][_0x2d45('0x35')](_0x288b9e[_0x105f82]);});}delete _0x1c60b1[_0x2d45('0x32')];}catch(_0x37f5a7){_0x2c613f(_0x37f5a7);}_0xef47ea(_0x1c60b1);});}function updateSmsInteraction(_0x46d1df,_0x2950e4,_0x18faf0){return new BPromise(function(_0x2fbf38,_0x326fb7){return getInteractionUsers(_0x46d1df,_0x18faf0)[_0x2d45('0x2b')](function(_0x5a31b9){return getInteractionTags(_0x5a31b9,_0x2950e4);})[_0x2d45('0x2b')](function(_0x29c031){_0x2fbf38(_0x29c031);})[_0x2d45('0x36')](function(_0x19646e){_0x326fb7(_0x19646e);});});}exports[_0x2d45('0x37')]=function(_0x29c329,_0x281347){var _0x4b7921={},_0x175aad={},_0x38271b={'count':0x0,'rows':[]};var _0x4cec64=_[_0x2d45('0x30')](db[_0x2d45('0x38')][_0x2d45('0x39')],function(_0x4e4c7a){return{'name':_0x4e4c7a[_0x2d45('0x3a')],'type':_0x4e4c7a[_0x2d45('0x3b')][_0x2d45('0x3c')]};});_0x175aad[_0x2d45('0x3d')]=_[_0x2d45('0x30')](_0x4cec64,'name');_0x175aad['query']=_[_0x2d45('0x3e')](_0x29c329[_0x2d45('0x3f')]);_0x175aad[_0x2d45('0x40')]=_['intersection'](_0x175aad[_0x2d45('0x3d')],_0x175aad[_0x2d45('0x3f')]);_0x4b7921[_0x2d45('0x41')]=_[_0x2d45('0x42')](_0x175aad[_0x2d45('0x3d')],qs[_0x2d45('0x43')](_0x29c329[_0x2d45('0x3f')]['fields']));_0x4b7921[_0x2d45('0x41')]=_0x4b7921[_0x2d45('0x41')]['length']?_0x4b7921[_0x2d45('0x41')]:_0x175aad[_0x2d45('0x3d')];if(!_0x29c329['query']['hasOwnProperty'](_0x2d45('0x44'))){_0x4b7921[_0x2d45('0x25')]=qs[_0x2d45('0x25')](_0x29c329['query'][_0x2d45('0x25')]);_0x4b7921[_0x2d45('0x22')]=qs[_0x2d45('0x22')](_0x29c329[_0x2d45('0x3f')][_0x2d45('0x22')]);}_0x4b7921[_0x2d45('0x45')]=qs[_0x2d45('0x46')](_0x29c329[_0x2d45('0x3f')]['sort']);_0x4b7921[_0x2d45('0x47')]=qs[_0x2d45('0x40')](_['pick'](_0x29c329[_0x2d45('0x3f')],_0x175aad['filters']),_0x4cec64);var _0x4f5d50=[];var _0x63f5ad=squel[_0x2d45('0x48')]()['field']('id')['field']('name')[_0x2d45('0x49')](_0x2d45('0x4a'))[_0x2d45('0x4b')](_0x2d45('0x4c'));var _0x3df094=squel['select']()[_0x2d45('0x49')]('u.id')['field'](_0x2d45('0x4d'))[_0x2d45('0x49')](_0x2d45('0x4e'))['from'](_0x2d45('0x4f'),'ui')[_0x2d45('0x50')](_0x2d45('0x51'),'u',_0x2d45('0x52'));var _0x4d0db1=squel[_0x2d45('0x48')]()['from'](_0x2d45('0x53'),'i')[_0x2d45('0x50')](_0x2d45('0x54'),'c',_0x2d45('0x55'))[_0x2d45('0x50')](_0x2d45('0x51'),'o',_0x2d45('0x56'))[_0x2d45('0x50')](_0x2d45('0x57'),'a',_0x2d45('0x58'))[_0x2d45('0x50')](_0x2d45('0x59'),'me',_0x2d45('0x5a'))[_0x2d45('0x50')](_0x2d45('0x5b'),'it',_0x2d45('0x5c'))[_0x2d45('0x50')](_0x2d45('0x4c'),'t',_0x2d45('0x5d'));var _0x5310aa=squel['expr']();var _0x547d6a=[];var _0x1a009f=squel[_0x2d45('0x5e')]();var _0x57efdf;if(_0x29c329[_0x2d45('0x3f')]['search']){_0x57efdf=as['parseSearch'](_0x29c329[_0x2d45('0x3f')][_0x2d45('0x5f')]);var _0x4a5544=_0x57efdf[_0x2d45('0x60')];for(var _0x288955=0x0;_0x288955<_0x57efdf['conditions'][_0x2d45('0x61')];_0x288955++){var _0x3baa1a=_0x57efdf[_0x2d45('0x62')][_0x288955];var _0x19342f='i';var _0x1b1cd0=_['find'](_0x4cec64,[_0x2d45('0x2e'),_0x3baa1a[_0x2d45('0x49')]]);if(!_0x1b1cd0){switch(_0x3baa1a[_0x2d45('0x49')]){case _0x2d45('0x63'):if(_0x3baa1a[_0x2d45('0x64')]==0x1){_0x4d0db1['having']('`'+_0x3baa1a['field']+_0x2d45('0x65'));}else{_0x4d0db1[_0x2d45('0x66')]('`'+_0x3baa1a[_0x2d45('0x49')]+_0x2d45('0x67'));}break;case _0x2d45('0x68'):if(_0x3baa1a[_0x2d45('0x69')]==='$substring'){if(_0x3baa1a['value']['split']('\x20')['length']>0x1){_0x5310aa[_0x4a5544](_0x2d45('0x6a'),qs[_0x2d45('0x6b')](_0x3baa1a['value']),null);}else{var _0x2aa349='%'+_0x3baa1a['value']+'%';_0x5310aa[_0x4a5544](_0x2d45('0x6c'),_0x2aa349,_0x2aa349,_0x2aa349);}}else{_0x1b1cd0=_[_0x2d45('0x6d')](_0x4cec64,[_0x2d45('0x2e'),'ContactId']);_0x3baa1a[_0x2d45('0x49')]=_0x2d45('0x6e');_0x3284ff=as[_0x2d45('0x6f')](_0x19342f,_0x1b1cd0[_0x2d45('0x3b')],_0x3baa1a);_0x5310aa[_0x4a5544](_0x3284ff[_0x2d45('0x70')],_0x3284ff[_0x2d45('0x64')][_0x2d45('0x71')],_0x3284ff[_0x2d45('0x64')][_0x2d45('0x20')]);}break;case'Tag':var _0xbb8a97=_0x3baa1a[_0x2d45('0x64')][_0x2d45('0x72')](',')['map'](function(_0x3bc562){return Number(_0x3bc562);});_0xbb8a97[_0x2d45('0x34')](function(_0x299e94){_0x1a009f['or'](_0x2d45('0x73'),'%,'+_0x299e94+',%');});_0x547d6a=_[_0x2d45('0x74')](_0x547d6a,_0xbb8a97);break;case _0x2d45('0x75'):if(_0x3baa1a[_0x2d45('0x69')]===_0x2d45('0x76')){_0x5310aa[_0x4a5544](_0x2d45('0x77'),'%'+_0x3baa1a['value']+'%',null);}else{_0x1b1cd0=_['find'](_0x4cec64,[_0x2d45('0x2e'),_0x2d45('0x78')]);_0x3baa1a[_0x2d45('0x49')]=_0x2d45('0x78');_0x3284ff=as[_0x2d45('0x6f')](_0x19342f,_0x1b1cd0['type'],_0x3baa1a);_0x5310aa[_0x4a5544](_0x3284ff['text'],_0x3284ff['value'][_0x2d45('0x71')],_0x3284ff[_0x2d45('0x64')]['end']);}break;case _0x2d45('0x79'):_0x3284ff=as[_0x2d45('0x6f')]('me',null,_0x3baa1a);_0x5310aa[_0x4a5544](_0x3284ff[_0x2d45('0x70')],_0x3284ff['value'][_0x2d45('0x71')],_0x3284ff['value'][_0x2d45('0x20')]);break;}}else{var _0x3284ff=as['buildExpression'](_0x19342f,_0x1b1cd0[_0x2d45('0x3b')],_0x3baa1a);_0x5310aa[_0x4a5544](_0x3284ff[_0x2d45('0x70')],_0x3284ff['value'][_0x2d45('0x71')],_0x3284ff['value'][_0x2d45('0x20')]);}}}else{var _0x5b0d75=_(_0x29c329[_0x2d45('0x3f')])['keys']()[_0x2d45('0x30')](function(_0x1c6882){return _[_0x2d45('0x7a')](_0x4cec64,[_0x2d45('0x2e'),_0x1c6882])?_0x1c6882:undefined;})[_0x2d45('0x7b')]()['value']();if(!_[_0x2d45('0x7c')](_0x5b0d75)){_0x5b0d75[_0x2d45('0x34')](function(_0x469abb){if(_0x469abb===_0x2d45('0x7d')){_0x4d0db1['where']('i.SmsAccountId\x20IN\x20?',[][_0x2d45('0x7e')](_0x29c329['query'][_0x469abb]));}else if(_0x469abb==='createdAt'){var _0x485cf8=JSON[_0x2d45('0x7f')](_0x29c329['query'][_0x469abb])[_0x2d45('0x80')];var _0x1e1e97=JSON[_0x2d45('0x7f')](_0x29c329[_0x2d45('0x3f')][_0x469abb])[_0x2d45('0x81')];_0x4d0db1[_0x2d45('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x485cf8,_0x1e1e97);}else{if(_0x29c329[_0x2d45('0x3f')][_0x469abb]===_0x2d45('0x82')){_0x4d0db1['where']('i.'+_0x469abb+_0x2d45('0x83'));}else{_0x4d0db1[_0x2d45('0x47')]('i.'+_0x469abb+_0x2d45('0x84'),_0x29c329[_0x2d45('0x3f')][_0x469abb]);}}});}if(_0x29c329[_0x2d45('0x3f')]['read']){if(_0x29c329[_0x2d45('0x3f')][_0x2d45('0x85')]==0x1){_0x4d0db1[_0x2d45('0x66')](_0x2d45('0x86'));}else{_0x4d0db1[_0x2d45('0x66')](_0x2d45('0x87'));}}if(_0x29c329[_0x2d45('0x3f')][_0x2d45('0x88')]){_0x547d6a=_[_0x2d45('0x89')](_0x29c329[_0x2d45('0x3f')][_0x2d45('0x88')])?_0x29c329[_0x2d45('0x3f')][_0x2d45('0x88')]:new Array(_0x29c329['query'][_0x2d45('0x88')]);_0x547d6a['forEach'](function(_0x2e9e9a){_0x1a009f['or'](_0x2d45('0x73'),'%,'+_0x2e9e9a+',%');});}if(_0x29c329[_0x2d45('0x3f')][_0x2d45('0x8a')]){var _0x1d36a7=_0x29c329[_0x2d45('0x3f')][_0x2d45('0x8a')]['replace']('\x5c','\x5c\x5c')[_0x2d45('0x8b')](/'/g,'\x27\x27');if(qs[_0x2d45('0x8c')](_0x1d36a7)){_0x5310aa['or'](_0x2d45('0x8d'),_0x1d36a7+'%')['or'](_0x2d45('0x8e'),_0x1d36a7+'%');}else{_0x5310aa['or'](_0x2d45('0x8f'),qs['getFullTextValue'](_0x1d36a7))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1d36a7+'%');}}}_0x4d0db1[_0x2d45('0x47')](_0x5310aa);_0x4d0db1[_0x2d45('0x90')](_0x2d45('0x91'));var _0x32bf5c={'type':db[_0x2d45('0x92')][_0x2d45('0x93')][_0x2d45('0x94')],'raw':!![]};var _0x42383a=_0x4d0db1[_0x2d45('0x95')]();_0x42383a['field']('i.id');_0x42383a[_0x2d45('0x49')](_0x2d45('0x96'),'unreadMessages');if(_0x4b7921[_0x2d45('0x45')]){_0x4b7921[_0x2d45('0x45')][_0x2d45('0x34')](function(_0x54d7ea){var _0x42c2a3=_0x54d7ea[0x0]===_0x2d45('0x97')?_0x54d7ea[0x0]:'i.'+_0x54d7ea[0x0];_0x4d0db1['order'](_0x42c2a3,_0x54d7ea[0x1]===_0x2d45('0x98')?![]:!![]);});}if(!_[_0x2d45('0x7c')](_0x547d6a)){_0x4d0db1[_0x2d45('0x66')](_0x1a009f);_0x42383a['where']('t.id\x20IN\x20?',_0x547d6a);}BPromise[_0x2d45('0x99')]()['then'](function(){if(!_0x57efdf){if(_0x29c329[_0x2d45('0x3f')]['SmsAccountId'])return;_0x42383a[_0x2d45('0x47')](_0x2d45('0x9a'));_0x4d0db1[_0x2d45('0x47')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x29c329[_0x2d45('0x9b')][_0x2d45('0x9c')]!==_0x2d45('0x9d'))return;return _0x29c329['user'][_0x2d45('0x9e')]({'attributes':['id'],'raw':!![]})[_0x2d45('0x2b')](function(_0x529c0f){if(_[_0x2d45('0x7c')](_0x529c0f)){_0x42383a[_0x2d45('0x47')](_0x2d45('0x9f'));_0x4d0db1[_0x2d45('0x47')](_0x2d45('0x9f'));}else{_0x42383a['where'](_0x2d45('0xa0'),_[_0x2d45('0x30')](_0x529c0f,'id'));_0x4d0db1[_0x2d45('0x47')](_0x2d45('0xa0'),_[_0x2d45('0x30')](_0x529c0f,'id'));}});})[_0x2d45('0x2b')](function(){if(_0x29c329['user'][_0x2d45('0x9c')]==='agent'&&!_0x57efdf&&!_0x29c329['query']['SmsAccountId'])return[];return db[_0x2d45('0xa1')][_0x2d45('0x3f')](_0x42383a[_0x2d45('0xa2')](),_0x32bf5c);})['then'](function(_0xc050de){_0x38271b['count']=_0xc050de[_0x2d45('0x61')];if(_0x38271b[_0x2d45('0x24')]===0x0)return[];return db[_0x2d45('0xa1')][_0x2d45('0x3f')](_0x63f5ad[_0x2d45('0xa2')](),_0x32bf5c)[_0x2d45('0x2b')](function(_0xc728f8){_0x4f5d50=_[_0x2d45('0xa3')](_0xc728f8,'id');_0x32bf5c=_['merge'](_0x32bf5c,{'model':db[_0x2d45('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x29c329[_0x2d45('0x3f')][_0x2d45('0x43')]){_0x4b7921[_0x2d45('0x41')][_0x2d45('0x34')](function(_0x3d7129){_0x4d0db1[_0x2d45('0x49')]('i.'+_0x3d7129);});}else{_0x4d0db1[_0x2d45('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2d45('0x63'));_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xa4'),'Account.key');_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xa5'),'Account.mandatoryDisposition');_0x4d0db1[_0x2d45('0x49')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x2d45('0x97'));_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xa6'));_0x4d0db1['field'](_0x2d45('0xa7'),'Contact.firstName');_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xa8'),_0x2d45('0xa9'));_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xaa'),_0x2d45('0xab'));_0x4d0db1['field']('c.phone',_0x2d45('0xac'));_0x4d0db1['field'](_0x2d45('0xad'),'Contact.mobile');_0x4d0db1['field'](_0x2d45('0xae'),_0x2d45('0xaf'));_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xb0'),'Owner.fullname');_0x4d0db1[_0x2d45('0x49')]('o.internal','Owner.internal');_0x4d0db1[_0x2d45('0x49')](_0x2d45('0xb1'),'TagIds');}if(_0x4b7921[_0x2d45('0x25')])_0x4d0db1[_0x2d45('0x25')](_0x4b7921[_0x2d45('0x25')]);if(_0x4b7921['offset'])_0x4d0db1['offset'](_0x4b7921[_0x2d45('0x22')]);return db['sequelize'][_0x2d45('0x3f')](_0x4d0db1[_0x2d45('0xa2')](),_0x32bf5c);})['then'](function(_0xeeb5ff){if(_0xeeb5ff['length']>0x0)_0x3df094[_0x2d45('0x47')](_0x2d45('0xb2'),_['map'](_0xeeb5ff,'id'));return db[_0x2d45('0xa1')][_0x2d45('0x3f')](_0x3df094[_0x2d45('0xa2')](),_0x32bf5c)[_0x2d45('0x2b')](function(_0xf881ab){var _0x35c0fd=_[_0x2d45('0xb3')](_0xf881ab,_0x2d45('0xb4'));var _0x3bffb3=[];_0xeeb5ff['forEach'](function(_0x6156a9){_0x3bffb3[_0x2d45('0x35')](updateSmsInteraction(_0x6156a9,_0x4f5d50,_0x35c0fd));});return BPromise[_0x2d45('0xb5')](_0x3bffb3);});});})[_0x2d45('0x2b')](function(_0x5776fb){_0x38271b[_0x2d45('0xb6')]=_0x5776fb;return _0x38271b;})['then'](respondWithFilteredResult(_0x281347,_0x4b7921))['catch'](handleError(_0x281347,null));};exports[_0x2d45('0xb7')]=function(_0x5c5e15,_0x228fb5){var _0x3c47e4={'raw':![],'where':{'id':_0x5c5e15['params']['id']}},_0x55c843={};_0x55c843[_0x2d45('0x3d')]=_[_0x2d45('0x3e')](db[_0x2d45('0x38')]['rawAttributes']);_0x55c843[_0x2d45('0x3f')]=_['keys'](_0x5c5e15[_0x2d45('0x3f')]);_0x55c843['filters']=_[_0x2d45('0x42')](_0x55c843[_0x2d45('0x3d')],_0x55c843[_0x2d45('0x3f')]);_0x3c47e4[_0x2d45('0x41')]=_[_0x2d45('0x42')](_0x55c843['model'],qs[_0x2d45('0x43')](_0x5c5e15[_0x2d45('0x3f')]['fields']));_0x3c47e4['attributes']=_0x3c47e4['attributes'][_0x2d45('0x61')]?_0x3c47e4[_0x2d45('0x41')]:_0x55c843[_0x2d45('0x3d')];if(_0x5c5e15['query'][_0x2d45('0xb8')]){_0x3c47e4['include']=[{'all':!![]}];}_0x3c47e4=_[_0x2d45('0xb9')]({},_0x3c47e4,_0x5c5e15[_0x2d45('0xba')]);return db[_0x2d45('0x38')]['find'](_0x3c47e4)['then'](handleEntityNotFound(_0x228fb5,null))[_0x2d45('0x2b')](respondWithResult(_0x228fb5,null))[_0x2d45('0x36')](handleError(_0x228fb5,null));};exports[_0x2d45('0xbb')]=function(_0xe3ad2e,_0x145f0f){return db[_0x2d45('0x38')]['create'](_0xe3ad2e[_0x2d45('0x79')],{})['then'](respondWithResult(_0x145f0f,0xc9))[_0x2d45('0x36')](handleError(_0x145f0f,null));};exports[_0x2d45('0x2a')]=function(_0x12ca57,_0xad4727){if(_0x12ca57['body']['id']){delete _0x12ca57[_0x2d45('0x79')]['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x12ca57['params']['id']}})[_0x2d45('0x2b')](handleEntityNotFound(_0xad4727,null))['then'](saveUpdates(_0x12ca57['body'],null))[_0x2d45('0x2b')](respondWithResult(_0xad4727,null))[_0x2d45('0x36')](handleError(_0xad4727,null));};exports['destroy']=function(_0x267791,_0x4c2627){return db[_0x2d45('0x38')]['find']({'where':{'id':_0x267791[_0x2d45('0xbc')]['id']}})[_0x2d45('0x2b')](handleEntityNotFound(_0x4c2627,null))['then'](removeEntity(_0x4c2627,null))[_0x2d45('0x36')](handleError(_0x4c2627,null));};exports['describe']=function(_0x3a92bc,_0x1c4574){return db[_0x2d45('0x38')]['describe']()['then'](respondWithResult(_0x1c4574,null))[_0x2d45('0x36')](handleError(_0x1c4574,null));};exports[_0x2d45('0xbd')]=function(_0x382c1c,_0x226b54,_0x1711c2){return db[_0x2d45('0xbe')][_0x2d45('0x6d')]({'where':{'id':_0x382c1c[_0x2d45('0xbc')]['id']}})[_0x2d45('0x2b')](handleEntityNotFound(_0x226b54,null))['then'](function(_0x199bd2){if(_0x199bd2){return _0x199bd2[_0x2d45('0xbd')](_0x382c1c['body']['ids'],_['omit'](_0x382c1c[_0x2d45('0x79')],['ids','id'])||{});}})[_0x2d45('0x2b')](respondWithResult(_0x226b54,null))[_0x2d45('0x36')](handleError(_0x226b54,null));};exports[_0x2d45('0xbf')]=function(_0x200cf4,_0x5d7e3e,_0x4dfaaf){var _0x4a41d8={'raw':![],'where':{}};var _0x436837={};var _0x420059={'count':0x0,'rows':[]};return db[_0x2d45('0x38')][_0x2d45('0xc0')]({'where':{'id':_0x200cf4[_0x2d45('0xbc')]['id']}})['then'](handleEntityNotFound(_0x5d7e3e,null))['then'](function(_0x4b3ec9){if(_0x4b3ec9){_0x436837[_0x2d45('0x3d')]=_[_0x2d45('0x3e')](db[_0x2d45('0xbe')]['rawAttributes']);_0x436837[_0x2d45('0x3f')]=_[_0x2d45('0x3e')](_0x200cf4[_0x2d45('0x3f')]);_0x436837[_0x2d45('0x40')]=_['intersection'](_0x436837[_0x2d45('0x3d')],_0x436837[_0x2d45('0x3f')]);_0x4a41d8[_0x2d45('0x41')]=_[_0x2d45('0x42')](_0x436837['model'],qs[_0x2d45('0x43')](_0x200cf4['query'][_0x2d45('0x43')]));_0x4a41d8[_0x2d45('0x41')]=_0x4a41d8[_0x2d45('0x41')]['length']?_0x4a41d8[_0x2d45('0x41')]:_0x436837[_0x2d45('0x3d')];if(!_0x200cf4['query']['hasOwnProperty']('nolimit')){_0x4a41d8[_0x2d45('0x25')]=qs['limit'](_0x200cf4[_0x2d45('0x3f')][_0x2d45('0x25')]);_0x4a41d8[_0x2d45('0x22')]=qs[_0x2d45('0x22')](_0x200cf4['query'][_0x2d45('0x22')]);}_0x4a41d8[_0x2d45('0x45')]=qs[_0x2d45('0x46')](_0x200cf4['query'][_0x2d45('0x46')]);_0x4a41d8[_0x2d45('0x47')]=qs[_0x2d45('0x40')](_['pick'](_0x200cf4[_0x2d45('0x3f')],_0x436837['filters']));_0x4a41d8[_0x2d45('0x47')]['SmsInteractionId']=_0x4b3ec9['id'];if(_0x200cf4[_0x2d45('0x3f')][_0x2d45('0x8a')]){_0x4a41d8[_0x2d45('0x47')]=_[_0x2d45('0xb9')](_0x4a41d8[_0x2d45('0x47')],{'$or':_[_0x2d45('0x30')](_0x4a41d8[_0x2d45('0x41')],function(_0x48c8cc){var _0x3ae6ea={};_0x3ae6ea[_0x48c8cc]={'$like':'%'+_0x200cf4[_0x2d45('0x3f')][_0x2d45('0x8a')]+'%'};return _0x3ae6ea;})});}if(_0x200cf4[_0x2d45('0x3f')][_0x2d45('0x80')]){var _0x360177=_0x200cf4[_0x2d45('0x3f')][_0x2d45('0x80')]['split'](',');var _0xf2ec9d={};_0xf2ec9d[_0x360177[0x0]]={'$gte':moment(_0x360177[0x1])['format'](_0x2d45('0xc1'))};_0x4a41d8[_0x2d45('0x47')]=_[_0x2d45('0xb9')](_0x4a41d8[_0x2d45('0x47')],_0xf2ec9d);}_0x4a41d8=_[_0x2d45('0xb9')]({},_0x4a41d8,_0x200cf4[_0x2d45('0xba')]);return db[_0x2d45('0xbe')][_0x2d45('0x24')]({'where':_0x4a41d8['where']})['then'](function(_0x59eb75){_0x420059[_0x2d45('0x24')]=_0x59eb75;if(_0x200cf4[_0x2d45('0x3f')]['includeAll']){_0x4a41d8[_0x2d45('0xc2')]=[{'all':!![]}];}return db[_0x2d45('0xbe')][_0x2d45('0xc3')](_0x4a41d8);})['then'](function(_0x1a9b7f){_0x420059['rows']=_0x1a9b7f;return _0x420059;});}})[_0x2d45('0x2b')](respondWithFilteredResult(_0x5d7e3e,_0x4a41d8))['catch'](handleError(_0x5d7e3e,null));};exports[_0x2d45('0xc4')]=function(_0x162d66,_0x359be2,_0x1a2535){return db['SmsInteraction'][_0x2d45('0x6d')]({'where':{'id':_0x162d66[_0x2d45('0xbc')]['id']}})[_0x2d45('0x2b')](handleEntityNotFound(_0x359be2,null))[_0x2d45('0x2b')](function(_0x2cf8e9){if(_0x2cf8e9){return _0x2cf8e9[_0x2d45('0xc5')](_0x162d66[_0x2d45('0x79')][_0x2d45('0xc6')],_[_0x2d45('0xc7')](_0x162d66[_0x2d45('0x79')],[_0x2d45('0xc6'),'id'])||{})[_0x2d45('0xc8')](function(){return db['Tag'][_0x2d45('0xc3')]({'attributes':['id','name','color'],'where':{'id':_0x162d66[_0x2d45('0x79')]['ids']}});})[_0x2d45('0x2b')](function(_0xb65888){socket[_0x2d45('0xc9')](_0x2d45('0xca'),{'id':Number(_0x162d66[_0x2d45('0xbc')]['id']),'tags':_0xb65888||[]});return{'id':Number(_0x162d66['params']['id']),'tags':_0xb65888||[]};});}})['then'](respondWithResult(_0x359be2,null))[_0x2d45('0x36')](handleError(_0x359be2,null));};exports[_0x2d45('0xcb')]=function(_0x2e0d41,_0x1707bb,_0x5ae8af){return db[_0x2d45('0x38')][_0x2d45('0x6d')]({'where':{'id':_0x2e0d41[_0x2d45('0xbc')]['id']}})['then'](handleEntityNotFound(_0x1707bb,null))['then'](function(_0x19229a){if(_0x19229a){return _0x19229a[_0x2d45('0xcb')](_0x2e0d41[_0x2d45('0x3f')][_0x2d45('0xc6')]);}})[_0x2d45('0x2b')](respondWithStatusCode(_0x1707bb,null))['catch'](handleError(_0x1707bb,null));};exports['download']=function(_0x1e1fe4,_0x49c2c3){var _0x3959c9=moment()[_0x2d45('0xcc')]()[_0x2d45('0xa2')]();var _0x3ce804=path[_0x2d45('0xcd')](config[_0x2d45('0xce')],_0x2d45('0xcf'),'files',_0x2d45('0xd0'));var _0x548d03=path[_0x2d45('0xcd')](config[_0x2d45('0xce')],_0x2d45('0xcf'),_0x2d45('0xd1'),_0x2d45('0xd2'));var _0x431d03=path[_0x2d45('0xcd')](_0x3ce804,_0x3959c9);var _0x3389b0=util[_0x2d45('0xd3')](_0x2d45('0xd4'),_0x1e1fe4[_0x2d45('0xbc')]['id'],_0x3959c9);var _0x6001ad=path[_0x2d45('0xcd')](_0x3ce804,_0x3389b0);var _0xf9541e=[];_0xf9541e['push']({'model':db[_0x2d45('0x75')],'as':_0x2d45('0x75'),'attributes':['id',_0x2d45('0x31')],'raw':!![]});_0xf9541e[_0x2d45('0x35')]({'model':db[_0x2d45('0xd5')],'as':_0x2d45('0x68'),'attributes':['id',_0x2d45('0xd6'),'lastName'],'raw':!![]});var _0x33b01f=[{'model':db[_0x2d45('0xbe')],'as':_0x2d45('0xd7'),'attributes':['id',_0x2d45('0x79'),_0x2d45('0xd8'),'direction',_0x2d45('0xd9'),_0x2d45('0x85')],'include':_0xf9541e}];_0x33b01f[_0x2d45('0x35')]({'model':db[_0x2d45('0xda')],'as':_0x2d45('0xdb'),'attributes':['id','name']});_0x33b01f[_0x2d45('0x35')]({'model':db['User'],'as':_0x2d45('0xdc'),'attributes':['id','fullname']});return db[_0x2d45('0x38')][_0x2d45('0x6d')]({'where':{'id':_0x1e1fe4[_0x2d45('0xbc')]['id']},'include':_0x33b01f})['then'](handleEntityNotFound(_0x49c2c3,null))[_0x2d45('0x2b')](function(_0x2afdf0){if(_0x2afdf0){var _0x56abfb=_0x2afdf0[_0x2d45('0xdd')]({'plain':!![]});fs['mkdirSync'](_0x431d03);var _0x32f3f1={'channel':'Sms','account':_0x56abfb['Account'][_0x2d45('0x2e')],'agent':_0x56abfb[_0x2d45('0xdc')]?_0x56abfb[_0x2d45('0xdc')][_0x2d45('0x31')]:_0x2d45('0xde'),'createdAt':moment(_0x56abfb[_0x2d45('0xd8')])[_0x2d45('0xd3')](_0x2d45('0xc1'))[_0x2d45('0xa2')](),'closedAt':_0x56abfb['closed']?moment(_0x56abfb[_0x2d45('0xdf')])[_0x2d45('0xd3')](_0x2d45('0xc1'))[_0x2d45('0xa2')]():'','disposition':_0x56abfb[_0x2d45('0xe0')],'messages':_(_0x56abfb[_0x2d45('0xd7')])[_0x2d45('0x8a')]({'secret':![]})[_0x2d45('0x30')](function(_0x22c9c3){return{'date':moment(_0x22c9c3[_0x2d45('0xd8')])[_0x2d45('0xd3')](_0x2d45('0xc1'))[_0x2d45('0xa2')](),'sender':_0x22c9c3['direction']===_0x2d45('0xe1')?_0x22c9c3['User']?_0x22c9c3[_0x2d45('0x75')][_0x2d45('0x31')]:_0x2d45('0xe2'):_0x22c9c3[_0x2d45('0x68')]['firstName']+(_0x22c9c3['Contact'][_0x2d45('0xe3')]?'\x20'+_0x22c9c3['Contact']['lastName']:''),'body':_0x22c9c3[_0x2d45('0x79')],'direction':_0x22c9c3[_0x2d45('0xe4')]===_0x2d45('0xe1')?'A':'C','secret':_0x22c9c3[_0x2d45('0xd9')],'read':_0x22c9c3[_0x2d45('0x85')]};})['value']()};return ejs[_0x2d45('0xe5')](path[_0x2d45('0xcd')](config[_0x2d45('0xce')],'server',_0x2d45('0xe6'),'downloadInteraction.ejs'),{'interaction':_0x32f3f1})['then'](function(_0xb81d75){var _0x428f52=path['join'](_0x431d03,_0x2d45('0xe7')+_0x56abfb['id']+'-'+_0x3959c9+_0x2d45('0xe8'));var _0x2f151f={'path':_0x428f52,'channel':'Sms','interactionId':_0x56abfb['id']};return pdf['createPdfFromHTML'](_0xb81d75,_0x2f151f);})[_0x2d45('0x2b')](function(){return new BPromise(function(_0x2a1ed5,_0x54624c){zipdir(_0x431d03,{'saveTo':_0x6001ad},function(_0x5eb386,_0x229dc5){if(_0x5eb386)return _0x54624c(_0x5eb386);return _0x2a1ed5(_0x229dc5);});})[_0x2d45('0x2b')](function(){return new BPromise(function(_0x4896e5,_0x3d2cc8){rimraf(_0x431d03,function(_0x5c397f){if(_0x5c397f)_0x3d2cc8(_0x5c397f);return _0x4896e5();});});})[_0x2d45('0x2b')](function(){return _0x49c2c3[_0x2d45('0xe9')](_0x6001ad,_0x3389b0,function(_0x3bf958){if(_0x3bf958){console[_0x2d45('0xea')](_0x2d45('0xeb'),_0x3bf958);}else{fs[_0x2d45('0xec')](_0x6001ad);}});});});}else{return _0x49c2c3[_0x2d45('0x1e')](0xc8);}})['catch'](handleError(_0x49c2c3,null));};
\ No newline at end of file
index c1f8082..cb81688 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fdc=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','map'];(function(_0x30f7a4,_0x25d6a7){var _0x37697d=function(_0x445cb0){while(--_0x445cb0){_0x30f7a4['push'](_0x30f7a4['shift']());}};_0x37697d(++_0x25d6a7);}(_0x5fdc,0x127));var _0xc5fd=function(_0x326e9a,_0x2b1e75){_0x326e9a=_0x326e9a-0x0;var _0xac0cb9=_0x5fdc[_0x326e9a];return _0xac0cb9;};'use strict';var EventEmitter=require(_0xc5fd('0x0'));var SmsInteraction=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x2')];var SmsMessage=require(_0xc5fd('0x1'))['db'][_0xc5fd('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xc5fd('0x4')](0x0);var events={'afterCreate':_0xc5fd('0x5'),'afterUpdate':_0xc5fd('0x6'),'afterDestroy':_0xc5fd('0x7')};function emitEvent(_0x1b6205){return function(_0xca27a0,_0xea5748,_0x44722b){_0xca27a0[_0xc5fd('0x8')]({'attributes':['id'],'raw':!![]})[_0xc5fd('0x9')](function(_0x5a2eb4){_0xca27a0['setDataValue']('Users',_0x5a2eb4[_0xc5fd('0xa')](function(_0x46bce3){return{'id':_0x46bce3['id']};}));return SmsMessage[_0xc5fd('0xb')]({'where':{'SmsInteractionId':_0xca27a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc5fd('0x9')](function(_0x4e6d35){_0xca27a0['setDataValue'](_0xc5fd('0xc'),_0x4e6d35[_0xc5fd('0xd')]);SmsInteractionEvents[_0xc5fd('0xe')](_0x1b6205+':'+_0xca27a0['id'],_0xca27a0);SmsInteractionEvents[_0xc5fd('0xe')](_0x1b6205,_0xca27a0);_0x44722b(null);})[_0xc5fd('0xf')](_0x44722b(null));};}for(var e in events){if(events[_0xc5fd('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0xc5fd('0x11')]=SmsInteractionEvents;
\ No newline at end of file
+var _0x056b=['hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x265eb8,_0x102b08){var _0x940494=function(_0x41ee4b){while(--_0x41ee4b){_0x265eb8['push'](_0x265eb8['shift']());}};_0x940494(++_0x102b08);}(_0x056b,0xb6));var _0xb056=function(_0x31a119,_0x17e6ca){_0x31a119=_0x31a119-0x0;var _0x2d6e6a=_0x056b[_0x31a119];return _0x2d6e6a;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0xb056('0x0'))['db'][_0xb056('0x1')];var SmsMessage=require(_0xb056('0x0'))['db'][_0xb056('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0xb056('0x3')](0x0);var events={'afterCreate':_0xb056('0x4'),'afterUpdate':_0xb056('0x5'),'afterDestroy':_0xb056('0x6')};function emitEvent(_0x343d88){return function(_0x2ff09d,_0x15a545,_0x515612){_0x2ff09d[_0xb056('0x7')]({'attributes':['id'],'raw':!![]})[_0xb056('0x8')](function(_0x3eae69){_0x2ff09d[_0xb056('0x9')](_0xb056('0xa'),_0x3eae69[_0xb056('0xb')](function(_0x539126){return{'id':_0x539126['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x2ff09d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb056('0x8')](function(_0x160c2a){_0x2ff09d[_0xb056('0x9')](_0xb056('0xc'),_0x160c2a['length']);SmsInteractionEvents[_0xb056('0xd')](_0x343d88+':'+_0x2ff09d['id'],_0x2ff09d);SmsInteractionEvents['emit'](_0x343d88,_0x2ff09d);_0x515612(null);})[_0xb056('0xe')](_0x515612(null));};}for(var e in events){if(events[_0xb056('0xf')](e)){var event=events[e];SmsInteraction[_0xb056('0x10')](e,emitEvent(event));}}module[_0xb056('0x11')]=SmsInteractionEvents;
\ No newline at end of file
index 8c70d66..83e4cfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x234a=['../../config/logger','api','moment','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','define','closed','closedAt','format','lodash','util'];(function(_0x5ec813,_0x4f0658){var _0x44ebd8=function(_0x5de820){while(--_0x5de820){_0x5ec813['push'](_0x5ec813['shift']());}};_0x44ebd8(++_0x4f0658);}(_0x234a,0x1e8));var _0xa234=function(_0x3a8cab,_0x375ef7){_0x3a8cab=_0x3a8cab-0x0;var _0x2be7ad=_0x234a[_0x3a8cab];return _0x2be7ad;};'use strict';var _=require(_0xa234('0x0'));var util=require(_0xa234('0x1'));var logger=require(_0xa234('0x2'))(_0xa234('0x3'));var moment=require(_0xa234('0x4'));var BPromise=require('bluebird');var rp=require(_0xa234('0x5'));var fs=require('fs');var path=require(_0xa234('0x6'));var rimraf=require('rimraf');var config=require(_0xa234('0x7'));var attributes=require(_0xa234('0x8'));module[_0xa234('0x9')]=function(_0x493cd7,_0x2baa05){return _0x493cd7[_0xa234('0xa')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x324e74,_0x3dc8b8,_0x4a42a6){if(_0x324e74['changed'](_0xa234('0xb'))){_0x324e74[_0xa234('0xc')]=moment()[_0xa234('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4a42a6(null,_0x324e74);}}});};
\ No newline at end of file
+var _0x1d50=['exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./smsInteraction.attributes'];(function(_0xe27810,_0x8b3e76){var _0x53dcec=function(_0x4a83c7){while(--_0x4a83c7){_0xe27810['push'](_0xe27810['shift']());}};_0x53dcec(++_0x8b3e76);}(_0x1d50,0x118));var _0x01d5=function(_0x442bf5,_0x18afae){_0x442bf5=_0x442bf5-0x0;var _0x5816a1=_0x1d50[_0x442bf5];return _0x5816a1;};'use strict';var _=require('lodash');var util=require(_0x01d5('0x0'));var logger=require(_0x01d5('0x1'))(_0x01d5('0x2'));var moment=require(_0x01d5('0x3'));var BPromise=require('bluebird');var rp=require(_0x01d5('0x4'));var fs=require('fs');var path=require(_0x01d5('0x5'));var rimraf=require('rimraf');var config=require(_0x01d5('0x6'));var attributes=require(_0x01d5('0x7'));module[_0x01d5('0x8')]=function(_0x4fc678,_0x2e96f1){return _0x4fc678[_0x01d5('0x9')](_0x01d5('0xa'),attributes,{'tableName':_0x01d5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x444404,_0x2ceea7,_0x13ac25){if(_0x444404[_0x01d5('0xc')](_0x01d5('0xd'))){_0x444404[_0x01d5('0xe')]=moment()['format'](_0x01d5('0xf'));}_0x13ac25(null,_0x444404);}}});};
\ No newline at end of file
index 2f1ffcd..2a38a0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf9ea=['register','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','UpdateSmsInteraction','body','options','raw','where','attributes','limit','catch','AddTagsToSmsInteraction','SmsInteraction','find','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost'];(function(_0x1351bf,_0x336f52){var _0x5326d6=function(_0x19e85f){while(--_0x19e85f){_0x1351bf['push'](_0x1351bf['shift']());}};_0x5326d6(++_0x336f52);}(_0xf9ea,0xe2));var _0xaf9e=function(_0x161d41,_0x306119){_0x161d41=_0x161d41-0x0;var _0x21daf6=_0xf9ea[_0x161d41];return _0x21daf6;};'use strict';var _=require(_0xaf9e('0x0'));var util=require(_0xaf9e('0x1'));var moment=require('moment');var BPromise=require(_0xaf9e('0x2'));var rs=require(_0xaf9e('0x3'));var fs=require('fs');var Redis=require(_0xaf9e('0x4'));var db=require(_0xaf9e('0x5'))['db'];var utils=require(_0xaf9e('0x6'));var logger=require('../../config/logger')(_0xaf9e('0x7'));var config=require(_0xaf9e('0x8'));var jayson=require(_0xaf9e('0x9'));var client=jayson[_0xaf9e('0xa')]['http']({'port':0x232a});config[_0xaf9e('0xb')]=_[_0xaf9e('0xc')](config[_0xaf9e('0xb')],{'host':_0xaf9e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')[_0xaf9e('0xe')](socket);function respondWithRpcPromise(_0x31346b,_0x18f318,_0x1a6555){return new BPromise(function(_0x67123f,_0x55cc90){return client['request'](_0x31346b,_0x1a6555)[_0xaf9e('0xf')](function(_0x214f04){logger['info'](_0xaf9e('0x10'),_0x18f318,_0xaf9e('0x11'));logger[_0xaf9e('0x12')](_0xaf9e('0x13'),_0x18f318,_0xaf9e('0x11'),JSON[_0xaf9e('0x14')](_0x214f04));if(_0x214f04[_0xaf9e('0x15')]){if(_0x214f04[_0xaf9e('0x15')][_0xaf9e('0x16')]===0x1f4){logger[_0xaf9e('0x15')](_0xaf9e('0x10'),_0x18f318,_0x214f04[_0xaf9e('0x15')][_0xaf9e('0x17')]);return _0x55cc90(_0x214f04[_0xaf9e('0x15')][_0xaf9e('0x17')]);}logger['error'](_0xaf9e('0x10'),_0x18f318,_0x214f04['error'][_0xaf9e('0x17')]);return _0x67123f(_0x214f04[_0xaf9e('0x15')]['message']);}else{logger[_0xaf9e('0x18')](_0xaf9e('0x10'),_0x18f318,'request\x20sent');_0x67123f(_0x214f04[_0xaf9e('0x19')][_0xaf9e('0x17')]);}})['catch'](function(_0x4132e6){logger[_0xaf9e('0x15')](_0xaf9e('0x10'),_0x18f318,_0x4132e6);_0x55cc90(_0x4132e6);});});}exports[_0xaf9e('0x1a')]=function(_0x2eda75){var _0x2c9c07=this;return new Promise(function(_0x727fed,_0x3e2a0f){return db['SmsInteraction']['update'](_0x2eda75[_0xaf9e('0x1b')],{'raw':_0x2eda75[_0xaf9e('0x1c')]?_0x2eda75[_0xaf9e('0x1c')][_0xaf9e('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2eda75[_0xaf9e('0x1c')]?_0x2eda75[_0xaf9e('0x1c')][_0xaf9e('0x1e')]||null:null,'attributes':_0x2eda75[_0xaf9e('0x1c')]?_0x2eda75[_0xaf9e('0x1c')][_0xaf9e('0x1f')]||null:null,'limit':_0x2eda75[_0xaf9e('0x1c')]?_0x2eda75[_0xaf9e('0x1c')][_0xaf9e('0x20')]||null:null})[_0xaf9e('0xf')](function(_0x16989d){logger[_0xaf9e('0x18')](_0xaf9e('0x1a'),_0x2eda75);logger[_0xaf9e('0x12')](_0xaf9e('0x1a'),_0x2eda75,JSON[_0xaf9e('0x14')](_0x16989d));_0x727fed(_0x16989d);})[_0xaf9e('0x21')](function(_0x1ddbee){logger[_0xaf9e('0x15')](_0xaf9e('0x1a'),_0x1ddbee[_0xaf9e('0x17')],_0x2eda75);_0x3e2a0f(_0x2c9c07[_0xaf9e('0x15')](0x1f4,_0x1ddbee[_0xaf9e('0x17')]));});});};exports[_0xaf9e('0x22')]=function(_0x9cebf1){return new Promise(function(_0x2e9c12,_0x3d25a8){return db[_0xaf9e('0x23')][_0xaf9e('0x24')]({'where':_0x9cebf1[_0xaf9e('0x1c')]?_0x9cebf1[_0xaf9e('0x1c')][_0xaf9e('0x1e')]||null:null})['then'](function(_0x3f509d){if(_0x3f509d){return _0x3f509d['addTags'](_0x9cebf1[_0xaf9e('0x1b')][_0xaf9e('0x25')],_['omit'](_0x9cebf1[_0xaf9e('0x1b')],[_0xaf9e('0x25'),'id'])||{});}})[_0xaf9e('0x26')](function(_0x3f87fb){logger[_0xaf9e('0x18')](_0xaf9e('0x27'),_0x9cebf1);logger[_0xaf9e('0x12')](_0xaf9e('0x27'),_0x9cebf1,JSON[_0xaf9e('0x14')](_0x3f87fb));_0x2e9c12(_0x3f87fb);})[_0xaf9e('0x21')](function(_0x2a7e14){logger[_0xaf9e('0x15')](_0xaf9e('0x27'),_0x2a7e14['message'],_0x9cebf1);_0x3d25a8(_this[_0xaf9e('0x15')](0x1f4,_0x2a7e14[_0xaf9e('0x17')]));});});};
\ No newline at end of file
+var _0x319e=['UpdateSmsInteraction','stringify','AddTagsToSmsInteraction','SmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','SmsInteraction,\x20%s,\x20%s','message','catch','update','body','options','raw','where','attributes','limit'];(function(_0x59eab9,_0x33a4a7){var _0x47bda4=function(_0x30b5aa){while(--_0x30b5aa){_0x59eab9['push'](_0x59eab9['shift']());}};_0x47bda4(++_0x33a4a7);}(_0x319e,0xd7));var _0xe319=function(_0x2bbfdf,_0x39a7aa){_0x2bbfdf=_0x2bbfdf-0x0;var _0x3767fd=_0x319e[_0x2bbfdf];return _0x3767fd;};'use strict';var _=require(_0xe319('0x0'));var util=require(_0xe319('0x1'));var moment=require(_0xe319('0x2'));var BPromise=require(_0xe319('0x3'));var rs=require(_0xe319('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe319('0x5'))['db'];var utils=require(_0xe319('0x6'));var logger=require(_0xe319('0x7'))(_0xe319('0x8'));var config=require('../../config/environment');var jayson=require(_0xe319('0x9'));var client=jayson[_0xe319('0xa')]['http']({'port':0x232a});config[_0xe319('0xb')]=_[_0xe319('0xc')](config[_0xe319('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xe319('0xd'))(new Redis(config[_0xe319('0xb')]));require('./smsInteraction.socket')[_0xe319('0xe')](socket);function respondWithRpcPromise(_0x2beb8a,_0xfc3fdd,_0x23b3d9){return new BPromise(function(_0x579862,_0x497bd7){return client['request'](_0x2beb8a,_0x23b3d9)[_0xe319('0xf')](function(_0x8d39fa){logger[_0xe319('0x10')]('SmsInteraction,\x20%s,\x20%s',_0xfc3fdd,_0xe319('0x11'));logger[_0xe319('0x12')](_0xe319('0x13'),_0xfc3fdd,_0xe319('0x11'),JSON['stringify'](_0x8d39fa));if(_0x8d39fa[_0xe319('0x14')]){if(_0x8d39fa[_0xe319('0x14')]['code']===0x1f4){logger[_0xe319('0x14')](_0xe319('0x15'),_0xfc3fdd,_0x8d39fa[_0xe319('0x14')][_0xe319('0x16')]);return _0x497bd7(_0x8d39fa[_0xe319('0x14')][_0xe319('0x16')]);}logger['error'](_0xe319('0x15'),_0xfc3fdd,_0x8d39fa['error'][_0xe319('0x16')]);return _0x579862(_0x8d39fa[_0xe319('0x14')][_0xe319('0x16')]);}else{logger[_0xe319('0x10')]('SmsInteraction,\x20%s,\x20%s',_0xfc3fdd,'request\x20sent');_0x579862(_0x8d39fa['result'][_0xe319('0x16')]);}})[_0xe319('0x17')](function(_0x1512fe){logger[_0xe319('0x14')](_0xe319('0x15'),_0xfc3fdd,_0x1512fe);_0x497bd7(_0x1512fe);});});}exports['UpdateSmsInteraction']=function(_0x19f4c0){var _0x387638=this;return new Promise(function(_0x1928f6,_0x2d8705){return db['SmsInteraction'][_0xe319('0x18')](_0x19f4c0[_0xe319('0x19')],{'raw':_0x19f4c0['options']?_0x19f4c0[_0xe319('0x1a')][_0xe319('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19f4c0[_0xe319('0x1a')]?_0x19f4c0[_0xe319('0x1a')][_0xe319('0x1c')]||null:null,'attributes':_0x19f4c0['options']?_0x19f4c0[_0xe319('0x1a')][_0xe319('0x1d')]||null:null,'limit':_0x19f4c0[_0xe319('0x1a')]?_0x19f4c0[_0xe319('0x1a')][_0xe319('0x1e')]||null:null})['then'](function(_0x28c4f6){logger[_0xe319('0x10')](_0xe319('0x1f'),_0x19f4c0);logger[_0xe319('0x12')](_0xe319('0x1f'),_0x19f4c0,JSON[_0xe319('0x20')](_0x28c4f6));_0x1928f6(_0x28c4f6);})['catch'](function(_0x534343){logger['error']('UpdateSmsInteraction',_0x534343[_0xe319('0x16')],_0x19f4c0);_0x2d8705(_0x387638[_0xe319('0x14')](0x1f4,_0x534343[_0xe319('0x16')]));});});};exports[_0xe319('0x21')]=function(_0x20160d){return new Promise(function(_0xd08837,_0x2bc343){return db[_0xe319('0x22')][_0xe319('0x23')]({'where':_0x20160d['options']?_0x20160d['options']['where']||null:null})[_0xe319('0xf')](function(_0x4fd70c){if(_0x4fd70c){return _0x4fd70c[_0xe319('0x24')](_0x20160d[_0xe319('0x19')][_0xe319('0x25')],_[_0xe319('0x26')](_0x20160d[_0xe319('0x19')],['ids','id'])||{});}})[_0xe319('0x27')](function(_0x398d05){logger[_0xe319('0x10')](_0xe319('0x28'),_0x20160d);logger[_0xe319('0x12')](_0xe319('0x28'),_0x20160d,JSON[_0xe319('0x20')](_0x398d05));_0xd08837(_0x398d05);})[_0xe319('0x17')](function(_0x45dc1c){logger[_0xe319('0x14')](_0xe319('0x28'),_0x45dc1c[_0xe319('0x16')],_0x20160d);_0x2bc343(_this[_0xe319('0x14')](0x1f4,_0x45dc1c[_0xe319('0x16')]));});});};
\ No newline at end of file
index a2d485e..0b3539e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fb1=['register','smsInteraction:','./smsInteraction.events','remove','update','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4fb1,0x1ee));var _0x14fb=function(_0x159c77,_0x39f075){_0x159c77=_0x159c77-0x0;var _0x11eb6b=_0x4fb1[_0x159c77];return _0x11eb6b;};'use strict';var SmsInteractionEvents=require(_0x14fb('0x0'));var events=['save',_0x14fb('0x1'),_0x14fb('0x2')];function createListener(_0x3f516f,_0x2820bf){return function(_0x2d226c){_0x2820bf['emit'](_0x3f516f,_0x2d226c);};}function removeListener(_0xa31c48,_0x175a7e){return function(){SmsInteractionEvents[_0x14fb('0x3')](_0xa31c48,_0x175a7e);};}exports[_0x14fb('0x4')]=function(_0x41379d){for(var _0x56c8f1=0x0,_0x3bbcd2=events['length'];_0x56c8f1<_0x3bbcd2;_0x56c8f1++){var _0x2b9b71=events[_0x56c8f1];var _0x4e22a9=createListener(_0x14fb('0x5')+_0x2b9b71,_0x41379d);SmsInteractionEvents['on'](_0x2b9b71,_0x4e22a9);}};
\ No newline at end of file
+var _0x45ee=['length','smsInteraction:','save','emit','removeListener','register'];(function(_0x35204,_0x15c770){var _0x4d91f7=function(_0xe87cd1){while(--_0xe87cd1){_0x35204['push'](_0x35204['shift']());}};_0x4d91f7(++_0x15c770);}(_0x45ee,0x18e));var _0xe45e=function(_0x86597f,_0x5dc3b3){_0x86597f=_0x86597f-0x0;var _0x1f4e98=_0x45ee[_0x86597f];return _0x1f4e98;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0xe45e('0x0'),'remove','update'];function createListener(_0x5bacac,_0x5417e1){return function(_0x37cc2c){_0x5417e1[_0xe45e('0x1')](_0x5bacac,_0x37cc2c);};}function removeListener(_0x415da1,_0x37d574){return function(){SmsInteractionEvents[_0xe45e('0x2')](_0x415da1,_0x37d574);};}exports[_0xe45e('0x3')]=function(_0x27a92d){for(var _0x16d2dd=0x0,_0x1a7ed9=events[_0xe45e('0x4')];_0x16d2dd<_0x1a7ed9;_0x16d2dd++){var _0x1e5316=events[_0x16d2dd];var _0x1b57a1=createListener(_0xe45e('0x5')+_0x1e5316,_0x27a92d);SmsInteractionEvents['on'](_0x1e5316,_0x1b57a1);}};
\ No newline at end of file
index 71380ff..b75f823 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d7b=['update','accept','/:id/reject','reject','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated','describe','/:id','post','tracked','sms','smsmessage:create','create','/:id/status','status','put'];(function(_0x534f08,_0x2cafb4){var _0x33bc92=function(_0x5dbfb5){while(--_0x5dbfb5){_0x534f08['push'](_0x534f08['shift']());}};_0x33bc92(++_0x2cafb4);}(_0x6d7b,0x13a));var _0xb6d7=function(_0x17ff72,_0x5a05c9){_0x17ff72=_0x17ff72-0x0;var _0x4b987c=_0x6d7b[_0x17ff72];return _0x4b987c;};'use strict';var multer=require(_0xb6d7('0x0'));var util=require('util');var path=require(_0xb6d7('0x1'));var timeout=require(_0xb6d7('0x2'));var express=require(_0xb6d7('0x3'));var router=express[_0xb6d7('0x4')]();var fs_extra=require(_0xb6d7('0x5'));var auth=require(_0xb6d7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb6d7('0x7'));var controller=require(_0xb6d7('0x8'));router[_0xb6d7('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb6d7('0x9')](_0xb6d7('0xa'),auth[_0xb6d7('0xb')](),controller[_0xb6d7('0xc')]);router[_0xb6d7('0x9')](_0xb6d7('0xd'),auth[_0xb6d7('0xb')](),controller['show']);router[_0xb6d7('0xe')]('/',auth[_0xb6d7('0xb')](),interaction[_0xb6d7('0xf')](_0xb6d7('0x10'),_0xb6d7('0x11')),controller[_0xb6d7('0x12')]);router['post'](_0xb6d7('0x13'),controller[_0xb6d7('0x14')]);router[_0xb6d7('0x15')](_0xb6d7('0xd'),auth['isAuthenticated'](),controller[_0xb6d7('0x16')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xb6d7('0x17')]);router['put'](_0xb6d7('0x18'),auth['isAuthenticated'](),controller[_0xb6d7('0x19')]);router[_0xb6d7('0x1a')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xb6d7('0x1b')]=router;
\ No newline at end of file
+var _0x578d=['../../config/environment','./smsMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','tracked','smsmessage:create','create','status','put','/:id/accept','accept','reject','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x578d,0x11a));var _0xd578=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x578d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd578('0x0'));var util=require('util');var path=require(_0xd578('0x1'));var timeout=require(_0xd578('0x2'));var express=require(_0xd578('0x3'));var router=express[_0xd578('0x4')]();var fs_extra=require(_0xd578('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd578('0x6'));var controller=require(_0xd578('0x7'));router[_0xd578('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd578('0x9'),auth[_0xd578('0xa')](),controller[_0xd578('0xb')]);router[_0xd578('0x8')](_0xd578('0xc'),auth[_0xd578('0xa')](),controller[_0xd578('0xd')]);router['post']('/',auth[_0xd578('0xa')](),interaction[_0xd578('0xe')]('sms',_0xd578('0xf')),controller[_0xd578('0x10')]);router['post']('/:id/status',controller[_0xd578('0x11')]);router['put'](_0xd578('0xc'),auth[_0xd578('0xa')](),controller['update']);router[_0xd578('0x12')](_0xd578('0x13'),auth['isAuthenticated'](),controller[_0xd578('0x14')]);router['put']('/:id/reject',auth[_0xd578('0xa')](),controller[_0xd578('0x15')]);router[_0xd578('0x16')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd578('0x17')]=router;
\ No newline at end of file
index 28c69eb..a0542b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf46b=['TEXT','medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x31e480,_0x293450){var _0x2076c8=function(_0x5cadea){while(--_0x5cadea){_0x31e480['push'](_0x31e480['shift']());}};_0x2076c8(++_0x293450);}(_0xf46b,0x11e));var _0xbf46=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xf46b[_0x525c7b];return _0x27b33e;};'use strict';var Sequelize=require(_0xbf46('0x0'));module[_0xbf46('0x1')]={'body':{'type':Sequelize[_0xbf46('0x2')](_0xbf46('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xbf46('0x4')]('in',_0xbf46('0x5')),'defaultValue':_0xbf46('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xbf46('0x6')](0xbe)},'phone':{'type':Sequelize[_0xbf46('0x6')]},'readAt':{'type':Sequelize[_0xbf46('0x7')]},'secret':{'type':Sequelize[_0xbf46('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xbf46('0x6')]},'providerResponse':{'type':Sequelize[_0xbf46('0x2')]}};
\ No newline at end of file
+var _0x0ee1=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x3b0c9d,_0x3ddeb5){var _0xcfc8d7=function(_0x320dc6){while(--_0x320dc6){_0x3b0c9d['push'](_0x3b0c9d['shift']());}};_0xcfc8d7(++_0x3ddeb5);}(_0x0ee1,0x1b0));var _0x10ee=function(_0x3d1807,_0x4fabc2){_0x3d1807=_0x3d1807-0x0;var _0x2b15c0=_0x0ee1[_0x3d1807];return _0x2b15c0;};'use strict';var Sequelize=require(_0x10ee('0x0'));module[_0x10ee('0x1')]={'body':{'type':Sequelize[_0x10ee('0x2')](_0x10ee('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x10ee('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x10ee('0x5')]('in',_0x10ee('0x6')),'defaultValue':_0x10ee('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x10ee('0x7')](0xbe)},'phone':{'type':Sequelize[_0x10ee('0x7')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x10ee('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x10ee('0x2')]}};
\ No newline at end of file
index bc05867..e39ed44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6e2=['sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','SIP/%s','channel','rejectmessage','SmsAccount','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','infobip','groupName','DELIVERED','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','save','update','destroy','name','send','index','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','merge','filter','options','includeAll','include','findAll','rows','show','SmsMessage','find','create','body','params','describe','sms-interactions','accept','read','readAt','format','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','EventManager','acceptmessage','reject'];(function(_0xc56386,_0x5cd340){var _0xd6c51d=function(_0x1b1da5){while(--_0x1b1da5){_0xc56386['push'](_0xc56386['shift']());}};_0xd6c51d(++_0x5cd340);}(_0xa6e2,0x1c6));var _0x2a6e=function(_0x11898f,_0x4985a0){_0x11898f=_0x11898f-0x0;var _0x423435=_0xa6e2[_0x11898f];return _0x423435;};'use strict';var emlformat=require(_0x2a6e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a6e('0x1'));var jsonpatch=require(_0x2a6e('0x2'));var rp=require(_0x2a6e('0x3'));var moment=require('moment');var BPromise=require(_0x2a6e('0x4'));var Mustache=require('mustache');var util=require(_0x2a6e('0x5'));var path=require(_0x2a6e('0x6'));var sox=require(_0x2a6e('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a6e('0x8'));var _=require(_0x2a6e('0x9'));var squel=require(_0x2a6e('0xa'));var crypto=require(_0x2a6e('0xb'));var jsforce=require(_0x2a6e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2a6e('0xd'));var Papa=require(_0x2a6e('0xe'));var Redis=require(_0x2a6e('0xf'));var authService=require(_0x2a6e('0x10'));var qs=require(_0x2a6e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a6e('0x12'));var logger=require(_0x2a6e('0x13'))(_0x2a6e('0x14'));var utils=require(_0x2a6e('0x15'));var config=require(_0x2a6e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2a6e('0x17'))['db'];config[_0x2a6e('0x18')]=_['defaults'](config[_0x2a6e('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2a6e('0x19'))[_0x2a6e('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x2a6e('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x2a6e('0x1b')][_0x2a6e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x2a77ec,_0x2f442e,_0x46a818,_0x324e2c){return new BPromise(function(_0x6ee911,_0x283a47){var _0x544c1d=_0x324e2c||client;return _0x544c1d[_0x2a6e('0x1d')](_0x2a77ec,_0x46a818)[_0x2a6e('0x1e')](function(_0x1c7e29){logger[_0x2a6e('0x1f')](_0x2a6e('0x20'),_0x2f442e,_0x2a6e('0x21'));logger[_0x2a6e('0x22')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2f442e,_0x2a6e('0x21'),JSON[_0x2a6e('0x23')](_0x1c7e29));if(_0x1c7e29[_0x2a6e('0x24')]){if(_0x1c7e29['error'][_0x2a6e('0x25')]===0x1f4){logger[_0x2a6e('0x24')](_0x2a6e('0x20'),_0x2f442e,_0x1c7e29[_0x2a6e('0x24')]['message']);return _0x283a47(_0x1c7e29['error'][_0x2a6e('0x26')]);}logger[_0x2a6e('0x24')]('SmsMessage,\x20%s,\x20%s',_0x2f442e,_0x1c7e29[_0x2a6e('0x24')][_0x2a6e('0x26')]);return _0x6ee911(_0x1c7e29[_0x2a6e('0x24')][_0x2a6e('0x26')]);}else{logger[_0x2a6e('0x1f')](_0x2a6e('0x20'),_0x2f442e,_0x2a6e('0x21'));_0x6ee911(_0x1c7e29['result']['message']);}})[_0x2a6e('0x27')](function(_0x4a9927){logger[_0x2a6e('0x24')](_0x2a6e('0x20'),_0x2f442e,_0x4a9927);_0x283a47(_0x4a9927);});});}function respondWithStatusCode(_0x3058b8,_0x11c58b){_0x11c58b=_0x11c58b||0xcc;return function(_0x5a3c7f){if(_0x5a3c7f){return _0x3058b8[_0x2a6e('0x28')](_0x11c58b);}return _0x3058b8[_0x2a6e('0x29')](_0x11c58b)[_0x2a6e('0x2a')]();};}function respondWithResult(_0x332a29,_0x136653){_0x136653=_0x136653||0xc8;return function(_0x46cd78){if(_0x46cd78){return _0x332a29[_0x2a6e('0x29')](_0x136653)[_0x2a6e('0x2b')](_0x46cd78);}};}function respondWithFilteredResult(_0x3cec59,_0x2052f6){return function(_0x2d3efd){if(_0x2d3efd){var _0x355e4d=typeof _0x2052f6['offset']===_0x2a6e('0x2c')&&typeof _0x2052f6['limit']===_0x2a6e('0x2c');var _0x31fd4a=_0x2d3efd[_0x2a6e('0x2d')];var _0x210ee3=_0x355e4d?0x0:_0x2052f6[_0x2a6e('0x2e')];var _0x6bebd8=_0x355e4d?_0x2d3efd[_0x2a6e('0x2d')]:_0x2052f6[_0x2a6e('0x2e')]+_0x2052f6[_0x2a6e('0x2f')];var _0x2a126d;if(_0x6bebd8>=_0x31fd4a){_0x6bebd8=_0x31fd4a;_0x2a126d=0xc8;}else{_0x2a126d=0xce;}_0x3cec59[_0x2a6e('0x29')](_0x2a126d);return _0x3cec59['set'](_0x2a6e('0x30'),_0x210ee3+'-'+_0x6bebd8+'/'+_0x31fd4a)[_0x2a6e('0x2b')](_0x2d3efd);}return null;};}function patchUpdates(_0xf7fb1e){return function(_0x42d3b0){try{jsonpatch['apply'](_0x42d3b0,_0xf7fb1e,!![]);}catch(_0x23faca){return BPromise['reject'](_0x23faca);}return _0x42d3b0[_0x2a6e('0x31')]();};}function saveUpdates(_0x43420d,_0x39033f){return function(_0x129226){if(_0x129226){return _0x129226[_0x2a6e('0x32')](_0x43420d)[_0x2a6e('0x1e')](function(_0x5a3410){return _0x5a3410;});}return null;};}function removeEntity(_0x14df2b,_0x24ad5b){return function(_0x2f2fbc){if(_0x2f2fbc){return _0x2f2fbc[_0x2a6e('0x33')]()[_0x2a6e('0x1e')](function(){_0x14df2b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3455d1,_0x5f462b){return function(_0x308e41){if(!_0x308e41){_0x3455d1[_0x2a6e('0x28')](0x194);}return _0x308e41;};}function handleError(_0x30e55f,_0x54346d){_0x54346d=_0x54346d||0x1f4;return function(_0x1ad4df){logger[_0x2a6e('0x24')](_0x1ad4df['stack']);if(_0x1ad4df[_0x2a6e('0x34')]){delete _0x1ad4df[_0x2a6e('0x34')];}_0x30e55f[_0x2a6e('0x29')](_0x54346d)[_0x2a6e('0x35')](_0x1ad4df);};}exports[_0x2a6e('0x36')]=function(_0x4d6961,_0xdc3c23){var _0x17331a={},_0x15c4ef={},_0x539019={'count':0x0,'rows':[]};var _0x2bce55=_['map'](db['SmsMessage'][_0x2a6e('0x37')],function(_0x49216a){return{'name':_0x49216a['fieldName'],'type':_0x49216a[_0x2a6e('0x38')][_0x2a6e('0x39')]};});_0x15c4ef['model']=_[_0x2a6e('0x3a')](_0x2bce55,'name');_0x15c4ef[_0x2a6e('0x3b')]=_[_0x2a6e('0x3c')](_0x4d6961[_0x2a6e('0x3b')]);_0x15c4ef[_0x2a6e('0x3d')]=_[_0x2a6e('0x3e')](_0x15c4ef[_0x2a6e('0x3f')],_0x15c4ef[_0x2a6e('0x3b')]);_0x17331a[_0x2a6e('0x40')]=_[_0x2a6e('0x3e')](_0x15c4ef['model'],qs[_0x2a6e('0x41')](_0x4d6961['query'][_0x2a6e('0x41')]));_0x17331a['attributes']=_0x17331a['attributes'][_0x2a6e('0x42')]?_0x17331a[_0x2a6e('0x40')]:_0x15c4ef[_0x2a6e('0x3f')];if(!_0x4d6961[_0x2a6e('0x3b')][_0x2a6e('0x43')]('nolimit')){_0x17331a[_0x2a6e('0x2f')]=qs[_0x2a6e('0x2f')](_0x4d6961[_0x2a6e('0x3b')][_0x2a6e('0x2f')]);_0x17331a[_0x2a6e('0x2e')]=qs['offset'](_0x4d6961['query'][_0x2a6e('0x2e')]);}_0x17331a['order']=qs[_0x2a6e('0x44')](_0x4d6961[_0x2a6e('0x3b')][_0x2a6e('0x44')]);_0x17331a[_0x2a6e('0x45')]=qs[_0x2a6e('0x3d')](_['pick'](_0x4d6961[_0x2a6e('0x3b')],_0x15c4ef['filters']),_0x2bce55);if(_0x4d6961[_0x2a6e('0x3b')]['filter']){_0x17331a['where']=_[_0x2a6e('0x46')](_0x17331a[_0x2a6e('0x45')],{'$or':_[_0x2a6e('0x3a')](_0x2bce55,function(_0x161f1d){if(_0x161f1d['type']!=='VIRTUAL'){var _0x2907d4={};_0x2907d4[_0x161f1d['name']]={'$like':'%'+_0x4d6961['query'][_0x2a6e('0x47')]+'%'};return _0x2907d4;}})});}_0x17331a=_[_0x2a6e('0x46')]({},_0x17331a,_0x4d6961[_0x2a6e('0x48')]);var _0xb3cfa9={'where':_0x17331a[_0x2a6e('0x45')]};return db['SmsMessage']['count'](_0xb3cfa9)['then'](function(_0x1317ec){_0x539019[_0x2a6e('0x2d')]=_0x1317ec;if(_0x4d6961['query'][_0x2a6e('0x49')]){_0x17331a[_0x2a6e('0x4a')]=[{'all':!![]}];}return db['SmsMessage'][_0x2a6e('0x4b')](_0x17331a);})[_0x2a6e('0x1e')](function(_0xf4b72f){_0x539019[_0x2a6e('0x4c')]=_0xf4b72f;return _0x539019;})[_0x2a6e('0x1e')](respondWithFilteredResult(_0xdc3c23,_0x17331a))['catch'](handleError(_0xdc3c23,null));};exports[_0x2a6e('0x4d')]=function(_0x4d775f,_0x20d32b){var _0x200ae6={'raw':!![],'where':{'id':_0x4d775f['params']['id']}},_0x595185={};_0x595185[_0x2a6e('0x3f')]=_['keys'](db[_0x2a6e('0x4e')][_0x2a6e('0x37')]);_0x595185[_0x2a6e('0x3b')]=_[_0x2a6e('0x3c')](_0x4d775f[_0x2a6e('0x3b')]);_0x595185['filters']=_[_0x2a6e('0x3e')](_0x595185[_0x2a6e('0x3f')],_0x595185[_0x2a6e('0x3b')]);_0x200ae6['attributes']=_[_0x2a6e('0x3e')](_0x595185[_0x2a6e('0x3f')],qs[_0x2a6e('0x41')](_0x4d775f[_0x2a6e('0x3b')][_0x2a6e('0x41')]));_0x200ae6['attributes']=_0x200ae6['attributes'][_0x2a6e('0x42')]?_0x200ae6[_0x2a6e('0x40')]:_0x595185[_0x2a6e('0x3f')];if(_0x4d775f[_0x2a6e('0x3b')][_0x2a6e('0x49')]){_0x200ae6[_0x2a6e('0x4a')]=[{'all':!![]}];}_0x200ae6=_[_0x2a6e('0x46')]({},_0x200ae6,_0x4d775f[_0x2a6e('0x48')]);return db['SmsMessage'][_0x2a6e('0x4f')](_0x200ae6)[_0x2a6e('0x1e')](handleEntityNotFound(_0x20d32b,null))[_0x2a6e('0x1e')](respondWithResult(_0x20d32b,null))[_0x2a6e('0x27')](handleError(_0x20d32b,null));};exports[_0x2a6e('0x50')]=function(_0x8b0919,_0x1e0ef7){return db[_0x2a6e('0x4e')]['create'](_0x8b0919[_0x2a6e('0x51')],{})[_0x2a6e('0x1e')](respondWithResult(_0x1e0ef7,0xc9))[_0x2a6e('0x27')](handleError(_0x1e0ef7,null));};exports['update']=function(_0x23ff7a,_0x5454c2){if(_0x23ff7a[_0x2a6e('0x51')]['id']){delete _0x23ff7a['body']['id'];}return db[_0x2a6e('0x4e')]['find']({'where':{'id':_0x23ff7a['params']['id']}})[_0x2a6e('0x1e')](handleEntityNotFound(_0x5454c2,null))[_0x2a6e('0x1e')](saveUpdates(_0x23ff7a['body'],null))['then'](respondWithResult(_0x5454c2,null))[_0x2a6e('0x27')](handleError(_0x5454c2,null));};exports[_0x2a6e('0x33')]=function(_0x501449,_0x68bfa3){return db[_0x2a6e('0x4e')][_0x2a6e('0x4f')]({'where':{'id':_0x501449[_0x2a6e('0x52')]['id']}})[_0x2a6e('0x1e')](handleEntityNotFound(_0x68bfa3,null))[_0x2a6e('0x1e')](removeEntity(_0x68bfa3,null))[_0x2a6e('0x27')](handleError(_0x68bfa3,null));};exports[_0x2a6e('0x53')]=function(_0x35bb95,_0x41ea7b){return db[_0x2a6e('0x4e')][_0x2a6e('0x53')]()[_0x2a6e('0x1e')](respondWithResult(_0x41ea7b,null))[_0x2a6e('0x27')](handleError(_0x41ea7b,null));};var interaction_log=require(_0x2a6e('0x13'))(_0x2a6e('0x54'));exports[_0x2a6e('0x55')]=function(_0x310548,_0x27d7e4,_0x566adc){var _0x2e1138={'agent':{},'channel':'sms'};if(_0x310548[_0x2a6e('0x51')]['id']){delete _0x310548[_0x2a6e('0x51')]['id'];}_0x310548[_0x2a6e('0x51')][_0x2a6e('0x56')]=!![];_0x310548[_0x2a6e('0x51')][_0x2a6e('0x57')]=moment()[_0x2a6e('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x310548[_0x2a6e('0x51')][_0x2a6e('0x59')]=_0x310548[_0x2a6e('0x51')]['UserId']||_0x310548[_0x2a6e('0x5a')]['id'];_0x2e1138[_0x2a6e('0x5b')]['id']=_0x310548['body'][_0x2a6e('0x59')];return db[_0x2a6e('0x4e')][_0x2a6e('0x4f')]({'where':{'id':_0x310548[_0x2a6e('0x52')]['id'],'UserId':null}})[_0x2a6e('0x1e')](handleEntityNotFound(_0x27d7e4,null))['then'](saveUpdates(_0x310548[_0x2a6e('0x51')],null))['then'](function(_0x3a327d){if(_0x3a327d){_0x2e1138[_0x2a6e('0x26')]=_0x3a327d[_0x2a6e('0x5c')]({'plain':!![]});return db[_0x2a6e('0x5d')]['find']({'where':{'id':_0x3a327d[_0x2a6e('0x5e')]}});}return null;})[_0x2a6e('0x1e')](handleEntityNotFound(_0x27d7e4,null))[_0x2a6e('0x1e')](function(_0x4b31de){if(_0x4b31de){return _0x4b31de[_0x2a6e('0x32')]({'UserId':_0x310548['body'][_0x2a6e('0x59')],'read1stAt':_[_0x2a6e('0x5f')](_0x4b31de[_0x2a6e('0x60')])?moment()[_0x2a6e('0x58')](_0x2a6e('0x61')):undefined});}return null;})[_0x2a6e('0x1e')](function(_0x396f83){if(_0x396f83){_0x2e1138['interaction']=_0x396f83['get']({'plain':!![]});interaction_log[_0x2a6e('0x1f')](_0x2a6e('0x62'),_0x310548['user']['id'],_0x310548[_0x2a6e('0x5a')]['name'],_0x310548['user']['role'],_0x2e1138[_0x2a6e('0x63')]['id'],_0x310548[_0x2a6e('0x51')]?JSON[_0x2a6e('0x23')](_0x310548[_0x2a6e('0x51')]):_0x2a6e('0x64'));return respondWithRpcPromise(_0x2a6e('0x65'),_0x2a6e('0x66'),_0x2e1138);}return null;})[_0x2a6e('0x1e')](function(_0x44bdce){var _0x337290=_0x2a6e('0x67')+_0x44bdce['message']['ContactId'];return db[_0x2a6e('0x68')]['query'](_0x337290,{'type':db[_0x2a6e('0x69')][_0x2a6e('0x6a')][_0x2a6e('0x6b')],'raw':!![]})['then'](function(_0x441fd2){return _0x441fd2;});})['then'](function(_0x31d965){if(_0x31d965){_0x2e1138[_0x2a6e('0x26')][_0x2a6e('0x6c')]=_0x31d965[0x0];if(!_0x310548[_0x2a6e('0x51')][_0x2a6e('0x59')])return;return db[_0x2a6e('0x6d')][_0x2a6e('0x4f')]({'where':{'id':_0x310548[_0x2a6e('0x51')]['UserId'],'role':_0x2a6e('0x5b')},'attributes':['id',_0x2a6e('0x34'),_0x2a6e('0x6e'),_0x2a6e('0x6f'),_0x2a6e('0x70')],'raw':!![]});}return null;})['then'](function(_0x25abdd){if(!_0x25abdd)return null;_0x2e1138[_0x2a6e('0x26')][_0x2a6e('0x5b')]=_0x25abdd;return _0x2e1138;})['then'](function(_0x4731a6){if(_0x4731a6){if(_0x310548['body'][_0x2a6e('0x71')]){_0x2e1138[_0x2a6e('0x26')][_0x2a6e('0x72')]=util[_0x2a6e('0x58')]('SIP/%s',_0x310548['user']['name']);_0x2e1138['message']['channel']=_0x2e1138['channel'];_0x2e1138[_0x2a6e('0x26')]['event']='accept';return respondWithRpcPromise(_0x2a6e('0x73'),'EventManager',{'event':_0x2a6e('0x74'),'message':_0x2e1138['message']},client9002)[_0x2a6e('0x1e')](function(){return _0x2e1138;});}return _0x2e1138;}return null;})[_0x2a6e('0x1e')](respondWithResult(_0x27d7e4,null))[_0x2a6e('0x27')](handleError(_0x27d7e4,null));};var interaction_log=require(_0x2a6e('0x13'))(_0x2a6e('0x54'));exports[_0x2a6e('0x75')]=function(_0x1a3d3b,_0x180590,_0x184eaf){var _0x31346c={'agent':{},'channel':_0x2a6e('0x76')};if(_0x1a3d3b[_0x2a6e('0x51')]['id']){delete _0x1a3d3b['body']['id'];}_0x1a3d3b[_0x2a6e('0x51')][_0x2a6e('0x59')]=_0x1a3d3b[_0x2a6e('0x51')][_0x2a6e('0x59')]||_0x1a3d3b['user']['id'];_0x31346c[_0x2a6e('0x5b')]['id']=_0x1a3d3b[_0x2a6e('0x51')][_0x2a6e('0x59')];return db[_0x2a6e('0x4e')]['find']({'where':{'id':_0x1a3d3b['params']['id'],'UserId':null}})[_0x2a6e('0x1e')](handleEntityNotFound(_0x180590,null))['then'](function(_0x9afdb3){if(_0x9afdb3){_0x31346c[_0x2a6e('0x26')]=_0x9afdb3['get']({'plain':!![]});return db[_0x2a6e('0x5d')][_0x2a6e('0x4f')]({'where':{'id':_0x9afdb3[_0x2a6e('0x5e')]}});}return null;})[_0x2a6e('0x1e')](handleEntityNotFound(_0x180590,null))[_0x2a6e('0x1e')](function(_0x5df06a){if(_0x5df06a){_0x31346c[_0x2a6e('0x63')]=_0x5df06a['get']({'plain':!![]});interaction_log[_0x2a6e('0x1f')](_0x2a6e('0x77'),_0x1a3d3b[_0x2a6e('0x5a')]['id'],_0x1a3d3b['user']['name'],_0x1a3d3b[_0x2a6e('0x5a')]['role'],_0x31346c['interaction']['id'],_0x1a3d3b[_0x2a6e('0x51')]?JSON['stringify'](_0x1a3d3b[_0x2a6e('0x51')]):_0x2a6e('0x64'));return respondWithRpcPromise(_0x2a6e('0x78'),_0x2a6e('0x79'),_0x31346c);}return null;})[_0x2a6e('0x1e')](function(_0xe86476){var _0x356606=_0x2a6e('0x67')+_0xe86476[_0x2a6e('0x26')][_0x2a6e('0x7a')];return db[_0x2a6e('0x68')][_0x2a6e('0x3b')](_0x356606,{'type':db[_0x2a6e('0x69')][_0x2a6e('0x6a')]['SELECT'],'raw':!![]})['then'](function(_0x5edba8){return _0x5edba8;});})[_0x2a6e('0x1e')](function(_0x3737ef){if(_0x3737ef){_0x31346c[_0x2a6e('0x26')]['contact']=_0x3737ef[0x0];if(!_0x1a3d3b[_0x2a6e('0x51')]['UserId'])return;return db['User'][_0x2a6e('0x4f')]({'where':{'id':_0x1a3d3b[_0x2a6e('0x51')]['UserId'],'role':_0x2a6e('0x5b')},'attributes':['id',_0x2a6e('0x34'),_0x2a6e('0x6e'),_0x2a6e('0x6f'),_0x2a6e('0x70')],'raw':!![]});}return null;})[_0x2a6e('0x1e')](function(_0xd7bb0){if(!_0xd7bb0)return null;_0x31346c[_0x2a6e('0x26')]['agent']=_0xd7bb0;return _0x31346c;})[_0x2a6e('0x1e')](function(_0x3d2935){if(_0x3d2935){_0x3d2935[_0x2a6e('0x26')][_0x2a6e('0x72')]=util[_0x2a6e('0x58')](_0x2a6e('0x7b'),_0x1a3d3b[_0x2a6e('0x5a')][_0x2a6e('0x34')]);_0x3d2935[_0x2a6e('0x26')][_0x2a6e('0x7c')]=_0x31346c[_0x2a6e('0x7c')];_0x3d2935[_0x2a6e('0x26')]['event']=_0x2a6e('0x75');respondWithRpcPromise('EventManager',_0x2a6e('0x73'),{'event':_0x2a6e('0x7d'),'message':_0x3d2935[_0x2a6e('0x26')]},client9002);return _0x31346c;}return null;})['then'](respondWithResult(_0x180590,null))['catch'](handleError(_0x180590,null));};exports[_0x2a6e('0x29')]=function(_0x2caf97,_0x3fd978,_0xab632){if(_0x2caf97[_0x2a6e('0x51')]['id']){delete _0x2caf97[_0x2a6e('0x51')]['id'];}var _0x40106c;return db[_0x2a6e('0x4e')][_0x2a6e('0x4f')]({'where':{'id':_0x2caf97[_0x2a6e('0x52')]['id']}})['then'](handleEntityNotFound(_0x3fd978,null))['then'](function(_0x404ef7){if(_0x404ef7){_0x40106c=_0x404ef7;return db[_0x2a6e('0x7e')][_0x2a6e('0x4f')]({'where':{'id':_0x404ef7['SmsAccountId']}});}})[_0x2a6e('0x1e')](handleEntityNotFound(_0x3fd978,null))[_0x2a6e('0x1e')](function(_0x3cd18e){if(_0x3cd18e){logger[_0x2a6e('0x22')](_0x2a6e('0x7f'),_0x2a6e('0x29'),_0x2a6e('0x80'),_0x3cd18e['type'],util[_0x2a6e('0x81')](_0x2caf97[_0x2a6e('0x51')],{'showHidden':![],'depth':null}));switch(_0x3cd18e[_0x2a6e('0x38')]){case _0x2a6e('0x82'):if(_0x2caf97[_0x2a6e('0x51')][_0x2a6e('0x83')]&&_0x2caf97[_0x2a6e('0x51')][_0x2a6e('0x83')]===_0x40106c[_0x2a6e('0x84')]){return _0x40106c[_0x2a6e('0x32')]({'read':!![]});}else{logger['error'](_0x2a6e('0x85'),_0x2a6e('0x29'),_0x2a6e('0x82'),util['inspect'](_0x2caf97[_0x2a6e('0x51')],{'showHidden':![],'depth':null}));}break;case _0x2a6e('0x86'):if(_0x2caf97[_0x2a6e('0x51')]['MessageUUID']&&_0x2caf97[_0x2a6e('0x51')][_0x2a6e('0x87')]===_0x40106c[_0x2a6e('0x84')]&&_[_0x2a6e('0x88')]([_0x2a6e('0x89'),_0x2a6e('0x8a')],_0x2caf97[_0x2a6e('0x51')][_0x2a6e('0x8b')])>=0x0){return _0x40106c[_0x2a6e('0x32')]({'read':!![]});}else{logger['error'](_0x2a6e('0x85'),_0x2a6e('0x29'),'plivio',util['inspect'](_0x2caf97[_0x2a6e('0x51')],{'showHidden':![],'depth':null}));}break;case _0x2a6e('0x8c'):var _0x1cc868=_0x2caf97[_0x2a6e('0x51')]['results'][0x0];if(_0x1cc868[_0x2a6e('0x29')][_0x2a6e('0x8d')]===_0x2a6e('0x8e')){return _0x40106c[_0x2a6e('0x32')]({'read':!![]});}else{logger['error'](_0x2a6e('0x85'),_0x2a6e('0x29'),_0x2a6e('0x8c'),util[_0x2a6e('0x81')](_0x2caf97['body'],{'showHidden':![],'depth':null}));}break;}return _0x40106c;}})[_0x2a6e('0x1e')](respondWithResult(_0x3fd978,null))[_0x2a6e('0x27')](handleError(_0x3fd978,null));};
\ No newline at end of file
+var _0xbd0a=['accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','isNil','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','contact','User','fullname','internal','manual','interface','channel','event','EventManager','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SELECT','email','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','indexOf','delivered','Status','results','groupName','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','client','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','destroy','stack','name','send','index','SmsMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','create','body','update','find','describe','sms-interactions'];(function(_0x36114b,_0x3937fb){var _0x288623=function(_0x325cb9){while(--_0x325cb9){_0x36114b['push'](_0x36114b['shift']());}};_0x288623(++_0x3937fb);}(_0xbd0a,0x153));var _0xabd0=function(_0x5d52d2,_0x577cef){_0x5d52d2=_0x5d52d2-0x0;var _0x22281c=_0xbd0a[_0x5d52d2];return _0x22281c;};'use strict';var emlformat=require(_0xabd0('0x0'));var rimraf=require(_0xabd0('0x1'));var zipdir=require(_0xabd0('0x2'));var jsonpatch=require(_0xabd0('0x3'));var rp=require(_0xabd0('0x4'));var moment=require(_0xabd0('0x5'));var BPromise=require(_0xabd0('0x6'));var Mustache=require(_0xabd0('0x7'));var util=require(_0xabd0('0x8'));var path=require('path');var sox=require(_0xabd0('0x9'));var csv=require(_0xabd0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xabd0('0xb'));var _=require(_0xabd0('0xc'));var squel=require(_0xabd0('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xabd0('0xe'));var toCsv=require(_0xabd0('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xabd0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xabd0('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabd0('0x11'));var logger=require(_0xabd0('0x12'))(_0xabd0('0x13'));var utils=require(_0xabd0('0x14'));var config=require(_0xabd0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xabd0('0x16'))['db'];config['redis']=_[_0xabd0('0x17')](config[_0xabd0('0x18')],{'host':_0xabd0('0x19'),'port':0x18eb});var socket=require(_0xabd0('0x1a'))(new Redis(config[_0xabd0('0x18')]));require(_0xabd0('0x1b'))[_0xabd0('0x1c')](socket);var jayson=require(_0xabd0('0x1d'));var client=jayson['client'][_0xabd0('0x1e')]({'port':0x232c});var client9002=jayson[_0xabd0('0x1f')][_0xabd0('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x570e1c,_0x11629b,_0x516366,_0x316c97){return new BPromise(function(_0x1f3569,_0x11a202){var _0xf3225c=_0x316c97||client;return _0xf3225c['request'](_0x570e1c,_0x516366)[_0xabd0('0x20')](function(_0x29c3ca){logger['info'](_0xabd0('0x21'),_0x11629b,_0xabd0('0x22'));logger[_0xabd0('0x23')](_0xabd0('0x24'),_0x11629b,'request\x20sent',JSON[_0xabd0('0x25')](_0x29c3ca));if(_0x29c3ca[_0xabd0('0x26')]){if(_0x29c3ca[_0xabd0('0x26')][_0xabd0('0x27')]===0x1f4){logger['error'](_0xabd0('0x21'),_0x11629b,_0x29c3ca[_0xabd0('0x26')][_0xabd0('0x28')]);return _0x11a202(_0x29c3ca['error'][_0xabd0('0x28')]);}logger['error'](_0xabd0('0x21'),_0x11629b,_0x29c3ca['error'][_0xabd0('0x28')]);return _0x1f3569(_0x29c3ca['error'][_0xabd0('0x28')]);}else{logger[_0xabd0('0x29')](_0xabd0('0x21'),_0x11629b,_0xabd0('0x22'));_0x1f3569(_0x29c3ca[_0xabd0('0x2a')][_0xabd0('0x28')]);}})[_0xabd0('0x2b')](function(_0x283e09){logger[_0xabd0('0x26')](_0xabd0('0x21'),_0x11629b,_0x283e09);_0x11a202(_0x283e09);});});}function respondWithStatusCode(_0x254bc3,_0x406498){_0x406498=_0x406498||0xcc;return function(_0x1cb297){if(_0x1cb297){return _0x254bc3[_0xabd0('0x2c')](_0x406498);}return _0x254bc3[_0xabd0('0x2d')](_0x406498)[_0xabd0('0x2e')]();};}function respondWithResult(_0x5e4b77,_0x2af258){_0x2af258=_0x2af258||0xc8;return function(_0x32e697){if(_0x32e697){return _0x5e4b77[_0xabd0('0x2d')](_0x2af258)[_0xabd0('0x2f')](_0x32e697);}};}function respondWithFilteredResult(_0x17b8c6,_0x463f69){return function(_0x196fd4){if(_0x196fd4){var _0x1b855d=typeof _0x463f69[_0xabd0('0x30')]==='undefined'&&typeof _0x463f69[_0xabd0('0x31')]==='undefined';var _0x237974=_0x196fd4[_0xabd0('0x32')];var _0x5aa8ab=_0x1b855d?0x0:_0x463f69[_0xabd0('0x30')];var _0x18c452=_0x1b855d?_0x196fd4[_0xabd0('0x32')]:_0x463f69[_0xabd0('0x30')]+_0x463f69['limit'];var _0x506ece;if(_0x18c452>=_0x237974){_0x18c452=_0x237974;_0x506ece=0xc8;}else{_0x506ece=0xce;}_0x17b8c6[_0xabd0('0x2d')](_0x506ece);return _0x17b8c6['set'](_0xabd0('0x33'),_0x5aa8ab+'-'+_0x18c452+'/'+_0x237974)[_0xabd0('0x2f')](_0x196fd4);}return null;};}function patchUpdates(_0x1dd947){return function(_0x3a1545){try{jsonpatch[_0xabd0('0x34')](_0x3a1545,_0x1dd947,!![]);}catch(_0x5dc77a){return BPromise[_0xabd0('0x35')](_0x5dc77a);}return _0x3a1545[_0xabd0('0x36')]();};}function saveUpdates(_0x702a8,_0x4eb56a){return function(_0x12ce91){if(_0x12ce91){return _0x12ce91['update'](_0x702a8)[_0xabd0('0x20')](function(_0x11e9ce){return _0x11e9ce;});}return null;};}function removeEntity(_0x52f4f7,_0x1df7ab){return function(_0x2b8d1f){if(_0x2b8d1f){return _0x2b8d1f[_0xabd0('0x37')]()['then'](function(){_0x52f4f7[_0xabd0('0x2d')](0xcc)[_0xabd0('0x2e')]();});}};}function handleEntityNotFound(_0x2ded78,_0x5b6d10){return function(_0x18020b){if(!_0x18020b){_0x2ded78['sendStatus'](0x194);}return _0x18020b;};}function handleError(_0x16a474,_0x3ec88d){_0x3ec88d=_0x3ec88d||0x1f4;return function(_0x4eb2e2){logger['error'](_0x4eb2e2[_0xabd0('0x38')]);if(_0x4eb2e2[_0xabd0('0x39')]){delete _0x4eb2e2[_0xabd0('0x39')];}_0x16a474[_0xabd0('0x2d')](_0x3ec88d)[_0xabd0('0x3a')](_0x4eb2e2);};}exports[_0xabd0('0x3b')]=function(_0x182d1e,_0x3765cf){var _0x1db212={},_0x4da910={},_0x4068cb={'count':0x0,'rows':[]};var _0x1829f9=_['map'](db[_0xabd0('0x3c')][_0xabd0('0x3d')],function(_0x3dbba2){return{'name':_0x3dbba2['fieldName'],'type':_0x3dbba2[_0xabd0('0x3e')][_0xabd0('0x3f')]};});_0x4da910[_0xabd0('0x40')]=_['map'](_0x1829f9,_0xabd0('0x39'));_0x4da910[_0xabd0('0x41')]=_[_0xabd0('0x42')](_0x182d1e[_0xabd0('0x41')]);_0x4da910[_0xabd0('0x43')]=_[_0xabd0('0x44')](_0x4da910[_0xabd0('0x40')],_0x4da910['query']);_0x1db212[_0xabd0('0x45')]=_[_0xabd0('0x44')](_0x4da910[_0xabd0('0x40')],qs[_0xabd0('0x46')](_0x182d1e['query'][_0xabd0('0x46')]));_0x1db212[_0xabd0('0x45')]=_0x1db212[_0xabd0('0x45')][_0xabd0('0x47')]?_0x1db212['attributes']:_0x4da910[_0xabd0('0x40')];if(!_0x182d1e[_0xabd0('0x41')]['hasOwnProperty'](_0xabd0('0x48'))){_0x1db212[_0xabd0('0x31')]=qs['limit'](_0x182d1e['query'][_0xabd0('0x31')]);_0x1db212[_0xabd0('0x30')]=qs[_0xabd0('0x30')](_0x182d1e[_0xabd0('0x41')][_0xabd0('0x30')]);}_0x1db212['order']=qs['sort'](_0x182d1e[_0xabd0('0x41')][_0xabd0('0x49')]);_0x1db212[_0xabd0('0x4a')]=qs[_0xabd0('0x43')](_[_0xabd0('0x4b')](_0x182d1e['query'],_0x4da910[_0xabd0('0x43')]),_0x1829f9);if(_0x182d1e[_0xabd0('0x41')][_0xabd0('0x4c')]){_0x1db212[_0xabd0('0x4a')]=_[_0xabd0('0x4d')](_0x1db212[_0xabd0('0x4a')],{'$or':_['map'](_0x1829f9,function(_0x50ca6f){if(_0x50ca6f[_0xabd0('0x3e')]!==_0xabd0('0x4e')){var _0x5c1b10={};_0x5c1b10[_0x50ca6f[_0xabd0('0x39')]]={'$like':'%'+_0x182d1e[_0xabd0('0x41')][_0xabd0('0x4c')]+'%'};return _0x5c1b10;}})});}_0x1db212=_[_0xabd0('0x4d')]({},_0x1db212,_0x182d1e[_0xabd0('0x4f')]);var _0xfe7629={'where':_0x1db212[_0xabd0('0x4a')]};return db[_0xabd0('0x3c')][_0xabd0('0x32')](_0xfe7629)[_0xabd0('0x20')](function(_0x4b8154){_0x4068cb[_0xabd0('0x32')]=_0x4b8154;if(_0x182d1e[_0xabd0('0x41')][_0xabd0('0x50')]){_0x1db212[_0xabd0('0x51')]=[{'all':!![]}];}return db[_0xabd0('0x3c')]['findAll'](_0x1db212);})[_0xabd0('0x20')](function(_0x843a42){_0x4068cb[_0xabd0('0x52')]=_0x843a42;return _0x4068cb;})[_0xabd0('0x20')](respondWithFilteredResult(_0x3765cf,_0x1db212))['catch'](handleError(_0x3765cf,null));};exports['show']=function(_0x75f7d,_0x2088df){var _0x1b35af={'raw':!![],'where':{'id':_0x75f7d[_0xabd0('0x53')]['id']}},_0x1ac834={};_0x1ac834[_0xabd0('0x40')]=_[_0xabd0('0x42')](db[_0xabd0('0x3c')][_0xabd0('0x3d')]);_0x1ac834[_0xabd0('0x41')]=_[_0xabd0('0x42')](_0x75f7d['query']);_0x1ac834[_0xabd0('0x43')]=_[_0xabd0('0x44')](_0x1ac834['model'],_0x1ac834['query']);_0x1b35af[_0xabd0('0x45')]=_[_0xabd0('0x44')](_0x1ac834[_0xabd0('0x40')],qs[_0xabd0('0x46')](_0x75f7d[_0xabd0('0x41')][_0xabd0('0x46')]));_0x1b35af[_0xabd0('0x45')]=_0x1b35af[_0xabd0('0x45')]['length']?_0x1b35af[_0xabd0('0x45')]:_0x1ac834[_0xabd0('0x40')];if(_0x75f7d[_0xabd0('0x41')]['includeAll']){_0x1b35af[_0xabd0('0x51')]=[{'all':!![]}];}_0x1b35af=_[_0xabd0('0x4d')]({},_0x1b35af,_0x75f7d[_0xabd0('0x4f')]);return db[_0xabd0('0x3c')]['find'](_0x1b35af)[_0xabd0('0x20')](handleEntityNotFound(_0x2088df,null))[_0xabd0('0x20')](respondWithResult(_0x2088df,null))[_0xabd0('0x2b')](handleError(_0x2088df,null));};exports['create']=function(_0x4ff8c0,_0x2c443b){return db[_0xabd0('0x3c')][_0xabd0('0x54')](_0x4ff8c0[_0xabd0('0x55')],{})[_0xabd0('0x20')](respondWithResult(_0x2c443b,0xc9))[_0xabd0('0x2b')](handleError(_0x2c443b,null));};exports[_0xabd0('0x56')]=function(_0x5f1abf,_0x9b917d){if(_0x5f1abf[_0xabd0('0x55')]['id']){delete _0x5f1abf['body']['id'];}return db[_0xabd0('0x3c')][_0xabd0('0x57')]({'where':{'id':_0x5f1abf[_0xabd0('0x53')]['id']}})['then'](handleEntityNotFound(_0x9b917d,null))[_0xabd0('0x20')](saveUpdates(_0x5f1abf['body'],null))[_0xabd0('0x20')](respondWithResult(_0x9b917d,null))[_0xabd0('0x2b')](handleError(_0x9b917d,null));};exports['destroy']=function(_0x12166f,_0x5b73c7){return db['SmsMessage'][_0xabd0('0x57')]({'where':{'id':_0x12166f[_0xabd0('0x53')]['id']}})['then'](handleEntityNotFound(_0x5b73c7,null))[_0xabd0('0x20')](removeEntity(_0x5b73c7,null))['catch'](handleError(_0x5b73c7,null));};exports['describe']=function(_0x5c02ed,_0x1cd005){return db[_0xabd0('0x3c')][_0xabd0('0x58')]()['then'](respondWithResult(_0x1cd005,null))[_0xabd0('0x2b')](handleError(_0x1cd005,null));};var interaction_log=require(_0xabd0('0x12'))(_0xabd0('0x59'));exports[_0xabd0('0x5a')]=function(_0x2d3c93,_0x1ccfd7,_0x16a298){var _0x3cf171={'agent':{},'channel':'sms'};if(_0x2d3c93[_0xabd0('0x55')]['id']){delete _0x2d3c93[_0xabd0('0x55')]['id'];}_0x2d3c93['body'][_0xabd0('0x5b')]=!![];_0x2d3c93[_0xabd0('0x55')]['readAt']=moment()[_0xabd0('0x5c')](_0xabd0('0x5d'));_0x2d3c93[_0xabd0('0x55')]['UserId']=_0x2d3c93[_0xabd0('0x55')][_0xabd0('0x5e')]||_0x2d3c93[_0xabd0('0x5f')]['id'];_0x3cf171[_0xabd0('0x60')]['id']=_0x2d3c93[_0xabd0('0x55')][_0xabd0('0x5e')];return db[_0xabd0('0x3c')][_0xabd0('0x57')]({'where':{'id':_0x2d3c93[_0xabd0('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x1ccfd7,null))[_0xabd0('0x20')](saveUpdates(_0x2d3c93[_0xabd0('0x55')],null))[_0xabd0('0x20')](function(_0xf09b13){if(_0xf09b13){_0x3cf171['message']=_0xf09b13[_0xabd0('0x61')]({'plain':!![]});return db[_0xabd0('0x62')][_0xabd0('0x57')]({'where':{'id':_0xf09b13['SmsInteractionId']}});}return null;})[_0xabd0('0x20')](handleEntityNotFound(_0x1ccfd7,null))[_0xabd0('0x20')](function(_0x355849){if(_0x355849){return _0x355849[_0xabd0('0x56')]({'UserId':_0x2d3c93[_0xabd0('0x55')][_0xabd0('0x5e')],'read1stAt':_[_0xabd0('0x63')](_0x355849['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xabd0('0x20')](function(_0x1df4e9){if(_0x1df4e9){_0x3cf171[_0xabd0('0x64')]=_0x1df4e9[_0xabd0('0x61')]({'plain':!![]});interaction_log[_0xabd0('0x29')](_0xabd0('0x65'),_0x2d3c93[_0xabd0('0x5f')]['id'],_0x2d3c93['user'][_0xabd0('0x39')],_0x2d3c93[_0xabd0('0x5f')]['role'],_0x3cf171[_0xabd0('0x64')]['id'],_0x2d3c93['body']?JSON[_0xabd0('0x25')](_0x2d3c93[_0xabd0('0x55')]):_0xabd0('0x66'));return respondWithRpcPromise(_0xabd0('0x67'),_0xabd0('0x68'),_0x3cf171);}return null;})['then'](function(_0x51a064){var _0x4e1819=_0xabd0('0x69')+_0x51a064[_0xabd0('0x28')][_0xabd0('0x6a')];return db[_0xabd0('0x6b')][_0xabd0('0x41')](_0x4e1819,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xabd0('0x20')](function(_0x56bd3e){return _0x56bd3e;});})[_0xabd0('0x20')](function(_0x11f8f2){if(_0x11f8f2){_0x3cf171[_0xabd0('0x28')][_0xabd0('0x6c')]=_0x11f8f2[0x0];if(!_0x2d3c93['body'][_0xabd0('0x5e')])return;return db[_0xabd0('0x6d')][_0xabd0('0x57')]({'where':{'id':_0x2d3c93[_0xabd0('0x55')][_0xabd0('0x5e')],'role':_0xabd0('0x60')},'attributes':['id',_0xabd0('0x39'),_0xabd0('0x6e'),'email',_0xabd0('0x6f')],'raw':!![]});}return null;})[_0xabd0('0x20')](function(_0x89e804){if(!_0x89e804)return null;_0x3cf171['message'][_0xabd0('0x60')]=_0x89e804;return _0x3cf171;})[_0xabd0('0x20')](function(_0x1d115d){if(_0x1d115d){if(_0x2d3c93[_0xabd0('0x55')][_0xabd0('0x70')]){_0x3cf171['message'][_0xabd0('0x71')]=util[_0xabd0('0x5c')]('SIP/%s',_0x2d3c93['user'][_0xabd0('0x39')]);_0x3cf171[_0xabd0('0x28')]['channel']=_0x3cf171[_0xabd0('0x72')];_0x3cf171[_0xabd0('0x28')][_0xabd0('0x73')]=_0xabd0('0x5a');return respondWithRpcPromise(_0xabd0('0x74'),_0xabd0('0x74'),{'event':'acceptmessage','message':_0x3cf171['message']},client9002)[_0xabd0('0x20')](function(){return _0x3cf171;});}return _0x3cf171;}return null;})[_0xabd0('0x20')](respondWithResult(_0x1ccfd7,null))['catch'](handleError(_0x1ccfd7,null));};var interaction_log=require(_0xabd0('0x12'))('sms-interactions');exports[_0xabd0('0x35')]=function(_0x9c0426,_0x3526e7,_0x293da8){var _0x37f089={'agent':{},'channel':'sms'};if(_0x9c0426['body']['id']){delete _0x9c0426[_0xabd0('0x55')]['id'];}_0x9c0426[_0xabd0('0x55')]['UserId']=_0x9c0426[_0xabd0('0x55')]['UserId']||_0x9c0426['user']['id'];_0x37f089[_0xabd0('0x60')]['id']=_0x9c0426[_0xabd0('0x55')]['UserId'];return db[_0xabd0('0x3c')][_0xabd0('0x57')]({'where':{'id':_0x9c0426[_0xabd0('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3526e7,null))[_0xabd0('0x20')](function(_0x5de396){if(_0x5de396){_0x37f089['message']=_0x5de396[_0xabd0('0x61')]({'plain':!![]});return db[_0xabd0('0x62')][_0xabd0('0x57')]({'where':{'id':_0x5de396[_0xabd0('0x75')]}});}return null;})[_0xabd0('0x20')](handleEntityNotFound(_0x3526e7,null))[_0xabd0('0x20')](function(_0x3793a3){if(_0x3793a3){_0x37f089['interaction']=_0x3793a3[_0xabd0('0x61')]({'plain':!![]});interaction_log['info'](_0xabd0('0x76'),_0x9c0426[_0xabd0('0x5f')]['id'],_0x9c0426[_0xabd0('0x5f')]['name'],_0x9c0426[_0xabd0('0x5f')][_0xabd0('0x77')],_0x37f089[_0xabd0('0x64')]['id'],_0x9c0426['body']?JSON[_0xabd0('0x25')](_0x9c0426[_0xabd0('0x55')]):_0xabd0('0x66'));return respondWithRpcPromise(_0xabd0('0x78'),_0xabd0('0x79'),_0x37f089);}return null;})[_0xabd0('0x20')](function(_0x205e99){var _0x4ba10f=_0xabd0('0x69')+_0x205e99[_0xabd0('0x28')]['ContactId'];return db['sequelize'][_0xabd0('0x41')](_0x4ba10f,{'type':db['Sequelize']['QueryTypes'][_0xabd0('0x7a')],'raw':!![]})[_0xabd0('0x20')](function(_0x436e1a){return _0x436e1a;});})[_0xabd0('0x20')](function(_0x23d94a){if(_0x23d94a){_0x37f089[_0xabd0('0x28')][_0xabd0('0x6c')]=_0x23d94a[0x0];if(!_0x9c0426[_0xabd0('0x55')][_0xabd0('0x5e')])return;return db[_0xabd0('0x6d')][_0xabd0('0x57')]({'where':{'id':_0x9c0426[_0xabd0('0x55')]['UserId'],'role':_0xabd0('0x60')},'attributes':['id',_0xabd0('0x39'),'fullname',_0xabd0('0x7b'),'internal'],'raw':!![]});}return null;})[_0xabd0('0x20')](function(_0x13cf1c){if(!_0x13cf1c)return null;_0x37f089['message'][_0xabd0('0x60')]=_0x13cf1c;return _0x37f089;})[_0xabd0('0x20')](function(_0x1d765b){if(_0x1d765b){_0x1d765b[_0xabd0('0x28')]['interface']=util[_0xabd0('0x5c')](_0xabd0('0x7c'),_0x9c0426[_0xabd0('0x5f')][_0xabd0('0x39')]);_0x1d765b[_0xabd0('0x28')][_0xabd0('0x72')]=_0x37f089['channel'];_0x1d765b['message']['event']=_0xabd0('0x35');respondWithRpcPromise('EventManager',_0xabd0('0x74'),{'event':_0xabd0('0x7d'),'message':_0x1d765b['message']},client9002);return _0x37f089;}return null;})[_0xabd0('0x20')](respondWithResult(_0x3526e7,null))[_0xabd0('0x2b')](handleError(_0x3526e7,null));};exports['status']=function(_0x95de25,_0x52bc3e,_0x5702c2){if(_0x95de25[_0xabd0('0x55')]['id']){delete _0x95de25['body']['id'];}var _0x2b2da7;return db[_0xabd0('0x3c')]['find']({'where':{'id':_0x95de25[_0xabd0('0x53')]['id']}})[_0xabd0('0x20')](handleEntityNotFound(_0x52bc3e,null))[_0xabd0('0x20')](function(_0x2e1792){if(_0x2e1792){_0x2b2da7=_0x2e1792;return db[_0xabd0('0x7e')][_0xabd0('0x57')]({'where':{'id':_0x2e1792[_0xabd0('0x7f')]}});}})[_0xabd0('0x20')](handleEntityNotFound(_0x52bc3e,null))['then'](function(_0xf01dd6){if(_0xf01dd6){logger[_0xabd0('0x23')](_0xabd0('0x24'),'status',_0xabd0('0x80'),_0xf01dd6[_0xabd0('0x3e')],util[_0xabd0('0x81')](_0x95de25[_0xabd0('0x55')],{'showHidden':![],'depth':null}));switch(_0xf01dd6[_0xabd0('0x3e')]){case _0xabd0('0x82'):if(_0x95de25[_0xabd0('0x55')][_0xabd0('0x83')]&&_0x95de25[_0xabd0('0x55')][_0xabd0('0x83')]===_0x2b2da7[_0xabd0('0x84')]){return _0x2b2da7[_0xabd0('0x56')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xabd0('0x2d'),_0xabd0('0x82'),util['inspect'](_0x95de25['body'],{'showHidden':![],'depth':null}));}break;case _0xabd0('0x85'):if(_0x95de25['body'][_0xabd0('0x86')]&&_0x95de25[_0xabd0('0x55')][_0xabd0('0x86')]===_0x2b2da7[_0xabd0('0x84')]&&_[_0xabd0('0x87')](['sent',_0xabd0('0x88')],_0x95de25[_0xabd0('0x55')][_0xabd0('0x89')])>=0x0){return _0x2b2da7[_0xabd0('0x56')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xabd0('0x2d'),'plivio',util[_0xabd0('0x81')](_0x95de25['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0xf6d8bc=_0x95de25[_0xabd0('0x55')][_0xabd0('0x8a')][0x0];if(_0xf6d8bc[_0xabd0('0x2d')][_0xabd0('0x8b')]===_0xabd0('0x8c')){return _0x2b2da7[_0xabd0('0x56')]({'read':!![]});}else{logger[_0xabd0('0x26')](_0xabd0('0x8d'),'status',_0xabd0('0x8e'),util['inspect'](_0x95de25[_0xabd0('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x2b2da7;}})[_0xabd0('0x20')](respondWithResult(_0x52bc3e,null))[_0xabd0('0x2b')](handleError(_0x52bc3e,null));};
\ No newline at end of file
index 8c72913..a8d745d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58e2=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5aa212,_0x5581d8){var _0x5afdf4=function(_0x28a94a){while(--_0x28a94a){_0x5aa212['push'](_0x5aa212['shift']());}};_0x5afdf4(++_0x5581d8);}(_0x58e2,0x1e5));var _0x258e=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x58e2[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0x258e('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x258e('0x1')](0x0);var events={'afterCreate':_0x258e('0x2'),'afterUpdate':_0x258e('0x3'),'afterDestroy':_0x258e('0x4')};function emitEvent(_0x110435){return function(_0x470b30,_0x11d4b5,_0x2c64f8){SmsMessageEvents[_0x258e('0x5')](_0x110435+':'+_0x470b30['id'],_0x470b30);SmsMessageEvents[_0x258e('0x5')](_0x110435,_0x470b30);_0x2c64f8(null);};}for(var e in events){if(events[_0x258e('0x6')](e)){var event=events[e];SmsMessage[_0x258e('0x7')](e,emitEvent(event));}}module[_0x258e('0x8')]=SmsMessageEvents;
\ No newline at end of file
+var _0xf214=['setMaxListeners','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x335ffa,_0x5ccc2b){var _0x5b242d=function(_0x57a48e){while(--_0x57a48e){_0x335ffa['push'](_0x335ffa['shift']());}};_0x5b242d(++_0x5ccc2b);}(_0xf214,0x133));var _0x4f21=function(_0x50a19b,_0x80c4d0){_0x50a19b=_0x50a19b-0x0;var _0x19b42d=_0xf214[_0x50a19b];return _0x19b42d;};'use strict';var EventEmitter=require(_0x4f21('0x0'));var SmsMessage=require('../../mysqldb')['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4f21('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4f21('0x2'),'afterDestroy':_0x4f21('0x3')};function emitEvent(_0x4b95fe){return function(_0x210f38,_0x47a70e,_0x392449){SmsMessageEvents['emit'](_0x4b95fe+':'+_0x210f38['id'],_0x210f38);SmsMessageEvents['emit'](_0x4b95fe,_0x210f38);_0x392449(null);};}for(var e in events){if(events[_0x4f21('0x4')](e)){var event=events[e];SmsMessage[_0x4f21('0x5')](e,emitEvent(event));}}module[_0x4f21('0x6')]=SmsMessageEvents;
\ No newline at end of file
index 6bd6e43..198faf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe80c=['username','password','smsMethod','sender','GET','split','sms','POST','session_key','total_sent','internal_order_id','deliveryReport','update','afterCreate','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','read','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','head','message_id','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','signature=','https://platform.clickatell.com/messages','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','application/json','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','define','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','findOne','SmsInteractionId','then','createdAt','error','SmsAccount','find','SmsAccountId','type','accountSid','authToken','phone','messages','create','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','twilio','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/'];(function(_0x5454e2,_0x576f66){var _0x5b9409=function(_0x52b3dd){while(--_0x52b3dd){_0x5454e2['push'](_0x5454e2['shift']());}};_0x5b9409(++_0x576f66);}(_0xe80c,0x1c2));var _0xce80=function(_0x20152f,_0x27ef67){_0x20152f=_0x20152f-0x0;var _0x3d85fd=_0xe80c[_0x20152f];return _0x3d85fd;};'use strict';var _=require('lodash');var util=require(_0xce80('0x0'));var logger=require(_0xce80('0x1'))(_0xce80('0x2'));var moment=require(_0xce80('0x3'));var BPromise=require(_0xce80('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce80('0x5'));var rimraf=require(_0xce80('0x6'));var config=require(_0xce80('0x7'));var attributes=require(_0xce80('0x8'));module['exports']=function(_0xb10325,_0x150f6a){return _0xb10325[_0xce80('0x9')]('SmsMessage',attributes,{'tableName':_0xce80('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xce80('0xb')]},{'name':'fti_sms_messages','fields':[_0xce80('0xc')],'type':_0xce80('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x51f349,_0x58894d,_0x2d7bf3){var _0x159969=_0xb10325[_0xce80('0xe')];var _0x53b6df=_0x51f349[_0xce80('0xf')]({'plain':!![]});if(_0x53b6df[_0xce80('0x10')][_0xce80('0x11')]()==='in'||_0x53b6df[_0xce80('0x10')]['toLowerCase']()===_0xce80('0x12')&&!_0x53b6df[_0xce80('0x13')]&&!_[_0xce80('0x14')](_0x53b6df['UserId'])){_0x159969['SmsInteraction'][_0xce80('0x15')]({'where':{'id':_0x53b6df[_0xce80('0x16')]}})[_0xce80('0x17')](function(_0x3cac82){if(_0x3cac82){_0x3cac82['update']({'lastMsgAt':_0x53b6df[_0xce80('0x18')],'lastMsgDirection':_0x53b6df['direction'][_0xce80('0x11')]()});}})['catch'](function(_0x24efa3){console[_0xce80('0x19')](_0x24efa3);});}if(_0x53b6df['direction']==='out'&&!_0x53b6df['secret']){var _0x35b40d;_0x159969[_0xce80('0x1a')][_0xce80('0x1b')]({'where':{'id':_0x53b6df[_0xce80('0x1c')]},'raw':!![]})[_0xce80('0x17')](function(_0x5ebf73){_0x35b40d=_0x5ebf73;if(_0x35b40d&&_0x35b40d[_0xce80('0x1d')]){switch(_0x35b40d[_0xce80('0x1d')]){case'twilio':var _0x56865a=require('twilio');if(_0x35b40d[_0xce80('0x1e')]&&_0x35b40d[_0xce80('0x1f')]&&_0x35b40d[_0xce80('0x20')]){var _0x44f399=new _0x56865a(_0x35b40d['accountSid'],_0x35b40d[_0xce80('0x1f')]);_0x44f399[_0xce80('0x21')][_0xce80('0x22')]({'body':_0x53b6df['body'],'to':_0x53b6df['phone'],'from':_0x35b40d[_0xce80('0x20')],'statusCallback':_0x35b40d['remote']+_0xce80('0x23')+_0x53b6df['id']+_0xce80('0x24')+_0x35b40d[_0xce80('0x25')]})[_0xce80('0x17')](function(_0x4fc91c){if(_0x4fc91c[_0xce80('0x26')]){return _0x51f349['update']({'messageId':_0x4fc91c[_0xce80('0x26')]});}})[_0xce80('0x27')](function(_0x4cd1f5){logger['error'](_0xce80('0x28'),'afterCreate',_0xce80('0x29'),util[_0xce80('0x2a')](_0x4cd1f5,{'showHidden':![],'depth':null}));});}else{logger[_0xce80('0x19')](_0xce80('0x28'),'afterCreate',_0xce80('0x29'),_0xce80('0x2b'));}break;case _0xce80('0x2c'):var _0x3d7c49=_0xce80('0x2d');if(_0x35b40d[_0xce80('0x2e')]&&_0x35b40d[_0xce80('0x2f')]){var _0x6d1190={'recipient':[_0x53b6df['phone']],'message':_0x53b6df[_0xce80('0xc')],'message_type':_0x35b40d[_0xce80('0x30')]};if(_0x35b40d[_0xce80('0x30')]&&_0x35b40d[_0xce80('0x30')]!=='SI'){_0x6d1190[_0xce80('0x31')]=_0x35b40d[_0xce80('0x20')];}var _0x35eac6={'url':_0x3d7c49+'login?username='+_0x35b40d[_0xce80('0x2e')]+'&password='+_0x35b40d['password'],'method':_0xce80('0x32')};rp(_0x35eac6)[_0xce80('0x17')](function(_0x39c1c0){var _0xa7aae9=_0x39c1c0[_0xce80('0x33')](';');var _0x31d431={'user_key':_0xa7aae9[0x0],'session_key':_0xa7aae9[0x1]};_0x35eac6={'url':_0x3d7c49+_0xce80('0x34'),'method':_0xce80('0x35'),'headers':{'user_key':_0x31d431['user_key'],'Session_key':_0x31d431[_0xce80('0x36')]},'json':!![],'body':_0x6d1190};return rp(_0x35eac6);})['then'](function(_0x25c8c7){if(_0x25c8c7[_0xce80('0x37')]>=0x1){var _0x107ad0={'messageId':_0x25c8c7[_0xce80('0x38')]};if(_0x35b40d[_0xce80('0x30')]!=='GP'||!_0x35b40d[_0xce80('0x39')]){_0x107ad0['read']=!![];}return _0x51f349[_0xce80('0x3a')](_0x107ad0);}else{return logger[_0xce80('0x19')](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x2c'),util[_0xce80('0x2a')](_0x25c8c7,{'showHidden':![],'depth':null}));}})['catch'](function(_0x4848d1){return logger[_0xce80('0x19')](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x2c'),util[_0xce80('0x2a')](_0x4848d1,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x2c'),_0xce80('0x3c'));}break;case _0xce80('0x3d'):if(_0x35b40d[_0xce80('0x1f')]){var _0x3cb994={'recipient':_0x53b6df[_0xce80('0x20')],'message':_0x53b6df[_0xce80('0xc')],'sender':_0x35b40d[_0xce80('0x3e')]||_0x35b40d['phone'],'authorization':_0x35b40d[_0xce80('0x1f')]};var _0x58894d={'method':_0xce80('0x35'),'uri':_0xce80('0x3f'),'body':_0x3cb994,'json':!![]};rp(_0x58894d)[_0xce80('0x17')](function(_0x2c87ce){var _0x222b08={'messageId':_0x2c87ce['requestid']};if(!_0x35b40d[_0xce80('0x39')]){_0x222b08[_0xce80('0x40')]=!![];}return _0x51f349[_0xce80('0x3a')](_0x222b08);})['catch'](function(_0x1d2dbe){logger['error'](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x3d'),util[_0xce80('0x2a')](_0x1d2dbe,{'showHidden':![],'depth':null}));});}else{logger[_0xce80('0x19')](_0xce80('0x28'),'afterCreate',_0xce80('0x3d'),_0xce80('0x41'));}break;case _0xce80('0x42'):if(_0x35b40d[_0xce80('0x2e')]&&_0x35b40d['password']){var _0x3cb994={'messages':[{'source':'xCALLY\x20Motion','to':_0x53b6df[_0xce80('0x20')],'body':_0x53b6df[_0xce80('0xc')],'from':_0x35b40d[_0xce80('0x3e')]||_0x35b40d[_0xce80('0x20')]}]};var _0x34be91=util[_0xce80('0x43')](_0xce80('0x44'),_0x35b40d[_0xce80('0x2e')],_0x35b40d[_0xce80('0x2f')]);var _0x58894d={'method':_0xce80('0x35'),'uri':_0xce80('0x45'),'body':_0x3cb994,'headers':{'Authorization':util[_0xce80('0x43')]('Basic\x20%s',new Buffer(_0x34be91)[_0xce80('0x46')](_0xce80('0x47')))},'json':!![]};rp(_0x58894d)[_0xce80('0x17')](function(_0x4e449f){if(_0x4e449f[_0xce80('0x48')]>=0xc8&&_0x4e449f['http_code']<=0xce){if(_0x4e449f[_0xce80('0x49')]&&_0x4e449f[_0xce80('0x49')][_0xce80('0x4a')]>0x0){var _0x5e7a00=_[_0xce80('0x4b')](_0x4e449f[_0xce80('0x49')][_0xce80('0x21')]);var _0x4d10a0={'messageId':_0x5e7a00[_0xce80('0x4c')]};if(!_0x35b40d['deliveryReport']){_0x4d10a0['read']=!![];}return _0x51f349[_0xce80('0x3a')](_0x4d10a0);}else{logger[_0xce80('0x19')](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x4d'),util[_0xce80('0x2a')](_0x4e449f,{'showHidden':![],'depth':null}));}}else{logger[_0xce80('0x19')](_0xce80('0x28'),'afterCreate',_0xce80('0x4d'),util['inspect'](_0x4e449f,{'showHidden':![],'depth':null}));}})[_0xce80('0x27')](function(_0x2dd290){logger[_0xce80('0x19')](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x4d'),util['inspect'](_0x2dd290,{'showHidden':![],'depth':null}));});}else{logger[_0xce80('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xce80('0x3b'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0xce80('0x4e'):if(_0x35b40d[_0xce80('0x4f')]&&_0x35b40d[_0xce80('0x1f')]){var _0x3cb994={'dst':_0x53b6df['phone'],'text':_0x53b6df[_0xce80('0xc')],'src':_0x35b40d[_0xce80('0x3e')]||_0x35b40d['phone'],'url':_0x35b40d[_0xce80('0x50')]+_0xce80('0x23')+_0x53b6df['id']+_0xce80('0x24')+_0x35b40d[_0xce80('0x25')]};var _0x34be91=util['format']('%s:%s',_0x35b40d[_0xce80('0x4f')],_0x35b40d[_0xce80('0x1f')]);var _0x58894d={'method':'POST','uri':util['format'](_0xce80('0x51'),_0x35b40d['authId']),'body':_0x3cb994,'headers':{'Authorization':util[_0xce80('0x43')](_0xce80('0x52'),new Buffer(_0x34be91)[_0xce80('0x46')](_0xce80('0x47')))},'json':!![]};rp(_0x58894d)[_0xce80('0x17')](function(_0x8610b){var _0x2869cf={'messageId':_0x8610b[_0xce80('0x53')][0x0]};return _0x51f349[_0xce80('0x3a')](_0x2869cf);})[_0xce80('0x27')](function(_0x142462){logger['error'](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x4e'),util[_0xce80('0x2a')](_0x142462,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xce80('0x28'),'afterCreate',_0xce80('0x4e'),_0xce80('0x54'));}break;case _0xce80('0x55'):if(_0x35b40d[_0xce80('0x2e')]&&_0x35b40d[_0xce80('0x2f')]){if(_0x35b40d[_0xce80('0x56')]){var _0x3c5915={'method':_0xce80('0x35'),'uri':_0x35b40d[_0xce80('0x56')]+_0xce80('0x57'),'body':{'username':_0x35b40d['username'],'password':_0x35b40d[_0xce80('0x2f')]},'json':!![]};return rp(_0x3c5915)[_0xce80('0x17')](function(_0x120cac){var _0x23566f={'method':_0xce80('0x35'),'uri':_0x35b40d[_0xce80('0x56')]+_0xce80('0x58'),'body':{'messages':[{'from':_0x35b40d[_0xce80('0x20')],'destinations':[{'to':_0x53b6df[_0xce80('0x20')]}],'text':_0x53b6df[_0xce80('0xc')],'notifyUrl':_0x35b40d[_0xce80('0x50')]+_0xce80('0x23')+_0x53b6df['id']+_0xce80('0x24')+_0x35b40d[_0xce80('0x25')],'notifyContentType':'application/json','callbackData':_0x35b40d[_0xce80('0x20')]+';'+_0x53b6df[_0xce80('0xc')]}]},'headers':{'Authorization':_0xce80('0x59')+_0x120cac['token']},'json':!![]};return rp(_0x23566f)[_0xce80('0x17')](function(_0x4ff3f0){if(_0x4ff3f0['messages']){var _0x2a8d9f={'messageId':_0x4ff3f0['messages'][0x0][_0xce80('0xb')]};if(!_0x35b40d[_0xce80('0x39')]){_0x2a8d9f[_0xce80('0x40')]=!![];}return _0x51f349['update'](_0x2a8d9f);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xce80('0x3b'),_0xce80('0x55'),util[_0xce80('0x2a')](_0x4ff3f0,{'showHidden':![],'depth':null}));}});})[_0xce80('0x27')](function(_0x4309a2){return logger[_0xce80('0x19')](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x55'),util[_0xce80('0x2a')](_0x4309a2,{'showHidden':![],'depth':null}));});}else{logger[_0xce80('0x19')](_0xce80('0x28'),'afterCreate','infobip',_0xce80('0x5a'));}}else{logger[_0xce80('0x19')](_0xce80('0x28'),'afterCreate',_0xce80('0x55'),_0xce80('0x3c'));}break;case _0xce80('0x5b'):var _0x577598=require(_0xce80('0x5c'));if(_0x35b40d[_0xce80('0x5d')]){var _0x1e46ec={};_0x1e46ec[_0xce80('0x5e')]=_0x35b40d['username'];_0x1e46ec[_0xce80('0x20')]=_0x53b6df['phone'];_0x1e46ec[_0xce80('0x31')]=_0x35b40d[_0xce80('0x20')];_0x1e46ec[_0xce80('0x5f')]=_0x53b6df[_0xce80('0xc')];_0x1e46ec[_0xce80('0x60')]=+new Date();var _0x29dfc8='';var _0x1eb92b='';var _0x19b642=Object[_0xce80('0x61')](_0x1e46ec);_0x19b642[_0xce80('0x62')]();for(var _0x309342=0x0;_0x309342<_0x19b642[_0xce80('0x63')];_0x309342++){if(_0x29dfc8!=''){_0x29dfc8+='&';}_0x29dfc8+=_0x19b642[_0x309342]+'='+encodeURIComponent(_0x1e46ec[_0x19b642[_0x309342]]);_0x1eb92b+=_0x1e46ec[_0x19b642[_0x309342]];}_0x1eb92b+=_0x35b40d[_0xce80('0x5d')];_0x1eb92b=_0x577598[_0xce80('0x64')](_0xce80('0x65'))['update'](_0x1eb92b)['digest']('hex');if(_0x29dfc8!==''){_0x29dfc8+='&';}_0x29dfc8+=_0xce80('0x66')+_0x1eb92b;var _0x35eac6={'method':_0xce80('0x32'),'uri':_0x35b40d[_0xce80('0x56')]+'/external/get/send.php?'+_0x29dfc8,'json':!![]};return rp(_0x35eac6)[_0xce80('0x17')](function(_0x9215aa){var _0x422b16=Object[_0xce80('0x61')](_0x9215aa);if(_0x9215aa[_0x422b16[0x0]][_0xce80('0x19')]&&parseInt(_0x9215aa[_0x422b16[0x0]][_0xce80('0x19')])===0x0){var _0x2b9cd5={'messageId':_0x9215aa[_0x422b16[0x0]]['id_sms']};if(!_0x35b40d[_0xce80('0x39')]){_0x2b9cd5[_0xce80('0x40')]=!![];}return _0x51f349[_0xce80('0x3a')](_0x2b9cd5);}else{return logger['error'](_0xce80('0x28'),'afterCreate',_0xce80('0x5b'),util[_0xce80('0x2a')](_0x9215aa['error'],{'showHidden':![],'depth':null}));}})[_0xce80('0x27')](function(_0x4fe5b8){return logger[_0xce80('0x19')](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x5b'),util[_0xce80('0x2a')](_0x4fe5b8,{'showHidden':![],'depth':null}));});}else{logger[_0xce80('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xce80('0x3b'),'csc','Missing\x20parameters:\x20apiKey');}break;case'clickatell':if(_0x35b40d['apiKey']){var _0x2aeb6f={'method':_0xce80('0x35'),'uri':_0xce80('0x67'),'headers':{'Authorization':_0x35b40d[_0xce80('0x5d')]},'body':{'content':_0x53b6df[_0xce80('0xc')],'to':[_0x53b6df[_0xce80('0x20')]],'from':_0x35b40d[_0xce80('0x20')],'binary':![],'clientMessageId':'uuid','charset':_0xce80('0x68')},'json':!![]};rp(_0x2aeb6f)['then'](function(_0x1a7cd8){if(!_0x1a7cd8[_0xce80('0x19')]){var _0x38a5f3={'messageId':_0x1a7cd8[_0xce80('0x21')][0x0][_0xce80('0x69')]};if(!_0x35b40d[_0xce80('0x39')]){_0x38a5f3[_0xce80('0x40')]=!![];}return _0x51f349[_0xce80('0x3a')](_0x38a5f3);}else{return logger[_0xce80('0x19')](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x6a'),util[_0xce80('0x2a')](_0x1a7cd8[_0xce80('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4ee1b5){return logger['error'](_0xce80('0x28'),'afterCreate',_0xce80('0x6a'),util[_0xce80('0x2a')](_0x4ee1b5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xce80('0x28'),'afterCreate',_0xce80('0x6a'),'Missing\x20parameters:\x20apiKey');}break;case _0xce80('0x6b'):if(_0x35b40d[_0xce80('0x2e')]&&_0x35b40d[_0xce80('0x2f')]){var _0x34be91=util[_0xce80('0x43')](_0xce80('0x44'),_0x35b40d[_0xce80('0x2e')],_0x35b40d[_0xce80('0x2f')]);var _0x58894d={'method':'POST','uri':_0xce80('0x6c')+_0x35b40d[_0xce80('0x6d')]+_0xce80('0x6e'),'body':{'to':[_0x53b6df[_0xce80('0x20')]],'text':_0x53b6df[_0xce80('0xc')],'from':_0x35b40d['phone'],'applicationId':_0x35b40d[_0xce80('0x6f')]},'headers':{'Authorization':util[_0xce80('0x43')](_0xce80('0x52'),new Buffer(_0x34be91)[_0xce80('0x46')](_0xce80('0x47')))},'json':!![]};rp(_0x58894d)[_0xce80('0x17')](function(_0x4bcc04){if(_0x4bcc04['id']){var _0x2cfe92={'messageId':_0x4bcc04['id']};return _0x51f349[_0xce80('0x3a')](_0x2cfe92);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xce80('0x6b'),util[_0xce80('0x2a')](_0x4bcc04,{'showHidden':![],'depth':null}));}})[_0xce80('0x27')](function(_0x572197){logger[_0xce80('0x19')](_0xce80('0x28'),_0xce80('0x3b'),'bandwidth',util[_0xce80('0x2a')](_0x572197,{'showHidden':![],'depth':null}));});}else{logger[_0xce80('0x19')](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x6b'),_0xce80('0x3c'));}break;case _0xce80('0x70'):if(_0x35b40d[_0xce80('0x5d')]){var _0x49c6cb={};var _0x35eac6={'method':'POST','uri':_0xce80('0x71'),'headers':{'Authorization':'Bearer\x20'+_0x35b40d['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x35b40d[_0xce80('0x20')],'to':_0x53b6df['phone'],'text':_0x53b6df[_0xce80('0xc')]},'json':!![]};return rp(_0x35eac6)[_0xce80('0x17')](function(_0x98026e){if(_0x98026e[_0xce80('0x72')]==0xca){_0x49c6cb[_0xce80('0x73')]=_0x98026e;var _0x1d2e8c={'method':_0xce80('0x35'),'uri':_0xce80('0x74'),'headers':{'Authorization':_0xce80('0x75')+_0x35b40d['apiKey'],'Content-Type':_0xce80('0x76')},'body':{'refid':_0x49c6cb[_0xce80('0x73')][_0xce80('0x77')]},'json':!![]};return rp(_0x1d2e8c)[_0xce80('0x17')](function(_0x1e4b20){_0x49c6cb[_0xce80('0x78')]=_0x1e4b20;var _0x1572de={'messageId':_0x49c6cb[_0xce80('0x73')][_0xce80('0x77')],'read':!![]};return _0x51f349[_0xce80('0x3a')](_0x1572de);});}else{return logger[_0xce80('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xce80('0x3b'),_0xce80('0x70'),util['inspect'](_0x98026e,{'showHidden':![],'depth':null}));}})[_0xce80('0x27')](function(_0x12c43a){return logger[_0xce80('0x19')](_0xce80('0x28'),_0xce80('0x3b'),_0xce80('0x70'),util[_0xce80('0x2a')](_0x12c43a,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xce80('0x70'),_0xce80('0x79'));}break;}}})['finally'](function(){_0x2d7bf3();});}else{_0x2d7bf3();}}},'charset':_0xce80('0x7a'),'collate':_0xce80('0x7b')});};
\ No newline at end of file
+var _0x0713=['phone','remote','/api/sms/messages/','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','&password=','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','Basic\x20%s','toString','base64','http_code','data','queued_count','clickSend','plivo','authId','senderString','/status?token=','token','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','login','keys','length','apiKey','createHash','digest','signature=','GET','/external/get/send.php?','clickatell','https://platform.clickatell.com/messages','uuid','apiMessageId','Missing\x20parameters:\x20apiKey','bandwidth','https://messaging.bandwidth.com/api/v2/users/','applicationId','Missing\x20parameters:\x20username,\x20password','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','application/json','refid','status','Token\x20not\x20received','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','isNil','SmsInteraction','findOne','then','update','createdAt','catch','error','out','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','create'];(function(_0x515a7b,_0x55c5e7){var _0x32068c=function(_0x77aed4){while(--_0x77aed4){_0x515a7b['push'](_0x515a7b['shift']());}};_0x32068c(++_0x55c5e7);}(_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':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]},{'name':_0x3071('0xd'),'fields':[_0x3071('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3457cd,_0x2610b4,_0x937259){var _0xff9a29=_0xabd7b6[_0x3071('0xf')];var _0x4a470a=_0x3457cd[_0x3071('0x10')]({'plain':!![]});if(_0x4a470a[_0x3071('0x11')][_0x3071('0x12')]()==='in'||_0x4a470a[_0x3071('0x11')][_0x3071('0x12')]()==='out'&&!_0x4a470a['secret']&&!_[_0x3071('0x13')](_0x4a470a['UserId'])){_0xff9a29[_0x3071('0x14')][_0x3071('0x15')]({'where':{'id':_0x4a470a['SmsInteractionId']}})[_0x3071('0x16')](function(_0x4e1219){if(_0x4e1219){_0x4e1219[_0x3071('0x17')]({'lastMsgAt':_0x4a470a[_0x3071('0x18')],'lastMsgDirection':_0x4a470a[_0x3071('0x11')][_0x3071('0x12')]()});}})[_0x3071('0x19')](function(_0x2a6a4b){console[_0x3071('0x1a')](_0x2a6a4b);});}if(_0x4a470a[_0x3071('0x11')]===_0x3071('0x1b')&&!_0x4a470a[_0x3071('0x1c')]){var _0x5f3c22;_0xff9a29[_0x3071('0x1d')][_0x3071('0x1e')]({'where':{'id':_0x4a470a[_0x3071('0x1f')]},'raw':!![]})[_0x3071('0x16')](function(_0x3acf0e){_0x5f3c22=_0x3acf0e;if(_0x5f3c22&&_0x5f3c22[_0x3071('0x20')]){switch(_0x5f3c22[_0x3071('0x20')]){case _0x3071('0x21'):var _0x502a16=require(_0x3071('0x21'));if(_0x5f3c22[_0x3071('0x22')]&&_0x5f3c22[_0x3071('0x23')]&&_0x5f3c22['phone']){var _0xb8f4e3=new _0x502a16(_0x5f3c22['accountSid'],_0x5f3c22[_0x3071('0x23')]);_0xb8f4e3[_0x3071('0x24')][_0x3071('0x25')]({'body':_0x4a470a[_0x3071('0xe')],'to':_0x4a470a[_0x3071('0x26')],'from':_0x5f3c22[_0x3071('0x26')],'statusCallback':_0x5f3c22[_0x3071('0x27')]+_0x3071('0x28')+_0x4a470a['id']+'/status?token='+_0x5f3c22['token']})[_0x3071('0x16')](function(_0xb05b1d){if(_0xb05b1d[_0x3071('0x29')]){return _0x3457cd[_0x3071('0x17')]({'messageId':_0xb05b1d[_0x3071('0x29')]});}})[_0x3071('0x19')](function(_0x7a4cb4){logger[_0x3071('0x1a')](_0x3071('0x2a'),'afterCreate',_0x3071('0x21'),util[_0x3071('0x2b')](_0x7a4cb4,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x21'),_0x3071('0x2d'));}break;case _0x3071('0x2e'):var _0x3fa3b8=_0x3071('0x2f');if(_0x5f3c22[_0x3071('0x30')]&&_0x5f3c22[_0x3071('0x31')]){var _0x32f1b4={'recipient':[_0x4a470a[_0x3071('0x26')]],'message':_0x4a470a[_0x3071('0xe')],'message_type':_0x5f3c22['smsMethod']};if(_0x5f3c22['smsMethod']&&_0x5f3c22[_0x3071('0x32')]!=='SI'){_0x32f1b4[_0x3071('0x33')]=_0x5f3c22[_0x3071('0x26')];}var _0x32b2e2={'url':_0x3fa3b8+_0x3071('0x34')+_0x5f3c22[_0x3071('0x30')]+_0x3071('0x35')+_0x5f3c22[_0x3071('0x31')],'method':'GET'};rp(_0x32b2e2)['then'](function(_0x4ab983){var _0x1b0aaf=_0x4ab983[_0x3071('0x36')](';');var _0x5b5bf1={'user_key':_0x1b0aaf[0x0],'session_key':_0x1b0aaf[0x1]};_0x32b2e2={'url':_0x3fa3b8+_0x3071('0x37'),'method':_0x3071('0x38'),'headers':{'user_key':_0x5b5bf1[_0x3071('0x39')],'Session_key':_0x5b5bf1[_0x3071('0x3a')]},'json':!![],'body':_0x32f1b4};return rp(_0x32b2e2);})['then'](function(_0x218a82){if(_0x218a82[_0x3071('0x3b')]>=0x1){var _0x602719={'messageId':_0x218a82[_0x3071('0x3c')]};if(_0x5f3c22[_0x3071('0x32')]!=='GP'||!_0x5f3c22[_0x3071('0x3d')]){_0x602719[_0x3071('0x3e')]=!![];}return _0x3457cd[_0x3071('0x17')](_0x602719);}else{return logger['error'](_0x3071('0x2a'),'afterCreate','skebby',util[_0x3071('0x2b')](_0x218a82,{'showHidden':![],'depth':null}));}})[_0x3071('0x19')](function(_0x54d9c3){return logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x2e'),util[_0x3071('0x2b')](_0x54d9c3,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x2e'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3071('0x3f'):if(_0x5f3c22['authToken']){var _0xda07a4={'recipient':_0x4a470a[_0x3071('0x26')],'message':_0x4a470a['body'],'sender':_0x5f3c22['senderString']||_0x5f3c22[_0x3071('0x26')],'authorization':_0x5f3c22[_0x3071('0x23')]};var _0x2610b4={'method':'POST','uri':_0x3071('0x40'),'body':_0xda07a4,'json':!![]};rp(_0x2610b4)['then'](function(_0x1ac90a){var _0x4b7928={'messageId':_0x1ac90a[_0x3071('0x41')]};if(!_0x5f3c22[_0x3071('0x3d')]){_0x4b7928[_0x3071('0x3e')]=!![];}return _0x3457cd[_0x3071('0x17')](_0x4b7928);})[_0x3071('0x19')](function(_0x593c9c){logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x3f'),util[_0x3071('0x2b')](_0x593c9c,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x3f'),_0x3071('0x42'));}break;case _0x3071('0x43'):if(_0x5f3c22[_0x3071('0x30')]&&_0x5f3c22['password']){var _0xda07a4={'messages':[{'source':'xCALLY\x20Motion','to':_0x4a470a['phone'],'body':_0x4a470a['body'],'from':_0x5f3c22['senderString']||_0x5f3c22[_0x3071('0x26')]}]};var _0x456921=util[_0x3071('0x44')](_0x3071('0x45'),_0x5f3c22[_0x3071('0x30')],_0x5f3c22[_0x3071('0x31')]);var _0x2610b4={'method':_0x3071('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0xda07a4,'headers':{'Authorization':util[_0x3071('0x44')](_0x3071('0x46'),new Buffer(_0x456921)[_0x3071('0x47')](_0x3071('0x48')))},'json':!![]};rp(_0x2610b4)[_0x3071('0x16')](function(_0x5ef13f){if(_0x5ef13f['http_code']>=0xc8&&_0x5ef13f[_0x3071('0x49')]<=0xce){if(_0x5ef13f[_0x3071('0x4a')]&&_0x5ef13f[_0x3071('0x4a')][_0x3071('0x4b')]>0x0){var _0x606ef8=_['head'](_0x5ef13f[_0x3071('0x4a')]['messages']);var _0x18a773={'messageId':_0x606ef8['message_id']};if(!_0x5f3c22['deliveryReport']){_0x18a773[_0x3071('0x3e')]=!![];}return _0x3457cd['update'](_0x18a773);}else{logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x4c'),util[_0x3071('0x2b')](_0x5ef13f,{'showHidden':![],'depth':null}));}}else{logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),'clickSend',util[_0x3071('0x2b')](_0x5ef13f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x46924d){logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x4c'),util[_0x3071('0x2b')](_0x46924d,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x4c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3071('0x4d'):if(_0x5f3c22[_0x3071('0x4e')]&&_0x5f3c22[_0x3071('0x23')]){var _0xda07a4={'dst':_0x4a470a['phone'],'text':_0x4a470a[_0x3071('0xe')],'src':_0x5f3c22[_0x3071('0x4f')]||_0x5f3c22[_0x3071('0x26')],'url':_0x5f3c22[_0x3071('0x27')]+_0x3071('0x28')+_0x4a470a['id']+_0x3071('0x50')+_0x5f3c22[_0x3071('0x51')]};var _0x456921=util[_0x3071('0x44')](_0x3071('0x45'),_0x5f3c22[_0x3071('0x4e')],_0x5f3c22[_0x3071('0x23')]);var _0x2610b4={'method':_0x3071('0x38'),'uri':util[_0x3071('0x44')](_0x3071('0x52'),_0x5f3c22['authId']),'body':_0xda07a4,'headers':{'Authorization':util['format'](_0x3071('0x46'),new Buffer(_0x456921)['toString'](_0x3071('0x48')))},'json':!![]};rp(_0x2610b4)[_0x3071('0x16')](function(_0x15c6f8){var _0x514821={'messageId':_0x15c6f8[_0x3071('0x53')][0x0]};return _0x3457cd[_0x3071('0x17')](_0x514821);})['catch'](function(_0x4b8ec0){logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x4d'),util['inspect'](_0x4b8ec0,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x4d'),_0x3071('0x54'));}break;case'infobip':if(_0x5f3c22[_0x3071('0x30')]&&_0x5f3c22[_0x3071('0x31')]){if(_0x5f3c22[_0x3071('0x55')]){var _0x27bad1={'method':_0x3071('0x38'),'uri':_0x5f3c22[_0x3071('0x55')]+_0x3071('0x56'),'body':{'username':_0x5f3c22['username'],'password':_0x5f3c22['password']},'json':!![]};return rp(_0x27bad1)[_0x3071('0x16')](function(_0x4de4f3){var _0xe96994={'method':_0x3071('0x38'),'uri':_0x5f3c22['baseUrl']+_0x3071('0x57'),'body':{'messages':[{'from':_0x5f3c22[_0x3071('0x26')],'destinations':[{'to':_0x4a470a['phone']}],'text':_0x4a470a[_0x3071('0xe')],'notifyUrl':_0x5f3c22[_0x3071('0x27')]+_0x3071('0x28')+_0x4a470a['id']+_0x3071('0x50')+_0x5f3c22[_0x3071('0x51')],'notifyContentType':'application/json','callbackData':_0x5f3c22[_0x3071('0x26')]+';'+_0x4a470a[_0x3071('0xe')]}]},'headers':{'Authorization':_0x3071('0x58')+_0x4de4f3['token']},'json':!![]};return rp(_0xe96994)[_0x3071('0x16')](function(_0x238fa9){if(_0x238fa9[_0x3071('0x24')]){var _0x25680e={'messageId':_0x238fa9[_0x3071('0x24')][0x0][_0x3071('0xc')]};if(!_0x5f3c22[_0x3071('0x3d')]){_0x25680e[_0x3071('0x3e')]=!![];}return _0x3457cd[_0x3071('0x17')](_0x25680e);}else{return logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x59'),util[_0x3071('0x2b')](_0x238fa9,{'showHidden':![],'depth':null}));}});})[_0x3071('0x19')](function(_0x1543df){return logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x59'),util[_0x3071('0x2b')](_0x1543df,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x59'),_0x3071('0x5a'));}}else{logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x59'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3071('0x5b'):var _0x1ebd77=require('crypto');if(_0x5f3c22['apiKey']){var _0x147856={};_0x147856[_0x3071('0x5c')]=_0x5f3c22[_0x3071('0x30')];_0x147856[_0x3071('0x26')]=_0x4a470a['phone'];_0x147856['sender']=_0x5f3c22[_0x3071('0x26')];_0x147856['text']=_0x4a470a['body'];_0x147856['timestamp']=+new Date();var _0x58da43='';var _0xec6f46='';var _0x1da52c=Object[_0x3071('0x5d')](_0x147856);_0x1da52c['sort']();for(var _0x492328=0x0;_0x492328<_0x1da52c[_0x3071('0x5e')];_0x492328++){if(_0x58da43!=''){_0x58da43+='&';}_0x58da43+=_0x1da52c[_0x492328]+'='+encodeURIComponent(_0x147856[_0x1da52c[_0x492328]]);_0xec6f46+=_0x147856[_0x1da52c[_0x492328]];}_0xec6f46+=_0x5f3c22[_0x3071('0x5f')];_0xec6f46=_0x1ebd77[_0x3071('0x60')]('md5')[_0x3071('0x17')](_0xec6f46)[_0x3071('0x61')]('hex');if(_0x58da43!==''){_0x58da43+='&';}_0x58da43+=_0x3071('0x62')+_0xec6f46;var _0x32b2e2={'method':_0x3071('0x63'),'uri':_0x5f3c22[_0x3071('0x55')]+_0x3071('0x64')+_0x58da43,'json':!![]};return rp(_0x32b2e2)[_0x3071('0x16')](function(_0x2deac2){var _0x5d83aa=Object['keys'](_0x2deac2);if(_0x2deac2[_0x5d83aa[0x0]][_0x3071('0x1a')]&&parseInt(_0x2deac2[_0x5d83aa[0x0]][_0x3071('0x1a')])===0x0){var _0x1456ce={'messageId':_0x2deac2[_0x5d83aa[0x0]]['id_sms']};if(!_0x5f3c22['deliveryReport']){_0x1456ce[_0x3071('0x3e')]=!![];}return _0x3457cd[_0x3071('0x17')](_0x1456ce);}else{return logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x5b'),util[_0x3071('0x2b')](_0x2deac2[_0x3071('0x1a')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x4ce89b){return logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x5b'),util[_0x3071('0x2b')](_0x4ce89b,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x5b'),'Missing\x20parameters:\x20apiKey');}break;case _0x3071('0x65'):if(_0x5f3c22[_0x3071('0x5f')]){var _0x1da477={'method':'POST','uri':_0x3071('0x66'),'headers':{'Authorization':_0x5f3c22[_0x3071('0x5f')]},'body':{'content':_0x4a470a[_0x3071('0xe')],'to':[_0x4a470a['phone']],'from':_0x5f3c22['phone'],'binary':![],'clientMessageId':_0x3071('0x67'),'charset':'UTF-8'},'json':!![]};rp(_0x1da477)[_0x3071('0x16')](function(_0x10a207){if(!_0x10a207[_0x3071('0x1a')]){var _0x23bc22={'messageId':_0x10a207[_0x3071('0x24')][0x0][_0x3071('0x68')]};if(!_0x5f3c22[_0x3071('0x3d')]){_0x23bc22['read']=!![];}return _0x3457cd[_0x3071('0x17')](_0x23bc22);}else{return logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x65'),util[_0x3071('0x2b')](_0x10a207[_0x3071('0x1a')],{'showHidden':![],'depth':null}));}})[_0x3071('0x19')](function(_0x4bc640){return logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x65'),util[_0x3071('0x2b')](_0x4bc640,{'showHidden':![],'depth':null}));});}else{logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x65'),_0x3071('0x69'));}break;case _0x3071('0x6a'):if(_0x5f3c22[_0x3071('0x30')]&&_0x5f3c22['password']){var _0x456921=util[_0x3071('0x44')]('%s:%s',_0x5f3c22[_0x3071('0x30')],_0x5f3c22[_0x3071('0x31')]);var _0x2610b4={'method':_0x3071('0x38'),'uri':_0x3071('0x6b')+_0x5f3c22['accountId']+'/messages','body':{'to':[_0x4a470a[_0x3071('0x26')]],'text':_0x4a470a['body'],'from':_0x5f3c22[_0x3071('0x26')],'applicationId':_0x5f3c22[_0x3071('0x6c')]},'headers':{'Authorization':util[_0x3071('0x44')](_0x3071('0x46'),new Buffer(_0x456921)[_0x3071('0x47')](_0x3071('0x48')))},'json':!![]};rp(_0x2610b4)['then'](function(_0x290d1c){if(_0x290d1c['id']){var _0xa732ea={'messageId':_0x290d1c['id']};return _0x3457cd[_0x3071('0x17')](_0xa732ea);}else{logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x6a'),util['inspect'](_0x290d1c,{'showHidden':![],'depth':null}));}})[_0x3071('0x19')](function(_0x2ea7e9){logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),'bandwidth',util[_0x3071('0x2b')](_0x2ea7e9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x6a'),_0x3071('0x6d'));}break;case _0x3071('0x6e'):if(_0x5f3c22[_0x3071('0x5f')]){var _0x11d654={};var _0x32b2e2={'method':'POST','uri':_0x3071('0x6f'),'headers':{'Authorization':_0x3071('0x70')+_0x5f3c22[_0x3071('0x5f')],'Content-Type':'application/json'},'body':{'from':_0x5f3c22[_0x3071('0x26')],'to':_0x4a470a['phone'],'text':_0x4a470a[_0x3071('0xe')]},'json':!![]};return rp(_0x32b2e2)[_0x3071('0x16')](function(_0x2f1761){if(_0x2f1761['code']==0xca){_0x11d654[_0x3071('0x71')]=_0x2f1761;var _0x2ef706={'method':_0x3071('0x38'),'uri':_0x3071('0x72'),'headers':{'Authorization':_0x3071('0x70')+_0x5f3c22[_0x3071('0x5f')],'Content-Type':_0x3071('0x73')},'body':{'refid':_0x11d654[_0x3071('0x71')][_0x3071('0x74')]},'json':!![]};return rp(_0x2ef706)['then'](function(_0x1429d2){_0x11d654[_0x3071('0x75')]=_0x1429d2;var _0x34b376={'messageId':_0x11d654['message']['refid'],'read':!![]};return _0x3457cd['update'](_0x34b376);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3071('0x2c'),_0x3071('0x6e'),util['inspect'](_0x2f1761,{'showHidden':![],'depth':null}));}})[_0x3071('0x19')](function(_0x195227){return logger[_0x3071('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3071('0x6e'),util[_0x3071('0x2b')](_0x195227,{'showHidden':![],'depth':null}));});}else{return logger[_0x3071('0x1a')](_0x3071('0x2a'),_0x3071('0x2c'),_0x3071('0x6e'),_0x3071('0x76'));}break;}}})['finally'](function(){_0x937259();});}else{_0x937259();}}},'charset':'utf8mb4','collate':_0x3071('0x77')});};
\ No newline at end of file
index 98f1068..71294cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6548=['SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','then','stringify','lodash','util','bluebird','randomstring','rpc','../../config/environment','client','http','defaults','redis','socket.io-emitter','register','request','info'];(function(_0x227901,_0x1d8fca){var _0x5a55e4=function(_0x528862){while(--_0x528862){_0x227901['push'](_0x227901['shift']());}};_0x5a55e4(++_0x1d8fca);}(_0x6548,0x88));var _0x8654=function(_0x237f14,_0x1dfc3a){_0x237f14=_0x237f14-0x0;var _0x540817=_0x6548[_0x237f14];return _0x540817;};'use strict';var _=require(_0x8654('0x0'));var util=require(_0x8654('0x1'));var moment=require('moment');var BPromise=require(_0x8654('0x2'));var rs=require(_0x8654('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8654('0x4'));var config=require(_0x8654('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8654('0x6')][_0x8654('0x7')]({'port':0x232a});config['redis']=_[_0x8654('0x8')](config[_0x8654('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8654('0xa'))(new Redis(config[_0x8654('0x9')]));require('./smsMessage.socket')[_0x8654('0xb')](socket);function respondWithRpcPromise(_0x4d4e63,_0xa813e,_0x3765df){return new BPromise(function(_0xfc56cb,_0x57491f){return client[_0x8654('0xc')](_0x4d4e63,_0x3765df)['then'](function(_0x1eacb2){logger[_0x8654('0xd')](_0x8654('0xe'),_0xa813e,_0x8654('0xf'));logger[_0x8654('0x10')](_0x8654('0x11'),_0xa813e,_0x8654('0xf'),JSON['stringify'](_0x1eacb2));if(_0x1eacb2[_0x8654('0x12')]){if(_0x1eacb2[_0x8654('0x12')][_0x8654('0x13')]===0x1f4){logger[_0x8654('0x12')](_0x8654('0xe'),_0xa813e,_0x1eacb2['error'][_0x8654('0x14')]);return _0x57491f(_0x1eacb2[_0x8654('0x12')]['message']);}logger['error'](_0x8654('0xe'),_0xa813e,_0x1eacb2[_0x8654('0x12')][_0x8654('0x14')]);return _0xfc56cb(_0x1eacb2[_0x8654('0x12')][_0x8654('0x14')]);}else{logger[_0x8654('0xd')](_0x8654('0xe'),_0xa813e,_0x8654('0xf'));_0xfc56cb(_0x1eacb2['result'][_0x8654('0x14')]);}})[_0x8654('0x15')](function(_0x3ae5c8){logger['error'](_0x8654('0xe'),_0xa813e,_0x3ae5c8);_0x57491f(_0x3ae5c8);});});}exports[_0x8654('0x16')]=function(_0x584f7b){var _0xc71799=this;return new Promise(function(_0x4b2367,_0x5ab9b2){return db[_0x8654('0x17')][_0x8654('0x18')](_0x584f7b[_0x8654('0x19')],{'raw':_0x584f7b['options']?_0x584f7b[_0x8654('0x1a')][_0x8654('0x1b')]===undefined?!![]:![]:!![]})[_0x8654('0x1c')](function(_0x27f7a5){logger[_0x8654('0xd')](_0x8654('0x16'),_0x584f7b);logger[_0x8654('0x10')]('CreateSmsMessage',_0x584f7b,JSON[_0x8654('0x1d')](_0x27f7a5));_0x4b2367(_0x27f7a5);})[_0x8654('0x15')](function(_0x124d38){logger[_0x8654('0x12')](_0x8654('0x16'),_0x124d38[_0x8654('0x14')],_0x584f7b);_0x5ab9b2(_0xc71799['error'](0x1f4,_0x124d38[_0x8654('0x14')]));});});};
\ No newline at end of file
+var _0xd251=['moment','bluebird','randomstring','ioredis','../../config/logger','client','http','redis','defaults','localhost','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','SmsMessage','create','body','options','raw','then','CreateSmsMessage','util'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0xd251,0x117));var _0x1d25=function(_0x11fd79,_0x5b1707){_0x11fd79=_0x11fd79-0x0;var _0x15e462=_0xd251[_0x11fd79];return _0x15e462;};'use strict';var _=require('lodash');var util=require(_0x1d25('0x0'));var moment=require(_0x1d25('0x1'));var BPromise=require(_0x1d25('0x2'));var rs=require(_0x1d25('0x3'));var fs=require('fs');var Redis=require(_0x1d25('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1d25('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1d25('0x6')][_0x1d25('0x7')]({'port':0x232a});config[_0x1d25('0x8')]=_[_0x1d25('0x9')](config['redis'],{'host':_0x1d25('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1d25('0x8')]));require(_0x1d25('0xb'))[_0x1d25('0xc')](socket);function respondWithRpcPromise(_0x41057b,_0x44fe3b,_0x2d5759){return new BPromise(function(_0x10d70c,_0xeba472){return client[_0x1d25('0xd')](_0x41057b,_0x2d5759)['then'](function(_0x8959b9){logger[_0x1d25('0xe')](_0x1d25('0xf'),_0x44fe3b,_0x1d25('0x10'));logger[_0x1d25('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44fe3b,'request\x20sent',JSON['stringify'](_0x8959b9));if(_0x8959b9[_0x1d25('0x12')]){if(_0x8959b9[_0x1d25('0x12')]['code']===0x1f4){logger['error'](_0x1d25('0xf'),_0x44fe3b,_0x8959b9[_0x1d25('0x12')][_0x1d25('0x13')]);return _0xeba472(_0x8959b9[_0x1d25('0x12')][_0x1d25('0x13')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x44fe3b,_0x8959b9[_0x1d25('0x12')][_0x1d25('0x13')]);return _0x10d70c(_0x8959b9[_0x1d25('0x12')][_0x1d25('0x13')]);}else{logger[_0x1d25('0xe')](_0x1d25('0xf'),_0x44fe3b,_0x1d25('0x10'));_0x10d70c(_0x8959b9['result'][_0x1d25('0x13')]);}})[_0x1d25('0x14')](function(_0x571772){logger[_0x1d25('0x12')]('SmsMessage,\x20%s,\x20%s',_0x44fe3b,_0x571772);_0xeba472(_0x571772);});});}exports['CreateSmsMessage']=function(_0x190b97){var _0x484768=this;return new Promise(function(_0x4789be,_0x26c7f3){return db[_0x1d25('0x15')][_0x1d25('0x16')](_0x190b97[_0x1d25('0x17')],{'raw':_0x190b97[_0x1d25('0x18')]?_0x190b97['options'][_0x1d25('0x19')]===undefined?!![]:![]:!![]})[_0x1d25('0x1a')](function(_0x1f4ac6){logger['info']('CreateSmsMessage',_0x190b97);logger[_0x1d25('0x11')](_0x1d25('0x1b'),_0x190b97,JSON['stringify'](_0x1f4ac6));_0x4789be(_0x1f4ac6);})['catch'](function(_0x487ab7){logger[_0x1d25('0x12')](_0x1d25('0x1b'),_0x487ab7[_0x1d25('0x13')],_0x190b97);_0x26c7f3(_0x484768[_0x1d25('0x12')](0x1f4,_0x487ab7['message']));});});};
\ No newline at end of file
index 3694111..1e33082 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7362=['smsMessage:','./smsMessage.events','save','update','emit','length'];(function(_0x1840a9,_0x155b7c){var _0x4c62f3=function(_0xdc726e){while(--_0xdc726e){_0x1840a9['push'](_0x1840a9['shift']());}};_0x4c62f3(++_0x155b7c);}(_0x7362,0x1ab));var _0x2736=function(_0x26b18a,_0x1dc046){_0x26b18a=_0x26b18a-0x0;var _0x3dbea7=_0x7362[_0x26b18a];return _0x3dbea7;};'use strict';var SmsMessageEvents=require(_0x2736('0x0'));var events=[_0x2736('0x1'),'remove',_0x2736('0x2')];function createListener(_0x3c7fcb,_0x5e4627){return function(_0x700277){_0x5e4627[_0x2736('0x3')](_0x3c7fcb,_0x700277);};}function removeListener(_0x2b7bcf,_0x4c44bd){return function(){SmsMessageEvents['removeListener'](_0x2b7bcf,_0x4c44bd);};}exports['register']=function(_0x6dc17d){for(var _0x59b06=0x0,_0x1f8253=events[_0x2736('0x4')];_0x59b06<_0x1f8253;_0x59b06++){var _0x3e4556=events[_0x59b06];var _0x46d519=createListener(_0x2736('0x5')+_0x3e4556,_0x6dc17d);SmsMessageEvents['on'](_0x3e4556,_0x46d519);}};
\ No newline at end of file
+var _0x4e4f=['./smsMessage.events','save','remove','update','length'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4e4f,0x186));var _0xf4e4=function(_0xa50d5d,_0x2be88b){_0xa50d5d=_0xa50d5d-0x0;var _0xb6c97b=_0x4e4f[_0xa50d5d];return _0xb6c97b;};'use strict';var SmsMessageEvents=require(_0xf4e4('0x0'));var events=[_0xf4e4('0x1'),_0xf4e4('0x2'),_0xf4e4('0x3')];function createListener(_0x285fbc,_0x5d0417){return function(_0x5bb61d){_0x5d0417['emit'](_0x285fbc,_0x5bb61d);};}function removeListener(_0x23e878,_0xafde23){return function(){SmsMessageEvents['removeListener'](_0x23e878,_0xafde23);};}exports['register']=function(_0x127a59){for(var _0x3ea0cb=0x0,_0x119c4a=events[_0xf4e4('0x4')];_0x3ea0cb<_0x119c4a;_0x3ea0cb++){var _0x5d61cd=events[_0x3ea0cb];var _0x58ee04=createListener('smsMessage:'+_0x5d61cd,_0x127a59);SmsMessageEvents['on'](_0x5d61cd,_0x58ee04);}};
\ No newline at end of file
index 29351af..35a3e9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0265=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addAgents','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members'];(function(_0x45400b,_0x1dbcf6){var _0x3527c8=function(_0x43890f){while(--_0x43890f){_0x45400b['push'](_0x45400b['shift']());}};_0x3527c8(++_0x1dbcf6);}(_0x0265,0xe2));var _0x5026=function(_0x4a8d9b,_0x55de9c){_0x4a8d9b=_0x4a8d9b-0x0;var _0x20130c=_0x0265[_0x4a8d9b];return _0x20130c;};'use strict';var multer=require(_0x5026('0x0'));var util=require(_0x5026('0x1'));var path=require(_0x5026('0x2'));var timeout=require(_0x5026('0x3'));var express=require(_0x5026('0x4'));var router=express[_0x5026('0x5')]();var fs_extra=require(_0x5026('0x6'));var auth=require(_0x5026('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5026('0x8'));var controller=require(_0x5026('0x9'));router[_0x5026('0xa')]('/',auth[_0x5026('0xb')](),controller[_0x5026('0xc')]);router[_0x5026('0xa')](_0x5026('0xd'),auth[_0x5026('0xb')](),controller['describe']);router[_0x5026('0xa')](_0x5026('0xe'),auth[_0x5026('0xb')](),controller[_0x5026('0xf')]);router['get'](_0x5026('0x10'),auth[_0x5026('0xb')](),controller[_0x5026('0x11')]);router['get'](_0x5026('0x12'),auth[_0x5026('0xb')](),controller[_0x5026('0x13')]);router[_0x5026('0xa')](_0x5026('0x14'),auth[_0x5026('0xb')](),controller[_0x5026('0x15')]);router[_0x5026('0x16')]('/',auth[_0x5026('0xb')](),controller['create']);router['post'](_0x5026('0x12'),auth[_0x5026('0xb')](),controller['addTeams']);router[_0x5026('0x16')](_0x5026('0x14'),auth[_0x5026('0xb')](),controller[_0x5026('0x17')]);router[_0x5026('0x18')]('/:id',auth[_0x5026('0xb')](),controller[_0x5026('0x19')]);router[_0x5026('0x1a')]('/:id',auth[_0x5026('0xb')](),controller['destroy']);router[_0x5026('0x1a')](_0x5026('0x12'),auth[_0x5026('0xb')](),controller['removeTeams']);router[_0x5026('0x1a')](_0x5026('0x14'),auth[_0x5026('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x002f=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','put','/:id','delete','destroy','removeTeams','exports','multer','util','path'];(function(_0xa218ce,_0x5aaf1a){var _0x561bb4=function(_0x474270){while(--_0x474270){_0xa218ce['push'](_0xa218ce['shift']());}};_0x561bb4(++_0x5aaf1a);}(_0x002f,0x8e));var _0xf002=function(_0x5cab28,_0x307622){_0x5cab28=_0x5cab28-0x0;var _0xa3554d=_0x002f[_0x5cab28];return _0xa3554d;};'use strict';var multer=require(_0xf002('0x0'));var util=require(_0xf002('0x1'));var path=require(_0xf002('0x2'));var timeout=require('connect-timeout');var express=require(_0xf002('0x3'));var router=express[_0xf002('0x4')]();var fs_extra=require(_0xf002('0x5'));var auth=require(_0xf002('0x6'));var interaction=require(_0xf002('0x7'));var config=require('../../config/environment');var controller=require(_0xf002('0x8'));router[_0xf002('0x9')]('/',auth['isAuthenticated'](),controller[_0xf002('0xa')]);router[_0xf002('0x9')](_0xf002('0xb'),auth[_0xf002('0xc')](),controller[_0xf002('0xd')]);router[_0xf002('0x9')]('/:id',auth[_0xf002('0xc')](),controller[_0xf002('0xe')]);router[_0xf002('0x9')](_0xf002('0xf'),auth[_0xf002('0xc')](),controller[_0xf002('0x10')]);router[_0xf002('0x9')]('/:id/teams',auth[_0xf002('0xc')](),controller[_0xf002('0x11')]);router[_0xf002('0x9')](_0xf002('0x12'),auth[_0xf002('0xc')](),controller[_0xf002('0x13')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xf002('0x14')](_0xf002('0x15'),auth[_0xf002('0xc')](),controller[_0xf002('0x16')]);router[_0xf002('0x14')](_0xf002('0x12'),auth[_0xf002('0xc')](),controller['addAgents']);router[_0xf002('0x17')](_0xf002('0x18'),auth[_0xf002('0xc')](),controller['update']);router[_0xf002('0x19')](_0xf002('0x18'),auth['isAuthenticated'](),controller[_0xf002('0x1a')]);router[_0xf002('0x19')](_0xf002('0x15'),auth[_0xf002('0xc')](),controller[_0xf002('0x1b')]);router[_0xf002('0x19')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xf002('0x1c')]=router;
\ No newline at end of file
index 90239ec..ed44251 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x056b=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','beepall'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x056b,0x1a1));var _0xb056=function(_0x209302,_0x5826ac){_0x209302=_0x209302-0x0;var _0x1df8e9=_0x056b[_0x209302];return _0x1df8e9;};'use strict';var Sequelize=require(_0xb056('0x0'));module[_0xb056('0x1')]={'name':{'type':Sequelize[_0xb056('0x2')],'unique':_0xb056('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb056('0x2')]},'timeout':{'type':Sequelize[_0xb056('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb056('0x5')]('rrmemory',_0xb056('0x6'),_0xb056('0x7'))}};
\ No newline at end of file
+var _0xc6b7=['name','INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING'];(function(_0x117692,_0x5ba99c){var _0x85d6b=function(_0x384ad4){while(--_0x384ad4){_0x117692['push'](_0x117692['shift']());}};_0x85d6b(++_0x5ba99c);}(_0xc6b7,0x8d));var _0x7c6b=function(_0x5ad53c,_0x582826){_0x5ad53c=_0x5ad53c-0x0;var _0x137e6e=_0xc6b7[_0x5ad53c];return _0x137e6e;};'use strict';var Sequelize=require(_0x7c6b('0x0'));module[_0x7c6b('0x1')]={'name':{'type':Sequelize[_0x7c6b('0x2')],'unique':_0x7c6b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7c6b('0x2')]},'timeout':{'type':Sequelize[_0x7c6b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7c6b('0x5')](_0x7c6b('0x6'),'beepall',_0x7c6b('0x7'))}};
\ No newline at end of file
index 1d4a68d..210b3ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c59=['interface','flatMap','sequelize','each','findOrCreate','removeTeams','select','field','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','all','union','compact','isEmpty','forEach','emit','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsQueue.socket','register','sendStatus','status','undefined','limit','count','offset','Content-Range','json','apply','reject','save','then','get','SmsQueues','UserProfileResource','destroy','end','stack','name','index','map','SmsQueue','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','findAll','User','findAndCountAll','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','order','addTeams','ids','Agents','online','voicePause'];(function(_0xed03d5,_0x5e89f6){var _0x291d16=function(_0x2bd203){while(--_0x2bd203){_0xed03d5['push'](_0xed03d5['shift']());}};_0x291d16(++_0x5e89f6);}(_0x7c59,0x143));var _0x97c5=function(_0x2037d5,_0x2f60f4){_0x2037d5=_0x2037d5-0x0;var _0x10efed=_0x7c59[_0x2037d5];return _0x10efed;};'use strict';var emlformat=require(_0x97c5('0x0'));var rimraf=require(_0x97c5('0x1'));var zipdir=require(_0x97c5('0x2'));var jsonpatch=require(_0x97c5('0x3'));var rp=require('request-promise');var moment=require(_0x97c5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x97c5('0x5'));var util=require('util');var path=require(_0x97c5('0x6'));var sox=require(_0x97c5('0x7'));var csv=require(_0x97c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97c5('0x9'));var _=require(_0x97c5('0xa'));var squel=require(_0x97c5('0xb'));var crypto=require('crypto');var jsforce=require(_0x97c5('0xc'));var deskjs=require(_0x97c5('0xd'));var toCsv=require(_0x97c5('0x8'));var querystring=require(_0x97c5('0xe'));var Papa=require(_0x97c5('0xf'));var Redis=require('ioredis');var authService=require(_0x97c5('0x10'));var qs=require(_0x97c5('0x11'));var as=require(_0x97c5('0x12'));var hardwareService=require(_0x97c5('0x13'));var logger=require(_0x97c5('0x14'))(_0x97c5('0x15'));var utils=require(_0x97c5('0x16'));var config=require(_0x97c5('0x17'));var licenseUtil=require(_0x97c5('0x18'));var db=require(_0x97c5('0x19'))['db'];config['redis']=_[_0x97c5('0x1a')](config['redis'],{'host':_0x97c5('0x1b'),'port':0x18eb});var socket=require(_0x97c5('0x1c'))(new Redis(config[_0x97c5('0x1d')]));require(_0x97c5('0x1e'))[_0x97c5('0x1f')](socket);function respondWithStatusCode(_0xe409af,_0x1ede8e){_0x1ede8e=_0x1ede8e||0xcc;return function(_0x1aeeaf){if(_0x1aeeaf){return _0xe409af[_0x97c5('0x20')](_0x1ede8e);}return _0xe409af[_0x97c5('0x21')](_0x1ede8e)['end']();};}function respondWithResult(_0x20120a,_0x560d3e){_0x560d3e=_0x560d3e||0xc8;return function(_0x533c86){if(_0x533c86){return _0x20120a[_0x97c5('0x21')](_0x560d3e)['json'](_0x533c86);}};}function respondWithFilteredResult(_0x5c74fd,_0x2065ad){return function(_0x5a8299){if(_0x5a8299){var _0x41a601=typeof _0x2065ad['offset']===_0x97c5('0x22')&&typeof _0x2065ad[_0x97c5('0x23')]===_0x97c5('0x22');var _0x4babfb=_0x5a8299[_0x97c5('0x24')];var _0x3a24af=_0x41a601?0x0:_0x2065ad[_0x97c5('0x25')];var _0x38c041=_0x41a601?_0x5a8299[_0x97c5('0x24')]:_0x2065ad[_0x97c5('0x25')]+_0x2065ad['limit'];var _0x46b051;if(_0x38c041>=_0x4babfb){_0x38c041=_0x4babfb;_0x46b051=0xc8;}else{_0x46b051=0xce;}_0x5c74fd[_0x97c5('0x21')](_0x46b051);return _0x5c74fd['set'](_0x97c5('0x26'),_0x3a24af+'-'+_0x38c041+'/'+_0x4babfb)[_0x97c5('0x27')](_0x5a8299);}return null;};}function patchUpdates(_0x5e7b94){return function(_0x1795a3){try{jsonpatch[_0x97c5('0x28')](_0x1795a3,_0x5e7b94,!![]);}catch(_0xf44f31){return BPromise[_0x97c5('0x29')](_0xf44f31);}return _0x1795a3[_0x97c5('0x2a')]();};}function saveUpdates(_0x1c73cb,_0xd6f2b3){return function(_0x294c62){if(_0x294c62){return _0x294c62['update'](_0x1c73cb)['then'](function(_0x42e05f){return _0x42e05f;});}return null;};}function removeEntity(_0x52a52c,_0x482ca2){return function(_0x3d388b){if(_0x3d388b){return _0x3d388b['destroy']()[_0x97c5('0x2b')](function(){var _0xace66e=_0x3d388b[_0x97c5('0x2c')]({'plain':!![]});var _0x350ea0=_0x97c5('0x2d');return db[_0x97c5('0x2e')][_0x97c5('0x2f')]({'where':{'type':_0x350ea0,'resourceId':_0xace66e['id']}})[_0x97c5('0x2b')](function(){return _0x3d388b;});})[_0x97c5('0x2b')](function(){_0x52a52c[_0x97c5('0x21')](0xcc)[_0x97c5('0x30')]();});}};}function handleEntityNotFound(_0x3abe1c,_0x2b5b30){return function(_0xc0a1de){if(!_0xc0a1de){_0x3abe1c[_0x97c5('0x20')](0x194);}return _0xc0a1de;};}function handleError(_0x402c20,_0x2dc991){_0x2dc991=_0x2dc991||0x1f4;return function(_0x2c14c4){logger['error'](_0x2c14c4[_0x97c5('0x31')]);if(_0x2c14c4['name']){delete _0x2c14c4[_0x97c5('0x32')];}_0x402c20[_0x97c5('0x21')](_0x2dc991)['send'](_0x2c14c4);};}exports[_0x97c5('0x33')]=function(_0x1dfbea,_0x356ba2){var _0x24059d={},_0x46d6d6={},_0x724027={'count':0x0,'rows':[]};var _0x2781b1=_[_0x97c5('0x34')](db[_0x97c5('0x35')][_0x97c5('0x36')],function(_0x799995){return{'name':_0x799995[_0x97c5('0x37')],'type':_0x799995[_0x97c5('0x38')][_0x97c5('0x39')]};});_0x46d6d6[_0x97c5('0x3a')]=_['map'](_0x2781b1,_0x97c5('0x32'));_0x46d6d6['query']=_[_0x97c5('0x3b')](_0x1dfbea[_0x97c5('0x3c')]);_0x46d6d6[_0x97c5('0x3d')]=_['intersection'](_0x46d6d6['model'],_0x46d6d6[_0x97c5('0x3c')]);_0x24059d[_0x97c5('0x3e')]=_['intersection'](_0x46d6d6[_0x97c5('0x3a')],qs['fields'](_0x1dfbea[_0x97c5('0x3c')][_0x97c5('0x3f')]));_0x24059d[_0x97c5('0x3e')]=_0x24059d[_0x97c5('0x3e')][_0x97c5('0x40')]?_0x24059d[_0x97c5('0x3e')]:_0x46d6d6[_0x97c5('0x3a')];if(!_0x1dfbea['query'][_0x97c5('0x41')](_0x97c5('0x42'))){_0x24059d['limit']=qs[_0x97c5('0x23')](_0x1dfbea['query'][_0x97c5('0x23')]);_0x24059d[_0x97c5('0x25')]=qs['offset'](_0x1dfbea[_0x97c5('0x3c')][_0x97c5('0x25')]);}_0x24059d['order']=qs[_0x97c5('0x43')](_0x1dfbea[_0x97c5('0x3c')][_0x97c5('0x43')]);_0x24059d[_0x97c5('0x44')]=qs[_0x97c5('0x3d')](_[_0x97c5('0x45')](_0x1dfbea['query'],_0x46d6d6[_0x97c5('0x3d')]),_0x2781b1);if(_0x1dfbea[_0x97c5('0x3c')][_0x97c5('0x46')]){_0x24059d[_0x97c5('0x44')]=_[_0x97c5('0x47')](_0x24059d['where'],{'$or':_[_0x97c5('0x34')](_0x2781b1,function(_0x531569){if(_0x531569[_0x97c5('0x38')]!==_0x97c5('0x48')){var _0x39e457={};_0x39e457[_0x531569['name']]={'$like':'%'+_0x1dfbea[_0x97c5('0x3c')][_0x97c5('0x46')]+'%'};return _0x39e457;}})});}_0x24059d=_['merge']({},_0x24059d,_0x1dfbea[_0x97c5('0x49')]);var _0x3f0e4a={'where':_0x24059d[_0x97c5('0x44')]};return db[_0x97c5('0x35')][_0x97c5('0x24')](_0x3f0e4a)[_0x97c5('0x2b')](function(_0x3ad0fb){_0x724027[_0x97c5('0x24')]=_0x3ad0fb;if(_0x1dfbea['query'][_0x97c5('0x4a')]){_0x24059d[_0x97c5('0x4b')]=[{'all':!![]}];}return db[_0x97c5('0x35')]['findAll'](_0x24059d);})[_0x97c5('0x2b')](function(_0x6487aa){_0x724027['rows']=_0x6487aa;return _0x724027;})[_0x97c5('0x2b')](respondWithFilteredResult(_0x356ba2,_0x24059d))[_0x97c5('0x4c')](handleError(_0x356ba2,null));};exports[_0x97c5('0x4d')]=function(_0x25d871,_0x2f254f){var _0x437190={'raw':!![],'where':{'id':_0x25d871[_0x97c5('0x4e')]['id']}},_0x2e63b6={};_0x2e63b6[_0x97c5('0x3a')]=_['keys'](db['SmsQueue'][_0x97c5('0x36')]);_0x2e63b6['query']=_[_0x97c5('0x3b')](_0x25d871['query']);_0x2e63b6[_0x97c5('0x3d')]=_['intersection'](_0x2e63b6[_0x97c5('0x3a')],_0x2e63b6['query']);_0x437190[_0x97c5('0x3e')]=_[_0x97c5('0x4f')](_0x2e63b6[_0x97c5('0x3a')],qs[_0x97c5('0x3f')](_0x25d871[_0x97c5('0x3c')][_0x97c5('0x3f')]));_0x437190[_0x97c5('0x3e')]=_0x437190[_0x97c5('0x3e')][_0x97c5('0x40')]?_0x437190[_0x97c5('0x3e')]:_0x2e63b6['model'];if(_0x25d871[_0x97c5('0x3c')][_0x97c5('0x4a')]){_0x437190[_0x97c5('0x4b')]=[{'all':!![]}];}_0x437190=_[_0x97c5('0x47')]({},_0x437190,_0x25d871[_0x97c5('0x49')]);return db['SmsQueue'][_0x97c5('0x50')](_0x437190)['then'](handleEntityNotFound(_0x2f254f,null))[_0x97c5('0x2b')](respondWithResult(_0x2f254f,null))[_0x97c5('0x4c')](handleError(_0x2f254f,null));};exports[_0x97c5('0x51')]=function(_0x375709,_0x2c91df){return db[_0x97c5('0x35')][_0x97c5('0x51')](_0x375709[_0x97c5('0x52')],{})['then'](function(_0xbd9175){var _0x2a4153=_0x375709[_0x97c5('0x53')][_0x97c5('0x2c')]({'plain':!![]});if(!_0x2a4153)throw new Error(_0x97c5('0x54'));if(_0x2a4153[_0x97c5('0x55')]==='user'){var _0x5c0192=_0xbd9175[_0x97c5('0x2c')]({'plain':!![]});var _0x2c1b23=_0x97c5('0x2d');return db[_0x97c5('0x56')][_0x97c5('0x50')]({'where':{'name':_0x2c1b23,'userProfileId':_0x2a4153['userProfileId']},'raw':!![]})[_0x97c5('0x2b')](function(_0x1adb1e){if(_0x1adb1e&&_0x1adb1e[_0x97c5('0x57')]===0x0){return db[_0x97c5('0x2e')]['create']({'name':_0x5c0192[_0x97c5('0x32')],'resourceId':_0x5c0192['id'],'type':_0x1adb1e[_0x97c5('0x32')],'sectionId':_0x1adb1e['id']},{})['then'](function(){return _0xbd9175;});}else{return _0xbd9175;}})['catch'](function(_0x53c80a){logger[_0x97c5('0x58')](_0x97c5('0x59'),_0x53c80a);throw _0x53c80a;});}return _0xbd9175;})[_0x97c5('0x2b')](respondWithResult(_0x2c91df,0xc9))[_0x97c5('0x4c')](handleError(_0x2c91df,null));};exports[_0x97c5('0x5a')]=function(_0x195cb6,_0x3c292e){if(_0x195cb6[_0x97c5('0x52')]['id']){delete _0x195cb6['body']['id'];}return db[_0x97c5('0x35')][_0x97c5('0x50')]({'where':{'id':_0x195cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c292e,null))[_0x97c5('0x2b')](saveUpdates(_0x195cb6['body'],null))['then'](respondWithResult(_0x3c292e,null))[_0x97c5('0x4c')](handleError(_0x3c292e,null));};exports[_0x97c5('0x2f')]=function(_0x496ba6,_0x4070e8){return db[_0x97c5('0x35')][_0x97c5('0x50')]({'where':{'id':_0x496ba6['params']['id']}})[_0x97c5('0x2b')](handleEntityNotFound(_0x4070e8,null))['then'](removeEntity(_0x4070e8,null))['catch'](handleError(_0x4070e8,null));};exports[_0x97c5('0x5b')]=function(_0x483c08,_0x429362){return db['SmsQueue'][_0x97c5('0x5b')]()['then'](respondWithResult(_0x429362,null))[_0x97c5('0x4c')](handleError(_0x429362,null));};exports[_0x97c5('0x5c')]=function(_0x487265,_0x5ed112,_0x59651a){var _0x158eb8={'raw':!![],'where':{}},_0x4ec465={},_0x24c3ac;return db[_0x97c5('0x35')][_0x97c5('0x5d')]({'where':{'id':_0x487265[_0x97c5('0x4e')]['id']}})[_0x97c5('0x2b')](handleEntityNotFound(_0x5ed112,null))['then'](function(_0xbd4ef3){if(_0xbd4ef3){_0x24c3ac=_0xbd4ef3[_0x97c5('0x2c')]({'plain':!![]});_0x4ec465[_0x97c5('0x3a')]=_[_0x97c5('0x3b')](db[_0x97c5('0x5e')][_0x97c5('0x36')]);_0x4ec465[_0x97c5('0x3c')]=_[_0x97c5('0x3b')](_0x487265[_0x97c5('0x3c')]);_0x4ec465[_0x97c5('0x3d')]=_[_0x97c5('0x4f')](_0x4ec465[_0x97c5('0x3a')],_0x4ec465[_0x97c5('0x3c')]);_0x158eb8[_0x97c5('0x3e')]=_['intersection'](_0x4ec465[_0x97c5('0x3a')],qs[_0x97c5('0x3f')](_0x487265['query'][_0x97c5('0x3f')]));_0x158eb8['attributes']=_0x158eb8[_0x97c5('0x3e')]['length']?_0x158eb8[_0x97c5('0x3e')]:_0x4ec465[_0x97c5('0x3a')];if(!_0x487265[_0x97c5('0x3c')]['hasOwnProperty'](_0x97c5('0x42'))){_0x158eb8[_0x97c5('0x23')]=qs[_0x97c5('0x23')](_0x487265['query']['limit']);_0x158eb8[_0x97c5('0x25')]=qs[_0x97c5('0x25')](_0x487265[_0x97c5('0x3c')][_0x97c5('0x25')]);}_0x158eb8['order']=qs['sort'](_0x487265[_0x97c5('0x3c')][_0x97c5('0x43')]);_0x158eb8[_0x97c5('0x44')]=qs[_0x97c5('0x3d')](_[_0x97c5('0x45')](_0x487265['query'],_0x4ec465[_0x97c5('0x3d')]));_0x158eb8[_0x97c5('0x44')][_0x97c5('0x5f')]=_0xbd4ef3['id'];if(_0x487265['query'][_0x97c5('0x46')]){_0x158eb8[_0x97c5('0x44')]=_[_0x97c5('0x47')](_0x158eb8[_0x97c5('0x44')],{'$or':_[_0x97c5('0x34')](_0x158eb8[_0x97c5('0x3e')],function(_0x5d7331){var _0x228ebb={};_0x228ebb[_0x5d7331]={'$like':'%'+_0x487265[_0x97c5('0x3c')]['filter']+'%'};return _0x228ebb;})});}_0x158eb8=_[_0x97c5('0x47')]({},_0x158eb8,_0x487265['options']);return db['UserSmsQueue'][_0x97c5('0x60')](_0x158eb8);}})['then'](function(_0x31f673){if(_0x31f673){return db[_0x97c5('0x61')][_0x97c5('0x62')]({'where':{'id':_[_0x97c5('0x34')](_0x31f673,'UserId'),'role':_0x97c5('0x63')},'attributes':['id',_0x97c5('0x32'),_0x97c5('0x64'),_0x97c5('0x65'),_0x97c5('0x66')]});}})[_0x97c5('0x2b')](function(_0x456864){if(_0x456864){return{'count':_0x456864['count'],'rows':_['map'](_0x456864[_0x97c5('0x67')],function(_0x582b24){return{'membername':_0x582b24[_0x97c5('0x32')],'UserId':_0x582b24['id'],'queue_name':_0x24c3ac[_0x97c5('0x32')],'SmsQueueId':_0x24c3ac['id'],'interface':util[_0x97c5('0x68')](_0x97c5('0x69'),_0x97c5('0x6a'),_0x582b24['name']),'penalty':0x0,'paused':_0x582b24[_0x97c5('0x64')],'createdAt':_0x582b24[_0x97c5('0x66')],'updatedAt':_0x582b24[_0x97c5('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x97c5('0x2b')](respondWithFilteredResult(_0x5ed112,_0x158eb8))['catch'](handleError(_0x5ed112,null));};exports[_0x97c5('0x6b')]=function(_0x59c226,_0x5626ff,_0x59f1a1){var _0x57f3ed={};var _0x119b3c={};var _0x480b8f;var _0x328ebd;return db[_0x97c5('0x35')][_0x97c5('0x5d')]({'where':{'id':_0x59c226[_0x97c5('0x4e')]['id']}})[_0x97c5('0x2b')](handleEntityNotFound(_0x5626ff,null))[_0x97c5('0x2b')](function(_0x36f1ae){if(_0x36f1ae){_0x480b8f=_0x36f1ae;_0x119b3c[_0x97c5('0x3a')]=_[_0x97c5('0x3b')](db[_0x97c5('0x6c')]['rawAttributes']);_0x119b3c[_0x97c5('0x3c')]=_[_0x97c5('0x3b')](_0x59c226['query']);_0x119b3c[_0x97c5('0x3d')]=_[_0x97c5('0x4f')](_0x119b3c[_0x97c5('0x3a')],_0x119b3c['query']);_0x57f3ed[_0x97c5('0x3e')]=_['intersection'](_0x119b3c[_0x97c5('0x3a')],qs[_0x97c5('0x3f')](_0x59c226[_0x97c5('0x3c')]['fields']));_0x57f3ed[_0x97c5('0x3e')]=_0x57f3ed[_0x97c5('0x3e')][_0x97c5('0x40')]?_0x57f3ed[_0x97c5('0x3e')]:_0x119b3c[_0x97c5('0x3a')];_0x57f3ed[_0x97c5('0x6d')]=qs['sort'](_0x59c226[_0x97c5('0x3c')][_0x97c5('0x43')]);_0x57f3ed['where']=qs[_0x97c5('0x3d')](_[_0x97c5('0x45')](_0x59c226[_0x97c5('0x3c')],_0x119b3c[_0x97c5('0x3d')]));if(_0x59c226[_0x97c5('0x3c')]['filter']){_0x57f3ed[_0x97c5('0x44')]=_[_0x97c5('0x47')](_0x57f3ed[_0x97c5('0x44')],{'$or':_[_0x97c5('0x34')](_0x57f3ed[_0x97c5('0x3e')],function(_0x4f5585){var _0x151651={};_0x151651[_0x4f5585]={'$like':'%'+_0x59c226['query'][_0x97c5('0x46')]+'%'};return _0x151651;})});}_0x57f3ed=_[_0x97c5('0x47')]({},_0x57f3ed,_0x59c226[_0x97c5('0x49')]);return _0x480b8f[_0x97c5('0x6b')](_0x57f3ed);}})[_0x97c5('0x2b')](function(_0x1ea649){if(_0x1ea649){_0x328ebd=_0x1ea649['length'];if(!_0x59c226[_0x97c5('0x3c')]['hasOwnProperty'](_0x97c5('0x42'))){_0x57f3ed['limit']=qs[_0x97c5('0x23')](_0x59c226[_0x97c5('0x3c')][_0x97c5('0x23')]);_0x57f3ed[_0x97c5('0x25')]=qs[_0x97c5('0x25')](_0x59c226[_0x97c5('0x3c')][_0x97c5('0x25')]);}return _0x480b8f[_0x97c5('0x6b')](_0x57f3ed);}})[_0x97c5('0x2b')](function(_0x585a22){if(_0x585a22){return _0x585a22?{'count':_0x328ebd,'rows':_0x585a22}:null;}})[_0x97c5('0x2b')](respondWithResult(_0x5626ff,null))[_0x97c5('0x4c')](handleError(_0x5626ff,null));};exports[_0x97c5('0x6e')]=function(_0x18ac8e,_0x508c05,_0xd66f8d){var _0x1dbfa9=_0x18ac8e[_0x97c5('0x52')][_0x97c5('0x6f')];return db[_0x97c5('0x6c')][_0x97c5('0x60')]({'where':{'id':_0x1dbfa9},'attributes':['id'],'include':[{'model':db[_0x97c5('0x61')],'as':_0x97c5('0x70'),'attributes':['id',_0x97c5('0x32'),_0x97c5('0x71'),_0x97c5('0x72'),_0x97c5('0x73')],'raw':!![]}]})[_0x97c5('0x2b')](function(_0x2e159d){if(_0x2e159d){var _0x4021df=_[_0x97c5('0x74')](_0x2e159d,function(_0x2e08a2){var _0x261ae3=_0x2e08a2[_0x97c5('0x2c')]({'plain':!![]});return _0x261ae3[_0x97c5('0x70')];});return db[_0x97c5('0x35')][_0x97c5('0x50')]({'where':{'id':_0x18ac8e[_0x97c5('0x4e')]['id']}})['then'](function(_0x16b7ec){return db[_0x97c5('0x75')]['transaction'](function(_0x3b54f8){return _0x16b7ec['addTeams'](_0x1dbfa9,{'transaction':_0x3b54f8})[_0x97c5('0x2b')](function(){return BPromise[_0x97c5('0x76')](_0x4021df,function(_0x31dc95){return db['UserSmsQueue'][_0x97c5('0x77')]({'where':{'UserId':_0x31dc95['id'],'SmsQueueId':_0x18ac8e[_0x97c5('0x4e')]['id']},'transaction':_0x3b54f8});});})['then'](function(){_0x4021df['forEach'](function(_0x54d315){socket['emit']('userSmsQueue:save',{'UserId':_0x54d315['id'],'SmsQueueId':_0x16b7ec['id']});});});});});}})['then'](respondWithStatusCode(_0x508c05,null))[_0x97c5('0x4c')](handleError(_0x508c05,null));};exports[_0x97c5('0x78')]=function(_0xdab86e,_0x3e373f,_0x1a9370){return db[_0x97c5('0x6c')][_0x97c5('0x60')]({'where':{'id':_0xdab86e[_0x97c5('0x3c')][_0x97c5('0x6f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x97c5('0x70'),'attributes':['id'],'raw':!![]}]})[_0x97c5('0x2b')](handleEntityNotFound(_0x3e373f,null))[_0x97c5('0x2b')](function(_0x461570){var _0x25929e=_[_0x97c5('0x34')](_0x461570,'id');var _0xe39473=[];var _0x560155=[];var _0x243fb7=squel[_0x97c5('0x79')]();_0x243fb7[_0x97c5('0x7a')]('tq.TeamId')['from'](_0x97c5('0x7b'),'tq')[_0x97c5('0x7c')]('user_has_teams','ut',_0x97c5('0x7d'))['where'](_0x97c5('0x7e'),_0xdab86e[_0x97c5('0x4e')]['id']);for(var _0x11f546=0x0;_0x11f546<_0x461570[_0x97c5('0x40')];_0x11f546+=0x1){let _0x2966c1=_0x461570[_0x11f546];for(var _0x38bd1b=0x0;_0x38bd1b<_0x2966c1['Agents'][_0x97c5('0x40')];_0x38bd1b+=0x1){let _0x437d1a=_0x2966c1[_0x97c5('0x70')][_0x38bd1b];var _0x326035=_0x243fb7['clone']();_0x326035['where'](_0x97c5('0x7f'),_0x437d1a['id']);_0x560155[_0x97c5('0x80')](db[_0x97c5('0x75')]['query'](_0x326035[_0x97c5('0x81')](),{'type':db['sequelize'][_0x97c5('0x82')]['SELECT']})[_0x97c5('0x2b')](function(_0x27f7da){if(_0x27f7da[_0x97c5('0x40')]===0x1){return _0x437d1a['id'];}else{var _0x3e6127=_['every'](_['map'](_0x27f7da,'TeamId'),function(_0x2b0eef){return _[_0x97c5('0x83')](_0x25929e,_0x2b0eef);});if(_0x3e6127){return _0x437d1a['id'];}}}));}}return BPromise[_0x97c5('0x84')](_0x560155)[_0x97c5('0x2b')](function(_0x17a9cf){_0xe39473=_(_0xe39473)[_0x97c5('0x85')](_0x17a9cf)[_0x97c5('0x86')]()['value']();return db['SmsQueue']['find']({'where':{'id':_0xdab86e[_0x97c5('0x4e')]['id']}})[_0x97c5('0x2b')](function(_0x14ec22){return db[_0x97c5('0x75')]['transaction'](function(_0x417d22){return _0x14ec22[_0x97c5('0x78')](_0xdab86e[_0x97c5('0x3c')][_0x97c5('0x6f')],{'transaction':_0x417d22})['then'](function(){if(!_[_0x97c5('0x87')](_0xe39473)){return _0x14ec22['removeAgents'](_0xe39473,{'transaction':_0x417d22});}})[_0x97c5('0x2b')](function(){_0xe39473[_0x97c5('0x88')](function(_0x4d1cc4){socket[_0x97c5('0x89')](_0x97c5('0x8a'),{'UserId':_0x4d1cc4,'SmsQueueId':_0x14ec22['id']});});});});});});})[_0x97c5('0x2b')](respondWithStatusCode(_0x3e373f,null))[_0x97c5('0x4c')](handleError(_0x3e373f,null));};exports[_0x97c5('0x8b')]=function(_0x5a1f2,_0x539c08,_0x3814ad){return db[_0x97c5('0x35')]['find']({'where':{'id':_0x5a1f2['params']['id']}})[_0x97c5('0x2b')](handleEntityNotFound(_0x539c08,null))[_0x97c5('0x2b')](function(_0x283b7e){if(_0x283b7e){return _0x283b7e['addAgents'](_0x5a1f2[_0x97c5('0x52')][_0x97c5('0x6f')],_[_0x97c5('0x8c')](_0x5a1f2[_0x97c5('0x52')],[_0x97c5('0x6f'),'id'])||{})[_0x97c5('0x8d')](function(_0x45d791){for(var _0x46f58e=0x0;_0x46f58e<_0x5a1f2['body'][_0x97c5('0x6f')][_0x97c5('0x40')];_0x46f58e+=0x1){socket[_0x97c5('0x89')](_0x97c5('0x8e'),{'UserId':Number(_0x5a1f2[_0x97c5('0x52')][_0x97c5('0x6f')][_0x46f58e]),'SmsQueueId':Number(_0x5a1f2[_0x97c5('0x4e')]['id'])});}return _0x45d791;});}})['then'](respondWithResult(_0x539c08,null))[_0x97c5('0x4c')](handleError(_0x539c08,null));};exports['removeAgents']=function(_0x4f328f,_0x488c71,_0x5ea1ce){return db[_0x97c5('0x35')]['find']({'where':{'id':_0x4f328f[_0x97c5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x488c71,null))[_0x97c5('0x2b')](function(_0x27ef36){if(_0x27ef36){return _0x27ef36[_0x97c5('0x8f')](_0x4f328f[_0x97c5('0x3c')][_0x97c5('0x6f')])[_0x97c5('0x2b')](function(){if(_[_0x97c5('0x90')](_0x4f328f[_0x97c5('0x3c')][_0x97c5('0x6f')])){for(var _0x46c474=0x0;_0x46c474<_0x4f328f[_0x97c5('0x3c')]['ids'][_0x97c5('0x40')];_0x46c474+=0x1){socket[_0x97c5('0x89')]('userSmsQueue:remove',{'UserId':Number(_0x4f328f[_0x97c5('0x3c')][_0x97c5('0x6f')][_0x46c474]),'SmsQueueId':Number(_0x4f328f[_0x97c5('0x4e')]['id'])});}}else{socket['emit'](_0x97c5('0x8a'),{'UserId':Number(_0x4f328f[_0x97c5('0x3c')][_0x97c5('0x6f')]),'SmsQueueId':Number(_0x4f328f[_0x97c5('0x4e')]['id'])});}});}})['then'](respondWithStatusCode(_0x488c71,null))[_0x97c5('0x4c')](handleError(_0x488c71,null));};exports[_0x97c5('0x91')]=function(_0x20b71b,_0x34e812,_0x454355){var _0x2a7ca6={};var _0x18f550={};var _0xeed603;var _0x31319c;return db[_0x97c5('0x35')]['findOne']({'where':{'id':_0x20b71b[_0x97c5('0x4e')]['id']}})[_0x97c5('0x2b')](handleEntityNotFound(_0x34e812,null))[_0x97c5('0x2b')](function(_0x3c3a5f){if(_0x3c3a5f){_0xeed603=_0x3c3a5f;_0x18f550[_0x97c5('0x3a')]=_[_0x97c5('0x3b')](db[_0x97c5('0x61')]['rawAttributes']);_0x18f550[_0x97c5('0x3c')]=_[_0x97c5('0x3b')](_0x20b71b[_0x97c5('0x3c')]);_0x18f550[_0x97c5('0x3d')]=_['intersection'](_0x18f550['model'],_0x18f550[_0x97c5('0x3c')]);_0x2a7ca6[_0x97c5('0x3e')]=_[_0x97c5('0x4f')](_0x18f550[_0x97c5('0x3a')],qs[_0x97c5('0x3f')](_0x20b71b[_0x97c5('0x3c')][_0x97c5('0x3f')]));_0x2a7ca6['attributes']=_0x2a7ca6[_0x97c5('0x3e')][_0x97c5('0x40')]?_0x2a7ca6[_0x97c5('0x3e')]:_0x18f550[_0x97c5('0x3a')];_0x2a7ca6['order']=qs['sort'](_0x20b71b[_0x97c5('0x3c')][_0x97c5('0x43')]);_0x2a7ca6[_0x97c5('0x44')]=qs['filters'](_[_0x97c5('0x45')](_0x20b71b[_0x97c5('0x3c')],_0x18f550[_0x97c5('0x3d')]));if(_0x20b71b[_0x97c5('0x3c')][_0x97c5('0x46')]){_0x2a7ca6[_0x97c5('0x44')]=_['merge'](_0x2a7ca6[_0x97c5('0x44')],{'$or':_[_0x97c5('0x34')](_0x2a7ca6[_0x97c5('0x3e')],function(_0x1e81a9){var _0x123e5b={};_0x123e5b[_0x1e81a9]={'$like':'%'+_0x20b71b[_0x97c5('0x3c')]['filter']+'%'};return _0x123e5b;})});}_0x2a7ca6=_[_0x97c5('0x47')]({},_0x2a7ca6,_0x20b71b[_0x97c5('0x49')]);return _0xeed603[_0x97c5('0x91')](_0x2a7ca6);}})['then'](function(_0x5a48fa){if(_0x5a48fa){_0x31319c=_0x5a48fa[_0x97c5('0x40')];if(!_0x20b71b[_0x97c5('0x3c')][_0x97c5('0x41')](_0x97c5('0x42'))){_0x2a7ca6[_0x97c5('0x23')]=qs[_0x97c5('0x23')](_0x20b71b[_0x97c5('0x3c')][_0x97c5('0x23')]);_0x2a7ca6[_0x97c5('0x25')]=qs[_0x97c5('0x25')](_0x20b71b[_0x97c5('0x3c')]['offset']);}return _0xeed603[_0x97c5('0x91')](_0x2a7ca6);}})[_0x97c5('0x2b')](function(_0x139611){if(_0x139611){return _0x139611?{'count':_0x31319c,'rows':_0x139611}:null;}})[_0x97c5('0x2b')](respondWithResult(_0x34e812,null))[_0x97c5('0x4c')](handleError(_0x34e812,null));};
\ No newline at end of file
+var _0x1cca=['flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','select','tq.TeamId','join','user_has_teams','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','omit','isArray','userSmsQueue:remove','getAgents','eml-format','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','get','SmsQueues','UserProfileResource','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','filter','merge','options','SmsQueue','include','rows','catch','params','includeAll','find','create','body','user','UserProfileSection','autoAssociation','describe','findOne','order','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','online','voicePause','interface'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x1cca,0x12d));var _0xa1cc=function(_0x2e2d88,_0x56f02b){_0x2e2d88=_0x2e2d88-0x0;var _0x4ca255=_0x1cca[_0x2e2d88];return _0x4ca255;};'use strict';var emlformat=require(_0xa1cc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa1cc('0x1'));var rp=require(_0xa1cc('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1cc('0x3'));var util=require(_0xa1cc('0x4'));var path=require(_0xa1cc('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa1cc('0x6'));var fs=require('fs');var fs_extra=require(_0xa1cc('0x7'));var _=require(_0xa1cc('0x8'));var squel=require(_0xa1cc('0x9'));var crypto=require(_0xa1cc('0xa'));var jsforce=require(_0xa1cc('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa1cc('0xc'));var querystring=require(_0xa1cc('0xd'));var Papa=require('papaparse');var Redis=require(_0xa1cc('0xe'));var authService=require(_0xa1cc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa1cc('0x10'));var logger=require(_0xa1cc('0x11'))(_0xa1cc('0x12'));var utils=require(_0xa1cc('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa1cc('0x14'));var db=require(_0xa1cc('0x15'))['db'];config[_0xa1cc('0x16')]=_['defaults'](config['redis'],{'host':_0xa1cc('0x17'),'port':0x18eb});var socket=require(_0xa1cc('0x18'))(new Redis(config[_0xa1cc('0x16')]));require('./smsQueue.socket')[_0xa1cc('0x19')](socket);function respondWithStatusCode(_0x989c7e,_0x5f925c){_0x5f925c=_0x5f925c||0xcc;return function(_0x5558c3){if(_0x5558c3){return _0x989c7e[_0xa1cc('0x1a')](_0x5f925c);}return _0x989c7e[_0xa1cc('0x1b')](_0x5f925c)[_0xa1cc('0x1c')]();};}function respondWithResult(_0x5e6764,_0x46c553){_0x46c553=_0x46c553||0xc8;return function(_0x12dde8){if(_0x12dde8){return _0x5e6764[_0xa1cc('0x1b')](_0x46c553)['json'](_0x12dde8);}};}function respondWithFilteredResult(_0x190768,_0x1134a9){return function(_0x992b0e){if(_0x992b0e){var _0x5a6c9f=typeof _0x1134a9[_0xa1cc('0x1d')]===_0xa1cc('0x1e')&&typeof _0x1134a9[_0xa1cc('0x1f')]===_0xa1cc('0x1e');var _0x4eb860=_0x992b0e[_0xa1cc('0x20')];var _0x201183=_0x5a6c9f?0x0:_0x1134a9['offset'];var _0x2067ad=_0x5a6c9f?_0x992b0e[_0xa1cc('0x20')]:_0x1134a9['offset']+_0x1134a9[_0xa1cc('0x1f')];var _0x44f054;if(_0x2067ad>=_0x4eb860){_0x2067ad=_0x4eb860;_0x44f054=0xc8;}else{_0x44f054=0xce;}_0x190768[_0xa1cc('0x1b')](_0x44f054);return _0x190768['set'](_0xa1cc('0x21'),_0x201183+'-'+_0x2067ad+'/'+_0x4eb860)[_0xa1cc('0x22')](_0x992b0e);}return null;};}function patchUpdates(_0xc7dd6c){return function(_0x32fa32){try{jsonpatch[_0xa1cc('0x23')](_0x32fa32,_0xc7dd6c,!![]);}catch(_0x213b32){return BPromise[_0xa1cc('0x24')](_0x213b32);}return _0x32fa32['save']();};}function saveUpdates(_0x2d6997,_0x1b25bb){return function(_0x231116){if(_0x231116){return _0x231116[_0xa1cc('0x25')](_0x2d6997)[_0xa1cc('0x26')](function(_0x1d716a){return _0x1d716a;});}return null;};}function removeEntity(_0x1f3f21,_0x45c3a4){return function(_0x206bb3){if(_0x206bb3){return _0x206bb3['destroy']()[_0xa1cc('0x26')](function(){var _0x3c49db=_0x206bb3[_0xa1cc('0x27')]({'plain':!![]});var _0x49f4ba=_0xa1cc('0x28');return db[_0xa1cc('0x29')][_0xa1cc('0x2a')]({'where':{'type':_0x49f4ba,'resourceId':_0x3c49db['id']}})[_0xa1cc('0x26')](function(){return _0x206bb3;});})[_0xa1cc('0x26')](function(){_0x1f3f21[_0xa1cc('0x1b')](0xcc)[_0xa1cc('0x1c')]();});}};}function handleEntityNotFound(_0x10f09c,_0xab50c2){return function(_0x353cc3){if(!_0x353cc3){_0x10f09c[_0xa1cc('0x1a')](0x194);}return _0x353cc3;};}function handleError(_0x49abc1,_0x38ac01){_0x38ac01=_0x38ac01||0x1f4;return function(_0x4c72da){logger[_0xa1cc('0x2b')](_0x4c72da[_0xa1cc('0x2c')]);if(_0x4c72da[_0xa1cc('0x2d')]){delete _0x4c72da[_0xa1cc('0x2d')];}_0x49abc1[_0xa1cc('0x1b')](_0x38ac01)[_0xa1cc('0x2e')](_0x4c72da);};}exports['index']=function(_0x3dd66f,_0x51b32c){var _0x39e1c5={},_0x5a464a={},_0x1c3b3f={'count':0x0,'rows':[]};var _0x4875ed=_[_0xa1cc('0x2f')](db['SmsQueue'][_0xa1cc('0x30')],function(_0x46cae1){return{'name':_0x46cae1[_0xa1cc('0x31')],'type':_0x46cae1[_0xa1cc('0x32')][_0xa1cc('0x33')]};});_0x5a464a[_0xa1cc('0x34')]=_[_0xa1cc('0x2f')](_0x4875ed,_0xa1cc('0x2d'));_0x5a464a[_0xa1cc('0x35')]=_[_0xa1cc('0x36')](_0x3dd66f[_0xa1cc('0x35')]);_0x5a464a[_0xa1cc('0x37')]=_[_0xa1cc('0x38')](_0x5a464a[_0xa1cc('0x34')],_0x5a464a[_0xa1cc('0x35')]);_0x39e1c5[_0xa1cc('0x39')]=_[_0xa1cc('0x38')](_0x5a464a[_0xa1cc('0x34')],qs['fields'](_0x3dd66f[_0xa1cc('0x35')][_0xa1cc('0x3a')]));_0x39e1c5[_0xa1cc('0x39')]=_0x39e1c5[_0xa1cc('0x39')][_0xa1cc('0x3b')]?_0x39e1c5['attributes']:_0x5a464a['model'];if(!_0x3dd66f['query'][_0xa1cc('0x3c')](_0xa1cc('0x3d'))){_0x39e1c5[_0xa1cc('0x1f')]=qs[_0xa1cc('0x1f')](_0x3dd66f['query'][_0xa1cc('0x1f')]);_0x39e1c5['offset']=qs[_0xa1cc('0x1d')](_0x3dd66f[_0xa1cc('0x35')][_0xa1cc('0x1d')]);}_0x39e1c5['order']=qs[_0xa1cc('0x3e')](_0x3dd66f[_0xa1cc('0x35')][_0xa1cc('0x3e')]);_0x39e1c5['where']=qs[_0xa1cc('0x37')](_[_0xa1cc('0x3f')](_0x3dd66f[_0xa1cc('0x35')],_0x5a464a[_0xa1cc('0x37')]),_0x4875ed);if(_0x3dd66f[_0xa1cc('0x35')]['filter']){_0x39e1c5[_0xa1cc('0x40')]=_['merge'](_0x39e1c5['where'],{'$or':_['map'](_0x4875ed,function(_0x1a427d){if(_0x1a427d['type']!=='VIRTUAL'){var _0x2f9584={};_0x2f9584[_0x1a427d[_0xa1cc('0x2d')]]={'$like':'%'+_0x3dd66f[_0xa1cc('0x35')][_0xa1cc('0x41')]+'%'};return _0x2f9584;}})});}_0x39e1c5=_[_0xa1cc('0x42')]({},_0x39e1c5,_0x3dd66f[_0xa1cc('0x43')]);var _0x524e49={'where':_0x39e1c5[_0xa1cc('0x40')]};return db[_0xa1cc('0x44')][_0xa1cc('0x20')](_0x524e49)['then'](function(_0x2be383){_0x1c3b3f[_0xa1cc('0x20')]=_0x2be383;if(_0x3dd66f[_0xa1cc('0x35')]['includeAll']){_0x39e1c5[_0xa1cc('0x45')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x39e1c5);})[_0xa1cc('0x26')](function(_0x289027){_0x1c3b3f[_0xa1cc('0x46')]=_0x289027;return _0x1c3b3f;})[_0xa1cc('0x26')](respondWithFilteredResult(_0x51b32c,_0x39e1c5))[_0xa1cc('0x47')](handleError(_0x51b32c,null));};exports['show']=function(_0x2a4e40,_0x23060b){var _0x5a5182={'raw':!![],'where':{'id':_0x2a4e40[_0xa1cc('0x48')]['id']}},_0x344334={};_0x344334[_0xa1cc('0x34')]=_[_0xa1cc('0x36')](db[_0xa1cc('0x44')]['rawAttributes']);_0x344334[_0xa1cc('0x35')]=_[_0xa1cc('0x36')](_0x2a4e40[_0xa1cc('0x35')]);_0x344334[_0xa1cc('0x37')]=_[_0xa1cc('0x38')](_0x344334[_0xa1cc('0x34')],_0x344334[_0xa1cc('0x35')]);_0x5a5182[_0xa1cc('0x39')]=_[_0xa1cc('0x38')](_0x344334[_0xa1cc('0x34')],qs[_0xa1cc('0x3a')](_0x2a4e40[_0xa1cc('0x35')][_0xa1cc('0x3a')]));_0x5a5182[_0xa1cc('0x39')]=_0x5a5182[_0xa1cc('0x39')][_0xa1cc('0x3b')]?_0x5a5182[_0xa1cc('0x39')]:_0x344334['model'];if(_0x2a4e40[_0xa1cc('0x35')][_0xa1cc('0x49')]){_0x5a5182[_0xa1cc('0x45')]=[{'all':!![]}];}_0x5a5182=_[_0xa1cc('0x42')]({},_0x5a5182,_0x2a4e40[_0xa1cc('0x43')]);return db[_0xa1cc('0x44')][_0xa1cc('0x4a')](_0x5a5182)[_0xa1cc('0x26')](handleEntityNotFound(_0x23060b,null))[_0xa1cc('0x26')](respondWithResult(_0x23060b,null))[_0xa1cc('0x47')](handleError(_0x23060b,null));};exports[_0xa1cc('0x4b')]=function(_0x31a622,_0x333f8c){return db[_0xa1cc('0x44')][_0xa1cc('0x4b')](_0x31a622[_0xa1cc('0x4c')],{})[_0xa1cc('0x26')](function(_0x64c5bb){var _0x270334=_0x31a622['user'][_0xa1cc('0x27')]({'plain':!![]});if(!_0x270334)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x270334['role']===_0xa1cc('0x4d')){var _0x1df649=_0x64c5bb[_0xa1cc('0x27')]({'plain':!![]});var _0x513ec5=_0xa1cc('0x28');return db[_0xa1cc('0x4e')][_0xa1cc('0x4a')]({'where':{'name':_0x513ec5,'userProfileId':_0x270334['userProfileId']},'raw':!![]})['then'](function(_0xdcb7fe){if(_0xdcb7fe&&_0xdcb7fe[_0xa1cc('0x4f')]===0x0){return db[_0xa1cc('0x29')][_0xa1cc('0x4b')]({'name':_0x1df649[_0xa1cc('0x2d')],'resourceId':_0x1df649['id'],'type':_0xdcb7fe[_0xa1cc('0x2d')],'sectionId':_0xdcb7fe['id']},{})['then'](function(){return _0x64c5bb;});}else{return _0x64c5bb;}})['catch'](function(_0x27caba){logger[_0xa1cc('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27caba);throw _0x27caba;});}return _0x64c5bb;})[_0xa1cc('0x26')](respondWithResult(_0x333f8c,0xc9))['catch'](handleError(_0x333f8c,null));};exports[_0xa1cc('0x25')]=function(_0x53497f,_0x1559f6){if(_0x53497f[_0xa1cc('0x4c')]['id']){delete _0x53497f[_0xa1cc('0x4c')]['id'];}return db[_0xa1cc('0x44')][_0xa1cc('0x4a')]({'where':{'id':_0x53497f[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](handleEntityNotFound(_0x1559f6,null))['then'](saveUpdates(_0x53497f[_0xa1cc('0x4c')],null))['then'](respondWithResult(_0x1559f6,null))[_0xa1cc('0x47')](handleError(_0x1559f6,null));};exports[_0xa1cc('0x2a')]=function(_0x21b8dc,_0x5f0701){return db[_0xa1cc('0x44')][_0xa1cc('0x4a')]({'where':{'id':_0x21b8dc[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](handleEntityNotFound(_0x5f0701,null))[_0xa1cc('0x26')](removeEntity(_0x5f0701,null))[_0xa1cc('0x47')](handleError(_0x5f0701,null));};exports['describe']=function(_0x1a8d59,_0x2a39ab){return db[_0xa1cc('0x44')][_0xa1cc('0x50')]()[_0xa1cc('0x26')](respondWithResult(_0x2a39ab,null))['catch'](handleError(_0x2a39ab,null));};exports['getMembers']=function(_0xbd97e7,_0x1da2ea,_0x55ff6f){var _0x52b6ef={'raw':!![],'where':{}},_0x2d4651={},_0x41a7f6;return db[_0xa1cc('0x44')][_0xa1cc('0x51')]({'where':{'id':_0xbd97e7[_0xa1cc('0x48')]['id']}})['then'](handleEntityNotFound(_0x1da2ea,null))[_0xa1cc('0x26')](function(_0x397087){if(_0x397087){_0x41a7f6=_0x397087[_0xa1cc('0x27')]({'plain':!![]});_0x2d4651[_0xa1cc('0x34')]=_[_0xa1cc('0x36')](db['UserSmsQueue']['rawAttributes']);_0x2d4651['query']=_[_0xa1cc('0x36')](_0xbd97e7[_0xa1cc('0x35')]);_0x2d4651[_0xa1cc('0x37')]=_[_0xa1cc('0x38')](_0x2d4651[_0xa1cc('0x34')],_0x2d4651[_0xa1cc('0x35')]);_0x52b6ef['attributes']=_[_0xa1cc('0x38')](_0x2d4651[_0xa1cc('0x34')],qs[_0xa1cc('0x3a')](_0xbd97e7[_0xa1cc('0x35')]['fields']));_0x52b6ef[_0xa1cc('0x39')]=_0x52b6ef[_0xa1cc('0x39')][_0xa1cc('0x3b')]?_0x52b6ef[_0xa1cc('0x39')]:_0x2d4651[_0xa1cc('0x34')];if(!_0xbd97e7[_0xa1cc('0x35')][_0xa1cc('0x3c')](_0xa1cc('0x3d'))){_0x52b6ef[_0xa1cc('0x1f')]=qs['limit'](_0xbd97e7[_0xa1cc('0x35')]['limit']);_0x52b6ef[_0xa1cc('0x1d')]=qs[_0xa1cc('0x1d')](_0xbd97e7['query']['offset']);}_0x52b6ef[_0xa1cc('0x52')]=qs[_0xa1cc('0x3e')](_0xbd97e7[_0xa1cc('0x35')][_0xa1cc('0x3e')]);_0x52b6ef[_0xa1cc('0x40')]=qs[_0xa1cc('0x37')](_[_0xa1cc('0x3f')](_0xbd97e7['query'],_0x2d4651['filters']));_0x52b6ef[_0xa1cc('0x40')]['SmsQueueId']=_0x397087['id'];if(_0xbd97e7[_0xa1cc('0x35')][_0xa1cc('0x41')]){_0x52b6ef['where']=_[_0xa1cc('0x42')](_0x52b6ef[_0xa1cc('0x40')],{'$or':_[_0xa1cc('0x2f')](_0x52b6ef[_0xa1cc('0x39')],function(_0x5a0718){var _0x381d4b={};_0x381d4b[_0x5a0718]={'$like':'%'+_0xbd97e7[_0xa1cc('0x35')][_0xa1cc('0x41')]+'%'};return _0x381d4b;})});}_0x52b6ef=_[_0xa1cc('0x42')]({},_0x52b6ef,_0xbd97e7[_0xa1cc('0x43')]);return db[_0xa1cc('0x53')]['findAll'](_0x52b6ef);}})[_0xa1cc('0x26')](function(_0xd81e0){if(_0xd81e0){return db[_0xa1cc('0x54')][_0xa1cc('0x55')]({'where':{'id':_[_0xa1cc('0x2f')](_0xd81e0,_0xa1cc('0x56')),'role':_0xa1cc('0x57')},'attributes':['id',_0xa1cc('0x2d'),_0xa1cc('0x58'),_0xa1cc('0x59'),'createdAt']});}})['then'](function(_0x5c36d9){if(_0x5c36d9){return{'count':_0x5c36d9[_0xa1cc('0x20')],'rows':_[_0xa1cc('0x2f')](_0x5c36d9['rows'],function(_0x35a171){return{'membername':_0x35a171[_0xa1cc('0x2d')],'UserId':_0x35a171['id'],'queue_name':_0x41a7f6[_0xa1cc('0x2d')],'SmsQueueId':_0x41a7f6['id'],'interface':util[_0xa1cc('0x5a')](_0xa1cc('0x5b'),_0xa1cc('0x5c'),_0x35a171[_0xa1cc('0x2d')]),'penalty':0x0,'paused':_0x35a171[_0xa1cc('0x58')],'createdAt':_0x35a171[_0xa1cc('0x5d')],'updatedAt':_0x35a171['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa1cc('0x26')](respondWithFilteredResult(_0x1da2ea,_0x52b6ef))[_0xa1cc('0x47')](handleError(_0x1da2ea,null));};exports[_0xa1cc('0x5e')]=function(_0x3df404,_0x50ab59,_0x22eb59){var _0x2e1cf8={};var _0x216a89={};var _0x5e9fb2;var _0x38fe98;return db[_0xa1cc('0x44')][_0xa1cc('0x51')]({'where':{'id':_0x3df404[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](handleEntityNotFound(_0x50ab59,null))[_0xa1cc('0x26')](function(_0x131f87){if(_0x131f87){_0x5e9fb2=_0x131f87;_0x216a89[_0xa1cc('0x34')]=_[_0xa1cc('0x36')](db[_0xa1cc('0x5f')][_0xa1cc('0x30')]);_0x216a89[_0xa1cc('0x35')]=_[_0xa1cc('0x36')](_0x3df404[_0xa1cc('0x35')]);_0x216a89['filters']=_[_0xa1cc('0x38')](_0x216a89[_0xa1cc('0x34')],_0x216a89['query']);_0x2e1cf8[_0xa1cc('0x39')]=_[_0xa1cc('0x38')](_0x216a89['model'],qs[_0xa1cc('0x3a')](_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x3a')]));_0x2e1cf8['attributes']=_0x2e1cf8[_0xa1cc('0x39')]['length']?_0x2e1cf8[_0xa1cc('0x39')]:_0x216a89['model'];_0x2e1cf8[_0xa1cc('0x52')]=qs[_0xa1cc('0x3e')](_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x3e')]);_0x2e1cf8['where']=qs[_0xa1cc('0x37')](_[_0xa1cc('0x3f')](_0x3df404[_0xa1cc('0x35')],_0x216a89[_0xa1cc('0x37')]));if(_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x41')]){_0x2e1cf8['where']=_[_0xa1cc('0x42')](_0x2e1cf8[_0xa1cc('0x40')],{'$or':_['map'](_0x2e1cf8['attributes'],function(_0x56718b){var _0x137e80={};_0x137e80[_0x56718b]={'$like':'%'+_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x41')]+'%'};return _0x137e80;})});}_0x2e1cf8=_[_0xa1cc('0x42')]({},_0x2e1cf8,_0x3df404[_0xa1cc('0x43')]);return _0x5e9fb2[_0xa1cc('0x5e')](_0x2e1cf8);}})[_0xa1cc('0x26')](function(_0x1330ef){if(_0x1330ef){_0x38fe98=_0x1330ef['length'];if(!_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x3c')](_0xa1cc('0x3d'))){_0x2e1cf8[_0xa1cc('0x1f')]=qs[_0xa1cc('0x1f')](_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x1f')]);_0x2e1cf8[_0xa1cc('0x1d')]=qs[_0xa1cc('0x1d')](_0x3df404[_0xa1cc('0x35')][_0xa1cc('0x1d')]);}return _0x5e9fb2[_0xa1cc('0x5e')](_0x2e1cf8);}})[_0xa1cc('0x26')](function(_0x5ef57e){if(_0x5ef57e){return _0x5ef57e?{'count':_0x38fe98,'rows':_0x5ef57e}:null;}})['then'](respondWithResult(_0x50ab59,null))[_0xa1cc('0x47')](handleError(_0x50ab59,null));};exports[_0xa1cc('0x60')]=function(_0xd2eefb,_0x3c118a,_0x19ddbb){var _0x33c156=_0xd2eefb['body'][_0xa1cc('0x61')];return db['Team']['findAll']({'where':{'id':_0x33c156},'attributes':['id'],'include':[{'model':db[_0xa1cc('0x54')],'as':'Agents','attributes':['id',_0xa1cc('0x2d'),_0xa1cc('0x62'),_0xa1cc('0x63'),_0xa1cc('0x64')],'raw':!![]}]})[_0xa1cc('0x26')](function(_0x24e2f4){if(_0x24e2f4){var _0x33e109=_[_0xa1cc('0x65')](_0x24e2f4,function(_0x5ad61f){var _0x48705e=_0x5ad61f[_0xa1cc('0x27')]({'plain':!![]});return _0x48705e[_0xa1cc('0x66')];});return db[_0xa1cc('0x44')][_0xa1cc('0x4a')]({'where':{'id':_0xd2eefb[_0xa1cc('0x48')]['id']}})['then'](function(_0x571d50){return db[_0xa1cc('0x67')][_0xa1cc('0x68')](function(_0x3657d2){return _0x571d50[_0xa1cc('0x60')](_0x33c156,{'transaction':_0x3657d2})['then'](function(){return BPromise[_0xa1cc('0x69')](_0x33e109,function(_0x4e69d7){return db[_0xa1cc('0x53')][_0xa1cc('0x6a')]({'where':{'UserId':_0x4e69d7['id'],'SmsQueueId':_0xd2eefb[_0xa1cc('0x48')]['id']},'transaction':_0x3657d2});});})[_0xa1cc('0x26')](function(){_0x33e109[_0xa1cc('0x6b')](function(_0xc88bad){socket[_0xa1cc('0x6c')](_0xa1cc('0x6d'),{'UserId':_0xc88bad['id'],'SmsQueueId':_0x571d50['id']});});});});});}})[_0xa1cc('0x26')](respondWithStatusCode(_0x3c118a,null))[_0xa1cc('0x47')](handleError(_0x3c118a,null));};exports['removeTeams']=function(_0x45a842,_0x19f6ef,_0x35e396){return db['Team']['findAll']({'where':{'id':_0x45a842[_0xa1cc('0x35')][_0xa1cc('0x61')]},'attributes':['id'],'include':[{'model':db[_0xa1cc('0x54')],'as':_0xa1cc('0x66'),'attributes':['id'],'raw':!![]}]})[_0xa1cc('0x26')](handleEntityNotFound(_0x19f6ef,null))['then'](function(_0x55bac9){var _0x3f593d=_['map'](_0x55bac9,'id');var _0x402b60=[];var _0x523961=[];var _0x3353ca=squel[_0xa1cc('0x6e')]();_0x3353ca['field'](_0xa1cc('0x6f'))['from']('team_has_sms_queues','tq')[_0xa1cc('0x70')](_0xa1cc('0x71'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa1cc('0x40')](_0xa1cc('0x72'),_0x45a842[_0xa1cc('0x48')]['id']);for(var _0x2c0f28=0x0;_0x2c0f28<_0x55bac9[_0xa1cc('0x3b')];_0x2c0f28+=0x1){let _0x563589=_0x55bac9[_0x2c0f28];for(var _0x46f39c=0x0;_0x46f39c<_0x563589[_0xa1cc('0x66')]['length'];_0x46f39c+=0x1){let _0x53f2ce=_0x563589['Agents'][_0x46f39c];var _0x179fdc=_0x3353ca[_0xa1cc('0x73')]();_0x179fdc[_0xa1cc('0x40')](_0xa1cc('0x74'),_0x53f2ce['id']);_0x523961[_0xa1cc('0x75')](db['sequelize'][_0xa1cc('0x35')](_0x179fdc[_0xa1cc('0x76')](),{'type':db[_0xa1cc('0x67')]['QueryTypes'][_0xa1cc('0x77')]})[_0xa1cc('0x26')](function(_0x78e00a){if(_0x78e00a[_0xa1cc('0x3b')]===0x1){return _0x53f2ce['id'];}else{var _0x3419cd=_[_0xa1cc('0x78')](_[_0xa1cc('0x2f')](_0x78e00a,_0xa1cc('0x79')),function(_0x4642f5){return _[_0xa1cc('0x7a')](_0x3f593d,_0x4642f5);});if(_0x3419cd){return _0x53f2ce['id'];}}}));}}return BPromise['all'](_0x523961)[_0xa1cc('0x26')](function(_0x4c8b58){_0x402b60=_(_0x402b60)[_0xa1cc('0x7b')](_0x4c8b58)[_0xa1cc('0x7c')]()[_0xa1cc('0x7d')]();return db[_0xa1cc('0x44')][_0xa1cc('0x4a')]({'where':{'id':_0x45a842[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](function(_0x3041f2){return db['sequelize'][_0xa1cc('0x68')](function(_0x583402){return _0x3041f2[_0xa1cc('0x7e')](_0x45a842[_0xa1cc('0x35')]['ids'],{'transaction':_0x583402})[_0xa1cc('0x26')](function(){if(!_[_0xa1cc('0x7f')](_0x402b60)){return _0x3041f2[_0xa1cc('0x80')](_0x402b60,{'transaction':_0x583402});}})['then'](function(){_0x402b60[_0xa1cc('0x6b')](function(_0x3cb801){socket[_0xa1cc('0x6c')]('userSmsQueue:remove',{'UserId':_0x3cb801,'SmsQueueId':_0x3041f2['id']});});});});});});})[_0xa1cc('0x26')](respondWithStatusCode(_0x19f6ef,null))['catch'](handleError(_0x19f6ef,null));};exports['addAgents']=function(_0x12c003,_0x1fe0ae,_0x42adeb){return db[_0xa1cc('0x44')]['find']({'where':{'id':_0x12c003[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](handleEntityNotFound(_0x1fe0ae,null))[_0xa1cc('0x26')](function(_0x455a2b){if(_0x455a2b){return _0x455a2b[_0xa1cc('0x81')](_0x12c003[_0xa1cc('0x4c')][_0xa1cc('0x61')],_[_0xa1cc('0x82')](_0x12c003[_0xa1cc('0x4c')],[_0xa1cc('0x61'),'id'])||{})['spread'](function(_0x225eb7){for(var _0x21094b=0x0;_0x21094b<_0x12c003[_0xa1cc('0x4c')][_0xa1cc('0x61')][_0xa1cc('0x3b')];_0x21094b+=0x1){socket['emit'](_0xa1cc('0x6d'),{'UserId':Number(_0x12c003[_0xa1cc('0x4c')][_0xa1cc('0x61')][_0x21094b]),'SmsQueueId':Number(_0x12c003[_0xa1cc('0x48')]['id'])});}return _0x225eb7;});}})[_0xa1cc('0x26')](respondWithResult(_0x1fe0ae,null))['catch'](handleError(_0x1fe0ae,null));};exports[_0xa1cc('0x80')]=function(_0x2c67d9,_0x3dac6d,_0x5b0402){return db[_0xa1cc('0x44')][_0xa1cc('0x4a')]({'where':{'id':_0x2c67d9['params']['id']}})['then'](handleEntityNotFound(_0x3dac6d,null))[_0xa1cc('0x26')](function(_0x39d7e5){if(_0x39d7e5){return _0x39d7e5[_0xa1cc('0x80')](_0x2c67d9[_0xa1cc('0x35')][_0xa1cc('0x61')])[_0xa1cc('0x26')](function(){if(_[_0xa1cc('0x83')](_0x2c67d9[_0xa1cc('0x35')][_0xa1cc('0x61')])){for(var _0x6e09fb=0x0;_0x6e09fb<_0x2c67d9[_0xa1cc('0x35')][_0xa1cc('0x61')][_0xa1cc('0x3b')];_0x6e09fb+=0x1){socket[_0xa1cc('0x6c')](_0xa1cc('0x84'),{'UserId':Number(_0x2c67d9[_0xa1cc('0x35')]['ids'][_0x6e09fb]),'SmsQueueId':Number(_0x2c67d9[_0xa1cc('0x48')]['id'])});}}else{socket[_0xa1cc('0x6c')](_0xa1cc('0x84'),{'UserId':Number(_0x2c67d9[_0xa1cc('0x35')]['ids']),'SmsQueueId':Number(_0x2c67d9[_0xa1cc('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x3dac6d,null))[_0xa1cc('0x47')](handleError(_0x3dac6d,null));};exports['getAgents']=function(_0x4fea45,_0x4ba067,_0x3213da){var _0x5bc29f={};var _0x135f6d={};var _0x246bf4;var _0x156499;return db['SmsQueue'][_0xa1cc('0x51')]({'where':{'id':_0x4fea45[_0xa1cc('0x48')]['id']}})[_0xa1cc('0x26')](handleEntityNotFound(_0x4ba067,null))[_0xa1cc('0x26')](function(_0x212f7b){if(_0x212f7b){_0x246bf4=_0x212f7b;_0x135f6d[_0xa1cc('0x34')]=_[_0xa1cc('0x36')](db[_0xa1cc('0x54')][_0xa1cc('0x30')]);_0x135f6d['query']=_[_0xa1cc('0x36')](_0x4fea45[_0xa1cc('0x35')]);_0x135f6d['filters']=_['intersection'](_0x135f6d[_0xa1cc('0x34')],_0x135f6d[_0xa1cc('0x35')]);_0x5bc29f[_0xa1cc('0x39')]=_['intersection'](_0x135f6d[_0xa1cc('0x34')],qs[_0xa1cc('0x3a')](_0x4fea45[_0xa1cc('0x35')][_0xa1cc('0x3a')]));_0x5bc29f[_0xa1cc('0x39')]=_0x5bc29f[_0xa1cc('0x39')]['length']?_0x5bc29f[_0xa1cc('0x39')]:_0x135f6d['model'];_0x5bc29f[_0xa1cc('0x52')]=qs['sort'](_0x4fea45[_0xa1cc('0x35')][_0xa1cc('0x3e')]);_0x5bc29f[_0xa1cc('0x40')]=qs[_0xa1cc('0x37')](_[_0xa1cc('0x3f')](_0x4fea45['query'],_0x135f6d[_0xa1cc('0x37')]));if(_0x4fea45[_0xa1cc('0x35')][_0xa1cc('0x41')]){_0x5bc29f[_0xa1cc('0x40')]=_[_0xa1cc('0x42')](_0x5bc29f[_0xa1cc('0x40')],{'$or':_[_0xa1cc('0x2f')](_0x5bc29f[_0xa1cc('0x39')],function(_0x598ec5){var _0x45b263={};_0x45b263[_0x598ec5]={'$like':'%'+_0x4fea45[_0xa1cc('0x35')][_0xa1cc('0x41')]+'%'};return _0x45b263;})});}_0x5bc29f=_[_0xa1cc('0x42')]({},_0x5bc29f,_0x4fea45[_0xa1cc('0x43')]);return _0x246bf4[_0xa1cc('0x85')](_0x5bc29f);}})['then'](function(_0x3a841a){if(_0x3a841a){_0x156499=_0x3a841a[_0xa1cc('0x3b')];if(!_0x4fea45['query'][_0xa1cc('0x3c')]('nolimit')){_0x5bc29f[_0xa1cc('0x1f')]=qs['limit'](_0x4fea45[_0xa1cc('0x35')][_0xa1cc('0x1f')]);_0x5bc29f[_0xa1cc('0x1d')]=qs[_0xa1cc('0x1d')](_0x4fea45['query'][_0xa1cc('0x1d')]);}return _0x246bf4[_0xa1cc('0x85')](_0x5bc29f);}})['then'](function(_0x278d0a){if(_0x278d0a){return _0x278d0a?{'count':_0x156499,'rows':_0x278d0a}:null;}})[_0xa1cc('0x26')](respondWithResult(_0x4ba067,null))['catch'](handleError(_0x4ba067,null));};
\ No newline at end of file
index 81c71b9..86757fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3b3=['save','emit','hasOwnProperty','events','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0xa94d0b,_0x1920c0){var _0x4c51d4=function(_0x5c08bd){while(--_0x5c08bd){_0xa94d0b['push'](_0xa94d0b['shift']());}};_0x4c51d4(++_0x1920c0);}(_0xd3b3,0x199));var _0x3d3b=function(_0x3bab53,_0x46230f){_0x3bab53=_0x3bab53-0x0;var _0x1a969e=_0xd3b3[_0x3bab53];return _0x1a969e;};'use strict';var EventEmitter=require(_0x3d3b('0x0'));var SmsQueue=require(_0x3d3b('0x1'))['db'][_0x3d3b('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3d3b('0x3')](0x0);var events={'afterCreate':_0x3d3b('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e618f){return function(_0x5ed3a7,_0x591b9d,_0xb669f3){SmsQueueEvents[_0x3d3b('0x5')](_0x2e618f+':'+_0x5ed3a7['id'],_0x5ed3a7);SmsQueueEvents[_0x3d3b('0x5')](_0x2e618f,_0x5ed3a7);_0xb669f3(null);};}for(var e in events){if(events[_0x3d3b('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
+var _0xb53e=['exports','events','../../mysqldb','SmsQueue','save','update','emit','hasOwnProperty','hook'];(function(_0x46ce98,_0x52d764){var _0x172f46=function(_0x10ccee){while(--_0x10ccee){_0x46ce98['push'](_0x46ce98['shift']());}};_0x172f46(++_0x52d764);}(_0xb53e,0x1f0));var _0xeb53=function(_0x33b398,_0x2bb569){_0x33b398=_0x33b398-0x0;var _0x63e07c=_0xb53e[_0x33b398];return _0x63e07c;};'use strict';var EventEmitter=require(_0xeb53('0x0'));var SmsQueue=require(_0xeb53('0x1'))['db'][_0xeb53('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb53('0x3'),'afterUpdate':_0xeb53('0x4'),'afterDestroy':'remove'};function emitEvent(_0xf25546){return function(_0x9f7dfd,_0x8f6a90,_0x107291){SmsQueueEvents[_0xeb53('0x5')](_0xf25546+':'+_0x9f7dfd['id'],_0x9f7dfd);SmsQueueEvents[_0xeb53('0x5')](_0xf25546,_0x9f7dfd);_0x107291(null);};}for(var e in events){if(events[_0xeb53('0x6')](e)){var event=events[e];SmsQueue[_0xeb53('0x7')](e,emitEvent(event));}}module[_0xeb53('0x8')]=SmsQueueEvents;
\ No newline at end of file
index ec71877..11223c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ac=['exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x1d2951,_0x52e37d){var _0x54a612=function(_0x5269b0){while(--_0x5269b0){_0x1d2951['push'](_0x1d2951['shift']());}};_0x54a612(++_0x52e37d);}(_0x53ac,0xe1));var _0xc53a=function(_0x12e10d,_0x455915){_0x12e10d=_0x12e10d-0x0;var _0x567e01=_0x53ac[_0x12e10d];return _0x567e01;};'use strict';var _=require(_0xc53a('0x0'));var util=require(_0xc53a('0x1'));var logger=require(_0xc53a('0x2'))(_0xc53a('0x3'));var moment=require(_0xc53a('0x4'));var BPromise=require(_0xc53a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53a('0x6'));var rimraf=require(_0xc53a('0x7'));var config=require(_0xc53a('0x8'));var attributes=require('./smsQueue.attributes');module[_0xc53a('0x9')]=function(_0x46ae0f,_0x3397a5){return _0x46ae0f[_0xc53a('0xa')](_0xc53a('0xb'),attributes,{'tableName':_0xc53a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22dc=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','define','SmsQueue','sms_queues','util'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x22dc,0x180));var _0xc22d=function(_0x4f7060,_0x6fc55b){_0x4f7060=_0x4f7060-0x0;var _0x4e6337=_0x22dc[_0x4f7060];return _0x4e6337;};'use strict';var _=require('lodash');var util=require(_0xc22d('0x0'));var logger=require(_0xc22d('0x1'))(_0xc22d('0x2'));var moment=require(_0xc22d('0x3'));var BPromise=require('bluebird');var rp=require(_0xc22d('0x4'));var fs=require('fs');var path=require(_0xc22d('0x5'));var rimraf=require(_0xc22d('0x6'));var config=require(_0xc22d('0x7'));var attributes=require('./smsQueue.attributes');module['exports']=function(_0x49bf1d,_0x41711f){return _0x49bf1d[_0xc22d('0x8')](_0xc22d('0x9'),attributes,{'tableName':_0xc22d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3e50508..60fd825 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8b2=['map','model','attributes','ShowSmsQueue','find','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','info','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','SmsQueue,\x20%s,\x20%s','message','request\x20sent','result','catch','GetSmsQueue','SmsQueue','options','raw','where','limit','include'];(function(_0x5b0ba,_0x47c0ea){var _0x3e4875=function(_0x4ea3e5){while(--_0x4ea3e5){_0x5b0ba['push'](_0x5b0ba['shift']());}};_0x3e4875(++_0x47c0ea);}(_0xc8b2,0x13d));var _0x2c8b=function(_0x453905,_0x5177de){_0x453905=_0x453905-0x0;var _0x5f0c06=_0xc8b2[_0x453905];return _0x5f0c06;};'use strict';var _=require(_0x2c8b('0x0'));var util=require(_0x2c8b('0x1'));var moment=require(_0x2c8b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c8b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2c8b('0x4'))(_0x2c8b('0x5'));var config=require(_0x2c8b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2c8b('0x7')][_0x2c8b('0x8')]({'port':0x232a});config[_0x2c8b('0x9')]=_[_0x2c8b('0xa')](config['redis'],{'host':_0x2c8b('0xb'),'port':0x18eb});var socket=require(_0x2c8b('0xc'))(new Redis(config[_0x2c8b('0x9')]));require(_0x2c8b('0xd'))[_0x2c8b('0xe')](socket);function respondWithRpcPromise(_0x2e0188,_0x3cc189,_0x2ba35a){return new BPromise(function(_0x1647e7,_0x709a6d){return client[_0x2c8b('0xf')](_0x2e0188,_0x2ba35a)[_0x2c8b('0x10')](function(_0x20940f){logger[_0x2c8b('0x11')]('SmsQueue,\x20%s,\x20%s',_0x3cc189,'request\x20sent');logger[_0x2c8b('0x12')](_0x2c8b('0x13'),_0x3cc189,'request\x20sent',JSON[_0x2c8b('0x14')](_0x20940f));if(_0x20940f[_0x2c8b('0x15')]){if(_0x20940f['error']['code']===0x1f4){logger[_0x2c8b('0x15')](_0x2c8b('0x16'),_0x3cc189,_0x20940f[_0x2c8b('0x15')]['message']);return _0x709a6d(_0x20940f[_0x2c8b('0x15')][_0x2c8b('0x17')]);}logger[_0x2c8b('0x15')](_0x2c8b('0x16'),_0x3cc189,_0x20940f[_0x2c8b('0x15')][_0x2c8b('0x17')]);return _0x1647e7(_0x20940f['error'][_0x2c8b('0x17')]);}else{logger[_0x2c8b('0x11')]('SmsQueue,\x20%s,\x20%s',_0x3cc189,_0x2c8b('0x18'));_0x1647e7(_0x20940f[_0x2c8b('0x19')][_0x2c8b('0x17')]);}})[_0x2c8b('0x1a')](function(_0x5b8153){logger[_0x2c8b('0x15')]('SmsQueue,\x20%s,\x20%s',_0x3cc189,_0x5b8153);_0x709a6d(_0x5b8153);});});}exports[_0x2c8b('0x1b')]=function(_0xbb9d11){var _0xf61d67=this;return new Promise(function(_0x45a9bb,_0x555187){return db[_0x2c8b('0x1c')]['findAll']({'raw':_0xbb9d11[_0x2c8b('0x1d')]?_0xbb9d11[_0x2c8b('0x1d')][_0x2c8b('0x1e')]===undefined?!![]:![]:!![],'where':_0xbb9d11[_0x2c8b('0x1d')]?_0xbb9d11[_0x2c8b('0x1d')][_0x2c8b('0x1f')]||null:null,'attributes':_0xbb9d11[_0x2c8b('0x1d')]?_0xbb9d11['options']['attributes']||null:null,'limit':_0xbb9d11[_0x2c8b('0x1d')]?_0xbb9d11[_0x2c8b('0x1d')][_0x2c8b('0x20')]||null:null,'include':_0xbb9d11[_0x2c8b('0x1d')]?_0xbb9d11[_0x2c8b('0x1d')][_0x2c8b('0x21')]?_[_0x2c8b('0x22')](_0xbb9d11[_0x2c8b('0x1d')][_0x2c8b('0x21')],function(_0x29b45b){return{'model':db[_0x29b45b[_0x2c8b('0x23')]],'as':_0x29b45b['as'],'attributes':_0x29b45b[_0x2c8b('0x24')],'include':_0x29b45b[_0x2c8b('0x21')]?_[_0x2c8b('0x22')](_0x29b45b[_0x2c8b('0x21')],function(_0x2c2b7c){return{'model':db[_0x2c2b7c['model']],'as':_0x2c2b7c['as'],'attributes':_0x2c2b7c[_0x2c8b('0x24')],'include':_0x2c2b7c['include']?_['map'](_0x2c2b7c[_0x2c8b('0x21')],function(_0x5a2210){return{'model':db[_0x5a2210['model']],'as':_0x5a2210['as'],'attributes':_0x5a2210[_0x2c8b('0x24')]};}):[]};}):[]};}):[]:[]})[_0x2c8b('0x10')](function(_0x1e4e0c){logger['info']('GetSmsQueue',_0xbb9d11);logger[_0x2c8b('0x12')](_0x2c8b('0x1b'),_0xbb9d11,JSON['stringify'](_0x1e4e0c));_0x45a9bb(_0x1e4e0c);})['catch'](function(_0x3aae5b){logger[_0x2c8b('0x15')](_0x2c8b('0x1b'),_0x3aae5b[_0x2c8b('0x17')],_0xbb9d11);_0x555187(_0xf61d67[_0x2c8b('0x15')](0x1f4,_0x3aae5b[_0x2c8b('0x17')]));});});};exports[_0x2c8b('0x25')]=function(_0x5e771a){var _0x329442=this;return new Promise(function(_0x578034,_0x237116){return db[_0x2c8b('0x1c')][_0x2c8b('0x26')]({'raw':_0x5e771a['options']?_0x5e771a['options'][_0x2c8b('0x1e')]===undefined?!![]:![]:!![],'where':_0x5e771a['options']?_0x5e771a[_0x2c8b('0x1d')][_0x2c8b('0x1f')]||null:null,'attributes':_0x5e771a[_0x2c8b('0x1d')]?_0x5e771a['options'][_0x2c8b('0x24')]||null:null,'include':_0x5e771a[_0x2c8b('0x1d')]?_0x5e771a[_0x2c8b('0x1d')][_0x2c8b('0x21')]?_[_0x2c8b('0x22')](_0x5e771a['options'][_0x2c8b('0x21')],function(_0x22ff61){return{'model':db[_0x22ff61[_0x2c8b('0x23')]],'as':_0x22ff61['as'],'attributes':_0x22ff61[_0x2c8b('0x24')],'include':_0x22ff61[_0x2c8b('0x21')]?_[_0x2c8b('0x22')](_0x22ff61[_0x2c8b('0x21')],function(_0x2e9c86){return{'model':db[_0x2e9c86[_0x2c8b('0x23')]],'as':_0x2e9c86['as'],'attributes':_0x2e9c86[_0x2c8b('0x24')],'include':_0x2e9c86['include']?_['map'](_0x2e9c86[_0x2c8b('0x21')],function(_0x3e908e){return{'model':db[_0x3e908e[_0x2c8b('0x23')]],'as':_0x3e908e['as'],'attributes':_0x3e908e[_0x2c8b('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16df23){logger['info']('ShowSmsQueue',_0x5e771a);logger[_0x2c8b('0x12')](_0x2c8b('0x25'),_0x5e771a,JSON['stringify'](_0x16df23));_0x578034(_0x16df23);})[_0x2c8b('0x1a')](function(_0xe4cbdf){logger[_0x2c8b('0x15')](_0x2c8b('0x25'),_0xe4cbdf[_0x2c8b('0x17')],_0x5e771a);_0x237116(_0x329442[_0x2c8b('0x15')](0x1f4,_0xe4cbdf[_0x2c8b('0x17')]));});});};
\ No newline at end of file
+var _0x6894=['debug','GetSmsQueue','SmsQueue','raw','ShowSmsQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./smsQueue.socket','register','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','where','limit','model','attributes','include','map','then'];(function(_0x3f8e92,_0x5a20b2){var _0x5b211b=function(_0x580299){while(--_0x580299){_0x3f8e92['push'](_0x3f8e92['shift']());}};_0x5b211b(++_0x5a20b2);}(_0x6894,0x13d));var _0x4689=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x6894[_0x38ced4];return _0x547c07;};'use strict';var _=require(_0x4689('0x0'));var util=require(_0x4689('0x1'));var moment=require(_0x4689('0x2'));var BPromise=require(_0x4689('0x3'));var rs=require(_0x4689('0x4'));var fs=require('fs');var Redis=require(_0x4689('0x5'));var db=require(_0x4689('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4689('0x7'))(_0x4689('0x8'));var config=require(_0x4689('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4689('0xa')]({'port':0x232a});config[_0x4689('0xb')]=_['defaults'](config[_0x4689('0xb')],{'host':_0x4689('0xc'),'port':0x18eb});var socket=require(_0x4689('0xd'))(new Redis(config[_0x4689('0xb')]));require(_0x4689('0xe'))[_0x4689('0xf')](socket);function respondWithRpcPromise(_0x2f0437,_0x2ee96e,_0x324b3d){return new BPromise(function(_0x56d261,_0x5b0065){return client['request'](_0x2f0437,_0x324b3d)['then'](function(_0x1b5d51){logger[_0x4689('0x10')](_0x4689('0x11'),_0x2ee96e,_0x4689('0x12'));logger['debug'](_0x4689('0x13'),_0x2ee96e,_0x4689('0x12'),JSON[_0x4689('0x14')](_0x1b5d51));if(_0x1b5d51[_0x4689('0x15')]){if(_0x1b5d51[_0x4689('0x15')]['code']===0x1f4){logger[_0x4689('0x15')](_0x4689('0x11'),_0x2ee96e,_0x1b5d51['error'][_0x4689('0x16')]);return _0x5b0065(_0x1b5d51[_0x4689('0x15')][_0x4689('0x16')]);}logger[_0x4689('0x15')](_0x4689('0x11'),_0x2ee96e,_0x1b5d51[_0x4689('0x15')][_0x4689('0x16')]);return _0x56d261(_0x1b5d51[_0x4689('0x15')][_0x4689('0x16')]);}else{logger[_0x4689('0x10')](_0x4689('0x11'),_0x2ee96e,_0x4689('0x12'));_0x56d261(_0x1b5d51[_0x4689('0x17')][_0x4689('0x16')]);}})[_0x4689('0x18')](function(_0x1c4128){logger[_0x4689('0x15')](_0x4689('0x11'),_0x2ee96e,_0x1c4128);_0x5b0065(_0x1c4128);});});}exports['GetSmsQueue']=function(_0xec28ad){var _0x5a3713=this;return new Promise(function(_0x229dc6,_0x3f2415){return db['SmsQueue'][_0x4689('0x19')]({'raw':_0xec28ad[_0x4689('0x1a')]?_0xec28ad[_0x4689('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0xec28ad[_0x4689('0x1a')]?_0xec28ad[_0x4689('0x1a')][_0x4689('0x1b')]||null:null,'attributes':_0xec28ad[_0x4689('0x1a')]?_0xec28ad['options']['attributes']||null:null,'limit':_0xec28ad['options']?_0xec28ad[_0x4689('0x1a')][_0x4689('0x1c')]||null:null,'include':_0xec28ad[_0x4689('0x1a')]?_0xec28ad[_0x4689('0x1a')]['include']?_['map'](_0xec28ad[_0x4689('0x1a')]['include'],function(_0x466c9b){return{'model':db[_0x466c9b[_0x4689('0x1d')]],'as':_0x466c9b['as'],'attributes':_0x466c9b[_0x4689('0x1e')],'include':_0x466c9b[_0x4689('0x1f')]?_[_0x4689('0x20')](_0x466c9b[_0x4689('0x1f')],function(_0x5a7369){return{'model':db[_0x5a7369[_0x4689('0x1d')]],'as':_0x5a7369['as'],'attributes':_0x5a7369['attributes'],'include':_0x5a7369[_0x4689('0x1f')]?_[_0x4689('0x20')](_0x5a7369[_0x4689('0x1f')],function(_0xbfcdc1){return{'model':db[_0xbfcdc1['model']],'as':_0xbfcdc1['as'],'attributes':_0xbfcdc1[_0x4689('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4689('0x21')](function(_0x8f09ef){logger['info']('GetSmsQueue',_0xec28ad);logger[_0x4689('0x22')]('GetSmsQueue',_0xec28ad,JSON['stringify'](_0x8f09ef));_0x229dc6(_0x8f09ef);})[_0x4689('0x18')](function(_0xac203){logger[_0x4689('0x15')](_0x4689('0x23'),_0xac203['message'],_0xec28ad);_0x3f2415(_0x5a3713[_0x4689('0x15')](0x1f4,_0xac203[_0x4689('0x16')]));});});};exports['ShowSmsQueue']=function(_0x14265b){var _0x4f749a=this;return new Promise(function(_0x5e33d7,_0x43ce37){return db[_0x4689('0x24')]['find']({'raw':_0x14265b[_0x4689('0x1a')]?_0x14265b[_0x4689('0x1a')][_0x4689('0x25')]===undefined?!![]:![]:!![],'where':_0x14265b['options']?_0x14265b[_0x4689('0x1a')][_0x4689('0x1b')]||null:null,'attributes':_0x14265b['options']?_0x14265b['options']['attributes']||null:null,'include':_0x14265b[_0x4689('0x1a')]?_0x14265b['options'][_0x4689('0x1f')]?_['map'](_0x14265b[_0x4689('0x1a')]['include'],function(_0x37562a){return{'model':db[_0x37562a[_0x4689('0x1d')]],'as':_0x37562a['as'],'attributes':_0x37562a[_0x4689('0x1e')],'include':_0x37562a[_0x4689('0x1f')]?_[_0x4689('0x20')](_0x37562a[_0x4689('0x1f')],function(_0x1123ed){return{'model':db[_0x1123ed[_0x4689('0x1d')]],'as':_0x1123ed['as'],'attributes':_0x1123ed[_0x4689('0x1e')],'include':_0x1123ed[_0x4689('0x1f')]?_[_0x4689('0x20')](_0x1123ed[_0x4689('0x1f')],function(_0x3f6414){return{'model':db[_0x3f6414[_0x4689('0x1d')]],'as':_0x3f6414['as'],'attributes':_0x3f6414[_0x4689('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4689('0x21')](function(_0x133395){logger['info'](_0x4689('0x26'),_0x14265b);logger['debug'](_0x4689('0x26'),_0x14265b,JSON[_0x4689('0x14')](_0x133395));_0x5e33d7(_0x133395);})[_0x4689('0x18')](function(_0x5d9885){logger[_0x4689('0x15')]('ShowSmsQueue',_0x5d9885[_0x4689('0x16')],_0x14265b);_0x43ce37(_0x4f749a[_0x4689('0x15')](0x1f4,_0x5d9885[_0x4689('0x16')]));});});};
\ No newline at end of file
index e8f83c2..896fa15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77d0=['register','length','smsQueue:','./smsQueue.events','remove'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x77d0,0x1d4));var _0x077d=function(_0x56deb5,_0x2faf05){_0x56deb5=_0x56deb5-0x0;var _0x57f929=_0x77d0[_0x56deb5];return _0x57f929;};'use strict';var SmsQueueEvents=require(_0x077d('0x0'));var events=['save',_0x077d('0x1'),'update'];function createListener(_0x46f6a8,_0x19ddf0){return function(_0x4eb4e9){_0x19ddf0['emit'](_0x46f6a8,_0x4eb4e9);};}function removeListener(_0x32b525,_0x51f6e9){return function(){SmsQueueEvents['removeListener'](_0x32b525,_0x51f6e9);};}exports[_0x077d('0x2')]=function(_0xbe79c7){for(var _0x422cc8=0x0,_0x4caed8=events[_0x077d('0x3')];_0x422cc8<_0x4caed8;_0x422cc8++){var _0x2be2d5=events[_0x422cc8];var _0x19a839=createListener(_0x077d('0x4')+_0x2be2d5,_0xbe79c7);SmsQueueEvents['on'](_0x2be2d5,_0x19a839);}};
\ No newline at end of file
+var _0x6e58=['./smsQueue.events','remove','emit','register','smsQueue:'];(function(_0x213518,_0x51e022){var _0x1baf75=function(_0x5c8444){while(--_0x5c8444){_0x213518['push'](_0x213518['shift']());}};_0x1baf75(++_0x51e022);}(_0x6e58,0x118));var _0x86e5=function(_0x30ec48,_0xda08c2){_0x30ec48=_0x30ec48-0x0;var _0x5ad2e0=_0x6e58[_0x30ec48];return _0x5ad2e0;};'use strict';var SmsQueueEvents=require(_0x86e5('0x0'));var events=['save',_0x86e5('0x1'),'update'];function createListener(_0x501c1d,_0x27f7a5){return function(_0x55e7ec){_0x27f7a5[_0x86e5('0x2')](_0x501c1d,_0x55e7ec);};}function removeListener(_0x21c7ca,_0x28a398){return function(){SmsQueueEvents['removeListener'](_0x21c7ca,_0x28a398);};}exports[_0x86e5('0x3')]=function(_0xcab069){for(var _0x1d73f2=0x0,_0x356423=events['length'];_0x1d73f2<_0x356423;_0x1d73f2++){var _0x5ee06b=events[_0x1d73f2];var _0xa5a26b=createListener(_0x86e5('0x4')+_0x5ee06b,_0xcab069);SmsQueueEvents['on'](_0x5ee06b,_0xa5a26b);}};
\ No newline at end of file
index 9a0fce5..e9e47e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb94=['/describe','/:id','show','post','create','put','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','isAuthenticated','index','get'];(function(_0x40c13b,_0x50bc13){var _0x5dcf86=function(_0x67c689){while(--_0x67c689){_0x40c13b['push'](_0x40c13b['shift']());}};_0x5dcf86(++_0x50bc13);}(_0xdb94,0xe5));var _0x4db9=function(_0x34a71f,_0xbf2b4a){_0x34a71f=_0x34a71f-0x0;var _0x945986=_0xdb94[_0x34a71f];return _0x945986;};'use strict';var multer=require('multer');var util=require(_0x4db9('0x0'));var path=require(_0x4db9('0x1'));var timeout=require('connect-timeout');var express=require(_0x4db9('0x2'));var router=express[_0x4db9('0x3')]();var fs_extra=require(_0x4db9('0x4'));var auth=require(_0x4db9('0x5'));var interaction=require(_0x4db9('0x6'));var config=require('../../config/environment');var controller=require(_0x4db9('0x7'));router['get']('/',auth[_0x4db9('0x8')](),controller[_0x4db9('0x9')]);router[_0x4db9('0xa')](_0x4db9('0xb'),auth[_0x4db9('0x8')](),controller['describe']);router[_0x4db9('0xa')](_0x4db9('0xc'),auth[_0x4db9('0x8')](),controller[_0x4db9('0xd')]);router[_0x4db9('0xe')]('/',auth['isAuthenticated'](),controller[_0x4db9('0xf')]);router[_0x4db9('0x10')](_0x4db9('0xc'),auth[_0x4db9('0x8')](),controller[_0x4db9('0x11')]);router[_0x4db9('0x12')]('/:id',auth[_0x4db9('0x8')](),controller[_0x4db9('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x5395=['index','/describe','/:id','show','update','exports','multer','path','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated'];(function(_0x52b536,_0x5e1303){var _0x1e5c30=function(_0x3913f2){while(--_0x3913f2){_0x52b536['push'](_0x52b536['shift']());}};_0x1e5c30(++_0x5e1303);}(_0x5395,0x150));var _0x5539=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5395[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x5539('0x0'));var util=require('util');var path=require(_0x5539('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5539('0x2')]();var fs_extra=require(_0x5539('0x3'));var auth=require(_0x5539('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5539('0x5'));var controller=require(_0x5539('0x6'));router[_0x5539('0x7')]('/',auth[_0x5539('0x8')](),controller[_0x5539('0x9')]);router[_0x5539('0x7')](_0x5539('0xa'),auth[_0x5539('0x8')](),controller['describe']);router[_0x5539('0x7')](_0x5539('0xb'),auth[_0x5539('0x8')](),controller[_0x5539('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x5539('0xb'),auth['isAuthenticated'](),controller[_0x5539('0xd')]);router['delete'](_0x5539('0xb'),auth[_0x5539('0x8')](),controller['destroy']);module[_0x5539('0xe')]=router;
\ No newline at end of file
index 11a625c..e963c8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe351=['STRING','DATE','moment','sequelize','exports'];(function(_0x3b9267,_0x2ab8cf){var _0x396cbe=function(_0x5a30f8){while(--_0x5a30f8){_0x3b9267['push'](_0x3b9267['shift']());}};_0x396cbe(++_0x2ab8cf);}(_0xe351,0x10b));var _0x1e35=function(_0x232c2f,_0x4972f7){_0x232c2f=_0x232c2f-0x0;var _0xa713f0=_0xe351[_0x232c2f];return _0xa713f0;};'use strict';var moment=require(_0x1e35('0x0'));var Sequelize=require(_0x1e35('0x1'));module[_0x1e35('0x2')]={'uniqueid':{'type':Sequelize[_0x1e35('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1e35('0x3')]},'joinAt':{'type':Sequelize[_0x1e35('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1e35('0x4')]},'exitAt':{'type':Sequelize[_0x1e35('0x4')]},'reason':{'type':Sequelize[_0x1e35('0x3')]}};
\ No newline at end of file
+var _0xf7d5=['DATE','sequelize','exports','STRING'];(function(_0x2d7214,_0x48ed98){var _0x1152dc=function(_0x8c93d1){while(--_0x8c93d1){_0x2d7214['push'](_0x2d7214['shift']());}};_0x1152dc(++_0x48ed98);}(_0xf7d5,0x189));var _0x5f7d=function(_0x3ead55,_0x22bc51){_0x3ead55=_0x3ead55-0x0;var _0x3ea16d=_0xf7d5[_0x3ead55];return _0x3ea16d;};'use strict';var moment=require('moment');var Sequelize=require(_0x5f7d('0x0'));module[_0x5f7d('0x1')]={'uniqueid':{'type':Sequelize[_0x5f7d('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5f7d('0x2')]},'joinAt':{'type':Sequelize[_0x5f7d('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5f7d('0x3')]},'exitAt':{'type':Sequelize[_0x5f7d('0x3')]},'reason':{'type':Sequelize[_0x5f7d('0x2')]}};
\ No newline at end of file
index 2cfecbb..0ce9cb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc891=['options','rows','show','params','include','find','catch','create','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','update','then','error','stack','name','send','SmsQueueReport','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x3434b7,_0x271541){var _0xa26b00=function(_0x3a4b0a){while(--_0x3a4b0a){_0x3434b7['push'](_0x3434b7['shift']());}};_0xa26b00(++_0x271541);}(_0xc891,0x1c0));var _0x1c89=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xc891[_0x1d9aa0];return _0x226868;};'use strict';var emlformat=require(_0x1c89('0x0'));var rimraf=require(_0x1c89('0x1'));var zipdir=require(_0x1c89('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1c89('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1c89('0x4'));var util=require(_0x1c89('0x5'));var path=require(_0x1c89('0x6'));var sox=require(_0x1c89('0x7'));var csv=require(_0x1c89('0x8'));var ejs=require(_0x1c89('0x9'));var fs=require('fs');var fs_extra=require(_0x1c89('0xa'));var _=require(_0x1c89('0xb'));var squel=require(_0x1c89('0xc'));var crypto=require(_0x1c89('0xd'));var jsforce=require(_0x1c89('0xe'));var deskjs=require(_0x1c89('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1c89('0x10'));var Papa=require(_0x1c89('0x11'));var Redis=require(_0x1c89('0x12'));var authService=require(_0x1c89('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c89('0x14'));var logger=require(_0x1c89('0x15'))(_0x1c89('0x16'));var utils=require(_0x1c89('0x17'));var config=require(_0x1c89('0x18'));var licenseUtil=require(_0x1c89('0x19'));var db=require(_0x1c89('0x1a'))['db'];function respondWithStatusCode(_0x18ed8c,_0x4580a0){_0x4580a0=_0x4580a0||0xcc;return function(_0x343268){if(_0x343268){return _0x18ed8c[_0x1c89('0x1b')](_0x4580a0);}return _0x18ed8c['status'](_0x4580a0)[_0x1c89('0x1c')]();};}function respondWithResult(_0x172fac,_0x4fd64a){_0x4fd64a=_0x4fd64a||0xc8;return function(_0x5a5bfc){if(_0x5a5bfc){return _0x172fac['status'](_0x4fd64a)[_0x1c89('0x1d')](_0x5a5bfc);}};}function respondWithFilteredResult(_0x492fd8,_0x3345d3){return function(_0x4f6dba){if(_0x4f6dba){var _0x3a947b=typeof _0x3345d3[_0x1c89('0x1e')]===_0x1c89('0x1f')&&typeof _0x3345d3[_0x1c89('0x20')]===_0x1c89('0x1f');var _0x4c6126=_0x4f6dba[_0x1c89('0x21')];var _0x30840f=_0x3a947b?0x0:_0x3345d3['offset'];var _0x57281d=_0x3a947b?_0x4f6dba[_0x1c89('0x21')]:_0x3345d3['offset']+_0x3345d3['limit'];var _0x18055e;if(_0x57281d>=_0x4c6126){_0x57281d=_0x4c6126;_0x18055e=0xc8;}else{_0x18055e=0xce;}_0x492fd8[_0x1c89('0x22')](_0x18055e);return _0x492fd8[_0x1c89('0x23')]('Content-Range',_0x30840f+'-'+_0x57281d+'/'+_0x4c6126)[_0x1c89('0x1d')](_0x4f6dba);}return null;};}function patchUpdates(_0x32ed7c){return function(_0x448414){try{jsonpatch['apply'](_0x448414,_0x32ed7c,!![]);}catch(_0x5c0814){return BPromise[_0x1c89('0x24')](_0x5c0814);}return _0x448414['save']();};}function saveUpdates(_0xb489d3,_0x4e6fbe){return function(_0x407108){if(_0x407108){return _0x407108[_0x1c89('0x25')](_0xb489d3)['then'](function(_0x471fde){return _0x471fde;});}return null;};}function removeEntity(_0x50893e,_0x486ae9){return function(_0x4fffa4){if(_0x4fffa4){return _0x4fffa4['destroy']()[_0x1c89('0x26')](function(){_0x50893e['status'](0xcc)[_0x1c89('0x1c')]();});}};}function handleEntityNotFound(_0x35d2fc,_0x198e80){return function(_0x5c4970){if(!_0x5c4970){_0x35d2fc[_0x1c89('0x1b')](0x194);}return _0x5c4970;};}function handleError(_0x4c9668,_0x25647c){_0x25647c=_0x25647c||0x1f4;return function(_0x2eadaf){logger[_0x1c89('0x27')](_0x2eadaf[_0x1c89('0x28')]);if(_0x2eadaf[_0x1c89('0x29')]){delete _0x2eadaf[_0x1c89('0x29')];}_0x4c9668['status'](_0x25647c)[_0x1c89('0x2a')](_0x2eadaf);};}exports['index']=function(_0x348136,_0x43b78e){var _0x3d48af={},_0x315588={},_0x272760={'count':0x0,'rows':[]};var _0x448f4e=_['map'](db[_0x1c89('0x2b')]['rawAttributes'],function(_0x4f6559){return{'name':_0x4f6559[_0x1c89('0x2c')],'type':_0x4f6559[_0x1c89('0x2d')]['key']};});_0x315588[_0x1c89('0x2e')]=_[_0x1c89('0x2f')](_0x448f4e,_0x1c89('0x29'));_0x315588[_0x1c89('0x30')]=_[_0x1c89('0x31')](_0x348136[_0x1c89('0x30')]);_0x315588[_0x1c89('0x32')]=_[_0x1c89('0x33')](_0x315588[_0x1c89('0x2e')],_0x315588[_0x1c89('0x30')]);_0x3d48af[_0x1c89('0x34')]=_[_0x1c89('0x33')](_0x315588[_0x1c89('0x2e')],qs[_0x1c89('0x35')](_0x348136['query'][_0x1c89('0x35')]));_0x3d48af[_0x1c89('0x34')]=_0x3d48af[_0x1c89('0x34')][_0x1c89('0x36')]?_0x3d48af['attributes']:_0x315588[_0x1c89('0x2e')];if(!_0x348136[_0x1c89('0x30')][_0x1c89('0x37')](_0x1c89('0x38'))){_0x3d48af[_0x1c89('0x20')]=qs['limit'](_0x348136[_0x1c89('0x30')][_0x1c89('0x20')]);_0x3d48af[_0x1c89('0x1e')]=qs['offset'](_0x348136[_0x1c89('0x30')][_0x1c89('0x1e')]);}_0x3d48af[_0x1c89('0x39')]=qs[_0x1c89('0x3a')](_0x348136[_0x1c89('0x30')][_0x1c89('0x3a')]);_0x3d48af[_0x1c89('0x3b')]=qs[_0x1c89('0x32')](_[_0x1c89('0x3c')](_0x348136['query'],_0x315588[_0x1c89('0x32')]),_0x448f4e);if(_0x348136[_0x1c89('0x30')][_0x1c89('0x3d')]){_0x3d48af[_0x1c89('0x3b')]=_[_0x1c89('0x3e')](_0x3d48af['where'],{'$or':_['map'](_0x448f4e,function(_0x3ec76){if(_0x3ec76[_0x1c89('0x2d')]!=='VIRTUAL'){var _0x2a0fad={};_0x2a0fad[_0x3ec76[_0x1c89('0x29')]]={'$like':'%'+_0x348136[_0x1c89('0x30')][_0x1c89('0x3d')]+'%'};return _0x2a0fad;}})});}_0x3d48af=_[_0x1c89('0x3e')]({},_0x3d48af,_0x348136[_0x1c89('0x3f')]);var _0x12c1ad={'where':_0x3d48af[_0x1c89('0x3b')]};return db[_0x1c89('0x2b')][_0x1c89('0x21')](_0x12c1ad)[_0x1c89('0x26')](function(_0x5986a1){_0x272760[_0x1c89('0x21')]=_0x5986a1;if(_0x348136[_0x1c89('0x30')]['includeAll']){_0x3d48af['include']=[{'all':!![]}];}return db[_0x1c89('0x2b')]['findAll'](_0x3d48af);})['then'](function(_0xcfb500){_0x272760[_0x1c89('0x40')]=_0xcfb500;return _0x272760;})[_0x1c89('0x26')](respondWithFilteredResult(_0x43b78e,_0x3d48af))['catch'](handleError(_0x43b78e,null));};exports[_0x1c89('0x41')]=function(_0x2920c9,_0x2f2418){var _0x1ce375={'raw':!![],'where':{'id':_0x2920c9[_0x1c89('0x42')]['id']}},_0x245a3c={};_0x245a3c['model']=_[_0x1c89('0x31')](db[_0x1c89('0x2b')]['rawAttributes']);_0x245a3c['query']=_['keys'](_0x2920c9[_0x1c89('0x30')]);_0x245a3c[_0x1c89('0x32')]=_[_0x1c89('0x33')](_0x245a3c[_0x1c89('0x2e')],_0x245a3c[_0x1c89('0x30')]);_0x1ce375['attributes']=_['intersection'](_0x245a3c['model'],qs[_0x1c89('0x35')](_0x2920c9['query'][_0x1c89('0x35')]));_0x1ce375[_0x1c89('0x34')]=_0x1ce375[_0x1c89('0x34')][_0x1c89('0x36')]?_0x1ce375[_0x1c89('0x34')]:_0x245a3c[_0x1c89('0x2e')];if(_0x2920c9[_0x1c89('0x30')]['includeAll']){_0x1ce375[_0x1c89('0x43')]=[{'all':!![]}];}_0x1ce375=_[_0x1c89('0x3e')]({},_0x1ce375,_0x2920c9[_0x1c89('0x3f')]);return db[_0x1c89('0x2b')][_0x1c89('0x44')](_0x1ce375)[_0x1c89('0x26')](handleEntityNotFound(_0x2f2418,null))[_0x1c89('0x26')](respondWithResult(_0x2f2418,null))[_0x1c89('0x45')](handleError(_0x2f2418,null));};exports[_0x1c89('0x46')]=function(_0x109011,_0x17d37b){return db[_0x1c89('0x2b')][_0x1c89('0x46')](_0x109011['body'],{})['then'](respondWithResult(_0x17d37b,0xc9))[_0x1c89('0x45')](handleError(_0x17d37b,null));};exports['update']=function(_0x4b2f3c,_0x5864c3){if(_0x4b2f3c[_0x1c89('0x47')]['id']){delete _0x4b2f3c[_0x1c89('0x47')]['id'];}return db[_0x1c89('0x2b')][_0x1c89('0x44')]({'where':{'id':_0x4b2f3c[_0x1c89('0x42')]['id']}})['then'](handleEntityNotFound(_0x5864c3,null))[_0x1c89('0x26')](saveUpdates(_0x4b2f3c[_0x1c89('0x47')],null))[_0x1c89('0x26')](respondWithResult(_0x5864c3,null))[_0x1c89('0x45')](handleError(_0x5864c3,null));};exports['destroy']=function(_0x5ed9bb,_0x44fa5c){return db['SmsQueueReport'][_0x1c89('0x44')]({'where':{'id':_0x5ed9bb[_0x1c89('0x42')]['id']}})[_0x1c89('0x26')](handleEntityNotFound(_0x44fa5c,null))['then'](removeEntity(_0x44fa5c,null))['catch'](handleError(_0x44fa5c,null));};exports[_0x1c89('0x48')]=function(_0xdc05da,_0x2c9f60){return db[_0x1c89('0x2b')][_0x1c89('0x48')]()[_0x1c89('0x26')](respondWithResult(_0x2c9f60,null))[_0x1c89('0x45')](handleError(_0x2c9f60,null));};
\ No newline at end of file
+var _0x733c=['query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','keys','include','find','catch','create','body','params','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','count','offset','Content-Range','apply','save','update','destroy','then','end','error','stack','name','index','SmsQueueReport','type','model','map'];(function(_0x41229c,_0x32fc89){var _0x1ce6c7=function(_0x9f4b40){while(--_0x9f4b40){_0x41229c['push'](_0x41229c['shift']());}};_0x1ce6c7(++_0x32fc89);}(_0x733c,0x13a));var _0xc733=function(_0x43dcaf,_0x4e0169){_0x43dcaf=_0x43dcaf-0x0;var _0x20dd04=_0x733c[_0x43dcaf];return _0x20dd04;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc733('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc733('0x1'));var rp=require(_0xc733('0x2'));var moment=require(_0xc733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc733('0x4'));var util=require(_0xc733('0x5'));var path=require(_0xc733('0x6'));var sox=require(_0xc733('0x7'));var csv=require(_0xc733('0x8'));var ejs=require(_0xc733('0x9'));var fs=require('fs');var fs_extra=require(_0xc733('0xa'));var _=require(_0xc733('0xb'));var squel=require(_0xc733('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc733('0x8'));var querystring=require(_0xc733('0xd'));var Papa=require(_0xc733('0xe'));var Redis=require(_0xc733('0xf'));var authService=require(_0xc733('0x10'));var qs=require(_0xc733('0x11'));var as=require(_0xc733('0x12'));var hardwareService=require(_0xc733('0x13'));var logger=require(_0xc733('0x14'))('api');var utils=require(_0xc733('0x15'));var config=require(_0xc733('0x16'));var licenseUtil=require(_0xc733('0x17'));var db=require(_0xc733('0x18'))['db'];function respondWithStatusCode(_0x2d3ad6,_0x5f59b6){_0x5f59b6=_0x5f59b6||0xcc;return function(_0x5bd4fa){if(_0x5bd4fa){return _0x2d3ad6[_0xc733('0x19')](_0x5f59b6);}return _0x2d3ad6[_0xc733('0x1a')](_0x5f59b6)['end']();};}function respondWithResult(_0x4d238d,_0x1beabd){_0x1beabd=_0x1beabd||0xc8;return function(_0x1ca6d6){if(_0x1ca6d6){return _0x4d238d[_0xc733('0x1a')](_0x1beabd)[_0xc733('0x1b')](_0x1ca6d6);}};}function respondWithFilteredResult(_0x1b03e6,_0x217815){return function(_0x14503e){if(_0x14503e){var _0xc1748d=typeof _0x217815['offset']==='undefined'&&typeof _0x217815[_0xc733('0x1c')]==='undefined';var _0x1675cb=_0x14503e[_0xc733('0x1d')];var _0x873c18=_0xc1748d?0x0:_0x217815[_0xc733('0x1e')];var _0x33b2c2=_0xc1748d?_0x14503e[_0xc733('0x1d')]:_0x217815[_0xc733('0x1e')]+_0x217815['limit'];var _0x178e48;if(_0x33b2c2>=_0x1675cb){_0x33b2c2=_0x1675cb;_0x178e48=0xc8;}else{_0x178e48=0xce;}_0x1b03e6[_0xc733('0x1a')](_0x178e48);return _0x1b03e6['set'](_0xc733('0x1f'),_0x873c18+'-'+_0x33b2c2+'/'+_0x1675cb)[_0xc733('0x1b')](_0x14503e);}return null;};}function patchUpdates(_0x237836){return function(_0x23c698){try{jsonpatch[_0xc733('0x20')](_0x23c698,_0x237836,!![]);}catch(_0x1f4a6c){return BPromise['reject'](_0x1f4a6c);}return _0x23c698[_0xc733('0x21')]();};}function saveUpdates(_0x16b15d,_0x18f88b){return function(_0x4958ef){if(_0x4958ef){return _0x4958ef[_0xc733('0x22')](_0x16b15d)['then'](function(_0x3ae555){return _0x3ae555;});}return null;};}function removeEntity(_0x4b3cda,_0x428493){return function(_0xefea1c){if(_0xefea1c){return _0xefea1c[_0xc733('0x23')]()[_0xc733('0x24')](function(){_0x4b3cda[_0xc733('0x1a')](0xcc)[_0xc733('0x25')]();});}};}function handleEntityNotFound(_0x4e92a1,_0x27d8cf){return function(_0x2e94cd){if(!_0x2e94cd){_0x4e92a1[_0xc733('0x19')](0x194);}return _0x2e94cd;};}function handleError(_0x1edd79,_0x196153){_0x196153=_0x196153||0x1f4;return function(_0x332662){logger[_0xc733('0x26')](_0x332662[_0xc733('0x27')]);if(_0x332662[_0xc733('0x28')]){delete _0x332662[_0xc733('0x28')];}_0x1edd79[_0xc733('0x1a')](_0x196153)['send'](_0x332662);};}exports[_0xc733('0x29')]=function(_0x1537cb,_0x14894c){var _0x2c9718={},_0x5a3146={},_0x5f4e3e={'count':0x0,'rows':[]};var _0x48c523=_['map'](db[_0xc733('0x2a')]['rawAttributes'],function(_0x58cf98){return{'name':_0x58cf98['fieldName'],'type':_0x58cf98[_0xc733('0x2b')]['key']};});_0x5a3146[_0xc733('0x2c')]=_[_0xc733('0x2d')](_0x48c523,_0xc733('0x28'));_0x5a3146['query']=_['keys'](_0x1537cb[_0xc733('0x2e')]);_0x5a3146[_0xc733('0x2f')]=_['intersection'](_0x5a3146[_0xc733('0x2c')],_0x5a3146[_0xc733('0x2e')]);_0x2c9718[_0xc733('0x30')]=_[_0xc733('0x31')](_0x5a3146[_0xc733('0x2c')],qs[_0xc733('0x32')](_0x1537cb[_0xc733('0x2e')][_0xc733('0x32')]));_0x2c9718[_0xc733('0x30')]=_0x2c9718[_0xc733('0x30')][_0xc733('0x33')]?_0x2c9718[_0xc733('0x30')]:_0x5a3146[_0xc733('0x2c')];if(!_0x1537cb[_0xc733('0x2e')][_0xc733('0x34')](_0xc733('0x35'))){_0x2c9718[_0xc733('0x1c')]=qs[_0xc733('0x1c')](_0x1537cb[_0xc733('0x2e')][_0xc733('0x1c')]);_0x2c9718[_0xc733('0x1e')]=qs['offset'](_0x1537cb[_0xc733('0x2e')][_0xc733('0x1e')]);}_0x2c9718['order']=qs['sort'](_0x1537cb[_0xc733('0x2e')][_0xc733('0x36')]);_0x2c9718[_0xc733('0x37')]=qs[_0xc733('0x2f')](_['pick'](_0x1537cb['query'],_0x5a3146[_0xc733('0x2f')]),_0x48c523);if(_0x1537cb[_0xc733('0x2e')][_0xc733('0x38')]){_0x2c9718[_0xc733('0x37')]=_[_0xc733('0x39')](_0x2c9718[_0xc733('0x37')],{'$or':_[_0xc733('0x2d')](_0x48c523,function(_0x38e0e0){if(_0x38e0e0[_0xc733('0x2b')]!==_0xc733('0x3a')){var _0xf52649={};_0xf52649[_0x38e0e0[_0xc733('0x28')]]={'$like':'%'+_0x1537cb[_0xc733('0x2e')][_0xc733('0x38')]+'%'};return _0xf52649;}})});}_0x2c9718=_[_0xc733('0x39')]({},_0x2c9718,_0x1537cb[_0xc733('0x3b')]);var _0x3c8ea8={'where':_0x2c9718['where']};return db[_0xc733('0x2a')][_0xc733('0x1d')](_0x3c8ea8)['then'](function(_0x732a7c){_0x5f4e3e[_0xc733('0x1d')]=_0x732a7c;if(_0x1537cb[_0xc733('0x2e')][_0xc733('0x3c')]){_0x2c9718['include']=[{'all':!![]}];}return db[_0xc733('0x2a')][_0xc733('0x3d')](_0x2c9718);})[_0xc733('0x24')](function(_0xbb06e7){_0x5f4e3e[_0xc733('0x3e')]=_0xbb06e7;return _0x5f4e3e;})[_0xc733('0x24')](respondWithFilteredResult(_0x14894c,_0x2c9718))['catch'](handleError(_0x14894c,null));};exports[_0xc733('0x3f')]=function(_0x206b44,_0xc10e2e){var _0x27c613={'raw':!![],'where':{'id':_0x206b44['params']['id']}},_0x369958={};_0x369958[_0xc733('0x2c')]=_[_0xc733('0x40')](db[_0xc733('0x2a')]['rawAttributes']);_0x369958[_0xc733('0x2e')]=_[_0xc733('0x40')](_0x206b44['query']);_0x369958[_0xc733('0x2f')]=_[_0xc733('0x31')](_0x369958[_0xc733('0x2c')],_0x369958[_0xc733('0x2e')]);_0x27c613[_0xc733('0x30')]=_['intersection'](_0x369958[_0xc733('0x2c')],qs[_0xc733('0x32')](_0x206b44[_0xc733('0x2e')][_0xc733('0x32')]));_0x27c613['attributes']=_0x27c613[_0xc733('0x30')][_0xc733('0x33')]?_0x27c613[_0xc733('0x30')]:_0x369958[_0xc733('0x2c')];if(_0x206b44['query'][_0xc733('0x3c')]){_0x27c613[_0xc733('0x41')]=[{'all':!![]}];}_0x27c613=_[_0xc733('0x39')]({},_0x27c613,_0x206b44[_0xc733('0x3b')]);return db['SmsQueueReport'][_0xc733('0x42')](_0x27c613)[_0xc733('0x24')](handleEntityNotFound(_0xc10e2e,null))[_0xc733('0x24')](respondWithResult(_0xc10e2e,null))[_0xc733('0x43')](handleError(_0xc10e2e,null));};exports[_0xc733('0x44')]=function(_0x39a4e9,_0x1998cb){return db['SmsQueueReport'][_0xc733('0x44')](_0x39a4e9[_0xc733('0x45')],{})[_0xc733('0x24')](respondWithResult(_0x1998cb,0xc9))['catch'](handleError(_0x1998cb,null));};exports['update']=function(_0x4826b5,_0x7a7b30){if(_0x4826b5[_0xc733('0x45')]['id']){delete _0x4826b5[_0xc733('0x45')]['id'];}return db[_0xc733('0x2a')][_0xc733('0x42')]({'where':{'id':_0x4826b5[_0xc733('0x46')]['id']}})[_0xc733('0x24')](handleEntityNotFound(_0x7a7b30,null))[_0xc733('0x24')](saveUpdates(_0x4826b5[_0xc733('0x45')],null))['then'](respondWithResult(_0x7a7b30,null))['catch'](handleError(_0x7a7b30,null));};exports[_0xc733('0x23')]=function(_0x4b45ef,_0x538750){return db['SmsQueueReport'][_0xc733('0x42')]({'where':{'id':_0x4b45ef[_0xc733('0x46')]['id']}})['then'](handleEntityNotFound(_0x538750,null))[_0xc733('0x24')](removeEntity(_0x538750,null))[_0xc733('0x43')](handleError(_0x538750,null));};exports[_0xc733('0x47')]=function(_0x5b734e,_0x5a87e3){return db[_0xc733('0x2a')]['describe']()[_0xc733('0x24')](respondWithResult(_0x5a87e3,null))[_0xc733('0x43')](handleError(_0x5a87e3,null));};
\ No newline at end of file
index b200930..d77d966 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x9619e6,_0x3b6326){var _0x443cc1=function(_0x52e621){while(--_0x52e621){_0x9619e6['push'](_0x9619e6['shift']());}};_0x443cc1(++_0x3b6326);}(_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 logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x266c40,_0x284502){var _0x35aa8a=function(_0x30a828){while(--_0x30a828){_0x266c40['push'](_0x266c40['shift']());}};_0x35aa8a(++_0x284502);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0xcb91[_0x29a29f];return _0x443ea3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 4367e1a..7ded487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd005=['rpc','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','SmsQueueReport','create','body','options','raw','CreateSmsQueueReport','update','where','limit','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x68bf6f,_0x19b203){var _0x2c806=function(_0x14b211){while(--_0x14b211){_0x68bf6f['push'](_0x68bf6f['shift']());}};_0x2c806(++_0x19b203);}(_0xd005,0xae));var _0x5d00=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xd005[_0x3ab51d];return _0x29a04e;};'use strict';var _=require('lodash');var util=require(_0x5d00('0x0'));var moment=require(_0x5d00('0x1'));var BPromise=require(_0x5d00('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d00('0x3'))['db'];var utils=require(_0x5d00('0x4'));var logger=require(_0x5d00('0x5'))(_0x5d00('0x6'));var config=require('../../config/environment');var jayson=require(_0x5d00('0x7'));var client=jayson[_0x5d00('0x8')][_0x5d00('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46e91f,_0x24631d,_0x40cd46){return new BPromise(function(_0xe2016c,_0x3d5dd0){return client['request'](_0x46e91f,_0x40cd46)[_0x5d00('0xa')](function(_0x45818c){logger[_0x5d00('0xb')](_0x5d00('0xc'),_0x24631d,'request\x20sent');logger[_0x5d00('0xd')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x24631d,_0x5d00('0xe'),JSON[_0x5d00('0xf')](_0x45818c));if(_0x45818c[_0x5d00('0x10')]){if(_0x45818c[_0x5d00('0x10')][_0x5d00('0x11')]===0x1f4){logger[_0x5d00('0x10')](_0x5d00('0xc'),_0x24631d,_0x45818c['error'][_0x5d00('0x12')]);return _0x3d5dd0(_0x45818c[_0x5d00('0x10')][_0x5d00('0x12')]);}logger[_0x5d00('0x10')](_0x5d00('0xc'),_0x24631d,_0x45818c['error'][_0x5d00('0x12')]);return _0xe2016c(_0x45818c[_0x5d00('0x10')][_0x5d00('0x12')]);}else{logger[_0x5d00('0xb')](_0x5d00('0xc'),_0x24631d,_0x5d00('0xe'));_0xe2016c(_0x45818c[_0x5d00('0x13')][_0x5d00('0x12')]);}})[_0x5d00('0x14')](function(_0x528b51){logger[_0x5d00('0x10')](_0x5d00('0xc'),_0x24631d,_0x528b51);_0x3d5dd0(_0x528b51);});});}exports['CreateSmsQueueReport']=function(_0x530580){var _0x39f4d9=this;return new Promise(function(_0x348f9e,_0x805d14){return db[_0x5d00('0x15')][_0x5d00('0x16')](_0x530580[_0x5d00('0x17')],{'raw':_0x530580[_0x5d00('0x18')]?_0x530580[_0x5d00('0x18')][_0x5d00('0x19')]===undefined?!![]:![]:!![]})[_0x5d00('0xa')](function(_0x323453){logger[_0x5d00('0xb')]('CreateSmsQueueReport',_0x530580);logger[_0x5d00('0xd')](_0x5d00('0x1a'),_0x530580,JSON[_0x5d00('0xf')](_0x323453));_0x348f9e(_0x323453);})[_0x5d00('0x14')](function(_0x15f68c){logger[_0x5d00('0x10')](_0x5d00('0x1a'),_0x15f68c[_0x5d00('0x12')],_0x530580);_0x805d14(_0x39f4d9['error'](0x1f4,_0x15f68c['message']));});});};exports['UpdateSmsQueueReport']=function(_0x514fd7){var _0x29b0e5=this;return new Promise(function(_0x1a21e2,_0x113f9a){return db[_0x5d00('0x15')][_0x5d00('0x1b')](_0x514fd7[_0x5d00('0x17')],{'raw':_0x514fd7[_0x5d00('0x18')]?_0x514fd7[_0x5d00('0x18')][_0x5d00('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x514fd7[_0x5d00('0x18')]?_0x514fd7[_0x5d00('0x18')][_0x5d00('0x1c')]||null:null,'attributes':_0x514fd7[_0x5d00('0x18')]?_0x514fd7[_0x5d00('0x18')]['attributes']||null:null,'limit':_0x514fd7[_0x5d00('0x18')]?_0x514fd7['options'][_0x5d00('0x1d')]||null:null})[_0x5d00('0xa')](function(_0x3ab94a){logger[_0x5d00('0xb')]('UpdateSmsQueueReport',_0x514fd7);logger[_0x5d00('0xd')]('UpdateSmsQueueReport',_0x514fd7,JSON['stringify'](_0x3ab94a));_0x1a21e2(_0x3ab94a);})[_0x5d00('0x14')](function(_0x2e3458){logger['error']('UpdateSmsQueueReport',_0x2e3458[_0x5d00('0x12')],_0x514fd7);_0x113f9a(_0x29b0e5[_0x5d00('0x10')](0x1f4,_0x2e3458[_0x5d00('0x12')]));});});};
\ No newline at end of file
+var _0x50ac=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','info','CreateSmsQueueReport','SmsQueueReport','create','body','options','stringify','catch','UpdateSmsQueueReport','raw','where','attributes','limit'];(function(_0x4d568c,_0x3ba6bb){var _0xe904b6=function(_0x2e9f15){while(--_0x2e9f15){_0x4d568c['push'](_0x4d568c['shift']());}};_0xe904b6(++_0x3ba6bb);}(_0x50ac,0x154));var _0xc50a=function(_0x2966b3,_0x164072){_0x2966b3=_0x2966b3-0x0;var _0xe534d6=_0x50ac[_0x2966b3];return _0xe534d6;};'use strict';var _=require(_0xc50a('0x0'));var util=require(_0xc50a('0x1'));var moment=require(_0xc50a('0x2'));var BPromise=require(_0xc50a('0x3'));var rs=require(_0xc50a('0x4'));var fs=require('fs');var Redis=require(_0xc50a('0x5'));var db=require(_0xc50a('0x6'))['db'];var utils=require(_0xc50a('0x7'));var logger=require(_0xc50a('0x8'))(_0xc50a('0x9'));var config=require('../../config/environment');var jayson=require(_0xc50a('0xa'));var client=jayson['client'][_0xc50a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219997,_0x3cd8b0,_0x4d6c6b){return new BPromise(function(_0x3c5072,_0x1a978b){return client[_0xc50a('0xc')](_0x219997,_0x4d6c6b)[_0xc50a('0xd')](function(_0x36ddc0){logger['info'](_0xc50a('0xe'),_0x3cd8b0,_0xc50a('0xf'));logger[_0xc50a('0x10')](_0xc50a('0x11'),_0x3cd8b0,_0xc50a('0xf'),JSON['stringify'](_0x36ddc0));if(_0x36ddc0['error']){if(_0x36ddc0[_0xc50a('0x12')][_0xc50a('0x13')]===0x1f4){logger[_0xc50a('0x12')](_0xc50a('0xe'),_0x3cd8b0,_0x36ddc0[_0xc50a('0x12')][_0xc50a('0x14')]);return _0x1a978b(_0x36ddc0[_0xc50a('0x12')][_0xc50a('0x14')]);}logger['error'](_0xc50a('0xe'),_0x3cd8b0,_0x36ddc0[_0xc50a('0x12')]['message']);return _0x3c5072(_0x36ddc0['error'][_0xc50a('0x14')]);}else{logger[_0xc50a('0x15')](_0xc50a('0xe'),_0x3cd8b0,_0xc50a('0xf'));_0x3c5072(_0x36ddc0['result']['message']);}})['catch'](function(_0x58e1d2){logger[_0xc50a('0x12')](_0xc50a('0xe'),_0x3cd8b0,_0x58e1d2);_0x1a978b(_0x58e1d2);});});}exports[_0xc50a('0x16')]=function(_0x42661c){var _0x46146c=this;return new Promise(function(_0x3d5cca,_0x3ac66f){return db[_0xc50a('0x17')][_0xc50a('0x18')](_0x42661c[_0xc50a('0x19')],{'raw':_0x42661c[_0xc50a('0x1a')]?_0x42661c['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5285d5){logger[_0xc50a('0x15')]('CreateSmsQueueReport',_0x42661c);logger[_0xc50a('0x10')]('CreateSmsQueueReport',_0x42661c,JSON[_0xc50a('0x1b')](_0x5285d5));_0x3d5cca(_0x5285d5);})[_0xc50a('0x1c')](function(_0x5c8054){logger[_0xc50a('0x12')](_0xc50a('0x16'),_0x5c8054[_0xc50a('0x14')],_0x42661c);_0x3ac66f(_0x46146c[_0xc50a('0x12')](0x1f4,_0x5c8054[_0xc50a('0x14')]));});});};exports[_0xc50a('0x1d')]=function(_0x1c884c){var _0x5e1405=this;return new Promise(function(_0xb65908,_0xf8f6d4){return db[_0xc50a('0x17')]['update'](_0x1c884c[_0xc50a('0x19')],{'raw':_0x1c884c[_0xc50a('0x1a')]?_0x1c884c[_0xc50a('0x1a')][_0xc50a('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c884c['options']?_0x1c884c['options'][_0xc50a('0x1f')]||null:null,'attributes':_0x1c884c[_0xc50a('0x1a')]?_0x1c884c[_0xc50a('0x1a')][_0xc50a('0x20')]||null:null,'limit':_0x1c884c['options']?_0x1c884c[_0xc50a('0x1a')][_0xc50a('0x21')]||null:null})[_0xc50a('0xd')](function(_0x2f3b75){logger['info'](_0xc50a('0x1d'),_0x1c884c);logger[_0xc50a('0x10')]('UpdateSmsQueueReport',_0x1c884c,JSON['stringify'](_0x2f3b75));_0xb65908(_0x2f3b75);})[_0xc50a('0x1c')](function(_0x2aafe8){logger[_0xc50a('0x12')]('UpdateSmsQueueReport',_0x2aafe8[_0xc50a('0x14')],_0x1c884c);_0xf8f6d4(_0x5e1405[_0xc50a('0x12')](0x1f4,_0x2aafe8[_0xc50a('0x14')]));});});};
\ No newline at end of file
index ae8c7ee..45345f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde64=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','post','create','update','delete','destroy','exports'];(function(_0x4ddc7e,_0xcb9b8){var _0xfbf0ec=function(_0x32b673){while(--_0x32b673){_0x4ddc7e['push'](_0x4ddc7e['shift']());}};_0xfbf0ec(++_0xcb9b8);}(_0xde64,0x17c));var _0x4de6=function(_0x13cae0,_0x418cee){_0x13cae0=_0x13cae0-0x0;var _0x34f844=_0xde64[_0x13cae0];return _0x34f844;};'use strict';var multer=require(_0x4de6('0x0'));var util=require(_0x4de6('0x1'));var path=require(_0x4de6('0x2'));var timeout=require(_0x4de6('0x3'));var express=require(_0x4de6('0x4'));var router=express[_0x4de6('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4de6('0x6'));var interaction=require(_0x4de6('0x7'));var config=require('../../config/environment');var controller=require('./smsTransferReport.controller');router[_0x4de6('0x8')]('/',auth[_0x4de6('0x9')](),controller['index']);router['get'](_0x4de6('0xa'),auth[_0x4de6('0x9')](),controller[_0x4de6('0xb')]);router[_0x4de6('0x8')](_0x4de6('0xc'),auth[_0x4de6('0x9')](),controller['show']);router[_0x4de6('0xd')]('/',auth[_0x4de6('0x9')](),controller[_0x4de6('0xe')]);router['put'](_0x4de6('0xc'),auth[_0x4de6('0x9')](),controller[_0x4de6('0xf')]);router[_0x4de6('0x10')](_0x4de6('0xc'),auth['isAuthenticated'](),controller[_0x4de6('0x11')]);module[_0x4de6('0x12')]=router;
\ No newline at end of file
+var _0x5fd1=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x5926d1,_0x2a606b){var _0x487a5c=function(_0x11d5cb){while(--_0x11d5cb){_0x5926d1['push'](_0x5926d1['shift']());}};_0x487a5c(++_0x2a606b);}(_0x5fd1,0x155));var _0x15fd=function(_0x260f88,_0x5208e7){_0x260f88=_0x260f88-0x0;var _0x2a4cd9=_0x5fd1[_0x260f88];return _0x2a4cd9;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x15fd('0x4'));var interaction=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var controller=require('./smsTransferReport.controller');router[_0x15fd('0x7')]('/',auth[_0x15fd('0x8')](),controller[_0x15fd('0x9')]);router[_0x15fd('0x7')](_0x15fd('0xa'),auth['isAuthenticated'](),controller[_0x15fd('0xb')]);router[_0x15fd('0x7')](_0x15fd('0xc'),auth['isAuthenticated'](),controller[_0x15fd('0xd')]);router['post']('/',auth[_0x15fd('0x8')](),controller[_0x15fd('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x15fd('0xf')]);router[_0x15fd('0x10')](_0x15fd('0xc'),auth[_0x15fd('0x8')](),controller[_0x15fd('0x11')]);module[_0x15fd('0x12')]=router;
\ No newline at end of file
index c249b1b..a691d97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x296575,_0x3d25d5){var _0x50a126=function(_0x3d0589){while(--_0x3d0589){_0x296575['push'](_0x296575['shift']());}};_0x50a126(++_0x3d25d5);}(_0xedd9,0xfc));var _0x9edd=function(_0x43826a,_0xa380ee){_0x43826a=_0x43826a-0x0;var _0x10dbf5=_0xedd9[_0x43826a];return _0x10dbf5;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x352662,_0x2b98e2){var _0x31d1ad=function(_0x2ac764){while(--_0x2ac764){_0x352662['push'](_0x352662['shift']());}};_0x31d1ad(++_0x2b98e2);}(_0x00bb,0x1d8));var _0xb00b=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x00bb[_0x411add];return _0x238242;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
index 61131c8..68bbe6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0efa=['Content-Range','save','then','end','error','stack','name','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','rows','catch','show','length','create','body','update','find','params','destroy','describe','rimraf','mustache','util','path','to-csv','ejs','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x0efa,0xad));var _0xa0ef=function(_0x1477ef,_0x54a5d6){_0x1477ef=_0x1477ef-0x0;var _0x164acd=_0x0efa[_0x1477ef];return _0x164acd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0ef('0x0'));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(_0xa0ef('0x1'));var util=require(_0xa0ef('0x2'));var path=require(_0xa0ef('0x3'));var sox=require('sox');var csv=require(_0xa0ef('0x4'));var ejs=require(_0xa0ef('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0ef('0x6'));var squel=require(_0xa0ef('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa0ef('0x4'));var querystring=require(_0xa0ef('0x8'));var Papa=require(_0xa0ef('0x9'));var Redis=require('ioredis');var authService=require(_0xa0ef('0xa'));var qs=require(_0xa0ef('0xb'));var as=require(_0xa0ef('0xc'));var hardwareService=require(_0xa0ef('0xd'));var logger=require(_0xa0ef('0xe'))(_0xa0ef('0xf'));var utils=require(_0xa0ef('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10950f,_0x576efe){_0x576efe=_0x576efe||0xcc;return function(_0x2030b8){if(_0x2030b8){return _0x10950f[_0xa0ef('0x11')](_0x576efe);}return _0x10950f[_0xa0ef('0x12')](_0x576efe)['end']();};}function respondWithResult(_0x3c91d1,_0x436f7b){_0x436f7b=_0x436f7b||0xc8;return function(_0xb2194a){if(_0xb2194a){return _0x3c91d1[_0xa0ef('0x12')](_0x436f7b)[_0xa0ef('0x13')](_0xb2194a);}};}function respondWithFilteredResult(_0x3c42c5,_0xf5a03e){return function(_0x23eccc){if(_0x23eccc){var _0x5e0a00=typeof _0xf5a03e[_0xa0ef('0x14')]===_0xa0ef('0x15')&&typeof _0xf5a03e[_0xa0ef('0x16')]===_0xa0ef('0x15');var _0x134519=_0x23eccc[_0xa0ef('0x17')];var _0x1313b5=_0x5e0a00?0x0:_0xf5a03e['offset'];var _0x22cf7e=_0x5e0a00?_0x23eccc['count']:_0xf5a03e[_0xa0ef('0x14')]+_0xf5a03e[_0xa0ef('0x16')];var _0x9deefe;if(_0x22cf7e>=_0x134519){_0x22cf7e=_0x134519;_0x9deefe=0xc8;}else{_0x9deefe=0xce;}_0x3c42c5['status'](_0x9deefe);return _0x3c42c5[_0xa0ef('0x18')](_0xa0ef('0x19'),_0x1313b5+'-'+_0x22cf7e+'/'+_0x134519)[_0xa0ef('0x13')](_0x23eccc);}return null;};}function patchUpdates(_0x35aaa7){return function(_0x5c1d65){try{jsonpatch['apply'](_0x5c1d65,_0x35aaa7,!![]);}catch(_0x5e2ac8){return BPromise['reject'](_0x5e2ac8);}return _0x5c1d65[_0xa0ef('0x1a')]();};}function saveUpdates(_0xfe9b98,_0x136ac9){return function(_0x160822){if(_0x160822){return _0x160822['update'](_0xfe9b98)[_0xa0ef('0x1b')](function(_0x1ce640){return _0x1ce640;});}return null;};}function removeEntity(_0x17512e,_0x2bc1d0){return function(_0x315830){if(_0x315830){return _0x315830['destroy']()[_0xa0ef('0x1b')](function(){_0x17512e[_0xa0ef('0x12')](0xcc)[_0xa0ef('0x1c')]();});}};}function handleEntityNotFound(_0x1835ea,_0x2f0d85){return function(_0x2700c0){if(!_0x2700c0){_0x1835ea[_0xa0ef('0x11')](0x194);}return _0x2700c0;};}function handleError(_0x29e7ec,_0x8fcf7){_0x8fcf7=_0x8fcf7||0x1f4;return function(_0x9dd38a){logger[_0xa0ef('0x1d')](_0x9dd38a[_0xa0ef('0x1e')]);if(_0x9dd38a[_0xa0ef('0x1f')]){delete _0x9dd38a['name'];}_0x29e7ec['status'](_0x8fcf7)['send'](_0x9dd38a);};}exports[_0xa0ef('0x20')]=function(_0x367e61,_0x385f1b){var _0x641ca5={},_0x3b52df={},_0x41ad33={'count':0x0,'rows':[]};var _0x3e48c9=_[_0xa0ef('0x21')](db[_0xa0ef('0x22')][_0xa0ef('0x23')],function(_0x1e1108){return{'name':_0x1e1108[_0xa0ef('0x24')],'type':_0x1e1108[_0xa0ef('0x25')][_0xa0ef('0x26')]};});_0x3b52df['model']=_[_0xa0ef('0x21')](_0x3e48c9,_0xa0ef('0x1f'));_0x3b52df[_0xa0ef('0x27')]=_[_0xa0ef('0x28')](_0x367e61[_0xa0ef('0x27')]);_0x3b52df[_0xa0ef('0x29')]=_[_0xa0ef('0x2a')](_0x3b52df[_0xa0ef('0x2b')],_0x3b52df['query']);_0x641ca5[_0xa0ef('0x2c')]=_['intersection'](_0x3b52df[_0xa0ef('0x2b')],qs[_0xa0ef('0x2d')](_0x367e61[_0xa0ef('0x27')][_0xa0ef('0x2d')]));_0x641ca5[_0xa0ef('0x2c')]=_0x641ca5[_0xa0ef('0x2c')]['length']?_0x641ca5['attributes']:_0x3b52df[_0xa0ef('0x2b')];if(!_0x367e61['query'][_0xa0ef('0x2e')]('nolimit')){_0x641ca5[_0xa0ef('0x16')]=qs['limit'](_0x367e61[_0xa0ef('0x27')][_0xa0ef('0x16')]);_0x641ca5['offset']=qs[_0xa0ef('0x14')](_0x367e61['query'][_0xa0ef('0x14')]);}_0x641ca5[_0xa0ef('0x2f')]=qs[_0xa0ef('0x30')](_0x367e61[_0xa0ef('0x27')][_0xa0ef('0x30')]);_0x641ca5[_0xa0ef('0x31')]=qs['filters'](_[_0xa0ef('0x32')](_0x367e61['query'],_0x3b52df['filters']),_0x3e48c9);if(_0x367e61[_0xa0ef('0x27')][_0xa0ef('0x33')]){_0x641ca5[_0xa0ef('0x31')]=_[_0xa0ef('0x34')](_0x641ca5[_0xa0ef('0x31')],{'$or':_['map'](_0x3e48c9,function(_0xef2fb){if(_0xef2fb['type']!=='VIRTUAL'){var _0x28cfce={};_0x28cfce[_0xef2fb['name']]={'$like':'%'+_0x367e61[_0xa0ef('0x27')][_0xa0ef('0x33')]+'%'};return _0x28cfce;}})});}_0x641ca5=_[_0xa0ef('0x34')]({},_0x641ca5,_0x367e61[_0xa0ef('0x35')]);var _0x14fc7c={'where':_0x641ca5[_0xa0ef('0x31')]};return db[_0xa0ef('0x22')]['count'](_0x14fc7c)[_0xa0ef('0x1b')](function(_0x317204){_0x41ad33[_0xa0ef('0x17')]=_0x317204;if(_0x367e61[_0xa0ef('0x27')]['includeAll']){_0x641ca5[_0xa0ef('0x36')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x641ca5);})[_0xa0ef('0x1b')](function(_0x2e48d3){_0x41ad33[_0xa0ef('0x37')]=_0x2e48d3;return _0x41ad33;})[_0xa0ef('0x1b')](respondWithFilteredResult(_0x385f1b,_0x641ca5))[_0xa0ef('0x38')](handleError(_0x385f1b,null));};exports[_0xa0ef('0x39')]=function(_0x5b8f32,_0x4209af){var _0x493d9f={'raw':!![],'where':{'id':_0x5b8f32['params']['id']}},_0x2175da={};_0x2175da[_0xa0ef('0x2b')]=_['keys'](db[_0xa0ef('0x22')][_0xa0ef('0x23')]);_0x2175da[_0xa0ef('0x27')]=_['keys'](_0x5b8f32[_0xa0ef('0x27')]);_0x2175da[_0xa0ef('0x29')]=_[_0xa0ef('0x2a')](_0x2175da[_0xa0ef('0x2b')],_0x2175da[_0xa0ef('0x27')]);_0x493d9f[_0xa0ef('0x2c')]=_[_0xa0ef('0x2a')](_0x2175da[_0xa0ef('0x2b')],qs[_0xa0ef('0x2d')](_0x5b8f32['query'][_0xa0ef('0x2d')]));_0x493d9f[_0xa0ef('0x2c')]=_0x493d9f[_0xa0ef('0x2c')][_0xa0ef('0x3a')]?_0x493d9f['attributes']:_0x2175da[_0xa0ef('0x2b')];if(_0x5b8f32['query']['includeAll']){_0x493d9f[_0xa0ef('0x36')]=[{'all':!![]}];}_0x493d9f=_[_0xa0ef('0x34')]({},_0x493d9f,_0x5b8f32[_0xa0ef('0x35')]);return db[_0xa0ef('0x22')]['find'](_0x493d9f)[_0xa0ef('0x1b')](handleEntityNotFound(_0x4209af,null))[_0xa0ef('0x1b')](respondWithResult(_0x4209af,null))[_0xa0ef('0x38')](handleError(_0x4209af,null));};exports[_0xa0ef('0x3b')]=function(_0x3c79d6,_0x2b47b9){return db['SmsTransferReport'][_0xa0ef('0x3b')](_0x3c79d6[_0xa0ef('0x3c')],{})[_0xa0ef('0x1b')](respondWithResult(_0x2b47b9,0xc9))[_0xa0ef('0x38')](handleError(_0x2b47b9,null));};exports[_0xa0ef('0x3d')]=function(_0x2038f1,_0x43be38){if(_0x2038f1[_0xa0ef('0x3c')]['id']){delete _0x2038f1[_0xa0ef('0x3c')]['id'];}return db['SmsTransferReport'][_0xa0ef('0x3e')]({'where':{'id':_0x2038f1[_0xa0ef('0x3f')]['id']}})[_0xa0ef('0x1b')](handleEntityNotFound(_0x43be38,null))[_0xa0ef('0x1b')](saveUpdates(_0x2038f1['body'],null))[_0xa0ef('0x1b')](respondWithResult(_0x43be38,null))['catch'](handleError(_0x43be38,null));};exports[_0xa0ef('0x40')]=function(_0x4fabac,_0x5cd4da){return db[_0xa0ef('0x22')][_0xa0ef('0x3e')]({'where':{'id':_0x4fabac[_0xa0ef('0x3f')]['id']}})[_0xa0ef('0x1b')](handleEntityNotFound(_0x5cd4da,null))[_0xa0ef('0x1b')](removeEntity(_0x5cd4da,null))[_0xa0ef('0x38')](handleError(_0x5cd4da,null));};exports[_0xa0ef('0x41')]=function(_0x4f680e,_0x13589c){return db[_0xa0ef('0x22')][_0xa0ef('0x41')]()[_0xa0ef('0x1b')](respondWithResult(_0x13589c,null))[_0xa0ef('0x38')](handleError(_0x13589c,null));};
\ No newline at end of file
+var _0x6926=['save','update','then','error','stack','name','send','SmsTransferReport','fieldName','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject'];(function(_0x57c7b8,_0x4622a6){var _0x429fb2=function(_0xeb30fc){while(--_0xeb30fc){_0x57c7b8['push'](_0x57c7b8['shift']());}};_0x429fb2(++_0x4622a6);}(_0x6926,0xbd));var _0x6692=function(_0x7bac67,_0x51ca67){_0x7bac67=_0x7bac67-0x0;var _0x46d6e2=_0x6926[_0x7bac67];return _0x46d6e2;};'use strict';var emlformat=require(_0x6692('0x0'));var rimraf=require(_0x6692('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6692('0x2'));var rp=require('request-promise');var moment=require(_0x6692('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6692('0x4'));var util=require(_0x6692('0x5'));var path=require(_0x6692('0x6'));var sox=require('sox');var csv=require(_0x6692('0x7'));var ejs=require(_0x6692('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6692('0x9'));var squel=require(_0x6692('0xa'));var crypto=require(_0x6692('0xb'));var jsforce=require(_0x6692('0xc'));var deskjs=require(_0x6692('0xd'));var toCsv=require(_0x6692('0x7'));var querystring=require(_0x6692('0xe'));var Papa=require('papaparse');var Redis=require(_0x6692('0xf'));var authService=require(_0x6692('0x10'));var qs=require(_0x6692('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6692('0x12'));var logger=require(_0x6692('0x13'))(_0x6692('0x14'));var utils=require(_0x6692('0x15'));var config=require(_0x6692('0x16'));var licenseUtil=require(_0x6692('0x17'));var db=require(_0x6692('0x18'))['db'];function respondWithStatusCode(_0x5912ff,_0x22f306){_0x22f306=_0x22f306||0xcc;return function(_0x44fe1e){if(_0x44fe1e){return _0x5912ff[_0x6692('0x19')](_0x22f306);}return _0x5912ff[_0x6692('0x1a')](_0x22f306)[_0x6692('0x1b')]();};}function respondWithResult(_0xcb5017,_0x5254cf){_0x5254cf=_0x5254cf||0xc8;return function(_0x276960){if(_0x276960){return _0xcb5017[_0x6692('0x1a')](_0x5254cf)['json'](_0x276960);}};}function respondWithFilteredResult(_0x4412fe,_0x28678e){return function(_0xe20284){if(_0xe20284){var _0x39d1c1=typeof _0x28678e['offset']===_0x6692('0x1c')&&typeof _0x28678e['limit']===_0x6692('0x1c');var _0x3b9b7c=_0xe20284[_0x6692('0x1d')];var _0x21d8f4=_0x39d1c1?0x0:_0x28678e[_0x6692('0x1e')];var _0x295954=_0x39d1c1?_0xe20284[_0x6692('0x1d')]:_0x28678e['offset']+_0x28678e[_0x6692('0x1f')];var _0x44711d;if(_0x295954>=_0x3b9b7c){_0x295954=_0x3b9b7c;_0x44711d=0xc8;}else{_0x44711d=0xce;}_0x4412fe[_0x6692('0x1a')](_0x44711d);return _0x4412fe['set'](_0x6692('0x20'),_0x21d8f4+'-'+_0x295954+'/'+_0x3b9b7c)[_0x6692('0x21')](_0xe20284);}return null;};}function patchUpdates(_0x268254){return function(_0x34d6d4){try{jsonpatch[_0x6692('0x22')](_0x34d6d4,_0x268254,!![]);}catch(_0x2eedd9){return BPromise[_0x6692('0x23')](_0x2eedd9);}return _0x34d6d4[_0x6692('0x24')]();};}function saveUpdates(_0x24e625,_0x28b155){return function(_0x578d84){if(_0x578d84){return _0x578d84[_0x6692('0x25')](_0x24e625)[_0x6692('0x26')](function(_0x50cd47){return _0x50cd47;});}return null;};}function removeEntity(_0x407662,_0x1717e5){return function(_0x3a28cb){if(_0x3a28cb){return _0x3a28cb['destroy']()['then'](function(){_0x407662[_0x6692('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x118a60,_0x266db8){return function(_0x25c9b2){if(!_0x25c9b2){_0x118a60['sendStatus'](0x194);}return _0x25c9b2;};}function handleError(_0x55705a,_0x230a92){_0x230a92=_0x230a92||0x1f4;return function(_0x5afa56){logger[_0x6692('0x27')](_0x5afa56[_0x6692('0x28')]);if(_0x5afa56[_0x6692('0x29')]){delete _0x5afa56['name'];}_0x55705a[_0x6692('0x1a')](_0x230a92)[_0x6692('0x2a')](_0x5afa56);};}exports['index']=function(_0x34a465,_0x310819){var _0x5f27bc={},_0x1b0c14={},_0x3159dc={'count':0x0,'rows':[]};var _0x30e890=_['map'](db[_0x6692('0x2b')]['rawAttributes'],function(_0xf6e8d3){return{'name':_0xf6e8d3[_0x6692('0x2c')],'type':_0xf6e8d3[_0x6692('0x2d')][_0x6692('0x2e')]};});_0x1b0c14[_0x6692('0x2f')]=_[_0x6692('0x30')](_0x30e890,_0x6692('0x29'));_0x1b0c14['query']=_[_0x6692('0x31')](_0x34a465['query']);_0x1b0c14[_0x6692('0x32')]=_[_0x6692('0x33')](_0x1b0c14[_0x6692('0x2f')],_0x1b0c14[_0x6692('0x34')]);_0x5f27bc['attributes']=_[_0x6692('0x33')](_0x1b0c14[_0x6692('0x2f')],qs[_0x6692('0x35')](_0x34a465[_0x6692('0x34')][_0x6692('0x35')]));_0x5f27bc[_0x6692('0x36')]=_0x5f27bc['attributes'][_0x6692('0x37')]?_0x5f27bc[_0x6692('0x36')]:_0x1b0c14[_0x6692('0x2f')];if(!_0x34a465[_0x6692('0x34')]['hasOwnProperty']('nolimit')){_0x5f27bc['limit']=qs[_0x6692('0x1f')](_0x34a465[_0x6692('0x34')][_0x6692('0x1f')]);_0x5f27bc['offset']=qs['offset'](_0x34a465[_0x6692('0x34')][_0x6692('0x1e')]);}_0x5f27bc[_0x6692('0x38')]=qs['sort'](_0x34a465['query'][_0x6692('0x39')]);_0x5f27bc[_0x6692('0x3a')]=qs[_0x6692('0x32')](_[_0x6692('0x3b')](_0x34a465['query'],_0x1b0c14[_0x6692('0x32')]),_0x30e890);if(_0x34a465[_0x6692('0x34')][_0x6692('0x3c')]){_0x5f27bc['where']=_[_0x6692('0x3d')](_0x5f27bc['where'],{'$or':_[_0x6692('0x30')](_0x30e890,function(_0x3bd08c){if(_0x3bd08c['type']!==_0x6692('0x3e')){var _0xc4eb70={};_0xc4eb70[_0x3bd08c[_0x6692('0x29')]]={'$like':'%'+_0x34a465[_0x6692('0x34')][_0x6692('0x3c')]+'%'};return _0xc4eb70;}})});}_0x5f27bc=_['merge']({},_0x5f27bc,_0x34a465[_0x6692('0x3f')]);var _0x205ce9={'where':_0x5f27bc[_0x6692('0x3a')]};return db['SmsTransferReport'][_0x6692('0x1d')](_0x205ce9)[_0x6692('0x26')](function(_0xf98f36){_0x3159dc[_0x6692('0x1d')]=_0xf98f36;if(_0x34a465[_0x6692('0x34')][_0x6692('0x40')]){_0x5f27bc[_0x6692('0x41')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x5f27bc);})[_0x6692('0x26')](function(_0x2f7da2){_0x3159dc[_0x6692('0x42')]=_0x2f7da2;return _0x3159dc;})[_0x6692('0x26')](respondWithFilteredResult(_0x310819,_0x5f27bc))[_0x6692('0x43')](handleError(_0x310819,null));};exports[_0x6692('0x44')]=function(_0x353d8f,_0x4284c7){var _0xfcaf57={'raw':!![],'where':{'id':_0x353d8f[_0x6692('0x45')]['id']}},_0xcb9862={};_0xcb9862[_0x6692('0x2f')]=_[_0x6692('0x31')](db['SmsTransferReport'][_0x6692('0x46')]);_0xcb9862['query']=_[_0x6692('0x31')](_0x353d8f['query']);_0xcb9862[_0x6692('0x32')]=_['intersection'](_0xcb9862[_0x6692('0x2f')],_0xcb9862[_0x6692('0x34')]);_0xfcaf57[_0x6692('0x36')]=_['intersection'](_0xcb9862[_0x6692('0x2f')],qs['fields'](_0x353d8f[_0x6692('0x34')][_0x6692('0x35')]));_0xfcaf57['attributes']=_0xfcaf57[_0x6692('0x36')][_0x6692('0x37')]?_0xfcaf57[_0x6692('0x36')]:_0xcb9862[_0x6692('0x2f')];if(_0x353d8f[_0x6692('0x34')][_0x6692('0x40')]){_0xfcaf57[_0x6692('0x41')]=[{'all':!![]}];}_0xfcaf57=_[_0x6692('0x3d')]({},_0xfcaf57,_0x353d8f['options']);return db['SmsTransferReport']['find'](_0xfcaf57)['then'](handleEntityNotFound(_0x4284c7,null))['then'](respondWithResult(_0x4284c7,null))[_0x6692('0x43')](handleError(_0x4284c7,null));};exports[_0x6692('0x47')]=function(_0x371662,_0x3f4256){return db[_0x6692('0x2b')][_0x6692('0x47')](_0x371662[_0x6692('0x48')],{})['then'](respondWithResult(_0x3f4256,0xc9))['catch'](handleError(_0x3f4256,null));};exports[_0x6692('0x25')]=function(_0x11127a,_0x57ee75){if(_0x11127a[_0x6692('0x48')]['id']){delete _0x11127a[_0x6692('0x48')]['id'];}return db[_0x6692('0x2b')][_0x6692('0x49')]({'where':{'id':_0x11127a['params']['id']}})['then'](handleEntityNotFound(_0x57ee75,null))[_0x6692('0x26')](saveUpdates(_0x11127a[_0x6692('0x48')],null))[_0x6692('0x26')](respondWithResult(_0x57ee75,null))[_0x6692('0x43')](handleError(_0x57ee75,null));};exports['destroy']=function(_0x208684,_0x2b2368){return db['SmsTransferReport'][_0x6692('0x49')]({'where':{'id':_0x208684[_0x6692('0x45')]['id']}})[_0x6692('0x26')](handleEntityNotFound(_0x2b2368,null))['then'](removeEntity(_0x2b2368,null))[_0x6692('0x43')](handleError(_0x2b2368,null));};exports[_0x6692('0x4a')]=function(_0xe44bc6,_0x304c26){return db[_0x6692('0x2b')]['describe']()['then'](respondWithResult(_0x304c26,null))[_0x6692('0x43')](handleError(_0x304c26,null));};
\ No newline at end of file
index 5ffd876..9075d83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb26e=['path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','moment','bluebird'];(function(_0x2b0890,_0x512c36){var _0x4a7a19=function(_0x23a460){while(--_0x23a460){_0x2b0890['push'](_0x2b0890['shift']());}};_0x4a7a19(++_0x512c36);}(_0xb26e,0x11d));var _0xeb26=function(_0x37cd8c,_0x425de5){_0x37cd8c=_0x37cd8c-0x0;var _0x213168=_0xb26e[_0x37cd8c];return _0x213168;};'use strict';var _=require(_0xeb26('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xeb26('0x1'));var BPromise=require(_0xeb26('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb26('0x3'));var rimraf=require(_0xeb26('0x4'));var config=require(_0xeb26('0x5'));var attributes=require(_0xeb26('0x6'));module[_0xeb26('0x7')]=function(_0x17f489,_0x2351f9){return _0x17f489[_0xeb26('0x8')](_0xeb26('0x9'),attributes,{'tableName':_0xeb26('0xa'),'paranoid':![],'indexes':[{'name':_0xeb26('0xb'),'fields':[_0xeb26('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8ece=['report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport'];(function(_0x2af655,_0x43eac3){var _0x54380a=function(_0x2a76fd){while(--_0x2a76fd){_0x2af655['push'](_0x2af655['shift']());}};_0x54380a(++_0x43eac3);}(_0x8ece,0x195));var _0xe8ec=function(_0x5df67d,_0x7f71cf){_0x5df67d=_0x5df67d-0x0;var _0x1f0c73=_0x8ece[_0x5df67d];return _0x1f0c73;};'use strict';var _=require(_0xe8ec('0x0'));var util=require(_0xe8ec('0x1'));var logger=require(_0xe8ec('0x2'))(_0xe8ec('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe8ec('0x4'));var fs=require('fs');var path=require(_0xe8ec('0x5'));var rimraf=require(_0xe8ec('0x6'));var config=require(_0xe8ec('0x7'));var attributes=require(_0xe8ec('0x8'));module['exports']=function(_0x346577,_0x23fa35){return _0x346577[_0xe8ec('0x9')](_0xe8ec('0xa'),attributes,{'tableName':_0xe8ec('0xb'),'paranoid':![],'indexes':[{'name':_0xe8ec('0xc'),'fields':[_0xe8ec('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 65fb40f..c6749f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f89=['info','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','SmsTransferReport,\x20%s,\x20%s','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x5814bf,_0x2cd816){var _0x78a352=function(_0x517be1){while(--_0x517be1){_0x5814bf['push'](_0x5814bf['shift']());}};_0x78a352(++_0x2cd816);}(_0x0f89,0x111));var _0x90f8=function(_0x5b2d6c,_0x3519d3){_0x5b2d6c=_0x5b2d6c-0x0;var _0x25ef43=_0x0f89[_0x5b2d6c];return _0x25ef43;};'use strict';var _=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var moment=require(_0x90f8('0x2'));var BPromise=require('bluebird');var rs=require(_0x90f8('0x3'));var fs=require('fs');var Redis=require(_0x90f8('0x4'));var db=require(_0x90f8('0x5'))['db'];var utils=require(_0x90f8('0x6'));var logger=require('../../config/logger')(_0x90f8('0x7'));var config=require(_0x90f8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x90f8('0x9')][_0x90f8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4457fb,_0x192b06,_0x240086){return new BPromise(function(_0x4424d1,_0x6dabde){return client[_0x90f8('0xb')](_0x4457fb,_0x240086)[_0x90f8('0xc')](function(_0x3cebe0){logger[_0x90f8('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x192b06,'request\x20sent');logger[_0x90f8('0xe')](_0x90f8('0xf'),_0x192b06,_0x90f8('0x10'),JSON[_0x90f8('0x11')](_0x3cebe0));if(_0x3cebe0[_0x90f8('0x12')]){if(_0x3cebe0[_0x90f8('0x12')]['code']===0x1f4){logger[_0x90f8('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x192b06,_0x3cebe0['error'][_0x90f8('0x13')]);return _0x6dabde(_0x3cebe0[_0x90f8('0x12')]['message']);}logger[_0x90f8('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x192b06,_0x3cebe0[_0x90f8('0x12')][_0x90f8('0x13')]);return _0x4424d1(_0x3cebe0[_0x90f8('0x12')][_0x90f8('0x13')]);}else{logger['info'](_0x90f8('0x14'),_0x192b06,_0x90f8('0x10'));_0x4424d1(_0x3cebe0[_0x90f8('0x15')][_0x90f8('0x13')]);}})['catch'](function(_0x2fa060){logger[_0x90f8('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x192b06,_0x2fa060);_0x6dabde(_0x2fa060);});});}
\ No newline at end of file
+var _0xe548=['then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../config/environment','client','request'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xe548,0x184));var _0x8e54=function(_0x35b195,_0x8893d5){_0x35b195=_0x35b195-0x0;var _0x2433bf=_0xe548[_0x35b195];return _0x2433bf;};'use strict';var _=require(_0x8e54('0x0'));var util=require(_0x8e54('0x1'));var moment=require(_0x8e54('0x2'));var BPromise=require(_0x8e54('0x3'));var rs=require(_0x8e54('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8e54('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x8e54('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc6281c,_0x2aa209,_0x148c1f){return new BPromise(function(_0x3d6444,_0x270ef1){return client[_0x8e54('0x7')](_0xc6281c,_0x148c1f)[_0x8e54('0x8')](function(_0x5b4913){logger[_0x8e54('0x9')](_0x8e54('0xa'),_0x2aa209,_0x8e54('0xb'));logger[_0x8e54('0xc')](_0x8e54('0xd'),_0x2aa209,'request\x20sent',JSON[_0x8e54('0xe')](_0x5b4913));if(_0x5b4913[_0x8e54('0xf')]){if(_0x5b4913['error']['code']===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x2aa209,_0x5b4913[_0x8e54('0xf')][_0x8e54('0x10')]);return _0x270ef1(_0x5b4913[_0x8e54('0xf')]['message']);}logger[_0x8e54('0xf')](_0x8e54('0xa'),_0x2aa209,_0x5b4913['error']['message']);return _0x3d6444(_0x5b4913[_0x8e54('0xf')]['message']);}else{logger[_0x8e54('0x9')]('SmsTransferReport,\x20%s,\x20%s',_0x2aa209,'request\x20sent');_0x3d6444(_0x5b4913[_0x8e54('0x11')][_0x8e54('0x10')]);}})['catch'](function(_0x45896b){logger[_0x8e54('0xf')](_0x8e54('0xa'),_0x2aa209,_0x45896b);_0x270ef1(_0x45896b);});});}
\ No newline at end of file
index ce085f8..6ada5fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfab3=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','index','/:id','isAuthenticated','/:id/download','download','root','server/files/sounds/original/','originalname','now','extname','post','file','create','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x1c2558,_0x5753be){var _0x527cfb=function(_0x9c5ba2){while(--_0x9c5ba2){_0x1c2558['push'](_0x1c2558['shift']());}};_0x527cfb(++_0x5753be);}(_0xfab3,0x101));var _0x3fab=function(_0x21ce98,_0x436b58){_0x21ce98=_0x21ce98-0x0;var _0x2b3e63=_0xfab3[_0x21ce98];return _0x2b3e63;};'use strict';var multer=require(_0x3fab('0x0'));var util=require('util');var path=require(_0x3fab('0x1'));var timeout=require(_0x3fab('0x2'));var express=require('express');var router=express[_0x3fab('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3fab('0x4'));var interaction=require(_0x3fab('0x5'));var config=require(_0x3fab('0x6'));var controller=require(_0x3fab('0x7'));router[_0x3fab('0x8')]('/',auth['isAuthenticated'](),controller[_0x3fab('0x9')]);router['get'](_0x3fab('0xa'),auth[_0x3fab('0xb')](),controller['show']);router[_0x3fab('0x8')](_0x3fab('0xc'),auth[_0x3fab('0xb')](),controller[_0x3fab('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x564879,_0x46127d,_0x1fcda2){_0x1fcda2(null,path['join'](config[_0x3fab('0xe')],_0x3fab('0xf')));},'filename':function(_0x524006,_0x28324c,_0x4c3d2e){_0x28324c[_0x3fab('0x10')]=_0x28324c[_0x3fab('0x10')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4c3d2e(null,util['format']('%s-%s%s',path['basename'](_0x28324c[_0x3fab('0x10')],path['extname'](_0x28324c[_0x3fab('0x10')])),Date[_0x3fab('0x11')](),path[_0x3fab('0x12')](_0x28324c[_0x3fab('0x10')])));}})});router[_0x3fab('0x13')]('/',upload['single'](_0x3fab('0x14')),controller[_0x3fab('0x15')]);router[_0x3fab('0x16')](_0x3fab('0xa'),auth[_0x3fab('0xb')](),controller[_0x3fab('0x17')]);router[_0x3fab('0x18')](_0x3fab('0xa'),auth['isAuthenticated'](),controller[_0x3fab('0x18')]);module[_0x3fab('0x19')]=router;
\ No newline at end of file
+var _0x3c08=['now','extname','post','single','put','delete','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','diskStorage','join','root','server/files/sounds/original/','originalname','format','%s-%s%s','basename'];(function(_0x1f7467,_0x29d5f7){var _0x5c6fed=function(_0x4bb9e5){while(--_0x4bb9e5){_0x1f7467['push'](_0x1f7467['shift']());}};_0x5c6fed(++_0x29d5f7);}(_0x3c08,0xd7));var _0x83c0=function(_0x59ca11,_0x46303a){_0x59ca11=_0x59ca11-0x0;var _0x21bc5f=_0x3c08[_0x59ca11];return _0x21bc5f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x83c0('0x0'));var timeout=require(_0x83c0('0x1'));var express=require(_0x83c0('0x2'));var router=express['Router']();var fs_extra=require(_0x83c0('0x3'));var auth=require(_0x83c0('0x4'));var interaction=require(_0x83c0('0x5'));var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth[_0x83c0('0x6')](),controller[_0x83c0('0x7')]);router[_0x83c0('0x8')](_0x83c0('0x9'),auth['isAuthenticated'](),controller[_0x83c0('0xa')]);router[_0x83c0('0x8')]('/:id/download',auth[_0x83c0('0x6')](),controller['download']);var upload=multer({'storage':multer[_0x83c0('0xb')]({'destination':function(_0x12b3b3,_0x17ed7f,_0x1469de){_0x1469de(null,path[_0x83c0('0xc')](config[_0x83c0('0xd')],_0x83c0('0xe')));},'filename':function(_0x5ee9d8,_0x2a0000,_0x4cccdc){_0x2a0000[_0x83c0('0xf')]=_0x2a0000[_0x83c0('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4cccdc(null,util[_0x83c0('0x10')](_0x83c0('0x11'),path[_0x83c0('0x12')](_0x2a0000['originalname'],path['extname'](_0x2a0000['originalname'])),Date[_0x83c0('0x13')](),path[_0x83c0('0x14')](_0x2a0000[_0x83c0('0xf')])));}})});router[_0x83c0('0x15')]('/',upload[_0x83c0('0x16')]('file'),controller['create']);router[_0x83c0('0x17')]('/:id',auth[_0x83c0('0x6')](),controller['update']);router['delete'](_0x83c0('0x9'),auth[_0x83c0('0x6')](),controller[_0x83c0('0x18')]);module[_0x83c0('0x19')]=router;
\ No newline at end of file
index 5e5b263..62d23b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19cd=['name','FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x463bda,_0x511490){var _0x4c67de=function(_0x608a88){while(--_0x608a88){_0x463bda['push'](_0x463bda['shift']());}};_0x4c67de(++_0x511490);}(_0x19cd,0xbe));var _0xd19c=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0x19cd[_0x411017];return _0x2adeea;};'use strict';var Sequelize=require(_0xd19c('0x0'));module['exports']={'name':{'type':Sequelize[_0xd19c('0x1')],'unique':_0xd19c('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xd19c('0x1')]},'display_name':{'type':Sequelize[_0xd19c('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xd19c('0x1')]},'original_duration':{'type':Sequelize[_0xd19c('0x3')]},'original_sampleCount':{'type':Sequelize[_0xd19c('0x4')]},'original_channelCount':{'type':Sequelize[_0xd19c('0x5')]},'original_bitRate':{'type':Sequelize[_0xd19c('0x4')]},'original_sampleRate':{'type':Sequelize[_0xd19c('0x5')]},'converted_format':{'type':Sequelize[_0xd19c('0x1')]},'converted_duration':{'type':Sequelize[_0xd19c('0x3')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0xd19c('0x5')]},'converted_bitRate':{'type':Sequelize[_0xd19c('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x913c=['INTEGER','BIGINT','exports','name','STRING','FLOAT'];(function(_0x4732b3,_0xb288de){var _0x567158=function(_0x2e138d){while(--_0x2e138d){_0x4732b3['push'](_0x4732b3['shift']());}};_0x567158(++_0xb288de);}(_0x913c,0x1a0));var _0xc913=function(_0x49bb06,_0x54e1f0){_0x49bb06=_0x49bb06-0x0;var _0x3b330c=_0x913c[_0x49bb06];return _0x3b330c;};'use strict';var Sequelize=require('sequelize');module[_0xc913('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xc913('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xc913('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xc913('0x2')]},'original_format':{'type':Sequelize[_0xc913('0x2')]},'original_duration':{'type':Sequelize[_0xc913('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xc913('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xc913('0x4')]},'converted_format':{'type':Sequelize[_0xc913('0x2')]},'converted_duration':{'type':Sequelize[_0xc913('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xc913('0x5')]},'converted_channelCount':{'type':Sequelize[_0xc913('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xc913('0x4')]}};
\ No newline at end of file
index 115e8c6..7e3e737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d44=['to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','json','apply','save','update','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','keys','length','find','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','wav','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_bitRate','bitRate','converted_sampleRate','0777','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','start','description','delete','original_format','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x3d44,0x75));var _0x43d4=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x3d44[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x43d4('0x0'));var zipdir=require(_0x43d4('0x1'));var jsonpatch=require(_0x43d4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43d4('0x3'));var Mustache=require(_0x43d4('0x4'));var util=require(_0x43d4('0x5'));var path=require(_0x43d4('0x6'));var sox=require(_0x43d4('0x7'));var csv=require(_0x43d4('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43d4('0x9'));var _=require(_0x43d4('0xa'));var squel=require('squel');var crypto=require(_0x43d4('0xb'));var jsforce=require(_0x43d4('0xc'));var deskjs=require(_0x43d4('0xd'));var toCsv=require(_0x43d4('0x8'));var querystring=require(_0x43d4('0xe'));var Papa=require(_0x43d4('0xf'));var Redis=require('ioredis');var authService=require(_0x43d4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x43d4('0x11'));var hardwareService=require(_0x43d4('0x12'));var logger=require(_0x43d4('0x13'))(_0x43d4('0x14'));var utils=require(_0x43d4('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x43d4('0x16'))['db'];function respondWithStatusCode(_0x315440,_0x3aa1e8){_0x3aa1e8=_0x3aa1e8||0xcc;return function(_0x5eedbf){if(_0x5eedbf){return _0x315440[_0x43d4('0x17')](_0x3aa1e8);}return _0x315440[_0x43d4('0x18')](_0x3aa1e8)[_0x43d4('0x19')]();};}function respondWithResult(_0x35dc46,_0x21451c){_0x21451c=_0x21451c||0xc8;return function(_0x1ceb59){if(_0x1ceb59){return _0x35dc46[_0x43d4('0x18')](_0x21451c)['json'](_0x1ceb59);}};}function respondWithFilteredResult(_0x144cbf,_0x3ba016){return function(_0x4358aa){if(_0x4358aa){var _0x9f2e8f=typeof _0x3ba016[_0x43d4('0x1a')]===_0x43d4('0x1b')&&typeof _0x3ba016[_0x43d4('0x1c')]===_0x43d4('0x1b');var _0x125067=_0x4358aa['count'];var _0x27e835=_0x9f2e8f?0x0:_0x3ba016['offset'];var _0x48ccf0=_0x9f2e8f?_0x4358aa['count']:_0x3ba016[_0x43d4('0x1a')]+_0x3ba016[_0x43d4('0x1c')];var _0x277841;if(_0x48ccf0>=_0x125067){_0x48ccf0=_0x125067;_0x277841=0xc8;}else{_0x277841=0xce;}_0x144cbf[_0x43d4('0x18')](_0x277841);return _0x144cbf[_0x43d4('0x1d')]('Content-Range',_0x27e835+'-'+_0x48ccf0+'/'+_0x125067)[_0x43d4('0x1e')](_0x4358aa);}return null;};}function patchUpdates(_0x5c0371){return function(_0x194504){try{jsonpatch[_0x43d4('0x1f')](_0x194504,_0x5c0371,!![]);}catch(_0x2797a1){return BPromise['reject'](_0x2797a1);}return _0x194504[_0x43d4('0x20')]();};}function saveUpdates(_0x168de3,_0x3028d7){return function(_0x3be494){if(_0x3be494){return _0x3be494[_0x43d4('0x21')](_0x168de3)[_0x43d4('0x22')](function(_0x57e2cd){return _0x57e2cd;});}return null;};}function removeEntity(_0x2c3ac4,_0x89bee4){return function(_0x55c539){if(_0x55c539){return _0x55c539[_0x43d4('0x23')]()[_0x43d4('0x22')](function(){var _0x87ae36=_0x55c539['get']({'plain':!![]});var _0x4366d6=_0x43d4('0x24');return db[_0x43d4('0x25')][_0x43d4('0x23')]({'where':{'type':_0x4366d6,'resourceId':_0x87ae36['id']}})['then'](function(){return _0x55c539;});})['then'](function(){_0x2c3ac4['status'](0xcc)[_0x43d4('0x19')]();});}};}function handleEntityNotFound(_0x408f50,_0x3198b2){return function(_0x142f7f){if(!_0x142f7f){_0x408f50[_0x43d4('0x17')](0x194);}return _0x142f7f;};}function handleError(_0x103a7b,_0x384e7d){_0x384e7d=_0x384e7d||0x1f4;return function(_0x4b0995){logger[_0x43d4('0x26')](_0x4b0995[_0x43d4('0x27')]);if(_0x4b0995['name']){delete _0x4b0995[_0x43d4('0x28')];}_0x103a7b[_0x43d4('0x18')](_0x384e7d)[_0x43d4('0x29')](_0x4b0995);};}exports[_0x43d4('0x2a')]=function(_0x3643d7,_0x1c455e){var _0x3b9a14={},_0xd21728={},_0x372e19={'count':0x0,'rows':[]};var _0x3ef910=_[_0x43d4('0x2b')](db[_0x43d4('0x2c')][_0x43d4('0x2d')],function(_0x821a7b){return{'name':_0x821a7b[_0x43d4('0x2e')],'type':_0x821a7b[_0x43d4('0x2f')][_0x43d4('0x30')]};});_0xd21728[_0x43d4('0x31')]=_[_0x43d4('0x2b')](_0x3ef910,_0x43d4('0x28'));_0xd21728[_0x43d4('0x32')]=_['keys'](_0x3643d7[_0x43d4('0x32')]);_0xd21728[_0x43d4('0x33')]=_[_0x43d4('0x34')](_0xd21728[_0x43d4('0x31')],_0xd21728['query']);_0x3b9a14[_0x43d4('0x35')]=_['intersection'](_0xd21728[_0x43d4('0x31')],qs[_0x43d4('0x36')](_0x3643d7[_0x43d4('0x32')]['fields']));_0x3b9a14[_0x43d4('0x35')]=_0x3b9a14[_0x43d4('0x35')]['length']?_0x3b9a14['attributes']:_0xd21728['model'];if(!_0x3643d7[_0x43d4('0x32')]['hasOwnProperty'](_0x43d4('0x37'))){_0x3b9a14['limit']=qs['limit'](_0x3643d7[_0x43d4('0x32')][_0x43d4('0x1c')]);_0x3b9a14[_0x43d4('0x1a')]=qs[_0x43d4('0x1a')](_0x3643d7['query'][_0x43d4('0x1a')]);}_0x3b9a14[_0x43d4('0x38')]=qs['sort'](_0x3643d7[_0x43d4('0x32')][_0x43d4('0x39')]);_0x3b9a14[_0x43d4('0x3a')]=qs[_0x43d4('0x33')](_[_0x43d4('0x3b')](_0x3643d7[_0x43d4('0x32')],_0xd21728['filters']),_0x3ef910);if(_0x3643d7[_0x43d4('0x32')][_0x43d4('0x3c')]){_0x3b9a14['where']=_[_0x43d4('0x3d')](_0x3b9a14[_0x43d4('0x3a')],{'$or':_[_0x43d4('0x2b')](_0x3ef910,function(_0x89c9ae){if(_0x89c9ae[_0x43d4('0x2f')]!==_0x43d4('0x3e')){var _0xd5e26b={};_0xd5e26b[_0x89c9ae['name']]={'$like':'%'+_0x3643d7['query'][_0x43d4('0x3c')]+'%'};return _0xd5e26b;}})});}_0x3b9a14=_[_0x43d4('0x3d')]({},_0x3b9a14,_0x3643d7['options']);var _0x5b6253={'where':_0x3b9a14[_0x43d4('0x3a')]};return db['Sound']['count'](_0x5b6253)[_0x43d4('0x22')](function(_0x41494d){_0x372e19[_0x43d4('0x3f')]=_0x41494d;if(_0x3643d7[_0x43d4('0x32')][_0x43d4('0x40')]){_0x3b9a14[_0x43d4('0x41')]=[{'all':!![]}];}return db[_0x43d4('0x2c')][_0x43d4('0x42')](_0x3b9a14);})['then'](function(_0x208c17){_0x372e19[_0x43d4('0x43')]=_0x208c17;return _0x372e19;})[_0x43d4('0x22')](respondWithFilteredResult(_0x1c455e,_0x3b9a14))[_0x43d4('0x44')](handleError(_0x1c455e,null));};exports[_0x43d4('0x45')]=function(_0x34bd7d,_0x41a283){var _0x330320={'raw':!![],'where':{'id':_0x34bd7d[_0x43d4('0x46')]['id']}},_0x596d6f={};_0x596d6f[_0x43d4('0x31')]=_[_0x43d4('0x47')](db[_0x43d4('0x2c')][_0x43d4('0x2d')]);_0x596d6f[_0x43d4('0x32')]=_['keys'](_0x34bd7d[_0x43d4('0x32')]);_0x596d6f[_0x43d4('0x33')]=_[_0x43d4('0x34')](_0x596d6f['model'],_0x596d6f[_0x43d4('0x32')]);_0x330320[_0x43d4('0x35')]=_[_0x43d4('0x34')](_0x596d6f[_0x43d4('0x31')],qs[_0x43d4('0x36')](_0x34bd7d[_0x43d4('0x32')][_0x43d4('0x36')]));_0x330320['attributes']=_0x330320['attributes'][_0x43d4('0x48')]?_0x330320['attributes']:_0x596d6f[_0x43d4('0x31')];if(_0x34bd7d['query']['includeAll']){_0x330320[_0x43d4('0x41')]=[{'all':!![]}];}_0x330320=_['merge']({},_0x330320,_0x34bd7d['options']);return db[_0x43d4('0x2c')][_0x43d4('0x49')](_0x330320)[_0x43d4('0x22')](handleEntityNotFound(_0x41a283,null))['then'](respondWithResult(_0x41a283,null))[_0x43d4('0x44')](handleError(_0x41a283,null));};exports[_0x43d4('0x4a')]=function(_0x437419,_0x25e1ea,_0x31a714){return db[_0x43d4('0x2c')][_0x43d4('0x49')]({'where':{'id':_0x437419['params']['id']},'attributes':['name',_0x43d4('0x4b'),_0x43d4('0x4c')],'raw':!![]})[_0x43d4('0x22')](handleEntityNotFound(_0x25e1ea,null))[_0x43d4('0x22')](function(_0x1f8ee5){if(_0x1f8ee5){if(!fs[_0x43d4('0x4d')](path[_0x43d4('0x4e')](config[_0x43d4('0x4f')],_0x43d4('0x50'),_0x1f8ee5['save_name']+'.'+_0x1f8ee5[_0x43d4('0x4c')]))){throw new db['Sequelize'][(_0x43d4('0x51'))](_0x43d4('0x52'));}return _0x25e1ea[_0x43d4('0x4a')](path[_0x43d4('0x4e')](config[_0x43d4('0x4f')],_0x43d4('0x50'),util[_0x43d4('0x53')](_0x43d4('0x54'),_0x1f8ee5['save_name'],_0x1f8ee5[_0x43d4('0x4c')])),util['format']('%s.%s',_0x1f8ee5[_0x43d4('0x28')],_0x1f8ee5['converted_format']));}return null;})[_0x43d4('0x44')](handleError(_0x25e1ea,null));};exports[_0x43d4('0x55')]=function(_0x59b0e0,_0x39f5cf,_0x41e1d8){var _0x1ef931={'name':path[_0x43d4('0x56')](_0x59b0e0[_0x43d4('0x57')][_0x43d4('0x58')],path['extname'](_0x59b0e0[_0x43d4('0x57')][_0x43d4('0x58')])),'save_name':path[_0x43d4('0x56')](_0x59b0e0[_0x43d4('0x57')]['filename'],path[_0x43d4('0x59')](_0x59b0e0[_0x43d4('0x57')][_0x43d4('0x5a')])),'original_format':path[_0x43d4('0x59')](_0x59b0e0[_0x43d4('0x57')][_0x43d4('0x58')])[_0x43d4('0x5b')](0x1),'converted_format':'wav'};var _0x46f716=path[_0x43d4('0x4e')](config[_0x43d4('0x4f')],_0x43d4('0x5c'),_0x59b0e0[_0x43d4('0x57')]['filename']);var _0x16da5c=path[_0x43d4('0x4e')](config['root'],_0x43d4('0x50'),util[_0x43d4('0x53')](_0x43d4('0x54'),path[_0x43d4('0x56')](_0x59b0e0[_0x43d4('0x57')][_0x43d4('0x5a')],path[_0x43d4('0x59')](_0x59b0e0[_0x43d4('0x57')]['filename'])),_0x1ef931[_0x43d4('0x4c')]));logger[_0x43d4('0x5d')](_0x43d4('0x5e'),_0x46f716);logger['info'](_0x43d4('0x5f'),_0x16da5c);try{fs[_0x43d4('0x60')](_0x46f716,parseInt('0777',0x8));var _0x53d0f7=sox[_0x43d4('0x61')](_0x46f716,_0x16da5c,{'sampleRate':0x1f40,'format':_0x43d4('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x53d0f7['on'](_0x43d4('0x26'),function(_0x5de5cc){fs['unlinkSync'](_0x46f716);_0x39f5cf[_0x43d4('0x18')](0x1f4)['send'](_0x5de5cc);});_0x53d0f7['on'](_0x43d4('0x63'),function(_0x4ae99d){_0x1ef931['original_duration']=isNaN(_0x4ae99d[_0x43d4('0x64')])?null:_0x4ae99d[_0x43d4('0x64')]*0x3e8;_0x1ef931[_0x43d4('0x65')]=isNaN(_0x4ae99d[_0x43d4('0x66')])?null:_0x4ae99d['sampleCount'];_0x1ef931[_0x43d4('0x67')]=isNaN(_0x4ae99d[_0x43d4('0x68')])?null:_0x4ae99d[_0x43d4('0x68')];_0x1ef931[_0x43d4('0x69')]=isNaN(_0x4ae99d['bitRate'])?null:_0x4ae99d['bitRate'];_0x1ef931[_0x43d4('0x6a')]=isNaN(_0x4ae99d[_0x43d4('0x6b')])?null:_0x4ae99d[_0x43d4('0x6b')];});_0x53d0f7['on'](_0x43d4('0x6c'),function(_0x13f0eb){_0x1ef931[_0x43d4('0x6d')]=isNaN(_0x13f0eb['duration'])?null:_0x13f0eb[_0x43d4('0x64')]*0x3e8;_0x1ef931['converted_sampleCount']=isNaN(_0x13f0eb[_0x43d4('0x66')])?null:_0x13f0eb['sampleCount'];_0x1ef931['converted_channelCount']=isNaN(_0x13f0eb[_0x43d4('0x68')])?null:_0x13f0eb[_0x43d4('0x68')];_0x1ef931[_0x43d4('0x6e')]=isNaN(_0x13f0eb[_0x43d4('0x6f')])?null:_0x13f0eb['bitRate'];_0x1ef931[_0x43d4('0x70')]=isNaN(_0x13f0eb[_0x43d4('0x6b')])?null:_0x13f0eb[_0x43d4('0x6b')];});_0x53d0f7['on'](_0x43d4('0x19'),function(){fs['chmodSync'](_0x16da5c,parseInt(_0x43d4('0x71'),0x8));return db[_0x43d4('0x2c')][_0x43d4('0x55')](_0x1ef931)[_0x43d4('0x22')](function(_0x5187e9){var _0x4b72fd={'role':_0x59b0e0[_0x43d4('0x72')][_0x43d4('0x73')],'userProfileId':_0x59b0e0[_0x43d4('0x72')]['userProfileId']};if(!_0x4b72fd)throw new Error(_0x43d4('0x74'));if(_0x4b72fd[_0x43d4('0x73')]==='user'){var _0x39b7ec=_0x5187e9[_0x43d4('0x75')]({'plain':!![]});return db[_0x43d4('0x76')][_0x43d4('0x49')]({'where':{'name':_0x43d4('0x24'),'userProfileId':_0x4b72fd['userProfileId']},'raw':!![]})[_0x43d4('0x22')](function(_0x44957b){if(_0x44957b&&_0x44957b[_0x43d4('0x77')]===0x0){return db['UserProfileResource']['create']({'name':_0x39b7ec['name'],'resourceId':_0x39b7ec['id'],'type':_0x44957b['name'],'sectionId':_0x44957b['id']},{})[_0x43d4('0x22')](function(){return _0x5187e9;});}else{return _0x5187e9;}})[_0x43d4('0x44')](function(_0x5d020e){logger[_0x43d4('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d020e);throw _0x5d020e;});}return _0x5187e9;})[_0x43d4('0x22')](respondWithResult(_0x39f5cf,null))['catch'](handleError(_0x39f5cf,null));});_0x53d0f7[_0x43d4('0x78')]();}catch(_0x35f34f){_0x39f5cf[_0x43d4('0x18')](0x1f4)['send'](_0x35f34f);}};exports[_0x43d4('0x21')]=function(_0x21f392,_0x19ded3,_0x14c6ef){return db[_0x43d4('0x2c')][_0x43d4('0x49')]({'where':{'id':_0x21f392[_0x43d4('0x46')]['id']}})[_0x43d4('0x22')](handleEntityNotFound(_0x19ded3,null))[_0x43d4('0x22')](saveUpdates(_['pick'](_0x21f392[_0x43d4('0x72')],[_0x43d4('0x28'),_0x43d4('0x79')]),null))['then'](respondWithResult(_0x19ded3,null))[_0x43d4('0x44')](handleError(_0x19ded3,null));};exports[_0x43d4('0x7a')]=function(_0x2afa5a,_0x1abde3,_0x322898){return db[_0x43d4('0x2c')]['find']({'where':{'id':_0x2afa5a[_0x43d4('0x46')]['id']}})['then'](function(_0x19de6e){if(_0x19de6e){return _0x19de6e[_0x43d4('0x23')]();}})['then'](function(_0x3fc7a5){var _0x345429=path[_0x43d4('0x4e')](config[_0x43d4('0x4f')],_0x43d4('0x5c'),util[_0x43d4('0x53')]('%s.%s',_0x3fc7a5[_0x43d4('0x4b')],_0x3fc7a5[_0x43d4('0x7b')]));var _0x25fa33=path[_0x43d4('0x4e')](config['root'],'server/files/sounds/converted',util['format'](_0x43d4('0x54'),_0x3fc7a5['save_name'],_0x3fc7a5[_0x43d4('0x4c')]));fs[_0x43d4('0x7c')](_0x345429);fs[_0x43d4('0x7c')](_0x25fa33);return _0x3fc7a5;})[_0x43d4('0x22')](function(_0xbf252b){if(_0xbf252b){return _0x1abde3[_0x43d4('0x18')](0xcc)[_0x43d4('0x19')]();}})['then'](handleEntityNotFound(_0x1abde3,null))['catch'](handleError(_0x1abde3,null));};
\ No newline at end of file
+var _0x55b0=['options','includeAll','include','rows','catch','show','keys','length','find','download','params','converted_format','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','Sound\x20not\x20found','format','%s.%s','create','basename','extname','file','originalname','filename','substring','wav','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','original_duration','duration','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','0777','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','Sounds','then','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x1dec93,_0x25781b){var _0x255250=function(_0x2563b6){while(--_0x2563b6){_0x1dec93['push'](_0x1dec93['shift']());}};_0x255250(++_0x25781b);}(_0x55b0,0x137));var _0x055b=function(_0x3f2d34,_0x57d7a){_0x3f2d34=_0x3f2d34-0x0;var _0x115f68=_0x55b0[_0x3f2d34];return _0x115f68;};'use strict';var emlformat=require(_0x055b('0x0'));var rimraf=require(_0x055b('0x1'));var zipdir=require(_0x055b('0x2'));var jsonpatch=require(_0x055b('0x3'));var rp=require(_0x055b('0x4'));var moment=require(_0x055b('0x5'));var BPromise=require(_0x055b('0x6'));var Mustache=require(_0x055b('0x7'));var util=require(_0x055b('0x8'));var path=require(_0x055b('0x9'));var sox=require(_0x055b('0xa'));var csv=require(_0x055b('0xb'));var ejs=require(_0x055b('0xc'));var fs=require('fs');var fs_extra=require(_0x055b('0xd'));var _=require(_0x055b('0xe'));var squel=require(_0x055b('0xf'));var crypto=require(_0x055b('0x10'));var jsforce=require('jsforce');var deskjs=require(_0x055b('0x11'));var toCsv=require(_0x055b('0xb'));var querystring=require(_0x055b('0x12'));var Papa=require(_0x055b('0x13'));var Redis=require(_0x055b('0x14'));var authService=require(_0x055b('0x15'));var qs=require(_0x055b('0x16'));var as=require(_0x055b('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x055b('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x055b('0x19'));var db=require(_0x055b('0x1a'))['db'];function respondWithStatusCode(_0x2ef940,_0x5c0543){_0x5c0543=_0x5c0543||0xcc;return function(_0x1e20b2){if(_0x1e20b2){return _0x2ef940[_0x055b('0x1b')](_0x5c0543);}return _0x2ef940[_0x055b('0x1c')](_0x5c0543)[_0x055b('0x1d')]();};}function respondWithResult(_0x25c307,_0x2c8293){_0x2c8293=_0x2c8293||0xc8;return function(_0x34ecea){if(_0x34ecea){return _0x25c307[_0x055b('0x1c')](_0x2c8293)[_0x055b('0x1e')](_0x34ecea);}};}function respondWithFilteredResult(_0x2232ce,_0x5745ba){return function(_0x1b2049){if(_0x1b2049){var _0x27cf61=typeof _0x5745ba[_0x055b('0x1f')]===_0x055b('0x20')&&typeof _0x5745ba[_0x055b('0x21')]===_0x055b('0x20');var _0x1b9798=_0x1b2049[_0x055b('0x22')];var _0x42d72c=_0x27cf61?0x0:_0x5745ba['offset'];var _0xed9896=_0x27cf61?_0x1b2049[_0x055b('0x22')]:_0x5745ba[_0x055b('0x1f')]+_0x5745ba['limit'];var _0x126ef5;if(_0xed9896>=_0x1b9798){_0xed9896=_0x1b9798;_0x126ef5=0xc8;}else{_0x126ef5=0xce;}_0x2232ce[_0x055b('0x1c')](_0x126ef5);return _0x2232ce[_0x055b('0x23')](_0x055b('0x24'),_0x42d72c+'-'+_0xed9896+'/'+_0x1b9798)[_0x055b('0x1e')](_0x1b2049);}return null;};}function patchUpdates(_0x35ce30){return function(_0x3c441a){try{jsonpatch[_0x055b('0x25')](_0x3c441a,_0x35ce30,!![]);}catch(_0x5e0316){return BPromise[_0x055b('0x26')](_0x5e0316);}return _0x3c441a[_0x055b('0x27')]();};}function saveUpdates(_0x8576d6,_0x550300){return function(_0x5269d0){if(_0x5269d0){return _0x5269d0[_0x055b('0x28')](_0x8576d6)['then'](function(_0x1a1e0e){return _0x1a1e0e;});}return null;};}function removeEntity(_0x1b3eaa,_0x365ff6){return function(_0xcefffb){if(_0xcefffb){return _0xcefffb[_0x055b('0x29')]()['then'](function(){var _0x1d8d52=_0xcefffb[_0x055b('0x2a')]({'plain':!![]});var _0xe448bf=_0x055b('0x2b');return db['UserProfileResource'][_0x055b('0x29')]({'where':{'type':_0xe448bf,'resourceId':_0x1d8d52['id']}})['then'](function(){return _0xcefffb;});})[_0x055b('0x2c')](function(){_0x1b3eaa[_0x055b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2476c0,_0x3ea377){return function(_0x319818){if(!_0x319818){_0x2476c0[_0x055b('0x1b')](0x194);}return _0x319818;};}function handleError(_0x33a6f6,_0x5777c2){_0x5777c2=_0x5777c2||0x1f4;return function(_0x17a1b7){logger[_0x055b('0x2d')](_0x17a1b7[_0x055b('0x2e')]);if(_0x17a1b7[_0x055b('0x2f')]){delete _0x17a1b7[_0x055b('0x2f')];}_0x33a6f6['status'](_0x5777c2)[_0x055b('0x30')](_0x17a1b7);};}exports[_0x055b('0x31')]=function(_0x4a4d89,_0x505021){var _0x34aca6={},_0x36b9b1={},_0x27897b={'count':0x0,'rows':[]};var _0x3d77b7=_[_0x055b('0x32')](db[_0x055b('0x33')][_0x055b('0x34')],function(_0xf9e317){return{'name':_0xf9e317[_0x055b('0x35')],'type':_0xf9e317[_0x055b('0x36')][_0x055b('0x37')]};});_0x36b9b1[_0x055b('0x38')]=_[_0x055b('0x32')](_0x3d77b7,_0x055b('0x2f'));_0x36b9b1['query']=_['keys'](_0x4a4d89[_0x055b('0x39')]);_0x36b9b1[_0x055b('0x3a')]=_[_0x055b('0x3b')](_0x36b9b1['model'],_0x36b9b1[_0x055b('0x39')]);_0x34aca6['attributes']=_[_0x055b('0x3b')](_0x36b9b1['model'],qs[_0x055b('0x3c')](_0x4a4d89[_0x055b('0x39')]['fields']));_0x34aca6[_0x055b('0x3d')]=_0x34aca6['attributes']['length']?_0x34aca6[_0x055b('0x3d')]:_0x36b9b1[_0x055b('0x38')];if(!_0x4a4d89[_0x055b('0x39')][_0x055b('0x3e')](_0x055b('0x3f'))){_0x34aca6[_0x055b('0x21')]=qs['limit'](_0x4a4d89[_0x055b('0x39')][_0x055b('0x21')]);_0x34aca6['offset']=qs[_0x055b('0x1f')](_0x4a4d89[_0x055b('0x39')][_0x055b('0x1f')]);}_0x34aca6[_0x055b('0x40')]=qs['sort'](_0x4a4d89[_0x055b('0x39')][_0x055b('0x41')]);_0x34aca6[_0x055b('0x42')]=qs[_0x055b('0x3a')](_[_0x055b('0x43')](_0x4a4d89[_0x055b('0x39')],_0x36b9b1['filters']),_0x3d77b7);if(_0x4a4d89[_0x055b('0x39')]['filter']){_0x34aca6['where']=_[_0x055b('0x44')](_0x34aca6[_0x055b('0x42')],{'$or':_[_0x055b('0x32')](_0x3d77b7,function(_0x489498){if(_0x489498[_0x055b('0x36')]!==_0x055b('0x45')){var _0x498eee={};_0x498eee[_0x489498[_0x055b('0x2f')]]={'$like':'%'+_0x4a4d89[_0x055b('0x39')]['filter']+'%'};return _0x498eee;}})});}_0x34aca6=_[_0x055b('0x44')]({},_0x34aca6,_0x4a4d89[_0x055b('0x46')]);var _0x24e2c7={'where':_0x34aca6[_0x055b('0x42')]};return db[_0x055b('0x33')][_0x055b('0x22')](_0x24e2c7)[_0x055b('0x2c')](function(_0x14db88){_0x27897b[_0x055b('0x22')]=_0x14db88;if(_0x4a4d89[_0x055b('0x39')][_0x055b('0x47')]){_0x34aca6[_0x055b('0x48')]=[{'all':!![]}];}return db[_0x055b('0x33')]['findAll'](_0x34aca6);})[_0x055b('0x2c')](function(_0x55897c){_0x27897b[_0x055b('0x49')]=_0x55897c;return _0x27897b;})[_0x055b('0x2c')](respondWithFilteredResult(_0x505021,_0x34aca6))[_0x055b('0x4a')](handleError(_0x505021,null));};exports[_0x055b('0x4b')]=function(_0x15e39c,_0x3b52ee){var _0x18b0d7={'raw':!![],'where':{'id':_0x15e39c['params']['id']}},_0x3a6dec={};_0x3a6dec['model']=_[_0x055b('0x4c')](db[_0x055b('0x33')][_0x055b('0x34')]);_0x3a6dec[_0x055b('0x39')]=_[_0x055b('0x4c')](_0x15e39c['query']);_0x3a6dec[_0x055b('0x3a')]=_['intersection'](_0x3a6dec[_0x055b('0x38')],_0x3a6dec[_0x055b('0x39')]);_0x18b0d7['attributes']=_[_0x055b('0x3b')](_0x3a6dec[_0x055b('0x38')],qs[_0x055b('0x3c')](_0x15e39c[_0x055b('0x39')][_0x055b('0x3c')]));_0x18b0d7[_0x055b('0x3d')]=_0x18b0d7[_0x055b('0x3d')][_0x055b('0x4d')]?_0x18b0d7[_0x055b('0x3d')]:_0x3a6dec[_0x055b('0x38')];if(_0x15e39c[_0x055b('0x39')][_0x055b('0x47')]){_0x18b0d7['include']=[{'all':!![]}];}_0x18b0d7=_[_0x055b('0x44')]({},_0x18b0d7,_0x15e39c['options']);return db['Sound'][_0x055b('0x4e')](_0x18b0d7)[_0x055b('0x2c')](handleEntityNotFound(_0x3b52ee,null))['then'](respondWithResult(_0x3b52ee,null))[_0x055b('0x4a')](handleError(_0x3b52ee,null));};exports[_0x055b('0x4f')]=function(_0x134894,_0x332df1,_0x535e3b){return db[_0x055b('0x33')][_0x055b('0x4e')]({'where':{'id':_0x134894[_0x055b('0x50')]['id']},'attributes':['name','save_name',_0x055b('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x332df1,null))[_0x055b('0x2c')](function(_0x257830){if(_0x257830){if(!fs[_0x055b('0x52')](path[_0x055b('0x53')](config[_0x055b('0x54')],_0x055b('0x55'),_0x257830[_0x055b('0x56')]+'.'+_0x257830[_0x055b('0x51')]))){throw new db[(_0x055b('0x57'))]['ValidationError'](_0x055b('0x58'));}return _0x332df1['download'](path[_0x055b('0x53')](config[_0x055b('0x54')],'server/files/sounds/converted',util[_0x055b('0x59')]('%s.%s',_0x257830['save_name'],_0x257830[_0x055b('0x51')])),util[_0x055b('0x59')](_0x055b('0x5a'),_0x257830[_0x055b('0x2f')],_0x257830[_0x055b('0x51')]));}return null;})['catch'](handleError(_0x332df1,null));};exports[_0x055b('0x5b')]=function(_0x4f7589,_0x7658d3,_0x412717){var _0x42621a={'name':path[_0x055b('0x5c')](_0x4f7589['file']['originalname'],path[_0x055b('0x5d')](_0x4f7589[_0x055b('0x5e')][_0x055b('0x5f')])),'save_name':path[_0x055b('0x5c')](_0x4f7589[_0x055b('0x5e')][_0x055b('0x60')],path[_0x055b('0x5d')](_0x4f7589[_0x055b('0x5e')]['filename'])),'original_format':path[_0x055b('0x5d')](_0x4f7589[_0x055b('0x5e')][_0x055b('0x5f')])[_0x055b('0x61')](0x1),'converted_format':_0x055b('0x62')};var _0x609e5c=path[_0x055b('0x53')](config[_0x055b('0x54')],'server/files/sounds/original',_0x4f7589[_0x055b('0x5e')][_0x055b('0x60')]);var _0xd08fac=path['join'](config[_0x055b('0x54')],_0x055b('0x55'),util[_0x055b('0x59')](_0x055b('0x5a'),path[_0x055b('0x5c')](_0x4f7589['file']['filename'],path['extname'](_0x4f7589[_0x055b('0x5e')]['filename'])),_0x42621a[_0x055b('0x51')]));logger['info'](_0x055b('0x63'),_0x609e5c);logger[_0x055b('0x64')](_0x055b('0x65'),_0xd08fac);try{fs[_0x055b('0x66')](_0x609e5c,parseInt('0777',0x8));var _0x100d27=sox[_0x055b('0x67')](_0x609e5c,_0xd08fac,{'sampleRate':0x1f40,'format':_0x055b('0x62'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x100d27['on']('error',function(_0x38b559){fs[_0x055b('0x68')](_0x609e5c);_0x7658d3['status'](0x1f4)[_0x055b('0x30')](_0x38b559);});_0x100d27['on'](_0x055b('0x69'),function(_0x2e4d18){_0x42621a[_0x055b('0x6a')]=isNaN(_0x2e4d18['duration'])?null:_0x2e4d18[_0x055b('0x6b')]*0x3e8;_0x42621a['original_sampleCount']=isNaN(_0x2e4d18[_0x055b('0x6c')])?null:_0x2e4d18[_0x055b('0x6c')];_0x42621a[_0x055b('0x6d')]=isNaN(_0x2e4d18[_0x055b('0x6e')])?null:_0x2e4d18[_0x055b('0x6e')];_0x42621a['original_bitRate']=isNaN(_0x2e4d18[_0x055b('0x6f')])?null:_0x2e4d18['bitRate'];_0x42621a['original_sampleRate']=isNaN(_0x2e4d18[_0x055b('0x70')])?null:_0x2e4d18['sampleRate'];});_0x100d27['on'](_0x055b('0x71'),function(_0x33116a){_0x42621a[_0x055b('0x72')]=isNaN(_0x33116a[_0x055b('0x6b')])?null:_0x33116a[_0x055b('0x6b')]*0x3e8;_0x42621a[_0x055b('0x73')]=isNaN(_0x33116a[_0x055b('0x6c')])?null:_0x33116a[_0x055b('0x6c')];_0x42621a[_0x055b('0x74')]=isNaN(_0x33116a[_0x055b('0x6e')])?null:_0x33116a[_0x055b('0x6e')];_0x42621a['converted_bitRate']=isNaN(_0x33116a[_0x055b('0x6f')])?null:_0x33116a['bitRate'];_0x42621a['converted_sampleRate']=isNaN(_0x33116a['sampleRate'])?null:_0x33116a[_0x055b('0x70')];});_0x100d27['on']('end',function(){fs['chmodSync'](_0xd08fac,parseInt(_0x055b('0x75'),0x8));return db['Sound'][_0x055b('0x5b')](_0x42621a)['then'](function(_0x3d23af){var _0x4ab7f9={'role':_0x4f7589[_0x055b('0x76')]['role'],'userProfileId':_0x4f7589[_0x055b('0x76')]['userProfileId']};if(!_0x4ab7f9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ab7f9[_0x055b('0x77')]===_0x055b('0x78')){var _0x57f08c=_0x3d23af[_0x055b('0x2a')]({'plain':!![]});return db[_0x055b('0x79')][_0x055b('0x4e')]({'where':{'name':_0x055b('0x2b'),'userProfileId':_0x4ab7f9[_0x055b('0x7a')]},'raw':!![]})['then'](function(_0x2b11f6){if(_0x2b11f6&&_0x2b11f6[_0x055b('0x7b')]===0x0){return db['UserProfileResource'][_0x055b('0x5b')]({'name':_0x57f08c['name'],'resourceId':_0x57f08c['id'],'type':_0x2b11f6[_0x055b('0x2f')],'sectionId':_0x2b11f6['id']},{})[_0x055b('0x2c')](function(){return _0x3d23af;});}else{return _0x3d23af;}})['catch'](function(_0x5232c8){logger[_0x055b('0x2d')](_0x055b('0x7c'),_0x5232c8);throw _0x5232c8;});}return _0x3d23af;})['then'](respondWithResult(_0x7658d3,null))[_0x055b('0x4a')](handleError(_0x7658d3,null));});_0x100d27[_0x055b('0x7d')]();}catch(_0x225762){_0x7658d3[_0x055b('0x1c')](0x1f4)['send'](_0x225762);}};exports[_0x055b('0x28')]=function(_0x96810b,_0x325e7d,_0x540f4f){return db[_0x055b('0x33')][_0x055b('0x4e')]({'where':{'id':_0x96810b[_0x055b('0x50')]['id']}})[_0x055b('0x2c')](handleEntityNotFound(_0x325e7d,null))[_0x055b('0x2c')](saveUpdates(_[_0x055b('0x43')](_0x96810b[_0x055b('0x76')],[_0x055b('0x2f'),'description']),null))['then'](respondWithResult(_0x325e7d,null))[_0x055b('0x4a')](handleError(_0x325e7d,null));};exports['delete']=function(_0x5c7a86,_0x3b27b1,_0x466fdf){return db[_0x055b('0x33')]['find']({'where':{'id':_0x5c7a86['params']['id']}})[_0x055b('0x2c')](function(_0x48f693){if(_0x48f693){return _0x48f693['destroy']();}})[_0x055b('0x2c')](function(_0x33d9dd){var _0x28505a=path[_0x055b('0x53')](config['root'],'server/files/sounds/original',util[_0x055b('0x59')](_0x055b('0x5a'),_0x33d9dd['save_name'],_0x33d9dd[_0x055b('0x7e')]));var _0x4cfecf=path['join'](config[_0x055b('0x54')],_0x055b('0x55'),util[_0x055b('0x59')](_0x055b('0x5a'),_0x33d9dd['save_name'],_0x33d9dd[_0x055b('0x51')]));fs[_0x055b('0x68')](_0x28505a);fs[_0x055b('0x68')](_0x4cfecf);return _0x33d9dd;})[_0x055b('0x2c')](function(_0x1f7455){if(_0x1f7455){return _0x3b27b1[_0x055b('0x1c')](0xcc)[_0x055b('0x1d')]();}})[_0x055b('0x2c')](handleEntityNotFound(_0x3b27b1,null))[_0x055b('0x4a')](handleError(_0x3b27b1,null));};
\ No newline at end of file
index 6daedf6..12d1490 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c5a=['tools_sounds','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./sound.attributes','exports','Sound'];(function(_0x1b90e5,_0x949403){var _0xeb8bac=function(_0x2237ac){while(--_0x2237ac){_0x1b90e5['push'](_0x1b90e5['shift']());}};_0xeb8bac(++_0x949403);}(_0x6c5a,0x182));var _0xa6c5=function(_0x4a16d9,_0x4736cf){_0x4a16d9=_0x4a16d9-0x0;var _0xe745fa=_0x6c5a[_0x4a16d9];return _0xe745fa;};'use strict';var _=require(_0xa6c5('0x0'));var util=require('util');var logger=require(_0xa6c5('0x1'))(_0xa6c5('0x2'));var moment=require('moment');var BPromise=require(_0xa6c5('0x3'));var rp=require(_0xa6c5('0x4'));var fs=require('fs');var path=require(_0xa6c5('0x5'));var rimraf=require(_0xa6c5('0x6'));var config=require('../../config/environment');var attributes=require(_0xa6c5('0x7'));module[_0xa6c5('0x8')]=function(_0x1d5757,_0x53c45){return _0x1d5757['define'](_0xa6c5('0x9'),attributes,{'tableName':_0xa6c5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x37c2=['tools_sounds','lodash','util','../../config/logger','api','moment','bluebird','path','exports','Sound'];(function(_0x35d39b,_0x100854){var _0x23e7dd=function(_0x128ba7){while(--_0x128ba7){_0x35d39b['push'](_0x35d39b['shift']());}};_0x23e7dd(++_0x100854);}(_0x37c2,0xbf));var _0x237c=function(_0x5d428d,_0x7fe6eb){_0x5d428d=_0x5d428d-0x0;var _0x5aad90=_0x37c2[_0x5d428d];return _0x5aad90;};'use strict';var _=require(_0x237c('0x0'));var util=require(_0x237c('0x1'));var logger=require(_0x237c('0x2'))(_0x237c('0x3'));var moment=require(_0x237c('0x4'));var BPromise=require(_0x237c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x237c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0x237c('0x7')]=function(_0x5f2df6,_0x695a75){return _0x5f2df6['define'](_0x237c('0x8'),attributes,{'tableName':_0x237c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 428999d..06946ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc1=['request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSound','find','options','attributes','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5c1312,_0x2c54ad){var _0x234b4b=function(_0x54fc52){while(--_0x54fc52){_0x5c1312['push'](_0x5c1312['shift']());}};_0x234b4b(++_0x2c54ad);}(_0x1cc1,0x1e5));var _0x11cc=function(_0xed5236,_0x167f69){_0xed5236=_0xed5236-0x0;var _0x10651c=_0x1cc1[_0xed5236];return _0x10651c;};'use strict';var _=require(_0x11cc('0x0'));var util=require(_0x11cc('0x1'));var moment=require(_0x11cc('0x2'));var BPromise=require(_0x11cc('0x3'));var rs=require(_0x11cc('0x4'));var fs=require('fs');var Redis=require(_0x11cc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x11cc('0x6'));var logger=require(_0x11cc('0x7'))(_0x11cc('0x8'));var config=require('../../config/environment');var jayson=require(_0x11cc('0x9'));var client=jayson[_0x11cc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x239c06,_0x922234,_0x5c0abb){return new BPromise(function(_0x31b025,_0xaed586){return client[_0x11cc('0xb')](_0x239c06,_0x5c0abb)[_0x11cc('0xc')](function(_0x56aaa5){logger[_0x11cc('0xd')](_0x11cc('0xe'),_0x922234,'request\x20sent');logger[_0x11cc('0xf')](_0x11cc('0x10'),_0x922234,_0x11cc('0x11'),JSON[_0x11cc('0x12')](_0x56aaa5));if(_0x56aaa5[_0x11cc('0x13')]){if(_0x56aaa5[_0x11cc('0x13')][_0x11cc('0x14')]===0x1f4){logger[_0x11cc('0x13')](_0x11cc('0xe'),_0x922234,_0x56aaa5['error'][_0x11cc('0x15')]);return _0xaed586(_0x56aaa5[_0x11cc('0x13')][_0x11cc('0x15')]);}logger[_0x11cc('0x13')](_0x11cc('0xe'),_0x922234,_0x56aaa5[_0x11cc('0x13')]['message']);return _0x31b025(_0x56aaa5[_0x11cc('0x13')][_0x11cc('0x15')]);}else{logger[_0x11cc('0xd')](_0x11cc('0xe'),_0x922234,_0x11cc('0x11'));_0x31b025(_0x56aaa5[_0x11cc('0x16')][_0x11cc('0x15')]);}})[_0x11cc('0x17')](function(_0x1e1b48){logger[_0x11cc('0x13')](_0x11cc('0xe'),_0x922234,_0x1e1b48);_0xaed586(_0x1e1b48);});});}exports[_0x11cc('0x18')]=function(_0x9d544c){var _0x6f92e=this;return new Promise(function(_0x44f8bb,_0x336c0a){return db['Sound'][_0x11cc('0x19')]({'raw':_0x9d544c[_0x11cc('0x1a')]?_0x9d544c[_0x11cc('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x9d544c[_0x11cc('0x1a')]?_0x9d544c[_0x11cc('0x1a')]['where']||null:null,'attributes':_0x9d544c[_0x11cc('0x1a')]?_0x9d544c['options'][_0x11cc('0x1b')]||null:null,'include':_0x9d544c[_0x11cc('0x1a')]?_0x9d544c['options'][_0x11cc('0x1c')]?_['map'](_0x9d544c[_0x11cc('0x1a')][_0x11cc('0x1c')],function(_0x8ed0ad){return{'model':db[_0x8ed0ad[_0x11cc('0x1d')]],'as':_0x8ed0ad['as'],'attributes':_0x8ed0ad[_0x11cc('0x1b')],'include':_0x8ed0ad[_0x11cc('0x1c')]?_['map'](_0x8ed0ad[_0x11cc('0x1c')],function(_0x530360){return{'model':db[_0x530360[_0x11cc('0x1d')]],'as':_0x530360['as'],'attributes':_0x530360[_0x11cc('0x1b')],'include':_0x530360['include']?_[_0x11cc('0x1e')](_0x530360[_0x11cc('0x1c')],function(_0xac1485){return{'model':db[_0xac1485[_0x11cc('0x1d')]],'as':_0xac1485['as'],'attributes':_0xac1485['attributes']};}):[]};}):[]};}):[]:[]})[_0x11cc('0xc')](function(_0x4d9e37){logger[_0x11cc('0xd')]('ShowSound',_0x9d544c);logger['debug'](_0x11cc('0x18'),_0x9d544c,JSON[_0x11cc('0x12')](_0x4d9e37));_0x44f8bb(_0x4d9e37);})[_0x11cc('0x17')](function(_0x252c53){logger[_0x11cc('0x13')](_0x11cc('0x18'),_0x252c53[_0x11cc('0x15')],_0x9d544c);_0x336c0a(_0x6f92e[_0x11cc('0x13')](0x1f4,_0x252c53[_0x11cc('0x15')]));});});};
\ No newline at end of file
+var _0x5974=['raw','attributes','include','map','model','ShowSound','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','find','options'];(function(_0x151926,_0x1c66fb){var _0x3a2182=function(_0x88cb4c){while(--_0x88cb4c){_0x151926['push'](_0x151926['shift']());}};_0x3a2182(++_0x1c66fb);}(_0x5974,0x16e));var _0x4597=function(_0x2d57a9,_0x5ae060){_0x2d57a9=_0x2d57a9-0x0;var _0x1b9671=_0x5974[_0x2d57a9];return _0x1b9671;};'use strict';var _=require(_0x4597('0x0'));var util=require(_0x4597('0x1'));var moment=require(_0x4597('0x2'));var BPromise=require(_0x4597('0x3'));var rs=require(_0x4597('0x4'));var fs=require('fs');var Redis=require(_0x4597('0x5'));var db=require(_0x4597('0x6'))['db'];var utils=require(_0x4597('0x7'));var logger=require(_0x4597('0x8'))(_0x4597('0x9'));var config=require(_0x4597('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4597('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e05fd,_0x178380,_0xe1b555){return new BPromise(function(_0x442532,_0x2cecbf){return client['request'](_0x2e05fd,_0xe1b555)[_0x4597('0xc')](function(_0x50106a){logger[_0x4597('0xd')](_0x4597('0xe'),_0x178380,'request\x20sent');logger[_0x4597('0xf')](_0x4597('0x10'),_0x178380,'request\x20sent',JSON[_0x4597('0x11')](_0x50106a));if(_0x50106a[_0x4597('0x12')]){if(_0x50106a[_0x4597('0x12')][_0x4597('0x13')]===0x1f4){logger[_0x4597('0x12')]('Sound,\x20%s,\x20%s',_0x178380,_0x50106a['error'][_0x4597('0x14')]);return _0x2cecbf(_0x50106a['error'][_0x4597('0x14')]);}logger[_0x4597('0x12')](_0x4597('0xe'),_0x178380,_0x50106a['error'][_0x4597('0x14')]);return _0x442532(_0x50106a['error'][_0x4597('0x14')]);}else{logger[_0x4597('0xd')]('Sound,\x20%s,\x20%s',_0x178380,'request\x20sent');_0x442532(_0x50106a['result'][_0x4597('0x14')]);}})[_0x4597('0x15')](function(_0x4294e4){logger[_0x4597('0x12')](_0x4597('0xe'),_0x178380,_0x4294e4);_0x2cecbf(_0x4294e4);});});}exports['ShowSound']=function(_0x5c419d){var _0x5e4dcc=this;return new Promise(function(_0x30af17,_0x12a416){return db['Sound'][_0x4597('0x16')]({'raw':_0x5c419d[_0x4597('0x17')]?_0x5c419d[_0x4597('0x17')][_0x4597('0x18')]===undefined?!![]:![]:!![],'where':_0x5c419d[_0x4597('0x17')]?_0x5c419d[_0x4597('0x17')]['where']||null:null,'attributes':_0x5c419d[_0x4597('0x17')]?_0x5c419d['options'][_0x4597('0x19')]||null:null,'include':_0x5c419d[_0x4597('0x17')]?_0x5c419d[_0x4597('0x17')][_0x4597('0x1a')]?_[_0x4597('0x1b')](_0x5c419d[_0x4597('0x17')][_0x4597('0x1a')],function(_0x520382){return{'model':db[_0x520382[_0x4597('0x1c')]],'as':_0x520382['as'],'attributes':_0x520382['attributes'],'include':_0x520382[_0x4597('0x1a')]?_[_0x4597('0x1b')](_0x520382['include'],function(_0x52c3f2){return{'model':db[_0x52c3f2[_0x4597('0x1c')]],'as':_0x52c3f2['as'],'attributes':_0x52c3f2[_0x4597('0x19')],'include':_0x52c3f2[_0x4597('0x1a')]?_[_0x4597('0x1b')](_0x52c3f2[_0x4597('0x1a')],function(_0x325106){return{'model':db[_0x325106[_0x4597('0x1c')]],'as':_0x325106['as'],'attributes':_0x325106[_0x4597('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4597('0xc')](function(_0x390ed5){logger[_0x4597('0xd')](_0x4597('0x1d'),_0x5c419d);logger['debug']('ShowSound',_0x5c419d,JSON['stringify'](_0x390ed5));_0x30af17(_0x390ed5);})[_0x4597('0x15')](function(_0x2f631d){logger[_0x4597('0x12')]('ShowSound',_0x2f631d[_0x4597('0x14')],_0x5c419d);_0x12a416(_0x5e4dcc['error'](0x1f4,_0x2f631d[_0x4597('0x14')]));});});};
\ No newline at end of file
index 5d9dc65..094d0e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x31ea6f,_0x5d2e87){var _0x164b40=function(_0x5d1924){while(--_0x5d1924){_0x31ea6f['push'](_0x31ea6f['shift']());}};_0x164b40(++_0x5d2e87);}(_0xda3f,0xec));var _0xfda3=function(_0x2fcab3,_0x56ec65){_0x2fcab3=_0x2fcab3-0x0;var _0x1ae27a=_0xda3f[_0x2fcab3];return _0x1ae27a;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router;
\ No newline at end of file
+var _0xd8b0=['update','delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id'];(function(_0x2ac42c,_0x400eff){var _0x29b7f3=function(_0x2f9606){while(--_0x2f9606){_0x2ac42c['push'](_0x2ac42c['shift']());}};_0x29b7f3(++_0x400eff);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['post']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xb')]);router[_0x0d8b('0xc')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xd'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);module['exports']=router;
\ No newline at end of file
index b8d3d7f..265b71b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee4b=['TEXT','medium','ENUM','out','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xee4b,0x177));var _0xbee4=function(_0x1b9cd5,_0x103dc4){_0x1b9cd5=_0x1b9cd5-0x0;var _0x4c74ca=_0xee4b[_0x1b9cd5];return _0x4c74ca;};'use strict';var Sequelize=require(_0xbee4('0x0'));module[_0xbee4('0x1')]={'uniqueid':{'type':Sequelize[_0xbee4('0x2')]},'body':{'type':Sequelize[_0xbee4('0x3')](_0xbee4('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0xbee4('0x5')]('in',_0xbee4('0x6')),'defaultValue':_0xbee4('0x6'),'allowNull':![]},'providerName':{'type':Sequelize[_0xbee4('0x2')]},'providerResponse':{'type':Sequelize[_0xbee4('0x3')]}};
\ No newline at end of file
+var _0xb15d=['out','STRING','TEXT','medium'];(function(_0x4b40a7,_0x437ca5){var _0x4df86a=function(_0x30273c){while(--_0x30273c){_0x4b40a7['push'](_0x4b40a7['shift']());}};_0x4df86a(++_0x437ca5);}(_0xb15d,0x1ee));var _0xdb15=function(_0x322862,_0x4de478){_0x322862=_0x322862-0x0;var _0x28b369=_0xb15d[_0x322862];return _0x28b369;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0xdb15('0x0')](_0xdb15('0x1')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xdb15('0x2')),'defaultValue':_0xdb15('0x2'),'allowNull':![]},'providerName':{'type':Sequelize[_0xdb15('0x3')]},'providerResponse':{'type':Sequelize[_0xdb15('0x0')]}};
\ No newline at end of file
index 3263c59..f1b652a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb233=['find','catch','create','body','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','name','index','map','SquareMessage','rawAttributes','query','filters','intersection','model','fields','length','attributes','nolimit','limit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','params','keys'];(function(_0x1fd5f2,_0x1f0f2a){var _0x545d41=function(_0x11e2c3){while(--_0x11e2c3){_0x1fd5f2['push'](_0x1fd5f2['shift']());}};_0x545d41(++_0x1f0f2a);}(_0xb233,0x15e));var _0x3b23=function(_0x5025f4,_0x4c575c){_0x5025f4=_0x5025f4-0x0;var _0x5b540e=_0xb233[_0x5025f4];return _0x5b540e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b23('0x0'));var zipdir=require(_0x3b23('0x1'));var jsonpatch=require(_0x3b23('0x2'));var rp=require('request-promise');var moment=require(_0x3b23('0x3'));var BPromise=require(_0x3b23('0x4'));var Mustache=require('mustache');var util=require(_0x3b23('0x5'));var path=require(_0x3b23('0x6'));var sox=require('sox');var csv=require(_0x3b23('0x7'));var ejs=require(_0x3b23('0x8'));var fs=require('fs');var fs_extra=require(_0x3b23('0x9'));var _=require(_0x3b23('0xa'));var squel=require(_0x3b23('0xb'));var crypto=require(_0x3b23('0xc'));var jsforce=require(_0x3b23('0xd'));var deskjs=require(_0x3b23('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3b23('0xf'));var Papa=require('papaparse');var Redis=require(_0x3b23('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3b23('0x11'));var as=require(_0x3b23('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3b23('0x13'));var utils=require(_0x3b23('0x14'));var config=require(_0x3b23('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b23('0x16'))['db'];function respondWithStatusCode(_0x38f26d,_0x40da28){_0x40da28=_0x40da28||0xcc;return function(_0x543c23){if(_0x543c23){return _0x38f26d[_0x3b23('0x17')](_0x40da28);}return _0x38f26d[_0x3b23('0x18')](_0x40da28)[_0x3b23('0x19')]();};}function respondWithResult(_0x4f0970,_0xc8be54){_0xc8be54=_0xc8be54||0xc8;return function(_0x4da0f2){if(_0x4da0f2){return _0x4f0970['status'](_0xc8be54)[_0x3b23('0x1a')](_0x4da0f2);}};}function respondWithFilteredResult(_0x55d8a3,_0x25d346){return function(_0x1ac0a6){if(_0x1ac0a6){var _0xf3303a=typeof _0x25d346[_0x3b23('0x1b')]===_0x3b23('0x1c')&&typeof _0x25d346['limit']==='undefined';var _0x2f800e=_0x1ac0a6[_0x3b23('0x1d')];var _0x4a37e6=_0xf3303a?0x0:_0x25d346[_0x3b23('0x1b')];var _0x143adc=_0xf3303a?_0x1ac0a6['count']:_0x25d346['offset']+_0x25d346['limit'];var _0x50f2e1;if(_0x143adc>=_0x2f800e){_0x143adc=_0x2f800e;_0x50f2e1=0xc8;}else{_0x50f2e1=0xce;}_0x55d8a3['status'](_0x50f2e1);return _0x55d8a3[_0x3b23('0x1e')](_0x3b23('0x1f'),_0x4a37e6+'-'+_0x143adc+'/'+_0x2f800e)[_0x3b23('0x1a')](_0x1ac0a6);}return null;};}function patchUpdates(_0x510741){return function(_0x5831c3){try{jsonpatch[_0x3b23('0x20')](_0x5831c3,_0x510741,!![]);}catch(_0x41ecca){return BPromise[_0x3b23('0x21')](_0x41ecca);}return _0x5831c3[_0x3b23('0x22')]();};}function saveUpdates(_0x169ce8,_0x2db5a1){return function(_0x5a4ba8){if(_0x5a4ba8){return _0x5a4ba8[_0x3b23('0x23')](_0x169ce8)[_0x3b23('0x24')](function(_0x28b9ca){return _0x28b9ca;});}return null;};}function removeEntity(_0x3b57f1,_0xb37453){return function(_0x3b5ec7){if(_0x3b5ec7){return _0x3b5ec7['destroy']()[_0x3b23('0x24')](function(){_0x3b57f1['status'](0xcc)[_0x3b23('0x19')]();});}};}function handleEntityNotFound(_0x367286,_0x711fd9){return function(_0x230528){if(!_0x230528){_0x367286[_0x3b23('0x17')](0x194);}return _0x230528;};}function handleError(_0x34faad,_0x2be72c){_0x2be72c=_0x2be72c||0x1f4;return function(_0x21d8be){logger['error'](_0x21d8be['stack']);if(_0x21d8be[_0x3b23('0x25')]){delete _0x21d8be[_0x3b23('0x25')];}_0x34faad[_0x3b23('0x18')](_0x2be72c)['send'](_0x21d8be);};}exports[_0x3b23('0x26')]=function(_0xee488a,_0x460502){var _0x1e0a80={},_0x3b0771={},_0x438f7a={'count':0x0,'rows':[]};var _0x59370d=_[_0x3b23('0x27')](db[_0x3b23('0x28')][_0x3b23('0x29')],function(_0x363209){return{'name':_0x363209['fieldName'],'type':_0x363209['type']['key']};});_0x3b0771['model']=_['map'](_0x59370d,_0x3b23('0x25'));_0x3b0771[_0x3b23('0x2a')]=_['keys'](_0xee488a[_0x3b23('0x2a')]);_0x3b0771[_0x3b23('0x2b')]=_[_0x3b23('0x2c')](_0x3b0771[_0x3b23('0x2d')],_0x3b0771['query']);_0x1e0a80['attributes']=_['intersection'](_0x3b0771['model'],qs['fields'](_0xee488a['query'][_0x3b23('0x2e')]));_0x1e0a80['attributes']=_0x1e0a80['attributes'][_0x3b23('0x2f')]?_0x1e0a80[_0x3b23('0x30')]:_0x3b0771[_0x3b23('0x2d')];if(!_0xee488a[_0x3b23('0x2a')]['hasOwnProperty'](_0x3b23('0x31'))){_0x1e0a80[_0x3b23('0x32')]=qs['limit'](_0xee488a[_0x3b23('0x2a')][_0x3b23('0x32')]);_0x1e0a80[_0x3b23('0x1b')]=qs['offset'](_0xee488a['query'][_0x3b23('0x1b')]);}_0x1e0a80['order']=qs['sort'](_0xee488a[_0x3b23('0x2a')][_0x3b23('0x33')]);_0x1e0a80[_0x3b23('0x34')]=qs[_0x3b23('0x2b')](_[_0x3b23('0x35')](_0xee488a[_0x3b23('0x2a')],_0x3b0771[_0x3b23('0x2b')]),_0x59370d);if(_0xee488a['query'][_0x3b23('0x36')]){_0x1e0a80[_0x3b23('0x34')]=_['merge'](_0x1e0a80[_0x3b23('0x34')],{'$or':_['map'](_0x59370d,function(_0x3d9b2c){if(_0x3d9b2c[_0x3b23('0x37')]!==_0x3b23('0x38')){var _0x3e1518={};_0x3e1518[_0x3d9b2c[_0x3b23('0x25')]]={'$like':'%'+_0xee488a[_0x3b23('0x2a')]['filter']+'%'};return _0x3e1518;}})});}_0x1e0a80=_[_0x3b23('0x39')]({},_0x1e0a80,_0xee488a[_0x3b23('0x3a')]);var _0x4415ac={'where':_0x1e0a80[_0x3b23('0x34')]};return db[_0x3b23('0x28')]['count'](_0x4415ac)[_0x3b23('0x24')](function(_0x2c51b6){_0x438f7a['count']=_0x2c51b6;if(_0xee488a[_0x3b23('0x2a')][_0x3b23('0x3b')]){_0x1e0a80[_0x3b23('0x3c')]=[{'all':!![]}];}return db[_0x3b23('0x28')][_0x3b23('0x3d')](_0x1e0a80);})[_0x3b23('0x24')](function(_0x5e60f1){_0x438f7a['rows']=_0x5e60f1;return _0x438f7a;})[_0x3b23('0x24')](respondWithFilteredResult(_0x460502,_0x1e0a80))['catch'](handleError(_0x460502,null));};exports['show']=function(_0x34018d,_0xbf5ab2){var _0x522196={'raw':!![],'where':{'id':_0x34018d[_0x3b23('0x3e')]['id']}},_0x26a74e={};_0x26a74e[_0x3b23('0x2d')]=_[_0x3b23('0x3f')](db[_0x3b23('0x28')]['rawAttributes']);_0x26a74e[_0x3b23('0x2a')]=_[_0x3b23('0x3f')](_0x34018d[_0x3b23('0x2a')]);_0x26a74e[_0x3b23('0x2b')]=_[_0x3b23('0x2c')](_0x26a74e[_0x3b23('0x2d')],_0x26a74e[_0x3b23('0x2a')]);_0x522196[_0x3b23('0x30')]=_[_0x3b23('0x2c')](_0x26a74e[_0x3b23('0x2d')],qs['fields'](_0x34018d[_0x3b23('0x2a')]['fields']));_0x522196[_0x3b23('0x30')]=_0x522196[_0x3b23('0x30')][_0x3b23('0x2f')]?_0x522196[_0x3b23('0x30')]:_0x26a74e[_0x3b23('0x2d')];if(_0x34018d[_0x3b23('0x2a')][_0x3b23('0x3b')]){_0x522196['include']=[{'all':!![]}];}_0x522196=_[_0x3b23('0x39')]({},_0x522196,_0x34018d[_0x3b23('0x3a')]);return db['SquareMessage'][_0x3b23('0x40')](_0x522196)['then'](handleEntityNotFound(_0xbf5ab2,null))[_0x3b23('0x24')](respondWithResult(_0xbf5ab2,null))[_0x3b23('0x41')](handleError(_0xbf5ab2,null));};exports[_0x3b23('0x42')]=function(_0x1b7e64,_0x213dfd){return db['SquareMessage'][_0x3b23('0x42')](_0x1b7e64[_0x3b23('0x43')],{})[_0x3b23('0x24')](respondWithResult(_0x213dfd,0xc9))['catch'](handleError(_0x213dfd,null));};exports[_0x3b23('0x23')]=function(_0x2428b6,_0x52c516){if(_0x2428b6[_0x3b23('0x43')]['id']){delete _0x2428b6[_0x3b23('0x43')]['id'];}return db['SquareMessage'][_0x3b23('0x40')]({'where':{'id':_0x2428b6[_0x3b23('0x3e')]['id']}})['then'](handleEntityNotFound(_0x52c516,null))[_0x3b23('0x24')](saveUpdates(_0x2428b6[_0x3b23('0x43')],null))[_0x3b23('0x24')](respondWithResult(_0x52c516,null))[_0x3b23('0x41')](handleError(_0x52c516,null));};exports[_0x3b23('0x44')]=function(_0x2276c0,_0x1811e5){return db['SquareMessage'][_0x3b23('0x40')]({'where':{'id':_0x2276c0[_0x3b23('0x3e')]['id']}})[_0x3b23('0x24')](handleEntityNotFound(_0x1811e5,null))['then'](removeEntity(_0x1811e5,null))['catch'](handleError(_0x1811e5,null));};
\ No newline at end of file
+var _0x07be=['crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','include','rows','catch','show','params','includeAll','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x54e74b,_0x3faf3c){var _0x30add6=function(_0x5e9a1a){while(--_0x5e9a1a){_0x54e74b['push'](_0x54e74b['shift']());}};_0x30add6(++_0x3faf3c);}(_0x07be,0x8a));var _0xe07b=function(_0x58d954,_0x4f9970){_0x58d954=_0x58d954-0x0;var _0x3f50da=_0x07be[_0x58d954];return _0x3f50da;};'use strict';var emlformat=require(_0xe07b('0x0'));var rimraf=require(_0xe07b('0x1'));var zipdir=require(_0xe07b('0x2'));var jsonpatch=require(_0xe07b('0x3'));var rp=require(_0xe07b('0x4'));var moment=require(_0xe07b('0x5'));var BPromise=require(_0xe07b('0x6'));var Mustache=require(_0xe07b('0x7'));var util=require('util');var path=require(_0xe07b('0x8'));var sox=require(_0xe07b('0x9'));var csv=require(_0xe07b('0xa'));var ejs=require(_0xe07b('0xb'));var fs=require('fs');var fs_extra=require(_0xe07b('0xc'));var _=require('lodash');var squel=require(_0xe07b('0xd'));var crypto=require(_0xe07b('0xe'));var jsforce=require(_0xe07b('0xf'));var deskjs=require(_0xe07b('0x10'));var toCsv=require(_0xe07b('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xe07b('0x11'));var authService=require(_0xe07b('0x12'));var qs=require(_0xe07b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe07b('0x14'));var logger=require(_0xe07b('0x15'))(_0xe07b('0x16'));var utils=require(_0xe07b('0x17'));var config=require(_0xe07b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe07b('0x19'))['db'];function respondWithStatusCode(_0x52b2aa,_0x2ba0e4){_0x2ba0e4=_0x2ba0e4||0xcc;return function(_0x211820){if(_0x211820){return _0x52b2aa['sendStatus'](_0x2ba0e4);}return _0x52b2aa[_0xe07b('0x1a')](_0x2ba0e4)[_0xe07b('0x1b')]();};}function respondWithResult(_0x24b712,_0x1f3300){_0x1f3300=_0x1f3300||0xc8;return function(_0x487b7d){if(_0x487b7d){return _0x24b712[_0xe07b('0x1a')](_0x1f3300)['json'](_0x487b7d);}};}function respondWithFilteredResult(_0x328d24,_0x247786){return function(_0x238df5){if(_0x238df5){var _0x2c7ef8=typeof _0x247786[_0xe07b('0x1c')]===_0xe07b('0x1d')&&typeof _0x247786[_0xe07b('0x1e')]==='undefined';var _0xd3f897=_0x238df5[_0xe07b('0x1f')];var _0x783d9e=_0x2c7ef8?0x0:_0x247786[_0xe07b('0x1c')];var _0xa7ef7b=_0x2c7ef8?_0x238df5[_0xe07b('0x1f')]:_0x247786[_0xe07b('0x1c')]+_0x247786[_0xe07b('0x1e')];var _0x442a97;if(_0xa7ef7b>=_0xd3f897){_0xa7ef7b=_0xd3f897;_0x442a97=0xc8;}else{_0x442a97=0xce;}_0x328d24[_0xe07b('0x1a')](_0x442a97);return _0x328d24[_0xe07b('0x20')](_0xe07b('0x21'),_0x783d9e+'-'+_0xa7ef7b+'/'+_0xd3f897)[_0xe07b('0x22')](_0x238df5);}return null;};}function patchUpdates(_0x2b14fc){return function(_0x179f14){try{jsonpatch[_0xe07b('0x23')](_0x179f14,_0x2b14fc,!![]);}catch(_0x2fd8f5){return BPromise[_0xe07b('0x24')](_0x2fd8f5);}return _0x179f14[_0xe07b('0x25')]();};}function saveUpdates(_0xa72082,_0x455674){return function(_0xafb2c0){if(_0xafb2c0){return _0xafb2c0[_0xe07b('0x26')](_0xa72082)[_0xe07b('0x27')](function(_0x2be22c){return _0x2be22c;});}return null;};}function removeEntity(_0x1477e7,_0x281268){return function(_0x113bb1){if(_0x113bb1){return _0x113bb1['destroy']()[_0xe07b('0x27')](function(){_0x1477e7[_0xe07b('0x1a')](0xcc)[_0xe07b('0x1b')]();});}};}function handleEntityNotFound(_0x42ff2f,_0x2af3c5){return function(_0x7827b8){if(!_0x7827b8){_0x42ff2f['sendStatus'](0x194);}return _0x7827b8;};}function handleError(_0x4c3279,_0x14da9e){_0x14da9e=_0x14da9e||0x1f4;return function(_0x822822){logger[_0xe07b('0x28')](_0x822822['stack']);if(_0x822822[_0xe07b('0x29')]){delete _0x822822['name'];}_0x4c3279['status'](_0x14da9e)[_0xe07b('0x2a')](_0x822822);};}exports['index']=function(_0x2f4ede,_0x5dff6c){var _0x23df60={},_0x53927b={},_0x26bedb={'count':0x0,'rows':[]};var _0x6abc34=_[_0xe07b('0x2b')](db[_0xe07b('0x2c')][_0xe07b('0x2d')],function(_0x2a24f4){return{'name':_0x2a24f4[_0xe07b('0x2e')],'type':_0x2a24f4[_0xe07b('0x2f')][_0xe07b('0x30')]};});_0x53927b['model']=_[_0xe07b('0x2b')](_0x6abc34,'name');_0x53927b['query']=_[_0xe07b('0x31')](_0x2f4ede[_0xe07b('0x32')]);_0x53927b['filters']=_[_0xe07b('0x33')](_0x53927b[_0xe07b('0x34')],_0x53927b[_0xe07b('0x32')]);_0x23df60[_0xe07b('0x35')]=_[_0xe07b('0x33')](_0x53927b[_0xe07b('0x34')],qs[_0xe07b('0x36')](_0x2f4ede[_0xe07b('0x32')][_0xe07b('0x36')]));_0x23df60[_0xe07b('0x35')]=_0x23df60[_0xe07b('0x35')][_0xe07b('0x37')]?_0x23df60['attributes']:_0x53927b[_0xe07b('0x34')];if(!_0x2f4ede[_0xe07b('0x32')][_0xe07b('0x38')](_0xe07b('0x39'))){_0x23df60[_0xe07b('0x1e')]=qs[_0xe07b('0x1e')](_0x2f4ede[_0xe07b('0x32')]['limit']);_0x23df60['offset']=qs['offset'](_0x2f4ede[_0xe07b('0x32')][_0xe07b('0x1c')]);}_0x23df60['order']=qs[_0xe07b('0x3a')](_0x2f4ede[_0xe07b('0x32')]['sort']);_0x23df60['where']=qs[_0xe07b('0x3b')](_[_0xe07b('0x3c')](_0x2f4ede[_0xe07b('0x32')],_0x53927b[_0xe07b('0x3b')]),_0x6abc34);if(_0x2f4ede[_0xe07b('0x32')][_0xe07b('0x3d')]){_0x23df60[_0xe07b('0x3e')]=_['merge'](_0x23df60[_0xe07b('0x3e')],{'$or':_[_0xe07b('0x2b')](_0x6abc34,function(_0x43bba5){if(_0x43bba5['type']!==_0xe07b('0x3f')){var _0x4c7cbd={};_0x4c7cbd[_0x43bba5[_0xe07b('0x29')]]={'$like':'%'+_0x2f4ede['query'][_0xe07b('0x3d')]+'%'};return _0x4c7cbd;}})});}_0x23df60=_[_0xe07b('0x40')]({},_0x23df60,_0x2f4ede['options']);var _0x52f526={'where':_0x23df60[_0xe07b('0x3e')]};return db['SquareMessage']['count'](_0x52f526)[_0xe07b('0x27')](function(_0x17f8dc){_0x26bedb[_0xe07b('0x1f')]=_0x17f8dc;if(_0x2f4ede[_0xe07b('0x32')]['includeAll']){_0x23df60[_0xe07b('0x41')]=[{'all':!![]}];}return db[_0xe07b('0x2c')]['findAll'](_0x23df60);})[_0xe07b('0x27')](function(_0x203274){_0x26bedb[_0xe07b('0x42')]=_0x203274;return _0x26bedb;})[_0xe07b('0x27')](respondWithFilteredResult(_0x5dff6c,_0x23df60))[_0xe07b('0x43')](handleError(_0x5dff6c,null));};exports[_0xe07b('0x44')]=function(_0x1d28da,_0x42db4f){var _0x401daf={'raw':!![],'where':{'id':_0x1d28da[_0xe07b('0x45')]['id']}},_0x17526f={};_0x17526f[_0xe07b('0x34')]=_[_0xe07b('0x31')](db[_0xe07b('0x2c')][_0xe07b('0x2d')]);_0x17526f[_0xe07b('0x32')]=_[_0xe07b('0x31')](_0x1d28da['query']);_0x17526f[_0xe07b('0x3b')]=_[_0xe07b('0x33')](_0x17526f[_0xe07b('0x34')],_0x17526f[_0xe07b('0x32')]);_0x401daf[_0xe07b('0x35')]=_[_0xe07b('0x33')](_0x17526f[_0xe07b('0x34')],qs['fields'](_0x1d28da[_0xe07b('0x32')][_0xe07b('0x36')]));_0x401daf[_0xe07b('0x35')]=_0x401daf[_0xe07b('0x35')]['length']?_0x401daf[_0xe07b('0x35')]:_0x17526f[_0xe07b('0x34')];if(_0x1d28da['query'][_0xe07b('0x46')]){_0x401daf['include']=[{'all':!![]}];}_0x401daf=_['merge']({},_0x401daf,_0x1d28da[_0xe07b('0x47')]);return db['SquareMessage'][_0xe07b('0x48')](_0x401daf)[_0xe07b('0x27')](handleEntityNotFound(_0x42db4f,null))[_0xe07b('0x27')](respondWithResult(_0x42db4f,null))[_0xe07b('0x43')](handleError(_0x42db4f,null));};exports[_0xe07b('0x49')]=function(_0x5d8830,_0x3688a5){return db[_0xe07b('0x2c')]['create'](_0x5d8830[_0xe07b('0x4a')],{})['then'](respondWithResult(_0x3688a5,0xc9))[_0xe07b('0x43')](handleError(_0x3688a5,null));};exports[_0xe07b('0x26')]=function(_0x11a5c7,_0x30dea8){if(_0x11a5c7['body']['id']){delete _0x11a5c7[_0xe07b('0x4a')]['id'];}return db[_0xe07b('0x2c')][_0xe07b('0x48')]({'where':{'id':_0x11a5c7[_0xe07b('0x45')]['id']}})[_0xe07b('0x27')](handleEntityNotFound(_0x30dea8,null))[_0xe07b('0x27')](saveUpdates(_0x11a5c7[_0xe07b('0x4a')],null))[_0xe07b('0x27')](respondWithResult(_0x30dea8,null))[_0xe07b('0x43')](handleError(_0x30dea8,null));};exports[_0xe07b('0x4b')]=function(_0x1af23d,_0x4db8d2){return db['SquareMessage'][_0xe07b('0x48')]({'where':{'id':_0x1af23d['params']['id']}})[_0xe07b('0x27')](handleEntityNotFound(_0x4db8d2,null))[_0xe07b('0x27')](removeEntity(_0x4db8d2,null))[_0xe07b('0x43')](handleError(_0x4db8d2,null));};
\ No newline at end of file
index e68d32b..4266278 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2517=['moment','bluebird','request-promise','../../config/environment','./squareMessage.attributes','exports','define','square_messages','lodash','../../config/logger'];(function(_0x25e802,_0x5112e3){var _0x446383=function(_0x5bc1e0){while(--_0x5bc1e0){_0x25e802['push'](_0x25e802['shift']());}};_0x446383(++_0x5112e3);}(_0x2517,0xe4));var _0x7251=function(_0x18bcd9,_0x9ddd25){_0x18bcd9=_0x18bcd9-0x0;var _0x28adad=_0x2517[_0x18bcd9];return _0x28adad;};'use strict';var _=require(_0x7251('0x0'));var util=require('util');var logger=require(_0x7251('0x1'))('api');var moment=require(_0x7251('0x2'));var BPromise=require(_0x7251('0x3'));var rp=require(_0x7251('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7251('0x5'));var attributes=require(_0x7251('0x6'));module[_0x7251('0x7')]=function(_0x635609,_0xef0852){return _0x635609[_0x7251('0x8')]('SquareMessage',attributes,{'tableName':_0x7251('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5dda=['rimraf','../../config/environment','./squareMessage.attributes','exports','SquareMessage','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5dda,0x94));var _0xa5dd=function(_0x5bd665,_0x3838f2){_0x5bd665=_0x5bd665-0x0;var _0x31fde9=_0x5dda[_0x5bd665];return _0x31fde9;};'use strict';var _=require(_0xa5dd('0x0'));var util=require(_0xa5dd('0x1'));var logger=require(_0xa5dd('0x2'))(_0xa5dd('0x3'));var moment=require(_0xa5dd('0x4'));var BPromise=require(_0xa5dd('0x5'));var rp=require(_0xa5dd('0x6'));var fs=require('fs');var path=require(_0xa5dd('0x7'));var rimraf=require(_0xa5dd('0x8'));var config=require(_0xa5dd('0x9'));var attributes=require(_0xa5dd('0xa'));module[_0xa5dd('0xb')]=function(_0x258b19,_0xf7068e){return _0x258b19['define'](_0xa5dd('0xc'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 781cb31..336c9c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x25e5=['CreateSquareMessage','create','body','options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result'];(function(_0x557a5a,_0xc3b252){var _0x4ddb70=function(_0x571c6c){while(--_0x571c6c){_0x557a5a['push'](_0x557a5a['shift']());}};_0x4ddb70(++_0xc3b252);}(_0x25e5,0x114));var _0x525e=function(_0x270adf,_0x1daaa3){_0x270adf=_0x270adf-0x0;var _0x29eda9=_0x25e5[_0x270adf];return _0x29eda9;};'use strict';var _=require(_0x525e('0x0'));var util=require(_0x525e('0x1'));var moment=require(_0x525e('0x2'));var BPromise=require('bluebird');var rs=require(_0x525e('0x3'));var fs=require('fs');var Redis=require(_0x525e('0x4'));var db=require(_0x525e('0x5'))['db'];var utils=require(_0x525e('0x6'));var logger=require(_0x525e('0x7'))('rpc');var config=require(_0x525e('0x8'));var jayson=require(_0x525e('0x9'));var client=jayson[_0x525e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53d3b7,_0x10c9e4,_0x327203){return new BPromise(function(_0x56246f,_0x35e144){return client[_0x525e('0xb')](_0x53d3b7,_0x327203)[_0x525e('0xc')](function(_0x9b66bb){logger[_0x525e('0xd')](_0x525e('0xe'),_0x10c9e4,'request\x20sent');logger[_0x525e('0xf')](_0x525e('0x10'),_0x10c9e4,_0x525e('0x11'),JSON['stringify'](_0x9b66bb));if(_0x9b66bb[_0x525e('0x12')]){if(_0x9b66bb[_0x525e('0x12')]['code']===0x1f4){logger['error'](_0x525e('0xe'),_0x10c9e4,_0x9b66bb[_0x525e('0x12')][_0x525e('0x13')]);return _0x35e144(_0x9b66bb[_0x525e('0x12')][_0x525e('0x13')]);}logger['error'](_0x525e('0xe'),_0x10c9e4,_0x9b66bb[_0x525e('0x12')][_0x525e('0x13')]);return _0x56246f(_0x9b66bb['error'][_0x525e('0x13')]);}else{logger[_0x525e('0xd')]('SquareMessage,\x20%s,\x20%s',_0x10c9e4,_0x525e('0x11'));_0x56246f(_0x9b66bb[_0x525e('0x14')][_0x525e('0x13')]);}})['catch'](function(_0x286aad){logger[_0x525e('0x12')](_0x525e('0xe'),_0x10c9e4,_0x286aad);_0x35e144(_0x286aad);});});}exports[_0x525e('0x15')]=function(_0x49e811){var _0x3b1f82=this;return new Promise(function(_0x1aeb53,_0x30f6a7){return db['SquareMessage'][_0x525e('0x16')](_0x49e811[_0x525e('0x17')],{'raw':_0x49e811[_0x525e('0x18')]?_0x49e811[_0x525e('0x18')][_0x525e('0x19')]===undefined?!![]:![]:!![]})[_0x525e('0xc')](function(_0x529418){logger[_0x525e('0xd')](_0x525e('0x15'),_0x49e811);logger[_0x525e('0xf')]('CreateSquareMessage',_0x49e811,JSON[_0x525e('0x1a')](_0x529418));_0x1aeb53(_0x529418);})['catch'](function(_0x23a250){logger[_0x525e('0x12')](_0x525e('0x15'),_0x23a250[_0x525e('0x13')],_0x49e811);_0x30f6a7(_0x3b1f82[_0x525e('0x12')](0x1f4,_0x23a250['message']));});});};
\ No newline at end of file
+var _0x6b45=['SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','stringify','error'];(function(_0x1bc4d7,_0x27fbab){var _0x307cb6=function(_0x43854){while(--_0x43854){_0x1bc4d7['push'](_0x1bc4d7['shift']());}};_0x307cb6(++_0x27fbab);}(_0x6b45,0x169));var _0x56b4=function(_0x3b5226,_0x496a84){_0x3b5226=_0x3b5226-0x0;var _0x3a13d1=_0x6b45[_0x3b5226];return _0x3a13d1;};'use strict';var _=require(_0x56b4('0x0'));var util=require(_0x56b4('0x1'));var moment=require(_0x56b4('0x2'));var BPromise=require(_0x56b4('0x3'));var rs=require(_0x56b4('0x4'));var fs=require('fs');var Redis=require(_0x56b4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x56b4('0x6'))(_0x56b4('0x7'));var config=require(_0x56b4('0x8'));var jayson=require(_0x56b4('0x9'));var client=jayson['client'][_0x56b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe962a,_0x5b65f3,_0x41409b){return new BPromise(function(_0x449c24,_0x3cd49b){return client[_0x56b4('0xb')](_0xe962a,_0x41409b)[_0x56b4('0xc')](function(_0x4c1274){logger[_0x56b4('0xd')]('SquareMessage,\x20%s,\x20%s',_0x5b65f3,_0x56b4('0xe'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x5b65f3,_0x56b4('0xe'),JSON[_0x56b4('0xf')](_0x4c1274));if(_0x4c1274[_0x56b4('0x10')]){if(_0x4c1274['error']['code']===0x1f4){logger[_0x56b4('0x10')](_0x56b4('0x11'),_0x5b65f3,_0x4c1274[_0x56b4('0x10')][_0x56b4('0x12')]);return _0x3cd49b(_0x4c1274[_0x56b4('0x10')][_0x56b4('0x12')]);}logger['error'](_0x56b4('0x11'),_0x5b65f3,_0x4c1274[_0x56b4('0x10')][_0x56b4('0x12')]);return _0x449c24(_0x4c1274['error'][_0x56b4('0x12')]);}else{logger['info'](_0x56b4('0x11'),_0x5b65f3,'request\x20sent');_0x449c24(_0x4c1274[_0x56b4('0x13')][_0x56b4('0x12')]);}})[_0x56b4('0x14')](function(_0x12edb9){logger[_0x56b4('0x10')](_0x56b4('0x11'),_0x5b65f3,_0x12edb9);_0x3cd49b(_0x12edb9);});});}exports[_0x56b4('0x15')]=function(_0x2c3164){var _0x3f4b81=this;return new Promise(function(_0xf6b42e,_0x5d2b13){return db[_0x56b4('0x16')][_0x56b4('0x17')](_0x2c3164[_0x56b4('0x18')],{'raw':_0x2c3164['options']?_0x2c3164[_0x56b4('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x56b4('0xc')](function(_0xa2cc3e){logger[_0x56b4('0xd')](_0x56b4('0x15'),_0x2c3164);logger[_0x56b4('0x1a')](_0x56b4('0x15'),_0x2c3164,JSON[_0x56b4('0xf')](_0xa2cc3e));_0xf6b42e(_0xa2cc3e);})[_0x56b4('0x14')](function(_0x12e0bd){logger[_0x56b4('0x10')](_0x56b4('0x15'),_0x12e0bd[_0x56b4('0x12')],_0x2c3164);_0x5d2b13(_0x3f4b81[_0x56b4('0x10')](0x1f4,_0x12e0bd[_0x56b4('0x12')]));});});};
\ No newline at end of file
index 97ee3f6..2df6451 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x444c=['15s','test','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0x444c,0xee));var _0xc444=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x444c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc444('0x0'));var util=require('util');var path=require(_0xc444('0x1'));var timeout=require(_0xc444('0x2'));var express=require(_0xc444('0x3'));var router=express[_0xc444('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc444('0x5'));var interaction=require(_0xc444('0x6'));var config=require(_0xc444('0x7'));var controller=require(_0xc444('0x8'));router[_0xc444('0x9')]('/',auth[_0xc444('0xa')](),controller[_0xc444('0xb')]);router[_0xc444('0x9')](_0xc444('0xc'),auth[_0xc444('0xa')](),controller[_0xc444('0xd')]);router['get'](_0xc444('0xe'),auth['isAuthenticated'](),timeout(_0xc444('0xf')),controller[_0xc444('0x10')]);router[_0xc444('0x11')]('/',auth[_0xc444('0xa')](),controller[_0xc444('0x12')]);router[_0xc444('0x13')](_0xc444('0xc'),auth[_0xc444('0xa')](),controller['update']);router[_0xc444('0x14')](_0xc444('0xc'),auth[_0xc444('0xa')](),controller[_0xc444('0x15')]);module[_0xc444('0x16')]=router;
\ No newline at end of file
+var _0x2621=['delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./squareOdbc.controller','isAuthenticated','index','/:id','show','get','/:id/test','15s','test','create','put','update'];(function(_0x37aeb4,_0x42ab87){var _0x264a13=function(_0x5233e7){while(--_0x5233e7){_0x37aeb4['push'](_0x37aeb4['shift']());}};_0x264a13(++_0x42ab87);}(_0x2621,0x1ba));var _0x1262=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2621[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1262('0x0'));var util=require('util');var path=require(_0x1262('0x1'));var timeout=require(_0x1262('0x2'));var express=require(_0x1262('0x3'));var router=express[_0x1262('0x4')]();var fs_extra=require(_0x1262('0x5'));var auth=require(_0x1262('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1262('0x7'));var controller=require(_0x1262('0x8'));router['get']('/',auth[_0x1262('0x9')](),controller[_0x1262('0xa')]);router['get'](_0x1262('0xb'),auth[_0x1262('0x9')](),controller[_0x1262('0xc')]);router[_0x1262('0xd')](_0x1262('0xe'),auth['isAuthenticated'](),timeout(_0x1262('0xf')),controller[_0x1262('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1262('0x11')]);router[_0x1262('0x12')](_0x1262('0xb'),auth['isAuthenticated'](),controller[_0x1262('0x13')]);router[_0x1262('0x14')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 7811033..4cee00f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf386=['sequelize','exports','name','STRING'];(function(_0x3c5072,_0x5756b4){var _0xdec73e=function(_0x44df37){while(--_0x44df37){_0x3c5072['push'](_0x3c5072['shift']());}};_0xdec73e(++_0x5756b4);}(_0xf386,0x120));var _0x6f38=function(_0x41946a,_0x2faf4a){_0x41946a=_0x41946a-0x0;var _0x2c0d09=_0xf386[_0x41946a];return _0x2c0d09;};'use strict';var Sequelize=require(_0x6f38('0x0'));module[_0x6f38('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6f38('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x6f38('0x3')]},'description':{'type':Sequelize[_0x6f38('0x3')]}};
\ No newline at end of file
+var _0x49d2=['STRING','name','exports'];(function(_0x328bf7,_0x3d7985){var _0x14cff7=function(_0x1f0eee){while(--_0x1f0eee){_0x328bf7['push'](_0x328bf7['shift']());}};_0x14cff7(++_0x3d7985);}(_0x49d2,0x1dc));var _0x249d=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x49d2[_0xef4cf0];return _0x497ad2;};'use strict';var Sequelize=require('sequelize');module[_0x249d('0x0')]={'name':{'type':Sequelize[_0x249d('0x1')],'unique':_0x249d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x249d('0x1')]},'description':{'type':Sequelize[_0x249d('0x1')]}};
\ No newline at end of file
index 95401bc..9babdc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b21=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','odbc','openSync','dsn','closeSync','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','SquareOdbc','rawAttributes','type','key','model','query','keys','filters'];(function(_0x159779,_0x39d008){var _0x6c937f=function(_0xabc852){while(--_0xabc852){_0x159779['push'](_0x159779['shift']());}};_0x6c937f(++_0x39d008);}(_0x6b21,0x1d6));var _0x16b2=function(_0x99a46c,_0x9480f){_0x99a46c=_0x99a46c-0x0;var _0x1c6bfe=_0x6b21[_0x99a46c];return _0x1c6bfe;};'use strict';var emlformat=require(_0x16b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x16b2('0x1'));var jsonpatch=require(_0x16b2('0x2'));var rp=require(_0x16b2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x16b2('0x4'));var util=require('util');var path=require(_0x16b2('0x5'));var sox=require('sox');var csv=require(_0x16b2('0x6'));var ejs=require(_0x16b2('0x7'));var fs=require('fs');var fs_extra=require(_0x16b2('0x8'));var _=require('lodash');var squel=require(_0x16b2('0x9'));var crypto=require(_0x16b2('0xa'));var jsforce=require(_0x16b2('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x16b2('0x6'));var querystring=require(_0x16b2('0xc'));var Papa=require(_0x16b2('0xd'));var Redis=require(_0x16b2('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x16b2('0xf'));var logger=require(_0x16b2('0x10'))(_0x16b2('0x11'));var utils=require(_0x16b2('0x12'));var config=require(_0x16b2('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x16b2('0x14'))['db'];function respondWithStatusCode(_0x12cf89,_0xa606fd){_0xa606fd=_0xa606fd||0xcc;return function(_0x47aa1b){if(_0x47aa1b){return _0x12cf89['sendStatus'](_0xa606fd);}return _0x12cf89[_0x16b2('0x15')](_0xa606fd)[_0x16b2('0x16')]();};}function respondWithResult(_0x35cfa9,_0x3a4631){_0x3a4631=_0x3a4631||0xc8;return function(_0x5131e4){if(_0x5131e4){return _0x35cfa9[_0x16b2('0x15')](_0x3a4631)[_0x16b2('0x17')](_0x5131e4);}};}function respondWithFilteredResult(_0x24e85b,_0x5616e3){return function(_0x504300){if(_0x504300){var _0x3c338c=typeof _0x5616e3[_0x16b2('0x18')]===_0x16b2('0x19')&&typeof _0x5616e3[_0x16b2('0x1a')]===_0x16b2('0x19');var _0x45f946=_0x504300[_0x16b2('0x1b')];var _0x10c2d3=_0x3c338c?0x0:_0x5616e3[_0x16b2('0x18')];var _0x4da789=_0x3c338c?_0x504300[_0x16b2('0x1b')]:_0x5616e3[_0x16b2('0x18')]+_0x5616e3[_0x16b2('0x1a')];var _0x53b5e8;if(_0x4da789>=_0x45f946){_0x4da789=_0x45f946;_0x53b5e8=0xc8;}else{_0x53b5e8=0xce;}_0x24e85b[_0x16b2('0x15')](_0x53b5e8);return _0x24e85b[_0x16b2('0x1c')](_0x16b2('0x1d'),_0x10c2d3+'-'+_0x4da789+'/'+_0x45f946)['json'](_0x504300);}return null;};}function patchUpdates(_0xafd24a){return function(_0x38b1c7){try{jsonpatch[_0x16b2('0x1e')](_0x38b1c7,_0xafd24a,!![]);}catch(_0x560731){return BPromise[_0x16b2('0x1f')](_0x560731);}return _0x38b1c7[_0x16b2('0x20')]();};}function saveUpdates(_0x31f14c,_0x2dae36){return function(_0x3ad323){if(_0x3ad323){return _0x3ad323[_0x16b2('0x21')](_0x31f14c)[_0x16b2('0x22')](function(_0x27ba90){return _0x27ba90;});}return null;};}function removeEntity(_0x49970d,_0x2384dc){return function(_0x963087){if(_0x963087){return _0x963087['destroy']()[_0x16b2('0x22')](function(){var _0xe9d9df=_0x963087[_0x16b2('0x23')]({'plain':!![]});var _0x3ebf5d='ODBC';return db[_0x16b2('0x24')]['destroy']({'where':{'type':_0x3ebf5d,'resourceId':_0xe9d9df['id']}})['then'](function(){return _0x963087;});})[_0x16b2('0x22')](function(){_0x49970d[_0x16b2('0x15')](0xcc)[_0x16b2('0x16')]();});}};}function handleEntityNotFound(_0x5df742,_0x2cff3c){return function(_0x11c377){if(!_0x11c377){_0x5df742[_0x16b2('0x25')](0x194);}return _0x11c377;};}function handleError(_0x4a64d7,_0x38f6fe){_0x38f6fe=_0x38f6fe||0x1f4;return function(_0x39e9b3){logger[_0x16b2('0x26')](_0x39e9b3[_0x16b2('0x27')]);if(_0x39e9b3[_0x16b2('0x28')]){delete _0x39e9b3[_0x16b2('0x28')];}_0x4a64d7['status'](_0x38f6fe)[_0x16b2('0x29')](_0x39e9b3);};}exports[_0x16b2('0x2a')]=function(_0x1f8c40,_0x5c9279){var _0x3d8e6e={},_0x16614c={},_0x27987b={'count':0x0,'rows':[]};var _0x504aea=_[_0x16b2('0x2b')](db[_0x16b2('0x2c')][_0x16b2('0x2d')],function(_0x303046){return{'name':_0x303046['fieldName'],'type':_0x303046[_0x16b2('0x2e')][_0x16b2('0x2f')]};});_0x16614c[_0x16b2('0x30')]=_[_0x16b2('0x2b')](_0x504aea,_0x16b2('0x28'));_0x16614c[_0x16b2('0x31')]=_[_0x16b2('0x32')](_0x1f8c40[_0x16b2('0x31')]);_0x16614c[_0x16b2('0x33')]=_[_0x16b2('0x34')](_0x16614c[_0x16b2('0x30')],_0x16614c[_0x16b2('0x31')]);_0x3d8e6e[_0x16b2('0x35')]=_[_0x16b2('0x34')](_0x16614c[_0x16b2('0x30')],qs[_0x16b2('0x36')](_0x1f8c40[_0x16b2('0x31')][_0x16b2('0x36')]));_0x3d8e6e[_0x16b2('0x35')]=_0x3d8e6e[_0x16b2('0x35')][_0x16b2('0x37')]?_0x3d8e6e[_0x16b2('0x35')]:_0x16614c[_0x16b2('0x30')];if(!_0x1f8c40[_0x16b2('0x31')][_0x16b2('0x38')](_0x16b2('0x39'))){_0x3d8e6e[_0x16b2('0x1a')]=qs['limit'](_0x1f8c40[_0x16b2('0x31')][_0x16b2('0x1a')]);_0x3d8e6e[_0x16b2('0x18')]=qs['offset'](_0x1f8c40[_0x16b2('0x31')][_0x16b2('0x18')]);}_0x3d8e6e[_0x16b2('0x3a')]=qs['sort'](_0x1f8c40['query'][_0x16b2('0x3b')]);_0x3d8e6e['where']=qs['filters'](_[_0x16b2('0x3c')](_0x1f8c40[_0x16b2('0x31')],_0x16614c[_0x16b2('0x33')]),_0x504aea);if(_0x1f8c40[_0x16b2('0x31')][_0x16b2('0x3d')]){_0x3d8e6e[_0x16b2('0x3e')]=_[_0x16b2('0x3f')](_0x3d8e6e[_0x16b2('0x3e')],{'$or':_[_0x16b2('0x2b')](_0x504aea,function(_0x161704){if(_0x161704[_0x16b2('0x2e')]!=='VIRTUAL'){var _0x3d67ff={};_0x3d67ff[_0x161704[_0x16b2('0x28')]]={'$like':'%'+_0x1f8c40['query']['filter']+'%'};return _0x3d67ff;}})});}_0x3d8e6e=_[_0x16b2('0x3f')]({},_0x3d8e6e,_0x1f8c40[_0x16b2('0x40')]);var _0x8cfe71={'where':_0x3d8e6e[_0x16b2('0x3e')]};return db[_0x16b2('0x2c')][_0x16b2('0x1b')](_0x8cfe71)['then'](function(_0x1807fd){_0x27987b[_0x16b2('0x1b')]=_0x1807fd;if(_0x1f8c40[_0x16b2('0x31')][_0x16b2('0x41')]){_0x3d8e6e['include']=[{'all':!![]}];}return db[_0x16b2('0x2c')][_0x16b2('0x42')](_0x3d8e6e);})[_0x16b2('0x22')](function(_0xbdeb25){_0x27987b[_0x16b2('0x43')]=_0xbdeb25;return _0x27987b;})[_0x16b2('0x22')](respondWithFilteredResult(_0x5c9279,_0x3d8e6e))[_0x16b2('0x44')](handleError(_0x5c9279,null));};exports[_0x16b2('0x45')]=function(_0x5ddb61,_0x2854cb){var _0x512054={'raw':!![],'where':{'id':_0x5ddb61['params']['id']}},_0x2366af={};_0x2366af[_0x16b2('0x30')]=_[_0x16b2('0x32')](db[_0x16b2('0x2c')]['rawAttributes']);_0x2366af[_0x16b2('0x31')]=_[_0x16b2('0x32')](_0x5ddb61[_0x16b2('0x31')]);_0x2366af['filters']=_[_0x16b2('0x34')](_0x2366af[_0x16b2('0x30')],_0x2366af['query']);_0x512054[_0x16b2('0x35')]=_[_0x16b2('0x34')](_0x2366af[_0x16b2('0x30')],qs[_0x16b2('0x36')](_0x5ddb61['query'][_0x16b2('0x36')]));_0x512054[_0x16b2('0x35')]=_0x512054[_0x16b2('0x35')][_0x16b2('0x37')]?_0x512054[_0x16b2('0x35')]:_0x2366af[_0x16b2('0x30')];if(_0x5ddb61[_0x16b2('0x31')][_0x16b2('0x41')]){_0x512054['include']=[{'all':!![]}];}_0x512054=_[_0x16b2('0x3f')]({},_0x512054,_0x5ddb61['options']);return db[_0x16b2('0x2c')][_0x16b2('0x46')](_0x512054)[_0x16b2('0x22')](handleEntityNotFound(_0x2854cb,null))[_0x16b2('0x22')](respondWithResult(_0x2854cb,null))[_0x16b2('0x44')](handleError(_0x2854cb,null));};exports['create']=function(_0x4ec57e,_0x1c8b6a){return db[_0x16b2('0x2c')][_0x16b2('0x47')](_0x4ec57e[_0x16b2('0x48')],{})[_0x16b2('0x22')](function(_0x1560ea){var _0x3b4027=_0x4ec57e[_0x16b2('0x49')][_0x16b2('0x23')]({'plain':!![]});if(!_0x3b4027)throw new Error(_0x16b2('0x4a'));if(_0x3b4027[_0x16b2('0x4b')]==='user'){var _0x18ced9=_0x1560ea[_0x16b2('0x23')]({'plain':!![]});var _0xb62d6a=_0x16b2('0x4c');return db[_0x16b2('0x4d')][_0x16b2('0x46')]({'where':{'name':_0xb62d6a,'userProfileId':_0x3b4027[_0x16b2('0x4e')]},'raw':!![]})[_0x16b2('0x22')](function(_0x591eee){if(_0x591eee&&_0x591eee[_0x16b2('0x4f')]===0x0){return db[_0x16b2('0x24')][_0x16b2('0x47')]({'name':_0x18ced9['name'],'resourceId':_0x18ced9['id'],'type':_0x591eee[_0x16b2('0x28')],'sectionId':_0x591eee['id']},{})['then'](function(){return _0x1560ea;});}else{return _0x1560ea;}})[_0x16b2('0x44')](function(_0x255a72){logger[_0x16b2('0x26')](_0x16b2('0x50'),_0x255a72);throw _0x255a72;});}return _0x1560ea;})[_0x16b2('0x22')](respondWithResult(_0x1c8b6a,0xc9))[_0x16b2('0x44')](handleError(_0x1c8b6a,null));};exports[_0x16b2('0x21')]=function(_0x458430,_0x1e2742){if(_0x458430[_0x16b2('0x48')]['id']){delete _0x458430[_0x16b2('0x48')]['id'];}return db[_0x16b2('0x2c')][_0x16b2('0x46')]({'where':{'id':_0x458430['params']['id']}})['then'](handleEntityNotFound(_0x1e2742,null))[_0x16b2('0x22')](saveUpdates(_0x458430[_0x16b2('0x48')],null))[_0x16b2('0x22')](respondWithResult(_0x1e2742,null))[_0x16b2('0x44')](handleError(_0x1e2742,null));};exports['destroy']=function(_0x15b952,_0x1e3311){return db[_0x16b2('0x2c')][_0x16b2('0x46')]({'where':{'id':_0x15b952[_0x16b2('0x51')]['id']}})['then'](handleEntityNotFound(_0x1e3311,null))['then'](removeEntity(_0x1e3311,null))['catch'](handleError(_0x1e3311,null));};exports[_0x16b2('0x52')]=function(_0x2c9978,_0x3fab6c,_0x214872){var _0x489c24;return db[_0x16b2('0x2c')]['find']({'where':{'id':_0x2c9978[_0x16b2('0x51')]['id']},'attributes':['id','dsn']})[_0x16b2('0x22')](handleEntityNotFound(_0x3fab6c,null))[_0x16b2('0x22')](function(_0xd507ac){if(_0xd507ac){var _0x30eb12=require(_0x16b2('0x53'))();_0x30eb12[_0x16b2('0x54')](_0xd507ac[_0x16b2('0x55')]);_0x30eb12[_0x16b2('0x56')]();return _0xd507ac;}})[_0x16b2('0x22')](respondWithResult(_0x3fab6c,null))[_0x16b2('0x44')](handleError(_0x3fab6c,null));};
\ No newline at end of file
+var _0xc2e6=['type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','intersection','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','dsn','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','then','get','ODBC','destroy','error','stack','name','send','index','SquareOdbc','fieldName'];(function(_0x3b6e69,_0x47ecc4){var _0x19c90a=function(_0x1a1a96){while(--_0x1a1a96){_0x3b6e69['push'](_0x3b6e69['shift']());}};_0x19c90a(++_0x47ecc4);}(_0xc2e6,0xdc));var _0x6c2e=function(_0x336719,_0x473ce0){_0x336719=_0x336719-0x0;var _0x53a9b4=_0xc2e6[_0x336719];return _0x53a9b4;};'use strict';var emlformat=require(_0x6c2e('0x0'));var rimraf=require(_0x6c2e('0x1'));var zipdir=require(_0x6c2e('0x2'));var jsonpatch=require(_0x6c2e('0x3'));var rp=require(_0x6c2e('0x4'));var moment=require(_0x6c2e('0x5'));var BPromise=require(_0x6c2e('0x6'));var Mustache=require(_0x6c2e('0x7'));var util=require(_0x6c2e('0x8'));var path=require(_0x6c2e('0x9'));var sox=require(_0x6c2e('0xa'));var csv=require(_0x6c2e('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c2e('0xc'));var _=require(_0x6c2e('0xd'));var squel=require(_0x6c2e('0xe'));var crypto=require(_0x6c2e('0xf'));var jsforce=require(_0x6c2e('0x10'));var deskjs=require(_0x6c2e('0x11'));var toCsv=require(_0x6c2e('0xb'));var querystring=require('querystring');var Papa=require(_0x6c2e('0x12'));var Redis=require('ioredis');var authService=require(_0x6c2e('0x13'));var qs=require(_0x6c2e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6c2e('0x15'));var logger=require(_0x6c2e('0x16'))(_0x6c2e('0x17'));var utils=require(_0x6c2e('0x18'));var config=require(_0x6c2e('0x19'));var licenseUtil=require(_0x6c2e('0x1a'));var db=require(_0x6c2e('0x1b'))['db'];function respondWithStatusCode(_0x3f7b3e,_0x10cf44){_0x10cf44=_0x10cf44||0xcc;return function(_0x2bcf81){if(_0x2bcf81){return _0x3f7b3e[_0x6c2e('0x1c')](_0x10cf44);}return _0x3f7b3e[_0x6c2e('0x1d')](_0x10cf44)[_0x6c2e('0x1e')]();};}function respondWithResult(_0x3758e1,_0xf7b82b){_0xf7b82b=_0xf7b82b||0xc8;return function(_0x5c3b94){if(_0x5c3b94){return _0x3758e1[_0x6c2e('0x1d')](_0xf7b82b)[_0x6c2e('0x1f')](_0x5c3b94);}};}function respondWithFilteredResult(_0x4dba7a,_0x369a0c){return function(_0x2907df){if(_0x2907df){var _0x2907a5=typeof _0x369a0c[_0x6c2e('0x20')]==='undefined'&&typeof _0x369a0c[_0x6c2e('0x21')]==='undefined';var _0x2cf8ab=_0x2907df[_0x6c2e('0x22')];var _0x4c4fac=_0x2907a5?0x0:_0x369a0c[_0x6c2e('0x20')];var _0x340ad9=_0x2907a5?_0x2907df[_0x6c2e('0x22')]:_0x369a0c[_0x6c2e('0x20')]+_0x369a0c[_0x6c2e('0x21')];var _0x49eef2;if(_0x340ad9>=_0x2cf8ab){_0x340ad9=_0x2cf8ab;_0x49eef2=0xc8;}else{_0x49eef2=0xce;}_0x4dba7a[_0x6c2e('0x1d')](_0x49eef2);return _0x4dba7a[_0x6c2e('0x23')](_0x6c2e('0x24'),_0x4c4fac+'-'+_0x340ad9+'/'+_0x2cf8ab)[_0x6c2e('0x1f')](_0x2907df);}return null;};}function patchUpdates(_0x398597){return function(_0x254875){try{jsonpatch[_0x6c2e('0x25')](_0x254875,_0x398597,!![]);}catch(_0x3de107){return BPromise['reject'](_0x3de107);}return _0x254875[_0x6c2e('0x26')]();};}function saveUpdates(_0x5915d2,_0x4e45d7){return function(_0x313c7d){if(_0x313c7d){return _0x313c7d['update'](_0x5915d2)[_0x6c2e('0x27')](function(_0x23d2dc){return _0x23d2dc;});}return null;};}function removeEntity(_0x12b680,_0x4f29ef){return function(_0x1d8109){if(_0x1d8109){return _0x1d8109['destroy']()[_0x6c2e('0x27')](function(){var _0x418e66=_0x1d8109[_0x6c2e('0x28')]({'plain':!![]});var _0x535929=_0x6c2e('0x29');return db['UserProfileResource'][_0x6c2e('0x2a')]({'where':{'type':_0x535929,'resourceId':_0x418e66['id']}})['then'](function(){return _0x1d8109;});})[_0x6c2e('0x27')](function(){_0x12b680[_0x6c2e('0x1d')](0xcc)[_0x6c2e('0x1e')]();});}};}function handleEntityNotFound(_0x5e75af,_0x51ba9a){return function(_0x1b9af2){if(!_0x1b9af2){_0x5e75af[_0x6c2e('0x1c')](0x194);}return _0x1b9af2;};}function handleError(_0x2d51e,_0x524631){_0x524631=_0x524631||0x1f4;return function(_0x2be5aa){logger[_0x6c2e('0x2b')](_0x2be5aa[_0x6c2e('0x2c')]);if(_0x2be5aa[_0x6c2e('0x2d')]){delete _0x2be5aa[_0x6c2e('0x2d')];}_0x2d51e[_0x6c2e('0x1d')](_0x524631)[_0x6c2e('0x2e')](_0x2be5aa);};}exports[_0x6c2e('0x2f')]=function(_0x2906e7,_0x485a05){var _0x487911={},_0x308320={},_0x523957={'count':0x0,'rows':[]};var _0x537a3e=_['map'](db[_0x6c2e('0x30')]['rawAttributes'],function(_0x1dd286){return{'name':_0x1dd286[_0x6c2e('0x31')],'type':_0x1dd286[_0x6c2e('0x32')][_0x6c2e('0x33')]};});_0x308320[_0x6c2e('0x34')]=_[_0x6c2e('0x35')](_0x537a3e,_0x6c2e('0x2d'));_0x308320[_0x6c2e('0x36')]=_[_0x6c2e('0x37')](_0x2906e7[_0x6c2e('0x36')]);_0x308320[_0x6c2e('0x38')]=_['intersection'](_0x308320[_0x6c2e('0x34')],_0x308320[_0x6c2e('0x36')]);_0x487911[_0x6c2e('0x39')]=_['intersection'](_0x308320[_0x6c2e('0x34')],qs[_0x6c2e('0x3a')](_0x2906e7[_0x6c2e('0x36')][_0x6c2e('0x3a')]));_0x487911[_0x6c2e('0x39')]=_0x487911[_0x6c2e('0x39')][_0x6c2e('0x3b')]?_0x487911[_0x6c2e('0x39')]:_0x308320['model'];if(!_0x2906e7['query'][_0x6c2e('0x3c')]('nolimit')){_0x487911['limit']=qs[_0x6c2e('0x21')](_0x2906e7['query']['limit']);_0x487911[_0x6c2e('0x20')]=qs[_0x6c2e('0x20')](_0x2906e7[_0x6c2e('0x36')]['offset']);}_0x487911[_0x6c2e('0x3d')]=qs[_0x6c2e('0x3e')](_0x2906e7['query'][_0x6c2e('0x3e')]);_0x487911[_0x6c2e('0x3f')]=qs[_0x6c2e('0x38')](_[_0x6c2e('0x40')](_0x2906e7[_0x6c2e('0x36')],_0x308320['filters']),_0x537a3e);if(_0x2906e7['query'][_0x6c2e('0x41')]){_0x487911[_0x6c2e('0x3f')]=_[_0x6c2e('0x42')](_0x487911[_0x6c2e('0x3f')],{'$or':_[_0x6c2e('0x35')](_0x537a3e,function(_0x23955c){if(_0x23955c['type']!==_0x6c2e('0x43')){var _0x135796={};_0x135796[_0x23955c['name']]={'$like':'%'+_0x2906e7[_0x6c2e('0x36')][_0x6c2e('0x41')]+'%'};return _0x135796;}})});}_0x487911=_[_0x6c2e('0x42')]({},_0x487911,_0x2906e7[_0x6c2e('0x44')]);var _0x34aaec={'where':_0x487911[_0x6c2e('0x3f')]};return db[_0x6c2e('0x30')][_0x6c2e('0x22')](_0x34aaec)['then'](function(_0x2a2d0b){_0x523957[_0x6c2e('0x22')]=_0x2a2d0b;if(_0x2906e7[_0x6c2e('0x36')][_0x6c2e('0x45')]){_0x487911[_0x6c2e('0x46')]=[{'all':!![]}];}return db[_0x6c2e('0x30')]['findAll'](_0x487911);})[_0x6c2e('0x27')](function(_0x478ed3){_0x523957[_0x6c2e('0x47')]=_0x478ed3;return _0x523957;})['then'](respondWithFilteredResult(_0x485a05,_0x487911))[_0x6c2e('0x48')](handleError(_0x485a05,null));};exports[_0x6c2e('0x49')]=function(_0x26f23c,_0x141916){var _0x1a2207={'raw':!![],'where':{'id':_0x26f23c['params']['id']}},_0x2c4d15={};_0x2c4d15[_0x6c2e('0x34')]=_[_0x6c2e('0x37')](db[_0x6c2e('0x30')]['rawAttributes']);_0x2c4d15['query']=_[_0x6c2e('0x37')](_0x26f23c[_0x6c2e('0x36')]);_0x2c4d15[_0x6c2e('0x38')]=_['intersection'](_0x2c4d15[_0x6c2e('0x34')],_0x2c4d15[_0x6c2e('0x36')]);_0x1a2207[_0x6c2e('0x39')]=_[_0x6c2e('0x4a')](_0x2c4d15['model'],qs['fields'](_0x26f23c['query'][_0x6c2e('0x3a')]));_0x1a2207['attributes']=_0x1a2207[_0x6c2e('0x39')]['length']?_0x1a2207[_0x6c2e('0x39')]:_0x2c4d15['model'];if(_0x26f23c[_0x6c2e('0x36')][_0x6c2e('0x45')]){_0x1a2207[_0x6c2e('0x46')]=[{'all':!![]}];}_0x1a2207=_[_0x6c2e('0x42')]({},_0x1a2207,_0x26f23c[_0x6c2e('0x44')]);return db[_0x6c2e('0x30')][_0x6c2e('0x4b')](_0x1a2207)[_0x6c2e('0x27')](handleEntityNotFound(_0x141916,null))[_0x6c2e('0x27')](respondWithResult(_0x141916,null))[_0x6c2e('0x48')](handleError(_0x141916,null));};exports[_0x6c2e('0x4c')]=function(_0x3e5053,_0x3a3849){return db[_0x6c2e('0x30')][_0x6c2e('0x4c')](_0x3e5053['body'],{})[_0x6c2e('0x27')](function(_0x241d4b){var _0xfc671=_0x3e5053['user'][_0x6c2e('0x28')]({'plain':!![]});if(!_0xfc671)throw new Error(_0x6c2e('0x4d'));if(_0xfc671[_0x6c2e('0x4e')]===_0x6c2e('0x4f')){var _0xbbc329=_0x241d4b['get']({'plain':!![]});var _0x261f25=_0x6c2e('0x29');return db[_0x6c2e('0x50')][_0x6c2e('0x4b')]({'where':{'name':_0x261f25,'userProfileId':_0xfc671[_0x6c2e('0x51')]},'raw':!![]})[_0x6c2e('0x27')](function(_0x27a54b){if(_0x27a54b&&_0x27a54b['autoAssociation']===0x0){return db[_0x6c2e('0x52')][_0x6c2e('0x4c')]({'name':_0xbbc329[_0x6c2e('0x2d')],'resourceId':_0xbbc329['id'],'type':_0x27a54b[_0x6c2e('0x2d')],'sectionId':_0x27a54b['id']},{})['then'](function(){return _0x241d4b;});}else{return _0x241d4b;}})[_0x6c2e('0x48')](function(_0x2502c6){logger[_0x6c2e('0x2b')](_0x6c2e('0x53'),_0x2502c6);throw _0x2502c6;});}return _0x241d4b;})[_0x6c2e('0x27')](respondWithResult(_0x3a3849,0xc9))[_0x6c2e('0x48')](handleError(_0x3a3849,null));};exports[_0x6c2e('0x54')]=function(_0x266602,_0x1331a1){if(_0x266602[_0x6c2e('0x55')]['id']){delete _0x266602[_0x6c2e('0x55')]['id'];}return db[_0x6c2e('0x30')][_0x6c2e('0x4b')]({'where':{'id':_0x266602[_0x6c2e('0x56')]['id']}})[_0x6c2e('0x27')](handleEntityNotFound(_0x1331a1,null))[_0x6c2e('0x27')](saveUpdates(_0x266602['body'],null))[_0x6c2e('0x27')](respondWithResult(_0x1331a1,null))[_0x6c2e('0x48')](handleError(_0x1331a1,null));};exports[_0x6c2e('0x2a')]=function(_0x3c6d91,_0x5343c8){return db[_0x6c2e('0x30')]['find']({'where':{'id':_0x3c6d91[_0x6c2e('0x56')]['id']}})[_0x6c2e('0x27')](handleEntityNotFound(_0x5343c8,null))[_0x6c2e('0x27')](removeEntity(_0x5343c8,null))[_0x6c2e('0x48')](handleError(_0x5343c8,null));};exports['test']=function(_0x35c51a,_0x78442d,_0x4e6039){var _0xe5722f;return db[_0x6c2e('0x30')][_0x6c2e('0x4b')]({'where':{'id':_0x35c51a[_0x6c2e('0x56')]['id']},'attributes':['id',_0x6c2e('0x57')]})['then'](handleEntityNotFound(_0x78442d,null))['then'](function(_0x4262f1){if(_0x4262f1){var _0x4c01a3=require('odbc')();_0x4c01a3[_0x6c2e('0x58')](_0x4262f1[_0x6c2e('0x57')]);_0x4c01a3[_0x6c2e('0x59')]();return _0x4262f1;}})[_0x6c2e('0x27')](respondWithResult(_0x78442d,null))[_0x6c2e('0x48')](handleError(_0x78442d,null));};
\ No newline at end of file
index dd6b837..eb5eeec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2919=['../../config/environment','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x235d85,_0x2db080){var _0x559ead=function(_0x3bde13){while(--_0x3bde13){_0x235d85['push'](_0x235d85['shift']());}};_0x559ead(++_0x2db080);}(_0x2919,0x1b2));var _0x9291=function(_0x5ce675,_0x1ab345){_0x5ce675=_0x5ce675-0x0;var _0x3c0fc5=_0x2919[_0x5ce675];return _0x3c0fc5;};'use strict';var _=require(_0x9291('0x0'));var util=require(_0x9291('0x1'));var logger=require(_0x9291('0x2'))(_0x9291('0x3'));var moment=require(_0x9291('0x4'));var BPromise=require('bluebird');var rp=require(_0x9291('0x5'));var fs=require('fs');var path=require(_0x9291('0x6'));var rimraf=require(_0x9291('0x7'));var config=require(_0x9291('0x8'));var attributes=require('./squareOdbc.attributes');module[_0x9291('0x9')]=function(_0x155c61,_0x57a27e){return _0x155c61[_0x9291('0xa')](_0x9291('0xb'),attributes,{'tableName':_0x9291('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5600=['rimraf','./squareOdbc.attributes','define','square_odbc','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4cc1ec,_0x443e76){var _0x3279cc=function(_0x203b77){while(--_0x203b77){_0x4cc1ec['push'](_0x4cc1ec['shift']());}};_0x3279cc(++_0x443e76);}(_0x5600,0x1e8));var _0x0560=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x5600[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x0560('0x0'));var util=require(_0x0560('0x1'));var logger=require(_0x0560('0x2'))(_0x0560('0x3'));var moment=require(_0x0560('0x4'));var BPromise=require(_0x0560('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0560('0x6'));var rimraf=require(_0x0560('0x7'));var config=require('../../config/environment');var attributes=require(_0x0560('0x8'));module['exports']=function(_0x28a56a,_0x58bcff){return _0x28a56a[_0x0560('0x9')]('SquareOdbc',attributes,{'tableName':_0x0560('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9293b86..6a23f6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab9e=['SquareOdbc,\x20%s,\x20%s','message','catch','ShowSquareOdbc','SquareOdbc','options','raw','where','attributes','include','model','map','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','info','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3c0444,_0x5dad2d){var _0x456e6f=function(_0x496b30){while(--_0x496b30){_0x3c0444['push'](_0x3c0444['shift']());}};_0x456e6f(++_0x5dad2d);}(_0xab9e,0xb5));var _0xeab9=function(_0x31515a,_0x30aa4d){_0x31515a=_0x31515a-0x0;var _0x2ce7f4=_0xab9e[_0x31515a];return _0x2ce7f4;};'use strict';var _=require(_0xeab9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xeab9('0x1'));var rs=require(_0xeab9('0x2'));var fs=require('fs');var Redis=require(_0xeab9('0x3'));var db=require(_0xeab9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeab9('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeab9('0x6')][_0xeab9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4a1ec2,_0x4e818b,_0x124012){return new BPromise(function(_0x134368,_0x1786d6){return client[_0xeab9('0x8')](_0x4a1ec2,_0x124012)['then'](function(_0x52e779){logger[_0xeab9('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x4e818b,_0xeab9('0xa'));logger[_0xeab9('0xb')](_0xeab9('0xc'),_0x4e818b,_0xeab9('0xa'),JSON[_0xeab9('0xd')](_0x52e779));if(_0x52e779[_0xeab9('0xe')]){if(_0x52e779['error']['code']===0x1f4){logger['error'](_0xeab9('0xf'),_0x4e818b,_0x52e779[_0xeab9('0xe')]['message']);return _0x1786d6(_0x52e779[_0xeab9('0xe')][_0xeab9('0x10')]);}logger[_0xeab9('0xe')](_0xeab9('0xf'),_0x4e818b,_0x52e779[_0xeab9('0xe')][_0xeab9('0x10')]);return _0x134368(_0x52e779[_0xeab9('0xe')]['message']);}else{logger[_0xeab9('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x4e818b,_0xeab9('0xa'));_0x134368(_0x52e779['result'][_0xeab9('0x10')]);}})[_0xeab9('0x11')](function(_0x5e0e8a){logger['error'](_0xeab9('0xf'),_0x4e818b,_0x5e0e8a);_0x1786d6(_0x5e0e8a);});});}exports[_0xeab9('0x12')]=function(_0x16825e){var _0x1eae6a=this;return new Promise(function(_0x3ff4b7,_0x383bdd){return db[_0xeab9('0x13')]['find']({'raw':_0x16825e[_0xeab9('0x14')]?_0x16825e[_0xeab9('0x14')][_0xeab9('0x15')]===undefined?!![]:![]:!![],'where':_0x16825e[_0xeab9('0x14')]?_0x16825e[_0xeab9('0x14')][_0xeab9('0x16')]||null:null,'attributes':_0x16825e['options']?_0x16825e['options'][_0xeab9('0x17')]||null:null,'include':_0x16825e[_0xeab9('0x14')]?_0x16825e[_0xeab9('0x14')][_0xeab9('0x18')]?_['map'](_0x16825e[_0xeab9('0x14')]['include'],function(_0xef3d5e){return{'model':db[_0xef3d5e[_0xeab9('0x19')]],'as':_0xef3d5e['as'],'attributes':_0xef3d5e[_0xeab9('0x17')],'include':_0xef3d5e['include']?_[_0xeab9('0x1a')](_0xef3d5e[_0xeab9('0x18')],function(_0x2412c2){return{'model':db[_0x2412c2[_0xeab9('0x19')]],'as':_0x2412c2['as'],'attributes':_0x2412c2[_0xeab9('0x17')],'include':_0x2412c2[_0xeab9('0x18')]?_[_0xeab9('0x1a')](_0x2412c2['include'],function(_0x78d145){return{'model':db[_0x78d145[_0xeab9('0x19')]],'as':_0x78d145['as'],'attributes':_0x78d145['attributes']};}):[]};}):[]};}):[]:[]})[_0xeab9('0x1b')](function(_0x562f23){logger['info']('ShowSquareOdbc',_0x16825e);logger[_0xeab9('0xb')](_0xeab9('0x12'),_0x16825e,JSON[_0xeab9('0xd')](_0x562f23));_0x3ff4b7(_0x562f23);})[_0xeab9('0x11')](function(_0x2df6e1){logger[_0xeab9('0xe')](_0xeab9('0x12'),_0x2df6e1[_0xeab9('0x10')],_0x16825e);_0x383bdd(_0x1eae6a['error'](0x1f4,_0x2df6e1[_0xeab9('0x10')]));});});};
\ No newline at end of file
+var _0xdbe4=['../../config/utils','../../config/logger','jayson/promise','client','request','then','info','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','find','options','raw','where','include','model','map','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x17bdab,_0x199650){var _0x4e2989=function(_0x360c15){while(--_0x360c15){_0x17bdab['push'](_0x17bdab['shift']());}};_0x4e2989(++_0x199650);}(_0xdbe4,0x1a6));var _0x4dbe=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xdbe4[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x4dbe('0x0'));var util=require(_0x4dbe('0x1'));var moment=require(_0x4dbe('0x2'));var BPromise=require(_0x4dbe('0x3'));var rs=require(_0x4dbe('0x4'));var fs=require('fs');var Redis=require(_0x4dbe('0x5'));var db=require(_0x4dbe('0x6'))['db'];var utils=require(_0x4dbe('0x7'));var logger=require(_0x4dbe('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4dbe('0x9'));var client=jayson[_0x4dbe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x298acd,_0x29084c,_0x1219a1){return new BPromise(function(_0x3dda38,_0xb5cb73){return client[_0x4dbe('0xb')](_0x298acd,_0x1219a1)[_0x4dbe('0xc')](function(_0x231307){logger[_0x4dbe('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x29084c,_0x4dbe('0xe'));logger['debug'](_0x4dbe('0xf'),_0x29084c,_0x4dbe('0xe'),JSON[_0x4dbe('0x10')](_0x231307));if(_0x231307[_0x4dbe('0x11')]){if(_0x231307[_0x4dbe('0x11')][_0x4dbe('0x12')]===0x1f4){logger[_0x4dbe('0x11')](_0x4dbe('0x13'),_0x29084c,_0x231307['error'][_0x4dbe('0x14')]);return _0xb5cb73(_0x231307[_0x4dbe('0x11')]['message']);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x29084c,_0x231307[_0x4dbe('0x11')][_0x4dbe('0x14')]);return _0x3dda38(_0x231307[_0x4dbe('0x11')][_0x4dbe('0x14')]);}else{logger[_0x4dbe('0xd')](_0x4dbe('0x13'),_0x29084c,_0x4dbe('0xe'));_0x3dda38(_0x231307[_0x4dbe('0x15')]['message']);}})[_0x4dbe('0x16')](function(_0x2eff80){logger[_0x4dbe('0x11')](_0x4dbe('0x13'),_0x29084c,_0x2eff80);_0xb5cb73(_0x2eff80);});});}exports[_0x4dbe('0x17')]=function(_0x178391){var _0xbb0f51=this;return new Promise(function(_0x3fdcb3,_0x1340c4){return db['SquareOdbc'][_0x4dbe('0x18')]({'raw':_0x178391[_0x4dbe('0x19')]?_0x178391['options'][_0x4dbe('0x1a')]===undefined?!![]:![]:!![],'where':_0x178391[_0x4dbe('0x19')]?_0x178391['options'][_0x4dbe('0x1b')]||null:null,'attributes':_0x178391[_0x4dbe('0x19')]?_0x178391[_0x4dbe('0x19')]['attributes']||null:null,'include':_0x178391['options']?_0x178391[_0x4dbe('0x19')][_0x4dbe('0x1c')]?_['map'](_0x178391['options'][_0x4dbe('0x1c')],function(_0x3b38ca){return{'model':db[_0x3b38ca[_0x4dbe('0x1d')]],'as':_0x3b38ca['as'],'attributes':_0x3b38ca['attributes'],'include':_0x3b38ca[_0x4dbe('0x1c')]?_[_0x4dbe('0x1e')](_0x3b38ca[_0x4dbe('0x1c')],function(_0x2a0596){return{'model':db[_0x2a0596[_0x4dbe('0x1d')]],'as':_0x2a0596['as'],'attributes':_0x2a0596[_0x4dbe('0x1f')],'include':_0x2a0596[_0x4dbe('0x1c')]?_[_0x4dbe('0x1e')](_0x2a0596['include'],function(_0x28c60f){return{'model':db[_0x28c60f[_0x4dbe('0x1d')]],'as':_0x28c60f['as'],'attributes':_0x28c60f[_0x4dbe('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x4dbe('0xc')](function(_0x161e9b){logger[_0x4dbe('0xd')](_0x4dbe('0x17'),_0x178391);logger[_0x4dbe('0x20')](_0x4dbe('0x17'),_0x178391,JSON[_0x4dbe('0x10')](_0x161e9b));_0x3fdcb3(_0x161e9b);})[_0x4dbe('0x16')](function(_0x536f3d){logger['error']('ShowSquareOdbc',_0x536f3d[_0x4dbe('0x14')],_0x178391);_0x1340c4(_0xbb0f51[_0x4dbe('0x11')](0x1f4,_0x536f3d[_0x4dbe('0x14')]));});});};
\ No newline at end of file
index 1bde523..0127042 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x928c=['update','delete','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','create','addUsers','put'];(function(_0x5e1516,_0x1e47fb){var _0x2033f1=function(_0x5552b1){while(--_0x5552b1){_0x5e1516['push'](_0x5e1516['shift']());}};_0x2033f1(++_0x1e47fb);}(_0x928c,0x157));var _0xc928=function(_0x3fc831,_0x14fcfe){_0x3fc831=_0x3fc831-0x0;var _0x4c4f16=_0x928c[_0x3fc831];return _0x4c4f16;};'use strict';var multer=require(_0xc928('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc928('0x1'));var express=require(_0xc928('0x2'));var router=express[_0xc928('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc928('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc928('0x5'));var controller=require('./squareProject.controller');router[_0xc928('0x6')]('/',auth[_0xc928('0x7')](),controller[_0xc928('0x8')]);router[_0xc928('0x6')](_0xc928('0x9'),auth[_0xc928('0x7')](),controller[_0xc928('0xa')]);router[_0xc928('0x6')](_0xc928('0xb'),auth['isAuthenticated'](),controller[_0xc928('0xc')]);router[_0xc928('0xd')]('/',auth[_0xc928('0x7')](),controller[_0xc928('0xe')]);router[_0xc928('0xd')]('/:id/users',auth[_0xc928('0x7')](),controller[_0xc928('0xf')]);router[_0xc928('0x10')]('/:id',auth[_0xc928('0x7')](),controller[_0xc928('0x11')]);router[_0xc928('0x12')]('/:id',auth[_0xc928('0x7')](),controller['destroy']);router[_0xc928('0x12')]('/:id/users',auth[_0xc928('0x7')](),controller['removeUsers']);module[_0xc928('0x13')]=router;
\ No newline at end of file
+var _0xa2c6=['/:id/users','addUsers','put','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','/:id','isAuthenticated','show','post'];(function(_0x483973,_0x136199){var _0x4bd772=function(_0x1f22c5){while(--_0x1f22c5){_0x483973['push'](_0x483973['shift']());}};_0x4bd772(++_0x136199);}(_0xa2c6,0x1bb));var _0x6a2c=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0xa2c6[_0xef8146];return _0x5a6cb0;};'use strict';var multer=require(_0x6a2c('0x0'));var util=require('util');var path=require(_0x6a2c('0x1'));var timeout=require(_0x6a2c('0x2'));var express=require(_0x6a2c('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6a2c('0x4'));var interaction=require(_0x6a2c('0x5'));var config=require(_0x6a2c('0x6'));var controller=require(_0x6a2c('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6a2c('0x8')](_0x6a2c('0x9'),auth[_0x6a2c('0xa')](),controller[_0x6a2c('0xb')]);router[_0x6a2c('0x8')]('/:id/users',auth[_0x6a2c('0xa')](),controller['getUsers']);router[_0x6a2c('0xc')]('/',auth[_0x6a2c('0xa')](),controller['create']);router['post'](_0x6a2c('0xd'),auth[_0x6a2c('0xa')](),controller[_0x6a2c('0xe')]);router[_0x6a2c('0xf')]('/:id',auth[_0x6a2c('0xa')](),controller['update']);router[_0x6a2c('0x10')](_0x6a2c('0x9'),auth[_0x6a2c('0xa')](),controller[_0x6a2c('0x11')]);router[_0x6a2c('0x10')](_0x6a2c('0xd'),auth[_0x6a2c('0xa')](),controller['removeUsers']);module[_0x6a2c('0x12')]=router;
\ No newline at end of file
index 20d74ef..e12a3ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1047=['toString','production','utf8','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction'];(function(_0x4f485f,_0x1db0f7){var _0x1e998e=function(_0x14066c){while(--_0x14066c){_0x4f485f['push'](_0x4f485f['shift']());}};_0x1e998e(++_0x1db0f7);}(_0x1047,0x79));var _0x7104=function(_0x5579db,_0x4b93b5){_0x5579db=_0x5579db-0x0;var _0x5f5a9b=_0x1047[_0x5579db];return _0x5f5a9b;};'use strict';var Sequelize=require(_0x7104('0x0'));module[_0x7104('0x1')]={'name':{'type':Sequelize[_0x7104('0x2')],'unique':_0x7104('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7104('0x2')]},'notes':{'type':Sequelize[_0x7104('0x4')]},'preproduction':{'type':Sequelize[_0x7104('0x5')](_0x7104('0x6')),'get':function(){if(this[_0x7104('0x7')](_0x7104('0x8'))){return this[_0x7104('0x7')](_0x7104('0x8'))[_0x7104('0x9')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0x7104('0x6')),'get':function(){if(this[_0x7104('0x7')](_0x7104('0xa'))){return this[_0x7104('0x7')](_0x7104('0xa'))[_0x7104('0x9')](_0x7104('0xb'));}}},'savedAt':{'type':Sequelize[_0x7104('0xc')]},'publishedAt':{'type':Sequelize[_0x7104('0xc')]}};
\ No newline at end of file
+var _0x323d=['DATE','sequelize','exports','STRING','name','TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production'];(function(_0x10a3f2,_0x15060a){var _0x16230d=function(_0x300290){while(--_0x300290){_0x10a3f2['push'](_0x10a3f2['shift']());}};_0x16230d(++_0x15060a);}(_0x323d,0x1e2));var _0xd323=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x323d[_0x2d8fc2];return _0x3a9e53;};'use strict';var Sequelize=require(_0xd323('0x0'));module[_0xd323('0x1')]={'name':{'type':Sequelize[_0xd323('0x2')],'unique':_0xd323('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd323('0x2')]},'notes':{'type':Sequelize[_0xd323('0x4')]},'preproduction':{'type':Sequelize[_0xd323('0x5')]('long'),'get':function(){if(this[_0xd323('0x6')](_0xd323('0x7'))){return this['getDataValue'](_0xd323('0x7'))[_0xd323('0x8')](_0xd323('0x9'));}}},'production':{'type':Sequelize[_0xd323('0x5')](_0xd323('0xa')),'get':function(){if(this['getDataValue'](_0xd323('0xb'))){return this[_0xd323('0x6')](_0xd323('0xb'))['toString']('utf8');}}},'savedAt':{'type':Sequelize[_0xd323('0xc')]},'publishedAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
index 45a0238..ec8d57c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6941=['omit','length','userSquareProject:remove','User','getUsers','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./squareProject.socket','register','undefined','limit','count','offset','status','set','Content-Range','json','apply','save','update','then','destroy','get','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','SquareProject','includeAll','findAll','rows','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','catch','addUsers','ids'];(function(_0x4f217e,_0xdecb81){var _0x4a5e3b=function(_0x24b1a0){while(--_0x24b1a0){_0x4f217e['push'](_0x4f217e['shift']());}};_0x4a5e3b(++_0xdecb81);}(_0x6941,0x11c));var _0x1694=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x6941[_0x2763f2];return _0x3ef471;};'use strict';var emlformat=require(_0x1694('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1694('0x1'));var jsonpatch=require(_0x1694('0x2'));var rp=require(_0x1694('0x3'));var moment=require(_0x1694('0x4'));var BPromise=require(_0x1694('0x5'));var Mustache=require(_0x1694('0x6'));var util=require('util');var path=require(_0x1694('0x7'));var sox=require(_0x1694('0x8'));var csv=require('to-csv');var ejs=require(_0x1694('0x9'));var fs=require('fs');var fs_extra=require(_0x1694('0xa'));var _=require(_0x1694('0xb'));var squel=require(_0x1694('0xc'));var crypto=require(_0x1694('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1694('0xe'));var querystring=require(_0x1694('0xf'));var Papa=require(_0x1694('0x10'));var Redis=require(_0x1694('0x11'));var authService=require(_0x1694('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1694('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1694('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1694('0x15'));var db=require(_0x1694('0x16'))['db'];config[_0x1694('0x17')]=_[_0x1694('0x18')](config[_0x1694('0x17')],{'host':_0x1694('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1694('0x1a'))[_0x1694('0x1b')](socket);function respondWithStatusCode(_0x5e8fa0,_0x1ec500){_0x1ec500=_0x1ec500||0xcc;return function(_0x414f97){if(_0x414f97){return _0x5e8fa0['sendStatus'](_0x1ec500);}return _0x5e8fa0['status'](_0x1ec500)['end']();};}function respondWithResult(_0x118661,_0x2bdb98){_0x2bdb98=_0x2bdb98||0xc8;return function(_0x4ff068){if(_0x4ff068){return _0x118661['status'](_0x2bdb98)['json'](_0x4ff068);}};}function respondWithFilteredResult(_0x228d2a,_0x283c7d){return function(_0x308864){if(_0x308864){var _0x7e9943=typeof _0x283c7d['offset']===_0x1694('0x1c')&&typeof _0x283c7d[_0x1694('0x1d')]===_0x1694('0x1c');var _0x5cbce7=_0x308864[_0x1694('0x1e')];var _0x4b3c2f=_0x7e9943?0x0:_0x283c7d[_0x1694('0x1f')];var _0x2c3036=_0x7e9943?_0x308864['count']:_0x283c7d[_0x1694('0x1f')]+_0x283c7d[_0x1694('0x1d')];var _0x164856;if(_0x2c3036>=_0x5cbce7){_0x2c3036=_0x5cbce7;_0x164856=0xc8;}else{_0x164856=0xce;}_0x228d2a[_0x1694('0x20')](_0x164856);return _0x228d2a[_0x1694('0x21')](_0x1694('0x22'),_0x4b3c2f+'-'+_0x2c3036+'/'+_0x5cbce7)[_0x1694('0x23')](_0x308864);}return null;};}function patchUpdates(_0x519901){return function(_0x2ca4e5){try{jsonpatch[_0x1694('0x24')](_0x2ca4e5,_0x519901,!![]);}catch(_0x4d3a19){return BPromise['reject'](_0x4d3a19);}return _0x2ca4e5[_0x1694('0x25')]();};}function saveUpdates(_0x2c11a2,_0x2aa090){return function(_0x75eba0){if(_0x75eba0){return _0x75eba0[_0x1694('0x26')](_0x2c11a2)[_0x1694('0x27')](function(_0x3895c0){return _0x3895c0;});}return null;};}function removeEntity(_0x866634,_0x535c5c){return function(_0x7e1d24){if(_0x7e1d24){return _0x7e1d24[_0x1694('0x28')]()[_0x1694('0x27')](function(){var _0x3003a6=_0x7e1d24[_0x1694('0x29')]({'plain':!![]});var _0x29ccc1='SquareProjects';return db['UserProfileResource']['destroy']({'where':{'type':_0x29ccc1,'resourceId':_0x3003a6['id']}})[_0x1694('0x27')](function(){return _0x7e1d24;});})[_0x1694('0x27')](function(){_0x866634[_0x1694('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f52a7,_0x5ee4b6){return function(_0x557edf){if(!_0x557edf){_0x3f52a7['sendStatus'](0x194);}return _0x557edf;};}function handleError(_0x3aea20,_0x2385fa){_0x2385fa=_0x2385fa||0x1f4;return function(_0x7f6c79){logger['error'](_0x7f6c79[_0x1694('0x2a')]);if(_0x7f6c79[_0x1694('0x2b')]){delete _0x7f6c79[_0x1694('0x2b')];}_0x3aea20[_0x1694('0x20')](_0x2385fa)[_0x1694('0x2c')](_0x7f6c79);};}exports['index']=function(_0x2d682a,_0x2fb68a){var _0x5ae342={},_0x1ec953={},_0x400c72={'count':0x0,'rows':[]};var _0x8f722c=_['map'](db['SquareProject'][_0x1694('0x2d')],function(_0x30882a){return{'name':_0x30882a[_0x1694('0x2e')],'type':_0x30882a[_0x1694('0x2f')][_0x1694('0x30')]};});_0x1ec953['model']=_[_0x1694('0x31')](_0x8f722c,'name');_0x1ec953[_0x1694('0x32')]=_[_0x1694('0x33')](_0x2d682a['query']);_0x1ec953[_0x1694('0x34')]=_['intersection'](_0x1ec953[_0x1694('0x35')],_0x1ec953['query']);_0x5ae342[_0x1694('0x36')]=_[_0x1694('0x37')](_0x1ec953['model'],qs['fields'](_0x2d682a[_0x1694('0x32')][_0x1694('0x38')]));_0x5ae342[_0x1694('0x36')]=_0x5ae342[_0x1694('0x36')]['length']?_0x5ae342[_0x1694('0x36')]:_0x1ec953[_0x1694('0x35')];if(!_0x2d682a[_0x1694('0x32')][_0x1694('0x39')](_0x1694('0x3a'))){_0x5ae342['limit']=qs[_0x1694('0x1d')](_0x2d682a[_0x1694('0x32')][_0x1694('0x1d')]);_0x5ae342[_0x1694('0x1f')]=qs['offset'](_0x2d682a[_0x1694('0x32')]['offset']);}_0x5ae342[_0x1694('0x3b')]=qs['sort'](_0x2d682a['query'][_0x1694('0x3c')]);_0x5ae342[_0x1694('0x3d')]=qs[_0x1694('0x34')](_['pick'](_0x2d682a[_0x1694('0x32')],_0x1ec953[_0x1694('0x34')]),_0x8f722c);if(_0x2d682a['query'][_0x1694('0x3e')]){_0x5ae342[_0x1694('0x3d')]=_[_0x1694('0x3f')](_0x5ae342['where'],{'$or':_[_0x1694('0x31')](_0x8f722c,function(_0xd31dbb){if(_0xd31dbb[_0x1694('0x2f')]!==_0x1694('0x40')){var _0x3bb5ab={};_0x3bb5ab[_0xd31dbb[_0x1694('0x2b')]]={'$like':'%'+_0x2d682a[_0x1694('0x32')]['filter']+'%'};return _0x3bb5ab;}})});}_0x5ae342=_['merge']({},_0x5ae342,_0x2d682a[_0x1694('0x41')]);var _0x58cf6c={'where':_0x5ae342[_0x1694('0x3d')]};return db[_0x1694('0x42')][_0x1694('0x1e')](_0x58cf6c)[_0x1694('0x27')](function(_0x217a79){_0x400c72[_0x1694('0x1e')]=_0x217a79;if(_0x2d682a[_0x1694('0x32')][_0x1694('0x43')]){_0x5ae342['include']=[{'all':!![]}];}return db[_0x1694('0x42')][_0x1694('0x44')](_0x5ae342);})['then'](function(_0x542be5){_0x400c72[_0x1694('0x45')]=_0x542be5;return _0x400c72;})[_0x1694('0x27')](respondWithFilteredResult(_0x2fb68a,_0x5ae342))['catch'](handleError(_0x2fb68a,null));};exports[_0x1694('0x46')]=function(_0xa3d0c9,_0x29dda1){var _0x3eefb0={'raw':![],'where':{'id':_0xa3d0c9[_0x1694('0x47')]['id']}},_0x82c9aa={};_0x82c9aa['model']=_[_0x1694('0x33')](db[_0x1694('0x42')][_0x1694('0x2d')]);_0x82c9aa['query']=_['keys'](_0xa3d0c9[_0x1694('0x32')]);_0x82c9aa[_0x1694('0x34')]=_[_0x1694('0x37')](_0x82c9aa[_0x1694('0x35')],_0x82c9aa[_0x1694('0x32')]);_0x3eefb0[_0x1694('0x36')]=_['intersection'](_0x82c9aa[_0x1694('0x35')],qs['fields'](_0xa3d0c9[_0x1694('0x32')][_0x1694('0x38')]));_0x3eefb0['attributes']=_0x3eefb0[_0x1694('0x36')]['length']?_0x3eefb0[_0x1694('0x36')]:_0x82c9aa[_0x1694('0x35')];if(_0xa3d0c9[_0x1694('0x32')]['includeAll']){_0x3eefb0[_0x1694('0x48')]=[{'all':!![]}];}_0x3eefb0=_['merge']({},_0x3eefb0,_0xa3d0c9[_0x1694('0x41')]);return db['SquareProject'][_0x1694('0x49')](_0x3eefb0)['then'](handleEntityNotFound(_0x29dda1,null))[_0x1694('0x27')](respondWithResult(_0x29dda1,null))['catch'](handleError(_0x29dda1,null));};exports[_0x1694('0x4a')]=function(_0x3f314f,_0x477d55){return db[_0x1694('0x42')][_0x1694('0x4a')](_0x3f314f[_0x1694('0x4b')],{})[_0x1694('0x27')](function(_0xbd5f39){var _0x13fd4a=_0x3f314f[_0x1694('0x4c')]['get']({'plain':!![]});if(!_0x13fd4a)throw new Error(_0x1694('0x4d'));if(_0x13fd4a[_0x1694('0x4e')]===_0x1694('0x4c')){var _0x30a5dc=_0xbd5f39[_0x1694('0x29')]({'plain':!![]});var _0x1eb532=_0x1694('0x4f');return db[_0x1694('0x50')][_0x1694('0x49')]({'where':{'name':_0x1eb532,'userProfileId':_0x13fd4a[_0x1694('0x51')]},'raw':!![]})[_0x1694('0x27')](function(_0x15cf4c){if(_0x15cf4c&&_0x15cf4c[_0x1694('0x52')]===0x0){return db[_0x1694('0x53')][_0x1694('0x4a')]({'name':_0x30a5dc[_0x1694('0x2b')],'resourceId':_0x30a5dc['id'],'type':_0x15cf4c[_0x1694('0x2b')],'sectionId':_0x15cf4c['id']},{})[_0x1694('0x27')](function(){return _0xbd5f39;});}else{return _0xbd5f39;}})['catch'](function(_0x16e441){logger[_0x1694('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16e441);throw _0x16e441;});}return _0xbd5f39;})[_0x1694('0x27')](respondWithResult(_0x477d55,0xc9))[_0x1694('0x55')](handleError(_0x477d55,null));};exports[_0x1694('0x26')]=function(_0x2c5b8a,_0x355110){if(_0x2c5b8a[_0x1694('0x4b')]['id']){delete _0x2c5b8a['body']['id'];}return db[_0x1694('0x42')][_0x1694('0x49')]({'where':{'id':_0x2c5b8a[_0x1694('0x47')]['id']}})[_0x1694('0x27')](handleEntityNotFound(_0x355110,null))[_0x1694('0x27')](saveUpdates(_0x2c5b8a[_0x1694('0x4b')],null))[_0x1694('0x27')](respondWithResult(_0x355110,null))[_0x1694('0x55')](handleError(_0x355110,null));};exports[_0x1694('0x28')]=function(_0x5dbb18,_0x4c6096){return db[_0x1694('0x42')][_0x1694('0x49')]({'where':{'id':_0x5dbb18[_0x1694('0x47')]['id']}})[_0x1694('0x27')](handleEntityNotFound(_0x4c6096,null))['then'](removeEntity(_0x4c6096,null))[_0x1694('0x55')](handleError(_0x4c6096,null));};exports[_0x1694('0x56')]=function(_0x144aa3,_0x3ec044,_0x46b35f){return db[_0x1694('0x42')][_0x1694('0x49')]({'where':{'id':_0x144aa3[_0x1694('0x47')]['id']}})[_0x1694('0x27')](handleEntityNotFound(_0x3ec044,null))[_0x1694('0x27')](function(_0x40d367){if(_0x40d367){return _0x40d367[_0x1694('0x56')](_0x144aa3['body'][_0x1694('0x57')],_[_0x1694('0x58')](_0x144aa3[_0x1694('0x4b')],[_0x1694('0x57'),'id'])||{});}})[_0x1694('0x27')](respondWithResult(_0x3ec044,null))[_0x1694('0x55')](handleError(_0x3ec044,null));};exports['removeUsers']=function(_0x58092a,_0x429913,_0x4f7c04){return db['SquareProject'][_0x1694('0x49')]({'where':{'id':_0x58092a[_0x1694('0x47')]['id']}})[_0x1694('0x27')](handleEntityNotFound(_0x429913,null))[_0x1694('0x27')](function(_0x3c7ad1){if(_0x3c7ad1){return _0x3c7ad1['removeUsers'](_0x58092a[_0x1694('0x32')][_0x1694('0x57')])[_0x1694('0x27')](function(){if(_['isArray'](_0x58092a[_0x1694('0x32')][_0x1694('0x57')])){for(var _0x19514e=0x0;_0x19514e<_0x58092a[_0x1694('0x32')][_0x1694('0x57')][_0x1694('0x59')];_0x19514e+=0x1){socket['emit'](_0x1694('0x5a'),{'UserId':Number(_0x58092a[_0x1694('0x32')][_0x1694('0x57')][_0x19514e]),'SquareProjectId':Number(_0x58092a['params']['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x58092a['query']['ids']),'SquareProjectId':Number(_0x58092a[_0x1694('0x47')]['id'])});}});}})[_0x1694('0x27')](respondWithStatusCode(_0x429913,null))[_0x1694('0x55')](handleError(_0x429913,null));};exports['getUsers']=function(_0x2837cd,_0x59a6b5,_0xccf003){var _0xcf4bed={};var _0x27743c={};var _0x41f593;var _0x479db9;return db[_0x1694('0x42')]['findOne']({'where':{'id':_0x2837cd[_0x1694('0x47')]['id']}})[_0x1694('0x27')](handleEntityNotFound(_0x59a6b5,null))[_0x1694('0x27')](function(_0x4985c1){if(_0x4985c1){_0x41f593=_0x4985c1;_0x27743c['model']=_['keys'](db[_0x1694('0x5b')][_0x1694('0x2d')]);_0x27743c[_0x1694('0x32')]=_['keys'](_0x2837cd[_0x1694('0x32')]);_0x27743c[_0x1694('0x34')]=_['intersection'](_0x27743c['model'],_0x27743c[_0x1694('0x32')]);_0xcf4bed[_0x1694('0x36')]=_[_0x1694('0x37')](_0x27743c['model'],qs[_0x1694('0x38')](_0x2837cd[_0x1694('0x32')][_0x1694('0x38')]));_0xcf4bed['attributes']=_0xcf4bed[_0x1694('0x36')][_0x1694('0x59')]?_0xcf4bed[_0x1694('0x36')]:_0x27743c[_0x1694('0x35')];_0xcf4bed[_0x1694('0x3b')]=qs['sort'](_0x2837cd[_0x1694('0x32')][_0x1694('0x3c')]);_0xcf4bed[_0x1694('0x3d')]=qs[_0x1694('0x34')](_['pick'](_0x2837cd[_0x1694('0x32')],_0x27743c[_0x1694('0x34')]));if(_0x2837cd['query'][_0x1694('0x3e')]){_0xcf4bed[_0x1694('0x3d')]=_[_0x1694('0x3f')](_0xcf4bed[_0x1694('0x3d')],{'$or':_['map'](_0xcf4bed[_0x1694('0x36')],function(_0x495abe){var _0x25abba={};_0x25abba[_0x495abe]={'$like':'%'+_0x2837cd[_0x1694('0x32')][_0x1694('0x3e')]+'%'};return _0x25abba;})});}_0xcf4bed=_[_0x1694('0x3f')]({},_0xcf4bed,_0x2837cd[_0x1694('0x41')]);return _0x41f593[_0x1694('0x5c')](_0xcf4bed);}})[_0x1694('0x27')](function(_0xe3bfbf){if(_0xe3bfbf){_0x479db9=_0xe3bfbf['length'];if(!_0x2837cd[_0x1694('0x32')][_0x1694('0x39')](_0x1694('0x3a'))){_0xcf4bed[_0x1694('0x1d')]=qs[_0x1694('0x1d')](_0x2837cd[_0x1694('0x32')][_0x1694('0x1d')]);_0xcf4bed['offset']=qs[_0x1694('0x1f')](_0x2837cd[_0x1694('0x32')][_0x1694('0x1f')]);}return _0x41f593[_0x1694('0x5c')](_0xcf4bed);}})[_0x1694('0x27')](function(_0x5794ed){if(_0x5794ed){return _0x5794ed?{'count':_0x479db9,'rows':_0x5794ed}:null;}})['then'](respondWithResult(_0x59a6b5,null))['catch'](handleError(_0x59a6b5,null));};
\ No newline at end of file
+var _0x63ba=['filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','show','params','keys','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','error','body','addUsers','omit','removeUsers','isArray','ids','userSquareProject:remove','getUsers','findOne','User','sort','nolimit','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','socket.io-emitter','./squareProject.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','then','get','SquareProjects','destroy','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query'];(function(_0x4c1678,_0x2afb36){var _0x1e9469=function(_0xd76668){while(--_0xd76668){_0x4c1678['push'](_0x4c1678['shift']());}};_0x1e9469(++_0x2afb36);}(_0x63ba,0x13c));var _0xa63b=function(_0x2f3038,_0x33d91e){_0x2f3038=_0x2f3038-0x0;var _0xba5b2e=_0x63ba[_0x2f3038];return _0xba5b2e;};'use strict';var emlformat=require(_0xa63b('0x0'));var rimraf=require(_0xa63b('0x1'));var zipdir=require(_0xa63b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa63b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa63b('0x4'));var util=require(_0xa63b('0x5'));var path=require(_0xa63b('0x6'));var sox=require(_0xa63b('0x7'));var csv=require(_0xa63b('0x8'));var ejs=require(_0xa63b('0x9'));var fs=require('fs');var fs_extra=require(_0xa63b('0xa'));var _=require('lodash');var squel=require(_0xa63b('0xb'));var crypto=require(_0xa63b('0xc'));var jsforce=require(_0xa63b('0xd'));var deskjs=require(_0xa63b('0xe'));var toCsv=require(_0xa63b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa63b('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa63b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa63b('0x11'));var utils=require(_0xa63b('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa63b('0x13')]=_[_0xa63b('0x14')](config[_0xa63b('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0xa63b('0x15'))(new Redis(config['redis']));require(_0xa63b('0x16'))[_0xa63b('0x17')](socket);function respondWithStatusCode(_0xa6c920,_0x3ac263){_0x3ac263=_0x3ac263||0xcc;return function(_0x41c474){if(_0x41c474){return _0xa6c920[_0xa63b('0x18')](_0x3ac263);}return _0xa6c920['status'](_0x3ac263)[_0xa63b('0x19')]();};}function respondWithResult(_0x19edb1,_0x1de421){_0x1de421=_0x1de421||0xc8;return function(_0xdb164d){if(_0xdb164d){return _0x19edb1['status'](_0x1de421)[_0xa63b('0x1a')](_0xdb164d);}};}function respondWithFilteredResult(_0x445514,_0x2a7220){return function(_0x4f08e2){if(_0x4f08e2){var _0x58e1=typeof _0x2a7220[_0xa63b('0x1b')]===_0xa63b('0x1c')&&typeof _0x2a7220[_0xa63b('0x1d')]===_0xa63b('0x1c');var _0xfe0b28=_0x4f08e2[_0xa63b('0x1e')];var _0x17bd39=_0x58e1?0x0:_0x2a7220['offset'];var _0x15b193=_0x58e1?_0x4f08e2[_0xa63b('0x1e')]:_0x2a7220[_0xa63b('0x1b')]+_0x2a7220[_0xa63b('0x1d')];var _0x4de492;if(_0x15b193>=_0xfe0b28){_0x15b193=_0xfe0b28;_0x4de492=0xc8;}else{_0x4de492=0xce;}_0x445514[_0xa63b('0x1f')](_0x4de492);return _0x445514[_0xa63b('0x20')](_0xa63b('0x21'),_0x17bd39+'-'+_0x15b193+'/'+_0xfe0b28)[_0xa63b('0x1a')](_0x4f08e2);}return null;};}function patchUpdates(_0x1c3541){return function(_0x30b346){try{jsonpatch[_0xa63b('0x22')](_0x30b346,_0x1c3541,!![]);}catch(_0x2849c7){return BPromise['reject'](_0x2849c7);}return _0x30b346[_0xa63b('0x23')]();};}function saveUpdates(_0x314842,_0x4350ea){return function(_0x22fed4){if(_0x22fed4){return _0x22fed4['update'](_0x314842)[_0xa63b('0x24')](function(_0x157fe3){return _0x157fe3;});}return null;};}function removeEntity(_0x5634ca,_0x3660d2){return function(_0x967846){if(_0x967846){return _0x967846['destroy']()['then'](function(){var _0x52d46c=_0x967846[_0xa63b('0x25')]({'plain':!![]});var _0x561605=_0xa63b('0x26');return db['UserProfileResource'][_0xa63b('0x27')]({'where':{'type':_0x561605,'resourceId':_0x52d46c['id']}})[_0xa63b('0x24')](function(){return _0x967846;});})['then'](function(){_0x5634ca[_0xa63b('0x1f')](0xcc)[_0xa63b('0x19')]();});}};}function handleEntityNotFound(_0x5606da,_0x52c71d){return function(_0x3e6613){if(!_0x3e6613){_0x5606da[_0xa63b('0x18')](0x194);}return _0x3e6613;};}function handleError(_0x236a4d,_0x5341f1){_0x5341f1=_0x5341f1||0x1f4;return function(_0x9200a3){logger['error'](_0x9200a3[_0xa63b('0x28')]);if(_0x9200a3[_0xa63b('0x29')]){delete _0x9200a3[_0xa63b('0x29')];}_0x236a4d[_0xa63b('0x1f')](_0x5341f1)[_0xa63b('0x2a')](_0x9200a3);};}exports[_0xa63b('0x2b')]=function(_0x1355c8,_0x2ad9c1){var _0x1ba2b2={},_0x44b920={},_0xc179e1={'count':0x0,'rows':[]};var _0x18f516=_[_0xa63b('0x2c')](db[_0xa63b('0x2d')][_0xa63b('0x2e')],function(_0x4af5c8){return{'name':_0x4af5c8[_0xa63b('0x2f')],'type':_0x4af5c8[_0xa63b('0x30')][_0xa63b('0x31')]};});_0x44b920[_0xa63b('0x32')]=_[_0xa63b('0x2c')](_0x18f516,_0xa63b('0x29'));_0x44b920[_0xa63b('0x33')]=_['keys'](_0x1355c8[_0xa63b('0x33')]);_0x44b920[_0xa63b('0x34')]=_[_0xa63b('0x35')](_0x44b920['model'],_0x44b920[_0xa63b('0x33')]);_0x1ba2b2['attributes']=_[_0xa63b('0x35')](_0x44b920[_0xa63b('0x32')],qs[_0xa63b('0x36')](_0x1355c8['query'][_0xa63b('0x36')]));_0x1ba2b2[_0xa63b('0x37')]=_0x1ba2b2[_0xa63b('0x37')][_0xa63b('0x38')]?_0x1ba2b2[_0xa63b('0x37')]:_0x44b920[_0xa63b('0x32')];if(!_0x1355c8[_0xa63b('0x33')][_0xa63b('0x39')]('nolimit')){_0x1ba2b2[_0xa63b('0x1d')]=qs[_0xa63b('0x1d')](_0x1355c8[_0xa63b('0x33')][_0xa63b('0x1d')]);_0x1ba2b2[_0xa63b('0x1b')]=qs[_0xa63b('0x1b')](_0x1355c8['query']['offset']);}_0x1ba2b2[_0xa63b('0x3a')]=qs['sort'](_0x1355c8[_0xa63b('0x33')]['sort']);_0x1ba2b2[_0xa63b('0x3b')]=qs[_0xa63b('0x34')](_[_0xa63b('0x3c')](_0x1355c8['query'],_0x44b920[_0xa63b('0x34')]),_0x18f516);if(_0x1355c8[_0xa63b('0x33')]['filter']){_0x1ba2b2[_0xa63b('0x3b')]=_[_0xa63b('0x3d')](_0x1ba2b2[_0xa63b('0x3b')],{'$or':_[_0xa63b('0x2c')](_0x18f516,function(_0x2b70b6){if(_0x2b70b6[_0xa63b('0x30')]!==_0xa63b('0x3e')){var _0x3cebf1={};_0x3cebf1[_0x2b70b6['name']]={'$like':'%'+_0x1355c8['query'][_0xa63b('0x3f')]+'%'};return _0x3cebf1;}})});}_0x1ba2b2=_['merge']({},_0x1ba2b2,_0x1355c8[_0xa63b('0x40')]);var _0x599f3c={'where':_0x1ba2b2[_0xa63b('0x3b')]};return db['SquareProject'][_0xa63b('0x1e')](_0x599f3c)['then'](function(_0x409c0d){_0xc179e1[_0xa63b('0x1e')]=_0x409c0d;if(_0x1355c8[_0xa63b('0x33')][_0xa63b('0x41')]){_0x1ba2b2['include']=[{'all':!![]}];}return db[_0xa63b('0x2d')][_0xa63b('0x42')](_0x1ba2b2);})[_0xa63b('0x24')](function(_0x2b36a1){_0xc179e1['rows']=_0x2b36a1;return _0xc179e1;})['then'](respondWithFilteredResult(_0x2ad9c1,_0x1ba2b2))['catch'](handleError(_0x2ad9c1,null));};exports[_0xa63b('0x43')]=function(_0x1ea836,_0x564894){var _0x569ac5={'raw':![],'where':{'id':_0x1ea836[_0xa63b('0x44')]['id']}},_0x56b3ff={};_0x56b3ff[_0xa63b('0x32')]=_[_0xa63b('0x45')](db[_0xa63b('0x2d')]['rawAttributes']);_0x56b3ff[_0xa63b('0x33')]=_[_0xa63b('0x45')](_0x1ea836['query']);_0x56b3ff['filters']=_[_0xa63b('0x35')](_0x56b3ff[_0xa63b('0x32')],_0x56b3ff[_0xa63b('0x33')]);_0x569ac5[_0xa63b('0x37')]=_[_0xa63b('0x35')](_0x56b3ff['model'],qs[_0xa63b('0x36')](_0x1ea836[_0xa63b('0x33')]['fields']));_0x569ac5[_0xa63b('0x37')]=_0x569ac5[_0xa63b('0x37')]['length']?_0x569ac5['attributes']:_0x56b3ff[_0xa63b('0x32')];if(_0x1ea836[_0xa63b('0x33')][_0xa63b('0x41')]){_0x569ac5[_0xa63b('0x46')]=[{'all':!![]}];}_0x569ac5=_['merge']({},_0x569ac5,_0x1ea836[_0xa63b('0x40')]);return db['SquareProject'][_0xa63b('0x47')](_0x569ac5)[_0xa63b('0x24')](handleEntityNotFound(_0x564894,null))[_0xa63b('0x24')](respondWithResult(_0x564894,null))[_0xa63b('0x48')](handleError(_0x564894,null));};exports[_0xa63b('0x49')]=function(_0x2bdf61,_0x3ff767){return db[_0xa63b('0x2d')]['create'](_0x2bdf61['body'],{})[_0xa63b('0x24')](function(_0x296615){var _0x58202d=_0x2bdf61[_0xa63b('0x4a')][_0xa63b('0x25')]({'plain':!![]});if(!_0x58202d)throw new Error(_0xa63b('0x4b'));if(_0x58202d['role']===_0xa63b('0x4a')){var _0x4da250=_0x296615[_0xa63b('0x25')]({'plain':!![]});var _0xa8b382=_0xa63b('0x26');return db[_0xa63b('0x4c')][_0xa63b('0x47')]({'where':{'name':_0xa8b382,'userProfileId':_0x58202d[_0xa63b('0x4d')]},'raw':!![]})[_0xa63b('0x24')](function(_0x30a6f1){if(_0x30a6f1&&_0x30a6f1['autoAssociation']===0x0){return db[_0xa63b('0x4e')][_0xa63b('0x49')]({'name':_0x4da250[_0xa63b('0x29')],'resourceId':_0x4da250['id'],'type':_0x30a6f1[_0xa63b('0x29')],'sectionId':_0x30a6f1['id']},{})[_0xa63b('0x24')](function(){return _0x296615;});}else{return _0x296615;}})[_0xa63b('0x48')](function(_0x4a5385){logger[_0xa63b('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a5385);throw _0x4a5385;});}return _0x296615;})[_0xa63b('0x24')](respondWithResult(_0x3ff767,0xc9))[_0xa63b('0x48')](handleError(_0x3ff767,null));};exports['update']=function(_0x2a2803,_0x156c6b){if(_0x2a2803[_0xa63b('0x50')]['id']){delete _0x2a2803[_0xa63b('0x50')]['id'];}return db[_0xa63b('0x2d')][_0xa63b('0x47')]({'where':{'id':_0x2a2803[_0xa63b('0x44')]['id']}})[_0xa63b('0x24')](handleEntityNotFound(_0x156c6b,null))[_0xa63b('0x24')](saveUpdates(_0x2a2803[_0xa63b('0x50')],null))[_0xa63b('0x24')](respondWithResult(_0x156c6b,null))[_0xa63b('0x48')](handleError(_0x156c6b,null));};exports[_0xa63b('0x27')]=function(_0x3973a9,_0x24d7f0){return db[_0xa63b('0x2d')][_0xa63b('0x47')]({'where':{'id':_0x3973a9[_0xa63b('0x44')]['id']}})['then'](handleEntityNotFound(_0x24d7f0,null))['then'](removeEntity(_0x24d7f0,null))[_0xa63b('0x48')](handleError(_0x24d7f0,null));};exports[_0xa63b('0x51')]=function(_0x4356e3,_0x3f0c7a,_0x2df6a5){return db[_0xa63b('0x2d')][_0xa63b('0x47')]({'where':{'id':_0x4356e3[_0xa63b('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f0c7a,null))[_0xa63b('0x24')](function(_0x30f2ae){if(_0x30f2ae){return _0x30f2ae[_0xa63b('0x51')](_0x4356e3[_0xa63b('0x50')]['ids'],_[_0xa63b('0x52')](_0x4356e3[_0xa63b('0x50')],['ids','id'])||{});}})['then'](respondWithResult(_0x3f0c7a,null))['catch'](handleError(_0x3f0c7a,null));};exports['removeUsers']=function(_0x5f3ae5,_0xf0719d,_0x2c7a93){return db[_0xa63b('0x2d')][_0xa63b('0x47')]({'where':{'id':_0x5f3ae5[_0xa63b('0x44')]['id']}})['then'](handleEntityNotFound(_0xf0719d,null))['then'](function(_0xb03707){if(_0xb03707){return _0xb03707[_0xa63b('0x53')](_0x5f3ae5[_0xa63b('0x33')]['ids'])[_0xa63b('0x24')](function(){if(_[_0xa63b('0x54')](_0x5f3ae5[_0xa63b('0x33')][_0xa63b('0x55')])){for(var _0x26b1d9=0x0;_0x26b1d9<_0x5f3ae5[_0xa63b('0x33')]['ids'][_0xa63b('0x38')];_0x26b1d9+=0x1){socket['emit'](_0xa63b('0x56'),{'UserId':Number(_0x5f3ae5['query'][_0xa63b('0x55')][_0x26b1d9]),'SquareProjectId':Number(_0x5f3ae5[_0xa63b('0x44')]['id'])});}}else{socket['emit'](_0xa63b('0x56'),{'UserId':Number(_0x5f3ae5[_0xa63b('0x33')][_0xa63b('0x55')]),'SquareProjectId':Number(_0x5f3ae5['params']['id'])});}});}})[_0xa63b('0x24')](respondWithStatusCode(_0xf0719d,null))[_0xa63b('0x48')](handleError(_0xf0719d,null));};exports[_0xa63b('0x57')]=function(_0x126801,_0x57aaa6,_0x28be23){var _0x1d113d={};var _0x2778bb={};var _0x1773b0;var _0x45b701;return db['SquareProject'][_0xa63b('0x58')]({'where':{'id':_0x126801[_0xa63b('0x44')]['id']}})[_0xa63b('0x24')](handleEntityNotFound(_0x57aaa6,null))['then'](function(_0x29bcc8){if(_0x29bcc8){_0x1773b0=_0x29bcc8;_0x2778bb['model']=_[_0xa63b('0x45')](db[_0xa63b('0x59')]['rawAttributes']);_0x2778bb['query']=_[_0xa63b('0x45')](_0x126801[_0xa63b('0x33')]);_0x2778bb[_0xa63b('0x34')]=_[_0xa63b('0x35')](_0x2778bb[_0xa63b('0x32')],_0x2778bb[_0xa63b('0x33')]);_0x1d113d[_0xa63b('0x37')]=_[_0xa63b('0x35')](_0x2778bb[_0xa63b('0x32')],qs[_0xa63b('0x36')](_0x126801['query']['fields']));_0x1d113d[_0xa63b('0x37')]=_0x1d113d[_0xa63b('0x37')]['length']?_0x1d113d[_0xa63b('0x37')]:_0x2778bb[_0xa63b('0x32')];_0x1d113d[_0xa63b('0x3a')]=qs[_0xa63b('0x5a')](_0x126801['query'][_0xa63b('0x5a')]);_0x1d113d[_0xa63b('0x3b')]=qs['filters'](_[_0xa63b('0x3c')](_0x126801[_0xa63b('0x33')],_0x2778bb[_0xa63b('0x34')]));if(_0x126801[_0xa63b('0x33')][_0xa63b('0x3f')]){_0x1d113d[_0xa63b('0x3b')]=_[_0xa63b('0x3d')](_0x1d113d[_0xa63b('0x3b')],{'$or':_['map'](_0x1d113d[_0xa63b('0x37')],function(_0xa4ba4c){var _0x34625b={};_0x34625b[_0xa4ba4c]={'$like':'%'+_0x126801[_0xa63b('0x33')]['filter']+'%'};return _0x34625b;})});}_0x1d113d=_[_0xa63b('0x3d')]({},_0x1d113d,_0x126801[_0xa63b('0x40')]);return _0x1773b0['getUsers'](_0x1d113d);}})[_0xa63b('0x24')](function(_0x17f5f1){if(_0x17f5f1){_0x45b701=_0x17f5f1['length'];if(!_0x126801['query']['hasOwnProperty'](_0xa63b('0x5b'))){_0x1d113d[_0xa63b('0x1d')]=qs[_0xa63b('0x1d')](_0x126801[_0xa63b('0x33')]['limit']);_0x1d113d[_0xa63b('0x1b')]=qs[_0xa63b('0x1b')](_0x126801['query'][_0xa63b('0x1b')]);}return _0x1773b0[_0xa63b('0x57')](_0x1d113d);}})[_0xa63b('0x24')](function(_0x211b07){if(_0x211b07){return _0x211b07?{'count':_0x45b701,'rows':_0x211b07}:null;}})[_0xa63b('0x24')](respondWithResult(_0x57aaa6,null))[_0xa63b('0x48')](handleError(_0x57aaa6,null));};
\ No newline at end of file
index bbe485c..74b05f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a81=['../../mysqldb','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x59d88b,_0x53b998){var _0x12e02e=function(_0x4e2772){while(--_0x4e2772){_0x59d88b['push'](_0x59d88b['shift']());}};_0x12e02e(++_0x53b998);}(_0x8a81,0x1a0));var _0x18a8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8a81[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0x18a8('0x0'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x18a8('0x1'),'afterUpdate':_0x18a8('0x2'),'afterDestroy':_0x18a8('0x3')};function emitEvent(_0x428627){return function(_0x1daec2,_0x1ee320,_0x103490){SquareProjectEvents[_0x18a8('0x4')](_0x428627+':'+_0x1daec2['id'],_0x1daec2);SquareProjectEvents[_0x18a8('0x4')](_0x428627,_0x1daec2);_0x103490(null);};}for(var e in events){if(events[_0x18a8('0x5')](e)){var event=events[e];SquareProject[_0x18a8('0x6')](e,emitEvent(event));}}module[_0x18a8('0x7')]=SquareProjectEvents;
\ No newline at end of file
+var _0xea1b=['SquareProject','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x252afc,_0x302af5){var _0x2c71bb=function(_0x1c8251){while(--_0x1c8251){_0x252afc['push'](_0x252afc['shift']());}};_0x2c71bb(++_0x302af5);}(_0xea1b,0x8f));var _0xbea1=function(_0x4681d1,_0x5823ea){_0x4681d1=_0x4681d1-0x0;var _0x4bf18c=_0xea1b[_0x4681d1];return _0x4bf18c;};'use strict';var EventEmitter=require(_0xbea1('0x0'));var SquareProject=require('../../mysqldb')['db'][_0xbea1('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xbea1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbea1('0x3'),'afterDestroy':_0xbea1('0x4')};function emitEvent(_0x5d6f2f){return function(_0x2e409c,_0x5b87fc,_0x5d96a4){SquareProjectEvents['emit'](_0x5d6f2f+':'+_0x2e409c['id'],_0x2e409c);SquareProjectEvents[_0xbea1('0x5')](_0x5d6f2f,_0x2e409c);_0x5d96a4(null);};}for(var e in events){if(events[_0xbea1('0x6')](e)){var event=events[e];SquareProject[_0xbea1('0x7')](e,emitEvent(event));}}module[_0xbea1('0x8')]=SquareProjectEvents;
\ No newline at end of file
index b5dfb13..ea16130 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd13=['util','../../config/logger','moment','rimraf','./squareProject.attributes','exports','define','square_projects','changed','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash'];(function(_0x250fee,_0x350553){var _0x85c0dc=function(_0x4eef70){while(--_0x4eef70){_0x250fee['push'](_0x250fee['shift']());}};_0x85c0dc(++_0x350553);}(_0xcd13,0x137));var _0x3cd1=function(_0x3c3035,_0xafab1){_0x3c3035=_0x3c3035-0x0;var _0x2efab6=_0xcd13[_0x3c3035];return _0x2efab6;};'use strict';var _=require(_0x3cd1('0x0'));var util=require(_0x3cd1('0x1'));var logger=require(_0x3cd1('0x2'))('api');var moment=require(_0x3cd1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3cd1('0x4'));var config=require('../../config/environment');var attributes=require(_0x3cd1('0x5'));module[_0x3cd1('0x6')]=function(_0x260d1c,_0x5e7452){return _0x260d1c[_0x3cd1('0x7')]('SquareProject',attributes,{'tableName':_0x3cd1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d557c,_0x2e63f5,_0x579dcc){if(_0x3d557c[_0x3cd1('0x9')]('preproduction')){_0x3d557c['savedAt']=moment()[_0x3cd1('0xa')](_0x3cd1('0xb'));}if(_0x3d557c[_0x3cd1('0x9')]('production')){_0x3d557c[_0x3cd1('0xc')]=moment()[_0x3cd1('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x579dcc(null,_0x3d557c);}}});};
\ No newline at end of file
+var _0x9f89=['exports','SquareProject','square_projects','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','format','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3d63da,_0x4c6968){var _0x37fe1f=function(_0x2a58dd){while(--_0x2a58dd){_0x3d63da['push'](_0x3d63da['shift']());}};_0x37fe1f(++_0x4c6968);}(_0x9f89,0x1de));var _0x99f8=function(_0x12dc1f,_0x395cec){_0x12dc1f=_0x12dc1f-0x0;var _0x47fdb8=_0x9f89[_0x12dc1f];return _0x47fdb8;};'use strict';var _=require('lodash');var util=require(_0x99f8('0x0'));var logger=require(_0x99f8('0x1'))('api');var moment=require(_0x99f8('0x2'));var BPromise=require(_0x99f8('0x3'));var rp=require(_0x99f8('0x4'));var fs=require('fs');var path=require(_0x99f8('0x5'));var rimraf=require(_0x99f8('0x6'));var config=require(_0x99f8('0x7'));var attributes=require('./squareProject.attributes');module[_0x99f8('0x8')]=function(_0x4ae388,_0x5418fa){return _0x4ae388['define'](_0x99f8('0x9'),attributes,{'tableName':_0x99f8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f7420,_0x31f490,_0x2439b4){if(_0x4f7420['changed'](_0x99f8('0xb'))){_0x4f7420[_0x99f8('0xc')]=moment()['format'](_0x99f8('0xd'));}if(_0x4f7420[_0x99f8('0xe')](_0x99f8('0xf'))){_0x4f7420[_0x99f8('0x10')]=moment()[_0x99f8('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2439b4(null,_0x4f7420);}}});};
\ No newline at end of file
index 1b71252..26cd6e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc549=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','catch','find','options','raw','where','attributes','include','model','map','ShowSquareProject','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x5e716b,_0x133ea1){var _0x22070c=function(_0x1143e7){while(--_0x1143e7){_0x5e716b['push'](_0x5e716b['shift']());}};_0x22070c(++_0x133ea1);}(_0xc549,0x1e8));var _0x9c54=function(_0x3a2c75,_0x2bcad6){_0x3a2c75=_0x3a2c75-0x0;var _0x3ff04e=_0xc549[_0x3a2c75];return _0x3ff04e;};'use strict';var _=require(_0x9c54('0x0'));var util=require(_0x9c54('0x1'));var moment=require(_0x9c54('0x2'));var BPromise=require(_0x9c54('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c54('0x4'))['db'];var utils=require(_0x9c54('0x5'));var logger=require(_0x9c54('0x6'))(_0x9c54('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c54('0x8'));var client=jayson[_0x9c54('0x9')][_0x9c54('0xa')]({'port':0x232a});config[_0x9c54('0xb')]=_[_0x9c54('0xc')](config[_0x9c54('0xb')],{'host':_0x9c54('0xd'),'port':0x18eb});var socket=require(_0x9c54('0xe'))(new Redis(config[_0x9c54('0xb')]));require('./squareProject.socket')[_0x9c54('0xf')](socket);function respondWithRpcPromise(_0x1fe55e,_0x5824c5,_0x52d41b){return new BPromise(function(_0x17a892,_0x3e3450){return client[_0x9c54('0x10')](_0x1fe55e,_0x52d41b)[_0x9c54('0x11')](function(_0x401d0b){logger[_0x9c54('0x12')]('SquareProject,\x20%s,\x20%s',_0x5824c5,_0x9c54('0x13'));logger['debug'](_0x9c54('0x14'),_0x5824c5,'request\x20sent',JSON[_0x9c54('0x15')](_0x401d0b));if(_0x401d0b[_0x9c54('0x16')]){if(_0x401d0b[_0x9c54('0x16')][_0x9c54('0x17')]===0x1f4){logger[_0x9c54('0x16')](_0x9c54('0x18'),_0x5824c5,_0x401d0b['error'][_0x9c54('0x19')]);return _0x3e3450(_0x401d0b[_0x9c54('0x16')][_0x9c54('0x19')]);}logger[_0x9c54('0x16')](_0x9c54('0x18'),_0x5824c5,_0x401d0b[_0x9c54('0x16')][_0x9c54('0x19')]);return _0x17a892(_0x401d0b[_0x9c54('0x16')][_0x9c54('0x19')]);}else{logger[_0x9c54('0x12')](_0x9c54('0x18'),_0x5824c5,_0x9c54('0x13'));_0x17a892(_0x401d0b[_0x9c54('0x1a')][_0x9c54('0x19')]);}})[_0x9c54('0x1b')](function(_0x91142c){logger[_0x9c54('0x16')](_0x9c54('0x18'),_0x5824c5,_0x91142c);_0x3e3450(_0x91142c);});});}exports['ShowSquareProject']=function(_0x5b33dd){var _0xab5330=this;return new Promise(function(_0x2da00b,_0x173191){return db['SquareProject'][_0x9c54('0x1c')]({'raw':_0x5b33dd[_0x9c54('0x1d')]?_0x5b33dd[_0x9c54('0x1d')][_0x9c54('0x1e')]===undefined?!![]:![]:!![],'where':_0x5b33dd['options']?_0x5b33dd[_0x9c54('0x1d')][_0x9c54('0x1f')]||null:null,'attributes':_0x5b33dd[_0x9c54('0x1d')]?_0x5b33dd['options'][_0x9c54('0x20')]||null:null,'include':_0x5b33dd[_0x9c54('0x1d')]?_0x5b33dd[_0x9c54('0x1d')][_0x9c54('0x21')]?_['map'](_0x5b33dd[_0x9c54('0x1d')][_0x9c54('0x21')],function(_0x52ffbb){return{'model':db[_0x52ffbb[_0x9c54('0x22')]],'as':_0x52ffbb['as'],'attributes':_0x52ffbb[_0x9c54('0x20')],'include':_0x52ffbb[_0x9c54('0x21')]?_[_0x9c54('0x23')](_0x52ffbb[_0x9c54('0x21')],function(_0x24f14f){return{'model':db[_0x24f14f['model']],'as':_0x24f14f['as'],'attributes':_0x24f14f[_0x9c54('0x20')],'include':_0x24f14f['include']?_[_0x9c54('0x23')](_0x24f14f[_0x9c54('0x21')],function(_0x372d2e){return{'model':db[_0x372d2e[_0x9c54('0x22')]],'as':_0x372d2e['as'],'attributes':_0x372d2e[_0x9c54('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9c54('0x11')](function(_0x372bac){logger[_0x9c54('0x12')](_0x9c54('0x24'),_0x5b33dd);logger[_0x9c54('0x25')](_0x9c54('0x24'),_0x5b33dd,JSON[_0x9c54('0x15')](_0x372bac));_0x2da00b(_0x372bac);})[_0x9c54('0x1b')](function(_0x582501){logger[_0x9c54('0x16')](_0x9c54('0x24'),_0x582501[_0x9c54('0x19')],_0x5b33dd);_0x173191(_0xab5330['error'](0x1f4,_0x582501['message']));});});};
\ No newline at end of file
+var _0xa295=['SquareProject','find','options','attributes','map','include','model','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject'];(function(_0x5f2116,_0x55c6c4){var _0x93adff=function(_0x491eda){while(--_0x491eda){_0x5f2116['push'](_0x5f2116['shift']());}};_0x93adff(++_0x55c6c4);}(_0xa295,0x194));var _0x5a29=function(_0x4c1562,_0x552b65){_0x4c1562=_0x4c1562-0x0;var _0x19255b=_0xa295[_0x4c1562];return _0x19255b;};'use strict';var _=require('lodash');var util=require(_0x5a29('0x0'));var moment=require(_0x5a29('0x1'));var BPromise=require(_0x5a29('0x2'));var rs=require(_0x5a29('0x3'));var fs=require('fs');var Redis=require(_0x5a29('0x4'));var db=require(_0x5a29('0x5'))['db'];var utils=require(_0x5a29('0x6'));var logger=require('../../config/logger')(_0x5a29('0x7'));var config=require(_0x5a29('0x8'));var jayson=require(_0x5a29('0x9'));var client=jayson[_0x5a29('0xa')]['http']({'port':0x232a});config[_0x5a29('0xb')]=_[_0x5a29('0xc')](config[_0x5a29('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5a29('0xd'))(new Redis(config[_0x5a29('0xb')]));require('./squareProject.socket')[_0x5a29('0xe')](socket);function respondWithRpcPromise(_0x1b0891,_0x4e4b96,_0x44c179){return new BPromise(function(_0x3ec41b,_0x514b84){return client[_0x5a29('0xf')](_0x1b0891,_0x44c179)['then'](function(_0x405a92){logger[_0x5a29('0x10')](_0x5a29('0x11'),_0x4e4b96,_0x5a29('0x12'));logger[_0x5a29('0x13')](_0x5a29('0x14'),_0x4e4b96,'request\x20sent',JSON[_0x5a29('0x15')](_0x405a92));if(_0x405a92['error']){if(_0x405a92[_0x5a29('0x16')][_0x5a29('0x17')]===0x1f4){logger[_0x5a29('0x16')](_0x5a29('0x11'),_0x4e4b96,_0x405a92[_0x5a29('0x16')]['message']);return _0x514b84(_0x405a92[_0x5a29('0x16')][_0x5a29('0x18')]);}logger[_0x5a29('0x16')]('SquareProject,\x20%s,\x20%s',_0x4e4b96,_0x405a92['error']['message']);return _0x3ec41b(_0x405a92[_0x5a29('0x16')]['message']);}else{logger[_0x5a29('0x10')](_0x5a29('0x11'),_0x4e4b96,_0x5a29('0x12'));_0x3ec41b(_0x405a92[_0x5a29('0x19')]['message']);}})[_0x5a29('0x1a')](function(_0x32d3b8){logger[_0x5a29('0x16')](_0x5a29('0x11'),_0x4e4b96,_0x32d3b8);_0x514b84(_0x32d3b8);});});}exports[_0x5a29('0x1b')]=function(_0x285490){var _0x544e93=this;return new Promise(function(_0xb3a719,_0x517bc5){return db[_0x5a29('0x1c')][_0x5a29('0x1d')]({'raw':_0x285490[_0x5a29('0x1e')]?_0x285490[_0x5a29('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x285490['options']?_0x285490[_0x5a29('0x1e')]['where']||null:null,'attributes':_0x285490[_0x5a29('0x1e')]?_0x285490[_0x5a29('0x1e')][_0x5a29('0x1f')]||null:null,'include':_0x285490[_0x5a29('0x1e')]?_0x285490[_0x5a29('0x1e')]['include']?_[_0x5a29('0x20')](_0x285490[_0x5a29('0x1e')][_0x5a29('0x21')],function(_0x4656a4){return{'model':db[_0x4656a4[_0x5a29('0x22')]],'as':_0x4656a4['as'],'attributes':_0x4656a4['attributes'],'include':_0x4656a4[_0x5a29('0x21')]?_[_0x5a29('0x20')](_0x4656a4[_0x5a29('0x21')],function(_0x3d792e){return{'model':db[_0x3d792e['model']],'as':_0x3d792e['as'],'attributes':_0x3d792e[_0x5a29('0x1f')],'include':_0x3d792e[_0x5a29('0x21')]?_['map'](_0x3d792e[_0x5a29('0x21')],function(_0x570d37){return{'model':db[_0x570d37[_0x5a29('0x22')]],'as':_0x570d37['as'],'attributes':_0x570d37[_0x5a29('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5a29('0x23')](function(_0xd929b1){logger[_0x5a29('0x10')]('ShowSquareProject',_0x285490);logger[_0x5a29('0x13')]('ShowSquareProject',_0x285490,JSON[_0x5a29('0x15')](_0xd929b1));_0xb3a719(_0xd929b1);})[_0x5a29('0x1a')](function(_0xb2115a){logger[_0x5a29('0x16')]('ShowSquareProject',_0xb2115a[_0x5a29('0x18')],_0x285490);_0x517bc5(_0x544e93[_0x5a29('0x16')](0x1f4,_0xb2115a[_0x5a29('0x18')]));});});};
\ No newline at end of file
index ea29d57..1107ea2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4edc=['remove','update','emit','removeListener','register','length','save'];(function(_0x16109f,_0x155f4a){var _0xc77d03=function(_0x271d70){while(--_0x271d70){_0x16109f['push'](_0x16109f['shift']());}};_0xc77d03(++_0x155f4a);}(_0x4edc,0xbc));var _0xc4ed=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x4edc[_0x525af9];return _0x129fbf;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0xc4ed('0x0'),_0xc4ed('0x1'),_0xc4ed('0x2')];function createListener(_0x43d87a,_0x145b66){return function(_0x389687){_0x145b66[_0xc4ed('0x3')](_0x43d87a,_0x389687);};}function removeListener(_0x2efba9,_0x57d367){return function(){SquareProjectEvents[_0xc4ed('0x4')](_0x2efba9,_0x57d367);};}exports[_0xc4ed('0x5')]=function(_0x1d8bcc){for(var _0x1c9c94=0x0,_0x28d475=events[_0xc4ed('0x6')];_0x1c9c94<_0x28d475;_0x1c9c94++){var _0x43a42b=events[_0x1c9c94];var _0x32d1b9=createListener('squareProject:'+_0x43a42b,_0x1d8bcc);SquareProjectEvents['on'](_0x43a42b,_0x32d1b9);}};
\ No newline at end of file
+var _0xc27f=['./squareProject.events','save','remove','register','length','squareProject:'];(function(_0x1ea99d,_0x2d4fa9){var _0x2e2430=function(_0x33596d){while(--_0x33596d){_0x1ea99d['push'](_0x1ea99d['shift']());}};_0x2e2430(++_0x2d4fa9);}(_0xc27f,0x78));var _0xfc27=function(_0x569c69,_0x4658bd){_0x569c69=_0x569c69-0x0;var _0x33079b=_0xc27f[_0x569c69];return _0x33079b;};'use strict';var SquareProjectEvents=require(_0xfc27('0x0'));var events=[_0xfc27('0x1'),_0xfc27('0x2'),'update'];function createListener(_0x1f6c54,_0x486ba9){return function(_0x4fee80){_0x486ba9['emit'](_0x1f6c54,_0x4fee80);};}function removeListener(_0x1fb44f,_0x456ed7){return function(){SquareProjectEvents['removeListener'](_0x1fb44f,_0x456ed7);};}exports[_0xfc27('0x3')]=function(_0xc1824e){for(var _0x435a4a=0x0,_0x3ce2bd=events[_0xfc27('0x4')];_0x435a4a<_0x3ce2bd;_0x435a4a++){var _0x5a2d75=events[_0x435a4a];var _0x5d1ff7=createListener(_0xfc27('0x5')+_0x5a2d75,_0xc1824e);SquareProjectEvents['on'](_0x5a2d75,_0x5d1ff7);}};
\ No newline at end of file
index 1437d03..d5bcdaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x497fd1,_0x37c8b7){var _0x4821fc=function(_0x43f1be){while(--_0x43f1be){_0x497fd1['push'](_0x497fd1['shift']());}};_0x4821fc(++_0x37c8b7);}(_0x53ec,0x192));var _0xc53e=function(_0x1b5805,_0x1d1f54){_0x1b5805=_0x1b5805-0x0;var _0x4b0de6=_0x53ec[_0x1b5805];return _0x4b0de6;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router;
\ No newline at end of file
+var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x3792f7,_0x4ec0d3){var _0xc4dd01=function(_0x493fba){while(--_0x493fba){_0x3792f7['push'](_0x3792f7['shift']());}};_0xc4dd01(++_0x4ec0d3);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x16f5d5,_0x184bb0){_0x16f5d5=_0x16f5d5-0x0;var _0x1b9f8c=_0x7fbe[_0x16f5d5];return _0x1b9f8c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var fs_extra=require(_0xe7fb('0x4'));var auth=require(_0xe7fb('0x5'));var interaction=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var controller=require(_0xe7fb('0x8'));router[_0xe7fb('0x9')]('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xb')]);router[_0xe7fb('0x9')](_0xe7fb('0xc'),auth['isAuthenticated'](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0x9')](_0xe7fb('0xe'),auth[_0xe7fb('0xa')](),controller['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router;
\ No newline at end of file
index 1368258..aa065a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbf5=['lastIndexOf','exports','STRING','VIRTUAL','savePath'];(function(_0x469f2a,_0x2819ca){var _0x59c8ce=function(_0x50113f){while(--_0x50113f){_0x469f2a['push'](_0x469f2a['shift']());}};_0x59c8ce(++_0x2819ca);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x1857fd,_0x3989fa){_0x1857fd=_0x1857fd-0x0;var _0x51290b=_0xdbf5[_0x1857fd];return _0x51290b;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5dbf('0x1')]},'context':{'type':Sequelize[_0x5dbf('0x1')]},'extension':{'type':Sequelize[_0x5dbf('0x1')]},'priority':{'type':Sequelize[_0x5dbf('0x1')]},'accountcode':{'type':Sequelize[_0x5dbf('0x1')]},'dnid':{'type':Sequelize[_0x5dbf('0x1')]},'projectName':{'type':Sequelize[_0x5dbf('0x1')]},'saveName':{'type':Sequelize[_0x5dbf('0x1')]},'filename':{'type':Sequelize[_0x5dbf('0x1')]},'savePath':{'type':Sequelize[_0x5dbf('0x1')]},'format':{'type':Sequelize[_0x5dbf('0x2')],'get':function(){var _0x88128e='';var _0x93e657=this['getDataValue'](_0x5dbf('0x3'));if(_0x93e657){_0x88128e=_0x93e657['substring'](_0x93e657[_0x5dbf('0x4')]('.'));}return _0x88128e;}}};
\ No newline at end of file
+var _0x6aa7=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x6aa7,0x178));var _0x76aa=function(_0x6d76e,_0xc6837){_0x6d76e=_0x6d76e-0x0;var _0x49d5a2=_0x6aa7[_0x6d76e];return _0x49d5a2;};'use strict';var Sequelize=require(_0x76aa('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x76aa('0x1')]},'callerid':{'type':Sequelize[_0x76aa('0x1')]},'calleridname':{'type':Sequelize[_0x76aa('0x1')]},'context':{'type':Sequelize[_0x76aa('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x76aa('0x1')]},'accountcode':{'type':Sequelize[_0x76aa('0x1')]},'dnid':{'type':Sequelize[_0x76aa('0x1')]},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x76aa('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x76aa('0x2')],'get':function(){var _0x36d12b='';var _0xa9b695=this['getDataValue'](_0x76aa('0x3'));if(_0xa9b695){_0x36d12b=_0xa9b695[_0x76aa('0x4')](_0xa9b695[_0x76aa('0x5')]('.'));}return _0x36d12b;}}};
\ No newline at end of file
index 111b1dc..76135db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6eab=['type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','download','../../components/encryptor','savePath','format','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','existsSync','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','error','stack','name','send','map','SquareRecording','rawAttributes'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6eab,0x15e));var _0xb6ea=function(_0x3c5f49,_0x2ca859){_0x3c5f49=_0x3c5f49-0x0;var _0xb0b1c6=_0x6eab[_0x3c5f49];return _0xb0b1c6;};'use strict';var emlformat=require(_0xb6ea('0x0'));var rimraf=require(_0xb6ea('0x1'));var zipdir=require(_0xb6ea('0x2'));var jsonpatch=require(_0xb6ea('0x3'));var rp=require(_0xb6ea('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb6ea('0x5'));var path=require(_0xb6ea('0x6'));var sox=require(_0xb6ea('0x7'));var csv=require(_0xb6ea('0x8'));var ejs=require(_0xb6ea('0x9'));var fs=require('fs');var fs_extra=require(_0xb6ea('0xa'));var _=require('lodash');var squel=require(_0xb6ea('0xb'));var crypto=require(_0xb6ea('0xc'));var jsforce=require(_0xb6ea('0xd'));var deskjs=require(_0xb6ea('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb6ea('0xf'));var Papa=require(_0xb6ea('0x10'));var Redis=require(_0xb6ea('0x11'));var authService=require(_0xb6ea('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb6ea('0x13'));var hardwareService=require(_0xb6ea('0x14'));var logger=require(_0xb6ea('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xb6ea('0x16'));var licenseUtil=require(_0xb6ea('0x17'));var db=require(_0xb6ea('0x18'))['db'];function respondWithStatusCode(_0x312020,_0x11f07a){_0x11f07a=_0x11f07a||0xcc;return function(_0x5424e5){if(_0x5424e5){return _0x312020[_0xb6ea('0x19')](_0x11f07a);}return _0x312020[_0xb6ea('0x1a')](_0x11f07a)[_0xb6ea('0x1b')]();};}function respondWithResult(_0x13da0a,_0x2a5505){_0x2a5505=_0x2a5505||0xc8;return function(_0x30a29a){if(_0x30a29a){return _0x13da0a[_0xb6ea('0x1a')](_0x2a5505)[_0xb6ea('0x1c')](_0x30a29a);}};}function respondWithFilteredResult(_0x5391a0,_0x464118){return function(_0x454040){if(_0x454040){var _0x1a3945=typeof _0x464118[_0xb6ea('0x1d')]===_0xb6ea('0x1e')&&typeof _0x464118['limit']===_0xb6ea('0x1e');var _0xe87d75=_0x454040['count'];var _0x2ff3a9=_0x1a3945?0x0:_0x464118['offset'];var _0xba179e=_0x1a3945?_0x454040[_0xb6ea('0x1f')]:_0x464118['offset']+_0x464118[_0xb6ea('0x20')];var _0x4767d9;if(_0xba179e>=_0xe87d75){_0xba179e=_0xe87d75;_0x4767d9=0xc8;}else{_0x4767d9=0xce;}_0x5391a0['status'](_0x4767d9);return _0x5391a0[_0xb6ea('0x21')]('Content-Range',_0x2ff3a9+'-'+_0xba179e+'/'+_0xe87d75)[_0xb6ea('0x1c')](_0x454040);}return null;};}function patchUpdates(_0x3903ac){return function(_0x244a4d){try{jsonpatch[_0xb6ea('0x22')](_0x244a4d,_0x3903ac,!![]);}catch(_0x2f11b5){return BPromise[_0xb6ea('0x23')](_0x2f11b5);}return _0x244a4d[_0xb6ea('0x24')]();};}function saveUpdates(_0x59a422,_0x28d679){return function(_0x49b93a){if(_0x49b93a){return _0x49b93a[_0xb6ea('0x25')](_0x59a422)[_0xb6ea('0x26')](function(_0x38dbee){return _0x38dbee;});}return null;};}function removeEntity(_0x526151,_0x154d88){return function(_0x311cfd){if(_0x311cfd){return _0x311cfd['destroy']()['then'](function(){_0x526151[_0xb6ea('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x493aa7,_0x5887bc){return function(_0x3c1f82){if(!_0x3c1f82){_0x493aa7[_0xb6ea('0x19')](0x194);}return _0x3c1f82;};}function handleError(_0x17516e,_0x3f0763){_0x3f0763=_0x3f0763||0x1f4;return function(_0x4830fc){logger[_0xb6ea('0x27')](_0x4830fc[_0xb6ea('0x28')]);if(_0x4830fc[_0xb6ea('0x29')]){delete _0x4830fc[_0xb6ea('0x29')];}_0x17516e[_0xb6ea('0x1a')](_0x3f0763)[_0xb6ea('0x2a')](_0x4830fc);};}exports['index']=function(_0x1608b5,_0x479f5f){var _0x3dabeb={},_0x423bf6={},_0x38a4cd={'count':0x0,'rows':[]};var _0xe12565=_[_0xb6ea('0x2b')](db[_0xb6ea('0x2c')][_0xb6ea('0x2d')],function(_0x5da093){return{'name':_0x5da093['fieldName'],'type':_0x5da093[_0xb6ea('0x2e')][_0xb6ea('0x2f')]};});_0x423bf6[_0xb6ea('0x30')]=_[_0xb6ea('0x2b')](_0xe12565,_0xb6ea('0x29'));_0x423bf6[_0xb6ea('0x31')]=_[_0xb6ea('0x32')](_0x1608b5['query']);_0x423bf6[_0xb6ea('0x33')]=_['intersection'](_0x423bf6[_0xb6ea('0x30')],_0x423bf6[_0xb6ea('0x31')]);_0x3dabeb[_0xb6ea('0x34')]=_[_0xb6ea('0x35')](_0x423bf6['model'],qs[_0xb6ea('0x36')](_0x1608b5['query'][_0xb6ea('0x36')]));_0x3dabeb['attributes']=_0x3dabeb['attributes'][_0xb6ea('0x37')]?_0x3dabeb[_0xb6ea('0x34')]:_0x423bf6[_0xb6ea('0x30')];if(!_0x1608b5[_0xb6ea('0x31')]['hasOwnProperty'](_0xb6ea('0x38'))){_0x3dabeb['limit']=qs[_0xb6ea('0x20')](_0x1608b5[_0xb6ea('0x31')][_0xb6ea('0x20')]);_0x3dabeb[_0xb6ea('0x1d')]=qs[_0xb6ea('0x1d')](_0x1608b5[_0xb6ea('0x31')]['offset']);}_0x3dabeb[_0xb6ea('0x39')]=qs[_0xb6ea('0x3a')](_0x1608b5['query'][_0xb6ea('0x3a')]);_0x3dabeb[_0xb6ea('0x3b')]=qs[_0xb6ea('0x33')](_[_0xb6ea('0x3c')](_0x1608b5[_0xb6ea('0x31')],_0x423bf6[_0xb6ea('0x33')]),_0xe12565);if(_0x1608b5[_0xb6ea('0x31')]['filter']){_0x3dabeb[_0xb6ea('0x3b')]=_['merge'](_0x3dabeb[_0xb6ea('0x3b')],{'$or':_[_0xb6ea('0x2b')](_0xe12565,function(_0x495c91){if(_0x495c91['type']!==_0xb6ea('0x3d')){var _0x392a27={};_0x392a27[_0x495c91[_0xb6ea('0x29')]]={'$like':'%'+_0x1608b5[_0xb6ea('0x31')][_0xb6ea('0x3e')]+'%'};return _0x392a27;}})});}_0x3dabeb=_[_0xb6ea('0x3f')]({},_0x3dabeb,_0x1608b5[_0xb6ea('0x40')]);var _0x5450e2={'where':_0x3dabeb[_0xb6ea('0x3b')]};return db['SquareRecording'][_0xb6ea('0x1f')](_0x5450e2)['then'](function(_0x4ed24c){_0x38a4cd['count']=_0x4ed24c;if(_0x1608b5[_0xb6ea('0x31')][_0xb6ea('0x41')]){_0x3dabeb['include']=[{'all':!![]}];}return db['SquareRecording'][_0xb6ea('0x42')](_0x3dabeb);})[_0xb6ea('0x26')](function(_0x10c0c2){_0x38a4cd[_0xb6ea('0x43')]=_0x10c0c2;return _0x38a4cd;})[_0xb6ea('0x26')](respondWithFilteredResult(_0x479f5f,_0x3dabeb))[_0xb6ea('0x44')](handleError(_0x479f5f,null));};exports[_0xb6ea('0x45')]=function(_0x2fb3a9,_0x2b3e63){var _0x588159={'raw':!![],'where':{'id':_0x2fb3a9['params']['id']}},_0x407fe4={};_0x407fe4['model']=_['keys'](db[_0xb6ea('0x2c')][_0xb6ea('0x2d')]);_0x407fe4[_0xb6ea('0x31')]=_['keys'](_0x2fb3a9[_0xb6ea('0x31')]);_0x407fe4['filters']=_['intersection'](_0x407fe4[_0xb6ea('0x30')],_0x407fe4[_0xb6ea('0x31')]);_0x588159[_0xb6ea('0x34')]=_[_0xb6ea('0x35')](_0x407fe4[_0xb6ea('0x30')],qs[_0xb6ea('0x36')](_0x2fb3a9[_0xb6ea('0x31')][_0xb6ea('0x36')]));_0x588159[_0xb6ea('0x34')]=_0x588159[_0xb6ea('0x34')][_0xb6ea('0x37')]?_0x588159[_0xb6ea('0x34')]:_0x407fe4['model'];if(_0x2fb3a9['query'][_0xb6ea('0x41')]){_0x588159[_0xb6ea('0x46')]=[{'all':!![]}];}_0x588159=_[_0xb6ea('0x3f')]({},_0x588159,_0x2fb3a9[_0xb6ea('0x40')]);return db[_0xb6ea('0x2c')][_0xb6ea('0x47')](_0x588159)['then'](handleEntityNotFound(_0x2b3e63,null))[_0xb6ea('0x26')](respondWithResult(_0x2b3e63,null))[_0xb6ea('0x44')](handleError(_0x2b3e63,null));};exports[_0xb6ea('0x48')]=function(_0x32bb09,_0xc2e594){return db['SquareRecording'][_0xb6ea('0x48')](_0x32bb09[_0xb6ea('0x49')],{})[_0xb6ea('0x26')](respondWithResult(_0xc2e594,0xc9))[_0xb6ea('0x44')](handleError(_0xc2e594,null));};exports[_0xb6ea('0x25')]=function(_0x3564fb,_0x1e94ed){if(_0x3564fb[_0xb6ea('0x49')]['id']){delete _0x3564fb[_0xb6ea('0x49')]['id'];}return db[_0xb6ea('0x2c')][_0xb6ea('0x47')]({'where':{'id':_0x3564fb[_0xb6ea('0x4a')]['id']}})[_0xb6ea('0x26')](handleEntityNotFound(_0x1e94ed,null))[_0xb6ea('0x26')](saveUpdates(_0x3564fb[_0xb6ea('0x49')],null))[_0xb6ea('0x26')](respondWithResult(_0x1e94ed,null))[_0xb6ea('0x44')](handleError(_0x1e94ed,null));};exports[_0xb6ea('0x4b')]=function(_0x5a5ae3,_0x135279,_0x53969d){var _0x30271e=require(_0xb6ea('0x4c'));var _0x2bc770=![];var _0x2ec107={};if(_0x5a5ae3[_0xb6ea('0x31')][_0xb6ea('0x2e')]&&_0x5a5ae3['query'][_0xb6ea('0x2e')]==='uniqueid'){_0x2ec107['uniqueid']=_0x5a5ae3[_0xb6ea('0x4a')]['id'];}else{_0x2ec107['id']=_0x5a5ae3[_0xb6ea('0x4a')]['id'];}return db[_0xb6ea('0x2c')]['find']({'where':_0x2ec107,'attributes':['id',_0xb6ea('0x4d'),'filename'],'raw':!![]})[_0xb6ea('0x26')](handleEntityNotFound(_0x135279,null))[_0xb6ea('0x26')](function(_0x5e1f83){if(_0x5e1f83){var _0x33f490=_0x5e1f83[_0xb6ea('0x4d')];var _0x25e3e3=util[_0xb6ea('0x4e')]('%s.cypher',_0x33f490);if(fs['existsSync'](_0x25e3e3)){_0x2bc770=!![];return _0x30271e['decryptFile'](_0x25e3e3,_0x33f490,config[_0xb6ea('0x4f')][_0xb6ea('0x50')])[_0xb6ea('0x26')](function(){return _0x5e1f83;});}return _0x5e1f83;}})[_0xb6ea('0x26')](function(_0x5ea305){if(_0x5ea305){var _0x313baf=_0x5ea305[_0xb6ea('0x4d')];if(!fs['existsSync'](_0x313baf)){throw new db[(_0xb6ea('0x51'))][(_0xb6ea('0x52'))](_0xb6ea('0x53'));}if(_0x5ea305[_0xb6ea('0x54')]){return _0x135279[_0xb6ea('0x4b')](_0x313baf,_0x5ea305['filename']+path[_0xb6ea('0x55')](_0x313baf),function(){if(_0x2bc770){fs[_0xb6ea('0x56')](_0x313baf);}});}else{return _0x135279[_0xb6ea('0x4b')](_0x313baf,function(_0x3a2651){if(_0x2bc770){fs[_0xb6ea('0x56')](_0x313baf);}});}}})[_0xb6ea('0x44')](function(_0x17f29a){if(_0x17f29a[_0xb6ea('0x57')]===_0xb6ea('0x53')){_0x135279[_0xb6ea('0x1a')](0x194)['send'](_0xb6ea('0x58'));}else{return handleError(_0x135279,null);}});};exports['destroy']=function(_0x892b1,_0x4ab529){return db[_0xb6ea('0x2c')][_0xb6ea('0x47')]({'where':{'id':_0x892b1['params']['id']}})['then'](function(_0x24e36b){if(_[_0xb6ea('0x59')](_0x24e36b)){throw new ReferenceError(_0xb6ea('0x5a'));}return _0x24e36b;})[_0xb6ea('0x26')](function(_0x185f7c){var _0x3a59a1=_0x185f7c[_0xb6ea('0x4d')];logger[_0xb6ea('0x5b')](_0xb6ea('0x5c'),_0x3a59a1);if(!_[_0xb6ea('0x59')](_0x185f7c['savePath'])&&fs['existsSync'](_0x3a59a1)){logger[_0xb6ea('0x5b')](_0xb6ea('0x5d')+_0x3a59a1+_0xb6ea('0x5e'));fs[_0xb6ea('0x5f')](_0x3a59a1);}_0x3a59a1=_0x3a59a1+_0xb6ea('0x60');if(!_[_0xb6ea('0x59')](_0x185f7c[_0xb6ea('0x4d')])&&fs[_0xb6ea('0x61')](_0x3a59a1)){logger[_0xb6ea('0x5b')](_0xb6ea('0x5d')+_0x3a59a1+_0xb6ea('0x5e'));fs['unlinkSync'](_0x3a59a1);}return _0x185f7c;})['then'](function(_0x5d98d5){if(!_0x5d98d5)throw new InternalError();return _0x5d98d5[_0xb6ea('0x62')]();})['then'](function(){_0x4ab529[_0xb6ea('0x1a')](0xcc)['end']();})[_0xb6ea('0x44')](handleError(_0x4ab529,null));};
\ No newline at end of file
+var _0xe67d=['../../components/encryptor','uniqueid','savePath','filename','format','existsSync','decryptFile','recording','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','send','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','SquareRecording','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','create','body','find','download'];(function(_0x3db7af,_0x2cad9d){var _0xc3be08=function(_0x4ba47d){while(--_0x4ba47d){_0x3db7af['push'](_0x3db7af['shift']());}};_0xc3be08(++_0x2cad9d);}(_0xe67d,0xd4));var _0xde67=function(_0x497948,_0x4ca60c){_0x497948=_0x497948-0x0;var _0x39bb36=_0xe67d[_0x497948];return _0x39bb36;};'use strict';var emlformat=require(_0xde67('0x0'));var rimraf=require(_0xde67('0x1'));var zipdir=require(_0xde67('0x2'));var jsonpatch=require(_0xde67('0x3'));var rp=require(_0xde67('0x4'));var moment=require(_0xde67('0x5'));var BPromise=require(_0xde67('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xde67('0x7'));var sox=require(_0xde67('0x8'));var csv=require(_0xde67('0x9'));var ejs=require(_0xde67('0xa'));var fs=require('fs');var fs_extra=require(_0xde67('0xb'));var _=require(_0xde67('0xc'));var squel=require('squel');var crypto=require(_0xde67('0xd'));var jsforce=require(_0xde67('0xe'));var deskjs=require(_0xde67('0xf'));var toCsv=require(_0xde67('0x9'));var querystring=require(_0xde67('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xde67('0x11'));var as=require(_0xde67('0x12'));var hardwareService=require(_0xde67('0x13'));var logger=require(_0xde67('0x14'))(_0xde67('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xde67('0x16'));var db=require(_0xde67('0x17'))['db'];function respondWithStatusCode(_0x5d2f28,_0x5d7bc3){_0x5d7bc3=_0x5d7bc3||0xcc;return function(_0x8625){if(_0x8625){return _0x5d2f28['sendStatus'](_0x5d7bc3);}return _0x5d2f28[_0xde67('0x18')](_0x5d7bc3)[_0xde67('0x19')]();};}function respondWithResult(_0x592432,_0x19792b){_0x19792b=_0x19792b||0xc8;return function(_0x21df3d){if(_0x21df3d){return _0x592432[_0xde67('0x18')](_0x19792b)[_0xde67('0x1a')](_0x21df3d);}};}function respondWithFilteredResult(_0x7fb328,_0x5ca891){return function(_0x35e8c7){if(_0x35e8c7){var _0x28fcbf=typeof _0x5ca891[_0xde67('0x1b')]===_0xde67('0x1c')&&typeof _0x5ca891[_0xde67('0x1d')]===_0xde67('0x1c');var _0x38a4a2=_0x35e8c7['count'];var _0x62129f=_0x28fcbf?0x0:_0x5ca891[_0xde67('0x1b')];var _0x12bc76=_0x28fcbf?_0x35e8c7[_0xde67('0x1e')]:_0x5ca891[_0xde67('0x1b')]+_0x5ca891['limit'];var _0x5908f0;if(_0x12bc76>=_0x38a4a2){_0x12bc76=_0x38a4a2;_0x5908f0=0xc8;}else{_0x5908f0=0xce;}_0x7fb328[_0xde67('0x18')](_0x5908f0);return _0x7fb328[_0xde67('0x1f')](_0xde67('0x20'),_0x62129f+'-'+_0x12bc76+'/'+_0x38a4a2)[_0xde67('0x1a')](_0x35e8c7);}return null;};}function patchUpdates(_0x12f5e7){return function(_0x23bcaf){try{jsonpatch[_0xde67('0x21')](_0x23bcaf,_0x12f5e7,!![]);}catch(_0x4e2fb2){return BPromise[_0xde67('0x22')](_0x4e2fb2);}return _0x23bcaf[_0xde67('0x23')]();};}function saveUpdates(_0x15894d,_0xbbaad1){return function(_0x371358){if(_0x371358){return _0x371358[_0xde67('0x24')](_0x15894d)[_0xde67('0x25')](function(_0x4f9e22){return _0x4f9e22;});}return null;};}function removeEntity(_0x265ce2,_0x138196){return function(_0x3ed488){if(_0x3ed488){return _0x3ed488[_0xde67('0x26')]()['then'](function(){_0x265ce2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x74a562,_0x120693){return function(_0x17facd){if(!_0x17facd){_0x74a562[_0xde67('0x27')](0x194);}return _0x17facd;};}function handleError(_0x1a2c63,_0x2e8416){_0x2e8416=_0x2e8416||0x1f4;return function(_0x534913){logger[_0xde67('0x28')](_0x534913[_0xde67('0x29')]);if(_0x534913[_0xde67('0x2a')]){delete _0x534913['name'];}_0x1a2c63['status'](_0x2e8416)['send'](_0x534913);};}exports[_0xde67('0x2b')]=function(_0x2d5410,_0x560acf){var _0x22e311={},_0x3e8d06={},_0x13d746={'count':0x0,'rows':[]};var _0xcc9cfa=_['map'](db[_0xde67('0x2c')][_0xde67('0x2d')],function(_0x5799cf){return{'name':_0x5799cf[_0xde67('0x2e')],'type':_0x5799cf[_0xde67('0x2f')][_0xde67('0x30')]};});_0x3e8d06[_0xde67('0x31')]=_[_0xde67('0x32')](_0xcc9cfa,_0xde67('0x2a'));_0x3e8d06[_0xde67('0x33')]=_[_0xde67('0x34')](_0x2d5410['query']);_0x3e8d06[_0xde67('0x35')]=_[_0xde67('0x36')](_0x3e8d06['model'],_0x3e8d06[_0xde67('0x33')]);_0x22e311[_0xde67('0x37')]=_[_0xde67('0x36')](_0x3e8d06[_0xde67('0x31')],qs[_0xde67('0x38')](_0x2d5410['query'][_0xde67('0x38')]));_0x22e311[_0xde67('0x37')]=_0x22e311[_0xde67('0x37')][_0xde67('0x39')]?_0x22e311[_0xde67('0x37')]:_0x3e8d06['model'];if(!_0x2d5410[_0xde67('0x33')]['hasOwnProperty']('nolimit')){_0x22e311[_0xde67('0x1d')]=qs[_0xde67('0x1d')](_0x2d5410[_0xde67('0x33')]['limit']);_0x22e311[_0xde67('0x1b')]=qs[_0xde67('0x1b')](_0x2d5410[_0xde67('0x33')][_0xde67('0x1b')]);}_0x22e311[_0xde67('0x3a')]=qs[_0xde67('0x3b')](_0x2d5410[_0xde67('0x33')]['sort']);_0x22e311[_0xde67('0x3c')]=qs[_0xde67('0x35')](_[_0xde67('0x3d')](_0x2d5410['query'],_0x3e8d06['filters']),_0xcc9cfa);if(_0x2d5410[_0xde67('0x33')][_0xde67('0x3e')]){_0x22e311[_0xde67('0x3c')]=_[_0xde67('0x3f')](_0x22e311[_0xde67('0x3c')],{'$or':_[_0xde67('0x32')](_0xcc9cfa,function(_0x16a711){if(_0x16a711[_0xde67('0x2f')]!==_0xde67('0x40')){var _0x52c531={};_0x52c531[_0x16a711[_0xde67('0x2a')]]={'$like':'%'+_0x2d5410[_0xde67('0x33')]['filter']+'%'};return _0x52c531;}})});}_0x22e311=_['merge']({},_0x22e311,_0x2d5410[_0xde67('0x41')]);var _0x5a4a49={'where':_0x22e311[_0xde67('0x3c')]};return db['SquareRecording']['count'](_0x5a4a49)[_0xde67('0x25')](function(_0x10c310){_0x13d746[_0xde67('0x1e')]=_0x10c310;if(_0x2d5410[_0xde67('0x33')][_0xde67('0x42')]){_0x22e311['include']=[{'all':!![]}];}return db['SquareRecording'][_0xde67('0x43')](_0x22e311);})[_0xde67('0x25')](function(_0x26486d){_0x13d746['rows']=_0x26486d;return _0x13d746;})[_0xde67('0x25')](respondWithFilteredResult(_0x560acf,_0x22e311))[_0xde67('0x44')](handleError(_0x560acf,null));};exports[_0xde67('0x45')]=function(_0x17b0c5,_0x23715c){var _0xff25c1={'raw':!![],'where':{'id':_0x17b0c5[_0xde67('0x46')]['id']}},_0x2d05e1={};_0x2d05e1['model']=_[_0xde67('0x34')](db['SquareRecording']['rawAttributes']);_0x2d05e1[_0xde67('0x33')]=_[_0xde67('0x34')](_0x17b0c5[_0xde67('0x33')]);_0x2d05e1[_0xde67('0x35')]=_[_0xde67('0x36')](_0x2d05e1[_0xde67('0x31')],_0x2d05e1[_0xde67('0x33')]);_0xff25c1[_0xde67('0x37')]=_[_0xde67('0x36')](_0x2d05e1[_0xde67('0x31')],qs[_0xde67('0x38')](_0x17b0c5[_0xde67('0x33')][_0xde67('0x38')]));_0xff25c1[_0xde67('0x37')]=_0xff25c1[_0xde67('0x37')][_0xde67('0x39')]?_0xff25c1[_0xde67('0x37')]:_0x2d05e1[_0xde67('0x31')];if(_0x17b0c5[_0xde67('0x33')][_0xde67('0x42')]){_0xff25c1[_0xde67('0x47')]=[{'all':!![]}];}_0xff25c1=_[_0xde67('0x3f')]({},_0xff25c1,_0x17b0c5[_0xde67('0x41')]);return db['SquareRecording']['find'](_0xff25c1)['then'](handleEntityNotFound(_0x23715c,null))[_0xde67('0x25')](respondWithResult(_0x23715c,null))[_0xde67('0x44')](handleError(_0x23715c,null));};exports[_0xde67('0x48')]=function(_0x5b0868,_0x338b7e){return db[_0xde67('0x2c')]['create'](_0x5b0868[_0xde67('0x49')],{})['then'](respondWithResult(_0x338b7e,0xc9))['catch'](handleError(_0x338b7e,null));};exports['update']=function(_0x404598,_0x4603d7){if(_0x404598['body']['id']){delete _0x404598[_0xde67('0x49')]['id'];}return db[_0xde67('0x2c')][_0xde67('0x4a')]({'where':{'id':_0x404598[_0xde67('0x46')]['id']}})['then'](handleEntityNotFound(_0x4603d7,null))['then'](saveUpdates(_0x404598[_0xde67('0x49')],null))[_0xde67('0x25')](respondWithResult(_0x4603d7,null))[_0xde67('0x44')](handleError(_0x4603d7,null));};exports[_0xde67('0x4b')]=function(_0xf943c0,_0xdf0bd6,_0x33074c){var _0x12203d=require(_0xde67('0x4c'));var _0xd48e40=![];var _0x575e39={};if(_0xf943c0[_0xde67('0x33')]['type']&&_0xf943c0['query'][_0xde67('0x2f')]==='uniqueid'){_0x575e39[_0xde67('0x4d')]=_0xf943c0[_0xde67('0x46')]['id'];}else{_0x575e39['id']=_0xf943c0[_0xde67('0x46')]['id'];}return db[_0xde67('0x2c')][_0xde67('0x4a')]({'where':_0x575e39,'attributes':['id',_0xde67('0x4e'),_0xde67('0x4f')],'raw':!![]})[_0xde67('0x25')](handleEntityNotFound(_0xdf0bd6,null))[_0xde67('0x25')](function(_0x23dea0){if(_0x23dea0){var _0xa04957=_0x23dea0[_0xde67('0x4e')];var _0x410837=util[_0xde67('0x50')]('%s.cypher',_0xa04957);if(fs[_0xde67('0x51')](_0x410837)){_0xd48e40=!![];return _0x12203d[_0xde67('0x52')](_0x410837,_0xa04957,config['secrets'][_0xde67('0x53')])[_0xde67('0x25')](function(){return _0x23dea0;});}return _0x23dea0;}})[_0xde67('0x25')](function(_0x4160c1){if(_0x4160c1){var _0x3ce801=_0x4160c1['savePath'];if(!fs[_0xde67('0x51')](_0x3ce801)){throw new db['Sequelize'][(_0xde67('0x54'))](_0xde67('0x55'));}if(_0x4160c1[_0xde67('0x4f')]){return _0xdf0bd6[_0xde67('0x4b')](_0x3ce801,_0x4160c1[_0xde67('0x4f')]+path[_0xde67('0x56')](_0x3ce801),function(){if(_0xd48e40){fs['unlink'](_0x3ce801);}});}else{return _0xdf0bd6[_0xde67('0x4b')](_0x3ce801,function(_0x344e6a){if(_0xd48e40){fs[_0xde67('0x57')](_0x3ce801);}});}}})['catch'](function(_0x43d253){if(_0x43d253[_0xde67('0x58')]===_0xde67('0x55')){_0xdf0bd6[_0xde67('0x18')](0x194)[_0xde67('0x59')](_0xde67('0x5a'));}else{return handleError(_0xdf0bd6,null);}});};exports[_0xde67('0x26')]=function(_0x1eec51,_0x31d239){return db[_0xde67('0x2c')][_0xde67('0x4a')]({'where':{'id':_0x1eec51[_0xde67('0x46')]['id']}})[_0xde67('0x25')](function(_0x3c8630){if(_[_0xde67('0x5b')](_0x3c8630)){throw new ReferenceError('Entity\x20not\x20found');}return _0x3c8630;})[_0xde67('0x25')](function(_0x50aecc){var _0x503498=_0x50aecc[_0xde67('0x4e')];logger[_0xde67('0x5c')](_0xde67('0x5d'),_0x503498);if(!_[_0xde67('0x5b')](_0x50aecc[_0xde67('0x4e')])&&fs[_0xde67('0x51')](_0x503498)){logger[_0xde67('0x5c')]('File:\x20\x22'+_0x503498+_0xde67('0x5e'));fs['unlinkSync'](_0x503498);}_0x503498=_0x503498+'.cypher';if(!_[_0xde67('0x5b')](_0x50aecc[_0xde67('0x4e')])&&fs[_0xde67('0x51')](_0x503498)){logger[_0xde67('0x5c')]('File:\x20\x22'+_0x503498+_0xde67('0x5e'));fs[_0xde67('0x5f')](_0x503498);}return _0x50aecc;})[_0xde67('0x25')](function(_0x46cb92){if(!_0x46cb92)throw new InternalError();return _0x46cb92[_0xde67('0x26')]();})[_0xde67('0x25')](function(){_0x31d239[_0xde67('0x18')](0xcc)[_0xde67('0x19')]();})[_0xde67('0x44')](handleError(_0x31d239,null));};
\ No newline at end of file
index 09de221..62a2605 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ff9=['api','moment','path','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util'];(function(_0x260ee9,_0x1bfec7){var _0xa28869=function(_0x255096){while(--_0x255096){_0x260ee9['push'](_0x260ee9['shift']());}};_0xa28869(++_0x1bfec7);}(_0x5ff9,0xa0));var _0x95ff=function(_0x26c3cb,_0x66682f){_0x26c3cb=_0x26c3cb-0x0;var _0x2cb4ad=_0x5ff9[_0x26c3cb];return _0x2cb4ad;};'use strict';var _=require(_0x95ff('0x0'));var util=require(_0x95ff('0x1'));var logger=require('../../config/logger')(_0x95ff('0x2'));var moment=require(_0x95ff('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x95ff('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x95ff('0x5'));module[_0x95ff('0x6')]=function(_0x4d37f2,_0x1d9d79){return _0x4d37f2['define'](_0x95ff('0x7'),attributes,{'tableName':_0x95ff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc274=['request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording','util','moment','bluebird'];(function(_0xc1e776,_0x2377b7){var _0x5a675b=function(_0x6c1e3f){while(--_0x6c1e3f){_0xc1e776['push'](_0xc1e776['shift']());}};_0x5a675b(++_0x2377b7);}(_0xc274,0x151));var _0x4c27=function(_0x34deb4,_0x3bc100){_0x34deb4=_0x34deb4-0x0;var _0x29c820=_0xc274[_0x34deb4];return _0x29c820;};'use strict';var _=require('lodash');var util=require(_0x4c27('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x4c27('0x1'));var BPromise=require(_0x4c27('0x2'));var rp=require(_0x4c27('0x3'));var fs=require('fs');var path=require(_0x4c27('0x4'));var rimraf=require(_0x4c27('0x5'));var config=require(_0x4c27('0x6'));var attributes=require('./squareRecording.attributes');module[_0x4c27('0x7')]=function(_0x545647,_0x1789ca){return _0x545647[_0x4c27('0x8')](_0x4c27('0x9'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7680162..95d2460 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a3e=['CreateSquareRecording','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','SquareRecording','options','raw','then'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8a3e,0xd3));var _0xe8a3=function(_0x4ea80f,_0x4eccf2){_0x4ea80f=_0x4ea80f-0x0;var _0x498ca8=_0x8a3e[_0x4ea80f];return _0x498ca8;};'use strict';var _=require(_0xe8a3('0x0'));var util=require(_0xe8a3('0x1'));var moment=require('moment');var BPromise=require(_0xe8a3('0x2'));var rs=require(_0xe8a3('0x3'));var fs=require('fs');var Redis=require(_0xe8a3('0x4'));var db=require(_0xe8a3('0x5'))['db'];var utils=require(_0xe8a3('0x6'));var logger=require(_0xe8a3('0x7'))(_0xe8a3('0x8'));var config=require(_0xe8a3('0x9'));var jayson=require(_0xe8a3('0xa'));var client=jayson[_0xe8a3('0xb')][_0xe8a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20da44,_0x52ca41,_0xf2c3e7){return new BPromise(function(_0x1bfc3b,_0x57bb96){return client[_0xe8a3('0xd')](_0x20da44,_0xf2c3e7)['then'](function(_0x13ffcf){logger[_0xe8a3('0xe')]('SquareRecording,\x20%s,\x20%s',_0x52ca41,_0xe8a3('0xf'));logger[_0xe8a3('0x10')](_0xe8a3('0x11'),_0x52ca41,_0xe8a3('0xf'),JSON[_0xe8a3('0x12')](_0x13ffcf));if(_0x13ffcf[_0xe8a3('0x13')]){if(_0x13ffcf[_0xe8a3('0x13')][_0xe8a3('0x14')]===0x1f4){logger[_0xe8a3('0x13')](_0xe8a3('0x15'),_0x52ca41,_0x13ffcf[_0xe8a3('0x13')][_0xe8a3('0x16')]);return _0x57bb96(_0x13ffcf['error']['message']);}logger[_0xe8a3('0x13')](_0xe8a3('0x15'),_0x52ca41,_0x13ffcf[_0xe8a3('0x13')]['message']);return _0x1bfc3b(_0x13ffcf[_0xe8a3('0x13')]['message']);}else{logger[_0xe8a3('0xe')](_0xe8a3('0x15'),_0x52ca41,_0xe8a3('0xf'));_0x1bfc3b(_0x13ffcf[_0xe8a3('0x17')]['message']);}})[_0xe8a3('0x18')](function(_0xf677b0){logger[_0xe8a3('0x13')]('SquareRecording,\x20%s,\x20%s',_0x52ca41,_0xf677b0);_0x57bb96(_0xf677b0);});});}exports['CreateSquareRecording']=function(_0x14428d){var _0x3e0cd8=this;return new Promise(function(_0x34a691,_0x14f564){return db[_0xe8a3('0x19')]['create'](_0x14428d['body'],{'raw':_0x14428d[_0xe8a3('0x1a')]?_0x14428d[_0xe8a3('0x1a')][_0xe8a3('0x1b')]===undefined?!![]:![]:!![]})[_0xe8a3('0x1c')](function(_0x36be5b){logger['info']('CreateSquareRecording',_0x14428d);logger[_0xe8a3('0x10')](_0xe8a3('0x1d'),_0x14428d,JSON[_0xe8a3('0x12')](_0x36be5b));_0x34a691(_0x36be5b);})[_0xe8a3('0x18')](function(_0x3b685c){logger[_0xe8a3('0x13')]('CreateSquareRecording',_0x3b685c[_0xe8a3('0x16')],_0x14428d);_0x14f564(_0x3e0cd8['error'](0x1f4,_0x3b685c[_0xe8a3('0x16')]));});});};
\ No newline at end of file
+var _0x8084=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','error','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','then','debug','stringify','lodash','moment','bluebird'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x8084,0x1d9));var _0x4808=function(_0x1eef9b,_0x54eb6d){_0x1eef9b=_0x1eef9b-0x0;var _0x1f28f7=_0x8084[_0x1eef9b];return _0x1f28f7;};'use strict';var _=require(_0x4808('0x0'));var util=require('util');var moment=require(_0x4808('0x1'));var BPromise=require(_0x4808('0x2'));var rs=require(_0x4808('0x3'));var fs=require('fs');var Redis=require(_0x4808('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4808('0x5'));var logger=require(_0x4808('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4808('0x7'));var client=jayson[_0x4808('0x8')][_0x4808('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ac050,_0x4d78d9,_0x27547a){return new BPromise(function(_0x599934,_0x50ba8f){return client[_0x4808('0xa')](_0x1ac050,_0x27547a)['then'](function(_0x5761d9){logger[_0x4808('0xb')]('SquareRecording,\x20%s,\x20%s',_0x4d78d9,_0x4808('0xc'));logger['debug'](_0x4808('0xd'),_0x4d78d9,_0x4808('0xc'),JSON['stringify'](_0x5761d9));if(_0x5761d9['error']){if(_0x5761d9[_0x4808('0xe')]['code']===0x1f4){logger[_0x4808('0xe')](_0x4808('0xf'),_0x4d78d9,_0x5761d9[_0x4808('0xe')][_0x4808('0x10')]);return _0x50ba8f(_0x5761d9[_0x4808('0xe')][_0x4808('0x10')]);}logger[_0x4808('0xe')](_0x4808('0xf'),_0x4d78d9,_0x5761d9[_0x4808('0xe')][_0x4808('0x10')]);return _0x599934(_0x5761d9[_0x4808('0xe')][_0x4808('0x10')]);}else{logger['info'](_0x4808('0xf'),_0x4d78d9,_0x4808('0xc'));_0x599934(_0x5761d9[_0x4808('0x11')][_0x4808('0x10')]);}})[_0x4808('0x12')](function(_0x28510b){logger[_0x4808('0xe')](_0x4808('0xf'),_0x4d78d9,_0x28510b);_0x50ba8f(_0x28510b);});});}exports[_0x4808('0x13')]=function(_0x4319d8){var _0x10cd20=this;return new Promise(function(_0x941134,_0x555548){return db[_0x4808('0x14')][_0x4808('0x15')](_0x4319d8[_0x4808('0x16')],{'raw':_0x4319d8['options']?_0x4319d8[_0x4808('0x17')][_0x4808('0x18')]===undefined?!![]:![]:!![]})[_0x4808('0x19')](function(_0x26056e){logger[_0x4808('0xb')](_0x4808('0x13'),_0x4319d8);logger[_0x4808('0x1a')](_0x4808('0x13'),_0x4319d8,JSON[_0x4808('0x1b')](_0x26056e));_0x941134(_0x26056e);})[_0x4808('0x12')](function(_0x40aeda){logger['error'](_0x4808('0x13'),_0x40aeda[_0x4808('0x10')],_0x4319d8);_0x555548(_0x10cd20[_0x4808('0xe')](0x1f4,_0x40aeda[_0x4808('0x10')]));});});};
\ No newline at end of file
index 92cfd30..ca4d54c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x44feec,_0xaed48f){var _0xb4292f=function(_0x1ae022){while(--_0x1ae022){_0x44feec['push'](_0x44feec['shift']());}};_0xb4292f(++_0xaed48f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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 fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
+var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1d13ad,_0x13fd01){var _0x2a734e=function(_0x85213f){while(--_0x85213f){_0x1d13ad['push'](_0x1d13ad['shift']());}};_0x2a734e(++_0x13fd01);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'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 fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router;
\ No newline at end of file
index 2d9599c..70dbfac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88b3=['DATE','sequelize','exports','STRING'];(function(_0xdd1d97,_0x71fb3b){var _0x312d5f=function(_0x227af3){while(--_0x227af3){_0xdd1d97['push'](_0xdd1d97['shift']());}};_0x312d5f(++_0x71fb3b);}(_0x88b3,0x101));var _0x388b=function(_0x1e66d3,_0x5f9ea6){_0x1e66d3=_0x1e66d3-0x0;var _0xcf9c47=_0x88b3[_0x1e66d3];return _0xcf9c47;};'use strict';var Sequelize=require(_0x388b('0x0'));module[_0x388b('0x1')]={'network':{'type':Sequelize[_0x388b('0x2')]},'network_script':{'type':Sequelize[_0x388b('0x2')]},'request':{'type':Sequelize[_0x388b('0x2')]},'channel':{'type':Sequelize[_0x388b('0x2')]},'language':{'type':Sequelize[_0x388b('0x2')]},'type':{'type':Sequelize[_0x388b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x388b('0x2')]},'callerid':{'type':Sequelize[_0x388b('0x2')]},'calleridname':{'type':Sequelize[_0x388b('0x2')]},'callingpres':{'type':Sequelize[_0x388b('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x388b('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x388b('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x388b('0x2')]},'extension':{'type':Sequelize[_0x388b('0x2')]},'priority':{'type':Sequelize[_0x388b('0x2')]},'enhanced':{'type':Sequelize[_0x388b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x388b('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x388b('0x3')]},'leaveAt':{'type':Sequelize[_0x388b('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x1355=['exports','STRING','DATE','BOOLEAN'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x1355,0xa4));var _0x5135=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0x1355[_0x31b5b2];return _0x364f13;};'use strict';var Sequelize=require('sequelize');module[_0x5135('0x0')]={'network':{'type':Sequelize[_0x5135('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x5135('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x5135('0x1')]},'type':{'type':Sequelize[_0x5135('0x1')]},'uniqueid':{'type':Sequelize[_0x5135('0x1')]},'version':{'type':Sequelize[_0x5135('0x1')]},'callerid':{'type':Sequelize[_0x5135('0x1')]},'calleridname':{'type':Sequelize[_0x5135('0x1')]},'callingpres':{'type':Sequelize[_0x5135('0x1')]},'callingani2':{'type':Sequelize[_0x5135('0x1')]},'callington':{'type':Sequelize[_0x5135('0x1')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x5135('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5135('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5135('0x1')]},'threadid':{'type':Sequelize[_0x5135('0x1')]},'project_name':{'type':Sequelize[_0x5135('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5135('0x2')]},'bot':{'type':Sequelize[_0x5135('0x3')],'defaultValue':![]}};
\ No newline at end of file
index b2ba7f7..712cfab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5310=['params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','apply','reject','save','update','then','destroy','stack','name','send','index','map','key','model','keys','query','filters','intersection','attributes','length','sort','where','filter','type','merge','SquareReport','includeAll','include','catch','show'];(function(_0x58a2c6,_0x3fc248){var _0x4fe162=function(_0x24ae09){while(--_0x24ae09){_0x58a2c6['push'](_0x58a2c6['shift']());}};_0x4fe162(++_0x3fc248);}(_0x5310,0x1a4));var _0x0531=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x5310[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x0531('0x0'));var rimraf=require(_0x0531('0x1'));var zipdir=require(_0x0531('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0531('0x3'));var Mustache=require(_0x0531('0x4'));var util=require(_0x0531('0x5'));var path=require(_0x0531('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0531('0x7'));var fs=require('fs');var fs_extra=require(_0x0531('0x8'));var _=require(_0x0531('0x9'));var squel=require(_0x0531('0xa'));var crypto=require(_0x0531('0xb'));var jsforce=require(_0x0531('0xc'));var deskjs=require(_0x0531('0xd'));var toCsv=require(_0x0531('0xe'));var querystring=require('querystring');var Papa=require(_0x0531('0xf'));var Redis=require(_0x0531('0x10'));var authService=require(_0x0531('0x11'));var qs=require(_0x0531('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0531('0x13'));var logger=require(_0x0531('0x14'))(_0x0531('0x15'));var utils=require(_0x0531('0x16'));var config=require(_0x0531('0x17'));var licenseUtil=require(_0x0531('0x18'));var db=require(_0x0531('0x19'))['db'];function respondWithStatusCode(_0x479f1e,_0xa34148){_0xa34148=_0xa34148||0xcc;return function(_0x49752a){if(_0x49752a){return _0x479f1e[_0x0531('0x1a')](_0xa34148);}return _0x479f1e[_0x0531('0x1b')](_0xa34148)[_0x0531('0x1c')]();};}function respondWithResult(_0x4e3da0,_0xd60123){_0xd60123=_0xd60123||0xc8;return function(_0x37b0b5){if(_0x37b0b5){return _0x4e3da0[_0x0531('0x1b')](_0xd60123)[_0x0531('0x1d')](_0x37b0b5);}};}function respondWithFilteredResult(_0x2dbb22,_0x1fc7ff){return function(_0x58b205){if(_0x58b205){var _0x228ee1=typeof _0x1fc7ff[_0x0531('0x1e')]==='undefined'&&typeof _0x1fc7ff[_0x0531('0x1f')]===_0x0531('0x20');var _0x3e67a4=_0x58b205[_0x0531('0x21')];var _0x112c1a=_0x228ee1?0x0:_0x1fc7ff[_0x0531('0x1e')];var _0x5238b1=_0x228ee1?_0x58b205['count']:_0x1fc7ff[_0x0531('0x1e')]+_0x1fc7ff['limit'];var _0x37797b;if(_0x5238b1>=_0x3e67a4){_0x5238b1=_0x3e67a4;_0x37797b=0xc8;}else{_0x37797b=0xce;}_0x2dbb22['status'](_0x37797b);return _0x2dbb22['set']('Content-Range',_0x112c1a+'-'+_0x5238b1+'/'+_0x3e67a4)[_0x0531('0x1d')](_0x58b205);}return null;};}function patchUpdates(_0x20b482){return function(_0x5ca150){try{jsonpatch[_0x0531('0x22')](_0x5ca150,_0x20b482,!![]);}catch(_0x49e6e6){return BPromise[_0x0531('0x23')](_0x49e6e6);}return _0x5ca150[_0x0531('0x24')]();};}function saveUpdates(_0x282240,_0x2141c5){return function(_0xbfed58){if(_0xbfed58){return _0xbfed58[_0x0531('0x25')](_0x282240)[_0x0531('0x26')](function(_0x4c376c){return _0x4c376c;});}return null;};}function removeEntity(_0x3b0084,_0x4ae6e9){return function(_0x4bc7fa){if(_0x4bc7fa){return _0x4bc7fa[_0x0531('0x27')]()['then'](function(){_0x3b0084[_0x0531('0x1b')](0xcc)[_0x0531('0x1c')]();});}};}function handleEntityNotFound(_0x4becf0,_0xe31661){return function(_0x4cd92a){if(!_0x4cd92a){_0x4becf0[_0x0531('0x1a')](0x194);}return _0x4cd92a;};}function handleError(_0xc52db2,_0x34901e){_0x34901e=_0x34901e||0x1f4;return function(_0x29983c){logger['error'](_0x29983c[_0x0531('0x28')]);if(_0x29983c[_0x0531('0x29')]){delete _0x29983c['name'];}_0xc52db2[_0x0531('0x1b')](_0x34901e)[_0x0531('0x2a')](_0x29983c);};}exports[_0x0531('0x2b')]=function(_0x23f732,_0x33eb8f){var _0x37af5b={},_0x52f151={},_0x5eaacc={'count':0x0,'rows':[]};var _0x51ee25=_[_0x0531('0x2c')](db['SquareReport']['rawAttributes'],function(_0x34e39b){return{'name':_0x34e39b['fieldName'],'type':_0x34e39b['type'][_0x0531('0x2d')]};});_0x52f151[_0x0531('0x2e')]=_[_0x0531('0x2c')](_0x51ee25,_0x0531('0x29'));_0x52f151['query']=_[_0x0531('0x2f')](_0x23f732[_0x0531('0x30')]);_0x52f151[_0x0531('0x31')]=_[_0x0531('0x32')](_0x52f151[_0x0531('0x2e')],_0x52f151[_0x0531('0x30')]);_0x37af5b[_0x0531('0x33')]=_['intersection'](_0x52f151[_0x0531('0x2e')],qs['fields'](_0x23f732[_0x0531('0x30')]['fields']));_0x37af5b[_0x0531('0x33')]=_0x37af5b['attributes'][_0x0531('0x34')]?_0x37af5b[_0x0531('0x33')]:_0x52f151['model'];if(!_0x23f732[_0x0531('0x30')]['hasOwnProperty']('nolimit')){_0x37af5b[_0x0531('0x1f')]=qs[_0x0531('0x1f')](_0x23f732[_0x0531('0x30')][_0x0531('0x1f')]);_0x37af5b[_0x0531('0x1e')]=qs[_0x0531('0x1e')](_0x23f732[_0x0531('0x30')][_0x0531('0x1e')]);}_0x37af5b['order']=qs['sort'](_0x23f732[_0x0531('0x30')][_0x0531('0x35')]);_0x37af5b[_0x0531('0x36')]=qs[_0x0531('0x31')](_['pick'](_0x23f732[_0x0531('0x30')],_0x52f151[_0x0531('0x31')]),_0x51ee25);if(_0x23f732[_0x0531('0x30')][_0x0531('0x37')]){_0x37af5b[_0x0531('0x36')]=_['merge'](_0x37af5b[_0x0531('0x36')],{'$or':_['map'](_0x51ee25,function(_0x1ed114){if(_0x1ed114[_0x0531('0x38')]!=='VIRTUAL'){var _0x49044d={};_0x49044d[_0x1ed114[_0x0531('0x29')]]={'$like':'%'+_0x23f732[_0x0531('0x30')][_0x0531('0x37')]+'%'};return _0x49044d;}})});}_0x37af5b=_[_0x0531('0x39')]({},_0x37af5b,_0x23f732['options']);var _0x5de22f={'where':_0x37af5b['where']};return db[_0x0531('0x3a')][_0x0531('0x21')](_0x5de22f)['then'](function(_0x1daa59){_0x5eaacc[_0x0531('0x21')]=_0x1daa59;if(_0x23f732[_0x0531('0x30')][_0x0531('0x3b')]){_0x37af5b[_0x0531('0x3c')]=[{'all':!![]}];}return db[_0x0531('0x3a')]['findAll'](_0x37af5b);})[_0x0531('0x26')](function(_0x1042ba){_0x5eaacc['rows']=_0x1042ba;return _0x5eaacc;})['then'](respondWithFilteredResult(_0x33eb8f,_0x37af5b))[_0x0531('0x3d')](handleError(_0x33eb8f,null));};exports[_0x0531('0x3e')]=function(_0x387938,_0x32356d){var _0x13c841={'raw':!![],'where':{'id':_0x387938[_0x0531('0x3f')]['id']}},_0x4c82c5={};_0x4c82c5[_0x0531('0x2e')]=_[_0x0531('0x2f')](db[_0x0531('0x3a')]['rawAttributes']);_0x4c82c5[_0x0531('0x30')]=_[_0x0531('0x2f')](_0x387938['query']);_0x4c82c5['filters']=_[_0x0531('0x32')](_0x4c82c5['model'],_0x4c82c5[_0x0531('0x30')]);_0x13c841[_0x0531('0x33')]=_[_0x0531('0x32')](_0x4c82c5['model'],qs[_0x0531('0x40')](_0x387938['query'][_0x0531('0x40')]));_0x13c841[_0x0531('0x33')]=_0x13c841[_0x0531('0x33')][_0x0531('0x34')]?_0x13c841[_0x0531('0x33')]:_0x4c82c5[_0x0531('0x2e')];if(_0x387938['query'][_0x0531('0x3b')]){_0x13c841[_0x0531('0x3c')]=[{'all':!![]}];}_0x13c841=_[_0x0531('0x39')]({},_0x13c841,_0x387938['options']);return db['SquareReport'][_0x0531('0x41')](_0x13c841)[_0x0531('0x26')](handleEntityNotFound(_0x32356d,null))[_0x0531('0x26')](respondWithResult(_0x32356d,null))[_0x0531('0x3d')](handleError(_0x32356d,null));};exports['create']=function(_0x5c6ba3,_0x285c4b){return db[_0x0531('0x3a')][_0x0531('0x42')](_0x5c6ba3[_0x0531('0x43')],{})[_0x0531('0x26')](respondWithResult(_0x285c4b,0xc9))['catch'](handleError(_0x285c4b,null));};exports['update']=function(_0x3651c5,_0x5327e9){if(_0x3651c5['body']['id']){delete _0x3651c5[_0x0531('0x43')]['id'];}return db[_0x0531('0x3a')][_0x0531('0x41')]({'where':{'id':_0x3651c5[_0x0531('0x3f')]['id']}})[_0x0531('0x26')](handleEntityNotFound(_0x5327e9,null))['then'](saveUpdates(_0x3651c5[_0x0531('0x43')],null))[_0x0531('0x26')](respondWithResult(_0x5327e9,null))[_0x0531('0x3d')](handleError(_0x5327e9,null));};exports[_0x0531('0x27')]=function(_0x4d34c5,_0x210d40){return db[_0x0531('0x3a')][_0x0531('0x41')]({'where':{'id':_0x4d34c5[_0x0531('0x3f')]['id']}})[_0x0531('0x26')](handleEntityNotFound(_0x210d40,null))[_0x0531('0x26')](removeEntity(_0x210d40,null))['catch'](handleError(_0x210d40,null));};exports['describe']=function(_0x32f53d,_0x12383b){return db[_0x0531('0x3a')][_0x0531('0x44')]()[_0x0531('0x26')](respondWithResult(_0x12383b,null))['catch'](handleError(_0x12383b,null));};
\ No newline at end of file
+var _0xa01b=['rawAttributes','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','SquareReport','fieldName','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','options','include','rows','catch','params'];(function(_0x47f84a,_0x33b10f){var _0x328233=function(_0x174a31){while(--_0x174a31){_0x47f84a['push'](_0x47f84a['shift']());}};_0x328233(++_0x33b10f);}(_0xa01b,0x1cf));var _0xba01=function(_0x3167fa,_0x5511f0){_0x3167fa=_0x3167fa-0x0;var _0x3619d5=_0xa01b[_0x3167fa];return _0x3619d5;};'use strict';var emlformat=require(_0xba01('0x0'));var rimraf=require(_0xba01('0x1'));var zipdir=require(_0xba01('0x2'));var jsonpatch=require(_0xba01('0x3'));var rp=require(_0xba01('0x4'));var moment=require(_0xba01('0x5'));var BPromise=require(_0xba01('0x6'));var Mustache=require('mustache');var util=require(_0xba01('0x7'));var path=require(_0xba01('0x8'));var sox=require(_0xba01('0x9'));var csv=require(_0xba01('0xa'));var ejs=require(_0xba01('0xb'));var fs=require('fs');var fs_extra=require(_0xba01('0xc'));var _=require(_0xba01('0xd'));var squel=require(_0xba01('0xe'));var crypto=require(_0xba01('0xf'));var jsforce=require(_0xba01('0x10'));var deskjs=require(_0xba01('0x11'));var toCsv=require(_0xba01('0xa'));var querystring=require('querystring');var Papa=require(_0xba01('0x12'));var Redis=require('ioredis');var authService=require(_0xba01('0x13'));var qs=require(_0xba01('0x14'));var as=require(_0xba01('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xba01('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xba01('0x17'));var db=require(_0xba01('0x18'))['db'];function respondWithStatusCode(_0x148538,_0x1821cb){_0x1821cb=_0x1821cb||0xcc;return function(_0x8338a7){if(_0x8338a7){return _0x148538[_0xba01('0x19')](_0x1821cb);}return _0x148538[_0xba01('0x1a')](_0x1821cb)['end']();};}function respondWithResult(_0x58e606,_0x3e090f){_0x3e090f=_0x3e090f||0xc8;return function(_0x463ff4){if(_0x463ff4){return _0x58e606[_0xba01('0x1a')](_0x3e090f)[_0xba01('0x1b')](_0x463ff4);}};}function respondWithFilteredResult(_0x46b709,_0xa02079){return function(_0x1acea0){if(_0x1acea0){var _0x395c61=typeof _0xa02079[_0xba01('0x1c')]===_0xba01('0x1d')&&typeof _0xa02079[_0xba01('0x1e')]===_0xba01('0x1d');var _0x2d4e4a=_0x1acea0[_0xba01('0x1f')];var _0x2e10ef=_0x395c61?0x0:_0xa02079[_0xba01('0x1c')];var _0x3b279c=_0x395c61?_0x1acea0['count']:_0xa02079[_0xba01('0x1c')]+_0xa02079[_0xba01('0x1e')];var _0x38592d;if(_0x3b279c>=_0x2d4e4a){_0x3b279c=_0x2d4e4a;_0x38592d=0xc8;}else{_0x38592d=0xce;}_0x46b709[_0xba01('0x1a')](_0x38592d);return _0x46b709[_0xba01('0x20')](_0xba01('0x21'),_0x2e10ef+'-'+_0x3b279c+'/'+_0x2d4e4a)['json'](_0x1acea0);}return null;};}function patchUpdates(_0x58819e){return function(_0x3fd7b0){try{jsonpatch[_0xba01('0x22')](_0x3fd7b0,_0x58819e,!![]);}catch(_0x7bfa3b){return BPromise[_0xba01('0x23')](_0x7bfa3b);}return _0x3fd7b0[_0xba01('0x24')]();};}function saveUpdates(_0x541783,_0x16fd84){return function(_0x32b1a9){if(_0x32b1a9){return _0x32b1a9[_0xba01('0x25')](_0x541783)[_0xba01('0x26')](function(_0x3c5ad0){return _0x3c5ad0;});}return null;};}function removeEntity(_0x244f0b,_0x438971){return function(_0x5cc1e8){if(_0x5cc1e8){return _0x5cc1e8[_0xba01('0x27')]()[_0xba01('0x26')](function(){_0x244f0b['status'](0xcc)[_0xba01('0x28')]();});}};}function handleEntityNotFound(_0x359851,_0xe3d318){return function(_0xc86cda){if(!_0xc86cda){_0x359851[_0xba01('0x19')](0x194);}return _0xc86cda;};}function handleError(_0x29b577,_0x22693d){_0x22693d=_0x22693d||0x1f4;return function(_0x16d523){logger[_0xba01('0x29')](_0x16d523['stack']);if(_0x16d523[_0xba01('0x2a')]){delete _0x16d523[_0xba01('0x2a')];}_0x29b577[_0xba01('0x1a')](_0x22693d)[_0xba01('0x2b')](_0x16d523);};}exports['index']=function(_0x2165fa,_0x50f12a){var _0x1df52f={},_0x514138={},_0x220dad={'count':0x0,'rows':[]};var _0x34eb2b=_[_0xba01('0x2c')](db[_0xba01('0x2d')]['rawAttributes'],function(_0xcf1214){return{'name':_0xcf1214[_0xba01('0x2e')],'type':_0xcf1214[_0xba01('0x2f')]['key']};});_0x514138['model']=_['map'](_0x34eb2b,_0xba01('0x2a'));_0x514138[_0xba01('0x30')]=_[_0xba01('0x31')](_0x2165fa['query']);_0x514138[_0xba01('0x32')]=_['intersection'](_0x514138['model'],_0x514138[_0xba01('0x30')]);_0x1df52f['attributes']=_[_0xba01('0x33')](_0x514138[_0xba01('0x34')],qs[_0xba01('0x35')](_0x2165fa['query'][_0xba01('0x35')]));_0x1df52f[_0xba01('0x36')]=_0x1df52f[_0xba01('0x36')]['length']?_0x1df52f[_0xba01('0x36')]:_0x514138[_0xba01('0x34')];if(!_0x2165fa[_0xba01('0x30')][_0xba01('0x37')](_0xba01('0x38'))){_0x1df52f[_0xba01('0x1e')]=qs[_0xba01('0x1e')](_0x2165fa[_0xba01('0x30')][_0xba01('0x1e')]);_0x1df52f['offset']=qs['offset'](_0x2165fa[_0xba01('0x30')][_0xba01('0x1c')]);}_0x1df52f[_0xba01('0x39')]=qs['sort'](_0x2165fa[_0xba01('0x30')][_0xba01('0x3a')]);_0x1df52f['where']=qs['filters'](_[_0xba01('0x3b')](_0x2165fa[_0xba01('0x30')],_0x514138[_0xba01('0x32')]),_0x34eb2b);if(_0x2165fa[_0xba01('0x30')]['filter']){_0x1df52f['where']=_[_0xba01('0x3c')](_0x1df52f[_0xba01('0x3d')],{'$or':_[_0xba01('0x2c')](_0x34eb2b,function(_0x1a364a){if(_0x1a364a[_0xba01('0x2f')]!==_0xba01('0x3e')){var _0x1ac341={};_0x1ac341[_0x1a364a[_0xba01('0x2a')]]={'$like':'%'+_0x2165fa['query'][_0xba01('0x3f')]+'%'};return _0x1ac341;}})});}_0x1df52f=_[_0xba01('0x3c')]({},_0x1df52f,_0x2165fa[_0xba01('0x40')]);var _0x4bfb0d={'where':_0x1df52f['where']};return db[_0xba01('0x2d')]['count'](_0x4bfb0d)[_0xba01('0x26')](function(_0x39bd7f){_0x220dad[_0xba01('0x1f')]=_0x39bd7f;if(_0x2165fa[_0xba01('0x30')]['includeAll']){_0x1df52f[_0xba01('0x41')]=[{'all':!![]}];}return db[_0xba01('0x2d')]['findAll'](_0x1df52f);})[_0xba01('0x26')](function(_0x408f5d){_0x220dad[_0xba01('0x42')]=_0x408f5d;return _0x220dad;})[_0xba01('0x26')](respondWithFilteredResult(_0x50f12a,_0x1df52f))[_0xba01('0x43')](handleError(_0x50f12a,null));};exports['show']=function(_0x1c9c52,_0xa59c44){var _0x5e9a8b={'raw':!![],'where':{'id':_0x1c9c52[_0xba01('0x44')]['id']}},_0x18def1={};_0x18def1[_0xba01('0x34')]=_[_0xba01('0x31')](db['SquareReport'][_0xba01('0x45')]);_0x18def1[_0xba01('0x30')]=_[_0xba01('0x31')](_0x1c9c52[_0xba01('0x30')]);_0x18def1[_0xba01('0x32')]=_['intersection'](_0x18def1['model'],_0x18def1[_0xba01('0x30')]);_0x5e9a8b[_0xba01('0x36')]=_[_0xba01('0x33')](_0x18def1['model'],qs['fields'](_0x1c9c52[_0xba01('0x30')]['fields']));_0x5e9a8b[_0xba01('0x36')]=_0x5e9a8b[_0xba01('0x36')][_0xba01('0x46')]?_0x5e9a8b[_0xba01('0x36')]:_0x18def1[_0xba01('0x34')];if(_0x1c9c52[_0xba01('0x30')][_0xba01('0x47')]){_0x5e9a8b['include']=[{'all':!![]}];}_0x5e9a8b=_[_0xba01('0x3c')]({},_0x5e9a8b,_0x1c9c52[_0xba01('0x40')]);return db['SquareReport'][_0xba01('0x48')](_0x5e9a8b)[_0xba01('0x26')](handleEntityNotFound(_0xa59c44,null))['then'](respondWithResult(_0xa59c44,null))['catch'](handleError(_0xa59c44,null));};exports[_0xba01('0x49')]=function(_0x5d9316,_0x7760b9){return db['SquareReport'][_0xba01('0x49')](_0x5d9316[_0xba01('0x4a')],{})['then'](respondWithResult(_0x7760b9,0xc9))[_0xba01('0x43')](handleError(_0x7760b9,null));};exports[_0xba01('0x25')]=function(_0x287fe4,_0x51c96e){if(_0x287fe4[_0xba01('0x4a')]['id']){delete _0x287fe4['body']['id'];}return db[_0xba01('0x2d')][_0xba01('0x48')]({'where':{'id':_0x287fe4[_0xba01('0x44')]['id']}})['then'](handleEntityNotFound(_0x51c96e,null))[_0xba01('0x26')](saveUpdates(_0x287fe4['body'],null))[_0xba01('0x26')](respondWithResult(_0x51c96e,null))[_0xba01('0x43')](handleError(_0x51c96e,null));};exports[_0xba01('0x27')]=function(_0x450ae6,_0x2c8903){return db[_0xba01('0x2d')][_0xba01('0x48')]({'where':{'id':_0x450ae6[_0xba01('0x44')]['id']}})[_0xba01('0x26')](handleEntityNotFound(_0x2c8903,null))[_0xba01('0x26')](removeEntity(_0x2c8903,null))['catch'](handleError(_0x2c8903,null));};exports['describe']=function(_0x1baf5a,_0xc7d2df){return db[_0xba01('0x2d')][_0xba01('0x4b')]()[_0xba01('0x26')](respondWithResult(_0xc7d2df,null))[_0xba01('0x43')](handleError(_0xc7d2df,null));};
\ No newline at end of file
index e55acbf..543eb6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb13d=['leaveAt','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','SquareReport','report_square','project_name'];(function(_0x11e43c,_0x46699b){var _0x2ce1e0=function(_0x213d8a){while(--_0x213d8a){_0x11e43c['push'](_0x11e43c['shift']());}};_0x2ce1e0(++_0x46699b);}(_0xb13d,0x16d));var _0xdb13=function(_0x5f29d9,_0x426886){_0x5f29d9=_0x5f29d9-0x0;var _0x20436a=_0xb13d[_0x5f29d9];return _0x20436a;};'use strict';var _=require('lodash');var util=require(_0xdb13('0x0'));var logger=require(_0xdb13('0x1'))('api');var moment=require(_0xdb13('0x2'));var BPromise=require(_0xdb13('0x3'));var rp=require(_0xdb13('0x4'));var fs=require('fs');var path=require(_0xdb13('0x5'));var rimraf=require(_0xdb13('0x6'));var config=require('../../config/environment');var attributes=require(_0xdb13('0x7'));module[_0xdb13('0x8')]=function(_0x232cb2,_0x22cebb){return _0x232cb2[_0xdb13('0x9')](_0xdb13('0xa'),attributes,{'tableName':_0xdb13('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0xdb13('0xc')]},{'name':_0xdb13('0xd'),'fields':[_0xdb13('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd675=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','define','report_square','uid_pname','uniqueid','leaveAt','lodash','util'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0xd675,0xd0));var _0x5d67=function(_0x1162f9,_0x35f87c){_0x1162f9=_0x1162f9-0x0;var _0x75257c=_0xd675[_0x1162f9];return _0x75257c;};'use strict';var _=require(_0x5d67('0x0'));var util=require(_0x5d67('0x1'));var logger=require(_0x5d67('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5d67('0x3'));var rp=require(_0x5d67('0x4'));var fs=require('fs');var path=require(_0x5d67('0x5'));var rimraf=require(_0x5d67('0x6'));var config=require(_0x5d67('0x7'));var attributes=require(_0x5d67('0x8'));module['exports']=function(_0xc79ea9,_0x2c930e){return _0xc79ea9[_0x5d67('0x9')]('SquareReport',attributes,{'tableName':_0x5d67('0xa'),'paranoid':![],'indexes':[{'name':_0x5d67('0xb'),'fields':[_0x5d67('0xc'),'project_name']},{'name':_0x5d67('0xd'),'fields':['leaveAt']}],'timestamps':!![]});};
\ No newline at end of file
index ad52f09..bbd5829 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c13=['limit','UpdateSquareReport','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSquareReport','SquareReport','create','body','options','raw','update','where'];(function(_0x344eb8,_0x12a8a5){var _0x3f197c=function(_0x21fa6e){while(--_0x21fa6e){_0x344eb8['push'](_0x344eb8['shift']());}};_0x3f197c(++_0x12a8a5);}(_0x9c13,0x1af));var _0x39c1=function(_0x13b392,_0x3481f2){_0x13b392=_0x13b392-0x0;var _0x39db24=_0x9c13[_0x13b392];return _0x39db24;};'use strict';var _=require('lodash');var util=require(_0x39c1('0x0'));var moment=require(_0x39c1('0x1'));var BPromise=require('bluebird');var rs=require(_0x39c1('0x2'));var fs=require('fs');var Redis=require(_0x39c1('0x3'));var db=require(_0x39c1('0x4'))['db'];var utils=require(_0x39c1('0x5'));var logger=require(_0x39c1('0x6'))(_0x39c1('0x7'));var config=require('../../config/environment');var jayson=require(_0x39c1('0x8'));var client=jayson[_0x39c1('0x9')][_0x39c1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xeff380,_0x4c0d56,_0x44bd9a){return new BPromise(function(_0x3f2486,_0x5e9cb2){return client[_0x39c1('0xb')](_0xeff380,_0x44bd9a)[_0x39c1('0xc')](function(_0x449a3e){logger[_0x39c1('0xd')](_0x39c1('0xe'),_0x4c0d56,_0x39c1('0xf'));logger[_0x39c1('0x10')](_0x39c1('0x11'),_0x4c0d56,_0x39c1('0xf'),JSON[_0x39c1('0x12')](_0x449a3e));if(_0x449a3e['error']){if(_0x449a3e[_0x39c1('0x13')][_0x39c1('0x14')]===0x1f4){logger[_0x39c1('0x13')](_0x39c1('0xe'),_0x4c0d56,_0x449a3e[_0x39c1('0x13')]['message']);return _0x5e9cb2(_0x449a3e[_0x39c1('0x13')][_0x39c1('0x15')]);}logger[_0x39c1('0x13')](_0x39c1('0xe'),_0x4c0d56,_0x449a3e['error'][_0x39c1('0x15')]);return _0x3f2486(_0x449a3e['error'][_0x39c1('0x15')]);}else{logger[_0x39c1('0xd')](_0x39c1('0xe'),_0x4c0d56,_0x39c1('0xf'));_0x3f2486(_0x449a3e['result'][_0x39c1('0x15')]);}})[_0x39c1('0x16')](function(_0x1de8b5){logger[_0x39c1('0x13')](_0x39c1('0xe'),_0x4c0d56,_0x1de8b5);_0x5e9cb2(_0x1de8b5);});});}exports[_0x39c1('0x17')]=function(_0x5f4860){var _0x217dd4=this;return new Promise(function(_0x4fa3e2,_0x31a78d){return db[_0x39c1('0x18')][_0x39c1('0x19')](_0x5f4860[_0x39c1('0x1a')],{'raw':_0x5f4860[_0x39c1('0x1b')]?_0x5f4860[_0x39c1('0x1b')][_0x39c1('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x3fb8d2){logger[_0x39c1('0xd')](_0x39c1('0x17'),_0x5f4860);logger[_0x39c1('0x10')](_0x39c1('0x17'),_0x5f4860,JSON['stringify'](_0x3fb8d2));_0x4fa3e2(_0x3fb8d2);})[_0x39c1('0x16')](function(_0x25b6a2){logger['error']('CreateSquareReport',_0x25b6a2[_0x39c1('0x15')],_0x5f4860);_0x31a78d(_0x217dd4[_0x39c1('0x13')](0x1f4,_0x25b6a2['message']));});});};exports['UpdateSquareReport']=function(_0x308379){var _0x232dd0=this;return new Promise(function(_0x2b0cdb,_0x475b98){return db[_0x39c1('0x18')][_0x39c1('0x1d')](_0x308379[_0x39c1('0x1a')],{'raw':_0x308379[_0x39c1('0x1b')]?_0x308379['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x308379[_0x39c1('0x1b')]?_0x308379['options'][_0x39c1('0x1e')]||null:null,'attributes':_0x308379[_0x39c1('0x1b')]?_0x308379['options']['attributes']||null:null,'limit':_0x308379[_0x39c1('0x1b')]?_0x308379[_0x39c1('0x1b')][_0x39c1('0x1f')]||null:null})['then'](function(_0x383e04){logger[_0x39c1('0xd')](_0x39c1('0x20'),_0x308379);logger[_0x39c1('0x10')](_0x39c1('0x20'),_0x308379,JSON[_0x39c1('0x12')](_0x383e04));_0x2b0cdb(_0x383e04);})[_0x39c1('0x16')](function(_0x37199b){logger['error'](_0x39c1('0x20'),_0x37199b['message'],_0x308379);_0x475b98(_0x232dd0[_0x39c1('0x13')](0x1f4,_0x37199b['message']));});});};
\ No newline at end of file
+var _0x7e1a=['code','message','result','CreateSquareReport','body','options','debug','catch','UpdateSquareReport','update','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3ed2cd,_0x5c1a87){var _0x583da6=function(_0x3e11ea){while(--_0x3e11ea){_0x3ed2cd['push'](_0x3ed2cd['shift']());}};_0x583da6(++_0x5c1a87);}(_0x7e1a,0x7c));var _0xa7e1=function(_0x23dadb,_0x2f3359){_0x23dadb=_0x23dadb-0x0;var _0xdd295c=_0x7e1a[_0x23dadb];return _0xdd295c;};'use strict';var _=require(_0xa7e1('0x0'));var util=require('util');var moment=require(_0xa7e1('0x1'));var BPromise=require(_0xa7e1('0x2'));var rs=require(_0xa7e1('0x3'));var fs=require('fs');var Redis=require(_0xa7e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa7e1('0x5'));var jayson=require(_0xa7e1('0x6'));var client=jayson['client'][_0xa7e1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfb8f29,_0x12a36b,_0x49bead){return new BPromise(function(_0x213525,_0x243e9e){return client[_0xa7e1('0x8')](_0xfb8f29,_0x49bead)[_0xa7e1('0x9')](function(_0x3cee91){logger[_0xa7e1('0xa')](_0xa7e1('0xb'),_0x12a36b,_0xa7e1('0xc'));logger['debug'](_0xa7e1('0xd'),_0x12a36b,'request\x20sent',JSON[_0xa7e1('0xe')](_0x3cee91));if(_0x3cee91[_0xa7e1('0xf')]){if(_0x3cee91[_0xa7e1('0xf')][_0xa7e1('0x10')]===0x1f4){logger[_0xa7e1('0xf')](_0xa7e1('0xb'),_0x12a36b,_0x3cee91[_0xa7e1('0xf')][_0xa7e1('0x11')]);return _0x243e9e(_0x3cee91['error'][_0xa7e1('0x11')]);}logger[_0xa7e1('0xf')](_0xa7e1('0xb'),_0x12a36b,_0x3cee91[_0xa7e1('0xf')][_0xa7e1('0x11')]);return _0x213525(_0x3cee91[_0xa7e1('0xf')][_0xa7e1('0x11')]);}else{logger[_0xa7e1('0xa')](_0xa7e1('0xb'),_0x12a36b,_0xa7e1('0xc'));_0x213525(_0x3cee91[_0xa7e1('0x12')]['message']);}})['catch'](function(_0x27e178){logger[_0xa7e1('0xf')](_0xa7e1('0xb'),_0x12a36b,_0x27e178);_0x243e9e(_0x27e178);});});}exports[_0xa7e1('0x13')]=function(_0x2ab5b7){var _0x3b8f22=this;return new Promise(function(_0x184563,_0x471e02){return db['SquareReport']['create'](_0x2ab5b7[_0xa7e1('0x14')],{'raw':_0x2ab5b7[_0xa7e1('0x15')]?_0x2ab5b7[_0xa7e1('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xa7e1('0x9')](function(_0x3fbf6c){logger[_0xa7e1('0xa')](_0xa7e1('0x13'),_0x2ab5b7);logger[_0xa7e1('0x16')](_0xa7e1('0x13'),_0x2ab5b7,JSON['stringify'](_0x3fbf6c));_0x184563(_0x3fbf6c);})[_0xa7e1('0x17')](function(_0x217acf){logger['error'](_0xa7e1('0x13'),_0x217acf[_0xa7e1('0x11')],_0x2ab5b7);_0x471e02(_0x3b8f22[_0xa7e1('0xf')](0x1f4,_0x217acf[_0xa7e1('0x11')]));});});};exports[_0xa7e1('0x18')]=function(_0x1ec066){var _0x133a13=this;return new Promise(function(_0x26e290,_0x13e766){return db['SquareReport'][_0xa7e1('0x19')](_0x1ec066[_0xa7e1('0x14')],{'raw':_0x1ec066[_0xa7e1('0x15')]?_0x1ec066[_0xa7e1('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ec066[_0xa7e1('0x15')]?_0x1ec066['options']['where']||null:null,'attributes':_0x1ec066[_0xa7e1('0x15')]?_0x1ec066[_0xa7e1('0x15')][_0xa7e1('0x1a')]||null:null,'limit':_0x1ec066[_0xa7e1('0x15')]?_0x1ec066[_0xa7e1('0x15')][_0xa7e1('0x1b')]||null:null})[_0xa7e1('0x9')](function(_0x576a88){logger[_0xa7e1('0xa')](_0xa7e1('0x18'),_0x1ec066);logger[_0xa7e1('0x16')](_0xa7e1('0x18'),_0x1ec066,JSON[_0xa7e1('0xe')](_0x576a88));_0x26e290(_0x576a88);})[_0xa7e1('0x17')](function(_0x4a7fa7){logger[_0xa7e1('0xf')](_0xa7e1('0x18'),_0x4a7fa7['message'],_0x1ec066);_0x13e766(_0x133a13[_0xa7e1('0xf')](0x1f4,_0x4a7fa7[_0xa7e1('0x11')]));});});};
\ No newline at end of file
index 375f46f..6ee1276 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd21=['get','index','/describe','isAuthenticated','/:id','show','create','put','delete','destroy','exports','connect-timeout','../../components/interaction/service','../../config/environment','./squareReportDetail.controller'];(function(_0x54f3e8,_0x3ed493){var _0x267b37=function(_0x58247e){while(--_0x58247e){_0x54f3e8['push'](_0x54f3e8['shift']());}};_0x267b37(++_0x3ed493);}(_0xdd21,0x155));var _0x1dd2=function(_0x44d5b7,_0x38c266){_0x44d5b7=_0x44d5b7-0x0;var _0x44f102=_0xdd21[_0x44d5b7];return _0x44f102;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1dd2('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1dd2('0x1'));var config=require(_0x1dd2('0x2'));var controller=require(_0x1dd2('0x3'));router[_0x1dd2('0x4')]('/',auth['isAuthenticated'](),controller[_0x1dd2('0x5')]);router['get'](_0x1dd2('0x6'),auth[_0x1dd2('0x7')](),controller['describe']);router[_0x1dd2('0x4')](_0x1dd2('0x8'),auth[_0x1dd2('0x7')](),controller[_0x1dd2('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1dd2('0xa')]);router[_0x1dd2('0xb')](_0x1dd2('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x1dd2('0xc')]('/:id',auth[_0x1dd2('0x7')](),controller[_0x1dd2('0xd')]);module[_0x1dd2('0xe')]=router;
\ No newline at end of file
+var _0xfe68=['../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','describe','/:id','post','create','put','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x3623dd,_0x43912b){var _0xa096=function(_0x5880fe){while(--_0x5880fe){_0x3623dd['push'](_0x3623dd['shift']());}};_0xa096(++_0x43912b);}(_0xfe68,0x139));var _0x8fe6=function(_0xca41dc,_0x22936e){_0xca41dc=_0xca41dc-0x0;var _0x3e125c=_0xfe68[_0xca41dc];return _0x3e125c;};'use strict';var multer=require(_0x8fe6('0x0'));var util=require(_0x8fe6('0x1'));var path=require(_0x8fe6('0x2'));var timeout=require('connect-timeout');var express=require(_0x8fe6('0x3'));var router=express[_0x8fe6('0x4')]();var fs_extra=require(_0x8fe6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8fe6('0x6'));var config=require(_0x8fe6('0x7'));var controller=require(_0x8fe6('0x8'));router['get']('/',auth[_0x8fe6('0x9')](),controller[_0x8fe6('0xa')]);router[_0x8fe6('0xb')]('/describe',auth[_0x8fe6('0x9')](),controller[_0x8fe6('0xc')]);router[_0x8fe6('0xb')](_0x8fe6('0xd'),auth[_0x8fe6('0x9')](),controller['show']);router[_0x8fe6('0xe')]('/',auth['isAuthenticated'](),controller[_0x8fe6('0xf')]);router[_0x8fe6('0x10')](_0x8fe6('0xd'),auth[_0x8fe6('0x9')](),controller[_0x8fe6('0x11')]);router[_0x8fe6('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8fe6('0x13')]=router;
\ No newline at end of file
index 8afc82a..7ed2841 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19e6=['STRING','TEXT','sequelize'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x19e6,0x1ac));var _0x619e=function(_0x1531f2,_0x22a502){_0x1531f2=_0x1531f2-0x0;var _0x5cc11b=_0x19e6[_0x1531f2];return _0x5cc11b;};'use strict';var Sequelize=require(_0x619e('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0x619e('0x1')]},'application':{'type':Sequelize[_0x619e('0x1')]},'data':{'type':Sequelize[_0x619e('0x2')]},'project_name':{'type':Sequelize[_0x619e('0x1')]},'callerid':{'type':Sequelize[_0x619e('0x1')]}};
\ No newline at end of file
+var _0x8fa6=['STRING','exports'];(function(_0x1d4923,_0x4e222f){var _0x14ea9a=function(_0x54e138){while(--_0x54e138){_0x1d4923['push'](_0x1d4923['shift']());}};_0x14ea9a(++_0x4e222f);}(_0x8fa6,0x139));var _0x68fa=function(_0x4ccc41,_0x34030f){_0x4ccc41=_0x4ccc41-0x0;var _0xa2d26=_0x8fa6[_0x4ccc41];return _0xa2d26;};'use strict';var Sequelize=require('sequelize');module[_0x68fa('0x0')]={'uniqueid':{'type':Sequelize[_0x68fa('0x1')]},'node':{'type':Sequelize[_0x68fa('0x1')]},'application':{'type':Sequelize[_0x68fa('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x68fa('0x1')]},'callerid':{'type':Sequelize[_0x68fa('0x1')]}};
\ No newline at end of file
index baa59ea..06a73ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x638f=['find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','apply','reject','save','update','destroy','then','stack','name','send','SquareDetailsReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x4bed5d,_0x2cb210){var _0x216ea3=function(_0x54b6e4){while(--_0x54b6e4){_0x4bed5d['push'](_0x4bed5d['shift']());}};_0x216ea3(++_0x2cb210);}(_0x638f,0xe5));var _0xf638=function(_0x32a81f,_0x4eee66){_0x32a81f=_0x32a81f-0x0;var _0x5b67a2=_0x638f[_0x32a81f];return _0x5b67a2;};'use strict';var emlformat=require(_0xf638('0x0'));var rimraf=require(_0xf638('0x1'));var zipdir=require(_0xf638('0x2'));var jsonpatch=require(_0xf638('0x3'));var rp=require('request-promise');var moment=require(_0xf638('0x4'));var BPromise=require(_0xf638('0x5'));var Mustache=require(_0xf638('0x6'));var util=require(_0xf638('0x7'));var path=require(_0xf638('0x8'));var sox=require('sox');var csv=require(_0xf638('0x9'));var ejs=require(_0xf638('0xa'));var fs=require('fs');var fs_extra=require(_0xf638('0xb'));var _=require(_0xf638('0xc'));var squel=require('squel');var crypto=require(_0xf638('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf638('0xe'));var toCsv=require(_0xf638('0x9'));var querystring=require(_0xf638('0xf'));var Papa=require(_0xf638('0x10'));var Redis=require('ioredis');var authService=require(_0xf638('0x11'));var qs=require(_0xf638('0x12'));var as=require(_0xf638('0x13'));var hardwareService=require(_0xf638('0x14'));var logger=require(_0xf638('0x15'))(_0xf638('0x16'));var utils=require(_0xf638('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf638('0x18'))['db'];function respondWithStatusCode(_0x139765,_0x5eff42){_0x5eff42=_0x5eff42||0xcc;return function(_0x585c40){if(_0x585c40){return _0x139765[_0xf638('0x19')](_0x5eff42);}return _0x139765['status'](_0x5eff42)[_0xf638('0x1a')]();};}function respondWithResult(_0x39bb10,_0x3f4745){_0x3f4745=_0x3f4745||0xc8;return function(_0x2723c2){if(_0x2723c2){return _0x39bb10[_0xf638('0x1b')](_0x3f4745)[_0xf638('0x1c')](_0x2723c2);}};}function respondWithFilteredResult(_0x3f8e18,_0x22ccb7){return function(_0x5d79f1){if(_0x5d79f1){var _0x1d7740=typeof _0x22ccb7['offset']==='undefined'&&typeof _0x22ccb7[_0xf638('0x1d')]===_0xf638('0x1e');var _0x17dd2f=_0x5d79f1['count'];var _0x4cdbe2=_0x1d7740?0x0:_0x22ccb7['offset'];var _0x5b0de1=_0x1d7740?_0x5d79f1[_0xf638('0x1f')]:_0x22ccb7[_0xf638('0x20')]+_0x22ccb7[_0xf638('0x1d')];var _0x24a9d5;if(_0x5b0de1>=_0x17dd2f){_0x5b0de1=_0x17dd2f;_0x24a9d5=0xc8;}else{_0x24a9d5=0xce;}_0x3f8e18[_0xf638('0x1b')](_0x24a9d5);return _0x3f8e18['set']('Content-Range',_0x4cdbe2+'-'+_0x5b0de1+'/'+_0x17dd2f)[_0xf638('0x1c')](_0x5d79f1);}return null;};}function patchUpdates(_0x253bac){return function(_0x5c3b53){try{jsonpatch[_0xf638('0x21')](_0x5c3b53,_0x253bac,!![]);}catch(_0x41ca6f){return BPromise[_0xf638('0x22')](_0x41ca6f);}return _0x5c3b53[_0xf638('0x23')]();};}function saveUpdates(_0x2bb814,_0x211aba){return function(_0x3f1922){if(_0x3f1922){return _0x3f1922[_0xf638('0x24')](_0x2bb814)['then'](function(_0xb0dba2){return _0xb0dba2;});}return null;};}function removeEntity(_0x13788d,_0x42d591){return function(_0x566522){if(_0x566522){return _0x566522[_0xf638('0x25')]()[_0xf638('0x26')](function(){_0x13788d['status'](0xcc)[_0xf638('0x1a')]();});}};}function handleEntityNotFound(_0x395d5b,_0x4034b8){return function(_0x3c9392){if(!_0x3c9392){_0x395d5b[_0xf638('0x19')](0x194);}return _0x3c9392;};}function handleError(_0x57431f,_0x3cb9eb){_0x3cb9eb=_0x3cb9eb||0x1f4;return function(_0x278474){logger['error'](_0x278474[_0xf638('0x27')]);if(_0x278474[_0xf638('0x28')]){delete _0x278474[_0xf638('0x28')];}_0x57431f[_0xf638('0x1b')](_0x3cb9eb)[_0xf638('0x29')](_0x278474);};}exports['index']=function(_0x49fd8b,_0x248e1b){var _0x14cbda={},_0x2a2d6d={},_0x11f04b={'count':0x0,'rows':[]};var _0x5f4200=_['map'](db[_0xf638('0x2a')][_0xf638('0x2b')],function(_0x522fd6){return{'name':_0x522fd6[_0xf638('0x2c')],'type':_0x522fd6['type']['key']};});_0x2a2d6d[_0xf638('0x2d')]=_['map'](_0x5f4200,_0xf638('0x28'));_0x2a2d6d[_0xf638('0x2e')]=_[_0xf638('0x2f')](_0x49fd8b[_0xf638('0x2e')]);_0x2a2d6d[_0xf638('0x30')]=_[_0xf638('0x31')](_0x2a2d6d['model'],_0x2a2d6d[_0xf638('0x2e')]);_0x14cbda['attributes']=_['intersection'](_0x2a2d6d['model'],qs[_0xf638('0x32')](_0x49fd8b[_0xf638('0x2e')][_0xf638('0x32')]));_0x14cbda['attributes']=_0x14cbda[_0xf638('0x33')][_0xf638('0x34')]?_0x14cbda[_0xf638('0x33')]:_0x2a2d6d[_0xf638('0x2d')];if(!_0x49fd8b[_0xf638('0x2e')][_0xf638('0x35')](_0xf638('0x36'))){_0x14cbda[_0xf638('0x1d')]=qs[_0xf638('0x1d')](_0x49fd8b['query']['limit']);_0x14cbda['offset']=qs[_0xf638('0x20')](_0x49fd8b[_0xf638('0x2e')][_0xf638('0x20')]);}_0x14cbda['order']=qs[_0xf638('0x37')](_0x49fd8b[_0xf638('0x2e')][_0xf638('0x37')]);_0x14cbda[_0xf638('0x38')]=qs[_0xf638('0x30')](_[_0xf638('0x39')](_0x49fd8b[_0xf638('0x2e')],_0x2a2d6d[_0xf638('0x30')]),_0x5f4200);if(_0x49fd8b['query'][_0xf638('0x3a')]){_0x14cbda[_0xf638('0x38')]=_['merge'](_0x14cbda[_0xf638('0x38')],{'$or':_[_0xf638('0x3b')](_0x5f4200,function(_0x394900){if(_0x394900[_0xf638('0x3c')]!==_0xf638('0x3d')){var _0x5640df={};_0x5640df[_0x394900[_0xf638('0x28')]]={'$like':'%'+_0x49fd8b[_0xf638('0x2e')]['filter']+'%'};return _0x5640df;}})});}_0x14cbda=_[_0xf638('0x3e')]({},_0x14cbda,_0x49fd8b[_0xf638('0x3f')]);var _0x35986f={'where':_0x14cbda['where']};return db[_0xf638('0x2a')]['count'](_0x35986f)[_0xf638('0x26')](function(_0x378344){_0x11f04b[_0xf638('0x1f')]=_0x378344;if(_0x49fd8b[_0xf638('0x2e')][_0xf638('0x40')]){_0x14cbda[_0xf638('0x41')]=[{'all':!![]}];}return db[_0xf638('0x2a')][_0xf638('0x42')](_0x14cbda);})[_0xf638('0x26')](function(_0x3174d0){_0x11f04b[_0xf638('0x43')]=_0x3174d0;return _0x11f04b;})['then'](respondWithFilteredResult(_0x248e1b,_0x14cbda))[_0xf638('0x44')](handleError(_0x248e1b,null));};exports[_0xf638('0x45')]=function(_0x5daf4,_0x4e220e){var _0x2d574d={'raw':!![],'where':{'id':_0x5daf4[_0xf638('0x46')]['id']}},_0x92ffd8={};_0x92ffd8['model']=_[_0xf638('0x2f')](db[_0xf638('0x2a')][_0xf638('0x2b')]);_0x92ffd8[_0xf638('0x2e')]=_['keys'](_0x5daf4[_0xf638('0x2e')]);_0x92ffd8[_0xf638('0x30')]=_['intersection'](_0x92ffd8[_0xf638('0x2d')],_0x92ffd8['query']);_0x2d574d['attributes']=_[_0xf638('0x31')](_0x92ffd8[_0xf638('0x2d')],qs[_0xf638('0x32')](_0x5daf4['query']['fields']));_0x2d574d[_0xf638('0x33')]=_0x2d574d[_0xf638('0x33')]['length']?_0x2d574d[_0xf638('0x33')]:_0x92ffd8['model'];if(_0x5daf4[_0xf638('0x2e')]['includeAll']){_0x2d574d[_0xf638('0x41')]=[{'all':!![]}];}_0x2d574d=_['merge']({},_0x2d574d,_0x5daf4[_0xf638('0x3f')]);return db[_0xf638('0x2a')][_0xf638('0x47')](_0x2d574d)['then'](handleEntityNotFound(_0x4e220e,null))[_0xf638('0x26')](respondWithResult(_0x4e220e,null))['catch'](handleError(_0x4e220e,null));};exports[_0xf638('0x48')]=function(_0x325527,_0x168d45){return db[_0xf638('0x2a')][_0xf638('0x48')](_0x325527[_0xf638('0x49')],{})[_0xf638('0x26')](respondWithResult(_0x168d45,0xc9))[_0xf638('0x44')](handleError(_0x168d45,null));};exports[_0xf638('0x24')]=function(_0xb1db17,_0x4d84dc){if(_0xb1db17['body']['id']){delete _0xb1db17[_0xf638('0x49')]['id'];}return db[_0xf638('0x2a')][_0xf638('0x47')]({'where':{'id':_0xb1db17[_0xf638('0x46')]['id']}})[_0xf638('0x26')](handleEntityNotFound(_0x4d84dc,null))[_0xf638('0x26')](saveUpdates(_0xb1db17['body'],null))[_0xf638('0x26')](respondWithResult(_0x4d84dc,null))[_0xf638('0x44')](handleError(_0x4d84dc,null));};exports[_0xf638('0x25')]=function(_0x4a8d9b,_0x5a8af5){return db[_0xf638('0x2a')][_0xf638('0x47')]({'where':{'id':_0x4a8d9b[_0xf638('0x46')]['id']}})[_0xf638('0x26')](handleEntityNotFound(_0x5a8af5,null))[_0xf638('0x26')](removeEntity(_0x5a8af5,null))[_0xf638('0x44')](handleError(_0x5a8af5,null));};exports[_0xf638('0x4a')]=function(_0x3a2438,_0x340148){return db['SquareDetailsReport'][_0xf638('0x4a')]()[_0xf638('0x26')](respondWithResult(_0x340148,null))[_0xf638('0x44')](handleError(_0x340148,null));};
\ No newline at end of file
+var _0xb203=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','type','filter','merge','options','includeAll','include','SquareDetailsReport','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0xb203,0x1be));var _0x3b20=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb203[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0x3b20('0x0'));var rimraf=require(_0x3b20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3b20('0x2'));var rp=require(_0x3b20('0x3'));var moment=require(_0x3b20('0x4'));var BPromise=require(_0x3b20('0x5'));var Mustache=require(_0x3b20('0x6'));var util=require('util');var path=require(_0x3b20('0x7'));var sox=require('sox');var csv=require(_0x3b20('0x8'));var ejs=require(_0x3b20('0x9'));var fs=require('fs');var fs_extra=require(_0x3b20('0xa'));var _=require(_0x3b20('0xb'));var squel=require(_0x3b20('0xc'));var crypto=require(_0x3b20('0xd'));var jsforce=require(_0x3b20('0xe'));var deskjs=require(_0x3b20('0xf'));var toCsv=require(_0x3b20('0x8'));var querystring=require(_0x3b20('0x10'));var Papa=require(_0x3b20('0x11'));var Redis=require(_0x3b20('0x12'));var authService=require(_0x3b20('0x13'));var qs=require(_0x3b20('0x14'));var as=require(_0x3b20('0x15'));var hardwareService=require(_0x3b20('0x16'));var logger=require(_0x3b20('0x17'))(_0x3b20('0x18'));var utils=require(_0x3b20('0x19'));var config=require(_0x3b20('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b20('0x1b'))['db'];function respondWithStatusCode(_0x147f16,_0x1809bb){_0x1809bb=_0x1809bb||0xcc;return function(_0x5cf8af){if(_0x5cf8af){return _0x147f16[_0x3b20('0x1c')](_0x1809bb);}return _0x147f16[_0x3b20('0x1d')](_0x1809bb)[_0x3b20('0x1e')]();};}function respondWithResult(_0x4f76e0,_0x49c158){_0x49c158=_0x49c158||0xc8;return function(_0x219881){if(_0x219881){return _0x4f76e0[_0x3b20('0x1d')](_0x49c158)['json'](_0x219881);}};}function respondWithFilteredResult(_0x1617a3,_0x4014f1){return function(_0x1914e5){if(_0x1914e5){var _0x2f1f04=typeof _0x4014f1[_0x3b20('0x1f')]===_0x3b20('0x20')&&typeof _0x4014f1[_0x3b20('0x21')]==='undefined';var _0x59c34c=_0x1914e5[_0x3b20('0x22')];var _0x4881a7=_0x2f1f04?0x0:_0x4014f1['offset'];var _0x19de04=_0x2f1f04?_0x1914e5[_0x3b20('0x22')]:_0x4014f1[_0x3b20('0x1f')]+_0x4014f1['limit'];var _0x47c78f;if(_0x19de04>=_0x59c34c){_0x19de04=_0x59c34c;_0x47c78f=0xc8;}else{_0x47c78f=0xce;}_0x1617a3[_0x3b20('0x1d')](_0x47c78f);return _0x1617a3[_0x3b20('0x23')](_0x3b20('0x24'),_0x4881a7+'-'+_0x19de04+'/'+_0x59c34c)[_0x3b20('0x25')](_0x1914e5);}return null;};}function patchUpdates(_0x473bd3){return function(_0xb45ce3){try{jsonpatch[_0x3b20('0x26')](_0xb45ce3,_0x473bd3,!![]);}catch(_0x50f04e){return BPromise[_0x3b20('0x27')](_0x50f04e);}return _0xb45ce3[_0x3b20('0x28')]();};}function saveUpdates(_0x19c08d,_0xff830){return function(_0x2050d9){if(_0x2050d9){return _0x2050d9['update'](_0x19c08d)[_0x3b20('0x29')](function(_0x340625){return _0x340625;});}return null;};}function removeEntity(_0x3351fc,_0x4f2884){return function(_0x5c7671){if(_0x5c7671){return _0x5c7671[_0x3b20('0x2a')]()[_0x3b20('0x29')](function(){_0x3351fc[_0x3b20('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49ec3e,_0x26f027){return function(_0xed367d){if(!_0xed367d){_0x49ec3e[_0x3b20('0x1c')](0x194);}return _0xed367d;};}function handleError(_0x33f4ea,_0x2cff46){_0x2cff46=_0x2cff46||0x1f4;return function(_0x5cc5fe){logger[_0x3b20('0x2b')](_0x5cc5fe[_0x3b20('0x2c')]);if(_0x5cc5fe['name']){delete _0x5cc5fe[_0x3b20('0x2d')];}_0x33f4ea[_0x3b20('0x1d')](_0x2cff46)['send'](_0x5cc5fe);};}exports[_0x3b20('0x2e')]=function(_0x5ddbb4,_0x26b44a){var _0x505690={},_0x180349={},_0x42195d={'count':0x0,'rows':[]};var _0x531f60=_['map'](db['SquareDetailsReport'][_0x3b20('0x2f')],function(_0x3b683c){return{'name':_0x3b683c['fieldName'],'type':_0x3b683c['type']['key']};});_0x180349[_0x3b20('0x30')]=_[_0x3b20('0x31')](_0x531f60,_0x3b20('0x2d'));_0x180349[_0x3b20('0x32')]=_[_0x3b20('0x33')](_0x5ddbb4[_0x3b20('0x32')]);_0x180349[_0x3b20('0x34')]=_[_0x3b20('0x35')](_0x180349[_0x3b20('0x30')],_0x180349[_0x3b20('0x32')]);_0x505690[_0x3b20('0x36')]=_[_0x3b20('0x35')](_0x180349[_0x3b20('0x30')],qs[_0x3b20('0x37')](_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x37')]));_0x505690[_0x3b20('0x36')]=_0x505690['attributes'][_0x3b20('0x38')]?_0x505690['attributes']:_0x180349['model'];if(!_0x5ddbb4[_0x3b20('0x32')]['hasOwnProperty'](_0x3b20('0x39'))){_0x505690[_0x3b20('0x21')]=qs[_0x3b20('0x21')](_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x21')]);_0x505690['offset']=qs['offset'](_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x1f')]);}_0x505690[_0x3b20('0x3a')]=qs['sort'](_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x3b')]);_0x505690[_0x3b20('0x3c')]=qs[_0x3b20('0x34')](_[_0x3b20('0x3d')](_0x5ddbb4['query'],_0x180349[_0x3b20('0x34')]),_0x531f60);if(_0x5ddbb4[_0x3b20('0x32')]['filter']){_0x505690[_0x3b20('0x3c')]=_['merge'](_0x505690[_0x3b20('0x3c')],{'$or':_[_0x3b20('0x31')](_0x531f60,function(_0x52b851){if(_0x52b851[_0x3b20('0x3e')]!=='VIRTUAL'){var _0x528a84={};_0x528a84[_0x52b851[_0x3b20('0x2d')]]={'$like':'%'+_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x3f')]+'%'};return _0x528a84;}})});}_0x505690=_[_0x3b20('0x40')]({},_0x505690,_0x5ddbb4[_0x3b20('0x41')]);var _0x342d5a={'where':_0x505690[_0x3b20('0x3c')]};return db['SquareDetailsReport'][_0x3b20('0x22')](_0x342d5a)[_0x3b20('0x29')](function(_0x8955cc){_0x42195d[_0x3b20('0x22')]=_0x8955cc;if(_0x5ddbb4[_0x3b20('0x32')][_0x3b20('0x42')]){_0x505690[_0x3b20('0x43')]=[{'all':!![]}];}return db[_0x3b20('0x44')][_0x3b20('0x45')](_0x505690);})[_0x3b20('0x29')](function(_0x2ca876){_0x42195d[_0x3b20('0x46')]=_0x2ca876;return _0x42195d;})[_0x3b20('0x29')](respondWithFilteredResult(_0x26b44a,_0x505690))[_0x3b20('0x47')](handleError(_0x26b44a,null));};exports[_0x3b20('0x48')]=function(_0x4bd63e,_0x215b8d){var _0x2606b3={'raw':!![],'where':{'id':_0x4bd63e[_0x3b20('0x49')]['id']}},_0x1639e0={};_0x1639e0[_0x3b20('0x30')]=_[_0x3b20('0x33')](db['SquareDetailsReport'][_0x3b20('0x2f')]);_0x1639e0[_0x3b20('0x32')]=_[_0x3b20('0x33')](_0x4bd63e['query']);_0x1639e0[_0x3b20('0x34')]=_['intersection'](_0x1639e0['model'],_0x1639e0[_0x3b20('0x32')]);_0x2606b3[_0x3b20('0x36')]=_[_0x3b20('0x35')](_0x1639e0[_0x3b20('0x30')],qs['fields'](_0x4bd63e[_0x3b20('0x32')][_0x3b20('0x37')]));_0x2606b3[_0x3b20('0x36')]=_0x2606b3[_0x3b20('0x36')]['length']?_0x2606b3[_0x3b20('0x36')]:_0x1639e0[_0x3b20('0x30')];if(_0x4bd63e[_0x3b20('0x32')]['includeAll']){_0x2606b3[_0x3b20('0x43')]=[{'all':!![]}];}_0x2606b3=_[_0x3b20('0x40')]({},_0x2606b3,_0x4bd63e[_0x3b20('0x41')]);return db[_0x3b20('0x44')][_0x3b20('0x4a')](_0x2606b3)[_0x3b20('0x29')](handleEntityNotFound(_0x215b8d,null))[_0x3b20('0x29')](respondWithResult(_0x215b8d,null))['catch'](handleError(_0x215b8d,null));};exports[_0x3b20('0x4b')]=function(_0x3c2493,_0x2af4ab){return db[_0x3b20('0x44')][_0x3b20('0x4b')](_0x3c2493[_0x3b20('0x4c')],{})[_0x3b20('0x29')](respondWithResult(_0x2af4ab,0xc9))['catch'](handleError(_0x2af4ab,null));};exports[_0x3b20('0x4d')]=function(_0x339920,_0x117fbf){if(_0x339920[_0x3b20('0x4c')]['id']){delete _0x339920[_0x3b20('0x4c')]['id'];}return db[_0x3b20('0x44')][_0x3b20('0x4a')]({'where':{'id':_0x339920[_0x3b20('0x49')]['id']}})[_0x3b20('0x29')](handleEntityNotFound(_0x117fbf,null))[_0x3b20('0x29')](saveUpdates(_0x339920[_0x3b20('0x4c')],null))[_0x3b20('0x29')](respondWithResult(_0x117fbf,null))['catch'](handleError(_0x117fbf,null));};exports[_0x3b20('0x2a')]=function(_0x19309d,_0x58a68e){return db[_0x3b20('0x44')][_0x3b20('0x4a')]({'where':{'id':_0x19309d['params']['id']}})[_0x3b20('0x29')](handleEntityNotFound(_0x58a68e,null))[_0x3b20('0x29')](removeEntity(_0x58a68e,null))[_0x3b20('0x47')](handleError(_0x58a68e,null));};exports[_0x3b20('0x4e')]=function(_0x3f6191,_0x347dc4){return db[_0x3b20('0x44')][_0x3b20('0x4e')]()['then'](respondWithResult(_0x347dc4,null))['catch'](handleError(_0x347dc4,null));};
\ No newline at end of file
index 6970dc1..7bc761f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc6c=['./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0xbc6c,0x91));var _0xcbc6=function(_0x3213b7,_0x6789ca){_0x3213b7=_0x3213b7-0x0;var _0xb960bf=_0xbc6c[_0x3213b7];return _0xb960bf;};'use strict';var _=require(_0xcbc6('0x0'));var util=require(_0xcbc6('0x1'));var logger=require(_0xcbc6('0x2'))(_0xcbc6('0x3'));var moment=require(_0xcbc6('0x4'));var BPromise=require(_0xcbc6('0x5'));var rp=require(_0xcbc6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcbc6('0x7'));var config=require(_0xcbc6('0x8'));var attributes=require(_0xcbc6('0x9'));module[_0xcbc6('0xa')]=function(_0x493fce,_0xe2c9b9){return _0x493fce[_0xcbc6('0xb')](_0xcbc6('0xc'),attributes,{'tableName':_0xcbc6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x049c=['exports','define','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x049c,0x129));var _0xc049=function(_0xb889f,_0x5c96c1){_0xb889f=_0xb889f-0x0;var _0x250eec=_0x049c[_0xb889f];return _0x250eec;};'use strict';var _=require(_0xc049('0x0'));var util=require(_0xc049('0x1'));var logger=require(_0xc049('0x2'))(_0xc049('0x3'));var moment=require(_0xc049('0x4'));var BPromise=require(_0xc049('0x5'));var rp=require(_0xc049('0x6'));var fs=require('fs');var path=require(_0xc049('0x7'));var rimraf=require(_0xc049('0x8'));var config=require(_0xc049('0x9'));var attributes=require(_0xc049('0xa'));module[_0xc049('0xb')]=function(_0x2efeef,_0x448b57){return _0x2efeef[_0xc049('0xc')]('SquareDetailsReport',attributes,{'tableName':_0xc049('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ce33d14..3e653b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x937d=['CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareDetailsReport,\x20%s,\x20%s','result','catch'];(function(_0x4687df,_0x12099c){var _0x32eaef=function(_0x2387db){while(--_0x2387db){_0x4687df['push'](_0x4687df['shift']());}};_0x32eaef(++_0x12099c);}(_0x937d,0x1f4));var _0xd937=function(_0x22478d,_0x315e8a){_0x22478d=_0x22478d-0x0;var _0x11c93d=_0x937d[_0x22478d];return _0x11c93d;};'use strict';var _=require(_0xd937('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd937('0x1'));var fs=require('fs');var Redis=require(_0xd937('0x2'));var db=require(_0xd937('0x3'))['db'];var utils=require(_0xd937('0x4'));var logger=require(_0xd937('0x5'))(_0xd937('0x6'));var config=require('../../config/environment');var jayson=require(_0xd937('0x7'));var client=jayson[_0xd937('0x8')][_0xd937('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f6cd9,_0x2454f9,_0x4dc790){return new BPromise(function(_0x490b1d,_0x372dff){return client[_0xd937('0xa')](_0x4f6cd9,_0x4dc790)[_0xd937('0xb')](function(_0xa97338){logger[_0xd937('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0xd937('0xd'));logger['debug'](_0xd937('0xe'),_0x2454f9,'request\x20sent',JSON[_0xd937('0xf')](_0xa97338));if(_0xa97338[_0xd937('0x10')]){if(_0xa97338[_0xd937('0x10')][_0xd937('0x11')]===0x1f4){logger[_0xd937('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);return _0x372dff(_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);}logger[_0xd937('0x10')](_0xd937('0x13'),_0x2454f9,_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);return _0x490b1d(_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);}else{logger['info'](_0xd937('0x13'),_0x2454f9,_0xd937('0xd'));_0x490b1d(_0xa97338[_0xd937('0x14')]['message']);}})[_0xd937('0x15')](function(_0x16d2ba){logger[_0xd937('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0x16d2ba);_0x372dff(_0x16d2ba);});});}exports[_0xd937('0x16')]=function(_0x3d6b1c){var _0x1d1b8b=this;return new Promise(function(_0x1bd7ee,_0x26d5ca){return db[_0xd937('0x17')][_0xd937('0x18')](_0x3d6b1c[_0xd937('0x19')],{'raw':_0x3d6b1c[_0xd937('0x1a')]?_0x3d6b1c[_0xd937('0x1a')][_0xd937('0x1b')]===undefined?!![]:![]:!![]})[_0xd937('0xb')](function(_0x2c18ea){logger[_0xd937('0xc')](_0xd937('0x16'),_0x3d6b1c);logger[_0xd937('0x1c')](_0xd937('0x16'),_0x3d6b1c,JSON['stringify'](_0x2c18ea));_0x1bd7ee(_0x2c18ea);})[_0xd937('0x15')](function(_0x168f3e){logger[_0xd937('0x10')](_0xd937('0x16'),_0x168f3e[_0xd937('0x12')],_0x3d6b1c);_0x26d5ca(_0x1d1b8b[_0xd937('0x10')](0x1f4,_0x168f3e[_0xd937('0x12')]));});});};
\ No newline at end of file
+var _0x0b7f=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code','SquareDetailsReport,\x20%s,\x20%s','message','request\x20sent','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','stringify','catch','lodash','util','bluebird'];(function(_0x6cad76,_0x2f256b){var _0x47efe2=function(_0x52ecfe){while(--_0x52ecfe){_0x6cad76['push'](_0x6cad76['shift']());}};_0x47efe2(++_0x2f256b);}(_0x0b7f,0x115));var _0xf0b7=function(_0x127565,_0x4cf4c7){_0x127565=_0x127565-0x0;var _0x35090e=_0x0b7f[_0x127565];return _0x35090e;};'use strict';var _=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var moment=require('moment');var BPromise=require(_0xf0b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0b7('0x3'));var db=require(_0xf0b7('0x4'))['db'];var utils=require(_0xf0b7('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0b7('0x6'));var jayson=require(_0xf0b7('0x7'));var client=jayson[_0xf0b7('0x8')][_0xf0b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b2de8,_0x5e449a,_0x1408ee){return new BPromise(function(_0x276f09,_0x275a13){return client[_0xf0b7('0xa')](_0x2b2de8,_0x1408ee)[_0xf0b7('0xb')](function(_0x588b46){logger[_0xf0b7('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x5e449a,'request\x20sent');logger['debug'](_0xf0b7('0xd'),_0x5e449a,'request\x20sent',JSON['stringify'](_0x588b46));if(_0x588b46[_0xf0b7('0xe')]){if(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0xf')]===0x1f4){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x275a13(_0x588b46[_0xf0b7('0xe')]['message']);}logger['error'](_0xf0b7('0x10'),_0x5e449a,_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);return _0x276f09(_0x588b46[_0xf0b7('0xe')][_0xf0b7('0x11')]);}else{logger['info'](_0xf0b7('0x10'),_0x5e449a,_0xf0b7('0x12'));_0x276f09(_0x588b46[_0xf0b7('0x13')][_0xf0b7('0x11')]);}})['catch'](function(_0x303db6){logger[_0xf0b7('0xe')](_0xf0b7('0x10'),_0x5e449a,_0x303db6);_0x275a13(_0x303db6);});});}exports[_0xf0b7('0x14')]=function(_0x52b27e){var _0x1e5fc9=this;return new Promise(function(_0x153d23,_0x28fd36){return db[_0xf0b7('0x15')][_0xf0b7('0x16')](_0x52b27e['body'],{'raw':_0x52b27e[_0xf0b7('0x17')]?_0x52b27e['options'][_0xf0b7('0x18')]===undefined?!![]:![]:!![]})[_0xf0b7('0xb')](function(_0x374496){logger['info']('CreateSquareDetailsReport',_0x52b27e);logger[_0xf0b7('0x19')](_0xf0b7('0x14'),_0x52b27e,JSON[_0xf0b7('0x1a')](_0x374496));_0x153d23(_0x374496);})[_0xf0b7('0x1b')](function(_0xb90b3c){logger[_0xf0b7('0xe')](_0xf0b7('0x14'),_0xb90b3c[_0xf0b7('0x11')],_0x52b27e);_0x28fd36(_0x1e5fc9[_0xf0b7('0xe')](0x1f4,_0xb90b3c['message']));});});};
\ No newline at end of file
index d10c2a3..870571d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe267=['/process/:pid/kill','exports','Router','../../components/auth/service','./system.controller','get','isAuthenticated'];(function(_0x34e736,_0x98f699){var _0x199496=function(_0x121bd7){while(--_0x121bd7){_0x34e736['push'](_0x34e736['shift']());}};_0x199496(++_0x98f699);}(_0xe267,0x14b));var _0x7e26=function(_0x34ed48,_0x2cc995){_0x34ed48=_0x34ed48-0x0;var _0x37da5c=_0xe267[_0x34ed48];return _0x37da5c;};'use strict';var express=require('express');var router=express[_0x7e26('0x0')]();var auth=require(_0x7e26('0x1'));var controller=require(_0x7e26('0x2'));router[_0x7e26('0x3')]('/',auth[_0x7e26('0x4')](),controller['index']);router[_0x7e26('0x3')](_0x7e26('0x5'),auth[_0x7e26('0x4')](),controller['killProcess']);module[_0x7e26('0x6')]=router;
\ No newline at end of file
+var _0x9ad9=['Router','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x9ad9,0x133));var _0x99ad=function(_0x1f54d7,_0xafc682){_0x1f54d7=_0x1f54d7-0x0;var _0x355fc0=_0x9ad9[_0x1f54d7];return _0x355fc0;};'use strict';var express=require(_0x99ad('0x0'));var router=express[_0x99ad('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x99ad('0x2')]('/',auth[_0x99ad('0x3')](),controller['index']);router['get'](_0x99ad('0x4'),auth[_0x99ad('0x3')](),controller[_0x99ad('0x5')]);module[_0x99ad('0x6')]=router;
\ No newline at end of file
index 01ab74b..8996a60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x86f4=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','index','then','catch','status','json','killProcess','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','systeminformation','exec','api','util','bluebird','lodash'];(function(_0x48fa38,_0x290047){var _0x3eb1f6=function(_0x1bd134){while(--_0x1bd134){_0x48fa38['push'](_0x48fa38['shift']());}};_0x3eb1f6(++_0x290047);}(_0x86f4,0xd2));var _0x486f=function(_0x4482b6,_0x12a572){_0x4482b6=_0x4482b6-0x0;var _0x54e103=_0x86f4[_0x4482b6];return _0x54e103;};'use strict';var info=require(_0x486f('0x0'));var exec=require('child_process')[_0x486f('0x1')];var logger=require('../../config/logger')(_0x486f('0x2'));var util=require(_0x486f('0x3'));var BPromise=require(_0x486f('0x4'));var _=require(_0x486f('0x5'));function handleError(_0x14575e,_0xf61e1b,_0x10e436){_0xf61e1b=_0xf61e1b||0x1f4;return function(_0x530754){logger[_0x486f('0x6')](_0x486f('0x7'),_0x10e436,_0xf61e1b,util[_0x486f('0x8')](_0x530754,{'showHidden':![],'depth':null}));delete _0x530754['name'];_0x14575e['status'](_0xf61e1b)['send'](_0x530754);};}exports[_0x486f('0x9')]=function(_0x2c5b23,_0x1e15e6){return info['getAllData']()[_0x486f('0xa')](function(_0x1f30cd){return _0x1e15e6['status'](0xc8)['json'](_0x1f30cd);})[_0x486f('0xb')](function(_0x4853f9){return _0x1e15e6[_0x486f('0xc')](0x1f4)[_0x486f('0xd')](_0x4853f9);});};exports[_0x486f('0xe')]=function(_0x41d078,_0x1e6ee1){var _0x5a2d41=['components/import/cm'];return new BPromise(function(_0x5a8266,_0xd027b8){return exec(util['format'](_0x486f('0xf'),_0x41d078[_0x486f('0x10')][_0x486f('0x11')]),function(_0x479b33,_0x1b9a1d,_0x5dad6b){if(_0x479b33){return _0xd027b8(_0x479b33);}return _0x5a8266(_0x1b9a1d);});})[_0x486f('0xa')](function(_0x34ae25){var _0x4e723b=![];var _0x53a4b6=_0x34ae25[_0x486f('0x12')](/\n/);for(var _0x6fb51b=0x0,_0x14b5eb=_0x5a2d41['length'];_0x6fb51b<_0x14b5eb,_0x4e723b===![];_0x6fb51b+=0x1){if(_0x34ae25[_0x486f('0x13')](_0x5a2d41[_0x6fb51b])>=0x0){_0x4e723b=!![];}}if(!_0x4e723b){throw new Error(util[_0x486f('0x14')](_0x486f('0x15'),_0x41d078[_0x486f('0x10')][_0x486f('0x11')]));}process[_0x486f('0x16')](_0x41d078[_0x486f('0x10')][_0x486f('0x11')],_0x486f('0x17'));return _0x1e6ee1['status'](0xc8)['json']({'message':util[_0x486f('0x14')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x41d078[_0x486f('0x10')]['pid'])});})[_0x486f('0xb')](handleError(_0x1e6ee1,null,'killProcess'));};
\ No newline at end of file
+var _0xd464=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','catch','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','format','kill','SIGINT','systeminformation','exec','../../config/logger','bluebird','lodash'];(function(_0x780a96,_0x577915){var _0x3e2028=function(_0xb1e075){while(--_0xb1e075){_0x780a96['push'](_0x780a96['shift']());}};_0x3e2028(++_0x577915);}(_0xd464,0x133));var _0x4d46=function(_0x585999,_0x4a450f){_0x585999=_0x585999-0x0;var _0x5d72aa=_0xd464[_0x585999];return _0x5d72aa;};'use strict';var info=require(_0x4d46('0x0'));var exec=require('child_process')[_0x4d46('0x1')];var logger=require(_0x4d46('0x2'))('api');var util=require('util');var BPromise=require(_0x4d46('0x3'));var _=require(_0x4d46('0x4'));function handleError(_0x3e8681,_0x918a87,_0x5db751){_0x918a87=_0x918a87||0x1f4;return function(_0x3c252f){logger[_0x4d46('0x5')](_0x4d46('0x6'),_0x5db751,_0x918a87,util[_0x4d46('0x7')](_0x3c252f,{'showHidden':![],'depth':null}));delete _0x3c252f['name'];_0x3e8681[_0x4d46('0x8')](_0x918a87)[_0x4d46('0x9')](_0x3c252f);};}exports[_0x4d46('0xa')]=function(_0x21bcae,_0x248b1d){return info[_0x4d46('0xb')]()[_0x4d46('0xc')](function(_0x29d40e){return _0x248b1d[_0x4d46('0x8')](0xc8)['json'](_0x29d40e);})[_0x4d46('0xd')](function(_0x366708){return _0x248b1d[_0x4d46('0x8')](0x1f4)[_0x4d46('0xe')](_0x366708);});};exports[_0x4d46('0xf')]=function(_0x1622e9,_0x276c3c){var _0x3725b7=[_0x4d46('0x10')];return new BPromise(function(_0x5baa26,_0x2fea9b){return exec(util['format'](_0x4d46('0x11'),_0x1622e9[_0x4d46('0x12')][_0x4d46('0x13')]),function(_0x308f9c,_0x49198c,_0x3cd324){if(_0x308f9c){return _0x2fea9b(_0x308f9c);}return _0x5baa26(_0x49198c);});})['then'](function(_0x2eb824){var _0x5299f9=![];var _0x3c6130=_0x2eb824[_0x4d46('0x14')](/\n/);for(var _0x11f85b=0x0,_0x4110ac=_0x3725b7[_0x4d46('0x15')];_0x11f85b<_0x4110ac,_0x5299f9===![];_0x11f85b+=0x1){if(_0x2eb824[_0x4d46('0x16')](_0x3725b7[_0x11f85b])>=0x0){_0x5299f9=!![];}}if(!_0x5299f9){throw new Error(util[_0x4d46('0x17')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1622e9[_0x4d46('0x12')][_0x4d46('0x13')]));}process[_0x4d46('0x18')](_0x1622e9[_0x4d46('0x12')][_0x4d46('0x13')],_0x4d46('0x19'));return _0x276c3c[_0x4d46('0x8')](0xc8)[_0x4d46('0xe')]({'message':util[_0x4d46('0x17')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x1622e9[_0x4d46('0x12')]['pid'])});})[_0x4d46('0xd')](handleError(_0x276c3c,null,_0x4d46('0xf')));};
\ No newline at end of file
index 3c0461b..5b4042f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x762e=['get','isAuthenticated','/:id','show','post','put','update','delete','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./tag.controller'];(function(_0x1b81f3,_0x3650a0){var _0x3f2734=function(_0x55229b){while(--_0x55229b){_0x1b81f3['push'](_0x1b81f3['shift']());}};_0x3f2734(++_0x3650a0);}(_0x762e,0xea));var _0xe762=function(_0x168888,_0x1f8123){_0x168888=_0x168888-0x0;var _0x442a72=_0x762e[_0x168888];return _0x442a72;};'use strict';var multer=require(_0xe762('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe762('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe762('0x2'));var auth=require(_0xe762('0x3'));var interaction=require(_0xe762('0x4'));var config=require('../../config/environment');var controller=require(_0xe762('0x5'));router[_0xe762('0x6')]('/',auth[_0xe762('0x7')](),controller['index']);router[_0xe762('0x6')](_0xe762('0x8'),auth[_0xe762('0x7')](),controller[_0xe762('0x9')]);router[_0xe762('0xa')]('/',auth[_0xe762('0x7')](),controller['create']);router[_0xe762('0xb')](_0xe762('0x8'),auth[_0xe762('0x7')](),controller[_0xe762('0xc')]);router[_0xe762('0xd')](_0xe762('0x8'),auth[_0xe762('0x7')](),controller['destroy']);module[_0xe762('0xe')]=router;
\ No newline at end of file
+var _0x183e=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x3e79a0,_0x44639d){var _0x5aad01=function(_0x1eb32a){while(--_0x1eb32a){_0x3e79a0['push'](_0x3e79a0['shift']());}};_0x5aad01(++_0x44639d);}(_0x183e,0x193));var _0xe183=function(_0x5a5b03,_0x1eb604){_0x5a5b03=_0x5a5b03-0x0;var _0x3030df=_0x183e[_0x5a5b03];return _0x3030df;};'use strict';var multer=require(_0xe183('0x0'));var util=require(_0xe183('0x1'));var path=require(_0xe183('0x2'));var timeout=require('connect-timeout');var express=require(_0xe183('0x3'));var router=express[_0xe183('0x4')]();var fs_extra=require(_0xe183('0x5'));var auth=require(_0xe183('0x6'));var interaction=require(_0xe183('0x7'));var config=require(_0xe183('0x8'));var controller=require('./tag.controller');router[_0xe183('0x9')]('/',auth[_0xe183('0xa')](),controller['index']);router[_0xe183('0x9')](_0xe183('0xb'),auth['isAuthenticated'](),controller[_0xe183('0xc')]);router[_0xe183('0xd')]('/',auth[_0xe183('0xa')](),controller[_0xe183('0xe')]);router[_0xe183('0xf')](_0xe183('0xb'),auth['isAuthenticated'](),controller[_0xe183('0x10')]);router[_0xe183('0x11')](_0xe183('0xb'),auth[_0xe183('0xa')](),controller[_0xe183('0x12')]);module[_0xe183('0x13')]=router;
\ No newline at end of file
index 7409c72..56ace02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13b6=['STRING','name','#0091EA','sequelize'];(function(_0xbb7efa,_0x41d88d){var _0x1fc27c=function(_0x40bc59){while(--_0x40bc59){_0xbb7efa['push'](_0xbb7efa['shift']());}};_0x1fc27c(++_0x41d88d);}(_0x13b6,0x97));var _0x613b=function(_0x37150e,_0x2635a7){_0x37150e=_0x37150e-0x0;var _0x585f8c=_0x13b6[_0x37150e];return _0x585f8c;};'use strict';var Sequelize=require(_0x613b('0x0'));module['exports']={'name':{'type':Sequelize[_0x613b('0x1')],'unique':_0x613b('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x613b('0x1')],'defaultValue':_0x613b('0x3')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x536f=['STRING','sequelize','#0091EA'];(function(_0x5c4c71,_0x3445f8){var _0x167d6b=function(_0x52069f){while(--_0x52069f){_0x5c4c71['push'](_0x5c4c71['shift']());}};_0x167d6b(++_0x3445f8);}(_0x536f,0x70));var _0xf536=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x536f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xf536('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0xf536('0x1')},'description':{'type':Sequelize[_0xf536('0x2')]}};
\ No newline at end of file
index 40f312a..003c0e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f62=['name','send','index','Tag','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','map','filter','merge','options','count','includeAll','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','userProfileId','autoAssociation','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','destroy','then','get','UserProfileResource','error','stack'];(function(_0x194244,_0x6184ae){var _0x15bdcd=function(_0x25b4af){while(--_0x25b4af){_0x194244['push'](_0x194244['shift']());}};_0x15bdcd(++_0x6184ae);}(_0x9f62,0x154));var _0x29f6=function(_0x2620c6,_0x5ee13c){_0x2620c6=_0x2620c6-0x0;var _0x50dcff=_0x9f62[_0x2620c6];return _0x50dcff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x29f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29f6('0x1'));var rp=require(_0x29f6('0x2'));var moment=require(_0x29f6('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29f6('0x4'));var path=require(_0x29f6('0x5'));var sox=require(_0x29f6('0x6'));var csv=require(_0x29f6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x29f6('0x8'));var _=require(_0x29f6('0x9'));var squel=require(_0x29f6('0xa'));var crypto=require(_0x29f6('0xb'));var jsforce=require(_0x29f6('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29f6('0xd'));var authService=require(_0x29f6('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x29f6('0xf'));var logger=require(_0x29f6('0x10'))('api');var utils=require(_0x29f6('0x11'));var config=require(_0x29f6('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x559585,_0x57b2d2){_0x57b2d2=_0x57b2d2||0xcc;return function(_0x2ae0e4){if(_0x2ae0e4){return _0x559585[_0x29f6('0x13')](_0x57b2d2);}return _0x559585[_0x29f6('0x14')](_0x57b2d2)[_0x29f6('0x15')]();};}function respondWithResult(_0x17de6e,_0x156c96){_0x156c96=_0x156c96||0xc8;return function(_0x35d2e2){if(_0x35d2e2){return _0x17de6e[_0x29f6('0x14')](_0x156c96)[_0x29f6('0x16')](_0x35d2e2);}};}function respondWithFilteredResult(_0x19331f,_0x28d314){return function(_0x370484){if(_0x370484){var _0x1dde97=typeof _0x28d314[_0x29f6('0x17')]===_0x29f6('0x18')&&typeof _0x28d314[_0x29f6('0x19')]===_0x29f6('0x18');var _0x5bfda7=_0x370484['count'];var _0x2e66d3=_0x1dde97?0x0:_0x28d314[_0x29f6('0x17')];var _0xb31436=_0x1dde97?_0x370484['count']:_0x28d314[_0x29f6('0x17')]+_0x28d314[_0x29f6('0x19')];var _0x49252f;if(_0xb31436>=_0x5bfda7){_0xb31436=_0x5bfda7;_0x49252f=0xc8;}else{_0x49252f=0xce;}_0x19331f[_0x29f6('0x14')](_0x49252f);return _0x19331f[_0x29f6('0x1a')](_0x29f6('0x1b'),_0x2e66d3+'-'+_0xb31436+'/'+_0x5bfda7)[_0x29f6('0x16')](_0x370484);}return null;};}function patchUpdates(_0xb6e7a9){return function(_0x2bfb3d){try{jsonpatch['apply'](_0x2bfb3d,_0xb6e7a9,!![]);}catch(_0xfb8fd2){return BPromise['reject'](_0xfb8fd2);}return _0x2bfb3d['save']();};}function saveUpdates(_0x470019,_0x1fa159){return function(_0x39c6b3){if(_0x39c6b3){return _0x39c6b3[_0x29f6('0x1c')](_0x470019)['then'](function(_0x2c672e){return _0x2c672e;});}return null;};}function removeEntity(_0x49f67d,_0xd4179c){return function(_0xcce041){if(_0xcce041){return _0xcce041[_0x29f6('0x1d')]()[_0x29f6('0x1e')](function(){var _0x4fc725=_0xcce041[_0x29f6('0x1f')]({'plain':!![]});var _0x4d494f='Tags';return db[_0x29f6('0x20')][_0x29f6('0x1d')]({'where':{'type':_0x4d494f,'resourceId':_0x4fc725['id']}})[_0x29f6('0x1e')](function(){return _0xcce041;});})[_0x29f6('0x1e')](function(){_0x49f67d[_0x29f6('0x14')](0xcc)[_0x29f6('0x15')]();});}};}function handleEntityNotFound(_0x23c630,_0x50cdd2){return function(_0x2183b7){if(!_0x2183b7){_0x23c630[_0x29f6('0x13')](0x194);}return _0x2183b7;};}function handleError(_0x1ab8d8,_0x3dace7){_0x3dace7=_0x3dace7||0x1f4;return function(_0xda0a63){logger[_0x29f6('0x21')](_0xda0a63[_0x29f6('0x22')]);if(_0xda0a63[_0x29f6('0x23')]){delete _0xda0a63[_0x29f6('0x23')];}_0x1ab8d8[_0x29f6('0x14')](_0x3dace7)[_0x29f6('0x24')](_0xda0a63);};}exports[_0x29f6('0x25')]=function(_0x40c830,_0x304c28){var _0x375564={},_0x218931={},_0x3a7249={'count':0x0,'rows':[]};var _0x5492c2=_['map'](db[_0x29f6('0x26')]['rawAttributes'],function(_0x341071){return{'name':_0x341071[_0x29f6('0x27')],'type':_0x341071[_0x29f6('0x28')][_0x29f6('0x29')]};});_0x218931['model']=_['map'](_0x5492c2,_0x29f6('0x23'));_0x218931[_0x29f6('0x2a')]=_[_0x29f6('0x2b')](_0x40c830[_0x29f6('0x2a')]);_0x218931[_0x29f6('0x2c')]=_[_0x29f6('0x2d')](_0x218931[_0x29f6('0x2e')],_0x218931[_0x29f6('0x2a')]);_0x375564[_0x29f6('0x2f')]=_[_0x29f6('0x2d')](_0x218931[_0x29f6('0x2e')],qs[_0x29f6('0x30')](_0x40c830[_0x29f6('0x2a')][_0x29f6('0x30')]));_0x375564['attributes']=_0x375564['attributes'][_0x29f6('0x31')]?_0x375564[_0x29f6('0x2f')]:_0x218931[_0x29f6('0x2e')];if(!_0x40c830['query'][_0x29f6('0x32')](_0x29f6('0x33'))){_0x375564[_0x29f6('0x19')]=qs[_0x29f6('0x19')](_0x40c830[_0x29f6('0x2a')]['limit']);_0x375564[_0x29f6('0x17')]=qs[_0x29f6('0x17')](_0x40c830[_0x29f6('0x2a')][_0x29f6('0x17')]);}_0x375564['order']=qs[_0x29f6('0x34')](_0x40c830[_0x29f6('0x2a')][_0x29f6('0x34')]);_0x375564[_0x29f6('0x35')]=qs['filters'](_['pick'](_0x40c830[_0x29f6('0x2a')],_0x218931['filters']),_0x5492c2);if(_0x40c830[_0x29f6('0x2a')]['filter']){_0x375564[_0x29f6('0x35')]=_['merge'](_0x375564[_0x29f6('0x35')],{'$or':_[_0x29f6('0x36')](_0x5492c2,function(_0x5448c4){if(_0x5448c4[_0x29f6('0x28')]!=='VIRTUAL'){var _0x3f3475={};_0x3f3475[_0x5448c4[_0x29f6('0x23')]]={'$like':'%'+_0x40c830['query'][_0x29f6('0x37')]+'%'};return _0x3f3475;}})});}_0x375564=_[_0x29f6('0x38')]({},_0x375564,_0x40c830[_0x29f6('0x39')]);var _0x1e9d5a={'where':_0x375564['where']};return db[_0x29f6('0x26')][_0x29f6('0x3a')](_0x1e9d5a)[_0x29f6('0x1e')](function(_0x2322eb){_0x3a7249[_0x29f6('0x3a')]=_0x2322eb;if(_0x40c830['query'][_0x29f6('0x3b')]){_0x375564['include']=[{'all':!![]}];}return db[_0x29f6('0x26')]['findAll'](_0x375564);})[_0x29f6('0x1e')](function(_0x3a8a12){_0x3a7249['rows']=_0x3a8a12;return _0x3a7249;})[_0x29f6('0x1e')](respondWithFilteredResult(_0x304c28,_0x375564))[_0x29f6('0x3c')](handleError(_0x304c28,null));};exports[_0x29f6('0x3d')]=function(_0x27d655,_0x5402bb){var _0x415dd3={'raw':!![],'where':{'id':_0x27d655[_0x29f6('0x3e')]['id']}},_0x2a83b7={};_0x2a83b7['model']=_[_0x29f6('0x2b')](db['Tag'][_0x29f6('0x3f')]);_0x2a83b7['query']=_['keys'](_0x27d655['query']);_0x2a83b7[_0x29f6('0x2c')]=_[_0x29f6('0x2d')](_0x2a83b7[_0x29f6('0x2e')],_0x2a83b7[_0x29f6('0x2a')]);_0x415dd3[_0x29f6('0x2f')]=_[_0x29f6('0x2d')](_0x2a83b7[_0x29f6('0x2e')],qs[_0x29f6('0x30')](_0x27d655[_0x29f6('0x2a')][_0x29f6('0x30')]));_0x415dd3['attributes']=_0x415dd3['attributes'][_0x29f6('0x31')]?_0x415dd3[_0x29f6('0x2f')]:_0x2a83b7[_0x29f6('0x2e')];if(_0x27d655[_0x29f6('0x2a')]['includeAll']){_0x415dd3[_0x29f6('0x40')]=[{'all':!![]}];}_0x415dd3=_[_0x29f6('0x38')]({},_0x415dd3,_0x27d655['options']);return db[_0x29f6('0x26')][_0x29f6('0x41')](_0x415dd3)[_0x29f6('0x1e')](handleEntityNotFound(_0x5402bb,null))[_0x29f6('0x1e')](respondWithResult(_0x5402bb,null))[_0x29f6('0x3c')](handleError(_0x5402bb,null));};exports[_0x29f6('0x42')]=function(_0x320b5e,_0x1f03b6){return db[_0x29f6('0x26')][_0x29f6('0x42')](_0x320b5e[_0x29f6('0x43')],{})[_0x29f6('0x1e')](function(_0x58ea69){var _0x416c24=_0x320b5e[_0x29f6('0x44')][_0x29f6('0x1f')]({'plain':!![]});if(!_0x416c24)throw new Error(_0x29f6('0x45'));if(_0x416c24[_0x29f6('0x46')]==='user'){var _0x2e29e3=_0x58ea69['get']({'plain':!![]});var _0x546c91=_0x29f6('0x47');return db[_0x29f6('0x48')][_0x29f6('0x41')]({'where':{'name':_0x546c91,'userProfileId':_0x416c24[_0x29f6('0x49')]},'raw':!![]})[_0x29f6('0x1e')](function(_0x509caf){if(_0x509caf&&_0x509caf[_0x29f6('0x4a')]===0x0){return db[_0x29f6('0x20')]['create']({'name':_0x2e29e3[_0x29f6('0x23')],'resourceId':_0x2e29e3['id'],'type':_0x509caf['name'],'sectionId':_0x509caf['id']},{})[_0x29f6('0x1e')](function(){return _0x58ea69;});}else{return _0x58ea69;}})[_0x29f6('0x3c')](function(_0x27601d){logger[_0x29f6('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x27601d);throw _0x27601d;});}return _0x58ea69;})[_0x29f6('0x1e')](respondWithResult(_0x1f03b6,0xc9))[_0x29f6('0x3c')](handleError(_0x1f03b6,null));};exports[_0x29f6('0x1c')]=function(_0x217428,_0x3aa7eb){if(_0x217428[_0x29f6('0x43')]['id']){delete _0x217428[_0x29f6('0x43')]['id'];}return db['Tag'][_0x29f6('0x41')]({'where':{'id':_0x217428[_0x29f6('0x3e')]['id']}})[_0x29f6('0x1e')](handleEntityNotFound(_0x3aa7eb,null))[_0x29f6('0x1e')](saveUpdates(_0x217428[_0x29f6('0x43')],null))[_0x29f6('0x1e')](respondWithResult(_0x3aa7eb,null))[_0x29f6('0x3c')](handleError(_0x3aa7eb,null));};exports[_0x29f6('0x1d')]=function(_0x39d531,_0x3dbd19){return db['Tag']['find']({'where':{'id':_0x39d531[_0x29f6('0x3e')]['id']}})[_0x29f6('0x1e')](handleEntityNotFound(_0x3dbd19,null))[_0x29f6('0x1e')](removeEntity(_0x3dbd19,null))['catch'](handleError(_0x3dbd19,null));};
\ No newline at end of file
+var _0x32ef=['lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','Tags','UserProfileResource','sendStatus','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x56e3f2,_0x4c3db1){var _0x1a0106=function(_0x1e3960){while(--_0x1e3960){_0x56e3f2['push'](_0x56e3f2['shift']());}};_0x1a0106(++_0x4c3db1);}(_0x32ef,0xf9));var _0xf32e=function(_0x55a6b2,_0x47471e){_0x55a6b2=_0x55a6b2-0x0;var _0x4ae306=_0x32ef[_0x55a6b2];return _0x4ae306;};'use strict';var emlformat=require(_0xf32e('0x0'));var rimraf=require(_0xf32e('0x1'));var zipdir=require(_0xf32e('0x2'));var jsonpatch=require(_0xf32e('0x3'));var rp=require(_0xf32e('0x4'));var moment=require(_0xf32e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf32e('0x6'));var util=require(_0xf32e('0x7'));var path=require('path');var sox=require(_0xf32e('0x8'));var csv=require(_0xf32e('0x9'));var ejs=require(_0xf32e('0xa'));var fs=require('fs');var fs_extra=require(_0xf32e('0xb'));var _=require(_0xf32e('0xc'));var squel=require(_0xf32e('0xd'));var crypto=require('crypto');var jsforce=require(_0xf32e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf32e('0x9'));var querystring=require(_0xf32e('0xf'));var Papa=require(_0xf32e('0x10'));var Redis=require(_0xf32e('0x11'));var authService=require(_0xf32e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf32e('0x13'));var hardwareService=require(_0xf32e('0x14'));var logger=require(_0xf32e('0x15'))(_0xf32e('0x16'));var utils=require(_0xf32e('0x17'));var config=require(_0xf32e('0x18'));var licenseUtil=require(_0xf32e('0x19'));var db=require(_0xf32e('0x1a'))['db'];function respondWithStatusCode(_0x319616,_0x1c1f52){_0x1c1f52=_0x1c1f52||0xcc;return function(_0xf7dc32){if(_0xf7dc32){return _0x319616['sendStatus'](_0x1c1f52);}return _0x319616[_0xf32e('0x1b')](_0x1c1f52)[_0xf32e('0x1c')]();};}function respondWithResult(_0x543072,_0x336e26){_0x336e26=_0x336e26||0xc8;return function(_0x35988d){if(_0x35988d){return _0x543072[_0xf32e('0x1b')](_0x336e26)['json'](_0x35988d);}};}function respondWithFilteredResult(_0xe324ad,_0x299efa){return function(_0x1dd008){if(_0x1dd008){var _0x400d25=typeof _0x299efa[_0xf32e('0x1d')]===_0xf32e('0x1e')&&typeof _0x299efa[_0xf32e('0x1f')]===_0xf32e('0x1e');var _0x21aa73=_0x1dd008['count'];var _0x3510ec=_0x400d25?0x0:_0x299efa[_0xf32e('0x1d')];var _0xb828b8=_0x400d25?_0x1dd008[_0xf32e('0x20')]:_0x299efa[_0xf32e('0x1d')]+_0x299efa[_0xf32e('0x1f')];var _0x2f909b;if(_0xb828b8>=_0x21aa73){_0xb828b8=_0x21aa73;_0x2f909b=0xc8;}else{_0x2f909b=0xce;}_0xe324ad[_0xf32e('0x1b')](_0x2f909b);return _0xe324ad[_0xf32e('0x21')](_0xf32e('0x22'),_0x3510ec+'-'+_0xb828b8+'/'+_0x21aa73)[_0xf32e('0x23')](_0x1dd008);}return null;};}function patchUpdates(_0x1b169e){return function(_0x3202e1){try{jsonpatch[_0xf32e('0x24')](_0x3202e1,_0x1b169e,!![]);}catch(_0x5f2e99){return BPromise['reject'](_0x5f2e99);}return _0x3202e1[_0xf32e('0x25')]();};}function saveUpdates(_0x57a8cb,_0x27b92c){return function(_0x2aaabf){if(_0x2aaabf){return _0x2aaabf[_0xf32e('0x26')](_0x57a8cb)[_0xf32e('0x27')](function(_0x35e34c){return _0x35e34c;});}return null;};}function removeEntity(_0x5409b4,_0x227405){return function(_0x4407f8){if(_0x4407f8){return _0x4407f8[_0xf32e('0x28')]()[_0xf32e('0x27')](function(){var _0x5e62eb=_0x4407f8[_0xf32e('0x29')]({'plain':!![]});var _0x1eb413=_0xf32e('0x2a');return db[_0xf32e('0x2b')][_0xf32e('0x28')]({'where':{'type':_0x1eb413,'resourceId':_0x5e62eb['id']}})[_0xf32e('0x27')](function(){return _0x4407f8;});})[_0xf32e('0x27')](function(){_0x5409b4[_0xf32e('0x1b')](0xcc)[_0xf32e('0x1c')]();});}};}function handleEntityNotFound(_0x29be62,_0x488489){return function(_0x3e6e6f){if(!_0x3e6e6f){_0x29be62[_0xf32e('0x2c')](0x194);}return _0x3e6e6f;};}function handleError(_0x3b906c,_0x4a873c){_0x4a873c=_0x4a873c||0x1f4;return function(_0x419d13){logger['error'](_0x419d13[_0xf32e('0x2d')]);if(_0x419d13['name']){delete _0x419d13[_0xf32e('0x2e')];}_0x3b906c[_0xf32e('0x1b')](_0x4a873c)[_0xf32e('0x2f')](_0x419d13);};}exports[_0xf32e('0x30')]=function(_0x32a74b,_0x4e64d4){var _0x2e2ea4={},_0x1d3c7a={},_0x175096={'count':0x0,'rows':[]};var _0x498c9c=_[_0xf32e('0x31')](db[_0xf32e('0x32')][_0xf32e('0x33')],function(_0x3b87d3){return{'name':_0x3b87d3[_0xf32e('0x34')],'type':_0x3b87d3[_0xf32e('0x35')][_0xf32e('0x36')]};});_0x1d3c7a[_0xf32e('0x37')]=_[_0xf32e('0x31')](_0x498c9c,_0xf32e('0x2e'));_0x1d3c7a[_0xf32e('0x38')]=_[_0xf32e('0x39')](_0x32a74b[_0xf32e('0x38')]);_0x1d3c7a['filters']=_[_0xf32e('0x3a')](_0x1d3c7a['model'],_0x1d3c7a[_0xf32e('0x38')]);_0x2e2ea4['attributes']=_['intersection'](_0x1d3c7a[_0xf32e('0x37')],qs[_0xf32e('0x3b')](_0x32a74b[_0xf32e('0x38')][_0xf32e('0x3b')]));_0x2e2ea4[_0xf32e('0x3c')]=_0x2e2ea4['attributes'][_0xf32e('0x3d')]?_0x2e2ea4[_0xf32e('0x3c')]:_0x1d3c7a[_0xf32e('0x37')];if(!_0x32a74b[_0xf32e('0x38')]['hasOwnProperty'](_0xf32e('0x3e'))){_0x2e2ea4[_0xf32e('0x1f')]=qs[_0xf32e('0x1f')](_0x32a74b[_0xf32e('0x38')][_0xf32e('0x1f')]);_0x2e2ea4['offset']=qs[_0xf32e('0x1d')](_0x32a74b[_0xf32e('0x38')][_0xf32e('0x1d')]);}_0x2e2ea4['order']=qs[_0xf32e('0x3f')](_0x32a74b['query'][_0xf32e('0x3f')]);_0x2e2ea4[_0xf32e('0x40')]=qs[_0xf32e('0x41')](_['pick'](_0x32a74b[_0xf32e('0x38')],_0x1d3c7a[_0xf32e('0x41')]),_0x498c9c);if(_0x32a74b[_0xf32e('0x38')][_0xf32e('0x42')]){_0x2e2ea4[_0xf32e('0x40')]=_[_0xf32e('0x43')](_0x2e2ea4['where'],{'$or':_[_0xf32e('0x31')](_0x498c9c,function(_0x26ef18){if(_0x26ef18[_0xf32e('0x35')]!==_0xf32e('0x44')){var _0x28fb71={};_0x28fb71[_0x26ef18[_0xf32e('0x2e')]]={'$like':'%'+_0x32a74b[_0xf32e('0x38')]['filter']+'%'};return _0x28fb71;}})});}_0x2e2ea4=_[_0xf32e('0x43')]({},_0x2e2ea4,_0x32a74b[_0xf32e('0x45')]);var _0x41fbb1={'where':_0x2e2ea4[_0xf32e('0x40')]};return db[_0xf32e('0x32')][_0xf32e('0x20')](_0x41fbb1)[_0xf32e('0x27')](function(_0x546b80){_0x175096[_0xf32e('0x20')]=_0x546b80;if(_0x32a74b[_0xf32e('0x38')][_0xf32e('0x46')]){_0x2e2ea4[_0xf32e('0x47')]=[{'all':!![]}];}return db[_0xf32e('0x32')][_0xf32e('0x48')](_0x2e2ea4);})[_0xf32e('0x27')](function(_0x3ce422){_0x175096[_0xf32e('0x49')]=_0x3ce422;return _0x175096;})[_0xf32e('0x27')](respondWithFilteredResult(_0x4e64d4,_0x2e2ea4))['catch'](handleError(_0x4e64d4,null));};exports[_0xf32e('0x4a')]=function(_0x1f07a6,_0xbd0442){var _0x2146e8={'raw':!![],'where':{'id':_0x1f07a6[_0xf32e('0x4b')]['id']}},_0x159dfd={};_0x159dfd['model']=_[_0xf32e('0x39')](db[_0xf32e('0x32')][_0xf32e('0x33')]);_0x159dfd[_0xf32e('0x38')]=_[_0xf32e('0x39')](_0x1f07a6['query']);_0x159dfd[_0xf32e('0x41')]=_['intersection'](_0x159dfd[_0xf32e('0x37')],_0x159dfd[_0xf32e('0x38')]);_0x2146e8['attributes']=_[_0xf32e('0x3a')](_0x159dfd['model'],qs['fields'](_0x1f07a6['query'][_0xf32e('0x3b')]));_0x2146e8[_0xf32e('0x3c')]=_0x2146e8[_0xf32e('0x3c')][_0xf32e('0x3d')]?_0x2146e8[_0xf32e('0x3c')]:_0x159dfd[_0xf32e('0x37')];if(_0x1f07a6[_0xf32e('0x38')][_0xf32e('0x46')]){_0x2146e8[_0xf32e('0x47')]=[{'all':!![]}];}_0x2146e8=_[_0xf32e('0x43')]({},_0x2146e8,_0x1f07a6[_0xf32e('0x45')]);return db[_0xf32e('0x32')][_0xf32e('0x4c')](_0x2146e8)[_0xf32e('0x27')](handleEntityNotFound(_0xbd0442,null))['then'](respondWithResult(_0xbd0442,null))[_0xf32e('0x4d')](handleError(_0xbd0442,null));};exports[_0xf32e('0x4e')]=function(_0xc83c9f,_0x4b15be){return db['Tag']['create'](_0xc83c9f[_0xf32e('0x4f')],{})[_0xf32e('0x27')](function(_0x5194e8){var _0x436b8a=_0xc83c9f[_0xf32e('0x50')]['get']({'plain':!![]});if(!_0x436b8a)throw new Error(_0xf32e('0x51'));if(_0x436b8a[_0xf32e('0x52')]===_0xf32e('0x50')){var _0x36015b=_0x5194e8[_0xf32e('0x29')]({'plain':!![]});var _0x12f8e2='Tags';return db[_0xf32e('0x53')][_0xf32e('0x4c')]({'where':{'name':_0x12f8e2,'userProfileId':_0x436b8a[_0xf32e('0x54')]},'raw':!![]})['then'](function(_0x15017b){if(_0x15017b&&_0x15017b[_0xf32e('0x55')]===0x0){return db[_0xf32e('0x2b')]['create']({'name':_0x36015b['name'],'resourceId':_0x36015b['id'],'type':_0x15017b['name'],'sectionId':_0x15017b['id']},{})[_0xf32e('0x27')](function(){return _0x5194e8;});}else{return _0x5194e8;}})[_0xf32e('0x4d')](function(_0x36b32a){logger[_0xf32e('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36b32a);throw _0x36b32a;});}return _0x5194e8;})[_0xf32e('0x27')](respondWithResult(_0x4b15be,0xc9))[_0xf32e('0x4d')](handleError(_0x4b15be,null));};exports[_0xf32e('0x26')]=function(_0x787572,_0x10f4d3){if(_0x787572['body']['id']){delete _0x787572[_0xf32e('0x4f')]['id'];}return db[_0xf32e('0x32')][_0xf32e('0x4c')]({'where':{'id':_0x787572[_0xf32e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x10f4d3,null))[_0xf32e('0x27')](saveUpdates(_0x787572['body'],null))['then'](respondWithResult(_0x10f4d3,null))[_0xf32e('0x4d')](handleError(_0x10f4d3,null));};exports[_0xf32e('0x28')]=function(_0x1a485b,_0x391cbc){return db[_0xf32e('0x32')][_0xf32e('0x4c')]({'where':{'id':_0x1a485b[_0xf32e('0x4b')]['id']}})[_0xf32e('0x27')](handleEntityNotFound(_0x391cbc,null))[_0xf32e('0x27')](removeEntity(_0x391cbc,null))[_0xf32e('0x4d')](handleError(_0x391cbc,null));};
\ No newline at end of file
index ff75d2f..5b68fb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77ec=['bluebird','request-promise','path','rimraf','../../config/environment','Tag','tools_tags','lodash','util','../../config/logger','api','moment'];(function(_0x5f37fe,_0x27c283){var _0x1c4ca7=function(_0x46f75b){while(--_0x46f75b){_0x5f37fe['push'](_0x5f37fe['shift']());}};_0x1c4ca7(++_0x27c283);}(_0x77ec,0x1cf));var _0xc77e=function(_0x28ed14,_0x551bb9){_0x28ed14=_0x28ed14-0x0;var _0xf0869=_0x77ec[_0x28ed14];return _0xf0869;};'use strict';var _=require(_0xc77e('0x0'));var util=require(_0xc77e('0x1'));var logger=require(_0xc77e('0x2'))(_0xc77e('0x3'));var moment=require(_0xc77e('0x4'));var BPromise=require(_0xc77e('0x5'));var rp=require(_0xc77e('0x6'));var fs=require('fs');var path=require(_0xc77e('0x7'));var rimraf=require(_0xc77e('0x8'));var config=require(_0xc77e('0x9'));var attributes=require('./tag.attributes');module['exports']=function(_0x2e5108,_0x420d94){return _0x2e5108['define'](_0xc77e('0xa'),attributes,{'tableName':_0xc77e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d3a=['../../config/environment','exports','define','Tag','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4c18df,_0x23b8ba){var _0x16cd93=function(_0x10f86e){while(--_0x10f86e){_0x4c18df['push'](_0x4c18df['shift']());}};_0x16cd93(++_0x23b8ba);}(_0x4d3a,0x157));var _0xa4d3=function(_0x3daa8c,_0x388a87){_0x3daa8c=_0x3daa8c-0x0;var _0x2b1bd7=_0x4d3a[_0x3daa8c];return _0x2b1bd7;};'use strict';var _=require('lodash');var util=require(_0xa4d3('0x0'));var logger=require(_0xa4d3('0x1'))(_0xa4d3('0x2'));var moment=require(_0xa4d3('0x3'));var BPromise=require(_0xa4d3('0x4'));var rp=require(_0xa4d3('0x5'));var fs=require('fs');var path=require(_0xa4d3('0x6'));var rimraf=require(_0xa4d3('0x7'));var config=require(_0xa4d3('0x8'));var attributes=require('./tag.attributes');module[_0xa4d3('0x9')]=function(_0xafbcf,_0x3c5717){return _0xafbcf[_0xa4d3('0xa')](_0xa4d3('0xb'),attributes,{'tableName':_0xa4d3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 972b460..2cc8a81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd50=['Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbd50,0x196));var _0x0bd5=function(_0x3d14d1,_0x23aa69){_0x3d14d1=_0x3d14d1-0x0;var _0xc78d1f=_0xbd50[_0x3d14d1];return _0xc78d1f;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});}
\ No newline at end of file
+var _0x0bde=['request','then','info','Tag,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1e72b3,_0x1360ae){var _0x3a4824=function(_0x463d48){while(--_0x463d48){_0x1e72b3['push'](_0x1e72b3['shift']());}};_0x3a4824(++_0x1360ae);}(_0x0bde,0xe7));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xe0bd('0x0'));var moment=require('moment');var BPromise=require(_0xe0bd('0x1'));var rs=require(_0xe0bd('0x2'));var fs=require('fs');var Redis=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];var utils=require(_0xe0bd('0x5'));var logger=require('../../config/logger')(_0xe0bd('0x6'));var config=require(_0xe0bd('0x7'));var jayson=require(_0xe0bd('0x8'));var client=jayson[_0xe0bd('0x9')][_0xe0bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x26393f,_0x217145,_0x491dc7){return new BPromise(function(_0x40b36a,_0x44cb0b){return client[_0xe0bd('0xb')](_0x26393f,_0x491dc7)[_0xe0bd('0xc')](function(_0x393379){logger[_0xe0bd('0xd')](_0xe0bd('0xe'),_0x217145,_0xe0bd('0xf'));logger['debug']('Tag,\x20%s,\x20%s,\x20%s',_0x217145,'request\x20sent',JSON[_0xe0bd('0x10')](_0x393379));if(_0x393379['error']){if(_0x393379['error'][_0xe0bd('0x11')]===0x1f4){logger[_0xe0bd('0x12')]('Tag,\x20%s,\x20%s',_0x217145,_0x393379[_0xe0bd('0x12')]['message']);return _0x44cb0b(_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);}logger[_0xe0bd('0x12')](_0xe0bd('0xe'),_0x217145,_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);return _0x40b36a(_0x393379[_0xe0bd('0x12')][_0xe0bd('0x13')]);}else{logger['info']('Tag,\x20%s,\x20%s',_0x217145,'request\x20sent');_0x40b36a(_0x393379[_0xe0bd('0x14')][_0xe0bd('0x13')]);}})[_0xe0bd('0x15')](function(_0x379ea2){logger[_0xe0bd('0x12')]('Tag,\x20%s,\x20%s',_0x217145,_0x379ea2);_0x44cb0b(_0x379ea2);});});}
\ No newline at end of file
index c350f29..377052f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router;
\ No newline at end of file
index 62010fb..68898a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['name','exports','STRING'];(function(_0x50b564,_0x44159b){var _0x524ba1=function(_0x4800f1){while(--_0x4800f1){_0x50b564['push'](_0x50b564['shift']());}};_0x524ba1(++_0x44159b);}(_0x2032,0xd9));var _0x2203=function(_0x441cbe,_0x5c05f6){_0x441cbe=_0x441cbe-0x0;var _0x563844=_0x2032[_0x441cbe];return _0x563844;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x757a=['exports','STRING'];(function(_0x32b53c,_0x25c72c){var _0x4815b6=function(_0x3b62a3){while(--_0x3b62a3){_0x32b53c['push'](_0x32b53c['shift']());}};_0x4815b6(++_0x25c72c);}(_0x757a,0xde));var _0xa757=function(_0x2b9d8b,_0x555662){_0x2b9d8b=_0x2b9d8b-0x0;var _0x2ac05d=_0x757a[_0x2b9d8b];return _0x2ac05d;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d16e7ef..f10a70b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x596b=['fieldName','type','key','model','map','keys','filters','intersection','attributes','query','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','Team','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','length','order','Queues','addQueues','add','removeQueues','Sequelize','Unknown\x20channel','ids','addAgents','Voice','Chat','Sms','Fax','Openchannel','Whatsapp','transaction','QueueId','defaults','TeamVoiceQueue','penalty','User','emit','Queue:save','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','all','removeAgents','Mail','sequelize','parse','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./team.socket','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','rawAttributes'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x596b,0xde));var _0xb596=function(_0x152ffe,_0x7e95d){_0x152ffe=_0x152ffe-0x0;var _0x35324c=_0x596b[_0x152ffe];return _0x35324c;};'use strict';var emlformat=require(_0xb596('0x0'));var rimraf=require(_0xb596('0x1'));var zipdir=require(_0xb596('0x2'));var jsonpatch=require(_0xb596('0x3'));var rp=require(_0xb596('0x4'));var moment=require(_0xb596('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb596('0x6'));var util=require(_0xb596('0x7'));var path=require(_0xb596('0x8'));var sox=require(_0xb596('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb596('0xa'));var _=require(_0xb596('0xb'));var squel=require(_0xb596('0xc'));var crypto=require(_0xb596('0xd'));var jsforce=require(_0xb596('0xe'));var deskjs=require(_0xb596('0xf'));var toCsv=require('to-csv');var querystring=require(_0xb596('0x10'));var Papa=require(_0xb596('0x11'));var Redis=require('ioredis');var authService=require(_0xb596('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb596('0x13'));var hardwareService=require(_0xb596('0x14'));var logger=require('../../config/logger')(_0xb596('0x15'));var utils=require(_0xb596('0x16'));var config=require(_0xb596('0x17'));var licenseUtil=require(_0xb596('0x18'));var db=require(_0xb596('0x19'))['db'];config['redis']=_['defaults'](config[_0xb596('0x1a')],{'host':_0xb596('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb596('0x1a')]));require(_0xb596('0x1c'))['register'](socket);function respondWithStatusCode(_0x5a21aa,_0x27c7ab){_0x27c7ab=_0x27c7ab||0xcc;return function(_0x3b56a0){if(_0x3b56a0){return _0x5a21aa[_0xb596('0x1d')](_0x27c7ab);}return _0x5a21aa['status'](_0x27c7ab)[_0xb596('0x1e')]();};}function respondWithResult(_0x384093,_0x4bab41){_0x4bab41=_0x4bab41||0xc8;return function(_0x50c939){if(_0x50c939){return _0x384093[_0xb596('0x1f')](_0x4bab41)['json'](_0x50c939);}};}function respondWithFilteredResult(_0x9fdeb0,_0x450f15){return function(_0x2b2556){if(_0x2b2556){var _0x4976cb=typeof _0x450f15[_0xb596('0x20')]===_0xb596('0x21')&&typeof _0x450f15[_0xb596('0x22')]===_0xb596('0x21');var _0x40506e=_0x2b2556[_0xb596('0x23')];var _0x7cfd22=_0x4976cb?0x0:_0x450f15[_0xb596('0x20')];var _0x42e13d=_0x4976cb?_0x2b2556['count']:_0x450f15[_0xb596('0x20')]+_0x450f15['limit'];var _0x27d0ed;if(_0x42e13d>=_0x40506e){_0x42e13d=_0x40506e;_0x27d0ed=0xc8;}else{_0x27d0ed=0xce;}_0x9fdeb0['status'](_0x27d0ed);return _0x9fdeb0[_0xb596('0x24')](_0xb596('0x25'),_0x7cfd22+'-'+_0x42e13d+'/'+_0x40506e)[_0xb596('0x26')](_0x2b2556);}return null;};}function patchUpdates(_0x270d02){return function(_0x2cbf6c){try{jsonpatch[_0xb596('0x27')](_0x2cbf6c,_0x270d02,!![]);}catch(_0x5cf038){return BPromise[_0xb596('0x28')](_0x5cf038);}return _0x2cbf6c[_0xb596('0x29')]();};}function saveUpdates(_0x3c1e83,_0x1b9af6){return function(_0x39a772){if(_0x39a772){return _0x39a772[_0xb596('0x2a')](_0x3c1e83)['then'](function(_0x2ff914){return _0x2ff914;});}return null;};}function removeEntity(_0x2963a0,_0x1cf199){return function(_0x387df2){if(_0x387df2){return _0x387df2[_0xb596('0x2b')]()[_0xb596('0x2c')](function(){var _0x5f288c=_0x387df2['get']({'plain':!![]});var _0x97a051='Teams';return db[_0xb596('0x2d')][_0xb596('0x2b')]({'where':{'type':_0x97a051,'resourceId':_0x5f288c['id']}})[_0xb596('0x2c')](function(){return _0x387df2;});})[_0xb596('0x2c')](function(){_0x2963a0[_0xb596('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1852a2,_0x1e7047){return function(_0x248dbc){if(!_0x248dbc){_0x1852a2['sendStatus'](0x194);}return _0x248dbc;};}function handleError(_0x3c321d,_0x86b377){_0x86b377=_0x86b377||0x1f4;return function(_0x55fa1c){logger[_0xb596('0x2e')](_0x55fa1c[_0xb596('0x2f')]);if(_0x55fa1c[_0xb596('0x30')]){delete _0x55fa1c[_0xb596('0x30')];}_0x3c321d[_0xb596('0x1f')](_0x86b377)[_0xb596('0x31')](_0x55fa1c);};}exports[_0xb596('0x32')]=function(_0x1d9a23,_0x164d6f){var _0x498927={},_0xa7416d={},_0x295628={'count':0x0,'rows':[]};var _0x3e6cf6=_['map'](db['Team'][_0xb596('0x33')],function(_0x407eae){return{'name':_0x407eae[_0xb596('0x34')],'type':_0x407eae[_0xb596('0x35')][_0xb596('0x36')]};});_0xa7416d[_0xb596('0x37')]=_[_0xb596('0x38')](_0x3e6cf6,'name');_0xa7416d['query']=_[_0xb596('0x39')](_0x1d9a23['query']);_0xa7416d[_0xb596('0x3a')]=_[_0xb596('0x3b')](_0xa7416d['model'],_0xa7416d['query']);_0x498927[_0xb596('0x3c')]=_[_0xb596('0x3b')](_0xa7416d[_0xb596('0x37')],qs['fields'](_0x1d9a23[_0xb596('0x3d')]['fields']));_0x498927['attributes']=_0x498927[_0xb596('0x3c')]['length']?_0x498927['attributes']:_0xa7416d[_0xb596('0x37')];if(!_0x1d9a23[_0xb596('0x3d')][_0xb596('0x3e')](_0xb596('0x3f'))){_0x498927[_0xb596('0x22')]=qs[_0xb596('0x22')](_0x1d9a23[_0xb596('0x3d')][_0xb596('0x22')]);_0x498927[_0xb596('0x20')]=qs[_0xb596('0x20')](_0x1d9a23['query'][_0xb596('0x20')]);}_0x498927['order']=qs['sort'](_0x1d9a23[_0xb596('0x3d')][_0xb596('0x40')]);_0x498927['where']=qs[_0xb596('0x3a')](_[_0xb596('0x41')](_0x1d9a23[_0xb596('0x3d')],_0xa7416d[_0xb596('0x3a')]),_0x3e6cf6);if(_0x1d9a23['query'][_0xb596('0x42')]){_0x498927['where']=_[_0xb596('0x43')](_0x498927[_0xb596('0x44')],{'$or':_['map'](_0x3e6cf6,function(_0x541bc9){if(_0x541bc9[_0xb596('0x35')]!==_0xb596('0x45')){var _0x51cacf={};_0x51cacf[_0x541bc9[_0xb596('0x30')]]={'$like':'%'+_0x1d9a23[_0xb596('0x3d')][_0xb596('0x42')]+'%'};return _0x51cacf;}})});}_0x498927=_[_0xb596('0x43')]({},_0x498927,_0x1d9a23[_0xb596('0x46')]);var _0x38d653={'where':_0x498927[_0xb596('0x44')]};return db[_0xb596('0x47')]['count'](_0x38d653)[_0xb596('0x2c')](function(_0x5cadf3){_0x295628[_0xb596('0x23')]=_0x5cadf3;if(_0x1d9a23['query'][_0xb596('0x48')]){_0x498927[_0xb596('0x49')]=[{'all':!![]}];}return db[_0xb596('0x47')][_0xb596('0x4a')](_0x498927);})[_0xb596('0x2c')](function(_0x50f6cc){_0x295628[_0xb596('0x4b')]=_0x50f6cc;return _0x295628;})[_0xb596('0x2c')](respondWithFilteredResult(_0x164d6f,_0x498927))[_0xb596('0x4c')](handleError(_0x164d6f,null));};exports[_0xb596('0x4d')]=function(_0x1d9b42,_0x1e3946){var _0xcdd0={'raw':![],'where':{'id':_0x1d9b42[_0xb596('0x4e')]['id']}},_0x3cafd6={};_0x3cafd6[_0xb596('0x37')]=_['keys'](db['Team'][_0xb596('0x33')]);_0x3cafd6[_0xb596('0x3d')]=_['keys'](_0x1d9b42[_0xb596('0x3d')]);_0x3cafd6[_0xb596('0x3a')]=_['intersection'](_0x3cafd6[_0xb596('0x37')],_0x3cafd6[_0xb596('0x3d')]);_0xcdd0[_0xb596('0x3c')]=_[_0xb596('0x3b')](_0x3cafd6[_0xb596('0x37')],qs[_0xb596('0x4f')](_0x1d9b42['query'][_0xb596('0x4f')]));_0xcdd0['attributes']=_0xcdd0[_0xb596('0x3c')]['length']?_0xcdd0[_0xb596('0x3c')]:_0x3cafd6[_0xb596('0x37')];if(_0x1d9b42[_0xb596('0x3d')][_0xb596('0x48')]){_0xcdd0[_0xb596('0x49')]=[{'all':!![]}];}_0xcdd0=_[_0xb596('0x43')]({},_0xcdd0,_0x1d9b42[_0xb596('0x46')]);return db[_0xb596('0x47')][_0xb596('0x50')](_0xcdd0)[_0xb596('0x2c')](handleEntityNotFound(_0x1e3946,null))['then'](respondWithResult(_0x1e3946,null))[_0xb596('0x4c')](handleError(_0x1e3946,null));};exports[_0xb596('0x51')]=function(_0x244c97,_0x4c06b1){return db[_0xb596('0x47')]['create'](_0x244c97[_0xb596('0x52')],{})['then'](function(_0x5becb4){var _0x5b2cee=_0x244c97[_0xb596('0x53')]['get']({'plain':!![]});if(!_0x5b2cee)throw new Error(_0xb596('0x54'));if(_0x5b2cee[_0xb596('0x55')]===_0xb596('0x53')){var _0x2308b4=_0x5becb4[_0xb596('0x56')]({'plain':!![]});var _0xc5fbba=_0xb596('0x57');return db[_0xb596('0x58')][_0xb596('0x50')]({'where':{'name':_0xc5fbba,'userProfileId':_0x5b2cee[_0xb596('0x59')]},'raw':!![]})[_0xb596('0x2c')](function(_0x2a538f){if(_0x2a538f&&_0x2a538f[_0xb596('0x5a')]===0x0){return db[_0xb596('0x2d')][_0xb596('0x51')]({'name':_0x2308b4[_0xb596('0x30')],'resourceId':_0x2308b4['id'],'type':_0x2a538f[_0xb596('0x30')],'sectionId':_0x2a538f['id']},{})['then'](function(){return _0x5becb4;});}else{return _0x5becb4;}})[_0xb596('0x4c')](function(_0x372952){logger[_0xb596('0x2e')](_0xb596('0x5b'),_0x372952);throw _0x372952;});}return _0x5becb4;})['then'](respondWithResult(_0x4c06b1,0xc9))[_0xb596('0x4c')](handleError(_0x4c06b1,null));};exports[_0xb596('0x2a')]=function(_0x28d97f,_0x37e503){if(_0x28d97f[_0xb596('0x52')]['id']){delete _0x28d97f[_0xb596('0x52')]['id'];}return db[_0xb596('0x47')][_0xb596('0x50')]({'where':{'id':_0x28d97f['params']['id']}})[_0xb596('0x2c')](handleEntityNotFound(_0x37e503,null))[_0xb596('0x2c')](saveUpdates(_0x28d97f[_0xb596('0x52')],null))[_0xb596('0x2c')](respondWithResult(_0x37e503,null))['catch'](handleError(_0x37e503,null));};exports['destroy']=function(_0xc94013,_0x5aa7bf){return db[_0xb596('0x47')]['find']({'where':{'id':_0xc94013[_0xb596('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5aa7bf,null))[_0xb596('0x2c')](removeEntity(_0x5aa7bf,null))[_0xb596('0x4c')](handleError(_0x5aa7bf,null));};exports['getQueues']=function(_0x5403fe,_0x4e1413,_0x1f3a6e){return db[_0xb596('0x47')][_0xb596('0x5c')]({'where':{'id':_0x5403fe[_0xb596('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4e1413,null))[_0xb596('0x2c')](function(_0x2c1577){if(!_0x5403fe[_0xb596('0x3d')][_0xb596('0x5d')]||!utils[_0xb596('0x5e')](_0x5403fe['query'][_0xb596('0x5d')])){throw new db['Sequelize'][(_0xb596('0x5f'))]('Unknown\x20channel');}var _0x25b048={};var _0x235be2={};_0x235be2['model']=_['keys'](db[_[_0xb596('0x60')](_0x5403fe[_0xb596('0x3d')][_0xb596('0x5d')][_0xb596('0x61')]())+_0xb596('0x62')][_0xb596('0x33')]);_0x235be2[_0xb596('0x3d')]=_[_0xb596('0x39')](_0x5403fe[_0xb596('0x3d')]);_0x235be2[_0xb596('0x3a')]=_[_0xb596('0x3b')](_0x235be2['model'],_0x235be2[_0xb596('0x3d')]);_0x25b048[_0xb596('0x3c')]=_[_0xb596('0x3b')](_0x235be2[_0xb596('0x37')],qs[_0xb596('0x4f')](_0x5403fe['query'][_0xb596('0x4f')]));_0x25b048[_0xb596('0x3c')]=_0x25b048[_0xb596('0x3c')][_0xb596('0x63')]?_0x25b048[_0xb596('0x3c')]:_0x235be2[_0xb596('0x37')];_0x25b048['limit']=qs['limit'](_0x5403fe[_0xb596('0x3d')][_0xb596('0x22')]);_0x25b048[_0xb596('0x20')]=qs['offset'](_0x5403fe['query'][_0xb596('0x20')]);_0x25b048[_0xb596('0x64')]=qs[_0xb596('0x40')](_0x5403fe['query'][_0xb596('0x40')]);_0x25b048['where']=qs[_0xb596('0x3a')](_[_0xb596('0x41')](_0x5403fe[_0xb596('0x3d')],_0x235be2[_0xb596('0x3a')]));_0x25b048=_[_0xb596('0x43')]({},_0x25b048,_0x5403fe[_0xb596('0x46')]);return _0x2c1577[_0xb596('0x56')+_['capitalize'](_0x5403fe[_0xb596('0x3d')]['channel'][_0xb596('0x61')]())+_0xb596('0x65')](_0x25b048);})[_0xb596('0x2c')](respondWithResult(_0x4e1413,null))[_0xb596('0x4c')](handleError(_0x4e1413,null));};exports[_0xb596('0x66')]=function(_0x3e67ee,_0x14ac9e,_0x18b77a){return db[_0xb596('0x47')][_0xb596('0x5c')]({'where':{'id':_0x3e67ee[_0xb596('0x4e')]['id']}})[_0xb596('0x2c')](function(_0x4eb689){if(_0x4eb689){if(!_0x3e67ee[_0xb596('0x52')][_0xb596('0x5d')]||!utils['isValidChannel'](_0x3e67ee[_0xb596('0x52')]['channel'])){throw new db['Sequelize'][(_0xb596('0x5f'))]('Unknown\x20channel');}return _0x4eb689[_0xb596('0x67')+_[_0xb596('0x60')](_0x3e67ee[_0xb596('0x52')][_0xb596('0x5d')][_0xb596('0x61')]())+_0xb596('0x65')](_0x3e67ee[_0xb596('0x52')]['ids']);}return null;})['then'](handleEntityNotFound(_0x14ac9e,null))[_0xb596('0x2c')](respondWithStatusCode(_0x14ac9e,null))[_0xb596('0x4c')](handleError(_0x14ac9e,null));};exports[_0xb596('0x68')]=function(_0x5ccc45,_0xdac8dd,_0x2cf746){return db[_0xb596('0x47')][_0xb596('0x5c')]({'where':{'id':_0x5ccc45[_0xb596('0x4e')]['id']}})[_0xb596('0x2c')](function(_0x2086bb){if(_0x2086bb){if(!_0x5ccc45[_0xb596('0x3d')][_0xb596('0x5d')]||!utils[_0xb596('0x5e')](_0x5ccc45['query'][_0xb596('0x5d')])){throw new db[(_0xb596('0x69'))][(_0xb596('0x5f'))](_0xb596('0x6a'));}return _0x2086bb['remove'+_['capitalize'](_0x5ccc45['query'][_0xb596('0x5d')]['toLowerCase']())+_0xb596('0x65')](_0x5ccc45[_0xb596('0x3d')][_0xb596('0x6b')]);}return null;})['then'](handleEntityNotFound(_0xdac8dd,null))['then'](respondWithStatusCode(_0xdac8dd,null))[_0xb596('0x4c')](handleError(_0xdac8dd,null));};exports[_0xb596('0x6c')]=function(_0x50dff8,_0x2eb7b1){return db[_0xb596('0x47')]['find']({'where':{'id':_0x50dff8[_0xb596('0x4e')]['id']}})[_0xb596('0x2c')](handleEntityNotFound(_0x2eb7b1,null))[_0xb596('0x2c')](function(_0x3d2a2c){if(_0x3d2a2c){var _0x111e73=[_0xb596('0x6d'),_0xb596('0x6e'),'Mail',_0xb596('0x6f'),_0xb596('0x70'),_0xb596('0x71'),_0xb596('0x72')];return db['sequelize'][_0xb596('0x73')](function(_0x3b9e84){var _0x222ac4=_['map'](_0x111e73,function(_0x382ff4){var _0x19713a={'attributes':['id','name']};if(_0x382ff4===_0xb596('0x6d')){_0x19713a['through']={'attributes':['penalty']};}return _0x3d2a2c[_0xb596('0x56')+_0x382ff4+'Queues'](_0x19713a)[_0xb596('0x2c')](function(_0x499535){var _0x4eb14b=_[_0xb596('0x38')](_0x499535,function(_0x40f479){var _0xdc7e78=_[_0xb596('0x38')](_0x50dff8['body'][_0xb596('0x6b')],function(_0x187ee6){var _0x657e86={'where':{'UserId':_0x187ee6,[_0x382ff4+_0xb596('0x74')]:_0x40f479['id']},'transaction':_0x3b9e84};if(_0x382ff4==='Voice'){_0x657e86[_0xb596('0x75')]={'penalty':_0x40f479[_0xb596('0x76')][_0xb596('0x77')]};}return db[_0xb596('0x78')+_0x382ff4+_0xb596('0x62')]['findOrCreate'](_0x657e86)[_0xb596('0x2c')](function(){socket[_0xb596('0x79')](_0xb596('0x53')+_0x382ff4+_0xb596('0x7a'),{'UserId':_0x187ee6,[_0x382ff4+'QueueId']:_0x40f479['id']});if(_0x382ff4!==_0xb596('0x6d'))return;return db[_0xb596('0x78')][_0xb596('0x4a')]({'where':{'id':_0x50dff8[_0xb596('0x52')][_0xb596('0x6b')],'online':0x1},'attributes':['id','name',_0xb596('0x7b'),'voicePause',_0xb596('0x7c')],'raw':!![]})[_0xb596('0x2c')](function(_0x25ab5a){var _0x59950b=_[_0xb596('0x38')](_0x25ab5a,function(_0x1913f5){return db[_0xb596('0x7d')][_0xb596('0x7e')]({'membername':_0x1913f5[_0xb596('0x30')],'UserId':_0x1913f5['id'],'queue_name':_0x40f479[_0xb596('0x30')],'VoiceQueueId':_0x40f479['id'],'interface':_[_0xb596('0x7f')](_0x1913f5[_0xb596('0x7c')])?util[_0xb596('0x80')](_0xb596('0x81'),_0x1913f5['name']):_0x1913f5[_0xb596('0x7c')],'paused':_0x1913f5[_0xb596('0x82')]||![],'penalty':_0x40f479[_0xb596('0x76')][_0xb596('0x77')]},{'transaction':_0x3b9e84});});return Promise[_0xb596('0x83')](_0x59950b);});});});return Promise[_0xb596('0x83')](_0xdc7e78);});return Promise['all'](_0x4eb14b);});});return Promise[_0xb596('0x83')](_0x222ac4)[_0xb596('0x2c')](function(){return _0x3d2a2c[_0xb596('0x6c')](_0x50dff8[_0xb596('0x52')]['ids'],{'transaction':_0x3b9e84})['spread'](function(_0x4b633a){return _0x4b633a;});});});}})[_0xb596('0x2c')](respondWithResult(_0x2eb7b1,null))['catch'](handleError(_0x2eb7b1,null));};exports[_0xb596('0x84')]=function(_0x5e27cd,_0x3d2301){return db[_0xb596('0x47')][_0xb596('0x50')]({'where':{'id':_0x5e27cd[_0xb596('0x4e')]['id']}})[_0xb596('0x2c')](handleEntityNotFound(_0x3d2301,null))['then'](function(_0x5cb1cc){if(_0x5cb1cc){var _0x3f6ff7=['Voice',_0xb596('0x6e'),_0xb596('0x85'),'Sms',_0xb596('0x70'),'Openchannel',_0xb596('0x72')];return db[_0xb596('0x86')][_0xb596('0x73')](function(_0x361c82){var _0x5f1eb5=_['map'](_0x3f6ff7,function(_0x185674){var _0x53bde8={'attributes':['id',_0xb596('0x30')]};return _0x5cb1cc[_0xb596('0x56')+_0x185674+_0xb596('0x65')](_0x53bde8)[_0xb596('0x2c')](function(_0x3181f4){var _0x4e0719=_['map'](_0x3181f4,function(_0x10624a){return _0x10624a[_0xb596('0x84')](_0x5e27cd[_0xb596('0x3d')][_0xb596('0x6b')],{'transaction':_0x361c82})[_0xb596('0x2c')](function(){var _0x216654=JSON[_0xb596('0x87')]('['+_0x5e27cd[_0xb596('0x3d')][_0xb596('0x6b')]+']');var _0x4d0e01=_['map'](_0x216654,function(_0x44a1d7){socket[_0xb596('0x79')]('user'+_0x185674+'Queue:remove',{'UserId':Number(_0x44a1d7),[_0x185674+_0xb596('0x74')]:_0x10624a['id']});if(_0x185674!=='Voice')return;return db[_0xb596('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x10624a['id'],'UserId':_0x44a1d7},'transaction':_0x361c82});});return Promise[_0xb596('0x83')](_0x4d0e01);});});return Promise[_0xb596('0x83')](_0x4e0719);});});return Promise[_0xb596('0x83')](_0x5f1eb5)[_0xb596('0x2c')](function(){return _0x5cb1cc[_0xb596('0x84')](_0x5e27cd['query'][_0xb596('0x6b')],{'transaction':_0x361c82});});});}})[_0xb596('0x2c')](respondWithStatusCode(_0x3d2301,null))[_0xb596('0x4c')](handleError(_0x3d2301,null));};exports[_0xb596('0x88')]=function(_0x389a69,_0x4b2f4c,_0x111fe2){var _0x8549ab={};var _0x5981dc={};var _0x312a1e;var _0x2a7604;return db[_0xb596('0x47')]['findOne']({'where':{'id':_0x389a69[_0xb596('0x4e')]['id']}})[_0xb596('0x2c')](handleEntityNotFound(_0x4b2f4c,null))['then'](function(_0xeead88){if(_0xeead88){_0x312a1e=_0xeead88;_0x5981dc[_0xb596('0x37')]=_[_0xb596('0x39')](db['User'][_0xb596('0x33')]);_0x5981dc[_0xb596('0x3d')]=_[_0xb596('0x39')](_0x389a69[_0xb596('0x3d')]);_0x5981dc[_0xb596('0x3a')]=_[_0xb596('0x3b')](_0x5981dc[_0xb596('0x37')],_0x5981dc[_0xb596('0x3d')]);_0x8549ab[_0xb596('0x3c')]=_[_0xb596('0x3b')](_0x5981dc[_0xb596('0x37')],qs['fields'](_0x389a69['query'][_0xb596('0x4f')]));_0x8549ab['attributes']=_0x8549ab[_0xb596('0x3c')]['length']?_0x8549ab['attributes']:_0x5981dc[_0xb596('0x37')];_0x8549ab['order']=qs['sort'](_0x389a69[_0xb596('0x3d')][_0xb596('0x40')]);_0x8549ab[_0xb596('0x44')]=qs[_0xb596('0x3a')](_[_0xb596('0x41')](_0x389a69['query'],_0x5981dc[_0xb596('0x3a')]));if(_0x389a69['query']['filter']){_0x8549ab[_0xb596('0x44')]=_[_0xb596('0x43')](_0x8549ab[_0xb596('0x44')],{'$or':_[_0xb596('0x38')](_0x8549ab[_0xb596('0x3c')],function(_0x3dd727){var _0x1fd517={};_0x1fd517[_0x3dd727]={'$like':'%'+_0x389a69[_0xb596('0x3d')][_0xb596('0x42')]+'%'};return _0x1fd517;})});}_0x8549ab=_[_0xb596('0x43')]({},_0x8549ab,_0x389a69['options']);return _0x312a1e['getAgents'](_0x8549ab);}})['then'](function(_0x4aa02d){if(_0x4aa02d){_0x2a7604=_0x4aa02d[_0xb596('0x63')];if(!_0x389a69[_0xb596('0x3d')][_0xb596('0x3e')]('nolimit')){_0x8549ab[_0xb596('0x22')]=qs['limit'](_0x389a69['query'][_0xb596('0x22')]);_0x8549ab[_0xb596('0x20')]=qs['offset'](_0x389a69['query'][_0xb596('0x20')]);}return _0x312a1e[_0xb596('0x88')](_0x8549ab);}})[_0xb596('0x2c')](function(_0x3ddf52){if(_0x3ddf52){return _0x3ddf52?{'count':_0x2a7604,'rows':_0x3ddf52}:null;}})['then'](respondWithResult(_0x4b2f4c,null))[_0xb596('0x4c')](handleError(_0x4b2f4c,null));};
\ No newline at end of file
+var _0x54a2=['Unknown\x20channel','add','ids','removeQueues','remove','addAgents','Voice','Sms','Fax','sequelize','transaction','through','QueueId','penalty','User','emit','findAll','voicePause','interface','UserVoiceQueueRt','upsert','SIP/%s','all','spread','removeAgents','Chat','Mail','Whatsapp','parse','Queue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','redis','defaults','localhost','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','error','stack','name','send','map','Team','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','include','rows','show','params','fields','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','keys','capitalize','toLowerCase','Queue','pick','Queues','addQueues'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x54a2,0x9d));var _0x254a=function(_0x28d1ea,_0x426311){_0x28d1ea=_0x28d1ea-0x0;var _0x1667b6=_0x54a2[_0x28d1ea];return _0x1667b6;};'use strict';var emlformat=require(_0x254a('0x0'));var rimraf=require(_0x254a('0x1'));var zipdir=require(_0x254a('0x2'));var jsonpatch=require(_0x254a('0x3'));var rp=require('request-promise');var moment=require(_0x254a('0x4'));var BPromise=require(_0x254a('0x5'));var Mustache=require('mustache');var util=require(_0x254a('0x6'));var path=require(_0x254a('0x7'));var sox=require(_0x254a('0x8'));var csv=require(_0x254a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x254a('0xa'));var jsforce=require(_0x254a('0xb'));var deskjs=require(_0x254a('0xc'));var toCsv=require(_0x254a('0x9'));var querystring=require(_0x254a('0xd'));var Papa=require('papaparse');var Redis=require(_0x254a('0xe'));var authService=require(_0x254a('0xf'));var qs=require(_0x254a('0x10'));var as=require(_0x254a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x254a('0x12'));var utils=require(_0x254a('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x254a('0x14')]=_[_0x254a('0x15')](config[_0x254a('0x14')],{'host':_0x254a('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./team.socket')[_0x254a('0x17')](socket);function respondWithStatusCode(_0x471c74,_0x4ffd4d){_0x4ffd4d=_0x4ffd4d||0xcc;return function(_0x31c2a2){if(_0x31c2a2){return _0x471c74[_0x254a('0x18')](_0x4ffd4d);}return _0x471c74[_0x254a('0x19')](_0x4ffd4d)[_0x254a('0x1a')]();};}function respondWithResult(_0x487fd2,_0x5c236f){_0x5c236f=_0x5c236f||0xc8;return function(_0x409b34){if(_0x409b34){return _0x487fd2[_0x254a('0x19')](_0x5c236f)['json'](_0x409b34);}};}function respondWithFilteredResult(_0x41817f,_0x2cbcd4){return function(_0x5d0ddf){if(_0x5d0ddf){var _0x5e55d6=typeof _0x2cbcd4[_0x254a('0x1b')]===_0x254a('0x1c')&&typeof _0x2cbcd4[_0x254a('0x1d')]===_0x254a('0x1c');var _0x48168f=_0x5d0ddf[_0x254a('0x1e')];var _0x2311ea=_0x5e55d6?0x0:_0x2cbcd4[_0x254a('0x1b')];var _0x3489f5=_0x5e55d6?_0x5d0ddf['count']:_0x2cbcd4['offset']+_0x2cbcd4[_0x254a('0x1d')];var _0xcda28;if(_0x3489f5>=_0x48168f){_0x3489f5=_0x48168f;_0xcda28=0xc8;}else{_0xcda28=0xce;}_0x41817f[_0x254a('0x19')](_0xcda28);return _0x41817f[_0x254a('0x1f')](_0x254a('0x20'),_0x2311ea+'-'+_0x3489f5+'/'+_0x48168f)['json'](_0x5d0ddf);}return null;};}function patchUpdates(_0x64b844){return function(_0x4263d8){try{jsonpatch[_0x254a('0x21')](_0x4263d8,_0x64b844,!![]);}catch(_0x7e7b75){return BPromise[_0x254a('0x22')](_0x7e7b75);}return _0x4263d8['save']();};}function saveUpdates(_0x55ef02,_0x250455){return function(_0x326c67){if(_0x326c67){return _0x326c67[_0x254a('0x23')](_0x55ef02)['then'](function(_0x2770dc){return _0x2770dc;});}return null;};}function removeEntity(_0x32c0eb,_0x5d7df3){return function(_0x1f4bf0){if(_0x1f4bf0){return _0x1f4bf0['destroy']()[_0x254a('0x24')](function(){var _0x5d3c2e=_0x1f4bf0[_0x254a('0x25')]({'plain':!![]});var _0x1db515='Teams';return db[_0x254a('0x26')]['destroy']({'where':{'type':_0x1db515,'resourceId':_0x5d3c2e['id']}})['then'](function(){return _0x1f4bf0;});})[_0x254a('0x24')](function(){_0x32c0eb[_0x254a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe778ca,_0x37a06d){return function(_0x1484c7){if(!_0x1484c7){_0xe778ca['sendStatus'](0x194);}return _0x1484c7;};}function handleError(_0x415009,_0x36d502){_0x36d502=_0x36d502||0x1f4;return function(_0x1136b1){logger[_0x254a('0x27')](_0x1136b1[_0x254a('0x28')]);if(_0x1136b1[_0x254a('0x29')]){delete _0x1136b1[_0x254a('0x29')];}_0x415009[_0x254a('0x19')](_0x36d502)[_0x254a('0x2a')](_0x1136b1);};}exports['index']=function(_0x76c7da,_0x41efa1){var _0x1996a2={},_0x5d3606={},_0x55b0cd={'count':0x0,'rows':[]};var _0x13c622=_[_0x254a('0x2b')](db[_0x254a('0x2c')][_0x254a('0x2d')],function(_0x1b3d7e){return{'name':_0x1b3d7e[_0x254a('0x2e')],'type':_0x1b3d7e['type'][_0x254a('0x2f')]};});_0x5d3606['model']=_[_0x254a('0x2b')](_0x13c622,'name');_0x5d3606[_0x254a('0x30')]=_['keys'](_0x76c7da[_0x254a('0x30')]);_0x5d3606[_0x254a('0x31')]=_[_0x254a('0x32')](_0x5d3606['model'],_0x5d3606[_0x254a('0x30')]);_0x1996a2[_0x254a('0x33')]=_['intersection'](_0x5d3606[_0x254a('0x34')],qs['fields'](_0x76c7da['query']['fields']));_0x1996a2[_0x254a('0x33')]=_0x1996a2['attributes'][_0x254a('0x35')]?_0x1996a2[_0x254a('0x33')]:_0x5d3606[_0x254a('0x34')];if(!_0x76c7da['query'][_0x254a('0x36')](_0x254a('0x37'))){_0x1996a2[_0x254a('0x1d')]=qs[_0x254a('0x1d')](_0x76c7da[_0x254a('0x30')][_0x254a('0x1d')]);_0x1996a2[_0x254a('0x1b')]=qs[_0x254a('0x1b')](_0x76c7da[_0x254a('0x30')][_0x254a('0x1b')]);}_0x1996a2[_0x254a('0x38')]=qs[_0x254a('0x39')](_0x76c7da['query']['sort']);_0x1996a2[_0x254a('0x3a')]=qs[_0x254a('0x31')](_['pick'](_0x76c7da[_0x254a('0x30')],_0x5d3606[_0x254a('0x31')]),_0x13c622);if(_0x76c7da['query'][_0x254a('0x3b')]){_0x1996a2['where']=_[_0x254a('0x3c')](_0x1996a2['where'],{'$or':_['map'](_0x13c622,function(_0x3f1f21){if(_0x3f1f21[_0x254a('0x3d')]!==_0x254a('0x3e')){var _0x4e1ab={};_0x4e1ab[_0x3f1f21[_0x254a('0x29')]]={'$like':'%'+_0x76c7da[_0x254a('0x30')][_0x254a('0x3b')]+'%'};return _0x4e1ab;}})});}_0x1996a2=_['merge']({},_0x1996a2,_0x76c7da[_0x254a('0x3f')]);var _0x59e458={'where':_0x1996a2[_0x254a('0x3a')]};return db[_0x254a('0x2c')]['count'](_0x59e458)['then'](function(_0x2257f6){_0x55b0cd[_0x254a('0x1e')]=_0x2257f6;if(_0x76c7da['query']['includeAll']){_0x1996a2[_0x254a('0x40')]=[{'all':!![]}];}return db[_0x254a('0x2c')]['findAll'](_0x1996a2);})[_0x254a('0x24')](function(_0x432f4f){_0x55b0cd[_0x254a('0x41')]=_0x432f4f;return _0x55b0cd;})['then'](respondWithFilteredResult(_0x41efa1,_0x1996a2))['catch'](handleError(_0x41efa1,null));};exports[_0x254a('0x42')]=function(_0xaed733,_0x2ec076){var _0x223c82={'raw':![],'where':{'id':_0xaed733[_0x254a('0x43')]['id']}},_0x430433={};_0x430433[_0x254a('0x34')]=_['keys'](db[_0x254a('0x2c')][_0x254a('0x2d')]);_0x430433[_0x254a('0x30')]=_['keys'](_0xaed733[_0x254a('0x30')]);_0x430433[_0x254a('0x31')]=_['intersection'](_0x430433['model'],_0x430433[_0x254a('0x30')]);_0x223c82['attributes']=_[_0x254a('0x32')](_0x430433[_0x254a('0x34')],qs['fields'](_0xaed733[_0x254a('0x30')][_0x254a('0x44')]));_0x223c82['attributes']=_0x223c82[_0x254a('0x33')][_0x254a('0x35')]?_0x223c82['attributes']:_0x430433[_0x254a('0x34')];if(_0xaed733[_0x254a('0x30')]['includeAll']){_0x223c82['include']=[{'all':!![]}];}_0x223c82=_['merge']({},_0x223c82,_0xaed733[_0x254a('0x3f')]);return db[_0x254a('0x2c')][_0x254a('0x45')](_0x223c82)[_0x254a('0x24')](handleEntityNotFound(_0x2ec076,null))['then'](respondWithResult(_0x2ec076,null))[_0x254a('0x46')](handleError(_0x2ec076,null));};exports[_0x254a('0x47')]=function(_0x4144a8,_0x5a7c71){return db[_0x254a('0x2c')][_0x254a('0x47')](_0x4144a8[_0x254a('0x48')],{})[_0x254a('0x24')](function(_0x828c4b){var _0x255de9=_0x4144a8[_0x254a('0x49')]['get']({'plain':!![]});if(!_0x255de9)throw new Error(_0x254a('0x4a'));if(_0x255de9[_0x254a('0x4b')]===_0x254a('0x49')){var _0x326157=_0x828c4b['get']({'plain':!![]});var _0x5a105a=_0x254a('0x4c');return db[_0x254a('0x4d')][_0x254a('0x45')]({'where':{'name':_0x5a105a,'userProfileId':_0x255de9[_0x254a('0x4e')]},'raw':!![]})['then'](function(_0x1a0ef5){if(_0x1a0ef5&&_0x1a0ef5[_0x254a('0x4f')]===0x0){return db['UserProfileResource'][_0x254a('0x47')]({'name':_0x326157[_0x254a('0x29')],'resourceId':_0x326157['id'],'type':_0x1a0ef5['name'],'sectionId':_0x1a0ef5['id']},{})['then'](function(){return _0x828c4b;});}else{return _0x828c4b;}})[_0x254a('0x46')](function(_0x2fdb2c){logger['error'](_0x254a('0x50'),_0x2fdb2c);throw _0x2fdb2c;});}return _0x828c4b;})['then'](respondWithResult(_0x5a7c71,0xc9))[_0x254a('0x46')](handleError(_0x5a7c71,null));};exports[_0x254a('0x23')]=function(_0x13616f,_0x160fbd){if(_0x13616f['body']['id']){delete _0x13616f[_0x254a('0x48')]['id'];}return db[_0x254a('0x2c')][_0x254a('0x45')]({'where':{'id':_0x13616f[_0x254a('0x43')]['id']}})[_0x254a('0x24')](handleEntityNotFound(_0x160fbd,null))[_0x254a('0x24')](saveUpdates(_0x13616f[_0x254a('0x48')],null))[_0x254a('0x24')](respondWithResult(_0x160fbd,null))[_0x254a('0x46')](handleError(_0x160fbd,null));};exports[_0x254a('0x51')]=function(_0x4d79de,_0x11298b){return db['Team'][_0x254a('0x45')]({'where':{'id':_0x4d79de[_0x254a('0x43')]['id']}})['then'](handleEntityNotFound(_0x11298b,null))['then'](removeEntity(_0x11298b,null))[_0x254a('0x46')](handleError(_0x11298b,null));};exports[_0x254a('0x52')]=function(_0xe0aab7,_0x349e61,_0x20947b){return db[_0x254a('0x2c')][_0x254a('0x53')]({'where':{'id':_0xe0aab7[_0x254a('0x43')]['id']}})['then'](handleEntityNotFound(_0x349e61,null))[_0x254a('0x24')](function(_0x116533){if(!_0xe0aab7[_0x254a('0x30')][_0x254a('0x54')]||!utils[_0x254a('0x55')](_0xe0aab7[_0x254a('0x30')][_0x254a('0x54')])){throw new db[(_0x254a('0x56'))][(_0x254a('0x57'))]('Unknown\x20channel');}var _0x53cb5e={};var _0x3fb7ef={};_0x3fb7ef[_0x254a('0x34')]=_[_0x254a('0x58')](db[_[_0x254a('0x59')](_0xe0aab7['query'][_0x254a('0x54')][_0x254a('0x5a')]())+_0x254a('0x5b')][_0x254a('0x2d')]);_0x3fb7ef[_0x254a('0x30')]=_[_0x254a('0x58')](_0xe0aab7[_0x254a('0x30')]);_0x3fb7ef[_0x254a('0x31')]=_[_0x254a('0x32')](_0x3fb7ef[_0x254a('0x34')],_0x3fb7ef[_0x254a('0x30')]);_0x53cb5e[_0x254a('0x33')]=_[_0x254a('0x32')](_0x3fb7ef[_0x254a('0x34')],qs[_0x254a('0x44')](_0xe0aab7[_0x254a('0x30')][_0x254a('0x44')]));_0x53cb5e['attributes']=_0x53cb5e[_0x254a('0x33')][_0x254a('0x35')]?_0x53cb5e[_0x254a('0x33')]:_0x3fb7ef[_0x254a('0x34')];_0x53cb5e[_0x254a('0x1d')]=qs[_0x254a('0x1d')](_0xe0aab7[_0x254a('0x30')][_0x254a('0x1d')]);_0x53cb5e[_0x254a('0x1b')]=qs[_0x254a('0x1b')](_0xe0aab7[_0x254a('0x30')][_0x254a('0x1b')]);_0x53cb5e['order']=qs[_0x254a('0x39')](_0xe0aab7[_0x254a('0x30')]['sort']);_0x53cb5e['where']=qs[_0x254a('0x31')](_[_0x254a('0x5c')](_0xe0aab7[_0x254a('0x30')],_0x3fb7ef[_0x254a('0x31')]));_0x53cb5e=_[_0x254a('0x3c')]({},_0x53cb5e,_0xe0aab7['options']);return _0x116533[_0x254a('0x25')+_[_0x254a('0x59')](_0xe0aab7[_0x254a('0x30')]['channel'][_0x254a('0x5a')]())+_0x254a('0x5d')](_0x53cb5e);})[_0x254a('0x24')](respondWithResult(_0x349e61,null))['catch'](handleError(_0x349e61,null));};exports[_0x254a('0x5e')]=function(_0x253e48,_0x4471ab,_0x297b16){return db[_0x254a('0x2c')][_0x254a('0x53')]({'where':{'id':_0x253e48[_0x254a('0x43')]['id']}})[_0x254a('0x24')](function(_0x1cfa03){if(_0x1cfa03){if(!_0x253e48[_0x254a('0x48')][_0x254a('0x54')]||!utils[_0x254a('0x55')](_0x253e48[_0x254a('0x48')]['channel'])){throw new db['Sequelize']['ValidationError'](_0x254a('0x5f'));}return _0x1cfa03[_0x254a('0x60')+_[_0x254a('0x59')](_0x253e48[_0x254a('0x48')][_0x254a('0x54')][_0x254a('0x5a')]())+_0x254a('0x5d')](_0x253e48[_0x254a('0x48')][_0x254a('0x61')]);}return null;})['then'](handleEntityNotFound(_0x4471ab,null))[_0x254a('0x24')](respondWithStatusCode(_0x4471ab,null))[_0x254a('0x46')](handleError(_0x4471ab,null));};exports[_0x254a('0x62')]=function(_0xba9be9,_0x2deb38,_0x154444){return db[_0x254a('0x2c')][_0x254a('0x53')]({'where':{'id':_0xba9be9[_0x254a('0x43')]['id']}})[_0x254a('0x24')](function(_0x1077fa){if(_0x1077fa){if(!_0xba9be9[_0x254a('0x30')][_0x254a('0x54')]||!utils['isValidChannel'](_0xba9be9[_0x254a('0x30')]['channel'])){throw new db[(_0x254a('0x56'))][(_0x254a('0x57'))](_0x254a('0x5f'));}return _0x1077fa[_0x254a('0x63')+_[_0x254a('0x59')](_0xba9be9[_0x254a('0x30')][_0x254a('0x54')]['toLowerCase']())+'Queues'](_0xba9be9['query'][_0x254a('0x61')]);}return null;})[_0x254a('0x24')](handleEntityNotFound(_0x2deb38,null))[_0x254a('0x24')](respondWithStatusCode(_0x2deb38,null))[_0x254a('0x46')](handleError(_0x2deb38,null));};exports[_0x254a('0x64')]=function(_0x59ad55,_0x1ccb0f){return db[_0x254a('0x2c')][_0x254a('0x45')]({'where':{'id':_0x59ad55['params']['id']}})[_0x254a('0x24')](handleEntityNotFound(_0x1ccb0f,null))['then'](function(_0x12c3c9){if(_0x12c3c9){var _0x2ee678=[_0x254a('0x65'),'Chat','Mail',_0x254a('0x66'),_0x254a('0x67'),'Openchannel','Whatsapp'];return db[_0x254a('0x68')][_0x254a('0x69')](function(_0x5c65ef){var _0x503e18=_['map'](_0x2ee678,function(_0x1bcd64){var _0x23173e={'attributes':['id',_0x254a('0x29')]};if(_0x1bcd64===_0x254a('0x65')){_0x23173e[_0x254a('0x6a')]={'attributes':['penalty']};}return _0x12c3c9[_0x254a('0x25')+_0x1bcd64+_0x254a('0x5d')](_0x23173e)[_0x254a('0x24')](function(_0x534def){var _0x5a26cb=_[_0x254a('0x2b')](_0x534def,function(_0x2d15ba){var _0x30cf94=_[_0x254a('0x2b')](_0x59ad55[_0x254a('0x48')][_0x254a('0x61')],function(_0x509edc){var _0x199763={'where':{'UserId':_0x509edc,[_0x1bcd64+_0x254a('0x6b')]:_0x2d15ba['id']},'transaction':_0x5c65ef};if(_0x1bcd64===_0x254a('0x65')){_0x199763[_0x254a('0x15')]={'penalty':_0x2d15ba['TeamVoiceQueue'][_0x254a('0x6c')]};}return db[_0x254a('0x6d')+_0x1bcd64+_0x254a('0x5b')]['findOrCreate'](_0x199763)[_0x254a('0x24')](function(){socket[_0x254a('0x6e')](_0x254a('0x49')+_0x1bcd64+'Queue:save',{'UserId':_0x509edc,[_0x1bcd64+'QueueId']:_0x2d15ba['id']});if(_0x1bcd64!==_0x254a('0x65'))return;return db[_0x254a('0x6d')][_0x254a('0x6f')]({'where':{'id':_0x59ad55[_0x254a('0x48')][_0x254a('0x61')],'online':0x1},'attributes':['id',_0x254a('0x29'),'online',_0x254a('0x70'),_0x254a('0x71')],'raw':!![]})[_0x254a('0x24')](function(_0x3927ae){var _0x3987f7=_['map'](_0x3927ae,function(_0x4ef9fa){return db[_0x254a('0x72')][_0x254a('0x73')]({'membername':_0x4ef9fa['name'],'UserId':_0x4ef9fa['id'],'queue_name':_0x2d15ba[_0x254a('0x29')],'VoiceQueueId':_0x2d15ba['id'],'interface':_['isNil'](_0x4ef9fa[_0x254a('0x71')])?util['format'](_0x254a('0x74'),_0x4ef9fa['name']):_0x4ef9fa[_0x254a('0x71')],'paused':_0x4ef9fa['voicePause']||![],'penalty':_0x2d15ba['TeamVoiceQueue'][_0x254a('0x6c')]},{'transaction':_0x5c65ef});});return Promise[_0x254a('0x75')](_0x3987f7);});});});return Promise['all'](_0x30cf94);});return Promise[_0x254a('0x75')](_0x5a26cb);});});return Promise[_0x254a('0x75')](_0x503e18)[_0x254a('0x24')](function(){return _0x12c3c9[_0x254a('0x64')](_0x59ad55[_0x254a('0x48')][_0x254a('0x61')],{'transaction':_0x5c65ef})[_0x254a('0x76')](function(_0xfb0137){return _0xfb0137;});});});}})['then'](respondWithResult(_0x1ccb0f,null))[_0x254a('0x46')](handleError(_0x1ccb0f,null));};exports[_0x254a('0x77')]=function(_0x28e78c,_0x5c56c0){return db[_0x254a('0x2c')]['find']({'where':{'id':_0x28e78c[_0x254a('0x43')]['id']}})[_0x254a('0x24')](handleEntityNotFound(_0x5c56c0,null))[_0x254a('0x24')](function(_0x2516c0){if(_0x2516c0){var _0x50e39f=[_0x254a('0x65'),_0x254a('0x78'),_0x254a('0x79'),_0x254a('0x66'),'Fax','Openchannel',_0x254a('0x7a')];return db[_0x254a('0x68')]['transaction'](function(_0x1fcc4a){var _0x59bca6=_['map'](_0x50e39f,function(_0x496da2){var _0x26a766={'attributes':['id',_0x254a('0x29')]};return _0x2516c0[_0x254a('0x25')+_0x496da2+_0x254a('0x5d')](_0x26a766)[_0x254a('0x24')](function(_0xd0d7ad){var _0x25f1af=_['map'](_0xd0d7ad,function(_0x19b894){return _0x19b894[_0x254a('0x77')](_0x28e78c[_0x254a('0x30')][_0x254a('0x61')],{'transaction':_0x1fcc4a})['then'](function(){var _0xb52d2c=JSON[_0x254a('0x7b')]('['+_0x28e78c[_0x254a('0x30')][_0x254a('0x61')]+']');var _0x8e8245=_['map'](_0xb52d2c,function(_0x55a290){socket[_0x254a('0x6e')](_0x254a('0x49')+_0x496da2+_0x254a('0x7c'),{'UserId':Number(_0x55a290),[_0x496da2+_0x254a('0x6b')]:_0x19b894['id']});if(_0x496da2!==_0x254a('0x65'))return;return db[_0x254a('0x72')][_0x254a('0x51')]({'where':{'VoiceQueueId':_0x19b894['id'],'UserId':_0x55a290},'transaction':_0x1fcc4a});});return Promise['all'](_0x8e8245);});});return Promise[_0x254a('0x75')](_0x25f1af);});});return Promise[_0x254a('0x75')](_0x59bca6)[_0x254a('0x24')](function(){return _0x2516c0[_0x254a('0x77')](_0x28e78c[_0x254a('0x30')][_0x254a('0x61')],{'transaction':_0x1fcc4a});});});}})[_0x254a('0x24')](respondWithStatusCode(_0x5c56c0,null))[_0x254a('0x46')](handleError(_0x5c56c0,null));};exports[_0x254a('0x7d')]=function(_0xba45f3,_0x1e4f16,_0x464b3f){var _0x12be39={};var _0x4dbb4a={};var _0x5bd11a;var _0x21a564;return db['Team'][_0x254a('0x53')]({'where':{'id':_0xba45f3['params']['id']}})[_0x254a('0x24')](handleEntityNotFound(_0x1e4f16,null))[_0x254a('0x24')](function(_0x394c99){if(_0x394c99){_0x5bd11a=_0x394c99;_0x4dbb4a[_0x254a('0x34')]=_[_0x254a('0x58')](db[_0x254a('0x6d')][_0x254a('0x2d')]);_0x4dbb4a[_0x254a('0x30')]=_['keys'](_0xba45f3[_0x254a('0x30')]);_0x4dbb4a[_0x254a('0x31')]=_['intersection'](_0x4dbb4a[_0x254a('0x34')],_0x4dbb4a[_0x254a('0x30')]);_0x12be39[_0x254a('0x33')]=_[_0x254a('0x32')](_0x4dbb4a[_0x254a('0x34')],qs[_0x254a('0x44')](_0xba45f3['query'][_0x254a('0x44')]));_0x12be39['attributes']=_0x12be39[_0x254a('0x33')][_0x254a('0x35')]?_0x12be39[_0x254a('0x33')]:_0x4dbb4a[_0x254a('0x34')];_0x12be39[_0x254a('0x38')]=qs[_0x254a('0x39')](_0xba45f3['query'][_0x254a('0x39')]);_0x12be39['where']=qs[_0x254a('0x31')](_[_0x254a('0x5c')](_0xba45f3[_0x254a('0x30')],_0x4dbb4a[_0x254a('0x31')]));if(_0xba45f3[_0x254a('0x30')][_0x254a('0x3b')]){_0x12be39[_0x254a('0x3a')]=_[_0x254a('0x3c')](_0x12be39[_0x254a('0x3a')],{'$or':_[_0x254a('0x2b')](_0x12be39[_0x254a('0x33')],function(_0x36a8bd){var _0x47702a={};_0x47702a[_0x36a8bd]={'$like':'%'+_0xba45f3[_0x254a('0x30')][_0x254a('0x3b')]+'%'};return _0x47702a;})});}_0x12be39=_[_0x254a('0x3c')]({},_0x12be39,_0xba45f3['options']);return _0x5bd11a[_0x254a('0x7d')](_0x12be39);}})[_0x254a('0x24')](function(_0x50c3eb){if(_0x50c3eb){_0x21a564=_0x50c3eb[_0x254a('0x35')];if(!_0xba45f3['query'][_0x254a('0x36')](_0x254a('0x37'))){_0x12be39[_0x254a('0x1d')]=qs[_0x254a('0x1d')](_0xba45f3[_0x254a('0x30')]['limit']);_0x12be39[_0x254a('0x1b')]=qs[_0x254a('0x1b')](_0xba45f3[_0x254a('0x30')][_0x254a('0x1b')]);}return _0x5bd11a[_0x254a('0x7d')](_0x12be39);}})[_0x254a('0x24')](function(_0x48a6b2){if(_0x48a6b2){return _0x48a6b2?{'count':_0x21a564,'rows':_0x48a6b2}:null;}})[_0x254a('0x24')](respondWithResult(_0x1e4f16,null))['catch'](handleError(_0x1e4f16,null));};
\ No newline at end of file
index 0b08258..5e0bb0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8be=['events','../../mysqldb','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0xe8be,0x80));var _0xee8b=function(_0xe4d6c6,_0x3bdbf2){_0xe4d6c6=_0xe4d6c6-0x0;var _0x3a8935=_0xe8be[_0xe4d6c6];return _0x3a8935;};'use strict';var EventEmitter=require(_0xee8b('0x0'));var Team=require(_0xee8b('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xee8b('0x2'),'afterUpdate':_0xee8b('0x3'),'afterDestroy':_0xee8b('0x4')};function emitEvent(_0x422882){return function(_0x1a49ac,_0x429326,_0x1b5311){TeamEvents[_0xee8b('0x5')](_0x422882+':'+_0x1a49ac['id'],_0x1a49ac);TeamEvents[_0xee8b('0x5')](_0x422882,_0x1a49ac);_0x1b5311(null);};}for(var e in events){if(events[_0xee8b('0x6')](e)){var event=events[e];Team[_0xee8b('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
+var _0x0a5e=['../../mysqldb','Team','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x4344af,_0x37896e){var _0x5cc0e1=function(_0x17dc80){while(--_0x17dc80){_0x4344af['push'](_0x4344af['shift']());}};_0x5cc0e1(++_0x37896e);}(_0x0a5e,0xbd));var _0xe0a5=function(_0xf623ba,_0x9ccc49){_0xf623ba=_0xf623ba-0x0;var _0x43f0ad=_0x0a5e[_0xf623ba];return _0x43f0ad;};'use strict';var EventEmitter=require(_0xe0a5('0x0'));var Team=require(_0xe0a5('0x1'))['db'][_0xe0a5('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0xe0a5('0x3')](0x0);var events={'afterCreate':_0xe0a5('0x4'),'afterUpdate':_0xe0a5('0x5'),'afterDestroy':_0xe0a5('0x6')};function emitEvent(_0x576e0a){return function(_0x3898f3,_0x12259b,_0x59e44e){TeamEvents[_0xe0a5('0x7')](_0x576e0a+':'+_0x3898f3['id'],_0x3898f3);TeamEvents[_0xe0a5('0x7')](_0x576e0a,_0x3898f3);_0x59e44e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xe0a5('0x8')](e,emitEvent(event));}}module[_0xe0a5('0x9')]=TeamEvents;
\ No newline at end of file
index 7f106dc..673137f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x196d=['exports','define','Team','teams','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2d3b99,_0x1ef1e0){var _0x164d35=function(_0x5949ef){while(--_0x5949ef){_0x2d3b99['push'](_0x2d3b99['shift']());}};_0x164d35(++_0x1ef1e0);}(_0x196d,0x1e5));var _0xd196=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x196d[_0x49b207];return _0x2dc8fa;};'use strict';var _=require(_0xd196('0x0'));var util=require('util');var logger=require(_0xd196('0x1'))(_0xd196('0x2'));var moment=require(_0xd196('0x3'));var BPromise=require(_0xd196('0x4'));var rp=require(_0xd196('0x5'));var fs=require('fs');var path=require(_0xd196('0x6'));var rimraf=require(_0xd196('0x7'));var config=require(_0xd196('0x8'));var attributes=require('./team.attributes');module[_0xd196('0x9')]=function(_0x3bbe42,_0xcc5aee){return _0x3bbe42[_0xd196('0xa')](_0xd196('0xb'),attributes,{'tableName':_0xd196('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x09bc=['./team.attributes','exports','define','Team','util','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0x2b5d44,_0x2c2aa5){var _0x381b98=function(_0x4d50b6){while(--_0x4d50b6){_0x2b5d44['push'](_0x2b5d44['shift']());}};_0x381b98(++_0x2c2aa5);}(_0x09bc,0x14e));var _0xc09b=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x09bc[_0x9aada2];return _0x196dff;};'use strict';var _=require('lodash');var util=require(_0xc09b('0x0'));var logger=require(_0xc09b('0x1'))(_0xc09b('0x2'));var moment=require(_0xc09b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc09b('0x4'));var rimraf=require(_0xc09b('0x5'));var config=require(_0xc09b('0x6'));var attributes=require(_0xc09b('0x7'));module[_0xc09b('0x8')]=function(_0x21893c,_0x111062){return _0x21893c[_0xc09b('0x9')](_0xc09b('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3c1d98d..9366ed1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf037=['util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Team,\x20%s,\x20%s','result','lodash'];(function(_0x4c6eba,_0xf33a0c){var _0x4003da=function(_0x194744){while(--_0x194744){_0x4c6eba['push'](_0x4c6eba['shift']());}};_0x4003da(++_0xf33a0c);}(_0xf037,0xca));var _0x7f03=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xf037[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x7f03('0x0'));var util=require(_0x7f03('0x1'));var moment=require(_0x7f03('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f03('0x3'));var fs=require('fs');var Redis=require(_0x7f03('0x4'));var db=require(_0x7f03('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7f03('0x6'))(_0x7f03('0x7'));var config=require(_0x7f03('0x8'));var jayson=require(_0x7f03('0x9'));var client=jayson[_0x7f03('0xa')][_0x7f03('0xb')]({'port':0x232a});config['redis']=_[_0x7f03('0xc')](config[_0x7f03('0xd')],{'host':_0x7f03('0xe'),'port':0x18eb});var socket=require(_0x7f03('0xf'))(new Redis(config[_0x7f03('0xd')]));require(_0x7f03('0x10'))[_0x7f03('0x11')](socket);function respondWithRpcPromise(_0x9060e3,_0x123bee,_0x360f34){return new BPromise(function(_0x57ec94,_0x5f16de){return client[_0x7f03('0x12')](_0x9060e3,_0x360f34)[_0x7f03('0x13')](function(_0x3facf2){logger[_0x7f03('0x14')]('Team,\x20%s,\x20%s',_0x123bee,_0x7f03('0x15'));logger['debug'](_0x7f03('0x16'),_0x123bee,_0x7f03('0x15'),JSON[_0x7f03('0x17')](_0x3facf2));if(_0x3facf2[_0x7f03('0x18')]){if(_0x3facf2['error'][_0x7f03('0x19')]===0x1f4){logger[_0x7f03('0x18')]('Team,\x20%s,\x20%s',_0x123bee,_0x3facf2[_0x7f03('0x18')][_0x7f03('0x1a')]);return _0x5f16de(_0x3facf2[_0x7f03('0x18')]['message']);}logger[_0x7f03('0x18')]('Team,\x20%s,\x20%s',_0x123bee,_0x3facf2[_0x7f03('0x18')]['message']);return _0x57ec94(_0x3facf2[_0x7f03('0x18')][_0x7f03('0x1a')]);}else{logger[_0x7f03('0x14')](_0x7f03('0x1b'),_0x123bee,_0x7f03('0x15'));_0x57ec94(_0x3facf2[_0x7f03('0x1c')][_0x7f03('0x1a')]);}})['catch'](function(_0x43eb7c){logger[_0x7f03('0x18')](_0x7f03('0x1b'),_0x123bee,_0x43eb7c);_0x5f16de(_0x43eb7c);});});}
\ No newline at end of file
+var _0x2228=['request','then','Team,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register'];(function(_0x384dd2,_0x1ffe65){var _0x52933a=function(_0x38afc1){while(--_0x38afc1){_0x384dd2['push'](_0x384dd2['shift']());}};_0x52933a(++_0x1ffe65);}(_0x2228,0x118));var _0x8222=function(_0x1d2c42,_0x1ba4a1){_0x1d2c42=_0x1d2c42-0x0;var _0x229c80=_0x2228[_0x1d2c42];return _0x229c80;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8222('0x0'));var BPromise=require('bluebird');var rs=require(_0x8222('0x1'));var fs=require('fs');var Redis=require(_0x8222('0x2'));var db=require(_0x8222('0x3'))['db'];var utils=require(_0x8222('0x4'));var logger=require(_0x8222('0x5'))(_0x8222('0x6'));var config=require(_0x8222('0x7'));var jayson=require(_0x8222('0x8'));var client=jayson[_0x8222('0x9')][_0x8222('0xa')]({'port':0x232a});config[_0x8222('0xb')]=_[_0x8222('0xc')](config[_0x8222('0xb')],{'host':_0x8222('0xd'),'port':0x18eb});var socket=require(_0x8222('0xe'))(new Redis(config['redis']));require(_0x8222('0xf'))[_0x8222('0x10')](socket);function respondWithRpcPromise(_0x1b185a,_0x4de67a,_0x40b0e2){return new BPromise(function(_0x2b4612,_0x473f0b){return client[_0x8222('0x11')](_0x1b185a,_0x40b0e2)[_0x8222('0x12')](function(_0x48c31a){logger['info'](_0x8222('0x13'),_0x4de67a,_0x8222('0x14'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x4de67a,_0x8222('0x14'),JSON['stringify'](_0x48c31a));if(_0x48c31a[_0x8222('0x15')]){if(_0x48c31a['error'][_0x8222('0x16')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x4de67a,_0x48c31a[_0x8222('0x15')][_0x8222('0x17')]);return _0x473f0b(_0x48c31a[_0x8222('0x15')][_0x8222('0x17')]);}logger[_0x8222('0x15')](_0x8222('0x13'),_0x4de67a,_0x48c31a[_0x8222('0x15')]['message']);return _0x2b4612(_0x48c31a[_0x8222('0x15')]['message']);}else{logger[_0x8222('0x18')](_0x8222('0x13'),_0x4de67a,_0x8222('0x14'));_0x2b4612(_0x48c31a[_0x8222('0x19')]['message']);}})[_0x8222('0x1a')](function(_0x11f981){logger[_0x8222('0x15')](_0x8222('0x13'),_0x4de67a,_0x11f981);_0x473f0b(_0x11f981);});});}
\ No newline at end of file
index ec43406..a2bbb76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69d3=['length','team:','./team.events','save','remove','register'];(function(_0x4bee59,_0x48f132){var _0x3ed6bb=function(_0x2b6c48){while(--_0x2b6c48){_0x4bee59['push'](_0x4bee59['shift']());}};_0x3ed6bb(++_0x48f132);}(_0x69d3,0xda));var _0x369d=function(_0x5c31ee,_0x2fb753){_0x5c31ee=_0x5c31ee-0x0;var _0x510210=_0x69d3[_0x5c31ee];return _0x510210;};'use strict';var TeamEvents=require(_0x369d('0x0'));var events=[_0x369d('0x1'),_0x369d('0x2'),'update'];function createListener(_0x47591f,_0x3e1172){return function(_0x4d777e){_0x3e1172['emit'](_0x47591f,_0x4d777e);};}function removeListener(_0xe38740,_0x59df58){return function(){TeamEvents['removeListener'](_0xe38740,_0x59df58);};}exports[_0x369d('0x3')]=function(_0x2f2a53){for(var _0x18c9f1=0x0,_0x424d8c=events[_0x369d('0x4')];_0x18c9f1<_0x424d8c;_0x18c9f1++){var _0x186302=events[_0x18c9f1];var _0x3adb26=createListener(_0x369d('0x5')+_0x186302,_0x2f2a53);TeamEvents['on'](_0x186302,_0x3adb26);}};
\ No newline at end of file
+var _0xf8fb=['team:','./team.events','save','remove','update','emit','register'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf8fb,0xd3));var _0xbf8f=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xf8fb[_0x4b369d];return _0x571a98;};'use strict';var TeamEvents=require(_0xbf8f('0x0'));var events=[_0xbf8f('0x1'),_0xbf8f('0x2'),_0xbf8f('0x3')];function createListener(_0x294f0a,_0x1868fa){return function(_0x156512){_0x1868fa[_0xbf8f('0x4')](_0x294f0a,_0x156512);};}function removeListener(_0x2cbfd0,_0x1a9836){return function(){TeamEvents['removeListener'](_0x2cbfd0,_0x1a9836);};}exports[_0xbf8f('0x5')]=function(_0x2b15b9){for(var _0xe08549=0x0,_0x4c78c0=events['length'];_0xe08549<_0x4c78c0;_0xe08549++){var _0xb43b2d=events[_0xe08549];var _0x331b7=createListener(_0xbf8f('0x6')+_0xb43b2d,_0x2b15b9);TeamEvents['on'](_0xb43b2d,_0x331b7);}};
\ No newline at end of file
index 5945986..a5546f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3941d4,_0x445e2f){var _0x42e507=function(_0x50a584){while(--_0x50a584){_0x3941d4['push'](_0x3941d4['shift']());}};_0x42e507(++_0x445e2f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x14445d,_0x16d90d){var _0xe2c1fa=function(_0x2e2389){while(--_0x2e2389){_0x14445d['push'](_0x14445d['shift']());}};_0xe2c1fa(++_0x16d90d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
index cd173a9..4a9642a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf404=['sequelize'];(function(_0x18587d,_0x57c260){var _0x372f7b=function(_0x511b29){while(--_0x511b29){_0x18587d['push'](_0x18587d['shift']());}};_0x372f7b(++_0x57c260);}(_0xf404,0x120));var _0x4f40=function(_0x4d20f0,_0x178850){_0x4d20f0=_0x4d20f0-0x0;var _0x476598=_0xf404[_0x4d20f0];return _0x476598;};'use strict';var Sequelize=require(_0x4f40('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xea1b=['sequelize','exports','INTEGER'];(function(_0x36c6eb,_0x4fb127){var _0x30675b=function(_0x3a788b){while(--_0x3a788b){_0x36c6eb['push'](_0x36c6eb['shift']());}};_0x30675b(++_0x4fb127);}(_0xea1b,0xd8));var _0xbea1=function(_0x149a62,_0x5532c8){_0x149a62=_0x149a62-0x0;var _0xb93b30=_0xea1b[_0x149a62];return _0xb93b30;};'use strict';var Sequelize=require(_0xbea1('0x0'));module[_0xbea1('0x1')]={'penalty':{'type':Sequelize[_0xbea1('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index b478c0a..c8f3fac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17ba=['define','TeamVoiceQueue','team_has_voice_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports'];(function(_0x262482,_0x1f2ecc){var _0x159353=function(_0x576925){while(--_0x576925){_0x262482['push'](_0x262482['shift']());}};_0x159353(++_0x1f2ecc);}(_0x17ba,0xab));var _0xa17b=function(_0x59c3e8,_0x342486){_0x59c3e8=_0x59c3e8-0x0;var _0x44e870=_0x17ba[_0x59c3e8];return _0x44e870;};'use strict';var _=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var logger=require('../../config/logger')(_0xa17b('0x2'));var moment=require(_0xa17b('0x3'));var BPromise=require(_0xa17b('0x4'));var rp=require(_0xa17b('0x5'));var fs=require('fs');var path=require(_0xa17b('0x6'));var rimraf=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var attributes=require(_0xa17b('0x9'));module[_0xa17b('0xa')]=function(_0x3cced2,_0xf72ed4){return _0x3cced2[_0xa17b('0xb')](_0xa17b('0xc'),attributes,{'tableName':_0xa17b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8135=['moment','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','define','TeamVoiceQueue','team_has_voice_queues','util','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8135,0x99));var _0x5813=function(_0x14da00,_0x1a6bd2){_0x14da00=_0x14da00-0x0;var _0x2a6a94=_0x8135[_0x14da00];return _0x2a6a94;};'use strict';var _=require('lodash');var util=require(_0x5813('0x0'));var logger=require(_0x5813('0x1'))(_0x5813('0x2'));var moment=require(_0x5813('0x3'));var BPromise=require('bluebird');var rp=require(_0x5813('0x4'));var fs=require('fs');var path=require(_0x5813('0x5'));var rimraf=require(_0x5813('0x6'));var config=require(_0x5813('0x7'));var attributes=require(_0x5813('0x8'));module['exports']=function(_0x57ac38,_0x27599d){return _0x57ac38[_0x5813('0x9')](_0x5813('0xa'),attributes,{'tableName':_0x5813('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4333bb1..b60fb8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfcd6=['then','info','TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x10cd6d,_0x47233a){var _0xe073b=function(_0x53ec0d){while(--_0x53ec0d){_0x10cd6d['push'](_0x10cd6d['shift']());}};_0xe073b(++_0x47233a);}(_0xfcd6,0x1d8));var _0x6fcd=function(_0x390201,_0x43b50b){_0x390201=_0x390201-0x0;var _0x522ed3=_0xfcd6[_0x390201];return _0x522ed3;};'use strict';var _=require(_0x6fcd('0x0'));var util=require('util');var moment=require(_0x6fcd('0x1'));var BPromise=require(_0x6fcd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fcd('0x3'))['db'];var utils=require(_0x6fcd('0x4'));var logger=require(_0x6fcd('0x5'))('rpc');var config=require(_0x6fcd('0x6'));var jayson=require(_0x6fcd('0x7'));var client=jayson[_0x6fcd('0x8')][_0x6fcd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53dd81,_0xeda602,_0x267a20){return new BPromise(function(_0x40b8c5,_0x446111){return client[_0x6fcd('0xa')](_0x53dd81,_0x267a20)[_0x6fcd('0xb')](function(_0x417bd1){logger[_0x6fcd('0xc')](_0x6fcd('0xd'),_0xeda602,'request\x20sent');logger['debug'](_0x6fcd('0xe'),_0xeda602,_0x6fcd('0xf'),JSON[_0x6fcd('0x10')](_0x417bd1));if(_0x417bd1['error']){if(_0x417bd1['error']['code']===0x1f4){logger[_0x6fcd('0x11')](_0x6fcd('0xd'),_0xeda602,_0x417bd1['error'][_0x6fcd('0x12')]);return _0x446111(_0x417bd1[_0x6fcd('0x11')]['message']);}logger[_0x6fcd('0x11')](_0x6fcd('0xd'),_0xeda602,_0x417bd1['error'][_0x6fcd('0x12')]);return _0x40b8c5(_0x417bd1[_0x6fcd('0x11')][_0x6fcd('0x12')]);}else{logger[_0x6fcd('0xc')](_0x6fcd('0xd'),_0xeda602,_0x6fcd('0xf'));_0x40b8c5(_0x417bd1[_0x6fcd('0x13')][_0x6fcd('0x12')]);}})[_0x6fcd('0x14')](function(_0x3bcb0a){logger[_0x6fcd('0x11')](_0x6fcd('0xd'),_0xeda602,_0x3bcb0a);_0x446111(_0x3bcb0a);});});}
\ No newline at end of file
+var _0xb412=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x475b45,_0x192ed2){var _0x125573=function(_0x34149b){while(--_0x34149b){_0x475b45['push'](_0x475b45['shift']());}};_0x125573(++_0x192ed2);}(_0xb412,0x7e));var _0x2b41=function(_0x5288d3,_0x4a8459){_0x5288d3=_0x5288d3-0x0;var _0x53fec7=_0xb412[_0x5288d3];return _0x53fec7;};'use strict';var _=require('lodash');var util=require(_0x2b41('0x0'));var moment=require(_0x2b41('0x1'));var BPromise=require(_0x2b41('0x2'));var rs=require(_0x2b41('0x3'));var fs=require('fs');var Redis=require(_0x2b41('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2b41('0x5'));var logger=require(_0x2b41('0x6'))('rpc');var config=require(_0x2b41('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b41('0x8')][_0x2b41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x528e88,_0x26ee38,_0xedd1d1){return new BPromise(function(_0x1b2b4a,_0x341298){return client['request'](_0x528e88,_0xedd1d1)[_0x2b41('0xa')](function(_0x4f6cfe){logger['info'](_0x2b41('0xb'),_0x26ee38,_0x2b41('0xc'));logger[_0x2b41('0xd')](_0x2b41('0xe'),_0x26ee38,_0x2b41('0xc'),JSON['stringify'](_0x4f6cfe));if(_0x4f6cfe['error']){if(_0x4f6cfe[_0x2b41('0xf')]['code']===0x1f4){logger[_0x2b41('0xf')](_0x2b41('0xb'),_0x26ee38,_0x4f6cfe[_0x2b41('0xf')][_0x2b41('0x10')]);return _0x341298(_0x4f6cfe[_0x2b41('0xf')]['message']);}logger[_0x2b41('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x26ee38,_0x4f6cfe[_0x2b41('0xf')][_0x2b41('0x10')]);return _0x1b2b4a(_0x4f6cfe[_0x2b41('0xf')]['message']);}else{logger['info'](_0x2b41('0xb'),_0x26ee38,_0x2b41('0xc'));_0x1b2b4a(_0x4f6cfe[_0x2b41('0x11')][_0x2b41('0x10')]);}})['catch'](function(_0x2c32aa){logger[_0x2b41('0xf')]('TeamVoiceQueue,\x20%s,\x20%s',_0x26ee38,_0x2c32aa);_0x341298(_0x2c32aa);});});}
\ No newline at end of file
index 941a87f..6b9e678 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8768=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy'];(function(_0x373bc5,_0x3add96){var _0x438e08=function(_0x5ba92b){while(--_0x5ba92b){_0x373bc5['push'](_0x373bc5['shift']());}};_0x438e08(++_0x3add96);}(_0x8768,0xa1));var _0x8876=function(_0x515e7e,_0x170eb1){_0x515e7e=_0x515e7e-0x0;var _0x52c628=_0x8768[_0x515e7e];return _0x52c628;};'use strict';var multer=require(_0x8876('0x0'));var util=require(_0x8876('0x1'));var path=require(_0x8876('0x2'));var timeout=require(_0x8876('0x3'));var express=require(_0x8876('0x4'));var router=express[_0x8876('0x5')]();var fs_extra=require(_0x8876('0x6'));var auth=require(_0x8876('0x7'));var interaction=require(_0x8876('0x8'));var config=require(_0x8876('0x9'));var controller=require(_0x8876('0xa'));router[_0x8876('0xb')]('/',auth[_0x8876('0xc')](),controller['index']);router[_0x8876('0xb')](_0x8876('0xd'),auth[_0x8876('0xc')](),controller[_0x8876('0xe')]);router[_0x8876('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8876('0x10')](_0x8876('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x8876('0x11')](_0x8876('0xd'),auth[_0x8876('0xc')](),controller[_0x8876('0x12')]);module[_0x8876('0x13')]=router;
\ No newline at end of file
+var _0xf4f4=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x149b5a,_0x4bd327){var _0x3658bf=function(_0x5c03e7){while(--_0x5c03e7){_0x149b5a['push'](_0x149b5a['shift']());}};_0x3658bf(++_0x4bd327);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x48511f,_0x3aa048){_0x48511f=_0x48511f-0x0;var _0x2f2488=_0xf4f4[_0x48511f];return _0x2f2488;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./template.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0xd')]('/',auth['isAuthenticated'](),controller[_0x4f4f('0xe')]);router[_0x4f4f('0xf')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x10')]);router[_0x4f4f('0x11')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 397f5f9..46be6d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe091=['exports','STRING','TEXT','sequelize'];(function(_0x68fece,_0x23955e){var _0x329c71=function(_0xf847c4){while(--_0xf847c4){_0x68fece['push'](_0x68fece['shift']());}};_0x329c71(++_0x23955e);}(_0xe091,0x117));var _0x1e09=function(_0x3902fc,_0x335216){_0x3902fc=_0x3902fc-0x0;var _0x2e64a3=_0xe091[_0x3902fc];return _0x2e64a3;};'use strict';var Sequelize=require(_0x1e09('0x0'));module[_0x1e09('0x1')]={'name':{'type':Sequelize[_0x1e09('0x2')]},'description':{'type':Sequelize[_0x1e09('0x2')]},'html':{'type':Sequelize[_0x1e09('0x3')]}};
\ No newline at end of file
+var _0xabf9=['TEXT','exports','STRING'];(function(_0x594ece,_0x2a1f27){var _0x471bc4=function(_0x31941c){while(--_0x31941c){_0x594ece['push'](_0x594ece['shift']());}};_0x471bc4(++_0x2a1f27);}(_0xabf9,0x1e4));var _0x9abf=function(_0x2e4483,_0x4848ab){_0x2e4483=_0x2e4483-0x0;var _0x3c3106=_0xabf9[_0x2e4483];return _0x3c3106;};'use strict';var Sequelize=require('sequelize');module[_0x9abf('0x0')]={'name':{'type':Sequelize[_0x9abf('0x1')]},'description':{'type':Sequelize[_0x9abf('0x1')]},'html':{'type':Sequelize[_0x9abf('0x2')]}};
\ No newline at end of file
index 8651f5b..1d6bdae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73a5=['path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','update','destroy','then','get','Templates','error','stack','name','send','index','map','Template','rawAttributes','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util'];(function(_0x2d5c0b,_0x23d252){var _0x7408a4=function(_0x4d1b74){while(--_0x4d1b74){_0x2d5c0b['push'](_0x2d5c0b['shift']());}};_0x7408a4(++_0x23d252);}(_0x73a5,0x192));var _0x573a=function(_0x1be136,_0x5364c2){_0x1be136=_0x1be136-0x0;var _0x4d2d8b=_0x73a5[_0x1be136];return _0x4d2d8b;};'use strict';var emlformat=require(_0x573a('0x0'));var rimraf=require(_0x573a('0x1'));var zipdir=require(_0x573a('0x2'));var jsonpatch=require(_0x573a('0x3'));var rp=require(_0x573a('0x4'));var moment=require('moment');var BPromise=require(_0x573a('0x5'));var Mustache=require(_0x573a('0x6'));var util=require(_0x573a('0x7'));var path=require(_0x573a('0x8'));var sox=require(_0x573a('0x9'));var csv=require('to-csv');var ejs=require(_0x573a('0xa'));var fs=require('fs');var fs_extra=require(_0x573a('0xb'));var _=require(_0x573a('0xc'));var squel=require(_0x573a('0xd'));var crypto=require('crypto');var jsforce=require(_0x573a('0xe'));var deskjs=require(_0x573a('0xf'));var toCsv=require(_0x573a('0x10'));var querystring=require(_0x573a('0x11'));var Papa=require(_0x573a('0x12'));var Redis=require(_0x573a('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x573a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x573a('0x15'))('api');var utils=require(_0x573a('0x16'));var config=require(_0x573a('0x17'));var licenseUtil=require(_0x573a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x180ade,_0x13ed50){_0x13ed50=_0x13ed50||0xcc;return function(_0x3f43d0){if(_0x3f43d0){return _0x180ade[_0x573a('0x19')](_0x13ed50);}return _0x180ade[_0x573a('0x1a')](_0x13ed50)[_0x573a('0x1b')]();};}function respondWithResult(_0x2e1980,_0x1f3255){_0x1f3255=_0x1f3255||0xc8;return function(_0x3ad0d0){if(_0x3ad0d0){return _0x2e1980[_0x573a('0x1a')](_0x1f3255)[_0x573a('0x1c')](_0x3ad0d0);}};}function respondWithFilteredResult(_0x8205a8,_0x53ee5c){return function(_0x2080a5){if(_0x2080a5){var _0xafbcd7=typeof _0x53ee5c[_0x573a('0x1d')]===_0x573a('0x1e')&&typeof _0x53ee5c['limit']==='undefined';var _0x440db1=_0x2080a5[_0x573a('0x1f')];var _0x299aca=_0xafbcd7?0x0:_0x53ee5c[_0x573a('0x1d')];var _0x331861=_0xafbcd7?_0x2080a5[_0x573a('0x1f')]:_0x53ee5c[_0x573a('0x1d')]+_0x53ee5c[_0x573a('0x20')];var _0x40b069;if(_0x331861>=_0x440db1){_0x331861=_0x440db1;_0x40b069=0xc8;}else{_0x40b069=0xce;}_0x8205a8['status'](_0x40b069);return _0x8205a8['set']('Content-Range',_0x299aca+'-'+_0x331861+'/'+_0x440db1)[_0x573a('0x1c')](_0x2080a5);}return null;};}function patchUpdates(_0x5783c9){return function(_0x10cf91){try{jsonpatch[_0x573a('0x21')](_0x10cf91,_0x5783c9,!![]);}catch(_0x5442fe){return BPromise['reject'](_0x5442fe);}return _0x10cf91[_0x573a('0x22')]();};}function saveUpdates(_0x3702ba,_0x533466){return function(_0x1766bb){if(_0x1766bb){return _0x1766bb[_0x573a('0x23')](_0x3702ba)['then'](function(_0x5b0af8){return _0x5b0af8;});}return null;};}function removeEntity(_0x3f4b17,_0x3ce668){return function(_0x49bd7a){if(_0x49bd7a){return _0x49bd7a[_0x573a('0x24')]()[_0x573a('0x25')](function(){var _0x15b665=_0x49bd7a[_0x573a('0x26')]({'plain':!![]});var _0x17a2f6=_0x573a('0x27');return db['UserProfileResource'][_0x573a('0x24')]({'where':{'type':_0x17a2f6,'resourceId':_0x15b665['id']}})['then'](function(){return _0x49bd7a;});})[_0x573a('0x25')](function(){_0x3f4b17[_0x573a('0x1a')](0xcc)[_0x573a('0x1b')]();});}};}function handleEntityNotFound(_0x3bca94,_0x3180c1){return function(_0x437c6a){if(!_0x437c6a){_0x3bca94[_0x573a('0x19')](0x194);}return _0x437c6a;};}function handleError(_0x55812c,_0x5bde01){_0x5bde01=_0x5bde01||0x1f4;return function(_0xc9152f){logger[_0x573a('0x28')](_0xc9152f[_0x573a('0x29')]);if(_0xc9152f[_0x573a('0x2a')]){delete _0xc9152f[_0x573a('0x2a')];}_0x55812c['status'](_0x5bde01)[_0x573a('0x2b')](_0xc9152f);};}exports[_0x573a('0x2c')]=function(_0x12c116,_0xac0216){var _0x1ba145={},_0x516787={},_0xde9c3c={'count':0x0,'rows':[]};var _0x2b065e=_[_0x573a('0x2d')](db[_0x573a('0x2e')][_0x573a('0x2f')],function(_0xe9a620){return{'name':_0xe9a620['fieldName'],'type':_0xe9a620['type']['key']};});_0x516787[_0x573a('0x30')]=_['map'](_0x2b065e,_0x573a('0x2a'));_0x516787[_0x573a('0x31')]=_[_0x573a('0x32')](_0x12c116[_0x573a('0x31')]);_0x516787['filters']=_[_0x573a('0x33')](_0x516787[_0x573a('0x30')],_0x516787['query']);_0x1ba145['attributes']=_[_0x573a('0x33')](_0x516787[_0x573a('0x30')],qs[_0x573a('0x34')](_0x12c116[_0x573a('0x31')][_0x573a('0x34')]));_0x1ba145[_0x573a('0x35')]=_0x1ba145[_0x573a('0x35')][_0x573a('0x36')]?_0x1ba145[_0x573a('0x35')]:_0x516787[_0x573a('0x30')];if(!_0x12c116[_0x573a('0x31')][_0x573a('0x37')]('nolimit')){_0x1ba145[_0x573a('0x20')]=qs[_0x573a('0x20')](_0x12c116[_0x573a('0x31')]['limit']);_0x1ba145[_0x573a('0x1d')]=qs['offset'](_0x12c116[_0x573a('0x31')][_0x573a('0x1d')]);}_0x1ba145[_0x573a('0x38')]=qs[_0x573a('0x39')](_0x12c116['query'][_0x573a('0x39')]);_0x1ba145[_0x573a('0x3a')]=qs[_0x573a('0x3b')](_[_0x573a('0x3c')](_0x12c116[_0x573a('0x31')],_0x516787['filters']),_0x2b065e);if(_0x12c116[_0x573a('0x31')][_0x573a('0x3d')]){_0x1ba145[_0x573a('0x3a')]=_[_0x573a('0x3e')](_0x1ba145[_0x573a('0x3a')],{'$or':_['map'](_0x2b065e,function(_0x188d74){if(_0x188d74[_0x573a('0x3f')]!==_0x573a('0x40')){var _0x3690b1={};_0x3690b1[_0x188d74[_0x573a('0x2a')]]={'$like':'%'+_0x12c116[_0x573a('0x31')][_0x573a('0x3d')]+'%'};return _0x3690b1;}})});}_0x1ba145=_[_0x573a('0x3e')]({},_0x1ba145,_0x12c116[_0x573a('0x41')]);var _0x2c9b0b={'where':_0x1ba145[_0x573a('0x3a')]};return db[_0x573a('0x2e')][_0x573a('0x1f')](_0x2c9b0b)[_0x573a('0x25')](function(_0x1ac532){_0xde9c3c[_0x573a('0x1f')]=_0x1ac532;if(_0x12c116[_0x573a('0x31')]['includeAll']){_0x1ba145[_0x573a('0x42')]=[{'all':!![]}];}return db[_0x573a('0x2e')][_0x573a('0x43')](_0x1ba145);})['then'](function(_0x306e18){_0xde9c3c[_0x573a('0x44')]=_0x306e18;return _0xde9c3c;})['then'](respondWithFilteredResult(_0xac0216,_0x1ba145))[_0x573a('0x45')](handleError(_0xac0216,null));};exports['show']=function(_0xb44b5b,_0x589869){var _0x5cccd1={'raw':!![],'where':{'id':_0xb44b5b[_0x573a('0x46')]['id']}},_0x2ecc08={};_0x2ecc08[_0x573a('0x30')]=_[_0x573a('0x32')](db[_0x573a('0x2e')][_0x573a('0x2f')]);_0x2ecc08[_0x573a('0x31')]=_[_0x573a('0x32')](_0xb44b5b['query']);_0x2ecc08[_0x573a('0x3b')]=_['intersection'](_0x2ecc08['model'],_0x2ecc08[_0x573a('0x31')]);_0x5cccd1[_0x573a('0x35')]=_['intersection'](_0x2ecc08[_0x573a('0x30')],qs[_0x573a('0x34')](_0xb44b5b[_0x573a('0x31')][_0x573a('0x34')]));_0x5cccd1['attributes']=_0x5cccd1[_0x573a('0x35')][_0x573a('0x36')]?_0x5cccd1[_0x573a('0x35')]:_0x2ecc08[_0x573a('0x30')];if(_0xb44b5b[_0x573a('0x31')][_0x573a('0x47')]){_0x5cccd1[_0x573a('0x42')]=[{'all':!![]}];}_0x5cccd1=_[_0x573a('0x3e')]({},_0x5cccd1,_0xb44b5b['options']);return db['Template'][_0x573a('0x48')](_0x5cccd1)[_0x573a('0x25')](handleEntityNotFound(_0x589869,null))['then'](respondWithResult(_0x589869,null))[_0x573a('0x45')](handleError(_0x589869,null));};exports[_0x573a('0x49')]=function(_0x489e3d,_0x168b41){return db[_0x573a('0x2e')][_0x573a('0x49')](_0x489e3d['body'],{})[_0x573a('0x25')](function(_0x3d1fa8){var _0x39d226=_0x489e3d[_0x573a('0x4a')]['get']({'plain':!![]});if(!_0x39d226)throw new Error(_0x573a('0x4b'));if(_0x39d226['role']===_0x573a('0x4a')){var _0xd5ec2c=_0x3d1fa8['get']({'plain':!![]});var _0x18efa5=_0x573a('0x27');return db[_0x573a('0x4c')][_0x573a('0x48')]({'where':{'name':_0x18efa5,'userProfileId':_0x39d226[_0x573a('0x4d')]},'raw':!![]})[_0x573a('0x25')](function(_0x27f52){if(_0x27f52&&_0x27f52[_0x573a('0x4e')]===0x0){return db[_0x573a('0x4f')][_0x573a('0x49')]({'name':_0xd5ec2c[_0x573a('0x2a')],'resourceId':_0xd5ec2c['id'],'type':_0x27f52[_0x573a('0x2a')],'sectionId':_0x27f52['id']},{})['then'](function(){return _0x3d1fa8;});}else{return _0x3d1fa8;}})[_0x573a('0x45')](function(_0x1a9389){logger['error'](_0x573a('0x50'),_0x1a9389);throw _0x1a9389;});}return _0x3d1fa8;})[_0x573a('0x25')](respondWithResult(_0x168b41,0xc9))[_0x573a('0x45')](handleError(_0x168b41,null));};exports['update']=function(_0x418942,_0x45616d){if(_0x418942[_0x573a('0x51')]['id']){delete _0x418942[_0x573a('0x51')]['id'];}return db[_0x573a('0x2e')][_0x573a('0x48')]({'where':{'id':_0x418942[_0x573a('0x46')]['id']}})[_0x573a('0x25')](handleEntityNotFound(_0x45616d,null))[_0x573a('0x25')](saveUpdates(_0x418942[_0x573a('0x51')],null))[_0x573a('0x25')](respondWithResult(_0x45616d,null))[_0x573a('0x45')](handleError(_0x45616d,null));};exports[_0x573a('0x24')]=function(_0x959107,_0x5412ab){return db['Template']['find']({'where':{'id':_0x959107[_0x573a('0x46')]['id']}})[_0x573a('0x25')](handleEntityNotFound(_0x5412ab,null))['then'](removeEntity(_0x5412ab,null))[_0x573a('0x45')](handleError(_0x5412ab,null));};
\ No newline at end of file
+var _0x0adf=['name','send','index','map','Template','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','json','reject','save','update','then','destroy','get','Templates','UserProfileResource','error','stack'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0adf,0x178));var _0xf0ad=function(_0x453119,_0x2a6e98){_0x453119=_0x453119-0x0;var _0x3a9382=_0x0adf[_0x453119];return _0x3a9382;};'use strict';var emlformat=require(_0xf0ad('0x0'));var rimraf=require(_0xf0ad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf0ad('0x2'));var rp=require(_0xf0ad('0x3'));var moment=require(_0xf0ad('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf0ad('0x5'));var util=require(_0xf0ad('0x6'));var path=require(_0xf0ad('0x7'));var sox=require(_0xf0ad('0x8'));var csv=require('to-csv');var ejs=require(_0xf0ad('0x9'));var fs=require('fs');var fs_extra=require(_0xf0ad('0xa'));var _=require('lodash');var squel=require(_0xf0ad('0xb'));var crypto=require(_0xf0ad('0xc'));var jsforce=require(_0xf0ad('0xd'));var deskjs=require(_0xf0ad('0xe'));var toCsv=require(_0xf0ad('0xf'));var querystring=require(_0xf0ad('0x10'));var Papa=require('papaparse');var Redis=require(_0xf0ad('0x11'));var authService=require(_0xf0ad('0x12'));var qs=require(_0xf0ad('0x13'));var as=require(_0xf0ad('0x14'));var hardwareService=require(_0xf0ad('0x15'));var logger=require('../../config/logger')(_0xf0ad('0x16'));var utils=require(_0xf0ad('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xf0ad('0x18'));var db=require(_0xf0ad('0x19'))['db'];function respondWithStatusCode(_0x29a708,_0x46c475){_0x46c475=_0x46c475||0xcc;return function(_0x247e9b){if(_0x247e9b){return _0x29a708[_0xf0ad('0x1a')](_0x46c475);}return _0x29a708['status'](_0x46c475)[_0xf0ad('0x1b')]();};}function respondWithResult(_0x2d0ed9,_0x4bb9ef){_0x4bb9ef=_0x4bb9ef||0xc8;return function(_0x3fc4f9){if(_0x3fc4f9){return _0x2d0ed9['status'](_0x4bb9ef)['json'](_0x3fc4f9);}};}function respondWithFilteredResult(_0x4f3697,_0x2d3db0){return function(_0x5de936){if(_0x5de936){var _0x41b823=typeof _0x2d3db0[_0xf0ad('0x1c')]===_0xf0ad('0x1d')&&typeof _0x2d3db0[_0xf0ad('0x1e')]===_0xf0ad('0x1d');var _0x35e326=_0x5de936[_0xf0ad('0x1f')];var _0x2e59af=_0x41b823?0x0:_0x2d3db0[_0xf0ad('0x1c')];var _0x37d667=_0x41b823?_0x5de936[_0xf0ad('0x1f')]:_0x2d3db0[_0xf0ad('0x1c')]+_0x2d3db0[_0xf0ad('0x1e')];var _0x1914ca;if(_0x37d667>=_0x35e326){_0x37d667=_0x35e326;_0x1914ca=0xc8;}else{_0x1914ca=0xce;}_0x4f3697[_0xf0ad('0x20')](_0x1914ca);return _0x4f3697['set']('Content-Range',_0x2e59af+'-'+_0x37d667+'/'+_0x35e326)[_0xf0ad('0x21')](_0x5de936);}return null;};}function patchUpdates(_0x2365e8){return function(_0x2619e4){try{jsonpatch['apply'](_0x2619e4,_0x2365e8,!![]);}catch(_0x45601f){return BPromise[_0xf0ad('0x22')](_0x45601f);}return _0x2619e4[_0xf0ad('0x23')]();};}function saveUpdates(_0x2eb91a,_0x28de44){return function(_0x3c616b){if(_0x3c616b){return _0x3c616b[_0xf0ad('0x24')](_0x2eb91a)[_0xf0ad('0x25')](function(_0x559d13){return _0x559d13;});}return null;};}function removeEntity(_0x529e75,_0x303521){return function(_0x55c50d){if(_0x55c50d){return _0x55c50d[_0xf0ad('0x26')]()[_0xf0ad('0x25')](function(){var _0x1d8e61=_0x55c50d[_0xf0ad('0x27')]({'plain':!![]});var _0x36311c=_0xf0ad('0x28');return db[_0xf0ad('0x29')]['destroy']({'where':{'type':_0x36311c,'resourceId':_0x1d8e61['id']}})['then'](function(){return _0x55c50d;});})[_0xf0ad('0x25')](function(){_0x529e75[_0xf0ad('0x20')](0xcc)[_0xf0ad('0x1b')]();});}};}function handleEntityNotFound(_0x13e90d,_0x511b88){return function(_0x3eed61){if(!_0x3eed61){_0x13e90d[_0xf0ad('0x1a')](0x194);}return _0x3eed61;};}function handleError(_0x356f47,_0x4209b9){_0x4209b9=_0x4209b9||0x1f4;return function(_0x490d7a){logger[_0xf0ad('0x2a')](_0x490d7a[_0xf0ad('0x2b')]);if(_0x490d7a[_0xf0ad('0x2c')]){delete _0x490d7a[_0xf0ad('0x2c')];}_0x356f47[_0xf0ad('0x20')](_0x4209b9)[_0xf0ad('0x2d')](_0x490d7a);};}exports[_0xf0ad('0x2e')]=function(_0x3c0bb0,_0x47e3af){var _0x435d57={},_0x339ac8={},_0x1e431e={'count':0x0,'rows':[]};var _0x3fc69d=_[_0xf0ad('0x2f')](db[_0xf0ad('0x30')][_0xf0ad('0x31')],function(_0x34fec3){return{'name':_0x34fec3['fieldName'],'type':_0x34fec3[_0xf0ad('0x32')][_0xf0ad('0x33')]};});_0x339ac8['model']=_[_0xf0ad('0x2f')](_0x3fc69d,_0xf0ad('0x2c'));_0x339ac8[_0xf0ad('0x34')]=_[_0xf0ad('0x35')](_0x3c0bb0[_0xf0ad('0x34')]);_0x339ac8[_0xf0ad('0x36')]=_[_0xf0ad('0x37')](_0x339ac8[_0xf0ad('0x38')],_0x339ac8['query']);_0x435d57[_0xf0ad('0x39')]=_[_0xf0ad('0x37')](_0x339ac8[_0xf0ad('0x38')],qs['fields'](_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x3a')]));_0x435d57['attributes']=_0x435d57['attributes'][_0xf0ad('0x3b')]?_0x435d57[_0xf0ad('0x39')]:_0x339ac8[_0xf0ad('0x38')];if(!_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x3c')](_0xf0ad('0x3d'))){_0x435d57[_0xf0ad('0x1e')]=qs[_0xf0ad('0x1e')](_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x1e')]);_0x435d57['offset']=qs[_0xf0ad('0x1c')](_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x1c')]);}_0x435d57[_0xf0ad('0x3e')]=qs['sort'](_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x3f')]);_0x435d57[_0xf0ad('0x40')]=qs['filters'](_[_0xf0ad('0x41')](_0x3c0bb0[_0xf0ad('0x34')],_0x339ac8[_0xf0ad('0x36')]),_0x3fc69d);if(_0x3c0bb0[_0xf0ad('0x34')]['filter']){_0x435d57[_0xf0ad('0x40')]=_[_0xf0ad('0x42')](_0x435d57['where'],{'$or':_[_0xf0ad('0x2f')](_0x3fc69d,function(_0x27898e){if(_0x27898e[_0xf0ad('0x32')]!=='VIRTUAL'){var _0x14e47b={};_0x14e47b[_0x27898e[_0xf0ad('0x2c')]]={'$like':'%'+_0x3c0bb0['query'][_0xf0ad('0x43')]+'%'};return _0x14e47b;}})});}_0x435d57=_[_0xf0ad('0x42')]({},_0x435d57,_0x3c0bb0[_0xf0ad('0x44')]);var _0x71ceb6={'where':_0x435d57[_0xf0ad('0x40')]};return db[_0xf0ad('0x30')][_0xf0ad('0x1f')](_0x71ceb6)[_0xf0ad('0x25')](function(_0x24f29a){_0x1e431e[_0xf0ad('0x1f')]=_0x24f29a;if(_0x3c0bb0[_0xf0ad('0x34')][_0xf0ad('0x45')]){_0x435d57[_0xf0ad('0x46')]=[{'all':!![]}];}return db[_0xf0ad('0x30')][_0xf0ad('0x47')](_0x435d57);})[_0xf0ad('0x25')](function(_0x41a346){_0x1e431e[_0xf0ad('0x48')]=_0x41a346;return _0x1e431e;})[_0xf0ad('0x25')](respondWithFilteredResult(_0x47e3af,_0x435d57))['catch'](handleError(_0x47e3af,null));};exports[_0xf0ad('0x49')]=function(_0x15a4bc,_0x3feda5){var _0x1b5698={'raw':!![],'where':{'id':_0x15a4bc[_0xf0ad('0x4a')]['id']}},_0x4259f1={};_0x4259f1[_0xf0ad('0x38')]=_[_0xf0ad('0x35')](db[_0xf0ad('0x30')][_0xf0ad('0x31')]);_0x4259f1[_0xf0ad('0x34')]=_['keys'](_0x15a4bc[_0xf0ad('0x34')]);_0x4259f1[_0xf0ad('0x36')]=_[_0xf0ad('0x37')](_0x4259f1['model'],_0x4259f1['query']);_0x1b5698[_0xf0ad('0x39')]=_[_0xf0ad('0x37')](_0x4259f1[_0xf0ad('0x38')],qs[_0xf0ad('0x3a')](_0x15a4bc[_0xf0ad('0x34')][_0xf0ad('0x3a')]));_0x1b5698['attributes']=_0x1b5698['attributes'][_0xf0ad('0x3b')]?_0x1b5698['attributes']:_0x4259f1['model'];if(_0x15a4bc[_0xf0ad('0x34')][_0xf0ad('0x45')]){_0x1b5698[_0xf0ad('0x46')]=[{'all':!![]}];}_0x1b5698=_[_0xf0ad('0x42')]({},_0x1b5698,_0x15a4bc[_0xf0ad('0x44')]);return db[_0xf0ad('0x30')][_0xf0ad('0x4b')](_0x1b5698)[_0xf0ad('0x25')](handleEntityNotFound(_0x3feda5,null))[_0xf0ad('0x25')](respondWithResult(_0x3feda5,null))['catch'](handleError(_0x3feda5,null));};exports[_0xf0ad('0x4c')]=function(_0x1060a8,_0x3f400a){return db[_0xf0ad('0x30')][_0xf0ad('0x4c')](_0x1060a8[_0xf0ad('0x4d')],{})[_0xf0ad('0x25')](function(_0x4b2f22){var _0x8be161=_0x1060a8[_0xf0ad('0x4e')][_0xf0ad('0x27')]({'plain':!![]});if(!_0x8be161)throw new Error(_0xf0ad('0x4f'));if(_0x8be161['role']===_0xf0ad('0x4e')){var _0xc4cbe9=_0x4b2f22[_0xf0ad('0x27')]({'plain':!![]});var _0x26a40a=_0xf0ad('0x28');return db[_0xf0ad('0x50')][_0xf0ad('0x4b')]({'where':{'name':_0x26a40a,'userProfileId':_0x8be161[_0xf0ad('0x51')]},'raw':!![]})[_0xf0ad('0x25')](function(_0x371e2){if(_0x371e2&&_0x371e2['autoAssociation']===0x0){return db[_0xf0ad('0x29')][_0xf0ad('0x4c')]({'name':_0xc4cbe9['name'],'resourceId':_0xc4cbe9['id'],'type':_0x371e2['name'],'sectionId':_0x371e2['id']},{})[_0xf0ad('0x25')](function(){return _0x4b2f22;});}else{return _0x4b2f22;}})[_0xf0ad('0x52')](function(_0x2e647c){logger[_0xf0ad('0x2a')](_0xf0ad('0x53'),_0x2e647c);throw _0x2e647c;});}return _0x4b2f22;})['then'](respondWithResult(_0x3f400a,0xc9))[_0xf0ad('0x52')](handleError(_0x3f400a,null));};exports[_0xf0ad('0x24')]=function(_0x3dde34,_0x3b2246){if(_0x3dde34[_0xf0ad('0x4d')]['id']){delete _0x3dde34['body']['id'];}return db['Template'][_0xf0ad('0x4b')]({'where':{'id':_0x3dde34['params']['id']}})['then'](handleEntityNotFound(_0x3b2246,null))[_0xf0ad('0x25')](saveUpdates(_0x3dde34[_0xf0ad('0x4d')],null))[_0xf0ad('0x25')](respondWithResult(_0x3b2246,null))[_0xf0ad('0x52')](handleError(_0x3b2246,null));};exports['destroy']=function(_0x57454f,_0x2dd2a0){return db['Template'][_0xf0ad('0x4b')]({'where':{'id':_0x57454f[_0xf0ad('0x4a')]['id']}})[_0xf0ad('0x25')](handleEntityNotFound(_0x2dd2a0,null))['then'](removeEntity(_0x2dd2a0,null))['catch'](handleError(_0x2dd2a0,null));};
\ No newline at end of file
index c5491ab..e9f9d37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ab5=['path','rimraf','../../config/environment','exports','Template','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xbb2033,_0x592d52){var _0x14b549=function(_0x219ade){while(--_0x219ade){_0xbb2033['push'](_0xbb2033['shift']());}};_0x14b549(++_0x592d52);}(_0x9ab5,0xc0));var _0x59ab=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9ab5[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x59ab('0x0'));var util=require(_0x59ab('0x1'));var logger=require(_0x59ab('0x2'))(_0x59ab('0x3'));var moment=require(_0x59ab('0x4'));var BPromise=require(_0x59ab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x59ab('0x6'));var rimraf=require(_0x59ab('0x7'));var config=require(_0x59ab('0x8'));var attributes=require('./template.attributes');module[_0x59ab('0x9')]=function(_0x51e23f,_0x553b87){return _0x51e23f['define'](_0x59ab('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb2a6=['api','moment','bluebird','path','rimraf','./template.attributes','exports','define','Template','tools_templates','lodash','util'];(function(_0x57b929,_0x39ba12){var _0x576796=function(_0x401b6e){while(--_0x401b6e){_0x57b929['push'](_0x57b929['shift']());}};_0x576796(++_0x39ba12);}(_0xb2a6,0xee));var _0x6b2a=function(_0x4377c2,_0x3f02ca){_0x4377c2=_0x4377c2-0x0;var _0x468941=_0xb2a6[_0x4377c2];return _0x468941;};'use strict';var _=require(_0x6b2a('0x0'));var util=require(_0x6b2a('0x1'));var logger=require('../../config/logger')(_0x6b2a('0x2'));var moment=require(_0x6b2a('0x3'));var BPromise=require(_0x6b2a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b2a('0x5'));var rimraf=require(_0x6b2a('0x6'));var config=require('../../config/environment');var attributes=require(_0x6b2a('0x7'));module[_0x6b2a('0x8')]=function(_0x33892f,_0x2daaed){return _0x33892f[_0x6b2a('0x9')](_0x6b2a('0xa'),attributes,{'tableName':_0x6b2a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 951c7cf..485bc12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa97d=['request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','where','attributes','limit','include','model','map','GetTemplate','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x1dd725,_0x27762a){var _0x4ba3d9=function(_0x511ed3){while(--_0x511ed3){_0x1dd725['push'](_0x1dd725['shift']());}};_0x4ba3d9(++_0x27762a);}(_0xa97d,0x88));var _0xda97=function(_0x5bb2e9,_0x2d3666){_0x5bb2e9=_0x5bb2e9-0x0;var _0xd073e8=_0xa97d[_0x5bb2e9];return _0xd073e8;};'use strict';var _=require(_0xda97('0x0'));var util=require(_0xda97('0x1'));var moment=require(_0xda97('0x2'));var BPromise=require(_0xda97('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xda97('0x4'))['db'];var utils=require(_0xda97('0x5'));var logger=require(_0xda97('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xda97('0x7'));var client=jayson['client'][_0xda97('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1faad0,_0xc69583,_0xf87d3a){return new BPromise(function(_0xf11d39,_0x28021e){return client[_0xda97('0x9')](_0x1faad0,_0xf87d3a)[_0xda97('0xa')](function(_0x1d89c6){logger[_0xda97('0xb')](_0xda97('0xc'),_0xc69583,_0xda97('0xd'));logger[_0xda97('0xe')](_0xda97('0xf'),_0xc69583,'request\x20sent',JSON[_0xda97('0x10')](_0x1d89c6));if(_0x1d89c6['error']){if(_0x1d89c6['error']['code']===0x1f4){logger[_0xda97('0x11')](_0xda97('0xc'),_0xc69583,_0x1d89c6['error']['message']);return _0x28021e(_0x1d89c6[_0xda97('0x11')][_0xda97('0x12')]);}logger['error'](_0xda97('0xc'),_0xc69583,_0x1d89c6[_0xda97('0x11')][_0xda97('0x12')]);return _0xf11d39(_0x1d89c6['error'][_0xda97('0x12')]);}else{logger[_0xda97('0xb')]('Template,\x20%s,\x20%s',_0xc69583,_0xda97('0xd'));_0xf11d39(_0x1d89c6[_0xda97('0x13')][_0xda97('0x12')]);}})[_0xda97('0x14')](function(_0x2fe172){logger[_0xda97('0x11')]('Template,\x20%s,\x20%s',_0xc69583,_0x2fe172);_0x28021e(_0x2fe172);});});}exports['GetTemplate']=function(_0x17ac71){var _0x5299d0=this;return new Promise(function(_0x59e144,_0xa1f70e){return db['Template']['findAll']({'raw':_0x17ac71[_0xda97('0x15')]?_0x17ac71[_0xda97('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x17ac71[_0xda97('0x15')]?_0x17ac71[_0xda97('0x15')][_0xda97('0x16')]||null:null,'attributes':_0x17ac71['options']?_0x17ac71[_0xda97('0x15')][_0xda97('0x17')]||null:null,'limit':_0x17ac71[_0xda97('0x15')]?_0x17ac71[_0xda97('0x15')][_0xda97('0x18')]||null:null,'include':_0x17ac71['options']?_0x17ac71[_0xda97('0x15')][_0xda97('0x19')]?_['map'](_0x17ac71['options'][_0xda97('0x19')],function(_0x4a5b53){return{'model':db[_0x4a5b53[_0xda97('0x1a')]],'as':_0x4a5b53['as'],'attributes':_0x4a5b53[_0xda97('0x17')],'include':_0x4a5b53['include']?_[_0xda97('0x1b')](_0x4a5b53[_0xda97('0x19')],function(_0x4c44ef){return{'model':db[_0x4c44ef[_0xda97('0x1a')]],'as':_0x4c44ef['as'],'attributes':_0x4c44ef[_0xda97('0x17')],'include':_0x4c44ef[_0xda97('0x19')]?_[_0xda97('0x1b')](_0x4c44ef['include'],function(_0x4ac1f0){return{'model':db[_0x4ac1f0[_0xda97('0x1a')]],'as':_0x4ac1f0['as'],'attributes':_0x4ac1f0[_0xda97('0x17')]};}):[]};}):[]};}):[]:[]})[_0xda97('0xa')](function(_0x282770){logger[_0xda97('0xb')](_0xda97('0x1c'),_0x17ac71);logger[_0xda97('0xe')](_0xda97('0x1c'),_0x17ac71,JSON[_0xda97('0x10')](_0x282770));_0x59e144(_0x282770);})['catch'](function(_0x25f0d9){logger[_0xda97('0x11')](_0xda97('0x1c'),_0x25f0d9[_0xda97('0x12')],_0x17ac71);_0xa1f70e(_0x5299d0[_0xda97('0x11')](0x1f4,_0x25f0d9['message']));});});};
\ No newline at end of file
+var _0x5083=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTemplate','Template','findAll','options','raw','attributes','limit','include','model','map','catch','util','moment'];(function(_0x84ca62,_0x93d8c){var _0x3d11b1=function(_0x10558f){while(--_0x10558f){_0x84ca62['push'](_0x84ca62['shift']());}};_0x3d11b1(++_0x93d8c);}(_0x5083,0x11e));var _0x3508=function(_0x1e371c,_0x2bb7a3){_0x1e371c=_0x1e371c-0x0;var _0x5f3580=_0x5083[_0x1e371c];return _0x5f3580;};'use strict';var _=require('lodash');var util=require(_0x3508('0x0'));var moment=require(_0x3508('0x1'));var BPromise=require(_0x3508('0x2'));var rs=require(_0x3508('0x3'));var fs=require('fs');var Redis=require(_0x3508('0x4'));var db=require(_0x3508('0x5'))['db'];var utils=require(_0x3508('0x6'));var logger=require(_0x3508('0x7'))('rpc');var config=require(_0x3508('0x8'));var jayson=require(_0x3508('0x9'));var client=jayson[_0x3508('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dd23a,_0x58e5ff,_0x37a323){return new BPromise(function(_0x249734,_0x52c9ed){return client['request'](_0x3dd23a,_0x37a323)[_0x3508('0xb')](function(_0x581369){logger['info'](_0x3508('0xc'),_0x58e5ff,_0x3508('0xd'));logger[_0x3508('0xe')](_0x3508('0xf'),_0x58e5ff,'request\x20sent',JSON[_0x3508('0x10')](_0x581369));if(_0x581369[_0x3508('0x11')]){if(_0x581369[_0x3508('0x11')][_0x3508('0x12')]===0x1f4){logger[_0x3508('0x11')](_0x3508('0xc'),_0x58e5ff,_0x581369[_0x3508('0x11')][_0x3508('0x13')]);return _0x52c9ed(_0x581369[_0x3508('0x11')][_0x3508('0x13')]);}logger[_0x3508('0x11')](_0x3508('0xc'),_0x58e5ff,_0x581369[_0x3508('0x11')][_0x3508('0x13')]);return _0x249734(_0x581369[_0x3508('0x11')][_0x3508('0x13')]);}else{logger['info'](_0x3508('0xc'),_0x58e5ff,_0x3508('0xd'));_0x249734(_0x581369[_0x3508('0x14')]['message']);}})['catch'](function(_0x229056){logger[_0x3508('0x11')](_0x3508('0xc'),_0x58e5ff,_0x229056);_0x52c9ed(_0x229056);});});}exports[_0x3508('0x15')]=function(_0x2645cf){var _0x22b828=this;return new Promise(function(_0x3ba624,_0x2f0229){return db[_0x3508('0x16')][_0x3508('0x17')]({'raw':_0x2645cf[_0x3508('0x18')]?_0x2645cf[_0x3508('0x18')][_0x3508('0x19')]===undefined?!![]:![]:!![],'where':_0x2645cf[_0x3508('0x18')]?_0x2645cf[_0x3508('0x18')]['where']||null:null,'attributes':_0x2645cf[_0x3508('0x18')]?_0x2645cf[_0x3508('0x18')][_0x3508('0x1a')]||null:null,'limit':_0x2645cf['options']?_0x2645cf[_0x3508('0x18')][_0x3508('0x1b')]||null:null,'include':_0x2645cf['options']?_0x2645cf[_0x3508('0x18')][_0x3508('0x1c')]?_['map'](_0x2645cf[_0x3508('0x18')][_0x3508('0x1c')],function(_0x4705d4){return{'model':db[_0x4705d4[_0x3508('0x1d')]],'as':_0x4705d4['as'],'attributes':_0x4705d4[_0x3508('0x1a')],'include':_0x4705d4[_0x3508('0x1c')]?_[_0x3508('0x1e')](_0x4705d4[_0x3508('0x1c')],function(_0x4bfd64){return{'model':db[_0x4bfd64['model']],'as':_0x4bfd64['as'],'attributes':_0x4bfd64[_0x3508('0x1a')],'include':_0x4bfd64[_0x3508('0x1c')]?_[_0x3508('0x1e')](_0x4bfd64['include'],function(_0x21e398){return{'model':db[_0x21e398[_0x3508('0x1d')]],'as':_0x21e398['as'],'attributes':_0x21e398[_0x3508('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x35ab7e){logger['info'](_0x3508('0x15'),_0x2645cf);logger['debug'](_0x3508('0x15'),_0x2645cf,JSON[_0x3508('0x10')](_0x35ab7e));_0x3ba624(_0x35ab7e);})[_0x3508('0x1f')](function(_0x14e1cf){logger[_0x3508('0x11')](_0x3508('0x15'),_0x14e1cf[_0x3508('0x13')],_0x2645cf);_0x2f0229(_0x22b828[_0x3508('0x11')](0x1f4,_0x14e1cf[_0x3508('0x13')]));});});};
\ No newline at end of file
index a5dd781..fa2efe9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb04a=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions','update','delete','destroy','exports','multer'];(function(_0x3835ec,_0x49c314){var _0x9d029c=function(_0x26c2c7){while(--_0x26c2c7){_0x3835ec['push'](_0x3835ec['shift']());}};_0x9d029c(++_0x49c314);}(_0xb04a,0x1ed));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xab04('0x0'));var util=require(_0xab04('0x1'));var path=require('path');var timeout=require(_0xab04('0x2'));var express=require(_0xab04('0x3'));var router=express[_0xab04('0x4')]();var fs_extra=require(_0xab04('0x5'));var auth=require(_0xab04('0x6'));var interaction=require(_0xab04('0x7'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xab04('0x8')]('/',auth[_0xab04('0x9')](),controller[_0xab04('0xa')]);router[_0xab04('0x8')](_0xab04('0xb'),auth[_0xab04('0x9')](),controller[_0xab04('0xc')]);router[_0xab04('0x8')](_0xab04('0xd'),auth['isAuthenticated'](),controller[_0xab04('0xe')]);router[_0xab04('0x8')]('/:id/any_conditions',auth[_0xab04('0x9')](),controller[_0xab04('0xf')]);router[_0xab04('0x8')](_0xab04('0x10'),auth['isAuthenticated'](),controller[_0xab04('0x11')]);router[_0xab04('0x12')]('/',auth['isAuthenticated'](),controller[_0xab04('0x13')]);router[_0xab04('0x12')](_0xab04('0xd'),auth['isAuthenticated'](),controller[_0xab04('0x14')]);router[_0xab04('0x12')](_0xab04('0x15'),auth[_0xab04('0x9')](),controller['addAnyCondition']);router[_0xab04('0x12')](_0xab04('0x10'),auth[_0xab04('0x9')](),controller['addAction']);router['put'](_0xab04('0xb'),auth[_0xab04('0x9')](),controller[_0xab04('0x16')]);router[_0xab04('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xab04('0x18')]);module[_0xab04('0x19')]=router;
\ No newline at end of file
+var _0x8830=['addAllCondition','addAction','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post'];(function(_0x5c893f,_0x140e06){var _0x2a9497=function(_0xe350d6){while(--_0xe350d6){_0x5c893f['push'](_0x5c893f['shift']());}};_0x2a9497(++_0x140e06);}(_0x8830,0x181));var _0x0883=function(_0x5783d5,_0x58607b){_0x5783d5=_0x5783d5-0x0;var _0x125646=_0x8830[_0x5783d5];return _0x125646;};'use strict';var multer=require(_0x0883('0x0'));var util=require(_0x0883('0x1'));var path=require(_0x0883('0x2'));var timeout=require(_0x0883('0x3'));var express=require('express');var router=express[_0x0883('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0883('0x5'));var interaction=require(_0x0883('0x6'));var config=require(_0x0883('0x7'));var controller=require(_0x0883('0x8'));router['get']('/',auth[_0x0883('0x9')](),controller[_0x0883('0xa')]);router[_0x0883('0xb')]('/:id',auth[_0x0883('0x9')](),controller[_0x0883('0xc')]);router[_0x0883('0xb')](_0x0883('0xd'),auth[_0x0883('0x9')](),controller[_0x0883('0xe')]);router[_0x0883('0xb')](_0x0883('0xf'),auth[_0x0883('0x9')](),controller[_0x0883('0x10')]);router[_0x0883('0xb')](_0x0883('0x11'),auth['isAuthenticated'](),controller[_0x0883('0x12')]);router[_0x0883('0x13')]('/',auth[_0x0883('0x9')](),controller['create']);router[_0x0883('0x13')]('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x0883('0x14')]);router['post'](_0x0883('0xf'),auth[_0x0883('0x9')](),controller['addAnyCondition']);router[_0x0883('0x13')](_0x0883('0x11'),auth[_0x0883('0x9')](),controller[_0x0883('0x15')]);router[_0x0883('0x16')](_0x0883('0x17'),auth[_0x0883('0x9')](),controller[_0x0883('0x18')]);router['delete']('/:id',auth[_0x0883('0x9')](),controller[_0x0883('0x19')]);module[_0x0883('0x1a')]=router;
\ No newline at end of file
index 5de25d6..e2eeed2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b43=['exports','STRING','BOOLEAN','sequelize'];(function(_0x3b1106,_0x4bd523){var _0x1fbeef=function(_0x2c6889){while(--_0x2c6889){_0x3b1106['push'](_0x3b1106['shift']());}};_0x1fbeef(++_0x4bd523);}(_0x9b43,0x15b));var _0x39b4=function(_0x24da0e,_0x395249){_0x24da0e=_0x24da0e-0x0;var _0x5f470a=_0x9b43[_0x24da0e];return _0x5f470a;};'use strict';var Sequelize=require(_0x39b4('0x0'));module[_0x39b4('0x1')]={'name':{'type':Sequelize[_0x39b4('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x39b4('0x2')]},'status':{'type':Sequelize[_0x39b4('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0xde7a=['sequelize','STRING','BOOLEAN'];(function(_0x23e6bb,_0x5c2d69){var _0x1e3b4c=function(_0x1afc46){while(--_0x1afc46){_0x23e6bb['push'](_0x23e6bb['shift']());}};_0x1e3b4c(++_0x5c2d69);}(_0xde7a,0x9c));var _0xade7=function(_0x4df59e,_0x3a96ac){_0x4df59e=_0x4df59e-0x0;var _0x2a888a=_0xde7a[_0x4df59e];return _0x2a888a;};'use strict';var Sequelize=require(_0xade7('0x0'));module['exports']={'name':{'type':Sequelize[_0xade7('0x1')]},'channel':{'type':Sequelize[_0xade7('0x1')]},'description':{'type':Sequelize[_0xade7('0x1')]},'status':{'type':Sequelize[_0xade7('0x2')],'defaultValue':![]}};
\ No newline at end of file
index f9618c4..bbca94d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1f6=['getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','save','update','then','destroy','get','UserProfileResource','end','name','map','Trigger','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','find','create','body','user','role','Triggers','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','order','getAnyConditions','findOne','nolimit','addAction','TriggerId','Action'];(function(_0x12cbcb,_0x315bff){var _0x37a179=function(_0x984e1d){while(--_0x984e1d){_0x12cbcb['push'](_0x12cbcb['shift']());}};_0x37a179(++_0x315bff);}(_0xd1f6,0x1d7));var _0x6d1f=function(_0x43d367,_0x27b214){_0x43d367=_0x43d367-0x0;var _0x508d23=_0xd1f6[_0x43d367];return _0x508d23;};'use strict';var emlformat=require(_0x6d1f('0x0'));var rimraf=require(_0x6d1f('0x1'));var zipdir=require(_0x6d1f('0x2'));var jsonpatch=require(_0x6d1f('0x3'));var rp=require(_0x6d1f('0x4'));var moment=require(_0x6d1f('0x5'));var BPromise=require(_0x6d1f('0x6'));var Mustache=require(_0x6d1f('0x7'));var util=require('util');var path=require(_0x6d1f('0x8'));var sox=require(_0x6d1f('0x9'));var csv=require('to-csv');var ejs=require(_0x6d1f('0xa'));var fs=require('fs');var fs_extra=require(_0x6d1f('0xb'));var _=require(_0x6d1f('0xc'));var squel=require(_0x6d1f('0xd'));var crypto=require(_0x6d1f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6d1f('0xf'));var toCsv=require(_0x6d1f('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d1f('0x11'));var authService=require(_0x6d1f('0x12'));var qs=require(_0x6d1f('0x13'));var as=require(_0x6d1f('0x14'));var hardwareService=require(_0x6d1f('0x15'));var logger=require(_0x6d1f('0x16'))(_0x6d1f('0x17'));var utils=require(_0x6d1f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x6d1f('0x19'));var db=require(_0x6d1f('0x1a'))['db'];function respondWithStatusCode(_0x38d978,_0x22d3d1){_0x22d3d1=_0x22d3d1||0xcc;return function(_0xa02840){if(_0xa02840){return _0x38d978[_0x6d1f('0x1b')](_0x22d3d1);}return _0x38d978[_0x6d1f('0x1c')](_0x22d3d1)['end']();};}function respondWithResult(_0x34ec2b,_0x2b07b1){_0x2b07b1=_0x2b07b1||0xc8;return function(_0x25f6b4){if(_0x25f6b4){return _0x34ec2b[_0x6d1f('0x1c')](_0x2b07b1)['json'](_0x25f6b4);}};}function respondWithFilteredResult(_0x10697,_0x8319e3){return function(_0x3f8c95){if(_0x3f8c95){var _0x292d0e=typeof _0x8319e3[_0x6d1f('0x1d')]===_0x6d1f('0x1e')&&typeof _0x8319e3[_0x6d1f('0x1f')]==='undefined';var _0x198e04=_0x3f8c95[_0x6d1f('0x20')];var _0x310876=_0x292d0e?0x0:_0x8319e3[_0x6d1f('0x1d')];var _0x3aa6cd=_0x292d0e?_0x3f8c95[_0x6d1f('0x20')]:_0x8319e3[_0x6d1f('0x1d')]+_0x8319e3['limit'];var _0x1e8f01;if(_0x3aa6cd>=_0x198e04){_0x3aa6cd=_0x198e04;_0x1e8f01=0xc8;}else{_0x1e8f01=0xce;}_0x10697[_0x6d1f('0x1c')](_0x1e8f01);return _0x10697[_0x6d1f('0x21')]('Content-Range',_0x310876+'-'+_0x3aa6cd+'/'+_0x198e04)[_0x6d1f('0x22')](_0x3f8c95);}return null;};}function patchUpdates(_0x1b7593){return function(_0x46f9e6){try{jsonpatch[_0x6d1f('0x23')](_0x46f9e6,_0x1b7593,!![]);}catch(_0x2a3142){return BPromise['reject'](_0x2a3142);}return _0x46f9e6[_0x6d1f('0x24')]();};}function saveUpdates(_0x1eb99b,_0x41ede6){return function(_0x1cefb7){if(_0x1cefb7){return _0x1cefb7[_0x6d1f('0x25')](_0x1eb99b)[_0x6d1f('0x26')](function(_0x117f3f){return _0x117f3f;});}return null;};}function removeEntity(_0x12ce87,_0x4ea943){return function(_0x189dda){if(_0x189dda){return _0x189dda[_0x6d1f('0x27')]()['then'](function(){var _0x52b854=_0x189dda[_0x6d1f('0x28')]({'plain':!![]});var _0x45bc41='Triggers';return db[_0x6d1f('0x29')][_0x6d1f('0x27')]({'where':{'type':_0x45bc41,'resourceId':_0x52b854['id']}})[_0x6d1f('0x26')](function(){return _0x189dda;});})[_0x6d1f('0x26')](function(){_0x12ce87[_0x6d1f('0x1c')](0xcc)[_0x6d1f('0x2a')]();});}};}function handleEntityNotFound(_0x4604b6,_0x16ac66){return function(_0x571b44){if(!_0x571b44){_0x4604b6['sendStatus'](0x194);}return _0x571b44;};}function handleError(_0x571737,_0x407066){_0x407066=_0x407066||0x1f4;return function(_0x570fc4){logger['error'](_0x570fc4['stack']);if(_0x570fc4[_0x6d1f('0x2b')]){delete _0x570fc4[_0x6d1f('0x2b')];}_0x571737[_0x6d1f('0x1c')](_0x407066)['send'](_0x570fc4);};}exports['index']=function(_0xd82fc2,_0x139f35){var _0x30e3d0={},_0x516826={},_0x4def3a={'count':0x0,'rows':[]};var _0xd3d2ff=_[_0x6d1f('0x2c')](db[_0x6d1f('0x2d')]['rawAttributes'],function(_0x188f73){return{'name':_0x188f73[_0x6d1f('0x2e')],'type':_0x188f73[_0x6d1f('0x2f')][_0x6d1f('0x30')]};});_0x516826[_0x6d1f('0x31')]=_[_0x6d1f('0x2c')](_0xd3d2ff,_0x6d1f('0x2b'));_0x516826['query']=_['keys'](_0xd82fc2[_0x6d1f('0x32')]);_0x516826['filters']=_[_0x6d1f('0x33')](_0x516826[_0x6d1f('0x31')],_0x516826[_0x6d1f('0x32')]);_0x30e3d0[_0x6d1f('0x34')]=_[_0x6d1f('0x33')](_0x516826[_0x6d1f('0x31')],qs[_0x6d1f('0x35')](_0xd82fc2[_0x6d1f('0x32')][_0x6d1f('0x35')]));_0x30e3d0[_0x6d1f('0x34')]=_0x30e3d0['attributes'][_0x6d1f('0x36')]?_0x30e3d0[_0x6d1f('0x34')]:_0x516826[_0x6d1f('0x31')];if(!_0xd82fc2['query'][_0x6d1f('0x37')]('nolimit')){_0x30e3d0['limit']=qs[_0x6d1f('0x1f')](_0xd82fc2[_0x6d1f('0x32')][_0x6d1f('0x1f')]);_0x30e3d0[_0x6d1f('0x1d')]=qs['offset'](_0xd82fc2[_0x6d1f('0x32')][_0x6d1f('0x1d')]);}_0x30e3d0['order']=qs['sort'](_0xd82fc2[_0x6d1f('0x32')][_0x6d1f('0x38')]);_0x30e3d0[_0x6d1f('0x39')]=qs['filters'](_[_0x6d1f('0x3a')](_0xd82fc2[_0x6d1f('0x32')],_0x516826[_0x6d1f('0x3b')]),_0xd3d2ff);if(_0xd82fc2[_0x6d1f('0x32')][_0x6d1f('0x3c')]){_0x30e3d0[_0x6d1f('0x39')]=_[_0x6d1f('0x3d')](_0x30e3d0['where'],{'$or':_[_0x6d1f('0x2c')](_0xd3d2ff,function(_0x1ff0de){if(_0x1ff0de[_0x6d1f('0x2f')]!==_0x6d1f('0x3e')){var _0x1c7e41={};_0x1c7e41[_0x1ff0de[_0x6d1f('0x2b')]]={'$like':'%'+_0xd82fc2[_0x6d1f('0x32')][_0x6d1f('0x3c')]+'%'};return _0x1c7e41;}})});}_0x30e3d0=_[_0x6d1f('0x3d')]({},_0x30e3d0,_0xd82fc2[_0x6d1f('0x3f')]);var _0x3e4d9f={'where':_0x30e3d0[_0x6d1f('0x39')]};return db['Trigger']['count'](_0x3e4d9f)['then'](function(_0x136f32){_0x4def3a[_0x6d1f('0x20')]=_0x136f32;if(_0xd82fc2[_0x6d1f('0x32')][_0x6d1f('0x40')]){_0x30e3d0[_0x6d1f('0x41')]=[{'all':!![]}];}return db[_0x6d1f('0x2d')][_0x6d1f('0x42')](_0x30e3d0);})[_0x6d1f('0x26')](function(_0x56f327){_0x4def3a[_0x6d1f('0x43')]=_0x56f327;return _0x4def3a;})[_0x6d1f('0x26')](respondWithFilteredResult(_0x139f35,_0x30e3d0))[_0x6d1f('0x44')](handleError(_0x139f35,null));};exports['show']=function(_0x571682,_0x19dc04){var _0x2183b6={'raw':![],'where':{'id':_0x571682['params']['id']}},_0x4b0c31={};_0x4b0c31[_0x6d1f('0x31')]=_[_0x6d1f('0x45')](db['Trigger'][_0x6d1f('0x46')]);_0x4b0c31[_0x6d1f('0x32')]=_['keys'](_0x571682['query']);_0x4b0c31[_0x6d1f('0x3b')]=_[_0x6d1f('0x33')](_0x4b0c31[_0x6d1f('0x31')],_0x4b0c31[_0x6d1f('0x32')]);_0x2183b6[_0x6d1f('0x34')]=_[_0x6d1f('0x33')](_0x4b0c31['model'],qs[_0x6d1f('0x35')](_0x571682[_0x6d1f('0x32')][_0x6d1f('0x35')]));_0x2183b6[_0x6d1f('0x34')]=_0x2183b6[_0x6d1f('0x34')][_0x6d1f('0x36')]?_0x2183b6[_0x6d1f('0x34')]:_0x4b0c31['model'];if(_0x571682[_0x6d1f('0x32')][_0x6d1f('0x40')]){_0x2183b6[_0x6d1f('0x41')]=[{'all':!![]}];}_0x2183b6=_[_0x6d1f('0x3d')]({},_0x2183b6,_0x571682['options']);return db[_0x6d1f('0x2d')][_0x6d1f('0x47')](_0x2183b6)['then'](handleEntityNotFound(_0x19dc04,null))[_0x6d1f('0x26')](respondWithResult(_0x19dc04,null))[_0x6d1f('0x44')](handleError(_0x19dc04,null));};exports[_0x6d1f('0x48')]=function(_0x18d614,_0x514a30){return db[_0x6d1f('0x2d')][_0x6d1f('0x48')](_0x18d614[_0x6d1f('0x49')],{})[_0x6d1f('0x26')](function(_0x580fa6){var _0x35e2=_0x18d614[_0x6d1f('0x4a')][_0x6d1f('0x28')]({'plain':!![]});if(!_0x35e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35e2[_0x6d1f('0x4b')]==='user'){var _0x492d83=_0x580fa6[_0x6d1f('0x28')]({'plain':!![]});var _0x5afbd0=_0x6d1f('0x4c');return db[_0x6d1f('0x4d')][_0x6d1f('0x47')]({'where':{'name':_0x5afbd0,'userProfileId':_0x35e2['userProfileId']},'raw':!![]})[_0x6d1f('0x26')](function(_0x555481){if(_0x555481&&_0x555481[_0x6d1f('0x4e')]===0x0){return db['UserProfileResource'][_0x6d1f('0x48')]({'name':_0x492d83[_0x6d1f('0x2b')],'resourceId':_0x492d83['id'],'type':_0x555481[_0x6d1f('0x2b')],'sectionId':_0x555481['id']},{})[_0x6d1f('0x26')](function(){return _0x580fa6;});}else{return _0x580fa6;}})[_0x6d1f('0x44')](function(_0x4d5c9e){logger['error'](_0x6d1f('0x4f'),_0x4d5c9e);throw _0x4d5c9e;});}return _0x580fa6;})[_0x6d1f('0x26')](respondWithResult(_0x514a30,0xc9))[_0x6d1f('0x44')](handleError(_0x514a30,null));};exports['update']=function(_0x1160fc,_0x5303c1){if(_0x1160fc[_0x6d1f('0x49')]['id']){delete _0x1160fc[_0x6d1f('0x49')]['id'];}return db[_0x6d1f('0x2d')][_0x6d1f('0x47')]({'where':{'id':_0x1160fc[_0x6d1f('0x50')]['id']}})[_0x6d1f('0x26')](handleEntityNotFound(_0x5303c1,null))[_0x6d1f('0x26')](saveUpdates(_0x1160fc[_0x6d1f('0x49')],null))[_0x6d1f('0x26')](respondWithResult(_0x5303c1,null))['catch'](handleError(_0x5303c1,null));};exports[_0x6d1f('0x27')]=function(_0x575d03,_0x4f84b2){return db[_0x6d1f('0x2d')][_0x6d1f('0x47')]({'where':{'id':_0x575d03[_0x6d1f('0x50')]['id']}})[_0x6d1f('0x26')](handleEntityNotFound(_0x4f84b2,null))['then'](removeEntity(_0x4f84b2,null))[_0x6d1f('0x44')](handleError(_0x4f84b2,null));};exports[_0x6d1f('0x51')]=function(_0x41331a,_0x309b2a,_0x1a4b61){if(_0x41331a['body']['id']){delete _0x41331a[_0x6d1f('0x49')]['id'];}return db[_0x6d1f('0x2d')][_0x6d1f('0x47')]({'where':{'id':_0x41331a[_0x6d1f('0x50')]['id']}})[_0x6d1f('0x26')](handleEntityNotFound(_0x309b2a,null))[_0x6d1f('0x26')](function(_0x58f587){if(_0x58f587){_0x41331a['body'][_0x6d1f('0x52')]=_0x58f587['id'];return db[_0x6d1f('0x53')][_0x6d1f('0x48')](_0x41331a[_0x6d1f('0x49')]);}})[_0x6d1f('0x26')](respondWithResult(_0x309b2a,null))[_0x6d1f('0x44')](handleError(_0x309b2a,null));};exports[_0x6d1f('0x54')]=function(_0x284937,_0x9c1a0c,_0x2a4abc){if(_0x284937['body']['id']){delete _0x284937[_0x6d1f('0x49')]['id'];}return db[_0x6d1f('0x2d')][_0x6d1f('0x47')]({'where':{'id':_0x284937[_0x6d1f('0x50')]['id']}})[_0x6d1f('0x26')](handleEntityNotFound(_0x9c1a0c,null))[_0x6d1f('0x26')](function(_0x2a0929){if(_0x2a0929){_0x284937[_0x6d1f('0x49')]['TriggerAnyId']=_0x2a0929['id'];return db['Condition']['create'](_0x284937[_0x6d1f('0x49')]);}})['then'](respondWithResult(_0x9c1a0c,null))[_0x6d1f('0x44')](handleError(_0x9c1a0c,null));};exports[_0x6d1f('0x55')]=function(_0x2ca682,_0x305afd,_0x4a5806){var _0x490744={};var _0x487571={};var _0x2936f8;var _0x4c2079;return db['Trigger']['findOne']({'where':{'id':_0x2ca682['params']['id']}})[_0x6d1f('0x26')](handleEntityNotFound(_0x305afd,null))[_0x6d1f('0x26')](function(_0x12011d){if(_0x12011d){_0x2936f8=_0x12011d;_0x487571[_0x6d1f('0x31')]=_[_0x6d1f('0x45')](db['Condition'][_0x6d1f('0x46')]);_0x487571[_0x6d1f('0x32')]=_['keys'](_0x2ca682[_0x6d1f('0x32')]);_0x487571[_0x6d1f('0x3b')]=_[_0x6d1f('0x33')](_0x487571[_0x6d1f('0x31')],_0x487571['query']);_0x490744[_0x6d1f('0x34')]=_[_0x6d1f('0x33')](_0x487571[_0x6d1f('0x31')],qs['fields'](_0x2ca682['query']['fields']));_0x490744['attributes']=_0x490744[_0x6d1f('0x34')][_0x6d1f('0x36')]?_0x490744[_0x6d1f('0x34')]:_0x487571[_0x6d1f('0x31')];_0x490744[_0x6d1f('0x56')]=qs[_0x6d1f('0x38')](_0x2ca682[_0x6d1f('0x32')][_0x6d1f('0x38')]);_0x490744[_0x6d1f('0x39')]=qs[_0x6d1f('0x3b')](_[_0x6d1f('0x3a')](_0x2ca682[_0x6d1f('0x32')],_0x487571[_0x6d1f('0x3b')]));if(_0x2ca682[_0x6d1f('0x32')][_0x6d1f('0x3c')]){_0x490744[_0x6d1f('0x39')]=_[_0x6d1f('0x3d')](_0x490744[_0x6d1f('0x39')],{'$or':_['map'](_0x490744[_0x6d1f('0x34')],function(_0x4ac828){var _0x599c40={};_0x599c40[_0x4ac828]={'$like':'%'+_0x2ca682[_0x6d1f('0x32')][_0x6d1f('0x3c')]+'%'};return _0x599c40;})});}_0x490744=_[_0x6d1f('0x3d')]({},_0x490744,_0x2ca682[_0x6d1f('0x3f')]);return _0x2936f8[_0x6d1f('0x55')](_0x490744);}})[_0x6d1f('0x26')](function(_0x4e7405){if(_0x4e7405){_0x4c2079=_0x4e7405[_0x6d1f('0x36')];if(!_0x2ca682[_0x6d1f('0x32')][_0x6d1f('0x37')]('nolimit')){_0x490744['limit']=qs[_0x6d1f('0x1f')](_0x2ca682['query']['limit']);_0x490744[_0x6d1f('0x1d')]=qs[_0x6d1f('0x1d')](_0x2ca682[_0x6d1f('0x32')][_0x6d1f('0x1d')]);}return _0x2936f8[_0x6d1f('0x55')](_0x490744);}})['then'](function(_0x34dcff){if(_0x34dcff){return _0x34dcff?{'count':_0x4c2079,'rows':_0x34dcff}:null;}})[_0x6d1f('0x26')](respondWithResult(_0x305afd,null))[_0x6d1f('0x44')](handleError(_0x305afd,null));};exports[_0x6d1f('0x57')]=function(_0x344fa7,_0xa90202,_0x5b424e){var _0x2efc84={};var _0x3083ff={};var _0x5039d4;var _0x1f6986;return db[_0x6d1f('0x2d')][_0x6d1f('0x58')]({'where':{'id':_0x344fa7['params']['id']}})['then'](handleEntityNotFound(_0xa90202,null))[_0x6d1f('0x26')](function(_0x2c14b9){if(_0x2c14b9){_0x5039d4=_0x2c14b9;_0x3083ff[_0x6d1f('0x31')]=_[_0x6d1f('0x45')](db[_0x6d1f('0x53')][_0x6d1f('0x46')]);_0x3083ff[_0x6d1f('0x32')]=_[_0x6d1f('0x45')](_0x344fa7[_0x6d1f('0x32')]);_0x3083ff[_0x6d1f('0x3b')]=_[_0x6d1f('0x33')](_0x3083ff[_0x6d1f('0x31')],_0x3083ff['query']);_0x2efc84[_0x6d1f('0x34')]=_[_0x6d1f('0x33')](_0x3083ff[_0x6d1f('0x31')],qs['fields'](_0x344fa7['query'][_0x6d1f('0x35')]));_0x2efc84[_0x6d1f('0x34')]=_0x2efc84[_0x6d1f('0x34')][_0x6d1f('0x36')]?_0x2efc84[_0x6d1f('0x34')]:_0x3083ff['model'];_0x2efc84['order']=qs[_0x6d1f('0x38')](_0x344fa7['query'][_0x6d1f('0x38')]);_0x2efc84[_0x6d1f('0x39')]=qs[_0x6d1f('0x3b')](_[_0x6d1f('0x3a')](_0x344fa7[_0x6d1f('0x32')],_0x3083ff[_0x6d1f('0x3b')]));if(_0x344fa7[_0x6d1f('0x32')][_0x6d1f('0x3c')]){_0x2efc84[_0x6d1f('0x39')]=_[_0x6d1f('0x3d')](_0x2efc84[_0x6d1f('0x39')],{'$or':_[_0x6d1f('0x2c')](_0x2efc84['attributes'],function(_0x4a2aea){var _0x53e840={};_0x53e840[_0x4a2aea]={'$like':'%'+_0x344fa7['query'][_0x6d1f('0x3c')]+'%'};return _0x53e840;})});}_0x2efc84=_[_0x6d1f('0x3d')]({},_0x2efc84,_0x344fa7[_0x6d1f('0x3f')]);return _0x5039d4[_0x6d1f('0x57')](_0x2efc84);}})[_0x6d1f('0x26')](function(_0x8089f5){if(_0x8089f5){_0x1f6986=_0x8089f5[_0x6d1f('0x36')];if(!_0x344fa7[_0x6d1f('0x32')][_0x6d1f('0x37')](_0x6d1f('0x59'))){_0x2efc84['limit']=qs[_0x6d1f('0x1f')](_0x344fa7[_0x6d1f('0x32')]['limit']);_0x2efc84['offset']=qs[_0x6d1f('0x1d')](_0x344fa7[_0x6d1f('0x32')][_0x6d1f('0x1d')]);}return _0x5039d4[_0x6d1f('0x57')](_0x2efc84);}})[_0x6d1f('0x26')](function(_0x5be8ac){if(_0x5be8ac){return _0x5be8ac?{'count':_0x1f6986,'rows':_0x5be8ac}:null;}})[_0x6d1f('0x26')](respondWithResult(_0xa90202,null))[_0x6d1f('0x44')](handleError(_0xa90202,null));};exports[_0x6d1f('0x5a')]=function(_0x58fa40,_0x57aae0,_0x3a7b8d){if(_0x58fa40[_0x6d1f('0x49')]['id']){delete _0x58fa40[_0x6d1f('0x49')]['id'];}return db[_0x6d1f('0x2d')][_0x6d1f('0x47')]({'where':{'id':_0x58fa40['params']['id']}})[_0x6d1f('0x26')](handleEntityNotFound(_0x57aae0,null))['then'](function(_0x23703f){if(_0x23703f){_0x58fa40['body'][_0x6d1f('0x5b')]=_0x23703f['id'];return db[_0x6d1f('0x5c')][_0x6d1f('0x48')](_0x58fa40[_0x6d1f('0x49')]);}})[_0x6d1f('0x26')](respondWithResult(_0x57aae0,null))[_0x6d1f('0x44')](handleError(_0x57aae0,null));};exports['getActions']=function(_0x4f097b,_0x1e65ff,_0x50f44c){var _0x413d9b={};var _0xca7d1a={};var _0x5964f7;var _0x393205;return db[_0x6d1f('0x2d')][_0x6d1f('0x58')]({'where':{'id':_0x4f097b[_0x6d1f('0x50')]['id']}})[_0x6d1f('0x26')](handleEntityNotFound(_0x1e65ff,null))[_0x6d1f('0x26')](function(_0x17875d){if(_0x17875d){_0x5964f7=_0x17875d;_0xca7d1a['model']=_[_0x6d1f('0x45')](db[_0x6d1f('0x5c')][_0x6d1f('0x46')]);_0xca7d1a[_0x6d1f('0x32')]=_[_0x6d1f('0x45')](_0x4f097b['query']);_0xca7d1a['filters']=_[_0x6d1f('0x33')](_0xca7d1a[_0x6d1f('0x31')],_0xca7d1a['query']);_0x413d9b['attributes']=_[_0x6d1f('0x33')](_0xca7d1a['model'],qs[_0x6d1f('0x35')](_0x4f097b[_0x6d1f('0x32')][_0x6d1f('0x35')]));_0x413d9b['attributes']=_0x413d9b['attributes'][_0x6d1f('0x36')]?_0x413d9b[_0x6d1f('0x34')]:_0xca7d1a['model'];_0x413d9b[_0x6d1f('0x56')]=qs[_0x6d1f('0x38')](_0x4f097b[_0x6d1f('0x32')][_0x6d1f('0x38')]);_0x413d9b[_0x6d1f('0x39')]=qs['filters'](_[_0x6d1f('0x3a')](_0x4f097b[_0x6d1f('0x32')],_0xca7d1a[_0x6d1f('0x3b')]));if(_0x4f097b['query'][_0x6d1f('0x3c')]){_0x413d9b[_0x6d1f('0x39')]=_[_0x6d1f('0x3d')](_0x413d9b[_0x6d1f('0x39')],{'$or':_[_0x6d1f('0x2c')](_0x413d9b['attributes'],function(_0x37760e){var _0x1ed101={};_0x1ed101[_0x37760e]={'$like':'%'+_0x4f097b['query'][_0x6d1f('0x3c')]+'%'};return _0x1ed101;})});}_0x413d9b=_[_0x6d1f('0x3d')]({},_0x413d9b,_0x4f097b[_0x6d1f('0x3f')]);return _0x5964f7[_0x6d1f('0x5d')](_0x413d9b);}})[_0x6d1f('0x26')](function(_0x306d14){if(_0x306d14){_0x393205=_0x306d14[_0x6d1f('0x36')];if(!_0x4f097b[_0x6d1f('0x32')]['hasOwnProperty'](_0x6d1f('0x59'))){_0x413d9b['limit']=qs[_0x6d1f('0x1f')](_0x4f097b[_0x6d1f('0x32')][_0x6d1f('0x1f')]);_0x413d9b[_0x6d1f('0x1d')]=qs[_0x6d1f('0x1d')](_0x4f097b[_0x6d1f('0x32')]['offset']);}return _0x5964f7[_0x6d1f('0x5d')](_0x413d9b);}})[_0x6d1f('0x26')](function(_0x2b795f){if(_0x2b795f){return _0x2b795f?{'count':_0x393205,'rows':_0x2b795f}:null;}})['then'](respondWithResult(_0x1e65ff,null))[_0x6d1f('0x44')](handleError(_0x1e65ff,null));};
\ No newline at end of file
+var _0x0807=['getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','sort','filters','pick','where','merge','map','VIRTUAL','filter','options','count','includeAll','include','Trigger','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','catch','find','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','order','getAllConditions','length','hasOwnProperty'];(function(_0x43444b,_0x8cf95b){var _0x392fe5=function(_0x7a1a82){while(--_0x7a1a82){_0x43444b['push'](_0x43444b['shift']());}};_0x392fe5(++_0x8cf95b);}(_0x0807,0x69));var _0x7080=function(_0x2d4524,_0x52607d){_0x2d4524=_0x2d4524-0x0;var _0xc04980=_0x0807[_0x2d4524];return _0xc04980;};'use strict';var emlformat=require(_0x7080('0x0'));var rimraf=require(_0x7080('0x1'));var zipdir=require(_0x7080('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7080('0x3'));var moment=require(_0x7080('0x4'));var BPromise=require(_0x7080('0x5'));var Mustache=require(_0x7080('0x6'));var util=require(_0x7080('0x7'));var path=require(_0x7080('0x8'));var sox=require(_0x7080('0x9'));var csv=require(_0x7080('0xa'));var ejs=require(_0x7080('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7080('0xc'));var squel=require(_0x7080('0xd'));var crypto=require(_0x7080('0xe'));var jsforce=require(_0x7080('0xf'));var deskjs=require(_0x7080('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7080('0x11'));var Papa=require('papaparse');var Redis=require(_0x7080('0x12'));var authService=require(_0x7080('0x13'));var qs=require(_0x7080('0x14'));var as=require(_0x7080('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7080('0x16'))(_0x7080('0x17'));var utils=require(_0x7080('0x18'));var config=require(_0x7080('0x19'));var licenseUtil=require(_0x7080('0x1a'));var db=require(_0x7080('0x1b'))['db'];function respondWithStatusCode(_0x3ee619,_0x23a5fe){_0x23a5fe=_0x23a5fe||0xcc;return function(_0x5a8a32){if(_0x5a8a32){return _0x3ee619[_0x7080('0x1c')](_0x23a5fe);}return _0x3ee619[_0x7080('0x1d')](_0x23a5fe)[_0x7080('0x1e')]();};}function respondWithResult(_0x3c6bef,_0x5635bf){_0x5635bf=_0x5635bf||0xc8;return function(_0x5c63ca){if(_0x5c63ca){return _0x3c6bef['status'](_0x5635bf)['json'](_0x5c63ca);}};}function respondWithFilteredResult(_0x56825a,_0x54e2d7){return function(_0x304329){if(_0x304329){var _0xb82a54=typeof _0x54e2d7[_0x7080('0x1f')]===_0x7080('0x20')&&typeof _0x54e2d7[_0x7080('0x21')]===_0x7080('0x20');var _0x3ea959=_0x304329['count'];var _0x481b30=_0xb82a54?0x0:_0x54e2d7[_0x7080('0x1f')];var _0x354f6f=_0xb82a54?_0x304329['count']:_0x54e2d7[_0x7080('0x1f')]+_0x54e2d7[_0x7080('0x21')];var _0x576f4b;if(_0x354f6f>=_0x3ea959){_0x354f6f=_0x3ea959;_0x576f4b=0xc8;}else{_0x576f4b=0xce;}_0x56825a[_0x7080('0x1d')](_0x576f4b);return _0x56825a[_0x7080('0x22')](_0x7080('0x23'),_0x481b30+'-'+_0x354f6f+'/'+_0x3ea959)[_0x7080('0x24')](_0x304329);}return null;};}function patchUpdates(_0x250e90){return function(_0x989be0){try{jsonpatch[_0x7080('0x25')](_0x989be0,_0x250e90,!![]);}catch(_0x23326f){return BPromise[_0x7080('0x26')](_0x23326f);}return _0x989be0[_0x7080('0x27')]();};}function saveUpdates(_0x2dddfe,_0xa9d641){return function(_0x1a6db7){if(_0x1a6db7){return _0x1a6db7[_0x7080('0x28')](_0x2dddfe)[_0x7080('0x29')](function(_0x12c9f7){return _0x12c9f7;});}return null;};}function removeEntity(_0x314e30,_0x4de41f){return function(_0x1a11e3){if(_0x1a11e3){return _0x1a11e3[_0x7080('0x2a')]()[_0x7080('0x29')](function(){var _0x1c459a=_0x1a11e3[_0x7080('0x2b')]({'plain':!![]});var _0x3ca367=_0x7080('0x2c');return db[_0x7080('0x2d')][_0x7080('0x2a')]({'where':{'type':_0x3ca367,'resourceId':_0x1c459a['id']}})['then'](function(){return _0x1a11e3;});})[_0x7080('0x29')](function(){_0x314e30[_0x7080('0x1d')](0xcc)[_0x7080('0x1e')]();});}};}function handleEntityNotFound(_0x398b1a,_0x4c84d5){return function(_0x205390){if(!_0x205390){_0x398b1a[_0x7080('0x1c')](0x194);}return _0x205390;};}function handleError(_0x4dce26,_0x1b608c){_0x1b608c=_0x1b608c||0x1f4;return function(_0xf9ae20){logger[_0x7080('0x2e')](_0xf9ae20[_0x7080('0x2f')]);if(_0xf9ae20[_0x7080('0x30')]){delete _0xf9ae20[_0x7080('0x30')];}_0x4dce26['status'](_0x1b608c)[_0x7080('0x31')](_0xf9ae20);};}exports[_0x7080('0x32')]=function(_0x16bd4c,_0x4e654e){var _0x5ca7c7={},_0x3d3614={},_0xdda243={'count':0x0,'rows':[]};var _0x2f9f47=_['map'](db['Trigger'][_0x7080('0x33')],function(_0x49b1f1){return{'name':_0x49b1f1[_0x7080('0x34')],'type':_0x49b1f1[_0x7080('0x35')][_0x7080('0x36')]};});_0x3d3614[_0x7080('0x37')]=_['map'](_0x2f9f47,_0x7080('0x30'));_0x3d3614[_0x7080('0x38')]=_[_0x7080('0x39')](_0x16bd4c[_0x7080('0x38')]);_0x3d3614['filters']=_[_0x7080('0x3a')](_0x3d3614[_0x7080('0x37')],_0x3d3614[_0x7080('0x38')]);_0x5ca7c7['attributes']=_['intersection'](_0x3d3614['model'],qs[_0x7080('0x3b')](_0x16bd4c[_0x7080('0x38')][_0x7080('0x3b')]));_0x5ca7c7[_0x7080('0x3c')]=_0x5ca7c7['attributes']['length']?_0x5ca7c7['attributes']:_0x3d3614[_0x7080('0x37')];if(!_0x16bd4c[_0x7080('0x38')]['hasOwnProperty'](_0x7080('0x3d'))){_0x5ca7c7[_0x7080('0x21')]=qs[_0x7080('0x21')](_0x16bd4c['query'][_0x7080('0x21')]);_0x5ca7c7[_0x7080('0x1f')]=qs['offset'](_0x16bd4c[_0x7080('0x38')][_0x7080('0x1f')]);}_0x5ca7c7['order']=qs[_0x7080('0x3e')](_0x16bd4c[_0x7080('0x38')][_0x7080('0x3e')]);_0x5ca7c7['where']=qs[_0x7080('0x3f')](_[_0x7080('0x40')](_0x16bd4c[_0x7080('0x38')],_0x3d3614['filters']),_0x2f9f47);if(_0x16bd4c[_0x7080('0x38')]['filter']){_0x5ca7c7[_0x7080('0x41')]=_[_0x7080('0x42')](_0x5ca7c7[_0x7080('0x41')],{'$or':_[_0x7080('0x43')](_0x2f9f47,function(_0x5f4cc8){if(_0x5f4cc8['type']!==_0x7080('0x44')){var _0x3f6844={};_0x3f6844[_0x5f4cc8['name']]={'$like':'%'+_0x16bd4c[_0x7080('0x38')][_0x7080('0x45')]+'%'};return _0x3f6844;}})});}_0x5ca7c7=_[_0x7080('0x42')]({},_0x5ca7c7,_0x16bd4c[_0x7080('0x46')]);var _0x12a69c={'where':_0x5ca7c7['where']};return db['Trigger'][_0x7080('0x47')](_0x12a69c)[_0x7080('0x29')](function(_0x3e359b){_0xdda243[_0x7080('0x47')]=_0x3e359b;if(_0x16bd4c[_0x7080('0x38')][_0x7080('0x48')]){_0x5ca7c7[_0x7080('0x49')]=[{'all':!![]}];}return db[_0x7080('0x4a')]['findAll'](_0x5ca7c7);})[_0x7080('0x29')](function(_0x1f34f6){_0xdda243[_0x7080('0x4b')]=_0x1f34f6;return _0xdda243;})[_0x7080('0x29')](respondWithFilteredResult(_0x4e654e,_0x5ca7c7))['catch'](handleError(_0x4e654e,null));};exports[_0x7080('0x4c')]=function(_0x28ffe5,_0x1b9abc){var _0x512a1c={'raw':![],'where':{'id':_0x28ffe5[_0x7080('0x4d')]['id']}},_0xbd518={};_0xbd518[_0x7080('0x37')]=_[_0x7080('0x39')](db[_0x7080('0x4a')][_0x7080('0x33')]);_0xbd518['query']=_[_0x7080('0x39')](_0x28ffe5[_0x7080('0x38')]);_0xbd518[_0x7080('0x3f')]=_[_0x7080('0x3a')](_0xbd518[_0x7080('0x37')],_0xbd518[_0x7080('0x38')]);_0x512a1c[_0x7080('0x3c')]=_[_0x7080('0x3a')](_0xbd518[_0x7080('0x37')],qs[_0x7080('0x3b')](_0x28ffe5[_0x7080('0x38')][_0x7080('0x3b')]));_0x512a1c['attributes']=_0x512a1c['attributes']['length']?_0x512a1c['attributes']:_0xbd518[_0x7080('0x37')];if(_0x28ffe5[_0x7080('0x38')][_0x7080('0x48')]){_0x512a1c[_0x7080('0x49')]=[{'all':!![]}];}_0x512a1c=_[_0x7080('0x42')]({},_0x512a1c,_0x28ffe5[_0x7080('0x46')]);return db['Trigger']['find'](_0x512a1c)['then'](handleEntityNotFound(_0x1b9abc,null))[_0x7080('0x29')](respondWithResult(_0x1b9abc,null))['catch'](handleError(_0x1b9abc,null));};exports['create']=function(_0x5a1deb,_0x2066f1){return db[_0x7080('0x4a')][_0x7080('0x4e')](_0x5a1deb[_0x7080('0x4f')],{})[_0x7080('0x29')](function(_0x47608b){var _0xaaef10=_0x5a1deb[_0x7080('0x50')][_0x7080('0x2b')]({'plain':!![]});if(!_0xaaef10)throw new Error(_0x7080('0x51'));if(_0xaaef10[_0x7080('0x52')]===_0x7080('0x50')){var _0x44fcc2=_0x47608b[_0x7080('0x2b')]({'plain':!![]});var _0x9b934f='Triggers';return db[_0x7080('0x53')]['find']({'where':{'name':_0x9b934f,'userProfileId':_0xaaef10[_0x7080('0x54')]},'raw':!![]})[_0x7080('0x29')](function(_0x16b1b1){if(_0x16b1b1&&_0x16b1b1[_0x7080('0x55')]===0x0){return db[_0x7080('0x2d')]['create']({'name':_0x44fcc2[_0x7080('0x30')],'resourceId':_0x44fcc2['id'],'type':_0x16b1b1['name'],'sectionId':_0x16b1b1['id']},{})[_0x7080('0x29')](function(){return _0x47608b;});}else{return _0x47608b;}})[_0x7080('0x56')](function(_0x47cb8b){logger[_0x7080('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47cb8b);throw _0x47cb8b;});}return _0x47608b;})[_0x7080('0x29')](respondWithResult(_0x2066f1,0xc9))['catch'](handleError(_0x2066f1,null));};exports['update']=function(_0xf66e7b,_0x474cc8){if(_0xf66e7b[_0x7080('0x4f')]['id']){delete _0xf66e7b[_0x7080('0x4f')]['id'];}return db['Trigger']['find']({'where':{'id':_0xf66e7b[_0x7080('0x4d')]['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x474cc8,null))[_0x7080('0x29')](saveUpdates(_0xf66e7b[_0x7080('0x4f')],null))[_0x7080('0x29')](respondWithResult(_0x474cc8,null))[_0x7080('0x56')](handleError(_0x474cc8,null));};exports['destroy']=function(_0x96de1f,_0x4432b6){return db[_0x7080('0x4a')][_0x7080('0x57')]({'where':{'id':_0x96de1f['params']['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x4432b6,null))[_0x7080('0x29')](removeEntity(_0x4432b6,null))[_0x7080('0x56')](handleError(_0x4432b6,null));};exports['addAllCondition']=function(_0xf69a3c,_0x154169,_0x5d0e60){if(_0xf69a3c[_0x7080('0x4f')]['id']){delete _0xf69a3c[_0x7080('0x4f')]['id'];}return db[_0x7080('0x4a')][_0x7080('0x57')]({'where':{'id':_0xf69a3c[_0x7080('0x4d')]['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x154169,null))[_0x7080('0x29')](function(_0x59fa9b){if(_0x59fa9b){_0xf69a3c[_0x7080('0x4f')][_0x7080('0x58')]=_0x59fa9b['id'];return db[_0x7080('0x59')]['create'](_0xf69a3c['body']);}})[_0x7080('0x29')](respondWithResult(_0x154169,null))[_0x7080('0x56')](handleError(_0x154169,null));};exports[_0x7080('0x5a')]=function(_0x620154,_0x55ad0d,_0x572017){if(_0x620154[_0x7080('0x4f')]['id']){delete _0x620154[_0x7080('0x4f')]['id'];}return db[_0x7080('0x4a')][_0x7080('0x57')]({'where':{'id':_0x620154[_0x7080('0x4d')]['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x55ad0d,null))[_0x7080('0x29')](function(_0x12f9f6){if(_0x12f9f6){_0x620154[_0x7080('0x4f')][_0x7080('0x5b')]=_0x12f9f6['id'];return db['Condition'][_0x7080('0x4e')](_0x620154[_0x7080('0x4f')]);}})[_0x7080('0x29')](respondWithResult(_0x55ad0d,null))[_0x7080('0x56')](handleError(_0x55ad0d,null));};exports['getAllConditions']=function(_0x33d7cc,_0x333e10,_0x38527d){var _0x5de89e={};var _0x36a5ac={};var _0x4237c3;var _0x1466d5;return db[_0x7080('0x4a')][_0x7080('0x5c')]({'where':{'id':_0x33d7cc[_0x7080('0x4d')]['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x333e10,null))[_0x7080('0x29')](function(_0x2bb29e){if(_0x2bb29e){_0x4237c3=_0x2bb29e;_0x36a5ac[_0x7080('0x37')]=_['keys'](db[_0x7080('0x59')][_0x7080('0x33')]);_0x36a5ac[_0x7080('0x38')]=_[_0x7080('0x39')](_0x33d7cc[_0x7080('0x38')]);_0x36a5ac[_0x7080('0x3f')]=_[_0x7080('0x3a')](_0x36a5ac['model'],_0x36a5ac[_0x7080('0x38')]);_0x5de89e[_0x7080('0x3c')]=_['intersection'](_0x36a5ac[_0x7080('0x37')],qs[_0x7080('0x3b')](_0x33d7cc[_0x7080('0x38')][_0x7080('0x3b')]));_0x5de89e[_0x7080('0x3c')]=_0x5de89e[_0x7080('0x3c')]['length']?_0x5de89e[_0x7080('0x3c')]:_0x36a5ac[_0x7080('0x37')];_0x5de89e[_0x7080('0x5d')]=qs[_0x7080('0x3e')](_0x33d7cc['query'][_0x7080('0x3e')]);_0x5de89e['where']=qs[_0x7080('0x3f')](_[_0x7080('0x40')](_0x33d7cc[_0x7080('0x38')],_0x36a5ac[_0x7080('0x3f')]));if(_0x33d7cc[_0x7080('0x38')]['filter']){_0x5de89e[_0x7080('0x41')]=_[_0x7080('0x42')](_0x5de89e['where'],{'$or':_[_0x7080('0x43')](_0x5de89e['attributes'],function(_0x4c6586){var _0x45a32e={};_0x45a32e[_0x4c6586]={'$like':'%'+_0x33d7cc[_0x7080('0x38')][_0x7080('0x45')]+'%'};return _0x45a32e;})});}_0x5de89e=_[_0x7080('0x42')]({},_0x5de89e,_0x33d7cc[_0x7080('0x46')]);return _0x4237c3[_0x7080('0x5e')](_0x5de89e);}})[_0x7080('0x29')](function(_0x5e749e){if(_0x5e749e){_0x1466d5=_0x5e749e[_0x7080('0x5f')];if(!_0x33d7cc['query'][_0x7080('0x60')]('nolimit')){_0x5de89e[_0x7080('0x21')]=qs[_0x7080('0x21')](_0x33d7cc['query'][_0x7080('0x21')]);_0x5de89e['offset']=qs['offset'](_0x33d7cc['query'][_0x7080('0x1f')]);}return _0x4237c3[_0x7080('0x5e')](_0x5de89e);}})[_0x7080('0x29')](function(_0x7610d){if(_0x7610d){return _0x7610d?{'count':_0x1466d5,'rows':_0x7610d}:null;}})[_0x7080('0x29')](respondWithResult(_0x333e10,null))[_0x7080('0x56')](handleError(_0x333e10,null));};exports[_0x7080('0x61')]=function(_0x570366,_0x24817f,_0x12a371){var _0x1aa0c5={};var _0x5576e6={};var _0x1d5742;var _0x477487;return db[_0x7080('0x4a')]['findOne']({'where':{'id':_0x570366['params']['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x24817f,null))['then'](function(_0x12bfdc){if(_0x12bfdc){_0x1d5742=_0x12bfdc;_0x5576e6[_0x7080('0x37')]=_[_0x7080('0x39')](db[_0x7080('0x59')][_0x7080('0x33')]);_0x5576e6[_0x7080('0x38')]=_[_0x7080('0x39')](_0x570366[_0x7080('0x38')]);_0x5576e6['filters']=_['intersection'](_0x5576e6[_0x7080('0x37')],_0x5576e6[_0x7080('0x38')]);_0x1aa0c5[_0x7080('0x3c')]=_[_0x7080('0x3a')](_0x5576e6[_0x7080('0x37')],qs[_0x7080('0x3b')](_0x570366[_0x7080('0x38')][_0x7080('0x3b')]));_0x1aa0c5['attributes']=_0x1aa0c5[_0x7080('0x3c')][_0x7080('0x5f')]?_0x1aa0c5[_0x7080('0x3c')]:_0x5576e6[_0x7080('0x37')];_0x1aa0c5[_0x7080('0x5d')]=qs[_0x7080('0x3e')](_0x570366[_0x7080('0x38')][_0x7080('0x3e')]);_0x1aa0c5['where']=qs[_0x7080('0x3f')](_[_0x7080('0x40')](_0x570366[_0x7080('0x38')],_0x5576e6[_0x7080('0x3f')]));if(_0x570366[_0x7080('0x38')][_0x7080('0x45')]){_0x1aa0c5[_0x7080('0x41')]=_[_0x7080('0x42')](_0x1aa0c5[_0x7080('0x41')],{'$or':_[_0x7080('0x43')](_0x1aa0c5[_0x7080('0x3c')],function(_0x3f6a2b){var _0x2273df={};_0x2273df[_0x3f6a2b]={'$like':'%'+_0x570366['query'][_0x7080('0x45')]+'%'};return _0x2273df;})});}_0x1aa0c5=_[_0x7080('0x42')]({},_0x1aa0c5,_0x570366[_0x7080('0x46')]);return _0x1d5742[_0x7080('0x61')](_0x1aa0c5);}})[_0x7080('0x29')](function(_0x1a4e6b){if(_0x1a4e6b){_0x477487=_0x1a4e6b[_0x7080('0x5f')];if(!_0x570366[_0x7080('0x38')][_0x7080('0x60')](_0x7080('0x3d'))){_0x1aa0c5[_0x7080('0x21')]=qs['limit'](_0x570366[_0x7080('0x38')]['limit']);_0x1aa0c5[_0x7080('0x1f')]=qs[_0x7080('0x1f')](_0x570366[_0x7080('0x38')][_0x7080('0x1f')]);}return _0x1d5742['getAnyConditions'](_0x1aa0c5);}})['then'](function(_0x268123){if(_0x268123){return _0x268123?{'count':_0x477487,'rows':_0x268123}:null;}})[_0x7080('0x29')](respondWithResult(_0x24817f,null))[_0x7080('0x56')](handleError(_0x24817f,null));};exports['addAction']=function(_0x89ec0a,_0x470a05,_0x42f94e){if(_0x89ec0a[_0x7080('0x4f')]['id']){delete _0x89ec0a[_0x7080('0x4f')]['id'];}return db[_0x7080('0x4a')]['find']({'where':{'id':_0x89ec0a['params']['id']}})[_0x7080('0x29')](handleEntityNotFound(_0x470a05,null))[_0x7080('0x29')](function(_0x1a4c54){if(_0x1a4c54){_0x89ec0a[_0x7080('0x4f')][_0x7080('0x62')]=_0x1a4c54['id'];return db[_0x7080('0x63')][_0x7080('0x4e')](_0x89ec0a['body']);}})[_0x7080('0x29')](respondWithResult(_0x470a05,null))[_0x7080('0x56')](handleError(_0x470a05,null));};exports[_0x7080('0x64')]=function(_0x14420e,_0x472c45,_0x232880){var _0x16b0ce={};var _0x146693={};var _0x5a543b;var _0x45db1c;return db['Trigger'][_0x7080('0x5c')]({'where':{'id':_0x14420e[_0x7080('0x4d')]['id']}})['then'](handleEntityNotFound(_0x472c45,null))[_0x7080('0x29')](function(_0x34f075){if(_0x34f075){_0x5a543b=_0x34f075;_0x146693[_0x7080('0x37')]=_[_0x7080('0x39')](db[_0x7080('0x63')]['rawAttributes']);_0x146693[_0x7080('0x38')]=_[_0x7080('0x39')](_0x14420e[_0x7080('0x38')]);_0x146693[_0x7080('0x3f')]=_[_0x7080('0x3a')](_0x146693['model'],_0x146693[_0x7080('0x38')]);_0x16b0ce[_0x7080('0x3c')]=_[_0x7080('0x3a')](_0x146693[_0x7080('0x37')],qs[_0x7080('0x3b')](_0x14420e[_0x7080('0x38')][_0x7080('0x3b')]));_0x16b0ce[_0x7080('0x3c')]=_0x16b0ce['attributes']['length']?_0x16b0ce['attributes']:_0x146693['model'];_0x16b0ce[_0x7080('0x5d')]=qs[_0x7080('0x3e')](_0x14420e[_0x7080('0x38')]['sort']);_0x16b0ce[_0x7080('0x41')]=qs['filters'](_['pick'](_0x14420e['query'],_0x146693['filters']));if(_0x14420e['query'][_0x7080('0x45')]){_0x16b0ce['where']=_[_0x7080('0x42')](_0x16b0ce[_0x7080('0x41')],{'$or':_[_0x7080('0x43')](_0x16b0ce[_0x7080('0x3c')],function(_0x4b306e){var _0x293ac0={};_0x293ac0[_0x4b306e]={'$like':'%'+_0x14420e['query'][_0x7080('0x45')]+'%'};return _0x293ac0;})});}_0x16b0ce=_[_0x7080('0x42')]({},_0x16b0ce,_0x14420e[_0x7080('0x46')]);return _0x5a543b[_0x7080('0x64')](_0x16b0ce);}})[_0x7080('0x29')](function(_0x16a535){if(_0x16a535){_0x45db1c=_0x16a535[_0x7080('0x5f')];if(!_0x14420e['query'][_0x7080('0x60')](_0x7080('0x3d'))){_0x16b0ce[_0x7080('0x21')]=qs[_0x7080('0x21')](_0x14420e[_0x7080('0x38')][_0x7080('0x21')]);_0x16b0ce['offset']=qs['offset'](_0x14420e[_0x7080('0x38')][_0x7080('0x1f')]);}return _0x5a543b['getActions'](_0x16b0ce);}})[_0x7080('0x29')](function(_0x54398e){if(_0x54398e){return _0x54398e?{'count':_0x45db1c,'rows':_0x54398e}:null;}})[_0x7080('0x29')](respondWithResult(_0x472c45,null))[_0x7080('0x56')](handleError(_0x472c45,null));};
\ No newline at end of file
index 1e82cb9..7cd5313 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda55=['util','moment','bluebird','request-promise','path','rimraf','./trigger.attributes','define','Trigger','tools_triggers','lodash'];(function(_0x233bee,_0x5520b6){var _0x388eec=function(_0x2ac7c1){while(--_0x2ac7c1){_0x233bee['push'](_0x233bee['shift']());}};_0x388eec(++_0x5520b6);}(_0xda55,0x6d));var _0x5da5=function(_0x4e5ff7,_0x1c555f){_0x4e5ff7=_0x4e5ff7-0x0;var _0xd3aec=_0xda55[_0x4e5ff7];return _0xd3aec;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5da5('0x7'));module['exports']=function(_0x356a37,_0x58e7b3){return _0x356a37[_0x5da5('0x8')](_0x5da5('0x9'),attributes,{'tableName':_0x5da5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7b83=['request-promise','path','../../config/environment','./trigger.attributes','exports','define','tools_triggers','lodash','util','../../config/logger','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7b83,0xa1));var _0x37b8=function(_0x54a65c,_0x1554d5){_0x54a65c=_0x54a65c-0x0;var _0x53ccb7=_0x7b83[_0x54a65c];return _0x53ccb7;};'use strict';var _=require(_0x37b8('0x0'));var util=require(_0x37b8('0x1'));var logger=require(_0x37b8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x37b8('0x3'));var rp=require(_0x37b8('0x4'));var fs=require('fs');var path=require(_0x37b8('0x5'));var rimraf=require('rimraf');var config=require(_0x37b8('0x6'));var attributes=require(_0x37b8('0x7'));module[_0x37b8('0x8')]=function(_0x2a5439,_0x4102eb){return _0x2a5439[_0x37b8('0x9')]('Trigger',attributes,{'tableName':_0x37b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fb25b4d..05e4402 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a65=['catch','ShowTrigger','find','then','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','error','code','message','info','result','Trigger','options','raw','where','attributes','include','model','map','GetTrigger','stringify'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a65,0x1a8));var _0x51a6=function(_0x5acca0,_0x203a90){_0x5acca0=_0x5acca0-0x0;var _0x4b7061=_0x1a65[_0x5acca0];return _0x4b7061;};'use strict';var _=require(_0x51a6('0x0'));var util=require(_0x51a6('0x1'));var moment=require('moment');var BPromise=require(_0x51a6('0x2'));var rs=require(_0x51a6('0x3'));var fs=require('fs');var Redis=require(_0x51a6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x51a6('0x5'))(_0x51a6('0x6'));var config=require(_0x51a6('0x7'));var jayson=require(_0x51a6('0x8'));var client=jayson[_0x51a6('0x9')][_0x51a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29e713,_0x235ef9,_0x123604){return new BPromise(function(_0x1d2d7f,_0x205b74){return client[_0x51a6('0xb')](_0x29e713,_0x123604)['then'](function(_0x5a9d95){logger['info'](_0x51a6('0xc'),_0x235ef9,_0x51a6('0xd'));logger[_0x51a6('0xe')](_0x51a6('0xf'),_0x235ef9,'request\x20sent',JSON['stringify'](_0x5a9d95));if(_0x5a9d95[_0x51a6('0x10')]){if(_0x5a9d95[_0x51a6('0x10')][_0x51a6('0x11')]===0x1f4){logger[_0x51a6('0x10')](_0x51a6('0xc'),_0x235ef9,_0x5a9d95[_0x51a6('0x10')]['message']);return _0x205b74(_0x5a9d95[_0x51a6('0x10')]['message']);}logger[_0x51a6('0x10')](_0x51a6('0xc'),_0x235ef9,_0x5a9d95[_0x51a6('0x10')]['message']);return _0x1d2d7f(_0x5a9d95[_0x51a6('0x10')][_0x51a6('0x12')]);}else{logger[_0x51a6('0x13')](_0x51a6('0xc'),_0x235ef9,_0x51a6('0xd'));_0x1d2d7f(_0x5a9d95[_0x51a6('0x14')][_0x51a6('0x12')]);}})['catch'](function(_0x3ffbee){logger[_0x51a6('0x10')](_0x51a6('0xc'),_0x235ef9,_0x3ffbee);_0x205b74(_0x3ffbee);});});}exports['GetTrigger']=function(_0x5a9596){var _0x5019c1=this;return new Promise(function(_0x430bca,_0x591f14){return db[_0x51a6('0x15')]['findAll']({'raw':_0x5a9596[_0x51a6('0x16')]?_0x5a9596[_0x51a6('0x16')][_0x51a6('0x17')]===undefined?!![]:![]:!![],'where':_0x5a9596[_0x51a6('0x16')]?_0x5a9596['options'][_0x51a6('0x18')]||null:null,'attributes':_0x5a9596[_0x51a6('0x16')]?_0x5a9596[_0x51a6('0x16')][_0x51a6('0x19')]||null:null,'limit':_0x5a9596[_0x51a6('0x16')]?_0x5a9596[_0x51a6('0x16')]['limit']||null:null,'include':_0x5a9596[_0x51a6('0x16')]?_0x5a9596[_0x51a6('0x16')][_0x51a6('0x1a')]?_['map'](_0x5a9596['options']['include'],function(_0x5d5ec9){return{'model':db[_0x5d5ec9[_0x51a6('0x1b')]],'as':_0x5d5ec9['as'],'attributes':_0x5d5ec9[_0x51a6('0x19')],'include':_0x5d5ec9[_0x51a6('0x1a')]?_[_0x51a6('0x1c')](_0x5d5ec9['include'],function(_0x1c57bd){return{'model':db[_0x1c57bd[_0x51a6('0x1b')]],'as':_0x1c57bd['as'],'attributes':_0x1c57bd['attributes'],'include':_0x1c57bd[_0x51a6('0x1a')]?_[_0x51a6('0x1c')](_0x1c57bd[_0x51a6('0x1a')],function(_0x34a186){return{'model':db[_0x34a186[_0x51a6('0x1b')]],'as':_0x34a186['as'],'attributes':_0x34a186[_0x51a6('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cf0b4){logger[_0x51a6('0x13')](_0x51a6('0x1d'),_0x5a9596);logger[_0x51a6('0xe')]('GetTrigger',_0x5a9596,JSON[_0x51a6('0x1e')](_0x2cf0b4));_0x430bca(_0x2cf0b4);})[_0x51a6('0x1f')](function(_0x257b9a){logger['error']('GetTrigger',_0x257b9a[_0x51a6('0x12')],_0x5a9596);_0x591f14(_0x5019c1[_0x51a6('0x10')](0x1f4,_0x257b9a[_0x51a6('0x12')]));});});};exports[_0x51a6('0x20')]=function(_0x2fb2ab){var _0x289630=this;return new Promise(function(_0x56f338,_0x3d3a59){return db[_0x51a6('0x15')][_0x51a6('0x21')]({'raw':_0x2fb2ab[_0x51a6('0x16')]?_0x2fb2ab[_0x51a6('0x16')][_0x51a6('0x17')]===undefined?!![]:![]:!![],'where':_0x2fb2ab[_0x51a6('0x16')]?_0x2fb2ab['options'][_0x51a6('0x18')]||null:null,'attributes':_0x2fb2ab[_0x51a6('0x16')]?_0x2fb2ab[_0x51a6('0x16')]['attributes']||null:null,'include':_0x2fb2ab[_0x51a6('0x16')]?_0x2fb2ab['options'][_0x51a6('0x1a')]?_[_0x51a6('0x1c')](_0x2fb2ab[_0x51a6('0x16')][_0x51a6('0x1a')],function(_0x13426a){return{'model':db[_0x13426a[_0x51a6('0x1b')]],'as':_0x13426a['as'],'attributes':_0x13426a[_0x51a6('0x19')],'include':_0x13426a[_0x51a6('0x1a')]?_['map'](_0x13426a[_0x51a6('0x1a')],function(_0x1e4afc){return{'model':db[_0x1e4afc[_0x51a6('0x1b')]],'as':_0x1e4afc['as'],'attributes':_0x1e4afc[_0x51a6('0x19')],'include':_0x1e4afc['include']?_[_0x51a6('0x1c')](_0x1e4afc[_0x51a6('0x1a')],function(_0xe5f7bd){return{'model':db[_0xe5f7bd[_0x51a6('0x1b')]],'as':_0xe5f7bd['as'],'attributes':_0xe5f7bd[_0x51a6('0x19')]};}):[]};}):[]};}):[]:[]})[_0x51a6('0x22')](function(_0x34fc59){logger[_0x51a6('0x13')](_0x51a6('0x20'),_0x2fb2ab);logger[_0x51a6('0xe')](_0x51a6('0x20'),_0x2fb2ab,JSON[_0x51a6('0x1e')](_0x34fc59));_0x56f338(_0x34fc59);})[_0x51a6('0x1f')](function(_0x59154a){logger[_0x51a6('0x10')](_0x51a6('0x20'),_0x59154a[_0x51a6('0x12')],_0x2fb2ab);_0x3d3a59(_0x289630['error'](0x1f4,_0x59154a[_0x51a6('0x12')]));});});};
\ No newline at end of file
+var _0xa9dd=['info','catch','GetTrigger','findAll','options','raw','where','attributes','map','include','model','debug','find','ShowTrigger','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5c0488,_0xf1cb3b){var _0x30e6e8=function(_0x58132a){while(--_0x58132a){_0x5c0488['push'](_0x5c0488['shift']());}};_0x30e6e8(++_0xf1cb3b);}(_0xa9dd,0xe0));var _0xda9d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa9dd[_0x432682];return _0x463d05;};'use strict';var _=require(_0xda9d('0x0'));var util=require(_0xda9d('0x1'));var moment=require(_0xda9d('0x2'));var BPromise=require(_0xda9d('0x3'));var rs=require(_0xda9d('0x4'));var fs=require('fs');var Redis=require(_0xda9d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xda9d('0x6'));var logger=require(_0xda9d('0x7'))(_0xda9d('0x8'));var config=require(_0xda9d('0x9'));var jayson=require(_0xda9d('0xa'));var client=jayson[_0xda9d('0xb')][_0xda9d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38e3a3,_0x2f5a92,_0x5c60e8){return new BPromise(function(_0x319dab,_0x18a46e){return client['request'](_0x38e3a3,_0x5c60e8)[_0xda9d('0xd')](function(_0x513fd1){logger['info'](_0xda9d('0xe'),_0x2f5a92,_0xda9d('0xf'));logger['debug'](_0xda9d('0x10'),_0x2f5a92,_0xda9d('0xf'),JSON[_0xda9d('0x11')](_0x513fd1));if(_0x513fd1[_0xda9d('0x12')]){if(_0x513fd1[_0xda9d('0x12')][_0xda9d('0x13')]===0x1f4){logger['error'](_0xda9d('0xe'),_0x2f5a92,_0x513fd1['error']['message']);return _0x18a46e(_0x513fd1[_0xda9d('0x12')][_0xda9d('0x14')]);}logger[_0xda9d('0x12')](_0xda9d('0xe'),_0x2f5a92,_0x513fd1[_0xda9d('0x12')][_0xda9d('0x14')]);return _0x319dab(_0x513fd1[_0xda9d('0x12')][_0xda9d('0x14')]);}else{logger[_0xda9d('0x15')](_0xda9d('0xe'),_0x2f5a92,'request\x20sent');_0x319dab(_0x513fd1['result'][_0xda9d('0x14')]);}})[_0xda9d('0x16')](function(_0x9dc262){logger[_0xda9d('0x12')](_0xda9d('0xe'),_0x2f5a92,_0x9dc262);_0x18a46e(_0x9dc262);});});}exports[_0xda9d('0x17')]=function(_0x147b3e){var _0x1996b6=this;return new Promise(function(_0x3e4c61,_0x249a70){return db['Trigger'][_0xda9d('0x18')]({'raw':_0x147b3e[_0xda9d('0x19')]?_0x147b3e['options'][_0xda9d('0x1a')]===undefined?!![]:![]:!![],'where':_0x147b3e[_0xda9d('0x19')]?_0x147b3e[_0xda9d('0x19')][_0xda9d('0x1b')]||null:null,'attributes':_0x147b3e[_0xda9d('0x19')]?_0x147b3e[_0xda9d('0x19')][_0xda9d('0x1c')]||null:null,'limit':_0x147b3e['options']?_0x147b3e[_0xda9d('0x19')]['limit']||null:null,'include':_0x147b3e[_0xda9d('0x19')]?_0x147b3e[_0xda9d('0x19')]['include']?_[_0xda9d('0x1d')](_0x147b3e[_0xda9d('0x19')][_0xda9d('0x1e')],function(_0x49b90b){return{'model':db[_0x49b90b[_0xda9d('0x1f')]],'as':_0x49b90b['as'],'attributes':_0x49b90b[_0xda9d('0x1c')],'include':_0x49b90b[_0xda9d('0x1e')]?_[_0xda9d('0x1d')](_0x49b90b[_0xda9d('0x1e')],function(_0x49333d){return{'model':db[_0x49333d[_0xda9d('0x1f')]],'as':_0x49333d['as'],'attributes':_0x49333d['attributes'],'include':_0x49333d[_0xda9d('0x1e')]?_['map'](_0x49333d[_0xda9d('0x1e')],function(_0x22ea90){return{'model':db[_0x22ea90[_0xda9d('0x1f')]],'as':_0x22ea90['as'],'attributes':_0x22ea90['attributes']};}):[]};}):[]};}):[]:[]})[_0xda9d('0xd')](function(_0x2161a6){logger[_0xda9d('0x15')](_0xda9d('0x17'),_0x147b3e);logger[_0xda9d('0x20')](_0xda9d('0x17'),_0x147b3e,JSON['stringify'](_0x2161a6));_0x3e4c61(_0x2161a6);})[_0xda9d('0x16')](function(_0x1a280a){logger[_0xda9d('0x12')]('GetTrigger',_0x1a280a['message'],_0x147b3e);_0x249a70(_0x1996b6['error'](0x1f4,_0x1a280a['message']));});});};exports['ShowTrigger']=function(_0x2bcd99){var _0x8315a7=this;return new Promise(function(_0x1c0e81,_0x2518cd){return db['Trigger'][_0xda9d('0x21')]({'raw':_0x2bcd99[_0xda9d('0x19')]?_0x2bcd99['options'][_0xda9d('0x1a')]===undefined?!![]:![]:!![],'where':_0x2bcd99[_0xda9d('0x19')]?_0x2bcd99[_0xda9d('0x19')][_0xda9d('0x1b')]||null:null,'attributes':_0x2bcd99['options']?_0x2bcd99['options'][_0xda9d('0x1c')]||null:null,'include':_0x2bcd99[_0xda9d('0x19')]?_0x2bcd99['options'][_0xda9d('0x1e')]?_[_0xda9d('0x1d')](_0x2bcd99[_0xda9d('0x19')][_0xda9d('0x1e')],function(_0x477eee){return{'model':db[_0x477eee[_0xda9d('0x1f')]],'as':_0x477eee['as'],'attributes':_0x477eee['attributes'],'include':_0x477eee['include']?_[_0xda9d('0x1d')](_0x477eee['include'],function(_0x328131){return{'model':db[_0x328131[_0xda9d('0x1f')]],'as':_0x328131['as'],'attributes':_0x328131[_0xda9d('0x1c')],'include':_0x328131[_0xda9d('0x1e')]?_['map'](_0x328131[_0xda9d('0x1e')],function(_0x36c78c){return{'model':db[_0x36c78c[_0xda9d('0x1f')]],'as':_0x36c78c['as'],'attributes':_0x36c78c[_0xda9d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xda9d('0xd')](function(_0x4671e3){logger[_0xda9d('0x15')](_0xda9d('0x22'),_0x2bcd99);logger[_0xda9d('0x20')](_0xda9d('0x22'),_0x2bcd99,JSON[_0xda9d('0x11')](_0x4671e3));_0x1c0e81(_0x4671e3);})[_0xda9d('0x16')](function(_0x54adab){logger[_0xda9d('0x12')]('ShowTrigger',_0x54adab['message'],_0x2bcd99);_0x2518cd(_0x8315a7[_0xda9d('0x12')](0x1f4,_0x54adab[_0xda9d('0x14')]));});});};
\ No newline at end of file
index 192e2ac..a3f88e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cd9=['get','isAuthenticated','/:id','show','post','/:id/clone','create','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller'];(function(_0x5a88af,_0x3b1387){var _0x2b837c=function(_0x7a360c){while(--_0x7a360c){_0x5a88af['push'](_0x5a88af['shift']());}};_0x2b837c(++_0x3b1387);}(_0x6cd9,0x14e));var _0x96cd=function(_0x53a719,_0xc00c0c){_0x53a719=_0x53a719-0x0;var _0x270361=_0x6cd9[_0x53a719];return _0x270361;};'use strict';var multer=require(_0x96cd('0x0'));var util=require(_0x96cd('0x1'));var path=require(_0x96cd('0x2'));var timeout=require(_0x96cd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x96cd('0x4'));var auth=require(_0x96cd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x96cd('0x6'));var controller=require(_0x96cd('0x7'));router[_0x96cd('0x8')]('/',auth[_0x96cd('0x9')](),controller['index']);router[_0x96cd('0x8')](_0x96cd('0xa'),auth[_0x96cd('0x9')](),controller[_0x96cd('0xb')]);router[_0x96cd('0xc')](_0x96cd('0xd'),auth[_0x96cd('0x9')](),controller['clone']);router['post']('/',auth[_0x96cd('0x9')](),controller[_0x96cd('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x96cd('0xf')]);router['delete'](_0x96cd('0xa'),auth[_0x96cd('0x9')](),controller[_0x96cd('0x10')]);module[_0x96cd('0x11')]=router;
\ No newline at end of file
+var _0x6ea2=['../../components/interaction/service','get','index','isAuthenticated','show','post','/:id/clone','clone','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x55a7c2,_0x365314){var _0xd12715=function(_0x1ba366){while(--_0x1ba366){_0x55a7c2['push'](_0x55a7c2['shift']());}};_0xd12715(++_0x365314);}(_0x6ea2,0x117));var _0x26ea=function(_0x54d09d,_0x1d9305){_0x54d09d=_0x54d09d-0x0;var _0x5b2ba0=_0x6ea2[_0x54d09d];return _0x5b2ba0;};'use strict';var multer=require(_0x26ea('0x0'));var util=require(_0x26ea('0x1'));var path=require(_0x26ea('0x2'));var timeout=require(_0x26ea('0x3'));var express=require(_0x26ea('0x4'));var router=express[_0x26ea('0x5')]();var fs_extra=require(_0x26ea('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x26ea('0x7'));var config=require('../../config/environment');var controller=require('./trunk.controller');router[_0x26ea('0x8')]('/',auth['isAuthenticated'](),controller[_0x26ea('0x9')]);router[_0x26ea('0x8')]('/:id',auth[_0x26ea('0xa')](),controller[_0x26ea('0xb')]);router[_0x26ea('0xc')](_0x26ea('0xd'),auth[_0x26ea('0xa')](),controller[_0x26ea('0xe')]);router[_0x26ea('0xc')]('/',auth[_0x26ea('0xa')](),controller[_0x26ea('0xf')]);router[_0x26ea('0x10')](_0x26ea('0x11'),auth[_0x26ea('0xa')](),controller[_0x26ea('0x12')]);router[_0x26ea('0x13')](_0x26ea('0x11'),auth['isAuthenticated'](),controller[_0x26ea('0x14')]);module[_0x26ea('0x15')]=router;
\ No newline at end of file
index 501d049..ef25b9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaee4=['rfc2833','update','outgoing','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always','accept','refuse','uas','pai','fingerprint','certificate','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto'];(function(_0x33cb35,_0x6240ef){var _0x50a2ac=function(_0x94b55d){while(--_0x94b55d){_0x33cb35['push'](_0x33cb35['shift']());}};_0x50a2ac(++_0x6240ef);}(_0xaee4,0x1ab));var _0x4aee=function(_0x2867b7,_0xffdcec){_0x2867b7=_0x2867b7-0x0;var _0x558aff=_0xaee4[_0x2867b7];return _0x558aff;};'use strict';var Sequelize=require(_0x4aee('0x0'));module[_0x4aee('0x1')]={'name':{'type':Sequelize[_0x4aee('0x2')],'allowNull':![],'unique':_0x4aee('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x5'),'user','peer'),'allowNull':![],'defaultValue':_0x4aee('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4aee('0x6')},'callingpres':{'type':Sequelize[_0x4aee('0x4')]('ALLOWED_NOT_SCREENED',_0x4aee('0x7'),'ALLOWED_FAILED_SCREEN',_0x4aee('0x8'),_0x4aee('0x9'),_0x4aee('0xa'),'PROHIB_FAILED_SCREEN',_0x4aee('0xb'))},'deny':{'type':Sequelize[_0x4aee('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x4aee('0x2')]},'md5secret':{'type':Sequelize[_0x4aee('0x2')]},'remotesecret':{'type':Sequelize[_0x4aee('0x2')]},'transport':{'type':Sequelize[_0x4aee('0x2')],'defaultValue':_0x4aee('0xc'),'set':function(_0x4d0f03){this[_0x4aee('0xd')](_0x4aee('0xe'),_0x4d0f03?_0x4d0f03[_0x4aee('0xf')](','):null);},'get':function(){return this[_0x4aee('0x10')](_0x4aee('0xe'))?this[_0x4aee('0x10')](_0x4aee('0xe'))[_0x4aee('0x11')](','):null;},'comment':_0x4aee('0x12')},'dtmfmode':{'type':Sequelize[_0x4aee('0x4')]('rfc2833',_0x4aee('0x13'),_0x4aee('0x14'),_0x4aee('0x15'),_0x4aee('0x16')),'defaultValue':_0x4aee('0x17')},'directmedia':{'type':Sequelize[_0x4aee('0x4')]('yes','no','nonat',_0x4aee('0x18'),_0x4aee('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x4aee('0x1a'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4aee('0x2')]},'directmediadeny':{'type':Sequelize[_0x4aee('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x4aee('0x1b'),'set':function(_0x5a3c5c){this[_0x4aee('0xd')](_0x4aee('0x1c'),_0x5a3c5c?_0x5a3c5c[_0x4aee('0xf')](','):null);},'get':function(){return this[_0x4aee('0x10')](_0x4aee('0x1c'))?this['getDataValue'](_0x4aee('0x1c'))[_0x4aee('0x11')](','):null;},'comment':_0x4aee('0x1d')},'callgroup':{'type':Sequelize[_0x4aee('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x4aee('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x4aee('0x2')]},'language':{'type':Sequelize[_0x4aee('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4aee('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4aee('0x2')],'defaultValue':_0x4aee('0x1e')},'allow':{'type':Sequelize[_0x4aee('0x2')],'allowNull':![],'defaultValue':_0x4aee('0x1f'),'set':function(_0x4326e4){this[_0x4aee('0xd')](_0x4aee('0x20'),_0x4326e4?_0x4326e4['join'](';'):_0x4aee('0x1f'));},'get':function(){return this[_0x4aee('0x10')](_0x4aee('0x20'))?this[_0x4aee('0x10')](_0x4aee('0x20'))[_0x4aee('0x11')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x4aee('0x1a'),'no')},'insecure':{'type':Sequelize[_0x4aee('0x2')],'defaultValue':_0x4aee('0x21'),'set':function(_0x5dbfd1){this[_0x4aee('0xd')](_0x4aee('0x22'),_0x5dbfd1?_0x5dbfd1[_0x4aee('0xf')](','):null);},'get':function(){return this[_0x4aee('0x10')](_0x4aee('0x22'))?this['getDataValue'](_0x4aee('0x22'))[_0x4aee('0x11')](','):null;},'comment':_0x4aee('0x23')},'trustrpid':{'type':Sequelize[_0x4aee('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no',_0x4aee('0x24'))},'promiscredir':{'type':Sequelize['ENUM'](_0x4aee('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no')},'accountcode':{'type':Sequelize[_0x4aee('0x25')](0xb)},'setvar':{'type':Sequelize[_0x4aee('0x2')]},'callerid':{'type':Sequelize[_0x4aee('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x4aee('0x4')]('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0x4aee('0x2')]},'template':{'type':Sequelize[_0x4aee('0x2')]},'videosupport':{'type':Sequelize[_0x4aee('0x4')]('yes','no',_0x4aee('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4aee('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no')},'mailbox':{'type':Sequelize[_0x4aee('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x4aee('0x27'),_0x4aee('0x28'),'originate')},'session_expires':{'type':Sequelize[_0x4aee('0x25')](0xb)},'session_minse':{'type':Sequelize[_0x4aee('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0x4aee('0x4')]('uac',_0x4aee('0x29')),'defaultValue':_0x4aee('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x4aee('0x2')]},'regexten':{'type':Sequelize[_0x4aee('0x2')]},'fromdomain':{'type':Sequelize[_0x4aee('0x2')]},'fromuser':{'type':Sequelize[_0x4aee('0x2')]},'port':{'type':Sequelize[_0x4aee('0x25')](0x5)},'qualify':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no'),'defaultValue':_0x4aee('0x1a')},'keepalive':{'type':Sequelize[_0x4aee('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x4aee('0x2')]},'defaultuser':{'type':Sequelize[_0x4aee('0x2')]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4aee('0x25')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0x4aee('0x1a'),'no',_0x4aee('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4aee('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x4aee('0x25')](0xb)},'timerb':{'type':Sequelize[_0x4aee('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x4aee('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x4aee('0x2')]},'contactdeny':{'type':Sequelize[_0x4aee('0x2')]},'contactacl':{'type':Sequelize[_0x4aee('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x4aee('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x4aee('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x4aee('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x4aee('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0x4aee('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0x4aee('0x4')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no',_0x4aee('0x2b'),_0x4aee('0x2c'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x4aee('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x4aee('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x4aee('0x2')]},'dtlscapath':{'type':Sequelize[_0x4aee('0x2')]},'dtlssetup':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x2d'),_0x4aee('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x4aee('0x2')]},'usereqphone':{'type':Sequelize['ENUM'](_0x4aee('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x4aee('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4aee('0x4')](_0x4aee('0x1a'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize[_0x4aee('0x2')]},'mohinterpret':{'type':Sequelize[_0x4aee('0x2')]},'mohsuggest':{'type':Sequelize[_0x4aee('0x2')]},'parkinglot':{'type':Sequelize[_0x4aee('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4aee('0x2')],'defaultValue':_0x4aee('0x2f')},'canreinvite':{'type':Sequelize[_0x4aee('0x4')]('yes','no','nonat',_0x4aee('0x18'),_0x4aee('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x4aee('0x2')]},'otherFields':{'type':Sequelize[_0x4aee('0x2')]},'active':{'type':Sequelize[_0x4aee('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}};
\ No newline at end of file
+var _0x1d28=['nat','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','ENUM','yes','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','certificate','active','dynamic','BOOLEAN','sequelize','exports','STRING','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','shortinfo','inband','auto','nonat','update','outgoing','force_rport,comedia'];(function(_0x1c145a,_0x39594e){var _0x3a1d4b=function(_0x25fb1a){while(--_0x25fb1a){_0x1c145a['push'](_0x1c145a['shift']());}};_0x3a1d4b(++_0x39594e);}(_0x1d28,0x13d));var _0x81d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d28[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x81d2('0x0'));module[_0x81d2('0x1')]={'name':{'type':Sequelize[_0x81d2('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x81d2('0x3'),'user',_0x81d2('0x4')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x81d2('0x2')],'allowNull':![],'defaultValue':_0x81d2('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0x81d2('0x6'),_0x81d2('0x7'),_0x81d2('0x8'),_0x81d2('0x9'),_0x81d2('0xa'),_0x81d2('0xb'),_0x81d2('0xc'),_0x81d2('0xd'))},'deny':{'type':Sequelize[_0x81d2('0x2')]},'permit':{'type':Sequelize[_0x81d2('0x2')]},'secret':{'type':Sequelize[_0x81d2('0x2')]},'md5secret':{'type':Sequelize[_0x81d2('0x2')]},'remotesecret':{'type':Sequelize[_0x81d2('0x2')]},'transport':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':_0x81d2('0xe'),'set':function(_0x28070e){this[_0x81d2('0xf')]('transport',_0x28070e?_0x28070e[_0x81d2('0x10')](','):null);},'get':function(){return this[_0x81d2('0x11')](_0x81d2('0x12'))?this[_0x81d2('0x11')](_0x81d2('0x12'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM']('rfc2833','info',_0x81d2('0x13'),_0x81d2('0x14'),_0x81d2('0x15')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x81d2('0x16'),_0x81d2('0x17'),_0x81d2('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x81d2('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x81d2('0x19'),'set':function(_0x14117e){this[_0x81d2('0xf')](_0x81d2('0x1a'),_0x14117e?_0x14117e[_0x81d2('0x10')](','):null);},'get':function(){return this[_0x81d2('0x11')](_0x81d2('0x1a'))?this[_0x81d2('0x11')](_0x81d2('0x1a'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x81d2('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x81d2('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x81d2('0x2')]},'language':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x81d2('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x81d2('0x1b')},'allow':{'type':Sequelize[_0x81d2('0x2')],'allowNull':![],'defaultValue':_0x81d2('0x1c'),'set':function(_0x4a7482){this[_0x81d2('0xf')](_0x81d2('0x1d'),_0x4a7482?_0x4a7482[_0x81d2('0x10')](';'):_0x81d2('0x1c'));},'get':function(){return this[_0x81d2('0x11')](_0x81d2('0x1d'))?this[_0x81d2('0x11')](_0x81d2('0x1d'))[_0x81d2('0x1e')](';'):null;},'comment':_0x81d2('0x1f')},'autoframing':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'insecure':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':'port,invite','set':function(_0x5007e4){this[_0x81d2('0xf')]('insecure',_0x5007e4?_0x5007e4[_0x81d2('0x10')](','):null);},'get':function(){return this[_0x81d2('0x11')](_0x81d2('0x22'))?this[_0x81d2('0x11')](_0x81d2('0x22'))['split'](','):null;},'comment':_0x81d2('0x23')},'trustrpid':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x81d2('0x21'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no',_0x81d2('0x24'))},'promiscredir':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'useclientcode':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'accountcode':{'type':Sequelize[_0x81d2('0x25')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':_0x81d2('0x26')},'amaflags':{'type':Sequelize[_0x81d2('0x2')]},'callcounter':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no'),'defaultValue':_0x81d2('0x21')},'busylevel':{'type':Sequelize[_0x81d2('0x25')](0xb)},'allowoverlap':{'type':Sequelize[_0x81d2('0x20')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'allowtransfer':{'type':Sequelize[_0x81d2('0x20')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'subscribecontext':{'type':Sequelize[_0x81d2('0x2')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0x81d2('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x81d2('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x81d2('0x20')]('yes','no')},'mailbox':{'type':Sequelize[_0x81d2('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x81d2('0x28'),'refuse',_0x81d2('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x2a'),'uas'),'defaultValue':_0x81d2('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x81d2('0x2')]},'regexten':{'type':Sequelize[_0x81d2('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x81d2('0x2')]},'port':{'type':Sequelize[_0x81d2('0x25')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x81d2('0x21'),'no'),'defaultValue':_0x81d2('0x21')},'keepalive':{'type':Sequelize[_0x81d2('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x81d2('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x81d2('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x81d2('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no',_0x81d2('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x81d2('0x2')]},'callbackextension':{'type':Sequelize[_0x81d2('0x2')]},'timert1':{'type':Sequelize[_0x81d2('0x25')](0xb)},'timerb':{'type':Sequelize[_0x81d2('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0x81d2('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0x81d2('0x2')]},'contactdeny':{'type':Sequelize[_0x81d2('0x2')]},'contactacl':{'type':Sequelize[_0x81d2('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x81d2('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x81d2('0x25')](0xb)},'encryption':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x81d2('0x20')]('yes','no')},'force_avp':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'icesupport':{'type':Sequelize['ENUM']('yes','no')},'dtlsenable':{'type':Sequelize[_0x81d2('0x20')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x81d2('0x20')]('yes','no','fingerprint',_0x81d2('0x2d'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0x81d2('0x2')]},'dtlscipher':{'type':Sequelize[_0x81d2('0x2')]},'dtlscafile':{'type':Sequelize[_0x81d2('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x2e'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x81d2('0x2')]},'usereqphone':{'type':Sequelize[_0x81d2('0x20')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x81d2('0x2')]},'recordofffeature':{'type':Sequelize[_0x81d2('0x2')]},'call_limit':{'type':Sequelize[_0x81d2('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x81d2('0x21'),'no')},'vmexten':{'type':Sequelize[_0x81d2('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x81d2('0x2')]},'parkinglot':{'type':Sequelize[_0x81d2('0x2')]},'description':{'type':Sequelize[_0x81d2('0x2')]},'host':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':_0x81d2('0x2f')},'canreinvite':{'type':Sequelize[_0x81d2('0x20')](_0x81d2('0x21'),'no',_0x81d2('0x16'),_0x81d2('0x17'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x81d2('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x81d2('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x81d2('0x2')],'defaultValue':'no'}};
\ No newline at end of file
index be1d30b..9183f2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x24f590,_0xfe4232){var _0x18709b=function(_0x9c4318){while(--_0x9c4318){_0x24f590['push'](_0x24f590['shift']());}};_0x18709b(++_0xfe4232);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4cce09,_0x435f4a){_0x4cce09=_0x4cce09-0x0;var _0x59eae5=_0xd6d6[_0x4cce09];return _0x59eae5;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));};
\ No newline at end of file
+var _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x4839a2,_0x1f67eb){var _0x465147=function(_0x4eae2e){while(--_0x4eae2e){_0x4839a2['push'](_0x4839a2['shift']());}};_0x465147(++_0x1f67eb);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x24f122,_0x4c1ad9){_0x24f122=_0x24f122-0x0;var _0x36042d=_0x8d0e[_0x24f122];return _0x36042d;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));};
\ No newline at end of file
index c445016..2a4563d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30b4=['./trunk.attributes','exports','tools_trunks','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2b84d5,_0x428914){var _0x51452a=function(_0x3ddc9c){while(--_0x3ddc9c){_0x2b84d5['push'](_0x2b84d5['shift']());}};_0x51452a(++_0x428914);}(_0x30b4,0x7c));var _0x430b=function(_0x5b3e28,_0x2ad693){_0x5b3e28=_0x5b3e28-0x0;var _0x21a6f4=_0x30b4[_0x5b3e28];return _0x21a6f4;};'use strict';var _=require(_0x430b('0x0'));var util=require(_0x430b('0x1'));var logger=require(_0x430b('0x2'))('api');var moment=require(_0x430b('0x3'));var BPromise=require('bluebird');var rp=require(_0x430b('0x4'));var fs=require('fs');var path=require(_0x430b('0x5'));var rimraf=require(_0x430b('0x6'));var config=require(_0x430b('0x7'));var attributes=require(_0x430b('0x8'));module[_0x430b('0x9')]=function(_0xfd7710,_0x3d9b65){return _0xfd7710['define']('Trunk',attributes,{'tableName':_0x430b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xce40=['request-promise','rimraf','../../config/environment','define','Trunk','tools_trunks','lodash','../../config/logger','api','bluebird'];(function(_0x23eb47,_0x4fa46d){var _0x5a706d=function(_0x59fc14){while(--_0x59fc14){_0x23eb47['push'](_0x23eb47['shift']());}};_0x5a706d(++_0x4fa46d);}(_0xce40,0x114));var _0x0ce4=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xce40[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x0ce4('0x0'));var util=require('util');var logger=require(_0x0ce4('0x1'))(_0x0ce4('0x2'));var moment=require('moment');var BPromise=require(_0x0ce4('0x3'));var rp=require(_0x0ce4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0ce4('0x5'));var config=require(_0x0ce4('0x6'));var attributes=require('./trunk.attributes');module['exports']=function(_0x1cfbc9,_0x57b389){return _0x1cfbc9[_0x0ce4('0x7')](_0x0ce4('0x8'),attributes,{'tableName':_0x0ce4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b550b0b..6d20caa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fcf=['GetTrunk','Trunk','findAll','options','raw','where','attributes','model','include','map','then','find','ShowTrunk','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x101134,_0x1ed1d3){var _0xc47acc=function(_0x7ea469){while(--_0x7ea469){_0x101134['push'](_0x101134['shift']());}};_0xc47acc(++_0x1ed1d3);}(_0x6fcf,0x175));var _0xf6fc=function(_0x36284b,_0x2b7436){_0x36284b=_0x36284b-0x0;var _0x23c34a=_0x6fcf[_0x36284b];return _0x23c34a;};'use strict';var _=require(_0xf6fc('0x0'));var util=require('util');var moment=require(_0xf6fc('0x1'));var BPromise=require(_0xf6fc('0x2'));var rs=require(_0xf6fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf6fc('0x4'))['db'];var utils=require(_0xf6fc('0x5'));var logger=require(_0xf6fc('0x6'))(_0xf6fc('0x7'));var config=require(_0xf6fc('0x8'));var jayson=require(_0xf6fc('0x9'));var client=jayson[_0xf6fc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53f467,_0x1c0b9d,_0x3ba322){return new BPromise(function(_0x3a8d38,_0x598f0a){return client[_0xf6fc('0xb')](_0x53f467,_0x3ba322)['then'](function(_0x18b85c){logger['info'](_0xf6fc('0xc'),_0x1c0b9d,_0xf6fc('0xd'));logger[_0xf6fc('0xe')](_0xf6fc('0xf'),_0x1c0b9d,'request\x20sent',JSON[_0xf6fc('0x10')](_0x18b85c));if(_0x18b85c['error']){if(_0x18b85c[_0xf6fc('0x11')][_0xf6fc('0x12')]===0x1f4){logger[_0xf6fc('0x11')](_0xf6fc('0xc'),_0x1c0b9d,_0x18b85c[_0xf6fc('0x11')][_0xf6fc('0x13')]);return _0x598f0a(_0x18b85c['error'][_0xf6fc('0x13')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x1c0b9d,_0x18b85c[_0xf6fc('0x11')][_0xf6fc('0x13')]);return _0x3a8d38(_0x18b85c[_0xf6fc('0x11')][_0xf6fc('0x13')]);}else{logger[_0xf6fc('0x14')](_0xf6fc('0xc'),_0x1c0b9d,_0xf6fc('0xd'));_0x3a8d38(_0x18b85c[_0xf6fc('0x15')][_0xf6fc('0x13')]);}})[_0xf6fc('0x16')](function(_0x5b4174){logger['error'](_0xf6fc('0xc'),_0x1c0b9d,_0x5b4174);_0x598f0a(_0x5b4174);});});}exports[_0xf6fc('0x17')]=function(_0x279080){var _0x49a3f2=this;return new Promise(function(_0x33894f,_0x19fff4){return db[_0xf6fc('0x18')][_0xf6fc('0x19')]({'raw':_0x279080[_0xf6fc('0x1a')]?_0x279080[_0xf6fc('0x1a')][_0xf6fc('0x1b')]===undefined?!![]:![]:!![],'where':_0x279080[_0xf6fc('0x1a')]?_0x279080[_0xf6fc('0x1a')][_0xf6fc('0x1c')]||null:null,'attributes':_0x279080[_0xf6fc('0x1a')]?_0x279080[_0xf6fc('0x1a')][_0xf6fc('0x1d')]||null:null,'limit':_0x279080['options']?_0x279080[_0xf6fc('0x1a')]['limit']||null:null,'include':_0x279080[_0xf6fc('0x1a')]?_0x279080[_0xf6fc('0x1a')]['include']?_['map'](_0x279080[_0xf6fc('0x1a')]['include'],function(_0x23507f){return{'model':db[_0x23507f[_0xf6fc('0x1e')]],'as':_0x23507f['as'],'attributes':_0x23507f['attributes'],'include':_0x23507f[_0xf6fc('0x1f')]?_['map'](_0x23507f[_0xf6fc('0x1f')],function(_0x1dbb40){return{'model':db[_0x1dbb40[_0xf6fc('0x1e')]],'as':_0x1dbb40['as'],'attributes':_0x1dbb40[_0xf6fc('0x1d')],'include':_0x1dbb40[_0xf6fc('0x1f')]?_[_0xf6fc('0x20')](_0x1dbb40[_0xf6fc('0x1f')],function(_0x12f7c3){return{'model':db[_0x12f7c3[_0xf6fc('0x1e')]],'as':_0x12f7c3['as'],'attributes':_0x12f7c3['attributes']};}):[]};}):[]};}):[]:[]})[_0xf6fc('0x21')](function(_0x136296){logger[_0xf6fc('0x14')](_0xf6fc('0x17'),_0x279080);logger[_0xf6fc('0xe')](_0xf6fc('0x17'),_0x279080,JSON['stringify'](_0x136296));_0x33894f(_0x136296);})[_0xf6fc('0x16')](function(_0x41e823){logger[_0xf6fc('0x11')](_0xf6fc('0x17'),_0x41e823[_0xf6fc('0x13')],_0x279080);_0x19fff4(_0x49a3f2[_0xf6fc('0x11')](0x1f4,_0x41e823[_0xf6fc('0x13')]));});});};exports['ShowTrunk']=function(_0x1c2f9c){var _0x982df=this;return new Promise(function(_0xe6f7e6,_0xe765c7){return db[_0xf6fc('0x18')][_0xf6fc('0x22')]({'raw':_0x1c2f9c[_0xf6fc('0x1a')]?_0x1c2f9c[_0xf6fc('0x1a')][_0xf6fc('0x1b')]===undefined?!![]:![]:!![],'where':_0x1c2f9c[_0xf6fc('0x1a')]?_0x1c2f9c['options'][_0xf6fc('0x1c')]||null:null,'attributes':_0x1c2f9c[_0xf6fc('0x1a')]?_0x1c2f9c['options'][_0xf6fc('0x1d')]||null:null,'include':_0x1c2f9c[_0xf6fc('0x1a')]?_0x1c2f9c[_0xf6fc('0x1a')][_0xf6fc('0x1f')]?_[_0xf6fc('0x20')](_0x1c2f9c[_0xf6fc('0x1a')]['include'],function(_0x2b72f8){return{'model':db[_0x2b72f8[_0xf6fc('0x1e')]],'as':_0x2b72f8['as'],'attributes':_0x2b72f8[_0xf6fc('0x1d')],'include':_0x2b72f8[_0xf6fc('0x1f')]?_[_0xf6fc('0x20')](_0x2b72f8[_0xf6fc('0x1f')],function(_0x2911b9){return{'model':db[_0x2911b9[_0xf6fc('0x1e')]],'as':_0x2911b9['as'],'attributes':_0x2911b9[_0xf6fc('0x1d')],'include':_0x2911b9[_0xf6fc('0x1f')]?_[_0xf6fc('0x20')](_0x2911b9[_0xf6fc('0x1f')],function(_0x27750e){return{'model':db[_0x27750e[_0xf6fc('0x1e')]],'as':_0x27750e['as'],'attributes':_0x27750e[_0xf6fc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf6fc('0x21')](function(_0x16069b){logger[_0xf6fc('0x14')](_0xf6fc('0x23'),_0x1c2f9c);logger[_0xf6fc('0xe')](_0xf6fc('0x23'),_0x1c2f9c,JSON[_0xf6fc('0x10')](_0x16069b));_0xe6f7e6(_0x16069b);})[_0xf6fc('0x16')](function(_0x4534e5){logger[_0xf6fc('0x11')]('ShowTrunk',_0x4534e5[_0xf6fc('0x13')],_0x1c2f9c);_0xe765c7(_0x982df['error'](0x1f4,_0x4534e5[_0xf6fc('0x13')]));});});};
\ No newline at end of file
+var _0xe65a=['then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','options','where','attributes','include','map','model','stringify','ShowTrunk','Trunk','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0xe65a,0x148));var _0xae65=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0xe65a[_0x3ce2c4];return _0x4047c1;};'use strict';var _=require(_0xae65('0x0'));var util=require(_0xae65('0x1'));var moment=require(_0xae65('0x2'));var BPromise=require(_0xae65('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae65('0x4'));var db=require(_0xae65('0x5'))['db'];var utils=require(_0xae65('0x6'));var logger=require(_0xae65('0x7'))(_0xae65('0x8'));var config=require(_0xae65('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xae65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50557a,_0x734ca3,_0x207bf6){return new BPromise(function(_0x27a311,_0x5295be){return client[_0xae65('0xb')](_0x50557a,_0x207bf6)[_0xae65('0xc')](function(_0x597d0e){logger[_0xae65('0xd')]('Trunk,\x20%s,\x20%s',_0x734ca3,_0xae65('0xe'));logger[_0xae65('0xf')](_0xae65('0x10'),_0x734ca3,_0xae65('0xe'),JSON['stringify'](_0x597d0e));if(_0x597d0e[_0xae65('0x11')]){if(_0x597d0e[_0xae65('0x11')]['code']===0x1f4){logger['error'](_0xae65('0x12'),_0x734ca3,_0x597d0e[_0xae65('0x11')][_0xae65('0x13')]);return _0x5295be(_0x597d0e[_0xae65('0x11')][_0xae65('0x13')]);}logger[_0xae65('0x11')]('Trunk,\x20%s,\x20%s',_0x734ca3,_0x597d0e[_0xae65('0x11')][_0xae65('0x13')]);return _0x27a311(_0x597d0e[_0xae65('0x11')][_0xae65('0x13')]);}else{logger[_0xae65('0xd')]('Trunk,\x20%s,\x20%s',_0x734ca3,_0xae65('0xe'));_0x27a311(_0x597d0e[_0xae65('0x14')][_0xae65('0x13')]);}})[_0xae65('0x15')](function(_0x511a04){logger['error']('Trunk,\x20%s,\x20%s',_0x734ca3,_0x511a04);_0x5295be(_0x511a04);});});}exports[_0xae65('0x16')]=function(_0x249f60){var _0x37e19d=this;return new Promise(function(_0x4a26ec,_0x27928b){return db['Trunk']['findAll']({'raw':_0x249f60['options']?_0x249f60['options']['raw']===undefined?!![]:![]:!![],'where':_0x249f60[_0xae65('0x17')]?_0x249f60[_0xae65('0x17')][_0xae65('0x18')]||null:null,'attributes':_0x249f60[_0xae65('0x17')]?_0x249f60[_0xae65('0x17')][_0xae65('0x19')]||null:null,'limit':_0x249f60[_0xae65('0x17')]?_0x249f60[_0xae65('0x17')]['limit']||null:null,'include':_0x249f60[_0xae65('0x17')]?_0x249f60[_0xae65('0x17')][_0xae65('0x1a')]?_[_0xae65('0x1b')](_0x249f60[_0xae65('0x17')][_0xae65('0x1a')],function(_0x1c1840){return{'model':db[_0x1c1840[_0xae65('0x1c')]],'as':_0x1c1840['as'],'attributes':_0x1c1840[_0xae65('0x19')],'include':_0x1c1840['include']?_[_0xae65('0x1b')](_0x1c1840[_0xae65('0x1a')],function(_0x34c667){return{'model':db[_0x34c667[_0xae65('0x1c')]],'as':_0x34c667['as'],'attributes':_0x34c667['attributes'],'include':_0x34c667[_0xae65('0x1a')]?_[_0xae65('0x1b')](_0x34c667[_0xae65('0x1a')],function(_0x97a75b){return{'model':db[_0x97a75b[_0xae65('0x1c')]],'as':_0x97a75b['as'],'attributes':_0x97a75b[_0xae65('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x597b20){logger[_0xae65('0xd')](_0xae65('0x16'),_0x249f60);logger[_0xae65('0xf')](_0xae65('0x16'),_0x249f60,JSON[_0xae65('0x1d')](_0x597b20));_0x4a26ec(_0x597b20);})[_0xae65('0x15')](function(_0x2af31e){logger[_0xae65('0x11')](_0xae65('0x16'),_0x2af31e['message'],_0x249f60);_0x27928b(_0x37e19d[_0xae65('0x11')](0x1f4,_0x2af31e[_0xae65('0x13')]));});});};exports[_0xae65('0x1e')]=function(_0xa15f92){var _0x7c6f5c=this;return new Promise(function(_0x521e19,_0x141688){return db[_0xae65('0x1f')][_0xae65('0x20')]({'raw':_0xa15f92[_0xae65('0x17')]?_0xa15f92[_0xae65('0x17')][_0xae65('0x21')]===undefined?!![]:![]:!![],'where':_0xa15f92[_0xae65('0x17')]?_0xa15f92[_0xae65('0x17')][_0xae65('0x18')]||null:null,'attributes':_0xa15f92[_0xae65('0x17')]?_0xa15f92['options']['attributes']||null:null,'include':_0xa15f92[_0xae65('0x17')]?_0xa15f92['options']['include']?_['map'](_0xa15f92[_0xae65('0x17')][_0xae65('0x1a')],function(_0x2d2cc8){return{'model':db[_0x2d2cc8[_0xae65('0x1c')]],'as':_0x2d2cc8['as'],'attributes':_0x2d2cc8[_0xae65('0x19')],'include':_0x2d2cc8[_0xae65('0x1a')]?_[_0xae65('0x1b')](_0x2d2cc8['include'],function(_0x50e9d){return{'model':db[_0x50e9d[_0xae65('0x1c')]],'as':_0x50e9d['as'],'attributes':_0x50e9d[_0xae65('0x19')],'include':_0x50e9d[_0xae65('0x1a')]?_[_0xae65('0x1b')](_0x50e9d['include'],function(_0x5c69fe){return{'model':db[_0x5c69fe[_0xae65('0x1c')]],'as':_0x5c69fe['as'],'attributes':_0x5c69fe[_0xae65('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa380a6){logger[_0xae65('0xd')]('ShowTrunk',_0xa15f92);logger[_0xae65('0xf')]('ShowTrunk',_0xa15f92,JSON[_0xae65('0x1d')](_0xa380a6));_0x521e19(_0xa380a6);})[_0xae65('0x15')](function(_0x377456){logger[_0xae65('0x11')](_0xae65('0x1e'),_0x377456[_0xae65('0x13')],_0xa15f92);_0x141688(_0x7c6f5c[_0xae65('0x11')](0x1f4,_0x377456[_0xae65('0x13')]));});});};
\ No newline at end of file
index 871706f..b0039c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6454=['getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/square_projects','getScheduledCalls','/:id/api_key','post','addContacts','create','bulkCreate','/:id/queues','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','/:id/fax_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','update','/:id/password','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','./user.controller','get','isAuthenticated','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','getAvatar','getOpenTabs','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes'];(function(_0xa64a33,_0x4c344c){var _0x6610b=function(_0x1c7f45){while(--_0x1c7f45){_0xa64a33['push'](_0xa64a33['shift']());}};_0x6610b(++_0x4c344c);}(_0x6454,0x1a9));var _0x4645=function(_0x2dc6eb,_0x439724){_0x2dc6eb=_0x2dc6eb-0x0;var _0x2faaf1=_0x6454[_0x2dc6eb];return _0x2faaf1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4645('0x0'));var timeout=require(_0x4645('0x1'));var express=require(_0x4645('0x2'));var router=express[_0x4645('0x3')]();var fs_extra=require(_0x4645('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4645('0x5'));var controller=require(_0x4645('0x6'));router[_0x4645('0x7')]('/',auth[_0x4645('0x8')](),controller['index']);router[_0x4645('0x7')](_0x4645('0x9'),auth[_0x4645('0x8')](),controller[_0x4645('0xa')]);router[_0x4645('0x7')](_0x4645('0xb'),auth['isAuthenticated'](),controller[_0x4645('0xc')]);router[_0x4645('0x7')](_0x4645('0xd'),auth['isAuthenticated'](),controller[_0x4645('0xe')]);router['get'](_0x4645('0xf'),auth[_0x4645('0x8')](),controller['show']);router[_0x4645('0x7')]('/:id/avatar',controller[_0x4645('0x10')]);router['get']('/:id/open_tabs',auth[_0x4645('0x8')](),controller[_0x4645('0x11')]);router[_0x4645('0x7')](_0x4645('0x12'),auth['isAuthenticated'](),controller[_0x4645('0x13')]);router['get']('/:id/queues',auth[_0x4645('0x8')](),controller[_0x4645('0x14')]);router[_0x4645('0x7')]('/:id/queues_rt',auth[_0x4645('0x8')](),controller[_0x4645('0x15')]);router[_0x4645('0x7')](_0x4645('0x16'),auth[_0x4645('0x8')](),controller[_0x4645('0x17')]);router[_0x4645('0x7')](_0x4645('0x18'),auth[_0x4645('0x8')](),controller[_0x4645('0x19')]);router[_0x4645('0x7')](_0x4645('0x1a'),auth[_0x4645('0x8')](),controller[_0x4645('0x1b')]);router[_0x4645('0x7')]('/:id/chat/interactions',auth[_0x4645('0x8')](),controller[_0x4645('0x1c')]);router[_0x4645('0x7')](_0x4645('0x1d'),auth[_0x4645('0x8')](),controller[_0x4645('0x1e')]);router[_0x4645('0x7')]('/:id/mail/interactions',auth[_0x4645('0x8')](),controller[_0x4645('0x1f')]);router[_0x4645('0x7')](_0x4645('0x20'),auth['isAuthenticated'](),controller[_0x4645('0x21')]);router[_0x4645('0x7')]('/:id/fax/interactions',auth[_0x4645('0x8')](),controller[_0x4645('0x22')]);router[_0x4645('0x7')](_0x4645('0x23'),auth[_0x4645('0x8')](),controller[_0x4645('0x24')]);router['get'](_0x4645('0x25'),auth[_0x4645('0x8')](),controller['getTeams']);router[_0x4645('0x7')](_0x4645('0x26'),auth[_0x4645('0x8')](),controller[_0x4645('0x27')]);router[_0x4645('0x7')](_0x4645('0x28'),auth[_0x4645('0x8')](),controller[_0x4645('0x29')]);router['get'](_0x4645('0x2a'),auth['isAuthenticated'](),controller['getVoicePrefixes']);router['get']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x4645('0x2b')]);router[_0x4645('0x7')](_0x4645('0x2c'),auth[_0x4645('0x8')](),controller[_0x4645('0x2d')]);router[_0x4645('0x7')](_0x4645('0x2e'),auth[_0x4645('0x8')](),controller[_0x4645('0x2f')]);router[_0x4645('0x7')](_0x4645('0x30'),auth[_0x4645('0x8')](),controller[_0x4645('0x31')]);router['get'](_0x4645('0x32'),auth[_0x4645('0x8')](),controller[_0x4645('0x33')]);router['get'](_0x4645('0x34'),auth[_0x4645('0x8')](),controller['getWhatsappAccounts']);router[_0x4645('0x7')](_0x4645('0x35'),auth[_0x4645('0x8')](),controller['getSquareProjects']);router[_0x4645('0x7')]('/:id/scheduled_calls',auth[_0x4645('0x8')](),controller[_0x4645('0x36')]);router[_0x4645('0x7')](_0x4645('0x37'),auth[_0x4645('0x8')](),controller['getApiKey']);router[_0x4645('0x38')](_0x4645('0x12'),auth[_0x4645('0x8')](),controller[_0x4645('0x39')]);router[_0x4645('0x38')]('/',auth[_0x4645('0x8')](),controller[_0x4645('0x3a')]);router[_0x4645('0x38')]('/create_many',auth[_0x4645('0x8')](),controller[_0x4645('0x3b')]);router[_0x4645('0x38')](_0x4645('0x3c'),auth[_0x4645('0x8')](),controller[_0x4645('0x3d')]);var upload=multer({'storage':multer[_0x4645('0x3e')]({'destination':function(_0x296316,_0x3ce56e,_0x31807c){_0x31807c(null,path[_0x4645('0x3f')](config[_0x4645('0x40')],_0x4645('0x41')));},'filename':function(_0x2bb28b,_0x262ca2,_0x3c3bf9){_0x3c3bf9(null,util[_0x4645('0x42')](_0x4645('0x43'),Date[_0x4645('0x44')](),_0x262ca2[_0x4645('0x45')]));}})});router['post']('/:id/avatar',upload[_0x4645('0x46')](_0x4645('0x47')),controller[_0x4645('0x48')]);router[_0x4645('0x38')](_0x4645('0x49'),auth[_0x4645('0x8')](),controller[_0x4645('0x4a')]);router[_0x4645('0x38')](_0x4645('0x4b'),auth[_0x4645('0x8')](),controller[_0x4645('0x4c')]);router[_0x4645('0x38')](_0x4645('0x4d'),auth[_0x4645('0x8')](),controller[_0x4645('0x4e')]);router[_0x4645('0x38')]('/:id/unpause',auth[_0x4645('0x8')](),controller['unpause']);router[_0x4645('0x38')]('/:id/teams',auth['isAuthenticated'](),controller['addTeams']);router[_0x4645('0x38')](_0x4645('0x4f'),auth['isAuthenticated'](),controller[_0x4645('0x50')]);router[_0x4645('0x38')](_0x4645('0x51'),auth['isAuthenticated'](),controller[_0x4645('0x52')]);router[_0x4645('0x38')](_0x4645('0x53'),auth['isAuthenticated'](),controller['addFaxInteractions']);router['post'](_0x4645('0x54'),auth[_0x4645('0x8')](),controller[_0x4645('0x55')]);router[_0x4645('0x38')](_0x4645('0x56'),auth[_0x4645('0x8')](),controller['addOpenchannelInteractions']);router[_0x4645('0x38')](_0x4645('0x57'),auth[_0x4645('0x8')](),controller[_0x4645('0x58')]);router['post'](_0x4645('0x59'),auth[_0x4645('0x8')](),controller['addFaxAccounts']);router[_0x4645('0x38')](_0x4645('0x2c'),auth[_0x4645('0x8')](),controller[_0x4645('0x5a')]);router['post'](_0x4645('0x2e'),auth['isAuthenticated'](),controller[_0x4645('0x5b')]);router['post'](_0x4645('0x30'),auth[_0x4645('0x8')](),controller[_0x4645('0x5c')]);router['post'](_0x4645('0x32'),auth['isAuthenticated'](),controller[_0x4645('0x5d')]);router[_0x4645('0x38')](_0x4645('0x34'),auth['isAuthenticated'](),controller[_0x4645('0x5e')]);router['post']('/:id/square_projects',auth[_0x4645('0x8')](),controller[_0x4645('0x5f')]);router[_0x4645('0x38')](_0x4645('0x37'),auth[_0x4645('0x8')](),controller[_0x4645('0x60')]);router['put'](_0x4645('0xf'),auth['isAuthenticated'](),controller[_0x4645('0x61')]);router['put'](_0x4645('0x62'),auth[_0x4645('0x8')](),controller['changePassword']);router[_0x4645('0x63')](_0x4645('0x3c'),auth['isAuthenticated'](),controller[_0x4645('0x64')]);router['delete']('/:id/teams',auth[_0x4645('0x8')](),controller[_0x4645('0x65')]);router['delete'](_0x4645('0xf'),auth[_0x4645('0x8')](),controller[_0x4645('0x66')]);router[_0x4645('0x63')](_0x4645('0x4f'),auth[_0x4645('0x8')](),controller[_0x4645('0x67')]);router[_0x4645('0x63')]('/:id/mail_interactions',auth[_0x4645('0x8')](),controller[_0x4645('0x68')]);router[_0x4645('0x63')](_0x4645('0x53'),auth[_0x4645('0x8')](),controller[_0x4645('0x69')]);router[_0x4645('0x63')]('/:id/sms_interactions',auth[_0x4645('0x8')](),controller[_0x4645('0x6a')]);router[_0x4645('0x63')](_0x4645('0x56'),auth['isAuthenticated'](),controller[_0x4645('0x6b')]);router['delete'](_0x4645('0x57'),auth[_0x4645('0x8')](),controller[_0x4645('0x6c')]);router['delete'](_0x4645('0x59'),auth[_0x4645('0x8')](),controller[_0x4645('0x6d')]);router[_0x4645('0x63')](_0x4645('0x2c'),auth[_0x4645('0x8')](),controller[_0x4645('0x6e')]);router[_0x4645('0x63')](_0x4645('0x2e'),auth[_0x4645('0x8')](),controller['removeOpenchannelAccounts']);router[_0x4645('0x63')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x4645('0x6f')]);router[_0x4645('0x63')](_0x4645('0x32'),auth[_0x4645('0x8')](),controller[_0x4645('0x70')]);router[_0x4645('0x63')](_0x4645('0x34'),auth[_0x4645('0x8')](),controller[_0x4645('0x71')]);router[_0x4645('0x63')](_0x4645('0x35'),auth[_0x4645('0x8')](),controller[_0x4645('0x72')]);router[_0x4645('0x63')](_0x4645('0x37'),auth[_0x4645('0x8')](),controller[_0x4645('0x73')]);module[_0x4645('0x74')]=router;
\ No newline at end of file
+var _0xb922=['/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/mail_accounts','getMailAccounts','/:id/sms_accounts','/:id/chat_websites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getApiKey','addContacts','post','create','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','/:id/avatar','single','file','/:id/logout','logout','/:id/pause','pause','/:id/unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','/:id/fax_accounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','put','update','changePassword','/:id/queues','removeQueues','delete','removeTeams','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','/:id/api_key','removeApiKey','util','path','connect-timeout','express','Router','fs-extra','get','index','/describe','isAuthenticated','/whoami','/:id','show','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getQueues','/:id/queues_rt','getVoiceQueuesRt'];(function(_0x384665,_0x3077be){var _0x2e4a5d=function(_0x26785e){while(--_0x26785e){_0x384665['push'](_0x384665['shift']());}};_0x2e4a5d(++_0x3077be);}(_0xb922,0x1a0));var _0x2b92=function(_0x47e50b,_0x1fdec6){_0x47e50b=_0x47e50b-0x0;var _0x2e6fb3=_0xb922[_0x47e50b];return _0x2e6fb3;};'use strict';var multer=require('multer');var util=require(_0x2b92('0x0'));var path=require(_0x2b92('0x1'));var timeout=require(_0x2b92('0x2'));var express=require(_0x2b92('0x3'));var router=express[_0x2b92('0x4')]();var fs_extra=require(_0x2b92('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./user.controller');router[_0x2b92('0x6')]('/',auth['isAuthenticated'](),controller[_0x2b92('0x7')]);router['get'](_0x2b92('0x8'),auth[_0x2b92('0x9')](),controller['describe']);router[_0x2b92('0x6')](_0x2b92('0xa'),auth['isAuthenticated'](),controller['whoami']);router['get']('/presence',auth[_0x2b92('0x9')](),controller['getPresence']);router['get'](_0x2b92('0xb'),auth['isAuthenticated'](),controller[_0x2b92('0xc')]);router[_0x2b92('0x6')]('/:id/avatar',controller[_0x2b92('0xd')]);router['get'](_0x2b92('0xe'),auth[_0x2b92('0x9')](),controller[_0x2b92('0xf')]);router['get'](_0x2b92('0x10'),auth[_0x2b92('0x9')](),controller['getContacts']);router[_0x2b92('0x6')]('/:id/queues',auth[_0x2b92('0x9')](),controller[_0x2b92('0x11')]);router[_0x2b92('0x6')](_0x2b92('0x12'),auth['isAuthenticated'](),controller[_0x2b92('0x13')]);router['get'](_0x2b92('0x14'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x15')]);router[_0x2b92('0x6')](_0x2b92('0x16'),auth[_0x2b92('0x9')](),controller['getRecordings']);router[_0x2b92('0x6')](_0x2b92('0x17'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x18')]);router['get'](_0x2b92('0x19'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x1a')]);router['get'](_0x2b92('0x1b'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x1c')]);router[_0x2b92('0x6')](_0x2b92('0x1d'),auth[_0x2b92('0x9')](),controller['getMailInteractions']);router[_0x2b92('0x6')]('/:id/sms/interactions',auth[_0x2b92('0x9')](),controller['getSmsInteractions']);router[_0x2b92('0x6')]('/:id/fax/interactions',auth[_0x2b92('0x9')](),controller[_0x2b92('0x1e')]);router['get'](_0x2b92('0x1f'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x20')]);router[_0x2b92('0x6')](_0x2b92('0x21'),auth['isAuthenticated'](),controller[_0x2b92('0x22')]);router['get'](_0x2b92('0x23'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x24')]);router['get']('/:id/agents',auth[_0x2b92('0x9')](),controller[_0x2b92('0x25')]);router['get'](_0x2b92('0x26'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x27')]);router[_0x2b92('0x6')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['getFaxAccounts']);router['get'](_0x2b92('0x28'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x29')]);router[_0x2b92('0x6')]('/:id/openchannel_accounts',auth[_0x2b92('0x9')](),controller['getOpenchannelAccounts']);router[_0x2b92('0x6')](_0x2b92('0x2a'),auth[_0x2b92('0x9')](),controller['getSmsAccounts']);router[_0x2b92('0x6')](_0x2b92('0x2b'),auth[_0x2b92('0x9')](),controller['getChatWebsites']);router[_0x2b92('0x6')](_0x2b92('0x2c'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x2d')]);router[_0x2b92('0x6')](_0x2b92('0x2e'),auth['isAuthenticated'](),controller[_0x2b92('0x2f')]);router['get'](_0x2b92('0x30'),auth[_0x2b92('0x9')](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth['isAuthenticated'](),controller[_0x2b92('0x31')]);router['post']('/:id/contacts',auth[_0x2b92('0x9')](),controller[_0x2b92('0x32')]);router[_0x2b92('0x33')]('/',auth[_0x2b92('0x9')](),controller[_0x2b92('0x34')]);router[_0x2b92('0x33')]('/create_many',auth[_0x2b92('0x9')](),controller[_0x2b92('0x35')]);router[_0x2b92('0x33')]('/:id/queues',auth[_0x2b92('0x9')](),controller[_0x2b92('0x36')]);var upload=multer({'storage':multer[_0x2b92('0x37')]({'destination':function(_0x50f106,_0x23f83c,_0x1b8d6d){_0x1b8d6d(null,path[_0x2b92('0x38')](config[_0x2b92('0x39')],_0x2b92('0x3a')));},'filename':function(_0x253595,_0x5ba869,_0xd4e020){_0xd4e020(null,util[_0x2b92('0x3b')](_0x2b92('0x3c'),Date['now'](),_0x5ba869['originalname']));}})});router[_0x2b92('0x33')](_0x2b92('0x3d'),upload[_0x2b92('0x3e')](_0x2b92('0x3f')),controller['addAvatar']);router[_0x2b92('0x33')]('/:id/login',auth[_0x2b92('0x9')](),controller['login']);router['post'](_0x2b92('0x40'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x41')]);router[_0x2b92('0x33')](_0x2b92('0x42'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x43')]);router['post'](_0x2b92('0x44'),auth['isAuthenticated'](),controller['unpause']);router[_0x2b92('0x33')](_0x2b92('0x21'),auth[_0x2b92('0x9')](),controller['addTeams']);router[_0x2b92('0x33')](_0x2b92('0x45'),auth['isAuthenticated'](),controller[_0x2b92('0x46')]);router['post'](_0x2b92('0x47'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x48')]);router[_0x2b92('0x33')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x2b92('0x49')]);router[_0x2b92('0x33')](_0x2b92('0x4a'),auth['isAuthenticated'](),controller[_0x2b92('0x4b')]);router[_0x2b92('0x33')](_0x2b92('0x4c'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x4d')]);router[_0x2b92('0x33')]('/:id/whatsapp_interactions',auth[_0x2b92('0x9')](),controller[_0x2b92('0x4e')]);router['post'](_0x2b92('0x4f'),auth[_0x2b92('0x9')](),controller['addFaxAccounts']);router[_0x2b92('0x33')](_0x2b92('0x28'),auth['isAuthenticated'](),controller['addMailAccounts']);router['post'](_0x2b92('0x50'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x51')]);router[_0x2b92('0x33')]('/:id/sms_accounts',auth[_0x2b92('0x9')](),controller[_0x2b92('0x52')]);router[_0x2b92('0x33')](_0x2b92('0x2b'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x53')]);router['post']('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x2b92('0x54')]);router[_0x2b92('0x33')](_0x2b92('0x2e'),auth['isAuthenticated'](),controller[_0x2b92('0x55')]);router['post']('/:id/api_key',auth[_0x2b92('0x9')](),controller['createApiKey']);router[_0x2b92('0x56')]('/:id',auth[_0x2b92('0x9')](),controller[_0x2b92('0x57')]);router[_0x2b92('0x56')]('/:id/password',auth[_0x2b92('0x9')](),controller[_0x2b92('0x58')]);router['delete'](_0x2b92('0x59'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x5a')]);router[_0x2b92('0x5b')]('/:id/teams',auth[_0x2b92('0x9')](),controller[_0x2b92('0x5c')]);router[_0x2b92('0x5b')](_0x2b92('0xb'),auth[_0x2b92('0x9')](),controller['destroy']);router[_0x2b92('0x5b')]('/:id/chat_interactions',auth[_0x2b92('0x9')](),controller[_0x2b92('0x5d')]);router[_0x2b92('0x5b')](_0x2b92('0x47'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x5e')]);router[_0x2b92('0x5b')](_0x2b92('0x5f'),auth['isAuthenticated'](),controller['removeFaxInteractions']);router[_0x2b92('0x5b')]('/:id/sms_interactions',auth[_0x2b92('0x9')](),controller[_0x2b92('0x60')]);router['delete'](_0x2b92('0x4c'),auth['isAuthenticated'](),controller[_0x2b92('0x61')]);router[_0x2b92('0x5b')](_0x2b92('0x62'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x63')]);router[_0x2b92('0x5b')]('/:id/fax_accounts',auth[_0x2b92('0x9')](),controller[_0x2b92('0x64')]);router[_0x2b92('0x5b')](_0x2b92('0x28'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x65')]);router['delete'](_0x2b92('0x50'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x66')]);router[_0x2b92('0x5b')](_0x2b92('0x2a'),auth['isAuthenticated'](),controller[_0x2b92('0x67')]);router['delete'](_0x2b92('0x2b'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x68')]);router['delete'](_0x2b92('0x2c'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x69')]);router[_0x2b92('0x5b')](_0x2b92('0x2e'),auth[_0x2b92('0x9')](),controller[_0x2b92('0x6a')]);router[_0x2b92('0x5b')](_0x2b92('0x6b'),auth['isAuthenticated'](),controller[_0x2b92('0x6c')]);module['exports']=router;
\ No newline at end of file
index 70a0214..2323edc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c3b=['toLowerCase','ENUM','admin','user','telephone','INTEGER','accountcode','\x22%s\x22\x20<%s>','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','friend','peer','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlsprivatekey','rtcp_mux','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','loginAttempts','blockedAt','UNSIGNED','sequelize','moment','util','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','format','getDataValue','internal','email'];(function(_0x520bcc,_0x54aa59){var _0x55e792=function(_0x2d49a2){while(--_0x2d49a2){_0x520bcc['push'](_0x520bcc['shift']());}};_0x55e792(++_0x54aa59);}(_0x1c3b,0xab));var _0xb1c3=function(_0x44d40e,_0x5349f1){_0x44d40e=_0x44d40e-0x0;var _0x2f9a42=_0x1c3b[_0x44d40e];return _0x2f9a42;};'use strict';var Sequelize=require(_0xb1c3('0x0'));var moment=require(_0xb1c3('0x1'));var util=require(_0xb1c3('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':![],'unique':_0xb1c3('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x20e7d2){this[_0xb1c3('0x5')](_0xb1c3('0x4'),_0x20e7d2);this[_0xb1c3('0x5')]('defaultuser',_0x20e7d2);},'comment':_0xb1c3('0x6')},'fullname':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':![],'set':function(_0x211254){this['setDataValue']('fullname',_0x211254);this['setDataValue']('callerid',util[_0xb1c3('0x7')]('\x22%s\x22\x20<%s>',_0x211254,this[_0xb1c3('0x8')](_0xb1c3('0x9'))));}},'alias':{'type':Sequelize[_0xb1c3('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb1c3('0xa'),'validate':{'isEmail':!![]},'set':function(_0x2b5fed){if(_0x2b5fed){this[_0xb1c3('0x5')]('email',_0x2b5fed[_0xb1c3('0xb')]());}}},'role':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0xd'),_0xb1c3('0xe'),'agent',_0xb1c3('0xf')),'allowNull':![]},'password':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xb1c3('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':![],'unique':_0xb1c3('0x9'),'set':function(_0x57b6c9){this[_0xb1c3('0x5')](_0xb1c3('0x9'),_0x57b6c9);this[_0xb1c3('0x5')](_0xb1c3('0x11'),_0x57b6c9);this[_0xb1c3('0x5')]('callerid',util[_0xb1c3('0x7')](_0xb1c3('0x12'),this[_0xb1c3('0x8')](_0xb1c3('0x13')),_0x57b6c9));}},'salt':{'type':Sequelize[_0xb1c3('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xb1c3('0x3')]},'address':{'type':Sequelize[_0xb1c3('0x3')]},'zipcode':{'type':Sequelize[_0xb1c3('0x3')]},'userpic':{'type':Sequelize[_0xb1c3('0x3')]},'city':{'type':Sequelize[_0xb1c3('0x3')]},'country':{'type':Sequelize[_0xb1c3('0x3')]},'online':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xb1c3('0x15')]},'voicePause':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xb1c3('0x3')],'defaultValue':_0xb1c3('0x16')},'lastPauseAt':{'type':Sequelize[_0xb1c3('0x15')]},'chatCapacity':{'type':Sequelize[_0xb1c3('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xb1c3('0x10')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xb1c3('0x10')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xb1c3('0x10')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xb1c3('0x10')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xb1c3('0x10')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0xb1c3('0x10')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x17'),_0xb1c3('0xe'),_0xb1c3('0x18')),'allowNull':!![],'defaultValue':_0xb1c3('0x17')},'context':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xb1c3('0xc')]('ALLOWED_NOT_SCREENED',_0xb1c3('0x19'),'ALLOWED_FAILED_SCREEN',_0xb1c3('0x1a'),_0xb1c3('0x1b'),_0xb1c3('0x1c'),_0xb1c3('0x1d'),_0xb1c3('0x1e')),'allowNull':!![]},'deny':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![],'defaultValue':_0xb1c3('0x1f'),'set':function(_0x1f22b2){this[_0xb1c3('0x5')](_0xb1c3('0x20'),_0x1f22b2?_0x1f22b2['join'](','):null);},'get':function(){return this[_0xb1c3('0x8')]('transport')?this[_0xb1c3('0x8')](_0xb1c3('0x20'))['split'](','):null;},'comment':_0xb1c3('0x21')},'dtmfmode':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x22'),_0xb1c3('0x23'),'shortinfo',_0xb1c3('0x24'),_0xb1c3('0x25')),'allowNull':!![],'defaultValue':_0xb1c3('0x22')},'directmedia':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no',_0xb1c3('0x27'),_0xb1c3('0x28'),_0xb1c3('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xb1c3('0x2a'),'set':function(_0x1a1a2f){this['setDataValue'](_0xb1c3('0x2b'),_0x1a1a2f?_0x1a1a2f[_0xb1c3('0x2c')](','):null);},'get':function(){return this[_0xb1c3('0x8')](_0xb1c3('0x2b'))?this[_0xb1c3('0x8')](_0xb1c3('0x2b'))[_0xb1c3('0x2d')](','):null;},'comment':_0xb1c3('0x2e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xb1c3('0x3')]},'pickupgroup':{'type':Sequelize[_0xb1c3('0x3')]},'namedpickupgroup':{'type':Sequelize[_0xb1c3('0x3')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':![],'defaultValue':_0xb1c3('0x2f')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xb1c3('0x30'),'set':function(_0x419db6){this['setDataValue'](_0xb1c3('0x31'),_0x419db6?_0x419db6['join'](';'):_0xb1c3('0x30'));},'get':function(){return this['getDataValue'](_0xb1c3('0x31'))?this['getDataValue'](_0xb1c3('0x31'))[_0xb1c3('0x2d')](';'):null;},'comment':_0xb1c3('0x32')},'autoframing':{'type':Sequelize[_0xb1c3('0xc')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![],'set':function(_0x398805){this['setDataValue'](_0xb1c3('0x33'),_0x398805?_0x398805[_0xb1c3('0x2c')](','):null);},'get':function(){return this[_0xb1c3('0x8')](_0xb1c3('0x33'))?this[_0xb1c3('0x8')](_0xb1c3('0x33'))[_0xb1c3('0x2d')](','):null;},'comment':_0xb1c3('0x34')},'trustrpid':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xb1c3('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no',_0xb1c3('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xb1c3('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![],'defaultValue':_0xb1c3('0x36')},'amaflags':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![],'defaultValue':_0xb1c3('0x26')},'busylevel':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no',_0xb1c3('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xb1c3('0x38'),'originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xb1c3('0x39'),_0xb1c3('0x3a')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![],'defaultValue':_0xb1c3('0x26')},'keepalive':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xb1c3('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0xb1c3('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no',_0xb1c3('0x3b'),_0xb1c3('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xb1c3('0x10')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x3d'),_0xb1c3('0x3e'),_0xb1c3('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0xb1c3('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xb1c3('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no','nonat',_0xb1c3('0x28'),_0xb1c3('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xb1c3('0x15')]},'passwordResetAt':{'type':Sequelize[_0xb1c3('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xb1c3('0x41')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x18b713){this['setDataValue']('showWebBar',_0x18b713);var _0x1edef3=this[_0xb1c3('0x42')]({'plain':!![]});switch(_0x18b713){case 0x0:case 0x1:var _0x100ef3=_0x1edef3['transport']?_[_0xb1c3('0x43')](_0x1edef3[_0xb1c3('0x20')])?_0x1edef3[_0xb1c3('0x20')][_0xb1c3('0x2c')]():_0x1edef3[_0xb1c3('0x20')]:_0xb1c3('0x1f');if(_0x100ef3===_0xb1c3('0x44')){_0x100ef3=_0xb1c3('0x1f');}this[_0xb1c3('0x5')](_0xb1c3('0x20'),_0x100ef3);this[_0xb1c3('0x5')](_0xb1c3('0x45'),'no');this[_0xb1c3('0x5')](_0xb1c3('0x46'),null);this[_0xb1c3('0x5')](_0xb1c3('0x47'),null);this[_0xb1c3('0x5')](_0xb1c3('0x48'),null);this[_0xb1c3('0x5')](_0xb1c3('0x49'),null);this['setDataValue'](_0xb1c3('0x4a'),null);this[_0xb1c3('0x5')]('dtlssetup',null);this['setDataValue']('dtlscertfile',null);this[_0xb1c3('0x5')](_0xb1c3('0x4b'),null);this[_0xb1c3('0x5')](_0xb1c3('0x4c'),'no');break;case 0x2:this['setDataValue'](_0xb1c3('0x20'),_0xb1c3('0x44'));this['setDataValue'](_0xb1c3('0x45'),_0xb1c3('0x26'));this[_0xb1c3('0x5')](_0xb1c3('0x46'),_0xb1c3('0x26'));this[_0xb1c3('0x5')](_0xb1c3('0x47'),'yes');this[_0xb1c3('0x5')]('icesupport',_0xb1c3('0x26'));this['setDataValue']('dtlsenable',_0xb1c3('0x26'));this[_0xb1c3('0x5')]('dtlsverify','no');this[_0xb1c3('0x5')](_0xb1c3('0x4d'),_0xb1c3('0x3f'));this[_0xb1c3('0x5')](_0xb1c3('0x4e'),_0x1edef3[_0xb1c3('0x4e')]||_0xb1c3('0x4f'));this[_0xb1c3('0x5')](_0xb1c3('0x4b'),_0x1edef3[_0xb1c3('0x4b')]||_0xb1c3('0x50'));this[_0xb1c3('0x5')]('rtcp_mux',_0xb1c3('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0xb1c3('0x41')],'set':function(_0x3112e7){this[_0xb1c3('0x5')](_0xb1c3('0x51'),_0x3112e7?_0x3112e7[_0xb1c3('0x2c')](','):[]);},'get':function(){return this['getDataValue'](_0xb1c3('0x51'))?_[_0xb1c3('0x52')](this['getDataValue'](_0xb1c3('0x51'))[_0xb1c3('0x2d')](','),function(_0x564314){return parseInt(_0x564314,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xb1c3('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xb1c3('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xb1c3('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xb1c3('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xb1c3('0xc')](_0xb1c3('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xb1c3('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xb1c3('0x53'))?this[_0xb1c3('0x8')](_0xb1c3('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0xb1c3('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xb1c3('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5c9022){if(typeof _0x5c9022===_0xb1c3('0x54')){var _0x48a220=_0x5c9022==='1'?!![]:_0x5c9022==='0'?![]:_0x5c9022===_0xb1c3('0x55')?!![]:_0x5c9022===_0xb1c3('0x56')?![]:![];this[_0xb1c3('0x5')](_0xb1c3('0x57'),_0x48a220);}else{this[_0xb1c3('0x5')]('screenrecording',_0x5c9022);}}},'blocked':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![],'set':function(_0x5e9a81){this[_0xb1c3('0x5')]('blocked',_0x5e9a81);if(_0x5e9a81===!![]){this[_0xb1c3('0x5')]('blockedAt',moment());this[_0xb1c3('0x5')](_0xb1c3('0x58'),0x0);}else{this[_0xb1c3('0x5')](_0xb1c3('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0xb1c3('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0xb1c3('0x5a')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb1c3('0x14')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x7c09=['internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','format','getDataValue','BOOLEAN','DATE','dynamic','friend','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','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\x22gsm\x22]','insecure','\x22\x22\x20<>','always','refuse','originate','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','isArray','wss','avpf','force_avp','icesupport','dtlsverify','dtlsprivatekey','rtcp_mux','encryption','dtlsenable','dtlssetup','dtlscertfile','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','loginAttempts','blockedAt','UNSIGNED','moment','util','exports','STRING','name','setDataValue','fullname','callerid','\x22%s\x22\x20<%s>'];(function(_0x154689,_0x1da8c5){var _0x3d0fc2=function(_0x47f038){while(--_0x47f038){_0x154689['push'](_0x154689['shift']());}};_0x3d0fc2(++_0x1da8c5);}(_0x7c09,0x102));var _0x97c0=function(_0x4037cb,_0x4252e0){_0x4037cb=_0x4037cb-0x0;var _0x4d591c=_0x7c09[_0x4037cb];return _0x4d591c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x97c0('0x0'));var util=require(_0x97c0('0x1'));var _=require('lodash');module[_0x97c0('0x2')]={'name':{'type':Sequelize[_0x97c0('0x3')],'allowNull':![],'unique':_0x97c0('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x214897){this[_0x97c0('0x5')](_0x97c0('0x4'),_0x214897);this[_0x97c0('0x5')]('defaultuser',_0x214897);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x46fdd9){this[_0x97c0('0x5')](_0x97c0('0x6'),_0x46fdd9);this[_0x97c0('0x5')](_0x97c0('0x7'),util['format'](_0x97c0('0x8'),_0x46fdd9,this['getDataValue'](_0x97c0('0x9'))));}},'alias':{'type':Sequelize[_0x97c0('0x3')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x3ba42b){if(_0x3ba42b){this[_0x97c0('0x5')](_0x97c0('0xa'),_0x3ba42b[_0x97c0('0xb')]());}}},'role':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0xd'),_0x97c0('0xe'),_0x97c0('0xf'),_0x97c0('0x10')),'allowNull':![]},'password':{'type':Sequelize[_0x97c0('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':_0x97c0('0x11')},'internal':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0x3f2fc2){this[_0x97c0('0x5')](_0x97c0('0x9'),_0x3f2fc2);this['setDataValue'](_0x97c0('0x13'),_0x3f2fc2);this[_0x97c0('0x5')](_0x97c0('0x7'),util[_0x97c0('0x14')](_0x97c0('0x8'),this[_0x97c0('0x15')]('fullname'),_0x3f2fc2));}},'salt':{'type':Sequelize[_0x97c0('0x3')]},'phone':{'type':Sequelize[_0x97c0('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x97c0('0x3')]},'zipcode':{'type':Sequelize[_0x97c0('0x3')]},'userpic':{'type':Sequelize[_0x97c0('0x3')]},'city':{'type':Sequelize[_0x97c0('0x3')]},'country':{'type':Sequelize[_0x97c0('0x3')]},'online':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x97c0('0x17')]},'voicePause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x97c0('0x17')]},'chatCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x97c0('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x97c0('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'defaultValue':_0x97c0('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x19'),'user',_0x97c0('0x1a')),'allowNull':!![],'defaultValue':_0x97c0('0x19')},'context':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x1b'),_0x97c0('0x1c'),_0x97c0('0x1d'),_0x97c0('0x1e'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x97c0('0x1f'),_0x97c0('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'defaultValue':_0x97c0('0x21'),'set':function(_0x9d87a){this[_0x97c0('0x5')](_0x97c0('0x22'),_0x9d87a?_0x9d87a[_0x97c0('0x23')](','):null);},'get':function(){return this[_0x97c0('0x15')](_0x97c0('0x22'))?this[_0x97c0('0x15')](_0x97c0('0x22'))[_0x97c0('0x24')](','):null;},'comment':_0x97c0('0x25')},'dtmfmode':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x26'),_0x97c0('0x27'),'shortinfo',_0x97c0('0x28'),_0x97c0('0x29')),'allowNull':!![],'defaultValue':_0x97c0('0x26')},'directmedia':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no',_0x97c0('0x2b'),_0x97c0('0x2c'),_0x97c0('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'defaultValue':_0x97c0('0x2e'),'set':function(_0x3988d3){this[_0x97c0('0x5')](_0x97c0('0x2f'),_0x3988d3?_0x3988d3[_0x97c0('0x23')](','):null);},'get':function(){return this[_0x97c0('0x15')](_0x97c0('0x2f'))?this[_0x97c0('0x15')](_0x97c0('0x2f'))['split'](','):null;},'comment':_0x97c0('0x30')},'callgroup':{'type':Sequelize[_0x97c0('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x97c0('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x97c0('0x3')]},'language':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x97c0('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x97c0('0x31')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x97c0('0x32'),'set':function(_0x64cfcd){this['setDataValue'](_0x97c0('0x33'),_0x64cfcd?_0x64cfcd[_0x97c0('0x23')](';'):_0x97c0('0x32'));},'get':function(){return this[_0x97c0('0x15')](_0x97c0('0x33'))?this[_0x97c0('0x15')](_0x97c0('0x33'))[_0x97c0('0x24')](';'):null;},'comment':_0x97c0('0x34')},'autoframing':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'set':function(_0x1351d2){this['setDataValue'](_0x97c0('0x35'),_0x1351d2?_0x1351d2[_0x97c0('0x23')](','):null);},'get':function(){return this[_0x97c0('0x15')](_0x97c0('0x35'))?this[_0x97c0('0x15')](_0x97c0('0x35'))[_0x97c0('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x97c0('0xc')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![],'defaultValue':_0x97c0('0x36')},'amaflags':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x97c0('0xc')]('yes','no'),'allowNull':!![],'defaultValue':_0x97c0('0x2a')},'busylevel':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no',_0x97c0('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x97c0('0xc')]('accept',_0x97c0('0x38'),_0x97c0('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x97c0('0xc')]('uac',_0x97c0('0x3a')),'allowNull':!![],'defaultValue':_0x97c0('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':_0x97c0('0x2a')},'keepalive':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x97c0('0xc')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x97c0('0xc')]('yes','no',_0x97c0('0x3b'),_0x97c0('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x3d'),_0x97c0('0x3e'),_0x97c0('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x97c0('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x97c0('0xc')](_0x97c0('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x97c0('0xc')]('yes','no',_0x97c0('0x2b'),'update',_0x97c0('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x97c0('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x97c0('0x17')]},'passwordResetAt':{'type':Sequelize[_0x97c0('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x97c0('0x41')]},'showWebBar':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0,'set':function(_0x3349df){this[_0x97c0('0x5')](_0x97c0('0x42'),_0x3349df);var _0x54970=this['get']({'plain':!![]});switch(_0x3349df){case 0x0:case 0x1:var _0x17488d=_0x54970[_0x97c0('0x22')]?_[_0x97c0('0x43')](_0x54970[_0x97c0('0x22')])?_0x54970['transport'][_0x97c0('0x23')]():_0x54970[_0x97c0('0x22')]:_0x97c0('0x21');if(_0x17488d===_0x97c0('0x44')){_0x17488d='udp';}this[_0x97c0('0x5')](_0x97c0('0x22'),_0x17488d);this[_0x97c0('0x5')]('encryption','no');this[_0x97c0('0x5')](_0x97c0('0x45'),null);this[_0x97c0('0x5')](_0x97c0('0x46'),null);this[_0x97c0('0x5')](_0x97c0('0x47'),null);this[_0x97c0('0x5')]('dtlsenable',null);this['setDataValue'](_0x97c0('0x48'),null);this[_0x97c0('0x5')]('dtlssetup',null);this[_0x97c0('0x5')]('dtlscertfile',null);this['setDataValue'](_0x97c0('0x49'),null);this['setDataValue'](_0x97c0('0x4a'),'no');break;case 0x2:this[_0x97c0('0x5')]('transport','wss');this['setDataValue'](_0x97c0('0x4b'),'yes');this[_0x97c0('0x5')](_0x97c0('0x45'),_0x97c0('0x2a'));this[_0x97c0('0x5')](_0x97c0('0x46'),_0x97c0('0x2a'));this[_0x97c0('0x5')](_0x97c0('0x47'),_0x97c0('0x2a'));this[_0x97c0('0x5')](_0x97c0('0x4c'),'yes');this[_0x97c0('0x5')](_0x97c0('0x48'),'no');this[_0x97c0('0x5')](_0x97c0('0x4d'),_0x97c0('0x3f'));this['setDataValue'](_0x97c0('0x4e'),_0x54970[_0x97c0('0x4e')]||'/etc/pki/tls/certs/motion.crt');this[_0x97c0('0x5')](_0x97c0('0x49'),_0x54970[_0x97c0('0x49')]||'/etc/pki/tls/private/motion.key');this[_0x97c0('0x5')](_0x97c0('0x4a'),_0x97c0('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x97c0('0x41')],'set':function(_0x4d40cd){this['setDataValue']('permissions',_0x4d40cd?_0x4d40cd[_0x97c0('0x23')](','):[]);},'get':function(){return this[_0x97c0('0x15')](_0x97c0('0x4f'))?_[_0x97c0('0x50')](this[_0x97c0('0x15')](_0x97c0('0x4f'))[_0x97c0('0x24')](','),function(_0x1e28fa){return parseInt(_0x1e28fa,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x97c0('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x97c0('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x97c0('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x97c0('0x51')],'get':function(){return this['getDataValue'](_0x97c0('0x52'))?this[_0x97c0('0x15')](_0x97c0('0x52')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x97c0('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x97c0('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x65f918){if(typeof _0x65f918==='string'){var _0x5b8ebd=_0x65f918==='1'?!![]:_0x65f918==='0'?![]:_0x65f918===_0x97c0('0x53')?!![]:_0x65f918===_0x97c0('0x54')?![]:![];this['setDataValue'](_0x97c0('0x55'),_0x5b8ebd);}else{this['setDataValue'](_0x97c0('0x55'),_0x65f918);}}},'blocked':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![],'set':function(_0x5c014f){this[_0x97c0('0x5')]('blocked',_0x5c014f);if(_0x5c014f===!![]){this['setDataValue']('blockedAt',moment());this[_0x97c0('0x5')](_0x97c0('0x56'),0x0);}else{this['setDataValue'](_0x97c0('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x97c0('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x97c0('0x12')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x97c0('0x12')](0x5)[_0x97c0('0x58')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x97c0('0x16')],'defaultValue':!![]}};
\ No newline at end of file
index 3e20d22..bfed882 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x390a=['Tags','color','tag','getQueues','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','order','getGroups','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','WhatsappInteraction','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','headers','x-forwarded-for','remoteAddress','socket','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','device','PAUSE','LOGININPAUSE','MemberReport','concat','resolve','logout','pause','QueuePause','updateAttributes','type','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','lastPauseAt','manual','set','%s%s','Pause','getTeams','Team','addTeams','omit','setDataValue','Chat','getMailQueues','Mail','getSmsQueues','Sms','Whatsapp','getFaxQueues','Openchannel','flatten','transaction','addAgent','getDataValue','Voice','removeTeams','getChatQueues','Fax','getOpenchannelQueues','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','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','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','getSquareProjects','removeSquareProjects','getScheduledCalls','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','CmHopper','lastName','Contact','token','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','queues','teams','inbound','col','toString','asc','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','unavailable','ringing','voiceStatus','busy','slice','toUpperCase','select','field','ui.','InteractionId','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','squel','jayson/promise','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','./user.socket','register','redis','defaults','http','request','info','User,\x20%s,\x20%s','debug','error','code','message','result','status','end','offset','undefined','limit','count','json','update','then','role','admin','Users','user','agent','Telephones','telephone','filter','value','find','name','UserProfileResource','destroy','sendStatus','stack','send','User','rawAttributes','map','fieldName','includes','password','salt','getOptions','where','include','attributes','push','findAll','query','openTabs','true','rows','length','chat','dataValues','sms','fax','mail','openchannel','all','catch','params','model','differenceBy','keys','intersection','fields','merge','options','whatsapp','body','describe','addContacts','ids','internal','Setting','findById','validatePasswordPattern','max','min_internal','isNil','sequelize','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','permissions','101','103','113','110','104','105','106','107','108','109','100','111','114','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','Agents','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','isEmpty','autoAssociation','compact','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','securePassword','passwordHistoryLimit','enforcePasswordHistory','validatePasswordHistory','updatePasswordsHistory','previousPasswords','addQueues','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','spread','capitalize','QueueId','emit','Queue:save','voice','VoiceQueue','get','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','removeQueues','channel','remove','Queue:remove','addAvatar','userpic','filename','getAvatar','join','root','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','SmsOpenTabs','WhatsappOpenTabs','getContacts','CmContact','filters','sort','pick','hasOwnProperty','includeAll','CmList','Tag'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x390a,0xc9));var _0xa390=function(_0xa409fc,_0x3b1d7c){_0xa409fc=_0xa409fc-0x0;var _0x3b8998=_0x390a[_0xa409fc];return _0x3b8998;};'use strict';var moment=require(_0xa390('0x0'));var BPromise=require(_0xa390('0x1'));var util=require(_0xa390('0x2'));var path=require(_0xa390('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa390('0x4'));var jayson=require(_0xa390('0x5'));var Redis=require(_0xa390('0x6'));var authService=require(_0xa390('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0xa390('0x8'))(_0xa390('0x9'));var utils=require(_0xa390('0xa'));var config=require('../../config/environment');var licenseUtil=require(_0xa390('0xb'));var db=require(_0xa390('0xc'))['db'];var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa390('0xd'))[_0xa390('0xe')](socket);config[_0xa390('0xf')]=_[_0xa390('0x10')](config[_0xa390('0xf')],{'host':'localhost','port':0x18eb});var client=jayson['client'][_0xa390('0x11')]({'port':0x232a});var values;function respondWithRpcPromise(_0x34f0fe,_0x1ecd8b,_0x484b38,_0x41f9f2){return new BPromise(function(_0x172371,_0x49c3a0){var _0x8580d5=_0x41f9f2||client;return _0x8580d5[_0xa390('0x12')](_0x34f0fe,_0x484b38)['then'](function(_0x5cd158){logger[_0xa390('0x13')](_0xa390('0x14'),_0x1ecd8b,'request\x20sent');logger[_0xa390('0x15')]('User,\x20%s,\x20%s,\x20%s',_0x1ecd8b,'request\x20sent',JSON['stringify'](_0x5cd158));if(_0x5cd158[_0xa390('0x16')]){if(_0x5cd158['error'][_0xa390('0x17')]===0x1f4){logger[_0xa390('0x16')]('User,\x20%s,\x20%s',_0x1ecd8b,_0x5cd158[_0xa390('0x16')][_0xa390('0x18')]);return _0x49c3a0(_0x5cd158['error'][_0xa390('0x18')]);}logger['error'](_0xa390('0x14'),_0x1ecd8b,_0x5cd158[_0xa390('0x16')][_0xa390('0x18')]);return _0x172371(_0x5cd158[_0xa390('0x16')]['message']);}else{logger[_0xa390('0x13')]('User,\x20%s,\x20%s',_0x1ecd8b,'request\x20sent');_0x172371(_0x5cd158[_0xa390('0x19')][_0xa390('0x18')]);}})['catch'](function(_0x3815bd){logger[_0xa390('0x16')]('User,\x20%s,\x20%s',_0x1ecd8b,_0x3815bd);_0x49c3a0(_0x3815bd);});});}function respondWithStatusCode(_0x134ace,_0x3ab696){_0x3ab696=_0x3ab696||0xcc;return function(_0x5c7e4c){if(_0x5c7e4c){return _0x134ace['sendStatus'](_0x3ab696);}return _0x134ace[_0xa390('0x1a')](_0x3ab696)[_0xa390('0x1b')]();};}function respondWithResult(_0x130355,_0x5a7e31){_0x5a7e31=_0x5a7e31||0xc8;return function(_0x4d320d){if(_0x4d320d){return _0x130355[_0xa390('0x1a')](_0x5a7e31)['json'](_0x4d320d);}};}function respondWithFilteredResult(_0x3f2840,_0x11a069){return function(_0x2aeb9f){if(_0x2aeb9f){var _0x5ea2de=typeof _0x11a069[_0xa390('0x1c')]===_0xa390('0x1d')&&typeof _0x11a069[_0xa390('0x1e')]==='undefined';var _0x2684ef=_0x2aeb9f['count'];var _0x34f865=_0x5ea2de?0x0:_0x11a069['offset'];var _0x22ec39=_0x5ea2de?_0x2aeb9f[_0xa390('0x1f')]:_0x11a069[_0xa390('0x1c')]+_0x11a069[_0xa390('0x1e')];var _0x22c5ba;if(_0x22ec39>=_0x2684ef){_0x22ec39=_0x2684ef;_0x22c5ba=0xc8;}else{_0x22c5ba=0xce;}_0x3f2840[_0xa390('0x1a')](_0x22c5ba);return _0x3f2840['set']('Content-Range',_0x34f865+'-'+_0x22ec39+'/'+_0x2684ef)[_0xa390('0x20')](_0x2aeb9f);}return null;};}function saveUpdates(_0x5022aa){return function(_0x45e70a){if(_0x45e70a){return _0x45e70a[_0xa390('0x21')](_0x5022aa)[_0xa390('0x22')](function(_0x11ce69){return _0x11ce69;});}return null;};}function removeEntity(_0x272949){return function(_0x35e44e){if(_0x35e44e){return _0x35e44e['destroy']()[_0xa390('0x22')](function(){var _0x4234e1=_0x35e44e['get']({'plain':!![]});if(_0x4234e1[_0xa390('0x23')]===_0xa390('0x24'))return;var _0x4f5b64=[{'name':_0xa390('0x25'),'value':_0xa390('0x26'),'ignore':!![]},{'name':'Agents','value':_0xa390('0x27'),'ignore':![]},{'name':_0xa390('0x28'),'value':_0xa390('0x29'),'ignore':![]}];var _0x9a9dfe=_(_0x4f5b64)[_0xa390('0x2a')]('ignore')['map'](_0xa390('0x2b'))[_0xa390('0x2b')]();if(_['includes'](_0x9a9dfe,_0x4234e1[_0xa390('0x23')])){return;}var _0x5199da=_[_0xa390('0x2c')](_0x4f5b64,[_0xa390('0x2b'),_0x4234e1[_0xa390('0x23')]])[_0xa390('0x2d')];return db[_0xa390('0x2e')][_0xa390('0x2f')]({'where':{'type':_0x5199da,'resourceId':_0x4234e1['id']}})[_0xa390('0x22')](function(){return _0x35e44e;});})[_0xa390('0x22')](function(){_0x272949[_0xa390('0x1a')](0xcc)[_0xa390('0x1b')]();});}};}function handleEntityNotFound(_0x209f82){return function(_0x57e821){if(!_0x57e821){_0x209f82[_0xa390('0x30')](0x194);}return _0x57e821;};}function handleError(_0x5c52ac,_0x2e0ddd){_0x2e0ddd=_0x2e0ddd||0x1f4;return function(_0x526dd0){logger[_0xa390('0x16')](_0x526dd0[_0xa390('0x31')]);if(_0x526dd0[_0xa390('0x2d')]){delete _0x526dd0[_0xa390('0x2d')];}_0x5c52ac['status'](_0x2e0ddd)[_0xa390('0x32')](_0x526dd0);};}exports['index']=function(_0x298169,_0x47f7ed){var _0x10e2de={},_0x2a22a3={'count':0x0,'rows':[]};var _0x2fe9f3=_(db[_0xa390('0x33')][_0xa390('0x34')])[_0xa390('0x35')](function(_0x25eb61){return{'name':_0x25eb61[_0xa390('0x36')],'type':_0x25eb61['type']['key']};})[_0xa390('0x2a')](function(_0x1ca9d0){return!_[_0xa390('0x37')]([_0xa390('0x38'),_0xa390('0x39')],_0x1ca9d0[_0xa390('0x2d')]);})['value']();_0x10e2de=qs[_0xa390('0x3a')](_0x2fe9f3,_0x298169);var _0x462fe5={'where':_0x10e2de[_0xa390('0x3b')]};return db[_0xa390('0x33')]['count'](_0x462fe5)[_0xa390('0x22')](function(_0x222b8d){_0x2a22a3['count']=_0x222b8d;if(_0x298169['query']['includeAll']){_0x10e2de[_0xa390('0x3c')]=[{'all':!![]}];}if(!_[_0xa390('0x37')](_0x10e2de[_0xa390('0x3d')],'id')){_0x10e2de[_0xa390('0x3d')][_0xa390('0x3e')]('id');}return db[_0xa390('0x33')][_0xa390('0x3f')](_0x10e2de);})[_0xa390('0x22')](function(_0x2e772a){_0x2a22a3['rows']=_0x2e772a;if(_0x298169[_0xa390('0x40')][_0xa390('0x41')]===_0xa390('0x42')){var _0x38b072=[];for(var _0xc2aae9=0x0;_0xc2aae9<_0x2a22a3[_0xa390('0x43')][_0xa390('0x44')];_0xc2aae9++){_0x38b072[_0xa390('0x3e')](get_open_tabs(_0xa390('0x45'),_0x2a22a3[_0xa390('0x43')][_0xc2aae9][_0xa390('0x46')]));_0x38b072[_0xa390('0x3e')](get_open_tabs(_0xa390('0x47'),_0x2a22a3[_0xa390('0x43')][_0xc2aae9][_0xa390('0x46')]));_0x38b072[_0xa390('0x3e')](get_open_tabs(_0xa390('0x48'),_0x2a22a3[_0xa390('0x43')][_0xc2aae9][_0xa390('0x46')]));_0x38b072[_0xa390('0x3e')](get_open_tabs(_0xa390('0x49'),_0x2a22a3['rows'][_0xc2aae9][_0xa390('0x46')]));_0x38b072[_0xa390('0x3e')](get_open_tabs(_0xa390('0x4a'),_0x2a22a3[_0xa390('0x43')][_0xc2aae9][_0xa390('0x46')]));_0x38b072[_0xa390('0x3e')](get_open_tabs('whatsapp',_0x2a22a3[_0xa390('0x43')][_0xc2aae9][_0xa390('0x46')]));}return BPromise[_0xa390('0x4b')](_0x38b072)['then'](function(_0xc1f29c){return _0x2a22a3;});}else{return _0x2a22a3;}})[_0xa390('0x22')](respondWithFilteredResult(_0x47f7ed,_0x10e2de))[_0xa390('0x4c')](handleError(_0x47f7ed,null));};exports['show']=function(_0x31662a,_0x423f8d){var _0x17764f={'raw':![],'where':{'id':_0x31662a[_0xa390('0x4d')]['id']}},_0x108948={};_0x108948[_0xa390('0x4e')]=_[_0xa390('0x4f')](_[_0xa390('0x50')](db[_0xa390('0x33')][_0xa390('0x34')]),[_0xa390('0x38'),_0xa390('0x39')]);_0x108948[_0xa390('0x40')]=_[_0xa390('0x50')](_0x31662a['query']);_0x108948['filters']=_[_0xa390('0x51')](_0x108948[_0xa390('0x4e')],_0x108948['query']);_0x17764f[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x108948[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x31662a[_0xa390('0x40')][_0xa390('0x52')]));_0x17764f[_0xa390('0x3d')]=_0x17764f[_0xa390('0x3d')][_0xa390('0x44')]?_0x17764f['attributes']:_0x108948[_0xa390('0x4e')];if(_0x31662a[_0xa390('0x40')]['includeAll']){_0x17764f['include']=[{'all':!![]}];}_0x17764f=_[_0xa390('0x53')]({},_0x17764f,_0x31662a[_0xa390('0x54')]);if(!_[_0xa390('0x37')](_0x17764f['attributes'],'id')){_0x17764f['attributes'][_0xa390('0x3e')]('id');}return db[_0xa390('0x33')][_0xa390('0x2c')](_0x17764f)[_0xa390('0x22')](handleEntityNotFound(_0x423f8d,null))[_0xa390('0x22')](function(_0x5849d9){var _0x183a58=[];values=_0x5849d9;if(_0x31662a[_0xa390('0x40')][_0xa390('0x41')]===_0xa390('0x42')){_0x183a58[_0xa390('0x3e')](get_open_tabs(_0xa390('0x45'),_0x5849d9[_0xa390('0x46')]));_0x183a58[_0xa390('0x3e')](get_open_tabs(_0xa390('0x47'),_0x5849d9[_0xa390('0x46')]));_0x183a58['push'](get_open_tabs(_0xa390('0x4a'),_0x5849d9[_0xa390('0x46')]));_0x183a58[_0xa390('0x3e')](get_open_tabs(_0xa390('0x55'),_0x5849d9[_0xa390('0x46')]));_0x183a58[_0xa390('0x3e')](get_open_tabs(_0xa390('0x48'),_0x5849d9[_0xa390('0x46')]));_0x183a58[_0xa390('0x3e')](get_open_tabs('mail',_0x5849d9['dataValues']));return BPromise[_0xa390('0x4b')](_0x183a58);}else{return values;}})[_0xa390('0x22')](function(_0x4dc0ba){return values;})[_0xa390('0x22')](respondWithResult(_0x423f8d,null))['catch'](handleError(_0x423f8d,null));};exports[_0xa390('0x21')]=function(_0x9eb2de,_0xa6f2c1){if(_0x9eb2de['body']['id']){delete _0x9eb2de[_0xa390('0x56')]['id'];}delete _0x9eb2de[_0xa390('0x56')][_0xa390('0x23')];return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x9eb2de[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0xa6f2c1,null))['then'](saveUpdates(_0x9eb2de[_0xa390('0x56')],null))[_0xa390('0x22')](respondWithResult(_0xa6f2c1,null))[_0xa390('0x4c')](handleError(_0xa6f2c1,null));};exports[_0xa390('0x57')]=function(_0x6a4449,_0x29b4b5){return db['User'][_0xa390('0x57')]()[_0xa390('0x22')](respondWithResult(_0x29b4b5,null))[_0xa390('0x4c')](handleError(_0x29b4b5,null));};exports[_0xa390('0x58')]=function(_0x227d84,_0x428537){return db['User'][_0xa390('0x2c')]({'where':{'id':_0x227d84[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x428537,null))[_0xa390('0x22')](function(_0x2dcf34){if(_0x2dcf34){return _0x2dcf34[_0xa390('0x58')](_0x227d84[_0xa390('0x56')][_0xa390('0x59')],_['omit'](_0x227d84[_0xa390('0x56')],[_0xa390('0x59'),'id'])||{});}})['then'](respondWithResult(_0x428537,null))[_0xa390('0x4c')](handleError(_0x428537,null));};function validateUser(_0x1cb166){return new BPromise(function(_0x323983,_0x438098){if(_0x1cb166[_0xa390('0x5a')])return _0x323983(_0x1cb166);return db[_0xa390('0x5b')][_0xa390('0x5c')](0x1)[_0xa390('0x22')](function(_0x506c36){if(_0x506c36['securePassword'])authService[_0xa390('0x5d')](_0x1cb166[_0xa390('0x38')]);db[_0xa390('0x33')][_0xa390('0x5e')]('internal')[_0xa390('0x22')](function(_0x27c0c0){if(_['isNil'](_0x27c0c0)){_0x1cb166['internal']=_0x506c36[_0xa390('0x5f')]||0x1;return;}if(_[_0xa390('0x60')](_0x506c36[_0xa390('0x5f')])||_0x506c36[_0xa390('0x5f')]===_0x27c0c0){_0x1cb166['internal']=_0x27c0c0+0x1;return;}if(_0x506c36[_0xa390('0x5f')]>_0x27c0c0){_0x1cb166[_0xa390('0x5a')]=_0x506c36['min_internal'];return;}return db[_0xa390('0x61')][_0xa390('0x40')]('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[_0xa390('0x61')][_0xa390('0x62')][_0xa390('0x63')]})['then'](function(_0x2f8a96){if(_0x2f8a96&&_0x2f8a96['length']){for(var _0x5d1a1b=0x0,_0x23ab9f=_0x2f8a96[_0xa390('0x44')];_0x5d1a1b<_0x23ab9f&&_[_0xa390('0x60')](_0x1cb166[_0xa390('0x5a')]);_0x5d1a1b++){if(_0x506c36[_0xa390('0x5f')]<=_0x2f8a96[_0x5d1a1b][_0xa390('0x64')]){_0x1cb166['internal']=_0x2f8a96[_0x5d1a1b]['from'];}else if(_0x506c36['min_internal']>_0x2f8a96[_0x5d1a1b][_0xa390('0x64')]&&_0x506c36[_0xa390('0x5f')]<=_0x2f8a96[_0x5d1a1b]['to']){_0x1cb166[_0xa390('0x5a')]=_0x506c36[_0xa390('0x5f')];}}}if(_['isNil'](_0x1cb166[_0xa390('0x5a')])){_0x1cb166[_0xa390('0x5a')]=_0x27c0c0+0x1;}return _0x323983(_0x1cb166);});});})[_0xa390('0x4c')](function(_0x2571b6){_0x438098(_0x2571b6);});});}function updateUser(_0x3754c3){return new BPromise(function(_0x391602,_0x141ec2){try{if(_0x3754c3['voicemail']){_0x3754c3[_0xa390('0x65')]=_0x3754c3['internal'];_0x3754c3[_0xa390('0x66')]={'mailbox':_0x3754c3[_0xa390('0x5a')],'password':_0x3754c3[_0xa390('0x38')],'fullname':_0x3754c3[_0xa390('0x67')],'email':_0x3754c3['email']};}if(_0x3754c3[_0xa390('0x23')]===_0xa390('0x27')){if(!_0x3754c3['permissions'])_0x3754c3[_0xa390('0x68')]=[_0xa390('0x69'),'102',_0xa390('0x6a'),_0xa390('0x6b'),_0xa390('0x6c'),_0xa390('0x6d'),_0xa390('0x6e'),_0xa390('0x6f'),_0xa390('0x70'),_0xa390('0x71'),_0xa390('0x72'),_0xa390('0x73'),_0xa390('0x74'),_0xa390('0x75'),'115'];}_0x391602(_0x3754c3);}catch(_0x274a9c){_0x141ec2(_0x274a9c);}});}exports[_0xa390('0x76')]=function(_0x1a8401,_0x5ad2ee){if(_0x1a8401[_0xa390('0x26')]['role']===_0xa390('0x27'))throw new Error('Unauthorized');if(_0x1a8401[_0xa390('0x56')][_0xa390('0x23')]===_0xa390('0x26')&&_0x1a8401[_0xa390('0x26')][_0xa390('0x23')]!==_0xa390('0x24')){throw new Error(_0xa390('0x77'));}if(_0x1a8401['body']['role']==='admin'&&_0x1a8401['user']['role']!==_0xa390('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xa390('0x78')]([_0x1a8401[_0xa390('0x56')]])[_0xa390('0x22')](function(){return validateUser(_0x1a8401[_0xa390('0x56')]);})[_0xa390('0x22')](function(_0x50297e){return updateUser(_0x50297e)[_0xa390('0x22')](function(_0x372c72){if(_0x372c72[_0xa390('0x23')]===_0xa390('0x24')){_0x372c72[_0xa390('0x79')]=_0x1a8401['user'][_0xa390('0x79')];delete _0x372c72[_0xa390('0x7a')];}return _0x372c72;});})[_0xa390('0x22')](function(_0x1a5d1e){return db[_0xa390('0x33')][_0xa390('0x76')](_0x1a5d1e,{'include':[{'model':db[_0xa390('0x66')],'as':_0xa390('0x66')}]});})[_0xa390('0x22')](function(_0x4b24c9){if(_0x1a8401[_0xa390('0x56')]['role']===_0xa390('0x26'))return _0x4b24c9;if(_0x1a8401['user'][_0xa390('0x23')]!=='user')return _0x4b24c9;return db[_0xa390('0x7b')][_0xa390('0x2c')]({'where':{'name':_0x4b24c9[_0xa390('0x23')]===_0xa390('0x27')?_0xa390('0x7c'):_0xa390('0x28'),'userProfileId':_0x1a8401[_0xa390('0x26')][_0xa390('0x7a')]},'raw':!![]})[_0xa390('0x22')](function(_0x4f7804){if(!_0x4f7804||_0x4f7804['autoAssociation']!=0x0)return _0x4b24c9;return db['UserProfileResource']['create']({'name':_0x4b24c9['name'],'resourceId':_0x4b24c9['id'],'type':_0x4f7804['name'],'sectionId':_0x4f7804['id']},{})[_0xa390('0x22')](function(){return _0x4b24c9;});})[_0xa390('0x4c')](function(_0x1f43e9){logger[_0xa390('0x16')](_0xa390('0x7d'),_0x1f43e9);throw _0x1f43e9;});})[_0xa390('0x22')](respondWithResult(_0x5ad2ee,0xc9))[_0xa390('0x4c')](handleError(_0x5ad2ee,null));};exports[_0xa390('0x7e')]=function(_0x5804eb,_0x51a803){var _0x527b3c=_0x5804eb[_0xa390('0x56')];var _0x2c2072=[];if(_0x5804eb[_0xa390('0x26')][_0xa390('0x23')]==='agent')throw new Error('Unauthorized');if(_[_0xa390('0x7f')](_0x527b3c,[_0xa390('0x23'),_0xa390('0x26')])&&_0x5804eb['user']['role']!==_0xa390('0x24')){throw new Error(_0xa390('0x77'));}if(_[_0xa390('0x7f')](_0x527b3c,[_0xa390('0x23'),'admin'])&&_0x5804eb['user'][_0xa390('0x23')]!==_0xa390('0x24')){throw new Error(_0xa390('0x80'));}return licenseUtil['checkUserLimits'](_0x527b3c)[_0xa390('0x22')](function(){return validateUser(_0x527b3c[0x0]);})['then'](function(){for(var _0x43ef3c=0x1;_0x43ef3c<_0x527b3c[_0xa390('0x44')];_0x43ef3c++){var _0x5ef41b=_0x527b3c[_0x43ef3c-0x1]['internal'];if(!_0x527b3c[_0x43ef3c]['internal'])_0x527b3c[_0x43ef3c][_0xa390('0x5a')]=_0x5ef41b+0x1;_0x2c2072[_0xa390('0x3e')](validateUser(_0x527b3c[_0x43ef3c]));}return BPromise[_0xa390('0x4b')](_0x2c2072);})[_0xa390('0x22')](function(){_0x2c2072=[];for(var _0x1b52aa=0x0;_0x1b52aa<_0x527b3c[_0xa390('0x44')];_0x1b52aa++){_0x2c2072['push'](updateUser(_0x527b3c[_0x1b52aa]));}return BPromise['all'](_0x2c2072);})[_0xa390('0x22')](function(){return BPromise[_0xa390('0x81')](_0x527b3c,function(_0x3743ef){return db[_0xa390('0x33')][_0xa390('0x76')](_0x3743ef,{'include':[{'model':db[_0xa390('0x66')],'as':_0xa390('0x66')}]})[_0xa390('0x22')](function(_0x280179){_0x3743ef['id']=_0x280179['id'];return _0x3743ef;});});})[_0xa390('0x22')](function(_0xd639ba){if(_0x5804eb[_0xa390('0x56')][_0xa390('0x23')]===_0xa390('0x26'))return _0xd639ba;if(_0x5804eb[_0xa390('0x26')][_0xa390('0x23')]!==_0xa390('0x26'))return _0xd639ba;var _0x5219d0=_[_0xa390('0x7f')](_0xd639ba,function(_0x12fbab){return _0x12fbab[_0xa390('0x23')]==='agent'||_0x12fbab['role']===_0xa390('0x29');});if(!_0x5219d0)return _0xd639ba;return db[_0xa390('0x7b')][_0xa390('0x3f')]({'where':{'name':{'$or':[_0xa390('0x7c'),_0xa390('0x28')]},'userProfileId':_0x5804eb[_0xa390('0x26')][_0xa390('0x7a')]},'raw':!![]})[_0xa390('0x22')](function(_0x3afcdf){if(_[_0xa390('0x82')](_0x3afcdf)||!_[_0xa390('0x7f')](_0x3afcdf,[_0xa390('0x83'),0x0]))return _0xd639ba;_0x2c2072=[];var _0x3cf1a2=_(_0x3afcdf)[_0xa390('0x35')](function(_0x40b07f){if(_0x40b07f[_0xa390('0x83')]===0x1)return;return _0x40b07f[_0xa390('0x2d')]==='Agents'?_0xa390('0x27'):_0xa390('0x29');})[_0xa390('0x84')]()['value']();for(var _0x1f57f3=0x0;_0x1f57f3<_0xd639ba['length'];_0x1f57f3++){if(!_[_0xa390('0x37')](_0x3cf1a2,_0xd639ba[_0x1f57f3][_0xa390('0x23')]))return;var _0x19612c=_0xd639ba[_0x1f57f3][_0xa390('0x23')]===_0xa390('0x27')?'Agents':'Telephones';_0x2c2072[_0xa390('0x3e')](db[_0xa390('0x2e')][_0xa390('0x76')]({'name':_0xd639ba[_0x1f57f3][_0xa390('0x2d')],'resourceId':_0xd639ba[_0x1f57f3]['id'],'type':_0x19612c,'sectionId':_[_0xa390('0x2c')](_0x3afcdf,[_0xa390('0x2d'),_0x19612c])['id']},{}));}return BPromise[_0xa390('0x4b')](_0x2c2072);});})[_0xa390('0x22')](respondWithResult(_0x51a803,0xc9))[_0xa390('0x4c')](handleError(_0x51a803,null));};exports[_0xa390('0x85')]=function(_0x37a7b9,_0xcb5c48){if(_0x37a7b9[_0xa390('0x56')]['id']){delete _0x37a7b9[_0xa390('0x56')]['id'];}return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x37a7b9[_0xa390('0x4d')]['id']}})['then'](function(_0x34a961){if(!_0x34a961)return null;if(_0x34a961['id']===_0x37a7b9[_0xa390('0x26')]['id']){if(!_0x37a7b9[_0xa390('0x56')][_0xa390('0x86')]||!_0x37a7b9[_0xa390('0x56')]['newPassword']){throw new db[(_0xa390('0x87'))][(_0xa390('0x88'))](_0xa390('0x89'));}if(!_0x34a961[_0xa390('0x8a')](_0x37a7b9[_0xa390('0x56')]['oldPassword'])){throw new db[(_0xa390('0x87'))][(_0xa390('0x88'))](_0xa390('0x8b'));}if(_0x37a7b9['body'][_0xa390('0x86')]===_0x37a7b9[_0xa390('0x56')][_0xa390('0x8c')]){throw new db[(_0xa390('0x87'))][(_0xa390('0x88'))](_0xa390('0x8d'));}}else if(_0x37a7b9[_0xa390('0x26')]['role']==='admin'){if(!_0x37a7b9[_0xa390('0x56')][_0xa390('0x8c')]){throw new db['Sequelize'][(_0xa390('0x88'))](_0xa390('0x8e'));}}else if(_0x37a7b9[_0xa390('0x26')][_0xa390('0x23')]===_0xa390('0x26')){if(!_0x37a7b9[_0xa390('0x56')][_0xa390('0x8c')]){throw new db['Sequelize'][(_0xa390('0x88'))](_0xa390('0x8e'));}if(_0x34a961[_0xa390('0x23')]!==_0xa390('0x27')){throw new db['Sequelize'][(_0xa390('0x88'))](_0xa390('0x8f'));}}else{throw new db[(_0xa390('0x87'))][(_0xa390('0x88'))]('Unauthorized');}return _0x34a961;})[_0xa390('0x22')](handleEntityNotFound(_0xcb5c48,null))[_0xa390('0x22')](function(_0x15a4e3){return db['Setting'][_0xa390('0x90')]({'attributes':['id',_0xa390('0x91'),'enforcePasswordHistory',_0xa390('0x92')]})['then'](function(_0x2bd6dc){if(_0x2bd6dc[_0xa390('0x91')])authService[_0xa390('0x5d')](_0x37a7b9[_0xa390('0x56')]['newPassword']);if(!_0x2bd6dc[_0xa390('0x93')]||!_0x15a4e3['previousPasswords'])return _0x15a4e3;authService[_0xa390('0x94')](_0x37a7b9['body'][_0xa390('0x8c')],_0x15a4e3['previousPasswords'],_0x2bd6dc[_0xa390('0x92')]);return _0x15a4e3;})[_0xa390('0x22')](saveUpdates({'password':_0x37a7b9[_0xa390('0x56')][_0xa390('0x8c')],'passwordResetAt':_0x37a7b9[_0xa390('0x26')]['id']==_0x37a7b9[_0xa390('0x4d')]['id']?moment():null,'previousPasswords':authService[_0xa390('0x95')](_0x37a7b9[_0xa390('0x56')]['newPassword'],_0x15a4e3[_0xa390('0x96')])},null));})[_0xa390('0x22')](respondWithResult(_0xcb5c48,null))['catch'](handleError(_0xcb5c48,null));};exports[_0xa390('0x97')]=function(_0x56033e,_0x58c90f){var _0x35f100=_0x56033e[_0xa390('0x56')]['channel'];return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x56033e[_0xa390('0x4d')]['id']},'attributes':['id','name','role',_0xa390('0x98'),_0xa390('0x99'),'voicePause',_0xa390('0x9a')]})[_0xa390('0x22')](handleEntityNotFound(_0x58c90f,null))['then'](function(_0x2a8a41){if(_0x2a8a41){if(!utils[_0xa390('0x9b')](_0x35f100)){throw new db[(_0xa390('0x87'))][(_0xa390('0x88'))](_0xa390('0x9c'));}return _0x2a8a41[_0xa390('0x9d')+_['capitalize'](_0x35f100[_0xa390('0x9e')]())+_0xa390('0x9f')](_0x56033e[_0xa390('0x56')]['ids'],{'penalty':_0x56033e[_0xa390('0x56')][_0xa390('0xa0')]||0x0})[_0xa390('0xa1')](function(_0x2f67c1){for(var _0x428096=0x0;_0x428096<_0x56033e[_0xa390('0x56')][_0xa390('0x59')][_0xa390('0x44')];_0x428096+=0x1){var _0x317387={'UserId':Number(_0x56033e[_0xa390('0x4d')]['id'])};_0x317387[_[_0xa390('0xa2')](_0x35f100[_0xa390('0x9e')]())+_0xa390('0xa3')]=Number(_0x56033e[_0xa390('0x56')][_0xa390('0x59')][_0x428096]);socket[_0xa390('0xa4')](_0xa390('0x26')+_[_0xa390('0xa2')](_0x35f100[_0xa390('0x9e')]())+_0xa390('0xa5'),_0x317387);}return _0x2f67c1;})[_0xa390('0x22')](function(){if(_0x35f100===_0xa390('0xa6')){return db[_0xa390('0xa7')]['findAll']({'where':{'id':_0x56033e[_0xa390('0x56')]['ids']||[]},'raw':!![],'attributes':['id',_0xa390('0x2d')]});}})[_0xa390('0x22')](function(_0x34b006){var _0x24c0f0=_0x2a8a41[_0xa390('0xa8')]({'plain':!![]});var _0x14ceee=[];if(_0x35f100===_0xa390('0xa6')&&_0x24c0f0[_0xa390('0x23')]===_0xa390('0x27')&&_0x24c0f0[_0xa390('0x98')]){for(var _0x2fd98b=0x0;_0x2fd98b<_0x34b006[_0xa390('0x44')];_0x2fd98b+=0x1){_0x14ceee['push']({'membername':_0x24c0f0[_0xa390('0x2d')],'UserId':_0x24c0f0['id'],'queue_name':_0x34b006[_0x2fd98b]['name'],'VoiceQueueId':_0x34b006[_0x2fd98b]['id'],'interface':_['isNil'](_0x24c0f0[_0xa390('0x9a')])?util[_0xa390('0xa9')](_0xa390('0xaa'),_0x24c0f0[_0xa390('0x2d')]):_0x24c0f0[_0xa390('0x9a')],'paused':_0x24c0f0[_0xa390('0xab')]||![],'penalty':_0x56033e['body'][_0xa390('0xa0')]||0x0});}return BPromise[_0xa390('0x81')](_0x14ceee,function(_0xf8f5a3){return db[_0xa390('0xac')][_0xa390('0xad')](_0xf8f5a3);});}return _0x2a8a41;});}})[_0xa390('0x22')](respondWithStatusCode(_0x58c90f,null))['catch'](handleError(_0x58c90f,null));};exports[_0xa390('0xae')]=function(_0x13b5f8,_0x6cf5d5){var _0x4df2ab;return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x13b5f8[_0xa390('0x4d')]['id']},'attributes':['id','name',_0xa390('0x23')]})[_0xa390('0x22')](handleEntityNotFound(_0x6cf5d5,null))[_0xa390('0x22')](function(_0x357f8e){if(_0x357f8e){_0x4df2ab=_0x357f8e;if(!_0x13b5f8['query'][_0xa390('0xaf')]||!utils[_0xa390('0x9b')](_0x13b5f8[_0xa390('0x40')][_0xa390('0xaf')])){throw new db[(_0xa390('0x87'))][(_0xa390('0x88'))](_0xa390('0x9c'));}return _0x357f8e[_0xa390('0xb0')+_[_0xa390('0xa2')](_0x13b5f8[_0xa390('0x40')][_0xa390('0xaf')][_0xa390('0x9e')]())+_0xa390('0x9f')](_0x13b5f8[_0xa390('0x40')]['ids']);}})[_0xa390('0x22')](function(_0x189ca7){if(_['isArray'](_0x13b5f8[_0xa390('0x40')]['ids'])){for(var _0x563e96=0x0;_0x563e96<_0x13b5f8[_0xa390('0x40')][_0xa390('0x59')][_0xa390('0x44')];_0x563e96+=0x1){var _0x1de755={'UserId':Number(_0x13b5f8[_0xa390('0x4d')]['id'])};_0x1de755[_[_0xa390('0xa2')](_0x13b5f8[_0xa390('0x40')][_0xa390('0xaf')]['toLowerCase']())+'QueueId']=Number(_0x13b5f8['query'][_0xa390('0x59')][_0x563e96]);socket['emit']('user'+_[_0xa390('0xa2')](_0x13b5f8[_0xa390('0x40')][_0xa390('0xaf')][_0xa390('0x9e')]())+_0xa390('0xb1'),_0x1de755);}}else{var _0x1de755={'UserId':Number(_0x13b5f8[_0xa390('0x4d')]['id'])};_0x1de755[_[_0xa390('0xa2')](_0x13b5f8['query'][_0xa390('0xaf')][_0xa390('0x9e')]())+_0xa390('0xa3')]=Number(_0x13b5f8['query']['ids']);socket['emit'](_0xa390('0x26')+_[_0xa390('0xa2')](_0x13b5f8[_0xa390('0x40')][_0xa390('0xaf')][_0xa390('0x9e')]())+_0xa390('0xb1'),_0x1de755);}return _0x189ca7;})[_0xa390('0x22')](function(){if(_0x13b5f8[_0xa390('0x40')][_0xa390('0xaf')]===_0xa390('0xa6')){return db[_0xa390('0xac')][_0xa390('0x2f')]({'where':{'UserId':_0x13b5f8[_0xa390('0x4d')]['id'],'VoiceQueueId':_0x13b5f8[_0xa390('0x40')][_0xa390('0x59')]},'individualHooks':!![]})[_0xa390('0x22')](function(){return _0x4df2ab;});}return _0x4df2ab;})[_0xa390('0x22')](respondWithStatusCode(_0x6cf5d5,null))['catch'](handleError(_0x6cf5d5,null));};exports[_0xa390('0xb2')]=function(_0x5da076,_0x5837d6){_0x5da076[_0xa390('0x56')][_0xa390('0xb3')]=_0x5da076['file'][_0xa390('0xb4')];return db['User'][_0xa390('0x2c')]({'where':{'id':_0x5da076[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x5837d6,null))[_0xa390('0x22')](saveUpdates(_0x5da076['body'],null))[_0xa390('0x22')](respondWithResult(_0x5837d6,null))[_0xa390('0x4c')](handleError(_0x5837d6,null));};exports[_0xa390('0xb5')]=function(_0xe9ac6b,_0x233ddb){var _0x4488b0=path[_0xa390('0xb6')](config[_0xa390('0xb7')],'server/files/images/logos/default_profile.png');return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0xe9ac6b[_0xa390('0x4d')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x233ddb,null))[_0xa390('0x22')](function(_0xb924ff){if(_0xb924ff){if(_['isNil'](_0xb924ff[_0xa390('0xb3')])){return _0x233ddb[_0xa390('0xb8')](_0x4488b0);}else{if(!fs[_0xa390('0xb9')](path[_0xa390('0xb6')](config['root'],'server/files/images/',_0xb924ff['userpic']))){return _0x233ddb[_0xa390('0xb8')](_0x4488b0);}return _0x233ddb['download'](path[_0xa390('0xb6')](config[_0xa390('0xb7')],_0xa390('0xba'),_0xb924ff[_0xa390('0xb3')]));}}})['catch'](handleError(_0x233ddb,null));};exports[_0xa390('0xbb')]=function(_0x1507b9,_0x4f352a){return db[_0xa390('0x33')]['find']({'where':{'id':_0x1507b9[_0xa390('0x4d')]['id']},'attributes':['id']})[_0xa390('0x22')](handleEntityNotFound(_0x4f352a,null))[_0xa390('0x22')](function(_0x2ca40f){var _0x4d0c11=[];values=_0x2ca40f['dataValues'];_0x4d0c11['push'](get_open_tabs(_0xa390('0x45'),_0x2ca40f[_0xa390('0x46')]));_0x4d0c11[_0xa390('0x3e')](get_open_tabs('sms',_0x2ca40f['dataValues']));_0x4d0c11[_0xa390('0x3e')](get_open_tabs(_0xa390('0x4a'),_0x2ca40f[_0xa390('0x46')]));_0x4d0c11['push'](get_open_tabs(_0xa390('0x55'),_0x2ca40f['dataValues']));_0x4d0c11[_0xa390('0x3e')](get_open_tabs(_0xa390('0x48'),_0x2ca40f['dataValues']));_0x4d0c11[_0xa390('0x3e')](get_open_tabs(_0xa390('0x49'),_0x2ca40f[_0xa390('0x46')]));return BPromise[_0xa390('0x4b')](_0x4d0c11);})[_0xa390('0x22')](function(_0x41cf88){var _0x55f651=[];if(_0x41cf88){for(var _0x53b126=0x0;_0x53b126<values[_0xa390('0xbc')][_0xa390('0x44')];_0x53b126++){var _0x1cea2e=values[_0xa390('0xbc')][_0x53b126];_0x55f651[_0xa390('0x3e')]({'channel':_0xa390('0xbd'),'id':_0x1cea2e['id'],'createdAt':_0x1cea2e[_0xa390('0xbe')]});}for(var _0x53b126=0x0;_0x53b126<values[_0xa390('0xbf')]['length'];_0x53b126++){var _0x1cea2e=values[_0xa390('0xbf')][_0x53b126];_0x55f651[_0xa390('0x3e')]({'channel':_0xa390('0xc0'),'id':_0x1cea2e['id'],'createdAt':_0x1cea2e[_0xa390('0xbe')]});}for(var _0x53b126=0x0;_0x53b126<values[_0xa390('0xc1')]['length'];_0x53b126++){var _0x1cea2e=values[_0xa390('0xc1')][_0x53b126];_0x55f651[_0xa390('0x3e')]({'channel':'OPENCHANNEL','id':_0x1cea2e['id'],'createdAt':_0x1cea2e[_0xa390('0xbe')]});}for(var _0x53b126=0x0;_0x53b126<values[_0xa390('0xc2')]['length'];_0x53b126++){var _0x1cea2e=values['MailOpenTabs'][_0x53b126];_0x55f651[_0xa390('0x3e')]({'channel':'MAIL','id':_0x1cea2e['id'],'createdAt':_0x1cea2e[_0xa390('0xbe')]});}for(var _0x53b126=0x0;_0x53b126<values[_0xa390('0xc3')][_0xa390('0x44')];_0x53b126++){var _0x1cea2e=values[_0xa390('0xc3')][_0x53b126];_0x55f651[_0xa390('0x3e')]({'channel':'SMS','id':_0x1cea2e['id'],'createdAt':_0x1cea2e[_0xa390('0xbe')]});}for(var _0x53b126=0x0;_0x53b126<values[_0xa390('0xc4')][_0xa390('0x44')];_0x53b126++){var _0x1cea2e=values[_0xa390('0xc4')][_0x53b126];_0x55f651[_0xa390('0x3e')]({'channel':'WHATSAPP','id':_0x1cea2e['id'],'createdAt':_0x1cea2e['createdAt']});}var _0x2829d2={'count':_0x55f651[_0xa390('0x44')],'rows':_0x55f651};return _0x2829d2;}else return null;})[_0xa390('0x22')](respondWithResult(_0x4f352a,null))[_0xa390('0x4c')](handleError(_0x4f352a,null));};exports[_0xa390('0xc5')]=function(_0x8532f4,_0x25a160){var _0x441ae3={};var _0x40d1b0={};var _0x4fe931;var _0x28bfca;return db[_0xa390('0x33')]['findOne']({'where':{'id':_0x8532f4[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x25a160,null))['then'](function(_0x5965f3){if(_0x5965f3){_0x4fe931=_0x5965f3;_0x40d1b0[_0xa390('0x4e')]=_[_0xa390('0x50')](db[_0xa390('0xc6')][_0xa390('0x34')]);_0x40d1b0['query']=_[_0xa390('0x50')](_0x8532f4[_0xa390('0x40')]);_0x40d1b0[_0xa390('0xc7')]=_['intersection'](_0x40d1b0[_0xa390('0x4e')],_0x40d1b0[_0xa390('0x40')]);_0x441ae3[_0xa390('0x3d')]=_['intersection'](_0x40d1b0[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x8532f4['query'][_0xa390('0x52')]));_0x441ae3[_0xa390('0x3d')]=_0x441ae3[_0xa390('0x3d')]['length']?_0x441ae3[_0xa390('0x3d')]:_0x40d1b0['model'];_0x441ae3['order']=qs[_0xa390('0xc8')](_0x8532f4[_0xa390('0x40')][_0xa390('0xc8')]);_0x441ae3[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x8532f4['query'],_0x40d1b0[_0xa390('0xc7')]));if(_0x8532f4[_0xa390('0x40')][_0xa390('0x2a')]){_0x441ae3[_0xa390('0x3b')]=_[_0xa390('0x53')](_0x441ae3[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x441ae3['attributes'],function(_0x138dd0){var _0x2f4e7f={};_0x2f4e7f[_0x138dd0]={'$like':'%'+_0x8532f4['query'][_0xa390('0x2a')]+'%'};return _0x2f4e7f;})});}_0x441ae3=_['merge']({},_0x441ae3,_0x8532f4[_0xa390('0x54')]);return _0x4fe931[_0xa390('0xc5')](_0x441ae3);}})[_0xa390('0x22')](function(_0x3a9a81){if(_0x3a9a81){_0x28bfca=_0x3a9a81[_0xa390('0x44')];if(_0x8532f4[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xcb'))){_0x441ae3['include']=[{'model':db[_0xa390('0xcc')],'as':'List','required':![]},{'model':db[_0xa390('0xcd')],'as':_0xa390('0xce'),'attributes':['id','name',_0xa390('0xcf')],'where':_0x8532f4[_0xa390('0x40')][_0xa390('0xd0')]?{'id':_0x8532f4[_0xa390('0x40')][_0xa390('0xd0')]}:undefined,'required':_0x8532f4[_0xa390('0x40')][_0xa390('0xd0')]?!![]:![]}];}if(!_0x8532f4[_0xa390('0x40')][_0xa390('0xca')]('nolimit')){_0x441ae3[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0x8532f4[_0xa390('0x40')][_0xa390('0x1e')]);_0x441ae3['offset']=qs[_0xa390('0x1c')](_0x8532f4['query']['offset']);}return _0x4fe931[_0xa390('0xc5')](_0x441ae3);}})[_0xa390('0x22')](function(_0x3969b6){if(_0x3969b6){return _0x3969b6?{'count':_0x28bfca,'rows':_0x3969b6}:null;}})['then'](respondWithResult(_0x25a160,null))[_0xa390('0x4c')](handleError(_0x25a160,null));};exports[_0xa390('0xd1')]=function(_0x5a2ba2,_0x29ae88){var _0x180829;var _0x5f10aa;var _0x4359af={};var _0x31c815;return db['User'][_0xa390('0x90')]({'where':{'id':_0x5a2ba2[_0xa390('0x4d')]['id']},'attributes':['id','name','role']})[_0xa390('0x22')](handleEntityNotFound(_0x29ae88,null))['then'](function(_0x2e59a0){if(!utils[_0xa390('0x9b')](_0x5a2ba2[_0xa390('0x40')][_0xa390('0xaf')])){throw new db[(_0xa390('0x87'))][(_0xa390('0x88'))](_0xa390('0x9c'));}_0x180829=_0x2e59a0;var _0x597f8b={};_0x597f8b['model']=_[_0xa390('0x50')](db[_[_0xa390('0xa2')](_0x5a2ba2[_0xa390('0x40')]['channel'])+_0xa390('0xd2')][_0xa390('0x34')]);_0x597f8b['query']=_[_0xa390('0x50')](_0x5a2ba2[_0xa390('0x40')]);_0x597f8b['filters']=_[_0xa390('0x51')](_0x597f8b[_0xa390('0x4e')],_0x597f8b[_0xa390('0x40')]);_0x4359af[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x597f8b['model'],qs[_0xa390('0x52')](_0x5a2ba2[_0xa390('0x40')][_0xa390('0x52')]));_0x4359af[_0xa390('0x3d')]=_0x4359af[_0xa390('0x3d')][_0xa390('0x44')]?_0x4359af[_0xa390('0x3d')]:_0x597f8b[_0xa390('0x4e')];_0x4359af['order']=qs[_0xa390('0xc8')](_0x5a2ba2[_0xa390('0x40')][_0xa390('0xc8')]);_0x4359af[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x5a2ba2[_0xa390('0x40')],_0x597f8b[_0xa390('0xc7')]));if(_0x5a2ba2[_0xa390('0x40')][_0xa390('0x2a')]){_0x4359af[_0xa390('0x3b')]=_[_0xa390('0x53')](_0x4359af[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x4359af['attributes'],function(_0x1c076c){var _0x534cd7={};_0x534cd7[_0x1c076c]={'$like':'%'+_0x5a2ba2['query'][_0xa390('0x2a')]+'%'};return _0x534cd7;})});}_0x4359af=_[_0xa390('0x53')]({},_0x4359af,_0x5a2ba2[_0xa390('0x54')]);switch(_0x180829[_0xa390('0x23')]){case _0xa390('0x24'):return db[_[_0xa390('0xa2')](_0x5a2ba2[_0xa390('0x40')][_0xa390('0xaf')])+'Queue'][_0xa390('0x3f')](_0x4359af);case _0xa390('0x26'):case'agent':return _0x180829[_0xa390('0xa8')+_['capitalize'](_0x5a2ba2[_0xa390('0x40')][_0xa390('0xaf')])+_0xa390('0x9f')](_0x4359af);default:throw new db[(_0xa390('0x87'))][(_0xa390('0x88'))](_0xa390('0xd3'));}})[_0xa390('0x22')](function(_0x278a1d){_0x31c815=_0x278a1d[_0xa390('0x44')];if(!_0x5a2ba2[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0x4359af[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0x5a2ba2[_0xa390('0x40')]['limit']);_0x4359af['offset']=qs[_0xa390('0x1c')](_0x5a2ba2[_0xa390('0x40')]['offset']);}switch(_0x180829['role']){case _0xa390('0x24'):return db[_[_0xa390('0xa2')](_0x5a2ba2[_0xa390('0x40')][_0xa390('0xaf')])+_0xa390('0xd2')]['findAll'](_0x4359af);case'user':case _0xa390('0x27'):return _0x180829[_0xa390('0xa8')+_[_0xa390('0xa2')](_0x5a2ba2[_0xa390('0x40')][_0xa390('0xaf')])+_0xa390('0x9f')](_0x4359af);}})[_0xa390('0x22')](function(_0x17407d){return{'count':_0x31c815,'rows':_0x17407d};})[_0xa390('0x22')](respondWithResult(_0x29ae88,null))[_0xa390('0x4c')](handleError(_0x29ae88,null));};exports[_0xa390('0xd5')]=function(_0x3f3096,_0x5ebd44){var _0x5473c4={};var _0x30dfd3={};var _0x40fafb;var _0x1a9e26;return db[_0xa390('0x33')][_0xa390('0x90')]({'where':{'id':_0x3f3096['params']['id']}})['then'](handleEntityNotFound(_0x5ebd44,null))[_0xa390('0x22')](function(_0x80c9ed){if(_0x80c9ed){_0x40fafb=_0x80c9ed;_0x30dfd3['model']=_[_0xa390('0x50')](db[_0xa390('0xac')][_0xa390('0x34')]);_0x30dfd3[_0xa390('0x40')]=_[_0xa390('0x50')](_0x3f3096[_0xa390('0x40')]);_0x30dfd3[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x30dfd3[_0xa390('0x4e')],_0x30dfd3['query']);_0x5473c4[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x30dfd3[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x3f3096['query'][_0xa390('0x52')]));_0x5473c4[_0xa390('0x3d')]=_0x5473c4[_0xa390('0x3d')]['length']?_0x5473c4[_0xa390('0x3d')]:_0x30dfd3[_0xa390('0x4e')];_0x5473c4['order']=qs[_0xa390('0xc8')](_0x3f3096['query'][_0xa390('0xc8')]);_0x5473c4['where']=qs[_0xa390('0xc7')](_['pick'](_0x3f3096[_0xa390('0x40')],_0x30dfd3[_0xa390('0xc7')]));if(_0x3f3096[_0xa390('0x40')][_0xa390('0x2a')]){_0x5473c4[_0xa390('0x3b')]=_[_0xa390('0x53')](_0x5473c4[_0xa390('0x3b')],{'$or':_['map'](_0x5473c4[_0xa390('0x3d')],function(_0x5390d1){var _0xcc1e62={};_0xcc1e62[_0x5390d1]={'$like':'%'+_0x3f3096['query'][_0xa390('0x2a')]+'%'};return _0xcc1e62;})});}_0x5473c4=_[_0xa390('0x53')]({},_0x5473c4,_0x3f3096[_0xa390('0x54')]);return _0x40fafb[_0xa390('0xd5')](_0x5473c4);}})['then'](function(_0x1c67b1){if(_0x1c67b1){_0x1a9e26=_0x1c67b1[_0xa390('0x44')];if(!_0x3f3096[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0x5473c4['limit']=qs['limit'](_0x3f3096[_0xa390('0x40')][_0xa390('0x1e')]);_0x5473c4[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x3f3096[_0xa390('0x40')][_0xa390('0x1c')]);}return _0x40fafb['getVoiceQueuesRt'](_0x5473c4);}})['then'](function(_0x357beb){if(_0x357beb){return _0x357beb?{'count':_0x1a9e26,'rows':_0x357beb}:null;}})[_0xa390('0x22')](respondWithResult(_0x5ebd44,null))[_0xa390('0x4c')](handleError(_0x5ebd44,null));};exports['getGroups']=function(_0x52b42e,_0x266bf8){var _0x45a8a5={};var _0x58e523={};var _0x61659a;var _0x3c9dd6;return db[_0xa390('0x33')]['findOne']({'where':{'id':_0x52b42e['params']['id']}})['then'](handleEntityNotFound(_0x266bf8,null))[_0xa390('0x22')](function(_0x5ef4a4){if(_0x5ef4a4){_0x61659a=_0x5ef4a4;_0x58e523[_0xa390('0x4e')]=_[_0xa390('0x50')](db['ChatGroup'][_0xa390('0x34')]);_0x58e523[_0xa390('0x40')]=_[_0xa390('0x50')](_0x52b42e['query']);_0x58e523[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x58e523[_0xa390('0x4e')],_0x58e523[_0xa390('0x40')]);_0x45a8a5[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x58e523[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x52b42e['query']['fields']));_0x45a8a5['attributes']=_0x45a8a5[_0xa390('0x3d')][_0xa390('0x44')]?_0x45a8a5[_0xa390('0x3d')]:_0x58e523['model'];_0x45a8a5[_0xa390('0xd6')]=qs[_0xa390('0xc8')](_0x52b42e['query'][_0xa390('0xc8')]);_0x45a8a5['where']=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x52b42e[_0xa390('0x40')],_0x58e523[_0xa390('0xc7')]));if(_0x52b42e[_0xa390('0x40')][_0xa390('0x2a')]){_0x45a8a5[_0xa390('0x3b')]=_[_0xa390('0x53')](_0x45a8a5['where'],{'$or':_[_0xa390('0x35')](_0x45a8a5[_0xa390('0x3d')],function(_0x2a472b){var _0x2d77e4={};_0x2d77e4[_0x2a472b]={'$like':'%'+_0x52b42e[_0xa390('0x40')]['filter']+'%'};return _0x2d77e4;})});}_0x45a8a5=_[_0xa390('0x53')]({},_0x45a8a5,_0x52b42e[_0xa390('0x54')]);return _0x61659a[_0xa390('0xd7')](_0x45a8a5);}})[_0xa390('0x22')](function(_0x1bb460){if(_0x1bb460){_0x3c9dd6=_0x1bb460['length'];if(!_0x52b42e['query'][_0xa390('0xca')]('nolimit')){_0x45a8a5['limit']=qs[_0xa390('0x1e')](_0x52b42e[_0xa390('0x40')][_0xa390('0x1e')]);_0x45a8a5[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x52b42e[_0xa390('0x40')][_0xa390('0x1c')]);}return _0x61659a['getGroups'](_0x45a8a5);}})[_0xa390('0x22')](function(_0x220f72){if(_0x220f72){return _0x220f72?{'count':_0x3c9dd6,'rows':_0x220f72}:null;}})[_0xa390('0x22')](respondWithResult(_0x266bf8,null))[_0xa390('0x4c')](handleError(_0x266bf8,null));};exports[_0xa390('0xd8')]=function(_0x30ccdc,_0x75352){var _0xd9c555={'raw':!![],'where':{}};var _0x3735a3={};var _0x1f952d={'count':0x0,'rows':[]};return db[_0xa390('0x33')][_0xa390('0x90')]({'where':{'id':_0x30ccdc[_0xa390('0x4d')]['id']}})['then'](handleEntityNotFound(_0x75352,null))['then'](function(_0x350622){if(_0x350622){_0x3735a3[_0xa390('0x4e')]=_['keys'](db['VoiceRecording'][_0xa390('0x34')]);_0x3735a3[_0xa390('0x40')]=_['keys'](_0x30ccdc[_0xa390('0x40')]);_0x3735a3[_0xa390('0xc7')]=_['intersection'](_0x3735a3[_0xa390('0x4e')],_0x3735a3[_0xa390('0x40')]);_0xd9c555['attributes']=_[_0xa390('0x51')](_0x3735a3[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x30ccdc[_0xa390('0x40')][_0xa390('0x52')]));_0xd9c555[_0xa390('0x3d')]=_0xd9c555['attributes'][_0xa390('0x44')]?_0xd9c555[_0xa390('0x3d')]:_0x3735a3[_0xa390('0x4e')];if(!_0x30ccdc[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0xd9c555['limit']=qs[_0xa390('0x1e')](_0x30ccdc[_0xa390('0x40')][_0xa390('0x1e')]);_0xd9c555[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x30ccdc[_0xa390('0x40')]['offset']);}_0xd9c555['order']=qs['sort'](_0x30ccdc[_0xa390('0x40')]['sort']);_0xd9c555[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x30ccdc[_0xa390('0x40')],_0x3735a3[_0xa390('0xc7')]));_0xd9c555[_0xa390('0x3b')][_0xa390('0xd9')]=_0x350622['id'];if(_0x30ccdc[_0xa390('0x40')][_0xa390('0x2a')]){_0xd9c555[_0xa390('0x3b')]=_[_0xa390('0x53')](_0xd9c555[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0xd9c555[_0xa390('0x3d')],function(_0x526837){var _0x1863d2={};_0x1863d2[_0x526837]={'$like':'%'+_0x30ccdc[_0xa390('0x40')]['filter']+'%'};return _0x1863d2;})});}_0xd9c555=_[_0xa390('0x53')]({},_0xd9c555,_0x30ccdc[_0xa390('0x54')]);return db[_0xa390('0xda')][_0xa390('0x1f')]({'where':_0xd9c555[_0xa390('0x3b')]})[_0xa390('0x22')](function(_0x62f04d){_0x1f952d['count']=_0x62f04d;if(_0x30ccdc['query']['includeAll']){_0xd9c555[_0xa390('0x3c')]=[{'all':!![]}];}return db[_0xa390('0xda')][_0xa390('0x3f')](_0xd9c555);})[_0xa390('0x22')](function(_0x3a29f7){_0x1f952d[_0xa390('0x43')]=_0x3a29f7;return _0x1f952d;});}})[_0xa390('0x22')](respondWithFilteredResult(_0x75352,_0xd9c555))[_0xa390('0x4c')](handleError(_0x75352,null));};exports[_0xa390('0xdb')]=function(_0x548bda,_0x48ae69){var _0x560d3d={'raw':!![],'where':{}};var _0x104cd4={};var _0x46c50a={'count':0x0,'rows':[]};return db[_0xa390('0x33')][_0xa390('0x90')]({'where':{'id':_0x548bda[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x48ae69,null))[_0xa390('0x22')](function(_0x1d65e0){if(_0x1d65e0){_0x104cd4[_0xa390('0x4e')]=_[_0xa390('0x50')](db['ScreenRecording'][_0xa390('0x34')]);_0x104cd4['query']=_[_0xa390('0x50')](_0x548bda['query']);_0x104cd4[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x104cd4[_0xa390('0x4e')],_0x104cd4['query']);_0x560d3d[_0xa390('0x3d')]=_['intersection'](_0x104cd4[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x548bda[_0xa390('0x40')][_0xa390('0x52')]));_0x560d3d[_0xa390('0x3d')]=_0x560d3d[_0xa390('0x3d')][_0xa390('0x44')]?_0x560d3d[_0xa390('0x3d')]:_0x104cd4[_0xa390('0x4e')];if(!_0x548bda[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0x560d3d[_0xa390('0x1e')]=qs['limit'](_0x548bda['query'][_0xa390('0x1e')]);_0x560d3d[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x548bda[_0xa390('0x40')]['offset']);}_0x560d3d[_0xa390('0xd6')]=qs[_0xa390('0xc8')](_0x548bda[_0xa390('0x40')]['sort']);_0x560d3d[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x548bda['query'],_0x104cd4[_0xa390('0xc7')]));_0x560d3d[_0xa390('0x3b')][_0xa390('0xd9')]=_0x1d65e0['id'];if(_0x548bda[_0xa390('0x40')][_0xa390('0x2a')]){_0x560d3d[_0xa390('0x3b')]=_['merge'](_0x560d3d[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x560d3d[_0xa390('0x3d')],function(_0x3ed8c5){var _0x9d5044={};_0x9d5044[_0x3ed8c5]={'$like':'%'+_0x548bda[_0xa390('0x40')][_0xa390('0x2a')]+'%'};return _0x9d5044;})});}_0x560d3d=_[_0xa390('0x53')]({},_0x560d3d,_0x548bda[_0xa390('0x54')]);return db[_0xa390('0xdc')]['count']({'where':_0x560d3d[_0xa390('0x3b')]})['then'](function(_0x5ef251){_0x46c50a[_0xa390('0x1f')]=_0x5ef251;if(_0x548bda[_0xa390('0x40')][_0xa390('0xcb')]){_0x560d3d[_0xa390('0x3c')]=[{'all':!![]}];}return db[_0xa390('0xdc')]['findAll'](_0x560d3d);})['then'](function(_0x279b69){_0x46c50a[_0xa390('0x43')]=_0x279b69;return _0x46c50a;});}})[_0xa390('0x22')](respondWithFilteredResult(_0x48ae69,_0x560d3d))['catch'](handleError(_0x48ae69,null));};exports[_0xa390('0xdd')]=function(_0x22623e,_0x232f97){var _0xe5ca0f={};var _0x15742a={};var _0x122aca;var _0x3ce379;return db[_0xa390('0x33')][_0xa390('0x90')]({'where':{'id':_0x22623e[_0xa390('0x4d')]['id']}})['then'](handleEntityNotFound(_0x232f97,null))[_0xa390('0x22')](function(_0x3ceaa3){if(_0x3ceaa3){_0x122aca=_0x3ceaa3;_0x15742a[_0xa390('0x4e')]=_[_0xa390('0x50')](db[_0xa390('0xde')][_0xa390('0x34')]);_0x15742a[_0xa390('0x40')]=_[_0xa390('0x50')](_0x22623e[_0xa390('0x40')]);_0x15742a[_0xa390('0xc7')]=_['intersection'](_0x15742a[_0xa390('0x4e')],_0x15742a[_0xa390('0x40')]);_0xe5ca0f[_0xa390('0x3d')]=_['intersection'](_0x15742a[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x22623e['query'][_0xa390('0x52')]));_0xe5ca0f[_0xa390('0x3d')]=_0xe5ca0f[_0xa390('0x3d')]['length']?_0xe5ca0f[_0xa390('0x3d')]:_0x15742a[_0xa390('0x4e')];_0xe5ca0f['order']=qs['sort'](_0x22623e[_0xa390('0x40')][_0xa390('0xc8')]);_0xe5ca0f['where']=qs['filters'](_[_0xa390('0xc9')](_0x22623e[_0xa390('0x40')],_0x15742a[_0xa390('0xc7')]));if(_0x22623e['query'][_0xa390('0x2a')]){_0xe5ca0f[_0xa390('0x3b')]=_[_0xa390('0x53')](_0xe5ca0f[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0xe5ca0f[_0xa390('0x3d')],function(_0x1ef526){var _0x11cd7e={};_0x11cd7e[_0x1ef526]={'$like':'%'+_0x22623e['query'][_0xa390('0x2a')]+'%'};return _0x11cd7e;})});}_0xe5ca0f=_[_0xa390('0x53')]({},_0xe5ca0f,_0x22623e[_0xa390('0x54')]);return _0x122aca[_0xa390('0xdd')](_0xe5ca0f);}})['then'](function(_0x10b7ab){if(_0x10b7ab){_0x3ce379=_0x10b7ab['length'];if(!_0x22623e[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0xe5ca0f['limit']=qs['limit'](_0x22623e['query'][_0xa390('0x1e')]);_0xe5ca0f[_0xa390('0x1c')]=qs['offset'](_0x22623e['query'][_0xa390('0x1c')]);}return _0x122aca[_0xa390('0xdd')](_0xe5ca0f);}})['then'](function(_0x569005){if(_0x569005){return _0x569005?{'count':_0x3ce379,'rows':_0x569005}:null;}})[_0xa390('0x22')](respondWithResult(_0x232f97,null))['catch'](handleError(_0x232f97,null));};exports[_0xa390('0xdf')]=function(_0x2aba0c,_0x43cfa4){var _0x43abbb={};var _0x10bd51={};var _0x45732e;var _0x406eec;return db[_0xa390('0x33')][_0xa390('0x90')]({'where':{'id':_0x2aba0c[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x43cfa4,null))[_0xa390('0x22')](function(_0x12aed2){if(_0x12aed2){_0x45732e=_0x12aed2;_0x10bd51[_0xa390('0x4e')]=_['keys'](db['OpenchannelInteraction']['rawAttributes']);_0x10bd51[_0xa390('0x40')]=_[_0xa390('0x50')](_0x2aba0c[_0xa390('0x40')]);_0x10bd51['filters']=_[_0xa390('0x51')](_0x10bd51[_0xa390('0x4e')],_0x10bd51[_0xa390('0x40')]);_0x43abbb[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x10bd51['model'],qs[_0xa390('0x52')](_0x2aba0c[_0xa390('0x40')][_0xa390('0x52')]));_0x43abbb[_0xa390('0x3d')]=_0x43abbb[_0xa390('0x3d')][_0xa390('0x44')]?_0x43abbb['attributes']:_0x10bd51[_0xa390('0x4e')];_0x43abbb['order']=qs[_0xa390('0xc8')](_0x2aba0c[_0xa390('0x40')][_0xa390('0xc8')]);_0x43abbb[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x2aba0c['query'],_0x10bd51[_0xa390('0xc7')]));if(_0x2aba0c['query'][_0xa390('0x2a')]){_0x43abbb[_0xa390('0x3b')]=_[_0xa390('0x53')](_0x43abbb[_0xa390('0x3b')],{'$or':_['map'](_0x43abbb[_0xa390('0x3d')],function(_0x4deebb){var _0x82ffe6={};_0x82ffe6[_0x4deebb]={'$like':'%'+_0x2aba0c['query'][_0xa390('0x2a')]+'%'};return _0x82ffe6;})});}_0x43abbb=_['merge']({},_0x43abbb,_0x2aba0c[_0xa390('0x54')]);return _0x45732e[_0xa390('0xdf')](_0x43abbb);}})[_0xa390('0x22')](function(_0x3be790){if(_0x3be790){_0x406eec=_0x3be790[_0xa390('0x44')];if(!_0x2aba0c[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0x43abbb[_0xa390('0x1e')]=qs['limit'](_0x2aba0c[_0xa390('0x40')][_0xa390('0x1e')]);_0x43abbb[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x2aba0c[_0xa390('0x40')]['offset']);}return _0x45732e[_0xa390('0xdf')](_0x43abbb);}})[_0xa390('0x22')](function(_0x4c400c){if(_0x4c400c){return _0x4c400c?{'count':_0x406eec,'rows':_0x4c400c}:null;}})[_0xa390('0x22')](respondWithResult(_0x43cfa4,null))[_0xa390('0x4c')](handleError(_0x43cfa4,null));};exports['getMailInteractions']=function(_0x4ef9ad,_0x37e896){var _0x179bf8={'raw':!![],'where':{}};var _0x2d39ce={};var _0x13939b={'count':0x0,'rows':[]};return db[_0xa390('0x33')]['findOne']({'where':{'id':_0x4ef9ad[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x37e896,null))[_0xa390('0x22')](function(_0x3142d4){if(_0x3142d4){_0x2d39ce[_0xa390('0x4e')]=_[_0xa390('0x50')](db[_0xa390('0xe0')][_0xa390('0x34')]);_0x2d39ce[_0xa390('0x40')]=_[_0xa390('0x50')](_0x4ef9ad[_0xa390('0x40')]);_0x2d39ce[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x2d39ce[_0xa390('0x4e')],_0x2d39ce['query']);_0x179bf8[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x2d39ce['model'],qs['fields'](_0x4ef9ad['query']['fields']));_0x179bf8[_0xa390('0x3d')]=_0x179bf8[_0xa390('0x3d')][_0xa390('0x44')]?_0x179bf8[_0xa390('0x3d')]:_0x2d39ce[_0xa390('0x4e')];if(!_0x4ef9ad[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0x179bf8[_0xa390('0x1e')]=qs['limit'](_0x4ef9ad[_0xa390('0x40')][_0xa390('0x1e')]);_0x179bf8['offset']=qs[_0xa390('0x1c')](_0x4ef9ad[_0xa390('0x40')][_0xa390('0x1c')]);}_0x179bf8[_0xa390('0xd6')]=qs[_0xa390('0xc8')](_0x4ef9ad[_0xa390('0x40')][_0xa390('0xc8')]);_0x179bf8[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_['pick'](_0x4ef9ad[_0xa390('0x40')],_0x2d39ce[_0xa390('0xc7')]));_0x179bf8[_0xa390('0x3b')]['UserId']=_0x3142d4['id'];if(_0x4ef9ad[_0xa390('0x40')][_0xa390('0x2a')]){_0x179bf8['where']=_[_0xa390('0x53')](_0x179bf8[_0xa390('0x3b')],{'$or':_['map'](_0x179bf8[_0xa390('0x3d')],function(_0x5f3d59){var _0x1a521a={};_0x1a521a[_0x5f3d59]={'$like':'%'+_0x4ef9ad[_0xa390('0x40')][_0xa390('0x2a')]+'%'};return _0x1a521a;})});}_0x179bf8=_[_0xa390('0x53')]({},_0x179bf8,_0x4ef9ad[_0xa390('0x54')]);return db[_0xa390('0xe0')][_0xa390('0x1f')]({'where':_0x179bf8['where']})[_0xa390('0x22')](function(_0x49ae76){_0x13939b['count']=_0x49ae76;if(_0x4ef9ad['query'][_0xa390('0xcb')]){_0x179bf8['include']=[{'all':!![]}];}return db[_0xa390('0xe0')]['findAll'](_0x179bf8);})['then'](function(_0x9aa49d){_0x13939b['rows']=_0x9aa49d;return _0x13939b;});}})[_0xa390('0x22')](respondWithFilteredResult(_0x37e896,_0x179bf8))[_0xa390('0x4c')](handleError(_0x37e896,null));};exports[_0xa390('0xe1')]=function(_0x34ff82,_0x1be65e){var _0x517266={};var _0x29855e={};var _0x3716d4;var _0x521779;return db['User']['findOne']({'where':{'id':_0x34ff82[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x1be65e,null))[_0xa390('0x22')](function(_0x46d5eb){if(_0x46d5eb){_0x3716d4=_0x46d5eb;_0x29855e['model']=_[_0xa390('0x50')](db[_0xa390('0xe2')][_0xa390('0x34')]);_0x29855e[_0xa390('0x40')]=_[_0xa390('0x50')](_0x34ff82[_0xa390('0x40')]);_0x29855e['filters']=_[_0xa390('0x51')](_0x29855e['model'],_0x29855e['query']);_0x517266['attributes']=_[_0xa390('0x51')](_0x29855e[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x34ff82[_0xa390('0x40')][_0xa390('0x52')]));_0x517266['attributes']=_0x517266[_0xa390('0x3d')][_0xa390('0x44')]?_0x517266[_0xa390('0x3d')]:_0x29855e[_0xa390('0x4e')];_0x517266['order']=qs[_0xa390('0xc8')](_0x34ff82['query']['sort']);_0x517266[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x34ff82[_0xa390('0x40')],_0x29855e[_0xa390('0xc7')]));if(_0x34ff82[_0xa390('0x40')][_0xa390('0x2a')]){_0x517266[_0xa390('0x3b')]=_[_0xa390('0x53')](_0x517266[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x517266[_0xa390('0x3d')],function(_0x4cc7de){var _0x48b6ab={};_0x48b6ab[_0x4cc7de]={'$like':'%'+_0x34ff82[_0xa390('0x40')]['filter']+'%'};return _0x48b6ab;})});}_0x517266=_['merge']({},_0x517266,_0x34ff82[_0xa390('0x54')]);return _0x3716d4[_0xa390('0xe1')](_0x517266);}})[_0xa390('0x22')](function(_0xe5094){if(_0xe5094){_0x521779=_0xe5094[_0xa390('0x44')];if(!_0x34ff82[_0xa390('0x40')][_0xa390('0xca')]('nolimit')){_0x517266[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0x34ff82['query']['limit']);_0x517266[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x34ff82[_0xa390('0x40')][_0xa390('0x1c')]);}return _0x3716d4[_0xa390('0xe1')](_0x517266);}})[_0xa390('0x22')](function(_0x55d400){if(_0x55d400){return _0x55d400?{'count':_0x521779,'rows':_0x55d400}:null;}})[_0xa390('0x22')](respondWithResult(_0x1be65e,null))[_0xa390('0x4c')](handleError(_0x1be65e,null));};exports[_0xa390('0xe3')]=function(_0x5f4bae,_0x1e9d7e){var _0x5f5cff={};var _0x3d7cc0={};var _0x337f28;var _0x2c8091;return db[_0xa390('0x33')][_0xa390('0x90')]({'where':{'id':_0x5f4bae[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x1e9d7e,null))[_0xa390('0x22')](function(_0x249aa7){if(_0x249aa7){_0x337f28=_0x249aa7;_0x3d7cc0['model']=_['keys'](db[_0xa390('0xe4')][_0xa390('0x34')]);_0x3d7cc0[_0xa390('0x40')]=_['keys'](_0x5f4bae[_0xa390('0x40')]);_0x3d7cc0[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x3d7cc0['model'],_0x3d7cc0[_0xa390('0x40')]);_0x5f5cff['attributes']=_[_0xa390('0x51')](_0x3d7cc0['model'],qs[_0xa390('0x52')](_0x5f4bae[_0xa390('0x40')][_0xa390('0x52')]));_0x5f5cff[_0xa390('0x3d')]=_0x5f5cff[_0xa390('0x3d')][_0xa390('0x44')]?_0x5f5cff[_0xa390('0x3d')]:_0x3d7cc0[_0xa390('0x4e')];_0x5f5cff['order']=qs['sort'](_0x5f4bae[_0xa390('0x40')][_0xa390('0xc8')]);_0x5f5cff[_0xa390('0x3b')]=qs['filters'](_[_0xa390('0xc9')](_0x5f4bae[_0xa390('0x40')],_0x3d7cc0['filters']));if(_0x5f4bae[_0xa390('0x40')]['filter']){_0x5f5cff[_0xa390('0x3b')]=_['merge'](_0x5f5cff[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x5f5cff[_0xa390('0x3d')],function(_0x11b215){var _0x2cdf7b={};_0x2cdf7b[_0x11b215]={'$like':'%'+_0x5f4bae[_0xa390('0x40')][_0xa390('0x2a')]+'%'};return _0x2cdf7b;})});}_0x5f5cff=_['merge']({},_0x5f5cff,_0x5f4bae[_0xa390('0x54')]);return _0x337f28[_0xa390('0xe3')](_0x5f5cff);}})['then'](function(_0x3ba789){if(_0x3ba789){_0x2c8091=_0x3ba789[_0xa390('0x44')];if(!_0x5f4bae[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0x5f5cff['limit']=qs[_0xa390('0x1e')](_0x5f4bae[_0xa390('0x40')][_0xa390('0x1e')]);_0x5f5cff[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x5f4bae['query'][_0xa390('0x1c')]);}return _0x337f28[_0xa390('0xe3')](_0x5f5cff);}})[_0xa390('0x22')](function(_0x436339){if(_0x436339){return _0x436339?{'count':_0x2c8091,'rows':_0x436339}:null;}})[_0xa390('0x22')](respondWithResult(_0x1e9d7e,null))[_0xa390('0x4c')](handleError(_0x1e9d7e,null));};exports[_0xa390('0xe5')]=function(_0x8f25e7,_0x8e0569){var _0xfedb8d={};var _0x34cc0e={};var _0x2b9d33;var _0x31f50e;return db[_0xa390('0x33')]['findOne']({'where':{'id':_0x8f25e7[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x8e0569,null))[_0xa390('0x22')](function(_0x48127c){if(_0x48127c){_0x2b9d33=_0x48127c;_0x34cc0e[_0xa390('0x4e')]=_[_0xa390('0x50')](db[_0xa390('0xe6')][_0xa390('0x34')]);_0x34cc0e[_0xa390('0x40')]=_[_0xa390('0x50')](_0x8f25e7[_0xa390('0x40')]);_0x34cc0e[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x34cc0e[_0xa390('0x4e')],_0x34cc0e[_0xa390('0x40')]);_0xfedb8d[_0xa390('0x3d')]=_['intersection'](_0x34cc0e[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x8f25e7[_0xa390('0x40')][_0xa390('0x52')]));_0xfedb8d[_0xa390('0x3d')]=_0xfedb8d[_0xa390('0x3d')][_0xa390('0x44')]?_0xfedb8d[_0xa390('0x3d')]:_0x34cc0e[_0xa390('0x4e')];_0xfedb8d['order']=qs['sort'](_0x8f25e7[_0xa390('0x40')]['sort']);_0xfedb8d['where']=qs[_0xa390('0xc7')](_['pick'](_0x8f25e7[_0xa390('0x40')],_0x34cc0e[_0xa390('0xc7')]));if(_0x8f25e7[_0xa390('0x40')][_0xa390('0x2a')]){_0xfedb8d['where']=_[_0xa390('0x53')](_0xfedb8d[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0xfedb8d[_0xa390('0x3d')],function(_0x4618e1){var _0x5c1c0c={};_0x5c1c0c[_0x4618e1]={'$like':'%'+_0x8f25e7[_0xa390('0x40')][_0xa390('0x2a')]+'%'};return _0x5c1c0c;})});}_0xfedb8d=_[_0xa390('0x53')]({},_0xfedb8d,_0x8f25e7['options']);return _0x2b9d33[_0xa390('0xe5')](_0xfedb8d);}})[_0xa390('0x22')](function(_0x34dfa9){if(_0x34dfa9){_0x31f50e=_0x34dfa9[_0xa390('0x44')];if(!_0x8f25e7[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0xfedb8d[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0x8f25e7[_0xa390('0x40')][_0xa390('0x1e')]);_0xfedb8d['offset']=qs['offset'](_0x8f25e7['query'][_0xa390('0x1c')]);}return _0x2b9d33[_0xa390('0xe5')](_0xfedb8d);}})[_0xa390('0x22')](function(_0xa3969f){if(_0xa3969f){return _0xa3969f?{'count':_0x31f50e,'rows':_0xa3969f}:null;}})[_0xa390('0x22')](respondWithResult(_0x8e0569,null))['catch'](handleError(_0x8e0569,null));};exports[_0xa390('0xe7')]=function(_0x528b8d,_0x49df17,_0x5a787d){var _0x427544;var _0x10301b;var _0x443b34;var _0x184232=!_[_0xa390('0x60')](_0x528b8d[_0xa390('0x4d')]['id'])?_0x528b8d['params']['id']:!_[_0xa390('0x60')](_0x528b8d[_0xa390('0x26')]['id'])?_0x528b8d[_0xa390('0x26')]['id']:null;return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x184232,'role':{'$or':['admin',_0xa390('0x26'),_0xa390('0x27')]}},'attributes':['id',_0xa390('0x2d'),_0xa390('0xe8'),_0xa390('0xe9'),_0xa390('0x23'),_0xa390('0x5a'),_0xa390('0x99')]})['then'](function(_0x1a738a){if(_0x1a738a){if(_0x1a738a['role']===_0xa390('0x27')){_0x427544=_0x1a738a;if(_0x528b8d[_0xa390('0x56')][_0xa390('0x9a')]){_0x443b34=util[_0xa390('0xa9')](_0xa390('0xea'),_0x427544[_0x528b8d[_0xa390('0x56')]['interface']]);}else if(_0x528b8d[_0xa390('0x56')][_0xa390('0xeb')]){_0x443b34=util['format'](_0xa390('0xaa'),_0x528b8d[_0xa390('0x56')]['intrf']);}else{_0x443b34=util[_0xa390('0xa9')](_0xa390('0xaa'),_0x427544['name']);}socket['to'](util[_0xa390('0xa9')](_0xa390('0xec'),_0x427544[_0xa390('0x2d')]))[_0xa390('0xa4')]('user:forcelogout',{'user':{'id':_0x427544['id'],'name':_0x427544[_0xa390('0x2d')]},'ip':_0x528b8d[_0xa390('0xed')][_0xa390('0xee')]||_0x528b8d['connection'][_0xa390('0xef')]||_0x528b8d[_0xa390('0xf0')][_0xa390('0xef')]||_0x528b8d[_0xa390('0xf1')]['socket']['remoteAddress']});return db['UserVoiceQueueRt'][_0xa390('0x2f')]({'where':{'membername':_0x427544[_0xa390('0x2d')]},'individualHooks':!![]});}}else{throw new db[(_0xa390('0x87'))]['ValidationError'](_0xa390('0xf2'));}})[_0xa390('0x22')](function(){if(_0x427544){return _0x427544[_0xa390('0xf3')]({'raw':!![]});}})[_0xa390('0x22')](function(_0xe16260){if(_0x427544){var _0x26da7a=[];if(_0xe16260){_0x10301b=_0xe16260;if(_0x10301b[_0xa390('0x44')]){for(var _0x54bb51=0x0;_0x54bb51<_0x10301b[_0xa390('0x44')];_0x54bb51++){_0x26da7a[_0xa390('0x3e')]({'membername':_0x427544[_0xa390('0x2d')],'UserId':_0x427544['id'],'queue_name':_0x10301b[_0x54bb51]['name'],'VoiceQueueId':_0x10301b[_0x54bb51]['id'],'interface':_0x443b34,'paused':_0x427544[_0xa390('0x99')]||![],'penalty':_0x10301b[_0x54bb51][_0xa390('0xf4')]||0x0});}return BPromise['each'](_0x26da7a,function(_0x4abbdf){return db[_0xa390('0xac')][_0xa390('0xad')](_0x4abbdf);});}}}})[_0xa390('0x22')](function(){if(_0x427544){return db['MemberReport']['findAll']({'where':{'membername':_0x427544[_0xa390('0x2d')],'exitAt':null}});}})['then'](function(_0x47e99c){if(_0x427544){var _0x4499ce=[];_0x47e99c['forEach'](function(_0x3ed4d8){_0x4499ce[_0xa390('0x3e')](_0x3ed4d8[_0xa390('0x21')]({'exitAt':moment()[_0xa390('0xa9')](_0xa390('0xf5'))}));});return BPromise['all'](_0x4499ce);}})['then'](function(){if(_0x427544){var _0x344061=[];var _0x4eb047=[];var _0x1de26f=utils[_0xa390('0xf6')]();var _0x5b9ec2={'membername':_0x427544[_0xa390('0x2d')],'interface':_0x443b34,'enterAt':moment()['format'](_0xa390('0xf5')),'role':_0x427544[_0xa390('0x23')],'internal':_0x427544['internal']};_0x1de26f[_0xa390('0xf7')](function(_0x33dcee){_0x344061[_0xa390('0x3e')](_['merge']({'channel':_0x33dcee,'type':_0xa390('0xf8'),'data1':_0x528b8d[_0xa390('0x56')][_0xa390('0xf9')],'data2':_0x443b34},_0x5b9ec2));if(_0x427544[_0xa390('0x99')]){_0x4eb047[_0xa390('0x3e')](_[_0xa390('0x53')]({'channel':_0x33dcee,'type':_0xa390('0xfa'),'data1':_0xa390('0xfb')},_0x5b9ec2));}});return db[_0xa390('0xfc')]['bulkCreate'](_0x344061[_0xa390('0xfd')](_0x4eb047),{'individualHooks':!![]});}})[_0xa390('0x22')](function(){if(_0x427544){return _0x427544[_0xa390('0x21')]({'online':!![],'lastLoginAt':moment()[_0xa390('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x427544[_0xa390('0x99')]||![],'mailPause':_0x427544[_0xa390('0x99')]||![],'chatPause':_0x427544[_0xa390('0x99')]||![],'faxPause':_0x427544[_0xa390('0x99')]||![],'smsPause':_0x427544[_0xa390('0x99')]||![],'openchannelPause':_0x427544[_0xa390('0x99')]||![],'whatsappPause':_0x427544[_0xa390('0x99')]||![],'pauseType':_0x427544[_0xa390('0x99')]?_0xa390('0xfb'):null,'interface':_0x443b34,'lastPauseAt':moment()[_0xa390('0xa9')](_0xa390('0xf5'))});}})['then'](function(_0x44712d){if(_0x528b8d['isMiddleware']){return _0x5a787d();}else{return BPromise[_0xa390('0xfe')](_0x44712d)[_0xa390('0x22')](respondWithResult(_0x49df17,null));}})[_0xa390('0x4c')](handleError(_0x49df17,null));};exports[_0xa390('0xff')]=function(_0xaa9279,_0x3aa069){var _0x438b08;return db['User'][_0xa390('0x2c')]({'where':{'id':_0xaa9279[_0xa390('0x4d')]['id'],'role':_0xa390('0x27')},'attributes':['id',_0xa390('0x2d'),_0xa390('0x23')]})['then'](handleEntityNotFound(_0x3aa069,null))['then'](function(_0x3a911d){if(_0x3a911d){_0x438b08=_0x3a911d;return db[_0xa390('0xac')]['destroy']({'where':{'membername':_0x438b08[_0xa390('0x2d')]},'individualHooks':!![]});}})[_0xa390('0x22')](function(){return db[_0xa390('0xfc')]['findAll']({'where':{'membername':_0x438b08[_0xa390('0x2d')],'exitAt':null}});})['then'](function(_0x2c7be4){var _0x4426e5=[];_0x2c7be4[_0xa390('0xf7')](function(_0x4163ca){_0x4426e5[_0xa390('0x3e')](_0x4163ca[_0xa390('0x21')]({'exitAt':moment()[_0xa390('0xa9')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x4426e5);})[_0xa390('0x22')](function(){return _0x438b08[_0xa390('0x21')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x3aa069,null))[_0xa390('0x4c')](handleError(_0x3aa069,null));};exports[_0xa390('0x100')]=function(_0x3b90f3,_0x2cb37b){var _0x17b676;return db[_0xa390('0xac')]['update']({'paused':0x1},{'where':{'UserId':_0x3b90f3['params']['id']},'individualHooks':!![]})[_0xa390('0x22')](function(){return db['User'][_0xa390('0x2c')]({'where':{'id':_0x3b90f3[_0xa390('0x4d')]['id'],'role':'agent'},'attributes':['id',_0xa390('0x2d'),_0xa390('0x23'),_0xa390('0x5a'),'interface']});})[_0xa390('0x22')](handleEntityNotFound(_0x2cb37b,null))[_0xa390('0x22')](function(_0x258748){if(_0x258748){_0x17b676=_0x258748;return respondWithRpcPromise(_0xa390('0x101'),_0xa390('0x100'),{'id':_0x17b676['id'],'name':_0x17b676[_0xa390('0x2d')],'pause':!![]});}})[_0xa390('0x22')](function(){if(_0x17b676){return db[_0xa390('0xfc')][_0xa390('0x3f')]({'where':{'membername':_0x17b676[_0xa390('0x2d')],'type':_0xa390('0xfa'),'exitAt':null}});}})[_0xa390('0x22')](function(_0x195e61){if(_0x195e61[_0xa390('0x44')]){var _0x138417=moment()[_0xa390('0xa9')](_0xa390('0xf5'));for(var _0x2cc82b=0x0,_0x1c48d1=_0x195e61[_0xa390('0x44')];_0x2cc82b<_0x1c48d1;_0x2cc82b++){_0x195e61[_0x2cc82b][_0xa390('0x102')]({'exitAt':_0x138417});}}})[_0xa390('0x22')](function(){var _0x35a867=[];var _0x1f95bf=utils['getChannels']();_0x1f95bf[_0xa390('0xf7')](function(_0x70419a){_0x35a867[_0xa390('0x3e')]({'channel':_0x70419a,'membername':_0x17b676['name'],'interface':_[_0xa390('0x60')](_0x17b676[_0xa390('0x9a')])?util[_0xa390('0xa9')](_0xa390('0xaa'),_0x17b676[_0xa390('0x2d')]):_0x17b676[_0xa390('0x9a')],'type':_0xa390('0xfa'),'enterAt':moment()[_0xa390('0xa9')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x3b90f3['body'][_0xa390('0x103')]||_0xa390('0x104'),'role':_0x17b676[_0xa390('0x23')],'internal':_0x17b676['internal']});});return db['MemberReport'][_0xa390('0x7e')](_0x35a867,{'individualHooks':!![]});})['then'](function(){return _0x17b676[_0xa390('0x21')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3b90f3[_0xa390('0x56')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xa390('0xa9')](_0xa390('0xf5'))});})[_0xa390('0x22')](respondWithResult(_0x2cb37b,null))[_0xa390('0x4c')](handleError(_0x2cb37b,null));};exports[_0xa390('0x105')]=function(_0xdb78fc,_0x189347){var _0x1c9152;return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0xdb78fc[_0xa390('0x4d')]['id']},'attributes':['id','name','role',_0xa390('0xab'),_0xa390('0x106'),_0xa390('0x107'),_0xa390('0x108'),_0xa390('0x109'),_0xa390('0x10a'),'whatsapppause','pauseType',_0xa390('0x10b')]})[_0xa390('0x22')](handleEntityNotFound(_0x189347,null))[_0xa390('0x22')](function(_0x4ccec3){if(_0x4ccec3){_0x1c9152=_0x4ccec3;if(_0xdb78fc['body'][_0xa390('0xaf')]&&!utils[_0xa390('0x9b')](_0xdb78fc[_0xa390('0x56')][_0xa390('0xaf')])){throw new db['Sequelize']['ValidationError'](_0xa390('0x9c'));}switch(_0xdb78fc['body'][_0xa390('0xaf')]){case _0xa390('0xa6'):return respondWithRpcPromise('QueuePause',_0xa390('0x105'),{'id':_0x1c9152['id'],'name':_0x1c9152[_0xa390('0x2d')],'pause':![]})[_0xa390('0x22')](function(){return db[_0xa390('0xac')][_0xa390('0x21')]({'paused':0x0},{'where':{'UserId':_0x1c9152['id']},'individualHooks':!![]});})[_0xa390('0x22')](function(){return db[_0xa390('0xfc')][_0xa390('0x2c')]({'where':{'channel':_0xdb78fc['body'][_0xa390('0xaf')],'membername':_0x1c9152[_0xa390('0x2d')],'type':_0xa390('0xfa'),'exitAt':null}});})['then'](function(_0x3ffc51){if(_0x3ffc51){return _0x3ffc51[_0xa390('0x21')]({'exitAt':moment()[_0xa390('0xa9')](_0xa390('0xf5')),'data2':_0xa390('0x10c')},{'individualHooks':!![]});}return null;})[_0xa390('0x22')](function(){return _0x1c9152[_0xa390('0x21')]({'voicePause':![]});});case _0xa390('0x49'):case'chat':case'fax':case _0xa390('0x47'):case _0xa390('0x55'):case _0xa390('0x4a'):return db[_0xa390('0xfc')][_0xa390('0x2c')]({'where':{'channel':_0xdb78fc[_0xa390('0x56')][_0xa390('0xaf')],'membername':_0x1c9152[_0xa390('0x2d')],'type':_0xa390('0xfa'),'exitAt':null}})[_0xa390('0x22')](function(_0x33871c){if(_0x33871c){return _0x33871c['update']({'exitAt':moment()[_0xa390('0xa9')](_0xa390('0xf5')),'data2':_0xa390('0x10c')},{'individualHooks':!![]});}return null;})[_0xa390('0x22')](function(){var _0x3c5d86={};_[_0xa390('0x10d')](_0x3c5d86,util[_0xa390('0xa9')](_0xa390('0x10e'),_0xdb78fc[_0xa390('0x56')][_0xa390('0xaf')],_0xa390('0x10f')),![]);return _0x1c9152[_0xa390('0x21')](_0x3c5d86);});default:return respondWithRpcPromise(_0xa390('0x101'),_0xa390('0x105'),{'id':_0x1c9152['id'],'name':_0x1c9152[_0xa390('0x2d')],'pause':![]})[_0xa390('0x22')](function(){return db[_0xa390('0xac')][_0xa390('0x21')]({'paused':0x0},{'where':{'UserId':_0x1c9152['id']}});})[_0xa390('0x22')](function(){return db[_0xa390('0xfc')][_0xa390('0x3f')]({'where':{'membername':_0x1c9152[_0xa390('0x2d')],'type':_0xa390('0xfa'),'exitAt':null}});})[_0xa390('0x22')](function(_0x49d9fd){var _0xfd0d7=[];_0x49d9fd[_0xa390('0xf7')](function(_0x5bfc5a){_0xfd0d7[_0xa390('0x3e')](_0x5bfc5a[_0xa390('0x21')]({'exitAt':moment()[_0xa390('0xa9')](_0xa390('0xf5')),'data2':_0xa390('0x10c')}));});return BPromise[_0xa390('0x4b')](_0xfd0d7);})[_0xa390('0x22')](function(){return _0x1c9152['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xa390('0x22')](respondWithResult(_0x189347,null))[_0xa390('0x4c')](handleError(_0x189347,null));};exports[_0xa390('0x110')]=function(_0x1ee2a9,_0x2615bf){var _0x2efd3c={};var _0x23150c={};var _0x4fe6e2;var _0x52739e;return db[_0xa390('0x33')][_0xa390('0x90')]({'where':{'id':_0x1ee2a9['params']['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x2615bf,null))[_0xa390('0x22')](function(_0x23f483){if(_0x23f483){_0x4fe6e2=_0x23f483;_0x23150c[_0xa390('0x4e')]=_[_0xa390('0x50')](db[_0xa390('0x111')][_0xa390('0x34')]);_0x23150c[_0xa390('0x40')]=_[_0xa390('0x50')](_0x1ee2a9[_0xa390('0x40')]);_0x23150c[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x23150c['model'],_0x23150c[_0xa390('0x40')]);_0x2efd3c[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x23150c[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x1ee2a9[_0xa390('0x40')]['fields']));_0x2efd3c[_0xa390('0x3d')]=_0x2efd3c[_0xa390('0x3d')][_0xa390('0x44')]?_0x2efd3c[_0xa390('0x3d')]:_0x23150c[_0xa390('0x4e')];_0x2efd3c[_0xa390('0xd6')]=qs[_0xa390('0xc8')](_0x1ee2a9[_0xa390('0x40')][_0xa390('0xc8')]);_0x2efd3c[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_['pick'](_0x1ee2a9[_0xa390('0x40')],_0x23150c['filters']));if(_0x1ee2a9[_0xa390('0x40')]['filter']){_0x2efd3c[_0xa390('0x3b')]=_['merge'](_0x2efd3c['where'],{'$or':_[_0xa390('0x35')](_0x2efd3c[_0xa390('0x3d')],function(_0x6da2c5){var _0xb20b41={};_0xb20b41[_0x6da2c5]={'$like':'%'+_0x1ee2a9[_0xa390('0x40')][_0xa390('0x2a')]+'%'};return _0xb20b41;})});}_0x2efd3c=_[_0xa390('0x53')]({},_0x2efd3c,_0x1ee2a9[_0xa390('0x54')]);return _0x4fe6e2[_0xa390('0x110')](_0x2efd3c);}})['then'](function(_0x27d614){if(_0x27d614){_0x52739e=_0x27d614['length'];if(!_0x1ee2a9['query'][_0xa390('0xca')](_0xa390('0xd4'))){_0x2efd3c['limit']=qs[_0xa390('0x1e')](_0x1ee2a9[_0xa390('0x40')][_0xa390('0x1e')]);_0x2efd3c[_0xa390('0x1c')]=qs['offset'](_0x1ee2a9[_0xa390('0x40')]['offset']);}return _0x4fe6e2[_0xa390('0x110')](_0x2efd3c);}})['then'](function(_0x10e9b8){if(_0x10e9b8){return _0x10e9b8?{'count':_0x52739e,'rows':_0x10e9b8}:null;}})['then'](respondWithResult(_0x2615bf,null))[_0xa390('0x4c')](handleError(_0x2615bf,null));};exports[_0xa390('0x112')]=function(_0x5bfab6,_0x2fc55e){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x5bfab6[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x2fc55e,null))[_0xa390('0x22')](function(_0x32a8f8){if(_0x32a8f8){var _0x208858=_0x32a8f8[_0xa390('0xa8')]({'plain':!![]});return _0x32a8f8[_0xa390('0x112')](_0x5bfab6['body'][_0xa390('0x59')],_[_0xa390('0x113')](_0x5bfab6[_0xa390('0x56')],['ids','id'])||{})[_0xa390('0x22')](function(){for(var _0x15c555=0x0;_0x15c555<_0x5bfab6['body']['ids'][_0xa390('0x44')];_0x15c555++){var _0x50c120=[];db[_0xa390('0x111')][_0xa390('0x90')]({'where':{'id':_0x5bfab6['body'][_0xa390('0x59')][_0x15c555]}})['then'](function(_0x246d1f){_0x50c120[_0xa390('0x3e')](_0x246d1f[_0xa390('0xf3')]()[_0xa390('0x22')](function(_0x19642a){for(var _0xa9097a=0x0;_0xa9097a<_0x19642a[_0xa390('0x44')];_0xa9097a++){_0x19642a[_0xa9097a][_0xa390('0x114')](_0xa390('0xaf'),'Voice');}return _0x19642a;}));_0x50c120[_0xa390('0x3e')](_0x246d1f['getChatQueues']()['then'](function(_0x42dbef){for(var _0x1ef3f2=0x0;_0x1ef3f2<_0x42dbef[_0xa390('0x44')];_0x1ef3f2++){_0x42dbef[_0x1ef3f2]['setDataValue'](_0xa390('0xaf'),_0xa390('0x115'));}return _0x42dbef;}));_0x50c120[_0xa390('0x3e')](_0x246d1f[_0xa390('0x116')]()['then'](function(_0x40d40c){for(var _0x3d04f8=0x0;_0x3d04f8<_0x40d40c['length'];_0x3d04f8++){_0x40d40c[_0x3d04f8][_0xa390('0x114')](_0xa390('0xaf'),_0xa390('0x117'));}return _0x40d40c;}));_0x50c120[_0xa390('0x3e')](_0x246d1f[_0xa390('0x118')]()[_0xa390('0x22')](function(_0x5a61e2){for(var _0x140ea2=0x0;_0x140ea2<_0x5a61e2['length'];_0x140ea2++){_0x5a61e2[_0x140ea2]['setDataValue'](_0xa390('0xaf'),_0xa390('0x119'));}return _0x5a61e2;}));_0x50c120[_0xa390('0x3e')](_0x246d1f['getWhatsappQueues']()[_0xa390('0x22')](function(_0x471d8c){for(var _0x59e6e2=0x0;_0x59e6e2<_0x471d8c[_0xa390('0x44')];_0x59e6e2++){_0x471d8c[_0x59e6e2]['setDataValue'](_0xa390('0xaf'),_0xa390('0x11a'));}return _0x471d8c;}));_0x50c120[_0xa390('0x3e')](_0x246d1f[_0xa390('0x11b')]()[_0xa390('0x22')](function(_0x3f9788){for(var _0x5d3a2e=0x0;_0x5d3a2e<_0x3f9788[_0xa390('0x44')];_0x5d3a2e++){_0x3f9788[_0x5d3a2e]['setDataValue'](_0xa390('0xaf'),'Fax');}return _0x3f9788;}));_0x50c120['push'](_0x246d1f['getOpenchannelQueues']()[_0xa390('0x22')](function(_0x2f8f36){for(var _0x334646=0x0;_0x334646<_0x2f8f36[_0xa390('0x44')];_0x334646++){_0x2f8f36[_0x334646]['setDataValue'](_0xa390('0xaf'),_0xa390('0x11c'));}return _0x2f8f36;}));return BPromise['all'](_0x50c120);})[_0xa390('0x22')](function(_0x373438){var _0x7176aa=_[_0xa390('0x11d')](_0x373438);_0x50c120=[];return db[_0xa390('0x61')][_0xa390('0x11e')](function(_0x26d9de){for(var _0x4083dd=0x0;_0x4083dd<_0x7176aa[_0xa390('0x44')];_0x4083dd++){_0x50c120[_0xa390('0x3e')](_0x7176aa[_0x4083dd][_0xa390('0x11f')](_0x208858['id']),{'transaction':_0x26d9de});}return BPromise[_0xa390('0x4b')](_0x50c120)['then'](function(){if(_0x208858[_0xa390('0x98')]){return BPromise[_0xa390('0x81')](_[_0xa390('0x2a')](_0x7176aa,function(_0x51fb89){return _0x51fb89[_0xa390('0x120')](_0xa390('0xaf'))===_0xa390('0x121');}),function(_0x375fd9){return db[_0xa390('0xac')][_0xa390('0xad')]({'membername':_0x208858[_0xa390('0x2d')],'UserId':_0x208858['id'],'queue_name':_0x375fd9[_0xa390('0x2d')],'VoiceQueueId':_0x375fd9['id'],'interface':_[_0xa390('0x60')](_0x208858['interface'])?util[_0xa390('0xa9')](_0xa390('0xaa'),_0x208858['name']):_0x208858[_0xa390('0x9a')],'paused':_0x208858[_0xa390('0xab')]||![],'penalty':_0x208858[_0xa390('0xa0')]},{'transaction':_0x26d9de});});}else{return;}})[_0xa390('0x22')](function(){for(var _0x8ec435=0x0;_0x8ec435<_0x7176aa[_0xa390('0x44')];_0x8ec435++){var _0x1e3d74=_0x7176aa[_0x8ec435][_0xa390('0x120')](_0xa390('0xaf'));var _0x5db816=_0x1e3d74+_0xa390('0xa3');socket[_0xa390('0xa4')](_0xa390('0x26')+_0x1e3d74+_0xa390('0xa5'),{'UserId':_0x208858['id'],['queueField']:_0x7176aa[_0x8ec435]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x2fc55e,null))[_0xa390('0x4c')](handleError(_0x2fc55e,null));};exports[_0xa390('0x122')]=function(_0x467b6b,_0x3494fa){return db[_0xa390('0x33')]['findOne']({'where':{'id':_0x467b6b[_0xa390('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3494fa,null))[_0xa390('0x22')](function(_0x1dc417){if(_0x1dc417){var _0x4c3fb9=_0x1dc417[_0xa390('0xa8')]({'plain':!![]});var _0x581cab=_0x467b6b[_0xa390('0x40')][_0xa390('0x59')];return _0x1dc417[_0xa390('0x122')](_0x581cab)[_0xa390('0x22')](function(){for(var _0x47f3aa=0x0;_0x47f3aa<_0x581cab['length'];_0x47f3aa++){var _0x4d9e91=[];db['Team']['findOne']({'where':{'id':_0x581cab[_0x47f3aa]}})[_0xa390('0x22')](function(_0xc43d98){_0x4d9e91[_0xa390('0x3e')](_0xc43d98[_0xa390('0xf3')]()[_0xa390('0x22')](function(_0x858f25){for(var _0x10830f=0x0;_0x10830f<_0x858f25[_0xa390('0x44')];_0x10830f++){_0x858f25[_0x10830f][_0xa390('0x114')](_0xa390('0xaf'),_0xa390('0x121'));}return _0x858f25;}));_0x4d9e91['push'](_0xc43d98[_0xa390('0x123')]()[_0xa390('0x22')](function(_0x5de5b7){for(var _0x25c6f7=0x0;_0x25c6f7<_0x5de5b7[_0xa390('0x44')];_0x25c6f7++){_0x5de5b7[_0x25c6f7][_0xa390('0x114')]('channel','Chat');}return _0x5de5b7;}));_0x4d9e91[_0xa390('0x3e')](_0xc43d98[_0xa390('0x116')]()[_0xa390('0x22')](function(_0x3d5ef0){for(var _0x5b04aa=0x0;_0x5b04aa<_0x3d5ef0[_0xa390('0x44')];_0x5b04aa++){_0x3d5ef0[_0x5b04aa][_0xa390('0x114')]('channel','Mail');}return _0x3d5ef0;}));_0x4d9e91[_0xa390('0x3e')](_0xc43d98[_0xa390('0x118')]()[_0xa390('0x22')](function(_0x492b37){for(var _0x3cd157=0x0;_0x3cd157<_0x492b37[_0xa390('0x44')];_0x3cd157++){_0x492b37[_0x3cd157]['setDataValue']('channel',_0xa390('0x119'));}return _0x492b37;}));_0x4d9e91[_0xa390('0x3e')](_0xc43d98['getWhatsappQueues']()[_0xa390('0x22')](function(_0x1b42fc){for(var _0xf2badf=0x0;_0xf2badf<_0x1b42fc['length'];_0xf2badf++){_0x1b42fc[_0xf2badf]['setDataValue'](_0xa390('0xaf'),_0xa390('0x11a'));}return _0x1b42fc;}));_0x4d9e91['push'](_0xc43d98['getFaxQueues']()['then'](function(_0xfd33a7){for(var _0x198573=0x0;_0x198573<_0xfd33a7[_0xa390('0x44')];_0x198573++){_0xfd33a7[_0x198573][_0xa390('0x114')](_0xa390('0xaf'),_0xa390('0x124'));}return _0xfd33a7;}));_0x4d9e91[_0xa390('0x3e')](_0xc43d98[_0xa390('0x125')]()['then'](function(_0x9a0889){for(var _0x15ba5c=0x0;_0x15ba5c<_0x9a0889['length'];_0x15ba5c++){_0x9a0889[_0x15ba5c][_0xa390('0x114')]('channel',_0xa390('0x11c'));}return _0x9a0889;}));return BPromise[_0xa390('0x4b')](_0x4d9e91);})[_0xa390('0x22')](function(_0x1ee94a){var _0x1f2136=_[_0xa390('0x11d')](_0x1ee94a);_0x4d9e91=[];return db[_0xa390('0x61')][_0xa390('0x11e')](function(_0x3b1c22){for(var _0x4fa51e=0x0;_0x4fa51e<_0x1f2136[_0xa390('0x44')];_0x4fa51e++){_0x4d9e91[_0xa390('0x3e')](_0x1f2136[_0x4fa51e][_0xa390('0x126')](_0x4c3fb9['id']),{'transaction':_0x3b1c22});}return BPromise['all'](_0x4d9e91)[_0xa390('0x22')](function(){if(_0x4c3fb9[_0xa390('0x98')]){return BPromise[_0xa390('0x81')](_[_0xa390('0x2a')](_0x1f2136,function(_0x594254){return _0x594254[_0xa390('0x120')]('channel')===_0xa390('0x121');}),function(_0x2e81ba){return db[_0xa390('0xac')]['destroy']({'where':{'VoiceQueueId':_0x2e81ba['id'],'UserId':_0x4c3fb9['id']},'transaction':_0x3b1c22});});}else{return;}})[_0xa390('0x22')](function(){for(var _0x1f0536=0x0;_0x1f0536<_0x1f2136[_0xa390('0x44')];_0x1f0536++){var _0xf94d01=_0x1f2136[_0x1f0536][_0xa390('0x120')](_0xa390('0xaf'));var _0x1a14c1=_0xf94d01+_0xa390('0xa3');socket[_0xa390('0xa4')]('user'+_0xf94d01+_0xa390('0xb1'),{'UserId':_0x4c3fb9['id'],['queueField']:_0x1f2136[_0x1f0536]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x3494fa,null))['catch'](handleError(_0x3494fa,null));};exports['getLists']=function(_0x512e36,_0x1bb772){var _0x48216d={};var _0x23808c={};var _0x108987;var _0x33ea4a;return db[_0xa390('0x33')]['findOne']({'where':{'id':_0x512e36[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x1bb772,null))['then'](function(_0x164c17){if(_0x164c17){_0x108987=_0x164c17;_0x23808c[_0xa390('0x4e')]=_[_0xa390('0x50')](db['CmList'][_0xa390('0x34')]);_0x23808c['query']=_[_0xa390('0x50')](_0x512e36[_0xa390('0x40')]);_0x23808c[_0xa390('0xc7')]=_['intersection'](_0x23808c[_0xa390('0x4e')],_0x23808c[_0xa390('0x40')]);_0x48216d[_0xa390('0x3d')]=_['intersection'](_0x23808c[_0xa390('0x4e')],qs['fields'](_0x512e36[_0xa390('0x40')][_0xa390('0x52')]));_0x48216d[_0xa390('0x3d')]=_0x48216d[_0xa390('0x3d')]['length']?_0x48216d['attributes']:_0x23808c[_0xa390('0x4e')];_0x48216d[_0xa390('0xd6')]=qs[_0xa390('0xc8')](_0x512e36[_0xa390('0x40')]['sort']);_0x48216d[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x512e36['query'],_0x23808c[_0xa390('0xc7')]));if(_0x512e36[_0xa390('0x40')][_0xa390('0x2a')]){_0x48216d['where']=_['merge'](_0x48216d[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x48216d[_0xa390('0x3d')],function(_0x113adb){var _0x4d11d4={};_0x4d11d4[_0x113adb]={'$like':'%'+_0x512e36[_0xa390('0x40')]['filter']+'%'};return _0x4d11d4;})});}_0x48216d=_['merge']({},_0x48216d,_0x512e36[_0xa390('0x54')]);return _0x108987[_0xa390('0x127')](_0x48216d);}})[_0xa390('0x22')](function(_0x250fb7){if(_0x250fb7){_0x33ea4a=_0x250fb7[_0xa390('0x44')];if(!_0x512e36[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0x48216d[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0x512e36['query'][_0xa390('0x1e')]);_0x48216d['offset']=qs[_0xa390('0x1c')](_0x512e36[_0xa390('0x40')][_0xa390('0x1c')]);}return _0x108987[_0xa390('0x127')](_0x48216d);}})[_0xa390('0x22')](function(_0x54e102){if(_0x54e102){return _0x54e102?{'count':_0x33ea4a,'rows':_0x54e102}:null;}})[_0xa390('0x22')](respondWithResult(_0x1bb772,null))[_0xa390('0x4c')](handleError(_0x1bb772,null));};exports[_0xa390('0x128')]=function(_0x6b17ff,_0x313112){var _0x3985b1={};var _0x206210={};var _0x3cfa9f;var _0x3a7019;return db[_0xa390('0x33')]['findOne']({'where':{'id':_0x6b17ff[_0xa390('0x4d')]['id']}})['then'](handleEntityNotFound(_0x313112,null))['then'](function(_0x150290){if(_0x150290){_0x3cfa9f=_0x150290;_0x206210[_0xa390('0x4e')]=_['keys'](db[_0xa390('0x33')]['rawAttributes']);_0x206210[_0xa390('0x40')]=_[_0xa390('0x50')](_0x6b17ff[_0xa390('0x40')]);_0x206210[_0xa390('0xc7')]=_['intersection'](_0x206210[_0xa390('0x4e')],_0x206210[_0xa390('0x40')]);_0x3985b1[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x206210[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x6b17ff[_0xa390('0x40')][_0xa390('0x52')]));_0x3985b1[_0xa390('0x3d')]=_0x3985b1['attributes'][_0xa390('0x44')]?_0x3985b1[_0xa390('0x3d')]:_0x206210[_0xa390('0x4e')];_0x3985b1[_0xa390('0xd6')]=qs[_0xa390('0xc8')](_0x6b17ff[_0xa390('0x40')][_0xa390('0xc8')]);_0x3985b1['where']=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x6b17ff[_0xa390('0x40')],_0x206210[_0xa390('0xc7')]));if(_0x6b17ff[_0xa390('0x40')]['filter']){_0x3985b1[_0xa390('0x3b')]=_[_0xa390('0x53')](_0x3985b1['where'],{'$or':_[_0xa390('0x35')](_0x3985b1[_0xa390('0x3d')],function(_0x3e4518){var _0x38ba9a={};_0x38ba9a[_0x3e4518]={'$like':'%'+_0x6b17ff[_0xa390('0x40')][_0xa390('0x2a')]+'%'};return _0x38ba9a;})});}_0x3985b1[_0xa390('0x4e')]=db[_0xa390('0x33')];_0x3985b1['as']=_0xa390('0x7c');_0x3985b1=_[_0xa390('0x53')]({},_0x3985b1,_0x6b17ff['options']);return _0x3cfa9f[_0xa390('0xf3')]({'include':[_0x3985b1]});}})[_0xa390('0x22')](function(_0x38e8ea){if(_0x38e8ea){var _0x4028b6={},_0x7c5d07=[],_0x260c7a=0x0;for(var _0x2e0aaa=0x0;_0x2e0aaa<_0x38e8ea[_0xa390('0x44')];_0x2e0aaa+=0x1){for(var _0x182cf0=0x0,_0xda9dae;_0x182cf0<_0x38e8ea[_0x2e0aaa][_0xa390('0x7c')][_0xa390('0x44')];_0x182cf0+=0x1){_0xda9dae=_0x38e8ea[_0x2e0aaa]['Agents'][_0x182cf0][_0xa390('0xa8')]({'plain':!![]});_0x4028b6[_0xda9dae['id']]=_0xda9dae;}}_0x4028b6=_[_0xa390('0x129')](_0x4028b6);for(var _0x142b13=qs[_0xa390('0x1c')](_0x6b17ff[_0xa390('0x40')]['offset']);_0x142b13<_0x4028b6['length']&&_0x7c5d07['length']<qs['limit'](_0x6b17ff[_0xa390('0x40')][_0xa390('0x1e')]);_0x142b13+=0x1){if(_0x4028b6[_0x142b13]){_0x7c5d07[_0xa390('0x3e')](_0x4028b6[_0x142b13]);}}return{'count':_0x4028b6[_0xa390('0x44')],'rows':_0x7c5d07};}})[_0xa390('0x22')](respondWithResult(_0x313112,null))[_0xa390('0x4c')](handleError(_0x313112,null));};exports[_0xa390('0x2f')]=function(_0x420ad5,_0x23d80f){if(_0x420ad5[_0xa390('0x26')]['id']==_0x420ad5[_0xa390('0x4d')]['id']){return _0x23d80f['status'](0x1f4)['send']({'message':_0xa390('0x12a')});}return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x420ad5['params']['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x23d80f,null))[_0xa390('0x22')](removeEntity(_0x23d80f,null))[_0xa390('0x4c')](handleError(_0x23d80f,null));};exports['addChatInteractions']=function(_0x4f136b,_0x41a30f){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x4f136b[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x41a30f,null))[_0xa390('0x22')](function(_0x54dacb){if(_0x54dacb){return _0x54dacb[_0xa390('0x12b')](_0x4f136b[_0xa390('0x56')][_0xa390('0x59')],_[_0xa390('0x113')](_0x4f136b[_0xa390('0x56')],[_0xa390('0x59'),'id'])||{})[_0xa390('0xa1')](function(){for(var _0x5a14ca=0x0;_0x5a14ca<_0x4f136b[_0xa390('0x56')][_0xa390('0x59')]['length'];_0x5a14ca+=0x1){socket[_0xa390('0xa4')](_0xa390('0x12c'),{'ChatInteractionId':Number(_0x4f136b[_0xa390('0x56')]['ids'][_0x5a14ca]),'UserId':Number(_0x4f136b['params']['id'])});}return _0x4f136b[_0xa390('0x56')][_0xa390('0x59')];});}})[_0xa390('0x22')](respondWithResult(_0x41a30f,null))[_0xa390('0x4c')](handleError(_0x41a30f,null));};exports[_0xa390('0x12d')]=function(_0x3a87f9,_0x24d868){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x3a87f9['params']['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x24d868,null))[_0xa390('0x22')](function(_0x242b02){if(_0x242b02){return _0x242b02[_0xa390('0x12d')](_0x3a87f9[_0xa390('0x40')][_0xa390('0x59')])[_0xa390('0x22')](function(){if(_[_0xa390('0x12e')](_0x3a87f9[_0xa390('0x40')][_0xa390('0x59')])){for(var _0x43d035=0x0;_0x43d035<_0x3a87f9[_0xa390('0x40')][_0xa390('0x59')][_0xa390('0x44')];_0x43d035+=0x1){socket[_0xa390('0xa4')](_0xa390('0x12f'),{'ChatInteractionId':Number(_0x3a87f9[_0xa390('0x40')][_0xa390('0x59')][_0x43d035]),'UserId':Number(_0x3a87f9[_0xa390('0x4d')]['id'])});}}else{socket[_0xa390('0xa4')](_0xa390('0x12f'),{'ChatInteractionId':Number(_0x3a87f9[_0xa390('0x40')]['ids']),'UserId':Number(_0x3a87f9[_0xa390('0x4d')]['id'])});}});}})[_0xa390('0x22')](respondWithStatusCode(_0x24d868,null))['catch'](handleError(_0x24d868,null));};exports[_0xa390('0x130')]=function(_0x23a2e,_0x370453){return db[_0xa390('0x33')]['find']({'where':{'id':_0x23a2e[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x370453,null))[_0xa390('0x22')](function(_0x2830b7){if(_0x2830b7){return _0x2830b7[_0xa390('0x130')](_0x23a2e[_0xa390('0x56')][_0xa390('0x59')],_['omit'](_0x23a2e[_0xa390('0x56')],[_0xa390('0x59'),'id'])||{})[_0xa390('0xa1')](function(){for(var _0x3e6c09=0x0;_0x3e6c09<_0x23a2e[_0xa390('0x56')][_0xa390('0x59')][_0xa390('0x44')];_0x3e6c09+=0x1){socket[_0xa390('0xa4')](_0xa390('0x131'),{'MailInteractionId':Number(_0x23a2e['body'][_0xa390('0x59')][_0x3e6c09]),'UserId':Number(_0x23a2e[_0xa390('0x4d')]['id'])});}return _0x23a2e['body'][_0xa390('0x59')];});}})['then'](respondWithResult(_0x370453,null))[_0xa390('0x4c')](handleError(_0x370453,null));};exports[_0xa390('0x132')]=function(_0x329ee9,_0x4a535c){return db[_0xa390('0x33')]['find']({'where':{'id':_0x329ee9[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x4a535c,null))[_0xa390('0x22')](function(_0x559fc4){if(_0x559fc4){return _0x559fc4[_0xa390('0x132')](_0x329ee9[_0xa390('0x40')][_0xa390('0x59')])[_0xa390('0x22')](function(){if(_['isArray'](_0x329ee9[_0xa390('0x40')][_0xa390('0x59')])){for(var _0x4168e7=0x0;_0x4168e7<_0x329ee9['query'][_0xa390('0x59')][_0xa390('0x44')];_0x4168e7+=0x1){socket[_0xa390('0xa4')](_0xa390('0x133'),{'MailInteractionId':Number(_0x329ee9['query'][_0xa390('0x59')][_0x4168e7]),'UserId':Number(_0x329ee9[_0xa390('0x4d')]['id'])});}}else{socket['emit'](_0xa390('0x133'),{'MailInteractionId':Number(_0x329ee9[_0xa390('0x40')][_0xa390('0x59')]),'UserId':Number(_0x329ee9['params']['id'])});}});}})[_0xa390('0x22')](respondWithStatusCode(_0x4a535c,null))[_0xa390('0x4c')](handleError(_0x4a535c,null));};exports['addFaxInteractions']=function(_0x54fb49,_0xe86fec){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x54fb49[_0xa390('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe86fec,null))[_0xa390('0x22')](function(_0xb6d77){if(_0xb6d77){return _0xb6d77[_0xa390('0x134')](_0x54fb49[_0xa390('0x56')][_0xa390('0x59')],_[_0xa390('0x113')](_0x54fb49['body'],['ids','id'])||{})[_0xa390('0xa1')](function(){for(var _0x16bcc6=0x0;_0x16bcc6<_0x54fb49[_0xa390('0x56')]['ids'][_0xa390('0x44')];_0x16bcc6+=0x1){socket[_0xa390('0xa4')](_0xa390('0x135'),{'FaxInteractionId':Number(_0x54fb49['body']['ids'][_0x16bcc6]),'UserId':Number(_0x54fb49[_0xa390('0x4d')]['id'])});}return _0x54fb49['body'][_0xa390('0x59')];});}})[_0xa390('0x22')](respondWithResult(_0xe86fec,null))[_0xa390('0x4c')](handleError(_0xe86fec,null));};exports[_0xa390('0x136')]=function(_0x3501a2,_0x328207){return db[_0xa390('0x33')]['find']({'where':{'id':_0x3501a2[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x328207,null))[_0xa390('0x22')](function(_0x5a1144){if(_0x5a1144){return _0x5a1144[_0xa390('0x136')](_0x3501a2['query'][_0xa390('0x59')])[_0xa390('0x22')](function(){if(_[_0xa390('0x12e')](_0x3501a2['query'][_0xa390('0x59')])){for(var _0x2785c5=0x0;_0x2785c5<_0x3501a2[_0xa390('0x40')][_0xa390('0x59')][_0xa390('0x44')];_0x2785c5+=0x1){socket[_0xa390('0xa4')](_0xa390('0x137'),{'FaxInteractionId':Number(_0x3501a2[_0xa390('0x40')][_0xa390('0x59')][_0x2785c5]),'UserId':Number(_0x3501a2['params']['id'])});}}else{socket['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3501a2[_0xa390('0x40')][_0xa390('0x59')]),'UserId':Number(_0x3501a2[_0xa390('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x328207,null))[_0xa390('0x4c')](handleError(_0x328207,null));};exports[_0xa390('0x138')]=function(_0x56858e,_0x4ce173){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x56858e['params']['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x4ce173,null))['then'](function(_0x5d0dae){if(_0x5d0dae){return _0x5d0dae[_0xa390('0x138')](_0x56858e[_0xa390('0x56')][_0xa390('0x59')],_['omit'](_0x56858e[_0xa390('0x56')],[_0xa390('0x59'),'id'])||{})['spread'](function(){for(var _0x57ef71=0x0;_0x57ef71<_0x56858e[_0xa390('0x56')]['ids'][_0xa390('0x44')];_0x57ef71+=0x1){socket[_0xa390('0xa4')](_0xa390('0x139'),{'SmsInteractionId':Number(_0x56858e[_0xa390('0x56')][_0xa390('0x59')][_0x57ef71]),'UserId':Number(_0x56858e[_0xa390('0x4d')]['id'])});}return _0x56858e[_0xa390('0x56')]['ids'];});}})[_0xa390('0x22')](respondWithResult(_0x4ce173,null))[_0xa390('0x4c')](handleError(_0x4ce173,null));};exports[_0xa390('0x13a')]=function(_0x24ff6c,_0x9771c6){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x24ff6c['params']['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x9771c6,null))[_0xa390('0x22')](function(_0x582eb6){if(_0x582eb6){return _0x582eb6[_0xa390('0x13a')](_0x24ff6c[_0xa390('0x40')][_0xa390('0x59')])[_0xa390('0x22')](function(){if(_['isArray'](_0x24ff6c[_0xa390('0x40')][_0xa390('0x59')])){for(var _0x4f68a5=0x0;_0x4f68a5<_0x24ff6c[_0xa390('0x40')][_0xa390('0x59')][_0xa390('0x44')];_0x4f68a5+=0x1){socket[_0xa390('0xa4')](_0xa390('0x13b'),{'SmsInteractionId':Number(_0x24ff6c[_0xa390('0x40')][_0xa390('0x59')][_0x4f68a5]),'UserId':Number(_0x24ff6c[_0xa390('0x4d')]['id'])});}}else{socket['emit'](_0xa390('0x13b'),{'SmsInteractionId':Number(_0x24ff6c[_0xa390('0x40')][_0xa390('0x59')]),'UserId':Number(_0x24ff6c[_0xa390('0x4d')]['id'])});}});}})[_0xa390('0x22')](respondWithStatusCode(_0x9771c6,null))['catch'](handleError(_0x9771c6,null));};exports[_0xa390('0x13c')]=function(_0x515147,_0x3c3de0){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x515147[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x3c3de0,null))[_0xa390('0x22')](function(_0x1c4127){if(_0x1c4127){return _0x1c4127['addOpenchannelInteractions'](_0x515147[_0xa390('0x56')]['ids'],_[_0xa390('0x113')](_0x515147[_0xa390('0x56')],[_0xa390('0x59'),'id'])||{})[_0xa390('0xa1')](function(){for(var _0x408678=0x0;_0x408678<_0x515147[_0xa390('0x56')][_0xa390('0x59')][_0xa390('0x44')];_0x408678+=0x1){socket[_0xa390('0xa4')](_0xa390('0x13d'),{'OpenchannelInteractionId':Number(_0x515147[_0xa390('0x56')][_0xa390('0x59')][_0x408678]),'UserId':Number(_0x515147[_0xa390('0x4d')]['id'])});}return _0x515147[_0xa390('0x56')][_0xa390('0x59')];});}})['then'](respondWithResult(_0x3c3de0,null))[_0xa390('0x4c')](handleError(_0x3c3de0,null));};exports[_0xa390('0x13e')]=function(_0x4fbf3b,_0x10cca2){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x4fbf3b[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x10cca2,null))[_0xa390('0x22')](function(_0x3695a0){if(_0x3695a0){return _0x3695a0['removeOpenchannelInteractions'](_0x4fbf3b[_0xa390('0x40')][_0xa390('0x59')])[_0xa390('0x22')](function(){if(_[_0xa390('0x12e')](_0x4fbf3b[_0xa390('0x40')][_0xa390('0x59')])){for(var _0x5545c3=0x0;_0x5545c3<_0x4fbf3b[_0xa390('0x40')][_0xa390('0x59')][_0xa390('0x44')];_0x5545c3+=0x1){socket[_0xa390('0xa4')](_0xa390('0x13f'),{'OpenchannelInteractionId':Number(_0x4fbf3b[_0xa390('0x40')][_0xa390('0x59')][_0x5545c3]),'UserId':Number(_0x4fbf3b[_0xa390('0x4d')]['id'])});}}else{socket['emit']('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x4fbf3b[_0xa390('0x40')][_0xa390('0x59')]),'UserId':Number(_0x4fbf3b[_0xa390('0x4d')]['id'])});}});}})[_0xa390('0x22')](respondWithStatusCode(_0x10cca2,null))[_0xa390('0x4c')](handleError(_0x10cca2,null));};exports[_0xa390('0x140')]=function(_0x5c51d7,_0xcccdc2){return db['User'][_0xa390('0x2c')]({'where':{'id':_0x5c51d7[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0xcccdc2,null))['then'](function(_0x3cacd5){if(_0x3cacd5){return _0x3cacd5[_0xa390('0x140')](_0x5c51d7[_0xa390('0x56')][_0xa390('0x59')],_[_0xa390('0x113')](_0x5c51d7[_0xa390('0x56')],['ids','id'])||{})[_0xa390('0xa1')](function(){for(var _0x3b6557=0x0;_0x3b6557<_0x5c51d7['body'][_0xa390('0x59')][_0xa390('0x44')];_0x3b6557+=0x1){socket['emit']('user_has_whatsapp_interactions:save',{'WhatsappInteractionId':Number(_0x5c51d7['body'][_0xa390('0x59')][_0x3b6557]),'UserId':Number(_0x5c51d7[_0xa390('0x4d')]['id'])});}return _0x5c51d7['body'][_0xa390('0x59')];});}})[_0xa390('0x22')](respondWithResult(_0xcccdc2,null))[_0xa390('0x4c')](handleError(_0xcccdc2,null));};exports[_0xa390('0x141')]=function(_0x1bba28,_0x74d450){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x1bba28[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x74d450,null))[_0xa390('0x22')](function(_0x2cacf6){if(_0x2cacf6){return _0x2cacf6[_0xa390('0x141')](_0x1bba28[_0xa390('0x40')]['ids']);}})[_0xa390('0x22')](respondWithStatusCode(_0x74d450,null))[_0xa390('0x4c')](handleError(_0x74d450,null));};exports[_0xa390('0x142')]=function(_0x5256d3,_0x253b69){var _0x14b999={};var _0x2c4154={};var _0x2cd5ed;var _0x2b7f82;return db['User']['findOne']({'where':{'id':_0x5256d3['params']['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x253b69,null))[_0xa390('0x22')](function(_0x23faca){if(_0x23faca){_0x2cd5ed=_0x23faca;_0x2c4154['model']=_['keys'](db[_0xa390('0x143')][_0xa390('0x34')]);_0x2c4154[_0xa390('0x40')]=_[_0xa390('0x50')](_0x5256d3['query']);_0x2c4154[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x2c4154[_0xa390('0x4e')],_0x2c4154[_0xa390('0x40')]);_0x14b999['attributes']=_['intersection'](_0x2c4154[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x5256d3['query'][_0xa390('0x52')]));_0x14b999[_0xa390('0x3d')]=_0x14b999['attributes'][_0xa390('0x44')]?_0x14b999[_0xa390('0x3d')]:_0x2c4154['model'];_0x14b999[_0xa390('0xd6')]=qs[_0xa390('0xc8')](_0x5256d3[_0xa390('0x40')][_0xa390('0xc8')]);_0x14b999[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x5256d3['query'],_0x2c4154[_0xa390('0xc7')]));if(_0x5256d3['query'][_0xa390('0x2a')]){_0x14b999[_0xa390('0x3b')]=_['merge'](_0x14b999[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x14b999['attributes'],function(_0x7f7a9e){var _0x58d0c1={};_0x58d0c1[_0x7f7a9e]={'$like':'%'+_0x5256d3[_0xa390('0x40')]['filter']+'%'};return _0x58d0c1;})});}_0x14b999=_[_0xa390('0x53')]({},_0x14b999,_0x5256d3[_0xa390('0x54')]);return _0x2cd5ed[_0xa390('0x142')](_0x14b999);}})[_0xa390('0x22')](function(_0x2cf047){if(_0x2cf047){_0x2b7f82=_0x2cf047['length'];if(!_0x5256d3[_0xa390('0x40')][_0xa390('0xca')]('nolimit')){_0x14b999[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0x5256d3[_0xa390('0x40')][_0xa390('0x1e')]);_0x14b999[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x5256d3[_0xa390('0x40')][_0xa390('0x1c')]);}return _0x2cd5ed[_0xa390('0x142')](_0x14b999);}})[_0xa390('0x22')](function(_0x92aa09){if(_0x92aa09){return _0x92aa09?{'count':_0x2b7f82,'rows':_0x92aa09}:null;}})[_0xa390('0x22')](respondWithResult(_0x253b69,null))[_0xa390('0x4c')](handleError(_0x253b69,null));};exports[_0xa390('0x144')]=function(_0x2043b0,_0x15e2f4){var _0x42443d={};var _0x15c31d={};var _0x19dbf0;var _0x5e94a5;return db[_0xa390('0x33')][_0xa390('0x90')]({'where':{'id':_0x2043b0[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x15e2f4,null))['then'](function(_0x4a226b){if(_0x4a226b){_0x19dbf0=_0x4a226b;_0x15c31d[_0xa390('0x4e')]=_[_0xa390('0x50')](db[_0xa390('0x145')]['rawAttributes']);_0x15c31d[_0xa390('0x40')]=_[_0xa390('0x50')](_0x2043b0[_0xa390('0x40')]);_0x15c31d[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x15c31d[_0xa390('0x4e')],_0x15c31d[_0xa390('0x40')]);_0x42443d[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x15c31d[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x2043b0['query']['fields']));_0x42443d[_0xa390('0x3d')]=_0x42443d[_0xa390('0x3d')]['length']?_0x42443d[_0xa390('0x3d')]:_0x15c31d[_0xa390('0x4e')];_0x42443d['order']=qs['sort'](_0x2043b0[_0xa390('0x40')]['sort']);_0x42443d[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x2043b0[_0xa390('0x40')],_0x15c31d[_0xa390('0xc7')]));if(_0x2043b0[_0xa390('0x40')][_0xa390('0x2a')]){_0x42443d[_0xa390('0x3b')]=_[_0xa390('0x53')](_0x42443d[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x42443d[_0xa390('0x3d')],function(_0x57cd76){var _0x1ef863={};_0x1ef863[_0x57cd76]={'$like':'%'+_0x2043b0[_0xa390('0x40')]['filter']+'%'};return _0x1ef863;})});}_0x42443d=_['merge']({},_0x42443d,_0x2043b0['options']);return _0x19dbf0[_0xa390('0x144')](_0x42443d);}})[_0xa390('0x22')](function(_0x3aa5de){if(_0x3aa5de){_0x5e94a5=_0x3aa5de[_0xa390('0x44')];if(!_0x2043b0[_0xa390('0x40')][_0xa390('0xca')]('nolimit')){_0x42443d['limit']=qs['limit'](_0x2043b0[_0xa390('0x40')][_0xa390('0x1e')]);_0x42443d['offset']=qs[_0xa390('0x1c')](_0x2043b0[_0xa390('0x40')][_0xa390('0x1c')]);}return _0x19dbf0[_0xa390('0x144')](_0x42443d);}})[_0xa390('0x22')](function(_0x26538a){if(_0x26538a){return _0x26538a?{'count':_0x5e94a5,'rows':_0x26538a}:null;}})[_0xa390('0x22')](respondWithResult(_0x15e2f4,null))[_0xa390('0x4c')](handleError(_0x15e2f4,null));};exports['addFaxAccounts']=function(_0x28afef,_0x1441a8){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x28afef['params']['id']}})['then'](handleEntityNotFound(_0x1441a8,null))['then'](function(_0x440191){if(_0x440191){return _0x440191[_0xa390('0x146')](_0x28afef[_0xa390('0x56')][_0xa390('0x59')],_[_0xa390('0x113')](_0x28afef[_0xa390('0x56')],['ids','id'])||{});}})[_0xa390('0x22')](respondWithResult(_0x1441a8,null))[_0xa390('0x4c')](handleError(_0x1441a8,null));};exports[_0xa390('0x147')]=function(_0x3f6e97,_0x3eddc1){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x3f6e97[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x3eddc1,null))[_0xa390('0x22')](function(_0x7656d4){if(_0x7656d4){return _0x7656d4[_0xa390('0x147')](_0x3f6e97['query'][_0xa390('0x59')]);}})['then'](respondWithStatusCode(_0x3eddc1,null))[_0xa390('0x4c')](handleError(_0x3eddc1,null));};exports['getMailAccounts']=function(_0x3529a1,_0x1aa176){var _0x34ce31={};var _0x3c5a55={};var _0x149432;var _0x8ffe3e;return db['User'][_0xa390('0x90')]({'where':{'id':_0x3529a1[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x1aa176,null))[_0xa390('0x22')](function(_0x151516){if(_0x151516){_0x149432=_0x151516;_0x3c5a55[_0xa390('0x4e')]=_[_0xa390('0x50')](db[_0xa390('0x148')][_0xa390('0x34')]);_0x3c5a55[_0xa390('0x40')]=_['keys'](_0x3529a1['query']);_0x3c5a55[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x3c5a55[_0xa390('0x4e')],_0x3c5a55[_0xa390('0x40')]);_0x34ce31['attributes']=_[_0xa390('0x51')](_0x3c5a55['model'],qs[_0xa390('0x52')](_0x3529a1[_0xa390('0x40')]['fields']));_0x34ce31[_0xa390('0x3d')]=_0x34ce31[_0xa390('0x3d')]['length']?_0x34ce31[_0xa390('0x3d')]:_0x3c5a55[_0xa390('0x4e')];_0x34ce31[_0xa390('0xd6')]=qs[_0xa390('0xc8')](_0x3529a1[_0xa390('0x40')][_0xa390('0xc8')]);_0x34ce31[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_['pick'](_0x3529a1[_0xa390('0x40')],_0x3c5a55['filters']));if(_0x3529a1[_0xa390('0x40')]['filter']){_0x34ce31[_0xa390('0x3b')]=_[_0xa390('0x53')](_0x34ce31['where'],{'$or':_[_0xa390('0x35')](_0x34ce31[_0xa390('0x3d')],function(_0x1cf1bd){var _0x493bda={};_0x493bda[_0x1cf1bd]={'$like':'%'+_0x3529a1['query'][_0xa390('0x2a')]+'%'};return _0x493bda;})});}_0x34ce31=_['merge']({},_0x34ce31,_0x3529a1['options']);return _0x149432[_0xa390('0x149')](_0x34ce31);}})[_0xa390('0x22')](function(_0x4c3455){if(_0x4c3455){_0x8ffe3e=_0x4c3455['length'];if(!_0x3529a1[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0x34ce31[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0x3529a1[_0xa390('0x40')]['limit']);_0x34ce31[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x3529a1[_0xa390('0x40')]['offset']);}return _0x149432[_0xa390('0x149')](_0x34ce31);}})[_0xa390('0x22')](function(_0x33e840){if(_0x33e840){return _0x33e840?{'count':_0x8ffe3e,'rows':_0x33e840}:null;}})['then'](respondWithResult(_0x1aa176,null))[_0xa390('0x4c')](handleError(_0x1aa176,null));};exports['addMailAccounts']=function(_0x52fede,_0x186f40){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x52fede[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x186f40,null))[_0xa390('0x22')](function(_0x22a50d){if(_0x22a50d){return _0x22a50d['addMailAccounts'](_0x52fede[_0xa390('0x56')][_0xa390('0x59')],_[_0xa390('0x113')](_0x52fede[_0xa390('0x56')],[_0xa390('0x59'),'id'])||{});}})[_0xa390('0x22')](respondWithResult(_0x186f40,null))[_0xa390('0x4c')](handleError(_0x186f40,null));};exports[_0xa390('0x14a')]=function(_0x37c5a1,_0x25be81){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x37c5a1[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x25be81,null))['then'](function(_0xa802df){if(_0xa802df){return _0xa802df[_0xa390('0x14a')](_0x37c5a1[_0xa390('0x40')][_0xa390('0x59')]);}})[_0xa390('0x22')](respondWithStatusCode(_0x25be81,null))[_0xa390('0x4c')](handleError(_0x25be81,null));};exports[_0xa390('0x14b')]=function(_0x1b04c3,_0x4a6ca7){var _0x3e65e6={};var _0x4f9617={};var _0x53dd0c;var _0xf9c4f;return db[_0xa390('0x33')]['findOne']({'where':{'id':_0x1b04c3[_0xa390('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a6ca7,null))[_0xa390('0x22')](function(_0x2b25c5){if(_0x2b25c5){_0x53dd0c=_0x2b25c5;_0x4f9617[_0xa390('0x4e')]=_[_0xa390('0x50')](db[_0xa390('0x14c')][_0xa390('0x34')]);_0x4f9617[_0xa390('0x40')]=_[_0xa390('0x50')](_0x1b04c3[_0xa390('0x40')]);_0x4f9617[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x4f9617['model'],_0x4f9617[_0xa390('0x40')]);_0x3e65e6['attributes']=_[_0xa390('0x51')](_0x4f9617[_0xa390('0x4e')],qs['fields'](_0x1b04c3['query'][_0xa390('0x52')]));_0x3e65e6['attributes']=_0x3e65e6['attributes'][_0xa390('0x44')]?_0x3e65e6[_0xa390('0x3d')]:_0x4f9617[_0xa390('0x4e')];_0x3e65e6['order']=qs[_0xa390('0xc8')](_0x1b04c3['query'][_0xa390('0xc8')]);_0x3e65e6[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x1b04c3[_0xa390('0x40')],_0x4f9617[_0xa390('0xc7')]));if(_0x1b04c3[_0xa390('0x40')][_0xa390('0x2a')]){_0x3e65e6['where']=_[_0xa390('0x53')](_0x3e65e6[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x3e65e6[_0xa390('0x3d')],function(_0x5d9072){var _0x36856a={};_0x36856a[_0x5d9072]={'$like':'%'+_0x1b04c3[_0xa390('0x40')][_0xa390('0x2a')]+'%'};return _0x36856a;})});}_0x3e65e6=_[_0xa390('0x53')]({},_0x3e65e6,_0x1b04c3[_0xa390('0x54')]);return _0x53dd0c[_0xa390('0x14b')](_0x3e65e6);}})[_0xa390('0x22')](function(_0x5a64f2){if(_0x5a64f2){_0xf9c4f=_0x5a64f2[_0xa390('0x44')];if(!_0x1b04c3['query'][_0xa390('0xca')](_0xa390('0xd4'))){_0x3e65e6[_0xa390('0x1e')]=qs['limit'](_0x1b04c3[_0xa390('0x40')][_0xa390('0x1e')]);_0x3e65e6[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x1b04c3[_0xa390('0x40')][_0xa390('0x1c')]);}return _0x53dd0c[_0xa390('0x14b')](_0x3e65e6);}})[_0xa390('0x22')](function(_0x3f9919){if(_0x3f9919){return _0x3f9919?{'count':_0xf9c4f,'rows':_0x3f9919}:null;}})[_0xa390('0x22')](respondWithResult(_0x4a6ca7,null))[_0xa390('0x4c')](handleError(_0x4a6ca7,null));};exports[_0xa390('0x14d')]=function(_0x5ba1df,_0x32b5b7){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x5ba1df['params']['id']}})['then'](handleEntityNotFound(_0x32b5b7,null))[_0xa390('0x22')](function(_0x566cfd){if(_0x566cfd){return _0x566cfd[_0xa390('0x14d')](_0x5ba1df['body'][_0xa390('0x59')],_[_0xa390('0x113')](_0x5ba1df[_0xa390('0x56')],['ids','id'])||{});}})['then'](respondWithResult(_0x32b5b7,null))[_0xa390('0x4c')](handleError(_0x32b5b7,null));};exports['removeOpenchannelAccounts']=function(_0x28d694,_0x4d456f){return db['User'][_0xa390('0x2c')]({'where':{'id':_0x28d694[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x4d456f,null))[_0xa390('0x22')](function(_0x3ce5df){if(_0x3ce5df){return _0x3ce5df[_0xa390('0x14e')](_0x28d694['query'][_0xa390('0x59')]);}})[_0xa390('0x22')](respondWithStatusCode(_0x4d456f,null))['catch'](handleError(_0x4d456f,null));};exports['getSmsAccounts']=function(_0x2ed46d,_0xc073c0){var _0x5df2fd={};var _0x5588d9={};var _0x1680b3;var _0x2d9b71;return db[_0xa390('0x33')]['findOne']({'where':{'id':_0x2ed46d[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0xc073c0,null))['then'](function(_0x16100b){if(_0x16100b){_0x1680b3=_0x16100b;_0x5588d9[_0xa390('0x4e')]=_[_0xa390('0x50')](db[_0xa390('0x14f')][_0xa390('0x34')]);_0x5588d9[_0xa390('0x40')]=_[_0xa390('0x50')](_0x2ed46d[_0xa390('0x40')]);_0x5588d9[_0xa390('0xc7')]=_['intersection'](_0x5588d9['model'],_0x5588d9[_0xa390('0x40')]);_0x5df2fd[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x5588d9['model'],qs['fields'](_0x2ed46d[_0xa390('0x40')][_0xa390('0x52')]));_0x5df2fd[_0xa390('0x3d')]=_0x5df2fd[_0xa390('0x3d')][_0xa390('0x44')]?_0x5df2fd['attributes']:_0x5588d9[_0xa390('0x4e')];_0x5df2fd['order']=qs[_0xa390('0xc8')](_0x2ed46d['query'][_0xa390('0xc8')]);_0x5df2fd[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x2ed46d['query'],_0x5588d9[_0xa390('0xc7')]));if(_0x2ed46d['query'][_0xa390('0x2a')]){_0x5df2fd['where']=_[_0xa390('0x53')](_0x5df2fd[_0xa390('0x3b')],{'$or':_['map'](_0x5df2fd[_0xa390('0x3d')],function(_0x1411ce){var _0x3a09c3={};_0x3a09c3[_0x1411ce]={'$like':'%'+_0x2ed46d['query'][_0xa390('0x2a')]+'%'};return _0x3a09c3;})});}_0x5df2fd=_[_0xa390('0x53')]({},_0x5df2fd,_0x2ed46d[_0xa390('0x54')]);return _0x1680b3[_0xa390('0x150')](_0x5df2fd);}})[_0xa390('0x22')](function(_0x10f3ab){if(_0x10f3ab){_0x2d9b71=_0x10f3ab['length'];if(!_0x2ed46d[_0xa390('0x40')]['hasOwnProperty'](_0xa390('0xd4'))){_0x5df2fd[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0x2ed46d[_0xa390('0x40')][_0xa390('0x1e')]);_0x5df2fd['offset']=qs[_0xa390('0x1c')](_0x2ed46d[_0xa390('0x40')]['offset']);}return _0x1680b3[_0xa390('0x150')](_0x5df2fd);}})[_0xa390('0x22')](function(_0x64dc1b){if(_0x64dc1b){return _0x64dc1b?{'count':_0x2d9b71,'rows':_0x64dc1b}:null;}})['then'](respondWithResult(_0xc073c0,null))[_0xa390('0x4c')](handleError(_0xc073c0,null));};exports[_0xa390('0x151')]=function(_0x5715cb,_0x5aaf10){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x5715cb[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x5aaf10,null))['then'](function(_0x43a6da){if(_0x43a6da){return _0x43a6da[_0xa390('0x151')](_0x5715cb[_0xa390('0x56')][_0xa390('0x59')],_['omit'](_0x5715cb[_0xa390('0x56')],[_0xa390('0x59'),'id'])||{});}})[_0xa390('0x22')](respondWithResult(_0x5aaf10,null))['catch'](handleError(_0x5aaf10,null));};exports['removeSmsAccounts']=function(_0x1093e9,_0x244bac){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x1093e9['params']['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x244bac,null))[_0xa390('0x22')](function(_0xbf6606){if(_0xbf6606){return _0xbf6606[_0xa390('0x152')](_0x1093e9[_0xa390('0x40')][_0xa390('0x59')]);}})['then'](respondWithStatusCode(_0x244bac,null))['catch'](handleError(_0x244bac,null));};exports['getChatWebsites']=function(_0x25e379,_0x1a759f){var _0x44e280={};var _0x3c3e82={};var _0x2cdc45;var _0x2d8a5f;return db[_0xa390('0x33')][_0xa390('0x90')]({'where':{'id':_0x25e379[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x1a759f,null))[_0xa390('0x22')](function(_0x482fdc){if(_0x482fdc){_0x2cdc45=_0x482fdc;_0x3c3e82[_0xa390('0x4e')]=_[_0xa390('0x50')](db['ChatWebsite']['rawAttributes']);_0x3c3e82[_0xa390('0x40')]=_[_0xa390('0x50')](_0x25e379[_0xa390('0x40')]);_0x3c3e82[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x3c3e82['model'],_0x3c3e82[_0xa390('0x40')]);_0x44e280[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x3c3e82[_0xa390('0x4e')],qs[_0xa390('0x52')](_0x25e379[_0xa390('0x40')][_0xa390('0x52')]));_0x44e280[_0xa390('0x3d')]=_0x44e280[_0xa390('0x3d')][_0xa390('0x44')]?_0x44e280['attributes']:_0x3c3e82['model'];_0x44e280[_0xa390('0xd6')]=qs[_0xa390('0xc8')](_0x25e379[_0xa390('0x40')]['sort']);_0x44e280[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x25e379[_0xa390('0x40')],_0x3c3e82[_0xa390('0xc7')]));if(_0x25e379[_0xa390('0x40')][_0xa390('0x2a')]){_0x44e280[_0xa390('0x3b')]=_[_0xa390('0x53')](_0x44e280[_0xa390('0x3b')],{'$or':_['map'](_0x44e280[_0xa390('0x3d')],function(_0xa810ad){var _0x3d6df7={};_0x3d6df7[_0xa810ad]={'$like':'%'+_0x25e379['query'][_0xa390('0x2a')]+'%'};return _0x3d6df7;})});}_0x44e280=_[_0xa390('0x53')]({},_0x44e280,_0x25e379['options']);return _0x2cdc45[_0xa390('0x153')](_0x44e280);}})[_0xa390('0x22')](function(_0x42d5e6){if(_0x42d5e6){_0x2d8a5f=_0x42d5e6[_0xa390('0x44')];if(!_0x25e379[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0x44e280[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0x25e379['query']['limit']);_0x44e280[_0xa390('0x1c')]=qs['offset'](_0x25e379[_0xa390('0x40')]['offset']);}return _0x2cdc45[_0xa390('0x153')](_0x44e280);}})['then'](function(_0x2081ac){if(_0x2081ac){return _0x2081ac?{'count':_0x2d8a5f,'rows':_0x2081ac}:null;}})[_0xa390('0x22')](respondWithResult(_0x1a759f,null))[_0xa390('0x4c')](handleError(_0x1a759f,null));};exports[_0xa390('0x154')]=function(_0x2c8095,_0x2021ef){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x2c8095['params']['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x2021ef,null))[_0xa390('0x22')](function(_0x31c497){if(_0x31c497){return _0x31c497['addChatWebsites'](_0x2c8095['body'][_0xa390('0x59')],_[_0xa390('0x113')](_0x2c8095[_0xa390('0x56')],[_0xa390('0x59'),'id'])||{});}})['then'](respondWithResult(_0x2021ef,null))[_0xa390('0x4c')](handleError(_0x2021ef,null));};exports[_0xa390('0x155')]=function(_0x3df795,_0x4b67a2){return db[_0xa390('0x33')]['find']({'where':{'id':_0x3df795[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x4b67a2,null))[_0xa390('0x22')](function(_0x5b94b6){if(_0x5b94b6){return _0x5b94b6[_0xa390('0x155')](_0x3df795[_0xa390('0x40')][_0xa390('0x59')]);}})[_0xa390('0x22')](respondWithStatusCode(_0x4b67a2,null))['catch'](handleError(_0x4b67a2,null));};exports[_0xa390('0x156')]=function(_0x118ff9,_0x863342){var _0x1762c1={};var _0x481cd7={};var _0x407781;var _0x1a8b60;return db[_0xa390('0x33')][_0xa390('0x90')]({'where':{'id':_0x118ff9[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x863342,null))[_0xa390('0x22')](function(_0x556d3b){if(_0x556d3b){_0x407781=_0x556d3b;_0x481cd7[_0xa390('0x4e')]=_[_0xa390('0x50')](db[_0xa390('0x157')][_0xa390('0x34')]);_0x481cd7[_0xa390('0x40')]=_[_0xa390('0x50')](_0x118ff9[_0xa390('0x40')]);_0x481cd7[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x481cd7[_0xa390('0x4e')],_0x481cd7[_0xa390('0x40')]);_0x1762c1[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x481cd7['model'],qs[_0xa390('0x52')](_0x118ff9[_0xa390('0x40')][_0xa390('0x52')]));_0x1762c1[_0xa390('0x3d')]=_0x1762c1[_0xa390('0x3d')]['length']?_0x1762c1['attributes']:_0x481cd7[_0xa390('0x4e')];_0x1762c1[_0xa390('0xd6')]=qs[_0xa390('0xc8')](_0x118ff9[_0xa390('0x40')][_0xa390('0xc8')]);_0x1762c1[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x118ff9[_0xa390('0x40')],_0x481cd7[_0xa390('0xc7')]));if(_0x118ff9[_0xa390('0x40')][_0xa390('0x2a')]){_0x1762c1[_0xa390('0x3b')]=_[_0xa390('0x53')](_0x1762c1[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x1762c1[_0xa390('0x3d')],function(_0x58e8fe){var _0x1ffaa1={};_0x1ffaa1[_0x58e8fe]={'$like':'%'+_0x118ff9[_0xa390('0x40')][_0xa390('0x2a')]+'%'};return _0x1ffaa1;})});}_0x1762c1=_[_0xa390('0x53')]({},_0x1762c1,_0x118ff9[_0xa390('0x54')]);return _0x407781[_0xa390('0x156')](_0x1762c1);}})['then'](function(_0x3be416){if(_0x3be416){_0x1a8b60=_0x3be416[_0xa390('0x44')];if(!_0x118ff9[_0xa390('0x40')][_0xa390('0xca')](_0xa390('0xd4'))){_0x1762c1['limit']=qs[_0xa390('0x1e')](_0x118ff9['query']['limit']);_0x1762c1[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x118ff9[_0xa390('0x40')][_0xa390('0x1c')]);}return _0x407781['getWhatsappAccounts'](_0x1762c1);}})[_0xa390('0x22')](function(_0x595222){if(_0x595222){return _0x595222?{'count':_0x1a8b60,'rows':_0x595222}:null;}})[_0xa390('0x22')](respondWithResult(_0x863342,null))[_0xa390('0x4c')](handleError(_0x863342,null));};exports[_0xa390('0x158')]=function(_0x5e184a,_0x6e5ddd){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x5e184a[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x6e5ddd,null))[_0xa390('0x22')](function(_0x554cfd){if(_0x554cfd){return _0x554cfd['addWhatsappAccounts'](_0x5e184a['body'][_0xa390('0x59')],_['omit'](_0x5e184a[_0xa390('0x56')],['ids','id'])||{});}})[_0xa390('0x22')](respondWithResult(_0x6e5ddd,null))[_0xa390('0x4c')](handleError(_0x6e5ddd,null));};exports['removeWhatsappAccounts']=function(_0x4ffb8e,_0x28af6a){return db['User'][_0xa390('0x2c')]({'where':{'id':_0x4ffb8e[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x28af6a,null))[_0xa390('0x22')](function(_0xb5b34d){if(_0xb5b34d){return _0xb5b34d['removeWhatsappAccounts'](_0x4ffb8e[_0xa390('0x40')][_0xa390('0x59')]);}})[_0xa390('0x22')](respondWithStatusCode(_0x28af6a,null))[_0xa390('0x4c')](handleError(_0x28af6a,null));};exports['getSquareProjects']=function(_0xbf1bc6,_0x383d7d){var _0x59bb1f={};var _0x3af2c8={};var _0x309ccd;var _0x94ac44;return db[_0xa390('0x33')]['findOne']({'where':{'id':_0xbf1bc6['params']['id']}})['then'](handleEntityNotFound(_0x383d7d,null))[_0xa390('0x22')](function(_0xc26754){if(_0xc26754){_0x309ccd=_0xc26754;_0x3af2c8[_0xa390('0x4e')]=_[_0xa390('0x50')](db['SquareProject'][_0xa390('0x34')]);_0x3af2c8[_0xa390('0x40')]=_[_0xa390('0x50')](_0xbf1bc6[_0xa390('0x40')]);_0x3af2c8[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x3af2c8['model'],_0x3af2c8[_0xa390('0x40')]);_0x59bb1f[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x3af2c8['model'],qs[_0xa390('0x52')](_0xbf1bc6[_0xa390('0x40')][_0xa390('0x52')]));_0x59bb1f[_0xa390('0x3d')]=_0x59bb1f[_0xa390('0x3d')][_0xa390('0x44')]?_0x59bb1f[_0xa390('0x3d')]:_0x3af2c8[_0xa390('0x4e')];_0x59bb1f[_0xa390('0xd6')]=qs[_0xa390('0xc8')](_0xbf1bc6[_0xa390('0x40')]['sort']);_0x59bb1f[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0xbf1bc6['query'],_0x3af2c8[_0xa390('0xc7')]));if(_0xbf1bc6[_0xa390('0x40')][_0xa390('0x2a')]){_0x59bb1f[_0xa390('0x3b')]=_['merge'](_0x59bb1f[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x59bb1f[_0xa390('0x3d')],function(_0xd76e9c){var _0x5e2799={};_0x5e2799[_0xd76e9c]={'$like':'%'+_0xbf1bc6[_0xa390('0x40')][_0xa390('0x2a')]+'%'};return _0x5e2799;})});}_0x59bb1f=_[_0xa390('0x53')]({},_0x59bb1f,_0xbf1bc6[_0xa390('0x54')]);return _0x309ccd[_0xa390('0x159')](_0x59bb1f);}})[_0xa390('0x22')](function(_0x1b6c35){if(_0x1b6c35){_0x94ac44=_0x1b6c35['length'];if(!_0xbf1bc6['query'][_0xa390('0xca')](_0xa390('0xd4'))){_0x59bb1f[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0xbf1bc6[_0xa390('0x40')][_0xa390('0x1e')]);_0x59bb1f[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0xbf1bc6['query'][_0xa390('0x1c')]);}return _0x309ccd['getSquareProjects'](_0x59bb1f);}})['then'](function(_0x1ded14){if(_0x1ded14){return _0x1ded14?{'count':_0x94ac44,'rows':_0x1ded14}:null;}})[_0xa390('0x22')](respondWithResult(_0x383d7d,null))[_0xa390('0x4c')](handleError(_0x383d7d,null));};exports['addSquareProjects']=function(_0x2ba0fb,_0x3223b9){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x2ba0fb[_0xa390('0x4d')]['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x3223b9,null))[_0xa390('0x22')](function(_0x85a28c){if(_0x85a28c){return _0x85a28c['addSquareProjects'](_0x2ba0fb['body'][_0xa390('0x59')],_[_0xa390('0x113')](_0x2ba0fb['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x3223b9,null))[_0xa390('0x4c')](handleError(_0x3223b9,null));};exports[_0xa390('0x15a')]=function(_0x3f3fea,_0x1d59df){return db['User'][_0xa390('0x2c')]({'where':{'id':_0x3f3fea[_0xa390('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1d59df,null))[_0xa390('0x22')](function(_0x1b2b23){if(_0x1b2b23){return _0x1b2b23[_0xa390('0x15a')](_0x3f3fea[_0xa390('0x40')][_0xa390('0x59')]);}})['then'](respondWithStatusCode(_0x1d59df,null))['catch'](handleError(_0x1d59df,null));};exports[_0xa390('0x15b')]=function(_0x283267,_0x27df9a){var _0x53c8ab={},_0x147eca={},_0x54aced={'count':0x0,'rows':[]};var _0x5a43cb=db['CmHopper'][_0xa390('0x34')];_0x147eca[_0xa390('0x4e')]=_[_0xa390('0x50')](_0x5a43cb);_0x147eca[_0xa390('0x40')]=_['keys'](_0x283267[_0xa390('0x40')]);_0x147eca[_0xa390('0xc7')]=_[_0xa390('0x51')](_0x147eca[_0xa390('0x4e')],_0x147eca[_0xa390('0x40')]);_0x147eca['filters']=_['concat'](_0x147eca[_0xa390('0xc7')],[_0xa390('0x15c'),_0xa390('0x15d'),_0xa390('0x15e'),_0xa390('0x15f'),_0xa390('0x160'),'$lte',_0xa390('0x161'),_0xa390('0x162'),_0xa390('0x163'),'$between',_0xa390('0x164'),_0xa390('0x165'),_0xa390('0x166'),_0xa390('0x167'),_0xa390('0x168'),_0xa390('0x169'),_0xa390('0x16a'),_0xa390('0x167'),_0xa390('0x16b'),'$contains',_0xa390('0x16c'),_0xa390('0x16d')]);_0x53c8ab[_0xa390('0x3d')]=_[_0xa390('0x51')](_0x147eca['model'],qs[_0xa390('0x52')](_0x283267[_0xa390('0x40')]['fields']));_0x53c8ab[_0xa390('0x3d')]=_0x53c8ab[_0xa390('0x3d')]['length']?_0x53c8ab['attributes']:_0x147eca[_0xa390('0x4e')];if(!_0x283267[_0xa390('0x40')][_0xa390('0xca')]('nolimit')){_0x53c8ab[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0x283267['query'][_0xa390('0x1e')]);_0x53c8ab[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x283267[_0xa390('0x40')][_0xa390('0x1c')]);}_0x53c8ab['order']=qs['sort'](_0x283267[_0xa390('0x40')][_0xa390('0xc8')]);_0x53c8ab[_0xa390('0x3b')]=qs[_0xa390('0xc7')](_[_0xa390('0xc9')](_0x283267[_0xa390('0x40')],_0x147eca[_0xa390('0xc7')]));if(_0x283267[_0xa390('0x40')][_0xa390('0x2a')]){_0x53c8ab['where']=_[_0xa390('0x53')](_0x53c8ab[_0xa390('0x3b')],{'$or':_[_0xa390('0x35')](_0x53c8ab['attributes'],function(_0xe5879e){var _0x4e126e={};_0x4e126e[_0xe5879e]={'$like':'%'+_0x283267[_0xa390('0x40')][_0xa390('0x2a')]+'%'};return _0x4e126e;})});}_0x53c8ab[_0xa390('0x3b')]={'$and':[_0x53c8ab[_0xa390('0x3b')],{'$or':[{'UserId':_0x283267['params']['id']},{'OwnerId':_0x283267['params']['id']}]}]};_0x53c8ab=_[_0xa390('0x53')]({},_0x53c8ab,_0x283267[_0xa390('0x54')]);var _0x161ba5={'where':_0x53c8ab[_0xa390('0x3b')]};return db[_0xa390('0x16e')][_0xa390('0x1f')](_0x161ba5)[_0xa390('0x22')](function(_0x39f242){_0x54aced[_0xa390('0x1f')]=_0x39f242;if(_0x283267[_0xa390('0x40')][_0xa390('0xcb')]){_0x53c8ab[_0xa390('0x3c')]=[{'attributes':['id','firstName',_0xa390('0x16f'),'phone'],'model':db[_0xa390('0xc6')],'as':_0xa390('0x170')},{'attributes':['id','name','dialActive'],'model':db[_0xa390('0xa7')],'as':_0xa390('0xd2')}];}return db[_0xa390('0x16e')]['findAll'](_0x53c8ab);})['then'](function(_0x12ea1b){_0x54aced[_0xa390('0x43')]=_0x12ea1b;return _0x54aced;})[_0xa390('0x22')](respondWithFilteredResult(_0x27df9a,_0x53c8ab))[_0xa390('0x4c')](handleError(_0x27df9a,null));};exports['getApiKey']=function(_0x52f81b,_0xae4cc){if(!_['isNil'](_0x52f81b[_0xa390('0x26')]['id'])&&(_0x52f81b[_0xa390('0x26')][_0xa390('0x23')]==_0xa390('0x24')||_0x52f81b[_0xa390('0x26')][_0xa390('0x23')]==_0xa390('0x26'))){return db[_0xa390('0x33')][_0xa390('0x90')]({'where':{'id':_0x52f81b[_0xa390('0x4d')]['id']},'raw':!![]})[_0xa390('0x22')](function(_0x5259eb){return authService['retrieveApiKey'](_0x5259eb);})['then'](function(_0x18d51e){if(_0x18d51e){return _0xae4cc['status'](0xc8)[_0xa390('0x20')]({'api_key':_0x18d51e[_0xa390('0x171')]});}else{return _0xae4cc['status'](0xcc)['json']({'message':'No\x20API\x20access\x20key\x20found!'});}})[_0xa390('0x4c')](handleError(_0xae4cc,0x193));}else{return _0xae4cc[_0xa390('0x1a')](0x191)[_0xa390('0x20')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xa390('0x172')]=function(_0x4f9f8e,_0x574bbb){if(!_[_0xa390('0x60')](_0x4f9f8e[_0xa390('0x26')]['id'])&&(_0x4f9f8e[_0xa390('0x26')]['role']=='admin'||_0x4f9f8e[_0xa390('0x26')][_0xa390('0x23')]==_0xa390('0x26'))){return db[_0xa390('0x33')][_0xa390('0x2c')]({'where':{'id':_0x4f9f8e[_0xa390('0x4d')]['id']}})['then'](function(_0x56a3c4){return authService[_0xa390('0x173')](_0x56a3c4);})[_0xa390('0x22')](function(_0xd14a03){return db[_0xa390('0x33')][_0xa390('0x21')]({'apiKeyIat':_0xd14a03[_0xa390('0x174')],'apiKeyNonce':_0xd14a03[_0xa390('0x175')]},{'where':{'id':_0x4f9f8e['params']['id']}})[_0xa390('0x22')](function(){return _0x574bbb['status'](0xc8)[_0xa390('0x20')]({'api_key':_0xd14a03[_0xa390('0x171')]});});})[_0xa390('0x4c')](handleError(_0x574bbb,0x193));}else{return _0x574bbb['status'](0x191)[_0xa390('0x20')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports[_0xa390('0x176')]=function(_0x535d30,_0x3094f3){if(!_[_0xa390('0x60')](_0x535d30['user']['id'])&&(_0x535d30[_0xa390('0x26')][_0xa390('0x23')]==_0xa390('0x24')||_0x535d30['user'][_0xa390('0x23')]==_0xa390('0x26'))){return db['User'][_0xa390('0x2c')]({'where':{'id':_0x535d30['params']['id']}})[_0xa390('0x22')](handleEntityNotFound(_0x3094f3,null))[_0xa390('0x22')](function(_0x17230c){if(_0x17230c&&_0x17230c[_0xa390('0x177')]&&_0x17230c[_0xa390('0x178')])return _0x17230c;else throw{'message':_0xa390('0x179')};})[_0xa390('0x22')](function(_0x15eb4e){return db[_0xa390('0x33')]['update']({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x535d30['params']['id']}});})[_0xa390('0x22')](respondWithStatusCode(_0x3094f3,0xc8))[_0xa390('0x4c')](handleError(_0x3094f3,0x193));}else{return _0x3094f3[_0xa390('0x1a')](0x191)[_0xa390('0x20')]({'message':_0xa390('0x17a')});}};exports[_0xa390('0x17b')]=function(_0x1435dd,_0x3df19c){var _0x22985c=_0x1435dd[_0xa390('0x26')]['get']({'plain':!![]});if(!_0x22985c){return _0x3df19c[_0xa390('0x1a')](0x191)[_0xa390('0x32')](_0xa390('0x17c'));}else{return _0x3df19c[_0xa390('0x1a')](0xc8)[_0xa390('0x20')](_0x22985c);}};exports[_0xa390('0x17d')]=function(_0x3de67d,_0x271d79){var _0x3b166f={'offset':0x0},_0x5a5476={'count':0x0,'rows':[]};Promise['resolve']()[_0xa390('0x22')](function(){if(!_0x3de67d[_0xa390('0x40')][_0xa390('0x2a')]&&!_0x3de67d[_0xa390('0x40')]['teams']&&!_0x3de67d[_0xa390('0x40')][_0xa390('0x17e')])return[];return Promise[_0xa390('0xfe')]()['then'](function(){var _0x5d38aa=[];if(!_[_0xa390('0x82')](_0x3de67d[_0xa390('0x40')][_0xa390('0x17f')])){_0x5d38aa[_0xa390('0x3e')](db[_0xa390('0x111')]['findAll']({'attributes':['id',_0xa390('0x2d')],'where':{'id':_0x3de67d[_0xa390('0x40')][_0xa390('0x17f')]}}));}if(!_[_0xa390('0x82')](_0x3de67d[_0xa390('0x40')][_0xa390('0x17e')])){_0x5d38aa[_0xa390('0x3e')](db[_0xa390('0xa7')][_0xa390('0x3f')]({'attributes':['id',_0xa390('0x2d')],'type':_0xa390('0x180'),'where':{'id':_0x3de67d[_0xa390('0x40')][_0xa390('0x17e')]}}));}return Promise[_0xa390('0x4b')](_0x5d38aa);})[_0xa390('0x22')](function(_0x108eb2){var _0x396caa=_['flatten'](_0x108eb2)['map'](function(_0x431bf7){return _0x431bf7['getAgents']({'attributes':['id',_0xa390('0x2d'),'internal',_0xa390('0x98')],'raw':!![]});});return Promise['all'](_0x396caa);})[_0xa390('0x22')](function(_0x148809){var _0x4e2fed=_[_0xa390('0x11d')](_0x148809);if(!_0x3de67d[_0xa390('0x40')][_0xa390('0x2a')])return _0x4e2fed;if(_[_0xa390('0x82')](_0x4e2fed)){return db[_0xa390('0x33')][_0xa390('0x3f')]({'attributes':['id',_0xa390('0x2d'),'internal','online'],'where':{'role':_0xa390('0x27'),'$or':[db[_0xa390('0x61')][_0xa390('0x3b')](db[_0xa390('0x61')]['fn']('lower',db[_0xa390('0x61')][_0xa390('0x181')](_0xa390('0x2d'))),{'$like':'%'+_0x3de67d[_0xa390('0x40')][_0xa390('0x2a')][_0xa390('0x9e')]()+'%'}),{'internal':{'$like':'%'+_0x3de67d[_0xa390('0x40')][_0xa390('0x2a')]+'%'}}]},'raw':!![]});}else{return _(_0x4e2fed)[_0xa390('0x11d')]()['filter'](function(_0x22e6d1){return _0x22e6d1[_0xa390('0x2d')]['toLowerCase']()['includes'](_0x3de67d[_0xa390('0x40')][_0xa390('0x2a')]['toLowerCase']())||_0x22e6d1[_0xa390('0x5a')][_0xa390('0x182')]()[_0xa390('0x37')](_0x3de67d[_0xa390('0x40')][_0xa390('0x2a')]);})[_0xa390('0x2b')]();}})[_0xa390('0x22')](function(_0x306287){var _0x4be2af=_0xa390('0x2d');var _0x2a8bbd=_0xa390('0x183');if(_0x3de67d[_0xa390('0x40')][_0xa390('0xc8')]){var _0x2a8bbd=_0x3de67d[_0xa390('0x40')]['sort'][0x0]==='-'?'desc':_0xa390('0x183');var _0x4be2af=_0x2a8bbd===_0xa390('0x183')?_0x3de67d[_0xa390('0x40')][_0xa390('0xc8')]:_0x3de67d[_0xa390('0x40')][_0xa390('0xc8')]['substring'](0x1);}return _(_0x306287)['uniqBy']('id')[_0xa390('0x184')]([function(_0xa6aa2a){return _0x4be2af===_0xa390('0x2d')?_0xa6aa2a[_0x4be2af][_0xa390('0x9e')]():_0xa6aa2a[_0x4be2af];}],[_0x2a8bbd])['map'](function(_0x425dc7){return _[_0xa390('0xc9')](_0x425dc7,['id',_0xa390('0x2d'),_0xa390('0x5a'),_0xa390('0x98')]);})[_0xa390('0x2b')]();})[_0xa390('0x22')](function(_0x4673c6){return client['request']('Agents',_0x3de67d)[_0xa390('0x22')](function(_0x34a190){if(_0x34a190[_0xa390('0x16')])throw new Error(_0xa390('0x185'));var _0x3198cf=_0x34a190[_0xa390('0x19')];var _0x213aaa=jayson[_0xa390('0x186')][_0xa390('0x11')]({'port':0x232c});return _0x213aaa[_0xa390('0x12')](_0xa390('0x7c'),_0x3de67d)[_0xa390('0x22')](function(_0x476422){if(_0x476422[_0xa390('0x16')])throw new Error(_0xa390('0x187'));var _0x444f0f=_0x476422['result'];return _['merge']({},_0x444f0f,_0x3198cf);});})[_0xa390('0x22')](function(_0x9360a6){return _[_0xa390('0x35')](_0x4673c6,function(_0x56c9c6){var _0x10f603=_[_0xa390('0x2c')](_0x9360a6[_0xa390('0x43')],['id',_0x56c9c6['id']]);if(!_0x10f603||!_0x56c9c6[_0xa390('0x98')]){_0x56c9c6[_0xa390('0x1a')]=_0xa390('0x188');}else if(_0x10f603[_0xa390('0xab')]){_0x56c9c6[_0xa390('0x1a')]=_0xa390('0x100');}else{_0x56c9c6[_0xa390('0x1a')]=_[_0xa390('0x37')](['idle','unknown',_0xa390('0x189'),_0xa390('0x18a'),null,undefined],_0x10f603[_0xa390('0x18b')])?_0xa390('0x98'):_0xa390('0x18c');}return _0x56c9c6;});});});})[_0xa390('0x22')](function(_0x1c49b2){if(!_0x3de67d[_0xa390('0x40')][_0xa390('0xca')]('nolimit')){_0x3b166f[_0xa390('0x1e')]=qs[_0xa390('0x1e')](_0x3de67d[_0xa390('0x40')][_0xa390('0x1e')]||0xa);_0x3b166f[_0xa390('0x1c')]=qs[_0xa390('0x1c')](_0x3de67d[_0xa390('0x40')][_0xa390('0x1c')]);}_0x5a5476['count']=_0x1c49b2[_0xa390('0x44')];_0x5a5476[_0xa390('0x43')]=_0x3b166f[_0xa390('0x1e')]?_0x1c49b2[_0xa390('0x18d')](_0x3b166f[_0xa390('0x1c')],_0x3b166f[_0xa390('0x1c')]+_0x3b166f['limit']):_0x1c49b2;return _0x5a5476;})[_0xa390('0x22')](respondWithFilteredResult(_0x271d79,_0x3b166f))[_0xa390('0x4c')](handleError(_0x271d79,null));};function get_open_tabs(_0x25f8ad,_0x40d081){var _0x267506=_0x25f8ad['charAt'](0x0)[_0xa390('0x18e')]()+_0x25f8ad[_0xa390('0x18d')](0x1);var _0x217443={'type':db[_0xa390('0x87')][_0xa390('0x62')][_0xa390('0x63')],'raw':!![]};return new BPromise(function(_0x2b8c33,_0xa764c0){var _0x1fda54=squel[_0xa390('0x18f')]()[_0xa390('0x190')](_0xa390('0x191')+_0x267506+_0xa390('0x192'),'id')[_0xa390('0x190')]('ui.createdAt')[_0xa390('0x64')](_0xa390('0x193')+_0x25f8ad+_0xa390('0x194'),'ui')[_0xa390('0x3b')](_0xa390('0x195'),_0x40d081['id']);return db[_0xa390('0x61')][_0xa390('0x40')](_0x1fda54[_0xa390('0x182')](),_0x217443)['then'](function(_0x3ac0ab){_0x40d081[_0x267506+_0xa390('0x196')]=_0x3ac0ab;_0x2b8c33(_0x3ac0ab);})['catch'](function(_0x568549){_0xa764c0(_0x568549);});});};
\ No newline at end of file
+var _0x65c9=['then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','undefined','count','set','update','destroy','get','role','admin','Users','user','Agents','Telephones','filter','ignore','map','value','includes','find','UserProfileResource','end','stack','name','send','index','User','fieldName','type','key','password','salt','getOptions','where','query','includeAll','include','attributes','push','findAll','openTabs','true','rows','chat','sms','fax','dataValues','mail','whatsapp','show','model','differenceBy','keys','rawAttributes','filters','intersection','fields','merge','options','all','body','params','describe','addContacts','omit','ids','Setting','securePassword','internal','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)','sequelize','QueryTypes','SELECT','length','isNil','from','voicemail','mailbox','agent','permissions','101','103','110','104','106','107','108','109','100','111','114','115','create','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','checkUserLimits','settingsEnabled','userProfileId','VoiceMail','UserProfileSection','autoAssociation','bulkCreate','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','some','telephone','isEmpty','compact','changePassword','newPassword','Sequelize','ValidationError','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','QueueId','emit','voice','VoiceQueue','interface','each','upsert','remove','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','file','filename','getAvatar','root','existsSync','join','download','server/files/images/','openchannel','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','CmContact','order','sort','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','limit','getQueues','Queue','pick','Unknown\x20role','getVoiceQueuesRt','getGroups','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','format','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','user:forcelogout','headers','connection','remoteAddress','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','PAUSE','LOGININPAUSE','concat','isMiddleware','resolve','logout','pause','QueuePause','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','%s%s','Pause','manual','getTeams','Team','setDataValue','Chat','getMailQueues','Mail','Sms','getWhatsappQueues','getFaxQueues','getOpenchannelQueues','flatten','transaction','getDataValue','Voice','removeTeams','getChatQueues','Whatsapp','Fax','Openchannel','removeAgent','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','spread','user_has_mail_interactions:save','removeMailInteractions','isArray','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$overlap','$contains','$contained','$any','Contact','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','lower','col','toString','asc','desc','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','unknown','unavailable','ringing','voiceStatus','busy','slice','charAt','toUpperCase','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','moment','bluebird','path','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','socket.io-emitter','redis','./user.socket','register','defaults','client','http','request'];(function(_0x2b7c18,_0x1e914c){var _0x3ef88e=function(_0x367f71){while(--_0x367f71){_0x2b7c18['push'](_0x2b7c18['shift']());}};_0x3ef88e(++_0x1e914c);}(_0x65c9,0x182));var _0x965c=function(_0x1df42e,_0x317735){_0x1df42e=_0x1df42e-0x0;var _0x5426b7=_0x65c9[_0x1df42e];return _0x5426b7;};'use strict';var moment=require(_0x965c('0x0'));var BPromise=require(_0x965c('0x1'));var util=require('util');var path=require(_0x965c('0x2'));var fs=require('fs');var _=require(_0x965c('0x3'));var squel=require(_0x965c('0x4'));var jayson=require(_0x965c('0x5'));var Redis=require(_0x965c('0x6'));var authService=require(_0x965c('0x7'));var qs=require(_0x965c('0x8'));var logger=require(_0x965c('0x9'))(_0x965c('0xa'));var utils=require(_0x965c('0xb'));var config=require(_0x965c('0xc'));var licenseUtil=require(_0x965c('0xd'));var db=require('../../mysqldb')['db'];var socket=require(_0x965c('0xe'))(new Redis(config[_0x965c('0xf')]));require(_0x965c('0x10'))[_0x965c('0x11')](socket);config[_0x965c('0xf')]=_[_0x965c('0x12')](config[_0x965c('0xf')],{'host':'localhost','port':0x18eb});var client=jayson[_0x965c('0x13')][_0x965c('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x3cf622,_0x363d74,_0x1dfd94,_0x2cc0ae){return new BPromise(function(_0x12151f,_0x26b2f6){var _0x3b5e1d=_0x2cc0ae||client;return _0x3b5e1d[_0x965c('0x15')](_0x3cf622,_0x1dfd94)[_0x965c('0x16')](function(_0x1d5cb4){logger[_0x965c('0x17')](_0x965c('0x18'),_0x363d74,'request\x20sent');logger[_0x965c('0x19')](_0x965c('0x1a'),_0x363d74,_0x965c('0x1b'),JSON['stringify'](_0x1d5cb4));if(_0x1d5cb4[_0x965c('0x1c')]){if(_0x1d5cb4[_0x965c('0x1c')][_0x965c('0x1d')]===0x1f4){logger['error'](_0x965c('0x18'),_0x363d74,_0x1d5cb4['error']['message']);return _0x26b2f6(_0x1d5cb4['error'][_0x965c('0x1e')]);}logger[_0x965c('0x1c')](_0x965c('0x18'),_0x363d74,_0x1d5cb4[_0x965c('0x1c')]['message']);return _0x12151f(_0x1d5cb4['error']['message']);}else{logger[_0x965c('0x17')](_0x965c('0x18'),_0x363d74,_0x965c('0x1b'));_0x12151f(_0x1d5cb4[_0x965c('0x1f')][_0x965c('0x1e')]);}})[_0x965c('0x20')](function(_0x2e41e5){logger[_0x965c('0x1c')](_0x965c('0x18'),_0x363d74,_0x2e41e5);_0x26b2f6(_0x2e41e5);});});}function respondWithStatusCode(_0x3a9260,_0xa2c510){_0xa2c510=_0xa2c510||0xcc;return function(_0x4be8a8){if(_0x4be8a8){return _0x3a9260[_0x965c('0x21')](_0xa2c510);}return _0x3a9260[_0x965c('0x22')](_0xa2c510)['end']();};}function respondWithResult(_0x490626,_0x364dd3){_0x364dd3=_0x364dd3||0xc8;return function(_0x5e25b2){if(_0x5e25b2){return _0x490626[_0x965c('0x22')](_0x364dd3)[_0x965c('0x23')](_0x5e25b2);}};}function respondWithFilteredResult(_0x3dcfa2,_0x4d41e5){return function(_0x11d518){if(_0x11d518){var _0x7b8907=typeof _0x4d41e5[_0x965c('0x24')]===_0x965c('0x25')&&typeof _0x4d41e5['limit']===_0x965c('0x25');var _0x4db10a=_0x11d518['count'];var _0x4d19f6=_0x7b8907?0x0:_0x4d41e5[_0x965c('0x24')];var _0x327aa6=_0x7b8907?_0x11d518[_0x965c('0x26')]:_0x4d41e5['offset']+_0x4d41e5['limit'];var _0x5574e2;if(_0x327aa6>=_0x4db10a){_0x327aa6=_0x4db10a;_0x5574e2=0xc8;}else{_0x5574e2=0xce;}_0x3dcfa2['status'](_0x5574e2);return _0x3dcfa2[_0x965c('0x27')]('Content-Range',_0x4d19f6+'-'+_0x327aa6+'/'+_0x4db10a)[_0x965c('0x23')](_0x11d518);}return null;};}function saveUpdates(_0xa21a2f){return function(_0x9227f8){if(_0x9227f8){return _0x9227f8[_0x965c('0x28')](_0xa21a2f)[_0x965c('0x16')](function(_0x392a54){return _0x392a54;});}return null;};}function removeEntity(_0x2fd2c7){return function(_0x2231d8){if(_0x2231d8){return _0x2231d8[_0x965c('0x29')]()['then'](function(){var _0x2a1b9d=_0x2231d8[_0x965c('0x2a')]({'plain':!![]});if(_0x2a1b9d[_0x965c('0x2b')]===_0x965c('0x2c'))return;var _0x238b4a=[{'name':_0x965c('0x2d'),'value':_0x965c('0x2e'),'ignore':!![]},{'name':_0x965c('0x2f'),'value':'agent','ignore':![]},{'name':_0x965c('0x30'),'value':'telephone','ignore':![]}];var _0x4e0b3c=_(_0x238b4a)[_0x965c('0x31')](_0x965c('0x32'))[_0x965c('0x33')]('value')[_0x965c('0x34')]();if(_[_0x965c('0x35')](_0x4e0b3c,_0x2a1b9d[_0x965c('0x2b')])){return;}var _0x5cacdd=_[_0x965c('0x36')](_0x238b4a,[_0x965c('0x34'),_0x2a1b9d[_0x965c('0x2b')]])['name'];return db[_0x965c('0x37')][_0x965c('0x29')]({'where':{'type':_0x5cacdd,'resourceId':_0x2a1b9d['id']}})[_0x965c('0x16')](function(){return _0x2231d8;});})[_0x965c('0x16')](function(){_0x2fd2c7[_0x965c('0x22')](0xcc)[_0x965c('0x38')]();});}};}function handleEntityNotFound(_0x5c2928){return function(_0x28a06a){if(!_0x28a06a){_0x5c2928[_0x965c('0x21')](0x194);}return _0x28a06a;};}function handleError(_0xd66556,_0x3f2861){_0x3f2861=_0x3f2861||0x1f4;return function(_0x16c8db){logger[_0x965c('0x1c')](_0x16c8db[_0x965c('0x39')]);if(_0x16c8db[_0x965c('0x3a')]){delete _0x16c8db['name'];}_0xd66556[_0x965c('0x22')](_0x3f2861)[_0x965c('0x3b')](_0x16c8db);};}exports[_0x965c('0x3c')]=function(_0x31b818,_0x4845d0){var _0x207286={},_0x452183={'count':0x0,'rows':[]};var _0x2b12a5=_(db[_0x965c('0x3d')]['rawAttributes'])[_0x965c('0x33')](function(_0x5b6b83){return{'name':_0x5b6b83[_0x965c('0x3e')],'type':_0x5b6b83[_0x965c('0x3f')][_0x965c('0x40')]};})[_0x965c('0x31')](function(_0x15924f){return!_['includes']([_0x965c('0x41'),_0x965c('0x42')],_0x15924f[_0x965c('0x3a')]);})[_0x965c('0x34')]();_0x207286=qs[_0x965c('0x43')](_0x2b12a5,_0x31b818);var _0xe498d2={'where':_0x207286[_0x965c('0x44')]};return db[_0x965c('0x3d')]['count'](_0xe498d2)[_0x965c('0x16')](function(_0x34fb66){_0x452183[_0x965c('0x26')]=_0x34fb66;if(_0x31b818[_0x965c('0x45')][_0x965c('0x46')]){_0x207286[_0x965c('0x47')]=[{'all':!![]}];}if(!_[_0x965c('0x35')](_0x207286[_0x965c('0x48')],'id')){_0x207286[_0x965c('0x48')][_0x965c('0x49')]('id');}return db['User'][_0x965c('0x4a')](_0x207286);})['then'](function(_0x2090e4){_0x452183['rows']=_0x2090e4;if(_0x31b818[_0x965c('0x45')][_0x965c('0x4b')]===_0x965c('0x4c')){var _0x48d94=[];for(var _0x19af9d=0x0;_0x19af9d<_0x452183[_0x965c('0x4d')]['length'];_0x19af9d++){_0x48d94['push'](get_open_tabs(_0x965c('0x4e'),_0x452183[_0x965c('0x4d')][_0x19af9d]['dataValues']));_0x48d94[_0x965c('0x49')](get_open_tabs(_0x965c('0x4f'),_0x452183[_0x965c('0x4d')][_0x19af9d]['dataValues']));_0x48d94[_0x965c('0x49')](get_open_tabs(_0x965c('0x50'),_0x452183[_0x965c('0x4d')][_0x19af9d][_0x965c('0x51')]));_0x48d94[_0x965c('0x49')](get_open_tabs(_0x965c('0x52'),_0x452183[_0x965c('0x4d')][_0x19af9d][_0x965c('0x51')]));_0x48d94['push'](get_open_tabs('openchannel',_0x452183['rows'][_0x19af9d][_0x965c('0x51')]));_0x48d94[_0x965c('0x49')](get_open_tabs(_0x965c('0x53'),_0x452183['rows'][_0x19af9d]['dataValues']));}return BPromise['all'](_0x48d94)['then'](function(_0x32a80e){return _0x452183;});}else{return _0x452183;}})['then'](respondWithFilteredResult(_0x4845d0,_0x207286))[_0x965c('0x20')](handleError(_0x4845d0,null));};exports[_0x965c('0x54')]=function(_0x133a86,_0x21ce0d){var _0x1560a9={'raw':![],'where':{'id':_0x133a86['params']['id']}},_0xa345d2={};_0xa345d2[_0x965c('0x55')]=_[_0x965c('0x56')](_[_0x965c('0x57')](db['User'][_0x965c('0x58')]),[_0x965c('0x41'),_0x965c('0x42')]);_0xa345d2['query']=_['keys'](_0x133a86[_0x965c('0x45')]);_0xa345d2[_0x965c('0x59')]=_[_0x965c('0x5a')](_0xa345d2[_0x965c('0x55')],_0xa345d2[_0x965c('0x45')]);_0x1560a9[_0x965c('0x48')]=_[_0x965c('0x5a')](_0xa345d2[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x133a86[_0x965c('0x45')][_0x965c('0x5b')]));_0x1560a9[_0x965c('0x48')]=_0x1560a9[_0x965c('0x48')]['length']?_0x1560a9[_0x965c('0x48')]:_0xa345d2[_0x965c('0x55')];if(_0x133a86[_0x965c('0x45')][_0x965c('0x46')]){_0x1560a9[_0x965c('0x47')]=[{'all':!![]}];}_0x1560a9=_[_0x965c('0x5c')]({},_0x1560a9,_0x133a86[_0x965c('0x5d')]);if(!_[_0x965c('0x35')](_0x1560a9[_0x965c('0x48')],'id')){_0x1560a9['attributes'][_0x965c('0x49')]('id');}return db[_0x965c('0x3d')]['find'](_0x1560a9)['then'](handleEntityNotFound(_0x21ce0d,null))[_0x965c('0x16')](function(_0x21e399){var _0x54fca4=[];values=_0x21e399;if(_0x133a86['query'][_0x965c('0x4b')]===_0x965c('0x4c')){_0x54fca4[_0x965c('0x49')](get_open_tabs(_0x965c('0x4e'),_0x21e399[_0x965c('0x51')]));_0x54fca4[_0x965c('0x49')](get_open_tabs(_0x965c('0x4f'),_0x21e399[_0x965c('0x51')]));_0x54fca4[_0x965c('0x49')](get_open_tabs('openchannel',_0x21e399[_0x965c('0x51')]));_0x54fca4[_0x965c('0x49')](get_open_tabs(_0x965c('0x53'),_0x21e399['dataValues']));_0x54fca4[_0x965c('0x49')](get_open_tabs(_0x965c('0x50'),_0x21e399[_0x965c('0x51')]));_0x54fca4[_0x965c('0x49')](get_open_tabs('mail',_0x21e399[_0x965c('0x51')]));return BPromise[_0x965c('0x5e')](_0x54fca4);}else{return values;}})['then'](function(_0x90c3aa){return values;})['then'](respondWithResult(_0x21ce0d,null))[_0x965c('0x20')](handleError(_0x21ce0d,null));};exports[_0x965c('0x28')]=function(_0x5e6a5d,_0x2334f4){if(_0x5e6a5d[_0x965c('0x5f')]['id']){delete _0x5e6a5d[_0x965c('0x5f')]['id'];}delete _0x5e6a5d[_0x965c('0x5f')]['role'];return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x5e6a5d[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0x2334f4,null))['then'](saveUpdates(_0x5e6a5d[_0x965c('0x5f')],null))[_0x965c('0x16')](respondWithResult(_0x2334f4,null))[_0x965c('0x20')](handleError(_0x2334f4,null));};exports[_0x965c('0x61')]=function(_0x419816,_0x1bb5be){return db[_0x965c('0x3d')][_0x965c('0x61')]()[_0x965c('0x16')](respondWithResult(_0x1bb5be,null))[_0x965c('0x20')](handleError(_0x1bb5be,null));};exports[_0x965c('0x62')]=function(_0x1106a9,_0x512eae){return db[_0x965c('0x3d')]['find']({'where':{'id':_0x1106a9[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x512eae,null))['then'](function(_0x6611b9){if(_0x6611b9){return _0x6611b9[_0x965c('0x62')](_0x1106a9[_0x965c('0x5f')]['ids'],_[_0x965c('0x63')](_0x1106a9['body'],[_0x965c('0x64'),'id'])||{});}})[_0x965c('0x16')](respondWithResult(_0x512eae,null))[_0x965c('0x20')](handleError(_0x512eae,null));};function validateUser(_0x116999){return new BPromise(function(_0x2ad76c,_0x181bce){if(_0x116999['internal'])return _0x2ad76c(_0x116999);return db[_0x965c('0x65')]['findById'](0x1)[_0x965c('0x16')](function(_0x1493b0){if(_0x1493b0[_0x965c('0x66')])authService['validatePasswordPattern'](_0x116999['password']);db[_0x965c('0x3d')]['max']('internal')['then'](function(_0x1fdc19){if(_['isNil'](_0x1fdc19)){_0x116999[_0x965c('0x67')]=_0x1493b0['min_internal']||0x1;return;}if(_['isNil'](_0x1493b0[_0x965c('0x68')])||_0x1493b0[_0x965c('0x68')]===_0x1fdc19){_0x116999[_0x965c('0x67')]=_0x1fdc19+0x1;return;}if(_0x1493b0['min_internal']>_0x1fdc19){_0x116999[_0x965c('0x67')]=_0x1493b0[_0x965c('0x68')];return;}return db['sequelize'][_0x965c('0x45')](_0x965c('0x69'),{'type':db[_0x965c('0x6a')][_0x965c('0x6b')][_0x965c('0x6c')]})[_0x965c('0x16')](function(_0x54da27){if(_0x54da27&&_0x54da27[_0x965c('0x6d')]){for(var _0x46b83c=0x0,_0x457bf2=_0x54da27['length'];_0x46b83c<_0x457bf2&&_[_0x965c('0x6e')](_0x116999[_0x965c('0x67')]);_0x46b83c++){if(_0x1493b0['min_internal']<=_0x54da27[_0x46b83c][_0x965c('0x6f')]){_0x116999[_0x965c('0x67')]=_0x54da27[_0x46b83c][_0x965c('0x6f')];}else if(_0x1493b0[_0x965c('0x68')]>_0x54da27[_0x46b83c]['from']&&_0x1493b0[_0x965c('0x68')]<=_0x54da27[_0x46b83c]['to']){_0x116999[_0x965c('0x67')]=_0x1493b0[_0x965c('0x68')];}}}if(_[_0x965c('0x6e')](_0x116999[_0x965c('0x67')])){_0x116999[_0x965c('0x67')]=_0x1fdc19+0x1;}return _0x2ad76c(_0x116999);});});})['catch'](function(_0x3c5a4c){_0x181bce(_0x3c5a4c);});});}function updateUser(_0x36409e){return new BPromise(function(_0x16f23c,_0x347fc6){try{if(_0x36409e[_0x965c('0x70')]){_0x36409e[_0x965c('0x71')]=_0x36409e[_0x965c('0x67')];_0x36409e['VoiceMail']={'mailbox':_0x36409e[_0x965c('0x67')],'password':_0x36409e[_0x965c('0x41')],'fullname':_0x36409e['fullname'],'email':_0x36409e['email']};}if(_0x36409e[_0x965c('0x2b')]===_0x965c('0x72')){if(!_0x36409e[_0x965c('0x73')])_0x36409e[_0x965c('0x73')]=[_0x965c('0x74'),'102',_0x965c('0x75'),'113',_0x965c('0x76'),_0x965c('0x77'),'105',_0x965c('0x78'),_0x965c('0x79'),_0x965c('0x7a'),_0x965c('0x7b'),_0x965c('0x7c'),_0x965c('0x7d'),_0x965c('0x7e'),_0x965c('0x7f')];}_0x16f23c(_0x36409e);}catch(_0x26a937){_0x347fc6(_0x26a937);}});}exports[_0x965c('0x80')]=function(_0x5395cd,_0x3020dc){if(_0x5395cd[_0x965c('0x2e')][_0x965c('0x2b')]==='agent')throw new Error('Unauthorized');if(_0x5395cd[_0x965c('0x5f')][_0x965c('0x2b')]===_0x965c('0x2e')&&_0x5395cd[_0x965c('0x2e')]['role']!=='admin'){throw new Error(_0x965c('0x81'));}if(_0x5395cd[_0x965c('0x5f')][_0x965c('0x2b')]===_0x965c('0x2c')&&_0x5395cd['user'][_0x965c('0x2b')]!==_0x965c('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0x965c('0x82')]([_0x5395cd[_0x965c('0x5f')]])[_0x965c('0x16')](function(){return validateUser(_0x5395cd['body']);})[_0x965c('0x16')](function(_0x2b0f14){return updateUser(_0x2b0f14)[_0x965c('0x16')](function(_0x5e3697){if(_0x5e3697[_0x965c('0x2b')]===_0x965c('0x2c')){_0x5e3697['settingsEnabled']=_0x5395cd[_0x965c('0x2e')][_0x965c('0x83')];delete _0x5e3697[_0x965c('0x84')];}return _0x5e3697;});})['then'](function(_0x156d79){return db['User'][_0x965c('0x80')](_0x156d79,{'include':[{'model':db[_0x965c('0x85')],'as':_0x965c('0x85')}]});})[_0x965c('0x16')](function(_0x578717){if(_0x5395cd[_0x965c('0x5f')][_0x965c('0x2b')]===_0x965c('0x2e'))return _0x578717;if(_0x5395cd[_0x965c('0x2e')]['role']!==_0x965c('0x2e'))return _0x578717;return db[_0x965c('0x86')]['find']({'where':{'name':_0x578717['role']===_0x965c('0x72')?_0x965c('0x2f'):_0x965c('0x30'),'userProfileId':_0x5395cd[_0x965c('0x2e')][_0x965c('0x84')]},'raw':!![]})[_0x965c('0x16')](function(_0x287c0f){if(!_0x287c0f||_0x287c0f[_0x965c('0x87')]!=0x0)return _0x578717;return db['UserProfileResource'][_0x965c('0x80')]({'name':_0x578717[_0x965c('0x3a')],'resourceId':_0x578717['id'],'type':_0x287c0f[_0x965c('0x3a')],'sectionId':_0x287c0f['id']},{})[_0x965c('0x16')](function(){return _0x578717;});})[_0x965c('0x20')](function(_0x3bd8d4){logger[_0x965c('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3bd8d4);throw _0x3bd8d4;});})[_0x965c('0x16')](respondWithResult(_0x3020dc,0xc9))[_0x965c('0x20')](handleError(_0x3020dc,null));};exports[_0x965c('0x88')]=function(_0x56acde,_0x3c5b4a){var _0x99d277=_0x56acde['body'];var _0x318ca8=[];if(_0x56acde[_0x965c('0x2e')][_0x965c('0x2b')]===_0x965c('0x72'))throw new Error(_0x965c('0x89'));if(_['some'](_0x99d277,['role',_0x965c('0x2e')])&&_0x56acde['user']['role']!==_0x965c('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x99d277,['role',_0x965c('0x2c')])&&_0x56acde[_0x965c('0x2e')][_0x965c('0x2b')]!==_0x965c('0x2c')){throw new Error(_0x965c('0x8a'));}return licenseUtil[_0x965c('0x82')](_0x99d277)['then'](function(){return validateUser(_0x99d277[0x0]);})['then'](function(){for(var _0x4eeccc=0x1;_0x4eeccc<_0x99d277['length'];_0x4eeccc++){var _0x17bae1=_0x99d277[_0x4eeccc-0x1][_0x965c('0x67')];if(!_0x99d277[_0x4eeccc][_0x965c('0x67')])_0x99d277[_0x4eeccc][_0x965c('0x67')]=_0x17bae1+0x1;_0x318ca8[_0x965c('0x49')](validateUser(_0x99d277[_0x4eeccc]));}return BPromise[_0x965c('0x5e')](_0x318ca8);})[_0x965c('0x16')](function(){_0x318ca8=[];for(var _0xbba18b=0x0;_0xbba18b<_0x99d277[_0x965c('0x6d')];_0xbba18b++){_0x318ca8['push'](updateUser(_0x99d277[_0xbba18b]));}return BPromise['all'](_0x318ca8);})[_0x965c('0x16')](function(){return BPromise['each'](_0x99d277,function(_0x5a2c62){return db[_0x965c('0x3d')][_0x965c('0x80')](_0x5a2c62,{'include':[{'model':db['VoiceMail'],'as':_0x965c('0x85')}]})[_0x965c('0x16')](function(_0xf81bc9){_0x5a2c62['id']=_0xf81bc9['id'];return _0x5a2c62;});});})[_0x965c('0x16')](function(_0x225174){if(_0x56acde['body'][_0x965c('0x2b')]===_0x965c('0x2e'))return _0x225174;if(_0x56acde['user']['role']!==_0x965c('0x2e'))return _0x225174;var _0x26500a=_[_0x965c('0x8b')](_0x225174,function(_0x284666){return _0x284666[_0x965c('0x2b')]===_0x965c('0x72')||_0x284666['role']===_0x965c('0x8c');});if(!_0x26500a)return _0x225174;return db[_0x965c('0x86')][_0x965c('0x4a')]({'where':{'name':{'$or':[_0x965c('0x2f'),'Telephones']},'userProfileId':_0x56acde['user'][_0x965c('0x84')]},'raw':!![]})[_0x965c('0x16')](function(_0x59dc4c){if(_[_0x965c('0x8d')](_0x59dc4c)||!_[_0x965c('0x8b')](_0x59dc4c,['autoAssociation',0x0]))return _0x225174;_0x318ca8=[];var _0xc749d1=_(_0x59dc4c)[_0x965c('0x33')](function(_0x3327f6){if(_0x3327f6[_0x965c('0x87')]===0x1)return;return _0x3327f6['name']===_0x965c('0x2f')?'agent':'telephone';})[_0x965c('0x8e')]()[_0x965c('0x34')]();for(var _0x3bd3ac=0x0;_0x3bd3ac<_0x225174[_0x965c('0x6d')];_0x3bd3ac++){if(!_[_0x965c('0x35')](_0xc749d1,_0x225174[_0x3bd3ac][_0x965c('0x2b')]))return;var _0x12209f=_0x225174[_0x3bd3ac][_0x965c('0x2b')]==='agent'?_0x965c('0x2f'):_0x965c('0x30');_0x318ca8[_0x965c('0x49')](db[_0x965c('0x37')]['create']({'name':_0x225174[_0x3bd3ac]['name'],'resourceId':_0x225174[_0x3bd3ac]['id'],'type':_0x12209f,'sectionId':_['find'](_0x59dc4c,[_0x965c('0x3a'),_0x12209f])['id']},{}));}return BPromise[_0x965c('0x5e')](_0x318ca8);});})[_0x965c('0x16')](respondWithResult(_0x3c5b4a,0xc9))[_0x965c('0x20')](handleError(_0x3c5b4a,null));};exports[_0x965c('0x8f')]=function(_0x168532,_0x1484c1){if(_0x168532[_0x965c('0x5f')]['id']){delete _0x168532['body']['id'];}return db[_0x965c('0x3d')]['find']({'where':{'id':_0x168532['params']['id']}})['then'](function(_0x25f812){if(!_0x25f812)return null;if(_0x25f812['id']===_0x168532[_0x965c('0x2e')]['id']){if(!_0x168532[_0x965c('0x5f')]['oldPassword']||!_0x168532[_0x965c('0x5f')][_0x965c('0x90')]){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x25f812['authenticate'](_0x168532[_0x965c('0x5f')][_0x965c('0x93')])){throw new db['Sequelize'][(_0x965c('0x92'))](_0x965c('0x94'));}if(_0x168532[_0x965c('0x5f')][_0x965c('0x93')]===_0x168532[_0x965c('0x5f')][_0x965c('0x90')]){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0x95'));}}else if(_0x168532[_0x965c('0x2e')][_0x965c('0x2b')]===_0x965c('0x2c')){if(!_0x168532['body'][_0x965c('0x90')]){throw new db['Sequelize'][(_0x965c('0x92'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x168532['user'][_0x965c('0x2b')]===_0x965c('0x2e')){if(!_0x168532[_0x965c('0x5f')][_0x965c('0x90')]){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x25f812[_0x965c('0x2b')]!==_0x965c('0x72')){throw new db['Sequelize']['ValidationError']('Unauthorized');}}else{throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0x89'));}return _0x25f812;})['then'](handleEntityNotFound(_0x1484c1,null))[_0x965c('0x16')](function(_0x4e7dc1){return db['Setting']['findOne']({'attributes':['id','securePassword',_0x965c('0x96'),_0x965c('0x97')]})[_0x965c('0x16')](function(_0x3cbef8){if(_0x3cbef8[_0x965c('0x66')])authService['validatePasswordPattern'](_0x168532['body']['newPassword']);if(!_0x3cbef8[_0x965c('0x96')]||!_0x4e7dc1[_0x965c('0x98')])return _0x4e7dc1;authService['validatePasswordHistory'](_0x168532[_0x965c('0x5f')][_0x965c('0x90')],_0x4e7dc1[_0x965c('0x98')],_0x3cbef8['passwordHistoryLimit']);return _0x4e7dc1;})[_0x965c('0x16')](saveUpdates({'password':_0x168532[_0x965c('0x5f')][_0x965c('0x90')],'passwordResetAt':_0x168532['user']['id']==_0x168532[_0x965c('0x60')]['id']?moment():null,'previousPasswords':authService[_0x965c('0x99')](_0x168532['body']['newPassword'],_0x4e7dc1[_0x965c('0x98')])},null));})[_0x965c('0x16')](respondWithResult(_0x1484c1,null))[_0x965c('0x20')](handleError(_0x1484c1,null));};exports[_0x965c('0x9a')]=function(_0x4e4b4d,_0x181d7b){var _0x4a7fce=_0x4e4b4d['body'][_0x965c('0x9b')];return db['User'][_0x965c('0x36')]({'where':{'id':_0x4e4b4d['params']['id']},'attributes':['id',_0x965c('0x3a'),_0x965c('0x2b'),_0x965c('0x9c'),_0x965c('0x9d'),_0x965c('0x9e'),'interface']})[_0x965c('0x16')](handleEntityNotFound(_0x181d7b,null))[_0x965c('0x16')](function(_0x331788){if(_0x331788){if(!utils[_0x965c('0x9f')](_0x4a7fce)){throw new db[(_0x965c('0x91'))]['ValidationError'](_0x965c('0xa0'));}return _0x331788[_0x965c('0xa1')+_[_0x965c('0xa2')](_0x4a7fce[_0x965c('0xa3')]())+_0x965c('0xa4')](_0x4e4b4d[_0x965c('0x5f')][_0x965c('0x64')],{'penalty':_0x4e4b4d[_0x965c('0x5f')][_0x965c('0xa5')]||0x0})['spread'](function(_0x156ddc){for(var _0x5d5728=0x0;_0x5d5728<_0x4e4b4d[_0x965c('0x5f')][_0x965c('0x64')][_0x965c('0x6d')];_0x5d5728+=0x1){var _0x285d46={'UserId':Number(_0x4e4b4d[_0x965c('0x60')]['id'])};_0x285d46[_['capitalize'](_0x4a7fce[_0x965c('0xa3')]())+_0x965c('0xa6')]=Number(_0x4e4b4d[_0x965c('0x5f')]['ids'][_0x5d5728]);socket[_0x965c('0xa7')](_0x965c('0x2e')+_[_0x965c('0xa2')](_0x4a7fce['toLowerCase']())+'Queue:save',_0x285d46);}return _0x156ddc;})[_0x965c('0x16')](function(){if(_0x4a7fce===_0x965c('0xa8')){return db[_0x965c('0xa9')][_0x965c('0x4a')]({'where':{'id':_0x4e4b4d['body'][_0x965c('0x64')]||[]},'raw':!![],'attributes':['id',_0x965c('0x3a')]});}})['then'](function(_0xc43ffc){var _0x5c0830=_0x331788[_0x965c('0x2a')]({'plain':!![]});var _0x762a94=[];if(_0x4a7fce===_0x965c('0xa8')&&_0x5c0830[_0x965c('0x2b')]===_0x965c('0x72')&&_0x5c0830[_0x965c('0x9c')]){for(var _0x33d486=0x0;_0x33d486<_0xc43ffc['length'];_0x33d486+=0x1){_0x762a94['push']({'membername':_0x5c0830[_0x965c('0x3a')],'UserId':_0x5c0830['id'],'queue_name':_0xc43ffc[_0x33d486][_0x965c('0x3a')],'VoiceQueueId':_0xc43ffc[_0x33d486]['id'],'interface':_[_0x965c('0x6e')](_0x5c0830[_0x965c('0xaa')])?util['format']('SIP/%s',_0x5c0830[_0x965c('0x3a')]):_0x5c0830[_0x965c('0xaa')],'paused':_0x5c0830['voicePause']||![],'penalty':_0x4e4b4d[_0x965c('0x5f')][_0x965c('0xa5')]||0x0});}return BPromise[_0x965c('0xab')](_0x762a94,function(_0x1bbca8){return db['UserVoiceQueueRt'][_0x965c('0xac')](_0x1bbca8);});}return _0x331788;});}})[_0x965c('0x16')](respondWithStatusCode(_0x181d7b,null))[_0x965c('0x20')](handleError(_0x181d7b,null));};exports['removeQueues']=function(_0x3dc1f9,_0x53de58){var _0x4ee155;return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x3dc1f9[_0x965c('0x60')]['id']},'attributes':['id',_0x965c('0x3a'),_0x965c('0x2b')]})[_0x965c('0x16')](handleEntityNotFound(_0x53de58,null))[_0x965c('0x16')](function(_0x445b08){if(_0x445b08){_0x4ee155=_0x445b08;if(!_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')]||!utils['isValidChannel'](_0x3dc1f9[_0x965c('0x45')]['channel'])){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))]('Unknown\x20channel');}return _0x445b08[_0x965c('0xad')+_[_0x965c('0xa2')](_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')][_0x965c('0xa3')]())+_0x965c('0xa4')](_0x3dc1f9[_0x965c('0x45')]['ids']);}})[_0x965c('0x16')](function(_0xb97532){if(_['isArray'](_0x3dc1f9['query'][_0x965c('0x64')])){for(var _0x125bd6=0x0;_0x125bd6<_0x3dc1f9[_0x965c('0x45')][_0x965c('0x64')][_0x965c('0x6d')];_0x125bd6+=0x1){var _0x6ed5ec={'UserId':Number(_0x3dc1f9[_0x965c('0x60')]['id'])};_0x6ed5ec[_['capitalize'](_0x3dc1f9['query'][_0x965c('0x9b')][_0x965c('0xa3')]())+_0x965c('0xa6')]=Number(_0x3dc1f9[_0x965c('0x45')][_0x965c('0x64')][_0x125bd6]);socket[_0x965c('0xa7')](_0x965c('0x2e')+_['capitalize'](_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')]['toLowerCase']())+'Queue:remove',_0x6ed5ec);}}else{var _0x6ed5ec={'UserId':Number(_0x3dc1f9['params']['id'])};_0x6ed5ec[_[_0x965c('0xa2')](_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')]['toLowerCase']())+'QueueId']=Number(_0x3dc1f9[_0x965c('0x45')]['ids']);socket[_0x965c('0xa7')](_0x965c('0x2e')+_[_0x965c('0xa2')](_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')]['toLowerCase']())+_0x965c('0xae'),_0x6ed5ec);}return _0xb97532;})['then'](function(){if(_0x3dc1f9[_0x965c('0x45')][_0x965c('0x9b')]==='voice'){return db[_0x965c('0xaf')][_0x965c('0x29')]({'where':{'UserId':_0x3dc1f9[_0x965c('0x60')]['id'],'VoiceQueueId':_0x3dc1f9[_0x965c('0x45')]['ids']},'individualHooks':!![]})[_0x965c('0x16')](function(){return _0x4ee155;});}return _0x4ee155;})[_0x965c('0x16')](respondWithStatusCode(_0x53de58,null))[_0x965c('0x20')](handleError(_0x53de58,null));};exports[_0x965c('0xb0')]=function(_0x32a2f4,_0x1247a1){_0x32a2f4[_0x965c('0x5f')][_0x965c('0xb1')]=_0x32a2f4[_0x965c('0xb2')][_0x965c('0xb3')];return db['User'][_0x965c('0x36')]({'where':{'id':_0x32a2f4[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x1247a1,null))['then'](saveUpdates(_0x32a2f4[_0x965c('0x5f')],null))['then'](respondWithResult(_0x1247a1,null))[_0x965c('0x20')](handleError(_0x1247a1,null));};exports[_0x965c('0xb4')]=function(_0x215827,_0x36e01f){var _0x353bfd=path['join'](config[_0x965c('0xb5')],'server/files/images/logos/default_profile.png');return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x215827[_0x965c('0x60')]['id']},'attributes':['id',_0x965c('0xb1')],'raw':!![]})[_0x965c('0x16')](handleEntityNotFound(_0x36e01f,null))[_0x965c('0x16')](function(_0x2084c7){if(_0x2084c7){if(_[_0x965c('0x6e')](_0x2084c7['userpic'])){return _0x36e01f['download'](_0x353bfd);}else{if(!fs[_0x965c('0xb6')](path[_0x965c('0xb7')](config['root'],'server/files/images/',_0x2084c7[_0x965c('0xb1')]))){return _0x36e01f[_0x965c('0xb8')](_0x353bfd);}return _0x36e01f[_0x965c('0xb8')](path[_0x965c('0xb7')](config[_0x965c('0xb5')],_0x965c('0xb9'),_0x2084c7[_0x965c('0xb1')]));}}})[_0x965c('0x20')](handleError(_0x36e01f,null));};exports['getOpenTabs']=function(_0x545443,_0x4834d1){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x545443[_0x965c('0x60')]['id']},'attributes':['id']})['then'](handleEntityNotFound(_0x4834d1,null))['then'](function(_0x37e505){var _0x4b96c7=[];values=_0x37e505[_0x965c('0x51')];_0x4b96c7[_0x965c('0x49')](get_open_tabs(_0x965c('0x4e'),_0x37e505[_0x965c('0x51')]));_0x4b96c7['push'](get_open_tabs(_0x965c('0x4f'),_0x37e505[_0x965c('0x51')]));_0x4b96c7['push'](get_open_tabs(_0x965c('0xba'),_0x37e505['dataValues']));_0x4b96c7[_0x965c('0x49')](get_open_tabs('whatsapp',_0x37e505[_0x965c('0x51')]));_0x4b96c7[_0x965c('0x49')](get_open_tabs('fax',_0x37e505[_0x965c('0x51')]));_0x4b96c7['push'](get_open_tabs('mail',_0x37e505['dataValues']));return BPromise[_0x965c('0x5e')](_0x4b96c7);})[_0x965c('0x16')](function(_0x5b157d){var _0xae5b53=[];if(_0x5b157d){for(var _0x25bbe3=0x0;_0x25bbe3<values['ChatOpenTabs'][_0x965c('0x6d')];_0x25bbe3++){var _0x471d43=values[_0x965c('0xbb')][_0x25bbe3];_0xae5b53[_0x965c('0x49')]({'channel':_0x965c('0xbc'),'id':_0x471d43['id'],'createdAt':_0x471d43[_0x965c('0xbd')]});}for(var _0x25bbe3=0x0;_0x25bbe3<values[_0x965c('0xbe')][_0x965c('0x6d')];_0x25bbe3++){var _0x471d43=values[_0x965c('0xbe')][_0x25bbe3];_0xae5b53['push']({'channel':_0x965c('0xbf'),'id':_0x471d43['id'],'createdAt':_0x471d43[_0x965c('0xbd')]});}for(var _0x25bbe3=0x0;_0x25bbe3<values['OpenchannelOpenTabs'][_0x965c('0x6d')];_0x25bbe3++){var _0x471d43=values[_0x965c('0xc0')][_0x25bbe3];_0xae5b53[_0x965c('0x49')]({'channel':'OPENCHANNEL','id':_0x471d43['id'],'createdAt':_0x471d43[_0x965c('0xbd')]});}for(var _0x25bbe3=0x0;_0x25bbe3<values[_0x965c('0xc1')][_0x965c('0x6d')];_0x25bbe3++){var _0x471d43=values[_0x965c('0xc1')][_0x25bbe3];_0xae5b53[_0x965c('0x49')]({'channel':_0x965c('0xc2'),'id':_0x471d43['id'],'createdAt':_0x471d43[_0x965c('0xbd')]});}for(var _0x25bbe3=0x0;_0x25bbe3<values[_0x965c('0xc3')][_0x965c('0x6d')];_0x25bbe3++){var _0x471d43=values['SmsOpenTabs'][_0x25bbe3];_0xae5b53[_0x965c('0x49')]({'channel':_0x965c('0xc4'),'id':_0x471d43['id'],'createdAt':_0x471d43[_0x965c('0xbd')]});}for(var _0x25bbe3=0x0;_0x25bbe3<values[_0x965c('0xc5')][_0x965c('0x6d')];_0x25bbe3++){var _0x471d43=values['WhatsappOpenTabs'][_0x25bbe3];_0xae5b53['push']({'channel':_0x965c('0xc6'),'id':_0x471d43['id'],'createdAt':_0x471d43[_0x965c('0xbd')]});}var _0x173183={'count':_0xae5b53[_0x965c('0x6d')],'rows':_0xae5b53};return _0x173183;}else return null;})['then'](respondWithResult(_0x4834d1,null))[_0x965c('0x20')](handleError(_0x4834d1,null));};exports[_0x965c('0xc7')]=function(_0x17ea9e,_0x341975){var _0x4633a8={};var _0x476259={};var _0x21e402;var _0x185c59;return db[_0x965c('0x3d')][_0x965c('0xc8')]({'where':{'id':_0x17ea9e[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0x341975,null))[_0x965c('0x16')](function(_0xf8d238){if(_0xf8d238){_0x21e402=_0xf8d238;_0x476259[_0x965c('0x55')]=_[_0x965c('0x57')](db[_0x965c('0xc9')][_0x965c('0x58')]);_0x476259[_0x965c('0x45')]=_[_0x965c('0x57')](_0x17ea9e[_0x965c('0x45')]);_0x476259[_0x965c('0x59')]=_['intersection'](_0x476259[_0x965c('0x55')],_0x476259[_0x965c('0x45')]);_0x4633a8['attributes']=_[_0x965c('0x5a')](_0x476259[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x17ea9e[_0x965c('0x45')][_0x965c('0x5b')]));_0x4633a8['attributes']=_0x4633a8[_0x965c('0x48')][_0x965c('0x6d')]?_0x4633a8[_0x965c('0x48')]:_0x476259[_0x965c('0x55')];_0x4633a8[_0x965c('0xca')]=qs[_0x965c('0xcb')](_0x17ea9e[_0x965c('0x45')][_0x965c('0xcb')]);_0x4633a8[_0x965c('0x44')]=qs[_0x965c('0x59')](_['pick'](_0x17ea9e['query'],_0x476259[_0x965c('0x59')]));if(_0x17ea9e[_0x965c('0x45')][_0x965c('0x31')]){_0x4633a8[_0x965c('0x44')]=_['merge'](_0x4633a8[_0x965c('0x44')],{'$or':_['map'](_0x4633a8[_0x965c('0x48')],function(_0x40c310){var _0x502cdf={};_0x502cdf[_0x40c310]={'$like':'%'+_0x17ea9e[_0x965c('0x45')]['filter']+'%'};return _0x502cdf;})});}_0x4633a8=_[_0x965c('0x5c')]({},_0x4633a8,_0x17ea9e[_0x965c('0x5d')]);return _0x21e402['getContacts'](_0x4633a8);}})['then'](function(_0x441e69){if(_0x441e69){_0x185c59=_0x441e69[_0x965c('0x6d')];if(_0x17ea9e[_0x965c('0x45')][_0x965c('0xcc')]('includeAll')){_0x4633a8[_0x965c('0x47')]=[{'model':db[_0x965c('0xcd')],'as':_0x965c('0xce'),'required':![]},{'model':db[_0x965c('0xcf')],'as':_0x965c('0xd0'),'attributes':['id',_0x965c('0x3a'),_0x965c('0xd1')],'where':_0x17ea9e[_0x965c('0x45')][_0x965c('0xd2')]?{'id':_0x17ea9e[_0x965c('0x45')]['tag']}:undefined,'required':_0x17ea9e[_0x965c('0x45')][_0x965c('0xd2')]?!![]:![]}];}if(!_0x17ea9e[_0x965c('0x45')][_0x965c('0xcc')](_0x965c('0xd3'))){_0x4633a8[_0x965c('0xd4')]=qs['limit'](_0x17ea9e[_0x965c('0x45')]['limit']);_0x4633a8['offset']=qs[_0x965c('0x24')](_0x17ea9e[_0x965c('0x45')][_0x965c('0x24')]);}return _0x21e402[_0x965c('0xc7')](_0x4633a8);}})[_0x965c('0x16')](function(_0x49650b){if(_0x49650b){return _0x49650b?{'count':_0x185c59,'rows':_0x49650b}:null;}})['then'](respondWithResult(_0x341975,null))[_0x965c('0x20')](handleError(_0x341975,null));};exports[_0x965c('0xd5')]=function(_0x337452,_0x29c061){var _0x5e5041;var _0x4daa44;var _0x4385dc={};var _0x37837a;return db[_0x965c('0x3d')]['findOne']({'where':{'id':_0x337452[_0x965c('0x60')]['id']},'attributes':['id',_0x965c('0x3a'),_0x965c('0x2b')]})[_0x965c('0x16')](handleEntityNotFound(_0x29c061,null))[_0x965c('0x16')](function(_0x41ddda){if(!utils[_0x965c('0x9f')](_0x337452['query'][_0x965c('0x9b')])){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0xa0'));}_0x5e5041=_0x41ddda;var _0x4e36b6={};_0x4e36b6[_0x965c('0x55')]=_[_0x965c('0x57')](db[_[_0x965c('0xa2')](_0x337452[_0x965c('0x45')][_0x965c('0x9b')])+_0x965c('0xd6')]['rawAttributes']);_0x4e36b6['query']=_[_0x965c('0x57')](_0x337452['query']);_0x4e36b6['filters']=_[_0x965c('0x5a')](_0x4e36b6['model'],_0x4e36b6[_0x965c('0x45')]);_0x4385dc[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x4e36b6[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x337452[_0x965c('0x45')][_0x965c('0x5b')]));_0x4385dc['attributes']=_0x4385dc[_0x965c('0x48')][_0x965c('0x6d')]?_0x4385dc[_0x965c('0x48')]:_0x4e36b6['model'];_0x4385dc['order']=qs['sort'](_0x337452[_0x965c('0x45')]['sort']);_0x4385dc[_0x965c('0x44')]=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0x337452['query'],_0x4e36b6[_0x965c('0x59')]));if(_0x337452[_0x965c('0x45')][_0x965c('0x31')]){_0x4385dc[_0x965c('0x44')]=_['merge'](_0x4385dc[_0x965c('0x44')],{'$or':_[_0x965c('0x33')](_0x4385dc[_0x965c('0x48')],function(_0x539087){var _0x516edf={};_0x516edf[_0x539087]={'$like':'%'+_0x337452[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x516edf;})});}_0x4385dc=_[_0x965c('0x5c')]({},_0x4385dc,_0x337452[_0x965c('0x5d')]);switch(_0x5e5041['role']){case'admin':return db[_[_0x965c('0xa2')](_0x337452['query'][_0x965c('0x9b')])+_0x965c('0xd6')][_0x965c('0x4a')](_0x4385dc);case _0x965c('0x2e'):case _0x965c('0x72'):return _0x5e5041[_0x965c('0x2a')+_['capitalize'](_0x337452[_0x965c('0x45')][_0x965c('0x9b')])+_0x965c('0xa4')](_0x4385dc);default:throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0xd8'));}})[_0x965c('0x16')](function(_0x1572e1){_0x37837a=_0x1572e1[_0x965c('0x6d')];if(!_0x337452['query'][_0x965c('0xcc')](_0x965c('0xd3'))){_0x4385dc[_0x965c('0xd4')]=qs['limit'](_0x337452[_0x965c('0x45')][_0x965c('0xd4')]);_0x4385dc[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x337452[_0x965c('0x45')][_0x965c('0x24')]);}switch(_0x5e5041[_0x965c('0x2b')]){case _0x965c('0x2c'):return db[_[_0x965c('0xa2')](_0x337452[_0x965c('0x45')][_0x965c('0x9b')])+'Queue']['findAll'](_0x4385dc);case'user':case _0x965c('0x72'):return _0x5e5041[_0x965c('0x2a')+_['capitalize'](_0x337452['query'][_0x965c('0x9b')])+_0x965c('0xa4')](_0x4385dc);}})[_0x965c('0x16')](function(_0x5d9bb1){return{'count':_0x37837a,'rows':_0x5d9bb1};})['then'](respondWithResult(_0x29c061,null))[_0x965c('0x20')](handleError(_0x29c061,null));};exports[_0x965c('0xd9')]=function(_0xab9e8f,_0x4fd651){var _0x3de9b7={};var _0x383fc7={};var _0x19ff3b;var _0x4516cd;return db[_0x965c('0x3d')]['findOne']({'where':{'id':_0xab9e8f[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x4fd651,null))['then'](function(_0x59a987){if(_0x59a987){_0x19ff3b=_0x59a987;_0x383fc7[_0x965c('0x55')]=_[_0x965c('0x57')](db['UserVoiceQueueRt'][_0x965c('0x58')]);_0x383fc7[_0x965c('0x45')]=_[_0x965c('0x57')](_0xab9e8f['query']);_0x383fc7[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x383fc7[_0x965c('0x55')],_0x383fc7[_0x965c('0x45')]);_0x3de9b7[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x383fc7[_0x965c('0x55')],qs['fields'](_0xab9e8f[_0x965c('0x45')][_0x965c('0x5b')]));_0x3de9b7['attributes']=_0x3de9b7[_0x965c('0x48')][_0x965c('0x6d')]?_0x3de9b7[_0x965c('0x48')]:_0x383fc7[_0x965c('0x55')];_0x3de9b7[_0x965c('0xca')]=qs[_0x965c('0xcb')](_0xab9e8f['query']['sort']);_0x3de9b7['where']=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0xab9e8f[_0x965c('0x45')],_0x383fc7['filters']));if(_0xab9e8f[_0x965c('0x45')][_0x965c('0x31')]){_0x3de9b7[_0x965c('0x44')]=_[_0x965c('0x5c')](_0x3de9b7['where'],{'$or':_[_0x965c('0x33')](_0x3de9b7[_0x965c('0x48')],function(_0xcc4e3e){var _0x277001={};_0x277001[_0xcc4e3e]={'$like':'%'+_0xab9e8f[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x277001;})});}_0x3de9b7=_[_0x965c('0x5c')]({},_0x3de9b7,_0xab9e8f[_0x965c('0x5d')]);return _0x19ff3b[_0x965c('0xd9')](_0x3de9b7);}})[_0x965c('0x16')](function(_0x42b321){if(_0x42b321){_0x4516cd=_0x42b321[_0x965c('0x6d')];if(!_0xab9e8f[_0x965c('0x45')][_0x965c('0xcc')](_0x965c('0xd3'))){_0x3de9b7[_0x965c('0xd4')]=qs['limit'](_0xab9e8f['query'][_0x965c('0xd4')]);_0x3de9b7[_0x965c('0x24')]=qs['offset'](_0xab9e8f['query'][_0x965c('0x24')]);}return _0x19ff3b[_0x965c('0xd9')](_0x3de9b7);}})[_0x965c('0x16')](function(_0x114dff){if(_0x114dff){return _0x114dff?{'count':_0x4516cd,'rows':_0x114dff}:null;}})[_0x965c('0x16')](respondWithResult(_0x4fd651,null))[_0x965c('0x20')](handleError(_0x4fd651,null));};exports['getGroups']=function(_0x4e1787,_0x5abf6d){var _0x3ac96c={};var _0x8c2086={};var _0x3f7413;var _0x533cfd;return db[_0x965c('0x3d')][_0x965c('0xc8')]({'where':{'id':_0x4e1787['params']['id']}})['then'](handleEntityNotFound(_0x5abf6d,null))['then'](function(_0x52f9b5){if(_0x52f9b5){_0x3f7413=_0x52f9b5;_0x8c2086[_0x965c('0x55')]=_['keys'](db['ChatGroup'][_0x965c('0x58')]);_0x8c2086[_0x965c('0x45')]=_[_0x965c('0x57')](_0x4e1787['query']);_0x8c2086[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x8c2086[_0x965c('0x55')],_0x8c2086[_0x965c('0x45')]);_0x3ac96c[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x8c2086[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x4e1787['query'][_0x965c('0x5b')]));_0x3ac96c[_0x965c('0x48')]=_0x3ac96c[_0x965c('0x48')][_0x965c('0x6d')]?_0x3ac96c['attributes']:_0x8c2086[_0x965c('0x55')];_0x3ac96c['order']=qs['sort'](_0x4e1787['query']['sort']);_0x3ac96c['where']=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0x4e1787[_0x965c('0x45')],_0x8c2086[_0x965c('0x59')]));if(_0x4e1787['query']['filter']){_0x3ac96c[_0x965c('0x44')]=_[_0x965c('0x5c')](_0x3ac96c[_0x965c('0x44')],{'$or':_[_0x965c('0x33')](_0x3ac96c[_0x965c('0x48')],function(_0x4d0e8b){var _0x12db90={};_0x12db90[_0x4d0e8b]={'$like':'%'+_0x4e1787['query'][_0x965c('0x31')]+'%'};return _0x12db90;})});}_0x3ac96c=_[_0x965c('0x5c')]({},_0x3ac96c,_0x4e1787[_0x965c('0x5d')]);return _0x3f7413['getGroups'](_0x3ac96c);}})['then'](function(_0x41dd18){if(_0x41dd18){_0x533cfd=_0x41dd18[_0x965c('0x6d')];if(!_0x4e1787[_0x965c('0x45')]['hasOwnProperty'](_0x965c('0xd3'))){_0x3ac96c[_0x965c('0xd4')]=qs[_0x965c('0xd4')](_0x4e1787[_0x965c('0x45')][_0x965c('0xd4')]);_0x3ac96c[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x4e1787[_0x965c('0x45')][_0x965c('0x24')]);}return _0x3f7413[_0x965c('0xda')](_0x3ac96c);}})['then'](function(_0x3bbc85){if(_0x3bbc85){return _0x3bbc85?{'count':_0x533cfd,'rows':_0x3bbc85}:null;}})[_0x965c('0x16')](respondWithResult(_0x5abf6d,null))[_0x965c('0x20')](handleError(_0x5abf6d,null));};exports['getRecordings']=function(_0x3decf9,_0x5e5195){var _0x5df3f8={'raw':!![],'where':{}};var _0xa75bb0={};var _0xe85a12={'count':0x0,'rows':[]};return db[_0x965c('0x3d')]['findOne']({'where':{'id':_0x3decf9[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x5e5195,null))[_0x965c('0x16')](function(_0x4616c0){if(_0x4616c0){_0xa75bb0[_0x965c('0x55')]=_[_0x965c('0x57')](db[_0x965c('0xdb')][_0x965c('0x58')]);_0xa75bb0[_0x965c('0x45')]=_[_0x965c('0x57')](_0x3decf9[_0x965c('0x45')]);_0xa75bb0[_0x965c('0x59')]=_['intersection'](_0xa75bb0[_0x965c('0x55')],_0xa75bb0[_0x965c('0x45')]);_0x5df3f8['attributes']=_['intersection'](_0xa75bb0[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x3decf9[_0x965c('0x45')]['fields']));_0x5df3f8['attributes']=_0x5df3f8[_0x965c('0x48')][_0x965c('0x6d')]?_0x5df3f8[_0x965c('0x48')]:_0xa75bb0['model'];if(!_0x3decf9[_0x965c('0x45')]['hasOwnProperty'](_0x965c('0xd3'))){_0x5df3f8['limit']=qs[_0x965c('0xd4')](_0x3decf9[_0x965c('0x45')][_0x965c('0xd4')]);_0x5df3f8[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x3decf9[_0x965c('0x45')][_0x965c('0x24')]);}_0x5df3f8[_0x965c('0xca')]=qs[_0x965c('0xcb')](_0x3decf9[_0x965c('0x45')]['sort']);_0x5df3f8[_0x965c('0x44')]=qs[_0x965c('0x59')](_['pick'](_0x3decf9[_0x965c('0x45')],_0xa75bb0[_0x965c('0x59')]));_0x5df3f8[_0x965c('0x44')][_0x965c('0xdc')]=_0x4616c0['id'];if(_0x3decf9[_0x965c('0x45')][_0x965c('0x31')]){_0x5df3f8[_0x965c('0x44')]=_[_0x965c('0x5c')](_0x5df3f8[_0x965c('0x44')],{'$or':_['map'](_0x5df3f8[_0x965c('0x48')],function(_0x575ca8){var _0x11e910={};_0x11e910[_0x575ca8]={'$like':'%'+_0x3decf9[_0x965c('0x45')]['filter']+'%'};return _0x11e910;})});}_0x5df3f8=_[_0x965c('0x5c')]({},_0x5df3f8,_0x3decf9[_0x965c('0x5d')]);return db[_0x965c('0xdb')][_0x965c('0x26')]({'where':_0x5df3f8[_0x965c('0x44')]})[_0x965c('0x16')](function(_0x4c7c0b){_0xe85a12[_0x965c('0x26')]=_0x4c7c0b;if(_0x3decf9[_0x965c('0x45')][_0x965c('0x46')]){_0x5df3f8[_0x965c('0x47')]=[{'all':!![]}];}return db['VoiceRecording'][_0x965c('0x4a')](_0x5df3f8);})[_0x965c('0x16')](function(_0x576dba){_0xe85a12[_0x965c('0x4d')]=_0x576dba;return _0xe85a12;});}})[_0x965c('0x16')](respondWithFilteredResult(_0x5e5195,_0x5df3f8))[_0x965c('0x20')](handleError(_0x5e5195,null));};exports[_0x965c('0xdd')]=function(_0x560bd3,_0x5f4bca){var _0x147494={'raw':!![],'where':{}};var _0x1e0323={};var _0x1e464b={'count':0x0,'rows':[]};return db[_0x965c('0x3d')]['findOne']({'where':{'id':_0x560bd3['params']['id']}})['then'](handleEntityNotFound(_0x5f4bca,null))['then'](function(_0x4ca74e){if(_0x4ca74e){_0x1e0323[_0x965c('0x55')]=_['keys'](db[_0x965c('0xde')][_0x965c('0x58')]);_0x1e0323[_0x965c('0x45')]=_[_0x965c('0x57')](_0x560bd3[_0x965c('0x45')]);_0x1e0323[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x1e0323[_0x965c('0x55')],_0x1e0323[_0x965c('0x45')]);_0x147494['attributes']=_[_0x965c('0x5a')](_0x1e0323['model'],qs[_0x965c('0x5b')](_0x560bd3[_0x965c('0x45')][_0x965c('0x5b')]));_0x147494['attributes']=_0x147494[_0x965c('0x48')]['length']?_0x147494[_0x965c('0x48')]:_0x1e0323['model'];if(!_0x560bd3['query'][_0x965c('0xcc')]('nolimit')){_0x147494[_0x965c('0xd4')]=qs[_0x965c('0xd4')](_0x560bd3[_0x965c('0x45')][_0x965c('0xd4')]);_0x147494[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x560bd3[_0x965c('0x45')][_0x965c('0x24')]);}_0x147494[_0x965c('0xca')]=qs[_0x965c('0xcb')](_0x560bd3[_0x965c('0x45')][_0x965c('0xcb')]);_0x147494[_0x965c('0x44')]=qs['filters'](_[_0x965c('0xd7')](_0x560bd3['query'],_0x1e0323[_0x965c('0x59')]));_0x147494[_0x965c('0x44')][_0x965c('0xdc')]=_0x4ca74e['id'];if(_0x560bd3[_0x965c('0x45')][_0x965c('0x31')]){_0x147494[_0x965c('0x44')]=_['merge'](_0x147494[_0x965c('0x44')],{'$or':_[_0x965c('0x33')](_0x147494['attributes'],function(_0x55f846){var _0x35eb82={};_0x35eb82[_0x55f846]={'$like':'%'+_0x560bd3[_0x965c('0x45')]['filter']+'%'};return _0x35eb82;})});}_0x147494=_['merge']({},_0x147494,_0x560bd3[_0x965c('0x5d')]);return db[_0x965c('0xde')][_0x965c('0x26')]({'where':_0x147494['where']})[_0x965c('0x16')](function(_0x3ae1a4){_0x1e464b[_0x965c('0x26')]=_0x3ae1a4;if(_0x560bd3[_0x965c('0x45')][_0x965c('0x46')]){_0x147494['include']=[{'all':!![]}];}return db[_0x965c('0xde')][_0x965c('0x4a')](_0x147494);})[_0x965c('0x16')](function(_0x44fa6f){_0x1e464b[_0x965c('0x4d')]=_0x44fa6f;return _0x1e464b;});}})[_0x965c('0x16')](respondWithFilteredResult(_0x5f4bca,_0x147494))[_0x965c('0x20')](handleError(_0x5f4bca,null));};exports[_0x965c('0xdf')]=function(_0x240393,_0x415367){var _0x20384e={};var _0x8b6a11={};var _0x3079e5;var _0x52770b;return db['User'][_0x965c('0xc8')]({'where':{'id':_0x240393['params']['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x415367,null))[_0x965c('0x16')](function(_0x235ae9){if(_0x235ae9){_0x3079e5=_0x235ae9;_0x8b6a11[_0x965c('0x55')]=_[_0x965c('0x57')](db[_0x965c('0xe0')][_0x965c('0x58')]);_0x8b6a11[_0x965c('0x45')]=_[_0x965c('0x57')](_0x240393['query']);_0x8b6a11[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x8b6a11['model'],_0x8b6a11[_0x965c('0x45')]);_0x20384e['attributes']=_[_0x965c('0x5a')](_0x8b6a11[_0x965c('0x55')],qs['fields'](_0x240393['query'][_0x965c('0x5b')]));_0x20384e[_0x965c('0x48')]=_0x20384e[_0x965c('0x48')][_0x965c('0x6d')]?_0x20384e['attributes']:_0x8b6a11[_0x965c('0x55')];_0x20384e[_0x965c('0xca')]=qs['sort'](_0x240393[_0x965c('0x45')][_0x965c('0xcb')]);_0x20384e[_0x965c('0x44')]=qs[_0x965c('0x59')](_['pick'](_0x240393[_0x965c('0x45')],_0x8b6a11[_0x965c('0x59')]));if(_0x240393[_0x965c('0x45')][_0x965c('0x31')]){_0x20384e[_0x965c('0x44')]=_[_0x965c('0x5c')](_0x20384e[_0x965c('0x44')],{'$or':_['map'](_0x20384e[_0x965c('0x48')],function(_0x4d55cd){var _0x2d98a6={};_0x2d98a6[_0x4d55cd]={'$like':'%'+_0x240393[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x2d98a6;})});}_0x20384e=_['merge']({},_0x20384e,_0x240393[_0x965c('0x5d')]);return _0x3079e5[_0x965c('0xdf')](_0x20384e);}})[_0x965c('0x16')](function(_0x379ef9){if(_0x379ef9){_0x52770b=_0x379ef9[_0x965c('0x6d')];if(!_0x240393[_0x965c('0x45')]['hasOwnProperty']('nolimit')){_0x20384e[_0x965c('0xd4')]=qs['limit'](_0x240393['query'][_0x965c('0xd4')]);_0x20384e['offset']=qs[_0x965c('0x24')](_0x240393[_0x965c('0x45')]['offset']);}return _0x3079e5['getChatInteractions'](_0x20384e);}})[_0x965c('0x16')](function(_0x31a9b4){if(_0x31a9b4){return _0x31a9b4?{'count':_0x52770b,'rows':_0x31a9b4}:null;}})[_0x965c('0x16')](respondWithResult(_0x415367,null))[_0x965c('0x20')](handleError(_0x415367,null));};exports['getOpenchannelInteractions']=function(_0x42f07c,_0x19ba24){var _0x7a6b00={};var _0x559767={};var _0x36ef70;var _0x1cc5eb;return db[_0x965c('0x3d')][_0x965c('0xc8')]({'where':{'id':_0x42f07c[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0x19ba24,null))['then'](function(_0x36e17b){if(_0x36e17b){_0x36ef70=_0x36e17b;_0x559767[_0x965c('0x55')]=_[_0x965c('0x57')](db['OpenchannelInteraction'][_0x965c('0x58')]);_0x559767[_0x965c('0x45')]=_['keys'](_0x42f07c[_0x965c('0x45')]);_0x559767[_0x965c('0x59')]=_['intersection'](_0x559767[_0x965c('0x55')],_0x559767[_0x965c('0x45')]);_0x7a6b00[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x559767[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x42f07c[_0x965c('0x45')][_0x965c('0x5b')]));_0x7a6b00['attributes']=_0x7a6b00[_0x965c('0x48')][_0x965c('0x6d')]?_0x7a6b00['attributes']:_0x559767[_0x965c('0x55')];_0x7a6b00[_0x965c('0xca')]=qs[_0x965c('0xcb')](_0x42f07c[_0x965c('0x45')][_0x965c('0xcb')]);_0x7a6b00['where']=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0x42f07c['query'],_0x559767['filters']));if(_0x42f07c[_0x965c('0x45')][_0x965c('0x31')]){_0x7a6b00['where']=_[_0x965c('0x5c')](_0x7a6b00[_0x965c('0x44')],{'$or':_[_0x965c('0x33')](_0x7a6b00[_0x965c('0x48')],function(_0x511224){var _0x339fff={};_0x339fff[_0x511224]={'$like':'%'+_0x42f07c['query'][_0x965c('0x31')]+'%'};return _0x339fff;})});}_0x7a6b00=_[_0x965c('0x5c')]({},_0x7a6b00,_0x42f07c[_0x965c('0x5d')]);return _0x36ef70[_0x965c('0xe1')](_0x7a6b00);}})[_0x965c('0x16')](function(_0x74db2){if(_0x74db2){_0x1cc5eb=_0x74db2[_0x965c('0x6d')];if(!_0x42f07c['query'][_0x965c('0xcc')](_0x965c('0xd3'))){_0x7a6b00[_0x965c('0xd4')]=qs['limit'](_0x42f07c[_0x965c('0x45')][_0x965c('0xd4')]);_0x7a6b00['offset']=qs[_0x965c('0x24')](_0x42f07c[_0x965c('0x45')]['offset']);}return _0x36ef70[_0x965c('0xe1')](_0x7a6b00);}})[_0x965c('0x16')](function(_0x1a1423){if(_0x1a1423){return _0x1a1423?{'count':_0x1cc5eb,'rows':_0x1a1423}:null;}})[_0x965c('0x16')](respondWithResult(_0x19ba24,null))['catch'](handleError(_0x19ba24,null));};exports[_0x965c('0xe2')]=function(_0x3b4120,_0x5a3866){var _0x22b034={'raw':!![],'where':{}};var _0x49a69c={};var _0x522325={'count':0x0,'rows':[]};return db[_0x965c('0x3d')][_0x965c('0xc8')]({'where':{'id':_0x3b4120[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x5a3866,null))[_0x965c('0x16')](function(_0x3947a5){if(_0x3947a5){_0x49a69c[_0x965c('0x55')]=_[_0x965c('0x57')](db['MailInteraction']['rawAttributes']);_0x49a69c[_0x965c('0x45')]=_[_0x965c('0x57')](_0x3b4120[_0x965c('0x45')]);_0x49a69c[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x49a69c[_0x965c('0x55')],_0x49a69c[_0x965c('0x45')]);_0x22b034[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x49a69c[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x3b4120[_0x965c('0x45')][_0x965c('0x5b')]));_0x22b034[_0x965c('0x48')]=_0x22b034[_0x965c('0x48')][_0x965c('0x6d')]?_0x22b034[_0x965c('0x48')]:_0x49a69c['model'];if(!_0x3b4120[_0x965c('0x45')][_0x965c('0xcc')](_0x965c('0xd3'))){_0x22b034[_0x965c('0xd4')]=qs[_0x965c('0xd4')](_0x3b4120[_0x965c('0x45')]['limit']);_0x22b034[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x3b4120[_0x965c('0x45')][_0x965c('0x24')]);}_0x22b034[_0x965c('0xca')]=qs['sort'](_0x3b4120[_0x965c('0x45')]['sort']);_0x22b034[_0x965c('0x44')]=qs['filters'](_[_0x965c('0xd7')](_0x3b4120[_0x965c('0x45')],_0x49a69c[_0x965c('0x59')]));_0x22b034['where'][_0x965c('0xdc')]=_0x3947a5['id'];if(_0x3b4120[_0x965c('0x45')]['filter']){_0x22b034['where']=_[_0x965c('0x5c')](_0x22b034['where'],{'$or':_[_0x965c('0x33')](_0x22b034['attributes'],function(_0x5988d3){var _0x206748={};_0x206748[_0x5988d3]={'$like':'%'+_0x3b4120[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x206748;})});}_0x22b034=_['merge']({},_0x22b034,_0x3b4120[_0x965c('0x5d')]);return db['MailInteraction'][_0x965c('0x26')]({'where':_0x22b034[_0x965c('0x44')]})[_0x965c('0x16')](function(_0x4cc1a1){_0x522325[_0x965c('0x26')]=_0x4cc1a1;if(_0x3b4120[_0x965c('0x45')][_0x965c('0x46')]){_0x22b034[_0x965c('0x47')]=[{'all':!![]}];}return db[_0x965c('0xe3')][_0x965c('0x4a')](_0x22b034);})['then'](function(_0x3da6ca){_0x522325[_0x965c('0x4d')]=_0x3da6ca;return _0x522325;});}})[_0x965c('0x16')](respondWithFilteredResult(_0x5a3866,_0x22b034))['catch'](handleError(_0x5a3866,null));};exports[_0x965c('0xe4')]=function(_0x59acfc,_0x457e2f){var _0x521fdd={};var _0x2ff503={};var _0x3f6a17;var _0x20fc6f;return db[_0x965c('0x3d')][_0x965c('0xc8')]({'where':{'id':_0x59acfc[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x457e2f,null))[_0x965c('0x16')](function(_0x4de8b1){if(_0x4de8b1){_0x3f6a17=_0x4de8b1;_0x2ff503[_0x965c('0x55')]=_[_0x965c('0x57')](db[_0x965c('0xe5')][_0x965c('0x58')]);_0x2ff503['query']=_[_0x965c('0x57')](_0x59acfc[_0x965c('0x45')]);_0x2ff503[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x2ff503[_0x965c('0x55')],_0x2ff503[_0x965c('0x45')]);_0x521fdd['attributes']=_[_0x965c('0x5a')](_0x2ff503[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x59acfc[_0x965c('0x45')][_0x965c('0x5b')]));_0x521fdd[_0x965c('0x48')]=_0x521fdd[_0x965c('0x48')][_0x965c('0x6d')]?_0x521fdd[_0x965c('0x48')]:_0x2ff503[_0x965c('0x55')];_0x521fdd[_0x965c('0xca')]=qs[_0x965c('0xcb')](_0x59acfc['query']['sort']);_0x521fdd[_0x965c('0x44')]=qs[_0x965c('0x59')](_['pick'](_0x59acfc['query'],_0x2ff503['filters']));if(_0x59acfc[_0x965c('0x45')]['filter']){_0x521fdd[_0x965c('0x44')]=_[_0x965c('0x5c')](_0x521fdd[_0x965c('0x44')],{'$or':_['map'](_0x521fdd[_0x965c('0x48')],function(_0x4d1826){var _0x458f19={};_0x458f19[_0x4d1826]={'$like':'%'+_0x59acfc[_0x965c('0x45')]['filter']+'%'};return _0x458f19;})});}_0x521fdd=_[_0x965c('0x5c')]({},_0x521fdd,_0x59acfc['options']);return _0x3f6a17[_0x965c('0xe4')](_0x521fdd);}})[_0x965c('0x16')](function(_0x192461){if(_0x192461){_0x20fc6f=_0x192461[_0x965c('0x6d')];if(!_0x59acfc[_0x965c('0x45')]['hasOwnProperty'](_0x965c('0xd3'))){_0x521fdd[_0x965c('0xd4')]=qs[_0x965c('0xd4')](_0x59acfc[_0x965c('0x45')][_0x965c('0xd4')]);_0x521fdd['offset']=qs[_0x965c('0x24')](_0x59acfc[_0x965c('0x45')][_0x965c('0x24')]);}return _0x3f6a17['getSmsInteractions'](_0x521fdd);}})[_0x965c('0x16')](function(_0x22d8d6){if(_0x22d8d6){return _0x22d8d6?{'count':_0x20fc6f,'rows':_0x22d8d6}:null;}})[_0x965c('0x16')](respondWithResult(_0x457e2f,null))[_0x965c('0x20')](handleError(_0x457e2f,null));};exports['getFaxInteractions']=function(_0x131abc,_0x52603c){var _0x55eecd={};var _0x5e66d7={};var _0x4f7a91;var _0x6d6b7;return db['User']['findOne']({'where':{'id':_0x131abc['params']['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x52603c,null))[_0x965c('0x16')](function(_0x13e71d){if(_0x13e71d){_0x4f7a91=_0x13e71d;_0x5e66d7['model']=_['keys'](db[_0x965c('0xe6')]['rawAttributes']);_0x5e66d7[_0x965c('0x45')]=_['keys'](_0x131abc[_0x965c('0x45')]);_0x5e66d7[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x5e66d7[_0x965c('0x55')],_0x5e66d7[_0x965c('0x45')]);_0x55eecd[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x5e66d7[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x131abc[_0x965c('0x45')][_0x965c('0x5b')]));_0x55eecd[_0x965c('0x48')]=_0x55eecd['attributes'][_0x965c('0x6d')]?_0x55eecd[_0x965c('0x48')]:_0x5e66d7[_0x965c('0x55')];_0x55eecd[_0x965c('0xca')]=qs[_0x965c('0xcb')](_0x131abc[_0x965c('0x45')][_0x965c('0xcb')]);_0x55eecd[_0x965c('0x44')]=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0x131abc[_0x965c('0x45')],_0x5e66d7[_0x965c('0x59')]));if(_0x131abc['query'][_0x965c('0x31')]){_0x55eecd[_0x965c('0x44')]=_['merge'](_0x55eecd[_0x965c('0x44')],{'$or':_[_0x965c('0x33')](_0x55eecd[_0x965c('0x48')],function(_0x5f5a42){var _0x43d05d={};_0x43d05d[_0x5f5a42]={'$like':'%'+_0x131abc[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x43d05d;})});}_0x55eecd=_[_0x965c('0x5c')]({},_0x55eecd,_0x131abc['options']);return _0x4f7a91[_0x965c('0xe7')](_0x55eecd);}})[_0x965c('0x16')](function(_0x988f86){if(_0x988f86){_0x6d6b7=_0x988f86[_0x965c('0x6d')];if(!_0x131abc[_0x965c('0x45')][_0x965c('0xcc')](_0x965c('0xd3'))){_0x55eecd[_0x965c('0xd4')]=qs[_0x965c('0xd4')](_0x131abc[_0x965c('0x45')][_0x965c('0xd4')]);_0x55eecd[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x131abc[_0x965c('0x45')]['offset']);}return _0x4f7a91[_0x965c('0xe7')](_0x55eecd);}})[_0x965c('0x16')](function(_0x5d0613){if(_0x5d0613){return _0x5d0613?{'count':_0x6d6b7,'rows':_0x5d0613}:null;}})[_0x965c('0x16')](respondWithResult(_0x52603c,null))[_0x965c('0x20')](handleError(_0x52603c,null));};exports[_0x965c('0xe8')]=function(_0x283c44,_0x3abb7d){var _0xee7d33={};var _0x534acf={};var _0x2f493c;var _0x370052;return db[_0x965c('0x3d')][_0x965c('0xc8')]({'where':{'id':_0x283c44['params']['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x3abb7d,null))[_0x965c('0x16')](function(_0x507c68){if(_0x507c68){_0x2f493c=_0x507c68;_0x534acf[_0x965c('0x55')]=_['keys'](db[_0x965c('0xe9')][_0x965c('0x58')]);_0x534acf[_0x965c('0x45')]=_[_0x965c('0x57')](_0x283c44[_0x965c('0x45')]);_0x534acf['filters']=_['intersection'](_0x534acf[_0x965c('0x55')],_0x534acf[_0x965c('0x45')]);_0xee7d33[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x534acf[_0x965c('0x55')],qs['fields'](_0x283c44['query'][_0x965c('0x5b')]));_0xee7d33[_0x965c('0x48')]=_0xee7d33[_0x965c('0x48')][_0x965c('0x6d')]?_0xee7d33[_0x965c('0x48')]:_0x534acf['model'];_0xee7d33[_0x965c('0xca')]=qs[_0x965c('0xcb')](_0x283c44[_0x965c('0x45')][_0x965c('0xcb')]);_0xee7d33['where']=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0x283c44[_0x965c('0x45')],_0x534acf[_0x965c('0x59')]));if(_0x283c44[_0x965c('0x45')][_0x965c('0x31')]){_0xee7d33[_0x965c('0x44')]=_[_0x965c('0x5c')](_0xee7d33[_0x965c('0x44')],{'$or':_['map'](_0xee7d33['attributes'],function(_0x197d2c){var _0x5661a9={};_0x5661a9[_0x197d2c]={'$like':'%'+_0x283c44['query'][_0x965c('0x31')]+'%'};return _0x5661a9;})});}_0xee7d33=_[_0x965c('0x5c')]({},_0xee7d33,_0x283c44['options']);return _0x2f493c['getWhatsappInteractions'](_0xee7d33);}})[_0x965c('0x16')](function(_0x4951e5){if(_0x4951e5){_0x370052=_0x4951e5['length'];if(!_0x283c44[_0x965c('0x45')]['hasOwnProperty'](_0x965c('0xd3'))){_0xee7d33[_0x965c('0xd4')]=qs[_0x965c('0xd4')](_0x283c44['query'][_0x965c('0xd4')]);_0xee7d33[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x283c44[_0x965c('0x45')][_0x965c('0x24')]);}return _0x2f493c['getWhatsappInteractions'](_0xee7d33);}})[_0x965c('0x16')](function(_0x318025){if(_0x318025){return _0x318025?{'count':_0x370052,'rows':_0x318025}:null;}})[_0x965c('0x16')](respondWithResult(_0x3abb7d,null))['catch'](handleError(_0x3abb7d,null));};exports[_0x965c('0xea')]=function(_0xfefff3,_0x1a6ed0,_0x4f90eb){var _0x67ca4a;var _0x5044be;var _0x62d285;var _0x570b56=!_[_0x965c('0x6e')](_0xfefff3[_0x965c('0x60')]['id'])?_0xfefff3[_0x965c('0x60')]['id']:!_[_0x965c('0x6e')](_0xfefff3['user']['id'])?_0xfefff3[_0x965c('0x2e')]['id']:null;return db['User']['find']({'where':{'id':_0x570b56,'role':{'$or':[_0x965c('0x2c'),'user','agent']}},'attributes':['id',_0x965c('0x3a'),_0x965c('0xeb'),'mobile','role',_0x965c('0x67'),_0x965c('0x9d')]})[_0x965c('0x16')](function(_0x515abb){if(_0x515abb){if(_0x515abb['role']===_0x965c('0x72')){_0x67ca4a=_0x515abb;if(_0xfefff3[_0x965c('0x5f')][_0x965c('0xaa')]){_0x62d285=util[_0x965c('0xec')](_0x965c('0xed'),_0x67ca4a[_0xfefff3[_0x965c('0x5f')][_0x965c('0xaa')]]);}else if(_0xfefff3[_0x965c('0x5f')][_0x965c('0xee')]){_0x62d285=util['format'](_0x965c('0xef'),_0xfefff3[_0x965c('0x5f')][_0x965c('0xee')]);}else{_0x62d285=util['format'](_0x965c('0xef'),_0x67ca4a[_0x965c('0x3a')]);}socket['to'](util[_0x965c('0xec')](_0x965c('0xf0'),_0x67ca4a['name']))[_0x965c('0xa7')](_0x965c('0xf1'),{'user':{'id':_0x67ca4a['id'],'name':_0x67ca4a['name']},'ip':_0xfefff3[_0x965c('0xf2')]['x-forwarded-for']||_0xfefff3[_0x965c('0xf3')][_0x965c('0xf4')]||_0xfefff3['socket']['remoteAddress']||_0xfefff3[_0x965c('0xf3')][_0x965c('0xf5')][_0x965c('0xf4')]});return db['UserVoiceQueueRt'][_0x965c('0x29')]({'where':{'membername':_0x67ca4a[_0x965c('0x3a')]},'individualHooks':!![]});}}else{throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0x67ca4a){return _0x67ca4a[_0x965c('0xf6')]({'raw':!![]});}})[_0x965c('0x16')](function(_0x8596f1){if(_0x67ca4a){var _0x123337=[];if(_0x8596f1){_0x5044be=_0x8596f1;if(_0x5044be[_0x965c('0x6d')]){for(var _0x440483=0x0;_0x440483<_0x5044be[_0x965c('0x6d')];_0x440483++){_0x123337[_0x965c('0x49')]({'membername':_0x67ca4a['name'],'UserId':_0x67ca4a['id'],'queue_name':_0x5044be[_0x440483][_0x965c('0x3a')],'VoiceQueueId':_0x5044be[_0x440483]['id'],'interface':_0x62d285,'paused':_0x67ca4a['loginInPause']||![],'penalty':_0x5044be[_0x440483][_0x965c('0xf7')]||0x0});}return BPromise['each'](_0x123337,function(_0x15b640){return db[_0x965c('0xaf')][_0x965c('0xac')](_0x15b640);});}}}})['then'](function(){if(_0x67ca4a){return db[_0x965c('0xf8')][_0x965c('0x4a')]({'where':{'membername':_0x67ca4a['name'],'exitAt':null}});}})['then'](function(_0x3eb590){if(_0x67ca4a){var _0x57cd11=[];_0x3eb590[_0x965c('0xf9')](function(_0x3940b7){_0x57cd11[_0x965c('0x49')](_0x3940b7[_0x965c('0x28')]({'exitAt':moment()['format'](_0x965c('0xfa'))}));});return BPromise[_0x965c('0x5e')](_0x57cd11);}})['then'](function(){if(_0x67ca4a){var _0x55963e=[];var _0x4ed310=[];var _0x588577=utils['getChannels']();var _0x231ff9={'membername':_0x67ca4a[_0x965c('0x3a')],'interface':_0x62d285,'enterAt':moment()[_0x965c('0xec')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x67ca4a['role'],'internal':_0x67ca4a[_0x965c('0x67')]};_0x588577[_0x965c('0xf9')](function(_0x1ee25c){_0x55963e[_0x965c('0x49')](_['merge']({'channel':_0x1ee25c,'type':_0x965c('0xfb'),'data1':_0xfefff3[_0x965c('0x5f')]['device'],'data2':_0x62d285},_0x231ff9));if(_0x67ca4a[_0x965c('0x9d')]){_0x4ed310[_0x965c('0x49')](_[_0x965c('0x5c')]({'channel':_0x1ee25c,'type':_0x965c('0xfc'),'data1':_0x965c('0xfd')},_0x231ff9));}});return db['MemberReport'][_0x965c('0x88')](_0x55963e[_0x965c('0xfe')](_0x4ed310),{'individualHooks':!![]});}})[_0x965c('0x16')](function(){if(_0x67ca4a){return _0x67ca4a['update']({'online':!![],'lastLoginAt':moment()[_0x965c('0xec')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x67ca4a['loginInPause']||![],'mailPause':_0x67ca4a[_0x965c('0x9d')]||![],'chatPause':_0x67ca4a[_0x965c('0x9d')]||![],'faxPause':_0x67ca4a['loginInPause']||![],'smsPause':_0x67ca4a[_0x965c('0x9d')]||![],'openchannelPause':_0x67ca4a[_0x965c('0x9d')]||![],'whatsappPause':_0x67ca4a['loginInPause']||![],'pauseType':_0x67ca4a[_0x965c('0x9d')]?_0x965c('0xfd'):null,'interface':_0x62d285,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x965c('0x16')](function(_0x5fe728){if(_0xfefff3[_0x965c('0xff')]){return _0x4f90eb();}else{return BPromise[_0x965c('0x100')](_0x5fe728)[_0x965c('0x16')](respondWithResult(_0x1a6ed0,null));}})['catch'](handleError(_0x1a6ed0,null));};exports[_0x965c('0x101')]=function(_0x5e247c,_0x4903cb){var _0x551aee;return db[_0x965c('0x3d')]['find']({'where':{'id':_0x5e247c[_0x965c('0x60')]['id'],'role':_0x965c('0x72')},'attributes':['id',_0x965c('0x3a'),_0x965c('0x2b')]})[_0x965c('0x16')](handleEntityNotFound(_0x4903cb,null))[_0x965c('0x16')](function(_0x2a075d){if(_0x2a075d){_0x551aee=_0x2a075d;return db[_0x965c('0xaf')][_0x965c('0x29')]({'where':{'membername':_0x551aee['name']},'individualHooks':!![]});}})[_0x965c('0x16')](function(){return db[_0x965c('0xf8')][_0x965c('0x4a')]({'where':{'membername':_0x551aee[_0x965c('0x3a')],'exitAt':null}});})[_0x965c('0x16')](function(_0x2653b5){var _0x5a6739=[];_0x2653b5[_0x965c('0xf9')](function(_0x34c0de){_0x5a6739[_0x965c('0x49')](_0x34c0de[_0x965c('0x28')]({'exitAt':moment()[_0x965c('0xec')](_0x965c('0xfa'))}));});return BPromise[_0x965c('0x5e')](_0x5a6739);})[_0x965c('0x16')](function(){return _0x551aee['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x965c('0x16')](respondWithResult(_0x4903cb,null))[_0x965c('0x20')](handleError(_0x4903cb,null));};exports[_0x965c('0x102')]=function(_0x32f51b,_0x94d4){var _0x21bea1;return db[_0x965c('0xaf')][_0x965c('0x28')]({'paused':0x1},{'where':{'UserId':_0x32f51b[_0x965c('0x60')]['id']},'individualHooks':!![]})[_0x965c('0x16')](function(){return db['User']['find']({'where':{'id':_0x32f51b[_0x965c('0x60')]['id'],'role':_0x965c('0x72')},'attributes':['id',_0x965c('0x3a'),'role',_0x965c('0x67'),'interface']});})[_0x965c('0x16')](handleEntityNotFound(_0x94d4,null))[_0x965c('0x16')](function(_0x3bd231){if(_0x3bd231){_0x21bea1=_0x3bd231;return respondWithRpcPromise(_0x965c('0x103'),_0x965c('0x102'),{'id':_0x21bea1['id'],'name':_0x21bea1['name'],'pause':!![]});}})[_0x965c('0x16')](function(){if(_0x21bea1){return db[_0x965c('0xf8')][_0x965c('0x4a')]({'where':{'membername':_0x21bea1[_0x965c('0x3a')],'type':'PAUSE','exitAt':null}});}})[_0x965c('0x16')](function(_0x227e3d){if(_0x227e3d[_0x965c('0x6d')]){var _0x10df92=moment()['format'](_0x965c('0xfa'));for(var _0x4c42f2=0x0,_0x1de203=_0x227e3d[_0x965c('0x6d')];_0x4c42f2<_0x1de203;_0x4c42f2++){_0x227e3d[_0x4c42f2][_0x965c('0x104')]({'exitAt':_0x10df92});}}})[_0x965c('0x16')](function(){var _0x97dec8=[];var _0x324b90=utils[_0x965c('0x105')]();_0x324b90['forEach'](function(_0x331fa8){_0x97dec8[_0x965c('0x49')]({'channel':_0x331fa8,'membername':_0x21bea1['name'],'interface':_['isNil'](_0x21bea1[_0x965c('0xaa')])?util[_0x965c('0xec')]('SIP/%s',_0x21bea1[_0x965c('0x3a')]):_0x21bea1[_0x965c('0xaa')],'type':_0x965c('0xfc'),'enterAt':moment()[_0x965c('0xec')](_0x965c('0xfa')),'data1':_0x32f51b[_0x965c('0x5f')][_0x965c('0x3f')]||'DEFAULT\x20PAUSE','role':_0x21bea1[_0x965c('0x2b')],'internal':_0x21bea1[_0x965c('0x67')]});});return db[_0x965c('0xf8')]['bulkCreate'](_0x97dec8,{'individualHooks':!![]});})['then'](function(){return _0x21bea1[_0x965c('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x32f51b[_0x965c('0x5f')][_0x965c('0x3f')]||_0x965c('0x106'),'lastPauseAt':moment()['format'](_0x965c('0xfa'))});})['then'](respondWithResult(_0x94d4,null))['catch'](handleError(_0x94d4,null));};exports[_0x965c('0x107')]=function(_0x1f58e1,_0xf7870f){var _0x23f363;return db['User']['find']({'where':{'id':_0x1f58e1['params']['id']},'attributes':['id','name',_0x965c('0x2b'),'voicePause',_0x965c('0x108'),_0x965c('0x109'),_0x965c('0x10a'),_0x965c('0x10b'),_0x965c('0x10c'),_0x965c('0x10d'),'pauseType',_0x965c('0x10e')]})[_0x965c('0x16')](handleEntityNotFound(_0xf7870f,null))[_0x965c('0x16')](function(_0x4c68de){if(_0x4c68de){_0x23f363=_0x4c68de;if(_0x1f58e1['body'][_0x965c('0x9b')]&&!utils[_0x965c('0x9f')](_0x1f58e1['body'][_0x965c('0x9b')])){throw new db[(_0x965c('0x91'))][(_0x965c('0x92'))](_0x965c('0xa0'));}switch(_0x1f58e1[_0x965c('0x5f')][_0x965c('0x9b')]){case _0x965c('0xa8'):return respondWithRpcPromise(_0x965c('0x103'),_0x965c('0x107'),{'id':_0x23f363['id'],'name':_0x23f363[_0x965c('0x3a')],'pause':![]})[_0x965c('0x16')](function(){return db[_0x965c('0xaf')][_0x965c('0x28')]({'paused':0x0},{'where':{'UserId':_0x23f363['id']},'individualHooks':!![]});})[_0x965c('0x16')](function(){return db[_0x965c('0xf8')][_0x965c('0x36')]({'where':{'channel':_0x1f58e1['body'][_0x965c('0x9b')],'membername':_0x23f363[_0x965c('0x3a')],'type':'PAUSE','exitAt':null}});})[_0x965c('0x16')](function(_0x44c57d){if(_0x44c57d){return _0x44c57d['update']({'exitAt':moment()[_0x965c('0xec')](_0x965c('0xfa')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x965c('0x16')](function(){return _0x23f363['update']({'voicePause':![]});});case _0x965c('0x52'):case _0x965c('0x4e'):case _0x965c('0x50'):case _0x965c('0x4f'):case _0x965c('0x53'):case _0x965c('0xba'):return db['MemberReport']['find']({'where':{'channel':_0x1f58e1['body']['channel'],'membername':_0x23f363['name'],'type':_0x965c('0xfc'),'exitAt':null}})[_0x965c('0x16')](function(_0x3c1966){if(_0x3c1966){return _0x3c1966[_0x965c('0x28')]({'exitAt':moment()[_0x965c('0xec')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x965c('0x16')](function(){var _0x3278f3={};_[_0x965c('0x27')](_0x3278f3,util[_0x965c('0xec')](_0x965c('0x10f'),_0x1f58e1['body']['channel'],_0x965c('0x110')),![]);return _0x23f363['update'](_0x3278f3);});default:return respondWithRpcPromise('QueuePause',_0x965c('0x107'),{'id':_0x23f363['id'],'name':_0x23f363[_0x965c('0x3a')],'pause':![]})[_0x965c('0x16')](function(){return db[_0x965c('0xaf')]['update']({'paused':0x0},{'where':{'UserId':_0x23f363['id']}});})['then'](function(){return db[_0x965c('0xf8')][_0x965c('0x4a')]({'where':{'membername':_0x23f363[_0x965c('0x3a')],'type':_0x965c('0xfc'),'exitAt':null}});})['then'](function(_0x3d1bf2){var _0x311795=[];_0x3d1bf2['forEach'](function(_0x2b4981){_0x311795['push'](_0x2b4981[_0x965c('0x28')]({'exitAt':moment()['format'](_0x965c('0xfa')),'data2':_0x965c('0x111')}));});return BPromise[_0x965c('0x5e')](_0x311795);})[_0x965c('0x16')](function(){return _0x23f363[_0x965c('0x28')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x965c('0x16')](respondWithResult(_0xf7870f,null))[_0x965c('0x20')](handleError(_0xf7870f,null));};exports['getTeams']=function(_0x40f3d6,_0x1afce6){var _0x1fc6db={};var _0x47ec18={};var _0x246bc1;var _0x22a400;return db[_0x965c('0x3d')]['findOne']({'where':{'id':_0x40f3d6[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0x1afce6,null))[_0x965c('0x16')](function(_0x4c28a9){if(_0x4c28a9){_0x246bc1=_0x4c28a9;_0x47ec18[_0x965c('0x55')]=_[_0x965c('0x57')](db['Team'][_0x965c('0x58')]);_0x47ec18['query']=_[_0x965c('0x57')](_0x40f3d6[_0x965c('0x45')]);_0x47ec18[_0x965c('0x59')]=_['intersection'](_0x47ec18[_0x965c('0x55')],_0x47ec18[_0x965c('0x45')]);_0x1fc6db[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x47ec18[_0x965c('0x55')],qs['fields'](_0x40f3d6[_0x965c('0x45')][_0x965c('0x5b')]));_0x1fc6db[_0x965c('0x48')]=_0x1fc6db[_0x965c('0x48')]['length']?_0x1fc6db[_0x965c('0x48')]:_0x47ec18[_0x965c('0x55')];_0x1fc6db['order']=qs[_0x965c('0xcb')](_0x40f3d6[_0x965c('0x45')][_0x965c('0xcb')]);_0x1fc6db[_0x965c('0x44')]=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0x40f3d6[_0x965c('0x45')],_0x47ec18[_0x965c('0x59')]));if(_0x40f3d6['query'][_0x965c('0x31')]){_0x1fc6db[_0x965c('0x44')]=_[_0x965c('0x5c')](_0x1fc6db[_0x965c('0x44')],{'$or':_[_0x965c('0x33')](_0x1fc6db[_0x965c('0x48')],function(_0x5b3dd7){var _0x360dda={};_0x360dda[_0x5b3dd7]={'$like':'%'+_0x40f3d6['query'][_0x965c('0x31')]+'%'};return _0x360dda;})});}_0x1fc6db=_[_0x965c('0x5c')]({},_0x1fc6db,_0x40f3d6[_0x965c('0x5d')]);return _0x246bc1[_0x965c('0x112')](_0x1fc6db);}})['then'](function(_0x17a69c){if(_0x17a69c){_0x22a400=_0x17a69c['length'];if(!_0x40f3d6[_0x965c('0x45')][_0x965c('0xcc')](_0x965c('0xd3'))){_0x1fc6db[_0x965c('0xd4')]=qs['limit'](_0x40f3d6['query'][_0x965c('0xd4')]);_0x1fc6db[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x40f3d6[_0x965c('0x45')][_0x965c('0x24')]);}return _0x246bc1[_0x965c('0x112')](_0x1fc6db);}})[_0x965c('0x16')](function(_0x1011c3){if(_0x1011c3){return _0x1011c3?{'count':_0x22a400,'rows':_0x1011c3}:null;}})[_0x965c('0x16')](respondWithResult(_0x1afce6,null))['catch'](handleError(_0x1afce6,null));};exports['addTeams']=function(_0x47b0ce,_0x54b52a){return db[_0x965c('0x3d')]['find']({'where':{'id':_0x47b0ce[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x54b52a,null))['then'](function(_0x5d2cd0){if(_0x5d2cd0){var _0x45099a=_0x5d2cd0[_0x965c('0x2a')]({'plain':!![]});return _0x5d2cd0['addTeams'](_0x47b0ce[_0x965c('0x5f')][_0x965c('0x64')],_[_0x965c('0x63')](_0x47b0ce['body'],[_0x965c('0x64'),'id'])||{})[_0x965c('0x16')](function(){for(var _0x303514=0x0;_0x303514<_0x47b0ce[_0x965c('0x5f')][_0x965c('0x64')]['length'];_0x303514++){var _0x9ffa1=[];db[_0x965c('0x113')][_0x965c('0xc8')]({'where':{'id':_0x47b0ce['body'][_0x965c('0x64')][_0x303514]}})[_0x965c('0x16')](function(_0x36a772){_0x9ffa1[_0x965c('0x49')](_0x36a772[_0x965c('0xf6')]()['then'](function(_0x46d679){for(var _0x68b018=0x0;_0x68b018<_0x46d679[_0x965c('0x6d')];_0x68b018++){_0x46d679[_0x68b018]['setDataValue']('channel','Voice');}return _0x46d679;}));_0x9ffa1[_0x965c('0x49')](_0x36a772['getChatQueues']()[_0x965c('0x16')](function(_0xb9b11){for(var _0xeb09fe=0x0;_0xeb09fe<_0xb9b11[_0x965c('0x6d')];_0xeb09fe++){_0xb9b11[_0xeb09fe][_0x965c('0x114')](_0x965c('0x9b'),_0x965c('0x115'));}return _0xb9b11;}));_0x9ffa1['push'](_0x36a772[_0x965c('0x116')]()['then'](function(_0x5daaff){for(var _0x8baec0=0x0;_0x8baec0<_0x5daaff[_0x965c('0x6d')];_0x8baec0++){_0x5daaff[_0x8baec0][_0x965c('0x114')](_0x965c('0x9b'),_0x965c('0x117'));}return _0x5daaff;}));_0x9ffa1[_0x965c('0x49')](_0x36a772['getSmsQueues']()[_0x965c('0x16')](function(_0x3d0524){for(var _0x469846=0x0;_0x469846<_0x3d0524[_0x965c('0x6d')];_0x469846++){_0x3d0524[_0x469846]['setDataValue'](_0x965c('0x9b'),_0x965c('0x118'));}return _0x3d0524;}));_0x9ffa1[_0x965c('0x49')](_0x36a772[_0x965c('0x119')]()[_0x965c('0x16')](function(_0x4c764c){for(var _0x55c1df=0x0;_0x55c1df<_0x4c764c[_0x965c('0x6d')];_0x55c1df++){_0x4c764c[_0x55c1df][_0x965c('0x114')]('channel','Whatsapp');}return _0x4c764c;}));_0x9ffa1['push'](_0x36a772[_0x965c('0x11a')]()[_0x965c('0x16')](function(_0x48b9ba){for(var _0xf56ee=0x0;_0xf56ee<_0x48b9ba['length'];_0xf56ee++){_0x48b9ba[_0xf56ee]['setDataValue'](_0x965c('0x9b'),'Fax');}return _0x48b9ba;}));_0x9ffa1['push'](_0x36a772[_0x965c('0x11b')]()[_0x965c('0x16')](function(_0x46da2c){for(var _0x5b9c93=0x0;_0x5b9c93<_0x46da2c[_0x965c('0x6d')];_0x5b9c93++){_0x46da2c[_0x5b9c93][_0x965c('0x114')](_0x965c('0x9b'),'Openchannel');}return _0x46da2c;}));return BPromise[_0x965c('0x5e')](_0x9ffa1);})['then'](function(_0x5f4782){var _0x4a5a2b=_[_0x965c('0x11c')](_0x5f4782);_0x9ffa1=[];return db[_0x965c('0x6a')][_0x965c('0x11d')](function(_0x2904c8){for(var _0x10c91a=0x0;_0x10c91a<_0x4a5a2b['length'];_0x10c91a++){_0x9ffa1[_0x965c('0x49')](_0x4a5a2b[_0x10c91a]['addAgent'](_0x45099a['id']),{'transaction':_0x2904c8});}return BPromise[_0x965c('0x5e')](_0x9ffa1)['then'](function(){if(_0x45099a['online']){return BPromise['each'](_[_0x965c('0x31')](_0x4a5a2b,function(_0x59a083){return _0x59a083[_0x965c('0x11e')](_0x965c('0x9b'))===_0x965c('0x11f');}),function(_0xb973af){return db['UserVoiceQueueRt'][_0x965c('0xac')]({'membername':_0x45099a[_0x965c('0x3a')],'UserId':_0x45099a['id'],'queue_name':_0xb973af[_0x965c('0x3a')],'VoiceQueueId':_0xb973af['id'],'interface':_[_0x965c('0x6e')](_0x45099a[_0x965c('0xaa')])?util[_0x965c('0xec')](_0x965c('0xef'),_0x45099a[_0x965c('0x3a')]):_0x45099a[_0x965c('0xaa')],'paused':_0x45099a['voicePause']||![],'penalty':_0x45099a[_0x965c('0xa5')]},{'transaction':_0x2904c8});});}else{return;}})[_0x965c('0x16')](function(){for(var _0x3cd8a3=0x0;_0x3cd8a3<_0x4a5a2b[_0x965c('0x6d')];_0x3cd8a3++){var _0x353d9d=_0x4a5a2b[_0x3cd8a3]['getDataValue']('channel');var _0x2df596=_0x353d9d+_0x965c('0xa6');socket[_0x965c('0xa7')](_0x965c('0x2e')+_0x353d9d+'Queue:save',{'UserId':_0x45099a['id'],['queueField']:_0x4a5a2b[_0x3cd8a3]['id']});}});});});}});}})[_0x965c('0x16')](respondWithStatusCode(_0x54b52a,null))[_0x965c('0x20')](handleError(_0x54b52a,null));};exports[_0x965c('0x120')]=function(_0x36bef9,_0x12dcc2){return db[_0x965c('0x3d')][_0x965c('0xc8')]({'where':{'id':_0x36bef9[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x12dcc2,null))[_0x965c('0x16')](function(_0x2abbf7){if(_0x2abbf7){var _0x4a377e=_0x2abbf7[_0x965c('0x2a')]({'plain':!![]});var _0x2495c6=_0x36bef9[_0x965c('0x45')]['ids'];return _0x2abbf7['removeTeams'](_0x2495c6)[_0x965c('0x16')](function(){for(var _0x5a46a4=0x0;_0x5a46a4<_0x2495c6[_0x965c('0x6d')];_0x5a46a4++){var _0x5cffe1=[];db[_0x965c('0x113')][_0x965c('0xc8')]({'where':{'id':_0x2495c6[_0x5a46a4]}})[_0x965c('0x16')](function(_0xb00317){_0x5cffe1['push'](_0xb00317['getVoiceQueues']()[_0x965c('0x16')](function(_0x4655fe){for(var _0x43f7dc=0x0;_0x43f7dc<_0x4655fe['length'];_0x43f7dc++){_0x4655fe[_0x43f7dc][_0x965c('0x114')](_0x965c('0x9b'),_0x965c('0x11f'));}return _0x4655fe;}));_0x5cffe1[_0x965c('0x49')](_0xb00317[_0x965c('0x121')]()[_0x965c('0x16')](function(_0x4e106f){for(var _0x33b69c=0x0;_0x33b69c<_0x4e106f[_0x965c('0x6d')];_0x33b69c++){_0x4e106f[_0x33b69c][_0x965c('0x114')](_0x965c('0x9b'),_0x965c('0x115'));}return _0x4e106f;}));_0x5cffe1[_0x965c('0x49')](_0xb00317['getMailQueues']()['then'](function(_0x3c7fe5){for(var _0x5aa553=0x0;_0x5aa553<_0x3c7fe5[_0x965c('0x6d')];_0x5aa553++){_0x3c7fe5[_0x5aa553]['setDataValue'](_0x965c('0x9b'),_0x965c('0x117'));}return _0x3c7fe5;}));_0x5cffe1[_0x965c('0x49')](_0xb00317['getSmsQueues']()[_0x965c('0x16')](function(_0x4203e7){for(var _0x4416a9=0x0;_0x4416a9<_0x4203e7[_0x965c('0x6d')];_0x4416a9++){_0x4203e7[_0x4416a9][_0x965c('0x114')](_0x965c('0x9b'),_0x965c('0x118'));}return _0x4203e7;}));_0x5cffe1[_0x965c('0x49')](_0xb00317['getWhatsappQueues']()['then'](function(_0x1143ce){for(var _0x5f5c51=0x0;_0x5f5c51<_0x1143ce['length'];_0x5f5c51++){_0x1143ce[_0x5f5c51][_0x965c('0x114')]('channel',_0x965c('0x122'));}return _0x1143ce;}));_0x5cffe1['push'](_0xb00317[_0x965c('0x11a')]()[_0x965c('0x16')](function(_0x3144f9){for(var _0x297de8=0x0;_0x297de8<_0x3144f9['length'];_0x297de8++){_0x3144f9[_0x297de8][_0x965c('0x114')](_0x965c('0x9b'),_0x965c('0x123'));}return _0x3144f9;}));_0x5cffe1['push'](_0xb00317[_0x965c('0x11b')]()[_0x965c('0x16')](function(_0x1c60c5){for(var _0x577686=0x0;_0x577686<_0x1c60c5[_0x965c('0x6d')];_0x577686++){_0x1c60c5[_0x577686][_0x965c('0x114')](_0x965c('0x9b'),_0x965c('0x124'));}return _0x1c60c5;}));return BPromise['all'](_0x5cffe1);})[_0x965c('0x16')](function(_0x36ff39){var _0x271af5=_[_0x965c('0x11c')](_0x36ff39);_0x5cffe1=[];return db[_0x965c('0x6a')][_0x965c('0x11d')](function(_0x427588){for(var _0x251093=0x0;_0x251093<_0x271af5['length'];_0x251093++){_0x5cffe1['push'](_0x271af5[_0x251093][_0x965c('0x125')](_0x4a377e['id']),{'transaction':_0x427588});}return BPromise[_0x965c('0x5e')](_0x5cffe1)['then'](function(){if(_0x4a377e['online']){return BPromise[_0x965c('0xab')](_['filter'](_0x271af5,function(_0x43c75c){return _0x43c75c[_0x965c('0x11e')](_0x965c('0x9b'))==='Voice';}),function(_0x2c16c9){return db['UserVoiceQueueRt'][_0x965c('0x29')]({'where':{'VoiceQueueId':_0x2c16c9['id'],'UserId':_0x4a377e['id']},'transaction':_0x427588});});}else{return;}})[_0x965c('0x16')](function(){for(var _0xddbaa0=0x0;_0xddbaa0<_0x271af5[_0x965c('0x6d')];_0xddbaa0++){var _0x518cdb=_0x271af5[_0xddbaa0]['getDataValue'](_0x965c('0x9b'));var _0x439a44=_0x518cdb+_0x965c('0xa6');socket[_0x965c('0xa7')](_0x965c('0x2e')+_0x518cdb+'Queue:remove',{'UserId':_0x4a377e['id'],['queueField']:_0x271af5[_0xddbaa0]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x12dcc2,null))[_0x965c('0x20')](handleError(_0x12dcc2,null));};exports['getLists']=function(_0x288387,_0x31b507){var _0x29c95e={};var _0x1f4d8c={};var _0x3cf691;var _0x566993;return db['User'][_0x965c('0xc8')]({'where':{'id':_0x288387[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x31b507,null))[_0x965c('0x16')](function(_0x439228){if(_0x439228){_0x3cf691=_0x439228;_0x1f4d8c[_0x965c('0x55')]=_[_0x965c('0x57')](db[_0x965c('0xcd')]['rawAttributes']);_0x1f4d8c[_0x965c('0x45')]=_[_0x965c('0x57')](_0x288387[_0x965c('0x45')]);_0x1f4d8c[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x1f4d8c[_0x965c('0x55')],_0x1f4d8c[_0x965c('0x45')]);_0x29c95e['attributes']=_['intersection'](_0x1f4d8c['model'],qs[_0x965c('0x5b')](_0x288387[_0x965c('0x45')][_0x965c('0x5b')]));_0x29c95e[_0x965c('0x48')]=_0x29c95e[_0x965c('0x48')][_0x965c('0x6d')]?_0x29c95e[_0x965c('0x48')]:_0x1f4d8c[_0x965c('0x55')];_0x29c95e['order']=qs[_0x965c('0xcb')](_0x288387[_0x965c('0x45')][_0x965c('0xcb')]);_0x29c95e['where']=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0x288387['query'],_0x1f4d8c[_0x965c('0x59')]));if(_0x288387[_0x965c('0x45')][_0x965c('0x31')]){_0x29c95e['where']=_[_0x965c('0x5c')](_0x29c95e[_0x965c('0x44')],{'$or':_['map'](_0x29c95e[_0x965c('0x48')],function(_0x401959){var _0x27e289={};_0x27e289[_0x401959]={'$like':'%'+_0x288387[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x27e289;})});}_0x29c95e=_[_0x965c('0x5c')]({},_0x29c95e,_0x288387[_0x965c('0x5d')]);return _0x3cf691[_0x965c('0x126')](_0x29c95e);}})[_0x965c('0x16')](function(_0x42aab7){if(_0x42aab7){_0x566993=_0x42aab7[_0x965c('0x6d')];if(!_0x288387[_0x965c('0x45')][_0x965c('0xcc')]('nolimit')){_0x29c95e['limit']=qs[_0x965c('0xd4')](_0x288387[_0x965c('0x45')][_0x965c('0xd4')]);_0x29c95e[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x288387[_0x965c('0x45')][_0x965c('0x24')]);}return _0x3cf691[_0x965c('0x126')](_0x29c95e);}})['then'](function(_0x1ee545){if(_0x1ee545){return _0x1ee545?{'count':_0x566993,'rows':_0x1ee545}:null;}})['then'](respondWithResult(_0x31b507,null))['catch'](handleError(_0x31b507,null));};exports[_0x965c('0x127')]=function(_0xee06f2,_0x452f49){var _0x16e6e9={};var _0x1fb87c={};var _0x767971;var _0x5642a4;return db['User'][_0x965c('0xc8')]({'where':{'id':_0xee06f2[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x452f49,null))[_0x965c('0x16')](function(_0x4b190d){if(_0x4b190d){_0x767971=_0x4b190d;_0x1fb87c['model']=_[_0x965c('0x57')](db[_0x965c('0x3d')][_0x965c('0x58')]);_0x1fb87c['query']=_['keys'](_0xee06f2[_0x965c('0x45')]);_0x1fb87c[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x1fb87c[_0x965c('0x55')],_0x1fb87c[_0x965c('0x45')]);_0x16e6e9[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x1fb87c['model'],qs[_0x965c('0x5b')](_0xee06f2[_0x965c('0x45')][_0x965c('0x5b')]));_0x16e6e9[_0x965c('0x48')]=_0x16e6e9[_0x965c('0x48')]['length']?_0x16e6e9[_0x965c('0x48')]:_0x1fb87c[_0x965c('0x55')];_0x16e6e9['order']=qs[_0x965c('0xcb')](_0xee06f2['query']['sort']);_0x16e6e9[_0x965c('0x44')]=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0xee06f2[_0x965c('0x45')],_0x1fb87c['filters']));if(_0xee06f2[_0x965c('0x45')][_0x965c('0x31')]){_0x16e6e9['where']=_[_0x965c('0x5c')](_0x16e6e9[_0x965c('0x44')],{'$or':_['map'](_0x16e6e9[_0x965c('0x48')],function(_0x1a3453){var _0x66f8ad={};_0x66f8ad[_0x1a3453]={'$like':'%'+_0xee06f2['query'][_0x965c('0x31')]+'%'};return _0x66f8ad;})});}_0x16e6e9[_0x965c('0x55')]=db[_0x965c('0x3d')];_0x16e6e9['as']=_0x965c('0x2f');_0x16e6e9=_['merge']({},_0x16e6e9,_0xee06f2[_0x965c('0x5d')]);return _0x767971[_0x965c('0xf6')]({'include':[_0x16e6e9]});}})['then'](function(_0x768a2f){if(_0x768a2f){var _0x345034={},_0x52b6bd=[],_0x39d2ef=0x0;for(var _0x34d62b=0x0;_0x34d62b<_0x768a2f[_0x965c('0x6d')];_0x34d62b+=0x1){for(var _0x238ddc=0x0,_0xb1b404;_0x238ddc<_0x768a2f[_0x34d62b][_0x965c('0x2f')][_0x965c('0x6d')];_0x238ddc+=0x1){_0xb1b404=_0x768a2f[_0x34d62b][_0x965c('0x2f')][_0x238ddc][_0x965c('0x2a')]({'plain':!![]});_0x345034[_0xb1b404['id']]=_0xb1b404;}}_0x345034=_[_0x965c('0x128')](_0x345034);for(var _0x30e860=qs[_0x965c('0x24')](_0xee06f2['query'][_0x965c('0x24')]);_0x30e860<_0x345034['length']&&_0x52b6bd[_0x965c('0x6d')]<qs['limit'](_0xee06f2[_0x965c('0x45')][_0x965c('0xd4')]);_0x30e860+=0x1){if(_0x345034[_0x30e860]){_0x52b6bd['push'](_0x345034[_0x30e860]);}}return{'count':_0x345034[_0x965c('0x6d')],'rows':_0x52b6bd};}})[_0x965c('0x16')](respondWithResult(_0x452f49,null))[_0x965c('0x20')](handleError(_0x452f49,null));};exports['destroy']=function(_0x39512f,_0x37d36c){if(_0x39512f[_0x965c('0x2e')]['id']==_0x39512f[_0x965c('0x60')]['id']){return _0x37d36c['status'](0x1f4)['send']({'message':_0x965c('0x129')});}return db[_0x965c('0x3d')]['find']({'where':{'id':_0x39512f['params']['id']}})['then'](handleEntityNotFound(_0x37d36c,null))['then'](removeEntity(_0x37d36c,null))[_0x965c('0x20')](handleError(_0x37d36c,null));};exports[_0x965c('0x12a')]=function(_0x34b69a,_0x195ddc){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x34b69a['params']['id']}})['then'](handleEntityNotFound(_0x195ddc,null))[_0x965c('0x16')](function(_0x21947a){if(_0x21947a){return _0x21947a['addChatInteractions'](_0x34b69a[_0x965c('0x5f')][_0x965c('0x64')],_['omit'](_0x34b69a['body'],[_0x965c('0x64'),'id'])||{})['spread'](function(){for(var _0x5dd4b3=0x0;_0x5dd4b3<_0x34b69a[_0x965c('0x5f')][_0x965c('0x64')]['length'];_0x5dd4b3+=0x1){socket[_0x965c('0xa7')]('user_has_chat_interactions:save',{'ChatInteractionId':Number(_0x34b69a['body'][_0x965c('0x64')][_0x5dd4b3]),'UserId':Number(_0x34b69a[_0x965c('0x60')]['id'])});}return _0x34b69a[_0x965c('0x5f')]['ids'];});}})[_0x965c('0x16')](respondWithResult(_0x195ddc,null))[_0x965c('0x20')](handleError(_0x195ddc,null));};exports[_0x965c('0x12b')]=function(_0x507283,_0x41f239){return db['User'][_0x965c('0x36')]({'where':{'id':_0x507283[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x41f239,null))[_0x965c('0x16')](function(_0x1b2c4a){if(_0x1b2c4a){return _0x1b2c4a['removeChatInteractions'](_0x507283['query']['ids'])['then'](function(){if(_['isArray'](_0x507283[_0x965c('0x45')][_0x965c('0x64')])){for(var _0x17f13f=0x0;_0x17f13f<_0x507283['query']['ids']['length'];_0x17f13f+=0x1){socket[_0x965c('0xa7')](_0x965c('0x12c'),{'ChatInteractionId':Number(_0x507283[_0x965c('0x45')]['ids'][_0x17f13f]),'UserId':Number(_0x507283[_0x965c('0x60')]['id'])});}}else{socket['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x507283['query'][_0x965c('0x64')]),'UserId':Number(_0x507283['params']['id'])});}});}})[_0x965c('0x16')](respondWithStatusCode(_0x41f239,null))[_0x965c('0x20')](handleError(_0x41f239,null));};exports[_0x965c('0x12d')]=function(_0x2cb7be,_0x491d89){return db[_0x965c('0x3d')]['find']({'where':{'id':_0x2cb7be['params']['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x491d89,null))[_0x965c('0x16')](function(_0x48a2b9){if(_0x48a2b9){return _0x48a2b9[_0x965c('0x12d')](_0x2cb7be[_0x965c('0x5f')][_0x965c('0x64')],_[_0x965c('0x63')](_0x2cb7be['body'],[_0x965c('0x64'),'id'])||{})[_0x965c('0x12e')](function(){for(var _0x3a5f81=0x0;_0x3a5f81<_0x2cb7be[_0x965c('0x5f')][_0x965c('0x64')][_0x965c('0x6d')];_0x3a5f81+=0x1){socket['emit'](_0x965c('0x12f'),{'MailInteractionId':Number(_0x2cb7be[_0x965c('0x5f')][_0x965c('0x64')][_0x3a5f81]),'UserId':Number(_0x2cb7be[_0x965c('0x60')]['id'])});}return _0x2cb7be[_0x965c('0x5f')][_0x965c('0x64')];});}})[_0x965c('0x16')](respondWithResult(_0x491d89,null))[_0x965c('0x20')](handleError(_0x491d89,null));};exports[_0x965c('0x130')]=function(_0xb29f8e,_0x4641d9){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0xb29f8e[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0x4641d9,null))[_0x965c('0x16')](function(_0x22534f){if(_0x22534f){return _0x22534f['removeMailInteractions'](_0xb29f8e[_0x965c('0x45')][_0x965c('0x64')])[_0x965c('0x16')](function(){if(_[_0x965c('0x131')](_0xb29f8e[_0x965c('0x45')]['ids'])){for(var _0x178dae=0x0;_0x178dae<_0xb29f8e[_0x965c('0x45')]['ids'][_0x965c('0x6d')];_0x178dae+=0x1){socket['emit']('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xb29f8e[_0x965c('0x45')][_0x965c('0x64')][_0x178dae]),'UserId':Number(_0xb29f8e[_0x965c('0x60')]['id'])});}}else{socket['emit'](_0x965c('0x132'),{'MailInteractionId':Number(_0xb29f8e[_0x965c('0x45')]['ids']),'UserId':Number(_0xb29f8e[_0x965c('0x60')]['id'])});}});}})[_0x965c('0x16')](respondWithStatusCode(_0x4641d9,null))[_0x965c('0x20')](handleError(_0x4641d9,null));};exports['addFaxInteractions']=function(_0x39d52f,_0x321577){return db[_0x965c('0x3d')]['find']({'where':{'id':_0x39d52f[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x321577,null))[_0x965c('0x16')](function(_0x382892){if(_0x382892){return _0x382892[_0x965c('0x133')](_0x39d52f[_0x965c('0x5f')][_0x965c('0x64')],_[_0x965c('0x63')](_0x39d52f['body'],['ids','id'])||{})['spread'](function(){for(var _0x2db960=0x0;_0x2db960<_0x39d52f[_0x965c('0x5f')][_0x965c('0x64')]['length'];_0x2db960+=0x1){socket['emit'](_0x965c('0x134'),{'FaxInteractionId':Number(_0x39d52f[_0x965c('0x5f')][_0x965c('0x64')][_0x2db960]),'UserId':Number(_0x39d52f[_0x965c('0x60')]['id'])});}return _0x39d52f[_0x965c('0x5f')]['ids'];});}})['then'](respondWithResult(_0x321577,null))[_0x965c('0x20')](handleError(_0x321577,null));};exports['removeFaxInteractions']=function(_0x24fab6,_0x579fb1){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x24fab6[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x579fb1,null))[_0x965c('0x16')](function(_0x22dbe2){if(_0x22dbe2){return _0x22dbe2[_0x965c('0x135')](_0x24fab6[_0x965c('0x45')]['ids'])[_0x965c('0x16')](function(){if(_[_0x965c('0x131')](_0x24fab6['query'][_0x965c('0x64')])){for(var _0x1ad8d4=0x0;_0x1ad8d4<_0x24fab6[_0x965c('0x45')][_0x965c('0x64')][_0x965c('0x6d')];_0x1ad8d4+=0x1){socket[_0x965c('0xa7')](_0x965c('0x136'),{'FaxInteractionId':Number(_0x24fab6[_0x965c('0x45')][_0x965c('0x64')][_0x1ad8d4]),'UserId':Number(_0x24fab6[_0x965c('0x60')]['id'])});}}else{socket[_0x965c('0xa7')](_0x965c('0x136'),{'FaxInteractionId':Number(_0x24fab6[_0x965c('0x45')][_0x965c('0x64')]),'UserId':Number(_0x24fab6[_0x965c('0x60')]['id'])});}});}})[_0x965c('0x16')](respondWithStatusCode(_0x579fb1,null))[_0x965c('0x20')](handleError(_0x579fb1,null));};exports[_0x965c('0x137')]=function(_0x4e2421,_0x17677b){return db[_0x965c('0x3d')]['find']({'where':{'id':_0x4e2421['params']['id']}})['then'](handleEntityNotFound(_0x17677b,null))[_0x965c('0x16')](function(_0x1e0494){if(_0x1e0494){return _0x1e0494[_0x965c('0x137')](_0x4e2421['body'][_0x965c('0x64')],_[_0x965c('0x63')](_0x4e2421['body'],['ids','id'])||{})[_0x965c('0x12e')](function(){for(var _0x24f82a=0x0;_0x24f82a<_0x4e2421[_0x965c('0x5f')][_0x965c('0x64')][_0x965c('0x6d')];_0x24f82a+=0x1){socket[_0x965c('0xa7')](_0x965c('0x138'),{'SmsInteractionId':Number(_0x4e2421[_0x965c('0x5f')]['ids'][_0x24f82a]),'UserId':Number(_0x4e2421[_0x965c('0x60')]['id'])});}return _0x4e2421[_0x965c('0x5f')][_0x965c('0x64')];});}})[_0x965c('0x16')](respondWithResult(_0x17677b,null))[_0x965c('0x20')](handleError(_0x17677b,null));};exports[_0x965c('0x139')]=function(_0x1d1762,_0x1ca604){return db['User']['find']({'where':{'id':_0x1d1762[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x1ca604,null))['then'](function(_0x482dd7){if(_0x482dd7){return _0x482dd7[_0x965c('0x139')](_0x1d1762[_0x965c('0x45')][_0x965c('0x64')])[_0x965c('0x16')](function(){if(_[_0x965c('0x131')](_0x1d1762[_0x965c('0x45')][_0x965c('0x64')])){for(var _0x557f85=0x0;_0x557f85<_0x1d1762[_0x965c('0x45')]['ids'][_0x965c('0x6d')];_0x557f85+=0x1){socket[_0x965c('0xa7')](_0x965c('0x13a'),{'SmsInteractionId':Number(_0x1d1762[_0x965c('0x45')][_0x965c('0x64')][_0x557f85]),'UserId':Number(_0x1d1762[_0x965c('0x60')]['id'])});}}else{socket[_0x965c('0xa7')](_0x965c('0x13a'),{'SmsInteractionId':Number(_0x1d1762[_0x965c('0x45')][_0x965c('0x64')]),'UserId':Number(_0x1d1762[_0x965c('0x60')]['id'])});}});}})[_0x965c('0x16')](respondWithStatusCode(_0x1ca604,null))[_0x965c('0x20')](handleError(_0x1ca604,null));};exports[_0x965c('0x13b')]=function(_0x4b772a,_0x147e9f){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x4b772a['params']['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x147e9f,null))[_0x965c('0x16')](function(_0x54d2b7){if(_0x54d2b7){return _0x54d2b7[_0x965c('0x13b')](_0x4b772a[_0x965c('0x5f')][_0x965c('0x64')],_[_0x965c('0x63')](_0x4b772a[_0x965c('0x5f')],[_0x965c('0x64'),'id'])||{})[_0x965c('0x12e')](function(){for(var _0x47678e=0x0;_0x47678e<_0x4b772a[_0x965c('0x5f')][_0x965c('0x64')][_0x965c('0x6d')];_0x47678e+=0x1){socket[_0x965c('0xa7')](_0x965c('0x13c'),{'OpenchannelInteractionId':Number(_0x4b772a[_0x965c('0x5f')][_0x965c('0x64')][_0x47678e]),'UserId':Number(_0x4b772a['params']['id'])});}return _0x4b772a[_0x965c('0x5f')][_0x965c('0x64')];});}})[_0x965c('0x16')](respondWithResult(_0x147e9f,null))[_0x965c('0x20')](handleError(_0x147e9f,null));};exports[_0x965c('0x13d')]=function(_0x5e47cb,_0x4499dc){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x5e47cb['params']['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x4499dc,null))[_0x965c('0x16')](function(_0x3d2452){if(_0x3d2452){return _0x3d2452[_0x965c('0x13d')](_0x5e47cb[_0x965c('0x45')][_0x965c('0x64')])[_0x965c('0x16')](function(){if(_[_0x965c('0x131')](_0x5e47cb['query'][_0x965c('0x64')])){for(var _0x2fb42e=0x0;_0x2fb42e<_0x5e47cb[_0x965c('0x45')][_0x965c('0x64')]['length'];_0x2fb42e+=0x1){socket[_0x965c('0xa7')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x5e47cb['query']['ids'][_0x2fb42e]),'UserId':Number(_0x5e47cb[_0x965c('0x60')]['id'])});}}else{socket[_0x965c('0xa7')](_0x965c('0x13e'),{'OpenchannelInteractionId':Number(_0x5e47cb['query'][_0x965c('0x64')]),'UserId':Number(_0x5e47cb['params']['id'])});}});}})[_0x965c('0x16')](respondWithStatusCode(_0x4499dc,null))['catch'](handleError(_0x4499dc,null));};exports[_0x965c('0x13f')]=function(_0x21f02c,_0x199bf4){return db[_0x965c('0x3d')]['find']({'where':{'id':_0x21f02c[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x199bf4,null))[_0x965c('0x16')](function(_0x4806f8){if(_0x4806f8){return _0x4806f8[_0x965c('0x13f')](_0x21f02c[_0x965c('0x5f')][_0x965c('0x64')],_['omit'](_0x21f02c[_0x965c('0x5f')],[_0x965c('0x64'),'id'])||{})[_0x965c('0x12e')](function(){for(var _0x17b0f2=0x0;_0x17b0f2<_0x21f02c['body'][_0x965c('0x64')]['length'];_0x17b0f2+=0x1){socket[_0x965c('0xa7')](_0x965c('0x140'),{'WhatsappInteractionId':Number(_0x21f02c[_0x965c('0x5f')][_0x965c('0x64')][_0x17b0f2]),'UserId':Number(_0x21f02c[_0x965c('0x60')]['id'])});}return _0x21f02c[_0x965c('0x5f')][_0x965c('0x64')];});}})[_0x965c('0x16')](respondWithResult(_0x199bf4,null))['catch'](handleError(_0x199bf4,null));};exports[_0x965c('0x141')]=function(_0x4ecfcc,_0x331ec1){return db['User']['find']({'where':{'id':_0x4ecfcc[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0x331ec1,null))['then'](function(_0x4c76f8){if(_0x4c76f8){return _0x4c76f8[_0x965c('0x141')](_0x4ecfcc[_0x965c('0x45')]['ids']);}})[_0x965c('0x16')](respondWithStatusCode(_0x331ec1,null))[_0x965c('0x20')](handleError(_0x331ec1,null));};exports[_0x965c('0x142')]=function(_0x28d2af,_0x25e811){var _0x1f0192={};var _0x346d9d={};var _0x32ae13;var _0x36e430;return db[_0x965c('0x3d')][_0x965c('0xc8')]({'where':{'id':_0x28d2af['params']['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x25e811,null))[_0x965c('0x16')](function(_0x71e3d8){if(_0x71e3d8){_0x32ae13=_0x71e3d8;_0x346d9d[_0x965c('0x55')]=_['keys'](db[_0x965c('0x143')][_0x965c('0x58')]);_0x346d9d['query']=_[_0x965c('0x57')](_0x28d2af[_0x965c('0x45')]);_0x346d9d[_0x965c('0x59')]=_['intersection'](_0x346d9d[_0x965c('0x55')],_0x346d9d[_0x965c('0x45')]);_0x1f0192['attributes']=_[_0x965c('0x5a')](_0x346d9d['model'],qs[_0x965c('0x5b')](_0x28d2af[_0x965c('0x45')][_0x965c('0x5b')]));_0x1f0192[_0x965c('0x48')]=_0x1f0192[_0x965c('0x48')][_0x965c('0x6d')]?_0x1f0192[_0x965c('0x48')]:_0x346d9d[_0x965c('0x55')];_0x1f0192['order']=qs[_0x965c('0xcb')](_0x28d2af[_0x965c('0x45')][_0x965c('0xcb')]);_0x1f0192[_0x965c('0x44')]=qs['filters'](_[_0x965c('0xd7')](_0x28d2af[_0x965c('0x45')],_0x346d9d[_0x965c('0x59')]));if(_0x28d2af[_0x965c('0x45')][_0x965c('0x31')]){_0x1f0192[_0x965c('0x44')]=_[_0x965c('0x5c')](_0x1f0192[_0x965c('0x44')],{'$or':_[_0x965c('0x33')](_0x1f0192['attributes'],function(_0x4dcf36){var _0x5c9600={};_0x5c9600[_0x4dcf36]={'$like':'%'+_0x28d2af[_0x965c('0x45')]['filter']+'%'};return _0x5c9600;})});}_0x1f0192=_['merge']({},_0x1f0192,_0x28d2af['options']);return _0x32ae13[_0x965c('0x142')](_0x1f0192);}})['then'](function(_0xe9906b){if(_0xe9906b){_0x36e430=_0xe9906b['length'];if(!_0x28d2af['query'][_0x965c('0xcc')](_0x965c('0xd3'))){_0x1f0192[_0x965c('0xd4')]=qs[_0x965c('0xd4')](_0x28d2af[_0x965c('0x45')][_0x965c('0xd4')]);_0x1f0192['offset']=qs[_0x965c('0x24')](_0x28d2af[_0x965c('0x45')]['offset']);}return _0x32ae13[_0x965c('0x142')](_0x1f0192);}})[_0x965c('0x16')](function(_0x443854){if(_0x443854){return _0x443854?{'count':_0x36e430,'rows':_0x443854}:null;}})[_0x965c('0x16')](respondWithResult(_0x25e811,null))['catch'](handleError(_0x25e811,null));};exports[_0x965c('0x144')]=function(_0x4bc83a,_0x589ea1){var _0x2e0f11={};var _0x2a4769={};var _0x5cb597;var _0x2cb37b;return db[_0x965c('0x3d')]['findOne']({'where':{'id':_0x4bc83a[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x589ea1,null))[_0x965c('0x16')](function(_0x26f62a){if(_0x26f62a){_0x5cb597=_0x26f62a;_0x2a4769[_0x965c('0x55')]=_[_0x965c('0x57')](db[_0x965c('0x145')][_0x965c('0x58')]);_0x2a4769['query']=_[_0x965c('0x57')](_0x4bc83a['query']);_0x2a4769['filters']=_[_0x965c('0x5a')](_0x2a4769['model'],_0x2a4769[_0x965c('0x45')]);_0x2e0f11['attributes']=_[_0x965c('0x5a')](_0x2a4769['model'],qs['fields'](_0x4bc83a[_0x965c('0x45')][_0x965c('0x5b')]));_0x2e0f11[_0x965c('0x48')]=_0x2e0f11[_0x965c('0x48')][_0x965c('0x6d')]?_0x2e0f11[_0x965c('0x48')]:_0x2a4769[_0x965c('0x55')];_0x2e0f11['order']=qs[_0x965c('0xcb')](_0x4bc83a['query'][_0x965c('0xcb')]);_0x2e0f11[_0x965c('0x44')]=qs['filters'](_[_0x965c('0xd7')](_0x4bc83a[_0x965c('0x45')],_0x2a4769[_0x965c('0x59')]));if(_0x4bc83a[_0x965c('0x45')]['filter']){_0x2e0f11[_0x965c('0x44')]=_['merge'](_0x2e0f11['where'],{'$or':_['map'](_0x2e0f11[_0x965c('0x48')],function(_0x626b97){var _0x571290={};_0x571290[_0x626b97]={'$like':'%'+_0x4bc83a[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x571290;})});}_0x2e0f11=_[_0x965c('0x5c')]({},_0x2e0f11,_0x4bc83a[_0x965c('0x5d')]);return _0x5cb597[_0x965c('0x144')](_0x2e0f11);}})[_0x965c('0x16')](function(_0x2bfd9e){if(_0x2bfd9e){_0x2cb37b=_0x2bfd9e[_0x965c('0x6d')];if(!_0x4bc83a[_0x965c('0x45')][_0x965c('0xcc')]('nolimit')){_0x2e0f11[_0x965c('0xd4')]=qs['limit'](_0x4bc83a[_0x965c('0x45')][_0x965c('0xd4')]);_0x2e0f11[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x4bc83a[_0x965c('0x45')][_0x965c('0x24')]);}return _0x5cb597[_0x965c('0x144')](_0x2e0f11);}})[_0x965c('0x16')](function(_0x45cf6b){if(_0x45cf6b){return _0x45cf6b?{'count':_0x2cb37b,'rows':_0x45cf6b}:null;}})['then'](respondWithResult(_0x589ea1,null))[_0x965c('0x20')](handleError(_0x589ea1,null));};exports['addFaxAccounts']=function(_0x314c9c,_0x162e8e){return db['User'][_0x965c('0x36')]({'where':{'id':_0x314c9c['params']['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x162e8e,null))[_0x965c('0x16')](function(_0x6811a1){if(_0x6811a1){return _0x6811a1[_0x965c('0x146')](_0x314c9c[_0x965c('0x5f')]['ids'],_['omit'](_0x314c9c[_0x965c('0x5f')],[_0x965c('0x64'),'id'])||{});}})[_0x965c('0x16')](respondWithResult(_0x162e8e,null))[_0x965c('0x20')](handleError(_0x162e8e,null));};exports['removeFaxAccounts']=function(_0x41de8c,_0x4a9065){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x41de8c['params']['id']}})['then'](handleEntityNotFound(_0x4a9065,null))[_0x965c('0x16')](function(_0x16b273){if(_0x16b273){return _0x16b273['removeFaxAccounts'](_0x41de8c[_0x965c('0x45')][_0x965c('0x64')]);}})[_0x965c('0x16')](respondWithStatusCode(_0x4a9065,null))[_0x965c('0x20')](handleError(_0x4a9065,null));};exports[_0x965c('0x147')]=function(_0x2d69ab,_0xe43d03){var _0x3db02b={};var _0x2ca568={};var _0x96326e;var _0x361ede;return db[_0x965c('0x3d')][_0x965c('0xc8')]({'where':{'id':_0x2d69ab[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0xe43d03,null))[_0x965c('0x16')](function(_0x17d518){if(_0x17d518){_0x96326e=_0x17d518;_0x2ca568[_0x965c('0x55')]=_['keys'](db[_0x965c('0x148')][_0x965c('0x58')]);_0x2ca568[_0x965c('0x45')]=_['keys'](_0x2d69ab[_0x965c('0x45')]);_0x2ca568[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x2ca568[_0x965c('0x55')],_0x2ca568[_0x965c('0x45')]);_0x3db02b['attributes']=_[_0x965c('0x5a')](_0x2ca568[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x2d69ab[_0x965c('0x45')][_0x965c('0x5b')]));_0x3db02b[_0x965c('0x48')]=_0x3db02b[_0x965c('0x48')][_0x965c('0x6d')]?_0x3db02b[_0x965c('0x48')]:_0x2ca568[_0x965c('0x55')];_0x3db02b[_0x965c('0xca')]=qs[_0x965c('0xcb')](_0x2d69ab['query'][_0x965c('0xcb')]);_0x3db02b['where']=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0x2d69ab['query'],_0x2ca568[_0x965c('0x59')]));if(_0x2d69ab['query'][_0x965c('0x31')]){_0x3db02b[_0x965c('0x44')]=_[_0x965c('0x5c')](_0x3db02b['where'],{'$or':_[_0x965c('0x33')](_0x3db02b[_0x965c('0x48')],function(_0x231656){var _0x1e390f={};_0x1e390f[_0x231656]={'$like':'%'+_0x2d69ab[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x1e390f;})});}_0x3db02b=_[_0x965c('0x5c')]({},_0x3db02b,_0x2d69ab[_0x965c('0x5d')]);return _0x96326e[_0x965c('0x147')](_0x3db02b);}})['then'](function(_0x4ef137){if(_0x4ef137){_0x361ede=_0x4ef137['length'];if(!_0x2d69ab[_0x965c('0x45')][_0x965c('0xcc')]('nolimit')){_0x3db02b[_0x965c('0xd4')]=qs[_0x965c('0xd4')](_0x2d69ab['query'][_0x965c('0xd4')]);_0x3db02b['offset']=qs[_0x965c('0x24')](_0x2d69ab[_0x965c('0x45')][_0x965c('0x24')]);}return _0x96326e[_0x965c('0x147')](_0x3db02b);}})[_0x965c('0x16')](function(_0x3da927){if(_0x3da927){return _0x3da927?{'count':_0x361ede,'rows':_0x3da927}:null;}})[_0x965c('0x16')](respondWithResult(_0xe43d03,null))[_0x965c('0x20')](handleError(_0xe43d03,null));};exports[_0x965c('0x149')]=function(_0x5f3531,_0x23906c){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x5f3531[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x23906c,null))['then'](function(_0x5dfdad){if(_0x5dfdad){return _0x5dfdad['addMailAccounts'](_0x5f3531['body'][_0x965c('0x64')],_['omit'](_0x5f3531[_0x965c('0x5f')],[_0x965c('0x64'),'id'])||{});}})[_0x965c('0x16')](respondWithResult(_0x23906c,null))[_0x965c('0x20')](handleError(_0x23906c,null));};exports[_0x965c('0x14a')]=function(_0x4a6166,_0x3c7b1b){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x4a6166['params']['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x3c7b1b,null))[_0x965c('0x16')](function(_0x12d276){if(_0x12d276){return _0x12d276[_0x965c('0x14a')](_0x4a6166[_0x965c('0x45')][_0x965c('0x64')]);}})[_0x965c('0x16')](respondWithStatusCode(_0x3c7b1b,null))[_0x965c('0x20')](handleError(_0x3c7b1b,null));};exports[_0x965c('0x14b')]=function(_0x2da96e,_0xb3e305){var _0x1e2e03={};var _0x4cf9d7={};var _0x4c3cd2;var _0x255b0d;return db[_0x965c('0x3d')][_0x965c('0xc8')]({'where':{'id':_0x2da96e[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0xb3e305,null))[_0x965c('0x16')](function(_0x27da1b){if(_0x27da1b){_0x4c3cd2=_0x27da1b;_0x4cf9d7[_0x965c('0x55')]=_[_0x965c('0x57')](db['OpenchannelAccount'][_0x965c('0x58')]);_0x4cf9d7['query']=_[_0x965c('0x57')](_0x2da96e[_0x965c('0x45')]);_0x4cf9d7['filters']=_['intersection'](_0x4cf9d7[_0x965c('0x55')],_0x4cf9d7['query']);_0x1e2e03[_0x965c('0x48')]=_['intersection'](_0x4cf9d7[_0x965c('0x55')],qs['fields'](_0x2da96e['query'][_0x965c('0x5b')]));_0x1e2e03[_0x965c('0x48')]=_0x1e2e03[_0x965c('0x48')][_0x965c('0x6d')]?_0x1e2e03[_0x965c('0x48')]:_0x4cf9d7[_0x965c('0x55')];_0x1e2e03[_0x965c('0xca')]=qs[_0x965c('0xcb')](_0x2da96e[_0x965c('0x45')][_0x965c('0xcb')]);_0x1e2e03[_0x965c('0x44')]=qs['filters'](_['pick'](_0x2da96e[_0x965c('0x45')],_0x4cf9d7[_0x965c('0x59')]));if(_0x2da96e[_0x965c('0x45')][_0x965c('0x31')]){_0x1e2e03['where']=_[_0x965c('0x5c')](_0x1e2e03[_0x965c('0x44')],{'$or':_[_0x965c('0x33')](_0x1e2e03[_0x965c('0x48')],function(_0x34299b){var _0x452b57={};_0x452b57[_0x34299b]={'$like':'%'+_0x2da96e[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x452b57;})});}_0x1e2e03=_[_0x965c('0x5c')]({},_0x1e2e03,_0x2da96e['options']);return _0x4c3cd2[_0x965c('0x14b')](_0x1e2e03);}})[_0x965c('0x16')](function(_0x28b0da){if(_0x28b0da){_0x255b0d=_0x28b0da[_0x965c('0x6d')];if(!_0x2da96e[_0x965c('0x45')][_0x965c('0xcc')](_0x965c('0xd3'))){_0x1e2e03[_0x965c('0xd4')]=qs[_0x965c('0xd4')](_0x2da96e['query']['limit']);_0x1e2e03[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x2da96e['query'][_0x965c('0x24')]);}return _0x4c3cd2[_0x965c('0x14b')](_0x1e2e03);}})[_0x965c('0x16')](function(_0x1ceb1a){if(_0x1ceb1a){return _0x1ceb1a?{'count':_0x255b0d,'rows':_0x1ceb1a}:null;}})[_0x965c('0x16')](respondWithResult(_0xb3e305,null))[_0x965c('0x20')](handleError(_0xb3e305,null));};exports[_0x965c('0x14c')]=function(_0x4840d4,_0x306a08){return db['User'][_0x965c('0x36')]({'where':{'id':_0x4840d4[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x306a08,null))['then'](function(_0x3f83fc){if(_0x3f83fc){return _0x3f83fc[_0x965c('0x14c')](_0x4840d4[_0x965c('0x5f')][_0x965c('0x64')],_[_0x965c('0x63')](_0x4840d4[_0x965c('0x5f')],[_0x965c('0x64'),'id'])||{});}})[_0x965c('0x16')](respondWithResult(_0x306a08,null))[_0x965c('0x20')](handleError(_0x306a08,null));};exports[_0x965c('0x14d')]=function(_0x38ccd1,_0x5c7555){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x38ccd1[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x5c7555,null))[_0x965c('0x16')](function(_0x35942b){if(_0x35942b){return _0x35942b[_0x965c('0x14d')](_0x38ccd1[_0x965c('0x45')][_0x965c('0x64')]);}})[_0x965c('0x16')](respondWithStatusCode(_0x5c7555,null))[_0x965c('0x20')](handleError(_0x5c7555,null));};exports[_0x965c('0x14e')]=function(_0x4e2ffa,_0x518011){var _0x58199f={};var _0x3045e9={};var _0x5796fa;var _0x4c1ad5;return db['User']['findOne']({'where':{'id':_0x4e2ffa[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0x518011,null))[_0x965c('0x16')](function(_0x2e6d11){if(_0x2e6d11){_0x5796fa=_0x2e6d11;_0x3045e9['model']=_[_0x965c('0x57')](db[_0x965c('0x14f')]['rawAttributes']);_0x3045e9[_0x965c('0x45')]=_[_0x965c('0x57')](_0x4e2ffa[_0x965c('0x45')]);_0x3045e9[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x3045e9[_0x965c('0x55')],_0x3045e9['query']);_0x58199f[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x3045e9[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x4e2ffa[_0x965c('0x45')][_0x965c('0x5b')]));_0x58199f[_0x965c('0x48')]=_0x58199f[_0x965c('0x48')][_0x965c('0x6d')]?_0x58199f[_0x965c('0x48')]:_0x3045e9[_0x965c('0x55')];_0x58199f[_0x965c('0xca')]=qs['sort'](_0x4e2ffa['query'][_0x965c('0xcb')]);_0x58199f['where']=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0x4e2ffa[_0x965c('0x45')],_0x3045e9[_0x965c('0x59')]));if(_0x4e2ffa['query'][_0x965c('0x31')]){_0x58199f[_0x965c('0x44')]=_['merge'](_0x58199f['where'],{'$or':_[_0x965c('0x33')](_0x58199f['attributes'],function(_0x4e0fc7){var _0x91777a={};_0x91777a[_0x4e0fc7]={'$like':'%'+_0x4e2ffa[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x91777a;})});}_0x58199f=_['merge']({},_0x58199f,_0x4e2ffa[_0x965c('0x5d')]);return _0x5796fa['getSmsAccounts'](_0x58199f);}})[_0x965c('0x16')](function(_0x407eca){if(_0x407eca){_0x4c1ad5=_0x407eca[_0x965c('0x6d')];if(!_0x4e2ffa[_0x965c('0x45')]['hasOwnProperty'](_0x965c('0xd3'))){_0x58199f[_0x965c('0xd4')]=qs[_0x965c('0xd4')](_0x4e2ffa[_0x965c('0x45')][_0x965c('0xd4')]);_0x58199f['offset']=qs['offset'](_0x4e2ffa[_0x965c('0x45')][_0x965c('0x24')]);}return _0x5796fa[_0x965c('0x14e')](_0x58199f);}})['then'](function(_0xa6864c){if(_0xa6864c){return _0xa6864c?{'count':_0x4c1ad5,'rows':_0xa6864c}:null;}})[_0x965c('0x16')](respondWithResult(_0x518011,null))[_0x965c('0x20')](handleError(_0x518011,null));};exports[_0x965c('0x150')]=function(_0x28fb30,_0x26ddbb){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x28fb30[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x26ddbb,null))[_0x965c('0x16')](function(_0x3f4ebb){if(_0x3f4ebb){return _0x3f4ebb[_0x965c('0x150')](_0x28fb30['body'][_0x965c('0x64')],_[_0x965c('0x63')](_0x28fb30['body'],[_0x965c('0x64'),'id'])||{});}})[_0x965c('0x16')](respondWithResult(_0x26ddbb,null))[_0x965c('0x20')](handleError(_0x26ddbb,null));};exports[_0x965c('0x151')]=function(_0x3b4240,_0x1df6cf){return db[_0x965c('0x3d')]['find']({'where':{'id':_0x3b4240[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0x1df6cf,null))[_0x965c('0x16')](function(_0x3f6d87){if(_0x3f6d87){return _0x3f6d87[_0x965c('0x151')](_0x3b4240[_0x965c('0x45')][_0x965c('0x64')]);}})[_0x965c('0x16')](respondWithStatusCode(_0x1df6cf,null))['catch'](handleError(_0x1df6cf,null));};exports[_0x965c('0x152')]=function(_0x268b19,_0x2eec3d){var _0x3c93c7={};var _0x13e6c5={};var _0x5f108d;var _0xaad136;return db['User'][_0x965c('0xc8')]({'where':{'id':_0x268b19[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x2eec3d,null))[_0x965c('0x16')](function(_0x210eb4){if(_0x210eb4){_0x5f108d=_0x210eb4;_0x13e6c5['model']=_[_0x965c('0x57')](db[_0x965c('0x153')][_0x965c('0x58')]);_0x13e6c5['query']=_[_0x965c('0x57')](_0x268b19[_0x965c('0x45')]);_0x13e6c5[_0x965c('0x59')]=_['intersection'](_0x13e6c5[_0x965c('0x55')],_0x13e6c5[_0x965c('0x45')]);_0x3c93c7[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x13e6c5['model'],qs[_0x965c('0x5b')](_0x268b19[_0x965c('0x45')]['fields']));_0x3c93c7['attributes']=_0x3c93c7[_0x965c('0x48')]['length']?_0x3c93c7[_0x965c('0x48')]:_0x13e6c5[_0x965c('0x55')];_0x3c93c7['order']=qs['sort'](_0x268b19[_0x965c('0x45')][_0x965c('0xcb')]);_0x3c93c7[_0x965c('0x44')]=qs['filters'](_[_0x965c('0xd7')](_0x268b19[_0x965c('0x45')],_0x13e6c5[_0x965c('0x59')]));if(_0x268b19[_0x965c('0x45')]['filter']){_0x3c93c7['where']=_['merge'](_0x3c93c7[_0x965c('0x44')],{'$or':_['map'](_0x3c93c7['attributes'],function(_0x2208b8){var _0x57051c={};_0x57051c[_0x2208b8]={'$like':'%'+_0x268b19[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x57051c;})});}_0x3c93c7=_['merge']({},_0x3c93c7,_0x268b19[_0x965c('0x5d')]);return _0x5f108d['getChatWebsites'](_0x3c93c7);}})[_0x965c('0x16')](function(_0x2323df){if(_0x2323df){_0xaad136=_0x2323df[_0x965c('0x6d')];if(!_0x268b19[_0x965c('0x45')]['hasOwnProperty']('nolimit')){_0x3c93c7['limit']=qs['limit'](_0x268b19[_0x965c('0x45')][_0x965c('0xd4')]);_0x3c93c7[_0x965c('0x24')]=qs['offset'](_0x268b19['query'][_0x965c('0x24')]);}return _0x5f108d[_0x965c('0x152')](_0x3c93c7);}})[_0x965c('0x16')](function(_0x21748f){if(_0x21748f){return _0x21748f?{'count':_0xaad136,'rows':_0x21748f}:null;}})[_0x965c('0x16')](respondWithResult(_0x2eec3d,null))[_0x965c('0x20')](handleError(_0x2eec3d,null));};exports[_0x965c('0x154')]=function(_0x140b09,_0x4643cc){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x140b09['params']['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x4643cc,null))[_0x965c('0x16')](function(_0x579f76){if(_0x579f76){return _0x579f76[_0x965c('0x154')](_0x140b09[_0x965c('0x5f')][_0x965c('0x64')],_[_0x965c('0x63')](_0x140b09['body'],[_0x965c('0x64'),'id'])||{});}})[_0x965c('0x16')](respondWithResult(_0x4643cc,null))[_0x965c('0x20')](handleError(_0x4643cc,null));};exports[_0x965c('0x155')]=function(_0x3dfa8b,_0x4a393e){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x3dfa8b[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x4a393e,null))['then'](function(_0x151f76){if(_0x151f76){return _0x151f76['removeChatWebsites'](_0x3dfa8b[_0x965c('0x45')][_0x965c('0x64')]);}})['then'](respondWithStatusCode(_0x4a393e,null))['catch'](handleError(_0x4a393e,null));};exports[_0x965c('0x156')]=function(_0x4d99a0,_0x4766cf){var _0x3e678b={};var _0x76ea64={};var _0x52c372;var _0x4166d4;return db[_0x965c('0x3d')]['findOne']({'where':{'id':_0x4d99a0[_0x965c('0x60')]['id']}})['then'](handleEntityNotFound(_0x4766cf,null))[_0x965c('0x16')](function(_0x4fa41a){if(_0x4fa41a){_0x52c372=_0x4fa41a;_0x76ea64[_0x965c('0x55')]=_['keys'](db['WhatsappAccount'][_0x965c('0x58')]);_0x76ea64[_0x965c('0x45')]=_[_0x965c('0x57')](_0x4d99a0[_0x965c('0x45')]);_0x76ea64[_0x965c('0x59')]=_['intersection'](_0x76ea64[_0x965c('0x55')],_0x76ea64['query']);_0x3e678b[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x76ea64[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x4d99a0[_0x965c('0x45')][_0x965c('0x5b')]));_0x3e678b['attributes']=_0x3e678b[_0x965c('0x48')]['length']?_0x3e678b['attributes']:_0x76ea64['model'];_0x3e678b['order']=qs['sort'](_0x4d99a0[_0x965c('0x45')][_0x965c('0xcb')]);_0x3e678b[_0x965c('0x44')]=qs['filters'](_[_0x965c('0xd7')](_0x4d99a0['query'],_0x76ea64['filters']));if(_0x4d99a0[_0x965c('0x45')][_0x965c('0x31')]){_0x3e678b[_0x965c('0x44')]=_['merge'](_0x3e678b['where'],{'$or':_[_0x965c('0x33')](_0x3e678b['attributes'],function(_0x35c3ba){var _0x187f32={};_0x187f32[_0x35c3ba]={'$like':'%'+_0x4d99a0[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x187f32;})});}_0x3e678b=_[_0x965c('0x5c')]({},_0x3e678b,_0x4d99a0[_0x965c('0x5d')]);return _0x52c372[_0x965c('0x156')](_0x3e678b);}})[_0x965c('0x16')](function(_0xb74a7f){if(_0xb74a7f){_0x4166d4=_0xb74a7f[_0x965c('0x6d')];if(!_0x4d99a0[_0x965c('0x45')][_0x965c('0xcc')](_0x965c('0xd3'))){_0x3e678b[_0x965c('0xd4')]=qs[_0x965c('0xd4')](_0x4d99a0[_0x965c('0x45')][_0x965c('0xd4')]);_0x3e678b['offset']=qs[_0x965c('0x24')](_0x4d99a0[_0x965c('0x45')][_0x965c('0x24')]);}return _0x52c372['getWhatsappAccounts'](_0x3e678b);}})[_0x965c('0x16')](function(_0x2f3799){if(_0x2f3799){return _0x2f3799?{'count':_0x4166d4,'rows':_0x2f3799}:null;}})['then'](respondWithResult(_0x4766cf,null))[_0x965c('0x20')](handleError(_0x4766cf,null));};exports[_0x965c('0x157')]=function(_0x45fc2a,_0x3e05ef){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x45fc2a[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x3e05ef,null))[_0x965c('0x16')](function(_0x338065){if(_0x338065){return _0x338065['addWhatsappAccounts'](_0x45fc2a[_0x965c('0x5f')][_0x965c('0x64')],_[_0x965c('0x63')](_0x45fc2a[_0x965c('0x5f')],[_0x965c('0x64'),'id'])||{});}})[_0x965c('0x16')](respondWithResult(_0x3e05ef,null))[_0x965c('0x20')](handleError(_0x3e05ef,null));};exports['removeWhatsappAccounts']=function(_0x9301b5,_0x359d80){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x9301b5[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x359d80,null))[_0x965c('0x16')](function(_0x13ecf4){if(_0x13ecf4){return _0x13ecf4[_0x965c('0x158')](_0x9301b5['query'][_0x965c('0x64')]);}})[_0x965c('0x16')](respondWithStatusCode(_0x359d80,null))[_0x965c('0x20')](handleError(_0x359d80,null));};exports['getSquareProjects']=function(_0x595bd4,_0x3b99bb){var _0x41e7ec={};var _0x6f87a6={};var _0x162b8e;var _0x3ce388;return db['User'][_0x965c('0xc8')]({'where':{'id':_0x595bd4['params']['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x3b99bb,null))[_0x965c('0x16')](function(_0x71fd2e){if(_0x71fd2e){_0x162b8e=_0x71fd2e;_0x6f87a6[_0x965c('0x55')]=_[_0x965c('0x57')](db['SquareProject'][_0x965c('0x58')]);_0x6f87a6[_0x965c('0x45')]=_[_0x965c('0x57')](_0x595bd4['query']);_0x6f87a6[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x6f87a6['model'],_0x6f87a6[_0x965c('0x45')]);_0x41e7ec[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x6f87a6[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x595bd4[_0x965c('0x45')][_0x965c('0x5b')]));_0x41e7ec[_0x965c('0x48')]=_0x41e7ec[_0x965c('0x48')][_0x965c('0x6d')]?_0x41e7ec[_0x965c('0x48')]:_0x6f87a6[_0x965c('0x55')];_0x41e7ec['order']=qs['sort'](_0x595bd4[_0x965c('0x45')][_0x965c('0xcb')]);_0x41e7ec[_0x965c('0x44')]=qs[_0x965c('0x59')](_[_0x965c('0xd7')](_0x595bd4['query'],_0x6f87a6[_0x965c('0x59')]));if(_0x595bd4[_0x965c('0x45')]['filter']){_0x41e7ec[_0x965c('0x44')]=_[_0x965c('0x5c')](_0x41e7ec['where'],{'$or':_[_0x965c('0x33')](_0x41e7ec[_0x965c('0x48')],function(_0x2a122a){var _0x37359a={};_0x37359a[_0x2a122a]={'$like':'%'+_0x595bd4['query']['filter']+'%'};return _0x37359a;})});}_0x41e7ec=_[_0x965c('0x5c')]({},_0x41e7ec,_0x595bd4[_0x965c('0x5d')]);return _0x162b8e[_0x965c('0x159')](_0x41e7ec);}})['then'](function(_0x2b6aa1){if(_0x2b6aa1){_0x3ce388=_0x2b6aa1[_0x965c('0x6d')];if(!_0x595bd4[_0x965c('0x45')][_0x965c('0xcc')](_0x965c('0xd3'))){_0x41e7ec['limit']=qs['limit'](_0x595bd4[_0x965c('0x45')][_0x965c('0xd4')]);_0x41e7ec['offset']=qs[_0x965c('0x24')](_0x595bd4[_0x965c('0x45')]['offset']);}return _0x162b8e['getSquareProjects'](_0x41e7ec);}})[_0x965c('0x16')](function(_0x2cf6fb){if(_0x2cf6fb){return _0x2cf6fb?{'count':_0x3ce388,'rows':_0x2cf6fb}:null;}})[_0x965c('0x16')](respondWithResult(_0x3b99bb,null))[_0x965c('0x20')](handleError(_0x3b99bb,null));};exports[_0x965c('0x15a')]=function(_0x47af56,_0x44df14){return db['User']['find']({'where':{'id':_0x47af56[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x44df14,null))['then'](function(_0x307ca3){if(_0x307ca3){return _0x307ca3[_0x965c('0x15a')](_0x47af56[_0x965c('0x5f')][_0x965c('0x64')],_[_0x965c('0x63')](_0x47af56[_0x965c('0x5f')],['ids','id'])||{});}})[_0x965c('0x16')](respondWithResult(_0x44df14,null))[_0x965c('0x20')](handleError(_0x44df14,null));};exports[_0x965c('0x15b')]=function(_0x444e4c,_0x5ee87d){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x444e4c[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x5ee87d,null))[_0x965c('0x16')](function(_0x1b8ca4){if(_0x1b8ca4){return _0x1b8ca4['removeSquareProjects'](_0x444e4c[_0x965c('0x45')]['ids']);}})[_0x965c('0x16')](respondWithStatusCode(_0x5ee87d,null))['catch'](handleError(_0x5ee87d,null));};exports[_0x965c('0x15c')]=function(_0x43f9c5,_0x4c466d){var _0x1a53e6={},_0x2a0912={},_0x510cfa={'count':0x0,'rows':[]};var _0x1a577f=db[_0x965c('0x15d')][_0x965c('0x58')];_0x2a0912[_0x965c('0x55')]=_[_0x965c('0x57')](_0x1a577f);_0x2a0912[_0x965c('0x45')]=_['keys'](_0x43f9c5[_0x965c('0x45')]);_0x2a0912[_0x965c('0x59')]=_[_0x965c('0x5a')](_0x2a0912[_0x965c('0x55')],_0x2a0912[_0x965c('0x45')]);_0x2a0912[_0x965c('0x59')]=_[_0x965c('0xfe')](_0x2a0912['filters'],['$and',_0x965c('0x15e'),'$gt',_0x965c('0x15f'),'$lt',_0x965c('0x160'),_0x965c('0x161'),_0x965c('0x162'),_0x965c('0x163'),_0x965c('0x164'),_0x965c('0x165'),_0x965c('0x166'),_0x965c('0x167'),_0x965c('0x168'),_0x965c('0x169'),_0x965c('0x16a'),'$notILike',_0x965c('0x168'),_0x965c('0x16b'),_0x965c('0x16c'),_0x965c('0x16d'),_0x965c('0x16e')]);_0x1a53e6[_0x965c('0x48')]=_[_0x965c('0x5a')](_0x2a0912[_0x965c('0x55')],qs[_0x965c('0x5b')](_0x43f9c5[_0x965c('0x45')][_0x965c('0x5b')]));_0x1a53e6['attributes']=_0x1a53e6[_0x965c('0x48')]['length']?_0x1a53e6[_0x965c('0x48')]:_0x2a0912[_0x965c('0x55')];if(!_0x43f9c5['query'][_0x965c('0xcc')](_0x965c('0xd3'))){_0x1a53e6['limit']=qs[_0x965c('0xd4')](_0x43f9c5['query']['limit']);_0x1a53e6['offset']=qs[_0x965c('0x24')](_0x43f9c5[_0x965c('0x45')]['offset']);}_0x1a53e6[_0x965c('0xca')]=qs[_0x965c('0xcb')](_0x43f9c5[_0x965c('0x45')][_0x965c('0xcb')]);_0x1a53e6[_0x965c('0x44')]=qs['filters'](_[_0x965c('0xd7')](_0x43f9c5['query'],_0x2a0912[_0x965c('0x59')]));if(_0x43f9c5[_0x965c('0x45')]['filter']){_0x1a53e6[_0x965c('0x44')]=_[_0x965c('0x5c')](_0x1a53e6[_0x965c('0x44')],{'$or':_['map'](_0x1a53e6[_0x965c('0x48')],function(_0x23d50a){var _0x1775fc={};_0x1775fc[_0x23d50a]={'$like':'%'+_0x43f9c5[_0x965c('0x45')][_0x965c('0x31')]+'%'};return _0x1775fc;})});}_0x1a53e6[_0x965c('0x44')]={'$and':[_0x1a53e6[_0x965c('0x44')],{'$or':[{'UserId':_0x43f9c5[_0x965c('0x60')]['id']},{'OwnerId':_0x43f9c5['params']['id']}]}]};_0x1a53e6=_[_0x965c('0x5c')]({},_0x1a53e6,_0x43f9c5[_0x965c('0x5d')]);var _0x42218b={'where':_0x1a53e6[_0x965c('0x44')]};return db['CmHopper'][_0x965c('0x26')](_0x42218b)[_0x965c('0x16')](function(_0x8dc917){_0x510cfa[_0x965c('0x26')]=_0x8dc917;if(_0x43f9c5[_0x965c('0x45')][_0x965c('0x46')]){_0x1a53e6[_0x965c('0x47')]=[{'attributes':['id','firstName','lastName','phone'],'model':db[_0x965c('0xc9')],'as':_0x965c('0x16f')},{'attributes':['id','name','dialActive'],'model':db['VoiceQueue'],'as':_0x965c('0xd6')}];}return db[_0x965c('0x15d')][_0x965c('0x4a')](_0x1a53e6);})[_0x965c('0x16')](function(_0x39ad95){_0x510cfa[_0x965c('0x4d')]=_0x39ad95;return _0x510cfa;})['then'](respondWithFilteredResult(_0x4c466d,_0x1a53e6))['catch'](handleError(_0x4c466d,null));};exports[_0x965c('0x170')]=function(_0x5121e9,_0x28b14c){if(!_[_0x965c('0x6e')](_0x5121e9[_0x965c('0x2e')]['id'])&&(_0x5121e9[_0x965c('0x2e')][_0x965c('0x2b')]==_0x965c('0x2c')||_0x5121e9[_0x965c('0x2e')][_0x965c('0x2b')]==_0x965c('0x2e'))){return db[_0x965c('0x3d')][_0x965c('0xc8')]({'where':{'id':_0x5121e9[_0x965c('0x60')]['id']},'raw':!![]})['then'](function(_0xe469b0){return authService[_0x965c('0x171')](_0xe469b0);})[_0x965c('0x16')](function(_0xa57e85){if(_0xa57e85){return _0x28b14c['status'](0xc8)[_0x965c('0x23')]({'api_key':_0xa57e85[_0x965c('0x172')]});}else{return _0x28b14c[_0x965c('0x22')](0xcc)[_0x965c('0x23')]({'message':'No\x20API\x20access\x20key\x20found!'});}})['catch'](handleError(_0x28b14c,0x193));}else{return _0x28b14c[_0x965c('0x22')](0x191)[_0x965c('0x23')]({'message':_0x965c('0x173')});}};exports[_0x965c('0x174')]=function(_0xbd05dc,_0x2537e3){if(!_['isNil'](_0xbd05dc[_0x965c('0x2e')]['id'])&&(_0xbd05dc[_0x965c('0x2e')][_0x965c('0x2b')]==_0x965c('0x2c')||_0xbd05dc[_0x965c('0x2e')][_0x965c('0x2b')]=='user')){return db[_0x965c('0x3d')]['find']({'where':{'id':_0xbd05dc[_0x965c('0x60')]['id']}})[_0x965c('0x16')](function(_0xf0619c){return authService[_0x965c('0x175')](_0xf0619c);})[_0x965c('0x16')](function(_0x3b1700){return db['User']['update']({'apiKeyIat':_0x3b1700[_0x965c('0x176')],'apiKeyNonce':_0x3b1700[_0x965c('0x177')]},{'where':{'id':_0xbd05dc[_0x965c('0x60')]['id']}})[_0x965c('0x16')](function(){return _0x2537e3['status'](0xc8)['json']({'api_key':_0x3b1700['token']});});})['catch'](handleError(_0x2537e3,0x193));}else{return _0x2537e3[_0x965c('0x22')](0x191)[_0x965c('0x23')]({'message':_0x965c('0x173')});}};exports[_0x965c('0x178')]=function(_0x26c03c,_0x27cfa6){if(!_[_0x965c('0x6e')](_0x26c03c[_0x965c('0x2e')]['id'])&&(_0x26c03c['user'][_0x965c('0x2b')]=='admin'||_0x26c03c[_0x965c('0x2e')]['role']==_0x965c('0x2e'))){return db[_0x965c('0x3d')][_0x965c('0x36')]({'where':{'id':_0x26c03c[_0x965c('0x60')]['id']}})[_0x965c('0x16')](handleEntityNotFound(_0x27cfa6,null))['then'](function(_0x2b7fe9){if(_0x2b7fe9&&_0x2b7fe9[_0x965c('0x179')]&&_0x2b7fe9[_0x965c('0x17a')])return _0x2b7fe9;else throw{'message':_0x965c('0x17b')};})[_0x965c('0x16')](function(_0x9df9e8){return db[_0x965c('0x3d')][_0x965c('0x28')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x26c03c[_0x965c('0x60')]['id']}});})['then'](respondWithStatusCode(_0x27cfa6,0xc8))[_0x965c('0x20')](handleError(_0x27cfa6,0x193));}else{return _0x27cfa6['status'](0x191)['json']({'message':_0x965c('0x173')});}};exports[_0x965c('0x17c')]=function(_0x35ded7,_0x3e29d8){var _0x3405a5=_0x35ded7[_0x965c('0x2e')][_0x965c('0x2a')]({'plain':!![]});if(!_0x3405a5){return _0x3e29d8['status'](0x191)[_0x965c('0x3b')](_0x965c('0x17d'));}else{return _0x3e29d8[_0x965c('0x22')](0xc8)[_0x965c('0x23')](_0x3405a5);}};exports[_0x965c('0x17e')]=function(_0x40755b,_0x3ffd24){var _0x21dfaa={'offset':0x0},_0x43fdde={'count':0x0,'rows':[]};Promise['resolve']()['then'](function(){if(!_0x40755b[_0x965c('0x45')]['filter']&&!_0x40755b[_0x965c('0x45')][_0x965c('0x17f')]&&!_0x40755b[_0x965c('0x45')]['queues'])return[];return Promise['resolve']()[_0x965c('0x16')](function(){var _0x40da8f=[];if(!_[_0x965c('0x8d')](_0x40755b[_0x965c('0x45')][_0x965c('0x17f')])){_0x40da8f['push'](db[_0x965c('0x113')][_0x965c('0x4a')]({'attributes':['id',_0x965c('0x3a')],'where':{'id':_0x40755b[_0x965c('0x45')]['teams']}}));}if(!_[_0x965c('0x8d')](_0x40755b[_0x965c('0x45')][_0x965c('0x180')])){_0x40da8f[_0x965c('0x49')](db['VoiceQueue'][_0x965c('0x4a')]({'attributes':['id',_0x965c('0x3a')],'type':'inbound','where':{'id':_0x40755b[_0x965c('0x45')][_0x965c('0x180')]}}));}return Promise['all'](_0x40da8f);})[_0x965c('0x16')](function(_0x3e3e21){var _0xb28c65=_[_0x965c('0x11c')](_0x3e3e21)[_0x965c('0x33')](function(_0x2a499f){return _0x2a499f['getAgents']({'attributes':['id',_0x965c('0x3a'),_0x965c('0x67'),_0x965c('0x9c')],'raw':!![]});});return Promise['all'](_0xb28c65);})['then'](function(_0x19427e){var _0xfdf80a=_[_0x965c('0x11c')](_0x19427e);if(!_0x40755b[_0x965c('0x45')][_0x965c('0x31')])return _0xfdf80a;if(_['isEmpty'](_0xfdf80a)){return db[_0x965c('0x3d')][_0x965c('0x4a')]({'attributes':['id',_0x965c('0x3a'),_0x965c('0x67'),_0x965c('0x9c')],'where':{'role':_0x965c('0x72'),'$or':[db[_0x965c('0x6a')][_0x965c('0x44')](db[_0x965c('0x6a')]['fn'](_0x965c('0x181'),db[_0x965c('0x6a')][_0x965c('0x182')](_0x965c('0x3a'))),{'$like':'%'+_0x40755b[_0x965c('0x45')][_0x965c('0x31')][_0x965c('0xa3')]()+'%'}),{'internal':{'$like':'%'+_0x40755b[_0x965c('0x45')][_0x965c('0x31')]+'%'}}]},'raw':!![]});}else{return _(_0xfdf80a)[_0x965c('0x11c')]()[_0x965c('0x31')](function(_0x307243){return _0x307243['name']['toLowerCase']()[_0x965c('0x35')](_0x40755b['query'][_0x965c('0x31')][_0x965c('0xa3')]())||_0x307243[_0x965c('0x67')][_0x965c('0x183')]()[_0x965c('0x35')](_0x40755b[_0x965c('0x45')]['filter']);})[_0x965c('0x34')]();}})['then'](function(_0x3838a9){var _0x3f81d9=_0x965c('0x3a');var _0x1992d7=_0x965c('0x184');if(_0x40755b[_0x965c('0x45')][_0x965c('0xcb')]){var _0x1992d7=_0x40755b[_0x965c('0x45')][_0x965c('0xcb')][0x0]==='-'?_0x965c('0x185'):_0x965c('0x184');var _0x3f81d9=_0x1992d7===_0x965c('0x184')?_0x40755b[_0x965c('0x45')]['sort']:_0x40755b[_0x965c('0x45')][_0x965c('0xcb')]['substring'](0x1);}return _(_0x3838a9)[_0x965c('0x186')]('id')['orderBy']([function(_0x2c0be4){return _0x3f81d9==='name'?_0x2c0be4[_0x3f81d9][_0x965c('0xa3')]():_0x2c0be4[_0x3f81d9];}],[_0x1992d7])[_0x965c('0x33')](function(_0x54f157){return _[_0x965c('0xd7')](_0x54f157,['id',_0x965c('0x3a'),_0x965c('0x67'),'online']);})[_0x965c('0x34')]();})[_0x965c('0x16')](function(_0x4f2374){return client[_0x965c('0x15')](_0x965c('0x2f'),_0x40755b)[_0x965c('0x16')](function(_0x9b6498){if(_0x9b6498[_0x965c('0x1c')])throw new Error(_0x965c('0x187'));var _0x24d65b=_0x9b6498[_0x965c('0x1f')];var _0x1c25df=jayson['client'][_0x965c('0x14')]({'port':0x232c});return _0x1c25df[_0x965c('0x15')](_0x965c('0x2f'),_0x40755b)[_0x965c('0x16')](function(_0x4f91bf){if(_0x4f91bf[_0x965c('0x1c')])throw new Error(_0x965c('0x188'));var _0x5c5e8c=_0x4f91bf[_0x965c('0x1f')];return _[_0x965c('0x5c')]({},_0x5c5e8c,_0x24d65b);});})[_0x965c('0x16')](function(_0x590341){return _[_0x965c('0x33')](_0x4f2374,function(_0x43ab4f){var _0x46072e=_[_0x965c('0x36')](_0x590341[_0x965c('0x4d')],['id',_0x43ab4f['id']]);if(!_0x46072e||!_0x43ab4f[_0x965c('0x9c')]){_0x43ab4f['status']='offline';}else if(_0x46072e[_0x965c('0x9e')]){_0x43ab4f[_0x965c('0x22')]='pause';}else{_0x43ab4f[_0x965c('0x22')]=_[_0x965c('0x35')](['idle',_0x965c('0x189'),_0x965c('0x18a'),_0x965c('0x18b'),null,undefined],_0x46072e[_0x965c('0x18c')])?_0x965c('0x9c'):_0x965c('0x18d');}return _0x43ab4f;});});});})[_0x965c('0x16')](function(_0x44f6d6){if(!_0x40755b[_0x965c('0x45')][_0x965c('0xcc')]('nolimit')){_0x21dfaa[_0x965c('0xd4')]=qs['limit'](_0x40755b[_0x965c('0x45')][_0x965c('0xd4')]||0xa);_0x21dfaa[_0x965c('0x24')]=qs[_0x965c('0x24')](_0x40755b['query'][_0x965c('0x24')]);}_0x43fdde[_0x965c('0x26')]=_0x44f6d6[_0x965c('0x6d')];_0x43fdde['rows']=_0x21dfaa[_0x965c('0xd4')]?_0x44f6d6[_0x965c('0x18e')](_0x21dfaa[_0x965c('0x24')],_0x21dfaa[_0x965c('0x24')]+_0x21dfaa['limit']):_0x44f6d6;return _0x43fdde;})['then'](respondWithFilteredResult(_0x3ffd24,_0x21dfaa))[_0x965c('0x20')](handleError(_0x3ffd24,null));};function get_open_tabs(_0x3630d9,_0xedeb68){var _0x2b37f2=_0x3630d9[_0x965c('0x18f')](0x0)[_0x965c('0x190')]()+_0x3630d9['slice'](0x1);var _0x3743b2={'type':db[_0x965c('0x91')][_0x965c('0x6b')]['SELECT'],'raw':!![]};return new BPromise(function(_0x35d13f,_0x34942b){var _0x51a9db=squel['select']()[_0x965c('0x191')](_0x965c('0x192')+_0x2b37f2+_0x965c('0x193'),'id')['field'](_0x965c('0x194'))['from'](_0x965c('0x195')+_0x3630d9+_0x965c('0x196'),'ui')[_0x965c('0x44')](_0x965c('0x197'),_0xedeb68['id']);return db[_0x965c('0x6a')]['query'](_0x51a9db[_0x965c('0x183')](),_0x3743b2)['then'](function(_0x1ad264){_0xedeb68[_0x2b37f2+'OpenTabs']=_0x1ad264;_0x35d13f(_0x1ad264);})[_0x965c('0x20')](function(_0x5b2f25){_0x34942b(_0x5b2f25);});});};
\ No newline at end of file
index b096d23..9c4fc58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a2b=['save','update','remove','emit','exports','events','../../mysqldb','User','setMaxListeners'];(function(_0x551d19,_0x42a786){var _0xa4cff3=function(_0x2e8a17){while(--_0x2e8a17){_0x551d19['push'](_0x551d19['shift']());}};_0xa4cff3(++_0x42a786);}(_0x1a2b,0xa7));var _0xb1a2=function(_0x5857a7,_0x3f8601){_0x5857a7=_0x5857a7-0x0;var _0x2c35e4=_0x1a2b[_0x5857a7];return _0x2c35e4;};'use strict';var EventEmitter=require(_0xb1a2('0x0'));var User=require(_0xb1a2('0x1'))['db'][_0xb1a2('0x2')];var UserEvents=new EventEmitter();UserEvents[_0xb1a2('0x3')](0x0);var events={'afterCreate':_0xb1a2('0x4'),'afterUpdate':_0xb1a2('0x5'),'afterDestroy':_0xb1a2('0x6')};function emitEvent(_0x284bd4){return function(_0x2b26df,_0x5adae8,_0x47c2e1){UserEvents['emit'](_0x284bd4+':'+_0x2b26df['id'],_0x2b26df);UserEvents[_0xb1a2('0x7')](_0x284bd4,_0x2b26df);_0x47c2e1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User['hook'](e,emitEvent(event));}}module[_0xb1a2('0x8')]=UserEvents;
\ No newline at end of file
+var _0xf0cd=['exports','events','User','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xf0cd,0x169));var _0xdf0c=function(_0xb346bb,_0x229ac6){_0xb346bb=_0xb346bb-0x0;var _0x16f05a=_0xf0cd[_0xb346bb];return _0x16f05a;};'use strict';var EventEmitter=require(_0xdf0c('0x0'));var User=require('../../mysqldb')['db'][_0xdf0c('0x1')];var UserEvents=new EventEmitter();UserEvents[_0xdf0c('0x2')](0x0);var events={'afterCreate':_0xdf0c('0x3'),'afterUpdate':'update','afterDestroy':_0xdf0c('0x4')};function emitEvent(_0x9cf664){return function(_0x16fbe7,_0x46ddd3,_0x190fd6){UserEvents[_0xdf0c('0x5')](_0x9cf664+':'+_0x16fbe7['id'],_0x16fbe7);UserEvents[_0xdf0c('0x5')](_0x9cf664,_0x16fbe7);_0x190fd6(null);};}for(var e in events){if(events[_0xdf0c('0x6')](e)){var event=events[e];User[_0xdf0c('0x7')](e,emitEvent(event));}}module[_0xdf0c('0x8')]=UserEvents;
\ No newline at end of file
index 70e18e2..bcdca59 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff1c=['md5','lodash','./user.attributes','google','length','context','system','%s%s','prefix','push','format','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','WAV','from-sip','Set','CDR(type)=internal','includes','_XCALLY_MIXMONITOR_FORMAT=%s','extensionMonitor','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','VoiceChanSpy','then','internal','concat','exports','models','define','User','users','utf8','userProfileId','undefined','UserProfile','privacyEnabled','updateMd5Password','updatePassword','resolve','changed','find','password','catch','VoiceExtension','destroy','bulkCreate','encryptPassword','function','base64','salt','sha1','toString','pbkdf2','indexOf','provider','Invalid\x20password','makeSalt','md5secret',':asterisk:','bluebird','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff1c,0xdf));var _0xcff1=function(_0x16f83a,_0x197cd4){_0x16f83a=_0x16f83a-0x0;var _0xe87bd=_0xff1c[_0x16f83a];return _0xe87bd;};'use strict';var BPromise=require(_0xcff1('0x0'));var crypto=require('crypto');var util=require(_0xcff1('0x1'));var md5=require(_0xcff1('0x2'));var _=require(_0xcff1('0x3'));var attributes=require(_0xcff1('0x4'));var authTypes=[_0xcff1('0x5')];var validatePresenceOf=function(_0x7d1981){return _0x7d1981&&_0x7d1981[_0xcff1('0x6')];};var getChanSpyApplications=function(_0x6a5b,_0x3f84ba,_0x13bea2){var _0x12ecf6={'context':_0x6a5b[_0xcff1('0x7')]||'from-sip','type':_0xcff1('0x8'),'isApp':![],'UserId':_0x6a5b['id']};var _0x5cef53=[];for(var _0x5b84a7=0x0,_0xfb3f2c=0x1;_0x5b84a7<_0x13bea2[_0xcff1('0x6')];_0x5b84a7++,_0xfb3f2c=0x1){var _0x51f4fb={'exten':util['format'](_0xcff1('0x9'),_0x13bea2[_0x5b84a7][_0xcff1('0xa')],_0x3f84ba),'ChanSpyId':_0x13bea2[_0x5b84a7]['id']};_0x5cef53[_0xcff1('0xb')](_['merge']({'app':'Set','appdata':util[_0xcff1('0xc')](_0xcff1('0xd'),_0xcff1('0xe')),'priority':_0xfb3f2c++},_0x12ecf6,_0x51f4fb));if(_0x13bea2[_0x5b84a7][_0xcff1('0xf')]){_0x5cef53[_0xcff1('0xb')](_[_0xcff1('0x10')]({'app':_0xcff1('0x11'),'appdata':util[_0xcff1('0xc')](_0xcff1('0x12'),_0x13bea2[_0x5b84a7][_0xcff1('0x13')]),'priority':_0xfb3f2c++},_0x12ecf6,_0x51f4fb));}if(_0x13bea2[_0x5b84a7]['auth']){_0x5cef53['push'](_[_0xcff1('0x10')]({'app':_0xcff1('0x14'),'appdata':_0x13bea2[_0x5b84a7]['password'],'priority':_0xfb3f2c++},_0x12ecf6,_0x51f4fb));}_0x5cef53[_0xcff1('0xb')](_[_0xcff1('0x10')]({'app':_0xcff1('0x15'),'appdata':util['format'](_0xcff1('0x16'),_0x6a5b[_0xcff1('0x17')],_0x13bea2[_0x5b84a7][_0xcff1('0x18')]?_0x13bea2[_0x5b84a7][_0xcff1('0x18')][_0xcff1('0x19')](''):''),'priority':_0xfb3f2c++},_0x12ecf6,_0x51f4fb));if(_0x13bea2[_0x5b84a7][_0xcff1('0xf')]){_0x5cef53[_0xcff1('0xb')](_[_0xcff1('0x10')]({'app':_0xcff1('0x1a'),'priority':_0xfb3f2c++},_0x12ecf6,_0x51f4fb));}}return _0x5cef53;};var getUserApplications=function(_0x3e2805,_0x153a31){var _0x273f44=['wav',_0xcff1('0x1b'),'gsm'];var _0x3b25e0={'context':_0x3e2805[_0xcff1('0x7')]||_0xcff1('0x1c'),'exten':_0x153a31,'type':'system','isApp':![],'UserId':_0x3e2805['id']};var _0x33e8e5=[{'app':_0xcff1('0x1d'),'appdata':_0xcff1('0x1e')}];if(_0x3e2805['extensionMonitor']&&_[_0xcff1('0x1f')](_0x273f44,_0x3e2805['extensionMonitor'])){_0x33e8e5['push']({'app':'Set','appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x33e8e5[_0xcff1('0xb')]({'app':'Set','appdata':util[_0xcff1('0xc')](_0xcff1('0x20'),_0x3e2805[_0xcff1('0x21')])});_0x33e8e5[_0xcff1('0xb')]({'app':_0xcff1('0x22'),'appdata':util[_0xcff1('0xc')](_0xcff1('0x23'),_0x3e2805[_0xcff1('0x17')])});}else{_0x33e8e5['push']({'app':_0xcff1('0x22'),'appdata':util[_0xcff1('0xc')](_0xcff1('0x24'),_0x3e2805[_0xcff1('0x17')])});}_0x33e8e5[_0xcff1('0xb')]({'app':_0xcff1('0x25')});for(var _0x3e1d62=0x0;_0x3e1d62<_0x33e8e5[_0xcff1('0x6')];_0x3e1d62++){_0x33e8e5[_0x3e1d62]['priority']=_0x3e1d62+0x1;_0x33e8e5[_0x3e1d62]=_['defaults'](_0x33e8e5[_0x3e1d62],_0x3b25e0);}return _0x33e8e5;};var getChanSpyPromise=function(_0x1f61fc,_0x4c8ec8){return new BPromise(function(_0x214380,_0x2f6a5f){return _0x1f61fc[_0xcff1('0x26')]['findAll']()[_0xcff1('0x27')](function(_0xdb230){if(_0xdb230){var _0x13311f=getChanSpyApplications(_0x4c8ec8,_0x4c8ec8[_0xcff1('0x28')],_0xdb230);if(_0x4c8ec8['internal']!=_0x4c8ec8[_0xcff1('0x17')]){_0x13311f=_0x13311f[_0xcff1('0x29')](getChanSpyApplications(_0x4c8ec8,_0x4c8ec8[_0xcff1('0x17')],_0xdb230));}return _0x214380(_0x13311f);}return _0x214380([]);})['catch'](function(_0x5bbc16){_0x2f6a5f(_0x5bbc16);});});};module[_0xcff1('0x2a')]=function(_0x106753,_0x193af4){var _0x3db554=_0x106753[_0xcff1('0x2b')];return _0x106753[_0xcff1('0x2c')](_0xcff1('0x2d'),attributes,{'tableName':_0xcff1('0x2e'),'charset':_0xcff1('0x2f'),'collate':'utf8_bin','hooks':{'beforeCreate':function(_0x1128f3,_0x4cc07c,_0x2cdc9a){var _0x28f930=typeof _0x1128f3[_0xcff1('0x30')]===_0xcff1('0x31')?BPromise['resolve'](null):_0x3db554[_0xcff1('0x32')]['find']({'where':{'id':_0x1128f3['userProfileId']}});_0x28f930[_0xcff1('0x27')](function(_0xbe0342){if(_0xbe0342){_0x1128f3[_0xcff1('0x33')]=_0xbe0342[_0xcff1('0x33')];}})[_0xcff1('0x27')](function(){_0x1128f3[_0xcff1('0x34')]();_0x1128f3[_0xcff1('0x35')](_0x2cdc9a);})['catch'](function(_0x28b72e){_0x2cdc9a(_0x28b72e);});},'beforeUpdate':function(_0x4f7dc9,_0x2952e8,_0x256f0f){Promise[_0xcff1('0x36')]()[_0xcff1('0x27')](function(){if(_0x4f7dc9[_0xcff1('0x37')](_0xcff1('0x30'))===![])return;return _0x3db554[_0xcff1('0x32')][_0xcff1('0x38')]({'where':{'id':_0x4f7dc9[_0xcff1('0x30')]}})[_0xcff1('0x27')](function(_0x2d99fd){if(_0x2d99fd)_0x4f7dc9[_0xcff1('0x33')]=_0x2d99fd[_0xcff1('0x33')];return;});})[_0xcff1('0x27')](function(){if(_0x4f7dc9[_0xcff1('0x37')](_0xcff1('0x39'))){_0x4f7dc9[_0xcff1('0x34')]();return _0x4f7dc9[_0xcff1('0x35')](_0x256f0f);}_0x256f0f();})[_0xcff1('0x3a')](function(_0x964b31){_0x256f0f(_0x964b31);});},'afterCreate':function(_0x54c2bf,_0x219f98,_0x95abb8){var _0x552dc9=getUserApplications(_0x54c2bf,_0x54c2bf[_0xcff1('0x28')]);if(_0x54c2bf[_0xcff1('0x28')]!=_0x54c2bf['name']){_0x552dc9=_0x552dc9[_0xcff1('0x29')](getUserApplications(_0x54c2bf,_0x54c2bf[_0xcff1('0x17')]));}return _0x3db554[_0xcff1('0x3b')]['bulkCreate'](_0x552dc9)[_0xcff1('0x27')](function(){if(_0x54c2bf[_0xcff1('0xe')]){return getChanSpyPromise(_0x3db554,_0x54c2bf);}})[_0xcff1('0x27')](function(_0x3a6a90){if(_0x3a6a90&&_0x3a6a90[_0xcff1('0x6')]){return _0x3db554['VoiceExtension']['bulkCreate'](_0x3a6a90);}})['then'](function(){_0x95abb8();})[_0xcff1('0x3a')](function(_0x46271d){_0x95abb8(_0x46271d);});},'afterUpdate':function(_0x17c304,_0x2d9fdc,_0x6da590){return BPromise[_0xcff1('0x36')]()[_0xcff1('0x27')](function(){if(_0x17c304[_0xcff1('0x37')](_0xcff1('0xe'))||_0x17c304[_0xcff1('0x37')]('context')){return _0x3db554[_0xcff1('0x3b')][_0xcff1('0x3c')]({'where':{'UserId':_0x17c304['id'],'type':_0xcff1('0x8'),'ChanSpyId':{'$ne':null}}})[_0xcff1('0x27')](function(){if(_0x17c304[_0xcff1('0xe')]){return getChanSpyPromise(_0x3db554,_0x17c304)['then'](function(_0x30c1c7){if(_0x30c1c7&&_0x30c1c7['length']){return _0x3db554['VoiceExtension'][_0xcff1('0x3d')](_0x30c1c7);}});}});}})[_0xcff1('0x27')](function(){if(_0x17c304[_0xcff1('0x37')](_0xcff1('0x21'))||_0x17c304['changed']('context')){return _0x3db554[_0xcff1('0x3b')][_0xcff1('0x3c')]({'where':{'UserId':_0x17c304['id'],'type':_0xcff1('0x8'),'ChanSpyId':null}})[_0xcff1('0x27')](function(){var _0x340b7d=getUserApplications(_0x17c304,_0x17c304['internal']);if(_0x17c304[_0xcff1('0x28')]!=_0x17c304[_0xcff1('0x17')]){_0x340b7d=_0x340b7d[_0xcff1('0x29')](getUserApplications(_0x17c304,_0x17c304['name']));}return _0x3db554[_0xcff1('0x3b')][_0xcff1('0x3d')](_0x340b7d);});}})['then'](function(){_0x6da590();})[_0xcff1('0x3a')](function(_0x40f807){_0x6da590(_0x40f807);});},'afterDestroy':function(_0x6a5352,_0xbbf94){return _0x3db554['VoiceExtension'][_0xcff1('0x3c')]({'where':{'UserId':_0x6a5352['id'],'type':_0xcff1('0x8')}});}},'instanceMethods':{'authenticate':function(_0x2d038c,_0x1dbc07){if(!_0x1dbc07){return this[_0xcff1('0x39')]===this[_0xcff1('0x3e')](_0x2d038c);}var _0x4b2d8c=this;this[_0xcff1('0x3e')](_0x2d038c,function(_0x515238,_0x53481c){if(_0x515238){_0x1dbc07(_0x515238);}if(_0x4b2d8c[_0xcff1('0x39')]===_0x53481c){_0x1dbc07(null,!![]);}else{_0x1dbc07(null,![]);}});},'makeSalt':function(_0x1c89e0,_0x4a86f6){var _0xcd67ee=0x10;if(typeof arguments[0x0]===_0xcff1('0x3f')){_0x4a86f6=arguments[0x0];_0x1c89e0=_0xcd67ee;}else if(typeof arguments[0x1]===_0xcff1('0x3f')){_0x4a86f6=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x1c89e0){_0x1c89e0=_0xcd67ee;}return crypto['randomBytes'](_0x1c89e0,function(_0x33b301,_0x3f7b68){if(_0x33b301){_0x4a86f6(_0x33b301);}return _0x4a86f6(null,_0x3f7b68['toString'](_0xcff1('0x40')));});},'encryptPassword':function(_0x34aae7,_0xc918b0){if(!_0x34aae7||!this['salt']){return _0xc918b0?_0xc918b0(null):null;}var _0x4b5037=0x2710;var _0x57a363=0x40;var _0x222017=new Buffer(this[_0xcff1('0x41')],_0xcff1('0x40'));if(!_0xc918b0){return crypto['pbkdf2Sync'](_0x34aae7,_0x222017,_0x4b5037,_0x57a363,_0xcff1('0x42'))[_0xcff1('0x43')]('base64');}return crypto[_0xcff1('0x44')](_0x34aae7,_0x222017,_0x4b5037,_0x57a363,'sha1',function(_0x24c812,_0x2ba09e){if(_0x24c812){_0xc918b0(_0x24c812);}return _0xc918b0(null,_0x2ba09e['toString'](_0xcff1('0x40')));});},'updatePassword':function(_0x1f7537){if(!this[_0xcff1('0x39')]){return _0x1f7537(null);}if(!validatePresenceOf(this[_0xcff1('0x39')])&&authTypes[_0xcff1('0x45')](this[_0xcff1('0x46')])===-0x1){_0x1f7537(new Error(_0xcff1('0x47')));}var _0x438c77=this;this[_0xcff1('0x48')](function(_0x1dc860,_0xe3b602){if(_0x1dc860){return _0x1f7537(_0x1dc860);}_0x438c77['salt']=_0xe3b602;_0x438c77[_0xcff1('0x3e')](_0x438c77['password'],function(_0x2e95a9,_0x686e0){if(_0x2e95a9){_0x1f7537(_0x2e95a9);}_0x438c77['password']=_0x686e0;_0x1f7537(null);});});},'updateMd5Password':function(){this[_0xcff1('0x49')]=md5(this[_0xcff1('0x17')]+_0xcff1('0x4a')+this[_0xcff1('0x39')]);return this[_0xcff1('0x49')];}}});};
\ No newline at end of file
+var _0x8376=['prefix','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','password','SIP/%s,%s','options','wav','WAV','system','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','name','priority','defaults','VoiceChanSpy','findAll','then','internal','concat','exports','models','define','User','users','utf8','utf8_bin','userProfileId','undefined','resolve','UserProfile','find','updateMd5Password','updatePassword','catch','changed','privacyEnabled','VoiceExtension','bulkCreate','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','toString','base64','salt','pbkdf2Sync','pbkdf2','provider','makeSalt',':asterisk:','md5secret','crypto','md5','lodash','length','context','from-sip','format','%s%s'];(function(_0x31c27f,_0x40294c){var _0x28f9c6=function(_0x4f7f35){while(--_0x4f7f35){_0x31c27f['push'](_0x31c27f['shift']());}};_0x28f9c6(++_0x40294c);}(_0x8376,0x160));var _0x6837=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x8376[_0x59ee6f];return _0x4c0979;};'use strict';var BPromise=require('bluebird');var crypto=require(_0x6837('0x0'));var util=require('util');var md5=require(_0x6837('0x1'));var _=require(_0x6837('0x2'));var attributes=require('./user.attributes');var authTypes=['google'];var validatePresenceOf=function(_0x40e772){return _0x40e772&&_0x40e772[_0x6837('0x3')];};var getChanSpyApplications=function(_0x2cf8a9,_0x406605,_0x3ca98d){var _0x4f154f={'context':_0x2cf8a9[_0x6837('0x4')]||_0x6837('0x5'),'type':'system','isApp':![],'UserId':_0x2cf8a9['id']};var _0x16fd03=[];for(var _0x3a1f4b=0x0,_0x438d26=0x1;_0x3a1f4b<_0x3ca98d['length'];_0x3a1f4b++,_0x438d26=0x1){var _0x2672a8={'exten':util[_0x6837('0x6')](_0x6837('0x7'),_0x3ca98d[_0x3a1f4b][_0x6837('0x8')],_0x406605),'ChanSpyId':_0x3ca98d[_0x3a1f4b]['id']};_0x16fd03[_0x6837('0x9')](_[_0x6837('0xa')]({'app':_0x6837('0xb'),'appdata':util[_0x6837('0x6')](_0x6837('0xc'),_0x6837('0xd')),'priority':_0x438d26++},_0x4f154f,_0x2672a8));if(_0x3ca98d[_0x3a1f4b][_0x6837('0xe')]){_0x16fd03[_0x6837('0x9')](_[_0x6837('0xa')]({'app':_0x6837('0xf'),'appdata':util[_0x6837('0x6')]('${UNIQUEID}.%s,a',_0x3ca98d[_0x3a1f4b][_0x6837('0x10')]),'priority':_0x438d26++},_0x4f154f,_0x2672a8));}if(_0x3ca98d[_0x3a1f4b][_0x6837('0x11')]){_0x16fd03['push'](_[_0x6837('0xa')]({'app':_0x6837('0x12'),'appdata':_0x3ca98d[_0x3a1f4b][_0x6837('0x13')],'priority':_0x438d26++},_0x4f154f,_0x2672a8));}_0x16fd03['push'](_[_0x6837('0xa')]({'app':'ChanSpy','appdata':util[_0x6837('0x6')](_0x6837('0x14'),_0x2cf8a9['name'],_0x3ca98d[_0x3a1f4b]['options']?_0x3ca98d[_0x3a1f4b][_0x6837('0x15')]['join'](''):''),'priority':_0x438d26++},_0x4f154f,_0x2672a8));if(_0x3ca98d[_0x3a1f4b][_0x6837('0xe')]){_0x16fd03['push'](_[_0x6837('0xa')]({'app':'StopMixMonitor','priority':_0x438d26++},_0x4f154f,_0x2672a8));}}return _0x16fd03;};var getUserApplications=function(_0x3627fd,_0x4ecfd1){var _0x11504d=[_0x6837('0x16'),_0x6837('0x17'),'gsm'];var _0xf63e86={'context':_0x3627fd['context']||_0x6837('0x5'),'exten':_0x4ecfd1,'type':_0x6837('0x18'),'isApp':![],'UserId':_0x3627fd['id']};var _0x5e198f=[{'app':_0x6837('0xb'),'appdata':_0x6837('0x19')}];if(_0x3627fd[_0x6837('0x1a')]&&_[_0x6837('0x1b')](_0x11504d,_0x3627fd[_0x6837('0x1a')])){_0x5e198f['push']({'app':_0x6837('0xb'),'appdata':_0x6837('0x1c')});_0x5e198f['push']({'app':_0x6837('0xb'),'appdata':util['format'](_0x6837('0x1d'),_0x3627fd[_0x6837('0x1a')])});_0x5e198f[_0x6837('0x9')]({'app':_0x6837('0x1e'),'appdata':util[_0x6837('0x6')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0x3627fd[_0x6837('0x1f')])});}else{_0x5e198f['push']({'app':'Dial','appdata':util[_0x6837('0x6')]('SIP/%s,,tTxX',_0x3627fd[_0x6837('0x1f')])});}_0x5e198f[_0x6837('0x9')]({'app':'Hangup'});for(var _0x2b33bf=0x0;_0x2b33bf<_0x5e198f['length'];_0x2b33bf++){_0x5e198f[_0x2b33bf][_0x6837('0x20')]=_0x2b33bf+0x1;_0x5e198f[_0x2b33bf]=_[_0x6837('0x21')](_0x5e198f[_0x2b33bf],_0xf63e86);}return _0x5e198f;};var getChanSpyPromise=function(_0x515f95,_0x5f573f){return new BPromise(function(_0x577c7e,_0xfbb3e3){return _0x515f95[_0x6837('0x22')][_0x6837('0x23')]()[_0x6837('0x24')](function(_0x4d040b){if(_0x4d040b){var _0x37b78b=getChanSpyApplications(_0x5f573f,_0x5f573f[_0x6837('0x25')],_0x4d040b);if(_0x5f573f[_0x6837('0x25')]!=_0x5f573f['name']){_0x37b78b=_0x37b78b[_0x6837('0x26')](getChanSpyApplications(_0x5f573f,_0x5f573f[_0x6837('0x1f')],_0x4d040b));}return _0x577c7e(_0x37b78b);}return _0x577c7e([]);})['catch'](function(_0x5a8d51){_0xfbb3e3(_0x5a8d51);});});};module[_0x6837('0x27')]=function(_0x1dd6f3,_0x2e76e2){var _0x520a24=_0x1dd6f3[_0x6837('0x28')];return _0x1dd6f3[_0x6837('0x29')](_0x6837('0x2a'),attributes,{'tableName':_0x6837('0x2b'),'charset':_0x6837('0x2c'),'collate':_0x6837('0x2d'),'hooks':{'beforeCreate':function(_0x1e0b2e,_0x11ee48,_0x45552a){var _0x3676db=typeof _0x1e0b2e[_0x6837('0x2e')]===_0x6837('0x2f')?BPromise[_0x6837('0x30')](null):_0x520a24[_0x6837('0x31')][_0x6837('0x32')]({'where':{'id':_0x1e0b2e['userProfileId']}});_0x3676db[_0x6837('0x24')](function(_0x4be4f3){if(_0x4be4f3){_0x1e0b2e['privacyEnabled']=_0x4be4f3['privacyEnabled'];}})['then'](function(){_0x1e0b2e[_0x6837('0x33')]();_0x1e0b2e[_0x6837('0x34')](_0x45552a);})[_0x6837('0x35')](function(_0x2c93f7){_0x45552a(_0x2c93f7);});},'beforeUpdate':function(_0x31ba55,_0x1d28be,_0x299981){Promise[_0x6837('0x30')]()[_0x6837('0x24')](function(){if(_0x31ba55[_0x6837('0x36')](_0x6837('0x2e'))===![])return;return _0x520a24[_0x6837('0x31')][_0x6837('0x32')]({'where':{'id':_0x31ba55[_0x6837('0x2e')]}})['then'](function(_0x2667f3){if(_0x2667f3)_0x31ba55[_0x6837('0x37')]=_0x2667f3[_0x6837('0x37')];return;});})[_0x6837('0x24')](function(){if(_0x31ba55['changed'](_0x6837('0x13'))){_0x31ba55[_0x6837('0x33')]();return _0x31ba55[_0x6837('0x34')](_0x299981);}_0x299981();})[_0x6837('0x35')](function(_0x5858c8){_0x299981(_0x5858c8);});},'afterCreate':function(_0x27cb26,_0x199539,_0x373669){var _0x6d20fd=getUserApplications(_0x27cb26,_0x27cb26['internal']);if(_0x27cb26[_0x6837('0x25')]!=_0x27cb26[_0x6837('0x1f')]){_0x6d20fd=_0x6d20fd[_0x6837('0x26')](getUserApplications(_0x27cb26,_0x27cb26[_0x6837('0x1f')]));}return _0x520a24[_0x6837('0x38')]['bulkCreate'](_0x6d20fd)[_0x6837('0x24')](function(){if(_0x27cb26[_0x6837('0xd')]){return getChanSpyPromise(_0x520a24,_0x27cb26);}})[_0x6837('0x24')](function(_0x1986d3){if(_0x1986d3&&_0x1986d3[_0x6837('0x3')]){return _0x520a24['VoiceExtension'][_0x6837('0x39')](_0x1986d3);}})['then'](function(){_0x373669();})[_0x6837('0x35')](function(_0x3fc021){_0x373669(_0x3fc021);});},'afterUpdate':function(_0x59192e,_0x1b89b9,_0x5bca98){return BPromise[_0x6837('0x30')]()[_0x6837('0x24')](function(){if(_0x59192e['changed']('chanspy')||_0x59192e[_0x6837('0x36')](_0x6837('0x4'))){return _0x520a24[_0x6837('0x38')][_0x6837('0x3a')]({'where':{'UserId':_0x59192e['id'],'type':_0x6837('0x18'),'ChanSpyId':{'$ne':null}}})['then'](function(){if(_0x59192e[_0x6837('0xd')]){return getChanSpyPromise(_0x520a24,_0x59192e)['then'](function(_0xb89f51){if(_0xb89f51&&_0xb89f51[_0x6837('0x3')]){return _0x520a24[_0x6837('0x38')]['bulkCreate'](_0xb89f51);}});}});}})[_0x6837('0x24')](function(){if(_0x59192e[_0x6837('0x36')](_0x6837('0x1a'))||_0x59192e['changed'](_0x6837('0x4'))){return _0x520a24['VoiceExtension'][_0x6837('0x3a')]({'where':{'UserId':_0x59192e['id'],'type':_0x6837('0x18'),'ChanSpyId':null}})[_0x6837('0x24')](function(){var _0x308f73=getUserApplications(_0x59192e,_0x59192e[_0x6837('0x25')]);if(_0x59192e[_0x6837('0x25')]!=_0x59192e[_0x6837('0x1f')]){_0x308f73=_0x308f73[_0x6837('0x26')](getUserApplications(_0x59192e,_0x59192e[_0x6837('0x1f')]));}return _0x520a24[_0x6837('0x38')]['bulkCreate'](_0x308f73);});}})[_0x6837('0x24')](function(){_0x5bca98();})[_0x6837('0x35')](function(_0x3b68a7){_0x5bca98(_0x3b68a7);});},'afterDestroy':function(_0x644026,_0x2fccf2){return _0x520a24[_0x6837('0x38')]['destroy']({'where':{'UserId':_0x644026['id'],'type':'system'}});}},'instanceMethods':{'authenticate':function(_0x251d22,_0xe5c37d){if(!_0xe5c37d){return this[_0x6837('0x13')]===this[_0x6837('0x3b')](_0x251d22);}var _0x167732=this;this[_0x6837('0x3b')](_0x251d22,function(_0x485bdd,_0x44df34){if(_0x485bdd){_0xe5c37d(_0x485bdd);}if(_0x167732[_0x6837('0x13')]===_0x44df34){_0xe5c37d(null,!![]);}else{_0xe5c37d(null,![]);}});},'makeSalt':function(_0x189cd6,_0x334494){var _0x1ef04b=0x10;if(typeof arguments[0x0]===_0x6837('0x3c')){_0x334494=arguments[0x0];_0x189cd6=_0x1ef04b;}else if(typeof arguments[0x1]===_0x6837('0x3c')){_0x334494=arguments[0x1];}else{throw new Error(_0x6837('0x3d'));}if(!_0x189cd6){_0x189cd6=_0x1ef04b;}return crypto[_0x6837('0x3e')](_0x189cd6,function(_0x567ebd,_0x153eca){if(_0x567ebd){_0x334494(_0x567ebd);}return _0x334494(null,_0x153eca[_0x6837('0x3f')](_0x6837('0x40')));});},'encryptPassword':function(_0x1a2dfb,_0x10e7f4){if(!_0x1a2dfb||!this[_0x6837('0x41')]){return _0x10e7f4?_0x10e7f4(null):null;}var _0x2ef7a7=0x2710;var _0xc5340b=0x40;var _0x1a560a=new Buffer(this[_0x6837('0x41')],_0x6837('0x40'));if(!_0x10e7f4){return crypto[_0x6837('0x42')](_0x1a2dfb,_0x1a560a,_0x2ef7a7,_0xc5340b,'sha1')[_0x6837('0x3f')](_0x6837('0x40'));}return crypto[_0x6837('0x43')](_0x1a2dfb,_0x1a560a,_0x2ef7a7,_0xc5340b,'sha1',function(_0x20c4fa,_0x547e59){if(_0x20c4fa){_0x10e7f4(_0x20c4fa);}return _0x10e7f4(null,_0x547e59['toString']('base64'));});},'updatePassword':function(_0x34038c){if(!this[_0x6837('0x13')]){return _0x34038c(null);}if(!validatePresenceOf(this[_0x6837('0x13')])&&authTypes['indexOf'](this[_0x6837('0x44')])===-0x1){_0x34038c(new Error('Invalid\x20password'));}var _0x26ee5b=this;this[_0x6837('0x45')](function(_0x2223ea,_0x543def){if(_0x2223ea){return _0x34038c(_0x2223ea);}_0x26ee5b[_0x6837('0x41')]=_0x543def;_0x26ee5b['encryptPassword'](_0x26ee5b['password'],function(_0x4a57ae,_0xace1e3){if(_0x4a57ae){_0x34038c(_0x4a57ae);}_0x26ee5b['password']=_0xace1e3;_0x34038c(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this[_0x6837('0x1f')]+_0x6837('0x46')+this[_0x6837('0x13')]);return this[_0x6837('0x47')];}}});};
\ No newline at end of file
index 53ead47..9f41b12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2b6=['agents','getVoiceQueues','UserVoiceQueue.penalty','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','then','User,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetUser','User','options','raw','where','limit','include','map','model','attributes','debug','ShowUser','PauseUser','find','name','role','internal','interface','update','MemberReport','findAll','PAUSE','length','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','YYYY-MM-DD\x20HH:mm:ss','body','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','findOne','channel','isValidChannel','Unknown\x20channel','UserVoiceQueueRt','system','mail','chat','fax','sms','set','all','destroy','LoginUser','phone','loginInPause','../../config/license/util','getLicense'];(function(_0x687c0b,_0x562538){var _0x553aa6=function(_0x102596){while(--_0x102596){_0x687c0b['push'](_0x687c0b['shift']());}};_0x553aa6(++_0x562538);}(_0xe2b6,0x1bf));var _0x6e2b=function(_0x5ddfb2,_0x177a8c){_0x5ddfb2=_0x5ddfb2-0x0;var _0x5cbed9=_0xe2b6[_0x5ddfb2];return _0x5cbed9;};'use strict';var _=require(_0x6e2b('0x0'));var util=require(_0x6e2b('0x1'));var moment=require(_0x6e2b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e2b('0x3'));var db=require(_0x6e2b('0x4'))['db'];var utils=require(_0x6e2b('0x5'));var logger=require(_0x6e2b('0x6'))(_0x6e2b('0x7'));var config=require('../../config/environment');var jayson=require(_0x6e2b('0x8'));var client=jayson[_0x6e2b('0x9')][_0x6e2b('0xa')]({'port':0x232a});config[_0x6e2b('0xb')]=_[_0x6e2b('0xc')](config['redis'],{'host':_0x6e2b('0xd'),'port':0x18eb});var socket=require(_0x6e2b('0xe'))(new Redis(config['redis']));require(_0x6e2b('0xf'))[_0x6e2b('0x10')](socket);function respondWithRpcPromise(_0x4572b8,_0x598a7a,_0x4cea4f){return new BPromise(function(_0x214427,_0x1e533c){return client['request'](_0x4572b8,_0x4cea4f)[_0x6e2b('0x11')](function(_0x281153){logger['info'](_0x6e2b('0x12'),_0x598a7a,_0x6e2b('0x13'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x598a7a,_0x6e2b('0x13'),JSON[_0x6e2b('0x14')](_0x281153));if(_0x281153[_0x6e2b('0x15')]){if(_0x281153[_0x6e2b('0x15')][_0x6e2b('0x16')]===0x1f4){logger[_0x6e2b('0x15')](_0x6e2b('0x12'),_0x598a7a,_0x281153['error']['message']);return _0x1e533c(_0x281153[_0x6e2b('0x15')]['message']);}logger['error']('User,\x20%s,\x20%s',_0x598a7a,_0x281153['error'][_0x6e2b('0x17')]);return _0x214427(_0x281153[_0x6e2b('0x15')][_0x6e2b('0x17')]);}else{logger[_0x6e2b('0x18')]('User,\x20%s,\x20%s',_0x598a7a,_0x6e2b('0x13'));_0x214427(_0x281153[_0x6e2b('0x19')][_0x6e2b('0x17')]);}})[_0x6e2b('0x1a')](function(_0x2528ca){logger[_0x6e2b('0x15')]('User,\x20%s,\x20%s',_0x598a7a,_0x2528ca);_0x1e533c(_0x2528ca);});});}exports[_0x6e2b('0x1b')]=function(_0x2042c1){var _0x19bf85=this;return new Promise(function(_0x5d4d86,_0x235091){return db[_0x6e2b('0x1c')]['findAll']({'raw':_0x2042c1[_0x6e2b('0x1d')]?_0x2042c1['options'][_0x6e2b('0x1e')]===undefined?!![]:![]:!![],'where':_0x2042c1[_0x6e2b('0x1d')]?_0x2042c1['options'][_0x6e2b('0x1f')]||null:null,'attributes':_0x2042c1[_0x6e2b('0x1d')]?_0x2042c1['options']['attributes']||null:null,'limit':_0x2042c1['options']?_0x2042c1[_0x6e2b('0x1d')][_0x6e2b('0x20')]||null:null,'include':_0x2042c1[_0x6e2b('0x1d')]?_0x2042c1[_0x6e2b('0x1d')][_0x6e2b('0x21')]?_[_0x6e2b('0x22')](_0x2042c1[_0x6e2b('0x1d')][_0x6e2b('0x21')],function(_0x2ebe09){return{'model':db[_0x2ebe09[_0x6e2b('0x23')]],'as':_0x2ebe09['as'],'attributes':_0x2ebe09[_0x6e2b('0x24')],'include':_0x2ebe09[_0x6e2b('0x21')]?_['map'](_0x2ebe09[_0x6e2b('0x21')],function(_0x5766b1){return{'model':db[_0x5766b1[_0x6e2b('0x23')]],'as':_0x5766b1['as'],'attributes':_0x5766b1[_0x6e2b('0x24')],'include':_0x5766b1[_0x6e2b('0x21')]?_[_0x6e2b('0x22')](_0x5766b1['include'],function(_0x453d1f){return{'model':db[_0x453d1f[_0x6e2b('0x23')]],'as':_0x453d1f['as'],'attributes':_0x453d1f[_0x6e2b('0x24')]};}):[]};}):[]};}):[]:[]})[_0x6e2b('0x11')](function(_0x39650){logger[_0x6e2b('0x18')](_0x6e2b('0x1b'),_0x2042c1);logger[_0x6e2b('0x25')](_0x6e2b('0x1b'),_0x2042c1,JSON[_0x6e2b('0x14')](_0x39650));_0x5d4d86(_0x39650);})[_0x6e2b('0x1a')](function(_0x525aef){logger[_0x6e2b('0x15')](_0x6e2b('0x1b'),_0x525aef[_0x6e2b('0x17')],_0x2042c1);_0x235091(_0x19bf85[_0x6e2b('0x15')](0x1f4,_0x525aef['message']));});});};exports[_0x6e2b('0x26')]=function(_0x3bb1c2){var _0x51fca9=this;return new Promise(function(_0x6ec1ad,_0x26432e){return db[_0x6e2b('0x1c')]['find']({'raw':_0x3bb1c2[_0x6e2b('0x1d')]?_0x3bb1c2[_0x6e2b('0x1d')][_0x6e2b('0x1e')]===undefined?!![]:![]:!![],'where':_0x3bb1c2[_0x6e2b('0x1d')]?_0x3bb1c2[_0x6e2b('0x1d')]['where']||null:null,'attributes':_0x3bb1c2[_0x6e2b('0x1d')]?_0x3bb1c2[_0x6e2b('0x1d')][_0x6e2b('0x24')]||null:null,'include':_0x3bb1c2[_0x6e2b('0x1d')]?_0x3bb1c2[_0x6e2b('0x1d')]['include']?_[_0x6e2b('0x22')](_0x3bb1c2[_0x6e2b('0x1d')][_0x6e2b('0x21')],function(_0x5d4185){return{'model':db[_0x5d4185[_0x6e2b('0x23')]],'as':_0x5d4185['as'],'attributes':_0x5d4185[_0x6e2b('0x24')],'include':_0x5d4185[_0x6e2b('0x21')]?_['map'](_0x5d4185['include'],function(_0x21a99a){return{'model':db[_0x21a99a[_0x6e2b('0x23')]],'as':_0x21a99a['as'],'attributes':_0x21a99a[_0x6e2b('0x24')],'include':_0x21a99a[_0x6e2b('0x21')]?_[_0x6e2b('0x22')](_0x21a99a[_0x6e2b('0x21')],function(_0x548f7f){return{'model':db[_0x548f7f[_0x6e2b('0x23')]],'as':_0x548f7f['as'],'attributes':_0x548f7f[_0x6e2b('0x24')]};}):[]};}):[]};}):[]:[]})[_0x6e2b('0x11')](function(_0x26c176){logger[_0x6e2b('0x18')](_0x6e2b('0x26'),_0x3bb1c2);logger[_0x6e2b('0x25')](_0x6e2b('0x26'),_0x3bb1c2,JSON[_0x6e2b('0x14')](_0x26c176));_0x6ec1ad(_0x26c176);})[_0x6e2b('0x1a')](function(_0x460f38){logger[_0x6e2b('0x15')](_0x6e2b('0x26'),_0x460f38[_0x6e2b('0x17')],_0x3bb1c2);_0x26432e(_0x51fca9[_0x6e2b('0x15')](0x1f4,_0x460f38[_0x6e2b('0x17')]));});});};exports[_0x6e2b('0x27')]=function(_0x3a31c1){var _0x399a42=this;return new Promise(function(_0x2b5780,_0x13d086){var _0x1f363c;return db['User'][_0x6e2b('0x28')]({'where':_0x3a31c1[_0x6e2b('0x1d')][_0x6e2b('0x1f')]||{},'attributes':['id',_0x6e2b('0x29'),_0x6e2b('0x2a'),_0x6e2b('0x2b'),_0x6e2b('0x2c')]})[_0x6e2b('0x11')](function(_0x4fe17d){if(_0x4fe17d){_0x1f363c=_0x4fe17d;return db['UserVoiceQueueRt'][_0x6e2b('0x2d')]({'paused':0x1},{'where':{'UserId':_0x1f363c['id']},'individualHooks':!![]});}})[_0x6e2b('0x11')](function(){if(_0x1f363c){return db[_0x6e2b('0x2e')][_0x6e2b('0x2f')]({'where':{'membername':_0x1f363c[_0x6e2b('0x29')],'type':_0x6e2b('0x30'),'exitAt':null}});}})[_0x6e2b('0x11')](function(_0x33439d){if(_0x1f363c){if(_0x33439d&&_0x33439d[_0x6e2b('0x31')]){var _0xc6c653=moment()[_0x6e2b('0x32')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2e60b3=0x0,_0x3880db=_0x33439d[_0x6e2b('0x31')];_0x2e60b3<_0x3880db;_0x2e60b3++){_0x33439d[_0x2e60b3][_0x6e2b('0x33')]({'exitAt':_0xc6c653});}}}})['then'](function(){if(_0x1f363c){var _0x2fed92=[];var _0x307203=utils[_0x6e2b('0x34')]();_0x307203[_0x6e2b('0x35')](function(_0x256075){_0x2fed92[_0x6e2b('0x36')]({'channel':_0x256075,'membername':_0x1f363c[_0x6e2b('0x29')],'interface':_[_0x6e2b('0x37')](_0x1f363c['interface'])?util[_0x6e2b('0x32')](_0x6e2b('0x38'),_0x1f363c[_0x6e2b('0x29')]):_0x1f363c[_0x6e2b('0x2c')],'type':_0x6e2b('0x30'),'enterAt':moment()[_0x6e2b('0x32')](_0x6e2b('0x39')),'data1':_0x3a31c1[_0x6e2b('0x3a')][_0x6e2b('0x3b')]||_0x6e2b('0x3c'),'role':_0x1f363c[_0x6e2b('0x2a')],'internal':_0x1f363c[_0x6e2b('0x2b')],'uniqueid':_0x3a31c1['body'][_0x6e2b('0x3d')]||null});});return db['MemberReport'][_0x6e2b('0x3e')](_0x2fed92,{'individualHooks':!![]});}})[_0x6e2b('0x11')](function(){if(_0x1f363c){return _0x1f363c[_0x6e2b('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3a31c1['body'][_0x6e2b('0x3b')]||_0x6e2b('0x3c'),'lastPauseAt':moment()['format'](_0x6e2b('0x39'))});}})[_0x6e2b('0x11')](function(_0xbe6aae){_0x2b5780(_0xbe6aae);})[_0x6e2b('0x1a')](function(_0x32691d){_0x13d086(_0x399a42['error'](0x1f4,_0x32691d[_0x6e2b('0x17')]));});});};exports['UnpauseUser']=function(_0x377ae6){var _0x3ea256=this;return new Promise(function(_0xef2218,_0x3e266e){var _0x849050;return db[_0x6e2b('0x1c')][_0x6e2b('0x3f')]({'where':_0x377ae6[_0x6e2b('0x1d')][_0x6e2b('0x1f')]||{},'attributes':['id',_0x6e2b('0x29')]})['then'](function(_0x3eda76){if(_0x3eda76){_0x849050=_0x3eda76;if(_0x377ae6[_0x6e2b('0x3a')][_0x6e2b('0x40')]&&!utils[_0x6e2b('0x41')](_0x377ae6[_0x6e2b('0x3a')][_0x6e2b('0x40')])){throw new Error(_0x6e2b('0x42'));}switch(_0x377ae6[_0x6e2b('0x3a')][_0x6e2b('0x40')]){case'voice':return db[_0x6e2b('0x43')][_0x6e2b('0x2d')]({'paused':0x0},{'where':{'UserId':_0x849050['id']}})[_0x6e2b('0x11')](function(){return db[_0x6e2b('0x2e')][_0x6e2b('0x28')]({'where':{'channel':_0x377ae6[_0x6e2b('0x3a')][_0x6e2b('0x40')],'membername':_0x849050['name'],'type':_0x6e2b('0x30'),'exitAt':null}});})[_0x6e2b('0x11')](function(_0x791f91){if(_0x791f91){return _0x791f91[_0x6e2b('0x2d')]({'exitAt':moment()['format'](_0x6e2b('0x39')),'data2':_0x6e2b('0x44')},{'individualHooks':!![]});}return null;})[_0x6e2b('0x11')](function(){return _0x849050[_0x6e2b('0x2d')]({'voicePause':![]});});case _0x6e2b('0x45'):case _0x6e2b('0x46'):case _0x6e2b('0x47'):case _0x6e2b('0x48'):case'openchannel':case'whatsapp':return db[_0x6e2b('0x2e')][_0x6e2b('0x28')]({'where':{'channel':_0x377ae6[_0x6e2b('0x3a')][_0x6e2b('0x40')],'membername':_0x849050['name'],'type':_0x6e2b('0x30'),'exitAt':null}})[_0x6e2b('0x11')](function(_0x1750e1){return _0x1750e1[_0x6e2b('0x2d')]({'exitAt':moment()[_0x6e2b('0x32')](_0x6e2b('0x39')),'data2':_0x6e2b('0x44')},{'individualHooks':!![]});})[_0x6e2b('0x11')](function(){var _0x27740f={};_[_0x6e2b('0x49')](_0x27740f,util[_0x6e2b('0x32')]('%s%s',_0x377ae6[_0x6e2b('0x3a')][_0x6e2b('0x40')],'Pause'),![]);return _0x849050[_0x6e2b('0x2d')](_0x27740f);});default:return db[_0x6e2b('0x43')][_0x6e2b('0x2d')]({'paused':0x0},{'where':{'UserId':_0x849050['id']}})[_0x6e2b('0x11')](function(){return db['MemberReport'][_0x6e2b('0x2f')]({'where':{'membername':_0x849050[_0x6e2b('0x29')],'type':_0x6e2b('0x30'),'exitAt':null}});})[_0x6e2b('0x11')](function(_0x2316de){var _0x17b110=[];_0x2316de[_0x6e2b('0x35')](function(_0x5a20c2){_0x17b110[_0x6e2b('0x36')](_0x5a20c2['update']({'exitAt':moment()[_0x6e2b('0x32')](_0x6e2b('0x39')),'data2':_0x6e2b('0x44')}));});return BPromise[_0x6e2b('0x4a')](_0x17b110);})[_0x6e2b('0x11')](function(){return _0x849050['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x6e2b('0x11')](function(_0x52f08a){_0xef2218(_0x52f08a);})[_0x6e2b('0x1a')](function(_0x4e04b7){_0x3e266e(_0x3ea256[_0x6e2b('0x15')](0x1f4,_0x4e04b7[_0x6e2b('0x17')]));});});};exports['LogoutUser']=function(_0x499262){var _0x48db9d=this;return new Promise(function(_0x17e336,_0x2ec5d9){var _0x23e996;return db[_0x6e2b('0x1c')][_0x6e2b('0x3f')]({'where':_0x499262[_0x6e2b('0x1d')][_0x6e2b('0x1f')]||{},'attributes':['id',_0x6e2b('0x29')]})[_0x6e2b('0x11')](function(_0x30d370){if(_0x30d370){_0x23e996=_0x30d370;return db[_0x6e2b('0x43')][_0x6e2b('0x4b')]({'where':{'membername':_0x23e996['name']},'individualHooks':!![]});}})[_0x6e2b('0x11')](function(){if(_0x23e996){return db[_0x6e2b('0x2e')]['findAll']({'where':{'membername':_0x23e996[_0x6e2b('0x29')],'exitAt':null}});}})[_0x6e2b('0x11')](function(_0x398186){if(_0x23e996){if(_0x398186&&_0x398186[_0x6e2b('0x31')]){var _0x1fd3c6=[];_0x398186[_0x6e2b('0x35')](function(_0x17ec2a){_0x1fd3c6[_0x6e2b('0x36')](_0x17ec2a[_0x6e2b('0x2d')]({'exitAt':moment()[_0x6e2b('0x32')](_0x6e2b('0x39'))}));});return BPromise[_0x6e2b('0x4a')](_0x1fd3c6);}}})[_0x6e2b('0x11')](function(){if(_0x23e996){return _0x23e996['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x6e2b('0x11')](function(_0x17c921){_0x17e336(_0x17c921);})[_0x6e2b('0x1a')](function(_0x29b69e){_0x2ec5d9(_0x48db9d[_0x6e2b('0x15')](0x1f4,_0x29b69e[_0x6e2b('0x17')]));});});};exports[_0x6e2b('0x4c')]=function(_0x233f5f){var _0x36688e=this;return new Promise(function(_0x1d8fbc,_0x1c9e70){var _0x1fa595;var _0xf2f48e;var _0x4d50b0;var _0x18c75c;return db[_0x6e2b('0x1c')][_0x6e2b('0x3f')]({'where':_0x233f5f['options'][_0x6e2b('0x1f')]||{},'attributes':['id',_0x6e2b('0x29'),_0x6e2b('0x2a'),'mobile',_0x6e2b('0x4d'),'internal',_0x6e2b('0x4e'),_0x6e2b('0x2c')]})[_0x6e2b('0x11')](function(_0x1cf5bb){if(_0x1cf5bb){_0x1fa595=_0x1cf5bb;_0x18c75c=_0x233f5f[_0x6e2b('0x3a')][_0x6e2b('0x2c')]?_0x233f5f[_0x6e2b('0x3a')][_0x6e2b('0x2c')]:util[_0x6e2b('0x32')](_0x6e2b('0x38'),_0x1fa595[_0x6e2b('0x29')]);return db[_0x6e2b('0x1c')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1fa595['id']}}});}})[_0x6e2b('0x11')](function(_0x34cb22){if(_0x34cb22){_0x4d50b0=_0x34cb22;return require(_0x6e2b('0x4f'))[_0x6e2b('0x50')]();}})[_0x6e2b('0x11')](function(_0x434ea0){if(_0x434ea0&&_0x434ea0['agents']&&_0x4d50b0>=_0x434ea0[_0x6e2b('0x51')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x1fa595){return db['UserVoiceQueueRt'][_0x6e2b('0x4b')]({'where':{'membername':_0x1fa595[_0x6e2b('0x29')]},'individualHooks':!![]});}})['then'](function(){if(_0x1fa595){return _0x1fa595[_0x6e2b('0x52')]({'raw':!![]});}})[_0x6e2b('0x11')](function(_0x29ac0f){if(_0x1fa595){if(_0x29ac0f){var _0x1d1b61=[];_0xf2f48e=_0x29ac0f;if(_0xf2f48e['length']){for(var _0x1b5b84=0x0;_0x1b5b84<_0xf2f48e[_0x6e2b('0x31')];_0x1b5b84++){_0x1d1b61['push'](db[_0x6e2b('0x43')]['upsert']({'membername':_0x1fa595['name'],'UserId':_0x1fa595['id'],'queue_name':_0xf2f48e[_0x1b5b84][_0x6e2b('0x29')],'VoiceQueueId':_0xf2f48e[_0x1b5b84]['id'],'interface':_0x18c75c,'paused':_0x1fa595[_0x6e2b('0x4e')]||![],'penalty':_0xf2f48e[_0x1b5b84][_0x6e2b('0x53')]||0x0}));}return BPromise[_0x6e2b('0x4a')](_0x1d1b61);}}}})[_0x6e2b('0x11')](function(){if(_0x1fa595){return db[_0x6e2b('0x2e')][_0x6e2b('0x2f')]({'where':{'membername':_0x1fa595[_0x6e2b('0x29')],'exitAt':null}});}})[_0x6e2b('0x11')](function(_0x32075a){if(_0x1fa595){if(_0x32075a&&_0x32075a[_0x6e2b('0x31')]){var _0x36019c=[];_0x32075a[_0x6e2b('0x35')](function(_0x186c9f){_0x36019c[_0x6e2b('0x36')](_0x186c9f[_0x6e2b('0x2d')]({'exitAt':moment()[_0x6e2b('0x32')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x36019c);}}})['then'](function(_0x502e73){if(_0x1fa595){var _0x22880c=[];var _0x3eb624=[];var _0x173067=utils['getChannels']();var _0x32d19e={'membername':_0x1fa595['name'],'interface':_0x18c75c,'enterAt':moment()[_0x6e2b('0x32')](_0x6e2b('0x39')),'role':_0x1fa595[_0x6e2b('0x2a')],'internal':_0x1fa595['internal']};_0x173067['forEach'](function(_0x15d021){_0x22880c['push'](_['merge']({'channel':_0x15d021,'type':_0x6e2b('0x54'),'data1':_0x6e2b('0x55'),'data2':_0x18c75c},_0x32d19e));if(_0x1fa595[_0x6e2b('0x4e')]){_0x3eb624[_0x6e2b('0x36')](_['merge']({'channel':_0x15d021,'type':_0x6e2b('0x30'),'data1':_0x6e2b('0x56')},_0x32d19e));}});return db[_0x6e2b('0x2e')][_0x6e2b('0x3e')](_0x22880c[_0x6e2b('0x57')](_0x3eb624),{'individualHooks':!![]});}})[_0x6e2b('0x11')](function(){if(_0x1fa595){return _0x1fa595[_0x6e2b('0x2d')]({'online':!![],'lastLoginAt':moment()[_0x6e2b('0x32')](_0x6e2b('0x39')),'voicePause':_0x1fa595['loginInPause']||![],'mailPause':_0x1fa595['loginInPause']||![],'chatPause':_0x1fa595['loginInPause']||![],'faxPause':_0x1fa595[_0x6e2b('0x4e')]||![],'smsPause':_0x1fa595['loginInPause']||![],'openchannelPause':_0x1fa595[_0x6e2b('0x4e')]||![],'pauseType':_0x1fa595[_0x6e2b('0x4e')]?_0x6e2b('0x56'):null,'lastPauseAt':moment()[_0x6e2b('0x32')](_0x6e2b('0x39')),'interface':_0x18c75c});}})['then'](function(_0x91ffa3){_0x1d8fbc(_0x91ffa3);})[_0x6e2b('0x1a')](function(_0x3df861){_0x1c9e70(_0x36688e[_0x6e2b('0x15')](0x1f4,_0x3df861[_0x6e2b('0x17')]));});});};
\ No newline at end of file
+var _0x4057=['map','attributes','model','then','find','ShowUser','PauseUser','name','internal','interface','UserVoiceQueueRt','update','MemberReport','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','getChannels','push','isNil','format','SIP/%s','body','DEFAULT\x20PAUSE','role','uniqueid','bulkCreate','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','system','mail','chat','fax','sms','openchannel','LogoutUser','destroy','all','LoginUser','../../config/license/util','getLicense','agents','getVoiceQueues','UserVoiceQueue.penalty','forEach','merge','LOGIN','callysquare','loginInPause','LOGININPAUSE','concat','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','register','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetUser','User','findAll','options','raw','where','limit','include'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x4057,0xdf));var _0x7405=function(_0x1bc9ff,_0xa70baa){_0x1bc9ff=_0x1bc9ff-0x0;var _0x17f01c=_0x4057[_0x1bc9ff];return _0x17f01c;};'use strict';var _=require('lodash');var util=require(_0x7405('0x0'));var moment=require(_0x7405('0x1'));var BPromise=require('bluebird');var rs=require(_0x7405('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7405('0x3'))['db'];var utils=require(_0x7405('0x4'));var logger=require('../../config/logger')(_0x7405('0x5'));var config=require(_0x7405('0x6'));var jayson=require(_0x7405('0x7'));var client=jayson[_0x7405('0x8')][_0x7405('0x9')]({'port':0x232a});config['redis']=_[_0x7405('0xa')](config[_0x7405('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./user.socket')[_0x7405('0xc')](socket);function respondWithRpcPromise(_0x33d121,_0xae9bdc,_0x382a3d){return new BPromise(function(_0x5767ad,_0x5ed7e8){return client[_0x7405('0xd')](_0x33d121,_0x382a3d)['then'](function(_0x36a96a){logger[_0x7405('0xe')](_0x7405('0xf'),_0xae9bdc,_0x7405('0x10'));logger[_0x7405('0x11')](_0x7405('0x12'),_0xae9bdc,_0x7405('0x10'),JSON[_0x7405('0x13')](_0x36a96a));if(_0x36a96a['error']){if(_0x36a96a[_0x7405('0x14')]['code']===0x1f4){logger[_0x7405('0x14')](_0x7405('0xf'),_0xae9bdc,_0x36a96a[_0x7405('0x14')]['message']);return _0x5ed7e8(_0x36a96a[_0x7405('0x14')]['message']);}logger[_0x7405('0x14')]('User,\x20%s,\x20%s',_0xae9bdc,_0x36a96a[_0x7405('0x14')]['message']);return _0x5767ad(_0x36a96a[_0x7405('0x14')][_0x7405('0x15')]);}else{logger[_0x7405('0xe')](_0x7405('0xf'),_0xae9bdc,'request\x20sent');_0x5767ad(_0x36a96a[_0x7405('0x16')]['message']);}})[_0x7405('0x17')](function(_0xc13fbd){logger[_0x7405('0x14')](_0x7405('0xf'),_0xae9bdc,_0xc13fbd);_0x5ed7e8(_0xc13fbd);});});}exports[_0x7405('0x18')]=function(_0x5c91bf){var _0x2effee=this;return new Promise(function(_0x1e08c0,_0x1312df){return db[_0x7405('0x19')][_0x7405('0x1a')]({'raw':_0x5c91bf[_0x7405('0x1b')]?_0x5c91bf[_0x7405('0x1b')][_0x7405('0x1c')]===undefined?!![]:![]:!![],'where':_0x5c91bf['options']?_0x5c91bf[_0x7405('0x1b')][_0x7405('0x1d')]||null:null,'attributes':_0x5c91bf['options']?_0x5c91bf['options']['attributes']||null:null,'limit':_0x5c91bf[_0x7405('0x1b')]?_0x5c91bf['options'][_0x7405('0x1e')]||null:null,'include':_0x5c91bf[_0x7405('0x1b')]?_0x5c91bf[_0x7405('0x1b')][_0x7405('0x1f')]?_[_0x7405('0x20')](_0x5c91bf[_0x7405('0x1b')][_0x7405('0x1f')],function(_0x5d2ddc){return{'model':db[_0x5d2ddc['model']],'as':_0x5d2ddc['as'],'attributes':_0x5d2ddc[_0x7405('0x21')],'include':_0x5d2ddc['include']?_[_0x7405('0x20')](_0x5d2ddc['include'],function(_0x54543d){return{'model':db[_0x54543d['model']],'as':_0x54543d['as'],'attributes':_0x54543d[_0x7405('0x21')],'include':_0x54543d[_0x7405('0x1f')]?_[_0x7405('0x20')](_0x54543d[_0x7405('0x1f')],function(_0x4adef6){return{'model':db[_0x4adef6[_0x7405('0x22')]],'as':_0x4adef6['as'],'attributes':_0x4adef6[_0x7405('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7405('0x23')](function(_0x590c12){logger[_0x7405('0xe')](_0x7405('0x18'),_0x5c91bf);logger['debug']('GetUser',_0x5c91bf,JSON[_0x7405('0x13')](_0x590c12));_0x1e08c0(_0x590c12);})[_0x7405('0x17')](function(_0x287e5a){logger[_0x7405('0x14')](_0x7405('0x18'),_0x287e5a[_0x7405('0x15')],_0x5c91bf);_0x1312df(_0x2effee[_0x7405('0x14')](0x1f4,_0x287e5a['message']));});});};exports['ShowUser']=function(_0xb9983a){var _0x333f20=this;return new Promise(function(_0x5ac64e,_0x2e642d){return db[_0x7405('0x19')][_0x7405('0x24')]({'raw':_0xb9983a[_0x7405('0x1b')]?_0xb9983a[_0x7405('0x1b')][_0x7405('0x1c')]===undefined?!![]:![]:!![],'where':_0xb9983a[_0x7405('0x1b')]?_0xb9983a[_0x7405('0x1b')][_0x7405('0x1d')]||null:null,'attributes':_0xb9983a[_0x7405('0x1b')]?_0xb9983a[_0x7405('0x1b')]['attributes']||null:null,'include':_0xb9983a[_0x7405('0x1b')]?_0xb9983a[_0x7405('0x1b')][_0x7405('0x1f')]?_[_0x7405('0x20')](_0xb9983a['options'][_0x7405('0x1f')],function(_0xc6027e){return{'model':db[_0xc6027e['model']],'as':_0xc6027e['as'],'attributes':_0xc6027e[_0x7405('0x21')],'include':_0xc6027e[_0x7405('0x1f')]?_['map'](_0xc6027e[_0x7405('0x1f')],function(_0x4045e7){return{'model':db[_0x4045e7[_0x7405('0x22')]],'as':_0x4045e7['as'],'attributes':_0x4045e7[_0x7405('0x21')],'include':_0x4045e7['include']?_[_0x7405('0x20')](_0x4045e7[_0x7405('0x1f')],function(_0x463139){return{'model':db[_0x463139['model']],'as':_0x463139['as'],'attributes':_0x463139[_0x7405('0x21')]};}):[]};}):[]};}):[]:[]})[_0x7405('0x23')](function(_0x3d5727){logger[_0x7405('0xe')](_0x7405('0x25'),_0xb9983a);logger[_0x7405('0x11')](_0x7405('0x25'),_0xb9983a,JSON[_0x7405('0x13')](_0x3d5727));_0x5ac64e(_0x3d5727);})[_0x7405('0x17')](function(_0x258513){logger['error'](_0x7405('0x25'),_0x258513[_0x7405('0x15')],_0xb9983a);_0x2e642d(_0x333f20['error'](0x1f4,_0x258513[_0x7405('0x15')]));});});};exports[_0x7405('0x26')]=function(_0x2d6f25){var _0x32bc93=this;return new Promise(function(_0x2bc957,_0x31fe5a){var _0x1c55fd;return db[_0x7405('0x19')][_0x7405('0x24')]({'where':_0x2d6f25[_0x7405('0x1b')][_0x7405('0x1d')]||{},'attributes':['id',_0x7405('0x27'),'role',_0x7405('0x28'),_0x7405('0x29')]})[_0x7405('0x23')](function(_0x7411be){if(_0x7411be){_0x1c55fd=_0x7411be;return db[_0x7405('0x2a')][_0x7405('0x2b')]({'paused':0x1},{'where':{'UserId':_0x1c55fd['id']},'individualHooks':!![]});}})[_0x7405('0x23')](function(){if(_0x1c55fd){return db[_0x7405('0x2c')][_0x7405('0x1a')]({'where':{'membername':_0x1c55fd[_0x7405('0x27')],'type':_0x7405('0x2d'),'exitAt':null}});}})[_0x7405('0x23')](function(_0x56347d){if(_0x1c55fd){if(_0x56347d&&_0x56347d[_0x7405('0x2e')]){var _0x47c210=moment()['format'](_0x7405('0x2f'));for(var _0x25d349=0x0,_0x47d48c=_0x56347d[_0x7405('0x2e')];_0x25d349<_0x47d48c;_0x25d349++){_0x56347d[_0x25d349]['updateAttributes']({'exitAt':_0x47c210});}}}})[_0x7405('0x23')](function(){if(_0x1c55fd){var _0x465942=[];var _0x25ddc9=utils[_0x7405('0x30')]();_0x25ddc9['forEach'](function(_0x3cc2ee){_0x465942[_0x7405('0x31')]({'channel':_0x3cc2ee,'membername':_0x1c55fd[_0x7405('0x27')],'interface':_[_0x7405('0x32')](_0x1c55fd[_0x7405('0x29')])?util[_0x7405('0x33')](_0x7405('0x34'),_0x1c55fd[_0x7405('0x27')]):_0x1c55fd[_0x7405('0x29')],'type':'PAUSE','enterAt':moment()[_0x7405('0x33')](_0x7405('0x2f')),'data1':_0x2d6f25[_0x7405('0x35')]['type']||_0x7405('0x36'),'role':_0x1c55fd[_0x7405('0x37')],'internal':_0x1c55fd[_0x7405('0x28')],'uniqueid':_0x2d6f25[_0x7405('0x35')][_0x7405('0x38')]||null});});return db[_0x7405('0x2c')][_0x7405('0x39')](_0x465942,{'individualHooks':!![]});}})[_0x7405('0x23')](function(){if(_0x1c55fd){return _0x1c55fd[_0x7405('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x2d6f25[_0x7405('0x35')]['type']||_0x7405('0x36'),'lastPauseAt':moment()['format'](_0x7405('0x2f'))});}})[_0x7405('0x23')](function(_0xa7284e){_0x2bc957(_0xa7284e);})[_0x7405('0x17')](function(_0x4ff123){_0x31fe5a(_0x32bc93[_0x7405('0x14')](0x1f4,_0x4ff123['message']));});});};exports[_0x7405('0x3a')]=function(_0x11b946){var _0x9f6950=this;return new Promise(function(_0x3180ff,_0x242d4e){var _0x7133e8;return db[_0x7405('0x19')][_0x7405('0x3b')]({'where':_0x11b946['options'][_0x7405('0x1d')]||{},'attributes':['id','name']})[_0x7405('0x23')](function(_0x1808f3){if(_0x1808f3){_0x7133e8=_0x1808f3;if(_0x11b946[_0x7405('0x35')][_0x7405('0x3c')]&&!utils[_0x7405('0x3d')](_0x11b946[_0x7405('0x35')]['channel'])){throw new Error(_0x7405('0x3e'));}switch(_0x11b946[_0x7405('0x35')][_0x7405('0x3c')]){case'voice':return db[_0x7405('0x2a')]['update']({'paused':0x0},{'where':{'UserId':_0x7133e8['id']}})[_0x7405('0x23')](function(){return db[_0x7405('0x2c')][_0x7405('0x24')]({'where':{'channel':_0x11b946[_0x7405('0x35')][_0x7405('0x3c')],'membername':_0x7133e8[_0x7405('0x27')],'type':_0x7405('0x2d'),'exitAt':null}});})[_0x7405('0x23')](function(_0x5bdf33){if(_0x5bdf33){return _0x5bdf33[_0x7405('0x2b')]({'exitAt':moment()['format'](_0x7405('0x2f')),'data2':_0x7405('0x3f')},{'individualHooks':!![]});}return null;})[_0x7405('0x23')](function(){return _0x7133e8[_0x7405('0x2b')]({'voicePause':![]});});case _0x7405('0x40'):case _0x7405('0x41'):case _0x7405('0x42'):case _0x7405('0x43'):case _0x7405('0x44'):case'whatsapp':return db[_0x7405('0x2c')][_0x7405('0x24')]({'where':{'channel':_0x11b946['body']['channel'],'membername':_0x7133e8[_0x7405('0x27')],'type':_0x7405('0x2d'),'exitAt':null}})[_0x7405('0x23')](function(_0x5b8ad8){return _0x5b8ad8[_0x7405('0x2b')]({'exitAt':moment()[_0x7405('0x33')](_0x7405('0x2f')),'data2':_0x7405('0x3f')},{'individualHooks':!![]});})['then'](function(){var _0x3df286={};_['set'](_0x3df286,util[_0x7405('0x33')]('%s%s',_0x11b946[_0x7405('0x35')]['channel'],'Pause'),![]);return _0x7133e8[_0x7405('0x2b')](_0x3df286);});default:return db[_0x7405('0x2a')][_0x7405('0x2b')]({'paused':0x0},{'where':{'UserId':_0x7133e8['id']}})[_0x7405('0x23')](function(){return db['MemberReport'][_0x7405('0x1a')]({'where':{'membername':_0x7133e8[_0x7405('0x27')],'type':_0x7405('0x2d'),'exitAt':null}});})['then'](function(_0x3426d0){var _0x2a4607=[];_0x3426d0['forEach'](function(_0x3be798){_0x2a4607[_0x7405('0x31')](_0x3be798[_0x7405('0x2b')]({'exitAt':moment()[_0x7405('0x33')](_0x7405('0x2f')),'data2':'system'}));});return BPromise['all'](_0x2a4607);})[_0x7405('0x23')](function(){return _0x7133e8[_0x7405('0x2b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x7405('0x23')](function(_0x23d2ff){_0x3180ff(_0x23d2ff);})[_0x7405('0x17')](function(_0x5d2194){_0x242d4e(_0x9f6950['error'](0x1f4,_0x5d2194[_0x7405('0x15')]));});});};exports[_0x7405('0x45')]=function(_0x56f3ed){var _0x543852=this;return new Promise(function(_0xaa6629,_0xa2484){var _0x2842f3;return db[_0x7405('0x19')][_0x7405('0x3b')]({'where':_0x56f3ed[_0x7405('0x1b')][_0x7405('0x1d')]||{},'attributes':['id',_0x7405('0x27')]})[_0x7405('0x23')](function(_0x2ba8b5){if(_0x2ba8b5){_0x2842f3=_0x2ba8b5;return db[_0x7405('0x2a')][_0x7405('0x46')]({'where':{'membername':_0x2842f3['name']},'individualHooks':!![]});}})[_0x7405('0x23')](function(){if(_0x2842f3){return db[_0x7405('0x2c')][_0x7405('0x1a')]({'where':{'membername':_0x2842f3[_0x7405('0x27')],'exitAt':null}});}})['then'](function(_0x2ed25c){if(_0x2842f3){if(_0x2ed25c&&_0x2ed25c[_0x7405('0x2e')]){var _0x49641a=[];_0x2ed25c['forEach'](function(_0xfd806c){_0x49641a[_0x7405('0x31')](_0xfd806c[_0x7405('0x2b')]({'exitAt':moment()['format'](_0x7405('0x2f'))}));});return BPromise[_0x7405('0x47')](_0x49641a);}}})[_0x7405('0x23')](function(){if(_0x2842f3){return _0x2842f3[_0x7405('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x2c9538){_0xaa6629(_0x2c9538);})[_0x7405('0x17')](function(_0x27b688){_0xa2484(_0x543852[_0x7405('0x14')](0x1f4,_0x27b688[_0x7405('0x15')]));});});};exports[_0x7405('0x48')]=function(_0x3a67c6){var _0x2c9477=this;return new Promise(function(_0xa2ebd6,_0x3e750e){var _0x28de0f;var _0x3300cb;var _0x2dfeea;var _0x585a90;return db['User'][_0x7405('0x3b')]({'where':_0x3a67c6[_0x7405('0x1b')]['where']||{},'attributes':['id','name',_0x7405('0x37'),'mobile','phone',_0x7405('0x28'),'loginInPause',_0x7405('0x29')]})['then'](function(_0xdb8178){if(_0xdb8178){_0x28de0f=_0xdb8178;_0x585a90=_0x3a67c6[_0x7405('0x35')][_0x7405('0x29')]?_0x3a67c6['body']['interface']:util[_0x7405('0x33')](_0x7405('0x34'),_0x28de0f['name']);return db[_0x7405('0x19')]['count']({'where':{'role':'agent','online':!![],'id':{'$ne':_0x28de0f['id']}}});}})['then'](function(_0xe242){if(_0xe242){_0x2dfeea=_0xe242;return require(_0x7405('0x49'))[_0x7405('0x4a')]();}})[_0x7405('0x23')](function(_0x23f269){if(_0x23f269&&_0x23f269['agents']&&_0x2dfeea>=_0x23f269[_0x7405('0x4b')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x7405('0x23')](function(){if(_0x28de0f){return db[_0x7405('0x2a')][_0x7405('0x46')]({'where':{'membername':_0x28de0f['name']},'individualHooks':!![]});}})['then'](function(){if(_0x28de0f){return _0x28de0f[_0x7405('0x4c')]({'raw':!![]});}})['then'](function(_0x5a4b2b){if(_0x28de0f){if(_0x5a4b2b){var _0x4f87ba=[];_0x3300cb=_0x5a4b2b;if(_0x3300cb[_0x7405('0x2e')]){for(var _0x5639b6=0x0;_0x5639b6<_0x3300cb['length'];_0x5639b6++){_0x4f87ba[_0x7405('0x31')](db[_0x7405('0x2a')]['upsert']({'membername':_0x28de0f[_0x7405('0x27')],'UserId':_0x28de0f['id'],'queue_name':_0x3300cb[_0x5639b6][_0x7405('0x27')],'VoiceQueueId':_0x3300cb[_0x5639b6]['id'],'interface':_0x585a90,'paused':_0x28de0f['loginInPause']||![],'penalty':_0x3300cb[_0x5639b6][_0x7405('0x4d')]||0x0}));}return BPromise[_0x7405('0x47')](_0x4f87ba);}}}})[_0x7405('0x23')](function(){if(_0x28de0f){return db['MemberReport'][_0x7405('0x1a')]({'where':{'membername':_0x28de0f[_0x7405('0x27')],'exitAt':null}});}})[_0x7405('0x23')](function(_0x32bf3c){if(_0x28de0f){if(_0x32bf3c&&_0x32bf3c[_0x7405('0x2e')]){var _0x318502=[];_0x32bf3c[_0x7405('0x4e')](function(_0xe207d6){_0x318502['push'](_0xe207d6[_0x7405('0x2b')]({'exitAt':moment()[_0x7405('0x33')](_0x7405('0x2f'))}));});return BPromise[_0x7405('0x47')](_0x318502);}}})[_0x7405('0x23')](function(_0x2d037c){if(_0x28de0f){var _0x7018a1=[];var _0x5209b3=[];var _0x2663e0=utils['getChannels']();var _0x30655a={'membername':_0x28de0f[_0x7405('0x27')],'interface':_0x585a90,'enterAt':moment()[_0x7405('0x33')](_0x7405('0x2f')),'role':_0x28de0f[_0x7405('0x37')],'internal':_0x28de0f[_0x7405('0x28')]};_0x2663e0[_0x7405('0x4e')](function(_0x13aa86){_0x7018a1[_0x7405('0x31')](_[_0x7405('0x4f')]({'channel':_0x13aa86,'type':_0x7405('0x50'),'data1':_0x7405('0x51'),'data2':_0x585a90},_0x30655a));if(_0x28de0f[_0x7405('0x52')]){_0x5209b3[_0x7405('0x31')](_[_0x7405('0x4f')]({'channel':_0x13aa86,'type':_0x7405('0x2d'),'data1':_0x7405('0x53')},_0x30655a));}});return db['MemberReport'][_0x7405('0x39')](_0x7018a1[_0x7405('0x54')](_0x5209b3),{'individualHooks':!![]});}})['then'](function(){if(_0x28de0f){return _0x28de0f[_0x7405('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x7405('0x33')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x28de0f['loginInPause']||![],'mailPause':_0x28de0f[_0x7405('0x52')]||![],'chatPause':_0x28de0f['loginInPause']||![],'faxPause':_0x28de0f[_0x7405('0x52')]||![],'smsPause':_0x28de0f[_0x7405('0x52')]||![],'openchannelPause':_0x28de0f[_0x7405('0x52')]||![],'pauseType':_0x28de0f['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x7405('0x33')](_0x7405('0x2f')),'interface':_0x585a90});}})[_0x7405('0x23')](function(_0x3cc817){_0xa2ebd6(_0x3cc817);})[_0x7405('0x17')](function(_0x1f2a1){_0x3e750e(_0x2c9477['error'](0x1f4,_0x1f2a1[_0x7405('0x15')]));});});};
\ No newline at end of file
index 2384b05..81fa8d7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde21=['user:','./user.events','remove','emit','removeListener'];(function(_0x4a109d,_0x11f78f){var _0xa8c853=function(_0x4031b6){while(--_0x4031b6){_0x4a109d['push'](_0x4a109d['shift']());}};_0xa8c853(++_0x11f78f);}(_0xde21,0xab));var _0x1de2=function(_0x3ef2a6,_0x6f574c){_0x3ef2a6=_0x3ef2a6-0x0;var _0x55bdf3=_0xde21[_0x3ef2a6];return _0x55bdf3;};'use strict';var UserEvents=require(_0x1de2('0x0'));var events=['save',_0x1de2('0x1'),'update'];function createListener(_0x544383,_0x3b8487){return function(_0x220334){_0x3b8487[_0x1de2('0x2')](_0x544383,_0x220334);};}function removeListener(_0x3c9c1d,_0x48614e){return function(){UserEvents[_0x1de2('0x3')](_0x3c9c1d,_0x48614e);};}exports['register']=function(_0x33ffa3){for(var _0x5c7059=0x0,_0x293d58=events['length'];_0x5c7059<_0x293d58;_0x5c7059++){var _0x5e2b1d=events[_0x5c7059];var _0x467935=createListener(_0x1de2('0x4')+_0x5e2b1d,_0x33ffa3);UserEvents['on'](_0x5e2b1d,_0x467935);}};
\ No newline at end of file
+var _0x2738=['save','update','emit','register','length','user:','./user.events'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2738,0x8b));var _0x8273=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x2738[_0x2aea9e];return _0x430b92;};'use strict';var UserEvents=require(_0x8273('0x0'));var events=[_0x8273('0x1'),'remove',_0x8273('0x2')];function createListener(_0x2878c5,_0x11b44b){return function(_0xc5f80f){_0x11b44b[_0x8273('0x3')](_0x2878c5,_0xc5f80f);};}function removeListener(_0x18fb6b,_0x4e3e31){return function(){UserEvents['removeListener'](_0x18fb6b,_0x4e3e31);};}exports[_0x8273('0x4')]=function(_0x6801cf){for(var _0xe09cc6=0x0,_0x3f0486=events[_0x8273('0x5')];_0xe09cc6<_0x3f0486;_0xe09cc6++){var _0x3a2dff=events[_0xe09cc6];var _0x588de7=createListener(_0x8273('0x6')+_0x3a2dff,_0x6801cf);UserEvents['on'](_0x3a2dff,_0x588de7);}};
\ No newline at end of file
index 31aeb5a..4be8768 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x22d08b,_0x32ad57){var _0x592314=function(_0x480721){while(--_0x480721){_0x22d08b['push'](_0x22d08b['shift']());}};_0x592314(++_0x32ad57);}(_0x70e0,0x17b));var _0x070e=function(_0x285667,_0x1cf47a){_0x285667=_0x285667-0x0;var _0x3a21fc=_0x70e0[_0x285667];return _0x3a21fc;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x595013,_0x65a215){var _0x2a29e3=function(_0x307bf8){while(--_0x307bf8){_0x595013['push'](_0x595013['shift']());}};_0x2a29e3(++_0x65a215);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 9006424..9a25521 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x47a6=['INTEGER','sequelize'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x47a6,0x113));var _0x647a=function(_0x50bc8e,_0x2fbf77){_0x50bc8e=_0x50bc8e-0x0;var _0xded66c=_0x47a6[_0x50bc8e];return _0xded66c;};'use strict';var Sequelize=require(_0x647a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x647a('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index f609f82..9b14136 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7c7=['../../config/environment','exports','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x32832a,_0x205d17){var _0x5da64c=function(_0x1e0c20){while(--_0x1e0c20){_0x32832a['push'](_0x32832a['shift']());}};_0x5da64c(++_0x205d17);}(_0xd7c7,0x138));var _0x7d7c=function(_0x4d9a45,_0x59cbb3){_0x4d9a45=_0x4d9a45-0x0;var _0x50a807=_0xd7c7[_0x4d9a45];return _0x50a807;};'use strict';var _=require(_0x7d7c('0x0'));var util=require('util');var logger=require(_0x7d7c('0x1'))('api');var moment=require(_0x7d7c('0x2'));var BPromise=require(_0x7d7c('0x3'));var rp=require(_0x7d7c('0x4'));var fs=require('fs');var path=require(_0x7d7c('0x5'));var rimraf=require(_0x7d7c('0x6'));var config=require(_0x7d7c('0x7'));var attributes=require('./userChatQueue.attributes');module[_0x7d7c('0x8')]=function(_0x18534f,_0x158f92){return _0x18534f['define'](_0x7d7c('0x9'),attributes,{'tableName':_0x7d7c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd36a=['user_has_chat_queues','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xd36a,0xb1));var _0xad36=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd36a[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xad36('0x0'));var logger=require(_0xad36('0x1'))('api');var moment=require('moment');var BPromise=require(_0xad36('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad36('0x3'));var rimraf=require(_0xad36('0x4'));var config=require(_0xad36('0x5'));var attributes=require(_0xad36('0x6'));module[_0xad36('0x7')]=function(_0x102ecc,_0x2485d3){return _0x102ecc[_0xad36('0x8')](_0xad36('0x9'),attributes,{'tableName':_0xad36('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 09691d7..d58197f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9cb2=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird'];(function(_0x1daba2,_0xbb63fd){var _0x32d30f=function(_0x16d1cc){while(--_0x16d1cc){_0x1daba2['push'](_0x1daba2['shift']());}};_0x32d30f(++_0xbb63fd);}(_0x9cb2,0xb5));var _0x29cb=function(_0x19089c,_0x1e2028){_0x19089c=_0x19089c-0x0;var _0x1281c8=_0x9cb2[_0x19089c];return _0x1281c8;};'use strict';var _=require(_0x29cb('0x0'));var util=require('util');var moment=require(_0x29cb('0x1'));var BPromise=require(_0x29cb('0x2'));var rs=require(_0x29cb('0x3'));var fs=require('fs');var Redis=require(_0x29cb('0x4'));var db=require(_0x29cb('0x5'))['db'];var utils=require(_0x29cb('0x6'));var logger=require(_0x29cb('0x7'))(_0x29cb('0x8'));var config=require(_0x29cb('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x29cb('0xa')][_0x29cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4108e5,_0xfaee24,_0x4c41e5){return new BPromise(function(_0x416548,_0x34632b){return client[_0x29cb('0xc')](_0x4108e5,_0x4c41e5)[_0x29cb('0xd')](function(_0x475817){logger[_0x29cb('0xe')](_0x29cb('0xf'),_0xfaee24,_0x29cb('0x10'));logger['debug'](_0x29cb('0x11'),_0xfaee24,_0x29cb('0x10'),JSON[_0x29cb('0x12')](_0x475817));if(_0x475817[_0x29cb('0x13')]){if(_0x475817[_0x29cb('0x13')][_0x29cb('0x14')]===0x1f4){logger[_0x29cb('0x13')](_0x29cb('0xf'),_0xfaee24,_0x475817[_0x29cb('0x13')][_0x29cb('0x15')]);return _0x34632b(_0x475817[_0x29cb('0x13')][_0x29cb('0x15')]);}logger[_0x29cb('0x13')]('UserChatQueue,\x20%s,\x20%s',_0xfaee24,_0x475817['error'][_0x29cb('0x15')]);return _0x416548(_0x475817[_0x29cb('0x13')]['message']);}else{logger[_0x29cb('0xe')](_0x29cb('0xf'),_0xfaee24,_0x29cb('0x10'));_0x416548(_0x475817[_0x29cb('0x16')][_0x29cb('0x15')]);}})['catch'](function(_0x2b0e45){logger[_0x29cb('0x13')](_0x29cb('0xf'),_0xfaee24,_0x2b0e45);_0x34632b(_0x2b0e45);});});}
\ No newline at end of file
+var _0x6e70=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x488a76,_0x308ab6){var _0x306b9b=function(_0x32fd84){while(--_0x32fd84){_0x488a76['push'](_0x488a76['shift']());}};_0x306b9b(++_0x308ab6);}(_0x6e70,0x131));var _0x06e7=function(_0x38417e,_0x4f9723){_0x38417e=_0x38417e-0x0;var _0x53dd9e=_0x6e70[_0x38417e];return _0x53dd9e;};'use strict';var _=require(_0x06e7('0x0'));var util=require('util');var moment=require(_0x06e7('0x1'));var BPromise=require(_0x06e7('0x2'));var rs=require(_0x06e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x06e7('0x5'))(_0x06e7('0x6'));var config=require(_0x06e7('0x7'));var jayson=require(_0x06e7('0x8'));var client=jayson[_0x06e7('0x9')][_0x06e7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x307f5c,_0x413637,_0x31c034){return new BPromise(function(_0x19b42f,_0x49b6e9){return client[_0x06e7('0xb')](_0x307f5c,_0x31c034)[_0x06e7('0xc')](function(_0x4d916f){logger['info'](_0x06e7('0xd'),_0x413637,_0x06e7('0xe'));logger[_0x06e7('0xf')](_0x06e7('0x10'),_0x413637,_0x06e7('0xe'),JSON[_0x06e7('0x11')](_0x4d916f));if(_0x4d916f[_0x06e7('0x12')]){if(_0x4d916f[_0x06e7('0x12')][_0x06e7('0x13')]===0x1f4){logger[_0x06e7('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x413637,_0x4d916f['error'][_0x06e7('0x14')]);return _0x49b6e9(_0x4d916f[_0x06e7('0x12')]['message']);}logger['error']('UserChatQueue,\x20%s,\x20%s',_0x413637,_0x4d916f[_0x06e7('0x12')]['message']);return _0x19b42f(_0x4d916f[_0x06e7('0x12')][_0x06e7('0x14')]);}else{logger['info'](_0x06e7('0xd'),_0x413637,_0x06e7('0xe'));_0x19b42f(_0x4d916f[_0x06e7('0x15')][_0x06e7('0x14')]);}})[_0x06e7('0x16')](function(_0x30e793){logger[_0x06e7('0x12')](_0x06e7('0xd'),_0x413637,_0x30e793);_0x49b6e9(_0x30e793);});});}
\ No newline at end of file
index 2adfb5f..c30de49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1d2fd9,_0xe4736a){var _0x5d98b6=function(_0x436d0d){while(--_0x436d0d){_0x1d2fd9['push'](_0x1d2fd9['shift']());}};_0x5d98b6(++_0xe4736a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0xa47cf9,_0x58e072){var _0x523e3a=function(_0x267ded){while(--_0x267ded){_0xa47cf9['push'](_0xa47cf9['shift']());}};_0x523e3a(++_0x58e072);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0xcb91[_0xb301d4];return _0x3b5bde;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index 6089d1a..57c9c61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf435=['sequelize','exports','INTEGER'];(function(_0x50d3a8,_0x2124d4){var _0x2ed001=function(_0x342faf){while(--_0x342faf){_0x50d3a8['push'](_0x50d3a8['shift']());}};_0x2ed001(++_0x2124d4);}(_0xf435,0xea));var _0x5f43=function(_0x1882ef,_0x3f9775){_0x1882ef=_0x1882ef-0x0;var _0x3e8860=_0xf435[_0x1882ef];return _0x3e8860;};'use strict';var Sequelize=require(_0x5f43('0x0'));module[_0x5f43('0x1')]={'penalty':{'type':Sequelize[_0x5f43('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xce1e=['INTEGER','STRING','sequelize'];(function(_0x23265c,_0x31a626){var _0x3ac202=function(_0x20f5e0){while(--_0x20f5e0){_0x23265c['push'](_0x23265c['shift']());}};_0x3ac202(++_0x31a626);}(_0xce1e,0x1d3));var _0xece1=function(_0x43c36a,_0x1295df){_0x43c36a=_0x43c36a-0x0;var _0x5d5275=_0xce1e[_0x43c36a];return _0x5d5275;};'use strict';var Sequelize=require(_0xece1('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xece1('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xece1('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xece1('0x2')]}};
\ No newline at end of file
index bdf7000..8dac4d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6696=['exports','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','bluebird','../../config/environment','./userFaxQueue.attributes'];(function(_0x38d18e,_0x387c7d){var _0x3792d9=function(_0x4cd9bf){while(--_0x4cd9bf){_0x38d18e['push'](_0x38d18e['shift']());}};_0x3792d9(++_0x387c7d);}(_0x6696,0x1b1));var _0x6669=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x6696[_0x1cb18a];return _0x22442e;};'use strict';var _=require(_0x6669('0x0'));var util=require(_0x6669('0x1'));var logger=require(_0x6669('0x2'))(_0x6669('0x3'));var moment=require('moment');var BPromise=require(_0x6669('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6669('0x5'));var attributes=require(_0x6669('0x6'));module[_0x6669('0x7')]=function(_0x3b5bfe,_0x5f402d){return _0x3b5bfe['define'](_0x6669('0x8'),attributes,{'tableName':_0x6669('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb6d3=['path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','bluebird','request-promise'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xb6d3,0x1b4));var _0x3b6d=function(_0x148947,_0x442f51){_0x148947=_0x148947-0x0;var _0x25e3a2=_0xb6d3[_0x148947];return _0x25e3a2;};'use strict';var _=require(_0x3b6d('0x0'));var util=require('util');var logger=require(_0x3b6d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3b6d('0x2'));var rp=require(_0x3b6d('0x3'));var fs=require('fs');var path=require(_0x3b6d('0x4'));var rimraf=require(_0x3b6d('0x5'));var config=require(_0x3b6d('0x6'));var attributes=require(_0x3b6d('0x7'));module[_0x3b6d('0x8')]=function(_0x49f9ad,_0x5cf8b0){return _0x49f9ad['define'](_0x3b6d('0x9'),attributes,{'tableName':_0x3b6d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4d02fbd..4173a6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0653=['catch','lodash','util','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0653,0x94));var _0x3065=function(_0x562e8f,_0x884ff1){_0x562e8f=_0x562e8f-0x0;var _0x2409a0=_0x0653[_0x562e8f];return _0x2409a0;};'use strict';var _=require(_0x3065('0x0'));var util=require(_0x3065('0x1'));var moment=require(_0x3065('0x2'));var BPromise=require(_0x3065('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(_0x3065('0x4'))(_0x3065('0x5'));var config=require(_0x3065('0x6'));var jayson=require(_0x3065('0x7'));var client=jayson['client'][_0x3065('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16879c,_0x38a72d,_0x4717b1){return new BPromise(function(_0x416b6d,_0x5ea905){return client[_0x3065('0x9')](_0x16879c,_0x4717b1)['then'](function(_0x44487d){logger[_0x3065('0xa')](_0x3065('0xb'),_0x38a72d,'request\x20sent');logger[_0x3065('0xc')](_0x3065('0xd'),_0x38a72d,_0x3065('0xe'),JSON[_0x3065('0xf')](_0x44487d));if(_0x44487d[_0x3065('0x10')]){if(_0x44487d['error'][_0x3065('0x11')]===0x1f4){logger[_0x3065('0x10')](_0x3065('0xb'),_0x38a72d,_0x44487d['error']['message']);return _0x5ea905(_0x44487d[_0x3065('0x10')][_0x3065('0x12')]);}logger[_0x3065('0x10')](_0x3065('0xb'),_0x38a72d,_0x44487d[_0x3065('0x10')][_0x3065('0x12')]);return _0x416b6d(_0x44487d[_0x3065('0x10')][_0x3065('0x12')]);}else{logger[_0x3065('0xa')](_0x3065('0xb'),_0x38a72d,_0x3065('0xe'));_0x416b6d(_0x44487d[_0x3065('0x13')]['message']);}})[_0x3065('0x14')](function(_0x4de9e5){logger[_0x3065('0x10')](_0x3065('0xb'),_0x38a72d,_0x4de9e5);_0x5ea905(_0x4de9e5);});});}
\ No newline at end of file
+var _0x8840=['request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0x8840,0x14d));var _0x0884=function(_0x2e5727,_0x1a1910){_0x2e5727=_0x2e5727-0x0;var _0x41faad=_0x8840[_0x2e5727];return _0x41faad;};'use strict';var _=require(_0x0884('0x0'));var util=require(_0x0884('0x1'));var moment=require(_0x0884('0x2'));var BPromise=require('bluebird');var rs=require(_0x0884('0x3'));var fs=require('fs');var Redis=require(_0x0884('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0884('0x5'));var logger=require(_0x0884('0x6'))('rpc');var config=require(_0x0884('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0884('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x78ac75,_0x4c11bd,_0x49035b){return new BPromise(function(_0x393279,_0x5733da){return client[_0x0884('0x9')](_0x78ac75,_0x49035b)['then'](function(_0x34793f){logger[_0x0884('0xa')](_0x0884('0xb'),_0x4c11bd,'request\x20sent');logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x4c11bd,_0x0884('0xc'),JSON[_0x0884('0xd')](_0x34793f));if(_0x34793f[_0x0884('0xe')]){if(_0x34793f[_0x0884('0xe')][_0x0884('0xf')]===0x1f4){logger[_0x0884('0xe')](_0x0884('0xb'),_0x4c11bd,_0x34793f['error'][_0x0884('0x10')]);return _0x5733da(_0x34793f['error'][_0x0884('0x10')]);}logger[_0x0884('0xe')](_0x0884('0xb'),_0x4c11bd,_0x34793f[_0x0884('0xe')][_0x0884('0x10')]);return _0x393279(_0x34793f[_0x0884('0xe')][_0x0884('0x10')]);}else{logger[_0x0884('0xa')](_0x0884('0xb'),_0x4c11bd,'request\x20sent');_0x393279(_0x34793f[_0x0884('0x11')][_0x0884('0x10')]);}})[_0x0884('0x12')](function(_0x185260){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4c11bd,_0x185260);_0x5733da(_0x185260);});});}
\ No newline at end of file
index 5dc5e06..d393f50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4bf5fd,_0x21a61f){var _0xaa79ab=function(_0x5c06e7){while(--_0x5c06e7){_0x4bf5fd['push'](_0x4bf5fd['shift']());}};_0xaa79ab(++_0x21a61f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x443520,_0x2fe333){var _0x20afa5=function(_0x13cf74){while(--_0x13cf74){_0x443520['push'](_0x443520['shift']());}};_0x20afa5(++_0x2fe333);}(_0x9c44,0x178));var _0x49c4=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x9c44[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 47dbb5e..cbf553c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f24=['INTEGER','sequelize','exports'];(function(_0x57807,_0x43a33b){var _0x1ba2c3=function(_0x224533){while(--_0x224533){_0x57807['push'](_0x57807['shift']());}};_0x1ba2c3(++_0x43a33b);}(_0x1f24,0xee));var _0x41f2=function(_0x429686,_0x1db466){_0x429686=_0x429686-0x0;var _0xc2a78a=_0x1f24[_0x429686];return _0xc2a78a;};'use strict';var Sequelize=require(_0x41f2('0x0'));module[_0x41f2('0x1')]={'penalty':{'type':Sequelize[_0x41f2('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5315=['sequelize'];(function(_0x9cd897,_0x468e72){var _0x58e11c=function(_0x21b879){while(--_0x21b879){_0x9cd897['push'](_0x9cd897['shift']());}};_0x58e11c(++_0x468e72);}(_0x5315,0xa3));var _0x5531=function(_0x1b19a4,_0x13ba33){_0x1b19a4=_0x1b19a4-0x0;var _0x47fc94=_0x5315[_0x1b19a4];return _0x47fc94;};'use strict';var Sequelize=require(_0x5531('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 7d8ea1c..a573423 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81d0=['rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','lodash','../../config/logger','api','moment','bluebird'];(function(_0x20fc7c,_0x2108bb){var _0x55f09e=function(_0x22e39f){while(--_0x22e39f){_0x20fc7c['push'](_0x20fc7c['shift']());}};_0x55f09e(++_0x2108bb);}(_0x81d0,0xf8));var _0x081d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81d0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x081d('0x0'));var util=require('util');var logger=require(_0x081d('0x1'))(_0x081d('0x2'));var moment=require(_0x081d('0x3'));var BPromise=require(_0x081d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x081d('0x5'));var config=require(_0x081d('0x6'));var attributes=require(_0x081d('0x7'));module[_0x081d('0x8')]=function(_0x155b3f,_0x297f60){return _0x155b3f[_0x081d('0x9')](_0x081d('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x66ea=['UserMailQueue','user_has_mail_queues','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define'];(function(_0x5a1760,_0x197140){var _0x158173=function(_0x3785d4){while(--_0x3785d4){_0x5a1760['push'](_0x5a1760['shift']());}};_0x158173(++_0x197140);}(_0x66ea,0x176));var _0xa66e=function(_0x534fcc,_0x59c0aa){_0x534fcc=_0x534fcc-0x0;var _0x25a3c9=_0x66ea[_0x534fcc];return _0x25a3c9;};'use strict';var _=require('lodash');var util=require(_0xa66e('0x0'));var logger=require(_0xa66e('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa66e('0x2'));var rp=require(_0xa66e('0x3'));var fs=require('fs');var path=require(_0xa66e('0x4'));var rimraf=require(_0xa66e('0x5'));var config=require(_0xa66e('0x6'));var attributes=require(_0xa66e('0x7'));module[_0xa66e('0x8')]=function(_0xf209d5,_0x2d7a97){return _0xf209d5[_0xa66e('0x9')](_0xa66e('0xa'),attributes,{'tableName':_0xa66e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2815024..e7da001 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserMailQueue,\x20%s,\x20%s','message','result'];(function(_0x26fe41,_0x22b289){var _0x212c15=function(_0xc3e6fd){while(--_0xc3e6fd){_0x26fe41['push'](_0x26fe41['shift']());}};_0x212c15(++_0x22b289);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x7c0646,_0x45d16b){_0x7c0646=_0x7c0646-0x0;var _0x32416d=_0xf3cd[_0x7c0646];return _0x32416d;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var moment=require(_0xdf3c('0x2'));var BPromise=require(_0xdf3c('0x3'));var rs=require(_0xdf3c('0x4'));var fs=require('fs');var Redis=require(_0xdf3c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdf3c('0x6'));var logger=require(_0xdf3c('0x7'))(_0xdf3c('0x8'));var config=require('../../config/environment');var jayson=require(_0xdf3c('0x9'));var client=jayson[_0xdf3c('0xa')][_0xdf3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f0601,_0x106021,_0x28edae){return new BPromise(function(_0x52c073,_0x15705d){return client['request'](_0x1f0601,_0x28edae)['then'](function(_0x22d8ae){logger[_0xdf3c('0xc')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0xdf3c('0xd'));logger[_0xdf3c('0xe')](_0xdf3c('0xf'),_0x106021,_0xdf3c('0xd'),JSON[_0xdf3c('0x10')](_0x22d8ae));if(_0x22d8ae[_0xdf3c('0x11')]){if(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x12')]===0x1f4){logger['error'](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);return _0x15705d(_0x22d8ae[_0xdf3c('0x11')]['message']);}logger[_0xdf3c('0x11')](_0xdf3c('0x13'),_0x106021,_0x22d8ae[_0xdf3c('0x11')]['message']);return _0x52c073(_0x22d8ae[_0xdf3c('0x11')][_0xdf3c('0x14')]);}else{logger[_0xdf3c('0xc')](_0xdf3c('0x13'),_0x106021,_0xdf3c('0xd'));_0x52c073(_0x22d8ae[_0xdf3c('0x15')][_0xdf3c('0x14')]);}})[_0xdf3c('0x16')](function(_0x2986d0){logger[_0xdf3c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});}
\ No newline at end of file
+var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserMailQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x008c,0x188));var _0xc008=function(_0x583ba8,_0x40bb0d){_0x583ba8=_0x583ba8-0x0;var _0x515683=_0x008c[_0x583ba8];return _0x515683;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('UserMailQueue,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});}
\ No newline at end of file
index 66fa9f1..17dcf5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17c8=['../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x34df4a,_0x209d10){var _0x145c69=function(_0xb9bcbd){while(--_0xb9bcbd){_0x34df4a['push'](_0x34df4a['shift']());}};_0x145c69(++_0x209d10);}(_0x17c8,0x1ce));var _0x817c=function(_0x2ff333,_0x6d2ad4){_0x2ff333=_0x2ff333-0x0;var _0x49e242=_0x17c8[_0x2ff333];return _0x49e242;};'use strict';var multer=require(_0x817c('0x0'));var util=require(_0x817c('0x1'));var path=require('path');var timeout=require(_0x817c('0x2'));var express=require(_0x817c('0x3'));var router=express[_0x817c('0x4')]();var fs_extra=require(_0x817c('0x5'));var auth=require(_0x817c('0x6'));var interaction=require(_0x817c('0x7'));var config=require('../../config/environment');var controller=require(_0x817c('0x8'));router[_0x817c('0x9')]('/',auth[_0x817c('0xa')](),controller[_0x817c('0xb')]);module[_0x817c('0xc')]=router;
\ No newline at end of file
+var _0x117a=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated'];(function(_0x441691,_0x467e46){var _0x3bbfae=function(_0x56e952){while(--_0x56e952){_0x441691['push'](_0x441691['shift']());}};_0x3bbfae(++_0x467e46);}(_0x117a,0x1a1));var _0xa117=function(_0xd02def,_0x144f25){_0xd02def=_0xd02def-0x0;var _0x2e8374=_0x117a[_0xd02def];return _0x2e8374;};'use strict';var multer=require(_0xa117('0x0'));var util=require(_0xa117('0x1'));var path=require(_0xa117('0x2'));var timeout=require(_0xa117('0x3'));var express=require('express');var router=express[_0xa117('0x4')]();var fs_extra=require(_0xa117('0x5'));var auth=require(_0xa117('0x6'));var interaction=require(_0xa117('0x7'));var config=require(_0xa117('0x8'));var controller=require(_0xa117('0x9'));router[_0xa117('0xa')]('/',auth[_0xa117('0xb')](),controller['sendUserNotification']);module[_0xa117('0xc')]=router;
\ No newline at end of file
index 81dab93..27f19c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcab9=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xcab9,0x198));var _0x9cab=function(_0x188341,_0x54ba0f){_0x188341=_0x188341-0x0;var _0x2e86cf=_0xcab9[_0x188341];return _0x2e86cf;};'use strict';var Sequelize=require(_0x9cab('0x0'));module['exports']={'body':{'type':Sequelize[_0x9cab('0x1')]},'senderName':{'type':Sequelize[_0x9cab('0x2')]},'recipientsId':{'type':Sequelize[_0x9cab('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize[_0x9cab('0x3')]}};
\ No newline at end of file
+var _0x7592=['TEXT','STRING','BOOLEAN'];(function(_0x4bfaae,_0x163b72){var _0x305f09=function(_0x34105b){while(--_0x34105b){_0x4bfaae['push'](_0x4bfaae['shift']());}};_0x305f09(++_0x163b72);}(_0x7592,0x9c));var _0x2759=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x7592[_0x2085f3];return _0x384e3c;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x2759('0x0')]},'senderName':{'type':Sequelize[_0x2759('0x1')]},'recipientsId':{'type':Sequelize[_0x2759('0x0')]},'recipientsDescription':{'type':Sequelize[_0x2759('0x1')]},'beep':{'type':Sequelize[_0x2759('0x2')]}};
\ No newline at end of file
index 30b6d5b..ecb307f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81e9=['undefined','count','set','Content-Range','json','save','update','destroy','then','end','error','send','sendUserNotification','body','hasOwnProperty','TemplateId','Sequelize','ValidationError','view','Missing\x20\x27view\x27\x20parameter','Missing\x20\x27recipients\x27\x20parameter','parse','recipients','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','toLowerCase','senderName','user','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','sequelize','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','ids','queue','Queue','push','all','flatten','map','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','limit'];(function(_0x23f622,_0x44a0fc){var _0x148a90=function(_0x4d033d){while(--_0x4d033d){_0x23f622['push'](_0x23f622['shift']());}};_0x148a90(++_0x44a0fc);}(_0x81e9,0xa6));var _0x981e=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x81e9[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require(_0x981e('0x0'));var rimraf=require(_0x981e('0x1'));var zipdir=require(_0x981e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x981e('0x3'));var moment=require(_0x981e('0x4'));var BPromise=require(_0x981e('0x5'));var Mustache=require('mustache');var util=require(_0x981e('0x6'));var path=require(_0x981e('0x7'));var sox=require('sox');var csv=require(_0x981e('0x8'));var ejs=require(_0x981e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x981e('0xa'));var squel=require(_0x981e('0xb'));var crypto=require(_0x981e('0xc'));var jsforce=require(_0x981e('0xd'));var deskjs=require(_0x981e('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x981e('0xf'));var Redis=require(_0x981e('0x10'));var authService=require(_0x981e('0x11'));var qs=require(_0x981e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x981e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x981e('0x14'));var config=require(_0x981e('0x15'));var licenseUtil=require(_0x981e('0x16'));var db=require(_0x981e('0x17'))['db'];config[_0x981e('0x18')]=_[_0x981e('0x19')](config[_0x981e('0x18')],{'host':_0x981e('0x1a'),'port':0x18eb});var socket=require(_0x981e('0x1b'))(new Redis(config[_0x981e('0x18')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x2e6c80,_0x2e85b6){_0x2e85b6=_0x2e85b6||0xcc;return function(_0x547bf){if(_0x547bf){return _0x2e6c80[_0x981e('0x1c')](_0x2e85b6);}return _0x2e6c80[_0x981e('0x1d')](_0x2e85b6)['end']();};}function respondWithResult(_0x8f5e8b,_0x25db56){_0x25db56=_0x25db56||0xc8;return function(_0x2cf30b){if(_0x2cf30b){return _0x8f5e8b[_0x981e('0x1d')](_0x25db56)['json'](_0x2cf30b);}};}function respondWithFilteredResult(_0x46f581,_0x359694){return function(_0x411635){if(_0x411635){var _0x4edd23=typeof _0x359694[_0x981e('0x1e')]==='undefined'&&typeof _0x359694[_0x981e('0x1f')]===_0x981e('0x20');var _0x3afdec=_0x411635[_0x981e('0x21')];var _0x22b39d=_0x4edd23?0x0:_0x359694['offset'];var _0x3f9e73=_0x4edd23?_0x411635[_0x981e('0x21')]:_0x359694[_0x981e('0x1e')]+_0x359694[_0x981e('0x1f')];var _0x151d99;if(_0x3f9e73>=_0x3afdec){_0x3f9e73=_0x3afdec;_0x151d99=0xc8;}else{_0x151d99=0xce;}_0x46f581[_0x981e('0x1d')](_0x151d99);return _0x46f581[_0x981e('0x22')](_0x981e('0x23'),_0x22b39d+'-'+_0x3f9e73+'/'+_0x3afdec)[_0x981e('0x24')](_0x411635);}return null;};}function patchUpdates(_0x4c3191){return function(_0x11adaf){try{jsonpatch['apply'](_0x11adaf,_0x4c3191,!![]);}catch(_0xec5397){return BPromise['reject'](_0xec5397);}return _0x11adaf[_0x981e('0x25')]();};}function saveUpdates(_0xa5cbb7,_0x5ce92a){return function(_0xa5003){if(_0xa5003){return _0xa5003[_0x981e('0x26')](_0xa5cbb7)['then'](function(_0x6d27d){return _0x6d27d;});}return null;};}function removeEntity(_0x1c9e83,_0x312890){return function(_0x2025d5){if(_0x2025d5){return _0x2025d5[_0x981e('0x27')]()[_0x981e('0x28')](function(){_0x1c9e83[_0x981e('0x1d')](0xcc)[_0x981e('0x29')]();});}};}function handleEntityNotFound(_0x5bb95a,_0x5e0153){return function(_0x437ab2){if(!_0x437ab2){_0x5bb95a['sendStatus'](0x194);}return _0x437ab2;};}function handleError(_0x763c80,_0x530ae1){_0x530ae1=_0x530ae1||0x1f4;return function(_0x1bea15){logger[_0x981e('0x2a')](_0x1bea15['stack']);if(_0x1bea15['name']){delete _0x1bea15['name'];}_0x763c80[_0x981e('0x1d')](_0x530ae1)[_0x981e('0x2b')](_0x1bea15);};}exports[_0x981e('0x2c')]=function(_0x7da8a,_0x1eaa18,_0x467b7a){if(!_0x7da8a['body']['hasOwnProperty']('text')&&!_0x7da8a[_0x981e('0x2d')][_0x981e('0x2e')](_0x981e('0x2f'))){throw new db[(_0x981e('0x30'))][(_0x981e('0x31'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x7da8a[_0x981e('0x2d')][_0x981e('0x2e')](_0x981e('0x2f'))&&!_0x7da8a['body']['hasOwnProperty'](_0x981e('0x32'))){throw new db[(_0x981e('0x30'))][(_0x981e('0x31'))](_0x981e('0x33'));}if(!_0x7da8a['body'][_0x981e('0x2e')]('recipients')){throw new db[(_0x981e('0x30'))][(_0x981e('0x31'))](_0x981e('0x34'));}else{try{var _0x31d72f=JSON[_0x981e('0x35')](_0x7da8a[_0x981e('0x2d')][_0x981e('0x36')]);}catch(_0x46ba67){logger[_0x981e('0x2a')](_0x46ba67);throw new db[(_0x981e('0x30'))][(_0x981e('0x31'))](_0x981e('0x37'));}var _0x58d4bd=[_0x981e('0x38'),_0x981e('0x39'),_0x981e('0x3a'),_0x981e('0x3b'),_0x981e('0x3c'),_0x981e('0x3d'),_0x981e('0x3e'),_0x981e('0x3f'),'user'];if(_[_0x981e('0x40')](_0x31d72f,function(_0x575978){return!_[_0x981e('0x41')](_0x58d4bd,_0x575978[_0x981e('0x42')][_0x981e('0x43')]());})){throw new db[(_0x981e('0x30'))][(_0x981e('0x31'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x18947b={};_0x18947b[_0x981e('0x44')]=_0x7da8a[_0x981e('0x2d')][_0x981e('0x2e')](_0x981e('0x44'))?_0x7da8a[_0x981e('0x2d')][_0x981e('0x44')]:_0x7da8a[_0x981e('0x45')][_0x981e('0x46')];_0x18947b[_0x981e('0x47')]=_[_0x981e('0x48')](_0x7da8a['body'][_0x981e('0x47')])?null:_0x7da8a[_0x981e('0x2d')][_0x981e('0x47')];_0x18947b[_0x981e('0x49')]=_0x7da8a[_0x981e('0x2d')][_0x981e('0x49')]||![];_0x18947b['SenderId']=_0x7da8a['user']['id'];return getContent(_0x7da8a['body'])['then'](function(_0x17b750){_0x18947b[_0x981e('0x2d')]=_0x17b750;return getRecipients(_0x31d72f);})['then'](function(_0x49d71a){_0x18947b[_0x981e('0x4a')]=_[_0x981e('0x4b')](_0x49d71a)[_0x981e('0x4c')](',');return db[_0x981e('0x4d')]['transaction'](function(_0x4f090b){return db[_0x981e('0x4e')][_0x981e('0x4f')](_0x18947b,{'raw':!![],'transaction':_0x4f090b})['then'](function(_0x4a8313){var _0x135abf={'sender':_0x18947b[_0x981e('0x44')],'description':_0x18947b[_0x981e('0x47')],'content':_0x18947b[_0x981e('0x2d')],'beep':_0x18947b[_0x981e('0x49')]};_0x49d71a[_0x981e('0x50')](function(_0x29aa9f){_0x135abf[_0x981e('0x51')]=_0x29aa9f;socket[_0x981e('0x52')](_0x981e('0x53'),_0x135abf);});return _0x4a8313;});});})[_0x981e('0x28')](respondWithResult(_0x1eaa18,0xc9))[_0x981e('0x54')](handleError(_0x1eaa18,null));};function getContent(_0x437d23){return new BPromise(function(_0x57f14c,_0x3a04c1){if(_0x437d23['text']){_0x57f14c(_0x437d23['text']);return;}return db[_0x981e('0x55')][_0x981e('0x56')]({'attributes':[_0x981e('0x57')],'where':{'id':_0x437d23[_0x981e('0x2f')]},'raw':!![]})[_0x981e('0x28')](function(_0x5a3d85){if(!_0x5a3d85)throw new db[(_0x981e('0x30'))][(_0x981e('0x31'))](_0x981e('0x58'));var _0x55c8d3=Mustache[_0x981e('0x59')](_0x5a3d85[_0x981e('0x57')],_0x437d23['view']);_0x57f14c(_0x55c8d3);})[_0x981e('0x54')](function(_0x5b52f4){_0x3a04c1(_0x5b52f4);});});}function getRecipients(_0x44e308){return new BPromise(function(_0x220919,_0x139fa4){var _0x157f5f=[];var _0x582220=[];_0x44e308[_0x981e('0x50')](function(_0x5425bb){var _0x5b4a24=_[_0x981e('0x5a')](_0x5425bb[_0x981e('0x42')]['toLowerCase']());if(_0x5b4a24==='User'){_0x157f5f=_[_0x981e('0x5b')](_0x157f5f,_0x5425bb[_0x981e('0x5c')]);}else{if(_[_0x981e('0x41')](_0x5b4a24,_0x981e('0x5d')))_0x5b4a24=_0x5b4a24['replace'](_0x981e('0x5d'),_0x981e('0x5e'));_0x5425bb[_0x981e('0x5c')][_0x981e('0x50')](function(_0xa8f9b8){_0x582220[_0x981e('0x5f')](getAgents(_0x5b4a24,_0xa8f9b8));});}});return BPromise[_0x981e('0x60')](_0x582220)[_0x981e('0x28')](function(_0xcc6a16){_0x157f5f=_[_0x981e('0x5b')](_0x157f5f,_[_0x981e('0x61')](_0xcc6a16));_0x220919(_0x157f5f);})[_0x981e('0x54')](function(_0x379bfc){_0x139fa4(_0x379bfc);});});}function getAgents(_0x27b9b6,_0x1bfdd4){return new BPromise(function(_0xce8380,_0x2a1d06){return db[_0x27b9b6][_0x981e('0x56')]({'where':{'id':_0x1bfdd4}})[_0x981e('0x28')](function(_0x24d8c1){return _0x24d8c1['getAgents']({'attributes':['id'],'raw':!![]})[_0x981e('0x28')](function(_0x3b345c){var _0x1a5b2c=_[_0x981e('0x62')](_0x3b345c,'id');_0xce8380(_0x1a5b2c);});})[_0x981e('0x54')](function(_0x305c62){_0x2a1d06(_0x305c62);});});}
\ No newline at end of file
+var _0xbd66=['some','includes','model','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','Template','findOne','render','html','view','startCase','toLowerCase','User','union','ids','queue','push','all','flatten','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','stack','name','sendUserNotification','body','hasOwnProperty','text','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','chatqueue','mailqueue','smsqueue','whatsappqueue','team','user'];(function(_0x4d3a37,_0x2b8d14){var _0x3e03be=function(_0x3be52e){while(--_0x3be52e){_0x4d3a37['push'](_0x4d3a37['shift']());}};_0x3e03be(++_0x2b8d14);}(_0xbd66,0x152));var _0x6bd6=function(_0x282402,_0x594a45){_0x282402=_0x282402-0x0;var _0x2a4edc=_0xbd66[_0x282402];return _0x2a4edc;};'use strict';var emlformat=require(_0x6bd6('0x0'));var rimraf=require(_0x6bd6('0x1'));var zipdir=require(_0x6bd6('0x2'));var jsonpatch=require(_0x6bd6('0x3'));var rp=require('request-promise');var moment=require(_0x6bd6('0x4'));var BPromise=require(_0x6bd6('0x5'));var Mustache=require('mustache');var util=require(_0x6bd6('0x6'));var path=require('path');var sox=require(_0x6bd6('0x7'));var csv=require(_0x6bd6('0x8'));var ejs=require(_0x6bd6('0x9'));var fs=require('fs');var fs_extra=require(_0x6bd6('0xa'));var _=require(_0x6bd6('0xb'));var squel=require(_0x6bd6('0xc'));var crypto=require('crypto');var jsforce=require(_0x6bd6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6bd6('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6bd6('0xe'));var authService=require(_0x6bd6('0xf'));var qs=require(_0x6bd6('0x10'));var as=require(_0x6bd6('0x11'));var hardwareService=require(_0x6bd6('0x12'));var logger=require(_0x6bd6('0x13'))(_0x6bd6('0x14'));var utils=require(_0x6bd6('0x15'));var config=require(_0x6bd6('0x16'));var licenseUtil=require(_0x6bd6('0x17'));var db=require(_0x6bd6('0x18'))['db'];config[_0x6bd6('0x19')]=_[_0x6bd6('0x1a')](config[_0x6bd6('0x19')],{'host':_0x6bd6('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6bd6('0x19')]));require(_0x6bd6('0x1c'))[_0x6bd6('0x1d')](socket);function respondWithStatusCode(_0x348db0,_0x348355){_0x348355=_0x348355||0xcc;return function(_0x43e4a5){if(_0x43e4a5){return _0x348db0[_0x6bd6('0x1e')](_0x348355);}return _0x348db0[_0x6bd6('0x1f')](_0x348355)[_0x6bd6('0x20')]();};}function respondWithResult(_0x21f60f,_0x441feb){_0x441feb=_0x441feb||0xc8;return function(_0x330eef){if(_0x330eef){return _0x21f60f[_0x6bd6('0x1f')](_0x441feb)[_0x6bd6('0x21')](_0x330eef);}};}function respondWithFilteredResult(_0x2cf152,_0x4ffc8f){return function(_0xff5afb){if(_0xff5afb){var _0x3a3031=typeof _0x4ffc8f[_0x6bd6('0x22')]===_0x6bd6('0x23')&&typeof _0x4ffc8f[_0x6bd6('0x24')]===_0x6bd6('0x23');var _0x1014a8=_0xff5afb['count'];var _0x5a8975=_0x3a3031?0x0:_0x4ffc8f[_0x6bd6('0x22')];var _0x28e5de=_0x3a3031?_0xff5afb[_0x6bd6('0x25')]:_0x4ffc8f[_0x6bd6('0x22')]+_0x4ffc8f['limit'];var _0x22cda4;if(_0x28e5de>=_0x1014a8){_0x28e5de=_0x1014a8;_0x22cda4=0xc8;}else{_0x22cda4=0xce;}_0x2cf152[_0x6bd6('0x1f')](_0x22cda4);return _0x2cf152[_0x6bd6('0x26')](_0x6bd6('0x27'),_0x5a8975+'-'+_0x28e5de+'/'+_0x1014a8)[_0x6bd6('0x21')](_0xff5afb);}return null;};}function patchUpdates(_0x2df557){return function(_0x13feb9){try{jsonpatch[_0x6bd6('0x28')](_0x13feb9,_0x2df557,!![]);}catch(_0x21f113){return BPromise['reject'](_0x21f113);}return _0x13feb9[_0x6bd6('0x29')]();};}function saveUpdates(_0x3c82c9,_0x867634){return function(_0x56833c){if(_0x56833c){return _0x56833c[_0x6bd6('0x2a')](_0x3c82c9)['then'](function(_0x19ee85){return _0x19ee85;});}return null;};}function removeEntity(_0x25dd8d,_0x485f39){return function(_0x175427){if(_0x175427){return _0x175427[_0x6bd6('0x2b')]()[_0x6bd6('0x2c')](function(){_0x25dd8d[_0x6bd6('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x224549,_0x1d1b73){return function(_0x2178c2){if(!_0x2178c2){_0x224549[_0x6bd6('0x1e')](0x194);}return _0x2178c2;};}function handleError(_0x5870df,_0x37edc7){_0x37edc7=_0x37edc7||0x1f4;return function(_0x146429){logger[_0x6bd6('0x2d')](_0x146429[_0x6bd6('0x2e')]);if(_0x146429[_0x6bd6('0x2f')]){delete _0x146429[_0x6bd6('0x2f')];}_0x5870df[_0x6bd6('0x1f')](_0x37edc7)['send'](_0x146429);};}exports[_0x6bd6('0x30')]=function(_0x581c4f,_0x1c32d7,_0x319fb1){if(!_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x32')](_0x6bd6('0x33'))&&!_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x32')]('TemplateId')){throw new db[(_0x6bd6('0x34'))]['ValidationError'](_0x6bd6('0x35'));}else{if(_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x32')](_0x6bd6('0x36'))&&!_0x581c4f['body'][_0x6bd6('0x32')]('view')){throw new db['Sequelize'][(_0x6bd6('0x37'))](_0x6bd6('0x38'));}if(!_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x32')](_0x6bd6('0x39'))){throw new db['Sequelize'][(_0x6bd6('0x37'))](_0x6bd6('0x3a'));}else{try{var _0x5af3b0=JSON[_0x6bd6('0x3b')](_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x39')]);}catch(_0x4ca8e2){logger[_0x6bd6('0x2d')](_0x4ca8e2);throw new db[(_0x6bd6('0x34'))][(_0x6bd6('0x37'))]('Invalid\x20\x27recipients\x27\x20object');}var _0xc84ee5=[_0x6bd6('0x3c'),'faxqueue',_0x6bd6('0x3d'),'openchannelqueue',_0x6bd6('0x3e'),'voicequeue',_0x6bd6('0x3f'),_0x6bd6('0x40'),_0x6bd6('0x41')];if(_[_0x6bd6('0x42')](_0x5af3b0,function(_0x22905c){return!_[_0x6bd6('0x43')](_0xc84ee5,_0x22905c[_0x6bd6('0x44')]['toLowerCase']());})){throw new db[(_0x6bd6('0x34'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x1e6f3b={};_0x1e6f3b[_0x6bd6('0x45')]=_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x32')](_0x6bd6('0x45'))?_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x45')]:_0x581c4f[_0x6bd6('0x41')][_0x6bd6('0x46')];_0x1e6f3b[_0x6bd6('0x47')]=_[_0x6bd6('0x48')](_0x581c4f['body']['recipientsDescription'])?null:_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x47')];_0x1e6f3b['beep']=_0x581c4f[_0x6bd6('0x31')][_0x6bd6('0x49')]||![];_0x1e6f3b[_0x6bd6('0x4a')]=_0x581c4f[_0x6bd6('0x41')]['id'];return getContent(_0x581c4f[_0x6bd6('0x31')])['then'](function(_0x473c8b){_0x1e6f3b[_0x6bd6('0x31')]=_0x473c8b;return getRecipients(_0x5af3b0);})[_0x6bd6('0x2c')](function(_0x965524){_0x1e6f3b[_0x6bd6('0x4b')]=_[_0x6bd6('0x4c')](_0x965524)[_0x6bd6('0x4d')](',');return db[_0x6bd6('0x4e')][_0x6bd6('0x4f')](function(_0x4f0313){return db[_0x6bd6('0x50')][_0x6bd6('0x51')](_0x1e6f3b,{'raw':!![],'transaction':_0x4f0313})[_0x6bd6('0x2c')](function(_0x39a107){var _0x3d695f={'sender':_0x1e6f3b[_0x6bd6('0x45')],'description':_0x1e6f3b[_0x6bd6('0x47')],'content':_0x1e6f3b[_0x6bd6('0x31')],'beep':_0x1e6f3b['beep']};_0x965524[_0x6bd6('0x52')](function(_0x33b432){_0x3d695f[_0x6bd6('0x53')]=_0x33b432;socket['emit'](_0x6bd6('0x54'),_0x3d695f);});return _0x39a107;});});})['then'](respondWithResult(_0x1c32d7,0xc9))[_0x6bd6('0x55')](handleError(_0x1c32d7,null));};function getContent(_0x487ecd){return new BPromise(function(_0x3e7039,_0x182cec){if(_0x487ecd[_0x6bd6('0x33')]){_0x3e7039(_0x487ecd[_0x6bd6('0x33')]);return;}return db[_0x6bd6('0x56')][_0x6bd6('0x57')]({'attributes':['html'],'where':{'id':_0x487ecd[_0x6bd6('0x36')]},'raw':!![]})[_0x6bd6('0x2c')](function(_0x1876f9){if(!_0x1876f9)throw new db[(_0x6bd6('0x34'))][(_0x6bd6('0x37'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x54ace7=Mustache[_0x6bd6('0x58')](_0x1876f9[_0x6bd6('0x59')],_0x487ecd[_0x6bd6('0x5a')]);_0x3e7039(_0x54ace7);})[_0x6bd6('0x55')](function(_0x4ae2bd){_0x182cec(_0x4ae2bd);});});}function getRecipients(_0x2dda93){return new BPromise(function(_0x3087d8,_0x2e9c02){var _0x15fd75=[];var _0x4c2bbd=[];_0x2dda93['forEach'](function(_0x4e9784){var _0xcaf4be=_[_0x6bd6('0x5b')](_0x4e9784[_0x6bd6('0x44')][_0x6bd6('0x5c')]());if(_0xcaf4be===_0x6bd6('0x5d')){_0x15fd75=_[_0x6bd6('0x5e')](_0x15fd75,_0x4e9784[_0x6bd6('0x5f')]);}else{if(_[_0x6bd6('0x43')](_0xcaf4be,_0x6bd6('0x60')))_0xcaf4be=_0xcaf4be['replace'](_0x6bd6('0x60'),'Queue');_0x4e9784['ids']['forEach'](function(_0x2ce37c){_0x4c2bbd[_0x6bd6('0x61')](getAgents(_0xcaf4be,_0x2ce37c));});}});return BPromise[_0x6bd6('0x62')](_0x4c2bbd)[_0x6bd6('0x2c')](function(_0x26c970){_0x15fd75=_[_0x6bd6('0x5e')](_0x15fd75,_[_0x6bd6('0x63')](_0x26c970));_0x3087d8(_0x15fd75);})['catch'](function(_0x3bf196){_0x2e9c02(_0x3bf196);});});}function getAgents(_0x2c305c,_0x1dfadf){return new BPromise(function(_0x6753b,_0x4814ab){return db[_0x2c305c][_0x6bd6('0x57')]({'where':{'id':_0x1dfadf}})[_0x6bd6('0x2c')](function(_0xbef6d0){return _0xbef6d0[_0x6bd6('0x64')]({'attributes':['id'],'raw':!![]})[_0x6bd6('0x2c')](function(_0x46bc0d){var _0xc35c69=_['map'](_0x46bc0d,'id');_0x6753b(_0xc35c69);});})[_0x6bd6('0x55')](function(_0x51fabf){_0x4814ab(_0x51fabf);});});}
\ No newline at end of file
index 6427733..3e63e74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf28=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','UserNotification','setMaxListeners','save','update'];(function(_0x57bf92,_0x241d5c){var _0xa00975=function(_0x3c0993){while(--_0x3c0993){_0x57bf92['push'](_0x57bf92['shift']());}};_0xa00975(++_0x241d5c);}(_0xcf28,0x7d));var _0x8cf2=function(_0x1fa89d,_0x4078c4){_0x1fa89d=_0x1fa89d-0x0;var _0x1deaa3=_0xcf28[_0x1fa89d];return _0x1deaa3;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x8cf2('0x0'))['db'][_0x8cf2('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x8cf2('0x2')](0x0);var events={'afterCreate':_0x8cf2('0x3'),'afterUpdate':_0x8cf2('0x4'),'afterDestroy':_0x8cf2('0x5')};function emitEvent(_0x2cba2e){return function(_0x8704ed,_0x2eb0d9,_0x33f81a){UserNotificationEvents[_0x8cf2('0x6')](_0x2cba2e+':'+_0x8704ed['id'],_0x8704ed);UserNotificationEvents[_0x8cf2('0x6')](_0x2cba2e,_0x8704ed);_0x33f81a(null);};}for(var e in events){if(events[_0x8cf2('0x7')](e)){var event=events[e];UserNotification[_0x8cf2('0x8')](e,emitEvent(event));}}module[_0x8cf2('0x9')]=UserNotificationEvents;
\ No newline at end of file
+var _0x1c49=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','save'];(function(_0xcedb41,_0x48b5d6){var _0x183200=function(_0x34a4ff){while(--_0x34a4ff){_0xcedb41['push'](_0xcedb41['shift']());}};_0x183200(++_0x48b5d6);}(_0x1c49,0x1d4));var _0x91c4=function(_0x1777a6,_0xf00e5c){_0x1777a6=_0x1777a6-0x0;var _0x9a7adf=_0x1c49[_0x1777a6];return _0x9a7adf;};'use strict';var EventEmitter=require(_0x91c4('0x0'));var UserNotification=require(_0x91c4('0x1'))['db'][_0x91c4('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x91c4('0x3')](0x0);var events={'afterCreate':_0x91c4('0x4'),'afterUpdate':_0x91c4('0x5'),'afterDestroy':_0x91c4('0x6')};function emitEvent(_0x4b5f1c){return function(_0x1dbf84,_0x5dbef5,_0x1fa427){UserNotificationEvents[_0x91c4('0x7')](_0x4b5f1c+':'+_0x1dbf84['id'],_0x1dbf84);UserNotificationEvents[_0x91c4('0x7')](_0x4b5f1c,_0x1dbf84);_0x1fa427(null);};}for(var e in events){if(events[_0x91c4('0x8')](e)){var event=events[e];UserNotification[_0x91c4('0x9')](e,emitEvent(event));}}module[_0x91c4('0xa')]=UserNotificationEvents;
\ No newline at end of file
index b0f04d5..ded5fb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0dd=['UserNotification','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','define'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0xc0dd,0x120));var _0xdc0d=function(_0x26c8fc,_0x30ba3d){_0x26c8fc=_0x26c8fc-0x0;var _0x20e41b=_0xc0dd[_0x26c8fc];return _0x20e41b;};'use strict';var _=require(_0xdc0d('0x0'));var util=require(_0xdc0d('0x1'));var logger=require(_0xdc0d('0x2'))(_0xdc0d('0x3'));var moment=require(_0xdc0d('0x4'));var BPromise=require(_0xdc0d('0x5'));var rp=require(_0xdc0d('0x6'));var fs=require('fs');var path=require(_0xdc0d('0x7'));var rimraf=require(_0xdc0d('0x8'));var config=require(_0xdc0d('0x9'));var attributes=require(_0xdc0d('0xa'));module['exports']=function(_0x49e2c1,_0x59bf7){return _0x49e2c1[_0xdc0d('0xb')](_0xdc0d('0xc'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc0d('0xd'),'collate':_0xdc0d('0xe')});};
\ No newline at end of file
+var _0x33d4=['exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0x33d4,0x84));var _0x433d=function(_0x5b1872,_0x481a51){_0x5b1872=_0x5b1872-0x0;var _0x52ed7c=_0x33d4[_0x5b1872];return _0x52ed7c;};'use strict';var _=require('lodash');var util=require(_0x433d('0x0'));var logger=require(_0x433d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x433d('0x2'));var rp=require(_0x433d('0x3'));var fs=require('fs');var path=require(_0x433d('0x4'));var rimraf=require(_0x433d('0x5'));var config=require(_0x433d('0x6'));var attributes=require(_0x433d('0x7'));module[_0x433d('0x8')]=function(_0x149ece,_0x284375){return _0x149ece[_0x433d('0x9')](_0x433d('0xa'),attributes,{'tableName':_0x433d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x433d('0xc'),'collate':_0x433d('0xd')});};
\ No newline at end of file
index 185ab84..a59e616 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x871c=['request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','register'];(function(_0x3ac4b1,_0x1adce0){var _0xf4bec4=function(_0x496b22){while(--_0x496b22){_0x3ac4b1['push'](_0x3ac4b1['shift']());}};_0xf4bec4(++_0x1adce0);}(_0x871c,0x9b));var _0xc871=function(_0x23f4db,_0x383686){_0x23f4db=_0x23f4db-0x0;var _0x46e911=_0x871c[_0x23f4db];return _0x46e911;};'use strict';var _=require('lodash');var util=require(_0xc871('0x0'));var moment=require(_0xc871('0x1'));var BPromise=require(_0xc871('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc871('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc871('0x4'));var logger=require('../../config/logger')(_0xc871('0x5'));var config=require(_0xc871('0x6'));var jayson=require(_0xc871('0x7'));var client=jayson[_0xc871('0x8')][_0xc871('0x9')]({'port':0x232a});config[_0xc871('0xa')]=_['defaults'](config[_0xc871('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xc871('0xb'))(new Redis(config[_0xc871('0xa')]));require('./userNotification.socket')[_0xc871('0xc')](socket);function respondWithRpcPromise(_0x337ed4,_0x3a76d,_0x1874c7){return new BPromise(function(_0x117550,_0x1c647b){return client[_0xc871('0xd')](_0x337ed4,_0x1874c7)['then'](function(_0x4a0810){logger[_0xc871('0xe')](_0xc871('0xf'),_0x3a76d,_0xc871('0x10'));logger[_0xc871('0x11')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x3a76d,'request\x20sent',JSON[_0xc871('0x12')](_0x4a0810));if(_0x4a0810[_0xc871('0x13')]){if(_0x4a0810[_0xc871('0x13')][_0xc871('0x14')]===0x1f4){logger['error'](_0xc871('0xf'),_0x3a76d,_0x4a0810['error'][_0xc871('0x15')]);return _0x1c647b(_0x4a0810['error'][_0xc871('0x15')]);}logger[_0xc871('0x13')](_0xc871('0xf'),_0x3a76d,_0x4a0810[_0xc871('0x13')]['message']);return _0x117550(_0x4a0810[_0xc871('0x13')]['message']);}else{logger[_0xc871('0xe')]('UserNotification,\x20%s,\x20%s',_0x3a76d,_0xc871('0x10'));_0x117550(_0x4a0810[_0xc871('0x16')][_0xc871('0x15')]);}})[_0xc871('0x17')](function(_0x5e10d8){logger['error']('UserNotification,\x20%s,\x20%s',_0x3a76d,_0x5e10d8);_0x1c647b(_0x5e10d8);});});}
\ No newline at end of file
+var _0xdcd7=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','localhost','./userNotification.socket','register','request','then','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x521a45,_0x5734bd){var _0x25dfa4=function(_0x4bc47f){while(--_0x4bc47f){_0x521a45['push'](_0x521a45['shift']());}};_0x25dfa4(++_0x5734bd);}(_0xdcd7,0x12c));var _0x7dcd=function(_0x7bab5a,_0x55b4f8){_0x7bab5a=_0x7bab5a-0x0;var _0x3ef90a=_0xdcd7[_0x7bab5a];return _0x3ef90a;};'use strict';var _=require(_0x7dcd('0x0'));var util=require(_0x7dcd('0x1'));var moment=require(_0x7dcd('0x2'));var BPromise=require(_0x7dcd('0x3'));var rs=require(_0x7dcd('0x4'));var fs=require('fs');var Redis=require(_0x7dcd('0x5'));var db=require(_0x7dcd('0x6'))['db'];var utils=require(_0x7dcd('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7dcd('0x8'));var client=jayson[_0x7dcd('0x9')][_0x7dcd('0xa')]({'port':0x232a});config[_0x7dcd('0xb')]=_['defaults'](config['redis'],{'host':_0x7dcd('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7dcd('0xb')]));require(_0x7dcd('0xd'))[_0x7dcd('0xe')](socket);function respondWithRpcPromise(_0x2abf05,_0x548e3c,_0x58221a){return new BPromise(function(_0x2c8f87,_0x82e5da){return client[_0x7dcd('0xf')](_0x2abf05,_0x58221a)[_0x7dcd('0x10')](function(_0x304d08){logger['info'](_0x7dcd('0x11'),_0x548e3c,_0x7dcd('0x12'));logger[_0x7dcd('0x13')](_0x7dcd('0x14'),_0x548e3c,_0x7dcd('0x12'),JSON[_0x7dcd('0x15')](_0x304d08));if(_0x304d08['error']){if(_0x304d08[_0x7dcd('0x16')]['code']===0x1f4){logger[_0x7dcd('0x16')](_0x7dcd('0x11'),_0x548e3c,_0x304d08[_0x7dcd('0x16')][_0x7dcd('0x17')]);return _0x82e5da(_0x304d08['error'][_0x7dcd('0x17')]);}logger[_0x7dcd('0x16')](_0x7dcd('0x11'),_0x548e3c,_0x304d08[_0x7dcd('0x16')][_0x7dcd('0x17')]);return _0x2c8f87(_0x304d08[_0x7dcd('0x16')][_0x7dcd('0x17')]);}else{logger['info'](_0x7dcd('0x11'),_0x548e3c,_0x7dcd('0x12'));_0x2c8f87(_0x304d08['result']['message']);}})[_0x7dcd('0x18')](function(_0x436efe){logger[_0x7dcd('0x16')]('UserNotification,\x20%s,\x20%s',_0x548e3c,_0x436efe);_0x82e5da(_0x436efe);});});}
\ No newline at end of file
index 081fde2..b4dc9ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb77c=['update','removeListener','register','length','userNotification:','./userNotification.events'];(function(_0x170318,_0x41bf31){var _0x336cc8=function(_0x9bc045){while(--_0x9bc045){_0x170318['push'](_0x170318['shift']());}};_0x336cc8(++_0x41bf31);}(_0xb77c,0x143));var _0xcb77=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xb77c[_0x36eaaa];return _0x461349;};'use strict';var UserNotificationEvents=require(_0xcb77('0x0'));var events=['save','remove',_0xcb77('0x1')];function createListener(_0x398f5e,_0x464a14){return function(_0x5d27ae){_0x464a14['emit'](_0x398f5e,_0x5d27ae);};}function removeListener(_0x373971,_0x331b3c){return function(){UserNotificationEvents[_0xcb77('0x2')](_0x373971,_0x331b3c);};}exports[_0xcb77('0x3')]=function(_0x5a1314){for(var _0x4d0a87=0x0,_0x1b7da=events[_0xcb77('0x4')];_0x4d0a87<_0x1b7da;_0x4d0a87++){var _0x2d4e9a=events[_0x4d0a87];var _0x168a44=createListener(_0xcb77('0x5')+_0x2d4e9a,_0x5a1314);UserNotificationEvents['on'](_0x2d4e9a,_0x168a44);}};
\ No newline at end of file
+var _0xf00a=['userNotification:','./userNotification.events','save','remove','removeListener','length'];(function(_0x280a84,_0x181a3f){var _0x160e33=function(_0x5c1bd0){while(--_0x5c1bd0){_0x280a84['push'](_0x280a84['shift']());}};_0x160e33(++_0x181a3f);}(_0xf00a,0xa9));var _0xaf00=function(_0x5b7b22,_0x5bc479){_0x5b7b22=_0x5b7b22-0x0;var _0x53dc9d=_0xf00a[_0x5b7b22];return _0x53dc9d;};'use strict';var UserNotificationEvents=require(_0xaf00('0x0'));var events=[_0xaf00('0x1'),_0xaf00('0x2'),'update'];function createListener(_0x33c2ef,_0x1d4da1){return function(_0x40bc49){_0x1d4da1['emit'](_0x33c2ef,_0x40bc49);};}function removeListener(_0x561a8b,_0x5d479c){return function(){UserNotificationEvents[_0xaf00('0x3')](_0x561a8b,_0x5d479c);};}exports['register']=function(_0x31c32c){for(var _0x2041e5=0x0,_0xfc395e=events[_0xaf00('0x4')];_0x2041e5<_0xfc395e;_0x2041e5++){var _0x9a685=events[_0x2041e5];var _0x210467=createListener(_0xaf00('0x5')+_0x9a685,_0x31c32c);UserNotificationEvents['on'](_0x9a685,_0x210467);}};
\ No newline at end of file
index bb000e1..3f1490f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x153990,_0x310bbe){var _0x40fbd3=function(_0x290b59){while(--_0x290b59){_0x153990['push'](_0x153990['shift']());}};_0x40fbd3(++_0x310bbe);}(_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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3b20ec,_0x95fe98){var _0x566898=function(_0x7b54b9){while(--_0x7b54b9){_0x3b20ec['push'](_0x3b20ec['shift']());}};_0x566898(++_0x95fe98);}(_0x70e0,0x17b));var _0x070e=function(_0x27bef0,_0x2ec5a3){_0x27bef0=_0x27bef0-0x0;var _0x576086=_0x70e0[_0x27bef0];return _0x576086;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index 607700f..d08547b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4588=['INTEGER'];(function(_0x2e8fd3,_0x311221){var _0x1faffe=function(_0x3ddd3e){while(--_0x3ddd3e){_0x2e8fd3['push'](_0x2e8fd3['shift']());}};_0x1faffe(++_0x311221);}(_0x4588,0x9c));var _0x8458=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x4588[_0x3c22e0];return _0x215811;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x8458('0x0')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x0bb1=['exports'];(function(_0x213dc5,_0x12a5f6){var _0x49256d=function(_0x453c07){while(--_0x453c07){_0x213dc5['push'](_0x213dc5['shift']());}};_0x49256d(++_0x12a5f6);}(_0x0bb1,0x1cd));var _0x10bb=function(_0x153e7d,_0x10a35f){_0x153e7d=_0x153e7d-0x0;var _0x3c22dd=_0x0bb1[_0x153e7d];return _0x3c22dd;};'use strict';var Sequelize=require('sequelize');module[_0x10bb('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index aeffd4d..e010753 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe21a=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','lodash','util','../../config/logger'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xe21a,0x107));var _0xae21=function(_0x1a0fe8,_0x8cd987){_0x1a0fe8=_0x1a0fe8-0x0;var _0x51a76d=_0xe21a[_0x1a0fe8];return _0x51a76d;};'use strict';var _=require(_0xae21('0x0'));var util=require(_0xae21('0x1'));var logger=require(_0xae21('0x2'))(_0xae21('0x3'));var moment=require(_0xae21('0x4'));var BPromise=require(_0xae21('0x5'));var rp=require(_0xae21('0x6'));var fs=require('fs');var path=require(_0xae21('0x7'));var rimraf=require(_0xae21('0x8'));var config=require(_0xae21('0x9'));var attributes=require(_0xae21('0xa'));module[_0xae21('0xb')]=function(_0x768c62,_0x1715dd){return _0x768c62[_0xae21('0xc')]('UserOpenchannelQueue',attributes,{'tableName':_0xae21('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xecee=['rimraf','../../config/environment','exports','define','UserOpenchannelQueue','lodash','util','../../config/logger','api','moment'];(function(_0x19cfd0,_0x35651b){var _0x5f22f8=function(_0x299d5a){while(--_0x299d5a){_0x19cfd0['push'](_0x19cfd0['shift']());}};_0x5f22f8(++_0x35651b);}(_0xecee,0xaf));var _0xeece=function(_0x395b51,_0x9cb7e5){_0x395b51=_0x395b51-0x0;var _0x33b025=_0xecee[_0x395b51];return _0x33b025;};'use strict';var _=require(_0xeece('0x0'));var util=require(_0xeece('0x1'));var logger=require(_0xeece('0x2'))(_0xeece('0x3'));var moment=require(_0xeece('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xeece('0x5'));var config=require(_0xeece('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xeece('0x7')]=function(_0x3618c4,_0x45518a){return _0x3618c4[_0xeece('0x8')](_0xeece('0x9'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cf41987..d667dee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2352=['jayson/promise','client','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x142ec2,_0x5bb03d){var _0x45ef4e=function(_0x4bc513){while(--_0x4bc513){_0x142ec2['push'](_0x142ec2['shift']());}};_0x45ef4e(++_0x5bb03d);}(_0x2352,0x121));var _0x2235=function(_0x521255,_0x4d4eeb){_0x521255=_0x521255-0x0;var _0x4082e8=_0x2352[_0x521255];return _0x4082e8;};'use strict';var _=require(_0x2235('0x0'));var util=require(_0x2235('0x1'));var moment=require(_0x2235('0x2'));var BPromise=require(_0x2235('0x3'));var rs=require(_0x2235('0x4'));var fs=require('fs');var Redis=require(_0x2235('0x5'));var db=require(_0x2235('0x6'))['db'];var utils=require(_0x2235('0x7'));var logger=require(_0x2235('0x8'))(_0x2235('0x9'));var config=require(_0x2235('0xa'));var jayson=require(_0x2235('0xb'));var client=jayson[_0x2235('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26d481,_0x866884,_0x4f8945){return new BPromise(function(_0x5ea697,_0x5d0da9){return client[_0x2235('0xd')](_0x26d481,_0x4f8945)[_0x2235('0xe')](function(_0x281378){logger[_0x2235('0xf')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x866884,_0x2235('0x10'));logger[_0x2235('0x11')](_0x2235('0x12'),_0x866884,'request\x20sent',JSON[_0x2235('0x13')](_0x281378));if(_0x281378[_0x2235('0x14')]){if(_0x281378[_0x2235('0x14')][_0x2235('0x15')]===0x1f4){logger[_0x2235('0x14')](_0x2235('0x16'),_0x866884,_0x281378['error'][_0x2235('0x17')]);return _0x5d0da9(_0x281378[_0x2235('0x14')][_0x2235('0x17')]);}logger[_0x2235('0x14')](_0x2235('0x16'),_0x866884,_0x281378[_0x2235('0x14')][_0x2235('0x17')]);return _0x5ea697(_0x281378['error']['message']);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x866884,_0x2235('0x10'));_0x5ea697(_0x281378['result']['message']);}})[_0x2235('0x18')](function(_0x17361c){logger[_0x2235('0x14')](_0x2235('0x16'),_0x866884,_0x17361c);_0x5d0da9(_0x17361c);});});}
\ No newline at end of file
+var _0xc7c5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','message','UserOpenchannelQueue,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xc7c5,0xc2));var _0x5c7c=function(_0x2b2c95,_0x2ab873){_0x2b2c95=_0x2b2c95-0x0;var _0x88dd44=_0xc7c5[_0x2b2c95];return _0x88dd44;};'use strict';var _=require(_0x5c7c('0x0'));var util=require(_0x5c7c('0x1'));var moment=require(_0x5c7c('0x2'));var BPromise=require(_0x5c7c('0x3'));var rs=require(_0x5c7c('0x4'));var fs=require('fs');var Redis=require(_0x5c7c('0x5'));var db=require(_0x5c7c('0x6'))['db'];var utils=require(_0x5c7c('0x7'));var logger=require(_0x5c7c('0x8'))(_0x5c7c('0x9'));var config=require(_0x5c7c('0xa'));var jayson=require(_0x5c7c('0xb'));var client=jayson[_0x5c7c('0xc')][_0x5c7c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x19b43d,_0x13fa34,_0x21574f){return new BPromise(function(_0x3f63ce,_0x2926f2){return client[_0x5c7c('0xe')](_0x19b43d,_0x21574f)[_0x5c7c('0xf')](function(_0x3b8bb4){logger[_0x5c7c('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x13fa34,_0x5c7c('0x11'));logger[_0x5c7c('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x13fa34,_0x5c7c('0x11'),JSON[_0x5c7c('0x13')](_0x3b8bb4));if(_0x3b8bb4[_0x5c7c('0x14')]){if(_0x3b8bb4['error']['code']===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x13fa34,_0x3b8bb4[_0x5c7c('0x14')][_0x5c7c('0x15')]);return _0x2926f2(_0x3b8bb4['error'][_0x5c7c('0x15')]);}logger[_0x5c7c('0x14')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x13fa34,_0x3b8bb4[_0x5c7c('0x14')][_0x5c7c('0x15')]);return _0x3f63ce(_0x3b8bb4[_0x5c7c('0x14')][_0x5c7c('0x15')]);}else{logger[_0x5c7c('0x10')](_0x5c7c('0x16'),_0x13fa34,_0x5c7c('0x11'));_0x3f63ce(_0x3b8bb4[_0x5c7c('0x17')]['message']);}})[_0x5c7c('0x18')](function(_0x2f5c3a){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x13fa34,_0x2f5c3a);_0x2926f2(_0x2f5c3a);});});}
\ No newline at end of file
index eb1e039..1a92df0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0ef=['post','create','/:id/clone','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/sections','getSections','/:id/resources'];(function(_0x11510f,_0x417e70){var _0x32325f=function(_0x548ab9){while(--_0x548ab9){_0x11510f['push'](_0x11510f['shift']());}};_0x32325f(++_0x417e70);}(_0xa0ef,0x183));var _0xfa0e=function(_0x4d237c,_0x445600){_0x4d237c=_0x4d237c-0x0;var _0x44f5b4=_0xa0ef[_0x4d237c];return _0x44f5b4;};'use strict';var multer=require(_0xfa0e('0x0'));var util=require(_0xfa0e('0x1'));var path=require(_0xfa0e('0x2'));var timeout=require(_0xfa0e('0x3'));var express=require(_0xfa0e('0x4'));var router=express[_0xfa0e('0x5')]();var fs_extra=require(_0xfa0e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xfa0e('0x7'));var config=require(_0xfa0e('0x8'));var controller=require('./userProfile.controller');router[_0xfa0e('0x9')]('/',auth[_0xfa0e('0xa')](),controller[_0xfa0e('0xb')]);router[_0xfa0e('0x9')](_0xfa0e('0xc'),auth['isAuthenticated'](),controller[_0xfa0e('0xd')]);router[_0xfa0e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xfa0e('0xe')]);router['get'](_0xfa0e('0xf'),auth[_0xfa0e('0xa')](),controller[_0xfa0e('0x10')]);router[_0xfa0e('0x9')](_0xfa0e('0x11'),auth[_0xfa0e('0xa')](),controller['getResources']);router[_0xfa0e('0x12')]('/',auth[_0xfa0e('0xa')](),controller[_0xfa0e('0x13')]);router['post'](_0xfa0e('0x14'),auth[_0xfa0e('0xa')](),controller['clone']);router[_0xfa0e('0x12')]('/:id/sections',auth['isAuthenticated'](),controller['addSections']);router[_0xfa0e('0x12')]('/:id/resources',auth[_0xfa0e('0xa')](),controller['addResources']);router[_0xfa0e('0x15')](_0xfa0e('0x16'),auth[_0xfa0e('0xa')](),controller[_0xfa0e('0x17')]);router[_0xfa0e('0x18')](_0xfa0e('0x16'),auth[_0xfa0e('0xa')](),controller[_0xfa0e('0x19')]);router[_0xfa0e('0x18')](_0xfa0e('0xf'),auth[_0xfa0e('0xa')](),controller['removeSections']);router['delete'](_0xfa0e('0x11'),auth[_0xfa0e('0xa')](),controller['removeResources']);module[_0xfa0e('0x1a')]=router;
\ No newline at end of file
+var _0xad57=['index','get','/describe','isAuthenticated','describe','/:id','show','/:id/sections','/:id/resources','post','create','/:id/clone','addSections','put','delete','destroy','removeSections','removeResources','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0xad57,0xc1));var _0x7ad5=function(_0x323b5c,_0x50d624){_0x323b5c=_0x323b5c-0x0;var _0x3d3634=_0xad57[_0x323b5c];return _0x3d3634;};'use strict';var multer=require(_0x7ad5('0x0'));var util=require(_0x7ad5('0x1'));var path=require('path');var timeout=require(_0x7ad5('0x2'));var express=require(_0x7ad5('0x3'));var router=express[_0x7ad5('0x4')]();var fs_extra=require(_0x7ad5('0x5'));var auth=require(_0x7ad5('0x6'));var interaction=require(_0x7ad5('0x7'));var config=require(_0x7ad5('0x8'));var controller=require(_0x7ad5('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7ad5('0xa')]);router[_0x7ad5('0xb')](_0x7ad5('0xc'),auth[_0x7ad5('0xd')](),controller[_0x7ad5('0xe')]);router[_0x7ad5('0xb')](_0x7ad5('0xf'),auth[_0x7ad5('0xd')](),controller[_0x7ad5('0x10')]);router[_0x7ad5('0xb')](_0x7ad5('0x11'),auth[_0x7ad5('0xd')](),controller['getSections']);router[_0x7ad5('0xb')](_0x7ad5('0x12'),auth[_0x7ad5('0xd')](),controller['getResources']);router[_0x7ad5('0x13')]('/',auth['isAuthenticated'](),controller[_0x7ad5('0x14')]);router[_0x7ad5('0x13')](_0x7ad5('0x15'),auth[_0x7ad5('0xd')](),controller['clone']);router[_0x7ad5('0x13')]('/:id/sections',auth['isAuthenticated'](),controller[_0x7ad5('0x16')]);router[_0x7ad5('0x13')](_0x7ad5('0x12'),auth['isAuthenticated'](),controller['addResources']);router[_0x7ad5('0x17')](_0x7ad5('0xf'),auth[_0x7ad5('0xd')](),controller['update']);router[_0x7ad5('0x18')](_0x7ad5('0xf'),auth[_0x7ad5('0xd')](),controller[_0x7ad5('0x19')]);router[_0x7ad5('0x18')](_0x7ad5('0x11'),auth[_0x7ad5('0xd')](),controller[_0x7ad5('0x1a')]);router[_0x7ad5('0x18')](_0x7ad5('0x12'),auth[_0x7ad5('0xd')](),controller[_0x7ad5('0x1b')]);module[_0x7ad5('0x1c')]=router;
\ No newline at end of file
index 42a6445..7d7ccf0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff40=['STRING','setDataValue','crudPermissions','join','getDataValue','BOOLEAN','sequelize'];(function(_0x4b2d62,_0x269a5f){var _0x40b29a=function(_0x33db79){while(--_0x33db79){_0x4b2d62['push'](_0x4b2d62['shift']());}};_0x40b29a(++_0x269a5f);}(_0xff40,0x117));var _0x0ff4=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0xff40[_0x58dc25];return _0x21b0a7;};'use strict';var Sequelize=require(_0x0ff4('0x0'));module['exports']={'name':{'type':Sequelize[_0x0ff4('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x0ff4('0x1')],'set':function(_0x26b24a){this[_0x0ff4('0x2')](_0x0ff4('0x3'),_0x26b24a?_0x26b24a[_0x0ff4('0x4')](''):[]);},'get':function(){return this[_0x0ff4('0x5')]('crudPermissions')?this['getDataValue'](_0x0ff4('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x0ff4('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x0ff4('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x0ff4('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x0ff4('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0ff4('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x0ff4('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0ff4('0x6')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xbe0b=['sequelize','exports','STRING','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0xd9d6aa,_0x92fe5e){var _0x4ca74d=function(_0x19a8e2){while(--_0x19a8e2){_0xd9d6aa['push'](_0xd9d6aa['shift']());}};_0x4ca74d(++_0x92fe5e);}(_0xbe0b,0x6c));var _0xbbe0=function(_0x1cf62f,_0x31c033){_0x1cf62f=_0x1cf62f-0x0;var _0x2d593e=_0xbe0b[_0x1cf62f];return _0x2d593e;};'use strict';var Sequelize=require(_0xbbe0('0x0'));module[_0xbbe0('0x1')]={'name':{'type':Sequelize[_0xbbe0('0x2')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x5b32b6){this[_0xbbe0('0x3')](_0xbbe0('0x4'),_0x5b32b6?_0x5b32b6[_0xbbe0('0x5')](''):[]);},'get':function(){return this[_0xbbe0('0x6')](_0xbbe0('0x4'))?this[_0xbbe0('0x6')](_0xbbe0('0x4'))[_0xbbe0('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xbbe0('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xbbe0('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xbbe0('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xbbe0('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xbbe0('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xbbe0('0x8')],'defaultValue':!![]}};
\ No newline at end of file
index 9b44a45..1cf7a74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ff9=['send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','include','findAll','rows','show','params','find','catch','create','body','clone','includeAll','options','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','UserProfileSection','destroy','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','push','findOne','Dashboard','resourceId','forEach','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','redis','defaults','socket.io-emitter','./userProfile.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','stack','name'];(function(_0x188edb,_0x19fed6){var _0x669a3d=function(_0x40b5d9){while(--_0x40b5d9){_0x188edb['push'](_0x188edb['shift']());}};_0x669a3d(++_0x19fed6);}(_0x8ff9,0x1a6));var _0x98ff=function(_0x5a67a5,_0x3b9c46){_0x5a67a5=_0x5a67a5-0x0;var _0x3ac6f9=_0x8ff9[_0x5a67a5];return _0x3ac6f9;};'use strict';var emlformat=require(_0x98ff('0x0'));var rimraf=require(_0x98ff('0x1'));var zipdir=require(_0x98ff('0x2'));var jsonpatch=require(_0x98ff('0x3'));var rp=require(_0x98ff('0x4'));var moment=require(_0x98ff('0x5'));var BPromise=require(_0x98ff('0x6'));var Mustache=require(_0x98ff('0x7'));var util=require(_0x98ff('0x8'));var path=require(_0x98ff('0x9'));var sox=require(_0x98ff('0xa'));var csv=require('to-csv');var ejs=require(_0x98ff('0xb'));var fs=require('fs');var fs_extra=require(_0x98ff('0xc'));var _=require(_0x98ff('0xd'));var squel=require(_0x98ff('0xe'));var crypto=require(_0x98ff('0xf'));var jsforce=require(_0x98ff('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x98ff('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x98ff('0x12'));var authService=require(_0x98ff('0x13'));var qs=require(_0x98ff('0x14'));var as=require(_0x98ff('0x15'));var hardwareService=require(_0x98ff('0x16'));var logger=require('../../config/logger')(_0x98ff('0x17'));var utils=require('../../config/utils');var config=require(_0x98ff('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x98ff('0x19')]=_[_0x98ff('0x1a')](config[_0x98ff('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x98ff('0x1b'))(new Redis(config['redis']));require(_0x98ff('0x1c'))[_0x98ff('0x1d')](socket);function respondWithStatusCode(_0x2c4e4d,_0x3a7e21){_0x3a7e21=_0x3a7e21||0xcc;return function(_0x2aae4d){if(_0x2aae4d){return _0x2c4e4d[_0x98ff('0x1e')](_0x3a7e21);}return _0x2c4e4d['status'](_0x3a7e21)[_0x98ff('0x1f')]();};}function respondWithResult(_0x196f27,_0xb48c72){_0xb48c72=_0xb48c72||0xc8;return function(_0x5af32){if(_0x5af32){return _0x196f27[_0x98ff('0x20')](_0xb48c72)[_0x98ff('0x21')](_0x5af32);}};}function respondWithFilteredResult(_0x1f3044,_0x33023e){return function(_0x268121){if(_0x268121){var _0x3c04d4=typeof _0x33023e[_0x98ff('0x22')]===_0x98ff('0x23')&&typeof _0x33023e[_0x98ff('0x24')]===_0x98ff('0x23');var _0x4c235b=_0x268121[_0x98ff('0x25')];var _0x31f525=_0x3c04d4?0x0:_0x33023e[_0x98ff('0x22')];var _0x43fb4f=_0x3c04d4?_0x268121[_0x98ff('0x25')]:_0x33023e[_0x98ff('0x22')]+_0x33023e[_0x98ff('0x24')];var _0x3a6c52;if(_0x43fb4f>=_0x4c235b){_0x43fb4f=_0x4c235b;_0x3a6c52=0xc8;}else{_0x3a6c52=0xce;}_0x1f3044[_0x98ff('0x20')](_0x3a6c52);return _0x1f3044[_0x98ff('0x26')](_0x98ff('0x27'),_0x31f525+'-'+_0x43fb4f+'/'+_0x4c235b)[_0x98ff('0x21')](_0x268121);}return null;};}function patchUpdates(_0x2fdbc2){return function(_0x4ea518){try{jsonpatch['apply'](_0x4ea518,_0x2fdbc2,!![]);}catch(_0x4c6ddc){return BPromise[_0x98ff('0x28')](_0x4c6ddc);}return _0x4ea518[_0x98ff('0x29')]();};}function saveUpdates(_0x547fab,_0xd0293e){return function(_0x58b281){if(_0x58b281){return _0x58b281[_0x98ff('0x2a')](_0x547fab)[_0x98ff('0x2b')](function(_0x308efd){return _0x308efd;});}return null;};}function removeEntity(_0x2b3ee9,_0x4003de){return function(_0x5c1c0c){if(_0x5c1c0c){return _0x5c1c0c['destroy']()[_0x98ff('0x2b')](function(){_0x2b3ee9[_0x98ff('0x20')](0xcc)[_0x98ff('0x1f')]();});}};}function handleEntityNotFound(_0x6ccf21,_0x8b7939){return function(_0x231e00){if(!_0x231e00){_0x6ccf21[_0x98ff('0x1e')](0x194);}return _0x231e00;};}function handleError(_0x28e0a0,_0xda7649){_0xda7649=_0xda7649||0x1f4;return function(_0x25a658){logger['error'](_0x25a658[_0x98ff('0x2c')]);if(_0x25a658[_0x98ff('0x2d')]){delete _0x25a658[_0x98ff('0x2d')];}_0x28e0a0[_0x98ff('0x20')](_0xda7649)[_0x98ff('0x2e')](_0x25a658);};}exports[_0x98ff('0x2f')]=function(_0x17975c,_0x41c093){var _0x42213a={},_0x205d85={},_0x3fa70c={'count':0x0,'rows':[]};var _0x1472cb=_[_0x98ff('0x30')](db[_0x98ff('0x31')][_0x98ff('0x32')],function(_0x81e918){return{'name':_0x81e918[_0x98ff('0x33')],'type':_0x81e918[_0x98ff('0x34')][_0x98ff('0x35')]};});_0x205d85[_0x98ff('0x36')]=_[_0x98ff('0x30')](_0x1472cb,'name');_0x205d85[_0x98ff('0x37')]=_[_0x98ff('0x38')](_0x17975c[_0x98ff('0x37')]);_0x205d85[_0x98ff('0x39')]=_[_0x98ff('0x3a')](_0x205d85['model'],_0x205d85[_0x98ff('0x37')]);_0x42213a['attributes']=_[_0x98ff('0x3a')](_0x205d85[_0x98ff('0x36')],qs[_0x98ff('0x3b')](_0x17975c[_0x98ff('0x37')][_0x98ff('0x3b')]));_0x42213a[_0x98ff('0x3c')]=_0x42213a[_0x98ff('0x3c')][_0x98ff('0x3d')]?_0x42213a[_0x98ff('0x3c')]:_0x205d85[_0x98ff('0x36')];if(!_0x17975c['query'][_0x98ff('0x3e')](_0x98ff('0x3f'))){_0x42213a[_0x98ff('0x24')]=qs[_0x98ff('0x24')](_0x17975c[_0x98ff('0x37')][_0x98ff('0x24')]);_0x42213a[_0x98ff('0x22')]=qs[_0x98ff('0x22')](_0x17975c['query'][_0x98ff('0x22')]);}_0x42213a['order']=qs[_0x98ff('0x40')](_0x17975c[_0x98ff('0x37')][_0x98ff('0x40')]);_0x42213a[_0x98ff('0x41')]=qs[_0x98ff('0x39')](_['pick'](_0x17975c['query'],_0x205d85[_0x98ff('0x39')]),_0x1472cb);if(_0x17975c[_0x98ff('0x37')][_0x98ff('0x42')]){_0x42213a[_0x98ff('0x41')]=_[_0x98ff('0x43')](_0x42213a[_0x98ff('0x41')],{'$or':_[_0x98ff('0x30')](_0x1472cb,function(_0x55286f){if(_0x55286f[_0x98ff('0x34')]!==_0x98ff('0x44')){var _0x2ef081={};_0x2ef081[_0x55286f[_0x98ff('0x2d')]]={'$like':'%'+_0x17975c[_0x98ff('0x37')][_0x98ff('0x42')]+'%'};return _0x2ef081;}})});}_0x42213a=_[_0x98ff('0x43')]({},_0x42213a,_0x17975c['options']);var _0x2c6ea8={'where':_0x42213a[_0x98ff('0x41')]};return db[_0x98ff('0x31')][_0x98ff('0x25')](_0x2c6ea8)[_0x98ff('0x2b')](function(_0x5d8c45){_0x3fa70c['count']=_0x5d8c45;if(_0x17975c[_0x98ff('0x37')]['includeAll']){_0x42213a[_0x98ff('0x45')]=[{'all':!![]}];}return db[_0x98ff('0x31')][_0x98ff('0x46')](_0x42213a);})[_0x98ff('0x2b')](function(_0x4208f5){_0x3fa70c[_0x98ff('0x47')]=_0x4208f5;return _0x3fa70c;})['then'](respondWithFilteredResult(_0x41c093,_0x42213a))['catch'](handleError(_0x41c093,null));};exports[_0x98ff('0x48')]=function(_0x4f2be4,_0x1507d1){var _0x61d31d={'raw':![],'where':{'id':_0x4f2be4[_0x98ff('0x49')]['id']}},_0xd3c5b0={};_0xd3c5b0[_0x98ff('0x36')]=_[_0x98ff('0x38')](db['UserProfile'][_0x98ff('0x32')]);_0xd3c5b0[_0x98ff('0x37')]=_[_0x98ff('0x38')](_0x4f2be4['query']);_0xd3c5b0[_0x98ff('0x39')]=_[_0x98ff('0x3a')](_0xd3c5b0[_0x98ff('0x36')],_0xd3c5b0[_0x98ff('0x37')]);_0x61d31d[_0x98ff('0x3c')]=_[_0x98ff('0x3a')](_0xd3c5b0[_0x98ff('0x36')],qs[_0x98ff('0x3b')](_0x4f2be4[_0x98ff('0x37')][_0x98ff('0x3b')]));_0x61d31d[_0x98ff('0x3c')]=_0x61d31d[_0x98ff('0x3c')][_0x98ff('0x3d')]?_0x61d31d[_0x98ff('0x3c')]:_0xd3c5b0[_0x98ff('0x36')];if(_0x4f2be4[_0x98ff('0x37')]['includeAll']){_0x61d31d['include']=[{'all':!![]}];}_0x61d31d=_[_0x98ff('0x43')]({},_0x61d31d,_0x4f2be4['options']);return db[_0x98ff('0x31')][_0x98ff('0x4a')](_0x61d31d)[_0x98ff('0x2b')](handleEntityNotFound(_0x1507d1,null))[_0x98ff('0x2b')](respondWithResult(_0x1507d1,null))[_0x98ff('0x4b')](handleError(_0x1507d1,null));};exports[_0x98ff('0x4c')]=function(_0x4596f5,_0x3eb900){return db[_0x98ff('0x31')]['create'](_0x4596f5[_0x98ff('0x4d')],{})['then'](respondWithResult(_0x3eb900,0xc9))[_0x98ff('0x4b')](handleError(_0x3eb900,null));};exports[_0x98ff('0x4e')]=function(_0x5e3283,_0x1e62ec){var _0x35cda7={'where':{'id':_0x5e3283[_0x98ff('0x49')]['id']}},_0x55c04f={};_0x55c04f[_0x98ff('0x36')]=_['keys'](db[_0x98ff('0x31')][_0x98ff('0x32')]);_0x35cda7[_0x98ff('0x3c')]=_[_0x98ff('0x3a')](_0x55c04f[_0x98ff('0x36')],qs[_0x98ff('0x3b')](_0x5e3283['query'][_0x98ff('0x3b')]));_0x35cda7[_0x98ff('0x3c')]=_0x35cda7[_0x98ff('0x3c')][_0x98ff('0x3d')]?_0x35cda7[_0x98ff('0x3c')]:_0x55c04f[_0x98ff('0x36')];if(_0x5e3283[_0x98ff('0x37')][_0x98ff('0x4f')]){_0x35cda7[_0x98ff('0x45')]=[{'all':!![]}];}_0x35cda7=_[_0x98ff('0x43')]({},_0x35cda7,_0x5e3283[_0x98ff('0x50')]);return db['UserProfile']['find'](_0x35cda7)[_0x98ff('0x2b')](handleEntityNotFound(_0x1e62ec,null))[_0x98ff('0x2b')](function(_0x3fe60f){if(_0x3fe60f){var _0x2b9789=_0x3fe60f[_0x98ff('0x51')]({'plain':!![]});_0x2b9789=qs[_0x98ff('0x52')](_0x2b9789,['id',_0x98ff('0x53'),_0x98ff('0x54'),_0x98ff('0x55')]);_0x5e3283['body']=_[_0x98ff('0x52')](_0x5e3283[_0x98ff('0x4d')],['id',_0x98ff('0x53'),_0x98ff('0x54')]);return db[_0x98ff('0x56')][_0x98ff('0x57')](function(_0x407fc8){return db[_0x98ff('0x31')][_0x98ff('0x4c')](_[_0x98ff('0x43')](_0x2b9789,_0x5e3283['body']),{'include':_0x5e3283['query'][_0x98ff('0x4f')]?[{'all':!![]}]:undefined,'transaction':_0x407fc8})[_0x98ff('0x2b')](function(_0x56b10a){var _0x302e7c=_0x56b10a['get']({'plain':!![]});return db['UserProfileSection'][_0x98ff('0x46')]({'where':{'userProfileId':_0x5e3283[_0x98ff('0x49')]['id']},'raw':!![]})['then'](function(_0x4f97c9){if(_0x4f97c9){return BPromise[_0x98ff('0x58')](_0x4f97c9,function(_0x3bb079){return new BPromise(function(_0x3a4ee2,_0x38fc80){if(_0x3bb079[_0x98ff('0x59')]===null||_0x3bb079['autoAssociation']===0x1)_0x3a4ee2(null);return db[_0x98ff('0x5a')][_0x98ff('0x46')]({'where':{'sectionId':_0x3bb079['id']},'raw':!![]})[_0x98ff('0x2b')](function(_0xa794c4){var _0x23479a=_[_0x98ff('0x30')](_0xa794c4,function(_0x595e5a){return qs['omit'](_0x595e5a,['id',_0x98ff('0x53'),_0x98ff('0x54'),_0x98ff('0x5b')]);});_0x3a4ee2(_0x23479a);})['catch'](function(_0x3abd71){_0x38fc80(_0x3abd71);});})[_0x98ff('0x2b')](function(_0x717195){var _0xc88fee=qs[_0x98ff('0x52')](_0x3bb079,['id',_0x98ff('0x53'),_0x98ff('0x54')]);_0xc88fee[_0x98ff('0x5c')]=_0x302e7c['id'];if(_0x717195)_0xc88fee['Resources']=_0x717195;return _0xc88fee;})[_0x98ff('0x2b')](function(_0x1d3bf6){return db['UserProfileSection'][_0x98ff('0x4c')](_0x1d3bf6,{'include':[{'model':db[_0x98ff('0x5a')],'as':_0x98ff('0x5d')}],'raw':!![],'transaction':_0x407fc8});});})[_0x98ff('0x2b')](function(){return _0x302e7c;});}});});});}})['then'](respondWithResult(_0x1e62ec,0xc9))[_0x98ff('0x4b')](handleError(_0x1e62ec,null));};exports['update']=function(_0x488d84,_0x1d28d7){if(_0x488d84[_0x98ff('0x4d')]['id']){delete _0x488d84[_0x98ff('0x4d')]['id'];}return db[_0x98ff('0x31')][_0x98ff('0x4a')]({'where':{'id':_0x488d84[_0x98ff('0x49')]['id']}})[_0x98ff('0x2b')](handleEntityNotFound(_0x1d28d7,null))[_0x98ff('0x2b')](saveUpdates(_0x488d84['body'],null))[_0x98ff('0x2b')](respondWithResult(_0x1d28d7,null))[_0x98ff('0x4b')](handleError(_0x1d28d7,null));};exports['destroy']=function(_0x47dde5,_0x54ed73){return db[_0x98ff('0x31')]['find']({'where':{'id':_0x47dde5[_0x98ff('0x49')]['id']}})[_0x98ff('0x2b')](handleEntityNotFound(_0x54ed73,null))[_0x98ff('0x2b')](removeEntity(_0x54ed73,null))[_0x98ff('0x4b')](handleError(_0x54ed73,null));};exports[_0x98ff('0x5e')]=function(_0x3960e2,_0x1e5937){return db[_0x98ff('0x31')][_0x98ff('0x5e')]()[_0x98ff('0x2b')](respondWithResult(_0x1e5937,null))[_0x98ff('0x4b')](handleError(_0x1e5937,null));};exports[_0x98ff('0x5f')]=function(_0x46dfad,_0x4f27ed){var _0x1fe438=_0x46dfad['body'];return db[_0x98ff('0x31')]['find']({'where':{'id':_0x46dfad[_0x98ff('0x49')]['id']}})['then'](handleEntityNotFound(_0x4f27ed,null))[_0x98ff('0x2b')](function(_0x41e465){if(_0x41e465){return db[_0x98ff('0x56')][_0x98ff('0x57')](function(_0x580d9a){return db[_0x98ff('0x60')][_0x98ff('0x61')]({'where':{'userProfileId':_0x46dfad[_0x98ff('0x49')]['id'],'sectionId':_[_0x98ff('0x30')](_0x1fe438,function(_0x531a4d){return _0x531a4d['sectionId'];})},'transaction':_0x580d9a})['then'](function(){var _0x200064=_[_0x98ff('0x30')](_0x1fe438,function(_0x13e386){_0x13e386[_0x98ff('0x5c')]=_0x46dfad[_0x98ff('0x49')]['id'];return _0x13e386;});var _0x4bc79f=[];return BPromise[_0x98ff('0x58')](_0x200064,function(_0x426979){return db[_0x98ff('0x60')][_0x98ff('0x4c')](_0x426979,{'include':[{'model':db[_0x98ff('0x5a')],'as':'Resources'}],'raw':!![],'transaction':_0x580d9a})[_0x98ff('0x2b')](function(_0x5c887c){_0x4bc79f['push'](_0x5c887c[_0x98ff('0x51')]({'plain':!![]}));});})[_0x98ff('0x2b')](function(){return _0x4bc79f;});});});}})[_0x98ff('0x2b')](function(_0x3e5572){return _0x3e5572;})[_0x98ff('0x2b')](respondWithResult(_0x4f27ed,null))['catch'](handleError(_0x4f27ed,null));};exports[_0x98ff('0x62')]=function(_0x5f197d,_0x5302ac){var _0x321f61;return db[_0x98ff('0x31')][_0x98ff('0x4a')]({'where':{'id':_0x5f197d['params']['id']},'attributes':['id',_0x98ff('0x2d')]})[_0x98ff('0x2b')](handleEntityNotFound(_0x5302ac,null))[_0x98ff('0x2b')](function(_0x3f78a7){if(_0x3f78a7){_0x321f61=_0x3f78a7;return db[_0x98ff('0x60')][_0x98ff('0x61')]({'where':{'userProfileId':_0x5f197d[_0x98ff('0x49')]['id'],'sectionId':_0x5f197d['query'][_0x98ff('0x63')]}});}})['then'](function(){return _0x321f61;})['then'](respondWithStatusCode(_0x5302ac,null))[_0x98ff('0x4b')](handleError(_0x5302ac,null));};exports[_0x98ff('0x64')]=function(_0x460bed,_0x1af88c){var _0x1ccae4=[];var _0x3d9333=[];return db[_0x98ff('0x60')][_0x98ff('0x46')]({'where':{'userProfileId':_0x460bed[_0x98ff('0x49')]['id']},'raw':!![]})[_0x98ff('0x2b')](function(_0x5efbdc){_0x1ccae4=_[_0x98ff('0x42')](_0x5efbdc,function(_0xf01703){return _0xf01703[_0x98ff('0x65')]===0x1||_['includes']([0x3eb,0x709],_0xf01703[_0x98ff('0x5b')]);});if(!_[_0x98ff('0x66')](_0x1ccae4)){return _[_0x98ff('0x30')](_0x1ccae4,function(_0x5b9d87){return _0x5b9d87[_0x98ff('0x5b')];});}else{return;}})[_0x98ff('0x2b')](function(_0x41ca49){if(_0x41ca49)_0x3d9333=_0x41ca49;if(_[_0x98ff('0x67')](_0x3d9333,0x64)){var _0x184005=_[_0x98ff('0x4a')](_0x1ccae4,{'sectionId':0x64});return hasDefaultDashboard(_0x184005)[_0x98ff('0x2b')](function(_0x93ea98){return _['map'](_0x1ccae4,function(_0xee17ca){if(_0xee17ca[_0x98ff('0x5b')]===0x64){_0xee17ca[_0x98ff('0x68')]=_0x93ea98;}return _0xee17ca;});});}else{return;}})['then'](function(_0x5c388c){if(_0x5c388c)_0x1ccae4=_0x5c388c;if(_['includes'](_0x3d9333,0x3eb)){var _0x48dcb5=_['find'](_0x1ccae4,{'sectionId':0x3eb});return getCustomDashboards(_0x48dcb5)[_0x98ff('0x2b')](function(_0x34bf7d){return _[_0x98ff('0x30')](_0x1ccae4,function(_0x7f7a01){if(_0x48dcb5[_0x98ff('0x65')]){if(_0x7f7a01[_0x98ff('0x5b')]===0x3eb){_0x7f7a01['subsections']=_0x34bf7d;}}else{if(_0x7f7a01[_0x98ff('0x5b')]===0x64){_0x7f7a01[_0x98ff('0x68')]=_0x34bf7d;}}return _0x7f7a01;});});}else{return;}})[_0x98ff('0x2b')](function(_0x5e90f7){if(_0x5e90f7)_0x1ccae4=_0x5e90f7;if(_['includes'](_0x3d9333,0x709)){var _0x591239=_[_0x98ff('0x4a')](_0x1ccae4,{'sectionId':0x709});return getPlugins(_0x591239)['then'](function(_0xa5f58a){if(_0x591239[_0x98ff('0x65')]){return _[_0x98ff('0x30')](_0x1ccae4,function(_0x46ebbf){if(_0x46ebbf['sectionId']===0x709){_0x46ebbf['subsections']=_0xa5f58a;}return _0x46ebbf;});}else{var _0x4b7100={'sectionId':0x76c,'enabled':0x1,'subsections':_0xa5f58a};var _0x538497=_[_0x98ff('0x30')](_0x1ccae4);_0x538497[_0x98ff('0x69')](_0x4b7100);return _0x538497;}});}else{return;}})[_0x98ff('0x2b')](function(_0x8a790a){if(_0x8a790a)_0x1ccae4=_0x8a790a;return _[_0x98ff('0x42')](_0x1ccae4,[_0x98ff('0x65'),0x1]);})[_0x98ff('0x2b')](respondWithResult(_0x1af88c,null))['catch'](handleError(_0x1af88c,null));};function hasDefaultDashboard(_0x348833){var _0x4ba137=[0x65];return new BPromise(function(_0x3a0faa,_0x50fda4){try{if(_0x348833[_0x98ff('0x59')]){_0x3a0faa(_0x4ba137);}else{return db['UserProfileResource'][_0x98ff('0x6a')]({'where':{'sectionId':_0x348833['id']},'raw':!![]})[_0x98ff('0x2b')](function(_0x4c3c62){_0x4c3c62?_0x3a0faa(_0x4ba137):_0x3a0faa();});}}catch(_0x528cb3){_0x50fda4(_0x528cb3);}});}function getCustomDashboards(_0x39fab1){var _0x527d68=[];return new BPromise(function(_0x2bc84f,_0x358fb6){try{if(_0x39fab1[_0x98ff('0x59')]){return db[_0x98ff('0x6b')][_0x98ff('0x46')]({'raw':!![]})[_0x98ff('0x2b')](function(_0x5cd834){_0x5cd834['forEach'](function(_0x61dcdf){_0x527d68[_0x98ff('0x69')](_0x61dcdf['id']+0x1869f);});_0x2bc84f(_0x527d68);});}else{return db[_0x98ff('0x5a')][_0x98ff('0x46')]({'where':{'sectionId':_0x39fab1['id']},'raw':!![]})[_0x98ff('0x2b')](function(_0x10da98){_0x10da98['forEach'](function(_0x4c8899){_0x527d68[_0x98ff('0x69')](_0x4c8899[_0x98ff('0x6c')]+0x1869f);});_0x2bc84f(_0x527d68);});}}catch(_0x8b1ee1){_0x358fb6(_0x8b1ee1);}});}function getPlugins(_0x7be72c){var _0x468157=[];return new BPromise(function(_0x30de9b,_0x1f7537){try{if(_0x7be72c[_0x98ff('0x59')]){return db['Plugin'][_0x98ff('0x46')]({'raw':!![]})['then'](function(_0x2bd7a7){_0x2bd7a7[_0x98ff('0x6d')](function(_0x58532b){_0x468157[_0x98ff('0x69')](_0x58532b['id']+0x15b38);});_0x30de9b(_0x468157);});}else{return db[_0x98ff('0x5a')][_0x98ff('0x46')]({'where':{'sectionId':_0x7be72c['id']},'raw':!![]})[_0x98ff('0x2b')](function(_0x45890c){_0x45890c[_0x98ff('0x6d')](function(_0x1f3345){_0x468157[_0x98ff('0x69')](_0x1f3345[_0x98ff('0x6c')]+0x15b38);});_0x30de9b(_0x468157);});}}catch(_0x106f0b){_0x1f7537(_0x106f0b);}});}exports[_0x98ff('0x6e')]=function(_0x541994,_0x4eeeea){return db[_0x98ff('0x31')][_0x98ff('0x4a')]({'where':{'id':_0x541994['params']['id']}})['then'](handleEntityNotFound(_0x4eeeea,null))['then'](function(_0x553df4){if(_0x553df4){return db[_0x98ff('0x56')][_0x98ff('0x57')](function(_0x3a337b){return db[_0x98ff('0x60')][_0x98ff('0x46')]({'where':{'userProfileId':_0x541994[_0x98ff('0x49')]['id']},'attributes':['id'],'raw':!![]})[_0x98ff('0x2b')](function(_0x436859){if(_0x436859){return db[_0x98ff('0x60')][_0x98ff('0x61')]({'where':{'userProfileId':_0x541994['params']['id'],'id':_[_0x98ff('0x30')](_0x436859,function(_0x3a51b2){return _0x3a51b2['id'];})},'transaction':_0x3a337b});}})[_0x98ff('0x2b')](function(_0x19be95){var _0x5eaeb8=_[_0x98ff('0x30')](_0x541994[_0x98ff('0x4d')],function(_0x5b3aa0){_0x5b3aa0[_0x98ff('0x5c')]=_0x541994[_0x98ff('0x49')]['id'];return _0x5b3aa0;});return db['UserProfileSection'][_0x98ff('0x6f')](_0x5eaeb8,{'raw':!![],'transaction':_0x3a337b});})[_0x98ff('0x2b')](function(_0x150b27){var _0x2e12c6=_[_0x98ff('0x42')](_[_0x98ff('0x30')](_0x150b27,function(_0x552d36){return _0x552d36[_0x98ff('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x2e12c6){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x541994[_0x98ff('0x49')]['id'],'sectionId':_[_0x98ff('0x30')](_0x2e12c6,function(_0x8d939c){return _0x8d939c['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0x98ff('0x2b')](function(_0x306f88){var _0xfbf24f=_[_0x98ff('0x30')](_0x541994[_0x98ff('0x4d')],function(_0x435b95){_0x435b95[_0x98ff('0x5c')]=_0x541994[_0x98ff('0x49')]['id'];return _0x435b95;});return db[_0x98ff('0x5a')]['bulkCreate'](_0xfbf24f,{'raw':!![],'transaction':_0x3a337b});});}})['catch'](handleError(_0x4eeeea,null));});}})['then'](function(_0x222765){var _0x16b43c=_[_0x98ff('0x30')](_0x222765,function(_0x2b631d){return _0x2b631d[_0x98ff('0x51')]({'plain':!![]});});})[_0x98ff('0x2b')](respondWithResult(_0x4eeeea,null))[_0x98ff('0x4b')](handleError(_0x4eeeea,null));};exports['removeResources']=function(_0x80d1e8,_0x2f7370,_0x4fb094){return db['UserProfile'][_0x98ff('0x4a')]({'where':{'id':_0x80d1e8['params']['id']}})['then'](handleEntityNotFound(_0x2f7370,null))[_0x98ff('0x2b')](function(_0xac0688){if(_0xac0688){return _0xac0688[_0x98ff('0x70')](_0x80d1e8['query'][_0x98ff('0x63')]);}})[_0x98ff('0x2b')](respondWithStatusCode(_0x2f7370,null))[_0x98ff('0x4b')](handleError(_0x2f7370,null));};exports[_0x98ff('0x71')]=function(_0x4931aa,_0x5b0d37){var _0x33db1d={};if(!_0x4931aa['query'][_0x98ff('0x72')])throw new Error(_0x98ff('0x73'));if(!_0x4931aa['query'][_0x98ff('0x3e')](_0x98ff('0x3f'))){_0x33db1d[_0x98ff('0x24')]=qs['limit'](_0x4931aa[_0x98ff('0x37')][_0x98ff('0x24')]);_0x33db1d['offset']=qs[_0x98ff('0x22')](_0x4931aa[_0x98ff('0x37')][_0x98ff('0x22')]);}return db[_0x98ff('0x31')][_0x98ff('0x4a')]({'where':{'id':_0x4931aa[_0x98ff('0x49')]['id']}})[_0x98ff('0x2b')](function(_0x40d35d){if(!_0x40d35d)throw new Error(_0x98ff('0x74')+_0x4931aa[_0x98ff('0x49')]['id']);return db[_0x98ff('0x31')][_0x98ff('0x71')](_0x4931aa);})[_0x98ff('0x2b')](respondWithFilteredResult(_0x5b0d37,_0x33db1d))['catch'](handleError(_0x5b0d37,null));};
\ No newline at end of file
+var _0xc7da=['enabled','includes','isEmpty','subsections','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','end','stack','UserProfile','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','push','removeSections','ids','getSections'];(function(_0x465158,_0x43dff2){var _0x43eeb3=function(_0x52f6b7){while(--_0x52f6b7){_0x465158['push'](_0x465158['shift']());}};_0x43eeb3(++_0x43dff2);}(_0xc7da,0xf2));var _0xac7d=function(_0x33932c,_0x271465){_0x33932c=_0x33932c-0x0;var _0xf063b=_0xc7da[_0x33932c];return _0xf063b;};'use strict';var emlformat=require(_0xac7d('0x0'));var rimraf=require(_0xac7d('0x1'));var zipdir=require(_0xac7d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac7d('0x3'));var moment=require(_0xac7d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xac7d('0x5'));var util=require(_0xac7d('0x6'));var path=require('path');var sox=require(_0xac7d('0x7'));var csv=require(_0xac7d('0x8'));var ejs=require(_0xac7d('0x9'));var fs=require('fs');var fs_extra=require(_0xac7d('0xa'));var _=require(_0xac7d('0xb'));var squel=require(_0xac7d('0xc'));var crypto=require('crypto');var jsforce=require(_0xac7d('0xd'));var deskjs=require(_0xac7d('0xe'));var toCsv=require(_0xac7d('0x8'));var querystring=require(_0xac7d('0xf'));var Papa=require(_0xac7d('0x10'));var Redis=require(_0xac7d('0x11'));var authService=require(_0xac7d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xac7d('0x13'));var hardwareService=require(_0xac7d('0x14'));var logger=require(_0xac7d('0x15'))('api');var utils=require(_0xac7d('0x16'));var config=require(_0xac7d('0x17'));var licenseUtil=require(_0xac7d('0x18'));var db=require(_0xac7d('0x19'))['db'];config['redis']=_[_0xac7d('0x1a')](config[_0xac7d('0x1b')],{'host':_0xac7d('0x1c'),'port':0x18eb});var socket=require(_0xac7d('0x1d'))(new Redis(config[_0xac7d('0x1b')]));require('./userProfile.socket')[_0xac7d('0x1e')](socket);function respondWithStatusCode(_0x5b94e9,_0x3e580d){_0x3e580d=_0x3e580d||0xcc;return function(_0x425235){if(_0x425235){return _0x5b94e9[_0xac7d('0x1f')](_0x3e580d);}return _0x5b94e9[_0xac7d('0x20')](_0x3e580d)['end']();};}function respondWithResult(_0x19e7ba,_0x4283dd){_0x4283dd=_0x4283dd||0xc8;return function(_0x27ed38){if(_0x27ed38){return _0x19e7ba[_0xac7d('0x20')](_0x4283dd)[_0xac7d('0x21')](_0x27ed38);}};}function respondWithFilteredResult(_0x48ac86,_0x7df8e0){return function(_0x3cb12d){if(_0x3cb12d){var _0x563634=typeof _0x7df8e0[_0xac7d('0x22')]===_0xac7d('0x23')&&typeof _0x7df8e0[_0xac7d('0x24')]===_0xac7d('0x23');var _0x4a5325=_0x3cb12d[_0xac7d('0x25')];var _0x3c6090=_0x563634?0x0:_0x7df8e0[_0xac7d('0x22')];var _0x518e77=_0x563634?_0x3cb12d[_0xac7d('0x25')]:_0x7df8e0['offset']+_0x7df8e0[_0xac7d('0x24')];var _0x3eedf8;if(_0x518e77>=_0x4a5325){_0x518e77=_0x4a5325;_0x3eedf8=0xc8;}else{_0x3eedf8=0xce;}_0x48ac86[_0xac7d('0x20')](_0x3eedf8);return _0x48ac86[_0xac7d('0x26')](_0xac7d('0x27'),_0x3c6090+'-'+_0x518e77+'/'+_0x4a5325)[_0xac7d('0x21')](_0x3cb12d);}return null;};}function patchUpdates(_0x5a006e){return function(_0x54c857){try{jsonpatch[_0xac7d('0x28')](_0x54c857,_0x5a006e,!![]);}catch(_0x6d2c50){return BPromise['reject'](_0x6d2c50);}return _0x54c857[_0xac7d('0x29')]();};}function saveUpdates(_0x3966dd,_0x2a5774){return function(_0x1c1f88){if(_0x1c1f88){return _0x1c1f88[_0xac7d('0x2a')](_0x3966dd)[_0xac7d('0x2b')](function(_0x200562){return _0x200562;});}return null;};}function removeEntity(_0x3bb7dd,_0x42e313){return function(_0x26a8c4){if(_0x26a8c4){return _0x26a8c4['destroy']()[_0xac7d('0x2b')](function(){_0x3bb7dd[_0xac7d('0x20')](0xcc)[_0xac7d('0x2c')]();});}};}function handleEntityNotFound(_0x1bcfd5,_0x4cc590){return function(_0x579b99){if(!_0x579b99){_0x1bcfd5['sendStatus'](0x194);}return _0x579b99;};}function handleError(_0xc30df3,_0x32b12c){_0x32b12c=_0x32b12c||0x1f4;return function(_0xac3f87){logger['error'](_0xac3f87[_0xac7d('0x2d')]);if(_0xac3f87['name']){delete _0xac3f87['name'];}_0xc30df3['status'](_0x32b12c)['send'](_0xac3f87);};}exports['index']=function(_0x104186,_0x1109b1){var _0x35be2f={},_0x31a082={},_0x15a950={'count':0x0,'rows':[]};var _0x5c3c15=_['map'](db[_0xac7d('0x2e')][_0xac7d('0x2f')],function(_0x20b54d){return{'name':_0x20b54d[_0xac7d('0x30')],'type':_0x20b54d[_0xac7d('0x31')][_0xac7d('0x32')]};});_0x31a082[_0xac7d('0x33')]=_[_0xac7d('0x34')](_0x5c3c15,_0xac7d('0x35'));_0x31a082[_0xac7d('0x36')]=_[_0xac7d('0x37')](_0x104186[_0xac7d('0x36')]);_0x31a082[_0xac7d('0x38')]=_[_0xac7d('0x39')](_0x31a082[_0xac7d('0x33')],_0x31a082[_0xac7d('0x36')]);_0x35be2f['attributes']=_[_0xac7d('0x39')](_0x31a082[_0xac7d('0x33')],qs[_0xac7d('0x3a')](_0x104186[_0xac7d('0x36')][_0xac7d('0x3a')]));_0x35be2f['attributes']=_0x35be2f[_0xac7d('0x3b')]['length']?_0x35be2f['attributes']:_0x31a082[_0xac7d('0x33')];if(!_0x104186[_0xac7d('0x36')][_0xac7d('0x3c')](_0xac7d('0x3d'))){_0x35be2f[_0xac7d('0x24')]=qs[_0xac7d('0x24')](_0x104186[_0xac7d('0x36')][_0xac7d('0x24')]);_0x35be2f[_0xac7d('0x22')]=qs[_0xac7d('0x22')](_0x104186[_0xac7d('0x36')]['offset']);}_0x35be2f['order']=qs[_0xac7d('0x3e')](_0x104186['query'][_0xac7d('0x3e')]);_0x35be2f[_0xac7d('0x3f')]=qs[_0xac7d('0x38')](_[_0xac7d('0x40')](_0x104186['query'],_0x31a082['filters']),_0x5c3c15);if(_0x104186[_0xac7d('0x36')][_0xac7d('0x41')]){_0x35be2f[_0xac7d('0x3f')]=_[_0xac7d('0x42')](_0x35be2f[_0xac7d('0x3f')],{'$or':_['map'](_0x5c3c15,function(_0x5415f1){if(_0x5415f1[_0xac7d('0x31')]!=='VIRTUAL'){var _0x117dc1={};_0x117dc1[_0x5415f1[_0xac7d('0x35')]]={'$like':'%'+_0x104186[_0xac7d('0x36')]['filter']+'%'};return _0x117dc1;}})});}_0x35be2f=_[_0xac7d('0x42')]({},_0x35be2f,_0x104186[_0xac7d('0x43')]);var _0x1d9bc1={'where':_0x35be2f[_0xac7d('0x3f')]};return db[_0xac7d('0x2e')][_0xac7d('0x25')](_0x1d9bc1)['then'](function(_0x4d4e6e){_0x15a950[_0xac7d('0x25')]=_0x4d4e6e;if(_0x104186[_0xac7d('0x36')]['includeAll']){_0x35be2f[_0xac7d('0x44')]=[{'all':!![]}];}return db[_0xac7d('0x2e')][_0xac7d('0x45')](_0x35be2f);})['then'](function(_0x5f3b48){_0x15a950[_0xac7d('0x46')]=_0x5f3b48;return _0x15a950;})['then'](respondWithFilteredResult(_0x1109b1,_0x35be2f))[_0xac7d('0x47')](handleError(_0x1109b1,null));};exports[_0xac7d('0x48')]=function(_0x411a44,_0x18717f){var _0x3ab9c7={'raw':![],'where':{'id':_0x411a44[_0xac7d('0x49')]['id']}},_0xbe836={};_0xbe836[_0xac7d('0x33')]=_[_0xac7d('0x37')](db[_0xac7d('0x2e')]['rawAttributes']);_0xbe836[_0xac7d('0x36')]=_[_0xac7d('0x37')](_0x411a44[_0xac7d('0x36')]);_0xbe836[_0xac7d('0x38')]=_[_0xac7d('0x39')](_0xbe836[_0xac7d('0x33')],_0xbe836[_0xac7d('0x36')]);_0x3ab9c7['attributes']=_[_0xac7d('0x39')](_0xbe836[_0xac7d('0x33')],qs['fields'](_0x411a44[_0xac7d('0x36')][_0xac7d('0x3a')]));_0x3ab9c7[_0xac7d('0x3b')]=_0x3ab9c7[_0xac7d('0x3b')][_0xac7d('0x4a')]?_0x3ab9c7[_0xac7d('0x3b')]:_0xbe836[_0xac7d('0x33')];if(_0x411a44['query'][_0xac7d('0x4b')]){_0x3ab9c7[_0xac7d('0x44')]=[{'all':!![]}];}_0x3ab9c7=_['merge']({},_0x3ab9c7,_0x411a44[_0xac7d('0x43')]);return db[_0xac7d('0x2e')][_0xac7d('0x4c')](_0x3ab9c7)['then'](handleEntityNotFound(_0x18717f,null))[_0xac7d('0x2b')](respondWithResult(_0x18717f,null))[_0xac7d('0x47')](handleError(_0x18717f,null));};exports[_0xac7d('0x4d')]=function(_0x302794,_0x57e0c2){return db[_0xac7d('0x2e')][_0xac7d('0x4d')](_0x302794[_0xac7d('0x4e')],{})[_0xac7d('0x2b')](respondWithResult(_0x57e0c2,0xc9))[_0xac7d('0x47')](handleError(_0x57e0c2,null));};exports['clone']=function(_0x4d5ebc,_0x100e6b){var _0x1ecf4b={'where':{'id':_0x4d5ebc['params']['id']}},_0x38f71e={};_0x38f71e[_0xac7d('0x33')]=_['keys'](db[_0xac7d('0x2e')][_0xac7d('0x2f')]);_0x1ecf4b[_0xac7d('0x3b')]=_[_0xac7d('0x39')](_0x38f71e[_0xac7d('0x33')],qs[_0xac7d('0x3a')](_0x4d5ebc['query'][_0xac7d('0x3a')]));_0x1ecf4b[_0xac7d('0x3b')]=_0x1ecf4b[_0xac7d('0x3b')][_0xac7d('0x4a')]?_0x1ecf4b[_0xac7d('0x3b')]:_0x38f71e[_0xac7d('0x33')];if(_0x4d5ebc[_0xac7d('0x36')][_0xac7d('0x4b')]){_0x1ecf4b[_0xac7d('0x44')]=[{'all':!![]}];}_0x1ecf4b=_[_0xac7d('0x42')]({},_0x1ecf4b,_0x4d5ebc[_0xac7d('0x43')]);return db[_0xac7d('0x2e')][_0xac7d('0x4c')](_0x1ecf4b)[_0xac7d('0x2b')](handleEntityNotFound(_0x100e6b,null))[_0xac7d('0x2b')](function(_0x3a7347){if(_0x3a7347){var _0xda0b68=_0x3a7347[_0xac7d('0x4f')]({'plain':!![]});_0xda0b68=qs[_0xac7d('0x50')](_0xda0b68,['id',_0xac7d('0x51'),_0xac7d('0x52'),_0xac7d('0x53')]);_0x4d5ebc[_0xac7d('0x4e')]=_[_0xac7d('0x50')](_0x4d5ebc['body'],['id','createdAt',_0xac7d('0x52')]);return db[_0xac7d('0x54')][_0xac7d('0x55')](function(_0x2c1c8a){return db['UserProfile'][_0xac7d('0x4d')](_[_0xac7d('0x42')](_0xda0b68,_0x4d5ebc[_0xac7d('0x4e')]),{'include':_0x4d5ebc[_0xac7d('0x36')][_0xac7d('0x4b')]?[{'all':!![]}]:undefined,'transaction':_0x2c1c8a})['then'](function(_0x28329b){var _0x36d8bd=_0x28329b[_0xac7d('0x4f')]({'plain':!![]});return db[_0xac7d('0x56')]['findAll']({'where':{'userProfileId':_0x4d5ebc['params']['id']},'raw':!![]})[_0xac7d('0x2b')](function(_0x456b84){if(_0x456b84){return BPromise[_0xac7d('0x57')](_0x456b84,function(_0x29fc2c){return new BPromise(function(_0x430260,_0x294a7c){if(_0x29fc2c[_0xac7d('0x58')]===null||_0x29fc2c[_0xac7d('0x58')]===0x1)_0x430260(null);return db[_0xac7d('0x59')]['findAll']({'where':{'sectionId':_0x29fc2c['id']},'raw':!![]})[_0xac7d('0x2b')](function(_0x26617a){var _0x7a9823=_[_0xac7d('0x34')](_0x26617a,function(_0x50a948){return qs[_0xac7d('0x50')](_0x50a948,['id',_0xac7d('0x51'),_0xac7d('0x52'),_0xac7d('0x5a')]);});_0x430260(_0x7a9823);})[_0xac7d('0x47')](function(_0x577bd8){_0x294a7c(_0x577bd8);});})[_0xac7d('0x2b')](function(_0x1d2347){var _0x912ceb=qs[_0xac7d('0x50')](_0x29fc2c,['id',_0xac7d('0x51'),_0xac7d('0x52')]);_0x912ceb[_0xac7d('0x5b')]=_0x36d8bd['id'];if(_0x1d2347)_0x912ceb['Resources']=_0x1d2347;return _0x912ceb;})[_0xac7d('0x2b')](function(_0x459d84){return db[_0xac7d('0x56')][_0xac7d('0x4d')](_0x459d84,{'include':[{'model':db[_0xac7d('0x59')],'as':_0xac7d('0x5c')}],'raw':!![],'transaction':_0x2c1c8a});});})[_0xac7d('0x2b')](function(){return _0x36d8bd;});}});});});}})[_0xac7d('0x2b')](respondWithResult(_0x100e6b,0xc9))[_0xac7d('0x47')](handleError(_0x100e6b,null));};exports[_0xac7d('0x2a')]=function(_0x22d7cd,_0x221b93){if(_0x22d7cd[_0xac7d('0x4e')]['id']){delete _0x22d7cd['body']['id'];}return db[_0xac7d('0x2e')][_0xac7d('0x4c')]({'where':{'id':_0x22d7cd[_0xac7d('0x49')]['id']}})['then'](handleEntityNotFound(_0x221b93,null))[_0xac7d('0x2b')](saveUpdates(_0x22d7cd['body'],null))['then'](respondWithResult(_0x221b93,null))[_0xac7d('0x47')](handleError(_0x221b93,null));};exports[_0xac7d('0x5d')]=function(_0x888d5f,_0x2ed3ab){return db[_0xac7d('0x2e')]['find']({'where':{'id':_0x888d5f[_0xac7d('0x49')]['id']}})['then'](handleEntityNotFound(_0x2ed3ab,null))[_0xac7d('0x2b')](removeEntity(_0x2ed3ab,null))['catch'](handleError(_0x2ed3ab,null));};exports[_0xac7d('0x5e')]=function(_0x46b202,_0x33be18){return db['UserProfile'][_0xac7d('0x5e')]()[_0xac7d('0x2b')](respondWithResult(_0x33be18,null))[_0xac7d('0x47')](handleError(_0x33be18,null));};exports[_0xac7d('0x5f')]=function(_0x5c9038,_0x298e2b){var _0x2779a4=_0x5c9038[_0xac7d('0x4e')];return db['UserProfile']['find']({'where':{'id':_0x5c9038[_0xac7d('0x49')]['id']}})[_0xac7d('0x2b')](handleEntityNotFound(_0x298e2b,null))['then'](function(_0x4b429a){if(_0x4b429a){return db[_0xac7d('0x54')]['transaction'](function(_0x36ff2d){return db[_0xac7d('0x56')][_0xac7d('0x5d')]({'where':{'userProfileId':_0x5c9038[_0xac7d('0x49')]['id'],'sectionId':_[_0xac7d('0x34')](_0x2779a4,function(_0x5bd9e0){return _0x5bd9e0[_0xac7d('0x5a')];})},'transaction':_0x36ff2d})[_0xac7d('0x2b')](function(){var _0x58960c=_[_0xac7d('0x34')](_0x2779a4,function(_0x334bc4){_0x334bc4[_0xac7d('0x5b')]=_0x5c9038['params']['id'];return _0x334bc4;});var _0x28e419=[];return BPromise[_0xac7d('0x57')](_0x58960c,function(_0x30d673){return db[_0xac7d('0x56')][_0xac7d('0x4d')](_0x30d673,{'include':[{'model':db[_0xac7d('0x59')],'as':'Resources'}],'raw':!![],'transaction':_0x36ff2d})['then'](function(_0x45d0fd){_0x28e419[_0xac7d('0x60')](_0x45d0fd[_0xac7d('0x4f')]({'plain':!![]}));});})['then'](function(){return _0x28e419;});});});}})[_0xac7d('0x2b')](function(_0x1f7f37){return _0x1f7f37;})[_0xac7d('0x2b')](respondWithResult(_0x298e2b,null))[_0xac7d('0x47')](handleError(_0x298e2b,null));};exports[_0xac7d('0x61')]=function(_0x1cf36a,_0x3c370d){var _0x1b6f79;return db[_0xac7d('0x2e')]['find']({'where':{'id':_0x1cf36a['params']['id']},'attributes':['id','name']})[_0xac7d('0x2b')](handleEntityNotFound(_0x3c370d,null))['then'](function(_0x1acf1b){if(_0x1acf1b){_0x1b6f79=_0x1acf1b;return db[_0xac7d('0x56')][_0xac7d('0x5d')]({'where':{'userProfileId':_0x1cf36a[_0xac7d('0x49')]['id'],'sectionId':_0x1cf36a[_0xac7d('0x36')][_0xac7d('0x62')]}});}})[_0xac7d('0x2b')](function(){return _0x1b6f79;})[_0xac7d('0x2b')](respondWithStatusCode(_0x3c370d,null))['catch'](handleError(_0x3c370d,null));};exports[_0xac7d('0x63')]=function(_0x43d26c,_0x49453e){var _0x29298b=[];var _0x50625f=[];return db[_0xac7d('0x56')][_0xac7d('0x45')]({'where':{'userProfileId':_0x43d26c[_0xac7d('0x49')]['id']},'raw':!![]})[_0xac7d('0x2b')](function(_0x2d766d){_0x29298b=_[_0xac7d('0x41')](_0x2d766d,function(_0x5085d2){return _0x5085d2[_0xac7d('0x64')]===0x1||_[_0xac7d('0x65')]([0x3eb,0x709],_0x5085d2[_0xac7d('0x5a')]);});if(!_[_0xac7d('0x66')](_0x29298b)){return _['map'](_0x29298b,function(_0x54fa30){return _0x54fa30['sectionId'];});}else{return;}})[_0xac7d('0x2b')](function(_0x59998b){if(_0x59998b)_0x50625f=_0x59998b;if(_[_0xac7d('0x65')](_0x50625f,0x64)){var _0x8cf7f6=_['find'](_0x29298b,{'sectionId':0x64});return hasDefaultDashboard(_0x8cf7f6)[_0xac7d('0x2b')](function(_0xf703a1){return _[_0xac7d('0x34')](_0x29298b,function(_0x22a3ab){if(_0x22a3ab[_0xac7d('0x5a')]===0x64){_0x22a3ab[_0xac7d('0x67')]=_0xf703a1;}return _0x22a3ab;});});}else{return;}})[_0xac7d('0x2b')](function(_0x17dbc1){if(_0x17dbc1)_0x29298b=_0x17dbc1;if(_[_0xac7d('0x65')](_0x50625f,0x3eb)){var _0x260281=_[_0xac7d('0x4c')](_0x29298b,{'sectionId':0x3eb});return getCustomDashboards(_0x260281)[_0xac7d('0x2b')](function(_0x38ee53){return _[_0xac7d('0x34')](_0x29298b,function(_0x2cde10){if(_0x260281[_0xac7d('0x64')]){if(_0x2cde10[_0xac7d('0x5a')]===0x3eb){_0x2cde10[_0xac7d('0x67')]=_0x38ee53;}}else{if(_0x2cde10[_0xac7d('0x5a')]===0x64){_0x2cde10['subsections']=_0x38ee53;}}return _0x2cde10;});});}else{return;}})['then'](function(_0x32e499){if(_0x32e499)_0x29298b=_0x32e499;if(_[_0xac7d('0x65')](_0x50625f,0x709)){var _0x428f20=_[_0xac7d('0x4c')](_0x29298b,{'sectionId':0x709});return getPlugins(_0x428f20)['then'](function(_0x7d535a){if(_0x428f20[_0xac7d('0x64')]){return _[_0xac7d('0x34')](_0x29298b,function(_0x4db037){if(_0x4db037[_0xac7d('0x5a')]===0x709){_0x4db037[_0xac7d('0x67')]=_0x7d535a;}return _0x4db037;});}else{var _0x1eabeb={'sectionId':0x76c,'enabled':0x1,'subsections':_0x7d535a};var _0x2ab84b=_['map'](_0x29298b);_0x2ab84b[_0xac7d('0x60')](_0x1eabeb);return _0x2ab84b;}});}else{return;}})[_0xac7d('0x2b')](function(_0x417415){if(_0x417415)_0x29298b=_0x417415;return _['filter'](_0x29298b,[_0xac7d('0x64'),0x1]);})['then'](respondWithResult(_0x49453e,null))[_0xac7d('0x47')](handleError(_0x49453e,null));};function hasDefaultDashboard(_0x3ec0a9){var _0x3de893=[0x65];return new BPromise(function(_0x574bb6,_0x5345a9){try{if(_0x3ec0a9[_0xac7d('0x58')]){_0x574bb6(_0x3de893);}else{return db[_0xac7d('0x59')]['findOne']({'where':{'sectionId':_0x3ec0a9['id']},'raw':!![]})[_0xac7d('0x2b')](function(_0x7e84a5){_0x7e84a5?_0x574bb6(_0x3de893):_0x574bb6();});}}catch(_0x59b59e){_0x5345a9(_0x59b59e);}});}function getCustomDashboards(_0x20b0d0){var _0x2be9ff=[];return new BPromise(function(_0x4efd06,_0x559643){try{if(_0x20b0d0[_0xac7d('0x58')]){return db[_0xac7d('0x68')]['findAll']({'raw':!![]})[_0xac7d('0x2b')](function(_0x21308c){_0x21308c[_0xac7d('0x69')](function(_0x472f55){_0x2be9ff['push'](_0x472f55['id']+0x1869f);});_0x4efd06(_0x2be9ff);});}else{return db[_0xac7d('0x59')]['findAll']({'where':{'sectionId':_0x20b0d0['id']},'raw':!![]})['then'](function(_0x53e402){_0x53e402[_0xac7d('0x69')](function(_0x5edac0){_0x2be9ff[_0xac7d('0x60')](_0x5edac0[_0xac7d('0x6a')]+0x1869f);});_0x4efd06(_0x2be9ff);});}}catch(_0x64cfbc){_0x559643(_0x64cfbc);}});}function getPlugins(_0x441022){var _0x3424db=[];return new BPromise(function(_0x130b71,_0x1a7341){try{if(_0x441022[_0xac7d('0x58')]){return db[_0xac7d('0x6b')][_0xac7d('0x45')]({'raw':!![]})[_0xac7d('0x2b')](function(_0x457034){_0x457034[_0xac7d('0x69')](function(_0x4420ea){_0x3424db[_0xac7d('0x60')](_0x4420ea['id']+0x15b38);});_0x130b71(_0x3424db);});}else{return db[_0xac7d('0x59')][_0xac7d('0x45')]({'where':{'sectionId':_0x441022['id']},'raw':!![]})[_0xac7d('0x2b')](function(_0x39b19d){_0x39b19d['forEach'](function(_0x44f443){_0x3424db[_0xac7d('0x60')](_0x44f443[_0xac7d('0x6a')]+0x15b38);});_0x130b71(_0x3424db);});}}catch(_0x42711e){_0x1a7341(_0x42711e);}});}exports['addResources']=function(_0x79c9f7,_0x3a548f){return db[_0xac7d('0x2e')][_0xac7d('0x4c')]({'where':{'id':_0x79c9f7[_0xac7d('0x49')]['id']}})[_0xac7d('0x2b')](handleEntityNotFound(_0x3a548f,null))[_0xac7d('0x2b')](function(_0x3aaf35){if(_0x3aaf35){return db[_0xac7d('0x54')][_0xac7d('0x55')](function(_0x34e30b){return db['UserProfileSection'][_0xac7d('0x45')]({'where':{'userProfileId':_0x79c9f7['params']['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x2e5c1d){if(_0x2e5c1d){return db[_0xac7d('0x56')][_0xac7d('0x5d')]({'where':{'userProfileId':_0x79c9f7[_0xac7d('0x49')]['id'],'id':_[_0xac7d('0x34')](_0x2e5c1d,function(_0xbc6455){return _0xbc6455['id'];})},'transaction':_0x34e30b});}})[_0xac7d('0x2b')](function(_0x2e78eb){var _0x29456f=_['map'](_0x79c9f7[_0xac7d('0x4e')],function(_0x2b0df2){_0x2b0df2[_0xac7d('0x5b')]=_0x79c9f7[_0xac7d('0x49')]['id'];return _0x2b0df2;});return db[_0xac7d('0x56')][_0xac7d('0x6c')](_0x29456f,{'raw':!![],'transaction':_0x34e30b});})[_0xac7d('0x2b')](function(_0x27eeae){var _0x28fef1=_['filter'](_['map'](_0x27eeae,function(_0x221a5d){return _0x221a5d[_0xac7d('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x28fef1){return db[_0xac7d('0x56')][_0xac7d('0x45')]({'where':{'userProfileId':_0x79c9f7[_0xac7d('0x49')]['id'],'sectionId':_[_0xac7d('0x34')](_0x28fef1,function(_0x2eff7e){return _0x2eff7e['sectionId'];})},'attributes':['id',_0xac7d('0x5a')],'raw':!![]})[_0xac7d('0x2b')](function(_0x2891e9){var _0x18704b=_[_0xac7d('0x34')](_0x79c9f7['body'],function(_0x25aba1){_0x25aba1[_0xac7d('0x5b')]=_0x79c9f7[_0xac7d('0x49')]['id'];return _0x25aba1;});return db['UserProfileResource'][_0xac7d('0x6c')](_0x18704b,{'raw':!![],'transaction':_0x34e30b});});}})[_0xac7d('0x47')](handleError(_0x3a548f,null));});}})[_0xac7d('0x2b')](function(_0x4cd453){var _0x323e5d=_[_0xac7d('0x34')](_0x4cd453,function(_0x558fcc){return _0x558fcc['get']({'plain':!![]});});})[_0xac7d('0x2b')](respondWithResult(_0x3a548f,null))[_0xac7d('0x47')](handleError(_0x3a548f,null));};exports[_0xac7d('0x6d')]=function(_0x36a271,_0x29102e,_0x570393){return db[_0xac7d('0x2e')]['find']({'where':{'id':_0x36a271['params']['id']}})[_0xac7d('0x2b')](handleEntityNotFound(_0x29102e,null))[_0xac7d('0x2b')](function(_0x982281){if(_0x982281){return _0x982281[_0xac7d('0x6d')](_0x36a271['query'][_0xac7d('0x62')]);}})['then'](respondWithStatusCode(_0x29102e,null))['catch'](handleError(_0x29102e,null));};exports[_0xac7d('0x6e')]=function(_0x2f84c0,_0x44aec1){var _0x480620={};if(!_0x2f84c0['query'][_0xac7d('0x6f')])throw new Error(_0xac7d('0x70'));if(!_0x2f84c0['query']['hasOwnProperty'](_0xac7d('0x3d'))){_0x480620[_0xac7d('0x24')]=qs['limit'](_0x2f84c0[_0xac7d('0x36')]['limit']);_0x480620['offset']=qs[_0xac7d('0x22')](_0x2f84c0[_0xac7d('0x36')][_0xac7d('0x22')]);}return db[_0xac7d('0x2e')][_0xac7d('0x4c')]({'where':{'id':_0x2f84c0[_0xac7d('0x49')]['id']}})[_0xac7d('0x2b')](function(_0x32dac2){if(!_0x32dac2)throw new Error(_0xac7d('0x71')+_0x2f84c0[_0xac7d('0x49')]['id']);return db['UserProfile'][_0xac7d('0x6e')](_0x2f84c0);})[_0xac7d('0x2b')](respondWithFilteredResult(_0x44aec1,_0x480620))[_0xac7d('0x47')](handleError(_0x44aec1,null));};
\ No newline at end of file
index 0c7d9f6..e574d48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f9d=['hasOwnProperty','hook','exports','events','UserProfile','save','update','remove','emit'];(function(_0x55969b,_0x1ebe62){var _0x3d7fc1=function(_0x5f2dbe){while(--_0x5f2dbe){_0x55969b['push'](_0x55969b['shift']());}};_0x3d7fc1(++_0x1ebe62);}(_0x8f9d,0x93));var _0xd8f9=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x8f9d[_0xfae23b];return _0x200640;};'use strict';var EventEmitter=require(_0xd8f9('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xd8f9('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd8f9('0x2'),'afterUpdate':_0xd8f9('0x3'),'afterDestroy':_0xd8f9('0x4')};function emitEvent(_0x354c26){return function(_0x1f9331,_0x1b82b8,_0x1d6420){UserProfileEvents['emit'](_0x354c26+':'+_0x1f9331['id'],_0x1f9331);UserProfileEvents[_0xd8f9('0x5')](_0x354c26,_0x1f9331);_0x1d6420(null);};}for(var e in events){if(events[_0xd8f9('0x6')](e)){var event=events[e];UserProfile[_0xd8f9('0x7')](e,emitEvent(event));}}module[_0xd8f9('0x8')]=UserProfileEvents;
\ No newline at end of file
+var _0x7eff=['hasOwnProperty','hook','exports','../../mysqldb','UserProfile','setMaxListeners','update','remove','emit'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0x7eff,0x162));var _0xf7ef=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7eff[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xf7ef('0x0'))['db'][_0xf7ef('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xf7ef('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf7ef('0x3'),'afterDestroy':_0xf7ef('0x4')};function emitEvent(_0xc0c7ba){return function(_0x4db614,_0x58a651,_0x4a4573){UserProfileEvents[_0xf7ef('0x5')](_0xc0c7ba+':'+_0x4db614['id'],_0x4db614);UserProfileEvents[_0xf7ef('0x5')](_0xc0c7ba,_0x4db614);_0x4a4573(null);};}for(var e in events){if(events[_0xf7ef('0x6')](e)){var event=events[e];UserProfile[_0xf7ef('0x7')](e,emitEvent(event));}}module[_0xf7ef('0x8')]=UserProfileEvents;
\ No newline at end of file
index d6efbd5..65b61a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x430c=['ignore','union','autoAssociation','keys','filters','intersection','attributes','fields','limit','offset','order','sort','pick','where','merge','key','foreignKey','forEach','include','reportType','default','DefaultReports','custom','count','rows','Tag','Tags','color','tag','ThroughTags','openTabs','chat','sms','dataValues','fax','mail','openchannel','lodash','squel','exports','filter','field','value','findAll','then','associatedResources','map','model','name','catch','resolve','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','SquareProject','childModel','squarerecordings','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','CmCustomField','chatqueues','chatwebsites','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','voicequeues','queuecampaigns','users','telephones','admin','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','user_has_','_interactions','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','length','push','find','params','all'];(function(_0x4b0cbb,_0x295210){var _0x14bc38=function(_0x2d555b){while(--_0x2d555b){_0x4b0cbb['push'](_0x4b0cbb['shift']());}};_0x14bc38(++_0x295210);}(_0x430c,0x1a1));var _0xc430=function(_0x5f08a6,_0x400121){_0x5f08a6=_0x5f08a6-0x0;var _0x5d0641=_0x430c[_0x5f08a6];return _0x5d0641;};'use strict';var _=require(_0xc430('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require(_0xc430('0x1'));module[_0xc430('0x2')]=function(_0x1d5b5e){var _0x503988=_0x1d5b5e['models'];function _0x5ccda6(_0x47d8b9,_0x338a82){return new Promise(function(_0x2408f5,_0x50b256){if(!_0x338a82)return _0x2408f5(null);var _0x42aa9c=_0x338a82['filter']?{[_0x338a82[_0xc430('0x3')][_0xc430('0x4')]]:_0x338a82[_0xc430('0x3')][_0xc430('0x5')]}:undefined;return _0x503988[_0x47d8b9][_0xc430('0x6')]({'where':_0x42aa9c,'raw':!![]})[_0xc430('0x7')](function(_0x861581){_0x338a82[_0xc430('0x8')]=_[_0xc430('0x9')](_0x861581,'id');_0x2408f5(_0x338a82);})['catch'](function(_0x97fa5b){_0x50b256(_0x97fa5b);});});}function _0x2b47d6(_0x56c090,_0x39e624){return new Promise(function(_0x5aeed9,_0x3b84bc){var _0x47e664=_0x56c090[_0xc430('0x3')]?{[_0x56c090[_0xc430('0x3')][_0xc430('0x4')]]:_0x56c090[_0xc430('0x3')][_0xc430('0x5')]}:undefined;return _0x503988[_0x56c090[_0xc430('0xa')]][_0xc430('0x6')]({'where':_0x47e664,'raw':!![]})['then'](function(_0x4e9134){_0x39e624[_0xc430('0x8')]=_[_0xc430('0x9')](_0x4e9134,function(_0x17d5c8){return _0x17d5c8[_0xc430('0xb')];});_0x5aeed9(_0x39e624);})[_0xc430('0xc')](function(_0x55cc6c){_0x3b84bc(_0x55cc6c);});});}function _0x111598(_0x4aeb72,_0x4bf91f,_0x2e7987){if(!_0x4bf91f)return Promise[_0xc430('0xd')](null);return new Promise(function(_0x2327c5,_0x5830b0){return _0x503988['UserProfileResource'][_0xc430('0x6')]({'where':{'sectionId':_0x4bf91f['id']},'raw':!![]})['then'](function(_0x2bcb21){if(_0x4aeb72['field']&&_0x4aeb72['field']!=='id'){_0x4bf91f[_0xc430('0x8')]=_['map'](_0x2bcb21,function(_0x302926){return _0x302926[_0x4aeb72[_0xc430('0x4')]];});}else{if(_0x2e7987===_0xc430('0xe')){_0x4bf91f[_0xc430('0x8')]=_[_0xc430('0x9')](_0x2bcb21,function(_0x5af282){return{'id':_0x5af282[_0xc430('0xf')],'type':_0x5af282['type']};});}else{_0x4bf91f['associatedResources']=_[_0xc430('0x9')](_0x2bcb21,function(_0x2ea352){return _0x2ea352[_0xc430('0xf')];});}}_0x2327c5(_0x4bf91f);})['catch'](function(_0x3fd56b){_0x5830b0(_0x3fd56b);});});}function _0x57d26e(_0x23425d,_0x22ebfb){var _0x4efecd={'parentSections':[]};switch(_0x23425d[_0xc430('0x10')]()){case _0xc430('0x11'):_0x4efecd['childModel']=_0xc430('0x12');break;case'odbc':_0x4efecd[_0xc430('0x13')]='SquareOdbc';break;case _0xc430('0x14'):_0x4efecd[_0xc430('0x13')]='SquareRecording';_0x4efecd[_0xc430('0x15')]=[{'name':_0xc430('0x16'),'field':_0xc430('0xb'),'foreignKey':_0xc430('0x17')}];break;case _0xc430('0x18'):_0x4efecd['childModel']=_0xc430('0x19');break;case _0xc430('0x1a'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x1b');_0x4efecd['parentSections']=[{'name':_0xc430('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0xc430('0x1d'):_0x4efecd['childModel']=_0xc430('0x1e');break;case _0xc430('0x1f'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x20');break;case'globalcustomfields':_0x4efecd[_0xc430('0x13')]=_0xc430('0x21');break;case _0xc430('0x22'):_0x4efecd[_0xc430('0x13')]='ChatQueue';break;case _0xc430('0x23'):_0x4efecd[_0xc430('0x13')]='ChatWebsite';break;case _0xc430('0x24'):_0x4efecd['childModel']='FaxQueue';break;case _0xc430('0x25'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x26');break;case _0xc430('0x27'):case _0xc430('0x28'):case _0xc430('0x29'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x2a');break;case'contexts':_0x4efecd[_0xc430('0x13')]='VoiceContext';break;case _0xc430('0x2b'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x2c');break;case _0xc430('0x2d'):_0x4efecd['childModel']=_0xc430('0x2e');_0x4efecd['parentSections']=[{'name':'Agents','field':_0xc430('0xb'),'foreignKey':_0xc430('0x2f'),'model':'User','filter':{'field':_0xc430('0x30'),'value':[_0xc430('0x31')]}},{'name':_0xc430('0x32'),'field':_0xc430('0xb'),'foreignKey':_0xc430('0x2f'),'model':_0xc430('0x33'),'filter':{'field':_0xc430('0x30'),'value':[_0xc430('0x34')]}},{'name':_0xc430('0x35'),'field':_0xc430('0xb'),'foreignKey':_0xc430('0x36'),'model':_0xc430('0x37'),'filter':{'field':_0xc430('0x38'),'value':[_0xc430('0x39')]}},{'name':_0xc430('0x3a'),'field':'name','foreignKey':_0xc430('0x36'),'model':_0xc430('0x37'),'filter':{'field':_0xc430('0x38'),'value':[_0xc430('0x3b')]}}];break;case'musiconholds':_0x4efecd[_0xc430('0x13')]=_0xc430('0x3c');break;case _0xc430('0x3d'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x3e');break;case _0xc430('0x3f'):_0x4efecd['childModel']=_0xc430('0x40');break;case _0xc430('0x41'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x42');break;case _0xc430('0x43'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x44');break;case _0xc430('0x45'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x46');break;case _0xc430('0x47'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x48');break;case _0xc430('0x49'):_0x4efecd['childModel']='OpenchannelQueue';break;case'openchannelaccounts':_0x4efecd[_0xc430('0x13')]=_0xc430('0x4a');break;case _0xc430('0x4b'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x4c');break;case _0xc430('0x4d'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x4e');break;case _0xc430('0x4f'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x50');break;case _0xc430('0x51'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x52');break;case _0xc430('0x53'):_0x4efecd[_0xc430('0x13')]='Team';break;case _0xc430('0x54'):case _0xc430('0x55'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x37');if(_0x22ebfb){_0x4efecd[_0xc430('0x15')]=[{'name':_0xc430('0x35')},{'name':_0xc430('0x3a')}];}break;case _0xc430('0x56'):case'agents':case _0xc430('0x57'):_0x4efecd['childModel']=_0xc430('0x33');if(_0x22ebfb){_0x4efecd[_0xc430('0x15')]=[{'name':'Users','filter':{'field':'role','value':[_0xc430('0x58'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0xc430('0x32')}];}break;case'zendeskaccounts':_0x4efecd[_0xc430('0x13')]=_0xc430('0x59');break;case _0xc430('0x5a'):_0x4efecd['childModel']=_0xc430('0x5b');break;case _0xc430('0x5c'):_0x4efecd[_0xc430('0x13')]='FreshdeskAccount';break;case _0xc430('0x5d'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x5e');break;case _0xc430('0x5f'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x60');break;case _0xc430('0x61'):_0x4efecd['childModel']=_0xc430('0x62');break;case _0xc430('0x63'):_0x4efecd[_0xc430('0x13')]='User';break;case _0xc430('0x64'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x65');break;case _0xc430('0x66'):_0x4efecd['childModel']=_0xc430('0x67');break;case'customdashboards':_0x4efecd[_0xc430('0x13')]=_0xc430('0x68');break;case _0xc430('0x69'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x6a');break;case _0xc430('0x6b'):_0x4efecd['childModel']=_0xc430('0x6c');break;case _0xc430('0x6d'):_0x4efecd['childModel']=_0xc430('0x6e');break;case _0xc430('0x6f'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x70');break;case'tags':_0x4efecd[_0xc430('0x13')]='Tag';break;case _0xc430('0x71'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x72');break;case _0xc430('0x73'):_0x4efecd['childModel']=_0xc430('0x74');break;case _0xc430('0x75'):_0x4efecd['childModel']='Trunk';break;case _0xc430('0x76'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x77');break;case _0xc430('0x78'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x79');break;case _0xc430('0x7a'):_0x4efecd['childModel']=_0xc430('0xe');_0x4efecd['parentSections']=[{'name':_0xc430('0x7b'),'field':'id','foreignKey':_0xc430('0x7c')}];break;case _0xc430('0x7d'):_0x4efecd[_0xc430('0x13')]=_0xc430('0x7e');break;}return _0x4efecd;}function _0x12b6f2(_0x540653,_0x1b2214){var _0x325387=_0x540653[_0xc430('0x7f')](0x0)[_0xc430('0x80')]()+_0x540653[_0xc430('0x81')](0x1);var _0xb4d28f={'type':_0x503988[_0xc430('0x82')]['QueryTypes'][_0xc430('0x83')],'raw':!![]};return new Promise(function(_0x52b5b4,_0x2a4ad3){var _0x4cc37b=squel[_0xc430('0x84')]()[_0xc430('0x4')](_0xc430('0x85')+_0x325387+_0xc430('0x86'),'id')[_0xc430('0x4')](_0xc430('0x87'))['from'](_0xc430('0x88')+_0x540653+_0xc430('0x89'),'ui')['where']('ui.UserId\x20=\x20?',_0x1b2214['id']);return _0x503988[_0xc430('0x8a')][_0xc430('0x8b')](_0x4cc37b[_0xc430('0x8c')](),_0xb4d28f)[_0xc430('0x7')](function(_0x3ca9ac){_0x1b2214[_0x325387+_0xc430('0x8d')]=_0x3ca9ac;_0x52b5b4(_0x3ca9ac);})[_0xc430('0xc')](function(_0x28fa9f){_0x2a4ad3(_0x28fa9f);});});}return _0x1d5b5e[_0xc430('0x8e')](_0xc430('0x8f'),attributes,{'tableName':_0xc430('0x90'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x28199b){var _0x56cc9c={'raw':![],'where':{}};var _0x52e622={};var _0x4547e7={'count':0x0,'rows':[]};var _0x56c6a8=_0x28199b[_0xc430('0x8b')][_0xc430('0x91')];var _0x541286=_0x28199b[_0xc430('0x8b')]['mergeResources']||![];var _0x4f4c0b=_0x57d26e(_0x56c6a8,_0x541286);if(!_0x4f4c0b[_0xc430('0x13')])throw new Error(_0xc430('0x92')+_0x56c6a8+'\x27');var _0x52f398=[{'name':_0x56c6a8}];if(!_[_0xc430('0x93')](_0x4f4c0b['parentSections']))_0x52f398=_0x4f4c0b['parentSections'];var _0x173792=[];for(var _0x3ab0ac=0x0;_0x3ab0ac<_0x52f398[_0xc430('0x94')];_0x3ab0ac++){_0x173792[_0xc430('0x95')](_0x503988['UserProfileSection'][_0xc430('0x96')]({'where':{'userProfileId':_0x28199b[_0xc430('0x97')]['id'],'name':_0x52f398[_0x3ab0ac][_0xc430('0xb')]},'raw':!![]}));}return Promise[_0xc430('0x98')](_0x173792)['then'](function(_0x31f2e8){var _0x170e3c=_[_0xc430('0x3')](_0x31f2e8,function(_0x304d1a){return _0x304d1a?_0x304d1a:undefined;});var _0x242160=_[_0xc430('0x3')](_0x52f398,[_0xc430('0x99'),!![]]);var _0x186925=_[_0xc430('0x93')](_0x170e3c)&&_[_0xc430('0x93')](_0x242160)?null:_[_0xc430('0x9a')](_0x242160,_0x170e3c);if(!_0x186925)return null;var _0x572a95=[];for(var _0x4f390c=0x0;_0x4f390c<_0x186925['length'];_0x4f390c++){var _0x4000c0=_[_0xc430('0x96')](_0x52f398,function(_0xdde142){return _0x186925[_0x4f390c]?_0xdde142['name']===_0x186925[_0x4f390c]['name']:null;});if(_0x4000c0){if(_0x186925[_0x4f390c][_0xc430('0x99')]){_0x572a95[_0xc430('0x95')](_0x5ccda6(_0x4f4c0b[_0xc430('0x13')],_0x186925[_0x4f390c]));}else{if(!_0x186925[_0x4f390c][_0xc430('0x9b')]){_0x572a95[_0xc430('0x95')](_0x111598(_0x4000c0,_0x186925[_0x4f390c],_0x4f4c0b[_0xc430('0x13')]));}else{if(_0x4000c0[_0xc430('0xa')]){_0x572a95[_0xc430('0x95')](_0x2b47d6(_0x4000c0,_0x186925[_0x4f390c]));}}}}}return Promise[_0xc430('0x98')](_0x572a95);})[_0xc430('0x7')](function(_0x5ca0f2){var _0x6debfb=_0x5ca0f2;var _0x43ad3d=null;if(_0x6debfb){_0x43ad3d=_0x6debfb[_0xc430('0x94')]===0x1?_0x6debfb[0x0]:null;}if(!_0x43ad3d&&!_0x6debfb)return _0x4547e7;var _0x4e21bc=_0x503988[_0x4f4c0b['childModel']]['rawAttributes'];_0x52e622[_0xc430('0xa')]=_[_0xc430('0x9c')](_0x4e21bc);_0x52e622[_0xc430('0x8b')]=_[_0xc430('0x9c')](_0x28199b['query']);_0x52e622[_0xc430('0x9d')]=_[_0xc430('0x9e')](_0x52e622[_0xc430('0xa')],_0x52e622['query']);_0x56cc9c[_0xc430('0x9f')]=_['intersection'](_0x52e622[_0xc430('0xa')],qs[_0xc430('0xa0')](_0x28199b[_0xc430('0x8b')][_0xc430('0xa0')]));_0x56cc9c[_0xc430('0x9f')]=_0x56cc9c['attributes'][_0xc430('0x94')]?_0x56cc9c[_0xc430('0x9f')]:_0x52e622[_0xc430('0xa')];if(!_0x28199b[_0xc430('0x8b')]['hasOwnProperty']('nolimit')){_0x56cc9c[_0xc430('0xa1')]=qs['limit'](_0x28199b['query'][_0xc430('0xa1')]);_0x56cc9c[_0xc430('0xa2')]=qs['offset'](_0x28199b[_0xc430('0x8b')][_0xc430('0xa2')]);}_0x56cc9c[_0xc430('0xa3')]=qs[_0xc430('0xa4')](_0x28199b[_0xc430('0x8b')][_0xc430('0xa4')]);_0x56cc9c['where']=qs[_0xc430('0x9d')](_[_0xc430('0xa5')](_0x28199b[_0xc430('0x8b')],_0x52e622[_0xc430('0x9d')]));if(_0x28199b['query'][_0xc430('0x3')]){_0x56cc9c[_0xc430('0xa6')]=_[_0xc430('0xa7')](_0x56cc9c['where'],{'$or':_[_0xc430('0x9')](_0x4e21bc,function(_0x5c31f1){if(_0x5c31f1['type'][_0xc430('0xa8')]!=='VIRTUAL'){var _0x2f2032={};_0x2f2032[_0x5c31f1['field']]={'$like':'%'+_0x28199b[_0xc430('0x8b')][_0xc430('0x3')]+'%'};return _0x2f2032;}})});}var _0x4feb16=[];var _0x3433ca=null;var _0x12a26b={};if(_0x43ad3d){_0x3433ca=_['find'](_0x52f398,[_0xc430('0xb'),_0x43ad3d[_0xc430('0xb')]]);if(_0x3433ca['field']){_0x12a26b={};if(_0x4f4c0b[_0xc430('0x13')]===_0xc430('0xe')){_0x12a26b[_0x3433ca['foreignKey']]=_[_0xc430('0x9')](_0x43ad3d[_0xc430('0x8')],'id');}else{_0x12a26b[_0x3433ca[_0xc430('0xa9')]]=_0x43ad3d[_0xc430('0x8')];}_0x4feb16[_0xc430('0x95')](_0x12a26b);}else{_0x56cc9c[_0xc430('0xa6')]['id']=_0x43ad3d[_0xc430('0x8')];}}else{for(var _0x1aa5f7=0x0;_0x1aa5f7<_0x6debfb[_0xc430('0x94')];_0x1aa5f7++){_0x3433ca=_[_0xc430('0x96')](_0x52f398,[_0xc430('0xb'),_0x6debfb[_0x1aa5f7]['name']]);if(_0x3433ca[_0xc430('0x4')]){_0x12a26b={};_0x12a26b[_0x3433ca[_0xc430('0xa9')]]=_0x6debfb[_0x1aa5f7][_0xc430('0x8')];_0x4feb16['push'](_0x12a26b);}else{if(!_0x56cc9c['where']['id'])_0x56cc9c[_0xc430('0xa6')]['id']=[];_0x6debfb[_0x1aa5f7]['associatedResources'][_0xc430('0xaa')](function(_0x2801c6){_0x56cc9c['where']['id']['push'](_0x2801c6);});}}}if(!_[_0xc430('0x93')](_0x4feb16)){_0x56cc9c[_0xc430('0xa6')]=_[_0xc430('0xa7')](_0x56cc9c['where'],{'$and':{'$or':_0x4feb16}});}_0x56cc9c=_[_0xc430('0xa7')]({},_0x56cc9c,_0x28199b['options']);if(_0x43ad3d&&!_0x43ad3d['autoAssociation']&&_0x4f4c0b[_0xc430('0x13')]===_0xc430('0xe')){if(_0x28199b[_0xc430('0x8b')]['includeAll']){_0x56cc9c[_0xc430('0xab')]=[{'all':!![]}];}return _0x503988[_0x4f4c0b[_0xc430('0x13')]][_0xc430('0x6')](_0x56cc9c)[_0xc430('0x7')](function(_0x4054b8){var _0x4d9ba8=[];_0x4054b8['forEach'](function(_0x1d0236){var _0x251b15;switch(_0x1d0236[_0xc430('0xac')]){case _0xc430('0xad'):_0x251b15=_[_0xc430('0x96')](_0x43ad3d[_0xc430('0x8')],function(_0x3b2804){return _0x3b2804['id']===_0x1d0236[_0xc430('0x7c')]&&_0x3b2804[_0xc430('0x38')]===_0xc430('0xae');});break;case _0xc430('0xaf'):_0x251b15=_['find'](_0x43ad3d[_0xc430('0x8')],function(_0x96deb0){return _0x96deb0['id']===_0x1d0236[_0xc430('0x7c')]&&_0x96deb0[_0xc430('0x38')]==='CustomReports';});break;}if(_0x251b15)_0x4d9ba8['push'](_0x1d0236);});_0x4547e7[_0xc430('0xb0')]=_0x4d9ba8['length'];_0x4547e7[_0xc430('0xb1')]=_0x4d9ba8;return _0x4547e7;});}else{return _0x503988[_0x4f4c0b[_0xc430('0x13')]][_0xc430('0xb0')]({'where':_0x56cc9c[_0xc430('0xa6')]})[_0xc430('0x7')](function(_0x59c102){_0x4547e7['count']=_0x59c102;if(_0x28199b['query']['includeAll']){if(_0x4f4c0b[_0xc430('0x13')]==='CmContact'){_0x56cc9c['include']=[{'model':_0x503988[_0xc430('0xb2')],'as':_0xc430('0xb3'),'attributes':['id',_0xc430('0xb'),_0xc430('0xb4')],'required':_0x28199b[_0xc430('0x8b')][_0xc430('0xb5')]?!![]:![]},{'model':_0x503988[_0xc430('0xb2')],'as':_0xc430('0xb6'),'attributes':['id',_0xc430('0xb'),_0xc430('0xb4')],'through':_0x28199b[_0xc430('0x8b')][_0xc430('0xb5')]?{'attributes':[],'where':{'TagId':_0x28199b[_0xc430('0x8b')]['tag']||undefined}}:{},'required':_0x28199b[_0xc430('0x8b')][_0xc430('0xb5')]?!![]:![]}];}else{_0x56cc9c[_0xc430('0xab')]=[{'all':!![]}];}}return _0x503988[_0x4f4c0b[_0xc430('0x13')]][_0xc430('0x6')](_0x56cc9c);})[_0xc430('0x7')](function(_0x369446){_0x4547e7[_0xc430('0xb1')]=_0x369446;if(_0x56c6a8==='Agents'&&_0x28199b[_0xc430('0x8b')][_0xc430('0xb7')]==='true'){var _0x3bd6e1=[];for(var _0x1a17ae=0x0;_0x1a17ae<_0x4547e7[_0xc430('0xb1')][_0xc430('0x94')];_0x1a17ae++){_0x3bd6e1['push'](_0x12b6f2(_0xc430('0xb8'),_0x4547e7['rows'][_0x1a17ae]['dataValues']));_0x3bd6e1[_0xc430('0x95')](_0x12b6f2(_0xc430('0xb9'),_0x4547e7[_0xc430('0xb1')][_0x1a17ae][_0xc430('0xba')]));_0x3bd6e1[_0xc430('0x95')](_0x12b6f2(_0xc430('0xbb'),_0x4547e7['rows'][_0x1a17ae][_0xc430('0xba')]));_0x3bd6e1[_0xc430('0x95')](_0x12b6f2(_0xc430('0xbc'),_0x4547e7[_0xc430('0xb1')][_0x1a17ae][_0xc430('0xba')]));_0x3bd6e1[_0xc430('0x95')](_0x12b6f2(_0xc430('0xbd'),_0x4547e7[_0xc430('0xb1')][_0x1a17ae][_0xc430('0xba')]));_0x3bd6e1[_0xc430('0x95')](_0x12b6f2('whatsapp',_0x4547e7[_0xc430('0xb1')][_0x1a17ae][_0xc430('0xba')]));}return Promise['all'](_0x3bd6e1)['then'](function(){return _0x4547e7;});}return _0x4547e7;});}});}}});};
\ No newline at end of file
+var _0x4888=['offset','order','sort','pick','merge','VIRTUAL','foreignKey','forEach','options','autoAssociation','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','rows','Tag','Tags','tag','ThroughTags','color','openTabs','dataValues','fax','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','findAll','then','associatedResources','map','catch','field','model','name','resolve','UserProfileResource','resourceId','type','odbc','squarerecordings','childModel','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','VoiceContext','voicerecordings','VoiceRecording','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','Dashboard','intervals','pauses','Pause','Schedule','sounds','tags','templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','extractedreports','AnalyticExtractedReport','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','section','mergeResources','isEmpty','length','push','find','params','all','ignore','union','rawAttributes','filters','intersection','attributes','fields','hasOwnProperty','limit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4888,0x198));var _0x8488=function(_0x393db8,_0x3e1157){_0x393db8=_0x393db8-0x0;var _0x4295cc=_0x4888[_0x393db8];return _0x4295cc;};'use strict';var _=require('lodash');var attributes=require(_0x8488('0x0'));var qs=require(_0x8488('0x1'));var squel=require(_0x8488('0x2'));module[_0x8488('0x3')]=function(_0x257275){var _0xacc8f0=_0x257275[_0x8488('0x4')];function _0x571e4b(_0x267093,_0xf45c3f){return new Promise(function(_0x1a97f4,_0x421292){if(!_0xf45c3f)return _0x1a97f4(null);var _0x326887=_0xf45c3f[_0x8488('0x5')]?{[_0xf45c3f['filter']['field']]:_0xf45c3f['filter']['value']}:undefined;return _0xacc8f0[_0x267093][_0x8488('0x6')]({'where':_0x326887,'raw':!![]})[_0x8488('0x7')](function(_0x542bd8){_0xf45c3f[_0x8488('0x8')]=_[_0x8488('0x9')](_0x542bd8,'id');_0x1a97f4(_0xf45c3f);})[_0x8488('0xa')](function(_0x19a2ee){_0x421292(_0x19a2ee);});});}function _0x515ea8(_0x377d3b,_0x1909c9){return new Promise(function(_0x468896,_0x256bab){var _0x47146a=_0x377d3b['filter']?{[_0x377d3b[_0x8488('0x5')][_0x8488('0xb')]]:_0x377d3b['filter']['value']}:undefined;return _0xacc8f0[_0x377d3b[_0x8488('0xc')]]['findAll']({'where':_0x47146a,'raw':!![]})[_0x8488('0x7')](function(_0x4e94fc){_0x1909c9['associatedResources']=_[_0x8488('0x9')](_0x4e94fc,function(_0x3635da){return _0x3635da[_0x8488('0xd')];});_0x468896(_0x1909c9);})[_0x8488('0xa')](function(_0x3b3cfa){_0x256bab(_0x3b3cfa);});});}function _0x8d3b3d(_0x165139,_0x4e44af,_0x3dad45){if(!_0x4e44af)return Promise[_0x8488('0xe')](null);return new Promise(function(_0x3edfe4,_0x37361d){return _0xacc8f0[_0x8488('0xf')][_0x8488('0x6')]({'where':{'sectionId':_0x4e44af['id']},'raw':!![]})[_0x8488('0x7')](function(_0x27c62a){if(_0x165139[_0x8488('0xb')]&&_0x165139[_0x8488('0xb')]!=='id'){_0x4e44af[_0x8488('0x8')]=_[_0x8488('0x9')](_0x27c62a,function(_0x3dd93e){return _0x3dd93e[_0x165139['field']];});}else{if(_0x3dad45==='AnalyticExtractedReport'){_0x4e44af[_0x8488('0x8')]=_[_0x8488('0x9')](_0x27c62a,function(_0xbb10fe){return{'id':_0xbb10fe[_0x8488('0x10')],'type':_0xbb10fe[_0x8488('0x11')]};});}else{_0x4e44af[_0x8488('0x8')]=_[_0x8488('0x9')](_0x27c62a,function(_0x3c078c){return _0x3c078c[_0x8488('0x10')];});}}_0x3edfe4(_0x4e44af);})['catch'](function(_0x476a14){_0x37361d(_0x476a14);});});}function _0x4e07e1(_0x140b0b,_0x1361a6){var _0x290b33={'parentSections':[]};switch(_0x140b0b['toLowerCase']()){case'squareprojects':_0x290b33['childModel']='SquareProject';break;case _0x8488('0x12'):_0x290b33['childModel']='SquareOdbc';break;case _0x8488('0x13'):_0x290b33[_0x8488('0x14')]=_0x8488('0x15');_0x290b33[_0x8488('0x16')]=[{'name':_0x8488('0x17'),'field':'name','foreignKey':_0x8488('0x18')}];break;case _0x8488('0x19'):_0x290b33[_0x8488('0x14')]=_0x8488('0x1a');break;case _0x8488('0x1b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x1c');_0x290b33[_0x8488('0x16')]=[{'name':_0x8488('0x1d'),'field':'id','foreignKey':_0x8488('0x1e')}];break;case _0x8488('0x1f'):_0x290b33['childModel']='CmList';break;case'companies':_0x290b33[_0x8488('0x14')]=_0x8488('0x20');break;case _0x8488('0x21'):_0x290b33[_0x8488('0x14')]=_0x8488('0x22');break;case _0x8488('0x23'):_0x290b33['childModel']=_0x8488('0x24');break;case _0x8488('0x25'):_0x290b33[_0x8488('0x14')]=_0x8488('0x26');break;case _0x8488('0x27'):_0x290b33['childModel']=_0x8488('0x28');break;case _0x8488('0x29'):_0x290b33['childModel']=_0x8488('0x2a');break;case _0x8488('0x2b'):case _0x8488('0x2c'):case _0x8488('0x2d'):_0x290b33[_0x8488('0x14')]='VoiceExtension';break;case _0x8488('0x2e'):_0x290b33[_0x8488('0x14')]=_0x8488('0x2f');break;case'voicemails':_0x290b33[_0x8488('0x14')]='VoiceMail';break;case _0x8488('0x30'):_0x290b33[_0x8488('0x14')]=_0x8488('0x31');_0x290b33[_0x8488('0x16')]=[{'name':'Agents','field':_0x8488('0xd'),'foreignKey':_0x8488('0x32'),'model':_0x8488('0x33'),'filter':{'field':'role','value':[_0x8488('0x34')]}},{'name':_0x8488('0x35'),'field':_0x8488('0xd'),'foreignKey':_0x8488('0x32'),'model':_0x8488('0x33'),'filter':{'field':_0x8488('0x36'),'value':[_0x8488('0x37')]}},{'name':_0x8488('0x38'),'field':_0x8488('0xd'),'foreignKey':_0x8488('0x39'),'model':_0x8488('0x3a'),'filter':{'field':'type','value':['inbound']}},{'name':_0x8488('0x3b'),'field':_0x8488('0xd'),'foreignKey':_0x8488('0x39'),'model':_0x8488('0x3a'),'filter':{'field':_0x8488('0x11'),'value':[_0x8488('0x3c')]}}];break;case _0x8488('0x3d'):_0x290b33[_0x8488('0x14')]=_0x8488('0x3e');break;case'chanspies':_0x290b33[_0x8488('0x14')]=_0x8488('0x3f');break;case _0x8488('0x40'):_0x290b33['childModel']=_0x8488('0x41');break;case _0x8488('0x42'):_0x290b33[_0x8488('0x14')]=_0x8488('0x43');break;case _0x8488('0x44'):_0x290b33[_0x8488('0x14')]=_0x8488('0x45');break;case'mailaccounts':_0x290b33[_0x8488('0x14')]=_0x8488('0x46');break;case _0x8488('0x47'):_0x290b33['childModel']=_0x8488('0x48');break;case'openchannelqueues':_0x290b33[_0x8488('0x14')]=_0x8488('0x49');break;case'openchannelaccounts':_0x290b33[_0x8488('0x14')]=_0x8488('0x4a');break;case _0x8488('0x4b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x4c');break;case'smsaccounts':_0x290b33[_0x8488('0x14')]='SmsAccount';break;case _0x8488('0x4d'):_0x290b33[_0x8488('0x14')]=_0x8488('0x4e');break;case _0x8488('0x4f'):_0x290b33[_0x8488('0x14')]=_0x8488('0x50');break;case _0x8488('0x51'):_0x290b33[_0x8488('0x14')]=_0x8488('0x52');break;case _0x8488('0x53'):case _0x8488('0x54'):_0x290b33[_0x8488('0x14')]=_0x8488('0x3a');if(_0x1361a6){_0x290b33[_0x8488('0x16')]=[{'name':_0x8488('0x38')},{'name':_0x8488('0x3b')}];}break;case _0x8488('0x55'):case'agents':case _0x8488('0x56'):_0x290b33[_0x8488('0x14')]=_0x8488('0x33');if(_0x1361a6){_0x290b33[_0x8488('0x16')]=[{'name':'Users','filter':{'field':_0x8488('0x36'),'value':[_0x8488('0x57'),_0x8488('0x58')]},'ignore':!![]},{'name':_0x8488('0x59')},{'name':'Telephones'}];}break;case _0x8488('0x5a'):_0x290b33[_0x8488('0x14')]=_0x8488('0x5b');break;case _0x8488('0x5c'):_0x290b33[_0x8488('0x14')]=_0x8488('0x5d');break;case _0x8488('0x5e'):_0x290b33[_0x8488('0x14')]=_0x8488('0x5f');break;case _0x8488('0x60'):_0x290b33[_0x8488('0x14')]=_0x8488('0x61');break;case _0x8488('0x62'):_0x290b33['childModel']='DeskAccount';break;case _0x8488('0x63'):_0x290b33[_0x8488('0x14')]=_0x8488('0x64');break;case _0x8488('0x65'):_0x290b33[_0x8488('0x14')]=_0x8488('0x33');break;case _0x8488('0x66'):_0x290b33[_0x8488('0x14')]=_0x8488('0x67');break;case'dispositions':_0x290b33[_0x8488('0x14')]=_0x8488('0x68');break;case'customdashboards':_0x290b33[_0x8488('0x14')]=_0x8488('0x69');break;case _0x8488('0x6a'):_0x290b33[_0x8488('0x14')]='Interval';break;case _0x8488('0x6b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x6c');break;case'scheduler':_0x290b33[_0x8488('0x14')]=_0x8488('0x6d');break;case _0x8488('0x6e'):_0x290b33[_0x8488('0x14')]='Sound';break;case _0x8488('0x6f'):_0x290b33['childModel']='Tag';break;case _0x8488('0x70'):_0x290b33['childModel']=_0x8488('0x71');break;case _0x8488('0x72'):_0x290b33[_0x8488('0x14')]=_0x8488('0x73');break;case _0x8488('0x74'):_0x290b33[_0x8488('0x14')]='Trunk';break;case _0x8488('0x75'):_0x290b33[_0x8488('0x14')]=_0x8488('0x76');break;case _0x8488('0x77'):_0x290b33[_0x8488('0x14')]='Plugin';break;case _0x8488('0x78'):_0x290b33['childModel']=_0x8488('0x79');_0x290b33[_0x8488('0x16')]=[{'name':'Reports','field':'id','foreignKey':_0x8488('0x7a')}];break;case _0x8488('0x7b'):_0x290b33[_0x8488('0x14')]=_0x8488('0x7c');break;}return _0x290b33;}function _0x4041e5(_0x168740,_0x59d0d4){var _0xb3574c=_0x168740['charAt'](0x0)[_0x8488('0x7d')]()+_0x168740[_0x8488('0x7e')](0x1);var _0x3c06a4={'type':_0xacc8f0[_0x8488('0x7f')][_0x8488('0x80')][_0x8488('0x81')],'raw':!![]};return new Promise(function(_0x5a4426,_0x43ec52){var _0x4dba5a=squel[_0x8488('0x82')]()[_0x8488('0xb')](_0x8488('0x83')+_0xb3574c+_0x8488('0x84'),'id')[_0x8488('0xb')](_0x8488('0x85'))['from']('user_has_'+_0x168740+'_interactions','ui')[_0x8488('0x86')](_0x8488('0x87'),_0x59d0d4['id']);return _0xacc8f0[_0x8488('0x88')][_0x8488('0x89')](_0x4dba5a[_0x8488('0x8a')](),_0x3c06a4)[_0x8488('0x7')](function(_0x2377db){_0x59d0d4[_0xb3574c+_0x8488('0x8b')]=_0x2377db;_0x5a4426(_0x2377db);})[_0x8488('0xa')](function(_0xa90a65){_0x43ec52(_0xa90a65);});});}return _0x257275['define'](_0x8488('0x8c'),attributes,{'tableName':_0x8488('0x8d'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3b6bfe){var _0x4ba14e={'raw':![],'where':{}};var _0x4ae192={};var _0x164d30={'count':0x0,'rows':[]};var _0x379a4d=_0x3b6bfe[_0x8488('0x89')][_0x8488('0x8e')];var _0x52bc90=_0x3b6bfe['query'][_0x8488('0x8f')]||![];var _0x26e0cc=_0x4e07e1(_0x379a4d,_0x52bc90);if(!_0x26e0cc[_0x8488('0x14')])throw new Error('Invalid\x20section\x20\x27'+_0x379a4d+'\x27');var _0x3c3e89=[{'name':_0x379a4d}];if(!_[_0x8488('0x90')](_0x26e0cc[_0x8488('0x16')]))_0x3c3e89=_0x26e0cc[_0x8488('0x16')];var _0x332a9c=[];for(var _0x5e41e5=0x0;_0x5e41e5<_0x3c3e89[_0x8488('0x91')];_0x5e41e5++){_0x332a9c[_0x8488('0x92')](_0xacc8f0['UserProfileSection'][_0x8488('0x93')]({'where':{'userProfileId':_0x3b6bfe[_0x8488('0x94')]['id'],'name':_0x3c3e89[_0x5e41e5]['name']},'raw':!![]}));}return Promise[_0x8488('0x95')](_0x332a9c)[_0x8488('0x7')](function(_0x212c3b){var _0x1d8c83=_[_0x8488('0x5')](_0x212c3b,function(_0x105f23){return _0x105f23?_0x105f23:undefined;});var _0x163cd9=_['filter'](_0x3c3e89,[_0x8488('0x96'),!![]]);var _0x3b7aa8=_['isEmpty'](_0x1d8c83)&&_['isEmpty'](_0x163cd9)?null:_[_0x8488('0x97')](_0x163cd9,_0x1d8c83);if(!_0x3b7aa8)return null;var _0x370a9c=[];for(var _0x3ff6c0=0x0;_0x3ff6c0<_0x3b7aa8['length'];_0x3ff6c0++){var _0xb85159=_[_0x8488('0x93')](_0x3c3e89,function(_0x56b35a){return _0x3b7aa8[_0x3ff6c0]?_0x56b35a[_0x8488('0xd')]===_0x3b7aa8[_0x3ff6c0]['name']:null;});if(_0xb85159){if(_0x3b7aa8[_0x3ff6c0][_0x8488('0x96')]){_0x370a9c[_0x8488('0x92')](_0x571e4b(_0x26e0cc[_0x8488('0x14')],_0x3b7aa8[_0x3ff6c0]));}else{if(!_0x3b7aa8[_0x3ff6c0]['autoAssociation']){_0x370a9c[_0x8488('0x92')](_0x8d3b3d(_0xb85159,_0x3b7aa8[_0x3ff6c0],_0x26e0cc[_0x8488('0x14')]));}else{if(_0xb85159['model']){_0x370a9c['push'](_0x515ea8(_0xb85159,_0x3b7aa8[_0x3ff6c0]));}}}}}return Promise[_0x8488('0x95')](_0x370a9c);})[_0x8488('0x7')](function(_0xfedfd2){var _0x3ab1b6=_0xfedfd2;var _0xe1fe21=null;if(_0x3ab1b6){_0xe1fe21=_0x3ab1b6[_0x8488('0x91')]===0x1?_0x3ab1b6[0x0]:null;}if(!_0xe1fe21&&!_0x3ab1b6)return _0x164d30;var _0x20d7c3=_0xacc8f0[_0x26e0cc[_0x8488('0x14')]][_0x8488('0x98')];_0x4ae192[_0x8488('0xc')]=_['keys'](_0x20d7c3);_0x4ae192[_0x8488('0x89')]=_['keys'](_0x3b6bfe[_0x8488('0x89')]);_0x4ae192[_0x8488('0x99')]=_[_0x8488('0x9a')](_0x4ae192[_0x8488('0xc')],_0x4ae192['query']);_0x4ba14e[_0x8488('0x9b')]=_[_0x8488('0x9a')](_0x4ae192['model'],qs[_0x8488('0x9c')](_0x3b6bfe['query'][_0x8488('0x9c')]));_0x4ba14e[_0x8488('0x9b')]=_0x4ba14e[_0x8488('0x9b')][_0x8488('0x91')]?_0x4ba14e[_0x8488('0x9b')]:_0x4ae192[_0x8488('0xc')];if(!_0x3b6bfe[_0x8488('0x89')][_0x8488('0x9d')]('nolimit')){_0x4ba14e[_0x8488('0x9e')]=qs['limit'](_0x3b6bfe['query'][_0x8488('0x9e')]);_0x4ba14e[_0x8488('0x9f')]=qs[_0x8488('0x9f')](_0x3b6bfe['query']['offset']);}_0x4ba14e[_0x8488('0xa0')]=qs[_0x8488('0xa1')](_0x3b6bfe['query'][_0x8488('0xa1')]);_0x4ba14e[_0x8488('0x86')]=qs[_0x8488('0x99')](_[_0x8488('0xa2')](_0x3b6bfe[_0x8488('0x89')],_0x4ae192[_0x8488('0x99')]));if(_0x3b6bfe['query'][_0x8488('0x5')]){_0x4ba14e[_0x8488('0x86')]=_[_0x8488('0xa3')](_0x4ba14e['where'],{'$or':_[_0x8488('0x9')](_0x20d7c3,function(_0x2b5ea4){if(_0x2b5ea4[_0x8488('0x11')]['key']!==_0x8488('0xa4')){var _0xaf7f76={};_0xaf7f76[_0x2b5ea4['field']]={'$like':'%'+_0x3b6bfe['query'][_0x8488('0x5')]+'%'};return _0xaf7f76;}})});}var _0x18c724=[];var _0x511143=null;var _0x353514={};if(_0xe1fe21){_0x511143=_[_0x8488('0x93')](_0x3c3e89,['name',_0xe1fe21['name']]);if(_0x511143[_0x8488('0xb')]){_0x353514={};if(_0x26e0cc['childModel']===_0x8488('0x79')){_0x353514[_0x511143[_0x8488('0xa5')]]=_[_0x8488('0x9')](_0xe1fe21[_0x8488('0x8')],'id');}else{_0x353514[_0x511143['foreignKey']]=_0xe1fe21[_0x8488('0x8')];}_0x18c724['push'](_0x353514);}else{_0x4ba14e[_0x8488('0x86')]['id']=_0xe1fe21['associatedResources'];}}else{for(var _0x2f137a=0x0;_0x2f137a<_0x3ab1b6[_0x8488('0x91')];_0x2f137a++){_0x511143=_[_0x8488('0x93')](_0x3c3e89,[_0x8488('0xd'),_0x3ab1b6[_0x2f137a][_0x8488('0xd')]]);if(_0x511143[_0x8488('0xb')]){_0x353514={};_0x353514[_0x511143[_0x8488('0xa5')]]=_0x3ab1b6[_0x2f137a][_0x8488('0x8')];_0x18c724[_0x8488('0x92')](_0x353514);}else{if(!_0x4ba14e[_0x8488('0x86')]['id'])_0x4ba14e[_0x8488('0x86')]['id']=[];_0x3ab1b6[_0x2f137a][_0x8488('0x8')][_0x8488('0xa6')](function(_0x3b22ad){_0x4ba14e['where']['id'][_0x8488('0x92')](_0x3b22ad);});}}}if(!_[_0x8488('0x90')](_0x18c724)){_0x4ba14e['where']=_[_0x8488('0xa3')](_0x4ba14e[_0x8488('0x86')],{'$and':{'$or':_0x18c724}});}_0x4ba14e=_[_0x8488('0xa3')]({},_0x4ba14e,_0x3b6bfe[_0x8488('0xa7')]);if(_0xe1fe21&&!_0xe1fe21[_0x8488('0xa8')]&&_0x26e0cc[_0x8488('0x14')]===_0x8488('0x79')){if(_0x3b6bfe[_0x8488('0x89')][_0x8488('0xa9')]){_0x4ba14e[_0x8488('0xaa')]=[{'all':!![]}];}return _0xacc8f0[_0x26e0cc[_0x8488('0x14')]]['findAll'](_0x4ba14e)[_0x8488('0x7')](function(_0x1abac4){var _0x51814e=[];_0x1abac4[_0x8488('0xa6')](function(_0x7426b2){var _0x76c3c;switch(_0x7426b2[_0x8488('0xab')]){case _0x8488('0xac'):_0x76c3c=_['find'](_0xe1fe21['associatedResources'],function(_0x31138c){return _0x31138c['id']===_0x7426b2[_0x8488('0x7a')]&&_0x31138c[_0x8488('0x11')]===_0x8488('0xad');});break;case _0x8488('0xae'):_0x76c3c=_[_0x8488('0x93')](_0xe1fe21[_0x8488('0x8')],function(_0x283824){return _0x283824['id']===_0x7426b2[_0x8488('0x7a')]&&_0x283824[_0x8488('0x11')]===_0x8488('0xaf');});break;}if(_0x76c3c)_0x51814e[_0x8488('0x92')](_0x7426b2);});_0x164d30[_0x8488('0xb0')]=_0x51814e[_0x8488('0x91')];_0x164d30[_0x8488('0xb1')]=_0x51814e;return _0x164d30;});}else{return _0xacc8f0[_0x26e0cc['childModel']][_0x8488('0xb0')]({'where':_0x4ba14e['where']})['then'](function(_0x1e25a3){_0x164d30[_0x8488('0xb0')]=_0x1e25a3;if(_0x3b6bfe[_0x8488('0x89')][_0x8488('0xa9')]){if(_0x26e0cc[_0x8488('0x14')]===_0x8488('0x1c')){_0x4ba14e[_0x8488('0xaa')]=[{'model':_0xacc8f0[_0x8488('0xb2')],'as':_0x8488('0xb3'),'attributes':['id',_0x8488('0xd'),'color'],'required':_0x3b6bfe[_0x8488('0x89')][_0x8488('0xb4')]?!![]:![]},{'model':_0xacc8f0[_0x8488('0xb2')],'as':_0x8488('0xb5'),'attributes':['id',_0x8488('0xd'),_0x8488('0xb6')],'through':_0x3b6bfe['query'][_0x8488('0xb4')]?{'attributes':[],'where':{'TagId':_0x3b6bfe['query'][_0x8488('0xb4')]||undefined}}:{},'required':_0x3b6bfe[_0x8488('0x89')]['tag']?!![]:![]}];}else{_0x4ba14e['include']=[{'all':!![]}];}}return _0xacc8f0[_0x26e0cc[_0x8488('0x14')]][_0x8488('0x6')](_0x4ba14e);})[_0x8488('0x7')](function(_0x30b124){_0x164d30[_0x8488('0xb1')]=_0x30b124;if(_0x379a4d==='Agents'&&_0x3b6bfe[_0x8488('0x89')][_0x8488('0xb7')]==='true'){var _0x52c750=[];for(var _0x41491a=0x0;_0x41491a<_0x164d30[_0x8488('0xb1')][_0x8488('0x91')];_0x41491a++){_0x52c750['push'](_0x4041e5('chat',_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5('sms',_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xb9'),_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xba'),_0x164d30[_0x8488('0xb1')][_0x41491a][_0x8488('0xb8')]));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xbb'),_0x164d30[_0x8488('0xb1')][_0x41491a]['dataValues']));_0x52c750[_0x8488('0x92')](_0x4041e5(_0x8488('0xbc'),_0x164d30[_0x8488('0xb1')][_0x41491a]['dataValues']));}return Promise[_0x8488('0x95')](_0x52c750)['then'](function(){return _0x164d30;});}return _0x164d30;});}});}}});};
\ No newline at end of file
index e28f5d5..887cdf4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5458=['UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1001b0,_0x55b362){var _0x2c4f67=function(_0x528752){while(--_0x528752){_0x1001b0['push'](_0x1001b0['shift']());}};_0x2c4f67(++_0x55b362);}(_0x5458,0x1c7));var _0x8545=function(_0x6aae24,_0x39f333){_0x6aae24=_0x6aae24-0x0;var _0x550008=_0x5458[_0x6aae24];return _0x550008;};'use strict';var _=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var moment=require(_0x8545('0x2'));var BPromise=require('bluebird');var rs=require(_0x8545('0x3'));var fs=require('fs');var Redis=require(_0x8545('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8545('0x5'));var logger=require(_0x8545('0x6'))(_0x8545('0x7'));var config=require('../../config/environment');var jayson=require(_0x8545('0x8'));var client=jayson[_0x8545('0x9')][_0x8545('0xa')]({'port':0x232a});config[_0x8545('0xb')]=_['defaults'](config[_0x8545('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x8545('0xc'))(new Redis(config[_0x8545('0xb')]));require(_0x8545('0xd'))[_0x8545('0xe')](socket);function respondWithRpcPromise(_0x737cb7,_0x36a6d8,_0x1ffef9){return new BPromise(function(_0x3721fa,_0x5531f0){return client[_0x8545('0xf')](_0x737cb7,_0x1ffef9)[_0x8545('0x10')](function(_0x200177){logger['info'](_0x8545('0x11'),_0x36a6d8,_0x8545('0x12'));logger[_0x8545('0x13')](_0x8545('0x14'),_0x36a6d8,_0x8545('0x12'),JSON[_0x8545('0x15')](_0x200177));if(_0x200177[_0x8545('0x16')]){if(_0x200177[_0x8545('0x16')][_0x8545('0x17')]===0x1f4){logger['error'](_0x8545('0x11'),_0x36a6d8,_0x200177[_0x8545('0x16')]['message']);return _0x5531f0(_0x200177[_0x8545('0x16')][_0x8545('0x18')]);}logger[_0x8545('0x16')]('UserProfile,\x20%s,\x20%s',_0x36a6d8,_0x200177[_0x8545('0x16')][_0x8545('0x18')]);return _0x3721fa(_0x200177[_0x8545('0x16')]['message']);}else{logger['info'](_0x8545('0x11'),_0x36a6d8,_0x8545('0x12'));_0x3721fa(_0x200177['result']['message']);}})['catch'](function(_0x42bf05){logger[_0x8545('0x16')](_0x8545('0x11'),_0x36a6d8,_0x42bf05);_0x5531f0(_0x42bf05);});});}
\ No newline at end of file
+var _0xdfb1=['info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','localhost','socket.io-emitter','register','request','then'];(function(_0x55f95a,_0x28c042){var _0x13e20f=function(_0x25bddc){while(--_0x25bddc){_0x55f95a['push'](_0x55f95a['shift']());}};_0x13e20f(++_0x28c042);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x1805f5,_0x1e01d5){_0x1805f5=_0x1805f5-0x0;var _0xad4653=_0xdfb1[_0x1805f5];return _0xad4653;};'use strict';var _=require(_0x1dfb('0x0'));var util=require(_0x1dfb('0x1'));var moment=require(_0x1dfb('0x2'));var BPromise=require(_0x1dfb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1dfb('0x4'));var db=require(_0x1dfb('0x5'))['db'];var utils=require(_0x1dfb('0x6'));var logger=require(_0x1dfb('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1dfb('0x8')][_0x1dfb('0x9')]({'port':0x232a});config[_0x1dfb('0xa')]=_['defaults'](config[_0x1dfb('0xa')],{'host':_0x1dfb('0xb'),'port':0x18eb});var socket=require(_0x1dfb('0xc'))(new Redis(config[_0x1dfb('0xa')]));require('./userProfile.socket')[_0x1dfb('0xd')](socket);function respondWithRpcPromise(_0x3e728f,_0x191d87,_0x4ea385){return new BPromise(function(_0xd747ac,_0x6a43eb){return client[_0x1dfb('0xe')](_0x3e728f,_0x4ea385)[_0x1dfb('0xf')](function(_0x3a0366){logger[_0x1dfb('0x10')](_0x1dfb('0x11'),_0x191d87,_0x1dfb('0x12'));logger[_0x1dfb('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x191d87,_0x1dfb('0x12'),JSON[_0x1dfb('0x14')](_0x3a0366));if(_0x3a0366['error']){if(_0x3a0366[_0x1dfb('0x15')][_0x1dfb('0x16')]===0x1f4){logger[_0x1dfb('0x15')]('UserProfile,\x20%s,\x20%s',_0x191d87,_0x3a0366[_0x1dfb('0x15')][_0x1dfb('0x17')]);return _0x6a43eb(_0x3a0366[_0x1dfb('0x15')]['message']);}logger[_0x1dfb('0x15')](_0x1dfb('0x11'),_0x191d87,_0x3a0366[_0x1dfb('0x15')]['message']);return _0xd747ac(_0x3a0366[_0x1dfb('0x15')][_0x1dfb('0x17')]);}else{logger[_0x1dfb('0x10')]('UserProfile,\x20%s,\x20%s',_0x191d87,'request\x20sent');_0xd747ac(_0x3a0366[_0x1dfb('0x18')][_0x1dfb('0x17')]);}})[_0x1dfb('0x19')](function(_0xce05c5){logger['error'](_0x1dfb('0x11'),_0x191d87,_0xce05c5);_0x6a43eb(_0xce05c5);});});}
\ No newline at end of file
index 353c10b..559670d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3444=['removeListener','register','length','userProfile:','./userProfile.events','update','emit'];(function(_0x41847e,_0x3d749c){var _0x1c8108=function(_0x20e334){while(--_0x20e334){_0x41847e['push'](_0x41847e['shift']());}};_0x1c8108(++_0x3d749c);}(_0x3444,0xac));var _0x4344=function(_0xaed7c9,_0x393548){_0xaed7c9=_0xaed7c9-0x0;var _0xf78b5e=_0x3444[_0xaed7c9];return _0xf78b5e;};'use strict';var UserProfileEvents=require(_0x4344('0x0'));var events=['save','remove',_0x4344('0x1')];function createListener(_0x2514a2,_0x2e79ad){return function(_0x2f9f86){_0x2e79ad[_0x4344('0x2')](_0x2514a2,_0x2f9f86);};}function removeListener(_0x2a1c02,_0x29c149){return function(){UserProfileEvents[_0x4344('0x3')](_0x2a1c02,_0x29c149);};}exports[_0x4344('0x4')]=function(_0x5d258a){for(var _0x1d7c3d=0x0,_0x1782f8=events[_0x4344('0x5')];_0x1d7c3d<_0x1782f8;_0x1d7c3d++){var _0x1fe403=events[_0x1d7c3d];var _0x7ed28d=createListener(_0x4344('0x6')+_0x1fe403,_0x5d258a);UserProfileEvents['on'](_0x1fe403,_0x7ed28d);}};
\ No newline at end of file
+var _0x21b2=['emit','removeListener','length','userProfile:','save','remove','update'];(function(_0xe721a4,_0x393102){var _0x231887=function(_0x47ce26){while(--_0x47ce26){_0xe721a4['push'](_0xe721a4['shift']());}};_0x231887(++_0x393102);}(_0x21b2,0x1bd));var _0x221b=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x21b2[_0x4565bf];return _0x5610ba;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x221b('0x0'),_0x221b('0x1'),_0x221b('0x2')];function createListener(_0x3e7e0f,_0x47997d){return function(_0x5e4df9){_0x47997d[_0x221b('0x3')](_0x3e7e0f,_0x5e4df9);};}function removeListener(_0x2d2692,_0x1ccdd3){return function(){UserProfileEvents[_0x221b('0x4')](_0x2d2692,_0x1ccdd3);};}exports['register']=function(_0x479037){for(var _0x23ee9c=0x0,_0x362d51=events[_0x221b('0x5')];_0x23ee9c<_0x362d51;_0x23ee9c++){var _0x60ff58=events[_0x23ee9c];var _0x4222d0=createListener(_0x221b('0x6')+_0x60ff58,_0x479037);UserProfileEvents['on'](_0x60ff58,_0x4222d0);}};
\ No newline at end of file
index 028339a..e9f7f06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d26=['/:id','show','post','put','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index'];(function(_0x5ac857,_0x1fd811){var _0xa44e8c=function(_0x6ec6ef){while(--_0x6ec6ef){_0x5ac857['push'](_0x5ac857['shift']());}};_0xa44e8c(++_0x1fd811);}(_0x8d26,0x1ab));var _0x68d2=function(_0x5a4526,_0x521684){_0x5a4526=_0x5a4526-0x0;var _0x4d5f94=_0x8d26[_0x5a4526];return _0x4d5f94;};'use strict';var multer=require(_0x68d2('0x0'));var util=require(_0x68d2('0x1'));var path=require(_0x68d2('0x2'));var timeout=require('connect-timeout');var express=require(_0x68d2('0x3'));var router=express[_0x68d2('0x4')]();var fs_extra=require(_0x68d2('0x5'));var auth=require(_0x68d2('0x6'));var interaction=require(_0x68d2('0x7'));var config=require(_0x68d2('0x8'));var controller=require(_0x68d2('0x9'));router[_0x68d2('0xa')]('/',auth[_0x68d2('0xb')](),controller[_0x68d2('0xc')]);router[_0x68d2('0xa')]('/describe',auth[_0x68d2('0xb')](),controller['describe']);router[_0x68d2('0xa')](_0x68d2('0xd'),auth[_0x68d2('0xb')](),controller[_0x68d2('0xe')]);router[_0x68d2('0xf')]('/',auth[_0x68d2('0xb')](),controller['create']);router[_0x68d2('0x10')](_0x68d2('0xd'),auth[_0x68d2('0xb')](),controller[_0x68d2('0x11')]);router['delete'](_0x68d2('0xd'),auth[_0x68d2('0xb')](),controller[_0x68d2('0x12')]);module[_0x68d2('0x13')]=router;
\ No newline at end of file
+var _0x45df=['/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get'];(function(_0x390910,_0x736e1e){var _0x5ce1ea=function(_0x1b36a7){while(--_0x1b36a7){_0x390910['push'](_0x390910['shift']());}};_0x5ce1ea(++_0x736e1e);}(_0x45df,0xdd));var _0xf45d=function(_0x38d5f7,_0x440f76){_0x38d5f7=_0x38d5f7-0x0;var _0x565610=_0x45df[_0x38d5f7];return _0x565610;};'use strict';var multer=require(_0xf45d('0x0'));var util=require(_0xf45d('0x1'));var path=require(_0xf45d('0x2'));var timeout=require(_0xf45d('0x3'));var express=require(_0xf45d('0x4'));var router=express[_0xf45d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf45d('0x6'));var interaction=require(_0xf45d('0x7'));var config=require('../../config/environment');var controller=require(_0xf45d('0x8'));router[_0xf45d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf45d('0x9')](_0xf45d('0xa'),auth[_0xf45d('0xb')](),controller['describe']);router[_0xf45d('0x9')](_0xf45d('0xc'),auth[_0xf45d('0xb')](),controller[_0xf45d('0xd')]);router[_0xf45d('0xe')]('/',auth[_0xf45d('0xb')](),controller[_0xf45d('0xf')]);router[_0xf45d('0x10')](_0xf45d('0xc'),auth[_0xf45d('0xb')](),controller[_0xf45d('0x11')]);router[_0xf45d('0x12')](_0xf45d('0xc'),auth['isAuthenticated'](),controller[_0xf45d('0x13')]);module[_0xf45d('0x14')]=router;
\ No newline at end of file
index 49cedda..a9ea9d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccff=['exports','STRING','sequelize'];(function(_0x173aca,_0x4cfe9f){var _0x5dbf81=function(_0x10c012){while(--_0x10c012){_0x173aca['push'](_0x173aca['shift']());}};_0x5dbf81(++_0x4cfe9f);}(_0xccff,0x167));var _0xfccf=function(_0x3b6fa9,_0x91a3b1){_0x3b6fa9=_0x3b6fa9-0x0;var _0x26621c=_0xccff[_0x3b6fa9];return _0x26621c;};'use strict';var Sequelize=require(_0xfccf('0x0'));module[_0xfccf('0x1')]={'name':{'type':Sequelize[_0xfccf('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xfccf('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xb9bb=['sequelize','exports','STRING'];(function(_0x4c4ca2,_0x30d812){var _0x17dac3=function(_0x4f07e6){while(--_0x4f07e6){_0x4c4ca2['push'](_0x4c4ca2['shift']());}};_0x17dac3(++_0x30d812);}(_0xb9bb,0x153));var _0xbb9b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb9bb[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xbb9b('0x0'));module[_0xbb9b('0x1')]={'name':{'type':Sequelize[_0xbb9b('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0xbb9b('0x2')],'allowNull':![]}};
\ No newline at end of file
index 3a46c13..0e2e1c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then'];(function(_0x16446a,_0x5e9140){var _0x2c7051=function(_0x2e6a25){while(--_0x2e6a25){_0x16446a['push'](_0x16446a['shift']());}};_0x2c7051(++_0x5e9140);}(_0x7880,0x1f4));var _0x0788=function(_0xa62163,_0x4a26fb){_0xa62163=_0xa62163-0x0;var _0x46b4fb=_0x7880[_0xa62163];return _0x46b4fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['UserProfileResource'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));};exports['describe']=function(_0x1693d0,_0x5d32ae){return db['UserProfileResource'][_0x0788('0x4c')]()[_0x0788('0x26')](respondWithResult(_0x5d32ae,null))[_0x0788('0x44')](handleError(_0x5d32ae,null));};
\ No newline at end of file
+var _0x5c3c=['findAll','rows','params','merge','catch','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','limit','count','offset','Content-Range','json','apply','reject','save','update','then','sendStatus','stack','name','send','index','map','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','UserProfileResource','includeAll','include'];(function(_0x1fa984,_0xd5100b){var _0x3efa99=function(_0x3b239a){while(--_0x3b239a){_0x1fa984['push'](_0x1fa984['shift']());}};_0x3efa99(++_0xd5100b);}(_0x5c3c,0x132));var _0xc5c3=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0x5c3c[_0x3c2a69];return _0x596bc8;};'use strict';var emlformat=require(_0xc5c3('0x0'));var rimraf=require(_0xc5c3('0x1'));var zipdir=require(_0xc5c3('0x2'));var jsonpatch=require(_0xc5c3('0x3'));var rp=require('request-promise');var moment=require(_0xc5c3('0x4'));var BPromise=require(_0xc5c3('0x5'));var Mustache=require(_0xc5c3('0x6'));var util=require(_0xc5c3('0x7'));var path=require(_0xc5c3('0x8'));var sox=require(_0xc5c3('0x9'));var csv=require(_0xc5c3('0xa'));var ejs=require(_0xc5c3('0xb'));var fs=require('fs');var fs_extra=require(_0xc5c3('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc5c3('0xd'));var deskjs=require(_0xc5c3('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc5c3('0xf'));var Papa=require(_0xc5c3('0x10'));var Redis=require('ioredis');var authService=require(_0xc5c3('0x11'));var qs=require(_0xc5c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c3('0x13'));var logger=require(_0xc5c3('0x14'))(_0xc5c3('0x15'));var utils=require('../../config/utils');var config=require(_0xc5c3('0x16'));var licenseUtil=require(_0xc5c3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b56e6,_0x44d2b9){_0x44d2b9=_0x44d2b9||0xcc;return function(_0x3f0f45){if(_0x3f0f45){return _0x2b56e6['sendStatus'](_0x44d2b9);}return _0x2b56e6[_0xc5c3('0x18')](_0x44d2b9)[_0xc5c3('0x19')]();};}function respondWithResult(_0x1488ab,_0x13a740){_0x13a740=_0x13a740||0xc8;return function(_0xc8a636){if(_0xc8a636){return _0x1488ab['status'](_0x13a740)['json'](_0xc8a636);}};}function respondWithFilteredResult(_0x4445ea,_0x577e1a){return function(_0x1bae87){if(_0x1bae87){var _0xef8b21=typeof _0x577e1a['offset']==='undefined'&&typeof _0x577e1a[_0xc5c3('0x1a')]==='undefined';var _0xa9bc84=_0x1bae87[_0xc5c3('0x1b')];var _0x2ff158=_0xef8b21?0x0:_0x577e1a[_0xc5c3('0x1c')];var _0x28bae6=_0xef8b21?_0x1bae87['count']:_0x577e1a[_0xc5c3('0x1c')]+_0x577e1a[_0xc5c3('0x1a')];var _0x123dba;if(_0x28bae6>=_0xa9bc84){_0x28bae6=_0xa9bc84;_0x123dba=0xc8;}else{_0x123dba=0xce;}_0x4445ea[_0xc5c3('0x18')](_0x123dba);return _0x4445ea['set'](_0xc5c3('0x1d'),_0x2ff158+'-'+_0x28bae6+'/'+_0xa9bc84)[_0xc5c3('0x1e')](_0x1bae87);}return null;};}function patchUpdates(_0x3cc612){return function(_0x3ca20a){try{jsonpatch[_0xc5c3('0x1f')](_0x3ca20a,_0x3cc612,!![]);}catch(_0x564815){return BPromise[_0xc5c3('0x20')](_0x564815);}return _0x3ca20a[_0xc5c3('0x21')]();};}function saveUpdates(_0x370254,_0x2de266){return function(_0x1c5793){if(_0x1c5793){return _0x1c5793[_0xc5c3('0x22')](_0x370254)[_0xc5c3('0x23')](function(_0x5996a0){return _0x5996a0;});}return null;};}function removeEntity(_0x52d638,_0x45affe){return function(_0x38dd9e){if(_0x38dd9e){return _0x38dd9e['destroy']()['then'](function(){_0x52d638[_0xc5c3('0x18')](0xcc)[_0xc5c3('0x19')]();});}};}function handleEntityNotFound(_0x38a3df,_0x52e54a){return function(_0x4af067){if(!_0x4af067){_0x38a3df[_0xc5c3('0x24')](0x194);}return _0x4af067;};}function handleError(_0x22f607,_0x20c506){_0x20c506=_0x20c506||0x1f4;return function(_0x29791c){logger['error'](_0x29791c[_0xc5c3('0x25')]);if(_0x29791c['name']){delete _0x29791c[_0xc5c3('0x26')];}_0x22f607['status'](_0x20c506)[_0xc5c3('0x27')](_0x29791c);};}exports[_0xc5c3('0x28')]=function(_0x4269eb,_0x4773c5){var _0x15361c={},_0x2d07e1={},_0x35a397={'count':0x0,'rows':[]};var _0x4b5a0c=_[_0xc5c3('0x29')](db['UserProfileResource'][_0xc5c3('0x2a')],function(_0x43ebfc){return{'name':_0x43ebfc['fieldName'],'type':_0x43ebfc['type'][_0xc5c3('0x2b')]};});_0x2d07e1[_0xc5c3('0x2c')]=_[_0xc5c3('0x29')](_0x4b5a0c,_0xc5c3('0x26'));_0x2d07e1['query']=_[_0xc5c3('0x2d')](_0x4269eb[_0xc5c3('0x2e')]);_0x2d07e1[_0xc5c3('0x2f')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],_0x2d07e1[_0xc5c3('0x2e')]);_0x15361c[_0xc5c3('0x31')]=_[_0xc5c3('0x30')](_0x2d07e1[_0xc5c3('0x2c')],qs['fields'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x32')]));_0x15361c[_0xc5c3('0x31')]=_0x15361c[_0xc5c3('0x31')][_0xc5c3('0x33')]?_0x15361c[_0xc5c3('0x31')]:_0x2d07e1[_0xc5c3('0x2c')];if(!_0x4269eb['query']['hasOwnProperty'](_0xc5c3('0x34'))){_0x15361c['limit']=qs[_0xc5c3('0x1a')](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x1a')]);_0x15361c[_0xc5c3('0x1c')]=qs[_0xc5c3('0x1c')](_0x4269eb['query'][_0xc5c3('0x1c')]);}_0x15361c[_0xc5c3('0x35')]=qs['sort'](_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x36')]);_0x15361c[_0xc5c3('0x37')]=qs[_0xc5c3('0x2f')](_[_0xc5c3('0x38')](_0x4269eb[_0xc5c3('0x2e')],_0x2d07e1[_0xc5c3('0x2f')]),_0x4b5a0c);if(_0x4269eb[_0xc5c3('0x2e')][_0xc5c3('0x39')]){_0x15361c[_0xc5c3('0x37')]=_['merge'](_0x15361c[_0xc5c3('0x37')],{'$or':_['map'](_0x4b5a0c,function(_0x4fdbe6){if(_0x4fdbe6[_0xc5c3('0x3a')]!==_0xc5c3('0x3b')){var _0x1b546e={};_0x1b546e[_0x4fdbe6[_0xc5c3('0x26')]]={'$like':'%'+_0x4269eb[_0xc5c3('0x2e')]['filter']+'%'};return _0x1b546e;}})});}_0x15361c=_['merge']({},_0x15361c,_0x4269eb[_0xc5c3('0x3c')]);var _0xa7cb91={'where':_0x15361c['where']};return db[_0xc5c3('0x3d')]['count'](_0xa7cb91)[_0xc5c3('0x23')](function(_0x2dfd19){_0x35a397[_0xc5c3('0x1b')]=_0x2dfd19;if(_0x4269eb['query'][_0xc5c3('0x3e')]){_0x15361c[_0xc5c3('0x3f')]=[{'all':!![]}];}return db['UserProfileResource'][_0xc5c3('0x40')](_0x15361c);})['then'](function(_0x33936c){_0x35a397[_0xc5c3('0x41')]=_0x33936c;return _0x35a397;})['then'](respondWithFilteredResult(_0x4773c5,_0x15361c))['catch'](handleError(_0x4773c5,null));};exports['show']=function(_0xfb64bb,_0x2f02ab){var _0x49b1fc={'raw':![],'where':{'id':_0xfb64bb[_0xc5c3('0x42')]['id']}},_0x1a8490={};_0x1a8490[_0xc5c3('0x2c')]=_[_0xc5c3('0x2d')](db['UserProfileResource'][_0xc5c3('0x2a')]);_0x1a8490['query']=_['keys'](_0xfb64bb[_0xc5c3('0x2e')]);_0x1a8490[_0xc5c3('0x2f')]=_['intersection'](_0x1a8490[_0xc5c3('0x2c')],_0x1a8490[_0xc5c3('0x2e')]);_0x49b1fc['attributes']=_[_0xc5c3('0x30')](_0x1a8490['model'],qs[_0xc5c3('0x32')](_0xfb64bb[_0xc5c3('0x2e')]['fields']));_0x49b1fc[_0xc5c3('0x31')]=_0x49b1fc['attributes'][_0xc5c3('0x33')]?_0x49b1fc[_0xc5c3('0x31')]:_0x1a8490['model'];if(_0xfb64bb[_0xc5c3('0x2e')][_0xc5c3('0x3e')]){_0x49b1fc[_0xc5c3('0x3f')]=[{'all':!![]}];}_0x49b1fc=_[_0xc5c3('0x43')]({},_0x49b1fc,_0xfb64bb[_0xc5c3('0x3c')]);return db[_0xc5c3('0x3d')]['find'](_0x49b1fc)[_0xc5c3('0x23')](handleEntityNotFound(_0x2f02ab,null))[_0xc5c3('0x23')](respondWithResult(_0x2f02ab,null))[_0xc5c3('0x44')](handleError(_0x2f02ab,null));};exports[_0xc5c3('0x45')]=function(_0x23002b,_0x4a7330){return db['UserProfileResource'][_0xc5c3('0x45')](_0x23002b[_0xc5c3('0x46')],{})[_0xc5c3('0x23')](respondWithResult(_0x4a7330,0xc9))['catch'](handleError(_0x4a7330,null));};exports[_0xc5c3('0x22')]=function(_0x65f720,_0x3a901f){if(_0x65f720[_0xc5c3('0x46')]['id']){delete _0x65f720[_0xc5c3('0x46')]['id'];}return db[_0xc5c3('0x3d')][_0xc5c3('0x47')]({'where':{'id':_0x65f720['params']['id']}})[_0xc5c3('0x23')](handleEntityNotFound(_0x3a901f,null))[_0xc5c3('0x23')](saveUpdates(_0x65f720[_0xc5c3('0x46')],null))['then'](respondWithResult(_0x3a901f,null))[_0xc5c3('0x44')](handleError(_0x3a901f,null));};exports[_0xc5c3('0x48')]=function(_0x3b1bc2,_0x103bde){return db[_0xc5c3('0x3d')]['find']({'where':{'id':_0x3b1bc2[_0xc5c3('0x42')]['id']}})['then'](handleEntityNotFound(_0x103bde,null))[_0xc5c3('0x23')](removeEntity(_0x103bde,null))['catch'](handleError(_0x103bde,null));};exports[_0xc5c3('0x49')]=function(_0x34a2c3,_0x4add6b){return db[_0xc5c3('0x3d')][_0xc5c3('0x49')]()['then'](respondWithResult(_0x4add6b,null))[_0xc5c3('0x44')](handleError(_0x4add6b,null));};
\ No newline at end of file
index 1a88f4e..eabd702 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x90d5=['bluebird','request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','lodash','util','../../config/logger','moment'];(function(_0x20fde0,_0x428064){var _0x2de52c=function(_0xe4c138){while(--_0xe4c138){_0x20fde0['push'](_0x20fde0['shift']());}};_0x2de52c(++_0x428064);}(_0x90d5,0x1be));var _0x590d=function(_0x2a3ce0,_0x5642e3){_0x2a3ce0=_0x2a3ce0-0x0;var _0x2a7c10=_0x90d5[_0x2a3ce0];return _0x2a7c10;};'use strict';var _=require(_0x590d('0x0'));var util=require(_0x590d('0x1'));var logger=require(_0x590d('0x2'))('api');var moment=require(_0x590d('0x3'));var BPromise=require(_0x590d('0x4'));var rp=require(_0x590d('0x5'));var fs=require('fs');var path=require(_0x590d('0x6'));var rimraf=require(_0x590d('0x7'));var config=require(_0x590d('0x8'));var attributes=require(_0x590d('0x9'));module[_0x590d('0xa')]=function(_0x35b165,_0x1947d0){return _0x35b165['define'](_0x590d('0xb'),attributes,{'tableName':_0x590d('0xc'),'paranoid':![],'indexes':[{'name':_0x590d('0xd'),'fields':[_0x590d('0xe'),'sectionId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf7a9=['request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger'];(function(_0xed8c8,_0x4b7cca){var _0x4010ed=function(_0x21546e){while(--_0x21546e){_0xed8c8['push'](_0xed8c8['shift']());}};_0x4010ed(++_0x4b7cca);}(_0xf7a9,0xa6));var _0x9f7a=function(_0x2994a2,_0x424152){_0x2994a2=_0x2994a2-0x0;var _0x4deeeb=_0xf7a9[_0x2994a2];return _0x4deeeb;};'use strict';var _=require('lodash');var util=require(_0x9f7a('0x0'));var logger=require(_0x9f7a('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f7a('0x2'));var fs=require('fs');var path=require(_0x9f7a('0x3'));var rimraf=require(_0x9f7a('0x4'));var config=require(_0x9f7a('0x5'));var attributes=require(_0x9f7a('0x6'));module['exports']=function(_0x2105ed,_0x2ee274){return _0x2105ed[_0x9f7a('0x7')]('UserProfileResource',attributes,{'tableName':_0x9f7a('0x8'),'paranoid':![],'indexes':[{'name':_0x9f7a('0x9'),'fields':[_0x9f7a('0xa'),_0x9f7a('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index bd27b49..465efc7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae3f=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x257bf7,_0x5c7755){var _0x361d0f=function(_0x1f1cb5){while(--_0x1f1cb5){_0x257bf7['push'](_0x257bf7['shift']());}};_0x361d0f(++_0x5c7755);}(_0xae3f,0xb0));var _0xfae3=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xae3f[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xfae3('0x0'));var util=require(_0xfae3('0x1'));var moment=require(_0xfae3('0x2'));var BPromise=require(_0xfae3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfae3('0x4'))['db'];var utils=require(_0xfae3('0x5'));var logger=require(_0xfae3('0x6'))(_0xfae3('0x7'));var config=require(_0xfae3('0x8'));var jayson=require(_0xfae3('0x9'));var client=jayson['client'][_0xfae3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x393be4,_0x34602c,_0x1430df){return new BPromise(function(_0x18effd,_0x6b906f){return client['request'](_0x393be4,_0x1430df)['then'](function(_0x456b28){logger[_0xfae3('0xb')](_0xfae3('0xc'),_0x34602c,'request\x20sent');logger[_0xfae3('0xd')](_0xfae3('0xe'),_0x34602c,_0xfae3('0xf'),JSON[_0xfae3('0x10')](_0x456b28));if(_0x456b28['error']){if(_0x456b28[_0xfae3('0x11')][_0xfae3('0x12')]===0x1f4){logger[_0xfae3('0x11')](_0xfae3('0xc'),_0x34602c,_0x456b28['error'][_0xfae3('0x13')]);return _0x6b906f(_0x456b28[_0xfae3('0x11')]['message']);}logger[_0xfae3('0x11')](_0xfae3('0xc'),_0x34602c,_0x456b28[_0xfae3('0x11')][_0xfae3('0x13')]);return _0x18effd(_0x456b28[_0xfae3('0x11')][_0xfae3('0x13')]);}else{logger[_0xfae3('0xb')](_0xfae3('0xc'),_0x34602c,'request\x20sent');_0x18effd(_0x456b28[_0xfae3('0x14')][_0xfae3('0x13')]);}})['catch'](function(_0x4bf84b){logger[_0xfae3('0x11')](_0xfae3('0xc'),_0x34602c,_0x4bf84b);_0x6b906f(_0x4bf84b);});});}
\ No newline at end of file
+var _0xfcf0=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x970068,_0x3e4142){var _0x51063d=function(_0x32b30e){while(--_0x32b30e){_0x970068['push'](_0x970068['shift']());}};_0x51063d(++_0x3e4142);}(_0xfcf0,0x1ad));var _0x0fcf=function(_0x1073ad,_0x44bf0b){_0x1073ad=_0x1073ad-0x0;var _0x528474=_0xfcf0[_0x1073ad];return _0x528474;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require(_0x0fcf('0x2'));var BPromise=require(_0x0fcf('0x3'));var rs=require(_0x0fcf('0x4'));var fs=require('fs');var Redis=require(_0x0fcf('0x5'));var db=require(_0x0fcf('0x6'))['db'];var utils=require(_0x0fcf('0x7'));var logger=require(_0x0fcf('0x8'))(_0x0fcf('0x9'));var config=require(_0x0fcf('0xa'));var jayson=require(_0x0fcf('0xb'));var client=jayson[_0x0fcf('0xc')][_0x0fcf('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x128860,_0x3dfb24,_0x893545){return new BPromise(function(_0x151bb3,_0x35b277){return client[_0x0fcf('0xe')](_0x128860,_0x893545)[_0x0fcf('0xf')](function(_0x9ebd82){logger[_0x0fcf('0x10')](_0x0fcf('0x11'),_0x3dfb24,_0x0fcf('0x12'));logger[_0x0fcf('0x13')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3dfb24,'request\x20sent',JSON[_0x0fcf('0x14')](_0x9ebd82));if(_0x9ebd82[_0x0fcf('0x15')]){if(_0x9ebd82[_0x0fcf('0x15')][_0x0fcf('0x16')]===0x1f4){logger[_0x0fcf('0x15')](_0x0fcf('0x11'),_0x3dfb24,_0x9ebd82[_0x0fcf('0x15')][_0x0fcf('0x17')]);return _0x35b277(_0x9ebd82[_0x0fcf('0x15')][_0x0fcf('0x17')]);}logger[_0x0fcf('0x15')](_0x0fcf('0x11'),_0x3dfb24,_0x9ebd82[_0x0fcf('0x15')][_0x0fcf('0x17')]);return _0x151bb3(_0x9ebd82['error']['message']);}else{logger['info'](_0x0fcf('0x11'),_0x3dfb24,_0x0fcf('0x12'));_0x151bb3(_0x9ebd82[_0x0fcf('0x18')][_0x0fcf('0x17')]);}})['catch'](function(_0x57452c){logger[_0x0fcf('0x15')]('UserProfileResource,\x20%s,\x20%s',_0x3dfb24,_0x57452c);_0x35b277(_0x57452c);});});}
\ No newline at end of file
index d37b170..3e98b0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x779a=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','/describe','describe','get','/:id','show','create','put'];(function(_0x4c12f4,_0x389a61){var _0x24bac8=function(_0x1e84bd){while(--_0x1e84bd){_0x4c12f4['push'](_0x4c12f4['shift']());}};_0x24bac8(++_0x389a61);}(_0x779a,0x124));var _0xa779=function(_0x236114,_0x39caa5){_0x236114=_0x236114-0x0;var _0x134b55=_0x779a[_0x236114];return _0x134b55;};'use strict';var multer=require(_0xa779('0x0'));var util=require(_0xa779('0x1'));var path=require(_0xa779('0x2'));var timeout=require(_0xa779('0x3'));var express=require(_0xa779('0x4'));var router=express[_0xa779('0x5')]();var fs_extra=require(_0xa779('0x6'));var auth=require(_0xa779('0x7'));var interaction=require(_0xa779('0x8'));var config=require(_0xa779('0x9'));var controller=require(_0xa779('0xa'));router['get']('/',auth[_0xa779('0xb')](),controller[_0xa779('0xc')]);router['get'](_0xa779('0xd'),auth[_0xa779('0xb')](),controller[_0xa779('0xe')]);router[_0xa779('0xf')](_0xa779('0x10'),auth[_0xa779('0xb')](),controller[_0xa779('0x11')]);router['post']('/',auth[_0xa779('0xb')](),controller[_0xa779('0x12')]);router[_0xa779('0x13')](_0xa779('0x10'),auth[_0xa779('0xb')](),controller[_0xa779('0x14')]);router[_0xa779('0x15')]('/:id',auth[_0xa779('0xb')](),controller[_0xa779('0x16')]);module[_0xa779('0x17')]=router;
\ No newline at end of file
+var _0xea91=['fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','delete','/:id','util','path','connect-timeout','express','Router'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xea91,0xfb));var _0x1ea9=function(_0x19f8a3,_0x34ba71){_0x19f8a3=_0x19f8a3-0x0;var _0x1b6ee8=_0xea91[_0x19f8a3];return _0x1b6ee8;};'use strict';var multer=require('multer');var util=require(_0x1ea9('0x0'));var path=require(_0x1ea9('0x1'));var timeout=require(_0x1ea9('0x2'));var express=require(_0x1ea9('0x3'));var router=express[_0x1ea9('0x4')]();var fs_extra=require(_0x1ea9('0x5'));var auth=require(_0x1ea9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ea9('0x7'));var controller=require('./userProfileSection.controller');router[_0x1ea9('0x8')]('/',auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xa')]);router[_0x1ea9('0x8')](_0x1ea9('0xb'),auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xc')]);router[_0x1ea9('0x8')]('/:id',auth[_0x1ea9('0x9')](),controller[_0x1ea9('0xd')]);router['post']('/',auth[_0x1ea9('0x9')](),controller['create']);router['put']('/:id',auth[_0x1ea9('0x9')](),controller['update']);router[_0x1ea9('0xe')](_0x1ea9('0xf'),auth[_0x1ea9('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 01429b3..d8bb6e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6c=['join','getDataValue','crudPermissions','sequelize','exports','STRING','INTEGER','setDataValue'];(function(_0x535c3f,_0x307bb8){var _0x4ce47a=function(_0x143dc1){while(--_0x143dc1){_0x535c3f['push'](_0x535c3f['shift']());}};_0x4ce47a(++_0x307bb8);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0xc6e6('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xc6e6('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xc6e6('0x2')],'set':function(_0x5a9e2b){this[_0xc6e6('0x4')]('crudPermissions',_0x5a9e2b?_0x5a9e2b[_0xc6e6('0x5')](''):[]);},'get':function(){return this[_0xc6e6('0x6')]('crudPermissions')?this[_0xc6e6('0x6')](_0xc6e6('0x7'))['split'](''):[];}}};
\ No newline at end of file
+var _0xa5fa=['INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split','exports','STRING'];(function(_0x1743a9,_0x4fb330){var _0x1a4feb=function(_0xb80b0){while(--_0xb80b0){_0x1743a9['push'](_0x1743a9['shift']());}};_0x1a4feb(++_0x4fb330);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x22d9d6,_0x2c9216){_0x22d9d6=_0x22d9d6-0x0;var _0x24b608=_0xa5fa[_0x22d9d6];return _0x24b608;};'use strict';var Sequelize=require('sequelize');module[_0xaa5f('0x0')]={'name':{'type':Sequelize[_0xaa5f('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0xaa5f('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xaa5f('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xaa5f('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xaa5f('0x1')],'set':function(_0x4d1c8b){this[_0xaa5f('0x4')](_0xaa5f('0x5'),_0x4d1c8b?_0x4d1c8b[_0xaa5f('0x6')](''):[]);},'get':function(){return this[_0xaa5f('0x7')](_0xaa5f('0x5'))?this[_0xaa5f('0x7')](_0xaa5f('0x5'))[_0xaa5f('0x8')](''):[];}}};
\ No newline at end of file
index f27d62d..3abb921 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7adf=['length','includeAll','create','update','body','find','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','catch','show'];(function(_0x40e8e7,_0x5b2e8e){var _0x3d0745=function(_0x127067){while(--_0x127067){_0x40e8e7['push'](_0x40e8e7['shift']());}};_0x3d0745(++_0x5b2e8e);}(_0x7adf,0x1a6));var _0xf7ad=function(_0x2ed3bf,_0x209ff4){_0x2ed3bf=_0x2ed3bf-0x0;var _0x451429=_0x7adf[_0x2ed3bf];return _0x451429;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7ad('0x0'));var zipdir=require(_0xf7ad('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf7ad('0x2'));var moment=require(_0xf7ad('0x3'));var BPromise=require(_0xf7ad('0x4'));var Mustache=require(_0xf7ad('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf7ad('0x6'));var ejs=require(_0xf7ad('0x7'));var fs=require('fs');var fs_extra=require(_0xf7ad('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf7ad('0x9'));var toCsv=require('to-csv');var querystring=require(_0xf7ad('0xa'));var Papa=require('papaparse');var Redis=require(_0xf7ad('0xb'));var authService=require(_0xf7ad('0xc'));var qs=require(_0xf7ad('0xd'));var as=require(_0xf7ad('0xe'));var hardwareService=require(_0xf7ad('0xf'));var logger=require('../../config/logger')(_0xf7ad('0x10'));var utils=require(_0xf7ad('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf7ad('0x12'))['db'];function respondWithStatusCode(_0x12b1e5,_0x4c2cbb){_0x4c2cbb=_0x4c2cbb||0xcc;return function(_0x5f02ef){if(_0x5f02ef){return _0x12b1e5[_0xf7ad('0x13')](_0x4c2cbb);}return _0x12b1e5['status'](_0x4c2cbb)[_0xf7ad('0x14')]();};}function respondWithResult(_0x116fe8,_0x2f52f2){_0x2f52f2=_0x2f52f2||0xc8;return function(_0xaaafa5){if(_0xaaafa5){return _0x116fe8[_0xf7ad('0x15')](_0x2f52f2)[_0xf7ad('0x16')](_0xaaafa5);}};}function respondWithFilteredResult(_0x569dd3,_0x1193be){return function(_0x834de3){if(_0x834de3){var _0x134d5f=typeof _0x1193be['offset']===_0xf7ad('0x17')&&typeof _0x1193be[_0xf7ad('0x18')]===_0xf7ad('0x17');var _0x5c36f0=_0x834de3[_0xf7ad('0x19')];var _0x1d19db=_0x134d5f?0x0:_0x1193be[_0xf7ad('0x1a')];var _0x13ca2f=_0x134d5f?_0x834de3['count']:_0x1193be[_0xf7ad('0x1a')]+_0x1193be[_0xf7ad('0x18')];var _0x53db09;if(_0x13ca2f>=_0x5c36f0){_0x13ca2f=_0x5c36f0;_0x53db09=0xc8;}else{_0x53db09=0xce;}_0x569dd3[_0xf7ad('0x15')](_0x53db09);return _0x569dd3[_0xf7ad('0x1b')](_0xf7ad('0x1c'),_0x1d19db+'-'+_0x13ca2f+'/'+_0x5c36f0)['json'](_0x834de3);}return null;};}function patchUpdates(_0x15e2ad){return function(_0x4c67d0){try{jsonpatch[_0xf7ad('0x1d')](_0x4c67d0,_0x15e2ad,!![]);}catch(_0x4335cb){return BPromise[_0xf7ad('0x1e')](_0x4335cb);}return _0x4c67d0[_0xf7ad('0x1f')]();};}function saveUpdates(_0x4b60f5,_0x5953ae){return function(_0x5f1bb7){if(_0x5f1bb7){return _0x5f1bb7['update'](_0x4b60f5)[_0xf7ad('0x20')](function(_0xf3ef86){return _0xf3ef86;});}return null;};}function removeEntity(_0x42414e,_0x201a0a){return function(_0x42bd55){if(_0x42bd55){return _0x42bd55[_0xf7ad('0x21')]()[_0xf7ad('0x20')](function(){_0x42414e['status'](0xcc)[_0xf7ad('0x14')]();});}};}function handleEntityNotFound(_0x23afc5,_0x4d02c3){return function(_0x494822){if(!_0x494822){_0x23afc5[_0xf7ad('0x13')](0x194);}return _0x494822;};}function handleError(_0x3ac08b,_0x713821){_0x713821=_0x713821||0x1f4;return function(_0x47c148){logger['error'](_0x47c148['stack']);if(_0x47c148[_0xf7ad('0x22')]){delete _0x47c148[_0xf7ad('0x22')];}_0x3ac08b['status'](_0x713821)[_0xf7ad('0x23')](_0x47c148);};}exports[_0xf7ad('0x24')]=function(_0x2742f8,_0x5ec965){var _0x2b2cb0={},_0x164605={},_0x589251={'count':0x0,'rows':[]};var _0x461f9d=_[_0xf7ad('0x25')](db[_0xf7ad('0x26')][_0xf7ad('0x27')],function(_0x359726){return{'name':_0x359726[_0xf7ad('0x28')],'type':_0x359726[_0xf7ad('0x29')]['key']};});_0x164605[_0xf7ad('0x2a')]=_[_0xf7ad('0x25')](_0x461f9d,_0xf7ad('0x22'));_0x164605[_0xf7ad('0x2b')]=_[_0xf7ad('0x2c')](_0x2742f8['query']);_0x164605[_0xf7ad('0x2d')]=_[_0xf7ad('0x2e')](_0x164605[_0xf7ad('0x2a')],_0x164605[_0xf7ad('0x2b')]);_0x2b2cb0[_0xf7ad('0x2f')]=_[_0xf7ad('0x2e')](_0x164605[_0xf7ad('0x2a')],qs[_0xf7ad('0x30')](_0x2742f8[_0xf7ad('0x2b')][_0xf7ad('0x30')]));_0x2b2cb0[_0xf7ad('0x2f')]=_0x2b2cb0[_0xf7ad('0x2f')]['length']?_0x2b2cb0['attributes']:_0x164605[_0xf7ad('0x2a')];if(!_0x2742f8[_0xf7ad('0x2b')]['hasOwnProperty'](_0xf7ad('0x31'))){_0x2b2cb0['limit']=qs[_0xf7ad('0x18')](_0x2742f8[_0xf7ad('0x2b')][_0xf7ad('0x18')]);_0x2b2cb0[_0xf7ad('0x1a')]=qs[_0xf7ad('0x1a')](_0x2742f8[_0xf7ad('0x2b')][_0xf7ad('0x1a')]);}_0x2b2cb0[_0xf7ad('0x32')]=qs[_0xf7ad('0x33')](_0x2742f8[_0xf7ad('0x2b')][_0xf7ad('0x33')]);_0x2b2cb0[_0xf7ad('0x34')]=qs[_0xf7ad('0x2d')](_[_0xf7ad('0x35')](_0x2742f8[_0xf7ad('0x2b')],_0x164605['filters']),_0x461f9d);if(_0x2742f8[_0xf7ad('0x2b')][_0xf7ad('0x36')]){_0x2b2cb0[_0xf7ad('0x34')]=_[_0xf7ad('0x37')](_0x2b2cb0[_0xf7ad('0x34')],{'$or':_['map'](_0x461f9d,function(_0x5eae05){if(_0x5eae05['type']!=='VIRTUAL'){var _0x304af0={};_0x304af0[_0x5eae05[_0xf7ad('0x22')]]={'$like':'%'+_0x2742f8['query'][_0xf7ad('0x36')]+'%'};return _0x304af0;}})});}_0x2b2cb0=_['merge']({},_0x2b2cb0,_0x2742f8[_0xf7ad('0x38')]);var _0x86a281={'where':_0x2b2cb0[_0xf7ad('0x34')]};return db[_0xf7ad('0x26')][_0xf7ad('0x19')](_0x86a281)[_0xf7ad('0x20')](function(_0xf0026c){_0x589251['count']=_0xf0026c;if(_0x2742f8[_0xf7ad('0x2b')]['includeAll']){_0x2b2cb0[_0xf7ad('0x39')]=[{'all':!![]}];}return db[_0xf7ad('0x26')][_0xf7ad('0x3a')](_0x2b2cb0);})[_0xf7ad('0x20')](function(_0x1fa7a9){_0x589251['rows']=_0x1fa7a9;return _0x589251;})[_0xf7ad('0x20')](respondWithFilteredResult(_0x5ec965,_0x2b2cb0))[_0xf7ad('0x3b')](handleError(_0x5ec965,null));};exports[_0xf7ad('0x3c')]=function(_0x105f90,_0x2070bd){var _0x46f091={'raw':![],'where':{'id':_0x105f90['params']['id']}},_0x3ad0a0={};_0x3ad0a0['model']=_[_0xf7ad('0x2c')](db['UserProfileSection'][_0xf7ad('0x27')]);_0x3ad0a0[_0xf7ad('0x2b')]=_[_0xf7ad('0x2c')](_0x105f90['query']);_0x3ad0a0[_0xf7ad('0x2d')]=_[_0xf7ad('0x2e')](_0x3ad0a0['model'],_0x3ad0a0[_0xf7ad('0x2b')]);_0x46f091[_0xf7ad('0x2f')]=_[_0xf7ad('0x2e')](_0x3ad0a0[_0xf7ad('0x2a')],qs[_0xf7ad('0x30')](_0x105f90[_0xf7ad('0x2b')][_0xf7ad('0x30')]));_0x46f091[_0xf7ad('0x2f')]=_0x46f091[_0xf7ad('0x2f')][_0xf7ad('0x3d')]?_0x46f091['attributes']:_0x3ad0a0[_0xf7ad('0x2a')];if(_0x105f90['query'][_0xf7ad('0x3e')]){_0x46f091[_0xf7ad('0x39')]=[{'all':!![]}];}_0x46f091=_[_0xf7ad('0x37')]({},_0x46f091,_0x105f90[_0xf7ad('0x38')]);return db[_0xf7ad('0x26')]['find'](_0x46f091)[_0xf7ad('0x20')](handleEntityNotFound(_0x2070bd,null))[_0xf7ad('0x20')](respondWithResult(_0x2070bd,null))[_0xf7ad('0x3b')](handleError(_0x2070bd,null));};exports[_0xf7ad('0x3f')]=function(_0x269c9b,_0x57d517){return db[_0xf7ad('0x26')]['create'](_0x269c9b['body'],{})['then'](respondWithResult(_0x57d517,0xc9))[_0xf7ad('0x3b')](handleError(_0x57d517,null));};exports[_0xf7ad('0x40')]=function(_0x2306e4,_0x465194){if(_0x2306e4[_0xf7ad('0x41')]['id']){delete _0x2306e4['body']['id'];}return db[_0xf7ad('0x26')][_0xf7ad('0x42')]({'where':{'id':_0x2306e4['params']['id']}})[_0xf7ad('0x20')](handleEntityNotFound(_0x465194,null))[_0xf7ad('0x20')](saveUpdates(_0x2306e4[_0xf7ad('0x41')],null))[_0xf7ad('0x20')](respondWithResult(_0x465194,null))[_0xf7ad('0x3b')](handleError(_0x465194,null));};exports[_0xf7ad('0x21')]=function(_0x4a0166,_0x53f0c7){return db[_0xf7ad('0x26')]['find']({'where':{'id':_0x4a0166[_0xf7ad('0x43')]['id']}})[_0xf7ad('0x20')](handleEntityNotFound(_0x53f0c7,null))[_0xf7ad('0x20')](removeEntity(_0x53f0c7,null))[_0xf7ad('0x3b')](handleError(_0x53f0c7,null));};exports[_0xf7ad('0x44')]=function(_0x2e3a02,_0xf8c181){return db[_0xf7ad('0x26')]['describe']()[_0xf7ad('0x20')](respondWithResult(_0xf8c181,null))[_0xf7ad('0x3b')](handleError(_0xf8c181,null));};
\ No newline at end of file
+var _0x322e=['desk.js','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','update','body','params','destroy','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x322e,0xd4));var _0xe322=function(_0x1785ef,_0x580e18){_0x1785ef=_0x1785ef-0x0;var _0x11aa64=_0x322e[_0x1785ef];return _0x11aa64;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe322('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe322('0x1'));var rp=require(_0xe322('0x2'));var moment=require(_0xe322('0x3'));var BPromise=require(_0xe322('0x4'));var Mustache=require('mustache');var util=require(_0xe322('0x5'));var path=require('path');var sox=require(_0xe322('0x6'));var csv=require(_0xe322('0x7'));var ejs=require(_0xe322('0x8'));var fs=require('fs');var fs_extra=require(_0xe322('0x9'));var _=require('lodash');var squel=require(_0xe322('0xa'));var crypto=require(_0xe322('0xb'));var jsforce=require(_0xe322('0xc'));var deskjs=require(_0xe322('0xd'));var toCsv=require(_0xe322('0x7'));var querystring=require(_0xe322('0xe'));var Papa=require(_0xe322('0xf'));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(_0xe322('0x10'))(_0xe322('0x11'));var utils=require(_0xe322('0x12'));var config=require(_0xe322('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xe322('0x14'))['db'];function respondWithStatusCode(_0x4c7ec5,_0x1c6b32){_0x1c6b32=_0x1c6b32||0xcc;return function(_0x34fda3){if(_0x34fda3){return _0x4c7ec5['sendStatus'](_0x1c6b32);}return _0x4c7ec5[_0xe322('0x15')](_0x1c6b32)[_0xe322('0x16')]();};}function respondWithResult(_0x4a5230,_0x4728fb){_0x4728fb=_0x4728fb||0xc8;return function(_0x2f503e){if(_0x2f503e){return _0x4a5230[_0xe322('0x15')](_0x4728fb)[_0xe322('0x17')](_0x2f503e);}};}function respondWithFilteredResult(_0x447583,_0x4ed5de){return function(_0x504a93){if(_0x504a93){var _0x3c25a0=typeof _0x4ed5de[_0xe322('0x18')]===_0xe322('0x19')&&typeof _0x4ed5de['limit']==='undefined';var _0x3fd688=_0x504a93['count'];var _0x3a484a=_0x3c25a0?0x0:_0x4ed5de[_0xe322('0x18')];var _0x1d1247=_0x3c25a0?_0x504a93[_0xe322('0x1a')]:_0x4ed5de['offset']+_0x4ed5de[_0xe322('0x1b')];var _0xf4957a;if(_0x1d1247>=_0x3fd688){_0x1d1247=_0x3fd688;_0xf4957a=0xc8;}else{_0xf4957a=0xce;}_0x447583[_0xe322('0x15')](_0xf4957a);return _0x447583[_0xe322('0x1c')](_0xe322('0x1d'),_0x3a484a+'-'+_0x1d1247+'/'+_0x3fd688)[_0xe322('0x17')](_0x504a93);}return null;};}function patchUpdates(_0x492448){return function(_0x132554){try{jsonpatch[_0xe322('0x1e')](_0x132554,_0x492448,!![]);}catch(_0x32f18d){return BPromise[_0xe322('0x1f')](_0x32f18d);}return _0x132554[_0xe322('0x20')]();};}function saveUpdates(_0x7f5f74,_0x2cb8ac){return function(_0x18eae4){if(_0x18eae4){return _0x18eae4['update'](_0x7f5f74)[_0xe322('0x21')](function(_0x12a701){return _0x12a701;});}return null;};}function removeEntity(_0xc5e196,_0x44a216){return function(_0x4017d8){if(_0x4017d8){return _0x4017d8['destroy']()[_0xe322('0x21')](function(){_0xc5e196['status'](0xcc)[_0xe322('0x16')]();});}};}function handleEntityNotFound(_0x347a99,_0x54cd4a){return function(_0x2e4770){if(!_0x2e4770){_0x347a99[_0xe322('0x22')](0x194);}return _0x2e4770;};}function handleError(_0x4e537d,_0x2bdafd){_0x2bdafd=_0x2bdafd||0x1f4;return function(_0x2076e8){logger[_0xe322('0x23')](_0x2076e8[_0xe322('0x24')]);if(_0x2076e8[_0xe322('0x25')]){delete _0x2076e8['name'];}_0x4e537d[_0xe322('0x15')](_0x2bdafd)[_0xe322('0x26')](_0x2076e8);};}exports[_0xe322('0x27')]=function(_0x1552a3,_0x2075cf){var _0x21799b={},_0x5ca8aa={},_0x5622be={'count':0x0,'rows':[]};var _0x823de8=_['map'](db[_0xe322('0x28')][_0xe322('0x29')],function(_0x4abc97){return{'name':_0x4abc97[_0xe322('0x2a')],'type':_0x4abc97['type'][_0xe322('0x2b')]};});_0x5ca8aa[_0xe322('0x2c')]=_[_0xe322('0x2d')](_0x823de8,'name');_0x5ca8aa[_0xe322('0x2e')]=_['keys'](_0x1552a3[_0xe322('0x2e')]);_0x5ca8aa[_0xe322('0x2f')]=_[_0xe322('0x30')](_0x5ca8aa[_0xe322('0x2c')],_0x5ca8aa['query']);_0x21799b['attributes']=_['intersection'](_0x5ca8aa[_0xe322('0x2c')],qs[_0xe322('0x31')](_0x1552a3[_0xe322('0x2e')]['fields']));_0x21799b[_0xe322('0x32')]=_0x21799b[_0xe322('0x32')][_0xe322('0x33')]?_0x21799b[_0xe322('0x32')]:_0x5ca8aa[_0xe322('0x2c')];if(!_0x1552a3[_0xe322('0x2e')][_0xe322('0x34')]('nolimit')){_0x21799b[_0xe322('0x1b')]=qs[_0xe322('0x1b')](_0x1552a3['query'][_0xe322('0x1b')]);_0x21799b[_0xe322('0x18')]=qs[_0xe322('0x18')](_0x1552a3[_0xe322('0x2e')]['offset']);}_0x21799b[_0xe322('0x35')]=qs[_0xe322('0x36')](_0x1552a3[_0xe322('0x2e')][_0xe322('0x36')]);_0x21799b[_0xe322('0x37')]=qs[_0xe322('0x2f')](_[_0xe322('0x38')](_0x1552a3[_0xe322('0x2e')],_0x5ca8aa['filters']),_0x823de8);if(_0x1552a3[_0xe322('0x2e')][_0xe322('0x39')]){_0x21799b[_0xe322('0x37')]=_['merge'](_0x21799b[_0xe322('0x37')],{'$or':_[_0xe322('0x2d')](_0x823de8,function(_0x1f445b){if(_0x1f445b['type']!==_0xe322('0x3a')){var _0x2b5e1d={};_0x2b5e1d[_0x1f445b[_0xe322('0x25')]]={'$like':'%'+_0x1552a3['query'][_0xe322('0x39')]+'%'};return _0x2b5e1d;}})});}_0x21799b=_[_0xe322('0x3b')]({},_0x21799b,_0x1552a3[_0xe322('0x3c')]);var _0x2ffd9a={'where':_0x21799b[_0xe322('0x37')]};return db[_0xe322('0x28')]['count'](_0x2ffd9a)[_0xe322('0x21')](function(_0x531361){_0x5622be[_0xe322('0x1a')]=_0x531361;if(_0x1552a3[_0xe322('0x2e')][_0xe322('0x3d')]){_0x21799b[_0xe322('0x3e')]=[{'all':!![]}];}return db[_0xe322('0x28')][_0xe322('0x3f')](_0x21799b);})[_0xe322('0x21')](function(_0x2bdfd0){_0x5622be[_0xe322('0x40')]=_0x2bdfd0;return _0x5622be;})['then'](respondWithFilteredResult(_0x2075cf,_0x21799b))[_0xe322('0x41')](handleError(_0x2075cf,null));};exports[_0xe322('0x42')]=function(_0x285459,_0x337830){var _0x4e3972={'raw':![],'where':{'id':_0x285459['params']['id']}},_0x189daf={};_0x189daf[_0xe322('0x2c')]=_[_0xe322('0x43')](db[_0xe322('0x28')][_0xe322('0x29')]);_0x189daf['query']=_[_0xe322('0x43')](_0x285459[_0xe322('0x2e')]);_0x189daf[_0xe322('0x2f')]=_[_0xe322('0x30')](_0x189daf[_0xe322('0x2c')],_0x189daf['query']);_0x4e3972[_0xe322('0x32')]=_[_0xe322('0x30')](_0x189daf[_0xe322('0x2c')],qs[_0xe322('0x31')](_0x285459[_0xe322('0x2e')][_0xe322('0x31')]));_0x4e3972['attributes']=_0x4e3972['attributes'][_0xe322('0x33')]?_0x4e3972['attributes']:_0x189daf[_0xe322('0x2c')];if(_0x285459[_0xe322('0x2e')]['includeAll']){_0x4e3972[_0xe322('0x3e')]=[{'all':!![]}];}_0x4e3972=_[_0xe322('0x3b')]({},_0x4e3972,_0x285459['options']);return db[_0xe322('0x28')][_0xe322('0x44')](_0x4e3972)[_0xe322('0x21')](handleEntityNotFound(_0x337830,null))[_0xe322('0x21')](respondWithResult(_0x337830,null))['catch'](handleError(_0x337830,null));};exports[_0xe322('0x45')]=function(_0x530d77,_0x2cac5b){return db[_0xe322('0x28')][_0xe322('0x45')](_0x530d77['body'],{})[_0xe322('0x21')](respondWithResult(_0x2cac5b,0xc9))['catch'](handleError(_0x2cac5b,null));};exports[_0xe322('0x46')]=function(_0x58b99f,_0x11b24f){if(_0x58b99f[_0xe322('0x47')]['id']){delete _0x58b99f[_0xe322('0x47')]['id'];}return db[_0xe322('0x28')]['find']({'where':{'id':_0x58b99f[_0xe322('0x48')]['id']}})[_0xe322('0x21')](handleEntityNotFound(_0x11b24f,null))[_0xe322('0x21')](saveUpdates(_0x58b99f[_0xe322('0x47')],null))['then'](respondWithResult(_0x11b24f,null))[_0xe322('0x41')](handleError(_0x11b24f,null));};exports[_0xe322('0x49')]=function(_0x20b0ce,_0x317390){return db['UserProfileSection'][_0xe322('0x44')]({'where':{'id':_0x20b0ce[_0xe322('0x48')]['id']}})[_0xe322('0x21')](handleEntityNotFound(_0x317390,null))[_0xe322('0x21')](removeEntity(_0x317390,null))[_0xe322('0x41')](handleError(_0x317390,null));};exports[_0xe322('0x4a')]=function(_0x37d3be,_0x311985){return db['UserProfileSection'][_0xe322('0x4a')]()['then'](respondWithResult(_0x311985,null))['catch'](handleError(_0x311985,null));};
\ No newline at end of file
index 74336e6..609fa07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc41a=['path','rimraf','../../config/environment','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','bluebird','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc41a,0x19c));var _0xac41=function(_0x249d2b,_0x1417f0){_0x249d2b=_0x249d2b-0x0;var _0x119903=_0xc41a[_0x249d2b];return _0x119903;};'use strict';var _=require(_0xac41('0x0'));var util=require(_0xac41('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xac41('0x2'));var rp=require(_0xac41('0x3'));var fs=require('fs');var path=require(_0xac41('0x4'));var rimraf=require(_0xac41('0x5'));var config=require(_0xac41('0x6'));var attributes=require('./userProfileSection.attributes');module[_0xac41('0x7')]=function(_0x10f23d,_0x355128){return _0x10f23d['define'](_0xac41('0x8'),attributes,{'tableName':_0xac41('0x9'),'paranoid':![],'indexes':[{'name':_0xac41('0xa'),'fields':[_0xac41('0xb'),_0xac41('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd5df=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define'];(function(_0x353ae5,_0x43f8a4){var _0xfb392f=function(_0xdbf88){while(--_0xdbf88){_0x353ae5['push'](_0x353ae5['shift']());}};_0xfb392f(++_0x43f8a4);}(_0xd5df,0xe5));var _0xfd5d=function(_0x70f98,_0x279250){_0x70f98=_0x70f98-0x0;var _0x1c8866=_0xd5df[_0x70f98];return _0x1c8866;};'use strict';var _=require(_0xfd5d('0x0'));var util=require('util');var logger=require(_0xfd5d('0x1'))(_0xfd5d('0x2'));var moment=require(_0xfd5d('0x3'));var BPromise=require(_0xfd5d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd5d('0x5'));var rimraf=require(_0xfd5d('0x6'));var config=require(_0xfd5d('0x7'));var attributes=require(_0xfd5d('0x8'));module[_0xfd5d('0x9')]=function(_0x15f3c0,_0x3b95c5){return _0x15f3c0[_0xfd5d('0xa')](_0xfd5d('0xb'),attributes,{'tableName':_0xfd5d('0xc'),'paranoid':![],'indexes':[{'name':_0xfd5d('0xd'),'fields':[_0xfd5d('0xe'),_0xfd5d('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index cd036d2..a77c487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d0f=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x40db71,_0x5cf042){var _0x3231af=function(_0x262c60){while(--_0x262c60){_0x40db71['push'](_0x40db71['shift']());}};_0x3231af(++_0x5cf042);}(_0x8d0f,0x100));var _0xf8d0=function(_0x9158dd,_0x231983){_0x9158dd=_0x9158dd-0x0;var _0x1468cb=_0x8d0f[_0x9158dd];return _0x1468cb;};'use strict';var _=require(_0xf8d0('0x0'));var util=require(_0xf8d0('0x1'));var moment=require('moment');var BPromise=require(_0xf8d0('0x2'));var rs=require(_0xf8d0('0x3'));var fs=require('fs');var Redis=require(_0xf8d0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf8d0('0x5'));var logger=require('../../config/logger')(_0xf8d0('0x6'));var config=require(_0xf8d0('0x7'));var jayson=require(_0xf8d0('0x8'));var client=jayson[_0xf8d0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bf4a2,_0x1b14d7,_0xbcc645){return new BPromise(function(_0x4a5879,_0xab6038){return client[_0xf8d0('0xa')](_0x1bf4a2,_0xbcc645)[_0xf8d0('0xb')](function(_0x389415){logger[_0xf8d0('0xc')](_0xf8d0('0xd'),_0x1b14d7,_0xf8d0('0xe'));logger[_0xf8d0('0xf')](_0xf8d0('0x10'),_0x1b14d7,'request\x20sent',JSON[_0xf8d0('0x11')](_0x389415));if(_0x389415[_0xf8d0('0x12')]){if(_0x389415[_0xf8d0('0x12')][_0xf8d0('0x13')]===0x1f4){logger[_0xf8d0('0x12')](_0xf8d0('0xd'),_0x1b14d7,_0x389415[_0xf8d0('0x12')][_0xf8d0('0x14')]);return _0xab6038(_0x389415[_0xf8d0('0x12')][_0xf8d0('0x14')]);}logger['error'](_0xf8d0('0xd'),_0x1b14d7,_0x389415[_0xf8d0('0x12')][_0xf8d0('0x14')]);return _0x4a5879(_0x389415['error']['message']);}else{logger[_0xf8d0('0xc')](_0xf8d0('0xd'),_0x1b14d7,_0xf8d0('0xe'));_0x4a5879(_0x389415[_0xf8d0('0x15')]['message']);}})[_0xf8d0('0x16')](function(_0x23a657){logger[_0xf8d0('0x12')](_0xf8d0('0xd'),_0x1b14d7,_0x23a657);_0xab6038(_0x23a657);});});}
\ No newline at end of file
+var _0x22cf=['request','then','info','request\x20sent','debug','error','code','UserProfileSection,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x24399e,_0x106103){var _0x3777ee=function(_0x2a35e7){while(--_0x2a35e7){_0x24399e['push'](_0x24399e['shift']());}};_0x3777ee(++_0x106103);}(_0x22cf,0x8f));var _0xf22c=function(_0x43477f,_0x51a6cb){_0x43477f=_0x43477f-0x0;var _0x56ff27=_0x22cf[_0x43477f];return _0x56ff27;};'use strict';var _=require(_0xf22c('0x0'));var util=require(_0xf22c('0x1'));var moment=require(_0xf22c('0x2'));var BPromise=require(_0xf22c('0x3'));var rs=require(_0xf22c('0x4'));var fs=require('fs');var Redis=require(_0xf22c('0x5'));var db=require(_0xf22c('0x6'))['db'];var utils=require(_0xf22c('0x7'));var logger=require(_0xf22c('0x8'))('rpc');var config=require(_0xf22c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf22c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x133920,_0x3d35f7,_0xadeb7f){return new BPromise(function(_0x3c4a0b,_0x24d5ba){return client[_0xf22c('0xb')](_0x133920,_0xadeb7f)[_0xf22c('0xc')](function(_0x254bfc){logger[_0xf22c('0xd')]('UserProfileSection,\x20%s,\x20%s',_0x3d35f7,_0xf22c('0xe'));logger[_0xf22c('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x3d35f7,'request\x20sent',JSON['stringify'](_0x254bfc));if(_0x254bfc[_0xf22c('0x10')]){if(_0x254bfc[_0xf22c('0x10')][_0xf22c('0x11')]===0x1f4){logger[_0xf22c('0x10')](_0xf22c('0x12'),_0x3d35f7,_0x254bfc[_0xf22c('0x10')][_0xf22c('0x13')]);return _0x24d5ba(_0x254bfc[_0xf22c('0x10')][_0xf22c('0x13')]);}logger['error'](_0xf22c('0x12'),_0x3d35f7,_0x254bfc[_0xf22c('0x10')][_0xf22c('0x13')]);return _0x3c4a0b(_0x254bfc[_0xf22c('0x10')][_0xf22c('0x13')]);}else{logger['info'](_0xf22c('0x12'),_0x3d35f7,'request\x20sent');_0x3c4a0b(_0x254bfc[_0xf22c('0x14')][_0xf22c('0x13')]);}})[_0xf22c('0x15')](function(_0x59de27){logger[_0xf22c('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x3d35f7,_0x59de27);_0x24d5ba(_0x59de27);});});}
\ No newline at end of file
index 24993e8..1a46920 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0xb4ea5b,_0x3e8eb9){var _0x3eeec7=function(_0x2ac5d7){while(--_0x2ac5d7){_0xb4ea5b['push'](_0xb4ea5b['shift']());}};_0x3eeec7(++_0x3e8eb9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x14132b,_0x232a8f){var _0x4696a1=function(_0x4f28d5){while(--_0x4f28d5){_0x14132b['push'](_0x14132b['shift']());}};_0x4696a1(++_0x232a8f);}(_0x70e0,0x17b));var _0x070e=function(_0x9fac00,_0x1f7a3f){_0x9fac00=_0x9fac00-0x0;var _0x1faac9=_0x70e0[_0x9fac00];return _0x1faac9;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
index dcb49c0..187aaff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1abe=['exports','INTEGER'];(function(_0x5744d0,_0x281507){var _0x7f5a59=function(_0x28f67a){while(--_0x28f67a){_0x5744d0['push'](_0x5744d0['shift']());}};_0x7f5a59(++_0x281507);}(_0x1abe,0xc2));var _0xe1ab=function(_0x3f114e,_0x1a9514){_0x3f114e=_0x3f114e-0x0;var _0x20a209=_0x1abe[_0x3f114e];return _0x20a209;};'use strict';var Sequelize=require('sequelize');module[_0xe1ab('0x0')]={'penalty':{'type':Sequelize[_0xe1ab('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x20a5=['sequelize','exports'];(function(_0x4b88fe,_0x139643){var _0x40138c=function(_0x77836){while(--_0x77836){_0x4b88fe['push'](_0x4b88fe['shift']());}};_0x40138c(++_0x139643);}(_0x20a5,0x122));var _0x520a=function(_0x31ad48,_0x57ac87){_0x31ad48=_0x31ad48-0x0;var _0x6dff53=_0x20a5[_0x31ad48];return _0x6dff53;};'use strict';var Sequelize=require(_0x520a('0x0'));module[_0x520a('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index a2b683f..f303c30 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f44=['bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash','util','api','moment'];(function(_0x5a61d9,_0x27add0){var _0x5e1047=function(_0x38b603){while(--_0x38b603){_0x5a61d9['push'](_0x5a61d9['shift']());}};_0x5e1047(++_0x27add0);}(_0x6f44,0x1ea));var _0x46f4=function(_0x7ac9f2,_0x164e43){_0x7ac9f2=_0x7ac9f2-0x0;var _0x23cf10=_0x6f44[_0x7ac9f2];return _0x23cf10;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var logger=require('../../config/logger')(_0x46f4('0x2'));var moment=require(_0x46f4('0x3'));var BPromise=require(_0x46f4('0x4'));var rp=require(_0x46f4('0x5'));var fs=require('fs');var path=require(_0x46f4('0x6'));var rimraf=require(_0x46f4('0x7'));var config=require(_0x46f4('0x8'));var attributes=require(_0x46f4('0x9'));module[_0x46f4('0xa')]=function(_0x57f1a9,_0x169a5a){return _0x57f1a9[_0x46f4('0xb')](_0x46f4('0xc'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x126e=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues'];(function(_0x345e5d,_0x41363b){var _0x447413=function(_0x17f45f){while(--_0x17f45f){_0x345e5d['push'](_0x345e5d['shift']());}};_0x447413(++_0x41363b);}(_0x126e,0x108));var _0xe126=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x126e[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xe126('0x0'));var logger=require(_0xe126('0x1'))(_0xe126('0x2'));var moment=require(_0xe126('0x3'));var BPromise=require(_0xe126('0x4'));var rp=require(_0xe126('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe126('0x6'));var config=require(_0xe126('0x7'));var attributes=require(_0xe126('0x8'));module[_0xe126('0x9')]=function(_0x2f75a4,_0x2162bd){return _0x2f75a4[_0xe126('0xa')]('UserSmsQueue',attributes,{'tableName':_0xe126('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f89e377..79c4066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa115=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x28203e,_0x723dff){var _0x51db1e=function(_0x2e1fcd){while(--_0x2e1fcd){_0x28203e['push'](_0x28203e['shift']());}};_0x51db1e(++_0x723dff);}(_0xa115,0x1cf));var _0x5a11=function(_0x3b0e01,_0x417e4b){_0x3b0e01=_0x3b0e01-0x0;var _0x78e5c=_0xa115[_0x3b0e01];return _0x78e5c;};'use strict';var _=require(_0x5a11('0x0'));var util=require('util');var moment=require(_0x5a11('0x1'));var BPromise=require(_0x5a11('0x2'));var rs=require(_0x5a11('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a11('0x4'))['db'];var utils=require(_0x5a11('0x5'));var logger=require(_0x5a11('0x6'))('rpc');var config=require(_0x5a11('0x7'));var jayson=require(_0x5a11('0x8'));var client=jayson[_0x5a11('0x9')][_0x5a11('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a9eea,_0x42381e,_0x1e953d){return new BPromise(function(_0x17b334,_0x4606f3){return client[_0x5a11('0xb')](_0x1a9eea,_0x1e953d)['then'](function(_0x1d641b){logger['info'](_0x5a11('0xc'),_0x42381e,_0x5a11('0xd'));logger[_0x5a11('0xe')](_0x5a11('0xf'),_0x42381e,_0x5a11('0xd'),JSON['stringify'](_0x1d641b));if(_0x1d641b[_0x5a11('0x10')]){if(_0x1d641b[_0x5a11('0x10')][_0x5a11('0x11')]===0x1f4){logger[_0x5a11('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x42381e,_0x1d641b[_0x5a11('0x10')][_0x5a11('0x12')]);return _0x4606f3(_0x1d641b[_0x5a11('0x10')]['message']);}logger['error'](_0x5a11('0xc'),_0x42381e,_0x1d641b[_0x5a11('0x10')][_0x5a11('0x12')]);return _0x17b334(_0x1d641b['error'][_0x5a11('0x12')]);}else{logger[_0x5a11('0x13')](_0x5a11('0xc'),_0x42381e,_0x5a11('0xd'));_0x17b334(_0x1d641b['result'][_0x5a11('0x12')]);}})[_0x5a11('0x14')](function(_0x51781d){logger[_0x5a11('0x10')](_0x5a11('0xc'),_0x42381e,_0x51781d);_0x4606f3(_0x51781d);});});}
\ No newline at end of file
+var _0x5a32=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x5a32,0x17e));var _0x25a3=function(_0x32b30e,_0x41c850){_0x32b30e=_0x32b30e-0x0;var _0x319f79=_0x5a32[_0x32b30e];return _0x319f79;};'use strict';var _=require('lodash');var util=require(_0x25a3('0x0'));var moment=require(_0x25a3('0x1'));var BPromise=require(_0x25a3('0x2'));var rs=require(_0x25a3('0x3'));var fs=require('fs');var Redis=require(_0x25a3('0x4'));var db=require(_0x25a3('0x5'))['db'];var utils=require(_0x25a3('0x6'));var logger=require(_0x25a3('0x7'))(_0x25a3('0x8'));var config=require(_0x25a3('0x9'));var jayson=require(_0x25a3('0xa'));var client=jayson[_0x25a3('0xb')][_0x25a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x271ade,_0x10c9ad,_0x54e90){return new BPromise(function(_0x4ce66a,_0x4c5475){return client['request'](_0x271ade,_0x54e90)[_0x25a3('0xd')](function(_0x1e1d6e){logger[_0x25a3('0xe')](_0x25a3('0xf'),_0x10c9ad,_0x25a3('0x10'));logger[_0x25a3('0x11')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x10c9ad,_0x25a3('0x10'),JSON[_0x25a3('0x12')](_0x1e1d6e));if(_0x1e1d6e['error']){if(_0x1e1d6e[_0x25a3('0x13')][_0x25a3('0x14')]===0x1f4){logger['error'](_0x25a3('0xf'),_0x10c9ad,_0x1e1d6e['error'][_0x25a3('0x15')]);return _0x4c5475(_0x1e1d6e[_0x25a3('0x13')][_0x25a3('0x15')]);}logger[_0x25a3('0x13')](_0x25a3('0xf'),_0x10c9ad,_0x1e1d6e['error'][_0x25a3('0x15')]);return _0x4ce66a(_0x1e1d6e[_0x25a3('0x13')][_0x25a3('0x15')]);}else{logger['info'](_0x25a3('0xf'),_0x10c9ad,_0x25a3('0x10'));_0x4ce66a(_0x1e1d6e[_0x25a3('0x16')]['message']);}})[_0x25a3('0x17')](function(_0x30b1be){logger[_0x25a3('0x13')]('UserSmsQueue,\x20%s,\x20%s',_0x10c9ad,_0x30b1be);_0x4c5475(_0x30b1be);});});}
\ No newline at end of file
index 71b08e1..7944814 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1ed354,_0x4bb5be){var _0x532757=function(_0x574f3e){while(--_0x574f3e){_0x1ed354['push'](_0x1ed354['shift']());}};_0x532757(++_0x4bb5be);}(_0x9c44,0x178));var _0x49c4=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9c44[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2df376,_0x371b9d){var _0x4e8d8f=function(_0x893814){while(--_0x893814){_0x2df376['push'](_0x2df376['shift']());}};_0x4e8d8f(++_0x371b9d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x273dc5,_0x268a81){_0x273dc5=_0x273dc5-0x0;var _0x46dae7=_0xcb91[_0x273dc5];return _0x46dae7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index c97513a..5e5a87e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a2f=['INTEGER','sequelize'];(function(_0xc830a7,_0x36e8ac){var _0xe0fa75=function(_0x1d747f){while(--_0x1d747f){_0xc830a7['push'](_0xc830a7['shift']());}};_0xe0fa75(++_0x36e8ac);}(_0x0a2f,0x6b));var _0xf0a2=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x0a2f[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0xf0a2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf0a2('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x070c=['exports','INTEGER','sequelize'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x070c,0xfb));var _0xc070=function(_0x23e776,_0x453cf4){_0x23e776=_0x23e776-0x0;var _0x52285a=_0x070c[_0x23e776];return _0x52285a;};'use strict';var Sequelize=require(_0xc070('0x0'));module[_0xc070('0x1')]={'penalty':{'type':Sequelize[_0xc070('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index a8e898c..dccd95e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2977=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','user_has_voice_queues','lodash','../../config/logger','api'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x2977,0xa6));var _0x7297=function(_0x2515d7,_0x418361){_0x2515d7=_0x2515d7-0x0;var _0x4a0014=_0x2977[_0x2515d7];return _0x4a0014;};'use strict';var _=require(_0x7297('0x0'));var util=require('util');var logger=require(_0x7297('0x1'))(_0x7297('0x2'));var moment=require(_0x7297('0x3'));var BPromise=require(_0x7297('0x4'));var rp=require(_0x7297('0x5'));var fs=require('fs');var path=require(_0x7297('0x6'));var rimraf=require(_0x7297('0x7'));var config=require(_0x7297('0x8'));var attributes=require(_0x7297('0x9'));module[_0x7297('0xa')]=function(_0x11412d,_0x11b796){return _0x11412d['define'](_0x7297('0xb'),attributes,{'tableName':_0x7297('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8461=['../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1a4c6a,_0xb966e8){var _0x2675b1=function(_0x109be8){while(--_0x109be8){_0x1a4c6a['push'](_0x1a4c6a['shift']());}};_0x2675b1(++_0xb966e8);}(_0x8461,0x101));var _0x1846=function(_0x24b5bc,_0x2f2d50){_0x24b5bc=_0x24b5bc-0x0;var _0x3f3db7=_0x8461[_0x24b5bc];return _0x3f3db7;};'use strict';var _=require(_0x1846('0x0'));var util=require(_0x1846('0x1'));var logger=require(_0x1846('0x2'))(_0x1846('0x3'));var moment=require(_0x1846('0x4'));var BPromise=require(_0x1846('0x5'));var rp=require(_0x1846('0x6'));var fs=require('fs');var path=require(_0x1846('0x7'));var rimraf=require(_0x1846('0x8'));var config=require(_0x1846('0x9'));var attributes=require('./userVoiceQueue.attributes');module[_0x1846('0xa')]=function(_0x5d8122,_0xe1edeb){return _0x5d8122[_0x1846('0xb')](_0x1846('0xc'),attributes,{'tableName':_0x1846('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c466c46..027f210 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a24=['request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x9a24,0xb7));var _0x49a2=function(_0x58855e,_0x2b2673){_0x58855e=_0x58855e-0x0;var _0x369df2=_0x9a24[_0x58855e];return _0x369df2;};'use strict';var _=require(_0x49a2('0x0'));var util=require(_0x49a2('0x1'));var moment=require(_0x49a2('0x2'));var BPromise=require(_0x49a2('0x3'));var rs=require(_0x49a2('0x4'));var fs=require('fs');var Redis=require(_0x49a2('0x5'));var db=require(_0x49a2('0x6'))['db'];var utils=require(_0x49a2('0x7'));var logger=require('../../config/logger')(_0x49a2('0x8'));var config=require(_0x49a2('0x9'));var jayson=require(_0x49a2('0xa'));var client=jayson[_0x49a2('0xb')][_0x49a2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1c011b,_0x409a5b,_0x48bde7){return new BPromise(function(_0x4cb27f,_0x13f3f5){return client[_0x49a2('0xd')](_0x1c011b,_0x48bde7)[_0x49a2('0xe')](function(_0x4e931c){logger[_0x49a2('0xf')](_0x49a2('0x10'),_0x409a5b,_0x49a2('0x11'));logger[_0x49a2('0x12')](_0x49a2('0x13'),_0x409a5b,_0x49a2('0x11'),JSON[_0x49a2('0x14')](_0x4e931c));if(_0x4e931c[_0x49a2('0x15')]){if(_0x4e931c['error'][_0x49a2('0x16')]===0x1f4){logger['error'](_0x49a2('0x10'),_0x409a5b,_0x4e931c['error'][_0x49a2('0x17')]);return _0x13f3f5(_0x4e931c[_0x49a2('0x15')][_0x49a2('0x17')]);}logger['error'](_0x49a2('0x10'),_0x409a5b,_0x4e931c[_0x49a2('0x15')][_0x49a2('0x17')]);return _0x4cb27f(_0x4e931c[_0x49a2('0x15')]['message']);}else{logger[_0x49a2('0xf')](_0x49a2('0x10'),_0x409a5b,_0x49a2('0x11'));_0x4cb27f(_0x4e931c[_0x49a2('0x18')][_0x49a2('0x17')]);}})['catch'](function(_0xa46e65){logger[_0x49a2('0x15')](_0x49a2('0x10'),_0x409a5b,_0xa46e65);_0x13f3f5(_0xa46e65);});});}
\ No newline at end of file
+var _0xf2ee=['info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf2ee,0x183));var _0xef2e=function(_0x525f5e,_0x2b72c6){_0x525f5e=_0x525f5e-0x0;var _0x2f1aee=_0xf2ee[_0x525f5e];return _0x2f1aee;};'use strict';var _=require(_0xef2e('0x0'));var util=require('util');var moment=require(_0xef2e('0x1'));var BPromise=require(_0xef2e('0x2'));var rs=require(_0xef2e('0x3'));var fs=require('fs');var Redis=require(_0xef2e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xef2e('0x5'));var logger=require(_0xef2e('0x6'))(_0xef2e('0x7'));var config=require(_0xef2e('0x8'));var jayson=require(_0xef2e('0x9'));var client=jayson['client'][_0xef2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xac51ce,_0x30d5ba,_0x5d4745){return new BPromise(function(_0x38cd3d,_0x2f3ea4){return client[_0xef2e('0xb')](_0xac51ce,_0x5d4745)[_0xef2e('0xc')](function(_0x278a75){logger[_0xef2e('0xd')](_0xef2e('0xe'),_0x30d5ba,'request\x20sent');logger['debug']('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x30d5ba,_0xef2e('0xf'),JSON[_0xef2e('0x10')](_0x278a75));if(_0x278a75[_0xef2e('0x11')]){if(_0x278a75['error']['code']===0x1f4){logger[_0xef2e('0x11')](_0xef2e('0xe'),_0x30d5ba,_0x278a75[_0xef2e('0x11')][_0xef2e('0x12')]);return _0x2f3ea4(_0x278a75[_0xef2e('0x11')][_0xef2e('0x12')]);}logger[_0xef2e('0x11')](_0xef2e('0xe'),_0x30d5ba,_0x278a75['error'][_0xef2e('0x12')]);return _0x38cd3d(_0x278a75[_0xef2e('0x11')][_0xef2e('0x12')]);}else{logger['info'](_0xef2e('0xe'),_0x30d5ba,'request\x20sent');_0x38cd3d(_0x278a75['result'][_0xef2e('0x12')]);}})[_0xef2e('0x13')](function(_0x4b60a0){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x30d5ba,_0x4b60a0);_0x2f3ea4(_0x4b60a0);});});}
\ No newline at end of file
index e4faebc..d72b62d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1d6798,_0x2d2ed8){var _0x586118=function(_0x574905){while(--_0x574905){_0x1d6798['push'](_0x1d6798['shift']());}};_0x586118(++_0x2d2ed8);}(_0xe706,0xa3));var _0x6e70=function(_0xe896bf,_0x4f8e5e){_0xe896bf=_0xe896bf-0x0;var _0x4c7a8a=_0xe706[_0xe896bf];return _0x4c7a8a;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x535748,_0x539f51){var _0x3eebf3=function(_0x34fce4){while(--_0x34fce4){_0x535748['push'](_0x535748['shift']());}};_0x3eebf3(++_0x539f51);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3a13cf,_0x478c62){_0x3a13cf=_0x3a13cf-0x0;var _0x4817c=_0xcb91[_0x3a13cf];return _0x4817c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
index 3b91c26..d831dda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b6e=['STRING','queue_interface','sequelize','exports','Required\x20by\x20Asterisk','INTEGER'];(function(_0x3c6891,_0x463935){var _0x4c6fb2=function(_0x45ad07){while(--_0x45ad07){_0x3c6891['push'](_0x3c6891['shift']());}};_0x4c6fb2(++_0x463935);}(_0x3b6e,0xfe));var _0xe3b6=function(_0x2b0f3b,_0x252de9){_0x2b0f3b=_0x2b0f3b-0x0;var _0x2a158a=_0x3b6e[_0x2b0f3b];return _0x2a158a;};'use strict';var Sequelize=require(_0xe3b6('0x0'));module[_0xe3b6('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xe3b6('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xe3b6('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xe3b6('0x4')],'allowNull':![],'unique':'queue_interface','comment':_0xe3b6('0x2')},'VoiceQueueId':{'type':Sequelize[_0xe3b6('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xe3b6('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xe3b6('0x3')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
+var _0xfafb=['STRING','queue_interface','sequelize','INTEGER','Required\x20by\x20Asterisk'];(function(_0x324676,_0xca5800){var _0x366d80=function(_0x3baa7b){while(--_0x3baa7b){_0x324676['push'](_0x324676['shift']());}};_0x366d80(++_0xca5800);}(_0xfafb,0xf2));var _0xbfaf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfafb[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbfaf('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbfaf('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xbfaf('0x2')},'membername':{'type':Sequelize[_0xbfaf('0x3')],'allowNull':![],'comment':_0xbfaf('0x2')},'UserId':{'type':Sequelize[_0xbfaf('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xbfaf('0x3')],'allowNull':![],'unique':_0xbfaf('0x4'),'comment':_0xbfaf('0x2')},'VoiceQueueId':{'type':Sequelize[_0xbfaf('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0xbfaf('0x3')],'allowNull':![],'unique':_0xbfaf('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xbfaf('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xbfaf('0x1')](0xb),'defaultValue':0x0,'comment':_0xbfaf('0x2')}};
\ No newline at end of file
index 885782d..a7d405b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe256=['exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x5b9a30,_0x2b3667){var _0x35f722=function(_0xfb962b){while(--_0xfb962b){_0x5b9a30['push'](_0x5b9a30['shift']());}};_0x35f722(++_0x2b3667);}(_0xe256,0x1cc));var _0x6e25=function(_0x183eb2,_0x5c2112){_0x183eb2=_0x183eb2-0x0;var _0x4bf61b=_0xe256[_0x183eb2];return _0x4bf61b;};'use strict';var EventEmitter=require(_0x6e25('0x0'));var UserVoiceQueueRt=require(_0x6e25('0x1'))['db'][_0x6e25('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x6e25('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6e25('0x4')};function emitEvent(_0x47b3ca){return function(_0x5529de,_0x537b16,_0x316a8b){UserVoiceQueueRtEvents[_0x6e25('0x5')](_0x47b3ca+':'+_0x5529de['id'],_0x5529de);UserVoiceQueueRtEvents[_0x6e25('0x5')](_0x47b3ca,_0x5529de);_0x316a8b(null);};}for(var e in events){if(events[_0x6e25('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x6e25('0x7')](e,emitEvent(event));}}module[_0x6e25('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0xc2b5=['../../mysqldb','UserVoiceQueueRt','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x22665f,_0x3386f2){var _0x49515a=function(_0x230eda){while(--_0x230eda){_0x22665f['push'](_0x22665f['shift']());}};_0x49515a(++_0x3386f2);}(_0xc2b5,0xa1));var _0x5c2b=function(_0x527ed8,_0x3ef7c1){_0x527ed8=_0x527ed8-0x0;var _0x551f3c=_0xc2b5[_0x527ed8];return _0x551f3c;};'use strict';var EventEmitter=require(_0x5c2b('0x0'));var UserVoiceQueueRt=require(_0x5c2b('0x1'))['db'][_0x5c2b('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5c2b('0x3'),'afterUpdate':_0x5c2b('0x4'),'afterDestroy':'remove'};function emitEvent(_0x20d91f){return function(_0x5783e6,_0x58eded,_0x397d22){UserVoiceQueueRtEvents['emit'](_0x20d91f+':'+_0x5783e6['id'],_0x5783e6);UserVoiceQueueRtEvents[_0x5c2b('0x5')](_0x20d91f,_0x5783e6);_0x397d22(null);};}for(var e in events){if(events[_0x5c2b('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x5c2b('0x7')](e,emitEvent(event));}}module[_0x5c2b('0x8')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index bef6e1a..996d78c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f43=['../../config/environment','exports','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0x8f43,0xca));var _0x38f4=function(_0x434f7f,_0x5d810d){_0x434f7f=_0x434f7f-0x0;var _0x9f30f7=_0x8f43[_0x434f7f];return _0x9f30f7;};'use strict';var _=require(_0x38f4('0x0'));var util=require(_0x38f4('0x1'));var logger=require(_0x38f4('0x2'))('api');var moment=require(_0x38f4('0x3'));var BPromise=require(_0x38f4('0x4'));var rp=require(_0x38f4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x38f4('0x6'));var config=require(_0x38f4('0x7'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x38f4('0x8')]=function(_0x319921,_0x1be505){return _0x319921['define'](_0x38f4('0x9'),attributes,{'tableName':_0x38f4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x30e2=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0x30e2,0x1d4));var _0x230e=function(_0x51ae7b,_0xb7a2e){_0x51ae7b=_0x51ae7b-0x0;var _0x3e5125=_0x30e2[_0x51ae7b];return _0x3e5125;};'use strict';var _=require('lodash');var util=require(_0x230e('0x0'));var logger=require(_0x230e('0x1'))(_0x230e('0x2'));var moment=require(_0x230e('0x3'));var BPromise=require(_0x230e('0x4'));var rp=require(_0x230e('0x5'));var fs=require('fs');var path=require(_0x230e('0x6'));var rimraf=require(_0x230e('0x7'));var config=require('../../config/environment');var attributes=require(_0x230e('0x8'));module[_0x230e('0x9')]=function(_0x5eb567,_0x16d847){return _0x5eb567[_0x230e('0xa')](_0x230e('0xb'),attributes,{'tableName':_0x230e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 86058e6..0de241f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa4d=['result','UserVoiceQueueRt','options','raw','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','info','GetVoiceQueueRtPauses','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x95db5e,_0x25b247){var _0x3a3cd3=function(_0x3706a0){while(--_0x3706a0){_0x95db5e['push'](_0x95db5e['shift']());}};_0x3a3cd3(++_0x25b247);}(_0xaa4d,0xb7));var _0xdaa4=function(_0x20049b,_0x369c8b){_0x20049b=_0x20049b-0x0;var _0x35cc83=_0xaa4d[_0x20049b];return _0x35cc83;};'use strict';var _=require(_0xdaa4('0x0'));var util=require(_0xdaa4('0x1'));var moment=require(_0xdaa4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdaa4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdaa4('0x4'))(_0xdaa4('0x5'));var config=require(_0xdaa4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdaa4('0x7')][_0xdaa4('0x8')]({'port':0x232a});config[_0xdaa4('0x9')]=_[_0xdaa4('0xa')](config[_0xdaa4('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xdaa4('0xb'))(new Redis(config[_0xdaa4('0x9')]));require('./userVoiceQueueRt.socket')[_0xdaa4('0xc')](socket);function respondWithRpcPromise(_0xfe90a6,_0x50e141,_0x487a91){return new BPromise(function(_0x5595b6,_0x183b54){return client[_0xdaa4('0xd')](_0xfe90a6,_0x487a91)[_0xdaa4('0xe')](function(_0x4d339a){logger['info'](_0xdaa4('0xf'),_0x50e141,_0xdaa4('0x10'));logger['debug'](_0xdaa4('0x11'),_0x50e141,'request\x20sent',JSON[_0xdaa4('0x12')](_0x4d339a));if(_0x4d339a['error']){if(_0x4d339a[_0xdaa4('0x13')]['code']===0x1f4){logger[_0xdaa4('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x50e141,_0x4d339a[_0xdaa4('0x13')]['message']);return _0x183b54(_0x4d339a[_0xdaa4('0x13')][_0xdaa4('0x14')]);}logger[_0xdaa4('0x13')](_0xdaa4('0xf'),_0x50e141,_0x4d339a[_0xdaa4('0x13')]['message']);return _0x5595b6(_0x4d339a[_0xdaa4('0x13')][_0xdaa4('0x14')]);}else{logger['info'](_0xdaa4('0xf'),_0x50e141,_0xdaa4('0x10'));_0x5595b6(_0x4d339a[_0xdaa4('0x15')][_0xdaa4('0x14')]);}})['catch'](function(_0x57edb7){logger[_0xdaa4('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x50e141,_0x57edb7);_0x183b54(_0x57edb7);});});}exports['GetVoiceQueueRtPauses']=function(_0x1ab8dd){var _0x64a47d=this;return new Promise(function(_0x5100ac,_0x4ea363){return db[_0xdaa4('0x16')]['findAll']({'raw':_0x1ab8dd[_0xdaa4('0x17')]?_0x1ab8dd[_0xdaa4('0x17')][_0xdaa4('0x18')]===undefined?!![]:![]:!![],'where':_0x1ab8dd[_0xdaa4('0x17')]?_0x1ab8dd[_0xdaa4('0x17')][_0xdaa4('0x19')]||null:null,'attributes':[[db['sequelize']['fn'](_0xdaa4('0x1a'),db[_0xdaa4('0x1b')]['fn']('IF',db[_0xdaa4('0x1b')][_0xdaa4('0x1c')](_0xdaa4('0x1d')))),_0xdaa4('0x1e')]]})[_0xdaa4('0xe')](function(_0x3fbc52){logger[_0xdaa4('0x1f')](_0xdaa4('0x20'),_0x1ab8dd);logger['debug'](_0xdaa4('0x20'),_0x1ab8dd,JSON['stringify'](_0x3fbc52));_0x5100ac(_0x3fbc52);})[_0xdaa4('0x21')](function(_0x504d13){logger['error'](_0xdaa4('0x20'),_0x504d13[_0xdaa4('0x14')],_0x1ab8dd);_0x4ea363(_0x64a47d[_0xdaa4('0x13')](0x1f4,_0x504d13[_0xdaa4('0x14')]));});});};
\ No newline at end of file
+var _0xd40d=['request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x66bdb7,_0x428348){var _0x1f152d=function(_0x340c52){while(--_0x340c52){_0x66bdb7['push'](_0x66bdb7['shift']());}};_0x1f152d(++_0x428348);}(_0xd40d,0x96));var _0xdd40=function(_0xb759bb,_0x409095){_0xb759bb=_0xb759bb-0x0;var _0x466205=_0xd40d[_0xb759bb];return _0x466205;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdd40('0x0'));var BPromise=require(_0xdd40('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd40('0x2'));var db=require(_0xdd40('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xdd40('0x4'));var jayson=require(_0xdd40('0x5'));var client=jayson[_0xdd40('0x6')]['http']({'port':0x232a});config['redis']=_[_0xdd40('0x7')](config[_0xdd40('0x8')],{'host':_0xdd40('0x9'),'port':0x18eb});var socket=require(_0xdd40('0xa'))(new Redis(config[_0xdd40('0x8')]));require('./userVoiceQueueRt.socket')['register'](socket);function respondWithRpcPromise(_0x21267b,_0x3be67a,_0x2108d9){return new BPromise(function(_0x2f80f0,_0x1aa8e9){return client[_0xdd40('0xb')](_0x21267b,_0x2108d9)[_0xdd40('0xc')](function(_0x5f0e5c){logger[_0xdd40('0xd')](_0xdd40('0xe'),_0x3be67a,_0xdd40('0xf'));logger[_0xdd40('0x10')](_0xdd40('0x11'),_0x3be67a,_0xdd40('0xf'),JSON['stringify'](_0x5f0e5c));if(_0x5f0e5c[_0xdd40('0x12')]){if(_0x5f0e5c[_0xdd40('0x12')][_0xdd40('0x13')]===0x1f4){logger[_0xdd40('0x12')](_0xdd40('0xe'),_0x3be67a,_0x5f0e5c[_0xdd40('0x12')][_0xdd40('0x14')]);return _0x1aa8e9(_0x5f0e5c[_0xdd40('0x12')][_0xdd40('0x14')]);}logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3be67a,_0x5f0e5c['error'][_0xdd40('0x14')]);return _0x2f80f0(_0x5f0e5c[_0xdd40('0x12')]['message']);}else{logger[_0xdd40('0xd')](_0xdd40('0xe'),_0x3be67a,_0xdd40('0xf'));_0x2f80f0(_0x5f0e5c['result']['message']);}})[_0xdd40('0x15')](function(_0xbb9bba){logger[_0xdd40('0x12')](_0xdd40('0xe'),_0x3be67a,_0xbb9bba);_0x1aa8e9(_0xbb9bba);});});}exports[_0xdd40('0x16')]=function(_0x5b961b){var _0x4fefaa=this;return new Promise(function(_0x2bbbf3,_0x3899de){return db[_0xdd40('0x17')]['findAll']({'raw':_0x5b961b[_0xdd40('0x18')]?_0x5b961b[_0xdd40('0x18')][_0xdd40('0x19')]===undefined?!![]:![]:!![],'where':_0x5b961b[_0xdd40('0x18')]?_0x5b961b[_0xdd40('0x18')][_0xdd40('0x1a')]||null:null,'attributes':[[db[_0xdd40('0x1b')]['fn'](_0xdd40('0x1c'),db['sequelize']['fn']('IF',db[_0xdd40('0x1b')][_0xdd40('0x1d')](_0xdd40('0x1e')))),_0xdd40('0x1f')]]})[_0xdd40('0xc')](function(_0x2efc01){logger['info'](_0xdd40('0x16'),_0x5b961b);logger[_0xdd40('0x10')](_0xdd40('0x16'),_0x5b961b,JSON[_0xdd40('0x20')](_0x2efc01));_0x2bbbf3(_0x2efc01);})[_0xdd40('0x15')](function(_0x25417d){logger[_0xdd40('0x12')]('GetVoiceQueueRtPauses',_0x25417d[_0xdd40('0x14')],_0x5b961b);_0x3899de(_0x4fefaa['error'](0x1f4,_0x25417d[_0xdd40('0x14')]));});});};
\ No newline at end of file
index 1179b46..dd2555e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x379e=['./userVoiceQueueRt.events','emit','removeListener','length','userVoiceQueueRt:'];(function(_0x3cc6b4,_0x58b1aa){var _0x1c07b8=function(_0x156458){while(--_0x156458){_0x3cc6b4['push'](_0x3cc6b4['shift']());}};_0x1c07b8(++_0x58b1aa);}(_0x379e,0x104));var _0xe379=function(_0x2ab05b,_0x30c823){_0x2ab05b=_0x2ab05b-0x0;var _0x3798ba=_0x379e[_0x2ab05b];return _0x3798ba;};'use strict';var UserVoiceQueueRtEvents=require(_0xe379('0x0'));var events=['save','remove','update'];function createListener(_0x594cd4,_0xccbef2){return function(_0x1e24f9){_0xccbef2[_0xe379('0x1')](_0x594cd4,_0x1e24f9);};}function removeListener(_0x3db31a,_0x475418){return function(){UserVoiceQueueRtEvents[_0xe379('0x2')](_0x3db31a,_0x475418);};}exports['register']=function(_0x1f6c46){for(var _0x24221c=0x0,_0x166621=events[_0xe379('0x3')];_0x24221c<_0x166621;_0x24221c++){var _0x22cb37=events[_0x24221c];var _0x5475e7=createListener(_0xe379('0x4')+_0x22cb37,_0x1f6c46);UserVoiceQueueRtEvents['on'](_0x22cb37,_0x5475e7);}};
\ No newline at end of file
+var _0x556b=['save','remove','update','emit','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x172252,_0x34b6ce){var _0x591ec7=function(_0x52f6b9){while(--_0x52f6b9){_0x172252['push'](_0x172252['shift']());}};_0x591ec7(++_0x34b6ce);}(_0x556b,0x1d7));var _0xb556=function(_0x264068,_0x1d7f28){_0x264068=_0x264068-0x0;var _0x51017d=_0x556b[_0x264068];return _0x51017d;};'use strict';var UserVoiceQueueRtEvents=require(_0xb556('0x0'));var events=[_0xb556('0x1'),_0xb556('0x2'),_0xb556('0x3')];function createListener(_0x3589ec,_0x5676d8){return function(_0xdc5b69){_0x5676d8[_0xb556('0x4')](_0x3589ec,_0xdc5b69);};}function removeListener(_0x4202e0,_0x30214e){return function(){UserVoiceQueueRtEvents[_0xb556('0x5')](_0x4202e0,_0x30214e);};}exports['register']=function(_0x4ee766){for(var _0x52669f=0x0,_0x18728e=events[_0xb556('0x6')];_0x52669f<_0x18728e;_0x52669f++){var _0x1cc8a1=events[_0x52669f];var _0x33508d=createListener(_0xb556('0x7')+_0x1cc8a1,_0x4ee766);UserVoiceQueueRtEvents['on'](_0x1cc8a1,_0x33508d);}};
\ No newline at end of file
index 9d9a070..3701326 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x4ff2e4,_0x3b1489){var _0x69c350=function(_0x4de9d3){while(--_0x4de9d3){_0x4ff2e4['push'](_0x4ff2e4['shift']());}};_0x69c350(++_0x3b1489);}(_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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x54ab62,_0x58e021){var _0x2d71b8=function(_0x464463){while(--_0x464463){_0x54ab62['push'](_0x54ab62['shift']());}};_0x2d71b8(++_0x58e021);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
index 5687cd4..9bae65c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe56d=['sequelize'];(function(_0xf26d40,_0x2f4f46){var _0x50b68c=function(_0x10aa58){while(--_0x10aa58){_0xf26d40['push'](_0xf26d40['shift']());}};_0x50b68c(++_0x2f4f46);}(_0xe56d,0x1ea));var _0xde56=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0xe56d[_0x284a61];return _0x220e3c;};'use strict';var Sequelize=require(_0xde56('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf008=['INTEGER','sequelize','exports'];(function(_0x2973c6,_0x4c6cb2){var _0x2284ff=function(_0xf6b32f){while(--_0xf6b32f){_0x2973c6['push'](_0x2973c6['shift']());}};_0x2284ff(++_0x4c6cb2);}(_0xf008,0x193));var _0x8f00=function(_0x14d0a8,_0x24b627){_0x14d0a8=_0x14d0a8-0x0;var _0x3e8a94=_0xf008[_0x14d0a8];return _0x3e8a94;};'use strict';var Sequelize=require(_0x8f00('0x0'));module[_0x8f00('0x1')]={'penalty':{'type':Sequelize[_0x8f00('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 90a4b6b..0353683 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x910e=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','UserWhatsappQueue','user_has_whatsapp_queues'];(function(_0x46a5dd,_0xa92214){var _0x17646d=function(_0x51c777){while(--_0x51c777){_0x46a5dd['push'](_0x46a5dd['shift']());}};_0x17646d(++_0xa92214);}(_0x910e,0x6e));var _0xe910=function(_0x3d8307,_0x23ca98){_0x3d8307=_0x3d8307-0x0;var _0x15954a=_0x910e[_0x3d8307];return _0x15954a;};'use strict';var _=require('lodash');var util=require(_0xe910('0x0'));var logger=require(_0xe910('0x1'))(_0xe910('0x2'));var moment=require(_0xe910('0x3'));var BPromise=require('bluebird');var rp=require(_0xe910('0x4'));var fs=require('fs');var path=require(_0xe910('0x5'));var rimraf=require('rimraf');var config=require(_0xe910('0x6'));var attributes=require(_0xe910('0x7'));module['exports']=function(_0x54145a,_0x2bae32){return _0x54145a['define'](_0xe910('0x8'),attributes,{'tableName':_0xe910('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9336=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x41ff8d,_0x2d1ce9){var _0x5bc742=function(_0x2fbe47){while(--_0x2fbe47){_0x41ff8d['push'](_0x41ff8d['shift']());}};_0x5bc742(++_0x2d1ce9);}(_0x9336,0x147));var _0x6933=function(_0x14a664,_0x526e16){_0x14a664=_0x14a664-0x0;var _0x13728e=_0x9336[_0x14a664];return _0x13728e;};'use strict';var _=require(_0x6933('0x0'));var util=require('util');var logger=require(_0x6933('0x1'))(_0x6933('0x2'));var moment=require('moment');var BPromise=require(_0x6933('0x3'));var rp=require(_0x6933('0x4'));var fs=require('fs');var path=require(_0x6933('0x5'));var rimraf=require(_0x6933('0x6'));var config=require(_0x6933('0x7'));var attributes=require(_0x6933('0x8'));module[_0x6933('0x9')]=function(_0x31fcc6,_0x1eecd1){return _0x31fcc6[_0x6933('0xa')](_0x6933('0xb'),attributes,{'tableName':_0x6933('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index aa196f3..2e63e53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x05b1=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x05b1,0x1b1));var _0x105b=function(_0x5682d8,_0x4d9a72){_0x5682d8=_0x5682d8-0x0;var _0x485708=_0x05b1[_0x5682d8];return _0x485708;};'use strict';var _=require(_0x105b('0x0'));var util=require(_0x105b('0x1'));var moment=require(_0x105b('0x2'));var BPromise=require(_0x105b('0x3'));var rs=require(_0x105b('0x4'));var fs=require('fs');var Redis=require(_0x105b('0x5'));var db=require(_0x105b('0x6'))['db'];var utils=require(_0x105b('0x7'));var logger=require(_0x105b('0x8'))('rpc');var config=require(_0x105b('0x9'));var jayson=require(_0x105b('0xa'));var client=jayson[_0x105b('0xb')][_0x105b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18d872,_0x213986,_0x340b11){return new BPromise(function(_0x4f9ce2,_0x542e67){return client[_0x105b('0xd')](_0x18d872,_0x340b11)['then'](function(_0x2385fe){logger[_0x105b('0xe')](_0x105b('0xf'),_0x213986,_0x105b('0x10'));logger[_0x105b('0x11')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x213986,_0x105b('0x10'),JSON[_0x105b('0x12')](_0x2385fe));if(_0x2385fe['error']){if(_0x2385fe['error'][_0x105b('0x13')]===0x1f4){logger['error'](_0x105b('0xf'),_0x213986,_0x2385fe[_0x105b('0x14')][_0x105b('0x15')]);return _0x542e67(_0x2385fe[_0x105b('0x14')][_0x105b('0x15')]);}logger[_0x105b('0x14')](_0x105b('0xf'),_0x213986,_0x2385fe['error'][_0x105b('0x15')]);return _0x4f9ce2(_0x2385fe[_0x105b('0x14')]['message']);}else{logger[_0x105b('0xe')](_0x105b('0xf'),_0x213986,_0x105b('0x10'));_0x4f9ce2(_0x2385fe[_0x105b('0x16')][_0x105b('0x15')]);}})[_0x105b('0x17')](function(_0x3fee53){logger[_0x105b('0x14')](_0x105b('0xf'),_0x213986,_0x3fee53);_0x542e67(_0x3fee53);});});}
\ No newline at end of file
+var _0xe8b7=['debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xe8b7,0x1a9));var _0x7e8b=function(_0x5b972d,_0x1d40d9){_0x5b972d=_0x5b972d-0x0;var _0x4e0593=_0xe8b7[_0x5b972d];return _0x4e0593;};'use strict';var _=require(_0x7e8b('0x0'));var util=require(_0x7e8b('0x1'));var moment=require(_0x7e8b('0x2'));var BPromise=require(_0x7e8b('0x3'));var rs=require(_0x7e8b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e8b('0x5'))['db'];var utils=require(_0x7e8b('0x6'));var logger=require(_0x7e8b('0x7'))(_0x7e8b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7e8b('0x9')][_0x7e8b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38d53a,_0x3efe87,_0x8d9993){return new BPromise(function(_0x119c39,_0x22b7da){return client[_0x7e8b('0xb')](_0x38d53a,_0x8d9993)['then'](function(_0xed369a){logger[_0x7e8b('0xc')](_0x7e8b('0xd'),_0x3efe87,_0x7e8b('0xe'));logger[_0x7e8b('0xf')](_0x7e8b('0x10'),_0x3efe87,_0x7e8b('0xe'),JSON['stringify'](_0xed369a));if(_0xed369a['error']){if(_0xed369a['error'][_0x7e8b('0x11')]===0x1f4){logger[_0x7e8b('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x3efe87,_0xed369a['error'][_0x7e8b('0x13')]);return _0x22b7da(_0xed369a[_0x7e8b('0x12')][_0x7e8b('0x13')]);}logger[_0x7e8b('0x12')](_0x7e8b('0xd'),_0x3efe87,_0xed369a[_0x7e8b('0x12')][_0x7e8b('0x13')]);return _0x119c39(_0xed369a['error'][_0x7e8b('0x13')]);}else{logger[_0x7e8b('0xc')](_0x7e8b('0xd'),_0x3efe87,_0x7e8b('0xe'));_0x119c39(_0xed369a[_0x7e8b('0x14')][_0x7e8b('0x13')]);}})[_0x7e8b('0x15')](function(_0x5ec0db){logger[_0x7e8b('0x12')](_0x7e8b('0xd'),_0x3efe87,_0x5ec0db);_0x22b7da(_0x5ec0db);});});}
\ No newline at end of file
index aaa94a0..8db3463 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04d0=['fs-extra','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0x1d5714,_0x2fa5f4){var _0x1b620e=function(_0x9a0a73){while(--_0x9a0a73){_0x1d5714['push'](_0x1d5714['shift']());}};_0x1b620e(++_0x2fa5f4);}(_0x04d0,0x10a));var _0x004d=function(_0x370b2b,_0x826dcc){_0x370b2b=_0x370b2b-0x0;var _0x138f29=_0x04d0[_0x370b2b];return _0x138f29;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x004d('0x0'));var timeout=require(_0x004d('0x1'));var express=require(_0x004d('0x2'));var router=express[_0x004d('0x3')]();var fs_extra=require(_0x004d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x004d('0x5'));var controller=require('./variable.controller');router[_0x004d('0x6')]('/',auth[_0x004d('0x7')](),controller['index']);router[_0x004d('0x6')](_0x004d('0x8'),auth['isAuthenticated'](),controller[_0x004d('0x9')]);router['post']('/',auth[_0x004d('0x7')](),controller[_0x004d('0xa')]);router[_0x004d('0xb')]('/:id',auth[_0x004d('0x7')](),controller[_0x004d('0xc')]);router['delete'](_0x004d('0x8'),auth['isAuthenticated'](),controller[_0x004d('0xd')]);module[_0x004d('0xe')]=router;
\ No newline at end of file
+var _0xb647=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','exports','multer','util'];(function(_0x141de6,_0x861ced){var _0x25eebd=function(_0x342fdd){while(--_0x342fdd){_0x141de6['push'](_0x141de6['shift']());}};_0x25eebd(++_0x861ced);}(_0xb647,0xdb));var _0x7b64=function(_0x1cfc6b,_0x54e241){_0x1cfc6b=_0x1cfc6b-0x0;var _0x3f5a1b=_0xb647[_0x1cfc6b];return _0x3f5a1b;};'use strict';var multer=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var path=require(_0x7b64('0x2'));var timeout=require(_0x7b64('0x3'));var express=require(_0x7b64('0x4'));var router=express[_0x7b64('0x5')]();var fs_extra=require(_0x7b64('0x6'));var auth=require(_0x7b64('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7b64('0x8'));var controller=require('./variable.controller');router[_0x7b64('0x9')]('/',auth[_0x7b64('0xa')](),controller[_0x7b64('0xb')]);router[_0x7b64('0x9')](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller[_0x7b64('0xd')]);router[_0x7b64('0xe')]('/',auth[_0x7b64('0xa')](),controller['create']);router[_0x7b64('0xf')]('/:id',auth[_0x7b64('0xa')](),controller['update']);router['delete'](_0x7b64('0xc'),auth[_0x7b64('0xa')](),controller['destroy']);module[_0x7b64('0x10')]=router;
\ No newline at end of file
index 6b2b0e4..71736a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45aa=['name','exports','STRING'];(function(_0x599c94,_0x464f0e){var _0x34e215=function(_0x36295a){while(--_0x36295a){_0x599c94['push'](_0x599c94['shift']());}};_0x34e215(++_0x464f0e);}(_0x45aa,0xdf));var _0xa45a=function(_0x1cd056,_0x3c53f4){_0x1cd056=_0x1cd056-0x0;var _0x4b051a=_0x45aa[_0x1cd056];return _0x4b051a;};'use strict';var Sequelize=require('sequelize');module[_0xa45a('0x0')]={'name':{'type':Sequelize[_0xa45a('0x1')],'unique':_0xa45a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa45a('0x1')]}};
\ No newline at end of file
+var _0x6a1d=['sequelize','exports','STRING'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x6a1d,0xe1));var _0xd6a1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6a1d[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0xd6a1('0x0'));module[_0xd6a1('0x1')]={'name':{'type':Sequelize[_0xd6a1('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd6a1('0x2')]}};
\ No newline at end of file
index 58c9518..d9c4085 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4528=['fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','set','apply','reject','save','update','then','destroy','get','Variables','error','stack','name','index','map','Variable','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir'];(function(_0x1df959,_0x39a1ab){var _0x501899=function(_0x2e105e){while(--_0x2e105e){_0x1df959['push'](_0x1df959['shift']());}};_0x501899(++_0x39a1ab);}(_0x4528,0x192));var _0x8452=function(_0x5f3671,_0x389548){_0x5f3671=_0x5f3671-0x0;var _0x3f36e3=_0x4528[_0x5f3671];return _0x3f36e3;};'use strict';var emlformat=require(_0x8452('0x0'));var rimraf=require(_0x8452('0x1'));var zipdir=require(_0x8452('0x2'));var jsonpatch=require(_0x8452('0x3'));var rp=require(_0x8452('0x4'));var moment=require(_0x8452('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8452('0x6'));var path=require(_0x8452('0x7'));var sox=require(_0x8452('0x8'));var csv=require('to-csv');var ejs=require(_0x8452('0x9'));var fs=require('fs');var fs_extra=require(_0x8452('0xa'));var _=require(_0x8452('0xb'));var squel=require(_0x8452('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8452('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8452('0xe'));var Papa=require(_0x8452('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8452('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8452('0x11'))('api');var utils=require(_0x8452('0x12'));var config=require(_0x8452('0x13'));var licenseUtil=require(_0x8452('0x14'));var db=require(_0x8452('0x15'))['db'];function respondWithStatusCode(_0x1b367f,_0x4a479a){_0x4a479a=_0x4a479a||0xcc;return function(_0x2f5c95){if(_0x2f5c95){return _0x1b367f[_0x8452('0x16')](_0x4a479a);}return _0x1b367f[_0x8452('0x17')](_0x4a479a)[_0x8452('0x18')]();};}function respondWithResult(_0x249c98,_0x2d2011){_0x2d2011=_0x2d2011||0xc8;return function(_0x16133e){if(_0x16133e){return _0x249c98['status'](_0x2d2011)[_0x8452('0x19')](_0x16133e);}};}function respondWithFilteredResult(_0x3d28ca,_0x45a0b9){return function(_0x40d724){if(_0x40d724){var _0xb6f79a=typeof _0x45a0b9['offset']==='undefined'&&typeof _0x45a0b9[_0x8452('0x1a')]==='undefined';var _0x3483d5=_0x40d724[_0x8452('0x1b')];var _0x22d0ee=_0xb6f79a?0x0:_0x45a0b9['offset'];var _0x48c164=_0xb6f79a?_0x40d724[_0x8452('0x1b')]:_0x45a0b9['offset']+_0x45a0b9['limit'];var _0xc97492;if(_0x48c164>=_0x3483d5){_0x48c164=_0x3483d5;_0xc97492=0xc8;}else{_0xc97492=0xce;}_0x3d28ca[_0x8452('0x17')](_0xc97492);return _0x3d28ca[_0x8452('0x1c')]('Content-Range',_0x22d0ee+'-'+_0x48c164+'/'+_0x3483d5)['json'](_0x40d724);}return null;};}function patchUpdates(_0x211331){return function(_0x2312f6){try{jsonpatch[_0x8452('0x1d')](_0x2312f6,_0x211331,!![]);}catch(_0x16e4ff){return BPromise[_0x8452('0x1e')](_0x16e4ff);}return _0x2312f6[_0x8452('0x1f')]();};}function saveUpdates(_0x4198dc,_0x49e4af){return function(_0x20b7c9){if(_0x20b7c9){return _0x20b7c9[_0x8452('0x20')](_0x4198dc)[_0x8452('0x21')](function(_0x2c8343){return _0x2c8343;});}return null;};}function removeEntity(_0x2cb04c,_0x835ab9){return function(_0x47ad45){if(_0x47ad45){return _0x47ad45[_0x8452('0x22')]()[_0x8452('0x21')](function(){var _0x32c837=_0x47ad45[_0x8452('0x23')]({'plain':!![]});var _0x22f221=_0x8452('0x24');return db['UserProfileResource'][_0x8452('0x22')]({'where':{'type':_0x22f221,'resourceId':_0x32c837['id']}})[_0x8452('0x21')](function(){return _0x47ad45;});})[_0x8452('0x21')](function(){_0x2cb04c[_0x8452('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c9274,_0x4fda63){return function(_0x253aed){if(!_0x253aed){_0x4c9274[_0x8452('0x16')](0x194);}return _0x253aed;};}function handleError(_0x457795,_0x4cf736){_0x4cf736=_0x4cf736||0x1f4;return function(_0x70c2e2){logger[_0x8452('0x25')](_0x70c2e2[_0x8452('0x26')]);if(_0x70c2e2[_0x8452('0x27')]){delete _0x70c2e2[_0x8452('0x27')];}_0x457795['status'](_0x4cf736)['send'](_0x70c2e2);};}exports[_0x8452('0x28')]=function(_0x317668,_0x331e89){var _0x419262={},_0x2c1698={},_0x3b56d6={'count':0x0,'rows':[]};var _0x116cd0=_[_0x8452('0x29')](db[_0x8452('0x2a')][_0x8452('0x2b')],function(_0x18d3ca){return{'name':_0x18d3ca['fieldName'],'type':_0x18d3ca['type'][_0x8452('0x2c')]};});_0x2c1698[_0x8452('0x2d')]=_[_0x8452('0x29')](_0x116cd0,_0x8452('0x27'));_0x2c1698[_0x8452('0x2e')]=_[_0x8452('0x2f')](_0x317668[_0x8452('0x2e')]);_0x2c1698['filters']=_[_0x8452('0x30')](_0x2c1698[_0x8452('0x2d')],_0x2c1698[_0x8452('0x2e')]);_0x419262[_0x8452('0x31')]=_[_0x8452('0x30')](_0x2c1698[_0x8452('0x2d')],qs[_0x8452('0x32')](_0x317668['query']['fields']));_0x419262[_0x8452('0x31')]=_0x419262[_0x8452('0x31')][_0x8452('0x33')]?_0x419262[_0x8452('0x31')]:_0x2c1698['model'];if(!_0x317668[_0x8452('0x2e')][_0x8452('0x34')](_0x8452('0x35'))){_0x419262[_0x8452('0x1a')]=qs['limit'](_0x317668['query'][_0x8452('0x1a')]);_0x419262[_0x8452('0x36')]=qs[_0x8452('0x36')](_0x317668[_0x8452('0x2e')][_0x8452('0x36')]);}_0x419262[_0x8452('0x37')]=qs[_0x8452('0x38')](_0x317668[_0x8452('0x2e')]['sort']);_0x419262[_0x8452('0x39')]=qs[_0x8452('0x3a')](_[_0x8452('0x3b')](_0x317668['query'],_0x2c1698['filters']),_0x116cd0);if(_0x317668[_0x8452('0x2e')][_0x8452('0x3c')]){_0x419262[_0x8452('0x39')]=_[_0x8452('0x3d')](_0x419262[_0x8452('0x39')],{'$or':_['map'](_0x116cd0,function(_0x1a5ffb){if(_0x1a5ffb[_0x8452('0x3e')]!=='VIRTUAL'){var _0x2985cc={};_0x2985cc[_0x1a5ffb['name']]={'$like':'%'+_0x317668[_0x8452('0x2e')][_0x8452('0x3c')]+'%'};return _0x2985cc;}})});}_0x419262=_[_0x8452('0x3d')]({},_0x419262,_0x317668['options']);var _0x3af7a6={'where':_0x419262['where']};return db['Variable'][_0x8452('0x1b')](_0x3af7a6)[_0x8452('0x21')](function(_0x11c12f){_0x3b56d6[_0x8452('0x1b')]=_0x11c12f;if(_0x317668[_0x8452('0x2e')][_0x8452('0x3f')]){_0x419262[_0x8452('0x40')]=[{'all':!![]}];}return db[_0x8452('0x2a')][_0x8452('0x41')](_0x419262);})['then'](function(_0x3edab){_0x3b56d6[_0x8452('0x42')]=_0x3edab;return _0x3b56d6;})[_0x8452('0x21')](respondWithFilteredResult(_0x331e89,_0x419262))[_0x8452('0x43')](handleError(_0x331e89,null));};exports[_0x8452('0x44')]=function(_0x59178a,_0x335c8b){var _0x37da6e={'raw':!![],'where':{'id':_0x59178a[_0x8452('0x45')]['id']}},_0x2c8f28={};_0x2c8f28[_0x8452('0x2d')]=_[_0x8452('0x2f')](db[_0x8452('0x2a')][_0x8452('0x2b')]);_0x2c8f28[_0x8452('0x2e')]=_[_0x8452('0x2f')](_0x59178a[_0x8452('0x2e')]);_0x2c8f28['filters']=_[_0x8452('0x30')](_0x2c8f28[_0x8452('0x2d')],_0x2c8f28[_0x8452('0x2e')]);_0x37da6e[_0x8452('0x31')]=_['intersection'](_0x2c8f28[_0x8452('0x2d')],qs[_0x8452('0x32')](_0x59178a[_0x8452('0x2e')][_0x8452('0x32')]));_0x37da6e[_0x8452('0x31')]=_0x37da6e[_0x8452('0x31')][_0x8452('0x33')]?_0x37da6e['attributes']:_0x2c8f28[_0x8452('0x2d')];if(_0x59178a[_0x8452('0x2e')][_0x8452('0x3f')]){_0x37da6e[_0x8452('0x40')]=[{'all':!![]}];}_0x37da6e=_[_0x8452('0x3d')]({},_0x37da6e,_0x59178a[_0x8452('0x46')]);return db[_0x8452('0x2a')][_0x8452('0x47')](_0x37da6e)[_0x8452('0x21')](handleEntityNotFound(_0x335c8b,null))[_0x8452('0x21')](respondWithResult(_0x335c8b,null))['catch'](handleError(_0x335c8b,null));};exports[_0x8452('0x48')]=function(_0xa83f9a,_0x337221){return db['Variable']['create'](_0xa83f9a[_0x8452('0x49')],{})[_0x8452('0x21')](function(_0x1c3b4a){var _0x1a986a=_0xa83f9a[_0x8452('0x4a')][_0x8452('0x23')]({'plain':!![]});if(!_0x1a986a)throw new Error(_0x8452('0x4b'));if(_0x1a986a[_0x8452('0x4c')]===_0x8452('0x4a')){var _0x220148=_0x1c3b4a[_0x8452('0x23')]({'plain':!![]});var _0x460e86=_0x8452('0x24');return db[_0x8452('0x4d')][_0x8452('0x47')]({'where':{'name':_0x460e86,'userProfileId':_0x1a986a[_0x8452('0x4e')]},'raw':!![]})['then'](function(_0x1f8cd8){if(_0x1f8cd8&&_0x1f8cd8['autoAssociation']===0x0){return db[_0x8452('0x4f')][_0x8452('0x48')]({'name':_0x220148[_0x8452('0x27')],'resourceId':_0x220148['id'],'type':_0x1f8cd8[_0x8452('0x27')],'sectionId':_0x1f8cd8['id']},{})[_0x8452('0x21')](function(){return _0x1c3b4a;});}else{return _0x1c3b4a;}})['catch'](function(_0x4c0660){logger['error'](_0x8452('0x50'),_0x4c0660);throw _0x4c0660;});}return _0x1c3b4a;})[_0x8452('0x21')](respondWithResult(_0x337221,0xc9))[_0x8452('0x43')](handleError(_0x337221,null));};exports[_0x8452('0x20')]=function(_0x26dd64,_0xc83fdf){if(_0x26dd64[_0x8452('0x49')]['id']){delete _0x26dd64[_0x8452('0x49')]['id'];}return db['Variable'][_0x8452('0x47')]({'where':{'id':_0x26dd64[_0x8452('0x45')]['id']}})[_0x8452('0x21')](handleEntityNotFound(_0xc83fdf,null))['then'](saveUpdates(_0x26dd64['body'],null))[_0x8452('0x21')](respondWithResult(_0xc83fdf,null))[_0x8452('0x43')](handleError(_0xc83fdf,null));};exports['destroy']=function(_0xba9a48,_0xd2b1be){return db['Variable'][_0x8452('0x47')]({'where':{'id':_0xba9a48[_0x8452('0x45')]['id']}})['then'](handleEntityNotFound(_0xd2b1be,null))['then'](removeEntity(_0xd2b1be,null))[_0x8452('0x43')](handleError(_0xd2b1be,null));};
\ No newline at end of file
+var _0x7935=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','error','stack','name','index','Variable','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','count','includeAll','include','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment'];(function(_0x808f62,_0x1ca1e4){var _0x77297b=function(_0x2bafe7){while(--_0x2bafe7){_0x808f62['push'](_0x808f62['shift']());}};_0x77297b(++_0x1ca1e4);}(_0x7935,0xdb));var _0x5793=function(_0x59bdce,_0x32766f){_0x59bdce=_0x59bdce-0x0;var _0x17f3b6=_0x7935[_0x59bdce];return _0x17f3b6;};'use strict';var emlformat=require(_0x5793('0x0'));var rimraf=require(_0x5793('0x1'));var zipdir=require(_0x5793('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5793('0x3'));var moment=require(_0x5793('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5793('0x5'));var util=require(_0x5793('0x6'));var path=require(_0x5793('0x7'));var sox=require(_0x5793('0x8'));var csv=require(_0x5793('0x9'));var ejs=require(_0x5793('0xa'));var fs=require('fs');var fs_extra=require(_0x5793('0xb'));var _=require(_0x5793('0xc'));var squel=require(_0x5793('0xd'));var crypto=require(_0x5793('0xe'));var jsforce=require(_0x5793('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5793('0x10'));var Papa=require(_0x5793('0x11'));var Redis=require(_0x5793('0x12'));var authService=require(_0x5793('0x13'));var qs=require(_0x5793('0x14'));var as=require(_0x5793('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5793('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x5793('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5793('0x18'))['db'];function respondWithStatusCode(_0x5a26ed,_0x4230eb){_0x4230eb=_0x4230eb||0xcc;return function(_0x582601){if(_0x582601){return _0x5a26ed[_0x5793('0x19')](_0x4230eb);}return _0x5a26ed['status'](_0x4230eb)[_0x5793('0x1a')]();};}function respondWithResult(_0xb985dd,_0x13f2fe){_0x13f2fe=_0x13f2fe||0xc8;return function(_0x3819b7){if(_0x3819b7){return _0xb985dd[_0x5793('0x1b')](_0x13f2fe)[_0x5793('0x1c')](_0x3819b7);}};}function respondWithFilteredResult(_0x3dfb18,_0x308ef7){return function(_0x27cc80){if(_0x27cc80){var _0x4d90c5=typeof _0x308ef7[_0x5793('0x1d')]===_0x5793('0x1e')&&typeof _0x308ef7[_0x5793('0x1f')]===_0x5793('0x1e');var _0x4f719d=_0x27cc80['count'];var _0x2ca11a=_0x4d90c5?0x0:_0x308ef7[_0x5793('0x1d')];var _0x432a33=_0x4d90c5?_0x27cc80['count']:_0x308ef7[_0x5793('0x1d')]+_0x308ef7[_0x5793('0x1f')];var _0x55376b;if(_0x432a33>=_0x4f719d){_0x432a33=_0x4f719d;_0x55376b=0xc8;}else{_0x55376b=0xce;}_0x3dfb18[_0x5793('0x1b')](_0x55376b);return _0x3dfb18[_0x5793('0x20')](_0x5793('0x21'),_0x2ca11a+'-'+_0x432a33+'/'+_0x4f719d)[_0x5793('0x1c')](_0x27cc80);}return null;};}function patchUpdates(_0x21182d){return function(_0x35802a){try{jsonpatch[_0x5793('0x22')](_0x35802a,_0x21182d,!![]);}catch(_0x306cd4){return BPromise[_0x5793('0x23')](_0x306cd4);}return _0x35802a[_0x5793('0x24')]();};}function saveUpdates(_0x4ec2ad,_0x4e83c1){return function(_0x203985){if(_0x203985){return _0x203985[_0x5793('0x25')](_0x4ec2ad)[_0x5793('0x26')](function(_0xfcc981){return _0xfcc981;});}return null;};}function removeEntity(_0x34079e,_0x4dc9ac){return function(_0xdf38b9){if(_0xdf38b9){return _0xdf38b9[_0x5793('0x27')]()[_0x5793('0x26')](function(){var _0x102481=_0xdf38b9[_0x5793('0x28')]({'plain':!![]});var _0x134dcc=_0x5793('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x134dcc,'resourceId':_0x102481['id']}})[_0x5793('0x26')](function(){return _0xdf38b9;});})[_0x5793('0x26')](function(){_0x34079e['status'](0xcc)[_0x5793('0x1a')]();});}};}function handleEntityNotFound(_0x2801ef,_0x309f73){return function(_0x27e681){if(!_0x27e681){_0x2801ef[_0x5793('0x19')](0x194);}return _0x27e681;};}function handleError(_0x4c385e,_0x4ea2de){_0x4ea2de=_0x4ea2de||0x1f4;return function(_0x1c6e16){logger[_0x5793('0x2a')](_0x1c6e16[_0x5793('0x2b')]);if(_0x1c6e16[_0x5793('0x2c')]){delete _0x1c6e16[_0x5793('0x2c')];}_0x4c385e[_0x5793('0x1b')](_0x4ea2de)['send'](_0x1c6e16);};}exports[_0x5793('0x2d')]=function(_0x54f9ff,_0x174eed){var _0x3d098b={},_0x2bebd3={},_0x255f19={'count':0x0,'rows':[]};var _0x187668=_['map'](db[_0x5793('0x2e')][_0x5793('0x2f')],function(_0x511419){return{'name':_0x511419[_0x5793('0x30')],'type':_0x511419['type'][_0x5793('0x31')]};});_0x2bebd3[_0x5793('0x32')]=_[_0x5793('0x33')](_0x187668,_0x5793('0x2c'));_0x2bebd3[_0x5793('0x34')]=_['keys'](_0x54f9ff[_0x5793('0x34')]);_0x2bebd3[_0x5793('0x35')]=_[_0x5793('0x36')](_0x2bebd3[_0x5793('0x32')],_0x2bebd3[_0x5793('0x34')]);_0x3d098b[_0x5793('0x37')]=_[_0x5793('0x36')](_0x2bebd3[_0x5793('0x32')],qs['fields'](_0x54f9ff[_0x5793('0x34')][_0x5793('0x38')]));_0x3d098b[_0x5793('0x37')]=_0x3d098b['attributes'][_0x5793('0x39')]?_0x3d098b['attributes']:_0x2bebd3[_0x5793('0x32')];if(!_0x54f9ff[_0x5793('0x34')][_0x5793('0x3a')](_0x5793('0x3b'))){_0x3d098b[_0x5793('0x1f')]=qs['limit'](_0x54f9ff[_0x5793('0x34')]['limit']);_0x3d098b[_0x5793('0x1d')]=qs[_0x5793('0x1d')](_0x54f9ff[_0x5793('0x34')][_0x5793('0x1d')]);}_0x3d098b['order']=qs['sort'](_0x54f9ff[_0x5793('0x34')]['sort']);_0x3d098b[_0x5793('0x3c')]=qs[_0x5793('0x35')](_['pick'](_0x54f9ff['query'],_0x2bebd3[_0x5793('0x35')]),_0x187668);if(_0x54f9ff[_0x5793('0x34')][_0x5793('0x3d')]){_0x3d098b[_0x5793('0x3c')]=_[_0x5793('0x3e')](_0x3d098b['where'],{'$or':_[_0x5793('0x33')](_0x187668,function(_0x25bdfb){if(_0x25bdfb['type']!==_0x5793('0x3f')){var _0x517fe2={};_0x517fe2[_0x25bdfb[_0x5793('0x2c')]]={'$like':'%'+_0x54f9ff[_0x5793('0x34')][_0x5793('0x3d')]+'%'};return _0x517fe2;}})});}_0x3d098b=_[_0x5793('0x3e')]({},_0x3d098b,_0x54f9ff[_0x5793('0x40')]);var _0x448de5={'where':_0x3d098b[_0x5793('0x3c')]};return db['Variable']['count'](_0x448de5)['then'](function(_0x4182ce){_0x255f19[_0x5793('0x41')]=_0x4182ce;if(_0x54f9ff[_0x5793('0x34')][_0x5793('0x42')]){_0x3d098b[_0x5793('0x43')]=[{'all':!![]}];}return db[_0x5793('0x2e')]['findAll'](_0x3d098b);})[_0x5793('0x26')](function(_0x100c6b){_0x255f19['rows']=_0x100c6b;return _0x255f19;})[_0x5793('0x26')](respondWithFilteredResult(_0x174eed,_0x3d098b))[_0x5793('0x44')](handleError(_0x174eed,null));};exports[_0x5793('0x45')]=function(_0x524ad0,_0x4c2c87){var _0x381221={'raw':!![],'where':{'id':_0x524ad0[_0x5793('0x46')]['id']}},_0x4bce67={};_0x4bce67[_0x5793('0x32')]=_[_0x5793('0x47')](db[_0x5793('0x2e')][_0x5793('0x2f')]);_0x4bce67['query']=_['keys'](_0x524ad0[_0x5793('0x34')]);_0x4bce67[_0x5793('0x35')]=_['intersection'](_0x4bce67[_0x5793('0x32')],_0x4bce67['query']);_0x381221[_0x5793('0x37')]=_[_0x5793('0x36')](_0x4bce67[_0x5793('0x32')],qs[_0x5793('0x38')](_0x524ad0[_0x5793('0x34')][_0x5793('0x38')]));_0x381221[_0x5793('0x37')]=_0x381221['attributes'][_0x5793('0x39')]?_0x381221[_0x5793('0x37')]:_0x4bce67[_0x5793('0x32')];if(_0x524ad0[_0x5793('0x34')][_0x5793('0x42')]){_0x381221['include']=[{'all':!![]}];}_0x381221=_[_0x5793('0x3e')]({},_0x381221,_0x524ad0['options']);return db['Variable']['find'](_0x381221)[_0x5793('0x26')](handleEntityNotFound(_0x4c2c87,null))[_0x5793('0x26')](respondWithResult(_0x4c2c87,null))['catch'](handleError(_0x4c2c87,null));};exports[_0x5793('0x48')]=function(_0x4911be,_0x22729){return db[_0x5793('0x2e')][_0x5793('0x48')](_0x4911be[_0x5793('0x49')],{})[_0x5793('0x26')](function(_0x450fe6){var _0x2d75f8=_0x4911be[_0x5793('0x4a')][_0x5793('0x28')]({'plain':!![]});if(!_0x2d75f8)throw new Error(_0x5793('0x4b'));if(_0x2d75f8[_0x5793('0x4c')]===_0x5793('0x4a')){var _0x2ec200=_0x450fe6['get']({'plain':!![]});var _0x3f68ac=_0x5793('0x29');return db[_0x5793('0x4d')][_0x5793('0x4e')]({'where':{'name':_0x3f68ac,'userProfileId':_0x2d75f8['userProfileId']},'raw':!![]})[_0x5793('0x26')](function(_0x286780){if(_0x286780&&_0x286780[_0x5793('0x4f')]===0x0){return db[_0x5793('0x50')]['create']({'name':_0x2ec200[_0x5793('0x2c')],'resourceId':_0x2ec200['id'],'type':_0x286780[_0x5793('0x2c')],'sectionId':_0x286780['id']},{})[_0x5793('0x26')](function(){return _0x450fe6;});}else{return _0x450fe6;}})[_0x5793('0x44')](function(_0x5e28c6){logger[_0x5793('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e28c6);throw _0x5e28c6;});}return _0x450fe6;})[_0x5793('0x26')](respondWithResult(_0x22729,0xc9))[_0x5793('0x44')](handleError(_0x22729,null));};exports['update']=function(_0x47bb16,_0x94e45a){if(_0x47bb16[_0x5793('0x49')]['id']){delete _0x47bb16[_0x5793('0x49')]['id'];}return db['Variable'][_0x5793('0x4e')]({'where':{'id':_0x47bb16[_0x5793('0x46')]['id']}})[_0x5793('0x26')](handleEntityNotFound(_0x94e45a,null))[_0x5793('0x26')](saveUpdates(_0x47bb16[_0x5793('0x49')],null))['then'](respondWithResult(_0x94e45a,null))['catch'](handleError(_0x94e45a,null));};exports[_0x5793('0x27')]=function(_0x4a6f8f,_0x41cf1f){return db[_0x5793('0x2e')][_0x5793('0x4e')]({'where':{'id':_0x4a6f8f[_0x5793('0x46')]['id']}})[_0x5793('0x26')](handleEntityNotFound(_0x41cf1f,null))[_0x5793('0x26')](removeEntity(_0x41cf1f,null))[_0x5793('0x44')](handleError(_0x41cf1f,null));};
\ No newline at end of file
index 79178cb..f07227c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b17=['./variable.attributes','exports','define','Variable','tools_variables','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x59f646,_0x21f26d){var _0x4472e8=function(_0x1c1a8d){while(--_0x1c1a8d){_0x59f646['push'](_0x59f646['shift']());}};_0x4472e8(++_0x21f26d);}(_0x7b17,0x149));var _0x77b1=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x7b17[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x77b1('0x0'));var util=require(_0x77b1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x77b1('0x2'));var BPromise=require(_0x77b1('0x3'));var rp=require(_0x77b1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77b1('0x5'));var config=require(_0x77b1('0x6'));var attributes=require(_0x77b1('0x7'));module[_0x77b1('0x8')]=function(_0xa8d274,_0x33abe9){return _0xa8d274[_0x77b1('0x9')](_0x77b1('0xa'),attributes,{'tableName':_0x77b1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4be=['tools_variables','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x4b964f,_0x688bee){var _0x4a8f98=function(_0x911a0d){while(--_0x911a0d){_0x4b964f['push'](_0x4b964f['shift']());}};_0x4a8f98(++_0x688bee);}(_0xf4be,0xe5));var _0xef4b=function(_0x7df7d9,_0x1c435e){_0x7df7d9=_0x7df7d9-0x0;var _0x316304=_0xf4be[_0x7df7d9];return _0x316304;};'use strict';var _=require(_0xef4b('0x0'));var util=require(_0xef4b('0x1'));var logger=require(_0xef4b('0x2'))(_0xef4b('0x3'));var moment=require(_0xef4b('0x4'));var BPromise=require(_0xef4b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef4b('0x6'));var rimraf=require(_0xef4b('0x7'));var config=require(_0xef4b('0x8'));var attributes=require('./variable.attributes');module[_0xef4b('0x9')]=function(_0x1b11bd,_0x2a486a){return _0x1b11bd[_0xef4b('0xa')]('Variable',attributes,{'tableName':_0xef4b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 91f2ab4..0401625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['debug','Variable,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowVariable','options','raw','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xa41a,0x6b));var _0xaa41=function(_0x15d471,_0x372dd0){_0x15d471=_0x15d471-0x0;var _0x8b9184=_0xa41a[_0x15d471];return _0x8b9184;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});}exports[_0xaa41('0x17')]=function(_0xd20ddf){var _0x29efe5=this;return new Promise(function(_0x46e6d3,_0x150ddf){return db['Variable']['find']({'raw':_0xd20ddf[_0xaa41('0x18')]?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x19')]===undefined?!![]:![]:!![],'where':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1a')]||null:null,'attributes':_0xd20ddf['options']?_0xd20ddf['options'][_0xaa41('0x1b')]||null:null,'include':_0xd20ddf['options']?_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0xd20ddf[_0xaa41('0x18')][_0xaa41('0x1c')],function(_0x4eb01f){return{'model':db[_0x4eb01f[_0xaa41('0x1e')]],'as':_0x4eb01f['as'],'attributes':_0x4eb01f[_0xaa41('0x1b')],'include':_0x4eb01f[_0xaa41('0x1c')]?_[_0xaa41('0x1d')](_0x4eb01f[_0xaa41('0x1c')],function(_0xa1f024){return{'model':db[_0xa1f024['model']],'as':_0xa1f024['as'],'attributes':_0xa1f024['attributes'],'include':_0xa1f024[_0xaa41('0x1c')]?_['map'](_0xa1f024['include'],function(_0x12e362){return{'model':db[_0x12e362['model']],'as':_0x12e362['as'],'attributes':_0x12e362['attributes']};}):[]};}):[]};}):[]:[]})[_0xaa41('0xd')](function(_0x9c8c21){logger[_0xaa41('0xe')](_0xaa41('0x17'),_0xd20ddf);logger[_0xaa41('0x11')](_0xaa41('0x17'),_0xd20ddf,JSON['stringify'](_0x9c8c21));_0x46e6d3(_0x9c8c21);})[_0xaa41('0x16')](function(_0x1f0275){logger[_0xaa41('0x13')](_0xaa41('0x17'),_0x1f0275[_0xaa41('0x14')],_0xd20ddf);_0x150ddf(_0x29efe5[_0xaa41('0x13')](0x1f4,_0x1f0275[_0xaa41('0x14')]));});});};
\ No newline at end of file
+var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x3b1705,_0x17bf2e){var _0x5157a3=function(_0x30f700){while(--_0x30f700){_0x3b1705['push'](_0x3b1705['shift']());}};_0x5157a3(++_0x17bf2e);}(_0x3e74,0x175));var _0x43e7=function(_0x2e4f4f,_0x1d5bcb){_0x2e4f4f=_0x2e4f4f-0x0;var _0x3cad47=_0x3e74[_0x2e4f4f];return _0x3cad47;};'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']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\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')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=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 73f470e..0a9ea8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b26=['/migrations','exports','../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','canUpdate','/reset','reset','/pull','pull','/restart','restart'];(function(_0x235f9e,_0x39c039){var _0x1e66b3=function(_0x14fd01){while(--_0x14fd01){_0x235f9e['push'](_0x235f9e['shift']());}};_0x1e66b3(++_0x39c039);}(_0x1b26,0xd4));var _0x61b2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x1b26[_0x2be8c2];return _0x97f531;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x61b2('0x0'));var controller=require(_0x61b2('0x1'));router[_0x61b2('0x2')]('/',controller['index']);router[_0x61b2('0x2')](_0x61b2('0x3'),auth[_0x61b2('0x4')](),auth[_0x61b2('0x5')](),controller['fetch']);router[_0x61b2('0x2')](_0x61b2('0x6'),auth[_0x61b2('0x4')](),auth['canUpdate'](),controller[_0x61b2('0x7')]);router[_0x61b2('0x2')](_0x61b2('0x8'),auth[_0x61b2('0x4')](),auth[_0x61b2('0x5')](),controller[_0x61b2('0x9')]);router[_0x61b2('0x2')](_0x61b2('0xa'),auth[_0x61b2('0x4')](),controller[_0x61b2('0xb')]);router[_0x61b2('0x2')](_0x61b2('0xc'),controller['migrations']);module[_0x61b2('0xd')]=router;
\ No newline at end of file
+var _0xcf1a=['reset','/pull','pull','/restart','restart','/migrations','migrations','exports','express','./version.controller','get','index','isAuthenticated','fetch','/reset','canUpdate'];(function(_0x1c0380,_0x15175d){var _0x35ec3e=function(_0x579193){while(--_0x579193){_0x1c0380['push'](_0x1c0380['shift']());}};_0x35ec3e(++_0x15175d);}(_0xcf1a,0xc8));var _0xacf1=function(_0x5091c0,_0x10cab3){_0x5091c0=_0x5091c0-0x0;var _0x2d065f=_0xcf1a[_0x5091c0];return _0x2d065f;};'use strict';var express=require(_0xacf1('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xacf1('0x1'));router[_0xacf1('0x2')]('/',controller[_0xacf1('0x3')]);router[_0xacf1('0x2')]('/fetch',auth[_0xacf1('0x4')](),auth['canUpdate'](),controller[_0xacf1('0x5')]);router[_0xacf1('0x2')](_0xacf1('0x6'),auth['isAuthenticated'](),auth[_0xacf1('0x7')](),controller[_0xacf1('0x8')]);router[_0xacf1('0x2')](_0xacf1('0x9'),auth[_0xacf1('0x4')](),auth['canUpdate'](),controller[_0xacf1('0xa')]);router[_0xacf1('0x2')](_0xacf1('0xb'),auth[_0xacf1('0x4')](),controller[_0xacf1('0xc')]);router['get'](_0xacf1('0xd'),controller[_0xacf1('0xe')]);module[_0xacf1('0xf')]=router;
\ No newline at end of file
index c80bbc4..d3abd20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd866=['../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server','length','replace','.js','push','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','then','Database\x20migrated\x20successfully\x20from\x20version\x20','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/environment'];(function(_0xc8966a,_0x19753d){var _0x2a3be4=function(_0x5caf4e){while(--_0x5caf4e){_0xc8966a['push'](_0xc8966a['shift']());}};_0x2a3be4(++_0x19753d);}(_0xd866,0x15c));var _0x6d86=function(_0x31dd7e,_0x72d5da){_0x31dd7e=_0x31dd7e-0x0;var _0x2a6bfd=_0xd866[_0x31dd7e];return _0x2a6bfd;};'use strict';var Umzug=require(_0x6d86('0x0'));var path=require(_0x6d86('0x1'));var fs=require('fs');var _=require(_0x6d86('0x2'));var pkginfo=require(_0x6d86('0x3'))(module,_0x6d86('0x4'));var compareVersions=require(_0x6d86('0x5'));var exec=require('child_process')[_0x6d86('0x6')];var db=require(_0x6d86('0x7'))['db'];var config=require(_0x6d86('0x8'));var pm2=require(_0x6d86('0x9'));var logger=require(_0x6d86('0xa'))(_0x6d86('0xb'));var git=require(_0x6d86('0xc'))(config[_0x6d86('0xd')]);exports[_0x6d86('0xe')]=function(_0x55a987,_0xa9aa4f){var _0x1f03d7={'current':module[_0x6d86('0xf')][_0x6d86('0x4')],'phonebar':0x2};if(_0x55a987[_0x6d86('0x10')]&&_0x55a987['query'][_0x6d86('0x11')]){return git[_0x6d86('0x12')]()[_0x6d86('0x13')](function(_0x5b46fb,_0x51f1fe){_0x1f03d7[_0x6d86('0x11')]=(_0x5b46fb?module[_0x6d86('0xf')][_0x6d86('0x4')]:_0x51f1fe[_0x6d86('0x11')])||_0x6d86('0x14');return _0xa9aa4f[_0x6d86('0x15')](0xc8)['json'](_0x1f03d7);});}else{return _0xa9aa4f[_0x6d86('0x15')](0xc8)[_0x6d86('0x16')](_0x1f03d7);}};exports[_0x6d86('0x12')]=function(_0x54ba15,_0x745b4b){return git[_0x6d86('0x12')](['origin',_0x6d86('0x17')],function(_0x31d329){if(_0x31d329){logger[_0x6d86('0x18')](_0x31d329);return _0x745b4b['status'](0x1f4)['json'](_0x31d329);}logger[_0x6d86('0x19')](_0x6d86('0x1a'));return _0x745b4b[_0x6d86('0x15')](0xc8)[_0x6d86('0x16')]({'output':_0x6d86('0x1b')});});};exports[_0x6d86('0x1c')]=function(_0x1ecdaa,_0xcffa21){return git[_0x6d86('0x1c')]([_0x6d86('0x1d'),_0x6d86('0x1e')],function(_0x244d7b){if(_0x244d7b){logger['error'](_0x244d7b);return _0xcffa21[_0x6d86('0x15')](0x1f4)[_0x6d86('0x16')](_0x244d7b);}logger[_0x6d86('0x19')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0xcffa21['status'](0xc8)[_0x6d86('0x16')]({'output':_0x6d86('0x1f')});});};exports[_0x6d86('0x20')]=function(_0x5d4b6c,_0x438fde){exec(_0x6d86('0x21'),function(_0x3f6e7a,_0x4d3e63,_0x48352f){logger[_0x6d86('0x19')](_0x4d3e63);logger[_0x6d86('0x19')](_0x48352f);if(_0x3f6e7a){logger['error'](_0x3f6e7a);return _0x438fde[_0x6d86('0x15')](0x1f4)[_0x6d86('0x16')](_0x3f6e7a);}return _0x438fde[_0x6d86('0x15')](0xc8)[_0x6d86('0x16')]({'output':_0x4d3e63});});};exports[_0x6d86('0x22')]=function(_0x4facf4,_0x599160){return pm2[_0x6d86('0x22')]('motion2')['then'](function(_0x206be6){logger[_0x6d86('0x19')](_0x6d86('0x23'),_0x206be6);return _0x599160['status'](0xc8)['json']({'output':_0x6d86('0x24')});})[_0x6d86('0x25')](function(_0x46cdd1){logger['error'](_0x46cdd1);return _0x599160[_0x6d86('0x15')](0x1f4)[_0x6d86('0x16')](_0x46cdd1);});};exports[_0x6d86('0x26')]=function(_0x9e7485,_0x38cf65){var _0x4ecefd=fs['readdirSync'](path[_0x6d86('0x27')](config[_0x6d86('0xd')],_0x6d86('0x28'),_0x6d86('0x26')));var _0xfef90e=[];for(var _0x350d1a=0x0;_0x350d1a<_0x4ecefd[_0x6d86('0x29')];_0x350d1a++){var _0x594808=_0x4ecefd[_0x350d1a][_0x6d86('0x2a')](_0x6d86('0x2b'),'');if(compareVersions(module[_0x6d86('0xf')][_0x6d86('0x4')],_0x594808)===-0x1){_0xfef90e[_0x6d86('0x2c')](_0x594808);}}if(_0xfef90e[_0x6d86('0x29')]){var _0x130ed7=_0xfef90e['sort'](compareVersions);var _0x183683=new Umzug({'storage':_0x6d86('0x2d'),'storageOptions':{'model':db[_0x6d86('0x2e')],'modelName':_0x6d86('0x2e'),'columnName':_0x6d86('0x4')},'migrations':{'params':[db[_0x6d86('0x2d')]['getQueryInterface'](),db[_0x6d86('0x2d')]['constructor'],function(){throw new Error(_0x6d86('0x2f'));}],'path':path['join'](config[_0x6d86('0xd')],'server',_0x6d86('0x26')),'pattern':/\.js$/}});_0x183683['up']({'migrations':_['map'](_0x130ed7,function(_0x481903){return _0x481903+_0x6d86('0x2b');})})[_0x6d86('0x30')](function(){return _0x38cf65[_0x6d86('0x15')](0xc8)[_0x6d86('0x16')]({'output':_0x6d86('0x31')+module[_0x6d86('0xf')]['version']+'\x20to\x20'+_['last'](_0x130ed7),'migrations':_['join'](_0x130ed7)});})[_0x6d86('0x25')](function(_0x260281){if(_0x260281 instanceof db[_0x6d86('0x2d')]['UniqueConstraintError']){return _0x38cf65[_0x6d86('0x15')](0xc8)['json']({'output':_0x6d86('0x32')});}else{return _0x38cf65[_0x6d86('0x15')](0x1f4)[_0x6d86('0x16')](_0x260281);}});}else{return _0x38cf65[_0x6d86('0x15')](0xc8)[_0x6d86('0x16')]({'output':_0x6d86('0x32')});}};
\ No newline at end of file
+var _0xf87a=['compare-versions','exec','../../mysqldb','../../config/pm2','root','index','exports','query','latest','fetch','status','json','origin','error','info','git\x20fetch','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version'];(function(_0xafd776,_0x4ed97d){var _0x52e1e6=function(_0x364831){while(--_0x364831){_0xafd776['push'](_0xafd776['shift']());}};_0x52e1e6(++_0x4ed97d);}(_0xf87a,0x15a));var _0xaf87=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xf87a[_0x502c7d];return _0x30b7ed;};'use strict';var Umzug=require(_0xaf87('0x0'));var path=require(_0xaf87('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xaf87('0x2'))(module,_0xaf87('0x3'));var compareVersions=require(_0xaf87('0x4'));var exec=require('child_process')[_0xaf87('0x5')];var db=require(_0xaf87('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xaf87('0x7'));var logger=require('../../config/logger')('update');var git=require('simple-git')(config[_0xaf87('0x8')]);exports[_0xaf87('0x9')]=function(_0x447608,_0x43ece2){var _0x33431b={'current':module[_0xaf87('0xa')][_0xaf87('0x3')],'phonebar':0x2};if(_0x447608[_0xaf87('0xb')]&&_0x447608[_0xaf87('0xb')][_0xaf87('0xc')]){return git[_0xaf87('0xd')]()['tags'](function(_0x2a803d,_0x346ee7){_0x33431b[_0xaf87('0xc')]=(_0x2a803d?module[_0xaf87('0xa')][_0xaf87('0x3')]:_0x346ee7[_0xaf87('0xc')])||'2.0.0';return _0x43ece2[_0xaf87('0xe')](0xc8)['json'](_0x33431b);});}else{return _0x43ece2[_0xaf87('0xe')](0xc8)[_0xaf87('0xf')](_0x33431b);}};exports[_0xaf87('0xd')]=function(_0x488f1f,_0x5cdd1c){return git['fetch']([_0xaf87('0x10'),'master'],function(_0x58a371){if(_0x58a371){logger[_0xaf87('0x11')](_0x58a371);return _0x5cdd1c[_0xaf87('0xe')](0x1f4)[_0xaf87('0xf')](_0x58a371);}logger[_0xaf87('0x12')](_0xaf87('0x13'));return _0x5cdd1c[_0xaf87('0xe')](0xc8)[_0xaf87('0xf')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xaf87('0x14')]=function(_0xe9f6e3,_0x5e5015){return git[_0xaf87('0x14')]([_0xaf87('0x15'),'FETCH_HEAD'],function(_0x14bd6d){if(_0x14bd6d){logger[_0xaf87('0x11')](_0x14bd6d);return _0x5e5015[_0xaf87('0xe')](0x1f4)[_0xaf87('0xf')](_0x14bd6d);}logger[_0xaf87('0x12')](_0xaf87('0x16'));return _0x5e5015[_0xaf87('0xe')](0xc8)[_0xaf87('0xf')]({'output':'git\x20reset\x20--hard'});});};exports[_0xaf87('0x17')]=function(_0x58eddd,_0x14f497){exec(_0xaf87('0x18'),function(_0x211d15,_0x589af6,_0x541d08){logger['info'](_0x589af6);logger[_0xaf87('0x12')](_0x541d08);if(_0x211d15){logger[_0xaf87('0x11')](_0x211d15);return _0x14f497['status'](0x1f4)[_0xaf87('0xf')](_0x211d15);}return _0x14f497[_0xaf87('0xe')](0xc8)['json']({'output':_0x589af6});});};exports[_0xaf87('0x19')]=function(_0x46c054,_0x437cf8){return pm2[_0xaf87('0x19')](_0xaf87('0x1a'))[_0xaf87('0x1b')](function(_0xa4019c){logger[_0xaf87('0x12')](_0xaf87('0x1c'),_0xa4019c);return _0x437cf8[_0xaf87('0xe')](0xc8)[_0xaf87('0xf')]({'output':_0xaf87('0x1d')});})[_0xaf87('0x1e')](function(_0x405670){logger[_0xaf87('0x11')](_0x405670);return _0x437cf8[_0xaf87('0xe')](0x1f4)[_0xaf87('0xf')](_0x405670);});};exports[_0xaf87('0x1f')]=function(_0x1f3878,_0x481c76){var _0x54cf24=fs[_0xaf87('0x20')](path[_0xaf87('0x21')](config[_0xaf87('0x8')],_0xaf87('0x22'),'migrations'));var _0x25fb54=[];for(var _0x3affd5=0x0;_0x3affd5<_0x54cf24[_0xaf87('0x23')];_0x3affd5++){var _0xbabf6e=_0x54cf24[_0x3affd5][_0xaf87('0x24')](_0xaf87('0x25'),'');if(compareVersions(module[_0xaf87('0xa')]['version'],_0xbabf6e)===-0x1){_0x25fb54['push'](_0xbabf6e);}}if(_0x25fb54[_0xaf87('0x23')]){var _0x7dc2ae=_0x25fb54[_0xaf87('0x26')](compareVersions);var _0x440e09=new Umzug({'storage':_0xaf87('0x27'),'storageOptions':{'model':db[_0xaf87('0x28')],'modelName':_0xaf87('0x28'),'columnName':'version'},'migrations':{'params':[db[_0xaf87('0x27')][_0xaf87('0x29')](),db[_0xaf87('0x27')][_0xaf87('0x2a')],function(){throw new Error(_0xaf87('0x2b'));}],'path':path[_0xaf87('0x21')](config[_0xaf87('0x8')],_0xaf87('0x22'),_0xaf87('0x1f')),'pattern':/\.js$/}});_0x440e09['up']({'migrations':_[_0xaf87('0x2c')](_0x7dc2ae,function(_0x315b29){return _0x315b29+_0xaf87('0x25');})})[_0xaf87('0x1b')](function(){return _0x481c76[_0xaf87('0xe')](0xc8)['json']({'output':_0xaf87('0x2d')+module[_0xaf87('0xa')][_0xaf87('0x3')]+_0xaf87('0x2e')+_[_0xaf87('0x2f')](_0x7dc2ae),'migrations':_[_0xaf87('0x21')](_0x7dc2ae)});})[_0xaf87('0x1e')](function(_0x342bb6){if(_0x342bb6 instanceof db[_0xaf87('0x27')][_0xaf87('0x30')]){return _0x481c76[_0xaf87('0xe')](0xc8)[_0xaf87('0xf')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x481c76['status'](0x1f4)[_0xaf87('0xf')](_0x342bb6);}});}else{return _0x481c76['status'](0xc8)[_0xaf87('0xf')]({'output':_0xaf87('0x31')});}};
\ No newline at end of file
index dbb2d8b..67370f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84b0=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','post','create','/:id','delete','destroy','multer'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x84b0,0x7d));var _0x084b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x84b0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x084b('0x0'));var util=require('util');var path=require(_0x084b('0x1'));var timeout=require(_0x084b('0x2'));var express=require(_0x084b('0x3'));var router=express['Router']();var fs_extra=require(_0x084b('0x4'));var auth=require(_0x084b('0x5'));var interaction=require(_0x084b('0x6'));var config=require(_0x084b('0x7'));var controller=require('./voiceAgentReport.controller');router[_0x084b('0x8')]('/',auth[_0x084b('0x9')](),controller[_0x084b('0xa')]);router[_0x084b('0x8')]('/describe',auth[_0x084b('0x9')](),controller[_0x084b('0xb')]);router[_0x084b('0x8')]('/:id',auth[_0x084b('0x9')](),controller[_0x084b('0xc')]);router[_0x084b('0xd')]('/',auth[_0x084b('0x9')](),controller[_0x084b('0xe')]);router['put'](_0x084b('0xf'),auth[_0x084b('0x9')](),controller['update']);router[_0x084b('0x10')](_0x084b('0xf'),auth['isAuthenticated'](),controller[_0x084b('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xec48=['fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','util','path','express','Router'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xec48,0x7a));var _0x8ec4=function(_0x1d760b,_0x47f9fe){_0x1d760b=_0x1d760b-0x0;var _0x18fb17=_0xec48[_0x1d760b];return _0x18fb17;};'use strict';var multer=require('multer');var util=require(_0x8ec4('0x0'));var path=require(_0x8ec4('0x1'));var timeout=require('connect-timeout');var express=require(_0x8ec4('0x2'));var router=express[_0x8ec4('0x3')]();var fs_extra=require(_0x8ec4('0x4'));var auth=require(_0x8ec4('0x5'));var interaction=require(_0x8ec4('0x6'));var config=require('../../config/environment');var controller=require(_0x8ec4('0x7'));router['get']('/',auth[_0x8ec4('0x8')](),controller[_0x8ec4('0x9')]);router[_0x8ec4('0xa')](_0x8ec4('0xb'),auth['isAuthenticated'](),controller[_0x8ec4('0xc')]);router[_0x8ec4('0xa')](_0x8ec4('0xd'),auth[_0x8ec4('0x8')](),controller[_0x8ec4('0xe')]);router[_0x8ec4('0xf')]('/',auth[_0x8ec4('0x8')](),controller[_0x8ec4('0x10')]);router[_0x8ec4('0x11')](_0x8ec4('0xd'),auth[_0x8ec4('0x8')](),controller[_0x8ec4('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8ec4('0x13')]);module[_0x8ec4('0x14')]=router;
\ No newline at end of file
index f37fb25..650f11f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeca8=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xeca8,0x1f2));var _0x8eca=function(_0x44a885,_0xe14b73){_0x44a885=_0x44a885-0x0;var _0x54e0ff=_0xeca8[_0x44a885];return _0x54e0ff;};'use strict';var Sequelize=require(_0x8eca('0x0'));module[_0x8eca('0x1')]={'type':{'type':Sequelize[_0x8eca('0x2')]},'uniqueid':{'type':Sequelize[_0x8eca('0x2')]},'calleridnum':{'type':Sequelize[_0x8eca('0x2')]},'calleridname':{'type':Sequelize[_0x8eca('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x8eca('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x8eca('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8eca('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x8eca('0x3')]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x8eca('0x3')]},'holdtime':{'type':Sequelize[_0x8eca('0x4')]},'agentcomplete':{'type':Sequelize[_0x8eca('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8eca('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8eca('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8eca('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8eca('0x4')]},'reason':{'type':Sequelize[_0x8eca('0x2')]},'lastevent':{'type':Sequelize[_0x8eca('0x2')]},'channel':{'type':Sequelize[_0x8eca('0x2')]},'channelstate':{'type':Sequelize[_0x8eca('0x4')]},'channelstatedesc':{'type':Sequelize[_0x8eca('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8eca('0x2')]},'connectedlinename':{'type':Sequelize[_0x8eca('0x2')]},'language':{'type':Sequelize[_0x8eca('0x2')]},'accountcode':{'type':Sequelize[_0x8eca('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x8eca('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x8eca('0x2')]},'destchannelstate':{'type':Sequelize[_0x8eca('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x8eca('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8eca('0x2')]},'destaccountcode':{'type':Sequelize[_0x8eca('0x2')]},'destcontext':{'type':Sequelize[_0x8eca('0x2')]},'destexten':{'type':Sequelize[_0x8eca('0x2')]},'destpriority':{'type':Sequelize[_0x8eca('0x2')]},'destuniqueid':{'type':Sequelize[_0x8eca('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8eca('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x8eca('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8eca('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x8eca('0x2')]},'transferuniqueid':{'type':Sequelize[_0x8eca('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x8caf=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x2067e9,_0x5e6a97){var _0x280ce4=function(_0x2eca23){while(--_0x2eca23){_0x2067e9['push'](_0x2067e9['shift']());}};_0x280ce4(++_0x5e6a97);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x5e4d4d,_0x5a5aa6){_0x5e4d4d=_0x5e4d4d-0x0;var _0x40cbd6=_0x8caf[_0x5e4d4d];return _0x40cbd6;};'use strict';var Sequelize=require('sequelize');module[_0xf8ca('0x0')]={'type':{'type':Sequelize[_0xf8ca('0x1')]},'uniqueid':{'type':Sequelize[_0xf8ca('0x1')]},'calleridnum':{'type':Sequelize[_0xf8ca('0x1')]},'calleridname':{'type':Sequelize[_0xf8ca('0x1')]},'queue':{'type':Sequelize[_0xf8ca('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xf8ca('0x1')]},'agentcalledAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentconnectAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xf8ca('0x2')]},'agentdumpAt':{'type':Sequelize[_0xf8ca('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xf8ca('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xf8ca('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf8ca('0x1')]},'channelstate':{'type':Sequelize[_0xf8ca('0x4')]},'channelstatedesc':{'type':Sequelize[_0xf8ca('0x1')]},'connectedlinenum':{'type':Sequelize[_0xf8ca('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf8ca('0x1')]},'accountcode':{'type':Sequelize[_0xf8ca('0x1')]},'context':{'type':Sequelize[_0xf8ca('0x1')]},'exten':{'type':Sequelize[_0xf8ca('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xf8ca('0x1')]},'destchannelstate':{'type':Sequelize[_0xf8ca('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xf8ca('0x1')]},'destcalleridname':{'type':Sequelize[_0xf8ca('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xf8ca('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xf8ca('0x1')]},'destlanguage':{'type':Sequelize[_0xf8ca('0x1')]},'destaccountcode':{'type':Sequelize[_0xf8ca('0x1')]},'destcontext':{'type':Sequelize[_0xf8ca('0x1')]},'destexten':{'type':Sequelize[_0xf8ca('0x1')]},'destpriority':{'type':Sequelize[_0xf8ca('0x1')]},'destuniqueid':{'type':Sequelize[_0xf8ca('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0xf8ca('0x1')]},'transfer':{'type':Sequelize[_0xf8ca('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf8ca('0x1')],'comment':_0xf8ca('0x5')},'transferexten':{'type':Sequelize[_0xf8ca('0x1')]},'transferuniqueid':{'type':Sequelize[_0xf8ca('0x1')]},'agententerreason':{'type':Sequelize[_0xf8ca('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index 3447c9f..83d208a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
+var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));};
\ No newline at end of file
index e9e5047..a3ec638 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bac=['lodash','../../config/logger','api','moment','bluebird','../../config/environment','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid'];(function(_0x1e36db,_0x29c4fa){var _0x5b44b2=function(_0x1b1699){while(--_0x1b1699){_0x1e36db['push'](_0x1e36db['shift']());}};_0x5b44b2(++_0x29c4fa);}(_0x6bac,0xa5));var _0xc6ba=function(_0x56d65d,_0x266360){_0x56d65d=_0x56d65d-0x0;var _0x29fcb4=_0x6bac[_0x56d65d];return _0x29fcb4;};'use strict';var _=require(_0xc6ba('0x0'));var util=require('util');var logger=require(_0xc6ba('0x1'))(_0xc6ba('0x2'));var moment=require(_0xc6ba('0x3'));var BPromise=require(_0xc6ba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc6ba('0x5'));var attributes=require(_0xc6ba('0x6'));module['exports']=function(_0x222f20,_0x2a16af){return _0x222f20[_0xc6ba('0x7')](_0xc6ba('0x8'),attributes,{'tableName':_0xc6ba('0x9'),'paranoid':![],'indexes':[{'fields':[_0xc6ba('0xa'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x47c7=['api','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','../../config/logger'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0x47c7,0x1ab));var _0x747c=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x47c7[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0x747c('0x0'));var util=require('util');var logger=require(_0x747c('0x1'))(_0x747c('0x2'));var moment=require('moment');var BPromise=require(_0x747c('0x3'));var rp=require(_0x747c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x747c('0x5'));var config=require(_0x747c('0x6'));var attributes=require(_0x747c('0x7'));module[_0x747c('0x8')]=function(_0x5e991e,_0xa1148a){return _0x5e991e['define'](_0x747c('0x9'),attributes,{'tableName':_0x747c('0xa'),'paranoid':![],'indexes':[{'fields':[_0x747c('0xb'),_0x747c('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index b8e09f3..0885690 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x835d=['UpdateVoiceAgentReport','VoiceAgentReport','update','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateVoiceAgentReport','body','options','raw','then'];(function(_0x260d5c,_0x2094a4){var _0x2874d1=function(_0x1be1c1){while(--_0x1be1c1){_0x260d5c['push'](_0x260d5c['shift']());}};_0x2874d1(++_0x2094a4);}(_0x835d,0xe4));var _0xd835=function(_0x1c56de,_0x31e666){_0x1c56de=_0x1c56de-0x0;var _0x1a1759=_0x835d[_0x1c56de];return _0x1a1759;};'use strict';var _=require(_0xd835('0x0'));var util=require(_0xd835('0x1'));var moment=require('moment');var BPromise=require(_0xd835('0x2'));var rs=require(_0xd835('0x3'));var fs=require('fs');var Redis=require(_0xd835('0x4'));var db=require(_0xd835('0x5'))['db'];var utils=require(_0xd835('0x6'));var logger=require(_0xd835('0x7'))(_0xd835('0x8'));var config=require(_0xd835('0x9'));var jayson=require(_0xd835('0xa'));var client=jayson[_0xd835('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53743a,_0x40e660,_0x12cab6){return new BPromise(function(_0x129ba1,_0x7aafb6){return client[_0xd835('0xc')](_0x53743a,_0x12cab6)['then'](function(_0x43f23e){logger[_0xd835('0xd')](_0xd835('0xe'),_0x40e660,'request\x20sent');logger[_0xd835('0xf')](_0xd835('0x10'),_0x40e660,_0xd835('0x11'),JSON[_0xd835('0x12')](_0x43f23e));if(_0x43f23e[_0xd835('0x13')]){if(_0x43f23e[_0xd835('0x13')][_0xd835('0x14')]===0x1f4){logger[_0xd835('0x13')]('VoiceAgentReport,\x20%s,\x20%s',_0x40e660,_0x43f23e['error'][_0xd835('0x15')]);return _0x7aafb6(_0x43f23e['error'][_0xd835('0x15')]);}logger[_0xd835('0x13')](_0xd835('0xe'),_0x40e660,_0x43f23e[_0xd835('0x13')][_0xd835('0x15')]);return _0x129ba1(_0x43f23e[_0xd835('0x13')]['message']);}else{logger[_0xd835('0xd')](_0xd835('0xe'),_0x40e660,_0xd835('0x11'));_0x129ba1(_0x43f23e['result'][_0xd835('0x15')]);}})[_0xd835('0x16')](function(_0x260c00){logger[_0xd835('0x13')](_0xd835('0xe'),_0x40e660,_0x260c00);_0x7aafb6(_0x260c00);});});}exports[_0xd835('0x17')]=function(_0x1fbbcf){var _0x5b1975=this;return new Promise(function(_0x1b3e27,_0x41b448){return db['VoiceAgentReport']['create'](_0x1fbbcf[_0xd835('0x18')],{'raw':_0x1fbbcf[_0xd835('0x19')]?_0x1fbbcf[_0xd835('0x19')][_0xd835('0x1a')]===undefined?!![]:![]:!![]})[_0xd835('0x1b')](function(_0x2572ed){logger[_0xd835('0xd')](_0xd835('0x17'),_0x1fbbcf);logger['debug']('CreateVoiceAgentReport',_0x1fbbcf,JSON['stringify'](_0x2572ed));_0x1b3e27(_0x2572ed);})['catch'](function(_0x18dd1f){logger[_0xd835('0x13')](_0xd835('0x17'),_0x18dd1f[_0xd835('0x15')],_0x1fbbcf);_0x41b448(_0x5b1975[_0xd835('0x13')](0x1f4,_0x18dd1f[_0xd835('0x15')]));});});};exports[_0xd835('0x1c')]=function(_0x2a91f1){var _0x41365d=this;return new Promise(function(_0xc853b9,_0x44dc48){return db[_0xd835('0x1d')][_0xd835('0x1e')](_0x2a91f1[_0xd835('0x18')],{'raw':_0x2a91f1[_0xd835('0x19')]?_0x2a91f1[_0xd835('0x19')][_0xd835('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a91f1[_0xd835('0x19')]?_0x2a91f1[_0xd835('0x19')]['where']||null:null,'attributes':_0x2a91f1[_0xd835('0x19')]?_0x2a91f1['options']['attributes']||null:null,'limit':_0x2a91f1[_0xd835('0x19')]?_0x2a91f1[_0xd835('0x19')][_0xd835('0x1f')]||null:null})['then'](function(_0x3a5bd4){logger[_0xd835('0xd')]('UpdateVoiceAgentReport',_0x2a91f1);logger['debug'](_0xd835('0x1c'),_0x2a91f1,JSON[_0xd835('0x12')](_0x3a5bd4));_0xc853b9(_0x3a5bd4);})['catch'](function(_0xb8652){logger['error'](_0xd835('0x1c'),_0xb8652[_0xd835('0x15')],_0x2a91f1);_0x44dc48(_0x41365d[_0xd835('0x13')](0x1f4,_0xb8652[_0xd835('0x15')]));});});};
\ No newline at end of file
+var _0xe1af=['../../config/logger','../../config/environment','http','then','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','info','UpdateVoiceAgentReport','update','where','attributes','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x36cc85,_0x912d2f){var _0x15146d=function(_0xc7d56c){while(--_0xc7d56c){_0x36cc85['push'](_0x36cc85['shift']());}};_0x15146d(++_0x912d2f);}(_0xe1af,0x1da));var _0xfe1a=function(_0x11a3ed,_0x143d66){_0x11a3ed=_0x11a3ed-0x0;var _0x3a72c7=_0xe1af[_0x11a3ed];return _0x3a72c7;};'use strict';var _=require(_0xfe1a('0x0'));var util=require(_0xfe1a('0x1'));var moment=require(_0xfe1a('0x2'));var BPromise=require('bluebird');var rs=require(_0xfe1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe1a('0x4'))['db'];var utils=require(_0xfe1a('0x5'));var logger=require(_0xfe1a('0x6'))('rpc');var config=require(_0xfe1a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfe1a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x538abe,_0x458f87,_0x44858f){return new BPromise(function(_0xf56396,_0x3cc220){return client['request'](_0x538abe,_0x44858f)[_0xfe1a('0x9')](function(_0x2a21f8){logger['info'](_0xfe1a('0xa'),_0x458f87,'request\x20sent');logger[_0xfe1a('0xb')](_0xfe1a('0xc'),_0x458f87,_0xfe1a('0xd'),JSON[_0xfe1a('0xe')](_0x2a21f8));if(_0x2a21f8[_0xfe1a('0xf')]){if(_0x2a21f8[_0xfe1a('0xf')][_0xfe1a('0x10')]===0x1f4){logger[_0xfe1a('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x458f87,_0x2a21f8[_0xfe1a('0xf')][_0xfe1a('0x11')]);return _0x3cc220(_0x2a21f8[_0xfe1a('0xf')]['message']);}logger[_0xfe1a('0xf')](_0xfe1a('0xa'),_0x458f87,_0x2a21f8[_0xfe1a('0xf')][_0xfe1a('0x11')]);return _0xf56396(_0x2a21f8[_0xfe1a('0xf')][_0xfe1a('0x11')]);}else{logger['info'](_0xfe1a('0xa'),_0x458f87,_0xfe1a('0xd'));_0xf56396(_0x2a21f8[_0xfe1a('0x12')][_0xfe1a('0x11')]);}})[_0xfe1a('0x13')](function(_0x1028f3){logger[_0xfe1a('0xf')](_0xfe1a('0xa'),_0x458f87,_0x1028f3);_0x3cc220(_0x1028f3);});});}exports[_0xfe1a('0x14')]=function(_0x5975bb){var _0x145efa=this;return new Promise(function(_0x16d29a,_0x24d44f){return db[_0xfe1a('0x15')][_0xfe1a('0x16')](_0x5975bb[_0xfe1a('0x17')],{'raw':_0x5975bb[_0xfe1a('0x18')]?_0x5975bb[_0xfe1a('0x18')][_0xfe1a('0x19')]===undefined?!![]:![]:!![]})[_0xfe1a('0x9')](function(_0x314db0){logger[_0xfe1a('0x1a')](_0xfe1a('0x14'),_0x5975bb);logger[_0xfe1a('0xb')]('CreateVoiceAgentReport',_0x5975bb,JSON[_0xfe1a('0xe')](_0x314db0));_0x16d29a(_0x314db0);})[_0xfe1a('0x13')](function(_0x121560){logger[_0xfe1a('0xf')](_0xfe1a('0x14'),_0x121560['message'],_0x5975bb);_0x24d44f(_0x145efa[_0xfe1a('0xf')](0x1f4,_0x121560[_0xfe1a('0x11')]));});});};exports[_0xfe1a('0x1b')]=function(_0x17c28b){var _0x36df50=this;return new Promise(function(_0x4f6384,_0x1c4c5c){return db[_0xfe1a('0x15')][_0xfe1a('0x1c')](_0x17c28b[_0xfe1a('0x17')],{'raw':_0x17c28b['options']?_0x17c28b['options'][_0xfe1a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17c28b['options']?_0x17c28b[_0xfe1a('0x18')][_0xfe1a('0x1d')]||null:null,'attributes':_0x17c28b[_0xfe1a('0x18')]?_0x17c28b['options'][_0xfe1a('0x1e')]||null:null,'limit':_0x17c28b[_0xfe1a('0x18')]?_0x17c28b[_0xfe1a('0x18')][_0xfe1a('0x1f')]||null:null})[_0xfe1a('0x9')](function(_0x36cd00){logger[_0xfe1a('0x1a')](_0xfe1a('0x1b'),_0x17c28b);logger['debug'](_0xfe1a('0x1b'),_0x17c28b,JSON[_0xfe1a('0xe')](_0x36cd00));_0x4f6384(_0x36cd00);})[_0xfe1a('0x13')](function(_0x3292f4){logger[_0xfe1a('0xf')](_0xfe1a('0x1b'),_0x3292f4[_0xfe1a('0x11')],_0x17c28b);_0x1c4c5c(_0x36df50[_0xfe1a('0xf')](0x1f4,_0x3292f4[_0xfe1a('0x11')]));});});};
\ No newline at end of file
index e69d8a2..b48a34a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae24=['./voiceCallReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','delete','exports','multer','path','express','Router','../../components/interaction/service'];(function(_0x22663b,_0xc8c6e3){var _0x310d0a=function(_0x151e66){while(--_0x151e66){_0x22663b['push'](_0x22663b['shift']());}};_0x310d0a(++_0xc8c6e3);}(_0xae24,0x182));var _0x4ae2=function(_0x4c9c78,_0x1c7eb9){_0x4c9c78=_0x4c9c78-0x0;var _0x5a6696=_0xae24[_0x4c9c78];return _0x5a6696;};'use strict';var multer=require(_0x4ae2('0x0'));var util=require('util');var path=require(_0x4ae2('0x1'));var timeout=require('connect-timeout');var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ae2('0x4'));var config=require('../../config/environment');var controller=require(_0x4ae2('0x5'));router[_0x4ae2('0x6')]('/',auth[_0x4ae2('0x7')](),controller[_0x4ae2('0x8')]);router[_0x4ae2('0x6')](_0x4ae2('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x4ae2('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x4ae2('0xa')]);router[_0x4ae2('0xb')]('/',auth['isAuthenticated'](),controller[_0x4ae2('0xc')]);router[_0x4ae2('0xd')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['update']);router[_0x4ae2('0xf')](_0x4ae2('0xe'),auth[_0x4ae2('0x7')](),controller['destroy']);module[_0x4ae2('0x10')]=router;
\ No newline at end of file
+var _0x24ca=['delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x24ca,0x1bc));var _0xa24c=function(_0x386525,_0xefae6){_0x386525=_0x386525-0x0;var _0x14d015=_0x24ca[_0x386525];return _0x14d015;};'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 fs_extra=require(_0xa24c('0x4'));var auth=require(_0xa24c('0x5'));var interaction=require(_0xa24c('0x6'));var config=require(_0xa24c('0x7'));var controller=require(_0xa24c('0x8'));router[_0xa24c('0x9')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xb')]);router[_0xa24c('0x9')](_0xa24c('0xc'),auth[_0xa24c('0xa')](),controller['describe']);router[_0xa24c('0x9')](_0xa24c('0xd'),auth[_0xa24c('0xa')](),controller['show']);router[_0xa24c('0xe')]('/',auth[_0xa24c('0xa')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xd'),auth[_0xa24c('0xa')](),controller[_0xa24c('0x11')]);router[_0xa24c('0x12')](_0xa24c('0xd'),auth['isAuthenticated'](),controller[_0xa24c('0x13')]);module[_0xa24c('0x14')]=router;
\ No newline at end of file
index d27adb2..35a911e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18df=['dialer','STRING','TEXT','DATE','INTEGER','sequelize','ENUM','inbound','internal','outbound','outbound-fax'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x18df,0x1b2));var _0xf18d=function(_0x9328db,_0x597dfe){_0x9328db=_0x9328db-0x0;var _0x1d6a8a=_0x18df[_0x9328db];return _0x1d6a8a;};'use strict';var Sequelize=require(_0xf18d('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf18d('0x1')](_0xf18d('0x2'),_0xf18d('0x3'),_0xf18d('0x4'),'inbound-fax',_0xf18d('0x5'),_0xf18d('0x6'))},'tag':{'type':Sequelize[_0xf18d('0x7')]},'accountcode':{'type':Sequelize[_0xf18d('0x7')]},'source':{'type':Sequelize[_0xf18d('0x7')]},'destination':{'type':Sequelize[_0xf18d('0x7')]},'destinationcontext':{'type':Sequelize[_0xf18d('0x7')]},'callerid':{'type':Sequelize[_0xf18d('0x7')]},'channel':{'type':Sequelize[_0xf18d('0x7')]},'destinationchannel':{'type':Sequelize[_0xf18d('0x7')]},'lastapplication':{'type':Sequelize[_0xf18d('0x7')]},'lastdata':{'type':Sequelize[_0xf18d('0x8')]},'starttime':{'type':Sequelize[_0xf18d('0x9')]},'systemanswertime':{'type':Sequelize[_0xf18d('0x9')]},'answertime':{'type':Sequelize[_0xf18d('0x9')]},'endtime':{'type':Sequelize[_0xf18d('0x9')]},'duration':{'type':Sequelize[_0xf18d('0xa')]},'billableseconds':{'type':Sequelize[_0xf18d('0xa')]},'mohtime':{'type':Sequelize[_0xf18d('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf18d('0x7')]},'userfield':{'type':Sequelize[_0xf18d('0x7')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xf18d('0x7')]},'note':{'type':Sequelize[_0xf18d('0x7')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0xf18d('0xa')]},'sipcallid':{'type':Sequelize[_0xf18d('0x7')]}};
\ No newline at end of file
+var _0x062f=['INTEGER','sequelize','exports','STRING','inbound','internal','inbound-fax','outbound-fax','dialer','TEXT','DATE'];(function(_0x13928e,_0xaff227){var _0x184e8b=function(_0x5aa9ef){while(--_0x5aa9ef){_0x13928e['push'](_0x13928e['shift']());}};_0x184e8b(++_0xaff227);}(_0x062f,0xc7));var _0xf062=function(_0x79324e,_0x4af67e){_0x79324e=_0x79324e-0x0;var _0x555666=_0x062f[_0x79324e];return _0x555666;};'use strict';var Sequelize=require(_0xf062('0x0'));module[_0xf062('0x1')]={'uniqueid':{'type':Sequelize[_0xf062('0x2')]},'type':{'type':Sequelize['ENUM'](_0xf062('0x3'),_0xf062('0x4'),'outbound',_0xf062('0x5'),_0xf062('0x6'),_0xf062('0x7'))},'tag':{'type':Sequelize[_0xf062('0x2')]},'accountcode':{'type':Sequelize[_0xf062('0x2')]},'source':{'type':Sequelize[_0xf062('0x2')]},'destination':{'type':Sequelize[_0xf062('0x2')]},'destinationcontext':{'type':Sequelize[_0xf062('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xf062('0x2')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xf062('0x2')]},'lastdata':{'type':Sequelize[_0xf062('0x8')]},'starttime':{'type':Sequelize[_0xf062('0x9')]},'systemanswertime':{'type':Sequelize[_0xf062('0x9')]},'answertime':{'type':Sequelize[_0xf062('0x9')]},'endtime':{'type':Sequelize[_0xf062('0x9')]},'duration':{'type':Sequelize[_0xf062('0xa')]},'billableseconds':{'type':Sequelize[_0xf062('0xa')]},'mohtime':{'type':Sequelize[_0xf062('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xf062('0x2')]},'userfield':{'type':Sequelize[_0xf062('0x2')]},'userDisposition':{'type':Sequelize[_0xf062('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xf062('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xf062('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xf062('0x2')]}};
\ No newline at end of file
index 1729f2f..ae3bbf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5f66[_0x4243a3];return _0x1b2a33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));};
\ No newline at end of file
+var _0x0b0e=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','count','includeAll','fullname','alias','User','findAll','rows','params','find','create','body','catch','describe','update','uniqueid','user','eml-format','zip-dir','request-promise','moment'];(function(_0x3f918e,_0x3e9626){var _0x4c8588=function(_0x3f72a0){while(--_0x3f72a0){_0x3f918e['push'](_0x3f918e['shift']());}};_0x4c8588(++_0x3e9626);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1233d2,_0x5416f4){_0x1233d2=_0x1233d2-0x0;var _0x22759e=_0x0b0e[_0x1233d2];return _0x22759e;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe0b0('0x17'))['db'];function respondWithStatusCode(_0x1c358a,_0x3cc19a){_0x3cc19a=_0x3cc19a||0xcc;return function(_0x45f914){if(_0x45f914){return _0x1c358a[_0xe0b0('0x18')](_0x3cc19a);}return _0x1c358a['status'](_0x3cc19a)[_0xe0b0('0x19')]();};}function respondWithResult(_0x154de6,_0x743318){_0x743318=_0x743318||0xc8;return function(_0x24babd){if(_0x24babd){return _0x154de6[_0xe0b0('0x1a')](_0x743318)['json'](_0x24babd);}};}function respondWithFilteredResult(_0x41a7e2,_0x5adb01){return function(_0x35cb40){if(_0x35cb40){var _0xadee6e=typeof _0x5adb01['offset']===_0xe0b0('0x1b')&&typeof _0x5adb01['limit']===_0xe0b0('0x1b');var _0x100204=_0x35cb40['count'];var _0x54a3eb=_0xadee6e?0x0:_0x5adb01[_0xe0b0('0x1c')];var _0x50a441=_0xadee6e?_0x35cb40['count']:_0x5adb01['offset']+_0x5adb01[_0xe0b0('0x1d')];var _0x50fa4a;if(_0x50a441>=_0x100204){_0x50a441=_0x100204;_0x50fa4a=0xc8;}else{_0x50fa4a=0xce;}_0x41a7e2['status'](_0x50fa4a);return _0x41a7e2[_0xe0b0('0x1e')]('Content-Range',_0x54a3eb+'-'+_0x50a441+'/'+_0x100204)[_0xe0b0('0x1f')](_0x35cb40);}return null;};}function patchUpdates(_0x5dba2f){return function(_0x2c84cc){try{jsonpatch[_0xe0b0('0x20')](_0x2c84cc,_0x5dba2f,!![]);}catch(_0x3e10b3){return BPromise[_0xe0b0('0x21')](_0x3e10b3);}return _0x2c84cc[_0xe0b0('0x22')]();};}function saveUpdates(_0x58b804,_0x4cae54){return function(_0x2fa820){if(_0x2fa820){return _0x2fa820['update'](_0x58b804)[_0xe0b0('0x23')](function(_0x31b5f8){return _0x31b5f8;});}return null;};}function removeEntity(_0x513e63,_0x170ad8){return function(_0x503883){if(_0x503883){return _0x503883[_0xe0b0('0x24')]()['then'](function(){_0x513e63[_0xe0b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e5c88,_0x4de537){return function(_0x4700cc){if(!_0x4700cc){_0x3e5c88['sendStatus'](0x194);}return _0x4700cc;};}function handleError(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0x1f4;return function(_0x362aba){logger[_0xe0b0('0x25')](_0x362aba[_0xe0b0('0x26')]);if(_0x362aba[_0xe0b0('0x27')]){delete _0x362aba[_0xe0b0('0x27')];}_0x3c221d[_0xe0b0('0x1a')](_0x5c5317)['send'](_0x362aba);};}exports[_0xe0b0('0x28')]=function(_0x1b8aa8,_0x5b7a64){var _0x15e13b={},_0x419b1f={},_0x36d137={'count':0x0,'rows':[]};var _0x1d5759=_[_0xe0b0('0x29')](db[_0xe0b0('0x2a')][_0xe0b0('0x2b')],function(_0x4fb3b7){return{'name':_0x4fb3b7[_0xe0b0('0x2c')],'type':_0x4fb3b7[_0xe0b0('0x2d')]['key']};});_0x419b1f['model']=_[_0xe0b0('0x29')](_0x1d5759,_0xe0b0('0x27'));_0x419b1f[_0xe0b0('0x2e')]=_[_0xe0b0('0x2f')](_0x1b8aa8[_0xe0b0('0x2e')]);_0x419b1f['filters']=_[_0xe0b0('0x30')](_0x419b1f[_0xe0b0('0x31')],_0x419b1f[_0xe0b0('0x2e')]);_0x15e13b[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x419b1f['model'],qs[_0xe0b0('0x33')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x33')]));_0x15e13b[_0xe0b0('0x32')]=_0x15e13b[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x15e13b[_0xe0b0('0x32')]:_0x419b1f[_0xe0b0('0x31')];if(!_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x35')](_0xe0b0('0x36'))){_0x15e13b[_0xe0b0('0x1d')]=qs[_0xe0b0('0x1d')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1d')]);_0x15e13b['offset']=qs[_0xe0b0('0x1c')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x1c')]);}_0x15e13b[_0xe0b0('0x37')]=qs[_0xe0b0('0x38')](_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x38')]);_0x15e13b['where']=qs['filters'](_['pick'](_0x1b8aa8['query'],_0x419b1f[_0xe0b0('0x39')]),_0x1d5759);if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]){_0x15e13b['where']=_[_0xe0b0('0x3b')](_0x15e13b[_0xe0b0('0x3c')],{'$or':_[_0xe0b0('0x29')](_0x1d5759,function(_0x297c64){if(_0x297c64['type']!==_0xe0b0('0x3d')){var _0xfbb61d={};_0xfbb61d[_0x297c64[_0xe0b0('0x27')]]={'$like':'%'+_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x3a')]+'%'};return _0xfbb61d;}})});}_0x15e13b=_[_0xe0b0('0x3b')]({},_0x15e13b,_0x1b8aa8[_0xe0b0('0x3e')]);var _0x115a69={'where':_0x15e13b[_0xe0b0('0x3c')]};return db['VoiceCallReport'][_0xe0b0('0x3f')](_0x115a69)['then'](function(_0x34178d){_0x36d137[_0xe0b0('0x3f')]=_0x34178d;if(_0x1b8aa8[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x15e13b['include']=[{'attributes':['id',_0xe0b0('0x27'),_0xe0b0('0x41'),_0xe0b0('0x42')],'model':db[_0xe0b0('0x43')],'as':_0xe0b0('0x43')}];}return db[_0xe0b0('0x2a')][_0xe0b0('0x44')](_0x15e13b);})[_0xe0b0('0x23')](function(_0x52ffe4){_0x36d137[_0xe0b0('0x45')]=_0x52ffe4;return _0x36d137;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x5b7a64,_0x15e13b))['catch'](handleError(_0x5b7a64,null));};exports['show']=function(_0x327fb4,_0x247f8d){var _0x56e7df={'raw':!![],'where':{'id':_0x327fb4[_0xe0b0('0x46')]['id']}},_0x18a59d={};_0x18a59d[_0xe0b0('0x31')]=_[_0xe0b0('0x2f')](db[_0xe0b0('0x2a')]['rawAttributes']);_0x18a59d['query']=_['keys'](_0x327fb4[_0xe0b0('0x2e')]);_0x18a59d[_0xe0b0('0x39')]=_['intersection'](_0x18a59d[_0xe0b0('0x31')],_0x18a59d[_0xe0b0('0x2e')]);_0x56e7df[_0xe0b0('0x32')]=_[_0xe0b0('0x30')](_0x18a59d[_0xe0b0('0x31')],qs['fields'](_0x327fb4['query'][_0xe0b0('0x33')]));_0x56e7df[_0xe0b0('0x32')]=_0x56e7df[_0xe0b0('0x32')][_0xe0b0('0x34')]?_0x56e7df[_0xe0b0('0x32')]:_0x18a59d['model'];if(_0x327fb4[_0xe0b0('0x2e')][_0xe0b0('0x40')]){_0x56e7df['include']=[{'all':!![]}];}_0x56e7df=_['merge']({},_0x56e7df,_0x327fb4['options']);return db[_0xe0b0('0x2a')][_0xe0b0('0x47')](_0x56e7df)[_0xe0b0('0x23')](handleEntityNotFound(_0x247f8d,null))[_0xe0b0('0x23')](respondWithResult(_0x247f8d,null))['catch'](handleError(_0x247f8d,null));};exports[_0xe0b0('0x48')]=function(_0x87d8f3,_0x483f12){return db['VoiceCallReport'][_0xe0b0('0x48')](_0x87d8f3[_0xe0b0('0x49')],{})['then'](respondWithResult(_0x483f12,0xc9))[_0xe0b0('0x4a')](handleError(_0x483f12,null));};exports[_0xe0b0('0x24')]=function(_0x504284,_0x5cb2b6){return db[_0xe0b0('0x2a')]['find']({'where':{'id':_0x504284[_0xe0b0('0x46')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x5cb2b6,null))[_0xe0b0('0x23')](removeEntity(_0x5cb2b6,null))[_0xe0b0('0x4a')](handleError(_0x5cb2b6,null));};exports[_0xe0b0('0x4b')]=function(_0xf9e694,_0x5f5486){return db['VoiceCallReport'][_0xe0b0('0x4b')]()['then'](respondWithResult(_0x5f5486,null))['catch'](handleError(_0x5f5486,null));};exports[_0xe0b0('0x4c')]=function(_0x222174,_0x54cf7b){if(_0x222174['body'][_0xe0b0('0x4d')]){delete _0x222174[_0xe0b0('0x49')][_0xe0b0('0x4d')];}return db[_0xe0b0('0x2a')][_0xe0b0('0x47')]({'where':{'uniqueid':_0x222174[_0xe0b0('0x46')]['id'],'UserId':{'$or':[null,_0x222174[_0xe0b0('0x4e')]['id']]}}})['then'](handleEntityNotFound(_0x54cf7b,null))[_0xe0b0('0x23')](saveUpdates(_0x222174['body'],null))[_0xe0b0('0x23')](respondWithResult(_0x54cf7b,null))['catch'](handleError(_0x54cf7b,null));};
\ No newline at end of file
index 744ad1f..c3697d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f09=['exports','define','VoiceCallReport','report_call','lodash','util','api','moment','request-promise','path','../../config/environment','./voiceCallReport.attributes'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8f09,0x19c));var _0x98f0=function(_0x58d41c,_0x3a43c5){_0x58d41c=_0x58d41c-0x0;var _0xad70f8=_0x8f09[_0x58d41c];return _0xad70f8;};'use strict';var _=require(_0x98f0('0x0'));var util=require(_0x98f0('0x1'));var logger=require('../../config/logger')(_0x98f0('0x2'));var moment=require(_0x98f0('0x3'));var BPromise=require('bluebird');var rp=require(_0x98f0('0x4'));var fs=require('fs');var path=require(_0x98f0('0x5'));var rimraf=require('rimraf');var config=require(_0x98f0('0x6'));var attributes=require(_0x98f0('0x7'));module[_0x98f0('0x8')]=function(_0x311554,_0x58f78a){return _0x311554[_0x98f0('0x9')](_0x98f0('0xa'),attributes,{'tableName':_0x98f0('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb5ce=['exports','define','VoiceCallReport','report_call','uniqueid','lodash','api','moment','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes'];(function(_0x76087e,_0x9cd048){var _0x373c65=function(_0x1a4aed){while(--_0x1a4aed){_0x76087e['push'](_0x76087e['shift']());}};_0x373c65(++_0x9cd048);}(_0xb5ce,0xa1));var _0xeb5c=function(_0x2f74f8,_0x1c37ce){_0x2f74f8=_0x2f74f8-0x0;var _0x5a2e34=_0xb5ce[_0x2f74f8];return _0x5a2e34;};'use strict';var _=require(_0xeb5c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeb5c('0x1'));var moment=require(_0xeb5c('0x2'));var BPromise=require('bluebird');var rp=require(_0xeb5c('0x3'));var fs=require('fs');var path=require(_0xeb5c('0x4'));var rimraf=require(_0xeb5c('0x5'));var config=require(_0xeb5c('0x6'));var attributes=require(_0xeb5c('0x7'));module[_0xeb5c('0x8')]=function(_0x1b0aee,_0x5560e8){return _0x1b0aee[_0xeb5c('0x9')](_0xeb5c('0xa'),attributes,{'tableName':_0xeb5c('0xb'),'paranoid':![],'indexes':[{'fields':[_0xeb5c('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index f6cfa89..03c4618 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x03c6=['then','info','VoiceCallReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','raw','options','where','attributes','limit','include','map','model','CreateVoiceCallReport','UpdateVoiceCallReport','update','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x325881,_0x2c22f6){var _0x1b9bae=function(_0x3959b2){while(--_0x3959b2){_0x325881['push'](_0x325881['shift']());}};_0x1b9bae(++_0x2c22f6);}(_0x03c6,0x84));var _0x603c=function(_0x101cce,_0xc1a9eb){_0x101cce=_0x101cce-0x0;var _0x3a5946=_0x03c6[_0x101cce];return _0x3a5946;};'use strict';var _=require('lodash');var util=require(_0x603c('0x0'));var moment=require(_0x603c('0x1'));var BPromise=require(_0x603c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x603c('0x3'));var db=require(_0x603c('0x4'))['db'];var utils=require(_0x603c('0x5'));var logger=require(_0x603c('0x6'))(_0x603c('0x7'));var config=require(_0x603c('0x8'));var jayson=require(_0x603c('0x9'));var client=jayson['client'][_0x603c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xdfd076,_0xb443b7,_0x461a9c){return new BPromise(function(_0x382938,_0x789bda){return client[_0x603c('0xb')](_0xdfd076,_0x461a9c)[_0x603c('0xc')](function(_0x39e57b){logger[_0x603c('0xd')](_0x603c('0xe'),_0xb443b7,'request\x20sent');logger[_0x603c('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0xb443b7,_0x603c('0x10'),JSON[_0x603c('0x11')](_0x39e57b));if(_0x39e57b[_0x603c('0x12')]){if(_0x39e57b['error']['code']===0x1f4){logger[_0x603c('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0xb443b7,_0x39e57b[_0x603c('0x12')][_0x603c('0x13')]);return _0x789bda(_0x39e57b['error'][_0x603c('0x13')]);}logger[_0x603c('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0xb443b7,_0x39e57b[_0x603c('0x12')][_0x603c('0x13')]);return _0x382938(_0x39e57b[_0x603c('0x12')][_0x603c('0x13')]);}else{logger[_0x603c('0xd')](_0x603c('0xe'),_0xb443b7,_0x603c('0x10'));_0x382938(_0x39e57b[_0x603c('0x14')][_0x603c('0x13')]);}})[_0x603c('0x15')](function(_0x5b320f){logger[_0x603c('0x12')](_0x603c('0xe'),_0xb443b7,_0x5b320f);_0x789bda(_0x5b320f);});});}exports[_0x603c('0x16')]=function(_0x16c43d){var _0x22bd12=this;return new Promise(function(_0x3bd979,_0x380c65){return db[_0x603c('0x17')][_0x603c('0x18')]({'raw':_0x16c43d['options']?_0x16c43d['options'][_0x603c('0x19')]===undefined?!![]:![]:!![],'where':_0x16c43d[_0x603c('0x1a')]?_0x16c43d[_0x603c('0x1a')][_0x603c('0x1b')]||null:null,'attributes':_0x16c43d[_0x603c('0x1a')]?_0x16c43d[_0x603c('0x1a')][_0x603c('0x1c')]||null:null,'limit':_0x16c43d[_0x603c('0x1a')]?_0x16c43d[_0x603c('0x1a')][_0x603c('0x1d')]||null:null,'include':_0x16c43d[_0x603c('0x1a')]?_0x16c43d[_0x603c('0x1a')][_0x603c('0x1e')]?_[_0x603c('0x1f')](_0x16c43d['options']['include'],function(_0x183c93){return{'model':db[_0x183c93['model']],'as':_0x183c93['as'],'attributes':_0x183c93[_0x603c('0x1c')],'include':_0x183c93['include']?_[_0x603c('0x1f')](_0x183c93['include'],function(_0x59cc20){return{'model':db[_0x59cc20[_0x603c('0x20')]],'as':_0x59cc20['as'],'attributes':_0x59cc20[_0x603c('0x1c')],'include':_0x59cc20[_0x603c('0x1e')]?_[_0x603c('0x1f')](_0x59cc20[_0x603c('0x1e')],function(_0x4a5c43){return{'model':db[_0x4a5c43['model']],'as':_0x4a5c43['as'],'attributes':_0x4a5c43['attributes']};}):[]};}):[]};}):[]:[]})[_0x603c('0xc')](function(_0x153e1e){logger[_0x603c('0xd')](_0x603c('0x16'),_0x16c43d);logger[_0x603c('0xf')](_0x603c('0x16'),_0x16c43d,JSON[_0x603c('0x11')](_0x153e1e));_0x3bd979(_0x153e1e);})[_0x603c('0x15')](function(_0x5d362a){logger[_0x603c('0x12')](_0x603c('0x16'),_0x5d362a[_0x603c('0x13')],_0x16c43d);_0x380c65(_0x22bd12[_0x603c('0x12')](0x1f4,_0x5d362a[_0x603c('0x13')]));});});};exports[_0x603c('0x21')]=function(_0x33ad42){var _0x5727db=this;return new Promise(function(_0x4bed3a,_0x12d769){return db[_0x603c('0x17')]['create'](_0x33ad42['body'],{'raw':_0x33ad42['options']?_0x33ad42[_0x603c('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x603c('0xc')](function(_0xaba243){logger[_0x603c('0xd')](_0x603c('0x21'),_0x33ad42);logger[_0x603c('0xf')](_0x603c('0x21'),_0x33ad42,JSON['stringify'](_0xaba243));_0x4bed3a(_0xaba243);})[_0x603c('0x15')](function(_0x2d8f55){logger['error']('CreateVoiceCallReport',_0x2d8f55[_0x603c('0x13')],_0x33ad42);_0x12d769(_0x5727db[_0x603c('0x12')](0x1f4,_0x2d8f55[_0x603c('0x13')]));});});};exports[_0x603c('0x22')]=function(_0x1197f7){var _0x47addc=this;return new Promise(function(_0x537837,_0x383592){return db[_0x603c('0x17')][_0x603c('0x23')](_0x1197f7['body'],{'raw':_0x1197f7[_0x603c('0x1a')]?_0x1197f7[_0x603c('0x1a')][_0x603c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1197f7[_0x603c('0x1a')]?_0x1197f7['options'][_0x603c('0x1b')]||null:null,'attributes':_0x1197f7[_0x603c('0x1a')]?_0x1197f7[_0x603c('0x1a')][_0x603c('0x1c')]||null:null,'limit':_0x1197f7[_0x603c('0x1a')]?_0x1197f7[_0x603c('0x1a')][_0x603c('0x1d')]||null:null})['then'](function(_0xda2f9d){logger[_0x603c('0xd')](_0x603c('0x22'),_0x1197f7);logger[_0x603c('0xf')](_0x603c('0x22'),_0x1197f7,JSON[_0x603c('0x11')](_0xda2f9d));_0x537837(_0xda2f9d);})['catch'](function(_0x449662){logger['error'](_0x603c('0x22'),_0x449662[_0x603c('0x13')],_0x1197f7);_0x383592(_0x47addc[_0x603c('0x12')](0x1f4,_0x449662[_0x603c('0x13')]));});});};
\ No newline at end of file
+var _0x35c1=['model','GetVoiceCallReport','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','body','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceCallReport','findAll','options','raw','limit','include','map','attributes'];(function(_0x2a9e2b,_0x57d947){var _0x35a87f=function(_0x21d480){while(--_0x21d480){_0x2a9e2b['push'](_0x2a9e2b['shift']());}};_0x35a87f(++_0x57d947);}(_0x35c1,0x17a));var _0x135c=function(_0x2bd9db,_0x2f6076){_0x2bd9db=_0x2bd9db-0x0;var _0x28441e=_0x35c1[_0x2bd9db];return _0x28441e;};'use strict';var _=require(_0x135c('0x0'));var util=require(_0x135c('0x1'));var moment=require('moment');var BPromise=require(_0x135c('0x2'));var rs=require(_0x135c('0x3'));var fs=require('fs');var Redis=require(_0x135c('0x4'));var db=require(_0x135c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x135c('0x6'))(_0x135c('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x135c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3de8b7,_0x41c849,_0x12dab1){return new BPromise(function(_0x4e613f,_0x4e1443){return client[_0x135c('0x9')](_0x3de8b7,_0x12dab1)[_0x135c('0xa')](function(_0x24631a){logger[_0x135c('0xb')](_0x135c('0xc'),_0x41c849,_0x135c('0xd'));logger[_0x135c('0xe')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x41c849,_0x135c('0xd'),JSON[_0x135c('0xf')](_0x24631a));if(_0x24631a[_0x135c('0x10')]){if(_0x24631a['error'][_0x135c('0x11')]===0x1f4){logger[_0x135c('0x10')](_0x135c('0xc'),_0x41c849,_0x24631a[_0x135c('0x10')][_0x135c('0x12')]);return _0x4e1443(_0x24631a[_0x135c('0x10')][_0x135c('0x12')]);}logger[_0x135c('0x10')](_0x135c('0xc'),_0x41c849,_0x24631a[_0x135c('0x10')][_0x135c('0x12')]);return _0x4e613f(_0x24631a[_0x135c('0x10')][_0x135c('0x12')]);}else{logger[_0x135c('0xb')](_0x135c('0xc'),_0x41c849,'request\x20sent');_0x4e613f(_0x24631a[_0x135c('0x13')][_0x135c('0x12')]);}})[_0x135c('0x14')](function(_0x4cccd6){logger[_0x135c('0x10')](_0x135c('0xc'),_0x41c849,_0x4cccd6);_0x4e1443(_0x4cccd6);});});}exports['GetVoiceCallReport']=function(_0x20f43c){var _0x5e5297=this;return new Promise(function(_0x16f271,_0x3beb04){return db[_0x135c('0x15')][_0x135c('0x16')]({'raw':_0x20f43c['options']?_0x20f43c[_0x135c('0x17')][_0x135c('0x18')]===undefined?!![]:![]:!![],'where':_0x20f43c['options']?_0x20f43c[_0x135c('0x17')]['where']||null:null,'attributes':_0x20f43c[_0x135c('0x17')]?_0x20f43c[_0x135c('0x17')]['attributes']||null:null,'limit':_0x20f43c[_0x135c('0x17')]?_0x20f43c[_0x135c('0x17')][_0x135c('0x19')]||null:null,'include':_0x20f43c[_0x135c('0x17')]?_0x20f43c[_0x135c('0x17')][_0x135c('0x1a')]?_[_0x135c('0x1b')](_0x20f43c[_0x135c('0x17')][_0x135c('0x1a')],function(_0xb6b0d){return{'model':db[_0xb6b0d['model']],'as':_0xb6b0d['as'],'attributes':_0xb6b0d[_0x135c('0x1c')],'include':_0xb6b0d[_0x135c('0x1a')]?_['map'](_0xb6b0d[_0x135c('0x1a')],function(_0x48125a){return{'model':db[_0x48125a['model']],'as':_0x48125a['as'],'attributes':_0x48125a[_0x135c('0x1c')],'include':_0x48125a[_0x135c('0x1a')]?_[_0x135c('0x1b')](_0x48125a[_0x135c('0x1a')],function(_0xcba21b){return{'model':db[_0xcba21b[_0x135c('0x1d')]],'as':_0xcba21b['as'],'attributes':_0xcba21b[_0x135c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x135c('0xa')](function(_0x27d63a){logger['info'](_0x135c('0x1e'),_0x20f43c);logger[_0x135c('0xe')](_0x135c('0x1e'),_0x20f43c,JSON[_0x135c('0xf')](_0x27d63a));_0x16f271(_0x27d63a);})[_0x135c('0x14')](function(_0x2493e9){logger['error'](_0x135c('0x1e'),_0x2493e9[_0x135c('0x12')],_0x20f43c);_0x3beb04(_0x5e5297[_0x135c('0x10')](0x1f4,_0x2493e9[_0x135c('0x12')]));});});};exports[_0x135c('0x1f')]=function(_0x3b8933){var _0x1a8488=this;return new Promise(function(_0x27d2de,_0x4d6651){return db[_0x135c('0x15')][_0x135c('0x20')](_0x3b8933['body'],{'raw':_0x3b8933[_0x135c('0x17')]?_0x3b8933['options'][_0x135c('0x18')]===undefined?!![]:![]:!![]})[_0x135c('0xa')](function(_0x4e1035){logger['info'](_0x135c('0x1f'),_0x3b8933);logger[_0x135c('0xe')](_0x135c('0x1f'),_0x3b8933,JSON[_0x135c('0xf')](_0x4e1035));_0x27d2de(_0x4e1035);})[_0x135c('0x14')](function(_0x3a3ca6){logger[_0x135c('0x10')]('CreateVoiceCallReport',_0x3a3ca6[_0x135c('0x12')],_0x3b8933);_0x4d6651(_0x1a8488['error'](0x1f4,_0x3a3ca6[_0x135c('0x12')]));});});};exports[_0x135c('0x21')]=function(_0x3e9877){var _0x140d67=this;return new Promise(function(_0x104111,_0x2f03ad){return db[_0x135c('0x15')][_0x135c('0x22')](_0x3e9877[_0x135c('0x23')],{'raw':_0x3e9877[_0x135c('0x17')]?_0x3e9877[_0x135c('0x17')][_0x135c('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e9877['options']?_0x3e9877[_0x135c('0x17')][_0x135c('0x24')]||null:null,'attributes':_0x3e9877[_0x135c('0x17')]?_0x3e9877[_0x135c('0x17')][_0x135c('0x1c')]||null:null,'limit':_0x3e9877[_0x135c('0x17')]?_0x3e9877[_0x135c('0x17')]['limit']||null:null})[_0x135c('0xa')](function(_0x6cb74e){logger['info'](_0x135c('0x21'),_0x3e9877);logger[_0x135c('0xe')]('UpdateVoiceCallReport',_0x3e9877,JSON[_0x135c('0xf')](_0x6cb74e));_0x104111(_0x6cb74e);})[_0x135c('0x14')](function(_0x48101c){logger[_0x135c('0x10')](_0x135c('0x21'),_0x48101c['message'],_0x3e9877);_0x2f03ad(_0x140d67[_0x135c('0x10')](0x1f4,_0x48101c[_0x135c('0x12')]));});});};
\ No newline at end of file
index 1a9c7fa..606cb47 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78e6=['delete','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','put','update'];(function(_0x187a65,_0x249c52){var _0x453865=function(_0x347e0e){while(--_0x347e0e){_0x187a65['push'](_0x187a65['shift']());}};_0x453865(++_0x249c52);}(_0x78e6,0x1dd));var _0x678e=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x78e6[_0x576170];return _0x397c70;};'use strict';var multer=require('multer');var util=require(_0x678e('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x678e('0x1')]();var fs_extra=require(_0x678e('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x678e('0x3'));var config=require(_0x678e('0x4'));var controller=require(_0x678e('0x5'));router[_0x678e('0x6')]('/',auth[_0x678e('0x7')](),controller[_0x678e('0x8')]);router[_0x678e('0x6')](_0x678e('0x9'),auth[_0x678e('0x7')](),controller[_0x678e('0xa')]);router['post']('/',auth[_0x678e('0x7')](),controller['create']);router[_0x678e('0xb')](_0x678e('0x9'),auth[_0x678e('0x7')](),controller[_0x678e('0xc')]);router[_0x678e('0xd')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xabe7=['destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','post','create','put','/:id','update','delete'];(function(_0x4b4500,_0x428486){var _0x2fa8a6=function(_0x35d33d){while(--_0x35d33d){_0x4b4500['push'](_0x4b4500['shift']());}};_0x2fa8a6(++_0x428486);}(_0xabe7,0x1c2));var _0x7abe=function(_0x595d74,_0x58378d){_0x595d74=_0x595d74-0x0;var _0x41f72e=_0xabe7[_0x595d74];return _0x41f72e;};'use strict';var multer=require(_0x7abe('0x0'));var util=require(_0x7abe('0x1'));var path=require(_0x7abe('0x2'));var timeout=require(_0x7abe('0x3'));var express=require(_0x7abe('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7abe('0x5'));var interaction=require(_0x7abe('0x6'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x7abe('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x7abe('0x8')]('/',auth[_0x7abe('0x7')](),controller[_0x7abe('0x9')]);router[_0x7abe('0xa')](_0x7abe('0xb'),auth[_0x7abe('0x7')](),controller[_0x7abe('0xc')]);router[_0x7abe('0xd')]('/:id',auth[_0x7abe('0x7')](),controller[_0x7abe('0xe')]);module[_0x7abe('0xf')]=router;
\ No newline at end of file
index c72c358..6fee0ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8d29=['exports','STRING','setDataValue','options','join','getDataValue','BOOLEAN','sequelize'];(function(_0x4b37e8,_0x48b2ec){var _0x3c981b=function(_0x31d358){while(--_0x31d358){_0x4b37e8['push'](_0x4b37e8['shift']());}};_0x3c981b(++_0x48b2ec);}(_0x8d29,0x1cf));var _0x98d2=function(_0x41a483,_0x23a27a){_0x41a483=_0x41a483-0x0;var _0x29804a=_0x8d29[_0x41a483];return _0x29804a;};'use strict';var Sequelize=require(_0x98d2('0x0'));module[_0x98d2('0x1')]={'name':{'type':Sequelize[_0x98d2('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x98d2('0x2')],'set':function(_0x1783c3){this[_0x98d2('0x3')](_0x98d2('0x4'),_0x1783c3?_0x1783c3[_0x98d2('0x5')](''):[]);},'get':function(){return this[_0x98d2('0x6')](_0x98d2('0x4'))?this['getDataValue'](_0x98d2('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x98d2('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x98d2('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x98d2('0x2')]}};
\ No newline at end of file
+var _0xb4e4=['join','getDataValue','split','BOOLEAN','sequelize','exports','STRING'];(function(_0x3d7af5,_0x308d72){var _0x11b446=function(_0x3ff3e4){while(--_0x3ff3e4){_0x3d7af5['push'](_0x3d7af5['shift']());}};_0x11b446(++_0x308d72);}(_0xb4e4,0x170));var _0x4b4e=function(_0x3bb409,_0x36a01f){_0x3bb409=_0x3bb409-0x0;var _0x252d77=_0xb4e4[_0x3bb409];return _0x252d77;};'use strict';var Sequelize=require(_0x4b4e('0x0'));module[_0x4b4e('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x4b4e('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x4b4e('0x2')],'set':function(_0x2805c9){this['setDataValue']('options',_0x2805c9?_0x2805c9[_0x4b4e('0x3')](''):[]);},'get':function(){return this['getDataValue']('options')?this[_0x4b4e('0x4')]('options')[_0x4b4e('0x5')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x4b4e('0x2')]},'record':{'type':Sequelize[_0x4b4e('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x4b4e('0x2')]},'description':{'type':Sequelize[_0x4b4e('0x2')]}};
\ No newline at end of file
index 20e619a..482b834 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4de=['pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','set','Content-Range','reject','update','then','get','ChanSpies','error','stack','name','send','index','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0xa4de,0x10d));var _0xea4d=function(_0x60cd3c,_0x5d5257){_0x60cd3c=_0x60cd3c-0x0;var _0x21f85e=_0xa4de[_0x60cd3c];return _0x21f85e;};'use strict';var emlformat=require(_0xea4d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xea4d('0x1'));var rp=require(_0xea4d('0x2'));var moment=require(_0xea4d('0x3'));var BPromise=require(_0xea4d('0x4'));var Mustache=require(_0xea4d('0x5'));var util=require(_0xea4d('0x6'));var path=require(_0xea4d('0x7'));var sox=require(_0xea4d('0x8'));var csv=require(_0xea4d('0x9'));var ejs=require(_0xea4d('0xa'));var fs=require('fs');var fs_extra=require(_0xea4d('0xb'));var _=require(_0xea4d('0xc'));var squel=require('squel');var crypto=require(_0xea4d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xea4d('0xe'));var toCsv=require(_0xea4d('0x9'));var querystring=require(_0xea4d('0xf'));var Papa=require(_0xea4d('0x10'));var Redis=require(_0xea4d('0x11'));var authService=require(_0xea4d('0x12'));var qs=require(_0xea4d('0x13'));var as=require(_0xea4d('0x14'));var hardwareService=require(_0xea4d('0x15'));var logger=require(_0xea4d('0x16'))(_0xea4d('0x17'));var utils=require(_0xea4d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xea4d('0x19'));var db=require(_0xea4d('0x1a'))['db'];function respondWithStatusCode(_0x2c4651,_0x178f42){_0x178f42=_0x178f42||0xcc;return function(_0x3cb932){if(_0x3cb932){return _0x2c4651['sendStatus'](_0x178f42);}return _0x2c4651[_0xea4d('0x1b')](_0x178f42)[_0xea4d('0x1c')]();};}function respondWithResult(_0x547628,_0x597c50){_0x597c50=_0x597c50||0xc8;return function(_0x38d7b9){if(_0x38d7b9){return _0x547628[_0xea4d('0x1b')](_0x597c50)[_0xea4d('0x1d')](_0x38d7b9);}};}function respondWithFilteredResult(_0x3726c6,_0x16003a){return function(_0x29f706){if(_0x29f706){var _0x1f725f=typeof _0x16003a['offset']===_0xea4d('0x1e')&&typeof _0x16003a['limit']===_0xea4d('0x1e');var _0xe9925d=_0x29f706[_0xea4d('0x1f')];var _0x16370e=_0x1f725f?0x0:_0x16003a[_0xea4d('0x20')];var _0x5d2912=_0x1f725f?_0x29f706['count']:_0x16003a[_0xea4d('0x20')]+_0x16003a['limit'];var _0x2d13f4;if(_0x5d2912>=_0xe9925d){_0x5d2912=_0xe9925d;_0x2d13f4=0xc8;}else{_0x2d13f4=0xce;}_0x3726c6['status'](_0x2d13f4);return _0x3726c6[_0xea4d('0x21')](_0xea4d('0x22'),_0x16370e+'-'+_0x5d2912+'/'+_0xe9925d)['json'](_0x29f706);}return null;};}function patchUpdates(_0x3cfdbd){return function(_0xdd6cd7){try{jsonpatch['apply'](_0xdd6cd7,_0x3cfdbd,!![]);}catch(_0x5c3d72){return BPromise[_0xea4d('0x23')](_0x5c3d72);}return _0xdd6cd7['save']();};}function saveUpdates(_0x515513,_0x17fef2){return function(_0x3c686d){if(_0x3c686d){return _0x3c686d[_0xea4d('0x24')](_0x515513)['then'](function(_0x4db59a){return _0x4db59a;});}return null;};}function removeEntity(_0x110768,_0x180242){return function(_0x103fee){if(_0x103fee){return _0x103fee['destroy']()[_0xea4d('0x25')](function(){var _0x2c10ca=_0x103fee[_0xea4d('0x26')]({'plain':!![]});var _0x32039a=_0xea4d('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x32039a,'resourceId':_0x2c10ca['id']}})[_0xea4d('0x25')](function(){return _0x103fee;});})['then'](function(){_0x110768[_0xea4d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe01672,_0x475567){return function(_0x18e4b0){if(!_0x18e4b0){_0xe01672['sendStatus'](0x194);}return _0x18e4b0;};}function handleError(_0x5325bf,_0x5102e4){_0x5102e4=_0x5102e4||0x1f4;return function(_0x540b0c){logger[_0xea4d('0x28')](_0x540b0c[_0xea4d('0x29')]);if(_0x540b0c[_0xea4d('0x2a')]){delete _0x540b0c[_0xea4d('0x2a')];}_0x5325bf[_0xea4d('0x1b')](_0x5102e4)[_0xea4d('0x2b')](_0x540b0c);};}exports[_0xea4d('0x2c')]=function(_0x563706,_0xd0a393){var _0xc99b7c={},_0x4fef86={},_0x4ad958={'count':0x0,'rows':[]};var _0x289bba=_['map'](db[_0xea4d('0x2d')][_0xea4d('0x2e')],function(_0x4db0e3){return{'name':_0x4db0e3['fieldName'],'type':_0x4db0e3[_0xea4d('0x2f')][_0xea4d('0x30')]};});_0x4fef86[_0xea4d('0x31')]=_['map'](_0x289bba,_0xea4d('0x2a'));_0x4fef86[_0xea4d('0x32')]=_[_0xea4d('0x33')](_0x563706[_0xea4d('0x32')]);_0x4fef86[_0xea4d('0x34')]=_['intersection'](_0x4fef86[_0xea4d('0x31')],_0x4fef86[_0xea4d('0x32')]);_0xc99b7c[_0xea4d('0x35')]=_[_0xea4d('0x36')](_0x4fef86[_0xea4d('0x31')],qs[_0xea4d('0x37')](_0x563706[_0xea4d('0x32')][_0xea4d('0x37')]));_0xc99b7c[_0xea4d('0x35')]=_0xc99b7c[_0xea4d('0x35')][_0xea4d('0x38')]?_0xc99b7c[_0xea4d('0x35')]:_0x4fef86[_0xea4d('0x31')];if(!_0x563706['query'][_0xea4d('0x39')](_0xea4d('0x3a'))){_0xc99b7c[_0xea4d('0x3b')]=qs[_0xea4d('0x3b')](_0x563706[_0xea4d('0x32')][_0xea4d('0x3b')]);_0xc99b7c[_0xea4d('0x20')]=qs['offset'](_0x563706[_0xea4d('0x32')][_0xea4d('0x20')]);}_0xc99b7c[_0xea4d('0x3c')]=qs[_0xea4d('0x3d')](_0x563706[_0xea4d('0x32')][_0xea4d('0x3d')]);_0xc99b7c[_0xea4d('0x3e')]=qs[_0xea4d('0x34')](_[_0xea4d('0x3f')](_0x563706[_0xea4d('0x32')],_0x4fef86['filters']),_0x289bba);if(_0x563706['query'][_0xea4d('0x40')]){_0xc99b7c[_0xea4d('0x3e')]=_[_0xea4d('0x41')](_0xc99b7c[_0xea4d('0x3e')],{'$or':_['map'](_0x289bba,function(_0x23b7a7){if(_0x23b7a7[_0xea4d('0x2f')]!==_0xea4d('0x42')){var _0x1c7318={};_0x1c7318[_0x23b7a7[_0xea4d('0x2a')]]={'$like':'%'+_0x563706[_0xea4d('0x32')][_0xea4d('0x40')]+'%'};return _0x1c7318;}})});}_0xc99b7c=_[_0xea4d('0x41')]({},_0xc99b7c,_0x563706[_0xea4d('0x43')]);var _0x507cd7={'where':_0xc99b7c[_0xea4d('0x3e')]};return db[_0xea4d('0x2d')]['count'](_0x507cd7)[_0xea4d('0x25')](function(_0x12c4f3){_0x4ad958['count']=_0x12c4f3;if(_0x563706[_0xea4d('0x32')]['includeAll']){_0xc99b7c[_0xea4d('0x44')]=[{'all':!![]}];}return db[_0xea4d('0x2d')]['findAll'](_0xc99b7c);})[_0xea4d('0x25')](function(_0x321fe2){_0x4ad958['rows']=_0x321fe2;return _0x4ad958;})['then'](respondWithFilteredResult(_0xd0a393,_0xc99b7c))[_0xea4d('0x45')](handleError(_0xd0a393,null));};exports[_0xea4d('0x46')]=function(_0x33df03,_0x22183e){var _0x4218c7={'raw':![],'where':{'id':_0x33df03[_0xea4d('0x47')]['id']}},_0x43f0da={};_0x43f0da[_0xea4d('0x31')]=_['keys'](db[_0xea4d('0x2d')][_0xea4d('0x2e')]);_0x43f0da[_0xea4d('0x32')]=_[_0xea4d('0x33')](_0x33df03[_0xea4d('0x32')]);_0x43f0da[_0xea4d('0x34')]=_[_0xea4d('0x36')](_0x43f0da[_0xea4d('0x31')],_0x43f0da[_0xea4d('0x32')]);_0x4218c7[_0xea4d('0x35')]=_[_0xea4d('0x36')](_0x43f0da['model'],qs[_0xea4d('0x37')](_0x33df03['query'][_0xea4d('0x37')]));_0x4218c7['attributes']=_0x4218c7['attributes'][_0xea4d('0x38')]?_0x4218c7[_0xea4d('0x35')]:_0x43f0da[_0xea4d('0x31')];if(_0x33df03['query'][_0xea4d('0x48')]){_0x4218c7[_0xea4d('0x44')]=[{'all':!![]}];}_0x4218c7=_[_0xea4d('0x41')]({},_0x4218c7,_0x33df03[_0xea4d('0x43')]);return db[_0xea4d('0x2d')][_0xea4d('0x49')](_0x4218c7)[_0xea4d('0x25')](handleEntityNotFound(_0x22183e,null))[_0xea4d('0x25')](respondWithResult(_0x22183e,null))[_0xea4d('0x45')](handleError(_0x22183e,null));};exports[_0xea4d('0x4a')]=function(_0x5ee70b,_0xa42df1){return db['VoiceChanSpy']['create'](_0x5ee70b[_0xea4d('0x4b')],{})[_0xea4d('0x25')](function(_0x28b07e){var _0xfc9dfc=_0x5ee70b['user']['get']({'plain':!![]});if(!_0xfc9dfc)throw new Error(_0xea4d('0x4c'));if(_0xfc9dfc['role']===_0xea4d('0x4d')){var _0x2bc8cb=_0x28b07e[_0xea4d('0x26')]({'plain':!![]});var _0x12270f=_0xea4d('0x27');return db[_0xea4d('0x4e')][_0xea4d('0x49')]({'where':{'name':_0x12270f,'userProfileId':_0xfc9dfc[_0xea4d('0x4f')]},'raw':!![]})[_0xea4d('0x25')](function(_0x38c426){if(_0x38c426&&_0x38c426[_0xea4d('0x50')]===0x0){return db[_0xea4d('0x51')][_0xea4d('0x4a')]({'name':_0x2bc8cb[_0xea4d('0x2a')],'resourceId':_0x2bc8cb['id'],'type':_0x38c426[_0xea4d('0x2a')],'sectionId':_0x38c426['id']},{})[_0xea4d('0x25')](function(){return _0x28b07e;});}else{return _0x28b07e;}})[_0xea4d('0x45')](function(_0x3bee2e){logger[_0xea4d('0x28')](_0xea4d('0x52'),_0x3bee2e);throw _0x3bee2e;});}return _0x28b07e;})[_0xea4d('0x25')](respondWithResult(_0xa42df1,0xc9))[_0xea4d('0x45')](handleError(_0xa42df1,null));};exports['update']=function(_0x3a270c,_0x5c1c87){if(_0x3a270c['body']['id']){delete _0x3a270c['body']['id'];}return db[_0xea4d('0x2d')]['find']({'where':{'id':_0x3a270c[_0xea4d('0x47')]['id']}})[_0xea4d('0x25')](handleEntityNotFound(_0x5c1c87,null))[_0xea4d('0x25')](saveUpdates(_0x3a270c[_0xea4d('0x4b')],null))[_0xea4d('0x25')](respondWithResult(_0x5c1c87,null))[_0xea4d('0x45')](handleError(_0x5c1c87,null));};exports['destroy']=function(_0x8e5e80,_0x26284){return db['VoiceChanSpy']['find']({'where':{'id':_0x8e5e80[_0xea4d('0x47')]['id']}})[_0xea4d('0x25')](handleEntityNotFound(_0x26284,null))[_0xea4d('0x25')](removeEntity(_0x26284,null))[_0xea4d('0x45')](handleError(_0x26284,null));};
\ No newline at end of file
+var _0x9e9b=['order','sort','where','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','create','body','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','ChanSpies','UserProfileResource','error','stack','index','VoiceChanSpy','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x524a38,_0x2368e7){var _0x553b80=function(_0x98842c){while(--_0x98842c){_0x524a38['push'](_0x524a38['shift']());}};_0x553b80(++_0x2368e7);}(_0x9e9b,0x1a7));var _0xb9e9=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0x9e9b[_0x3ec1da];return _0x472358;};'use strict';var emlformat=require(_0xb9e9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb9e9('0x1'));var rp=require(_0xb9e9('0x2'));var moment=require(_0xb9e9('0x3'));var BPromise=require(_0xb9e9('0x4'));var Mustache=require('mustache');var util=require(_0xb9e9('0x5'));var path=require(_0xb9e9('0x6'));var sox=require('sox');var csv=require(_0xb9e9('0x7'));var ejs=require(_0xb9e9('0x8'));var fs=require('fs');var fs_extra=require(_0xb9e9('0x9'));var _=require(_0xb9e9('0xa'));var squel=require(_0xb9e9('0xb'));var crypto=require(_0xb9e9('0xc'));var jsforce=require(_0xb9e9('0xd'));var deskjs=require(_0xb9e9('0xe'));var toCsv=require(_0xb9e9('0x7'));var querystring=require(_0xb9e9('0xf'));var Papa=require(_0xb9e9('0x10'));var Redis=require(_0xb9e9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb9e9('0x12'));var as=require(_0xb9e9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9e9('0x14'))(_0xb9e9('0x15'));var utils=require(_0xb9e9('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb9e9('0x17'))['db'];function respondWithStatusCode(_0x393cc5,_0x1b15f9){_0x1b15f9=_0x1b15f9||0xcc;return function(_0x1c0b64){if(_0x1c0b64){return _0x393cc5[_0xb9e9('0x18')](_0x1b15f9);}return _0x393cc5['status'](_0x1b15f9)['end']();};}function respondWithResult(_0x3af79d,_0xac8104){_0xac8104=_0xac8104||0xc8;return function(_0x52b6bf){if(_0x52b6bf){return _0x3af79d[_0xb9e9('0x19')](_0xac8104)[_0xb9e9('0x1a')](_0x52b6bf);}};}function respondWithFilteredResult(_0x13b48f,_0x3a3b0e){return function(_0x4a141f){if(_0x4a141f){var _0xf3d58f=typeof _0x3a3b0e[_0xb9e9('0x1b')]===_0xb9e9('0x1c')&&typeof _0x3a3b0e['limit']===_0xb9e9('0x1c');var _0x107be6=_0x4a141f[_0xb9e9('0x1d')];var _0x3f3a27=_0xf3d58f?0x0:_0x3a3b0e[_0xb9e9('0x1b')];var _0x258791=_0xf3d58f?_0x4a141f[_0xb9e9('0x1d')]:_0x3a3b0e[_0xb9e9('0x1b')]+_0x3a3b0e[_0xb9e9('0x1e')];var _0x142694;if(_0x258791>=_0x107be6){_0x258791=_0x107be6;_0x142694=0xc8;}else{_0x142694=0xce;}_0x13b48f[_0xb9e9('0x19')](_0x142694);return _0x13b48f[_0xb9e9('0x1f')](_0xb9e9('0x20'),_0x3f3a27+'-'+_0x258791+'/'+_0x107be6)[_0xb9e9('0x1a')](_0x4a141f);}return null;};}function patchUpdates(_0x1183e2){return function(_0x45b9b0){try{jsonpatch[_0xb9e9('0x21')](_0x45b9b0,_0x1183e2,!![]);}catch(_0x39e10c){return BPromise[_0xb9e9('0x22')](_0x39e10c);}return _0x45b9b0[_0xb9e9('0x23')]();};}function saveUpdates(_0x52a8b9,_0x25b5ed){return function(_0x524afc){if(_0x524afc){return _0x524afc[_0xb9e9('0x24')](_0x52a8b9)[_0xb9e9('0x25')](function(_0x876b4d){return _0x876b4d;});}return null;};}function removeEntity(_0x2cb451,_0x84c9e3){return function(_0x143654){if(_0x143654){return _0x143654[_0xb9e9('0x26')]()[_0xb9e9('0x25')](function(){var _0x5c3dc8=_0x143654['get']({'plain':!![]});var _0x36b8f8=_0xb9e9('0x27');return db[_0xb9e9('0x28')][_0xb9e9('0x26')]({'where':{'type':_0x36b8f8,'resourceId':_0x5c3dc8['id']}})[_0xb9e9('0x25')](function(){return _0x143654;});})[_0xb9e9('0x25')](function(){_0x2cb451['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5543b2,_0x4f44cf){return function(_0x28a35a){if(!_0x28a35a){_0x5543b2['sendStatus'](0x194);}return _0x28a35a;};}function handleError(_0x5ea227,_0x12262b){_0x12262b=_0x12262b||0x1f4;return function(_0x51bd72){logger[_0xb9e9('0x29')](_0x51bd72[_0xb9e9('0x2a')]);if(_0x51bd72['name']){delete _0x51bd72['name'];}_0x5ea227[_0xb9e9('0x19')](_0x12262b)['send'](_0x51bd72);};}exports[_0xb9e9('0x2b')]=function(_0x5d6102,_0x5a1992){var _0xd2587e={},_0x4332a2={},_0x2c0f42={'count':0x0,'rows':[]};var _0x5050a5=_['map'](db[_0xb9e9('0x2c')]['rawAttributes'],function(_0x22f3ad){return{'name':_0x22f3ad['fieldName'],'type':_0x22f3ad['type'][_0xb9e9('0x2d')]};});_0x4332a2[_0xb9e9('0x2e')]=_['map'](_0x5050a5,_0xb9e9('0x2f'));_0x4332a2[_0xb9e9('0x30')]=_[_0xb9e9('0x31')](_0x5d6102['query']);_0x4332a2[_0xb9e9('0x32')]=_[_0xb9e9('0x33')](_0x4332a2['model'],_0x4332a2[_0xb9e9('0x30')]);_0xd2587e[_0xb9e9('0x34')]=_[_0xb9e9('0x33')](_0x4332a2[_0xb9e9('0x2e')],qs[_0xb9e9('0x35')](_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x35')]));_0xd2587e['attributes']=_0xd2587e[_0xb9e9('0x34')][_0xb9e9('0x36')]?_0xd2587e['attributes']:_0x4332a2[_0xb9e9('0x2e')];if(!_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x37')](_0xb9e9('0x38'))){_0xd2587e[_0xb9e9('0x1e')]=qs[_0xb9e9('0x1e')](_0x5d6102[_0xb9e9('0x30')]['limit']);_0xd2587e[_0xb9e9('0x1b')]=qs[_0xb9e9('0x1b')](_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x1b')]);}_0xd2587e[_0xb9e9('0x39')]=qs[_0xb9e9('0x3a')](_0x5d6102[_0xb9e9('0x30')]['sort']);_0xd2587e[_0xb9e9('0x3b')]=qs[_0xb9e9('0x32')](_['pick'](_0x5d6102[_0xb9e9('0x30')],_0x4332a2['filters']),_0x5050a5);if(_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x3c')]){_0xd2587e['where']=_[_0xb9e9('0x3d')](_0xd2587e[_0xb9e9('0x3b')],{'$or':_[_0xb9e9('0x3e')](_0x5050a5,function(_0x58d1bd){if(_0x58d1bd['type']!=='VIRTUAL'){var _0x692047={};_0x692047[_0x58d1bd[_0xb9e9('0x2f')]]={'$like':'%'+_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x3c')]+'%'};return _0x692047;}})});}_0xd2587e=_[_0xb9e9('0x3d')]({},_0xd2587e,_0x5d6102[_0xb9e9('0x3f')]);var _0x235dfd={'where':_0xd2587e[_0xb9e9('0x3b')]};return db[_0xb9e9('0x2c')]['count'](_0x235dfd)['then'](function(_0x42553){_0x2c0f42['count']=_0x42553;if(_0x5d6102[_0xb9e9('0x30')][_0xb9e9('0x40')]){_0xd2587e[_0xb9e9('0x41')]=[{'all':!![]}];}return db[_0xb9e9('0x2c')][_0xb9e9('0x42')](_0xd2587e);})[_0xb9e9('0x25')](function(_0x4e6e48){_0x2c0f42[_0xb9e9('0x43')]=_0x4e6e48;return _0x2c0f42;})[_0xb9e9('0x25')](respondWithFilteredResult(_0x5a1992,_0xd2587e))[_0xb9e9('0x44')](handleError(_0x5a1992,null));};exports[_0xb9e9('0x45')]=function(_0x2d5aef,_0x5bada6){var _0x72110a={'raw':![],'where':{'id':_0x2d5aef['params']['id']}},_0x23a421={};_0x23a421[_0xb9e9('0x2e')]=_[_0xb9e9('0x31')](db['VoiceChanSpy']['rawAttributes']);_0x23a421[_0xb9e9('0x30')]=_['keys'](_0x2d5aef[_0xb9e9('0x30')]);_0x23a421[_0xb9e9('0x32')]=_['intersection'](_0x23a421['model'],_0x23a421['query']);_0x72110a[_0xb9e9('0x34')]=_['intersection'](_0x23a421[_0xb9e9('0x2e')],qs[_0xb9e9('0x35')](_0x2d5aef['query'][_0xb9e9('0x35')]));_0x72110a['attributes']=_0x72110a[_0xb9e9('0x34')]['length']?_0x72110a[_0xb9e9('0x34')]:_0x23a421[_0xb9e9('0x2e')];if(_0x2d5aef[_0xb9e9('0x30')][_0xb9e9('0x40')]){_0x72110a[_0xb9e9('0x41')]=[{'all':!![]}];}_0x72110a=_[_0xb9e9('0x3d')]({},_0x72110a,_0x2d5aef[_0xb9e9('0x3f')]);return db[_0xb9e9('0x2c')]['find'](_0x72110a)[_0xb9e9('0x25')](handleEntityNotFound(_0x5bada6,null))['then'](respondWithResult(_0x5bada6,null))[_0xb9e9('0x44')](handleError(_0x5bada6,null));};exports[_0xb9e9('0x46')]=function(_0x4640a0,_0x315620){return db[_0xb9e9('0x2c')]['create'](_0x4640a0[_0xb9e9('0x47')],{})[_0xb9e9('0x25')](function(_0x36541e){var _0x135a14=_0x4640a0[_0xb9e9('0x48')][_0xb9e9('0x49')]({'plain':!![]});if(!_0x135a14)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x135a14[_0xb9e9('0x4a')]===_0xb9e9('0x48')){var _0x5a61bf=_0x36541e['get']({'plain':!![]});var _0x51c531=_0xb9e9('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x51c531,'userProfileId':_0x135a14[_0xb9e9('0x4b')]},'raw':!![]})[_0xb9e9('0x25')](function(_0x26be11){if(_0x26be11&&_0x26be11[_0xb9e9('0x4c')]===0x0){return db[_0xb9e9('0x28')]['create']({'name':_0x5a61bf[_0xb9e9('0x2f')],'resourceId':_0x5a61bf['id'],'type':_0x26be11[_0xb9e9('0x2f')],'sectionId':_0x26be11['id']},{})[_0xb9e9('0x25')](function(){return _0x36541e;});}else{return _0x36541e;}})[_0xb9e9('0x44')](function(_0x5af6df){logger[_0xb9e9('0x29')](_0xb9e9('0x4d'),_0x5af6df);throw _0x5af6df;});}return _0x36541e;})[_0xb9e9('0x25')](respondWithResult(_0x315620,0xc9))[_0xb9e9('0x44')](handleError(_0x315620,null));};exports[_0xb9e9('0x24')]=function(_0x56540a,_0x1199bb){if(_0x56540a['body']['id']){delete _0x56540a[_0xb9e9('0x47')]['id'];}return db[_0xb9e9('0x2c')][_0xb9e9('0x4e')]({'where':{'id':_0x56540a['params']['id']}})['then'](handleEntityNotFound(_0x1199bb,null))['then'](saveUpdates(_0x56540a[_0xb9e9('0x47')],null))[_0xb9e9('0x25')](respondWithResult(_0x1199bb,null))[_0xb9e9('0x44')](handleError(_0x1199bb,null));};exports[_0xb9e9('0x26')]=function(_0x4ecae3,_0x12f6af){return db[_0xb9e9('0x2c')]['find']({'where':{'id':_0x4ecae3[_0xb9e9('0x4f')]['id']}})['then'](handleEntityNotFound(_0x12f6af,null))[_0xb9e9('0x25')](removeEntity(_0x12f6af,null))[_0xb9e9('0x44')](handleError(_0x12f6af,null));};
\ No newline at end of file
index fa05869..9799d31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cb7=['system','push','merge','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','findAll','agent','then','catch','exports','define','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s'];(function(_0x5b3599,_0x4e7c37){var _0xf8ccd4=function(_0x424953){while(--_0x424953){_0x5b3599['push'](_0x5b3599['shift']());}};_0xf8ccd4(++_0x4e7c37);}(_0x6cb7,0xd6));var _0x76cb=function(_0x30d20c,_0x424001){_0x30d20c=_0x30d20c-0x0;var _0x22c36f=_0x6cb7[_0x30d20c];return _0x22c36f;};'use strict';var _=require(_0x76cb('0x0'));var util=require(_0x76cb('0x1'));var BPromise=require(_0x76cb('0x2'));var attributes=require(_0x76cb('0x3'));var getUserApplications=function(_0x44850f,_0x37a5b4,_0x289dcf){var _0x114f0d=0x1;var _0x209ef4=[];var _0x393734={'context':_0x37a5b4[_0x76cb('0x4')]||_0x76cb('0x5'),'exten':util[_0x76cb('0x6')](_0x76cb('0x7'),_0x44850f['prefix'],_0x289dcf),'type':_0x76cb('0x8'),'isApp':![],'ChanSpyId':_0x44850f['id'],'UserId':_0x37a5b4['id']};_0x209ef4[_0x76cb('0x9')](_[_0x76cb('0xa')]({'app':'Set','appdata':util[_0x76cb('0x6')]('CDR(type)=%s',_0x76cb('0xb')),'priority':_0x114f0d++},_0x393734));if(_0x44850f[_0x76cb('0xc')]){_0x209ef4[_0x76cb('0x9')](_[_0x76cb('0xa')]({'app':_0x76cb('0xd'),'appdata':util[_0x76cb('0x6')]('${UNIQUEID}.%s,a',_0x44850f[_0x76cb('0xe')]),'priority':_0x114f0d++},_0x393734));}if(_0x44850f[_0x76cb('0xf')]){_0x209ef4[_0x76cb('0x9')](_['merge']({'app':_0x76cb('0x10'),'appdata':_0x44850f[_0x76cb('0x11')],'priority':_0x114f0d++},_0x393734));}_0x209ef4['push'](_[_0x76cb('0xa')]({'app':_0x76cb('0x12'),'appdata':util[_0x76cb('0x6')](_0x76cb('0x13'),_0x37a5b4[_0x76cb('0x14')],_0x44850f[_0x76cb('0x15')]?_0x44850f['options'][_0x76cb('0x16')](''):''),'priority':_0x114f0d++},_0x393734));if(_0x44850f[_0x76cb('0xc')]){_0x209ef4[_0x76cb('0x9')](_[_0x76cb('0xa')]({'app':_0x76cb('0x17'),'priority':_0x114f0d++},_0x393734));}return _0x209ef4;};var getChanSpyApplications=function(_0x24f7c9,_0x4e1dcf){var _0x5cf577=[];for(var _0x90e538=0x0,_0x2eaf71=0x1;_0x90e538<_0x4e1dcf[_0x76cb('0x18')];_0x90e538++,_0x2eaf71=0x1){_0x5cf577=_0x5cf577[_0x76cb('0x19')](getUserApplications(_0x24f7c9,_0x4e1dcf[_0x90e538],_0x4e1dcf[_0x90e538][_0x76cb('0x1a')]));if(_0x4e1dcf[_0x90e538][_0x76cb('0x1a')]!=_0x4e1dcf[_0x90e538]['name']){_0x5cf577=_0x5cf577[_0x76cb('0x19')](getUserApplications(_0x24f7c9,_0x4e1dcf[_0x90e538],_0x4e1dcf[_0x90e538][_0x76cb('0x14')]));}}return _0x5cf577;};var getChanSpyPromise=function(_0x2cd4c5,_0x7583c2){return new BPromise(function(_0x1e7cb8,_0x3426ef){return _0x2cd4c5['User'][_0x76cb('0x1b')]({'attributes':['id',_0x76cb('0x14'),_0x76cb('0x1a')],'where':{'role':_0x76cb('0x1c'),'chanspy':!![]},'raw':!![]})[_0x76cb('0x1d')](function(_0x3b35c8){if(_0x3b35c8){return _0x1e7cb8(getChanSpyApplications(_0x7583c2,_0x3b35c8));}return _0x1e7cb8([]);})[_0x76cb('0x1e')](function(_0x2579d2){_0x3426ef(_0x2579d2);});});};module[_0x76cb('0x1f')]=function(_0x1d0736,_0x163e68){var _0x5db725=_0x1d0736['models'];return _0x1d0736[_0x76cb('0x20')]('VoiceChanSpy',attributes,{'tableName':_0x76cb('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x591dc5,_0x260a95,_0x5a0410){return getChanSpyPromise(_0x5db725,_0x591dc5)[_0x76cb('0x1d')](function(_0x22cdb9){if(_0x22cdb9&&_0x22cdb9[_0x76cb('0x18')]){return _0x5db725[_0x76cb('0x22')]['bulkCreate'](_0x22cdb9);}})[_0x76cb('0x1d')](function(){_0x5a0410();})['catch'](function(_0x4ed1e4){_0x5a0410(_0x4ed1e4);});},'afterUpdate':function(_0x4d4849,_0x373353,_0x2f1982){return _0x5db725[_0x76cb('0x22')][_0x76cb('0x23')]({'where':{'ChanSpyId':_0x4d4849['id']}})[_0x76cb('0x1d')](function(){return getChanSpyPromise(_0x5db725,_0x4d4849);})[_0x76cb('0x1d')](function(_0x5e99a0){if(_0x5e99a0&&_0x5e99a0[_0x76cb('0x18')]){return _0x5db725['VoiceExtension'][_0x76cb('0x24')](_0x5e99a0);}})['then'](function(){_0x2f1982();})['catch'](function(_0x28bc2c){_0x2f1982(_0x28bc2c);});},'afterDestroy':function(_0x19b329,_0x1e4a7b,_0x3852e1){return _0x5db725['VoiceExtension'][_0x76cb('0x23')]({'where':{'ChanSpyId':_0x19b329['id']}})[_0x76cb('0x1d')](function(){_0x3852e1();})[_0x76cb('0x1e')](function(_0x318434){_0x3852e1(_0x318434);});}}});};
\ No newline at end of file
+var _0xb432=['name','options','join','StopMixMonitor','concat','internal','findAll','agent','catch','exports','models','define','VoiceChanSpy','length','VoiceExtension','bulkCreate','then','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','auth','password','ChanSpy','SIP/%s,%s'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xb432,0x18d));var _0x2b43=function(_0xc5fe,_0x261bbb){_0xc5fe=_0xc5fe-0x0;var _0x3d9e2c=_0xb432[_0xc5fe];return _0x3d9e2c;};'use strict';var _=require(_0x2b43('0x0'));var util=require('util');var BPromise=require(_0x2b43('0x1'));var attributes=require(_0x2b43('0x2'));var getUserApplications=function(_0x36548e,_0x30d191,_0x570159){var _0x3ed16c=0x1;var _0x27055f=[];var _0x326f83={'context':_0x30d191[_0x2b43('0x3')]||_0x2b43('0x4'),'exten':util[_0x2b43('0x5')](_0x2b43('0x6'),_0x36548e[_0x2b43('0x7')],_0x570159),'type':_0x2b43('0x8'),'isApp':![],'ChanSpyId':_0x36548e['id'],'UserId':_0x30d191['id']};_0x27055f[_0x2b43('0x9')](_[_0x2b43('0xa')]({'app':_0x2b43('0xb'),'appdata':util[_0x2b43('0x5')](_0x2b43('0xc'),_0x2b43('0xd')),'priority':_0x3ed16c++},_0x326f83));if(_0x36548e[_0x2b43('0xe')]){_0x27055f[_0x2b43('0x9')](_[_0x2b43('0xa')]({'app':_0x2b43('0xf'),'appdata':util[_0x2b43('0x5')](_0x2b43('0x10'),_0x36548e['recordingFormat']),'priority':_0x3ed16c++},_0x326f83));}if(_0x36548e[_0x2b43('0x11')]){_0x27055f[_0x2b43('0x9')](_['merge']({'app':'Authenticate','appdata':_0x36548e[_0x2b43('0x12')],'priority':_0x3ed16c++},_0x326f83));}_0x27055f[_0x2b43('0x9')](_[_0x2b43('0xa')]({'app':_0x2b43('0x13'),'appdata':util[_0x2b43('0x5')](_0x2b43('0x14'),_0x30d191[_0x2b43('0x15')],_0x36548e[_0x2b43('0x16')]?_0x36548e['options'][_0x2b43('0x17')](''):''),'priority':_0x3ed16c++},_0x326f83));if(_0x36548e[_0x2b43('0xe')]){_0x27055f['push'](_[_0x2b43('0xa')]({'app':_0x2b43('0x18'),'priority':_0x3ed16c++},_0x326f83));}return _0x27055f;};var getChanSpyApplications=function(_0x174edc,_0x58a05d){var _0x170062=[];for(var _0x10d5cd=0x0,_0xb1b9b3=0x1;_0x10d5cd<_0x58a05d['length'];_0x10d5cd++,_0xb1b9b3=0x1){_0x170062=_0x170062[_0x2b43('0x19')](getUserApplications(_0x174edc,_0x58a05d[_0x10d5cd],_0x58a05d[_0x10d5cd]['internal']));if(_0x58a05d[_0x10d5cd][_0x2b43('0x1a')]!=_0x58a05d[_0x10d5cd][_0x2b43('0x15')]){_0x170062=_0x170062[_0x2b43('0x19')](getUserApplications(_0x174edc,_0x58a05d[_0x10d5cd],_0x58a05d[_0x10d5cd][_0x2b43('0x15')]));}}return _0x170062;};var getChanSpyPromise=function(_0x4479b9,_0x1610f9){return new BPromise(function(_0xa22f8c,_0x39cd9d){return _0x4479b9['User'][_0x2b43('0x1b')]({'attributes':['id',_0x2b43('0x15'),_0x2b43('0x1a')],'where':{'role':_0x2b43('0x1c'),'chanspy':!![]},'raw':!![]})['then'](function(_0x64959c){if(_0x64959c){return _0xa22f8c(getChanSpyApplications(_0x1610f9,_0x64959c));}return _0xa22f8c([]);})[_0x2b43('0x1d')](function(_0x21d2df){_0x39cd9d(_0x21d2df);});});};module[_0x2b43('0x1e')]=function(_0x3e10b5,_0x4f62ed){var _0x20ab8b=_0x3e10b5[_0x2b43('0x1f')];return _0x3e10b5[_0x2b43('0x20')](_0x2b43('0x21'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x29a660,_0x1e4a53,_0x2c55eb){return getChanSpyPromise(_0x20ab8b,_0x29a660)['then'](function(_0x27edb6){if(_0x27edb6&&_0x27edb6[_0x2b43('0x22')]){return _0x20ab8b[_0x2b43('0x23')][_0x2b43('0x24')](_0x27edb6);}})['then'](function(){_0x2c55eb();})[_0x2b43('0x1d')](function(_0x3b6e62){_0x2c55eb(_0x3b6e62);});},'afterUpdate':function(_0x3ed4c7,_0x2032af,_0x5f4851){return _0x20ab8b[_0x2b43('0x23')]['destroy']({'where':{'ChanSpyId':_0x3ed4c7['id']}})['then'](function(){return getChanSpyPromise(_0x20ab8b,_0x3ed4c7);})['then'](function(_0x3b9e11){if(_0x3b9e11&&_0x3b9e11[_0x2b43('0x22')]){return _0x20ab8b[_0x2b43('0x23')][_0x2b43('0x24')](_0x3b9e11);}})[_0x2b43('0x25')](function(){_0x5f4851();})[_0x2b43('0x1d')](function(_0x3cfe2f){_0x5f4851(_0x3cfe2f);});},'afterDestroy':function(_0x3a675e,_0x187fe1,_0x3660e7){return _0x20ab8b[_0x2b43('0x23')]['destroy']({'where':{'ChanSpyId':_0x3a675e['id']}})[_0x2b43('0x25')](function(){_0x3660e7();})[_0x2b43('0x1d')](function(_0x3e354d){_0x3660e7(_0x3e354d);});}}});};
\ No newline at end of file
index 73ac4ad..b693e33 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b73=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1b73,0x1d5));var _0x31b7=function(_0x25116b,_0x406ed0){_0x25116b=_0x25116b-0x0;var _0x5ce67b=_0x1b73[_0x25116b];return _0x5ce67b;};'use strict';var _=require('lodash');var util=require(_0x31b7('0x0'));var moment=require(_0x31b7('0x1'));var BPromise=require(_0x31b7('0x2'));var rs=require(_0x31b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x31b7('0x5'))(_0x31b7('0x6'));var config=require('../../config/environment');var jayson=require(_0x31b7('0x7'));var client=jayson[_0x31b7('0x8')][_0x31b7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x502838,_0x445dbe,_0x1a730f){return new BPromise(function(_0x86ef8e,_0x19b92a){return client[_0x31b7('0xa')](_0x502838,_0x1a730f)[_0x31b7('0xb')](function(_0x3d2b41){logger['info'](_0x31b7('0xc'),_0x445dbe,_0x31b7('0xd'));logger[_0x31b7('0xe')](_0x31b7('0xf'),_0x445dbe,_0x31b7('0xd'),JSON[_0x31b7('0x10')](_0x3d2b41));if(_0x3d2b41[_0x31b7('0x11')]){if(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x12')]===0x1f4){logger[_0x31b7('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x19b92a(_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);}logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3d2b41[_0x31b7('0x11')][_0x31b7('0x13')]);return _0x86ef8e(_0x3d2b41[_0x31b7('0x11')]['message']);}else{logger[_0x31b7('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0x445dbe,_0x31b7('0xd'));_0x86ef8e(_0x3d2b41[_0x31b7('0x15')]['message']);}})[_0x31b7('0x16')](function(_0x3c71ae){logger[_0x31b7('0x11')](_0x31b7('0xc'),_0x445dbe,_0x3c71ae);_0x19b92a(_0x3c71ae);});});}
\ No newline at end of file
+var _0xbc9d=['randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x59509b,_0x384196){_0x59509b=_0x59509b-0x0;var _0x43a850=_0xbc9d[_0x59509b];return _0x43a850;};'use strict';var _=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var moment=require(_0xdbc9('0x2'));var BPromise=require(_0xdbc9('0x3'));var rs=require(_0xdbc9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xdbc9('0x5'))(_0xdbc9('0x6'));var config=require(_0xdbc9('0x7'));var jayson=require(_0xdbc9('0x8'));var client=jayson[_0xdbc9('0x9')][_0xdbc9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381a0e,_0x4a9246,_0x2dbd23){return new BPromise(function(_0x181f8a,_0x3d4918){return client['request'](_0x381a0e,_0x2dbd23)[_0xdbc9('0xb')](function(_0x53cff1){logger['info'](_0xdbc9('0xc'),_0x4a9246,_0xdbc9('0xd'));logger[_0xdbc9('0xe')](_0xdbc9('0xf'),_0x4a9246,'request\x20sent',JSON[_0xdbc9('0x10')](_0x53cff1));if(_0x53cff1[_0xdbc9('0x11')]){if(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x12')]===0x1f4){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1['error']['message']);return _0x3d4918(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x53cff1[_0xdbc9('0x11')]['message']);return _0x181f8a(_0x53cff1[_0xdbc9('0x11')][_0xdbc9('0x13')]);}else{logger[_0xdbc9('0x14')]('VoiceChanSpy,\x20%s,\x20%s',_0x4a9246,_0xdbc9('0xd'));_0x181f8a(_0x53cff1[_0xdbc9('0x15')]['message']);}})[_0xdbc9('0x16')](function(_0x37856d){logger[_0xdbc9('0x11')](_0xdbc9('0xc'),_0x4a9246,_0x37856d);_0x3d4918(_0x37856d);});});}
\ No newline at end of file
index 76fe42e..eaf6e6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4768=['./voiceContext.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1fddd6,_0x35c1c8){var _0xdd2ba2=function(_0x39d1d7){while(--_0x39d1d7){_0x1fddd6['push'](_0x1fddd6['shift']());}};_0xdd2ba2(++_0x35c1c8);}(_0x4768,0x65));var _0x8476=function(_0x3b0201,_0xb39cfb){_0x3b0201=_0x3b0201-0x0;var _0x543194=_0x4768[_0x3b0201];return _0x543194;};'use strict';var multer=require(_0x8476('0x0'));var util=require(_0x8476('0x1'));var path=require('path');var timeout=require(_0x8476('0x2'));var express=require(_0x8476('0x3'));var router=express[_0x8476('0x4')]();var fs_extra=require(_0x8476('0x5'));var auth=require(_0x8476('0x6'));var interaction=require(_0x8476('0x7'));var config=require(_0x8476('0x8'));var controller=require(_0x8476('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x8476('0xa')]);router[_0x8476('0xb')](_0x8476('0xc'),auth[_0x8476('0xd')](),controller[_0x8476('0xe')]);router[_0x8476('0xf')]('/',auth[_0x8476('0xd')](),controller[_0x8476('0x10')]);router[_0x8476('0x11')](_0x8476('0xc'),auth[_0x8476('0xd')](),controller[_0x8476('0x12')]);router[_0x8476('0x13')]('/:id',auth[_0x8476('0xd')](),controller[_0x8476('0x14')]);module[_0x8476('0x15')]=router;
\ No newline at end of file
+var _0x7176=['delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x18f270,_0x4efe01){var _0x4a80f0=function(_0x483391){while(--_0x483391){_0x18f270['push'](_0x18f270['shift']());}};_0x4a80f0(++_0x4efe01);}(_0x7176,0xa3));var _0x6717=function(_0x4ddc73,_0x523949){_0x4ddc73=_0x4ddc73-0x0;var _0x167cca=_0x7176[_0x4ddc73];return _0x167cca;};'use strict';var multer=require(_0x6717('0x0'));var util=require('util');var path=require(_0x6717('0x1'));var timeout=require(_0x6717('0x2'));var express=require(_0x6717('0x3'));var router=express['Router']();var fs_extra=require(_0x6717('0x4'));var auth=require(_0x6717('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6717('0x6'));var controller=require(_0x6717('0x7'));router[_0x6717('0x8')]('/',auth[_0x6717('0x9')](),controller[_0x6717('0xa')]);router['get'](_0x6717('0xb'),auth[_0x6717('0x9')](),controller[_0x6717('0xc')]);router[_0x6717('0xd')]('/',auth[_0x6717('0x9')](),controller[_0x6717('0xe')]);router[_0x6717('0xf')](_0x6717('0xb'),auth[_0x6717('0x9')](),controller[_0x6717('0x10')]);router[_0x6717('0x11')](_0x6717('0xb'),auth[_0x6717('0x9')](),controller[_0x6717('0x12')]);module[_0x6717('0x13')]=router;
\ No newline at end of file
index 1435d6a..e51e616 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e40=['sequelize','STRING','BOOLEAN'];(function(_0x4cfdb7,_0x3ab137){var _0x186b5a=function(_0x46a9f1){while(--_0x46a9f1){_0x4cfdb7['push'](_0x4cfdb7['shift']());}};_0x186b5a(++_0x3ab137);}(_0x2e40,0xf0));var _0x02e4=function(_0x532612,_0xa6442c){_0x532612=_0x532612-0x0;var _0x41f9ca=_0x2e40[_0x532612];return _0x41f9ca;};'use strict';var Sequelize=require(_0x02e4('0x0'));module['exports']={'name':{'type':Sequelize[_0x02e4('0x1')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x02e4('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x337d=['BOOLEAN','sequelize','exports','name','STRING'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x337d,0x17d));var _0xd337=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x337d[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0xd337('0x0'));module[_0xd337('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd337('0x2')},'description':{'type':Sequelize[_0xd337('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xd337('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index b02369f..f64b239 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc6e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','Contexts','stack','name','send','index','map','VoiceContext','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','rows','params','rawAttributes','include','find','create','readFileSync','root','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','render','join','chan_sip.so','eml-format','rimraf'];(function(_0x24d540,_0x283d56){var _0x5427a5=function(_0x312313){while(--_0x312313){_0x24d540['push'](_0x24d540['shift']());}};_0x5427a5(++_0x283d56);}(_0xcc6e,0x67));var _0xecc6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcc6e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xecc6('0x0'));var rimraf=require(_0xecc6('0x1'));var zipdir=require(_0xecc6('0x2'));var jsonpatch=require(_0xecc6('0x3'));var rp=require(_0xecc6('0x4'));var moment=require(_0xecc6('0x5'));var BPromise=require(_0xecc6('0x6'));var Mustache=require(_0xecc6('0x7'));var util=require(_0xecc6('0x8'));var path=require(_0xecc6('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xecc6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xecc6('0xb'));var squel=require('squel');var crypto=require(_0xecc6('0xc'));var jsforce=require(_0xecc6('0xd'));var deskjs=require(_0xecc6('0xe'));var toCsv=require(_0xecc6('0xf'));var querystring=require(_0xecc6('0x10'));var Papa=require(_0xecc6('0x11'));var Redis=require(_0xecc6('0x12'));var authService=require(_0xecc6('0x13'));var qs=require(_0xecc6('0x14'));var as=require(_0xecc6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xecc6('0x16'))(_0xecc6('0x17'));var utils=require('../../config/utils');var config=require(_0xecc6('0x18'));var licenseUtil=require(_0xecc6('0x19'));var db=require(_0xecc6('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xecc6('0x1b')][_0xecc6('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x40fe02,_0x2a9a38,_0x10fe9c,_0x17e3e9){return new BPromise(function(_0x1fc920,_0x45f490){var _0x18a4c7=_0x17e3e9||client;return _0x18a4c7['request'](_0x40fe02,_0x10fe9c)[_0xecc6('0x1d')](function(_0x11b47a){logger[_0xecc6('0x1e')](_0xecc6('0x1f'),_0x2a9a38,_0xecc6('0x20'));logger[_0xecc6('0x21')](_0xecc6('0x22'),_0x2a9a38,_0xecc6('0x20'),JSON[_0xecc6('0x23')](_0x11b47a));if(_0x11b47a['error']){if(_0x11b47a[_0xecc6('0x24')]['code']===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x2a9a38,_0x11b47a[_0xecc6('0x24')][_0xecc6('0x25')]);return _0x45f490(_0x11b47a[_0xecc6('0x24')][_0xecc6('0x25')]);}logger[_0xecc6('0x24')](_0xecc6('0x1f'),_0x2a9a38,_0x11b47a[_0xecc6('0x24')][_0xecc6('0x25')]);return _0x1fc920(_0x11b47a['error'][_0xecc6('0x25')]);}else{logger[_0xecc6('0x1e')](_0xecc6('0x1f'),_0x2a9a38,'request\x20sent');_0x1fc920(_0x11b47a[_0xecc6('0x26')][_0xecc6('0x25')]);}})[_0xecc6('0x27')](function(_0x3378f6){logger['error']('VoiceContext,\x20%s,\x20%s',_0x2a9a38,_0x3378f6);_0x45f490(_0x3378f6);});});}function respondWithStatusCode(_0x2bcc50,_0x17c246){_0x17c246=_0x17c246||0xcc;return function(_0x5a031c){if(_0x5a031c){return _0x2bcc50[_0xecc6('0x28')](_0x17c246);}return _0x2bcc50[_0xecc6('0x29')](_0x17c246)[_0xecc6('0x2a')]();};}function respondWithResult(_0x126df3,_0x1af61a){_0x1af61a=_0x1af61a||0xc8;return function(_0xa5c1dc){if(_0xa5c1dc){return _0x126df3['status'](_0x1af61a)[_0xecc6('0x2b')](_0xa5c1dc);}};}function respondWithFilteredResult(_0x2e35f8,_0x37c77d){return function(_0x1a87ea){if(_0x1a87ea){var _0x442a66=typeof _0x37c77d[_0xecc6('0x2c')]===_0xecc6('0x2d')&&typeof _0x37c77d[_0xecc6('0x2e')]===_0xecc6('0x2d');var _0x7ea24f=_0x1a87ea[_0xecc6('0x2f')];var _0x53f1e7=_0x442a66?0x0:_0x37c77d[_0xecc6('0x2c')];var _0x2179b3=_0x442a66?_0x1a87ea[_0xecc6('0x2f')]:_0x37c77d[_0xecc6('0x2c')]+_0x37c77d[_0xecc6('0x2e')];var _0x1a11b8;if(_0x2179b3>=_0x7ea24f){_0x2179b3=_0x7ea24f;_0x1a11b8=0xc8;}else{_0x1a11b8=0xce;}_0x2e35f8[_0xecc6('0x29')](_0x1a11b8);return _0x2e35f8[_0xecc6('0x30')](_0xecc6('0x31'),_0x53f1e7+'-'+_0x2179b3+'/'+_0x7ea24f)[_0xecc6('0x2b')](_0x1a87ea);}return null;};}function patchUpdates(_0x17a561){return function(_0x42841a){try{jsonpatch[_0xecc6('0x32')](_0x42841a,_0x17a561,!![]);}catch(_0x27e6fd){return BPromise['reject'](_0x27e6fd);}return _0x42841a[_0xecc6('0x33')]();};}function saveUpdates(_0xc1e2ea,_0x4bf225){return function(_0x648822){if(_0x648822){return _0x648822[_0xecc6('0x34')](_0xc1e2ea)[_0xecc6('0x1d')](function(_0x5a0dd3){return _0x5a0dd3;});}return null;};}function removeEntity(_0x301eb0,_0xa70bff){return function(_0x33838d){if(_0x33838d){return _0x33838d[_0xecc6('0x35')]()['then'](function(){var _0x31310c=_0x33838d[_0xecc6('0x36')]({'plain':!![]});var _0x3fe027=_0xecc6('0x37');return db['UserProfileResource']['destroy']({'where':{'type':_0x3fe027,'resourceId':_0x31310c['id']}})['then'](function(){return _0x33838d;});})['then'](function(){_0x301eb0[_0xecc6('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e4827,_0x47d5db){return function(_0x8265a3){if(!_0x8265a3){_0x1e4827[_0xecc6('0x28')](0x194);}return _0x8265a3;};}function handleError(_0x31ad7d,_0x44d6f8){_0x44d6f8=_0x44d6f8||0x1f4;return function(_0x2a53eb){logger[_0xecc6('0x24')](_0x2a53eb[_0xecc6('0x38')]);if(_0x2a53eb[_0xecc6('0x39')]){delete _0x2a53eb['name'];}_0x31ad7d[_0xecc6('0x29')](_0x44d6f8)[_0xecc6('0x3a')](_0x2a53eb);};}exports[_0xecc6('0x3b')]=function(_0x2b6659,_0x5ea020){var _0x3f1c97={},_0x1e317d={},_0xab9455={'count':0x0,'rows':[]};var _0x31e4fc=_[_0xecc6('0x3c')](db[_0xecc6('0x3d')]['rawAttributes'],function(_0xfb8dd7){return{'name':_0xfb8dd7['fieldName'],'type':_0xfb8dd7[_0xecc6('0x3e')][_0xecc6('0x3f')]};});_0x1e317d[_0xecc6('0x40')]=_[_0xecc6('0x3c')](_0x31e4fc,_0xecc6('0x39'));_0x1e317d[_0xecc6('0x41')]=_[_0xecc6('0x42')](_0x2b6659['query']);_0x1e317d[_0xecc6('0x43')]=_[_0xecc6('0x44')](_0x1e317d[_0xecc6('0x40')],_0x1e317d['query']);_0x3f1c97[_0xecc6('0x45')]=_[_0xecc6('0x44')](_0x1e317d['model'],qs['fields'](_0x2b6659['query'][_0xecc6('0x46')]));_0x3f1c97[_0xecc6('0x45')]=_0x3f1c97[_0xecc6('0x45')][_0xecc6('0x47')]?_0x3f1c97[_0xecc6('0x45')]:_0x1e317d[_0xecc6('0x40')];if(!_0x2b6659['query'][_0xecc6('0x48')](_0xecc6('0x49'))){_0x3f1c97['limit']=qs[_0xecc6('0x2e')](_0x2b6659['query'][_0xecc6('0x2e')]);_0x3f1c97[_0xecc6('0x2c')]=qs[_0xecc6('0x2c')](_0x2b6659[_0xecc6('0x41')][_0xecc6('0x2c')]);}_0x3f1c97[_0xecc6('0x4a')]=qs[_0xecc6('0x4b')](_0x2b6659[_0xecc6('0x41')][_0xecc6('0x4b')]);_0x3f1c97[_0xecc6('0x4c')]=qs['filters'](_['pick'](_0x2b6659[_0xecc6('0x41')],_0x1e317d[_0xecc6('0x43')]),_0x31e4fc);if(_0x2b6659['query'][_0xecc6('0x4d')]){_0x3f1c97[_0xecc6('0x4c')]=_[_0xecc6('0x4e')](_0x3f1c97[_0xecc6('0x4c')],{'$or':_['map'](_0x31e4fc,function(_0x1c980c){if(_0x1c980c[_0xecc6('0x3e')]!=='VIRTUAL'){var _0x1dc48b={};_0x1dc48b[_0x1c980c[_0xecc6('0x39')]]={'$like':'%'+_0x2b6659[_0xecc6('0x41')]['filter']+'%'};return _0x1dc48b;}})});}_0x3f1c97=_[_0xecc6('0x4e')]({},_0x3f1c97,_0x2b6659[_0xecc6('0x4f')]);var _0x40089e={'where':_0x3f1c97[_0xecc6('0x4c')]};return db[_0xecc6('0x3d')][_0xecc6('0x2f')](_0x40089e)['then'](function(_0x34d120){_0xab9455[_0xecc6('0x2f')]=_0x34d120;if(_0x2b6659[_0xecc6('0x41')][_0xecc6('0x50')]){_0x3f1c97['include']=[{'all':!![]}];}return db[_0xecc6('0x3d')][_0xecc6('0x51')](_0x3f1c97);})[_0xecc6('0x1d')](function(_0x489271){_0xab9455[_0xecc6('0x52')]=_0x489271;return _0xab9455;})[_0xecc6('0x1d')](respondWithFilteredResult(_0x5ea020,_0x3f1c97))[_0xecc6('0x27')](handleError(_0x5ea020,null));};exports['show']=function(_0x20a488,_0x1db9d2){var _0x479f8b={'raw':![],'where':{'id':_0x20a488[_0xecc6('0x53')]['id']}},_0x291982={};_0x291982[_0xecc6('0x40')]=_[_0xecc6('0x42')](db['VoiceContext'][_0xecc6('0x54')]);_0x291982[_0xecc6('0x41')]=_[_0xecc6('0x42')](_0x20a488['query']);_0x291982[_0xecc6('0x43')]=_[_0xecc6('0x44')](_0x291982[_0xecc6('0x40')],_0x291982[_0xecc6('0x41')]);_0x479f8b[_0xecc6('0x45')]=_[_0xecc6('0x44')](_0x291982[_0xecc6('0x40')],qs[_0xecc6('0x46')](_0x20a488[_0xecc6('0x41')][_0xecc6('0x46')]));_0x479f8b[_0xecc6('0x45')]=_0x479f8b[_0xecc6('0x45')][_0xecc6('0x47')]?_0x479f8b[_0xecc6('0x45')]:_0x291982['model'];if(_0x20a488[_0xecc6('0x41')][_0xecc6('0x50')]){_0x479f8b[_0xecc6('0x55')]=[{'all':!![]}];}_0x479f8b=_[_0xecc6('0x4e')]({},_0x479f8b,_0x20a488['options']);return db[_0xecc6('0x3d')][_0xecc6('0x56')](_0x479f8b)[_0xecc6('0x1d')](handleEntityNotFound(_0x1db9d2,null))[_0xecc6('0x1d')](respondWithResult(_0x1db9d2,null))['catch'](handleError(_0x1db9d2,null));};exports[_0xecc6('0x57')]=function(_0x411715,_0x59e70,_0x3fd9c9){var _0xcbc754;return db[_0xecc6('0x3d')][_0xecc6('0x57')](_0x411715['body'],{'raw':!![]})[_0xecc6('0x1d')](function(_0x442fc4){_0xcbc754=_0x442fc4;return db['VoiceContext']['findAll']({'raw':!![]});})[_0xecc6('0x1d')](function(_0x82f016){var _0x7fcdd0=fs[_0xecc6('0x58')](path['join'](config[_0xecc6('0x59')],_0xecc6('0x5a')),_0xecc6('0x5b'));var _0x48c566=ejs['render'](_0x7fcdd0,{'contexts':_0x82f016||[]});fs[_0xecc6('0x5c')](_0xecc6('0x5d'),_0x48c566);})[_0xecc6('0x1d')](function(){return respondWithRpcPromise(_0xecc6('0x5e'),'create',{'module':'chan_sip.so'});})[_0xecc6('0x1d')](function(){var _0x52931e=_0x411715[_0xecc6('0x5f')]['get']({'plain':!![]});if(!_0x52931e)throw new Error(_0xecc6('0x60'));if(_0x52931e[_0xecc6('0x61')]==='user'){var _0x527389=_0xcbc754['get']({'plain':!![]});return db['UserProfileSection'][_0xecc6('0x56')]({'where':{'name':'Contexts','userProfileId':_0x52931e[_0xecc6('0x62')]},'raw':!![]})[_0xecc6('0x1d')](function(_0x37f589){if(_0x37f589&&_0x37f589[_0xecc6('0x63')]===0x0){return db[_0xecc6('0x64')][_0xecc6('0x57')]({'name':_0x527389[_0xecc6('0x39')],'resourceId':_0x527389['id'],'type':_0x37f589[_0xecc6('0x39')],'sectionId':_0x37f589['id']},{})[_0xecc6('0x1d')](function(){return _0xcbc754;});}else{return _0xcbc754;}})['catch'](function(_0x52cc4e){logger['error'](_0xecc6('0x65'),_0x52cc4e);throw _0x52cc4e;});}return _0xcbc754;})['then'](respondWithResult(_0x59e70,0xc9))['catch'](handleError(_0x59e70,null));};exports[_0xecc6('0x34')]=function(_0x14c0c6,_0xa076ca,_0x54eb1d){var _0x2b2034;return db[_0xecc6('0x3d')][_0xecc6('0x56')]({'where':{'id':_0x14c0c6[_0xecc6('0x53')]['id']}})[_0xecc6('0x1d')](handleEntityNotFound(_0xa076ca,null))[_0xecc6('0x1d')](saveUpdates(_0x14c0c6['body'],null))['then'](function(_0x472d5f){if(_0x472d5f){_0x2b2034=_0x472d5f;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0xecc6('0x1d')](function(_0x2c34e1){var _0x36cf61=fs[_0xecc6('0x58')](path['join'](config[_0xecc6('0x59')],_0xecc6('0x5a')),_0xecc6('0x5b'));var _0x4c5dd9=ejs[_0xecc6('0x66')](_0x36cf61,{'contexts':_0x2c34e1||[]});fs[_0xecc6('0x5c')](_0xecc6('0x5d'),_0x4c5dd9);})[_0xecc6('0x1d')](function(){return respondWithRpcPromise(_0xecc6('0x5e'),_0xecc6('0x34'),{'module':'chan_sip.so'});})['then'](function(){return _0x2b2034;})[_0xecc6('0x1d')](respondWithResult(_0xa076ca,null))[_0xecc6('0x27')](handleError(_0xa076ca,null));};exports[_0xecc6('0x35')]=function(_0x46ec26,_0x39b42b,_0x49d7f3){var _0x9ece0;return db[_0xecc6('0x3d')][_0xecc6('0x56')]({'where':{'id':_0x46ec26['params']['id']}})[_0xecc6('0x1d')](handleEntityNotFound(_0x39b42b,null))[_0xecc6('0x1d')](removeEntity(_0x39b42b,null))[_0xecc6('0x1d')](function(){return db[_0xecc6('0x3d')][_0xecc6('0x51')]({'raw':!![]});})['then'](function(_0x54d82d){var _0x1c850e=fs['readFileSync'](path[_0xecc6('0x67')](config[_0xecc6('0x59')],_0xecc6('0x5a')),_0xecc6('0x5b'));var _0x38e072=ejs['render'](_0x1c850e,{'contexts':_0x54d82d});fs[_0xecc6('0x5c')](_0xecc6('0x5d'),_0x38e072);return respondWithRpcPromise(_0xecc6('0x5e'),_0xecc6('0x35'),{'module':_0xecc6('0x68')});})[_0xecc6('0x27')](handleError(_0x39b42b,null));};
\ No newline at end of file
+var _0xf62f=['Reload','eml-format','rimraf','zip-dir','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','json','undefined','offset','count','limit','Content-Range','reject','save','update','then','destroy','get','Contexts','UserProfileResource','stack','name','index','map','VoiceContext','fieldName','key','model','query','keys','filters','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','attributes','merge','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','chan_sip.so','writeFileSync'];(function(_0x285b7c,_0x295a4a){var _0x9c736f=function(_0x3f8b58){while(--_0x3f8b58){_0x285b7c['push'](_0x285b7c['shift']());}};_0x9c736f(++_0x295a4a);}(_0xf62f,0x1a1));var _0xff62=function(_0x5d4f7b,_0x5db02e){_0x5d4f7b=_0x5d4f7b-0x0;var _0x5d1bbd=_0xf62f[_0x5d4f7b];return _0x5d1bbd;};'use strict';var emlformat=require(_0xff62('0x0'));var rimraf=require(_0xff62('0x1'));var zipdir=require(_0xff62('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xff62('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xff62('0x4'));var util=require(_0xff62('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xff62('0x6'));var fs=require('fs');var fs_extra=require(_0xff62('0x7'));var _=require(_0xff62('0x8'));var squel=require(_0xff62('0x9'));var crypto=require(_0xff62('0xa'));var jsforce=require(_0xff62('0xb'));var deskjs=require(_0xff62('0xc'));var toCsv=require(_0xff62('0xd'));var querystring=require(_0xff62('0xe'));var Papa=require(_0xff62('0xf'));var Redis=require(_0xff62('0x10'));var authService=require(_0xff62('0x11'));var qs=require(_0xff62('0x12'));var as=require(_0xff62('0x13'));var hardwareService=require(_0xff62('0x14'));var logger=require(_0xff62('0x15'))('api');var utils=require(_0xff62('0x16'));var config=require(_0xff62('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xff62('0x18'))['db'];var jayson=require(_0xff62('0x19'));var client=jayson[_0xff62('0x1a')][_0xff62('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x57e1a2,_0x3a4174,_0x317315,_0x25f70e){return new BPromise(function(_0x5e788c,_0x4615eb){var _0x6a4b32=_0x25f70e||client;return _0x6a4b32[_0xff62('0x1c')](_0x57e1a2,_0x317315)['then'](function(_0x17158b){logger['info'](_0xff62('0x1d'),_0x3a4174,_0xff62('0x1e'));logger[_0xff62('0x1f')](_0xff62('0x20'),_0x3a4174,_0xff62('0x1e'),JSON[_0xff62('0x21')](_0x17158b));if(_0x17158b[_0xff62('0x22')]){if(_0x17158b['error']['code']===0x1f4){logger[_0xff62('0x22')](_0xff62('0x1d'),_0x3a4174,_0x17158b[_0xff62('0x22')][_0xff62('0x23')]);return _0x4615eb(_0x17158b[_0xff62('0x22')]['message']);}logger[_0xff62('0x22')](_0xff62('0x1d'),_0x3a4174,_0x17158b[_0xff62('0x22')][_0xff62('0x23')]);return _0x5e788c(_0x17158b[_0xff62('0x22')][_0xff62('0x23')]);}else{logger[_0xff62('0x24')](_0xff62('0x1d'),_0x3a4174,_0xff62('0x1e'));_0x5e788c(_0x17158b[_0xff62('0x25')][_0xff62('0x23')]);}})[_0xff62('0x26')](function(_0x98dfa5){logger['error'](_0xff62('0x1d'),_0x3a4174,_0x98dfa5);_0x4615eb(_0x98dfa5);});});}function respondWithStatusCode(_0x46e529,_0x468042){_0x468042=_0x468042||0xcc;return function(_0x43de27){if(_0x43de27){return _0x46e529[_0xff62('0x27')](_0x468042);}return _0x46e529[_0xff62('0x28')](_0x468042)['end']();};}function respondWithResult(_0x74fc69,_0x439dd9){_0x439dd9=_0x439dd9||0xc8;return function(_0x2b7cf6){if(_0x2b7cf6){return _0x74fc69[_0xff62('0x28')](_0x439dd9)[_0xff62('0x29')](_0x2b7cf6);}};}function respondWithFilteredResult(_0x38b8e6,_0x5c8913){return function(_0x3fe83d){if(_0x3fe83d){var _0x29b51e=typeof _0x5c8913['offset']===_0xff62('0x2a')&&typeof _0x5c8913['limit']==='undefined';var _0x896b9f=_0x3fe83d['count'];var _0x8aa6b9=_0x29b51e?0x0:_0x5c8913[_0xff62('0x2b')];var _0x163669=_0x29b51e?_0x3fe83d[_0xff62('0x2c')]:_0x5c8913[_0xff62('0x2b')]+_0x5c8913[_0xff62('0x2d')];var _0x4b46fe;if(_0x163669>=_0x896b9f){_0x163669=_0x896b9f;_0x4b46fe=0xc8;}else{_0x4b46fe=0xce;}_0x38b8e6[_0xff62('0x28')](_0x4b46fe);return _0x38b8e6['set'](_0xff62('0x2e'),_0x8aa6b9+'-'+_0x163669+'/'+_0x896b9f)['json'](_0x3fe83d);}return null;};}function patchUpdates(_0x421631){return function(_0x1bec6a){try{jsonpatch['apply'](_0x1bec6a,_0x421631,!![]);}catch(_0x2702e3){return BPromise[_0xff62('0x2f')](_0x2702e3);}return _0x1bec6a[_0xff62('0x30')]();};}function saveUpdates(_0x3c6abf,_0x330f5f){return function(_0x4d2ef2){if(_0x4d2ef2){return _0x4d2ef2[_0xff62('0x31')](_0x3c6abf)[_0xff62('0x32')](function(_0x35b001){return _0x35b001;});}return null;};}function removeEntity(_0x459934,_0x5ab155){return function(_0x497519){if(_0x497519){return _0x497519[_0xff62('0x33')]()['then'](function(){var _0x39dc5a=_0x497519[_0xff62('0x34')]({'plain':!![]});var _0x27379b=_0xff62('0x35');return db[_0xff62('0x36')]['destroy']({'where':{'type':_0x27379b,'resourceId':_0x39dc5a['id']}})[_0xff62('0x32')](function(){return _0x497519;});})[_0xff62('0x32')](function(){_0x459934[_0xff62('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ff925,_0x314392){return function(_0x117b0a){if(!_0x117b0a){_0x2ff925['sendStatus'](0x194);}return _0x117b0a;};}function handleError(_0x16ed5a,_0x561f0b){_0x561f0b=_0x561f0b||0x1f4;return function(_0x5a44ca){logger[_0xff62('0x22')](_0x5a44ca[_0xff62('0x37')]);if(_0x5a44ca[_0xff62('0x38')]){delete _0x5a44ca[_0xff62('0x38')];}_0x16ed5a[_0xff62('0x28')](_0x561f0b)['send'](_0x5a44ca);};}exports[_0xff62('0x39')]=function(_0x1b7d56,_0x30ab75){var _0x2d2bd7={},_0x1cb772={},_0x246f44={'count':0x0,'rows':[]};var _0x57b590=_[_0xff62('0x3a')](db[_0xff62('0x3b')]['rawAttributes'],function(_0x28ef7c){return{'name':_0x28ef7c[_0xff62('0x3c')],'type':_0x28ef7c['type'][_0xff62('0x3d')]};});_0x1cb772[_0xff62('0x3e')]=_['map'](_0x57b590,'name');_0x1cb772[_0xff62('0x3f')]=_[_0xff62('0x40')](_0x1b7d56[_0xff62('0x3f')]);_0x1cb772[_0xff62('0x41')]=_['intersection'](_0x1cb772[_0xff62('0x3e')],_0x1cb772[_0xff62('0x3f')]);_0x2d2bd7['attributes']=_[_0xff62('0x42')](_0x1cb772[_0xff62('0x3e')],qs['fields'](_0x1b7d56[_0xff62('0x3f')][_0xff62('0x43')]));_0x2d2bd7['attributes']=_0x2d2bd7['attributes'][_0xff62('0x44')]?_0x2d2bd7['attributes']:_0x1cb772[_0xff62('0x3e')];if(!_0x1b7d56[_0xff62('0x3f')][_0xff62('0x45')]('nolimit')){_0x2d2bd7['limit']=qs[_0xff62('0x2d')](_0x1b7d56[_0xff62('0x3f')][_0xff62('0x2d')]);_0x2d2bd7[_0xff62('0x2b')]=qs['offset'](_0x1b7d56['query'][_0xff62('0x2b')]);}_0x2d2bd7[_0xff62('0x46')]=qs[_0xff62('0x47')](_0x1b7d56[_0xff62('0x3f')][_0xff62('0x47')]);_0x2d2bd7['where']=qs[_0xff62('0x41')](_[_0xff62('0x48')](_0x1b7d56['query'],_0x1cb772[_0xff62('0x41')]),_0x57b590);if(_0x1b7d56[_0xff62('0x3f')][_0xff62('0x49')]){_0x2d2bd7[_0xff62('0x4a')]=_['merge'](_0x2d2bd7['where'],{'$or':_[_0xff62('0x3a')](_0x57b590,function(_0x1a9b5a){if(_0x1a9b5a[_0xff62('0x4b')]!==_0xff62('0x4c')){var _0x325646={};_0x325646[_0x1a9b5a['name']]={'$like':'%'+_0x1b7d56[_0xff62('0x3f')]['filter']+'%'};return _0x325646;}})});}_0x2d2bd7=_['merge']({},_0x2d2bd7,_0x1b7d56[_0xff62('0x4d')]);var _0x1f110f={'where':_0x2d2bd7[_0xff62('0x4a')]};return db['VoiceContext']['count'](_0x1f110f)[_0xff62('0x32')](function(_0x25ceb9){_0x246f44[_0xff62('0x2c')]=_0x25ceb9;if(_0x1b7d56['query'][_0xff62('0x4e')]){_0x2d2bd7[_0xff62('0x4f')]=[{'all':!![]}];}return db[_0xff62('0x3b')][_0xff62('0x50')](_0x2d2bd7);})['then'](function(_0x4888f1){_0x246f44[_0xff62('0x51')]=_0x4888f1;return _0x246f44;})[_0xff62('0x32')](respondWithFilteredResult(_0x30ab75,_0x2d2bd7))[_0xff62('0x26')](handleError(_0x30ab75,null));};exports[_0xff62('0x52')]=function(_0x246813,_0x46edb9){var _0x972906={'raw':![],'where':{'id':_0x246813[_0xff62('0x53')]['id']}},_0x52c5b5={};_0x52c5b5[_0xff62('0x3e')]=_[_0xff62('0x40')](db[_0xff62('0x3b')]['rawAttributes']);_0x52c5b5[_0xff62('0x3f')]=_[_0xff62('0x40')](_0x246813[_0xff62('0x3f')]);_0x52c5b5['filters']=_[_0xff62('0x42')](_0x52c5b5[_0xff62('0x3e')],_0x52c5b5[_0xff62('0x3f')]);_0x972906[_0xff62('0x54')]=_['intersection'](_0x52c5b5['model'],qs[_0xff62('0x43')](_0x246813[_0xff62('0x3f')][_0xff62('0x43')]));_0x972906[_0xff62('0x54')]=_0x972906['attributes'][_0xff62('0x44')]?_0x972906[_0xff62('0x54')]:_0x52c5b5['model'];if(_0x246813[_0xff62('0x3f')]['includeAll']){_0x972906[_0xff62('0x4f')]=[{'all':!![]}];}_0x972906=_[_0xff62('0x55')]({},_0x972906,_0x246813[_0xff62('0x4d')]);return db[_0xff62('0x3b')][_0xff62('0x56')](_0x972906)['then'](handleEntityNotFound(_0x46edb9,null))[_0xff62('0x32')](respondWithResult(_0x46edb9,null))[_0xff62('0x26')](handleError(_0x46edb9,null));};exports['create']=function(_0x2750ad,_0x4e3a12,_0x25d7ad){var _0x50bdb5;return db[_0xff62('0x3b')][_0xff62('0x57')](_0x2750ad[_0xff62('0x58')],{'raw':!![]})[_0xff62('0x32')](function(_0x4955d0){_0x50bdb5=_0x4955d0;return db[_0xff62('0x3b')][_0xff62('0x50')]({'raw':!![]});})[_0xff62('0x32')](function(_0x56765a){var _0x4ac85f=fs[_0xff62('0x59')](path[_0xff62('0x5a')](config[_0xff62('0x5b')],_0xff62('0x5c')),_0xff62('0x5d'));var _0x10dae6=ejs[_0xff62('0x5e')](_0x4ac85f,{'contexts':_0x56765a||[]});fs['writeFileSync'](_0xff62('0x5f'),_0x10dae6);})[_0xff62('0x32')](function(){return respondWithRpcPromise('Reload',_0xff62('0x57'),{'module':'chan_sip.so'});})[_0xff62('0x32')](function(){var _0x2a47ba=_0x2750ad[_0xff62('0x60')]['get']({'plain':!![]});if(!_0x2a47ba)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a47ba[_0xff62('0x61')]===_0xff62('0x60')){var _0x32de5d=_0x50bdb5['get']({'plain':!![]});return db['UserProfileSection'][_0xff62('0x56')]({'where':{'name':_0xff62('0x35'),'userProfileId':_0x2a47ba[_0xff62('0x62')]},'raw':!![]})[_0xff62('0x32')](function(_0x437cbf){if(_0x437cbf&&_0x437cbf[_0xff62('0x63')]===0x0){return db['UserProfileResource'][_0xff62('0x57')]({'name':_0x32de5d['name'],'resourceId':_0x32de5d['id'],'type':_0x437cbf[_0xff62('0x38')],'sectionId':_0x437cbf['id']},{})[_0xff62('0x32')](function(){return _0x50bdb5;});}else{return _0x50bdb5;}})['catch'](function(_0x456a48){logger[_0xff62('0x22')](_0xff62('0x64'),_0x456a48);throw _0x456a48;});}return _0x50bdb5;})[_0xff62('0x32')](respondWithResult(_0x4e3a12,0xc9))[_0xff62('0x26')](handleError(_0x4e3a12,null));};exports[_0xff62('0x31')]=function(_0x1c9e0e,_0x1683d5,_0x35ea71){var _0x217b34;return db[_0xff62('0x3b')]['find']({'where':{'id':_0x1c9e0e[_0xff62('0x53')]['id']}})[_0xff62('0x32')](handleEntityNotFound(_0x1683d5,null))[_0xff62('0x32')](saveUpdates(_0x1c9e0e['body'],null))[_0xff62('0x32')](function(_0x46c79a){if(_0x46c79a){_0x217b34=_0x46c79a;return db[_0xff62('0x3b')][_0xff62('0x50')]({'raw':!![]});}})[_0xff62('0x32')](function(_0x3f5aad){var _0x37b3c2=fs[_0xff62('0x59')](path['join'](config[_0xff62('0x5b')],_0xff62('0x5c')),'utf8');var _0x5084fd=ejs['render'](_0x37b3c2,{'contexts':_0x3f5aad||[]});fs['writeFileSync'](_0xff62('0x5f'),_0x5084fd);})[_0xff62('0x32')](function(){return respondWithRpcPromise('Reload','update',{'module':_0xff62('0x65')});})['then'](function(){return _0x217b34;})[_0xff62('0x32')](respondWithResult(_0x1683d5,null))[_0xff62('0x26')](handleError(_0x1683d5,null));};exports['destroy']=function(_0x510569,_0x27c057,_0x103663){var _0x38077d;return db[_0xff62('0x3b')][_0xff62('0x56')]({'where':{'id':_0x510569[_0xff62('0x53')]['id']}})[_0xff62('0x32')](handleEntityNotFound(_0x27c057,null))['then'](removeEntity(_0x27c057,null))['then'](function(){return db['VoiceContext']['findAll']({'raw':!![]});})[_0xff62('0x32')](function(_0x48a767){var _0x556e95=fs[_0xff62('0x59')](path[_0xff62('0x5a')](config['root'],_0xff62('0x5c')),'utf8');var _0x55c4ec=ejs[_0xff62('0x5e')](_0x556e95,{'contexts':_0x48a767});fs[_0xff62('0x66')](_0xff62('0x5f'),_0x55c4ec);return respondWithRpcPromise(_0xff62('0x67'),'destroy',{'module':_0xff62('0x65')});})[_0xff62('0x26')](handleError(_0x27c057,null));};
\ No newline at end of file
index 9c6d302..be049c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe37b=['../../config/logger','api','bluebird','path','rimraf','exports','VoiceContext','voice_contexts','lodash','util'];(function(_0x3f3e64,_0x362a96){var _0x13ffba=function(_0x19e2ed){while(--_0x19e2ed){_0x3f3e64['push'](_0x3f3e64['shift']());}};_0x13ffba(++_0x362a96);}(_0xe37b,0x1e8));var _0xbe37=function(_0x5c1e72,_0x4af78a){_0x5c1e72=_0x5c1e72-0x0;var _0x200cd3=_0xe37b[_0x5c1e72];return _0x200cd3;};'use strict';var _=require(_0xbe37('0x0'));var util=require(_0xbe37('0x1'));var logger=require(_0xbe37('0x2'))(_0xbe37('0x3'));var moment=require('moment');var BPromise=require(_0xbe37('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe37('0x5'));var rimraf=require(_0xbe37('0x6'));var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0xbe37('0x7')]=function(_0xf59267,_0x5310e9){return _0xf59267['define'](_0xbe37('0x8'),attributes,{'tableName':_0xbe37('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x102b=['path','rimraf','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','../../config/logger','api','moment','request-promise'];(function(_0x73d01c,_0x28e57){var _0x36478d=function(_0x57d69d){while(--_0x57d69d){_0x73d01c['push'](_0x73d01c['shift']());}};_0x36478d(++_0x28e57);}(_0x102b,0xeb));var _0xb102=function(_0x4a8f59,_0x4c05a4){_0x4a8f59=_0x4a8f59-0x0;var _0x75eb77=_0x102b[_0x4a8f59];return _0x75eb77;};'use strict';var _=require(_0xb102('0x0'));var util=require('util');var logger=require(_0xb102('0x1'))(_0xb102('0x2'));var moment=require(_0xb102('0x3'));var BPromise=require('bluebird');var rp=require(_0xb102('0x4'));var fs=require('fs');var path=require(_0xb102('0x5'));var rimraf=require(_0xb102('0x6'));var config=require(_0xb102('0x7'));var attributes=require('./voiceContext.attributes');module[_0xb102('0x8')]=function(_0x10fa2b,_0x940ace){return _0x10fa2b[_0xb102('0x9')](_0xb102('0xa'),attributes,{'tableName':_0xb102('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 5605af6..74f0849 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d06=['VoiceContext,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x7d06,0x158));var _0x67d0=function(_0x5d85a4,_0x377017){_0x5d85a4=_0x5d85a4-0x0;var _0x26916d=_0x7d06[_0x5d85a4];return _0x26916d;};'use strict';var _=require(_0x67d0('0x0'));var util=require(_0x67d0('0x1'));var moment=require(_0x67d0('0x2'));var BPromise=require(_0x67d0('0x3'));var rs=require(_0x67d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x67d0('0x5'))['db'];var utils=require(_0x67d0('0x6'));var logger=require(_0x67d0('0x7'))('rpc');var config=require(_0x67d0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x67d0('0x9')][_0x67d0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x367f1d,_0xe4789b,_0x3c9976){return new BPromise(function(_0x481a08,_0x358986){return client['request'](_0x367f1d,_0x3c9976)[_0x67d0('0xb')](function(_0x5916d0){logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));logger[_0x67d0('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0xe4789b,_0x67d0('0xe'),JSON['stringify'](_0x5916d0));if(_0x5916d0['error']){if(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x11')]===0x1f4){logger['error'](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')]['message']);return _0x358986(_0x5916d0[_0x67d0('0x10')]['message']);}logger[_0x67d0('0x10')](_0x67d0('0xd'),_0xe4789b,_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);return _0x481a08(_0x5916d0[_0x67d0('0x10')][_0x67d0('0x12')]);}else{logger[_0x67d0('0xc')](_0x67d0('0xd'),_0xe4789b,_0x67d0('0xe'));_0x481a08(_0x5916d0[_0x67d0('0x13')]['message']);}})[_0x67d0('0x14')](function(_0xa1b889){logger['error'](_0x67d0('0xd'),_0xe4789b,_0xa1b889);_0x358986(_0xa1b889);});});}
\ No newline at end of file
+var _0x6888=['../../config/utils','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x187537,_0x20ca9d){var _0x529c61=function(_0x495083){while(--_0x495083){_0x187537['push'](_0x187537['shift']());}};_0x529c61(++_0x20ca9d);}(_0x6888,0xd2));var _0x8688=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6888[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8688('0x0'));var util=require('util');var moment=require(_0x8688('0x1'));var BPromise=require(_0x8688('0x2'));var rs=require(_0x8688('0x3'));var fs=require('fs');var Redis=require(_0x8688('0x4'));var db=require(_0x8688('0x5'))['db'];var utils=require(_0x8688('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8688('0x7'));var jayson=require(_0x8688('0x8'));var client=jayson[_0x8688('0x9')][_0x8688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfa1a28,_0xcc92be,_0x5860a8){return new BPromise(function(_0x457991,_0x15f2b9){return client[_0x8688('0xb')](_0xfa1a28,_0x5860a8)[_0x8688('0xc')](function(_0x18723c){logger['info']('VoiceContext,\x20%s,\x20%s',_0xcc92be,_0x8688('0xd'));logger[_0x8688('0xe')](_0x8688('0xf'),_0xcc92be,_0x8688('0xd'),JSON[_0x8688('0x10')](_0x18723c));if(_0x18723c[_0x8688('0x11')]){if(_0x18723c[_0x8688('0x11')][_0x8688('0x12')]===0x1f4){logger[_0x8688('0x11')]('VoiceContext,\x20%s,\x20%s',_0xcc92be,_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);return _0x15f2b9(_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);}logger[_0x8688('0x11')](_0x8688('0x14'),_0xcc92be,_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);return _0x457991(_0x18723c[_0x8688('0x11')][_0x8688('0x13')]);}else{logger[_0x8688('0x15')](_0x8688('0x14'),_0xcc92be,'request\x20sent');_0x457991(_0x18723c[_0x8688('0x16')][_0x8688('0x13')]);}})[_0x8688('0x17')](function(_0x5ef2e6){logger[_0x8688('0x11')](_0x8688('0x14'),_0xcc92be,_0x5ef2e6);_0x15f2b9(_0x5ef2e6);});});}
\ No newline at end of file
index 7de8fe5..6b83c85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c00=['/:id','show','post','update','delete','destroy','Router','fs-extra','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1c521c,_0x3dbc38){var _0x14fb73=function(_0x1b789b){while(--_0x1b789b){_0x1c521c['push'](_0x1c521c['shift']());}};_0x14fb73(++_0x3dbc38);}(_0x9c00,0xf4));var _0x09c0=function(_0x8e4e90,_0x6d7185){_0x8e4e90=_0x8e4e90-0x0;var _0x1d9d2b=_0x9c00[_0x8e4e90];return _0x1d9d2b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x09c0('0x0')]();var fs_extra=require(_0x09c0('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x09c0('0x2'));var config=require('../../config/environment');var controller=require(_0x09c0('0x3'));router[_0x09c0('0x4')]('/',auth[_0x09c0('0x5')](),controller[_0x09c0('0x6')]);router[_0x09c0('0x4')](_0x09c0('0x7'),auth[_0x09c0('0x5')](),controller['describe']);router[_0x09c0('0x4')](_0x09c0('0x8'),auth['isAuthenticated'](),controller[_0x09c0('0x9')]);router[_0x09c0('0xa')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x09c0('0x8'),auth[_0x09c0('0x5')](),controller[_0x09c0('0xb')]);router[_0x09c0('0xc')]('/:id',auth[_0x09c0('0x5')](),controller[_0x09c0('0xd')]);module['exports']=router;
\ No newline at end of file
+var _0xb48d=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post','update','exports','multer'];(function(_0x349793,_0x534b25){var _0x21f9cd=function(_0x2054e5){while(--_0x2054e5){_0x349793['push'](_0x349793['shift']());}};_0x21f9cd(++_0x534b25);}(_0xb48d,0x194));var _0xdb48=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0xb48d[_0x3fba9f];return _0x192cf1;};'use strict';var multer=require(_0xdb48('0x0'));var util=require('util');var path=require(_0xdb48('0x1'));var timeout=require('connect-timeout');var express=require(_0xdb48('0x2'));var router=express[_0xdb48('0x3')]();var fs_extra=require(_0xdb48('0x4'));var auth=require(_0xdb48('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdb48('0x6'));var controller=require('./voiceDialReport.controller');router[_0xdb48('0x7')]('/',auth[_0xdb48('0x8')](),controller[_0xdb48('0x9')]);router['get']('/describe',auth[_0xdb48('0x8')](),controller[_0xdb48('0xa')]);router['get'](_0xdb48('0xb'),auth[_0xdb48('0x8')](),controller['show']);router[_0xdb48('0xc')]('/',auth[_0xdb48('0x8')](),controller['create']);router['put'](_0xdb48('0xb'),auth[_0xdb48('0x8')](),controller[_0xdb48('0xd')]);router['delete'](_0xdb48('0xb'),auth[_0xdb48('0x8')](),controller['destroy']);module[_0xdb48('0xe')]=router;
\ No newline at end of file
index 5b83573..c5c542a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa41a=['exports','STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x5407c7,_0x4fac36){var _0x194490=function(_0x560890){while(--_0x560890){_0x5407c7['push'](_0x5407c7['shift']());}};_0x194490(++_0x4fac36);}(_0xa41a,0x6b));var _0xaa41=function(_0x20a3de,_0x22e557){_0x20a3de=_0x20a3de-0x0;var _0x38111a=_0xa41a[_0x20a3de];return _0x38111a;};'use strict';var Sequelize=require(_0xaa41('0x0'));module[_0xaa41('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x2')]},'channelstate':{'type':Sequelize[_0xaa41('0x3')]},'channelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'calleridnum':{'type':Sequelize[_0xaa41('0x2')]},'calleridname':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'connectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'language':{'type':Sequelize[_0xaa41('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xaa41('0x2')]},'exten':{'type':Sequelize[_0xaa41('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xaa41('0x2')]},'destchannel':{'type':Sequelize[_0xaa41('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridnum':{'type':Sequelize[_0xaa41('0x2')]},'destcalleridname':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaa41('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaa41('0x2')]},'destlanguage':{'type':Sequelize[_0xaa41('0x2')]},'destaccountcode':{'type':Sequelize[_0xaa41('0x2')]},'destcontext':{'type':Sequelize[_0xaa41('0x2')]},'destexten':{'type':Sequelize[_0xaa41('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xaa41('0x2')]},'destlinkedid':{'type':Sequelize[_0xaa41('0x2')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa41('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xaa41('0x4')]},'lastevent':{'type':Sequelize[_0xaa41('0x2')],'comment':_0xaa41('0x5')},'routeId':{'type':Sequelize[_0xaa41('0x3')]},'duration':{'type':Sequelize[_0xaa41('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xaa41('0x3')]}};
\ No newline at end of file
+var _0xe14d=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0xe14d,0x1ee));var _0xde14=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xe14d[_0x455c6c];return _0x488242;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'privilege':{'type':Sequelize[_0xde14('0x2')]},'channel':{'type':Sequelize[_0xde14('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'calleridnum':{'type':Sequelize[_0xde14('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'connectedlinename':{'type':Sequelize[_0xde14('0x2')]},'language':{'type':Sequelize[_0xde14('0x2')]},'accountcode':{'type':Sequelize[_0xde14('0x2')]},'context':{'type':Sequelize[_0xde14('0x2')]},'exten':{'type':Sequelize[_0xde14('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xde14('0x2')]},'destchannel':{'type':Sequelize[_0xde14('0x2')]},'destchannelstate':{'type':Sequelize[_0xde14('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'destcalleridnum':{'type':Sequelize[_0xde14('0x2')]},'destcalleridname':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xde14('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xde14('0x2')]},'destcontext':{'type':Sequelize[_0xde14('0x2')]},'destexten':{'type':Sequelize[_0xde14('0x2')]},'destpriority':{'type':Sequelize[_0xde14('0x3')]},'destuniqueid':{'type':Sequelize[_0xde14('0x2')]},'destlinkedid':{'type':Sequelize[_0xde14('0x2')]},'dialstring':{'type':Sequelize[_0xde14('0x2')]},'dialstatus':{'type':Sequelize[_0xde14('0x2')]},'starttime':{'type':Sequelize[_0xde14('0x4')]},'answertime':{'type':Sequelize[_0xde14('0x4')]},'endtime':{'type':Sequelize[_0xde14('0x4')]},'lastevent':{'type':Sequelize[_0xde14('0x2')],'comment':_0xde14('0x5')},'routeId':{'type':Sequelize[_0xde14('0x3')]},'duration':{'type':Sequelize[_0xde14('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 1a98933..d468fa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fe8=['options','includeAll','include','findAll','catch','rawAttributes','fields','length','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','VoiceDialReport','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','hasOwnProperty','order','sort','filter','where','VIRTUAL'];(function(_0x2788dc,_0x344e4f){var _0x48bbe4=function(_0x2d75c8){while(--_0x2d75c8){_0x2788dc['push'](_0x2788dc['shift']());}};_0x48bbe4(++_0x344e4f);}(_0x1fe8,0x9f));var _0x81fe=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x1fe8[_0x5a776b];return _0xbbef59;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x81fe('0x0'));var zipdir=require(_0x81fe('0x1'));var jsonpatch=require(_0x81fe('0x2'));var rp=require(_0x81fe('0x3'));var moment=require(_0x81fe('0x4'));var BPromise=require(_0x81fe('0x5'));var Mustache=require('mustache');var util=require(_0x81fe('0x6'));var path=require(_0x81fe('0x7'));var sox=require(_0x81fe('0x8'));var csv=require(_0x81fe('0x9'));var ejs=require(_0x81fe('0xa'));var fs=require('fs');var fs_extra=require(_0x81fe('0xb'));var _=require(_0x81fe('0xc'));var squel=require(_0x81fe('0xd'));var crypto=require(_0x81fe('0xe'));var jsforce=require(_0x81fe('0xf'));var deskjs=require(_0x81fe('0x10'));var toCsv=require(_0x81fe('0x9'));var querystring=require('querystring');var Papa=require(_0x81fe('0x11'));var Redis=require('ioredis');var authService=require(_0x81fe('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x81fe('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x81fe('0x14'))('api');var utils=require(_0x81fe('0x15'));var config=require(_0x81fe('0x16'));var licenseUtil=require(_0x81fe('0x17'));var db=require(_0x81fe('0x18'))['db'];function respondWithStatusCode(_0x2d7ff5,_0x26dfe2){_0x26dfe2=_0x26dfe2||0xcc;return function(_0x44f5f4){if(_0x44f5f4){return _0x2d7ff5[_0x81fe('0x19')](_0x26dfe2);}return _0x2d7ff5[_0x81fe('0x1a')](_0x26dfe2)[_0x81fe('0x1b')]();};}function respondWithResult(_0x50c70e,_0x369d5e){_0x369d5e=_0x369d5e||0xc8;return function(_0x58e008){if(_0x58e008){return _0x50c70e['status'](_0x369d5e)['json'](_0x58e008);}};}function respondWithFilteredResult(_0x568756,_0xea9813){return function(_0x2e09c5){if(_0x2e09c5){var _0x10537d=typeof _0xea9813[_0x81fe('0x1c')]==='undefined'&&typeof _0xea9813[_0x81fe('0x1d')]===_0x81fe('0x1e');var _0x1539ed=_0x2e09c5[_0x81fe('0x1f')];var _0x2f76cf=_0x10537d?0x0:_0xea9813[_0x81fe('0x1c')];var _0x55320c=_0x10537d?_0x2e09c5[_0x81fe('0x1f')]:_0xea9813[_0x81fe('0x1c')]+_0xea9813['limit'];var _0x35556a;if(_0x55320c>=_0x1539ed){_0x55320c=_0x1539ed;_0x35556a=0xc8;}else{_0x35556a=0xce;}_0x568756['status'](_0x35556a);return _0x568756[_0x81fe('0x20')](_0x81fe('0x21'),_0x2f76cf+'-'+_0x55320c+'/'+_0x1539ed)['json'](_0x2e09c5);}return null;};}function patchUpdates(_0x127be4){return function(_0x3c5c64){try{jsonpatch[_0x81fe('0x22')](_0x3c5c64,_0x127be4,!![]);}catch(_0x47602c){return BPromise[_0x81fe('0x23')](_0x47602c);}return _0x3c5c64['save']();};}function saveUpdates(_0x38b9d8,_0x3b6843){return function(_0x3aa19d){if(_0x3aa19d){return _0x3aa19d[_0x81fe('0x24')](_0x38b9d8)[_0x81fe('0x25')](function(_0x33ff3f){return _0x33ff3f;});}return null;};}function removeEntity(_0x218e38,_0x125300){return function(_0x3bb72c){if(_0x3bb72c){return _0x3bb72c[_0x81fe('0x26')]()[_0x81fe('0x25')](function(){_0x218e38['status'](0xcc)[_0x81fe('0x1b')]();});}};}function handleEntityNotFound(_0x3bd4fe,_0x58ec24){return function(_0x53b88d){if(!_0x53b88d){_0x3bd4fe['sendStatus'](0x194);}return _0x53b88d;};}function handleError(_0x150516,_0x3f6c15){_0x3f6c15=_0x3f6c15||0x1f4;return function(_0x92c7ca){logger[_0x81fe('0x27')](_0x92c7ca[_0x81fe('0x28')]);if(_0x92c7ca[_0x81fe('0x29')]){delete _0x92c7ca[_0x81fe('0x29')];}_0x150516['status'](_0x3f6c15)['send'](_0x92c7ca);};}exports[_0x81fe('0x2a')]=function(_0x2d1ab3,_0x3da75d){var _0x4604dd={},_0x2b31ad={},_0x16ac80={'count':0x0,'rows':[]};var _0x4ac418=_['map'](db[_0x81fe('0x2b')]['rawAttributes'],function(_0x5c91cd){return{'name':_0x5c91cd[_0x81fe('0x2c')],'type':_0x5c91cd[_0x81fe('0x2d')][_0x81fe('0x2e')]};});_0x2b31ad['model']=_[_0x81fe('0x2f')](_0x4ac418,_0x81fe('0x29'));_0x2b31ad[_0x81fe('0x30')]=_[_0x81fe('0x31')](_0x2d1ab3[_0x81fe('0x30')]);_0x2b31ad[_0x81fe('0x32')]=_['intersection'](_0x2b31ad['model'],_0x2b31ad[_0x81fe('0x30')]);_0x4604dd['attributes']=_[_0x81fe('0x33')](_0x2b31ad[_0x81fe('0x34')],qs['fields'](_0x2d1ab3['query']['fields']));_0x4604dd[_0x81fe('0x35')]=_0x4604dd[_0x81fe('0x35')]['length']?_0x4604dd['attributes']:_0x2b31ad[_0x81fe('0x34')];if(!_0x2d1ab3['query'][_0x81fe('0x36')]('nolimit')){_0x4604dd[_0x81fe('0x1d')]=qs['limit'](_0x2d1ab3[_0x81fe('0x30')][_0x81fe('0x1d')]);_0x4604dd[_0x81fe('0x1c')]=qs[_0x81fe('0x1c')](_0x2d1ab3[_0x81fe('0x30')]['offset']);}_0x4604dd[_0x81fe('0x37')]=qs[_0x81fe('0x38')](_0x2d1ab3[_0x81fe('0x30')][_0x81fe('0x38')]);_0x4604dd['where']=qs[_0x81fe('0x32')](_['pick'](_0x2d1ab3[_0x81fe('0x30')],_0x2b31ad[_0x81fe('0x32')]),_0x4ac418);if(_0x2d1ab3[_0x81fe('0x30')][_0x81fe('0x39')]){_0x4604dd['where']=_['merge'](_0x4604dd[_0x81fe('0x3a')],{'$or':_['map'](_0x4ac418,function(_0x5b55ae){if(_0x5b55ae['type']!==_0x81fe('0x3b')){var _0x4411a4={};_0x4411a4[_0x5b55ae[_0x81fe('0x29')]]={'$like':'%'+_0x2d1ab3['query'][_0x81fe('0x39')]+'%'};return _0x4411a4;}})});}_0x4604dd=_['merge']({},_0x4604dd,_0x2d1ab3[_0x81fe('0x3c')]);var _0x441023={'where':_0x4604dd[_0x81fe('0x3a')]};return db[_0x81fe('0x2b')][_0x81fe('0x1f')](_0x441023)['then'](function(_0xe146db){_0x16ac80[_0x81fe('0x1f')]=_0xe146db;if(_0x2d1ab3[_0x81fe('0x30')][_0x81fe('0x3d')]){_0x4604dd[_0x81fe('0x3e')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x81fe('0x3f')](_0x4604dd);})[_0x81fe('0x25')](function(_0x612fd9){_0x16ac80['rows']=_0x612fd9;return _0x16ac80;})[_0x81fe('0x25')](respondWithFilteredResult(_0x3da75d,_0x4604dd))[_0x81fe('0x40')](handleError(_0x3da75d,null));};exports['show']=function(_0x356d15,_0x2faaa6){var _0x1b3b65={'raw':!![],'where':{'id':_0x356d15['params']['id']}},_0x28a110={};_0x28a110['model']=_['keys'](db[_0x81fe('0x2b')][_0x81fe('0x41')]);_0x28a110[_0x81fe('0x30')]=_[_0x81fe('0x31')](_0x356d15[_0x81fe('0x30')]);_0x28a110[_0x81fe('0x32')]=_['intersection'](_0x28a110[_0x81fe('0x34')],_0x28a110[_0x81fe('0x30')]);_0x1b3b65[_0x81fe('0x35')]=_[_0x81fe('0x33')](_0x28a110['model'],qs[_0x81fe('0x42')](_0x356d15['query'][_0x81fe('0x42')]));_0x1b3b65['attributes']=_0x1b3b65[_0x81fe('0x35')][_0x81fe('0x43')]?_0x1b3b65[_0x81fe('0x35')]:_0x28a110[_0x81fe('0x34')];if(_0x356d15['query'][_0x81fe('0x3d')]){_0x1b3b65[_0x81fe('0x3e')]=[{'all':!![]}];}_0x1b3b65=_['merge']({},_0x1b3b65,_0x356d15['options']);return db[_0x81fe('0x2b')]['find'](_0x1b3b65)['then'](handleEntityNotFound(_0x2faaa6,null))['then'](respondWithResult(_0x2faaa6,null))[_0x81fe('0x40')](handleError(_0x2faaa6,null));};exports[_0x81fe('0x44')]=function(_0x3415ec,_0x451d01){return db[_0x81fe('0x2b')][_0x81fe('0x44')](_0x3415ec[_0x81fe('0x45')],{})[_0x81fe('0x25')](respondWithResult(_0x451d01,0xc9))[_0x81fe('0x40')](handleError(_0x451d01,null));};exports['update']=function(_0x3ef503,_0x261853){if(_0x3ef503[_0x81fe('0x45')]['id']){delete _0x3ef503['body']['id'];}return db[_0x81fe('0x2b')]['find']({'where':{'id':_0x3ef503['params']['id']}})[_0x81fe('0x25')](handleEntityNotFound(_0x261853,null))[_0x81fe('0x25')](saveUpdates(_0x3ef503[_0x81fe('0x45')],null))['then'](respondWithResult(_0x261853,null))['catch'](handleError(_0x261853,null));};exports['destroy']=function(_0x2c4a2a,_0x55513e){return db[_0x81fe('0x2b')][_0x81fe('0x46')]({'where':{'id':_0x2c4a2a[_0x81fe('0x47')]['id']}})[_0x81fe('0x25')](handleEntityNotFound(_0x55513e,null))[_0x81fe('0x25')](removeEntity(_0x55513e,null))[_0x81fe('0x40')](handleError(_0x55513e,null));};exports[_0x81fe('0x48')]=function(_0xe1f87e,_0x1d6f8e){return db[_0x81fe('0x2b')][_0x81fe('0x48')]()['then'](respondWithResult(_0x1d6f8e,null))['catch'](handleError(_0x1d6f8e,null));};
\ No newline at end of file
+var _0xb823=['filter','where','merge','map','VIRTUAL','VoiceDialReport','findAll','rows','show','params','keys','includeAll','include','catch','create','update','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','stack','name','index','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0xb823,0xa7));var _0x3b82=function(_0xf5d71c,_0x2613a6){_0xf5d71c=_0xf5d71c-0x0;var _0x5af672=_0xb823[_0xf5d71c];return _0x5af672;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3b82('0x0'));var zipdir=require(_0x3b82('0x1'));var jsonpatch=require(_0x3b82('0x2'));var rp=require(_0x3b82('0x3'));var moment=require('moment');var BPromise=require(_0x3b82('0x4'));var Mustache=require(_0x3b82('0x5'));var util=require('util');var path=require(_0x3b82('0x6'));var sox=require(_0x3b82('0x7'));var csv=require(_0x3b82('0x8'));var ejs=require(_0x3b82('0x9'));var fs=require('fs');var fs_extra=require(_0x3b82('0xa'));var _=require(_0x3b82('0xb'));var squel=require(_0x3b82('0xc'));var crypto=require(_0x3b82('0xd'));var jsforce=require(_0x3b82('0xe'));var deskjs=require(_0x3b82('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3b82('0x10'));var Papa=require(_0x3b82('0x11'));var Redis=require(_0x3b82('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3b82('0x13'));var as=require(_0x3b82('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3b82('0x15'))(_0x3b82('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3b82('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x501c65,_0x938470){_0x938470=_0x938470||0xcc;return function(_0x1b9a0d){if(_0x1b9a0d){return _0x501c65['sendStatus'](_0x938470);}return _0x501c65['status'](_0x938470)[_0x3b82('0x18')]();};}function respondWithResult(_0x405612,_0x136e4b){_0x136e4b=_0x136e4b||0xc8;return function(_0x387613){if(_0x387613){return _0x405612[_0x3b82('0x19')](_0x136e4b)[_0x3b82('0x1a')](_0x387613);}};}function respondWithFilteredResult(_0x58ee49,_0x3b4a86){return function(_0x26f2f6){if(_0x26f2f6){var _0x3a8bab=typeof _0x3b4a86['offset']===_0x3b82('0x1b')&&typeof _0x3b4a86[_0x3b82('0x1c')]===_0x3b82('0x1b');var _0x22d5f1=_0x26f2f6[_0x3b82('0x1d')];var _0x8eff77=_0x3a8bab?0x0:_0x3b4a86['offset'];var _0x18466f=_0x3a8bab?_0x26f2f6[_0x3b82('0x1d')]:_0x3b4a86[_0x3b82('0x1e')]+_0x3b4a86[_0x3b82('0x1c')];var _0x1f6695;if(_0x18466f>=_0x22d5f1){_0x18466f=_0x22d5f1;_0x1f6695=0xc8;}else{_0x1f6695=0xce;}_0x58ee49['status'](_0x1f6695);return _0x58ee49[_0x3b82('0x1f')](_0x3b82('0x20'),_0x8eff77+'-'+_0x18466f+'/'+_0x22d5f1)['json'](_0x26f2f6);}return null;};}function patchUpdates(_0x2e1130){return function(_0x40e6bb){try{jsonpatch['apply'](_0x40e6bb,_0x2e1130,!![]);}catch(_0x3be1b6){return BPromise[_0x3b82('0x21')](_0x3be1b6);}return _0x40e6bb[_0x3b82('0x22')]();};}function saveUpdates(_0x33b998,_0x1c5c96){return function(_0x3def32){if(_0x3def32){return _0x3def32['update'](_0x33b998)[_0x3b82('0x23')](function(_0x38580c){return _0x38580c;});}return null;};}function removeEntity(_0x55733b,_0x47bf19){return function(_0x50b0d4){if(_0x50b0d4){return _0x50b0d4[_0x3b82('0x24')]()[_0x3b82('0x23')](function(){_0x55733b[_0x3b82('0x19')](0xcc)[_0x3b82('0x18')]();});}};}function handleEntityNotFound(_0x13d66c,_0x295f01){return function(_0x4c7899){if(!_0x4c7899){_0x13d66c[_0x3b82('0x25')](0x194);}return _0x4c7899;};}function handleError(_0x4e29f0,_0x5c1991){_0x5c1991=_0x5c1991||0x1f4;return function(_0x5868cd){logger['error'](_0x5868cd[_0x3b82('0x26')]);if(_0x5868cd[_0x3b82('0x27')]){delete _0x5868cd[_0x3b82('0x27')];}_0x4e29f0[_0x3b82('0x19')](_0x5c1991)['send'](_0x5868cd);};}exports[_0x3b82('0x28')]=function(_0x1cc593,_0x573297){var _0x6bf6c9={},_0x5a22e5={},_0x5f498a={'count':0x0,'rows':[]};var _0x2ffc2e=_['map'](db['VoiceDialReport']['rawAttributes'],function(_0x396f47){return{'name':_0x396f47['fieldName'],'type':_0x396f47[_0x3b82('0x29')][_0x3b82('0x2a')]};});_0x5a22e5['model']=_['map'](_0x2ffc2e,_0x3b82('0x27'));_0x5a22e5['query']=_['keys'](_0x1cc593[_0x3b82('0x2b')]);_0x5a22e5[_0x3b82('0x2c')]=_[_0x3b82('0x2d')](_0x5a22e5[_0x3b82('0x2e')],_0x5a22e5[_0x3b82('0x2b')]);_0x6bf6c9['attributes']=_[_0x3b82('0x2d')](_0x5a22e5[_0x3b82('0x2e')],qs[_0x3b82('0x2f')](_0x1cc593[_0x3b82('0x2b')][_0x3b82('0x2f')]));_0x6bf6c9[_0x3b82('0x30')]=_0x6bf6c9[_0x3b82('0x30')][_0x3b82('0x31')]?_0x6bf6c9[_0x3b82('0x30')]:_0x5a22e5[_0x3b82('0x2e')];if(!_0x1cc593[_0x3b82('0x2b')][_0x3b82('0x32')](_0x3b82('0x33'))){_0x6bf6c9[_0x3b82('0x1c')]=qs['limit'](_0x1cc593[_0x3b82('0x2b')][_0x3b82('0x1c')]);_0x6bf6c9[_0x3b82('0x1e')]=qs[_0x3b82('0x1e')](_0x1cc593[_0x3b82('0x2b')][_0x3b82('0x1e')]);}_0x6bf6c9[_0x3b82('0x34')]=qs[_0x3b82('0x35')](_0x1cc593['query'][_0x3b82('0x35')]);_0x6bf6c9['where']=qs[_0x3b82('0x2c')](_[_0x3b82('0x36')](_0x1cc593[_0x3b82('0x2b')],_0x5a22e5[_0x3b82('0x2c')]),_0x2ffc2e);if(_0x1cc593['query'][_0x3b82('0x37')]){_0x6bf6c9[_0x3b82('0x38')]=_[_0x3b82('0x39')](_0x6bf6c9[_0x3b82('0x38')],{'$or':_[_0x3b82('0x3a')](_0x2ffc2e,function(_0x5be083){if(_0x5be083[_0x3b82('0x29')]!==_0x3b82('0x3b')){var _0xa779c7={};_0xa779c7[_0x5be083['name']]={'$like':'%'+_0x1cc593[_0x3b82('0x2b')][_0x3b82('0x37')]+'%'};return _0xa779c7;}})});}_0x6bf6c9=_[_0x3b82('0x39')]({},_0x6bf6c9,_0x1cc593['options']);var _0x231582={'where':_0x6bf6c9[_0x3b82('0x38')]};return db['VoiceDialReport'][_0x3b82('0x1d')](_0x231582)[_0x3b82('0x23')](function(_0x19388c){_0x5f498a[_0x3b82('0x1d')]=_0x19388c;if(_0x1cc593['query']['includeAll']){_0x6bf6c9['include']=[{'all':!![]}];}return db[_0x3b82('0x3c')][_0x3b82('0x3d')](_0x6bf6c9);})[_0x3b82('0x23')](function(_0x28b4e8){_0x5f498a[_0x3b82('0x3e')]=_0x28b4e8;return _0x5f498a;})['then'](respondWithFilteredResult(_0x573297,_0x6bf6c9))['catch'](handleError(_0x573297,null));};exports[_0x3b82('0x3f')]=function(_0x40b567,_0x1913b9){var _0x4af9d7={'raw':!![],'where':{'id':_0x40b567[_0x3b82('0x40')]['id']}},_0x2754e1={};_0x2754e1[_0x3b82('0x2e')]=_[_0x3b82('0x41')](db['VoiceDialReport']['rawAttributes']);_0x2754e1['query']=_[_0x3b82('0x41')](_0x40b567[_0x3b82('0x2b')]);_0x2754e1[_0x3b82('0x2c')]=_[_0x3b82('0x2d')](_0x2754e1[_0x3b82('0x2e')],_0x2754e1[_0x3b82('0x2b')]);_0x4af9d7[_0x3b82('0x30')]=_[_0x3b82('0x2d')](_0x2754e1[_0x3b82('0x2e')],qs['fields'](_0x40b567[_0x3b82('0x2b')][_0x3b82('0x2f')]));_0x4af9d7['attributes']=_0x4af9d7['attributes'][_0x3b82('0x31')]?_0x4af9d7[_0x3b82('0x30')]:_0x2754e1[_0x3b82('0x2e')];if(_0x40b567[_0x3b82('0x2b')][_0x3b82('0x42')]){_0x4af9d7[_0x3b82('0x43')]=[{'all':!![]}];}_0x4af9d7=_[_0x3b82('0x39')]({},_0x4af9d7,_0x40b567['options']);return db[_0x3b82('0x3c')]['find'](_0x4af9d7)[_0x3b82('0x23')](handleEntityNotFound(_0x1913b9,null))[_0x3b82('0x23')](respondWithResult(_0x1913b9,null))[_0x3b82('0x44')](handleError(_0x1913b9,null));};exports[_0x3b82('0x45')]=function(_0x4705c0,_0x21bd50){return db[_0x3b82('0x3c')]['create'](_0x4705c0['body'],{})['then'](respondWithResult(_0x21bd50,0xc9))['catch'](handleError(_0x21bd50,null));};exports[_0x3b82('0x46')]=function(_0x45f315,_0x328a2f){if(_0x45f315['body']['id']){delete _0x45f315[_0x3b82('0x47')]['id'];}return db[_0x3b82('0x3c')][_0x3b82('0x48')]({'where':{'id':_0x45f315[_0x3b82('0x40')]['id']}})['then'](handleEntityNotFound(_0x328a2f,null))[_0x3b82('0x23')](saveUpdates(_0x45f315[_0x3b82('0x47')],null))[_0x3b82('0x23')](respondWithResult(_0x328a2f,null))[_0x3b82('0x44')](handleError(_0x328a2f,null));};exports[_0x3b82('0x24')]=function(_0x2b9424,_0xa593ac){return db[_0x3b82('0x3c')][_0x3b82('0x48')]({'where':{'id':_0x2b9424[_0x3b82('0x40')]['id']}})[_0x3b82('0x23')](handleEntityNotFound(_0xa593ac,null))[_0x3b82('0x23')](removeEntity(_0xa593ac,null))[_0x3b82('0x44')](handleError(_0xa593ac,null));};exports[_0x3b82('0x49')]=function(_0x2aefb6,_0x1cc401){return db[_0x3b82('0x3c')][_0x3b82('0x49')]()[_0x3b82('0x23')](respondWithResult(_0x1cc401,null))[_0x3b82('0x44')](handleError(_0x1cc401,null));};
\ No newline at end of file
index e08cdab..f1aeb27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06c5=['bluebird','path','../../config/environment','exports','define','VoiceDialReport','report_dial','lodash','util','../../config/logger','api','moment'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x06c5,0x19f));var _0x506c=function(_0x1489d0,_0x22010f){_0x1489d0=_0x1489d0-0x0;var _0x3da9a8=_0x06c5[_0x1489d0];return _0x3da9a8;};'use strict';var _=require(_0x506c('0x0'));var util=require(_0x506c('0x1'));var logger=require(_0x506c('0x2'))(_0x506c('0x3'));var moment=require(_0x506c('0x4'));var BPromise=require(_0x506c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x506c('0x6'));var rimraf=require('rimraf');var config=require(_0x506c('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0x506c('0x8')]=function(_0x1c5311,_0x5c7e2d){return _0x1c5311[_0x506c('0x9')](_0x506c('0xa'),attributes,{'tableName':_0x506c('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9349=['define','report_dial','uniqueid','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x2dc73a,_0x566e08){var _0x5d2654=function(_0x4cef2a){while(--_0x4cef2a){_0x2dc73a['push'](_0x2dc73a['shift']());}};_0x5d2654(++_0x566e08);}(_0x9349,0x16b));var _0x9934=function(_0x2525b9,_0x5267b1){_0x2525b9=_0x2525b9-0x0;var _0x40bbe6=_0x9349[_0x2525b9];return _0x40bbe6;};'use strict';var _=require('lodash');var util=require(_0x9934('0x0'));var logger=require(_0x9934('0x1'))(_0x9934('0x2'));var moment=require('moment');var BPromise=require(_0x9934('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9934('0x4'));var rimraf=require(_0x9934('0x5'));var config=require(_0x9934('0x6'));var attributes=require(_0x9934('0x7'));module[_0x9934('0x8')]=function(_0xf4aeca,_0x1d6777){return _0xf4aeca[_0x9934('0x9')]('VoiceDialReport',attributes,{'tableName':_0x9934('0xa'),'paranoid':![],'indexes':[{'fields':[_0x9934('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
index 59f3366..67a642e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5a8=['body','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','where','attributes','limit','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','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','VoiceDialReport'];(function(_0x16e0f5,_0x4ec0f3){var _0x4839d5=function(_0x296b8f){while(--_0x296b8f){_0x16e0f5['push'](_0x16e0f5['shift']());}};_0x4839d5(++_0x4ec0f3);}(_0xd5a8,0x69));var _0x8d5a=function(_0x38c26a,_0xdc754){_0x38c26a=_0x38c26a-0x0;var _0x4e56de=_0xd5a8[_0x38c26a];return _0x4e56de;};'use strict';var _=require(_0x8d5a('0x0'));var util=require(_0x8d5a('0x1'));var moment=require(_0x8d5a('0x2'));var BPromise=require(_0x8d5a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d5a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8d5a('0x5'));var logger=require(_0x8d5a('0x6'))(_0x8d5a('0x7'));var config=require(_0x8d5a('0x8'));var jayson=require(_0x8d5a('0x9'));var client=jayson[_0x8d5a('0xa')][_0x8d5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x126a6a,_0x3b89ae,_0x577e86){return new BPromise(function(_0x1cf77c,_0x500a93){return client['request'](_0x126a6a,_0x577e86)[_0x8d5a('0xc')](function(_0x40c487){logger[_0x8d5a('0xd')](_0x8d5a('0xe'),_0x3b89ae,_0x8d5a('0xf'));logger[_0x8d5a('0x10')](_0x8d5a('0x11'),_0x3b89ae,_0x8d5a('0xf'),JSON['stringify'](_0x40c487));if(_0x40c487[_0x8d5a('0x12')]){if(_0x40c487[_0x8d5a('0x12')]['code']===0x1f4){logger[_0x8d5a('0x12')](_0x8d5a('0xe'),_0x3b89ae,_0x40c487[_0x8d5a('0x12')][_0x8d5a('0x13')]);return _0x500a93(_0x40c487['error']['message']);}logger[_0x8d5a('0x12')](_0x8d5a('0xe'),_0x3b89ae,_0x40c487['error'][_0x8d5a('0x13')]);return _0x1cf77c(_0x40c487['error'][_0x8d5a('0x13')]);}else{logger[_0x8d5a('0xd')](_0x8d5a('0xe'),_0x3b89ae,_0x8d5a('0xf'));_0x1cf77c(_0x40c487[_0x8d5a('0x14')][_0x8d5a('0x13')]);}})[_0x8d5a('0x15')](function(_0x2f3ff6){logger[_0x8d5a('0x12')](_0x8d5a('0xe'),_0x3b89ae,_0x2f3ff6);_0x500a93(_0x2f3ff6);});});}exports['CreateVoiceDialReport']=function(_0x4a3d8){var _0x27ac77=this;return new Promise(function(_0x4bb1,_0x312750){return db[_0x8d5a('0x16')]['create'](_0x4a3d8[_0x8d5a('0x17')],{'raw':_0x4a3d8[_0x8d5a('0x18')]?_0x4a3d8['options'][_0x8d5a('0x19')]===undefined?!![]:![]:!![]})[_0x8d5a('0xc')](function(_0x21892b){logger[_0x8d5a('0xd')]('CreateVoiceDialReport',_0x4a3d8);logger[_0x8d5a('0x10')](_0x8d5a('0x1a'),_0x4a3d8,JSON['stringify'](_0x21892b));_0x4bb1(_0x21892b);})[_0x8d5a('0x15')](function(_0x3e187b){logger['error'](_0x8d5a('0x1a'),_0x3e187b[_0x8d5a('0x13')],_0x4a3d8);_0x312750(_0x27ac77[_0x8d5a('0x12')](0x1f4,_0x3e187b[_0x8d5a('0x13')]));});});};exports[_0x8d5a('0x1b')]=function(_0x53f13b){var _0x4fc3e2=this;return new Promise(function(_0x1e4aa7,_0x57388f){return db[_0x8d5a('0x16')]['update'](_0x53f13b[_0x8d5a('0x17')],{'raw':_0x53f13b[_0x8d5a('0x18')]?_0x53f13b[_0x8d5a('0x18')][_0x8d5a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53f13b[_0x8d5a('0x18')]?_0x53f13b[_0x8d5a('0x18')][_0x8d5a('0x1c')]||null:null,'attributes':_0x53f13b['options']?_0x53f13b[_0x8d5a('0x18')][_0x8d5a('0x1d')]||null:null,'limit':_0x53f13b[_0x8d5a('0x18')]?_0x53f13b['options'][_0x8d5a('0x1e')]||null:null})[_0x8d5a('0xc')](function(_0xa9bf52){logger[_0x8d5a('0xd')]('UpdateVoiceDialReport',_0x53f13b);logger[_0x8d5a('0x10')]('UpdateVoiceDialReport',_0x53f13b,JSON[_0x8d5a('0x1f')](_0xa9bf52));_0x1e4aa7(_0xa9bf52);})[_0x8d5a('0x15')](function(_0x2061f8){logger[_0x8d5a('0x12')](_0x8d5a('0x1b'),_0x2061f8['message'],_0x53f13b);_0x57388f(_0x4fc3e2[_0x8d5a('0x12')](0x1f4,_0x2061f8['message']));});});};
\ No newline at end of file
+var _0x1aa8=['raw','then','CreateVoiceDialReport','debug','UpdateVoiceDialReport','update','body','where','limit','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','VoiceDialReport','options'];(function(_0x474e89,_0x521d5d){var _0x2cc8c6=function(_0x104299){while(--_0x104299){_0x474e89['push'](_0x474e89['shift']());}};_0x2cc8c6(++_0x521d5d);}(_0x1aa8,0x189));var _0x81aa=function(_0x344598,_0x1f4008){_0x344598=_0x344598-0x0;var _0x31c197=_0x1aa8[_0x344598];return _0x31c197;};'use strict';var _=require(_0x81aa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x81aa('0x1'));var fs=require('fs');var Redis=require(_0x81aa('0x2'));var db=require(_0x81aa('0x3'))['db'];var utils=require(_0x81aa('0x4'));var logger=require(_0x81aa('0x5'))(_0x81aa('0x6'));var config=require(_0x81aa('0x7'));var jayson=require(_0x81aa('0x8'));var client=jayson[_0x81aa('0x9')][_0x81aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x376511,_0xb6ab16,_0x22777d){return new BPromise(function(_0x34d184,_0x278ccd){return client[_0x81aa('0xb')](_0x376511,_0x22777d)['then'](function(_0x17692b){logger[_0x81aa('0xc')](_0x81aa('0xd'),_0xb6ab16,_0x81aa('0xe'));logger['debug']('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0xb6ab16,_0x81aa('0xe'),JSON[_0x81aa('0xf')](_0x17692b));if(_0x17692b['error']){if(_0x17692b[_0x81aa('0x10')][_0x81aa('0x11')]===0x1f4){logger[_0x81aa('0x10')](_0x81aa('0xd'),_0xb6ab16,_0x17692b[_0x81aa('0x10')][_0x81aa('0x12')]);return _0x278ccd(_0x17692b[_0x81aa('0x10')][_0x81aa('0x12')]);}logger['error'](_0x81aa('0xd'),_0xb6ab16,_0x17692b[_0x81aa('0x10')][_0x81aa('0x12')]);return _0x34d184(_0x17692b[_0x81aa('0x10')][_0x81aa('0x12')]);}else{logger[_0x81aa('0xc')](_0x81aa('0xd'),_0xb6ab16,_0x81aa('0xe'));_0x34d184(_0x17692b[_0x81aa('0x13')][_0x81aa('0x12')]);}})[_0x81aa('0x14')](function(_0x153c0d){logger[_0x81aa('0x10')](_0x81aa('0xd'),_0xb6ab16,_0x153c0d);_0x278ccd(_0x153c0d);});});}exports['CreateVoiceDialReport']=function(_0x1d8b7c){var _0xab08a3=this;return new Promise(function(_0x1e2b59,_0x16a759){return db[_0x81aa('0x15')]['create'](_0x1d8b7c['body'],{'raw':_0x1d8b7c[_0x81aa('0x16')]?_0x1d8b7c[_0x81aa('0x16')][_0x81aa('0x17')]===undefined?!![]:![]:!![]})[_0x81aa('0x18')](function(_0x39fb17){logger[_0x81aa('0xc')](_0x81aa('0x19'),_0x1d8b7c);logger[_0x81aa('0x1a')](_0x81aa('0x19'),_0x1d8b7c,JSON['stringify'](_0x39fb17));_0x1e2b59(_0x39fb17);})[_0x81aa('0x14')](function(_0x47164b){logger[_0x81aa('0x10')](_0x81aa('0x19'),_0x47164b['message'],_0x1d8b7c);_0x16a759(_0xab08a3['error'](0x1f4,_0x47164b[_0x81aa('0x12')]));});});};exports[_0x81aa('0x1b')]=function(_0x650ca){var _0x7f59=this;return new Promise(function(_0x10b06e,_0x5adbe1){return db[_0x81aa('0x15')][_0x81aa('0x1c')](_0x650ca[_0x81aa('0x1d')],{'raw':_0x650ca[_0x81aa('0x16')]?_0x650ca[_0x81aa('0x16')][_0x81aa('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x650ca[_0x81aa('0x16')]?_0x650ca[_0x81aa('0x16')][_0x81aa('0x1e')]||null:null,'attributes':_0x650ca[_0x81aa('0x16')]?_0x650ca[_0x81aa('0x16')]['attributes']||null:null,'limit':_0x650ca[_0x81aa('0x16')]?_0x650ca[_0x81aa('0x16')][_0x81aa('0x1f')]||null:null})[_0x81aa('0x18')](function(_0x56394b){logger[_0x81aa('0xc')]('UpdateVoiceDialReport',_0x650ca);logger['debug']('UpdateVoiceDialReport',_0x650ca,JSON['stringify'](_0x56394b));_0x10b06e(_0x56394b);})[_0x81aa('0x14')](function(_0xe35e1d){logger[_0x81aa('0x10')](_0x81aa('0x1b'),_0xe35e1d[_0x81aa('0x12')],_0x650ca);_0x5adbe1(_0x7f59[_0x81aa('0x10')](0x1f4,_0xe35e1d[_0x81aa('0x12')]));});});};
\ No newline at end of file
index 6696e85..56ed21b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf13=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show','create','post','/:id/applications','addApplications','put','update','delete','exports','multer','path','express'];(function(_0x160ea7,_0x1e6c77){var _0x4a0d35=function(_0x672e8f){while(--_0x672e8f){_0x160ea7['push'](_0x160ea7['shift']());}};_0x4a0d35(++_0x1e6c77);}(_0xcf13,0x1f1));var _0x3cf1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf13[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3cf1('0x0'));var util=require('util');var path=require(_0x3cf1('0x1'));var timeout=require('connect-timeout');var express=require(_0x3cf1('0x2'));var router=express['Router']();var fs_extra=require(_0x3cf1('0x3'));var auth=require(_0x3cf1('0x4'));var interaction=require(_0x3cf1('0x5'));var config=require(_0x3cf1('0x6'));var controller=require(_0x3cf1('0x7'));router[_0x3cf1('0x8')]('/',auth[_0x3cf1('0x9')](),controller['index']);router[_0x3cf1('0x8')](_0x3cf1('0xa'),auth['isAuthenticated'](),controller[_0x3cf1('0xb')]);router['post']('/',auth[_0x3cf1('0x9')](),controller[_0x3cf1('0xc')]);router[_0x3cf1('0xd')](_0x3cf1('0xe'),auth['isAuthenticated'](),controller[_0x3cf1('0xf')]);router[_0x3cf1('0x10')](_0x3cf1('0xa'),auth[_0x3cf1('0x9')](),controller[_0x3cf1('0x11')]);router[_0x3cf1('0x12')](_0x3cf1('0xa'),auth[_0x3cf1('0x9')](),controller['destroy']);module[_0x3cf1('0x13')]=router;
\ No newline at end of file
+var _0x799e=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','isAuthenticated','index','show','post','create','/:id/applications','put','/:id','update','exports','multer','path','connect-timeout','express'];(function(_0x3ad840,_0x24bae5){var _0x58f228=function(_0x3f58fe){while(--_0x3f58fe){_0x3ad840['push'](_0x3ad840['shift']());}};_0x58f228(++_0x24bae5);}(_0x799e,0xf3));var _0xe799=function(_0x598c13,_0x1b9620){_0x598c13=_0x598c13-0x0;var _0x42326e=_0x799e[_0x598c13];return _0x42326e;};'use strict';var multer=require(_0xe799('0x0'));var util=require('util');var path=require(_0xe799('0x1'));var timeout=require(_0xe799('0x2'));var express=require(_0xe799('0x3'));var router=express[_0xe799('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe799('0x5'));var interaction=require(_0xe799('0x6'));var config=require(_0xe799('0x7'));var controller=require(_0xe799('0x8'));router['get']('/',auth[_0xe799('0x9')](),controller[_0xe799('0xa')]);router['get']('/:id',auth[_0xe799('0x9')](),controller[_0xe799('0xb')]);router[_0xe799('0xc')]('/',auth[_0xe799('0x9')](),controller[_0xe799('0xd')]);router[_0xe799('0xc')](_0xe799('0xe'),auth[_0xe799('0x9')](),controller['addApplications']);router[_0xe799('0xf')](_0xe799('0x10'),auth[_0xe799('0x9')](),controller[_0xe799('0x11')]);router['delete'](_0xe799('0x10'),auth[_0xe799('0x9')](),controller['destroy']);module[_0xe799('0x12')]=router;
\ No newline at end of file
index fba7fca..b910326 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71af=['exten','exports','compositeIndex','NoOp','STRING','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue'];(function(_0x50344d,_0x26ffb2){var _0x42a125=function(_0x5876a2){while(--_0x5876a2){_0x50344d['push'](_0x50344d['shift']());}};_0x42a125(++_0x26ffb2);}(_0x71af,0x133));var _0xf71a=function(_0x499acc,_0x3e6b5c){_0x499acc=_0x499acc-0x0;var _0x197025=_0x71af[_0x499acc];return _0x197025;};'use strict';var Sequelize=require('sequelize');module[_0xf71a('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf71a('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf71a('0x1')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf71a('0x2')},'appdata':{'type':Sequelize[_0xf71a('0x3')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xf71a('0x4')](_0xf71a('0x5'),_0xf71a('0x6'),_0xf71a('0x7'),_0xf71a('0x8'),_0xf71a('0x9'),_0xf71a('0xa'),_0xf71a('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0xf71a('0x3')]},'interval':{'type':Sequelize[_0xf71a('0x3')],'allowNull':![],'defaultValue':_0xf71a('0xc')},'IntervalId':{'type':Sequelize[_0xf71a('0xd')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xf71a('0x3')],'defaultValue':null},'callerID':{'type':Sequelize[_0xf71a('0x3')],'allowNull':!![]},'record':{'type':Sequelize[_0xf71a('0xe')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xf71a('0xd')]},'recordingFormat':{'type':Sequelize[_0xf71a('0x3')],'defaultValue':_0xf71a('0xf')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x338734){return this[_0xf71a('0x10')](_0xf71a('0x11'));}},'alias':{'type':Sequelize[_0xf71a('0x3')],'allowNull':!![]}};
\ No newline at end of file
+var _0xae06=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exports','STRING','compositeIndex','NoOp','ENUM','outbound-fax','system','any'];(function(_0x41a5e1,_0x5c9ed8){var _0x4e2a2d=function(_0x260f73){while(--_0x260f73){_0x41a5e1['push'](_0x41a5e1['shift']());}};_0x4e2a2d(++_0x5c9ed8);}(_0xae06,0x172));var _0x6ae0=function(_0x16b0c0,_0x17952b){_0x16b0c0=_0x16b0c0-0x0;var _0x33d5f8=_0xae06[_0x16b0c0];return _0x33d5f8;};'use strict';var Sequelize=require('sequelize');module[_0x6ae0('0x0')]={'context':{'type':Sequelize[_0x6ae0('0x1')],'allowNull':![],'unique':_0x6ae0('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6ae0('0x1')],'allowNull':![],'unique':_0x6ae0('0x2')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x6ae0('0x2')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6ae0('0x3')},'appdata':{'type':Sequelize[_0x6ae0('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6ae0('0x4')]('inbound','outbound','internal','inbound-fax',_0x6ae0('0x5'),_0x6ae0('0x6'),_0x6ae0('0x7')),'allowNull':![]},'description':{'type':Sequelize[_0x6ae0('0x1')]},'interval':{'type':Sequelize[_0x6ae0('0x1')],'allowNull':![],'defaultValue':_0x6ae0('0x8')},'IntervalId':{'type':Sequelize[_0x6ae0('0x9')]},'isApp':{'type':Sequelize[_0x6ae0('0xa')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0x6ae0('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x6ae0('0xa')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6ae0('0x9')]},'recordingFormat':{'type':Sequelize[_0x6ae0('0x1')],'defaultValue':_0x6ae0('0xb')},'answer':{'type':Sequelize[_0x6ae0('0xa')],'defaultValue':!![]},'name':{'type':Sequelize[_0x6ae0('0xc')],'get':function(_0x3b4614){return this[_0x6ae0('0xd')]('exten');}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
index 3806650..0dea58d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb658=['keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','create','startsWith','body','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','mandatoryDisposition','alias','addApplications','findOne','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','map','value','includes','type','name','UserProfileResource','end','sendStatus','error','VoiceExtension','rawAttributes','fieldName','key','model','query'];(function(_0x19409d,_0xf48905){var _0x5de146=function(_0x117745){while(--_0x117745){_0x19409d['push'](_0x19409d['shift']());}};_0x5de146(++_0xf48905);}(_0xb658,0x109));var _0x8b65=function(_0x8dd76c,_0x43a7be){_0x8dd76c=_0x8dd76c-0x0;var _0x3cab6e=_0xb658[_0x8dd76c];return _0x3cab6e;};'use strict';var emlformat=require(_0x8b65('0x0'));var rimraf=require(_0x8b65('0x1'));var zipdir=require(_0x8b65('0x2'));var jsonpatch=require(_0x8b65('0x3'));var rp=require('request-promise');var moment=require(_0x8b65('0x4'));var BPromise=require(_0x8b65('0x5'));var Mustache=require('mustache');var util=require(_0x8b65('0x6'));var path=require(_0x8b65('0x7'));var sox=require(_0x8b65('0x8'));var csv=require(_0x8b65('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8b65('0xa'));var squel=require(_0x8b65('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8b65('0xc'));var toCsv=require(_0x8b65('0x9'));var querystring=require(_0x8b65('0xd'));var Papa=require('papaparse');var Redis=require(_0x8b65('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b65('0xf'));var logger=require(_0x8b65('0x10'))(_0x8b65('0x11'));var utils=require(_0x8b65('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x8b65('0x13'));var db=require('../../mysqldb')['db'];config[_0x8b65('0x14')]=_[_0x8b65('0x15')](config[_0x8b65('0x14')],{'host':_0x8b65('0x16'),'port':0x18eb});var socket=require(_0x8b65('0x17'))(new Redis(config[_0x8b65('0x14')]));require(_0x8b65('0x18'))[_0x8b65('0x19')](socket);function respondWithStatusCode(_0x5c7ec9,_0x24c548){_0x24c548=_0x24c548||0xcc;return function(_0xa6242f){if(_0xa6242f){return _0x5c7ec9['sendStatus'](_0x24c548);}return _0x5c7ec9[_0x8b65('0x1a')](_0x24c548)['end']();};}function respondWithResult(_0x1c18d2,_0x49aeea){_0x49aeea=_0x49aeea||0xc8;return function(_0x390cb0){if(_0x390cb0){return _0x1c18d2[_0x8b65('0x1a')](_0x49aeea)[_0x8b65('0x1b')](_0x390cb0);}};}function respondWithFilteredResult(_0x268d6e,_0x5d9a31){return function(_0x5ee950){if(_0x5ee950){var _0x2e8b37=typeof _0x5d9a31[_0x8b65('0x1c')]==='undefined'&&typeof _0x5d9a31['limit']===_0x8b65('0x1d');var _0x2fa836=_0x5ee950[_0x8b65('0x1e')];var _0x4c15a1=_0x2e8b37?0x0:_0x5d9a31[_0x8b65('0x1c')];var _0x549aab=_0x2e8b37?_0x5ee950[_0x8b65('0x1e')]:_0x5d9a31[_0x8b65('0x1c')]+_0x5d9a31[_0x8b65('0x1f')];var _0x36e9c0;if(_0x549aab>=_0x2fa836){_0x549aab=_0x2fa836;_0x36e9c0=0xc8;}else{_0x36e9c0=0xce;}_0x268d6e[_0x8b65('0x1a')](_0x36e9c0);return _0x268d6e[_0x8b65('0x20')](_0x8b65('0x21'),_0x4c15a1+'-'+_0x549aab+'/'+_0x2fa836)[_0x8b65('0x1b')](_0x5ee950);}return null;};}function patchUpdates(_0x136835){return function(_0xaf2ff0){try{jsonpatch[_0x8b65('0x22')](_0xaf2ff0,_0x136835,!![]);}catch(_0x2ecfd2){return BPromise[_0x8b65('0x23')](_0x2ecfd2);}return _0xaf2ff0[_0x8b65('0x24')]();};}function saveUpdates(_0x53a33f,_0xf4e9f9){return function(_0x11b05a){if(_0x11b05a){return _0x11b05a[_0x8b65('0x25')](_0x53a33f)[_0x8b65('0x26')](function(_0x5b8dfc){return _0x5b8dfc;});}return null;};}function removeEntity(_0x5b8a6a,_0x5de49d){return function(_0x26344b){if(_0x26344b){return _0x26344b[_0x8b65('0x27')]()['then'](function(){var _0x5c695c=_0x26344b['get']({'plain':!![]});var _0x221418=[{'name':_0x8b65('0x28'),'value':_0x8b65('0x29'),'ignore':![]},{'name':_0x8b65('0x2a'),'value':_0x8b65('0x2b'),'ignore':![]},{'name':_0x8b65('0x2c'),'value':_0x8b65('0x2d'),'ignore':![]}];var _0x1df91d=_(_0x221418)[_0x8b65('0x2e')]('ignore')[_0x8b65('0x2f')](_0x8b65('0x30'))[_0x8b65('0x30')]();if(_[_0x8b65('0x31')](_0x1df91d,_0x5c695c[_0x8b65('0x32')])){return;}var _0x15c9c0=_['find'](_0x221418,['value',_0x5c695c['type']])[_0x8b65('0x33')];return db[_0x8b65('0x34')]['destroy']({'where':{'type':_0x15c9c0,'resourceId':_0x5c695c['id']}})['then'](function(){return _0x26344b;});})[_0x8b65('0x26')](function(){_0x5b8a6a['status'](0xcc)[_0x8b65('0x35')]();});}};}function handleEntityNotFound(_0x27d9dd,_0x5152ff){return function(_0x152ebe){if(!_0x152ebe){_0x27d9dd[_0x8b65('0x36')](0x194);}return _0x152ebe;};}function handleError(_0x312e3b,_0x33e1c5){_0x33e1c5=_0x33e1c5||0x1f4;return function(_0x3bab5a){logger[_0x8b65('0x37')](_0x3bab5a['stack']);if(_0x3bab5a[_0x8b65('0x33')]){delete _0x3bab5a[_0x8b65('0x33')];}_0x312e3b['status'](_0x33e1c5)['send'](_0x3bab5a);};}exports['index']=function(_0x6d5781,_0x16998a){var _0x4fc57e={},_0x3a7f74={},_0x72eaf0={'count':0x0,'rows':[]};var _0x565e60=_[_0x8b65('0x2f')](db[_0x8b65('0x38')][_0x8b65('0x39')],function(_0x52645e){return{'name':_0x52645e[_0x8b65('0x3a')],'type':_0x52645e[_0x8b65('0x32')][_0x8b65('0x3b')]};});_0x3a7f74[_0x8b65('0x3c')]=_[_0x8b65('0x2f')](_0x565e60,_0x8b65('0x33'));_0x3a7f74[_0x8b65('0x3d')]=_[_0x8b65('0x3e')](_0x6d5781[_0x8b65('0x3d')]);_0x3a7f74['filters']=_['intersection'](_0x3a7f74[_0x8b65('0x3c')],_0x3a7f74[_0x8b65('0x3d')]);_0x4fc57e[_0x8b65('0x3f')]=_[_0x8b65('0x40')](_0x3a7f74['model'],qs[_0x8b65('0x41')](_0x6d5781[_0x8b65('0x3d')][_0x8b65('0x41')]));_0x4fc57e[_0x8b65('0x3f')]=_0x4fc57e[_0x8b65('0x3f')][_0x8b65('0x42')]?_0x4fc57e['attributes']:_0x3a7f74[_0x8b65('0x3c')];if(!_0x6d5781[_0x8b65('0x3d')]['hasOwnProperty'](_0x8b65('0x43'))){_0x4fc57e[_0x8b65('0x1f')]=qs['limit'](_0x6d5781[_0x8b65('0x3d')]['limit']);_0x4fc57e[_0x8b65('0x1c')]=qs['offset'](_0x6d5781['query']['offset']);}_0x4fc57e[_0x8b65('0x44')]=qs[_0x8b65('0x45')](_0x6d5781[_0x8b65('0x3d')][_0x8b65('0x45')]);_0x4fc57e[_0x8b65('0x46')]=qs[_0x8b65('0x47')](_[_0x8b65('0x48')](_0x6d5781[_0x8b65('0x3d')],_0x3a7f74['filters']),_0x565e60);if(_0x6d5781[_0x8b65('0x3d')][_0x8b65('0x2e')]){_0x4fc57e['where']=_[_0x8b65('0x49')](_0x4fc57e[_0x8b65('0x46')],{'$or':_['map'](_0x565e60,function(_0x2c44e8){if(_0x2c44e8[_0x8b65('0x32')]!==_0x8b65('0x4a')){var _0x206298={};_0x206298[_0x2c44e8[_0x8b65('0x33')]]={'$like':'%'+_0x6d5781['query'][_0x8b65('0x2e')]+'%'};return _0x206298;}})});}_0x4fc57e=_[_0x8b65('0x49')]({},_0x4fc57e,_0x6d5781[_0x8b65('0x4b')]);var _0x1e318d={'where':_0x4fc57e[_0x8b65('0x46')]};return db[_0x8b65('0x38')][_0x8b65('0x1e')](_0x1e318d)[_0x8b65('0x26')](function(_0x1648c2){_0x72eaf0[_0x8b65('0x1e')]=_0x1648c2;if(_0x6d5781['query'][_0x8b65('0x4c')]){_0x4fc57e['include']=[{'all':!![]}];}return db[_0x8b65('0x38')][_0x8b65('0x4d')](_0x4fc57e);})[_0x8b65('0x26')](function(_0x7b8d9a){_0x72eaf0[_0x8b65('0x4e')]=_0x7b8d9a;return _0x72eaf0;})[_0x8b65('0x26')](respondWithFilteredResult(_0x16998a,_0x4fc57e))[_0x8b65('0x4f')](handleError(_0x16998a,null));};exports['show']=function(_0x7d10a1,_0x210427){var _0x3257fe={'raw':![],'where':{'id':_0x7d10a1[_0x8b65('0x50')]['id']}},_0xb7fae2={};_0xb7fae2[_0x8b65('0x3c')]=_[_0x8b65('0x3e')](db[_0x8b65('0x38')][_0x8b65('0x39')]);_0xb7fae2[_0x8b65('0x3d')]=_[_0x8b65('0x3e')](_0x7d10a1[_0x8b65('0x3d')]);_0xb7fae2[_0x8b65('0x47')]=_[_0x8b65('0x40')](_0xb7fae2[_0x8b65('0x3c')],_0xb7fae2[_0x8b65('0x3d')]);_0x3257fe[_0x8b65('0x3f')]=_[_0x8b65('0x40')](_0xb7fae2[_0x8b65('0x3c')],qs[_0x8b65('0x41')](_0x7d10a1[_0x8b65('0x3d')]['fields']));_0x3257fe['attributes']=_0x3257fe[_0x8b65('0x3f')]['length']?_0x3257fe['attributes']:_0xb7fae2[_0x8b65('0x3c')];if(_0x7d10a1[_0x8b65('0x3d')]['includeAll']){_0x3257fe['include']=[{'all':!![]}];}_0x3257fe=_['merge']({},_0x3257fe,_0x7d10a1[_0x8b65('0x4b')]);return db[_0x8b65('0x38')]['find'](_0x3257fe)[_0x8b65('0x26')](handleEntityNotFound(_0x210427,null))[_0x8b65('0x26')](respondWithResult(_0x210427,null))[_0x8b65('0x4f')](handleError(_0x210427,null));};exports['destroy']=function(_0x175628,_0x31a0b8){return db[_0x8b65('0x38')][_0x8b65('0x51')]({'where':{'id':_0x175628[_0x8b65('0x50')]['id']}})[_0x8b65('0x26')](handleEntityNotFound(_0x31a0b8,null))[_0x8b65('0x26')](removeEntity(_0x31a0b8,null))[_0x8b65('0x4f')](handleError(_0x31a0b8,null));};exports[_0x8b65('0x52')]=function(_0x17b92e,_0x2038cb){if(_0x17b92e['body'][_0x8b65('0x32')]===_0x8b65('0x2b')&&!_[_0x8b65('0x53')](_0x17b92e[_0x8b65('0x54')][_0x8b65('0x55')],'_')){_0x17b92e[_0x8b65('0x54')]['exten']='_'['concat'](_0x17b92e[_0x8b65('0x54')][_0x8b65('0x55')]);}return db[_0x8b65('0x38')][_0x8b65('0x52')](_0x17b92e[_0x8b65('0x54')],{'raw':![]})[_0x8b65('0x26')](function(_0x506104){var _0x23364f=_0x17b92e[_0x8b65('0x56')]['get']({'plain':!![]});if(!_0x23364f)throw new Error(_0x8b65('0x57'));if(_0x23364f[_0x8b65('0x58')]==='user'){var _0x4adbaa=_0x506104['get']({'plain':!![]});var _0x544c42=[{'name':_0x8b65('0x28'),'value':'inbound'},{'name':_0x8b65('0x2a'),'value':'outbound'},{'name':_0x8b65('0x2c'),'value':_0x8b65('0x2d')}];var _0xf70831=_[_0x8b65('0x51')](_0x544c42,[_0x8b65('0x30'),_0x4adbaa[_0x8b65('0x32')]])['name'];return db[_0x8b65('0x59')]['find']({'where':{'name':_0xf70831,'userProfileId':_0x23364f[_0x8b65('0x5a')]},'raw':!![]})[_0x8b65('0x26')](function(_0x528636){if(_0x528636&&_0x528636[_0x8b65('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x4adbaa[_0x8b65('0x33')],'resourceId':_0x4adbaa['id'],'type':_0x528636[_0x8b65('0x33')],'sectionId':_0x528636['id']},{})['then'](function(){return _0x506104;});}else{return _0x506104;}})[_0x8b65('0x4f')](function(_0x4cf7ff){logger[_0x8b65('0x37')](_0x8b65('0x5c'),_0x4cf7ff);throw _0x4cf7ff;});}return _0x506104;})[_0x8b65('0x26')](respondWithResult(_0x2038cb,0xc9))[_0x8b65('0x4f')](handleError(_0x2038cb,null));};exports['update']=function(_0x4df6ff,_0x4ef9f6){if(_0x4df6ff[_0x8b65('0x54')]['id']){delete _0x4df6ff[_0x8b65('0x54')]['id'];}return db[_0x8b65('0x38')][_0x8b65('0x51')]({'where':{'id':_0x4df6ff[_0x8b65('0x50')]['id']}})[_0x8b65('0x26')](handleEntityNotFound(_0x4ef9f6,null))[_0x8b65('0x26')](function(_0x3ec485){if(_0x3ec485){return db[_0x8b65('0x38')][_0x8b65('0x25')](_[_0x8b65('0x48')](_0x4df6ff[_0x8b65('0x54')],[_0x8b65('0x55'),_0x8b65('0x5d'),_0x8b65('0x5e'),'recordingFormat','cutdigits',_0x8b65('0x5f'),_0x8b65('0x60')]),{'where':{'context':_0x3ec485[_0x8b65('0x5d')],'exten':_0x3ec485[_0x8b65('0x55')]},'individualHooks':!![]})[_0x8b65('0x26')](function(_0x2d62e3){return _0x2d62e3;});}return null;})['then'](respondWithStatusCode(_0x4ef9f6,null))[_0x8b65('0x4f')](handleError(_0x4ef9f6,null));};exports[_0x8b65('0x61')]=function(_0x6d717e,_0x2105cd){return db[_0x8b65('0x38')][_0x8b65('0x62')]({'where':{'id':_0x6d717e[_0x8b65('0x50')]['id']}})[_0x8b65('0x26')](function(_0x2063f6){if(_0x2063f6){return db['sequelize'][_0x8b65('0x63')](function(_0x43cc58){return db['VoiceExtension'][_0x8b65('0x27')]({'where':{'VoiceExtensionId':_0x6d717e[_0x8b65('0x50')]['id']},'transaction':_0x43cc58})[_0x8b65('0x26')](function(){var _0x534fc0=_['map'](_0x6d717e[_0x8b65('0x54')],function(_0x2d09e3){_0x2d09e3[_0x8b65('0x64')]=_0x6d717e['params']['id'];_0x2d09e3[_0x8b65('0x65')]=!![];return _0x2d09e3;});var _0x43401e=_0x6d717e[_0x8b65('0x3d')]['rewriteDial']&&_0x6d717e[_0x8b65('0x3d')][_0x8b65('0x66')][_0x8b65('0x67')]()===_0x8b65('0x68')?!![]:![];return _0x2063f6[_0x8b65('0x69')](_0x534fc0,_0x43401e);})[_0x8b65('0x26')](function(_0x1aaace){return db[_0x8b65('0x38')][_0x8b65('0x6a')](_0x1aaace,{'transaction':_0x43cc58});});})['then'](function(){return db[_0x8b65('0x38')][_0x8b65('0x6b')]({'where':{'isApp':!![],'VoiceExtensionId':_0x6d717e[_0x8b65('0x50')]['id']},'order':_0x8b65('0x6c')});});}})[_0x8b65('0x26')](respondWithResult(_0x2105cd,null))[_0x8b65('0x4f')](handleError(_0x2105cd,null));};
\ No newline at end of file
+var _0xbda0=['sox','to-csv','fs-extra','lodash','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','./voiceExtension.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','ignore','map','value','includes','type','find','name','UserProfileResource','destroy','end','sendStatus','error','stack','send','index','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','VoiceExtension','findAll','rows','show','includeAll','include','catch','params','create','body','startsWith','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','rewriteDial','toLowerCase','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','moment','mustache','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbda0,0xd7));var _0x0bda=function(_0x16d8d7,_0x3775ec){_0x16d8d7=_0x16d8d7-0x0;var _0x420186=_0xbda0[_0x16d8d7];return _0x420186;};'use strict';var emlformat=require(_0x0bda('0x0'));var rimraf=require(_0x0bda('0x1'));var zipdir=require(_0x0bda('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0bda('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0bda('0x4'));var util=require(_0x0bda('0x5'));var path=require(_0x0bda('0x6'));var sox=require(_0x0bda('0x7'));var csv=require(_0x0bda('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0bda('0x9'));var _=require(_0x0bda('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0bda('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0bda('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0bda('0xc'));var authService=require(_0x0bda('0xd'));var qs=require(_0x0bda('0xe'));var as=require(_0x0bda('0xf'));var hardwareService=require(_0x0bda('0x10'));var logger=require(_0x0bda('0x11'))(_0x0bda('0x12'));var utils=require(_0x0bda('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0bda('0x14'));var db=require(_0x0bda('0x15'))['db'];config['redis']=_[_0x0bda('0x16')](config[_0x0bda('0x17')],{'host':_0x0bda('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0bda('0x17')]));require(_0x0bda('0x19'))[_0x0bda('0x1a')](socket);function respondWithStatusCode(_0x570016,_0xe52f5a){_0xe52f5a=_0xe52f5a||0xcc;return function(_0x4be75c){if(_0x4be75c){return _0x570016['sendStatus'](_0xe52f5a);}return _0x570016[_0x0bda('0x1b')](_0xe52f5a)['end']();};}function respondWithResult(_0x4c201b,_0x293e37){_0x293e37=_0x293e37||0xc8;return function(_0x2dc7b9){if(_0x2dc7b9){return _0x4c201b['status'](_0x293e37)[_0x0bda('0x1c')](_0x2dc7b9);}};}function respondWithFilteredResult(_0x1139e9,_0x5b4de5){return function(_0x7c3875){if(_0x7c3875){var _0x50110e=typeof _0x5b4de5[_0x0bda('0x1d')]===_0x0bda('0x1e')&&typeof _0x5b4de5[_0x0bda('0x1f')]===_0x0bda('0x1e');var _0x159dec=_0x7c3875['count'];var _0x2a1212=_0x50110e?0x0:_0x5b4de5[_0x0bda('0x1d')];var _0x5b4b50=_0x50110e?_0x7c3875[_0x0bda('0x20')]:_0x5b4de5[_0x0bda('0x1d')]+_0x5b4de5['limit'];var _0x500da6;if(_0x5b4b50>=_0x159dec){_0x5b4b50=_0x159dec;_0x500da6=0xc8;}else{_0x500da6=0xce;}_0x1139e9[_0x0bda('0x1b')](_0x500da6);return _0x1139e9[_0x0bda('0x21')](_0x0bda('0x22'),_0x2a1212+'-'+_0x5b4b50+'/'+_0x159dec)[_0x0bda('0x1c')](_0x7c3875);}return null;};}function patchUpdates(_0x42421d){return function(_0x48cfbf){try{jsonpatch[_0x0bda('0x23')](_0x48cfbf,_0x42421d,!![]);}catch(_0x49acc6){return BPromise['reject'](_0x49acc6);}return _0x48cfbf[_0x0bda('0x24')]();};}function saveUpdates(_0x5da5b4,_0x3a01d0){return function(_0xf0e44e){if(_0xf0e44e){return _0xf0e44e[_0x0bda('0x25')](_0x5da5b4)['then'](function(_0x23da00){return _0x23da00;});}return null;};}function removeEntity(_0x4a04a0,_0x5f110f){return function(_0x3f7e43){if(_0x3f7e43){return _0x3f7e43['destroy']()[_0x0bda('0x26')](function(){var _0x3fdf58=_0x3f7e43[_0x0bda('0x27')]({'plain':!![]});var _0x1ff84f=[{'name':_0x0bda('0x28'),'value':_0x0bda('0x29'),'ignore':![]},{'name':_0x0bda('0x2a'),'value':_0x0bda('0x2b'),'ignore':![]},{'name':_0x0bda('0x2c'),'value':'internal','ignore':![]}];var _0x212471=_(_0x1ff84f)['filter'](_0x0bda('0x2d'))[_0x0bda('0x2e')](_0x0bda('0x2f'))['value']();if(_[_0x0bda('0x30')](_0x212471,_0x3fdf58[_0x0bda('0x31')])){return;}var _0x1bd0ed=_[_0x0bda('0x32')](_0x1ff84f,[_0x0bda('0x2f'),_0x3fdf58[_0x0bda('0x31')]])[_0x0bda('0x33')];return db[_0x0bda('0x34')][_0x0bda('0x35')]({'where':{'type':_0x1bd0ed,'resourceId':_0x3fdf58['id']}})['then'](function(){return _0x3f7e43;});})[_0x0bda('0x26')](function(){_0x4a04a0[_0x0bda('0x1b')](0xcc)[_0x0bda('0x36')]();});}};}function handleEntityNotFound(_0x4b0485,_0x1c463c){return function(_0x1247a6){if(!_0x1247a6){_0x4b0485[_0x0bda('0x37')](0x194);}return _0x1247a6;};}function handleError(_0x450efa,_0x1af3a7){_0x1af3a7=_0x1af3a7||0x1f4;return function(_0x8086b0){logger[_0x0bda('0x38')](_0x8086b0[_0x0bda('0x39')]);if(_0x8086b0[_0x0bda('0x33')]){delete _0x8086b0[_0x0bda('0x33')];}_0x450efa[_0x0bda('0x1b')](_0x1af3a7)[_0x0bda('0x3a')](_0x8086b0);};}exports[_0x0bda('0x3b')]=function(_0x44255f,_0xf8a9e7){var _0x232adf={},_0xde7c7e={},_0x17b686={'count':0x0,'rows':[]};var _0x277305=_['map'](db['VoiceExtension'][_0x0bda('0x3c')],function(_0x3d480c){return{'name':_0x3d480c[_0x0bda('0x3d')],'type':_0x3d480c[_0x0bda('0x31')]['key']};});_0xde7c7e[_0x0bda('0x3e')]=_['map'](_0x277305,'name');_0xde7c7e[_0x0bda('0x3f')]=_[_0x0bda('0x40')](_0x44255f['query']);_0xde7c7e[_0x0bda('0x41')]=_[_0x0bda('0x42')](_0xde7c7e['model'],_0xde7c7e[_0x0bda('0x3f')]);_0x232adf[_0x0bda('0x43')]=_[_0x0bda('0x42')](_0xde7c7e[_0x0bda('0x3e')],qs['fields'](_0x44255f['query'][_0x0bda('0x44')]));_0x232adf[_0x0bda('0x43')]=_0x232adf[_0x0bda('0x43')][_0x0bda('0x45')]?_0x232adf[_0x0bda('0x43')]:_0xde7c7e[_0x0bda('0x3e')];if(!_0x44255f[_0x0bda('0x3f')][_0x0bda('0x46')](_0x0bda('0x47'))){_0x232adf[_0x0bda('0x1f')]=qs[_0x0bda('0x1f')](_0x44255f[_0x0bda('0x3f')][_0x0bda('0x1f')]);_0x232adf[_0x0bda('0x1d')]=qs[_0x0bda('0x1d')](_0x44255f['query']['offset']);}_0x232adf[_0x0bda('0x48')]=qs['sort'](_0x44255f[_0x0bda('0x3f')][_0x0bda('0x49')]);_0x232adf['where']=qs[_0x0bda('0x41')](_[_0x0bda('0x4a')](_0x44255f[_0x0bda('0x3f')],_0xde7c7e[_0x0bda('0x41')]),_0x277305);if(_0x44255f[_0x0bda('0x3f')][_0x0bda('0x4b')]){_0x232adf[_0x0bda('0x4c')]=_['merge'](_0x232adf[_0x0bda('0x4c')],{'$or':_['map'](_0x277305,function(_0x247783){if(_0x247783[_0x0bda('0x31')]!==_0x0bda('0x4d')){var _0x3fefc0={};_0x3fefc0[_0x247783[_0x0bda('0x33')]]={'$like':'%'+_0x44255f[_0x0bda('0x3f')][_0x0bda('0x4b')]+'%'};return _0x3fefc0;}})});}_0x232adf=_[_0x0bda('0x4e')]({},_0x232adf,_0x44255f[_0x0bda('0x4f')]);var _0xf50a6e={'where':_0x232adf[_0x0bda('0x4c')]};return db[_0x0bda('0x50')][_0x0bda('0x20')](_0xf50a6e)[_0x0bda('0x26')](function(_0x24220b){_0x17b686[_0x0bda('0x20')]=_0x24220b;if(_0x44255f[_0x0bda('0x3f')]['includeAll']){_0x232adf['include']=[{'all':!![]}];}return db['VoiceExtension'][_0x0bda('0x51')](_0x232adf);})[_0x0bda('0x26')](function(_0xc019dc){_0x17b686[_0x0bda('0x52')]=_0xc019dc;return _0x17b686;})['then'](respondWithFilteredResult(_0xf8a9e7,_0x232adf))['catch'](handleError(_0xf8a9e7,null));};exports[_0x0bda('0x53')]=function(_0x353de2,_0x2980f9){var _0x3a9fb4={'raw':![],'where':{'id':_0x353de2['params']['id']}},_0xf31617={};_0xf31617[_0x0bda('0x3e')]=_[_0x0bda('0x40')](db[_0x0bda('0x50')][_0x0bda('0x3c')]);_0xf31617['query']=_[_0x0bda('0x40')](_0x353de2[_0x0bda('0x3f')]);_0xf31617[_0x0bda('0x41')]=_[_0x0bda('0x42')](_0xf31617[_0x0bda('0x3e')],_0xf31617['query']);_0x3a9fb4[_0x0bda('0x43')]=_[_0x0bda('0x42')](_0xf31617['model'],qs[_0x0bda('0x44')](_0x353de2[_0x0bda('0x3f')][_0x0bda('0x44')]));_0x3a9fb4[_0x0bda('0x43')]=_0x3a9fb4[_0x0bda('0x43')][_0x0bda('0x45')]?_0x3a9fb4['attributes']:_0xf31617[_0x0bda('0x3e')];if(_0x353de2[_0x0bda('0x3f')][_0x0bda('0x54')]){_0x3a9fb4[_0x0bda('0x55')]=[{'all':!![]}];}_0x3a9fb4=_['merge']({},_0x3a9fb4,_0x353de2[_0x0bda('0x4f')]);return db['VoiceExtension'][_0x0bda('0x32')](_0x3a9fb4)[_0x0bda('0x26')](handleEntityNotFound(_0x2980f9,null))[_0x0bda('0x26')](respondWithResult(_0x2980f9,null))[_0x0bda('0x56')](handleError(_0x2980f9,null));};exports[_0x0bda('0x35')]=function(_0x1cee87,_0x2d5d64){return db[_0x0bda('0x50')][_0x0bda('0x32')]({'where':{'id':_0x1cee87[_0x0bda('0x57')]['id']}})[_0x0bda('0x26')](handleEntityNotFound(_0x2d5d64,null))[_0x0bda('0x26')](removeEntity(_0x2d5d64,null))[_0x0bda('0x56')](handleError(_0x2d5d64,null));};exports[_0x0bda('0x58')]=function(_0x4c7890,_0x46ee5b){if(_0x4c7890[_0x0bda('0x59')]['type']===_0x0bda('0x2b')&&!_[_0x0bda('0x5a')](_0x4c7890[_0x0bda('0x59')][_0x0bda('0x5b')],'_')){_0x4c7890['body'][_0x0bda('0x5b')]='_'[_0x0bda('0x5c')](_0x4c7890['body'][_0x0bda('0x5b')]);}return db[_0x0bda('0x50')]['create'](_0x4c7890['body'],{'raw':![]})[_0x0bda('0x26')](function(_0x510a16){var _0x1ea81f=_0x4c7890[_0x0bda('0x5d')]['get']({'plain':!![]});if(!_0x1ea81f)throw new Error(_0x0bda('0x5e'));if(_0x1ea81f['role']===_0x0bda('0x5d')){var _0x12f48a=_0x510a16['get']({'plain':!![]});var _0x2f8361=[{'name':_0x0bda('0x28'),'value':_0x0bda('0x29')},{'name':'OutboundRoutes','value':_0x0bda('0x2b')},{'name':'InternalRoutes','value':'internal'}];var _0x11943a=_['find'](_0x2f8361,[_0x0bda('0x2f'),_0x12f48a[_0x0bda('0x31')]])['name'];return db[_0x0bda('0x5f')][_0x0bda('0x32')]({'where':{'name':_0x11943a,'userProfileId':_0x1ea81f[_0x0bda('0x60')]},'raw':!![]})['then'](function(_0x31825d){if(_0x31825d&&_0x31825d[_0x0bda('0x61')]===0x0){return db[_0x0bda('0x34')][_0x0bda('0x58')]({'name':_0x12f48a[_0x0bda('0x33')],'resourceId':_0x12f48a['id'],'type':_0x31825d[_0x0bda('0x33')],'sectionId':_0x31825d['id']},{})[_0x0bda('0x26')](function(){return _0x510a16;});}else{return _0x510a16;}})[_0x0bda('0x56')](function(_0x16368e){logger['error'](_0x0bda('0x62'),_0x16368e);throw _0x16368e;});}return _0x510a16;})['then'](respondWithResult(_0x46ee5b,0xc9))[_0x0bda('0x56')](handleError(_0x46ee5b,null));};exports[_0x0bda('0x25')]=function(_0x456786,_0x3c30cd){if(_0x456786[_0x0bda('0x59')]['id']){delete _0x456786[_0x0bda('0x59')]['id'];}return db[_0x0bda('0x50')][_0x0bda('0x32')]({'where':{'id':_0x456786[_0x0bda('0x57')]['id']}})[_0x0bda('0x26')](handleEntityNotFound(_0x3c30cd,null))[_0x0bda('0x26')](function(_0xd58f37){if(_0xd58f37){return db['VoiceExtension'][_0x0bda('0x25')](_[_0x0bda('0x4a')](_0x456786[_0x0bda('0x59')],[_0x0bda('0x5b'),_0x0bda('0x63'),_0x0bda('0x64'),_0x0bda('0x65'),_0x0bda('0x66'),_0x0bda('0x67'),_0x0bda('0x68')]),{'where':{'context':_0xd58f37[_0x0bda('0x63')],'exten':_0xd58f37[_0x0bda('0x5b')]},'individualHooks':!![]})[_0x0bda('0x26')](function(_0x6368e5){return _0x6368e5;});}return null;})['then'](respondWithStatusCode(_0x3c30cd,null))[_0x0bda('0x56')](handleError(_0x3c30cd,null));};exports[_0x0bda('0x69')]=function(_0x445af1,_0x555a17){return db['VoiceExtension']['findOne']({'where':{'id':_0x445af1[_0x0bda('0x57')]['id']}})[_0x0bda('0x26')](function(_0x56057a){if(_0x56057a){return db['sequelize']['transaction'](function(_0x10b81b){return db[_0x0bda('0x50')][_0x0bda('0x35')]({'where':{'VoiceExtensionId':_0x445af1[_0x0bda('0x57')]['id']},'transaction':_0x10b81b})[_0x0bda('0x26')](function(){var _0xa44974=_[_0x0bda('0x2e')](_0x445af1[_0x0bda('0x59')],function(_0x1079f5){_0x1079f5['VoiceExtensionId']=_0x445af1[_0x0bda('0x57')]['id'];_0x1079f5['isApp']=!![];return _0x1079f5;});var _0x1ae086=_0x445af1[_0x0bda('0x3f')]['rewriteDial']&&_0x445af1[_0x0bda('0x3f')][_0x0bda('0x6a')][_0x0bda('0x6b')]()==='true'?!![]:![];return _0x56057a[_0x0bda('0x6c')](_0xa44974,_0x1ae086);})['then'](function(_0x107b37){return db[_0x0bda('0x50')]['bulkCreate'](_0x107b37,{'transaction':_0x10b81b});});})[_0x0bda('0x26')](function(){return db[_0x0bda('0x50')][_0x0bda('0x6d')]({'where':{'isApp':!![],'VoiceExtensionId':_0x445af1[_0x0bda('0x57')]['id']},'order':_0x0bda('0x6e')});});}})[_0x0bda('0x26')](respondWithResult(_0x555a17,null))[_0x0bda('0x56')](handleError(_0x555a17,null));};
\ No newline at end of file
index b10dbf6..7f0e87e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73b7=['exports','events','VoiceExtension','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x6eb350,_0x48dd25){var _0x39ec2f=function(_0x29d45b){while(--_0x29d45b){_0x6eb350['push'](_0x6eb350['shift']());}};_0x39ec2f(++_0x48dd25);}(_0x73b7,0x88));var _0x773b=function(_0x19f872,_0x3559c5){_0x19f872=_0x19f872-0x0;var _0x6ad032=_0x73b7[_0x19f872];return _0x6ad032;};'use strict';var EventEmitter=require(_0x773b('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x773b('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x773b('0x2')](0x0);var events={'afterCreate':_0x773b('0x3'),'afterUpdate':'update','afterDestroy':_0x773b('0x4')};function emitEvent(_0x511f2d){return function(_0x53fdd0,_0x40fa43,_0x10c697){VoiceExtensionEvents[_0x773b('0x5')](_0x511f2d+':'+_0x53fdd0['id'],_0x53fdd0);VoiceExtensionEvents[_0x773b('0x5')](_0x511f2d,_0x53fdd0);_0x10c697(null);};}for(var e in events){if(events[_0x773b('0x6')](e)){var event=events[e];VoiceExtension[_0x773b('0x7')](e,emitEvent(event));}}module[_0x773b('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
+var _0x0eab=['events','../../mysqldb','VoiceExtension','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0eab,0x132));var _0xb0ea=function(_0x24ec03,_0x3e2a9c){_0x24ec03=_0x24ec03-0x0;var _0x3a8338=_0x0eab[_0x24ec03];return _0x3a8338;};'use strict';var EventEmitter=require(_0xb0ea('0x0'));var VoiceExtension=require(_0xb0ea('0x1'))['db'][_0xb0ea('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb0ea('0x3'),'afterUpdate':_0xb0ea('0x4'),'afterDestroy':_0xb0ea('0x5')};function emitEvent(_0x38f762){return function(_0x50feef,_0x41734c,_0x5d4502){VoiceExtensionEvents['emit'](_0x38f762+':'+_0x50feef['id'],_0x50feef);VoiceExtensionEvents[_0xb0ea('0x6')](_0x38f762,_0x50feef);_0x5d4502(null);};}for(var e in events){if(events[_0xb0ea('0x7')](e)){var event=events[e];VoiceExtension[_0xb0ea('0x8')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
index cbf8a40..86ecaa1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34b7=['No\x20alias\x20set','inbound','CDR(routeid)=','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','url','split','length','param','phone','prefix','${EXTEN:','${EXTEN}','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','appType','appdata','last','priority','concat','catch','define','VoiceExtension','Hangup','util','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','NoOp','alias','CDR(routeAlias)='];(function(_0x2b8ab9,_0x148e46){var _0x5229e0=function(_0x3283e3){while(--_0x3283e3){_0x2b8ab9['push'](_0x2b8ab9['shift']());}};_0x5229e0(++_0x148e46);}(_0x34b7,0x1db));var _0x734b=function(_0x146ef3,_0x1c7bb0){_0x146ef3=_0x146ef3-0x0;var _0x5d9bae=_0x34b7[_0x146ef3];return _0x5d9bae;};'use strict';var util=require(_0x734b('0x0'));var _=require('lodash');var attributes=require(_0x734b('0x1'));module['exports']=function(_0x1253e2){var _0x31bec8=_0x1253e2[_0x734b('0x2')];function _0xbeea2a(_0x149466){var _0x523a71=0x2;var _0x81d717=[{'type':_0x149466[_0x734b('0x3')],'app':_0x734b('0x4'),'appdata':_0x734b('0x5')+_0x149466[_0x734b('0x3')],'context':_0x149466[_0x734b('0x6')],'exten':_0x149466[_0x734b('0x7')],'priority':_0x523a71++,'VoiceExtensionId':_0x149466['id']},{'type':_0x149466[_0x734b('0x3')],'app':_0x149466['alias']?_0x734b('0x4'):_0x734b('0x8'),'appdata':_0x149466[_0x734b('0x9')]?_0x734b('0xa')+_0x149466[_0x734b('0x9')]:_0x734b('0xb'),'context':_0x149466['context'],'exten':_0x149466[_0x734b('0x7')],'priority':_0x523a71++,'VoiceExtensionId':_0x149466['id']}];if(_0x149466['type']==='inbound'){_0x81d717['push']({'type':_0x734b('0xc'),'app':_0x734b('0x4'),'appdata':_0x734b('0xd')+_0x149466['id'],'context':_0x149466[_0x734b('0x6')],'exten':_0x149466[_0x734b('0x7')],'priority':_0x523a71++,'VoiceExtensionId':_0x149466['id']});}_0x81d717[_0x734b('0xe')]({'type':_0x149466[_0x734b('0x3')],'app':'Set','appdata':_0x734b('0xf'),'context':_0x149466[_0x734b('0x6')],'exten':_0x149466[_0x734b('0x7')],'priority':_0x523a71++,'VoiceExtensionId':_0x149466['id']},{'type':_0x149466[_0x734b('0x3')],'app':_0x734b('0x4'),'appdata':_0x734b('0x10'),'context':_0x149466[_0x734b('0x6')],'exten':_0x149466['exten'],'priority':_0x523a71++,'VoiceExtensionId':_0x149466['id']},{'type':_0x149466[_0x734b('0x3')],'app':_0x734b('0x4'),'appdata':_0x734b('0x11'),'context':_0x149466[_0x734b('0x6')],'exten':_0x149466['exten'],'priority':_0x523a71++,'VoiceExtensionId':_0x149466['id']});return _0x81d717;}function _0xde48e3(_0x20c609){var _0x3e7282=0x2;var _0x4abfd3=[{'type':_0x734b('0x12'),'app':_0x734b('0x4'),'appdata':_0x734b('0x13'),'context':_0x20c609[_0x734b('0x6')],'exten':_0x20c609[_0x734b('0x7')],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']},{'type':_0x734b('0x12'),'app':_0x20c609[_0x734b('0x9')]?_0x734b('0x4'):_0x734b('0x8'),'appdata':_0x20c609[_0x734b('0x9')]?_0x734b('0xa')+_0x20c609[_0x734b('0x9')]:_0x734b('0xb'),'context':_0x20c609['context'],'exten':_0x20c609['exten'],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']},{'type':'outbound','app':_0x734b('0x4'),'appdata':_0x734b('0x14')+(_0x20c609['cutdigits']?'${EXTEN:'+_0x20c609[_0x734b('0x15')]+'}':'${EXTEN}'),'context':_0x20c609['context'],'exten':_0x20c609[_0x734b('0x7')],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']},{'type':'outbound','app':_0x734b('0x4'),'appdata':'CDR(routeid)='+_0x20c609['id'],'context':_0x20c609[_0x734b('0x6')],'exten':_0x20c609[_0x734b('0x7')],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']},{'type':_0x734b('0x12'),'app':_0x734b('0x16'),'appdata':_0x734b('0x17')+(_0x3e7282+0x2)+_0x734b('0x18')+(_0x3e7282+0x1)+')','context':_0x20c609[_0x734b('0x6')],'exten':_0x20c609[_0x734b('0x7')],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']},{'type':_0x734b('0x12'),'app':_0x734b('0x4'),'appdata':_0x20c609[_0x734b('0x15')]?'CDR(prefix)=${EXTEN:0:'+_0x20c609[_0x734b('0x15')]+'}':_0x734b('0x19'),'context':_0x20c609[_0x734b('0x6')],'exten':_0x20c609[_0x734b('0x7')],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']},{'type':_0x734b('0x12'),'app':_0x734b('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x20c609[_0x734b('0x6')],'exten':_0x20c609[_0x734b('0x7')],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']},{'type':_0x734b('0x12'),'app':_0x734b('0x4'),'appdata':_0x734b('0x10'),'context':_0x20c609[_0x734b('0x6')],'exten':_0x20c609[_0x734b('0x7')],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']},{'type':'outbound','app':_0x734b('0x4'),'appdata':_0x734b('0x11'),'context':_0x20c609[_0x734b('0x6')],'exten':_0x20c609['exten'],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']},{'type':_0x734b('0x12'),'app':_0x734b('0x4'),'appdata':_0x734b('0x1a')+_0x20c609['id'],'context':_0x20c609['context'],'exten':_0x20c609[_0x734b('0x7')],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']}];if(_0x20c609[_0x734b('0x1b')](_0x734b('0x1c'))&&_0x20c609['recordingFormat']!==_0x734b('0x1d')){_0x4abfd3[_0x734b('0xe')]({'type':_0x734b('0x12'),'app':_0x734b('0x4'),'appdata':_0x734b('0x1e'),'context':_0x20c609[_0x734b('0x6')],'exten':_0x20c609[_0x734b('0x7')],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']},{'type':'outbound','app':'Set','appdata':_0x734b('0x1f')+_0x20c609[_0x734b('0x1c')]||_0x734b('0x20'),'context':_0x20c609['context'],'exten':_0x20c609['exten'],'priority':_0x3e7282++,'VoiceExtensionId':_0x20c609['id']});}return _0x4abfd3;}function _0x4c3021(_0x378434){var _0x3d466c=[{'name':_0x734b('0x21'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x734b('0x22'),'param':0x2},{'name':_0x734b('0x23'),'param':0x3}];var _0x456887={};var _0x46974d=_0x378434[_0x734b('0x24')](',');var _0x6f7527=[];for(var _0x337a52=0x0;_0x337a52<_0x3d466c[_0x734b('0x25')];_0x337a52++){switch(_0x3d466c[_0x337a52]['name']){case _0x734b('0x21'):_0x456887[_0x734b('0x21')]=_0x46974d[_0x3d466c[_0x337a52][_0x734b('0x26')]][_0x734b('0x24')]('/')[0x1];_0x456887[_0x734b('0x27')]=_0x46974d[_0x3d466c[_0x337a52][_0x734b('0x26')]][_0x734b('0x24')]('/')[0x2];_0x456887[_0x734b('0x28')]=_0x456887[_0x734b('0x27')]?_0x456887[_0x734b('0x27')][_0x734b('0x24')]('$')[0x0]:undefined;_0x456887[_0x734b('0x27')]=route[_0x734b('0x15')]?(_0x456887[_0x734b('0x28')]||'')+_0x734b('0x29')+route[_0x734b('0x15')]+'}':(_0x456887[_0x734b('0x28')]||'')+_0x734b('0x2a');_0x6f7527[_0x3d466c[_0x337a52][_0x734b('0x26')]]=[_0x734b('0x2b'),_0x456887[_0x734b('0x21')],_0x456887[_0x734b('0x27')]][_0x734b('0x2c')]('/');break;case _0x734b('0x22'):_0x456887[_0x734b('0x22')]=_0x46974d[_0x3d466c[_0x337a52][_0x734b('0x26')]];if(route[_0x734b('0x1c')]!=='none'){if(_0x456887['options'][_0x734b('0x2d')](_0x734b('0x2e'))<0x0){_0x456887[_0x734b('0x22')]+=_0x734b('0x2e');}}else{_0x456887['options']=_0x456887[_0x734b('0x22')][_0x734b('0x2f')](_0x734b('0x2e'),'');}_0x6f7527[_0x3d466c[_0x337a52]['param']]=_0x456887[_0x734b('0x22')];break;default:_0x6f7527[_0x3d466c[_0x337a52][_0x734b('0x26')]]=_0x46974d[_0x3d466c[_0x337a52][_0x734b('0x26')]];}}return _0x6f7527['join'](',');}function _0x549166(_0x4e5308,_0x1f78d9,_0x50022a,_0x5eb520){return new Promise(function(_0x401957,_0x3de861){var _0x162a37=[];if(_[_0x734b('0x30')](_0x1f78d9))return _0x401957(_0x162a37);_0x31bec8['Interval'][_0x734b('0x31')]({'attributes':['id',_0x734b('0x32'),_0x734b('0x33')],'raw':!![]})[_0x734b('0x34')](function(_0xee40c2){for(var _0x53c2ee=0x0,_0x324e47=0x0;_0x53c2ee<_0x1f78d9[_0x734b('0x25')];_0x53c2ee++,_0x324e47=0x0){var _0x17849d=_0x1f78d9[_0x53c2ee];var _0x169e20=[];var _0x681f47=[];if(_0x17849d['interval']!==_0x734b('0x35')){_0x17849d[_0x734b('0x36')]=[_0x17849d['interval']];}else{_0x17849d[_0x734b('0x36')]=_0x17849d['IntervalId']?_[_0x734b('0x37')](_[_0x734b('0x38')](_0xee40c2,{'IntervalId':_0x17849d['IntervalId']}),_0x734b('0x32')):[];}_0x17849d[_0x734b('0x6')]=_0x4e5308['context'];_0x17849d[_0x734b('0x7')]=_0x4e5308['exten'];if(_0x17849d[_0x734b('0x3')])_0x17849d[_0x734b('0x3')]=_0x17849d[_0x734b('0x3')][_0x734b('0x39')]();if(_0x4e5308[_0x734b('0x3')]===_0x734b('0x12')){if(_0x17849d[_0x734b('0x1b')](_0x734b('0x3a'))&&_0x17849d[_0x734b('0x3a')]&&_0x17849d['tag']!=='--'){_0x169e20[_0x734b('0xe')]({'type':_0x17849d[_0x734b('0x3')]['toLowerCase'](),'app':_0x734b('0x4'),'appdata':_0x734b('0x3b')+_0x17849d[_0x734b('0x3a')],'context':_0x4e5308[_0x734b('0x6')],'exten':_0x4e5308[_0x734b('0x7')],'priority':_0x17849d['intervals'][_0x734b('0x25')]+_0x50022a+_0x324e47++,'VoiceExtensionId':_0x4e5308['id']});}_0x169e20[_0x734b('0xe')]({'type':_0x17849d[_0x734b('0x3')][_0x734b('0x39')](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x17849d[_0x734b('0x3c')]?_0x734b('0x3d')+_0x17849d['callerID']+')':_0x734b('0x3e')),'context':_0x4e5308[_0x734b('0x6')],'exten':_0x4e5308['exten'],'priority':_0x17849d[_0x734b('0x36')][_0x734b('0x25')]+_0x50022a+_0x324e47++,'VoiceExtensionId':_0x4e5308['id']});}else{if(_0x17849d['hasOwnProperty'](_0x734b('0x3f'))){if([_0x734b('0x40'),_0x734b('0x41')][_0x734b('0x42')](_0x17849d['app'][_0x734b('0x39')]())&&_0x17849d['appType']!=='custom'){if(_0x17849d['answer']){_0x169e20[_0x734b('0xe')]({'type':_0x17849d[_0x734b('0x3')]['toLowerCase'](),'app':_0x734b('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4e5308[_0x734b('0x6')],'exten':_0x4e5308[_0x734b('0x7')],'priority':_0x17849d[_0x734b('0x36')][_0x734b('0x25')]+_0x50022a+_0x324e47++,'VoiceExtensionId':_0x4e5308['id']});_0x169e20['push']({'type':_0x17849d[_0x734b('0x3')]['toLowerCase'](),'app':_0x734b('0x4'),'appdata':_0x734b('0x43'),'context':_0x4e5308[_0x734b('0x6')],'exten':_0x4e5308[_0x734b('0x7')],'priority':_0x17849d[_0x734b('0x36')][_0x734b('0x25')]+_0x50022a+_0x324e47++,'VoiceExtensionId':_0x4e5308['id']});}else{_0x169e20[_0x734b('0xe')]({'type':_0x17849d[_0x734b('0x3')][_0x734b('0x39')](),'app':_0x734b('0x16'),'appdata':_0x734b('0x44'),'context':_0x4e5308['context'],'exten':_0x4e5308['exten'],'priority':_0x17849d['intervals'][_0x734b('0x25')]+_0x50022a+_0x324e47++,'VoiceExtensionId':_0x4e5308['id']});_0x169e20[_0x734b('0xe')]({'type':_0x17849d[_0x734b('0x3')][_0x734b('0x39')](),'app':_0x734b('0x4'),'appdata':_0x734b('0x45'),'context':_0x4e5308[_0x734b('0x6')],'exten':_0x4e5308[_0x734b('0x7')],'priority':_0x17849d[_0x734b('0x36')]['length']+_0x50022a+_0x324e47++,'VoiceExtensionId':_0x4e5308['id']});}}}}for(var _0x548a13=0x0;_0x548a13<_0x17849d[_0x734b('0x36')][_0x734b('0x25')];_0x548a13++){var _0x34699d=_0x50022a+_0x17849d[_0x734b('0x36')][_0x734b('0x25')];var _0x57e5c8=_0x548a13===_0x17849d[_0x734b('0x36')]['length']-0x1?_0x50022a+_0x169e20['length']+_0x681f47[_0x734b('0x25')]+0x2:_0x50022a+_0x548a13+0x1;_0x169e20['splice'](_0x548a13,0x0,{'type':_0x4e5308['type'],'app':_0x734b('0x46'),'appdata':_0x17849d[_0x734b('0x36')][_0x548a13]+'?'+_0x4e5308[_0x734b('0x6')]+',${EXTEN},'+_0x34699d+':'+_0x4e5308[_0x734b('0x6')]+_0x734b('0x47')+_0x57e5c8,'exten':_0x4e5308[_0x734b('0x7')],'context':_0x4e5308[_0x734b('0x6')],'priority':_0x50022a+_0x548a13,'VoiceExtensionId':_0x4e5308['id']});}if(_0x5eb520&&_0x17849d[_0x734b('0x48')]==='outboundDial')_0x17849d[_0x734b('0x49')]=_0x4c3021(_0x17849d['appdata']);_0x17849d['priority']=_0x169e20[_0x734b('0x25')]?_[_0x734b('0x4a')](_0x169e20)[_0x734b('0x4b')]+0x1:_0x50022a;_0x162a37=_[_0x734b('0x4c')](_0x162a37,_0x169e20,[_0x17849d],_0x681f47);_0x50022a=_[_0x734b('0x4a')](_0x162a37)['priority']+0x1;}return _0x401957(_0x162a37);})[_0x734b('0x4d')](function(_0x5a149e){_0x3de861(_0x5a149e);});});}return _0x1253e2[_0x734b('0x4e')](_0x734b('0x4f'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x2334cc,_0x10795f){var _0x1998a8=this;var _0x13ce04=_0x1998a8['type']===_0x734b('0x12')?_0xde48e3(_0x1998a8):_0xbeea2a(_0x1998a8);return _0x549166(_0x1998a8,_0x2334cc,_[_0x734b('0x4a')](_0x13ce04)[_0x734b('0x4b')]+0x1,_0x10795f)['then'](function(_0x250c64){var _0x5ba814=_[_0x734b('0x4c')](_0x13ce04,_0x250c64);_0x5ba814[_0x734b('0xe')]({'type':_0x1998a8['type'],'app':_0x734b('0x50'),'exten':_0x1998a8[_0x734b('0x7')],'context':_0x1998a8[_0x734b('0x6')],'priority':_[_0x734b('0x4a')](_0x5ba814)['priority']+0x1,'VoiceExtensionId':_0x1998a8['id']});return _0x5ba814;});}}});};
\ No newline at end of file
+var _0x84cb=['push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','options','url','name','split','phone','param','prefix','${EXTEN:','SIP','join','indexOf','replace','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','length','intervals','map','filter','tag','CDR(tag)=','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appdata','last','concat','priority','catch','then','Hangup','util','./voiceExtension.attributes','exports','models','type','Set','context','exten','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound'];(function(_0x197871,_0x205912){var _0x51532f=function(_0x1ce0fb){while(--_0x1ce0fb){_0x197871['push'](_0x197871['shift']());}};_0x51532f(++_0x205912);}(_0x84cb,0x93));var _0xb84c=function(_0x638eb6,_0xd902e0){_0x638eb6=_0x638eb6-0x0;var _0x4249ce=_0x84cb[_0x638eb6];return _0x4249ce;};'use strict';var util=require(_0xb84c('0x0'));var _=require('lodash');var attributes=require(_0xb84c('0x1'));module[_0xb84c('0x2')]=function(_0x3d174b){var _0x52ce14=_0x3d174b[_0xb84c('0x3')];function _0x29a7c6(_0x4208c8){var _0x1307be=0x2;var _0x40f777=[{'type':_0x4208c8[_0xb84c('0x4')],'app':_0xb84c('0x5'),'appdata':'CDR(type)='+_0x4208c8[_0xb84c('0x4')],'context':_0x4208c8[_0xb84c('0x6')],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']},{'type':_0x4208c8[_0xb84c('0x4')],'app':_0x4208c8['alias']?'Set':_0xb84c('0x8'),'appdata':_0x4208c8[_0xb84c('0x9')]?_0xb84c('0xa')+_0x4208c8['alias']:_0xb84c('0xb'),'context':_0x4208c8[_0xb84c('0x6')],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']}];if(_0x4208c8[_0xb84c('0x4')]===_0xb84c('0xc')){_0x40f777[_0xb84c('0xd')]({'type':_0xb84c('0xc'),'app':_0xb84c('0x5'),'appdata':_0xb84c('0xe')+_0x4208c8['id'],'context':_0x4208c8['context'],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']});}_0x40f777[_0xb84c('0xd')]({'type':_0x4208c8[_0xb84c('0x4')],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x4208c8[_0xb84c('0x6')],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']},{'type':_0x4208c8['type'],'app':_0xb84c('0x5'),'appdata':_0xb84c('0xf'),'context':_0x4208c8[_0xb84c('0x6')],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']},{'type':_0x4208c8[_0xb84c('0x4')],'app':_0xb84c('0x5'),'appdata':_0xb84c('0x10'),'context':_0x4208c8[_0xb84c('0x6')],'exten':_0x4208c8[_0xb84c('0x7')],'priority':_0x1307be++,'VoiceExtensionId':_0x4208c8['id']});return _0x40f777;}function _0x29dabd(_0x56c658){var _0x599241=0x2;var _0x44468a=[{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x12'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0x56c658[_0xb84c('0x9')]?_0xb84c('0x5'):'NoOp','appdata':_0x56c658['alias']?'CDR(routeAlias)='+_0x56c658[_0xb84c('0x9')]:_0xb84c('0xb'),'context':_0x56c658['context'],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x13')+(_0x56c658[_0xb84c('0x14')]?'${EXTEN:'+_0x56c658['cutdigits']+'}':'${EXTEN}'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':'CDR(routeid)='+_0x56c658['id'],'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x15'),'appdata':_0xb84c('0x16')+(_0x599241+0x2)+_0xb84c('0x17')+(_0x599241+0x1)+')','context':_0x56c658['context'],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':_0x56c658[_0xb84c('0x14')]?_0xb84c('0x18')+_0x56c658[_0xb84c('0x14')]+'}':_0xb84c('0x19'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658['exten'],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':'outbound','app':_0xb84c('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':'outbound','app':'Set','appdata':_0xb84c('0xf'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658['exten'],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x10'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658['exten'],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':_0xb84c('0x11'),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x1a')+_0x56c658['id'],'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']}];if(_0x56c658[_0xb84c('0x1b')](_0xb84c('0x1c'))&&_0x56c658[_0xb84c('0x1c')]!==_0xb84c('0x1d')){_0x44468a[_0xb84c('0xd')]({'type':_0xb84c('0x11'),'app':'Set','appdata':_0xb84c('0x1e'),'context':_0x56c658[_0xb84c('0x6')],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']},{'type':'outbound','app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x56c658[_0xb84c('0x1c')]||_0xb84c('0x1f'),'context':_0x56c658['context'],'exten':_0x56c658[_0xb84c('0x7')],'priority':_0x599241++,'VoiceExtensionId':_0x56c658['id']});}return _0x44468a;}function _0x13ad61(_0x316e0c){var _0x4d19d8=[{'name':_0xb84c('0x20'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0xb84c('0x21'),'param':0x2},{'name':_0xb84c('0x22'),'param':0x3}];var _0x443328={};var _0x2f4c54=_0x316e0c['split'](',');var _0x333137=[];for(var _0x3f4efd=0x0;_0x3f4efd<_0x4d19d8['length'];_0x3f4efd++){switch(_0x4d19d8[_0x3f4efd][_0xb84c('0x23')]){case _0xb84c('0x20'):_0x443328[_0xb84c('0x20')]=_0x2f4c54[_0x4d19d8[_0x3f4efd]['param']][_0xb84c('0x24')]('/')[0x1];_0x443328[_0xb84c('0x25')]=_0x2f4c54[_0x4d19d8[_0x3f4efd][_0xb84c('0x26')]][_0xb84c('0x24')]('/')[0x2];_0x443328['prefix']=_0x443328[_0xb84c('0x25')]?_0x443328[_0xb84c('0x25')][_0xb84c('0x24')]('$')[0x0]:undefined;_0x443328['phone']=route[_0xb84c('0x14')]?(_0x443328[_0xb84c('0x27')]||'')+_0xb84c('0x28')+route[_0xb84c('0x14')]+'}':(_0x443328[_0xb84c('0x27')]||'')+'${EXTEN}';_0x333137[_0x4d19d8[_0x3f4efd]['param']]=[_0xb84c('0x29'),_0x443328[_0xb84c('0x20')],_0x443328[_0xb84c('0x25')]][_0xb84c('0x2a')]('/');break;case _0xb84c('0x21'):_0x443328[_0xb84c('0x21')]=_0x2f4c54[_0x4d19d8[_0x3f4efd]['param']];if(route['recordingFormat']!==_0xb84c('0x1d')){if(_0x443328[_0xb84c('0x21')][_0xb84c('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x443328['options']+='U(xcally-mixmonitor-context)';}}else{_0x443328[_0xb84c('0x21')]=_0x443328[_0xb84c('0x21')][_0xb84c('0x2c')](_0xb84c('0x2d'),'');}_0x333137[_0x4d19d8[_0x3f4efd][_0xb84c('0x26')]]=_0x443328[_0xb84c('0x21')];break;default:_0x333137[_0x4d19d8[_0x3f4efd][_0xb84c('0x26')]]=_0x2f4c54[_0x4d19d8[_0x3f4efd][_0xb84c('0x26')]];}}return _0x333137[_0xb84c('0x2a')](',');}function _0xd4b0d6(_0x3a6575,_0x5dd1ce,_0x8cc5f1,_0x2f184d){return new Promise(function(_0x44e8f6,_0x20ac85){var _0x98afd7=[];if(_[_0xb84c('0x2e')](_0x5dd1ce))return _0x44e8f6(_0x98afd7);_0x52ce14[_0xb84c('0x2f')][_0xb84c('0x30')]({'attributes':['id',_0xb84c('0x31'),_0xb84c('0x32')],'raw':!![]})['then'](function(_0x25491c){for(var _0x9ebd28=0x0,_0x11e31e=0x0;_0x9ebd28<_0x5dd1ce[_0xb84c('0x33')];_0x9ebd28++,_0x11e31e=0x0){var _0x258454=_0x5dd1ce[_0x9ebd28];var _0x41d9e8=[];var _0x175884=[];if(_0x258454[_0xb84c('0x31')]!=='*,*,*,*'){_0x258454[_0xb84c('0x34')]=[_0x258454[_0xb84c('0x31')]];}else{_0x258454[_0xb84c('0x34')]=_0x258454[_0xb84c('0x32')]?_[_0xb84c('0x35')](_[_0xb84c('0x36')](_0x25491c,{'IntervalId':_0x258454[_0xb84c('0x32')]}),'interval'):[];}_0x258454[_0xb84c('0x6')]=_0x3a6575[_0xb84c('0x6')];_0x258454[_0xb84c('0x7')]=_0x3a6575[_0xb84c('0x7')];if(_0x258454[_0xb84c('0x4')])_0x258454[_0xb84c('0x4')]=_0x258454[_0xb84c('0x4')]['toLowerCase']();if(_0x3a6575[_0xb84c('0x4')]===_0xb84c('0x11')){if(_0x258454['hasOwnProperty'](_0xb84c('0x37'))&&_0x258454['tag']&&_0x258454[_0xb84c('0x37')]!=='--'){_0x41d9e8[_0xb84c('0xd')]({'type':_0x258454[_0xb84c('0x4')]['toLowerCase'](),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x38')+_0x258454[_0xb84c('0x37')],'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575[_0xb84c('0x7')],'priority':_0x258454[_0xb84c('0x34')][_0xb84c('0x33')]+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});}_0x41d9e8[_0xb84c('0xd')]({'type':_0x258454[_0xb84c('0x4')][_0xb84c('0x39')](),'app':'ExecIf','appdata':_0xb84c('0x3a')+(_0x258454[_0xb84c('0x3b')]?_0xb84c('0x3c')+_0x258454[_0xb84c('0x3b')]+')':_0xb84c('0x3d')),'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575['exten'],'priority':_0x258454['intervals'][_0xb84c('0x33')]+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});}else{if(_0x258454[_0xb84c('0x1b')]('answer')){if(['queue',_0xb84c('0x3e')][_0xb84c('0x3f')](_0x258454['app'][_0xb84c('0x39')]())&&_0x258454[_0xb84c('0x40')]!==_0xb84c('0x41')){if(_0x258454['answer']){_0x41d9e8[_0xb84c('0xd')]({'type':_0x258454[_0xb84c('0x4')]['toLowerCase'](),'app':'ExecIf','appdata':_0xb84c('0x42'),'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575[_0xb84c('0x7')],'priority':_0x258454[_0xb84c('0x34')][_0xb84c('0x33')]+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});_0x41d9e8[_0xb84c('0xd')]({'type':_0x258454[_0xb84c('0x4')][_0xb84c('0x39')](),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x43'),'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575[_0xb84c('0x7')],'priority':_0x258454[_0xb84c('0x34')]['length']+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});}else{_0x41d9e8['push']({'type':_0x258454[_0xb84c('0x4')][_0xb84c('0x39')](),'app':_0xb84c('0x15'),'appdata':_0xb84c('0x44'),'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575['exten'],'priority':_0x258454[_0xb84c('0x34')][_0xb84c('0x33')]+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});_0x41d9e8['push']({'type':_0x258454[_0xb84c('0x4')]['toLowerCase'](),'app':_0xb84c('0x5'),'appdata':_0xb84c('0x45'),'context':_0x3a6575[_0xb84c('0x6')],'exten':_0x3a6575[_0xb84c('0x7')],'priority':_0x258454['intervals'][_0xb84c('0x33')]+_0x8cc5f1+_0x11e31e++,'VoiceExtensionId':_0x3a6575['id']});}}}}for(var _0x3c81ae=0x0;_0x3c81ae<_0x258454[_0xb84c('0x34')]['length'];_0x3c81ae++){var _0x382dbf=_0x8cc5f1+_0x258454[_0xb84c('0x34')][_0xb84c('0x33')];var _0x3d31bd=_0x3c81ae===_0x258454[_0xb84c('0x34')]['length']-0x1?_0x8cc5f1+_0x41d9e8[_0xb84c('0x33')]+_0x175884[_0xb84c('0x33')]+0x2:_0x8cc5f1+_0x3c81ae+0x1;_0x41d9e8[_0xb84c('0x46')](_0x3c81ae,0x0,{'type':_0x3a6575[_0xb84c('0x4')],'app':_0xb84c('0x47'),'appdata':_0x258454[_0xb84c('0x34')][_0x3c81ae]+'?'+_0x3a6575[_0xb84c('0x6')]+_0xb84c('0x48')+_0x382dbf+':'+_0x3a6575['context']+_0xb84c('0x48')+_0x3d31bd,'exten':_0x3a6575[_0xb84c('0x7')],'context':_0x3a6575['context'],'priority':_0x8cc5f1+_0x3c81ae,'VoiceExtensionId':_0x3a6575['id']});}if(_0x2f184d&&_0x258454[_0xb84c('0x40')]==='outboundDial')_0x258454['appdata']=_0x13ad61(_0x258454[_0xb84c('0x49')]);_0x258454['priority']=_0x41d9e8[_0xb84c('0x33')]?_[_0xb84c('0x4a')](_0x41d9e8)['priority']+0x1:_0x8cc5f1;_0x98afd7=_[_0xb84c('0x4b')](_0x98afd7,_0x41d9e8,[_0x258454],_0x175884);_0x8cc5f1=_[_0xb84c('0x4a')](_0x98afd7)[_0xb84c('0x4c')]+0x1;}return _0x44e8f6(_0x98afd7);})[_0xb84c('0x4d')](function(_0x5eeab9){_0x20ac85(_0x5eeab9);});});}return _0x3d174b['define']('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x209917,_0x4a442f){var _0x5285ce=this;var _0x679651=_0x5285ce['type']===_0xb84c('0x11')?_0x29dabd(_0x5285ce):_0x29a7c6(_0x5285ce);return _0xd4b0d6(_0x5285ce,_0x209917,_['last'](_0x679651)[_0xb84c('0x4c')]+0x1,_0x4a442f)[_0xb84c('0x4e')](function(_0x3ea593){var _0x20d762=_['concat'](_0x679651,_0x3ea593);_0x20d762[_0xb84c('0xd')]({'type':_0x5285ce[_0xb84c('0x4')],'app':_0xb84c('0x4f'),'exten':_0x5285ce[_0xb84c('0x7')],'context':_0x5285ce[_0xb84c('0x6')],'priority':_['last'](_0x20d762)[_0xb84c('0x4c')]+0x1,'VoiceExtensionId':_0x5285ce['id']});return _0x20d762;});}}});};
\ No newline at end of file
index 7d933b4..814d350 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd87=['options','raw','where','limit','include','model','attributes','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','register','request','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0xfd87,0x80));var _0x7fd8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd87[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7fd8('0x0'));var util=require(_0x7fd8('0x1'));var moment=require(_0x7fd8('0x2'));var BPromise=require(_0x7fd8('0x3'));var rs=require(_0x7fd8('0x4'));var fs=require('fs');var Redis=require(_0x7fd8('0x5'));var db=require(_0x7fd8('0x6'))['db'];var utils=require(_0x7fd8('0x7'));var logger=require(_0x7fd8('0x8'))(_0x7fd8('0x9'));var config=require(_0x7fd8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7fd8('0xb')][_0x7fd8('0xc')]({'port':0x232a});config['redis']=_[_0x7fd8('0xd')](config[_0x7fd8('0xe')],{'host':_0x7fd8('0xf'),'port':0x18eb});var socket=require(_0x7fd8('0x10'))(new Redis(config[_0x7fd8('0xe')]));require('./voiceExtension.socket')[_0x7fd8('0x11')](socket);function respondWithRpcPromise(_0x18e3ea,_0x1b8863,_0x596d03){return new BPromise(function(_0x5486fc,_0x4948d0){return client[_0x7fd8('0x12')](_0x18e3ea,_0x596d03)['then'](function(_0x4749df){logger[_0x7fd8('0x13')](_0x7fd8('0x14'),_0x1b8863,'request\x20sent');logger[_0x7fd8('0x15')](_0x7fd8('0x16'),_0x1b8863,_0x7fd8('0x17'),JSON[_0x7fd8('0x18')](_0x4749df));if(_0x4749df[_0x7fd8('0x19')]){if(_0x4749df['error'][_0x7fd8('0x1a')]===0x1f4){logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);return _0x4948d0(_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);}logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x4749df[_0x7fd8('0x19')][_0x7fd8('0x1b')]);return _0x5486fc(_0x4749df['error']['message']);}else{logger['info'](_0x7fd8('0x14'),_0x1b8863,_0x7fd8('0x17'));_0x5486fc(_0x4749df['result'][_0x7fd8('0x1b')]);}})[_0x7fd8('0x1c')](function(_0x40b134){logger[_0x7fd8('0x19')](_0x7fd8('0x14'),_0x1b8863,_0x40b134);_0x4948d0(_0x40b134);});});}exports[_0x7fd8('0x1d')]=function(_0x2edf31){var _0x4539b6=this;return new Promise(function(_0x4b5d0a,_0x34bc09){return db[_0x7fd8('0x1e')][_0x7fd8('0x1f')]({'raw':_0x2edf31[_0x7fd8('0x20')]?_0x2edf31[_0x7fd8('0x20')][_0x7fd8('0x21')]===undefined?!![]:![]:!![],'where':_0x2edf31['options']?_0x2edf31[_0x7fd8('0x20')][_0x7fd8('0x22')]||null:null,'attributes':_0x2edf31[_0x7fd8('0x20')]?_0x2edf31[_0x7fd8('0x20')]['attributes']||null:null,'limit':_0x2edf31[_0x7fd8('0x20')]?_0x2edf31[_0x7fd8('0x20')][_0x7fd8('0x23')]||null:null,'include':_0x2edf31[_0x7fd8('0x20')]?_0x2edf31[_0x7fd8('0x20')]['include']?_['map'](_0x2edf31[_0x7fd8('0x20')][_0x7fd8('0x24')],function(_0xa273a7){return{'model':db[_0xa273a7[_0x7fd8('0x25')]],'as':_0xa273a7['as'],'attributes':_0xa273a7[_0x7fd8('0x26')],'include':_0xa273a7['include']?_[_0x7fd8('0x27')](_0xa273a7[_0x7fd8('0x24')],function(_0xda5f2a){return{'model':db[_0xda5f2a[_0x7fd8('0x25')]],'as':_0xda5f2a['as'],'attributes':_0xda5f2a[_0x7fd8('0x26')],'include':_0xda5f2a['include']?_['map'](_0xda5f2a[_0x7fd8('0x24')],function(_0x2bd721){return{'model':db[_0x2bd721[_0x7fd8('0x25')]],'as':_0x2bd721['as'],'attributes':_0x2bd721[_0x7fd8('0x26')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4fc63a){logger[_0x7fd8('0x13')]('GetVoiceExtension',_0x2edf31);logger[_0x7fd8('0x15')](_0x7fd8('0x1d'),_0x2edf31,JSON[_0x7fd8('0x18')](_0x4fc63a));_0x4b5d0a(_0x4fc63a);})['catch'](function(_0x28e28e){logger['error'](_0x7fd8('0x1d'),_0x28e28e[_0x7fd8('0x1b')],_0x2edf31);_0x34bc09(_0x4539b6[_0x7fd8('0x19')](0x1f4,_0x28e28e[_0x7fd8('0x1b')]));});});};
\ No newline at end of file
+var _0xc569=['model','map','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include'];(function(_0x33c364,_0xa6c8a0){var _0x87421d=function(_0x584c02){while(--_0x584c02){_0x33c364['push'](_0x33c364['shift']());}};_0x87421d(++_0xa6c8a0);}(_0xc569,0x159));var _0x9c56=function(_0x26e125,_0x55760c){_0x26e125=_0x26e125-0x0;var _0x22c3a6=_0xc569[_0x26e125];return _0x22c3a6;};'use strict';var _=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var moment=require(_0x9c56('0x2'));var BPromise=require('bluebird');var rs=require(_0x9c56('0x3'));var fs=require('fs');var Redis=require(_0x9c56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c56('0x5'));var logger=require(_0x9c56('0x6'))(_0x9c56('0x7'));var config=require('../../config/environment');var jayson=require(_0x9c56('0x8'));var client=jayson[_0x9c56('0x9')][_0x9c56('0xa')]({'port':0x232a});config[_0x9c56('0xb')]=_['defaults'](config[_0x9c56('0xb')],{'host':_0x9c56('0xc'),'port':0x18eb});var socket=require(_0x9c56('0xd'))(new Redis(config[_0x9c56('0xb')]));require(_0x9c56('0xe'))['register'](socket);function respondWithRpcPromise(_0x478bf3,_0x533731,_0x16bc76){return new BPromise(function(_0xee51af,_0x5a6a26){return client[_0x9c56('0xf')](_0x478bf3,_0x16bc76)['then'](function(_0x36cb53){logger[_0x9c56('0x10')](_0x9c56('0x11'),_0x533731,_0x9c56('0x12'));logger[_0x9c56('0x13')](_0x9c56('0x14'),_0x533731,_0x9c56('0x12'),JSON['stringify'](_0x36cb53));if(_0x36cb53[_0x9c56('0x15')]){if(_0x36cb53[_0x9c56('0x15')][_0x9c56('0x16')]===0x1f4){logger[_0x9c56('0x15')](_0x9c56('0x11'),_0x533731,_0x36cb53['error'][_0x9c56('0x17')]);return _0x5a6a26(_0x36cb53['error'][_0x9c56('0x17')]);}logger[_0x9c56('0x15')](_0x9c56('0x11'),_0x533731,_0x36cb53[_0x9c56('0x15')][_0x9c56('0x17')]);return _0xee51af(_0x36cb53[_0x9c56('0x15')][_0x9c56('0x17')]);}else{logger[_0x9c56('0x10')](_0x9c56('0x11'),_0x533731,_0x9c56('0x12'));_0xee51af(_0x36cb53[_0x9c56('0x18')][_0x9c56('0x17')]);}})[_0x9c56('0x19')](function(_0x8ef95e){logger[_0x9c56('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x533731,_0x8ef95e);_0x5a6a26(_0x8ef95e);});});}exports[_0x9c56('0x1a')]=function(_0x3b2124){var _0x6d7bf6=this;return new Promise(function(_0x56bf0a,_0xf074f9){return db[_0x9c56('0x1b')][_0x9c56('0x1c')]({'raw':_0x3b2124[_0x9c56('0x1d')]?_0x3b2124[_0x9c56('0x1d')][_0x9c56('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b2124[_0x9c56('0x1d')]?_0x3b2124[_0x9c56('0x1d')][_0x9c56('0x1f')]||null:null,'attributes':_0x3b2124['options']?_0x3b2124[_0x9c56('0x1d')][_0x9c56('0x20')]||null:null,'limit':_0x3b2124['options']?_0x3b2124[_0x9c56('0x1d')][_0x9c56('0x21')]||null:null,'include':_0x3b2124[_0x9c56('0x1d')]?_0x3b2124[_0x9c56('0x1d')][_0x9c56('0x22')]?_['map'](_0x3b2124['options'][_0x9c56('0x22')],function(_0x1e03ff){return{'model':db[_0x1e03ff['model']],'as':_0x1e03ff['as'],'attributes':_0x1e03ff[_0x9c56('0x20')],'include':_0x1e03ff['include']?_['map'](_0x1e03ff[_0x9c56('0x22')],function(_0x42a685){return{'model':db[_0x42a685[_0x9c56('0x23')]],'as':_0x42a685['as'],'attributes':_0x42a685[_0x9c56('0x20')],'include':_0x42a685[_0x9c56('0x22')]?_[_0x9c56('0x24')](_0x42a685['include'],function(_0x14efdf){return{'model':db[_0x14efdf[_0x9c56('0x23')]],'as':_0x14efdf['as'],'attributes':_0x14efdf['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x47c7be){logger[_0x9c56('0x10')]('GetVoiceExtension',_0x3b2124);logger[_0x9c56('0x13')](_0x9c56('0x1a'),_0x3b2124,JSON[_0x9c56('0x25')](_0x47c7be));_0x56bf0a(_0x47c7be);})[_0x9c56('0x19')](function(_0x289696){logger[_0x9c56('0x15')]('GetVoiceExtension',_0x289696[_0x9c56('0x17')],_0x3b2124);_0xf074f9(_0x6d7bf6['error'](0x1f4,_0x289696['message']));});});};
\ No newline at end of file
index c10e2b0..cc83c2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0x1cb9,0x14e));var _0x91cb=function(_0x52765d,_0x3ba73b){_0x52765d=_0x52765d-0x0;var _0x2c793e=_0x1cb9[_0x52765d];return _0x2c793e;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}};
\ No newline at end of file
+var _0xabce=['voiceExtension:','./voiceExtension.events','save','remove','update','emit'];(function(_0x56051f,_0x60433f){var _0x3159c1=function(_0x18862f){while(--_0x18862f){_0x56051f['push'](_0x56051f['shift']());}};_0x3159c1(++_0x60433f);}(_0xabce,0x103));var _0xeabc=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0xabce[_0x550d12];return _0x12103d;};'use strict';var VoiceExtensionEvents=require(_0xeabc('0x0'));var events=[_0xeabc('0x1'),_0xeabc('0x2'),_0xeabc('0x3')];function createListener(_0x49dbcc,_0x5bd1a4){return function(_0x5ebc95){_0x5bd1a4[_0xeabc('0x4')](_0x49dbcc,_0x5ebc95);};}function removeListener(_0x1d9f37,_0x1a88a7){return function(){VoiceExtensionEvents['removeListener'](_0x1d9f37,_0x1a88a7);};}exports['register']=function(_0x1b07a8){for(var _0x52a4d7=0x0,_0x229ba4=events['length'];_0x52a4d7<_0x229ba4;_0x52a4d7++){var _0x3bdc29=events[_0x52a4d7];var _0x9417af=createListener(_0xeabc('0x5')+_0x3bdc29,_0x1b07a8);VoiceExtensionEvents['on'](_0x3bdc29,_0x9417af);}};
\ No newline at end of file
index 992c227..8c87826 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x687b=['../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x350bee,_0x31570f){var _0x1285d1=function(_0x486b21){while(--_0x486b21){_0x350bee['push'](_0x350bee['shift']());}};_0x1285d1(++_0x31570f);}(_0x687b,0x14a));var _0xb687=function(_0x2ed806,_0x4e64aa){_0x2ed806=_0x2ed806-0x0;var _0x55f7aa=_0x687b[_0x2ed806];return _0x55f7aa;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb687('0x4'));var auth=require(_0xb687('0x5'));var interaction=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var controller=require(_0xb687('0x8'));router[_0xb687('0x9')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0xb')]);router[_0xb687('0x9')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0x9')]('/:id/messages',auth[_0xb687('0xa')](),controller[_0xb687('0xe')]);router[_0xb687('0xf')]('/',auth[_0xb687('0xa')](),controller[_0xb687('0x10')]);router[_0xb687('0x11')](_0xb687('0xc'),auth[_0xb687('0xa')](),controller[_0xb687('0x12')]);router['delete'](_0xb687('0xc'),auth[_0xb687('0xa')](),controller[_0xb687('0x13')]);module[_0xb687('0x14')]=router;
\ No newline at end of file
+var _0x4fb4=['update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','getMessages','post','create','put'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x4fb4,0x190));var _0x44fb=function(_0x148f98,_0xa894ba){_0x148f98=_0x148f98-0x0;var _0x4f964d=_0x4fb4[_0x148f98];return _0x4f964d;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id/messages',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0x10')]);router[_0x44fb('0x11')](_0x44fb('0xc'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x12')]);router[_0x44fb('0x13')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0x14')]);module[_0x44fb('0x15')]=router;
\ No newline at end of file
index 6eb0c0e..0181576 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70a8=['from-voicemail','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','VIRTUAL','fullname','mailbox','sequelize','exports','STRING'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x70a8,0x15d));var _0x870a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x70a8[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x870a('0x0'));module[_0x870a('0x1')]={'customer_id':{'type':Sequelize[_0x870a('0x2')]},'context':{'type':Sequelize[_0x870a('0x2')],'defaultValue':_0x870a('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x870a('0x2')],'defaultValue':'','allowNull':![],'unique':_0x870a('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x870a('0x2')]},'email':{'type':Sequelize[_0x870a('0x2')],'validate':{'isEmail':!![]},'set':function(_0x202574){this[_0x870a('0x5')](_0x870a('0x6'),typeof _0x202574===_0x870a('0x7')&&_0x202574['trim']()?_0x202574[_0x870a('0x8')]():null);}},'pager':{'type':Sequelize[_0x870a('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':'central'},'attach':{'type':Sequelize[_0x870a('0x9')](_0x870a('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x870a('0x9')]('yes','no'),'defaultValue':_0x870a('0xa'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x870a('0x2')]},'review':{'type':Sequelize[_0x870a('0x9')](_0x870a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x870a('0x9')](_0x870a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x870a('0x9')](_0x870a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x870a('0x9')](_0x870a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x870a('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x870a('0x9')](_0x870a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x870a('0x9')](_0x870a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x870a('0x9')](_0x870a('0xa'),'no'),'defaultValue':_0x870a('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x870a('0x9')](_0x870a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x870a('0x9')](_0x870a('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x870a('0x9')](_0x870a('0xa'),'no'),'defaultValue':_0x870a('0xa'),'allowNull':![]},'stamp':{'type':_0x870a('0xc')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x870a('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x870a('0xd')],'get':function(){return this['getDataValue'](_0x870a('0xe'))+'\x20-\x20'+this['getDataValue'](_0x870a('0xf'));}}};
\ No newline at end of file
+var _0x0f6e=['INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','exports','STRING','from-voicemail','contest_mailbox','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP'];(function(_0x5e8eae,_0x4f81e0){var _0xdd09cd=function(_0x28c85c){while(--_0x28c85c){_0x5e8eae['push'](_0x5e8eae['shift']());}};_0xdd09cd(++_0x4f81e0);}(_0x0f6e,0xd5));var _0xe0f6=function(_0x5d09d9,_0x181abf){_0x5d09d9=_0x5d09d9-0x0;var _0x7ce182=_0x0f6e[_0x5d09d9];return _0x7ce182;};'use strict';var Sequelize=require('sequelize');module[_0xe0f6('0x0')]={'customer_id':{'type':Sequelize[_0xe0f6('0x1')]},'context':{'type':Sequelize[_0xe0f6('0x1')],'defaultValue':_0xe0f6('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xe0f6('0x3')},'password':{'type':Sequelize[_0xe0f6('0x1')]},'fullname':{'type':Sequelize[_0xe0f6('0x1')]},'email':{'type':Sequelize[_0xe0f6('0x1')],'validate':{'isEmail':!![]},'set':function(_0x15f96b){this['setDataValue']('email',typeof _0x15f96b===_0xe0f6('0x4')&&_0x15f96b[_0xe0f6('0x5')]()?_0x15f96b[_0xe0f6('0x5')]():null);}},'pager':{'type':Sequelize[_0xe0f6('0x1')]},'tz':{'type':Sequelize[_0xe0f6('0x1')],'defaultValue':_0xe0f6('0x6')},'attach':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':_0xe0f6('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xe0f6('0x7')]('yes','no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0xe0f6('0x1')]},'callback':{'type':Sequelize[_0xe0f6('0x1')]},'review':{'type':Sequelize['ENUM'](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe0f6('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':_0xe0f6('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe0f6('0x7')](_0xe0f6('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xe0f6('0x8'),'no'),'defaultValue':_0xe0f6('0x8'),'allowNull':![]},'stamp':{'type':_0xe0f6('0xa')},'emailsubject':{'type':Sequelize[_0xe0f6('0x1')]},'emailbody':{'type':Sequelize[_0xe0f6('0x1')]},'maxsecs':{'type':Sequelize[_0xe0f6('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe0f6('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe0f6('0xc')],'get':function(){return this[_0xe0f6('0xd')](_0xe0f6('0xe'))+_0xe0f6('0xf')+this[_0xe0f6('0xd')]('mailbox');}}};
\ No newline at end of file
index e14601f..3b75c67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x236c=['fs-extra','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x3bf90d,_0x33fe38){var _0x5aa34c=function(_0x9f7f81){while(--_0x9f7f81){_0x3bf90d['push'](_0x3bf90d['shift']());}};_0x5aa34c(++_0x33fe38);}(_0x236c,0x155));var _0xc236=function(_0x4e4848,_0x5c7271){_0x4e4848=_0x4e4848-0x0;var _0xa69a7=_0x236c[_0x4e4848];return _0xa69a7;};'use strict';var emlformat=require(_0xc236('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc236('0x1'));var jsonpatch=require(_0xc236('0x2'));var rp=require(_0xc236('0x3'));var moment=require(_0xc236('0x4'));var BPromise=require(_0xc236('0x5'));var Mustache=require('mustache');var util=require(_0xc236('0x6'));var path=require(_0xc236('0x7'));var sox=require(_0xc236('0x8'));var csv=require(_0xc236('0x9'));var ejs=require(_0xc236('0xa'));var fs=require('fs');var fs_extra=require(_0xc236('0xb'));var _=require('lodash');var squel=require(_0xc236('0xc'));var crypto=require(_0xc236('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xc236('0xe'));var Papa=require('papaparse');var Redis=require(_0xc236('0xf'));var authService=require(_0xc236('0x10'));var qs=require(_0xc236('0x11'));var as=require(_0xc236('0x12'));var hardwareService=require(_0xc236('0x13'));var logger=require('../../config/logger')(_0xc236('0x14'));var utils=require(_0xc236('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc236('0x16'));var db=require(_0xc236('0x17'))['db'];function respondWithStatusCode(_0x5ee3a5,_0x5b9638){_0x5b9638=_0x5b9638||0xcc;return function(_0x5bce83){if(_0x5bce83){return _0x5ee3a5['sendStatus'](_0x5b9638);}return _0x5ee3a5[_0xc236('0x18')](_0x5b9638)[_0xc236('0x19')]();};}function respondWithResult(_0x2184c9,_0x71bce2){_0x71bce2=_0x71bce2||0xc8;return function(_0x5052db){if(_0x5052db){return _0x2184c9[_0xc236('0x18')](_0x71bce2)['json'](_0x5052db);}};}function respondWithFilteredResult(_0x5221bf,_0x9a65e8){return function(_0x32f2fd){if(_0x32f2fd){var _0x443a46=typeof _0x9a65e8[_0xc236('0x1a')]===_0xc236('0x1b')&&typeof _0x9a65e8['limit']==='undefined';var _0x57355b=_0x32f2fd[_0xc236('0x1c')];var _0x76f45=_0x443a46?0x0:_0x9a65e8[_0xc236('0x1a')];var _0x541a20=_0x443a46?_0x32f2fd[_0xc236('0x1c')]:_0x9a65e8['offset']+_0x9a65e8['limit'];var _0x1eafba;if(_0x541a20>=_0x57355b){_0x541a20=_0x57355b;_0x1eafba=0xc8;}else{_0x1eafba=0xce;}_0x5221bf[_0xc236('0x18')](_0x1eafba);return _0x5221bf[_0xc236('0x1d')](_0xc236('0x1e'),_0x76f45+'-'+_0x541a20+'/'+_0x57355b)[_0xc236('0x1f')](_0x32f2fd);}return null;};}function patchUpdates(_0x27c6ab){return function(_0x3f0e2f){try{jsonpatch[_0xc236('0x20')](_0x3f0e2f,_0x27c6ab,!![]);}catch(_0x54ffac){return BPromise[_0xc236('0x21')](_0x54ffac);}return _0x3f0e2f[_0xc236('0x22')]();};}function saveUpdates(_0x4a9006,_0x208c3f){return function(_0x34d73a){if(_0x34d73a){return _0x34d73a[_0xc236('0x23')](_0x4a9006)[_0xc236('0x24')](function(_0x27afba){return _0x27afba;});}return null;};}function removeEntity(_0x21fab8,_0x3a315b){return function(_0xf921e6){if(_0xf921e6){return _0xf921e6[_0xc236('0x25')]()[_0xc236('0x24')](function(){var _0x17cb3b=_0xf921e6['get']({'plain':!![]});var _0x308cd6=_0xc236('0x26');return db[_0xc236('0x27')][_0xc236('0x25')]({'where':{'type':_0x308cd6,'resourceId':_0x17cb3b['id']}})['then'](function(){return _0xf921e6;});})[_0xc236('0x24')](function(){_0x21fab8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15ead8,_0x4eace8){return function(_0x36e578){if(!_0x36e578){_0x15ead8['sendStatus'](0x194);}return _0x36e578;};}function handleError(_0x54365,_0x5c79d6){_0x5c79d6=_0x5c79d6||0x1f4;return function(_0x423842){logger[_0xc236('0x28')](_0x423842['stack']);if(_0x423842['name']){delete _0x423842[_0xc236('0x29')];}_0x54365[_0xc236('0x18')](_0x5c79d6)[_0xc236('0x2a')](_0x423842);};}exports[_0xc236('0x2b')]=function(_0x5f3891,_0x4e3262){var _0x28ffa5={},_0x53b767={},_0x2c756f={'count':0x0,'rows':[]};var _0x4ddc87=_[_0xc236('0x2c')](db[_0xc236('0x2d')]['rawAttributes'],function(_0x5a5ec3){return{'name':_0x5a5ec3[_0xc236('0x2e')],'type':_0x5a5ec3[_0xc236('0x2f')][_0xc236('0x30')]};});_0x53b767[_0xc236('0x31')]=_[_0xc236('0x2c')](_0x4ddc87,_0xc236('0x29'));_0x53b767[_0xc236('0x32')]=_[_0xc236('0x33')](_0x5f3891[_0xc236('0x32')]);_0x53b767['filters']=_['intersection'](_0x53b767['model'],_0x53b767[_0xc236('0x32')]);_0x28ffa5[_0xc236('0x34')]=_[_0xc236('0x35')](_0x53b767[_0xc236('0x31')],qs[_0xc236('0x36')](_0x5f3891[_0xc236('0x32')][_0xc236('0x36')]));_0x28ffa5['attributes']=_0x28ffa5[_0xc236('0x34')][_0xc236('0x37')]?_0x28ffa5[_0xc236('0x34')]:_0x53b767['model'];if(!_0x5f3891[_0xc236('0x32')][_0xc236('0x38')](_0xc236('0x39'))){_0x28ffa5[_0xc236('0x3a')]=qs['limit'](_0x5f3891[_0xc236('0x32')][_0xc236('0x3a')]);_0x28ffa5[_0xc236('0x1a')]=qs[_0xc236('0x1a')](_0x5f3891[_0xc236('0x32')][_0xc236('0x1a')]);}_0x28ffa5[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x5f3891[_0xc236('0x32')][_0xc236('0x3c')]);_0x28ffa5[_0xc236('0x3d')]=qs[_0xc236('0x3e')](_[_0xc236('0x3f')](_0x5f3891[_0xc236('0x32')],_0x53b767[_0xc236('0x3e')]),_0x4ddc87);if(_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]){_0x28ffa5['where']=_['merge'](_0x28ffa5['where'],{'$or':_['map'](_0x4ddc87,function(_0x369a79){if(_0x369a79['type']!==_0xc236('0x41')){var _0x361526={};_0x361526[_0x369a79[_0xc236('0x29')]]={'$like':'%'+_0x5f3891[_0xc236('0x32')][_0xc236('0x40')]+'%'};return _0x361526;}})});}_0x28ffa5=_[_0xc236('0x42')]({},_0x28ffa5,_0x5f3891[_0xc236('0x43')]);var _0x201ba3={'where':_0x28ffa5[_0xc236('0x3d')]};return db[_0xc236('0x2d')][_0xc236('0x1c')](_0x201ba3)[_0xc236('0x24')](function(_0x3b2f2f){_0x2c756f[_0xc236('0x1c')]=_0x3b2f2f;if(_0x5f3891[_0xc236('0x32')]['includeAll']){_0x28ffa5[_0xc236('0x44')]=[{'all':!![]}];}return db[_0xc236('0x2d')]['findAll'](_0x28ffa5);})[_0xc236('0x24')](function(_0x5b0bc5){_0x2c756f[_0xc236('0x45')]=_0x5b0bc5;return _0x2c756f;})['then'](respondWithFilteredResult(_0x4e3262,_0x28ffa5))[_0xc236('0x46')](handleError(_0x4e3262,null));};exports[_0xc236('0x47')]=function(_0x8d04c9,_0x479e02){var _0x11e3dd={'raw':!![],'where':{'id':_0x8d04c9[_0xc236('0x48')]['id']}},_0x429e08={};_0x429e08['model']=_[_0xc236('0x33')](db[_0xc236('0x2d')][_0xc236('0x49')]);_0x429e08[_0xc236('0x32')]=_[_0xc236('0x33')](_0x8d04c9[_0xc236('0x32')]);_0x429e08['filters']=_[_0xc236('0x35')](_0x429e08['model'],_0x429e08[_0xc236('0x32')]);_0x11e3dd[_0xc236('0x34')]=_[_0xc236('0x35')](_0x429e08[_0xc236('0x31')],qs[_0xc236('0x36')](_0x8d04c9[_0xc236('0x32')][_0xc236('0x36')]));_0x11e3dd['attributes']=_0x11e3dd[_0xc236('0x34')]['length']?_0x11e3dd[_0xc236('0x34')]:_0x429e08[_0xc236('0x31')];if(_0x8d04c9['query'][_0xc236('0x4a')]){_0x11e3dd[_0xc236('0x44')]=[{'all':!![]}];}_0x11e3dd=_[_0xc236('0x42')]({},_0x11e3dd,_0x8d04c9[_0xc236('0x43')]);return db[_0xc236('0x2d')][_0xc236('0x4b')](_0x11e3dd)[_0xc236('0x24')](handleEntityNotFound(_0x479e02,null))['then'](respondWithResult(_0x479e02,null))['catch'](handleError(_0x479e02,null));};exports[_0xc236('0x4c')]=function(_0x2afed2,_0x510f7f){return db[_0xc236('0x2d')][_0xc236('0x4c')](_0x2afed2[_0xc236('0x4d')],{})[_0xc236('0x24')](function(_0x45fa20){var _0x1683f4=_0x2afed2[_0xc236('0x4e')][_0xc236('0x4f')]({'plain':!![]});if(!_0x1683f4)throw new Error(_0xc236('0x50'));if(_0x1683f4['role']===_0xc236('0x4e')){var _0x307663=_0x45fa20[_0xc236('0x4f')]({'plain':!![]});var _0x447a83=_0xc236('0x26');return db[_0xc236('0x51')][_0xc236('0x4b')]({'where':{'name':_0x447a83,'userProfileId':_0x1683f4['userProfileId']},'raw':!![]})[_0xc236('0x24')](function(_0x3788ff){if(_0x3788ff&&_0x3788ff[_0xc236('0x52')]===0x0){return db[_0xc236('0x27')]['create']({'name':_0x307663[_0xc236('0x29')],'resourceId':_0x307663['id'],'type':_0x3788ff[_0xc236('0x29')],'sectionId':_0x3788ff['id']},{})[_0xc236('0x24')](function(){return _0x45fa20;});}else{return _0x45fa20;}})[_0xc236('0x46')](function(_0x9d81c8){logger['error'](_0xc236('0x53'),_0x9d81c8);throw _0x9d81c8;});}return _0x45fa20;})['then'](respondWithResult(_0x510f7f,0xc9))[_0xc236('0x46')](handleError(_0x510f7f,null));};exports[_0xc236('0x23')]=function(_0x3f9e85,_0x15defc){if(_0x3f9e85[_0xc236('0x4d')]['id']){delete _0x3f9e85['body']['id'];}return db['VoiceMail'][_0xc236('0x4b')]({'where':{'id':_0x3f9e85[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x15defc,null))[_0xc236('0x24')](saveUpdates(_0x3f9e85[_0xc236('0x4d')],null))[_0xc236('0x24')](respondWithResult(_0x15defc,null))[_0xc236('0x46')](handleError(_0x15defc,null));};exports[_0xc236('0x25')]=function(_0x24af08,_0x2d27e7){return db['VoiceMail']['find']({'where':{'id':_0x24af08[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x2d27e7,null))[_0xc236('0x24')](removeEntity(_0x2d27e7,null))[_0xc236('0x46')](handleError(_0x2d27e7,null));};exports['getMessages']=function(_0x94fc7,_0x460076,_0x56e476){return db[_0xc236('0x2d')][_0xc236('0x54')]({'where':{'id':_0x94fc7[_0xc236('0x48')]['id']}})[_0xc236('0x24')](handleEntityNotFound(_0x460076,null))['then'](function(_0x1558dd){var _0xec00da;var _0x35955c={},_0x2602f8={};_0x2602f8[_0xc236('0x31')]=_[_0xc236('0x33')](db[_0xc236('0x55')]['rawAttributes']);_0x2602f8[_0xc236('0x32')]=_['keys'](_0x94fc7[_0xc236('0x32')]);_0x2602f8[_0xc236('0x3e')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],_0x2602f8['query']);_0x35955c[_0xc236('0x34')]=_[_0xc236('0x35')](_0x2602f8[_0xc236('0x31')],qs['fields'](_0x94fc7[_0xc236('0x32')][_0xc236('0x36')]));_0x35955c[_0xc236('0x34')]=_0x35955c[_0xc236('0x34')][_0xc236('0x37')]?_0x35955c[_0xc236('0x34')]:_0x2602f8['model'];if(!_0x94fc7['query'][_0xc236('0x38')](_0xc236('0x39'))){_0x35955c[_0xc236('0x3a')]=qs[_0xc236('0x3a')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3a')]);_0x35955c[_0xc236('0x1a')]=qs['offset'](_0x94fc7['query']['offset']);}_0x35955c[_0xc236('0x3b')]=qs[_0xc236('0x3c')](_0x94fc7[_0xc236('0x32')][_0xc236('0x3c')]);_0x35955c['where']=qs['filters'](_['pick'](_0x94fc7['query'],_0x2602f8[_0xc236('0x3e')]));if(_0x94fc7['query'][_0xc236('0x40')]){_0x35955c['where']=_[_0xc236('0x42')](_0x35955c[_0xc236('0x3d')],{'$or':_[_0xc236('0x2c')](_0x35955c[_0xc236('0x34')],function(_0x26d708){var _0x169e73={};_0x169e73[_0x26d708]={'$like':'%'+_0x94fc7[_0xc236('0x32')]['filter']+'%'};return _0x169e73;})});}_0x35955c[_0xc236('0x3d')]=_['merge'](_0x35955c[_0xc236('0x3d')],{'mailboxuser':_0x1558dd[_0xc236('0x56')]});_0x35955c=_[_0xc236('0x42')]({},_0x35955c,_0x94fc7[_0xc236('0x43')]);return db[_0xc236('0x55')][_0xc236('0x57')](_0x35955c)['then'](respondWithFilteredResult(_0x460076,_0x35955c));})[_0xc236('0x46')](handleError(_0x460076,null));};
\ No newline at end of file
+var _0x69d3=['Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','findAll','catch','show','params','include','options','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','VoiceMailMessage','mailbox','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then'];(function(_0x2813fa,_0x3211d4){var _0x8a2acb=function(_0x4a9602){while(--_0x4a9602){_0x2813fa['push'](_0x2813fa['shift']());}};_0x8a2acb(++_0x3211d4);}(_0x69d3,0xda));var _0x369d=function(_0x51c968,_0x35b964){_0x51c968=_0x51c968-0x0;var _0x9ec045=_0x69d3[_0x51c968];return _0x9ec045;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];function respondWithStatusCode(_0xee549e,_0x52c126){_0x52c126=_0x52c126||0xcc;return function(_0x15b417){if(_0x15b417){return _0xee549e[_0x369d('0x17')](_0x52c126);}return _0xee549e[_0x369d('0x18')](_0x52c126)[_0x369d('0x19')]();};}function respondWithResult(_0x121307,_0x539536){_0x539536=_0x539536||0xc8;return function(_0x5cd4c3){if(_0x5cd4c3){return _0x121307['status'](_0x539536)[_0x369d('0x1a')](_0x5cd4c3);}};}function respondWithFilteredResult(_0xa126c1,_0x389c43){return function(_0x5b4f55){if(_0x5b4f55){var _0x2c1a4a=typeof _0x389c43[_0x369d('0x1b')]===_0x369d('0x1c')&&typeof _0x389c43['limit']===_0x369d('0x1c');var _0x1f37ff=_0x5b4f55['count'];var _0x572513=_0x2c1a4a?0x0:_0x389c43['offset'];var _0x2946be=_0x2c1a4a?_0x5b4f55[_0x369d('0x1d')]:_0x389c43[_0x369d('0x1b')]+_0x389c43['limit'];var _0x410dbe;if(_0x2946be>=_0x1f37ff){_0x2946be=_0x1f37ff;_0x410dbe=0xc8;}else{_0x410dbe=0xce;}_0xa126c1[_0x369d('0x18')](_0x410dbe);return _0xa126c1[_0x369d('0x1e')](_0x369d('0x1f'),_0x572513+'-'+_0x2946be+'/'+_0x1f37ff)[_0x369d('0x1a')](_0x5b4f55);}return null;};}function patchUpdates(_0x538ca4){return function(_0x5c9fdd){try{jsonpatch[_0x369d('0x20')](_0x5c9fdd,_0x538ca4,!![]);}catch(_0x1edcd5){return BPromise[_0x369d('0x21')](_0x1edcd5);}return _0x5c9fdd[_0x369d('0x22')]();};}function saveUpdates(_0x84cc0f,_0x15fbef){return function(_0x1b262a){if(_0x1b262a){return _0x1b262a['update'](_0x84cc0f)['then'](function(_0x32ef9a){return _0x32ef9a;});}return null;};}function removeEntity(_0xed16e,_0xf7bc3a){return function(_0xcae58){if(_0xcae58){return _0xcae58[_0x369d('0x23')]()[_0x369d('0x24')](function(){var _0x36cf04=_0xcae58['get']({'plain':!![]});var _0x4dfe83=_0x369d('0x25');return db[_0x369d('0x26')][_0x369d('0x23')]({'where':{'type':_0x4dfe83,'resourceId':_0x36cf04['id']}})[_0x369d('0x24')](function(){return _0xcae58;});})[_0x369d('0x24')](function(){_0xed16e[_0x369d('0x18')](0xcc)[_0x369d('0x19')]();});}};}function handleEntityNotFound(_0x570db4,_0x23656b){return function(_0xe95742){if(!_0xe95742){_0x570db4[_0x369d('0x17')](0x194);}return _0xe95742;};}function handleError(_0xf952a3,_0x345be5){_0x345be5=_0x345be5||0x1f4;return function(_0x41367a){logger[_0x369d('0x27')](_0x41367a['stack']);if(_0x41367a[_0x369d('0x28')]){delete _0x41367a['name'];}_0xf952a3['status'](_0x345be5)[_0x369d('0x29')](_0x41367a);};}exports[_0x369d('0x2a')]=function(_0x5844c7,_0x104540){var _0x5a14ce={},_0x37274f={},_0x39d656={'count':0x0,'rows':[]};var _0xe45219=_[_0x369d('0x2b')](db[_0x369d('0x2c')][_0x369d('0x2d')],function(_0x119c00){return{'name':_0x119c00['fieldName'],'type':_0x119c00[_0x369d('0x2e')][_0x369d('0x2f')]};});_0x37274f[_0x369d('0x30')]=_[_0x369d('0x2b')](_0xe45219,_0x369d('0x28'));_0x37274f[_0x369d('0x31')]=_[_0x369d('0x32')](_0x5844c7[_0x369d('0x31')]);_0x37274f['filters']=_[_0x369d('0x33')](_0x37274f[_0x369d('0x30')],_0x37274f[_0x369d('0x31')]);_0x5a14ce[_0x369d('0x34')]=_[_0x369d('0x33')](_0x37274f['model'],qs[_0x369d('0x35')](_0x5844c7[_0x369d('0x31')][_0x369d('0x35')]));_0x5a14ce[_0x369d('0x34')]=_0x5a14ce[_0x369d('0x34')][_0x369d('0x36')]?_0x5a14ce['attributes']:_0x37274f[_0x369d('0x30')];if(!_0x5844c7[_0x369d('0x31')][_0x369d('0x37')](_0x369d('0x38'))){_0x5a14ce[_0x369d('0x39')]=qs[_0x369d('0x39')](_0x5844c7[_0x369d('0x31')][_0x369d('0x39')]);_0x5a14ce[_0x369d('0x1b')]=qs[_0x369d('0x1b')](_0x5844c7[_0x369d('0x31')][_0x369d('0x1b')]);}_0x5a14ce[_0x369d('0x3a')]=qs[_0x369d('0x3b')](_0x5844c7[_0x369d('0x31')][_0x369d('0x3b')]);_0x5a14ce[_0x369d('0x3c')]=qs[_0x369d('0x3d')](_[_0x369d('0x3e')](_0x5844c7[_0x369d('0x31')],_0x37274f[_0x369d('0x3d')]),_0xe45219);if(_0x5844c7[_0x369d('0x31')][_0x369d('0x3f')]){_0x5a14ce[_0x369d('0x3c')]=_['merge'](_0x5a14ce['where'],{'$or':_[_0x369d('0x2b')](_0xe45219,function(_0x319e5d){if(_0x319e5d[_0x369d('0x2e')]!==_0x369d('0x40')){var _0x3afa89={};_0x3afa89[_0x319e5d[_0x369d('0x28')]]={'$like':'%'+_0x5844c7[_0x369d('0x31')][_0x369d('0x3f')]+'%'};return _0x3afa89;}})});}_0x5a14ce=_[_0x369d('0x41')]({},_0x5a14ce,_0x5844c7['options']);var _0x322b13={'where':_0x5a14ce[_0x369d('0x3c')]};return db[_0x369d('0x2c')][_0x369d('0x1d')](_0x322b13)[_0x369d('0x24')](function(_0x25cf4e){_0x39d656[_0x369d('0x1d')]=_0x25cf4e;if(_0x5844c7[_0x369d('0x31')]['includeAll']){_0x5a14ce['include']=[{'all':!![]}];}return db[_0x369d('0x2c')][_0x369d('0x42')](_0x5a14ce);})[_0x369d('0x24')](function(_0x4dad71){_0x39d656['rows']=_0x4dad71;return _0x39d656;})['then'](respondWithFilteredResult(_0x104540,_0x5a14ce))[_0x369d('0x43')](handleError(_0x104540,null));};exports[_0x369d('0x44')]=function(_0x55dfde,_0xe7ba64){var _0x430040={'raw':!![],'where':{'id':_0x55dfde[_0x369d('0x45')]['id']}},_0x102a65={};_0x102a65['model']=_[_0x369d('0x32')](db['VoiceMail'][_0x369d('0x2d')]);_0x102a65['query']=_[_0x369d('0x32')](_0x55dfde[_0x369d('0x31')]);_0x102a65[_0x369d('0x3d')]=_['intersection'](_0x102a65['model'],_0x102a65[_0x369d('0x31')]);_0x430040[_0x369d('0x34')]=_[_0x369d('0x33')](_0x102a65['model'],qs[_0x369d('0x35')](_0x55dfde[_0x369d('0x31')][_0x369d('0x35')]));_0x430040[_0x369d('0x34')]=_0x430040[_0x369d('0x34')][_0x369d('0x36')]?_0x430040[_0x369d('0x34')]:_0x102a65[_0x369d('0x30')];if(_0x55dfde[_0x369d('0x31')]['includeAll']){_0x430040[_0x369d('0x46')]=[{'all':!![]}];}_0x430040=_[_0x369d('0x41')]({},_0x430040,_0x55dfde[_0x369d('0x47')]);return db[_0x369d('0x2c')][_0x369d('0x48')](_0x430040)[_0x369d('0x24')](handleEntityNotFound(_0xe7ba64,null))['then'](respondWithResult(_0xe7ba64,null))[_0x369d('0x43')](handleError(_0xe7ba64,null));};exports[_0x369d('0x49')]=function(_0x16dd8f,_0x44a357){return db[_0x369d('0x2c')][_0x369d('0x49')](_0x16dd8f[_0x369d('0x4a')],{})[_0x369d('0x24')](function(_0x3f8a54){var _0x3c15cb=_0x16dd8f[_0x369d('0x4b')][_0x369d('0x4c')]({'plain':!![]});if(!_0x3c15cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c15cb[_0x369d('0x4d')]===_0x369d('0x4b')){var _0x289eb8=_0x3f8a54[_0x369d('0x4c')]({'plain':!![]});var _0x648a0d='Voicemails';return db[_0x369d('0x4e')]['find']({'where':{'name':_0x648a0d,'userProfileId':_0x3c15cb[_0x369d('0x4f')]},'raw':!![]})[_0x369d('0x24')](function(_0x22b594){if(_0x22b594&&_0x22b594[_0x369d('0x50')]===0x0){return db[_0x369d('0x26')][_0x369d('0x49')]({'name':_0x289eb8[_0x369d('0x28')],'resourceId':_0x289eb8['id'],'type':_0x22b594[_0x369d('0x28')],'sectionId':_0x22b594['id']},{})[_0x369d('0x24')](function(){return _0x3f8a54;});}else{return _0x3f8a54;}})[_0x369d('0x43')](function(_0x4d582a){logger['error'](_0x369d('0x51'),_0x4d582a);throw _0x4d582a;});}return _0x3f8a54;})[_0x369d('0x24')](respondWithResult(_0x44a357,0xc9))[_0x369d('0x43')](handleError(_0x44a357,null));};exports[_0x369d('0x52')]=function(_0x347df4,_0x5cd43f){if(_0x347df4['body']['id']){delete _0x347df4[_0x369d('0x4a')]['id'];}return db[_0x369d('0x2c')]['find']({'where':{'id':_0x347df4[_0x369d('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cd43f,null))[_0x369d('0x24')](saveUpdates(_0x347df4[_0x369d('0x4a')],null))[_0x369d('0x24')](respondWithResult(_0x5cd43f,null))['catch'](handleError(_0x5cd43f,null));};exports[_0x369d('0x23')]=function(_0x145ba8,_0x45ac3c){return db[_0x369d('0x2c')]['find']({'where':{'id':_0x145ba8['params']['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x45ac3c,null))[_0x369d('0x24')](removeEntity(_0x45ac3c,null))[_0x369d('0x43')](handleError(_0x45ac3c,null));};exports['getMessages']=function(_0x43afd7,_0x2dbbee,_0x402aae){return db['VoiceMail']['findOne']({'where':{'id':_0x43afd7[_0x369d('0x45')]['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x2dbbee,null))[_0x369d('0x24')](function(_0x158ce7){var _0x5408b3;var _0x33bba6={},_0x1fa6bb={};_0x1fa6bb[_0x369d('0x30')]=_[_0x369d('0x32')](db[_0x369d('0x53')]['rawAttributes']);_0x1fa6bb[_0x369d('0x31')]=_[_0x369d('0x32')](_0x43afd7[_0x369d('0x31')]);_0x1fa6bb['filters']=_[_0x369d('0x33')](_0x1fa6bb['model'],_0x1fa6bb[_0x369d('0x31')]);_0x33bba6['attributes']=_['intersection'](_0x1fa6bb['model'],qs['fields'](_0x43afd7[_0x369d('0x31')]['fields']));_0x33bba6[_0x369d('0x34')]=_0x33bba6['attributes'][_0x369d('0x36')]?_0x33bba6[_0x369d('0x34')]:_0x1fa6bb[_0x369d('0x30')];if(!_0x43afd7['query'][_0x369d('0x37')](_0x369d('0x38'))){_0x33bba6[_0x369d('0x39')]=qs[_0x369d('0x39')](_0x43afd7[_0x369d('0x31')][_0x369d('0x39')]);_0x33bba6['offset']=qs[_0x369d('0x1b')](_0x43afd7['query']['offset']);}_0x33bba6['order']=qs[_0x369d('0x3b')](_0x43afd7[_0x369d('0x31')][_0x369d('0x3b')]);_0x33bba6[_0x369d('0x3c')]=qs[_0x369d('0x3d')](_[_0x369d('0x3e')](_0x43afd7[_0x369d('0x31')],_0x1fa6bb[_0x369d('0x3d')]));if(_0x43afd7[_0x369d('0x31')][_0x369d('0x3f')]){_0x33bba6[_0x369d('0x3c')]=_[_0x369d('0x41')](_0x33bba6[_0x369d('0x3c')],{'$or':_[_0x369d('0x2b')](_0x33bba6[_0x369d('0x34')],function(_0x46f58a){var _0x4fe1b6={};_0x4fe1b6[_0x46f58a]={'$like':'%'+_0x43afd7[_0x369d('0x31')]['filter']+'%'};return _0x4fe1b6;})});}_0x33bba6[_0x369d('0x3c')]=_[_0x369d('0x41')](_0x33bba6[_0x369d('0x3c')],{'mailboxuser':_0x158ce7[_0x369d('0x54')]});_0x33bba6=_[_0x369d('0x41')]({},_0x33bba6,_0x43afd7['options']);return db[_0x369d('0x53')]['findAndCountAll'](_0x33bba6)['then'](respondWithFilteredResult(_0x2dbbee,_0x33bba6));})[_0x369d('0x43')](handleError(_0x2dbbee,null));};
\ No newline at end of file
index 9088836..0242d38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef74=['voice_voicemail','mailbox_context','context','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','VoiceMail'];(function(_0x3c9e5d,_0x4e7042){var _0xf87253=function(_0x21982f){while(--_0x21982f){_0x3c9e5d['push'](_0x3c9e5d['shift']());}};_0xf87253(++_0x4e7042);}(_0xef74,0x153));var _0x4ef7=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xef74[_0x500419];return _0x241c1a;};'use strict';var _=require(_0x4ef7('0x0'));var util=require(_0x4ef7('0x1'));var logger=require(_0x4ef7('0x2'))(_0x4ef7('0x3'));var moment=require('moment');var BPromise=require(_0x4ef7('0x4'));var rp=require(_0x4ef7('0x5'));var fs=require('fs');var path=require(_0x4ef7('0x6'));var rimraf=require(_0x4ef7('0x7'));var config=require(_0x4ef7('0x8'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x3f50de,_0x4c3bc6){return _0x3f50de[_0x4ef7('0x9')](_0x4ef7('0xa'),attributes,{'tableName':_0x4ef7('0xb'),'paranoid':![],'indexes':[{'name':_0x4ef7('0xc'),'fields':['mailbox',_0x4ef7('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xbe57=['../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','../../config/logger','api','moment','path','rimraf'];(function(_0x552fcb,_0x533085){var _0x5d6231=function(_0x2de4fa){while(--_0x2de4fa){_0x552fcb['push'](_0x552fcb['shift']());}};_0x5d6231(++_0x533085);}(_0xbe57,0x166));var _0x7be5=function(_0x4db8be,_0x155ce5){_0x4db8be=_0x4db8be-0x0;var _0x4c90d8=_0xbe57[_0x4db8be];return _0x4c90d8;};'use strict';var _=require(_0x7be5('0x0'));var util=require('util');var logger=require(_0x7be5('0x1'))(_0x7be5('0x2'));var moment=require(_0x7be5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7be5('0x4'));var rimraf=require(_0x7be5('0x5'));var config=require(_0x7be5('0x6'));var attributes=require(_0x7be5('0x7'));module[_0x7be5('0x8')]=function(_0x24ce81,_0x516325){return _0x24ce81['define'](_0x7be5('0x9'),attributes,{'tableName':_0x7be5('0xa'),'paranoid':![],'indexes':[{'name':_0x7be5('0xb'),'fields':[_0x7be5('0xc'),_0x7be5('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 7804118..21a1d5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf177=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util'];(function(_0x49d931,_0x121258){var _0x491a2a=function(_0x338d50){while(--_0x338d50){_0x49d931['push'](_0x49d931['shift']());}};_0x491a2a(++_0x121258);}(_0xf177,0x140));var _0x7f17=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf177[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x7f17('0x0'));var util=require(_0x7f17('0x1'));var moment=require(_0x7f17('0x2'));var BPromise=require(_0x7f17('0x3'));var rs=require(_0x7f17('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7f17('0x5'));var logger=require(_0x7f17('0x6'))(_0x7f17('0x7'));var config=require('../../config/environment');var jayson=require(_0x7f17('0x8'));var client=jayson[_0x7f17('0x9')][_0x7f17('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c48d6,_0x41d0d2,_0x50db4a){return new BPromise(function(_0xe9ba4b,_0x2504a9){return client[_0x7f17('0xb')](_0x3c48d6,_0x50db4a)[_0x7f17('0xc')](function(_0x3387f8){logger[_0x7f17('0xd')](_0x7f17('0xe'),_0x41d0d2,_0x7f17('0xf'));logger[_0x7f17('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x41d0d2,_0x7f17('0xf'),JSON[_0x7f17('0x11')](_0x3387f8));if(_0x3387f8[_0x7f17('0x12')]){if(_0x3387f8[_0x7f17('0x12')][_0x7f17('0x13')]===0x1f4){logger[_0x7f17('0x12')](_0x7f17('0xe'),_0x41d0d2,_0x3387f8[_0x7f17('0x12')][_0x7f17('0x14')]);return _0x2504a9(_0x3387f8[_0x7f17('0x12')][_0x7f17('0x14')]);}logger[_0x7f17('0x12')]('VoiceMail,\x20%s,\x20%s',_0x41d0d2,_0x3387f8[_0x7f17('0x12')][_0x7f17('0x14')]);return _0xe9ba4b(_0x3387f8['error']['message']);}else{logger[_0x7f17('0xd')](_0x7f17('0xe'),_0x41d0d2,'request\x20sent');_0xe9ba4b(_0x3387f8[_0x7f17('0x15')][_0x7f17('0x14')]);}})[_0x7f17('0x16')](function(_0x5c4d38){logger[_0x7f17('0x12')](_0x7f17('0xe'),_0x41d0d2,_0x5c4d38);_0x2504a9(_0x5c4d38);});});}
\ No newline at end of file
+var _0x6ada=['rpc','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x1cd8cc,_0x1a2bfc){var _0x457cf4=function(_0x485410){while(--_0x485410){_0x1cd8cc['push'](_0x1cd8cc['shift']());}};_0x457cf4(++_0x1a2bfc);}(_0x6ada,0xf7));var _0xa6ad=function(_0x7bf9c2,_0xd621e3){_0x7bf9c2=_0x7bf9c2-0x0;var _0x5cf637=_0x6ada[_0x7bf9c2];return _0x5cf637;};'use strict';var _=require(_0xa6ad('0x0'));var util=require('util');var moment=require(_0xa6ad('0x1'));var BPromise=require(_0xa6ad('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6ad('0x3'))['db'];var utils=require(_0xa6ad('0x4'));var logger=require('../../config/logger')(_0xa6ad('0x5'));var config=require('../../config/environment');var jayson=require(_0xa6ad('0x6'));var client=jayson[_0xa6ad('0x7')][_0xa6ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ece82,_0x46632e,_0x464bd5){return new BPromise(function(_0x3e9773,_0x2a1843){return client[_0xa6ad('0x9')](_0x4ece82,_0x464bd5)['then'](function(_0x223c8c){logger[_0xa6ad('0xa')]('VoiceMail,\x20%s,\x20%s',_0x46632e,_0xa6ad('0xb'));logger[_0xa6ad('0xc')](_0xa6ad('0xd'),_0x46632e,_0xa6ad('0xb'),JSON[_0xa6ad('0xe')](_0x223c8c));if(_0x223c8c[_0xa6ad('0xf')]){if(_0x223c8c[_0xa6ad('0xf')][_0xa6ad('0x10')]===0x1f4){logger[_0xa6ad('0xf')](_0xa6ad('0x11'),_0x46632e,_0x223c8c[_0xa6ad('0xf')][_0xa6ad('0x12')]);return _0x2a1843(_0x223c8c[_0xa6ad('0xf')][_0xa6ad('0x12')]);}logger['error'](_0xa6ad('0x11'),_0x46632e,_0x223c8c[_0xa6ad('0xf')][_0xa6ad('0x12')]);return _0x3e9773(_0x223c8c['error'][_0xa6ad('0x12')]);}else{logger[_0xa6ad('0xa')]('VoiceMail,\x20%s,\x20%s',_0x46632e,'request\x20sent');_0x3e9773(_0x223c8c[_0xa6ad('0x13')]['message']);}})[_0xa6ad('0x14')](function(_0x1eb7d1){logger[_0xa6ad('0xf')](_0xa6ad('0x11'),_0x46632e,_0x1eb7d1);_0x2a1843(_0x1eb7d1);});});}
\ No newline at end of file
index 1a43af8..982e37f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82e2=['../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x47ecc4,_0x45a1c5){var _0x49a831=function(_0x5e46c){while(--_0x5e46c){_0x47ecc4['push'](_0x47ecc4['shift']());}};_0x49a831(++_0x45a1c5);}(_0x82e2,0x1f3));var _0x282e=function(_0x1b00d0,_0x265b67){_0x1b00d0=_0x1b00d0-0x0;var _0x31446c=_0x82e2[_0x1b00d0];return _0x31446c;};'use strict';var multer=require(_0x282e('0x0'));var util=require(_0x282e('0x1'));var path=require('path');var timeout=require(_0x282e('0x2'));var express=require(_0x282e('0x3'));var router=express['Router']();var fs_extra=require(_0x282e('0x4'));var auth=require(_0x282e('0x5'));var interaction=require(_0x282e('0x6'));var config=require(_0x282e('0x7'));var controller=require(_0x282e('0x8'));router[_0x282e('0x9')]('/',auth[_0x282e('0xa')](),controller[_0x282e('0xb')]);router[_0x282e('0x9')]('/:id',auth[_0x282e('0xa')](),controller[_0x282e('0xc')]);router[_0x282e('0x9')](_0x282e('0xd'),auth[_0x282e('0xa')](),controller[_0x282e('0xe')]);router[_0x282e('0xf')]('/',auth[_0x282e('0xa')](),controller[_0x282e('0x10')]);router[_0x282e('0x11')](_0x282e('0x12'),auth[_0x282e('0xa')](),controller[_0x282e('0x13')]);router[_0x282e('0x14')](_0x282e('0x12'),auth[_0x282e('0xa')](),controller['destroy']);module[_0x282e('0x15')]=router;
\ No newline at end of file
+var _0x7fe6=['put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','/:id/download','download','create'];(function(_0x389bd9,_0x7f1b0d){var _0x1d811e=function(_0x1bea09){while(--_0x1bea09){_0x389bd9['push'](_0x389bd9['shift']());}};_0x1d811e(++_0x7f1b0d);}(_0x7fe6,0x16e));var _0x67fe=function(_0x2632b7,_0x41bffc){_0x2632b7=_0x2632b7-0x0;var _0x553ed9=_0x7fe6[_0x2632b7];return _0x553ed9;};'use strict';var multer=require('multer');var util=require(_0x67fe('0x0'));var path=require(_0x67fe('0x1'));var timeout=require(_0x67fe('0x2'));var express=require(_0x67fe('0x3'));var router=express[_0x67fe('0x4')]();var fs_extra=require(_0x67fe('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x67fe('0x6'));var config=require(_0x67fe('0x7'));var controller=require(_0x67fe('0x8'));router[_0x67fe('0x9')]('/',auth[_0x67fe('0xa')](),controller['index']);router[_0x67fe('0x9')]('/:id',auth[_0x67fe('0xa')](),controller['show']);router['get'](_0x67fe('0xb'),auth[_0x67fe('0xa')](),controller[_0x67fe('0xc')]);router['post']('/',auth[_0x67fe('0xa')](),controller[_0x67fe('0xd')]);router[_0x67fe('0xe')](_0x67fe('0xf'),auth[_0x67fe('0xa')](),controller[_0x67fe('0x10')]);router[_0x67fe('0x11')](_0x67fe('0xf'),auth[_0x67fe('0xa')](),controller[_0x67fe('0x12')]);module[_0x67fe('0x13')]=router;
\ No newline at end of file
index 4d35cc5..2e7b2b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47ef=['sequelize','exports','getDataValue','STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x245599,_0xa48bbb){var _0x47b86e=function(_0xb7c7dd){while(--_0xb7c7dd){_0x245599['push'](_0x245599['shift']());}};_0x47b86e(++_0xa48bbb);}(_0x47ef,0xf8));var _0xf47e=function(_0x1f0b3f,_0xbd987){_0x1f0b3f=_0x1f0b3f-0x0;var _0x3b1705=_0x47ef[_0x1f0b3f];return _0x3b1705;};'use strict';var Sequelize=require(_0xf47e('0x0'));module[_0xf47e('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x25de15){return this[_0xf47e('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xf47e('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xf47e('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xf47e('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0xf47e('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xf47e('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xf47e('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0xf47e('0x4')](_0xf47e('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xf47e('0x3')],'defaultValue':''},'stamp':{'type':_0xf47e('0x6'),'defaultValue':Sequelize['literal'](_0xf47e('0x7'))}};
\ No newline at end of file
+var _0x646e=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','getDataValue','INTEGER','STRING'];(function(_0x5e6796,_0x16cf18){var _0x2e44e1=function(_0x420a91){while(--_0x420a91){_0x5e6796['push'](_0x5e6796['shift']());}};_0x2e44e1(++_0x16cf18);}(_0x646e,0xe3));var _0xe646=function(_0x487b1f,_0x2dac5a){_0x487b1f=_0x487b1f-0x0;var _0x3de30c=_0x646e[_0x487b1f];return _0x3de30c;};'use strict';var Sequelize=require(_0xe646('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x429c51){return this[_0xe646('0x1')]('id');}},'msgnum':{'type':Sequelize[_0xe646('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xe646('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xe646('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xe646('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xe646('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xe646('0x3')],'defaultValue':''},'stamp':{'type':_0xe646('0x4'),'defaultValue':Sequelize[_0xe646('0x5')](_0xe646('0x6'))}};
\ No newline at end of file
index 78d16d1..910673d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbba2=['fields','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','destroy','recording','msg_id','Sequelize','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','sendStatus','error','name','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','attributes'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xbba2,0x104));var _0x2bba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbba2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x2bba('0x0'));var rimraf=require(_0x2bba('0x1'));var zipdir=require(_0x2bba('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2bba('0x3'));var moment=require(_0x2bba('0x4'));var BPromise=require(_0x2bba('0x5'));var Mustache=require(_0x2bba('0x6'));var util=require(_0x2bba('0x7'));var path=require('path');var sox=require(_0x2bba('0x8'));var csv=require(_0x2bba('0x9'));var ejs=require(_0x2bba('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2bba('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2bba('0xc'));var deskjs=require(_0x2bba('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2bba('0xe'));var Papa=require(_0x2bba('0xf'));var Redis=require(_0x2bba('0x10'));var authService=require(_0x2bba('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2bba('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2bba('0x13'));var utils=require('../../config/utils');var config=require(_0x2bba('0x14'));var licenseUtil=require(_0x2bba('0x15'));var db=require(_0x2bba('0x16'))['db'];function respondWithStatusCode(_0x622028,_0x117d8d){_0x117d8d=_0x117d8d||0xcc;return function(_0x115dd1){if(_0x115dd1){return _0x622028['sendStatus'](_0x117d8d);}return _0x622028[_0x2bba('0x17')](_0x117d8d)[_0x2bba('0x18')]();};}function respondWithResult(_0x2dcf64,_0x26edbb){_0x26edbb=_0x26edbb||0xc8;return function(_0x50f7a4){if(_0x50f7a4){return _0x2dcf64[_0x2bba('0x17')](_0x26edbb)[_0x2bba('0x19')](_0x50f7a4);}};}function respondWithFilteredResult(_0x382c5e,_0x4bdf67){return function(_0x201ac3){if(_0x201ac3){var _0x561d50=typeof _0x4bdf67[_0x2bba('0x1a')]===_0x2bba('0x1b')&&typeof _0x4bdf67[_0x2bba('0x1c')]===_0x2bba('0x1b');var _0x4f1cb2=_0x201ac3[_0x2bba('0x1d')];var _0x584153=_0x561d50?0x0:_0x4bdf67[_0x2bba('0x1a')];var _0x37d519=_0x561d50?_0x201ac3[_0x2bba('0x1d')]:_0x4bdf67[_0x2bba('0x1a')]+_0x4bdf67[_0x2bba('0x1c')];var _0x4be2cb;if(_0x37d519>=_0x4f1cb2){_0x37d519=_0x4f1cb2;_0x4be2cb=0xc8;}else{_0x4be2cb=0xce;}_0x382c5e['status'](_0x4be2cb);return _0x382c5e[_0x2bba('0x1e')](_0x2bba('0x1f'),_0x584153+'-'+_0x37d519+'/'+_0x4f1cb2)[_0x2bba('0x19')](_0x201ac3);}return null;};}function patchUpdates(_0x2de9e5){return function(_0x25d0da){try{jsonpatch['apply'](_0x25d0da,_0x2de9e5,!![]);}catch(_0x2974da){return BPromise['reject'](_0x2974da);}return _0x25d0da[_0x2bba('0x20')]();};}function saveUpdates(_0x3728d7,_0x8e0386){return function(_0x2eb097){if(_0x2eb097){return _0x2eb097[_0x2bba('0x21')](_0x3728d7)['then'](function(_0x54c708){return _0x54c708;});}return null;};}function removeEntity(_0x3fccad,_0x21e787){return function(_0x45f45b){if(_0x45f45b){return _0x45f45b['destroy']()[_0x2bba('0x22')](function(){_0x3fccad[_0x2bba('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49b91e,_0x8836ac){return function(_0x4c2247){if(!_0x4c2247){_0x49b91e[_0x2bba('0x23')](0x194);}return _0x4c2247;};}function handleError(_0x1f8a2b,_0x4855a4){_0x4855a4=_0x4855a4||0x1f4;return function(_0x15751c){logger[_0x2bba('0x24')](_0x15751c['stack']);if(_0x15751c[_0x2bba('0x25')]){delete _0x15751c[_0x2bba('0x25')];}_0x1f8a2b['status'](_0x4855a4)['send'](_0x15751c);};}exports[_0x2bba('0x26')]=function(_0x198b03,_0x2b158c){var _0x426c94={},_0x473d0b={},_0xfe5192={'count':0x0,'rows':[]};var _0x1aa834=_[_0x2bba('0x27')](db[_0x2bba('0x28')][_0x2bba('0x29')],function(_0xe6567){return{'name':_0xe6567[_0x2bba('0x2a')],'type':_0xe6567[_0x2bba('0x2b')][_0x2bba('0x2c')]};});_0x473d0b[_0x2bba('0x2d')]=_[_0x2bba('0x2e')](_['map'](_0x1aa834,_0x2bba('0x25')),[_0x2bba('0x25')]);_0x473d0b['query']=_[_0x2bba('0x2f')](_0x198b03[_0x2bba('0x30')]);_0x473d0b[_0x2bba('0x31')]=_[_0x2bba('0x32')](_0x473d0b[_0x2bba('0x2d')],_0x473d0b[_0x2bba('0x30')]);_0x426c94[_0x2bba('0x33')]=_['intersection'](_0x473d0b[_0x2bba('0x2d')],qs[_0x2bba('0x34')](_0x198b03[_0x2bba('0x30')][_0x2bba('0x34')]));_0x426c94[_0x2bba('0x33')]=_0x426c94['attributes']['length']?_0x426c94['attributes']:_0x473d0b[_0x2bba('0x2d')];if(!_0x198b03[_0x2bba('0x30')][_0x2bba('0x35')]('nolimit')){_0x426c94[_0x2bba('0x1c')]=qs[_0x2bba('0x1c')](_0x198b03[_0x2bba('0x30')][_0x2bba('0x1c')]);_0x426c94[_0x2bba('0x1a')]=qs['offset'](_0x198b03['query'][_0x2bba('0x1a')]);}_0x426c94[_0x2bba('0x36')]=qs[_0x2bba('0x37')](_0x198b03[_0x2bba('0x30')][_0x2bba('0x37')]);_0x426c94[_0x2bba('0x38')]=qs[_0x2bba('0x31')](_['pick'](_0x198b03[_0x2bba('0x30')],_0x473d0b[_0x2bba('0x31')]),_0x1aa834);if(_0x198b03[_0x2bba('0x30')][_0x2bba('0x39')]){_0x426c94[_0x2bba('0x38')]=_[_0x2bba('0x3a')](_0x426c94['where'],{'$or':_[_0x2bba('0x27')](_0x1aa834,function(_0x4fa3ec){if(_0x4fa3ec[_0x2bba('0x2b')]!=='VIRTUAL'){var _0x31855c={};_0x31855c[_0x4fa3ec[_0x2bba('0x25')]]={'$like':'%'+_0x198b03[_0x2bba('0x30')][_0x2bba('0x39')]+'%'};return _0x31855c;}})});}_0x426c94=_[_0x2bba('0x3a')]({},_0x426c94,_0x198b03[_0x2bba('0x3b')]);var _0xcb2b49={'where':_0x426c94[_0x2bba('0x38')]};return db[_0x2bba('0x28')][_0x2bba('0x1d')](_0xcb2b49)[_0x2bba('0x22')](function(_0x22f0c9){_0xfe5192[_0x2bba('0x1d')]=_0x22f0c9;if(_0x198b03[_0x2bba('0x30')][_0x2bba('0x3c')]){_0x426c94[_0x2bba('0x3d')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x2bba('0x3e')](_0x426c94);})[_0x2bba('0x22')](function(_0x44fedd){_0xfe5192[_0x2bba('0x3f')]=_0x44fedd;return _0xfe5192;})[_0x2bba('0x22')](respondWithFilteredResult(_0x2b158c,_0x426c94))[_0x2bba('0x40')](handleError(_0x2b158c,null));};exports[_0x2bba('0x41')]=function(_0x2a1111,_0x480a02){var _0x5739ab={'raw':!![],'where':{'id':_0x2a1111[_0x2bba('0x42')]['id']}},_0x21224c={};_0x21224c['model']=_[_0x2bba('0x2f')](db[_0x2bba('0x28')][_0x2bba('0x29')]);_0x21224c[_0x2bba('0x30')]=_[_0x2bba('0x2f')](_0x2a1111[_0x2bba('0x30')]);_0x21224c[_0x2bba('0x31')]=_[_0x2bba('0x32')](_0x21224c[_0x2bba('0x2d')],_0x21224c[_0x2bba('0x30')]);_0x5739ab['attributes']=_[_0x2bba('0x32')](_0x21224c[_0x2bba('0x2d')],qs[_0x2bba('0x34')](_0x2a1111['query'][_0x2bba('0x34')]));_0x5739ab[_0x2bba('0x33')]=_0x5739ab['attributes'][_0x2bba('0x43')]?_0x5739ab[_0x2bba('0x33')]:_0x21224c['model'];if(_0x2a1111[_0x2bba('0x30')][_0x2bba('0x3c')]){_0x5739ab[_0x2bba('0x3d')]=[{'all':!![]}];}_0x5739ab=_['merge']({},_0x5739ab,_0x2a1111['options']);return db[_0x2bba('0x28')]['find'](_0x5739ab)[_0x2bba('0x22')](handleEntityNotFound(_0x480a02,null))[_0x2bba('0x22')](respondWithResult(_0x480a02,null))['catch'](handleError(_0x480a02,null));};exports[_0x2bba('0x44')]=function(_0x7451b1,_0x3d412d){return db[_0x2bba('0x28')][_0x2bba('0x44')](_0x7451b1[_0x2bba('0x45')],{})[_0x2bba('0x22')](respondWithResult(_0x3d412d,0xc9))[_0x2bba('0x40')](handleError(_0x3d412d,null));};exports[_0x2bba('0x21')]=function(_0x3fa575,_0x342247){if(_0x3fa575[_0x2bba('0x45')]['id']){delete _0x3fa575[_0x2bba('0x45')]['id'];}return db[_0x2bba('0x28')][_0x2bba('0x46')]({'where':{'id':_0x3fa575[_0x2bba('0x42')]['id']}})[_0x2bba('0x22')](handleEntityNotFound(_0x342247,null))[_0x2bba('0x22')](saveUpdates(_0x3fa575['body'],null))[_0x2bba('0x22')](respondWithResult(_0x342247,null))[_0x2bba('0x40')](handleError(_0x342247,null));};exports[_0x2bba('0x47')]=function(_0x4059b9,_0x26ae14){return db[_0x2bba('0x28')][_0x2bba('0x46')]({'where':{'id':_0x4059b9[_0x2bba('0x42')]['id']}})[_0x2bba('0x22')](handleEntityNotFound(_0x26ae14,null))['then'](removeEntity(_0x26ae14,null))[_0x2bba('0x40')](handleError(_0x26ae14,null));};exports['download']=function(_0x43bd1e,_0xe91543,_0x2a2259){return db[_0x2bba('0x28')][_0x2bba('0x46')]({'where':{'id':_0x43bd1e[_0x2bba('0x42')]['id']},'attributes':['id',_0x2bba('0x48'),_0x2bba('0x49')]})[_0x2bba('0x22')](handleEntityNotFound(_0xe91543,null))[_0x2bba('0x22')](function(_0x1bef6f){if(_0x1bef6f){if(!_0x1bef6f[_0x2bba('0x48')]){throw new db[(_0x2bba('0x4a'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x3cabf0={'Content-Type':'audio/wav','Content-Disposition':'attachment'};if(_0x1bef6f[_0x2bba('0x49')]){_0x3cabf0[_0x2bba('0x4b')]=_0x2bba('0x4c')+_0x1bef6f[_0x2bba('0x49')]+_0x2bba('0x4d');}_0xe91543[_0x2bba('0x1e')](_0x3cabf0);return _0xe91543['send'](new Buffer(_0x1bef6f['recording']));}})[_0x2bba('0x40')](handleError(_0xe91543,null));};
\ No newline at end of file
+var _0x530f=['send','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','index','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','include','find','catch','create','body','update','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22'];(function(_0xa918fa,_0x23b0dd){var _0x642ab2=function(_0xd27049){while(--_0xd27049){_0xa918fa['push'](_0xa918fa['shift']());}};_0x642ab2(++_0x23b0dd);}(_0x530f,0x10c));var _0xf530=function(_0x2c21fa,_0x5f0a10){_0x2c21fa=_0x2c21fa-0x0;var _0x5aafc6=_0x530f[_0x2c21fa];return _0x5aafc6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf530('0x0'));var zipdir=require(_0xf530('0x1'));var jsonpatch=require(_0xf530('0x2'));var rp=require(_0xf530('0x3'));var moment=require(_0xf530('0x4'));var BPromise=require(_0xf530('0x5'));var Mustache=require('mustache');var util=require(_0xf530('0x6'));var path=require('path');var sox=require(_0xf530('0x7'));var csv=require(_0xf530('0x8'));var ejs=require(_0xf530('0x9'));var fs=require('fs');var fs_extra=require(_0xf530('0xa'));var _=require(_0xf530('0xb'));var squel=require(_0xf530('0xc'));var crypto=require(_0xf530('0xd'));var jsforce=require(_0xf530('0xe'));var deskjs=require(_0xf530('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf530('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf530('0x11'));var qs=require(_0xf530('0x12'));var as=require(_0xf530('0x13'));var hardwareService=require(_0xf530('0x14'));var logger=require(_0xf530('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf530('0x16'));var licenseUtil=require(_0xf530('0x17'));var db=require(_0xf530('0x18'))['db'];function respondWithStatusCode(_0x386bda,_0x5abb78){_0x5abb78=_0x5abb78||0xcc;return function(_0x126c28){if(_0x126c28){return _0x386bda[_0xf530('0x19')](_0x5abb78);}return _0x386bda['status'](_0x5abb78)[_0xf530('0x1a')]();};}function respondWithResult(_0xd91e6b,_0x3363d2){_0x3363d2=_0x3363d2||0xc8;return function(_0x53dad2){if(_0x53dad2){return _0xd91e6b[_0xf530('0x1b')](_0x3363d2)[_0xf530('0x1c')](_0x53dad2);}};}function respondWithFilteredResult(_0x58ae24,_0xabb1be){return function(_0x52c1a4){if(_0x52c1a4){var _0x439dde=typeof _0xabb1be[_0xf530('0x1d')]===_0xf530('0x1e')&&typeof _0xabb1be['limit']===_0xf530('0x1e');var _0x230242=_0x52c1a4['count'];var _0x2b03aa=_0x439dde?0x0:_0xabb1be[_0xf530('0x1d')];var _0x156f54=_0x439dde?_0x52c1a4[_0xf530('0x1f')]:_0xabb1be[_0xf530('0x1d')]+_0xabb1be[_0xf530('0x20')];var _0xcdb883;if(_0x156f54>=_0x230242){_0x156f54=_0x230242;_0xcdb883=0xc8;}else{_0xcdb883=0xce;}_0x58ae24[_0xf530('0x1b')](_0xcdb883);return _0x58ae24[_0xf530('0x21')](_0xf530('0x22'),_0x2b03aa+'-'+_0x156f54+'/'+_0x230242)['json'](_0x52c1a4);}return null;};}function patchUpdates(_0xec89e6){return function(_0x3da70d){try{jsonpatch[_0xf530('0x23')](_0x3da70d,_0xec89e6,!![]);}catch(_0x452db1){return BPromise[_0xf530('0x24')](_0x452db1);}return _0x3da70d[_0xf530('0x25')]();};}function saveUpdates(_0x5145d8,_0xe10839){return function(_0x14acc6){if(_0x14acc6){return _0x14acc6['update'](_0x5145d8)[_0xf530('0x26')](function(_0x22afbe){return _0x22afbe;});}return null;};}function removeEntity(_0x29b4b0,_0x242de4){return function(_0x2dcc2d){if(_0x2dcc2d){return _0x2dcc2d[_0xf530('0x27')]()[_0xf530('0x26')](function(){_0x29b4b0[_0xf530('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23233c,_0x389d7f){return function(_0x3af938){if(!_0x3af938){_0x23233c['sendStatus'](0x194);}return _0x3af938;};}function handleError(_0x548dbf,_0x1fb658){_0x1fb658=_0x1fb658||0x1f4;return function(_0x4b917a){logger['error'](_0x4b917a[_0xf530('0x28')]);if(_0x4b917a[_0xf530('0x29')]){delete _0x4b917a[_0xf530('0x29')];}_0x548dbf['status'](_0x1fb658)['send'](_0x4b917a);};}exports[_0xf530('0x2a')]=function(_0x3e5af7,_0x592abf){var _0x2aef99={},_0x2d3591={},_0x24d596={'count':0x0,'rows':[]};var _0x2d65cd=_[_0xf530('0x2b')](db[_0xf530('0x2c')][_0xf530('0x2d')],function(_0xc198a3){return{'name':_0xc198a3['fieldName'],'type':_0xc198a3[_0xf530('0x2e')][_0xf530('0x2f')]};});_0x2d3591[_0xf530('0x30')]=_[_0xf530('0x31')](_[_0xf530('0x2b')](_0x2d65cd,_0xf530('0x29')),[_0xf530('0x29')]);_0x2d3591['query']=_[_0xf530('0x32')](_0x3e5af7[_0xf530('0x33')]);_0x2d3591[_0xf530('0x34')]=_[_0xf530('0x35')](_0x2d3591['model'],_0x2d3591[_0xf530('0x33')]);_0x2aef99[_0xf530('0x36')]=_['intersection'](_0x2d3591['model'],qs[_0xf530('0x37')](_0x3e5af7[_0xf530('0x33')][_0xf530('0x37')]));_0x2aef99[_0xf530('0x36')]=_0x2aef99['attributes'][_0xf530('0x38')]?_0x2aef99[_0xf530('0x36')]:_0x2d3591[_0xf530('0x30')];if(!_0x3e5af7[_0xf530('0x33')][_0xf530('0x39')](_0xf530('0x3a'))){_0x2aef99['limit']=qs[_0xf530('0x20')](_0x3e5af7[_0xf530('0x33')]['limit']);_0x2aef99['offset']=qs[_0xf530('0x1d')](_0x3e5af7['query'][_0xf530('0x1d')]);}_0x2aef99[_0xf530('0x3b')]=qs[_0xf530('0x3c')](_0x3e5af7[_0xf530('0x33')][_0xf530('0x3c')]);_0x2aef99[_0xf530('0x3d')]=qs['filters'](_[_0xf530('0x3e')](_0x3e5af7[_0xf530('0x33')],_0x2d3591[_0xf530('0x34')]),_0x2d65cd);if(_0x3e5af7[_0xf530('0x33')]['filter']){_0x2aef99[_0xf530('0x3d')]=_['merge'](_0x2aef99[_0xf530('0x3d')],{'$or':_[_0xf530('0x2b')](_0x2d65cd,function(_0xb5061a){if(_0xb5061a['type']!==_0xf530('0x3f')){var _0x14c264={};_0x14c264[_0xb5061a[_0xf530('0x29')]]={'$like':'%'+_0x3e5af7[_0xf530('0x33')][_0xf530('0x40')]+'%'};return _0x14c264;}})});}_0x2aef99=_[_0xf530('0x41')]({},_0x2aef99,_0x3e5af7[_0xf530('0x42')]);var _0x430410={'where':_0x2aef99[_0xf530('0x3d')]};return db[_0xf530('0x2c')][_0xf530('0x1f')](_0x430410)[_0xf530('0x26')](function(_0x26bc15){_0x24d596[_0xf530('0x1f')]=_0x26bc15;if(_0x3e5af7[_0xf530('0x33')][_0xf530('0x43')]){_0x2aef99['include']=[{'all':!![]}];}return db[_0xf530('0x2c')][_0xf530('0x44')](_0x2aef99);})[_0xf530('0x26')](function(_0x47865b){_0x24d596[_0xf530('0x45')]=_0x47865b;return _0x24d596;})[_0xf530('0x26')](respondWithFilteredResult(_0x592abf,_0x2aef99))['catch'](handleError(_0x592abf,null));};exports[_0xf530('0x46')]=function(_0x149b6f,_0x456b25){var _0x3c6a66={'raw':!![],'where':{'id':_0x149b6f[_0xf530('0x47')]['id']}},_0x57bd9b={};_0x57bd9b['model']=_['keys'](db[_0xf530('0x2c')][_0xf530('0x2d')]);_0x57bd9b[_0xf530('0x33')]=_['keys'](_0x149b6f[_0xf530('0x33')]);_0x57bd9b['filters']=_[_0xf530('0x35')](_0x57bd9b[_0xf530('0x30')],_0x57bd9b[_0xf530('0x33')]);_0x3c6a66[_0xf530('0x36')]=_['intersection'](_0x57bd9b[_0xf530('0x30')],qs[_0xf530('0x37')](_0x149b6f[_0xf530('0x33')][_0xf530('0x37')]));_0x3c6a66['attributes']=_0x3c6a66[_0xf530('0x36')]['length']?_0x3c6a66[_0xf530('0x36')]:_0x57bd9b[_0xf530('0x30')];if(_0x149b6f[_0xf530('0x33')][_0xf530('0x43')]){_0x3c6a66[_0xf530('0x48')]=[{'all':!![]}];}_0x3c6a66=_[_0xf530('0x41')]({},_0x3c6a66,_0x149b6f['options']);return db[_0xf530('0x2c')][_0xf530('0x49')](_0x3c6a66)[_0xf530('0x26')](handleEntityNotFound(_0x456b25,null))[_0xf530('0x26')](respondWithResult(_0x456b25,null))[_0xf530('0x4a')](handleError(_0x456b25,null));};exports['create']=function(_0x1c6ab9,_0x151c53){return db[_0xf530('0x2c')][_0xf530('0x4b')](_0x1c6ab9[_0xf530('0x4c')],{})[_0xf530('0x26')](respondWithResult(_0x151c53,0xc9))['catch'](handleError(_0x151c53,null));};exports[_0xf530('0x4d')]=function(_0x44f53a,_0x4533cc){if(_0x44f53a['body']['id']){delete _0x44f53a[_0xf530('0x4c')]['id'];}return db[_0xf530('0x2c')]['find']({'where':{'id':_0x44f53a[_0xf530('0x47')]['id']}})[_0xf530('0x26')](handleEntityNotFound(_0x4533cc,null))[_0xf530('0x26')](saveUpdates(_0x44f53a[_0xf530('0x4c')],null))[_0xf530('0x26')](respondWithResult(_0x4533cc,null))[_0xf530('0x4a')](handleError(_0x4533cc,null));};exports[_0xf530('0x27')]=function(_0x39e229,_0x1dc7cc){return db['VoiceMailMessage'][_0xf530('0x49')]({'where':{'id':_0x39e229[_0xf530('0x47')]['id']}})[_0xf530('0x26')](handleEntityNotFound(_0x1dc7cc,null))['then'](removeEntity(_0x1dc7cc,null))[_0xf530('0x4a')](handleError(_0x1dc7cc,null));};exports[_0xf530('0x4e')]=function(_0x5e78c8,_0x439624,_0x27f21b){return db[_0xf530('0x2c')][_0xf530('0x49')]({'where':{'id':_0x5e78c8[_0xf530('0x47')]['id']},'attributes':['id',_0xf530('0x4f'),'msg_id']})['then'](handleEntityNotFound(_0x439624,null))[_0xf530('0x26')](function(_0x2234f8){if(_0x2234f8){if(!_0x2234f8[_0xf530('0x4f')]){throw new db[(_0xf530('0x50'))][(_0xf530('0x51'))](_0xf530('0x52'));}var _0x285315={'Content-Type':'audio/wav','Content-Disposition':_0xf530('0x53')};if(_0x2234f8[_0xf530('0x54')]){_0x285315[_0xf530('0x55')]=_0xf530('0x56')+_0x2234f8[_0xf530('0x54')]+_0xf530('0x57');}_0x439624[_0xf530('0x21')](_0x285315);return _0x439624[_0xf530('0x58')](new Buffer(_0x2234f8[_0xf530('0x4f')]));}})[_0xf530('0x4a')](handleError(_0x439624,null));};
\ No newline at end of file
index 5029082..936c3c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x983b=['util','../../config/logger','moment','bluebird','path','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash'];(function(_0xd21803,_0x4365f6){var _0x525ddc=function(_0x2d9760){while(--_0x2d9760){_0xd21803['push'](_0xd21803['shift']());}};_0x525ddc(++_0x4365f6);}(_0x983b,0xcf));var _0xb983=function(_0x45dbfa,_0x334f29){_0x45dbfa=_0x45dbfa-0x0;var _0x2da804=_0x983b[_0x45dbfa];return _0x2da804;};'use strict';var _=require(_0xb983('0x0'));var util=require(_0xb983('0x1'));var logger=require(_0xb983('0x2'))('api');var moment=require(_0xb983('0x3'));var BPromise=require(_0xb983('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb983('0x5'));var rimraf=require(_0xb983('0x6'));var config=require('../../config/environment');var attributes=require(_0xb983('0x7'));module[_0xb983('0x8')]=function(_0x48db51,_0xaffd15){return _0x48db51[_0xb983('0x9')](_0xb983('0xa'),attributes,{'tableName':_0xb983('0xb'),'paranoid':![],'indexes':[{'name':_0xb983('0xc'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
+var _0xd167=['dir','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x491cbe,_0x45c8ba){var _0x59449d=function(_0x21b463){while(--_0x21b463){_0x491cbe['push'](_0x491cbe['shift']());}};_0x59449d(++_0x45c8ba);}(_0xd167,0xf1));var _0x7d16=function(_0x32e12f,_0x440873){_0x32e12f=_0x32e12f-0x0;var _0x3ee254=_0xd167[_0x32e12f];return _0x3ee254;};'use strict';var _=require(_0x7d16('0x0'));var util=require(_0x7d16('0x1'));var logger=require('../../config/logger')(_0x7d16('0x2'));var moment=require(_0x7d16('0x3'));var BPromise=require(_0x7d16('0x4'));var rp=require(_0x7d16('0x5'));var fs=require('fs');var path=require(_0x7d16('0x6'));var rimraf=require(_0x7d16('0x7'));var config=require(_0x7d16('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x7d16('0x9')]=function(_0x382fb2,_0x24683c){return _0x382fb2[_0x7d16('0xa')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x7d16('0xb'),'fields':['dir']}],'timestamps':![]});};
\ No newline at end of file
index 811848e..654e62b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1990=['jayson/promise','http','request','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1990,0x7d));var _0x0199=function(_0x37c286,_0x34ba4e){_0x37c286=_0x37c286-0x0;var _0x1869e4=_0x1990[_0x37c286];return _0x1869e4;};'use strict';var _=require(_0x0199('0x0'));var util=require(_0x0199('0x1'));var moment=require('moment');var BPromise=require(_0x0199('0x2'));var rs=require(_0x0199('0x3'));var fs=require('fs');var Redis=require(_0x0199('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0199('0x5'))(_0x0199('0x6'));var config=require(_0x0199('0x7'));var jayson=require(_0x0199('0x8'));var client=jayson['client'][_0x0199('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f41c2,_0x3334a3,_0x1796aa){return new BPromise(function(_0x4a419d,_0x404cf6){return client[_0x0199('0xa')](_0x5f41c2,_0x1796aa)['then'](function(_0x3704a0){logger['info'](_0x0199('0xb'),_0x3334a3,_0x0199('0xc'));logger['debug'](_0x0199('0xd'),_0x3334a3,'request\x20sent',JSON[_0x0199('0xe')](_0x3704a0));if(_0x3704a0['error']){if(_0x3704a0[_0x0199('0xf')][_0x0199('0x10')]===0x1f4){logger['error'](_0x0199('0xb'),_0x3334a3,_0x3704a0[_0x0199('0xf')][_0x0199('0x11')]);return _0x404cf6(_0x3704a0[_0x0199('0xf')][_0x0199('0x11')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x3334a3,_0x3704a0[_0x0199('0xf')][_0x0199('0x11')]);return _0x4a419d(_0x3704a0[_0x0199('0xf')]['message']);}else{logger['info'](_0x0199('0xb'),_0x3334a3,_0x0199('0xc'));_0x4a419d(_0x3704a0[_0x0199('0x12')][_0x0199('0x11')]);}})['catch'](function(_0x3bdbc0){logger[_0x0199('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x3334a3,_0x3bdbc0);_0x404cf6(_0x3bdbc0);});});}
\ No newline at end of file
+var _0x640b=['request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x1436e9,_0x23eb4d){var _0x1b5b9a=function(_0x4bc5d6){while(--_0x4bc5d6){_0x1436e9['push'](_0x1436e9['shift']());}};_0x1b5b9a(++_0x23eb4d);}(_0x640b,0x1ab));var _0xb640=function(_0x54e573,_0x129035){_0x54e573=_0x54e573-0x0;var _0x14d781=_0x640b[_0x54e573];return _0x14d781;};'use strict';var _=require(_0xb640('0x0'));var util=require(_0xb640('0x1'));var moment=require(_0xb640('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb640('0x3'));var db=require(_0xb640('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb640('0x5'))(_0xb640('0x6'));var config=require(_0xb640('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb640('0x8')][_0xb640('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c459d,_0x535c8a,_0x588a02){return new BPromise(function(_0x2dedbc,_0x36c93f){return client[_0xb640('0xa')](_0x4c459d,_0x588a02)[_0xb640('0xb')](function(_0x19a408){logger[_0xb640('0xc')](_0xb640('0xd'),_0x535c8a,_0xb640('0xe'));logger['debug'](_0xb640('0xf'),_0x535c8a,_0xb640('0xe'),JSON[_0xb640('0x10')](_0x19a408));if(_0x19a408[_0xb640('0x11')]){if(_0x19a408['error'][_0xb640('0x12')]===0x1f4){logger['error'](_0xb640('0xd'),_0x535c8a,_0x19a408[_0xb640('0x11')][_0xb640('0x13')]);return _0x36c93f(_0x19a408[_0xb640('0x11')][_0xb640('0x13')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x535c8a,_0x19a408[_0xb640('0x11')]['message']);return _0x2dedbc(_0x19a408[_0xb640('0x11')]['message']);}else{logger[_0xb640('0xc')](_0xb640('0xd'),_0x535c8a,_0xb640('0xe'));_0x2dedbc(_0x19a408['result'][_0xb640('0x13')]);}})[_0xb640('0x14')](function(_0x471a9f){logger[_0xb640('0x11')](_0xb640('0xd'),_0x535c8a,_0x471a9f);_0x36c93f(_0x471a9f);});});}
\ No newline at end of file
index 8e1ded4..e248fde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa579=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/sounds','getSounds','update','delete','destroy','/:id/sounds/:id2','exports','multer','util','path','express','fs-extra'];(function(_0x4359ac,_0x34d8b5){var _0x2efbdb=function(_0x581a4a){while(--_0x581a4a){_0x4359ac['push'](_0x4359ac['shift']());}};_0x2efbdb(++_0x34d8b5);}(_0xa579,0x1c3));var _0x9a57=function(_0x1e44ff,_0x4ebe40){_0x1e44ff=_0x1e44ff-0x0;var _0x4a575f=_0xa579[_0x1e44ff];return _0x4a575f;};'use strict';var multer=require(_0x9a57('0x0'));var util=require(_0x9a57('0x1'));var path=require(_0x9a57('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a57('0x3'));var router=express['Router']();var fs_extra=require(_0x9a57('0x4'));var auth=require(_0x9a57('0x5'));var interaction=require(_0x9a57('0x6'));var config=require(_0x9a57('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0x9a57('0x8')]('/',auth[_0x9a57('0x9')](),controller[_0x9a57('0xa')]);router[_0x9a57('0x8')](_0x9a57('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9a57('0x8')](_0x9a57('0xc'),auth[_0x9a57('0x9')](),controller[_0x9a57('0xd')]);router['post']('/',auth[_0x9a57('0x9')](),controller['create']);router['post'](_0x9a57('0xc'),auth[_0x9a57('0x9')](),controller['addSound']);router['put'](_0x9a57('0xb'),auth[_0x9a57('0x9')](),controller[_0x9a57('0xe')]);router[_0x9a57('0xf')](_0x9a57('0xb'),auth['isAuthenticated'](),controller[_0x9a57('0x10')]);router['delete'](_0x9a57('0x11'),auth[_0x9a57('0x9')](),controller['removeSound']);module[_0x9a57('0x12')]=router;
\ No newline at end of file
+var _0x6440=['post','create','put','delete','/:id/sounds/:id2','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','/:id/sounds','getSounds'];(function(_0x26373a,_0xe554fe){var _0x4c1021=function(_0x2a8ee8){while(--_0x2a8ee8){_0x26373a['push'](_0x26373a['shift']());}};_0x4c1021(++_0xe554fe);}(_0x6440,0x195));var _0x0644=function(_0x2f227c,_0x360c3a){_0x2f227c=_0x2f227c-0x0;var _0x5032bc=_0x6440[_0x2f227c];return _0x5032bc;};'use strict';var multer=require(_0x0644('0x0'));var util=require('util');var path=require(_0x0644('0x1'));var timeout=require(_0x0644('0x2'));var express=require(_0x0644('0x3'));var router=express['Router']();var fs_extra=require(_0x0644('0x4'));var auth=require(_0x0644('0x5'));var interaction=require(_0x0644('0x6'));var config=require(_0x0644('0x7'));var controller=require(_0x0644('0x8'));router[_0x0644('0x9')]('/',auth['isAuthenticated'](),controller[_0x0644('0xa')]);router[_0x0644('0x9')](_0x0644('0xb'),auth[_0x0644('0xc')](),controller['show']);router[_0x0644('0x9')](_0x0644('0xd'),auth[_0x0644('0xc')](),controller[_0x0644('0xe')]);router[_0x0644('0xf')]('/',auth[_0x0644('0xc')](),controller[_0x0644('0x10')]);router[_0x0644('0xf')](_0x0644('0xd'),auth['isAuthenticated'](),controller['addSound']);router[_0x0644('0x11')](_0x0644('0xb'),auth[_0x0644('0xc')](),controller['update']);router[_0x0644('0x12')](_0x0644('0xb'),auth[_0x0644('0xc')](),controller['destroy']);router['delete'](_0x0644('0x13'),auth[_0x0644('0xc')](),controller['removeSound']);module['exports']=router;
\ No newline at end of file
index bddd613..68215be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x843e=['STRING','name','mp3nb','quietmp3nb','mp3','files','alpha','sequelize'];(function(_0x175c16,_0x382e78){var _0x30cc6a=function(_0xc6d340){while(--_0xc6d340){_0x175c16['push'](_0x175c16['shift']());}};_0x30cc6a(++_0x382e78);}(_0x843e,0x1af));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe843('0x0'));module['exports']={'name':{'type':Sequelize[_0xe843('0x1')],'allowNull':![],'unique':_0xe843('0x2')},'mode':{'type':Sequelize['ENUM']('custom','files',_0xe843('0x3'),_0xe843('0x4'),'quietmp3',_0xe843('0x5')),'allowNull':!![],'defaultValue':_0xe843('0x6')},'directory':{'type':Sequelize[_0xe843('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xe843('0x1')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xe843('0x1')],'allowNull':!![],'defaultValue':_0xe843('0x7')},'format':{'type':Sequelize[_0xe843('0x1')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe7e6=['mp3','STRING','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','name','files','mp3nb'];(function(_0x2af573,_0x2065a5){var _0x59be3b=function(_0x26fc0d){while(--_0x26fc0d){_0x2af573['push'](_0x2af573['shift']());}};_0x59be3b(++_0x2065a5);}(_0xe7e6,0x11d));var _0x6e7e=function(_0x2d3f04,_0x517387){_0x2d3f04=_0x2d3f04-0x0;var _0x5709a4=_0xe7e6[_0x2d3f04];return _0x5709a4;};'use strict';var Sequelize=require(_0x6e7e('0x0'));module[_0x6e7e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6e7e('0x2')},'mode':{'type':Sequelize['ENUM']('custom',_0x6e7e('0x3'),_0x6e7e('0x4'),'quietmp3nb','quietmp3',_0x6e7e('0x5')),'allowNull':!![],'defaultValue':_0x6e7e('0x3')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x6e7e('0x6')],'allowNull':!![]},'digit':{'type':Sequelize[_0x6e7e('0x6')],'allowNull':!![]},'sort':{'type':Sequelize[_0x6e7e('0x6')],'allowNull':!![],'defaultValue':_0x6e7e('0x7')},'format':{'type':Sequelize[_0x6e7e('0x6')],'allowNull':!![]},'stamp':{'type':_0x6e7e('0x8')},'defaultEntry':{'type':Sequelize[_0x6e7e('0x9')],'defaultValue':0x0}};
\ No newline at end of file
index 142aab7..89e6c10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf075=['util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','get','MusicOnHolds','UserProfileResource','destroy','end','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','rows','params','length','include','find','catch','body','create','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','readdirSync','rmdirSync','Sequelize','ValidationError','message','addSound','sequelize','Sound','findOne','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','save_name','symlinkSync','removeSound','id2','unlinkSync','getSounds','pick','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x398b3d,_0x2f497e){var _0x20b1cf=function(_0x23a3ea){while(--_0x23a3ea){_0x398b3d['push'](_0x398b3d['shift']());}};_0x20b1cf(++_0x2f497e);}(_0xf075,0x151));var _0x5f07=function(_0x1d6686,_0x2fd2e3){_0x1d6686=_0x1d6686-0x0;var _0x8783f=_0xf075[_0x1d6686];return _0x8783f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f07('0x0'));var rp=require(_0x5f07('0x1'));var moment=require(_0x5f07('0x2'));var BPromise=require(_0x5f07('0x3'));var Mustache=require(_0x5f07('0x4'));var util=require(_0x5f07('0x5'));var path=require(_0x5f07('0x6'));var sox=require(_0x5f07('0x7'));var csv=require('to-csv');var ejs=require(_0x5f07('0x8'));var fs=require('fs');var fs_extra=require(_0x5f07('0x9'));var _=require(_0x5f07('0xa'));var squel=require('squel');var crypto=require(_0x5f07('0xb'));var jsforce=require(_0x5f07('0xc'));var deskjs=require(_0x5f07('0xd'));var toCsv=require(_0x5f07('0xe'));var querystring=require(_0x5f07('0xf'));var Papa=require(_0x5f07('0x10'));var Redis=require(_0x5f07('0x11'));var authService=require(_0x5f07('0x12'));var qs=require(_0x5f07('0x13'));var as=require(_0x5f07('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f07('0x15'))(_0x5f07('0x16'));var utils=require('../../config/utils');var config=require(_0x5f07('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f07('0x18'))['db'];function respondWithStatusCode(_0x23f811,_0x416a58){_0x416a58=_0x416a58||0xcc;return function(_0xa37220){if(_0xa37220){return _0x23f811[_0x5f07('0x19')](_0x416a58);}return _0x23f811['status'](_0x416a58)['end']();};}function respondWithResult(_0xb49669,_0x4b9baa){_0x4b9baa=_0x4b9baa||0xc8;return function(_0x13b1c6){if(_0x13b1c6){return _0xb49669[_0x5f07('0x1a')](_0x4b9baa)[_0x5f07('0x1b')](_0x13b1c6);}};}function respondWithFilteredResult(_0x47d7bb,_0x1edc20){return function(_0xc53670){if(_0xc53670){var _0x43bfbf=typeof _0x1edc20['offset']===_0x5f07('0x1c')&&typeof _0x1edc20[_0x5f07('0x1d')]==='undefined';var _0x4c9140=_0xc53670[_0x5f07('0x1e')];var _0x5b5727=_0x43bfbf?0x0:_0x1edc20['offset'];var _0x5b79f9=_0x43bfbf?_0xc53670[_0x5f07('0x1e')]:_0x1edc20[_0x5f07('0x1f')]+_0x1edc20[_0x5f07('0x1d')];var _0x5979b1;if(_0x5b79f9>=_0x4c9140){_0x5b79f9=_0x4c9140;_0x5979b1=0xc8;}else{_0x5979b1=0xce;}_0x47d7bb[_0x5f07('0x1a')](_0x5979b1);return _0x47d7bb[_0x5f07('0x20')](_0x5f07('0x21'),_0x5b5727+'-'+_0x5b79f9+'/'+_0x4c9140)[_0x5f07('0x1b')](_0xc53670);}return null;};}function patchUpdates(_0x4f441d){return function(_0x2d9abc){try{jsonpatch['apply'](_0x2d9abc,_0x4f441d,!![]);}catch(_0x5db4b8){return BPromise[_0x5f07('0x22')](_0x5db4b8);}return _0x2d9abc[_0x5f07('0x23')]();};}function saveUpdates(_0x49f63a,_0x279d52){return function(_0x19e398){if(_0x19e398){return _0x19e398[_0x5f07('0x24')](_0x49f63a)[_0x5f07('0x25')](function(_0x241759){return _0x241759;});}return null;};}function removeEntity(_0x5633a4,_0x3d7987){return function(_0x3fc581){if(_0x3fc581){return _0x3fc581['destroy']()[_0x5f07('0x25')](function(){var _0x4e9681=_0x3fc581[_0x5f07('0x26')]({'plain':!![]});var _0x48ad92=_0x5f07('0x27');return db[_0x5f07('0x28')][_0x5f07('0x29')]({'where':{'type':_0x48ad92,'resourceId':_0x4e9681['id']}})['then'](function(){return _0x3fc581;});})[_0x5f07('0x25')](function(){_0x5633a4[_0x5f07('0x1a')](0xcc)[_0x5f07('0x2a')]();});}};}function handleEntityNotFound(_0x17715d,_0x4cf871){return function(_0x1c8955){if(!_0x1c8955){_0x17715d[_0x5f07('0x19')](0x194);}return _0x1c8955;};}function handleError(_0x57f224,_0x1963ff){_0x1963ff=_0x1963ff||0x1f4;return function(_0x42766d){logger['error'](_0x42766d[_0x5f07('0x2b')]);if(_0x42766d[_0x5f07('0x2c')]){delete _0x42766d[_0x5f07('0x2c')];}_0x57f224['status'](_0x1963ff)['send'](_0x42766d);};}exports[_0x5f07('0x2d')]=function(_0x296af4,_0x26920e){var _0x61ed3d={},_0x2cf62a={},_0x33de1c={'count':0x0,'rows':[]};var _0x46c416=_[_0x5f07('0x2e')](db[_0x5f07('0x2f')][_0x5f07('0x30')],function(_0x4e4537){return{'name':_0x4e4537[_0x5f07('0x31')],'type':_0x4e4537[_0x5f07('0x32')][_0x5f07('0x33')]};});_0x2cf62a[_0x5f07('0x34')]=_[_0x5f07('0x2e')](_0x46c416,_0x5f07('0x2c'));_0x2cf62a[_0x5f07('0x35')]=_[_0x5f07('0x36')](_0x296af4[_0x5f07('0x35')]);_0x2cf62a['filters']=_['intersection'](_0x2cf62a[_0x5f07('0x34')],_0x2cf62a['query']);_0x61ed3d[_0x5f07('0x37')]=_[_0x5f07('0x38')](_0x2cf62a[_0x5f07('0x34')],qs[_0x5f07('0x39')](_0x296af4[_0x5f07('0x35')][_0x5f07('0x39')]));_0x61ed3d[_0x5f07('0x37')]=_0x61ed3d[_0x5f07('0x37')]['length']?_0x61ed3d[_0x5f07('0x37')]:_0x2cf62a['model'];if(!_0x296af4['query'][_0x5f07('0x3a')](_0x5f07('0x3b'))){_0x61ed3d[_0x5f07('0x1d')]=qs['limit'](_0x296af4[_0x5f07('0x35')][_0x5f07('0x1d')]);_0x61ed3d[_0x5f07('0x1f')]=qs['offset'](_0x296af4['query'][_0x5f07('0x1f')]);}_0x61ed3d[_0x5f07('0x3c')]=qs[_0x5f07('0x3d')](_0x296af4['query'][_0x5f07('0x3d')]);delete _0x296af4[_0x5f07('0x35')]['sort'];_0x61ed3d[_0x5f07('0x3e')]=qs[_0x5f07('0x3f')](_['pick'](_0x296af4[_0x5f07('0x35')],_0x2cf62a['filters']),_0x46c416);if(_0x296af4[_0x5f07('0x35')][_0x5f07('0x40')]){_0x61ed3d[_0x5f07('0x3e')]=_[_0x5f07('0x41')](_0x61ed3d[_0x5f07('0x3e')],{'$or':_[_0x5f07('0x2e')](_0x46c416,function(_0x2768fc){if(_0x2768fc['type']!==_0x5f07('0x42')){var _0x1deeab={};_0x1deeab[_0x2768fc[_0x5f07('0x2c')]]={'$like':'%'+_0x296af4[_0x5f07('0x35')][_0x5f07('0x40')]+'%'};return _0x1deeab;}})});}_0x61ed3d=_[_0x5f07('0x41')]({},_0x61ed3d,_0x296af4[_0x5f07('0x43')]);var _0x21432e={'where':_0x61ed3d[_0x5f07('0x3e')]};return db[_0x5f07('0x2f')][_0x5f07('0x1e')](_0x21432e)[_0x5f07('0x25')](function(_0x607cf3){_0x33de1c['count']=_0x607cf3;if(_0x296af4['query']['includeAll']){_0x61ed3d['include']=[{'all':!![]}];}return db[_0x5f07('0x2f')][_0x5f07('0x44')](_0x61ed3d);})[_0x5f07('0x25')](function(_0x4f8b89){_0x33de1c[_0x5f07('0x45')]=_0x4f8b89;return _0x33de1c;})[_0x5f07('0x25')](respondWithFilteredResult(_0x26920e,_0x61ed3d))['catch'](handleError(_0x26920e,null));};exports['show']=function(_0x561151,_0x267bb9){var _0x8104d2={'raw':![],'where':{'id':_0x561151[_0x5f07('0x46')]['id']}},_0x4d49e6={};_0x4d49e6[_0x5f07('0x34')]=_['keys'](db[_0x5f07('0x2f')]['rawAttributes']);_0x4d49e6['query']=_[_0x5f07('0x36')](_0x561151[_0x5f07('0x35')]);_0x4d49e6[_0x5f07('0x3f')]=_[_0x5f07('0x38')](_0x4d49e6[_0x5f07('0x34')],_0x4d49e6[_0x5f07('0x35')]);_0x8104d2[_0x5f07('0x37')]=_['intersection'](_0x4d49e6[_0x5f07('0x34')],qs[_0x5f07('0x39')](_0x561151['query'][_0x5f07('0x39')]));_0x8104d2[_0x5f07('0x37')]=_0x8104d2[_0x5f07('0x37')][_0x5f07('0x47')]?_0x8104d2['attributes']:_0x4d49e6['model'];if(_0x561151[_0x5f07('0x35')]['includeAll']){_0x8104d2[_0x5f07('0x48')]=[{'all':!![]}];}_0x8104d2=_[_0x5f07('0x41')]({},_0x8104d2,_0x561151[_0x5f07('0x43')]);return db[_0x5f07('0x2f')][_0x5f07('0x49')](_0x8104d2)[_0x5f07('0x25')](handleEntityNotFound(_0x267bb9,null))[_0x5f07('0x25')](respondWithResult(_0x267bb9,null))[_0x5f07('0x4a')](handleError(_0x267bb9,null));};exports[_0x5f07('0x24')]=function(_0x52d6e9,_0x44b5e4){if(_0x52d6e9[_0x5f07('0x4b')]['id']){delete _0x52d6e9[_0x5f07('0x4b')]['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0x52d6e9['params']['id']}})[_0x5f07('0x25')](handleEntityNotFound(_0x44b5e4,null))[_0x5f07('0x25')](saveUpdates(_0x52d6e9[_0x5f07('0x4b')],null))[_0x5f07('0x25')](respondWithResult(_0x44b5e4,null))[_0x5f07('0x4a')](handleError(_0x44b5e4,null));};exports[_0x5f07('0x4c')]=function(_0x5470c0,_0x3c2930,_0x2fbd73){return db['sequelize'][_0x5f07('0x4d')](function(_0xb5e425){if(_0x5470c0['body'][_0x5f07('0x4e')]===_0x5f07('0x4f')){_0x5470c0['body'][_0x5f07('0x50')]=path[_0x5f07('0x51')](config[_0x5f07('0x52')],_0x5f07('0x53'),_0x5470c0[_0x5f07('0x4b')][_0x5f07('0x2c')]);}return db[_0x5f07('0x2f')][_0x5f07('0x4c')](_0x5470c0[_0x5f07('0x4b')],{'transaction':_0xb5e425})['then'](function(_0x562644){if(_0x5470c0[_0x5f07('0x4b')][_0x5f07('0x4e')]===_0x5f07('0x4f')){fs[_0x5f07('0x54')](_0x562644[_0x5f07('0x50')],parseInt(_0x5f07('0x55'),0x8));}var _0x46fbd0=_0x5470c0['user']['get']({'plain':!![]});if(!_0x46fbd0)throw new Error(_0x5f07('0x56'));if(_0x46fbd0[_0x5f07('0x57')]==='user'){var _0x33c5cb=_0x562644['get']({'plain':!![]});return db[_0x5f07('0x58')][_0x5f07('0x49')]({'where':{'name':'MusicOnHolds','userProfileId':_0x46fbd0[_0x5f07('0x59')]},'raw':!![]})[_0x5f07('0x25')](function(_0x35e721){if(_0x35e721&&_0x35e721[_0x5f07('0x5a')]===0x0){return db[_0x5f07('0x28')][_0x5f07('0x4c')]({'name':_0x33c5cb[_0x5f07('0x2c')],'resourceId':_0x33c5cb['id'],'type':_0x35e721[_0x5f07('0x2c')],'sectionId':_0x35e721['id']},{})[_0x5f07('0x25')](function(){return _0x562644;});}else{return _0x562644;}})[_0x5f07('0x4a')](function(_0x23eb44){logger[_0x5f07('0x5b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23eb44);});}return _0x562644;});})[_0x5f07('0x25')](respondWithResult(_0x3c2930,0xc9))[_0x5f07('0x4a')](handleError(_0x3c2930,null));};exports[_0x5f07('0x29')]=function(_0x3e0099,_0x8ac54a,_0x2d46af){var _0x24a52e;return db[_0x5f07('0x2f')]['find']({'where':{'id':_0x3e0099[_0x5f07('0x46')]['id']}})['then'](function(_0x2e09d1){if(_0x2e09d1){return db['sequelize'][_0x5f07('0x4d')](function(_0x51e21e){return _0x2e09d1[_0x5f07('0x29')]({'transaction':_0x51e21e,'raw':!![]})['then'](function(_0x41eb6d){if(_0x41eb6d[_0x5f07('0x50')]){fs[_0x5f07('0x5c')](_0x41eb6d[_0x5f07('0x50')])['forEach'](function(_0x1e9b16){fs['unlinkSync'](path[_0x5f07('0x51')](_0x41eb6d['directory'],_0x1e9b16));});fs[_0x5f07('0x5d')](_0x41eb6d[_0x5f07('0x50')]);}return _0x41eb6d;});})[_0x5f07('0x4a')](function(_0x1ec3ed){throw new db[(_0x5f07('0x5e'))][(_0x5f07('0x5f'))](_0x1ec3ed[_0x5f07('0x60')]);});}})[_0x5f07('0x25')](handleEntityNotFound(_0x8ac54a,null))[_0x5f07('0x25')](removeEntity(_0x8ac54a,null))['catch'](handleError(_0x8ac54a,null));};exports[_0x5f07('0x61')]=function(_0x32de78,_0x5a6ce1,_0x12ee61){return db[_0x5f07('0x62')][_0x5f07('0x4d')](function(_0x428ffe){var _0x40ac55;return db[_0x5f07('0x2f')][_0x5f07('0x49')]({'where':{'id':_0x32de78[_0x5f07('0x46')]['id']}})[_0x5f07('0x25')](function(_0x70ce3f){if(_0x70ce3f){_0x40ac55=_0x70ce3f;return _0x70ce3f['addSound'](_0x32de78['body']['id'],{'transaction':_0x428ffe});}})['then'](function(_0xd1563e){if(_0xd1563e){return db[_0x5f07('0x63')][_0x5f07('0x64')]({'where':{'id':_0x32de78['body']['id']},'attributes':['id',_0x5f07('0x2c'),'save_name',_0x5f07('0x65'),_0x5f07('0x66')],'raw':!![]});}})[_0x5f07('0x25')](function(_0x5c2d3b){if(_0x5c2d3b){var _0xefeeda=path['join'](config['root'],_0x5f07('0x67'),util[_0x5f07('0x68')](_0x5f07('0x69'),path[_0x5f07('0x6a')](_0x5c2d3b[_0x5f07('0x6b')],path['extname'](_0x5c2d3b[_0x5f07('0x6b')])),_0x5c2d3b[_0x5f07('0x65')]));var _0x4da13c=path[_0x5f07('0x51')](config['root'],_0x5f07('0x53'),_0x40ac55[_0x5f07('0x2c')],util['format'](_0x5f07('0x69'),_0x5c2d3b[_0x5f07('0x2c')],_0x5c2d3b[_0x5f07('0x65')]));fs[_0x5f07('0x6c')](_0xefeeda,_0x4da13c);return _0x5c2d3b;}})[_0x5f07('0x4a')](function(_0x16e5b2){throw new db[(_0x5f07('0x5e'))][(_0x5f07('0x5f'))](_0x16e5b2[_0x5f07('0x60')]);});})['then'](handleEntityNotFound(_0x5a6ce1,null))[_0x5f07('0x25')](respondWithResult(_0x5a6ce1,0xc9))['catch'](handleError(_0x5a6ce1,null));};exports['removeSound']=function(_0x2fd51d,_0x79b78a,_0x26b276){return db[_0x5f07('0x62')][_0x5f07('0x4d')](function(_0x34938c){var _0x8f8471;return db[_0x5f07('0x2f')][_0x5f07('0x64')]({'where':{'id':_0x2fd51d['params']['id']}})['then'](handleEntityNotFound(_0x79b78a,null))[_0x5f07('0x25')](function(_0x62e37d){if(_0x62e37d){_0x8f8471=_0x62e37d;return _0x62e37d[_0x5f07('0x6d')](_0x2fd51d[_0x5f07('0x46')][_0x5f07('0x6e')]);}})[_0x5f07('0x25')](function(_0xc24572){if(_0xc24572){return db['Sound'][_0x5f07('0x64')]({'where':{'id':_0x2fd51d[_0x5f07('0x46')]['id2']},'attributes':['id','name',_0x5f07('0x6b'),'converted_format',_0x5f07('0x66')],'raw':!![]});}})['then'](function(_0x43d383){if(_0x43d383){fs[_0x5f07('0x6f')](path[_0x5f07('0x51')](_0x8f8471['directory'],util[_0x5f07('0x68')](_0x5f07('0x69'),_0x43d383['name'],_0x43d383[_0x5f07('0x65')])));return _0x43d383;}})[_0x5f07('0x4a')](function(_0x14850a){throw new db[(_0x5f07('0x5e'))][(_0x5f07('0x5f'))](_0x14850a['message']);});})[_0x5f07('0x25')](handleEntityNotFound(_0x79b78a,null))[_0x5f07('0x25')](respondWithStatusCode(_0x79b78a,0xcc))['catch'](handleError(_0x79b78a,null));};exports[_0x5f07('0x70')]=function(_0x5d5dfd,_0x3f2638,_0xf1457d){var _0x5c61e4={};var _0x533661={};var _0xbf06e3;var _0x44d8a3;return db[_0x5f07('0x2f')][_0x5f07('0x64')]({'where':{'id':_0x5d5dfd[_0x5f07('0x46')]['id']}})[_0x5f07('0x25')](handleEntityNotFound(_0x3f2638,null))['then'](function(_0x5189a7){if(_0x5189a7){_0xbf06e3=_0x5189a7;_0x533661[_0x5f07('0x34')]=_['keys'](db[_0x5f07('0x63')][_0x5f07('0x30')]);_0x533661[_0x5f07('0x35')]=_[_0x5f07('0x36')](_0x5d5dfd['query']);_0x533661[_0x5f07('0x3f')]=_['intersection'](_0x533661[_0x5f07('0x34')],_0x533661[_0x5f07('0x35')]);_0x5c61e4[_0x5f07('0x37')]=_[_0x5f07('0x38')](_0x533661[_0x5f07('0x34')],qs[_0x5f07('0x39')](_0x5d5dfd[_0x5f07('0x35')]['fields']));_0x5c61e4[_0x5f07('0x37')]=_0x5c61e4[_0x5f07('0x37')][_0x5f07('0x47')]?_0x5c61e4[_0x5f07('0x37')]:_0x533661['model'];_0x5c61e4[_0x5f07('0x3c')]=qs['sort'](_0x5d5dfd[_0x5f07('0x35')][_0x5f07('0x3d')]);_0x5c61e4[_0x5f07('0x3e')]=qs[_0x5f07('0x3f')](_[_0x5f07('0x71')](_0x5d5dfd['query'],_0x533661[_0x5f07('0x3f')]));if(_0x5d5dfd['query'][_0x5f07('0x40')]){_0x5c61e4[_0x5f07('0x3e')]=_['merge'](_0x5c61e4[_0x5f07('0x3e')],{'$or':_[_0x5f07('0x2e')](_0x5c61e4['attributes'],function(_0x2b7c10){var _0x57ee41={};_0x57ee41[_0x2b7c10]={'$like':'%'+_0x5d5dfd[_0x5f07('0x35')]['filter']+'%'};return _0x57ee41;})});}_0x5c61e4=_[_0x5f07('0x41')]({},_0x5c61e4,_0x5d5dfd[_0x5f07('0x43')]);return _0xbf06e3[_0x5f07('0x70')](_0x5c61e4);}})[_0x5f07('0x25')](function(_0x1eb7bf){if(_0x1eb7bf){_0x44d8a3=_0x1eb7bf[_0x5f07('0x47')];if(!_0x5d5dfd[_0x5f07('0x35')][_0x5f07('0x3a')](_0x5f07('0x3b'))){_0x5c61e4[_0x5f07('0x1d')]=qs[_0x5f07('0x1d')](_0x5d5dfd[_0x5f07('0x35')]['limit']);_0x5c61e4[_0x5f07('0x1f')]=qs[_0x5f07('0x1f')](_0x5d5dfd[_0x5f07('0x35')][_0x5f07('0x1f')]);}return _0xbf06e3[_0x5f07('0x70')](_0x5c61e4);}})[_0x5f07('0x25')](function(_0x6c36fa){if(_0x6c36fa){return _0x6c36fa?{'count':_0x44d8a3,'rows':_0x6c36fa}:null;}})[_0x5f07('0x25')](respondWithResult(_0x3f2638,null))[_0x5f07('0x4a')](handleError(_0x3f2638,null));};
\ No newline at end of file
+var _0x997b=['map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','create','sequelize','transaction','mode','directory','join','server/files/moh','files','0777','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','forEach','rmdirSync','Sequelize','ValidationError','addSound','Sound','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','message','findOne','removeSound','id2','unlinkSync','getSounds','pick','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','send','VoiceMusicOnHold','rawAttributes','type','key','model'];(function(_0x2a0422,_0x42121c){var _0x562dce=function(_0x69f263){while(--_0x69f263){_0x2a0422['push'](_0x2a0422['shift']());}};_0x562dce(++_0x42121c);}(_0x997b,0x125));var _0xb997=function(_0xa7a587,_0x1103e1){_0xa7a587=_0xa7a587-0x0;var _0x74b664=_0x997b[_0xa7a587];return _0x74b664;};'use strict';var emlformat=require(_0xb997('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb997('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb997('0x2'));var moment=require(_0xb997('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb997('0x4'));var util=require(_0xb997('0x5'));var path=require(_0xb997('0x6'));var sox=require(_0xb997('0x7'));var csv=require('to-csv');var ejs=require(_0xb997('0x8'));var fs=require('fs');var fs_extra=require(_0xb997('0x9'));var _=require('lodash');var squel=require(_0xb997('0xa'));var crypto=require('crypto');var jsforce=require(_0xb997('0xb'));var deskjs=require(_0xb997('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb997('0xd'));var Papa=require(_0xb997('0xe'));var Redis=require(_0xb997('0xf'));var authService=require(_0xb997('0x10'));var qs=require(_0xb997('0x11'));var as=require(_0xb997('0x12'));var hardwareService=require(_0xb997('0x13'));var logger=require('../../config/logger')(_0xb997('0x14'));var utils=require(_0xb997('0x15'));var config=require(_0xb997('0x16'));var licenseUtil=require(_0xb997('0x17'));var db=require(_0xb997('0x18'))['db'];function respondWithStatusCode(_0x49d211,_0x196882){_0x196882=_0x196882||0xcc;return function(_0x4f69bc){if(_0x4f69bc){return _0x49d211[_0xb997('0x19')](_0x196882);}return _0x49d211[_0xb997('0x1a')](_0x196882)['end']();};}function respondWithResult(_0x2baecf,_0xe73cca){_0xe73cca=_0xe73cca||0xc8;return function(_0x177783){if(_0x177783){return _0x2baecf[_0xb997('0x1a')](_0xe73cca)[_0xb997('0x1b')](_0x177783);}};}function respondWithFilteredResult(_0x1a42fa,_0x301acb){return function(_0x4850e1){if(_0x4850e1){var _0x404ce4=typeof _0x301acb[_0xb997('0x1c')]===_0xb997('0x1d')&&typeof _0x301acb[_0xb997('0x1e')]===_0xb997('0x1d');var _0x1df8f8=_0x4850e1[_0xb997('0x1f')];var _0x4122a6=_0x404ce4?0x0:_0x301acb[_0xb997('0x1c')];var _0x1ce424=_0x404ce4?_0x4850e1['count']:_0x301acb[_0xb997('0x1c')]+_0x301acb[_0xb997('0x1e')];var _0x15de41;if(_0x1ce424>=_0x1df8f8){_0x1ce424=_0x1df8f8;_0x15de41=0xc8;}else{_0x15de41=0xce;}_0x1a42fa['status'](_0x15de41);return _0x1a42fa[_0xb997('0x20')](_0xb997('0x21'),_0x4122a6+'-'+_0x1ce424+'/'+_0x1df8f8)['json'](_0x4850e1);}return null;};}function patchUpdates(_0x55b532){return function(_0x160617){try{jsonpatch[_0xb997('0x22')](_0x160617,_0x55b532,!![]);}catch(_0x2c880e){return BPromise[_0xb997('0x23')](_0x2c880e);}return _0x160617['save']();};}function saveUpdates(_0x4a014a,_0x228a48){return function(_0x38a59a){if(_0x38a59a){return _0x38a59a['update'](_0x4a014a)[_0xb997('0x24')](function(_0x5abe36){return _0x5abe36;});}return null;};}function removeEntity(_0x269316,_0x57076a){return function(_0x349924){if(_0x349924){return _0x349924[_0xb997('0x25')]()[_0xb997('0x24')](function(){var _0x29fa55=_0x349924['get']({'plain':!![]});var _0x4e3a6c=_0xb997('0x26');return db[_0xb997('0x27')][_0xb997('0x25')]({'where':{'type':_0x4e3a6c,'resourceId':_0x29fa55['id']}})[_0xb997('0x24')](function(){return _0x349924;});})['then'](function(){_0x269316['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29d02a,_0x5248d5){return function(_0x195407){if(!_0x195407){_0x29d02a[_0xb997('0x19')](0x194);}return _0x195407;};}function handleError(_0x5aaa65,_0x5bffc4){_0x5bffc4=_0x5bffc4||0x1f4;return function(_0x126d56){logger[_0xb997('0x28')](_0x126d56[_0xb997('0x29')]);if(_0x126d56[_0xb997('0x2a')]){delete _0x126d56[_0xb997('0x2a')];}_0x5aaa65[_0xb997('0x1a')](_0x5bffc4)[_0xb997('0x2b')](_0x126d56);};}exports['index']=function(_0x1b7d43,_0x3dd72b){var _0x204556={},_0x402118={},_0x20316f={'count':0x0,'rows':[]};var _0x2a0d72=_['map'](db[_0xb997('0x2c')][_0xb997('0x2d')],function(_0x167791){return{'name':_0x167791['fieldName'],'type':_0x167791[_0xb997('0x2e')][_0xb997('0x2f')]};});_0x402118[_0xb997('0x30')]=_[_0xb997('0x31')](_0x2a0d72,_0xb997('0x2a'));_0x402118[_0xb997('0x32')]=_[_0xb997('0x33')](_0x1b7d43['query']);_0x402118[_0xb997('0x34')]=_[_0xb997('0x35')](_0x402118[_0xb997('0x30')],_0x402118[_0xb997('0x32')]);_0x204556[_0xb997('0x36')]=_[_0xb997('0x35')](_0x402118[_0xb997('0x30')],qs[_0xb997('0x37')](_0x1b7d43[_0xb997('0x32')][_0xb997('0x37')]));_0x204556[_0xb997('0x36')]=_0x204556[_0xb997('0x36')][_0xb997('0x38')]?_0x204556[_0xb997('0x36')]:_0x402118['model'];if(!_0x1b7d43[_0xb997('0x32')][_0xb997('0x39')](_0xb997('0x3a'))){_0x204556[_0xb997('0x1e')]=qs['limit'](_0x1b7d43[_0xb997('0x32')][_0xb997('0x1e')]);_0x204556[_0xb997('0x1c')]=qs['offset'](_0x1b7d43[_0xb997('0x32')][_0xb997('0x1c')]);}_0x204556[_0xb997('0x3b')]=qs['sort'](_0x1b7d43[_0xb997('0x32')][_0xb997('0x3c')]);delete _0x1b7d43[_0xb997('0x32')]['sort'];_0x204556[_0xb997('0x3d')]=qs[_0xb997('0x34')](_['pick'](_0x1b7d43[_0xb997('0x32')],_0x402118[_0xb997('0x34')]),_0x2a0d72);if(_0x1b7d43[_0xb997('0x32')][_0xb997('0x3e')]){_0x204556[_0xb997('0x3d')]=_[_0xb997('0x3f')](_0x204556['where'],{'$or':_[_0xb997('0x31')](_0x2a0d72,function(_0x30428a){if(_0x30428a[_0xb997('0x2e')]!==_0xb997('0x40')){var _0x101e58={};_0x101e58[_0x30428a['name']]={'$like':'%'+_0x1b7d43[_0xb997('0x32')][_0xb997('0x3e')]+'%'};return _0x101e58;}})});}_0x204556=_[_0xb997('0x3f')]({},_0x204556,_0x1b7d43[_0xb997('0x41')]);var _0x1d6e48={'where':_0x204556['where']};return db[_0xb997('0x2c')]['count'](_0x1d6e48)[_0xb997('0x24')](function(_0x35d693){_0x20316f['count']=_0x35d693;if(_0x1b7d43[_0xb997('0x32')][_0xb997('0x42')]){_0x204556[_0xb997('0x43')]=[{'all':!![]}];}return db[_0xb997('0x2c')][_0xb997('0x44')](_0x204556);})['then'](function(_0xe0f878){_0x20316f[_0xb997('0x45')]=_0xe0f878;return _0x20316f;})[_0xb997('0x24')](respondWithFilteredResult(_0x3dd72b,_0x204556))[_0xb997('0x46')](handleError(_0x3dd72b,null));};exports['show']=function(_0x5d95e4,_0x56379d){var _0x357917={'raw':![],'where':{'id':_0x5d95e4[_0xb997('0x47')]['id']}},_0x20ea71={};_0x20ea71[_0xb997('0x30')]=_[_0xb997('0x33')](db[_0xb997('0x2c')][_0xb997('0x2d')]);_0x20ea71['query']=_[_0xb997('0x33')](_0x5d95e4[_0xb997('0x32')]);_0x20ea71['filters']=_[_0xb997('0x35')](_0x20ea71[_0xb997('0x30')],_0x20ea71['query']);_0x357917[_0xb997('0x36')]=_[_0xb997('0x35')](_0x20ea71[_0xb997('0x30')],qs[_0xb997('0x37')](_0x5d95e4[_0xb997('0x32')]['fields']));_0x357917[_0xb997('0x36')]=_0x357917[_0xb997('0x36')][_0xb997('0x38')]?_0x357917[_0xb997('0x36')]:_0x20ea71[_0xb997('0x30')];if(_0x5d95e4[_0xb997('0x32')][_0xb997('0x42')]){_0x357917['include']=[{'all':!![]}];}_0x357917=_[_0xb997('0x3f')]({},_0x357917,_0x5d95e4[_0xb997('0x41')]);return db[_0xb997('0x2c')][_0xb997('0x48')](_0x357917)[_0xb997('0x24')](handleEntityNotFound(_0x56379d,null))[_0xb997('0x24')](respondWithResult(_0x56379d,null))[_0xb997('0x46')](handleError(_0x56379d,null));};exports['update']=function(_0x379af5,_0x101e1b){if(_0x379af5[_0xb997('0x49')]['id']){delete _0x379af5[_0xb997('0x49')]['id'];}return db[_0xb997('0x2c')]['find']({'where':{'id':_0x379af5[_0xb997('0x47')]['id']}})[_0xb997('0x24')](handleEntityNotFound(_0x101e1b,null))['then'](saveUpdates(_0x379af5[_0xb997('0x49')],null))['then'](respondWithResult(_0x101e1b,null))['catch'](handleError(_0x101e1b,null));};exports[_0xb997('0x4a')]=function(_0x155a2a,_0xe5666f,_0xf67c5c){return db[_0xb997('0x4b')][_0xb997('0x4c')](function(_0x30c213){if(_0x155a2a['body'][_0xb997('0x4d')]==='files'){_0x155a2a['body'][_0xb997('0x4e')]=path[_0xb997('0x4f')](config['root'],_0xb997('0x50'),_0x155a2a[_0xb997('0x49')][_0xb997('0x2a')]);}return db['VoiceMusicOnHold'][_0xb997('0x4a')](_0x155a2a[_0xb997('0x49')],{'transaction':_0x30c213})[_0xb997('0x24')](function(_0x4c7751){if(_0x155a2a[_0xb997('0x49')][_0xb997('0x4d')]===_0xb997('0x51')){fs['mkdirSync'](_0x4c7751['directory'],parseInt(_0xb997('0x52'),0x8));}var _0x1048bd=_0x155a2a[_0xb997('0x53')]['get']({'plain':!![]});if(!_0x1048bd)throw new Error(_0xb997('0x54'));if(_0x1048bd[_0xb997('0x55')]===_0xb997('0x53')){var _0x254107=_0x4c7751[_0xb997('0x56')]({'plain':!![]});return db[_0xb997('0x57')][_0xb997('0x48')]({'where':{'name':_0xb997('0x26'),'userProfileId':_0x1048bd[_0xb997('0x58')]},'raw':!![]})[_0xb997('0x24')](function(_0x95c363){if(_0x95c363&&_0x95c363[_0xb997('0x59')]===0x0){return db['UserProfileResource'][_0xb997('0x4a')]({'name':_0x254107[_0xb997('0x2a')],'resourceId':_0x254107['id'],'type':_0x95c363[_0xb997('0x2a')],'sectionId':_0x95c363['id']},{})[_0xb997('0x24')](function(){return _0x4c7751;});}else{return _0x4c7751;}})[_0xb997('0x46')](function(_0x505c8b){logger[_0xb997('0x28')](_0xb997('0x5a'),_0x505c8b);});}return _0x4c7751;});})[_0xb997('0x24')](respondWithResult(_0xe5666f,0xc9))[_0xb997('0x46')](handleError(_0xe5666f,null));};exports[_0xb997('0x25')]=function(_0x3ecbf7,_0x147148,_0x115486){var _0x4ce124;return db[_0xb997('0x2c')][_0xb997('0x48')]({'where':{'id':_0x3ecbf7[_0xb997('0x47')]['id']}})['then'](function(_0x1c11b3){if(_0x1c11b3){return db['sequelize']['transaction'](function(_0x447bd7){return _0x1c11b3[_0xb997('0x25')]({'transaction':_0x447bd7,'raw':!![]})['then'](function(_0x1ab582){if(_0x1ab582['directory']){fs['readdirSync'](_0x1ab582[_0xb997('0x4e')])[_0xb997('0x5b')](function(_0x321fba){fs['unlinkSync'](path['join'](_0x1ab582[_0xb997('0x4e')],_0x321fba));});fs[_0xb997('0x5c')](_0x1ab582['directory']);}return _0x1ab582;});})['catch'](function(_0x25d49b){throw new db[(_0xb997('0x5d'))][(_0xb997('0x5e'))](_0x25d49b['message']);});}})[_0xb997('0x24')](handleEntityNotFound(_0x147148,null))[_0xb997('0x24')](removeEntity(_0x147148,null))[_0xb997('0x46')](handleError(_0x147148,null));};exports[_0xb997('0x5f')]=function(_0x1ee075,_0x516849,_0x250e6c){return db[_0xb997('0x4b')]['transaction'](function(_0x5673f4){var _0x2bdb57;return db[_0xb997('0x2c')][_0xb997('0x48')]({'where':{'id':_0x1ee075['params']['id']}})[_0xb997('0x24')](function(_0x55b6ce){if(_0x55b6ce){_0x2bdb57=_0x55b6ce;return _0x55b6ce['addSound'](_0x1ee075[_0xb997('0x49')]['id'],{'transaction':_0x5673f4});}})[_0xb997('0x24')](function(_0x804f87){if(_0x804f87){return db[_0xb997('0x60')]['findOne']({'where':{'id':_0x1ee075['body']['id']},'attributes':['id',_0xb997('0x2a'),_0xb997('0x61'),_0xb997('0x62'),_0xb997('0x63')],'raw':!![]});}})[_0xb997('0x24')](function(_0x462fdf){if(_0x462fdf){var _0x4a5655=path['join'](config[_0xb997('0x64')],_0xb997('0x65'),util[_0xb997('0x66')](_0xb997('0x67'),path[_0xb997('0x68')](_0x462fdf['save_name'],path[_0xb997('0x69')](_0x462fdf[_0xb997('0x61')])),_0x462fdf['converted_format']));var _0x25b5eb=path[_0xb997('0x4f')](config[_0xb997('0x64')],'server/files/moh',_0x2bdb57[_0xb997('0x2a')],util['format'](_0xb997('0x67'),_0x462fdf['name'],_0x462fdf[_0xb997('0x62')]));fs[_0xb997('0x6a')](_0x4a5655,_0x25b5eb);return _0x462fdf;}})['catch'](function(_0x556696){throw new db[(_0xb997('0x5d'))][(_0xb997('0x5e'))](_0x556696[_0xb997('0x6b')]);});})[_0xb997('0x24')](handleEntityNotFound(_0x516849,null))[_0xb997('0x24')](respondWithResult(_0x516849,0xc9))[_0xb997('0x46')](handleError(_0x516849,null));};exports['removeSound']=function(_0x33a210,_0x5e814f,_0x2b3722){return db[_0xb997('0x4b')][_0xb997('0x4c')](function(_0x299748){var _0x204535;return db[_0xb997('0x2c')][_0xb997('0x6c')]({'where':{'id':_0x33a210[_0xb997('0x47')]['id']}})[_0xb997('0x24')](handleEntityNotFound(_0x5e814f,null))[_0xb997('0x24')](function(_0xe50d84){if(_0xe50d84){_0x204535=_0xe50d84;return _0xe50d84[_0xb997('0x6d')](_0x33a210[_0xb997('0x47')]['id2']);}})[_0xb997('0x24')](function(_0x35653e){if(_0x35653e){return db[_0xb997('0x60')][_0xb997('0x6c')]({'where':{'id':_0x33a210[_0xb997('0x47')][_0xb997('0x6e')]},'attributes':['id','name',_0xb997('0x61'),'converted_format',_0xb997('0x63')],'raw':!![]});}})['then'](function(_0x4433ca){if(_0x4433ca){fs[_0xb997('0x6f')](path[_0xb997('0x4f')](_0x204535['directory'],util['format'](_0xb997('0x67'),_0x4433ca[_0xb997('0x2a')],_0x4433ca[_0xb997('0x62')])));return _0x4433ca;}})[_0xb997('0x46')](function(_0x411689){throw new db[(_0xb997('0x5d'))][(_0xb997('0x5e'))](_0x411689[_0xb997('0x6b')]);});})[_0xb997('0x24')](handleEntityNotFound(_0x5e814f,null))['then'](respondWithStatusCode(_0x5e814f,0xcc))['catch'](handleError(_0x5e814f,null));};exports[_0xb997('0x70')]=function(_0xd2f715,_0x469dec,_0x4afc1b){var _0x244d19={};var _0x4d033d={};var _0x215012;var _0x5e4729;return db[_0xb997('0x2c')][_0xb997('0x6c')]({'where':{'id':_0xd2f715[_0xb997('0x47')]['id']}})['then'](handleEntityNotFound(_0x469dec,null))['then'](function(_0x6aa66c){if(_0x6aa66c){_0x215012=_0x6aa66c;_0x4d033d['model']=_['keys'](db[_0xb997('0x60')][_0xb997('0x2d')]);_0x4d033d[_0xb997('0x32')]=_['keys'](_0xd2f715[_0xb997('0x32')]);_0x4d033d[_0xb997('0x34')]=_[_0xb997('0x35')](_0x4d033d['model'],_0x4d033d[_0xb997('0x32')]);_0x244d19[_0xb997('0x36')]=_['intersection'](_0x4d033d['model'],qs[_0xb997('0x37')](_0xd2f715[_0xb997('0x32')]['fields']));_0x244d19[_0xb997('0x36')]=_0x244d19['attributes']['length']?_0x244d19[_0xb997('0x36')]:_0x4d033d[_0xb997('0x30')];_0x244d19['order']=qs[_0xb997('0x3c')](_0xd2f715[_0xb997('0x32')][_0xb997('0x3c')]);_0x244d19[_0xb997('0x3d')]=qs['filters'](_[_0xb997('0x71')](_0xd2f715[_0xb997('0x32')],_0x4d033d[_0xb997('0x34')]));if(_0xd2f715[_0xb997('0x32')]['filter']){_0x244d19[_0xb997('0x3d')]=_[_0xb997('0x3f')](_0x244d19['where'],{'$or':_[_0xb997('0x31')](_0x244d19[_0xb997('0x36')],function(_0x3ef35d){var _0xbee6f8={};_0xbee6f8[_0x3ef35d]={'$like':'%'+_0xd2f715['query'][_0xb997('0x3e')]+'%'};return _0xbee6f8;})});}_0x244d19=_[_0xb997('0x3f')]({},_0x244d19,_0xd2f715[_0xb997('0x41')]);return _0x215012[_0xb997('0x70')](_0x244d19);}})[_0xb997('0x24')](function(_0x7a32c5){if(_0x7a32c5){_0x5e4729=_0x7a32c5['length'];if(!_0xd2f715[_0xb997('0x32')][_0xb997('0x39')]('nolimit')){_0x244d19['limit']=qs[_0xb997('0x1e')](_0xd2f715[_0xb997('0x32')][_0xb997('0x1e')]);_0x244d19[_0xb997('0x1c')]=qs[_0xb997('0x1c')](_0xd2f715[_0xb997('0x32')][_0xb997('0x1c')]);}return _0x215012[_0xb997('0x70')](_0x244d19);}})[_0xb997('0x24')](function(_0x153450){if(_0x153450){return _0x153450?{'count':_0x5e4729,'rows':_0x153450}:null;}})[_0xb997('0x24')](respondWithResult(_0x469dec,null))[_0xb997('0x46')](handleError(_0x469dec,null));};
\ No newline at end of file
index f6a7c91..73b37cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22da=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','define','voice_musiconhold','lodash'];(function(_0xbfbef0,_0x218b21){var _0x3fdf6f=function(_0x468471){while(--_0x468471){_0xbfbef0['push'](_0xbfbef0['shift']());}};_0x3fdf6f(++_0x218b21);}(_0x22da,0x18b));var _0xa22d=function(_0x239589,_0x2a7895){_0x239589=_0x239589-0x0;var _0x39632b=_0x22da[_0x239589];return _0x39632b;};'use strict';var _=require(_0xa22d('0x0'));var util=require(_0xa22d('0x1'));var logger=require('../../config/logger')(_0xa22d('0x2'));var moment=require(_0xa22d('0x3'));var BPromise=require(_0xa22d('0x4'));var rp=require(_0xa22d('0x5'));var fs=require('fs');var path=require(_0xa22d('0x6'));var rimraf=require(_0xa22d('0x7'));var config=require(_0xa22d('0x8'));var attributes=require(_0xa22d('0x9'));module['exports']=function(_0x571c96,_0x407095){return _0x571c96[_0xa22d('0xa')]('VoiceMusicOnHold',attributes,{'tableName':_0xa22d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7565=['lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','VoiceMusicOnHold'];(function(_0x2ab914,_0x210788){var _0x35c276=function(_0x2b79d0){while(--_0x2b79d0){_0x2ab914['push'](_0x2ab914['shift']());}};_0x35c276(++_0x210788);}(_0x7565,0x1ce));var _0x5756=function(_0x39166a,_0x18cc82){_0x39166a=_0x39166a-0x0;var _0x4c8d11=_0x7565[_0x39166a];return _0x4c8d11;};'use strict';var _=require(_0x5756('0x0'));var util=require(_0x5756('0x1'));var logger=require('../../config/logger')(_0x5756('0x2'));var moment=require(_0x5756('0x3'));var BPromise=require(_0x5756('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5756('0x5'));var rimraf=require(_0x5756('0x6'));var config=require(_0x5756('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x5756('0x8')]=function(_0x2e151e,_0x484278){return _0x2e151e[_0x5756('0x9')](_0x5756('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 86c2e60..03685d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x4bbdcc,_0xb989be){var _0x4038ba=function(_0x36e6ce){while(--_0x36e6ce){_0x4bbdcc['push'](_0x4bbdcc['shift']());}};_0x4038ba(++_0xb989be);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xf2f332,_0x299fbf){_0xf2f332=_0xf2f332-0x0;var _0x56cce3=_0xcb91[_0xf2f332];return _0x56cce3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x527faa,_0x2ed441){var _0x25eba9=function(_0x13f2b8){while(--_0x13f2b8){_0x527faa['push'](_0x527faa['shift']());}};_0x25eba9(++_0x2ed441);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 5fc8f15..21a30d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d2c=['index','/describe','isAuthenticated','describe','/:id','show','/:id/users','post','create','addAgents','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get'];(function(_0x484cac,_0x30ad3a){var _0x1d6e77=function(_0x4f5f16){while(--_0x4f5f16){_0x484cac['push'](_0x484cac['shift']());}};_0x1d6e77(++_0x30ad3a);}(_0x6d2c,0xe6));var _0xc6d2=function(_0x1ee8e0,_0x1de084){_0x1ee8e0=_0x1ee8e0-0x0;var _0x188155=_0x6d2c[_0x1ee8e0];return _0x188155;};'use strict';var multer=require(_0xc6d2('0x0'));var util=require(_0xc6d2('0x1'));var path=require(_0xc6d2('0x2'));var timeout=require(_0xc6d2('0x3'));var express=require('express');var router=express[_0xc6d2('0x4')]();var fs_extra=require(_0xc6d2('0x5'));var auth=require(_0xc6d2('0x6'));var interaction=require(_0xc6d2('0x7'));var config=require('../../config/environment');var controller=require(_0xc6d2('0x8'));router[_0xc6d2('0x9')]('/',auth['isAuthenticated'](),controller[_0xc6d2('0xa')]);router[_0xc6d2('0x9')](_0xc6d2('0xb'),auth[_0xc6d2('0xc')](),controller[_0xc6d2('0xd')]);router['get'](_0xc6d2('0xe'),auth[_0xc6d2('0xc')](),controller[_0xc6d2('0xf')]);router[_0xc6d2('0x9')](_0xc6d2('0x10'),auth[_0xc6d2('0xc')](),controller['getAgents']);router[_0xc6d2('0x11')]('/',auth['isAuthenticated'](),controller[_0xc6d2('0x12')]);router[_0xc6d2('0x11')](_0xc6d2('0x10'),auth['isAuthenticated'](),controller[_0xc6d2('0x13')]);router['put'](_0xc6d2('0xe'),auth[_0xc6d2('0xc')](),controller[_0xc6d2('0x14')]);router[_0xc6d2('0x15')](_0xc6d2('0xe'),auth[_0xc6d2('0xc')](),controller[_0xc6d2('0x16')]);router[_0xc6d2('0x15')](_0xc6d2('0x10'),auth[_0xc6d2('0xc')](),controller['removeAgents']);module[_0xc6d2('0x17')]=router;
\ No newline at end of file
+var _0xa4de=['isAuthenticated','describe','/:id','show','/:id/users','getAgents','post','create','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voicePrefix.controller','get'];(function(_0xd1793a,_0x5563fd){var _0x5b321=function(_0x52b983){while(--_0x52b983){_0xd1793a['push'](_0xd1793a['shift']());}};_0x5b321(++_0x5563fd);}(_0xa4de,0x1d1));var _0xea4d=function(_0x496a45,_0x2de9b2){_0x496a45=_0x496a45-0x0;var _0x5a381f=_0xa4de[_0x496a45];return _0x5a381f;};'use strict';var multer=require(_0xea4d('0x0'));var util=require(_0xea4d('0x1'));var path=require(_0xea4d('0x2'));var timeout=require(_0xea4d('0x3'));var express=require(_0xea4d('0x4'));var router=express[_0xea4d('0x5')]();var fs_extra=require(_0xea4d('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xea4d('0x7'));var controller=require(_0xea4d('0x8'));router[_0xea4d('0x9')]('/',auth[_0xea4d('0xa')](),controller['index']);router[_0xea4d('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xea4d('0xb')]);router['get'](_0xea4d('0xc'),auth[_0xea4d('0xa')](),controller[_0xea4d('0xd')]);router['get'](_0xea4d('0xe'),auth[_0xea4d('0xa')](),controller[_0xea4d('0xf')]);router[_0xea4d('0x10')]('/',auth[_0xea4d('0xa')](),controller[_0xea4d('0x11')]);router[_0xea4d('0x10')](_0xea4d('0xe'),auth[_0xea4d('0xa')](),controller[_0xea4d('0x12')]);router[_0xea4d('0x13')](_0xea4d('0xc'),auth['isAuthenticated'](),controller[_0xea4d('0x14')]);router['delete'](_0xea4d('0xc'),auth[_0xea4d('0xa')](),controller[_0xea4d('0x15')]);router[_0xea4d('0x16')](_0xea4d('0xe'),auth[_0xea4d('0xa')](),controller[_0xea4d('0x17')]);module[_0xea4d('0x18')]=router;
\ No newline at end of file
index 6b4bd3f..bf53c1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb694=['name','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0x27037c,_0x468fcd){var _0x442a0d=function(_0x5124c6){while(--_0x5124c6){_0x27037c['push'](_0x27037c['shift']());}};_0x442a0d(++_0x468fcd);}(_0xb694,0x177));var _0x4b69=function(_0x674c8c,_0x3def3a){_0x674c8c=_0x674c8c-0x0;var _0x58f9b1=_0xb694[_0x674c8c];return _0x58f9b1;};'use strict';var Sequelize=require(_0x4b69('0x0'));module[_0x4b69('0x1')]={'name':{'type':Sequelize[_0x4b69('0x2')],'allowNull':![],'unique':_0x4b69('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x449a56){return'system-'+this[_0x4b69('0x4')](_0x4b69('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x4b69('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x4b69('0x5')]}};
\ No newline at end of file
+var _0x2ac9=['VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING','name'];(function(_0x21e89e,_0x10fb19){var _0x5b1e25=function(_0x196574){while(--_0x196574){_0x21e89e['push'](_0x21e89e['shift']());}};_0x5b1e25(++_0x10fb19);}(_0x2ac9,0x10c));var _0x92ac=function(_0x30c71b,_0x30da84){_0x30c71b=_0x30c71b-0x0;var _0x21914b=_0x2ac9[_0x30c71b];return _0x21914b;};'use strict';var Sequelize=require(_0x92ac('0x0'));module[_0x92ac('0x1')]={'name':{'type':Sequelize[_0x92ac('0x2')],'allowNull':![],'unique':_0x92ac('0x3')},'prefix':{'type':Sequelize[_0x92ac('0x4')],'get':function(_0x15640f){return _0x92ac('0x5')+this[_0x92ac('0x6')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x92ac('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x92ac('0x7')]}};
\ No newline at end of file
index 98989c6..e1289ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2bf=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','index','map','VoicePrefix','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','describe','sequelize','transaction','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','VoicePrefixId','Extensions\x20creation\x20failed','Set','push','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','body','prefix','system-','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','findOne','pick','eml-format','request-promise','moment','mustache','path','sox','to-csv'];(function(_0x3c352e,_0x28aae2){var _0x32d611=function(_0x1739dd){while(--_0x1739dd){_0x3c352e['push'](_0x3c352e['shift']());}};_0x32d611(++_0x28aae2);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xd2bf[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0xfd2b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfd2b('0x1'));var moment=require(_0xfd2b('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xfd2b('0x3'));var util=require('util');var path=require(_0xfd2b('0x4'));var sox=require(_0xfd2b('0x5'));var csv=require(_0xfd2b('0x6'));var ejs=require(_0xfd2b('0x7'));var fs=require('fs');var fs_extra=require(_0xfd2b('0x8'));var _=require('lodash');var squel=require(_0xfd2b('0x9'));var crypto=require(_0xfd2b('0xa'));var jsforce=require(_0xfd2b('0xb'));var deskjs=require(_0xfd2b('0xc'));var toCsv=require(_0xfd2b('0x6'));var querystring=require(_0xfd2b('0xd'));var Papa=require(_0xfd2b('0xe'));var Redis=require(_0xfd2b('0xf'));var authService=require(_0xfd2b('0x10'));var qs=require(_0xfd2b('0x11'));var as=require(_0xfd2b('0x12'));var hardwareService=require(_0xfd2b('0x13'));var logger=require(_0xfd2b('0x14'))(_0xfd2b('0x15'));var utils=require('../../config/utils');var config=require(_0xfd2b('0x16'));var licenseUtil=require(_0xfd2b('0x17'));var db=require(_0xfd2b('0x18'))['db'];config['redis']=_[_0xfd2b('0x19')](config['redis'],{'host':_0xfd2b('0x1a'),'port':0x18eb});var socket=require(_0xfd2b('0x1b'))(new Redis(config[_0xfd2b('0x1c')]));require('./voicePrefix.socket')[_0xfd2b('0x1d')](socket);function respondWithStatusCode(_0x1be5d8,_0x2bc40c){_0x2bc40c=_0x2bc40c||0xcc;return function(_0x3ef7ef){if(_0x3ef7ef){return _0x1be5d8[_0xfd2b('0x1e')](_0x2bc40c);}return _0x1be5d8['status'](_0x2bc40c)[_0xfd2b('0x1f')]();};}function respondWithResult(_0x130b62,_0x374c92){_0x374c92=_0x374c92||0xc8;return function(_0xba0085){if(_0xba0085){return _0x130b62[_0xfd2b('0x20')](_0x374c92)[_0xfd2b('0x21')](_0xba0085);}};}function respondWithFilteredResult(_0x47c36b,_0x4df522){return function(_0x2ebf14){if(_0x2ebf14){var _0x738bd=typeof _0x4df522[_0xfd2b('0x22')]===_0xfd2b('0x23')&&typeof _0x4df522[_0xfd2b('0x24')]==='undefined';var _0x157817=_0x2ebf14[_0xfd2b('0x25')];var _0x378eed=_0x738bd?0x0:_0x4df522[_0xfd2b('0x22')];var _0x5186bc=_0x738bd?_0x2ebf14[_0xfd2b('0x25')]:_0x4df522[_0xfd2b('0x22')]+_0x4df522[_0xfd2b('0x24')];var _0x4d31ba;if(_0x5186bc>=_0x157817){_0x5186bc=_0x157817;_0x4d31ba=0xc8;}else{_0x4d31ba=0xce;}_0x47c36b[_0xfd2b('0x20')](_0x4d31ba);return _0x47c36b[_0xfd2b('0x26')](_0xfd2b('0x27'),_0x378eed+'-'+_0x5186bc+'/'+_0x157817)[_0xfd2b('0x21')](_0x2ebf14);}return null;};}function patchUpdates(_0x4b15ed){return function(_0x3c9ffa){try{jsonpatch['apply'](_0x3c9ffa,_0x4b15ed,!![]);}catch(_0x17fb6f){return BPromise[_0xfd2b('0x28')](_0x17fb6f);}return _0x3c9ffa['save']();};}function saveUpdates(_0x337f15,_0x17ec35){return function(_0x2f1f75){if(_0x2f1f75){return _0x2f1f75[_0xfd2b('0x29')](_0x337f15)[_0xfd2b('0x2a')](function(_0x222eed){return _0x222eed;});}return null;};}function removeEntity(_0x1cd6d5,_0x983c56){return function(_0xe895ef){if(_0xe895ef){return _0xe895ef['destroy']()[_0xfd2b('0x2a')](function(){var _0x1b7126=_0xe895ef[_0xfd2b('0x2b')]({'plain':!![]});var _0x2ae821=_0xfd2b('0x2c');return db[_0xfd2b('0x2d')][_0xfd2b('0x2e')]({'where':{'type':_0x2ae821,'resourceId':_0x1b7126['id']}})['then'](function(){return _0xe895ef;});})[_0xfd2b('0x2a')](function(){_0x1cd6d5['status'](0xcc)[_0xfd2b('0x1f')]();});}};}function handleEntityNotFound(_0x1fbcff,_0x160c54){return function(_0x38a250){if(!_0x38a250){_0x1fbcff[_0xfd2b('0x1e')](0x194);}return _0x38a250;};}function handleError(_0x466a7c,_0x2b5530){_0x2b5530=_0x2b5530||0x1f4;return function(_0x93a02f){logger[_0xfd2b('0x2f')](_0x93a02f[_0xfd2b('0x30')]);if(_0x93a02f[_0xfd2b('0x31')]){delete _0x93a02f[_0xfd2b('0x31')];}_0x466a7c[_0xfd2b('0x20')](_0x2b5530)['send'](_0x93a02f);};}exports[_0xfd2b('0x32')]=function(_0x9ea48a,_0xe101ed){var _0x2ffc01={},_0x36117a={},_0x55bcd4={'count':0x0,'rows':[]};var _0x40e166=_[_0xfd2b('0x33')](db[_0xfd2b('0x34')][_0xfd2b('0x35')],function(_0x680ae4){return{'name':_0x680ae4['fieldName'],'type':_0x680ae4['type'][_0xfd2b('0x36')]};});_0x36117a[_0xfd2b('0x37')]=_['map'](_0x40e166,'name');_0x36117a[_0xfd2b('0x38')]=_[_0xfd2b('0x39')](_0x9ea48a[_0xfd2b('0x38')]);_0x36117a[_0xfd2b('0x3a')]=_[_0xfd2b('0x3b')](_0x36117a[_0xfd2b('0x37')],_0x36117a[_0xfd2b('0x38')]);_0x2ffc01['attributes']=_[_0xfd2b('0x3b')](_0x36117a['model'],qs[_0xfd2b('0x3c')](_0x9ea48a['query'][_0xfd2b('0x3c')]));_0x2ffc01[_0xfd2b('0x3d')]=_0x2ffc01[_0xfd2b('0x3d')][_0xfd2b('0x3e')]?_0x2ffc01['attributes']:_0x36117a[_0xfd2b('0x37')];if(!_0x9ea48a[_0xfd2b('0x38')][_0xfd2b('0x3f')](_0xfd2b('0x40'))){_0x2ffc01[_0xfd2b('0x24')]=qs['limit'](_0x9ea48a[_0xfd2b('0x38')][_0xfd2b('0x24')]);_0x2ffc01[_0xfd2b('0x22')]=qs[_0xfd2b('0x22')](_0x9ea48a[_0xfd2b('0x38')][_0xfd2b('0x22')]);}_0x2ffc01[_0xfd2b('0x41')]=qs[_0xfd2b('0x42')](_0x9ea48a['query'][_0xfd2b('0x42')]);_0x2ffc01[_0xfd2b('0x43')]=qs['filters'](_['pick'](_0x9ea48a[_0xfd2b('0x38')],_0x36117a['filters']),_0x40e166);if(_0x9ea48a[_0xfd2b('0x38')][_0xfd2b('0x44')]){_0x2ffc01['where']=_['merge'](_0x2ffc01['where'],{'$or':_[_0xfd2b('0x33')](_0x40e166,function(_0x2c2424){if(_0x2c2424[_0xfd2b('0x45')]!==_0xfd2b('0x46')){var _0x67d7ef={};_0x67d7ef[_0x2c2424['name']]={'$like':'%'+_0x9ea48a[_0xfd2b('0x38')][_0xfd2b('0x44')]+'%'};return _0x67d7ef;}})});}_0x2ffc01=_[_0xfd2b('0x47')]({},_0x2ffc01,_0x9ea48a[_0xfd2b('0x48')]);var _0x357792={'where':_0x2ffc01[_0xfd2b('0x43')]};return db['VoicePrefix'][_0xfd2b('0x25')](_0x357792)[_0xfd2b('0x2a')](function(_0x3a295b){_0x55bcd4[_0xfd2b('0x25')]=_0x3a295b;if(_0x9ea48a[_0xfd2b('0x38')][_0xfd2b('0x49')]){_0x2ffc01[_0xfd2b('0x4a')]=[{'all':!![]}];}return db[_0xfd2b('0x34')][_0xfd2b('0x4b')](_0x2ffc01);})[_0xfd2b('0x2a')](function(_0x2763a7){_0x55bcd4[_0xfd2b('0x4c')]=_0x2763a7;return _0x55bcd4;})['then'](respondWithFilteredResult(_0xe101ed,_0x2ffc01))[_0xfd2b('0x4d')](handleError(_0xe101ed,null));};exports[_0xfd2b('0x4e')]=function(_0x362c08,_0x30375a){var _0x55f1bd={'raw':![],'where':{'id':_0x362c08[_0xfd2b('0x4f')]['id']}},_0x43af41={};_0x43af41[_0xfd2b('0x37')]=_[_0xfd2b('0x39')](db[_0xfd2b('0x34')]['rawAttributes']);_0x43af41[_0xfd2b('0x38')]=_[_0xfd2b('0x39')](_0x362c08[_0xfd2b('0x38')]);_0x43af41[_0xfd2b('0x3a')]=_[_0xfd2b('0x3b')](_0x43af41[_0xfd2b('0x37')],_0x43af41['query']);_0x55f1bd['attributes']=_[_0xfd2b('0x3b')](_0x43af41[_0xfd2b('0x37')],qs[_0xfd2b('0x3c')](_0x362c08[_0xfd2b('0x38')][_0xfd2b('0x3c')]));_0x55f1bd[_0xfd2b('0x3d')]=_0x55f1bd[_0xfd2b('0x3d')]['length']?_0x55f1bd[_0xfd2b('0x3d')]:_0x43af41['model'];if(_0x362c08[_0xfd2b('0x38')][_0xfd2b('0x49')]){_0x55f1bd[_0xfd2b('0x4a')]=[{'all':!![]}];}_0x55f1bd=_[_0xfd2b('0x47')]({},_0x55f1bd,_0x362c08[_0xfd2b('0x48')]);return db[_0xfd2b('0x34')][_0xfd2b('0x50')](_0x55f1bd)[_0xfd2b('0x2a')](handleEntityNotFound(_0x30375a,null))[_0xfd2b('0x2a')](respondWithResult(_0x30375a,null))['catch'](handleError(_0x30375a,null));};exports[_0xfd2b('0x2e')]=function(_0x23517d,_0x142b6d){return db[_0xfd2b('0x34')]['find']({'where':{'id':_0x23517d[_0xfd2b('0x4f')]['id']}})[_0xfd2b('0x2a')](handleEntityNotFound(_0x142b6d,null))[_0xfd2b('0x2a')](removeEntity(_0x142b6d,null))[_0xfd2b('0x4d')](handleError(_0x142b6d,null));};exports['describe']=function(_0x5c416a,_0x301b57){return db['VoicePrefix'][_0xfd2b('0x51')]()['then'](respondWithResult(_0x301b57,null))[_0xfd2b('0x4d')](handleError(_0x301b57,null));};exports['create']=function(_0x5286e6,_0x2f2964){var _0xc8ff11;return db[_0xfd2b('0x52')][_0xfd2b('0x53')](function(_0x4d0ea5){return db[_0xfd2b('0x34')]['create'](_0x5286e6['body'],{'transaction':_0x4d0ea5})[_0xfd2b('0x2a')](function(_0xad2a42){_0xc8ff11=_0xad2a42[_0xfd2b('0x2b')]({'plain':!![]});return db[_0xfd2b('0x54')][_0xfd2b('0x50')]({'where':{'id':_0xc8ff11[_0xfd2b('0x55')]},'raw':!![]})[_0xfd2b('0x2a')](function(_0x35ce47){return createVoicePrefixExtensions(_0xc8ff11,_0x35ce47,_0x4d0ea5);});});})[_0xfd2b('0x2a')](function(){var _0x5d0d53=_0x5286e6['user'][_0xfd2b('0x2b')]({'plain':!![]});if(!_0x5d0d53)throw new Error(_0xfd2b('0x56'));if(_0x5d0d53[_0xfd2b('0x57')]===_0xfd2b('0x58')){var _0x523d58=_0xc8ff11;return db[_0xfd2b('0x59')][_0xfd2b('0x50')]({'where':{'name':_0xfd2b('0x2c'),'userProfileId':_0x5d0d53[_0xfd2b('0x5a')]},'raw':!![]})['then'](function(_0x2a9c31){if(_0x2a9c31&&_0x2a9c31['autoAssociation']===0x0){return db[_0xfd2b('0x2d')]['create']({'name':_0x523d58[_0xfd2b('0x31')],'resourceId':_0x523d58['id'],'type':_0x2a9c31[_0xfd2b('0x31')],'sectionId':_0x2a9c31['id']},{})[_0xfd2b('0x2a')](function(){return _0xc8ff11;});}else{return _0xc8ff11;}})['catch'](function(_0x281d2c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x281d2c);throw _0x281d2c;});}return _0xc8ff11;})['then'](respondWithResult(_0x2f2964,null))[_0xfd2b('0x4d')](handleError(_0x2f2964,null));};function Extension(_0x18c286,_0x2a1e8a,_0x4e1aa6,_0xd6e004){this['context']=_0xfd2b('0x5b');this['exten']=_0x18c286;this[_0xfd2b('0x5c')]=_0x4e1aa6;this['type']=_0xfd2b('0x5d');this[_0xfd2b('0x5e')]=_0xfd2b('0x5f');this[_0xfd2b('0x60')]=_0x2a1e8a;this[_0xfd2b('0x61')]=_0xd6e004;}function createVoicePrefixExtensions(_0x4a432e,_0x432768,_0x4677ab){return new BPromise(function(_0x2beae8,_0x11903b){var _0x58c215=new Extension(formatPrefixName(_0x4a432e['prefix']),0x1,'NoOp','Voice\x20Prefix');_0x58c215[_0xfd2b('0x62')]=_0x4a432e['id'];return db[_0xfd2b('0x54')]['create'](_0x58c215,{'transaction':_0x4677ab})[_0xfd2b('0x2a')](function(_0x3e5ff7){var _0x58d81b=_0x3e5ff7[_0xfd2b('0x2b')]({'plain':!![]});var _0xf690f6=_[_0xfd2b('0x33')](addVoicePrefixExtensions(_0x4a432e,_0x432768),function(_0x222d9a){_0x222d9a[_0xfd2b('0x55')]=_0x58d81b['id'];_0x222d9a[_0xfd2b('0x62')]=_0x4a432e['id'];return _0x222d9a;});return db[_0xfd2b('0x54')]['bulkCreate'](_0xf690f6,{'transaction':_0x4677ab})['then'](function(_0x488c1c){if(!_0x488c1c){return _0x11903b(_0xfd2b('0x63'));}else{return _0x2beae8(_0x488c1c);}})[_0xfd2b('0x4d')](function(_0xa5f440){return _0x11903b(_0xa5f440);});});;});};function addVoicePrefixExtensions(_0x35e4d6,_0x3c129a){var _0x378262=[];var _0x3bce98=formatPrefixName(_0x35e4d6['prefix']);_0x378262['push'](new Extension(_0x3bce98,0x2,_0xfd2b('0x64'),'CDR(prefix)='+_0x35e4d6[_0xfd2b('0x31')]));if(_0x35e4d6['callerIdAll']){_0x378262[_0xfd2b('0x65')](new Extension(_0x3bce98,0x3,'Set',_0xfd2b('0x66')+_0x35e4d6['callerIdAll']));}else{_0x378262['push'](new Extension(_0x3bce98,0x3,'NoOp','No\x20callerid\x20available'));}_0x378262[_0xfd2b('0x65')](new Extension(_0x3bce98,0x4,_0xfd2b('0x67'),_0x3c129a['context']+','+_0xfd2b('0x68')+(0x8+_0x35e4d6[_0xfd2b('0x31')][_0xfd2b('0x3e')])+'}'+','+0x1));return _0x378262;}function formatPrefixName(_0x2b0454){var _0x3071e8='_';for(var _0x50ad56=0x0;_0x50ad56<_0x2b0454['length'];_0x50ad56++){if(_0x2b0454[_0xfd2b('0x69')](_0x50ad56)=='-'){_0x3071e8+=_0x2b0454[_0xfd2b('0x69')](_0x50ad56);}else{_0x3071e8+='['+_0x2b0454[_0xfd2b('0x69')](_0x50ad56)+']';}}_0x3071e8+='.';return _0x3071e8;}exports['update']=function(_0x517adb,_0x233477,_0x60eabd){var _0x4322b5=_0x517adb[_0xfd2b('0x6a')];_0x4322b5[_0xfd2b('0x6b')]=_0xfd2b('0x6c')+_0x4322b5[_0xfd2b('0x31')]+'-';return db[_0xfd2b('0x52')][_0xfd2b('0x53')](function(_0x271150){return db[_0xfd2b('0x34')][_0xfd2b('0x29')](_0x4322b5,{'where':{'id':_0x4322b5['id']},'transaction':_0x271150})[_0xfd2b('0x2a')](function(){return db[_0xfd2b('0x54')]['destroy']({'where':{'VoicePrefixId':_0x4322b5['id']},'transaction':_0x271150})[_0xfd2b('0x2a')](function(){return db[_0xfd2b('0x54')][_0xfd2b('0x50')]({'where':{'id':_0x4322b5['VoiceExtensionId']},'raw':!![]})['then'](function(_0x144e48){return createVoicePrefixExtensions(_0x4322b5,_0x144e48,_0x271150);});});});})[_0xfd2b('0x2a')](function(){return db[_0xfd2b('0x34')][_0xfd2b('0x6d')](_0x4322b5['id']);})[_0xfd2b('0x2a')](respondWithResult(_0x233477,null))[_0xfd2b('0x4d')](handleError(_0x233477,null));};exports['addAgents']=function(_0x4df15b,_0x392a5c,_0x112958){return db[_0xfd2b('0x34')][_0xfd2b('0x50')]({'where':{'id':_0x4df15b[_0xfd2b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x392a5c,null))[_0xfd2b('0x2a')](function(_0x2b680c){if(_0x2b680c){return _0x2b680c[_0xfd2b('0x6e')](_0x4df15b['body'][_0xfd2b('0x6f')],_[_0xfd2b('0x70')](_0x4df15b['body'],[_0xfd2b('0x6f'),'id'])||{})[_0xfd2b('0x71')](function(_0x470ec0){for(var _0x1b78d6=0x0;_0x1b78d6<_0x4df15b[_0xfd2b('0x6a')][_0xfd2b('0x6f')]['length'];_0x1b78d6+=0x1){socket['emit'](_0xfd2b('0x72'),{'UserId':Number(_0x4df15b[_0xfd2b('0x6a')][_0xfd2b('0x6f')][_0x1b78d6]),'VoicePrefixId':Number(_0x4df15b[_0xfd2b('0x4f')]['id'])});}return _0x470ec0;});}})[_0xfd2b('0x2a')](respondWithResult(_0x392a5c,null))[_0xfd2b('0x4d')](handleError(_0x392a5c,null));};exports[_0xfd2b('0x73')]=function(_0x4abf41,_0xb39591,_0x36bb67){return db['VoicePrefix']['find']({'where':{'id':_0x4abf41[_0xfd2b('0x4f')]['id']}})['then'](handleEntityNotFound(_0xb39591,null))[_0xfd2b('0x2a')](function(_0x1b1875){if(_0x1b1875){return _0x1b1875[_0xfd2b('0x73')](_0x4abf41[_0xfd2b('0x38')][_0xfd2b('0x6f')])[_0xfd2b('0x2a')](function(){if(_['isArray'](_0x4abf41[_0xfd2b('0x38')]['ids'])){for(var _0x35ce5a=0x0;_0x35ce5a<_0x4abf41[_0xfd2b('0x38')][_0xfd2b('0x6f')][_0xfd2b('0x3e')];_0x35ce5a+=0x1){socket[_0xfd2b('0x74')]('userVoicePrefix:remove',{'UserId':Number(_0x4abf41[_0xfd2b('0x38')][_0xfd2b('0x6f')][_0x35ce5a]),'VoicePrefixId':Number(_0x4abf41['params']['id'])});}}else{socket['emit'](_0xfd2b('0x75'),{'UserId':Number(_0x4abf41[_0xfd2b('0x38')][_0xfd2b('0x6f')]),'VoicePrefixId':Number(_0x4abf41['params']['id'])});}});}})[_0xfd2b('0x2a')](respondWithStatusCode(_0xb39591,null))[_0xfd2b('0x4d')](handleError(_0xb39591,null));};exports[_0xfd2b('0x76')]=function(_0x20cad3,_0x2184f8,_0x2e91aa){var _0xfc1338={};var _0x252ca8={};var _0x18623a;var _0x2f6319;return db[_0xfd2b('0x34')][_0xfd2b('0x77')]({'where':{'id':_0x20cad3[_0xfd2b('0x4f')]['id']}})[_0xfd2b('0x2a')](handleEntityNotFound(_0x2184f8,null))[_0xfd2b('0x2a')](function(_0x5025c6){if(_0x5025c6){_0x18623a=_0x5025c6;_0x252ca8[_0xfd2b('0x37')]=_[_0xfd2b('0x39')](db['User'][_0xfd2b('0x35')]);_0x252ca8[_0xfd2b('0x38')]=_['keys'](_0x20cad3[_0xfd2b('0x38')]);_0x252ca8[_0xfd2b('0x3a')]=_['intersection'](_0x252ca8[_0xfd2b('0x37')],_0x252ca8[_0xfd2b('0x38')]);_0xfc1338[_0xfd2b('0x3d')]=_[_0xfd2b('0x3b')](_0x252ca8[_0xfd2b('0x37')],qs[_0xfd2b('0x3c')](_0x20cad3[_0xfd2b('0x38')][_0xfd2b('0x3c')]));_0xfc1338[_0xfd2b('0x3d')]=_0xfc1338[_0xfd2b('0x3d')]['length']?_0xfc1338['attributes']:_0x252ca8['model'];_0xfc1338['order']=qs[_0xfd2b('0x42')](_0x20cad3[_0xfd2b('0x38')][_0xfd2b('0x42')]);_0xfc1338[_0xfd2b('0x43')]=qs['filters'](_[_0xfd2b('0x78')](_0x20cad3[_0xfd2b('0x38')],_0x252ca8['filters']));if(_0x20cad3[_0xfd2b('0x38')][_0xfd2b('0x44')]){_0xfc1338[_0xfd2b('0x43')]=_[_0xfd2b('0x47')](_0xfc1338[_0xfd2b('0x43')],{'$or':_[_0xfd2b('0x33')](_0xfc1338[_0xfd2b('0x3d')],function(_0x5044d6){var _0x4eef78={};_0x4eef78[_0x5044d6]={'$like':'%'+_0x20cad3[_0xfd2b('0x38')][_0xfd2b('0x44')]+'%'};return _0x4eef78;})});}_0xfc1338=_[_0xfd2b('0x47')]({},_0xfc1338,_0x20cad3[_0xfd2b('0x48')]);return _0x18623a[_0xfd2b('0x76')](_0xfc1338);}})['then'](function(_0x1a4902){if(_0x1a4902){_0x2f6319=_0x1a4902[_0xfd2b('0x3e')];if(!_0x20cad3[_0xfd2b('0x38')][_0xfd2b('0x3f')]('nolimit')){_0xfc1338['limit']=qs[_0xfd2b('0x24')](_0x20cad3[_0xfd2b('0x38')][_0xfd2b('0x24')]);_0xfc1338[_0xfd2b('0x22')]=qs['offset'](_0x20cad3[_0xfd2b('0x38')]['offset']);}return _0x18623a[_0xfd2b('0x76')](_0xfc1338);}})[_0xfd2b('0x2a')](function(_0x4ef2c3){if(_0x4ef2c3){return _0x4ef2c3?{'count':_0x2f6319,'rows':_0x4ef2c3}:null;}})[_0xfd2b('0x2a')](respondWithResult(_0x2184f8,null))[_0xfd2b('0x4d')](handleError(_0x2184f8,null));};
\ No newline at end of file
+var _0x3306=['callerIdAll','PREFIX-CALLERIDALL=','goto','${EXTEN:','charAt','system-','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','User','hasOwnProperty','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','end','status','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','VoicePrefixes','UserProfileResource','sendStatus','stack','name','send','VoicePrefix','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','options','includeAll','include','catch','show','params','find','create','sequelize','transaction','body','get','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)='];(function(_0x265dcb,_0x43d7d4){var _0x28fac1=function(_0x15a435){while(--_0x15a435){_0x265dcb['push'](_0x265dcb['shift']());}};_0x28fac1(++_0x43d7d4);}(_0x3306,0x107));var _0x6330=function(_0x4d6c70,_0x395db1){_0x4d6c70=_0x4d6c70-0x0;var _0x3470f3=_0x3306[_0x4d6c70];return _0x3470f3;};'use strict';var emlformat=require(_0x6330('0x0'));var rimraf=require(_0x6330('0x1'));var zipdir=require(_0x6330('0x2'));var jsonpatch=require(_0x6330('0x3'));var rp=require('request-promise');var moment=require(_0x6330('0x4'));var BPromise=require(_0x6330('0x5'));var Mustache=require(_0x6330('0x6'));var util=require(_0x6330('0x7'));var path=require(_0x6330('0x8'));var sox=require('sox');var csv=require(_0x6330('0x9'));var ejs=require(_0x6330('0xa'));var fs=require('fs');var fs_extra=require(_0x6330('0xb'));var _=require(_0x6330('0xc'));var squel=require(_0x6330('0xd'));var crypto=require(_0x6330('0xe'));var jsforce=require(_0x6330('0xf'));var deskjs=require(_0x6330('0x10'));var toCsv=require(_0x6330('0x9'));var querystring=require(_0x6330('0x11'));var Papa=require('papaparse');var Redis=require(_0x6330('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6330('0x13'));var as=require(_0x6330('0x14'));var hardwareService=require(_0x6330('0x15'));var logger=require(_0x6330('0x16'))(_0x6330('0x17'));var utils=require(_0x6330('0x18'));var config=require(_0x6330('0x19'));var licenseUtil=require(_0x6330('0x1a'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6330('0x1b')](config[_0x6330('0x1c')],{'host':_0x6330('0x1d'),'port':0x18eb});var socket=require(_0x6330('0x1e'))(new Redis(config[_0x6330('0x1c')]));require('./voicePrefix.socket')[_0x6330('0x1f')](socket);function respondWithStatusCode(_0x38367a,_0x11306d){_0x11306d=_0x11306d||0xcc;return function(_0xd5cf27){if(_0xd5cf27){return _0x38367a['sendStatus'](_0x11306d);}return _0x38367a['status'](_0x11306d)[_0x6330('0x20')]();};}function respondWithResult(_0x476774,_0x3c3fac){_0x3c3fac=_0x3c3fac||0xc8;return function(_0x5b155d){if(_0x5b155d){return _0x476774[_0x6330('0x21')](_0x3c3fac)[_0x6330('0x22')](_0x5b155d);}};}function respondWithFilteredResult(_0x5a643e,_0x5c35fa){return function(_0x348b34){if(_0x348b34){var _0x29fd07=typeof _0x5c35fa[_0x6330('0x23')]===_0x6330('0x24')&&typeof _0x5c35fa[_0x6330('0x25')]===_0x6330('0x24');var _0xfbafd6=_0x348b34[_0x6330('0x26')];var _0x1080e9=_0x29fd07?0x0:_0x5c35fa[_0x6330('0x23')];var _0x55790e=_0x29fd07?_0x348b34[_0x6330('0x26')]:_0x5c35fa[_0x6330('0x23')]+_0x5c35fa[_0x6330('0x25')];var _0x3c8ce5;if(_0x55790e>=_0xfbafd6){_0x55790e=_0xfbafd6;_0x3c8ce5=0xc8;}else{_0x3c8ce5=0xce;}_0x5a643e[_0x6330('0x21')](_0x3c8ce5);return _0x5a643e['set'](_0x6330('0x27'),_0x1080e9+'-'+_0x55790e+'/'+_0xfbafd6)[_0x6330('0x22')](_0x348b34);}return null;};}function patchUpdates(_0x282809){return function(_0x1a6169){try{jsonpatch[_0x6330('0x28')](_0x1a6169,_0x282809,!![]);}catch(_0x186b91){return BPromise['reject'](_0x186b91);}return _0x1a6169['save']();};}function saveUpdates(_0x59144c,_0xd535b9){return function(_0x3f5ee7){if(_0x3f5ee7){return _0x3f5ee7[_0x6330('0x29')](_0x59144c)[_0x6330('0x2a')](function(_0x5899f8){return _0x5899f8;});}return null;};}function removeEntity(_0x10ea33,_0x25aa25){return function(_0xba8b22){if(_0xba8b22){return _0xba8b22[_0x6330('0x2b')]()[_0x6330('0x2a')](function(){var _0x4cf9d9=_0xba8b22['get']({'plain':!![]});var _0x255861=_0x6330('0x2c');return db[_0x6330('0x2d')]['destroy']({'where':{'type':_0x255861,'resourceId':_0x4cf9d9['id']}})[_0x6330('0x2a')](function(){return _0xba8b22;});})[_0x6330('0x2a')](function(){_0x10ea33[_0x6330('0x21')](0xcc)[_0x6330('0x20')]();});}};}function handleEntityNotFound(_0x4a55c4,_0x46011b){return function(_0x50ab51){if(!_0x50ab51){_0x4a55c4[_0x6330('0x2e')](0x194);}return _0x50ab51;};}function handleError(_0x43799b,_0x366232){_0x366232=_0x366232||0x1f4;return function(_0x3e8efc){logger['error'](_0x3e8efc[_0x6330('0x2f')]);if(_0x3e8efc[_0x6330('0x30')]){delete _0x3e8efc[_0x6330('0x30')];}_0x43799b[_0x6330('0x21')](_0x366232)[_0x6330('0x31')](_0x3e8efc);};}exports['index']=function(_0x40514b,_0x47ce15){var _0xaaf11d={},_0x5d01b3={},_0x1ccca0={'count':0x0,'rows':[]};var _0x4e9a28=_['map'](db[_0x6330('0x32')][_0x6330('0x33')],function(_0x2cff0f){return{'name':_0x2cff0f[_0x6330('0x34')],'type':_0x2cff0f[_0x6330('0x35')][_0x6330('0x36')]};});_0x5d01b3[_0x6330('0x37')]=_[_0x6330('0x38')](_0x4e9a28,_0x6330('0x30'));_0x5d01b3[_0x6330('0x39')]=_[_0x6330('0x3a')](_0x40514b[_0x6330('0x39')]);_0x5d01b3['filters']=_[_0x6330('0x3b')](_0x5d01b3['model'],_0x5d01b3[_0x6330('0x39')]);_0xaaf11d[_0x6330('0x3c')]=_[_0x6330('0x3b')](_0x5d01b3[_0x6330('0x37')],qs[_0x6330('0x3d')](_0x40514b[_0x6330('0x39')][_0x6330('0x3d')]));_0xaaf11d[_0x6330('0x3c')]=_0xaaf11d[_0x6330('0x3c')][_0x6330('0x3e')]?_0xaaf11d['attributes']:_0x5d01b3[_0x6330('0x37')];if(!_0x40514b[_0x6330('0x39')]['hasOwnProperty']('nolimit')){_0xaaf11d[_0x6330('0x25')]=qs['limit'](_0x40514b[_0x6330('0x39')][_0x6330('0x25')]);_0xaaf11d[_0x6330('0x23')]=qs[_0x6330('0x23')](_0x40514b[_0x6330('0x39')][_0x6330('0x23')]);}_0xaaf11d[_0x6330('0x3f')]=qs[_0x6330('0x40')](_0x40514b['query'][_0x6330('0x40')]);_0xaaf11d[_0x6330('0x41')]=qs[_0x6330('0x42')](_['pick'](_0x40514b['query'],_0x5d01b3[_0x6330('0x42')]),_0x4e9a28);if(_0x40514b[_0x6330('0x39')][_0x6330('0x43')]){_0xaaf11d['where']=_['merge'](_0xaaf11d['where'],{'$or':_['map'](_0x4e9a28,function(_0x57c19b){if(_0x57c19b[_0x6330('0x35')]!=='VIRTUAL'){var _0x4909f2={};_0x4909f2[_0x57c19b[_0x6330('0x30')]]={'$like':'%'+_0x40514b[_0x6330('0x39')][_0x6330('0x43')]+'%'};return _0x4909f2;}})});}_0xaaf11d=_[_0x6330('0x44')]({},_0xaaf11d,_0x40514b[_0x6330('0x45')]);var _0x146459={'where':_0xaaf11d[_0x6330('0x41')]};return db[_0x6330('0x32')][_0x6330('0x26')](_0x146459)[_0x6330('0x2a')](function(_0x531c8a){_0x1ccca0[_0x6330('0x26')]=_0x531c8a;if(_0x40514b[_0x6330('0x39')][_0x6330('0x46')]){_0xaaf11d[_0x6330('0x47')]=[{'all':!![]}];}return db[_0x6330('0x32')]['findAll'](_0xaaf11d);})[_0x6330('0x2a')](function(_0x10811e){_0x1ccca0['rows']=_0x10811e;return _0x1ccca0;})[_0x6330('0x2a')](respondWithFilteredResult(_0x47ce15,_0xaaf11d))[_0x6330('0x48')](handleError(_0x47ce15,null));};exports[_0x6330('0x49')]=function(_0x5aaea3,_0x1fc396){var _0x233ac5={'raw':![],'where':{'id':_0x5aaea3[_0x6330('0x4a')]['id']}},_0x1a24c4={};_0x1a24c4[_0x6330('0x37')]=_['keys'](db[_0x6330('0x32')][_0x6330('0x33')]);_0x1a24c4[_0x6330('0x39')]=_[_0x6330('0x3a')](_0x5aaea3[_0x6330('0x39')]);_0x1a24c4[_0x6330('0x42')]=_[_0x6330('0x3b')](_0x1a24c4['model'],_0x1a24c4[_0x6330('0x39')]);_0x233ac5[_0x6330('0x3c')]=_['intersection'](_0x1a24c4['model'],qs['fields'](_0x5aaea3[_0x6330('0x39')]['fields']));_0x233ac5[_0x6330('0x3c')]=_0x233ac5['attributes']['length']?_0x233ac5[_0x6330('0x3c')]:_0x1a24c4[_0x6330('0x37')];if(_0x5aaea3[_0x6330('0x39')][_0x6330('0x46')]){_0x233ac5['include']=[{'all':!![]}];}_0x233ac5=_[_0x6330('0x44')]({},_0x233ac5,_0x5aaea3[_0x6330('0x45')]);return db['VoicePrefix'][_0x6330('0x4b')](_0x233ac5)['then'](handleEntityNotFound(_0x1fc396,null))[_0x6330('0x2a')](respondWithResult(_0x1fc396,null))[_0x6330('0x48')](handleError(_0x1fc396,null));};exports[_0x6330('0x2b')]=function(_0x203d86,_0x395f11){return db[_0x6330('0x32')][_0x6330('0x4b')]({'where':{'id':_0x203d86['params']['id']}})[_0x6330('0x2a')](handleEntityNotFound(_0x395f11,null))[_0x6330('0x2a')](removeEntity(_0x395f11,null))[_0x6330('0x48')](handleError(_0x395f11,null));};exports['describe']=function(_0x3365a0,_0x4a1af6){return db[_0x6330('0x32')]['describe']()[_0x6330('0x2a')](respondWithResult(_0x4a1af6,null))[_0x6330('0x48')](handleError(_0x4a1af6,null));};exports[_0x6330('0x4c')]=function(_0xcefa3c,_0xb0e9cc){var _0x59c5e4;return db[_0x6330('0x4d')][_0x6330('0x4e')](function(_0x1c6fda){return db[_0x6330('0x32')][_0x6330('0x4c')](_0xcefa3c[_0x6330('0x4f')],{'transaction':_0x1c6fda})['then'](function(_0x471df6){_0x59c5e4=_0x471df6[_0x6330('0x50')]({'plain':!![]});return db[_0x6330('0x51')][_0x6330('0x4b')]({'where':{'id':_0x59c5e4[_0x6330('0x52')]},'raw':!![]})[_0x6330('0x2a')](function(_0x54010d){return createVoicePrefixExtensions(_0x59c5e4,_0x54010d,_0x1c6fda);});});})[_0x6330('0x2a')](function(){var _0x1ff69b=_0xcefa3c[_0x6330('0x53')][_0x6330('0x50')]({'plain':!![]});if(!_0x1ff69b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1ff69b[_0x6330('0x54')]==='user'){var _0xa4c663=_0x59c5e4;return db[_0x6330('0x55')][_0x6330('0x4b')]({'where':{'name':'VoicePrefixes','userProfileId':_0x1ff69b[_0x6330('0x56')]},'raw':!![]})[_0x6330('0x2a')](function(_0x451db0){if(_0x451db0&&_0x451db0[_0x6330('0x57')]===0x0){return db[_0x6330('0x2d')][_0x6330('0x4c')]({'name':_0xa4c663['name'],'resourceId':_0xa4c663['id'],'type':_0x451db0[_0x6330('0x30')],'sectionId':_0x451db0['id']},{})['then'](function(){return _0x59c5e4;});}else{return _0x59c5e4;}})['catch'](function(_0xfa70bf){logger[_0x6330('0x58')](_0x6330('0x59'),_0xfa70bf);throw _0xfa70bf;});}return _0x59c5e4;})[_0x6330('0x2a')](respondWithResult(_0xb0e9cc,null))['catch'](handleError(_0xb0e9cc,null));};function Extension(_0x223609,_0x5cad4b,_0x1067f1,_0x6f6cf6){this[_0x6330('0x5a')]=_0x6330('0x5b');this['exten']=_0x223609;this[_0x6330('0x5c')]=_0x1067f1;this['type']=_0x6330('0x5d');this[_0x6330('0x5e')]=_0x6330('0x5f');this[_0x6330('0x60')]=_0x5cad4b;this[_0x6330('0x61')]=_0x6f6cf6;}function createVoicePrefixExtensions(_0x5ed34a,_0x527fdd,_0x84fa67){return new BPromise(function(_0x5c2b87,_0x7feb12){var _0x4850f8=new Extension(formatPrefixName(_0x5ed34a[_0x6330('0x62')]),0x1,_0x6330('0x63'),_0x6330('0x64'));_0x4850f8[_0x6330('0x65')]=_0x5ed34a['id'];return db['VoiceExtension'][_0x6330('0x4c')](_0x4850f8,{'transaction':_0x84fa67})[_0x6330('0x2a')](function(_0x884f74){var _0x2af99b=_0x884f74[_0x6330('0x50')]({'plain':!![]});var _0x5c57e7=_[_0x6330('0x38')](addVoicePrefixExtensions(_0x5ed34a,_0x527fdd),function(_0x139ace){_0x139ace[_0x6330('0x52')]=_0x2af99b['id'];_0x139ace[_0x6330('0x65')]=_0x5ed34a['id'];return _0x139ace;});return db[_0x6330('0x51')][_0x6330('0x66')](_0x5c57e7,{'transaction':_0x84fa67})[_0x6330('0x2a')](function(_0x44a035){if(!_0x44a035){return _0x7feb12('Extensions\x20creation\x20failed');}else{return _0x5c2b87(_0x44a035);}})[_0x6330('0x48')](function(_0x2eece8){return _0x7feb12(_0x2eece8);});});;});};function addVoicePrefixExtensions(_0x57893f,_0x39a46f){var _0x476790=[];var _0x20758e=formatPrefixName(_0x57893f['prefix']);_0x476790[_0x6330('0x67')](new Extension(_0x20758e,0x2,_0x6330('0x68'),_0x6330('0x69')+_0x57893f['name']));if(_0x57893f[_0x6330('0x6a')]){_0x476790['push'](new Extension(_0x20758e,0x3,_0x6330('0x68'),_0x6330('0x6b')+_0x57893f[_0x6330('0x6a')]));}else{_0x476790[_0x6330('0x67')](new Extension(_0x20758e,0x3,_0x6330('0x63'),'No\x20callerid\x20available'));}_0x476790['push'](new Extension(_0x20758e,0x4,_0x6330('0x6c'),_0x39a46f[_0x6330('0x5a')]+','+_0x6330('0x6d')+(0x8+_0x57893f[_0x6330('0x30')][_0x6330('0x3e')])+'}'+','+0x1));return _0x476790;}function formatPrefixName(_0x236d5d){var _0xd154cb='_';for(var _0x5a5c7f=0x0;_0x5a5c7f<_0x236d5d['length'];_0x5a5c7f++){if(_0x236d5d[_0x6330('0x6e')](_0x5a5c7f)=='-'){_0xd154cb+=_0x236d5d[_0x6330('0x6e')](_0x5a5c7f);}else{_0xd154cb+='['+_0x236d5d[_0x6330('0x6e')](_0x5a5c7f)+']';}}_0xd154cb+='.';return _0xd154cb;}exports[_0x6330('0x29')]=function(_0x8daa8,_0xd1992b,_0x1531db){var _0x285a49=_0x8daa8[_0x6330('0x4f')];_0x285a49['prefix']=_0x6330('0x6f')+_0x285a49[_0x6330('0x30')]+'-';return db['sequelize'][_0x6330('0x4e')](function(_0x175935){return db[_0x6330('0x32')][_0x6330('0x29')](_0x285a49,{'where':{'id':_0x285a49['id']},'transaction':_0x175935})[_0x6330('0x2a')](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x285a49['id']},'transaction':_0x175935})['then'](function(){return db[_0x6330('0x51')][_0x6330('0x4b')]({'where':{'id':_0x285a49[_0x6330('0x52')]},'raw':!![]})[_0x6330('0x2a')](function(_0x511ef7){return createVoicePrefixExtensions(_0x285a49,_0x511ef7,_0x175935);});});});})[_0x6330('0x2a')](function(){return db[_0x6330('0x32')]['findById'](_0x285a49['id']);})[_0x6330('0x2a')](respondWithResult(_0xd1992b,null))[_0x6330('0x48')](handleError(_0xd1992b,null));};exports[_0x6330('0x70')]=function(_0x18bfd5,_0x5a2e42,_0x2b4c6f){return db[_0x6330('0x32')]['find']({'where':{'id':_0x18bfd5[_0x6330('0x4a')]['id']}})[_0x6330('0x2a')](handleEntityNotFound(_0x5a2e42,null))[_0x6330('0x2a')](function(_0x2a2afe){if(_0x2a2afe){return _0x2a2afe[_0x6330('0x70')](_0x18bfd5['body'][_0x6330('0x71')],_[_0x6330('0x72')](_0x18bfd5[_0x6330('0x4f')],[_0x6330('0x71'),'id'])||{})[_0x6330('0x73')](function(_0x4a7eef){for(var _0x20f89d=0x0;_0x20f89d<_0x18bfd5[_0x6330('0x4f')][_0x6330('0x71')][_0x6330('0x3e')];_0x20f89d+=0x1){socket['emit'](_0x6330('0x74'),{'UserId':Number(_0x18bfd5[_0x6330('0x4f')][_0x6330('0x71')][_0x20f89d]),'VoicePrefixId':Number(_0x18bfd5[_0x6330('0x4a')]['id'])});}return _0x4a7eef;});}})[_0x6330('0x2a')](respondWithResult(_0x5a2e42,null))[_0x6330('0x48')](handleError(_0x5a2e42,null));};exports['removeAgents']=function(_0x53f521,_0x2237d1,_0x2a8ddf){return db[_0x6330('0x32')][_0x6330('0x4b')]({'where':{'id':_0x53f521[_0x6330('0x4a')]['id']}})[_0x6330('0x2a')](handleEntityNotFound(_0x2237d1,null))['then'](function(_0x4ce7ce){if(_0x4ce7ce){return _0x4ce7ce[_0x6330('0x75')](_0x53f521[_0x6330('0x39')][_0x6330('0x71')])[_0x6330('0x2a')](function(){if(_['isArray'](_0x53f521[_0x6330('0x39')][_0x6330('0x71')])){for(var _0x2ea26f=0x0;_0x2ea26f<_0x53f521['query'][_0x6330('0x71')][_0x6330('0x3e')];_0x2ea26f+=0x1){socket[_0x6330('0x76')](_0x6330('0x77'),{'UserId':Number(_0x53f521['query'][_0x6330('0x71')][_0x2ea26f]),'VoicePrefixId':Number(_0x53f521[_0x6330('0x4a')]['id'])});}}else{socket[_0x6330('0x76')](_0x6330('0x77'),{'UserId':Number(_0x53f521[_0x6330('0x39')]['ids']),'VoicePrefixId':Number(_0x53f521[_0x6330('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2237d1,null))[_0x6330('0x48')](handleError(_0x2237d1,null));};exports['getAgents']=function(_0x22cc13,_0x34334c,_0x30018b){var _0x556092={};var _0x165535={};var _0x7b5d8e;var _0x31d996;return db[_0x6330('0x32')]['findOne']({'where':{'id':_0x22cc13[_0x6330('0x4a')]['id']}})[_0x6330('0x2a')](handleEntityNotFound(_0x34334c,null))['then'](function(_0x118d77){if(_0x118d77){_0x7b5d8e=_0x118d77;_0x165535[_0x6330('0x37')]=_['keys'](db[_0x6330('0x78')][_0x6330('0x33')]);_0x165535[_0x6330('0x39')]=_[_0x6330('0x3a')](_0x22cc13[_0x6330('0x39')]);_0x165535[_0x6330('0x42')]=_[_0x6330('0x3b')](_0x165535[_0x6330('0x37')],_0x165535['query']);_0x556092[_0x6330('0x3c')]=_[_0x6330('0x3b')](_0x165535[_0x6330('0x37')],qs[_0x6330('0x3d')](_0x22cc13[_0x6330('0x39')][_0x6330('0x3d')]));_0x556092[_0x6330('0x3c')]=_0x556092[_0x6330('0x3c')][_0x6330('0x3e')]?_0x556092['attributes']:_0x165535[_0x6330('0x37')];_0x556092['order']=qs[_0x6330('0x40')](_0x22cc13[_0x6330('0x39')][_0x6330('0x40')]);_0x556092[_0x6330('0x41')]=qs[_0x6330('0x42')](_['pick'](_0x22cc13['query'],_0x165535[_0x6330('0x42')]));if(_0x22cc13[_0x6330('0x39')][_0x6330('0x43')]){_0x556092['where']=_[_0x6330('0x44')](_0x556092['where'],{'$or':_[_0x6330('0x38')](_0x556092['attributes'],function(_0x304c53){var _0x16332f={};_0x16332f[_0x304c53]={'$like':'%'+_0x22cc13[_0x6330('0x39')][_0x6330('0x43')]+'%'};return _0x16332f;})});}_0x556092=_[_0x6330('0x44')]({},_0x556092,_0x22cc13[_0x6330('0x45')]);return _0x7b5d8e['getAgents'](_0x556092);}})[_0x6330('0x2a')](function(_0x19da3b){if(_0x19da3b){_0x31d996=_0x19da3b[_0x6330('0x3e')];if(!_0x22cc13[_0x6330('0x39')][_0x6330('0x79')]('nolimit')){_0x556092[_0x6330('0x25')]=qs[_0x6330('0x25')](_0x22cc13[_0x6330('0x39')][_0x6330('0x25')]);_0x556092[_0x6330('0x23')]=qs['offset'](_0x22cc13['query'][_0x6330('0x23')]);}return _0x7b5d8e[_0x6330('0x7a')](_0x556092);}})['then'](function(_0x2e4293){if(_0x2e4293){return _0x2e4293?{'count':_0x31d996,'rows':_0x2e4293}:null;}})[_0x6330('0x2a')](respondWithResult(_0x34334c,null))[_0x6330('0x48')](handleError(_0x34334c,null));};
\ No newline at end of file
index c5e980c..6998342 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93f2=['save','update','emit','hasOwnProperty','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x59668a,_0x3654bd){var _0x2aa07e=function(_0x4d2c30){while(--_0x4d2c30){_0x59668a['push'](_0x59668a['shift']());}};_0x2aa07e(++_0x3654bd);}(_0x93f2,0x1e4));var _0x293f=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x93f2[_0x40220a];return _0x3903cc;};'use strict';var EventEmitter=require(_0x293f('0x0'));var VoicePrefix=require(_0x293f('0x1'))['db'][_0x293f('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x293f('0x3')](0x0);var events={'afterCreate':_0x293f('0x4'),'afterUpdate':_0x293f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x23c2bf){return function(_0x5d9ba1,_0x33db3a,_0x32d694){VoicePrefixEvents[_0x293f('0x6')](_0x23c2bf+':'+_0x5d9ba1['id'],_0x5d9ba1);VoicePrefixEvents[_0x293f('0x6')](_0x23c2bf,_0x5d9ba1);_0x32d694(null);};}for(var e in events){if(events[_0x293f('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
+var _0xbb34=['update','emit','hasOwnProperty','hook','save'];(function(_0x58c343,_0x3f6bfd){var _0x22a02b=function(_0x393211){while(--_0x393211){_0x58c343['push'](_0x58c343['shift']());}};_0x22a02b(++_0x3f6bfd);}(_0xbb34,0x16c));var _0x4bb3=function(_0x14525d,_0x747b83){_0x14525d=_0x14525d-0x0;var _0x26b05c=_0xbb34[_0x14525d];return _0x26b05c;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4bb3('0x0'),'afterUpdate':_0x4bb3('0x1'),'afterDestroy':'remove'};function emitEvent(_0x348c01){return function(_0x20615a,_0x53b4f7,_0x21cdf3){VoicePrefixEvents[_0x4bb3('0x2')](_0x348c01+':'+_0x20615a['id'],_0x20615a);VoicePrefixEvents[_0x4bb3('0x2')](_0x348c01,_0x20615a);_0x21cdf3(null);};}for(var e in events){if(events[_0x4bb3('0x3')](e)){var event=events[e];VoicePrefix[_0x4bb3('0x4')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
index 6d90cb5..f84e3c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fac=['./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6fac,0x154));var _0xc6fa=function(_0x4ac382,_0x34c2dd){_0x4ac382=_0x4ac382-0x0;var _0x6c9502=_0x6fac[_0x4ac382];return _0x6c9502;};'use strict';var _=require(_0xc6fa('0x0'));var util=require(_0xc6fa('0x1'));var logger=require(_0xc6fa('0x2'))('api');var moment=require(_0xc6fa('0x3'));var BPromise=require(_0xc6fa('0x4'));var rp=require(_0xc6fa('0x5'));var fs=require('fs');var path=require(_0xc6fa('0x6'));var rimraf=require(_0xc6fa('0x7'));var config=require('../../config/environment');var attributes=require(_0xc6fa('0x8'));module[_0xc6fa('0x9')]=function(_0x5a1999,_0x3d6944){return _0x5a1999[_0xc6fa('0xa')](_0xc6fa('0xb'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x75b3=['./voicePrefix.attributes','exports','define','voice_prefixes','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3bce19,_0x317f24){var _0x3d9451=function(_0x43f002){while(--_0x43f002){_0x3bce19['push'](_0x3bce19['shift']());}};_0x3d9451(++_0x317f24);}(_0x75b3,0x1e4));var _0x375b=function(_0x35a7e0,_0x1a7666){_0x35a7e0=_0x35a7e0-0x0;var _0x2ffaba=_0x75b3[_0x35a7e0];return _0x2ffaba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x375b('0x0'))(_0x375b('0x1'));var moment=require(_0x375b('0x2'));var BPromise=require(_0x375b('0x3'));var rp=require(_0x375b('0x4'));var fs=require('fs');var path=require(_0x375b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x375b('0x6'));module[_0x375b('0x7')]=function(_0x2f1ed5,_0x3a69e6){return _0x2f1ed5[_0x375b('0x8')]('VoicePrefix',attributes,{'tableName':_0x375b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 477d608..c5bf4d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6132=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x220236,_0x27dc5a){var _0x3823d4=function(_0x2b306a){while(--_0x2b306a){_0x220236['push'](_0x220236['shift']());}};_0x3823d4(++_0x27dc5a);}(_0x6132,0x13a));var _0x2613=function(_0x27d0f9,_0x2272e6){_0x27d0f9=_0x27d0f9-0x0;var _0x1e888e=_0x6132[_0x27d0f9];return _0x1e888e;};'use strict';var _=require(_0x2613('0x0'));var util=require(_0x2613('0x1'));var moment=require(_0x2613('0x2'));var BPromise=require(_0x2613('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2613('0x4'));var db=require(_0x2613('0x5'))['db'];var utils=require(_0x2613('0x6'));var logger=require(_0x2613('0x7'))('rpc');var config=require(_0x2613('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2613('0x9')]({'port':0x232a});config[_0x2613('0xa')]=_[_0x2613('0xb')](config[_0x2613('0xa')],{'host':_0x2613('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2613('0xa')]));require(_0x2613('0xd'))[_0x2613('0xe')](socket);function respondWithRpcPromise(_0x5c9af5,_0xe1a1ff,_0x12c800){return new BPromise(function(_0x6d4439,_0x37fe48){return client[_0x2613('0xf')](_0x5c9af5,_0x12c800)[_0x2613('0x10')](function(_0xcc6236){logger[_0x2613('0x11')](_0x2613('0x12'),_0xe1a1ff,_0x2613('0x13'));logger['debug'](_0x2613('0x14'),_0xe1a1ff,_0x2613('0x13'),JSON[_0x2613('0x15')](_0xcc6236));if(_0xcc6236[_0x2613('0x16')]){if(_0xcc6236['error'][_0x2613('0x17')]===0x1f4){logger[_0x2613('0x16')](_0x2613('0x12'),_0xe1a1ff,_0xcc6236[_0x2613('0x16')]['message']);return _0x37fe48(_0xcc6236[_0x2613('0x16')][_0x2613('0x18')]);}logger[_0x2613('0x16')](_0x2613('0x12'),_0xe1a1ff,_0xcc6236['error'][_0x2613('0x18')]);return _0x6d4439(_0xcc6236[_0x2613('0x16')]['message']);}else{logger[_0x2613('0x11')](_0x2613('0x12'),_0xe1a1ff,_0x2613('0x13'));_0x6d4439(_0xcc6236[_0x2613('0x19')][_0x2613('0x18')]);}})['catch'](function(_0x349c5c){logger[_0x2613('0x16')]('VoicePrefix,\x20%s,\x20%s',_0xe1a1ff,_0x349c5c);_0x37fe48(_0x349c5c);});});}
\ No newline at end of file
+var _0x6337=['http','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x6337,0x18a));var _0x7633=function(_0x3afdca,_0x27dcd5){_0x3afdca=_0x3afdca-0x0;var _0x545ec9=_0x6337[_0x3afdca];return _0x545ec9;};'use strict';var _=require('lodash');var util=require(_0x7633('0x0'));var moment=require(_0x7633('0x1'));var BPromise=require(_0x7633('0x2'));var rs=require(_0x7633('0x3'));var fs=require('fs');var Redis=require(_0x7633('0x4'));var db=require(_0x7633('0x5'))['db'];var utils=require(_0x7633('0x6'));var logger=require(_0x7633('0x7'))(_0x7633('0x8'));var config=require('../../config/environment');var jayson=require(_0x7633('0x9'));var client=jayson[_0x7633('0xa')][_0x7633('0xb')]({'port':0x232a});config['redis']=_[_0x7633('0xc')](config['redis'],{'host':_0x7633('0xd'),'port':0x18eb});var socket=require(_0x7633('0xe'))(new Redis(config['redis']));require(_0x7633('0xf'))['register'](socket);function respondWithRpcPromise(_0x35a196,_0x4c0f0a,_0x174d9f){return new BPromise(function(_0x2404e4,_0x59e518){return client[_0x7633('0x10')](_0x35a196,_0x174d9f)[_0x7633('0x11')](function(_0x332283){logger['info'](_0x7633('0x12'),_0x4c0f0a,_0x7633('0x13'));logger[_0x7633('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x4c0f0a,_0x7633('0x13'),JSON[_0x7633('0x15')](_0x332283));if(_0x332283[_0x7633('0x16')]){if(_0x332283['error']['code']===0x1f4){logger['error'](_0x7633('0x12'),_0x4c0f0a,_0x332283[_0x7633('0x16')][_0x7633('0x17')]);return _0x59e518(_0x332283[_0x7633('0x16')][_0x7633('0x17')]);}logger[_0x7633('0x16')](_0x7633('0x12'),_0x4c0f0a,_0x332283[_0x7633('0x16')][_0x7633('0x17')]);return _0x2404e4(_0x332283['error'][_0x7633('0x17')]);}else{logger[_0x7633('0x18')](_0x7633('0x12'),_0x4c0f0a,_0x7633('0x13'));_0x2404e4(_0x332283[_0x7633('0x19')]['message']);}})[_0x7633('0x1a')](function(_0x30b58b){logger[_0x7633('0x16')](_0x7633('0x12'),_0x4c0f0a,_0x30b58b);_0x59e518(_0x30b58b);});});}
\ No newline at end of file
index af13459..56660bd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['emit','removeListener','register','length','voicePrefix:','./voicePrefix.events','save','update'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xbec5,0xe5));var _0x5bec=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0xbec5[_0xd22d95];return _0x15d7a3;};'use strict';var VoicePrefixEvents=require(_0x5bec('0x0'));var events=[_0x5bec('0x1'),'remove',_0x5bec('0x2')];function createListener(_0x38c81a,_0x276b9e){return function(_0x3859a1){_0x276b9e[_0x5bec('0x3')](_0x38c81a,_0x3859a1);};}function removeListener(_0x4ee982,_0x1f8933){return function(){VoicePrefixEvents[_0x5bec('0x4')](_0x4ee982,_0x1f8933);};}exports[_0x5bec('0x5')]=function(_0x4aaac6){for(var _0x3ed67a=0x0,_0x28a427=events[_0x5bec('0x6')];_0x3ed67a<_0x28a427;_0x3ed67a++){var _0x406e65=events[_0x3ed67a];var _0x43d96e=createListener(_0x5bec('0x7')+_0x406e65,_0x4aaac6);VoicePrefixEvents['on'](_0x406e65,_0x43d96e);}};
\ No newline at end of file
+var _0xf2a6=['emit','removeListener','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x15de11,_0x3cd20d){var _0x4f1c07=function(_0xf74624){while(--_0xf74624){_0x15de11['push'](_0x15de11['shift']());}};_0x4f1c07(++_0x3cd20d);}(_0xf2a6,0x13d));var _0x6f2a=function(_0xcea15c,_0x2f302b){_0xcea15c=_0xcea15c-0x0;var _0x230f27=_0xf2a6[_0xcea15c];return _0x230f27;};'use strict';var VoicePrefixEvents=require(_0x6f2a('0x0'));var events=['save','remove','update'];function createListener(_0x1b32c0,_0x5b2cbc){return function(_0x3b14e2){_0x5b2cbc[_0x6f2a('0x1')](_0x1b32c0,_0x3b14e2);};}function removeListener(_0x454ff7,_0x32ddb6){return function(){VoicePrefixEvents[_0x6f2a('0x2')](_0x454ff7,_0x32ddb6);};}exports[_0x6f2a('0x3')]=function(_0x4684f4){for(var _0x19ebe9=0x0,_0x1efd8=events[_0x6f2a('0x4')];_0x19ebe9<_0x1efd8;_0x19ebe9++){var _0x4b4fde=events[_0x19ebe9];var _0x379b80=createListener(_0x6f2a('0x5')+_0x4b4fde,_0x4684f4);VoicePrefixEvents['on'](_0x4b4fde,_0x379b80);}};
\ No newline at end of file
index 143faae..0647088 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x127e=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','getTeams','/:id/users','getAgents','getMembers','getLists','/:id/blacklists','create','post','/:id/clone','clone','/:id/teams','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','destroy','removeTeams','removeAgents','/:id/lists','removeBlackLists'];(function(_0x5db0bc,_0x3cdd02){var _0x5e28d7=function(_0x3817ad){while(--_0x3817ad){_0x5db0bc['push'](_0x5db0bc['shift']());}};_0x5e28d7(++_0x3cdd02);}(_0x127e,0xad));var _0xe127=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x127e[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xe127('0x0'));var util=require(_0xe127('0x1'));var path=require(_0xe127('0x2'));var timeout=require(_0xe127('0x3'));var express=require(_0xe127('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe127('0x5'));var interaction=require(_0xe127('0x6'));var config=require('../../config/environment');var controller=require(_0xe127('0x7'));router[_0xe127('0x8')]('/',auth[_0xe127('0x9')](),controller['index']);router[_0xe127('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xe127('0xa')]);router[_0xe127('0x8')](_0xe127('0xb'),auth['isAuthenticated'](),controller[_0xe127('0xc')]);router[_0xe127('0x8')](_0xe127('0xd'),auth['isAuthenticated'](),controller[_0xe127('0xe')]);router['get'](_0xe127('0xf'),auth[_0xe127('0x9')](),controller[_0xe127('0x10')]);router['get']('/:id/hopper_black',auth[_0xe127('0x9')](),controller[_0xe127('0x11')]);router[_0xe127('0x8')]('/:id/teams',auth[_0xe127('0x9')](),controller[_0xe127('0x12')]);router[_0xe127('0x8')](_0xe127('0x13'),auth[_0xe127('0x9')](),controller[_0xe127('0x14')]);router[_0xe127('0x8')]('/:id/members',auth[_0xe127('0x9')](),controller[_0xe127('0x15')]);router[_0xe127('0x8')]('/:id/lists',auth[_0xe127('0x9')](),controller[_0xe127('0x16')]);router[_0xe127('0x8')](_0xe127('0x17'),auth[_0xe127('0x9')](),controller['getBlackLists']);router['post']('/',auth['isAuthenticated'](),controller[_0xe127('0x18')]);router[_0xe127('0x19')](_0xe127('0x1a'),auth[_0xe127('0x9')](),controller[_0xe127('0x1b')]);router['post'](_0xe127('0x1c'),auth[_0xe127('0x9')](),controller[_0xe127('0x1d')]);router[_0xe127('0x19')]('/:id/users',auth[_0xe127('0x9')](),controller[_0xe127('0x1e')]);router[_0xe127('0x19')]('/:id/lists',auth[_0xe127('0x9')](),controller[_0xe127('0x1f')]);router[_0xe127('0x19')](_0xe127('0x17'),auth[_0xe127('0x9')](),controller[_0xe127('0x20')]);router[_0xe127('0x21')](_0xe127('0x22'),auth[_0xe127('0x9')](),controller[_0xe127('0x23')]);router[_0xe127('0x24')](_0xe127('0x22'),auth[_0xe127('0x9')](),controller[_0xe127('0x25')]);router[_0xe127('0x24')](_0xe127('0x1c'),auth[_0xe127('0x9')](),controller[_0xe127('0x26')]);router[_0xe127('0x24')]('/:id/users',auth[_0xe127('0x9')](),controller[_0xe127('0x27')]);router[_0xe127('0x24')](_0xe127('0x28'),auth[_0xe127('0x9')](),controller['removeLists']);router[_0xe127('0x24')](_0xe127('0x17'),auth[_0xe127('0x9')](),controller[_0xe127('0x29')]);module[_0xe127('0x2a')]=router;
\ No newline at end of file
+var _0x3b5b=['clone','/:id/teams','addTeams','addAgents','addLists','addBlackLists','put','update','delete','destroy','removeAgents','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone'];(function(_0x10bb45,_0x3791ad){var _0x1eb585=function(_0x360ffd){while(--_0x360ffd){_0x10bb45['push'](_0x10bb45['shift']());}};_0x1eb585(++_0x3791ad);}(_0x3b5b,0xc2));var _0xb3b5=function(_0x205457,_0x427066){_0x205457=_0x205457-0x0;var _0x17442d=_0x3b5b[_0x205457];return _0x17442d;};'use strict';var multer=require(_0xb3b5('0x0'));var util=require(_0xb3b5('0x1'));var path=require('path');var timeout=require(_0xb3b5('0x2'));var express=require(_0xb3b5('0x3'));var router=express[_0xb3b5('0x4')]();var fs_extra=require(_0xb3b5('0x5'));var auth=require(_0xb3b5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb3b5('0x7'));var controller=require(_0xb3b5('0x8'));router[_0xb3b5('0x9')]('/',auth[_0xb3b5('0xa')](),controller['index']);router['get'](_0xb3b5('0xb'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0xc')]);router[_0xb3b5('0x9')](_0xb3b5('0xd'),auth['isAuthenticated'](),controller[_0xb3b5('0xe')]);router[_0xb3b5('0x9')]('/:id/hopper_histories',auth[_0xb3b5('0xa')](),controller['getHopperHistories']);router[_0xb3b5('0x9')](_0xb3b5('0xf'),auth['isAuthenticated'](),controller[_0xb3b5('0x10')]);router[_0xb3b5('0x9')](_0xb3b5('0x11'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x12')]);router[_0xb3b5('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0xb3b5('0x13')]);router[_0xb3b5('0x9')](_0xb3b5('0x14'),auth['isAuthenticated'](),controller[_0xb3b5('0x15')]);router[_0xb3b5('0x9')](_0xb3b5('0x16'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x17')]);router[_0xb3b5('0x9')](_0xb3b5('0x18'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x19')]);router[_0xb3b5('0x9')](_0xb3b5('0x1a'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x1b')]);router[_0xb3b5('0x1c')]('/',auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x1d')]);router[_0xb3b5('0x1c')](_0xb3b5('0x1e'),auth['isAuthenticated'](),controller[_0xb3b5('0x1f')]);router[_0xb3b5('0x1c')](_0xb3b5('0x20'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x21')]);router['post'](_0xb3b5('0x14'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x22')]);router[_0xb3b5('0x1c')](_0xb3b5('0x18'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x23')]);router[_0xb3b5('0x1c')](_0xb3b5('0x1a'),auth['isAuthenticated'](),controller[_0xb3b5('0x24')]);router[_0xb3b5('0x25')]('/:id',auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x26')]);router[_0xb3b5('0x27')](_0xb3b5('0xb'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x28')]);router['delete'](_0xb3b5('0x20'),auth[_0xb3b5('0xa')](),controller['removeTeams']);router[_0xb3b5('0x27')]('/:id/users',auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x29')]);router[_0xb3b5('0x27')](_0xb3b5('0x18'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x2a')]);router[_0xb3b5('0x27')](_0xb3b5('0x1a'),auth[_0xb3b5('0xa')](),controller[_0xb3b5('0x2b')]);module[_0xb3b5('0x2c')]=router;
\ No newline at end of file
index 3a0c817..34cd851 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7250=['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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','name','ENUM','inbound','outbound','STRING','leastrecent','random','rrmemory','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','booked','roundrobin','progressive','power','INTEGER','yes','all','once','periodic_announce','joinempty','join','leavewhenempty','split','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#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','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)'];(function(_0x4dbfa0,_0x22f00f){var _0x662629=function(_0x40f6d7){while(--_0x40f6d7){_0x4dbfa0['push'](_0x4dbfa0['shift']());}};_0x662629(++_0x22f00f);}(_0x7250,0x1b1));var _0x0725=function(_0x489a29,_0x41b4a8){_0x489a29=_0x489a29-0x0;var _0x5cd130=_0x7250[_0x489a29];return _0x5cd130;};'use strict';var Sequelize=require(_0x0725('0x0'));module[_0x0725('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0725('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0725('0x3')](_0x0725('0x4'),_0x0725('0x5')),'allowNull':![],'defaultValue':_0x0725('0x4')},'musiconhold':{'type':Sequelize[_0x0725('0x6')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x0725('0x6')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x0725('0x7'),'fewestcalls',_0x0725('0x8'),_0x0725('0x9'),'linear',_0x0725('0xa'),_0x0725('0xb')),'allowNull':![],'defaultValue':_0x0725('0xc'),'set':function(_0xc12c1e){this[_0x0725('0xd')](_0x0725('0xe'),_0xc12c1e?_0xc12c1e:_0x0725('0x9'));},'get':function(){var _0x4c2f6a=this[_0x0725('0xf')](_0x0725('0x10'));var _0x3b4790=this['getDataValue']('dialMethod');var _0x6b2fa8=this[_0x0725('0xf')](_0x0725('0xe'));if(_0x4c2f6a===_0x0725('0x4')){return _0x6b2fa8;}if(_0x3b4790===_0x0725('0x11')&&_0x6b2fa8===_0x0725('0x9')||_0x3b4790===_0x0725('0x11')&&_0x6b2fa8===_0x0725('0x12')){return _0x6b2fa8;}if(_0x3b4790===_0x0725('0x13')||_0x3b4790==='predictive'||_0x3b4790===_0x0725('0x14')){return _0x6b2fa8;}return null;}},'servicelevel':{'type':Sequelize[_0x0725('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0725('0x6')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0725('0x15')](0xb)},'timeout':{'type':Sequelize[_0x0725('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0725('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0725('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x0725('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x0725('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0725('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0x0725('0x3')](_0x0725('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0725('0x3')](_0x0725('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0725('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0725('0x3')](_0x0725('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0725('0x3')](_0x0725('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0725('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0725('0x3')](_0x0725('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0725('0x6')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0725('0x6')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0725('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0725('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0725('0x16'),'no'),'defaultValue':_0x0725('0x16')},'announce_holdtime':{'type':Sequelize[_0x0725('0x3')](_0x0725('0x16'),'no',_0x0725('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0725('0x6')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x0725('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0x0725('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x0725('0x6')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0725('0x6')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x0725('0x6')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0725('0x6')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0725('0x6')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0725('0x6')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x0725('0x6')]},'queue_quantity2':{'type':Sequelize[_0x0725('0x6')]},'queue_periodic_announce':{'type':Sequelize[_0x0725('0x6')]},'queue_less_than':{'type':Sequelize[_0x0725('0x6')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x42ee6c){this[_0x0725('0xd')](_0x0725('0x19'),_0x42ee6c?_0x42ee6c['join'](','):[]);},'get':function(){return this[_0x0725('0xf')]('periodic_announce')?this[_0x0725('0xf')](_0x0725('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x0725('0x6')],'defaultValue':_0x0725('0x16'),'set':function(_0x347951){this[_0x0725('0xd')](_0x0725('0x1a'),_0x347951?_0x347951[_0x0725('0x1b')](','):undefined);},'get':function(){return this[_0x0725('0xf')](_0x0725('0x1a'))?this[_0x0725('0xf')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0725('0x6')],'defaultValue':'no','set':function(_0x53c06a){this[_0x0725('0xd')]('leavewhenempty',_0x53c06a?_0x53c06a[_0x0725('0x1b')](','):undefined);},'get':function(){return this[_0x0725('0xf')](_0x0725('0x1c'))?this[_0x0725('0xf')](_0x0725('0x1c'))[_0x0725('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0725('0x3')](_0x0725('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0725('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0725('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x0725('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0725('0x6')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x4327ac){this[_0x0725('0xd')](_0x0725('0x1e'),_0x4327ac);if(_0x4327ac){if(this['getDataValue']('wrapuptime')<0x2){this['setDataValue'](_0x0725('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0725('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0725('0x20')],'defaultValue':0x0,'comment':_0x0725('0x21')},'dialMethod':{'type':Sequelize[_0x0725('0x3')]('preview',_0x0725('0x13'),_0x0725('0x14'),_0x0725('0x22'),_0x0725('0x11')),'defaultValue':_0x0725('0x13'),'comment':_0x0725('0x23')},'dialLimitChannel':{'type':Sequelize[_0x0725('0x15')](0x4)[_0x0725('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0725('0x25')},'dialLimitQueue':{'type':Sequelize[_0x0725('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0725('0x26')},'dialPowerLevel':{'type':Sequelize[_0x0725('0x27')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0725('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x0725('0x3')](_0x0725('0x29'),_0x0725('0x2a')),'defaultValue':_0x0725('0x2a'),'comment':_0x0725('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0725('0x27')](0x2)[_0x0725('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x0725('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0725('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0725('0x6')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0725('0x6')]},'dialOriginateTimeout':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0725('0x2d')},'dialQueueOptions':{'type':Sequelize[_0x0725('0x6')],'defaultValue':_0x0725('0x2e'),'comment':_0x0725('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0725('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0725('0x30')},'dialQueueProject':{'type':Sequelize[_0x0725('0x6')],'comment':_0x0725('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0725('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0725('0x15')](0x5)[_0x0725('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0725('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0725('0x34')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0725('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0725('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'defaultValue':0x3,'comment':_0x0725('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0725('0x15')](0x5)[_0x0725('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0725('0x37')},'dialTimezone':{'type':Sequelize[_0x0725('0x6')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0725('0x6')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x0725('0x6')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0725('0x3')](_0x0725('0x38'),'never',_0x0725('0x39')),'defaultValue':_0x0725('0x38')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0725('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0x0725('0x15')](0x9)[_0x0725('0x24')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0725('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x0725('0x15')](0x9)[_0x0725('0x24')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0725('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0725('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0725('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0725('0x15')](0x9)[_0x0725('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0725('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0725('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0725('0x15')](0x9)[_0x0725('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0725('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0725('0x15')](0x9)[_0x0725('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0725('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0725('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0725('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0725('0x42')},'dialRecallMeTimeout':{'type':Sequelize[_0x0725('0x15')](0x5)[_0x0725('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x0725('0x20')],'defaultValue':0x0,'comment':_0x0725('0x43')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0725('0x3')](_0x0725('0x44'),_0x0725('0x45')),'defaultValue':_0x0725('0x44')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0725('0x20')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0725('0x46')},'dialCutDigit':{'type':Sequelize[_0x0725('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0725('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0725('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0725('0x15')](0x5)[_0x0725('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0725('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x0725('0x15')](0x5)[_0x0725('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0725('0x4a')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0725('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0725('0x15')](0x5)[_0x0725('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0725('0x4c')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0725('0x15')](0x5)[_0x0725('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0725('0x4d')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0725('0x4e')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0725('0x15')](0x5)[_0x0725('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0725('0x4f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0725('0x15')],'allowNull':!![],'comment':_0x0725('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x0725('0x20')],'defaultValue':![],'comment':_0x0725('0x51'),'set':function(_0x38ae30){if(!_0x38ae30)this['setDataValue'](_0x0725('0x52'),null);this['setDataValue'](_0x0725('0x53'),_0x38ae30);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0725('0x15')](0x3)[_0x0725('0x24')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0x1c3b=['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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','inbound','outbound','default','ringall','leastrecent','fewestcalls','rrordered','setDataValue','strategy','getDataValue','type','dialMethod','booked','rrmemory','roundrobin','progressive','power','INTEGER','ENUM','yes','all','TEXT','join','periodic_announce','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\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','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','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)'];(function(_0x5c6081,_0x247a8f){var _0x10aadb=function(_0x4a99ba){while(--_0x4a99ba){_0x5c6081['push'](_0x5c6081['shift']());}};_0x10aadb(++_0x247a8f);}(_0x1c3b,0xab));var _0xb1c3=function(_0x27d1b8,_0x2652b7){_0x27d1b8=_0x27d1b8-0x0;var _0x2e03e8=_0x1c3b[_0x27d1b8];return _0x2e03e8;};'use strict';var Sequelize=require(_0xb1c3('0x0'));module[_0xb1c3('0x1')]={'name':{'type':Sequelize[_0xb1c3('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xb1c3('0x3'),_0xb1c3('0x4')),'allowNull':![],'defaultValue':_0xb1c3('0x3')},'musiconhold':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':_0xb1c3('0x5')},'announce':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xb1c3('0x6'),_0xb1c3('0x7'),_0xb1c3('0x8'),'random','rrmemory','linear','wrandom',_0xb1c3('0x9')),'allowNull':![],'defaultValue':'ringall','set':function(_0x2879c2){this[_0xb1c3('0xa')](_0xb1c3('0xb'),_0x2879c2?_0x2879c2:'rrmemory');},'get':function(){var _0x226a88=this[_0xb1c3('0xc')](_0xb1c3('0xd'));var _0x5f1e34=this[_0xb1c3('0xc')](_0xb1c3('0xe'));var _0x19c7f1=this[_0xb1c3('0xc')]('strategy');if(_0x226a88===_0xb1c3('0x3')){return _0x19c7f1;}if(_0x5f1e34===_0xb1c3('0xf')&&_0x19c7f1===_0xb1c3('0x10')||_0x5f1e34==='booked'&&_0x19c7f1===_0xb1c3('0x11')){return _0x19c7f1;}if(_0x5f1e34===_0xb1c3('0x12')||_0x5f1e34==='predictive'||_0x5f1e34===_0xb1c3('0x13')){return _0x19c7f1;}return null;}},'servicelevel':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xb1c3('0x14')](0xb)},'timeout':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xb1c3('0x2')]},'weight':{'type':Sequelize[_0xb1c3('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no',_0xb1c3('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xb1c3('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xb1c3('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xb1c3('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xb1c3('0x16'),'no'),'defaultValue':_0xb1c3('0x16')},'announce_holdtime':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no')},'announce_position_limit':{'type':Sequelize[_0xb1c3('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xb1c3('0x15')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xb1c3('0x2')]},'queue_youarenext':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xb1c3('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xb1c3('0x2')]},'queue_quantity1':{'type':Sequelize[_0xb1c3('0x2')]},'queue_quantity2':{'type':Sequelize[_0xb1c3('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xb1c3('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0xb1c3('0x18')],'set':function(_0x52b961){this[_0xb1c3('0xa')]('periodic_announce',_0x52b961?_0x52b961[_0xb1c3('0x19')](','):[]);},'get':function(){return this[_0xb1c3('0xc')](_0xb1c3('0x1a'))?this[_0xb1c3('0xc')](_0xb1c3('0x1a'))[_0xb1c3('0x1b')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x2dc95f){this[_0xb1c3('0xa')](_0xb1c3('0x1c'),_0x2dc95f?_0x2dc95f[_0xb1c3('0x19')](','):undefined);},'get':function(){return this[_0xb1c3('0xc')](_0xb1c3('0x1c'))?this[_0xb1c3('0xc')]('joinempty')[_0xb1c3('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x351069){this[_0xb1c3('0xa')]('leavewhenempty',_0x351069?_0x351069[_0xb1c3('0x19')](','):undefined);},'get':function(){return this[_0xb1c3('0xc')](_0xb1c3('0x1d'))?this[_0xb1c3('0xc')]('leavewhenempty')[_0xb1c3('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xb1c3('0x2')]},'description':{'type':Sequelize[_0xb1c3('0x2')]},'acw':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':0x0,'set':function(_0x379c9a){this['setDataValue'](_0xb1c3('0x1f'),_0x379c9a);if(_0x379c9a){if(this[_0xb1c3('0xc')]('wrapuptime')<0x2){this[_0xb1c3('0xa')](_0xb1c3('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xb1c3('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':0x0,'comment':_0xb1c3('0x21')},'dialMethod':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x22'),_0xb1c3('0x12'),'power',_0xb1c3('0x23'),_0xb1c3('0xf')),'defaultValue':_0xb1c3('0x12'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0xb1c3('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb1c3('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xb1c3('0x24')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xb1c3('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xb1c3('0x24')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xb1c3('0x15')]('agentBusyFactor',_0xb1c3('0x27')),'defaultValue':'dropRate','comment':_0xb1c3('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xb1c3('0x29')](0x2)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xb1c3('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xb1c3('0x24')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xb1c3('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xb1c3('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1c3('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':_0xb1c3('0x2d'),'comment':_0xb1c3('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1c3('0x2f')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xb1c3('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1c3('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'comment':_0xb1c3('0x33')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x34')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb1c3('0x35')},'dialTimezone':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':_0xb1c3('0x36')},'dialPrefix':{'type':Sequelize[_0xb1c3('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x37'),_0xb1c3('0x38'),_0xb1c3('0x39')),'defaultValue':_0xb1c3('0x37')},'dialAMDActive':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':0x0,'comment':_0xb1c3('0x3a')},'dialAMDInitialSilence':{'type':Sequelize[_0xb1c3('0x14')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xb1c3('0x14')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb1c3('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb1c3('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb1c3('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb1c3('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb1c3('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xb1c3('0x14')](0x9)[_0xb1c3('0x24')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb1c3('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xb1c3('0x14')](0x9)[_0xb1c3('0x24')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb1c3('0x3f')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb1c3('0x14')](0x9)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb1c3('0x40')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb1c3('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb1c3('0x41')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb1c3('0x14')](0x9)[_0xb1c3('0x24')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb1c3('0x42')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xb1c3('0x43')},'dialRecallInQueue':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':0x0,'comment':_0xb1c3('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0xb1c3('0x15')](_0xb1c3('0x45'),_0xb1c3('0x46')),'defaultValue':_0xb1c3('0x45')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb1c3('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb1c3('0x47')},'dialCutDigit':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb1c3('0x48')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1c3('0x49')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x4a')},'dialDropMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb1c3('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x4d')},'dialMachineMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb1c3('0x14')](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb1c3('0x14')](0x3)[_0xb1c3('0x24')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb1c3('0x24')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb1c3('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb1c3('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb1c3('0x1e')],'defaultValue':![],'comment':_0xb1c3('0x4f'),'set':function(_0x3b9d2f){if(!_0x3b9d2f)this['setDataValue'](_0xb1c3('0x50'),null);this[_0xb1c3('0xa')](_0xb1c3('0x51'),_0x3b9d2f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xb1c3('0x24')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
index d638403..fe02ce0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x388d=['phone\x20NOT\x20IN\x20(?)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','push','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','value','find','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','rows','catch','show','params','keys','length','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','user','getHoppers','findOne','hasOwnProperty','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','online','interface','flatMap','Agents','forEach','penalty','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','UserVoiceQueueRt','isNil','SIP/%s','voicePause','emit','removeTeams','ids','select','field','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','sequelize','toString','every','TeamId','includes','all','union','compact','isEmpty','userVoiceQueue:remove','addAgents','spread','format','removeAgents','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','cm_contacts','phone\x20IS\x20NOT\x20NULL'];(function(_0x5d1718,_0x3c0926){var _0x1cd8ff=function(_0xd52d24){while(--_0xd52d24){_0x5d1718['push'](_0x5d1718['shift']());}};_0x1cd8ff(++_0x3c0926);}(_0x388d,0x17e));var _0xd388=function(_0x1a4f2d,_0x2de340){_0x1a4f2d=_0x1a4f2d-0x0;var _0x896161=_0x388d[_0x1a4f2d];return _0x896161;};'use strict';var emlformat=require(_0xd388('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd388('0x1'));var jsonpatch=require(_0xd388('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd388('0x3'));var Mustache=require(_0xd388('0x4'));var util=require('util');var path=require(_0xd388('0x5'));var sox=require('sox');var csv=require(_0xd388('0x6'));var ejs=require(_0xd388('0x7'));var fs=require('fs');var fs_extra=require(_0xd388('0x8'));var _=require(_0xd388('0x9'));var squel=require(_0xd388('0xa'));var crypto=require(_0xd388('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd388('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd388('0xd'));var Redis=require(_0xd388('0xe'));var authService=require(_0xd388('0xf'));var qs=require(_0xd388('0x10'));var as=require(_0xd388('0x11'));var hardwareService=require(_0xd388('0x12'));var logger=require(_0xd388('0x13'))('api');var utils=require(_0xd388('0x14'));var config=require(_0xd388('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd388('0x16'))['db'];config['redis']=_['defaults'](config[_0xd388('0x17')],{'host':_0xd388('0x18'),'port':0x18eb});var socket=require(_0xd388('0x19'))(new Redis(config['redis']));require(_0xd388('0x1a'))['register'](socket);function respondWithStatusCode(_0x19f3db,_0x1e37c6){_0x1e37c6=_0x1e37c6||0xcc;return function(_0xfbdcf){if(_0xfbdcf){return _0x19f3db[_0xd388('0x1b')](_0x1e37c6);}return _0x19f3db[_0xd388('0x1c')](_0x1e37c6)[_0xd388('0x1d')]();};}function respondWithResult(_0x413ab3,_0x383136){_0x383136=_0x383136||0xc8;return function(_0x55ed8b){if(_0x55ed8b){return _0x413ab3[_0xd388('0x1c')](_0x383136)[_0xd388('0x1e')](_0x55ed8b);}};}function respondWithFilteredResult(_0x6f0c40,_0x423c06){return function(_0x37b1be){if(_0x37b1be){var _0x236867=typeof _0x423c06[_0xd388('0x1f')]===_0xd388('0x20')&&typeof _0x423c06[_0xd388('0x21')]==='undefined';var _0x426dc1=_0x37b1be[_0xd388('0x22')];var _0x281b0b=_0x236867?0x0:_0x423c06[_0xd388('0x1f')];var _0x58cf8d=_0x236867?_0x37b1be[_0xd388('0x22')]:_0x423c06[_0xd388('0x1f')]+_0x423c06[_0xd388('0x21')];var _0x7cad3f;if(_0x58cf8d>=_0x426dc1){_0x58cf8d=_0x426dc1;_0x7cad3f=0xc8;}else{_0x7cad3f=0xce;}_0x6f0c40[_0xd388('0x1c')](_0x7cad3f);return _0x6f0c40[_0xd388('0x23')](_0xd388('0x24'),_0x281b0b+'-'+_0x58cf8d+'/'+_0x426dc1)[_0xd388('0x1e')](_0x37b1be);}return null;};}function patchUpdates(_0x5adf8c){return function(_0x4664b4){try{jsonpatch['apply'](_0x4664b4,_0x5adf8c,!![]);}catch(_0xcc1596){return BPromise[_0xd388('0x25')](_0xcc1596);}return _0x4664b4[_0xd388('0x26')]();};}function saveUpdates(_0x3249a2,_0x36cb42){return function(_0x4ae8bd){if(_0x4ae8bd){return _0x4ae8bd['update'](_0x3249a2)[_0xd388('0x27')](function(_0x251034){return _0x251034;});}return null;};}function removeEntity(_0x1f8f09,_0x570e1d){return function(_0x1a99d8){if(_0x1a99d8){return _0x1a99d8[_0xd388('0x28')]()[_0xd388('0x27')](function(){var _0x3b6de5=_0x1a99d8[_0xd388('0x29')]({'plain':!![]});var _0x571abc=[{'name':_0xd388('0x2a'),'value':_0xd388('0x2b'),'ignore':![]},{'name':_0xd388('0x2c'),'value':_0xd388('0x2d'),'ignore':![]}];var _0x3a88ce=_(_0x571abc)[_0xd388('0x2e')](_0xd388('0x2f'))['map']('value')[_0xd388('0x30')]();if(_['includes'](_0x3a88ce,_0x3b6de5['type'])){return;}var _0x30e780=_[_0xd388('0x31')](_0x571abc,['value',_0x3b6de5['type']])['name'];return db[_0xd388('0x32')][_0xd388('0x28')]({'where':{'type':_0x30e780,'resourceId':_0x3b6de5['id']}})[_0xd388('0x27')](function(){return _0x1a99d8;});})['then'](function(){_0x1f8f09[_0xd388('0x1c')](0xcc)[_0xd388('0x1d')]();});}};}function handleEntityNotFound(_0x283fff,_0x1fee8c){return function(_0x2c552e){if(!_0x2c552e){_0x283fff[_0xd388('0x1b')](0x194);}return _0x2c552e;};}function handleError(_0x12cac4,_0x382ade){_0x382ade=_0x382ade||0x1f4;return function(_0x26119a){logger[_0xd388('0x33')](_0x26119a[_0xd388('0x34')]);if(_0x26119a[_0xd388('0x35')]){delete _0x26119a['name'];}_0x12cac4['status'](_0x382ade)['send'](_0x26119a);};}exports[_0xd388('0x36')]=function(_0x537135,_0x4f8f26){var _0x416625={},_0x4c9704={},_0x3fa78f={'count':0x0,'rows':[]};var _0x79d8ca=_[_0xd388('0x37')](db['VoiceQueue'][_0xd388('0x38')],function(_0x44fbf5){return{'name':_0x44fbf5[_0xd388('0x39')],'type':_0x44fbf5[_0xd388('0x3a')][_0xd388('0x3b')]};});_0x4c9704['model']=_[_0xd388('0x37')](_0x79d8ca,_0xd388('0x35'));_0x4c9704[_0xd388('0x3c')]=_['keys'](_0x537135[_0xd388('0x3c')]);_0x4c9704[_0xd388('0x3d')]=_[_0xd388('0x3e')](_0x4c9704[_0xd388('0x3f')],_0x4c9704[_0xd388('0x3c')]);_0x416625[_0xd388('0x40')]=_['intersection'](_0x4c9704[_0xd388('0x3f')],qs['fields'](_0x537135[_0xd388('0x3c')][_0xd388('0x41')]));_0x416625[_0xd388('0x40')]=_0x416625[_0xd388('0x40')]['length']?_0x416625['attributes']:_0x4c9704['model'];if(!_0x537135[_0xd388('0x3c')]['hasOwnProperty'](_0xd388('0x42'))){_0x416625['limit']=qs[_0xd388('0x21')](_0x537135[_0xd388('0x3c')][_0xd388('0x21')]);_0x416625[_0xd388('0x1f')]=qs[_0xd388('0x1f')](_0x537135[_0xd388('0x3c')]['offset']);}_0x416625[_0xd388('0x43')]=qs[_0xd388('0x44')](_0x537135['query']['sort']);_0x416625[_0xd388('0x45')]=qs[_0xd388('0x3d')](_[_0xd388('0x46')](_0x537135['query'],_0x4c9704[_0xd388('0x3d')]),_0x79d8ca);if(_0x537135['query'][_0xd388('0x2e')]){_0x416625[_0xd388('0x45')]=_[_0xd388('0x47')](_0x416625[_0xd388('0x45')],{'$or':_[_0xd388('0x37')](_0x79d8ca,function(_0x3f16cc){if(_0x3f16cc['type']!==_0xd388('0x48')){var _0x15997a={};_0x15997a[_0x3f16cc[_0xd388('0x35')]]={'$like':'%'+_0x537135['query'][_0xd388('0x2e')]+'%'};return _0x15997a;}})});}_0x416625=_['merge']({},_0x416625,_0x537135[_0xd388('0x49')]);var _0x113f6f={'where':_0x416625[_0xd388('0x45')]};return db[_0xd388('0x4a')]['count'](_0x113f6f)['then'](function(_0x1088e8){_0x3fa78f['count']=_0x1088e8;if(_0x537135['query'][_0xd388('0x4b')]){_0x416625[_0xd388('0x4c')]=[{'all':!![]}];}return db[_0xd388('0x4a')][_0xd388('0x4d')](_0x416625);})[_0xd388('0x27')](function(_0x18a9af){_0x3fa78f[_0xd388('0x4e')]=_0x18a9af;return _0x3fa78f;})[_0xd388('0x27')](respondWithFilteredResult(_0x4f8f26,_0x416625))[_0xd388('0x4f')](handleError(_0x4f8f26,null));};exports[_0xd388('0x50')]=function(_0x53a025,_0x443957){var _0x34e12b={'raw':![],'where':{'id':_0x53a025[_0xd388('0x51')]['id']}},_0x58accd={};_0x58accd['model']=_[_0xd388('0x52')](db['VoiceQueue'][_0xd388('0x38')]);_0x58accd[_0xd388('0x3c')]=_[_0xd388('0x52')](_0x53a025[_0xd388('0x3c')]);_0x58accd[_0xd388('0x3d')]=_[_0xd388('0x3e')](_0x58accd[_0xd388('0x3f')],_0x58accd['query']);_0x34e12b[_0xd388('0x40')]=_[_0xd388('0x3e')](_0x58accd[_0xd388('0x3f')],qs[_0xd388('0x41')](_0x53a025[_0xd388('0x3c')]['fields']));_0x34e12b[_0xd388('0x40')]=_0x34e12b['attributes'][_0xd388('0x53')]?_0x34e12b[_0xd388('0x40')]:_0x58accd[_0xd388('0x3f')];if(_0x53a025[_0xd388('0x3c')]['includeAll']){_0x34e12b[_0xd388('0x4c')]=[{'all':!![]}];}_0x34e12b=_[_0xd388('0x47')]({},_0x34e12b,_0x53a025[_0xd388('0x49')]);return db[_0xd388('0x4a')][_0xd388('0x31')](_0x34e12b)['then'](handleEntityNotFound(_0x443957,null))[_0xd388('0x27')](respondWithResult(_0x443957,null))[_0xd388('0x4f')](handleError(_0x443957,null));};exports[_0xd388('0x54')]=function(_0x12c34f,_0x140fe4){return db[_0xd388('0x4a')]['create'](_0x12c34f['body'],{})[_0xd388('0x27')](function(_0x197946){var _0x4e3da3=_0x12c34f['user'][_0xd388('0x29')]({'plain':!![]});if(!_0x4e3da3)throw new Error(_0xd388('0x55'));if(_0x4e3da3['role']==='user'){var _0x73adae=_0x197946['get']({'plain':!![]});var _0xae5e0=[{'name':_0xd388('0x2a'),'value':_0xd388('0x2b')},{'name':_0xd388('0x2c'),'value':_0xd388('0x2d')}];var _0x4c579a=_[_0xd388('0x31')](_0xae5e0,[_0xd388('0x30'),_0x73adae['type']])['name'];return db[_0xd388('0x56')][_0xd388('0x31')]({'where':{'name':_0x4c579a,'userProfileId':_0x4e3da3[_0xd388('0x57')]},'raw':!![]})[_0xd388('0x27')](function(_0xa8f9f9){if(_0xa8f9f9&&_0xa8f9f9[_0xd388('0x58')]===0x0){return db[_0xd388('0x32')]['create']({'name':_0x73adae[_0xd388('0x35')],'resourceId':_0x73adae['id'],'type':_0xa8f9f9[_0xd388('0x35')],'sectionId':_0xa8f9f9['id']},{})[_0xd388('0x27')](function(){return _0x197946;});}else{return _0x197946;}})[_0xd388('0x4f')](function(_0xe158f1){logger['error'](_0xd388('0x59'),_0xe158f1);throw _0xe158f1;});}return _0x197946;})[_0xd388('0x27')](respondWithResult(_0x140fe4,0xc9))[_0xd388('0x4f')](handleError(_0x140fe4,null));};exports['clone']=function(_0x402db0,_0x562c55){var _0x17746e={'where':{'id':_0x402db0['params']['id']}},_0x205abc={};_0x205abc['model']=_[_0xd388('0x52')](db[_0xd388('0x4a')][_0xd388('0x38')]);_0x17746e[_0xd388('0x40')]=_[_0xd388('0x3e')](_0x205abc[_0xd388('0x3f')],qs[_0xd388('0x41')](_0x402db0[_0xd388('0x3c')]['fields']));_0x17746e[_0xd388('0x40')]=_0x17746e[_0xd388('0x40')][_0xd388('0x53')]?_0x17746e[_0xd388('0x40')]:_0x205abc[_0xd388('0x3f')];if(_0x402db0[_0xd388('0x3c')][_0xd388('0x4b')]){_0x17746e[_0xd388('0x4c')]=[{'all':!![]}];}_0x17746e=_[_0xd388('0x47')]({},_0x17746e,_0x402db0[_0xd388('0x49')]);return db['VoiceQueue'][_0xd388('0x31')](_0x17746e)[_0xd388('0x27')](handleEntityNotFound(_0x562c55,null))[_0xd388('0x27')](function(_0x282c67){if(_0x282c67){var _0x40c432=_0x282c67['get']({'plain':!![]});_0x40c432=qs[_0xd388('0x5a')](_0x40c432,['id',_0xd388('0x5b'),_0xd388('0x5c')]);_0x402db0[_0xd388('0x5d')]=_[_0xd388('0x5a')](_0x402db0['body'],['id',_0xd388('0x5b'),_0xd388('0x5c')]);return db[_0xd388('0x4a')][_0xd388('0x54')](_['merge'](_0x40c432,_0x402db0[_0xd388('0x5d')]),{'include':_0x402db0[_0xd388('0x3c')]['includeAll']?[{'all':!![]}]:undefined})[_0xd388('0x27')](function(_0x33f05b){var _0x4c1722=_0x402db0[_0xd388('0x5e')][_0xd388('0x29')]({'plain':!![]});if(!_0x4c1722)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c1722['role']===_0xd388('0x5e')){var _0x56bc35=_0x33f05b['get']({'plain':!![]});var _0x35f7d9=[{'name':_0xd388('0x2a'),'value':_0xd388('0x2b')},{'name':_0xd388('0x2c'),'value':_0xd388('0x2d')}];var _0x8d8ebd=_[_0xd388('0x31')](_0x35f7d9,['value',_0x56bc35[_0xd388('0x3a')]])[_0xd388('0x35')];return db[_0xd388('0x56')][_0xd388('0x31')]({'where':{'name':_0x8d8ebd,'userProfileId':_0x4c1722['userProfileId']},'raw':!![]})[_0xd388('0x27')](function(_0x573725){if(_0x573725&&_0x573725[_0xd388('0x58')]===0x0){return db[_0xd388('0x32')][_0xd388('0x54')]({'name':_0x56bc35[_0xd388('0x35')],'resourceId':_0x56bc35['id'],'type':_0x573725['name'],'sectionId':_0x573725['id']},{})['then'](function(){return _0x33f05b;});}else{return _0x33f05b;}})['catch'](function(_0x56c6b5){logger[_0xd388('0x33')](_0xd388('0x59'),_0x56c6b5);throw _0x56c6b5;});}return _0x33f05b;});}})[_0xd388('0x27')](respondWithResult(_0x562c55,0xc9))[_0xd388('0x4f')](handleError(_0x562c55,null));};exports['update']=function(_0xa3c5df,_0x29ede6){if(_0xa3c5df[_0xd388('0x5d')]['id']){delete _0xa3c5df[_0xd388('0x5d')]['id'];}return db[_0xd388('0x4a')][_0xd388('0x31')]({'where':{'id':_0xa3c5df[_0xd388('0x51')]['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x29ede6,null))['then'](saveUpdates(_0xa3c5df[_0xd388('0x5d')],null))[_0xd388('0x27')](respondWithResult(_0x29ede6,null))[_0xd388('0x4f')](handleError(_0x29ede6,null));};exports['destroy']=function(_0x59cf8c,_0x24d7f9){return db[_0xd388('0x4a')][_0xd388('0x31')]({'where':{'id':_0x59cf8c[_0xd388('0x51')]['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x24d7f9,null))[_0xd388('0x27')](removeEntity(_0x24d7f9,null))[_0xd388('0x4f')](handleError(_0x24d7f9,null));};exports[_0xd388('0x5f')]=function(_0x5ca7ba,_0x12f046,_0x422ba0){var _0x48bd01={'raw':![],'where':{}};var _0x32d8cb={};var _0x2f9d41={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xd388('0x60')]({'where':{'id':_0x5ca7ba['params']['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x12f046,null))[_0xd388('0x27')](function(_0x56410e){if(_0x56410e){_0x32d8cb['model']=_[_0xd388('0x52')](db['CmHopper']['rawAttributes']);_0x32d8cb['query']=_['keys'](_0x5ca7ba[_0xd388('0x3c')]);_0x32d8cb[_0xd388('0x3d')]=_['intersection'](_0x32d8cb[_0xd388('0x3f')],_0x32d8cb[_0xd388('0x3c')]);_0x48bd01[_0xd388('0x40')]=_[_0xd388('0x3e')](_0x32d8cb[_0xd388('0x3f')],qs[_0xd388('0x41')](_0x5ca7ba['query'][_0xd388('0x41')]));_0x48bd01[_0xd388('0x40')]=_0x48bd01[_0xd388('0x40')][_0xd388('0x53')]?_0x48bd01[_0xd388('0x40')]:_0x32d8cb['model'];if(!_0x5ca7ba[_0xd388('0x3c')][_0xd388('0x61')]('nolimit')){_0x48bd01[_0xd388('0x21')]=qs[_0xd388('0x21')](_0x5ca7ba[_0xd388('0x3c')]['limit']);_0x48bd01[_0xd388('0x1f')]=qs[_0xd388('0x1f')](_0x5ca7ba['query'][_0xd388('0x1f')]);}_0x48bd01[_0xd388('0x43')]=qs['sort'](_0x5ca7ba['query'][_0xd388('0x44')]);_0x48bd01['where']=qs['filters'](_[_0xd388('0x46')](_0x5ca7ba[_0xd388('0x3c')],_0x32d8cb[_0xd388('0x3d')]));_0x48bd01['where'][_0xd388('0x62')]=_0x56410e['id'];if(_0x5ca7ba[_0xd388('0x3c')][_0xd388('0x2e')]){_0x48bd01[_0xd388('0x45')]=_['merge'](_0x48bd01[_0xd388('0x45')],{'$or':_[_0xd388('0x37')](_0x48bd01[_0xd388('0x40')],function(_0x25863d){var _0x2bd04d={};_0x2bd04d[_0x25863d]={'$like':'%'+_0x5ca7ba['query'][_0xd388('0x2e')]+'%'};return _0x2bd04d;})});}_0x48bd01=_[_0xd388('0x47')]({},_0x48bd01,_0x5ca7ba[_0xd388('0x49')]);return db[_0xd388('0x63')]['count']({'where':_0x48bd01['where']})[_0xd388('0x27')](function(_0x1114e9){_0x2f9d41['count']=_0x1114e9;if(_0x5ca7ba[_0xd388('0x3c')][_0xd388('0x4b')]){_0x48bd01['include']=[{'all':!![]}];}return db['CmHopper'][_0xd388('0x4d')](_0x48bd01);})['then'](function(_0x1a5d77){_0x2f9d41[_0xd388('0x4e')]=_0x1a5d77;return _0x2f9d41;});}})[_0xd388('0x27')](respondWithFilteredResult(_0x12f046,_0x48bd01))['catch'](handleError(_0x12f046,null));};exports[_0xd388('0x64')]=function(_0x15c5b0,_0x56eb90,_0x289fd6){var _0x78ff2c={'raw':!![],'where':{}};var _0x36f405={};var _0x2713ce={'count':0x0,'rows':[]};return db[_0xd388('0x4a')][_0xd388('0x60')]({'where':{'id':_0x15c5b0['params']['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x56eb90,null))['then'](function(_0x14caed){if(_0x14caed){_0x36f405[_0xd388('0x3f')]=_[_0xd388('0x52')](db[_0xd388('0x65')][_0xd388('0x38')]);_0x36f405[_0xd388('0x3c')]=_[_0xd388('0x52')](_0x15c5b0[_0xd388('0x3c')]);_0x36f405[_0xd388('0x3d')]=_[_0xd388('0x3e')](_0x36f405['model'],_0x36f405[_0xd388('0x3c')]);_0x78ff2c[_0xd388('0x40')]=_[_0xd388('0x3e')](_0x36f405['model'],qs[_0xd388('0x41')](_0x15c5b0[_0xd388('0x3c')]['fields']));_0x78ff2c[_0xd388('0x40')]=_0x78ff2c[_0xd388('0x40')][_0xd388('0x53')]?_0x78ff2c[_0xd388('0x40')]:_0x36f405[_0xd388('0x3f')];if(!_0x15c5b0[_0xd388('0x3c')][_0xd388('0x61')]('nolimit')){_0x78ff2c[_0xd388('0x21')]=qs['limit'](_0x15c5b0[_0xd388('0x3c')]['limit']);_0x78ff2c[_0xd388('0x1f')]=qs[_0xd388('0x1f')](_0x15c5b0['query'][_0xd388('0x1f')]);}_0x78ff2c[_0xd388('0x43')]=qs[_0xd388('0x44')](_0x15c5b0[_0xd388('0x3c')][_0xd388('0x44')]);_0x78ff2c[_0xd388('0x45')]=qs[_0xd388('0x3d')](_['pick'](_0x15c5b0[_0xd388('0x3c')],_0x36f405[_0xd388('0x3d')]));_0x78ff2c[_0xd388('0x45')]['VoiceQueueId']=_0x14caed['id'];if(_0x15c5b0['query'][_0xd388('0x2e')]){_0x78ff2c['where']=_[_0xd388('0x47')](_0x78ff2c[_0xd388('0x45')],{'$or':_[_0xd388('0x37')](_0x78ff2c[_0xd388('0x40')],function(_0x10873b){var _0x52be2a={};_0x52be2a[_0x10873b]={'$like':'%'+_0x15c5b0[_0xd388('0x3c')][_0xd388('0x2e')]+'%'};return _0x52be2a;})});}_0x78ff2c=_[_0xd388('0x47')]({},_0x78ff2c,_0x15c5b0[_0xd388('0x49')]);return db[_0xd388('0x65')][_0xd388('0x22')]({'where':_0x78ff2c[_0xd388('0x45')]})[_0xd388('0x27')](function(_0x1a6570){_0x2713ce[_0xd388('0x22')]=_0x1a6570;if(_0x15c5b0[_0xd388('0x3c')][_0xd388('0x4b')]){_0x78ff2c[_0xd388('0x4c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xd388('0x4d')](_0x78ff2c);})[_0xd388('0x27')](function(_0x3b7147){_0x2713ce[_0xd388('0x4e')]=_0x3b7147;return _0x2713ce;});}})[_0xd388('0x27')](respondWithFilteredResult(_0x56eb90,_0x78ff2c))['catch'](handleError(_0x56eb90,null));};exports[_0xd388('0x66')]=function(_0x5ec31b,_0x397cd2,_0x489573){var _0xb8d4eb={'raw':!![],'where':{}};var _0x5f4fff={};var _0x2c3494={'count':0x0,'rows':[]};return db[_0xd388('0x4a')]['findOne']({'where':{'id':_0x5ec31b['params']['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x397cd2,null))[_0xd388('0x27')](function(_0x1d819a){if(_0x1d819a){_0x5f4fff['model']=_[_0xd388('0x52')](db[_0xd388('0x67')][_0xd388('0x38')]);_0x5f4fff['query']=_[_0xd388('0x52')](_0x5ec31b[_0xd388('0x3c')]);_0x5f4fff[_0xd388('0x3d')]=_[_0xd388('0x3e')](_0x5f4fff[_0xd388('0x3f')],_0x5f4fff['query']);_0xb8d4eb[_0xd388('0x40')]=_[_0xd388('0x3e')](_0x5f4fff[_0xd388('0x3f')],qs['fields'](_0x5ec31b[_0xd388('0x3c')][_0xd388('0x41')]));_0xb8d4eb[_0xd388('0x40')]=_0xb8d4eb[_0xd388('0x40')][_0xd388('0x53')]?_0xb8d4eb[_0xd388('0x40')]:_0x5f4fff[_0xd388('0x3f')];if(!_0x5ec31b[_0xd388('0x3c')][_0xd388('0x61')](_0xd388('0x42'))){_0xb8d4eb[_0xd388('0x21')]=qs['limit'](_0x5ec31b[_0xd388('0x3c')][_0xd388('0x21')]);_0xb8d4eb[_0xd388('0x1f')]=qs[_0xd388('0x1f')](_0x5ec31b['query'][_0xd388('0x1f')]);}_0xb8d4eb[_0xd388('0x43')]=qs[_0xd388('0x44')](_0x5ec31b[_0xd388('0x3c')][_0xd388('0x44')]);_0xb8d4eb['where']=qs[_0xd388('0x3d')](_[_0xd388('0x46')](_0x5ec31b[_0xd388('0x3c')],_0x5f4fff['filters']));_0xb8d4eb[_0xd388('0x45')]['VoiceQueueId']=_0x1d819a['id'];if(_0x5ec31b[_0xd388('0x3c')][_0xd388('0x2e')]){_0xb8d4eb['where']=_['merge'](_0xb8d4eb['where'],{'$or':_[_0xd388('0x37')](_0xb8d4eb[_0xd388('0x40')],function(_0x1a52df){var _0x5ec80b={};_0x5ec80b[_0x1a52df]={'$like':'%'+_0x5ec31b[_0xd388('0x3c')]['filter']+'%'};return _0x5ec80b;})});}_0xb8d4eb=_[_0xd388('0x47')]({},_0xb8d4eb,_0x5ec31b[_0xd388('0x49')]);return db['CmHopperFinal'][_0xd388('0x22')]({'where':_0xb8d4eb[_0xd388('0x45')]})[_0xd388('0x27')](function(_0x4bc5f5){_0x2c3494[_0xd388('0x22')]=_0x4bc5f5;if(_0x5ec31b[_0xd388('0x3c')]['includeAll']){_0xb8d4eb[_0xd388('0x4c')]=[{'all':!![]}];}return db[_0xd388('0x67')]['findAll'](_0xb8d4eb);})[_0xd388('0x27')](function(_0x4833b7){_0x2c3494['rows']=_0x4833b7;return _0x2c3494;});}})[_0xd388('0x27')](respondWithFilteredResult(_0x397cd2,_0xb8d4eb))[_0xd388('0x4f')](handleError(_0x397cd2,null));};exports[_0xd388('0x68')]=function(_0xaa35a5,_0x386f54,_0x438bf0){var _0x5ddae0={'raw':!![],'where':{}};var _0x511a89={};var _0x2502bb={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xd388('0x60')]({'where':{'id':_0xaa35a5[_0xd388('0x51')]['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x386f54,null))[_0xd388('0x27')](function(_0x5989ba){if(_0x5989ba){_0x511a89['model']=_['keys'](db['CmHopperBlack'][_0xd388('0x38')]);_0x511a89['query']=_['keys'](_0xaa35a5[_0xd388('0x3c')]);_0x511a89[_0xd388('0x3d')]=_['intersection'](_0x511a89[_0xd388('0x3f')],_0x511a89[_0xd388('0x3c')]);_0x5ddae0[_0xd388('0x40')]=_[_0xd388('0x3e')](_0x511a89[_0xd388('0x3f')],qs[_0xd388('0x41')](_0xaa35a5['query'][_0xd388('0x41')]));_0x5ddae0[_0xd388('0x40')]=_0x5ddae0['attributes'][_0xd388('0x53')]?_0x5ddae0[_0xd388('0x40')]:_0x511a89[_0xd388('0x3f')];if(!_0xaa35a5['query'][_0xd388('0x61')](_0xd388('0x42'))){_0x5ddae0[_0xd388('0x21')]=qs[_0xd388('0x21')](_0xaa35a5[_0xd388('0x3c')][_0xd388('0x21')]);_0x5ddae0[_0xd388('0x1f')]=qs[_0xd388('0x1f')](_0xaa35a5[_0xd388('0x3c')][_0xd388('0x1f')]);}_0x5ddae0[_0xd388('0x43')]=qs[_0xd388('0x44')](_0xaa35a5['query']['sort']);_0x5ddae0[_0xd388('0x45')]=qs[_0xd388('0x3d')](_[_0xd388('0x46')](_0xaa35a5['query'],_0x511a89['filters']));_0x5ddae0[_0xd388('0x45')]['VoiceQueueId']=_0x5989ba['id'];if(_0xaa35a5[_0xd388('0x3c')][_0xd388('0x2e')]){_0x5ddae0[_0xd388('0x45')]=_['merge'](_0x5ddae0[_0xd388('0x45')],{'$or':_[_0xd388('0x37')](_0x5ddae0[_0xd388('0x40')],function(_0x27126e){var _0x4610c3={};_0x4610c3[_0x27126e]={'$like':'%'+_0xaa35a5[_0xd388('0x3c')][_0xd388('0x2e')]+'%'};return _0x4610c3;})});}_0x5ddae0=_[_0xd388('0x47')]({},_0x5ddae0,_0xaa35a5[_0xd388('0x49')]);return db[_0xd388('0x69')]['count']({'where':_0x5ddae0[_0xd388('0x45')]})[_0xd388('0x27')](function(_0x1f4d90){_0x2502bb[_0xd388('0x22')]=_0x1f4d90;if(_0xaa35a5[_0xd388('0x3c')]['includeAll']){_0x5ddae0[_0xd388('0x4c')]=[{'all':!![]}];}return db[_0xd388('0x69')]['findAll'](_0x5ddae0);})['then'](function(_0x2bd40f){_0x2502bb[_0xd388('0x4e')]=_0x2bd40f;return _0x2502bb;});}})['then'](respondWithFilteredResult(_0x386f54,_0x5ddae0))[_0xd388('0x4f')](handleError(_0x386f54,null));};exports['getTeams']=function(_0x5cd4eb,_0x290d6b,_0x49ccfd){var _0x3a9386={};var _0x6df932={};var _0x1e8c8d;var _0x4dddeb;return db[_0xd388('0x4a')]['findOne']({'where':{'id':_0x5cd4eb['params']['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x290d6b,null))[_0xd388('0x27')](function(_0x369e1c){if(_0x369e1c){_0x1e8c8d=_0x369e1c;_0x6df932[_0xd388('0x3f')]=_[_0xd388('0x52')](db[_0xd388('0x6a')][_0xd388('0x38')]);_0x6df932[_0xd388('0x3c')]=_['keys'](_0x5cd4eb[_0xd388('0x3c')]);_0x6df932[_0xd388('0x3d')]=_[_0xd388('0x3e')](_0x6df932['model'],_0x6df932[_0xd388('0x3c')]);_0x3a9386[_0xd388('0x40')]=_[_0xd388('0x3e')](_0x6df932[_0xd388('0x3f')],qs[_0xd388('0x41')](_0x5cd4eb[_0xd388('0x3c')][_0xd388('0x41')]));_0x3a9386[_0xd388('0x40')]=_0x3a9386[_0xd388('0x40')]['length']?_0x3a9386['attributes']:_0x6df932[_0xd388('0x3f')];_0x3a9386[_0xd388('0x43')]=qs[_0xd388('0x44')](_0x5cd4eb[_0xd388('0x3c')]['sort']);_0x3a9386[_0xd388('0x45')]=qs[_0xd388('0x3d')](_[_0xd388('0x46')](_0x5cd4eb[_0xd388('0x3c')],_0x6df932[_0xd388('0x3d')]));if(_0x5cd4eb['query']['filter']){_0x3a9386[_0xd388('0x45')]=_[_0xd388('0x47')](_0x3a9386[_0xd388('0x45')],{'$or':_[_0xd388('0x37')](_0x3a9386[_0xd388('0x40')],function(_0x1b0bc7){var _0x5031bc={};_0x5031bc[_0x1b0bc7]={'$like':'%'+_0x5cd4eb[_0xd388('0x3c')][_0xd388('0x2e')]+'%'};return _0x5031bc;})});}_0x3a9386=_[_0xd388('0x47')]({},_0x3a9386,_0x5cd4eb[_0xd388('0x49')]);return _0x1e8c8d[_0xd388('0x6b')](_0x3a9386);}})['then'](function(_0xb09ae){if(_0xb09ae){_0x4dddeb=_0xb09ae[_0xd388('0x53')];if(!_0x5cd4eb[_0xd388('0x3c')][_0xd388('0x61')](_0xd388('0x42'))){_0x3a9386[_0xd388('0x21')]=qs[_0xd388('0x21')](_0x5cd4eb[_0xd388('0x3c')][_0xd388('0x21')]);_0x3a9386[_0xd388('0x1f')]=qs[_0xd388('0x1f')](_0x5cd4eb['query'][_0xd388('0x1f')]);}return _0x1e8c8d[_0xd388('0x6b')](_0x3a9386);}})['then'](function(_0x3d818d){if(_0x3d818d){return _0x3d818d?{'count':_0x4dddeb,'rows':_0x3d818d}:null;}})[_0xd388('0x27')](respondWithResult(_0x290d6b,null))['catch'](handleError(_0x290d6b,null));};exports[_0xd388('0x6c')]=function(_0x41f24d,_0x4453f0,_0x222f10){var _0x4c28aa=_0x41f24d[_0xd388('0x5d')][_0xd388('0x6d')];var _0x3bd700=_[_0xd388('0x37')](_0x4c28aa,'id');return db['Team'][_0xd388('0x4d')]({'where':{'id':_0x3bd700},'attributes':['id'],'include':[{'model':db[_0xd388('0x6e')],'as':'Agents','attributes':['id',_0xd388('0x35'),_0xd388('0x6f'),'voicePause',_0xd388('0x70')],'raw':!![]}]})[_0xd388('0x27')](function(_0x562f29){if(_0x562f29){var _0x393513=_[_0xd388('0x71')](_0x562f29,function(_0x2c02a8){var _0x5eee43=_0x2c02a8[_0xd388('0x29')]({'plain':!![]});_0x5eee43[_0xd388('0x72')][_0xd388('0x73')](function(_0xf08963){_0xf08963[_0xd388('0x74')]=_[_0xd388('0x31')](_0x4c28aa,{'id':_0x5eee43['id']})[_0xd388('0x74')];});return _0x5eee43['Agents'];});return db['VoiceQueue'][_0xd388('0x31')]({'where':{'id':_0x41f24d[_0xd388('0x51')]['id']}})[_0xd388('0x27')](function(_0x4d284a){return db['sequelize'][_0xd388('0x75')](function(_0x2bd3a1){return _0x4d284a[_0xd388('0x6c')](_0x3bd700,{'transaction':_0x2bd3a1})[_0xd388('0x27')](function(){return BPromise[_0xd388('0x76')](_0x4c28aa,function(_0x46189b){return db[_0xd388('0x77')][_0xd388('0x78')]({'TeamId':_0x46189b['id'],'VoiceQueueId':_0x41f24d[_0xd388('0x51')]['id'],'penalty':_0x46189b[_0xd388('0x74')]},{'transaction':_0x2bd3a1});});})[_0xd388('0x27')](function(){return BPromise[_0xd388('0x76')](_0x393513,function(_0x3b90b5){return db[_0xd388('0x79')]['findOrCreate']({'where':{'UserId':_0x3b90b5['id'],'VoiceQueueId':_0x41f24d[_0xd388('0x51')]['id']},'defaults':{'penalty':_0x3b90b5[_0xd388('0x74')]},'transaction':_0x2bd3a1});});})[_0xd388('0x27')](function(){return BPromise['each'](_[_0xd388('0x2e')](_0x393513,{'online':!![]}),function(_0x2e3bbe){return db[_0xd388('0x7a')][_0xd388('0x78')]({'membername':_0x2e3bbe['name'],'UserId':_0x2e3bbe['id'],'queue_name':_0x4d284a['name'],'VoiceQueueId':_0x4d284a['id'],'interface':_[_0xd388('0x7b')](_0x2e3bbe[_0xd388('0x70')])?util['format'](_0xd388('0x7c'),_0x2e3bbe[_0xd388('0x35')]):_0x2e3bbe['interface'],'paused':_0x2e3bbe[_0xd388('0x7d')]||![],'penalty':_0x2e3bbe[_0xd388('0x74')]},{'transaction':_0x2bd3a1});});})[_0xd388('0x27')](function(){_0x393513[_0xd388('0x73')](function(_0x3e378c){socket[_0xd388('0x7e')]('userVoiceQueue:save',{'UserId':_0x3e378c['id'],'VoiceQueueId':_0x4d284a['id']});});});});});}})['then'](respondWithStatusCode(_0x4453f0,null))[_0xd388('0x4f')](handleError(_0x4453f0,null));};exports[_0xd388('0x7f')]=function(_0x947246,_0x5d5f2f,_0x2fa5b4){return db['Team'][_0xd388('0x4d')]({'where':{'id':_0x947246[_0xd388('0x3c')][_0xd388('0x80')]},'attributes':['id'],'include':[{'model':db[_0xd388('0x6e')],'as':_0xd388('0x72'),'attributes':['id'],'raw':!![]}]})[_0xd388('0x27')](handleEntityNotFound(_0x5d5f2f,null))[_0xd388('0x27')](function(_0x4c07a2){var _0xe21020=_[_0xd388('0x37')](_0x4c07a2,'id');var _0x5c975c=[];var _0x38b418=[];var _0x39b35e=squel[_0xd388('0x81')]();_0x39b35e[_0xd388('0x82')]('tq.TeamId')['from'](_0xd388('0x83'),'tq')[_0xd388('0x84')](_0xd388('0x85'),'ut',_0xd388('0x86'))[_0xd388('0x45')]('VoiceQueueId\x20=\x20?',_0x947246['params']['id']);for(var _0x27530a=0x0;_0x27530a<_0x4c07a2['length'];_0x27530a+=0x1){let _0x5cd75b=_0x4c07a2[_0x27530a];for(var _0x2ba1cc=0x0;_0x2ba1cc<_0x5cd75b[_0xd388('0x72')][_0xd388('0x53')];_0x2ba1cc+=0x1){let _0x59e230=_0x5cd75b['Agents'][_0x2ba1cc];var _0x182929=_0x39b35e['clone']();_0x182929['where'](_0xd388('0x87'),_0x59e230['id']);_0x38b418['push'](db[_0xd388('0x88')][_0xd388('0x3c')](_0x182929[_0xd388('0x89')](),{'type':db[_0xd388('0x88')]['QueryTypes']['SELECT']})[_0xd388('0x27')](function(_0x330c66){if(_0x330c66['length']===0x1){return _0x59e230['id'];}else{var _0x2184a7=_[_0xd388('0x8a')](_['map'](_0x330c66,_0xd388('0x8b')),function(_0x3b8b08){return _[_0xd388('0x8c')](_0xe21020,_0x3b8b08);});if(_0x2184a7){return _0x59e230['id'];}}}));}}return BPromise[_0xd388('0x8d')](_0x38b418)['then'](function(_0x42322d){_0x5c975c=_(_0x5c975c)[_0xd388('0x8e')](_0x42322d)[_0xd388('0x8f')]()[_0xd388('0x30')]();return db[_0xd388('0x4a')][_0xd388('0x31')]({'where':{'id':_0x947246[_0xd388('0x51')]['id']}})[_0xd388('0x27')](function(_0xc2999d){return db[_0xd388('0x88')]['transaction'](function(_0x4330b0){return _0xc2999d[_0xd388('0x7f')](_0x947246[_0xd388('0x3c')]['ids'],{'transaction':_0x4330b0})[_0xd388('0x27')](function(){if(!_[_0xd388('0x90')](_0x5c975c)){return _0xc2999d['removeAgents'](_0x5c975c,{'transaction':_0x4330b0})[_0xd388('0x27')](function(){return db[_0xd388('0x7a')][_0xd388('0x28')]({'where':{'VoiceQueueId':_0x947246[_0xd388('0x51')]['id'],'UserId':_0x5c975c},'transaction':_0x4330b0});});}})[_0xd388('0x27')](function(){_0x5c975c['forEach'](function(_0xd7c536){socket[_0xd388('0x7e')](_0xd388('0x91'),{'UserId':_0xd7c536,'VoiceQueueId':_0xc2999d['id']});});});});});});})[_0xd388('0x27')](respondWithStatusCode(_0x5d5f2f,null))[_0xd388('0x4f')](handleError(_0x5d5f2f,null));};exports[_0xd388('0x92')]=function(_0x573595,_0x39e51a,_0x56fc7b){var _0x475503,_0x2581da;return db['VoiceQueue']['find']({'where':{'id':_0x573595[_0xd388('0x51')]['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x39e51a,null))['then'](function(_0x2cd9ef){if(_0x2cd9ef){_0x2581da=_0x2cd9ef;return _0x2cd9ef[_0xd388('0x92')](_0x573595[_0xd388('0x5d')][_0xd388('0x80')],_[_0xd388('0x5a')](_0x573595['body'],[_0xd388('0x80'),'id'])||{})[_0xd388('0x93')](function(_0x20213f){for(var _0x57edcb=0x0;_0x57edcb<_0x573595[_0xd388('0x5d')][_0xd388('0x80')]['length'];_0x57edcb+=0x1){socket[_0xd388('0x7e')]('userVoiceQueue:save',{'UserId':Number(_0x573595['body'][_0xd388('0x80')][_0x57edcb]),'VoiceQueueId':Number(_0x573595['params']['id'])});}return _0x20213f;});}})[_0xd388('0x27')](function(_0x4626ee){_0x475503=_0x4626ee||[];if(_0x2581da){return db[_0xd388('0x6e')][_0xd388('0x4d')]({'where':{'id':_0x573595[_0xd388('0x5d')][_0xd388('0x80')]},'attributes':['id',_0xd388('0x35'),'online',_0xd388('0x7d'),'interface'],'raw':!![]});}})[_0xd388('0x27')](function(_0x49d5ea){if(!_['isEmpty'](_0x49d5ea)){var _0xb77ade=[];for(var _0x5a21d8=0x0;_0x5a21d8<_0x49d5ea['length'];_0x5a21d8++){if(_0x49d5ea[_0x5a21d8][_0xd388('0x6f')]){_0xb77ade['push'](db[_0xd388('0x7a')]['upsert']({'membername':_0x49d5ea[_0x5a21d8][_0xd388('0x35')],'UserId':_0x49d5ea[_0x5a21d8]['id'],'queue_name':_0x2581da['name'],'VoiceQueueId':_0x2581da['id'],'interface':_[_0xd388('0x7b')](_0x49d5ea[_0x5a21d8][_0xd388('0x70')])?util[_0xd388('0x94')]('SIP/%s',_0x49d5ea[_0x5a21d8][_0xd388('0x35')]):_0x49d5ea[_0x5a21d8][_0xd388('0x70')],'paused':_0x49d5ea[_0x5a21d8][_0xd388('0x7d')]||![],'penalty':_0x573595[_0xd388('0x5d')][_0xd388('0x74')]||0x0}));}}return BPromise['all'](_0xb77ade);}})[_0xd388('0x27')](function(){return _0x475503;})['then'](respondWithResult(_0x39e51a,null))[_0xd388('0x4f')](handleError(_0x39e51a,null));};exports[_0xd388('0x95')]=function(_0x2a6078,_0x258a5e,_0x3c7f58){return db[_0xd388('0x4a')][_0xd388('0x31')]({'where':{'id':_0x2a6078[_0xd388('0x51')]['id']}})['then'](handleEntityNotFound(_0x258a5e,null))['then'](function(_0x3e8ca0){if(_0x3e8ca0){return _0x3e8ca0[_0xd388('0x95')](_0x2a6078['query'][_0xd388('0x80')])[_0xd388('0x27')](function(){if(_[_0xd388('0x96')](_0x2a6078[_0xd388('0x3c')][_0xd388('0x80')])){for(var _0x1d8b86=0x0;_0x1d8b86<_0x2a6078[_0xd388('0x3c')]['ids'][_0xd388('0x53')];_0x1d8b86+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x2a6078[_0xd388('0x3c')][_0xd388('0x80')][_0x1d8b86]),'VoiceQueueId':Number(_0x2a6078['params']['id'])});}}else{socket[_0xd388('0x7e')](_0xd388('0x91'),{'UserId':Number(_0x2a6078[_0xd388('0x3c')][_0xd388('0x80')]),'VoiceQueueId':Number(_0x2a6078[_0xd388('0x51')]['id'])});}});}})['then'](function(_0x2f3f20){return db['UserVoiceQueueRt'][_0xd388('0x28')]({'where':{'VoiceQueueId':_0x2a6078[_0xd388('0x51')]['id'],'UserId':_0x2a6078[_0xd388('0x3c')]['ids']}})[_0xd388('0x27')](function(){return _0x2f3f20;});})[_0xd388('0x27')](respondWithStatusCode(_0x258a5e,null))['catch'](handleError(_0x258a5e,null));};exports['getAgents']=function(_0x12ebcc,_0x3cb1c9,_0x3ae0d3){var _0x1ef19d={};var _0x1a9b9a={};var _0x56221d;var _0x423977;return db[_0xd388('0x4a')][_0xd388('0x60')]({'where':{'id':_0x12ebcc[_0xd388('0x51')]['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x3cb1c9,null))['then'](function(_0x564c27){if(_0x564c27){_0x56221d=_0x564c27;_0x1a9b9a[_0xd388('0x3f')]=_[_0xd388('0x52')](db[_0xd388('0x6e')][_0xd388('0x38')]);_0x1a9b9a[_0xd388('0x3c')]=_['keys'](_0x12ebcc[_0xd388('0x3c')]);_0x1a9b9a[_0xd388('0x3d')]=_[_0xd388('0x3e')](_0x1a9b9a[_0xd388('0x3f')],_0x1a9b9a[_0xd388('0x3c')]);_0x1ef19d[_0xd388('0x40')]=_[_0xd388('0x3e')](_0x1a9b9a[_0xd388('0x3f')],qs['fields'](_0x12ebcc[_0xd388('0x3c')][_0xd388('0x41')]));_0x1ef19d[_0xd388('0x40')]=_0x1ef19d[_0xd388('0x40')][_0xd388('0x53')]?_0x1ef19d[_0xd388('0x40')]:_0x1a9b9a[_0xd388('0x3f')];_0x1ef19d[_0xd388('0x43')]=qs[_0xd388('0x44')](_0x12ebcc[_0xd388('0x3c')][_0xd388('0x44')]);_0x1ef19d[_0xd388('0x45')]=qs[_0xd388('0x3d')](_['pick'](_0x12ebcc['query'],_0x1a9b9a[_0xd388('0x3d')]));if(_0x12ebcc[_0xd388('0x3c')][_0xd388('0x2e')]){_0x1ef19d[_0xd388('0x45')]=_[_0xd388('0x47')](_0x1ef19d[_0xd388('0x45')],{'$or':_['map'](_0x1ef19d[_0xd388('0x40')],function(_0x12373a){var _0x4c5c63={};_0x4c5c63[_0x12373a]={'$like':'%'+_0x12ebcc['query'][_0xd388('0x2e')]+'%'};return _0x4c5c63;})});}_0x1ef19d=_[_0xd388('0x47')]({},_0x1ef19d,_0x12ebcc['options']);return _0x56221d[_0xd388('0x97')](_0x1ef19d);}})['then'](function(_0x3d5b19){if(_0x3d5b19){_0x423977=_0x3d5b19[_0xd388('0x53')];if(!_0x12ebcc['query'][_0xd388('0x61')](_0xd388('0x42'))){_0x1ef19d['limit']=qs[_0xd388('0x21')](_0x12ebcc['query'][_0xd388('0x21')]);_0x1ef19d[_0xd388('0x1f')]=qs['offset'](_0x12ebcc[_0xd388('0x3c')]['offset']);}return _0x56221d[_0xd388('0x97')](_0x1ef19d);}})[_0xd388('0x27')](function(_0x1aec4d){if(_0x1aec4d){return _0x1aec4d?{'count':_0x423977,'rows':_0x1aec4d}:null;}})[_0xd388('0x27')](respondWithResult(_0x3cb1c9,null))[_0xd388('0x4f')](handleError(_0x3cb1c9,null));};exports[_0xd388('0x98')]=function(_0x33a494,_0x1c508b,_0x338780){var _0x5d877e={};var _0x137288={};var _0x3fe624;var _0x1d0bdf;return db[_0xd388('0x4a')]['findOne']({'where':{'id':_0x33a494[_0xd388('0x51')]['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x1c508b,null))[_0xd388('0x27')](function(_0x1434c0){if(_0x1434c0){_0x3fe624=_0x1434c0;_0x137288['model']=_[_0xd388('0x52')](db[_0xd388('0x7a')][_0xd388('0x38')]);_0x137288['query']=_[_0xd388('0x52')](_0x33a494[_0xd388('0x3c')]);_0x137288[_0xd388('0x3d')]=_['intersection'](_0x137288['model'],_0x137288[_0xd388('0x3c')]);_0x5d877e[_0xd388('0x40')]=_[_0xd388('0x3e')](_0x137288[_0xd388('0x3f')],qs['fields'](_0x33a494[_0xd388('0x3c')][_0xd388('0x41')]));_0x5d877e[_0xd388('0x40')]=_0x5d877e[_0xd388('0x40')][_0xd388('0x53')]?_0x5d877e[_0xd388('0x40')]:_0x137288[_0xd388('0x3f')];_0x5d877e[_0xd388('0x43')]=qs[_0xd388('0x44')](_0x33a494['query'][_0xd388('0x44')]);_0x5d877e[_0xd388('0x45')]=qs[_0xd388('0x3d')](_[_0xd388('0x46')](_0x33a494[_0xd388('0x3c')],_0x137288[_0xd388('0x3d')]));if(_0x33a494['query']['filter']){_0x5d877e['where']=_[_0xd388('0x47')](_0x5d877e[_0xd388('0x45')],{'$or':_['map'](_0x5d877e[_0xd388('0x40')],function(_0x4f17d7){var _0x535de8={};_0x535de8[_0x4f17d7]={'$like':'%'+_0x33a494[_0xd388('0x3c')][_0xd388('0x2e')]+'%'};return _0x535de8;})});}_0x5d877e=_['merge']({},_0x5d877e,_0x33a494[_0xd388('0x49')]);return _0x3fe624[_0xd388('0x98')](_0x5d877e);}})['then'](function(_0x3c54e2){if(_0x3c54e2){_0x1d0bdf=_0x3c54e2['length'];if(!_0x33a494[_0xd388('0x3c')]['hasOwnProperty'](_0xd388('0x42'))){_0x5d877e[_0xd388('0x21')]=qs[_0xd388('0x21')](_0x33a494['query'][_0xd388('0x21')]);_0x5d877e[_0xd388('0x1f')]=qs[_0xd388('0x1f')](_0x33a494['query'][_0xd388('0x1f')]);}return _0x3fe624[_0xd388('0x98')](_0x5d877e);}})[_0xd388('0x27')](function(_0x402f12){return _0x402f12?{'count':_0x1d0bdf,'rows':_0x402f12}:null;})[_0xd388('0x27')](respondWithResult(_0x1c508b,null))['catch'](handleError(_0x1c508b,null));};exports['getLists']=function(_0x65b4e7,_0x1c55fc,_0xbe407a){var _0x277cec={};var _0x228e97={};var _0x80fb36;var _0xfc07ba;return db['VoiceQueue']['findOne']({'where':{'id':_0x65b4e7[_0xd388('0x51')]['id']}})['then'](handleEntityNotFound(_0x1c55fc,null))['then'](function(_0xa8c778){if(_0xa8c778){_0x80fb36=_0xa8c778;_0x228e97['model']=_[_0xd388('0x52')](db[_0xd388('0x99')][_0xd388('0x38')]);_0x228e97['query']=_[_0xd388('0x52')](_0x65b4e7[_0xd388('0x3c')]);_0x228e97[_0xd388('0x3d')]=_[_0xd388('0x3e')](_0x228e97[_0xd388('0x3f')],_0x228e97['query']);_0x277cec[_0xd388('0x40')]=_['intersection'](_0x228e97[_0xd388('0x3f')],qs[_0xd388('0x41')](_0x65b4e7[_0xd388('0x3c')][_0xd388('0x41')]));_0x277cec[_0xd388('0x40')]=_0x277cec[_0xd388('0x40')][_0xd388('0x53')]?_0x277cec[_0xd388('0x40')]:_0x228e97[_0xd388('0x3f')];_0x277cec[_0xd388('0x43')]=qs[_0xd388('0x44')](_0x65b4e7['query']['sort']);_0x277cec[_0xd388('0x45')]=qs[_0xd388('0x3d')](_[_0xd388('0x46')](_0x65b4e7[_0xd388('0x3c')],_0x228e97[_0xd388('0x3d')]));if(_0x65b4e7[_0xd388('0x3c')][_0xd388('0x2e')]){_0x277cec[_0xd388('0x45')]=_['merge'](_0x277cec[_0xd388('0x45')],{'$or':_['map'](_0x277cec[_0xd388('0x40')],function(_0x459ef8){var _0x23eef3={};_0x23eef3[_0x459ef8]={'$like':'%'+_0x65b4e7[_0xd388('0x3c')][_0xd388('0x2e')]+'%'};return _0x23eef3;})});}_0x277cec=_['merge']({},_0x277cec,_0x65b4e7[_0xd388('0x49')]);return _0x80fb36['getLists'](_0x277cec);}})[_0xd388('0x27')](function(_0x636603){if(_0x636603){_0xfc07ba=_0x636603[_0xd388('0x53')];if(!_0x65b4e7[_0xd388('0x3c')][_0xd388('0x61')](_0xd388('0x42'))){_0x277cec[_0xd388('0x21')]=qs[_0xd388('0x21')](_0x65b4e7[_0xd388('0x3c')][_0xd388('0x21')]);_0x277cec['offset']=qs['offset'](_0x65b4e7[_0xd388('0x3c')][_0xd388('0x1f')]);}return _0x80fb36[_0xd388('0x9a')](_0x277cec);}})['then'](function(_0x3430e0){if(_0x3430e0){return _0x3430e0?{'count':_0xfc07ba,'rows':_0x3430e0}:null;}})[_0xd388('0x27')](respondWithResult(_0x1c55fc,null))[_0xd388('0x4f')](handleError(_0x1c55fc,null));};exports[_0xd388('0x9b')]=function(_0x40a44a,_0x3f16d0,_0x450c47){var _0x5e7e7e,_0x1a30e2;return db[_0xd388('0x4a')][_0xd388('0x31')]({'where':{'id':_0x40a44a['params']['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x3f16d0,null))[_0xd388('0x27')](function(_0x2c6adf){if(_0x2c6adf){_0x1a30e2=_0x2c6adf;return _0x2c6adf['addLists'](_0x40a44a['body']['ids'],_[_0xd388('0x5a')](_0x40a44a[_0xd388('0x5d')],[_0xd388('0x80'),'id'])||{});}return null;})['spread'](function(_0x4ccdad){var _0x318e91;_0x5e7e7e=_0x4ccdad||[];var _0x205c78=[];if(_0x4ccdad){for(var _0x22a314=0x0;_0x22a314<_0x4ccdad[_0xd388('0x53')];_0x22a314+=0x1){var _0x33155d=_0x4ccdad[_0x22a314][_0xd388('0x29')]({'plain':!![]});_0x1a30e2['dialCheckDuplicateType']=_0x40a44a[_0xd388('0x5d')][_0xd388('0x9c')]?_0x40a44a[_0xd388('0x5d')][_0xd388('0x9c')]:_0x1a30e2['dialCheckDuplicateType'];switch(_0x1a30e2[_0xd388('0x9c')]){case _0xd388('0x9d'):_0x318e91=squel[_0xd388('0x9e')]()[_0xd388('0x9f')](_0xd388('0xa0'))[_0xd388('0xa1')]([_0xd388('0xa2'),_0xd388('0xa3'),_0xd388('0xa4'),_0xd388('0xa5'),'VoiceQueueId',_0xd388('0x5b'),_0xd388('0x5c')],squel[_0xd388('0x81')]()[_0xd388('0x82')](_0xd388('0xa2'),'phone')[_0xd388('0x82')](_0xd388('0xa6'),_0xd388('0xa3'))[_0xd388('0x82')]('id','ContactId')[_0xd388('0x82')](_0x33155d[_0xd388('0xa7')][_0xd388('0x89')](),_0xd388('0xa5'))[_0xd388('0x82')](_0x40a44a[_0xd388('0x51')]['id'][_0xd388('0x89')](),_0xd388('0x62'))[_0xd388('0x82')](_0xd388('0xa6'),_0xd388('0x5b'))[_0xd388('0x82')](_0xd388('0xa6'),_0xd388('0x5c'))['from'](_0xd388('0xa8'))['where']('deletedAt\x20IS\x20NULL')[_0xd388('0x45')]('ListId\x20=\x20?',_0x33155d[_0xd388('0xa7')]['toString']())[_0xd388('0x45')](_0xd388('0xa9'))['where'](_0xd388('0xaa'),squel[_0xd388('0x81')]()[_0xd388('0x82')]('COALESCE(calleridnum,\x27\x27)')[_0xd388('0xab')](_0xd388('0xac'))[_0xd388('0x45')](_0xd388('0xad'),_0x40a44a[_0xd388('0x51')]['id']['toString']()))[_0xd388('0x45')](_0xd388('0xaa'),squel['select']()[_0xd388('0x82')](_0xd388('0xae'))[_0xd388('0xab')](_0xd388('0xa0'))[_0xd388('0x45')](_0xd388('0xad'),_0x40a44a[_0xd388('0x51')]['id'][_0xd388('0x89')]())))['toString']();break;case _0xd388('0xaf'):_0x318e91=squel[_0xd388('0x9e')]()[_0xd388('0x9f')](_0xd388('0xa0'))['fromQuery'](['phone',_0xd388('0xa3'),_0xd388('0xa4'),_0xd388('0xa5'),'VoiceQueueId',_0xd388('0x5b'),_0xd388('0x5c')],squel['select']()[_0xd388('0x82')](_0xd388('0xa2'),'phone')['field'](_0xd388('0xa6'),_0xd388('0xa3'))[_0xd388('0x82')]('id',_0xd388('0xa4'))['field'](_0x33155d['CmListId'][_0xd388('0x89')](),_0xd388('0xa5'))['field'](_0x40a44a[_0xd388('0x51')]['id']['toString'](),_0xd388('0x62'))[_0xd388('0x82')]('NOW()','createdAt')[_0xd388('0x82')](_0xd388('0xa6'),_0xd388('0x5c'))['from'](_0xd388('0xa8'))[_0xd388('0x45')](_0xd388('0xb0'))[_0xd388('0x45')](_0xd388('0xb1'),_0x33155d[_0xd388('0xa7')]['toString']())[_0xd388('0x45')](_0xd388('0xa9'))[_0xd388('0x45')](_0xd388('0xaa'),squel[_0xd388('0x81')]()[_0xd388('0x82')](_0xd388('0xae'))[_0xd388('0xab')]('cm_hopper')[_0xd388('0x45')](_0xd388('0xad'),_0x40a44a['params']['id'][_0xd388('0x89')]())))[_0xd388('0x89')]();break;default:_0x318e91=squel[_0xd388('0x9e')]()[_0xd388('0x9f')](_0xd388('0xa0'))[_0xd388('0xa1')]([_0xd388('0xa2'),'scheduledAt',_0xd388('0xa4'),_0xd388('0xa5'),'VoiceQueueId','createdAt',_0xd388('0x5c')],squel[_0xd388('0x81')]()[_0xd388('0x82')](_0xd388('0xa2'),_0xd388('0xa2'))[_0xd388('0x82')](_0xd388('0xa6'),_0xd388('0xa3'))[_0xd388('0x82')]('id',_0xd388('0xa4'))[_0xd388('0x82')](_0x33155d[_0xd388('0xa7')][_0xd388('0x89')](),_0xd388('0xa5'))[_0xd388('0x82')](_0x40a44a[_0xd388('0x51')]['id'][_0xd388('0x89')](),'VoiceQueueId')['field'](_0xd388('0xa6'),_0xd388('0x5b'))[_0xd388('0x82')](_0xd388('0xa6'),'updatedAt')['from'](_0xd388('0xa8'))[_0xd388('0x45')](_0xd388('0xb0'))[_0xd388('0x45')](_0xd388('0xb1'),_0x33155d['CmListId']['toString']())[_0xd388('0x45')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x205c78[_0xd388('0xb2')](db['sequelize'][_0xd388('0x3c')](_0x318e91));}return BPromise[_0xd388('0x8d')](_0x205c78);}})[_0xd388('0x27')](function(){return _0x5e7e7e;})[_0xd388('0x27')](respondWithResult(_0x3f16d0,null))[_0xd388('0x4f')](handleError(_0x3f16d0,null));};exports[_0xd388('0xb3')]=function(_0x2f142e,_0x2fee35,_0x5e017c){return db['VoiceQueue']['find']({'where':{'id':_0x2f142e['params']['id']}})['then'](handleEntityNotFound(_0x2fee35,null))[_0xd388('0x27')](function(_0x3cbf4e){if(_0x3cbf4e){return _0x3cbf4e[_0xd388('0xb3')](_0x2f142e[_0xd388('0x3c')][_0xd388('0x80')]);}})['then'](function(_0x5ca640){if(_0x5ca640){return db[_0xd388('0x63')][_0xd388('0x28')]({'where':{'ListId':_0x2f142e[_0xd388('0x3c')][_0xd388('0x80')],'VoiceQueueId':_0x2f142e[_0xd388('0x51')]['id']}})[_0xd388('0x27')](function(){return _0x5ca640;});}})[_0xd388('0x27')](respondWithStatusCode(_0x2fee35,null))[_0xd388('0x4f')](handleError(_0x2fee35,null));};exports[_0xd388('0xb4')]=function(_0x195ebe,_0x1a12cb,_0x32ae7b){var _0x7a1d34={};var _0x47c7e4={};var _0xbd9fa1;var _0x3f7522;return db[_0xd388('0x4a')]['findOne']({'where':{'id':_0x195ebe[_0xd388('0x51')]['id']}})[_0xd388('0x27')](handleEntityNotFound(_0x1a12cb,null))[_0xd388('0x27')](function(_0x522c7e){if(_0x522c7e){_0xbd9fa1=_0x522c7e;_0x47c7e4[_0xd388('0x3f')]=_['keys'](db[_0xd388('0x99')][_0xd388('0x38')]);_0x47c7e4[_0xd388('0x3c')]=_[_0xd388('0x52')](_0x195ebe[_0xd388('0x3c')]);_0x47c7e4[_0xd388('0x3d')]=_[_0xd388('0x3e')](_0x47c7e4['model'],_0x47c7e4[_0xd388('0x3c')]);_0x7a1d34[_0xd388('0x40')]=_[_0xd388('0x3e')](_0x47c7e4[_0xd388('0x3f')],qs[_0xd388('0x41')](_0x195ebe['query']['fields']));_0x7a1d34[_0xd388('0x40')]=_0x7a1d34[_0xd388('0x40')][_0xd388('0x53')]?_0x7a1d34[_0xd388('0x40')]:_0x47c7e4[_0xd388('0x3f')];_0x7a1d34['order']=qs['sort'](_0x195ebe[_0xd388('0x3c')][_0xd388('0x44')]);_0x7a1d34[_0xd388('0x45')]=qs[_0xd388('0x3d')](_[_0xd388('0x46')](_0x195ebe[_0xd388('0x3c')],_0x47c7e4[_0xd388('0x3d')]));if(_0x195ebe[_0xd388('0x3c')][_0xd388('0x2e')]){_0x7a1d34[_0xd388('0x45')]=_[_0xd388('0x47')](_0x7a1d34['where'],{'$or':_[_0xd388('0x37')](_0x7a1d34[_0xd388('0x40')],function(_0x3cf0e1){var _0x56eb35={};_0x56eb35[_0x3cf0e1]={'$like':'%'+_0x195ebe['query'][_0xd388('0x2e')]+'%'};return _0x56eb35;})});}_0x7a1d34=_[_0xd388('0x47')]({},_0x7a1d34,_0x195ebe[_0xd388('0x49')]);return _0xbd9fa1[_0xd388('0xb4')](_0x7a1d34);}})[_0xd388('0x27')](function(_0x144124){if(_0x144124){_0x3f7522=_0x144124[_0xd388('0x53')];if(!_0x195ebe[_0xd388('0x3c')][_0xd388('0x61')](_0xd388('0x42'))){_0x7a1d34['limit']=qs[_0xd388('0x21')](_0x195ebe[_0xd388('0x3c')][_0xd388('0x21')]);_0x7a1d34['offset']=qs[_0xd388('0x1f')](_0x195ebe[_0xd388('0x3c')][_0xd388('0x1f')]);}return _0xbd9fa1[_0xd388('0xb4')](_0x7a1d34);}})[_0xd388('0x27')](function(_0x1c6c8c){if(_0x1c6c8c){return _0x1c6c8c?{'count':_0x3f7522,'rows':_0x1c6c8c}:null;}})[_0xd388('0x27')](respondWithResult(_0x1a12cb,null))[_0xd388('0x4f')](handleError(_0x1a12cb,null));};exports[_0xd388('0xb5')]=function(_0x511813,_0x17f3c1,_0x40d86d){var _0x434584,_0x27bcf7;return db[_0xd388('0x4a')][_0xd388('0x31')]({'where':{'id':_0x511813['params']['id']}})['then'](handleEntityNotFound(_0x17f3c1,null))[_0xd388('0x27')](function(_0x5c7cf5){if(_0x5c7cf5){_0x27bcf7=_0x5c7cf5;return _0x5c7cf5['addBlackLists'](_0x511813[_0xd388('0x5d')][_0xd388('0x80')],_['omit'](_0x511813['body'],['ids','id'])||{});}return null;})[_0xd388('0x93')](function(_0x32e548){var _0x437528;_0x434584=_0x32e548||[];var _0x592c36=[];if(_0x32e548){for(var _0x104c0b=0x0;_0x104c0b<_0x32e548['length'];_0x104c0b+=0x1){var _0x55a599=_0x32e548[_0x104c0b][_0xd388('0x29')]({'plain':!![]});_0x437528=squel['insert']()['into'](_0xd388('0xb6'))[_0xd388('0xa1')]([_0xd388('0xa2'),_0xd388('0xa4'),_0xd388('0xa5'),_0xd388('0x62'),_0xd388('0x5b'),_0xd388('0x5c')],squel['select']()[_0xd388('0x82')](_0xd388('0xa2'),_0xd388('0xa2'))['field']('id',_0xd388('0xa4'))[_0xd388('0x82')](_0x55a599[_0xd388('0xa7')][_0xd388('0x89')](),_0xd388('0xa5'))[_0xd388('0x82')](_0x511813[_0xd388('0x51')]['id'][_0xd388('0x89')](),_0xd388('0x62'))[_0xd388('0x82')](_0xd388('0xa6'),'createdAt')['field'](_0xd388('0xa6'),_0xd388('0x5c'))[_0xd388('0xab')](_0xd388('0xa8'))[_0xd388('0x45')](_0xd388('0xb0'))[_0xd388('0x45')](_0xd388('0xb1'),_0x55a599[_0xd388('0xa7')]['toString']())['where'](_0xd388('0xa9')))[_0xd388('0x89')]();_0x592c36[_0xd388('0xb2')](db[_0xd388('0x88')][_0xd388('0x3c')](_0x437528));}return BPromise['all'](_0x592c36);}})[_0xd388('0x27')](function(){return _0x434584;})[_0xd388('0x27')](respondWithResult(_0x17f3c1,null))[_0xd388('0x4f')](handleError(_0x17f3c1,null));};exports[_0xd388('0xb7')]=function(_0x31822c,_0x2e58d7,_0x277de7){return db[_0xd388('0x4a')][_0xd388('0x31')]({'where':{'id':_0x31822c[_0xd388('0x51')]['id']}})['then'](handleEntityNotFound(_0x2e58d7,null))['then'](function(_0x678be3){if(_0x678be3){return _0x678be3['removeBlackLists'](_0x31822c[_0xd388('0x3c')][_0xd388('0x80')]);}})[_0xd388('0x27')](function(_0x54d9bc){if(_0x54d9bc){return db[_0xd388('0x69')][_0xd388('0x28')]({'where':{'ListId':_0x31822c[_0xd388('0x3c')][_0xd388('0x80')],'VoiceQueueId':_0x31822c[_0xd388('0x51')]['id']}})['then'](function(){return _0x54d9bc;});}})['then'](respondWithStatusCode(_0x2e58d7,null))['catch'](handleError(_0x2e58d7,null));};
\ No newline at end of file
+var _0x206c=['TeamVoiceQueue','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','ids','select','field','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','all','union','compact','removeTeams','isEmpty','removeAgents','destroy','userVoiceQueue:remove','addAgents','userVoiceQueue:save','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','into','ListId\x20=\x20?','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','undefined','limit','offset','set','apply','reject','update','get','VoiceQueues','inbound','filter','ignore','map','value','includes','type','find','UserProfileResource','then','end','sendStatus','error','stack','name','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','merge','options','count','includeAll','findAll','show','params','keys','include','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','role','outbound','getHoppers','findOne','CmHopper','nolimit','VoiceQueueId','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Team','User','Agents','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each'];(function(_0x47bce1,_0x4a2a0a){var _0x1a97de=function(_0x4c8de8){while(--_0x4c8de8){_0x47bce1['push'](_0x47bce1['shift']());}};_0x1a97de(++_0x4a2a0a);}(_0x206c,0x1b8));var _0xc206=function(_0x2c5255,_0x4340c3){_0x2c5255=_0x2c5255-0x0;var _0x30d0ea=_0x206c[_0x2c5255];return _0x30d0ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc206('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc206('0x1'));var rp=require(_0xc206('0x2'));var moment=require(_0xc206('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc206('0x4'));var util=require(_0xc206('0x5'));var path=require(_0xc206('0x6'));var sox=require('sox');var csv=require(_0xc206('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc206('0x8'));var squel=require(_0xc206('0x9'));var crypto=require('crypto');var jsforce=require(_0xc206('0xa'));var deskjs=require(_0xc206('0xb'));var toCsv=require(_0xc206('0x7'));var querystring=require(_0xc206('0xc'));var Papa=require('papaparse');var Redis=require(_0xc206('0xd'));var authService=require(_0xc206('0xe'));var qs=require(_0xc206('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc206('0x10'));var logger=require(_0xc206('0x11'))(_0xc206('0x12'));var utils=require('../../config/utils');var config=require(_0xc206('0x13'));var licenseUtil=require(_0xc206('0x14'));var db=require(_0xc206('0x15'))['db'];config[_0xc206('0x16')]=_[_0xc206('0x17')](config[_0xc206('0x16')],{'host':_0xc206('0x18'),'port':0x18eb});var socket=require(_0xc206('0x19'))(new Redis(config[_0xc206('0x16')]));require('./voiceQueue.socket')[_0xc206('0x1a')](socket);function respondWithStatusCode(_0x1a8e7d,_0xaa143c){_0xaa143c=_0xaa143c||0xcc;return function(_0xda3738){if(_0xda3738){return _0x1a8e7d['sendStatus'](_0xaa143c);}return _0x1a8e7d[_0xc206('0x1b')](_0xaa143c)['end']();};}function respondWithResult(_0x20a5c5,_0x387112){_0x387112=_0x387112||0xc8;return function(_0x456984){if(_0x456984){return _0x20a5c5[_0xc206('0x1b')](_0x387112)[_0xc206('0x1c')](_0x456984);}};}function respondWithFilteredResult(_0xc59af5,_0x42e501){return function(_0x3d3cdb){if(_0x3d3cdb){var _0x48467f=typeof _0x42e501['offset']===_0xc206('0x1d')&&typeof _0x42e501[_0xc206('0x1e')]===_0xc206('0x1d');var _0x2706ae=_0x3d3cdb['count'];var _0x450030=_0x48467f?0x0:_0x42e501[_0xc206('0x1f')];var _0x1b5532=_0x48467f?_0x3d3cdb['count']:_0x42e501[_0xc206('0x1f')]+_0x42e501[_0xc206('0x1e')];var _0x547ca4;if(_0x1b5532>=_0x2706ae){_0x1b5532=_0x2706ae;_0x547ca4=0xc8;}else{_0x547ca4=0xce;}_0xc59af5['status'](_0x547ca4);return _0xc59af5[_0xc206('0x20')]('Content-Range',_0x450030+'-'+_0x1b5532+'/'+_0x2706ae)['json'](_0x3d3cdb);}return null;};}function patchUpdates(_0x3d8585){return function(_0x18fec0){try{jsonpatch[_0xc206('0x21')](_0x18fec0,_0x3d8585,!![]);}catch(_0x24a0b8){return BPromise[_0xc206('0x22')](_0x24a0b8);}return _0x18fec0['save']();};}function saveUpdates(_0x100cd8,_0x4eb7fa){return function(_0x187935){if(_0x187935){return _0x187935[_0xc206('0x23')](_0x100cd8)['then'](function(_0x55a2cb){return _0x55a2cb;});}return null;};}function removeEntity(_0x4f86eb,_0x439d96){return function(_0x4faa9c){if(_0x4faa9c){return _0x4faa9c['destroy']()['then'](function(){var _0x5e1c7c=_0x4faa9c[_0xc206('0x24')]({'plain':!![]});var _0xfb7213=[{'name':_0xc206('0x25'),'value':_0xc206('0x26'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x30d5e0=_(_0xfb7213)[_0xc206('0x27')](_0xc206('0x28'))[_0xc206('0x29')](_0xc206('0x2a'))[_0xc206('0x2a')]();if(_[_0xc206('0x2b')](_0x30d5e0,_0x5e1c7c[_0xc206('0x2c')])){return;}var _0x1d0c14=_[_0xc206('0x2d')](_0xfb7213,[_0xc206('0x2a'),_0x5e1c7c[_0xc206('0x2c')]])['name'];return db[_0xc206('0x2e')]['destroy']({'where':{'type':_0x1d0c14,'resourceId':_0x5e1c7c['id']}})[_0xc206('0x2f')](function(){return _0x4faa9c;});})[_0xc206('0x2f')](function(){_0x4f86eb[_0xc206('0x1b')](0xcc)[_0xc206('0x30')]();});}};}function handleEntityNotFound(_0x490743,_0x47733f){return function(_0x414fe8){if(!_0x414fe8){_0x490743[_0xc206('0x31')](0x194);}return _0x414fe8;};}function handleError(_0x50cd83,_0xff1d69){_0xff1d69=_0xff1d69||0x1f4;return function(_0x24e997){logger[_0xc206('0x32')](_0x24e997[_0xc206('0x33')]);if(_0x24e997[_0xc206('0x34')]){delete _0x24e997[_0xc206('0x34')];}_0x50cd83['status'](_0xff1d69)[_0xc206('0x35')](_0x24e997);};}exports[_0xc206('0x36')]=function(_0x5212ab,_0x500c88){var _0x228285={},_0x3fdf30={},_0x448ca0={'count':0x0,'rows':[]};var _0xfb7c42=_[_0xc206('0x29')](db[_0xc206('0x37')][_0xc206('0x38')],function(_0xc6496){return{'name':_0xc6496[_0xc206('0x39')],'type':_0xc6496[_0xc206('0x2c')][_0xc206('0x3a')]};});_0x3fdf30[_0xc206('0x3b')]=_[_0xc206('0x29')](_0xfb7c42,_0xc206('0x34'));_0x3fdf30[_0xc206('0x3c')]=_['keys'](_0x5212ab[_0xc206('0x3c')]);_0x3fdf30[_0xc206('0x3d')]=_[_0xc206('0x3e')](_0x3fdf30[_0xc206('0x3b')],_0x3fdf30[_0xc206('0x3c')]);_0x228285[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x3fdf30['model'],qs[_0xc206('0x40')](_0x5212ab['query'][_0xc206('0x40')]));_0x228285[_0xc206('0x3f')]=_0x228285['attributes'][_0xc206('0x41')]?_0x228285[_0xc206('0x3f')]:_0x3fdf30[_0xc206('0x3b')];if(!_0x5212ab['query'][_0xc206('0x42')]('nolimit')){_0x228285['limit']=qs[_0xc206('0x1e')](_0x5212ab['query'][_0xc206('0x1e')]);_0x228285[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x5212ab[_0xc206('0x3c')]['offset']);}_0x228285[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x5212ab['query'][_0xc206('0x44')]);_0x228285[_0xc206('0x45')]=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x5212ab['query'],_0x3fdf30[_0xc206('0x3d')]),_0xfb7c42);if(_0x5212ab[_0xc206('0x3c')][_0xc206('0x27')]){_0x228285[_0xc206('0x45')]=_['merge'](_0x228285[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0xfb7c42,function(_0x219e61){if(_0x219e61[_0xc206('0x2c')]!==_0xc206('0x47')){var _0x3afe5e={};_0x3afe5e[_0x219e61[_0xc206('0x34')]]={'$like':'%'+_0x5212ab[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x3afe5e;}})});}_0x228285=_[_0xc206('0x48')]({},_0x228285,_0x5212ab[_0xc206('0x49')]);var _0x4516c2={'where':_0x228285[_0xc206('0x45')]};return db[_0xc206('0x37')][_0xc206('0x4a')](_0x4516c2)[_0xc206('0x2f')](function(_0x1378ac){_0x448ca0[_0xc206('0x4a')]=_0x1378ac;if(_0x5212ab[_0xc206('0x3c')][_0xc206('0x4b')]){_0x228285['include']=[{'all':!![]}];}return db['VoiceQueue'][_0xc206('0x4c')](_0x228285);})['then'](function(_0x1ae89b){_0x448ca0['rows']=_0x1ae89b;return _0x448ca0;})[_0xc206('0x2f')](respondWithFilteredResult(_0x500c88,_0x228285))['catch'](handleError(_0x500c88,null));};exports[_0xc206('0x4d')]=function(_0x4adbbc,_0xdde8d7){var _0xcbee19={'raw':![],'where':{'id':_0x4adbbc[_0xc206('0x4e')]['id']}},_0x3c7611={};_0x3c7611[_0xc206('0x3b')]=_[_0xc206('0x4f')](db['VoiceQueue']['rawAttributes']);_0x3c7611['query']=_['keys'](_0x4adbbc[_0xc206('0x3c')]);_0x3c7611[_0xc206('0x3d')]=_[_0xc206('0x3e')](_0x3c7611[_0xc206('0x3b')],_0x3c7611[_0xc206('0x3c')]);_0xcbee19['attributes']=_[_0xc206('0x3e')](_0x3c7611[_0xc206('0x3b')],qs['fields'](_0x4adbbc['query'][_0xc206('0x40')]));_0xcbee19[_0xc206('0x3f')]=_0xcbee19[_0xc206('0x3f')]['length']?_0xcbee19['attributes']:_0x3c7611[_0xc206('0x3b')];if(_0x4adbbc[_0xc206('0x3c')][_0xc206('0x4b')]){_0xcbee19[_0xc206('0x50')]=[{'all':!![]}];}_0xcbee19=_['merge']({},_0xcbee19,_0x4adbbc[_0xc206('0x49')]);return db[_0xc206('0x37')]['find'](_0xcbee19)[_0xc206('0x2f')](handleEntityNotFound(_0xdde8d7,null))[_0xc206('0x2f')](respondWithResult(_0xdde8d7,null))[_0xc206('0x51')](handleError(_0xdde8d7,null));};exports[_0xc206('0x52')]=function(_0x577f7b,_0x2a740c){return db[_0xc206('0x37')][_0xc206('0x52')](_0x577f7b[_0xc206('0x53')],{})[_0xc206('0x2f')](function(_0x4c6250){var _0x5d3215=_0x577f7b[_0xc206('0x54')][_0xc206('0x24')]({'plain':!![]});if(!_0x5d3215)throw new Error(_0xc206('0x55'));if(_0x5d3215['role']==='user'){var _0x572651=_0x4c6250[_0xc206('0x24')]({'plain':!![]});var _0x57a577=[{'name':_0xc206('0x25'),'value':_0xc206('0x26')},{'name':_0xc206('0x56'),'value':'outbound'}];var _0x447624=_[_0xc206('0x2d')](_0x57a577,[_0xc206('0x2a'),_0x572651[_0xc206('0x2c')]])[_0xc206('0x34')];return db[_0xc206('0x57')][_0xc206('0x2d')]({'where':{'name':_0x447624,'userProfileId':_0x5d3215[_0xc206('0x58')]},'raw':!![]})['then'](function(_0x4dc904){if(_0x4dc904&&_0x4dc904[_0xc206('0x59')]===0x0){return db['UserProfileResource'][_0xc206('0x52')]({'name':_0x572651['name'],'resourceId':_0x572651['id'],'type':_0x4dc904[_0xc206('0x34')],'sectionId':_0x4dc904['id']},{})[_0xc206('0x2f')](function(){return _0x4c6250;});}else{return _0x4c6250;}})[_0xc206('0x51')](function(_0x1fecc8){logger['error'](_0xc206('0x5a'),_0x1fecc8);throw _0x1fecc8;});}return _0x4c6250;})['then'](respondWithResult(_0x2a740c,0xc9))[_0xc206('0x51')](handleError(_0x2a740c,null));};exports['clone']=function(_0x1dce31,_0x4bc228){var _0x27949d={'where':{'id':_0x1dce31[_0xc206('0x4e')]['id']}},_0x1f47bf={};_0x1f47bf[_0xc206('0x3b')]=_[_0xc206('0x4f')](db[_0xc206('0x37')]['rawAttributes']);_0x27949d[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x1f47bf[_0xc206('0x3b')],qs['fields'](_0x1dce31[_0xc206('0x3c')][_0xc206('0x40')]));_0x27949d[_0xc206('0x3f')]=_0x27949d['attributes'][_0xc206('0x41')]?_0x27949d['attributes']:_0x1f47bf['model'];if(_0x1dce31['query'][_0xc206('0x4b')]){_0x27949d[_0xc206('0x50')]=[{'all':!![]}];}_0x27949d=_[_0xc206('0x48')]({},_0x27949d,_0x1dce31['options']);return db[_0xc206('0x37')]['find'](_0x27949d)[_0xc206('0x2f')](handleEntityNotFound(_0x4bc228,null))[_0xc206('0x2f')](function(_0x24120b){if(_0x24120b){var _0x3dc6d2=_0x24120b[_0xc206('0x24')]({'plain':!![]});_0x3dc6d2=qs[_0xc206('0x5b')](_0x3dc6d2,['id','createdAt',_0xc206('0x5c')]);_0x1dce31[_0xc206('0x53')]=_['omit'](_0x1dce31[_0xc206('0x53')],['id','createdAt','updatedAt']);return db[_0xc206('0x37')][_0xc206('0x52')](_['merge'](_0x3dc6d2,_0x1dce31[_0xc206('0x53')]),{'include':_0x1dce31['query'][_0xc206('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x36298b){var _0x39d6ae=_0x1dce31[_0xc206('0x54')]['get']({'plain':!![]});if(!_0x39d6ae)throw new Error(_0xc206('0x55'));if(_0x39d6ae[_0xc206('0x5d')]===_0xc206('0x54')){var _0x4ef39b=_0x36298b[_0xc206('0x24')]({'plain':!![]});var _0x208205=[{'name':'VoiceQueues','value':'inbound'},{'name':_0xc206('0x56'),'value':_0xc206('0x5e')}];var _0x3b9b0a=_[_0xc206('0x2d')](_0x208205,[_0xc206('0x2a'),_0x4ef39b[_0xc206('0x2c')]])[_0xc206('0x34')];return db[_0xc206('0x57')][_0xc206('0x2d')]({'where':{'name':_0x3b9b0a,'userProfileId':_0x39d6ae[_0xc206('0x58')]},'raw':!![]})['then'](function(_0x29d555){if(_0x29d555&&_0x29d555[_0xc206('0x59')]===0x0){return db[_0xc206('0x2e')]['create']({'name':_0x4ef39b[_0xc206('0x34')],'resourceId':_0x4ef39b['id'],'type':_0x29d555[_0xc206('0x34')],'sectionId':_0x29d555['id']},{})[_0xc206('0x2f')](function(){return _0x36298b;});}else{return _0x36298b;}})['catch'](function(_0x203896){logger[_0xc206('0x32')](_0xc206('0x5a'),_0x203896);throw _0x203896;});}return _0x36298b;});}})[_0xc206('0x2f')](respondWithResult(_0x4bc228,0xc9))['catch'](handleError(_0x4bc228,null));};exports['update']=function(_0x196918,_0x860256){if(_0x196918[_0xc206('0x53')]['id']){delete _0x196918['body']['id'];}return db[_0xc206('0x37')]['find']({'where':{'id':_0x196918[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x860256,null))[_0xc206('0x2f')](saveUpdates(_0x196918['body'],null))[_0xc206('0x2f')](respondWithResult(_0x860256,null))[_0xc206('0x51')](handleError(_0x860256,null));};exports['destroy']=function(_0x558c8a,_0x2a337a){return db[_0xc206('0x37')][_0xc206('0x2d')]({'where':{'id':_0x558c8a['params']['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x2a337a,null))[_0xc206('0x2f')](removeEntity(_0x2a337a,null))[_0xc206('0x51')](handleError(_0x2a337a,null));};exports[_0xc206('0x5f')]=function(_0x4c4588,_0x18c61b,_0x425d84){var _0x2a71dc={'raw':![],'where':{}};var _0x5df5b1={};var _0x48a1a5={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc206('0x60')]({'where':{'id':_0x4c4588[_0xc206('0x4e')]['id']}})['then'](handleEntityNotFound(_0x18c61b,null))[_0xc206('0x2f')](function(_0x3c31d1){if(_0x3c31d1){_0x5df5b1[_0xc206('0x3b')]=_[_0xc206('0x4f')](db[_0xc206('0x61')][_0xc206('0x38')]);_0x5df5b1[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x4c4588['query']);_0x5df5b1[_0xc206('0x3d')]=_[_0xc206('0x3e')](_0x5df5b1[_0xc206('0x3b')],_0x5df5b1[_0xc206('0x3c')]);_0x2a71dc[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x5df5b1['model'],qs[_0xc206('0x40')](_0x4c4588[_0xc206('0x3c')][_0xc206('0x40')]));_0x2a71dc[_0xc206('0x3f')]=_0x2a71dc[_0xc206('0x3f')][_0xc206('0x41')]?_0x2a71dc[_0xc206('0x3f')]:_0x5df5b1['model'];if(!_0x4c4588['query'][_0xc206('0x42')](_0xc206('0x62'))){_0x2a71dc[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x4c4588[_0xc206('0x3c')][_0xc206('0x1e')]);_0x2a71dc[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x4c4588['query'][_0xc206('0x1f')]);}_0x2a71dc[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x4c4588[_0xc206('0x3c')]['sort']);_0x2a71dc['where']=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x4c4588['query'],_0x5df5b1[_0xc206('0x3d')]));_0x2a71dc[_0xc206('0x45')][_0xc206('0x63')]=_0x3c31d1['id'];if(_0x4c4588[_0xc206('0x3c')][_0xc206('0x27')]){_0x2a71dc[_0xc206('0x45')]=_[_0xc206('0x48')](_0x2a71dc[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x2a71dc[_0xc206('0x3f')],function(_0x32bc59){var _0x38b7af={};_0x38b7af[_0x32bc59]={'$like':'%'+_0x4c4588['query'][_0xc206('0x27')]+'%'};return _0x38b7af;})});}_0x2a71dc=_[_0xc206('0x48')]({},_0x2a71dc,_0x4c4588['options']);return db[_0xc206('0x61')][_0xc206('0x4a')]({'where':_0x2a71dc['where']})[_0xc206('0x2f')](function(_0x4ba34c){_0x48a1a5[_0xc206('0x4a')]=_0x4ba34c;if(_0x4c4588[_0xc206('0x3c')][_0xc206('0x4b')]){_0x2a71dc[_0xc206('0x50')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x2a71dc);})[_0xc206('0x2f')](function(_0x2c4176){_0x48a1a5['rows']=_0x2c4176;return _0x48a1a5;});}})[_0xc206('0x2f')](respondWithFilteredResult(_0x18c61b,_0x2a71dc))[_0xc206('0x51')](handleError(_0x18c61b,null));};exports[_0xc206('0x64')]=function(_0x25878e,_0x41ccbe,_0x35ba26){var _0x2514e1={'raw':!![],'where':{}};var _0x49d2e8={};var _0x57b846={'count':0x0,'rows':[]};return db[_0xc206('0x37')][_0xc206('0x60')]({'where':{'id':_0x25878e[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x41ccbe,null))[_0xc206('0x2f')](function(_0x9b46ee){if(_0x9b46ee){_0x49d2e8['model']=_['keys'](db[_0xc206('0x65')][_0xc206('0x38')]);_0x49d2e8[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x25878e['query']);_0x49d2e8[_0xc206('0x3d')]=_['intersection'](_0x49d2e8[_0xc206('0x3b')],_0x49d2e8[_0xc206('0x3c')]);_0x2514e1[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x49d2e8[_0xc206('0x3b')],qs[_0xc206('0x40')](_0x25878e[_0xc206('0x3c')][_0xc206('0x40')]));_0x2514e1[_0xc206('0x3f')]=_0x2514e1[_0xc206('0x3f')]['length']?_0x2514e1['attributes']:_0x49d2e8['model'];if(!_0x25878e['query'][_0xc206('0x42')](_0xc206('0x62'))){_0x2514e1[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x25878e[_0xc206('0x3c')][_0xc206('0x1e')]);_0x2514e1[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x25878e[_0xc206('0x3c')]['offset']);}_0x2514e1[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x25878e['query']['sort']);_0x2514e1[_0xc206('0x45')]=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x25878e[_0xc206('0x3c')],_0x49d2e8[_0xc206('0x3d')]));_0x2514e1['where']['VoiceQueueId']=_0x9b46ee['id'];if(_0x25878e['query'][_0xc206('0x27')]){_0x2514e1['where']=_[_0xc206('0x48')](_0x2514e1[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x2514e1[_0xc206('0x3f')],function(_0xb25d62){var _0x4ef021={};_0x4ef021[_0xb25d62]={'$like':'%'+_0x25878e[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x4ef021;})});}_0x2514e1=_[_0xc206('0x48')]({},_0x2514e1,_0x25878e[_0xc206('0x49')]);return db[_0xc206('0x65')]['count']({'where':_0x2514e1[_0xc206('0x45')]})['then'](function(_0x3c355e){_0x57b846[_0xc206('0x4a')]=_0x3c355e;if(_0x25878e[_0xc206('0x3c')][_0xc206('0x4b')]){_0x2514e1[_0xc206('0x50')]=[{'all':!![]}];}return db[_0xc206('0x65')][_0xc206('0x4c')](_0x2514e1);})[_0xc206('0x2f')](function(_0x262ca2){_0x57b846[_0xc206('0x66')]=_0x262ca2;return _0x57b846;});}})[_0xc206('0x2f')](respondWithFilteredResult(_0x41ccbe,_0x2514e1))[_0xc206('0x51')](handleError(_0x41ccbe,null));};exports[_0xc206('0x67')]=function(_0x5b387d,_0x72e777,_0x292c4c){var _0x3ac8d5={'raw':!![],'where':{}};var _0x587378={};var _0x5c067c={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xc206('0x60')]({'where':{'id':_0x5b387d[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x72e777,null))[_0xc206('0x2f')](function(_0x5a9777){if(_0x5a9777){_0x587378['model']=_[_0xc206('0x4f')](db[_0xc206('0x68')][_0xc206('0x38')]);_0x587378[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x5b387d['query']);_0x587378['filters']=_['intersection'](_0x587378[_0xc206('0x3b')],_0x587378[_0xc206('0x3c')]);_0x3ac8d5[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x587378['model'],qs[_0xc206('0x40')](_0x5b387d[_0xc206('0x3c')][_0xc206('0x40')]));_0x3ac8d5[_0xc206('0x3f')]=_0x3ac8d5[_0xc206('0x3f')][_0xc206('0x41')]?_0x3ac8d5[_0xc206('0x3f')]:_0x587378[_0xc206('0x3b')];if(!_0x5b387d[_0xc206('0x3c')]['hasOwnProperty']('nolimit')){_0x3ac8d5[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x5b387d['query'][_0xc206('0x1e')]);_0x3ac8d5[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x5b387d['query']['offset']);}_0x3ac8d5[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x5b387d[_0xc206('0x3c')][_0xc206('0x44')]);_0x3ac8d5[_0xc206('0x45')]=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x5b387d[_0xc206('0x3c')],_0x587378['filters']));_0x3ac8d5[_0xc206('0x45')][_0xc206('0x63')]=_0x5a9777['id'];if(_0x5b387d['query']['filter']){_0x3ac8d5[_0xc206('0x45')]=_[_0xc206('0x48')](_0x3ac8d5[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x3ac8d5[_0xc206('0x3f')],function(_0x35022e){var _0x465f14={};_0x465f14[_0x35022e]={'$like':'%'+_0x5b387d[_0xc206('0x3c')]['filter']+'%'};return _0x465f14;})});}_0x3ac8d5=_[_0xc206('0x48')]({},_0x3ac8d5,_0x5b387d['options']);return db['CmHopperFinal'][_0xc206('0x4a')]({'where':_0x3ac8d5[_0xc206('0x45')]})[_0xc206('0x2f')](function(_0x48594e){_0x5c067c['count']=_0x48594e;if(_0x5b387d[_0xc206('0x3c')]['includeAll']){_0x3ac8d5['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xc206('0x4c')](_0x3ac8d5);})[_0xc206('0x2f')](function(_0x2c5346){_0x5c067c['rows']=_0x2c5346;return _0x5c067c;});}})[_0xc206('0x2f')](respondWithFilteredResult(_0x72e777,_0x3ac8d5))['catch'](handleError(_0x72e777,null));};exports[_0xc206('0x69')]=function(_0x577ebb,_0x16926d,_0x46a742){var _0x5ce35e={'raw':!![],'where':{}};var _0x233a3a={};var _0x198d7a={'count':0x0,'rows':[]};return db[_0xc206('0x37')][_0xc206('0x60')]({'where':{'id':_0x577ebb[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x16926d,null))[_0xc206('0x2f')](function(_0x19f642){if(_0x19f642){_0x233a3a[_0xc206('0x3b')]=_['keys'](db[_0xc206('0x6a')]['rawAttributes']);_0x233a3a[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x577ebb[_0xc206('0x3c')]);_0x233a3a[_0xc206('0x3d')]=_[_0xc206('0x3e')](_0x233a3a[_0xc206('0x3b')],_0x233a3a[_0xc206('0x3c')]);_0x5ce35e[_0xc206('0x3f')]=_['intersection'](_0x233a3a[_0xc206('0x3b')],qs[_0xc206('0x40')](_0x577ebb[_0xc206('0x3c')][_0xc206('0x40')]));_0x5ce35e[_0xc206('0x3f')]=_0x5ce35e[_0xc206('0x3f')][_0xc206('0x41')]?_0x5ce35e[_0xc206('0x3f')]:_0x233a3a['model'];if(!_0x577ebb[_0xc206('0x3c')]['hasOwnProperty']('nolimit')){_0x5ce35e[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x577ebb[_0xc206('0x3c')][_0xc206('0x1e')]);_0x5ce35e[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x577ebb[_0xc206('0x3c')][_0xc206('0x1f')]);}_0x5ce35e[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x577ebb[_0xc206('0x3c')][_0xc206('0x44')]);_0x5ce35e['where']=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x577ebb[_0xc206('0x3c')],_0x233a3a[_0xc206('0x3d')]));_0x5ce35e['where'][_0xc206('0x63')]=_0x19f642['id'];if(_0x577ebb[_0xc206('0x3c')][_0xc206('0x27')]){_0x5ce35e[_0xc206('0x45')]=_[_0xc206('0x48')](_0x5ce35e[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x5ce35e['attributes'],function(_0x47d47c){var _0x44d850={};_0x44d850[_0x47d47c]={'$like':'%'+_0x577ebb[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x44d850;})});}_0x5ce35e=_[_0xc206('0x48')]({},_0x5ce35e,_0x577ebb['options']);return db[_0xc206('0x6a')]['count']({'where':_0x5ce35e[_0xc206('0x45')]})['then'](function(_0x35c1c4){_0x198d7a[_0xc206('0x4a')]=_0x35c1c4;if(_0x577ebb[_0xc206('0x3c')]['includeAll']){_0x5ce35e[_0xc206('0x50')]=[{'all':!![]}];}return db[_0xc206('0x6a')]['findAll'](_0x5ce35e);})[_0xc206('0x2f')](function(_0x3ea4b8){_0x198d7a['rows']=_0x3ea4b8;return _0x198d7a;});}})[_0xc206('0x2f')](respondWithFilteredResult(_0x16926d,_0x5ce35e))[_0xc206('0x51')](handleError(_0x16926d,null));};exports['getTeams']=function(_0x27cdef,_0x1ea42f,_0x45ce9a){var _0x435c59={};var _0x305737={};var _0x1fc9ba;var _0x19bf94;return db['VoiceQueue']['findOne']({'where':{'id':_0x27cdef[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x1ea42f,null))[_0xc206('0x2f')](function(_0xf8612b){if(_0xf8612b){_0x1fc9ba=_0xf8612b;_0x305737[_0xc206('0x3b')]=_[_0xc206('0x4f')](db['Team'][_0xc206('0x38')]);_0x305737['query']=_[_0xc206('0x4f')](_0x27cdef[_0xc206('0x3c')]);_0x305737['filters']=_[_0xc206('0x3e')](_0x305737[_0xc206('0x3b')],_0x305737['query']);_0x435c59[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x305737[_0xc206('0x3b')],qs['fields'](_0x27cdef[_0xc206('0x3c')][_0xc206('0x40')]));_0x435c59[_0xc206('0x3f')]=_0x435c59[_0xc206('0x3f')][_0xc206('0x41')]?_0x435c59['attributes']:_0x305737[_0xc206('0x3b')];_0x435c59[_0xc206('0x43')]=qs['sort'](_0x27cdef[_0xc206('0x3c')][_0xc206('0x44')]);_0x435c59['where']=qs[_0xc206('0x3d')](_['pick'](_0x27cdef['query'],_0x305737[_0xc206('0x3d')]));if(_0x27cdef[_0xc206('0x3c')]['filter']){_0x435c59['where']=_[_0xc206('0x48')](_0x435c59[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x435c59[_0xc206('0x3f')],function(_0x2908c1){var _0x2f6e9e={};_0x2f6e9e[_0x2908c1]={'$like':'%'+_0x27cdef[_0xc206('0x3c')]['filter']+'%'};return _0x2f6e9e;})});}_0x435c59=_[_0xc206('0x48')]({},_0x435c59,_0x27cdef[_0xc206('0x49')]);return _0x1fc9ba[_0xc206('0x6b')](_0x435c59);}})[_0xc206('0x2f')](function(_0xe86d5b){if(_0xe86d5b){_0x19bf94=_0xe86d5b[_0xc206('0x41')];if(!_0x27cdef[_0xc206('0x3c')]['hasOwnProperty'](_0xc206('0x62'))){_0x435c59[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x27cdef[_0xc206('0x3c')][_0xc206('0x1e')]);_0x435c59[_0xc206('0x1f')]=qs['offset'](_0x27cdef[_0xc206('0x3c')][_0xc206('0x1f')]);}return _0x1fc9ba['getTeams'](_0x435c59);}})['then'](function(_0x6a5056){if(_0x6a5056){return _0x6a5056?{'count':_0x19bf94,'rows':_0x6a5056}:null;}})[_0xc206('0x2f')](respondWithResult(_0x1ea42f,null))[_0xc206('0x51')](handleError(_0x1ea42f,null));};exports[_0xc206('0x6c')]=function(_0x3a6aa6,_0x2003f5,_0x2b5e59){var _0x5bbac4=_0x3a6aa6[_0xc206('0x53')][_0xc206('0x6d')];var _0x23fc5e=_[_0xc206('0x29')](_0x5bbac4,'id');return db[_0xc206('0x6e')]['findAll']({'where':{'id':_0x23fc5e},'attributes':['id'],'include':[{'model':db[_0xc206('0x6f')],'as':_0xc206('0x70'),'attributes':['id','name','online',_0xc206('0x71'),_0xc206('0x72')],'raw':!![]}]})[_0xc206('0x2f')](function(_0x3f5b3a){if(_0x3f5b3a){var _0x464441=_[_0xc206('0x73')](_0x3f5b3a,function(_0x8bf1f5){var _0x565792=_0x8bf1f5['get']({'plain':!![]});_0x565792[_0xc206('0x70')][_0xc206('0x74')](function(_0x43c8f9){_0x43c8f9[_0xc206('0x75')]=_['find'](_0x5bbac4,{'id':_0x565792['id']})[_0xc206('0x75')];});return _0x565792[_0xc206('0x70')];});return db['VoiceQueue']['find']({'where':{'id':_0x3a6aa6[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](function(_0x27578a){return db[_0xc206('0x76')][_0xc206('0x77')](function(_0x21f476){return _0x27578a[_0xc206('0x6c')](_0x23fc5e,{'transaction':_0x21f476})[_0xc206('0x2f')](function(){return BPromise[_0xc206('0x78')](_0x5bbac4,function(_0x126b82){return db[_0xc206('0x79')]['upsert']({'TeamId':_0x126b82['id'],'VoiceQueueId':_0x3a6aa6[_0xc206('0x4e')]['id'],'penalty':_0x126b82[_0xc206('0x75')]},{'transaction':_0x21f476});});})[_0xc206('0x2f')](function(){return BPromise['each'](_0x464441,function(_0x42d1a5){return db[_0xc206('0x7a')][_0xc206('0x7b')]({'where':{'UserId':_0x42d1a5['id'],'VoiceQueueId':_0x3a6aa6['params']['id']},'defaults':{'penalty':_0x42d1a5[_0xc206('0x75')]},'transaction':_0x21f476});});})['then'](function(){return BPromise['each'](_[_0xc206('0x27')](_0x464441,{'online':!![]}),function(_0x29cbb7){return db[_0xc206('0x7c')]['upsert']({'membername':_0x29cbb7['name'],'UserId':_0x29cbb7['id'],'queue_name':_0x27578a['name'],'VoiceQueueId':_0x27578a['id'],'interface':_[_0xc206('0x7d')](_0x29cbb7[_0xc206('0x72')])?util[_0xc206('0x7e')](_0xc206('0x7f'),_0x29cbb7[_0xc206('0x34')]):_0x29cbb7['interface'],'paused':_0x29cbb7[_0xc206('0x71')]||![],'penalty':_0x29cbb7['penalty']},{'transaction':_0x21f476});});})[_0xc206('0x2f')](function(){_0x464441[_0xc206('0x74')](function(_0x14a43f){socket[_0xc206('0x80')]('userVoiceQueue:save',{'UserId':_0x14a43f['id'],'VoiceQueueId':_0x27578a['id']});});});});});}})['then'](respondWithStatusCode(_0x2003f5,null))[_0xc206('0x51')](handleError(_0x2003f5,null));};exports['removeTeams']=function(_0xb6328f,_0x2bba4a,_0x4cedcc){return db['Team']['findAll']({'where':{'id':_0xb6328f[_0xc206('0x3c')][_0xc206('0x81')]},'attributes':['id'],'include':[{'model':db[_0xc206('0x6f')],'as':_0xc206('0x70'),'attributes':['id'],'raw':!![]}]})[_0xc206('0x2f')](handleEntityNotFound(_0x2bba4a,null))['then'](function(_0xed9406){var _0x13b21d=_[_0xc206('0x29')](_0xed9406,'id');var _0x401374=[];var _0x22b913=[];var _0x352b2e=squel[_0xc206('0x82')]();_0x352b2e[_0xc206('0x83')]('tq.TeamId')[_0xc206('0x84')](_0xc206('0x85'),'tq')[_0xc206('0x86')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc206('0x45')](_0xc206('0x87'),_0xb6328f[_0xc206('0x4e')]['id']);for(var _0x87a2ea=0x0;_0x87a2ea<_0xed9406[_0xc206('0x41')];_0x87a2ea+=0x1){let _0x259109=_0xed9406[_0x87a2ea];for(var _0x214ce9=0x0;_0x214ce9<_0x259109[_0xc206('0x70')]['length'];_0x214ce9+=0x1){let _0x349874=_0x259109[_0xc206('0x70')][_0x214ce9];var _0x3c3e39=_0x352b2e[_0xc206('0x88')]();_0x3c3e39[_0xc206('0x45')](_0xc206('0x89'),_0x349874['id']);_0x22b913[_0xc206('0x8a')](db[_0xc206('0x76')][_0xc206('0x3c')](_0x3c3e39[_0xc206('0x8b')](),{'type':db[_0xc206('0x76')]['QueryTypes'][_0xc206('0x8c')]})[_0xc206('0x2f')](function(_0xa80c98){if(_0xa80c98['length']===0x1){return _0x349874['id'];}else{var _0x148339=_[_0xc206('0x8d')](_['map'](_0xa80c98,_0xc206('0x8e')),function(_0x468432){return _[_0xc206('0x2b')](_0x13b21d,_0x468432);});if(_0x148339){return _0x349874['id'];}}}));}}return BPromise[_0xc206('0x8f')](_0x22b913)[_0xc206('0x2f')](function(_0x4e49c2){_0x401374=_(_0x401374)[_0xc206('0x90')](_0x4e49c2)[_0xc206('0x91')]()[_0xc206('0x2a')]();return db[_0xc206('0x37')][_0xc206('0x2d')]({'where':{'id':_0xb6328f[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](function(_0x38bbe9){return db[_0xc206('0x76')][_0xc206('0x77')](function(_0x102a1e){return _0x38bbe9[_0xc206('0x92')](_0xb6328f['query'][_0xc206('0x81')],{'transaction':_0x102a1e})[_0xc206('0x2f')](function(){if(!_[_0xc206('0x93')](_0x401374)){return _0x38bbe9[_0xc206('0x94')](_0x401374,{'transaction':_0x102a1e})[_0xc206('0x2f')](function(){return db['UserVoiceQueueRt'][_0xc206('0x95')]({'where':{'VoiceQueueId':_0xb6328f['params']['id'],'UserId':_0x401374},'transaction':_0x102a1e});});}})[_0xc206('0x2f')](function(){_0x401374[_0xc206('0x74')](function(_0x3db8ea){socket[_0xc206('0x80')](_0xc206('0x96'),{'UserId':_0x3db8ea,'VoiceQueueId':_0x38bbe9['id']});});});});});});})[_0xc206('0x2f')](respondWithStatusCode(_0x2bba4a,null))[_0xc206('0x51')](handleError(_0x2bba4a,null));};exports[_0xc206('0x97')]=function(_0x3c4938,_0x3a3e51,_0x148809){var _0x27784f,_0x11fb50;return db[_0xc206('0x37')][_0xc206('0x2d')]({'where':{'id':_0x3c4938[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x3a3e51,null))['then'](function(_0x5ba6e2){if(_0x5ba6e2){_0x11fb50=_0x5ba6e2;return _0x5ba6e2[_0xc206('0x97')](_0x3c4938['body'][_0xc206('0x81')],_['omit'](_0x3c4938['body'],[_0xc206('0x81'),'id'])||{})['spread'](function(_0x1899a2){for(var _0x4eba27=0x0;_0x4eba27<_0x3c4938[_0xc206('0x53')]['ids'][_0xc206('0x41')];_0x4eba27+=0x1){socket[_0xc206('0x80')](_0xc206('0x98'),{'UserId':Number(_0x3c4938['body']['ids'][_0x4eba27]),'VoiceQueueId':Number(_0x3c4938[_0xc206('0x4e')]['id'])});}return _0x1899a2;});}})[_0xc206('0x2f')](function(_0x31326a){_0x27784f=_0x31326a||[];if(_0x11fb50){return db[_0xc206('0x6f')][_0xc206('0x4c')]({'where':{'id':_0x3c4938['body']['ids']},'attributes':['id',_0xc206('0x34'),'online','voicePause',_0xc206('0x72')],'raw':!![]});}})['then'](function(_0x2d9747){if(!_[_0xc206('0x93')](_0x2d9747)){var _0x13b9ce=[];for(var _0x1aae08=0x0;_0x1aae08<_0x2d9747[_0xc206('0x41')];_0x1aae08++){if(_0x2d9747[_0x1aae08]['online']){_0x13b9ce['push'](db[_0xc206('0x7c')]['upsert']({'membername':_0x2d9747[_0x1aae08]['name'],'UserId':_0x2d9747[_0x1aae08]['id'],'queue_name':_0x11fb50[_0xc206('0x34')],'VoiceQueueId':_0x11fb50['id'],'interface':_[_0xc206('0x7d')](_0x2d9747[_0x1aae08][_0xc206('0x72')])?util['format']('SIP/%s',_0x2d9747[_0x1aae08][_0xc206('0x34')]):_0x2d9747[_0x1aae08][_0xc206('0x72')],'paused':_0x2d9747[_0x1aae08]['voicePause']||![],'penalty':_0x3c4938[_0xc206('0x53')][_0xc206('0x75')]||0x0}));}}return BPromise['all'](_0x13b9ce);}})[_0xc206('0x2f')](function(){return _0x27784f;})[_0xc206('0x2f')](respondWithResult(_0x3a3e51,null))['catch'](handleError(_0x3a3e51,null));};exports['removeAgents']=function(_0x2f0d4a,_0x177caf,_0x493937){return db[_0xc206('0x37')]['find']({'where':{'id':_0x2f0d4a['params']['id']}})['then'](handleEntityNotFound(_0x177caf,null))[_0xc206('0x2f')](function(_0x12c484){if(_0x12c484){return _0x12c484[_0xc206('0x94')](_0x2f0d4a['query'][_0xc206('0x81')])[_0xc206('0x2f')](function(){if(_[_0xc206('0x99')](_0x2f0d4a[_0xc206('0x3c')][_0xc206('0x81')])){for(var _0xa1064a=0x0;_0xa1064a<_0x2f0d4a[_0xc206('0x3c')][_0xc206('0x81')][_0xc206('0x41')];_0xa1064a+=0x1){socket['emit'](_0xc206('0x96'),{'UserId':Number(_0x2f0d4a[_0xc206('0x3c')][_0xc206('0x81')][_0xa1064a]),'VoiceQueueId':Number(_0x2f0d4a['params']['id'])});}}else{socket[_0xc206('0x80')](_0xc206('0x96'),{'UserId':Number(_0x2f0d4a[_0xc206('0x3c')][_0xc206('0x81')]),'VoiceQueueId':Number(_0x2f0d4a['params']['id'])});}});}})[_0xc206('0x2f')](function(_0x25ac7d){return db['UserVoiceQueueRt'][_0xc206('0x95')]({'where':{'VoiceQueueId':_0x2f0d4a[_0xc206('0x4e')]['id'],'UserId':_0x2f0d4a['query'][_0xc206('0x81')]}})['then'](function(){return _0x25ac7d;});})[_0xc206('0x2f')](respondWithStatusCode(_0x177caf,null))[_0xc206('0x51')](handleError(_0x177caf,null));};exports[_0xc206('0x9a')]=function(_0x277a11,_0x154c1f,_0x48f3ca){var _0x4b862f={};var _0x197a5e={};var _0x32fe5c;var _0x33db7c;return db[_0xc206('0x37')]['findOne']({'where':{'id':_0x277a11[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x154c1f,null))[_0xc206('0x2f')](function(_0x18f6f4){if(_0x18f6f4){_0x32fe5c=_0x18f6f4;_0x197a5e[_0xc206('0x3b')]=_[_0xc206('0x4f')](db[_0xc206('0x6f')][_0xc206('0x38')]);_0x197a5e[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x277a11[_0xc206('0x3c')]);_0x197a5e[_0xc206('0x3d')]=_[_0xc206('0x3e')](_0x197a5e[_0xc206('0x3b')],_0x197a5e[_0xc206('0x3c')]);_0x4b862f['attributes']=_[_0xc206('0x3e')](_0x197a5e[_0xc206('0x3b')],qs[_0xc206('0x40')](_0x277a11[_0xc206('0x3c')][_0xc206('0x40')]));_0x4b862f['attributes']=_0x4b862f[_0xc206('0x3f')][_0xc206('0x41')]?_0x4b862f[_0xc206('0x3f')]:_0x197a5e[_0xc206('0x3b')];_0x4b862f[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x277a11[_0xc206('0x3c')]['sort']);_0x4b862f[_0xc206('0x45')]=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x277a11['query'],_0x197a5e[_0xc206('0x3d')]));if(_0x277a11[_0xc206('0x3c')][_0xc206('0x27')]){_0x4b862f[_0xc206('0x45')]=_[_0xc206('0x48')](_0x4b862f[_0xc206('0x45')],{'$or':_['map'](_0x4b862f[_0xc206('0x3f')],function(_0x2d6a5d){var _0x49382c={};_0x49382c[_0x2d6a5d]={'$like':'%'+_0x277a11[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x49382c;})});}_0x4b862f=_[_0xc206('0x48')]({},_0x4b862f,_0x277a11[_0xc206('0x49')]);return _0x32fe5c[_0xc206('0x9a')](_0x4b862f);}})[_0xc206('0x2f')](function(_0x15cd58){if(_0x15cd58){_0x33db7c=_0x15cd58[_0xc206('0x41')];if(!_0x277a11[_0xc206('0x3c')]['hasOwnProperty'](_0xc206('0x62'))){_0x4b862f[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x277a11[_0xc206('0x3c')][_0xc206('0x1e')]);_0x4b862f[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x277a11['query'][_0xc206('0x1f')]);}return _0x32fe5c[_0xc206('0x9a')](_0x4b862f);}})[_0xc206('0x2f')](function(_0x56a3ba){if(_0x56a3ba){return _0x56a3ba?{'count':_0x33db7c,'rows':_0x56a3ba}:null;}})['then'](respondWithResult(_0x154c1f,null))['catch'](handleError(_0x154c1f,null));};exports[_0xc206('0x9b')]=function(_0x3bcd2e,_0x19b6ae,_0x581cc8){var _0x40ad80={};var _0x2456e0={};var _0x3cd09e;var _0x221e82;return db[_0xc206('0x37')][_0xc206('0x60')]({'where':{'id':_0x3bcd2e['params']['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x19b6ae,null))[_0xc206('0x2f')](function(_0x50b8b4){if(_0x50b8b4){_0x3cd09e=_0x50b8b4;_0x2456e0['model']=_[_0xc206('0x4f')](db[_0xc206('0x7c')][_0xc206('0x38')]);_0x2456e0['query']=_[_0xc206('0x4f')](_0x3bcd2e[_0xc206('0x3c')]);_0x2456e0['filters']=_['intersection'](_0x2456e0[_0xc206('0x3b')],_0x2456e0[_0xc206('0x3c')]);_0x40ad80[_0xc206('0x3f')]=_[_0xc206('0x3e')](_0x2456e0['model'],qs[_0xc206('0x40')](_0x3bcd2e[_0xc206('0x3c')][_0xc206('0x40')]));_0x40ad80['attributes']=_0x40ad80[_0xc206('0x3f')][_0xc206('0x41')]?_0x40ad80[_0xc206('0x3f')]:_0x2456e0[_0xc206('0x3b')];_0x40ad80['order']=qs[_0xc206('0x44')](_0x3bcd2e['query'][_0xc206('0x44')]);_0x40ad80[_0xc206('0x45')]=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x3bcd2e[_0xc206('0x3c')],_0x2456e0[_0xc206('0x3d')]));if(_0x3bcd2e['query'][_0xc206('0x27')]){_0x40ad80['where']=_['merge'](_0x40ad80['where'],{'$or':_['map'](_0x40ad80[_0xc206('0x3f')],function(_0x42fc70){var _0x1aa806={};_0x1aa806[_0x42fc70]={'$like':'%'+_0x3bcd2e[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x1aa806;})});}_0x40ad80=_['merge']({},_0x40ad80,_0x3bcd2e[_0xc206('0x49')]);return _0x3cd09e[_0xc206('0x9b')](_0x40ad80);}})[_0xc206('0x2f')](function(_0x343215){if(_0x343215){_0x221e82=_0x343215['length'];if(!_0x3bcd2e[_0xc206('0x3c')][_0xc206('0x42')]('nolimit')){_0x40ad80[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x3bcd2e[_0xc206('0x3c')][_0xc206('0x1e')]);_0x40ad80['offset']=qs['offset'](_0x3bcd2e['query']['offset']);}return _0x3cd09e[_0xc206('0x9b')](_0x40ad80);}})[_0xc206('0x2f')](function(_0xddb6f1){return _0xddb6f1?{'count':_0x221e82,'rows':_0xddb6f1}:null;})[_0xc206('0x2f')](respondWithResult(_0x19b6ae,null))['catch'](handleError(_0x19b6ae,null));};exports[_0xc206('0x9c')]=function(_0x32efc5,_0x56f244,_0x4a20d2){var _0xa19dea={};var _0x2ef7e3={};var _0x17789b;var _0x2a8006;return db[_0xc206('0x37')]['findOne']({'where':{'id':_0x32efc5['params']['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x56f244,null))['then'](function(_0x46d8ca){if(_0x46d8ca){_0x17789b=_0x46d8ca;_0x2ef7e3['model']=_[_0xc206('0x4f')](db['CmList'][_0xc206('0x38')]);_0x2ef7e3[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x32efc5['query']);_0x2ef7e3['filters']=_['intersection'](_0x2ef7e3[_0xc206('0x3b')],_0x2ef7e3[_0xc206('0x3c')]);_0xa19dea[_0xc206('0x3f')]=_['intersection'](_0x2ef7e3[_0xc206('0x3b')],qs[_0xc206('0x40')](_0x32efc5['query'][_0xc206('0x40')]));_0xa19dea[_0xc206('0x3f')]=_0xa19dea['attributes'][_0xc206('0x41')]?_0xa19dea[_0xc206('0x3f')]:_0x2ef7e3[_0xc206('0x3b')];_0xa19dea[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x32efc5['query'][_0xc206('0x44')]);_0xa19dea['where']=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x32efc5['query'],_0x2ef7e3[_0xc206('0x3d')]));if(_0x32efc5[_0xc206('0x3c')][_0xc206('0x27')]){_0xa19dea[_0xc206('0x45')]=_[_0xc206('0x48')](_0xa19dea[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0xa19dea[_0xc206('0x3f')],function(_0x2b60f1){var _0x48c6a1={};_0x48c6a1[_0x2b60f1]={'$like':'%'+_0x32efc5[_0xc206('0x3c')][_0xc206('0x27')]+'%'};return _0x48c6a1;})});}_0xa19dea=_[_0xc206('0x48')]({},_0xa19dea,_0x32efc5[_0xc206('0x49')]);return _0x17789b[_0xc206('0x9c')](_0xa19dea);}})[_0xc206('0x2f')](function(_0x5361f6){if(_0x5361f6){_0x2a8006=_0x5361f6['length'];if(!_0x32efc5['query']['hasOwnProperty'](_0xc206('0x62'))){_0xa19dea[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x32efc5[_0xc206('0x3c')][_0xc206('0x1e')]);_0xa19dea[_0xc206('0x1f')]=qs[_0xc206('0x1f')](_0x32efc5[_0xc206('0x3c')][_0xc206('0x1f')]);}return _0x17789b['getLists'](_0xa19dea);}})[_0xc206('0x2f')](function(_0x2a42b3){if(_0x2a42b3){return _0x2a42b3?{'count':_0x2a8006,'rows':_0x2a42b3}:null;}})[_0xc206('0x2f')](respondWithResult(_0x56f244,null))[_0xc206('0x51')](handleError(_0x56f244,null));};exports[_0xc206('0x9d')]=function(_0x2f13b4,_0x4875b4,_0x469c26){var _0x31a5f1,_0x213598;return db[_0xc206('0x37')][_0xc206('0x2d')]({'where':{'id':_0x2f13b4[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x4875b4,null))[_0xc206('0x2f')](function(_0x4a6d38){if(_0x4a6d38){_0x213598=_0x4a6d38;return _0x4a6d38[_0xc206('0x9d')](_0x2f13b4['body'][_0xc206('0x81')],_['omit'](_0x2f13b4['body'],[_0xc206('0x81'),'id'])||{});}return null;})[_0xc206('0x9e')](function(_0x1933e2){var _0x5c6912;_0x31a5f1=_0x1933e2||[];var _0x58c884=[];if(_0x1933e2){for(var _0x436e65=0x0;_0x436e65<_0x1933e2[_0xc206('0x41')];_0x436e65+=0x1){var _0x66b9d1=_0x1933e2[_0x436e65][_0xc206('0x24')]({'plain':!![]});_0x213598['dialCheckDuplicateType']=_0x2f13b4['body'][_0xc206('0x9f')]?_0x2f13b4['body'][_0xc206('0x9f')]:_0x213598['dialCheckDuplicateType'];switch(_0x213598[_0xc206('0x9f')]){case _0xc206('0xa0'):_0x5c6912=squel[_0xc206('0xa1')]()['into'](_0xc206('0xa2'))[_0xc206('0xa3')]([_0xc206('0xa4'),_0xc206('0xa5'),_0xc206('0xa6'),_0xc206('0xa7'),_0xc206('0x63'),_0xc206('0xa8'),_0xc206('0x5c')],squel[_0xc206('0x82')]()[_0xc206('0x83')](_0xc206('0xa4'),_0xc206('0xa4'))['field'](_0xc206('0xa9'),'scheduledAt')[_0xc206('0x83')]('id',_0xc206('0xa6'))[_0xc206('0x83')](_0x66b9d1[_0xc206('0xaa')][_0xc206('0x8b')](),_0xc206('0xa7'))[_0xc206('0x83')](_0x2f13b4['params']['id'][_0xc206('0x8b')](),'VoiceQueueId')['field']('NOW()',_0xc206('0xa8'))['field'](_0xc206('0xa9'),_0xc206('0x5c'))[_0xc206('0x84')](_0xc206('0xab'))[_0xc206('0x45')](_0xc206('0xac'))[_0xc206('0x45')]('ListId\x20=\x20?',_0x66b9d1[_0xc206('0xaa')][_0xc206('0x8b')]())[_0xc206('0x45')](_0xc206('0xad'))[_0xc206('0x45')](_0xc206('0xae'),squel[_0xc206('0x82')]()[_0xc206('0x83')](_0xc206('0xaf'))['from'](_0xc206('0xb0'))[_0xc206('0x45')](_0xc206('0x87'),_0x2f13b4[_0xc206('0x4e')]['id'][_0xc206('0x8b')]()))[_0xc206('0x45')](_0xc206('0xae'),squel[_0xc206('0x82')]()[_0xc206('0x83')](_0xc206('0xb1'))[_0xc206('0x84')](_0xc206('0xa2'))[_0xc206('0x45')](_0xc206('0x87'),_0x2f13b4['params']['id'][_0xc206('0x8b')]())))[_0xc206('0x8b')]();break;case _0xc206('0xb2'):_0x5c6912=squel['insert']()[_0xc206('0xb3')](_0xc206('0xa2'))['fromQuery']([_0xc206('0xa4'),'scheduledAt','ContactId',_0xc206('0xa7'),_0xc206('0x63'),'createdAt',_0xc206('0x5c')],squel[_0xc206('0x82')]()['field'](_0xc206('0xa4'),_0xc206('0xa4'))[_0xc206('0x83')](_0xc206('0xa9'),'scheduledAt')['field']('id',_0xc206('0xa6'))[_0xc206('0x83')](_0x66b9d1[_0xc206('0xaa')][_0xc206('0x8b')](),_0xc206('0xa7'))[_0xc206('0x83')](_0x2f13b4['params']['id'][_0xc206('0x8b')](),_0xc206('0x63'))['field'](_0xc206('0xa9'),_0xc206('0xa8'))['field']('NOW()','updatedAt')[_0xc206('0x84')](_0xc206('0xab'))['where'](_0xc206('0xac'))[_0xc206('0x45')](_0xc206('0xb4'),_0x66b9d1[_0xc206('0xaa')][_0xc206('0x8b')]())[_0xc206('0x45')](_0xc206('0xad'))['where'](_0xc206('0xae'),squel[_0xc206('0x82')]()[_0xc206('0x83')]('COALESCE(phone,\x27\x27)')[_0xc206('0x84')](_0xc206('0xa2'))['where']('VoiceQueueId\x20=\x20?',_0x2f13b4[_0xc206('0x4e')]['id']['toString']())))['toString']();break;default:_0x5c6912=squel[_0xc206('0xa1')]()[_0xc206('0xb3')](_0xc206('0xa2'))[_0xc206('0xa3')]([_0xc206('0xa4'),_0xc206('0xa5'),_0xc206('0xa6'),_0xc206('0xa7'),_0xc206('0x63'),'createdAt',_0xc206('0x5c')],squel[_0xc206('0x82')]()['field']('phone',_0xc206('0xa4'))[_0xc206('0x83')](_0xc206('0xa9'),_0xc206('0xa5'))[_0xc206('0x83')]('id','ContactId')[_0xc206('0x83')](_0x66b9d1[_0xc206('0xaa')]['toString'](),_0xc206('0xa7'))[_0xc206('0x83')](_0x2f13b4[_0xc206('0x4e')]['id'][_0xc206('0x8b')](),_0xc206('0x63'))['field'](_0xc206('0xa9'),_0xc206('0xa8'))['field']('NOW()',_0xc206('0x5c'))['from'](_0xc206('0xab'))[_0xc206('0x45')](_0xc206('0xac'))[_0xc206('0x45')]('ListId\x20=\x20?',_0x66b9d1[_0xc206('0xaa')]['toString']())[_0xc206('0x45')](_0xc206('0xad')))['toString']();}_0x58c884['push'](db[_0xc206('0x76')]['query'](_0x5c6912));}return BPromise[_0xc206('0x8f')](_0x58c884);}})[_0xc206('0x2f')](function(){return _0x31a5f1;})[_0xc206('0x2f')](respondWithResult(_0x4875b4,null))[_0xc206('0x51')](handleError(_0x4875b4,null));};exports[_0xc206('0xb5')]=function(_0x10404d,_0x3a62ff,_0x558f58){return db[_0xc206('0x37')]['find']({'where':{'id':_0x10404d[_0xc206('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3a62ff,null))['then'](function(_0x548f71){if(_0x548f71){return _0x548f71[_0xc206('0xb5')](_0x10404d[_0xc206('0x3c')][_0xc206('0x81')]);}})['then'](function(_0x31a849){if(_0x31a849){return db[_0xc206('0x61')][_0xc206('0x95')]({'where':{'ListId':_0x10404d['query'][_0xc206('0x81')],'VoiceQueueId':_0x10404d[_0xc206('0x4e')]['id']}})['then'](function(){return _0x31a849;});}})[_0xc206('0x2f')](respondWithStatusCode(_0x3a62ff,null))[_0xc206('0x51')](handleError(_0x3a62ff,null));};exports[_0xc206('0xb6')]=function(_0x3d1c23,_0x132fe8,_0x508ddf){var _0x1920b6={};var _0x509a97={};var _0x22bdd3;var _0x3d1c61;return db[_0xc206('0x37')][_0xc206('0x60')]({'where':{'id':_0x3d1c23[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x132fe8,null))[_0xc206('0x2f')](function(_0x37128b){if(_0x37128b){_0x22bdd3=_0x37128b;_0x509a97[_0xc206('0x3b')]=_[_0xc206('0x4f')](db[_0xc206('0xb7')][_0xc206('0x38')]);_0x509a97[_0xc206('0x3c')]=_[_0xc206('0x4f')](_0x3d1c23[_0xc206('0x3c')]);_0x509a97['filters']=_[_0xc206('0x3e')](_0x509a97[_0xc206('0x3b')],_0x509a97['query']);_0x1920b6[_0xc206('0x3f')]=_['intersection'](_0x509a97['model'],qs['fields'](_0x3d1c23[_0xc206('0x3c')][_0xc206('0x40')]));_0x1920b6[_0xc206('0x3f')]=_0x1920b6[_0xc206('0x3f')]['length']?_0x1920b6[_0xc206('0x3f')]:_0x509a97[_0xc206('0x3b')];_0x1920b6[_0xc206('0x43')]=qs[_0xc206('0x44')](_0x3d1c23[_0xc206('0x3c')][_0xc206('0x44')]);_0x1920b6['where']=qs[_0xc206('0x3d')](_[_0xc206('0x46')](_0x3d1c23[_0xc206('0x3c')],_0x509a97['filters']));if(_0x3d1c23[_0xc206('0x3c')][_0xc206('0x27')]){_0x1920b6[_0xc206('0x45')]=_['merge'](_0x1920b6[_0xc206('0x45')],{'$or':_[_0xc206('0x29')](_0x1920b6[_0xc206('0x3f')],function(_0x46ba19){var _0x403543={};_0x403543[_0x46ba19]={'$like':'%'+_0x3d1c23[_0xc206('0x3c')]['filter']+'%'};return _0x403543;})});}_0x1920b6=_[_0xc206('0x48')]({},_0x1920b6,_0x3d1c23[_0xc206('0x49')]);return _0x22bdd3[_0xc206('0xb6')](_0x1920b6);}})[_0xc206('0x2f')](function(_0x4d9bfa){if(_0x4d9bfa){_0x3d1c61=_0x4d9bfa[_0xc206('0x41')];if(!_0x3d1c23[_0xc206('0x3c')]['hasOwnProperty'](_0xc206('0x62'))){_0x1920b6[_0xc206('0x1e')]=qs[_0xc206('0x1e')](_0x3d1c23[_0xc206('0x3c')]['limit']);_0x1920b6[_0xc206('0x1f')]=qs['offset'](_0x3d1c23[_0xc206('0x3c')][_0xc206('0x1f')]);}return _0x22bdd3[_0xc206('0xb6')](_0x1920b6);}})[_0xc206('0x2f')](function(_0x583e3b){if(_0x583e3b){return _0x583e3b?{'count':_0x3d1c61,'rows':_0x583e3b}:null;}})[_0xc206('0x2f')](respondWithResult(_0x132fe8,null))['catch'](handleError(_0x132fe8,null));};exports[_0xc206('0xb8')]=function(_0x40cb0c,_0x3220d7,_0x125c06){var _0xa27a2d,_0x32907a;return db['VoiceQueue'][_0xc206('0x2d')]({'where':{'id':_0x40cb0c['params']['id']}})['then'](handleEntityNotFound(_0x3220d7,null))[_0xc206('0x2f')](function(_0x42e86d){if(_0x42e86d){_0x32907a=_0x42e86d;return _0x42e86d['addBlackLists'](_0x40cb0c[_0xc206('0x53')][_0xc206('0x81')],_[_0xc206('0x5b')](_0x40cb0c['body'],[_0xc206('0x81'),'id'])||{});}return null;})[_0xc206('0x9e')](function(_0x3d7584){var _0x3335d9;_0xa27a2d=_0x3d7584||[];var _0x40d7f0=[];if(_0x3d7584){for(var _0x33786a=0x0;_0x33786a<_0x3d7584[_0xc206('0x41')];_0x33786a+=0x1){var _0x2586cf=_0x3d7584[_0x33786a]['get']({'plain':!![]});_0x3335d9=squel[_0xc206('0xa1')]()[_0xc206('0xb3')](_0xc206('0xb9'))[_0xc206('0xa3')]([_0xc206('0xa4'),'ContactId',_0xc206('0xa7'),_0xc206('0x63'),'createdAt',_0xc206('0x5c')],squel[_0xc206('0x82')]()[_0xc206('0x83')](_0xc206('0xa4'),'phone')[_0xc206('0x83')]('id','ContactId')[_0xc206('0x83')](_0x2586cf[_0xc206('0xaa')][_0xc206('0x8b')](),_0xc206('0xa7'))[_0xc206('0x83')](_0x40cb0c[_0xc206('0x4e')]['id']['toString'](),'VoiceQueueId')[_0xc206('0x83')](_0xc206('0xa9'),_0xc206('0xa8'))['field'](_0xc206('0xa9'),_0xc206('0x5c'))['from'](_0xc206('0xab'))[_0xc206('0x45')]('deletedAt\x20IS\x20NULL')['where'](_0xc206('0xb4'),_0x2586cf[_0xc206('0xaa')][_0xc206('0x8b')]())['where'](_0xc206('0xad')))[_0xc206('0x8b')]();_0x40d7f0[_0xc206('0x8a')](db[_0xc206('0x76')][_0xc206('0x3c')](_0x3335d9));}return BPromise[_0xc206('0x8f')](_0x40d7f0);}})[_0xc206('0x2f')](function(){return _0xa27a2d;})['then'](respondWithResult(_0x3220d7,null))[_0xc206('0x51')](handleError(_0x3220d7,null));};exports[_0xc206('0xba')]=function(_0x4e0b09,_0x1241a7,_0x3b3515){return db[_0xc206('0x37')]['find']({'where':{'id':_0x4e0b09[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](handleEntityNotFound(_0x1241a7,null))[_0xc206('0x2f')](function(_0x12cdea){if(_0x12cdea){return _0x12cdea[_0xc206('0xba')](_0x4e0b09[_0xc206('0x3c')][_0xc206('0x81')]);}})[_0xc206('0x2f')](function(_0x2fd9e0){if(_0x2fd9e0){return db['CmHopperBlack'][_0xc206('0x95')]({'where':{'ListId':_0x4e0b09['query'][_0xc206('0x81')],'VoiceQueueId':_0x4e0b09[_0xc206('0x4e')]['id']}})[_0xc206('0x2f')](function(){return _0x2fd9e0;});}})['then'](respondWithStatusCode(_0x1241a7,null))[_0xc206('0x51')](handleError(_0x1241a7,null));};
\ No newline at end of file
index e2bcd34..a3e4648 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe888=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x528ffb,_0x2df4e0){var _0x41895=function(_0x3d576a){while(--_0x3d576a){_0x528ffb['push'](_0x528ffb['shift']());}};_0x41895(++_0x2df4e0);}(_0xe888,0x1e5));var _0x8e88=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xe888[_0x79b649];return _0x1af9b1;};'use strict';var EventEmitter=require(_0x8e88('0x0'));var VoiceQueue=require(_0x8e88('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x8e88('0x2')](0x0);var events={'afterCreate':_0x8e88('0x3'),'afterUpdate':_0x8e88('0x4'),'afterDestroy':'remove'};function emitEvent(_0x29a420){return function(_0x3c027f,_0x43e273,_0x48145f){VoiceQueueEvents[_0x8e88('0x5')](_0x29a420+':'+_0x3c027f['id'],_0x3c027f);VoiceQueueEvents['emit'](_0x29a420,_0x3c027f);_0x48145f(null);};}for(var e in events){if(events[_0x8e88('0x6')](e)){var event=events[e];VoiceQueue[_0x8e88('0x7')](e,emitEvent(event));}}module[_0x8e88('0x8')]=VoiceQueueEvents;
\ No newline at end of file
+var _0xc960=['events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x15b932,_0x39ba3f){var _0x28fa64=function(_0x479c8a){while(--_0x479c8a){_0x15b932['push'](_0x15b932['shift']());}};_0x28fa64(++_0x39ba3f);}(_0xc960,0xd8));var _0x0c96=function(_0x443a3c,_0x3dc955){_0x443a3c=_0x443a3c-0x0;var _0x1f32a7=_0xc960[_0x443a3c];return _0x1f32a7;};'use strict';var EventEmitter=require(_0x0c96('0x0'));var VoiceQueue=require(_0x0c96('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0c96('0x2')](0x0);var events={'afterCreate':_0x0c96('0x3'),'afterUpdate':_0x0c96('0x4'),'afterDestroy':'remove'};function emitEvent(_0x7086d4){return function(_0x9ad18f,_0x287b95,_0x8cae18){VoiceQueueEvents[_0x0c96('0x5')](_0x7086d4+':'+_0x9ad18f['id'],_0x9ad18f);VoiceQueueEvents['emit'](_0x7086d4,_0x9ad18f);_0x8cae18(null);};}for(var e in events){if(events[_0x0c96('0x6')](e)){var event=events[e];VoiceQueue[_0x0c96('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents;
\ No newline at end of file
index 6a4fc5c..3e5d308 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x3d4687,_0xae81f6){var _0x3aa67f=function(_0x3f1ef4){while(--_0x3f1ef4){_0x3d4687['push'](_0x3d4687['shift']());}};_0x3aa67f(++_0xae81f6);}(_0xedd9,0xfc));var _0x9edd=function(_0x25594a,_0x56bfe2){_0x25594a=_0x25594a-0x0;var _0x500b31=_0xedd9[_0x25594a];return _0x500b31;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x255caf,_0x2f893b){var _0x25e862=function(_0xffbed9){while(--_0xffbed9){_0x255caf['push'](_0x255caf['shift']());}};_0x25e862(++_0x2f893b);}(_0x008c,0x188));var _0xc008=function(_0x5bc05a,_0x20fe3a){_0x5bc05a=_0x5bc05a-0x0;var _0x5bbd92=_0x008c[_0x5bc05a];return _0x5bbd92;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 318dcdd..1d041f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbbe0=['redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','info','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','VoiceQueue,\x20%s,\x20%s','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','map','include','model','attributes','debug','ShowVoiceQueue','find','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x2465d0,_0x1e7b48){var _0x2a2dba=function(_0x4b26b0){while(--_0x4b26b0){_0x2465d0['push'](_0x2465d0['shift']());}};_0x2a2dba(++_0x1e7b48);}(_0xbbe0,0x6d));var _0x0bbe=function(_0x8aec76,_0x6cf63d){_0x8aec76=_0x8aec76-0x0;var _0x57de59=_0xbbe0[_0x8aec76];return _0x57de59;};'use strict';var _=require(_0x0bbe('0x0'));var util=require(_0x0bbe('0x1'));var moment=require(_0x0bbe('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bbe('0x3'));var fs=require('fs');var Redis=require(_0x0bbe('0x4'));var db=require(_0x0bbe('0x5'))['db'];var utils=require(_0x0bbe('0x6'));var logger=require('../../config/logger')(_0x0bbe('0x7'));var config=require(_0x0bbe('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0bbe('0x9')][_0x0bbe('0xa')]({'port':0x232a});config[_0x0bbe('0xb')]=_[_0x0bbe('0xc')](config[_0x0bbe('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0bbe('0xd'))(new Redis(config[_0x0bbe('0xb')]));require(_0x0bbe('0xe'))[_0x0bbe('0xf')](socket);function respondWithRpcPromise(_0x510e61,_0xc76379,_0x22a297){return new BPromise(function(_0x129fcd,_0x5d4672){return client[_0x0bbe('0x10')](_0x510e61,_0x22a297)['then'](function(_0x4216b2){logger[_0x0bbe('0x11')]('VoiceQueue,\x20%s,\x20%s',_0xc76379,'request\x20sent');logger['debug'](_0x0bbe('0x12'),_0xc76379,_0x0bbe('0x13'),JSON[_0x0bbe('0x14')](_0x4216b2));if(_0x4216b2[_0x0bbe('0x15')]){if(_0x4216b2['error']['code']===0x1f4){logger[_0x0bbe('0x15')]('VoiceQueue,\x20%s,\x20%s',_0xc76379,_0x4216b2[_0x0bbe('0x15')][_0x0bbe('0x16')]);return _0x5d4672(_0x4216b2[_0x0bbe('0x15')][_0x0bbe('0x16')]);}logger['error'](_0x0bbe('0x17'),_0xc76379,_0x4216b2[_0x0bbe('0x15')][_0x0bbe('0x16')]);return _0x129fcd(_0x4216b2[_0x0bbe('0x15')][_0x0bbe('0x16')]);}else{logger[_0x0bbe('0x11')](_0x0bbe('0x17'),_0xc76379,_0x0bbe('0x13'));_0x129fcd(_0x4216b2['result'][_0x0bbe('0x16')]);}})[_0x0bbe('0x18')](function(_0x468d28){logger[_0x0bbe('0x15')](_0x0bbe('0x17'),_0xc76379,_0x468d28);_0x5d4672(_0x468d28);});});}exports[_0x0bbe('0x19')]=function(_0x58bb08){var _0xa70d3d=this;return new Promise(function(_0x4c4375,_0x29be0b){return db[_0x0bbe('0x1a')][_0x0bbe('0x1b')]({'raw':_0x58bb08[_0x0bbe('0x1c')]?_0x58bb08[_0x0bbe('0x1c')][_0x0bbe('0x1d')]===undefined?!![]:![]:!![],'where':_0x58bb08[_0x0bbe('0x1c')]?_0x58bb08[_0x0bbe('0x1c')][_0x0bbe('0x1e')]||null:null,'attributes':_0x58bb08[_0x0bbe('0x1c')]?_0x58bb08[_0x0bbe('0x1c')]['attributes']||null:null,'limit':_0x58bb08[_0x0bbe('0x1c')]?_0x58bb08[_0x0bbe('0x1c')][_0x0bbe('0x1f')]||null:null,'include':_0x58bb08[_0x0bbe('0x1c')]?_0x58bb08[_0x0bbe('0x1c')]['include']?_[_0x0bbe('0x20')](_0x58bb08[_0x0bbe('0x1c')][_0x0bbe('0x21')],function(_0x1dd4c3){return{'model':db[_0x1dd4c3[_0x0bbe('0x22')]],'as':_0x1dd4c3['as'],'attributes':_0x1dd4c3[_0x0bbe('0x23')],'include':_0x1dd4c3[_0x0bbe('0x21')]?_[_0x0bbe('0x20')](_0x1dd4c3['include'],function(_0x32451f){return{'model':db[_0x32451f[_0x0bbe('0x22')]],'as':_0x32451f['as'],'attributes':_0x32451f['attributes'],'include':_0x32451f['include']?_[_0x0bbe('0x20')](_0x32451f['include'],function(_0x4aa692){return{'model':db[_0x4aa692[_0x0bbe('0x22')]],'as':_0x4aa692['as'],'attributes':_0x4aa692['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x932c80){logger[_0x0bbe('0x11')](_0x0bbe('0x19'),_0x58bb08);logger[_0x0bbe('0x24')](_0x0bbe('0x19'),_0x58bb08,JSON['stringify'](_0x932c80));_0x4c4375(_0x932c80);})[_0x0bbe('0x18')](function(_0x3bd223){logger[_0x0bbe('0x15')](_0x0bbe('0x19'),_0x3bd223[_0x0bbe('0x16')],_0x58bb08);_0x29be0b(_0xa70d3d['error'](0x1f4,_0x3bd223[_0x0bbe('0x16')]));});});};exports[_0x0bbe('0x25')]=function(_0x19bb2f){var _0x5535f0=this;return new Promise(function(_0x44e62a,_0x5b4ece){return db[_0x0bbe('0x1a')][_0x0bbe('0x26')]({'raw':_0x19bb2f[_0x0bbe('0x1c')]?_0x19bb2f['options'][_0x0bbe('0x1d')]===undefined?!![]:![]:!![],'where':_0x19bb2f[_0x0bbe('0x1c')]?_0x19bb2f['options'][_0x0bbe('0x1e')]||null:null,'attributes':_0x19bb2f[_0x0bbe('0x1c')]?_0x19bb2f[_0x0bbe('0x1c')][_0x0bbe('0x23')]||null:null,'include':_0x19bb2f[_0x0bbe('0x1c')]?_0x19bb2f[_0x0bbe('0x1c')][_0x0bbe('0x21')]?_[_0x0bbe('0x20')](_0x19bb2f[_0x0bbe('0x1c')][_0x0bbe('0x21')],function(_0x1e280f){return{'model':db[_0x1e280f['model']],'as':_0x1e280f['as'],'attributes':_0x1e280f['attributes'],'include':_0x1e280f[_0x0bbe('0x21')]?_['map'](_0x1e280f[_0x0bbe('0x21')],function(_0x365ea2){return{'model':db[_0x365ea2[_0x0bbe('0x22')]],'as':_0x365ea2['as'],'attributes':_0x365ea2[_0x0bbe('0x23')],'include':_0x365ea2[_0x0bbe('0x21')]?_[_0x0bbe('0x20')](_0x365ea2[_0x0bbe('0x21')],function(_0x2b56e0){return{'model':db[_0x2b56e0[_0x0bbe('0x22')]],'as':_0x2b56e0['as'],'attributes':_0x2b56e0[_0x0bbe('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0bbe('0x27')](function(_0x8241dc){logger[_0x0bbe('0x11')](_0x0bbe('0x25'),_0x19bb2f);logger[_0x0bbe('0x24')](_0x0bbe('0x25'),_0x19bb2f,JSON[_0x0bbe('0x14')](_0x8241dc));_0x44e62a(_0x8241dc);})[_0x0bbe('0x18')](function(_0x4c928d){logger[_0x0bbe('0x15')](_0x0bbe('0x25'),_0x4c928d['message'],_0x19bb2f);_0x5b4ece(_0x5535f0[_0x0bbe('0x15')](0x1f4,_0x4c928d[_0x0bbe('0x16')]));});});};
\ No newline at end of file
+var _0x0ac5=['register','request','then','info','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','raw','options','where','attributes','limit','include','map','model','stringify','ShowVoiceQueue','VoiceQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','defaults','redis','socket.io-emitter','./voiceQueue.socket'];(function(_0x55bac1,_0x51cf9b){var _0x99e374=function(_0x31554f){while(--_0x31554f){_0x55bac1['push'](_0x55bac1['shift']());}};_0x99e374(++_0x51cf9b);}(_0x0ac5,0x65));var _0x50ac=function(_0x20bf3c,_0x19240b){_0x20bf3c=_0x20bf3c-0x0;var _0x5a6596=_0x0ac5[_0x20bf3c];return _0x5a6596;};'use strict';var _=require(_0x50ac('0x0'));var util=require(_0x50ac('0x1'));var moment=require(_0x50ac('0x2'));var BPromise=require('bluebird');var rs=require(_0x50ac('0x3'));var fs=require('fs');var Redis=require(_0x50ac('0x4'));var db=require(_0x50ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x50ac('0x6'))(_0x50ac('0x7'));var config=require('../../config/environment');var jayson=require(_0x50ac('0x8'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x50ac('0x9')](config[_0x50ac('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x50ac('0xb'))(new Redis(config[_0x50ac('0xa')]));require(_0x50ac('0xc'))[_0x50ac('0xd')](socket);function respondWithRpcPromise(_0xa52623,_0xf07520,_0x47522){return new BPromise(function(_0x1b77d1,_0x2b5e4c){return client[_0x50ac('0xe')](_0xa52623,_0x47522)[_0x50ac('0xf')](function(_0x462c0f){logger[_0x50ac('0x10')]('VoiceQueue,\x20%s,\x20%s',_0xf07520,_0x50ac('0x11'));logger[_0x50ac('0x12')](_0x50ac('0x13'),_0xf07520,_0x50ac('0x11'),JSON['stringify'](_0x462c0f));if(_0x462c0f[_0x50ac('0x14')]){if(_0x462c0f['error']['code']===0x1f4){logger[_0x50ac('0x14')](_0x50ac('0x15'),_0xf07520,_0x462c0f[_0x50ac('0x14')][_0x50ac('0x16')]);return _0x2b5e4c(_0x462c0f[_0x50ac('0x14')][_0x50ac('0x16')]);}logger[_0x50ac('0x14')]('VoiceQueue,\x20%s,\x20%s',_0xf07520,_0x462c0f[_0x50ac('0x14')][_0x50ac('0x16')]);return _0x1b77d1(_0x462c0f['error']['message']);}else{logger[_0x50ac('0x10')](_0x50ac('0x15'),_0xf07520,'request\x20sent');_0x1b77d1(_0x462c0f[_0x50ac('0x17')][_0x50ac('0x16')]);}})[_0x50ac('0x18')](function(_0x554527){logger[_0x50ac('0x14')]('VoiceQueue,\x20%s,\x20%s',_0xf07520,_0x554527);_0x2b5e4c(_0x554527);});});}exports[_0x50ac('0x19')]=function(_0x572814){var _0x387d70=this;return new Promise(function(_0x156683,_0x466b4d){return db['VoiceQueue']['findAll']({'raw':_0x572814['options']?_0x572814['options'][_0x50ac('0x1a')]===undefined?!![]:![]:!![],'where':_0x572814[_0x50ac('0x1b')]?_0x572814[_0x50ac('0x1b')][_0x50ac('0x1c')]||null:null,'attributes':_0x572814[_0x50ac('0x1b')]?_0x572814['options'][_0x50ac('0x1d')]||null:null,'limit':_0x572814[_0x50ac('0x1b')]?_0x572814['options'][_0x50ac('0x1e')]||null:null,'include':_0x572814[_0x50ac('0x1b')]?_0x572814[_0x50ac('0x1b')]['include']?_['map'](_0x572814['options'][_0x50ac('0x1f')],function(_0x3bc774){return{'model':db[_0x3bc774['model']],'as':_0x3bc774['as'],'attributes':_0x3bc774[_0x50ac('0x1d')],'include':_0x3bc774[_0x50ac('0x1f')]?_[_0x50ac('0x20')](_0x3bc774[_0x50ac('0x1f')],function(_0x1ab591){return{'model':db[_0x1ab591[_0x50ac('0x21')]],'as':_0x1ab591['as'],'attributes':_0x1ab591[_0x50ac('0x1d')],'include':_0x1ab591[_0x50ac('0x1f')]?_[_0x50ac('0x20')](_0x1ab591[_0x50ac('0x1f')],function(_0x3fb253){return{'model':db[_0x3fb253[_0x50ac('0x21')]],'as':_0x3fb253['as'],'attributes':_0x3fb253[_0x50ac('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50ac('0xf')](function(_0x3637d8){logger['info'](_0x50ac('0x19'),_0x572814);logger[_0x50ac('0x12')](_0x50ac('0x19'),_0x572814,JSON[_0x50ac('0x22')](_0x3637d8));_0x156683(_0x3637d8);})[_0x50ac('0x18')](function(_0x5911f2){logger['error'](_0x50ac('0x19'),_0x5911f2['message'],_0x572814);_0x466b4d(_0x387d70[_0x50ac('0x14')](0x1f4,_0x5911f2[_0x50ac('0x16')]));});});};exports[_0x50ac('0x23')]=function(_0x51a497){var _0xe83e83=this;return new Promise(function(_0x533f44,_0x37da7c){return db[_0x50ac('0x24')][_0x50ac('0x25')]({'raw':_0x51a497[_0x50ac('0x1b')]?_0x51a497[_0x50ac('0x1b')][_0x50ac('0x1a')]===undefined?!![]:![]:!![],'where':_0x51a497[_0x50ac('0x1b')]?_0x51a497[_0x50ac('0x1b')][_0x50ac('0x1c')]||null:null,'attributes':_0x51a497['options']?_0x51a497[_0x50ac('0x1b')][_0x50ac('0x1d')]||null:null,'include':_0x51a497['options']?_0x51a497[_0x50ac('0x1b')]['include']?_['map'](_0x51a497['options'][_0x50ac('0x1f')],function(_0x2ede9c){return{'model':db[_0x2ede9c[_0x50ac('0x21')]],'as':_0x2ede9c['as'],'attributes':_0x2ede9c['attributes'],'include':_0x2ede9c[_0x50ac('0x1f')]?_['map'](_0x2ede9c[_0x50ac('0x1f')],function(_0x173402){return{'model':db[_0x173402[_0x50ac('0x21')]],'as':_0x173402['as'],'attributes':_0x173402['attributes'],'include':_0x173402['include']?_[_0x50ac('0x20')](_0x173402[_0x50ac('0x1f')],function(_0x2c098d){return{'model':db[_0x2c098d[_0x50ac('0x21')]],'as':_0x2c098d['as'],'attributes':_0x2c098d[_0x50ac('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50ac('0xf')](function(_0x1dbd2f){logger['info'](_0x50ac('0x23'),_0x51a497);logger[_0x50ac('0x12')](_0x50ac('0x23'),_0x51a497,JSON[_0x50ac('0x22')](_0x1dbd2f));_0x533f44(_0x1dbd2f);})[_0x50ac('0x18')](function(_0x3977f6){logger['error'](_0x50ac('0x23'),_0x3977f6[_0x50ac('0x16')],_0x51a497);_0x37da7c(_0xe83e83[_0x50ac('0x14')](0x1f4,_0x3977f6[_0x50ac('0x16')]));});});};
\ No newline at end of file
index e10192c..58c594c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04d4=['remove','update','emit','length','voiceQueue:','./voiceQueue.events','save'];(function(_0x116f7a,_0x34f408){var _0x5c2a2c=function(_0x3f5e56){while(--_0x3f5e56){_0x116f7a['push'](_0x116f7a['shift']());}};_0x5c2a2c(++_0x34f408);}(_0x04d4,0x91));var _0x404d=function(_0x171514,_0x340d41){_0x171514=_0x171514-0x0;var _0x59fb21=_0x04d4[_0x171514];return _0x59fb21;};'use strict';var VoiceQueueEvents=require(_0x404d('0x0'));var events=[_0x404d('0x1'),_0x404d('0x2'),_0x404d('0x3')];function createListener(_0x3fc8e7,_0x3b4ee6){return function(_0x4d4e7d){_0x3b4ee6[_0x404d('0x4')](_0x3fc8e7,_0x4d4e7d);};}function removeListener(_0x86be8,_0x45b05d){return function(){VoiceQueueEvents['removeListener'](_0x86be8,_0x45b05d);};}exports['register']=function(_0x139846){for(var _0x2ef54c=0x0,_0x460952=events[_0x404d('0x5')];_0x2ef54c<_0x460952;_0x2ef54c++){var _0x1ac48a=events[_0x2ef54c];var _0xf68237=createListener(_0x404d('0x6')+_0x1ac48a,_0x139846);VoiceQueueEvents['on'](_0x1ac48a,_0xf68237);}};
\ No newline at end of file
+var _0x06e5=['register','length','voiceQueue:','./voiceQueue.events','save','remove','update','emit'];(function(_0x5ec4db,_0x5d931e){var _0x40b983=function(_0x5b6763){while(--_0x5b6763){_0x5ec4db['push'](_0x5ec4db['shift']());}};_0x40b983(++_0x5d931e);}(_0x06e5,0x73));var _0x506e=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x06e5[_0x422905];return _0x33dc6c;};'use strict';var VoiceQueueEvents=require(_0x506e('0x0'));var events=[_0x506e('0x1'),_0x506e('0x2'),_0x506e('0x3')];function createListener(_0x5641ac,_0x35278b){return function(_0x49b28d){_0x35278b[_0x506e('0x4')](_0x5641ac,_0x49b28d);};}function removeListener(_0xee2fba,_0x473063){return function(){VoiceQueueEvents['removeListener'](_0xee2fba,_0x473063);};}exports[_0x506e('0x5')]=function(_0x1fee6c){for(var _0xa473ce=0x0,_0x198b1d=events[_0x506e('0x6')];_0xa473ce<_0x198b1d;_0xa473ce++){var _0x564aa0=events[_0xa473ce];var _0xe72cc3=createListener(_0x506e('0x7')+_0x564aa0,_0x1fee6c);VoiceQueueEvents['on'](_0x564aa0,_0xe72cc3);}};
\ No newline at end of file
index e266f28..ee901e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe55=['delete','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','isAuthenticated','index','/describe','describe','get','/index','getVoiceQueuesReport','show','post','create','/:id','update'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xbe55,0x76));var _0x5be5=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbe55[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x5be5('0x0'));var util=require(_0x5be5('0x1'));var path=require(_0x5be5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5be5('0x3')]();var fs_extra=require(_0x5be5('0x4'));var auth=require(_0x5be5('0x5'));var interaction=require(_0x5be5('0x6'));var config=require('../../config/environment');var controller=require(_0x5be5('0x7'));router['get']('/',auth[_0x5be5('0x8')](),controller[_0x5be5('0x9')]);router['get'](_0x5be5('0xa'),auth[_0x5be5('0x8')](),controller[_0x5be5('0xb')]);router[_0x5be5('0xc')](_0x5be5('0xd'),auth[_0x5be5('0x8')](),controller[_0x5be5('0xe')]);router['get']('/:id',auth[_0x5be5('0x8')](),controller[_0x5be5('0xf')]);router[_0x5be5('0x10')]('/',auth['isAuthenticated'](),controller[_0x5be5('0x11')]);router['put'](_0x5be5('0x12'),auth[_0x5be5('0x8')](),controller[_0x5be5('0x13')]);router[_0x5be5('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x5be5('0x15')]);module[_0x5be5('0x16')]=router;
\ No newline at end of file
+var _0xc26c=['post','put','update','delete','destroy','exports','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','/index','getVoiceQueuesReport','show'];(function(_0x59663d,_0x24a288){var _0x2ec850=function(_0x4f8e1b){while(--_0x4f8e1b){_0x59663d['push'](_0x59663d['shift']());}};_0x2ec850(++_0x24a288);}(_0xc26c,0x1bf));var _0xcc26=function(_0x2131b3,_0x2fa235){_0x2131b3=_0x2131b3-0x0;var _0x2b97f4=_0xc26c[_0x2131b3];return _0x2b97f4;};'use strict';var multer=require('multer');var util=require(_0xcc26('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc26('0x1'));var router=express['Router']();var fs_extra=require(_0xcc26('0x2'));var auth=require(_0xcc26('0x3'));var interaction=require(_0xcc26('0x4'));var config=require(_0xcc26('0x5'));var controller=require(_0xcc26('0x6'));router[_0xcc26('0x7')]('/',auth[_0xcc26('0x8')](),controller[_0xcc26('0x9')]);router[_0xcc26('0x7')](_0xcc26('0xa'),auth[_0xcc26('0x8')](),controller[_0xcc26('0xb')]);router[_0xcc26('0x7')](_0xcc26('0xc'),auth[_0xcc26('0x8')](),controller[_0xcc26('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcc26('0xe')]);router[_0xcc26('0xf')]('/',auth[_0xcc26('0x8')](),controller['create']);router[_0xcc26('0x10')]('/:id',auth[_0xcc26('0x8')](),controller[_0xcc26('0x11')]);router[_0xcc26('0x12')]('/:id',auth[_0xcc26('0x8')](),controller[_0xcc26('0x13')]);module[_0xcc26('0x14')]=router;
\ No newline at end of file
index b04efe6..d1f02ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9b5=['moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x3e3385,_0x38bd90){var _0x4135f0=function(_0x8d7b17){while(--_0x8d7b17){_0x3e3385['push'](_0x3e3385['shift']());}};_0x4135f0(++_0x38bd90);}(_0xd9b5,0x69));var _0x5d9b=function(_0xd673e6,_0x23f8fa){_0xd673e6=_0xd673e6-0x0;var _0x4672fc=_0xd9b5[_0xd673e6];return _0x4672fc;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5d9b('0x0'));module[_0x5d9b('0x1')]={'type':{'type':Sequelize[_0x5d9b('0x2')]},'uniqueid':{'type':Sequelize[_0x5d9b('0x2')]},'calleridnum':{'type':Sequelize[_0x5d9b('0x2')]},'calleridname':{'type':Sequelize[_0x5d9b('0x2')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x5d9b('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x5d9b('0x3')],'set':function(_0x4fdb82){var _0x20777b=moment(_0x4fdb82);var _0x280aac=moment(this[_0x5d9b('0x4')](_0x5d9b('0x5')))[_0x5d9b('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x552e13=_0x20777b['diff'](_0x280aac,_0x5d9b('0x7'));this[_0x5d9b('0x8')](_0x5d9b('0x9'),_0x4fdb82);this[_0x5d9b('0x8')](_0x5d9b('0xa'),_0x552e13||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x5d9b('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x5d9b('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x5d9b('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x5d9b('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5d9b('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x5d9b('0x2')],'comment':_0x5d9b('0xd')},'originalposition':{'type':Sequelize[_0x5d9b('0xb')]},'channel':{'type':Sequelize[_0x5d9b('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5d9b('0x2')]},'connectedlinename':{'type':Sequelize[_0x5d9b('0x2')]},'accountcode':{'type':Sequelize[_0x5d9b('0x2')]},'context':{'type':Sequelize[_0x5d9b('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5d9b('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x5d9b('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5d9b('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x5d9b('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x5d9b('0xe')},'transferexten':{'type':Sequelize[_0x5d9b('0x2')]},'transferuniqueid':{'type':Sequelize[_0x5d9b('0x2')]},'disposition':{'type':Sequelize[_0x5d9b('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5d9b('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf8f2=['STRING','DATE','getDataValue','queuecallerjoinAt','format','diff','seconds','queuecallerleaveAt','holdtime','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports'];(function(_0x6f4046,_0x133bc9){var _0x35e23f=function(_0x17140c){while(--_0x17140c){_0x6f4046['push'](_0x6f4046['shift']());}};_0x35e23f(++_0x133bc9);}(_0xf8f2,0xa7));var _0x2f8f=function(_0xc3a516,_0x32c235){_0xc3a516=_0xc3a516-0x0;var _0x1aec8a=_0xf8f2[_0xc3a516];return _0x1aec8a;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x2f8f('0x0')]={'type':{'type':Sequelize[_0x2f8f('0x1')]},'uniqueid':{'type':Sequelize[_0x2f8f('0x1')]},'calleridnum':{'type':Sequelize[_0x2f8f('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x2f8f('0x2')]},'queuecallerleaveAt':{'type':Sequelize[_0x2f8f('0x2')],'set':function(_0x471cbb){var _0x1383db=moment(_0x471cbb);var _0x2a8026=moment(this[_0x2f8f('0x3')](_0x2f8f('0x4')))[_0x2f8f('0x5')]('YYYY-MM-DD\x20HH:mm:ss');var _0x2a1332=_0x1383db[_0x2f8f('0x6')](_0x2a8026,_0x2f8f('0x7'));this['setDataValue'](_0x2f8f('0x8'),_0x471cbb);this['setDataValue'](_0x2f8f('0x9'),_0x2a1332||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize[_0x2f8f('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x2f8f('0x2')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x2f8f('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0x2f8f('0x1')],'comment':_0x2f8f('0xb')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x2f8f('0x1')]},'connectedlinename':{'type':Sequelize[_0x2f8f('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x2f8f('0x1')]},'exten':{'type':Sequelize[_0x2f8f('0x1')]},'priority':{'type':Sequelize[_0x2f8f('0x1')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x2f8f('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2f8f('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x2f8f('0x1')]},'transfer':{'type':Sequelize[_0x2f8f('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x2f8f('0x1')],'comment':_0x2f8f('0xd')},'transferexten':{'type':Sequelize[_0x2f8f('0x1')]},'transferuniqueid':{'type':Sequelize[_0x2f8f('0x1')]},'disposition':{'type':Sequelize[_0x2f8f('0x1')]},'secondDisposition':{'type':Sequelize[_0x2f8f('0x1')]},'thirdDisposition':{'type':Sequelize[_0x2f8f('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x2f8f('0xc')],'defaultValue':0x0}};
\ No newline at end of file
index 271263a..34e409f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe94b=['send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','rows','catch','show','params','keys','includeAll','create','body','find','describe','include','findAll','getVoiceQueuesReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name'];(function(_0x3232ca,_0x255c98){var _0x22502f=function(_0x44e3d3){while(--_0x44e3d3){_0x3232ca['push'](_0x3232ca['shift']());}};_0x22502f(++_0x255c98);}(_0xe94b,0xcf));var _0xbe94=function(_0x2d8c22,_0x237928){_0x2d8c22=_0x2d8c22-0x0;var _0x40c90e=_0xe94b[_0x2d8c22];return _0x40c90e;};'use strict';var emlformat=require(_0xbe94('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe94('0x1'));var jsonpatch=require(_0xbe94('0x2'));var rp=require(_0xbe94('0x3'));var moment=require(_0xbe94('0x4'));var BPromise=require(_0xbe94('0x5'));var Mustache=require(_0xbe94('0x6'));var util=require(_0xbe94('0x7'));var path=require(_0xbe94('0x8'));var sox=require(_0xbe94('0x9'));var csv=require(_0xbe94('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe94('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbe94('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbe94('0xa'));var querystring=require(_0xbe94('0xd'));var Papa=require('papaparse');var Redis=require(_0xbe94('0xe'));var authService=require(_0xbe94('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbe94('0x10'));var hardwareService=require(_0xbe94('0x11'));var logger=require(_0xbe94('0x12'))(_0xbe94('0x13'));var utils=require(_0xbe94('0x14'));var config=require(_0xbe94('0x15'));var licenseUtil=require(_0xbe94('0x16'));var db=require(_0xbe94('0x17'))['db'];config[_0xbe94('0x18')]=_[_0xbe94('0x19')](config[_0xbe94('0x18')],{'host':_0xbe94('0x1a'),'port':0x18eb});var socket=require(_0xbe94('0x1b'))(new Redis(config[_0xbe94('0x18')]));require(_0xbe94('0x1c'))[_0xbe94('0x1d')](socket);function respondWithStatusCode(_0x142164,_0xdcd3a8){_0xdcd3a8=_0xdcd3a8||0xcc;return function(_0x543b63){if(_0x543b63){return _0x142164['sendStatus'](_0xdcd3a8);}return _0x142164[_0xbe94('0x1e')](_0xdcd3a8)['end']();};}function respondWithResult(_0x16cdc2,_0x6d73c4){_0x6d73c4=_0x6d73c4||0xc8;return function(_0x3fec51){if(_0x3fec51){return _0x16cdc2[_0xbe94('0x1e')](_0x6d73c4)['json'](_0x3fec51);}};}function respondWithFilteredResult(_0x37985c,_0x629ea8){return function(_0x51fbfb){if(_0x51fbfb){var _0x435e47=typeof _0x629ea8[_0xbe94('0x1f')]==='undefined'&&typeof _0x629ea8['limit']===_0xbe94('0x20');var _0x281149=_0x51fbfb[_0xbe94('0x21')];var _0x7e75db=_0x435e47?0x0:_0x629ea8[_0xbe94('0x1f')];var _0x170954=_0x435e47?_0x51fbfb['count']:_0x629ea8[_0xbe94('0x1f')]+_0x629ea8[_0xbe94('0x22')];var _0xb30c7b;if(_0x170954>=_0x281149){_0x170954=_0x281149;_0xb30c7b=0xc8;}else{_0xb30c7b=0xce;}_0x37985c[_0xbe94('0x1e')](_0xb30c7b);return _0x37985c[_0xbe94('0x23')](_0xbe94('0x24'),_0x7e75db+'-'+_0x170954+'/'+_0x281149)[_0xbe94('0x25')](_0x51fbfb);}return null;};}function patchUpdates(_0x4d6fe6){return function(_0x53f980){try{jsonpatch[_0xbe94('0x26')](_0x53f980,_0x4d6fe6,!![]);}catch(_0x48cf4a){return BPromise[_0xbe94('0x27')](_0x48cf4a);}return _0x53f980[_0xbe94('0x28')]();};}function saveUpdates(_0x4f2af0,_0x59e959){return function(_0x12ecf5){if(_0x12ecf5){return _0x12ecf5[_0xbe94('0x29')](_0x4f2af0)[_0xbe94('0x2a')](function(_0x1a7374){return _0x1a7374;});}return null;};}function removeEntity(_0x4a9ca3,_0x4277f0){return function(_0x1d859e){if(_0x1d859e){return _0x1d859e[_0xbe94('0x2b')]()['then'](function(){_0x4a9ca3[_0xbe94('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2478de,_0xdb9e71){return function(_0x359244){if(!_0x359244){_0x2478de[_0xbe94('0x2c')](0x194);}return _0x359244;};}function handleError(_0x254968,_0x2d02a6){_0x2d02a6=_0x2d02a6||0x1f4;return function(_0x514506){logger[_0xbe94('0x2d')](_0x514506[_0xbe94('0x2e')]);if(_0x514506[_0xbe94('0x2f')]){delete _0x514506['name'];}_0x254968[_0xbe94('0x1e')](_0x2d02a6)[_0xbe94('0x30')](_0x514506);};}exports[_0xbe94('0x31')]=function(_0x18e282,_0x3ef849){var _0x5e03a6={},_0x40d39d={},_0x5c3ad1={'count':0x0,'rows':[]};var _0x1f0172=_[_0xbe94('0x32')](db[_0xbe94('0x33')][_0xbe94('0x34')],function(_0x17d726){return{'name':_0x17d726[_0xbe94('0x35')],'type':_0x17d726[_0xbe94('0x36')]['key']};});_0x40d39d['model']=_['map'](_0x1f0172,_0xbe94('0x2f'));_0x40d39d['query']=_['keys'](_0x18e282[_0xbe94('0x37')]);_0x40d39d[_0xbe94('0x38')]=_[_0xbe94('0x39')](_0x40d39d[_0xbe94('0x3a')],_0x40d39d[_0xbe94('0x37')]);_0x5e03a6[_0xbe94('0x3b')]=_[_0xbe94('0x39')](_0x40d39d['model'],qs[_0xbe94('0x3c')](_0x18e282[_0xbe94('0x37')][_0xbe94('0x3c')]));_0x5e03a6[_0xbe94('0x3b')]=_0x5e03a6['attributes'][_0xbe94('0x3d')]?_0x5e03a6[_0xbe94('0x3b')]:_0x40d39d[_0xbe94('0x3a')];if(!_0x18e282[_0xbe94('0x37')][_0xbe94('0x3e')](_0xbe94('0x3f'))){_0x5e03a6[_0xbe94('0x22')]=qs[_0xbe94('0x22')](_0x18e282[_0xbe94('0x37')]['limit']);_0x5e03a6[_0xbe94('0x1f')]=qs['offset'](_0x18e282['query']['offset']);}_0x5e03a6[_0xbe94('0x40')]=qs[_0xbe94('0x41')](_0x18e282[_0xbe94('0x37')][_0xbe94('0x41')]);_0x5e03a6['where']=qs[_0xbe94('0x38')](_[_0xbe94('0x42')](_0x18e282[_0xbe94('0x37')],_0x40d39d[_0xbe94('0x38')]),_0x1f0172);if(_0x18e282[_0xbe94('0x37')][_0xbe94('0x43')]){_0x5e03a6[_0xbe94('0x44')]=_['merge'](_0x5e03a6['where'],{'$or':_[_0xbe94('0x32')](_0x1f0172,function(_0x2b6a84){if(_0x2b6a84[_0xbe94('0x36')]!==_0xbe94('0x45')){var _0x8f4848={};_0x8f4848[_0x2b6a84['name']]={'$like':'%'+_0x18e282[_0xbe94('0x37')][_0xbe94('0x43')]+'%'};return _0x8f4848;}})});}_0x5e03a6=_[_0xbe94('0x46')]({},_0x5e03a6,_0x18e282[_0xbe94('0x47')]);var _0x2d9b1e={'where':_0x5e03a6[_0xbe94('0x44')]};return db[_0xbe94('0x33')]['count'](_0x2d9b1e)['then'](function(_0x5d0e3c){_0x5c3ad1['count']=_0x5d0e3c;if(_0x18e282['query']['includeAll']){_0x5e03a6['include']=[{'all':!![]}];}return db[_0xbe94('0x33')]['findAll'](_0x5e03a6);})[_0xbe94('0x2a')](function(_0xce1fa0){_0x5c3ad1[_0xbe94('0x48')]=_0xce1fa0;return _0x5c3ad1;})['then'](respondWithFilteredResult(_0x3ef849,_0x5e03a6))[_0xbe94('0x49')](handleError(_0x3ef849,null));};exports[_0xbe94('0x4a')]=function(_0x52f209,_0x36e189){var _0x27272f={'raw':![],'where':{'id':_0x52f209[_0xbe94('0x4b')]['id']}},_0x1bf261={};_0x1bf261[_0xbe94('0x3a')]=_[_0xbe94('0x4c')](db[_0xbe94('0x33')][_0xbe94('0x34')]);_0x1bf261['query']=_[_0xbe94('0x4c')](_0x52f209['query']);_0x1bf261[_0xbe94('0x38')]=_[_0xbe94('0x39')](_0x1bf261[_0xbe94('0x3a')],_0x1bf261[_0xbe94('0x37')]);_0x27272f[_0xbe94('0x3b')]=_[_0xbe94('0x39')](_0x1bf261[_0xbe94('0x3a')],qs[_0xbe94('0x3c')](_0x52f209[_0xbe94('0x37')][_0xbe94('0x3c')]));_0x27272f[_0xbe94('0x3b')]=_0x27272f[_0xbe94('0x3b')][_0xbe94('0x3d')]?_0x27272f[_0xbe94('0x3b')]:_0x1bf261[_0xbe94('0x3a')];if(_0x52f209[_0xbe94('0x37')][_0xbe94('0x4d')]){_0x27272f['include']=[{'all':!![]}];}_0x27272f=_[_0xbe94('0x46')]({},_0x27272f,_0x52f209[_0xbe94('0x47')]);return db[_0xbe94('0x33')]['find'](_0x27272f)[_0xbe94('0x2a')](handleEntityNotFound(_0x36e189,null))[_0xbe94('0x2a')](respondWithResult(_0x36e189,null))[_0xbe94('0x49')](handleError(_0x36e189,null));};exports[_0xbe94('0x4e')]=function(_0x1f1fcd,_0x3cb56a){return db['VoiceQueueReport'][_0xbe94('0x4e')](_0x1f1fcd[_0xbe94('0x4f')],{})['then'](respondWithResult(_0x3cb56a,0xc9))[_0xbe94('0x49')](handleError(_0x3cb56a,null));};exports[_0xbe94('0x29')]=function(_0x4ab277,_0x5851d8){if(_0x4ab277[_0xbe94('0x4f')]['id']){delete _0x4ab277[_0xbe94('0x4f')]['id'];}return db[_0xbe94('0x33')][_0xbe94('0x50')]({'where':{'id':_0x4ab277[_0xbe94('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5851d8,null))['then'](saveUpdates(_0x4ab277[_0xbe94('0x4f')],null))[_0xbe94('0x2a')](respondWithResult(_0x5851d8,null))[_0xbe94('0x49')](handleError(_0x5851d8,null));};exports[_0xbe94('0x2b')]=function(_0xdec247,_0x30aa8d){return db[_0xbe94('0x33')]['find']({'where':{'id':_0xdec247[_0xbe94('0x4b')]['id']}})[_0xbe94('0x2a')](handleEntityNotFound(_0x30aa8d,null))[_0xbe94('0x2a')](removeEntity(_0x30aa8d,null))[_0xbe94('0x49')](handleError(_0x30aa8d,null));};exports[_0xbe94('0x51')]=function(_0x52f587,_0x3bde9d){return db[_0xbe94('0x33')][_0xbe94('0x51')]()['then'](respondWithResult(_0x3bde9d,null))[_0xbe94('0x49')](handleError(_0x3bde9d,null));};exports['getVoiceQueuesReport']=function(_0x513ac7,_0x9f64fb){var _0x43225f={},_0xe9122c={},_0x823d40={'count':0x0,'rows':[]};_0xe9122c[_0xbe94('0x3a')]=_[_0xbe94('0x4c')](db[_0xbe94('0x33')]['rawAttributes']);_0xe9122c[_0xbe94('0x37')]=_['keys'](_0x513ac7[_0xbe94('0x37')]);_0xe9122c['filters']=_['intersection'](_0xe9122c[_0xbe94('0x3a')],_0xe9122c['query']);_0x43225f[_0xbe94('0x3b')]=_[_0xbe94('0x39')](_0xe9122c[_0xbe94('0x3a')],qs[_0xbe94('0x3c')](_0x513ac7['query'][_0xbe94('0x3c')]));_0x43225f[_0xbe94('0x3b')]=_0x43225f[_0xbe94('0x3b')]['length']?_0x43225f[_0xbe94('0x3b')]:_0xe9122c['model'];if(!_0x513ac7[_0xbe94('0x37')][_0xbe94('0x3e')](_0xbe94('0x3f'))){_0x43225f['limit']=qs[_0xbe94('0x22')](_0x513ac7[_0xbe94('0x37')][_0xbe94('0x22')]);_0x43225f[_0xbe94('0x1f')]=qs[_0xbe94('0x1f')](_0x513ac7[_0xbe94('0x37')]['offset']);}_0x43225f[_0xbe94('0x40')]=qs[_0xbe94('0x41')](_0x513ac7[_0xbe94('0x37')][_0xbe94('0x41')]);_0x43225f[_0xbe94('0x44')]=qs[_0xbe94('0x38')](_[_0xbe94('0x42')](_0x513ac7[_0xbe94('0x37')],_0xe9122c[_0xbe94('0x38')]));if(_0x513ac7['query'][_0xbe94('0x43')]){_0x43225f['where']=_['merge'](_0x43225f[_0xbe94('0x44')],{'$or':_['map'](_0x43225f[_0xbe94('0x3b')],function(_0x1bf45a){var _0x5b4256={};_0x5b4256[_0x1bf45a]={'$like':'%'+_0x513ac7['query'][_0xbe94('0x43')]+'%'};return _0x5b4256;})});}_0x43225f=_[_0xbe94('0x46')]({},_0x43225f,_0x513ac7['options']);var _0x40b663={'where':_0x43225f['where']};return db[_0xbe94('0x33')][_0xbe94('0x21')](_0x40b663)[_0xbe94('0x2a')](function(_0x3c1a16){_0x823d40[_0xbe94('0x21')]=_0x3c1a16;if(_0x513ac7[_0xbe94('0x37')]['includeAll']){_0x43225f[_0xbe94('0x52')]=[{'all':!![]}];}return db[_0xbe94('0x33')][_0xbe94('0x53')](_0x43225f);})['then'](function(_0x36aa5b){_0x823d40[_0xbe94('0x48')]=_0x36aa5b;return _0x823d40;})['then'](respondWithFilteredResult(_0x9f64fb,_0x43225f,_0xbe94('0x54')))[_0xbe94('0x49')](handleError(_0x9f64fb,null,'getVoiceQueuesReport'));};
\ No newline at end of file
+var _0xa3aa=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','name','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','catch','show','includeAll','find','create','body','params','destroy','describe','getVoiceQueuesReport','rows','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','status','json'];(function(_0x254d9f,_0x54ddb5){var _0x1eedb9=function(_0x2d05f1){while(--_0x2d05f1){_0x254d9f['push'](_0x254d9f['shift']());}};_0x1eedb9(++_0x54ddb5);}(_0xa3aa,0x1cc));var _0xaa3a=function(_0x220de9,_0x35a959){_0x220de9=_0x220de9-0x0;var _0xe38a42=_0xa3aa[_0x220de9];return _0xe38a42;};'use strict';var emlformat=require(_0xaa3a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaa3a('0x1'));var rp=require('request-promise');var moment=require(_0xaa3a('0x2'));var BPromise=require(_0xaa3a('0x3'));var Mustache=require(_0xaa3a('0x4'));var util=require(_0xaa3a('0x5'));var path=require(_0xaa3a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaa3a('0x7'));var fs=require('fs');var fs_extra=require(_0xaa3a('0x8'));var _=require(_0xaa3a('0x9'));var squel=require(_0xaa3a('0xa'));var crypto=require('crypto');var jsforce=require(_0xaa3a('0xb'));var deskjs=require(_0xaa3a('0xc'));var toCsv=require(_0xaa3a('0xd'));var querystring=require(_0xaa3a('0xe'));var Papa=require(_0xaa3a('0xf'));var Redis=require(_0xaa3a('0x10'));var authService=require(_0xaa3a('0x11'));var qs=require(_0xaa3a('0x12'));var as=require(_0xaa3a('0x13'));var hardwareService=require(_0xaa3a('0x14'));var logger=require(_0xaa3a('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xaa3a('0x16'));var licenseUtil=require(_0xaa3a('0x17'));var db=require(_0xaa3a('0x18'))['db'];config['redis']=_[_0xaa3a('0x19')](config[_0xaa3a('0x1a')],{'host':_0xaa3a('0x1b'),'port':0x18eb});var socket=require(_0xaa3a('0x1c'))(new Redis(config[_0xaa3a('0x1a')]));require('./voiceQueueReport.socket')[_0xaa3a('0x1d')](socket);function respondWithStatusCode(_0x2fecb1,_0x3f942f){_0x3f942f=_0x3f942f||0xcc;return function(_0x2f0c0a){if(_0x2f0c0a){return _0x2fecb1['sendStatus'](_0x3f942f);}return _0x2fecb1[_0xaa3a('0x1e')](_0x3f942f)['end']();};}function respondWithResult(_0x37aafd,_0x32b95c){_0x32b95c=_0x32b95c||0xc8;return function(_0x3a38de){if(_0x3a38de){return _0x37aafd['status'](_0x32b95c)[_0xaa3a('0x1f')](_0x3a38de);}};}function respondWithFilteredResult(_0x2694cb,_0x37396b){return function(_0x163428){if(_0x163428){var _0x22b9d1=typeof _0x37396b[_0xaa3a('0x20')]===_0xaa3a('0x21')&&typeof _0x37396b[_0xaa3a('0x22')]==='undefined';var _0x368c2a=_0x163428[_0xaa3a('0x23')];var _0x594847=_0x22b9d1?0x0:_0x37396b['offset'];var _0x3ee322=_0x22b9d1?_0x163428[_0xaa3a('0x23')]:_0x37396b[_0xaa3a('0x20')]+_0x37396b['limit'];var _0x1e6c27;if(_0x3ee322>=_0x368c2a){_0x3ee322=_0x368c2a;_0x1e6c27=0xc8;}else{_0x1e6c27=0xce;}_0x2694cb[_0xaa3a('0x1e')](_0x1e6c27);return _0x2694cb[_0xaa3a('0x24')](_0xaa3a('0x25'),_0x594847+'-'+_0x3ee322+'/'+_0x368c2a)[_0xaa3a('0x1f')](_0x163428);}return null;};}function patchUpdates(_0x163075){return function(_0x977f6c){try{jsonpatch[_0xaa3a('0x26')](_0x977f6c,_0x163075,!![]);}catch(_0x37a661){return BPromise[_0xaa3a('0x27')](_0x37a661);}return _0x977f6c[_0xaa3a('0x28')]();};}function saveUpdates(_0x55a60b,_0x20bf45){return function(_0x4ae3a1){if(_0x4ae3a1){return _0x4ae3a1[_0xaa3a('0x29')](_0x55a60b)['then'](function(_0x165e68){return _0x165e68;});}return null;};}function removeEntity(_0x2f99e3,_0x11710f){return function(_0x3a6b2a){if(_0x3a6b2a){return _0x3a6b2a['destroy']()[_0xaa3a('0x2a')](function(){_0x2f99e3[_0xaa3a('0x1e')](0xcc)[_0xaa3a('0x2b')]();});}};}function handleEntityNotFound(_0xaa862c,_0x56e3fb){return function(_0x1c2c31){if(!_0x1c2c31){_0xaa862c[_0xaa3a('0x2c')](0x194);}return _0x1c2c31;};}function handleError(_0x3f59fc,_0x53d5a0){_0x53d5a0=_0x53d5a0||0x1f4;return function(_0x565e22){logger[_0xaa3a('0x2d')](_0x565e22[_0xaa3a('0x2e')]);if(_0x565e22[_0xaa3a('0x2f')]){delete _0x565e22[_0xaa3a('0x2f')];}_0x3f59fc['status'](_0x53d5a0)['send'](_0x565e22);};}exports['index']=function(_0x2192d8,_0x1838ef){var _0x3893a6={},_0x421118={},_0x3a7755={'count':0x0,'rows':[]};var _0xb601f3=_[_0xaa3a('0x30')](db[_0xaa3a('0x31')][_0xaa3a('0x32')],function(_0x566396){return{'name':_0x566396[_0xaa3a('0x33')],'type':_0x566396['type'][_0xaa3a('0x34')]};});_0x421118[_0xaa3a('0x35')]=_[_0xaa3a('0x30')](_0xb601f3,'name');_0x421118[_0xaa3a('0x36')]=_[_0xaa3a('0x37')](_0x2192d8[_0xaa3a('0x36')]);_0x421118[_0xaa3a('0x38')]=_['intersection'](_0x421118[_0xaa3a('0x35')],_0x421118['query']);_0x3893a6[_0xaa3a('0x39')]=_[_0xaa3a('0x3a')](_0x421118['model'],qs[_0xaa3a('0x3b')](_0x2192d8['query'][_0xaa3a('0x3b')]));_0x3893a6[_0xaa3a('0x39')]=_0x3893a6[_0xaa3a('0x39')][_0xaa3a('0x3c')]?_0x3893a6['attributes']:_0x421118[_0xaa3a('0x35')];if(!_0x2192d8[_0xaa3a('0x36')][_0xaa3a('0x3d')]('nolimit')){_0x3893a6[_0xaa3a('0x22')]=qs[_0xaa3a('0x22')](_0x2192d8[_0xaa3a('0x36')][_0xaa3a('0x22')]);_0x3893a6[_0xaa3a('0x20')]=qs['offset'](_0x2192d8['query'][_0xaa3a('0x20')]);}_0x3893a6[_0xaa3a('0x3e')]=qs[_0xaa3a('0x3f')](_0x2192d8[_0xaa3a('0x36')]['sort']);_0x3893a6[_0xaa3a('0x40')]=qs['filters'](_[_0xaa3a('0x41')](_0x2192d8[_0xaa3a('0x36')],_0x421118[_0xaa3a('0x38')]),_0xb601f3);if(_0x2192d8[_0xaa3a('0x36')][_0xaa3a('0x42')]){_0x3893a6[_0xaa3a('0x40')]=_[_0xaa3a('0x43')](_0x3893a6[_0xaa3a('0x40')],{'$or':_[_0xaa3a('0x30')](_0xb601f3,function(_0x320e17){if(_0x320e17['type']!=='VIRTUAL'){var _0x32508f={};_0x32508f[_0x320e17[_0xaa3a('0x2f')]]={'$like':'%'+_0x2192d8[_0xaa3a('0x36')][_0xaa3a('0x42')]+'%'};return _0x32508f;}})});}_0x3893a6=_[_0xaa3a('0x43')]({},_0x3893a6,_0x2192d8[_0xaa3a('0x44')]);var _0x4fd716={'where':_0x3893a6[_0xaa3a('0x40')]};return db[_0xaa3a('0x31')][_0xaa3a('0x23')](_0x4fd716)[_0xaa3a('0x2a')](function(_0x4cdfb2){_0x3a7755['count']=_0x4cdfb2;if(_0x2192d8['query']['includeAll']){_0x3893a6[_0xaa3a('0x45')]=[{'all':!![]}];}return db[_0xaa3a('0x31')][_0xaa3a('0x46')](_0x3893a6);})[_0xaa3a('0x2a')](function(_0x8f6a7d){_0x3a7755['rows']=_0x8f6a7d;return _0x3a7755;})[_0xaa3a('0x2a')](respondWithFilteredResult(_0x1838ef,_0x3893a6))[_0xaa3a('0x47')](handleError(_0x1838ef,null));};exports[_0xaa3a('0x48')]=function(_0x5a530b,_0x5abec8){var _0x192460={'raw':![],'where':{'id':_0x5a530b['params']['id']}},_0x16c860={};_0x16c860[_0xaa3a('0x35')]=_[_0xaa3a('0x37')](db[_0xaa3a('0x31')][_0xaa3a('0x32')]);_0x16c860['query']=_[_0xaa3a('0x37')](_0x5a530b[_0xaa3a('0x36')]);_0x16c860[_0xaa3a('0x38')]=_[_0xaa3a('0x3a')](_0x16c860['model'],_0x16c860[_0xaa3a('0x36')]);_0x192460[_0xaa3a('0x39')]=_['intersection'](_0x16c860[_0xaa3a('0x35')],qs[_0xaa3a('0x3b')](_0x5a530b[_0xaa3a('0x36')][_0xaa3a('0x3b')]));_0x192460[_0xaa3a('0x39')]=_0x192460['attributes']['length']?_0x192460[_0xaa3a('0x39')]:_0x16c860['model'];if(_0x5a530b[_0xaa3a('0x36')][_0xaa3a('0x49')]){_0x192460[_0xaa3a('0x45')]=[{'all':!![]}];}_0x192460=_[_0xaa3a('0x43')]({},_0x192460,_0x5a530b['options']);return db['VoiceQueueReport'][_0xaa3a('0x4a')](_0x192460)['then'](handleEntityNotFound(_0x5abec8,null))['then'](respondWithResult(_0x5abec8,null))[_0xaa3a('0x47')](handleError(_0x5abec8,null));};exports[_0xaa3a('0x4b')]=function(_0x1efcbf,_0x5d0cb6){return db[_0xaa3a('0x31')][_0xaa3a('0x4b')](_0x1efcbf[_0xaa3a('0x4c')],{})[_0xaa3a('0x2a')](respondWithResult(_0x5d0cb6,0xc9))['catch'](handleError(_0x5d0cb6,null));};exports[_0xaa3a('0x29')]=function(_0x3a3f67,_0x575104){if(_0x3a3f67[_0xaa3a('0x4c')]['id']){delete _0x3a3f67['body']['id'];}return db[_0xaa3a('0x31')][_0xaa3a('0x4a')]({'where':{'id':_0x3a3f67[_0xaa3a('0x4d')]['id']}})['then'](handleEntityNotFound(_0x575104,null))[_0xaa3a('0x2a')](saveUpdates(_0x3a3f67[_0xaa3a('0x4c')],null))[_0xaa3a('0x2a')](respondWithResult(_0x575104,null))[_0xaa3a('0x47')](handleError(_0x575104,null));};exports[_0xaa3a('0x4e')]=function(_0x5cc759,_0x23cac6){return db[_0xaa3a('0x31')][_0xaa3a('0x4a')]({'where':{'id':_0x5cc759[_0xaa3a('0x4d')]['id']}})[_0xaa3a('0x2a')](handleEntityNotFound(_0x23cac6,null))[_0xaa3a('0x2a')](removeEntity(_0x23cac6,null))[_0xaa3a('0x47')](handleError(_0x23cac6,null));};exports[_0xaa3a('0x4f')]=function(_0x33c7cf,_0xee3386){return db[_0xaa3a('0x31')]['describe']()['then'](respondWithResult(_0xee3386,null))[_0xaa3a('0x47')](handleError(_0xee3386,null));};exports[_0xaa3a('0x50')]=function(_0x5db568,_0x2cdbf6){var _0x5ce7bd={},_0x32242a={},_0x4ec499={'count':0x0,'rows':[]};_0x32242a[_0xaa3a('0x35')]=_[_0xaa3a('0x37')](db[_0xaa3a('0x31')][_0xaa3a('0x32')]);_0x32242a['query']=_[_0xaa3a('0x37')](_0x5db568[_0xaa3a('0x36')]);_0x32242a['filters']=_['intersection'](_0x32242a[_0xaa3a('0x35')],_0x32242a[_0xaa3a('0x36')]);_0x5ce7bd['attributes']=_[_0xaa3a('0x3a')](_0x32242a[_0xaa3a('0x35')],qs[_0xaa3a('0x3b')](_0x5db568[_0xaa3a('0x36')][_0xaa3a('0x3b')]));_0x5ce7bd[_0xaa3a('0x39')]=_0x5ce7bd[_0xaa3a('0x39')]['length']?_0x5ce7bd['attributes']:_0x32242a[_0xaa3a('0x35')];if(!_0x5db568['query'][_0xaa3a('0x3d')]('nolimit')){_0x5ce7bd[_0xaa3a('0x22')]=qs['limit'](_0x5db568[_0xaa3a('0x36')][_0xaa3a('0x22')]);_0x5ce7bd[_0xaa3a('0x20')]=qs['offset'](_0x5db568['query'][_0xaa3a('0x20')]);}_0x5ce7bd[_0xaa3a('0x3e')]=qs[_0xaa3a('0x3f')](_0x5db568[_0xaa3a('0x36')][_0xaa3a('0x3f')]);_0x5ce7bd[_0xaa3a('0x40')]=qs['filters'](_[_0xaa3a('0x41')](_0x5db568[_0xaa3a('0x36')],_0x32242a[_0xaa3a('0x38')]));if(_0x5db568['query']['filter']){_0x5ce7bd[_0xaa3a('0x40')]=_[_0xaa3a('0x43')](_0x5ce7bd[_0xaa3a('0x40')],{'$or':_[_0xaa3a('0x30')](_0x5ce7bd[_0xaa3a('0x39')],function(_0x427a04){var _0x3b7af0={};_0x3b7af0[_0x427a04]={'$like':'%'+_0x5db568[_0xaa3a('0x36')][_0xaa3a('0x42')]+'%'};return _0x3b7af0;})});}_0x5ce7bd=_[_0xaa3a('0x43')]({},_0x5ce7bd,_0x5db568['options']);var _0x212443={'where':_0x5ce7bd['where']};return db[_0xaa3a('0x31')]['count'](_0x212443)[_0xaa3a('0x2a')](function(_0x216444){_0x4ec499['count']=_0x216444;if(_0x5db568['query'][_0xaa3a('0x49')]){_0x5ce7bd[_0xaa3a('0x45')]=[{'all':!![]}];}return db[_0xaa3a('0x31')][_0xaa3a('0x46')](_0x5ce7bd);})[_0xaa3a('0x2a')](function(_0x23d36c){_0x4ec499[_0xaa3a('0x51')]=_0x23d36c;return _0x4ec499;})['then'](respondWithFilteredResult(_0x2cdbf6,_0x5ce7bd,_0xaa3a('0x50')))['catch'](handleError(_0x2cdbf6,null,_0xaa3a('0x50')));};
\ No newline at end of file
index 84b0fa9..0221a9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18a6=['hook','exports','VoiceQueueReport','save','update','remove','hasOwnProperty'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x18a6,0xbf));var _0x618a=function(_0x357c8d,_0x394e52){_0x357c8d=_0x357c8d-0x0;var _0x2645f0=_0x18a6[_0x357c8d];return _0x2645f0;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x618a('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x618a('0x1'),'afterUpdate':_0x618a('0x2'),'afterDestroy':_0x618a('0x3')};function emitEvent(_0x4fc29f){return function(_0x19866e,_0x338dc6,_0x21cf84){VoiceQueueReportEvents['emit'](_0x4fc29f+':'+_0x19866e['id'],_0x19866e);VoiceQueueReportEvents['emit'](_0x4fc29f,_0x19866e);_0x21cf84(null);};}for(var e in events){if(events[_0x618a('0x4')](e)){var event=events[e];VoiceQueueReport[_0x618a('0x5')](e,emitEvent(event));}}module[_0x618a('0x6')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xf6b5=['save','update','remove','emit','hook','exports','events','../../mysqldb','setMaxListeners'];(function(_0x44fef1,_0x132cf4){var _0x3c3a04=function(_0x175a90){while(--_0x175a90){_0x44fef1['push'](_0x44fef1['shift']());}};_0x3c3a04(++_0x132cf4);}(_0xf6b5,0x102));var _0x5f6b=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xf6b5[_0x5c351c];return _0x26f3b3;};'use strict';var EventEmitter=require(_0x5f6b('0x0'));var VoiceQueueReport=require(_0x5f6b('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x5f6b('0x2')](0x0);var events={'afterCreate':_0x5f6b('0x3'),'afterUpdate':_0x5f6b('0x4'),'afterDestroy':_0x5f6b('0x5')};function emitEvent(_0x180aaf){return function(_0x1a6403,_0xfff139,_0x5ee4ed){VoiceQueueReportEvents['emit'](_0x180aaf+':'+_0x1a6403['id'],_0x1a6403);VoiceQueueReportEvents[_0x5f6b('0x6')](_0x180aaf,_0x1a6403);_0x5ee4ed(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0x5f6b('0x7')](e,emitEvent(event));}}module[_0x5f6b('0x8')]=VoiceQueueReportEvents;
\ No newline at end of file
index c27bbf4..92bdce0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5cd=['api','request-promise','path','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','calleridnum','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5cd,0x171));var _0xdd5c=function(_0x58501c,_0x4b9ca1){_0x58501c=_0x58501c-0x0;var _0x7bd9a1=_0xd5cd[_0x58501c];return _0x7bd9a1;};'use strict';var _=require(_0xdd5c('0x0'));var util=require(_0xdd5c('0x1'));var logger=require(_0xdd5c('0x2'))(_0xdd5c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdd5c('0x4'));var fs=require('fs');var path=require(_0xdd5c('0x5'));var rimraf=require('rimraf');var config=require(_0xdd5c('0x6'));var attributes=require(_0xdd5c('0x7'));module['exports']=function(_0x217ec7,_0x562e5c){return _0x217ec7[_0xdd5c('0x8')](_0xdd5c('0x9'),attributes,{'tableName':_0xdd5c('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0xdd5c('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5238=['uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird','path','rimraf','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue'];(function(_0x475d32,_0x45102b){var _0x3adbd3=function(_0x466fa8){while(--_0x466fa8){_0x475d32['push'](_0x475d32['shift']());}};_0x3adbd3(++_0x45102b);}(_0x5238,0x198));var _0x8523=function(_0x46e88e,_0x11c813){_0x46e88e=_0x46e88e-0x0;var _0x5f40fd=_0x5238[_0x46e88e];return _0x5f40fd;};'use strict';var _=require('lodash');var util=require(_0x8523('0x0'));var logger=require(_0x8523('0x1'))(_0x8523('0x2'));var moment=require(_0x8523('0x3'));var BPromise=require(_0x8523('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8523('0x5'));var rimraf=require(_0x8523('0x6'));var config=require('../../config/environment');var attributes=require(_0x8523('0x7'));module[_0x8523('0x8')]=function(_0x5ad6de,_0xa9ecb5){return _0x5ad6de[_0x8523('0x9')](_0x8523('0xa'),attributes,{'tableName':_0x8523('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8523('0xc')]},{'fields':[_0x8523('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 2ecb28e..e418478 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x311a=['message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','include','model','attributes','map','VoiceQueueReport','create','body','then','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','limit','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x271195,_0x1ec6a6){var _0x46ac47=function(_0x4288e1){while(--_0x4288e1){_0x271195['push'](_0x271195['shift']());}};_0x46ac47(++_0x1ec6a6);}(_0x311a,0xf5));var _0xa311=function(_0x153162,_0xd7921d){_0x153162=_0x153162-0x0;var _0x2f4492=_0x311a[_0x153162];return _0x2f4492;};'use strict';var _=require(_0xa311('0x0'));var util=require('util');var moment=require(_0xa311('0x1'));var BPromise=require(_0xa311('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa311('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa311('0x4'));var logger=require(_0xa311('0x5'))('rpc');var config=require(_0xa311('0x6'));var jayson=require(_0xa311('0x7'));var client=jayson[_0xa311('0x8')][_0xa311('0x9')]({'port':0x232a});config[_0xa311('0xa')]=_[_0xa311('0xb')](config[_0xa311('0xa')],{'host':_0xa311('0xc'),'port':0x18eb});var socket=require(_0xa311('0xd'))(new Redis(config[_0xa311('0xa')]));require(_0xa311('0xe'))[_0xa311('0xf')](socket);function respondWithRpcPromise(_0x1b7c0a,_0x1ce7e3,_0x4a232f){return new BPromise(function(_0x28104c,_0x2fe0f9){return client[_0xa311('0x10')](_0x1b7c0a,_0x4a232f)['then'](function(_0x58df2c){logger[_0xa311('0x11')](_0xa311('0x12'),_0x1ce7e3,_0xa311('0x13'));logger[_0xa311('0x14')](_0xa311('0x15'),_0x1ce7e3,_0xa311('0x13'),JSON[_0xa311('0x16')](_0x58df2c));if(_0x58df2c[_0xa311('0x17')]){if(_0x58df2c[_0xa311('0x17')][_0xa311('0x18')]===0x1f4){logger[_0xa311('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x1ce7e3,_0x58df2c['error'][_0xa311('0x19')]);return _0x2fe0f9(_0x58df2c[_0xa311('0x17')][_0xa311('0x19')]);}logger[_0xa311('0x17')](_0xa311('0x12'),_0x1ce7e3,_0x58df2c[_0xa311('0x17')][_0xa311('0x19')]);return _0x28104c(_0x58df2c[_0xa311('0x17')][_0xa311('0x19')]);}else{logger['info'](_0xa311('0x12'),_0x1ce7e3,'request\x20sent');_0x28104c(_0x58df2c[_0xa311('0x1a')][_0xa311('0x19')]);}})[_0xa311('0x1b')](function(_0x17ee88){logger[_0xa311('0x17')](_0xa311('0x12'),_0x1ce7e3,_0x17ee88);_0x2fe0f9(_0x17ee88);});});}exports[_0xa311('0x1c')]=function(_0x59f422){var _0x5f4bd6=this;return new Promise(function(_0x4250c5,_0x2bab70){return db['VoiceQueueReport'][_0xa311('0x1d')]({'raw':_0x59f422['options']?_0x59f422[_0xa311('0x1e')][_0xa311('0x1f')]===undefined?!![]:![]:!![],'where':_0x59f422[_0xa311('0x1e')]?_0x59f422['options'][_0xa311('0x20')]||null:null,'attributes':_0x59f422['options']?_0x59f422[_0xa311('0x1e')]['attributes']||null:null,'limit':_0x59f422[_0xa311('0x1e')]?_0x59f422[_0xa311('0x1e')]['limit']||null:null,'include':_0x59f422[_0xa311('0x1e')]?_0x59f422['options'][_0xa311('0x21')]?_['map'](_0x59f422[_0xa311('0x1e')][_0xa311('0x21')],function(_0x3ceff5){return{'model':db[_0x3ceff5[_0xa311('0x22')]],'as':_0x3ceff5['as'],'attributes':_0x3ceff5[_0xa311('0x23')],'include':_0x3ceff5[_0xa311('0x21')]?_[_0xa311('0x24')](_0x3ceff5[_0xa311('0x21')],function(_0x17bc25){return{'model':db[_0x17bc25[_0xa311('0x22')]],'as':_0x17bc25['as'],'attributes':_0x17bc25['attributes'],'include':_0x17bc25['include']?_[_0xa311('0x24')](_0x17bc25['include'],function(_0x3d85bc){return{'model':db[_0x3d85bc[_0xa311('0x22')]],'as':_0x3d85bc['as'],'attributes':_0x3d85bc[_0xa311('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d2899){logger[_0xa311('0x11')](_0xa311('0x1c'),_0x59f422);logger[_0xa311('0x14')]('GetVoiceQueueReport',_0x59f422,JSON[_0xa311('0x16')](_0x5d2899));_0x4250c5(_0x5d2899);})[_0xa311('0x1b')](function(_0x55cb19){logger[_0xa311('0x17')](_0xa311('0x1c'),_0x55cb19['message'],_0x59f422);_0x2bab70(_0x5f4bd6[_0xa311('0x17')](0x1f4,_0x55cb19[_0xa311('0x19')]));});});};exports['CreateVoiceQueueReport']=function(_0xa47ad6){var _0x2e0867=this;return new Promise(function(_0x4c91ae,_0x56bf41){return db[_0xa311('0x25')][_0xa311('0x26')](_0xa47ad6[_0xa311('0x27')],{'raw':_0xa47ad6[_0xa311('0x1e')]?_0xa47ad6[_0xa311('0x1e')][_0xa311('0x1f')]===undefined?!![]:![]:!![]})[_0xa311('0x28')](function(_0x42e731){logger[_0xa311('0x11')](_0xa311('0x29'),_0xa47ad6);logger[_0xa311('0x14')](_0xa311('0x29'),_0xa47ad6,JSON[_0xa311('0x16')](_0x42e731));_0x4c91ae(_0x42e731);})['catch'](function(_0x51beca){logger[_0xa311('0x17')](_0xa311('0x29'),_0x51beca[_0xa311('0x19')],_0xa47ad6);_0x56bf41(_0x2e0867[_0xa311('0x17')](0x1f4,_0x51beca[_0xa311('0x19')]));});});};exports[_0xa311('0x2a')]=function(_0x1dac13){var _0x429f30=this;return new Promise(function(_0xd1efca,_0x37d5dc){return db[_0xa311('0x25')][_0xa311('0x2b')](_0x1dac13[_0xa311('0x27')],{'raw':_0x1dac13[_0xa311('0x1e')]?_0x1dac13[_0xa311('0x1e')][_0xa311('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dac13[_0xa311('0x1e')]?_0x1dac13[_0xa311('0x1e')][_0xa311('0x20')]||null:null,'attributes':_0x1dac13[_0xa311('0x1e')]?_0x1dac13[_0xa311('0x1e')][_0xa311('0x23')]||null:null,'limit':_0x1dac13[_0xa311('0x1e')]?_0x1dac13[_0xa311('0x1e')][_0xa311('0x2c')]||null:null})['then'](function(_0x2cf7c8){logger['info']('UpdateVoiceQueueReport',_0x1dac13);logger['debug'](_0xa311('0x2a'),_0x1dac13,JSON[_0xa311('0x16')](_0x2cf7c8));_0xd1efca(_0x2cf7c8);})[_0xa311('0x1b')](function(_0x1cf649){logger[_0xa311('0x17')](_0xa311('0x2a'),_0x1cf649[_0xa311('0x19')],_0x1dac13);_0x37d5dc(_0x429f30[_0xa311('0x17')](0x1f4,_0x1cf649[_0xa311('0x19')]));});});};
\ No newline at end of file
+var _0xeb0c=['GetVoiceQueueReport','VoiceQueueReport','findAll','options','attributes','limit','include','map','model','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0x2f227c,_0x360c3a){var _0x5032bc=function(_0x824bb){while(--_0x824bb){_0x2f227c['push'](_0x2f227c['shift']());}};_0x5032bc(++_0x360c3a);}(_0xeb0c,0x133));var _0xceb0=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0xeb0c[_0x22f85a];return _0xaa717;};'use strict';var _=require(_0xceb0('0x0'));var util=require(_0xceb0('0x1'));var moment=require(_0xceb0('0x2'));var BPromise=require(_0xceb0('0x3'));var rs=require(_0xceb0('0x4'));var fs=require('fs');var Redis=require(_0xceb0('0x5'));var db=require(_0xceb0('0x6'))['db'];var utils=require(_0xceb0('0x7'));var logger=require(_0xceb0('0x8'))(_0xceb0('0x9'));var config=require(_0xceb0('0xa'));var jayson=require(_0xceb0('0xb'));var client=jayson[_0xceb0('0xc')][_0xceb0('0xd')]({'port':0x232a});config[_0xceb0('0xe')]=_[_0xceb0('0xf')](config[_0xceb0('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xceb0('0x10'))(new Redis(config[_0xceb0('0xe')]));require('./voiceQueueReport.socket')[_0xceb0('0x11')](socket);function respondWithRpcPromise(_0x38f7ae,_0x19036d,_0x2d7de4){return new BPromise(function(_0x3c1821,_0x27f7cc){return client[_0xceb0('0x12')](_0x38f7ae,_0x2d7de4)[_0xceb0('0x13')](function(_0x2a4b18){logger[_0xceb0('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x19036d,_0xceb0('0x15'));logger[_0xceb0('0x16')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x19036d,_0xceb0('0x15'),JSON[_0xceb0('0x17')](_0x2a4b18));if(_0x2a4b18[_0xceb0('0x18')]){if(_0x2a4b18[_0xceb0('0x18')]['code']===0x1f4){logger[_0xceb0('0x18')](_0xceb0('0x19'),_0x19036d,_0x2a4b18['error'][_0xceb0('0x1a')]);return _0x27f7cc(_0x2a4b18[_0xceb0('0x18')][_0xceb0('0x1a')]);}logger[_0xceb0('0x18')](_0xceb0('0x19'),_0x19036d,_0x2a4b18['error'][_0xceb0('0x1a')]);return _0x3c1821(_0x2a4b18[_0xceb0('0x18')]['message']);}else{logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x19036d,_0xceb0('0x15'));_0x3c1821(_0x2a4b18[_0xceb0('0x1b')][_0xceb0('0x1a')]);}})[_0xceb0('0x1c')](function(_0x4e2d83){logger[_0xceb0('0x18')](_0xceb0('0x19'),_0x19036d,_0x4e2d83);_0x27f7cc(_0x4e2d83);});});}exports[_0xceb0('0x1d')]=function(_0x523693){var _0x1860f8=this;return new Promise(function(_0x2b763f,_0x2d9b7a){return db[_0xceb0('0x1e')][_0xceb0('0x1f')]({'raw':_0x523693[_0xceb0('0x20')]?_0x523693['options']['raw']===undefined?!![]:![]:!![],'where':_0x523693['options']?_0x523693[_0xceb0('0x20')]['where']||null:null,'attributes':_0x523693[_0xceb0('0x20')]?_0x523693[_0xceb0('0x20')][_0xceb0('0x21')]||null:null,'limit':_0x523693[_0xceb0('0x20')]?_0x523693[_0xceb0('0x20')][_0xceb0('0x22')]||null:null,'include':_0x523693[_0xceb0('0x20')]?_0x523693[_0xceb0('0x20')][_0xceb0('0x23')]?_[_0xceb0('0x24')](_0x523693[_0xceb0('0x20')][_0xceb0('0x23')],function(_0x54caa5){return{'model':db[_0x54caa5['model']],'as':_0x54caa5['as'],'attributes':_0x54caa5['attributes'],'include':_0x54caa5[_0xceb0('0x23')]?_[_0xceb0('0x24')](_0x54caa5['include'],function(_0x53f803){return{'model':db[_0x53f803[_0xceb0('0x25')]],'as':_0x53f803['as'],'attributes':_0x53f803['attributes'],'include':_0x53f803['include']?_['map'](_0x53f803[_0xceb0('0x23')],function(_0x5475d0){return{'model':db[_0x5475d0[_0xceb0('0x25')]],'as':_0x5475d0['as'],'attributes':_0x5475d0['attributes']};}):[]};}):[]};}):[]:[]})[_0xceb0('0x13')](function(_0x4d62aa){logger[_0xceb0('0x14')]('GetVoiceQueueReport',_0x523693);logger[_0xceb0('0x16')](_0xceb0('0x1d'),_0x523693,JSON['stringify'](_0x4d62aa));_0x2b763f(_0x4d62aa);})[_0xceb0('0x1c')](function(_0x545b3f){logger[_0xceb0('0x18')](_0xceb0('0x1d'),_0x545b3f['message'],_0x523693);_0x2d9b7a(_0x1860f8['error'](0x1f4,_0x545b3f[_0xceb0('0x1a')]));});});};exports[_0xceb0('0x26')]=function(_0x311538){var _0x4fbdf4=this;return new Promise(function(_0x368c2d,_0x2c86c0){return db[_0xceb0('0x1e')][_0xceb0('0x27')](_0x311538['body'],{'raw':_0x311538[_0xceb0('0x20')]?_0x311538[_0xceb0('0x20')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xbe2158){logger['info'](_0xceb0('0x26'),_0x311538);logger['debug']('CreateVoiceQueueReport',_0x311538,JSON[_0xceb0('0x17')](_0xbe2158));_0x368c2d(_0xbe2158);})[_0xceb0('0x1c')](function(_0xe9480f){logger[_0xceb0('0x18')]('CreateVoiceQueueReport',_0xe9480f['message'],_0x311538);_0x2c86c0(_0x4fbdf4[_0xceb0('0x18')](0x1f4,_0xe9480f[_0xceb0('0x1a')]));});});};exports[_0xceb0('0x28')]=function(_0x5d80fd){var _0x266025=this;return new Promise(function(_0x36ccb6,_0x5692cd){return db[_0xceb0('0x1e')]['update'](_0x5d80fd['body'],{'raw':_0x5d80fd[_0xceb0('0x20')]?_0x5d80fd['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d80fd[_0xceb0('0x20')]?_0x5d80fd[_0xceb0('0x20')][_0xceb0('0x29')]||null:null,'attributes':_0x5d80fd[_0xceb0('0x20')]?_0x5d80fd['options']['attributes']||null:null,'limit':_0x5d80fd['options']?_0x5d80fd[_0xceb0('0x20')][_0xceb0('0x22')]||null:null})['then'](function(_0x39b6aa){logger[_0xceb0('0x14')](_0xceb0('0x28'),_0x5d80fd);logger[_0xceb0('0x16')]('UpdateVoiceQueueReport',_0x5d80fd,JSON[_0xceb0('0x17')](_0x39b6aa));_0x36ccb6(_0x39b6aa);})[_0xceb0('0x1c')](function(_0x352572){logger[_0xceb0('0x18')](_0xceb0('0x28'),_0x352572[_0xceb0('0x1a')],_0x5d80fd);_0x5692cd(_0x266025[_0xceb0('0x18')](0x1f4,_0x352572['message']));});});};
\ No newline at end of file
index 2160e11..246be5a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89fe=['remove','update','removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x53ca91,_0x29392a){var _0x425f14=function(_0x23a899){while(--_0x23a899){_0x53ca91['push'](_0x53ca91['shift']());}};_0x425f14(++_0x29392a);}(_0x89fe,0x83));var _0xe89f=function(_0xe18dd3,_0x13a11f){_0xe18dd3=_0xe18dd3-0x0;var _0x132936=_0x89fe[_0xe18dd3];return _0x132936;};'use strict';var VoiceQueueReportEvents=require(_0xe89f('0x0'));var events=[_0xe89f('0x1'),_0xe89f('0x2'),_0xe89f('0x3')];function createListener(_0x5241a6,_0xebfbaa){return function(_0x4445f1){_0xebfbaa['emit'](_0x5241a6,_0x4445f1);};}function removeListener(_0x3d3aa8,_0x3d8b30){return function(){VoiceQueueReportEvents[_0xe89f('0x4')](_0x3d3aa8,_0x3d8b30);};}exports[_0xe89f('0x5')]=function(_0x2e61cf){for(var _0x2d5020=0x0,_0x24358f=events['length'];_0x2d5020<_0x24358f;_0x2d5020++){var _0x4639f0=events[_0x2d5020];var _0x3e9998=createListener(_0xe89f('0x6')+_0x4639f0,_0x2e61cf);VoiceQueueReportEvents['on'](_0x4639f0,_0x3e9998);}};
\ No newline at end of file
+var _0x2159=['save','remove','update','emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x3e8453,_0xfe4800){var _0x52c7e6=function(_0x7ab67c){while(--_0x7ab67c){_0x3e8453['push'](_0x3e8453['shift']());}};_0x52c7e6(++_0xfe4800);}(_0x2159,0x17f));var _0x9215=function(_0x485f35,_0x45a0fc){_0x485f35=_0x485f35-0x0;var _0x2ad118=_0x2159[_0x485f35];return _0x2ad118;};'use strict';var VoiceQueueReportEvents=require(_0x9215('0x0'));var events=[_0x9215('0x1'),_0x9215('0x2'),_0x9215('0x3')];function createListener(_0x4b113a,_0x1474c7){return function(_0x4ca557){_0x1474c7[_0x9215('0x4')](_0x4b113a,_0x4ca557);};}function removeListener(_0x3128f9,_0x202c8d){return function(){VoiceQueueReportEvents[_0x9215('0x5')](_0x3128f9,_0x202c8d);};}exports[_0x9215('0x6')]=function(_0x1fd854){for(var _0x3be70d=0x0,_0x383bb1=events['length'];_0x3be70d<_0x383bb1;_0x3be70d++){var _0x419fb3=events[_0x3be70d];var _0x245ee1=createListener(_0x9215('0x7')+_0x419fb3,_0x1fd854);VoiceQueueReportEvents['on'](_0x419fb3,_0x245ee1);}};
\ No newline at end of file
index c672d64..f562957 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1360=['../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x1360,0xd6));var _0x0136=function(_0x59385f,_0x218c19){_0x59385f=_0x59385f-0x0;var _0x3502df=_0x1360[_0x59385f];return _0x3502df;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0136('0x0'));var timeout=require(_0x0136('0x1'));var express=require(_0x0136('0x2'));var router=express[_0x0136('0x3')]();var fs_extra=require(_0x0136('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0136('0x5'));var config=require(_0x0136('0x6'));var controller=require(_0x0136('0x7'));router[_0x0136('0x8')]('/',auth[_0x0136('0x9')](),controller[_0x0136('0xa')]);router['get']('/:id',auth[_0x0136('0x9')](),controller[_0x0136('0xb')]);router[_0x0136('0xc')]('/',auth[_0x0136('0x9')](),controller[_0x0136('0xd')]);router[_0x0136('0xe')](_0x0136('0xf'),auth[_0x0136('0x9')](),controller[_0x0136('0x10')]);router[_0x0136('0x11')]('/:id',auth[_0x0136('0x9')](),controller[_0x0136('0x12')]);module[_0x0136('0x13')]=router;
\ No newline at end of file
+var _0x9be9=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x215d9f,_0x43476e){var _0x293ece=function(_0x1e2764){while(--_0x1e2764){_0x215d9f['push'](_0x215d9f['shift']());}};_0x293ece(++_0x43476e);}(_0x9be9,0x98));var _0x99be=function(_0xedff86,_0x3faa57){_0xedff86=_0xedff86-0x0;var _0x1b1efc=_0x9be9[_0xedff86];return _0x1b1efc;};'use strict';var multer=require(_0x99be('0x0'));var util=require(_0x99be('0x1'));var path=require(_0x99be('0x2'));var timeout=require(_0x99be('0x3'));var express=require(_0x99be('0x4'));var router=express[_0x99be('0x5')]();var fs_extra=require(_0x99be('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x99be('0x7'));var config=require('../../config/environment');var controller=require(_0x99be('0x8'));router['get']('/',auth[_0x99be('0x9')](),controller[_0x99be('0xa')]);router[_0x99be('0xb')](_0x99be('0xc'),auth[_0x99be('0x9')](),controller[_0x99be('0xd')]);router[_0x99be('0xe')]('/',auth[_0x99be('0x9')](),controller[_0x99be('0xf')]);router[_0x99be('0x10')](_0x99be('0xc'),auth[_0x99be('0x9')](),controller[_0x99be('0x11')]);router[_0x99be('0x12')](_0x99be('0xc'),auth[_0x99be('0x9')](),controller[_0x99be('0x13')]);module[_0x99be('0x14')]=router;
\ No newline at end of file
index 8282def..d22a1ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3a1=['DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x1a14c6,_0x12077f){var _0x4cffaa=function(_0x93f6c6){while(--_0x93f6c6){_0x1a14c6['push'](_0x1a14c6['shift']());}};_0x4cffaa(++_0x12077f);}(_0xc3a1,0x8c));var _0x1c3a=function(_0x5ed70c,_0x47c6fa){_0x5ed70c=_0x5ed70c-0x0;var _0x35c6d8=_0xc3a1[_0x5ed70c];return _0x35c6d8;};'use strict';var Sequelize=require(_0x1c3a('0x0'));var moment=require(_0x1c3a('0x1'));module[_0x1c3a('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x1c3a('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x1c3a('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x1c3a('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x1c3a('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x1c3a('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x1c3a('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x1c3a('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x1c3a('0x4')],'allowNull':![],'defaultValue':moment()['format'](_0x1c3a('0x5'))}};
\ No newline at end of file
+var _0x4b31=['DATE','format','sequelize','moment','exports','STRING'];(function(_0x4300d4,_0x46689c){var _0x1c06ae=function(_0xcdbf7){while(--_0xcdbf7){_0x4300d4['push'](_0x4300d4['shift']());}};_0x1c06ae(++_0x46689c);}(_0x4b31,0x1c4));var _0x14b3=function(_0x12c34e,_0x39287a){_0x12c34e=_0x12c34e-0x0;var _0x244e88=_0x4b31[_0x12c34e];return _0x244e88;};'use strict';var Sequelize=require(_0x14b3('0x0'));var moment=require(_0x14b3('0x1'));module[_0x14b3('0x2')]={'time':{'type':Sequelize[_0x14b3('0x3')]},'callid':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x14b3('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x14b3('0x4')],'allowNull':![],'defaultValue':moment()[_0x14b3('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
index c2d9dc8..203fefb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bfc=['intersection','fields','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','VoiceQueuesLog','fieldName','key','map','keys','query','filters','model','attributes'];(function(_0x36fd90,_0xad7b2a){var _0x40c7e8=function(_0x497200){while(--_0x497200){_0x36fd90['push'](_0x36fd90['shift']());}};_0x40c7e8(++_0xad7b2a);}(_0x4bfc,0x185));var _0xc4bf=function(_0x4eca55,_0x18c5dd){_0x4eca55=_0x4eca55-0x0;var _0x56771f=_0x4bfc[_0x4eca55];return _0x56771f;};'use strict';var emlformat=require(_0xc4bf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4bf('0x1'));var jsonpatch=require(_0xc4bf('0x2'));var rp=require(_0xc4bf('0x3'));var moment=require('moment');var BPromise=require(_0xc4bf('0x4'));var Mustache=require(_0xc4bf('0x5'));var util=require('util');var path=require(_0xc4bf('0x6'));var sox=require(_0xc4bf('0x7'));var csv=require('to-csv');var ejs=require(_0xc4bf('0x8'));var fs=require('fs');var fs_extra=require(_0xc4bf('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc4bf('0xa'));var jsforce=require(_0xc4bf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc4bf('0xc'));var querystring=require(_0xc4bf('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc4bf('0xe'));var qs=require(_0xc4bf('0xf'));var as=require(_0xc4bf('0x10'));var hardwareService=require(_0xc4bf('0x11'));var logger=require(_0xc4bf('0x12'))(_0xc4bf('0x13'));var utils=require(_0xc4bf('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc4bf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xcd5428,_0x2e5086){_0x2e5086=_0x2e5086||0xcc;return function(_0xb20db0){if(_0xb20db0){return _0xcd5428['sendStatus'](_0x2e5086);}return _0xcd5428[_0xc4bf('0x16')](_0x2e5086)[_0xc4bf('0x17')]();};}function respondWithResult(_0x7be40c,_0x4ac488){_0x4ac488=_0x4ac488||0xc8;return function(_0x1c03f0){if(_0x1c03f0){return _0x7be40c[_0xc4bf('0x16')](_0x4ac488)[_0xc4bf('0x18')](_0x1c03f0);}};}function respondWithFilteredResult(_0x291d2d,_0x34ecb1){return function(_0x31f6bc){if(_0x31f6bc){var _0x3d43fd=typeof _0x34ecb1[_0xc4bf('0x19')]===_0xc4bf('0x1a')&&typeof _0x34ecb1['limit']==='undefined';var _0x1f6e91=_0x31f6bc[_0xc4bf('0x1b')];var _0x53760a=_0x3d43fd?0x0:_0x34ecb1[_0xc4bf('0x19')];var _0x2b35a3=_0x3d43fd?_0x31f6bc['count']:_0x34ecb1['offset']+_0x34ecb1['limit'];var _0x2bc05b;if(_0x2b35a3>=_0x1f6e91){_0x2b35a3=_0x1f6e91;_0x2bc05b=0xc8;}else{_0x2bc05b=0xce;}_0x291d2d[_0xc4bf('0x16')](_0x2bc05b);return _0x291d2d[_0xc4bf('0x1c')](_0xc4bf('0x1d'),_0x53760a+'-'+_0x2b35a3+'/'+_0x1f6e91)['json'](_0x31f6bc);}return null;};}function patchUpdates(_0x3be1af){return function(_0x599ae3){try{jsonpatch[_0xc4bf('0x1e')](_0x599ae3,_0x3be1af,!![]);}catch(_0x49377a){return BPromise[_0xc4bf('0x1f')](_0x49377a);}return _0x599ae3['save']();};}function saveUpdates(_0x47f8bd,_0x23f5c1){return function(_0x5a6f14){if(_0x5a6f14){return _0x5a6f14[_0xc4bf('0x20')](_0x47f8bd)[_0xc4bf('0x21')](function(_0x1bc954){return _0x1bc954;});}return null;};}function removeEntity(_0x55fdab,_0x1bded5){return function(_0x3a2e01){if(_0x3a2e01){return _0x3a2e01[_0xc4bf('0x22')]()[_0xc4bf('0x21')](function(){_0x55fdab[_0xc4bf('0x16')](0xcc)[_0xc4bf('0x17')]();});}};}function handleEntityNotFound(_0x3274a2,_0x4e8c03){return function(_0x2e5a7d){if(!_0x2e5a7d){_0x3274a2[_0xc4bf('0x23')](0x194);}return _0x2e5a7d;};}function handleError(_0x50ceed,_0x5dab90){_0x5dab90=_0x5dab90||0x1f4;return function(_0x880243){logger['error'](_0x880243[_0xc4bf('0x24')]);if(_0x880243['name']){delete _0x880243[_0xc4bf('0x25')];}_0x50ceed[_0xc4bf('0x16')](_0x5dab90)[_0xc4bf('0x26')](_0x880243);};}exports[_0xc4bf('0x27')]=function(_0x5d17c6,_0x32fb79){var _0x356a67={},_0x17a1ea={},_0x15475a={'count':0x0,'rows':[]};var _0x5638ac=_['map'](db[_0xc4bf('0x28')]['rawAttributes'],function(_0x44f34a){return{'name':_0x44f34a[_0xc4bf('0x29')],'type':_0x44f34a['type'][_0xc4bf('0x2a')]};});_0x17a1ea['model']=_[_0xc4bf('0x2b')](_0x5638ac,_0xc4bf('0x25'));_0x17a1ea['query']=_[_0xc4bf('0x2c')](_0x5d17c6[_0xc4bf('0x2d')]);_0x17a1ea[_0xc4bf('0x2e')]=_['intersection'](_0x17a1ea[_0xc4bf('0x2f')],_0x17a1ea[_0xc4bf('0x2d')]);_0x356a67[_0xc4bf('0x30')]=_[_0xc4bf('0x31')](_0x17a1ea[_0xc4bf('0x2f')],qs['fields'](_0x5d17c6[_0xc4bf('0x2d')][_0xc4bf('0x32')]));_0x356a67[_0xc4bf('0x30')]=_0x356a67[_0xc4bf('0x30')]['length']?_0x356a67['attributes']:_0x17a1ea[_0xc4bf('0x2f')];if(!_0x5d17c6[_0xc4bf('0x2d')][_0xc4bf('0x33')]('nolimit')){_0x356a67['limit']=qs[_0xc4bf('0x34')](_0x5d17c6[_0xc4bf('0x2d')][_0xc4bf('0x34')]);_0x356a67[_0xc4bf('0x19')]=qs[_0xc4bf('0x19')](_0x5d17c6['query'][_0xc4bf('0x19')]);}_0x356a67[_0xc4bf('0x35')]=qs[_0xc4bf('0x36')](_0x5d17c6[_0xc4bf('0x2d')][_0xc4bf('0x36')]);_0x356a67[_0xc4bf('0x37')]=qs[_0xc4bf('0x2e')](_[_0xc4bf('0x38')](_0x5d17c6['query'],_0x17a1ea[_0xc4bf('0x2e')]),_0x5638ac);if(_0x5d17c6['query'][_0xc4bf('0x39')]){_0x356a67[_0xc4bf('0x37')]=_[_0xc4bf('0x3a')](_0x356a67[_0xc4bf('0x37')],{'$or':_['map'](_0x5638ac,function(_0x1e5d0d){if(_0x1e5d0d['type']!==_0xc4bf('0x3b')){var _0xfeadec={};_0xfeadec[_0x1e5d0d[_0xc4bf('0x25')]]={'$like':'%'+_0x5d17c6['query'][_0xc4bf('0x39')]+'%'};return _0xfeadec;}})});}_0x356a67=_[_0xc4bf('0x3a')]({},_0x356a67,_0x5d17c6[_0xc4bf('0x3c')]);var _0x536003={'where':_0x356a67[_0xc4bf('0x37')]};return db[_0xc4bf('0x28')][_0xc4bf('0x1b')](_0x536003)['then'](function(_0x2555b1){_0x15475a[_0xc4bf('0x1b')]=_0x2555b1;if(_0x5d17c6[_0xc4bf('0x2d')][_0xc4bf('0x3d')]){_0x356a67[_0xc4bf('0x3e')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xc4bf('0x3f')](_0x356a67);})[_0xc4bf('0x21')](function(_0x9154fe){_0x15475a[_0xc4bf('0x40')]=_0x9154fe;return _0x15475a;})['then'](respondWithFilteredResult(_0x32fb79,_0x356a67))['catch'](handleError(_0x32fb79,null));};exports[_0xc4bf('0x41')]=function(_0x1d344f,_0x3ebff4){var _0x4e867d={'raw':!![],'where':{'id':_0x1d344f[_0xc4bf('0x42')]['id']}},_0x4781b3={};_0x4781b3[_0xc4bf('0x2f')]=_[_0xc4bf('0x2c')](db['VoiceQueuesLog'][_0xc4bf('0x43')]);_0x4781b3[_0xc4bf('0x2d')]=_[_0xc4bf('0x2c')](_0x1d344f[_0xc4bf('0x2d')]);_0x4781b3[_0xc4bf('0x2e')]=_[_0xc4bf('0x31')](_0x4781b3['model'],_0x4781b3[_0xc4bf('0x2d')]);_0x4e867d[_0xc4bf('0x30')]=_[_0xc4bf('0x31')](_0x4781b3['model'],qs[_0xc4bf('0x32')](_0x1d344f[_0xc4bf('0x2d')][_0xc4bf('0x32')]));_0x4e867d[_0xc4bf('0x30')]=_0x4e867d[_0xc4bf('0x30')][_0xc4bf('0x44')]?_0x4e867d['attributes']:_0x4781b3[_0xc4bf('0x2f')];if(_0x1d344f[_0xc4bf('0x2d')][_0xc4bf('0x3d')]){_0x4e867d[_0xc4bf('0x3e')]=[{'all':!![]}];}_0x4e867d=_[_0xc4bf('0x3a')]({},_0x4e867d,_0x1d344f[_0xc4bf('0x3c')]);return db[_0xc4bf('0x28')]['find'](_0x4e867d)[_0xc4bf('0x21')](handleEntityNotFound(_0x3ebff4,null))[_0xc4bf('0x21')](respondWithResult(_0x3ebff4,null))[_0xc4bf('0x45')](handleError(_0x3ebff4,null));};exports[_0xc4bf('0x46')]=function(_0x4a4b77,_0x3da038){return db[_0xc4bf('0x28')][_0xc4bf('0x46')](_0x4a4b77[_0xc4bf('0x47')],{})[_0xc4bf('0x21')](respondWithResult(_0x3da038,0xc9))['catch'](handleError(_0x3da038,null));};exports[_0xc4bf('0x20')]=function(_0x3a102f,_0x552b9f){if(_0x3a102f[_0xc4bf('0x47')]['id']){delete _0x3a102f['body']['id'];}return db['VoiceQueuesLog'][_0xc4bf('0x48')]({'where':{'id':_0x3a102f[_0xc4bf('0x42')]['id']}})['then'](handleEntityNotFound(_0x552b9f,null))[_0xc4bf('0x21')](saveUpdates(_0x3a102f[_0xc4bf('0x47')],null))['then'](respondWithResult(_0x552b9f,null))['catch'](handleError(_0x552b9f,null));};exports[_0xc4bf('0x22')]=function(_0xd7c7a8,_0x22e42f){return db[_0xc4bf('0x28')][_0xc4bf('0x48')]({'where':{'id':_0xd7c7a8[_0xc4bf('0x42')]['id']}})[_0xc4bf('0x21')](handleEntityNotFound(_0x22e42f,null))['then'](removeEntity(_0x22e42f,null))[_0xc4bf('0x45')](handleError(_0x22e42f,null));};
\ No newline at end of file
+var _0xfbda=['type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','keys','rawAttributes','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','stack','name','send','map','VoiceQueuesLog','fieldName'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfbda,0xae));var _0xafbd=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xfbda[_0x580576];return _0x3f55a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xafbd('0x0'));var zipdir=require(_0xafbd('0x1'));var jsonpatch=require(_0xafbd('0x2'));var rp=require(_0xafbd('0x3'));var moment=require(_0xafbd('0x4'));var BPromise=require(_0xafbd('0x5'));var Mustache=require(_0xafbd('0x6'));var util=require(_0xafbd('0x7'));var path=require(_0xafbd('0x8'));var sox=require('sox');var csv=require(_0xafbd('0x9'));var ejs=require(_0xafbd('0xa'));var fs=require('fs');var fs_extra=require(_0xafbd('0xb'));var _=require(_0xafbd('0xc'));var squel=require(_0xafbd('0xd'));var crypto=require(_0xafbd('0xe'));var jsforce=require(_0xafbd('0xf'));var deskjs=require(_0xafbd('0x10'));var toCsv=require(_0xafbd('0x9'));var querystring=require(_0xafbd('0x11'));var Papa=require(_0xafbd('0x12'));var Redis=require(_0xafbd('0x13'));var authService=require(_0xafbd('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xafbd('0x15'));var hardwareService=require(_0xafbd('0x16'));var logger=require(_0xafbd('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xafbd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xafbd('0x19'))['db'];function respondWithStatusCode(_0x354744,_0x18e76d){_0x18e76d=_0x18e76d||0xcc;return function(_0x47610b){if(_0x47610b){return _0x354744[_0xafbd('0x1a')](_0x18e76d);}return _0x354744['status'](_0x18e76d)[_0xafbd('0x1b')]();};}function respondWithResult(_0x531035,_0x2b128e){_0x2b128e=_0x2b128e||0xc8;return function(_0x54c853){if(_0x54c853){return _0x531035[_0xafbd('0x1c')](_0x2b128e)[_0xafbd('0x1d')](_0x54c853);}};}function respondWithFilteredResult(_0x12ea09,_0x228beb){return function(_0x451a35){if(_0x451a35){var _0x4da989=typeof _0x228beb[_0xafbd('0x1e')]==='undefined'&&typeof _0x228beb[_0xafbd('0x1f')]==='undefined';var _0x3a9055=_0x451a35[_0xafbd('0x20')];var _0x216692=_0x4da989?0x0:_0x228beb['offset'];var _0x1c1e62=_0x4da989?_0x451a35['count']:_0x228beb[_0xafbd('0x1e')]+_0x228beb[_0xafbd('0x1f')];var _0x58cd83;if(_0x1c1e62>=_0x3a9055){_0x1c1e62=_0x3a9055;_0x58cd83=0xc8;}else{_0x58cd83=0xce;}_0x12ea09[_0xafbd('0x1c')](_0x58cd83);return _0x12ea09[_0xafbd('0x21')](_0xafbd('0x22'),_0x216692+'-'+_0x1c1e62+'/'+_0x3a9055)['json'](_0x451a35);}return null;};}function patchUpdates(_0x157e2a){return function(_0x2afa27){try{jsonpatch[_0xafbd('0x23')](_0x2afa27,_0x157e2a,!![]);}catch(_0x1671ab){return BPromise['reject'](_0x1671ab);}return _0x2afa27['save']();};}function saveUpdates(_0xccec52,_0x1babe1){return function(_0x4600c5){if(_0x4600c5){return _0x4600c5[_0xafbd('0x24')](_0xccec52)[_0xafbd('0x25')](function(_0xdffe91){return _0xdffe91;});}return null;};}function removeEntity(_0x1430cc,_0x878407){return function(_0xb48b4){if(_0xb48b4){return _0xb48b4[_0xafbd('0x26')]()[_0xafbd('0x25')](function(){_0x1430cc[_0xafbd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x259d64,_0xfa8e){return function(_0x27bd59){if(!_0x27bd59){_0x259d64[_0xafbd('0x1a')](0x194);}return _0x27bd59;};}function handleError(_0x2a9845,_0x4c6bcd){_0x4c6bcd=_0x4c6bcd||0x1f4;return function(_0x526d0c){logger['error'](_0x526d0c[_0xafbd('0x27')]);if(_0x526d0c[_0xafbd('0x28')]){delete _0x526d0c[_0xafbd('0x28')];}_0x2a9845[_0xafbd('0x1c')](_0x4c6bcd)[_0xafbd('0x29')](_0x526d0c);};}exports['index']=function(_0x41d238,_0x3a353e){var _0x245172={},_0x3fd42e={},_0x2bd560={'count':0x0,'rows':[]};var _0x57dce7=_[_0xafbd('0x2a')](db[_0xafbd('0x2b')]['rawAttributes'],function(_0x3caaad){return{'name':_0x3caaad[_0xafbd('0x2c')],'type':_0x3caaad[_0xafbd('0x2d')][_0xafbd('0x2e')]};});_0x3fd42e[_0xafbd('0x2f')]=_['map'](_0x57dce7,_0xafbd('0x28'));_0x3fd42e[_0xafbd('0x30')]=_['keys'](_0x41d238['query']);_0x3fd42e['filters']=_[_0xafbd('0x31')](_0x3fd42e[_0xafbd('0x2f')],_0x3fd42e[_0xafbd('0x30')]);_0x245172[_0xafbd('0x32')]=_[_0xafbd('0x31')](_0x3fd42e[_0xafbd('0x2f')],qs[_0xafbd('0x33')](_0x41d238[_0xafbd('0x30')][_0xafbd('0x33')]));_0x245172[_0xafbd('0x32')]=_0x245172[_0xafbd('0x32')][_0xafbd('0x34')]?_0x245172[_0xafbd('0x32')]:_0x3fd42e[_0xafbd('0x2f')];if(!_0x41d238[_0xafbd('0x30')][_0xafbd('0x35')](_0xafbd('0x36'))){_0x245172[_0xafbd('0x1f')]=qs[_0xafbd('0x1f')](_0x41d238[_0xafbd('0x30')]['limit']);_0x245172[_0xafbd('0x1e')]=qs['offset'](_0x41d238[_0xafbd('0x30')][_0xafbd('0x1e')]);}_0x245172[_0xafbd('0x37')]=qs['sort'](_0x41d238[_0xafbd('0x30')][_0xafbd('0x38')]);_0x245172['where']=qs[_0xafbd('0x39')](_['pick'](_0x41d238[_0xafbd('0x30')],_0x3fd42e['filters']),_0x57dce7);if(_0x41d238[_0xafbd('0x30')][_0xafbd('0x3a')]){_0x245172[_0xafbd('0x3b')]=_[_0xafbd('0x3c')](_0x245172[_0xafbd('0x3b')],{'$or':_['map'](_0x57dce7,function(_0x221b00){if(_0x221b00[_0xafbd('0x2d')]!==_0xafbd('0x3d')){var _0x11c9ce={};_0x11c9ce[_0x221b00['name']]={'$like':'%'+_0x41d238['query'][_0xafbd('0x3a')]+'%'};return _0x11c9ce;}})});}_0x245172=_[_0xafbd('0x3c')]({},_0x245172,_0x41d238[_0xafbd('0x3e')]);var _0x5ca798={'where':_0x245172[_0xafbd('0x3b')]};return db[_0xafbd('0x2b')][_0xafbd('0x20')](_0x5ca798)[_0xafbd('0x25')](function(_0x3990b3){_0x2bd560[_0xafbd('0x20')]=_0x3990b3;if(_0x41d238[_0xafbd('0x30')][_0xafbd('0x3f')]){_0x245172[_0xafbd('0x40')]=[{'all':!![]}];}return db[_0xafbd('0x2b')]['findAll'](_0x245172);})['then'](function(_0x4f6c49){_0x2bd560['rows']=_0x4f6c49;return _0x2bd560;})[_0xafbd('0x25')](respondWithFilteredResult(_0x3a353e,_0x245172))['catch'](handleError(_0x3a353e,null));};exports[_0xafbd('0x41')]=function(_0x3a5f0c,_0x419002){var _0x35900a={'raw':!![],'where':{'id':_0x3a5f0c[_0xafbd('0x42')]['id']}},_0x2e2273={};_0x2e2273[_0xafbd('0x2f')]=_[_0xafbd('0x43')](db[_0xafbd('0x2b')][_0xafbd('0x44')]);_0x2e2273['query']=_[_0xafbd('0x43')](_0x3a5f0c[_0xafbd('0x30')]);_0x2e2273[_0xafbd('0x39')]=_[_0xafbd('0x31')](_0x2e2273[_0xafbd('0x2f')],_0x2e2273[_0xafbd('0x30')]);_0x35900a[_0xafbd('0x32')]=_['intersection'](_0x2e2273[_0xafbd('0x2f')],qs[_0xafbd('0x33')](_0x3a5f0c[_0xafbd('0x30')]['fields']));_0x35900a[_0xafbd('0x32')]=_0x35900a['attributes'][_0xafbd('0x34')]?_0x35900a[_0xafbd('0x32')]:_0x2e2273[_0xafbd('0x2f')];if(_0x3a5f0c[_0xafbd('0x30')][_0xafbd('0x3f')]){_0x35900a[_0xafbd('0x40')]=[{'all':!![]}];}_0x35900a=_[_0xafbd('0x3c')]({},_0x35900a,_0x3a5f0c[_0xafbd('0x3e')]);return db[_0xafbd('0x2b')][_0xafbd('0x45')](_0x35900a)[_0xafbd('0x25')](handleEntityNotFound(_0x419002,null))[_0xafbd('0x25')](respondWithResult(_0x419002,null))[_0xafbd('0x46')](handleError(_0x419002,null));};exports[_0xafbd('0x47')]=function(_0x1054b9,_0x269fc5){return db[_0xafbd('0x2b')][_0xafbd('0x47')](_0x1054b9[_0xafbd('0x48')],{})[_0xafbd('0x25')](respondWithResult(_0x269fc5,0xc9))[_0xafbd('0x46')](handleError(_0x269fc5,null));};exports[_0xafbd('0x24')]=function(_0x4d81ff,_0x1d685e){if(_0x4d81ff[_0xafbd('0x48')]['id']){delete _0x4d81ff[_0xafbd('0x48')]['id'];}return db[_0xafbd('0x2b')][_0xafbd('0x45')]({'where':{'id':_0x4d81ff['params']['id']}})['then'](handleEntityNotFound(_0x1d685e,null))[_0xafbd('0x25')](saveUpdates(_0x4d81ff['body'],null))[_0xafbd('0x25')](respondWithResult(_0x1d685e,null))['catch'](handleError(_0x1d685e,null));};exports[_0xafbd('0x26')]=function(_0x4ecf36,_0x9f5b02){return db[_0xafbd('0x2b')]['find']({'where':{'id':_0x4ecf36[_0xafbd('0x42')]['id']}})[_0xafbd('0x25')](handleEntityNotFound(_0x9f5b02,null))[_0xafbd('0x25')](removeEntity(_0x9f5b02,null))[_0xafbd('0x46')](handleError(_0x9f5b02,null));};
\ No newline at end of file
index 71c9ebf..5f086b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5db8=['exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./voiceQueuesLog.attributes'];(function(_0x264876,_0x264112){var _0x10b169=function(_0x59b337){while(--_0x59b337){_0x264876['push'](_0x264876['shift']());}};_0x10b169(++_0x264112);}(_0x5db8,0xbb));var _0x85db=function(_0x4b54fb,_0x2150e4){_0x4b54fb=_0x4b54fb-0x0;var _0x375eb4=_0x5db8[_0x4b54fb];return _0x375eb4;};'use strict';var _=require(_0x85db('0x0'));var util=require(_0x85db('0x1'));var logger=require(_0x85db('0x2'))('api');var moment=require(_0x85db('0x3'));var BPromise=require(_0x85db('0x4'));var rp=require(_0x85db('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x85db('0x6'));var attributes=require(_0x85db('0x7'));module[_0x85db('0x8')]=function(_0x34d71f,_0x48bf16){return _0x34d71f['define'](_0x85db('0x9'),attributes,{'tableName':_0x85db('0xa'),'paranoid':![],'indexes':[{'name':_0x85db('0xb'),'fields':[_0x85db('0xc'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
+var _0x1c73=['event_dtm','event','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','VoiceQueuesLog','voice_queues_log'];(function(_0x16ea6e,_0x13456a){var _0x479de7=function(_0x1e1b7d){while(--_0x1e1b7d){_0x16ea6e['push'](_0x16ea6e['shift']());}};_0x479de7(++_0x13456a);}(_0x1c73,0xc2));var _0x31c7=function(_0x360f55,_0x25658c){_0x360f55=_0x360f55-0x0;var _0x3fa3ec=_0x1c73[_0x360f55];return _0x3fa3ec;};'use strict';var _=require(_0x31c7('0x0'));var util=require('util');var logger=require(_0x31c7('0x1'))(_0x31c7('0x2'));var moment=require(_0x31c7('0x3'));var BPromise=require(_0x31c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31c7('0x5'));var rimraf=require(_0x31c7('0x6'));var config=require(_0x31c7('0x7'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x3da553,_0x597fbf){return _0x3da553['define'](_0x31c7('0x8'),attributes,{'tableName':_0x31c7('0x9'),'paranoid':![],'indexes':[{'name':_0x31c7('0xa'),'fields':[_0x31c7('0xb'),'dtm']}],'timestamps':![]});};
\ No newline at end of file
index a7d071f..16f8799 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe688=['stringify','error','code','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xe688,0xac));var _0x8e68=function(_0x529f2a,_0x13152b){_0x529f2a=_0x529f2a-0x0;var _0x37361d=_0xe688[_0x529f2a];return _0x37361d;};'use strict';var _=require(_0x8e68('0x0'));var util=require('util');var moment=require(_0x8e68('0x1'));var BPromise=require(_0x8e68('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8e68('0x3'));var db=require(_0x8e68('0x4'))['db'];var utils=require(_0x8e68('0x5'));var logger=require('../../config/logger')(_0x8e68('0x6'));var config=require(_0x8e68('0x7'));var jayson=require(_0x8e68('0x8'));var client=jayson[_0x8e68('0x9')][_0x8e68('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa34390,_0x31470d,_0x5948f1){return new BPromise(function(_0x50a7e6,_0x46b51a){return client[_0x8e68('0xb')](_0xa34390,_0x5948f1)[_0x8e68('0xc')](function(_0x5ae7bc){logger[_0x8e68('0xd')](_0x8e68('0xe'),_0x31470d,'request\x20sent');logger['debug'](_0x8e68('0xf'),_0x31470d,_0x8e68('0x10'),JSON[_0x8e68('0x11')](_0x5ae7bc));if(_0x5ae7bc[_0x8e68('0x12')]){if(_0x5ae7bc['error'][_0x8e68('0x13')]===0x1f4){logger[_0x8e68('0x12')](_0x8e68('0xe'),_0x31470d,_0x5ae7bc[_0x8e68('0x12')]['message']);return _0x46b51a(_0x5ae7bc[_0x8e68('0x12')][_0x8e68('0x14')]);}logger[_0x8e68('0x12')](_0x8e68('0xe'),_0x31470d,_0x5ae7bc[_0x8e68('0x12')][_0x8e68('0x14')]);return _0x50a7e6(_0x5ae7bc[_0x8e68('0x12')]['message']);}else{logger[_0x8e68('0xd')](_0x8e68('0xe'),_0x31470d,'request\x20sent');_0x50a7e6(_0x5ae7bc['result'][_0x8e68('0x14')]);}})['catch'](function(_0x29b3ed){logger['error'](_0x8e68('0xe'),_0x31470d,_0x29b3ed);_0x46b51a(_0x29b3ed);});});}
\ No newline at end of file
+var _0x22d3=['debug','stringify','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent'];(function(_0x29673a,_0xcd0eef){var _0x2a2c24=function(_0x34ff45){while(--_0x34ff45){_0x29673a['push'](_0x29673a['shift']());}};_0x2a2c24(++_0xcd0eef);}(_0x22d3,0xf8));var _0x322d=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x22d3[_0x1f8053];return _0x174fd8;};'use strict';var _=require(_0x322d('0x0'));var util=require(_0x322d('0x1'));var moment=require(_0x322d('0x2'));var BPromise=require(_0x322d('0x3'));var rs=require(_0x322d('0x4'));var fs=require('fs');var Redis=require(_0x322d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x322d('0x6'));var logger=require(_0x322d('0x7'))(_0x322d('0x8'));var config=require(_0x322d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x322d('0xa')][_0x322d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c2a38,_0x1bb16a,_0xf9b463){return new BPromise(function(_0x434a7f,_0x2b3ac4){return client[_0x322d('0xc')](_0x1c2a38,_0xf9b463)[_0x322d('0xd')](function(_0x2577c9){logger[_0x322d('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1bb16a,_0x322d('0xf'));logger[_0x322d('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x1bb16a,_0x322d('0xf'),JSON[_0x322d('0x11')](_0x2577c9));if(_0x2577c9[_0x322d('0x12')]){if(_0x2577c9[_0x322d('0x12')][_0x322d('0x13')]===0x1f4){logger[_0x322d('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1bb16a,_0x2577c9[_0x322d('0x12')][_0x322d('0x14')]);return _0x2b3ac4(_0x2577c9[_0x322d('0x12')][_0x322d('0x14')]);}logger['error'](_0x322d('0x15'),_0x1bb16a,_0x2577c9['error'][_0x322d('0x14')]);return _0x434a7f(_0x2577c9[_0x322d('0x12')][_0x322d('0x14')]);}else{logger[_0x322d('0xe')](_0x322d('0x15'),_0x1bb16a,_0x322d('0xf'));_0x434a7f(_0x2577c9[_0x322d('0x16')][_0x322d('0x14')]);}})[_0x322d('0x17')](function(_0x2ade50){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x1bb16a,_0x2ade50);_0x2b3ac4(_0x2ade50);});});}
\ No newline at end of file
index ca0407c..6cf8351 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd66f=['show','/:id/downloads','/:id/transcribe','downloadTranscribe','create','post','runTranscribe','put','delete','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x2fb131,_0x16e1e5){var _0x2d3d5c=function(_0xdc9c17){while(--_0xdc9c17){_0x2fb131['push'](_0x2fb131['shift']());}};_0x2d3d5c(++_0x16e1e5);}(_0xd66f,0x1b2));var _0xfd66=function(_0x3eab9e,_0x2197d9){_0x3eab9e=_0x3eab9e-0x0;var _0x49b28b=_0xd66f[_0x3eab9e];return _0x49b28b;};'use strict';var multer=require(_0xfd66('0x0'));var util=require(_0xfd66('0x1'));var path=require(_0xfd66('0x2'));var timeout=require('connect-timeout');var express=require(_0xfd66('0x3'));var router=express[_0xfd66('0x4')]();var fs_extra=require(_0xfd66('0x5'));var auth=require(_0xfd66('0x6'));var interaction=require(_0xfd66('0x7'));var config=require(_0xfd66('0x8'));var controller=require(_0xfd66('0x9'));router[_0xfd66('0xa')]('/',auth['isAuthenticated'](),controller[_0xfd66('0xb')]);router[_0xfd66('0xa')](_0xfd66('0xc'),auth[_0xfd66('0xd')](),controller[_0xfd66('0xe')]);router[_0xfd66('0xa')](_0xfd66('0xf'),auth['isAuthenticated'](),controller[_0xfd66('0x10')]);router['get']('/:id/download',auth[_0xfd66('0xd')](),controller['download']);router['get'](_0xfd66('0x11'),controller['downloads']);router['get'](_0xfd66('0x12'),auth['isAuthenticated'](),controller[_0xfd66('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfd66('0x14')]);router[_0xfd66('0x15')]('/:id/transcribe',auth[_0xfd66('0xd')](),controller[_0xfd66('0x16')]);router[_0xfd66('0x17')](_0xfd66('0xf'),auth[_0xfd66('0xd')](),controller['update']);router[_0xfd66('0x18')](_0xfd66('0xf'),auth[_0xfd66('0xd')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8cde=['runTranscribe','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post'];(function(_0x283eb5,_0x580840){var _0x47305b=function(_0xa3a19a){while(--_0xa3a19a){_0x283eb5['push'](_0x283eb5['shift']());}};_0x47305b(++_0x580840);}(_0x8cde,0x16c));var _0xe8cd=function(_0x104112,_0x342eb6){_0x104112=_0x104112-0x0;var _0x394ab4=_0x8cde[_0x104112];return _0x394ab4;};'use strict';var multer=require(_0xe8cd('0x0'));var util=require(_0xe8cd('0x1'));var path=require(_0xe8cd('0x2'));var timeout=require(_0xe8cd('0x3'));var express=require('express');var router=express[_0xe8cd('0x4')]();var fs_extra=require(_0xe8cd('0x5'));var auth=require(_0xe8cd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe8cd('0x7'));var controller=require(_0xe8cd('0x8'));router[_0xe8cd('0x9')]('/',auth[_0xe8cd('0xa')](),controller['index']);router['get'](_0xe8cd('0xb'),auth[_0xe8cd('0xa')](),controller[_0xe8cd('0xc')]);router['get'](_0xe8cd('0xd'),auth[_0xe8cd('0xa')](),controller['show']);router[_0xe8cd('0x9')]('/:id/download',auth[_0xe8cd('0xa')](),controller[_0xe8cd('0xe')]);router[_0xe8cd('0x9')](_0xe8cd('0xf'),controller[_0xe8cd('0x10')]);router['get'](_0xe8cd('0x11'),auth[_0xe8cd('0xa')](),controller[_0xe8cd('0x12')]);router[_0xe8cd('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe8cd('0x13')](_0xe8cd('0x11'),auth[_0xe8cd('0xa')](),controller[_0xe8cd('0x14')]);router['put'](_0xe8cd('0xd'),auth[_0xe8cd('0xa')](),controller[_0xe8cd('0x15')]);router[_0xe8cd('0x16')](_0xe8cd('0xd'),auth[_0xe8cd('0xa')](),controller['destroy']);module[_0xe8cd('0x17')]=router;
\ No newline at end of file
index 2d5b295..9cc0d51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
+var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}};
\ No newline at end of file
index 28d71a5..ba3a76e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfef3=['sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','end','name','send','VoiceRecording','rawAttributes','type','key','differenceBy','format','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','include','findAll','catch','show','keys','includeAll','options','find','create','body','params','describe','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','Sequelize','ValidationError','VoiceRecording\x20not\x20found','download','filename','unlink','message','Not\x20found','downloads','sequelize','MD5','col','$and','push','%s.cypher','recording','extname','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','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)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','transcribeRegion','language','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','transcribeAccountId','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','aws-sdk','uuid/v4','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x4c3ed0,_0x119ca3){var _0x1b0876=function(_0x444d3b){while(--_0x444d3b){_0x4c3ed0['push'](_0x4c3ed0['shift']());}};_0x1b0876(++_0x119ca3);}(_0xfef3,0x110));var _0x3fef=function(_0x43b34a,_0x39f685){_0x43b34a=_0x43b34a-0x0;var _0x4d4b3b=_0xfef3[_0x43b34a];return _0x4d4b3b;};'use strict';var emlformat=require(_0x3fef('0x0'));var rimraf=require(_0x3fef('0x1'));var zipdir=require(_0x3fef('0x2'));var jsonpatch=require(_0x3fef('0x3'));var rp=require(_0x3fef('0x4'));var moment=require(_0x3fef('0x5'));var BPromise=require(_0x3fef('0x6'));var Mustache=require(_0x3fef('0x7'));var util=require('util');var path=require(_0x3fef('0x8'));var sox=require(_0x3fef('0x9'));var csv=require(_0x3fef('0xa'));var ejs=require(_0x3fef('0xb'));var fs=require('fs');var fs_extra=require(_0x3fef('0xc'));var _=require('lodash');var squel=require(_0x3fef('0xd'));var crypto=require(_0x3fef('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3fef('0xa'));var querystring=require(_0x3fef('0xf'));var Papa=require('papaparse');var AWS=require(_0x3fef('0x10'));var uuidv4=require(_0x3fef('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3fef('0x12'));var as=require(_0x3fef('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3fef('0x14'))('api');var utils=require(_0x3fef('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x3fef('0x16'));var db=require(_0x3fef('0x17'))['db'];function respondWithStatusCode(_0x5a3648,_0x11058b){_0x11058b=_0x11058b||0xcc;return function(_0x3e753f){if(_0x3e753f){return _0x5a3648[_0x3fef('0x18')](_0x11058b);}return _0x5a3648[_0x3fef('0x19')](_0x11058b)['end']();};}function respondWithResult(_0x5fe02a,_0x4bea58){_0x4bea58=_0x4bea58||0xc8;return function(_0x22db05){if(_0x22db05){return _0x5fe02a[_0x3fef('0x19')](_0x4bea58)['json'](_0x22db05);}};}function respondWithFilteredResult(_0x112f8b,_0x26da3c){return function(_0x217215){if(_0x217215){var _0x15f543=typeof _0x26da3c[_0x3fef('0x1a')]==='undefined'&&typeof _0x26da3c[_0x3fef('0x1b')]===_0x3fef('0x1c');var _0x519f25=_0x217215[_0x3fef('0x1d')];var _0x124bac=_0x15f543?0x0:_0x26da3c['offset'];var _0x2b79fa=_0x15f543?_0x217215[_0x3fef('0x1d')]:_0x26da3c[_0x3fef('0x1a')]+_0x26da3c[_0x3fef('0x1b')];var _0xedc7b8;if(_0x2b79fa>=_0x519f25){_0x2b79fa=_0x519f25;_0xedc7b8=0xc8;}else{_0xedc7b8=0xce;}_0x112f8b[_0x3fef('0x19')](_0xedc7b8);return _0x112f8b['set'](_0x3fef('0x1e'),_0x124bac+'-'+_0x2b79fa+'/'+_0x519f25)[_0x3fef('0x1f')](_0x217215);}return null;};}function patchUpdates(_0x493d24){return function(_0x2aa7e1){try{jsonpatch[_0x3fef('0x20')](_0x2aa7e1,_0x493d24,!![]);}catch(_0x59f21a){return BPromise[_0x3fef('0x21')](_0x59f21a);}return _0x2aa7e1[_0x3fef('0x22')]();};}function saveUpdates(_0x2793e6,_0xe64ac7){return function(_0x5dc3b7){if(_0x5dc3b7){return _0x5dc3b7[_0x3fef('0x23')](_0x2793e6)[_0x3fef('0x24')](function(_0x4ff127){return _0x4ff127;});}return null;};}function removeEntity(_0x33bbb5,_0xa2c1b3){return function(_0x1bf081){if(_0x1bf081){return _0x1bf081['destroy']()[_0x3fef('0x24')](function(){_0x33bbb5[_0x3fef('0x19')](0xcc)[_0x3fef('0x25')]();});}};}function handleEntityNotFound(_0x4d2bac,_0x29b1e8){return function(_0x1c51fb){if(!_0x1c51fb){_0x4d2bac['sendStatus'](0x194);}return _0x1c51fb;};}function handleError(_0x4db5ae,_0x36d141){_0x36d141=_0x36d141||0x1f4;return function(_0x25cb60){logger['error'](_0x25cb60['stack']);if(_0x25cb60[_0x3fef('0x26')]){delete _0x25cb60[_0x3fef('0x26')];}_0x4db5ae[_0x3fef('0x19')](_0x36d141)[_0x3fef('0x27')](_0x25cb60);};}exports['index']=function(_0x326769,_0xeabb0d){var _0x2579f7={},_0x416cf1={},_0x5dd5c6={'count':0x0,'rows':[]};var _0xfe86b3=_['map'](db[_0x3fef('0x28')][_0x3fef('0x29')],function(_0x15765e){return{'name':_0x15765e['fieldName'],'type':_0x15765e[_0x3fef('0x2a')][_0x3fef('0x2b')]};});_0x416cf1['model']=_[_0x3fef('0x2c')](_['map'](_0xfe86b3,_0x3fef('0x26')),[_0x3fef('0x2d')]);_0x416cf1[_0x3fef('0x2e')]=_['keys'](_0x326769[_0x3fef('0x2e')]);_0x416cf1[_0x3fef('0x2f')]=_[_0x3fef('0x30')](_0x416cf1[_0x3fef('0x31')],_0x416cf1[_0x3fef('0x2e')]);_0x2579f7[_0x3fef('0x32')]=_[_0x3fef('0x30')](_0x416cf1['model'],qs[_0x3fef('0x33')](_0x326769[_0x3fef('0x2e')][_0x3fef('0x33')]));_0x2579f7['attributes']=_0x2579f7[_0x3fef('0x32')][_0x3fef('0x34')]?_0x2579f7[_0x3fef('0x32')]:_0x416cf1[_0x3fef('0x31')];if(!_0x326769[_0x3fef('0x2e')][_0x3fef('0x35')]('nolimit')){_0x2579f7[_0x3fef('0x1b')]=qs[_0x3fef('0x1b')](_0x326769[_0x3fef('0x2e')][_0x3fef('0x1b')]);_0x2579f7[_0x3fef('0x1a')]=qs[_0x3fef('0x1a')](_0x326769[_0x3fef('0x2e')][_0x3fef('0x1a')]);}_0x2579f7[_0x3fef('0x36')]=qs[_0x3fef('0x37')](_0x326769['query'][_0x3fef('0x37')]);_0x2579f7[_0x3fef('0x38')]=qs[_0x3fef('0x2f')](_[_0x3fef('0x39')](_0x326769['query'],_0x416cf1[_0x3fef('0x2f')]),_0xfe86b3);if(_0x326769[_0x3fef('0x2e')][_0x3fef('0x3a')]){_0x2579f7['where']=_[_0x3fef('0x3b')](_0x2579f7['where'],{'$or':_[_0x3fef('0x3c')](_0xfe86b3,function(_0x25551f){if(_0x25551f[_0x3fef('0x2a')]!=='VIRTUAL'){var _0x7089cb={};_0x7089cb[_0x25551f[_0x3fef('0x26')]]={'$like':'%'+_0x326769[_0x3fef('0x2e')][_0x3fef('0x3a')]+'%'};return _0x7089cb;}})});}_0x2579f7=_[_0x3fef('0x3b')]({},_0x2579f7,_0x326769['options']);var _0x336d59={'where':_0x2579f7[_0x3fef('0x38')]};return db[_0x3fef('0x28')]['count'](_0x336d59)[_0x3fef('0x24')](function(_0x4040cb){_0x5dd5c6[_0x3fef('0x1d')]=_0x4040cb;if(_0x326769[_0x3fef('0x2e')]['includeAll']){_0x2579f7[_0x3fef('0x3d')]=[{'all':!![]}];}return db[_0x3fef('0x28')][_0x3fef('0x3e')](_0x2579f7);})[_0x3fef('0x24')](function(_0x139d11){_0x5dd5c6['rows']=_0x139d11;return _0x5dd5c6;})[_0x3fef('0x24')](respondWithFilteredResult(_0xeabb0d,_0x2579f7))[_0x3fef('0x3f')](handleError(_0xeabb0d,null));};exports[_0x3fef('0x40')]=function(_0x1431a6,_0x36d6ac){var _0x126dfe={'raw':![],'where':{'id':_0x1431a6['params']['id']}},_0x123958={};_0x123958[_0x3fef('0x31')]=_['keys'](db[_0x3fef('0x28')][_0x3fef('0x29')]);_0x123958[_0x3fef('0x2e')]=_[_0x3fef('0x41')](_0x1431a6['query']);_0x123958[_0x3fef('0x2f')]=_[_0x3fef('0x30')](_0x123958['model'],_0x123958[_0x3fef('0x2e')]);_0x126dfe[_0x3fef('0x32')]=_['intersection'](_0x123958[_0x3fef('0x31')],qs[_0x3fef('0x33')](_0x1431a6[_0x3fef('0x2e')][_0x3fef('0x33')]));_0x126dfe['attributes']=_0x126dfe[_0x3fef('0x32')][_0x3fef('0x34')]?_0x126dfe['attributes']:_0x123958['model'];if(_0x1431a6[_0x3fef('0x2e')][_0x3fef('0x42')]){_0x126dfe[_0x3fef('0x3d')]=[{'all':!![]}];}_0x126dfe=_[_0x3fef('0x3b')]({},_0x126dfe,_0x1431a6[_0x3fef('0x43')]);return db['VoiceRecording'][_0x3fef('0x44')](_0x126dfe)[_0x3fef('0x24')](handleEntityNotFound(_0x36d6ac,null))[_0x3fef('0x24')](respondWithResult(_0x36d6ac,null))[_0x3fef('0x3f')](handleError(_0x36d6ac,null));};exports[_0x3fef('0x45')]=function(_0x40fb22,_0x4f8522){return db[_0x3fef('0x28')][_0x3fef('0x45')](_0x40fb22[_0x3fef('0x46')],{})[_0x3fef('0x24')](respondWithResult(_0x4f8522,0xc9))[_0x3fef('0x3f')](handleError(_0x4f8522,null));};exports[_0x3fef('0x23')]=function(_0x487888,_0x3e1cf2){if(_0x487888['body']['id']){delete _0x487888[_0x3fef('0x46')]['id'];}return db[_0x3fef('0x28')]['find']({'where':{'id':_0x487888[_0x3fef('0x47')]['id']}})[_0x3fef('0x24')](handleEntityNotFound(_0x3e1cf2,null))[_0x3fef('0x24')](saveUpdates(_0x487888[_0x3fef('0x46')],null))['then'](respondWithResult(_0x3e1cf2,null))[_0x3fef('0x3f')](handleError(_0x3e1cf2,null));};exports[_0x3fef('0x48')]=function(_0x5f21d8,_0x54d536){return db[_0x3fef('0x28')][_0x3fef('0x48')]()[_0x3fef('0x24')](respondWithResult(_0x54d536,null))['catch'](handleError(_0x54d536,null));};exports['download']=function(_0x3b5dca,_0x49bf04,_0x68f849){var _0x44fce9=require(_0x3fef('0x49'));var _0x3e5702=![];var _0x932223={};if(_0x3b5dca[_0x3fef('0x2e')][_0x3fef('0x2a')]&&_0x3b5dca[_0x3fef('0x2e')][_0x3fef('0x2a')]===_0x3fef('0x4a')){_0x932223[_0x3fef('0x4a')]=_0x3b5dca[_0x3fef('0x47')]['id'];}else{_0x932223['id']=_0x3b5dca[_0x3fef('0x47')]['id'];}return db['VoiceRecording']['find']({'where':_0x932223,'attributes':['id','value'],'raw':!![]})[_0x3fef('0x24')](handleEntityNotFound(_0x49bf04,null))[_0x3fef('0x24')](function(_0x3122d6){if(_0x3122d6){var _0x2e9ec0=_0x3122d6[_0x3fef('0x4b')];var _0x242866=util['format']('%s.cypher',_0x2e9ec0);if(fs[_0x3fef('0x4c')](_0x242866)){_0x3e5702=!![];return _0x44fce9[_0x3fef('0x4d')](_0x242866,_0x2e9ec0,config[_0x3fef('0x4e')]['recording'])[_0x3fef('0x24')](function(){return _0x3122d6;});}return _0x3122d6;}})[_0x3fef('0x24')](function(_0x5da9e7){if(_0x5da9e7){var _0x27d8aa=_0x5da9e7[_0x3fef('0x4b')];if(!fs[_0x3fef('0x4c')](_0x27d8aa)){throw new db[(_0x3fef('0x4f'))][(_0x3fef('0x50'))](_0x3fef('0x51'));}if(_0x5da9e7['filename']){return _0x49bf04[_0x3fef('0x52')](_0x27d8aa,_0x5da9e7[_0x3fef('0x53')]+path['extname'](_0x27d8aa),function(){if(_0x3e5702){fs[_0x3fef('0x54')](_0x27d8aa);}});}else{return _0x49bf04[_0x3fef('0x52')](_0x27d8aa,function(_0x407c4c){if(_0x3e5702){fs[_0x3fef('0x54')](_0x27d8aa);}});}}})['catch'](function(_0x1392db){if(_0x1392db[_0x3fef('0x55')]===_0x3fef('0x51')){_0x49bf04['status'](0x194)[_0x3fef('0x27')](_0x3fef('0x56'));}else{return handleError(_0x49bf04,null);}});};exports[_0x3fef('0x57')]=function(_0x5470cc,_0x501e69,_0x161a30){var _0x489125=require(_0x3fef('0x49'));var _0x2c486e=![];var _0x10c5b4={'$and':[db['sequelize'][_0x3fef('0x38')](db[_0x3fef('0x58')]['fn'](_0x3fef('0x59'),db[_0x3fef('0x58')][_0x3fef('0x5a')](_0x3fef('0x4a'))),_0x5470cc['query']['token'])]};if(_0x5470cc[_0x3fef('0x2e')][_0x3fef('0x2a')]&&_0x5470cc[_0x3fef('0x2e')][_0x3fef('0x2a')]===_0x3fef('0x4a')){_0x10c5b4[_0x3fef('0x5b')][_0x3fef('0x5c')]({'uniqueid':_0x5470cc[_0x3fef('0x47')]['id']});}else{_0x10c5b4[_0x3fef('0x5b')][_0x3fef('0x5c')]({'id':_0x5470cc[_0x3fef('0x47')]['id']});}return db[_0x3fef('0x28')][_0x3fef('0x44')]({'where':_0x10c5b4,'attributes':['id',_0x3fef('0x4b')],'raw':!![]})[_0x3fef('0x24')](handleEntityNotFound(_0x501e69,null))[_0x3fef('0x24')](function(_0x518300){if(_0x518300){var _0x568b0f=util['format'](_0x3fef('0x5d'),_0x518300[_0x3fef('0x4b')]);if(fs[_0x3fef('0x4c')](_0x568b0f)){_0x2c486e=!![];return _0x489125[_0x3fef('0x4d')](_0x568b0f,_0x518300['value'],config['secrets'][_0x3fef('0x5e')])[_0x3fef('0x24')](function(){return _0x518300;});}return _0x518300;}})[_0x3fef('0x24')](function(_0x3af240){if(_0x3af240){if(!fs[_0x3fef('0x4c')](_0x3af240['value'])){throw new db[(_0x3fef('0x4f'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x3af240[_0x3fef('0x53')]){return _0x501e69[_0x3fef('0x52')](_0x3af240[_0x3fef('0x4b')],_0x3af240[_0x3fef('0x53')]+path[_0x3fef('0x5f')](_0x3af240['value']),function(){if(_0x2c486e){fs[_0x3fef('0x54')](_0x3af240[_0x3fef('0x4b')]);}});}else{return _0x501e69[_0x3fef('0x52')](_0x3af240[_0x3fef('0x4b')],function(_0x1141fb){if(_0x2c486e){fs[_0x3fef('0x54')](_0x3af240[_0x3fef('0x4b')]);}});}}})[_0x3fef('0x3f')](handleError(_0x501e69,null));};exports[_0x3fef('0x60')]=function(_0x5d77e5,_0xc29764){return db[_0x3fef('0x28')]['find']({'where':{'id':_0x5d77e5[_0x3fef('0x47')]['id']}})['then'](function(_0x4d645a){if(_[_0x3fef('0x61')](_0x4d645a)){throw new ReferenceError(_0x3fef('0x62'));}return _0x4d645a;})[_0x3fef('0x24')](function(_0x1f6402){var _0x21cce6=_0x1f6402[_0x3fef('0x4b')];logger[_0x3fef('0x63')](_0x3fef('0x64'),_0x21cce6);if(!_['isNil'](_0x1f6402[_0x3fef('0x4b')])&&fs[_0x3fef('0x4c')](_0x21cce6)){logger[_0x3fef('0x63')]('File:\x20\x22'+_0x21cce6+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x3fef('0x65')](_0x21cce6);}_0x21cce6=_0x21cce6+_0x3fef('0x66');if(!_[_0x3fef('0x61')](_0x1f6402[_0x3fef('0x4b')])&&fs['existsSync'](_0x21cce6)){logger[_0x3fef('0x63')]('File:\x20\x22'+_0x21cce6+_0x3fef('0x67'));fs[_0x3fef('0x65')](_0x21cce6);}return _0x1f6402;})[_0x3fef('0x24')](function(_0x2fea6d){if(!_0x2fea6d)throw new InternalError();return _0x2fea6d[_0x3fef('0x60')]();})['then'](function(){_0xc29764[_0x3fef('0x19')](0xcc)['end']();})[_0x3fef('0x3f')](handleError(_0xc29764,null));};function getBucketslist(_0x5e267f,_0x1d8e5e,_0x260e1d){return new Promise(function(_0x3afc9f,_0x363158){var _0x49cfc8=new AWS['S3']({'accessKeyId':_0x1d8e5e,'secretAccessKey':_0x5e267f,'region':_0x260e1d});_0x49cfc8[_0x3fef('0x68')]({},function(_0xb79815,_0x40f6e2){if(_0xb79815){return _0x363158(_0xb79815);}else{return _0x3afc9f(_0x40f6e2);}});});}function createBucket(_0xd2cb6f,_0x5357af,_0x89e066,_0x4169bc){return new Promise(function(_0x53d9cb,_0x3a34f2){var _0x155022=new AWS['S3']({'accessKeyId':_0x5357af,'secretAccessKey':_0xd2cb6f,'region':_0x89e066});_0x155022['createBucket']({'Bucket':_0x4169bc},function(_0x1e592f,_0x346cba){if(_0x1e592f){return _0x3a34f2(_0x1e592f);}else{return _0x53d9cb(_0x346cba);}});});}function uploadFile(_0x5db98c,_0xcddfab,_0x202612,_0x5483df,_0xd15c43,_0x5ce4a9){return new Promise(function(_0x1cb673,_0x20314b){var _0x289818=new AWS['S3']({'accessKeyId':_0xcddfab,'secretAccessKey':_0x5db98c,'region':_0x202612});_0x289818[_0x3fef('0x69')]({'Bucket':_0x5483df,'Key':_0xd15c43,'Body':_0x5ce4a9},function(_0x47b3c4,_0x26742c){if(_0x47b3c4){return _0x20314b(_0x47b3c4);}else{return _0x1cb673(_0x26742c);}});});}function startTranscribe(_0x350a3a,_0x3510d7,_0x4f856c,_0x1f5ce2,_0x13ba6d,_0x9742ca){return new Promise(function(_0x518e1c,_0x28ae3e){var _0x27b140=new AWS[(_0x3fef('0x6a'))]({'accessKeyId':_0x3510d7,'secretAccessKey':_0x350a3a,'region':_0x4f856c});_0x27b140[_0x3fef('0x6b')]({'TranscriptionJobName':_0x1f5ce2,'LanguageCode':_0x13ba6d,'Media':{'MediaFileUri':_0x9742ca}},function(_0x598afc,_0x345c44){if(_0x598afc){return _0x28ae3e(_0x598afc);}else{return _0x518e1c(_0x345c44);}});});}function transcribe(_0x38538f,_0x47e883,_0x317996,_0x347997,_0x37a41b,_0x664aee,_0x4c6eaf){return new Promise(function(_0x3458ee,_0xed01a8){var _0x13142f={};logger[_0x3fef('0x63')](util['format'](_0x3fef('0x6c'),_0x38538f,_0x37a41b));return uploadFile(_0x47e883,_0x317996,_0x347997,_0x37a41b,path[_0x3fef('0x6d')](_0x664aee),fs[_0x3fef('0x6e')](_0x664aee))[_0x3fef('0x24')](function(_0x13e50d){logger[_0x3fef('0x63')](util[_0x3fef('0x2d')](_0x3fef('0x6f'),_0x38538f,_0x37a41b,_0x13e50d[_0x3fef('0x70')]));_0x13142f[_0x3fef('0x71')]=_0x13e50d[_0x3fef('0x72')];_0x13142f[_0x3fef('0x73')]=_0x13e50d['Location'];logger[_0x3fef('0x63')](util['format'](_0x3fef('0x74'),_0x38538f));return startTranscribe(_0x47e883,_0x317996,_0x347997,uuidv4(),_0x4c6eaf,_0x13e50d['Location']);})[_0x3fef('0x24')](function(_0x181f08){logger['info'](util[_0x3fef('0x2d')](_0x3fef('0x75'),_0x38538f,_0x181f08[_0x3fef('0x76')]['TranscriptionJobName']));_0x13142f[_0x3fef('0x77')]=_0x181f08[_0x3fef('0x76')]['TranscriptionJobName'];_0x13142f[_0x3fef('0x78')]=_0x181f08[_0x3fef('0x76')][_0x3fef('0x79')];return _0x3458ee(_0x13142f);})[_0x3fef('0x3f')](function(_0x7e1c12){return _0xed01a8(_0x7e1c12);});});}exports[_0x3fef('0x7a')]=function(_0x48cabf,_0x123cb3,_0x47dfbf){var _0x212099;var _0x5b25d7;var _0x1ece77;var _0x3c5d68=require(_0x3fef('0x49'));return db[_0x3fef('0x28')][_0x3fef('0x7b')]({'where':{'id':_0x48cabf[_0x3fef('0x47')]['id']}})['then'](function(_0x234163){if(_0x234163){var _0x1d71e6=util[_0x3fef('0x2d')]('%s.cypher',_0x234163['value']);if(fs[_0x3fef('0x4c')](_0x1d71e6)){cypher=!![];return _0x3c5d68[_0x3fef('0x4d')](_0x1d71e6,_0x234163[_0x3fef('0x4b')],config[_0x3fef('0x4e')][_0x3fef('0x5e')])[_0x3fef('0x24')](function(){return _0x234163;});}return _0x234163;}})['then'](function(_0x23f9a2){if(!_0x23f9a2){throw new db[(_0x3fef('0x4f'))][(_0x3fef('0x50'))](_0x3fef('0x7c'));}_0x5b25d7=_0x23f9a2;return db['Setting'][_0x3fef('0x7b')]({'where':{'id':0x1}});})[_0x3fef('0x24')](handleEntityNotFound(_0x123cb3,null))[_0x3fef('0x24')](function(_0x31ec8a){if(_0x31ec8a){_0x212099=_0x31ec8a;if(!_0x212099['transcribe']||!_0x212099['transcribeAccountId']||!_0x212099[_0x3fef('0x7d')]||!_0x212099[_0x3fef('0x7e')]||!_0x212099[_0x3fef('0x71')]){throw new db[(_0x3fef('0x4f'))]['ValidationError']('Transcribe\x20not\x20configured');}if(_0x48cabf[_0x3fef('0x46')]['runSentiment']&&(!_0x212099[_0x3fef('0x7f')]||!_0x212099[_0x3fef('0x80')]||!_0x212099[_0x3fef('0x81')]||!_0x212099[_0x3fef('0x7e')]||!_0x212099[_0x3fef('0x71')])){throw new db['Sequelize']['ValidationError'](_0x3fef('0x82'));}return db['CloudProvider'][_0x3fef('0x7b')]({'where':{'id':_0x212099[_0x3fef('0x83')]}});}})[_0x3fef('0x24')](function(_0x523d9f){if(!_0x523d9f){throw new db[(_0x3fef('0x4f'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x523d9f[_0x3fef('0x84')]||!_0x523d9f[_0x3fef('0x85')]){throw new db[(_0x3fef('0x4f'))][(_0x3fef('0x50'))](_0x3fef('0x86'));}_0x1ece77=_0x523d9f;return getBucketslist(_0x1ece77[_0x3fef('0x84')],_0x1ece77['data2'],_0x212099['transcribeRegion']);})[_0x3fef('0x24')](function(_0x472773){if(_0x472773&&_0x472773[_0x3fef('0x87')]){var _0x51635e=_[_0x3fef('0x44')](_0x472773[_0x3fef('0x87')],function(_0x2ae0b4){return _0x2ae0b4[_0x3fef('0x88')]===_0x212099[_0x3fef('0x71')];});if(!_0x51635e){logger[_0x3fef('0x63')](util[_0x3fef('0x2d')](_0x3fef('0x89'),_0x48cabf['params']['id'],_0x212099['bucket']));return createBucket(_0x1ece77[_0x3fef('0x84')],_0x1ece77[_0x3fef('0x85')],_0x212099['transcribeRegion'],_0x212099['bucket']);}logger['info'](util[_0x3fef('0x2d')](_0x3fef('0x8a'),_0x48cabf[_0x3fef('0x47')]['id'],_0x212099[_0x3fef('0x71')]));return;}})['then'](function(_0x1e28f7){if(_0x5b25d7['transcribeStatus']===_0x3fef('0x8b')){return transcribe(_0x48cabf[_0x3fef('0x47')]['id'],_0x1ece77[_0x3fef('0x84')],_0x1ece77[_0x3fef('0x85')],_0x212099['transcribeRegion'],_0x212099[_0x3fef('0x71')],_0x5b25d7[_0x3fef('0x4b')],_0x212099[_0x3fef('0x7e')]);}else{logger['info'](util[_0x3fef('0x2d')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x48cabf['params']['id']));return{'transcribeStatus':_0x3fef('0x8c')};}})[_0x3fef('0x24')](function(_0x3be073){if(_0x3be073){_0x3be073[_0x3fef('0x8d')]=_0x48cabf[_0x3fef('0x46')]['runSentiment'];return _0x5b25d7[_0x3fef('0x8e')](_0x3be073);}})['then'](respondWithResult(_0x123cb3,null))[_0x3fef('0x3f')](handleError(_0x123cb3,null));};function writeFile(_0x27286f,_0x405b52){return new Promise(function(_0x2800c5,_0x2808db){fs['writeFile'](_0x405b52,_0x27286f,function(_0x2786a2,_0x7f111a){if(_0x2786a2){return _0x2808db(_0x2786a2);}else{return _0x2800c5(_0x7f111a);}});});}exports['downloadTranscribe']=function(_0x44516d,_0x94e438,_0x5bf888){return db[_0x3fef('0x28')][_0x3fef('0x7b')]({'where':{'id':_0x44516d[_0x3fef('0x47')]['id']}})[_0x3fef('0x24')](handleEntityNotFound(_0x94e438))[_0x3fef('0x24')](function(_0x266575){if(_0x266575&&_0x266575[_0x3fef('0x8f')]){var _0x189841=_0x266575['fileText'];var _0x3caf1b=config[_0x3fef('0x90')]+_0x3fef('0x91')+_0x266575['id']+_0x3fef('0x92');if(fs['existsSync'](_0x3caf1b)){return _0x3caf1b;}return writeFile(_0x189841,_0x3caf1b)[_0x3fef('0x24')](function(){return _0x3caf1b;});}else{throw new db['Sequelize'][(_0x3fef('0x50'))](_0x3fef('0x93'));}})[_0x3fef('0x24')](function(_0x1f03ac){return _0x94e438[_0x3fef('0x52')](_0x1f03ac);})['catch'](handleError(_0x94e438));};
\ No newline at end of file
+var _0x9292=['fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','VoiceRecording','includeAll','include','rows','find','create','body','catch','params','describe','download','../../components/encryptor','uniqueid','value','secrets','recording','Sequelize','filename','extname','unlink','message','VoiceRecording\x20not\x20found','send','Not\x20found','downloads','sequelize','MD5','token','push','$and','%s.cypher','existsSync','decryptFile','ValidationError','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','end','listBuckets','createBucket','upload','TranscribeService','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','TranscriptionJob','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentRegion','CloudProvider','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','fieldName','type','model','format','query','keys','filters','intersection','attributes'];(function(_0xc69530,_0x57c174){var _0x148a92=function(_0x409d97){while(--_0x409d97){_0xc69530['push'](_0xc69530['shift']());}};_0x148a92(++_0x57c174);}(_0x9292,0xfb));var _0x2929=function(_0x56a662,_0x375295){_0x56a662=_0x56a662-0x0;var _0x40525b=_0x9292[_0x56a662];return _0x40525b;};'use strict';var emlformat=require(_0x2929('0x0'));var rimraf=require(_0x2929('0x1'));var zipdir=require(_0x2929('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2929('0x3'));var moment=require(_0x2929('0x4'));var BPromise=require(_0x2929('0x5'));var Mustache=require('mustache');var util=require(_0x2929('0x6'));var path=require(_0x2929('0x7'));var sox=require(_0x2929('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2929('0x9'));var squel=require(_0x2929('0xa'));var crypto=require(_0x2929('0xb'));var jsforce=require(_0x2929('0xc'));var deskjs=require(_0x2929('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2929('0xe'));var Papa=require('papaparse');var AWS=require(_0x2929('0xf'));var uuidv4=require(_0x2929('0x10'));var Redis=require(_0x2929('0x11'));var authService=require(_0x2929('0x12'));var qs=require(_0x2929('0x13'));var as=require(_0x2929('0x14'));var hardwareService=require(_0x2929('0x15'));var logger=require(_0x2929('0x16'))(_0x2929('0x17'));var utils=require('../../config/utils');var config=require(_0x2929('0x18'));var licenseUtil=require(_0x2929('0x19'));var db=require(_0x2929('0x1a'))['db'];function respondWithStatusCode(_0x2d92c4,_0x445d6c){_0x445d6c=_0x445d6c||0xcc;return function(_0x2868f0){if(_0x2868f0){return _0x2d92c4[_0x2929('0x1b')](_0x445d6c);}return _0x2d92c4[_0x2929('0x1c')](_0x445d6c)['end']();};}function respondWithResult(_0x532cae,_0x5db1b6){_0x5db1b6=_0x5db1b6||0xc8;return function(_0x5c0ec5){if(_0x5c0ec5){return _0x532cae['status'](_0x5db1b6)['json'](_0x5c0ec5);}};}function respondWithFilteredResult(_0x4779df,_0x560d2a){return function(_0x35776f){if(_0x35776f){var _0x50ce9d=typeof _0x560d2a[_0x2929('0x1d')]===_0x2929('0x1e')&&typeof _0x560d2a[_0x2929('0x1f')]==='undefined';var _0x7502b4=_0x35776f[_0x2929('0x20')];var _0x35fb94=_0x50ce9d?0x0:_0x560d2a[_0x2929('0x1d')];var _0x3f3839=_0x50ce9d?_0x35776f[_0x2929('0x20')]:_0x560d2a[_0x2929('0x1d')]+_0x560d2a[_0x2929('0x1f')];var _0x3c4962;if(_0x3f3839>=_0x7502b4){_0x3f3839=_0x7502b4;_0x3c4962=0xc8;}else{_0x3c4962=0xce;}_0x4779df[_0x2929('0x1c')](_0x3c4962);return _0x4779df[_0x2929('0x21')](_0x2929('0x22'),_0x35fb94+'-'+_0x3f3839+'/'+_0x7502b4)[_0x2929('0x23')](_0x35776f);}return null;};}function patchUpdates(_0x50c08d){return function(_0x5216a4){try{jsonpatch[_0x2929('0x24')](_0x5216a4,_0x50c08d,!![]);}catch(_0x212b4c){return BPromise[_0x2929('0x25')](_0x212b4c);}return _0x5216a4[_0x2929('0x26')]();};}function saveUpdates(_0x5ef89b,_0x2bda3d){return function(_0x4c5787){if(_0x4c5787){return _0x4c5787[_0x2929('0x27')](_0x5ef89b)[_0x2929('0x28')](function(_0x47a92b){return _0x47a92b;});}return null;};}function removeEntity(_0x44df64,_0x10e211){return function(_0x3a86ac){if(_0x3a86ac){return _0x3a86ac[_0x2929('0x29')]()['then'](function(){_0x44df64['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x46f59e,_0x30e739){return function(_0xb64591){if(!_0xb64591){_0x46f59e['sendStatus'](0x194);}return _0xb64591;};}function handleError(_0x4a6286,_0x3b6cb3){_0x3b6cb3=_0x3b6cb3||0x1f4;return function(_0x166e19){logger[_0x2929('0x2a')](_0x166e19[_0x2929('0x2b')]);if(_0x166e19[_0x2929('0x2c')]){delete _0x166e19[_0x2929('0x2c')];}_0x4a6286[_0x2929('0x1c')](_0x3b6cb3)['send'](_0x166e19);};}exports['index']=function(_0x4ce333,_0x17d325){var _0x3aaf26={},_0x15430f={},_0x12c07c={'count':0x0,'rows':[]};var _0x47a68f=_[_0x2929('0x2d')](db['VoiceRecording']['rawAttributes'],function(_0x3d91bf){return{'name':_0x3d91bf[_0x2929('0x2e')],'type':_0x3d91bf[_0x2929('0x2f')]['key']};});_0x15430f[_0x2929('0x30')]=_['differenceBy'](_[_0x2929('0x2d')](_0x47a68f,_0x2929('0x2c')),[_0x2929('0x31')]);_0x15430f[_0x2929('0x32')]=_[_0x2929('0x33')](_0x4ce333[_0x2929('0x32')]);_0x15430f[_0x2929('0x34')]=_[_0x2929('0x35')](_0x15430f[_0x2929('0x30')],_0x15430f[_0x2929('0x32')]);_0x3aaf26[_0x2929('0x36')]=_[_0x2929('0x35')](_0x15430f['model'],qs[_0x2929('0x37')](_0x4ce333[_0x2929('0x32')]['fields']));_0x3aaf26['attributes']=_0x3aaf26[_0x2929('0x36')][_0x2929('0x38')]?_0x3aaf26[_0x2929('0x36')]:_0x15430f['model'];if(!_0x4ce333[_0x2929('0x32')][_0x2929('0x39')](_0x2929('0x3a'))){_0x3aaf26[_0x2929('0x1f')]=qs['limit'](_0x4ce333[_0x2929('0x32')][_0x2929('0x1f')]);_0x3aaf26[_0x2929('0x1d')]=qs[_0x2929('0x1d')](_0x4ce333[_0x2929('0x32')][_0x2929('0x1d')]);}_0x3aaf26[_0x2929('0x3b')]=qs[_0x2929('0x3c')](_0x4ce333[_0x2929('0x32')][_0x2929('0x3c')]);_0x3aaf26[_0x2929('0x3d')]=qs[_0x2929('0x34')](_['pick'](_0x4ce333[_0x2929('0x32')],_0x15430f[_0x2929('0x34')]),_0x47a68f);if(_0x4ce333['query'][_0x2929('0x3e')]){_0x3aaf26[_0x2929('0x3d')]=_[_0x2929('0x3f')](_0x3aaf26[_0x2929('0x3d')],{'$or':_[_0x2929('0x2d')](_0x47a68f,function(_0x5f0725){if(_0x5f0725['type']!==_0x2929('0x40')){var _0x367956={};_0x367956[_0x5f0725[_0x2929('0x2c')]]={'$like':'%'+_0x4ce333[_0x2929('0x32')][_0x2929('0x3e')]+'%'};return _0x367956;}})});}_0x3aaf26=_[_0x2929('0x3f')]({},_0x3aaf26,_0x4ce333[_0x2929('0x41')]);var _0x5b32b0={'where':_0x3aaf26[_0x2929('0x3d')]};return db[_0x2929('0x42')][_0x2929('0x20')](_0x5b32b0)['then'](function(_0x26e96a){_0x12c07c[_0x2929('0x20')]=_0x26e96a;if(_0x4ce333[_0x2929('0x32')][_0x2929('0x43')]){_0x3aaf26[_0x2929('0x44')]=[{'all':!![]}];}return db[_0x2929('0x42')]['findAll'](_0x3aaf26);})[_0x2929('0x28')](function(_0x56db7a){_0x12c07c[_0x2929('0x45')]=_0x56db7a;return _0x12c07c;})[_0x2929('0x28')](respondWithFilteredResult(_0x17d325,_0x3aaf26))['catch'](handleError(_0x17d325,null));};exports['show']=function(_0x340414,_0x370112){var _0x4022a5={'raw':![],'where':{'id':_0x340414['params']['id']}},_0x33e481={};_0x33e481[_0x2929('0x30')]=_[_0x2929('0x33')](db['VoiceRecording']['rawAttributes']);_0x33e481[_0x2929('0x32')]=_[_0x2929('0x33')](_0x340414['query']);_0x33e481['filters']=_[_0x2929('0x35')](_0x33e481['model'],_0x33e481[_0x2929('0x32')]);_0x4022a5[_0x2929('0x36')]=_[_0x2929('0x35')](_0x33e481['model'],qs['fields'](_0x340414[_0x2929('0x32')]['fields']));_0x4022a5['attributes']=_0x4022a5[_0x2929('0x36')][_0x2929('0x38')]?_0x4022a5[_0x2929('0x36')]:_0x33e481[_0x2929('0x30')];if(_0x340414[_0x2929('0x32')][_0x2929('0x43')]){_0x4022a5[_0x2929('0x44')]=[{'all':!![]}];}_0x4022a5=_[_0x2929('0x3f')]({},_0x4022a5,_0x340414[_0x2929('0x41')]);return db['VoiceRecording'][_0x2929('0x46')](_0x4022a5)[_0x2929('0x28')](handleEntityNotFound(_0x370112,null))[_0x2929('0x28')](respondWithResult(_0x370112,null))['catch'](handleError(_0x370112,null));};exports[_0x2929('0x47')]=function(_0x578149,_0x465347){return db['VoiceRecording'][_0x2929('0x47')](_0x578149[_0x2929('0x48')],{})[_0x2929('0x28')](respondWithResult(_0x465347,0xc9))[_0x2929('0x49')](handleError(_0x465347,null));};exports[_0x2929('0x27')]=function(_0x2c48fc,_0x87c32){if(_0x2c48fc[_0x2929('0x48')]['id']){delete _0x2c48fc[_0x2929('0x48')]['id'];}return db[_0x2929('0x42')][_0x2929('0x46')]({'where':{'id':_0x2c48fc[_0x2929('0x4a')]['id']}})[_0x2929('0x28')](handleEntityNotFound(_0x87c32,null))[_0x2929('0x28')](saveUpdates(_0x2c48fc[_0x2929('0x48')],null))['then'](respondWithResult(_0x87c32,null))[_0x2929('0x49')](handleError(_0x87c32,null));};exports[_0x2929('0x4b')]=function(_0x41af9e,_0x4c6c58){return db[_0x2929('0x42')]['describe']()[_0x2929('0x28')](respondWithResult(_0x4c6c58,null))[_0x2929('0x49')](handleError(_0x4c6c58,null));};exports[_0x2929('0x4c')]=function(_0x2f7e71,_0xb81e7c,_0x361ebb){var _0x34fee6=require(_0x2929('0x4d'));var _0x616bfe=![];var _0x32e22f={};if(_0x2f7e71[_0x2929('0x32')][_0x2929('0x2f')]&&_0x2f7e71[_0x2929('0x32')][_0x2929('0x2f')]===_0x2929('0x4e')){_0x32e22f[_0x2929('0x4e')]=_0x2f7e71[_0x2929('0x4a')]['id'];}else{_0x32e22f['id']=_0x2f7e71[_0x2929('0x4a')]['id'];}return db[_0x2929('0x42')][_0x2929('0x46')]({'where':_0x32e22f,'attributes':['id',_0x2929('0x4f')],'raw':!![]})[_0x2929('0x28')](handleEntityNotFound(_0xb81e7c,null))['then'](function(_0x3a5b2e){if(_0x3a5b2e){var _0x1b3057=_0x3a5b2e[_0x2929('0x4f')];var _0x19f37a=util[_0x2929('0x31')]('%s.cypher',_0x1b3057);if(fs['existsSync'](_0x19f37a)){_0x616bfe=!![];return _0x34fee6['decryptFile'](_0x19f37a,_0x1b3057,config[_0x2929('0x50')][_0x2929('0x51')])['then'](function(){return _0x3a5b2e;});}return _0x3a5b2e;}})[_0x2929('0x28')](function(_0x21bd47){if(_0x21bd47){var _0x5c348f=_0x21bd47[_0x2929('0x4f')];if(!fs['existsSync'](_0x5c348f)){throw new db[(_0x2929('0x52'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x21bd47[_0x2929('0x53')]){return _0xb81e7c[_0x2929('0x4c')](_0x5c348f,_0x21bd47[_0x2929('0x53')]+path[_0x2929('0x54')](_0x5c348f),function(){if(_0x616bfe){fs[_0x2929('0x55')](_0x5c348f);}});}else{return _0xb81e7c['download'](_0x5c348f,function(_0x1d055f){if(_0x616bfe){fs['unlink'](_0x5c348f);}});}}})[_0x2929('0x49')](function(_0x5628f2){if(_0x5628f2[_0x2929('0x56')]===_0x2929('0x57')){_0xb81e7c[_0x2929('0x1c')](0x194)[_0x2929('0x58')](_0x2929('0x59'));}else{return handleError(_0xb81e7c,null);}});};exports[_0x2929('0x5a')]=function(_0x51ee2e,_0x3830cb,_0x24cdaa){var _0x499d8c=require(_0x2929('0x4d'));var _0x313f11=![];var _0x3a2a0d={'$and':[db[_0x2929('0x5b')][_0x2929('0x3d')](db['sequelize']['fn'](_0x2929('0x5c'),db[_0x2929('0x5b')]['col'](_0x2929('0x4e'))),_0x51ee2e[_0x2929('0x32')][_0x2929('0x5d')])]};if(_0x51ee2e[_0x2929('0x32')][_0x2929('0x2f')]&&_0x51ee2e['query'][_0x2929('0x2f')]==='uniqueid'){_0x3a2a0d['$and'][_0x2929('0x5e')]({'uniqueid':_0x51ee2e[_0x2929('0x4a')]['id']});}else{_0x3a2a0d[_0x2929('0x5f')]['push']({'id':_0x51ee2e['params']['id']});}return db[_0x2929('0x42')][_0x2929('0x46')]({'where':_0x3a2a0d,'attributes':['id',_0x2929('0x4f')],'raw':!![]})[_0x2929('0x28')](handleEntityNotFound(_0x3830cb,null))[_0x2929('0x28')](function(_0x373022){if(_0x373022){var _0x2c4a30=util['format'](_0x2929('0x60'),_0x373022[_0x2929('0x4f')]);if(fs[_0x2929('0x61')](_0x2c4a30)){_0x313f11=!![];return _0x499d8c[_0x2929('0x62')](_0x2c4a30,_0x373022[_0x2929('0x4f')],config[_0x2929('0x50')][_0x2929('0x51')])[_0x2929('0x28')](function(){return _0x373022;});}return _0x373022;}})[_0x2929('0x28')](function(_0x4b9a04){if(_0x4b9a04){if(!fs[_0x2929('0x61')](_0x4b9a04[_0x2929('0x4f')])){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))](_0x2929('0x57'));}if(_0x4b9a04[_0x2929('0x53')]){return _0x3830cb[_0x2929('0x4c')](_0x4b9a04['value'],_0x4b9a04[_0x2929('0x53')]+path[_0x2929('0x54')](_0x4b9a04[_0x2929('0x4f')]),function(){if(_0x313f11){fs[_0x2929('0x55')](_0x4b9a04['value']);}});}else{return _0x3830cb['download'](_0x4b9a04[_0x2929('0x4f')],function(_0x5f4177){if(_0x313f11){fs['unlink'](_0x4b9a04[_0x2929('0x4f')]);}});}}})[_0x2929('0x49')](handleError(_0x3830cb,null));};exports[_0x2929('0x29')]=function(_0x28ff64,_0x3e6b84){return db[_0x2929('0x42')][_0x2929('0x46')]({'where':{'id':_0x28ff64[_0x2929('0x4a')]['id']}})[_0x2929('0x28')](function(_0x54c6d9){if(_[_0x2929('0x64')](_0x54c6d9)){throw new ReferenceError('Entity\x20not\x20found');}return _0x54c6d9;})['then'](function(_0x2effa1){var _0x34ebd0=_0x2effa1[_0x2929('0x4f')];logger[_0x2929('0x65')](_0x2929('0x66'),_0x34ebd0);if(!_[_0x2929('0x64')](_0x2effa1['value'])&&fs[_0x2929('0x61')](_0x34ebd0)){logger[_0x2929('0x65')](_0x2929('0x67')+_0x34ebd0+_0x2929('0x68'));fs[_0x2929('0x69')](_0x34ebd0);}_0x34ebd0=_0x34ebd0+_0x2929('0x6a');if(!_[_0x2929('0x64')](_0x2effa1['value'])&&fs[_0x2929('0x61')](_0x34ebd0)){logger['info'](_0x2929('0x67')+_0x34ebd0+_0x2929('0x68'));fs[_0x2929('0x69')](_0x34ebd0);}return _0x2effa1;})['then'](function(_0x4f12e8){if(!_0x4f12e8)throw new InternalError();return _0x4f12e8[_0x2929('0x29')]();})[_0x2929('0x28')](function(){_0x3e6b84[_0x2929('0x1c')](0xcc)[_0x2929('0x6b')]();})[_0x2929('0x49')](handleError(_0x3e6b84,null));};function getBucketslist(_0x4c5d82,_0x44aefa,_0x52e430){return new Promise(function(_0x5f3651,_0x5e89c0){var _0xc6e8c=new AWS['S3']({'accessKeyId':_0x44aefa,'secretAccessKey':_0x4c5d82,'region':_0x52e430});_0xc6e8c[_0x2929('0x6c')]({},function(_0x259d18,_0x2ac4aa){if(_0x259d18){return _0x5e89c0(_0x259d18);}else{return _0x5f3651(_0x2ac4aa);}});});}function createBucket(_0x5e0884,_0x4e7dd0,_0x5d8e20,_0x2d81b4){return new Promise(function(_0x3d0ef1,_0x5947a2){var _0x264a2d=new AWS['S3']({'accessKeyId':_0x4e7dd0,'secretAccessKey':_0x5e0884,'region':_0x5d8e20});_0x264a2d[_0x2929('0x6d')]({'Bucket':_0x2d81b4},function(_0x546f13,_0xbd42c9){if(_0x546f13){return _0x5947a2(_0x546f13);}else{return _0x3d0ef1(_0xbd42c9);}});});}function uploadFile(_0x474cb7,_0x44c688,_0x5a885f,_0x3fe407,_0x440c7e,_0x5d99fb){return new Promise(function(_0x1317d5,_0x4e7fa3){var _0x549c8d=new AWS['S3']({'accessKeyId':_0x44c688,'secretAccessKey':_0x474cb7,'region':_0x5a885f});_0x549c8d[_0x2929('0x6e')]({'Bucket':_0x3fe407,'Key':_0x440c7e,'Body':_0x5d99fb},function(_0x4806fc,_0x3d84a3){if(_0x4806fc){return _0x4e7fa3(_0x4806fc);}else{return _0x1317d5(_0x3d84a3);}});});}function startTranscribe(_0x39dd4e,_0x4f881e,_0x1af928,_0x4ebbbc,_0x32307c,_0x4219be){return new Promise(function(_0x1bca56,_0x76b86b){var _0x3728f2=new AWS[(_0x2929('0x6f'))]({'accessKeyId':_0x4f881e,'secretAccessKey':_0x39dd4e,'region':_0x1af928});_0x3728f2['startTranscriptionJob']({'TranscriptionJobName':_0x4ebbbc,'LanguageCode':_0x32307c,'Media':{'MediaFileUri':_0x4219be}},function(_0x464c23,_0x480df4){if(_0x464c23){return _0x76b86b(_0x464c23);}else{return _0x1bca56(_0x480df4);}});});}function transcribe(_0x49558d,_0x395ad2,_0xbeabe7,_0x19346d,_0x5d737c,_0x146c75,_0xf6f574){return new Promise(function(_0x18ad8b,_0x133b85){var _0x412065={};logger[_0x2929('0x65')](util[_0x2929('0x31')](_0x2929('0x70'),_0x49558d,_0x5d737c));return uploadFile(_0x395ad2,_0xbeabe7,_0x19346d,_0x5d737c,path[_0x2929('0x71')](_0x146c75),fs[_0x2929('0x72')](_0x146c75))[_0x2929('0x28')](function(_0x5802f0){logger[_0x2929('0x65')](util[_0x2929('0x31')](_0x2929('0x73'),_0x49558d,_0x5d737c,_0x5802f0[_0x2929('0x74')]));_0x412065['bucket']=_0x5802f0['Bucket'];_0x412065['location']=_0x5802f0[_0x2929('0x74')];logger[_0x2929('0x65')](util[_0x2929('0x31')](_0x2929('0x75'),_0x49558d));return startTranscribe(_0x395ad2,_0xbeabe7,_0x19346d,uuidv4(),_0xf6f574,_0x5802f0[_0x2929('0x74')]);})[_0x2929('0x28')](function(_0x5a6a10){logger[_0x2929('0x65')](util['format'](_0x2929('0x76'),_0x49558d,_0x5a6a10['TranscriptionJob'][_0x2929('0x77')]));_0x412065['transcribeName']=_0x5a6a10[_0x2929('0x78')][_0x2929('0x77')];_0x412065[_0x2929('0x79')]=_0x5a6a10[_0x2929('0x78')][_0x2929('0x7a')];return _0x18ad8b(_0x412065);})[_0x2929('0x49')](function(_0x2ae696){return _0x133b85(_0x2ae696);});});}exports[_0x2929('0x7b')]=function(_0x13c98a,_0x2b6750,_0x2beb79){var _0xad9958;var _0x3a8732;var _0x476478;var _0x578ffd=require(_0x2929('0x4d'));return db[_0x2929('0x42')][_0x2929('0x7c')]({'where':{'id':_0x13c98a[_0x2929('0x4a')]['id']}})[_0x2929('0x28')](function(_0x2e4545){if(_0x2e4545){var _0xbb9866=util[_0x2929('0x31')]('%s.cypher',_0x2e4545[_0x2929('0x4f')]);if(fs[_0x2929('0x61')](_0xbb9866)){cypher=!![];return _0x578ffd[_0x2929('0x62')](_0xbb9866,_0x2e4545['value'],config[_0x2929('0x50')]['recording'])[_0x2929('0x28')](function(){return _0x2e4545;});}return _0x2e4545;}})[_0x2929('0x28')](function(_0x27b1e4){if(!_0x27b1e4){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))](_0x2929('0x7d'));}_0x3a8732=_0x27b1e4;return db[_0x2929('0x7e')][_0x2929('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x2b6750,null))[_0x2929('0x28')](function(_0x4afe25){if(_0x4afe25){_0xad9958=_0x4afe25;if(!_0xad9958[_0x2929('0x7f')]||!_0xad9958['transcribeAccountId']||!_0xad9958['transcribeRegion']||!_0xad9958[_0x2929('0x80')]||!_0xad9958[_0x2929('0x81')]){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))](_0x2929('0x82'));}if(_0x13c98a[_0x2929('0x48')][_0x2929('0x83')]&&(!_0xad9958[_0x2929('0x84')]||!_0xad9958['sentimentAccountId']||!_0xad9958[_0x2929('0x85')]||!_0xad9958[_0x2929('0x80')]||!_0xad9958[_0x2929('0x81')])){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x2929('0x86')][_0x2929('0x7c')]({'where':{'id':_0xad9958['transcribeAccountId']}});}})[_0x2929('0x28')](function(_0x44516b){if(!_0x44516b){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x44516b[_0x2929('0x87')]||!_0x44516b[_0x2929('0x88')]){throw new db[(_0x2929('0x52'))][(_0x2929('0x63'))]('Cloud\x20Provider\x20not\x20configured');}_0x476478=_0x44516b;return getBucketslist(_0x476478[_0x2929('0x87')],_0x476478[_0x2929('0x88')],_0xad9958['transcribeRegion']);})[_0x2929('0x28')](function(_0x52ead5){if(_0x52ead5&&_0x52ead5[_0x2929('0x89')]){var _0x409693=_['find'](_0x52ead5[_0x2929('0x89')],function(_0x77ab82){return _0x77ab82[_0x2929('0x8a')]===_0xad9958[_0x2929('0x81')];});if(!_0x409693){logger[_0x2929('0x65')](util['format'](_0x2929('0x8b'),_0x13c98a[_0x2929('0x4a')]['id'],_0xad9958[_0x2929('0x81')]));return createBucket(_0x476478[_0x2929('0x87')],_0x476478[_0x2929('0x88')],_0xad9958[_0x2929('0x8c')],_0xad9958['bucket']);}logger['info'](util['format'](_0x2929('0x8d'),_0x13c98a[_0x2929('0x4a')]['id'],_0xad9958[_0x2929('0x81')]));return;}})[_0x2929('0x28')](function(_0x264499){if(_0x3a8732['transcribeStatus']===_0x2929('0x8e')){return transcribe(_0x13c98a[_0x2929('0x4a')]['id'],_0x476478[_0x2929('0x87')],_0x476478['data2'],_0xad9958[_0x2929('0x8c')],_0xad9958[_0x2929('0x81')],_0x3a8732[_0x2929('0x4f')],_0xad9958[_0x2929('0x80')]);}else{logger[_0x2929('0x65')](util[_0x2929('0x31')](_0x2929('0x8f'),_0x13c98a['params']['id']));return{'transcribeStatus':_0x2929('0x90')};}})['then'](function(_0x578952){if(_0x578952){_0x578952['tempSentiment']=_0x13c98a['body']['runSentiment'];return _0x3a8732[_0x2929('0x91')](_0x578952);}})[_0x2929('0x28')](respondWithResult(_0x2b6750,null))['catch'](handleError(_0x2b6750,null));};function writeFile(_0x29843d,_0x114715){return new Promise(function(_0x38dd16,_0x447908){fs[_0x2929('0x92')](_0x114715,_0x29843d,function(_0x4c06e4,_0x46803b){if(_0x4c06e4){return _0x447908(_0x4c06e4);}else{return _0x38dd16(_0x46803b);}});});}exports[_0x2929('0x93')]=function(_0x3b06d8,_0x5ab243,_0x38ac88){return db[_0x2929('0x42')][_0x2929('0x7c')]({'where':{'id':_0x3b06d8['params']['id']}})[_0x2929('0x28')](handleEntityNotFound(_0x5ab243))[_0x2929('0x28')](function(_0x217548){if(_0x217548&&_0x217548[_0x2929('0x94')]){var _0x571456=_0x217548[_0x2929('0x94')];var _0x215505=config[_0x2929('0x95')]+_0x2929('0x96')+_0x217548['id']+_0x2929('0x97');if(fs['existsSync'](_0x215505)){return _0x215505;}return writeFile(_0x571456,_0x215505)[_0x2929('0x28')](function(){return _0x215505;});}else{throw new db['Sequelize'][(_0x2929('0x63'))](_0x2929('0x98'));}})[_0x2929('0x28')](function(_0x4c10d3){return _0x5ab243['download'](_0x4c10d3);})[_0x2929('0x49')](handleError(_0x5ab243));};
\ No newline at end of file
index ff170b2..8b207b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a2f=['define','voice_recordings','lodash','util','api','moment','request-promise','rimraf','./voiceRecording.attributes'];(function(_0x410b81,_0x871c4b){var _0x17e81e=function(_0x1106ac){while(--_0x1106ac){_0x410b81['push'](_0x410b81['shift']());}};_0x17e81e(++_0x871c4b);}(_0x5a2f,0x9b));var _0xf5a2=function(_0xa2fe91,_0x72207d){_0xa2fe91=_0xa2fe91-0x0;var _0x74235e=_0x5a2f[_0xa2fe91];return _0x74235e;};'use strict';var _=require(_0xf5a2('0x0'));var util=require(_0xf5a2('0x1'));var logger=require('../../config/logger')(_0xf5a2('0x2'));var moment=require(_0xf5a2('0x3'));var BPromise=require('bluebird');var rp=require(_0xf5a2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5a2('0x5'));var config=require('../../config/environment');var attributes=require(_0xf5a2('0x6'));module['exports']=function(_0x828239,_0xd5cc62){return _0x828239[_0xf5a2('0x7')]('VoiceRecording',attributes,{'tableName':_0xf5a2('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9f37=['exports','define','VoiceRecording','voice_recordings','uniqueid','lodash','util','api','request-promise','path','rimraf','./voiceRecording.attributes'];(function(_0x3d51f3,_0x4cf925){var _0x36a199=function(_0x3ba0ed){while(--_0x3ba0ed){_0x3d51f3['push'](_0x3d51f3['shift']());}};_0x36a199(++_0x4cf925);}(_0x9f37,0xd1));var _0x79f3=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x9f37[_0x2aec52];return _0x3b8835;};'use strict';var _=require(_0x79f3('0x0'));var util=require(_0x79f3('0x1'));var logger=require('../../config/logger')(_0x79f3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x79f3('0x3'));var fs=require('fs');var path=require(_0x79f3('0x4'));var rimraf=require(_0x79f3('0x5'));var config=require('../../config/environment');var attributes=require(_0x79f3('0x6'));module[_0x79f3('0x7')]=function(_0x594d87,_0x5db84b){return _0x594d87[_0x79f3('0x8')](_0x79f3('0x9'),attributes,{'tableName':_0x79f3('0xa'),'paranoid':![],'indexes':[{'name':_0x79f3('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 173a81f..50ea7f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a37=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateVoiceRecording','update','body','options','raw','where','attributes','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','VoiceRecording','create','existsSync','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted'];(function(_0x1bf7de,_0x1c373a){var _0xf1a88=function(_0xa2c962){while(--_0xa2c962){_0x1bf7de['push'](_0x1bf7de['shift']());}};_0xf1a88(++_0x1c373a);}(_0x1a37,0xb4));var _0x71a3=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x1a37[_0x599e60];return _0x468e19;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45050a,_0x231ea7,_0x2bb6a2){return new BPromise(function(_0x4a9ab2,_0x53b893){return client['request'](_0x45050a,_0x2bb6a2)['then'](function(_0x89da86){logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,_0x71a3('0xe'));logger[_0x71a3('0xf')](_0x71a3('0x10'),_0x231ea7,_0x71a3('0xe'),JSON[_0x71a3('0x11')](_0x89da86));if(_0x89da86['error']){if(_0x89da86['error']['code']===0x1f4){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x53b893(_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);}logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x4a9ab2(_0x89da86[_0x71a3('0x12')]['message']);}else{logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,'request\x20sent');_0x4a9ab2(_0x89da86['result'][_0x71a3('0x13')]);}})[_0x71a3('0x14')](function(_0xee797f){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0xee797f);_0x53b893(_0xee797f);});});}exports[_0x71a3('0x15')]=function(_0x5d4dee){var _0x656cd2=this;return new Promise(function(_0x27bfb4,_0x5b955a){return db['VoiceRecording'][_0x71a3('0x16')](_0x5d4dee[_0x71a3('0x17')],{'raw':_0x5d4dee[_0x71a3('0x18')]?_0x5d4dee[_0x71a3('0x18')][_0x71a3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d4dee['options']?_0x5d4dee[_0x71a3('0x18')][_0x71a3('0x1a')]||null:null,'attributes':_0x5d4dee[_0x71a3('0x18')]?_0x5d4dee[_0x71a3('0x18')][_0x71a3('0x1b')]||null:null,'limit':_0x5d4dee['options']?_0x5d4dee[_0x71a3('0x18')]['limit']||null:null})[_0x71a3('0x1c')](function(_0x35d1d4){logger[_0x71a3('0xc')](_0x71a3('0x15'),_0x5d4dee);logger[_0x71a3('0xf')](_0x71a3('0x15'),_0x5d4dee,JSON['stringify'](_0x35d1d4));_0x27bfb4(_0x35d1d4);})[_0x71a3('0x14')](function(_0x299d1d){logger[_0x71a3('0x12')](_0x71a3('0x15'),_0x299d1d[_0x71a3('0x13')],_0x5d4dee);_0x5b955a(_0x656cd2['error'](0x1f4,_0x299d1d[_0x71a3('0x13')]));});});};exports[_0x71a3('0x1d')]=function(_0x4c1a3d){var _0x412746=this;return new Promise(function(_0x515519,_0x46f1ff){var _0x2fd3b6=require(_0x71a3('0x1e'));var _0x35b5c7;return db[_0x71a3('0x1f')][_0x71a3('0x20')]({'attributes':['id',_0x71a3('0x21')],'where':{'id':0x1},'raw':!![]})[_0x71a3('0x1c')](function(_0x305eb1){_0x35b5c7=_0x305eb1;return db[_0x71a3('0x22')][_0x71a3('0x23')](_0x4c1a3d[_0x71a3('0x17')]);})['then'](function(_0x26fd9f){if(_0x35b5c7[_0x71a3('0x21')]&&fs[_0x71a3('0x24')](_0x26fd9f[_0x71a3('0x25')])){var _0x4a750c=util[_0x71a3('0x26')](_0x71a3('0x27'),_0x26fd9f[_0x71a3('0x25')]);return _0x2fd3b6[_0x71a3('0x28')](_0x26fd9f[_0x71a3('0x25')],_0x4a750c,config[_0x71a3('0x29')][_0x71a3('0x2a')])['then'](function(){fs[_0x71a3('0x2b')](_0x26fd9f[_0x71a3('0x25')]);logger[_0x71a3('0xc')](_0x71a3('0x2c'));return _0x26fd9f;});}return _0x26fd9f;})[_0x71a3('0x1c')](function(_0x73c8e7){logger[_0x71a3('0xc')](_0x71a3('0x1d'),_0x4c1a3d);logger[_0x71a3('0xf')](_0x71a3('0x1d'),_0x4c1a3d,JSON[_0x71a3('0x11')](_0x73c8e7));_0x515519(_0x73c8e7);})[_0x71a3('0x14')](function(_0x447b14){logger['error']('CreateVoiceRecording',_0x447b14[_0x71a3('0x13')],_0x4c1a3d);_0x46f1ff(_0x412746[_0x71a3('0x12')](0x1f4,_0x447b14['message']));});});};
\ No newline at end of file
+var _0xba34=['body','options','attributes','limit','CreateVoiceRecording','Setting','findOne','create','callRecordingEncryption','existsSync','value','format','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update'];(function(_0x235cea,_0x4c3504){var _0x15ee93=function(_0x5cb350){while(--_0x5cb350){_0x235cea['push'](_0x235cea['shift']());}};_0x15ee93(++_0x4c3504);}(_0xba34,0x119));var _0x4ba3=function(_0x40e3e0,_0x4f2f53){_0x40e3e0=_0x40e3e0-0x0;var _0x51ca7b=_0xba34[_0x40e3e0];return _0x51ca7b;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe5f99a,_0x585f2d,_0x6254fb){return new BPromise(function(_0x368eee,_0x2df7f3){return client[_0x4ba3('0xb')](_0xe5f99a,_0x6254fb)[_0x4ba3('0xc')](function(_0xcf1ec3){logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));logger[_0x4ba3('0x10')](_0x4ba3('0x11'),_0x585f2d,'request\x20sent',JSON[_0x4ba3('0x12')](_0xcf1ec3));if(_0xcf1ec3[_0x4ba3('0x13')]){if(_0xcf1ec3['error'][_0x4ba3('0x14')]===0x1f4){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3['error'][_0x4ba3('0x15')]);return _0x2df7f3(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}logger[_0x4ba3('0x13')](_0x4ba3('0xe'),_0x585f2d,_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);return _0x368eee(_0xcf1ec3[_0x4ba3('0x13')][_0x4ba3('0x15')]);}else{logger[_0x4ba3('0xd')](_0x4ba3('0xe'),_0x585f2d,_0x4ba3('0xf'));_0x368eee(_0xcf1ec3[_0x4ba3('0x16')][_0x4ba3('0x15')]);}})[_0x4ba3('0x17')](function(_0x1b7776){logger['error'](_0x4ba3('0xe'),_0x585f2d,_0x1b7776);_0x2df7f3(_0x1b7776);});});}exports[_0x4ba3('0x18')]=function(_0x5ff7ce){var _0x451c92=this;return new Promise(function(_0x556290,_0x2519bb){return db[_0x4ba3('0x19')][_0x4ba3('0x1a')](_0x5ff7ce[_0x4ba3('0x1b')],{'raw':_0x5ff7ce[_0x4ba3('0x1c')]?_0x5ff7ce[_0x4ba3('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5ff7ce['options']?_0x5ff7ce[_0x4ba3('0x1c')]['where']||null:null,'attributes':_0x5ff7ce[_0x4ba3('0x1c')]?_0x5ff7ce[_0x4ba3('0x1c')][_0x4ba3('0x1d')]||null:null,'limit':_0x5ff7ce[_0x4ba3('0x1c')]?_0x5ff7ce[_0x4ba3('0x1c')][_0x4ba3('0x1e')]||null:null})['then'](function(_0x143c78){logger[_0x4ba3('0xd')]('UpdateVoiceRecording',_0x5ff7ce);logger[_0x4ba3('0x10')]('UpdateVoiceRecording',_0x5ff7ce,JSON[_0x4ba3('0x12')](_0x143c78));_0x556290(_0x143c78);})[_0x4ba3('0x17')](function(_0x11a917){logger[_0x4ba3('0x13')](_0x4ba3('0x18'),_0x11a917[_0x4ba3('0x15')],_0x5ff7ce);_0x2519bb(_0x451c92[_0x4ba3('0x13')](0x1f4,_0x11a917[_0x4ba3('0x15')]));});});};exports[_0x4ba3('0x1f')]=function(_0x2e67a0){var _0x50c729=this;return new Promise(function(_0x252f37,_0x13c353){var _0x2311ed=require('../../components/encryptor');var _0x10537e;return db[_0x4ba3('0x20')][_0x4ba3('0x21')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0x4ba3('0xc')](function(_0x843276){_0x10537e=_0x843276;return db[_0x4ba3('0x19')][_0x4ba3('0x22')](_0x2e67a0['body']);})['then'](function(_0x38ef88){if(_0x10537e[_0x4ba3('0x23')]&&fs[_0x4ba3('0x24')](_0x38ef88[_0x4ba3('0x25')])){var _0x2cb5d5=util[_0x4ba3('0x26')]('%s.cypher',_0x38ef88[_0x4ba3('0x25')]);return _0x2311ed[_0x4ba3('0x27')](_0x38ef88[_0x4ba3('0x25')],_0x2cb5d5,config[_0x4ba3('0x28')][_0x4ba3('0x29')])[_0x4ba3('0xc')](function(){fs[_0x4ba3('0x2a')](_0x38ef88[_0x4ba3('0x25')]);logger[_0x4ba3('0xd')](_0x4ba3('0x2b'));return _0x38ef88;});}return _0x38ef88;})['then'](function(_0x5a453f){logger['info'](_0x4ba3('0x1f'),_0x2e67a0);logger[_0x4ba3('0x10')](_0x4ba3('0x1f'),_0x2e67a0,JSON[_0x4ba3('0x12')](_0x5a453f));_0x252f37(_0x5a453f);})[_0x4ba3('0x17')](function(_0x137f9b){logger[_0x4ba3('0x13')](_0x4ba3('0x1f'),_0x137f9b[_0x4ba3('0x15')],_0x2e67a0);_0x13c353(_0x50c729[_0x4ba3('0x13')](0x1f4,_0x137f9b[_0x4ba3('0x15')]));});});};
\ No newline at end of file
index feb955a..e876341 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55d4=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','create'];(function(_0x467f0a,_0x5f5c39){var _0x491da5=function(_0x2f20b1){while(--_0x2f20b1){_0x467f0a['push'](_0x467f0a['shift']());}};_0x491da5(++_0x5f5c39);}(_0x55d4,0x148));var _0x455d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x55d4[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0x455d('0x0'));var util=require(_0x455d('0x1'));var path=require(_0x455d('0x2'));var timeout=require(_0x455d('0x3'));var express=require(_0x455d('0x4'));var router=express['Router']();var fs_extra=require(_0x455d('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x455d('0x6'));var controller=require(_0x455d('0x7'));router[_0x455d('0x8')]('/',auth[_0x455d('0x9')](),controller['index']);router['get'](_0x455d('0xa'),auth[_0x455d('0x9')](),controller[_0x455d('0xb')]);router[_0x455d('0x8')](_0x455d('0xc'),auth[_0x455d('0x9')](),controller['show']);router['post']('/',auth[_0x455d('0x9')](),controller[_0x455d('0xd')]);router[_0x455d('0xe')](_0x455d('0xc'),auth[_0x455d('0x9')](),controller[_0x455d('0xf')]);router[_0x455d('0x10')](_0x455d('0xc'),auth[_0x455d('0x9')](),controller[_0x455d('0x11')]);module[_0x455d('0x12')]=router;
\ No newline at end of file
+var _0x8784=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','delete'];(function(_0x462069,_0x11c4f4){var _0x27f2de=function(_0x3cf4d5){while(--_0x3cf4d5){_0x462069['push'](_0x462069['shift']());}};_0x27f2de(++_0x11c4f4);}(_0x8784,0xd3));var _0x4878=function(_0x48a96f,_0x530059){_0x48a96f=_0x48a96f-0x0;var _0x3ff3ef=_0x8784[_0x48a96f];return _0x3ff3ef;};'use strict';var multer=require(_0x4878('0x0'));var util=require(_0x4878('0x1'));var path=require(_0x4878('0x2'));var timeout=require(_0x4878('0x3'));var express=require(_0x4878('0x4'));var router=express[_0x4878('0x5')]();var fs_extra=require(_0x4878('0x6'));var auth=require(_0x4878('0x7'));var interaction=require(_0x4878('0x8'));var config=require('../../config/environment');var controller=require(_0x4878('0x9'));router[_0x4878('0xa')]('/',auth[_0x4878('0xb')](),controller[_0x4878('0xc')]);router[_0x4878('0xa')](_0x4878('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x4878('0xa')]('/:id',auth[_0x4878('0xb')](),controller[_0x4878('0xe')]);router[_0x4878('0xf')]('/',auth[_0x4878('0xb')](),controller[_0x4878('0x10')]);router[_0x4878('0x11')]('/:id',auth[_0x4878('0xb')](),controller[_0x4878('0x12')]);router[_0x4878('0x13')]('/:id',auth[_0x4878('0xb')](),controller['destroy']);module[_0x4878('0x14')]=router;
\ No newline at end of file
index cff1151..10e7e13 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcce7=['Yes','moment','blind','STRING'];(function(_0x4803be,_0x18c257){var _0x926742=function(_0x2e9d42){while(--_0x2e9d42){_0x4803be['push'](_0x4803be['shift']());}};_0x926742(++_0x18c257);}(_0xcce7,0x1bd));var _0x7cce=function(_0x2d7e2d,_0x3ab06e){_0x2d7e2d=_0x2d7e2d-0x0;var _0x2c6252=_0xcce7[_0x2d7e2d];return _0x2c6252;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x7cce('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x7cce('0x1'),'attended')},'result':{'type':Sequelize[_0x7cce('0x2')]},'transfererchannel':{'type':Sequelize[_0x7cce('0x2')]},'transferercalleridnum':{'type':Sequelize[_0x7cce('0x2')]},'transferercalleridname':{'type':Sequelize[_0x7cce('0x2')]},'transfererconnectedlinenum':{'type':Sequelize[_0x7cce('0x2')]},'transfererconnectedlinename':{'type':Sequelize[_0x7cce('0x2')]},'transfereraccountcode':{'type':Sequelize[_0x7cce('0x2')]},'transferercontext':{'type':Sequelize[_0x7cce('0x2')]},'transfererexten':{'type':Sequelize[_0x7cce('0x2')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x7cce('0x2')]},'transfereecalleridnum':{'type':Sequelize[_0x7cce('0x2')]},'transfereecalleridname':{'type':Sequelize[_0x7cce('0x2')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x7cce('0x2')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x7cce('0x2')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x7cce('0x2')]},'isexternal':{'type':Sequelize['ENUM'](_0x7cce('0x3'),'No')},'context':{'type':Sequelize[_0x7cce('0x2')]},'extension':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd801=['ENUM','blind','attended','STRING','moment','exports'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd801,0xe8));var _0x1d80=function(_0x5738d7,_0x424f69){_0x5738d7=_0x5738d7-0x0;var _0x19dd9c=_0xd801[_0x5738d7];return _0x19dd9c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1d80('0x0'));module[_0x1d80('0x1')]={'type':{'type':Sequelize[_0x1d80('0x2')](_0x1d80('0x3'),_0x1d80('0x4'))},'result':{'type':Sequelize[_0x1d80('0x5')]},'transfererchannel':{'type':Sequelize[_0x1d80('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x1d80('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1d80('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x1d80('0x5')]},'transferercontext':{'type':Sequelize[_0x1d80('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x1d80('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x1d80('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1d80('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1d80('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x1d80('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x1d80('0x5')]},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x1d80('0x5')]}};
\ No newline at end of file
index 7ec1719..d6a4dae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe63c=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','VIRTUAL','merge','VoiceTransferReport','includeAll','include','findAll','rows','catch','show','params','length','options','update','find','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware'];(function(_0x4506ec,_0x44543d){var _0x5edc22=function(_0x25d762){while(--_0x25d762){_0x4506ec['push'](_0x4506ec['shift']());}};_0x5edc22(++_0x44543d);}(_0xe63c,0xc3));var _0xce63=function(_0x2ce447,_0x2b3f3b){_0x2ce447=_0x2ce447-0x0;var _0x564b8b=_0xe63c[_0x2ce447];return _0x564b8b;};'use strict';var emlformat=require(_0xce63('0x0'));var rimraf=require(_0xce63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xce63('0x2'));var rp=require(_0xce63('0x3'));var moment=require(_0xce63('0x4'));var BPromise=require(_0xce63('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xce63('0x6'));var csv=require('to-csv');var ejs=require(_0xce63('0x7'));var fs=require('fs');var fs_extra=require(_0xce63('0x8'));var _=require('lodash');var squel=require(_0xce63('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xce63('0xa'));var toCsv=require('to-csv');var querystring=require(_0xce63('0xb'));var Papa=require(_0xce63('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xce63('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xce63('0xe'));var logger=require(_0xce63('0xf'))(_0xce63('0x10'));var utils=require('../../config/utils');var config=require(_0xce63('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xce63('0x12'))['db'];function respondWithStatusCode(_0x421554,_0xc6324b){_0xc6324b=_0xc6324b||0xcc;return function(_0x3b3158){if(_0x3b3158){return _0x421554[_0xce63('0x13')](_0xc6324b);}return _0x421554['status'](_0xc6324b)[_0xce63('0x14')]();};}function respondWithResult(_0x531853,_0x5d316a){_0x5d316a=_0x5d316a||0xc8;return function(_0x4f7233){if(_0x4f7233){return _0x531853[_0xce63('0x15')](_0x5d316a)['json'](_0x4f7233);}};}function respondWithFilteredResult(_0x5125c0,_0x1462d1){return function(_0x3dcdf1){if(_0x3dcdf1){var _0x1ec21c=typeof _0x1462d1[_0xce63('0x16')]==='undefined'&&typeof _0x1462d1[_0xce63('0x17')]===_0xce63('0x18');var _0x5806f1=_0x3dcdf1[_0xce63('0x19')];var _0x59f0ff=_0x1ec21c?0x0:_0x1462d1[_0xce63('0x16')];var _0x5ca0eb=_0x1ec21c?_0x3dcdf1['count']:_0x1462d1[_0xce63('0x16')]+_0x1462d1['limit'];var _0x2c3473;if(_0x5ca0eb>=_0x5806f1){_0x5ca0eb=_0x5806f1;_0x2c3473=0xc8;}else{_0x2c3473=0xce;}_0x5125c0['status'](_0x2c3473);return _0x5125c0[_0xce63('0x1a')](_0xce63('0x1b'),_0x59f0ff+'-'+_0x5ca0eb+'/'+_0x5806f1)[_0xce63('0x1c')](_0x3dcdf1);}return null;};}function patchUpdates(_0x31c22e){return function(_0x126c37){try{jsonpatch[_0xce63('0x1d')](_0x126c37,_0x31c22e,!![]);}catch(_0x17efd5){return BPromise[_0xce63('0x1e')](_0x17efd5);}return _0x126c37[_0xce63('0x1f')]();};}function saveUpdates(_0x48d009,_0x404ee8){return function(_0x1bc991){if(_0x1bc991){return _0x1bc991['update'](_0x48d009)['then'](function(_0x166c5e){return _0x166c5e;});}return null;};}function removeEntity(_0x1e05a9,_0x59378e){return function(_0x1807e3){if(_0x1807e3){return _0x1807e3['destroy']()[_0xce63('0x20')](function(){_0x1e05a9[_0xce63('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x26ca7f,_0x5041c4){return function(_0xc044d5){if(!_0xc044d5){_0x26ca7f[_0xce63('0x13')](0x194);}return _0xc044d5;};}function handleError(_0x416306,_0x5e152f){_0x5e152f=_0x5e152f||0x1f4;return function(_0x84d5b){logger[_0xce63('0x21')](_0x84d5b[_0xce63('0x22')]);if(_0x84d5b['name']){delete _0x84d5b[_0xce63('0x23')];}_0x416306['status'](_0x5e152f)['send'](_0x84d5b);};}exports[_0xce63('0x24')]=function(_0x1cee10,_0x42aeea){var _0x1abac1={},_0x2f098e={},_0x1bc448={'count':0x0,'rows':[]};var _0x55dcb0=_[_0xce63('0x25')](db['VoiceTransferReport'][_0xce63('0x26')],function(_0x5d432e){return{'name':_0x5d432e[_0xce63('0x27')],'type':_0x5d432e['type'][_0xce63('0x28')]};});_0x2f098e[_0xce63('0x29')]=_['map'](_0x55dcb0,'name');_0x2f098e[_0xce63('0x2a')]=_[_0xce63('0x2b')](_0x1cee10['query']);_0x2f098e['filters']=_[_0xce63('0x2c')](_0x2f098e[_0xce63('0x29')],_0x2f098e['query']);_0x1abac1[_0xce63('0x2d')]=_['intersection'](_0x2f098e[_0xce63('0x29')],qs[_0xce63('0x2e')](_0x1cee10['query'][_0xce63('0x2e')]));_0x1abac1[_0xce63('0x2d')]=_0x1abac1[_0xce63('0x2d')]['length']?_0x1abac1['attributes']:_0x2f098e[_0xce63('0x29')];if(!_0x1cee10[_0xce63('0x2a')][_0xce63('0x2f')](_0xce63('0x30'))){_0x1abac1[_0xce63('0x17')]=qs[_0xce63('0x17')](_0x1cee10[_0xce63('0x2a')]['limit']);_0x1abac1[_0xce63('0x16')]=qs[_0xce63('0x16')](_0x1cee10[_0xce63('0x2a')][_0xce63('0x16')]);}_0x1abac1['order']=qs['sort'](_0x1cee10[_0xce63('0x2a')][_0xce63('0x31')]);_0x1abac1['where']=qs[_0xce63('0x32')](_['pick'](_0x1cee10['query'],_0x2f098e[_0xce63('0x32')]),_0x55dcb0);if(_0x1cee10[_0xce63('0x2a')][_0xce63('0x33')]){_0x1abac1[_0xce63('0x34')]=_['merge'](_0x1abac1['where'],{'$or':_['map'](_0x55dcb0,function(_0x50e389){if(_0x50e389['type']!==_0xce63('0x35')){var _0x391818={};_0x391818[_0x50e389['name']]={'$like':'%'+_0x1cee10[_0xce63('0x2a')][_0xce63('0x33')]+'%'};return _0x391818;}})});}_0x1abac1=_[_0xce63('0x36')]({},_0x1abac1,_0x1cee10['options']);var _0xe9c5c5={'where':_0x1abac1[_0xce63('0x34')]};return db[_0xce63('0x37')][_0xce63('0x19')](_0xe9c5c5)[_0xce63('0x20')](function(_0x6ed4cc){_0x1bc448[_0xce63('0x19')]=_0x6ed4cc;if(_0x1cee10['query'][_0xce63('0x38')]){_0x1abac1[_0xce63('0x39')]=[{'all':!![]}];}return db[_0xce63('0x37')][_0xce63('0x3a')](_0x1abac1);})['then'](function(_0x20dfcb){_0x1bc448[_0xce63('0x3b')]=_0x20dfcb;return _0x1bc448;})[_0xce63('0x20')](respondWithFilteredResult(_0x42aeea,_0x1abac1))[_0xce63('0x3c')](handleError(_0x42aeea,null));};exports[_0xce63('0x3d')]=function(_0x3c2bd5,_0x5985b9){var _0x37d411={'raw':!![],'where':{'id':_0x3c2bd5[_0xce63('0x3e')]['id']}},_0x459c9d={};_0x459c9d[_0xce63('0x29')]=_[_0xce63('0x2b')](db['VoiceTransferReport']['rawAttributes']);_0x459c9d['query']=_['keys'](_0x3c2bd5[_0xce63('0x2a')]);_0x459c9d[_0xce63('0x32')]=_[_0xce63('0x2c')](_0x459c9d['model'],_0x459c9d[_0xce63('0x2a')]);_0x37d411[_0xce63('0x2d')]=_[_0xce63('0x2c')](_0x459c9d[_0xce63('0x29')],qs['fields'](_0x3c2bd5[_0xce63('0x2a')][_0xce63('0x2e')]));_0x37d411[_0xce63('0x2d')]=_0x37d411[_0xce63('0x2d')][_0xce63('0x3f')]?_0x37d411[_0xce63('0x2d')]:_0x459c9d[_0xce63('0x29')];if(_0x3c2bd5[_0xce63('0x2a')][_0xce63('0x38')]){_0x37d411[_0xce63('0x39')]=[{'all':!![]}];}_0x37d411=_['merge']({},_0x37d411,_0x3c2bd5[_0xce63('0x40')]);return db[_0xce63('0x37')]['find'](_0x37d411)[_0xce63('0x20')](handleEntityNotFound(_0x5985b9,null))['then'](respondWithResult(_0x5985b9,null))[_0xce63('0x3c')](handleError(_0x5985b9,null));};exports['create']=function(_0x130d21,_0x207155){return db[_0xce63('0x37')]['create'](_0x130d21['body'],{})[_0xce63('0x20')](respondWithResult(_0x207155,0xc9))[_0xce63('0x3c')](handleError(_0x207155,null));};exports[_0xce63('0x41')]=function(_0x43185a,_0x5d02f6){if(_0x43185a['body']['id']){delete _0x43185a['body']['id'];}return db[_0xce63('0x37')][_0xce63('0x42')]({'where':{'id':_0x43185a['params']['id']}})[_0xce63('0x20')](handleEntityNotFound(_0x5d02f6,null))['then'](saveUpdates(_0x43185a[_0xce63('0x43')],null))[_0xce63('0x20')](respondWithResult(_0x5d02f6,null))[_0xce63('0x3c')](handleError(_0x5d02f6,null));};exports[_0xce63('0x44')]=function(_0xaca72c,_0x379325){return db[_0xce63('0x37')][_0xce63('0x42')]({'where':{'id':_0xaca72c['params']['id']}})[_0xce63('0x20')](handleEntityNotFound(_0x379325,null))[_0xce63('0x20')](removeEntity(_0x379325,null))[_0xce63('0x3c')](handleError(_0x379325,null));};exports[_0xce63('0x45')]=function(_0x24f7a8,_0x399d34){return db[_0xce63('0x37')][_0xce63('0x45')]()[_0xce63('0x20')](respondWithResult(_0x399d34,null))[_0xce63('0x3c')](handleError(_0x399d34,null));};
\ No newline at end of file
+var _0x2931=['jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','destroy','then','error','stack','name','send','map','VoiceTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x3b9d5f,_0x2e9039){var _0x39924e=function(_0x5752ee){while(--_0x5752ee){_0x3b9d5f['push'](_0x3b9d5f['shift']());}};_0x39924e(++_0x2e9039);}(_0x2931,0x110));var _0x1293=function(_0x50be1c,_0x494b89){_0x50be1c=_0x50be1c-0x0;var _0x4e2133=_0x2931[_0x50be1c];return _0x4e2133;};'use strict';var emlformat=require(_0x1293('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1293('0x1'));var jsonpatch=require(_0x1293('0x2'));var rp=require(_0x1293('0x3'));var moment=require(_0x1293('0x4'));var BPromise=require(_0x1293('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1293('0x6'));var ejs=require(_0x1293('0x7'));var fs=require('fs');var fs_extra=require(_0x1293('0x8'));var _=require(_0x1293('0x9'));var squel=require(_0x1293('0xa'));var crypto=require(_0x1293('0xb'));var jsforce=require(_0x1293('0xc'));var deskjs=require(_0x1293('0xd'));var toCsv=require(_0x1293('0x6'));var querystring=require(_0x1293('0xe'));var Papa=require(_0x1293('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1293('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1293('0x11'))(_0x1293('0x12'));var utils=require('../../config/utils');var config=require(_0x1293('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1293('0x14'))['db'];function respondWithStatusCode(_0x55fd35,_0x2c98e7){_0x2c98e7=_0x2c98e7||0xcc;return function(_0x1a08dd){if(_0x1a08dd){return _0x55fd35[_0x1293('0x15')](_0x2c98e7);}return _0x55fd35[_0x1293('0x16')](_0x2c98e7)[_0x1293('0x17')]();};}function respondWithResult(_0x5b0569,_0x32d163){_0x32d163=_0x32d163||0xc8;return function(_0x38c039){if(_0x38c039){return _0x5b0569['status'](_0x32d163)[_0x1293('0x18')](_0x38c039);}};}function respondWithFilteredResult(_0x376ef0,_0x46cfb4){return function(_0xb168bb){if(_0xb168bb){var _0x11deb8=typeof _0x46cfb4[_0x1293('0x19')]===_0x1293('0x1a')&&typeof _0x46cfb4['limit']==='undefined';var _0x14f9bb=_0xb168bb[_0x1293('0x1b')];var _0x2a4e18=_0x11deb8?0x0:_0x46cfb4['offset'];var _0x26b216=_0x11deb8?_0xb168bb[_0x1293('0x1b')]:_0x46cfb4[_0x1293('0x19')]+_0x46cfb4[_0x1293('0x1c')];var _0x5a2431;if(_0x26b216>=_0x14f9bb){_0x26b216=_0x14f9bb;_0x5a2431=0xc8;}else{_0x5a2431=0xce;}_0x376ef0[_0x1293('0x16')](_0x5a2431);return _0x376ef0[_0x1293('0x1d')]('Content-Range',_0x2a4e18+'-'+_0x26b216+'/'+_0x14f9bb)[_0x1293('0x18')](_0xb168bb);}return null;};}function patchUpdates(_0x58d872){return function(_0x4b6a24){try{jsonpatch['apply'](_0x4b6a24,_0x58d872,!![]);}catch(_0xb0a0cf){return BPromise[_0x1293('0x1e')](_0xb0a0cf);}return _0x4b6a24[_0x1293('0x1f')]();};}function saveUpdates(_0x38d20d,_0x403e07){return function(_0x54c983){if(_0x54c983){return _0x54c983[_0x1293('0x20')](_0x38d20d)['then'](function(_0x58224a){return _0x58224a;});}return null;};}function removeEntity(_0x4479cb,_0x3ea643){return function(_0x93f032){if(_0x93f032){return _0x93f032[_0x1293('0x21')]()[_0x1293('0x22')](function(){_0x4479cb['status'](0xcc)[_0x1293('0x17')]();});}};}function handleEntityNotFound(_0x29383a,_0x19ba71){return function(_0x16a18b){if(!_0x16a18b){_0x29383a[_0x1293('0x15')](0x194);}return _0x16a18b;};}function handleError(_0x281118,_0x4b462f){_0x4b462f=_0x4b462f||0x1f4;return function(_0x21b7d3){logger[_0x1293('0x23')](_0x21b7d3[_0x1293('0x24')]);if(_0x21b7d3[_0x1293('0x25')]){delete _0x21b7d3[_0x1293('0x25')];}_0x281118[_0x1293('0x16')](_0x4b462f)[_0x1293('0x26')](_0x21b7d3);};}exports['index']=function(_0x5c80be,_0x258253){var _0xe6a9a={},_0x30c879={},_0x72c1d1={'count':0x0,'rows':[]};var _0x2f1b34=_[_0x1293('0x27')](db[_0x1293('0x28')][_0x1293('0x29')],function(_0x1f0220){return{'name':_0x1f0220[_0x1293('0x2a')],'type':_0x1f0220['type'][_0x1293('0x2b')]};});_0x30c879[_0x1293('0x2c')]=_[_0x1293('0x27')](_0x2f1b34,_0x1293('0x25'));_0x30c879[_0x1293('0x2d')]=_[_0x1293('0x2e')](_0x5c80be[_0x1293('0x2d')]);_0x30c879['filters']=_[_0x1293('0x2f')](_0x30c879['model'],_0x30c879[_0x1293('0x2d')]);_0xe6a9a[_0x1293('0x30')]=_[_0x1293('0x2f')](_0x30c879['model'],qs[_0x1293('0x31')](_0x5c80be[_0x1293('0x2d')][_0x1293('0x31')]));_0xe6a9a[_0x1293('0x30')]=_0xe6a9a[_0x1293('0x30')][_0x1293('0x32')]?_0xe6a9a[_0x1293('0x30')]:_0x30c879[_0x1293('0x2c')];if(!_0x5c80be['query'][_0x1293('0x33')](_0x1293('0x34'))){_0xe6a9a[_0x1293('0x1c')]=qs[_0x1293('0x1c')](_0x5c80be[_0x1293('0x2d')][_0x1293('0x1c')]);_0xe6a9a['offset']=qs[_0x1293('0x19')](_0x5c80be[_0x1293('0x2d')]['offset']);}_0xe6a9a[_0x1293('0x35')]=qs[_0x1293('0x36')](_0x5c80be[_0x1293('0x2d')][_0x1293('0x36')]);_0xe6a9a[_0x1293('0x37')]=qs['filters'](_['pick'](_0x5c80be['query'],_0x30c879[_0x1293('0x38')]),_0x2f1b34);if(_0x5c80be[_0x1293('0x2d')]['filter']){_0xe6a9a[_0x1293('0x37')]=_[_0x1293('0x39')](_0xe6a9a[_0x1293('0x37')],{'$or':_['map'](_0x2f1b34,function(_0x2e33ed){if(_0x2e33ed['type']!==_0x1293('0x3a')){var _0x3ed4a9={};_0x3ed4a9[_0x2e33ed[_0x1293('0x25')]]={'$like':'%'+_0x5c80be[_0x1293('0x2d')]['filter']+'%'};return _0x3ed4a9;}})});}_0xe6a9a=_['merge']({},_0xe6a9a,_0x5c80be[_0x1293('0x3b')]);var _0x3b88e6={'where':_0xe6a9a[_0x1293('0x37')]};return db[_0x1293('0x28')][_0x1293('0x1b')](_0x3b88e6)['then'](function(_0x218738){_0x72c1d1[_0x1293('0x1b')]=_0x218738;if(_0x5c80be[_0x1293('0x2d')][_0x1293('0x3c')]){_0xe6a9a[_0x1293('0x3d')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x1293('0x3e')](_0xe6a9a);})['then'](function(_0xf6fe80){_0x72c1d1[_0x1293('0x3f')]=_0xf6fe80;return _0x72c1d1;})['then'](respondWithFilteredResult(_0x258253,_0xe6a9a))[_0x1293('0x40')](handleError(_0x258253,null));};exports[_0x1293('0x41')]=function(_0xa1c1df,_0x456ef5){var _0x19dcf2={'raw':!![],'where':{'id':_0xa1c1df[_0x1293('0x42')]['id']}},_0x435b5f={};_0x435b5f['model']=_[_0x1293('0x2e')](db['VoiceTransferReport']['rawAttributes']);_0x435b5f[_0x1293('0x2d')]=_[_0x1293('0x2e')](_0xa1c1df['query']);_0x435b5f['filters']=_[_0x1293('0x2f')](_0x435b5f['model'],_0x435b5f[_0x1293('0x2d')]);_0x19dcf2[_0x1293('0x30')]=_['intersection'](_0x435b5f[_0x1293('0x2c')],qs[_0x1293('0x31')](_0xa1c1df[_0x1293('0x2d')][_0x1293('0x31')]));_0x19dcf2['attributes']=_0x19dcf2[_0x1293('0x30')][_0x1293('0x32')]?_0x19dcf2[_0x1293('0x30')]:_0x435b5f[_0x1293('0x2c')];if(_0xa1c1df['query'][_0x1293('0x3c')]){_0x19dcf2[_0x1293('0x3d')]=[{'all':!![]}];}_0x19dcf2=_[_0x1293('0x39')]({},_0x19dcf2,_0xa1c1df[_0x1293('0x3b')]);return db[_0x1293('0x28')][_0x1293('0x43')](_0x19dcf2)[_0x1293('0x22')](handleEntityNotFound(_0x456ef5,null))[_0x1293('0x22')](respondWithResult(_0x456ef5,null))['catch'](handleError(_0x456ef5,null));};exports[_0x1293('0x44')]=function(_0x3a2454,_0x445d90){return db[_0x1293('0x28')][_0x1293('0x44')](_0x3a2454['body'],{})[_0x1293('0x22')](respondWithResult(_0x445d90,0xc9))[_0x1293('0x40')](handleError(_0x445d90,null));};exports[_0x1293('0x20')]=function(_0x5479c1,_0x22ea67){if(_0x5479c1[_0x1293('0x45')]['id']){delete _0x5479c1['body']['id'];}return db[_0x1293('0x28')][_0x1293('0x43')]({'where':{'id':_0x5479c1[_0x1293('0x42')]['id']}})[_0x1293('0x22')](handleEntityNotFound(_0x22ea67,null))[_0x1293('0x22')](saveUpdates(_0x5479c1[_0x1293('0x45')],null))['then'](respondWithResult(_0x22ea67,null))['catch'](handleError(_0x22ea67,null));};exports[_0x1293('0x21')]=function(_0x2f6f75,_0x6f8d8){return db['VoiceTransferReport'][_0x1293('0x43')]({'where':{'id':_0x2f6f75[_0x1293('0x42')]['id']}})[_0x1293('0x22')](handleEntityNotFound(_0x6f8d8,null))[_0x1293('0x22')](removeEntity(_0x6f8d8,null))[_0x1293('0x40')](handleError(_0x6f8d8,null));};exports[_0x1293('0x46')]=function(_0x35073a,_0x2046f1){return db[_0x1293('0x28')][_0x1293('0x46')]()[_0x1293('0x22')](respondWithResult(_0x2046f1,null))['catch'](handleError(_0x2046f1,null));};
\ No newline at end of file
index 2ae6fa4..72a1b7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8137=['./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x4d6945,_0x49e051){var _0x4f506a=function(_0x31a5d2){while(--_0x31a5d2){_0x4d6945['push'](_0x4d6945['shift']());}};_0x4f506a(++_0x49e051);}(_0x8137,0x190));var _0x7813=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x8137[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x7813('0x0'));var util=require(_0x7813('0x1'));var logger=require(_0x7813('0x2'))(_0x7813('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7813('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7813('0x5'));var config=require(_0x7813('0x6'));var attributes=require(_0x7813('0x7'));module[_0x7813('0x8')]=function(_0x1fd205,_0x4a2bd6){return _0x1fd205[_0x7813('0x9')](_0x7813('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe143=['rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','util','../../config/logger','api','bluebird'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xe143,0x1d2));var _0x3e14=function(_0x33f5b3,_0x4a8e4f){_0x33f5b3=_0x33f5b3-0x0;var _0x40597c=_0xe143[_0x33f5b3];return _0x40597c;};'use strict';var _=require('lodash');var util=require(_0x3e14('0x0'));var logger=require(_0x3e14('0x1'))(_0x3e14('0x2'));var moment=require('moment');var BPromise=require(_0x3e14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3e14('0x4'));var config=require(_0x3e14('0x5'));var attributes=require(_0x3e14('0x6'));module['exports']=function(_0x36969c,_0x239492){return _0x36969c[_0x3e14('0x7')](_0x3e14('0x8'),attributes,{'tableName':_0x3e14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9a99dcb..50e79d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa91=['debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0xaa91,0xd6));var _0x1aa9=function(_0x451a51,_0xca0201){_0x451a51=_0x451a51-0x0;var _0x33689f=_0xaa91[_0x451a51];return _0x33689f;};'use strict';var _=require(_0x1aa9('0x0'));var util=require(_0x1aa9('0x1'));var moment=require(_0x1aa9('0x2'));var BPromise=require(_0x1aa9('0x3'));var rs=require(_0x1aa9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1aa9('0x5'))['db'];var utils=require(_0x1aa9('0x6'));var logger=require(_0x1aa9('0x7'))(_0x1aa9('0x8'));var config=require(_0x1aa9('0x9'));var jayson=require(_0x1aa9('0xa'));var client=jayson[_0x1aa9('0xb')][_0x1aa9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52a1dc,_0x241f1b,_0x1f741f){return new BPromise(function(_0x3f7d1e,_0x8aa462){return client[_0x1aa9('0xd')](_0x52a1dc,_0x1f741f)[_0x1aa9('0xe')](function(_0x4bdf73){logger[_0x1aa9('0xf')](_0x1aa9('0x10'),_0x241f1b,_0x1aa9('0x11'));logger[_0x1aa9('0x12')](_0x1aa9('0x13'),_0x241f1b,_0x1aa9('0x11'),JSON['stringify'](_0x4bdf73));if(_0x4bdf73[_0x1aa9('0x14')]){if(_0x4bdf73[_0x1aa9('0x14')][_0x1aa9('0x15')]===0x1f4){logger[_0x1aa9('0x14')](_0x1aa9('0x10'),_0x241f1b,_0x4bdf73[_0x1aa9('0x14')][_0x1aa9('0x16')]);return _0x8aa462(_0x4bdf73[_0x1aa9('0x14')][_0x1aa9('0x16')]);}logger[_0x1aa9('0x14')](_0x1aa9('0x10'),_0x241f1b,_0x4bdf73[_0x1aa9('0x14')]['message']);return _0x3f7d1e(_0x4bdf73[_0x1aa9('0x14')][_0x1aa9('0x16')]);}else{logger[_0x1aa9('0xf')](_0x1aa9('0x10'),_0x241f1b,_0x1aa9('0x11'));_0x3f7d1e(_0x4bdf73['result'][_0x1aa9('0x16')]);}})[_0x1aa9('0x17')](function(_0x2778d2){logger[_0x1aa9('0x14')]('VoiceTransferReport,\x20%s,\x20%s',_0x241f1b,_0x2778d2);_0x8aa462(_0x2778d2);});});}exports[_0x1aa9('0x18')]=function(_0x2f9e14){var _0x51dee9=this;return new Promise(function(_0x602bf4,_0x5cb39c){return db[_0x1aa9('0x19')][_0x1aa9('0x1a')](_0x2f9e14[_0x1aa9('0x1b')],{'raw':_0x2f9e14['options']?_0x2f9e14['options'][_0x1aa9('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x2320bc){logger[_0x1aa9('0xf')]('CreateVoiceTransferReport',_0x2f9e14);logger['debug']('CreateVoiceTransferReport',_0x2f9e14,JSON['stringify'](_0x2320bc));_0x602bf4(_0x2320bc);})[_0x1aa9('0x17')](function(_0x336ab9){logger['error'](_0x1aa9('0x18'),_0x336ab9[_0x1aa9('0x16')],_0x2f9e14);_0x5cb39c(_0x51dee9['error'](0x1f4,_0x336ab9['message']));});});};
\ No newline at end of file
+var _0xe766=['info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x53348c,_0x21ede1){var _0x35b11c=function(_0x17bc41){while(--_0x17bc41){_0x53348c['push'](_0x53348c['shift']());}};_0x35b11c(++_0x21ede1);}(_0xe766,0x14f));var _0x6e76=function(_0x552fce,_0x3f24bc){_0x552fce=_0x552fce-0x0;var _0x3e27a2=_0xe766[_0x552fce];return _0x3e27a2;};'use strict';var _=require('lodash');var util=require(_0x6e76('0x0'));var moment=require(_0x6e76('0x1'));var BPromise=require('bluebird');var rs=require(_0x6e76('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6e76('0x3'))['db'];var utils=require(_0x6e76('0x4'));var logger=require(_0x6e76('0x5'))(_0x6e76('0x6'));var config=require(_0x6e76('0x7'));var jayson=require(_0x6e76('0x8'));var client=jayson[_0x6e76('0x9')][_0x6e76('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53352c,_0x480aca,_0x2ab3a0){return new BPromise(function(_0x3993b4,_0xf58bfe){return client[_0x6e76('0xb')](_0x53352c,_0x2ab3a0)[_0x6e76('0xc')](function(_0x1b94f8){logger[_0x6e76('0xd')](_0x6e76('0xe'),_0x480aca,_0x6e76('0xf'));logger[_0x6e76('0x10')](_0x6e76('0x11'),_0x480aca,'request\x20sent',JSON[_0x6e76('0x12')](_0x1b94f8));if(_0x1b94f8['error']){if(_0x1b94f8['error'][_0x6e76('0x13')]===0x1f4){logger[_0x6e76('0x14')](_0x6e76('0xe'),_0x480aca,_0x1b94f8[_0x6e76('0x14')][_0x6e76('0x15')]);return _0xf58bfe(_0x1b94f8['error']['message']);}logger[_0x6e76('0x14')](_0x6e76('0xe'),_0x480aca,_0x1b94f8[_0x6e76('0x14')]['message']);return _0x3993b4(_0x1b94f8[_0x6e76('0x14')][_0x6e76('0x15')]);}else{logger[_0x6e76('0xd')](_0x6e76('0xe'),_0x480aca,_0x6e76('0xf'));_0x3993b4(_0x1b94f8['result'][_0x6e76('0x15')]);}})['catch'](function(_0x2a9481){logger[_0x6e76('0x14')](_0x6e76('0xe'),_0x480aca,_0x2a9481);_0xf58bfe(_0x2a9481);});});}exports[_0x6e76('0x16')]=function(_0x54977a){var _0xb5a350=this;return new Promise(function(_0xd6a59e,_0x3db4a1){return db[_0x6e76('0x17')][_0x6e76('0x18')](_0x54977a[_0x6e76('0x19')],{'raw':_0x54977a[_0x6e76('0x1a')]?_0x54977a[_0x6e76('0x1a')][_0x6e76('0x1b')]===undefined?!![]:![]:!![]})[_0x6e76('0xc')](function(_0x418552){logger[_0x6e76('0xd')](_0x6e76('0x16'),_0x54977a);logger[_0x6e76('0x10')](_0x6e76('0x16'),_0x54977a,JSON['stringify'](_0x418552));_0xd6a59e(_0x418552);})[_0x6e76('0x1c')](function(_0x561026){logger[_0x6e76('0x14')](_0x6e76('0x16'),_0x561026[_0x6e76('0x15')],_0x54977a);_0x3db4a1(_0xb5a350[_0x6e76('0x14')](0x1f4,_0x561026[_0x6e76('0x15')]));});});};
\ No newline at end of file
index 57d6018..9d83fef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4f5=['hangup','/answer','/unhold','unhold','/calls','calls','/transfer','express','Router','./webbar.controller','/originate','isAuthenticated','canUpdate','originate','post','/hangup'];(function(_0x9d1d1f,_0x3d6e3f){var _0x19e276=function(_0x2fb01c){while(--_0x2fb01c){_0x9d1d1f['push'](_0x9d1d1f['shift']());}};_0x19e276(++_0x3d6e3f);}(_0xc4f5,0xc7));var _0x5c4f=function(_0x2724e5,_0x229d74){_0x2724e5=_0x2724e5-0x0;var _0x4b6621=_0xc4f5[_0x2724e5];return _0x4b6621;};'use strict';var express=require(_0x5c4f('0x0'));var router=express[_0x5c4f('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5c4f('0x2'));router['post'](_0x5c4f('0x3'),auth[_0x5c4f('0x4')](),auth[_0x5c4f('0x5')](),controller[_0x5c4f('0x6')]);router[_0x5c4f('0x7')](_0x5c4f('0x8'),auth['isAuthenticated'](),auth['canUpdate'](),controller[_0x5c4f('0x9')]);router['post'](_0x5c4f('0xa'),auth[_0x5c4f('0x4')](),auth['canUpdate'](),controller['answer']);router[_0x5c4f('0x7')]('/hold',auth[_0x5c4f('0x4')](),auth[_0x5c4f('0x5')](),controller['hold']);router[_0x5c4f('0x7')](_0x5c4f('0xb'),auth[_0x5c4f('0x4')](),auth['canUpdate'](),controller[_0x5c4f('0xc')]);router[_0x5c4f('0x7')](_0x5c4f('0xd'),auth['isAuthenticated'](),auth[_0x5c4f('0x5')](),controller[_0x5c4f('0xe')]);router[_0x5c4f('0x7')](_0x5c4f('0xf'),auth[_0x5c4f('0x4')](),auth[_0x5c4f('0x5')](),controller['transfer']);module['exports']=router;
\ No newline at end of file
+var _0x1643=['Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','exports','express'];(function(_0x3a5416,_0x59b45f){var _0x5ad0e4=function(_0x59dc17){while(--_0x59dc17){_0x3a5416['push'](_0x3a5416['shift']());}};_0x5ad0e4(++_0x59b45f);}(_0x1643,0xd1));var _0x3164=function(_0x280ba2,_0x25d412){_0x280ba2=_0x280ba2-0x0;var _0x12a78e=_0x1643[_0x280ba2];return _0x12a78e;};'use strict';var express=require(_0x3164('0x0'));var router=express[_0x3164('0x1')]();var auth=require(_0x3164('0x2'));var controller=require(_0x3164('0x3'));router[_0x3164('0x4')](_0x3164('0x5'),auth[_0x3164('0x6')](),auth[_0x3164('0x7')](),controller[_0x3164('0x8')]);router[_0x3164('0x4')](_0x3164('0x9'),auth[_0x3164('0x6')](),auth[_0x3164('0x7')](),controller[_0x3164('0xa')]);router[_0x3164('0x4')]('/answer',auth[_0x3164('0x6')](),auth[_0x3164('0x7')](),controller[_0x3164('0xb')]);router[_0x3164('0x4')](_0x3164('0xc'),auth['isAuthenticated'](),auth[_0x3164('0x7')](),controller[_0x3164('0xd')]);router['post'](_0x3164('0xe'),auth[_0x3164('0x6')](),auth[_0x3164('0x7')](),controller[_0x3164('0xf')]);router[_0x3164('0x4')](_0x3164('0x10'),auth['isAuthenticated'](),auth[_0x3164('0x7')](),controller[_0x3164('0x11')]);router[_0x3164('0x4')](_0x3164('0x12'),auth[_0x3164('0x6')](),auth[_0x3164('0x7')](),controller[_0x3164('0x13')]);module[_0x3164('0x14')]=router;
\ No newline at end of file
index 62608ed..5ec200c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37f8=['string','callNumber\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','handleError:','error','stack','name','send','status','NotFound','request','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','\x20not\x20found!','originate','originate\x20fired:','length','json','body','callbackUrl','entityFound:','format','user:%s','hangup','hangup\x20fired:','sessionId','info','hangup\x20executed!','answer','answer\x20fired:','userId','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','webbar:transfer','lodash','../../mysqldb','../../config/environment','util','jayson/promise','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required'];(function(_0x559233,_0x4f4408){var _0x1a9acb=function(_0x4d9c52){while(--_0x4d9c52){_0x559233['push'](_0x559233['shift']());}};_0x1a9acb(++_0x4f4408);}(_0x37f8,0xd2));var _0x837f=function(_0x2b0c2b,_0x279329){_0x2b0c2b=_0x2b0c2b-0x0;var _0x3a5e50=_0x37f8[_0x2b0c2b];return _0x3a5e50;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x837f('0x0'));var db=require(_0x837f('0x1'))['db'];var config=require(_0x837f('0x2'));var util=require(_0x837f('0x3'));var BPromise=require('bluebird');var jayson=require(_0x837f('0x4'));var amiClient=jayson['client']['http']({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require('ioredis');config[_0x837f('0x5')]=_[_0x837f('0x6')](config[_0x837f('0x5')],{'host':_0x837f('0x7'),'port':0x18eb});var io=require(_0x837f('0x8'))(new Redis(config[_0x837f('0x5')]));var Schema=require(_0x837f('0x9'));var originateValidation=new Schema({'userId':{'type':_0x837f('0xa'),'required':[!![],_0x837f('0xb')]},'callNumber':{'type':_0x837f('0xc'),'required':[!![],_0x837f('0xd')]},'callerId':{'type':_0x837f('0xc')},'callbackUrl':{'type':_0x837f('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x837f('0xa'),'required':[!![],_0x837f('0xb')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x837f('0xa'),'required':[!![],_0x837f('0xb')]},'sessionId':{'type':_0x837f('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x837f('0xa'),'required':[!![],_0x837f('0xb')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x837f('0xc'),'required':[!![],_0x837f('0xe')]}});var holdValidation=new Schema({'userId':{'type':_0x837f('0xa'),'required':[!![],_0x837f('0xb')]},'sessionId':{'type':_0x837f('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x837f('0xb')]},'sessionId':{'type':_0x837f('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x837f('0xa'),'required':[!![],_0x837f('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0x837f('0xa'),'required':[!![],_0x837f('0xb')]}});function emit(_0x546352,_0x11f37a,_0x2f2617){logger['info'](_0x546352,_0x11f37a,JSON[_0x837f('0xf')](_0x2f2617));io['to'](_0x546352)[_0x837f('0x10')](_0x11f37a,_0x2f2617);}function handleError(_0x28baaf){return function(_0x1d17b3){console['log'](_0x837f('0x11'),_0x1d17b3,_0x1d17b3 instanceof RangeError);logger[_0x837f('0x12')](_0x1d17b3[_0x837f('0x13')]);if(_0x1d17b3 instanceof RangeError){if(_0x1d17b3[_0x837f('0x14')]){delete _0x1d17b3[_0x837f('0x14')];}_0x28baaf['status'](0x194)[_0x837f('0x15')](_0x1d17b3);}else{if(_0x1d17b3[_0x837f('0x14')]){delete _0x1d17b3[_0x837f('0x14')];}_0x28baaf[_0x837f('0x16')](0x1f4)[_0x837f('0x15')](_0x1d17b3);}};}function checkError(){return function(_0x55dc1e){if(!_0x55dc1e){throw new RangeError(_0x837f('0x17'));}return _0x55dc1e;};}function respondWithRpcPromise(_0x37d7e0,_0x287c6e){return new BPromise(function(_0xe68eb1,_0xa0af78){var _0x237656=amiClient;return _0x237656[_0x837f('0x18')](_0x37d7e0,_0x287c6e)[_0x837f('0x19')](function(_0x11a9b3){if(_0x11a9b3[_0x837f('0x12')]){if(_0x11a9b3[_0x837f('0x12')][_0x837f('0x1a')]===0x1f4){return _0xa0af78(_0x11a9b3[_0x837f('0x12')][_0x837f('0x1b')]);}return _0xe68eb1(_0x11a9b3[_0x837f('0x12')][_0x837f('0x1b')]);}else{_0xe68eb1(_0x11a9b3[_0x837f('0x1c')]);}})[_0x837f('0x1d')](function(_0x1a6f26){_0xa0af78(_0x1a6f26);});});}function getAgent(_0x3af34f){return db[_0x837f('0x1e')][_0x837f('0x1f')]({'where':{'id':_0x3af34f,'role':_0x837f('0x20')}})['then'](checkError());}function getAgentCheckSession(_0x3f467d,_0x2df32d){return new BPromise(function(_0x4290e6,_0x5d7af3){var _0x530f6d=respondWithRpcPromise(_0x837f('0x21'));var _0x1ab2e4=getAgent(_0x3f467d);Promise[_0x837f('0x22')]([_0x530f6d,_0x1ab2e4])[_0x837f('0x19')](function(_0x30a3d9){var _0x387533=_0x30a3d9[0x0];var _0x323565=_0x30a3d9[0x1];var _0x507984=_[_0x837f('0x23')](_0x387533[_0x837f('0x24')],function(_0x266871){return _0x266871[_0x837f('0x25')]==_0x323565['id']&&_0x266871['sessionId']==_0x2df32d;});if(_0x507984['length']==0x1){_0x4290e6(_0x323565);}else{_0x5d7af3(new RangeError('sessionId\x20'+_0x2df32d+_0x837f('0x26')));}});});}exports[_0x837f('0x27')]=function(_0x2f6ab5,_0x422498){logger['info'](_0x837f('0x28'),_0x2f6ab5['body']);var _0x3997ab=originateValidation['validate'](_0x2f6ab5['body']);if(_0x3997ab[_0x837f('0x29')]>0x0){return _0x422498[_0x837f('0x16')](0x190)[_0x837f('0x2a')](_0x3997ab);}var _0x5200a9=_0x2f6ab5[_0x837f('0x2b')]['userId'];var _0x56ddfc=_0x2f6ab5[_0x837f('0x2b')]['callNumber'];var _0x2c3337=_0x2f6ab5[_0x837f('0x2b')]['callerId'];var _0x245342=_0x2f6ab5[_0x837f('0x2b')][_0x837f('0x2c')];return getAgent(_0x5200a9)[_0x837f('0x19')](function(_0x26bde0){logger['info'](_0x837f('0x2d'),_0x26bde0[_0x837f('0x14')]);emit(util[_0x837f('0x2e')](_0x837f('0x2f'),_0x26bde0[_0x837f('0x14')]),'webbar:originate',{'callNumber':_0x56ddfc,'callerId':_0x2c3337,'callbackUrl':_0x245342});return _0x422498['status'](0xc8)[_0x837f('0x2a')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x422498));};exports[_0x837f('0x30')]=function(_0x1c7352,_0x554b11){logger['info'](_0x837f('0x31'),_0x1c7352[_0x837f('0x2b')]);var _0x1e0584=hangupValidation['validate'](_0x1c7352[_0x837f('0x2b')]);if(_0x1e0584[_0x837f('0x29')]>0x0){return _0x554b11[_0x837f('0x16')](0x190)[_0x837f('0x2a')](_0x1e0584);}var _0x2ed1de=_0x1c7352['body']['userId'];var _0x3a9566=_0x1c7352[_0x837f('0x2b')][_0x837f('0x32')];return getAgent(_0x2ed1de)['then'](function(_0x5e001c){logger[_0x837f('0x33')](_0x837f('0x2d'),_0x5e001c[_0x837f('0x14')]);emit(util['format'](_0x837f('0x2f'),_0x5e001c[_0x837f('0x14')]),'webbar:hangup',{'sessionId':_0x3a9566});return _0x554b11['status'](0xc8)['json']({'error':![],'message':_0x837f('0x34')});})[_0x837f('0x1d')](handleError(_0x554b11));};exports[_0x837f('0x35')]=function(_0x4591db,_0x15e50d){logger[_0x837f('0x33')](_0x837f('0x36'),_0x4591db[_0x837f('0x2b')]);var _0xdbd892=answerValidation[_0x837f('0x9')](_0x4591db['body']);if(_0xdbd892[_0x837f('0x29')]>0x0){return _0x15e50d[_0x837f('0x16')](0x190)['json'](_0xdbd892);}var _0xc2e307=_0x4591db[_0x837f('0x2b')][_0x837f('0x37')];var _0x443e7c=_0x4591db[_0x837f('0x2b')][_0x837f('0x32')];return getAgent(_0xc2e307)['then'](function(_0x24c03c){logger[_0x837f('0x33')](_0x837f('0x2d'),_0x24c03c[_0x837f('0x14')]);emit(util[_0x837f('0x2e')](_0x837f('0x2f'),_0x24c03c[_0x837f('0x14')]),_0x837f('0x38'),{'sessionId':_0x443e7c});return _0x15e50d['status'](0xc8)[_0x837f('0x2a')]({'error':![],'message':_0x837f('0x39')});})['catch'](handleError(_0x15e50d));};exports[_0x837f('0x3a')]=function(_0x400ccd,_0x5ce967){logger[_0x837f('0x33')](_0x837f('0x3b'),_0x400ccd[_0x837f('0x2b')]);var _0x45af4a=holdValidation[_0x837f('0x9')](_0x400ccd[_0x837f('0x2b')]);if(_0x45af4a['length']>0x0){return _0x5ce967[_0x837f('0x16')](0x190)['json'](_0x45af4a);}var _0x1146ef=_0x400ccd[_0x837f('0x2b')][_0x837f('0x37')];var _0x39ce8b=_0x400ccd[_0x837f('0x2b')][_0x837f('0x32')];return getAgent(_0x1146ef)['then'](function(_0x554f74){logger['info'](_0x837f('0x2d'),_0x554f74[_0x837f('0x14')]);emit(util['format'](_0x837f('0x2f'),_0x554f74['name']),_0x837f('0x3c'),{'sessionId':_0x39ce8b});return _0x5ce967[_0x837f('0x16')](0xc8)[_0x837f('0x2a')]({'error':![],'message':_0x837f('0x3d')});})[_0x837f('0x1d')](handleError(_0x5ce967));};exports[_0x837f('0x3e')]=function(_0x4d9156,_0x23406b){logger['info'](_0x837f('0x3f'),_0x4d9156[_0x837f('0x2b')]);var _0x3734a6=unholdValidation['validate'](_0x4d9156[_0x837f('0x2b')]);if(_0x3734a6[_0x837f('0x29')]>0x0){return _0x23406b[_0x837f('0x16')](0x190)[_0x837f('0x2a')](_0x3734a6);}var _0x1dec94=_0x4d9156[_0x837f('0x2b')]['userId'];var _0x5446d8=_0x4d9156[_0x837f('0x2b')][_0x837f('0x32')];return getAgent(_0x1dec94)[_0x837f('0x19')](function(_0x4c36f0){logger[_0x837f('0x33')]('entityFound:',_0x4c36f0[_0x837f('0x14')]);emit(util['format'](_0x837f('0x2f'),_0x4c36f0[_0x837f('0x14')]),_0x837f('0x40'),{'sessionId':_0x5446d8});return _0x23406b[_0x837f('0x16')](0xc8)[_0x837f('0x2a')]({'error':![],'message':_0x837f('0x41')});})[_0x837f('0x1d')](handleError(_0x23406b));};exports[_0x837f('0x42')]=function(_0x2322d8,_0x3b9899){logger[_0x837f('0x33')](_0x837f('0x43'),_0x3b9899['body']);var _0x4ade1b=callsValidation[_0x837f('0x9')](_0x2322d8['body']);if(_0x4ade1b[_0x837f('0x29')]>0x0){return _0x3b9899[_0x837f('0x16')](0x190)[_0x837f('0x2a')](_0x4ade1b);}var _0x11bde4=_0x2322d8[_0x837f('0x2b')][_0x837f('0x37')];var _0x438d93=respondWithRpcPromise(_0x837f('0x21'));var _0x145e5d=getAgent(_0x11bde4);return Promise[_0x837f('0x22')]([_0x438d93,_0x145e5d])[_0x837f('0x19')](function(_0x13d01a){var _0x2b528a=_0x13d01a[0x0];var _0x48440f=_0x13d01a[0x1];var _0x476acd=_[_0x837f('0x23')](_0x2b528a[_0x837f('0x24')],function(_0x5acfab){return _0x5acfab[_0x837f('0x25')]==_0x48440f['id'];});return _0x3b9899[_0x837f('0x16')](0xc8)[_0x837f('0x2a')]({'count':_0x476acd[_0x837f('0x29')],'rows':_0x476acd});})[_0x837f('0x1d')](handleError(_0x3b9899));};exports[_0x837f('0x44')]=function(_0x536075,_0x48fa74){logger[_0x837f('0x33')](_0x837f('0x45'),_0x536075[_0x837f('0x2b')]);var _0x5a2868=conferenceValidation[_0x837f('0x9')](_0x536075[_0x837f('0x2b')]);if(_0x5a2868[_0x837f('0x29')]>0x0){return _0x48fa74[_0x837f('0x16')](0x190)['json'](_0x5a2868);}var _0x35f2f3=_0x536075[_0x837f('0x2b')][_0x837f('0x37')];return getAgent(_0x35f2f3)['then'](function(_0x53c966){logger['info'](_0x837f('0x2d'),_0x53c966[_0x837f('0x14')]);emit(util[_0x837f('0x2e')](_0x837f('0x2f'),_0x53c966[_0x837f('0x14')]),_0x837f('0x46'));return _0x48fa74[_0x837f('0x16')](0xc8)[_0x837f('0x2a')]({'error':![],'message':_0x837f('0x47')});})[_0x837f('0x1d')](handleError(_0x48fa74));};exports[_0x837f('0x48')]=function(_0x1022a7,_0x1b6747){logger[_0x837f('0x33')]('transfer\x20fired:',_0x1022a7['body']);var _0x50a01e=transferValidation[_0x837f('0x9')](_0x1022a7[_0x837f('0x2b')]);if(_0x50a01e[_0x837f('0x29')]>0x0){return _0x1b6747[_0x837f('0x16')](0x190)[_0x837f('0x2a')](_0x50a01e);}var _0xf00bc5=_0x1022a7['body'][_0x837f('0x37')];var _0x239981=_0x1022a7['body'][_0x837f('0x32')];var _0x1d43f6=_0x1022a7[_0x837f('0x2b')]['transferNumber'];return getAgent(_0xf00bc5)[_0x837f('0x19')](function(_0x365bff){logger[_0x837f('0x33')]('entityFound:',_0x365bff['name']);emit(util[_0x837f('0x2e')]('user:%s',_0x365bff[_0x837f('0x14')]),_0x837f('0x49'),{'sessionId':_0x239981,'transferNumber':_0x1d43f6});return _0x1b6747[_0x837f('0x16')](0xc8)[_0x837f('0x2a')]({'error':![],'message':'transfer\x20executed!'});})[_0x837f('0x1d')](handleError(_0x1b6747));};
\ No newline at end of file
+var _0x5ff3=['defaults','socket.io-emitter','validate','number','userId\x20is\x20required','callNumber\x20is\x20required','string','sessionId\x20is\x20required','info','stringify','emit','log','error','stack','name','send','NotFound','request','then','code','message','result','User','findOne','agent','VoiceChannels','all','filter','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','status','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','catch','hangup','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','rows','UserId','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','lodash','../../config/environment','bluebird','jayson/promise','client','http','webbarapi','ioredis','redis'];(function(_0x2bdd37,_0x463323){var _0x18a4d8=function(_0x436ebd){while(--_0x436ebd){_0x2bdd37['push'](_0x2bdd37['shift']());}};_0x18a4d8(++_0x463323);}(_0x5ff3,0x17d));var _0x35ff=function(_0x56455e,_0x513f4f){_0x56455e=_0x56455e-0x0;var _0x2df6ac=_0x5ff3[_0x56455e];return _0x2df6ac;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x35ff('0x0'));var db=require('../../mysqldb')['db'];var config=require(_0x35ff('0x1'));var util=require('util');var BPromise=require(_0x35ff('0x2'));var jayson=require(_0x35ff('0x3'));var amiClient=jayson[_0x35ff('0x4')][_0x35ff('0x5')]({'port':0x232a});var logger=require('../../config/logger')(_0x35ff('0x6'));var Redis=require(_0x35ff('0x7'));config[_0x35ff('0x8')]=_[_0x35ff('0x9')](config[_0x35ff('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x35ff('0xa'))(new Redis(config['redis']));var Schema=require(_0x35ff('0xb'));var originateValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],_0x35ff('0xd')]},'callNumber':{'type':'string','required':[!![],_0x35ff('0xe')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x35ff('0xf')}});var hangupValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x35ff('0xd')]},'sessionId':{'type':_0x35ff('0xf'),'required':[!![],_0x35ff('0x10')]},'transferNumber':{'type':_0x35ff('0xf'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],_0x35ff('0xd')]},'sessionId':{'type':_0x35ff('0xf'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x35ff('0xd')]},'sessionId':{'type':_0x35ff('0xf'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],_0x35ff('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x35ff('0xc'),'required':[!![],_0x35ff('0xd')]}});function emit(_0x2d4a88,_0x28def2,_0x30b5bf){logger[_0x35ff('0x11')](_0x2d4a88,_0x28def2,JSON[_0x35ff('0x12')](_0x30b5bf));io['to'](_0x2d4a88)[_0x35ff('0x13')](_0x28def2,_0x30b5bf);}function handleError(_0x37ea06){return function(_0x16c803){console[_0x35ff('0x14')]('handleError:',_0x16c803,_0x16c803 instanceof RangeError);logger[_0x35ff('0x15')](_0x16c803[_0x35ff('0x16')]);if(_0x16c803 instanceof RangeError){if(_0x16c803[_0x35ff('0x17')]){delete _0x16c803[_0x35ff('0x17')];}_0x37ea06['status'](0x194)['send'](_0x16c803);}else{if(_0x16c803[_0x35ff('0x17')]){delete _0x16c803[_0x35ff('0x17')];}_0x37ea06['status'](0x1f4)[_0x35ff('0x18')](_0x16c803);}};}function checkError(){return function(_0x224f67){if(!_0x224f67){throw new RangeError(_0x35ff('0x19'));}return _0x224f67;};}function respondWithRpcPromise(_0x1e1dd2,_0x48f3bd){return new BPromise(function(_0x3d60b4,_0x55274b){var _0x7cc20a=amiClient;return _0x7cc20a[_0x35ff('0x1a')](_0x1e1dd2,_0x48f3bd)[_0x35ff('0x1b')](function(_0x16a5a0){if(_0x16a5a0[_0x35ff('0x15')]){if(_0x16a5a0[_0x35ff('0x15')][_0x35ff('0x1c')]===0x1f4){return _0x55274b(_0x16a5a0['error'][_0x35ff('0x1d')]);}return _0x3d60b4(_0x16a5a0[_0x35ff('0x15')]['message']);}else{_0x3d60b4(_0x16a5a0[_0x35ff('0x1e')]);}})['catch'](function(_0x4c46b7){_0x55274b(_0x4c46b7);});});}function getAgent(_0x186768){return db[_0x35ff('0x1f')][_0x35ff('0x20')]({'where':{'id':_0x186768,'role':_0x35ff('0x21')}})[_0x35ff('0x1b')](checkError());}function getAgentCheckSession(_0x546ec0,_0x2bdba4){return new BPromise(function(_0x412873,_0x148884){var _0x5e191b=respondWithRpcPromise(_0x35ff('0x22'));var _0x1f51c5=getAgent(_0x546ec0);Promise[_0x35ff('0x23')]([_0x5e191b,_0x1f51c5])[_0x35ff('0x1b')](function(_0x47fcb5){var _0x61b554=_0x47fcb5[0x0];var _0x1afc98=_0x47fcb5[0x1];var _0xdf6ff=_[_0x35ff('0x24')](_0x61b554['rows'],function(_0x3f9440){return _0x3f9440['UserId']==_0x1afc98['id']&&_0x3f9440[_0x35ff('0x25')]==_0x2bdba4;});if(_0xdf6ff[_0x35ff('0x26')]==0x1){_0x412873(_0x1afc98);}else{_0x148884(new RangeError(_0x35ff('0x27')+_0x2bdba4+_0x35ff('0x28')));}});});}exports['originate']=function(_0x182b71,_0x5de349){logger[_0x35ff('0x11')](_0x35ff('0x29'),_0x182b71['body']);var _0x5a48b0=originateValidation[_0x35ff('0xb')](_0x182b71[_0x35ff('0x2a')]);if(_0x5a48b0['length']>0x0){return _0x5de349[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x5a48b0);}var _0x4d194c=_0x182b71[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x131b22=_0x182b71[_0x35ff('0x2a')][_0x35ff('0x2e')];var _0x2720dc=_0x182b71[_0x35ff('0x2a')][_0x35ff('0x2f')];var _0x35a3c7=_0x182b71[_0x35ff('0x2a')][_0x35ff('0x30')];return getAgent(_0x4d194c)[_0x35ff('0x1b')](function(_0x41b48d){logger['info'](_0x35ff('0x31'),_0x41b48d['name']);emit(util[_0x35ff('0x32')](_0x35ff('0x33'),_0x41b48d[_0x35ff('0x17')]),_0x35ff('0x34'),{'callNumber':_0x131b22,'callerId':_0x2720dc,'callbackUrl':_0x35a3c7});return _0x5de349[_0x35ff('0x2b')](0xc8)['json']({'error':![],'message':_0x35ff('0x35')});})[_0x35ff('0x36')](handleError(_0x5de349));};exports[_0x35ff('0x37')]=function(_0x4250cb,_0x324f6c){logger['info'](_0x35ff('0x38'),_0x4250cb[_0x35ff('0x2a')]);var _0x1640b5=hangupValidation['validate'](_0x4250cb['body']);if(_0x1640b5[_0x35ff('0x26')]>0x0){return _0x324f6c[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x1640b5);}var _0x37677f=_0x4250cb[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x27f32d=_0x4250cb[_0x35ff('0x2a')]['sessionId'];return getAgent(_0x37677f)['then'](function(_0x550c09){logger[_0x35ff('0x11')](_0x35ff('0x31'),_0x550c09[_0x35ff('0x17')]);emit(util[_0x35ff('0x32')](_0x35ff('0x33'),_0x550c09['name']),_0x35ff('0x39'),{'sessionId':_0x27f32d});return _0x324f6c[_0x35ff('0x2b')](0xc8)[_0x35ff('0x2c')]({'error':![],'message':_0x35ff('0x3a')});})[_0x35ff('0x36')](handleError(_0x324f6c));};exports[_0x35ff('0x3b')]=function(_0x55efda,_0x5e4360){logger[_0x35ff('0x11')](_0x35ff('0x3c'),_0x55efda[_0x35ff('0x2a')]);var _0x21b123=answerValidation['validate'](_0x55efda['body']);if(_0x21b123[_0x35ff('0x26')]>0x0){return _0x5e4360[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x21b123);}var _0x1cd2c8=_0x55efda[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x346758=_0x55efda['body']['sessionId'];return getAgent(_0x1cd2c8)[_0x35ff('0x1b')](function(_0x318297){logger[_0x35ff('0x11')]('entityFound:',_0x318297[_0x35ff('0x17')]);emit(util[_0x35ff('0x32')]('user:%s',_0x318297['name']),_0x35ff('0x3d'),{'sessionId':_0x346758});return _0x5e4360['status'](0xc8)[_0x35ff('0x2c')]({'error':![],'message':_0x35ff('0x3e')});})['catch'](handleError(_0x5e4360));};exports[_0x35ff('0x3f')]=function(_0x4b1b86,_0x53c3c7){logger[_0x35ff('0x11')](_0x35ff('0x40'),_0x4b1b86[_0x35ff('0x2a')]);var _0x3a70cd=holdValidation[_0x35ff('0xb')](_0x4b1b86[_0x35ff('0x2a')]);if(_0x3a70cd[_0x35ff('0x26')]>0x0){return _0x53c3c7[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x3a70cd);}var _0xee99f9=_0x4b1b86[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x5d2894=_0x4b1b86[_0x35ff('0x2a')][_0x35ff('0x25')];return getAgent(_0xee99f9)[_0x35ff('0x1b')](function(_0x2d26e2){logger['info']('entityFound:',_0x2d26e2[_0x35ff('0x17')]);emit(util['format'](_0x35ff('0x33'),_0x2d26e2[_0x35ff('0x17')]),_0x35ff('0x41'),{'sessionId':_0x5d2894});return _0x53c3c7[_0x35ff('0x2b')](0xc8)[_0x35ff('0x2c')]({'error':![],'message':_0x35ff('0x42')});})[_0x35ff('0x36')](handleError(_0x53c3c7));};exports[_0x35ff('0x43')]=function(_0x3be5fc,_0x535cc8){logger['info'](_0x35ff('0x44'),_0x3be5fc['body']);var _0x309fe1=unholdValidation[_0x35ff('0xb')](_0x3be5fc[_0x35ff('0x2a')]);if(_0x309fe1[_0x35ff('0x26')]>0x0){return _0x535cc8[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x309fe1);}var _0x2db44c=_0x3be5fc[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x5b8f52=_0x3be5fc[_0x35ff('0x2a')][_0x35ff('0x25')];return getAgent(_0x2db44c)[_0x35ff('0x1b')](function(_0x148183){logger['info']('entityFound:',_0x148183['name']);emit(util[_0x35ff('0x32')](_0x35ff('0x33'),_0x148183[_0x35ff('0x17')]),'webbar:unhold',{'sessionId':_0x5b8f52});return _0x535cc8[_0x35ff('0x2b')](0xc8)['json']({'error':![],'message':_0x35ff('0x45')});})['catch'](handleError(_0x535cc8));};exports[_0x35ff('0x46')]=function(_0x3b7e40,_0x681d2b){logger[_0x35ff('0x11')]('calls\x20fired:',_0x681d2b['body']);var _0x2be86b=callsValidation['validate'](_0x3b7e40[_0x35ff('0x2a')]);if(_0x2be86b[_0x35ff('0x26')]>0x0){return _0x681d2b['status'](0x190)[_0x35ff('0x2c')](_0x2be86b);}var _0x567be6=_0x3b7e40[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x424586=respondWithRpcPromise(_0x35ff('0x22'));var _0x316624=getAgent(_0x567be6);return Promise[_0x35ff('0x23')]([_0x424586,_0x316624])['then'](function(_0x54d949){var _0x13b904=_0x54d949[0x0];var _0x340ed8=_0x54d949[0x1];var _0x5ca898=_[_0x35ff('0x24')](_0x13b904[_0x35ff('0x47')],function(_0x52a6f7){return _0x52a6f7[_0x35ff('0x48')]==_0x340ed8['id'];});return _0x681d2b[_0x35ff('0x2b')](0xc8)[_0x35ff('0x2c')]({'count':_0x5ca898[_0x35ff('0x26')],'rows':_0x5ca898});})[_0x35ff('0x36')](handleError(_0x681d2b));};exports['conference']=function(_0x4af4cb,_0x552a66){logger[_0x35ff('0x11')]('conference\x20fired:',_0x4af4cb[_0x35ff('0x2a')]);var _0x55ff13=conferenceValidation[_0x35ff('0xb')](_0x4af4cb[_0x35ff('0x2a')]);if(_0x55ff13[_0x35ff('0x26')]>0x0){return _0x552a66[_0x35ff('0x2b')](0x190)[_0x35ff('0x2c')](_0x55ff13);}var _0x3b9d9b=_0x4af4cb['body'][_0x35ff('0x2d')];return getAgent(_0x3b9d9b)[_0x35ff('0x1b')](function(_0x543109){logger[_0x35ff('0x11')](_0x35ff('0x31'),_0x543109[_0x35ff('0x17')]);emit(util[_0x35ff('0x32')](_0x35ff('0x33'),_0x543109[_0x35ff('0x17')]),_0x35ff('0x49'));return _0x552a66[_0x35ff('0x2b')](0xc8)[_0x35ff('0x2c')]({'error':![],'message':'conference\x20executed!'});})[_0x35ff('0x36')](handleError(_0x552a66));};exports[_0x35ff('0x4a')]=function(_0x36e8d1,_0x2f9107){logger[_0x35ff('0x11')](_0x35ff('0x4b'),_0x36e8d1['body']);var _0x27433f=transferValidation[_0x35ff('0xb')](_0x36e8d1[_0x35ff('0x2a')]);if(_0x27433f['length']>0x0){return _0x2f9107[_0x35ff('0x2b')](0x190)['json'](_0x27433f);}var _0x56e6cc=_0x36e8d1[_0x35ff('0x2a')][_0x35ff('0x2d')];var _0x4a8907=_0x36e8d1[_0x35ff('0x2a')][_0x35ff('0x25')];var _0x36e334=_0x36e8d1[_0x35ff('0x2a')][_0x35ff('0x4c')];return getAgent(_0x56e6cc)[_0x35ff('0x1b')](function(_0x5fd425){logger[_0x35ff('0x11')](_0x35ff('0x31'),_0x5fd425[_0x35ff('0x17')]);emit(util[_0x35ff('0x32')](_0x35ff('0x33'),_0x5fd425[_0x35ff('0x17')]),_0x35ff('0x4d'),{'sessionId':_0x4a8907,'transferNumber':_0x36e334});return _0x2f9107[_0x35ff('0x2b')](0xc8)[_0x35ff('0x2c')]({'error':![],'message':'transfer\x20executed!'});})[_0x35ff('0x36')](handleError(_0x2f9107));};
\ No newline at end of file
index 9857807..affa772 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['notify','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addAnswer','addAgents'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0xadb5,0xad));var _0x5adb=function(_0x539184,_0x3daa5c){_0x539184=_0x539184-0x0;var _0x6f1319=_0xadb5[_0x539184];return _0x6f1319;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./whatsappAccount.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getDispositions']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['get'](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['get'](_0x5adb('0x13'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);router['post']('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x15')]);router[_0x5adb('0x16')]('/:id/dispositions',auth[_0x5adb('0x8')](),controller['addDisposition']);router[_0x5adb('0x16')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x16')](_0x5adb('0x11'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x18')]);router[_0x5adb('0x16')]('/:id/applications',auth[_0x5adb('0x8')](),controller['addApplications']);router[_0x5adb('0x16')]('/:id/notify',controller[_0x5adb('0x19')]);router['post']('/:id/send',auth[_0x5adb('0x8')](),controller[_0x5adb('0x1a')]);router[_0x5adb('0x1b')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller['update']);router[_0x5adb('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x5adb('0x1d')]);router[_0x5adb('0x1c')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x1e')]);router[_0x5adb('0x1c')](_0x5adb('0xf'),auth['isAuthenticated'](),controller[_0x5adb('0x1f')]);router[_0x5adb('0x1c')](_0x5adb('0x11'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x20')]);module['exports']=router;
\ No newline at end of file
+var _0xd7d1=['delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getAnswers','/:id/users','getAgents','getApplications','create','post','addDisposition','/:id/canned_answers','addAgents','addApplications','notify','/:id/send','send','put','update'];(function(_0x485c35,_0x1ef463){var _0x699c07=function(_0x2d0938){while(--_0x2d0938){_0x485c35['push'](_0x485c35['shift']());}};_0x699c07(++_0x1ef463);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x59238a,_0x4560ae){_0x59238a=_0x59238a-0x0;var _0x478549=_0xd7d1[_0x59238a];return _0x478549;};'use strict';var multer=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var path=require(_0x1d7d('0x2'));var timeout=require(_0x1d7d('0x3'));var express=require(_0x1d7d('0x4'));var router=express[_0x1d7d('0x5')]();var fs_extra=require(_0x1d7d('0x6'));var auth=require(_0x1d7d('0x7'));var interaction=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var controller=require(_0x1d7d('0xa'));router[_0x1d7d('0xb')]('/',auth[_0x1d7d('0xc')](),controller['index']);router[_0x1d7d('0xb')](_0x1d7d('0xd'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0xe')]);router[_0x1d7d('0xb')](_0x1d7d('0xf'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0xb')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller['getDispositions']);router[_0x1d7d('0xb')]('/:id/canned_answers',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0xb')](_0x1d7d('0x13'),auth['isAuthenticated'](),controller[_0x1d7d('0x14')]);router['get']('/:id/applications',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1d7d('0x16')]);router[_0x1d7d('0x17')](_0x1d7d('0x11'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x18')]);router['post'](_0x1d7d('0x19'),auth[_0x1d7d('0xc')](),controller['addAnswer']);router[_0x1d7d('0x17')](_0x1d7d('0x13'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1a')]);router[_0x1d7d('0x17')]('/:id/applications',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1b')]);router['post']('/:id/notify',controller[_0x1d7d('0x1c')]);router[_0x1d7d('0x17')](_0x1d7d('0x1d'),auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x1e')]);router[_0x1d7d('0x1f')]('/:id',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x20')]);router[_0x1d7d('0x21')]('/:id',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x22')]);router['delete']('/:id/dispositions',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x23')]);router[_0x1d7d('0x21')]('/:id/canned_answers',auth[_0x1d7d('0xc')](),controller[_0x1d7d('0x24')]);router[_0x1d7d('0x21')](_0x1d7d('0x13'),auth['isAuthenticated'](),controller[_0x1d7d('0x25')]);module[_0x1d7d('0x26')]=router;
\ No newline at end of file
index 3fae65d..7ef2f29 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5d2=['ENUM','twilio','TEXT','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','randomstring','exports','STRING','name','generate'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0xd5d2,0x154));var _0x2d5d=function(_0x86527a,_0x2787c6){_0x86527a=_0x86527a-0x0;var _0x2f14b6=_0xd5d2[_0x86527a];return _0x2f14b6;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x2d5d('0x0'));module[_0x2d5d('0x1')]={'name':{'type':Sequelize[_0x2d5d('0x2')],'unique':_0x2d5d('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x2d5d('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x2d5d('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x2d5d('0x4')]();}},'phone':{'type':Sequelize[_0x2d5d('0x2')]},'type':{'type':Sequelize[_0x2d5d('0x5')](_0x2d5d('0x6'))},'accountSid':{'type':Sequelize[_0x2d5d('0x2')]},'authToken':{'type':Sequelize[_0x2d5d('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2d5d('0x7')],'defaultValue':function(){return _0x2d5d('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x2d5d('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2d5d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2d5d('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2d5d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2d5d('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2d5d('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2d5d('0xa')],'comment':_0x2d5d('0xb')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2d5d('0xc'),'set':function(_0xcd4f6c){if(!_0xcd4f6c){this[_0x2d5d('0xd')](_0x2d5d('0xe'),null);}this[_0x2d5d('0xd')]('mandatoryDisposition',_0xcd4f6c);}},'description':{'type':Sequelize[_0x2d5d('0x2')]}};
\ No newline at end of file
+var _0xebab=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','twilio','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x1cd1ef,_0x49a3bb){var _0x43b467=function(_0x4660ce){while(--_0x4660ce){_0x1cd1ef['push'](_0x1cd1ef['shift']());}};_0x43b467(++_0x49a3bb);}(_0xebab,0xc4));var _0xbeba=function(_0x3238db,_0x530412){_0x3238db=_0x3238db-0x0;var _0x1f0cc5=_0xebab[_0x3238db];return _0x1f0cc5;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xbeba('0x0'));module[_0xbeba('0x1')]={'name':{'type':Sequelize[_0xbeba('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0xbeba('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xbeba('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xbeba('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xbeba('0x3'))},'accountSid':{'type':Sequelize[_0xbeba('0x2')]},'authToken':{'type':Sequelize[_0xbeba('0x2')]},'notificationTemplate':{'type':Sequelize[_0xbeba('0x4')],'defaultValue':function(){return _0xbeba('0x5');}},'notificationSound':{'type':Sequelize[_0xbeba('0x6')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbeba('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xbeba('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbeba('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbeba('0x7')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xbeba('0x6')],'defaultValue':![],'comment':_0xbeba('0x8'),'set':function(_0x40ab42){if(!_0x40ab42){this[_0xbeba('0x9')](_0xbeba('0xa'),null);}this[_0xbeba('0x9')](_0xbeba('0xb'),_0x40ab42);}},'description':{'type':Sequelize[_0xbeba('0x2')]}};
\ No newline at end of file
index d0c7ee6..5bbf429 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef7e=['AttachmentId','UserId','unshift','agent','startRouting','Start','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','to\x20is\x20mandatory','updatedAt','List','out','Messages','WhatsappMessage','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','save','update','destroy','get','WhatsappAccounts','stack','name','send','index','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','findAll','rows','show','params','Pause','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','describe','addDisposition','WhatsappAccountId','findOne','Disposition','nolimit','pick','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','applications','CmContact','ValidationError','difference','createdAt','CompanyId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','DESC','list','Contacts','WhatsappInteraction','interaction','push','close','unmanaged','*,*,*,*','created','ContactId'];(function(_0x15c93b,_0x52f50f){var _0x544bba=function(_0x40fcb7){while(--_0x40fcb7){_0x15c93b['push'](_0x15c93b['shift']());}};_0x544bba(++_0x52f50f);}(_0xef7e,0xd0));var _0xeef7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef7e[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0xeef7('0x0'));var rimraf=require(_0xeef7('0x1'));var zipdir=require(_0xeef7('0x2'));var jsonpatch=require(_0xeef7('0x3'));var rp=require(_0xeef7('0x4'));var moment=require(_0xeef7('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xeef7('0x6'));var path=require(_0xeef7('0x7'));var sox=require(_0xeef7('0x8'));var csv=require(_0xeef7('0x9'));var ejs=require(_0xeef7('0xa'));var fs=require('fs');var fs_extra=require(_0xeef7('0xb'));var _=require('lodash');var squel=require(_0xeef7('0xc'));var crypto=require(_0xeef7('0xd'));var jsforce=require(_0xeef7('0xe'));var deskjs=require(_0xeef7('0xf'));var toCsv=require(_0xeef7('0x9'));var querystring=require(_0xeef7('0x10'));var Papa=require(_0xeef7('0x11'));var Redis=require('ioredis');var authService=require(_0xeef7('0x12'));var qs=require(_0xeef7('0x13'));var as=require(_0xeef7('0x14'));var hardwareService=require(_0xeef7('0x15'));var logger=require(_0xeef7('0x16'))(_0xeef7('0x17'));var utils=require(_0xeef7('0x18'));var config=require(_0xeef7('0x19'));var licenseUtil=require(_0xeef7('0x1a'));var db=require(_0xeef7('0x1b'))['db'];config[_0xeef7('0x1c')]=_[_0xeef7('0x1d')](config[_0xeef7('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xeef7('0x1e'))(new Redis(config['redis']));require(_0xeef7('0x1f'))[_0xeef7('0x20')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xeef7('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x428fef,_0x232753,_0x47815c,_0x49d3e8){return new BPromise(function(_0x4695a9,_0x27218f){var _0x4fc8ba=_0x49d3e8||client;return _0x4fc8ba[_0xeef7('0x22')](_0x428fef,_0x47815c)[_0xeef7('0x23')](function(_0x6a92c4){logger[_0xeef7('0x24')](_0xeef7('0x25'),_0x232753,_0xeef7('0x26'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x232753,_0xeef7('0x26'),JSON[_0xeef7('0x27')](_0x6a92c4));if(_0x6a92c4[_0xeef7('0x28')]){if(_0x6a92c4[_0xeef7('0x28')][_0xeef7('0x29')]===0x1f4){logger['error'](_0xeef7('0x25'),_0x232753,_0x6a92c4[_0xeef7('0x28')][_0xeef7('0x2a')]);return _0x27218f(_0x6a92c4[_0xeef7('0x28')][_0xeef7('0x2a')]);}logger[_0xeef7('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x232753,_0x6a92c4[_0xeef7('0x28')][_0xeef7('0x2a')]);return _0x4695a9(_0x6a92c4[_0xeef7('0x28')]['message']);}else{logger[_0xeef7('0x24')](_0xeef7('0x25'),_0x232753,'request\x20sent');_0x4695a9(_0x6a92c4['result'][_0xeef7('0x2a')]);}})[_0xeef7('0x2b')](function(_0x432866){logger[_0xeef7('0x28')](_0xeef7('0x25'),_0x232753,_0x432866);_0x27218f(_0x432866);});});}function respondWithStatusCode(_0x11ca2d,_0x386525){_0x386525=_0x386525||0xcc;return function(_0x585246){if(_0x585246){return _0x11ca2d[_0xeef7('0x2c')](_0x386525);}return _0x11ca2d['status'](_0x386525)[_0xeef7('0x2d')]();};}function respondWithResult(_0x18e778,_0x3fdfc2){_0x3fdfc2=_0x3fdfc2||0xc8;return function(_0x1beb5d){if(_0x1beb5d){return _0x18e778[_0xeef7('0x2e')](_0x3fdfc2)['json'](_0x1beb5d);}};}function respondWithFilteredResult(_0x4f679c,_0x542dd0){return function(_0x3a5a15){if(_0x3a5a15){var _0x320e23=typeof _0x542dd0[_0xeef7('0x2f')]===_0xeef7('0x30')&&typeof _0x542dd0[_0xeef7('0x31')]===_0xeef7('0x30');var _0x4b3e89=_0x3a5a15[_0xeef7('0x32')];var _0x8cff25=_0x320e23?0x0:_0x542dd0[_0xeef7('0x2f')];var _0x50761d=_0x320e23?_0x3a5a15[_0xeef7('0x32')]:_0x542dd0[_0xeef7('0x2f')]+_0x542dd0[_0xeef7('0x31')];var _0x350710;if(_0x50761d>=_0x4b3e89){_0x50761d=_0x4b3e89;_0x350710=0xc8;}else{_0x350710=0xce;}_0x4f679c['status'](_0x350710);return _0x4f679c['set'](_0xeef7('0x33'),_0x8cff25+'-'+_0x50761d+'/'+_0x4b3e89)[_0xeef7('0x34')](_0x3a5a15);}return null;};}function patchUpdates(_0x2bae6b){return function(_0x55a484){try{jsonpatch[_0xeef7('0x35')](_0x55a484,_0x2bae6b,!![]);}catch(_0x558b7f){return BPromise['reject'](_0x558b7f);}return _0x55a484[_0xeef7('0x36')]();};}function saveUpdates(_0x1a16d2,_0x39ff11){return function(_0x224f25){if(_0x224f25){return _0x224f25[_0xeef7('0x37')](_0x1a16d2)[_0xeef7('0x23')](function(_0x2c730a){return _0x2c730a;});}return null;};}function removeEntity(_0x985acb,_0x494eab){return function(_0x26a423){if(_0x26a423){return _0x26a423[_0xeef7('0x38')]()['then'](function(){var _0x49fb0b=_0x26a423[_0xeef7('0x39')]({'plain':!![]});var _0x3cc974=_0xeef7('0x3a');return db['UserProfileResource'][_0xeef7('0x38')]({'where':{'type':_0x3cc974,'resourceId':_0x49fb0b['id']}})['then'](function(){return _0x26a423;});})['then'](function(){_0x985acb[_0xeef7('0x2e')](0xcc)[_0xeef7('0x2d')]();});}};}function handleEntityNotFound(_0x1fdc98,_0x2dda3d){return function(_0x2ffe0e){if(!_0x2ffe0e){_0x1fdc98[_0xeef7('0x2c')](0x194);}return _0x2ffe0e;};}function handleError(_0x5d5877,_0x13d792){_0x13d792=_0x13d792||0x1f4;return function(_0x142d75){logger[_0xeef7('0x28')](_0x142d75[_0xeef7('0x3b')]);if(_0x142d75[_0xeef7('0x3c')]){delete _0x142d75[_0xeef7('0x3c')];}_0x5d5877[_0xeef7('0x2e')](_0x13d792)[_0xeef7('0x3d')](_0x142d75);};}exports[_0xeef7('0x3e')]=function(_0xb6007e,_0x294fbe){var _0x40e286={'include':[{'model':db['Pause'],'as':_0xeef7('0x3f')}]},_0x535508={},_0x1df283={'count':0x0,'rows':[]};var _0x80103f=_[_0xeef7('0x40')](db[_0xeef7('0x41')][_0xeef7('0x42')],function(_0xe1d836){return{'name':_0xe1d836[_0xeef7('0x43')],'type':_0xe1d836[_0xeef7('0x44')][_0xeef7('0x45')]};});_0x535508[_0xeef7('0x46')]=_[_0xeef7('0x40')](_0x80103f,_0xeef7('0x3c'));_0x535508[_0xeef7('0x47')]=_[_0xeef7('0x48')](_0xb6007e['query']);_0x535508[_0xeef7('0x49')]=_['intersection'](_0x535508[_0xeef7('0x46')],_0x535508[_0xeef7('0x47')]);_0x40e286[_0xeef7('0x4a')]=_[_0xeef7('0x4b')](_0x535508['model'],qs['fields'](_0xb6007e['query'][_0xeef7('0x4c')]));_0x40e286['attributes']=_0x40e286[_0xeef7('0x4a')][_0xeef7('0x4d')]?_0x40e286['attributes']:_0x535508[_0xeef7('0x46')];if(!_0xb6007e[_0xeef7('0x47')][_0xeef7('0x4e')]('nolimit')){_0x40e286['limit']=qs['limit'](_0xb6007e[_0xeef7('0x47')][_0xeef7('0x31')]);_0x40e286[_0xeef7('0x2f')]=qs[_0xeef7('0x2f')](_0xb6007e[_0xeef7('0x47')][_0xeef7('0x2f')]);}_0x40e286[_0xeef7('0x4f')]=qs[_0xeef7('0x50')](_0xb6007e[_0xeef7('0x47')]['sort']);_0x40e286['where']=qs[_0xeef7('0x49')](_['pick'](_0xb6007e[_0xeef7('0x47')],_0x535508[_0xeef7('0x49')]),_0x80103f);if(_0xb6007e[_0xeef7('0x47')][_0xeef7('0x51')]){_0x40e286[_0xeef7('0x52')]=_['merge'](_0x40e286[_0xeef7('0x52')],{'$or':_[_0xeef7('0x40')](_0x80103f,function(_0x989af4){if(_0x989af4[_0xeef7('0x44')]!=='VIRTUAL'){var _0x43d7d8={};_0x43d7d8[_0x989af4['name']]={'$like':'%'+_0xb6007e[_0xeef7('0x47')][_0xeef7('0x51')]+'%'};return _0x43d7d8;}})});}_0x40e286=_[_0xeef7('0x53')]({},_0x40e286,_0xb6007e[_0xeef7('0x54')]);var _0x220513={'where':_0x40e286[_0xeef7('0x52')]};return db[_0xeef7('0x41')][_0xeef7('0x32')](_0x220513)[_0xeef7('0x23')](function(_0x291bb2){_0x1df283['count']=_0x291bb2;if(_0xb6007e[_0xeef7('0x47')][_0xeef7('0x55')]){_0x40e286['include']=[{'all':!![]}];}return db[_0xeef7('0x41')][_0xeef7('0x56')](_0x40e286);})['then'](function(_0x48ce8e){_0x1df283[_0xeef7('0x57')]=_0x48ce8e;return _0x1df283;})[_0xeef7('0x23')](respondWithFilteredResult(_0x294fbe,_0x40e286))[_0xeef7('0x2b')](handleError(_0x294fbe,null));};exports[_0xeef7('0x58')]=function(_0xd34820,_0x19cd44){var _0x1d4c86={'raw':![],'where':{'id':_0xd34820[_0xeef7('0x59')]['id']},'include':[{'model':db[_0xeef7('0x5a')],'as':_0xeef7('0x3f')}]},_0x41e266={};_0x41e266['model']=_[_0xeef7('0x48')](db[_0xeef7('0x41')][_0xeef7('0x42')]);_0x41e266['query']=_[_0xeef7('0x48')](_0xd34820['query']);_0x41e266[_0xeef7('0x49')]=_[_0xeef7('0x4b')](_0x41e266[_0xeef7('0x46')],_0x41e266['query']);_0x1d4c86[_0xeef7('0x4a')]=_[_0xeef7('0x4b')](_0x41e266[_0xeef7('0x46')],qs['fields'](_0xd34820[_0xeef7('0x47')][_0xeef7('0x4c')]));_0x1d4c86[_0xeef7('0x4a')]=_0x1d4c86['attributes'][_0xeef7('0x4d')]?_0x1d4c86[_0xeef7('0x4a')]:_0x41e266['model'];if(_0xd34820[_0xeef7('0x47')]['includeAll']){_0x1d4c86[_0xeef7('0x5b')]=[{'all':!![]}];}_0x1d4c86=_['merge']({},_0x1d4c86,_0xd34820[_0xeef7('0x54')]);return db[_0xeef7('0x41')][_0xeef7('0x5c')](_0x1d4c86)[_0xeef7('0x23')](handleEntityNotFound(_0x19cd44,null))[_0xeef7('0x23')](respondWithResult(_0x19cd44,null))[_0xeef7('0x2b')](handleError(_0x19cd44,null));};exports[_0xeef7('0x5d')]=function(_0x44322a,_0x204bf0){return db[_0xeef7('0x41')][_0xeef7('0x5d')](_0x44322a[_0xeef7('0x5e')],{})[_0xeef7('0x23')](function(_0x451adc){var _0x334884=_0x44322a[_0xeef7('0x5f')][_0xeef7('0x39')]({'plain':!![]});if(!_0x334884)throw new Error(_0xeef7('0x60'));if(_0x334884[_0xeef7('0x61')]==='user'){var _0x4e401e=_0x451adc[_0xeef7('0x39')]({'plain':!![]});var _0x34d41a=_0xeef7('0x3a');return db[_0xeef7('0x62')][_0xeef7('0x5c')]({'where':{'name':_0x34d41a,'userProfileId':_0x334884[_0xeef7('0x63')]},'raw':!![]})[_0xeef7('0x23')](function(_0x3974aa){if(_0x3974aa&&_0x3974aa[_0xeef7('0x64')]===0x0){return db[_0xeef7('0x65')][_0xeef7('0x5d')]({'name':_0x4e401e[_0xeef7('0x3c')],'resourceId':_0x4e401e['id'],'type':_0x3974aa[_0xeef7('0x3c')],'sectionId':_0x3974aa['id']},{})[_0xeef7('0x23')](function(){return _0x451adc;});}else{return _0x451adc;}})['catch'](function(_0x5aea4f){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5aea4f);throw _0x5aea4f;});}return _0x451adc;})[_0xeef7('0x23')](respondWithResult(_0x204bf0,0xc9))[_0xeef7('0x2b')](handleError(_0x204bf0,null));};exports[_0xeef7('0x37')]=function(_0x1d0983,_0x151aec){if(_0x1d0983[_0xeef7('0x5e')]['id']){delete _0x1d0983[_0xeef7('0x5e')]['id'];}return db[_0xeef7('0x41')][_0xeef7('0x5c')]({'where':{'id':_0x1d0983[_0xeef7('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xeef7('0x3f')}]})['then'](handleEntityNotFound(_0x151aec,null))[_0xeef7('0x23')](saveUpdates(_0x1d0983[_0xeef7('0x5e')],null))[_0xeef7('0x23')](respondWithResult(_0x151aec,null))['catch'](handleError(_0x151aec,null));};exports[_0xeef7('0x38')]=function(_0x1a11aa,_0x20851f){return db[_0xeef7('0x41')]['find']({'where':{'id':_0x1a11aa[_0xeef7('0x59')]['id']}})['then'](handleEntityNotFound(_0x20851f,null))[_0xeef7('0x23')](removeEntity(_0x20851f,null))[_0xeef7('0x2b')](handleError(_0x20851f,null));};exports[_0xeef7('0x66')]=function(_0x388584,_0x121cf7){return db[_0xeef7('0x41')][_0xeef7('0x66')]()[_0xeef7('0x23')](respondWithResult(_0x121cf7,null))[_0xeef7('0x2b')](handleError(_0x121cf7,null));};exports[_0xeef7('0x67')]=function(_0x196b04,_0x23cf83,_0x1c3667){if(_0x196b04['body']['id']){delete _0x196b04[_0xeef7('0x5e')]['id'];}return db[_0xeef7('0x41')][_0xeef7('0x5c')]({'where':{'id':_0x196b04[_0xeef7('0x59')]['id']}})[_0xeef7('0x23')](handleEntityNotFound(_0x23cf83,null))['then'](function(_0x2c0fcb){if(_0x2c0fcb){_0x196b04[_0xeef7('0x5e')][_0xeef7('0x68')]=_0x2c0fcb['id'];return db['Disposition'][_0xeef7('0x5d')](_0x196b04[_0xeef7('0x5e')]);}})['then'](respondWithResult(_0x23cf83,null))[_0xeef7('0x2b')](handleError(_0x23cf83,null));};exports['getDispositions']=function(_0x22df53,_0x1c9c09,_0x291945){var _0x5dbf05={'raw':![],'where':{}};var _0x468e25={};var _0x1f46e1={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xeef7('0x69')]({'where':{'id':_0x22df53[_0xeef7('0x59')]['id']}})['then'](handleEntityNotFound(_0x1c9c09,null))['then'](function(_0x598475){if(_0x598475){_0x468e25[_0xeef7('0x46')]=_[_0xeef7('0x48')](db[_0xeef7('0x6a')][_0xeef7('0x42')]);_0x468e25[_0xeef7('0x47')]=_[_0xeef7('0x48')](_0x22df53[_0xeef7('0x47')]);_0x468e25['filters']=_['intersection'](_0x468e25[_0xeef7('0x46')],_0x468e25[_0xeef7('0x47')]);_0x5dbf05[_0xeef7('0x4a')]=_['intersection'](_0x468e25[_0xeef7('0x46')],qs[_0xeef7('0x4c')](_0x22df53[_0xeef7('0x47')]['fields']));_0x5dbf05[_0xeef7('0x4a')]=_0x5dbf05[_0xeef7('0x4a')][_0xeef7('0x4d')]?_0x5dbf05[_0xeef7('0x4a')]:_0x468e25[_0xeef7('0x46')];if(!_0x22df53['query'][_0xeef7('0x4e')](_0xeef7('0x6b'))){_0x5dbf05['limit']=qs[_0xeef7('0x31')](_0x22df53[_0xeef7('0x47')][_0xeef7('0x31')]);_0x5dbf05[_0xeef7('0x2f')]=qs[_0xeef7('0x2f')](_0x22df53['query'][_0xeef7('0x2f')]);}_0x5dbf05['order']=qs[_0xeef7('0x50')](_0x22df53[_0xeef7('0x47')][_0xeef7('0x50')]);_0x5dbf05[_0xeef7('0x52')]=qs[_0xeef7('0x49')](_[_0xeef7('0x6c')](_0x22df53[_0xeef7('0x47')],_0x468e25[_0xeef7('0x49')]));_0x5dbf05[_0xeef7('0x52')][_0xeef7('0x68')]=_0x598475['id'];if(_0x22df53[_0xeef7('0x47')][_0xeef7('0x51')]){_0x5dbf05[_0xeef7('0x52')]=_[_0xeef7('0x53')](_0x5dbf05[_0xeef7('0x52')],{'$or':_[_0xeef7('0x40')](_0x5dbf05[_0xeef7('0x4a')],function(_0x4fb0a5){var _0xc51c9e={};_0xc51c9e[_0x4fb0a5]={'$like':'%'+_0x22df53[_0xeef7('0x47')][_0xeef7('0x51')]+'%'};return _0xc51c9e;})});}_0x5dbf05=_[_0xeef7('0x53')]({},_0x5dbf05,_0x22df53[_0xeef7('0x54')]);return db[_0xeef7('0x6a')][_0xeef7('0x32')]({'where':_0x5dbf05[_0xeef7('0x52')]})['then'](function(_0x176472){_0x1f46e1[_0xeef7('0x32')]=_0x176472;if(_0x22df53[_0xeef7('0x47')][_0xeef7('0x55')]){_0x5dbf05[_0xeef7('0x5b')]=[{'all':!![]}];}return db[_0xeef7('0x6a')]['findAll'](_0x5dbf05);})['then'](function(_0x3a145b){_0x1f46e1[_0xeef7('0x57')]=_0x3a145b;return _0x1f46e1;});}})[_0xeef7('0x23')](respondWithFilteredResult(_0x1c9c09,_0x5dbf05))[_0xeef7('0x2b')](handleError(_0x1c9c09,null));};exports[_0xeef7('0x6d')]=function(_0x1bf2b4,_0x50ea63,_0x2bf3ef){return db['WhatsappAccount'][_0xeef7('0x5c')]({'where':{'id':_0x1bf2b4[_0xeef7('0x59')]['id']}})['then'](handleEntityNotFound(_0x50ea63,null))['then'](function(_0x2d521a){if(_0x2d521a){return _0x2d521a[_0xeef7('0x6d')](_0x1bf2b4[_0xeef7('0x47')][_0xeef7('0x6e')]);}})[_0xeef7('0x23')](respondWithStatusCode(_0x50ea63,null))[_0xeef7('0x2b')](handleError(_0x50ea63,null));};exports['addAnswer']=function(_0x989226,_0x1e9baf,_0x355781){if(_0x989226[_0xeef7('0x5e')]['id']){delete _0x989226['body']['id'];}return db[_0xeef7('0x41')][_0xeef7('0x5c')]({'where':{'id':_0x989226[_0xeef7('0x59')]['id']}})[_0xeef7('0x23')](handleEntityNotFound(_0x1e9baf,null))['then'](function(_0x10f095){if(_0x10f095){_0x989226[_0xeef7('0x5e')][_0xeef7('0x68')]=_0x10f095['id'];return db[_0xeef7('0x6f')]['create'](_0x989226[_0xeef7('0x5e')]);}})[_0xeef7('0x23')](respondWithResult(_0x1e9baf,null))[_0xeef7('0x2b')](handleError(_0x1e9baf,null));};exports[_0xeef7('0x70')]=function(_0x174afa,_0x54fe35,_0x1dd1bd){var _0xdc1a85={'raw':![],'where':{}};var _0x53a3bd={};var _0x23e46b={'count':0x0,'rows':[]};return db[_0xeef7('0x41')][_0xeef7('0x69')]({'where':{'id':_0x174afa[_0xeef7('0x59')]['id']}})[_0xeef7('0x23')](handleEntityNotFound(_0x54fe35,null))[_0xeef7('0x23')](function(_0x33135c){if(_0x33135c){_0x53a3bd['model']=_[_0xeef7('0x48')](db[_0xeef7('0x6f')]['rawAttributes']);_0x53a3bd['query']=_[_0xeef7('0x48')](_0x174afa[_0xeef7('0x47')]);_0x53a3bd[_0xeef7('0x49')]=_['intersection'](_0x53a3bd[_0xeef7('0x46')],_0x53a3bd['query']);_0xdc1a85[_0xeef7('0x4a')]=_['intersection'](_0x53a3bd[_0xeef7('0x46')],qs[_0xeef7('0x4c')](_0x174afa[_0xeef7('0x47')]['fields']));_0xdc1a85[_0xeef7('0x4a')]=_0xdc1a85[_0xeef7('0x4a')][_0xeef7('0x4d')]?_0xdc1a85[_0xeef7('0x4a')]:_0x53a3bd['model'];if(!_0x174afa[_0xeef7('0x47')][_0xeef7('0x4e')](_0xeef7('0x6b'))){_0xdc1a85[_0xeef7('0x31')]=qs['limit'](_0x174afa[_0xeef7('0x47')][_0xeef7('0x31')]);_0xdc1a85[_0xeef7('0x2f')]=qs[_0xeef7('0x2f')](_0x174afa[_0xeef7('0x47')][_0xeef7('0x2f')]);}_0xdc1a85[_0xeef7('0x4f')]=qs[_0xeef7('0x50')](_0x174afa[_0xeef7('0x47')][_0xeef7('0x50')]);_0xdc1a85[_0xeef7('0x52')]=qs[_0xeef7('0x49')](_['pick'](_0x174afa[_0xeef7('0x47')],_0x53a3bd['filters']));_0xdc1a85['where'][_0xeef7('0x68')]=_0x33135c['id'];if(_0x174afa[_0xeef7('0x47')][_0xeef7('0x51')]){_0xdc1a85[_0xeef7('0x52')]=_[_0xeef7('0x53')](_0xdc1a85[_0xeef7('0x52')],{'$or':_[_0xeef7('0x40')](_0xdc1a85[_0xeef7('0x4a')],function(_0x1e8601){var _0x823f4f={};_0x823f4f[_0x1e8601]={'$like':'%'+_0x174afa[_0xeef7('0x47')][_0xeef7('0x51')]+'%'};return _0x823f4f;})});}_0xdc1a85=_[_0xeef7('0x53')]({},_0xdc1a85,_0x174afa['options']);return db[_0xeef7('0x6f')]['count']({'where':_0xdc1a85[_0xeef7('0x52')]})[_0xeef7('0x23')](function(_0x4c7998){_0x23e46b[_0xeef7('0x32')]=_0x4c7998;if(_0x174afa['query']['includeAll']){_0xdc1a85[_0xeef7('0x5b')]=[{'all':!![]}];}return db[_0xeef7('0x6f')][_0xeef7('0x56')](_0xdc1a85);})['then'](function(_0x19b689){_0x23e46b[_0xeef7('0x57')]=_0x19b689;return _0x23e46b;});}})[_0xeef7('0x23')](respondWithFilteredResult(_0x54fe35,_0xdc1a85))['catch'](handleError(_0x54fe35,null));};exports[_0xeef7('0x71')]=function(_0x4803e2,_0xd32041,_0x40eb40){return db[_0xeef7('0x41')][_0xeef7('0x5c')]({'where':{'id':_0x4803e2['params']['id']}})[_0xeef7('0x23')](handleEntityNotFound(_0xd32041,null))[_0xeef7('0x23')](function(_0x5cb074){if(_0x5cb074){return _0x5cb074[_0xeef7('0x71')](_0x4803e2[_0xeef7('0x47')][_0xeef7('0x6e')]);}})[_0xeef7('0x23')](respondWithStatusCode(_0xd32041,null))[_0xeef7('0x2b')](handleError(_0xd32041,null));};exports[_0xeef7('0x72')]=function(_0x14cd10,_0x9b6b01,_0x146e84){return db[_0xeef7('0x41')][_0xeef7('0x5c')]({'where':{'id':_0x14cd10['params']['id']}})[_0xeef7('0x23')](handleEntityNotFound(_0x9b6b01,null))[_0xeef7('0x23')](function(_0x43695f){if(_0x43695f){return _0x43695f[_0xeef7('0x72')](_0x14cd10['body']['ids'],_['omit'](_0x14cd10[_0xeef7('0x5e')],[_0xeef7('0x6e'),'id'])||{})[_0xeef7('0x73')](function(_0x3572d6){for(var _0x28943f=0x0;_0x28943f<_0x14cd10[_0xeef7('0x5e')][_0xeef7('0x6e')][_0xeef7('0x4d')];_0x28943f+=0x1){socket[_0xeef7('0x74')](_0xeef7('0x75'),{'UserId':Number(_0x14cd10[_0xeef7('0x5e')][_0xeef7('0x6e')][_0x28943f]),'WhatsappAccountId':Number(_0x14cd10[_0xeef7('0x59')]['id'])});}return _0x3572d6;});}})[_0xeef7('0x23')](respondWithResult(_0x9b6b01,null))[_0xeef7('0x2b')](handleError(_0x9b6b01,null));};exports['removeAgents']=function(_0x1c4bea,_0x4063df,_0x1313c1){return db[_0xeef7('0x41')][_0xeef7('0x5c')]({'where':{'id':_0x1c4bea['params']['id']}})[_0xeef7('0x23')](handleEntityNotFound(_0x4063df,null))[_0xeef7('0x23')](function(_0x2c760f){if(_0x2c760f){return _0x2c760f[_0xeef7('0x76')](_0x1c4bea['query']['ids'])[_0xeef7('0x23')](function(){if(_['isArray'](_0x1c4bea[_0xeef7('0x47')]['ids'])){for(var _0x37978a=0x0;_0x37978a<_0x1c4bea[_0xeef7('0x47')][_0xeef7('0x6e')][_0xeef7('0x4d')];_0x37978a+=0x1){socket['emit'](_0xeef7('0x77'),{'UserId':Number(_0x1c4bea['query']['ids'][_0x37978a]),'WhatsappAccountId':Number(_0x1c4bea[_0xeef7('0x59')]['id'])});}}else{socket['emit'](_0xeef7('0x77'),{'UserId':Number(_0x1c4bea[_0xeef7('0x47')]['ids']),'WhatsappAccountId':Number(_0x1c4bea[_0xeef7('0x59')]['id'])});}});}})[_0xeef7('0x23')](respondWithStatusCode(_0x4063df,null))['catch'](handleError(_0x4063df,null));};exports[_0xeef7('0x78')]=function(_0x12c859,_0x5b016a,_0xfb0ab1){var _0xc1abc3={};var _0x35b779={};var _0x175dcd;var _0x19eb56;return db[_0xeef7('0x41')]['findOne']({'where':{'id':_0x12c859['params']['id']}})[_0xeef7('0x23')](handleEntityNotFound(_0x5b016a,null))['then'](function(_0x4c0555){if(_0x4c0555){_0x175dcd=_0x4c0555;_0x35b779[_0xeef7('0x46')]=_[_0xeef7('0x48')](db[_0xeef7('0x79')][_0xeef7('0x42')]);_0x35b779[_0xeef7('0x47')]=_[_0xeef7('0x48')](_0x12c859[_0xeef7('0x47')]);_0x35b779[_0xeef7('0x49')]=_[_0xeef7('0x4b')](_0x35b779[_0xeef7('0x46')],_0x35b779['query']);_0xc1abc3['attributes']=_['intersection'](_0x35b779[_0xeef7('0x46')],qs[_0xeef7('0x4c')](_0x12c859['query'][_0xeef7('0x4c')]));_0xc1abc3[_0xeef7('0x4a')]=_0xc1abc3[_0xeef7('0x4a')]['length']?_0xc1abc3[_0xeef7('0x4a')]:_0x35b779[_0xeef7('0x46')];_0xc1abc3[_0xeef7('0x4f')]=qs['sort'](_0x12c859[_0xeef7('0x47')][_0xeef7('0x50')]);_0xc1abc3['where']=qs[_0xeef7('0x49')](_[_0xeef7('0x6c')](_0x12c859[_0xeef7('0x47')],_0x35b779[_0xeef7('0x49')]));if(_0x12c859['query'][_0xeef7('0x51')]){_0xc1abc3[_0xeef7('0x52')]=_[_0xeef7('0x53')](_0xc1abc3['where'],{'$or':_['map'](_0xc1abc3['attributes'],function(_0x283ecc){var _0x1070bb={};_0x1070bb[_0x283ecc]={'$like':'%'+_0x12c859[_0xeef7('0x47')][_0xeef7('0x51')]+'%'};return _0x1070bb;})});}_0xc1abc3=_[_0xeef7('0x53')]({},_0xc1abc3,_0x12c859['options']);return _0x175dcd[_0xeef7('0x78')](_0xc1abc3);}})['then'](function(_0x216517){if(_0x216517){_0x19eb56=_0x216517[_0xeef7('0x4d')];if(!_0x12c859[_0xeef7('0x47')][_0xeef7('0x4e')](_0xeef7('0x6b'))){_0xc1abc3[_0xeef7('0x31')]=qs[_0xeef7('0x31')](_0x12c859['query'][_0xeef7('0x31')]);_0xc1abc3[_0xeef7('0x2f')]=qs[_0xeef7('0x2f')](_0x12c859[_0xeef7('0x47')][_0xeef7('0x2f')]);}return _0x175dcd[_0xeef7('0x78')](_0xc1abc3);}})[_0xeef7('0x23')](function(_0x53c34c){if(_0x53c34c){return _0x53c34c?{'count':_0x19eb56,'rows':_0x53c34c}:null;}})[_0xeef7('0x23')](respondWithResult(_0x5b016a,null))[_0xeef7('0x2b')](handleError(_0x5b016a,null));};exports[_0xeef7('0x7a')]=function(_0x35259e,_0x5bf0b3,_0x317fc9){return db[_0xeef7('0x41')][_0xeef7('0x69')]({'where':{'id':_0x35259e[_0xeef7('0x59')]['id']}})[_0xeef7('0x23')](handleEntityNotFound(_0x5bf0b3,null))[_0xeef7('0x23')](function(_0xcfb8c1){if(_0xcfb8c1){return db[_0xeef7('0x7b')]['transaction'](function(_0x7a147d){return db[_0xeef7('0x7c')][_0xeef7('0x38')]({'where':{'WhatsappAccountId':_0x35259e[_0xeef7('0x59')]['id']},'transaction':_0x7a147d})['then'](function(_0x54f321){var _0x6274d3=_[_0xeef7('0x40')](_0x35259e[_0xeef7('0x5e')],function(_0x2d2456){_0x2d2456['WhatsappAccountId']=_0x35259e['params']['id'];return _0x2d2456;});return db[_0xeef7('0x7c')][_0xeef7('0x7d')](_0x6274d3,{'transaction':_0x7a147d});});})[_0xeef7('0x23')](function(){return db[_0xeef7('0x7c')][_0xeef7('0x7e')]({'where':{'WhatsappAccountId':_0x35259e[_0xeef7('0x59')]['id']},'order':_0xeef7('0x7f')});});}})[_0xeef7('0x23')](respondWithResult(_0x5bf0b3,null))['catch'](handleError(_0x5bf0b3,null));};exports[_0xeef7('0x80')]=function(_0x3e74b5,_0x34d8ee,_0x597fc3){var _0x81c0ca={};var _0x3e94ca={};var _0x260c9c;var _0x57018d;return db[_0xeef7('0x41')][_0xeef7('0x69')]({'where':{'id':_0x3e74b5[_0xeef7('0x59')]['id']}})[_0xeef7('0x23')](handleEntityNotFound(_0x34d8ee,null))[_0xeef7('0x23')](function(_0x37e4c7){if(_0x37e4c7){_0x260c9c=_0x37e4c7;_0x3e94ca['model']=_[_0xeef7('0x48')](db[_0xeef7('0x7c')]['rawAttributes']);_0x3e94ca[_0xeef7('0x47')]=_[_0xeef7('0x48')](_0x3e74b5[_0xeef7('0x47')]);_0x3e94ca[_0xeef7('0x49')]=_[_0xeef7('0x4b')](_0x3e94ca[_0xeef7('0x46')],_0x3e94ca[_0xeef7('0x47')]);_0x81c0ca['attributes']=_[_0xeef7('0x4b')](_0x3e94ca[_0xeef7('0x46')],qs['fields'](_0x3e74b5['query'][_0xeef7('0x4c')]));_0x81c0ca['attributes']=_0x81c0ca[_0xeef7('0x4a')][_0xeef7('0x4d')]?_0x81c0ca[_0xeef7('0x4a')]:_0x3e94ca[_0xeef7('0x46')];_0x81c0ca[_0xeef7('0x4f')]=qs[_0xeef7('0x50')](_0x3e74b5[_0xeef7('0x47')][_0xeef7('0x50')]);_0x81c0ca[_0xeef7('0x52')]=qs[_0xeef7('0x49')](_[_0xeef7('0x6c')](_0x3e74b5[_0xeef7('0x47')],_0x3e94ca['filters']));if(_0x3e74b5['query'][_0xeef7('0x51')]){_0x81c0ca['where']=_[_0xeef7('0x53')](_0x81c0ca[_0xeef7('0x52')],{'$or':_[_0xeef7('0x40')](_0x81c0ca['attributes'],function(_0x14763e){var _0x80550f={};_0x80550f[_0x14763e]={'$like':'%'+_0x3e74b5[_0xeef7('0x47')][_0xeef7('0x51')]+'%'};return _0x80550f;})});}_0x81c0ca=_[_0xeef7('0x53')]({},_0x81c0ca,_0x3e74b5[_0xeef7('0x54')]);return _0x260c9c[_0xeef7('0x80')](_0x81c0ca);}})['then'](function(_0x2145ef){if(_0x2145ef){_0x57018d=_0x2145ef['length'];if(!_0x3e74b5[_0xeef7('0x47')][_0xeef7('0x4e')](_0xeef7('0x6b'))){_0x81c0ca['limit']=qs[_0xeef7('0x31')](_0x3e74b5[_0xeef7('0x47')]['limit']);_0x81c0ca[_0xeef7('0x2f')]=qs[_0xeef7('0x2f')](_0x3e74b5[_0xeef7('0x47')]['offset']);}return _0x260c9c[_0xeef7('0x80')](_0x81c0ca);}})[_0xeef7('0x23')](function(_0x5b6d5a){if(_0x5b6d5a){return _0x5b6d5a?{'count':_0x57018d,'rows':_0x5b6d5a}:null;}})[_0xeef7('0x23')](respondWithResult(_0x34d8ee,null))['catch'](handleError(_0x34d8ee,null));};exports[_0xeef7('0x81')]=function(_0x29cda5,_0x68adf1,_0x3cbcbd){var _0x36628a={'channel':_0xeef7('0x82')};var _0x366efd=[];var _0x3e6d84=[];var _0x4d0193={};return db[_0xeef7('0x41')][_0xeef7('0x5c')]({'where':{'id':_0x29cda5[_0xeef7('0x59')]['id']},'include':[{'model':db[_0xeef7('0x7c')],'as':_0xeef7('0x83')}]})[_0xeef7('0x23')](handleEntityNotFound(_0x68adf1,null))[_0xeef7('0x23')](function(_0x3483c2){_0x36628a[_0xeef7('0x84')]=_0x3483c2;_0x36628a[_0xeef7('0x85')]=_['orderBy'](_0x3483c2['Applications'],[_0xeef7('0x7f')],['asc']);if(_0x36628a[_0xeef7('0x84')][_0xeef7('0x83')]){delete _0x36628a[_0xeef7('0x84')][_0xeef7('0x83')];}return db[_0xeef7('0x86')][_0xeef7('0x66')]();})[_0xeef7('0x23')](function(_0x3d251e){if(!_0x3d251e){throw new db['Sequelize'][(_0xeef7('0x87'))]('no\x20available\x20attributes');}_0x366efd=_[_0xeef7('0x88')](_[_0xeef7('0x48')](_0x3d251e),[_0xeef7('0x89'),'updatedAt']);_0x3e6d84=_[_0xeef7('0x88')](_[_0xeef7('0x48')](_0x3d251e),[_0xeef7('0x89'),'updatedAt',_0xeef7('0x8a'),'ListId']);_0x36628a[_0xeef7('0x5e')]={'mapKey':_0xeef7('0x8b')};if(_0x36628a[_0xeef7('0x84')][_0xeef7('0x44')]&&_0x36628a[_0xeef7('0x84')][_0xeef7('0x44')]===_0xeef7('0x8c')){_0x36628a[_0xeef7('0x5e')][_0xeef7('0x8d')]=_0x29cda5['body'][_0xeef7('0x8e')][_0xeef7('0x8f')](_0xeef7('0x90'),'');_0x36628a[_0xeef7('0x5e')][_0xeef7('0x5e')]=_0x29cda5[_0xeef7('0x5e')][_0xeef7('0x91')];_0x36628a['body'][_0xeef7('0x92')]=_0x29cda5[_0xeef7('0x5e')][_0xeef7('0x93')];}if(_0x36628a[_0xeef7('0x5e')]['id']){delete _0x36628a[_0xeef7('0x5e')]['id'];}if(_[_0xeef7('0x94')](_0x36628a[_0xeef7('0x5e')]['from'])){throw new db['Sequelize'][(_0xeef7('0x87'))]('from\x20is\x20mandatory');}if(_[_0xeef7('0x94')](_0x36628a[_0xeef7('0x5e')]['body'])||_0x36628a[_0xeef7('0x5e')][_0xeef7('0x5e')]===''){throw new db[(_0xeef7('0x95'))][(_0xeef7('0x87'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xeef7('0x94')](_0x36628a[_0xeef7('0x5e')][_0xeef7('0x96')])){throw new db[(_0xeef7('0x95'))][(_0xeef7('0x87'))](_0xeef7('0x97')+_0x3e6d84);}if(!_[_0xeef7('0x98')](_0x3e6d84,_0x36628a[_0xeef7('0x5e')]['mapKey'])){throw new db[(_0xeef7('0x95'))][(_0xeef7('0x87'))](_0xeef7('0x99')+_0x3e6d84);}_0x4d0193[_0x36628a[_0xeef7('0x5e')]['mapKey']]=_0x36628a['body'][_0xeef7('0x8d')];return db['CmList'][_0xeef7('0x5c')]({'where':{'id':_0x36628a['account'][_0xeef7('0x9a')]},'include':[{'model':db[_0xeef7('0x86')],'as':'Contacts','where':_0x4d0193,'limit':0x1,'order':[['updatedAt',_0xeef7('0x9b')]]}]});})[_0xeef7('0x23')](handleEntityNotFound(_0x68adf1,null))[_0xeef7('0x23')](function(_0x39379b){if(_0x39379b){_0x36628a[_0xeef7('0x9c')]=_['omit'](_0x39379b,[_0xeef7('0x9d')]);if(_0x39379b[_0xeef7('0x9d')]['length']){return _0x39379b[_0xeef7('0x9d')][0x0];}var _0x57a84d=_[_0xeef7('0x1d')](_0x36628a[_0xeef7('0x5e')],{'firstName':_0x36628a[_0xeef7('0x5e')][_0xeef7('0x8d')],'ListId':_0x39379b['id']});_0x57a84d[_0x36628a[_0xeef7('0x5e')][_0xeef7('0x96')]]=_0x36628a[_0xeef7('0x5e')]['from'];return db[_0xeef7('0x86')]['create'](_0x57a84d,{'fields':_0x366efd,'raw':!![]});}})['then'](handleEntityNotFound(_0x68adf1,null))[_0xeef7('0x23')](function(_0x38c1ff){if(_0x38c1ff){_0x36628a['contact']=_0x38c1ff;var _0x34ec64={'ContactId':_0x38c1ff['id'],'phone':_0x36628a[_0xeef7('0x5e')][_0xeef7('0x8d')],'WhatsappAccountId':_0x29cda5['params']['id']};var _0x532c1a={'ContactId':_0x38c1ff['id'],'WhatsappAccountId':_0x29cda5[_0xeef7('0x59')]['id'],'closed':![]};return db[_0xeef7('0x9e')][_0xeef7('0x5c')]({'where':_0x532c1a})[_0xeef7('0x23')](function(_0x21ccd7){if(_0x21ccd7){return[_0x21ccd7,![]];}return db[_0xeef7('0x9e')][_0xeef7('0x5d')](_0x34ec64)[_0xeef7('0x23')](function(_0x48c502){return[_0x48c502,!![]];});});}})[_0xeef7('0x73')](function(_0x22871b,_0x135d29){_0x36628a[_0xeef7('0x9f')]=_0x22871b[_0xeef7('0x39')]({'plain':!![]});_0x36628a[_0xeef7('0x9f')]['created']=![];if(_0x135d29){if(_0x36628a['account']['autoclose']){_0x36628a[_0xeef7('0x85')][_0xeef7('0xa0')]({'id':0x0,'priority':_0x36628a[_0xeef7('0x85')][_0xeef7('0x4d')]+0x1,'app':_0xeef7('0xa1'),'appdata':_0xeef7('0xa2'),'interval':_0xeef7('0xa3')});}_0x36628a[_0xeef7('0x9f')][_0xeef7('0xa4')]=!![];}return db['WhatsappMessage'][_0xeef7('0x5d')]({'phone':_0x36628a[_0xeef7('0x5e')][_0xeef7('0x8d')],'messageId':_0x36628a[_0xeef7('0x5e')][_0xeef7('0x92')],'body':_0x36628a[_0xeef7('0x5e')][_0xeef7('0x5e')],'WhatsappAccountId':_0x29cda5['params']['id'],'WhatsappInteractionId':_0x22871b['id'],'direction':'in','ContactId':_0x22871b[_0xeef7('0xa5')],'AttachmentId':_0x36628a['body'][_0xeef7('0xa6')]});})[_0xeef7('0x23')](function(_0x33ad71){_0x36628a[_0xeef7('0x2a')]=_0x33ad71;if(_0x36628a['interaction'][_0xeef7('0xa7')]){return db[_0xeef7('0x79')]['find']({'attributes':['id','name'],'where':{'id':_0x36628a[_0xeef7('0x9f')]['UserId']}})['then'](function(_0x9d314a){if(_0x9d314a){_0x36628a['applications'][_0xeef7('0xa8')]({'id':0x0,'priority':0x0,'app':_0xeef7('0xa9'),'appdata':_0x9d314a[_0xeef7('0x3c')]+','+(_0x36628a[_0xeef7('0x84')]['waitForTheAssignedAgent']||0xa),'interval':_0xeef7('0xa3')});}return respondWithRpcPromise('Start',_0xeef7('0xaa'),_0x36628a);});}return respondWithRpcPromise(_0xeef7('0xab'),_0xeef7('0xaa'),_0x36628a);})['then'](function(_0x43de77){if(_0x43de77){var _0x32e8c0=0xc8;var _0x2ab5a8=_0xeef7('0xac');logger[_0xeef7('0x24')](_0xeef7('0xad'),_0x2ab5a8,_0x32e8c0,_0xeef7('0xae'));logger[_0xeef7('0xaf')](_0xeef7('0xb0'),_0x2ab5a8,_0x32e8c0,_0xeef7('0xae'),JSON[_0xeef7('0x27')](_0x43de77));if(_0x36628a[_0xeef7('0x84')][_0xeef7('0x44')]==='twilio'){return _0x68adf1[_0xeef7('0x2e')](_0x32e8c0)[_0xeef7('0xb1')]('Content-Type',_0xeef7('0xb2'))[_0xeef7('0x3d')](_0xeef7('0xb3'));}else{return _0x68adf1[_0xeef7('0x2e')](_0x32e8c0)[_0xeef7('0x34')](_0x43de77);}}})[_0xeef7('0x2b')](handleError(_0x68adf1,null));};exports['send']=function(_0x4fdf54,_0x13398b,_0x5dd1ef){var _0x41b7a0,_0xc79611,_0x413c01;if(_[_0xeef7('0x94')](_0x4fdf54[_0xeef7('0x5e')]['body'])||_0x4fdf54['body']['body']===''){throw new db['Sequelize'][(_0xeef7('0x87'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xeef7('0x94')](_0x4fdf54[_0xeef7('0x5e')]['to'])){throw new db[(_0xeef7('0x95'))]['ValidationError'](_0xeef7('0xb4'));}_0x41b7a0=_0x4fdf54['body']['to'];return db[_0xeef7('0x41')]['find']({'where':{'id':_0x4fdf54[_0xeef7('0x59')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xeef7('0x9d'),'where':{'mobile':_0x41b7a0},'limit':0x1,'order':[[_0xeef7('0xb5'),_0xeef7('0x9b')]]}]}]})['then'](handleEntityNotFound(_0x13398b,null))[_0xeef7('0x23')](function(_0x1f403f){if(_0x1f403f&&_0x1f403f[_0xeef7('0xb6')]){_0xc79611=_0x1f403f[_0xeef7('0x39')]({'plain':!![]});if(_0xc79611[_0xeef7('0xb6')]&&_0xc79611[_0xeef7('0xb6')][_0xeef7('0x9d')][_0xeef7('0x4d')]){return _0xc79611[_0xeef7('0xb6')]['Contacts'][0x0];}return db[_0xeef7('0x86')][_0xeef7('0x5d')](_[_0xeef7('0x1d')](_0x4fdf54[_0xeef7('0x5e')],{'firstName':_0x41b7a0,'mobile':_0x41b7a0,'phone':_0x41b7a0,'ListId':_0xc79611[_0xeef7('0x9a')]}));}})['then'](handleEntityNotFound(_0x13398b,null))[_0xeef7('0x23')](function(_0x1389b9){if(_0x1389b9){_0x413c01=_0x1389b9;return db[_0xeef7('0x9e')][_0xeef7('0x5c')]({'where':{'ContactId':_0x413c01['id'],'closed':![],'WhatsappAccountId':_0xc79611['id']}})[_0xeef7('0x23')](function(_0x8a208f){if(_0x8a208f){return[_0x8a208f,![]];}return db['WhatsappInteraction'][_0xeef7('0x5d')]({'UserId':_0x4fdf54[_0xeef7('0x5f')]['id'],'ContactId':_0x413c01['id'],'WhatsappAccountId':_0xc79611['id'],'phone':_0x41b7a0,'firstMsgDirection':_0xeef7('0xb7'),'Messages':[_['merge'](_0x4fdf54[_0xeef7('0x5e')],{'read':![],'body':_0x4fdf54[_0xeef7('0x5e')][_0xeef7('0x5e')],'phone':_0x41b7a0,'WhatsappAccountId':_0xc79611['id'],'UserId':_0x4fdf54[_0xeef7('0x5f')]['id'],'ContactId':_0x413c01['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0xeef7('0xb8')}]})[_0xeef7('0x23')](function(_0x5c99b4){return[_0x5c99b4,!![]];});});}})[_0xeef7('0x73')](function(_0xcf4225,_0x5ba35a){if(_0x5ba35a){return _0xcf4225;}return db[_0xeef7('0xb9')][_0xeef7('0x5d')](_['merge'](_0x4fdf54[_0xeef7('0x5e')],{'read':![],'body':_0x4fdf54[_0xeef7('0x5e')][_0xeef7('0x5e')],'phone':_0x41b7a0,'WhatsappAccountId':_0xc79611['id'],'WhatsappInteractionId':_0xcf4225['id'],'UserId':_0x4fdf54['user']['id'],'ContactId':_0x413c01['id']}))[_0xeef7('0x23')](function(_0x1a65b1){_0xcf4225['dataValues']['Messages']=[];_0xcf4225[_0xeef7('0xba')][_0xeef7('0xb8')][_0xeef7('0xa0')](_0x1a65b1[_0xeef7('0xba')]);return _0xcf4225;});})[_0xeef7('0x23')](respondWithResult(_0x13398b,null))[_0xeef7('0x2b')](handleError(_0x13398b,null));};
\ No newline at end of file
+var _0x6fe0=['show','params','Pause','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','WhatsappAccountId','Disposition','getDispositions','findOne','findAll','rows','removeDispositions','CannedAnswer','removeAnswers','ids','addAgents','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','applications','orderBy','asc','account','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','From','replace','whatsapp:','messageId','MessageSid','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','list','omit','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','unmanaged','ContactId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','stringify','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','List','defaults','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','WhatsappAccounts','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','WhatsappAccount','include'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x6fe0,0x120));var _0x06fe=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x6fe0[_0xe1b5f6];return _0x44636e;};'use strict';var emlformat=require(_0x06fe('0x0'));var rimraf=require(_0x06fe('0x1'));var zipdir=require(_0x06fe('0x2'));var jsonpatch=require(_0x06fe('0x3'));var rp=require(_0x06fe('0x4'));var moment=require(_0x06fe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x06fe('0x6'));var util=require(_0x06fe('0x7'));var path=require(_0x06fe('0x8'));var sox=require(_0x06fe('0x9'));var csv=require(_0x06fe('0xa'));var ejs=require(_0x06fe('0xb'));var fs=require('fs');var fs_extra=require(_0x06fe('0xc'));var _=require(_0x06fe('0xd'));var squel=require(_0x06fe('0xe'));var crypto=require(_0x06fe('0xf'));var jsforce=require(_0x06fe('0x10'));var deskjs=require(_0x06fe('0x11'));var toCsv=require('to-csv');var querystring=require(_0x06fe('0x12'));var Papa=require(_0x06fe('0x13'));var Redis=require(_0x06fe('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x06fe('0x15'));var as=require(_0x06fe('0x16'));var hardwareService=require(_0x06fe('0x17'));var logger=require(_0x06fe('0x18'))(_0x06fe('0x19'));var utils=require(_0x06fe('0x1a'));var config=require(_0x06fe('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0x06fe('0x1c'))['db'];config[_0x06fe('0x1d')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x06fe('0x1e'))(new Redis(config[_0x06fe('0x1d')]));require(_0x06fe('0x1f'))['register'](socket);var jayson=require(_0x06fe('0x20'));var client=jayson[_0x06fe('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1fc0cb,_0x373adb,_0x375bc8,_0x5521a0){return new BPromise(function(_0x31b462,_0x241105){var _0x163d52=_0x5521a0||client;return _0x163d52[_0x06fe('0x22')](_0x1fc0cb,_0x375bc8)[_0x06fe('0x23')](function(_0x42a7d7){logger[_0x06fe('0x24')](_0x06fe('0x25'),_0x373adb,_0x06fe('0x26'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x373adb,_0x06fe('0x26'),JSON['stringify'](_0x42a7d7));if(_0x42a7d7['error']){if(_0x42a7d7[_0x06fe('0x27')][_0x06fe('0x28')]===0x1f4){logger['error'](_0x06fe('0x25'),_0x373adb,_0x42a7d7[_0x06fe('0x27')][_0x06fe('0x29')]);return _0x241105(_0x42a7d7['error'][_0x06fe('0x29')]);}logger['error'](_0x06fe('0x25'),_0x373adb,_0x42a7d7['error']['message']);return _0x31b462(_0x42a7d7['error'][_0x06fe('0x29')]);}else{logger[_0x06fe('0x24')](_0x06fe('0x25'),_0x373adb,_0x06fe('0x26'));_0x31b462(_0x42a7d7[_0x06fe('0x2a')][_0x06fe('0x29')]);}})[_0x06fe('0x2b')](function(_0x2f404d){logger['error'](_0x06fe('0x25'),_0x373adb,_0x2f404d);_0x241105(_0x2f404d);});});}function respondWithStatusCode(_0x7b36,_0x328691){_0x328691=_0x328691||0xcc;return function(_0x5b95dd){if(_0x5b95dd){return _0x7b36[_0x06fe('0x2c')](_0x328691);}return _0x7b36['status'](_0x328691)['end']();};}function respondWithResult(_0x412a58,_0x128029){_0x128029=_0x128029||0xc8;return function(_0x8cb33c){if(_0x8cb33c){return _0x412a58[_0x06fe('0x2d')](_0x128029)[_0x06fe('0x2e')](_0x8cb33c);}};}function respondWithFilteredResult(_0x150783,_0x19c0d7){return function(_0xdf691a){if(_0xdf691a){var _0x2ac45d=typeof _0x19c0d7[_0x06fe('0x2f')]===_0x06fe('0x30')&&typeof _0x19c0d7[_0x06fe('0x31')]===_0x06fe('0x30');var _0x53b18a=_0xdf691a[_0x06fe('0x32')];var _0x3acded=_0x2ac45d?0x0:_0x19c0d7['offset'];var _0xd3665f=_0x2ac45d?_0xdf691a[_0x06fe('0x32')]:_0x19c0d7[_0x06fe('0x2f')]+_0x19c0d7[_0x06fe('0x31')];var _0x4be744;if(_0xd3665f>=_0x53b18a){_0xd3665f=_0x53b18a;_0x4be744=0xc8;}else{_0x4be744=0xce;}_0x150783[_0x06fe('0x2d')](_0x4be744);return _0x150783[_0x06fe('0x33')]('Content-Range',_0x3acded+'-'+_0xd3665f+'/'+_0x53b18a)[_0x06fe('0x2e')](_0xdf691a);}return null;};}function patchUpdates(_0xd2961){return function(_0x22a590){try{jsonpatch[_0x06fe('0x34')](_0x22a590,_0xd2961,!![]);}catch(_0x5bf088){return BPromise['reject'](_0x5bf088);}return _0x22a590[_0x06fe('0x35')]();};}function saveUpdates(_0x379935,_0xff5d44){return function(_0x41a345){if(_0x41a345){return _0x41a345[_0x06fe('0x36')](_0x379935)[_0x06fe('0x23')](function(_0x305714){return _0x305714;});}return null;};}function removeEntity(_0x52a584,_0x420e80){return function(_0x109d91){if(_0x109d91){return _0x109d91[_0x06fe('0x37')]()[_0x06fe('0x23')](function(){var _0xda552d=_0x109d91['get']({'plain':!![]});var _0x3025ab=_0x06fe('0x38');return db['UserProfileResource'][_0x06fe('0x37')]({'where':{'type':_0x3025ab,'resourceId':_0xda552d['id']}})[_0x06fe('0x23')](function(){return _0x109d91;});})[_0x06fe('0x23')](function(){_0x52a584[_0x06fe('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460562,_0x4b95f8){return function(_0x180aad){if(!_0x180aad){_0x460562['sendStatus'](0x194);}return _0x180aad;};}function handleError(_0x51b036,_0x513006){_0x513006=_0x513006||0x1f4;return function(_0x1be9a5){logger[_0x06fe('0x27')](_0x1be9a5[_0x06fe('0x39')]);if(_0x1be9a5['name']){delete _0x1be9a5[_0x06fe('0x3a')];}_0x51b036[_0x06fe('0x2d')](_0x513006)[_0x06fe('0x3b')](_0x1be9a5);};}exports[_0x06fe('0x3c')]=function(_0x169fd8,_0x1f99dc){var _0x341d5f={'include':[{'model':db['Pause'],'as':_0x06fe('0x3d')}]},_0x3d438c={},_0xd4a147={'count':0x0,'rows':[]};var _0x3e5179=_[_0x06fe('0x3e')](db['WhatsappAccount'][_0x06fe('0x3f')],function(_0x7fe658){return{'name':_0x7fe658[_0x06fe('0x40')],'type':_0x7fe658[_0x06fe('0x41')]['key']};});_0x3d438c[_0x06fe('0x42')]=_[_0x06fe('0x3e')](_0x3e5179,_0x06fe('0x3a'));_0x3d438c[_0x06fe('0x43')]=_[_0x06fe('0x44')](_0x169fd8[_0x06fe('0x43')]);_0x3d438c[_0x06fe('0x45')]=_[_0x06fe('0x46')](_0x3d438c[_0x06fe('0x42')],_0x3d438c[_0x06fe('0x43')]);_0x341d5f['attributes']=_[_0x06fe('0x46')](_0x3d438c[_0x06fe('0x42')],qs[_0x06fe('0x47')](_0x169fd8[_0x06fe('0x43')][_0x06fe('0x47')]));_0x341d5f[_0x06fe('0x48')]=_0x341d5f[_0x06fe('0x48')]['length']?_0x341d5f[_0x06fe('0x48')]:_0x3d438c['model'];if(!_0x169fd8[_0x06fe('0x43')][_0x06fe('0x49')](_0x06fe('0x4a'))){_0x341d5f[_0x06fe('0x31')]=qs[_0x06fe('0x31')](_0x169fd8[_0x06fe('0x43')]['limit']);_0x341d5f[_0x06fe('0x2f')]=qs['offset'](_0x169fd8[_0x06fe('0x43')][_0x06fe('0x2f')]);}_0x341d5f[_0x06fe('0x4b')]=qs[_0x06fe('0x4c')](_0x169fd8['query']['sort']);_0x341d5f[_0x06fe('0x4d')]=qs[_0x06fe('0x45')](_[_0x06fe('0x4e')](_0x169fd8['query'],_0x3d438c[_0x06fe('0x45')]),_0x3e5179);if(_0x169fd8[_0x06fe('0x43')][_0x06fe('0x4f')]){_0x341d5f[_0x06fe('0x4d')]=_[_0x06fe('0x50')](_0x341d5f['where'],{'$or':_[_0x06fe('0x3e')](_0x3e5179,function(_0x1b19ea){if(_0x1b19ea[_0x06fe('0x41')]!=='VIRTUAL'){var _0x4f0781={};_0x4f0781[_0x1b19ea[_0x06fe('0x3a')]]={'$like':'%'+_0x169fd8[_0x06fe('0x43')][_0x06fe('0x4f')]+'%'};return _0x4f0781;}})});}_0x341d5f=_[_0x06fe('0x50')]({},_0x341d5f,_0x169fd8[_0x06fe('0x51')]);var _0x1952e9={'where':_0x341d5f[_0x06fe('0x4d')]};return db[_0x06fe('0x52')][_0x06fe('0x32')](_0x1952e9)['then'](function(_0x42f985){_0xd4a147[_0x06fe('0x32')]=_0x42f985;if(_0x169fd8['query']['includeAll']){_0x341d5f[_0x06fe('0x53')]=[{'all':!![]}];}return db['WhatsappAccount']['findAll'](_0x341d5f);})[_0x06fe('0x23')](function(_0x162a97){_0xd4a147['rows']=_0x162a97;return _0xd4a147;})['then'](respondWithFilteredResult(_0x1f99dc,_0x341d5f))[_0x06fe('0x2b')](handleError(_0x1f99dc,null));};exports[_0x06fe('0x54')]=function(_0x37fc3c,_0x22364c){var _0x272ac5={'raw':![],'where':{'id':_0x37fc3c[_0x06fe('0x55')]['id']},'include':[{'model':db[_0x06fe('0x56')],'as':'mandatoryDispositionPause'}]},_0x142fbc={};_0x142fbc[_0x06fe('0x42')]=_[_0x06fe('0x44')](db['WhatsappAccount']['rawAttributes']);_0x142fbc[_0x06fe('0x43')]=_['keys'](_0x37fc3c[_0x06fe('0x43')]);_0x142fbc[_0x06fe('0x45')]=_[_0x06fe('0x46')](_0x142fbc[_0x06fe('0x42')],_0x142fbc[_0x06fe('0x43')]);_0x272ac5[_0x06fe('0x48')]=_[_0x06fe('0x46')](_0x142fbc[_0x06fe('0x42')],qs[_0x06fe('0x47')](_0x37fc3c['query'][_0x06fe('0x47')]));_0x272ac5[_0x06fe('0x48')]=_0x272ac5[_0x06fe('0x48')][_0x06fe('0x57')]?_0x272ac5['attributes']:_0x142fbc[_0x06fe('0x42')];if(_0x37fc3c[_0x06fe('0x43')][_0x06fe('0x58')]){_0x272ac5[_0x06fe('0x53')]=[{'all':!![]}];}_0x272ac5=_['merge']({},_0x272ac5,_0x37fc3c[_0x06fe('0x51')]);return db['WhatsappAccount'][_0x06fe('0x59')](_0x272ac5)[_0x06fe('0x23')](handleEntityNotFound(_0x22364c,null))['then'](respondWithResult(_0x22364c,null))[_0x06fe('0x2b')](handleError(_0x22364c,null));};exports[_0x06fe('0x5a')]=function(_0x23e206,_0x5081a8){return db[_0x06fe('0x52')][_0x06fe('0x5a')](_0x23e206[_0x06fe('0x5b')],{})[_0x06fe('0x23')](function(_0x4b7291){var _0x3fb3cd=_0x23e206[_0x06fe('0x5c')][_0x06fe('0x5d')]({'plain':!![]});if(!_0x3fb3cd)throw new Error(_0x06fe('0x5e'));if(_0x3fb3cd['role']==='user'){var _0x20f61d=_0x4b7291[_0x06fe('0x5d')]({'plain':!![]});var _0x462071='WhatsappAccounts';return db[_0x06fe('0x5f')][_0x06fe('0x59')]({'where':{'name':_0x462071,'userProfileId':_0x3fb3cd[_0x06fe('0x60')]},'raw':!![]})[_0x06fe('0x23')](function(_0x54f48a){if(_0x54f48a&&_0x54f48a[_0x06fe('0x61')]===0x0){return db[_0x06fe('0x62')][_0x06fe('0x5a')]({'name':_0x20f61d['name'],'resourceId':_0x20f61d['id'],'type':_0x54f48a[_0x06fe('0x3a')],'sectionId':_0x54f48a['id']},{})[_0x06fe('0x23')](function(){return _0x4b7291;});}else{return _0x4b7291;}})['catch'](function(_0x222849){logger['error'](_0x06fe('0x63'),_0x222849);throw _0x222849;});}return _0x4b7291;})['then'](respondWithResult(_0x5081a8,0xc9))['catch'](handleError(_0x5081a8,null));};exports[_0x06fe('0x36')]=function(_0x35ffd9,_0x2cb74e){if(_0x35ffd9[_0x06fe('0x5b')]['id']){delete _0x35ffd9[_0x06fe('0x5b')]['id'];}return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x35ffd9[_0x06fe('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x06fe('0x3d')}]})[_0x06fe('0x23')](handleEntityNotFound(_0x2cb74e,null))[_0x06fe('0x23')](saveUpdates(_0x35ffd9[_0x06fe('0x5b')],null))[_0x06fe('0x23')](respondWithResult(_0x2cb74e,null))[_0x06fe('0x2b')](handleError(_0x2cb74e,null));};exports[_0x06fe('0x37')]=function(_0x18990b,_0x77fd6a){return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x18990b[_0x06fe('0x55')]['id']}})['then'](handleEntityNotFound(_0x77fd6a,null))[_0x06fe('0x23')](removeEntity(_0x77fd6a,null))[_0x06fe('0x2b')](handleError(_0x77fd6a,null));};exports[_0x06fe('0x64')]=function(_0xd10c26,_0x322620){return db['WhatsappAccount']['describe']()[_0x06fe('0x23')](respondWithResult(_0x322620,null))[_0x06fe('0x2b')](handleError(_0x322620,null));};exports['addDisposition']=function(_0x151dd0,_0x4eafb3,_0x345f8a){if(_0x151dd0[_0x06fe('0x5b')]['id']){delete _0x151dd0['body']['id'];}return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x151dd0[_0x06fe('0x55')]['id']}})['then'](handleEntityNotFound(_0x4eafb3,null))['then'](function(_0x4fbdfd){if(_0x4fbdfd){_0x151dd0['body'][_0x06fe('0x65')]=_0x4fbdfd['id'];return db[_0x06fe('0x66')][_0x06fe('0x5a')](_0x151dd0[_0x06fe('0x5b')]);}})[_0x06fe('0x23')](respondWithResult(_0x4eafb3,null))['catch'](handleError(_0x4eafb3,null));};exports[_0x06fe('0x67')]=function(_0x4fbc35,_0x35e55a,_0x253086){var _0x5dd88d={'raw':![],'where':{}};var _0x56d4f1={};var _0x2713af={'count':0x0,'rows':[]};return db[_0x06fe('0x52')][_0x06fe('0x68')]({'where':{'id':_0x4fbc35[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x35e55a,null))[_0x06fe('0x23')](function(_0x21c255){if(_0x21c255){_0x56d4f1[_0x06fe('0x42')]=_[_0x06fe('0x44')](db['Disposition']['rawAttributes']);_0x56d4f1[_0x06fe('0x43')]=_[_0x06fe('0x44')](_0x4fbc35['query']);_0x56d4f1[_0x06fe('0x45')]=_[_0x06fe('0x46')](_0x56d4f1['model'],_0x56d4f1[_0x06fe('0x43')]);_0x5dd88d['attributes']=_[_0x06fe('0x46')](_0x56d4f1[_0x06fe('0x42')],qs[_0x06fe('0x47')](_0x4fbc35[_0x06fe('0x43')][_0x06fe('0x47')]));_0x5dd88d[_0x06fe('0x48')]=_0x5dd88d[_0x06fe('0x48')][_0x06fe('0x57')]?_0x5dd88d[_0x06fe('0x48')]:_0x56d4f1['model'];if(!_0x4fbc35[_0x06fe('0x43')][_0x06fe('0x49')](_0x06fe('0x4a'))){_0x5dd88d[_0x06fe('0x31')]=qs[_0x06fe('0x31')](_0x4fbc35['query'][_0x06fe('0x31')]);_0x5dd88d[_0x06fe('0x2f')]=qs[_0x06fe('0x2f')](_0x4fbc35[_0x06fe('0x43')]['offset']);}_0x5dd88d[_0x06fe('0x4b')]=qs['sort'](_0x4fbc35[_0x06fe('0x43')][_0x06fe('0x4c')]);_0x5dd88d[_0x06fe('0x4d')]=qs[_0x06fe('0x45')](_['pick'](_0x4fbc35['query'],_0x56d4f1['filters']));_0x5dd88d[_0x06fe('0x4d')][_0x06fe('0x65')]=_0x21c255['id'];if(_0x4fbc35[_0x06fe('0x43')][_0x06fe('0x4f')]){_0x5dd88d[_0x06fe('0x4d')]=_[_0x06fe('0x50')](_0x5dd88d['where'],{'$or':_[_0x06fe('0x3e')](_0x5dd88d[_0x06fe('0x48')],function(_0x4fe950){var _0x1e9b5d={};_0x1e9b5d[_0x4fe950]={'$like':'%'+_0x4fbc35[_0x06fe('0x43')]['filter']+'%'};return _0x1e9b5d;})});}_0x5dd88d=_['merge']({},_0x5dd88d,_0x4fbc35['options']);return db[_0x06fe('0x66')]['count']({'where':_0x5dd88d[_0x06fe('0x4d')]})[_0x06fe('0x23')](function(_0xe90e3f){_0x2713af['count']=_0xe90e3f;if(_0x4fbc35[_0x06fe('0x43')]['includeAll']){_0x5dd88d[_0x06fe('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x06fe('0x69')](_0x5dd88d);})[_0x06fe('0x23')](function(_0x198bdf){_0x2713af[_0x06fe('0x6a')]=_0x198bdf;return _0x2713af;});}})[_0x06fe('0x23')](respondWithFilteredResult(_0x35e55a,_0x5dd88d))[_0x06fe('0x2b')](handleError(_0x35e55a,null));};exports[_0x06fe('0x6b')]=function(_0x149075,_0x2ec4e1,_0x54b7ca){return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x149075[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x2ec4e1,null))['then'](function(_0x2d9bf9){if(_0x2d9bf9){return _0x2d9bf9['removeDispositions'](_0x149075['query']['ids']);}})[_0x06fe('0x23')](respondWithStatusCode(_0x2ec4e1,null))['catch'](handleError(_0x2ec4e1,null));};exports['addAnswer']=function(_0x1f8401,_0x8b3553,_0x2fdc88){if(_0x1f8401['body']['id']){delete _0x1f8401[_0x06fe('0x5b')]['id'];}return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x1f8401[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x8b3553,null))['then'](function(_0x297e76){if(_0x297e76){_0x1f8401[_0x06fe('0x5b')][_0x06fe('0x65')]=_0x297e76['id'];return db[_0x06fe('0x6c')][_0x06fe('0x5a')](_0x1f8401['body']);}})[_0x06fe('0x23')](respondWithResult(_0x8b3553,null))['catch'](handleError(_0x8b3553,null));};exports['getAnswers']=function(_0x4aaddb,_0x3e0b3b,_0x2686a3){var _0x144767={'raw':![],'where':{}};var _0x349a5c={};var _0x114a3d={'count':0x0,'rows':[]};return db[_0x06fe('0x52')][_0x06fe('0x68')]({'where':{'id':_0x4aaddb[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x3e0b3b,null))[_0x06fe('0x23')](function(_0xd4b59d){if(_0xd4b59d){_0x349a5c['model']=_[_0x06fe('0x44')](db[_0x06fe('0x6c')]['rawAttributes']);_0x349a5c['query']=_[_0x06fe('0x44')](_0x4aaddb['query']);_0x349a5c[_0x06fe('0x45')]=_['intersection'](_0x349a5c[_0x06fe('0x42')],_0x349a5c[_0x06fe('0x43')]);_0x144767[_0x06fe('0x48')]=_[_0x06fe('0x46')](_0x349a5c[_0x06fe('0x42')],qs[_0x06fe('0x47')](_0x4aaddb[_0x06fe('0x43')][_0x06fe('0x47')]));_0x144767['attributes']=_0x144767[_0x06fe('0x48')][_0x06fe('0x57')]?_0x144767[_0x06fe('0x48')]:_0x349a5c['model'];if(!_0x4aaddb[_0x06fe('0x43')][_0x06fe('0x49')](_0x06fe('0x4a'))){_0x144767['limit']=qs[_0x06fe('0x31')](_0x4aaddb['query'][_0x06fe('0x31')]);_0x144767[_0x06fe('0x2f')]=qs[_0x06fe('0x2f')](_0x4aaddb['query'][_0x06fe('0x2f')]);}_0x144767[_0x06fe('0x4b')]=qs[_0x06fe('0x4c')](_0x4aaddb[_0x06fe('0x43')]['sort']);_0x144767[_0x06fe('0x4d')]=qs[_0x06fe('0x45')](_[_0x06fe('0x4e')](_0x4aaddb[_0x06fe('0x43')],_0x349a5c[_0x06fe('0x45')]));_0x144767['where']['WhatsappAccountId']=_0xd4b59d['id'];if(_0x4aaddb[_0x06fe('0x43')]['filter']){_0x144767['where']=_[_0x06fe('0x50')](_0x144767[_0x06fe('0x4d')],{'$or':_[_0x06fe('0x3e')](_0x144767['attributes'],function(_0x5508a4){var _0x33e93c={};_0x33e93c[_0x5508a4]={'$like':'%'+_0x4aaddb[_0x06fe('0x43')]['filter']+'%'};return _0x33e93c;})});}_0x144767=_['merge']({},_0x144767,_0x4aaddb['options']);return db[_0x06fe('0x6c')][_0x06fe('0x32')]({'where':_0x144767[_0x06fe('0x4d')]})[_0x06fe('0x23')](function(_0x23ee52){_0x114a3d['count']=_0x23ee52;if(_0x4aaddb['query']['includeAll']){_0x144767[_0x06fe('0x53')]=[{'all':!![]}];}return db[_0x06fe('0x6c')][_0x06fe('0x69')](_0x144767);})[_0x06fe('0x23')](function(_0x59d4d0){_0x114a3d[_0x06fe('0x6a')]=_0x59d4d0;return _0x114a3d;});}})['then'](respondWithFilteredResult(_0x3e0b3b,_0x144767))[_0x06fe('0x2b')](handleError(_0x3e0b3b,null));};exports['removeAnswers']=function(_0x194e73,_0x555905,_0x55a964){return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x194e73[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x555905,null))[_0x06fe('0x23')](function(_0x112e7a){if(_0x112e7a){return _0x112e7a[_0x06fe('0x6d')](_0x194e73[_0x06fe('0x43')][_0x06fe('0x6e')]);}})[_0x06fe('0x23')](respondWithStatusCode(_0x555905,null))[_0x06fe('0x2b')](handleError(_0x555905,null));};exports[_0x06fe('0x6f')]=function(_0x46429f,_0x5956e0,_0x1712cc){return db['WhatsappAccount'][_0x06fe('0x59')]({'where':{'id':_0x46429f[_0x06fe('0x55')]['id']}})['then'](handleEntityNotFound(_0x5956e0,null))[_0x06fe('0x23')](function(_0x1e8963){if(_0x1e8963){return _0x1e8963[_0x06fe('0x6f')](_0x46429f[_0x06fe('0x5b')][_0x06fe('0x6e')],_['omit'](_0x46429f['body'],[_0x06fe('0x6e'),'id'])||{})['spread'](function(_0x33c62b){for(var _0x4b0ef4=0x0;_0x4b0ef4<_0x46429f[_0x06fe('0x5b')]['ids'][_0x06fe('0x57')];_0x4b0ef4+=0x1){socket[_0x06fe('0x70')](_0x06fe('0x71'),{'UserId':Number(_0x46429f['body'][_0x06fe('0x6e')][_0x4b0ef4]),'WhatsappAccountId':Number(_0x46429f['params']['id'])});}return _0x33c62b;});}})[_0x06fe('0x23')](respondWithResult(_0x5956e0,null))['catch'](handleError(_0x5956e0,null));};exports[_0x06fe('0x72')]=function(_0x3f94fb,_0x2e5e16,_0x571746){return db['WhatsappAccount']['find']({'where':{'id':_0x3f94fb['params']['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x2e5e16,null))[_0x06fe('0x23')](function(_0x2fe14f){if(_0x2fe14f){return _0x2fe14f['removeAgents'](_0x3f94fb[_0x06fe('0x43')][_0x06fe('0x6e')])[_0x06fe('0x23')](function(){if(_[_0x06fe('0x73')](_0x3f94fb[_0x06fe('0x43')][_0x06fe('0x6e')])){for(var _0x598e43=0x0;_0x598e43<_0x3f94fb['query'][_0x06fe('0x6e')]['length'];_0x598e43+=0x1){socket[_0x06fe('0x70')](_0x06fe('0x74'),{'UserId':Number(_0x3f94fb['query']['ids'][_0x598e43]),'WhatsappAccountId':Number(_0x3f94fb[_0x06fe('0x55')]['id'])});}}else{socket[_0x06fe('0x70')]('userWhatsappAccount:remove',{'UserId':Number(_0x3f94fb[_0x06fe('0x43')]['ids']),'WhatsappAccountId':Number(_0x3f94fb[_0x06fe('0x55')]['id'])});}});}})[_0x06fe('0x23')](respondWithStatusCode(_0x2e5e16,null))[_0x06fe('0x2b')](handleError(_0x2e5e16,null));};exports['getAgents']=function(_0x3ba4e9,_0x4fdd96,_0x10922d){var _0x55c7b9={};var _0x3eae50={};var _0x1b585c;var _0x510a3a;return db[_0x06fe('0x52')]['findOne']({'where':{'id':_0x3ba4e9[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x4fdd96,null))[_0x06fe('0x23')](function(_0x3ab0ce){if(_0x3ab0ce){_0x1b585c=_0x3ab0ce;_0x3eae50[_0x06fe('0x42')]=_[_0x06fe('0x44')](db[_0x06fe('0x75')][_0x06fe('0x3f')]);_0x3eae50[_0x06fe('0x43')]=_[_0x06fe('0x44')](_0x3ba4e9[_0x06fe('0x43')]);_0x3eae50[_0x06fe('0x45')]=_[_0x06fe('0x46')](_0x3eae50[_0x06fe('0x42')],_0x3eae50[_0x06fe('0x43')]);_0x55c7b9[_0x06fe('0x48')]=_[_0x06fe('0x46')](_0x3eae50[_0x06fe('0x42')],qs[_0x06fe('0x47')](_0x3ba4e9['query']['fields']));_0x55c7b9[_0x06fe('0x48')]=_0x55c7b9[_0x06fe('0x48')][_0x06fe('0x57')]?_0x55c7b9[_0x06fe('0x48')]:_0x3eae50[_0x06fe('0x42')];_0x55c7b9['order']=qs[_0x06fe('0x4c')](_0x3ba4e9[_0x06fe('0x43')][_0x06fe('0x4c')]);_0x55c7b9['where']=qs['filters'](_[_0x06fe('0x4e')](_0x3ba4e9[_0x06fe('0x43')],_0x3eae50[_0x06fe('0x45')]));if(_0x3ba4e9[_0x06fe('0x43')]['filter']){_0x55c7b9['where']=_[_0x06fe('0x50')](_0x55c7b9[_0x06fe('0x4d')],{'$or':_[_0x06fe('0x3e')](_0x55c7b9[_0x06fe('0x48')],function(_0xef43c4){var _0x39cbcd={};_0x39cbcd[_0xef43c4]={'$like':'%'+_0x3ba4e9[_0x06fe('0x43')]['filter']+'%'};return _0x39cbcd;})});}_0x55c7b9=_[_0x06fe('0x50')]({},_0x55c7b9,_0x3ba4e9[_0x06fe('0x51')]);return _0x1b585c[_0x06fe('0x76')](_0x55c7b9);}})['then'](function(_0x293d67){if(_0x293d67){_0x510a3a=_0x293d67[_0x06fe('0x57')];if(!_0x3ba4e9[_0x06fe('0x43')][_0x06fe('0x49')](_0x06fe('0x4a'))){_0x55c7b9[_0x06fe('0x31')]=qs['limit'](_0x3ba4e9[_0x06fe('0x43')][_0x06fe('0x31')]);_0x55c7b9['offset']=qs[_0x06fe('0x2f')](_0x3ba4e9[_0x06fe('0x43')][_0x06fe('0x2f')]);}return _0x1b585c['getAgents'](_0x55c7b9);}})[_0x06fe('0x23')](function(_0x2b361d){if(_0x2b361d){return _0x2b361d?{'count':_0x510a3a,'rows':_0x2b361d}:null;}})['then'](respondWithResult(_0x4fdd96,null))[_0x06fe('0x2b')](handleError(_0x4fdd96,null));};exports[_0x06fe('0x77')]=function(_0x45b688,_0x4bc684,_0x479f74){return db['WhatsappAccount']['findOne']({'where':{'id':_0x45b688[_0x06fe('0x55')]['id']}})['then'](handleEntityNotFound(_0x4bc684,null))['then'](function(_0x8d1993){if(_0x8d1993){return db['sequelize'][_0x06fe('0x78')](function(_0x2b1a0e){return db[_0x06fe('0x79')][_0x06fe('0x37')]({'where':{'WhatsappAccountId':_0x45b688[_0x06fe('0x55')]['id']},'transaction':_0x2b1a0e})['then'](function(_0x537654){var _0x116948=_['map'](_0x45b688[_0x06fe('0x5b')],function(_0x20ed3f){_0x20ed3f[_0x06fe('0x65')]=_0x45b688[_0x06fe('0x55')]['id'];return _0x20ed3f;});return db['WhatsappApplication'][_0x06fe('0x7a')](_0x116948,{'transaction':_0x2b1a0e});});})['then'](function(){return db[_0x06fe('0x79')][_0x06fe('0x7b')]({'where':{'WhatsappAccountId':_0x45b688[_0x06fe('0x55')]['id']},'order':_0x06fe('0x7c')});});}})[_0x06fe('0x23')](respondWithResult(_0x4bc684,null))['catch'](handleError(_0x4bc684,null));};exports[_0x06fe('0x7d')]=function(_0x2a348b,_0x3eb9c3,_0x90e7be){var _0x548d4a={};var _0x4b4824={};var _0x2b71ec;var _0x15db01;return db[_0x06fe('0x52')][_0x06fe('0x68')]({'where':{'id':_0x2a348b[_0x06fe('0x55')]['id']}})[_0x06fe('0x23')](handleEntityNotFound(_0x3eb9c3,null))[_0x06fe('0x23')](function(_0x475e02){if(_0x475e02){_0x2b71ec=_0x475e02;_0x4b4824[_0x06fe('0x42')]=_['keys'](db['WhatsappApplication'][_0x06fe('0x3f')]);_0x4b4824[_0x06fe('0x43')]=_[_0x06fe('0x44')](_0x2a348b[_0x06fe('0x43')]);_0x4b4824['filters']=_[_0x06fe('0x46')](_0x4b4824[_0x06fe('0x42')],_0x4b4824[_0x06fe('0x43')]);_0x548d4a[_0x06fe('0x48')]=_[_0x06fe('0x46')](_0x4b4824[_0x06fe('0x42')],qs['fields'](_0x2a348b[_0x06fe('0x43')][_0x06fe('0x47')]));_0x548d4a[_0x06fe('0x48')]=_0x548d4a['attributes'][_0x06fe('0x57')]?_0x548d4a[_0x06fe('0x48')]:_0x4b4824['model'];_0x548d4a[_0x06fe('0x4b')]=qs[_0x06fe('0x4c')](_0x2a348b[_0x06fe('0x43')][_0x06fe('0x4c')]);_0x548d4a[_0x06fe('0x4d')]=qs[_0x06fe('0x45')](_[_0x06fe('0x4e')](_0x2a348b[_0x06fe('0x43')],_0x4b4824[_0x06fe('0x45')]));if(_0x2a348b[_0x06fe('0x43')][_0x06fe('0x4f')]){_0x548d4a[_0x06fe('0x4d')]=_[_0x06fe('0x50')](_0x548d4a[_0x06fe('0x4d')],{'$or':_[_0x06fe('0x3e')](_0x548d4a[_0x06fe('0x48')],function(_0x21992f){var _0x21ea31={};_0x21ea31[_0x21992f]={'$like':'%'+_0x2a348b[_0x06fe('0x43')]['filter']+'%'};return _0x21ea31;})});}_0x548d4a=_[_0x06fe('0x50')]({},_0x548d4a,_0x2a348b['options']);return _0x2b71ec['getApplications'](_0x548d4a);}})[_0x06fe('0x23')](function(_0x3b8f28){if(_0x3b8f28){_0x15db01=_0x3b8f28['length'];if(!_0x2a348b[_0x06fe('0x43')]['hasOwnProperty'](_0x06fe('0x4a'))){_0x548d4a[_0x06fe('0x31')]=qs[_0x06fe('0x31')](_0x2a348b[_0x06fe('0x43')]['limit']);_0x548d4a[_0x06fe('0x2f')]=qs[_0x06fe('0x2f')](_0x2a348b[_0x06fe('0x43')][_0x06fe('0x2f')]);}return _0x2b71ec[_0x06fe('0x7d')](_0x548d4a);}})[_0x06fe('0x23')](function(_0x16c236){if(_0x16c236){return _0x16c236?{'count':_0x15db01,'rows':_0x16c236}:null;}})[_0x06fe('0x23')](respondWithResult(_0x3eb9c3,null))[_0x06fe('0x2b')](handleError(_0x3eb9c3,null));};exports[_0x06fe('0x7e')]=function(_0x4bc60a,_0x20e8df,_0x5c4997){var _0x5a2c89={'channel':'whatsapp'};var _0xf7f3de=[];var _0x146767=[];var _0x366c4e={};return db[_0x06fe('0x52')][_0x06fe('0x59')]({'where':{'id':_0x4bc60a[_0x06fe('0x55')]['id']},'include':[{'model':db[_0x06fe('0x79')],'as':_0x06fe('0x7f')}]})[_0x06fe('0x23')](handleEntityNotFound(_0x20e8df,null))[_0x06fe('0x23')](function(_0x2b95e9){_0x5a2c89['account']=_0x2b95e9;_0x5a2c89[_0x06fe('0x80')]=_[_0x06fe('0x81')](_0x2b95e9['Applications'],[_0x06fe('0x7c')],[_0x06fe('0x82')]);if(_0x5a2c89[_0x06fe('0x83')][_0x06fe('0x7f')]){delete _0x5a2c89[_0x06fe('0x83')][_0x06fe('0x7f')];}return db['CmContact'][_0x06fe('0x64')]();})[_0x06fe('0x23')](function(_0x27ae45){if(!_0x27ae45){throw new db[(_0x06fe('0x84'))][(_0x06fe('0x85'))](_0x06fe('0x86'));}_0xf7f3de=_[_0x06fe('0x87')](_['keys'](_0x27ae45),[_0x06fe('0x88'),_0x06fe('0x89')]);_0x146767=_['difference'](_[_0x06fe('0x44')](_0x27ae45),[_0x06fe('0x88'),_0x06fe('0x89'),_0x06fe('0x8a'),_0x06fe('0x8b')]);_0x5a2c89[_0x06fe('0x5b')]={'mapKey':'mobile'};if(_0x5a2c89[_0x06fe('0x83')]['type']&&_0x5a2c89[_0x06fe('0x83')]['type']===_0x06fe('0x8c')){_0x5a2c89['body']['from']=_0x4bc60a[_0x06fe('0x5b')][_0x06fe('0x8d')][_0x06fe('0x8e')](_0x06fe('0x8f'),'');_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x5b')]=_0x4bc60a[_0x06fe('0x5b')]['Body'];_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x90')]=_0x4bc60a[_0x06fe('0x5b')][_0x06fe('0x91')];}if(_0x5a2c89[_0x06fe('0x5b')]['id']){delete _0x5a2c89[_0x06fe('0x5b')]['id'];}if(_[_0x06fe('0x92')](_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x93')])){throw new db['Sequelize'][(_0x06fe('0x85'))](_0x06fe('0x94'));}if(_[_0x06fe('0x92')](_0x5a2c89[_0x06fe('0x5b')]['body'])||_0x5a2c89['body'][_0x06fe('0x5b')]===''){throw new db['Sequelize'][(_0x06fe('0x85'))](_0x06fe('0x95'));}if(_['isNil'](_0x5a2c89['body'][_0x06fe('0x96')])){throw new db[(_0x06fe('0x84'))][(_0x06fe('0x85'))](_0x06fe('0x97')+_0x146767);}if(!_[_0x06fe('0x98')](_0x146767,_0x5a2c89['body']['mapKey'])){throw new db[(_0x06fe('0x84'))][(_0x06fe('0x85'))](_0x06fe('0x99')+_0x146767);}_0x366c4e[_0x5a2c89[_0x06fe('0x5b')]['mapKey']]=_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x93')];return db[_0x06fe('0x9a')][_0x06fe('0x59')]({'where':{'id':_0x5a2c89[_0x06fe('0x83')][_0x06fe('0x8b')]},'include':[{'model':db[_0x06fe('0x9b')],'as':'Contacts','where':_0x366c4e,'limit':0x1,'order':[[_0x06fe('0x89'),_0x06fe('0x9c')]]}]});})[_0x06fe('0x23')](handleEntityNotFound(_0x20e8df,null))[_0x06fe('0x23')](function(_0x3aac7b){if(_0x3aac7b){_0x5a2c89[_0x06fe('0x9d')]=_[_0x06fe('0x9e')](_0x3aac7b,['Contacts']);if(_0x3aac7b[_0x06fe('0x9f')][_0x06fe('0x57')]){return _0x3aac7b[_0x06fe('0x9f')][0x0];}var _0x6d0e1c=_['defaults'](_0x5a2c89[_0x06fe('0x5b')],{'firstName':_0x5a2c89['body'][_0x06fe('0x93')],'ListId':_0x3aac7b['id']});_0x6d0e1c[_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x96')]]=_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x93')];return db['CmContact'][_0x06fe('0x5a')](_0x6d0e1c,{'fields':_0xf7f3de,'raw':!![]});}})[_0x06fe('0x23')](handleEntityNotFound(_0x20e8df,null))['then'](function(_0x58eff8){if(_0x58eff8){_0x5a2c89[_0x06fe('0xa0')]=_0x58eff8;var _0xdb9ce2={'ContactId':_0x58eff8['id'],'phone':_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x93')],'WhatsappAccountId':_0x4bc60a[_0x06fe('0x55')]['id']};var _0x15cf73={'ContactId':_0x58eff8['id'],'WhatsappAccountId':_0x4bc60a[_0x06fe('0x55')]['id'],'closed':![]};return db[_0x06fe('0xa1')]['find']({'where':_0x15cf73})['then'](function(_0x4dd475){if(_0x4dd475){return[_0x4dd475,![]];}return db[_0x06fe('0xa1')]['create'](_0xdb9ce2)[_0x06fe('0x23')](function(_0x40b3df){return[_0x40b3df,!![]];});});}})[_0x06fe('0xa2')](function(_0x226981,_0x4c8ad7){_0x5a2c89[_0x06fe('0xa3')]=_0x226981[_0x06fe('0x5d')]({'plain':!![]});_0x5a2c89['interaction'][_0x06fe('0xa4')]=![];if(_0x4c8ad7){if(_0x5a2c89[_0x06fe('0x83')][_0x06fe('0xa5')]){_0x5a2c89['applications'][_0x06fe('0xa6')]({'id':0x0,'priority':_0x5a2c89['applications'][_0x06fe('0x57')]+0x1,'app':_0x06fe('0xa7'),'appdata':_0x06fe('0xa8'),'interval':'*,*,*,*'});}_0x5a2c89['interaction'][_0x06fe('0xa4')]=!![];}return db['WhatsappMessage'][_0x06fe('0x5a')]({'phone':_0x5a2c89[_0x06fe('0x5b')]['from'],'messageId':_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x90')],'body':_0x5a2c89[_0x06fe('0x5b')][_0x06fe('0x5b')],'WhatsappAccountId':_0x4bc60a['params']['id'],'WhatsappInteractionId':_0x226981['id'],'direction':'in','ContactId':_0x226981[_0x06fe('0xa9')],'AttachmentId':_0x5a2c89[_0x06fe('0x5b')]['AttachmentId']});})[_0x06fe('0x23')](function(_0x1bab0d){_0x5a2c89['message']=_0x1bab0d;if(_0x5a2c89['interaction'][_0x06fe('0xaa')]){return db[_0x06fe('0x75')]['find']({'attributes':['id',_0x06fe('0x3a')],'where':{'id':_0x5a2c89[_0x06fe('0xa3')][_0x06fe('0xaa')]}})[_0x06fe('0x23')](function(_0x1c3e97){if(_0x1c3e97){_0x5a2c89[_0x06fe('0x80')][_0x06fe('0xab')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1c3e97[_0x06fe('0x3a')]+','+(_0x5a2c89['account'][_0x06fe('0xac')]||0xa),'interval':_0x06fe('0xad')});}return respondWithRpcPromise(_0x06fe('0xae'),_0x06fe('0xaf'),_0x5a2c89);});}return respondWithRpcPromise(_0x06fe('0xae'),'startRouting',_0x5a2c89);})[_0x06fe('0x23')](function(_0x474cd9){if(_0x474cd9){var _0x50c2cc=0xc8;var _0x4e51ec='receiveMessage';logger[_0x06fe('0x24')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4e51ec,_0x50c2cc,_0x06fe('0xb0'));logger['debug'](_0x06fe('0xb1'),_0x4e51ec,_0x50c2cc,'entity\x20found',JSON[_0x06fe('0xb2')](_0x474cd9));if(_0x5a2c89[_0x06fe('0x83')][_0x06fe('0x41')]===_0x06fe('0x8c')){return _0x20e8df[_0x06fe('0x2d')](_0x50c2cc)[_0x06fe('0x33')](_0x06fe('0xb3'),_0x06fe('0xb4'))[_0x06fe('0x3b')](_0x06fe('0xb5'));}else{return _0x20e8df[_0x06fe('0x2d')](_0x50c2cc)[_0x06fe('0x2e')](_0x474cd9);}}})[_0x06fe('0x2b')](handleError(_0x20e8df,null));};exports['send']=function(_0x435794,_0x331899,_0x2bb76f){var _0x7746f7,_0x4b0a4b,_0x3b62d4;if(_[_0x06fe('0x92')](_0x435794[_0x06fe('0x5b')][_0x06fe('0x5b')])||_0x435794[_0x06fe('0x5b')][_0x06fe('0x5b')]===''){throw new db['Sequelize'][(_0x06fe('0x85'))](_0x06fe('0x95'));}if(_[_0x06fe('0x92')](_0x435794[_0x06fe('0x5b')]['to'])){throw new db[(_0x06fe('0x84'))][(_0x06fe('0x85'))]('to\x20is\x20mandatory');}_0x7746f7=_0x435794[_0x06fe('0x5b')]['to'];return db['WhatsappAccount'][_0x06fe('0x59')]({'where':{'id':_0x435794[_0x06fe('0x55')]['id']},'include':[{'model':db[_0x06fe('0x9a')],'as':_0x06fe('0xb6'),'include':[{'model':db[_0x06fe('0x9b')],'as':_0x06fe('0x9f'),'where':{'mobile':_0x7746f7},'limit':0x1,'order':[[_0x06fe('0x89'),_0x06fe('0x9c')]]}]}]})['then'](handleEntityNotFound(_0x331899,null))[_0x06fe('0x23')](function(_0x1fe7e1){if(_0x1fe7e1&&_0x1fe7e1[_0x06fe('0xb6')]){_0x4b0a4b=_0x1fe7e1[_0x06fe('0x5d')]({'plain':!![]});if(_0x4b0a4b['List']&&_0x4b0a4b['List']['Contacts'][_0x06fe('0x57')]){return _0x4b0a4b[_0x06fe('0xb6')][_0x06fe('0x9f')][0x0];}return db[_0x06fe('0x9b')]['create'](_[_0x06fe('0xb7')](_0x435794[_0x06fe('0x5b')],{'firstName':_0x7746f7,'mobile':_0x7746f7,'phone':_0x7746f7,'ListId':_0x4b0a4b[_0x06fe('0x8b')]}));}})[_0x06fe('0x23')](handleEntityNotFound(_0x331899,null))[_0x06fe('0x23')](function(_0x5f4b7e){if(_0x5f4b7e){_0x3b62d4=_0x5f4b7e;return db['WhatsappInteraction'][_0x06fe('0x59')]({'where':{'ContactId':_0x3b62d4['id'],'closed':![],'WhatsappAccountId':_0x4b0a4b['id']}})[_0x06fe('0x23')](function(_0x138e49){if(_0x138e49){return[_0x138e49,![]];}return db[_0x06fe('0xa1')][_0x06fe('0x5a')]({'UserId':_0x435794['user']['id'],'ContactId':_0x3b62d4['id'],'WhatsappAccountId':_0x4b0a4b['id'],'phone':_0x7746f7,'firstMsgDirection':'out','Messages':[_[_0x06fe('0x50')](_0x435794['body'],{'read':![],'body':_0x435794[_0x06fe('0x5b')][_0x06fe('0x5b')],'phone':_0x7746f7,'WhatsappAccountId':_0x4b0a4b['id'],'UserId':_0x435794[_0x06fe('0x5c')]['id'],'ContactId':_0x3b62d4['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':'Messages'}]})['then'](function(_0x138fcc){return[_0x138fcc,!![]];});});}})[_0x06fe('0xa2')](function(_0x56b9b3,_0x1607f8){if(_0x1607f8){return _0x56b9b3;}return db['WhatsappMessage']['create'](_[_0x06fe('0x50')](_0x435794['body'],{'read':![],'body':_0x435794[_0x06fe('0x5b')][_0x06fe('0x5b')],'phone':_0x7746f7,'WhatsappAccountId':_0x4b0a4b['id'],'WhatsappInteractionId':_0x56b9b3['id'],'UserId':_0x435794[_0x06fe('0x5c')]['id'],'ContactId':_0x3b62d4['id']}))['then'](function(_0x4a8b0f){_0x56b9b3[_0x06fe('0xb8')][_0x06fe('0xb9')]=[];_0x56b9b3[_0x06fe('0xb8')][_0x06fe('0xb9')][_0x06fe('0xa6')](_0x4a8b0f[_0x06fe('0xb8')]);return _0x56b9b3;});})['then'](respondWithResult(_0x331899,null))[_0x06fe('0x2b')](handleError(_0x331899,null));};
\ No newline at end of file
index 72e77f9..4961394 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75c8=['exports','events','../../mysqldb','WhatsappAccount','save','update','emit','hasOwnProperty','hook'];(function(_0x34ddd9,_0x1e4292){var _0x22b771=function(_0x401c02){while(--_0x401c02){_0x34ddd9['push'](_0x34ddd9['shift']());}};_0x22b771(++_0x1e4292);}(_0x75c8,0x1cc));var _0x875c=function(_0x165009,_0x5bc0aa){_0x165009=_0x165009-0x0;var _0x281488=_0x75c8[_0x165009];return _0x281488;};'use strict';var EventEmitter=require(_0x875c('0x0'));var WhatsappAccount=require(_0x875c('0x1'))['db'][_0x875c('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x875c('0x3'),'afterUpdate':_0x875c('0x4'),'afterDestroy':'remove'};function emitEvent(_0xe484f){return function(_0x19a2f4,_0x4c031a,_0x596e78){WhatsappAccountEvents[_0x875c('0x5')](_0xe484f+':'+_0x19a2f4['id'],_0x19a2f4);WhatsappAccountEvents['emit'](_0xe484f,_0x19a2f4);_0x596e78(null);};}for(var e in events){if(events[_0x875c('0x6')](e)){var event=events[e];WhatsappAccount[_0x875c('0x7')](e,emitEvent(event));}}module[_0x875c('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0x3e5c=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','save','update','remove'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x3e5c,0x90));var _0xc3e5=function(_0xc125b3,_0x4c6e3f){_0xc125b3=_0xc125b3-0x0;var _0xe5f0f8=_0x3e5c[_0xc125b3];return _0xe5f0f8;};'use strict';var EventEmitter=require(_0xc3e5('0x0'));var WhatsappAccount=require(_0xc3e5('0x1'))['db'][_0xc3e5('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc3e5('0x3'),'afterUpdate':_0xc3e5('0x4'),'afterDestroy':_0xc3e5('0x5')};function emitEvent(_0x561d52){return function(_0x209c7d,_0x4e4396,_0x81601e){WhatsappAccountEvents[_0xc3e5('0x6')](_0x561d52+':'+_0x209c7d['id'],_0x209c7d);WhatsappAccountEvents[_0xc3e5('0x6')](_0x561d52,_0x209c7d);_0x81601e(null);};}for(var e in events){if(events[_0xc3e5('0x7')](e)){var event=events[e];WhatsappAccount[_0xc3e5('0x8')](e,emitEvent(event));}}module[_0xc3e5('0x9')]=WhatsappAccountEvents;
\ No newline at end of file
index 8662c1c..d40cd0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4097=['moment','bluebird','request-promise','path','rimraf','./whatsappAccount.attributes','define','whatsapp_accounts','lodash','../../config/logger'];(function(_0x3fbf0b,_0x104f95){var _0x4ee88e=function(_0x28fa4d){while(--_0x28fa4d){_0x3fbf0b['push'](_0x3fbf0b['shift']());}};_0x4ee88e(++_0x104f95);}(_0x4097,0x1de));var _0x7409=function(_0x2e11b6,_0x24e1d4){_0x2e11b6=_0x2e11b6-0x0;var _0x509b1e=_0x4097[_0x2e11b6];return _0x509b1e;};'use strict';var _=require(_0x7409('0x0'));var util=require('util');var logger=require(_0x7409('0x1'))('api');var moment=require(_0x7409('0x2'));var BPromise=require(_0x7409('0x3'));var rp=require(_0x7409('0x4'));var fs=require('fs');var path=require(_0x7409('0x5'));var rimraf=require(_0x7409('0x6'));var config=require('../../config/environment');var attributes=require(_0x7409('0x7'));module['exports']=function(_0x42746a,_0x163785){return _0x42746a[_0x7409('0x8')]('WhatsappAccount',attributes,{'tableName':_0x7409('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x86f3=['rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','whatsapp_accounts','api','moment','bluebird','request-promise'];(function(_0x2db80d,_0x599677){var _0x526078=function(_0x2c98e5){while(--_0x2c98e5){_0x2db80d['push'](_0x2db80d['shift']());}};_0x526078(++_0x599677);}(_0x86f3,0xc4));var _0x386f=function(_0x10791d,_0x2562b6){_0x10791d=_0x10791d-0x0;var _0x1b4f9c=_0x86f3[_0x10791d];return _0x1b4f9c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x386f('0x0'));var moment=require(_0x386f('0x1'));var BPromise=require(_0x386f('0x2'));var rp=require(_0x386f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x386f('0x4'));var config=require(_0x386f('0x5'));var attributes=require(_0x386f('0x6'));module[_0x386f('0x7')]=function(_0x1dce16,_0x287b7c){return _0x1dce16[_0x386f('0x8')]('WhatsappAccount',attributes,{'tableName':_0x386f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 613db54..90e7148 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4f2=['util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','find','raw','options','where','include','map','model','attributes','ShowWhatsappAccount'];(function(_0x2fc3ad,_0x42f187){var _0x233b6d=function(_0x21229e){while(--_0x21229e){_0x2fc3ad['push'](_0x2fc3ad['shift']());}};_0x233b6d(++_0x42f187);}(_0xf4f2,0xc3));var _0x2f4f=function(_0x31d663,_0x3e2316){_0x31d663=_0x31d663-0x0;var _0x5344cb=_0xf4f2[_0x31d663];return _0x5344cb;};'use strict';var _=require('lodash');var util=require(_0x2f4f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2f4f('0x1'));var fs=require('fs');var Redis=require(_0x2f4f('0x2'));var db=require(_0x2f4f('0x3'))['db'];var utils=require(_0x2f4f('0x4'));var logger=require(_0x2f4f('0x5'))(_0x2f4f('0x6'));var config=require(_0x2f4f('0x7'));var jayson=require(_0x2f4f('0x8'));var client=jayson[_0x2f4f('0x9')][_0x2f4f('0xa')]({'port':0x232a});config[_0x2f4f('0xb')]=_[_0x2f4f('0xc')](config[_0x2f4f('0xb')],{'host':_0x2f4f('0xd'),'port':0x18eb});var socket=require(_0x2f4f('0xe'))(new Redis(config[_0x2f4f('0xb')]));require(_0x2f4f('0xf'))[_0x2f4f('0x10')](socket);function respondWithRpcPromise(_0x5139ee,_0xef4f59,_0x53340b){return new BPromise(function(_0x34ef81,_0x1726de){return client[_0x2f4f('0x11')](_0x5139ee,_0x53340b)[_0x2f4f('0x12')](function(_0x41ff35){logger[_0x2f4f('0x13')](_0x2f4f('0x14'),_0xef4f59,'request\x20sent');logger[_0x2f4f('0x15')](_0x2f4f('0x16'),_0xef4f59,_0x2f4f('0x17'),JSON[_0x2f4f('0x18')](_0x41ff35));if(_0x41ff35['error']){if(_0x41ff35[_0x2f4f('0x19')][_0x2f4f('0x1a')]===0x1f4){logger['error'](_0x2f4f('0x14'),_0xef4f59,_0x41ff35[_0x2f4f('0x19')][_0x2f4f('0x1b')]);return _0x1726de(_0x41ff35[_0x2f4f('0x19')][_0x2f4f('0x1b')]);}logger[_0x2f4f('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0xef4f59,_0x41ff35['error'][_0x2f4f('0x1b')]);return _0x34ef81(_0x41ff35[_0x2f4f('0x19')][_0x2f4f('0x1b')]);}else{logger['info'](_0x2f4f('0x14'),_0xef4f59,_0x2f4f('0x17'));_0x34ef81(_0x41ff35[_0x2f4f('0x1c')][_0x2f4f('0x1b')]);}})[_0x2f4f('0x1d')](function(_0xdfe556){logger[_0x2f4f('0x19')](_0x2f4f('0x14'),_0xef4f59,_0xdfe556);_0x1726de(_0xdfe556);});});}exports['ShowWhatsappAccount']=function(_0x1b1d17){var _0x345e28=this;return new Promise(function(_0x58c6a0,_0x48c33a){return db['WhatsappAccount'][_0x2f4f('0x1e')]({'raw':_0x1b1d17['options']?_0x1b1d17['options'][_0x2f4f('0x1f')]===undefined?!![]:![]:!![],'where':_0x1b1d17['options']?_0x1b1d17[_0x2f4f('0x20')][_0x2f4f('0x21')]||null:null,'attributes':_0x1b1d17['options']?_0x1b1d17[_0x2f4f('0x20')]['attributes']||null:null,'include':_0x1b1d17[_0x2f4f('0x20')]?_0x1b1d17[_0x2f4f('0x20')][_0x2f4f('0x22')]?_[_0x2f4f('0x23')](_0x1b1d17[_0x2f4f('0x20')][_0x2f4f('0x22')],function(_0xd55257){return{'model':db[_0xd55257[_0x2f4f('0x24')]],'as':_0xd55257['as'],'attributes':_0xd55257[_0x2f4f('0x25')],'include':_0xd55257[_0x2f4f('0x22')]?_[_0x2f4f('0x23')](_0xd55257[_0x2f4f('0x22')],function(_0x2db852){return{'model':db[_0x2db852[_0x2f4f('0x24')]],'as':_0x2db852['as'],'attributes':_0x2db852[_0x2f4f('0x25')],'include':_0x2db852[_0x2f4f('0x22')]?_[_0x2f4f('0x23')](_0x2db852[_0x2f4f('0x22')],function(_0x4f3817){return{'model':db[_0x4f3817['model']],'as':_0x4f3817['as'],'attributes':_0x4f3817['attributes']};}):[]};}):[]};}):[]:[]})[_0x2f4f('0x12')](function(_0x2be475){logger[_0x2f4f('0x13')](_0x2f4f('0x26'),_0x1b1d17);logger[_0x2f4f('0x15')](_0x2f4f('0x26'),_0x1b1d17,JSON[_0x2f4f('0x18')](_0x2be475));_0x58c6a0(_0x2be475);})[_0x2f4f('0x1d')](function(_0x32daf5){logger['error'](_0x2f4f('0x26'),_0x32daf5[_0x2f4f('0x1b')],_0x1b1d17);_0x48c33a(_0x345e28[_0x2f4f('0x19')](0x1f4,_0x32daf5[_0x2f4f('0x1b')]));});});};
\ No newline at end of file
+var _0x9007=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','randomstring','ioredis'];(function(_0xd5a931,_0x4fb842){var _0x32a849=function(_0x30ff84){while(--_0x30ff84){_0xd5a931['push'](_0xd5a931['shift']());}};_0x32a849(++_0x4fb842);}(_0x9007,0x1db));var _0x7900=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x9007[_0x46f1a6];return _0x38429a;};'use strict';var _=require(_0x7900('0x0'));var util=require(_0x7900('0x1'));var moment=require(_0x7900('0x2'));var BPromise=require('bluebird');var rs=require(_0x7900('0x3'));var fs=require('fs');var Redis=require(_0x7900('0x4'));var db=require(_0x7900('0x5'))['db'];var utils=require(_0x7900('0x6'));var logger=require(_0x7900('0x7'))(_0x7900('0x8'));var config=require(_0x7900('0x9'));var jayson=require(_0x7900('0xa'));var client=jayson[_0x7900('0xb')][_0x7900('0xc')]({'port':0x232a});config['redis']=_[_0x7900('0xd')](config['redis'],{'host':_0x7900('0xe'),'port':0x18eb});var socket=require(_0x7900('0xf'))(new Redis(config[_0x7900('0x10')]));require(_0x7900('0x11'))[_0x7900('0x12')](socket);function respondWithRpcPromise(_0x34fa98,_0x4a470f,_0x2cd5c4){return new BPromise(function(_0x3cb0a7,_0x181726){return client[_0x7900('0x13')](_0x34fa98,_0x2cd5c4)[_0x7900('0x14')](function(_0x400279){logger[_0x7900('0x15')](_0x7900('0x16'),_0x4a470f,_0x7900('0x17'));logger[_0x7900('0x18')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4a470f,_0x7900('0x17'),JSON[_0x7900('0x19')](_0x400279));if(_0x400279[_0x7900('0x1a')]){if(_0x400279['error']['code']===0x1f4){logger[_0x7900('0x1a')](_0x7900('0x16'),_0x4a470f,_0x400279[_0x7900('0x1a')][_0x7900('0x1b')]);return _0x181726(_0x400279[_0x7900('0x1a')][_0x7900('0x1b')]);}logger[_0x7900('0x1a')](_0x7900('0x16'),_0x4a470f,_0x400279['error'][_0x7900('0x1b')]);return _0x3cb0a7(_0x400279[_0x7900('0x1a')][_0x7900('0x1b')]);}else{logger[_0x7900('0x15')](_0x7900('0x16'),_0x4a470f,_0x7900('0x17'));_0x3cb0a7(_0x400279[_0x7900('0x1c')][_0x7900('0x1b')]);}})[_0x7900('0x1d')](function(_0x4e244a){logger[_0x7900('0x1a')]('WhatsappAccount,\x20%s,\x20%s',_0x4a470f,_0x4e244a);_0x181726(_0x4e244a);});});}exports[_0x7900('0x1e')]=function(_0x39b3bf){var _0x2b1fc8=this;return new Promise(function(_0x4d68d2,_0x318e13){return db[_0x7900('0x1f')][_0x7900('0x20')]({'raw':_0x39b3bf['options']?_0x39b3bf[_0x7900('0x21')][_0x7900('0x22')]===undefined?!![]:![]:!![],'where':_0x39b3bf[_0x7900('0x21')]?_0x39b3bf['options'][_0x7900('0x23')]||null:null,'attributes':_0x39b3bf[_0x7900('0x21')]?_0x39b3bf[_0x7900('0x21')][_0x7900('0x24')]||null:null,'include':_0x39b3bf[_0x7900('0x21')]?_0x39b3bf['options'][_0x7900('0x25')]?_[_0x7900('0x26')](_0x39b3bf[_0x7900('0x21')][_0x7900('0x25')],function(_0x293c27){return{'model':db[_0x293c27[_0x7900('0x27')]],'as':_0x293c27['as'],'attributes':_0x293c27['attributes'],'include':_0x293c27[_0x7900('0x25')]?_[_0x7900('0x26')](_0x293c27[_0x7900('0x25')],function(_0x36b211){return{'model':db[_0x36b211['model']],'as':_0x36b211['as'],'attributes':_0x36b211[_0x7900('0x24')],'include':_0x36b211[_0x7900('0x25')]?_[_0x7900('0x26')](_0x36b211['include'],function(_0x227578){return{'model':db[_0x227578[_0x7900('0x27')]],'as':_0x227578['as'],'attributes':_0x227578[_0x7900('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11d0fd){logger[_0x7900('0x15')](_0x7900('0x1e'),_0x39b3bf);logger[_0x7900('0x18')](_0x7900('0x1e'),_0x39b3bf,JSON[_0x7900('0x19')](_0x11d0fd));_0x4d68d2(_0x11d0fd);})['catch'](function(_0x5d4a48){logger[_0x7900('0x1a')]('ShowWhatsappAccount',_0x5d4a48[_0x7900('0x1b')],_0x39b3bf);_0x318e13(_0x2b1fc8[_0x7900('0x1a')](0x1f4,_0x5d4a48[_0x7900('0x1b')]));});});};
\ No newline at end of file
index c657e40..e7bcbac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3743=['length','whatsappAccount:','./whatsappAccount.events','remove','update','emit','removeListener','register'];(function(_0x31899f,_0x3a3578){var _0x516937=function(_0x6738ec){while(--_0x6738ec){_0x31899f['push'](_0x31899f['shift']());}};_0x516937(++_0x3a3578);}(_0x3743,0x162));var _0x3374=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x3743[_0x36ed48];return _0x51c63a;};'use strict';var WhatsappAccountEvents=require(_0x3374('0x0'));var events=['save',_0x3374('0x1'),_0x3374('0x2')];function createListener(_0x213919,_0x3d24cd){return function(_0x1a0141){_0x3d24cd[_0x3374('0x3')](_0x213919,_0x1a0141);};}function removeListener(_0x5ae646,_0x2722b0){return function(){WhatsappAccountEvents[_0x3374('0x4')](_0x5ae646,_0x2722b0);};}exports[_0x3374('0x5')]=function(_0x228510){for(var _0x46392a=0x0,_0x34ab49=events[_0x3374('0x6')];_0x46392a<_0x34ab49;_0x46392a++){var _0x47aced=events[_0x46392a];var _0x4a66b8=createListener(_0x3374('0x7')+_0x47aced,_0x228510);WhatsappAccountEvents['on'](_0x47aced,_0x4a66b8);}};
\ No newline at end of file
+var _0x6583=['removeListener','register','whatsappAccount:','./whatsappAccount.events','remove','update'];(function(_0x134261,_0xa29812){var _0x142e8c=function(_0x586618){while(--_0x586618){_0x134261['push'](_0x134261['shift']());}};_0x142e8c(++_0xa29812);}(_0x6583,0x123));var _0x3658=function(_0x3ac312,_0x5d3903){_0x3ac312=_0x3ac312-0x0;var _0x36b673=_0x6583[_0x3ac312];return _0x36b673;};'use strict';var WhatsappAccountEvents=require(_0x3658('0x0'));var events=['save',_0x3658('0x1'),_0x3658('0x2')];function createListener(_0x3f760a,_0x554303){return function(_0x472497){_0x554303['emit'](_0x3f760a,_0x472497);};}function removeListener(_0x52ea17,_0x59cd35){return function(){WhatsappAccountEvents[_0x3658('0x3')](_0x52ea17,_0x59cd35);};}exports[_0x3658('0x4')]=function(_0x306e9d){for(var _0x100d66=0x0,_0xe7679d=events['length'];_0x100d66<_0xe7679d;_0x100d66++){var _0x2c69f9=events[_0x100d66];var _0x1a4146=createListener(_0x3658('0x5')+_0x2c69f9,_0x306e9d);WhatsappAccountEvents['on'](_0x2c69f9,_0x1a4146);}};
\ No newline at end of file
index 14ce329..9087477 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61ca=['./whatsappApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1e07a8,_0x3a47a8){var _0x4ee5f5=function(_0x29d5cf){while(--_0x29d5cf){_0x1e07a8['push'](_0x1e07a8['shift']());}};_0x4ee5f5(++_0x3a47a8);}(_0x61ca,0x11d));var _0xa61c=function(_0x2b5448,_0xe31456){_0x2b5448=_0x2b5448-0x0;var _0xee510e=_0x61ca[_0x2b5448];return _0xee510e;};'use strict';var multer=require(_0xa61c('0x0'));var util=require(_0xa61c('0x1'));var path=require(_0xa61c('0x2'));var timeout=require(_0xa61c('0x3'));var express=require('express');var router=express[_0xa61c('0x4')]();var fs_extra=require(_0xa61c('0x5'));var auth=require(_0xa61c('0x6'));var interaction=require(_0xa61c('0x7'));var config=require(_0xa61c('0x8'));var controller=require(_0xa61c('0x9'));router[_0xa61c('0xa')]('/',auth['isAuthenticated'](),controller[_0xa61c('0xb')]);router[_0xa61c('0xa')](_0xa61c('0xc'),auth[_0xa61c('0xd')](),controller[_0xa61c('0xe')]);router[_0xa61c('0xf')]('/',auth[_0xa61c('0xd')](),controller[_0xa61c('0x10')]);router[_0xa61c('0x11')](_0xa61c('0xc'),auth['isAuthenticated'](),controller[_0xa61c('0x12')]);router['delete'](_0xa61c('0xc'),auth[_0xa61c('0xd')](),controller[_0xa61c('0x13')]);module[_0xa61c('0x14')]=router;
\ No newline at end of file
+var _0x18aa=['multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports'];(function(_0x5071c1,_0x435e3b){var _0x461654=function(_0x312ed2){while(--_0x312ed2){_0x5071c1['push'](_0x5071c1['shift']());}};_0x461654(++_0x435e3b);}(_0x18aa,0xdc));var _0xa18a=function(_0x3288c0,_0x3100b6){_0x3288c0=_0x3288c0-0x0;var _0x2c06ba=_0x18aa[_0x3288c0];return _0x2c06ba;};'use strict';var multer=require(_0xa18a('0x0'));var util=require(_0xa18a('0x1'));var path=require(_0xa18a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa18a('0x3')]();var fs_extra=require(_0xa18a('0x4'));var auth=require(_0xa18a('0x5'));var interaction=require(_0xa18a('0x6'));var config=require(_0xa18a('0x7'));var controller=require(_0xa18a('0x8'));router[_0xa18a('0x9')]('/',auth[_0xa18a('0xa')](),controller[_0xa18a('0xb')]);router['get'](_0xa18a('0xc'),auth[_0xa18a('0xa')](),controller[_0xa18a('0xd')]);router[_0xa18a('0xe')]('/',auth[_0xa18a('0xa')](),controller[_0xa18a('0xf')]);router['put'](_0xa18a('0xc'),auth[_0xa18a('0xa')](),controller[_0xa18a('0x10')]);router[_0xa18a('0x11')](_0xa18a('0xc'),auth[_0xa18a('0xa')](),controller[_0xa18a('0x12')]);module[_0xa18a('0x13')]=router;
\ No newline at end of file
index 56b5e5e..e531179 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ac7=['exports','INTEGER','STRING','sequelize'];(function(_0x41cc3f,_0x2678a2){var _0x47ff58=function(_0x190d53){while(--_0x190d53){_0x41cc3f['push'](_0x41cc3f['shift']());}};_0x47ff58(++_0x2678a2);}(_0x0ac7,0x17f));var _0x70ac=function(_0x14494e,_0x439581){_0x14494e=_0x14494e-0x0;var _0x2b023c=_0x0ac7[_0x14494e];return _0x2b023c;};'use strict';var Sequelize=require(_0x70ac('0x0'));module[_0x70ac('0x1')]={'priority':{'type':Sequelize[_0x70ac('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x70ac('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xad89=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0x3dd627,_0x581f7f){var _0x523732=function(_0x2d9080){while(--_0x2d9080){_0x3dd627['push'](_0x3dd627['shift']());}};_0x523732(++_0x581f7f);}(_0xad89,0xbd));var _0x9ad8=function(_0x123d3d,_0x114ea5){_0x123d3d=_0x123d3d-0x0;var _0x5707bf=_0xad89[_0x123d3d];return _0x5707bf;};'use strict';var Sequelize=require('sequelize');module[_0x9ad8('0x0')]={'priority':{'type':Sequelize[_0x9ad8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9ad8('0x2')],'allowNull':![],'defaultValue':_0x9ad8('0x3')},'appdata':{'type':Sequelize[_0x9ad8('0x4')]()},'description':{'type':Sequelize[_0x9ad8('0x2')]},'interval':{'type':Sequelize[_0x9ad8('0x2')],'defaultValue':_0x9ad8('0x5')}};
\ No newline at end of file
index ead0676..d151262 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73a1=['json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','params','length','find','create','body','catch','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status'];(function(_0x2a6361,_0x5a34bf){var _0xc7050f=function(_0x4dbeb4){while(--_0x4dbeb4){_0x2a6361['push'](_0x2a6361['shift']());}};_0xc7050f(++_0x5a34bf);}(_0x73a1,0x161));var _0x173a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x73a1[_0x68c979];return _0x4f0001;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x173a('0x0'));var jsonpatch=require(_0x173a('0x1'));var rp=require('request-promise');var moment=require(_0x173a('0x2'));var BPromise=require(_0x173a('0x3'));var Mustache=require(_0x173a('0x4'));var util=require(_0x173a('0x5'));var path=require(_0x173a('0x6'));var sox=require('sox');var csv=require(_0x173a('0x7'));var ejs=require(_0x173a('0x8'));var fs=require('fs');var fs_extra=require(_0x173a('0x9'));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('0x7'));var querystring=require(_0x173a('0xf'));var Papa=require(_0x173a('0x10'));var Redis=require(_0x173a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x173a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x173a('0x13'));var logger=require(_0x173a('0x14'))(_0x173a('0x15'));var utils=require(_0x173a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x173a('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28b560,_0x540cfd){_0x540cfd=_0x540cfd||0xcc;return function(_0x127dc2){if(_0x127dc2){return _0x28b560[_0x173a('0x18')](_0x540cfd);}return _0x28b560['status'](_0x540cfd)[_0x173a('0x19')]();};}function respondWithResult(_0x3d49ea,_0x17f38e){_0x17f38e=_0x17f38e||0xc8;return function(_0x20eb9f){if(_0x20eb9f){return _0x3d49ea[_0x173a('0x1a')](_0x17f38e)[_0x173a('0x1b')](_0x20eb9f);}};}function respondWithFilteredResult(_0x69fe68,_0x309879){return function(_0x5e4252){if(_0x5e4252){var _0xb8e6b=typeof _0x309879[_0x173a('0x1c')]===_0x173a('0x1d')&&typeof _0x309879['limit']==='undefined';var _0x5a08a4=_0x5e4252[_0x173a('0x1e')];var _0x5e5ebd=_0xb8e6b?0x0:_0x309879['offset'];var _0xd84224=_0xb8e6b?_0x5e4252[_0x173a('0x1e')]:_0x309879['offset']+_0x309879[_0x173a('0x1f')];var _0x3d6897;if(_0xd84224>=_0x5a08a4){_0xd84224=_0x5a08a4;_0x3d6897=0xc8;}else{_0x3d6897=0xce;}_0x69fe68[_0x173a('0x1a')](_0x3d6897);return _0x69fe68[_0x173a('0x20')](_0x173a('0x21'),_0x5e5ebd+'-'+_0xd84224+'/'+_0x5a08a4)[_0x173a('0x1b')](_0x5e4252);}return null;};}function patchUpdates(_0x47b362){return function(_0xa58b66){try{jsonpatch[_0x173a('0x22')](_0xa58b66,_0x47b362,!![]);}catch(_0x5c3e80){return BPromise[_0x173a('0x23')](_0x5c3e80);}return _0xa58b66['save']();};}function saveUpdates(_0x4a46bb,_0x457f9d){return function(_0x238615){if(_0x238615){return _0x238615[_0x173a('0x24')](_0x4a46bb)['then'](function(_0x2993a0){return _0x2993a0;});}return null;};}function removeEntity(_0x3207ef,_0x2a7f65){return function(_0xe5334){if(_0xe5334){return _0xe5334[_0x173a('0x25')]()[_0x173a('0x26')](function(){_0x3207ef['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44d885,_0x30bfb9){return function(_0x129f75){if(!_0x129f75){_0x44d885[_0x173a('0x18')](0x194);}return _0x129f75;};}function handleError(_0x27c810,_0x30c261){_0x30c261=_0x30c261||0x1f4;return function(_0x47f8a6){logger[_0x173a('0x27')](_0x47f8a6[_0x173a('0x28')]);if(_0x47f8a6[_0x173a('0x29')]){delete _0x47f8a6[_0x173a('0x29')];}_0x27c810[_0x173a('0x1a')](_0x30c261)[_0x173a('0x2a')](_0x47f8a6);};}exports[_0x173a('0x2b')]=function(_0x230482,_0x8cfc24){var _0x456551={},_0x5aae65={},_0x5db920={'count':0x0,'rows':[]};var _0x5c1f50=_[_0x173a('0x2c')](db[_0x173a('0x2d')][_0x173a('0x2e')],function(_0x30080f){return{'name':_0x30080f[_0x173a('0x2f')],'type':_0x30080f['type'][_0x173a('0x30')]};});_0x5aae65[_0x173a('0x31')]=_['map'](_0x5c1f50,_0x173a('0x29'));_0x5aae65[_0x173a('0x32')]=_[_0x173a('0x33')](_0x230482['query']);_0x5aae65[_0x173a('0x34')]=_['intersection'](_0x5aae65[_0x173a('0x31')],_0x5aae65['query']);_0x456551['attributes']=_[_0x173a('0x35')](_0x5aae65[_0x173a('0x31')],qs[_0x173a('0x36')](_0x230482[_0x173a('0x32')]['fields']));_0x456551[_0x173a('0x37')]=_0x456551[_0x173a('0x37')]['length']?_0x456551[_0x173a('0x37')]:_0x5aae65['model'];if(!_0x230482[_0x173a('0x32')][_0x173a('0x38')](_0x173a('0x39'))){_0x456551[_0x173a('0x1f')]=qs[_0x173a('0x1f')](_0x230482[_0x173a('0x32')][_0x173a('0x1f')]);_0x456551['offset']=qs[_0x173a('0x1c')](_0x230482[_0x173a('0x32')][_0x173a('0x1c')]);}_0x456551[_0x173a('0x3a')]=qs['sort'](_0x230482[_0x173a('0x32')][_0x173a('0x3b')]);_0x456551[_0x173a('0x3c')]=qs['filters'](_[_0x173a('0x3d')](_0x230482[_0x173a('0x32')],_0x5aae65[_0x173a('0x34')]),_0x5c1f50);if(_0x230482[_0x173a('0x32')]['filter']){_0x456551['where']=_[_0x173a('0x3e')](_0x456551[_0x173a('0x3c')],{'$or':_[_0x173a('0x2c')](_0x5c1f50,function(_0x31b482){if(_0x31b482[_0x173a('0x3f')]!==_0x173a('0x40')){var _0x414940={};_0x414940[_0x31b482[_0x173a('0x29')]]={'$like':'%'+_0x230482['query'][_0x173a('0x41')]+'%'};return _0x414940;}})});}_0x456551=_[_0x173a('0x3e')]({},_0x456551,_0x230482[_0x173a('0x42')]);var _0x358d89={'where':_0x456551[_0x173a('0x3c')]};return db[_0x173a('0x2d')][_0x173a('0x1e')](_0x358d89)[_0x173a('0x26')](function(_0x477980){_0x5db920[_0x173a('0x1e')]=_0x477980;if(_0x230482[_0x173a('0x32')][_0x173a('0x43')]){_0x456551[_0x173a('0x44')]=[{'all':!![]}];}return db[_0x173a('0x2d')]['findAll'](_0x456551);})[_0x173a('0x26')](function(_0x508e9b){_0x5db920[_0x173a('0x45')]=_0x508e9b;return _0x5db920;})[_0x173a('0x26')](respondWithFilteredResult(_0x8cfc24,_0x456551))['catch'](handleError(_0x8cfc24,null));};exports['show']=function(_0x2afdb2,_0x524420){var _0x1c036f={'raw':!![],'where':{'id':_0x2afdb2[_0x173a('0x46')]['id']}},_0x14582c={};_0x14582c['model']=_[_0x173a('0x33')](db[_0x173a('0x2d')][_0x173a('0x2e')]);_0x14582c['query']=_[_0x173a('0x33')](_0x2afdb2[_0x173a('0x32')]);_0x14582c[_0x173a('0x34')]=_['intersection'](_0x14582c[_0x173a('0x31')],_0x14582c[_0x173a('0x32')]);_0x1c036f['attributes']=_[_0x173a('0x35')](_0x14582c[_0x173a('0x31')],qs['fields'](_0x2afdb2[_0x173a('0x32')]['fields']));_0x1c036f[_0x173a('0x37')]=_0x1c036f['attributes'][_0x173a('0x47')]?_0x1c036f[_0x173a('0x37')]:_0x14582c[_0x173a('0x31')];if(_0x2afdb2[_0x173a('0x32')]['includeAll']){_0x1c036f[_0x173a('0x44')]=[{'all':!![]}];}_0x1c036f=_[_0x173a('0x3e')]({},_0x1c036f,_0x2afdb2[_0x173a('0x42')]);return db[_0x173a('0x2d')][_0x173a('0x48')](_0x1c036f)[_0x173a('0x26')](handleEntityNotFound(_0x524420,null))[_0x173a('0x26')](respondWithResult(_0x524420,null))['catch'](handleError(_0x524420,null));};exports[_0x173a('0x49')]=function(_0x4b48d5,_0x103c98){return db[_0x173a('0x2d')][_0x173a('0x49')](_0x4b48d5[_0x173a('0x4a')],{})['then'](respondWithResult(_0x103c98,0xc9))['catch'](handleError(_0x103c98,null));};exports[_0x173a('0x24')]=function(_0x164fd0,_0x2aca19){if(_0x164fd0[_0x173a('0x4a')]['id']){delete _0x164fd0[_0x173a('0x4a')]['id'];}return db[_0x173a('0x2d')][_0x173a('0x48')]({'where':{'id':_0x164fd0[_0x173a('0x46')]['id']}})[_0x173a('0x26')](handleEntityNotFound(_0x2aca19,null))[_0x173a('0x26')](saveUpdates(_0x164fd0[_0x173a('0x4a')],null))[_0x173a('0x26')](respondWithResult(_0x2aca19,null))[_0x173a('0x4b')](handleError(_0x2aca19,null));};exports['destroy']=function(_0x4f9d5c,_0x5dde78){return db[_0x173a('0x2d')][_0x173a('0x48')]({'where':{'id':_0x4f9d5c[_0x173a('0x46')]['id']}})[_0x173a('0x26')](handleEntityNotFound(_0x5dde78,null))['then'](removeEntity(_0x5dde78,null))[_0x173a('0x4b')](handleError(_0x5dde78,null));};
\ No newline at end of file
+var _0x4ccb=['destroy','error','stack','name','send','index','map','WhatsappApplication','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then'];(function(_0x2b3e10,_0x2e8409){var _0x2c532f=function(_0x215d71){while(--_0x215d71){_0x2b3e10['push'](_0x2b3e10['shift']());}};_0x2c532f(++_0x2e8409);}(_0x4ccb,0x196));var _0xb4cc=function(_0x1cd93b,_0x523800){_0x1cd93b=_0x1cd93b-0x0;var _0x15ac86=_0x4ccb[_0x1cd93b];return _0x15ac86;};'use strict';var emlformat=require(_0xb4cc('0x0'));var rimraf=require(_0xb4cc('0x1'));var zipdir=require(_0xb4cc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb4cc('0x3'));var moment=require(_0xb4cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb4cc('0x5'));var util=require(_0xb4cc('0x6'));var path=require(_0xb4cc('0x7'));var sox=require('sox');var csv=require(_0xb4cc('0x8'));var ejs=require(_0xb4cc('0x9'));var fs=require('fs');var fs_extra=require(_0xb4cc('0xa'));var _=require('lodash');var squel=require(_0xb4cc('0xb'));var crypto=require(_0xb4cc('0xc'));var jsforce=require(_0xb4cc('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb4cc('0x8'));var querystring=require(_0xb4cc('0xe'));var Papa=require(_0xb4cc('0xf'));var Redis=require(_0xb4cc('0x10'));var authService=require(_0xb4cc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb4cc('0x12'));var hardwareService=require(_0xb4cc('0x13'));var logger=require('../../config/logger')(_0xb4cc('0x14'));var utils=require('../../config/utils');var config=require(_0xb4cc('0x15'));var licenseUtil=require(_0xb4cc('0x16'));var db=require(_0xb4cc('0x17'))['db'];function respondWithStatusCode(_0x58ed7d,_0x5a4449){_0x5a4449=_0x5a4449||0xcc;return function(_0x205a03){if(_0x205a03){return _0x58ed7d['sendStatus'](_0x5a4449);}return _0x58ed7d['status'](_0x5a4449)[_0xb4cc('0x18')]();};}function respondWithResult(_0x58b1c2,_0x52b57d){_0x52b57d=_0x52b57d||0xc8;return function(_0xcfdeb9){if(_0xcfdeb9){return _0x58b1c2[_0xb4cc('0x19')](_0x52b57d)[_0xb4cc('0x1a')](_0xcfdeb9);}};}function respondWithFilteredResult(_0x5d33a5,_0x4096db){return function(_0x1a5edc){if(_0x1a5edc){var _0x3aca2b=typeof _0x4096db[_0xb4cc('0x1b')]===_0xb4cc('0x1c')&&typeof _0x4096db['limit']===_0xb4cc('0x1c');var _0x2ba050=_0x1a5edc[_0xb4cc('0x1d')];var _0x5b56b2=_0x3aca2b?0x0:_0x4096db[_0xb4cc('0x1b')];var _0x14d8b6=_0x3aca2b?_0x1a5edc[_0xb4cc('0x1d')]:_0x4096db[_0xb4cc('0x1b')]+_0x4096db[_0xb4cc('0x1e')];var _0x5cfc7d;if(_0x14d8b6>=_0x2ba050){_0x14d8b6=_0x2ba050;_0x5cfc7d=0xc8;}else{_0x5cfc7d=0xce;}_0x5d33a5[_0xb4cc('0x19')](_0x5cfc7d);return _0x5d33a5[_0xb4cc('0x1f')](_0xb4cc('0x20'),_0x5b56b2+'-'+_0x14d8b6+'/'+_0x2ba050)[_0xb4cc('0x1a')](_0x1a5edc);}return null;};}function patchUpdates(_0x3a957b){return function(_0x554418){try{jsonpatch[_0xb4cc('0x21')](_0x554418,_0x3a957b,!![]);}catch(_0x1bed69){return BPromise[_0xb4cc('0x22')](_0x1bed69);}return _0x554418[_0xb4cc('0x23')]();};}function saveUpdates(_0x56f634,_0x571793){return function(_0xc9d835){if(_0xc9d835){return _0xc9d835[_0xb4cc('0x24')](_0x56f634)[_0xb4cc('0x25')](function(_0xaf11df){return _0xaf11df;});}return null;};}function removeEntity(_0x5e1c46,_0x4dddc8){return function(_0x3dd7ef){if(_0x3dd7ef){return _0x3dd7ef[_0xb4cc('0x26')]()['then'](function(){_0x5e1c46['status'](0xcc)[_0xb4cc('0x18')]();});}};}function handleEntityNotFound(_0xeb25e1,_0x2ee2d3){return function(_0x154002){if(!_0x154002){_0xeb25e1['sendStatus'](0x194);}return _0x154002;};}function handleError(_0x4efac8,_0x3a1236){_0x3a1236=_0x3a1236||0x1f4;return function(_0x4f47ed){logger[_0xb4cc('0x27')](_0x4f47ed[_0xb4cc('0x28')]);if(_0x4f47ed[_0xb4cc('0x29')]){delete _0x4f47ed[_0xb4cc('0x29')];}_0x4efac8[_0xb4cc('0x19')](_0x3a1236)[_0xb4cc('0x2a')](_0x4f47ed);};}exports[_0xb4cc('0x2b')]=function(_0x1de4b6,_0x27b804){var _0x5baab6={},_0x755b4a={},_0x210e23={'count':0x0,'rows':[]};var _0x4707b1=_[_0xb4cc('0x2c')](db[_0xb4cc('0x2d')]['rawAttributes'],function(_0x61dc50){return{'name':_0x61dc50[_0xb4cc('0x2e')],'type':_0x61dc50[_0xb4cc('0x2f')][_0xb4cc('0x30')]};});_0x755b4a['model']=_[_0xb4cc('0x2c')](_0x4707b1,_0xb4cc('0x29'));_0x755b4a['query']=_[_0xb4cc('0x31')](_0x1de4b6[_0xb4cc('0x32')]);_0x755b4a['filters']=_[_0xb4cc('0x33')](_0x755b4a[_0xb4cc('0x34')],_0x755b4a[_0xb4cc('0x32')]);_0x5baab6[_0xb4cc('0x35')]=_[_0xb4cc('0x33')](_0x755b4a[_0xb4cc('0x34')],qs[_0xb4cc('0x36')](_0x1de4b6[_0xb4cc('0x32')][_0xb4cc('0x36')]));_0x5baab6['attributes']=_0x5baab6['attributes'][_0xb4cc('0x37')]?_0x5baab6[_0xb4cc('0x35')]:_0x755b4a[_0xb4cc('0x34')];if(!_0x1de4b6[_0xb4cc('0x32')][_0xb4cc('0x38')]('nolimit')){_0x5baab6[_0xb4cc('0x1e')]=qs[_0xb4cc('0x1e')](_0x1de4b6[_0xb4cc('0x32')]['limit']);_0x5baab6[_0xb4cc('0x1b')]=qs[_0xb4cc('0x1b')](_0x1de4b6[_0xb4cc('0x32')]['offset']);}_0x5baab6[_0xb4cc('0x39')]=qs['sort'](_0x1de4b6[_0xb4cc('0x32')][_0xb4cc('0x3a')]);_0x5baab6[_0xb4cc('0x3b')]=qs[_0xb4cc('0x3c')](_['pick'](_0x1de4b6[_0xb4cc('0x32')],_0x755b4a['filters']),_0x4707b1);if(_0x1de4b6[_0xb4cc('0x32')][_0xb4cc('0x3d')]){_0x5baab6[_0xb4cc('0x3b')]=_[_0xb4cc('0x3e')](_0x5baab6[_0xb4cc('0x3b')],{'$or':_[_0xb4cc('0x2c')](_0x4707b1,function(_0x4214e5){if(_0x4214e5['type']!==_0xb4cc('0x3f')){var _0x379ab3={};_0x379ab3[_0x4214e5[_0xb4cc('0x29')]]={'$like':'%'+_0x1de4b6['query']['filter']+'%'};return _0x379ab3;}})});}_0x5baab6=_[_0xb4cc('0x3e')]({},_0x5baab6,_0x1de4b6[_0xb4cc('0x40')]);var _0x2d3653={'where':_0x5baab6[_0xb4cc('0x3b')]};return db[_0xb4cc('0x2d')]['count'](_0x2d3653)[_0xb4cc('0x25')](function(_0x5d55fe){_0x210e23['count']=_0x5d55fe;if(_0x1de4b6[_0xb4cc('0x32')][_0xb4cc('0x41')]){_0x5baab6[_0xb4cc('0x42')]=[{'all':!![]}];}return db[_0xb4cc('0x2d')][_0xb4cc('0x43')](_0x5baab6);})['then'](function(_0xda87d5){_0x210e23['rows']=_0xda87d5;return _0x210e23;})[_0xb4cc('0x25')](respondWithFilteredResult(_0x27b804,_0x5baab6))[_0xb4cc('0x44')](handleError(_0x27b804,null));};exports[_0xb4cc('0x45')]=function(_0x2bf6b2,_0x428ef1){var _0x35a6c8={'raw':!![],'where':{'id':_0x2bf6b2[_0xb4cc('0x46')]['id']}},_0x31521b={};_0x31521b[_0xb4cc('0x34')]=_[_0xb4cc('0x31')](db[_0xb4cc('0x2d')]['rawAttributes']);_0x31521b[_0xb4cc('0x32')]=_[_0xb4cc('0x31')](_0x2bf6b2[_0xb4cc('0x32')]);_0x31521b[_0xb4cc('0x3c')]=_['intersection'](_0x31521b['model'],_0x31521b[_0xb4cc('0x32')]);_0x35a6c8[_0xb4cc('0x35')]=_['intersection'](_0x31521b[_0xb4cc('0x34')],qs[_0xb4cc('0x36')](_0x2bf6b2[_0xb4cc('0x32')][_0xb4cc('0x36')]));_0x35a6c8['attributes']=_0x35a6c8[_0xb4cc('0x35')][_0xb4cc('0x37')]?_0x35a6c8[_0xb4cc('0x35')]:_0x31521b['model'];if(_0x2bf6b2[_0xb4cc('0x32')][_0xb4cc('0x41')]){_0x35a6c8[_0xb4cc('0x42')]=[{'all':!![]}];}_0x35a6c8=_[_0xb4cc('0x3e')]({},_0x35a6c8,_0x2bf6b2[_0xb4cc('0x40')]);return db[_0xb4cc('0x2d')][_0xb4cc('0x47')](_0x35a6c8)[_0xb4cc('0x25')](handleEntityNotFound(_0x428ef1,null))[_0xb4cc('0x25')](respondWithResult(_0x428ef1,null))['catch'](handleError(_0x428ef1,null));};exports[_0xb4cc('0x48')]=function(_0x5dffc3,_0x2b159b){return db[_0xb4cc('0x2d')][_0xb4cc('0x48')](_0x5dffc3['body'],{})[_0xb4cc('0x25')](respondWithResult(_0x2b159b,0xc9))[_0xb4cc('0x44')](handleError(_0x2b159b,null));};exports[_0xb4cc('0x24')]=function(_0x422db1,_0x28d91f){if(_0x422db1[_0xb4cc('0x49')]['id']){delete _0x422db1[_0xb4cc('0x49')]['id'];}return db[_0xb4cc('0x2d')]['find']({'where':{'id':_0x422db1[_0xb4cc('0x46')]['id']}})[_0xb4cc('0x25')](handleEntityNotFound(_0x28d91f,null))[_0xb4cc('0x25')](saveUpdates(_0x422db1[_0xb4cc('0x49')],null))[_0xb4cc('0x25')](respondWithResult(_0x28d91f,null))[_0xb4cc('0x44')](handleError(_0x28d91f,null));};exports[_0xb4cc('0x26')]=function(_0x5558d8,_0x21e047){return db[_0xb4cc('0x2d')]['find']({'where':{'id':_0x5558d8[_0xb4cc('0x46')]['id']}})[_0xb4cc('0x25')](handleEntityNotFound(_0x21e047,null))[_0xb4cc('0x25')](removeEntity(_0x21e047,null))[_0xb4cc('0x44')](handleError(_0x21e047,null));};
\ No newline at end of file
index c76eb4f..64fc7b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a81=['util','../../config/logger','api','request-promise','rimraf','../../config/environment','define','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x47de9a,_0x40cf23){var _0x4b9d6c=function(_0x507054){while(--_0x507054){_0x47de9a['push'](_0x47de9a['shift']());}};_0x4b9d6c(++_0x40cf23);}(_0x4a81,0x1b7));var _0x14a8=function(_0x411c51,_0x31ebd8){_0x411c51=_0x411c51-0x0;var _0x13aca9=_0x4a81[_0x411c51];return _0x13aca9;};'use strict';var _=require(_0x14a8('0x0'));var util=require(_0x14a8('0x1'));var logger=require(_0x14a8('0x2'))(_0x14a8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x14a8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x14a8('0x5'));var config=require(_0x14a8('0x6'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x2cd6d2,_0x4aa19e){return _0x2cd6d2[_0x14a8('0x7')]('WhatsappApplication',attributes,{'tableName':_0x14a8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x14a8('0x9'),'collate':_0x14a8('0xa')});};
\ No newline at end of file
+var _0x8b7c=['path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x8b7c,0x119));var _0xc8b7=function(_0x4e9861,_0x25fe5f){_0x4e9861=_0x4e9861-0x0;var _0x49802f=_0x8b7c[_0x4e9861];return _0x49802f;};'use strict';var _=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var logger=require(_0xc8b7('0x2'))(_0xc8b7('0x3'));var moment=require(_0xc8b7('0x4'));var BPromise=require(_0xc8b7('0x5'));var rp=require(_0xc8b7('0x6'));var fs=require('fs');var path=require(_0xc8b7('0x7'));var rimraf=require('rimraf');var config=require(_0xc8b7('0x8'));var attributes=require(_0xc8b7('0x9'));module[_0xc8b7('0xa')]=function(_0x4a8b93,_0x256c78){return _0x4a8b93[_0xc8b7('0xb')](_0xc8b7('0xc'),attributes,{'tableName':_0xc8b7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8b7('0xe'),'collate':_0xc8b7('0xf')});};
\ No newline at end of file
index 59ba467..2ed5d6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd28=['error','code','message','info','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x516920,_0x1eff5e){var _0x12fb50=function(_0x444525){while(--_0x444525){_0x516920['push'](_0x516920['shift']());}};_0x12fb50(++_0x1eff5e);}(_0xfd28,0x148));var _0x8fd2=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xfd28[_0xc8a931];return _0x28bd27;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0afc,_0x4bdc1a,_0x53d938){return new BPromise(function(_0x10fccf,_0x466c3d){return client[_0x8fd2('0xa')](_0x2f0afc,_0x53d938)['then'](function(_0x13cc69){logger['info'](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');logger[_0x8fd2('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x4bdc1a,_0x8fd2('0xd'),JSON['stringify'](_0x13cc69));if(_0x13cc69[_0x8fd2('0xe')]){if(_0x13cc69['error'][_0x8fd2('0xf')]===0x1f4){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x466c3d(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x10fccf(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}else{logger[_0x8fd2('0x11')](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');_0x10fccf(_0x13cc69[_0x8fd2('0x12')]['message']);}})['catch'](function(_0x56f75d){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x56f75d);_0x466c3d(_0x56f75d);});});}
\ No newline at end of file
+var _0xac9d=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3738be,_0x53ac03){var _0xd6b4e7=function(_0x2ac1a3){while(--_0x2ac1a3){_0x3738be['push'](_0x3738be['shift']());}};_0xd6b4e7(++_0x53ac03);}(_0xac9d,0x14d));var _0xdac9=function(_0x1147ab,_0x10e72b){_0x1147ab=_0x1147ab-0x0;var _0x55cb5a=_0xac9d[_0x1147ab];return _0x55cb5a;};'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});function respondWithRpcPromise(_0x776b6c,_0x1c78c5,_0x39f560){return new BPromise(function(_0x5531af,_0x2b1d6f){return client['request'](_0x776b6c,_0x39f560)[_0xdac9('0xc')](function(_0x3a013b){logger[_0xdac9('0xd')](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));logger[_0xdac9('0x10')](_0xdac9('0x11'),_0x1c78c5,_0xdac9('0xf'),JSON[_0xdac9('0x12')](_0x3a013b));if(_0x3a013b['error']){if(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x14')]===0x1f4){logger['error'](_0xdac9('0xe'),_0x1c78c5,_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);return _0x2b1d6f(_0x3a013b['error'][_0xdac9('0x15')]);}logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x3a013b['error']['message']);return _0x5531af(_0x3a013b[_0xdac9('0x13')][_0xdac9('0x15')]);}else{logger['info'](_0xdac9('0xe'),_0x1c78c5,_0xdac9('0xf'));_0x5531af(_0x3a013b[_0xdac9('0x16')][_0xdac9('0x15')]);}})[_0xdac9('0x17')](function(_0x393acc){logger[_0xdac9('0x13')](_0xdac9('0xe'),_0x1c78c5,_0x393acc);_0x2b1d6f(_0x393acc);});});}
\ No newline at end of file
index a724d54..9b0ea81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe132=['index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','tracked','whatsapp','addTags','put','whatsappinteraction:update','whatsappinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x316320,_0x5e1b23){var _0x42f6c5=function(_0x26067b){while(--_0x26067b){_0x316320['push'](_0x316320['shift']());}};_0x42f6c5(++_0x5e1b23);}(_0xe132,0x162));var _0x2e13=function(_0x548e8d,_0x12af15){_0x548e8d=_0x548e8d-0x0;var _0x42a406=_0xe132[_0x548e8d];return _0x42a406;};'use strict';var multer=require(_0x2e13('0x0'));var util=require('util');var path=require(_0x2e13('0x1'));var timeout=require(_0x2e13('0x2'));var express=require(_0x2e13('0x3'));var router=express[_0x2e13('0x4')]();var fs_extra=require(_0x2e13('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var controller=require('./whatsappInteraction.controller');router['get']('/',auth[_0x2e13('0x8')](),controller[_0x2e13('0x9')]);router[_0x2e13('0xa')](_0x2e13('0xb'),auth[_0x2e13('0x8')](),controller[_0x2e13('0xc')]);router[_0x2e13('0xa')](_0x2e13('0xd'),auth[_0x2e13('0x8')](),controller[_0x2e13('0xe')]);router['get'](_0x2e13('0xf'),auth[_0x2e13('0x8')](),controller[_0x2e13('0x10')]);router[_0x2e13('0xa')](_0x2e13('0x11'),auth[_0x2e13('0x8')](),controller[_0x2e13('0x12')]);router['post']('/',auth[_0x2e13('0x8')](),controller[_0x2e13('0x13')]);router[_0x2e13('0x14')](_0x2e13('0xf'),auth[_0x2e13('0x8')](),controller[_0x2e13('0x15')]);router[_0x2e13('0x14')]('/:id/tags',auth[_0x2e13('0x8')](),interaction[_0x2e13('0x16')](_0x2e13('0x17'),'whatsappinteraction:addtags'),controller[_0x2e13('0x18')]);router[_0x2e13('0x19')](_0x2e13('0xd'),auth['isAuthenticated'](),interaction[_0x2e13('0x16')](_0x2e13('0x17'),_0x2e13('0x1a')),controller['update']);router['delete'](_0x2e13('0xd'),auth[_0x2e13('0x8')](),interaction[_0x2e13('0x16')](_0x2e13('0x17'),_0x2e13('0x1b')),controller[_0x2e13('0x1c')]);router[_0x2e13('0x1d')](_0x2e13('0x1e'),auth['isAuthenticated'](),controller[_0x2e13('0x1f')]);module[_0x2e13('0x20')]=router;
\ No newline at end of file
+var _0xcb66=['../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','create','post','addMessage','tracked','whatsappinteraction:addtags','addTags','whatsapp','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','util','path','connect-timeout','express','Router'];(function(_0x57bfb8,_0x262223){var _0x369bc3=function(_0x3b5363){while(--_0x3b5363){_0x57bfb8['push'](_0x57bfb8['shift']());}};_0x369bc3(++_0x262223);}(_0xcb66,0x19f));var _0x6cb6=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0xcb66[_0x31b9cf];return _0x357b8a;};'use strict';var multer=require('multer');var util=require(_0x6cb6('0x0'));var path=require(_0x6cb6('0x1'));var timeout=require(_0x6cb6('0x2'));var express=require(_0x6cb6('0x3'));var router=express[_0x6cb6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6cb6('0x5'));var interaction=require(_0x6cb6('0x6'));var config=require(_0x6cb6('0x7'));var controller=require(_0x6cb6('0x8'));router[_0x6cb6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6cb6('0x9')](_0x6cb6('0xa'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0xc')]);router[_0x6cb6('0x9')](_0x6cb6('0xd'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0xe')]);router[_0x6cb6('0x9')](_0x6cb6('0xf'),auth[_0x6cb6('0xb')](),controller[_0x6cb6('0x10')]);router[_0x6cb6('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x6cb6('0xb')](),controller[_0x6cb6('0x11')]);router[_0x6cb6('0x12')](_0x6cb6('0xf'),auth['isAuthenticated'](),controller[_0x6cb6('0x13')]);router[_0x6cb6('0x12')]('/:id/tags',auth[_0x6cb6('0xb')](),interaction[_0x6cb6('0x14')]('whatsapp',_0x6cb6('0x15')),controller[_0x6cb6('0x16')]);router['put']('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x6cb6('0x17'),_0x6cb6('0x18')),controller[_0x6cb6('0x19')]);router[_0x6cb6('0x1a')](_0x6cb6('0xd'),auth[_0x6cb6('0xb')](),interaction['tracked'](_0x6cb6('0x17'),_0x6cb6('0x1b')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
index 89afc30..b913b9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28b1=['BOOLEAN','sequelize','moment','exports','DATE','STRING','out'];(function(_0x1b4ef9,_0x57b55a){var _0x1940c7=function(_0x443ee5){while(--_0x443ee5){_0x1b4ef9['push'](_0x1b4ef9['shift']());}};_0x1940c7(++_0x57b55a);}(_0x28b1,0x1d6));var _0x128b=function(_0x2d318c,_0x33989d){_0x2d318c=_0x2d318c-0x0;var _0x31dcc0=_0x28b1[_0x2d318c];return _0x31dcc0;};'use strict';var Sequelize=require(_0x128b('0x0'));var moment=require(_0x128b('0x1'));module[_0x128b('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x128b('0x3')]},'disposition':{'type':Sequelize[_0x128b('0x4')]},'secondDisposition':{'type':Sequelize[_0x128b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x128b('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x128b('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x128b('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x128b('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x128b('0x6')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc21c=['out','sequelize','moment','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3d73a0,_0x59b4bd){var _0x11ca40=function(_0x340daf){while(--_0x340daf){_0x3d73a0['push'](_0x3d73a0['shift']());}};_0x11ca40(++_0x59b4bd);}(_0xc21c,0x166));var _0xcc21=function(_0x5003df,_0x266193){_0x5003df=_0x5003df-0x0;var _0x5a28b9=_0xc21c[_0x5003df];return _0x5a28b9;};'use strict';var Sequelize=require(_0xcc21('0x0'));var moment=require(_0xcc21('0x1'));module['exports']={'closed':{'type':Sequelize[_0xcc21('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcc21('0x3')]},'disposition':{'type':Sequelize[_0xcc21('0x4')]},'secondDisposition':{'type':Sequelize[_0xcc21('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xcc21('0x4')]},'phone':{'type':Sequelize[_0xcc21('0x4')]},'read1stAt':{'type':Sequelize[_0xcc21('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcc21('0x5')]('in',_0xcc21('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcc21('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcc21('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xcc21('0x2')],'defaultValue':![]}};
\ No newline at end of file
index 7e0ac7a..830e6be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa101=['UserId','start','body','isEmpty','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','clone','i.id','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','WhatsappInteractionId','params','rawAttributes','includeAll','include','create','describe','WhatsappMessage','addMessage','ids','omit','getMessages','findOne','hasOwnProperty','pick','$gte','format','options','findAll','rows','addTags','setTags','spread','Tag','emit','whatsappInteractionTags:save','removeTags','unix','join','root','server','files','attachments','CmContact','firstName','lastName','Attachment','Messages','direction','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','basename','createReadStream','pipe','secret','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','Users','map','fullname','Tags','TagIds','split','push','catch','WhatsappInteraction','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','select','field','color','from','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','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','text','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?'];(function(_0x1df4ae,_0x130d29){var _0x36a5e0=function(_0x417069){while(--_0x417069){_0x1df4ae['push'](_0x1df4ae['shift']());}};_0x36a5e0(++_0x130d29);}(_0xa101,0x15f));var _0x1a10=function(_0x74892f,_0x1e981b){_0x74892f=_0x74892f-0x0;var _0x10ee61=_0xa101[_0x74892f];return _0x10ee61;};'use strict';var emlformat=require(_0x1a10('0x0'));var rimraf=require(_0x1a10('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a10('0x2'));var rp=require(_0x1a10('0x3'));var moment=require('moment');var BPromise=require(_0x1a10('0x4'));var Mustache=require(_0x1a10('0x5'));var util=require('util');var path=require(_0x1a10('0x6'));var sox=require(_0x1a10('0x7'));var csv=require(_0x1a10('0x8'));var ejs=require(_0x1a10('0x9'));var fs=require('fs');var fs_extra=require(_0x1a10('0xa'));var _=require(_0x1a10('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1a10('0xc'));var deskjs=require(_0x1a10('0xd'));var toCsv=require(_0x1a10('0x8'));var querystring=require(_0x1a10('0xe'));var Papa=require(_0x1a10('0xf'));var Redis=require(_0x1a10('0x10'));var authService=require(_0x1a10('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1a10('0x12'));var pdf=require(_0x1a10('0x13'));var hardwareService=require(_0x1a10('0x14'));var logger=require('../../config/logger')(_0x1a10('0x15'));var utils=require(_0x1a10('0x16'));var config=require(_0x1a10('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a10('0x18'))['db'];config[_0x1a10('0x19')]=_[_0x1a10('0x1a')](config[_0x1a10('0x19')],{'host':_0x1a10('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1a10('0x19')]));require('./whatsappInteraction.socket')['register'](socket);function respondWithStatusCode(_0x54a16b,_0x45b8a3){_0x45b8a3=_0x45b8a3||0xcc;return function(_0x3d0150){if(_0x3d0150){return _0x54a16b[_0x1a10('0x1c')](_0x45b8a3);}return _0x54a16b[_0x1a10('0x1d')](_0x45b8a3)['end']();};}function respondWithResult(_0x22f8a5,_0x1fe16a){_0x1fe16a=_0x1fe16a||0xc8;return function(_0x5395b4){if(_0x5395b4){return _0x22f8a5[_0x1a10('0x1d')](_0x1fe16a)[_0x1a10('0x1e')](_0x5395b4);}};}function respondWithFilteredResult(_0x353785,_0x457e2f){return function(_0x4a3813){if(_0x4a3813){var _0x169cf2=typeof _0x457e2f[_0x1a10('0x1f')]===_0x1a10('0x20')&&typeof _0x457e2f[_0x1a10('0x21')]===_0x1a10('0x20');var _0xe0057f=_0x4a3813[_0x1a10('0x22')];var _0xd01708=_0x169cf2?0x0:_0x457e2f[_0x1a10('0x1f')];var _0x203561=_0x169cf2?_0x4a3813[_0x1a10('0x22')]:_0x457e2f[_0x1a10('0x1f')]+_0x457e2f[_0x1a10('0x21')];var _0x45228b;if(_0x203561>=_0xe0057f){_0x203561=_0xe0057f;_0x45228b=0xc8;}else{_0x45228b=0xce;}_0x353785[_0x1a10('0x1d')](_0x45228b);return _0x353785['set'](_0x1a10('0x23'),_0xd01708+'-'+_0x203561+'/'+_0xe0057f)['json'](_0x4a3813);}return null;};}function patchUpdates(_0x1198e1){return function(_0x5e3a13){try{jsonpatch[_0x1a10('0x24')](_0x5e3a13,_0x1198e1,!![]);}catch(_0x4c48ea){return BPromise[_0x1a10('0x25')](_0x4c48ea);}return _0x5e3a13[_0x1a10('0x26')]();};}function saveUpdates(_0x5f2d2d,_0x3b3aee){return function(_0x2e618a){if(_0x2e618a){return _0x2e618a[_0x1a10('0x27')](_0x5f2d2d)[_0x1a10('0x28')](function(_0x4eaae7){return _0x4eaae7;});}return null;};}function removeEntity(_0x36aaae,_0x28a771){return function(_0x58493){if(_0x58493){return _0x58493[_0x1a10('0x29')]()[_0x1a10('0x28')](function(){_0x36aaae[_0x1a10('0x1d')](0xcc)[_0x1a10('0x2a')]();});}};}function handleEntityNotFound(_0x29eb9f,_0x4ba1a2){return function(_0x5d1a65){if(!_0x5d1a65){_0x29eb9f['sendStatus'](0x194);}return _0x5d1a65;};}function handleError(_0x9e9cc,_0x35db81){_0x35db81=_0x35db81||0x1f4;return function(_0x105677){logger[_0x1a10('0x2b')](_0x105677['stack']);if(_0x105677[_0x1a10('0x2c')]){delete _0x105677[_0x1a10('0x2c')];}_0x9e9cc['status'](_0x35db81)[_0x1a10('0x2d')](_0x105677);};}function getInteractionUsers(_0x3fd7c9,_0x41716c){return new BPromise(function(_0x4ae3ea,_0x422276){try{if(_0x41716c[_0x3fd7c9['id']]){_0x3fd7c9[_0x1a10('0x2e')]=_[_0x1a10('0x2f')](_0x41716c[_0x3fd7c9['id']],function(_0x3e805f){return{'id':_0x3e805f['id'],'fullname':_0x3e805f[_0x1a10('0x30')]};});}}catch(_0x4b6a0f){_0x422276(_0x4b6a0f);}_0x4ae3ea(_0x3fd7c9);});}function getInteractionTags(_0x30eb67,_0x50b2b1){return new BPromise(function(_0x305254,_0x3559c4){try{if(_0x30eb67['TagIds']){_0x30eb67[_0x1a10('0x31')]=[];_0x30eb67[_0x1a10('0x32')][_0x1a10('0x33')](',')['forEach'](function(_0x4eeb1e){_0x30eb67[_0x1a10('0x31')][_0x1a10('0x34')](_0x50b2b1[_0x4eeb1e]);});}delete _0x30eb67[_0x1a10('0x32')];}catch(_0x13c518){_0x3559c4(_0x13c518);}_0x305254(_0x30eb67);});}function updateWhatsappInteraction(_0x2f854f,_0x3346c5,_0xa91b12){return new BPromise(function(_0x3ab2ce,_0x5256c7){return getInteractionUsers(_0x2f854f,_0xa91b12)[_0x1a10('0x28')](function(_0x1efe0e){return getInteractionTags(_0x1efe0e,_0x3346c5);})[_0x1a10('0x28')](function(_0x3de8eb){_0x3ab2ce(_0x3de8eb);})[_0x1a10('0x35')](function(_0x404025){_0x5256c7(_0x404025);});});}exports['index']=function(_0x299ea4,_0xf133cb){var _0x448928={},_0x399234={},_0x15f50d={'count':0x0,'rows':[]};var _0x816f92=_[_0x1a10('0x2f')](db[_0x1a10('0x36')]['rawAttributes'],function(_0x1034f8){return{'name':_0x1034f8[_0x1a10('0x37')],'type':_0x1034f8[_0x1a10('0x38')][_0x1a10('0x39')]};});_0x399234['model']=_[_0x1a10('0x2f')](_0x816f92,'name');_0x399234[_0x1a10('0x3a')]=_[_0x1a10('0x3b')](_0x299ea4[_0x1a10('0x3a')]);_0x399234[_0x1a10('0x3c')]=_[_0x1a10('0x3d')](_0x399234[_0x1a10('0x3e')],_0x399234[_0x1a10('0x3a')]);_0x448928[_0x1a10('0x3f')]=_['intersection'](_0x399234[_0x1a10('0x3e')],qs[_0x1a10('0x40')](_0x299ea4[_0x1a10('0x3a')][_0x1a10('0x40')]));_0x448928['attributes']=_0x448928[_0x1a10('0x3f')][_0x1a10('0x41')]?_0x448928[_0x1a10('0x3f')]:_0x399234['model'];if(!_0x299ea4['query']['hasOwnProperty'](_0x1a10('0x42'))){_0x448928['limit']=qs['limit'](_0x299ea4[_0x1a10('0x3a')][_0x1a10('0x21')]);_0x448928[_0x1a10('0x1f')]=qs[_0x1a10('0x1f')](_0x299ea4[_0x1a10('0x3a')]['offset']);}_0x448928[_0x1a10('0x43')]=qs[_0x1a10('0x44')](_0x299ea4[_0x1a10('0x3a')][_0x1a10('0x44')]);_0x448928[_0x1a10('0x45')]=qs[_0x1a10('0x3c')](_['pick'](_0x299ea4[_0x1a10('0x3a')],_0x399234[_0x1a10('0x3c')]),_0x816f92);var _0x792dd6=[];var _0x5e7f23=squel[_0x1a10('0x46')]()[_0x1a10('0x47')]('id')[_0x1a10('0x47')](_0x1a10('0x2c'))['field'](_0x1a10('0x48'))[_0x1a10('0x49')]('tools_tags');var _0x4ead84=squel[_0x1a10('0x46')]()[_0x1a10('0x47')](_0x1a10('0x4a'))['field'](_0x1a10('0x4b'))[_0x1a10('0x47')](_0x1a10('0x4c'))[_0x1a10('0x49')](_0x1a10('0x4d'),'ui')[_0x1a10('0x4e')](_0x1a10('0x4f'),'u',_0x1a10('0x50'));var _0x384f25=squel[_0x1a10('0x46')]()[_0x1a10('0x49')](_0x1a10('0x51'),'i')[_0x1a10('0x4e')](_0x1a10('0x52'),'c',_0x1a10('0x53'))[_0x1a10('0x4e')](_0x1a10('0x4f'),'o','o.id\x20=\x20i.UserId')[_0x1a10('0x4e')](_0x1a10('0x54'),'a',_0x1a10('0x55'))['left_join'](_0x1a10('0x56'),'me',_0x1a10('0x57'))[_0x1a10('0x4e')](_0x1a10('0x58'),'it',_0x1a10('0x59'))['left_join'](_0x1a10('0x5a'),'t',_0x1a10('0x5b'));var _0x55ce9e=squel[_0x1a10('0x5c')]();var _0x2b666f=[];var _0x26b2e5=squel['expr']();var _0x186d2a;if(_0x299ea4[_0x1a10('0x3a')][_0x1a10('0x5d')]){_0x186d2a=as['parseSearch'](_0x299ea4['query']['search']);var _0x395df0=_0x186d2a[_0x1a10('0x5e')];for(var _0x45823e=0x0;_0x45823e<_0x186d2a[_0x1a10('0x5f')]['length'];_0x45823e++){var _0x49bab6=_0x186d2a[_0x1a10('0x5f')][_0x45823e];var _0x56c85d='i';var _0x43712a=_[_0x1a10('0x60')](_0x816f92,[_0x1a10('0x2c'),_0x49bab6['field']]);if(!_0x43712a){switch(_0x49bab6[_0x1a10('0x47')]){case _0x1a10('0x61'):if(_0x49bab6[_0x1a10('0x62')]==0x1){_0x384f25[_0x1a10('0x63')]('`'+_0x49bab6[_0x1a10('0x47')]+_0x1a10('0x64'));}else{_0x384f25[_0x1a10('0x63')]('`'+_0x49bab6[_0x1a10('0x47')]+_0x1a10('0x65'));}break;case _0x1a10('0x66'):if(_0x49bab6[_0x1a10('0x67')]===_0x1a10('0x68')){if(_0x49bab6[_0x1a10('0x62')][_0x1a10('0x33')]('\x20')['length']>0x1){_0x55ce9e[_0x395df0](_0x1a10('0x69'),qs[_0x1a10('0x6a')](_0x49bab6[_0x1a10('0x62')]),null);}else{var _0x20505a='%'+_0x49bab6[_0x1a10('0x62')]+'%';_0x55ce9e[_0x395df0](_0x1a10('0x6b'),_0x20505a,_0x20505a,_0x20505a);}}else{_0x43712a=_['find'](_0x816f92,[_0x1a10('0x2c'),_0x1a10('0x6c')]);_0x49bab6[_0x1a10('0x47')]=_0x1a10('0x6c');_0x29151c=as[_0x1a10('0x6d')](_0x56c85d,_0x43712a[_0x1a10('0x38')],_0x49bab6);_0x55ce9e[_0x395df0](_0x29151c[_0x1a10('0x6e')],_0x29151c[_0x1a10('0x62')]['start'],_0x29151c[_0x1a10('0x62')][_0x1a10('0x2a')]);}break;case'Tag':var _0x5402b6=_0x49bab6[_0x1a10('0x62')][_0x1a10('0x33')](',')['map'](function(_0x514131){return Number(_0x514131);});_0x5402b6[_0x1a10('0x6f')](function(_0x4f2123){_0x26b2e5['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4f2123+',%');});_0x2b666f=_[_0x1a10('0x70')](_0x2b666f,_0x5402b6);break;case _0x1a10('0x71'):if(_0x49bab6[_0x1a10('0x67')]===_0x1a10('0x68')){_0x55ce9e[_0x395df0](_0x1a10('0x72'),'%'+_0x49bab6[_0x1a10('0x62')]+'%',null);}else{_0x43712a=_['find'](_0x816f92,[_0x1a10('0x2c'),'UserId']);_0x49bab6[_0x1a10('0x47')]=_0x1a10('0x73');_0x29151c=as[_0x1a10('0x6d')](_0x56c85d,_0x43712a['type'],_0x49bab6);_0x55ce9e[_0x395df0](_0x29151c[_0x1a10('0x6e')],_0x29151c['value'][_0x1a10('0x74')],_0x29151c[_0x1a10('0x62')][_0x1a10('0x2a')]);}break;case _0x1a10('0x75'):_0x29151c=as[_0x1a10('0x6d')]('me',null,_0x49bab6);_0x55ce9e[_0x395df0](_0x29151c['text'],_0x29151c[_0x1a10('0x62')][_0x1a10('0x74')],_0x29151c[_0x1a10('0x62')][_0x1a10('0x2a')]);break;}}else{var _0x29151c=as['buildExpression'](_0x56c85d,_0x43712a['type'],_0x49bab6);_0x55ce9e[_0x395df0](_0x29151c[_0x1a10('0x6e')],_0x29151c['value'][_0x1a10('0x74')],_0x29151c[_0x1a10('0x62')]['end']);}}}else{var _0x195f44=_(_0x299ea4[_0x1a10('0x3a')])[_0x1a10('0x3b')]()[_0x1a10('0x2f')](function(_0x36361d){return _['some'](_0x816f92,[_0x1a10('0x2c'),_0x36361d])?_0x36361d:undefined;})['compact']()[_0x1a10('0x62')]();if(!_[_0x1a10('0x76')](_0x195f44)){_0x195f44[_0x1a10('0x6f')](function(_0x64d377){if(_0x64d377==='WhatsappAccountId'){_0x384f25['where'](_0x1a10('0x77'),[][_0x1a10('0x78')](_0x299ea4[_0x1a10('0x3a')][_0x64d377]));}else if(_0x64d377===_0x1a10('0x79')){var _0x9337dc=JSON['parse'](_0x299ea4['query'][_0x64d377])['$gte'];var _0x5d1b46=JSON[_0x1a10('0x7a')](_0x299ea4['query'][_0x64d377])[_0x1a10('0x7b')];_0x384f25['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x9337dc,_0x5d1b46);}else{if(_0x299ea4[_0x1a10('0x3a')][_0x64d377]===_0x1a10('0x7c')){_0x384f25[_0x1a10('0x45')]('i.'+_0x64d377+_0x1a10('0x7d'));}else{_0x384f25[_0x1a10('0x45')]('i.'+_0x64d377+_0x1a10('0x7e'),_0x299ea4[_0x1a10('0x3a')][_0x64d377]);}}});}if(_0x299ea4[_0x1a10('0x3a')]['read']){if(_0x299ea4[_0x1a10('0x3a')][_0x1a10('0x7f')]==0x1){_0x384f25[_0x1a10('0x63')]('`unreadMessages`\x20=\x200');}else{_0x384f25['having']('`unreadMessages`\x20>\x200');}}if(_0x299ea4[_0x1a10('0x3a')][_0x1a10('0x80')]){_0x2b666f=_['isArray'](_0x299ea4[_0x1a10('0x3a')][_0x1a10('0x80')])?_0x299ea4['query']['tag']:new Array(_0x299ea4[_0x1a10('0x3a')][_0x1a10('0x80')]);_0x2b666f[_0x1a10('0x6f')](function(_0x115131){_0x26b2e5['or'](_0x1a10('0x81'),'%,'+_0x115131+',%');});}if(_0x299ea4[_0x1a10('0x3a')][_0x1a10('0x82')]){var _0x50b08a=_0x299ea4[_0x1a10('0x3a')][_0x1a10('0x82')][_0x1a10('0x83')]('\x5c','\x5c\x5c')[_0x1a10('0x83')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x50b08a)){_0x55ce9e['or']('i.id\x20LIKE\x20?',_0x50b08a+'%')['or'](_0x1a10('0x84'),_0x50b08a+'%');}else{_0x55ce9e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1a10('0x6a')](_0x50b08a))['or'](_0x1a10('0x85'),_0x50b08a+'%');}}}_0x384f25[_0x1a10('0x45')](_0x55ce9e);_0x384f25[_0x1a10('0x86')]('i.id');var _0x42bf98={'type':db[_0x1a10('0x87')][_0x1a10('0x88')]['SELECT'],'raw':!![]};var _0x3f42b8=_0x384f25[_0x1a10('0x89')]();_0x3f42b8[_0x1a10('0x47')](_0x1a10('0x8a'));_0x3f42b8['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x1a10('0x61'));if(_0x448928[_0x1a10('0x43')]){_0x448928['order']['forEach'](function(_0x55ad33){var _0x25e064=_0x55ad33[0x0]===_0x1a10('0x8b')?_0x55ad33[0x0]:'i.'+_0x55ad33[0x0];_0x384f25['order'](_0x25e064,_0x55ad33[0x1]===_0x1a10('0x8c')?![]:!![]);});}if(!_[_0x1a10('0x76')](_0x2b666f)){_0x384f25['having'](_0x26b2e5);_0x3f42b8[_0x1a10('0x45')](_0x1a10('0x8d'),_0x2b666f);}BPromise[_0x1a10('0x8e')]()['then'](function(){if(!_0x186d2a){if(_0x299ea4[_0x1a10('0x3a')]['WhatsappAccountId'])return;_0x3f42b8[_0x1a10('0x45')](_0x1a10('0x8f'));_0x384f25['where'](_0x1a10('0x8f'));return;}if(_0x299ea4[_0x1a10('0x90')][_0x1a10('0x91')]!==_0x1a10('0x92'))return;return _0x299ea4[_0x1a10('0x90')][_0x1a10('0x93')]({'attributes':['id'],'raw':!![]})['then'](function(_0xa3708e){if(_[_0x1a10('0x76')](_0xa3708e)){_0x3f42b8[_0x1a10('0x45')](_0x1a10('0x94'));_0x384f25[_0x1a10('0x45')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x3f42b8['where'](_0x1a10('0x77'),_[_0x1a10('0x2f')](_0xa3708e,'id'));_0x384f25[_0x1a10('0x45')]('i.WhatsappAccountId\x20IN\x20?',_[_0x1a10('0x2f')](_0xa3708e,'id'));}});})['then'](function(){if(_0x299ea4['user'][_0x1a10('0x91')]==='agent'&&!_0x186d2a&&!_0x299ea4[_0x1a10('0x3a')]['WhatsappAccountId'])return[];return db[_0x1a10('0x95')]['query'](_0x3f42b8[_0x1a10('0x96')](),_0x42bf98);})['then'](function(_0x761edc){_0x15f50d[_0x1a10('0x22')]=_0x761edc[_0x1a10('0x41')];if(_0x15f50d[_0x1a10('0x22')]===0x0)return[];return db[_0x1a10('0x95')][_0x1a10('0x3a')](_0x5e7f23[_0x1a10('0x96')](),_0x42bf98)['then'](function(_0x210bb8){_0x792dd6=_[_0x1a10('0x97')](_0x210bb8,'id');_0x42bf98=_[_0x1a10('0x98')](_0x42bf98,{'model':db['WhatsappInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x299ea4[_0x1a10('0x3a')][_0x1a10('0x40')]){_0x448928[_0x1a10('0x3f')]['forEach'](function(_0x1d9fc8){_0x384f25['field']('i.'+_0x1d9fc8);});}else{_0x384f25[_0x1a10('0x47')](_0x1a10('0x99'),_0x1a10('0x61'));_0x384f25[_0x1a10('0x47')]('a.key',_0x1a10('0x9a'));_0x384f25[_0x1a10('0x47')]('a.mandatoryDisposition',_0x1a10('0x9b'));_0x384f25[_0x1a10('0x47')](_0x1a10('0x9c'),_0x1a10('0x8b'));_0x384f25[_0x1a10('0x47')](_0x1a10('0x9d'));_0x384f25[_0x1a10('0x47')](_0x1a10('0x9e'),_0x1a10('0x9f'));_0x384f25['field'](_0x1a10('0xa0'),_0x1a10('0xa1'));_0x384f25[_0x1a10('0x47')](_0x1a10('0xa2'),'Contact.email');_0x384f25['field'](_0x1a10('0xa3'),_0x1a10('0xa4'));_0x384f25['field'](_0x1a10('0xa5'),_0x1a10('0xa6'));_0x384f25[_0x1a10('0x47')](_0x1a10('0xa7'),_0x1a10('0xa8'));_0x384f25['field']('o.fullname',_0x1a10('0xa9'));_0x384f25[_0x1a10('0x47')]('o.internal','Owner.internal');_0x384f25[_0x1a10('0x47')](_0x1a10('0xaa'),_0x1a10('0x32'));}if(_0x448928[_0x1a10('0x21')])_0x384f25[_0x1a10('0x21')](_0x448928[_0x1a10('0x21')]);if(_0x448928[_0x1a10('0x1f')])_0x384f25[_0x1a10('0x1f')](_0x448928[_0x1a10('0x1f')]);return db['sequelize'][_0x1a10('0x3a')](_0x384f25[_0x1a10('0x96')](),_0x42bf98);})['then'](function(_0x3bed8d){if(_0x3bed8d[_0x1a10('0x41')]>0x0)_0x4ead84[_0x1a10('0x45')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x1a10('0x2f')](_0x3bed8d,'id'));return db['sequelize'][_0x1a10('0x3a')](_0x4ead84[_0x1a10('0x96')](),_0x42bf98)[_0x1a10('0x28')](function(_0x4d93ad){var _0x432f98=_[_0x1a10('0xab')](_0x4d93ad,_0x1a10('0xac'));var _0x355722=[];_0x3bed8d[_0x1a10('0x6f')](function(_0x4a7d6b){_0x355722[_0x1a10('0x34')](updateWhatsappInteraction(_0x4a7d6b,_0x792dd6,_0x432f98));});return BPromise['all'](_0x355722);});});})[_0x1a10('0x28')](function(_0x20926d){_0x15f50d['rows']=_0x20926d;return _0x15f50d;})[_0x1a10('0x28')](respondWithFilteredResult(_0xf133cb,_0x448928))[_0x1a10('0x35')](handleError(_0xf133cb,null));};exports['show']=function(_0x17903d,_0x51429d){var _0x13e597={'raw':![],'where':{'id':_0x17903d[_0x1a10('0xad')]['id']}},_0x3adc13={};_0x3adc13[_0x1a10('0x3e')]=_[_0x1a10('0x3b')](db[_0x1a10('0x36')][_0x1a10('0xae')]);_0x3adc13['query']=_[_0x1a10('0x3b')](_0x17903d[_0x1a10('0x3a')]);_0x3adc13[_0x1a10('0x3c')]=_[_0x1a10('0x3d')](_0x3adc13[_0x1a10('0x3e')],_0x3adc13[_0x1a10('0x3a')]);_0x13e597[_0x1a10('0x3f')]=_['intersection'](_0x3adc13[_0x1a10('0x3e')],qs[_0x1a10('0x40')](_0x17903d['query'][_0x1a10('0x40')]));_0x13e597['attributes']=_0x13e597['attributes']['length']?_0x13e597[_0x1a10('0x3f')]:_0x3adc13[_0x1a10('0x3e')];if(_0x17903d[_0x1a10('0x3a')][_0x1a10('0xaf')]){_0x13e597[_0x1a10('0xb0')]=[{'all':!![]}];}_0x13e597=_[_0x1a10('0x98')]({},_0x13e597,_0x17903d['options']);return db[_0x1a10('0x36')][_0x1a10('0x60')](_0x13e597)[_0x1a10('0x28')](handleEntityNotFound(_0x51429d,null))['then'](respondWithResult(_0x51429d,null))[_0x1a10('0x35')](handleError(_0x51429d,null));};exports[_0x1a10('0xb1')]=function(_0x3cb9f9,_0x33b91c){return db[_0x1a10('0x36')][_0x1a10('0xb1')](_0x3cb9f9[_0x1a10('0x75')],{})['then'](respondWithResult(_0x33b91c,0xc9))['catch'](handleError(_0x33b91c,null));};exports[_0x1a10('0x27')]=function(_0x1ae8d9,_0x1ec175){if(_0x1ae8d9['body']['id']){delete _0x1ae8d9[_0x1a10('0x75')]['id'];}return db['WhatsappInteraction'][_0x1a10('0x60')]({'where':{'id':_0x1ae8d9[_0x1a10('0xad')]['id']}})[_0x1a10('0x28')](handleEntityNotFound(_0x1ec175,null))[_0x1a10('0x28')](saveUpdates(_0x1ae8d9[_0x1a10('0x75')],null))['then'](respondWithResult(_0x1ec175,null))[_0x1a10('0x35')](handleError(_0x1ec175,null));};exports[_0x1a10('0x29')]=function(_0x145b3,_0x4a0671){return db[_0x1a10('0x36')][_0x1a10('0x60')]({'where':{'id':_0x145b3[_0x1a10('0xad')]['id']}})[_0x1a10('0x28')](handleEntityNotFound(_0x4a0671,null))[_0x1a10('0x28')](removeEntity(_0x4a0671,null))['catch'](handleError(_0x4a0671,null));};exports[_0x1a10('0xb2')]=function(_0x5800bd,_0x11ae1b){return db[_0x1a10('0x36')]['describe']()[_0x1a10('0x28')](respondWithResult(_0x11ae1b,null))['catch'](handleError(_0x11ae1b,null));};exports['addMessage']=function(_0x49734d,_0x4cd40f,_0x201401){return db[_0x1a10('0xb3')][_0x1a10('0x60')]({'where':{'id':_0x49734d[_0x1a10('0xad')]['id']}})[_0x1a10('0x28')](handleEntityNotFound(_0x4cd40f,null))[_0x1a10('0x28')](function(_0x15b724){if(_0x15b724){return _0x15b724[_0x1a10('0xb4')](_0x49734d[_0x1a10('0x75')][_0x1a10('0xb5')],_[_0x1a10('0xb6')](_0x49734d['body'],[_0x1a10('0xb5'),'id'])||{});}})[_0x1a10('0x28')](respondWithResult(_0x4cd40f,null))[_0x1a10('0x35')](handleError(_0x4cd40f,null));};exports[_0x1a10('0xb7')]=function(_0x1b9935,_0x4ff1bc,_0x132768){var _0x1cf007={'raw':![],'where':{}};var _0x523d83={};var _0x14c67c={'count':0x0,'rows':[]};return db[_0x1a10('0x36')][_0x1a10('0xb8')]({'where':{'id':_0x1b9935[_0x1a10('0xad')]['id']}})[_0x1a10('0x28')](handleEntityNotFound(_0x4ff1bc,null))[_0x1a10('0x28')](function(_0x1caabf){if(_0x1caabf){_0x523d83[_0x1a10('0x3e')]=_[_0x1a10('0x3b')](db[_0x1a10('0xb3')]['rawAttributes']);_0x523d83[_0x1a10('0x3a')]=_[_0x1a10('0x3b')](_0x1b9935['query']);_0x523d83['filters']=_[_0x1a10('0x3d')](_0x523d83['model'],_0x523d83['query']);_0x1cf007[_0x1a10('0x3f')]=_['intersection'](_0x523d83['model'],qs['fields'](_0x1b9935[_0x1a10('0x3a')][_0x1a10('0x40')]));_0x1cf007['attributes']=_0x1cf007[_0x1a10('0x3f')][_0x1a10('0x41')]?_0x1cf007['attributes']:_0x523d83[_0x1a10('0x3e')];if(!_0x1b9935[_0x1a10('0x3a')][_0x1a10('0xb9')]('nolimit')){_0x1cf007['limit']=qs[_0x1a10('0x21')](_0x1b9935[_0x1a10('0x3a')][_0x1a10('0x21')]);_0x1cf007[_0x1a10('0x1f')]=qs[_0x1a10('0x1f')](_0x1b9935[_0x1a10('0x3a')]['offset']);}_0x1cf007[_0x1a10('0x43')]=qs[_0x1a10('0x44')](_0x1b9935['query'][_0x1a10('0x44')]);_0x1cf007[_0x1a10('0x45')]=qs['filters'](_[_0x1a10('0xba')](_0x1b9935[_0x1a10('0x3a')],_0x523d83['filters']));_0x1cf007[_0x1a10('0x45')]['WhatsappInteractionId']=_0x1caabf['id'];if(_0x1b9935[_0x1a10('0x3a')][_0x1a10('0x82')]){_0x1cf007[_0x1a10('0x45')]=_[_0x1a10('0x98')](_0x1cf007['where'],{'$or':_['map'](_0x1cf007[_0x1a10('0x3f')],function(_0x296baa){var _0x111fd1={};_0x111fd1[_0x296baa]={'$like':'%'+_0x1b9935[_0x1a10('0x3a')][_0x1a10('0x82')]+'%'};return _0x111fd1;})});}if(_0x1b9935['query'][_0x1a10('0xbb')]){var _0x36722d=_0x1b9935[_0x1a10('0x3a')][_0x1a10('0xbb')][_0x1a10('0x33')](',');var _0x4ee8a6={};_0x4ee8a6[_0x36722d[0x0]]={'$gte':moment(_0x36722d[0x1])[_0x1a10('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1cf007['where']=_['merge'](_0x1cf007[_0x1a10('0x45')],_0x4ee8a6);}_0x1cf007=_[_0x1a10('0x98')]({},_0x1cf007,_0x1b9935[_0x1a10('0xbd')]);return db[_0x1a10('0xb3')][_0x1a10('0x22')]({'where':_0x1cf007[_0x1a10('0x45')]})['then'](function(_0x29c294){_0x14c67c[_0x1a10('0x22')]=_0x29c294;if(_0x1b9935[_0x1a10('0x3a')][_0x1a10('0xaf')]){_0x1cf007['include']=[{'all':!![]}];}return db[_0x1a10('0xb3')][_0x1a10('0xbe')](_0x1cf007);})[_0x1a10('0x28')](function(_0x4bd097){_0x14c67c[_0x1a10('0xbf')]=_0x4bd097;return _0x14c67c;});}})['then'](respondWithFilteredResult(_0x4ff1bc,_0x1cf007))[_0x1a10('0x35')](handleError(_0x4ff1bc,null));};exports[_0x1a10('0xc0')]=function(_0x1bbdab,_0x40af9b,_0x4a0523){return db[_0x1a10('0x36')]['find']({'where':{'id':_0x1bbdab[_0x1a10('0xad')]['id']}})[_0x1a10('0x28')](handleEntityNotFound(_0x40af9b,null))['then'](function(_0x40d1dd){if(_0x40d1dd){return _0x40d1dd[_0x1a10('0xc1')](_0x1bbdab[_0x1a10('0x75')][_0x1a10('0xb5')],_['omit'](_0x1bbdab['body'],[_0x1a10('0xb5'),'id'])||{})[_0x1a10('0xc2')](function(){return db[_0x1a10('0xc3')]['findAll']({'attributes':['id','name',_0x1a10('0x48')],'where':{'id':_0x1bbdab[_0x1a10('0x75')][_0x1a10('0xb5')]}});})[_0x1a10('0x28')](function(_0x10ea5d){socket[_0x1a10('0xc4')](_0x1a10('0xc5'),{'id':Number(_0x1bbdab['params']['id']),'tags':_0x10ea5d||[]});return{'id':Number(_0x1bbdab[_0x1a10('0xad')]['id']),'tags':_0x10ea5d||[]};});}})[_0x1a10('0x28')](respondWithResult(_0x40af9b,null))[_0x1a10('0x35')](handleError(_0x40af9b,null));};exports[_0x1a10('0xc6')]=function(_0x1dd6de,_0x16dd11,_0x3d4624){return db[_0x1a10('0x36')]['find']({'where':{'id':_0x1dd6de[_0x1a10('0xad')]['id']}})[_0x1a10('0x28')](handleEntityNotFound(_0x16dd11,null))[_0x1a10('0x28')](function(_0x545bdc){if(_0x545bdc){return _0x545bdc[_0x1a10('0xc6')](_0x1dd6de[_0x1a10('0x3a')][_0x1a10('0xb5')]);}})['then'](respondWithStatusCode(_0x16dd11,null))['catch'](handleError(_0x16dd11,null));};exports['download']=function(_0x322ddf,_0x32f519){var _0x112dca=moment()[_0x1a10('0xc7')]()[_0x1a10('0x96')]();var _0x5b3c45=path[_0x1a10('0xc8')](config[_0x1a10('0xc9')],_0x1a10('0xca'),_0x1a10('0xcb'),'tmp');var _0x20306a=path[_0x1a10('0xc8')](config[_0x1a10('0xc9')],_0x1a10('0xca'),_0x1a10('0xcb'),_0x1a10('0xcc'));var _0x5ca770=path['join'](_0x5b3c45,_0x112dca);var _0x26c1b3=util[_0x1a10('0xbc')]('transcript-%d-%s.zip',_0x322ddf['params']['id'],_0x112dca);var _0xb244b3=path[_0x1a10('0xc8')](_0x5b3c45,_0x26c1b3);var _0x7b2d9a=[];_0x7b2d9a[_0x1a10('0x34')]({'model':db[_0x1a10('0x71')],'as':'User','attributes':['id',_0x1a10('0x30')],'raw':!![]});_0x7b2d9a[_0x1a10('0x34')]({'model':db[_0x1a10('0xcd')],'as':_0x1a10('0x66'),'attributes':['id',_0x1a10('0xce'),_0x1a10('0xcf')],'raw':!![]});if(_0x322ddf[_0x1a10('0x3a')][_0x1a10('0xcc')]){_0x7b2d9a['push']({'model':db[_0x1a10('0xd0')],'as':_0x1a10('0xd0'),'raw':!![]});}var _0x4ffad2=[{'model':db['WhatsappMessage'],'as':_0x1a10('0xd1'),'attributes':['id','body',_0x1a10('0x79'),_0x1a10('0xd2'),'secret',_0x1a10('0x7f')],'include':_0x7b2d9a}];_0x4ffad2[_0x1a10('0x34')]({'model':db[_0x1a10('0xd3')],'as':_0x1a10('0xd4'),'attributes':['id','name']});_0x4ffad2[_0x1a10('0x34')]({'model':db['User'],'as':_0x1a10('0xd5'),'attributes':['id',_0x1a10('0x30')]});return db[_0x1a10('0x36')]['find']({'where':{'id':_0x322ddf[_0x1a10('0xad')]['id']},'include':_0x4ffad2})['then'](handleEntityNotFound(_0x32f519,null))[_0x1a10('0x28')](function(_0x3edf94){if(_0x3edf94){var _0x5598b9=_0x3edf94[_0x1a10('0xd6')]({'plain':!![]});fs[_0x1a10('0xd7')](_0x5ca770);var _0x10b8a2={'channel':_0x1a10('0xd8'),'account':_0x5598b9[_0x1a10('0xd4')][_0x1a10('0x2c')],'agent':_0x5598b9[_0x1a10('0xd5')]?_0x5598b9['Owner'][_0x1a10('0x30')]:_0x1a10('0xd9'),'createdAt':moment(_0x5598b9['createdAt'])['format'](_0x1a10('0xda'))[_0x1a10('0x96')](),'closedAt':_0x5598b9[_0x1a10('0xdb')]?moment(_0x5598b9[_0x1a10('0xdc')])[_0x1a10('0xbc')](_0x1a10('0xda'))['toString']():'','disposition':_0x5598b9[_0x1a10('0xdd')],'messages':_(_0x5598b9[_0x1a10('0xd1')])['filter']({'secret':![]})['map'](function(_0x3decc5){if(_0x3decc5[_0x1a10('0xd0')]){var _0x3eab0f=path[_0x1a10('0xc8')](_0x20306a,_0x3decc5[_0x1a10('0xd0')][_0x1a10('0xde')]);if(fs['existsSync'](_0x3eab0f)){fs[_0x1a10('0xdf')](_0x3eab0f)[_0x1a10('0xe0')](fs['createWriteStream'](path['join'](_0x5ca770,_0x3decc5['Attachment'][_0x1a10('0xde')])));}}return{'date':moment(_0x3decc5[_0x1a10('0x79')])[_0x1a10('0xbc')](_0x1a10('0xda'))['toString'](),'sender':_0x3decc5[_0x1a10('0xd2')]==='out'?_0x3decc5[_0x1a10('0x71')]?_0x3decc5[_0x1a10('0x71')]['fullname']:'System':_0x3decc5[_0x1a10('0x66')][_0x1a10('0xce')]+(_0x3decc5[_0x1a10('0x66')][_0x1a10('0xcf')]?'\x20'+_0x3decc5[_0x1a10('0x66')][_0x1a10('0xcf')]:''),'body':_0x3decc5[_0x1a10('0xd0')]?_0x3decc5['Attachment'][_0x1a10('0xde')]:_0x3decc5['body'],'direction':_0x3decc5[_0x1a10('0xd2')]==='out'?'A':'C','secret':_0x3decc5[_0x1a10('0xe1')],'read':_0x3decc5[_0x1a10('0x7f')],'attachment':_0x3decc5[_0x1a10('0xd0')]};})['value']()};return ejs['renderFile'](path[_0x1a10('0xc8')](config[_0x1a10('0xc9')],_0x1a10('0xca'),_0x1a10('0xe2'),_0x1a10('0xe3')),{'interaction':_0x10b8a2})['then'](function(_0x7b48bd){var _0xa7df54=path[_0x1a10('0xc8')](_0x5ca770,_0x1a10('0xe4')+_0x5598b9['id']+'-'+_0x112dca+'.pdf');var _0x23aaf3={'path':_0xa7df54,'channel':_0x1a10('0xd8'),'interactionId':_0x5598b9['id']};return pdf[_0x1a10('0xe5')](_0x7b48bd,_0x23aaf3);})[_0x1a10('0x28')](function(){return new BPromise(function(_0x13065c,_0x4848c9){zipdir(_0x5ca770,{'saveTo':_0xb244b3},function(_0x586288,_0x568ce7){if(_0x586288)return _0x4848c9(_0x586288);return _0x13065c(_0x568ce7);});})['then'](function(){return new BPromise(function(_0x38290c,_0x1e890c){rimraf(_0x5ca770,function(_0x5080e8){if(_0x5080e8)_0x1e890c(_0x5080e8);return _0x38290c();});});})[_0x1a10('0x28')](function(){return _0x32f519[_0x1a10('0xe6')](_0xb244b3,_0x26c1b3,function(_0xdfe515){if(_0xdfe515){console['log'](_0x1a10('0xe7'),_0xdfe515);}else{fs[_0x1a10('0xe8')](_0xb244b3);}});});});}else{return _0x32f519[_0x1a10('0x1c')](0xc8);}})[_0x1a10('0x35')](handleError(_0x32f519,null));};
\ No newline at end of file
+var _0x7a43=['Contact.mobile','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','groupBy','WhatsappInteractionId','all','rows','catch','show','include','options','create','params','describe','WhatsappMessage','addMessage','omit','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','ids','spread','emit','whatsappInteractionTags:save','removeTags','download','join','root','server','files','tmp','format','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','Messages','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','closedAt','disposition','existsSync','createReadStream','pipe','createWriteStream','basename','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','Users','map','fullname','split','forEach','Tags','push','TagIds','index','WhatsappInteraction','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','whatsapp_interactions','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','keys','some','compact','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','WhatsappAccountId','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.phone'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7a43,0x13e));var _0x37a4=function(_0x28c077,_0x237a73){_0x28c077=_0x28c077-0x0;var _0x646e8d=_0x7a43[_0x28c077];return _0x646e8d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x37a4('0x0'));var zipdir=require(_0x37a4('0x1'));var jsonpatch=require(_0x37a4('0x2'));var rp=require(_0x37a4('0x3'));var moment=require(_0x37a4('0x4'));var BPromise=require(_0x37a4('0x5'));var Mustache=require('mustache');var util=require(_0x37a4('0x6'));var path=require(_0x37a4('0x7'));var sox=require(_0x37a4('0x8'));var csv=require(_0x37a4('0x9'));var ejs=require(_0x37a4('0xa'));var fs=require('fs');var fs_extra=require(_0x37a4('0xb'));var _=require(_0x37a4('0xc'));var squel=require(_0x37a4('0xd'));var crypto=require(_0x37a4('0xe'));var jsforce=require(_0x37a4('0xf'));var deskjs=require(_0x37a4('0x10'));var toCsv=require('to-csv');var querystring=require(_0x37a4('0x11'));var Papa=require(_0x37a4('0x12'));var Redis=require(_0x37a4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x37a4('0x14'));var as=require(_0x37a4('0x15'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x37a4('0x16'));var logger=require(_0x37a4('0x17'))('api');var utils=require(_0x37a4('0x18'));var config=require(_0x37a4('0x19'));var licenseUtil=require(_0x37a4('0x1a'));var db=require('../../mysqldb')['db'];config[_0x37a4('0x1b')]=_['defaults'](config[_0x37a4('0x1b')],{'host':_0x37a4('0x1c'),'port':0x18eb});var socket=require(_0x37a4('0x1d'))(new Redis(config['redis']));require(_0x37a4('0x1e'))[_0x37a4('0x1f')](socket);function respondWithStatusCode(_0x39166b,_0x126bff){_0x126bff=_0x126bff||0xcc;return function(_0x16aae3){if(_0x16aae3){return _0x39166b['sendStatus'](_0x126bff);}return _0x39166b[_0x37a4('0x20')](_0x126bff)[_0x37a4('0x21')]();};}function respondWithResult(_0x570430,_0x5bcf73){_0x5bcf73=_0x5bcf73||0xc8;return function(_0x10a156){if(_0x10a156){return _0x570430['status'](_0x5bcf73)[_0x37a4('0x22')](_0x10a156);}};}function respondWithFilteredResult(_0xb58e85,_0x3e4236){return function(_0x5568d2){if(_0x5568d2){var _0x195df5=typeof _0x3e4236[_0x37a4('0x23')]===_0x37a4('0x24')&&typeof _0x3e4236[_0x37a4('0x25')]===_0x37a4('0x24');var _0x4b5a34=_0x5568d2[_0x37a4('0x26')];var _0x423487=_0x195df5?0x0:_0x3e4236[_0x37a4('0x23')];var _0x2be137=_0x195df5?_0x5568d2[_0x37a4('0x26')]:_0x3e4236[_0x37a4('0x23')]+_0x3e4236['limit'];var _0x401003;if(_0x2be137>=_0x4b5a34){_0x2be137=_0x4b5a34;_0x401003=0xc8;}else{_0x401003=0xce;}_0xb58e85['status'](_0x401003);return _0xb58e85['set'](_0x37a4('0x27'),_0x423487+'-'+_0x2be137+'/'+_0x4b5a34)[_0x37a4('0x22')](_0x5568d2);}return null;};}function patchUpdates(_0x457c9f){return function(_0x1321ef){try{jsonpatch[_0x37a4('0x28')](_0x1321ef,_0x457c9f,!![]);}catch(_0x728539){return BPromise[_0x37a4('0x29')](_0x728539);}return _0x1321ef[_0x37a4('0x2a')]();};}function saveUpdates(_0xe4180,_0x30226d){return function(_0xec2564){if(_0xec2564){return _0xec2564[_0x37a4('0x2b')](_0xe4180)['then'](function(_0x4df1bb){return _0x4df1bb;});}return null;};}function removeEntity(_0x554122,_0x3f3ba3){return function(_0x592895){if(_0x592895){return _0x592895[_0x37a4('0x2c')]()[_0x37a4('0x2d')](function(){_0x554122['status'](0xcc)[_0x37a4('0x21')]();});}};}function handleEntityNotFound(_0xc9cc7d,_0x4b448b){return function(_0x47eff0){if(!_0x47eff0){_0xc9cc7d[_0x37a4('0x2e')](0x194);}return _0x47eff0;};}function handleError(_0x1ad212,_0x42f9c1){_0x42f9c1=_0x42f9c1||0x1f4;return function(_0xf19dc4){logger['error'](_0xf19dc4[_0x37a4('0x2f')]);if(_0xf19dc4[_0x37a4('0x30')]){delete _0xf19dc4[_0x37a4('0x30')];}_0x1ad212[_0x37a4('0x20')](_0x42f9c1)[_0x37a4('0x31')](_0xf19dc4);};}function getInteractionUsers(_0x28291b,_0x26ec28){return new BPromise(function(_0x1eec41,_0x3c6d1a){try{if(_0x26ec28[_0x28291b['id']]){_0x28291b[_0x37a4('0x32')]=_[_0x37a4('0x33')](_0x26ec28[_0x28291b['id']],function(_0x133765){return{'id':_0x133765['id'],'fullname':_0x133765[_0x37a4('0x34')]};});}}catch(_0x27c84b){_0x3c6d1a(_0x27c84b);}_0x1eec41(_0x28291b);});}function getInteractionTags(_0x558ae7,_0x5f4e73){return new BPromise(function(_0x4a9539,_0x11da7d){try{if(_0x558ae7['TagIds']){_0x558ae7['Tags']=[];_0x558ae7['TagIds'][_0x37a4('0x35')](',')[_0x37a4('0x36')](function(_0x3551b5){_0x558ae7[_0x37a4('0x37')][_0x37a4('0x38')](_0x5f4e73[_0x3551b5]);});}delete _0x558ae7[_0x37a4('0x39')];}catch(_0x8eba35){_0x11da7d(_0x8eba35);}_0x4a9539(_0x558ae7);});}function updateWhatsappInteraction(_0x333143,_0x16afa2,_0x2c8166){return new BPromise(function(_0x5c2a1c,_0x17deb0){return getInteractionUsers(_0x333143,_0x2c8166)['then'](function(_0x4fa987){return getInteractionTags(_0x4fa987,_0x16afa2);})['then'](function(_0x5574ca){_0x5c2a1c(_0x5574ca);})['catch'](function(_0xa81e00){_0x17deb0(_0xa81e00);});});}exports[_0x37a4('0x3a')]=function(_0x47f7f8,_0x3877fc){var _0x4bbc24={},_0x5bf7ac={},_0x3d1920={'count':0x0,'rows':[]};var _0x583c7f=_[_0x37a4('0x33')](db[_0x37a4('0x3b')][_0x37a4('0x3c')],function(_0x37db65){return{'name':_0x37db65['fieldName'],'type':_0x37db65[_0x37a4('0x3d')][_0x37a4('0x3e')]};});_0x5bf7ac[_0x37a4('0x3f')]=_['map'](_0x583c7f,'name');_0x5bf7ac[_0x37a4('0x40')]=_['keys'](_0x47f7f8[_0x37a4('0x40')]);_0x5bf7ac[_0x37a4('0x41')]=_[_0x37a4('0x42')](_0x5bf7ac[_0x37a4('0x3f')],_0x5bf7ac[_0x37a4('0x40')]);_0x4bbc24[_0x37a4('0x43')]=_[_0x37a4('0x42')](_0x5bf7ac['model'],qs[_0x37a4('0x44')](_0x47f7f8['query'][_0x37a4('0x44')]));_0x4bbc24[_0x37a4('0x43')]=_0x4bbc24['attributes'][_0x37a4('0x45')]?_0x4bbc24[_0x37a4('0x43')]:_0x5bf7ac[_0x37a4('0x3f')];if(!_0x47f7f8['query'][_0x37a4('0x46')](_0x37a4('0x47'))){_0x4bbc24[_0x37a4('0x25')]=qs['limit'](_0x47f7f8['query'][_0x37a4('0x25')]);_0x4bbc24['offset']=qs[_0x37a4('0x23')](_0x47f7f8['query'][_0x37a4('0x23')]);}_0x4bbc24[_0x37a4('0x48')]=qs[_0x37a4('0x49')](_0x47f7f8[_0x37a4('0x40')]['sort']);_0x4bbc24[_0x37a4('0x4a')]=qs[_0x37a4('0x41')](_[_0x37a4('0x4b')](_0x47f7f8['query'],_0x5bf7ac[_0x37a4('0x41')]),_0x583c7f);var _0x37f7fa=[];var _0x2009e8=squel[_0x37a4('0x4c')]()['field']('id')[_0x37a4('0x4d')]('name')[_0x37a4('0x4d')](_0x37a4('0x4e'))[_0x37a4('0x4f')](_0x37a4('0x50'));var _0x275ab6=squel[_0x37a4('0x4c')]()[_0x37a4('0x4d')](_0x37a4('0x51'))['field'](_0x37a4('0x52'))[_0x37a4('0x4d')](_0x37a4('0x53'))['from'](_0x37a4('0x54'),'ui')[_0x37a4('0x55')](_0x37a4('0x56'),'u','u.id\x20=\x20ui.UserId');var _0x51043a=squel[_0x37a4('0x4c')]()[_0x37a4('0x4f')](_0x37a4('0x57'),'i')['left_join'](_0x37a4('0x58'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x37a4('0x55')](_0x37a4('0x56'),'o',_0x37a4('0x59'))[_0x37a4('0x55')](_0x37a4('0x5a'),'a',_0x37a4('0x5b'))[_0x37a4('0x55')](_0x37a4('0x5c'),'me',_0x37a4('0x5d'))['left_join'](_0x37a4('0x5e'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x37a4('0x55')]('tools_tags','t',_0x37a4('0x5f'));var _0x64be00=squel[_0x37a4('0x60')]();var _0x495009=[];var _0xa2fab9=squel[_0x37a4('0x60')]();var _0x550746;if(_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x61')]){_0x550746=as['parseSearch'](_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x61')]);var _0x10957b=_0x550746['sqlOperator'];for(var _0x41f415=0x0;_0x41f415<_0x550746[_0x37a4('0x62')][_0x37a4('0x45')];_0x41f415++){var _0x1356da=_0x550746[_0x37a4('0x62')][_0x41f415];var _0x4d4c02='i';var _0x1ac76f=_['find'](_0x583c7f,[_0x37a4('0x30'),_0x1356da[_0x37a4('0x4d')]]);if(!_0x1ac76f){switch(_0x1356da['field']){case _0x37a4('0x63'):if(_0x1356da[_0x37a4('0x64')]==0x1){_0x51043a[_0x37a4('0x65')]('`'+_0x1356da[_0x37a4('0x4d')]+_0x37a4('0x66'));}else{_0x51043a[_0x37a4('0x65')]('`'+_0x1356da[_0x37a4('0x4d')]+_0x37a4('0x67'));}break;case _0x37a4('0x68'):if(_0x1356da['operator']===_0x37a4('0x69')){if(_0x1356da[_0x37a4('0x64')]['split']('\x20')[_0x37a4('0x45')]>0x1){_0x64be00[_0x10957b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x37a4('0x6a')](_0x1356da['value']),null);}else{var _0x32375b='%'+_0x1356da[_0x37a4('0x64')]+'%';_0x64be00[_0x10957b](_0x37a4('0x6b'),_0x32375b,_0x32375b,_0x32375b);}}else{_0x1ac76f=_[_0x37a4('0x6c')](_0x583c7f,[_0x37a4('0x30'),_0x37a4('0x6d')]);_0x1356da[_0x37a4('0x4d')]=_0x37a4('0x6d');_0x17613b=as[_0x37a4('0x6e')](_0x4d4c02,_0x1ac76f[_0x37a4('0x3d')],_0x1356da);_0x64be00[_0x10957b](_0x17613b[_0x37a4('0x6f')],_0x17613b['value'][_0x37a4('0x70')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x21')]);}break;case _0x37a4('0x71'):var _0x502c1e=_0x1356da[_0x37a4('0x64')][_0x37a4('0x35')](',')[_0x37a4('0x33')](function(_0x457ac8){return Number(_0x457ac8);});_0x502c1e[_0x37a4('0x36')](function(_0x384f6c){_0xa2fab9['or'](_0x37a4('0x72'),'%,'+_0x384f6c+',%');});_0x495009=_[_0x37a4('0x73')](_0x495009,_0x502c1e);break;case _0x37a4('0x74'):if(_0x1356da[_0x37a4('0x75')]===_0x37a4('0x69')){_0x64be00[_0x10957b](_0x37a4('0x76'),'%'+_0x1356da[_0x37a4('0x64')]+'%',null);}else{_0x1ac76f=_['find'](_0x583c7f,['name',_0x37a4('0x77')]);_0x1356da['field']='UserId';_0x17613b=as[_0x37a4('0x6e')](_0x4d4c02,_0x1ac76f[_0x37a4('0x3d')],_0x1356da);_0x64be00[_0x10957b](_0x17613b[_0x37a4('0x6f')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x70')],_0x17613b[_0x37a4('0x64')]['end']);}break;case _0x37a4('0x78'):_0x17613b=as['buildExpression']('me',null,_0x1356da);_0x64be00[_0x10957b](_0x17613b[_0x37a4('0x6f')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x70')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x21')]);break;}}else{var _0x17613b=as[_0x37a4('0x6e')](_0x4d4c02,_0x1ac76f['type'],_0x1356da);_0x64be00[_0x10957b](_0x17613b[_0x37a4('0x6f')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x70')],_0x17613b[_0x37a4('0x64')][_0x37a4('0x21')]);}}}else{var _0x84284f=_(_0x47f7f8[_0x37a4('0x40')])[_0x37a4('0x79')]()[_0x37a4('0x33')](function(_0x8f45cb){return _[_0x37a4('0x7a')](_0x583c7f,['name',_0x8f45cb])?_0x8f45cb:undefined;})[_0x37a4('0x7b')]()[_0x37a4('0x64')]();if(!_['isEmpty'](_0x84284f)){_0x84284f['forEach'](function(_0x519887){if(_0x519887==='WhatsappAccountId'){_0x51043a[_0x37a4('0x4a')](_0x37a4('0x7c'),[][_0x37a4('0x7d')](_0x47f7f8[_0x37a4('0x40')][_0x519887]));}else if(_0x519887===_0x37a4('0x7e')){var _0xd06d0f=JSON[_0x37a4('0x7f')](_0x47f7f8[_0x37a4('0x40')][_0x519887])['$gte'];var _0x40ebcd=JSON['parse'](_0x47f7f8[_0x37a4('0x40')][_0x519887])[_0x37a4('0x80')];_0x51043a['where'](_0x37a4('0x81'),_0xd06d0f,_0x40ebcd);}else{if(_0x47f7f8[_0x37a4('0x40')][_0x519887]===_0x37a4('0x82')){_0x51043a[_0x37a4('0x4a')]('i.'+_0x519887+_0x37a4('0x83'));}else{_0x51043a[_0x37a4('0x4a')]('i.'+_0x519887+_0x37a4('0x84'),_0x47f7f8[_0x37a4('0x40')][_0x519887]);}}});}if(_0x47f7f8[_0x37a4('0x40')]['read']){if(_0x47f7f8[_0x37a4('0x40')]['read']==0x1){_0x51043a['having']('`unreadMessages`\x20=\x200');}else{_0x51043a[_0x37a4('0x65')](_0x37a4('0x85'));}}if(_0x47f7f8['query'][_0x37a4('0x86')]){_0x495009=_[_0x37a4('0x87')](_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x86')])?_0x47f7f8['query'][_0x37a4('0x86')]:new Array(_0x47f7f8['query'][_0x37a4('0x86')]);_0x495009[_0x37a4('0x36')](function(_0x58a80f){_0xa2fab9['or'](_0x37a4('0x72'),'%,'+_0x58a80f+',%');});}if(_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x88')]){var _0x73f5df=_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x88')][_0x37a4('0x89')]('\x5c','\x5c\x5c')[_0x37a4('0x89')](/'/g,'\x27\x27');if(qs[_0x37a4('0x8a')](_0x73f5df)){_0x64be00['or']('i.id\x20LIKE\x20?',_0x73f5df+'%')['or'](_0x37a4('0x8b'),_0x73f5df+'%');}else{_0x64be00['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x37a4('0x6a')](_0x73f5df))['or'](_0x37a4('0x8c'),_0x73f5df+'%');}}}_0x51043a[_0x37a4('0x4a')](_0x64be00);_0x51043a[_0x37a4('0x8d')](_0x37a4('0x8e'));var _0x17e285={'type':db['Sequelize'][_0x37a4('0x8f')][_0x37a4('0x90')],'raw':!![]};var _0x16dc6c=_0x51043a[_0x37a4('0x91')]();_0x16dc6c['field'](_0x37a4('0x8e'));_0x16dc6c[_0x37a4('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x4bbc24[_0x37a4('0x48')]){_0x4bbc24[_0x37a4('0x48')][_0x37a4('0x36')](function(_0x5938d6){var _0x45ef19=_0x5938d6[0x0]===_0x37a4('0x92')?_0x5938d6[0x0]:'i.'+_0x5938d6[0x0];_0x51043a[_0x37a4('0x48')](_0x45ef19,_0x5938d6[0x1]===_0x37a4('0x93')?![]:!![]);});}if(!_[_0x37a4('0x94')](_0x495009)){_0x51043a[_0x37a4('0x65')](_0xa2fab9);_0x16dc6c['where'](_0x37a4('0x95'),_0x495009);}BPromise['resolve']()[_0x37a4('0x2d')](function(){if(!_0x550746){if(_0x47f7f8[_0x37a4('0x40')]['WhatsappAccountId'])return;_0x16dc6c[_0x37a4('0x4a')](_0x37a4('0x96'));_0x51043a[_0x37a4('0x4a')](_0x37a4('0x96'));return;}if(_0x47f7f8['user'][_0x37a4('0x97')]!==_0x37a4('0x98'))return;return _0x47f7f8[_0x37a4('0x99')][_0x37a4('0x9a')]({'attributes':['id'],'raw':!![]})[_0x37a4('0x2d')](function(_0x219cc0){if(_[_0x37a4('0x94')](_0x219cc0)){_0x16dc6c['where'](_0x37a4('0x9b'));_0x51043a[_0x37a4('0x4a')](_0x37a4('0x9b'));}else{_0x16dc6c[_0x37a4('0x4a')](_0x37a4('0x7c'),_[_0x37a4('0x33')](_0x219cc0,'id'));_0x51043a['where'](_0x37a4('0x7c'),_[_0x37a4('0x33')](_0x219cc0,'id'));}});})['then'](function(){if(_0x47f7f8[_0x37a4('0x99')][_0x37a4('0x97')]===_0x37a4('0x98')&&!_0x550746&&!_0x47f7f8['query'][_0x37a4('0x9c')])return[];return db['sequelize'][_0x37a4('0x40')](_0x16dc6c[_0x37a4('0x9d')](),_0x17e285);})[_0x37a4('0x2d')](function(_0x1848e6){_0x3d1920[_0x37a4('0x26')]=_0x1848e6['length'];if(_0x3d1920[_0x37a4('0x26')]===0x0)return[];return db['sequelize'][_0x37a4('0x40')](_0x2009e8[_0x37a4('0x9d')](),_0x17e285)[_0x37a4('0x2d')](function(_0x4f0e72){_0x37f7fa=_[_0x37a4('0x9e')](_0x4f0e72,'id');_0x17e285=_[_0x37a4('0x9f')](_0x17e285,{'model':db[_0x37a4('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x47f7f8[_0x37a4('0x40')][_0x37a4('0x44')]){_0x4bbc24[_0x37a4('0x43')][_0x37a4('0x36')](function(_0x40b2df){_0x51043a[_0x37a4('0x4d')]('i.'+_0x40b2df);});}else{_0x51043a['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x37a4('0x63'));_0x51043a['field'](_0x37a4('0xa0'),_0x37a4('0xa1'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xa2'),_0x37a4('0xa3'));_0x51043a[_0x37a4('0x4d')]('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x37a4('0x92'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xa4'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xa5'),_0x37a4('0xa6'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xa7'),_0x37a4('0xa8'));_0x51043a[_0x37a4('0x4d')]('c.email','Contact.email');_0x51043a['field']('c.phone',_0x37a4('0xa9'));_0x51043a[_0x37a4('0x4d')]('c.mobile',_0x37a4('0xaa'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xab'),'Contact.fax');_0x51043a[_0x37a4('0x4d')](_0x37a4('0xac'),_0x37a4('0xad'));_0x51043a[_0x37a4('0x4d')]('o.internal',_0x37a4('0xae'));_0x51043a[_0x37a4('0x4d')](_0x37a4('0xaf'),_0x37a4('0x39'));}if(_0x4bbc24[_0x37a4('0x25')])_0x51043a[_0x37a4('0x25')](_0x4bbc24[_0x37a4('0x25')]);if(_0x4bbc24[_0x37a4('0x23')])_0x51043a[_0x37a4('0x23')](_0x4bbc24['offset']);return db[_0x37a4('0xb0')]['query'](_0x51043a[_0x37a4('0x9d')](),_0x17e285);})[_0x37a4('0x2d')](function(_0x72a6d4){if(_0x72a6d4[_0x37a4('0x45')]>0x0)_0x275ab6[_0x37a4('0x4a')]('ui.WhatsappInteractionId\x20IN\x20?',_['map'](_0x72a6d4,'id'));return db[_0x37a4('0xb0')][_0x37a4('0x40')](_0x275ab6[_0x37a4('0x9d')](),_0x17e285)['then'](function(_0xfca958){var _0x3b6e56=_[_0x37a4('0xb1')](_0xfca958,_0x37a4('0xb2'));var _0x806b50=[];_0x72a6d4[_0x37a4('0x36')](function(_0x459033){_0x806b50['push'](updateWhatsappInteraction(_0x459033,_0x37f7fa,_0x3b6e56));});return BPromise[_0x37a4('0xb3')](_0x806b50);});});})['then'](function(_0x17c5e4){_0x3d1920[_0x37a4('0xb4')]=_0x17c5e4;return _0x3d1920;})['then'](respondWithFilteredResult(_0x3877fc,_0x4bbc24))[_0x37a4('0xb5')](handleError(_0x3877fc,null));};exports[_0x37a4('0xb6')]=function(_0x23bfd9,_0x36193a){var _0x215bad={'raw':![],'where':{'id':_0x23bfd9['params']['id']}},_0x3d6058={};_0x3d6058[_0x37a4('0x3f')]=_[_0x37a4('0x79')](db[_0x37a4('0x3b')][_0x37a4('0x3c')]);_0x3d6058[_0x37a4('0x40')]=_[_0x37a4('0x79')](_0x23bfd9['query']);_0x3d6058[_0x37a4('0x41')]=_[_0x37a4('0x42')](_0x3d6058[_0x37a4('0x3f')],_0x3d6058['query']);_0x215bad[_0x37a4('0x43')]=_['intersection'](_0x3d6058[_0x37a4('0x3f')],qs[_0x37a4('0x44')](_0x23bfd9[_0x37a4('0x40')]['fields']));_0x215bad[_0x37a4('0x43')]=_0x215bad[_0x37a4('0x43')][_0x37a4('0x45')]?_0x215bad['attributes']:_0x3d6058[_0x37a4('0x3f')];if(_0x23bfd9[_0x37a4('0x40')]['includeAll']){_0x215bad[_0x37a4('0xb7')]=[{'all':!![]}];}_0x215bad=_[_0x37a4('0x9f')]({},_0x215bad,_0x23bfd9[_0x37a4('0xb8')]);return db[_0x37a4('0x3b')][_0x37a4('0x6c')](_0x215bad)[_0x37a4('0x2d')](handleEntityNotFound(_0x36193a,null))[_0x37a4('0x2d')](respondWithResult(_0x36193a,null))[_0x37a4('0xb5')](handleError(_0x36193a,null));};exports[_0x37a4('0xb9')]=function(_0x5e8b96,_0xfb50e2){return db[_0x37a4('0x3b')][_0x37a4('0xb9')](_0x5e8b96[_0x37a4('0x78')],{})['then'](respondWithResult(_0xfb50e2,0xc9))[_0x37a4('0xb5')](handleError(_0xfb50e2,null));};exports[_0x37a4('0x2b')]=function(_0x5736e6,_0x452e56){if(_0x5736e6[_0x37a4('0x78')]['id']){delete _0x5736e6[_0x37a4('0x78')]['id'];}return db[_0x37a4('0x3b')][_0x37a4('0x6c')]({'where':{'id':_0x5736e6['params']['id']}})[_0x37a4('0x2d')](handleEntityNotFound(_0x452e56,null))[_0x37a4('0x2d')](saveUpdates(_0x5736e6[_0x37a4('0x78')],null))['then'](respondWithResult(_0x452e56,null))[_0x37a4('0xb5')](handleError(_0x452e56,null));};exports[_0x37a4('0x2c')]=function(_0x3ace59,_0x26c4fa){return db[_0x37a4('0x3b')][_0x37a4('0x6c')]({'where':{'id':_0x3ace59[_0x37a4('0xba')]['id']}})[_0x37a4('0x2d')](handleEntityNotFound(_0x26c4fa,null))[_0x37a4('0x2d')](removeEntity(_0x26c4fa,null))[_0x37a4('0xb5')](handleError(_0x26c4fa,null));};exports[_0x37a4('0xbb')]=function(_0x49f1af,_0x15b8dc){return db[_0x37a4('0x3b')]['describe']()['then'](respondWithResult(_0x15b8dc,null))[_0x37a4('0xb5')](handleError(_0x15b8dc,null));};exports['addMessage']=function(_0xbea30a,_0xd20ae,_0x2a149f){return db[_0x37a4('0xbc')][_0x37a4('0x6c')]({'where':{'id':_0xbea30a['params']['id']}})[_0x37a4('0x2d')](handleEntityNotFound(_0xd20ae,null))[_0x37a4('0x2d')](function(_0x437c42){if(_0x437c42){return _0x437c42[_0x37a4('0xbd')](_0xbea30a['body']['ids'],_[_0x37a4('0xbe')](_0xbea30a[_0x37a4('0x78')],['ids','id'])||{});}})[_0x37a4('0x2d')](respondWithResult(_0xd20ae,null))[_0x37a4('0xb5')](handleError(_0xd20ae,null));};exports[_0x37a4('0xbf')]=function(_0xc6a8bd,_0x250c6a,_0x47d046){var _0x3e936f={'raw':![],'where':{}};var _0x2f7f62={};var _0x3b6491={'count':0x0,'rows':[]};return db[_0x37a4('0x3b')]['findOne']({'where':{'id':_0xc6a8bd[_0x37a4('0xba')]['id']}})[_0x37a4('0x2d')](handleEntityNotFound(_0x250c6a,null))[_0x37a4('0x2d')](function(_0x56a0ec){if(_0x56a0ec){_0x2f7f62[_0x37a4('0x3f')]=_[_0x37a4('0x79')](db[_0x37a4('0xbc')][_0x37a4('0x3c')]);_0x2f7f62[_0x37a4('0x40')]=_[_0x37a4('0x79')](_0xc6a8bd[_0x37a4('0x40')]);_0x2f7f62['filters']=_[_0x37a4('0x42')](_0x2f7f62[_0x37a4('0x3f')],_0x2f7f62[_0x37a4('0x40')]);_0x3e936f['attributes']=_[_0x37a4('0x42')](_0x2f7f62[_0x37a4('0x3f')],qs['fields'](_0xc6a8bd[_0x37a4('0x40')]['fields']));_0x3e936f[_0x37a4('0x43')]=_0x3e936f[_0x37a4('0x43')][_0x37a4('0x45')]?_0x3e936f['attributes']:_0x2f7f62['model'];if(!_0xc6a8bd[_0x37a4('0x40')]['hasOwnProperty'](_0x37a4('0x47'))){_0x3e936f[_0x37a4('0x25')]=qs[_0x37a4('0x25')](_0xc6a8bd['query']['limit']);_0x3e936f[_0x37a4('0x23')]=qs['offset'](_0xc6a8bd[_0x37a4('0x40')][_0x37a4('0x23')]);}_0x3e936f[_0x37a4('0x48')]=qs[_0x37a4('0x49')](_0xc6a8bd['query'][_0x37a4('0x49')]);_0x3e936f[_0x37a4('0x4a')]=qs[_0x37a4('0x41')](_[_0x37a4('0x4b')](_0xc6a8bd[_0x37a4('0x40')],_0x2f7f62[_0x37a4('0x41')]));_0x3e936f['where']['WhatsappInteractionId']=_0x56a0ec['id'];if(_0xc6a8bd[_0x37a4('0x40')][_0x37a4('0x88')]){_0x3e936f[_0x37a4('0x4a')]=_[_0x37a4('0x9f')](_0x3e936f[_0x37a4('0x4a')],{'$or':_['map'](_0x3e936f[_0x37a4('0x43')],function(_0x96055d){var _0x205320={};_0x205320[_0x96055d]={'$like':'%'+_0xc6a8bd[_0x37a4('0x40')][_0x37a4('0x88')]+'%'};return _0x205320;})});}if(_0xc6a8bd[_0x37a4('0x40')]['$gte']){var _0x1d5d65=_0xc6a8bd[_0x37a4('0x40')][_0x37a4('0xc0')][_0x37a4('0x35')](',');var _0xf90a63={};_0xf90a63[_0x1d5d65[0x0]]={'$gte':moment(_0x1d5d65[0x1])['format'](_0x37a4('0xc1'))};_0x3e936f[_0x37a4('0x4a')]=_['merge'](_0x3e936f['where'],_0xf90a63);}_0x3e936f=_['merge']({},_0x3e936f,_0xc6a8bd[_0x37a4('0xb8')]);return db[_0x37a4('0xbc')][_0x37a4('0x26')]({'where':_0x3e936f[_0x37a4('0x4a')]})[_0x37a4('0x2d')](function(_0x288ac3){_0x3b6491[_0x37a4('0x26')]=_0x288ac3;if(_0xc6a8bd[_0x37a4('0x40')][_0x37a4('0xc2')]){_0x3e936f[_0x37a4('0xb7')]=[{'all':!![]}];}return db[_0x37a4('0xbc')][_0x37a4('0xc3')](_0x3e936f);})[_0x37a4('0x2d')](function(_0x1194d5){_0x3b6491[_0x37a4('0xb4')]=_0x1194d5;return _0x3b6491;});}})['then'](respondWithFilteredResult(_0x250c6a,_0x3e936f))[_0x37a4('0xb5')](handleError(_0x250c6a,null));};exports[_0x37a4('0xc4')]=function(_0x1ef139,_0x433ac5,_0x5d0a32){return db['WhatsappInteraction'][_0x37a4('0x6c')]({'where':{'id':_0x1ef139[_0x37a4('0xba')]['id']}})['then'](handleEntityNotFound(_0x433ac5,null))[_0x37a4('0x2d')](function(_0x26cda2){if(_0x26cda2){return _0x26cda2[_0x37a4('0xc5')](_0x1ef139[_0x37a4('0x78')][_0x37a4('0xc6')],_[_0x37a4('0xbe')](_0x1ef139[_0x37a4('0x78')],[_0x37a4('0xc6'),'id'])||{})[_0x37a4('0xc7')](function(){return db['Tag'][_0x37a4('0xc3')]({'attributes':['id',_0x37a4('0x30'),_0x37a4('0x4e')],'where':{'id':_0x1ef139[_0x37a4('0x78')][_0x37a4('0xc6')]}});})[_0x37a4('0x2d')](function(_0x281bf5){socket[_0x37a4('0xc8')](_0x37a4('0xc9'),{'id':Number(_0x1ef139[_0x37a4('0xba')]['id']),'tags':_0x281bf5||[]});return{'id':Number(_0x1ef139[_0x37a4('0xba')]['id']),'tags':_0x281bf5||[]};});}})[_0x37a4('0x2d')](respondWithResult(_0x433ac5,null))[_0x37a4('0xb5')](handleError(_0x433ac5,null));};exports[_0x37a4('0xca')]=function(_0x3259ae,_0x26d196,_0x181b96){return db['WhatsappInteraction'][_0x37a4('0x6c')]({'where':{'id':_0x3259ae[_0x37a4('0xba')]['id']}})[_0x37a4('0x2d')](handleEntityNotFound(_0x26d196,null))[_0x37a4('0x2d')](function(_0x4cf7a4){if(_0x4cf7a4){return _0x4cf7a4['removeTags'](_0x3259ae[_0x37a4('0x40')]['ids']);}})[_0x37a4('0x2d')](respondWithStatusCode(_0x26d196,null))[_0x37a4('0xb5')](handleError(_0x26d196,null));};exports[_0x37a4('0xcb')]=function(_0x33723f,_0x402981){var _0x4ceb87=moment()['unix']()[_0x37a4('0x9d')]();var _0x545e1b=path[_0x37a4('0xcc')](config[_0x37a4('0xcd')],_0x37a4('0xce'),_0x37a4('0xcf'),_0x37a4('0xd0'));var _0x478dbd=path[_0x37a4('0xcc')](config[_0x37a4('0xcd')],_0x37a4('0xce'),_0x37a4('0xcf'),'attachments');var _0x4d276f=path[_0x37a4('0xcc')](_0x545e1b,_0x4ceb87);var _0x1b357e=util[_0x37a4('0xd1')](_0x37a4('0xd2'),_0x33723f[_0x37a4('0xba')]['id'],_0x4ceb87);var _0x3da3d3=path[_0x37a4('0xcc')](_0x545e1b,_0x1b357e);var _0x3a6ff9=[];_0x3a6ff9[_0x37a4('0x38')]({'model':db['User'],'as':_0x37a4('0x74'),'attributes':['id',_0x37a4('0x34')],'raw':!![]});_0x3a6ff9[_0x37a4('0x38')]({'model':db[_0x37a4('0xd3')],'as':_0x37a4('0x68'),'attributes':['id',_0x37a4('0xd4'),_0x37a4('0xd5')],'raw':!![]});if(_0x33723f[_0x37a4('0x40')][_0x37a4('0xd6')]){_0x3a6ff9[_0x37a4('0x38')]({'model':db[_0x37a4('0xd7')],'as':_0x37a4('0xd7'),'raw':!![]});}var _0x49f948=[{'model':db[_0x37a4('0xbc')],'as':_0x37a4('0xd8'),'attributes':['id',_0x37a4('0x78'),'createdAt',_0x37a4('0xd9'),_0x37a4('0xda'),_0x37a4('0xdb')],'include':_0x3a6ff9}];_0x49f948['push']({'model':db[_0x37a4('0xdc')],'as':_0x37a4('0xdd'),'attributes':['id','name']});_0x49f948['push']({'model':db[_0x37a4('0x74')],'as':_0x37a4('0xde'),'attributes':['id',_0x37a4('0x34')]});return db[_0x37a4('0x3b')][_0x37a4('0x6c')]({'where':{'id':_0x33723f['params']['id']},'include':_0x49f948})[_0x37a4('0x2d')](handleEntityNotFound(_0x402981,null))[_0x37a4('0x2d')](function(_0xbda3c1){if(_0xbda3c1){var _0x37cf2e=_0xbda3c1[_0x37a4('0xdf')]({'plain':!![]});fs[_0x37a4('0xe0')](_0x4d276f);var _0x4d89df={'channel':'Whatsapp','account':_0x37cf2e[_0x37a4('0xdd')][_0x37a4('0x30')],'agent':_0x37cf2e[_0x37a4('0xde')]?_0x37cf2e[_0x37a4('0xde')][_0x37a4('0x34')]:'N.A.','createdAt':moment(_0x37cf2e[_0x37a4('0x7e')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x37a4('0x9d')](),'closedAt':_0x37cf2e['closed']?moment(_0x37cf2e[_0x37a4('0xe1')])[_0x37a4('0xd1')](_0x37a4('0xc1'))[_0x37a4('0x9d')]():'','disposition':_0x37cf2e[_0x37a4('0xe2')],'messages':_(_0x37cf2e['Messages'])[_0x37a4('0x88')]({'secret':![]})[_0x37a4('0x33')](function(_0x3d62f8){if(_0x3d62f8[_0x37a4('0xd7')]){var _0x1e9e55=path['join'](_0x478dbd,_0x3d62f8['Attachment']['basename']);if(fs[_0x37a4('0xe3')](_0x1e9e55)){fs[_0x37a4('0xe4')](_0x1e9e55)[_0x37a4('0xe5')](fs[_0x37a4('0xe6')](path['join'](_0x4d276f,_0x3d62f8[_0x37a4('0xd7')][_0x37a4('0xe7')])));}}return{'date':moment(_0x3d62f8[_0x37a4('0x7e')])[_0x37a4('0xd1')](_0x37a4('0xc1'))[_0x37a4('0x9d')](),'sender':_0x3d62f8[_0x37a4('0xd9')]===_0x37a4('0xe8')?_0x3d62f8[_0x37a4('0x74')]?_0x3d62f8[_0x37a4('0x74')][_0x37a4('0x34')]:_0x37a4('0xe9'):_0x3d62f8[_0x37a4('0x68')][_0x37a4('0xd4')]+(_0x3d62f8['Contact'][_0x37a4('0xd5')]?'\x20'+_0x3d62f8['Contact'][_0x37a4('0xd5')]:''),'body':_0x3d62f8[_0x37a4('0xd7')]?_0x3d62f8[_0x37a4('0xd7')][_0x37a4('0xe7')]:_0x3d62f8[_0x37a4('0x78')],'direction':_0x3d62f8[_0x37a4('0xd9')]===_0x37a4('0xe8')?'A':'C','secret':_0x3d62f8[_0x37a4('0xda')],'read':_0x3d62f8[_0x37a4('0xdb')],'attachment':_0x3d62f8['Attachment']};})['value']()};return ejs[_0x37a4('0xea')](path[_0x37a4('0xcc')](config[_0x37a4('0xcd')],'server',_0x37a4('0xeb'),_0x37a4('0xec')),{'interaction':_0x4d89df})[_0x37a4('0x2d')](function(_0x5590e3){var _0x450d4e=path['join'](_0x4d276f,_0x37a4('0xed')+_0x37cf2e['id']+'-'+_0x4ceb87+_0x37a4('0xee'));var _0x1b33d1={'path':_0x450d4e,'channel':_0x37a4('0xef'),'interactionId':_0x37cf2e['id']};return pdf[_0x37a4('0xf0')](_0x5590e3,_0x1b33d1);})[_0x37a4('0x2d')](function(){return new BPromise(function(_0x35b8d4,_0x1cdf3c){zipdir(_0x4d276f,{'saveTo':_0x3da3d3},function(_0x2bb2b7,_0x1a890d){if(_0x2bb2b7)return _0x1cdf3c(_0x2bb2b7);return _0x35b8d4(_0x1a890d);});})[_0x37a4('0x2d')](function(){return new BPromise(function(_0x30465c,_0x55718f){rimraf(_0x4d276f,function(_0x5271fc){if(_0x5271fc)_0x55718f(_0x5271fc);return _0x30465c();});});})[_0x37a4('0x2d')](function(){return _0x402981['download'](_0x3da3d3,_0x1b357e,function(_0x4fe262){if(_0x4fe262){console[_0x37a4('0xf1')](_0x37a4('0xf2'),_0x4fe262);}else{fs[_0x37a4('0xf3')](_0x3da3d3);}});});});}else{return _0x402981['sendStatus'](0xc8);}})['catch'](handleError(_0x402981,null));};
\ No newline at end of file
index 3a81f28..1e28d51 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ec2=['unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7ec2,0x15c));var _0x27ec=function(_0x518207,_0x2ae835){_0x518207=_0x518207-0x0;var _0x19856b=_0x7ec2[_0x518207];return _0x19856b;};'use strict';var EventEmitter=require(_0x27ec('0x0'));var WhatsappInteraction=require(_0x27ec('0x1'))['db'][_0x27ec('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0x27ec('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x27ec('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x27ec('0x5'),'afterDestroy':_0x27ec('0x6')};function emitEvent(_0x3e1120){return function(_0x39badf,_0x1c84fd,_0x2f5fcb){_0x39badf[_0x27ec('0x7')]({'attributes':['id'],'raw':!![]})[_0x27ec('0x8')](function(_0x27b57c){_0x39badf[_0x27ec('0x9')](_0x27ec('0xa'),_0x27b57c[_0x27ec('0xb')](function(_0x247954){return{'id':_0x247954['id']};}));return WhatsappMessage[_0x27ec('0xc')]({'where':{'WhatsappInteractionId':_0x39badf['id'],'direction':'in','read':![]},'raw':!![]});})[_0x27ec('0x8')](function(_0x334fea){_0x39badf[_0x27ec('0x9')](_0x27ec('0xd'),_0x334fea[_0x27ec('0xe')]);WhatsappInteractionEvents[_0x27ec('0xf')](_0x3e1120+':'+_0x39badf['id'],_0x39badf);WhatsappInteractionEvents[_0x27ec('0xf')](_0x3e1120,_0x39badf);_0x2f5fcb(null);})['catch'](_0x2f5fcb(null));};}for(var e in events){if(events[_0x27ec('0x10')](e)){var event=events[e];WhatsappInteraction[_0x27ec('0x11')](e,emitEvent(event));}}module[_0x27ec('0x12')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0x98e5=['setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty','exports','../../mysqldb','WhatsappMessage','save','update','then'];(function(_0x1cc598,_0x53bae5){var _0x491d7b=function(_0x95fa84){while(--_0x95fa84){_0x1cc598['push'](_0x1cc598['shift']());}};_0x491d7b(++_0x53bae5);}(_0x98e5,0x8a));var _0x598e=function(_0x3be18d,_0x59246a){_0x3be18d=_0x3be18d-0x0;var _0x516272=_0x98e5[_0x3be18d];return _0x516272;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x598e('0x0'))['db'][_0x598e('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x598e('0x2'),'afterUpdate':_0x598e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3af01f){return function(_0x5a876c,_0x55025c,_0x154755){_0x5a876c['getUsers']({'attributes':['id'],'raw':!![]})[_0x598e('0x4')](function(_0x1fc8b5){_0x5a876c[_0x598e('0x5')](_0x598e('0x6'),_0x1fc8b5[_0x598e('0x7')](function(_0x3e6e86){return{'id':_0x3e6e86['id']};}));return WhatsappMessage[_0x598e('0x8')]({'where':{'WhatsappInteractionId':_0x5a876c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x598e('0x4')](function(_0x2e8f07){_0x5a876c[_0x598e('0x5')](_0x598e('0x9'),_0x2e8f07['length']);WhatsappInteractionEvents[_0x598e('0xa')](_0x3af01f+':'+_0x5a876c['id'],_0x5a876c);WhatsappInteractionEvents[_0x598e('0xa')](_0x3af01f,_0x5a876c);_0x154755(null);})['catch'](_0x154755(null));};}for(var e in events){if(events[_0x598e('0xb')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x598e('0xc')]=WhatsappInteractionEvents;
\ No newline at end of file
index ac91a2c..4b42803 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc84=['rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','closed','closedAt','lodash','../../config/logger','api','request-promise','path'];(function(_0x31bbce,_0x1e54f2){var _0x25b1f0=function(_0x5156c8){while(--_0x5156c8){_0x31bbce['push'](_0x31bbce['shift']());}};_0x25b1f0(++_0x1e54f2);}(_0xdc84,0x1ad));var _0x4dc8=function(_0x17dcd1,_0x3b7ccb){_0x17dcd1=_0x17dcd1-0x0;var _0x12af77=_0xdc84[_0x17dcd1];return _0x12af77;};'use strict';var _=require(_0x4dc8('0x0'));var util=require('util');var logger=require(_0x4dc8('0x1'))(_0x4dc8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4dc8('0x3'));var fs=require('fs');var path=require(_0x4dc8('0x4'));var rimraf=require(_0x4dc8('0x5'));var config=require(_0x4dc8('0x6'));var attributes=require(_0x4dc8('0x7'));module[_0x4dc8('0x8')]=function(_0x2c75c9,_0x28f242){return _0x2c75c9[_0x4dc8('0x9')](_0x4dc8('0xa'),attributes,{'tableName':_0x4dc8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x926f93,_0x3e51af,_0x3aa144){if(_0x926f93['changed'](_0x4dc8('0xc'))){_0x926f93[_0x4dc8('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x3aa144(null,_0x926f93);}}});};
\ No newline at end of file
+var _0x4bcf=['api','bluebird','request-promise','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x1cb690,_0x5592e3){var _0x3bebd4=function(_0x266301){while(--_0x266301){_0x1cb690['push'](_0x1cb690['shift']());}};_0x3bebd4(++_0x5592e3);}(_0x4bcf,0x177));var _0xf4bc=function(_0x310990,_0x245984){_0x310990=_0x310990-0x0;var _0x648534=_0x4bcf[_0x310990];return _0x648534;};'use strict';var _=require(_0xf4bc('0x0'));var util=require(_0xf4bc('0x1'));var logger=require('../../config/logger')(_0xf4bc('0x2'));var moment=require('moment');var BPromise=require(_0xf4bc('0x3'));var rp=require(_0xf4bc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf4bc('0x5'));module[_0xf4bc('0x6')]=function(_0x2c0e88,_0x220411){return _0x2c0e88[_0xf4bc('0x7')](_0xf4bc('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e2159,_0xd1c2f0,_0x241792){if(_0x3e2159[_0xf4bc('0x9')](_0xf4bc('0xa'))){_0x3e2159['closedAt']=moment()[_0xf4bc('0xb')](_0xf4bc('0xc'));}_0x241792(null,_0x3e2159);}}});};
\ No newline at end of file
index c333c74..4d32739 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec66=['../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./whatsappInteraction.socket','register','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','limit','info','catch','AddTagsToWhatsappInteraction','find','ids','omit','spread','AddTags','stringify','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x340737,_0x104f77){var _0x2d1d51=function(_0x3ddfaf){while(--_0x3ddfaf){_0x340737['push'](_0x340737['shift']());}};_0x2d1d51(++_0x104f77);}(_0xec66,0x73));var _0x6ec6=function(_0x36e059,_0x19ee27){_0x36e059=_0x36e059-0x0;var _0x52ee13=_0xec66[_0x36e059];return _0x52ee13;};'use strict';var _=require(_0x6ec6('0x0'));var util=require(_0x6ec6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6ec6('0x2'));var fs=require('fs');var Redis=require(_0x6ec6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6ec6('0x4'))('rpc');var config=require(_0x6ec6('0x5'));var jayson=require(_0x6ec6('0x6'));var client=jayson[_0x6ec6('0x7')][_0x6ec6('0x8')]({'port':0x232a});config[_0x6ec6('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6ec6('0xa'))(new Redis(config[_0x6ec6('0x9')]));require(_0x6ec6('0xb'))[_0x6ec6('0xc')](socket);function respondWithRpcPromise(_0x47a4a3,_0x257293,_0x5604aa){return new BPromise(function(_0x4f84d7,_0x23f9d4){return client[_0x6ec6('0xd')](_0x47a4a3,_0x5604aa)[_0x6ec6('0xe')](function(_0x36c058){logger['info'](_0x6ec6('0xf'),_0x257293,_0x6ec6('0x10'));logger[_0x6ec6('0x11')](_0x6ec6('0x12'),_0x257293,_0x6ec6('0x10'),JSON['stringify'](_0x36c058));if(_0x36c058[_0x6ec6('0x13')]){if(_0x36c058['error'][_0x6ec6('0x14')]===0x1f4){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x257293,_0x36c058[_0x6ec6('0x13')][_0x6ec6('0x15')]);return _0x23f9d4(_0x36c058[_0x6ec6('0x13')]['message']);}logger[_0x6ec6('0x13')](_0x6ec6('0xf'),_0x257293,_0x36c058[_0x6ec6('0x13')][_0x6ec6('0x15')]);return _0x4f84d7(_0x36c058[_0x6ec6('0x13')][_0x6ec6('0x15')]);}else{logger['info'](_0x6ec6('0xf'),_0x257293,_0x6ec6('0x10'));_0x4f84d7(_0x36c058[_0x6ec6('0x16')]['message']);}})['catch'](function(_0x1ca3d6){logger[_0x6ec6('0x13')](_0x6ec6('0xf'),_0x257293,_0x1ca3d6);_0x23f9d4(_0x1ca3d6);});});}exports[_0x6ec6('0x17')]=function(_0x4a908f){var _0x344137=this;return new Promise(function(_0xa04dfe,_0x52fd0b){return db[_0x6ec6('0x18')][_0x6ec6('0x19')](_0x4a908f[_0x6ec6('0x1a')],{'raw':_0x4a908f[_0x6ec6('0x1b')]?_0x4a908f[_0x6ec6('0x1b')][_0x6ec6('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a908f[_0x6ec6('0x1b')]?_0x4a908f['options'][_0x6ec6('0x1d')]||null:null,'attributes':_0x4a908f[_0x6ec6('0x1b')]?_0x4a908f[_0x6ec6('0x1b')]['attributes']||null:null,'limit':_0x4a908f[_0x6ec6('0x1b')]?_0x4a908f['options'][_0x6ec6('0x1e')]||null:null})[_0x6ec6('0xe')](function(_0x128a60){logger[_0x6ec6('0x1f')](_0x6ec6('0x17'),_0x4a908f);logger[_0x6ec6('0x11')](_0x6ec6('0x17'),_0x4a908f,JSON['stringify'](_0x128a60));_0xa04dfe(_0x128a60);})[_0x6ec6('0x20')](function(_0x4adaea){logger[_0x6ec6('0x13')](_0x6ec6('0x17'),_0x4adaea[_0x6ec6('0x15')],_0x4a908f);_0x52fd0b(_0x344137[_0x6ec6('0x13')](0x1f4,_0x4adaea[_0x6ec6('0x15')]));});});};exports[_0x6ec6('0x21')]=function(_0x22b6fd){return new Promise(function(_0x1a2b0b,_0x4d3204){return db[_0x6ec6('0x18')][_0x6ec6('0x22')]({'where':_0x22b6fd['options']?_0x22b6fd[_0x6ec6('0x1b')][_0x6ec6('0x1d')]||null:null})['then'](function(_0x18d4e0){if(_0x18d4e0){return _0x18d4e0['addTags'](_0x22b6fd[_0x6ec6('0x1a')][_0x6ec6('0x23')],_[_0x6ec6('0x24')](_0x22b6fd[_0x6ec6('0x1a')],[_0x6ec6('0x23'),'id'])||{});}})[_0x6ec6('0x25')](function(_0x2f3f35){logger[_0x6ec6('0x1f')](_0x6ec6('0x26'),_0x22b6fd);logger[_0x6ec6('0x11')](_0x6ec6('0x26'),_0x22b6fd,JSON[_0x6ec6('0x27')](_0x2f3f35));_0x1a2b0b(_0x2f3f35);})[_0x6ec6('0x20')](function(_0x41f0a7){logger['error'](_0x6ec6('0x26'),_0x41f0a7['message'],_0x22b6fd);_0x4d3204(_this[_0x6ec6('0x13')](0x1f4,_0x41f0a7[_0x6ec6('0x15')]));});});};
\ No newline at end of file
+var _0xadb4=['code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','attributes','debug','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','defaults','redis','register','request','then','info','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x825ea9,_0x56c3ea){var _0x4282a8=function(_0x9dd4e2){while(--_0x9dd4e2){_0x825ea9['push'](_0x825ea9['shift']());}};_0x4282a8(++_0x56c3ea);}(_0xadb4,0xdb));var _0x4adb=function(_0x1d3d54,_0x284f48){_0x1d3d54=_0x1d3d54-0x0;var _0x12be4a=_0xadb4[_0x1d3d54];return _0x12be4a;};'use strict';var _=require(_0x4adb('0x0'));var util=require(_0x4adb('0x1'));var moment=require(_0x4adb('0x2'));var BPromise=require(_0x4adb('0x3'));var rs=require(_0x4adb('0x4'));var fs=require('fs');var Redis=require(_0x4adb('0x5'));var db=require(_0x4adb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4adb('0x7'))(_0x4adb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4adb('0x9')][_0x4adb('0xa')]({'port':0x232a});config['redis']=_[_0x4adb('0xb')](config[_0x4adb('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4adb('0xc')]));require('./whatsappInteraction.socket')[_0x4adb('0xd')](socket);function respondWithRpcPromise(_0x5df0e4,_0x40a6ce,_0x463b58){return new BPromise(function(_0x2b6e70,_0x46af87){return client[_0x4adb('0xe')](_0x5df0e4,_0x463b58)[_0x4adb('0xf')](function(_0x493d25){logger[_0x4adb('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x40a6ce,_0x4adb('0x11'));logger['debug'](_0x4adb('0x12'),_0x40a6ce,'request\x20sent',JSON[_0x4adb('0x13')](_0x493d25));if(_0x493d25['error']){if(_0x493d25[_0x4adb('0x14')][_0x4adb('0x15')]===0x1f4){logger['error'](_0x4adb('0x16'),_0x40a6ce,_0x493d25[_0x4adb('0x14')]['message']);return _0x46af87(_0x493d25['error'][_0x4adb('0x17')]);}logger[_0x4adb('0x14')](_0x4adb('0x16'),_0x40a6ce,_0x493d25[_0x4adb('0x14')][_0x4adb('0x17')]);return _0x2b6e70(_0x493d25[_0x4adb('0x14')][_0x4adb('0x17')]);}else{logger[_0x4adb('0x10')](_0x4adb('0x16'),_0x40a6ce,'request\x20sent');_0x2b6e70(_0x493d25[_0x4adb('0x18')]['message']);}})[_0x4adb('0x19')](function(_0x1d992a){logger[_0x4adb('0x14')](_0x4adb('0x16'),_0x40a6ce,_0x1d992a);_0x46af87(_0x1d992a);});});}exports[_0x4adb('0x1a')]=function(_0x6dcbe6){var _0x2fd204=this;return new Promise(function(_0xfba5fc,_0x1b1c03){return db[_0x4adb('0x1b')]['update'](_0x6dcbe6[_0x4adb('0x1c')],{'raw':_0x6dcbe6[_0x4adb('0x1d')]?_0x6dcbe6[_0x4adb('0x1d')][_0x4adb('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x6dcbe6[_0x4adb('0x1d')]?_0x6dcbe6[_0x4adb('0x1d')]['where']||null:null,'attributes':_0x6dcbe6[_0x4adb('0x1d')]?_0x6dcbe6[_0x4adb('0x1d')][_0x4adb('0x1f')]||null:null,'limit':_0x6dcbe6[_0x4adb('0x1d')]?_0x6dcbe6[_0x4adb('0x1d')]['limit']||null:null})['then'](function(_0x1c58d5){logger['info']('UpdateWhatsappInteraction',_0x6dcbe6);logger[_0x4adb('0x20')](_0x4adb('0x1a'),_0x6dcbe6,JSON[_0x4adb('0x13')](_0x1c58d5));_0xfba5fc(_0x1c58d5);})[_0x4adb('0x19')](function(_0x3adfd1){logger['error']('UpdateWhatsappInteraction',_0x3adfd1['message'],_0x6dcbe6);_0x1b1c03(_0x2fd204[_0x4adb('0x14')](0x1f4,_0x3adfd1['message']));});});};exports[_0x4adb('0x21')]=function(_0x14c8cd){return new Promise(function(_0x4f7c65,_0x4ccad7){return db[_0x4adb('0x1b')][_0x4adb('0x22')]({'where':_0x14c8cd[_0x4adb('0x1d')]?_0x14c8cd['options']['where']||null:null})[_0x4adb('0xf')](function(_0x568a27){if(_0x568a27){return _0x568a27[_0x4adb('0x23')](_0x14c8cd[_0x4adb('0x1c')][_0x4adb('0x24')],_[_0x4adb('0x25')](_0x14c8cd[_0x4adb('0x1c')],[_0x4adb('0x24'),'id'])||{});}})[_0x4adb('0x26')](function(_0x450b6f){logger[_0x4adb('0x10')](_0x4adb('0x27'),_0x14c8cd);logger[_0x4adb('0x20')](_0x4adb('0x27'),_0x14c8cd,JSON[_0x4adb('0x13')](_0x450b6f));_0x4f7c65(_0x450b6f);})['catch'](function(_0x4aace7){logger['error']('AddTags',_0x4aace7[_0x4adb('0x17')],_0x14c8cd);_0x4ccad7(_this[_0x4adb('0x14')](0x1f4,_0x4aace7[_0x4adb('0x17')]));});});};
\ No newline at end of file
index 1e00e73..f457f2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd694=['./whatsappInteraction.events','remove','update','emit','removeListener','length','whatsappInteraction:'];(function(_0x5a09bd,_0x2dbc79){var _0x34de95=function(_0x48081b){while(--_0x48081b){_0x5a09bd['push'](_0x5a09bd['shift']());}};_0x34de95(++_0x2dbc79);}(_0xd694,0x1ea));var _0x4d69=function(_0x305d69,_0x3bbf4c){_0x305d69=_0x305d69-0x0;var _0x3fcfc4=_0xd694[_0x305d69];return _0x3fcfc4;};'use strict';var WhatsappInteractionEvents=require(_0x4d69('0x0'));var events=['save',_0x4d69('0x1'),_0x4d69('0x2')];function createListener(_0x23c6a6,_0x2f59d6){return function(_0xe10818){_0x2f59d6[_0x4d69('0x3')](_0x23c6a6,_0xe10818);};}function removeListener(_0x53412f,_0x3354b4){return function(){WhatsappInteractionEvents[_0x4d69('0x4')](_0x53412f,_0x3354b4);};}exports['register']=function(_0x5c76ba){for(var _0x77764d=0x0,_0x4be967=events[_0x4d69('0x5')];_0x77764d<_0x4be967;_0x77764d++){var _0x337b2d=events[_0x77764d];var _0x18c3b7=createListener(_0x4d69('0x6')+_0x337b2d,_0x5c76ba);WhatsappInteractionEvents['on'](_0x337b2d,_0x18c3b7);}};
\ No newline at end of file
+var _0x96e4=['save','remove','update','emit','register','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x4640dd,_0x26f32a){var _0x5569aa=function(_0x133545){while(--_0x133545){_0x4640dd['push'](_0x4640dd['shift']());}};_0x5569aa(++_0x26f32a);}(_0x96e4,0x6f));var _0x496e=function(_0x470e67,_0x4a596d){_0x470e67=_0x470e67-0x0;var _0x28bbde=_0x96e4[_0x470e67];return _0x28bbde;};'use strict';var WhatsappInteractionEvents=require(_0x496e('0x0'));var events=[_0x496e('0x1'),_0x496e('0x2'),_0x496e('0x3')];function createListener(_0x2b5225,_0x51786b){return function(_0x4351db){_0x51786b[_0x496e('0x4')](_0x2b5225,_0x4351db);};}function removeListener(_0x3b50ef,_0x5821fa){return function(){WhatsappInteractionEvents['removeListener'](_0x3b50ef,_0x5821fa);};}exports[_0x496e('0x5')]=function(_0x358a57){for(var _0x5934f9=0x0,_0xf5dac6=events['length'];_0x5934f9<_0xf5dac6;_0x5934f9++){var _0x48a7c0=events[_0x5934f9];var _0x46afb5=createListener(_0x496e('0x6')+_0x48a7c0,_0x358a57);WhatsappInteractionEvents['on'](_0x48a7c0,_0x46afb5);}};
\ No newline at end of file
index bf648e5..0299d07 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc8=['/:id/status','status','put','/:id/accept','accept','/:id/reject','reject','delete','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','create'];(function(_0xeed188,_0x46c688){var _0x1970fc=function(_0x1b74d9){while(--_0x1b74d9){_0xeed188['push'](_0xeed188['shift']());}};_0x1970fc(++_0x46c688);}(_0x5fc8,0x1bb));var _0x85fc=function(_0x58ceaa,_0x53d5e3){_0x58ceaa=_0x58ceaa-0x0;var _0x5d1a27=_0x5fc8[_0x58ceaa];return _0x5d1a27;};'use strict';var multer=require(_0x85fc('0x0'));var util=require(_0x85fc('0x1'));var path=require(_0x85fc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x85fc('0x3')]();var fs_extra=require(_0x85fc('0x4'));var auth=require(_0x85fc('0x5'));var interaction=require(_0x85fc('0x6'));var config=require(_0x85fc('0x7'));var controller=require(_0x85fc('0x8'));router[_0x85fc('0x9')]('/',auth[_0x85fc('0xa')](),controller[_0x85fc('0xb')]);router[_0x85fc('0x9')](_0x85fc('0xc'),auth['isAuthenticated'](),controller[_0x85fc('0xd')]);router[_0x85fc('0x9')](_0x85fc('0xe'),auth[_0x85fc('0xa')](),controller[_0x85fc('0xf')]);router[_0x85fc('0x10')]('/',auth[_0x85fc('0xa')](),interaction[_0x85fc('0x11')](_0x85fc('0x12'),_0x85fc('0x13')),controller[_0x85fc('0x14')]);router[_0x85fc('0x10')](_0x85fc('0x15'),controller[_0x85fc('0x16')]);router['put'](_0x85fc('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x85fc('0x17')](_0x85fc('0x18'),auth[_0x85fc('0xa')](),controller[_0x85fc('0x19')]);router['put'](_0x85fc('0x1a'),auth['isAuthenticated'](),controller[_0x85fc('0x1b')]);router[_0x85fc('0x1c')](_0x85fc('0xe'),auth[_0x85fc('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x057e=['exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappMessage.controller','isAuthenticated','index','get','describe','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','update','put','/:id/accept','accept','reject','delete'];(function(_0xfc27dd,_0x4f0e7e){var _0x110ef3=function(_0x4a7ca1){while(--_0x4a7ca1){_0xfc27dd['push'](_0xfc27dd['shift']());}};_0x110ef3(++_0x4f0e7e);}(_0x057e,0x1aa));var _0xe057=function(_0x767333,_0x4ceb6b){_0x767333=_0x767333-0x0;var _0x2263ac=_0x057e[_0x767333];return _0x2263ac;};'use strict';var multer=require(_0xe057('0x0'));var util=require(_0xe057('0x1'));var path=require('path');var timeout=require(_0xe057('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe057('0x3'));var auth=require(_0xe057('0x4'));var interaction=require(_0xe057('0x5'));var config=require('../../config/environment');var controller=require(_0xe057('0x6'));router['get']('/',auth[_0xe057('0x7')](),controller[_0xe057('0x8')]);router[_0xe057('0x9')]('/describe',auth[_0xe057('0x7')](),controller[_0xe057('0xa')]);router[_0xe057('0x9')]('/:id',auth[_0xe057('0x7')](),controller['show']);router[_0xe057('0xb')]('/',auth['isAuthenticated'](),interaction[_0xe057('0xc')](_0xe057('0xd'),_0xe057('0xe')),controller[_0xe057('0xf')]);router['post'](_0xe057('0x10'),controller[_0xe057('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe057('0x12')]);router[_0xe057('0x13')](_0xe057('0x14'),auth[_0xe057('0x7')](),controller[_0xe057('0x15')]);router[_0xe057('0x13')]('/:id/reject',auth['isAuthenticated'](),controller[_0xe057('0x16')]);router[_0xe057('0x17')]('/:id',auth[_0xe057('0x7')](),controller['destroy']);module[_0xe057('0x18')]=router;
\ No newline at end of file
index 694b41f..164905f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa2f3=['BOOLEAN','out','STRING','exports','medium'];(function(_0x23031e,_0x134916){var _0x5d7b0c=function(_0x4053be){while(--_0x4053be){_0x23031e['push'](_0x23031e['shift']());}};_0x5d7b0c(++_0x134916);}(_0xa2f3,0x76));var _0x3a2f=function(_0xfcc017,_0x6d40e){_0xfcc017=_0xfcc017-0x0;var _0x577619=_0xa2f3[_0xfcc017];return _0x577619;};'use strict';var Sequelize=require('sequelize');module[_0x3a2f('0x0')]={'body':{'type':Sequelize['TEXT'](_0x3a2f('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3a2f('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3a2f('0x3')),'defaultValue':_0x3a2f('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3a2f('0x4')](0xbe)},'phone':{'type':Sequelize[_0x3a2f('0x4')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x3a2f('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3a2f('0x4')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x4913=['STRING','DATE','exports','TEXT','BOOLEAN','ENUM'];(function(_0x4b9111,_0x2f1ba1){var _0x1cde79=function(_0x43f96e){while(--_0x43f96e){_0x4b9111['push'](_0x4b9111['shift']());}};_0x1cde79(++_0x2f1ba1);}(_0x4913,0x170));var _0x3491=function(_0x2088ac,_0x2886ba){_0x2088ac=_0x2088ac-0x0;var _0x50b6a4=_0x4913[_0x2088ac];return _0x50b6a4;};'use strict';var Sequelize=require('sequelize');module[_0x3491('0x0')]={'body':{'type':Sequelize[_0x3491('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x3491('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3491('0x3')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x3491('0x4')](0xbe)},'phone':{'type':Sequelize[_0x3491('0x4')]},'readAt':{'type':Sequelize[_0x3491('0x5')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index b9df1af..0f2bc7e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x095b=['limit','count','apply','reject','save','stack','send','index','map','WhatsappMessage','rawAttributes','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','merge','find','create','body','update','describe','whatsapp-interactions','accept','whatsapp','read','readAt','user','agent','get','WhatsappInteraction','WhatsappInteractionId','UserId','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','manual','interface','channel','event','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','ContactId','contact','User','internal','SIP/%s','rejectmessage','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined'];(function(_0x2b10d9,_0x2582b7){var _0x15ce1e=function(_0xa71883){while(--_0xa71883){_0x2b10d9['push'](_0x2b10d9['shift']());}};_0x15ce1e(++_0x2582b7);}(_0x095b,0x17c));var _0xb095=function(_0x244d4d,_0x2c8f6b){_0x244d4d=_0x244d4d-0x0;var _0x5b8ff3=_0x095b[_0x244d4d];return _0x5b8ff3;};'use strict';var emlformat=require(_0xb095('0x0'));var rimraf=require(_0xb095('0x1'));var zipdir=require(_0xb095('0x2'));var jsonpatch=require(_0xb095('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb095('0x4'));var Mustache=require(_0xb095('0x5'));var util=require(_0xb095('0x6'));var path=require(_0xb095('0x7'));var sox=require(_0xb095('0x8'));var csv=require(_0xb095('0x9'));var ejs=require(_0xb095('0xa'));var fs=require('fs');var fs_extra=require(_0xb095('0xb'));var _=require('lodash');var squel=require(_0xb095('0xc'));var crypto=require(_0xb095('0xd'));var jsforce=require(_0xb095('0xe'));var deskjs=require(_0xb095('0xf'));var toCsv=require(_0xb095('0x9'));var querystring=require(_0xb095('0x10'));var Papa=require(_0xb095('0x11'));var Redis=require(_0xb095('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb095('0x13'));var as=require(_0xb095('0x14'));var hardwareService=require(_0xb095('0x15'));var logger=require(_0xb095('0x16'))('api');var utils=require(_0xb095('0x17'));var config=require(_0xb095('0x18'));var licenseUtil=require(_0xb095('0x19'));var db=require(_0xb095('0x1a'))['db'];config[_0xb095('0x1b')]=_[_0xb095('0x1c')](config[_0xb095('0x1b')],{'host':_0xb095('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb095('0x1b')]));require(_0xb095('0x1e'))[_0xb095('0x1f')](socket);var jayson=require(_0xb095('0x20'));var client=jayson[_0xb095('0x21')][_0xb095('0x22')]({'port':0x232c});var client9002=jayson[_0xb095('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7a641e,_0x1f73a4,_0x4e0f7a,_0x1eb3bd){return new BPromise(function(_0x57c0c1,_0x15922e){var _0x1b3726=_0x1eb3bd||client;return _0x1b3726['request'](_0x7a641e,_0x4e0f7a)[_0xb095('0x23')](function(_0x35c43e){logger[_0xb095('0x24')](_0xb095('0x25'),_0x1f73a4,_0xb095('0x26'));logger['debug'](_0xb095('0x27'),_0x1f73a4,_0xb095('0x26'),JSON[_0xb095('0x28')](_0x35c43e));if(_0x35c43e[_0xb095('0x29')]){if(_0x35c43e[_0xb095('0x29')][_0xb095('0x2a')]===0x1f4){logger[_0xb095('0x29')](_0xb095('0x25'),_0x1f73a4,_0x35c43e['error'][_0xb095('0x2b')]);return _0x15922e(_0x35c43e[_0xb095('0x29')][_0xb095('0x2b')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x1f73a4,_0x35c43e[_0xb095('0x29')]['message']);return _0x57c0c1(_0x35c43e['error'][_0xb095('0x2b')]);}else{logger[_0xb095('0x24')]('WhatsappMessage,\x20%s,\x20%s',_0x1f73a4,_0xb095('0x26'));_0x57c0c1(_0x35c43e[_0xb095('0x2c')][_0xb095('0x2b')]);}})[_0xb095('0x2d')](function(_0x5a5624){logger[_0xb095('0x29')](_0xb095('0x25'),_0x1f73a4,_0x5a5624);_0x15922e(_0x5a5624);});});}function respondWithStatusCode(_0x2ec9c5,_0x671e51){_0x671e51=_0x671e51||0xcc;return function(_0x243bab){if(_0x243bab){return _0x2ec9c5[_0xb095('0x2e')](_0x671e51);}return _0x2ec9c5['status'](_0x671e51)[_0xb095('0x2f')]();};}function respondWithResult(_0x237be7,_0x2e4a2a){_0x2e4a2a=_0x2e4a2a||0xc8;return function(_0x3122e0){if(_0x3122e0){return _0x237be7[_0xb095('0x30')](_0x2e4a2a)[_0xb095('0x31')](_0x3122e0);}};}function respondWithFilteredResult(_0x19065f,_0xb54e84){return function(_0x111330){if(_0x111330){var _0x33aff3=typeof _0xb54e84[_0xb095('0x32')]===_0xb095('0x33')&&typeof _0xb54e84[_0xb095('0x34')]==='undefined';var _0x57aaa6=_0x111330[_0xb095('0x35')];var _0x231a6e=_0x33aff3?0x0:_0xb54e84['offset'];var _0x362d57=_0x33aff3?_0x111330[_0xb095('0x35')]:_0xb54e84['offset']+_0xb54e84[_0xb095('0x34')];var _0xe5fb31;if(_0x362d57>=_0x57aaa6){_0x362d57=_0x57aaa6;_0xe5fb31=0xc8;}else{_0xe5fb31=0xce;}_0x19065f[_0xb095('0x30')](_0xe5fb31);return _0x19065f['set']('Content-Range',_0x231a6e+'-'+_0x362d57+'/'+_0x57aaa6)[_0xb095('0x31')](_0x111330);}return null;};}function patchUpdates(_0x266e79){return function(_0x2a7ac6){try{jsonpatch[_0xb095('0x36')](_0x2a7ac6,_0x266e79,!![]);}catch(_0x33a7ff){return BPromise[_0xb095('0x37')](_0x33a7ff);}return _0x2a7ac6[_0xb095('0x38')]();};}function saveUpdates(_0x26853a,_0x217f05){return function(_0x4a9e02){if(_0x4a9e02){return _0x4a9e02['update'](_0x26853a)[_0xb095('0x23')](function(_0x2dbbd0){return _0x2dbbd0;});}return null;};}function removeEntity(_0x44a6f8,_0x3f3f83){return function(_0x53d6da){if(_0x53d6da){return _0x53d6da['destroy']()[_0xb095('0x23')](function(){_0x44a6f8['status'](0xcc)[_0xb095('0x2f')]();});}};}function handleEntityNotFound(_0x509135,_0x23f944){return function(_0x482a26){if(!_0x482a26){_0x509135[_0xb095('0x2e')](0x194);}return _0x482a26;};}function handleError(_0x490044,_0x154992){_0x154992=_0x154992||0x1f4;return function(_0x8f7967){logger['error'](_0x8f7967[_0xb095('0x39')]);if(_0x8f7967['name']){delete _0x8f7967['name'];}_0x490044[_0xb095('0x30')](_0x154992)[_0xb095('0x3a')](_0x8f7967);};}exports[_0xb095('0x3b')]=function(_0x1b4295,_0x34a5a7){var _0x4fb74d={},_0x57be34={},_0x162e0b={'count':0x0,'rows':[]};var _0x15b810=_[_0xb095('0x3c')](db[_0xb095('0x3d')][_0xb095('0x3e')],function(_0x1a4cf5){return{'name':_0x1a4cf5['fieldName'],'type':_0x1a4cf5['type'][_0xb095('0x3f')]};});_0x57be34['model']=_[_0xb095('0x3c')](_0x15b810,_0xb095('0x40'));_0x57be34[_0xb095('0x41')]=_['keys'](_0x1b4295['query']);_0x57be34[_0xb095('0x42')]=_[_0xb095('0x43')](_0x57be34[_0xb095('0x44')],_0x57be34[_0xb095('0x41')]);_0x4fb74d[_0xb095('0x45')]=_['intersection'](_0x57be34['model'],qs['fields'](_0x1b4295[_0xb095('0x41')][_0xb095('0x46')]));_0x4fb74d[_0xb095('0x45')]=_0x4fb74d['attributes'][_0xb095('0x47')]?_0x4fb74d[_0xb095('0x45')]:_0x57be34[_0xb095('0x44')];if(!_0x1b4295[_0xb095('0x41')][_0xb095('0x48')](_0xb095('0x49'))){_0x4fb74d[_0xb095('0x34')]=qs[_0xb095('0x34')](_0x1b4295[_0xb095('0x41')][_0xb095('0x34')]);_0x4fb74d[_0xb095('0x32')]=qs[_0xb095('0x32')](_0x1b4295[_0xb095('0x41')][_0xb095('0x32')]);}_0x4fb74d[_0xb095('0x4a')]=qs[_0xb095('0x4b')](_0x1b4295[_0xb095('0x41')][_0xb095('0x4b')]);_0x4fb74d[_0xb095('0x4c')]=qs['filters'](_[_0xb095('0x4d')](_0x1b4295['query'],_0x57be34[_0xb095('0x42')]),_0x15b810);if(_0x1b4295['query'][_0xb095('0x4e')]){_0x4fb74d[_0xb095('0x4c')]=_['merge'](_0x4fb74d[_0xb095('0x4c')],{'$or':_['map'](_0x15b810,function(_0x5158d1){if(_0x5158d1[_0xb095('0x4f')]!==_0xb095('0x50')){var _0x27328c={};_0x27328c[_0x5158d1['name']]={'$like':'%'+_0x1b4295[_0xb095('0x41')][_0xb095('0x4e')]+'%'};return _0x27328c;}})});}_0x4fb74d=_['merge']({},_0x4fb74d,_0x1b4295[_0xb095('0x51')]);var _0x400d1e={'where':_0x4fb74d['where']};return db['WhatsappMessage'][_0xb095('0x35')](_0x400d1e)[_0xb095('0x23')](function(_0x2adce2){_0x162e0b[_0xb095('0x35')]=_0x2adce2;if(_0x1b4295[_0xb095('0x41')][_0xb095('0x52')]){_0x4fb74d['include']=[{'all':!![]}];}return db[_0xb095('0x3d')][_0xb095('0x53')](_0x4fb74d);})[_0xb095('0x23')](function(_0x730aea){_0x162e0b[_0xb095('0x54')]=_0x730aea;return _0x162e0b;})[_0xb095('0x23')](respondWithFilteredResult(_0x34a5a7,_0x4fb74d))[_0xb095('0x2d')](handleError(_0x34a5a7,null));};exports[_0xb095('0x55')]=function(_0x347ff4,_0x1dbcb7){var _0xf1db59={'raw':!![],'where':{'id':_0x347ff4[_0xb095('0x56')]['id']}},_0x5cc4dc={};_0x5cc4dc[_0xb095('0x44')]=_[_0xb095('0x57')](db[_0xb095('0x3d')][_0xb095('0x3e')]);_0x5cc4dc[_0xb095('0x41')]=_['keys'](_0x347ff4[_0xb095('0x41')]);_0x5cc4dc[_0xb095('0x42')]=_[_0xb095('0x43')](_0x5cc4dc['model'],_0x5cc4dc[_0xb095('0x41')]);_0xf1db59['attributes']=_[_0xb095('0x43')](_0x5cc4dc['model'],qs[_0xb095('0x46')](_0x347ff4['query'][_0xb095('0x46')]));_0xf1db59['attributes']=_0xf1db59[_0xb095('0x45')][_0xb095('0x47')]?_0xf1db59[_0xb095('0x45')]:_0x5cc4dc[_0xb095('0x44')];if(_0x347ff4['query'][_0xb095('0x52')]){_0xf1db59[_0xb095('0x58')]=[{'all':!![]}];}_0xf1db59=_[_0xb095('0x59')]({},_0xf1db59,_0x347ff4[_0xb095('0x51')]);return db[_0xb095('0x3d')][_0xb095('0x5a')](_0xf1db59)[_0xb095('0x23')](handleEntityNotFound(_0x1dbcb7,null))[_0xb095('0x23')](respondWithResult(_0x1dbcb7,null))['catch'](handleError(_0x1dbcb7,null));};exports[_0xb095('0x5b')]=function(_0x4ddced,_0x47f95c){return db[_0xb095('0x3d')][_0xb095('0x5b')](_0x4ddced[_0xb095('0x5c')],{})[_0xb095('0x23')](respondWithResult(_0x47f95c,0xc9))['catch'](handleError(_0x47f95c,null));};exports[_0xb095('0x5d')]=function(_0x161643,_0x17ce27){if(_0x161643[_0xb095('0x5c')]['id']){delete _0x161643[_0xb095('0x5c')]['id'];}return db[_0xb095('0x3d')][_0xb095('0x5a')]({'where':{'id':_0x161643['params']['id']}})[_0xb095('0x23')](handleEntityNotFound(_0x17ce27,null))[_0xb095('0x23')](saveUpdates(_0x161643[_0xb095('0x5c')],null))[_0xb095('0x23')](respondWithResult(_0x17ce27,null))['catch'](handleError(_0x17ce27,null));};exports['destroy']=function(_0x25056e,_0x37eab9){return db[_0xb095('0x3d')]['find']({'where':{'id':_0x25056e[_0xb095('0x56')]['id']}})[_0xb095('0x23')](handleEntityNotFound(_0x37eab9,null))[_0xb095('0x23')](removeEntity(_0x37eab9,null))[_0xb095('0x2d')](handleError(_0x37eab9,null));};exports['describe']=function(_0x55bfcd,_0x3a897b){return db[_0xb095('0x3d')][_0xb095('0x5e')]()[_0xb095('0x23')](respondWithResult(_0x3a897b,null))[_0xb095('0x2d')](handleError(_0x3a897b,null));};var interaction_log=require('../../config/logger')(_0xb095('0x5f'));exports[_0xb095('0x60')]=function(_0x4573d2,_0x3e6102,_0x5a6313){var _0x4ff7b9={'agent':{},'channel':_0xb095('0x61')};if(_0x4573d2[_0xb095('0x5c')]['id']){delete _0x4573d2['body']['id'];}_0x4573d2[_0xb095('0x5c')][_0xb095('0x62')]=!![];_0x4573d2['body'][_0xb095('0x63')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4573d2[_0xb095('0x5c')]['UserId']=_0x4573d2[_0xb095('0x5c')]['UserId']||_0x4573d2[_0xb095('0x64')]['id'];_0x4ff7b9[_0xb095('0x65')]['id']=_0x4573d2[_0xb095('0x5c')]['UserId'];return db[_0xb095('0x3d')][_0xb095('0x5a')]({'where':{'id':_0x4573d2['params']['id'],'UserId':null}})[_0xb095('0x23')](handleEntityNotFound(_0x3e6102,null))['then'](saveUpdates(_0x4573d2[_0xb095('0x5c')],null))[_0xb095('0x23')](function(_0x194e23){if(_0x194e23){_0x4ff7b9[_0xb095('0x2b')]=_0x194e23[_0xb095('0x66')]({'plain':!![]});return db[_0xb095('0x67')][_0xb095('0x5a')]({'where':{'id':_0x194e23[_0xb095('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x3e6102,null))[_0xb095('0x23')](function(_0x2f1345){if(_0x2f1345){return _0x2f1345[_0xb095('0x5d')]({'UserId':_0x4573d2[_0xb095('0x5c')][_0xb095('0x69')],'read1stAt':_[_0xb095('0x6a')](_0x2f1345[_0xb095('0x6b')])?moment()[_0xb095('0x6c')](_0xb095('0x6d')):undefined});}return null;})['then'](function(_0x4a27d6){if(_0x4a27d6){_0x4ff7b9[_0xb095('0x6e')]=_0x4a27d6[_0xb095('0x66')]({'plain':!![]});interaction_log[_0xb095('0x24')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4573d2['user']['id'],_0x4573d2[_0xb095('0x64')][_0xb095('0x40')],_0x4573d2[_0xb095('0x64')][_0xb095('0x6f')],_0x4ff7b9['interaction']['id'],_0x4573d2[_0xb095('0x5c')]?JSON[_0xb095('0x28')](_0x4573d2[_0xb095('0x5c')]):_0xb095('0x70'));return respondWithRpcPromise('AcceptMessage',_0xb095('0x71'),_0x4ff7b9);}return null;})[_0xb095('0x23')](function(_0x50134f){var _0x458743=_0xb095('0x72')+_0x50134f[_0xb095('0x2b')]['ContactId'];return db[_0xb095('0x73')][_0xb095('0x41')](_0x458743,{'type':db[_0xb095('0x74')][_0xb095('0x75')][_0xb095('0x76')],'raw':!![]})[_0xb095('0x23')](function(_0x4dddc9){return _0x4dddc9;});})[_0xb095('0x23')](function(_0x576752){if(_0x576752){_0x4ff7b9['message']['contact']=_0x576752[0x0];if(!_0x4573d2[_0xb095('0x5c')][_0xb095('0x69')])return;return db['User'][_0xb095('0x5a')]({'where':{'id':_0x4573d2[_0xb095('0x5c')][_0xb095('0x69')],'role':_0xb095('0x65')},'attributes':['id',_0xb095('0x40'),_0xb095('0x77'),_0xb095('0x78'),'internal'],'raw':!![]});}return null;})[_0xb095('0x23')](function(_0x3f262e){if(!_0x3f262e)return null;_0x4ff7b9[_0xb095('0x2b')]['agent']=_0x3f262e;return _0x4ff7b9;})[_0xb095('0x23')](function(_0x4e2bf5){if(_0x4e2bf5){if(_0x4573d2[_0xb095('0x5c')][_0xb095('0x79')]){_0x4ff7b9['message'][_0xb095('0x7a')]=util[_0xb095('0x6c')]('SIP/%s',_0x4573d2['user']['name']);_0x4ff7b9[_0xb095('0x2b')]['channel']=_0x4ff7b9[_0xb095('0x7b')];_0x4ff7b9['message'][_0xb095('0x7c')]=_0xb095('0x60');return respondWithRpcPromise(_0xb095('0x7d'),_0xb095('0x7d'),{'event':'acceptmessage','message':_0x4ff7b9['message']},client9002)['then'](function(){return _0x4ff7b9;});}return _0x4ff7b9;}return null;})[_0xb095('0x23')](respondWithResult(_0x3e6102,null))[_0xb095('0x2d')](handleError(_0x3e6102,null));};var interaction_log=require(_0xb095('0x16'))(_0xb095('0x5f'));exports[_0xb095('0x37')]=function(_0x597cad,_0x1f9736,_0xe458ed){var _0x22b5c8={'agent':{},'channel':_0xb095('0x61')};if(_0x597cad[_0xb095('0x5c')]['id']){delete _0x597cad[_0xb095('0x5c')]['id'];}_0x597cad[_0xb095('0x5c')][_0xb095('0x69')]=_0x597cad[_0xb095('0x5c')][_0xb095('0x69')]||_0x597cad[_0xb095('0x64')]['id'];_0x22b5c8['agent']['id']=_0x597cad[_0xb095('0x5c')][_0xb095('0x69')];return db[_0xb095('0x3d')][_0xb095('0x5a')]({'where':{'id':_0x597cad[_0xb095('0x56')]['id'],'UserId':null}})[_0xb095('0x23')](handleEntityNotFound(_0x1f9736,null))[_0xb095('0x23')](function(_0x747599){if(_0x747599){_0x22b5c8[_0xb095('0x2b')]=_0x747599[_0xb095('0x66')]({'plain':!![]});return db['WhatsappInteraction'][_0xb095('0x5a')]({'where':{'id':_0x747599[_0xb095('0x68')]}});}return null;})[_0xb095('0x23')](handleEntityNotFound(_0x1f9736,null))['then'](function(_0x5de742){if(_0x5de742){_0x22b5c8[_0xb095('0x6e')]=_0x5de742[_0xb095('0x66')]({'plain':!![]});interaction_log[_0xb095('0x24')](_0xb095('0x7e'),_0x597cad[_0xb095('0x64')]['id'],_0x597cad['user'][_0xb095('0x40')],_0x597cad[_0xb095('0x64')]['role'],_0x22b5c8[_0xb095('0x6e')]['id'],_0x597cad[_0xb095('0x5c')]?JSON['stringify'](_0x597cad['body']):'null');return respondWithRpcPromise(_0xb095('0x7f'),_0xb095('0x80'),_0x22b5c8);}return null;})[_0xb095('0x23')](function(_0x507b19){var _0x423803='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x507b19[_0xb095('0x2b')][_0xb095('0x81')];return db['sequelize'][_0xb095('0x41')](_0x423803,{'type':db[_0xb095('0x74')]['QueryTypes'][_0xb095('0x76')],'raw':!![]})['then'](function(_0x5eba49){return _0x5eba49;});})['then'](function(_0x10c915){if(_0x10c915){_0x22b5c8[_0xb095('0x2b')][_0xb095('0x82')]=_0x10c915[0x0];if(!_0x597cad[_0xb095('0x5c')][_0xb095('0x69')])return;return db[_0xb095('0x83')]['find']({'where':{'id':_0x597cad[_0xb095('0x5c')]['UserId'],'role':_0xb095('0x65')},'attributes':['id',_0xb095('0x40'),_0xb095('0x77'),_0xb095('0x78'),_0xb095('0x84')],'raw':!![]});}return null;})[_0xb095('0x23')](function(_0x6e611e){if(!_0x6e611e)return null;_0x22b5c8[_0xb095('0x2b')][_0xb095('0x65')]=_0x6e611e;return _0x22b5c8;})[_0xb095('0x23')](function(_0xf05154){if(_0xf05154){_0xf05154[_0xb095('0x2b')][_0xb095('0x7a')]=util[_0xb095('0x6c')](_0xb095('0x85'),_0x597cad[_0xb095('0x64')][_0xb095('0x40')]);_0xf05154['message'][_0xb095('0x7b')]=_0x22b5c8[_0xb095('0x7b')];_0xf05154['message'][_0xb095('0x7c')]=_0xb095('0x37');respondWithRpcPromise(_0xb095('0x7d'),'EventManager',{'event':_0xb095('0x86'),'message':_0xf05154[_0xb095('0x2b')]},client9002);return _0x22b5c8;}return null;})[_0xb095('0x23')](respondWithResult(_0x1f9736,null))['catch'](handleError(_0x1f9736,null));};exports[_0xb095('0x30')]=function(_0x3278e9,_0x37bb4e,_0x3af29b){if(_0x3278e9[_0xb095('0x5c')]['id']){delete _0x3278e9[_0xb095('0x5c')]['id'];}var _0x3d8373;return db[_0xb095('0x3d')][_0xb095('0x5a')]({'where':{'id':_0x3278e9[_0xb095('0x56')]['id']}})['then'](handleEntityNotFound(_0x37bb4e,null))[_0xb095('0x23')](function(_0x217cc9){if(_0x217cc9){_0x3d8373=_0x217cc9;return db['WhatsappAccount'][_0xb095('0x5a')]({'where':{'id':_0x217cc9[_0xb095('0x87')]}});}})[_0xb095('0x23')](handleEntityNotFound(_0x37bb4e,null))['then'](function(_0x124f12){if(_0x124f12){logger[_0xb095('0x88')](_0xb095('0x89'),'status',_0xb095('0x8a'),_0x124f12[_0xb095('0x4f')],util[_0xb095('0x8b')](_0x3278e9[_0xb095('0x5c')],{'showHidden':![],'depth':null}));switch(_0x124f12[_0xb095('0x4f')]){case _0xb095('0x8c'):if(_0x3278e9[_0xb095('0x5c')]['MessageSid']&&_0x3278e9[_0xb095('0x5c')][_0xb095('0x8d')]===_0x3d8373['messageId']&&_0x3278e9['body'][_0xb095('0x8e')]&&_0x3278e9[_0xb095('0x5c')][_0xb095('0x8e')]===_0xb095('0x62')){return _0x3d8373['update']({'read':!![]});}else{logger['error'](_0xb095('0x8f'),_0xb095('0x30'),_0xb095('0x8c'),util[_0xb095('0x8b')](_0x3278e9[_0xb095('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x3d8373;}})[_0xb095('0x23')](respondWithResult(_0x37bb4e,null))[_0xb095('0x2d')](handleError(_0x37bb4e,null));};
\ No newline at end of file
+var _0xd1ad=['YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','WhatsappInteractionId','isNil','format','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','manual','channel','event','EventManager','acceptmessage','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','fullname','internal','interface','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','twilio','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','jayson/promise','http','client','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','limit','undefined','count','apply','reject','update','destroy','end','stack','name','send','index','map','WhatsappMessage','fieldName','key','query','keys','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','create','body','find','describe','whatsapp-interactions','accept','whatsapp','read'];(function(_0x587cce,_0x39073f){var _0x4dc67a=function(_0x22ad0c){while(--_0x22ad0c){_0x587cce['push'](_0x587cce['shift']());}};_0x4dc67a(++_0x39073f);}(_0xd1ad,0x1d7));var _0xdd1a=function(_0x2118ad,_0xe8e3fd){_0x2118ad=_0x2118ad-0x0;var _0x4b5715=_0xd1ad[_0x2118ad];return _0x4b5715;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdd1a('0x0'));var zipdir=require(_0xdd1a('0x1'));var jsonpatch=require(_0xdd1a('0x2'));var rp=require(_0xdd1a('0x3'));var moment=require(_0xdd1a('0x4'));var BPromise=require(_0xdd1a('0x5'));var Mustache=require(_0xdd1a('0x6'));var util=require(_0xdd1a('0x7'));var path=require(_0xdd1a('0x8'));var sox=require(_0xdd1a('0x9'));var csv=require(_0xdd1a('0xa'));var ejs=require(_0xdd1a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd1a('0xc'));var squel=require(_0xdd1a('0xd'));var crypto=require('crypto');var jsforce=require(_0xdd1a('0xe'));var deskjs=require(_0xdd1a('0xf'));var toCsv=require(_0xdd1a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdd1a('0x10'));var qs=require(_0xdd1a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd1a('0x12'));var logger=require(_0xdd1a('0x13'))(_0xdd1a('0x14'));var utils=require(_0xdd1a('0x15'));var config=require(_0xdd1a('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xdd1a('0x17'))['db'];config[_0xdd1a('0x18')]=_[_0xdd1a('0x19')](config['redis'],{'host':_0xdd1a('0x1a'),'port':0x18eb});var socket=require(_0xdd1a('0x1b'))(new Redis(config[_0xdd1a('0x18')]));require(_0xdd1a('0x1c'))[_0xdd1a('0x1d')](socket);var jayson=require(_0xdd1a('0x1e'));var client=jayson['client'][_0xdd1a('0x1f')]({'port':0x232c});var client9002=jayson[_0xdd1a('0x20')][_0xdd1a('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x278c0a,_0x3e27d2,_0x5da72d,_0x2d641c){return new BPromise(function(_0x1ed817,_0x4dc0d3){var _0x2f0a88=_0x2d641c||client;return _0x2f0a88[_0xdd1a('0x21')](_0x278c0a,_0x5da72d)[_0xdd1a('0x22')](function(_0x29d42f){logger['info'](_0xdd1a('0x23'),_0x3e27d2,'request\x20sent');logger[_0xdd1a('0x24')](_0xdd1a('0x25'),_0x3e27d2,_0xdd1a('0x26'),JSON[_0xdd1a('0x27')](_0x29d42f));if(_0x29d42f['error']){if(_0x29d42f[_0xdd1a('0x28')][_0xdd1a('0x29')]===0x1f4){logger[_0xdd1a('0x28')]('WhatsappMessage,\x20%s,\x20%s',_0x3e27d2,_0x29d42f[_0xdd1a('0x28')][_0xdd1a('0x2a')]);return _0x4dc0d3(_0x29d42f[_0xdd1a('0x28')][_0xdd1a('0x2a')]);}logger[_0xdd1a('0x28')](_0xdd1a('0x23'),_0x3e27d2,_0x29d42f[_0xdd1a('0x28')]['message']);return _0x1ed817(_0x29d42f[_0xdd1a('0x28')][_0xdd1a('0x2a')]);}else{logger[_0xdd1a('0x2b')]('WhatsappMessage,\x20%s,\x20%s',_0x3e27d2,_0xdd1a('0x26'));_0x1ed817(_0x29d42f[_0xdd1a('0x2c')][_0xdd1a('0x2a')]);}})[_0xdd1a('0x2d')](function(_0x24527e){logger[_0xdd1a('0x28')](_0xdd1a('0x23'),_0x3e27d2,_0x24527e);_0x4dc0d3(_0x24527e);});});}function respondWithStatusCode(_0x3a9522,_0x296206){_0x296206=_0x296206||0xcc;return function(_0x5af205){if(_0x5af205){return _0x3a9522[_0xdd1a('0x2e')](_0x296206);}return _0x3a9522[_0xdd1a('0x2f')](_0x296206)['end']();};}function respondWithResult(_0x5f172f,_0x5db56b){_0x5db56b=_0x5db56b||0xc8;return function(_0x15b632){if(_0x15b632){return _0x5f172f[_0xdd1a('0x2f')](_0x5db56b)[_0xdd1a('0x30')](_0x15b632);}};}function respondWithFilteredResult(_0x1e970c,_0x18df8f){return function(_0x3f338e){if(_0x3f338e){var _0x5a2fab=typeof _0x18df8f[_0xdd1a('0x31')]==='undefined'&&typeof _0x18df8f[_0xdd1a('0x32')]===_0xdd1a('0x33');var _0xab3b95=_0x3f338e[_0xdd1a('0x34')];var _0x18fd78=_0x5a2fab?0x0:_0x18df8f[_0xdd1a('0x31')];var _0x45f452=_0x5a2fab?_0x3f338e[_0xdd1a('0x34')]:_0x18df8f[_0xdd1a('0x31')]+_0x18df8f[_0xdd1a('0x32')];var _0x3c5cde;if(_0x45f452>=_0xab3b95){_0x45f452=_0xab3b95;_0x3c5cde=0xc8;}else{_0x3c5cde=0xce;}_0x1e970c[_0xdd1a('0x2f')](_0x3c5cde);return _0x1e970c['set']('Content-Range',_0x18fd78+'-'+_0x45f452+'/'+_0xab3b95)['json'](_0x3f338e);}return null;};}function patchUpdates(_0x50e0e7){return function(_0xce2a58){try{jsonpatch[_0xdd1a('0x35')](_0xce2a58,_0x50e0e7,!![]);}catch(_0x3cbc99){return BPromise[_0xdd1a('0x36')](_0x3cbc99);}return _0xce2a58['save']();};}function saveUpdates(_0x456d6d,_0x4679c6){return function(_0x14e029){if(_0x14e029){return _0x14e029[_0xdd1a('0x37')](_0x456d6d)[_0xdd1a('0x22')](function(_0x4bc58b){return _0x4bc58b;});}return null;};}function removeEntity(_0x30bb02,_0x4908b2){return function(_0x5edbe1){if(_0x5edbe1){return _0x5edbe1[_0xdd1a('0x38')]()[_0xdd1a('0x22')](function(){_0x30bb02['status'](0xcc)[_0xdd1a('0x39')]();});}};}function handleEntityNotFound(_0x4d6661,_0x535518){return function(_0x5c2f38){if(!_0x5c2f38){_0x4d6661['sendStatus'](0x194);}return _0x5c2f38;};}function handleError(_0x3cb575,_0xc91e4a){_0xc91e4a=_0xc91e4a||0x1f4;return function(_0x5de46a){logger[_0xdd1a('0x28')](_0x5de46a[_0xdd1a('0x3a')]);if(_0x5de46a[_0xdd1a('0x3b')]){delete _0x5de46a['name'];}_0x3cb575[_0xdd1a('0x2f')](_0xc91e4a)[_0xdd1a('0x3c')](_0x5de46a);};}exports[_0xdd1a('0x3d')]=function(_0x5e32b4,_0x35a6db){var _0x10e608={},_0x3c93f3={},_0x3bc0c9={'count':0x0,'rows':[]};var _0x5a9ba7=_[_0xdd1a('0x3e')](db[_0xdd1a('0x3f')]['rawAttributes'],function(_0x187619){return{'name':_0x187619[_0xdd1a('0x40')],'type':_0x187619['type'][_0xdd1a('0x41')]};});_0x3c93f3['model']=_[_0xdd1a('0x3e')](_0x5a9ba7,_0xdd1a('0x3b'));_0x3c93f3[_0xdd1a('0x42')]=_[_0xdd1a('0x43')](_0x5e32b4['query']);_0x3c93f3['filters']=_['intersection'](_0x3c93f3['model'],_0x3c93f3[_0xdd1a('0x42')]);_0x10e608[_0xdd1a('0x44')]=_[_0xdd1a('0x45')](_0x3c93f3[_0xdd1a('0x46')],qs[_0xdd1a('0x47')](_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x47')]));_0x10e608[_0xdd1a('0x44')]=_0x10e608[_0xdd1a('0x44')][_0xdd1a('0x48')]?_0x10e608[_0xdd1a('0x44')]:_0x3c93f3['model'];if(!_0x5e32b4['query'][_0xdd1a('0x49')](_0xdd1a('0x4a'))){_0x10e608['limit']=qs[_0xdd1a('0x32')](_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x32')]);_0x10e608['offset']=qs['offset'](_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x31')]);}_0x10e608[_0xdd1a('0x4b')]=qs[_0xdd1a('0x4c')](_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x4c')]);_0x10e608['where']=qs[_0xdd1a('0x4d')](_['pick'](_0x5e32b4[_0xdd1a('0x42')],_0x3c93f3[_0xdd1a('0x4d')]),_0x5a9ba7);if(_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x4e')]){_0x10e608[_0xdd1a('0x4f')]=_[_0xdd1a('0x50')](_0x10e608[_0xdd1a('0x4f')],{'$or':_[_0xdd1a('0x3e')](_0x5a9ba7,function(_0x4c45fe){if(_0x4c45fe[_0xdd1a('0x51')]!==_0xdd1a('0x52')){var _0x1abedc={};_0x1abedc[_0x4c45fe[_0xdd1a('0x3b')]]={'$like':'%'+_0x5e32b4['query']['filter']+'%'};return _0x1abedc;}})});}_0x10e608=_[_0xdd1a('0x50')]({},_0x10e608,_0x5e32b4['options']);var _0x1cad8d={'where':_0x10e608[_0xdd1a('0x4f')]};return db[_0xdd1a('0x3f')]['count'](_0x1cad8d)['then'](function(_0x8e050b){_0x3bc0c9[_0xdd1a('0x34')]=_0x8e050b;if(_0x5e32b4[_0xdd1a('0x42')][_0xdd1a('0x53')]){_0x10e608[_0xdd1a('0x54')]=[{'all':!![]}];}return db[_0xdd1a('0x3f')][_0xdd1a('0x55')](_0x10e608);})[_0xdd1a('0x22')](function(_0x1bbead){_0x3bc0c9[_0xdd1a('0x56')]=_0x1bbead;return _0x3bc0c9;})[_0xdd1a('0x22')](respondWithFilteredResult(_0x35a6db,_0x10e608))[_0xdd1a('0x2d')](handleError(_0x35a6db,null));};exports[_0xdd1a('0x57')]=function(_0x23a949,_0x4ee5eb){var _0x37fd5c={'raw':!![],'where':{'id':_0x23a949[_0xdd1a('0x58')]['id']}},_0x57b520={};_0x57b520[_0xdd1a('0x46')]=_['keys'](db[_0xdd1a('0x3f')]['rawAttributes']);_0x57b520['query']=_[_0xdd1a('0x43')](_0x23a949[_0xdd1a('0x42')]);_0x57b520['filters']=_['intersection'](_0x57b520['model'],_0x57b520[_0xdd1a('0x42')]);_0x37fd5c[_0xdd1a('0x44')]=_['intersection'](_0x57b520[_0xdd1a('0x46')],qs[_0xdd1a('0x47')](_0x23a949[_0xdd1a('0x42')]['fields']));_0x37fd5c[_0xdd1a('0x44')]=_0x37fd5c[_0xdd1a('0x44')][_0xdd1a('0x48')]?_0x37fd5c['attributes']:_0x57b520[_0xdd1a('0x46')];if(_0x23a949[_0xdd1a('0x42')][_0xdd1a('0x53')]){_0x37fd5c[_0xdd1a('0x54')]=[{'all':!![]}];}_0x37fd5c=_[_0xdd1a('0x50')]({},_0x37fd5c,_0x23a949['options']);return db[_0xdd1a('0x3f')]['find'](_0x37fd5c)[_0xdd1a('0x22')](handleEntityNotFound(_0x4ee5eb,null))['then'](respondWithResult(_0x4ee5eb,null))['catch'](handleError(_0x4ee5eb,null));};exports[_0xdd1a('0x59')]=function(_0x593298,_0x376555){return db[_0xdd1a('0x3f')][_0xdd1a('0x59')](_0x593298[_0xdd1a('0x5a')],{})[_0xdd1a('0x22')](respondWithResult(_0x376555,0xc9))[_0xdd1a('0x2d')](handleError(_0x376555,null));};exports[_0xdd1a('0x37')]=function(_0x446122,_0x1e1e98){if(_0x446122[_0xdd1a('0x5a')]['id']){delete _0x446122[_0xdd1a('0x5a')]['id'];}return db[_0xdd1a('0x3f')][_0xdd1a('0x5b')]({'where':{'id':_0x446122[_0xdd1a('0x58')]['id']}})['then'](handleEntityNotFound(_0x1e1e98,null))[_0xdd1a('0x22')](saveUpdates(_0x446122[_0xdd1a('0x5a')],null))['then'](respondWithResult(_0x1e1e98,null))[_0xdd1a('0x2d')](handleError(_0x1e1e98,null));};exports[_0xdd1a('0x38')]=function(_0x27f68c,_0x4b8d32){return db[_0xdd1a('0x3f')][_0xdd1a('0x5b')]({'where':{'id':_0x27f68c['params']['id']}})['then'](handleEntityNotFound(_0x4b8d32,null))[_0xdd1a('0x22')](removeEntity(_0x4b8d32,null))['catch'](handleError(_0x4b8d32,null));};exports[_0xdd1a('0x5c')]=function(_0x5ea593,_0x2f8e2c){return db[_0xdd1a('0x3f')][_0xdd1a('0x5c')]()['then'](respondWithResult(_0x2f8e2c,null))[_0xdd1a('0x2d')](handleError(_0x2f8e2c,null));};var interaction_log=require('../../config/logger')(_0xdd1a('0x5d'));exports[_0xdd1a('0x5e')]=function(_0x238ba3,_0x28cd06,_0x490a0f){var _0x491106={'agent':{},'channel':_0xdd1a('0x5f')};if(_0x238ba3[_0xdd1a('0x5a')]['id']){delete _0x238ba3[_0xdd1a('0x5a')]['id'];}_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x60')]=!![];_0x238ba3[_0xdd1a('0x5a')]['readAt']=moment()['format'](_0xdd1a('0x61'));_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x62')]=_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x62')]||_0x238ba3[_0xdd1a('0x63')]['id'];_0x491106[_0xdd1a('0x64')]['id']=_0x238ba3['body']['UserId'];return db[_0xdd1a('0x3f')]['find']({'where':{'id':_0x238ba3['params']['id'],'UserId':null}})[_0xdd1a('0x22')](handleEntityNotFound(_0x28cd06,null))['then'](saveUpdates(_0x238ba3['body'],null))['then'](function(_0x15717c){if(_0x15717c){_0x491106[_0xdd1a('0x2a')]=_0x15717c['get']({'plain':!![]});return db['WhatsappInteraction'][_0xdd1a('0x5b')]({'where':{'id':_0x15717c[_0xdd1a('0x65')]}});}return null;})[_0xdd1a('0x22')](handleEntityNotFound(_0x28cd06,null))[_0xdd1a('0x22')](function(_0x105616){if(_0x105616){return _0x105616[_0xdd1a('0x37')]({'UserId':_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x62')],'read1stAt':_[_0xdd1a('0x66')](_0x105616['read1stAt'])?moment()[_0xdd1a('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xdd1a('0x22')](function(_0x484c4e){if(_0x484c4e){_0x491106[_0xdd1a('0x68')]=_0x484c4e[_0xdd1a('0x69')]({'plain':!![]});interaction_log[_0xdd1a('0x2b')](_0xdd1a('0x6a'),_0x238ba3[_0xdd1a('0x63')]['id'],_0x238ba3[_0xdd1a('0x63')][_0xdd1a('0x3b')],_0x238ba3[_0xdd1a('0x63')]['role'],_0x491106['interaction']['id'],_0x238ba3[_0xdd1a('0x5a')]?JSON['stringify'](_0x238ba3[_0xdd1a('0x5a')]):_0xdd1a('0x6b'));return respondWithRpcPromise(_0xdd1a('0x6c'),_0xdd1a('0x6d'),_0x491106);}return null;})[_0xdd1a('0x22')](function(_0x328bfb){var _0x5a3f3a=_0xdd1a('0x6e')+_0x328bfb[_0xdd1a('0x2a')][_0xdd1a('0x6f')];return db[_0xdd1a('0x70')][_0xdd1a('0x42')](_0x5a3f3a,{'type':db[_0xdd1a('0x71')][_0xdd1a('0x72')][_0xdd1a('0x73')],'raw':!![]})['then'](function(_0x4ef8a9){return _0x4ef8a9;});})['then'](function(_0x330a48){if(_0x330a48){_0x491106[_0xdd1a('0x2a')][_0xdd1a('0x74')]=_0x330a48[0x0];if(!_0x238ba3['body'][_0xdd1a('0x62')])return;return db[_0xdd1a('0x75')]['find']({'where':{'id':_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x62')],'role':'agent'},'attributes':['id','name','fullname','email','internal'],'raw':!![]});}return null;})[_0xdd1a('0x22')](function(_0x1d50a7){if(!_0x1d50a7)return null;_0x491106[_0xdd1a('0x2a')][_0xdd1a('0x64')]=_0x1d50a7;return _0x491106;})[_0xdd1a('0x22')](function(_0x17a6b4){if(_0x17a6b4){if(_0x238ba3[_0xdd1a('0x5a')][_0xdd1a('0x76')]){_0x491106['message']['interface']=util[_0xdd1a('0x67')]('SIP/%s',_0x238ba3['user']['name']);_0x491106[_0xdd1a('0x2a')]['channel']=_0x491106[_0xdd1a('0x77')];_0x491106[_0xdd1a('0x2a')][_0xdd1a('0x78')]='accept';return respondWithRpcPromise('EventManager',_0xdd1a('0x79'),{'event':_0xdd1a('0x7a'),'message':_0x491106['message']},client9002)[_0xdd1a('0x22')](function(){return _0x491106;});}return _0x491106;}return null;})[_0xdd1a('0x22')](respondWithResult(_0x28cd06,null))[_0xdd1a('0x2d')](handleError(_0x28cd06,null));};var interaction_log=require('../../config/logger')(_0xdd1a('0x5d'));exports[_0xdd1a('0x36')]=function(_0x32b4d8,_0x46dfce,_0x3d95e3){var _0x376ce1={'agent':{},'channel':_0xdd1a('0x5f')};if(_0x32b4d8[_0xdd1a('0x5a')]['id']){delete _0x32b4d8['body']['id'];}_0x32b4d8[_0xdd1a('0x5a')][_0xdd1a('0x62')]=_0x32b4d8['body']['UserId']||_0x32b4d8['user']['id'];_0x376ce1['agent']['id']=_0x32b4d8[_0xdd1a('0x5a')][_0xdd1a('0x62')];return db[_0xdd1a('0x3f')][_0xdd1a('0x5b')]({'where':{'id':_0x32b4d8[_0xdd1a('0x58')]['id'],'UserId':null}})[_0xdd1a('0x22')](handleEntityNotFound(_0x46dfce,null))[_0xdd1a('0x22')](function(_0x481e53){if(_0x481e53){_0x376ce1[_0xdd1a('0x2a')]=_0x481e53[_0xdd1a('0x69')]({'plain':!![]});return db[_0xdd1a('0x7b')][_0xdd1a('0x5b')]({'where':{'id':_0x481e53['WhatsappInteractionId']}});}return null;})[_0xdd1a('0x22')](handleEntityNotFound(_0x46dfce,null))['then'](function(_0x238555){if(_0x238555){_0x376ce1[_0xdd1a('0x68')]=_0x238555[_0xdd1a('0x69')]({'plain':!![]});interaction_log['info'](_0xdd1a('0x7c'),_0x32b4d8[_0xdd1a('0x63')]['id'],_0x32b4d8['user'][_0xdd1a('0x3b')],_0x32b4d8[_0xdd1a('0x63')][_0xdd1a('0x7d')],_0x376ce1['interaction']['id'],_0x32b4d8[_0xdd1a('0x5a')]?JSON[_0xdd1a('0x27')](_0x32b4d8['body']):_0xdd1a('0x6b'));return respondWithRpcPromise('RejectMessage',_0xdd1a('0x7e'),_0x376ce1);}return null;})[_0xdd1a('0x22')](function(_0x95ac3){var _0x4d4852='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x95ac3[_0xdd1a('0x2a')][_0xdd1a('0x6f')];return db[_0xdd1a('0x70')][_0xdd1a('0x42')](_0x4d4852,{'type':db[_0xdd1a('0x71')][_0xdd1a('0x72')][_0xdd1a('0x73')],'raw':!![]})[_0xdd1a('0x22')](function(_0x4d1e24){return _0x4d1e24;});})[_0xdd1a('0x22')](function(_0x576162){if(_0x576162){_0x376ce1[_0xdd1a('0x2a')][_0xdd1a('0x74')]=_0x576162[0x0];if(!_0x32b4d8[_0xdd1a('0x5a')][_0xdd1a('0x62')])return;return db[_0xdd1a('0x75')][_0xdd1a('0x5b')]({'where':{'id':_0x32b4d8[_0xdd1a('0x5a')]['UserId'],'role':_0xdd1a('0x64')},'attributes':['id','name',_0xdd1a('0x7f'),'email',_0xdd1a('0x80')],'raw':!![]});}return null;})[_0xdd1a('0x22')](function(_0x418b43){if(!_0x418b43)return null;_0x376ce1[_0xdd1a('0x2a')][_0xdd1a('0x64')]=_0x418b43;return _0x376ce1;})[_0xdd1a('0x22')](function(_0x2a224a){if(_0x2a224a){_0x2a224a[_0xdd1a('0x2a')][_0xdd1a('0x81')]=util[_0xdd1a('0x67')](_0xdd1a('0x82'),_0x32b4d8[_0xdd1a('0x63')][_0xdd1a('0x3b')]);_0x2a224a[_0xdd1a('0x2a')][_0xdd1a('0x77')]=_0x376ce1['channel'];_0x2a224a['message'][_0xdd1a('0x78')]=_0xdd1a('0x36');respondWithRpcPromise('EventManager',_0xdd1a('0x79'),{'event':_0xdd1a('0x83'),'message':_0x2a224a[_0xdd1a('0x2a')]},client9002);return _0x376ce1;}return null;})[_0xdd1a('0x22')](respondWithResult(_0x46dfce,null))['catch'](handleError(_0x46dfce,null));};exports[_0xdd1a('0x2f')]=function(_0x4e865a,_0x54a3d8,_0xcf4000){if(_0x4e865a['body']['id']){delete _0x4e865a[_0xdd1a('0x5a')]['id'];}var _0x485088;return db['WhatsappMessage'][_0xdd1a('0x5b')]({'where':{'id':_0x4e865a[_0xdd1a('0x58')]['id']}})[_0xdd1a('0x22')](handleEntityNotFound(_0x54a3d8,null))[_0xdd1a('0x22')](function(_0x447d10){if(_0x447d10){_0x485088=_0x447d10;return db[_0xdd1a('0x84')][_0xdd1a('0x5b')]({'where':{'id':_0x447d10[_0xdd1a('0x85')]}});}})[_0xdd1a('0x22')](handleEntityNotFound(_0x54a3d8,null))[_0xdd1a('0x22')](function(_0x15f3a0){if(_0x15f3a0){logger[_0xdd1a('0x24')](_0xdd1a('0x86'),_0xdd1a('0x2f'),_0xdd1a('0x87'),_0x15f3a0[_0xdd1a('0x51')],util[_0xdd1a('0x88')](_0x4e865a[_0xdd1a('0x5a')],{'showHidden':![],'depth':null}));switch(_0x15f3a0[_0xdd1a('0x51')]){case'twilio':if(_0x4e865a['body'][_0xdd1a('0x89')]&&_0x4e865a['body'][_0xdd1a('0x89')]===_0x485088[_0xdd1a('0x8a')]&&_0x4e865a[_0xdd1a('0x5a')][_0xdd1a('0x8b')]&&_0x4e865a[_0xdd1a('0x5a')][_0xdd1a('0x8b')]===_0xdd1a('0x60')){return _0x485088[_0xdd1a('0x37')]({'read':!![]});}else{logger['error'](_0xdd1a('0x8c'),'status',_0xdd1a('0x8d'),util[_0xdd1a('0x88')](_0x4e865a[_0xdd1a('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x485088;}})[_0xdd1a('0x22')](respondWithResult(_0x54a3d8,null))[_0xdd1a('0x2d')](handleError(_0x54a3d8,null));};
\ No newline at end of file
index a08e2fc..baa201f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0972=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x2e3f4a,_0x5b9d4d){var _0x4b301f=function(_0x20d18c){while(--_0x20d18c){_0x2e3f4a['push'](_0x2e3f4a['shift']());}};_0x4b301f(++_0x5b9d4d);}(_0x0972,0x64));var _0x2097=function(_0x1334c4,_0x575b22){_0x1334c4=_0x1334c4-0x0;var _0x430a59=_0x0972[_0x1334c4];return _0x430a59;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x2097('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x2097('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2097('0x2'),'afterDestroy':_0x2097('0x3')};function emitEvent(_0x5b16c0){return function(_0x348ad8,_0x431d1c,_0xe6fbae){WhatsappMessageEvents[_0x2097('0x4')](_0x5b16c0+':'+_0x348ad8['id'],_0x348ad8);WhatsappMessageEvents[_0x2097('0x4')](_0x5b16c0,_0x348ad8);_0xe6fbae(null);};}for(var e in events){if(events[_0x2097('0x5')](e)){var event=events[e];WhatsappMessage[_0x2097('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0x4bde=['hook','events','../../mysqldb','WhatsappMessage','save','update','remove','emit','hasOwnProperty'];(function(_0x5c80ad,_0x4d009a){var _0x531595=function(_0x4fda55){while(--_0x4fda55){_0x5c80ad['push'](_0x5c80ad['shift']());}};_0x531595(++_0x4d009a);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x5501b9,_0x5e9477){_0x5501b9=_0x5501b9-0x0;var _0x10e83f=_0x4bde[_0x5501b9];return _0x10e83f;};'use strict';var EventEmitter=require(_0xe4bd('0x0'));var WhatsappMessage=require(_0xe4bd('0x1'))['db'][_0xe4bd('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe4bd('0x3'),'afterUpdate':_0xe4bd('0x4'),'afterDestroy':_0xe4bd('0x5')};function emitEvent(_0x3108bd){return function(_0x5741e5,_0x210d47,_0x1b8621){WhatsappMessageEvents[_0xe4bd('0x6')](_0x3108bd+':'+_0x5741e5['id'],_0x5741e5);WhatsappMessageEvents[_0xe4bd('0x6')](_0x3108bd,_0x5741e5);_0x1b8621(null);};}for(var e in events){if(events[_0xe4bd('0x7')](e)){var event=events[e];WhatsappMessage[_0xe4bd('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
index 9055b34..0450c35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff47=['WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','finally','utf8mb4','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappMessage.attributes','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','then','update','createdAt','catch','error','WhatsappAccount','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','/api/whatsapp/messages/','/status?token=','sid'];(function(_0xc61fdc,_0x5e42a3){var _0xfa7aaf=function(_0x5b7544){while(--_0x5b7544){_0xc61fdc['push'](_0xc61fdc['shift']());}};_0xfa7aaf(++_0x5e42a3);}(_0xff47,0x15c));var _0x7ff4=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xff47[_0x134c2e];return _0x2825db;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7ff4('0x0'))(_0x7ff4('0x1'));var moment=require(_0x7ff4('0x2'));var BPromise=require(_0x7ff4('0x3'));var rp=require(_0x7ff4('0x4'));var fs=require('fs');var path=require(_0x7ff4('0x5'));var rimraf=require(_0x7ff4('0x6'));var config=require('../../config/environment');var attributes=require(_0x7ff4('0x7'));module['exports']=function(_0x5952a7,_0x4baffc){return _0x5952a7['define']('WhatsappMessage',attributes,{'tableName':_0x7ff4('0x8'),'paranoid':![],'indexes':[{'name':_0x7ff4('0x9'),'fields':[_0x7ff4('0x9')]},{'name':_0x7ff4('0xa'),'fields':[_0x7ff4('0xb')],'type':_0x7ff4('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d0b00,_0x2690b8,_0x2bbc89){var _0x28a02b=_0x5952a7[_0x7ff4('0xd')];var _0x7bcb99=_0x2d0b00[_0x7ff4('0xe')]({'plain':!![]});if(_0x7bcb99[_0x7ff4('0xf')][_0x7ff4('0x10')]()==='in'||_0x7bcb99['direction'][_0x7ff4('0x10')]()===_0x7ff4('0x11')&&!_0x7bcb99[_0x7ff4('0x12')]&&!_[_0x7ff4('0x13')](_0x7bcb99[_0x7ff4('0x14')])){_0x28a02b[_0x7ff4('0x15')]['findOne']({'where':{'id':_0x7bcb99['WhatsappInteractionId']}})[_0x7ff4('0x16')](function(_0xdecad3){if(_0xdecad3){_0xdecad3[_0x7ff4('0x17')]({'lastMsgAt':_0x7bcb99[_0x7ff4('0x18')],'lastMsgDirection':_0x7bcb99[_0x7ff4('0xf')][_0x7ff4('0x10')]()});}})[_0x7ff4('0x19')](function(_0x2d28f1){console[_0x7ff4('0x1a')](_0x2d28f1);});}if(_0x7bcb99[_0x7ff4('0xf')]===_0x7ff4('0x11')&&!_0x7bcb99['secret']){var _0x240ad7;_0x28a02b[_0x7ff4('0x1b')]['find']({'where':{'id':_0x7bcb99['WhatsappAccountId']},'raw':!![]})[_0x7ff4('0x16')](function(_0x3f7588){_0x240ad7=_0x3f7588;if(_0x240ad7&&_0x240ad7['type']){switch(_0x240ad7[_0x7ff4('0x1c')]){case'twilio':var _0x3ec51f=require(_0x7ff4('0x1d'));if(_0x240ad7[_0x7ff4('0x1e')]&&_0x240ad7[_0x7ff4('0x1f')]&&_0x240ad7['phone']){var _0x18bf55=new _0x3ec51f(_0x240ad7[_0x7ff4('0x1e')],_0x240ad7[_0x7ff4('0x1f')]);_0x18bf55[_0x7ff4('0x20')][_0x7ff4('0x21')]({'body':_0x7bcb99['body'],'to':_0x7ff4('0x22')+_0x7bcb99[_0x7ff4('0x23')],'from':_0x7ff4('0x22')+_0x240ad7['phone'],'statusCallback':_0x240ad7['remote']+_0x7ff4('0x24')+_0x7bcb99['id']+_0x7ff4('0x25')+_0x240ad7['token']})['then'](function(_0x35ed0c){if(_0x35ed0c[_0x7ff4('0x26')]){return _0x2d0b00[_0x7ff4('0x17')]({'messageId':_0x35ed0c[_0x7ff4('0x26')]});}})[_0x7ff4('0x19')](function(_0x1892d4){logger[_0x7ff4('0x1a')](_0x7ff4('0x27'),_0x7ff4('0x28'),_0x7ff4('0x1d'),util['inspect'](_0x1892d4,{'showHidden':![],'depth':null}));});}else{logger[_0x7ff4('0x1a')](_0x7ff4('0x27'),_0x7ff4('0x28'),_0x7ff4('0x1d'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;}}})[_0x7ff4('0x29')](function(){_0x2bbc89();});}else{_0x2bbc89();}}},'charset':_0x7ff4('0x2a'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x6a24=['whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappMessage.attributes','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create'];(function(_0x3815c2,_0x1f54e3){var _0x271f88=function(_0x53963c){while(--_0x53963c){_0x3815c2['push'](_0x3815c2['shift']());}};_0x271f88(++_0x1f54e3);}(_0x6a24,0xd1));var _0x46a2=function(_0x3dfe02,_0x17c046){_0x3dfe02=_0x3dfe02-0x0;var _0x48ab66=_0x6a24[_0x3dfe02];return _0x48ab66;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var logger=require('../../config/logger')(_0x46a2('0x2'));var moment=require(_0x46a2('0x3'));var BPromise=require(_0x46a2('0x4'));var rp=require(_0x46a2('0x5'));var fs=require('fs');var path=require(_0x46a2('0x6'));var rimraf=require('rimraf');var config=require(_0x46a2('0x7'));var attributes=require(_0x46a2('0x8'));module['exports']=function(_0x22de0d,_0x8b6541){return _0x22de0d['define']('WhatsappMessage',attributes,{'tableName':_0x46a2('0x9'),'paranoid':![],'indexes':[{'name':_0x46a2('0xa'),'fields':['messageId']},{'name':_0x46a2('0xb'),'fields':['body'],'type':_0x46a2('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5086ae,_0x34c0cf,_0x6e22ae){var _0x21d1f3=_0x22de0d[_0x46a2('0xd')];var _0x35e6d9=_0x5086ae[_0x46a2('0xe')]({'plain':!![]});if(_0x35e6d9[_0x46a2('0xf')][_0x46a2('0x10')]()==='in'||_0x35e6d9['direction']['toLowerCase']()===_0x46a2('0x11')&&!_0x35e6d9[_0x46a2('0x12')]&&!_['isNil'](_0x35e6d9[_0x46a2('0x13')])){_0x21d1f3[_0x46a2('0x14')][_0x46a2('0x15')]({'where':{'id':_0x35e6d9[_0x46a2('0x16')]}})[_0x46a2('0x17')](function(_0x2fd383){if(_0x2fd383){_0x2fd383[_0x46a2('0x18')]({'lastMsgAt':_0x35e6d9[_0x46a2('0x19')],'lastMsgDirection':_0x35e6d9['direction']['toLowerCase']()});}})[_0x46a2('0x1a')](function(_0x2deb20){console['error'](_0x2deb20);});}if(_0x35e6d9[_0x46a2('0xf')]===_0x46a2('0x11')&&!_0x35e6d9['secret']){var _0xa2eb96;_0x21d1f3[_0x46a2('0x1b')]['find']({'where':{'id':_0x35e6d9[_0x46a2('0x1c')]},'raw':!![]})[_0x46a2('0x17')](function(_0x529bb5){_0xa2eb96=_0x529bb5;if(_0xa2eb96&&_0xa2eb96[_0x46a2('0x1d')]){switch(_0xa2eb96[_0x46a2('0x1d')]){case _0x46a2('0x1e'):var _0xc28d15=require(_0x46a2('0x1e'));if(_0xa2eb96[_0x46a2('0x1f')]&&_0xa2eb96[_0x46a2('0x20')]&&_0xa2eb96[_0x46a2('0x21')]){var _0x2d65c2=new _0xc28d15(_0xa2eb96[_0x46a2('0x1f')],_0xa2eb96[_0x46a2('0x20')]);_0x2d65c2[_0x46a2('0x22')][_0x46a2('0x23')]({'body':_0x35e6d9['body'],'to':_0x46a2('0x24')+_0x35e6d9['phone'],'from':_0x46a2('0x24')+_0xa2eb96[_0x46a2('0x21')],'statusCallback':_0xa2eb96['remote']+_0x46a2('0x25')+_0x35e6d9['id']+_0x46a2('0x26')+_0xa2eb96[_0x46a2('0x27')]})[_0x46a2('0x17')](function(_0x4d50f5){if(_0x4d50f5[_0x46a2('0x28')]){return _0x5086ae[_0x46a2('0x18')]({'messageId':_0x4d50f5[_0x46a2('0x28')]});}})[_0x46a2('0x1a')](function(_0x74bb6a){logger[_0x46a2('0x29')](_0x46a2('0x2a'),_0x46a2('0x2b'),_0x46a2('0x1e'),util[_0x46a2('0x2c')](_0x74bb6a,{'showHidden':![],'depth':null}));});}else{logger[_0x46a2('0x29')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x46a2('0x2b'),_0x46a2('0x1e'),_0x46a2('0x2d'));}break;}}})[_0x46a2('0x2e')](function(){_0x6e22ae();});}else{_0x6e22ae();}}},'charset':_0x46a2('0x2f'),'collate':_0x46a2('0x30')});};
\ No newline at end of file
index dea60a9..f01232c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1879=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','CreateWhatsappMessage','create','body','options','raw','lodash','util','bluebird','randomstring'];(function(_0x232a94,_0x578e76){var _0x4403f3=function(_0x4cfafb){while(--_0x4cfafb){_0x232a94['push'](_0x232a94['shift']());}};_0x4403f3(++_0x578e76);}(_0x1879,0x74));var _0x9187=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x1879[_0x3a2a3c];return _0x50ac9a;};'use strict';var _=require(_0x9187('0x0'));var util=require(_0x9187('0x1'));var moment=require('moment');var BPromise=require(_0x9187('0x2'));var rs=require(_0x9187('0x3'));var fs=require('fs');var Redis=require(_0x9187('0x4'));var db=require(_0x9187('0x5'))['db'];var utils=require(_0x9187('0x6'));var logger=require(_0x9187('0x7'))(_0x9187('0x8'));var config=require('../../config/environment');var jayson=require(_0x9187('0x9'));var client=jayson['client'][_0x9187('0xa')]({'port':0x232a});config[_0x9187('0xb')]=_['defaults'](config['redis'],{'host':_0x9187('0xc'),'port':0x18eb});var socket=require(_0x9187('0xd'))(new Redis(config[_0x9187('0xb')]));require(_0x9187('0xe'))[_0x9187('0xf')](socket);function respondWithRpcPromise(_0x3d285e,_0x14f5ab,_0x1b0b97){return new BPromise(function(_0x1d846c,_0xaaa299){return client[_0x9187('0x10')](_0x3d285e,_0x1b0b97)['then'](function(_0x29b3c1){logger[_0x9187('0x11')](_0x9187('0x12'),_0x14f5ab,_0x9187('0x13'));logger[_0x9187('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x14f5ab,_0x9187('0x13'),JSON['stringify'](_0x29b3c1));if(_0x29b3c1[_0x9187('0x15')]){if(_0x29b3c1[_0x9187('0x15')][_0x9187('0x16')]===0x1f4){logger['error'](_0x9187('0x12'),_0x14f5ab,_0x29b3c1['error'][_0x9187('0x17')]);return _0xaaa299(_0x29b3c1['error'][_0x9187('0x17')]);}logger['error'](_0x9187('0x12'),_0x14f5ab,_0x29b3c1[_0x9187('0x15')][_0x9187('0x17')]);return _0x1d846c(_0x29b3c1[_0x9187('0x15')][_0x9187('0x17')]);}else{logger[_0x9187('0x11')]('WhatsappMessage,\x20%s,\x20%s',_0x14f5ab,'request\x20sent');_0x1d846c(_0x29b3c1[_0x9187('0x18')]['message']);}})['catch'](function(_0x182e38){logger[_0x9187('0x15')](_0x9187('0x12'),_0x14f5ab,_0x182e38);_0xaaa299(_0x182e38);});});}exports[_0x9187('0x19')]=function(_0x591c78){var _0x4a8555=this;return new Promise(function(_0x32c721,_0x5410cd){return db['WhatsappMessage'][_0x9187('0x1a')](_0x591c78[_0x9187('0x1b')],{'raw':_0x591c78[_0x9187('0x1c')]?_0x591c78['options'][_0x9187('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x4bd6a9){logger[_0x9187('0x11')](_0x9187('0x19'),_0x591c78);logger[_0x9187('0x14')](_0x9187('0x19'),_0x591c78,JSON['stringify'](_0x4bd6a9));_0x32c721(_0x4bd6a9);})['catch'](function(_0x52ad5d){logger[_0x9187('0x15')](_0x9187('0x19'),_0x52ad5d[_0x9187('0x17')],_0x591c78);_0x5410cd(_0x4a8555[_0x9187('0x15')](0x1f4,_0x52ad5d['message']));});});};
\ No newline at end of file
+var _0x3452=['localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappMessage','create','body','options','CreateWhatsappMessage','debug','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','http','redis','defaults'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3452,0x6f));var _0x2345=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x3452[_0x3e5086];return _0xfeb102;};'use strict';var _=require('lodash');var util=require(_0x2345('0x0'));var moment=require('moment');var BPromise=require(_0x2345('0x1'));var rs=require(_0x2345('0x2'));var fs=require('fs');var Redis=require(_0x2345('0x3'));var db=require(_0x2345('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2345('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x2345('0x6')]({'port':0x232a});config[_0x2345('0x7')]=_[_0x2345('0x8')](config[_0x2345('0x7')],{'host':_0x2345('0x9'),'port':0x18eb});var socket=require(_0x2345('0xa'))(new Redis(config[_0x2345('0x7')]));require(_0x2345('0xb'))[_0x2345('0xc')](socket);function respondWithRpcPromise(_0x6115fc,_0x5b2107,_0x57ef57){return new BPromise(function(_0x22b86f,_0x5b09b3){return client['request'](_0x6115fc,_0x57ef57)[_0x2345('0xd')](function(_0x3cb373){logger[_0x2345('0xe')](_0x2345('0xf'),_0x5b2107,_0x2345('0x10'));logger['debug'](_0x2345('0x11'),_0x5b2107,_0x2345('0x10'),JSON[_0x2345('0x12')](_0x3cb373));if(_0x3cb373[_0x2345('0x13')]){if(_0x3cb373[_0x2345('0x13')][_0x2345('0x14')]===0x1f4){logger[_0x2345('0x13')]('WhatsappMessage,\x20%s,\x20%s',_0x5b2107,_0x3cb373[_0x2345('0x13')][_0x2345('0x15')]);return _0x5b09b3(_0x3cb373[_0x2345('0x13')][_0x2345('0x15')]);}logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5b2107,_0x3cb373['error']['message']);return _0x22b86f(_0x3cb373[_0x2345('0x13')]['message']);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x5b2107,_0x2345('0x10'));_0x22b86f(_0x3cb373[_0x2345('0x16')][_0x2345('0x15')]);}})[_0x2345('0x17')](function(_0x116cc2){logger[_0x2345('0x13')](_0x2345('0xf'),_0x5b2107,_0x116cc2);_0x5b09b3(_0x116cc2);});});}exports['CreateWhatsappMessage']=function(_0x47b94d){var _0x176c0a=this;return new Promise(function(_0x46db8a,_0x32ad3f){return db[_0x2345('0x18')][_0x2345('0x19')](_0x47b94d[_0x2345('0x1a')],{'raw':_0x47b94d[_0x2345('0x1b')]?_0x47b94d['options']['raw']===undefined?!![]:![]:!![]})[_0x2345('0xd')](function(_0x1ef635){logger[_0x2345('0xe')](_0x2345('0x1c'),_0x47b94d);logger[_0x2345('0x1d')](_0x2345('0x1c'),_0x47b94d,JSON['stringify'](_0x1ef635));_0x46db8a(_0x1ef635);})['catch'](function(_0x4c4617){logger[_0x2345('0x13')](_0x2345('0x1c'),_0x4c4617[_0x2345('0x15')],_0x47b94d);_0x32ad3f(_0x176c0a['error'](0x1f4,_0x4c4617['message']));});});};
\ No newline at end of file
index 1ec7ae3..d590f10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42ee=['removeListener','register','length','whatsappMessage:','save','update'];(function(_0x3e2791,_0x4b316b){var _0x212ea3=function(_0x22b90d){while(--_0x22b90d){_0x3e2791['push'](_0x3e2791['shift']());}};_0x212ea3(++_0x4b316b);}(_0x42ee,0xb8));var _0xe42e=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x42ee[_0xbf8ebe];return _0x1e25e8;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xe42e('0x0'),'remove',_0xe42e('0x1')];function createListener(_0x17d50c,_0x2fbe51){return function(_0x3340f3){_0x2fbe51['emit'](_0x17d50c,_0x3340f3);};}function removeListener(_0x16f898,_0x4b70c4){return function(){WhatsappMessageEvents[_0xe42e('0x2')](_0x16f898,_0x4b70c4);};}exports[_0xe42e('0x3')]=function(_0x55e529){for(var _0x1aeb25=0x0,_0x41248e=events[_0xe42e('0x4')];_0x1aeb25<_0x41248e;_0x1aeb25++){var _0xcb8512=events[_0x1aeb25];var _0x20f53e=createListener(_0xe42e('0x5')+_0xcb8512,_0x55e529);WhatsappMessageEvents['on'](_0xcb8512,_0x20f53e);}};
\ No newline at end of file
+var _0xa5d1=['remove','update','emit','register','length','./whatsappMessage.events'];(function(_0x3128da,_0x4498ac){var _0x41f15d=function(_0x192e87){while(--_0x192e87){_0x3128da['push'](_0x3128da['shift']());}};_0x41f15d(++_0x4498ac);}(_0xa5d1,0x161));var _0x1a5d=function(_0x13aa65,_0x5282e9){_0x13aa65=_0x13aa65-0x0;var _0x641fbb=_0xa5d1[_0x13aa65];return _0x641fbb;};'use strict';var WhatsappMessageEvents=require(_0x1a5d('0x0'));var events=['save',_0x1a5d('0x1'),_0x1a5d('0x2')];function createListener(_0x4c887d,_0x56c30d){return function(_0x4b6fd0){_0x56c30d[_0x1a5d('0x3')](_0x4c887d,_0x4b6fd0);};}function removeListener(_0x442442,_0x4a6d1b){return function(){WhatsappMessageEvents['removeListener'](_0x442442,_0x4a6d1b);};}exports[_0x1a5d('0x4')]=function(_0x5bc5ca){for(var _0x174262=0x0,_0x11b379=events[_0x1a5d('0x5')];_0x174262<_0x11b379;_0x174262++){var _0x50a5bc=events[_0x174262];var _0x3fe3f8=createListener('whatsappMessage:'+_0x50a5bc,_0x5bc5ca);WhatsappMessageEvents['on'](_0x50a5bc,_0x3fe3f8);}};
\ No newline at end of file
index 6c549b8..62db844 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4853=['describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','delete','destroy','removeAgents','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x240ad0,_0xfeaeda){var _0x208958=function(_0x52969a){while(--_0x52969a){_0x240ad0['push'](_0x240ad0['shift']());}};_0x208958(++_0xfeaeda);}(_0x4853,0x1f0));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x3485('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3485('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x3485('0x2'));var interaction=require(_0x3485('0x3'));var config=require(_0x3485('0x4'));var controller=require(_0x3485('0x5'));router[_0x3485('0x6')]('/',auth[_0x3485('0x7')](),controller[_0x3485('0x8')]);router[_0x3485('0x6')](_0x3485('0x9'),auth[_0x3485('0x7')](),controller[_0x3485('0xa')]);router['get'](_0x3485('0xb'),auth[_0x3485('0x7')](),controller[_0x3485('0xc')]);router[_0x3485('0x6')](_0x3485('0xd'),auth['isAuthenticated'](),controller['getMembers']);router['get'](_0x3485('0xe'),auth[_0x3485('0x7')](),controller[_0x3485('0xf')]);router[_0x3485('0x6')](_0x3485('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x3485('0x11')]('/',auth[_0x3485('0x7')](),controller['create']);router[_0x3485('0x11')]('/:id/teams',auth[_0x3485('0x7')](),controller[_0x3485('0x12')]);router[_0x3485('0x11')](_0x3485('0x10'),auth['isAuthenticated'](),controller[_0x3485('0x13')]);router['put'](_0x3485('0xb'),auth[_0x3485('0x7')](),controller['update']);router[_0x3485('0x14')](_0x3485('0xb'),auth[_0x3485('0x7')](),controller[_0x3485('0x15')]);router['delete']('/:id/teams',auth[_0x3485('0x7')](),controller['removeTeams']);router[_0x3485('0x14')](_0x3485('0x10'),auth[_0x3485('0x7')](),controller[_0x3485('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xe91b=['/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers'];(function(_0x4570c6,_0x4e1a32){var _0x27d7a4=function(_0x1adb8e){while(--_0x1adb8e){_0x4570c6['push'](_0x4570c6['shift']());}};_0x27d7a4(++_0x4e1a32);}(_0xe91b,0xce));var _0xbe91=function(_0x31b5b2,_0x5ab927){_0x31b5b2=_0x31b5b2-0x0;var _0x364f13=_0xe91b[_0x31b5b2];return _0x364f13;};'use strict';var multer=require(_0xbe91('0x0'));var util=require(_0xbe91('0x1'));var path=require(_0xbe91('0x2'));var timeout=require(_0xbe91('0x3'));var express=require(_0xbe91('0x4'));var router=express[_0xbe91('0x5')]();var fs_extra=require(_0xbe91('0x6'));var auth=require(_0xbe91('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xbe91('0x8'));var controller=require('./whatsappQueue.controller');router[_0xbe91('0x9')]('/',auth['isAuthenticated'](),controller[_0xbe91('0xa')]);router[_0xbe91('0x9')](_0xbe91('0xb'),auth[_0xbe91('0xc')](),controller[_0xbe91('0xd')]);router[_0xbe91('0x9')](_0xbe91('0xe'),auth[_0xbe91('0xc')](),controller[_0xbe91('0xf')]);router[_0xbe91('0x9')](_0xbe91('0x10'),auth['isAuthenticated'](),controller[_0xbe91('0x11')]);router['get'](_0xbe91('0x12'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x13')]);router[_0xbe91('0x9')](_0xbe91('0x14'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x15')]);router[_0xbe91('0x16')]('/',auth[_0xbe91('0xc')](),controller[_0xbe91('0x17')]);router[_0xbe91('0x16')](_0xbe91('0x12'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x18')]);router[_0xbe91('0x16')](_0xbe91('0x14'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x19')]);router[_0xbe91('0x1a')](_0xbe91('0xe'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x1b')]);router['delete'](_0xbe91('0xe'),auth['isAuthenticated'](),controller[_0xbe91('0x1c')]);router[_0xbe91('0x1d')](_0xbe91('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router['delete'](_0xbe91('0x14'),auth[_0xbe91('0xc')](),controller[_0xbe91('0x1e')]);module[_0xbe91('0x1f')]=router;
\ No newline at end of file
index 0cab042..3ec8871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe60=['ENUM','beepall','roundrobin','STRING','exports','name','INTEGER'];(function(_0x5b0927,_0x101936){var _0x2d0e4d=function(_0xd4a515){while(--_0xd4a515){_0x5b0927['push'](_0x5b0927['shift']());}};_0x2d0e4d(++_0x101936);}(_0xfe60,0x1cb));var _0x0fe6=function(_0x4dd20e,_0x2e9b53){_0x4dd20e=_0x4dd20e-0x0;var _0x1a9dcb=_0xfe60[_0x4dd20e];return _0x1a9dcb;};'use strict';var Sequelize=require('sequelize');module[_0x0fe6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x0fe6('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0fe6('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0fe6('0x3')]('rrmemory',_0x0fe6('0x4'),_0x0fe6('0x5'))},'description':{'type':Sequelize[_0x0fe6('0x6')]}};
\ No newline at end of file
+var _0x1f38=['exports','STRING','name','INTEGER','ENUM','beepall','roundrobin','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1f38,0xd7));var _0x81f3=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0x1f38[_0xf04c6d];return _0x4a804e;};'use strict';var Sequelize=require(_0x81f3('0x0'));module[_0x81f3('0x1')]={'name':{'type':Sequelize[_0x81f3('0x2')],'unique':_0x81f3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x81f3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x81f3('0x5')]('rrmemory',_0x81f3('0x6'),_0x81f3('0x7'))},'description':{'type':Sequelize[_0x81f3('0x2')]}};
\ No newline at end of file
index 0cded70..7eeba16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0577=['transaction','addTeams','findOrCreate','forEach','emit','userWhatsappQueue:save','ids','Agents','field','tq.TeamId','from','team_has_whatsapp_queues','join','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','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','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','then','destroy','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','WhatsappQueue','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','include','catch','show','params','keys','rawAttributes','includeAll','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','findAll','User','findAndCountAll','UserId','agent','updatedAt','rows','SIP','whatsappPause','createdAt','getTeams','Team','online','voicePause','interface','flatMap','sequelize'];(function(_0x444c70,_0x58d3d9){var _0x93886f=function(_0x103bd2){while(--_0x103bd2){_0x444c70['push'](_0x444c70['shift']());}};_0x93886f(++_0x58d3d9);}(_0x0577,0xb5));var _0x7057=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x0577[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7057('0x0'));var zipdir=require(_0x7057('0x1'));var jsonpatch=require(_0x7057('0x2'));var rp=require('request-promise');var moment=require(_0x7057('0x3'));var BPromise=require(_0x7057('0x4'));var Mustache=require(_0x7057('0x5'));var util=require(_0x7057('0x6'));var path=require(_0x7057('0x7'));var sox=require(_0x7057('0x8'));var csv=require('to-csv');var ejs=require(_0x7057('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7057('0xa'));var squel=require(_0x7057('0xb'));var crypto=require(_0x7057('0xc'));var jsforce=require(_0x7057('0xd'));var deskjs=require(_0x7057('0xe'));var toCsv=require(_0x7057('0xf'));var querystring=require(_0x7057('0x10'));var Papa=require(_0x7057('0x11'));var Redis=require(_0x7057('0x12'));var authService=require(_0x7057('0x13'));var qs=require(_0x7057('0x14'));var as=require(_0x7057('0x15'));var hardwareService=require(_0x7057('0x16'));var logger=require(_0x7057('0x17'))(_0x7057('0x18'));var utils=require(_0x7057('0x19'));var config=require(_0x7057('0x1a'));var licenseUtil=require(_0x7057('0x1b'));var db=require(_0x7057('0x1c'))['db'];config[_0x7057('0x1d')]=_['defaults'](config[_0x7057('0x1d')],{'host':_0x7057('0x1e'),'port':0x18eb});var socket=require(_0x7057('0x1f'))(new Redis(config[_0x7057('0x1d')]));require(_0x7057('0x20'))['register'](socket);function respondWithStatusCode(_0x3db360,_0x4441c2){_0x4441c2=_0x4441c2||0xcc;return function(_0x41988f){if(_0x41988f){return _0x3db360['sendStatus'](_0x4441c2);}return _0x3db360['status'](_0x4441c2)[_0x7057('0x21')]();};}function respondWithResult(_0x2168f6,_0x146ad1){_0x146ad1=_0x146ad1||0xc8;return function(_0x4bd584){if(_0x4bd584){return _0x2168f6[_0x7057('0x22')](_0x146ad1)[_0x7057('0x23')](_0x4bd584);}};}function respondWithFilteredResult(_0x275d2a,_0x4fc0af){return function(_0x2d26f6){if(_0x2d26f6){var _0x7f3680=typeof _0x4fc0af['offset']===_0x7057('0x24')&&typeof _0x4fc0af['limit']===_0x7057('0x24');var _0xd7970c=_0x2d26f6[_0x7057('0x25')];var _0x4ff1a8=_0x7f3680?0x0:_0x4fc0af[_0x7057('0x26')];var _0x545137=_0x7f3680?_0x2d26f6[_0x7057('0x25')]:_0x4fc0af['offset']+_0x4fc0af[_0x7057('0x27')];var _0x1bfb2b;if(_0x545137>=_0xd7970c){_0x545137=_0xd7970c;_0x1bfb2b=0xc8;}else{_0x1bfb2b=0xce;}_0x275d2a['status'](_0x1bfb2b);return _0x275d2a[_0x7057('0x28')](_0x7057('0x29'),_0x4ff1a8+'-'+_0x545137+'/'+_0xd7970c)[_0x7057('0x23')](_0x2d26f6);}return null;};}function patchUpdates(_0x4d9135){return function(_0x234104){try{jsonpatch[_0x7057('0x2a')](_0x234104,_0x4d9135,!![]);}catch(_0x5b83cc){return BPromise[_0x7057('0x2b')](_0x5b83cc);}return _0x234104['save']();};}function saveUpdates(_0x1a8793,_0x3f1b80){return function(_0x1b60ef){if(_0x1b60ef){return _0x1b60ef['update'](_0x1a8793)[_0x7057('0x2c')](function(_0x2284b8){return _0x2284b8;});}return null;};}function removeEntity(_0x466909,_0x51da90){return function(_0x1caf1a){if(_0x1caf1a){return _0x1caf1a[_0x7057('0x2d')]()['then'](function(){var _0x247173=_0x1caf1a['get']({'plain':!![]});var _0x2f6b44=_0x7057('0x2e');return db[_0x7057('0x2f')][_0x7057('0x2d')]({'where':{'type':_0x2f6b44,'resourceId':_0x247173['id']}})[_0x7057('0x2c')](function(){return _0x1caf1a;});})[_0x7057('0x2c')](function(){_0x466909[_0x7057('0x22')](0xcc)[_0x7057('0x21')]();});}};}function handleEntityNotFound(_0x53c1a0,_0x153b6e){return function(_0x2ac183){if(!_0x2ac183){_0x53c1a0[_0x7057('0x30')](0x194);}return _0x2ac183;};}function handleError(_0x4befde,_0x44d792){_0x44d792=_0x44d792||0x1f4;return function(_0x16f6fa){logger[_0x7057('0x31')](_0x16f6fa[_0x7057('0x32')]);if(_0x16f6fa[_0x7057('0x33')]){delete _0x16f6fa[_0x7057('0x33')];}_0x4befde[_0x7057('0x22')](_0x44d792)[_0x7057('0x34')](_0x16f6fa);};}exports[_0x7057('0x35')]=function(_0x5b0bf9,_0x4c2b10){var _0x1213c7={},_0x445ea4={},_0x129575={'count':0x0,'rows':[]};var _0x26bb1d=_[_0x7057('0x36')](db[_0x7057('0x37')]['rawAttributes'],function(_0x3412b6){return{'name':_0x3412b6['fieldName'],'type':_0x3412b6[_0x7057('0x38')][_0x7057('0x39')]};});_0x445ea4[_0x7057('0x3a')]=_['map'](_0x26bb1d,_0x7057('0x33'));_0x445ea4[_0x7057('0x3b')]=_['keys'](_0x5b0bf9[_0x7057('0x3b')]);_0x445ea4['filters']=_[_0x7057('0x3c')](_0x445ea4[_0x7057('0x3a')],_0x445ea4[_0x7057('0x3b')]);_0x1213c7[_0x7057('0x3d')]=_[_0x7057('0x3c')](_0x445ea4[_0x7057('0x3a')],qs[_0x7057('0x3e')](_0x5b0bf9[_0x7057('0x3b')]['fields']));_0x1213c7[_0x7057('0x3d')]=_0x1213c7[_0x7057('0x3d')][_0x7057('0x3f')]?_0x1213c7[_0x7057('0x3d')]:_0x445ea4[_0x7057('0x3a')];if(!_0x5b0bf9[_0x7057('0x3b')][_0x7057('0x40')](_0x7057('0x41'))){_0x1213c7[_0x7057('0x27')]=qs[_0x7057('0x27')](_0x5b0bf9[_0x7057('0x3b')][_0x7057('0x27')]);_0x1213c7['offset']=qs[_0x7057('0x26')](_0x5b0bf9[_0x7057('0x3b')][_0x7057('0x26')]);}_0x1213c7[_0x7057('0x42')]=qs[_0x7057('0x43')](_0x5b0bf9['query'][_0x7057('0x43')]);_0x1213c7[_0x7057('0x44')]=qs[_0x7057('0x45')](_[_0x7057('0x46')](_0x5b0bf9[_0x7057('0x3b')],_0x445ea4['filters']),_0x26bb1d);if(_0x5b0bf9[_0x7057('0x3b')][_0x7057('0x47')]){_0x1213c7['where']=_[_0x7057('0x48')](_0x1213c7['where'],{'$or':_[_0x7057('0x36')](_0x26bb1d,function(_0x148d42){if(_0x148d42[_0x7057('0x38')]!=='VIRTUAL'){var _0x2394c8={};_0x2394c8[_0x148d42[_0x7057('0x33')]]={'$like':'%'+_0x5b0bf9['query']['filter']+'%'};return _0x2394c8;}})});}_0x1213c7=_[_0x7057('0x48')]({},_0x1213c7,_0x5b0bf9[_0x7057('0x49')]);var _0x3ab81e={'where':_0x1213c7[_0x7057('0x44')]};return db[_0x7057('0x37')][_0x7057('0x25')](_0x3ab81e)[_0x7057('0x2c')](function(_0x13d676){_0x129575[_0x7057('0x25')]=_0x13d676;if(_0x5b0bf9[_0x7057('0x3b')]['includeAll']){_0x1213c7[_0x7057('0x4a')]=[{'all':!![]}];}return db[_0x7057('0x37')]['findAll'](_0x1213c7);})[_0x7057('0x2c')](function(_0x340559){_0x129575['rows']=_0x340559;return _0x129575;})[_0x7057('0x2c')](respondWithFilteredResult(_0x4c2b10,_0x1213c7))[_0x7057('0x4b')](handleError(_0x4c2b10,null));};exports[_0x7057('0x4c')]=function(_0x2fcac9,_0x42d5fc){var _0x496061={'raw':!![],'where':{'id':_0x2fcac9[_0x7057('0x4d')]['id']}},_0x34a9c8={};_0x34a9c8[_0x7057('0x3a')]=_[_0x7057('0x4e')](db[_0x7057('0x37')][_0x7057('0x4f')]);_0x34a9c8[_0x7057('0x3b')]=_[_0x7057('0x4e')](_0x2fcac9[_0x7057('0x3b')]);_0x34a9c8[_0x7057('0x45')]=_[_0x7057('0x3c')](_0x34a9c8[_0x7057('0x3a')],_0x34a9c8['query']);_0x496061['attributes']=_['intersection'](_0x34a9c8[_0x7057('0x3a')],qs['fields'](_0x2fcac9['query']['fields']));_0x496061[_0x7057('0x3d')]=_0x496061[_0x7057('0x3d')]['length']?_0x496061['attributes']:_0x34a9c8[_0x7057('0x3a')];if(_0x2fcac9[_0x7057('0x3b')][_0x7057('0x50')]){_0x496061[_0x7057('0x4a')]=[{'all':!![]}];}_0x496061=_[_0x7057('0x48')]({},_0x496061,_0x2fcac9[_0x7057('0x49')]);return db[_0x7057('0x37')]['find'](_0x496061)[_0x7057('0x2c')](handleEntityNotFound(_0x42d5fc,null))[_0x7057('0x2c')](respondWithResult(_0x42d5fc,null))[_0x7057('0x4b')](handleError(_0x42d5fc,null));};exports[_0x7057('0x51')]=function(_0x221c52,_0x3faddc){return db[_0x7057('0x37')][_0x7057('0x51')](_0x221c52['body'],{})[_0x7057('0x2c')](function(_0x9b3c3f){var _0xa7cc75=_0x221c52['user'][_0x7057('0x52')]({'plain':!![]});if(!_0xa7cc75)throw new Error(_0x7057('0x53'));if(_0xa7cc75['role']==='user'){var _0x49f5c6=_0x9b3c3f[_0x7057('0x52')]({'plain':!![]});var _0x4ddcaf=_0x7057('0x2e');return db[_0x7057('0x54')][_0x7057('0x55')]({'where':{'name':_0x4ddcaf,'userProfileId':_0xa7cc75[_0x7057('0x56')]},'raw':!![]})['then'](function(_0x56649d){if(_0x56649d&&_0x56649d[_0x7057('0x57')]===0x0){return db[_0x7057('0x2f')][_0x7057('0x51')]({'name':_0x49f5c6[_0x7057('0x33')],'resourceId':_0x49f5c6['id'],'type':_0x56649d[_0x7057('0x33')],'sectionId':_0x56649d['id']},{})['then'](function(){return _0x9b3c3f;});}else{return _0x9b3c3f;}})[_0x7057('0x4b')](function(_0x548347){logger[_0x7057('0x31')](_0x7057('0x58'),_0x548347);throw _0x548347;});}return _0x9b3c3f;})[_0x7057('0x2c')](respondWithResult(_0x3faddc,0xc9))['catch'](handleError(_0x3faddc,null));};exports[_0x7057('0x59')]=function(_0xface39,_0x51a462){if(_0xface39[_0x7057('0x5a')]['id']){delete _0xface39['body']['id'];}return db[_0x7057('0x37')][_0x7057('0x55')]({'where':{'id':_0xface39['params']['id']}})[_0x7057('0x2c')](handleEntityNotFound(_0x51a462,null))[_0x7057('0x2c')](saveUpdates(_0xface39[_0x7057('0x5a')],null))[_0x7057('0x2c')](respondWithResult(_0x51a462,null))[_0x7057('0x4b')](handleError(_0x51a462,null));};exports[_0x7057('0x2d')]=function(_0x4b1554,_0x3be51f){return db[_0x7057('0x37')][_0x7057('0x55')]({'where':{'id':_0x4b1554[_0x7057('0x4d')]['id']}})[_0x7057('0x2c')](handleEntityNotFound(_0x3be51f,null))[_0x7057('0x2c')](removeEntity(_0x3be51f,null))[_0x7057('0x4b')](handleError(_0x3be51f,null));};exports[_0x7057('0x5b')]=function(_0x2297a5,_0x7799c5){return db[_0x7057('0x37')]['describe']()[_0x7057('0x2c')](respondWithResult(_0x7799c5,null))['catch'](handleError(_0x7799c5,null));};exports[_0x7057('0x5c')]=function(_0x110d8b,_0x233087,_0x44b551){var _0x45ff4c={'raw':!![],'where':{}},_0x205ea2={},_0x4076e8;return db[_0x7057('0x37')][_0x7057('0x5d')]({'where':{'id':_0x110d8b['params']['id']}})[_0x7057('0x2c')](handleEntityNotFound(_0x233087,null))[_0x7057('0x2c')](function(_0x581673){if(_0x581673){_0x4076e8=_0x581673[_0x7057('0x52')]({'plain':!![]});_0x205ea2['model']=_[_0x7057('0x4e')](db[_0x7057('0x5e')]['rawAttributes']);_0x205ea2[_0x7057('0x3b')]=_[_0x7057('0x4e')](_0x110d8b[_0x7057('0x3b')]);_0x205ea2[_0x7057('0x45')]=_[_0x7057('0x3c')](_0x205ea2[_0x7057('0x3a')],_0x205ea2[_0x7057('0x3b')]);_0x45ff4c[_0x7057('0x3d')]=_[_0x7057('0x3c')](_0x205ea2[_0x7057('0x3a')],qs['fields'](_0x110d8b['query'][_0x7057('0x3e')]));_0x45ff4c[_0x7057('0x3d')]=_0x45ff4c[_0x7057('0x3d')]['length']?_0x45ff4c[_0x7057('0x3d')]:_0x205ea2[_0x7057('0x3a')];if(!_0x110d8b[_0x7057('0x3b')][_0x7057('0x40')]('nolimit')){_0x45ff4c[_0x7057('0x27')]=qs[_0x7057('0x27')](_0x110d8b[_0x7057('0x3b')][_0x7057('0x27')]);_0x45ff4c[_0x7057('0x26')]=qs[_0x7057('0x26')](_0x110d8b[_0x7057('0x3b')]['offset']);}_0x45ff4c[_0x7057('0x42')]=qs[_0x7057('0x43')](_0x110d8b['query']['sort']);_0x45ff4c[_0x7057('0x44')]=qs[_0x7057('0x45')](_['pick'](_0x110d8b['query'],_0x205ea2[_0x7057('0x45')]));_0x45ff4c['where'][_0x7057('0x5f')]=_0x581673['id'];if(_0x110d8b[_0x7057('0x3b')][_0x7057('0x47')]){_0x45ff4c[_0x7057('0x44')]=_[_0x7057('0x48')](_0x45ff4c[_0x7057('0x44')],{'$or':_[_0x7057('0x36')](_0x45ff4c[_0x7057('0x3d')],function(_0x25c4b8){var _0x306fe0={};_0x306fe0[_0x25c4b8]={'$like':'%'+_0x110d8b['query']['filter']+'%'};return _0x306fe0;})});}_0x45ff4c=_[_0x7057('0x48')]({},_0x45ff4c,_0x110d8b['options']);return db['UserWhatsappQueue'][_0x7057('0x60')](_0x45ff4c);}})[_0x7057('0x2c')](function(_0x5df5cf){if(_0x5df5cf){return db[_0x7057('0x61')][_0x7057('0x62')]({'where':{'id':_[_0x7057('0x36')](_0x5df5cf,_0x7057('0x63')),'role':_0x7057('0x64')},'attributes':['id',_0x7057('0x33'),'whatsappPause',_0x7057('0x65'),'createdAt']});}})[_0x7057('0x2c')](function(_0x323fbd){if(_0x323fbd){return{'count':_0x323fbd['count'],'rows':_[_0x7057('0x36')](_0x323fbd[_0x7057('0x66')],function(_0x222386){return{'membername':_0x222386[_0x7057('0x33')],'UserId':_0x222386['id'],'queue_name':_0x4076e8['name'],'WhatsappQueueId':_0x4076e8['id'],'interface':util['format']('%s/%s',_0x7057('0x67'),_0x222386['name']),'penalty':0x0,'paused':_0x222386[_0x7057('0x68')],'createdAt':_0x222386[_0x7057('0x69')],'updatedAt':_0x222386[_0x7057('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7057('0x2c')](respondWithFilteredResult(_0x233087,_0x45ff4c))[_0x7057('0x4b')](handleError(_0x233087,null));};exports[_0x7057('0x6a')]=function(_0x12dec4,_0x1c98c2,_0x2a0fef){var _0xbdc73f={};var _0x32483b={};var _0x3f7be1;var _0x15ae7c;return db[_0x7057('0x37')][_0x7057('0x5d')]({'where':{'id':_0x12dec4['params']['id']}})['then'](handleEntityNotFound(_0x1c98c2,null))['then'](function(_0x2fd255){if(_0x2fd255){_0x3f7be1=_0x2fd255;_0x32483b[_0x7057('0x3a')]=_[_0x7057('0x4e')](db[_0x7057('0x6b')][_0x7057('0x4f')]);_0x32483b[_0x7057('0x3b')]=_[_0x7057('0x4e')](_0x12dec4[_0x7057('0x3b')]);_0x32483b[_0x7057('0x45')]=_[_0x7057('0x3c')](_0x32483b[_0x7057('0x3a')],_0x32483b[_0x7057('0x3b')]);_0xbdc73f['attributes']=_[_0x7057('0x3c')](_0x32483b['model'],qs[_0x7057('0x3e')](_0x12dec4[_0x7057('0x3b')][_0x7057('0x3e')]));_0xbdc73f[_0x7057('0x3d')]=_0xbdc73f[_0x7057('0x3d')][_0x7057('0x3f')]?_0xbdc73f[_0x7057('0x3d')]:_0x32483b[_0x7057('0x3a')];_0xbdc73f['order']=qs[_0x7057('0x43')](_0x12dec4['query'][_0x7057('0x43')]);_0xbdc73f[_0x7057('0x44')]=qs[_0x7057('0x45')](_[_0x7057('0x46')](_0x12dec4['query'],_0x32483b[_0x7057('0x45')]));if(_0x12dec4[_0x7057('0x3b')][_0x7057('0x47')]){_0xbdc73f[_0x7057('0x44')]=_[_0x7057('0x48')](_0xbdc73f['where'],{'$or':_[_0x7057('0x36')](_0xbdc73f[_0x7057('0x3d')],function(_0x4c936e){var _0x36991e={};_0x36991e[_0x4c936e]={'$like':'%'+_0x12dec4['query'][_0x7057('0x47')]+'%'};return _0x36991e;})});}_0xbdc73f=_['merge']({},_0xbdc73f,_0x12dec4[_0x7057('0x49')]);return _0x3f7be1[_0x7057('0x6a')](_0xbdc73f);}})[_0x7057('0x2c')](function(_0x79330f){if(_0x79330f){_0x15ae7c=_0x79330f[_0x7057('0x3f')];if(!_0x12dec4[_0x7057('0x3b')][_0x7057('0x40')](_0x7057('0x41'))){_0xbdc73f[_0x7057('0x27')]=qs[_0x7057('0x27')](_0x12dec4[_0x7057('0x3b')][_0x7057('0x27')]);_0xbdc73f['offset']=qs[_0x7057('0x26')](_0x12dec4[_0x7057('0x3b')][_0x7057('0x26')]);}return _0x3f7be1[_0x7057('0x6a')](_0xbdc73f);}})[_0x7057('0x2c')](function(_0x4d47c4){if(_0x4d47c4){return _0x4d47c4?{'count':_0x15ae7c,'rows':_0x4d47c4}:null;}})[_0x7057('0x2c')](respondWithResult(_0x1c98c2,null))[_0x7057('0x4b')](handleError(_0x1c98c2,null));};exports['addTeams']=function(_0x59b0af,_0x384c12,_0x35442d){var _0x570cf7=_0x59b0af[_0x7057('0x5a')]['ids'];return db[_0x7057('0x6b')][_0x7057('0x60')]({'where':{'id':_0x570cf7},'attributes':['id'],'include':[{'model':db[_0x7057('0x61')],'as':'Agents','attributes':['id','name',_0x7057('0x6c'),_0x7057('0x6d'),_0x7057('0x6e')],'raw':!![]}]})[_0x7057('0x2c')](function(_0x4c2931){if(_0x4c2931){var _0x1989b9=_[_0x7057('0x6f')](_0x4c2931,function(_0x35d88b){var _0x9b1b12=_0x35d88b['get']({'plain':!![]});return _0x9b1b12['Agents'];});return db['WhatsappQueue'][_0x7057('0x55')]({'where':{'id':_0x59b0af[_0x7057('0x4d')]['id']}})[_0x7057('0x2c')](function(_0xa7fe83){return db[_0x7057('0x70')][_0x7057('0x71')](function(_0x1b4228){return _0xa7fe83[_0x7057('0x72')](_0x570cf7,{'transaction':_0x1b4228})[_0x7057('0x2c')](function(){return BPromise['each'](_0x1989b9,function(_0x249c39){return db[_0x7057('0x5e')][_0x7057('0x73')]({'where':{'UserId':_0x249c39['id'],'WhatsappQueueId':_0x59b0af[_0x7057('0x4d')]['id']},'transaction':_0x1b4228});});})[_0x7057('0x2c')](function(){_0x1989b9[_0x7057('0x74')](function(_0x16ead4){socket[_0x7057('0x75')](_0x7057('0x76'),{'UserId':_0x16ead4['id'],'WhatsappQueueId':_0xa7fe83['id']});});});});});}})[_0x7057('0x2c')](respondWithStatusCode(_0x384c12,null))[_0x7057('0x4b')](handleError(_0x384c12,null));};exports['removeTeams']=function(_0x3a5657,_0x213906,_0x4d3b5b){return db['Team']['findAll']({'where':{'id':_0x3a5657[_0x7057('0x3b')][_0x7057('0x77')]},'attributes':['id'],'include':[{'model':db[_0x7057('0x61')],'as':_0x7057('0x78'),'attributes':['id'],'raw':!![]}]})[_0x7057('0x2c')](handleEntityNotFound(_0x213906,null))[_0x7057('0x2c')](function(_0x5ec2f5){var _0xb31f25=_[_0x7057('0x36')](_0x5ec2f5,'id');var _0x4752cf=[];var _0x506c82=[];var _0x48429f=squel['select']();_0x48429f[_0x7057('0x79')](_0x7057('0x7a'))[_0x7057('0x7b')](_0x7057('0x7c'),'tq')[_0x7057('0x7d')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7057('0x44')](_0x7057('0x7e'),_0x3a5657[_0x7057('0x4d')]['id']);for(var _0x47a76a=0x0;_0x47a76a<_0x5ec2f5[_0x7057('0x3f')];_0x47a76a+=0x1){let _0x130d00=_0x5ec2f5[_0x47a76a];for(var _0x3ed4c8=0x0;_0x3ed4c8<_0x130d00[_0x7057('0x78')]['length'];_0x3ed4c8+=0x1){let _0x4d11cb=_0x130d00[_0x7057('0x78')][_0x3ed4c8];var _0x3a3f0b=_0x48429f['clone']();_0x3a3f0b['where'](_0x7057('0x7f'),_0x4d11cb['id']);_0x506c82[_0x7057('0x80')](db[_0x7057('0x70')][_0x7057('0x3b')](_0x3a3f0b[_0x7057('0x81')](),{'type':db[_0x7057('0x70')][_0x7057('0x82')][_0x7057('0x83')]})[_0x7057('0x2c')](function(_0x4da5e1){if(_0x4da5e1[_0x7057('0x3f')]===0x1){return _0x4d11cb['id'];}else{var _0x3a4c54=_['every'](_['map'](_0x4da5e1,_0x7057('0x84')),function(_0x2c2609){return _[_0x7057('0x85')](_0xb31f25,_0x2c2609);});if(_0x3a4c54){return _0x4d11cb['id'];}}}));}}return BPromise[_0x7057('0x86')](_0x506c82)[_0x7057('0x2c')](function(_0x303cb4){_0x4752cf=_(_0x4752cf)[_0x7057('0x87')](_0x303cb4)[_0x7057('0x88')]()[_0x7057('0x89')]();return db[_0x7057('0x37')][_0x7057('0x55')]({'where':{'id':_0x3a5657[_0x7057('0x4d')]['id']}})[_0x7057('0x2c')](function(_0x398f98){return db[_0x7057('0x70')][_0x7057('0x71')](function(_0x36e2c7){return _0x398f98[_0x7057('0x8a')](_0x3a5657[_0x7057('0x3b')][_0x7057('0x77')],{'transaction':_0x36e2c7})[_0x7057('0x2c')](function(){if(!_[_0x7057('0x8b')](_0x4752cf)){return _0x398f98[_0x7057('0x8c')](_0x4752cf,{'transaction':_0x36e2c7});}})[_0x7057('0x2c')](function(){_0x4752cf[_0x7057('0x74')](function(_0x2dcfae){socket[_0x7057('0x75')](_0x7057('0x8d'),{'UserId':_0x2dcfae,'WhatsappQueueId':_0x398f98['id']});});});});});});})[_0x7057('0x2c')](respondWithStatusCode(_0x213906,null))[_0x7057('0x4b')](handleError(_0x213906,null));};exports[_0x7057('0x8e')]=function(_0x4fee2c,_0xeddd58,_0x12450d){return db[_0x7057('0x37')]['find']({'where':{'id':_0x4fee2c[_0x7057('0x4d')]['id']}})[_0x7057('0x2c')](handleEntityNotFound(_0xeddd58,null))['then'](function(_0x7e00bf){if(_0x7e00bf){return _0x7e00bf['addAgents'](_0x4fee2c[_0x7057('0x5a')][_0x7057('0x77')],_[_0x7057('0x8f')](_0x4fee2c['body'],[_0x7057('0x77'),'id'])||{})[_0x7057('0x90')](function(_0x186622){for(var _0x1a2d90=0x0;_0x1a2d90<_0x4fee2c[_0x7057('0x5a')]['ids'][_0x7057('0x3f')];_0x1a2d90+=0x1){socket[_0x7057('0x75')](_0x7057('0x76'),{'UserId':Number(_0x4fee2c[_0x7057('0x5a')][_0x7057('0x77')][_0x1a2d90]),'WhatsappQueueId':Number(_0x4fee2c[_0x7057('0x4d')]['id'])});}return _0x186622;});}})['then'](respondWithResult(_0xeddd58,null))[_0x7057('0x4b')](handleError(_0xeddd58,null));};exports['removeAgents']=function(_0x5e75db,_0x3c551d,_0x5a4736){return db['WhatsappQueue'][_0x7057('0x55')]({'where':{'id':_0x5e75db[_0x7057('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3c551d,null))[_0x7057('0x2c')](function(_0x19f587){if(_0x19f587){return _0x19f587[_0x7057('0x8c')](_0x5e75db['query'][_0x7057('0x77')])[_0x7057('0x2c')](function(){if(_[_0x7057('0x91')](_0x5e75db[_0x7057('0x3b')]['ids'])){for(var _0x5005e5=0x0;_0x5005e5<_0x5e75db[_0x7057('0x3b')][_0x7057('0x77')][_0x7057('0x3f')];_0x5005e5+=0x1){socket[_0x7057('0x75')]('userWhatsappQueue:remove',{'UserId':Number(_0x5e75db[_0x7057('0x3b')][_0x7057('0x77')][_0x5005e5]),'WhatsappQueueId':Number(_0x5e75db[_0x7057('0x4d')]['id'])});}}else{socket['emit'](_0x7057('0x8d'),{'UserId':Number(_0x5e75db[_0x7057('0x3b')]['ids']),'WhatsappQueueId':Number(_0x5e75db['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3c551d,null))['catch'](handleError(_0x3c551d,null));};exports['getAgents']=function(_0x4b5011,_0x32d5c6,_0x4ddb7a){var _0x3737d4={};var _0x54fa64={};var _0x23fb6d;var _0x3e33d5;return db[_0x7057('0x37')][_0x7057('0x5d')]({'where':{'id':_0x4b5011['params']['id']}})[_0x7057('0x2c')](handleEntityNotFound(_0x32d5c6,null))[_0x7057('0x2c')](function(_0x3ce0a8){if(_0x3ce0a8){_0x23fb6d=_0x3ce0a8;_0x54fa64[_0x7057('0x3a')]=_[_0x7057('0x4e')](db[_0x7057('0x61')][_0x7057('0x4f')]);_0x54fa64['query']=_[_0x7057('0x4e')](_0x4b5011[_0x7057('0x3b')]);_0x54fa64['filters']=_[_0x7057('0x3c')](_0x54fa64[_0x7057('0x3a')],_0x54fa64['query']);_0x3737d4[_0x7057('0x3d')]=_[_0x7057('0x3c')](_0x54fa64[_0x7057('0x3a')],qs[_0x7057('0x3e')](_0x4b5011[_0x7057('0x3b')][_0x7057('0x3e')]));_0x3737d4[_0x7057('0x3d')]=_0x3737d4[_0x7057('0x3d')][_0x7057('0x3f')]?_0x3737d4[_0x7057('0x3d')]:_0x54fa64[_0x7057('0x3a')];_0x3737d4[_0x7057('0x42')]=qs[_0x7057('0x43')](_0x4b5011[_0x7057('0x3b')][_0x7057('0x43')]);_0x3737d4[_0x7057('0x44')]=qs[_0x7057('0x45')](_[_0x7057('0x46')](_0x4b5011[_0x7057('0x3b')],_0x54fa64[_0x7057('0x45')]));if(_0x4b5011[_0x7057('0x3b')][_0x7057('0x47')]){_0x3737d4[_0x7057('0x44')]=_[_0x7057('0x48')](_0x3737d4[_0x7057('0x44')],{'$or':_[_0x7057('0x36')](_0x3737d4[_0x7057('0x3d')],function(_0x17794a){var _0x54063d={};_0x54063d[_0x17794a]={'$like':'%'+_0x4b5011[_0x7057('0x3b')][_0x7057('0x47')]+'%'};return _0x54063d;})});}_0x3737d4=_[_0x7057('0x48')]({},_0x3737d4,_0x4b5011[_0x7057('0x49')]);return _0x23fb6d[_0x7057('0x92')](_0x3737d4);}})[_0x7057('0x2c')](function(_0x4ad237){if(_0x4ad237){_0x3e33d5=_0x4ad237[_0x7057('0x3f')];if(!_0x4b5011[_0x7057('0x3b')]['hasOwnProperty'](_0x7057('0x41'))){_0x3737d4['limit']=qs[_0x7057('0x27')](_0x4b5011['query'][_0x7057('0x27')]);_0x3737d4[_0x7057('0x26')]=qs['offset'](_0x4b5011[_0x7057('0x3b')]['offset']);}return _0x23fb6d[_0x7057('0x92')](_0x3737d4);}})[_0x7057('0x2c')](function(_0x3ab374){if(_0x3ab374){return _0x3ab374?{'count':_0x3e33d5,'rows':_0x3ab374}:null;}})[_0x7057('0x2c')](respondWithResult(_0x32d5c6,null))[_0x7057('0x4b')](handleError(_0x32d5c6,null));};
\ No newline at end of file
+var _0xaa40=['model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','WhatsappQueue','includeAll','include','findAll','rows','catch','show','params','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserWhatsappQueue','WhatsappQueueId','filter','User','findAndCountAll','agent','whatsappPause','format','SIP','createdAt','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','includes','union','compact','value','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','WhatsappQueues','UserProfileResource','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key'];(function(_0xe32bc8,_0x44287e){var _0x1ff259=function(_0x4706d6){while(--_0x4706d6){_0xe32bc8['push'](_0xe32bc8['shift']());}};_0x1ff259(++_0x44287e);}(_0xaa40,0x173));var _0x0aa4=function(_0x5e75e4,_0x469fb9){_0x5e75e4=_0x5e75e4-0x0;var _0x289bd9=_0xaa40[_0x5e75e4];return _0x289bd9;};'use strict';var emlformat=require(_0x0aa4('0x0'));var rimraf=require(_0x0aa4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0aa4('0x2'));var rp=require(_0x0aa4('0x3'));var moment=require(_0x0aa4('0x4'));var BPromise=require(_0x0aa4('0x5'));var Mustache=require(_0x0aa4('0x6'));var util=require(_0x0aa4('0x7'));var path=require(_0x0aa4('0x8'));var sox=require(_0x0aa4('0x9'));var csv=require(_0x0aa4('0xa'));var ejs=require(_0x0aa4('0xb'));var fs=require('fs');var fs_extra=require(_0x0aa4('0xc'));var _=require(_0x0aa4('0xd'));var squel=require(_0x0aa4('0xe'));var crypto=require(_0x0aa4('0xf'));var jsforce=require(_0x0aa4('0x10'));var deskjs=require(_0x0aa4('0x11'));var toCsv=require('to-csv');var querystring=require(_0x0aa4('0x12'));var Papa=require('papaparse');var Redis=require(_0x0aa4('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0aa4('0x14'));var logger=require(_0x0aa4('0x15'))(_0x0aa4('0x16'));var utils=require(_0x0aa4('0x17'));var config=require(_0x0aa4('0x18'));var licenseUtil=require(_0x0aa4('0x19'));var db=require(_0x0aa4('0x1a'))['db'];config['redis']=_[_0x0aa4('0x1b')](config[_0x0aa4('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0aa4('0x1d'))(new Redis(config['redis']));require('./whatsappQueue.socket')['register'](socket);function respondWithStatusCode(_0x559df4,_0x295a93){_0x295a93=_0x295a93||0xcc;return function(_0x4e335d){if(_0x4e335d){return _0x559df4[_0x0aa4('0x1e')](_0x295a93);}return _0x559df4[_0x0aa4('0x1f')](_0x295a93)[_0x0aa4('0x20')]();};}function respondWithResult(_0x5bef82,_0x11432b){_0x11432b=_0x11432b||0xc8;return function(_0x5bc4b9){if(_0x5bc4b9){return _0x5bef82[_0x0aa4('0x1f')](_0x11432b)[_0x0aa4('0x21')](_0x5bc4b9);}};}function respondWithFilteredResult(_0x59a56b,_0x48e77e){return function(_0x2d8e44){if(_0x2d8e44){var _0x1757b5=typeof _0x48e77e['offset']===_0x0aa4('0x22')&&typeof _0x48e77e['limit']===_0x0aa4('0x22');var _0xeb3516=_0x2d8e44[_0x0aa4('0x23')];var _0x27a231=_0x1757b5?0x0:_0x48e77e['offset'];var _0x50aca8=_0x1757b5?_0x2d8e44[_0x0aa4('0x23')]:_0x48e77e[_0x0aa4('0x24')]+_0x48e77e[_0x0aa4('0x25')];var _0x9c0d73;if(_0x50aca8>=_0xeb3516){_0x50aca8=_0xeb3516;_0x9c0d73=0xc8;}else{_0x9c0d73=0xce;}_0x59a56b[_0x0aa4('0x1f')](_0x9c0d73);return _0x59a56b[_0x0aa4('0x26')](_0x0aa4('0x27'),_0x27a231+'-'+_0x50aca8+'/'+_0xeb3516)[_0x0aa4('0x21')](_0x2d8e44);}return null;};}function patchUpdates(_0x3197b1){return function(_0x3344fd){try{jsonpatch[_0x0aa4('0x28')](_0x3344fd,_0x3197b1,!![]);}catch(_0xd4cad6){return BPromise[_0x0aa4('0x29')](_0xd4cad6);}return _0x3344fd[_0x0aa4('0x2a')]();};}function saveUpdates(_0x3e2560,_0x49276b){return function(_0xa4ccaa){if(_0xa4ccaa){return _0xa4ccaa[_0x0aa4('0x2b')](_0x3e2560)['then'](function(_0x210473){return _0x210473;});}return null;};}function removeEntity(_0x3169a2,_0x22296b){return function(_0x3e0525){if(_0x3e0525){return _0x3e0525['destroy']()[_0x0aa4('0x2c')](function(){var _0x2789e5=_0x3e0525[_0x0aa4('0x2d')]({'plain':!![]});var _0x94f52b=_0x0aa4('0x2e');return db[_0x0aa4('0x2f')][_0x0aa4('0x30')]({'where':{'type':_0x94f52b,'resourceId':_0x2789e5['id']}})[_0x0aa4('0x2c')](function(){return _0x3e0525;});})['then'](function(){_0x3169a2[_0x0aa4('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40ecc0,_0x49b619){return function(_0x2eb6e0){if(!_0x2eb6e0){_0x40ecc0[_0x0aa4('0x1e')](0x194);}return _0x2eb6e0;};}function handleError(_0x1ccf62,_0xeda27b){_0xeda27b=_0xeda27b||0x1f4;return function(_0x395acf){logger[_0x0aa4('0x31')](_0x395acf[_0x0aa4('0x32')]);if(_0x395acf['name']){delete _0x395acf[_0x0aa4('0x33')];}_0x1ccf62['status'](_0xeda27b)['send'](_0x395acf);};}exports[_0x0aa4('0x34')]=function(_0x3d554a,_0x49782f){var _0x4e13a8={},_0x16ee39={},_0x27b078={'count':0x0,'rows':[]};var _0x58d964=_[_0x0aa4('0x35')](db['WhatsappQueue'][_0x0aa4('0x36')],function(_0xef9ea1){return{'name':_0xef9ea1[_0x0aa4('0x37')],'type':_0xef9ea1[_0x0aa4('0x38')][_0x0aa4('0x39')]};});_0x16ee39[_0x0aa4('0x3a')]=_[_0x0aa4('0x35')](_0x58d964,_0x0aa4('0x33'));_0x16ee39['query']=_[_0x0aa4('0x3b')](_0x3d554a['query']);_0x16ee39[_0x0aa4('0x3c')]=_[_0x0aa4('0x3d')](_0x16ee39[_0x0aa4('0x3a')],_0x16ee39[_0x0aa4('0x3e')]);_0x4e13a8['attributes']=_[_0x0aa4('0x3d')](_0x16ee39[_0x0aa4('0x3a')],qs[_0x0aa4('0x3f')](_0x3d554a[_0x0aa4('0x3e')][_0x0aa4('0x3f')]));_0x4e13a8[_0x0aa4('0x40')]=_0x4e13a8['attributes'][_0x0aa4('0x41')]?_0x4e13a8[_0x0aa4('0x40')]:_0x16ee39[_0x0aa4('0x3a')];if(!_0x3d554a['query'][_0x0aa4('0x42')](_0x0aa4('0x43'))){_0x4e13a8[_0x0aa4('0x25')]=qs[_0x0aa4('0x25')](_0x3d554a[_0x0aa4('0x3e')]['limit']);_0x4e13a8[_0x0aa4('0x24')]=qs[_0x0aa4('0x24')](_0x3d554a[_0x0aa4('0x3e')]['offset']);}_0x4e13a8[_0x0aa4('0x44')]=qs['sort'](_0x3d554a[_0x0aa4('0x3e')][_0x0aa4('0x45')]);_0x4e13a8[_0x0aa4('0x46')]=qs[_0x0aa4('0x3c')](_[_0x0aa4('0x47')](_0x3d554a['query'],_0x16ee39[_0x0aa4('0x3c')]),_0x58d964);if(_0x3d554a[_0x0aa4('0x3e')]['filter']){_0x4e13a8['where']=_[_0x0aa4('0x48')](_0x4e13a8[_0x0aa4('0x46')],{'$or':_[_0x0aa4('0x35')](_0x58d964,function(_0x1c4ada){if(_0x1c4ada[_0x0aa4('0x38')]!==_0x0aa4('0x49')){var _0x5b0140={};_0x5b0140[_0x1c4ada[_0x0aa4('0x33')]]={'$like':'%'+_0x3d554a['query']['filter']+'%'};return _0x5b0140;}})});}_0x4e13a8=_[_0x0aa4('0x48')]({},_0x4e13a8,_0x3d554a[_0x0aa4('0x4a')]);var _0x48902c={'where':_0x4e13a8[_0x0aa4('0x46')]};return db[_0x0aa4('0x4b')][_0x0aa4('0x23')](_0x48902c)[_0x0aa4('0x2c')](function(_0x49f709){_0x27b078[_0x0aa4('0x23')]=_0x49f709;if(_0x3d554a[_0x0aa4('0x3e')][_0x0aa4('0x4c')]){_0x4e13a8[_0x0aa4('0x4d')]=[{'all':!![]}];}return db[_0x0aa4('0x4b')][_0x0aa4('0x4e')](_0x4e13a8);})[_0x0aa4('0x2c')](function(_0x236c55){_0x27b078[_0x0aa4('0x4f')]=_0x236c55;return _0x27b078;})[_0x0aa4('0x2c')](respondWithFilteredResult(_0x49782f,_0x4e13a8))[_0x0aa4('0x50')](handleError(_0x49782f,null));};exports[_0x0aa4('0x51')]=function(_0x473a19,_0x3c6808){var _0x5307c7={'raw':!![],'where':{'id':_0x473a19[_0x0aa4('0x52')]['id']}},_0x2cbe81={};_0x2cbe81['model']=_[_0x0aa4('0x3b')](db[_0x0aa4('0x4b')]['rawAttributes']);_0x2cbe81[_0x0aa4('0x3e')]=_['keys'](_0x473a19['query']);_0x2cbe81[_0x0aa4('0x3c')]=_[_0x0aa4('0x3d')](_0x2cbe81['model'],_0x2cbe81[_0x0aa4('0x3e')]);_0x5307c7['attributes']=_[_0x0aa4('0x3d')](_0x2cbe81[_0x0aa4('0x3a')],qs[_0x0aa4('0x3f')](_0x473a19[_0x0aa4('0x3e')][_0x0aa4('0x3f')]));_0x5307c7[_0x0aa4('0x40')]=_0x5307c7['attributes']['length']?_0x5307c7['attributes']:_0x2cbe81[_0x0aa4('0x3a')];if(_0x473a19[_0x0aa4('0x3e')][_0x0aa4('0x4c')]){_0x5307c7[_0x0aa4('0x4d')]=[{'all':!![]}];}_0x5307c7=_['merge']({},_0x5307c7,_0x473a19[_0x0aa4('0x4a')]);return db['WhatsappQueue']['find'](_0x5307c7)[_0x0aa4('0x2c')](handleEntityNotFound(_0x3c6808,null))[_0x0aa4('0x2c')](respondWithResult(_0x3c6808,null))[_0x0aa4('0x50')](handleError(_0x3c6808,null));};exports[_0x0aa4('0x53')]=function(_0x2e64d7,_0x34b960){return db[_0x0aa4('0x4b')][_0x0aa4('0x53')](_0x2e64d7[_0x0aa4('0x54')],{})[_0x0aa4('0x2c')](function(_0x468717){var _0x52afa2=_0x2e64d7['user'][_0x0aa4('0x2d')]({'plain':!![]});if(!_0x52afa2)throw new Error(_0x0aa4('0x55'));if(_0x52afa2['role']===_0x0aa4('0x56')){var _0x2f5ff0=_0x468717[_0x0aa4('0x2d')]({'plain':!![]});var _0x1208c1=_0x0aa4('0x2e');return db['UserProfileSection'][_0x0aa4('0x57')]({'where':{'name':_0x1208c1,'userProfileId':_0x52afa2[_0x0aa4('0x58')]},'raw':!![]})[_0x0aa4('0x2c')](function(_0x31adc5){if(_0x31adc5&&_0x31adc5[_0x0aa4('0x59')]===0x0){return db['UserProfileResource'][_0x0aa4('0x53')]({'name':_0x2f5ff0[_0x0aa4('0x33')],'resourceId':_0x2f5ff0['id'],'type':_0x31adc5[_0x0aa4('0x33')],'sectionId':_0x31adc5['id']},{})['then'](function(){return _0x468717;});}else{return _0x468717;}})['catch'](function(_0x45c9cb){logger[_0x0aa4('0x31')](_0x0aa4('0x5a'),_0x45c9cb);throw _0x45c9cb;});}return _0x468717;})['then'](respondWithResult(_0x34b960,0xc9))['catch'](handleError(_0x34b960,null));};exports[_0x0aa4('0x2b')]=function(_0x47157d,_0x38bf20){if(_0x47157d[_0x0aa4('0x54')]['id']){delete _0x47157d[_0x0aa4('0x54')]['id'];}return db[_0x0aa4('0x4b')][_0x0aa4('0x57')]({'where':{'id':_0x47157d[_0x0aa4('0x52')]['id']}})['then'](handleEntityNotFound(_0x38bf20,null))['then'](saveUpdates(_0x47157d[_0x0aa4('0x54')],null))[_0x0aa4('0x2c')](respondWithResult(_0x38bf20,null))[_0x0aa4('0x50')](handleError(_0x38bf20,null));};exports[_0x0aa4('0x30')]=function(_0x7c01f,_0x5b4c07){return db[_0x0aa4('0x4b')][_0x0aa4('0x57')]({'where':{'id':_0x7c01f[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0x5b4c07,null))[_0x0aa4('0x2c')](removeEntity(_0x5b4c07,null))['catch'](handleError(_0x5b4c07,null));};exports[_0x0aa4('0x5b')]=function(_0x2a3511,_0x1ab965){return db[_0x0aa4('0x4b')][_0x0aa4('0x5b')]()[_0x0aa4('0x2c')](respondWithResult(_0x1ab965,null))[_0x0aa4('0x50')](handleError(_0x1ab965,null));};exports[_0x0aa4('0x5c')]=function(_0x3297fe,_0x3c7c94,_0x1b4049){var _0x181d0d={'raw':!![],'where':{}},_0x1895ac={},_0x4cf7ec;return db[_0x0aa4('0x4b')]['findOne']({'where':{'id':_0x3297fe[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0x3c7c94,null))[_0x0aa4('0x2c')](function(_0x1ffee3){if(_0x1ffee3){_0x4cf7ec=_0x1ffee3['get']({'plain':!![]});_0x1895ac['model']=_[_0x0aa4('0x3b')](db[_0x0aa4('0x5d')][_0x0aa4('0x36')]);_0x1895ac['query']=_['keys'](_0x3297fe[_0x0aa4('0x3e')]);_0x1895ac[_0x0aa4('0x3c')]=_[_0x0aa4('0x3d')](_0x1895ac['model'],_0x1895ac['query']);_0x181d0d[_0x0aa4('0x40')]=_[_0x0aa4('0x3d')](_0x1895ac[_0x0aa4('0x3a')],qs[_0x0aa4('0x3f')](_0x3297fe[_0x0aa4('0x3e')][_0x0aa4('0x3f')]));_0x181d0d[_0x0aa4('0x40')]=_0x181d0d[_0x0aa4('0x40')][_0x0aa4('0x41')]?_0x181d0d[_0x0aa4('0x40')]:_0x1895ac[_0x0aa4('0x3a')];if(!_0x3297fe[_0x0aa4('0x3e')][_0x0aa4('0x42')](_0x0aa4('0x43'))){_0x181d0d[_0x0aa4('0x25')]=qs['limit'](_0x3297fe[_0x0aa4('0x3e')][_0x0aa4('0x25')]);_0x181d0d['offset']=qs[_0x0aa4('0x24')](_0x3297fe[_0x0aa4('0x3e')]['offset']);}_0x181d0d['order']=qs['sort'](_0x3297fe['query'][_0x0aa4('0x45')]);_0x181d0d['where']=qs[_0x0aa4('0x3c')](_[_0x0aa4('0x47')](_0x3297fe[_0x0aa4('0x3e')],_0x1895ac['filters']));_0x181d0d[_0x0aa4('0x46')][_0x0aa4('0x5e')]=_0x1ffee3['id'];if(_0x3297fe['query']['filter']){_0x181d0d[_0x0aa4('0x46')]=_[_0x0aa4('0x48')](_0x181d0d[_0x0aa4('0x46')],{'$or':_[_0x0aa4('0x35')](_0x181d0d[_0x0aa4('0x40')],function(_0x2c6221){var _0x537706={};_0x537706[_0x2c6221]={'$like':'%'+_0x3297fe['query'][_0x0aa4('0x5f')]+'%'};return _0x537706;})});}_0x181d0d=_[_0x0aa4('0x48')]({},_0x181d0d,_0x3297fe['options']);return db[_0x0aa4('0x5d')]['findAll'](_0x181d0d);}})[_0x0aa4('0x2c')](function(_0x276d94){if(_0x276d94){return db[_0x0aa4('0x60')][_0x0aa4('0x61')]({'where':{'id':_[_0x0aa4('0x35')](_0x276d94,'UserId'),'role':_0x0aa4('0x62')},'attributes':['id',_0x0aa4('0x33'),_0x0aa4('0x63'),'updatedAt','createdAt']});}})[_0x0aa4('0x2c')](function(_0x55f8a9){if(_0x55f8a9){return{'count':_0x55f8a9[_0x0aa4('0x23')],'rows':_['map'](_0x55f8a9[_0x0aa4('0x4f')],function(_0x385f4b){return{'membername':_0x385f4b[_0x0aa4('0x33')],'UserId':_0x385f4b['id'],'queue_name':_0x4cf7ec[_0x0aa4('0x33')],'WhatsappQueueId':_0x4cf7ec['id'],'interface':util[_0x0aa4('0x64')]('%s/%s',_0x0aa4('0x65'),_0x385f4b[_0x0aa4('0x33')]),'penalty':0x0,'paused':_0x385f4b[_0x0aa4('0x63')],'createdAt':_0x385f4b[_0x0aa4('0x66')],'updatedAt':_0x385f4b[_0x0aa4('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0aa4('0x2c')](respondWithFilteredResult(_0x3c7c94,_0x181d0d))[_0x0aa4('0x50')](handleError(_0x3c7c94,null));};exports[_0x0aa4('0x68')]=function(_0x57c1d9,_0x831fd0,_0x4280c1){var _0xf28b9e={};var _0x2e5ee9={};var _0x3ba313;var _0x11d02e;return db[_0x0aa4('0x4b')][_0x0aa4('0x69')]({'where':{'id':_0x57c1d9['params']['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0x831fd0,null))[_0x0aa4('0x2c')](function(_0x1cdb95){if(_0x1cdb95){_0x3ba313=_0x1cdb95;_0x2e5ee9['model']=_[_0x0aa4('0x3b')](db[_0x0aa4('0x6a')][_0x0aa4('0x36')]);_0x2e5ee9['query']=_[_0x0aa4('0x3b')](_0x57c1d9['query']);_0x2e5ee9[_0x0aa4('0x3c')]=_[_0x0aa4('0x3d')](_0x2e5ee9[_0x0aa4('0x3a')],_0x2e5ee9[_0x0aa4('0x3e')]);_0xf28b9e['attributes']=_[_0x0aa4('0x3d')](_0x2e5ee9[_0x0aa4('0x3a')],qs[_0x0aa4('0x3f')](_0x57c1d9[_0x0aa4('0x3e')][_0x0aa4('0x3f')]));_0xf28b9e[_0x0aa4('0x40')]=_0xf28b9e['attributes'][_0x0aa4('0x41')]?_0xf28b9e[_0x0aa4('0x40')]:_0x2e5ee9[_0x0aa4('0x3a')];_0xf28b9e[_0x0aa4('0x44')]=qs[_0x0aa4('0x45')](_0x57c1d9[_0x0aa4('0x3e')][_0x0aa4('0x45')]);_0xf28b9e['where']=qs[_0x0aa4('0x3c')](_['pick'](_0x57c1d9['query'],_0x2e5ee9['filters']));if(_0x57c1d9[_0x0aa4('0x3e')][_0x0aa4('0x5f')]){_0xf28b9e[_0x0aa4('0x46')]=_[_0x0aa4('0x48')](_0xf28b9e[_0x0aa4('0x46')],{'$or':_[_0x0aa4('0x35')](_0xf28b9e['attributes'],function(_0x212b9b){var _0x519052={};_0x519052[_0x212b9b]={'$like':'%'+_0x57c1d9[_0x0aa4('0x3e')]['filter']+'%'};return _0x519052;})});}_0xf28b9e=_[_0x0aa4('0x48')]({},_0xf28b9e,_0x57c1d9[_0x0aa4('0x4a')]);return _0x3ba313['getTeams'](_0xf28b9e);}})[_0x0aa4('0x2c')](function(_0x92e033){if(_0x92e033){_0x11d02e=_0x92e033[_0x0aa4('0x41')];if(!_0x57c1d9[_0x0aa4('0x3e')][_0x0aa4('0x42')](_0x0aa4('0x43'))){_0xf28b9e[_0x0aa4('0x25')]=qs[_0x0aa4('0x25')](_0x57c1d9[_0x0aa4('0x3e')]['limit']);_0xf28b9e[_0x0aa4('0x24')]=qs[_0x0aa4('0x24')](_0x57c1d9[_0x0aa4('0x3e')][_0x0aa4('0x24')]);}return _0x3ba313[_0x0aa4('0x68')](_0xf28b9e);}})[_0x0aa4('0x2c')](function(_0x36fced){if(_0x36fced){return _0x36fced?{'count':_0x11d02e,'rows':_0x36fced}:null;}})[_0x0aa4('0x2c')](respondWithResult(_0x831fd0,null))[_0x0aa4('0x50')](handleError(_0x831fd0,null));};exports[_0x0aa4('0x6b')]=function(_0x264b24,_0x40d4d3,_0xe32158){var _0x3f6f28=_0x264b24['body'][_0x0aa4('0x6c')];return db[_0x0aa4('0x6a')][_0x0aa4('0x4e')]({'where':{'id':_0x3f6f28},'attributes':['id'],'include':[{'model':db[_0x0aa4('0x60')],'as':_0x0aa4('0x6d'),'attributes':['id',_0x0aa4('0x33'),_0x0aa4('0x6e'),_0x0aa4('0x6f'),_0x0aa4('0x70')],'raw':!![]}]})[_0x0aa4('0x2c')](function(_0x3efdca){if(_0x3efdca){var _0x4e61bd=_[_0x0aa4('0x71')](_0x3efdca,function(_0x5c292c){var _0x868fa0=_0x5c292c[_0x0aa4('0x2d')]({'plain':!![]});return _0x868fa0[_0x0aa4('0x6d')];});return db[_0x0aa4('0x4b')][_0x0aa4('0x57')]({'where':{'id':_0x264b24[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](function(_0x3c714f){return db[_0x0aa4('0x72')]['transaction'](function(_0x46bdbc){return _0x3c714f[_0x0aa4('0x6b')](_0x3f6f28,{'transaction':_0x46bdbc})[_0x0aa4('0x2c')](function(){return BPromise[_0x0aa4('0x73')](_0x4e61bd,function(_0x46a366){return db[_0x0aa4('0x5d')][_0x0aa4('0x74')]({'where':{'UserId':_0x46a366['id'],'WhatsappQueueId':_0x264b24['params']['id']},'transaction':_0x46bdbc});});})['then'](function(){_0x4e61bd['forEach'](function(_0x7c3816){socket[_0x0aa4('0x75')](_0x0aa4('0x76'),{'UserId':_0x7c3816['id'],'WhatsappQueueId':_0x3c714f['id']});});});});});}})[_0x0aa4('0x2c')](respondWithStatusCode(_0x40d4d3,null))[_0x0aa4('0x50')](handleError(_0x40d4d3,null));};exports[_0x0aa4('0x77')]=function(_0x7c7688,_0xfc3b00,_0x240299){return db[_0x0aa4('0x6a')][_0x0aa4('0x4e')]({'where':{'id':_0x7c7688[_0x0aa4('0x3e')][_0x0aa4('0x6c')]},'attributes':['id'],'include':[{'model':db[_0x0aa4('0x60')],'as':_0x0aa4('0x6d'),'attributes':['id'],'raw':!![]}]})[_0x0aa4('0x2c')](handleEntityNotFound(_0xfc3b00,null))[_0x0aa4('0x2c')](function(_0x126ddb){var _0x51df87=_['map'](_0x126ddb,'id');var _0x1eb3f9=[];var _0x58af83=[];var _0x40b2df=squel['select']();_0x40b2df[_0x0aa4('0x78')](_0x0aa4('0x79'))['from']('team_has_whatsapp_queues','tq')['join']('user_has_teams','ut',_0x0aa4('0x7a'))[_0x0aa4('0x46')](_0x0aa4('0x7b'),_0x7c7688[_0x0aa4('0x52')]['id']);for(var _0x38ca8f=0x0;_0x38ca8f<_0x126ddb[_0x0aa4('0x41')];_0x38ca8f+=0x1){let _0x372f8b=_0x126ddb[_0x38ca8f];for(var _0x26d109=0x0;_0x26d109<_0x372f8b[_0x0aa4('0x6d')][_0x0aa4('0x41')];_0x26d109+=0x1){let _0x28e2a4=_0x372f8b[_0x0aa4('0x6d')][_0x26d109];var _0x1ecfba=_0x40b2df[_0x0aa4('0x7c')]();_0x1ecfba['where'](_0x0aa4('0x7d'),_0x28e2a4['id']);_0x58af83[_0x0aa4('0x7e')](db[_0x0aa4('0x72')][_0x0aa4('0x3e')](_0x1ecfba[_0x0aa4('0x7f')](),{'type':db[_0x0aa4('0x72')][_0x0aa4('0x80')][_0x0aa4('0x81')]})[_0x0aa4('0x2c')](function(_0x26d995){if(_0x26d995[_0x0aa4('0x41')]===0x1){return _0x28e2a4['id'];}else{var _0x1331f9=_['every'](_[_0x0aa4('0x35')](_0x26d995,'TeamId'),function(_0x42fdd9){return _[_0x0aa4('0x82')](_0x51df87,_0x42fdd9);});if(_0x1331f9){return _0x28e2a4['id'];}}}));}}return BPromise['all'](_0x58af83)['then'](function(_0x459f05){_0x1eb3f9=_(_0x1eb3f9)[_0x0aa4('0x83')](_0x459f05)[_0x0aa4('0x84')]()[_0x0aa4('0x85')]();return db[_0x0aa4('0x4b')][_0x0aa4('0x57')]({'where':{'id':_0x7c7688[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](function(_0x2226f7){return db[_0x0aa4('0x72')]['transaction'](function(_0x37e823){return _0x2226f7['removeTeams'](_0x7c7688[_0x0aa4('0x3e')][_0x0aa4('0x6c')],{'transaction':_0x37e823})[_0x0aa4('0x2c')](function(){if(!_[_0x0aa4('0x86')](_0x1eb3f9)){return _0x2226f7[_0x0aa4('0x87')](_0x1eb3f9,{'transaction':_0x37e823});}})[_0x0aa4('0x2c')](function(){_0x1eb3f9[_0x0aa4('0x88')](function(_0x5bc64c){socket['emit'](_0x0aa4('0x89'),{'UserId':_0x5bc64c,'WhatsappQueueId':_0x2226f7['id']});});});});});});})[_0x0aa4('0x2c')](respondWithStatusCode(_0xfc3b00,null))[_0x0aa4('0x50')](handleError(_0xfc3b00,null));};exports[_0x0aa4('0x8a')]=function(_0x534b0a,_0x4733f5,_0x36cc0d){return db[_0x0aa4('0x4b')]['find']({'where':{'id':_0x534b0a[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0x4733f5,null))[_0x0aa4('0x2c')](function(_0x159f79){if(_0x159f79){return _0x159f79[_0x0aa4('0x8a')](_0x534b0a['body'][_0x0aa4('0x6c')],_[_0x0aa4('0x8b')](_0x534b0a['body'],[_0x0aa4('0x6c'),'id'])||{})[_0x0aa4('0x8c')](function(_0x505839){for(var _0x899fa0=0x0;_0x899fa0<_0x534b0a[_0x0aa4('0x54')][_0x0aa4('0x6c')][_0x0aa4('0x41')];_0x899fa0+=0x1){socket[_0x0aa4('0x75')](_0x0aa4('0x76'),{'UserId':Number(_0x534b0a[_0x0aa4('0x54')][_0x0aa4('0x6c')][_0x899fa0]),'WhatsappQueueId':Number(_0x534b0a['params']['id'])});}return _0x505839;});}})[_0x0aa4('0x2c')](respondWithResult(_0x4733f5,null))[_0x0aa4('0x50')](handleError(_0x4733f5,null));};exports[_0x0aa4('0x87')]=function(_0x2d49d7,_0xe1238a,_0x3aa84e){return db[_0x0aa4('0x4b')][_0x0aa4('0x57')]({'where':{'id':_0x2d49d7['params']['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0xe1238a,null))['then'](function(_0x587208){if(_0x587208){return _0x587208[_0x0aa4('0x87')](_0x2d49d7[_0x0aa4('0x3e')][_0x0aa4('0x6c')])[_0x0aa4('0x2c')](function(){if(_[_0x0aa4('0x8d')](_0x2d49d7[_0x0aa4('0x3e')][_0x0aa4('0x6c')])){for(var _0x3140da=0x0;_0x3140da<_0x2d49d7[_0x0aa4('0x3e')][_0x0aa4('0x6c')][_0x0aa4('0x41')];_0x3140da+=0x1){socket[_0x0aa4('0x75')](_0x0aa4('0x89'),{'UserId':Number(_0x2d49d7['query'][_0x0aa4('0x6c')][_0x3140da]),'WhatsappQueueId':Number(_0x2d49d7[_0x0aa4('0x52')]['id'])});}}else{socket['emit']('userWhatsappQueue:remove',{'UserId':Number(_0x2d49d7[_0x0aa4('0x3e')][_0x0aa4('0x6c')]),'WhatsappQueueId':Number(_0x2d49d7[_0x0aa4('0x52')]['id'])});}});}})[_0x0aa4('0x2c')](respondWithStatusCode(_0xe1238a,null))['catch'](handleError(_0xe1238a,null));};exports[_0x0aa4('0x8e')]=function(_0x4fad39,_0xa25820,_0x31d58c){var _0x1b37ed={};var _0x5c0dde={};var _0x1e672a;var _0x1ba2ca;return db[_0x0aa4('0x4b')][_0x0aa4('0x69')]({'where':{'id':_0x4fad39[_0x0aa4('0x52')]['id']}})[_0x0aa4('0x2c')](handleEntityNotFound(_0xa25820,null))[_0x0aa4('0x2c')](function(_0x12d366){if(_0x12d366){_0x1e672a=_0x12d366;_0x5c0dde[_0x0aa4('0x3a')]=_[_0x0aa4('0x3b')](db[_0x0aa4('0x60')][_0x0aa4('0x36')]);_0x5c0dde['query']=_['keys'](_0x4fad39[_0x0aa4('0x3e')]);_0x5c0dde['filters']=_[_0x0aa4('0x3d')](_0x5c0dde[_0x0aa4('0x3a')],_0x5c0dde['query']);_0x1b37ed['attributes']=_['intersection'](_0x5c0dde[_0x0aa4('0x3a')],qs['fields'](_0x4fad39['query'][_0x0aa4('0x3f')]));_0x1b37ed['attributes']=_0x1b37ed[_0x0aa4('0x40')]['length']?_0x1b37ed[_0x0aa4('0x40')]:_0x5c0dde['model'];_0x1b37ed[_0x0aa4('0x44')]=qs[_0x0aa4('0x45')](_0x4fad39[_0x0aa4('0x3e')][_0x0aa4('0x45')]);_0x1b37ed[_0x0aa4('0x46')]=qs[_0x0aa4('0x3c')](_[_0x0aa4('0x47')](_0x4fad39[_0x0aa4('0x3e')],_0x5c0dde[_0x0aa4('0x3c')]));if(_0x4fad39[_0x0aa4('0x3e')][_0x0aa4('0x5f')]){_0x1b37ed[_0x0aa4('0x46')]=_[_0x0aa4('0x48')](_0x1b37ed['where'],{'$or':_[_0x0aa4('0x35')](_0x1b37ed[_0x0aa4('0x40')],function(_0x254c83){var _0x4cbabb={};_0x4cbabb[_0x254c83]={'$like':'%'+_0x4fad39[_0x0aa4('0x3e')]['filter']+'%'};return _0x4cbabb;})});}_0x1b37ed=_[_0x0aa4('0x48')]({},_0x1b37ed,_0x4fad39[_0x0aa4('0x4a')]);return _0x1e672a[_0x0aa4('0x8e')](_0x1b37ed);}})[_0x0aa4('0x2c')](function(_0x11feab){if(_0x11feab){_0x1ba2ca=_0x11feab['length'];if(!_0x4fad39[_0x0aa4('0x3e')][_0x0aa4('0x42')](_0x0aa4('0x43'))){_0x1b37ed['limit']=qs['limit'](_0x4fad39[_0x0aa4('0x3e')][_0x0aa4('0x25')]);_0x1b37ed['offset']=qs[_0x0aa4('0x24')](_0x4fad39['query'][_0x0aa4('0x24')]);}return _0x1e672a[_0x0aa4('0x8e')](_0x1b37ed);}})['then'](function(_0x3fb80f){if(_0x3fb80f){return _0x3fb80f?{'count':_0x1ba2ca,'rows':_0x3fb80f}:null;}})['then'](respondWithResult(_0xa25820,null))['catch'](handleError(_0xa25820,null));};
\ No newline at end of file
index 9da90a4..c0117fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ed=['exports','events','WhatsappQueue','save','remove','emit','hasOwnProperty','hook'];(function(_0x40f310,_0x33f8ba){var _0x414b2d=function(_0x23aa85){while(--_0x23aa85){_0x40f310['push'](_0x40f310['shift']());}};_0x414b2d(++_0x33f8ba);}(_0xa9ed,0x121));var _0xda9e=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xa9ed[_0x1573ea];return _0x51c0e2;};'use strict';var EventEmitter=require(_0xda9e('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xda9e('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xda9e('0x2'),'afterUpdate':'update','afterDestroy':_0xda9e('0x3')};function emitEvent(_0x51ce81){return function(_0x570022,_0x7fa8a4,_0x38ebfb){WhatsappQueueEvents[_0xda9e('0x4')](_0x51ce81+':'+_0x570022['id'],_0x570022);WhatsappQueueEvents[_0xda9e('0x4')](_0x51ce81,_0x570022);_0x38ebfb(null);};}for(var e in events){if(events[_0xda9e('0x5')](e)){var event=events[e];WhatsappQueue[_0xda9e('0x6')](e,emitEvent(event));}}module[_0xda9e('0x7')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0xf155=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x2f57b2,_0xa8e91a){var _0x5ace77=function(_0x59c00a){while(--_0x59c00a){_0x2f57b2['push'](_0x2f57b2['shift']());}};_0x5ace77(++_0xa8e91a);}(_0xf155,0x174));var _0x5f15=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0xf155[_0x55e1d1];return _0x1165db;};'use strict';var EventEmitter=require(_0x5f15('0x0'));var WhatsappQueue=require(_0x5f15('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x5f15('0x2')](0x0);var events={'afterCreate':_0x5f15('0x3'),'afterUpdate':'update','afterDestroy':_0x5f15('0x4')};function emitEvent(_0x58f3de){return function(_0x52ac7d,_0x2163ce,_0x3ffaf6){WhatsappQueueEvents[_0x5f15('0x5')](_0x58f3de+':'+_0x52ac7d['id'],_0x52ac7d);WhatsappQueueEvents[_0x5f15('0x5')](_0x58f3de,_0x52ac7d);_0x3ffaf6(null);};}for(var e in events){if(events[_0x5f15('0x6')](e)){var event=events[e];WhatsappQueue[_0x5f15('0x7')](e,emitEvent(event));}}module[_0x5f15('0x8')]=WhatsappQueueEvents;
\ No newline at end of file
index cdafda7..5d4ed97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x48bb=['bluebird','path','rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','../../config/logger','moment'];(function(_0x179d19,_0x3f63fc){var _0x1ca47f=function(_0x42ef71){while(--_0x42ef71){_0x179d19['push'](_0x179d19['shift']());}};_0x1ca47f(++_0x3f63fc);}(_0x48bb,0x1ec));var _0xb48b=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x48bb[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0xb48b('0x0'));var util=require('util');var logger=require(_0xb48b('0x1'))('api');var moment=require(_0xb48b('0x2'));var BPromise=require(_0xb48b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb48b('0x4'));var rimraf=require(_0xb48b('0x5'));var config=require('../../config/environment');var attributes=require(_0xb48b('0x6'));module[_0xb48b('0x7')]=function(_0xa0c28d,_0xbac3b3){return _0xa0c28d[_0xb48b('0x8')](_0xb48b('0x9'),attributes,{'tableName':_0xb48b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x622f=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','lodash','api','moment'];(function(_0x2cfc8c,_0x5472df){var _0x1de813=function(_0x580f50){while(--_0x580f50){_0x2cfc8c['push'](_0x2cfc8c['shift']());}};_0x1de813(++_0x5472df);}(_0x622f,0x15d));var _0xf622=function(_0x2c58bc,_0x49b37d){_0x2c58bc=_0x2c58bc-0x0;var _0xddb541=_0x622f[_0x2c58bc];return _0xddb541;};'use strict';var _=require(_0xf622('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf622('0x1'));var moment=require(_0xf622('0x2'));var BPromise=require(_0xf622('0x3'));var rp=require(_0xf622('0x4'));var fs=require('fs');var path=require(_0xf622('0x5'));var rimraf=require(_0xf622('0x6'));var config=require(_0xf622('0x7'));var attributes=require(_0xf622('0x8'));module['exports']=function(_0x1f8280,_0x51a48c){return _0x1f8280['define'](_0xf622('0x9'),attributes,{'tableName':_0xf622('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a173e74..830ecb5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62e2=['ShowWhatsappQueue','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','catch','find'];(function(_0x30d44f,_0x3335d4){var _0x4ef812=function(_0x101259){while(--_0x101259){_0x30d44f['push'](_0x30d44f['shift']());}};_0x4ef812(++_0x3335d4);}(_0x62e2,0x1bd));var _0x262e=function(_0x4ec125,_0x2a497b){_0x4ec125=_0x4ec125-0x0;var _0x35540e=_0x62e2[_0x4ec125];return _0x35540e;};'use strict';var _=require('lodash');var util=require(_0x262e('0x0'));var moment=require('moment');var BPromise=require(_0x262e('0x1'));var rs=require(_0x262e('0x2'));var fs=require('fs');var Redis=require(_0x262e('0x3'));var db=require(_0x262e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x262e('0x5'));var config=require(_0x262e('0x6'));var jayson=require(_0x262e('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x262e('0x8')],{'host':_0x262e('0x9'),'port':0x18eb});var socket=require(_0x262e('0xa'))(new Redis(config['redis']));require(_0x262e('0xb'))[_0x262e('0xc')](socket);function respondWithRpcPromise(_0x349f51,_0x3541c9,_0x4c512f){return new BPromise(function(_0x254855,_0x2bc89c){return client[_0x262e('0xd')](_0x349f51,_0x4c512f)[_0x262e('0xe')](function(_0x6b8151){logger[_0x262e('0xf')](_0x262e('0x10'),_0x3541c9,'request\x20sent');logger[_0x262e('0x11')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x3541c9,_0x262e('0x12'),JSON[_0x262e('0x13')](_0x6b8151));if(_0x6b8151[_0x262e('0x14')]){if(_0x6b8151[_0x262e('0x14')]['code']===0x1f4){logger['error'](_0x262e('0x10'),_0x3541c9,_0x6b8151[_0x262e('0x14')]['message']);return _0x2bc89c(_0x6b8151[_0x262e('0x14')][_0x262e('0x15')]);}logger[_0x262e('0x14')](_0x262e('0x10'),_0x3541c9,_0x6b8151[_0x262e('0x14')][_0x262e('0x15')]);return _0x254855(_0x6b8151[_0x262e('0x14')][_0x262e('0x15')]);}else{logger[_0x262e('0xf')](_0x262e('0x10'),_0x3541c9,_0x262e('0x12'));_0x254855(_0x6b8151[_0x262e('0x16')][_0x262e('0x15')]);}})['catch'](function(_0x5cb6e3){logger[_0x262e('0x14')]('WhatsappQueue,\x20%s,\x20%s',_0x3541c9,_0x5cb6e3);_0x2bc89c(_0x5cb6e3);});});}exports[_0x262e('0x17')]=function(_0x2cb9ef){var _0x36b68e=this;return new Promise(function(_0x1cde3f,_0x5c5a2b){return db[_0x262e('0x18')][_0x262e('0x19')]({'raw':_0x2cb9ef[_0x262e('0x1a')]?_0x2cb9ef[_0x262e('0x1a')][_0x262e('0x1b')]===undefined?!![]:![]:!![],'where':_0x2cb9ef['options']?_0x2cb9ef['options'][_0x262e('0x1c')]||null:null,'attributes':_0x2cb9ef[_0x262e('0x1a')]?_0x2cb9ef[_0x262e('0x1a')][_0x262e('0x1d')]||null:null,'limit':_0x2cb9ef[_0x262e('0x1a')]?_0x2cb9ef[_0x262e('0x1a')][_0x262e('0x1e')]||null:null,'include':_0x2cb9ef[_0x262e('0x1a')]?_0x2cb9ef['options'][_0x262e('0x1f')]?_[_0x262e('0x20')](_0x2cb9ef[_0x262e('0x1a')]['include'],function(_0x1f878e){return{'model':db[_0x1f878e[_0x262e('0x21')]],'as':_0x1f878e['as'],'attributes':_0x1f878e[_0x262e('0x1d')],'include':_0x1f878e[_0x262e('0x1f')]?_[_0x262e('0x20')](_0x1f878e[_0x262e('0x1f')],function(_0x45e286){return{'model':db[_0x45e286[_0x262e('0x21')]],'as':_0x45e286['as'],'attributes':_0x45e286[_0x262e('0x1d')],'include':_0x45e286[_0x262e('0x1f')]?_['map'](_0x45e286[_0x262e('0x1f')],function(_0x2fc855){return{'model':db[_0x2fc855[_0x262e('0x21')]],'as':_0x2fc855['as'],'attributes':_0x2fc855[_0x262e('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x262e('0xe')](function(_0x1974e0){logger[_0x262e('0xf')](_0x262e('0x17'),_0x2cb9ef);logger[_0x262e('0x11')]('GetWhatsappQueue',_0x2cb9ef,JSON[_0x262e('0x13')](_0x1974e0));_0x1cde3f(_0x1974e0);})[_0x262e('0x22')](function(_0x505a96){logger[_0x262e('0x14')]('GetWhatsappQueue',_0x505a96[_0x262e('0x15')],_0x2cb9ef);_0x5c5a2b(_0x36b68e[_0x262e('0x14')](0x1f4,_0x505a96[_0x262e('0x15')]));});});};exports['ShowWhatsappQueue']=function(_0x47efdd){var _0x40b078=this;return new Promise(function(_0x5799c3,_0x30cd8f){return db['WhatsappQueue'][_0x262e('0x23')]({'raw':_0x47efdd[_0x262e('0x1a')]?_0x47efdd['options']['raw']===undefined?!![]:![]:!![],'where':_0x47efdd[_0x262e('0x1a')]?_0x47efdd['options'][_0x262e('0x1c')]||null:null,'attributes':_0x47efdd['options']?_0x47efdd[_0x262e('0x1a')][_0x262e('0x1d')]||null:null,'include':_0x47efdd['options']?_0x47efdd[_0x262e('0x1a')][_0x262e('0x1f')]?_[_0x262e('0x20')](_0x47efdd[_0x262e('0x1a')][_0x262e('0x1f')],function(_0x594e92){return{'model':db[_0x594e92['model']],'as':_0x594e92['as'],'attributes':_0x594e92[_0x262e('0x1d')],'include':_0x594e92[_0x262e('0x1f')]?_[_0x262e('0x20')](_0x594e92[_0x262e('0x1f')],function(_0x1d8012){return{'model':db[_0x1d8012['model']],'as':_0x1d8012['as'],'attributes':_0x1d8012[_0x262e('0x1d')],'include':_0x1d8012['include']?_[_0x262e('0x20')](_0x1d8012['include'],function(_0x361d21){return{'model':db[_0x361d21[_0x262e('0x21')]],'as':_0x361d21['as'],'attributes':_0x361d21['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x259492){logger[_0x262e('0xf')](_0x262e('0x24'),_0x47efdd);logger['debug']('ShowWhatsappQueue',_0x47efdd,JSON['stringify'](_0x259492));_0x5799c3(_0x259492);})['catch'](function(_0x1374bf){logger['error'](_0x262e('0x24'),_0x1374bf[_0x262e('0x15')],_0x47efdd);_0x30cd8f(_0x40b078['error'](0x1f4,_0x1374bf[_0x262e('0x15')]));});});};
\ No newline at end of file
+var _0x849e=['register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetWhatsappQueue','catch','ShowWhatsappQueue','then','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','localhost','redis','./whatsappQueue.socket'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x849e,0x1c6));var _0xe849=function(_0x684ef1,_0x5887f7){_0x684ef1=_0x684ef1-0x0;var _0xa80b7a=_0x849e[_0x684ef1];return _0xa80b7a;};'use strict';var _=require(_0xe849('0x0'));var util=require(_0xe849('0x1'));var moment=require(_0xe849('0x2'));var BPromise=require(_0xe849('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe849('0x4'));var db=require(_0xe849('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe849('0x6'))(_0xe849('0x7'));var config=require(_0xe849('0x8'));var jayson=require(_0xe849('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xe849('0xa')](config['redis'],{'host':_0xe849('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe849('0xc')]));require(_0xe849('0xd'))[_0xe849('0xe')](socket);function respondWithRpcPromise(_0x37319a,_0x18fe96,_0xf5bfe9){return new BPromise(function(_0x3be34b,_0x45af8b){return client[_0xe849('0xf')](_0x37319a,_0xf5bfe9)['then'](function(_0x421228){logger[_0xe849('0x10')](_0xe849('0x11'),_0x18fe96,_0xe849('0x12'));logger[_0xe849('0x13')](_0xe849('0x14'),_0x18fe96,'request\x20sent',JSON[_0xe849('0x15')](_0x421228));if(_0x421228[_0xe849('0x16')]){if(_0x421228[_0xe849('0x16')][_0xe849('0x17')]===0x1f4){logger[_0xe849('0x16')](_0xe849('0x11'),_0x18fe96,_0x421228['error'][_0xe849('0x18')]);return _0x45af8b(_0x421228[_0xe849('0x16')][_0xe849('0x18')]);}logger[_0xe849('0x16')](_0xe849('0x11'),_0x18fe96,_0x421228[_0xe849('0x16')][_0xe849('0x18')]);return _0x3be34b(_0x421228[_0xe849('0x16')]['message']);}else{logger[_0xe849('0x10')](_0xe849('0x11'),_0x18fe96,_0xe849('0x12'));_0x3be34b(_0x421228['result'][_0xe849('0x18')]);}})['catch'](function(_0x2d2e9c){logger[_0xe849('0x16')](_0xe849('0x11'),_0x18fe96,_0x2d2e9c);_0x45af8b(_0x2d2e9c);});});}exports['GetWhatsappQueue']=function(_0x1e607f){var _0x214ef0=this;return new Promise(function(_0x41f6d3,_0x3c8038){return db[_0xe849('0x19')][_0xe849('0x1a')]({'raw':_0x1e607f[_0xe849('0x1b')]?_0x1e607f[_0xe849('0x1b')][_0xe849('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e607f[_0xe849('0x1b')]?_0x1e607f[_0xe849('0x1b')][_0xe849('0x1d')]||null:null,'attributes':_0x1e607f[_0xe849('0x1b')]?_0x1e607f[_0xe849('0x1b')][_0xe849('0x1e')]||null:null,'limit':_0x1e607f[_0xe849('0x1b')]?_0x1e607f[_0xe849('0x1b')][_0xe849('0x1f')]||null:null,'include':_0x1e607f[_0xe849('0x1b')]?_0x1e607f['options'][_0xe849('0x20')]?_['map'](_0x1e607f['options']['include'],function(_0x56fe7e){return{'model':db[_0x56fe7e[_0xe849('0x21')]],'as':_0x56fe7e['as'],'attributes':_0x56fe7e[_0xe849('0x1e')],'include':_0x56fe7e[_0xe849('0x20')]?_[_0xe849('0x22')](_0x56fe7e[_0xe849('0x20')],function(_0x4151b8){return{'model':db[_0x4151b8[_0xe849('0x21')]],'as':_0x4151b8['as'],'attributes':_0x4151b8[_0xe849('0x1e')],'include':_0x4151b8['include']?_[_0xe849('0x22')](_0x4151b8['include'],function(_0x15ad1b){return{'model':db[_0x15ad1b['model']],'as':_0x15ad1b['as'],'attributes':_0x15ad1b[_0xe849('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c9734){logger[_0xe849('0x10')](_0xe849('0x23'),_0x1e607f);logger[_0xe849('0x13')]('GetWhatsappQueue',_0x1e607f,JSON[_0xe849('0x15')](_0x3c9734));_0x41f6d3(_0x3c9734);})[_0xe849('0x24')](function(_0x2b53b3){logger['error'](_0xe849('0x23'),_0x2b53b3[_0xe849('0x18')],_0x1e607f);_0x3c8038(_0x214ef0[_0xe849('0x16')](0x1f4,_0x2b53b3['message']));});});};exports[_0xe849('0x25')]=function(_0xf0e284){var _0x45afc8=this;return new Promise(function(_0x53eece,_0x566e0d){return db[_0xe849('0x19')]['find']({'raw':_0xf0e284[_0xe849('0x1b')]?_0xf0e284[_0xe849('0x1b')][_0xe849('0x1c')]===undefined?!![]:![]:!![],'where':_0xf0e284[_0xe849('0x1b')]?_0xf0e284[_0xe849('0x1b')][_0xe849('0x1d')]||null:null,'attributes':_0xf0e284[_0xe849('0x1b')]?_0xf0e284[_0xe849('0x1b')][_0xe849('0x1e')]||null:null,'include':_0xf0e284[_0xe849('0x1b')]?_0xf0e284['options'][_0xe849('0x20')]?_[_0xe849('0x22')](_0xf0e284[_0xe849('0x1b')][_0xe849('0x20')],function(_0x1e3c0d){return{'model':db[_0x1e3c0d['model']],'as':_0x1e3c0d['as'],'attributes':_0x1e3c0d[_0xe849('0x1e')],'include':_0x1e3c0d[_0xe849('0x20')]?_[_0xe849('0x22')](_0x1e3c0d[_0xe849('0x20')],function(_0x40a1fe){return{'model':db[_0x40a1fe[_0xe849('0x21')]],'as':_0x40a1fe['as'],'attributes':_0x40a1fe[_0xe849('0x1e')],'include':_0x40a1fe['include']?_[_0xe849('0x22')](_0x40a1fe[_0xe849('0x20')],function(_0x7dcff9){return{'model':db[_0x7dcff9[_0xe849('0x21')]],'as':_0x7dcff9['as'],'attributes':_0x7dcff9[_0xe849('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe849('0x26')](function(_0x581c45){logger['info'](_0xe849('0x25'),_0xf0e284);logger['debug']('ShowWhatsappQueue',_0xf0e284,JSON[_0xe849('0x15')](_0x581c45));_0x53eece(_0x581c45);})[_0xe849('0x24')](function(_0x404c63){logger[_0xe849('0x16')](_0xe849('0x25'),_0x404c63['message'],_0xf0e284);_0x566e0d(_0x45afc8[_0xe849('0x16')](0x1f4,_0x404c63[_0xe849('0x18')]));});});};
\ No newline at end of file
index 4e56ad2..600a2ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70f3=['remove','update','emit','register','whatsappQueue:','./whatsappQueue.events'];(function(_0x21f772,_0x2fd04c){var _0x392146=function(_0x22eee7){while(--_0x22eee7){_0x21f772['push'](_0x21f772['shift']());}};_0x392146(++_0x2fd04c);}(_0x70f3,0x95));var _0x370f=function(_0x4d6826,_0x50de8d){_0x4d6826=_0x4d6826-0x0;var _0x2764bc=_0x70f3[_0x4d6826];return _0x2764bc;};'use strict';var WhatsappQueueEvents=require(_0x370f('0x0'));var events=['save',_0x370f('0x1'),_0x370f('0x2')];function createListener(_0x133e74,_0x114e3e){return function(_0x45e5a5){_0x114e3e[_0x370f('0x3')](_0x133e74,_0x45e5a5);};}function removeListener(_0x5dcbc6,_0x2d8b1a){return function(){WhatsappQueueEvents['removeListener'](_0x5dcbc6,_0x2d8b1a);};}exports[_0x370f('0x4')]=function(_0x5bc0d9){for(var _0x3bb91c=0x0,_0x475f8f=events['length'];_0x3bb91c<_0x475f8f;_0x3bb91c++){var _0x38153f=events[_0x3bb91c];var _0x1f44e3=createListener(_0x370f('0x5')+_0x38153f,_0x5bc0d9);WhatsappQueueEvents['on'](_0x38153f,_0x1f44e3);}};
\ No newline at end of file
+var _0xcb8d=['save','remove','update','emit','removeListener','register','length','whatsappQueue:','./whatsappQueue.events'];(function(_0xf81e99,_0x282a09){var _0x4bdf2a=function(_0x5f2602){while(--_0x5f2602){_0xf81e99['push'](_0xf81e99['shift']());}};_0x4bdf2a(++_0x282a09);}(_0xcb8d,0xd7));var _0xdcb8=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xcb8d[_0x220f3f];return _0x1f170e;};'use strict';var WhatsappQueueEvents=require(_0xdcb8('0x0'));var events=[_0xdcb8('0x1'),_0xdcb8('0x2'),_0xdcb8('0x3')];function createListener(_0x4566c0,_0x1926a5){return function(_0x1c081b){_0x1926a5[_0xdcb8('0x4')](_0x4566c0,_0x1c081b);};}function removeListener(_0x13afde,_0x2f12bf){return function(){WhatsappQueueEvents[_0xdcb8('0x5')](_0x13afde,_0x2f12bf);};}exports[_0xdcb8('0x6')]=function(_0x4188e7){for(var _0x45b68e=0x0,_0x199005=events[_0xdcb8('0x7')];_0x45b68e<_0x199005;_0x45b68e++){var _0x156b35=events[_0x45b68e];var _0x5552ce=createListener(_0xdcb8('0x8')+_0x156b35,_0x4188e7);WhatsappQueueEvents['on'](_0x156b35,_0x5552ce);}};
\ No newline at end of file
index 41a9268..7b8ad24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7b2=['../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa7b2,0x13e));var _0x2a7b=function(_0x4b3331,_0x3cfafc){_0x4b3331=_0x4b3331-0x0;var _0x586d70=_0xa7b2[_0x4b3331];return _0x586d70;};'use strict';var multer=require('multer');var util=require(_0x2a7b('0x0'));var path=require('path');var timeout=require(_0x2a7b('0x1'));var express=require(_0x2a7b('0x2'));var router=express[_0x2a7b('0x3')]();var fs_extra=require(_0x2a7b('0x4'));var auth=require(_0x2a7b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2a7b('0x6'));var controller=require(_0x2a7b('0x7'));router[_0x2a7b('0x8')]('/',auth[_0x2a7b('0x9')](),controller[_0x2a7b('0xa')]);router[_0x2a7b('0x8')](_0x2a7b('0xb'),auth[_0x2a7b('0x9')](),controller['describe']);router[_0x2a7b('0x8')](_0x2a7b('0xc'),auth[_0x2a7b('0x9')](),controller['show']);router[_0x2a7b('0xd')]('/',auth[_0x2a7b('0x9')](),controller[_0x2a7b('0xe')]);router[_0x2a7b('0xf')](_0x2a7b('0xc'),auth[_0x2a7b('0x9')](),controller['update']);router[_0x2a7b('0x10')](_0x2a7b('0xc'),auth[_0x2a7b('0x9')](),controller[_0x2a7b('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xb1ae=['/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x3cf3e4,_0x508c06){var _0x1018a8=function(_0x1791d9){while(--_0x1791d9){_0x3cf3e4['push'](_0x3cf3e4['shift']());}};_0x1018a8(++_0x508c06);}(_0xb1ae,0x185));var _0xeb1a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb1ae[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xeb1a('0x0'));var util=require(_0xeb1a('0x1'));var path=require(_0xeb1a('0x2'));var timeout=require(_0xeb1a('0x3'));var express=require(_0xeb1a('0x4'));var router=express[_0xeb1a('0x5')]();var fs_extra=require(_0xeb1a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xeb1a('0x7'));var config=require(_0xeb1a('0x8'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth[_0xeb1a('0x9')](),controller['index']);router[_0xeb1a('0xa')](_0xeb1a('0xb'),auth[_0xeb1a('0x9')](),controller[_0xeb1a('0xc')]);router['get'](_0xeb1a('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xeb1a('0xe')]('/',auth['isAuthenticated'](),controller[_0xeb1a('0xf')]);router[_0xeb1a('0x10')](_0xeb1a('0xd'),auth[_0xeb1a('0x9')](),controller['update']);router[_0xeb1a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xeb1a('0x12')]);module[_0xeb1a('0x13')]=router;
\ No newline at end of file
index 0c3d7a4..0c6e049 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0xad1c3b,_0x3d0e97){var _0x79e9ac=function(_0x57f78a){while(--_0x57f78a){_0xad1c3b['push'](_0xad1c3b['shift']());}};_0x79e9ac(++_0x3d0e97);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
+var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x252e1b,_0x53c017){var _0x4d5f86=function(_0x41f39f){while(--_0x41f39f){_0x252e1b['push'](_0x252e1b['shift']());}};_0x4d5f86(++_0x53c017);}(_0x7a54,0x106));var _0x47a5=function(_0x27430e,_0x4219b6){_0x27430e=_0x27430e-0x0;var _0x551e1c=_0x7a54[_0x27430e];return _0x551e1c;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
index 46589da..ca2a013 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc900=['filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','catch','show','includeAll','include','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','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','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','keys','query'];(function(_0x544658,_0x504644){var _0xd252f4=function(_0x19a022){while(--_0x19a022){_0x544658['push'](_0x544658['shift']());}};_0xd252f4(++_0x504644);}(_0xc900,0xb3));var _0x0c90=function(_0x1dd50d,_0x568858){_0x1dd50d=_0x1dd50d-0x0;var _0x1fddd5=_0xc900[_0x1dd50d];return _0x1fddd5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0c90('0x0'));var jsonpatch=require(_0x0c90('0x1'));var rp=require(_0x0c90('0x2'));var moment=require('moment');var BPromise=require(_0x0c90('0x3'));var Mustache=require(_0x0c90('0x4'));var util=require('util');var path=require(_0x0c90('0x5'));var sox=require(_0x0c90('0x6'));var csv=require(_0x0c90('0x7'));var ejs=require(_0x0c90('0x8'));var fs=require('fs');var fs_extra=require(_0x0c90('0x9'));var _=require(_0x0c90('0xa'));var squel=require('squel');var crypto=require(_0x0c90('0xb'));var jsforce=require(_0x0c90('0xc'));var deskjs=require(_0x0c90('0xd'));var toCsv=require(_0x0c90('0x7'));var querystring=require(_0x0c90('0xe'));var Papa=require(_0x0c90('0xf'));var Redis=require(_0x0c90('0x10'));var authService=require(_0x0c90('0x11'));var qs=require(_0x0c90('0x12'));var as=require(_0x0c90('0x13'));var hardwareService=require(_0x0c90('0x14'));var logger=require(_0x0c90('0x15'))(_0x0c90('0x16'));var utils=require('../../config/utils');var config=require(_0x0c90('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c90('0x18'))['db'];function respondWithStatusCode(_0x50e7db,_0x459cdb){_0x459cdb=_0x459cdb||0xcc;return function(_0x26fc46){if(_0x26fc46){return _0x50e7db[_0x0c90('0x19')](_0x459cdb);}return _0x50e7db[_0x0c90('0x1a')](_0x459cdb)[_0x0c90('0x1b')]();};}function respondWithResult(_0x59ea8e,_0x467b32){_0x467b32=_0x467b32||0xc8;return function(_0x4451e0){if(_0x4451e0){return _0x59ea8e['status'](_0x467b32)[_0x0c90('0x1c')](_0x4451e0);}};}function respondWithFilteredResult(_0x3a492d,_0x3bd5e8){return function(_0x5bef7d){if(_0x5bef7d){var _0x5daeb7=typeof _0x3bd5e8[_0x0c90('0x1d')]===_0x0c90('0x1e')&&typeof _0x3bd5e8[_0x0c90('0x1f')]===_0x0c90('0x1e');var _0x276b92=_0x5bef7d[_0x0c90('0x20')];var _0x42321a=_0x5daeb7?0x0:_0x3bd5e8['offset'];var _0xc3bb47=_0x5daeb7?_0x5bef7d[_0x0c90('0x20')]:_0x3bd5e8[_0x0c90('0x1d')]+_0x3bd5e8[_0x0c90('0x1f')];var _0x594267;if(_0xc3bb47>=_0x276b92){_0xc3bb47=_0x276b92;_0x594267=0xc8;}else{_0x594267=0xce;}_0x3a492d[_0x0c90('0x1a')](_0x594267);return _0x3a492d[_0x0c90('0x21')](_0x0c90('0x22'),_0x42321a+'-'+_0xc3bb47+'/'+_0x276b92)[_0x0c90('0x1c')](_0x5bef7d);}return null;};}function patchUpdates(_0x315932){return function(_0xc08f54){try{jsonpatch['apply'](_0xc08f54,_0x315932,!![]);}catch(_0x365a42){return BPromise['reject'](_0x365a42);}return _0xc08f54[_0x0c90('0x23')]();};}function saveUpdates(_0x1a021e,_0x47b13c){return function(_0x2a053a){if(_0x2a053a){return _0x2a053a[_0x0c90('0x24')](_0x1a021e)[_0x0c90('0x25')](function(_0x86dee){return _0x86dee;});}return null;};}function removeEntity(_0x212164,_0x3b287c){return function(_0x4dfbc3){if(_0x4dfbc3){return _0x4dfbc3[_0x0c90('0x26')]()[_0x0c90('0x25')](function(){_0x212164['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28d005,_0x3ea861){return function(_0x35c243){if(!_0x35c243){_0x28d005[_0x0c90('0x19')](0x194);}return _0x35c243;};}function handleError(_0x4dde67,_0x2dfa14){_0x2dfa14=_0x2dfa14||0x1f4;return function(_0x438652){logger[_0x0c90('0x27')](_0x438652[_0x0c90('0x28')]);if(_0x438652[_0x0c90('0x29')]){delete _0x438652[_0x0c90('0x29')];}_0x4dde67['status'](_0x2dfa14)[_0x0c90('0x2a')](_0x438652);};}exports[_0x0c90('0x2b')]=function(_0x39f1b2,_0x13b377){var _0x52d28d={},_0x4c8603={},_0x1f27f1={'count':0x0,'rows':[]};var _0x25da6e=_[_0x0c90('0x2c')](db[_0x0c90('0x2d')][_0x0c90('0x2e')],function(_0x562664){return{'name':_0x562664[_0x0c90('0x2f')],'type':_0x562664[_0x0c90('0x30')][_0x0c90('0x31')]};});_0x4c8603['model']=_[_0x0c90('0x2c')](_0x25da6e,'name');_0x4c8603['query']=_[_0x0c90('0x32')](_0x39f1b2[_0x0c90('0x33')]);_0x4c8603[_0x0c90('0x34')]=_[_0x0c90('0x35')](_0x4c8603['model'],_0x4c8603[_0x0c90('0x33')]);_0x52d28d['attributes']=_[_0x0c90('0x35')](_0x4c8603['model'],qs[_0x0c90('0x36')](_0x39f1b2[_0x0c90('0x33')]['fields']));_0x52d28d[_0x0c90('0x37')]=_0x52d28d[_0x0c90('0x37')][_0x0c90('0x38')]?_0x52d28d[_0x0c90('0x37')]:_0x4c8603[_0x0c90('0x39')];if(!_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x3a')](_0x0c90('0x3b'))){_0x52d28d['limit']=qs[_0x0c90('0x1f')](_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x1f')]);_0x52d28d[_0x0c90('0x1d')]=qs['offset'](_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x1d')]);}_0x52d28d[_0x0c90('0x3c')]=qs[_0x0c90('0x3d')](_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x3d')]);_0x52d28d[_0x0c90('0x3e')]=qs[_0x0c90('0x34')](_['pick'](_0x39f1b2[_0x0c90('0x33')],_0x4c8603[_0x0c90('0x34')]),_0x25da6e);if(_0x39f1b2['query'][_0x0c90('0x3f')]){_0x52d28d[_0x0c90('0x3e')]=_[_0x0c90('0x40')](_0x52d28d[_0x0c90('0x3e')],{'$or':_[_0x0c90('0x2c')](_0x25da6e,function(_0x50c126){if(_0x50c126[_0x0c90('0x30')]!==_0x0c90('0x41')){var _0x11530f={};_0x11530f[_0x50c126[_0x0c90('0x29')]]={'$like':'%'+_0x39f1b2[_0x0c90('0x33')][_0x0c90('0x3f')]+'%'};return _0x11530f;}})});}_0x52d28d=_[_0x0c90('0x40')]({},_0x52d28d,_0x39f1b2[_0x0c90('0x42')]);var _0x11a8e3={'where':_0x52d28d['where']};return db[_0x0c90('0x2d')]['count'](_0x11a8e3)[_0x0c90('0x25')](function(_0x593cc0){_0x1f27f1[_0x0c90('0x20')]=_0x593cc0;if(_0x39f1b2[_0x0c90('0x33')]['includeAll']){_0x52d28d['include']=[{'all':!![]}];}return db[_0x0c90('0x2d')]['findAll'](_0x52d28d);})[_0x0c90('0x25')](function(_0x4545bb){_0x1f27f1[_0x0c90('0x43')]=_0x4545bb;return _0x1f27f1;})['then'](respondWithFilteredResult(_0x13b377,_0x52d28d))[_0x0c90('0x44')](handleError(_0x13b377,null));};exports[_0x0c90('0x45')]=function(_0x123b58,_0x3e5137){var _0x2139c3={'raw':!![],'where':{'id':_0x123b58['params']['id']}},_0x1184c4={};_0x1184c4[_0x0c90('0x39')]=_[_0x0c90('0x32')](db[_0x0c90('0x2d')][_0x0c90('0x2e')]);_0x1184c4[_0x0c90('0x33')]=_[_0x0c90('0x32')](_0x123b58[_0x0c90('0x33')]);_0x1184c4['filters']=_[_0x0c90('0x35')](_0x1184c4['model'],_0x1184c4[_0x0c90('0x33')]);_0x2139c3[_0x0c90('0x37')]=_[_0x0c90('0x35')](_0x1184c4[_0x0c90('0x39')],qs[_0x0c90('0x36')](_0x123b58[_0x0c90('0x33')][_0x0c90('0x36')]));_0x2139c3[_0x0c90('0x37')]=_0x2139c3[_0x0c90('0x37')][_0x0c90('0x38')]?_0x2139c3[_0x0c90('0x37')]:_0x1184c4[_0x0c90('0x39')];if(_0x123b58[_0x0c90('0x33')][_0x0c90('0x46')]){_0x2139c3[_0x0c90('0x47')]=[{'all':!![]}];}_0x2139c3=_['merge']({},_0x2139c3,_0x123b58[_0x0c90('0x42')]);return db[_0x0c90('0x2d')][_0x0c90('0x48')](_0x2139c3)[_0x0c90('0x25')](handleEntityNotFound(_0x3e5137,null))[_0x0c90('0x25')](respondWithResult(_0x3e5137,null))[_0x0c90('0x44')](handleError(_0x3e5137,null));};exports[_0x0c90('0x49')]=function(_0x302dc6,_0x3bb138){return db[_0x0c90('0x2d')][_0x0c90('0x49')](_0x302dc6[_0x0c90('0x4a')],{})[_0x0c90('0x25')](respondWithResult(_0x3bb138,0xc9))[_0x0c90('0x44')](handleError(_0x3bb138,null));};exports['update']=function(_0x1b4aac,_0x38f492){if(_0x1b4aac['body']['id']){delete _0x1b4aac['body']['id'];}return db['WhatsappQueueReport'][_0x0c90('0x48')]({'where':{'id':_0x1b4aac[_0x0c90('0x4b')]['id']}})[_0x0c90('0x25')](handleEntityNotFound(_0x38f492,null))[_0x0c90('0x25')](saveUpdates(_0x1b4aac[_0x0c90('0x4a')],null))['then'](respondWithResult(_0x38f492,null))[_0x0c90('0x44')](handleError(_0x38f492,null));};exports[_0x0c90('0x26')]=function(_0x2b756d,_0x549c78){return db[_0x0c90('0x2d')][_0x0c90('0x48')]({'where':{'id':_0x2b756d[_0x0c90('0x4b')]['id']}})[_0x0c90('0x25')](handleEntityNotFound(_0x549c78,null))[_0x0c90('0x25')](removeEntity(_0x549c78,null))[_0x0c90('0x44')](handleError(_0x549c78,null));};exports[_0x0c90('0x4c')]=function(_0x2a339d,_0x1daeed){return db[_0x0c90('0x2d')]['describe']()[_0x0c90('0x25')](respondWithResult(_0x1daeed,null))['catch'](handleError(_0x1daeed,null));};
\ No newline at end of file
+var _0xdb94=['length','nolimit','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','model','query','keys','intersection','attributes','fields'];(function(_0x50802a,_0x3094b1){var _0x2ca906=function(_0x2ec080){while(--_0x2ec080){_0x50802a['push'](_0x50802a['shift']());}};_0x2ca906(++_0x3094b1);}(_0xdb94,0xab));var _0x4db9=function(_0x43585d,_0x30f5f8){_0x43585d=_0x43585d-0x0;var _0x45be42=_0xdb94[_0x43585d];return _0x45be42;};'use strict';var emlformat=require(_0x4db9('0x0'));var rimraf=require(_0x4db9('0x1'));var zipdir=require(_0x4db9('0x2'));var jsonpatch=require(_0x4db9('0x3'));var rp=require(_0x4db9('0x4'));var moment=require('moment');var BPromise=require(_0x4db9('0x5'));var Mustache=require(_0x4db9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db9('0x8'));var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31222b,_0x5e644c){_0x5e644c=_0x5e644c||0xcc;return function(_0x571685){if(_0x571685){return _0x31222b[_0x4db9('0x17')](_0x5e644c);}return _0x31222b[_0x4db9('0x18')](_0x5e644c)['end']();};}function respondWithResult(_0xd37d63,_0x1f9638){_0x1f9638=_0x1f9638||0xc8;return function(_0x452896){if(_0x452896){return _0xd37d63[_0x4db9('0x18')](_0x1f9638)['json'](_0x452896);}};}function respondWithFilteredResult(_0x5e04ab,_0x102274){return function(_0x34de1a){if(_0x34de1a){var _0x4a037f=typeof _0x102274[_0x4db9('0x19')]===_0x4db9('0x1a')&&typeof _0x102274['limit']==='undefined';var _0x250a80=_0x34de1a[_0x4db9('0x1b')];var _0x462af3=_0x4a037f?0x0:_0x102274[_0x4db9('0x19')];var _0x1d3c33=_0x4a037f?_0x34de1a['count']:_0x102274[_0x4db9('0x19')]+_0x102274[_0x4db9('0x1c')];var _0x11012e;if(_0x1d3c33>=_0x250a80){_0x1d3c33=_0x250a80;_0x11012e=0xc8;}else{_0x11012e=0xce;}_0x5e04ab['status'](_0x11012e);return _0x5e04ab[_0x4db9('0x1d')](_0x4db9('0x1e'),_0x462af3+'-'+_0x1d3c33+'/'+_0x250a80)[_0x4db9('0x1f')](_0x34de1a);}return null;};}function patchUpdates(_0x4c92e8){return function(_0x46b522){try{jsonpatch[_0x4db9('0x20')](_0x46b522,_0x4c92e8,!![]);}catch(_0x4553c2){return BPromise[_0x4db9('0x21')](_0x4553c2);}return _0x46b522[_0x4db9('0x22')]();};}function saveUpdates(_0x159d9b,_0x3585d5){return function(_0x5aef3b){if(_0x5aef3b){return _0x5aef3b[_0x4db9('0x23')](_0x159d9b)[_0x4db9('0x24')](function(_0xcde40c){return _0xcde40c;});}return null;};}function removeEntity(_0x319475,_0x4aaa84){return function(_0x213daa){if(_0x213daa){return _0x213daa[_0x4db9('0x25')]()['then'](function(){_0x319475[_0x4db9('0x18')](0xcc)[_0x4db9('0x26')]();});}};}function handleEntityNotFound(_0x2987c6,_0x4dbb1b){return function(_0x3c8237){if(!_0x3c8237){_0x2987c6[_0x4db9('0x17')](0x194);}return _0x3c8237;};}function handleError(_0x43b95e,_0x2d330e){_0x2d330e=_0x2d330e||0x1f4;return function(_0x3f9f7e){logger[_0x4db9('0x27')](_0x3f9f7e[_0x4db9('0x28')]);if(_0x3f9f7e[_0x4db9('0x29')]){delete _0x3f9f7e[_0x4db9('0x29')];}_0x43b95e[_0x4db9('0x18')](_0x2d330e)[_0x4db9('0x2a')](_0x3f9f7e);};}exports[_0x4db9('0x2b')]=function(_0x2d646d,_0x20f133){var _0x583861={},_0x5031fe={},_0x3951b2={'count':0x0,'rows':[]};var _0x331279=_[_0x4db9('0x2c')](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x459131){return{'name':_0x459131['fieldName'],'type':_0x459131[_0x4db9('0x2f')]['key']};});_0x5031fe[_0x4db9('0x30')]=_[_0x4db9('0x2c')](_0x331279,_0x4db9('0x29'));_0x5031fe[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x2d646d['query']);_0x5031fe['filters']=_[_0x4db9('0x33')](_0x5031fe['model'],_0x5031fe[_0x4db9('0x31')]);_0x583861[_0x4db9('0x34')]=_['intersection'](_0x5031fe[_0x4db9('0x30')],qs[_0x4db9('0x35')](_0x2d646d[_0x4db9('0x31')]['fields']));_0x583861[_0x4db9('0x34')]=_0x583861['attributes'][_0x4db9('0x36')]?_0x583861[_0x4db9('0x34')]:_0x5031fe[_0x4db9('0x30')];if(!_0x2d646d['query']['hasOwnProperty'](_0x4db9('0x37'))){_0x583861[_0x4db9('0x1c')]=qs[_0x4db9('0x1c')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x1c')]);_0x583861[_0x4db9('0x19')]=qs[_0x4db9('0x19')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x19')]);}_0x583861['order']=qs[_0x4db9('0x38')](_0x2d646d[_0x4db9('0x31')][_0x4db9('0x38')]);_0x583861[_0x4db9('0x39')]=qs['filters'](_[_0x4db9('0x3a')](_0x2d646d[_0x4db9('0x31')],_0x5031fe[_0x4db9('0x3b')]),_0x331279);if(_0x2d646d['query'][_0x4db9('0x3c')]){_0x583861[_0x4db9('0x39')]=_[_0x4db9('0x3d')](_0x583861[_0x4db9('0x39')],{'$or':_['map'](_0x331279,function(_0x5a78b4){if(_0x5a78b4[_0x4db9('0x2f')]!==_0x4db9('0x3e')){var _0x32e62b={};_0x32e62b[_0x5a78b4[_0x4db9('0x29')]]={'$like':'%'+_0x2d646d[_0x4db9('0x31')]['filter']+'%'};return _0x32e62b;}})});}_0x583861=_[_0x4db9('0x3d')]({},_0x583861,_0x2d646d[_0x4db9('0x3f')]);var _0x23affc={'where':_0x583861[_0x4db9('0x39')]};return db[_0x4db9('0x2d')]['count'](_0x23affc)[_0x4db9('0x24')](function(_0x324765){_0x3951b2[_0x4db9('0x1b')]=_0x324765;if(_0x2d646d['query'][_0x4db9('0x40')]){_0x583861[_0x4db9('0x41')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x42')](_0x583861);})[_0x4db9('0x24')](function(_0x24aa2a){_0x3951b2[_0x4db9('0x43')]=_0x24aa2a;return _0x3951b2;})[_0x4db9('0x24')](respondWithFilteredResult(_0x20f133,_0x583861))[_0x4db9('0x44')](handleError(_0x20f133,null));};exports[_0x4db9('0x45')]=function(_0x4bb740,_0x56bd68){var _0x48aaf5={'raw':!![],'where':{'id':_0x4bb740[_0x4db9('0x46')]['id']}},_0x22a021={};_0x22a021['model']=_[_0x4db9('0x32')](db[_0x4db9('0x2d')]['rawAttributes']);_0x22a021['query']=_[_0x4db9('0x32')](_0x4bb740['query']);_0x22a021[_0x4db9('0x3b')]=_[_0x4db9('0x33')](_0x22a021['model'],_0x22a021[_0x4db9('0x31')]);_0x48aaf5[_0x4db9('0x34')]=_['intersection'](_0x22a021[_0x4db9('0x30')],qs[_0x4db9('0x35')](_0x4bb740[_0x4db9('0x31')]['fields']));_0x48aaf5['attributes']=_0x48aaf5[_0x4db9('0x34')][_0x4db9('0x36')]?_0x48aaf5[_0x4db9('0x34')]:_0x22a021[_0x4db9('0x30')];if(_0x4bb740[_0x4db9('0x31')][_0x4db9('0x40')]){_0x48aaf5[_0x4db9('0x41')]=[{'all':!![]}];}_0x48aaf5=_[_0x4db9('0x3d')]({},_0x48aaf5,_0x4bb740[_0x4db9('0x3f')]);return db[_0x4db9('0x2d')][_0x4db9('0x47')](_0x48aaf5)[_0x4db9('0x24')](handleEntityNotFound(_0x56bd68,null))[_0x4db9('0x24')](respondWithResult(_0x56bd68,null))['catch'](handleError(_0x56bd68,null));};exports[_0x4db9('0x48')]=function(_0x2faacf,_0x3852f0){return db[_0x4db9('0x2d')][_0x4db9('0x48')](_0x2faacf[_0x4db9('0x49')],{})[_0x4db9('0x24')](respondWithResult(_0x3852f0,0xc9))[_0x4db9('0x44')](handleError(_0x3852f0,null));};exports[_0x4db9('0x23')]=function(_0x2d6094,_0x10dccb){if(_0x2d6094['body']['id']){delete _0x2d6094['body']['id'];}return db[_0x4db9('0x2d')][_0x4db9('0x47')]({'where':{'id':_0x2d6094[_0x4db9('0x46')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0x10dccb,null))[_0x4db9('0x24')](saveUpdates(_0x2d6094[_0x4db9('0x49')],null))[_0x4db9('0x24')](respondWithResult(_0x10dccb,null))[_0x4db9('0x44')](handleError(_0x10dccb,null));};exports['destroy']=function(_0xd8eae3,_0xcb832e){return db[_0x4db9('0x2d')][_0x4db9('0x47')]({'where':{'id':_0xd8eae3[_0x4db9('0x46')]['id']}})[_0x4db9('0x24')](handleEntityNotFound(_0xcb832e,null))[_0x4db9('0x24')](removeEntity(_0xcb832e,null))[_0x4db9('0x44')](handleError(_0xcb832e,null));};exports['describe']=function(_0x45bc79,_0xd6701a){return db[_0x4db9('0x2d')][_0x4db9('0x4a')]()[_0x4db9('0x24')](respondWithResult(_0xd6701a,null))[_0x4db9('0x44')](handleError(_0xd6701a,null));};
\ No newline at end of file
index 0984aed..2f19984 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x088c=['util','../../config/logger','api','moment','bluebird','request-promise','path','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x088c,0xa7));var _0xc088=function(_0x184fed,_0x2fad66){_0x184fed=_0x184fed-0x0;var _0x69522e=_0x088c[_0x184fed];return _0x69522e;};'use strict';var _=require(_0xc088('0x0'));var util=require(_0xc088('0x1'));var logger=require(_0xc088('0x2'))(_0xc088('0x3'));var moment=require(_0xc088('0x4'));var BPromise=require(_0xc088('0x5'));var rp=require(_0xc088('0x6'));var fs=require('fs');var path=require(_0xc088('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc088('0x8'));module[_0xc088('0x9')]=function(_0x5de4da,_0xf225d9){return _0x5de4da[_0xc088('0xa')](_0xc088('0xb'),attributes,{'tableName':_0xc088('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc088('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xf158=['request-promise','path','rimraf','./whatsappQueueReport.attributes','WhatsappQueueReport','uniqueid','lodash','util','moment','bluebird'];(function(_0x308e3b,_0x5c67e9){var _0x326fe6=function(_0x174a9e){while(--_0x174a9e){_0x308e3b['push'](_0x308e3b['shift']());}};_0x326fe6(++_0x5c67e9);}(_0xf158,0x1d2));var _0x8f15=function(_0xcbe624,_0x42d09d){_0xcbe624=_0xcbe624-0x0;var _0x40a5b2=_0xf158[_0xcbe624];return _0x40a5b2;};'use strict';var _=require(_0x8f15('0x0'));var util=require(_0x8f15('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8f15('0x2'));var BPromise=require(_0x8f15('0x3'));var rp=require(_0x8f15('0x4'));var fs=require('fs');var path=require(_0x8f15('0x5'));var rimraf=require(_0x8f15('0x6'));var config=require('../../config/environment');var attributes=require(_0x8f15('0x7'));module['exports']=function(_0x45cdaa,_0x348159){return _0x45cdaa['define'](_0x8f15('0x8'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x8f15('0x9'),'fields':[_0x8f15('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index a026b7b..da6977a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9861=['request\x20sent','catch','WhatsappQueueReport','create','body','options','raw','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','update','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','WhatsappQueueReport,\x20%s,\x20%s','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x282edf,_0x1d836a){var _0x5807d0=function(_0x330e1d){while(--_0x330e1d){_0x282edf['push'](_0x282edf['shift']());}};_0x5807d0(++_0x1d836a);}(_0x9861,0x1a5));var _0x1986=function(_0x3191ae,_0x3d2e14){_0x3191ae=_0x3191ae-0x0;var _0x4dc4af=_0x9861[_0x3191ae];return _0x4dc4af;};'use strict';var _=require(_0x1986('0x0'));var util=require('util');var moment=require(_0x1986('0x1'));var BPromise=require('bluebird');var rs=require(_0x1986('0x2'));var fs=require('fs');var Redis=require(_0x1986('0x3'));var db=require(_0x1986('0x4'))['db'];var utils=require(_0x1986('0x5'));var logger=require(_0x1986('0x6'))(_0x1986('0x7'));var config=require(_0x1986('0x8'));var jayson=require(_0x1986('0x9'));var client=jayson[_0x1986('0xa')][_0x1986('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xedb434,_0x7dc75e,_0x3fd77c){return new BPromise(function(_0x516c99,_0x10f23c){return client['request'](_0xedb434,_0x3fd77c)[_0x1986('0xc')](function(_0x43cedb){logger[_0x1986('0xd')](_0x1986('0xe'),_0x7dc75e,'request\x20sent');logger[_0x1986('0xf')](_0x1986('0x10'),_0x7dc75e,'request\x20sent',JSON[_0x1986('0x11')](_0x43cedb));if(_0x43cedb[_0x1986('0x12')]){if(_0x43cedb['error'][_0x1986('0x13')]===0x1f4){logger[_0x1986('0x12')](_0x1986('0xe'),_0x7dc75e,_0x43cedb['error'][_0x1986('0x14')]);return _0x10f23c(_0x43cedb[_0x1986('0x12')][_0x1986('0x14')]);}logger['error'](_0x1986('0xe'),_0x7dc75e,_0x43cedb[_0x1986('0x12')][_0x1986('0x14')]);return _0x516c99(_0x43cedb['error'][_0x1986('0x14')]);}else{logger[_0x1986('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x7dc75e,_0x1986('0x15'));_0x516c99(_0x43cedb['result'][_0x1986('0x14')]);}})[_0x1986('0x16')](function(_0x35a917){logger[_0x1986('0x12')](_0x1986('0xe'),_0x7dc75e,_0x35a917);_0x10f23c(_0x35a917);});});}exports['CreateWhatsappQueueReport']=function(_0x4fcc7f){var _0x5247b8=this;return new Promise(function(_0xdc6241,_0x18b12f){return db[_0x1986('0x17')][_0x1986('0x18')](_0x4fcc7f[_0x1986('0x19')],{'raw':_0x4fcc7f[_0x1986('0x1a')]?_0x4fcc7f[_0x1986('0x1a')][_0x1986('0x1b')]===undefined?!![]:![]:!![]})[_0x1986('0xc')](function(_0x4961b2){logger[_0x1986('0xd')](_0x1986('0x1c'),_0x4fcc7f);logger['debug'](_0x1986('0x1c'),_0x4fcc7f,JSON[_0x1986('0x11')](_0x4961b2));_0xdc6241(_0x4961b2);})[_0x1986('0x16')](function(_0x570f4b){logger[_0x1986('0x12')]('CreateWhatsappQueueReport',_0x570f4b[_0x1986('0x14')],_0x4fcc7f);_0x18b12f(_0x5247b8[_0x1986('0x12')](0x1f4,_0x570f4b[_0x1986('0x14')]));});});};exports[_0x1986('0x1d')]=function(_0x3feca9){var _0x45836c=this;return new Promise(function(_0x381aa4,_0x3d6011){return db[_0x1986('0x17')][_0x1986('0x1e')](_0x3feca9[_0x1986('0x19')],{'raw':_0x3feca9[_0x1986('0x1a')]?_0x3feca9[_0x1986('0x1a')][_0x1986('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3feca9[_0x1986('0x1a')]?_0x3feca9[_0x1986('0x1a')][_0x1986('0x1f')]||null:null,'attributes':_0x3feca9[_0x1986('0x1a')]?_0x3feca9[_0x1986('0x1a')][_0x1986('0x20')]||null:null,'limit':_0x3feca9[_0x1986('0x1a')]?_0x3feca9[_0x1986('0x1a')][_0x1986('0x21')]||null:null})[_0x1986('0xc')](function(_0x27be60){logger[_0x1986('0xd')](_0x1986('0x1d'),_0x3feca9);logger[_0x1986('0xf')](_0x1986('0x1d'),_0x3feca9,JSON[_0x1986('0x11')](_0x27be60));_0x381aa4(_0x27be60);})[_0x1986('0x16')](function(_0x377711){logger[_0x1986('0x12')]('UpdateWhatsappQueueReport',_0x377711[_0x1986('0x14')],_0x3feca9);_0x3d6011(_0x45836c['error'](0x1f4,_0x377711[_0x1986('0x14')]));});});};
\ No newline at end of file
+var _0xe590=['jayson/promise','client','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','WhatsappQueueReport','create','body','options','raw','then','CreateWhatsappQueueReport','update','where','attributes','limit','UpdateWhatsappQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x8d98c6,_0x520c06){var _0xef6863=function(_0x1afd0b){while(--_0x1afd0b){_0x8d98c6['push'](_0x8d98c6['shift']());}};_0xef6863(++_0x520c06);}(_0xe590,0x7f));var _0x0e59=function(_0xb66008,_0x4eb6b6){_0xb66008=_0xb66008-0x0;var _0x478ea9=_0xe590[_0xb66008];return _0x478ea9;};'use strict';var _=require(_0x0e59('0x0'));var util=require('util');var moment=require(_0x0e59('0x1'));var BPromise=require(_0x0e59('0x2'));var rs=require(_0x0e59('0x3'));var fs=require('fs');var Redis=require(_0x0e59('0x4'));var db=require(_0x0e59('0x5'))['db'];var utils=require(_0x0e59('0x6'));var logger=require(_0x0e59('0x7'))('rpc');var config=require(_0x0e59('0x8'));var jayson=require(_0x0e59('0x9'));var client=jayson[_0x0e59('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8ff6f5,_0x257f67,_0x1bc99e){return new BPromise(function(_0x294da2,_0x5cb622){return client[_0x0e59('0xb')](_0x8ff6f5,_0x1bc99e)['then'](function(_0x28771c){logger[_0x0e59('0xc')](_0x0e59('0xd'),_0x257f67,_0x0e59('0xe'));logger[_0x0e59('0xf')](_0x0e59('0x10'),_0x257f67,_0x0e59('0xe'),JSON[_0x0e59('0x11')](_0x28771c));if(_0x28771c[_0x0e59('0x12')]){if(_0x28771c['error']['code']===0x1f4){logger[_0x0e59('0x12')](_0x0e59('0xd'),_0x257f67,_0x28771c[_0x0e59('0x12')][_0x0e59('0x13')]);return _0x5cb622(_0x28771c[_0x0e59('0x12')]['message']);}logger[_0x0e59('0x12')](_0x0e59('0xd'),_0x257f67,_0x28771c['error'][_0x0e59('0x13')]);return _0x294da2(_0x28771c[_0x0e59('0x12')][_0x0e59('0x13')]);}else{logger[_0x0e59('0xc')](_0x0e59('0xd'),_0x257f67,'request\x20sent');_0x294da2(_0x28771c[_0x0e59('0x14')][_0x0e59('0x13')]);}})[_0x0e59('0x15')](function(_0x1f12ee){logger[_0x0e59('0x12')](_0x0e59('0xd'),_0x257f67,_0x1f12ee);_0x5cb622(_0x1f12ee);});});}exports['CreateWhatsappQueueReport']=function(_0x244d0f){var _0x349acd=this;return new Promise(function(_0x351e80,_0x24917a){return db[_0x0e59('0x16')][_0x0e59('0x17')](_0x244d0f[_0x0e59('0x18')],{'raw':_0x244d0f[_0x0e59('0x19')]?_0x244d0f[_0x0e59('0x19')][_0x0e59('0x1a')]===undefined?!![]:![]:!![]})[_0x0e59('0x1b')](function(_0x1bb8f8){logger['info'](_0x0e59('0x1c'),_0x244d0f);logger[_0x0e59('0xf')](_0x0e59('0x1c'),_0x244d0f,JSON['stringify'](_0x1bb8f8));_0x351e80(_0x1bb8f8);})[_0x0e59('0x15')](function(_0x24d00d){logger['error'](_0x0e59('0x1c'),_0x24d00d[_0x0e59('0x13')],_0x244d0f);_0x24917a(_0x349acd[_0x0e59('0x12')](0x1f4,_0x24d00d[_0x0e59('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x2ec221){var _0x28c898=this;return new Promise(function(_0x3c58cc,_0x331cda){return db['WhatsappQueueReport'][_0x0e59('0x1d')](_0x2ec221[_0x0e59('0x18')],{'raw':_0x2ec221[_0x0e59('0x19')]?_0x2ec221[_0x0e59('0x19')][_0x0e59('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ec221[_0x0e59('0x19')]?_0x2ec221[_0x0e59('0x19')][_0x0e59('0x1e')]||null:null,'attributes':_0x2ec221['options']?_0x2ec221['options'][_0x0e59('0x1f')]||null:null,'limit':_0x2ec221['options']?_0x2ec221[_0x0e59('0x19')][_0x0e59('0x20')]||null:null})[_0x0e59('0x1b')](function(_0x327ea5){logger['info'](_0x0e59('0x21'),_0x2ec221);logger[_0x0e59('0xf')](_0x0e59('0x21'),_0x2ec221,JSON[_0x0e59('0x11')](_0x327ea5));_0x3c58cc(_0x327ea5);})['catch'](function(_0x17820a){logger['error'](_0x0e59('0x21'),_0x17820a[_0x0e59('0x13')],_0x2ec221);_0x331cda(_0x28c898[_0x0e59('0x12')](0x1f4,_0x17820a[_0x0e59('0x13')]));});});};
\ No newline at end of file
index ea62f00..1906a6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf52f=['get','isAuthenticated','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1a6097,_0xd1b438){var _0x404ebc=function(_0x1d7688){while(--_0x1d7688){_0x1a6097['push'](_0x1a6097['shift']());}};_0x404ebc(++_0xd1b438);}(_0xf52f,0x1e6));var _0xff52=function(_0x41efc4,_0x1c54cb){_0x41efc4=_0x41efc4-0x0;var _0x172f72=_0xf52f[_0x41efc4];return _0x172f72;};'use strict';var multer=require(_0xff52('0x0'));var util=require(_0xff52('0x1'));var path=require(_0xff52('0x2'));var timeout=require(_0xff52('0x3'));var express=require('express');var router=express[_0xff52('0x4')]();var fs_extra=require(_0xff52('0x5'));var auth=require(_0xff52('0x6'));var interaction=require(_0xff52('0x7'));var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0xff52('0x8')]('/',auth[_0xff52('0x9')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xff52('0xa')]);router[_0xff52('0x8')](_0xff52('0xb'),auth[_0xff52('0x9')](),controller[_0xff52('0xc')]);router[_0xff52('0xd')]('/',auth['isAuthenticated'](),controller[_0xff52('0xe')]);router[_0xff52('0xf')](_0xff52('0xb'),auth[_0xff52('0x9')](),controller['update']);router[_0xff52('0x10')](_0xff52('0xb'),auth[_0xff52('0x9')](),controller[_0xff52('0x11')]);module[_0xff52('0x12')]=router;
\ No newline at end of file
+var _0xe8e3=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','create','put','update','exports','multer','util'];(function(_0x40a740,_0x5e1944){var _0x2b5bbb=function(_0x2b3bed){while(--_0x2b3bed){_0x40a740['push'](_0x40a740['shift']());}};_0x2b5bbb(++_0x5e1944);}(_0xe8e3,0x166));var _0x3e8e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe8e3[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x3e8e('0x0'));var util=require(_0x3e8e('0x1'));var path=require(_0x3e8e('0x2'));var timeout=require(_0x3e8e('0x3'));var express=require(_0x3e8e('0x4'));var router=express[_0x3e8e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x3e8e('0x6'));var interaction=require(_0x3e8e('0x7'));var config=require(_0x3e8e('0x8'));var controller=require(_0x3e8e('0x9'));router[_0x3e8e('0xa')]('/',auth[_0x3e8e('0xb')](),controller[_0x3e8e('0xc')]);router[_0x3e8e('0xa')](_0x3e8e('0xd'),auth[_0x3e8e('0xb')](),controller[_0x3e8e('0xe')]);router[_0x3e8e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3e8e('0xf')]);router['post']('/',auth[_0x3e8e('0xb')](),controller[_0x3e8e('0x10')]);router[_0x3e8e('0x11')]('/:id',auth[_0x3e8e('0xb')](),controller[_0x3e8e('0x12')]);router['delete']('/:id',auth[_0x3e8e('0xb')](),controller['destroy']);module[_0x3e8e('0x13')]=router;
\ No newline at end of file
index 8725bab..1697d8b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c8d=['agent','exports','STRING','ENUM','account'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0x0c8d,0x79));var _0xd0c8=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x0c8d[_0x29d94e];return _0x106237;};'use strict';var Sequelize=require('sequelize');module[_0xd0c8('0x0')]={'uniqueid':{'type':Sequelize[_0xd0c8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xd0c8('0x2')](_0xd0c8('0x3'),_0xd0c8('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0x8c50=['DATE','exports','STRING','account','agent','queue'];(function(_0x279a81,_0x3d7cd5){var _0xe2f86e=function(_0x4b9568){while(--_0x4b9568){_0x279a81['push'](_0x279a81['shift']());}};_0xe2f86e(++_0x3d7cd5);}(_0x8c50,0xcd));var _0x08c5=function(_0x1b266a,_0x39577c){_0x1b266a=_0x1b266a-0x0;var _0x1da7eb=_0x8c50[_0x1b266a];return _0x1da7eb;};'use strict';var Sequelize=require('sequelize');module[_0x08c5('0x0')]={'uniqueid':{'type':Sequelize[_0x08c5('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x08c5('0x2'),_0x08c5('0x3'),_0x08c5('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x08c5('0x5')]}};
\ No newline at end of file
index d2169e5..108d587 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aea=['status','end','json','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','catch','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x17f126,_0x47909f){var _0x5ba5dd=function(_0x1296d4){while(--_0x1296d4){_0x17f126['push'](_0x17f126['shift']());}};_0x5ba5dd(++_0x47909f);}(_0x8aea,0x7a));var _0xa8ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8aea[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xa8ae('0x0'));var rimraf=require(_0xa8ae('0x1'));var zipdir=require(_0xa8ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa8ae('0x3'));var moment=require(_0xa8ae('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa8ae('0x5'));var util=require(_0xa8ae('0x6'));var path=require('path');var sox=require(_0xa8ae('0x7'));var csv=require(_0xa8ae('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa8ae('0x9'));var _=require('lodash');var squel=require(_0xa8ae('0xa'));var crypto=require(_0xa8ae('0xb'));var jsforce=require(_0xa8ae('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa8ae('0x8'));var querystring=require('querystring');var Papa=require(_0xa8ae('0xd'));var Redis=require('ioredis');var authService=require(_0xa8ae('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xa8ae('0xf'));var hardwareService=require(_0xa8ae('0x10'));var logger=require(_0xa8ae('0x11'))(_0xa8ae('0x12'));var utils=require('../../config/utils');var config=require(_0xa8ae('0x13'));var licenseUtil=require(_0xa8ae('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13d1cd,_0x48c8b4){_0x48c8b4=_0x48c8b4||0xcc;return function(_0x217d04){if(_0x217d04){return _0x13d1cd[_0xa8ae('0x15')](_0x48c8b4);}return _0x13d1cd[_0xa8ae('0x16')](_0x48c8b4)[_0xa8ae('0x17')]();};}function respondWithResult(_0x2032ea,_0x9bdefa){_0x9bdefa=_0x9bdefa||0xc8;return function(_0x3a2f68){if(_0x3a2f68){return _0x2032ea['status'](_0x9bdefa)[_0xa8ae('0x18')](_0x3a2f68);}};}function respondWithFilteredResult(_0x3031cd,_0x62e114){return function(_0x39af4a){if(_0x39af4a){var _0x5cd8ec=typeof _0x62e114[_0xa8ae('0x19')]===_0xa8ae('0x1a')&&typeof _0x62e114[_0xa8ae('0x1b')]===_0xa8ae('0x1a');var _0x460cbb=_0x39af4a[_0xa8ae('0x1c')];var _0x9a8a9f=_0x5cd8ec?0x0:_0x62e114['offset'];var _0x21b79e=_0x5cd8ec?_0x39af4a[_0xa8ae('0x1c')]:_0x62e114[_0xa8ae('0x19')]+_0x62e114[_0xa8ae('0x1b')];var _0x3cb6dd;if(_0x21b79e>=_0x460cbb){_0x21b79e=_0x460cbb;_0x3cb6dd=0xc8;}else{_0x3cb6dd=0xce;}_0x3031cd[_0xa8ae('0x16')](_0x3cb6dd);return _0x3031cd['set'](_0xa8ae('0x1d'),_0x9a8a9f+'-'+_0x21b79e+'/'+_0x460cbb)[_0xa8ae('0x18')](_0x39af4a);}return null;};}function patchUpdates(_0x5460a7){return function(_0x4d1796){try{jsonpatch[_0xa8ae('0x1e')](_0x4d1796,_0x5460a7,!![]);}catch(_0x5d3cf6){return BPromise['reject'](_0x5d3cf6);}return _0x4d1796['save']();};}function saveUpdates(_0x2bb2ac,_0x2e2d8f){return function(_0xff025d){if(_0xff025d){return _0xff025d[_0xa8ae('0x1f')](_0x2bb2ac)[_0xa8ae('0x20')](function(_0x11bf9a){return _0x11bf9a;});}return null;};}function removeEntity(_0x5673a2,_0x2e6667){return function(_0x57f79d){if(_0x57f79d){return _0x57f79d[_0xa8ae('0x21')]()[_0xa8ae('0x20')](function(){_0x5673a2['status'](0xcc)[_0xa8ae('0x17')]();});}};}function handleEntityNotFound(_0x1f5505,_0xfa66e1){return function(_0x439035){if(!_0x439035){_0x1f5505[_0xa8ae('0x15')](0x194);}return _0x439035;};}function handleError(_0x3ec1b,_0x5a5427){_0x5a5427=_0x5a5427||0x1f4;return function(_0x5bdadf){logger[_0xa8ae('0x22')](_0x5bdadf[_0xa8ae('0x23')]);if(_0x5bdadf[_0xa8ae('0x24')]){delete _0x5bdadf[_0xa8ae('0x24')];}_0x3ec1b[_0xa8ae('0x16')](_0x5a5427)[_0xa8ae('0x25')](_0x5bdadf);};}exports[_0xa8ae('0x26')]=function(_0x3ba82c,_0xf98ea6){var _0x41fc4a={},_0x58d1e8={},_0x1c34e3={'count':0x0,'rows':[]};var _0x10266c=_[_0xa8ae('0x27')](db[_0xa8ae('0x28')]['rawAttributes'],function(_0x4e5a74){return{'name':_0x4e5a74[_0xa8ae('0x29')],'type':_0x4e5a74[_0xa8ae('0x2a')][_0xa8ae('0x2b')]};});_0x58d1e8[_0xa8ae('0x2c')]=_[_0xa8ae('0x27')](_0x10266c,'name');_0x58d1e8[_0xa8ae('0x2d')]=_[_0xa8ae('0x2e')](_0x3ba82c[_0xa8ae('0x2d')]);_0x58d1e8[_0xa8ae('0x2f')]=_['intersection'](_0x58d1e8['model'],_0x58d1e8[_0xa8ae('0x2d')]);_0x41fc4a['attributes']=_[_0xa8ae('0x30')](_0x58d1e8[_0xa8ae('0x2c')],qs[_0xa8ae('0x31')](_0x3ba82c[_0xa8ae('0x2d')][_0xa8ae('0x31')]));_0x41fc4a['attributes']=_0x41fc4a[_0xa8ae('0x32')]['length']?_0x41fc4a['attributes']:_0x58d1e8['model'];if(!_0x3ba82c[_0xa8ae('0x2d')][_0xa8ae('0x33')](_0xa8ae('0x34'))){_0x41fc4a[_0xa8ae('0x1b')]=qs['limit'](_0x3ba82c[_0xa8ae('0x2d')][_0xa8ae('0x1b')]);_0x41fc4a['offset']=qs['offset'](_0x3ba82c[_0xa8ae('0x2d')]['offset']);}_0x41fc4a[_0xa8ae('0x35')]=qs[_0xa8ae('0x36')](_0x3ba82c[_0xa8ae('0x2d')]['sort']);_0x41fc4a[_0xa8ae('0x37')]=qs[_0xa8ae('0x2f')](_[_0xa8ae('0x38')](_0x3ba82c['query'],_0x58d1e8[_0xa8ae('0x2f')]),_0x10266c);if(_0x3ba82c[_0xa8ae('0x2d')][_0xa8ae('0x39')]){_0x41fc4a[_0xa8ae('0x37')]=_[_0xa8ae('0x3a')](_0x41fc4a['where'],{'$or':_['map'](_0x10266c,function(_0x4b4d71){if(_0x4b4d71[_0xa8ae('0x2a')]!==_0xa8ae('0x3b')){var _0x2bfb31={};_0x2bfb31[_0x4b4d71['name']]={'$like':'%'+_0x3ba82c['query'][_0xa8ae('0x39')]+'%'};return _0x2bfb31;}})});}_0x41fc4a=_[_0xa8ae('0x3a')]({},_0x41fc4a,_0x3ba82c[_0xa8ae('0x3c')]);var _0x3851f3={'where':_0x41fc4a['where']};return db[_0xa8ae('0x28')][_0xa8ae('0x1c')](_0x3851f3)[_0xa8ae('0x20')](function(_0x3888dc){_0x1c34e3[_0xa8ae('0x1c')]=_0x3888dc;if(_0x3ba82c[_0xa8ae('0x2d')][_0xa8ae('0x3d')]){_0x41fc4a[_0xa8ae('0x3e')]=[{'all':!![]}];}return db[_0xa8ae('0x28')][_0xa8ae('0x3f')](_0x41fc4a);})[_0xa8ae('0x20')](function(_0x579c63){_0x1c34e3[_0xa8ae('0x40')]=_0x579c63;return _0x1c34e3;})['then'](respondWithFilteredResult(_0xf98ea6,_0x41fc4a))['catch'](handleError(_0xf98ea6,null));};exports['show']=function(_0x45fb1b,_0x5c9519){var _0x52d95b={'raw':!![],'where':{'id':_0x45fb1b[_0xa8ae('0x41')]['id']}},_0xb68d99={};_0xb68d99['model']=_[_0xa8ae('0x2e')](db[_0xa8ae('0x28')][_0xa8ae('0x42')]);_0xb68d99['query']=_[_0xa8ae('0x2e')](_0x45fb1b[_0xa8ae('0x2d')]);_0xb68d99[_0xa8ae('0x2f')]=_[_0xa8ae('0x30')](_0xb68d99[_0xa8ae('0x2c')],_0xb68d99['query']);_0x52d95b[_0xa8ae('0x32')]=_[_0xa8ae('0x30')](_0xb68d99[_0xa8ae('0x2c')],qs[_0xa8ae('0x31')](_0x45fb1b['query'][_0xa8ae('0x31')]));_0x52d95b[_0xa8ae('0x32')]=_0x52d95b[_0xa8ae('0x32')][_0xa8ae('0x43')]?_0x52d95b[_0xa8ae('0x32')]:_0xb68d99[_0xa8ae('0x2c')];if(_0x45fb1b[_0xa8ae('0x2d')][_0xa8ae('0x3d')]){_0x52d95b[_0xa8ae('0x3e')]=[{'all':!![]}];}_0x52d95b=_['merge']({},_0x52d95b,_0x45fb1b[_0xa8ae('0x3c')]);return db[_0xa8ae('0x28')][_0xa8ae('0x44')](_0x52d95b)['then'](handleEntityNotFound(_0x5c9519,null))[_0xa8ae('0x20')](respondWithResult(_0x5c9519,null))[_0xa8ae('0x45')](handleError(_0x5c9519,null));};exports['create']=function(_0x5437b3,_0x374702){return db[_0xa8ae('0x28')]['create'](_0x5437b3[_0xa8ae('0x46')],{})[_0xa8ae('0x20')](respondWithResult(_0x374702,0xc9))[_0xa8ae('0x45')](handleError(_0x374702,null));};exports[_0xa8ae('0x1f')]=function(_0x338b24,_0x47a2ff){if(_0x338b24[_0xa8ae('0x46')]['id']){delete _0x338b24['body']['id'];}return db[_0xa8ae('0x28')][_0xa8ae('0x44')]({'where':{'id':_0x338b24[_0xa8ae('0x41')]['id']}})['then'](handleEntityNotFound(_0x47a2ff,null))[_0xa8ae('0x20')](saveUpdates(_0x338b24['body'],null))[_0xa8ae('0x20')](respondWithResult(_0x47a2ff,null))['catch'](handleError(_0x47a2ff,null));};exports[_0xa8ae('0x21')]=function(_0x473b0c,_0x1dddde){return db['WhatsappTransferReport']['find']({'where':{'id':_0x473b0c[_0xa8ae('0x41')]['id']}})[_0xa8ae('0x20')](handleEntityNotFound(_0x1dddde,null))[_0xa8ae('0x20')](removeEntity(_0x1dddde,null))[_0xa8ae('0x45')](handleError(_0x1dddde,null));};exports[_0xa8ae('0x47')]=function(_0x4590c1,_0x25ad6d){return db[_0xa8ae('0x28')][_0xa8ae('0x47')]()[_0xa8ae('0x20')](respondWithResult(_0x25ad6d,null))[_0xa8ae('0x45')](handleError(_0x25ad6d,null));};
\ No newline at end of file
+var _0x6380=['apply','update','then','destroy','error','name','send','index','map','WhatsappTransferReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','rawAttributes','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','status','Content-Range'];(function(_0x48025a,_0x19dbcf){var _0x42ae6a=function(_0x9ea881){while(--_0x9ea881){_0x48025a['push'](_0x48025a['shift']());}};_0x42ae6a(++_0x19dbcf);}(_0x6380,0x159));var _0x0638=function(_0x54de37,_0x1a8a09){_0x54de37=_0x54de37-0x0;var _0x50f433=_0x6380[_0x54de37];return _0x50f433;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0638('0x0'));var zipdir=require(_0x0638('0x1'));var jsonpatch=require(_0x0638('0x2'));var rp=require(_0x0638('0x3'));var moment=require(_0x0638('0x4'));var BPromise=require(_0x0638('0x5'));var Mustache=require(_0x0638('0x6'));var util=require('util');var path=require(_0x0638('0x7'));var sox=require(_0x0638('0x8'));var csv=require(_0x0638('0x9'));var ejs=require(_0x0638('0xa'));var fs=require('fs');var fs_extra=require(_0x0638('0xb'));var _=require(_0x0638('0xc'));var squel=require(_0x0638('0xd'));var crypto=require(_0x0638('0xe'));var jsforce=require(_0x0638('0xf'));var deskjs=require(_0x0638('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0638('0x11'));var Papa=require('papaparse');var Redis=require(_0x0638('0x12'));var authService=require(_0x0638('0x13'));var qs=require(_0x0638('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0638('0x15'))(_0x0638('0x16'));var utils=require(_0x0638('0x17'));var config=require(_0x0638('0x18'));var licenseUtil=require(_0x0638('0x19'));var db=require(_0x0638('0x1a'))['db'];function respondWithStatusCode(_0x53de4a,_0xd426ab){_0xd426ab=_0xd426ab||0xcc;return function(_0xc2c081){if(_0xc2c081){return _0x53de4a[_0x0638('0x1b')](_0xd426ab);}return _0x53de4a['status'](_0xd426ab)[_0x0638('0x1c')]();};}function respondWithResult(_0xc21892,_0x5b4251){_0x5b4251=_0x5b4251||0xc8;return function(_0x109f57){if(_0x109f57){return _0xc21892['status'](_0x5b4251)[_0x0638('0x1d')](_0x109f57);}};}function respondWithFilteredResult(_0x1cda33,_0x4c943c){return function(_0x12515a){if(_0x12515a){var _0x55ae4e=typeof _0x4c943c[_0x0638('0x1e')]===_0x0638('0x1f')&&typeof _0x4c943c[_0x0638('0x20')]===_0x0638('0x1f');var _0x2722b7=_0x12515a['count'];var _0x49ee55=_0x55ae4e?0x0:_0x4c943c[_0x0638('0x1e')];var _0x4d1d03=_0x55ae4e?_0x12515a['count']:_0x4c943c[_0x0638('0x1e')]+_0x4c943c['limit'];var _0x3bac8a;if(_0x4d1d03>=_0x2722b7){_0x4d1d03=_0x2722b7;_0x3bac8a=0xc8;}else{_0x3bac8a=0xce;}_0x1cda33[_0x0638('0x21')](_0x3bac8a);return _0x1cda33['set'](_0x0638('0x22'),_0x49ee55+'-'+_0x4d1d03+'/'+_0x2722b7)[_0x0638('0x1d')](_0x12515a);}return null;};}function patchUpdates(_0x588cea){return function(_0x26ba61){try{jsonpatch[_0x0638('0x23')](_0x26ba61,_0x588cea,!![]);}catch(_0x4bc376){return BPromise['reject'](_0x4bc376);}return _0x26ba61['save']();};}function saveUpdates(_0x2697d0,_0x4a916e){return function(_0x49dfdd){if(_0x49dfdd){return _0x49dfdd[_0x0638('0x24')](_0x2697d0)[_0x0638('0x25')](function(_0xb5d62){return _0xb5d62;});}return null;};}function removeEntity(_0x2dfb89,_0x36dcb4){return function(_0x38a4f0){if(_0x38a4f0){return _0x38a4f0[_0x0638('0x26')]()[_0x0638('0x25')](function(){_0x2dfb89[_0x0638('0x21')](0xcc)[_0x0638('0x1c')]();});}};}function handleEntityNotFound(_0x15d2cf,_0x5442c1){return function(_0x1d35e3){if(!_0x1d35e3){_0x15d2cf['sendStatus'](0x194);}return _0x1d35e3;};}function handleError(_0xa14abc,_0x210fc7){_0x210fc7=_0x210fc7||0x1f4;return function(_0x536996){logger[_0x0638('0x27')](_0x536996['stack']);if(_0x536996[_0x0638('0x28')]){delete _0x536996['name'];}_0xa14abc['status'](_0x210fc7)[_0x0638('0x29')](_0x536996);};}exports[_0x0638('0x2a')]=function(_0x21114f,_0x1c36d3){var _0x55f3d0={},_0x730b66={},_0x2548cd={'count':0x0,'rows':[]};var _0x2f209a=_[_0x0638('0x2b')](db[_0x0638('0x2c')]['rawAttributes'],function(_0x5473fc){return{'name':_0x5473fc[_0x0638('0x2d')],'type':_0x5473fc[_0x0638('0x2e')][_0x0638('0x2f')]};});_0x730b66[_0x0638('0x30')]=_[_0x0638('0x2b')](_0x2f209a,_0x0638('0x28'));_0x730b66[_0x0638('0x31')]=_[_0x0638('0x32')](_0x21114f[_0x0638('0x31')]);_0x730b66['filters']=_[_0x0638('0x33')](_0x730b66[_0x0638('0x30')],_0x730b66['query']);_0x55f3d0[_0x0638('0x34')]=_[_0x0638('0x33')](_0x730b66['model'],qs[_0x0638('0x35')](_0x21114f[_0x0638('0x31')][_0x0638('0x35')]));_0x55f3d0[_0x0638('0x34')]=_0x55f3d0[_0x0638('0x34')]['length']?_0x55f3d0[_0x0638('0x34')]:_0x730b66[_0x0638('0x30')];if(!_0x21114f[_0x0638('0x31')][_0x0638('0x36')](_0x0638('0x37'))){_0x55f3d0[_0x0638('0x20')]=qs[_0x0638('0x20')](_0x21114f['query'][_0x0638('0x20')]);_0x55f3d0[_0x0638('0x1e')]=qs[_0x0638('0x1e')](_0x21114f['query']['offset']);}_0x55f3d0[_0x0638('0x38')]=qs[_0x0638('0x39')](_0x21114f[_0x0638('0x31')]['sort']);_0x55f3d0['where']=qs[_0x0638('0x3a')](_[_0x0638('0x3b')](_0x21114f[_0x0638('0x31')],_0x730b66[_0x0638('0x3a')]),_0x2f209a);if(_0x21114f[_0x0638('0x31')][_0x0638('0x3c')]){_0x55f3d0[_0x0638('0x3d')]=_[_0x0638('0x3e')](_0x55f3d0[_0x0638('0x3d')],{'$or':_[_0x0638('0x2b')](_0x2f209a,function(_0x37590b){if(_0x37590b[_0x0638('0x2e')]!==_0x0638('0x3f')){var _0x365517={};_0x365517[_0x37590b['name']]={'$like':'%'+_0x21114f[_0x0638('0x31')][_0x0638('0x3c')]+'%'};return _0x365517;}})});}_0x55f3d0=_['merge']({},_0x55f3d0,_0x21114f[_0x0638('0x40')]);var _0x272ab6={'where':_0x55f3d0[_0x0638('0x3d')]};return db[_0x0638('0x2c')][_0x0638('0x41')](_0x272ab6)['then'](function(_0x375a43){_0x2548cd[_0x0638('0x41')]=_0x375a43;if(_0x21114f['query'][_0x0638('0x42')]){_0x55f3d0[_0x0638('0x43')]=[{'all':!![]}];}return db[_0x0638('0x2c')]['findAll'](_0x55f3d0);})[_0x0638('0x25')](function(_0x32ef24){_0x2548cd[_0x0638('0x44')]=_0x32ef24;return _0x2548cd;})[_0x0638('0x25')](respondWithFilteredResult(_0x1c36d3,_0x55f3d0))[_0x0638('0x45')](handleError(_0x1c36d3,null));};exports[_0x0638('0x46')]=function(_0x235746,_0x4337b2){var _0x4b8eb8={'raw':!![],'where':{'id':_0x235746[_0x0638('0x47')]['id']}},_0x58d11e={};_0x58d11e[_0x0638('0x30')]=_[_0x0638('0x32')](db[_0x0638('0x2c')][_0x0638('0x48')]);_0x58d11e[_0x0638('0x31')]=_[_0x0638('0x32')](_0x235746[_0x0638('0x31')]);_0x58d11e[_0x0638('0x3a')]=_[_0x0638('0x33')](_0x58d11e[_0x0638('0x30')],_0x58d11e[_0x0638('0x31')]);_0x4b8eb8['attributes']=_[_0x0638('0x33')](_0x58d11e[_0x0638('0x30')],qs[_0x0638('0x35')](_0x235746['query'][_0x0638('0x35')]));_0x4b8eb8[_0x0638('0x34')]=_0x4b8eb8[_0x0638('0x34')]['length']?_0x4b8eb8[_0x0638('0x34')]:_0x58d11e['model'];if(_0x235746[_0x0638('0x31')][_0x0638('0x42')]){_0x4b8eb8['include']=[{'all':!![]}];}_0x4b8eb8=_[_0x0638('0x3e')]({},_0x4b8eb8,_0x235746['options']);return db[_0x0638('0x2c')][_0x0638('0x49')](_0x4b8eb8)[_0x0638('0x25')](handleEntityNotFound(_0x4337b2,null))[_0x0638('0x25')](respondWithResult(_0x4337b2,null))[_0x0638('0x45')](handleError(_0x4337b2,null));};exports['create']=function(_0x322b8c,_0x476ebc){return db[_0x0638('0x2c')]['create'](_0x322b8c[_0x0638('0x4a')],{})['then'](respondWithResult(_0x476ebc,0xc9))['catch'](handleError(_0x476ebc,null));};exports[_0x0638('0x24')]=function(_0xa31093,_0x1d0d57){if(_0xa31093[_0x0638('0x4a')]['id']){delete _0xa31093[_0x0638('0x4a')]['id'];}return db[_0x0638('0x2c')]['find']({'where':{'id':_0xa31093[_0x0638('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d0d57,null))[_0x0638('0x25')](saveUpdates(_0xa31093[_0x0638('0x4a')],null))[_0x0638('0x25')](respondWithResult(_0x1d0d57,null))[_0x0638('0x45')](handleError(_0x1d0d57,null));};exports[_0x0638('0x26')]=function(_0x3cd94c,_0x5863fb){return db[_0x0638('0x2c')][_0x0638('0x49')]({'where':{'id':_0x3cd94c[_0x0638('0x47')]['id']}})[_0x0638('0x25')](handleEntityNotFound(_0x5863fb,null))['then'](removeEntity(_0x5863fb,null))[_0x0638('0x45')](handleError(_0x5863fb,null));};exports[_0x0638('0x4b')]=function(_0x4251b5,_0x9e582e){return db[_0x0638('0x2c')][_0x0638('0x4b')]()['then'](respondWithResult(_0x9e582e,null))[_0x0638('0x45')](handleError(_0x9e582e,null));};
\ No newline at end of file
index f0c51ac..a415fad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf289=['uniqueid','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','report_whatsapp_transfer'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0xf289,0x1ed));var _0x9f28=function(_0x364574,_0x4b80bc){_0x364574=_0x364574-0x0;var _0x3fefde=_0xf289[_0x364574];return _0x3fefde;};'use strict';var _=require(_0x9f28('0x0'));var util=require(_0x9f28('0x1'));var logger=require('../../config/logger')(_0x9f28('0x2'));var moment=require(_0x9f28('0x3'));var BPromise=require(_0x9f28('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9f28('0x5'));var rimraf=require(_0x9f28('0x6'));var config=require(_0x9f28('0x7'));var attributes=require(_0x9f28('0x8'));module[_0x9f28('0x9')]=function(_0x25f399,_0x34993b){return _0x25f399['define']('WhatsappTransferReport',attributes,{'tableName':_0x9f28('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9f28('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2648=['bluebird','path','rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','../../config/logger'];(function(_0x4b12e0,_0x4c0dc6){var _0x5a4fbf=function(_0xd4a812){while(--_0xd4a812){_0x4b12e0['push'](_0x4b12e0['shift']());}};_0x5a4fbf(++_0x4c0dc6);}(_0x2648,0x13f));var _0x8264=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2648[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8264('0x0'))('api');var moment=require('moment');var BPromise=require(_0x8264('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8264('0x2'));var rimraf=require(_0x8264('0x3'));var config=require(_0x8264('0x4'));var attributes=require('./whatsappTransferReport.attributes');module[_0x8264('0x5')]=function(_0x35797e,_0xffadcc){return _0x35797e[_0x8264('0x6')](_0x8264('0x7'),attributes,{'tableName':_0x8264('0x8'),'paranoid':![],'indexes':[{'name':_0x8264('0x9'),'fields':[_0x8264('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 68cd857..e155111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50bf=['WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info'];(function(_0x134529,_0x38721e){var _0x2da0e1=function(_0x9efcf6){while(--_0x9efcf6){_0x134529['push'](_0x134529['shift']());}};_0x2da0e1(++_0x38721e);}(_0x50bf,0x1c2));var _0xf50b=function(_0x58f17d,_0x13a598){_0x58f17d=_0x58f17d-0x0;var _0x382f0e=_0x50bf[_0x58f17d];return _0x382f0e;};'use strict';var _=require(_0xf50b('0x0'));var util=require(_0xf50b('0x1'));var moment=require(_0xf50b('0x2'));var BPromise=require(_0xf50b('0x3'));var rs=require(_0xf50b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf50b('0x5'))['db'];var utils=require(_0xf50b('0x6'));var logger=require(_0xf50b('0x7'))('rpc');var config=require(_0xf50b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf50b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37b1fa,_0x4d2490,_0x63f131){return new BPromise(function(_0x388ab6,_0x1bf38e){return client['request'](_0x37b1fa,_0x63f131)[_0xf50b('0xa')](function(_0x3532c0){logger[_0xf50b('0xb')](_0xf50b('0xc'),_0x4d2490,_0xf50b('0xd'));logger[_0xf50b('0xe')](_0xf50b('0xf'),_0x4d2490,'request\x20sent',JSON[_0xf50b('0x10')](_0x3532c0));if(_0x3532c0[_0xf50b('0x11')]){if(_0x3532c0[_0xf50b('0x11')][_0xf50b('0x12')]===0x1f4){logger[_0xf50b('0x11')](_0xf50b('0xc'),_0x4d2490,_0x3532c0[_0xf50b('0x11')][_0xf50b('0x13')]);return _0x1bf38e(_0x3532c0[_0xf50b('0x11')][_0xf50b('0x13')]);}logger[_0xf50b('0x11')](_0xf50b('0xc'),_0x4d2490,_0x3532c0[_0xf50b('0x11')]['message']);return _0x388ab6(_0x3532c0[_0xf50b('0x11')][_0xf50b('0x13')]);}else{logger[_0xf50b('0xb')](_0xf50b('0xc'),_0x4d2490,_0xf50b('0xd'));_0x388ab6(_0x3532c0[_0xf50b('0x14')][_0xf50b('0x13')]);}})[_0xf50b('0x15')](function(_0x1abacd){logger['error'](_0xf50b('0xc'),_0x4d2490,_0x1abacd);_0x1bf38e(_0x1abacd);});});}
\ No newline at end of file
+var _0xf18c=['debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x4c60d6,_0x3c3e5a){var _0x15c9c6=function(_0x2f0c07){while(--_0x2f0c07){_0x4c60d6['push'](_0x4c60d6['shift']());}};_0x15c9c6(++_0x3c3e5a);}(_0xf18c,0x1a7));var _0xcf18=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xf18c[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0xcf18('0x0'));var util=require(_0xcf18('0x1'));var moment=require('moment');var BPromise=require(_0xcf18('0x2'));var rs=require(_0xcf18('0x3'));var fs=require('fs');var Redis=require(_0xcf18('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf18('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xcf18('0x6'));var jayson=require(_0xcf18('0x7'));var client=jayson[_0xcf18('0x8')][_0xcf18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3940a1,_0x2ec0b0,_0x216ddd){return new BPromise(function(_0x5aef5d,_0x10ec45){return client[_0xcf18('0xa')](_0x3940a1,_0x216ddd)[_0xcf18('0xb')](function(_0x157b3d){logger[_0xcf18('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2ec0b0,_0xcf18('0xd'));logger[_0xcf18('0xe')](_0xcf18('0xf'),_0x2ec0b0,_0xcf18('0xd'),JSON[_0xcf18('0x10')](_0x157b3d));if(_0x157b3d[_0xcf18('0x11')]){if(_0x157b3d['error'][_0xcf18('0x12')]===0x1f4){logger[_0xcf18('0x11')](_0xcf18('0x13'),_0x2ec0b0,_0x157b3d[_0xcf18('0x11')][_0xcf18('0x14')]);return _0x10ec45(_0x157b3d[_0xcf18('0x11')][_0xcf18('0x14')]);}logger['error'](_0xcf18('0x13'),_0x2ec0b0,_0x157b3d[_0xcf18('0x11')][_0xcf18('0x14')]);return _0x5aef5d(_0x157b3d[_0xcf18('0x11')][_0xcf18('0x14')]);}else{logger[_0xcf18('0xc')]('WhatsappTransferReport,\x20%s,\x20%s',_0x2ec0b0,_0xcf18('0xd'));_0x5aef5d(_0x157b3d[_0xcf18('0x15')][_0xcf18('0x14')]);}})[_0xcf18('0x16')](function(_0x45f302){logger[_0xcf18('0x11')](_0xcf18('0x13'),_0x2ec0b0,_0x45f302);_0x10ec45(_0x45f302);});});}
\ No newline at end of file
index 4c52c86..264c76f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e2e=['then','listen','info','start','Online\x20apps:','map','filter','online','name','join','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sync'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0e2e,0xd7));var _0xe0e2=function(_0x11c6e7,_0x4391ae){_0x11c6e7=_0x11c6e7-0x0;var _0x14f255=_0x0e2e[_0x11c6e7];return _0x14f255;};'use strict';var _=require(_0xe0e2('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require('./config/environment');var logger=require(_0xe0e2('0x1'))('app');var pm2=require(_0xe0e2('0x2'));var pm2Config=require(_0xe0e2('0x3'));var schedule=require(_0xe0e2('0x4'));var chat=require(_0xe0e2('0x5'));var whatsapp=require(_0xe0e2('0x6'));var transcribe=require(_0xe0e2('0x7'));function main(){return mysqldb['db']['sequelize'][_0xe0e2('0x8')]()[_0xe0e2('0x9')](function(){return rpc[_0xe0e2('0xa')]();})[_0xe0e2('0x9')](function(_0x373f06){logger[_0xe0e2('0xb')](_0x373f06);return chat['start']();})[_0xe0e2('0x9')](function(){return whatsapp[_0xe0e2('0xc')]();})[_0xe0e2('0x9')](function(){return schedule[_0xe0e2('0xc')]();})[_0xe0e2('0x9')](function(){return transcribe[_0xe0e2('0xc')]();})[_0xe0e2('0x9')](function(_0x1cbfbf){logger[_0xe0e2('0xb')](_0x1cbfbf);return pm2[_0xe0e2('0xc')](pm2Config);})[_0xe0e2('0x9')](function(_0x449154){logger[_0xe0e2('0xb')](_0xe0e2('0xd'),_[_0xe0e2('0xe')](_[_0xe0e2('0xf')](_0x449154,{'status':_0xe0e2('0x10')}),_0xe0e2('0x11'))[_0xe0e2('0x12')]());logger[_0xe0e2('0xb')]('Offline\x20apps:',_[_0xe0e2('0xe')](_['filter'](_0x449154,function(_0x4cae5c){return _0x4cae5c['status']!==_0xe0e2('0x10');}),_0xe0e2('0x11'))['join']()||_0xe0e2('0x13'));config[_0xe0e2('0x14')]&&require(_0xe0e2('0x15'))[_0xe0e2('0x16')]();require(_0xe0e2('0x17'))[_0xe0e2('0x16')]();})[_0xe0e2('0x18')](function(_0xedc058){logger[_0xe0e2('0x19')](_0xe0e2('0x1a'),_0xedc058);process[_0xe0e2('0x1b')](0x1);});}main();
\ No newline at end of file
+var _0xac83=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','map','filter','online','name','join','Offline\x20apps:','None','./config/seedDB','./config/license','catch','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac83,0x119));var _0x3ac8=function(_0x5b27da,_0x4a6532){_0x5b27da=_0x5b27da-0x0;var _0x3254f4=_0xac83[_0x5b27da];return _0x3254f4;};'use strict';var _=require(_0x3ac8('0x0'));var mysqldb=require(_0x3ac8('0x1'));var rpc=require(_0x3ac8('0x2'));var config=require(_0x3ac8('0x3'));var logger=require(_0x3ac8('0x4'))(_0x3ac8('0x5'));var pm2=require(_0x3ac8('0x6'));var pm2Config=require(_0x3ac8('0x7'));var schedule=require(_0x3ac8('0x8'));var chat=require(_0x3ac8('0x9'));var whatsapp=require(_0x3ac8('0xa'));var transcribe=require(_0x3ac8('0xb'));function main(){return mysqldb['db'][_0x3ac8('0xc')][_0x3ac8('0xd')]()[_0x3ac8('0xe')](function(){return rpc[_0x3ac8('0xf')]();})[_0x3ac8('0xe')](function(_0x2fa342){logger[_0x3ac8('0x10')](_0x2fa342);return chat[_0x3ac8('0x11')]();})[_0x3ac8('0xe')](function(){return whatsapp[_0x3ac8('0x11')]();})[_0x3ac8('0xe')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x3ac8('0x11')]();})['then'](function(_0x16d6f5){logger[_0x3ac8('0x10')](_0x16d6f5);return pm2[_0x3ac8('0x11')](pm2Config);})[_0x3ac8('0xe')](function(_0x213e2f){logger[_0x3ac8('0x10')]('Online\x20apps:',_[_0x3ac8('0x12')](_[_0x3ac8('0x13')](_0x213e2f,{'status':_0x3ac8('0x14')}),_0x3ac8('0x15'))[_0x3ac8('0x16')]());logger[_0x3ac8('0x10')](_0x3ac8('0x17'),_['map'](_[_0x3ac8('0x13')](_0x213e2f,function(_0x5535fc){return _0x5535fc['status']!==_0x3ac8('0x14');}),_0x3ac8('0x15'))[_0x3ac8('0x16')]()||_0x3ac8('0x18'));config['seedDB']&&require(_0x3ac8('0x19'))['default']();require(_0x3ac8('0x1a'))['default']();})[_0x3ac8('0x1b')](function(_0x1c570c){logger[_0x3ac8('0x1c')](_0x3ac8('0x1d'),_0x1c570c);process[_0x3ac8('0x1e')](0x1);});}main();
\ No newline at end of file
index 3fda427..f360b6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x743c=['query','apikey','getUuid','sub','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','add','blockDuration','minutes','Invalid\x20API\x20access\x20key','catch','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','regenerateApiKey','validatePasswordPattern','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~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','join','promisify','sign','payload','secrets','session','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','crypto','util','moment','role','name','email','permissions','md5secret','chatPause','faxPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','json','Unmanaged.','Forbidden.','isAuthenticated','headers','startsWith','authorization','Basic','User','find','authenticate','pass','status','Bearer'];(function(_0x8e0257,_0x4b84ee){var _0x5ad3af=function(_0x2e17b8){while(--_0x2e17b8){_0x8e0257['push'](_0x8e0257['shift']());}};_0x5ad3af(++_0x4b84ee);}(_0x743c,0xab));var _0xc743=function(_0x1b3ddb,_0x190f99){_0x1b3ddb=_0x1b3ddb-0x0;var _0x3b952d=_0x743c[_0x1b3ddb];return _0x3b952d;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xc743('0x0'));var hardwareConf=require(_0xc743('0x1'));var licenseUtil=require(_0xc743('0x2'));var encryptor=require(_0xc743('0x3'));var _=require(_0xc743('0x4'));var jwt=require(_0xc743('0x5'));var expressJwt=require(_0xc743('0x6'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require(_0xc743('0x7'));var BPromise=require('bluebird');var util=require(_0xc743('0x8'));var moment=require(_0xc743('0x9'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0xc743('0xa'),'fullname',_0xc743('0xb'),'internal',_0xc743('0xc'),'userpic',_0xc743('0xd'),_0xc743('0xe'),'voicePause',_0xc743('0xf'),'mailPause',_0xc743('0x10'),'smsPause','openchannelPause','pauseType',_0xc743('0x11'),_0xc743('0x12'),_0xc743('0x13'),_0xc743('0x14'),_0xc743('0x15'),'passwordResetAt',_0xc743('0x16'),_0xc743('0x17'),_0xc743('0x18'),'phoneBarDnd',_0xc743('0x19'),_0xc743('0x1a'),_0xc743('0x1b'),_0xc743('0x1c'),'phoneBarPrefixRequired',_0xc743('0x1d'),_0xc743('0x1e'),_0xc743('0x1f'),'interface',_0xc743('0x20'),_0xc743('0x21'),_0xc743('0x22'),_0xc743('0x23'),_0xc743('0x24'),_0xc743('0x25'),_0xc743('0x26')];exports[_0xc743('0x27')]=function(){return this['isAuthenticated'](!![])[_0xc743('0x28')](function(_0x222c3a,_0x163ffc,_0x553d84){if(_0x222c3a[_0xc743('0x29')]){_0x553d84();}else{return db[_0xc743('0x2a')][_0xc743('0x2b')]({'where':{'id':_0x222c3a[_0xc743('0x2c')]['id']},'attributes':['id',_0xc743('0x2d'),_0xc743('0x2e')],'raw':!![]})[_0xc743('0x2f')](function(_0x247863){if(_0x247863&&_0x247863['closed']){return _0x163ffc['status'](_0x247863[_0xc743('0x2e')]===_0xc743('0x30')?0x195:0x193)[_0xc743('0x31')]({'message':_0x247863[_0xc743('0x2e')]==='unmanaged'?_0xc743('0x32'):_0xc743('0x33')});}else{_0x553d84();}})['catch'](function(_0x40e3f4){_0x553d84(_0x40e3f4);});}});};exports[_0xc743('0x34')]=function isAuthenticated(_0x5e8c0c){return compose()['use'](function(_0x1e0bc7,_0x424d64,_0x5bdfc7){var _0x170c06;if(_0x1e0bc7[_0xc743('0x35')]['authorization']){if(_[_0xc743('0x36')](_0x1e0bc7['headers'][_0xc743('0x37')],_0xc743('0x38'))){var _0x378cd9=basicAuth(_0x1e0bc7);db[_0xc743('0x39')][_0xc743('0x3a')]({'where':{'name':_0x378cd9[_0xc743('0xb')]}})[_0xc743('0x2f')](function(_0x36bcd5){if(!_0x36bcd5||!_0x36bcd5[_0xc743('0x3b')](_0x378cd9[_0xc743('0x3c')])){return _0x424d64[_0xc743('0x3d')](0x191)[_0xc743('0x31')]({'message':'Wrong\x20credentials.'});}_0x1e0bc7[_0xc743('0x29')]={'id':_0x36bcd5['id']};_0x5bdfc7();})['catch'](function(_0x21a018){_0x5bdfc7(_0x21a018);});}else if(_[_0xc743('0x36')](_0x1e0bc7['headers'][_0xc743('0x37')],_0xc743('0x3e'))){validateJwt(_0x1e0bc7,_0x424d64,_0x5bdfc7);}else{if(_0x5e8c0c){_0x5bdfc7();}else{return _0x424d64['status'](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x1e0bc7[_0xc743('0x3f')][_0xc743('0x40')]){try{var _0x23cb44={'audience':hardwareConf[_0xc743('0x41')](),'issuer':hardwareConf[_0xc743('0x41')]()};verifyJwt(_0x1e0bc7[_0xc743('0x3f')][_0xc743('0x40')],_0x23cb44)[_0xc743('0x2f')](function(_0x2edc74){return db[_0xc743('0x39')]['find']({'where':{'id':_0x2edc74[_0xc743('0x42')]}})[_0xc743('0x2f')](function(_0x545c3c){_0x170c06=_0x545c3c;return db['Setting'][_0xc743('0x2b')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]});})[_0xc743('0x2f')](function(_0x34f24c){if(!_0x170c06||!_['isEqual'](_0x170c06['apiKeyNonce'],_0x2edc74['nonce'])){return _0x424d64[_0xc743('0x3d')](0x191)[_0xc743('0x31')]({'message':_0xc743('0x43')});}if(_0x170c06[_0xc743('0x44')]){return _0x424d64[_0xc743('0x3d')](0x191)[_0xc743('0x31')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x170c06[_0xc743('0x45')]){if(_0x34f24c['blockDuration']>0x0){if(moment(_0x170c06['blockedAt'])[_0xc743('0x46')](_0x34f24c[_0xc743('0x47')],_0xc743('0x48'))>moment()){return _0x424d64[_0xc743('0x3d')](0x191)[_0xc743('0x31')]({'message':_0xc743('0x49')});}}else{return _0x424d64[_0xc743('0x3d')](0x191)[_0xc743('0x31')]({'message':_0xc743('0x49')});}}_0x1e0bc7[_0xc743('0x29')]={'id':_0x170c06['id']};_0x5bdfc7();});})[_0xc743('0x4a')](function(){return _0x424d64[_0xc743('0x3d')](0x191)[_0xc743('0x31')]({'message':_0xc743('0x49')});});}catch(_0x103090){_0x5bdfc7(_0x103090);}}else if(_0x5e8c0c){_0x5bdfc7();}else{return _0x424d64[_0xc743('0x3d')](0x193)[_0xc743('0x31')]({'message':'Unknown\x20authorization\x20format'});}})[_0xc743('0x28')](function(_0x24d52e,_0x671b2b,_0x3d4b7f){if(_0x24d52e[_0xc743('0x29')]){db['User'][_0xc743('0x3a')]({'where':{'id':_0x24d52e[_0xc743('0x29')]['id']},'attributes':userAttributes})[_0xc743('0x2f')](function(_0x33f0e9){if(!_0x33f0e9){return _0x671b2b[_0xc743('0x3d')](0x194)['json']({'message':_0xc743('0x4b')});}_0x24d52e[_0xc743('0x29')]=_0x33f0e9;_0x3d4b7f();})[_0xc743('0x4a')](function(_0x413bb7){_0x3d4b7f(_0x413bb7);});}else if(_0x5e8c0c){_0x3d4b7f();}else{return _0x671b2b['status'](0x194)['json']({'message':_0xc743('0x4c')});}});};exports[_0xc743('0x4d')]=function canUpdate(){return compose()['use'](function(_0x3cfb73,_0x4d4ccd,_0x48c5af){return licenseUtil[_0xc743('0x4e')]()[_0xc743('0x2f')](function(_0x5daf45){if(_0x5daf45['update']){_0x48c5af();}else{return _0x4d4ccd[_0xc743('0x3d')](0x193)[_0xc743('0x31')]({'message':_0xc743('0x4f')});}})[_0xc743('0x4a')](function(_0x509850){_0x48c5af(_0x509850);});});};exports[_0xc743('0x50')]=function(_0x1a02ad,_0x4b8b26,_0x1d2d6b){_0x1a02ad[_0xc743('0x50')]=!![];return _0x1d2d6b();};exports[_0xc743('0x51')]=function signToken(_0x41f6be){return signJwt(_0x41f6be);};exports['setTokenCookie']=function(_0x105fa5,_0x7a3e98){if(!_0x105fa5['user']){return _0x7a3e98['status'](0x194)['json']({'message':_0xc743('0x52')});}var _0x1569f8={'payload':{'id':_0x105fa5[_0xc743('0x29')]['id'],'role':_0x105fa5['user'][_0xc743('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x1569f8)[_0xc743('0x2f')](function(_0x3e35ce){_0x7a3e98[_0xc743('0x53')](_0xc743('0x54'),_0x3e35ce);_0x7a3e98[_0xc743('0x55')](_0xc743('0x56'));})[_0xc743('0x4a')](function(_0x4b7f77){return _0x7a3e98['status'](0x1f4)[_0xc743('0x57')](_0x4b7f77);});};exports[_0xc743('0x58')]=function(_0x409f45){if(_[_0xc743('0x59')](_0x409f45[_0xc743('0x5a')])||_['isNil'](_0x409f45['apiKeyIat'])){return null;}else{return createJwt(_0x409f45);}};exports['generateApiKey']=function(_0x1d8d6d){_0x1d8d6d[_0xc743('0x5a')]=generateNonce();_0x1d8d6d[_0xc743('0x5b')]=generateIssuedAt();return createJwt(_0x1d8d6d);};exports[_0xc743('0x5c')]=function(_0x179f2c,_0x265787){var _0x11ec5e=_0x179f2c[_0xc743('0x3f')][_0xc743('0x40')];if(_0x11ec5e){var _0x1a3322={'nonce':_0x265787['apiKeyNonce'],'iat':_0x265787[_0xc743('0x5b')],'audience':hardwareConf[_0xc743('0x41')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x11ec5e,_0x1a3322)[_0xc743('0x2f')](function(){return generateApiKey(_0x265787);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xc743('0x5d')]=function(_0x35e0ad){var _0x1e8f84=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1e8f84[_0xc743('0x5e')](_0x35e0ad))throw new db['Sequelize'][(_0xc743('0x5f'))](_0xc743('0x60'));return;};exports[_0xc743('0x61')]=function(_0xa21a19,_0x1de892,_0xb2dafa){var _0x1bb0f4=encryptor[_0xc743('0x62')](_0x1de892)[_0xc743('0x63')](',');for(var _0x4d0f48=0x0;_0x4d0f48<_0xb2dafa;_0x4d0f48++){if(!_0x1bb0f4[_0x4d0f48])break;if(_0xa21a19['toLowerCase']()===_0x1bb0f4[_0x4d0f48][_0xc743('0x64')]()){var _0xa42d67=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0xb2dafa);if(_0xb2dafa===0x1){_0xa42d67=_0xc743('0x65');}throw new db['Sequelize'][(_0xc743('0x5f'))](_0xa42d67);}}return;};exports[_0xc743('0x66')]=function(_0x483c61,_0x102df6){var _0x473842=_0x102df6?encryptor[_0xc743('0x62')](_0x102df6)[_0xc743('0x63')](','):[];if(_0x473842[_0xc743('0x67')]===0x5){_0x473842[_0xc743('0x68')](-0x1,0x1);}_0x473842['unshift'](_0x483c61);return encryptor['encryptString'](_0x473842[_0xc743('0x69')](','));};function signJwt(_0x2204a6){var _0x1a848c=BPromise[_0xc743('0x6a')](jwt[_0xc743('0x6b')],{'context':jwt});var _0xcf06cd=_0x2204a6['secret']||config['secrets']['session'];return new BPromise(function(_0x4c6dd1,_0x184af0){_0x1a848c(_0x2204a6[_0xc743('0x6c')],_0xcf06cd,_0x2204a6['options'])['then'](function(_0x261641){_0x4c6dd1(_0x261641);})[_0xc743('0x4a')](function(_0x56dd8b){_0x184af0(_0x56dd8b);});});}function verifyJwt(_0x4ff17c,_0x277377,_0x4c4897){var _0x1948c3=BPromise[_0xc743('0x6a')](jwt['verify'],{'context':jwt});var _0xec7d0d=_0x4c4897||config[_0xc743('0x6d')][_0xc743('0x6e')];return new BPromise(function(_0x19ccb6,_0x3a04d7){_0x1948c3(_0x4ff17c,_0xec7d0d,_0x277377)[_0xc743('0x2f')](function(_0x5e0d2d){_0x19ccb6(_0x5e0d2d);})['catch'](function(_0x5bb4bc){_0x3a04d7(_0x5bb4bc);});});}function generateNonce(){return crypto[_0xc743('0x6f')](0x10)[_0xc743('0x70')](_0xc743('0x71'));}function generateIssuedAt(){return Math[_0xc743('0x72')](Date[_0xc743('0x73')]()/0x3e8)[_0xc743('0x70')]();}function createJwt(_0x6fbcf0){var _0x43e86a={'payload':{'iat':_0x6fbcf0[_0xc743('0x5b')],'nonce':_0x6fbcf0[_0xc743('0x5a')]},'options':{'algorithm':_0xc743('0x74'),'subject':_0x6fbcf0['id'][_0xc743('0x70')](),'issuer':hardwareConf[_0xc743('0x41')](),'audience':hardwareConf[_0xc743('0x41')]()}};return signJwt(_0x43e86a)[_0xc743('0x2f')](function(_0x5398e6){return{'iat':_0x6fbcf0[_0xc743('0x5b')],'nonce':_0x6fbcf0[_0xc743('0x5a')],'token':_0x5398e6};});}
\ No newline at end of file
+var _0x5c0f=['generateApiKey','apiKeyNonce','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','Sequelize','length','splice','unshift','encryptString','join','sign','payload','options','promisify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','basic-auth','crypto','bluebird','util','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','status','json','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','startsWith','Basic','User','authenticate','pass','Wrong\x20credentials.','query','apikey','getUuid','find','sub','Setting','blockDuration','isEqual','nonce','Invalid\x20API\x20access\x20key','blockedAt','minutes','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','/dashboards/general','retrieveApiKey','isNil'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5c0f,0x9b));var _0xf5c0=function(_0x50f469,_0x1439fc){_0x50f469=_0x50f469-0x0;var _0x4af9d4=_0x5c0f[_0x50f469];return _0x4af9d4;};'use strict';var db=require(_0xf5c0('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xf5c0('0x1'));var licenseUtil=require(_0xf5c0('0x2'));var encryptor=require(_0xf5c0('0x3'));var _=require('lodash');var jwt=require(_0xf5c0('0x4'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0xf5c0('0x5'));var crypto=require(_0xf5c0('0x6'));var BPromise=require(_0xf5c0('0x7'));var util=require(_0xf5c0('0x8'));var moment=require(_0xf5c0('0x9'));var validateJwt=expressJwt({'secret':config[_0xf5c0('0xa')][_0xf5c0('0xb')]});var userAttributes=['id',_0xf5c0('0xc'),_0xf5c0('0xd'),_0xf5c0('0xe'),_0xf5c0('0xf'),_0xf5c0('0x10'),_0xf5c0('0x11'),_0xf5c0('0x12'),_0xf5c0('0x13'),_0xf5c0('0x14'),_0xf5c0('0x15'),_0xf5c0('0x16'),'faxPause',_0xf5c0('0x17'),_0xf5c0('0x18'),_0xf5c0('0x19'),_0xf5c0('0x1a'),_0xf5c0('0x1b'),_0xf5c0('0x1c'),'crudPermissions','allowmessenger',_0xf5c0('0x1d'),_0xf5c0('0x1e'),_0xf5c0('0x1f'),_0xf5c0('0x20'),_0xf5c0('0x21'),_0xf5c0('0x22'),_0xf5c0('0x23'),'phoneBarEnableSettings',_0xf5c0('0x24'),_0xf5c0('0x25'),_0xf5c0('0x26'),'phoneBarRemoteControlPort',_0xf5c0('0x27'),_0xf5c0('0x28'),_0xf5c0('0x29'),_0xf5c0('0x2a'),_0xf5c0('0x2b'),_0xf5c0('0x2c'),_0xf5c0('0x2d'),'downloadOmnichannelInteractions',_0xf5c0('0x2e')];exports[_0xf5c0('0x2f')]=function(){return this[_0xf5c0('0x30')](!![])[_0xf5c0('0x31')](function(_0x1f4f75,_0x4f895a,_0x591ec9){if(_0x1f4f75[_0xf5c0('0x32')]){_0x591ec9();}else{return db[_0xf5c0('0x33')][_0xf5c0('0x34')]({'where':{'id':_0x1f4f75[_0xf5c0('0x35')]['id']},'attributes':['id',_0xf5c0('0x36'),_0xf5c0('0x37')],'raw':!![]})[_0xf5c0('0x38')](function(_0x3fb93a){if(_0x3fb93a&&_0x3fb93a[_0xf5c0('0x36')]){return _0x4f895a[_0xf5c0('0x39')](_0x3fb93a[_0xf5c0('0x37')]==='unmanaged'?0x195:0x193)[_0xf5c0('0x3a')]({'message':_0x3fb93a[_0xf5c0('0x37')]===_0xf5c0('0x3b')?_0xf5c0('0x3c'):_0xf5c0('0x3d')});}else{_0x591ec9();}})[_0xf5c0('0x3e')](function(_0x559f82){_0x591ec9(_0x559f82);});}});};exports[_0xf5c0('0x30')]=function isAuthenticated(_0xdcb92a){return compose()['use'](function(_0xa393d9,_0x2a2282,_0x3f0c0d){var _0x282f01;if(_0xa393d9[_0xf5c0('0x3f')][_0xf5c0('0x40')]){if(_[_0xf5c0('0x41')](_0xa393d9[_0xf5c0('0x3f')]['authorization'],_0xf5c0('0x42'))){var _0x29e95b=basicAuth(_0xa393d9);db[_0xf5c0('0x43')]['find']({'where':{'name':_0x29e95b[_0xf5c0('0xe')]}})[_0xf5c0('0x38')](function(_0x3912a4){if(!_0x3912a4||!_0x3912a4[_0xf5c0('0x44')](_0x29e95b[_0xf5c0('0x45')])){return _0x2a2282[_0xf5c0('0x39')](0x191)['json']({'message':_0xf5c0('0x46')});}_0xa393d9['user']={'id':_0x3912a4['id']};_0x3f0c0d();})[_0xf5c0('0x3e')](function(_0x2587d1){_0x3f0c0d(_0x2587d1);});}else if(_[_0xf5c0('0x41')](_0xa393d9[_0xf5c0('0x3f')][_0xf5c0('0x40')],'Bearer')){validateJwt(_0xa393d9,_0x2a2282,_0x3f0c0d);}else{if(_0xdcb92a){_0x3f0c0d();}else{return _0x2a2282['status'](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xa393d9[_0xf5c0('0x47')][_0xf5c0('0x48')]){try{var _0x3b2e1f={'audience':hardwareConf[_0xf5c0('0x49')](),'issuer':hardwareConf[_0xf5c0('0x49')]()};verifyJwt(_0xa393d9['query'][_0xf5c0('0x48')],_0x3b2e1f)[_0xf5c0('0x38')](function(_0x5bfbd3){return db[_0xf5c0('0x43')][_0xf5c0('0x4a')]({'where':{'id':_0x5bfbd3[_0xf5c0('0x4b')]}})[_0xf5c0('0x38')](function(_0x3a5b80){_0x282f01=_0x3a5b80;return db[_0xf5c0('0x4c')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xf5c0('0x4d')],'raw':!![]});})[_0xf5c0('0x38')](function(_0x570bfa){if(!_0x282f01||!_[_0xf5c0('0x4e')](_0x282f01['apiKeyNonce'],_0x5bfbd3[_0xf5c0('0x4f')])){return _0x2a2282['status'](0x191)[_0xf5c0('0x3a')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x282f01['disabled']){return _0x2a2282['status'](0x191)[_0xf5c0('0x3a')]({'message':_0xf5c0('0x50')});}if(_0x282f01['blocked']){if(_0x570bfa[_0xf5c0('0x4d')]>0x0){if(moment(_0x282f01[_0xf5c0('0x51')])['add'](_0x570bfa[_0xf5c0('0x4d')],_0xf5c0('0x52'))>moment()){return _0x2a2282['status'](0x191)[_0xf5c0('0x3a')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2a2282[_0xf5c0('0x39')](0x191)[_0xf5c0('0x3a')]({'message':_0xf5c0('0x50')});}}_0xa393d9[_0xf5c0('0x32')]={'id':_0x282f01['id']};_0x3f0c0d();});})[_0xf5c0('0x3e')](function(){return _0x2a2282[_0xf5c0('0x39')](0x191)[_0xf5c0('0x3a')]({'message':_0xf5c0('0x50')});});}catch(_0x4690e8){_0x3f0c0d(_0x4690e8);}}else if(_0xdcb92a){_0x3f0c0d();}else{return _0x2a2282[_0xf5c0('0x39')](0x193)['json']({'message':_0xf5c0('0x53')});}})[_0xf5c0('0x31')](function(_0x1d9d7b,_0x3b43d5,_0x2ef1ef){if(_0x1d9d7b[_0xf5c0('0x32')]){db[_0xf5c0('0x43')][_0xf5c0('0x4a')]({'where':{'id':_0x1d9d7b['user']['id']},'attributes':userAttributes})[_0xf5c0('0x38')](function(_0xc5ec63){if(!_0xc5ec63){return _0x3b43d5[_0xf5c0('0x39')](0x194)['json']({'message':_0xf5c0('0x54')});}_0x1d9d7b[_0xf5c0('0x32')]=_0xc5ec63;_0x2ef1ef();})[_0xf5c0('0x3e')](function(_0x1b9269){_0x2ef1ef(_0x1b9269);});}else if(_0xdcb92a){_0x2ef1ef();}else{return _0x3b43d5['status'](0x194)['json']({'message':_0xf5c0('0x55')});}});};exports[_0xf5c0('0x56')]=function canUpdate(){return compose()[_0xf5c0('0x31')](function(_0x2218ef,_0x338c82,_0xdd046){return licenseUtil[_0xf5c0('0x57')]()['then'](function(_0x531702){if(_0x531702[_0xf5c0('0x58')]){_0xdd046();}else{return _0x338c82[_0xf5c0('0x39')](0x193)[_0xf5c0('0x3a')]({'message':'Forbidden'});}})[_0xf5c0('0x3e')](function(_0x1d37e4){_0xdd046(_0x1d37e4);});});};exports[_0xf5c0('0x59')]=function(_0x49c4e5,_0x480785,_0x4758f7){_0x49c4e5[_0xf5c0('0x59')]=!![];return _0x4758f7();};exports[_0xf5c0('0x5a')]=function signToken(_0x278292){return signJwt(_0x278292);};exports[_0xf5c0('0x5b')]=function(_0x445e8a,_0x5fcc1a){if(!_0x445e8a[_0xf5c0('0x32')]){return _0x5fcc1a[_0xf5c0('0x39')](0x194)['json']({'message':_0xf5c0('0x5c')});}var _0x3d4404={'payload':{'id':_0x445e8a[_0xf5c0('0x32')]['id'],'role':_0x445e8a[_0xf5c0('0x32')][_0xf5c0('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3d4404)[_0xf5c0('0x38')](function(_0x572785){_0x5fcc1a['cookie']('motion.token',_0x572785);_0x5fcc1a[_0xf5c0('0x5d')](_0xf5c0('0x5e'));})[_0xf5c0('0x3e')](function(_0x27feff){return _0x5fcc1a[_0xf5c0('0x39')](0x1f4)['send'](_0x27feff);});};exports[_0xf5c0('0x5f')]=function(_0xfe5bb0){if(_[_0xf5c0('0x60')](_0xfe5bb0['apiKeyNonce'])||_[_0xf5c0('0x60')](_0xfe5bb0['apiKeyIat'])){return null;}else{return createJwt(_0xfe5bb0);}};exports[_0xf5c0('0x61')]=function(_0xc4a35d){_0xc4a35d[_0xf5c0('0x62')]=generateNonce();_0xc4a35d[_0xf5c0('0x63')]=generateIssuedAt();return createJwt(_0xc4a35d);};exports[_0xf5c0('0x64')]=function(_0x2fc669,_0x34c77e){var _0x362ecb=_0x2fc669[_0xf5c0('0x47')][_0xf5c0('0x48')];if(_0x362ecb){var _0x615f41={'nonce':_0x34c77e[_0xf5c0('0x62')],'iat':_0x34c77e[_0xf5c0('0x63')],'audience':hardwareConf[_0xf5c0('0x49')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x362ecb,_0x615f41)['then'](function(){return generateApiKey(_0x34c77e);});}else{throw{'message':_0xf5c0('0x65')};}};exports['validatePasswordPattern']=function(_0x1d55f6){var _0x124d91=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x124d91['test'](_0x1d55f6))throw new db['Sequelize'][(_0xf5c0('0x66'))](_0xf5c0('0x67'));return;};exports[_0xf5c0('0x68')]=function(_0xcf0683,_0x5cac7a,_0x4f7e5c){var _0x59467f=encryptor[_0xf5c0('0x69')](_0x5cac7a)[_0xf5c0('0x6a')](',');for(var _0x230722=0x0;_0x230722<_0x4f7e5c;_0x230722++){if(!_0x59467f[_0x230722])break;if(_0xcf0683[_0xf5c0('0x6b')]()===_0x59467f[_0x230722][_0xf5c0('0x6b')]()){var _0x34f681=util[_0xf5c0('0x6c')](_0xf5c0('0x6d'),_0x4f7e5c);if(_0x4f7e5c===0x1){_0x34f681='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0xf5c0('0x6e'))][(_0xf5c0('0x66'))](_0x34f681);}}return;};exports['updatePasswordsHistory']=function(_0x4611e4,_0x7b7470){var _0x2d4a09=_0x7b7470?encryptor[_0xf5c0('0x69')](_0x7b7470)[_0xf5c0('0x6a')](','):[];if(_0x2d4a09[_0xf5c0('0x6f')]===0x5){_0x2d4a09[_0xf5c0('0x70')](-0x1,0x1);}_0x2d4a09[_0xf5c0('0x71')](_0x4611e4);return encryptor[_0xf5c0('0x72')](_0x2d4a09[_0xf5c0('0x73')](','));};function signJwt(_0x4f43b8){var _0x145bfb=BPromise['promisify'](jwt[_0xf5c0('0x74')],{'context':jwt});var _0xd17960=_0x4f43b8['secret']||config[_0xf5c0('0xa')][_0xf5c0('0xb')];return new BPromise(function(_0x19e6f9,_0x1ae269){_0x145bfb(_0x4f43b8[_0xf5c0('0x75')],_0xd17960,_0x4f43b8[_0xf5c0('0x76')])[_0xf5c0('0x38')](function(_0x528b03){_0x19e6f9(_0x528b03);})[_0xf5c0('0x3e')](function(_0x262294){_0x1ae269(_0x262294);});});}function verifyJwt(_0x30630b,_0x3dc327,_0x10a615){var _0x55c2e3=BPromise[_0xf5c0('0x77')](jwt['verify'],{'context':jwt});var _0x5807e4=_0x10a615||config[_0xf5c0('0xa')][_0xf5c0('0xb')];return new BPromise(function(_0x81b87e,_0x47257c){_0x55c2e3(_0x30630b,_0x5807e4,_0x3dc327)['then'](function(_0x4e2636){_0x81b87e(_0x4e2636);})['catch'](function(_0x575111){_0x47257c(_0x575111);});});}function generateNonce(){return crypto[_0xf5c0('0x78')](0x10)[_0xf5c0('0x79')](_0xf5c0('0x7a'));}function generateIssuedAt(){return Math[_0xf5c0('0x7b')](Date[_0xf5c0('0x7c')]()/0x3e8)[_0xf5c0('0x79')]();}function createJwt(_0xcd70ed){var _0x1fe2f5={'payload':{'iat':_0xcd70ed[_0xf5c0('0x63')],'nonce':_0xcd70ed['apiKeyNonce']},'options':{'algorithm':_0xf5c0('0x7d'),'subject':_0xcd70ed['id'][_0xf5c0('0x79')](),'issuer':hardwareConf[_0xf5c0('0x49')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x1fe2f5)[_0xf5c0('0x38')](function(_0x1c86d6){return{'iat':_0xcd70ed[_0xf5c0('0x63')],'nonce':_0xcd70ed[_0xf5c0('0x62')],'token':_0x1c86d6};});}
\ No newline at end of file
index d2c1f5c..dd4249c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb659=['decryptString','base64','utf8','crypto','lodash','../../config/environment','../../config/logger','app','session','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','update','write','end','final','binary','close','unlink','createDecipher','secret'];(function(_0x342612,_0x33f937){var _0xd63c9e=function(_0x5f690){while(--_0x5f690){_0x342612['push'](_0x342612['shift']());}};_0xd63c9e(++_0x33f937);}(_0xb659,0x1c3));var _0x9b65=function(_0x5c2d75,_0x4035fc){_0x5c2d75=_0x5c2d75-0x0;var _0x48f399=_0xb659[_0x5c2d75];return _0x48f399;};'use strict';var crypto=require(_0x9b65('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x9b65('0x1'));var config=require(_0x9b65('0x2'));var logger=require(_0x9b65('0x3'))(_0x9b65('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x9b65('0x5')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x9b65('0x6')};if(config[_0x9b65('0x7')]&&config[_0x9b65('0x7')][_0x9b65('0x8')]){var isSupported=isAlgorithmSupported(config[_0x9b65('0x7')][_0x9b65('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0x9b65('0x7')][_0x9b65('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x9b65('0x9')](',\x20');logger['error'](config[_0x9b65('0x7')][_0x9b65('0x8')],_0x9b65('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x1fe6a1){return AES_SUPPORTED_RX[_0x9b65('0xb')](_0x1fe6a1);}function getSupportedCiphers(){return crypto[_0x9b65('0xc')]()[_0x9b65('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x3b389b){return getSupportedCiphers()['indexOf'](_0x3b389b)>-0x1;}function combineOptions(_0x1be10f){var _0x1aa62d={};for(var _0xcf24dc in fileOptions){if(fileOptions[_0x9b65('0xe')](_0xcf24dc)){_0x1aa62d[_0xcf24dc]=fileOptions[_0xcf24dc];}}if(_0x1be10f){for(var _0x15ed53 in _0x1be10f){if(_0x1be10f[_0x9b65('0xe')](_0x15ed53)){_0x1aa62d[_0x15ed53]=_0x1be10f[_0x15ed53];}}}return _0x1aa62d;}exports[_0x9b65('0xf')]=function(_0x528282,_0x16359a,_0x2c994a,_0x31dd50){return new BPromise(function(_0x2d941b,_0x53968f){_0x31dd50=combineOptions(_0x31dd50);var _0xbb596=new Buffer(_0x2c994a);var _0x4d25f1=fs[_0x9b65('0x10')](_0x528282);var _0x590238=fs[_0x9b65('0x11')](_0x16359a);var _0x4d9810=crypto[_0x9b65('0x12')](_0x31dd50[_0x9b65('0x8')],_0xbb596);_0x4d25f1['on'](_0x9b65('0x13'),function(_0x57dd0c){var _0x376e22=new Buffer(_0x4d9810[_0x9b65('0x14')](_0x57dd0c),'binary');_0x590238[_0x9b65('0x15')](_0x376e22);});_0x4d25f1['on'](_0x9b65('0x16'),function(){try{var _0x4a4d49=new Buffer(_0x4d9810[_0x9b65('0x17')](_0x9b65('0x18')),'binary');_0x590238[_0x9b65('0x15')](_0x4a4d49);_0x590238[_0x9b65('0x16')]();_0x590238['on'](_0x9b65('0x19'),function(){return _0x2d941b(_0x16359a);});}catch(_0xca6e52){fs[_0x9b65('0x1a')](_0x16359a);return _0x53968f(_0xca6e52);}});});};exports['decryptFile']=function(_0x185034,_0x40b81c,_0xae00c4,_0x47844c){return new BPromise(function(_0x597c1a,_0x25306e){_0x47844c=combineOptions(_0x47844c);var _0xc2d981=new Buffer(_0xae00c4);var _0x330165=fs[_0x9b65('0x10')](_0x185034);var _0x3f5644=fs[_0x9b65('0x11')](_0x40b81c);var _0x35456c=crypto[_0x9b65('0x1b')](_0x47844c[_0x9b65('0x8')],_0xc2d981);_0x330165['on']('data',function(_0x4db66a){var _0xcdd470=new Buffer(_0x35456c[_0x9b65('0x14')](_0x4db66a),_0x9b65('0x18'));_0x3f5644[_0x9b65('0x15')](_0xcdd470);});_0x330165['on'](_0x9b65('0x16'),function(){try{var _0x287189=new Buffer(_0x35456c[_0x9b65('0x17')](_0x9b65('0x18')),_0x9b65('0x18'));_0x3f5644[_0x9b65('0x15')](_0x287189);_0x3f5644[_0x9b65('0x16')]();_0x3f5644['on'](_0x9b65('0x19'),function(){return _0x597c1a(_0x40b81c);});}catch(_0x5a1210){fs[_0x9b65('0x1a')](_0x40b81c);return _0x25306e(_0x5a1210);}});});};exports['encryptString']=function(_0x2cb9f6,_0x4f8dc0,_0x584c00){var _0x47abd6=_0x584c00||stringOptions['algorithm'];var _0x42aca6=_0x4f8dc0||stringOptions[_0x9b65('0x1c')];var _0x385449=crypto['createCipher'](_0x47abd6,_0x42aca6);var _0x3f24da=_0x385449[_0x9b65('0x14')](_0x2cb9f6,'utf8','base64');_0x3f24da+=_0x385449[_0x9b65('0x17')]('base64');return _0x3f24da;};exports[_0x9b65('0x1d')]=function(_0x16f3b9,_0x2f6a5b,_0x272b0e){var _0x2d81d9=_0x272b0e||stringOptions['algorithm'];var _0x37196a=_0x2f6a5b||stringOptions['secret'];var _0x74a2e1=crypto[_0x9b65('0x1b')](_0x2d81d9,_0x37196a);var _0x4d0f44=_0x74a2e1[_0x9b65('0x14')](_0x16f3b9,_0x9b65('0x1e'),_0x9b65('0x1f'));_0x4d0f44+=_0x74a2e1[_0x9b65('0x17')](_0x9b65('0x1f'));return _0x4d0f44;};
\ No newline at end of file
+var _0xde24=['decryptFile','createWriteStream','createDecipher','data','encryptString','secret','utf8','base64','decryptString','bluebird','lodash','session','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createCipher','update','binary','end','final','write','close','unlink'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xde24,0xc9));var _0x4de2=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde24[_0xa464c9];return _0x3d73c4;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x4de2('0x0'));var _=require(_0x4de2('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')('app');const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x4de2('0x2')],'algorithm':_0x4de2('0x3')};const fileOptions={'algorithm':_0x4de2('0x4')};if(config[_0x4de2('0x5')]&&config[_0x4de2('0x5')][_0x4de2('0x6')]){var isSupported=isAlgorithmSupported(config[_0x4de2('0x5')][_0x4de2('0x6')]);if(isSupported){fileOptions[_0x4de2('0x6')]=config['encrypt'][_0x4de2('0x6')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0x4de2('0x7')](config[_0x4de2('0x5')][_0x4de2('0x6')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x3677de){return AES_SUPPORTED_RX[_0x4de2('0x8')](_0x3677de);}function getSupportedCiphers(){return crypto[_0x4de2('0x9')]()[_0x4de2('0xa')](isASupportedCipher);}function isAlgorithmSupported(_0x234f53){return getSupportedCiphers()[_0x4de2('0xb')](_0x234f53)>-0x1;}function combineOptions(_0x69cd35){var _0x544924={};for(var _0x2d1459 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2d1459)){_0x544924[_0x2d1459]=fileOptions[_0x2d1459];}}if(_0x69cd35){for(var _0x2ad627 in _0x69cd35){if(_0x69cd35[_0x4de2('0xc')](_0x2ad627)){_0x544924[_0x2ad627]=_0x69cd35[_0x2ad627];}}}return _0x544924;}exports[_0x4de2('0xd')]=function(_0x39080d,_0x10bcac,_0x59466a,_0x22658f){return new BPromise(function(_0x2e3508,_0xa9f10b){_0x22658f=combineOptions(_0x22658f);var _0x9cb23d=new Buffer(_0x59466a);var _0x5b46f0=fs[_0x4de2('0xe')](_0x39080d);var _0xa73067=fs['createWriteStream'](_0x10bcac);var _0x28b76d=crypto[_0x4de2('0xf')](_0x22658f['algorithm'],_0x9cb23d);_0x5b46f0['on']('data',function(_0x2602c0){var _0x2a8344=new Buffer(_0x28b76d[_0x4de2('0x10')](_0x2602c0),_0x4de2('0x11'));_0xa73067['write'](_0x2a8344);});_0x5b46f0['on'](_0x4de2('0x12'),function(){try{var _0x27ea80=new Buffer(_0x28b76d[_0x4de2('0x13')]('binary'),'binary');_0xa73067[_0x4de2('0x14')](_0x27ea80);_0xa73067[_0x4de2('0x12')]();_0xa73067['on'](_0x4de2('0x15'),function(){return _0x2e3508(_0x10bcac);});}catch(_0x2c08cb){fs[_0x4de2('0x16')](_0x10bcac);return _0xa9f10b(_0x2c08cb);}});});};exports[_0x4de2('0x17')]=function(_0x712600,_0x318211,_0x1212c8,_0x3e2c9f){return new BPromise(function(_0x1c51a8,_0x38541a){_0x3e2c9f=combineOptions(_0x3e2c9f);var _0x582e06=new Buffer(_0x1212c8);var _0x4c40e0=fs[_0x4de2('0xe')](_0x712600);var _0x25bb3c=fs[_0x4de2('0x18')](_0x318211);var _0x26df77=crypto[_0x4de2('0x19')](_0x3e2c9f['algorithm'],_0x582e06);_0x4c40e0['on'](_0x4de2('0x1a'),function(_0x40c68b){var _0x3a2565=new Buffer(_0x26df77[_0x4de2('0x10')](_0x40c68b),_0x4de2('0x11'));_0x25bb3c['write'](_0x3a2565);});_0x4c40e0['on'](_0x4de2('0x12'),function(){try{var _0x4219d8=new Buffer(_0x26df77[_0x4de2('0x13')](_0x4de2('0x11')),'binary');_0x25bb3c['write'](_0x4219d8);_0x25bb3c[_0x4de2('0x12')]();_0x25bb3c['on']('close',function(){return _0x1c51a8(_0x318211);});}catch(_0x41f195){fs['unlink'](_0x318211);return _0x38541a(_0x41f195);}});});};exports[_0x4de2('0x1b')]=function(_0x28cf84,_0x55fcab,_0x5b1199){var _0x4a5808=_0x5b1199||stringOptions[_0x4de2('0x6')];var _0x457698=_0x55fcab||stringOptions[_0x4de2('0x1c')];var _0x12b3f7=crypto[_0x4de2('0xf')](_0x4a5808,_0x457698);var _0x1b66e7=_0x12b3f7[_0x4de2('0x10')](_0x28cf84,_0x4de2('0x1d'),_0x4de2('0x1e'));_0x1b66e7+=_0x12b3f7[_0x4de2('0x13')](_0x4de2('0x1e'));return _0x1b66e7;};exports[_0x4de2('0x1f')]=function(_0x34e4c5,_0x5bf391,_0x54c994){var _0x497384=_0x54c994||stringOptions['algorithm'];var _0x4b7644=_0x5bf391||stringOptions['secret'];var _0xf12f56=crypto['createDecipher'](_0x497384,_0x4b7644);var _0x5aa993=_0xf12f56['update'](_0x34e4c5,_0x4de2('0x1e'),_0x4de2('0x1d'));_0x5aa993+=_0xf12f56['final']('utf8');return _0x5aa993;};
\ No newline at end of file
index d96aa0f..6042afb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0fd9=['split','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','existsSync','mkdirSync','each','join','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','path','lodash','to-csv','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','sequelize','QueryTypes','SELECT','num','Empty','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0fd9,0xa3));var _0x90fd=function(_0x16e0c8,_0x4861eb){_0x16e0c8=_0x16e0c8-0x0;var _0xe4b5af=_0x0fd9[_0x16e0c8];return _0xe4b5af;};'use strict';var util=require('util');var path=require(_0x90fd('0x0'));var _=require(_0x90fd('0x1'));var csv=require(_0x90fd('0x2'));var fs=require('fs');var BPromise=require(_0x90fd('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x90fd('0x4'))['db'];var dbH=require(_0x90fd('0x4'))[_0x90fd('0x5')];var logger=require(_0x90fd('0x6'))(_0x90fd('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x90fd('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x128c17,_0x50c778){var _0x5a604a={'status':_0x128c17};var _0x2acef7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x50c778){_0x5a604a[_0x90fd('0x9')]=_0x50c778;}return db['AnalyticExtractedReport'][_0x90fd('0xa')](_0x5a604a,_0x2acef7);}function main(){var _0x464236=0x1388;var _0x3c0592;logger[_0x90fd('0xb')](util[_0x90fd('0xc')](_0x90fd('0xd'),EXTRACTED_REPORT_ID,_0x90fd('0xe')));return db[_0x90fd('0xf')][_0x90fd('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x90fd('0x11')]})[_0x90fd('0x12')](function(_0x4e8b99){if(_0x4e8b99){_0x3c0592=_0x4e8b99;_0x464236=_0x3c0592[_0x90fd('0x11')]||0x1388;}})[_0x90fd('0x12')](function(){return dbH[_0x90fd('0x13')]['query'](util[_0x90fd('0xc')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x90fd('0x13')][_0x90fd('0x14')][_0x90fd('0x15')]});})[_0x90fd('0x12')](function(_0x3c5da8){if(!_0x3c5da8[0x0][_0x90fd('0x16')]){return analyticExtractedReport(_0x90fd('0x17'));}var _0x4eb953=[];var _0x4f6b7b=0x0;var _0x1e1cea=!![];if(_0x3c5da8&&_0x3c5da8[_0x90fd('0x18')]){var _0x4baa2c=_0x3c5da8[0x0][_0x90fd('0x16')]%(_0x4f6b7b+_0x464236);if(_0x3c0592[_0x90fd('0x19')]){for(;_0x1e1cea;_0x4f6b7b+=_0x464236,_0x4baa2c=_0x3c5da8[0x0][_0x90fd('0x16')]%(_0x4f6b7b+_0x464236)){if(_0x4baa2c==0x0||_0x4baa2c==_0x3c5da8[0x0]['num']){_0x1e1cea=![];}_0x4eb953[_0x90fd('0x1a')](dbH[_0x90fd('0x13')][_0x90fd('0x1b')](util[_0x90fd('0xc')](_0x90fd('0x1c'),QUERY,_0x464236,_0x4f6b7b),{'type':dbH[_0x90fd('0x13')][_0x90fd('0x14')][_0x90fd('0x15')]}));}}else{_0x4eb953[_0x90fd('0x1a')](dbH[_0x90fd('0x13')][_0x90fd('0x1b')](QUERY,{'type':dbH[_0x90fd('0x13')][_0x90fd('0x14')][_0x90fd('0x15')]}));}}var _0x34a2f4=path['dirname'](PATH);var _0x35ce4e=path[_0x90fd('0x1d')](PATH,_0x90fd('0x1e'));var _0x1b47e5=_0x3c0592[_0x90fd('0x19')]&&_0x4eb953[_0x90fd('0x18')]>0x1;var _0x30f67e=[];if(!fs[_0x90fd('0x1f')](path['join'](_0x34a2f4,_0x35ce4e))&&_0x1b47e5){fs[_0x90fd('0x20')](path['join'](_0x34a2f4,_0x35ce4e));}return BPromise[_0x90fd('0x21')](_0x4eb953,function(_0x18d5b3){_0x30f67e[_0x90fd('0x1a')](_0x18d5b3);})[_0x90fd('0x12')](function(){for(var _0x18beb5=0x0;_0x18beb5<_0x30f67e['length'];_0x18beb5+=0x1){var _0x35c38d;var _0xe333f0=_0x30f67e[_0x18beb5];if(_0x1b47e5){_0x35c38d=path[_0x90fd('0x22')](_0x34a2f4,_0x35ce4e,util[_0x90fd('0xc')](_0x90fd('0x23'),_0x35ce4e,_0x18beb5,_0x90fd('0x24')));}else{_0x35c38d=path['join'](_0x34a2f4,util['format'](_0x90fd('0x25'),_0x35ce4e,_0x90fd('0x24')));}fs[_0x90fd('0x26')](_0x35c38d,csv(_0xe333f0));}})[_0x90fd('0x12')](function(){if(_0x1b47e5){zipdir(path[_0x90fd('0x22')](_0x34a2f4,_0x35ce4e),{'saveTo':path['join'](_0x34a2f4,util['format'](_0x90fd('0x25'),_0x35ce4e,_0x90fd('0x27')))},function(_0x228fbc,_0x3a0102){});rimraf(path['join'](_0x34a2f4,_0x35ce4e),function(){});}})['then'](function(){logger[_0x90fd('0xb')](util[_0x90fd('0xc')](_0x90fd('0x28'),EXTRACTED_REPORT_ID,_0x90fd('0xe')));return analyticExtractedReport('Completed',_0x1b47e5?util[_0x90fd('0xc')](_0x90fd('0x25'),_0x35ce4e,_0x1b47e5?_0x90fd('0x27'):_0x90fd('0x24')):null);});})[_0x90fd('0x29')](function(_0x204255){logger[_0x90fd('0xb')](util[_0x90fd('0xc')](_0x90fd('0x2a'),EXTRACTED_REPORT_ID,_0x90fd('0xe')),util[_0x90fd('0x2b')](_0x204255,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x90fd('0x2c'));})[_0x90fd('0x2d')](function(){process[_0x90fd('0x2e')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x3c81=['format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.csv','existsSync','join','each','csv','writeFileSync','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','finally','exit','util','path','to-csv','bluebird','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info'];(function(_0x4f28fa,_0x150e41){var _0x371ae1=function(_0x182c33){while(--_0x182c33){_0x4f28fa['push'](_0x4f28fa['shift']());}};_0x371ae1(++_0x150e41);}(_0x3c81,0x102));var _0x13c8=function(_0x3ad7e5,_0x5b5a5d){_0x3ad7e5=_0x3ad7e5-0x0;var _0x5bfcdc=_0x3c81[_0x3ad7e5];return _0x5bfcdc;};'use strict';var util=require(_0x13c8('0x0'));var path=require(_0x13c8('0x1'));var _=require('lodash');var csv=require(_0x13c8('0x2'));var fs=require('fs');var BPromise=require(_0x13c8('0x3'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x13c8('0x4')];var logger=require(_0x13c8('0x5'))(_0x13c8('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x13c8('0x7')][0x2]);var QUERY=process[_0x13c8('0x7')][0x3];var PATH=process[_0x13c8('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x445b69,_0x4f7bcc){var _0x17c228={'status':_0x445b69};var _0x4905c3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4f7bcc){_0x17c228[_0x13c8('0x8')]=_0x4f7bcc;}return db[_0x13c8('0x9')][_0x13c8('0xa')](_0x17c228,_0x4905c3);}function main(){var _0x30b4d6=0x1388;var _0xaa58b6;logger[_0x13c8('0xb')](util[_0x13c8('0xc')](_0x13c8('0xd'),EXTRACTED_REPORT_ID,_0x13c8('0xe')));return db[_0x13c8('0xf')][_0x13c8('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x13c8('0x11'),_0x13c8('0x12')]})[_0x13c8('0x13')](function(_0x5ab91d){if(_0x5ab91d){_0xaa58b6=_0x5ab91d;_0x30b4d6=_0xaa58b6[_0x13c8('0x12')]||0x1388;}})[_0x13c8('0x13')](function(){return dbH[_0x13c8('0x14')][_0x13c8('0x15')](util['format'](_0x13c8('0x16'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x13c8('0x13')](function(_0x5e0e06){if(!_0x5e0e06[0x0][_0x13c8('0x17')]){return analyticExtractedReport(_0x13c8('0x18'));}var _0x23f64e=[];var _0x7cbfb=0x0;var _0x5d7906=!![];if(_0x5e0e06&&_0x5e0e06[_0x13c8('0x19')]){var _0x408abc=_0x5e0e06[0x0][_0x13c8('0x17')]%(_0x7cbfb+_0x30b4d6);if(_0xaa58b6[_0x13c8('0x11')]){for(;_0x5d7906;_0x7cbfb+=_0x30b4d6,_0x408abc=_0x5e0e06[0x0][_0x13c8('0x17')]%(_0x7cbfb+_0x30b4d6)){if(_0x408abc==0x0||_0x408abc==_0x5e0e06[0x0][_0x13c8('0x17')]){_0x5d7906=![];}_0x23f64e[_0x13c8('0x1a')](dbH[_0x13c8('0x14')][_0x13c8('0x15')](util[_0x13c8('0xc')](_0x13c8('0x1b'),QUERY,_0x30b4d6,_0x7cbfb),{'type':dbH['sequelize'][_0x13c8('0x1c')][_0x13c8('0x1d')]}));}}else{_0x23f64e[_0x13c8('0x1a')](dbH[_0x13c8('0x14')]['query'](QUERY,{'type':dbH[_0x13c8('0x14')][_0x13c8('0x1c')][_0x13c8('0x1d')]}));}}var _0x1f60ed=path[_0x13c8('0x1e')](PATH);var _0x2fc123=path['basename'](PATH,_0x13c8('0x1f'));var _0x1d8e9f=_0xaa58b6[_0x13c8('0x11')]&&_0x23f64e[_0x13c8('0x19')]>0x1;var _0x577df6=[];if(!fs[_0x13c8('0x20')](path[_0x13c8('0x21')](_0x1f60ed,_0x2fc123))&&_0x1d8e9f){fs['mkdirSync'](path['join'](_0x1f60ed,_0x2fc123));}return BPromise[_0x13c8('0x22')](_0x23f64e,function(_0x4aff35){_0x577df6['push'](_0x4aff35);})['then'](function(){for(var _0x288c3c=0x0;_0x288c3c<_0x577df6[_0x13c8('0x19')];_0x288c3c+=0x1){var _0x53ada9;var _0x4df077=_0x577df6[_0x288c3c];if(_0x1d8e9f){_0x53ada9=path[_0x13c8('0x21')](_0x1f60ed,_0x2fc123,util['format']('%s%d.%s',_0x2fc123,_0x288c3c,_0x13c8('0x23')));}else{_0x53ada9=path[_0x13c8('0x21')](_0x1f60ed,util[_0x13c8('0xc')]('%s.%s',_0x2fc123,'csv'));}fs[_0x13c8('0x24')](_0x53ada9,csv(_0x4df077));}})[_0x13c8('0x13')](function(){if(_0x1d8e9f){zipdir(path[_0x13c8('0x21')](_0x1f60ed,_0x2fc123),{'saveTo':path[_0x13c8('0x21')](_0x1f60ed,util[_0x13c8('0xc')](_0x13c8('0x25'),_0x2fc123,_0x13c8('0x26')))},function(_0x4a1b9c,_0x109cb8){});rimraf(path[_0x13c8('0x21')](_0x1f60ed,_0x2fc123),function(){});}})['then'](function(){logger['info'](util[_0x13c8('0xc')](_0x13c8('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x13c8('0x28'),_0x1d8e9f?util[_0x13c8('0xc')]('%s.%s',_0x2fc123,_0x1d8e9f?_0x13c8('0x26'):_0x13c8('0x23')):null);});})[_0x13c8('0x29')](function(_0x26a93b){logger[_0x13c8('0xb')](util[_0x13c8('0xc')](_0x13c8('0x2a'),EXTRACTED_REPORT_ID,_0x13c8('0xe')),util['inspect'](_0x26a93b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x13c8('0x2b')](function(){process[_0x13c8('0x2c')](EXIT_CODE);});}main();
\ No newline at end of file
index 7ef767b..5365f70 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57f7=['mkdirSync','all','flatten','createPdfKitDocument','%s%d.%s','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','zip','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','lodash','util','path','moment','html-to-pdfmake','rimraf','JSDOM','window','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','AnalyticExtractedReport','update','map','pick','toString','fill','length','body','push','concat','chunk','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','num','Empty','dirname','basename','.pdf','join','%s.%s','pdf','Setting','find','split','then','splitSizePdf','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes'];(function(_0x419f8a,_0x1628cc){var _0xa57e4=function(_0x250d15){while(--_0x250d15){_0x419f8a['push'](_0x419f8a['shift']());}};_0xa57e4(++_0x1628cc);}(_0x57f7,0x1ef));var _0x757f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x57f7[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x757f('0x0'));var fs=require('fs');var util=require(_0x757f('0x1'));var path=require(_0x757f('0x2'));var moment=require(_0x757f('0x3'));var htmlToPdfmake=require(_0x757f('0x4'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x757f('0x5'));var JSDOM=require('jsdom')[_0x757f('0x6')];var window=new JSDOM('')[_0x757f('0x7')];var db=require(_0x757f('0x8'))['db'];var dbH=require(_0x757f('0x8'))[_0x757f('0x9')];var logger=require(_0x757f('0xa'))(_0x757f('0xb'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x757f('0xc')][0x3];var PATH=process[_0x757f('0xc')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x757f('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x277a03,_0x26777f){var _0xbd79ec={'status':_0x277a03};var _0x2384f7={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x26777f){_0xbd79ec['savename']=_0x26777f;}return db[_0x757f('0xe')][_0x757f('0xf')](_0xbd79ec,_0x2384f7);}function getHeaders(_0x441569){return _['map'](_0x441569,function(_0x185aba){return{'text':_0x185aba,'style':'tableHeader'};});}function getRows(_0x5e88e8,_0x1f2612){return _[_0x757f('0x10')](_0x1f2612,function(_0x26f67e){return _(_0x26f67e)[_0x757f('0x11')](_0x5e88e8)['map'](function(_0x110cdc){return _0x110cdc?_[_0x757f('0x12')](_0x110cdc):'';})['value']();});}function createTable(_0x4e0622,_0x525059){var _0x1dbac1={'widths':_[_0x757f('0x13')](Array(_0x4e0622[_0x757f('0x14')]),0x91),'heights':function(_0x1c059a){return _0x1c059a===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0xc2a914=getHeaders(_0x4e0622);_0x1dbac1[_0x757f('0x15')][_0x757f('0x16')](_0xc2a914);var _0x5dd0a4=getRows(_0x4e0622,_0x525059);_0x1dbac1[_0x757f('0x15')]=_0x1dbac1[_0x757f('0x15')][_0x757f('0x17')](_0x5dd0a4);return _0x1dbac1;}function createTables(_0xf5a56d){var _0x38648e=[];var _0x1ffdd4=_[_0x757f('0x18')](Object['keys'](_0xf5a56d[0x0]),0x5);_0x1ffdd4[_0x757f('0x19')](function(_0x243c5a){_0x38648e[_0x757f('0x16')](createTable(_0x243c5a,_0xf5a56d));});return _0x38648e;}function getPDFDocDefinition(_0x74218){var _0x2e5fa2=util['format'](_0x757f('0x1a'),NAME,EXTRACTED_REPORT[_0x757f('0x1b')],moment(EXTRACTED_REPORT[_0x757f('0x1c')])[_0x757f('0x1d')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x757f('0x1d')](FORMAT));var _0x2f0b62=[];for(var _0xfb5965=0x0;_0xfb5965<_0x74218[_0x757f('0x14')];_0xfb5965++){var _0x50e8ef=[];if(_0xfb5965===0x0){_0x50e8ef['push']({'text':_0x2e5fa2,'style':_0x757f('0x1e')});}var _0x4e0b3c={'table':_0x74218[_0xfb5965]};if(_0xfb5965>0x0){_0x4e0b3c[_0x757f('0x1f')]=_0x757f('0x20');_0x4e0b3c[_0x757f('0x21')]=[0x0,0x46,0x0,0x0];}_0x50e8ef[_0x757f('0x16')](_0x4e0b3c);_0x2f0b62[_0x757f('0x16')](_0x50e8ef);}return{'pageSize':'A4','pageOrientation':_0x757f('0x22'),'content':_0x2f0b62,'footer':function(_0x3b8ac4,_0x53278a){return{'text':_0x3b8ac4[_0x757f('0x12')]()+_0x757f('0x23')+_0x53278a,'style':_0x757f('0x24')};},'defaultStyle':{'font':_0x757f('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x757f('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1f3e63){var _0x5d3704=0x1388;var _0xbc5f9d;if(!_0x1f3e63[0x0][_0x757f('0x27')]){return analyticExtractedReport(_0x757f('0x28'));}var _0x4385e8=[];var _0x37a605=0x0;var _0x33e5ad=!![];var _0x1d7b47=path[_0x757f('0x29')](PATH);var _0x31a70e=path[_0x757f('0x2a')](PATH,_0x757f('0x2b'));var _0x119194=path[_0x757f('0x2c')](_0x1d7b47,util['format'](_0x757f('0x2d'),_0x31a70e,_0x757f('0x2e')));var _0x5d5190=![];return db[_0x757f('0x2f')][_0x757f('0x30')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x757f('0x31'),'splitSizePdf']})[_0x757f('0x32')](function(_0xa30a57){if(_0xa30a57){_0xbc5f9d=_0xa30a57;_0x5d3704=_0xbc5f9d[_0x757f('0x33')]||0x3e8;}})['then'](function(){if(_0x1f3e63&&_0x1f3e63[_0x757f('0x14')]){var _0x38e129=_0x1f3e63[0x0]['num']%(_0x37a605+_0x5d3704);if(_0xbc5f9d[_0x757f('0x31')]){for(;_0x33e5ad;_0x37a605+=_0x5d3704,_0x38e129=_0x1f3e63[0x0]['num']%(_0x37a605+_0x5d3704)){if(_0x38e129==0x0||_0x38e129==_0x1f3e63[0x0][_0x757f('0x27')]){_0x33e5ad=![];}_0x4385e8[_0x757f('0x16')](dbH[_0x757f('0x34')][_0x757f('0x35')](util[_0x757f('0x1d')](_0x757f('0x36'),QUERY,_0x5d3704,_0x37a605),{'type':dbH['sequelize']['QueryTypes'][_0x757f('0x37')]}));}}else{_0x4385e8[_0x757f('0x16')](dbH[_0x757f('0x34')][_0x757f('0x35')](QUERY,{'type':dbH[_0x757f('0x34')][_0x757f('0x38')][_0x757f('0x37')]}));}}_0x5d5190=_0xbc5f9d['split']&&_0x4385e8[_0x757f('0x14')]>0x1;if(!fs['existsSync'](path['join'](_0x1d7b47,_0x31a70e))&&_0x5d5190){fs[_0x757f('0x39')](path[_0x757f('0x2c')](_0x1d7b47,_0x31a70e));}return Promise[_0x757f('0x3a')](_0x4385e8);})[_0x757f('0x32')](function(_0x5120b2){return createTables(_[_0x757f('0x3b')](_0x5120b2));})[_0x757f('0x32')](function(_0x48a987){var _0x14f7b4=getPDFDocDefinition(_0x48a987);var _0x9b8ea3=getPDFPrinter();var _0x128d30=_0x9b8ea3[_0x757f('0x3c')](_0x14f7b4);if(_0x5d5190)_0x119194=path[_0x757f('0x2c')](_0x1d7b47,_0x31a70e,util[_0x757f('0x1d')](_0x757f('0x3d'),_0x31a70e,index,_0x757f('0x2e')));return writePDFDocument(_0x128d30,_0x119194);})[_0x757f('0x32')](function(){if(!_0x5d5190)return;zipdir(path['join'](_0x1d7b47,_0x31a70e),{'saveTo':path[_0x757f('0x2c')](_0x1d7b47,util['format'](_0x757f('0x2d'),_0x31a70e,'zip'))},function(_0x472c78){if(_0x472c78)throw _0x472c78;return;});})['then'](function(){if(!_0x5d5190)return;rimraf(path['join'](_0x1d7b47,_0x31a70e),function(){});})['then'](function(){logger['info'](util[_0x757f('0x1d')](_0x757f('0x3e'),EXTRACTED_REPORT_ID,_0x757f('0x3f')));return analyticExtractedReport(_0x757f('0x40'),_0x5d5190?util['format']('%s.%s',_0x31a70e,_0x5d5190?_0x757f('0x41'):_0x757f('0x2e')):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x757f('0x42')](util[_0x757f('0x1d')](_0x757f('0x43'),EXTRACTED_REPORT_ID,_0x757f('0x44')));return db[_0x757f('0xe')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x757f('0x32')](function(_0x331780){EXTRACTED_REPORT=_0x331780;return dbH['sequelize'][_0x757f('0x35')](util[_0x757f('0x1d')](_0x757f('0x45'),QUERY),{'type':dbH['sequelize'][_0x757f('0x38')][_0x757f('0x37')]});})[_0x757f('0x32')](extractReport)[_0x757f('0x46')](function(_0x2de59e){logger[_0x757f('0x42')](util[_0x757f('0x1d')](_0x757f('0x47'),EXTRACTED_REPORT_ID,_0x757f('0x44')),util[_0x757f('0x48')](_0x2de59e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x757f('0x49'));})[_0x757f('0x4a')](function(){process[_0x757f('0x4b')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x16848c=new PdfPrinter({'Arial':{'normal':__dirname+_0x757f('0x4c'),'bold':__dirname+_0x757f('0x4d'),'italics':__dirname+_0x757f('0x4e'),'bolditalics':__dirname+_0x757f('0x4f')}});return _0x16848c;}function getPDFDocDefinitionFromHTML(_0x41d94b,_0x36c96a){var _0x29f558=util[_0x757f('0x1d')](_0x757f('0x50'),_0x36c96a[_0x757f('0x51')],_0x36c96a[_0x757f('0x52')]);var _0x57cba2=moment()[_0x757f('0x1d')](_0x757f('0x53'))[_0x757f('0x12')]();var _0x4b7543=htmlToPdfmake(_0x41d94b,{'window':window,'tableAutoSize':!![]});return{'content':[_0x4b7543],'defaultStyle':{'font':_0x757f('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x757f('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x757f('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x757f('0x55'),'style':_0x757f('0x1e')}];},'footer':function(_0x3f4eb8,_0x1453d5){return[{'text':util[_0x757f('0x1d')](_0x757f('0x56'),_0x29f558,_0x3f4eb8,_0x1453d5,_0x57cba2),'style':'footer'}];}};}function writePDFDocument(_0x3f037f,_0x3750ed){return new Promise(function(_0x3d33a6,_0x4a7f9d){var _0x503ea5=_0x3f037f[_0x757f('0x57')](fs[_0x757f('0x58')](_0x3750ed));_0x503ea5['on'](_0x757f('0x59'),function(){_0x3d33a6(_0x757f('0x59'));});_0x503ea5['on'](_0x757f('0x5a'),function(_0xef6df3){_0x4a7f9d(_0xef6df3);});_0x3f037f[_0x757f('0x5b')]();});}exports['createPdfFromHTML']=function(_0x302c7c,_0x129f1b){var _0x5b7bf9=getPDFPrinter();var _0x4abb3d=getPDFDocDefinitionFromHTML(_0x302c7c,_0x129f1b);var _0x7888b1=_0x5b7bf9[_0x757f('0x3c')](_0x4abb3d);return writePDFDocument(_0x7888b1,_0x129f1b[_0x757f('0x2')])[_0x757f('0x46')](function(_0x3acc89){throw _0x3acc89;});};
\ No newline at end of file
+var _0x1ee4=['map','toString','value','fill','auto','body','push','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','Empty','.pdf','join','%s.%s','split','splitSizePdf','then','num','query','sequelize','QueryTypes','SELECT','length','existsSync','mkdirSync','all','flatten','createPdfKitDocument','%s%d.%s','pdf','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','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','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','createPdfFromHTML','util','path','moment','html-to-pdfmake','zip-dir','rimraf','window','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','tableHeader'];(function(_0x2cca6e,_0x5c4d19){var _0x3ddfb5=function(_0x2ae4b8){while(--_0x2ae4b8){_0x2cca6e['push'](_0x2cca6e['shift']());}};_0x3ddfb5(++_0x5c4d19);}(_0x1ee4,0x9d));var _0x41ee=function(_0x4f0afc,_0x3d938e){_0x4f0afc=_0x4f0afc-0x0;var _0x4c4ca8=_0x1ee4[_0x4f0afc];return _0x4c4ca8;};'use strict';var _=require('lodash');var fs=require('fs');var util=require(_0x41ee('0x0'));var path=require(_0x41ee('0x1'));var moment=require(_0x41ee('0x2'));var htmlToPdfmake=require(_0x41ee('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0x41ee('0x4'));var rimraf=require(_0x41ee('0x5'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0x41ee('0x6')];var db=require(_0x41ee('0x7'))['db'];var dbH=require(_0x41ee('0x7'))[_0x41ee('0x8')];var logger=require(_0x41ee('0x9'))(_0x41ee('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x41ee('0xb')][0x2]);var QUERY=process[_0x41ee('0xb')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x41ee('0xb')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x272b7f,_0x34b57b){var _0x2b67d9={'status':_0x272b7f};var _0x3ef0c6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x34b57b){_0x2b67d9['savename']=_0x34b57b;}return db[_0x41ee('0xc')][_0x41ee('0xd')](_0x2b67d9,_0x3ef0c6);}function getHeaders(_0x4ca605){return _['map'](_0x4ca605,function(_0x11b5e9){return{'text':_0x11b5e9,'style':_0x41ee('0xe')};});}function getRows(_0x55240c,_0x336879){return _[_0x41ee('0xf')](_0x336879,function(_0x4f1ea7){return _(_0x4f1ea7)['pick'](_0x55240c)[_0x41ee('0xf')](function(_0x4f3f36){return _0x4f3f36?_[_0x41ee('0x10')](_0x4f3f36):'';})[_0x41ee('0x11')]();});}function createTable(_0x1c1121,_0x283cd2){var _0x27821f={'widths':_[_0x41ee('0x12')](Array(_0x1c1121['length']),0x91),'heights':function(_0x3072ff){return _0x3072ff===0x0?_0x41ee('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3ce2ab=getHeaders(_0x1c1121);_0x27821f[_0x41ee('0x14')][_0x41ee('0x15')](_0x3ce2ab);var _0x373a24=getRows(_0x1c1121,_0x283cd2);_0x27821f[_0x41ee('0x14')]=_0x27821f['body']['concat'](_0x373a24);return _0x27821f;}function createTables(_0x2ce7e9){var _0x55b1da=[];var _0x5d7d51=_[_0x41ee('0x16')](Object[_0x41ee('0x17')](_0x2ce7e9[0x0]),0x5);_0x5d7d51[_0x41ee('0x18')](function(_0x2b42c7){_0x55b1da[_0x41ee('0x15')](createTable(_0x2b42c7,_0x2ce7e9));});return _0x55b1da;}function getPDFDocDefinition(_0x45f5c6){var _0x47efa8=util[_0x41ee('0x19')](_0x41ee('0x1a'),NAME,EXTRACTED_REPORT[_0x41ee('0x1b')],moment(EXTRACTED_REPORT[_0x41ee('0x1c')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x41ee('0x1d')])[_0x41ee('0x19')](FORMAT));var _0x577ea5=[];for(var _0x19806d=0x0;_0x19806d<_0x45f5c6['length'];_0x19806d++){var _0x435629=[];if(_0x19806d===0x0){_0x435629[_0x41ee('0x15')]({'text':_0x47efa8,'style':_0x41ee('0x1e')});}var _0x3a5782={'table':_0x45f5c6[_0x19806d]};if(_0x19806d>0x0){_0x3a5782[_0x41ee('0x1f')]=_0x41ee('0x20');_0x3a5782[_0x41ee('0x21')]=[0x0,0x46,0x0,0x0];}_0x435629['push'](_0x3a5782);_0x577ea5['push'](_0x435629);}return{'pageSize':'A4','pageOrientation':_0x41ee('0x22'),'content':_0x577ea5,'footer':function(_0x447207,_0x284c46){return{'text':_0x447207[_0x41ee('0x10')]()+_0x41ee('0x23')+_0x284c46,'style':_0x41ee('0x24')};},'defaultStyle':{'font':_0x41ee('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x41308d){var _0x6d02=0x1388;var _0x2e29e9;if(!_0x41308d[0x0]['num']){return analyticExtractedReport(_0x41ee('0x26'));}var _0x27734d=[];var _0x22103d=0x0;var _0x18040c=!![];var _0x1ff189=path['dirname'](PATH);var _0x395ae4=path['basename'](PATH,_0x41ee('0x27'));var _0x159656=path[_0x41ee('0x28')](_0x1ff189,util[_0x41ee('0x19')](_0x41ee('0x29'),_0x395ae4,'pdf'));var _0x186572=![];return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x41ee('0x2a'),_0x41ee('0x2b')]})['then'](function(_0x421ad9){if(_0x421ad9){_0x2e29e9=_0x421ad9;_0x6d02=_0x2e29e9[_0x41ee('0x2b')]||0x3e8;}})[_0x41ee('0x2c')](function(){if(_0x41308d&&_0x41308d['length']){var _0x2702c6=_0x41308d[0x0]['num']%(_0x22103d+_0x6d02);if(_0x2e29e9[_0x41ee('0x2a')]){for(;_0x18040c;_0x22103d+=_0x6d02,_0x2702c6=_0x41308d[0x0][_0x41ee('0x2d')]%(_0x22103d+_0x6d02)){if(_0x2702c6==0x0||_0x2702c6==_0x41308d[0x0][_0x41ee('0x2d')]){_0x18040c=![];}_0x27734d['push'](dbH['sequelize'][_0x41ee('0x2e')](util[_0x41ee('0x19')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x6d02,_0x22103d),{'type':dbH[_0x41ee('0x2f')][_0x41ee('0x30')][_0x41ee('0x31')]}));}}else{_0x27734d[_0x41ee('0x15')](dbH[_0x41ee('0x2f')][_0x41ee('0x2e')](QUERY,{'type':dbH[_0x41ee('0x2f')][_0x41ee('0x30')][_0x41ee('0x31')]}));}}_0x186572=_0x2e29e9[_0x41ee('0x2a')]&&_0x27734d[_0x41ee('0x32')]>0x1;if(!fs[_0x41ee('0x33')](path[_0x41ee('0x28')](_0x1ff189,_0x395ae4))&&_0x186572){fs[_0x41ee('0x34')](path[_0x41ee('0x28')](_0x1ff189,_0x395ae4));}return Promise[_0x41ee('0x35')](_0x27734d);})['then'](function(_0x58e5f5){return createTables(_[_0x41ee('0x36')](_0x58e5f5));})['then'](function(_0x27c6c6){var _0x4780e6=getPDFDocDefinition(_0x27c6c6);var _0x33093f=getPDFPrinter();var _0xf4735a=_0x33093f[_0x41ee('0x37')](_0x4780e6);if(_0x186572)_0x159656=path['join'](_0x1ff189,_0x395ae4,util[_0x41ee('0x19')](_0x41ee('0x38'),_0x395ae4,index,_0x41ee('0x39')));return writePDFDocument(_0xf4735a,_0x159656);})[_0x41ee('0x2c')](function(){if(!_0x186572)return;zipdir(path[_0x41ee('0x28')](_0x1ff189,_0x395ae4),{'saveTo':path[_0x41ee('0x28')](_0x1ff189,util[_0x41ee('0x19')](_0x41ee('0x29'),_0x395ae4,_0x41ee('0x3a')))},function(_0x215e42){if(_0x215e42)throw _0x215e42;return;});})[_0x41ee('0x2c')](function(){if(!_0x186572)return;rimraf(path[_0x41ee('0x28')](_0x1ff189,_0x395ae4),function(){});})[_0x41ee('0x2c')](function(){logger[_0x41ee('0x3b')](util[_0x41ee('0x19')](_0x41ee('0x3c'),EXTRACTED_REPORT_ID,_0x41ee('0x3d')));return analyticExtractedReport(_0x41ee('0x3e'),_0x186572?util[_0x41ee('0x19')](_0x41ee('0x29'),_0x395ae4,_0x186572?_0x41ee('0x3a'):'pdf'):null);});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0x41ee('0x3f'),EXTRACTED_REPORT_ID,_0x41ee('0x40')));return db[_0x41ee('0xc')][_0x41ee('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x30b610){EXTRACTED_REPORT=_0x30b610;return dbH[_0x41ee('0x2f')][_0x41ee('0x2e')](util['format'](_0x41ee('0x42'),QUERY),{'type':dbH[_0x41ee('0x2f')]['QueryTypes'][_0x41ee('0x31')]});})[_0x41ee('0x2c')](extractReport)[_0x41ee('0x43')](function(_0xd81008){logger['info'](util[_0x41ee('0x19')](_0x41ee('0x44'),EXTRACTED_REPORT_ID,_0x41ee('0x40')),util[_0x41ee('0x45')](_0xd81008,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x41ee('0x46')](function(){process[_0x41ee('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x518803=new PdfPrinter({'Arial':{'normal':__dirname+_0x41ee('0x48'),'bold':__dirname+_0x41ee('0x49'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0x41ee('0x4a')}});return _0x518803;}function getPDFDocDefinitionFromHTML(_0x3f653a,_0x503725){var _0x113a53=util[_0x41ee('0x19')](_0x41ee('0x4b'),_0x503725[_0x41ee('0x4c')],_0x503725[_0x41ee('0x4d')]);var _0x22326a=moment()['format'](_0x41ee('0x4e'))[_0x41ee('0x10')]();var _0x1870e5=htmlToPdfmake(_0x3f653a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1870e5],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x41ee('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x41ee('0x4f')}},'header':function(){return[{'text':_0x41ee('0x50'),'style':'header'}];},'footer':function(_0x2d86d2,_0x172f48){return[{'text':util[_0x41ee('0x19')](_0x41ee('0x51'),_0x113a53,_0x2d86d2,_0x172f48,_0x22326a),'style':_0x41ee('0x24')}];}};}function writePDFDocument(_0x4e4e6c,_0x1ca27b){return new Promise(function(_0xe804fa,_0x2c208a){var _0x5dee64=_0x4e4e6c[_0x41ee('0x52')](fs['createWriteStream'](_0x1ca27b));_0x5dee64['on'](_0x41ee('0x53'),function(){_0xe804fa(_0x41ee('0x53'));});_0x5dee64['on'](_0x41ee('0x54'),function(_0x30d105){_0x2c208a(_0x30d105);});_0x4e4e6c['end']();});}exports[_0x41ee('0x55')]=function(_0x2757ac,_0x59ab3f){var _0x24a111=getPDFPrinter();var _0x3fa3be=getPDFDocDefinitionFromHTML(_0x2757ac,_0x59ab3f);var _0x52e3a4=_0x24a111['createPdfKitDocument'](_0x3fa3be);return writePDFDocument(_0x52e3a4,_0x59ab3f[_0x41ee('0x1')])[_0x41ee('0x43')](function(_0x13783c){throw _0x13783c;});};
\ No newline at end of file
index 33c9817..9bcdbcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1a4=['basename','.xlsx','existsSync','join','each','xlsx','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','then','splitSizeXlsx','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','num','Empty','split','length','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname'];(function(_0x5837d1,_0x4661e0){var _0x43b3b7=function(_0x22c638){while(--_0x22c638){_0x5837d1['push'](_0x5837d1['shift']());}};_0x43b3b7(++_0x4661e0);}(_0xf1a4,0x151));var _0x4f1a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf1a4[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x4f1a('0x0'));var path=require(_0x4f1a('0x1'));var _=require(_0x4f1a('0x2'));var fs=require('fs');var json2xls=require(_0x4f1a('0x3'));var BPromise=require(_0x4f1a('0x4'));var zipdir=require(_0x4f1a('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x4f1a('0x6')];var logger=require(_0x4f1a('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x4f1a('0x8')][0x2]);var QUERY=process[_0x4f1a('0x8')][0x3];var PATH=process[_0x4f1a('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x305949,_0x47d7dd){var _0x4ee84e={'status':_0x305949};var _0x328023={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x47d7dd){_0x4ee84e[_0x4f1a('0x9')]=_0x47d7dd;}return db[_0x4f1a('0xa')][_0x4f1a('0xb')](_0x4ee84e,_0x328023);}function main(){var _0x3e639c=0x1388;var _0x3f56c2;logger[_0x4f1a('0xc')](util[_0x4f1a('0xd')](_0x4f1a('0xe'),EXTRACTED_REPORT_ID,_0x4f1a('0xf')));return db[_0x4f1a('0x10')][_0x4f1a('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0x4f1a('0x12')](function(_0x4eaae9){if(_0x4eaae9){_0x3f56c2=_0x4eaae9;_0x3e639c=_0x3f56c2[_0x4f1a('0x13')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x4f1a('0x14')](util[_0x4f1a('0xd')](_0x4f1a('0x15'),QUERY),{'type':dbH['sequelize']['QueryTypes']['SELECT']});})[_0x4f1a('0x12')](function(_0x549f4f){if(!_0x549f4f[0x0][_0x4f1a('0x16')]){return analyticExtractedReport(_0x4f1a('0x17'));}var _0x3bf80e=[];var _0x2ba01b=0x0;var _0x4060f4=!![];if(_0x3f56c2[_0x4f1a('0x18')]){if(_0x549f4f&&_0x549f4f[_0x4f1a('0x19')]){var _0x3a8e71=_0x549f4f[0x0]['num']%(_0x2ba01b+_0x3e639c);for(;_0x4060f4;_0x2ba01b+=_0x3e639c,_0x3a8e71=_0x549f4f[0x0][_0x4f1a('0x16')]%(_0x2ba01b+_0x3e639c)){if(_0x3a8e71==0x0||_0x3a8e71==_0x549f4f[0x0][_0x4f1a('0x16')]){_0x4060f4=![];}_0x3bf80e[_0x4f1a('0x1a')](dbH[_0x4f1a('0x1b')][_0x4f1a('0x14')](util['format'](_0x4f1a('0x1c'),QUERY,_0x3e639c,_0x2ba01b),{'type':dbH[_0x4f1a('0x1b')][_0x4f1a('0x1d')]['SELECT']}));}}}else{_0x3bf80e[_0x4f1a('0x1a')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x4f1a('0x1b')][_0x4f1a('0x1d')]['SELECT']}));}var _0x11d93e=path[_0x4f1a('0x1e')](PATH);var _0x38cb69=path[_0x4f1a('0x1f')](PATH,_0x4f1a('0x20'));var _0x6b6318=_0x3f56c2[_0x4f1a('0x18')]&&_0x3bf80e[_0x4f1a('0x19')]>0x1;var _0x3860a7=[];if(!fs[_0x4f1a('0x21')](path[_0x4f1a('0x22')](_0x11d93e,_0x38cb69))&&_0x6b6318){fs['mkdirSync'](path['join'](_0x11d93e,_0x38cb69));}return BPromise[_0x4f1a('0x23')](_0x3bf80e,function(_0x3ba027){_0x3860a7[_0x4f1a('0x1a')](_0x3ba027);})[_0x4f1a('0x12')](function(){for(var _0x376515=0x0;_0x376515<_0x3860a7[_0x4f1a('0x19')];_0x376515+=0x1){var _0x12074c;var _0x1539a9=_0x3860a7[_0x376515];if(_0x6b6318){_0x12074c=path[_0x4f1a('0x22')](_0x11d93e,_0x38cb69,util[_0x4f1a('0xd')]('%s%d.%s',_0x38cb69,_0x376515,_0x4f1a('0x24')));}else{_0x12074c=path[_0x4f1a('0x22')](_0x11d93e,util[_0x4f1a('0xd')]('%s.%s',_0x38cb69,'xlsx'));}fs['writeFileSync'](_0x12074c,json2xls(_0x1539a9),_0x4f1a('0x25'));}})[_0x4f1a('0x12')](function(){if(_0x6b6318){zipdir(path[_0x4f1a('0x22')](_0x11d93e,_0x38cb69),{'saveTo':path['join'](_0x11d93e,util[_0x4f1a('0xd')](_0x4f1a('0x26'),_0x38cb69,_0x4f1a('0x27')))},function(_0x498c86,_0x4d3380){});rimraf(path['join'](_0x11d93e,_0x38cb69),function(){});}})[_0x4f1a('0x12')](function(){logger['info'](util[_0x4f1a('0xd')](_0x4f1a('0x28'),EXTRACTED_REPORT_ID,_0x4f1a('0xf')));return analyticExtractedReport(_0x4f1a('0x29'),_0x6b6318?util['format'](_0x4f1a('0x26'),_0x38cb69,_0x6b6318?_0x4f1a('0x27'):_0x4f1a('0x24')):null);});})['catch'](function(_0x36728b){logger[_0x4f1a('0xc')](util['format'](_0x4f1a('0x2a'),EXTRACTED_REPORT_ID,_0x4f1a('0xf')),util['inspect'](_0x36728b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x4f1a('0x2b'));})[_0x4f1a('0x2c')](function(){process[_0x4f1a('0x2d')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x662c=['existsSync','mkdirSync','%s%d.%s','join','%s.%s','xlsx','binary','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','inspect','finally','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx'];(function(_0x11155f,_0x57b687){var _0xd07e48=function(_0x592615){while(--_0x592615){_0x11155f['push'](_0x11155f['shift']());}};_0xd07e48(++_0x57b687);}(_0x662c,0x140));var _0xc662=function(_0x43e834,_0x364d29){_0x43e834=_0x43e834-0x0;var _0x56b530=_0x662c[_0x43e834];return _0x56b530;};'use strict';var util=require(_0xc662('0x0'));var path=require(_0xc662('0x1'));var _=require(_0xc662('0x2'));var fs=require('fs');var json2xls=require(_0xc662('0x3'));var BPromise=require(_0xc662('0x4'));var zipdir=require(_0xc662('0x5'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0xc662('0x6'))[_0xc662('0x7')];var logger=require(_0xc662('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xc662('0x9')][0x2]);var QUERY=process[_0xc662('0x9')][0x3];var PATH=process[_0xc662('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x532ebb,_0x106710){var _0x2b9824={'status':_0x532ebb};var _0x4950c8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x106710){_0x2b9824[_0xc662('0xa')]=_0x106710;}return db[_0xc662('0xb')]['update'](_0x2b9824,_0x4950c8);}function main(){var _0x39bc1a=0x1388;var _0x49d0f6;logger[_0xc662('0xc')](util[_0xc662('0xd')](_0xc662('0xe'),EXTRACTED_REPORT_ID,_0xc662('0xf')));return db[_0xc662('0x10')][_0xc662('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc662('0x12'),'splitSizeXlsx']})['then'](function(_0x4b421f){if(_0x4b421f){_0x49d0f6=_0x4b421f;_0x39bc1a=_0x49d0f6['splitSizeXlsx']||0x1388;}})['then'](function(){return dbH[_0xc662('0x13')][_0xc662('0x14')](util[_0xc662('0xd')](_0xc662('0x15'),QUERY),{'type':dbH['sequelize'][_0xc662('0x16')][_0xc662('0x17')]});})[_0xc662('0x18')](function(_0x4b1776){if(!_0x4b1776[0x0][_0xc662('0x19')]){return analyticExtractedReport(_0xc662('0x1a'));}var _0x3194fc=[];var _0x1be650=0x0;var _0x447a71=!![];if(_0x49d0f6['split']){if(_0x4b1776&&_0x4b1776[_0xc662('0x1b')]){var _0x2e2c0b=_0x4b1776[0x0][_0xc662('0x19')]%(_0x1be650+_0x39bc1a);for(;_0x447a71;_0x1be650+=_0x39bc1a,_0x2e2c0b=_0x4b1776[0x0][_0xc662('0x19')]%(_0x1be650+_0x39bc1a)){if(_0x2e2c0b==0x0||_0x2e2c0b==_0x4b1776[0x0]['num']){_0x447a71=![];}_0x3194fc[_0xc662('0x1c')](dbH['sequelize']['query'](util[_0xc662('0xd')](_0xc662('0x1d'),QUERY,_0x39bc1a,_0x1be650),{'type':dbH[_0xc662('0x13')][_0xc662('0x16')][_0xc662('0x17')]}));}}}else{_0x3194fc[_0xc662('0x1c')](dbH[_0xc662('0x13')][_0xc662('0x14')](QUERY,{'type':dbH['sequelize'][_0xc662('0x16')][_0xc662('0x17')]}));}var _0x7f911=path[_0xc662('0x1e')](PATH);var _0x299911=path['basename'](PATH,_0xc662('0x1f'));var _0x3d40dc=_0x49d0f6[_0xc662('0x12')]&&_0x3194fc[_0xc662('0x1b')]>0x1;var _0x4e113d=[];if(!fs[_0xc662('0x20')](path['join'](_0x7f911,_0x299911))&&_0x3d40dc){fs[_0xc662('0x21')](path['join'](_0x7f911,_0x299911));}return BPromise['each'](_0x3194fc,function(_0x52549a){_0x4e113d[_0xc662('0x1c')](_0x52549a);})[_0xc662('0x18')](function(){for(var _0x4f8234=0x0;_0x4f8234<_0x4e113d[_0xc662('0x1b')];_0x4f8234+=0x1){var _0x63b62;var _0x7c4f5e=_0x4e113d[_0x4f8234];if(_0x3d40dc){_0x63b62=path['join'](_0x7f911,_0x299911,util[_0xc662('0xd')](_0xc662('0x22'),_0x299911,_0x4f8234,'xlsx'));}else{_0x63b62=path[_0xc662('0x23')](_0x7f911,util[_0xc662('0xd')](_0xc662('0x24'),_0x299911,_0xc662('0x25')));}fs['writeFileSync'](_0x63b62,json2xls(_0x7c4f5e),_0xc662('0x26'));}})[_0xc662('0x18')](function(){if(_0x3d40dc){zipdir(path[_0xc662('0x23')](_0x7f911,_0x299911),{'saveTo':path[_0xc662('0x23')](_0x7f911,util['format'](_0xc662('0x24'),_0x299911,'zip'))},function(_0x55f7bf,_0x56ef13){});rimraf(path[_0xc662('0x23')](_0x7f911,_0x299911),function(){});}})[_0xc662('0x18')](function(){logger[_0xc662('0xc')](util[_0xc662('0xd')](_0xc662('0x27'),EXTRACTED_REPORT_ID,_0xc662('0xf')));return analyticExtractedReport('Completed',_0x3d40dc?util[_0xc662('0xd')]('%s.%s',_0x299911,_0x3d40dc?_0xc662('0x28'):_0xc662('0x25')):null);});})[_0xc662('0x29')](function(_0x453584){logger[_0xc662('0xc')](util[_0xc662('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xc662('0xf')),util[_0xc662('0x2a')](_0x453584,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xc662('0x2b')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
index cbac1ed..f74c6ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec20=['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-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','bulkCreate','catch','rewrite','lodash','models','Interval','then','findAll','IntervalId','VoiceExtension','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','hasOwnProperty','priority','extensions','extension','find','type','format','CDR(type)=%s','context','VoiceExtensionId','inbound','Set','CDR(routeid)=','outbound','push','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','*,*,*,*','intervals','interval','tag'];(function(_0xbbe8da,_0x49a528){var _0x4780ec=function(_0x3a29c6){while(--_0x3a29c6){_0xbbe8da['push'](_0xbbe8da['shift']());}};_0x4780ec(++_0x49a528);}(_0xec20,0x1e0));var _0x0ec2=function(_0x3de09a,_0x41d5a0){_0x3de09a=_0x3de09a-0x0;var _0x175890=_0xec20[_0x3de09a];return _0x175890;};'use strict';var _=require(_0x0ec2('0x0'));var util=require('util');function rewrite(_0x5a1166,_0x35d003){var _0x5d2f96=this;return _0x5a1166[_0x0ec2('0x1')][_0x0ec2('0x2')]['findAll']({'raw':!![]})[_0x0ec2('0x3')](function(_0x1cb152){_0x5d2f96['intervals']=_0x1cb152;return _0x5a1166['models']['VoiceExtension'][_0x0ec2('0x4')]({'where':{'IntervalId':_0x35d003[_0x0ec2('0x5')]},'raw':!![]});})['then'](function(_0x2a81d4){return _0x5a1166[_0x0ec2('0x1')][_0x0ec2('0x6')][_0x0ec2('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x0ec2('0x7')](_0x2a81d4,_0x0ec2('0x8')))}},'order':[{'raw':_0x0ec2('0x9')}],'raw':!![]});})[_0x0ec2('0x3')](function(_0x4b1050){var _0x50c2db=_[_0x0ec2('0xa')](_0x4b1050,{'priority':'1'});var _0x5aaeef=_['filter'](_0x4b1050,{'isApp':0x1});var _0x527b29=_['groupBy'](_0x5aaeef,_0x0ec2('0x8'));var _0x225bad=[_0x0ec2('0xb'),_0x0ec2('0xc')];var _0x463c13=[];var _0x3ea8c4=[];for(var _0x3486df in _0x527b29){if(_0x527b29[_0x0ec2('0xd')](_0x3486df)){_0x5d2f96[_0x0ec2('0xe')]=0x2;_0x5d2f96[_0x0ec2('0xf')]=[];_0x5d2f96[_0x0ec2('0x10')]=_[_0x0ec2('0x11')](_0x50c2db,{'exten':_0x527b29[_0x3486df][0x0][_0x0ec2('0x8')]});_0x5d2f96[_0x0ec2('0xf')]['push']({'type':_0x527b29[_0x3486df][0x0][_0x0ec2('0x12')],'app':'Set','appdata':util[_0x0ec2('0x13')](_0x0ec2('0x14'),_0x527b29[_0x3486df][0x0][_0x0ec2('0x12')]),'context':_0x527b29[_0x3486df][0x0][_0x0ec2('0x15')],'exten':_0x527b29[_0x3486df][0x0][_0x0ec2('0x8')],'priority':_0x5d2f96[_0x0ec2('0xe')]++,'VoiceExtensionId':_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')]});if(_0x527b29[_0x3486df][0x0][_0x0ec2('0x12')]===_0x0ec2('0x17')){_0x5d2f96['extensions']['push']({'type':_0x527b29[_0x3486df][0x0][_0x0ec2('0x12')],'app':_0x0ec2('0x18'),'appdata':_0x0ec2('0x19')+_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')],'context':_0x527b29[_0x3486df][0x0][_0x0ec2('0x15')],'exten':_0x527b29[_0x3486df][0x0][_0x0ec2('0x8')],'priority':_0x5d2f96[_0x0ec2('0xe')]++,'VoiceExtensionId':_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')]});}else if(_0x527b29[_0x3486df][0x0][_0x0ec2('0x12')]===_0x0ec2('0x1a')){if(_0x5d2f96[_0x0ec2('0x10')]){_0x5d2f96[_0x0ec2('0xf')][_0x0ec2('0x1b')]({'type':_0x527b29[_0x3486df][0x0]['type'],'app':_0x0ec2('0x18'),'appdata':'CDR(destination)='+(_0x5d2f96[_0x0ec2('0x10')][_0x0ec2('0x1c')]?'${EXTEN:'+_0x5d2f96['extension'][_0x0ec2('0x1c')]+'}':'${EXTEN}'),'context':_0x527b29[_0x3486df][0x0][_0x0ec2('0x15')],'exten':_0x527b29[_0x3486df][0x0][_0x0ec2('0x8')],'priority':_0x5d2f96['priority']++,'VoiceExtensionId':_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')]});}_0x5d2f96[_0x0ec2('0xf')]['push']({'type':_0x527b29[_0x3486df][0x0]['type'],'app':_0x0ec2('0x18'),'appdata':'CDR(routeid)='+_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')],'context':_0x527b29[_0x3486df][0x0][_0x0ec2('0x15')],'exten':_0x527b29[_0x3486df][0x0][_0x0ec2('0x8')],'priority':_0x5d2f96['priority']++,'VoiceExtensionId':_0x527b29[_0x3486df][0x0]['VoiceExtensionId']});var _0x462371=_0x5d2f96[_0x0ec2('0xe')]++;_0x5d2f96[_0x0ec2('0xf')]['push']({'type':_0x527b29[_0x3486df][0x0][_0x0ec2('0x12')],'app':_0x0ec2('0x1d'),'appdata':_0x0ec2('0x1e')+(_0x462371+0x2)+_0x0ec2('0x1f')+(_0x462371+0x1)+')','context':_0x527b29[_0x3486df][0x0][_0x0ec2('0x15')],'exten':_0x527b29[_0x3486df][0x0][_0x0ec2('0x8')],'priority':_0x462371,'VoiceExtensionId':_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')]});if(_0x5d2f96['extension']){_0x5d2f96[_0x0ec2('0xf')][_0x0ec2('0x1b')]({'type':_0x527b29[_0x3486df][0x0][_0x0ec2('0x12')],'app':'Set','appdata':_0x5d2f96[_0x0ec2('0x10')][_0x0ec2('0x1c')]?_0x0ec2('0x20')+_0x5d2f96[_0x0ec2('0x10')][_0x0ec2('0x1c')]+'}':_0x0ec2('0x21'),'context':_0x527b29[_0x3486df][0x0][_0x0ec2('0x15')],'exten':_0x527b29[_0x3486df][0x0][_0x0ec2('0x8')],'priority':_0x5d2f96[_0x0ec2('0xe')]++,'VoiceExtensionId':_0x527b29[_0x3486df][0x0]['VoiceExtensionId']});}_0x5d2f96[_0x0ec2('0xf')][_0x0ec2('0x1b')]({'type':_0x527b29[_0x3486df][0x0][_0x0ec2('0x12')],'app':'Set','appdata':_0x0ec2('0x22')+_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')],'context':_0x527b29[_0x3486df][0x0][_0x0ec2('0x15')],'exten':_0x527b29[_0x3486df][0x0]['exten'],'priority':_0x5d2f96[_0x0ec2('0xe')]++,'VoiceExtensionId':_0x527b29[_0x3486df][0x0]['VoiceExtensionId']});if(_0x5d2f96[_0x0ec2('0x10')]&&_0x5d2f96['extension'][_0x0ec2('0xd')](_0x0ec2('0x23'))&&_0x5d2f96[_0x0ec2('0x10')][_0x0ec2('0x23')]!=='none'){_0x5d2f96[_0x0ec2('0xf')][_0x0ec2('0x1b')]({'type':_0x527b29[_0x3486df][0x0]['type'],'app':'Set','appdata':_0x0ec2('0x24'),'context':_0x527b29[_0x3486df][0x0][_0x0ec2('0x15')],'exten':_0x527b29[_0x3486df][0x0][_0x0ec2('0x8')],'priority':_0x5d2f96[_0x0ec2('0xe')]++,'VoiceExtensionId':_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')]});_0x5d2f96[_0x0ec2('0xf')]['push']({'type':_0x527b29[_0x3486df][0x0][_0x0ec2('0x12')],'app':'Set','appdata':_0x0ec2('0x25')+_0x5d2f96['extension'][_0x0ec2('0x23')]||'wav','context':_0x527b29[_0x3486df][0x0][_0x0ec2('0x15')],'exten':_0x527b29[_0x3486df][0x0][_0x0ec2('0x8')],'priority':_0x5d2f96[_0x0ec2('0xe')]++,'VoiceExtensionId':_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')]});}}_0x5d2f96[_0x0ec2('0xf')]['push']({'type':_0x527b29[_0x3486df][0x0][_0x0ec2('0x12')],'app':'Set','appdata':_0x0ec2('0x26'),'context':_0x527b29[_0x3486df][0x0][_0x0ec2('0x15')],'exten':_0x527b29[_0x3486df][0x0][_0x0ec2('0x8')],'priority':_0x5d2f96[_0x0ec2('0xe')]++,'VoiceExtensionId':_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')]});_0x5d2f96['extensions'][_0x0ec2('0x1b')]({'type':_0x527b29[_0x3486df][0x0][_0x0ec2('0x12')],'app':_0x0ec2('0x18'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x527b29[_0x3486df][0x0]['context'],'exten':_0x527b29[_0x3486df][0x0]['exten'],'priority':_0x5d2f96['priority']++,'VoiceExtensionId':_0x527b29[_0x3486df][0x0]['VoiceExtensionId']});_0x5d2f96[_0x0ec2('0xf')]['push']({'type':_0x527b29[_0x3486df][0x0]['type'],'app':'Set','appdata':_0x0ec2('0x27'),'context':_0x527b29[_0x3486df][0x0]['context'],'exten':_0x527b29[_0x3486df][0x0][_0x0ec2('0x8')],'priority':_0x5d2f96['priority']++,'VoiceExtensionId':_0x527b29[_0x3486df][0x0]['VoiceExtensionId']});for(var _0x8e354f=0x0,_0x229fe4=0x0;_0x8e354f<_0x527b29[_0x3486df][_0x0ec2('0x28')];_0x8e354f+=0x1,_0x229fe4=0x0){var _0x31d744=_0x527b29[_0x3486df][_0x8e354f];if(_0x31d744[_0x0ec2('0x12')]){_0x31d744[_0x0ec2('0x12')]=_0x31d744[_0x0ec2('0x12')][_0x0ec2('0x29')]();}var _0x17a859=[];var _0x489a58=[];delete _0x31d744['id'];delete _0x31d744[_0x0ec2('0x2a')];delete _0x31d744[_0x0ec2('0x2b')];var _0x138913=_0x31d744['interval']!==_0x0ec2('0x2c')?[_0x31d744['interval']]:_0x31d744['IntervalId']?_['map'](_[_0x0ec2('0xa')](_0x5d2f96[_0x0ec2('0x2d')],{'IntervalId':_0x31d744[_0x0ec2('0x5')]}),_0x0ec2('0x2e')):[];if(_0x31d744[_0x0ec2('0xd')]('tag')){if(_0x31d744['tag']&&_0x31d744[_0x0ec2('0x2f')]!=='--'){_0x17a859[_0x0ec2('0x1b')]({'type':_0x31d744[_0x0ec2('0x12')],'app':_0x0ec2('0x18'),'appdata':'CDR(tag)='+_0x31d744[_0x0ec2('0x2f')],'context':_0x31d744[_0x0ec2('0x15')],'exten':_0x31d744['exten'],'priority':_0x138913[_0x0ec2('0x28')]+_0x5d2f96[_0x0ec2('0xe')]+_0x229fe4++,'VoiceExtensionId':_0x31d744[_0x0ec2('0x16')]});}}if(_0x31d744[_0x0ec2('0x12')]===_0x0ec2('0x1a')&&_0x31d744['hasOwnProperty'](_0x0ec2('0x30'))){if(_0x31d744[_0x0ec2('0x30')]){_0x17a859[_0x0ec2('0x1b')]({'type':_0x31d744[_0x0ec2('0x12')],'app':_0x0ec2('0x1d'),'appdata':_0x0ec2('0x31')+_0x31d744[_0x0ec2('0x30')]+')','context':_0x31d744[_0x0ec2('0x15')],'exten':_0x31d744['exten'],'priority':_0x138913['length']+_0x5d2f96['priority']+_0x229fe4++,'VoiceExtensionId':_0x31d744[_0x0ec2('0x16')]});}else{_0x17a859[_0x0ec2('0x1b')]({'type':_0x31d744[_0x0ec2('0x12')],'app':_0x0ec2('0x1d'),'appdata':_0x0ec2('0x32'),'context':_0x31d744['context'],'exten':_0x31d744[_0x0ec2('0x8')],'priority':_0x138913['length']+_0x5d2f96['priority']+_0x229fe4++,'VoiceExtensionId':_0x31d744[_0x0ec2('0x16')]});}}if(_0x31d744['hasOwnProperty'](_0x0ec2('0x33'))){if(_0x225bad[_0x0ec2('0x34')](_0x31d744[_0x0ec2('0x35')]['toLowerCase']())>=0x0&&_0x31d744[_0x0ec2('0x36')]!==_0x0ec2('0x37')){if(_0x31d744[_0x0ec2('0x33')]){_0x17a859[_0x0ec2('0x1b')]({'type':_0x31d744[_0x0ec2('0x12')],'app':_0x0ec2('0x1d'),'appdata':_0x0ec2('0x38'),'context':_0x31d744[_0x0ec2('0x15')],'exten':_0x31d744[_0x0ec2('0x8')],'priority':_0x138913['length']+_0x5d2f96[_0x0ec2('0xe')]+_0x229fe4++,'VoiceExtensionId':_0x31d744[_0x0ec2('0x16')]});_0x17a859[_0x0ec2('0x1b')]({'type':_0x31d744[_0x0ec2('0x12')],'app':_0x0ec2('0x18'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x31d744[_0x0ec2('0x15')],'exten':_0x31d744[_0x0ec2('0x8')],'priority':_0x138913[_0x0ec2('0x28')]+_0x5d2f96[_0x0ec2('0xe')]+_0x229fe4++,'VoiceExtensionId':_0x31d744[_0x0ec2('0x16')]});}else{_0x17a859[_0x0ec2('0x1b')]({'type':_0x31d744[_0x0ec2('0x12')],'app':_0x0ec2('0x1d'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x31d744[_0x0ec2('0x15')],'exten':_0x31d744[_0x0ec2('0x8')],'priority':_0x138913[_0x0ec2('0x28')]+_0x5d2f96['priority']+_0x229fe4++,'VoiceExtensionId':_0x31d744[_0x0ec2('0x16')]});_0x17a859[_0x0ec2('0x1b')]({'type':_0x31d744[_0x0ec2('0x12')],'app':'Set','appdata':_0x0ec2('0x39'),'context':_0x31d744[_0x0ec2('0x15')],'exten':_0x31d744[_0x0ec2('0x8')],'priority':_0x138913[_0x0ec2('0x28')]+_0x5d2f96[_0x0ec2('0xe')]+_0x229fe4++,'VoiceExtensionId':_0x31d744[_0x0ec2('0x16')]});}}}for(var _0x45d30a=0x0;_0x45d30a<_0x138913[_0x0ec2('0x28')];_0x45d30a+=0x1){var _0x9156d5=_0x5d2f96[_0x0ec2('0xe')]+_0x138913[_0x0ec2('0x28')];var _0x4f8ccc=_0x45d30a===_0x138913[_0x0ec2('0x28')]-0x1?_0x5d2f96[_0x0ec2('0xe')]+_0x17a859['length']+_0x489a58[_0x0ec2('0x28')]+0x2:_0x5d2f96['priority']+_0x45d30a+0x1;_0x17a859[_0x0ec2('0x3a')](_0x45d30a,0x0,{'type':_0x31d744[_0x0ec2('0x12')],'app':_0x0ec2('0x3b'),'appdata':_0x138913[_0x45d30a]+'?'+_0x31d744[_0x0ec2('0x15')]+_0x0ec2('0x3c')+_0x9156d5+':'+_0x31d744['context']+',${EXTEN},'+_0x4f8ccc,'exten':_0x31d744[_0x0ec2('0x8')],'context':_0x31d744[_0x0ec2('0x15')],'priority':_0x5d2f96['priority']+_0x45d30a,'VoiceExtensionId':_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')]});}_0x31d744[_0x0ec2('0xe')]=_0x17a859['length']?_[_0x0ec2('0x3d')](_0x17a859)[_0x0ec2('0xe')]+0x1:_0x5d2f96[_0x0ec2('0xe')];_0x5d2f96['priority']=(_0x489a58[_0x0ec2('0x28')]?_[_0x0ec2('0x3d')](_0x489a58)[_0x0ec2('0xe')]:_0x31d744[_0x0ec2('0xe')])+0x1;_0x5d2f96[_0x0ec2('0xf')]=_['concat'](_0x5d2f96[_0x0ec2('0xf')],_0x17a859,[_0x31d744],_0x489a58);}_0x5d2f96[_0x0ec2('0xf')]['push']({'type':_0x527b29[_0x3486df][0x0]['type'],'app':'Hangup','exten':_0x527b29[_0x3486df][0x0]['exten'],'context':_0x527b29[_0x3486df][0x0][_0x0ec2('0x15')],'priority':_0x5d2f96[_0x0ec2('0xe')],'VoiceExtensionId':_0x527b29[_0x3486df][0x0]['VoiceExtensionId']});_0x463c13['push'](_0x527b29[_0x3486df][0x0][_0x0ec2('0x16')]);_0x3ea8c4=_[_0x0ec2('0x3e')](_0x3ea8c4,_0x5d2f96[_0x0ec2('0xf')]);}}return _0x5a1166['transaction'](function(_0x223134){return _0x5a1166['models'][_0x0ec2('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x463c13}},'transaction':_0x223134})[_0x0ec2('0x3')](function(_0x5e311d){return _0x5a1166[_0x0ec2('0x1')][_0x0ec2('0x6')][_0x0ec2('0x3f')](_['sortBy'](_0x3ea8c4,_0x0ec2('0xe')),{'transaction':_0x223134});});});})[_0x0ec2('0x40')](function(_0x1c0f16){console['error'](_0x1c0f16);});}exports[_0x0ec2('0x41')]=rewrite;
\ No newline at end of file
+var _0xaeed=['answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','rewrite','lodash','util','Interval','findAll','models','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','then','filter','queue','playback','hasOwnProperty','priority','extension','push','format','CDR(type)=%s','type','context','VoiceExtensionId','inbound','Set','outbound','extensions','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','length','toLowerCase','createdAt','updatedAt','interval','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)'];(function(_0x21fdbb,_0x157d2b){var _0x2793da=function(_0x34dfce){while(--_0x34dfce){_0x21fdbb['push'](_0x21fdbb['shift']());}};_0x2793da(++_0x157d2b);}(_0xaeed,0xd8));var _0xdaee=function(_0x1ad758,_0x404e4b){_0x1ad758=_0x1ad758-0x0;var _0x5cd6c5=_0xaeed[_0x1ad758];return _0x5cd6c5;};'use strict';var _=require(_0xdaee('0x0'));var util=require(_0xdaee('0x1'));function rewrite(_0x7e19e4,_0x5a08f0){var _0x1298a9=this;return _0x7e19e4['models'][_0xdaee('0x2')][_0xdaee('0x3')]({'raw':!![]})['then'](function(_0x492b5f){_0x1298a9['intervals']=_0x492b5f;return _0x7e19e4[_0xdaee('0x4')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x5a08f0[_0xdaee('0x5')]},'raw':!![]});})['then'](function(_0x4f925e){return _0x7e19e4[_0xdaee('0x4')][_0xdaee('0x6')][_0xdaee('0x3')]({'where':{'exten':{'$in':_[_0xdaee('0x7')](_[_0xdaee('0x8')](_0x4f925e,_0xdaee('0x9')))}},'order':[{'raw':_0xdaee('0xa')}],'raw':!![]});})[_0xdaee('0xb')](function(_0x352157){var _0x1f0a07=_[_0xdaee('0xc')](_0x352157,{'priority':'1'});var _0x52b141=_['filter'](_0x352157,{'isApp':0x1});var _0x556052=_['groupBy'](_0x52b141,_0xdaee('0x9'));var _0x13ff73=[_0xdaee('0xd'),_0xdaee('0xe')];var _0x23138b=[];var _0x354ccc=[];for(var _0x5b9baa in _0x556052){if(_0x556052[_0xdaee('0xf')](_0x5b9baa)){_0x1298a9[_0xdaee('0x10')]=0x2;_0x1298a9['extensions']=[];_0x1298a9[_0xdaee('0x11')]=_['find'](_0x1f0a07,{'exten':_0x556052[_0x5b9baa][0x0]['exten']});_0x1298a9['extensions'][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0]['type'],'app':'Set','appdata':util[_0xdaee('0x13')](_0xdaee('0x14'),_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')]),'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});if(_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')]===_0xdaee('0x18')){_0x1298a9['extensions'][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':'CDR(routeid)='+_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')],'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0]['exten'],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});}else if(_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')]===_0xdaee('0x1a')){if(_0x1298a9[_0xdaee('0x11')]){_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x1c')+(_0x1298a9[_0xdaee('0x11')][_0xdaee('0x1d')]?_0xdaee('0x1e')+_0x1298a9[_0xdaee('0x11')]['cutdigits']+'}':_0xdaee('0x1f')),'context':_0x556052[_0x5b9baa][0x0]['context'],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});}_0x1298a9['extensions'][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x20')+_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')],'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9['priority']++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});var _0x591723=_0x1298a9[_0xdaee('0x10')]++;_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x21'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x591723+0x2)+'):Goto('+(_0x591723+0x1)+')','context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x591723,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});if(_0x1298a9['extension']){_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0x1298a9[_0xdaee('0x11')]['cutdigits']?_0xdaee('0x22')+_0x1298a9[_0xdaee('0x11')][_0xdaee('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x556052[_0x5b9baa][0x0]['context'],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});}_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0]['type'],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x23')+_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')],'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});if(_0x1298a9[_0xdaee('0x11')]&&_0x1298a9[_0xdaee('0x11')][_0xdaee('0xf')]('recordingFormat')&&_0x1298a9['extension'][_0xdaee('0x24')]!==_0xdaee('0x25')){_0x1298a9[_0xdaee('0x1b')]['push']({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x26'),'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0]['exten'],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x27')+_0x1298a9[_0xdaee('0x11')][_0xdaee('0x24')]||_0xdaee('0x28'),'context':_0x556052[_0x5b9baa][0x0]['context'],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9['priority']++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});}}_0x1298a9['extensions'][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0]['type'],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x29'),'context':_0x556052[_0x5b9baa][0x0]['context'],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});_0x1298a9[_0xdaee('0x1b')]['push']({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});_0x1298a9[_0xdaee('0x1b')][_0xdaee('0x12')]({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':'MONITOR_OPTIONS=ab','context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'exten':_0x556052[_0x5b9baa][0x0][_0xdaee('0x9')],'priority':_0x1298a9[_0xdaee('0x10')]++,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});for(var _0x2d7a19=0x0,_0x34f641=0x0;_0x2d7a19<_0x556052[_0x5b9baa][_0xdaee('0x2a')];_0x2d7a19+=0x1,_0x34f641=0x0){var _0x18c473=_0x556052[_0x5b9baa][_0x2d7a19];if(_0x18c473[_0xdaee('0x15')]){_0x18c473[_0xdaee('0x15')]=_0x18c473['type'][_0xdaee('0x2b')]();}var _0xfdb893=[];var _0x50da27=[];delete _0x18c473['id'];delete _0x18c473[_0xdaee('0x2c')];delete _0x18c473[_0xdaee('0x2d')];var _0x1c6389=_0x18c473['interval']!=='*,*,*,*'?[_0x18c473[_0xdaee('0x2e')]]:_0x18c473['IntervalId']?_['map'](_[_0xdaee('0xc')](_0x1298a9[_0xdaee('0x2f')],{'IntervalId':_0x18c473[_0xdaee('0x5')]}),_0xdaee('0x2e')):[];if(_0x18c473[_0xdaee('0xf')](_0xdaee('0x30'))){if(_0x18c473[_0xdaee('0x30')]&&_0x18c473[_0xdaee('0x30')]!=='--'){_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':'Set','appdata':_0xdaee('0x31')+_0x18c473[_0xdaee('0x30')],'context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389['length']+_0x1298a9['priority']+_0x34f641++,'VoiceExtensionId':_0x18c473[_0xdaee('0x17')]});}}if(_0x18c473[_0xdaee('0x15')]==='outbound'&&_0x18c473['hasOwnProperty'](_0xdaee('0x32'))){if(_0x18c473[_0xdaee('0x32')]){_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x18c473[_0xdaee('0x32')]+')','context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389[_0xdaee('0x2a')]+_0x1298a9[_0xdaee('0x10')]+_0x34f641++,'VoiceExtensionId':_0x18c473[_0xdaee('0x17')]});}else{_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':_0xdaee('0x21'),'appdata':_0xdaee('0x33'),'context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389[_0xdaee('0x2a')]+_0x1298a9[_0xdaee('0x10')]+_0x34f641++,'VoiceExtensionId':_0x18c473['VoiceExtensionId']});}}if(_0x18c473[_0xdaee('0xf')](_0xdaee('0x34'))){if(_0x13ff73['indexOf'](_0x18c473['app']['toLowerCase']())>=0x0&&_0x18c473['appType']!=='custom'){if(_0x18c473[_0xdaee('0x34')]){_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':_0xdaee('0x21'),'appdata':_0xdaee('0x35'),'context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389[_0xdaee('0x2a')]+_0x1298a9[_0xdaee('0x10')]+_0x34f641++,'VoiceExtensionId':_0x18c473[_0xdaee('0x17')]});_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x36'),'context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389[_0xdaee('0x2a')]+_0x1298a9['priority']+_0x34f641++,'VoiceExtensionId':_0x18c473[_0xdaee('0x17')]});}else{_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473[_0xdaee('0x15')],'app':_0xdaee('0x21'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x18c473[_0xdaee('0x16')],'exten':_0x18c473['exten'],'priority':_0x1c6389['length']+_0x1298a9[_0xdaee('0x10')]+_0x34f641++,'VoiceExtensionId':_0x18c473['VoiceExtensionId']});_0xfdb893[_0xdaee('0x12')]({'type':_0x18c473['type'],'app':_0xdaee('0x19'),'appdata':_0xdaee('0x37'),'context':_0x18c473['context'],'exten':_0x18c473[_0xdaee('0x9')],'priority':_0x1c6389[_0xdaee('0x2a')]+_0x1298a9[_0xdaee('0x10')]+_0x34f641++,'VoiceExtensionId':_0x18c473[_0xdaee('0x17')]});}}}for(var _0x2a0f1e=0x0;_0x2a0f1e<_0x1c6389[_0xdaee('0x2a')];_0x2a0f1e+=0x1){var _0x144c58=_0x1298a9[_0xdaee('0x10')]+_0x1c6389[_0xdaee('0x2a')];var _0x5e958e=_0x2a0f1e===_0x1c6389[_0xdaee('0x2a')]-0x1?_0x1298a9[_0xdaee('0x10')]+_0xfdb893[_0xdaee('0x2a')]+_0x50da27['length']+0x2:_0x1298a9[_0xdaee('0x10')]+_0x2a0f1e+0x1;_0xfdb893[_0xdaee('0x38')](_0x2a0f1e,0x0,{'type':_0x18c473[_0xdaee('0x15')],'app':_0xdaee('0x39'),'appdata':_0x1c6389[_0x2a0f1e]+'?'+_0x18c473['context']+_0xdaee('0x3a')+_0x144c58+':'+_0x18c473[_0xdaee('0x16')]+_0xdaee('0x3a')+_0x5e958e,'exten':_0x18c473[_0xdaee('0x9')],'context':_0x18c473['context'],'priority':_0x1298a9[_0xdaee('0x10')]+_0x2a0f1e,'VoiceExtensionId':_0x556052[_0x5b9baa][0x0]['VoiceExtensionId']});}_0x18c473['priority']=_0xfdb893[_0xdaee('0x2a')]?_['last'](_0xfdb893)[_0xdaee('0x10')]+0x1:_0x1298a9[_0xdaee('0x10')];_0x1298a9[_0xdaee('0x10')]=(_0x50da27[_0xdaee('0x2a')]?_[_0xdaee('0x3b')](_0x50da27)['priority']:_0x18c473['priority'])+0x1;_0x1298a9['extensions']=_[_0xdaee('0x3c')](_0x1298a9['extensions'],_0xfdb893,[_0x18c473],_0x50da27);}_0x1298a9[_0xdaee('0x1b')]['push']({'type':_0x556052[_0x5b9baa][0x0][_0xdaee('0x15')],'app':_0xdaee('0x3d'),'exten':_0x556052[_0x5b9baa][0x0]['exten'],'context':_0x556052[_0x5b9baa][0x0][_0xdaee('0x16')],'priority':_0x1298a9[_0xdaee('0x10')],'VoiceExtensionId':_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]});_0x23138b['push'](_0x556052[_0x5b9baa][0x0][_0xdaee('0x17')]);_0x354ccc=_['concat'](_0x354ccc,_0x1298a9[_0xdaee('0x1b')]);}}return _0x7e19e4[_0xdaee('0x3e')](function(_0x1ca795){return _0x7e19e4[_0xdaee('0x4')][_0xdaee('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x23138b}},'transaction':_0x1ca795})[_0xdaee('0xb')](function(_0x3dfb23){return _0x7e19e4['models'][_0xdaee('0x6')][_0xdaee('0x3f')](_[_0xdaee('0x40')](_0x354ccc,'priority'),{'transaction':_0x1ca795});});});})[_0xdaee('0x41')](function(_0x5ac1de){console['error'](_0x5ac1de);});}exports[_0xdaee('0x42')]=rewrite;
\ No newline at end of file
index e94ce0c..84dcb91 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe4d=['where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','\x20=\x20?','id\x20IN\x20?','str','calleridnum','cm_hopper_final','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','join','hasOwnProperty','data','firstName','phone','phone\x20not\x20specified!','birthDate','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','checkHopper','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','updatedAt','cm_contacts'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbe4d,0x111));var _0xdbe4=function(_0x1a2405,_0x4442b8){_0x1a2405=_0x1a2405-0x0;var _0xecef9c=_0xbe4d[_0x1a2405];return _0xecef9c;};'use strict';var BPromise=require(_0xdbe4('0x0'));var util=require(_0xdbe4('0x1'));var _=require('lodash');var fs=require('fs');var squel=require(_0xdbe4('0x2'));var Papa=require(_0xdbe4('0x3'));var Redis=require(_0xdbe4('0x4'));var db=require('../../../mysqldb')['db'];var config=require(_0xdbe4('0x5'));var logger=require(_0xdbe4('0x6'))(_0xdbe4('0x7'));config[_0xdbe4('0x8')]=_[_0xdbe4('0x9')](config[_0xdbe4('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xdbe4('0xa'))(new Redis(config[_0xdbe4('0x8')]));require(_0xdbe4('0xb'))['register'](socket);try{if(!process[_0xdbe4('0xc')][0x2]||process[_0xdbe4('0xc')][0x2]===_0xdbe4('0xd')||process[_0xdbe4('0xc')][0x2]===_0xdbe4('0xe')){throw new Error(_0xdbe4('0xf'));}var FILEPATH=process[_0xdbe4('0xc')][0x2];if(!process[_0xdbe4('0xc')][0x3]||process[_0xdbe4('0xc')][0x3]===_0xdbe4('0xd')||process['argv'][0x3]==='null'||!process['argv'][0x4]||process['argv'][0x4]===_0xdbe4('0xd')||process[_0xdbe4('0xc')][0x4]==='null'){throw new Error(_0xdbe4('0x10'));}var FIELDS=_[_0xdbe4('0x11')](process[_0xdbe4('0xc')][0x3]['split'](','),process[_0xdbe4('0xc')][0x4][_0xdbe4('0x12')](','));if(!process[_0xdbe4('0xc')][0x5]||process['argv'][0x5]===_0xdbe4('0xd')||process[_0xdbe4('0xc')][0x5]==='null'){throw new Error(_0xdbe4('0x13'));}var LISTID=process[_0xdbe4('0xc')][0x5];var COMPANYID=process[_0xdbe4('0xc')][0x6]&&process[_0xdbe4('0xc')][0x6]!=='undefined'&&process['argv'][0x6]!==_0xdbe4('0xe')?process[_0xdbe4('0xc')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0xdbe4('0xd')&&process['argv'][0x7]!==_0xdbe4('0xe')?process[_0xdbe4('0xc')][0x7]:null;if(!process[_0xdbe4('0xc')][0x8]||process[_0xdbe4('0xc')][0x8]==='undefined'||process[_0xdbe4('0xc')][0x8]==='null'){throw new Error(_0xdbe4('0x14'));}var SOCKET_TIMESTAMP=process[_0xdbe4('0xc')][0x8];}catch(_0x46a8ce){logger[_0xdbe4('0x15')](_0x46a8ce);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(_0x20b0b8,_0x1c5b91,_0x57dcaf,_0x4cd682){var _0x2eede6={'message':_0x1c5b91};_0x2eede6[_0x20b0b8]=!![];if(_0x57dcaf){_0x2eede6[_0xdbe4('0x16')]=_0x57dcaf;}if(_0x4cd682){_0x2eede6[_0xdbe4('0x17')]=_0x4cd682;}return _0x2eede6;}function isEmail(_0x2dcbad){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))*$/[_0xdbe4('0x18')](_0x2dcbad);}function checkRow(_0x4d6c44,_0x16f3c9,_0x42a5ab){return new BPromise(function(_0x2511d8,_0x172ff9){if(_[_0xdbe4('0x19')](_0x4d6c44)){return _0x172ff9(handleCheckRowError(_0xdbe4('0x15'),_0xdbe4('0x1a'),null,_0x42a5ab));}if(_0x4d6c44[_0xdbe4('0x1b')]&&_0x4d6c44[_0xdbe4('0x1b')][_0xdbe4('0x1c')]){var _0x37b544=_['map'](_0x4d6c44[_0xdbe4('0x1b')],'message')[_0xdbe4('0x1d')](';');return _0x172ff9(handleCheckRowError(_0xdbe4('0x15'),_0x37b544,null,_0x42a5ab));}var _0x303308={};for(var _0x1da560 in FIELDS){if(FIELDS[_0xdbe4('0x1e')](_0x1da560)&&FIELDS[_0x1da560]){_0x303308[_0x1da560]=_0x4d6c44['data'][0x0][FIELDS[_0x1da560]]||_0x4d6c44[_0xdbe4('0x1f')][0x0]['\ufeff'+FIELDS[_0x1da560]];}}if(!_0x303308[_0xdbe4('0x20')]){return _0x172ff9(handleCheckRowError(_0xdbe4('0x15'),'firstName\x20not\x20specified!',null,_0x42a5ab));}if(!_0x303308[_0xdbe4('0x21')]){return _0x172ff9(handleCheckRowError('error',_0xdbe4('0x22'),null,_0x42a5ab));}if(_0x303308['birthDate']){var _0x5415f9=moment(_0x303308[_0xdbe4('0x23')],'YYYY-MM-DD');if(!_0x5415f9['isValid']()){return _0x172ff9(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x42a5ab));}}if(_0x303308[_0xdbe4('0x24')]){if(!isEmail(_0x303308[_0xdbe4('0x24')])){return _0x172ff9(handleCheckRowError(_0xdbe4('0x15'),_0xdbe4('0x25'),null,_0x42a5ab));}}_0x303308[_0xdbe4('0x26')]=LISTID;_0x303308[_0xdbe4('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xdbe4('0x1c')]&&_0x16f3c9){var _0x383c93={};for(var _0x3b5983=0x0,_0x1b23d3=DUPLICATES[_0xdbe4('0x1c')];_0x3b5983<_0x1b23d3;_0x3b5983+=0x1){_0x383c93[DUPLICATES[_0x3b5983]]=_0x303308[DUPLICATES[_0x3b5983]];}var _0x27b753=_[_0xdbe4('0x28')](_0x16f3c9,_0x383c93);if(_0x27b753){return _0x172ff9(handleCheckRowError(_0xdbe4('0x29'),_0xdbe4('0x2a'),_0x27b753,_0x42a5ab));}}return db[_0xdbe4('0x2b')][_0xdbe4('0x2c')](_0x303308,{'raw':!![],'hooks':![],'fields':_[_0xdbe4('0x2d')](_0x303308)})[_0xdbe4('0x2e')](function(_0x118a53){if(DUPLICATES&&DUPLICATES[_0xdbe4('0x1c')]&&_0x16f3c9){_0x16f3c9[_0xdbe4('0x2f')](_[_0xdbe4('0x30')](_0x303308,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x118a53['id'];return _0x2511d8();})[_0xdbe4('0x31')](function(_0x42a808){return _0x172ff9(handleCheckRowError(_0xdbe4('0x15'),_0xdbe4('0x32')+(_0x42a808[_0xdbe4('0x33')]||JSON['stringify'](_0x42a808)),null,_0x42a5ab));});});}function checkHopper(){function _0x550215(){return function(_0x525c04){logger[_0xdbe4('0x15')]('cmContact',_0xdbe4('0x34'),util['inspect'](_0x525c04,{'showHidden':![],'depth':null}));};}var _0x45f574=function(_0x2b04f1,_0xf5b3b5){var _0x19caf9=squel[_0xdbe4('0x35')]()[_0xdbe4('0x36')](_0xdbe4('0x37'))[_0xdbe4('0x38')]([_0xdbe4('0x21'),_0xdbe4('0x39'),_0xdbe4('0x3a'),_0xdbe4('0x26'),_0xf5b3b5,_0xdbe4('0x3b'),'updatedAt'],squel[_0xdbe4('0x3c')]()[_0xdbe4('0x3d')](_0xdbe4('0x21'),'phone')[_0xdbe4('0x3d')](_0xdbe4('0x3e'),_0xdbe4('0x39'))[_0xdbe4('0x3d')]('id',_0xdbe4('0x3a'))[_0xdbe4('0x3d')](LISTID[_0xdbe4('0x3f')](),'ListId')[_0xdbe4('0x3d')](_0x2b04f1['id'][_0xdbe4('0x3f')](),_0xf5b3b5)[_0xdbe4('0x3d')]('NOW()',_0xdbe4('0x3b'))[_0xdbe4('0x3d')](_0xdbe4('0x3e'),_0xdbe4('0x40'))['from'](_0xdbe4('0x41'))[_0xdbe4('0x42')](_0xdbe4('0x43'))['where'](_0xdbe4('0x44'),LISTID[_0xdbe4('0x3f')]())['where'](_0xdbe4('0x45'))[_0xdbe4('0x42')](_0xdbe4('0x46'),squel['select']()[_0xdbe4('0x3d')](_0xdbe4('0x21'))[_0xdbe4('0x47')](_0xdbe4('0x37'))['where'](_0xf5b3b5+_0xdbe4('0x48'),_0x2b04f1['id'][_0xdbe4('0x3f')]())))[_0xdbe4('0x3f')]();return _0x19caf9;};var _0x274974=function(_0x3806ea,_0x47af34){var _0x55082c=squel[_0xdbe4('0x35')]()[_0xdbe4('0x36')](_0xdbe4('0x37'))[_0xdbe4('0x38')](['phone',_0xdbe4('0x39'),_0xdbe4('0x3a'),_0xdbe4('0x26'),_0x47af34,'createdAt','updatedAt'],squel[_0xdbe4('0x3c')]()['field']('phone',_0xdbe4('0x21'))[_0xdbe4('0x3d')](_0xdbe4('0x3e'),'scheduledAt')['field']('id',_0xdbe4('0x3a'))[_0xdbe4('0x3d')](LISTID['toString'](),'ListId')[_0xdbe4('0x3d')](_0x3806ea['id'][_0xdbe4('0x3f')](),_0x47af34)[_0xdbe4('0x3d')](_0xdbe4('0x3e'),_0xdbe4('0x3b'))[_0xdbe4('0x3d')](_0xdbe4('0x3e'),'updatedAt')[_0xdbe4('0x47')](_0xdbe4('0x41'))['where'](_0xdbe4('0x43'))[_0xdbe4('0x42')](_0xdbe4('0x44'),LISTID[_0xdbe4('0x3f')]())[_0xdbe4('0x42')](_0xdbe4('0x49'),squel[_0xdbe4('0x4a')](hopperContacts))[_0xdbe4('0x42')](_0xdbe4('0x45'))[_0xdbe4('0x42')](_0xdbe4('0x46'),squel[_0xdbe4('0x3c')]()[_0xdbe4('0x3d')](_0xdbe4('0x4b'))['from'](_0xdbe4('0x4c'))[_0xdbe4('0x42')](_0x47af34+_0xdbe4('0x48'),_0x3806ea['id'][_0xdbe4('0x3f')]()))[_0xdbe4('0x42')](_0xdbe4('0x46'),squel['select']()['field']('phone')['from'](_0xdbe4('0x37'))['where'](_0x47af34+'\x20=\x20?',_0x3806ea['id'][_0xdbe4('0x3f')]())))[_0xdbe4('0x3f')]();return _0x55082c;};function _0x6f7947(_0x3856d0,_0x501ab4){var _0x468fb4=squel['insert']()[_0xdbe4('0x36')](_0xdbe4('0x37'))[_0xdbe4('0x38')](['phone',_0xdbe4('0x39'),'ContactId',_0xdbe4('0x26'),_0x501ab4,_0xdbe4('0x3b'),_0xdbe4('0x40')],squel[_0xdbe4('0x3c')]()[_0xdbe4('0x3d')](_0xdbe4('0x21'),_0xdbe4('0x21'))['field']('NOW()',_0xdbe4('0x39'))[_0xdbe4('0x3d')]('id',_0xdbe4('0x3a'))[_0xdbe4('0x3d')](LISTID['toString'](),_0xdbe4('0x26'))[_0xdbe4('0x3d')](_0x3856d0['id'][_0xdbe4('0x3f')](),_0x501ab4)[_0xdbe4('0x3d')](_0xdbe4('0x3e'),_0xdbe4('0x3b'))[_0xdbe4('0x3d')](_0xdbe4('0x3e'),'updatedAt')[_0xdbe4('0x47')]('cm_contacts')[_0xdbe4('0x42')](_0xdbe4('0x43'))['where'](_0xdbe4('0x44'),LISTID['toString']())[_0xdbe4('0x42')](_0xdbe4('0x49'),squel[_0xdbe4('0x4a')](hopperContacts))[_0xdbe4('0x42')](_0xdbe4('0x45')))['toString']();return _0x468fb4;}function _0x1a7b88(_0x4bd9d4,_0x14038b){var _0x43c68f=squel[_0xdbe4('0x35')]()[_0xdbe4('0x36')]('cm_hopper_black')[_0xdbe4('0x38')]([_0xdbe4('0x21'),_0xdbe4('0x3a'),_0xdbe4('0x26'),_0x14038b,_0xdbe4('0x3b'),_0xdbe4('0x40')],squel['select']()['field']('phone',_0xdbe4('0x21'))['field']('id',_0xdbe4('0x3a'))['field'](LISTID[_0xdbe4('0x3f')](),_0xdbe4('0x26'))[_0xdbe4('0x3d')](_0x4bd9d4['id']['toString'](),_0x14038b)[_0xdbe4('0x3d')](_0xdbe4('0x3e'),'createdAt')[_0xdbe4('0x3d')]('NOW()',_0xdbe4('0x40'))[_0xdbe4('0x47')]('cm_contacts')[_0xdbe4('0x42')](_0xdbe4('0x43'))[_0xdbe4('0x42')](_0xdbe4('0x44'),LISTID[_0xdbe4('0x3f')]())[_0xdbe4('0x42')]('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0xdbe4('0x45')))[_0xdbe4('0x3f')]();return _0x43c68f;}return db[_0xdbe4('0x4d')][_0xdbe4('0x4e')]({'where':{'type':_0xdbe4('0x4f')},'attributes':['id',_0xdbe4('0x50')],'include':[{'model':db[_0xdbe4('0x51')],'as':_0xdbe4('0x52'),'where':{'id':LISTID}}]})[_0xdbe4('0x2e')](function(_0xf760ad){var _0xca18a5=[];if(_0xf760ad){var _0x29af80;for(var _0x37f9a5=0x0,_0x4d0922;_0x37f9a5<_0xf760ad[_0xdbe4('0x1c')];_0x37f9a5+=0x1){_0x4d0922=_0xf760ad[_0x37f9a5][_0xdbe4('0x53')]({'plain':!![]});switch(_0x4d0922[_0xdbe4('0x50')]){case _0xdbe4('0x54'):_0xca18a5[_0xdbe4('0x2f')](db[_0xdbe4('0x55')][_0xdbe4('0x56')](_0x274974(_0x4d0922,_0xdbe4('0x57')))[_0xdbe4('0x2e')](function(){})[_0xdbe4('0x31')](_0x550215()));break;case _0xdbe4('0x58'):_0xca18a5[_0xdbe4('0x2f')](db[_0xdbe4('0x55')]['query'](_0x45f574(_0x4d0922,_0xdbe4('0x57')))[_0xdbe4('0x2e')](function(){})[_0xdbe4('0x31')](_0x550215()));break;default:_0xca18a5['push'](db['sequelize'][_0xdbe4('0x56')](_0x6f7947(_0x4d0922,_0xdbe4('0x57')))['then'](function(){})[_0xdbe4('0x31')](_0x550215()));}}}return _0xca18a5;})[_0xdbe4('0x59')]()[_0xdbe4('0x2e')](function(){return db[_0xdbe4('0x4d')][_0xdbe4('0x4e')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0xdbe4('0x51')],'as':_0xdbe4('0x5a'),'where':{'id':LISTID}}]})[_0xdbe4('0x2e')](function(_0xa5c9c7){var _0x5e9626=[];if(_0xa5c9c7){var _0x3419f2;for(var _0x385447=0x0,_0x1b3c5d;_0x385447<_0xa5c9c7['length'];_0x385447+=0x1){_0x1b3c5d=_0xa5c9c7[_0x385447]['get']({'plain':!![]});_0x5e9626[_0xdbe4('0x2f')](db[_0xdbe4('0x55')][_0xdbe4('0x56')](_0x1a7b88(_0x1b3c5d,_0xdbe4('0x57')))[_0xdbe4('0x2e')](function(){})['catch'](_0x550215()));}}return _0x5e9626;})[_0xdbe4('0x59')]();})[_0xdbe4('0x2e')](function(){return db[_0xdbe4('0x5b')]['findAll']({'attributes':['id',_0xdbe4('0x50')],'include':[{'model':db['CmList'],'as':_0xdbe4('0x52'),'where':{'id':LISTID}}]})[_0xdbe4('0x2e')](function(_0x20b966){var _0x41d549=[];if(_0x20b966){for(var _0xfa3e53=0x0,_0x1e9b62;_0xfa3e53<_0x20b966[_0xdbe4('0x1c')];_0xfa3e53+=0x1){_0x1e9b62=_0x20b966[_0xfa3e53][_0xdbe4('0x53')]({'plain':!![]});switch(_0x1e9b62['dialCheckDuplicateType']){case'always':_0x41d549[_0xdbe4('0x2f')](db[_0xdbe4('0x55')]['query'](_0x274974(_0x1e9b62,'CampaignId'))['then'](function(){})['catch'](_0x550215()));break;case _0xdbe4('0x58'):_0x41d549[_0xdbe4('0x2f')](db[_0xdbe4('0x55')][_0xdbe4('0x56')](_0x45f574(_0x1e9b62,_0xdbe4('0x5c')))['then'](function(){})[_0xdbe4('0x31')](_0x550215()));break;default:_0x41d549[_0xdbe4('0x2f')](db[_0xdbe4('0x55')][_0xdbe4('0x56')](_0x6f7947(_0x1e9b62,'CampaignId'))[_0xdbe4('0x2e')](function(){})['catch'](_0x550215()));}}}return _0x41d549;})[_0xdbe4('0x59')]();})['then'](function(){return db[_0xdbe4('0x5b')][_0xdbe4('0x4e')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xdbe4('0x5a'),'where':{'id':LISTID}}]})['then'](function(_0x592228){var _0x31e894=[];if(_0x592228){for(var _0x23cf6b=0x0,_0x41a562;_0x23cf6b<_0x592228[_0xdbe4('0x1c')];_0x23cf6b+=0x1){_0x41a562=_0x592228[_0x23cf6b][_0xdbe4('0x53')]({'plain':!![]});_0x31e894['push'](db[_0xdbe4('0x55')][_0xdbe4('0x56')](_0x1a7b88(_0x41a562,_0xdbe4('0x5c')))[_0xdbe4('0x2e')](function(){})[_0xdbe4('0x31')](_0x550215()));}}return _0x31e894;})[_0xdbe4('0x59')]();})[_0xdbe4('0x31')](function(_0x50c6c9){logger['error'](_0xdbe4('0x5d'),_0xdbe4('0x5e'),_0x50c6c9[_0xdbe4('0x33')]);});}var processPromises=function(_0x2254a3){return BPromise[_0xdbe4('0x59')](promises)[_0xdbe4('0x2e')](function(_0x274581){})[_0xdbe4('0x31')](function(_0x38e869){logger['error'](_0xdbe4('0x5f'),JSON[_0xdbe4('0x60')](_0x38e869));})[_0xdbe4('0x61')](function(){socket[_0xdbe4('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2254a3){return _0x2254a3['resume']();}});};var endCsv=function(){return BPromise['resolve']()[_0xdbe4('0x2e')](function(){if(hopperContacts){return checkHopper();}})[_0xdbe4('0x2e')](function(){socket[_0xdbe4('0x62')](_0xdbe4('0x63')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xdbe4('0x64')](FILEPATH);}catch(_0x2d9359){logger['error'](_0xdbe4('0x65'),JSON[_0xdbe4('0x60')](_0x2d9359));}finally{process[_0xdbe4('0x66')](0x0);}});};process['on'](_0xdbe4('0x67'),function(){logger[_0xdbe4('0x68')](_0xdbe4('0x69'));endCsv();});function main(){return BPromise[_0xdbe4('0x6a')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xdbe4('0x2b')][_0xdbe4('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xdbe4('0x2e')](function(_0x110441){var _0x4291df=fs[_0xdbe4('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xdbe4('0x6c')](_0x4291df,{'header':!![],'skipEmptyLines':!![],'step':function(_0x24cbb3,_0x4c875c){total+=0x1;var _0x45dcb5=total;promises[_0xdbe4('0x2f')](checkRow(_0x24cbb3,_0x110441,_0x45dcb5)[_0xdbe4('0x2e')](function(){success+=0x1;})[_0xdbe4('0x31')](function(_0x2ca8cc){if(_0x2ca8cc[_0xdbe4('0x15')]){errors+=0x1;delete _0x2ca8cc[_0xdbe4('0x15')];}else if(_0x2ca8cc['duplicate']){duplicates+=0x1;delete _0x2ca8cc[_0xdbe4('0x29')];}rows[_0xdbe4('0x2f')](_0x2ca8cc);}));if(total%0xc8===0x0){_0x4c875c[_0xdbe4('0x6d')]();return processPromises(_0x4c875c);}},'complete':function(){return processPromises()[_0xdbe4('0x2e')](function(){logger[_0xdbe4('0x68')](_0xdbe4('0x6e'));endCsv();});},'error':function(_0x392235,_0x214176){logger[_0xdbe4('0x68')](_0xdbe4('0x6f'),JSON[_0xdbe4('0x60')](_0x392235));endCsv();}});})[_0xdbe4('0x31')](function(_0x1087a1){logger[_0xdbe4('0x15')](_0xdbe4('0x70'),JSON['stringify'](_0x1087a1));});}main();
\ No newline at end of file
+var _0x7c64=['checkHopper','inspect','insert','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper','into','from','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','dialCheckDuplicateType','CmList','Lists','get','always','sequelize','VoiceQueueId','onlyIfOpen','all','BlackLists','query','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','stringify','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','CSV\x20import\x20process\x20stopped!','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','api','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','contact','test','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','phone','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact'];(function(_0x20589d,_0x55d5bf){var _0x422de9=function(_0x44cbbb){while(--_0x44cbbb){_0x20589d['push'](_0x20589d['shift']());}};_0x422de9(++_0x55d5bf);}(_0x7c64,0x180));var _0x47c6=function(_0x15aacf,_0x2887aa){_0x15aacf=_0x15aacf-0x0;var _0x2796f9=_0x7c64[_0x15aacf];return _0x2796f9;};'use strict';var BPromise=require(_0x47c6('0x0'));var util=require(_0x47c6('0x1'));var _=require(_0x47c6('0x2'));var fs=require('fs');var squel=require(_0x47c6('0x3'));var Papa=require(_0x47c6('0x4'));var Redis=require(_0x47c6('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0x47c6('0x6'));var logger=require(_0x47c6('0x7'))(_0x47c6('0x8'));config[_0x47c6('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47c6('0x9')]));require(_0x47c6('0xa'))[_0x47c6('0xb')](socket);try{if(!process[_0x47c6('0xc')][0x2]||process[_0x47c6('0xc')][0x2]===_0x47c6('0xd')||process[_0x47c6('0xc')][0x2]===_0x47c6('0xe')){throw new Error(_0x47c6('0xf'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x47c6('0xc')][0x3]===_0x47c6('0xd')||process['argv'][0x3]===_0x47c6('0xe')||!process['argv'][0x4]||process[_0x47c6('0xc')][0x4]===_0x47c6('0xd')||process[_0x47c6('0xc')][0x4]===_0x47c6('0xe')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x47c6('0x10')](process[_0x47c6('0xc')][0x3]['split'](','),process[_0x47c6('0xc')][0x4][_0x47c6('0x11')](','));if(!process[_0x47c6('0xc')][0x5]||process['argv'][0x5]===_0x47c6('0xd')||process[_0x47c6('0xc')][0x5]===_0x47c6('0xe')){throw new Error(_0x47c6('0x12'));}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x47c6('0xc')][0x6]&&process[_0x47c6('0xc')][0x6]!==_0x47c6('0xd')&&process[_0x47c6('0xc')][0x6]!==_0x47c6('0xe')?process[_0x47c6('0xc')][0x6]:null;var DUPLICATES=process[_0x47c6('0xc')][0x7]&&process[_0x47c6('0xc')][0x7]!=='undefined'&&process['argv'][0x7]!==_0x47c6('0xe')?process[_0x47c6('0xc')][0x7]:null;if(!process[_0x47c6('0xc')][0x8]||process[_0x47c6('0xc')][0x8]===_0x47c6('0xd')||process[_0x47c6('0xc')][0x8]===_0x47c6('0xe')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x47c6('0xc')][0x8];}catch(_0x16a965){logger['error'](_0x16a965);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(_0x276820,_0x3bf563,_0x555fff,_0x322806){var _0x272661={'message':_0x3bf563};_0x272661[_0x276820]=!![];if(_0x555fff){_0x272661[_0x47c6('0x13')]=_0x555fff;}if(_0x322806){_0x272661['index']=_0x322806;}return _0x272661;}function isEmail(_0x18d95f){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))*$/[_0x47c6('0x14')](_0x18d95f);}function checkRow(_0x20c724,_0x228523,_0x4b4073){return new BPromise(function(_0x4b8059,_0x3f607e){if(_['isNil'](_0x20c724)){return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),_0x47c6('0x16'),null,_0x4b4073));}if(_0x20c724[_0x47c6('0x17')]&&_0x20c724[_0x47c6('0x17')][_0x47c6('0x18')]){var _0x1718fc=_[_0x47c6('0x19')](_0x20c724[_0x47c6('0x17')],_0x47c6('0x1a'))[_0x47c6('0x1b')](';');return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),_0x1718fc,null,_0x4b4073));}var _0x48c662={};for(var _0x4cb8fb in FIELDS){if(FIELDS[_0x47c6('0x1c')](_0x4cb8fb)&&FIELDS[_0x4cb8fb]){_0x48c662[_0x4cb8fb]=_0x20c724[_0x47c6('0x1d')][0x0][FIELDS[_0x4cb8fb]]||_0x20c724[_0x47c6('0x1d')][0x0]['\ufeff'+FIELDS[_0x4cb8fb]];}}if(!_0x48c662['firstName']){return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),'firstName\x20not\x20specified!',null,_0x4b4073));}if(!_0x48c662[_0x47c6('0x1e')]){return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),'phone\x20not\x20specified!',null,_0x4b4073));}if(_0x48c662['birthDate']){var _0x3a3e31=moment(_0x48c662['birthDate'],'YYYY-MM-DD');if(!_0x3a3e31[_0x47c6('0x1f')]()){return _0x3f607e(handleCheckRowError('error',_0x47c6('0x20'),null,_0x4b4073));}}if(_0x48c662['email']){if(!isEmail(_0x48c662[_0x47c6('0x21')])){return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),_0x47c6('0x22'),null,_0x4b4073));}}_0x48c662[_0x47c6('0x23')]=LISTID;_0x48c662[_0x47c6('0x24')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x47c6('0x18')]&&_0x228523){var _0x3d9e74={};for(var _0x4132a7=0x0,_0x52dcf3=DUPLICATES[_0x47c6('0x18')];_0x4132a7<_0x52dcf3;_0x4132a7+=0x1){_0x3d9e74[DUPLICATES[_0x4132a7]]=_0x48c662[DUPLICATES[_0x4132a7]];}var _0x430966=_[_0x47c6('0x25')](_0x228523,_0x3d9e74);if(_0x430966){return _0x3f607e(handleCheckRowError(_0x47c6('0x26'),_0x47c6('0x27'),_0x430966,_0x4b4073));}}return db['CmContact'][_0x47c6('0x28')](_0x48c662,{'raw':!![],'hooks':![],'fields':_[_0x47c6('0x29')](_0x48c662)})[_0x47c6('0x2a')](function(_0x563d8e){if(DUPLICATES&&DUPLICATES['length']&&_0x228523){_0x228523[_0x47c6('0x2b')](_[_0x47c6('0x2c')](_0x48c662,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x563d8e['id'];return _0x4b8059();})[_0x47c6('0x2d')](function(_0xe04bed){return _0x3f607e(handleCheckRowError(_0x47c6('0x15'),_0x47c6('0x2e')+(_0xe04bed[_0x47c6('0x1a')]||JSON['stringify'](_0xe04bed)),null,_0x4b4073));});});}function checkHopper(){function _0x3c6ae3(){return function(_0x14ffff){logger[_0x47c6('0x15')](_0x47c6('0x2f'),_0x47c6('0x30'),util[_0x47c6('0x31')](_0x14ffff,{'showHidden':![],'depth':null}));};}var _0x1c3ec3=function(_0x4d7f8c,_0xa8f98c){var _0x5cf524=squel[_0x47c6('0x32')]()['into']('cm_hopper')[_0x47c6('0x33')]([_0x47c6('0x1e'),_0x47c6('0x34'),_0x47c6('0x35'),_0x47c6('0x23'),_0xa8f98c,_0x47c6('0x36'),_0x47c6('0x37')],squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x1e'),_0x47c6('0x1e'))['field'](_0x47c6('0x3a'),'scheduledAt')[_0x47c6('0x39')]('id',_0x47c6('0x35'))[_0x47c6('0x39')](LISTID[_0x47c6('0x3b')](),_0x47c6('0x23'))['field'](_0x4d7f8c['id'][_0x47c6('0x3b')](),_0xa8f98c)['field'](_0x47c6('0x3a'),_0x47c6('0x36'))['field'](_0x47c6('0x3a'),_0x47c6('0x37'))['from'](_0x47c6('0x3c'))[_0x47c6('0x3d')](_0x47c6('0x3e'))[_0x47c6('0x3d')](_0x47c6('0x3f'),LISTID['toString']())[_0x47c6('0x3d')](_0x47c6('0x40'))[_0x47c6('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x47c6('0x38')]()['field'](_0x47c6('0x1e'))['from'](_0x47c6('0x41'))[_0x47c6('0x3d')](_0xa8f98c+'\x20=\x20?',_0x4d7f8c['id'][_0x47c6('0x3b')]())))[_0x47c6('0x3b')]();return _0x5cf524;};var _0x767e04=function(_0x2635c8,_0x5bb0e6){var _0x8d3494=squel[_0x47c6('0x32')]()[_0x47c6('0x42')](_0x47c6('0x41'))[_0x47c6('0x33')](['phone',_0x47c6('0x34'),_0x47c6('0x35'),'ListId',_0x5bb0e6,'createdAt',_0x47c6('0x37')],squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x1e'),_0x47c6('0x1e'))['field']('NOW()',_0x47c6('0x34'))[_0x47c6('0x39')]('id',_0x47c6('0x35'))[_0x47c6('0x39')](LISTID[_0x47c6('0x3b')](),_0x47c6('0x23'))[_0x47c6('0x39')](_0x2635c8['id']['toString'](),_0x5bb0e6)[_0x47c6('0x39')](_0x47c6('0x3a'),'createdAt')['field'](_0x47c6('0x3a'),'updatedAt')[_0x47c6('0x43')]('cm_contacts')['where'](_0x47c6('0x3e'))[_0x47c6('0x3d')](_0x47c6('0x3f'),LISTID['toString']())[_0x47c6('0x3d')](_0x47c6('0x44'),squel[_0x47c6('0x45')](hopperContacts))['where'](_0x47c6('0x40'))[_0x47c6('0x3d')](_0x47c6('0x46'),squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x47'))[_0x47c6('0x43')](_0x47c6('0x48'))[_0x47c6('0x3d')](_0x5bb0e6+'\x20=\x20?',_0x2635c8['id']['toString']()))[_0x47c6('0x3d')](_0x47c6('0x46'),squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x1e'))[_0x47c6('0x43')](_0x47c6('0x41'))[_0x47c6('0x3d')](_0x5bb0e6+_0x47c6('0x49'),_0x2635c8['id'][_0x47c6('0x3b')]())))['toString']();return _0x8d3494;};function _0x457695(_0x39aad6,_0x8ae868){var _0x295d64=squel[_0x47c6('0x32')]()['into'](_0x47c6('0x41'))[_0x47c6('0x33')]([_0x47c6('0x1e'),_0x47c6('0x34'),_0x47c6('0x35'),_0x47c6('0x23'),_0x8ae868,'createdAt',_0x47c6('0x37')],squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x1e'),_0x47c6('0x1e'))[_0x47c6('0x39')]('NOW()',_0x47c6('0x34'))['field']('id',_0x47c6('0x35'))[_0x47c6('0x39')](LISTID[_0x47c6('0x3b')](),_0x47c6('0x23'))[_0x47c6('0x39')](_0x39aad6['id'][_0x47c6('0x3b')](),_0x8ae868)[_0x47c6('0x39')](_0x47c6('0x3a'),'createdAt')[_0x47c6('0x39')](_0x47c6('0x3a'),_0x47c6('0x37'))['from']('cm_contacts')['where'](_0x47c6('0x3e'))[_0x47c6('0x3d')](_0x47c6('0x3f'),LISTID[_0x47c6('0x3b')]())[_0x47c6('0x3d')](_0x47c6('0x44'),squel[_0x47c6('0x45')](hopperContacts))[_0x47c6('0x3d')](_0x47c6('0x40')))[_0x47c6('0x3b')]();return _0x295d64;}function _0x4dedcc(_0x1a57dc,_0x3634d2){var _0x3dddeb=squel[_0x47c6('0x32')]()['into'](_0x47c6('0x4a'))[_0x47c6('0x33')]([_0x47c6('0x1e'),_0x47c6('0x35'),_0x47c6('0x23'),_0x3634d2,_0x47c6('0x36'),_0x47c6('0x37')],squel[_0x47c6('0x38')]()[_0x47c6('0x39')](_0x47c6('0x1e'),_0x47c6('0x1e'))['field']('id',_0x47c6('0x35'))['field'](LISTID[_0x47c6('0x3b')](),_0x47c6('0x23'))[_0x47c6('0x39')](_0x1a57dc['id'][_0x47c6('0x3b')](),_0x3634d2)['field'](_0x47c6('0x3a'),_0x47c6('0x36'))[_0x47c6('0x39')]('NOW()',_0x47c6('0x37'))[_0x47c6('0x43')](_0x47c6('0x3c'))[_0x47c6('0x3d')](_0x47c6('0x3e'))[_0x47c6('0x3d')](_0x47c6('0x3f'),LISTID['toString']())[_0x47c6('0x3d')](_0x47c6('0x44'),squel[_0x47c6('0x45')](hopperContacts))[_0x47c6('0x3d')](_0x47c6('0x40')))[_0x47c6('0x3b')]();return _0x3dddeb;}return db[_0x47c6('0x4b')][_0x47c6('0x4c')]({'where':{'type':'outbound'},'attributes':['id',_0x47c6('0x4d')],'include':[{'model':db[_0x47c6('0x4e')],'as':_0x47c6('0x4f'),'where':{'id':LISTID}}]})[_0x47c6('0x2a')](function(_0x13eabc){var _0x28952a=[];if(_0x13eabc){var _0x20d74c;for(var _0x1f7649=0x0,_0x302010;_0x1f7649<_0x13eabc[_0x47c6('0x18')];_0x1f7649+=0x1){_0x302010=_0x13eabc[_0x1f7649][_0x47c6('0x50')]({'plain':!![]});switch(_0x302010[_0x47c6('0x4d')]){case _0x47c6('0x51'):_0x28952a[_0x47c6('0x2b')](db[_0x47c6('0x52')]['query'](_0x767e04(_0x302010,_0x47c6('0x53')))[_0x47c6('0x2a')](function(){})[_0x47c6('0x2d')](_0x3c6ae3()));break;case _0x47c6('0x54'):_0x28952a[_0x47c6('0x2b')](db[_0x47c6('0x52')]['query'](_0x1c3ec3(_0x302010,'VoiceQueueId'))['then'](function(){})[_0x47c6('0x2d')](_0x3c6ae3()));break;default:_0x28952a[_0x47c6('0x2b')](db[_0x47c6('0x52')]['query'](_0x457695(_0x302010,_0x47c6('0x53')))[_0x47c6('0x2a')](function(){})[_0x47c6('0x2d')](_0x3c6ae3()));}}}return _0x28952a;})[_0x47c6('0x55')]()[_0x47c6('0x2a')](function(){return db['VoiceQueue'][_0x47c6('0x4c')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x47c6('0x56'),'where':{'id':LISTID}}]})[_0x47c6('0x2a')](function(_0x4b4d7a){var _0x573a51=[];if(_0x4b4d7a){var _0x44579b;for(var _0x5d9758=0x0,_0x4a043b;_0x5d9758<_0x4b4d7a[_0x47c6('0x18')];_0x5d9758+=0x1){_0x4a043b=_0x4b4d7a[_0x5d9758][_0x47c6('0x50')]({'plain':!![]});_0x573a51[_0x47c6('0x2b')](db[_0x47c6('0x52')][_0x47c6('0x57')](_0x4dedcc(_0x4a043b,_0x47c6('0x53')))[_0x47c6('0x2a')](function(){})[_0x47c6('0x2d')](_0x3c6ae3()));}}return _0x573a51;})[_0x47c6('0x55')]();})[_0x47c6('0x2a')](function(){return db[_0x47c6('0x58')]['findAll']({'attributes':['id',_0x47c6('0x4d')],'include':[{'model':db[_0x47c6('0x4e')],'as':_0x47c6('0x4f'),'where':{'id':LISTID}}]})[_0x47c6('0x2a')](function(_0x5a4cce){var _0x1ed995=[];if(_0x5a4cce){for(var _0x4e28d1=0x0,_0x3fa2d7;_0x4e28d1<_0x5a4cce['length'];_0x4e28d1+=0x1){_0x3fa2d7=_0x5a4cce[_0x4e28d1]['get']({'plain':!![]});switch(_0x3fa2d7[_0x47c6('0x4d')]){case _0x47c6('0x51'):_0x1ed995[_0x47c6('0x2b')](db[_0x47c6('0x52')]['query'](_0x767e04(_0x3fa2d7,_0x47c6('0x59')))[_0x47c6('0x2a')](function(){})['catch'](_0x3c6ae3()));break;case _0x47c6('0x54'):_0x1ed995[_0x47c6('0x2b')](db[_0x47c6('0x52')][_0x47c6('0x57')](_0x1c3ec3(_0x3fa2d7,_0x47c6('0x59')))['then'](function(){})['catch'](_0x3c6ae3()));break;default:_0x1ed995[_0x47c6('0x2b')](db['sequelize'][_0x47c6('0x57')](_0x457695(_0x3fa2d7,_0x47c6('0x59')))[_0x47c6('0x2a')](function(){})['catch'](_0x3c6ae3()));}}}return _0x1ed995;})[_0x47c6('0x55')]();})['then'](function(){return db[_0x47c6('0x58')][_0x47c6('0x4c')]({'attributes':['id'],'include':[{'model':db[_0x47c6('0x4e')],'as':_0x47c6('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x7362ef){var _0x1d0331=[];if(_0x7362ef){for(var _0x2d7ca8=0x0,_0x2470bd;_0x2d7ca8<_0x7362ef[_0x47c6('0x18')];_0x2d7ca8+=0x1){_0x2470bd=_0x7362ef[_0x2d7ca8][_0x47c6('0x50')]({'plain':!![]});_0x1d0331[_0x47c6('0x2b')](db[_0x47c6('0x52')][_0x47c6('0x57')](_0x4dedcc(_0x2470bd,_0x47c6('0x59')))[_0x47c6('0x2a')](function(){})[_0x47c6('0x2d')](_0x3c6ae3()));}}return _0x1d0331;})[_0x47c6('0x55')]();})[_0x47c6('0x2d')](function(_0x70f320){logger['error'](_0x47c6('0x5a'),_0x47c6('0x5b'),_0x70f320[_0x47c6('0x1a')]);});}var processPromises=function(_0x1ddf75){return BPromise[_0x47c6('0x55')](promises)['then'](function(_0x19fd0f){})['catch'](function(_0x4b8af9){logger[_0x47c6('0x15')]('Error\x20processing\x20rows\x20block:',JSON[_0x47c6('0x5c')](_0x4b8af9));})[_0x47c6('0x5d')](function(){socket[_0x47c6('0x5e')](_0x47c6('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x1ddf75){return _0x1ddf75['resume']();}});};var endCsv=function(){return BPromise[_0x47c6('0x60')]()[_0x47c6('0x2a')](function(){if(hopperContacts){return checkHopper();}})[_0x47c6('0x2a')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x47c6('0x61')](FILEPATH);}catch(_0x106277){logger[_0x47c6('0x15')](_0x47c6('0x62'),JSON[_0x47c6('0x5c')](_0x106277));}finally{process[_0x47c6('0x63')](0x0);}});};process['on'](_0x47c6('0x64'),function(){logger['info'](_0x47c6('0x65'));endCsv();});function main(){return BPromise[_0x47c6('0x60')]()[_0x47c6('0x2a')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x47c6('0x11')](',');return db[_0x47c6('0x66')][_0x47c6('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x47c6('0x2a')](function(_0x3f0c97){var _0x5e358e=fs[_0x47c6('0x67')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x47c6('0x68')](_0x5e358e,{'header':!![],'skipEmptyLines':!![],'step':function(_0x370dba,_0x1a4e57){total+=0x1;var _0x2ce7ae=total;promises[_0x47c6('0x2b')](checkRow(_0x370dba,_0x3f0c97,_0x2ce7ae)['then'](function(){success+=0x1;})[_0x47c6('0x2d')](function(_0x2e30c9){if(_0x2e30c9[_0x47c6('0x15')]){errors+=0x1;delete _0x2e30c9[_0x47c6('0x15')];}else if(_0x2e30c9[_0x47c6('0x26')]){duplicates+=0x1;delete _0x2e30c9[_0x47c6('0x26')];}rows[_0x47c6('0x2b')](_0x2e30c9);}));if(total%0xc8===0x0){_0x1a4e57[_0x47c6('0x69')]();return processPromises(_0x1a4e57);}},'complete':function(){return processPromises()[_0x47c6('0x2a')](function(){logger['info'](_0x47c6('0x6a'));endCsv();});},'error':function(_0x4f5241,_0x58c266){logger['info'](_0x47c6('0x6b'),JSON[_0x47c6('0x5c')](_0x4f5241));endCsv();}});})['catch'](function(_0x38f0f2){logger[_0x47c6('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x47c6('0x5c')](_0x38f0f2));});}main();
\ No newline at end of file
index 0653efe..0118ec4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89cb=['ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.id','phone','select','field','cm_hopper_black','\x20=\x20?','keys','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','error','message','errors','push','code','sequelize','query','spread','catch','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','writeFileSync','parse','data','length','rows','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','contact:import:','abort','SystemError','step','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','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()','duplicates','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','emit','unlink','exit','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','localhost','socket.io-emitter','YYYY-MM-DD\x20HH:mm:ss','test','from','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat'];(function(_0x2da15f,_0x4a8bd1){var _0x5e63de=function(_0x244f5d){while(--_0x244f5d){_0x2da15f['push'](_0x2da15f['shift']());}};_0x5e63de(++_0x4a8bd1);}(_0x89cb,0xef));var _0xb89c=function(_0x399f1d,_0x45bebd){_0x399f1d=_0x399f1d-0x0;var _0x2c6061=_0x89cb[_0x399f1d];return _0x2c6061;};'use strict';var fs=require('fs');var path=require(_0xb89c('0x0'));var _=require(_0xb89c('0x1'));var Papa=require(_0xb89c('0x2'));var util=require(_0xb89c('0x3'));var BPromise=require(_0xb89c('0x4'));var moment=require(_0xb89c('0x5'));var squel=require(_0xb89c('0x6'));var Redis=require(_0xb89c('0x7'));var db=require(_0xb89c('0x8'))['db'];var config=require(_0xb89c('0x9'));var logger=require(_0xb89c('0xa'))(_0xb89c('0xb'));config[_0xb89c('0xc')]=_['defaults'](config[_0xb89c('0xc')],{'host':_0xb89c('0xd'),'port':0x18eb});var socket=require(_0xb89c('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0xb89c('0xf'));function isEmail(_0x266071){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))*$/[_0xb89c('0x10')](_0x266071);}function selectNotIn(_0x301e9f,_0x57484f,_0x1c72f1,_0x1ab4e0,_0x200e1f){return squel['select']()['field']('phone')[_0xb89c('0x11')](_0x1ab4e0)['join'](_0x57484f,null,_0x57484f+_0xb89c('0x12')+_0x1ab4e0+'.'+_0x1c72f1)['where'](_0x1ab4e0+'.'+_0x1c72f1+_0xb89c('0x13')+_0x301e9f+'.'+_0x1c72f1)[_0xb89c('0x14')](_0x57484f+_0xb89c('0x15')+_0x200e1f[_0xb89c('0x16')]()+')');}function insertCmHopper(_0xd19675,_0xf28dca,_0x1d14ec,_0xa5d382,_0x131817){var _0x36a787=[_0xb89c('0x17'),_0xb89c('0x18'),'cm_contacts.id',_0xb89c('0x19'),_0xf28dca+'.'+_0xa5d382,_0xb89c('0x1a'),_0xb89c('0x1b'),_0xb89c('0x1c'),_0xb89c('0x1d'),'\x22'+_0x131817+'\x22'];return squel[_0xb89c('0x1e')]()[_0xb89c('0x1f')](_0xb89c('0x20'))[_0xb89c('0x21')](['phone',_0xb89c('0x22'),_0xb89c('0x23'),_0xb89c('0x24'),_0xa5d382,_0xb89c('0x25'),_0xb89c('0x26'),_0xb89c('0x27'),_0xb89c('0x28'),'recallme'],squel['select']()[_0xb89c('0x29')](_0x36a787)[_0xb89c('0x11')](_0xf28dca)[_0xb89c('0x16')](_0xb89c('0x2a'),null,_0xb89c('0x2b')+_0xf28dca+_0xb89c('0x2c'))[_0xb89c('0x16')](_0x1d14ec,null,_0x1d14ec+_0xb89c('0x12')+_0xf28dca+'.'+_0xa5d382)['where'](_0xf28dca+_0xb89c('0x2d'),_0xd19675)[_0xb89c('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0xb89c('0x2e'),selectNotIn(_0xf28dca,_0x1d14ec,_0xa5d382,'cm_hopper',[_0xb89c('0x2f'),'\x22onlyIfOpen\x22']))[_0xb89c('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xf28dca,_0x1d14ec,_0xa5d382,_0xb89c('0x20'),[_0xb89c('0x2f')])))[_0xb89c('0x30')]();}function insertCmHopperBlack(_0x37e738,_0x389b84,_0x5dfa5f,_0x4ec158){var _0x5a851a=[_0xb89c('0x17'),_0xb89c('0x31'),_0xb89c('0x19'),_0x389b84+'.'+_0x4ec158,_0xb89c('0x1a'),_0xb89c('0x1b')];return squel['insert']()[_0xb89c('0x1f')]('cm_hopper_black')[_0xb89c('0x21')]([_0xb89c('0x32'),_0xb89c('0x23'),'ListId',_0x4ec158,_0xb89c('0x25'),_0xb89c('0x26')],squel['select']()['fields'](_0x5a851a)[_0xb89c('0x11')](_0x389b84)[_0xb89c('0x16')](_0xb89c('0x2a'),null,_0xb89c('0x2b')+_0x389b84+_0xb89c('0x2c'))[_0xb89c('0x16')](_0x5dfa5f,null,_0x5dfa5f+'.id\x20=\x20'+_0x389b84+'.'+_0x4ec158)[_0xb89c('0x14')](_0x389b84+'.CmListId\x20=\x20?',_0x37e738)[_0xb89c('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xb89c('0x33')]()[_0xb89c('0x34')]('phone')[_0xb89c('0x11')](_0xb89c('0x35'))[_0xb89c('0x14')]('ListId\x20=\x20?',_0x37e738)[_0xb89c('0x14')](_0x4ec158+_0xb89c('0x36'),_0x389b84+'.'+_0x4ec158)))[_0xb89c('0x30')]();}function insertCmContact(_0x13b078,_0x359b23,_0x43aa62,_0x459568){var _0x561826=_['concat'](_[_0xb89c('0x37')](_0x459568),['ListId','CompanyId',_0xb89c('0x25'),'updatedAt']);return squel[_0xb89c('0x1e')]()['into'](_0xb89c('0x2a'))[_0xb89c('0x21')](_0x561826,squel['select']()['fields'](_0x561826)['from'](_0x359b23)['where']('('+_0x43aa62[_0xb89c('0x16')](',')+')\x20NOT\x20IN\x20?',squel[_0xb89c('0x33')]()['fields'](_0x43aa62)['from']('cm_contacts')[_0xb89c('0x14')](_0xb89c('0x38'),_0x13b078)[_0xb89c('0x14')](_0xb89c('0x39')))[_0xb89c('0x14')](_0xb89c('0x3a'),squel[_0xb89c('0x33')]()['field'](_0xb89c('0x3b'),_0xb89c('0x3c'))['from'](_0x359b23)['group'](_0x43aa62[_0xb89c('0x16')](','))))['toString']();}function handleStop(){logger[_0xb89c('0x3d')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x36d131){logger[_0xb89c('0x3e')](_0x36d131[_0xb89c('0x3f')]);process['exit'](0x1);}function handleError(_0x4cec9c,_0x56f4fa){stats[_0xb89c('0x40')][_0xb89c('0x41')]({'name':_0x56f4fa[_0xb89c('0x42')],'message':_0x56f4fa[_0xb89c('0x3f')],'row':_0x4cec9c});}function handleQuery(_0x4608a3){logger[_0xb89c('0x3d')](_0x4608a3);return db[_0xb89c('0x43')][_0xb89c('0x44')](_0x4608a3)[_0xb89c('0x45')](function(_0x38e507){results[_0xb89c('0x41')](_0x38e507);})[_0xb89c('0x46')](function(_0x5db7d0){logger[_0xb89c('0x3e')](_0x5db7d0[_0xb89c('0x3f')]);});}function main(_0x5247ed,_0x1a6cd7,_0x5b2a8a,_0x1ad930){logger['info']('main',_0x5247ed,JSON[_0xb89c('0x47')](_0x1a6cd7));process[_0xb89c('0x48')](_0xb89c('0x49'));var _0x510b60=_0x1a6cd7[_0xb89c('0x4a')];var _0x41bd1d=_0x1a6cd7[_0xb89c('0x4b')];var _0x5c27e3=path[_0xb89c('0x16')](config[_0xb89c('0x4c')],_0xb89c('0x4d'),_0x41bd1d+_0xb89c('0x4e'));var _0x3f25fc=_[_0xb89c('0x37')](_0x510b60)[_0xb89c('0x16')]();logger['info']('header',_0x3f25fc);fs[_0xb89c('0x4f')](_0x5c27e3,_0x3f25fc+'\x0a');Papa[_0xb89c('0x50')](fs['createReadStream'](_0x5247ed),{'header':!![],'skipEmptyLines':!![],'step':function(_0xdafcf4,_0x4c07fc){try{for(var _0x57018d=0x0,_0x1d2cf5=[];_0x57018d<_0xdafcf4[_0xb89c('0x51')][_0xb89c('0x52')];_0x57018d++){stats[_0xb89c('0x53')]+=0x1;if(_0xdafcf4[_0xb89c('0x40')][_0x57018d]){handleError(_0xdafcf4['data'][_0x57018d],_0xdafcf4['errors'][_0x57018d]);}else{var _0xdc80fa=[];for(var _0x2d08c1 in _0x510b60){if(_0x510b60[_0xb89c('0x54')](_0x2d08c1)){if(_0xdafcf4[_0xb89c('0x51')][_0x57018d][_0x510b60[_0x2d08c1]]){var _0x3ef893=_[_0xb89c('0x55')](_0xdafcf4[_0xb89c('0x51')][_0x57018d][_0x510b60[_0x2d08c1]]['replace'](/"/g,'\x27'));switch(_0x2d08c1){case _0xb89c('0x22'):var _0x4bcc4f=moment(_0x3ef893,_0xb89c('0xf'),!![]);if(_0x4bcc4f[_0xb89c('0x56')]()){_0x1d2cf5[_0xb89c('0x41')]('\x22'+_0x3ef893+'\x22');}else{_0xdc80fa[_0xb89c('0x41')](_0xb89c('0x57'));}break;case'priority':var _0x23f48c=parseInt(_0x3ef893);_0x3ef893=_['isNaN'](_0x23f48c)||_0x23f48c<0x0||_0x23f48c>0x4?_0x1ad930?0x3:0x2:_0x23f48c;_0x1d2cf5[_0xb89c('0x41')]('\x22'+_0x3ef893+'\x22');break;case'UserId':var _0x11cdb5=parseInt(_0x3ef893);if(_[_0xb89c('0x58')](_0x11cdb5)&&_['includes'](_0x5b2a8a,_0x11cdb5)){_0x1d2cf5['push']('\x22'+_0x11cdb5+'\x22');}else{_0xdc80fa[_0xb89c('0x41')]('agent\x20not\x20exists');}break;case _0xb89c('0x59'):if(isEmail(_0x3ef893)){_0x1d2cf5['push']('\x22'+_0x3ef893+'\x22');}else{_0xdc80fa[_0xb89c('0x41')](_0xb89c('0x5a'));}break;case _0xb89c('0x5b'):var _0x573ef2=moment(_0x3ef893,_0xb89c('0x5c'),!![]);if(_0x573ef2[_0xb89c('0x56')]()){_0x1d2cf5['push']('\x22'+_0x3ef893+'\x22');}else{_0xdc80fa['push'](_0xb89c('0x5d'));}break;default:_0x1d2cf5[_0xb89c('0x41')]('\x22'+_0x3ef893+'\x22');}}else{switch(_0x2d08c1){case _0xb89c('0x5e'):case _0xb89c('0x32'):_0xdc80fa['push'](_0x2d08c1+'\x20not\x20specified');break;default:_0x1d2cf5[_0xb89c('0x41')]('\x22\x22');}}}}if(_0xdc80fa[_0xb89c('0x52')]){handleError(_0xdafcf4['data'][_0x57018d],{'code':_0xb89c('0x5f'),'message':_0xdc80fa[_0xb89c('0x16')]()});}else{fs[_0xb89c('0x60')](_0x5c27e3,_0x1d2cf5['join']()+'\x0a');}_0x1d2cf5=[];}if(!(stats[_0xb89c('0x53')]%0xc8)){socket['emit'](_0xb89c('0x61')+_0x41bd1d,stats);stats['errors']=[];}}if(stopped){logger[_0xb89c('0x3d')]('Abort\x20parser');_0x4c07fc[_0xb89c('0x62')]();}}catch(_0x34acfb){handleError(_0xdafcf4[_0xb89c('0x51')][_0x57018d],{'code':_0xb89c('0x63'),'message':_0x34acfb[_0xb89c('0x3f')]});logger[_0xb89c('0x3e')](_0xb89c('0x64'),_0x34acfb[_0xb89c('0x3f')]);}},'complete':function(){try{var _0x1d9d3e=[];var _0x788379=_0xb89c('0x2a');if(_0x1a6cd7['duplicates']&&_0x1a6cd7['duplicates'][_0xb89c('0x52')]){_0x788379=_0xb89c('0x65')+_0x41bd1d;_0x1d9d3e[_0xb89c('0x41')](_0xb89c('0x66')+_0x788379+_0xb89c('0x67'));}var _0x4b16d2=util[_0xb89c('0x68')](_0xb89c('0x69'),_0x5c27e3,_0x788379,_0x3f25fc,_0x1a6cd7['ListId'],_0x1a6cd7[_0xb89c('0x6a')]||null,NOW,NOW);if(_[_0xb89c('0x6b')](_0x510b60['scheduledat'])){_0x4b16d2+=_0xb89c('0x6c');}_0x1d9d3e[_0xb89c('0x41')](_0x4b16d2);if(_0x1a6cd7[_0xb89c('0x6d')]&&_0x1a6cd7[_0xb89c('0x6d')][_0xb89c('0x52')]){_0x1d9d3e['push'](insertCmContact(_0x1a6cd7[_0xb89c('0x24')],_0x788379,_0x1a6cd7[_0xb89c('0x6d')],_0x510b60));_0x1d9d3e[_0xb89c('0x41')](_0xb89c('0x6e')+_0x788379+';');}_0x1d9d3e[_0xb89c('0x41')](insertCmHopper(_0x1a6cd7[_0xb89c('0x24')],_0xb89c('0x6f'),_0xb89c('0x70'),'VoiceQueueId',_0x1ad930));_0x1d9d3e[_0xb89c('0x41')](insertCmHopperBlack(_0x1a6cd7[_0xb89c('0x24')],'voice_queues_has_cm_blacklists',_0xb89c('0x70'),_0xb89c('0x71')));_0x1d9d3e[_0xb89c('0x41')](insertCmHopper(_0x1a6cd7[_0xb89c('0x24')],_0xb89c('0x72'),_0xb89c('0x73'),_0xb89c('0x74'),_0x1ad930));_0x1d9d3e[_0xb89c('0x41')](insertCmHopperBlack(_0x1a6cd7[_0xb89c('0x24')],_0xb89c('0x75'),_0xb89c('0x73'),_0xb89c('0x74')));BPromise[_0xb89c('0x76')](_0x1d9d3e,handleQuery)[_0xb89c('0x77')](function(_0x3711fd){stats[_0xb89c('0x78')]=!![];stats[_0xb89c('0x79')]=_0x1a6cd7['duplicates']&&_0x1a6cd7[_0xb89c('0x6d')]['length']?results[0x2][_0xb89c('0x79')]:results[0x0]['affectedRows'];socket[_0xb89c('0x7a')](_0xb89c('0x61')+_0x41bd1d,stats);fs[_0xb89c('0x7b')](_0x5247ed);fs[_0xb89c('0x7b')](_0x5c27e3);process[_0xb89c('0x7c')](0x0);})[_0xb89c('0x46')](function(_0xc2e102){logger[_0xb89c('0x3e')](_0xc2e102[_0xb89c('0x3f')]);process[_0xb89c('0x7c')](0x1);});}catch(_0x4bd917){logger['error'](_0xb89c('0x7d'),_0x4bd917[_0xb89c('0x3f')]);process[_0xb89c('0x7c')](0x1);}},'error':function(_0x1151a2,_0x2c15b6,_0xa4e215,_0x4d5959){throw new Error(_0x4d5959);}});}function validate(){if(process[_0xb89c('0x7e')]&&process[_0xb89c('0x7e')][_0xb89c('0x52')]<0x4){throw new Error(_0xb89c('0x7f'));}var _0x3d9f12=path[_0xb89c('0x16')](config[_0xb89c('0x4c')],_0xb89c('0x4d'),process[_0xb89c('0x7e')][0x2]);if(!fs['existsSync'](_0x3d9f12)){throw new Error(_0xb89c('0x80'));}var _0x125966={};try{_0x125966=JSON[_0xb89c('0x50')](process['argv'][0x3]);if(!_0x125966[_0xb89c('0x4a')]){throw new Error(_0xb89c('0x81'));}if(!_0x125966[_0xb89c('0x4a')][_0xb89c('0x32')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x125966['binding'][_0xb89c('0x5e')]){throw new Error(_0xb89c('0x82'));}var _0x145a5=0x0;if(_0x125966[_0xb89c('0x4a')]['UserId']){_0x145a5=0x1;}if(!_0x125966['ListId']){throw new Error(_0xb89c('0x83'));}}catch(_0x21485e){throw new Error(_0xb89c('0x84'));}var _0x44bab5=[];try{_0x44bab5=_[_0xb89c('0x85')](JSON['parse'](process[_0xb89c('0x7e')][0x4]),'id');}catch(_0x28599c){logger[_0xb89c('0x3d')](_0xb89c('0x86'));}main(_0x3d9f12,_0x125966,_0x44bab5,_0x145a5);}validate();process['on'](_0xb89c('0x87'),handleStop);process['on'](_0xb89c('0x88'),handleUncaughtException);
\ No newline at end of file
+var _0x5e61=['\x20LIKE\x20cm_contacts;','isNil','scheduledat',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns','then','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','existsSync','file\x20doesn\x27t\x20exists','parse','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','util','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','localhost','socket.io-emitter','format','field','phone','join','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','ContactId','ListId','createdAt','updatedAt','UserId','recallme','select','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_hopper_black','fromQuery','from','.CmListId','ListId\x20=\x20?','concat','keys','CompanyId','insert','fields',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','spread','catch','send','start','binding','socket_timestamp','server/files/tmp','.csv','header','writeFileSync','createReadStream','length','rows','data','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_'];(function(_0x16051a,_0x5e4326){var _0x35d20d=function(_0x52b02e){while(--_0x52b02e){_0x16051a['push'](_0x16051a['shift']());}};_0x35d20d(++_0x5e4326);}(_0x5e61,0x126));var _0x15e6=function(_0x4d3a09,_0xdc7ed4){_0x4d3a09=_0x4d3a09-0x0;var _0x555d66=_0x5e61[_0x4d3a09];return _0x555d66;};'use strict';var fs=require('fs');var path=require(_0x15e6('0x0'));var _=require('lodash');var Papa=require(_0x15e6('0x1'));var util=require(_0x15e6('0x2'));var BPromise=require('bluebird');var moment=require(_0x15e6('0x3'));var squel=require(_0x15e6('0x4'));var Redis=require(_0x15e6('0x5'));var db=require(_0x15e6('0x6'))['db'];var config=require('../../../config/environment');var logger=require(_0x15e6('0x7'))(_0x15e6('0x8'));config[_0x15e6('0x9')]=_['defaults'](config[_0x15e6('0x9')],{'host':_0x15e6('0xa'),'port':0x18eb});var socket=require(_0x15e6('0xb'))(new Redis(config[_0x15e6('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x15e6('0xc')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x501836){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'](_0x501836);}function selectNotIn(_0x10a5ec,_0x16cfb0,_0x5c355c,_0x3f51fc,_0x85e48a){return squel['select']()[_0x15e6('0xd')](_0x15e6('0xe'))['from'](_0x3f51fc)[_0x15e6('0xf')](_0x16cfb0,null,_0x16cfb0+'.id\x20=\x20'+_0x3f51fc+'.'+_0x5c355c)['where'](_0x3f51fc+'.'+_0x5c355c+_0x15e6('0x10')+_0x10a5ec+'.'+_0x5c355c)[_0x15e6('0x11')](_0x16cfb0+_0x15e6('0x12')+_0x85e48a[_0x15e6('0xf')]()+')');}function insertCmHopper(_0x398f71,_0x331ad2,_0x522312,_0x4cdc5a,_0x13cbe2){var _0x527891=[_0x15e6('0x13'),_0x15e6('0x14'),_0x15e6('0x15'),'cm_contacts.ListId',_0x331ad2+'.'+_0x4cdc5a,_0x15e6('0x16'),_0x15e6('0x17'),_0x15e6('0x18'),_0x15e6('0x19'),'\x22'+_0x13cbe2+'\x22'];return squel['insert']()[_0x15e6('0x1a')](_0x15e6('0x1b'))['fromQuery']([_0x15e6('0xe'),'scheduledat',_0x15e6('0x1c'),_0x15e6('0x1d'),_0x4cdc5a,_0x15e6('0x1e'),_0x15e6('0x1f'),'priority',_0x15e6('0x20'),_0x15e6('0x21')],squel[_0x15e6('0x22')]()['fields'](_0x527891)['from'](_0x331ad2)['join'](_0x15e6('0x23'),null,_0x15e6('0x24')+_0x331ad2+'.CmListId')[_0x15e6('0xf')](_0x522312,null,_0x522312+_0x15e6('0x25')+_0x331ad2+'.'+_0x4cdc5a)['where'](_0x331ad2+_0x15e6('0x26'),_0x398f71)[_0x15e6('0x11')](_0x15e6('0x27'),NOW)[_0x15e6('0x11')](_0x15e6('0x28'),selectNotIn(_0x331ad2,_0x522312,_0x4cdc5a,_0x15e6('0x1b'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x15e6('0x11')](_0x15e6('0x28'),selectNotIn(_0x331ad2,_0x522312,_0x4cdc5a,_0x15e6('0x1b'),[_0x15e6('0x29')])))[_0x15e6('0x2a')]();}function insertCmHopperBlack(_0x569dd4,_0x2345d6,_0x4030dc,_0x353af7){var _0x252538=[_0x15e6('0x13'),_0x15e6('0x15'),'cm_contacts.ListId',_0x2345d6+'.'+_0x353af7,_0x15e6('0x16'),_0x15e6('0x17')];return squel['insert']()[_0x15e6('0x1a')](_0x15e6('0x2b'))[_0x15e6('0x2c')]([_0x15e6('0xe'),_0x15e6('0x1c'),_0x15e6('0x1d'),_0x353af7,'createdAt',_0x15e6('0x1f')],squel[_0x15e6('0x22')]()['fields'](_0x252538)[_0x15e6('0x2d')](_0x2345d6)['join'](_0x15e6('0x23'),null,_0x15e6('0x24')+_0x2345d6+_0x15e6('0x2e'))[_0x15e6('0xf')](_0x4030dc,null,_0x4030dc+'.id\x20=\x20'+_0x2345d6+'.'+_0x353af7)['where'](_0x2345d6+'.CmListId\x20=\x20?',_0x569dd4)[_0x15e6('0x11')](_0x15e6('0x27'),NOW)[_0x15e6('0x11')](_0x15e6('0x28'),squel[_0x15e6('0x22')]()[_0x15e6('0xd')]('phone')[_0x15e6('0x2d')](_0x15e6('0x2b'))[_0x15e6('0x11')](_0x15e6('0x2f'),_0x569dd4)[_0x15e6('0x11')](_0x353af7+'\x20=\x20?',_0x2345d6+'.'+_0x353af7)))[_0x15e6('0x2a')]();}function insertCmContact(_0x1a235f,_0x2dd103,_0x40a862,_0x43728d){var _0xd4a534=_[_0x15e6('0x30')](_[_0x15e6('0x31')](_0x43728d),[_0x15e6('0x1d'),_0x15e6('0x32'),_0x15e6('0x1e'),_0x15e6('0x1f')]);return squel[_0x15e6('0x33')]()[_0x15e6('0x1a')](_0x15e6('0x23'))[_0x15e6('0x2c')](_0xd4a534,squel[_0x15e6('0x22')]()[_0x15e6('0x34')](_0xd4a534)[_0x15e6('0x2d')](_0x2dd103)[_0x15e6('0x11')]('('+_0x40a862[_0x15e6('0xf')](',')+_0x15e6('0x35'),squel[_0x15e6('0x22')]()[_0x15e6('0x34')](_0x40a862)[_0x15e6('0x2d')](_0x15e6('0x23'))[_0x15e6('0x11')](_0x15e6('0x2f'),_0x1a235f)['where'](_0x15e6('0x36')))[_0x15e6('0x11')](_0x15e6('0x37'),squel['select']()['field']('MIN(id)',_0x15e6('0x38'))[_0x15e6('0x2d')](_0x2dd103)[_0x15e6('0x39')](_0x40a862['join'](','))))[_0x15e6('0x2a')]();}function handleStop(){logger[_0x15e6('0x3a')](_0x15e6('0x3b'));stopped=!![];}function handleUncaughtException(_0x4e1e83){logger[_0x15e6('0x3c')](_0x4e1e83[_0x15e6('0x3d')]);process[_0x15e6('0x3e')](0x1);}function handleError(_0x50dcf1,_0x4b777a){stats[_0x15e6('0x3f')][_0x15e6('0x40')]({'name':_0x4b777a[_0x15e6('0x41')],'message':_0x4b777a[_0x15e6('0x3d')],'row':_0x50dcf1});}function handleQuery(_0x4b5354){logger[_0x15e6('0x3a')](_0x4b5354);return db[_0x15e6('0x42')]['query'](_0x4b5354)[_0x15e6('0x43')](function(_0xfd9c26){results['push'](_0xfd9c26);})[_0x15e6('0x44')](function(_0x3dc4ee){logger[_0x15e6('0x3c')](_0x3dc4ee[_0x15e6('0x3d')]);});}function main(_0x4df0a1,_0x522fe3,_0xb4805f,_0xf976ac){logger[_0x15e6('0x3a')]('main',_0x4df0a1,JSON['stringify'](_0x522fe3));process[_0x15e6('0x45')](_0x15e6('0x46'));var _0x12ae6b=_0x522fe3[_0x15e6('0x47')];var _0xf7a6af=_0x522fe3[_0x15e6('0x48')];var _0x2450a8=path[_0x15e6('0xf')](config['root'],_0x15e6('0x49'),_0xf7a6af+_0x15e6('0x4a'));var _0x5a4405=_[_0x15e6('0x31')](_0x12ae6b)['join']();logger['info'](_0x15e6('0x4b'),_0x5a4405);fs[_0x15e6('0x4c')](_0x2450a8,_0x5a4405+'\x0a');Papa['parse'](fs[_0x15e6('0x4d')](_0x4df0a1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x25c9d9,_0x2c9c8d){try{for(var _0x566c79=0x0,_0x150306=[];_0x566c79<_0x25c9d9['data'][_0x15e6('0x4e')];_0x566c79++){stats[_0x15e6('0x4f')]+=0x1;if(_0x25c9d9['errors'][_0x566c79]){handleError(_0x25c9d9[_0x15e6('0x50')][_0x566c79],_0x25c9d9[_0x15e6('0x3f')][_0x566c79]);}else{var _0x4a6529=[];for(var _0x2b2c30 in _0x12ae6b){if(_0x12ae6b['hasOwnProperty'](_0x2b2c30)){if(_0x25c9d9[_0x15e6('0x50')][_0x566c79][_0x12ae6b[_0x2b2c30]]){var _0x1a4061=_['trim'](_0x25c9d9[_0x15e6('0x50')][_0x566c79][_0x12ae6b[_0x2b2c30]][_0x15e6('0x51')](/"/g,'\x27'));switch(_0x2b2c30){case'scheduledat':var _0xd9b1b0=moment(_0x1a4061,_0x15e6('0x52'),!![]);if(_0xd9b1b0[_0x15e6('0x53')]()){_0x150306[_0x15e6('0x40')]('\x22'+_0x1a4061+'\x22');}else{_0x4a6529[_0x15e6('0x40')](_0x15e6('0x54'));}break;case _0x15e6('0x55'):var _0x3526a8=parseInt(_0x1a4061);_0x1a4061=_[_0x15e6('0x56')](_0x3526a8)||_0x3526a8<0x0||_0x3526a8>0x4?_0xf976ac?0x3:0x2:_0x3526a8;_0x150306[_0x15e6('0x40')]('\x22'+_0x1a4061+'\x22');break;case _0x15e6('0x20'):var _0x1aa02e=parseInt(_0x1a4061);if(_['isNumber'](_0x1aa02e)&&_[_0x15e6('0x57')](_0xb4805f,_0x1aa02e)){_0x150306[_0x15e6('0x40')]('\x22'+_0x1aa02e+'\x22');}else{_0x4a6529[_0x15e6('0x40')](_0x15e6('0x58'));}break;case _0x15e6('0x59'):if(isEmail(_0x1a4061)){_0x150306[_0x15e6('0x40')]('\x22'+_0x1a4061+'\x22');}else{_0x4a6529[_0x15e6('0x40')](_0x15e6('0x5a'));}break;case _0x15e6('0x5b'):var _0x46c226=moment(_0x1a4061,_0x15e6('0x5c'),!![]);if(_0x46c226[_0x15e6('0x53')]()){_0x150306[_0x15e6('0x40')]('\x22'+_0x1a4061+'\x22');}else{_0x4a6529[_0x15e6('0x40')](_0x15e6('0x5d'));}break;default:_0x150306[_0x15e6('0x40')]('\x22'+_0x1a4061+'\x22');}}else{switch(_0x2b2c30){case _0x15e6('0x5e'):case'phone':_0x4a6529[_0x15e6('0x40')](_0x2b2c30+_0x15e6('0x5f'));break;default:_0x150306[_0x15e6('0x40')]('\x22\x22');}}}}if(_0x4a6529[_0x15e6('0x4e')]){handleError(_0x25c9d9[_0x15e6('0x50')][_0x566c79],{'code':_0x15e6('0x60'),'message':_0x4a6529[_0x15e6('0xf')]()});}else{fs[_0x15e6('0x61')](_0x2450a8,_0x150306['join']()+'\x0a');}_0x150306=[];}if(!(stats[_0x15e6('0x4f')]%0xc8)){socket[_0x15e6('0x62')](_0x15e6('0x63')+_0xf7a6af,stats);stats[_0x15e6('0x3f')]=[];}}if(stopped){logger['info'](_0x15e6('0x64'));_0x2c9c8d[_0x15e6('0x65')]();}}catch(_0x3d1326){handleError(_0x25c9d9[_0x15e6('0x50')][_0x566c79],{'code':_0x15e6('0x66'),'message':_0x3d1326[_0x15e6('0x3d')]});logger[_0x15e6('0x3c')]('step',_0x3d1326[_0x15e6('0x3d')]);}},'complete':function(){try{var _0x25973a=[];var _0x2e0829=_0x15e6('0x23');if(_0x522fe3['duplicates']&&_0x522fe3[_0x15e6('0x67')][_0x15e6('0x4e')]){_0x2e0829=_0x15e6('0x68')+_0xf7a6af;_0x25973a[_0x15e6('0x40')]('CREATE\x20TABLE\x20'+_0x2e0829+_0x15e6('0x69'));}var _0xe6c7df=util['format']('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',_0x2450a8,_0x2e0829,_0x5a4405,_0x522fe3[_0x15e6('0x1d')],_0x522fe3[_0x15e6('0x32')]||null,NOW,NOW);if(_[_0x15e6('0x6a')](_0x12ae6b[_0x15e6('0x6b')])){_0xe6c7df+=_0x15e6('0x6c');}_0x25973a[_0x15e6('0x40')](_0xe6c7df);if(_0x522fe3[_0x15e6('0x67')]&&_0x522fe3[_0x15e6('0x67')][_0x15e6('0x4e')]){_0x25973a[_0x15e6('0x40')](insertCmContact(_0x522fe3['ListId'],_0x2e0829,_0x522fe3[_0x15e6('0x67')],_0x12ae6b));_0x25973a[_0x15e6('0x40')](_0x15e6('0x6d')+_0x2e0829+';');}_0x25973a[_0x15e6('0x40')](insertCmHopper(_0x522fe3[_0x15e6('0x1d')],_0x15e6('0x6e'),_0x15e6('0x6f'),_0x15e6('0x70'),_0xf976ac));_0x25973a[_0x15e6('0x40')](insertCmHopperBlack(_0x522fe3['ListId'],_0x15e6('0x71'),_0x15e6('0x6f'),_0x15e6('0x70')));_0x25973a[_0x15e6('0x40')](insertCmHopper(_0x522fe3[_0x15e6('0x1d')],'campaigns_has_cm_lists','campaigns',_0x15e6('0x72'),_0xf976ac));_0x25973a[_0x15e6('0x40')](insertCmHopperBlack(_0x522fe3[_0x15e6('0x1d')],'campaigns_has_cm_blacklists',_0x15e6('0x73'),_0x15e6('0x72')));BPromise['each'](_0x25973a,handleQuery)[_0x15e6('0x74')](function(_0x31dce2){stats['finish']=!![];stats[_0x15e6('0x75')]=_0x522fe3[_0x15e6('0x67')]&&_0x522fe3[_0x15e6('0x67')][_0x15e6('0x4e')]?results[0x2][_0x15e6('0x75')]:results[0x0][_0x15e6('0x75')];socket['emit'](_0x15e6('0x63')+_0xf7a6af,stats);fs[_0x15e6('0x76')](_0x4df0a1);fs[_0x15e6('0x76')](_0x2450a8);process[_0x15e6('0x3e')](0x0);})[_0x15e6('0x44')](function(_0x3f6b41){logger[_0x15e6('0x3c')](_0x3f6b41[_0x15e6('0x3d')]);process[_0x15e6('0x3e')](0x1);});}catch(_0x2a4c75){logger['error'](_0x15e6('0x77'),_0x2a4c75[_0x15e6('0x3d')]);process[_0x15e6('0x3e')](0x1);}},'error':function(_0x2e97a1,_0x134e14,_0x3012fb,_0xbc1c31){throw new Error(_0xbc1c31);}});}function validate(){if(process[_0x15e6('0x78')]&&process['argv']['length']<0x4){throw new Error(_0x15e6('0x79'));}var _0x388c86=path[_0x15e6('0xf')](config[_0x15e6('0x7a')],_0x15e6('0x49'),process[_0x15e6('0x78')][0x2]);if(!fs[_0x15e6('0x7b')](_0x388c86)){throw new Error(_0x15e6('0x7c'));}var _0x3adc31={};try{_0x3adc31=JSON[_0x15e6('0x7d')](process[_0x15e6('0x78')][0x3]);if(!_0x3adc31[_0x15e6('0x47')]){throw new Error(_0x15e6('0x7e'));}if(!_0x3adc31['binding']['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x3adc31[_0x15e6('0x47')][_0x15e6('0x5e')]){throw new Error(_0x15e6('0x7f'));}var _0x824f8a=0x0;if(_0x3adc31[_0x15e6('0x47')][_0x15e6('0x20')]){_0x824f8a=0x1;}if(!_0x3adc31['ListId']){throw new Error(_0x15e6('0x80'));}}catch(_0x3e28b0){throw new Error(_0x15e6('0x81'));}var _0x227f89=[];try{_0x227f89=_['map'](JSON[_0x15e6('0x7d')](process['argv'][0x4]),'id');}catch(_0x41b6c7){logger[_0x15e6('0x3a')](_0x15e6('0x82'));}main(_0x388c86,_0x3adc31,_0x227f89,_0x824f8a);}validate();process['on'](_0x15e6('0x83'),handleStop);process['on'](_0x15e6('0x84'),handleUncaughtException);
\ No newline at end of file
index 144941a..482cbd9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4aff=['getDescriptions','toLowerCase','voice','inbound','keyValue','Caller\x20Number','Caller\x20Name','calleridname','destexten','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','Hold\x20Time','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','Date','starttime','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','variable','queue','push','calleridnum','outbound','destcalleridnum'];(function(_0x389c8a,_0x387eef){var _0x26a356=function(_0x56a36d){while(--_0x56a36d){_0x389c8a['push'](_0x389c8a['shift']());}};_0x26a356(++_0x387eef);}(_0x4aff,0x1b9));var _0xf4af=function(_0x2815b3,_0x5e085a){_0x2815b3=_0x2815b3-0x0;var _0x4c6510=_0x4aff[_0x2815b3];return _0x4c6510;};'use strict';exports[_0xf4af('0x0')]=function(_0x13e130,_0x1f7e27){var _0x83bd8e=[{'type':_0xf4af('0x1'),'content':_0xf4af('0x2'),'variableName':null}];switch(_0x13e130['toLowerCase']()){case'voice':switch(_0x1f7e27['toLowerCase']()){case'inbound':_0x83bd8e['push']({'type':_0xf4af('0x3'),'content':'','variableName':_0xf4af('0x4')});_0x83bd8e[_0xf4af('0x5')]({'type':'variable','content':'','variableName':_0xf4af('0x6')});break;case _0xf4af('0x7'):_0x83bd8e['push']({'type':_0xf4af('0x1'),'content':'Outbound\x20Call','variableName':null});_0x83bd8e['push']({'type':_0xf4af('0x3'),'content':'','variableName':_0xf4af('0x8')});break;}}return _0x83bd8e;};exports[_0xf4af('0x9')]=function(_0x43b765,_0x98dcf7){var _0x777032=[];switch(_0x43b765[_0xf4af('0xa')]()){case _0xf4af('0xb'):switch(_0x98dcf7[_0xf4af('0xa')]()){case _0xf4af('0xc'):_0x777032=[{'type':_0xf4af('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0xe'),'keyType':_0xf4af('0x3'),'variableName':_0xf4af('0x6')},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0xf'),'keyType':_0xf4af('0x3'),'variableName':_0xf4af('0x10')},{'type':_0xf4af('0xd'),'content':'','key':'Call\x20To','keyType':_0xf4af('0x3'),'variableName':_0xf4af('0x11')},{'type':'keyValue','content':'','key':_0xf4af('0x12'),'keyType':_0xf4af('0x3'),'variableName':'queue'},{'type':'keyValue','content':'','key':_0xf4af('0x13'),'keyType':_0xf4af('0x3'),'variableName':_0xf4af('0x14')},{'type':_0xf4af('0xd'),'content':'','key':'Date','keyType':_0xf4af('0x3'),'variableName':_0xf4af('0x15')},{'type':_0xf4af('0x1'),'content':_0xf4af('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xf4af('0x17'),'keyType':_0xf4af('0x3'),'variableName':'destcalleridname'},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0x18'),'keyType':_0xf4af('0x3'),'variableName':'destcalleridnum'},{'type':_0xf4af('0x1'),'content':_0xf4af('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xf4af('0xd'),'content':'','key':'Agent\x20Ring','keyType':_0xf4af('0x3'),'variableName':_0xf4af('0x15')},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0x1a'),'keyType':_0xf4af('0x3'),'variableName':_0xf4af('0x1b')},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0x1c'),'keyType':'variable','variableName':'agentcompleteAt'},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0x1d'),'keyType':_0xf4af('0x3'),'variableName':'holdtime'},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0x1e'),'keyType':_0xf4af('0x3'),'variableName':_0xf4af('0x1f')}];break;case _0xf4af('0x7'):_0x777032=[{'type':_0xf4af('0x1'),'content':_0xf4af('0x20'),'variableName':null},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0x21'),'keyType':_0xf4af('0x3'),'keyContent':'','variableName':_0xf4af('0x8')},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0x22'),'keyType':_0xf4af('0x3'),'keyContent':'','variableName':_0xf4af('0x23')},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0x13'),'keyType':_0xf4af('0x3'),'keyContent':'','variableName':_0xf4af('0x14')},{'type':'keyValue','content':'','key':_0xf4af('0x24'),'keyType':_0xf4af('0x3'),'keyContent':'','variableName':_0xf4af('0x25')},{'type':_0xf4af('0x1'),'content':_0xf4af('0x19')},{'type':_0xf4af('0xd'),'content':'','key':'Answer\x20Time','keyType':_0xf4af('0x3'),'keyContent':'','variableName':_0xf4af('0x26')},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0x27'),'keyType':'variable','keyContent':'','variableName':_0xf4af('0x28')},{'type':'keyValue','content':'','key':_0xf4af('0x29'),'keyType':_0xf4af('0x3'),'keyContent':'','variableName':_0xf4af('0x2a')},{'type':_0xf4af('0xd'),'content':'','key':_0xf4af('0x2b'),'keyType':_0xf4af('0x3'),'keyContent':'','variableName':_0xf4af('0x2c')}];break;}}return _0x777032;};
\ No newline at end of file
+var _0xf64f=['string','[xCALLY\x20Ticket]','toLowerCase','voice','push','calleridnum','outbound','Outbound\x20Call','variable','destcalleridnum','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','billableseconds'];(function(_0x935d60,_0xcdbabd){var _0xde2edb=function(_0x2e8a94){while(--_0x2e8a94){_0x935d60['push'](_0x935d60['shift']());}};_0xde2edb(++_0xcdbabd);}(_0xf64f,0x108));var _0xff64=function(_0x137336,_0x3c4298){_0x137336=_0x137336-0x0;var _0x3103f2=_0xf64f[_0x137336];return _0x3103f2;};'use strict';exports['getSubjects']=function(_0x683aa0,_0x2f10f3){var _0x26796d=[{'type':_0xff64('0x0'),'content':_0xff64('0x1'),'variableName':null}];switch(_0x683aa0[_0xff64('0x2')]()){case _0xff64('0x3'):switch(_0x2f10f3[_0xff64('0x2')]()){case'inbound':_0x26796d[_0xff64('0x4')]({'type':'variable','content':'','variableName':'queue'});_0x26796d[_0xff64('0x4')]({'type':'variable','content':'','variableName':_0xff64('0x5')});break;case _0xff64('0x6'):_0x26796d[_0xff64('0x4')]({'type':_0xff64('0x0'),'content':_0xff64('0x7'),'variableName':null});_0x26796d[_0xff64('0x4')]({'type':_0xff64('0x8'),'content':'','variableName':_0xff64('0x9')});break;}}return _0x26796d;};exports['getDescriptions']=function(_0x25e611,_0x1549bf){var _0x427144=[];switch(_0x25e611[_0xff64('0x2')]()){case _0xff64('0x3'):switch(_0x1549bf[_0xff64('0x2')]()){case _0xff64('0xa'):_0x427144=[{'type':_0xff64('0x0'),'content':_0xff64('0xb'),'key':null,'keyType':null,'variableName':null},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0xd'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x5')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0xe'),'keyType':_0xff64('0x8'),'variableName':'calleridname'},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0xf'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x10')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x11'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x12')},{'type':'keyValue','content':'','key':_0xff64('0x13'),'keyType':'variable','variableName':_0xff64('0x14')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x15'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x16')},{'type':_0xff64('0x0'),'content':_0xff64('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x18'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x19')},{'type':_0xff64('0xc'),'content':'','key':'Agent\x20Number','keyType':'variable','variableName':_0xff64('0x9')},{'type':_0xff64('0x0'),'content':_0xff64('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xff64('0xc'),'content':'','key':'Agent\x20Ring','keyType':_0xff64('0x8'),'variableName':_0xff64('0x16')},{'type':'keyValue','content':'','key':_0xff64('0x1b'),'keyType':_0xff64('0x8'),'variableName':_0xff64('0x1c')},{'type':_0xff64('0xc'),'content':'','key':'Agent\x20Complete','keyType':_0xff64('0x8'),'variableName':_0xff64('0x1d')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x1e'),'keyType':'variable','variableName':_0xff64('0x1f')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x20'),'keyType':'variable','variableName':_0xff64('0x21')}];break;case _0xff64('0x6'):_0x427144=[{'type':'string','content':_0xff64('0xb'),'variableName':null},{'type':_0xff64('0xc'),'content':'','key':'Called\x20Number','keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x9')},{'type':'keyValue','content':'','key':_0xff64('0x22'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x23')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x13'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x14')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x15'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x24')},{'type':'string','content':_0xff64('0x1a')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x25'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x26')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x27'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x28')},{'type':_0xff64('0xc'),'content':'','key':_0xff64('0x29'),'keyType':_0xff64('0x8'),'keyContent':'','variableName':_0xff64('0x2a')},{'type':_0xff64('0xc'),'content':'','key':'Billable\x20Time','keyType':'variable','keyContent':'','variableName':_0xff64('0x2b')}];break;}}return _0x427144;};
\ No newline at end of file
index 369ba86..b7aa8cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88bc=['openchannel-interactions','mail-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','then','update','info','catch','error','user','body','omit','html','phone','mobile','../../mysqldb','../../config/logger'];(function(_0x36e941,_0x304f19){var _0x3111a1=function(_0x1467e0){while(--_0x1467e0){_0x36e941['push'](_0x36e941['shift']());}};_0x3111a1(++_0x304f19);}(_0x88bc,0x6a));var _0xc88b=function(_0x1f239e,_0x367b43){_0x1f239e=_0x1f239e-0x0;var _0x826971=_0x88bc[_0x1f239e];return _0x826971;};'use strict';var _=require('lodash');var db=require(_0xc88b('0x0'))['db'];var loggers={'openchannel':require(_0xc88b('0x1'))(_0xc88b('0x2')),'mail':require(_0xc88b('0x1'))(_0xc88b('0x3')),'fax':require(_0xc88b('0x1'))('fax-interactions'),'sms':require(_0xc88b('0x1'))(_0xc88b('0x4')),'chat':require(_0xc88b('0x1'))(_0xc88b('0x5')),'whatsapp':require('../../config/logger')(_0xc88b('0x6'))};function getInteractionId(_0x3c9660,_0x134ff0,_0x5697e7){if(_0x3c9660&&_0x3c9660[_[_0xc88b('0x7')](_0x5697e7)+_0xc88b('0x8')]){return _0x3c9660[_[_0xc88b('0x7')](_0x5697e7)+_0xc88b('0x8')];}else if(_0x3c9660&&_0x3c9660['id']){return _0x3c9660['id'];}else if(_0x134ff0&&_0x134ff0['id']){return _0x134ff0['id'];}else{return'unknown';}}function log(_0x2f61d3,_0x5f5908,_0x4d5685,_0x2caf61,_0x1e5a05,_0x317399){loggers[_0x1e5a05['toLowerCase']()][_0x2f61d3](_0xc88b('0x9'),_0x317399[_0xc88b('0xa')](),_0x5f5908?_0x5f5908['id']:null,_0x5f5908?_0x5f5908[_0xc88b('0xb')]:null,_0x5f5908?_0x5f5908[_0xc88b('0xc')]:null,getInteractionId(_0x4d5685,_0x2caf61,_0x1e5a05),_0x4d5685?JSON[_0xc88b('0xd')](_0x4d5685):_0xc88b('0xe'));}function updateUser(_0x3d7abd,_0x3a6e22,_0x3a4585,_0x1c6ef9,_0x2c025e){db[_['upperFirst'](_0x1c6ef9)+_0xc88b('0xf')]['findOne']({'where':{'id':getInteractionId(_0x3a6e22,_0x3a4585,_0x1c6ef9)}})[_0xc88b('0x10')](function(_0x2116ad){if(_0x2116ad){return _0x2116ad[_0xc88b('0x11')]({'UserId':_0x3d7abd?_0x3d7abd['id']:null});}})['then'](function(_0x8fe93e){if(_0x8fe93e){log(_0xc88b('0x12'),_0x3d7abd,_0x3a6e22,_0x3a4585,_0x1c6ef9,_0x2c025e);}})[_0xc88b('0x13')](function(){log(_0xc88b('0x14'),_0x3d7abd,_0x3a6e22,_0x3a4585,_0x1c6ef9,_0x2c025e);});}exports['tracked']=function(_0x1c536c,_0x29d5a8){return function(_0x44ed49,_0x3cc8ab,_0x405602){var _0x3d751f=_0x44ed49[_0xc88b('0x15')];var _0x31875c={};var _0x23055a=_0x44ed49['query'];if(_0x31875c){_0x31875c=_['clone'](_0x44ed49[_0xc88b('0x16')]);_0x31875c=_[_0xc88b('0x17')](_0x31875c,['body',_0xc88b('0x18'),_0xc88b('0x19'),'fax',_0xc88b('0x1a')]);}updateUser(_0x3d751f,_0x31875c,_0x23055a,_0x1c536c,_0x29d5a8);_0x405602(null);};};
\ No newline at end of file
+var _0x3a78=['clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','Interaction','findOne','then','update','info','error','tracked','user','query'];(function(_0x529586,_0x3f1b1f){var _0x104e16=function(_0x2a9785){while(--_0x2a9785){_0x529586['push'](_0x529586['shift']());}};_0x104e16(++_0x3f1b1f);}(_0x3a78,0xa2));var _0x83a7=function(_0x1ebe90,_0x5d29fc){_0x1ebe90=_0x1ebe90-0x0;var _0x447c82=_0x3a78[_0x1ebe90];return _0x447c82;};'use strict';var _=require(_0x83a7('0x0'));var db=require(_0x83a7('0x1'))['db'];var loggers={'openchannel':require(_0x83a7('0x2'))(_0x83a7('0x3')),'mail':require(_0x83a7('0x2'))(_0x83a7('0x4')),'fax':require(_0x83a7('0x2'))(_0x83a7('0x5')),'sms':require(_0x83a7('0x2'))(_0x83a7('0x6')),'chat':require(_0x83a7('0x2'))(_0x83a7('0x7')),'whatsapp':require(_0x83a7('0x2'))(_0x83a7('0x8'))};function getInteractionId(_0x2edd8a,_0x2385ab,_0x57c99c){if(_0x2edd8a&&_0x2edd8a[_['upperFirst'](_0x57c99c)+'InteractionId']){return _0x2edd8a[_[_0x83a7('0x9')](_0x57c99c)+_0x83a7('0xa')];}else if(_0x2edd8a&&_0x2edd8a['id']){return _0x2edd8a['id'];}else if(_0x2385ab&&_0x2385ab['id']){return _0x2385ab['id'];}else{return'unknown';}}function log(_0x39bd43,_0x8e231d,_0x562f35,_0x556816,_0x58e72c,_0x70ff84){loggers[_0x58e72c[_0x83a7('0xb')]()][_0x39bd43](_0x83a7('0xc'),_0x70ff84[_0x83a7('0xd')](),_0x8e231d?_0x8e231d['id']:null,_0x8e231d?_0x8e231d['name']:null,_0x8e231d?_0x8e231d['role']:null,getInteractionId(_0x562f35,_0x556816,_0x58e72c),_0x562f35?JSON[_0x83a7('0xe')](_0x562f35):'null');}function updateUser(_0x1dfae6,_0x1265fc,_0x2ee28a,_0x3c5b9a,_0x1da661){db[_[_0x83a7('0x9')](_0x3c5b9a)+_0x83a7('0xf')][_0x83a7('0x10')]({'where':{'id':getInteractionId(_0x1265fc,_0x2ee28a,_0x3c5b9a)}})[_0x83a7('0x11')](function(_0x1c5e21){if(_0x1c5e21){return _0x1c5e21[_0x83a7('0x12')]({'UserId':_0x1dfae6?_0x1dfae6['id']:null});}})['then'](function(_0x30cf61){if(_0x30cf61){log(_0x83a7('0x13'),_0x1dfae6,_0x1265fc,_0x2ee28a,_0x3c5b9a,_0x1da661);}})['catch'](function(){log(_0x83a7('0x14'),_0x1dfae6,_0x1265fc,_0x2ee28a,_0x3c5b9a,_0x1da661);});}exports[_0x83a7('0x15')]=function(_0x5969aa,_0x416568){return function(_0x51c736,_0x429aa2,_0x13ca3c){var _0x4967dc=_0x51c736[_0x83a7('0x16')];var _0xd8abfd={};var _0x3de411=_0x51c736[_0x83a7('0x17')];if(_0xd8abfd){_0xd8abfd=_[_0x83a7('0x18')](_0x51c736[_0x83a7('0x19')]);_0xd8abfd=_[_0x83a7('0x1a')](_0xd8abfd,['body',_0x83a7('0x1b'),_0x83a7('0x1c'),_0x83a7('0x1d'),_0x83a7('0x1e')]);}updateUser(_0x4967dc,_0xd8abfd,_0x3de411,_0x5969aa,_0x416568);_0x13ca3c(null);};};
\ No newline at end of file
index 8680503..86ad832 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x037c=['data1','split','aes-256-ctr','format','update','base64','utf8','hasOwnProperty','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','admin','user','isUserLimit','util','../../mysqldb','../../config/environment'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x037c,0x189));var _0xc037=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x037c[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var util=require(_0xc037('0x0'));var compose=require('composable-middleware');var db=require(_0xc037('0x1'))['db'];var config=require(_0xc037('0x2'));function getValueFromLicense(_0xcfe153,_0x3fd1f3){if(_0xcfe153&&_0x3fd1f3){if(_0x3fd1f3[_0xc037('0x3')]&&_0x3fd1f3['license']){var _0x3d8d8f=_0x3fd1f3[_0xc037('0x3')];var _0x2be565=_0x3fd1f3['license'];var _0x3e0cac=_0x3d8d8f['split']('-')[0x4];var _0x1e38e5=_0x3d8d8f[_0xc037('0x4')]('-')[0x0];var _0x8bc86e=crypto['createDecipher'](_0xc037('0x5'),util[_0xc037('0x6')]('%s:%s:%s',_0x3e0cac,_0x3d8d8f,_0x1e38e5));var _0x3254db=_0x8bc86e[_0xc037('0x7')](_0x2be565,_0xc037('0x8'),_0xc037('0x9'));_0x3254db+=_0x8bc86e['final'](_0xc037('0x9'));var _0x4e28ce=JSON['parse'](_0x3254db);return _0x4e28ce[_0xc037('0xa')](_0xcfe153)?_0x4e28ce[_0xcfe153]:null;}}return null;}function isLimit(_0x2dbf45,_0x23cb0c,_0x1a06ba,_0x513ec9){var _0x2dbb4c=_0x23cb0c;return compose()[_0xc037('0xb')](function(_0x217e9,_0x4ff017,_0x4e0c03){return db[_0xc037('0xc')][_0xc037('0xd')]({'where':{'id':0x1},'raw':!![]})[_0xc037('0xe')](function(_0x2c0643){var _0x40737b=getValueFromLicense(_0x2dbf45,_0x2c0643);return _0x40737b?_0x40737b:_0x2dbb4c;})['then'](function(_0x9a223f){_0x2dbb4c=_0x9a223f;return _0x1a06ba['count'](_0x513ec9);})[_0xc037('0xe')](function(_0x3f8114){if(_0x3f8114>=_0x2dbb4c){return _0x4ff017[_0xc037('0xf')](0x193)[_0xc037('0x10')]({'message':util[_0xc037('0x6')](_0xc037('0x11'),_0x2dbf45)});}_0x4e0c03();})[_0xc037('0x12')](function(_0x5aec99){_0x4e0c03(_0x5aec99);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0xc037('0x13')},{'role':_0xc037('0x14')}]}});}exports[_0xc037('0x15')]=isUserLimit;
\ No newline at end of file
+var _0xb955=['users','admin','user','isUserLimit','crypto','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','update','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','catch'];(function(_0x110197,_0x4e546b){var _0x3b8623=function(_0x5de3eb){while(--_0x5de3eb){_0x110197['push'](_0x110197['shift']());}};_0x3b8623(++_0x4e546b);}(_0xb955,0x81));var _0x5b95=function(_0x3b2718,_0x4a2fab){_0x3b2718=_0x3b2718-0x0;var _0x5e58bd=_0xb955[_0x3b2718];return _0x5e58bd;};'use strict';var crypto=require(_0x5b95('0x0'));var util=require('util');var compose=require('composable-middleware');var db=require(_0x5b95('0x1'))['db'];var config=require(_0x5b95('0x2'));function getValueFromLicense(_0x4d01b5,_0x3abb26){if(_0x4d01b5&&_0x3abb26){if(_0x3abb26[_0x5b95('0x3')]&&_0x3abb26[_0x5b95('0x4')]){var _0x5cbbb0=_0x3abb26[_0x5b95('0x3')];var _0x313317=_0x3abb26[_0x5b95('0x4')];var _0xd5f32a=_0x5cbbb0[_0x5b95('0x5')]('-')[0x4];var _0x3b9e98=_0x5cbbb0[_0x5b95('0x5')]('-')[0x0];var _0x197751=crypto[_0x5b95('0x6')]('aes-256-ctr',util[_0x5b95('0x7')]('%s:%s:%s',_0xd5f32a,_0x5cbbb0,_0x3b9e98));var _0x4876e2=_0x197751[_0x5b95('0x8')](_0x313317,_0x5b95('0x9'),_0x5b95('0xa'));_0x4876e2+=_0x197751['final'](_0x5b95('0xa'));var _0xc6c323=JSON[_0x5b95('0xb')](_0x4876e2);return _0xc6c323[_0x5b95('0xc')](_0x4d01b5)?_0xc6c323[_0x4d01b5]:null;}}return null;}function isLimit(_0x246ebd,_0x4e9849,_0x2c92ec,_0xd8bb83){var _0x18bcee=_0x4e9849;return compose()[_0x5b95('0xd')](function(_0x31d262,_0x3fcf5c,_0x79447d){return db[_0x5b95('0xe')][_0x5b95('0xf')]({'where':{'id':0x1},'raw':!![]})[_0x5b95('0x10')](function(_0x2764ae){var _0x225350=getValueFromLicense(_0x246ebd,_0x2764ae);return _0x225350?_0x225350:_0x18bcee;})[_0x5b95('0x10')](function(_0xe7e541){_0x18bcee=_0xe7e541;return _0x2c92ec[_0x5b95('0x11')](_0xd8bb83);})['then'](function(_0x140753){if(_0x140753>=_0x18bcee){return _0x3fcf5c[_0x5b95('0x12')](0x193)[_0x5b95('0x13')]({'message':util[_0x5b95('0x7')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x246ebd)});}_0x79447d();})[_0x5b95('0x14')](function(_0x5e63a4){_0x79447d(_0x5e63a4);});});}function isUserLimit(){return isLimit(_0x5b95('0x15'),0x1,db['User'],{'where':{'$or':[{'role':_0x5b95('0x16')},{'role':_0x5b95('0x17')}]}});}exports[_0x5b95('0x18')]=isUserLimit;
\ No newline at end of file
index 6e16751..8320da4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c09=['conditions','DATE','operator','$eq','$between','value','includes','$gt','$lte','days','castTo','CAST(','text','$ne','$notIn','\x20OR\x20','field','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','>\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','utcOffset','format','add','hours','minutes','seconds','lodash','parseSearch','sqlOperator','[$or]','and','[$and]','replace','split','length','slice','forEach','shift','filter','indexOf','map'];(function(_0x5c01a1,_0x1bddaf){var _0x56abb4=function(_0x1531b8){while(--_0x1531b8){_0x5c01a1['push'](_0x5c01a1['shift']());}};_0x56abb4(++_0x1bddaf);}(_0x0c09,0x16b));var _0x90c0=function(_0x43126b,_0x4c9b09){_0x43126b=_0x43126b-0x0;var _0x392346=_0x0c09[_0x43126b];return _0x392346;};'use strict';var _=require(_0x90c0('0x0'));var moment=require('moment');exports[_0x90c0('0x1')]=function(_0x1caacb){var _0x540936={'conditions':[]};_0x540936[_0x90c0('0x2')]=_['startsWith'](_0x1caacb,_0x90c0('0x3'))?'or':_0x90c0('0x4');var _0x5637db=_0x1caacb['replace'](_0x90c0('0x5'),'')[_0x90c0('0x6')](_0x90c0('0x3'),'')[_0x90c0('0x7')]('||');for(var _0x49628c=0x0;_0x49628c<_0x5637db[_0x90c0('0x8')];_0x49628c++){var _0x4a2d12=_0x5637db[_0x49628c][_0x90c0('0x7')](':=');var _0x5a7805=_0x4a2d12[0x0];var _0x41d802=_0x4a2d12[_0x90c0('0x9')](0x1);_0x41d802[_0x90c0('0xa')](function(_0x489ec2){var _0x162145=_0x489ec2[_0x90c0('0x7')]('[')[_0x90c0('0xb')]();var _0x18623d=_0x489ec2['match'](/\[(.*?)\]/g);_0x18623d[_0x90c0('0xa')](function(_0x33a9da){var _0x483c6f=_0x33a9da['split']('[')[_0x90c0('0xc')](function(_0x15a828){return _0x15a828[_0x90c0('0xd')](']')>-0x1;})[_0x90c0('0xe')](function(_0x185512){return _0x185512[_0x90c0('0x7')](']')[0x0];})[0x0];_0x540936[_0x90c0('0xf')]['push']({'field':_0x5a7805,'operator':_0x162145,'value':_0x483c6f});});});}return _0x540936;};exports['buildExpression']=function(_0x453868,_0x4a48db,_0x1d7ec1){var _0xa4def1={};if(_0x4a48db===_0x90c0('0x10')){if(_0x1d7ec1[_0x90c0('0x11')]===_0x90c0('0x12')){_0x1d7ec1[_0x90c0('0x11')]=_0x90c0('0x13');_0x1d7ec1[_0x90c0('0x14')]+=','+_0x1d7ec1[_0x90c0('0x14')];}else if(_[_0x90c0('0x15')]([_0x90c0('0x16'),_0x90c0('0x17')],_0x1d7ec1[_0x90c0('0x11')])){_0x1d7ec1[_0x90c0('0x14')]=moment(_0x1d7ec1[_0x90c0('0x14')])['add'](0x1,_0x90c0('0x18'))['format']('YYYY-MM-DD');}}if(_0x1d7ec1['castTo']){_0x4a48db=_0x1d7ec1[_0x90c0('0x19')];_0xa4def1['text']=_0x90c0('0x1a')+_0x453868+'.'+_0x1d7ec1['field']+'\x20AS\x20'+_0x1d7ec1[_0x90c0('0x19')]+')\x20'+parseOperator(_0x1d7ec1[_0x90c0('0x11')]);}else{_0xa4def1[_0x90c0('0x1b')]=_0x453868+'.'+_0x1d7ec1['field']+'\x20'+parseOperator(_0x1d7ec1[_0x90c0('0x11')]);}if(_['includes']([_0x90c0('0x1c'),_0x90c0('0x1d')],_0x1d7ec1[_0x90c0('0x11')]))_0xa4def1['text']='('+_0xa4def1['text']+_0x90c0('0x1e')+_0x453868+'.'+_0x1d7ec1[_0x90c0('0x1f')]+_0x90c0('0x20');_0xa4def1['value']=parseValue(_0x4a48db,_0x1d7ec1[_0x90c0('0x11')],_0x1d7ec1['value']);return _0xa4def1;};function parseOperator(_0x47d95d){var _0xe8329a;switch(_0x47d95d){case _0x90c0('0x21'):_0xe8329a=_0x90c0('0x22');break;case _0x90c0('0x1d'):_0xe8329a=_0x90c0('0x23');break;case _0x90c0('0x12'):_0xe8329a=_0x90c0('0x24');break;case _0x90c0('0x1c'):_0xe8329a='<>\x20?';break;case _0x90c0('0x25'):case _0x90c0('0x26'):case _0x90c0('0x27'):_0xe8329a=_0x90c0('0x28');break;case _0x90c0('0x29'):_0xe8329a=_0x90c0('0x2a');break;case _0x90c0('0x16'):_0xe8329a=_0x90c0('0x2b');break;case _0x90c0('0x17'):_0xe8329a='<=\x20?';break;case _0x90c0('0x2c'):_0xe8329a=_0x90c0('0x2d');break;case _0x90c0('0x13'):_0xe8329a=_0x90c0('0x2e');break;}return _0xe8329a;}function parseValue(_0x2ae97d,_0x535d86,_0x6701cd){var _0x1eec37={'start':undefined,'end':undefined};switch(_0x535d86){case _0x90c0('0x21'):case _0x90c0('0x1d'):_0x1eec37['start']=_0x6701cd['split'](',');break;case _0x90c0('0x25'):_0x1eec37[_0x90c0('0x2f')]='%'+_0x6701cd+'%';break;case _0x90c0('0x26'):_0x1eec37['start']=_0x6701cd+'%';break;case _0x90c0('0x27'):_0x1eec37[_0x90c0('0x2f')]='%'+_0x6701cd;break;case _0x90c0('0x13'):var _0x59735b=_0x6701cd[_0x90c0('0x7')](',');var _0x6701cd=_0x59735b[_0x90c0('0xb')]();var _0x9d5bbf=_0x59735b['pop']();if(_0x2ae97d==='DATE'){_0x6701cd=moment(_0x6701cd)[_0x90c0('0x30')](0x0,!![])[_0x90c0('0x31')]();_0x9d5bbf=moment(_0x9d5bbf)[_0x90c0('0x30')](0x0,!![])[_0x90c0('0x32')](0x17,_0x90c0('0x33'))['add'](0x3b,_0x90c0('0x34'))[_0x90c0('0x32')](0x3b,_0x90c0('0x35'))[_0x90c0('0x31')]();}_0x1eec37={'start':_0x6701cd,'end':_0x9d5bbf};break;default:_0x1eec37[_0x90c0('0x2f')]=_0x6701cd;break;}return _0x1eec37;}
\ No newline at end of file
+var _0xc061=['$notIn','\x20IS\x20NULL)','$in','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','start','$startsWith','pop','DATE','utcOffset','hours','add','minutes','seconds','moment','sqlOperator','startsWith','and','[$and]','replace','length','split','slice','forEach','shift','filter','indexOf','map','push','buildExpression','$eq','operator','$between','value','days','format','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','includes','$ne'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0xc061,0x1b6));var _0x1c06=function(_0x2a8a41,_0x5bca91){_0x2a8a41=_0x2a8a41-0x0;var _0x1139ae=_0xc061[_0x2a8a41];return _0x1139ae;};'use strict';var _=require('lodash');var moment=require(_0x1c06('0x0'));exports['parseSearch']=function(_0x2ac90d){var _0x5a3943={'conditions':[]};_0x5a3943[_0x1c06('0x1')]=_[_0x1c06('0x2')](_0x2ac90d,'[$or]')?'or':_0x1c06('0x3');var _0x209b70=_0x2ac90d['replace'](_0x1c06('0x4'),'')[_0x1c06('0x5')]('[$or]','')['split']('||');for(var _0x4b4b89=0x0;_0x4b4b89<_0x209b70[_0x1c06('0x6')];_0x4b4b89++){var _0x1a49e6=_0x209b70[_0x4b4b89][_0x1c06('0x7')](':=');var _0x2b5201=_0x1a49e6[0x0];var _0x10efbe=_0x1a49e6[_0x1c06('0x8')](0x1);_0x10efbe[_0x1c06('0x9')](function(_0x2df451){var _0x53e281=_0x2df451[_0x1c06('0x7')]('[')[_0x1c06('0xa')]();var _0x4e7df7=_0x2df451['match'](/\[(.*?)\]/g);_0x4e7df7[_0x1c06('0x9')](function(_0x4dc6db){var _0x3df572=_0x4dc6db[_0x1c06('0x7')]('[')[_0x1c06('0xb')](function(_0x24346c){return _0x24346c[_0x1c06('0xc')](']')>-0x1;})[_0x1c06('0xd')](function(_0x1f4f34){return _0x1f4f34['split'](']')[0x0];})[0x0];_0x5a3943['conditions'][_0x1c06('0xe')]({'field':_0x2b5201,'operator':_0x53e281,'value':_0x3df572});});});}return _0x5a3943;};exports[_0x1c06('0xf')]=function(_0xa50f53,_0x3fdf42,_0x56271f){var _0x2306bd={};if(_0x3fdf42==='DATE'){if(_0x56271f['operator']===_0x1c06('0x10')){_0x56271f[_0x1c06('0x11')]=_0x1c06('0x12');_0x56271f[_0x1c06('0x13')]+=','+_0x56271f[_0x1c06('0x13')];}else if(_['includes'](['$gt','$lte'],_0x56271f[_0x1c06('0x11')])){_0x56271f[_0x1c06('0x13')]=moment(_0x56271f[_0x1c06('0x13')])['add'](0x1,_0x1c06('0x14'))[_0x1c06('0x15')](_0x1c06('0x16'));}}if(_0x56271f[_0x1c06('0x17')]){_0x3fdf42=_0x56271f['castTo'];_0x2306bd[_0x1c06('0x18')]=_0x1c06('0x19')+_0xa50f53+'.'+_0x56271f['field']+_0x1c06('0x1a')+_0x56271f['castTo']+')\x20'+parseOperator(_0x56271f['operator']);}else{_0x2306bd[_0x1c06('0x18')]=_0xa50f53+'.'+_0x56271f[_0x1c06('0x1b')]+'\x20'+parseOperator(_0x56271f['operator']);}if(_[_0x1c06('0x1c')]([_0x1c06('0x1d'),_0x1c06('0x1e')],_0x56271f[_0x1c06('0x11')]))_0x2306bd[_0x1c06('0x18')]='('+_0x2306bd['text']+'\x20OR\x20'+_0xa50f53+'.'+_0x56271f[_0x1c06('0x1b')]+_0x1c06('0x1f');_0x2306bd[_0x1c06('0x13')]=parseValue(_0x3fdf42,_0x56271f[_0x1c06('0x11')],_0x56271f[_0x1c06('0x13')]);return _0x2306bd;};function parseOperator(_0x15e538){var _0x40876d;switch(_0x15e538){case _0x1c06('0x20'):_0x40876d='IN\x20?';break;case'$notIn':_0x40876d='NOT\x20IN\x20?';break;case'$eq':_0x40876d='=\x20?';break;case _0x1c06('0x1d'):_0x40876d=_0x1c06('0x21');break;case _0x1c06('0x22'):case'$startsWith':case _0x1c06('0x23'):_0x40876d=_0x1c06('0x24');break;case'$lt':_0x40876d=_0x1c06('0x25');break;case'$gt':_0x40876d=_0x1c06('0x26');break;case _0x1c06('0x27'):_0x40876d=_0x1c06('0x28');break;case _0x1c06('0x29'):_0x40876d=_0x1c06('0x2a');break;case'$between':_0x40876d='BETWEEN\x20?\x20AND\x20?';break;}return _0x40876d;}function parseValue(_0x52ce6a,_0x2d8648,_0x2868f4){var _0xf06549={'start':undefined,'end':undefined};switch(_0x2d8648){case _0x1c06('0x20'):case _0x1c06('0x1e'):_0xf06549[_0x1c06('0x2b')]=_0x2868f4[_0x1c06('0x7')](',');break;case _0x1c06('0x22'):_0xf06549[_0x1c06('0x2b')]='%'+_0x2868f4+'%';break;case _0x1c06('0x2c'):_0xf06549['start']=_0x2868f4+'%';break;case _0x1c06('0x23'):_0xf06549['start']='%'+_0x2868f4;break;case _0x1c06('0x12'):var _0x49b4ed=_0x2868f4['split'](',');var _0x2868f4=_0x49b4ed[_0x1c06('0xa')]();var _0x112b71=_0x49b4ed[_0x1c06('0x2d')]();if(_0x52ce6a===_0x1c06('0x2e')){_0x2868f4=moment(_0x2868f4)[_0x1c06('0x2f')](0x0,!![])[_0x1c06('0x15')]();_0x112b71=moment(_0x112b71)[_0x1c06('0x2f')](0x0,!![])['add'](0x17,_0x1c06('0x30'))[_0x1c06('0x31')](0x3b,_0x1c06('0x32'))[_0x1c06('0x31')](0x3b,_0x1c06('0x33'))[_0x1c06('0x15')]();}_0xf06549={'start':_0x2868f4,'end':_0x112b71};break;default:_0xf06549[_0x1c06('0x2b')]=_0x2868f4;break;}return _0xf06549;}
\ No newline at end of file
index 1fe653e..d624314 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6857=['attributes','fields','nolimit','order','where','pick','filter','merge','type','VIRTUAL','lower','options','sequelize','moment','parse','keys','includes','split','filters','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','subtract','name','uniqueid','isArray','limit','offset','sort','priority','cast','col','unsigned','DESC','ASC','omit','isEmpty','length','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','forEach','push','join','getOptions','$id','query','model','map','intersection'];(function(_0x4824c1,_0x2657fa){var _0x7cd05a=function(_0x6c3aa9){while(--_0x6c3aa9){_0x4824c1['push'](_0x4824c1['shift']());}};_0x7cd05a(++_0x2657fa);}(_0x6857,0x12e));var _0x7685=function(_0x15c6bb,_0x50a271){_0x15c6bb=_0x15c6bb-0x0;var _0x306310=_0x6857[_0x15c6bb];return _0x306310;};'use strict';var _=require('lodash');var sequelize=require(_0x7685('0x0'));var moment=require(_0x7685('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3f4b51){var _0x2b3003=['ne'];try{var _0x40c771=JSON[_0x7685('0x2')](_0x3f4b51);var _0xdc9193=Object[_0x7685('0x3')](_0x40c771)[0x0];return _0x2b3003[_0x7685('0x4')](_0xdc9193);}catch(_0x591692){return![];}}function getOperatorValue(_0x369de2){var _0x3a0af3=JSON[_0x7685('0x2')](_0x369de2);var _0x4a311c=Object[_0x7685('0x3')](_0x3a0af3)[0x0];var _0x23deb4=_0x3a0af3[_0x4a311c];return{['$'+_0x4a311c]:_0x23deb4};}exports['fields']=function(_0x4d1894){var _0x49f0c0=null;if(_0x4d1894){_0x49f0c0=_0x4d1894[_0x7685('0x5')](',');}return _0x49f0c0;};exports[_0x7685('0x6')]=function(_0x166e2b,_0x53935c){var _0x15732c={};if(!_['isEmpty'](_0x166e2b)){_['forOwn'](_0x166e2b,function(_0x4015ae,_0x442522){try{if(_0x53935c){var _0x19d0d7=_[_0x7685('0x7')](_0x53935c,{'name':_0x442522})||{};if(hasSequelizeOperator(_0x4015ae)){_0x15732c[_0x442522]=getOperatorValue(_0x4015ae);}else if(_0x19d0d7['type']===_0x7685('0x8')&&_[_0x7685('0x9')](_0x4015ae)){var _0x521afe=JSON['parse'](_0x4015ae);var _0x12762f={'$gte':moment(moment(_0x521afe[_0x7685('0xa')])[_0x7685('0xb')](_0x7685('0xc')))[_0x7685('0xd')]()[_0x7685('0xb')](),'$lte':moment(moment(_0x521afe['$lte'])[_0x7685('0xb')](_0x7685('0xc')))[_0x7685('0xd')]()[_0x7685('0xe')](0x1,'s')[_0x7685('0xb')]()};_0x15732c[_0x442522]=_0x12762f;}else if(_0x19d0d7[_0x7685('0xf')]===_0x7685('0x10')){_0x15732c[_0x442522]=_0x4015ae;}else{_0x15732c[_0x442522]=_[_0x7685('0x11')](_0x4015ae)?_0x4015ae:JSON[_0x7685('0x2')](_0x4015ae);}}else{_0x15732c[_0x442522]=_[_0x7685('0x11')](_0x4015ae)?_0x4015ae:JSON[_0x7685('0x2')](_0x4015ae);}}catch(_0xe3b8c7){_0x15732c[_0x442522]=_0x4015ae[_0x7685('0x5')](',');}});}return _0x15732c;};exports[_0x7685('0x12')]=function(_0x2ceffb){_0x2ceffb=parseInt(_0x2ceffb,0xa);if(!_0x2ceffb||_0x2ceffb<0x0){_0x2ceffb=LIMIT_VALUE;}return _0x2ceffb;};exports[_0x7685('0x13')]=function(_0x55377c){_0x55377c=parseInt(_0x55377c,0xa);if(!_0x55377c||_0x55377c<0x0){_0x55377c=0x0;}return _0x55377c;};exports[_0x7685('0x14')]=function(_0x335f8f){var _0x5810c7,_0xb88b8e=null;if(_0x335f8f){_0x5810c7=_0x335f8f[_0x7685('0x5')](',');_0xb88b8e=_['map'](_0x5810c7,function(_0x54ceb6){if(_0x54ceb6['indexOf']('-')===0x0){return[_0x54ceb6===_0x7685('0x15')?sequelize[_0x7685('0x16')](sequelize[_0x7685('0x17')](_0x7685('0x15')),_0x7685('0x18')):_0x54ceb6['substr'](0x1),_0x7685('0x19')];}else{return[_0x54ceb6===_0x7685('0x15')?sequelize[_0x7685('0x16')](sequelize[_0x7685('0x17')]('priority'),_0x7685('0x18')):_0x54ceb6,_0x7685('0x1a')];}});}return _0xb88b8e;};exports[_0x7685('0x1b')]=function(_0x5bb71d,_0x456f29){if(_[_0x7685('0x1c')](_0x5bb71d)){return _0x5bb71d;}if(_[_0x7685('0x11')](_0x5bb71d)){for(var _0x3286ac=0x0;_0x3286ac<_0x5bb71d[_0x7685('0x1d')];_0x3286ac+=0x1){_0x5bb71d[_0x3286ac]=this[_0x7685('0x1b')](_0x5bb71d[_0x3286ac],_0x456f29);}return _0x5bb71d;}if(!_['isObject'](_0x5bb71d)){return _0x5bb71d;}if(_[_0x7685('0x1e')](_0x456f29)){_0x456f29=[_0x456f29];}if(!_[_0x7685('0x11')](_0x456f29)){return _0x5bb71d;}for(var _0x305930=0x0;_0x305930<_0x456f29['length'];_0x305930+=0x1){_[_0x7685('0x1f')](_0x5bb71d,_0x456f29[_0x305930]);}for(var _0xc7313d in _0x5bb71d){if(_0x5bb71d[_0x7685('0x20')](_0xc7313d)){_0x5bb71d[_0xc7313d]=this[_0x7685('0x1b')](_0x5bb71d[_0xc7313d],_0x456f29);}}return _0x5bb71d;};exports[_0x7685('0x21')]=function(_0x1bdac0){return _0x1bdac0[_0x7685('0x22')](RegExp(_0x7685('0x23')))?!![]:![];};exports['isEmail']=function(_0x1c05da){return _0x1c05da['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x7685('0x24')]=function(_0x20a349){var _0x16b636=[];_0x20a349['split'](/[ ,]+/)[_0x7685('0x25')](function(_0x29c704){_0x29c704=_0x29c704['replace'](/([^:]")"+/g,'$1');_0x29c704='+'+_0x29c704+'*';if(_0x29c704[_0x7685('0x4')]('@'))_0x29c704='\x22'+_0x29c704+'\x22';_0x16b636[_0x7685('0x26')](_0x29c704);});return _0x16b636[_0x7685('0x27')]('\x20');};exports[_0x7685('0x28')]=function(_0x1092e4,_0x412f59,_0x536e88){var _0x52b119={},_0x566038={};if(_0x412f59['query'][_0x7685('0x29')]){_0x412f59['query']['id']=_0x412f59[_0x7685('0x2a')][_0x7685('0x29')];delete _0x412f59[_0x7685('0x2a')][_0x7685('0x29')];}_0x52b119[_0x7685('0x2b')]=_[_0x7685('0x2c')](_0x1092e4,_0x7685('0xf'));_0x52b119['query']=_['keys'](_0x412f59[_0x7685('0x2a')]);_0x52b119['filters']=_[_0x7685('0x2d')](_0x52b119['model'],_0x52b119[_0x7685('0x2a')]);_0x566038[_0x7685('0x2e')]=_[_0x7685('0x2d')](_0x52b119[_0x7685('0x2b')],this[_0x7685('0x2f')](_0x412f59[_0x7685('0x2a')][_0x7685('0x2f')]));_0x566038[_0x7685('0x2e')]=_0x566038[_0x7685('0x2e')][_0x7685('0x1d')]?_0x566038[_0x7685('0x2e')]:_0x52b119[_0x7685('0x2b')];if(!_0x412f59[_0x7685('0x2a')][_0x7685('0x20')](_0x7685('0x30'))){_0x566038[_0x7685('0x12')]=this[_0x7685('0x12')](_0x412f59[_0x7685('0x2a')][_0x7685('0x12')]);_0x566038[_0x7685('0x13')]=this[_0x7685('0x13')](_0x412f59[_0x7685('0x2a')]['offset']);}_0x566038[_0x7685('0x31')]=this['sort'](_0x412f59[_0x7685('0x2a')][_0x7685('0x14')]);_0x566038[_0x7685('0x32')]=this[_0x7685('0x6')](_[_0x7685('0x33')](_0x412f59['query'],_0x52b119['filters']),_0x1092e4);if(_0x412f59[_0x7685('0x2a')][_0x7685('0x34')]){_0x566038[_0x7685('0x32')]=_[_0x7685('0x35')](_0x566038['where'],{'$or':_[_0x7685('0x2c')](_0x1092e4,function(_0x3056fc){if(_0x3056fc[_0x7685('0x36')]!==_0x7685('0x37')){if(_0x536e88){return sequelize[_0x7685('0x32')](sequelize['fn'](_0x7685('0x38'),sequelize[_0x7685('0x17')](_0x3056fc[_0x7685('0xf')])),{'$like':sequelize['fn'](_0x7685('0x38'),'%'+_0x412f59[_0x7685('0x2a')][_0x7685('0x34')]+'%')});}else{var _0x99f196={};_0x99f196[_0x3056fc['name']]={'$like':'%'+_0x412f59['query'][_0x7685('0x34')]+'%'};return _0x99f196;}}})});}_0x566038=_['merge']({},_0x566038,_0x412f59[_0x7685('0x39')]);return _0x566038;};
\ No newline at end of file
+var _0x8727=['omit','isArray','length','isObject','isString','isNumeric','match','^[+]?[0-9]*$','forEach','replace','join','getOptions','query','$id','model','intersection','attributes','hasOwnProperty','nolimit','order','where','filter','type','VIRTUAL','lower','merge','options','lodash','sequelize','moment','parse','keys','fields','split','filters','isEmpty','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','$lte','subtract','name','uniqueid','limit','offset','sort','map','indexOf','cast','col','priority','unsigned','DESC','ASC'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x8727,0x1aa));var _0x7872=function(_0x506f64,_0x395f5a){_0x506f64=_0x506f64-0x0;var _0x389fdb=_0x8727[_0x506f64];return _0x389fdb;};'use strict';var _=require(_0x7872('0x0'));var sequelize=require(_0x7872('0x1'));var moment=require(_0x7872('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x16e094){var _0x35e604=['ne'];try{var _0x4c3818=JSON[_0x7872('0x3')](_0x16e094);var _0x4a04e6=Object['keys'](_0x4c3818)[0x0];return _0x35e604['includes'](_0x4a04e6);}catch(_0x2de8d9){return![];}}function getOperatorValue(_0x4aaf1c){var _0x5b7ae9=JSON[_0x7872('0x3')](_0x4aaf1c);var _0x4c2d3b=Object[_0x7872('0x4')](_0x5b7ae9)[0x0];var _0x4d487c=_0x5b7ae9[_0x4c2d3b];return{['$'+_0x4c2d3b]:_0x4d487c};}exports[_0x7872('0x5')]=function(_0x4a8470){var _0x183802=null;if(_0x4a8470){_0x183802=_0x4a8470[_0x7872('0x6')](',');}return _0x183802;};exports[_0x7872('0x7')]=function(_0x3b06d5,_0x5da66d){var _0x5ee7ac={};if(!_[_0x7872('0x8')](_0x3b06d5)){_['forOwn'](_0x3b06d5,function(_0x1b988c,_0x4235a5){try{if(_0x5da66d){var _0xf13bd3=_[_0x7872('0x9')](_0x5da66d,{'name':_0x4235a5})||{};if(hasSequelizeOperator(_0x1b988c)){_0x5ee7ac[_0x4235a5]=getOperatorValue(_0x1b988c);}else if(_0xf13bd3['type']===_0x7872('0xa')&&_[_0x7872('0xb')](_0x1b988c)){var _0x4ff602=JSON[_0x7872('0x3')](_0x1b988c);var _0x3ec23b={'$gte':moment(moment(_0x4ff602[_0x7872('0xc')])[_0x7872('0xd')](_0x7872('0xe')))['utc']()[_0x7872('0xd')](),'$lte':moment(moment(_0x4ff602[_0x7872('0xf')])[_0x7872('0xd')](_0x7872('0xe')))['utc']()[_0x7872('0x10')](0x1,'s')[_0x7872('0xd')]()};_0x5ee7ac[_0x4235a5]=_0x3ec23b;}else if(_0xf13bd3[_0x7872('0x11')]===_0x7872('0x12')){_0x5ee7ac[_0x4235a5]=_0x1b988c;}else{_0x5ee7ac[_0x4235a5]=_['isArray'](_0x1b988c)?_0x1b988c:JSON[_0x7872('0x3')](_0x1b988c);}}else{_0x5ee7ac[_0x4235a5]=_['isArray'](_0x1b988c)?_0x1b988c:JSON[_0x7872('0x3')](_0x1b988c);}}catch(_0x347c70){_0x5ee7ac[_0x4235a5]=_0x1b988c['split'](',');}});}return _0x5ee7ac;};exports[_0x7872('0x13')]=function(_0x40e806){_0x40e806=parseInt(_0x40e806,0xa);if(!_0x40e806||_0x40e806<0x0){_0x40e806=LIMIT_VALUE;}return _0x40e806;};exports[_0x7872('0x14')]=function(_0x2ede58){_0x2ede58=parseInt(_0x2ede58,0xa);if(!_0x2ede58||_0x2ede58<0x0){_0x2ede58=0x0;}return _0x2ede58;};exports[_0x7872('0x15')]=function(_0x304293){var _0x2ddae1,_0x235f31=null;if(_0x304293){_0x2ddae1=_0x304293[_0x7872('0x6')](',');_0x235f31=_[_0x7872('0x16')](_0x2ddae1,function(_0x3d0004){if(_0x3d0004[_0x7872('0x17')]('-')===0x0){return[_0x3d0004==='priority'?sequelize[_0x7872('0x18')](sequelize[_0x7872('0x19')](_0x7872('0x1a')),_0x7872('0x1b')):_0x3d0004['substr'](0x1),_0x7872('0x1c')];}else{return[_0x3d0004===_0x7872('0x1a')?sequelize[_0x7872('0x18')](sequelize['col'](_0x7872('0x1a')),_0x7872('0x1b')):_0x3d0004,_0x7872('0x1d')];}});}return _0x235f31;};exports[_0x7872('0x1e')]=function(_0x356541,_0x66b74a){if(_[_0x7872('0x8')](_0x356541)){return _0x356541;}if(_[_0x7872('0x1f')](_0x356541)){for(var _0x1bcd8e=0x0;_0x1bcd8e<_0x356541[_0x7872('0x20')];_0x1bcd8e+=0x1){_0x356541[_0x1bcd8e]=this[_0x7872('0x1e')](_0x356541[_0x1bcd8e],_0x66b74a);}return _0x356541;}if(!_[_0x7872('0x21')](_0x356541)){return _0x356541;}if(_[_0x7872('0x22')](_0x66b74a)){_0x66b74a=[_0x66b74a];}if(!_[_0x7872('0x1f')](_0x66b74a)){return _0x356541;}for(var _0x44ee25=0x0;_0x44ee25<_0x66b74a['length'];_0x44ee25+=0x1){_['unset'](_0x356541,_0x66b74a[_0x44ee25]);}for(var _0x3f2480 in _0x356541){if(_0x356541['hasOwnProperty'](_0x3f2480)){_0x356541[_0x3f2480]=this[_0x7872('0x1e')](_0x356541[_0x3f2480],_0x66b74a);}}return _0x356541;};exports[_0x7872('0x23')]=function(_0x51441f){return _0x51441f[_0x7872('0x24')](RegExp(_0x7872('0x25')))?!![]:![];};exports['isEmail']=function(_0x5e0f60){return _0x5e0f60[_0x7872('0x24')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x4d966b){var _0x5aacb4=[];_0x4d966b[_0x7872('0x6')](/[ ,]+/)[_0x7872('0x26')](function(_0x2643fb){_0x2643fb=_0x2643fb[_0x7872('0x27')](/([^:]")"+/g,'$1');_0x2643fb='+'+_0x2643fb+'*';if(_0x2643fb['includes']('@'))_0x2643fb='\x22'+_0x2643fb+'\x22';_0x5aacb4['push'](_0x2643fb);});return _0x5aacb4[_0x7872('0x28')]('\x20');};exports[_0x7872('0x29')]=function(_0x142e2f,_0x17c691,_0x66a814){var _0xd3c7c={},_0x1ff60b={};if(_0x17c691[_0x7872('0x2a')][_0x7872('0x2b')]){_0x17c691[_0x7872('0x2a')]['id']=_0x17c691[_0x7872('0x2a')][_0x7872('0x2b')];delete _0x17c691['query'][_0x7872('0x2b')];}_0xd3c7c[_0x7872('0x2c')]=_['map'](_0x142e2f,'name');_0xd3c7c[_0x7872('0x2a')]=_[_0x7872('0x4')](_0x17c691[_0x7872('0x2a')]);_0xd3c7c[_0x7872('0x7')]=_[_0x7872('0x2d')](_0xd3c7c[_0x7872('0x2c')],_0xd3c7c[_0x7872('0x2a')]);_0x1ff60b[_0x7872('0x2e')]=_[_0x7872('0x2d')](_0xd3c7c[_0x7872('0x2c')],this[_0x7872('0x5')](_0x17c691[_0x7872('0x2a')][_0x7872('0x5')]));_0x1ff60b['attributes']=_0x1ff60b[_0x7872('0x2e')][_0x7872('0x20')]?_0x1ff60b[_0x7872('0x2e')]:_0xd3c7c[_0x7872('0x2c')];if(!_0x17c691[_0x7872('0x2a')][_0x7872('0x2f')](_0x7872('0x30'))){_0x1ff60b['limit']=this['limit'](_0x17c691[_0x7872('0x2a')][_0x7872('0x13')]);_0x1ff60b[_0x7872('0x14')]=this['offset'](_0x17c691[_0x7872('0x2a')][_0x7872('0x14')]);}_0x1ff60b[_0x7872('0x31')]=this[_0x7872('0x15')](_0x17c691[_0x7872('0x2a')]['sort']);_0x1ff60b[_0x7872('0x32')]=this['filters'](_['pick'](_0x17c691[_0x7872('0x2a')],_0xd3c7c['filters']),_0x142e2f);if(_0x17c691[_0x7872('0x2a')][_0x7872('0x33')]){_0x1ff60b[_0x7872('0x32')]=_['merge'](_0x1ff60b[_0x7872('0x32')],{'$or':_[_0x7872('0x16')](_0x142e2f,function(_0x2329f5){if(_0x2329f5[_0x7872('0x34')]!==_0x7872('0x35')){if(_0x66a814){return sequelize[_0x7872('0x32')](sequelize['fn'](_0x7872('0x36'),sequelize[_0x7872('0x19')](_0x2329f5['name'])),{'$like':sequelize['fn']('lower','%'+_0x17c691[_0x7872('0x2a')][_0x7872('0x33')]+'%')});}else{var _0x149762={};_0x149762[_0x2329f5[_0x7872('0x11')]]={'$like':'%'+_0x17c691['query'][_0x7872('0x33')]+'%'};return _0x149762;}}})});}_0x1ff60b=_[_0x7872('0x37')]({},_0x1ff60b,_0x17c691[_0x7872('0x38')]);return _0x1ff60b;};
\ No newline at end of file
index 656536e..6741894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66cc=['/server/views','html','ejs','renderFile','view\x20engine','50mb','json','initialize','express','serve-favicon','body-parser','method-override','errorhandler','cors','moment','./environment','default','get','production','set','join','root','development','test','client','use','toISOString','split','static','appPath'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0x66cc,0x1ca));var _0xc66c=function(_0x219096,_0xdce7a2){_0x219096=_0x219096-0x0;var _0x3a1b15=_0x66cc[_0x219096];return _0x3a1b15;};'use strict';var express=require(_0xc66c('0x0'));var favicon=require(_0xc66c('0x1'));var bodyParser=require(_0xc66c('0x2'));var methodOverride=require(_0xc66c('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xc66c('0x4'));var path=require('path');var passport=require('passport');var cors=require(_0xc66c('0x5'));var moment=require(_0xc66c('0x6'));var config=require(_0xc66c('0x7'));var db=require('../mysqldb')['db'];exports[_0xc66c('0x8')]=function(_0x523e3a){var _0x50640c=_0x523e3a[_0xc66c('0x9')]('env');if(_0x50640c===_0xc66c('0xa')){_0x523e3a[_0xc66c('0xb')]('appPath',path[_0xc66c('0xc')](config[_0xc66c('0xd')],'public'));}if(_0x50640c===_0xc66c('0xe')||_0x50640c===_0xc66c('0xf')){_0x523e3a[_0xc66c('0xb')]('appPath',path[_0xc66c('0xc')](config['root'],_0xc66c('0x10')));_0x523e3a[_0xc66c('0x11')](errorHandler());}_0x523e3a[_0xc66c('0xb')]('json\x20replacer',function(_0x1125c0,_0x526dd8){if(this[_0x1125c0]instanceof Date){_0x526dd8=this[_0x1125c0][_0xc66c('0x12')]()[_0xc66c('0x13')]('.')[0x0]+'Z';}return _0x526dd8;});_0x523e3a['use'](express[_0xc66c('0x14')](_0x523e3a[_0xc66c('0x9')](_0xc66c('0x15'))));_0x523e3a[_0xc66c('0xb')]('views',config['root']+_0xc66c('0x16'));_0x523e3a['engine'](_0xc66c('0x17'),require(_0xc66c('0x18'))[_0xc66c('0x19')]);_0x523e3a[_0xc66c('0xb')](_0xc66c('0x1a'),'html');_0x523e3a[_0xc66c('0x11')](bodyParser['urlencoded']({'limit':_0xc66c('0x1b'),'extended':!![]}));_0x523e3a[_0xc66c('0x11')](bodyParser[_0xc66c('0x1c')]({'limit':_0xc66c('0x1b')}));_0x523e3a[_0xc66c('0x11')](cors());_0x523e3a[_0xc66c('0x11')](methodOverride());_0x523e3a['use'](cookieParser());_0x523e3a[_0xc66c('0x11')](passport[_0xc66c('0x1d')]());};
\ No newline at end of file
+var _0x2fc7=['/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','./environment','get','production','set','appPath','join','root','public','development','test','client','toISOString','split','use','views'];(function(_0xbeaae9,_0x17b5a6){var _0x21e17d=function(_0x2770bb){while(--_0x2770bb){_0xbeaae9['push'](_0xbeaae9['shift']());}};_0x21e17d(++_0x17b5a6);}(_0x2fc7,0xe9));var _0x72fc=function(_0x2483c1,_0x3f3293){_0x2483c1=_0x2483c1-0x0;var _0x3fdce4=_0x2fc7[_0x2483c1];return _0x3fdce4;};'use strict';var express=require(_0x72fc('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x72fc('0x1'));var methodOverride=require(_0x72fc('0x2'));var cookieParser=require(_0x72fc('0x3'));var errorHandler=require(_0x72fc('0x4'));var path=require(_0x72fc('0x5'));var passport=require(_0x72fc('0x6'));var cors=require(_0x72fc('0x7'));var moment=require('moment');var config=require(_0x72fc('0x8'));var db=require('../mysqldb')['db'];exports['default']=function(_0x25ed28){var _0x1c47d3=_0x25ed28[_0x72fc('0x9')]('env');if(_0x1c47d3===_0x72fc('0xa')){_0x25ed28[_0x72fc('0xb')](_0x72fc('0xc'),path[_0x72fc('0xd')](config[_0x72fc('0xe')],_0x72fc('0xf')));}if(_0x1c47d3===_0x72fc('0x10')||_0x1c47d3===_0x72fc('0x11')){_0x25ed28[_0x72fc('0xb')]('appPath',path['join'](config['root'],_0x72fc('0x12')));_0x25ed28['use'](errorHandler());}_0x25ed28['set']('json\x20replacer',function(_0x4de8dd,_0x3913a6){if(this[_0x4de8dd]instanceof Date){_0x3913a6=this[_0x4de8dd][_0x72fc('0x13')]()[_0x72fc('0x14')]('.')[0x0]+'Z';}return _0x3913a6;});_0x25ed28[_0x72fc('0x15')](express['static'](_0x25ed28[_0x72fc('0x9')](_0x72fc('0xc'))));_0x25ed28[_0x72fc('0xb')](_0x72fc('0x16'),config[_0x72fc('0xe')]+_0x72fc('0x17'));_0x25ed28[_0x72fc('0x18')](_0x72fc('0x19'),require(_0x72fc('0x1a'))[_0x72fc('0x1b')]);_0x25ed28[_0x72fc('0xb')](_0x72fc('0x1c'),_0x72fc('0x19'));_0x25ed28['use'](bodyParser[_0x72fc('0x1d')]({'limit':'50mb','extended':!![]}));_0x25ed28[_0x72fc('0x15')](bodyParser[_0x72fc('0x1e')]({'limit':_0x72fc('0x1f')}));_0x25ed28[_0x72fc('0x15')](cors());_0x25ed28['use'](methodOverride());_0x25ed28[_0x72fc('0x15')](cookieParser());_0x25ed28['use'](passport['initialize']());};
\ No newline at end of file
index 8a4ecb0..be5ade9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99b7=['hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','createHash','update','substring','lodash','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','family','IPv4','head','mac','address','map','model','md5','digest'];(function(_0x359e94,_0x45e35b){var _0x103832=function(_0x3fc4a6){while(--_0x3fc4a6){_0x359e94['push'](_0x359e94['shift']());}};_0x103832(++_0x45e35b);}(_0x99b7,0x9c));var _0x799b=function(_0x40b3f2,_0x2c4f5f){_0x40b3f2=_0x40b3f2-0x0;var _0x4ce90c=_0x99b7[_0x40b3f2];return _0x4ce90c;};'use strict';var _=require(_0x799b('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x799b('0x1'));var exec=require(_0x799b('0x2'))[_0x799b('0x3')];var config=require('../environment');function getInterfaces(){var _0x2f1769=[];var _0x17e240=os[_0x799b('0x4')]();var _0x432822=_[_0x799b('0x5')](_[_0x799b('0x6')](_0x17e240));for(var _0x569190=0x0;_0x569190<_0x432822[_0x799b('0x7')];_0x569190++){var _0x5a8ecc=_0x17e240[_0x432822[_0x569190]][_0x799b('0x8')](function(_0x2479c6){return _0x2479c6[_0x799b('0x9')]===_0x799b('0xa')&&_0x2479c6['internal']===![];});_0x2f1769=_0x2f1769['concat'](_0x5a8ecc);}return _0x2f1769;}function getFirstInterface(){var _0x1d8954=_[_0x799b('0xb')](getInterfaces());return{'macAddress':_0x1d8954&&_0x1d8954['mac']?_0x1d8954[_0x799b('0xc')]:'00:00:00:00:00:00','ipAddress':_0x1d8954&&_0x1d8954[_0x799b('0xd')]?_0x1d8954['address']:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x52c18d=_[_0x799b('0x5')](os['cpus']()[_0x799b('0xe')](function(_0x525c72){return _0x525c72[_0x799b('0xf')];}))['join'](':');return crypto['createHash'](_0x799b('0x10'))['update'](_0x52c18d)[_0x799b('0x11')](_0x799b('0x12'));}exports[_0x799b('0x13')]=function(){var _0x3827b5=os[_0x799b('0x14')]();var _0x14f921=/[0-9a-f-]{36}/;if(config[_0x799b('0x15')]&&_0x14f921[_0x799b('0x16')](config[_0x799b('0x15')])){return config['licenseToken'];}else if(_0x3827b5===_0x799b('0x17')){return exec(_0x799b('0x18'),{'encoding':_0x799b('0x19')})['replace']('\x0d\x0a','');}else{var _0x1bb068=getFirstInterface();var _0x200540=getCPUhash();var _0x1cb12d=_0x200540+'|'+os['hostname']()+'|'+_0x1bb068['macAddress']+'|'+_0x1bb068['ipAddress'];var _0x216eae=crypto[_0x799b('0x1a')](_0x799b('0x10'))[_0x799b('0x1b')](_0x1cb12d)[_0x799b('0x11')](_0x799b('0x12'));return _0x216eae[_0x799b('0x1c')](0x0,0x8)+'-'+_0x216eae[_0x799b('0x1c')](0x8,0xc)+'-'+_0x216eae['substring'](0xc,0x10)+'-'+_0x216eae[_0x799b('0x1c')](0x10,0x14)+'-'+_0x216eae[_0x799b('0x1c')](0x14);}};
\ No newline at end of file
+var _0x6682=['digest','getUuid','licenseToken','dmidecode\x20--string\x20system-uuid','replace','macAddress','ipAddress','createHash','substring','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','keys','filter','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','md5','update'];(function(_0x32e8c9,_0x247f25){var _0x4e1148=function(_0x23de4d){while(--_0x23de4d){_0x32e8c9['push'](_0x32e8c9['shift']());}};_0x4e1148(++_0x247f25);}(_0x6682,0x85));var _0x2668=function(_0x1411d8,_0x5d8a99){_0x1411d8=_0x1411d8-0x0;var _0x2572c7=_0x6682[_0x1411d8];return _0x2572c7;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x2668('0x0'));var machine=require(_0x2668('0x1'));var exec=require(_0x2668('0x2'))['execSync'];var config=require(_0x2668('0x3'));function getInterfaces(){var _0x5647d6=[];var _0x474b69=os[_0x2668('0x4')]();var _0x71613e=_[_0x2668('0x5')](_[_0x2668('0x6')](_0x474b69));for(var _0x3bbb22=0x0;_0x3bbb22<_0x71613e['length'];_0x3bbb22++){var _0x5a6365=_0x474b69[_0x71613e[_0x3bbb22]][_0x2668('0x7')](function(_0x905701){return _0x905701['family']===_0x2668('0x8')&&_0x905701[_0x2668('0x9')]===![];});_0x5647d6=_0x5647d6[_0x2668('0xa')](_0x5a6365);}return _0x5647d6;}function getFirstInterface(){var _0x30109f=_[_0x2668('0xb')](getInterfaces());return{'macAddress':_0x30109f&&_0x30109f['mac']?_0x30109f[_0x2668('0xc')]:_0x2668('0xd'),'ipAddress':_0x30109f&&_0x30109f[_0x2668('0xe')]?_0x30109f['address']:_0x2668('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x8cfddf=_[_0x2668('0x5')](os[_0x2668('0x10')]()[_0x2668('0x11')](function(_0x5d1b92){return _0x5d1b92[_0x2668('0x12')];}))[_0x2668('0x13')](':');return crypto['createHash'](_0x2668('0x14'))[_0x2668('0x15')](_0x8cfddf)[_0x2668('0x16')]('hex');}exports[_0x2668('0x17')]=function(){var _0x2e6e5b=os['platform']();var _0x1b4091=/[0-9a-f-]{36}/;if(config[_0x2668('0x18')]&&_0x1b4091['test'](config[_0x2668('0x18')])){return config['licenseToken'];}else if(_0x2e6e5b==='win32'){return exec(_0x2668('0x19'),{'encoding':'utf8'})[_0x2668('0x1a')]('\x0d\x0a','');}else{var _0x2cd300=getFirstInterface();var _0x3f1dfc=getCPUhash();var _0x378ce1=_0x3f1dfc+'|'+os['hostname']()+'|'+_0x2cd300[_0x2668('0x1b')]+'|'+_0x2cd300[_0x2668('0x1c')];var _0xca9cd7=crypto[_0x2668('0x1d')](_0x2668('0x14'))['update'](_0x378ce1)['digest']('hex');return _0xca9cd7[_0x2668('0x1e')](0x0,0x8)+'-'+_0xca9cd7[_0x2668('0x1e')](0x8,0xc)+'-'+_0xca9cd7[_0x2668('0x1e')](0xc,0x10)+'-'+_0xca9cd7[_0x2668('0x1e')](0x10,0x14)+'-'+_0xca9cd7[_0x2668('0x1e')](0x14);}};
\ No newline at end of file
index 40b160e..6b4d00c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8436=['util','request-promise','bluebird','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','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','encryptString','diff','days','error','finally','getUuid','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s'];(function(_0x493b63,_0x2b2929){var _0x293e51=function(_0x587e17){while(--_0x587e17){_0x493b63['push'](_0x493b63['shift']());}};_0x293e51(++_0x2b2929);}(_0x8436,0x156));var _0x6843=function(_0x463f9e,_0x16ad88){_0x463f9e=_0x463f9e-0x0;var _0x3493fc=_0x8436[_0x463f9e];return _0x3493fc;};'use strict';var util=require(_0x6843('0x0'));var moment=require('moment');var rp=require(_0x6843('0x1'));var BPromise=require(_0x6843('0x2'));var pkginfo=require('pkginfo')(module,'version');var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x6843('0x3'));var logger=require(_0x6843('0x4'))(_0x6843('0x5'));var HOST=_0x6843('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3edb12){return new BPromise(function(_0x443332,_0x5b0181){var _0x2e8f76=util[_0x6843('0x7')](_0x6843('0x8'),HOST,_0x3edb12,module[_0x6843('0x9')][_0x6843('0xa')]);if(oldToken){_0x2e8f76=util[_0x6843('0x7')](_0x6843('0xb'),HOST,_0x3edb12,module[_0x6843('0x9')]['version'],oldToken);}var _0x57a404={'uri':_0x2e8f76,'method':_0x6843('0xc'),'timeout':0xea60,'json':!![]};return rp(_0x57a404)[_0x6843('0xd')](function(_0x4d60f0){_0x443332(_0x4d60f0);})[_0x6843('0xe')](function(_0x5c7cd0){_0x5b0181(_0x5c7cd0);});});}function manageLicense(_0x756f51,_0x5b06be){var _0x32c83c=_0x5b06be[_0x6843('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x32c83c[_0x6843('0x10')]!==_0x756f51&&!_0x32c83c['data2']){oldToken=_0x32c83c[_0x6843('0x10')];}httpRequest(_0x756f51)[_0x6843('0xd')](function(_0x42a712){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x42a712[_0x6843('0x11')]){isOldTokenSent=![];if(!_0x32c83c[_0x6843('0x5')]&&_0x32c83c[_0x6843('0x5')]!=_0x42a712['license']||_0x32c83c['license']&&_0x32c83c[_0x6843('0x12')]){logger[_0x6843('0x13')](_0x6843('0x14'));}if(_0x32c83c[_0x6843('0x5')]&&!_0x32c83c[_0x6843('0x12')]&&_0x32c83c['license']!=_0x42a712[_0x6843('0x5')]){logger[_0x6843('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x32c83c[_0x6843('0x5')]&&!_0x32c83c['data2']&&_0x32c83c['license']==_0x42a712[_0x6843('0x5')]){return _0x5b06be;}return _0x5b06be[_0x6843('0x15')]({'data1':_0x756f51,'data2':null,'license':_0x42a712[_0x6843('0x5')]});}else{if(_0x42a712[_0x6843('0x5')]||_0x32c83c['license']){if(!_0x32c83c[_0x6843('0x12')]){if(_0x32c83c['data1']==_0x756f51){GRAY_PERIOD_REASON=_0x6843('0x16');logger[_0x6843('0x13')](_0x6843('0x17'));}else{GRAY_PERIOD_REASON=_0x6843('0x18');logger[_0x6843('0x13')](_0x6843('0x19'),_0x32c83c[_0x6843('0x10')],_0x756f51);}logger[_0x6843('0x13')](_0x6843('0x1a'),GRAY_PERIOD_REASON[_0x6843('0x1b')](),moment()[_0x6843('0x7')](_0x6843('0x1c')));return _0x5b06be[_0x6843('0x15')]({'data2':encryptor[_0x6843('0x1d')](moment()['format'](_0x6843('0x1c')))});}else{if(moment()[_0x6843('0x1e')](encryptor['decryptString'](_0x32c83c[_0x6843('0x12')]),_0x6843('0x1f'))>DAYS){logger[_0x6843('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0x6843('0x7')](_0x6843('0x1c')));isOldTokenSent=![];return _0x5b06be['update']({'data1':_0x756f51,'data2':null,'license':null});}}}else{if(_0x32c83c[_0x6843('0x10')]!=_0x756f51){logger[_0x6843('0x13')](_0x6843('0x19'),_0x32c83c[_0x6843('0x10')],_0x756f51);return _0x5b06be[_0x6843('0x15')]({'data1':_0x756f51,'data2':null,'license':null});}}}return _0x5b06be;})['then'](function(_0x54dd2b){_0x5b06be=_0x54dd2b;})['catch'](function(_0x13fc94){logger[_0x6843('0x20')](_0x13fc94['message']);})[_0x6843('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x6843('0x22')](),_0x5b06be);},TIME);});}function defaultLicense(){var _0x8b3afe=hardware[_0x6843('0x22')]();if(_0x8b3afe){return db['License'][_0x6843('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x8b3afe}})[_0x6843('0x24')](function(_0x3e0a76,_0x574aea){logger[_0x6843('0x13')](_0x6843('0x25'),_0x8b3afe);manageLicense(_0x8b3afe,_0x3e0a76);})[_0x6843('0xe')](function(_0x2d5091){logger[_0x6843('0x20')](_0x2d5091['message']);});}}exports['default']=defaultLicense;
\ No newline at end of file
+var _0x2b1c=['../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','get','data2','data1','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','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','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','update','catch','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo'];(function(_0x1198ad,_0x38262b){var _0x564aff=function(_0x188898){while(--_0x188898){_0x1198ad['push'](_0x1198ad['shift']());}};_0x564aff(++_0x38262b);}(_0x2b1c,0x122));var _0xc2b1=function(_0x4bbf39,_0xf6c81d){_0x4bbf39=_0x4bbf39-0x0;var _0xa36b8=_0x2b1c[_0x4bbf39];return _0xa36b8;};'use strict';var util=require(_0xc2b1('0x0'));var moment=require('moment');var rp=require(_0xc2b1('0x1'));var BPromise=require(_0xc2b1('0x2'));var pkginfo=require(_0xc2b1('0x3'))(module,'version');var db=require(_0xc2b1('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xc2b1('0x5'));var logger=require(_0xc2b1('0x6'))(_0xc2b1('0x7'));var HOST=_0xc2b1('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2f6803){return new BPromise(function(_0x1cc072,_0x470550){var _0x6ae294=util[_0xc2b1('0x9')](_0xc2b1('0xa'),HOST,_0x2f6803,module[_0xc2b1('0xb')]['version']);if(oldToken){_0x6ae294=util[_0xc2b1('0x9')](_0xc2b1('0xc'),HOST,_0x2f6803,module['exports']['version'],oldToken);}var _0x22cd6d={'uri':_0x6ae294,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x22cd6d)[_0xc2b1('0xd')](function(_0x18e0b1){_0x1cc072(_0x18e0b1);})['catch'](function(_0x4a2f90){_0x470550(_0x4a2f90);});});}function manageLicense(_0x3ecf68,_0x4b8e63){var _0x2cea51=_0x4b8e63[_0xc2b1('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x2cea51['data1']!==_0x3ecf68&&!_0x2cea51[_0xc2b1('0xf')]){oldToken=_0x2cea51[_0xc2b1('0x10')];}httpRequest(_0x3ecf68)[_0xc2b1('0xd')](function(_0x25f495){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x25f495[_0xc2b1('0x11')]){isOldTokenSent=![];if(!_0x2cea51[_0xc2b1('0x7')]&&_0x2cea51[_0xc2b1('0x7')]!=_0x25f495[_0xc2b1('0x7')]||_0x2cea51[_0xc2b1('0x7')]&&_0x2cea51['data2']){logger['info'](_0xc2b1('0x12'));}if(_0x2cea51[_0xc2b1('0x7')]&&!_0x2cea51['data2']&&_0x2cea51['license']!=_0x25f495[_0xc2b1('0x7')]){logger[_0xc2b1('0x13')](_0xc2b1('0x14'));}if(_0x2cea51[_0xc2b1('0x7')]&&!_0x2cea51[_0xc2b1('0xf')]&&_0x2cea51[_0xc2b1('0x7')]==_0x25f495['license']){return _0x4b8e63;}return _0x4b8e63['update']({'data1':_0x3ecf68,'data2':null,'license':_0x25f495[_0xc2b1('0x7')]});}else{if(_0x25f495[_0xc2b1('0x7')]||_0x2cea51[_0xc2b1('0x7')]){if(!_0x2cea51[_0xc2b1('0xf')]){if(_0x2cea51[_0xc2b1('0x10')]==_0x3ecf68){GRAY_PERIOD_REASON=_0xc2b1('0x15');logger[_0xc2b1('0x13')](_0xc2b1('0x16'));}else{GRAY_PERIOD_REASON='Changed';logger[_0xc2b1('0x13')](_0xc2b1('0x17'),_0x2cea51[_0xc2b1('0x10')],_0x3ecf68);}logger[_0xc2b1('0x13')](_0xc2b1('0x18'),GRAY_PERIOD_REASON[_0xc2b1('0x19')](),moment()['format'](_0xc2b1('0x1a')));return _0x4b8e63['update']({'data2':encryptor[_0xc2b1('0x1b')](moment()[_0xc2b1('0x9')](_0xc2b1('0x1a')))});}else{if(moment()['diff'](encryptor[_0xc2b1('0x1c')](_0x2cea51['data2']),_0xc2b1('0x1d'))>DAYS){logger[_0xc2b1('0x13')](_0xc2b1('0x1e'),moment()[_0xc2b1('0x9')](_0xc2b1('0x1a')));isOldTokenSent=![];return _0x4b8e63['update']({'data1':_0x3ecf68,'data2':null,'license':null});}}}else{if(_0x2cea51[_0xc2b1('0x10')]!=_0x3ecf68){logger[_0xc2b1('0x13')](_0xc2b1('0x17'),_0x2cea51[_0xc2b1('0x10')],_0x3ecf68);return _0x4b8e63[_0xc2b1('0x1f')]({'data1':_0x3ecf68,'data2':null,'license':null});}}}return _0x4b8e63;})[_0xc2b1('0xd')](function(_0x5e95e1){_0x4b8e63=_0x5e95e1;})[_0xc2b1('0x20')](function(_0x14d4a8){logger[_0xc2b1('0x21')](_0x14d4a8[_0xc2b1('0x22')]);})[_0xc2b1('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0xc2b1('0x24')](),_0x4b8e63);},TIME);});}function defaultLicense(){var _0xe612cb=hardware[_0xc2b1('0x24')]();if(_0xe612cb){return db[_0xc2b1('0x25')][_0xc2b1('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0xe612cb}})[_0xc2b1('0x27')](function(_0x3961cf,_0x85fdc4){logger[_0xc2b1('0x13')](_0xc2b1('0x28'),_0xe612cb);manageLicense(_0xe612cb,_0x3961cf);})['catch'](function(_0x22d530){logger[_0xc2b1('0x21')](_0x22d530[_0xc2b1('0x22')]);});}}exports[_0xc2b1('0x29')]=defaultLicense;
\ No newline at end of file
index ec2b2cb..3a0f8cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb04f=['grayReason','changed','message','User','role','sequelize','COUNT','col','count','admin','user','users','forEach','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','Demo\x20license','Breaking\x20license','getUuid','License','find','defaults','then','catch','data1','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','%s:%s:%s','demo','uuid','machineUuid','gray','deadline','add','days'];(function(_0x51b59f,_0x1ce8b1){var _0x422940=function(_0x123b7f){while(--_0x123b7f){_0x51b59f['push'](_0x51b59f['shift']());}};_0x422940(++_0x1ce8b1);}(_0xb04f,0x9f));var _0xfb04=function(_0x2a1f04,_0x5dae41){_0x2a1f04=_0x2a1f04-0x0;var _0x55dd6c=_0xb04f[_0x2a1f04];return _0x55dd6c;};'use strict';var util=require(_0xfb04('0x0'));var _=require(_0xfb04('0x1'));var moment=require(_0xfb04('0x2'));var BPromise=require(_0xfb04('0x3'));var hardware=require(_0xfb04('0x4'));var encryptor=require(_0xfb04('0x5'));var db=require(_0xfb04('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xfb04('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xfb04('0x8'),'machineUuid':hardware[_0xfb04('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x1ee84d){return new BPromise(function(_0x2e16e5,_0x262054){return db[_0xfb04('0xa')][_0xfb04('0xb')](_[_0xfb04('0xc')](_0x1ee84d,{'raw':!![],'where':{'id':0x1}}))[_0xfb04('0xd')](function(_0x24b145){return checkLicense(_0x24b145,null);})['then'](function(_0x11b0fc){_0x2e16e5(_0x11b0fc);return;})[_0xfb04('0xe')](function(_0x13f71f){_0x262054(_0x13f71f);});});}function checkLicense(_0x46befe,_0xdebde8){if(!_0x46befe){demoLicense['uuid']=_0x46befe[_0xfb04('0xf')];return demoLicense;}try{var _0x5940f7=_0xdebde8||_0x46befe['license'];if(_[_0xfb04('0x10')](_0x5940f7)){throw new Error(_0xfb04('0x11'));}var _0x2e482d=_0x46befe[_0xfb04('0xf')];var _0x34fe1d=_0x46befe[_0xfb04('0x12')];var _0xef8d8f=_0x2e482d[_0xfb04('0x13')]('-')[0x4];var _0x4c273d=_0x2e482d[_0xfb04('0x13')]('-')[0x0];var _0x28ffe1=encryptor[_0xfb04('0x14')](_0x5940f7,util['format'](_0xfb04('0x15'),_0xef8d8f,_0x2e482d,_0x4c273d));var _0x46e47e=JSON['parse'](_0x28ffe1);_0x46e47e[_0xfb04('0x16')]=![];_0x46e47e[_0xfb04('0x17')]=_0x2e482d;_0x46e47e[_0xfb04('0x18')]=hardware[_0xfb04('0x9')]();if(_0x34fe1d){var _0x1d0318=encryptor['decryptString'](_0x34fe1d);_0x46e47e[_0xfb04('0x19')]=_0x1d0318;_0x46e47e[_0xfb04('0x1a')]=moment(_0x1d0318)[_0xfb04('0x1b')](0x7,_0xfb04('0x1c'))['format']();_0x46e47e[_0xfb04('0x1d')]=_0x46e47e[_0xfb04('0x17')]!=_0x46e47e[_0xfb04('0x18')]?_0xfb04('0x1e'):'disabled';}return _0x46e47e;}catch(_0x59233d){breakingLicense['uuid']=_0x46befe[_0xfb04('0xf')];breakingLicense[_0xfb04('0x1f')]=_0x59233d[_0xfb04('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x732eed,_0x385155){getLicense()['then'](function(_0x478f11){return db[_0xfb04('0x20')]['findAll']({'attributes':[_0xfb04('0x21'),[db[_0xfb04('0x22')]['fn'](_0xfb04('0x23'),db[_0xfb04('0x22')][_0xfb04('0x24')](_0xfb04('0x21'))),_0xfb04('0x25')]],'group':_0xfb04('0x21'),'where':{'role':{'$or':[_0xfb04('0x26'),_0xfb04('0x27'),'telephone']}},'raw':!![]})['then'](function(_0x95b436){var _0x536a46={'user':_0x478f11[_0xfb04('0x28')]||0x0,'telephone':_0x478f11['telephones']||0x0};_0x95b436[_0xfb04('0x29')](function(_0x17da6c){var _0x2e0944=_0x17da6c['role']===_0xfb04('0x26')?_0xfb04('0x27'):_0x17da6c[_0xfb04('0x21')];_0x536a46[_0x2e0944]-=_0x17da6c[_0xfb04('0x25')];if(_0x536a46[_0x2e0944]<0x0)_0x536a46[_0x2e0944]=0x0;});_0x732eed(_0x536a46);return;});})[_0xfb04('0xe')](function(_0x5e7f47){_0x385155(_0x5e7f47);});});}function checkUserLimits(_0x192a65){return new BPromise(function(_0x434844,_0x483165){getLimits()[_0xfb04('0xd')](function(_0x16f984){var _0x54dc91=_['pick'](_[_0xfb04('0x2a')](_0x192a65,'role'),[_0xfb04('0x26'),_0xfb04('0x27'),_0xfb04('0x2b')]);var _0x128462=(_0x54dc91['admin']||0x0)+(_0x54dc91['user']||0x0);var _0x5d86c3=_0x54dc91['telephone']||0x0;if(_0x128462>_0x16f984[_0xfb04('0x27')])return _0x483165(_0xfb04('0x2c'));if(_0x5d86c3>_0x16f984['telephone'])return _0x483165(_0xfb04('0x2d'));return _0x434844();})[_0xfb04('0xe')](function(_0x2977e8){_0x483165(_0x2977e8);});});}module[_0xfb04('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0x7ca7=['License\x20limit\x20reached\x20for\x20telephones','util','lodash','bluebird','./hardware','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','gray','deadline','add','days','grayReason','machineUuid','changed','disabled','message','User','findAll','role','COUNT','col','count','admin','user','telephone','telephones','forEach','pick','countBy','License\x20limit\x20reached\x20for\x20users'];(function(_0x592ecf,_0xaafad){var _0x4404ac=function(_0x3d34b4){while(--_0x3d34b4){_0x592ecf['push'](_0x592ecf['shift']());}};_0x4404ac(++_0xaafad);}(_0x7ca7,0x8e));var _0x77ca=function(_0x11ca63,_0xea9f9c){_0x11ca63=_0x11ca63-0x0;var _0x41f1f6=_0x7ca7[_0x11ca63];return _0x41f1f6;};'use strict';var util=require(_0x77ca('0x0'));var _=require(_0x77ca('0x1'));var moment=require('moment');var BPromise=require(_0x77ca('0x2'));var hardware=require(_0x77ca('0x3'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x77ca('0x4')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x77ca('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x77ca('0x6'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xdc1ecb){return new BPromise(function(_0x6674e3,_0x461901){return db[_0x77ca('0x7')][_0x77ca('0x8')](_[_0x77ca('0x9')](_0xdc1ecb,{'raw':!![],'where':{'id':0x1}}))[_0x77ca('0xa')](function(_0x4874f0){return checkLicense(_0x4874f0,null);})[_0x77ca('0xa')](function(_0xcf4eda){_0x6674e3(_0xcf4eda);return;})[_0x77ca('0xb')](function(_0x3d39c7){_0x461901(_0x3d39c7);});});}function checkLicense(_0x3c8e92,_0x1625d9){if(!_0x3c8e92){demoLicense[_0x77ca('0xc')]=_0x3c8e92[_0x77ca('0xd')];return demoLicense;}try{var _0x5a0940=_0x1625d9||_0x3c8e92[_0x77ca('0xe')];if(_['isEmpty'](_0x5a0940)){throw new Error(_0x77ca('0xf'));}var _0x4dcfd6=_0x3c8e92[_0x77ca('0xd')];var _0xcd56b7=_0x3c8e92[_0x77ca('0x10')];var _0x5b770e=_0x4dcfd6['split']('-')[0x4];var _0x43e9e0=_0x4dcfd6[_0x77ca('0x11')]('-')[0x0];var _0x3af16e=encryptor[_0x77ca('0x12')](_0x5a0940,util[_0x77ca('0x13')](_0x77ca('0x14'),_0x5b770e,_0x4dcfd6,_0x43e9e0));var _0x5316f3=JSON[_0x77ca('0x15')](_0x3af16e);_0x5316f3[_0x77ca('0x16')]=![];_0x5316f3[_0x77ca('0xc')]=_0x4dcfd6;_0x5316f3['machineUuid']=hardware[_0x77ca('0x4')]();if(_0xcd56b7){var _0x4be4a2=encryptor[_0x77ca('0x12')](_0xcd56b7);_0x5316f3[_0x77ca('0x17')]=_0x4be4a2;_0x5316f3[_0x77ca('0x18')]=moment(_0x4be4a2)[_0x77ca('0x19')](0x7,_0x77ca('0x1a'))[_0x77ca('0x13')]();_0x5316f3[_0x77ca('0x1b')]=_0x5316f3['uuid']!=_0x5316f3[_0x77ca('0x1c')]?_0x77ca('0x1d'):_0x77ca('0x1e');}return _0x5316f3;}catch(_0x20f3cc){breakingLicense[_0x77ca('0xc')]=_0x3c8e92['data1'];breakingLicense[_0x77ca('0x1f')]=_0x20f3cc[_0x77ca('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x27bc33,_0x5acdcd){getLicense()[_0x77ca('0xa')](function(_0x78d428){return db[_0x77ca('0x20')][_0x77ca('0x21')]({'attributes':[_0x77ca('0x22'),[db['sequelize']['fn'](_0x77ca('0x23'),db['sequelize'][_0x77ca('0x24')](_0x77ca('0x22'))),_0x77ca('0x25')]],'group':_0x77ca('0x22'),'where':{'role':{'$or':[_0x77ca('0x26'),_0x77ca('0x27'),_0x77ca('0x28')]}},'raw':!![]})['then'](function(_0x2d4a01){var _0x141428={'user':_0x78d428['users']||0x0,'telephone':_0x78d428[_0x77ca('0x29')]||0x0};_0x2d4a01[_0x77ca('0x2a')](function(_0x2401bf){var _0x4e909b=_0x2401bf[_0x77ca('0x22')]==='admin'?_0x77ca('0x27'):_0x2401bf[_0x77ca('0x22')];_0x141428[_0x4e909b]-=_0x2401bf['count'];if(_0x141428[_0x4e909b]<0x0)_0x141428[_0x4e909b]=0x0;});_0x27bc33(_0x141428);return;});})[_0x77ca('0xb')](function(_0x11b9d6){_0x5acdcd(_0x11b9d6);});});}function checkUserLimits(_0x23ecdd){return new BPromise(function(_0x2bbcee,_0x17f760){getLimits()[_0x77ca('0xa')](function(_0x4acc99){var _0x3d8f98=_[_0x77ca('0x2b')](_[_0x77ca('0x2c')](_0x23ecdd,_0x77ca('0x22')),[_0x77ca('0x26'),'user',_0x77ca('0x28')]);var _0x5efd44=(_0x3d8f98[_0x77ca('0x26')]||0x0)+(_0x3d8f98[_0x77ca('0x27')]||0x0);var _0x3a54d4=_0x3d8f98['telephone']||0x0;if(_0x5efd44>_0x4acc99['user'])return _0x17f760(_0x77ca('0x2d'));if(_0x3a54d4>_0x4acc99[_0x77ca('0x28')])return _0x17f760(_0x77ca('0x2e'));return _0x2bbcee();})[_0x77ca('0xb')](function(_0x4f5563){_0x17f760(_0x4f5563);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index db68a4e..553ddd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4a2=['app-id','exports'];(function(_0x271ba2,_0x54a752){var _0x4e760e=function(_0x5324ca){while(--_0x5324ca){_0x271ba2['push'](_0x271ba2['shift']());}};_0x4e760e(++_0x54a752);}(_0xd4a2,0x173));var _0x2d4a=function(_0x56c685,_0x4f9711){_0x56c685=_0x56c685-0x0;var _0x38f27a=_0xd4a2[_0x56c685];return _0x38f27a;};'use strict';module[_0x2d4a('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x2d4a('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
+var _0x5b12=['http://localhost:9000','myappanuglar-secret','secret','exports'];(function(_0xcf807,_0x4c736b){var _0x2ef9e9=function(_0x33ed42){while(--_0x33ed42){_0xcf807['push'](_0xcf807['shift']());}};_0x2ef9e9(++_0x4c736b);}(_0x5b12,0xa3));var _0x25b1=function(_0x5e651b,_0x1c223f){_0x5e651b=_0x5e651b-0x0;var _0xd0b6c5=_0x5b12[_0x5e651b];return _0xd0b6c5;};'use strict';module[_0x25b1('0x0')]={'DOMAIN':_0x25b1('0x1'),'SESSION_SECRET':_0x25b1('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0x25b1('0x3'),'DEBUG':''};
\ No newline at end of file
index 8d02804..b7c6bee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dde=['exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','util','path','INFO','join','/var','xcally','format','message','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase'];(function(_0x3dd1a6,_0x10554f){var _0x296b89=function(_0x2a3554){while(--_0x2a3554){_0x3dd1a6['push'](_0x3dd1a6['shift']());}};_0x296b89(++_0x10554f);}(_0x3dde,0x136));var _0xe3dd=function(_0x3b1e04,_0x1b7b69){_0x3b1e04=_0x3b1e04-0x0;var _0x4b6fa0=_0x3dde[_0x3b1e04];return _0x4b6fa0;};'use strict';var moment=require(_0xe3dd('0x0'));var winston=require('winston');var util=require(_0xe3dd('0x1'));var path=require(_0xe3dd('0x2'));var debugLevel=_0xe3dd('0x3');function filename(_0x81c83b,_0x2079c8){return path[_0xe3dd('0x4')](_0xe3dd('0x5'),'log',_0xe3dd('0x6'),util[_0xe3dd('0x7')]('%s-%s.log',_0x81c83b,_0x2079c8));}function formatter(_0x5d6e8a,_0x37fd4d){_0x37fd4d[_0xe3dd('0x8')]=_0x37fd4d[_0xe3dd('0x8')]['replace'](/@@{/g,'{{{')['replace'](/}@@/g,_0xe3dd('0x9'))['replace'](/@{/g,'{{')[_0xe3dd('0xa')](/}@/g,'}}');return util[_0xe3dd('0x7')](_0xe3dd('0xb'),moment()[_0xe3dd('0x7')](_0xe3dd('0xc')),_0x37fd4d[_0xe3dd('0xd')][_0xe3dd('0xe')](),_0x5d6e8a,_0x37fd4d[_0xe3dd('0x8')]);}module[_0xe3dd('0xf')]=function(_0x3e80ee){return new winston[(_0xe3dd('0x10'))]({'transports':[new winston[(_0xe3dd('0x11'))][(_0xe3dd('0x12'))]({'name':util[_0xe3dd('0x7')](_0xe3dd('0x13'),_0x3e80ee,_0xe3dd('0x14')),'filename':filename(_0x3e80ee,_0xe3dd('0x14')),'level':_0xe3dd('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x38ea80){return formatter(_0x3e80ee,_0x38ea80);}}),new winston[(_0xe3dd('0x11'))][(_0xe3dd('0x12'))]({'name':util[_0xe3dd('0x7')](_0xe3dd('0x13'),_0x3e80ee,'info'),'filename':filename(_0x3e80ee,'info'),'level':_0xe3dd('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5faae8){return formatter(_0x3e80ee,_0x5faae8);}}),new winston[(_0xe3dd('0x11'))][(_0xe3dd('0x16'))]({'level':process[_0xe3dd('0x17')][_0xe3dd('0x18')]||debugLevel,'json':![],'formatter':function(_0x585c88){return formatter(_0x3e80ee,_0x585c88);}})]});};
\ No newline at end of file
+var _0x4bef=['exports','Logger','transports','File','error','%s-%s','info','Console','debugLevel','moment','winston','util','path','INFO','join','/var','log','format','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase'];(function(_0x54c715,_0xd765a5){var _0x48b500=function(_0x28539c){while(--_0x28539c){_0x54c715['push'](_0x54c715['shift']());}};_0x48b500(++_0xd765a5);}(_0x4bef,0x129));var _0xf4be=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x4bef[_0x2be8c2];return _0x97f531;};'use strict';var moment=require(_0xf4be('0x0'));var winston=require(_0xf4be('0x1'));var util=require(_0xf4be('0x2'));var path=require(_0xf4be('0x3'));var debugLevel=_0xf4be('0x4');function filename(_0x5be799,_0x1bed79){return path[_0xf4be('0x5')](_0xf4be('0x6'),_0xf4be('0x7'),'xcally',util[_0xf4be('0x8')]('%s-%s.log',_0x5be799,_0x1bed79));}function formatter(_0x1f1dde,_0x16286f){_0x16286f[_0xf4be('0x9')]=_0x16286f[_0xf4be('0x9')][_0xf4be('0xa')](/@@{/g,_0xf4be('0xb'))[_0xf4be('0xa')](/}@@/g,'}}}')[_0xf4be('0xa')](/@{/g,'{{')[_0xf4be('0xa')](/}@/g,'}}');return util[_0xf4be('0x8')](_0xf4be('0xc'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x16286f[_0xf4be('0xd')][_0xf4be('0xe')](),_0x1f1dde,_0x16286f[_0xf4be('0x9')]);}module[_0xf4be('0xf')]=function(_0x56b707){return new winston[(_0xf4be('0x10'))]({'transports':[new winston[(_0xf4be('0x11'))][(_0xf4be('0x12'))]({'name':util[_0xf4be('0x8')]('%s-%s',_0x56b707,_0xf4be('0x13')),'filename':filename(_0x56b707,'error'),'level':_0xf4be('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5afa62){return formatter(_0x56b707,_0x5afa62);}}),new winston[(_0xf4be('0x11'))]['File']({'name':util['format'](_0xf4be('0x14'),_0x56b707,_0xf4be('0x15')),'filename':filename(_0x56b707,_0xf4be('0x15')),'level':_0xf4be('0x15'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xff8c3b){return formatter(_0x56b707,_0xff8c3b);}}),new winston[(_0xf4be('0x11'))][(_0xf4be('0x16'))]({'level':process['env'][_0xf4be('0x17')]||debugLevel,'json':![],'formatter':function(_0x409ee8){return formatter(_0x56b707,_0x409ee8);}})]});};
\ No newline at end of file
index 36519ff..cd43589 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd394=['../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing'];(function(_0xc62164,_0x1e36b3){var _0x359c0d=function(_0x411ada){while(--_0x411ada){_0xc62164['push'](_0xc62164['shift']());}};_0x359c0d(++_0x1e36b3);}(_0xd394,0xd6));var _0x4d39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd394[_0x321bb2];return _0x9c12ed;};'use strict';var path=require(_0x4d39('0x0'));var os=require('os');var config={'apps':[{'name':_0x4d39('0x1'),'script':path[_0x4d39('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x4d39('0x3'),'script':path[_0x4d39('0x2')](__dirname,_0x4d39('0x4'))},{'name':_0x4d39('0x5'),'script':path[_0x4d39('0x2')](__dirname,_0x4d39('0x6'))},{'name':_0x4d39('0x7'),'script':path[_0x4d39('0x2')](__dirname,_0x4d39('0x8'))},{'name':_0x4d39('0x9'),'script':path[_0x4d39('0x2')](__dirname,_0x4d39('0xa'))},{'name':_0x4d39('0xb'),'script':path['join'](__dirname,_0x4d39('0xc'))}]};module[_0x4d39('0xd')]=config;
\ No newline at end of file
+var _0x1ac4=['path','express','join','ami','email','../../services/email/index.js','../../services/xdr/index.js','exports'];(function(_0x1f3890,_0x2f9aad){var _0x4af351=function(_0xd4cdfa){while(--_0xd4cdfa){_0x1f3890['push'](_0x1f3890['shift']());}};_0x4af351(++_0x2f9aad);}(_0x1ac4,0x118));var _0x41ac=function(_0x2a0fd3,_0x3fcf1e){_0x2a0fd3=_0x2a0fd3-0x0;var _0x1ad887=_0x1ac4[_0x2a0fd3];return _0x1ad887;};'use strict';var path=require(_0x41ac('0x0'));var os=require('os');var config={'apps':[{'name':_0x41ac('0x1'),'script':path[_0x41ac('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x41ac('0x3'),'script':path[_0x41ac('0x2')](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0x41ac('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x41ac('0x4'),'script':path['join'](__dirname,_0x41ac('0x5'))},{'name':'routing','script':path['join'](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0x41ac('0x2')](__dirname,_0x41ac('0x6'))}]};module[_0x41ac('0x7')]=config;
\ No newline at end of file
index 6362c86..9fb2e7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8174=['then','restart','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','disconnect','stop'];(function(_0x25402e,_0x1ab8f2){var _0x168dbb=function(_0x440845){while(--_0x440845){_0x25402e['push'](_0x25402e['shift']());}};_0x168dbb(++_0x1ab8f2);}(_0x8174,0x70));var _0x4817=function(_0xa6cb09,_0x39410f){_0xa6cb09=_0xa6cb09-0x0;var _0x12b437=_0x8174[_0xa6cb09];return _0x12b437;};'use strict';var pm2=require(_0x4817('0x0'));var BPromise=require(_0x4817('0x1'));var config=require(_0x4817('0x2'));function connect(){return new BPromise(function(_0x1caec7,_0x1d8be9){return pm2[_0x4817('0x3')](function(_0x398bdb){if(_0x398bdb){return _0x1d8be9(_0x398bdb);}return _0x1caec7(_0x4817('0x4'));});});};exports['start']=function(_0x2c017f){return connect()['then'](function(){return new BPromise(function(_0xf1f322,_0x3bc7a6){return pm2[_0x4817('0x5')](_0x2c017f,function(_0x1f481d,_0x2822a5){if(_0x1f481d){return _0x3bc7a6(_0x1f481d);}pm2[_0x4817('0x6')]();return _0xf1f322(_0x2822a5);});});});};exports[_0x4817('0x7')]=function(_0x5a8da4){return connect()[_0x4817('0x8')](function(){return new BPromise(function(_0x860ae1,_0x36b3bb){return pm2[_0x4817('0x7')](_0x5a8da4,function(_0x252600,_0x292c8f){if(_0x252600){return _0x36b3bb(_0x252600);}pm2['disconnect']();return _0x860ae1(_0x292c8f);});});});};exports[_0x4817('0x9')]=function(_0xd905ee){return connect()['then'](function(){return new BPromise(function(_0x24bed2,_0x4d25f1){return pm2[_0x4817('0x9')](_0xd905ee,function(_0x4238c0,_0x2eb1f0){if(_0x4238c0){return _0x4d25f1(_0x4238c0);}pm2[_0x4817('0x6')]();return _0x24bed2(_0x2eb1f0);});});});};exports[_0x4817('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x3aae0d,_0x531b4b){return pm2[_0x4817('0xa')](function(_0x3cd59e,_0x23c279){if(_0x3cd59e){return _0x531b4b(_0x3cd59e);}pm2[_0x4817('0x6')]();return _0x3aae0d(_0x23c279);});});});};exports[_0x4817('0xb')]=function(_0x104874){return connect()[_0x4817('0x8')](function(){return new BPromise(function(_0x1eb10a,_0x4d2779){return pm2[_0x4817('0xb')](_0x104874,function(_0x5dcd0c,_0x5ec217){if(_0x5dcd0c){return _0x4d2779(_0x5dcd0c);}pm2[_0x4817('0x6')]();return _0x1eb10a(_0x5ec217);});});});};exports[_0x4817('0xc')]=function(_0x4d04fa){return connect()[_0x4817('0x8')](function(){return new BPromise(function(_0xf0e27e,_0x4a961f){return pm2[_0x4817('0xc')](_0x4d04fa,function(_0x30626d,_0x4c411c){if(_0x30626d){return _0x4a961f(_0x30626d);}pm2[_0x4817('0x6')]();return _0xf0e27e(_0x4c411c);});});});};exports[_0x4817('0xd')]=function(){return connect()[_0x4817('0x8')](function(){return new BPromise(function(_0x1765ee,_0xcd645b){return pm2['dump'](function(_0x3f8e55){if(_0x3f8e55){return _0xcd645b(_0x3f8e55);}return _0x1765ee(_0x4817('0xe'));});});});};
\ No newline at end of file
+var _0xaed7=['stop','restart','list','describe','delete','dump','saved','bluebird','connect','connected','start','then','disconnect'];(function(_0x354fa9,_0x58734f){var _0x1ef483=function(_0x5a6623){while(--_0x5a6623){_0x354fa9['push'](_0x354fa9['shift']());}};_0x1ef483(++_0x58734f);}(_0xaed7,0x13f));var _0x7aed=function(_0x3310fb,_0x19568c){_0x3310fb=_0x3310fb-0x0;var _0x511750=_0xaed7[_0x3310fb];return _0x511750;};'use strict';var pm2=require('pm2');var BPromise=require(_0x7aed('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x40c40d,_0x579460){return pm2[_0x7aed('0x1')](function(_0x32e933){if(_0x32e933){return _0x579460(_0x32e933);}return _0x40c40d(_0x7aed('0x2'));});});};exports[_0x7aed('0x3')]=function(_0x1c2ecd){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x5029ce,_0x142823){return pm2[_0x7aed('0x3')](_0x1c2ecd,function(_0x4f5ac1,_0x4a7f4a){if(_0x4f5ac1){return _0x142823(_0x4f5ac1);}pm2[_0x7aed('0x5')]();return _0x5029ce(_0x4a7f4a);});});});};exports['stop']=function(_0x57f435){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x4b558a,_0x17cbf0){return pm2[_0x7aed('0x6')](_0x57f435,function(_0x3335b7,_0x401ba4){if(_0x3335b7){return _0x17cbf0(_0x3335b7);}pm2[_0x7aed('0x5')]();return _0x4b558a(_0x401ba4);});});});};exports[_0x7aed('0x7')]=function(_0x160f00){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x3f7082,_0xc35505){return pm2[_0x7aed('0x7')](_0x160f00,function(_0x5503d0,_0x4ad529){if(_0x5503d0){return _0xc35505(_0x5503d0);}pm2[_0x7aed('0x5')]();return _0x3f7082(_0x4ad529);});});});};exports[_0x7aed('0x8')]=function(){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x2b579e,_0x4da35c){return pm2[_0x7aed('0x8')](function(_0x2b09bd,_0x5a5f4d){if(_0x2b09bd){return _0x4da35c(_0x2b09bd);}pm2[_0x7aed('0x5')]();return _0x2b579e(_0x5a5f4d);});});});};exports['describe']=function(_0x458f1b){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x482843,_0x2169eb){return pm2[_0x7aed('0x9')](_0x458f1b,function(_0x303f4b,_0x3ef080){if(_0x303f4b){return _0x2169eb(_0x303f4b);}pm2[_0x7aed('0x5')]();return _0x482843(_0x3ef080);});});});};exports['delete']=function(_0x5c81f1){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x43e47b,_0x4e8434){return pm2[_0x7aed('0xa')](_0x5c81f1,function(_0x5b1398,_0x3efb40){if(_0x5b1398){return _0x4e8434(_0x5b1398);}pm2[_0x7aed('0x5')]();return _0x43e47b(_0x3efb40);});});});};exports[_0x7aed('0xb')]=function(){return connect()[_0x7aed('0x4')](function(){return new BPromise(function(_0x450a98,_0x349f9e){return pm2[_0x7aed('0xb')](function(_0x495d59){if(_0x495d59){return _0x349f9e(_0x495d59);}return _0x450a98(_0x7aed('0xc'));});});});};
\ No newline at end of file
index 84938b2..a54ae09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8db9=['system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','Setting','find','chatTimeout','ChatInteraction','findAll','then','length','map','info','update'];(function(_0x4ac18e,_0x5a060c){var _0x4a8f52=function(_0x16fed7){while(--_0x16fed7){_0x4ac18e['push'](_0x4ac18e['shift']());}};_0x4a8f52(++_0x5a060c);}(_0x8db9,0x102));var _0x98db=function(_0x3dae5b,_0x36cb90){_0x3dae5b=_0x3dae5b-0x0;var _0x505412=_0x8db9[_0x3dae5b];return _0x505412;};'use strict';var _=require(_0x98db('0x0'));var moment=require(_0x98db('0x1'));var Redis=require(_0x98db('0x2'));var util=require(_0x98db('0x3'));var config=require(_0x98db('0x4'));var db=require(_0x98db('0x5'))['db'];var logger=require(_0x98db('0x6'))(_0x98db('0x7'));config[_0x98db('0x8')]=_[_0x98db('0x9')](config[_0x98db('0x8')],{'host':_0x98db('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x98db('0x8')]));function closeInteractions(){var _0x30cb19=0x0;var _0x18507c=[];return db[_0x98db('0xb')][_0x98db('0xc')]({'raw':!![],'attributes':['id',_0x98db('0xd')],'where':{'id':0x1}})['then'](function(_0x2bf0d){_0x30cb19=_0x2bf0d[_0x98db('0xd')];if(_0x30cb19){return db[_0x98db('0xe')][_0x98db('0xf')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x2bf0d[_0x98db('0xd')],'minutes')}}});}else{return[];}})[_0x98db('0x10')](function(_0x309532){if(_0x309532&&_0x309532[_0x98db('0x11')]){_0x18507c=_[_0x98db('0x12')](_0x309532||[],'id');logger[_0x98db('0x13')]('[CHAT]\x20Interactions\x20to\x20close:',_0x18507c['join']());return db[_0x98db('0xe')][_0x98db('0x14')]({'closeReason':_0x98db('0x15'),'disposition':_0x98db('0x16'),'closed':!![],'closedAt':moment()[_0x98db('0x17')](_0x98db('0x18'))},{'where':{'id':_0x18507c}});}})[_0x98db('0x10')](function(){if(_0x18507c&&_0x18507c[_0x98db('0x11')]){logger[_0x98db('0x13')](_0x98db('0x19'),_0x18507c[_0x98db('0x1a')]());for(var _0x30ecae=0x0;_0x30ecae<_0x18507c[_0x98db('0x11')];_0x30ecae++){io[_0x98db('0x1b')]('chatInteraction:update',{'id':_0x18507c[_0x30ecae],'closed':!![]});}}})[_0x98db('0x1c')](function(_0x5d9492){logger['error'](_0x98db('0x1d'),_0x5d9492?util[_0x98db('0x1e')](_0x5d9492,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x15d6=['findAll','lastMsgAt','subtract','chatTimeout','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','update','system','YYYY-MM-DD\x20HH:mm:ss','length','join','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','start','moment','ioredis','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','Setting','find','then','ChatInteraction'];(function(_0x108b9e,_0x5e73e8){var _0x33bef6=function(_0x46bb4b){while(--_0x46bb4b){_0x108b9e['push'](_0x108b9e['shift']());}};_0x33bef6(++_0x5e73e8);}(_0x15d6,0xec));var _0x615d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x15d6[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require(_0x615d('0x0'));var Redis=require(_0x615d('0x1'));var util=require('util');var config=require(_0x615d('0x2'));var db=require(_0x615d('0x3'))['db'];var logger=require('../logger')(_0x615d('0x4'));config[_0x615d('0x5')]=_[_0x615d('0x6')](config[_0x615d('0x5')],{'host':_0x615d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x615d('0x5')]));function closeInteractions(){var _0x29978b=0x0;var _0x1e0d03=[];return db[_0x615d('0x8')][_0x615d('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x615d('0xa')](function(_0x1547e6){_0x29978b=_0x1547e6['chatTimeout'];if(_0x29978b){return db[_0x615d('0xb')][_0x615d('0xc')]({'raw':!![],'attributes':['id',_0x615d('0xd')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x615d('0xe')](_0x1547e6[_0x615d('0xf')],_0x615d('0x10'))}}});}else{return[];}})[_0x615d('0xa')](function(_0x1ae036){if(_0x1ae036&&_0x1ae036['length']){_0x1e0d03=_[_0x615d('0x11')](_0x1ae036||[],'id');logger[_0x615d('0x12')](_0x615d('0x13'),_0x1e0d03['join']());return db[_0x615d('0xb')][_0x615d('0x14')]({'closeReason':_0x615d('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()['format'](_0x615d('0x16'))},{'where':{'id':_0x1e0d03}});}})['then'](function(){if(_0x1e0d03&&_0x1e0d03[_0x615d('0x17')]){logger[_0x615d('0x12')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x1e0d03[_0x615d('0x18')]());for(var _0x3f6886=0x0;_0x3f6886<_0x1e0d03[_0x615d('0x17')];_0x3f6886++){io[_0x615d('0x19')](_0x615d('0x1a'),{'id':_0x1e0d03[_0x3f6886],'closed':!![]});}}})[_0x615d('0x1b')](function(_0x205dc6){logger[_0x615d('0x1c')](_0x615d('0x1d'),_0x205dc6?util['inspect'](_0x205dc6,{'showHidden':![],'depth':null}):'');});}exports[_0x615d('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index dec1377..f1ef66c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80a8=['email','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','zip','existsSync','status','Sent','message','text','stringify','attachments','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','keys','map','toString','difference','length','exists','stop','toRun','index','my\x20id','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','deleteJob','update\x20cron','stop\x20cron','run','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','service','host','port','secure','authentication','auth','Smtp','user','pass','name'];(function(_0x595604,_0x2cc998){var _0x1466f3=function(_0x4e1d9b){while(--_0x4e1d9b){_0x595604['push'](_0x595604['shift']());}};_0x1466f3(++_0x2cc998);}(_0x80a8,0x14a));var _0x880a=function(_0x7a319d,_0x235959){_0x7a319d=_0x7a319d-0x0;var _0x5c6b4e=_0x80a8[_0x7a319d];return _0x5c6b4e;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x880a('0x0'));var _=require('lodash');var moment=require(_0x880a('0x1'));var CronJobManager=require(_0x880a('0x2'));var jayson=require(_0x880a('0x3'));var BPromise=require(_0x880a('0x4'));var logger=require(_0x880a('0x5'))('schedule');var db=require(_0x880a('0x6'))['db'];var analyticCustomReportController=require(_0x880a('0x7'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x880a('0x8')][_0x880a('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x299fde,_0x48c1c9){return function(){logger['info'](_0x880a('0xa'),_0x299fde['email']);var _0x4ee5d1=!![];var _0x509996={'tls':{'rejectUnauthorized':![]}};if(_0x299fde[_0x880a('0xb')]['Smtp'][_0x880a('0xc')]){_0x509996[_0x880a('0xc')]=_0x299fde[_0x880a('0xb')]['Smtp'][_0x880a('0xc')];}else{_0x509996[_0x880a('0xd')]=_0x299fde['MailAccount']['Smtp'][_0x880a('0xd')];_0x509996[_0x880a('0xe')]=_0x299fde[_0x880a('0xb')]['Smtp'][_0x880a('0xe')];_0x509996[_0x880a('0xf')]=_0x299fde[_0x880a('0xb')]['Smtp']['secure'];}if(_0x299fde[_0x880a('0xb')]['Smtp'][_0x880a('0x10')]){_0x509996[_0x880a('0x11')]={'user':_0x299fde['MailAccount'][_0x880a('0x12')][_0x880a('0x13')],'pass':_0x299fde['MailAccount'][_0x880a('0x12')][_0x880a('0x14')]};}var _0x34b1b4={'account':_0x509996,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x299fde[_0x880a('0xb')][_0x880a('0x15')],_0x299fde[_0x880a('0xb')][_0x880a('0x16')]||_0x299fde[_0x880a('0xb')][_0x880a('0x12')][_0x880a('0x13')]),'to':_0x299fde[_0x880a('0x16')],'cc':_0x299fde['cc'],'bcc':_0x299fde[_0x880a('0x17')],'subject':util[_0x880a('0x18')](_0x880a('0x19'),_0x48c1c9[_0x880a('0x15')],_0x299fde['subtractNumber'],_0x299fde[_0x880a('0x1a')])}};var _0x441c65=path[_0x880a('0x1b')](__dirname,_0x880a('0x1c'));var _0x5b4454=_0x48c1c9[_0x880a('0x1d')];var _0x397465=util[_0x880a('0x18')](_0x880a('0x1e'),path[_0x880a('0x1f')](_0x48c1c9[_0x880a('0x1d')],path[_0x880a('0x20')](_0x48c1c9['savename'])),_0x880a('0x21'));var _0x1bc7bc=path[_0x880a('0x1b')](_0x441c65,_0x5b4454);var _0x117227=path[_0x880a('0x1b')](_0x441c65,_0x397465);if(fs[_0x880a('0x22')](_0x1bc7bc)){_0x48c1c9[_0x880a('0x23')]=_0x880a('0x24');_0x34b1b4[_0x880a('0x25')]['attachments']=[{'filename':_0x5b4454,'path':_0x1bc7bc}];_0x34b1b4[_0x880a('0x25')][_0x880a('0x26')]=util[_0x880a('0x18')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x880a('0x27')](_0x48c1c9,null,0x2));}else if(fs[_0x880a('0x22')](_0x117227)){_0x48c1c9[_0x880a('0x23')]=_0x880a('0x24');_0x34b1b4[_0x880a('0x25')][_0x880a('0x28')]=[{'filename':_0x397465,'path':_0x117227}];}else{_0x34b1b4[_0x880a('0x25')][_0x880a('0x26')]=_0x880a('0x29');if(!_0x299fde['sendIfEmpty']){_0x4ee5d1=![];logger[_0x880a('0x2a')](_0x880a('0x2b'));}}if(_0x4ee5d1){return client['request'](_0x880a('0x2c'),_0x34b1b4)[_0x880a('0x2d')](function(_0x5dddb4){if(_0x5dddb4[_0x880a('0x2e')]){return logger[_0x880a('0x2e')](_0x880a('0x2f'),JSON[_0x880a('0x27')](_0x5dddb4));}return logger[_0x880a('0x2a')](_0x880a('0x30'));})[_0x880a('0x31')](function(_0x1eeadd){return logger[_0x880a('0x2e')](_0x880a('0x2f'),JSON[_0x880a('0x27')](_0x1eeadd));});}};}function handleError(){return function(_0x393b9a){return logger[_0x880a('0x2e')](JSON[_0x880a('0x27')](_0x393b9a));};}function handleResult(_0x3ac263){return function(_0x4071be){logger[_0x880a('0x2a')](_0x880a('0x32'),JSON['stringify'](_0x4071be));if(_0x3ac263['MailAccount']&&_0x3ac263[_0x880a('0xb')][_0x880a('0x12')]&&!_[_0x880a('0x33')](_0x3ac263[_0x880a('0x16')])){setTimeout(handleSendEmail(_0x3ac263,_0x4071be),0x3c*0x3e8);}};}function handleJob(_0x12a29f){return function(){try{if(_[_0x880a('0x33')](_0x12a29f[_0x880a('0x34')])){return logger[_0x880a('0x2a')](_0x880a('0x35'));}if(_[_0x880a('0x33')](_0x12a29f['subtractUnit'])){return logger[_0x880a('0x2a')](_0x880a('0x36'));}var _0x34054={'startDate':moment()[_0x880a('0x37')](_0x12a29f[_0x880a('0x34')],_0x12a29f[_0x880a('0x1a')])[_0x880a('0x18')](_0x880a('0x38')),'endDate':moment()[_0x880a('0x18')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x12a29f[_0x880a('0x39')],'name':_0x12a29f[_0x880a('0x15')]};if(!_[_0x880a('0x33')](_0x12a29f[_0x880a('0x3a')])){logger['info'](_0x880a('0x3b'),_0x12a29f['DefaultReportId']);return analyticDefaultReportController[_0x880a('0x3c')]({'id':_0x12a29f[_0x880a('0x3a')]},_0x34054)[_0x880a('0x2d')](handleResult(_0x12a29f))[_0x880a('0x31')](handleError());}if(!_['isNil'](_0x12a29f[_0x880a('0x3d')])){logger[_0x880a('0x2a')](_0x880a('0x3e'),_0x12a29f[_0x880a('0x3d')]);return analyticCustomReportController['runReport']({'id':_0x12a29f[_0x880a('0x3d')]},_0x34054)['then'](handleResult(_0x12a29f))[_0x880a('0x31')](handleError());}}catch(_0x216057){logger[_0x880a('0x2e')](JSON[_0x880a('0x27')](_0x216057));}return logger[_0x880a('0x2a')](_0x880a('0x3f'));};}function getJobs(_0x50c372){var _0x2248e3={};if(_0x50c372){_0x2248e3['id']=_0x50c372;}return db[_0x880a('0x40')][_0x880a('0x41')]({'where':_0x2248e3,'include':[{'model':db['MailAccount'],'attributes':['id',_0x880a('0x15'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x880a('0x12')}]}]})[_0x880a('0x2d')](function(_0x562a77){var _0x3395b2=_[_0x880a('0x42')](manager['jobs']);var _0x576031=_[_0x880a('0x43')](_0x562a77,function(_0x5e86e2){return _0x5e86e2['id'][_0x880a('0x44')]();});var _0x50461f=_['keyBy'](_0x562a77,function(_0x2d01a4){return _0x2d01a4['id']['toString']();});var _0x5efe45=_0x50c372?_0x576031:_[_0x880a('0x45')](_0x576031,_0x3395b2);var _0x26aca1=_['intersection'](_0x576031,_0x3395b2);var _0xee9a22=_['difference'](_0x3395b2,_0x576031);var _0x5d92b9;var _0x486981;for(_0x5d92b9=0x0;_0x5d92b9<_0xee9a22[_0x880a('0x46')]&&!_0x50c372;_0x5d92b9+=0x1){_0x486981=_0xee9a22[_0x5d92b9]['toString']();if(manager[_0x880a('0x47')](_0x486981)){manager[_0x880a('0x48')](_0x486981);manager['deleteJob'](_0x486981);logger[_0x880a('0x2a')]('delete\x20cron',_0x486981);}}logger['info'](_0x880a('0x49'),JSON['stringify'](_0x5efe45));for(_0x5d92b9=0x0;_0x5d92b9<_0x5efe45[_0x880a('0x46')];_0x5d92b9+=0x1){_0x486981=_0x5efe45[_0x5d92b9][_0x880a('0x44')]();logger[_0x880a('0x2a')](_0x880a('0x4a'),_0x486981);if(_0x50c372){logger[_0x880a('0x2a')](_0x880a('0x4b'),_0x50c372);logger[_0x880a('0x2a')](JSON['stringify'](_0x50461f[_0x486981]));BPromise['resolve']()['then'](handleJob(_0x50461f[_0x486981]));logger[_0x880a('0x2a')](_0x880a('0x4c'),_0x50461f[_0x486981][_0x880a('0x15')],_0x50461f[_0x486981][_0x880a('0x4d')]);}else if(_0x50461f[_0x486981][_0x880a('0x4d')]&&_0x50461f[_0x486981][_0x880a('0x4e')]&&moment()[_0x880a('0x4f')](_0x50461f[_0x486981][_0x880a('0x50')],_0x50461f[_0x486981]['endAt'])){manager[_0x880a('0x51')](_0x486981,_0x50461f[_0x486981]['cron'],handleJob(_0x50461f[_0x486981]));manager[_0x880a('0x52')](_0x486981);logger['info'](_0x880a('0x53'),_0x50461f[_0x486981][_0x880a('0x15')],_0x50461f[_0x486981]['cron']);}else if(manager[_0x880a('0x47')](_0x486981)){manager[_0x880a('0x48')](_0x486981);manager[_0x880a('0x54')](_0x486981);logger[_0x880a('0x2a')]('stop\x20cron',_0x50461f[_0x486981][_0x880a('0x15')],_0x50461f[_0x486981][_0x880a('0x4d')]);}}for(_0x5d92b9=0x0,_0x486981;_0x5d92b9<_0x26aca1[_0x880a('0x46')]&&!_0x50c372;_0x5d92b9+=0x1){_0x486981=_0x26aca1[_0x5d92b9]['toString']();if(manager[_0x880a('0x47')](_0x486981)){if(_0x50461f[_0x486981][_0x880a('0x4d')]&&_0x50461f[_0x486981][_0x880a('0x4e')]&&moment()[_0x880a('0x4f')](_0x50461f[_0x486981][_0x880a('0x50')],_0x50461f[_0x486981]['endAt'])){manager['update'](_0x486981,_0x50461f[_0x486981]['cron'],handleJob(_0x50461f[_0x486981]));logger['info'](_0x880a('0x55'),_0x50461f[_0x486981][_0x880a('0x15')],_0x50461f[_0x486981][_0x880a('0x4d')]);}else{manager[_0x880a('0x48')](_0x486981);manager[_0x880a('0x54')](_0x486981);logger[_0x880a('0x2a')](_0x880a('0x56'),_0x50461f[_0x486981][_0x880a('0x15')],_0x50461f[_0x486981][_0x880a('0x4d')]);}}}})[_0x880a('0x31')](function(_0x3053b8){logger[_0x880a('0x2e')](JSON[_0x880a('0x27')](_0x3053b8));});}exports[_0x880a('0x57')]=function(_0x98df6e){return getJobs(_0x98df6e);};exports[_0x880a('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x6d94=['\x22%s\x22\x20<%s>','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','basename','extname','zip','existsSync','status','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Sent','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','SendMail','then','error','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','runReport','no\x20report\x20id','Schedule','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','endAt','add\x20cron','stop\x20cron','active','isBetween','startAt','update','update\x20cron','util','path','lodash','moment','bluebird','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','host','MailAccount','port','secure','authentication','auth','user','format'];(function(_0x2511c6,_0x5859ca){var _0x10a803=function(_0x3fb3a2){while(--_0x3fb3a2){_0x2511c6['push'](_0x2511c6['shift']());}};_0x10a803(++_0x5859ca);}(_0x6d94,0x1a5));var _0x46d9=function(_0x3b2a08,_0xffae5d){_0x3b2a08=_0x3b2a08-0x0;var _0x1339a6=_0x6d94[_0x3b2a08];return _0x1339a6;};'use strict';var fs=require('fs');var util=require(_0x46d9('0x0'));var path=require(_0x46d9('0x1'));var _=require(_0x46d9('0x2'));var moment=require(_0x46d9('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require(_0x46d9('0x4'));var logger=require('../logger')(_0x46d9('0x5'));var db=require(_0x46d9('0x6'))['db'];var analyticCustomReportController=require(_0x46d9('0x7'));var analyticDefaultReportController=require(_0x46d9('0x8'));var client=jayson[_0x46d9('0x9')][_0x46d9('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xff7926,_0x36d74e){return function(){logger[_0x46d9('0xb')](_0x46d9('0xc'),_0xff7926[_0x46d9('0xd')]);var _0x20018a=!![];var _0x36fb45={'tls':{'rejectUnauthorized':![]}};if(_0xff7926['MailAccount'][_0x46d9('0xe')][_0x46d9('0xf')]){_0x36fb45[_0x46d9('0xf')]=_0xff7926['MailAccount'][_0x46d9('0xe')]['service'];}else{_0x36fb45[_0x46d9('0x10')]=_0xff7926[_0x46d9('0x11')][_0x46d9('0xe')][_0x46d9('0x10')];_0x36fb45['port']=_0xff7926['MailAccount'][_0x46d9('0xe')][_0x46d9('0x12')];_0x36fb45[_0x46d9('0x13')]=_0xff7926[_0x46d9('0x11')][_0x46d9('0xe')][_0x46d9('0x13')];}if(_0xff7926['MailAccount'][_0x46d9('0xe')][_0x46d9('0x14')]){_0x36fb45[_0x46d9('0x15')]={'user':_0xff7926[_0x46d9('0x11')][_0x46d9('0xe')][_0x46d9('0x16')],'pass':_0xff7926[_0x46d9('0x11')][_0x46d9('0xe')]['pass']};}var _0x24497d={'account':_0x36fb45,'message':{'from':util[_0x46d9('0x17')](_0x46d9('0x18'),_0xff7926[_0x46d9('0x11')][_0x46d9('0x19')],_0xff7926[_0x46d9('0x11')]['email']||_0xff7926['MailAccount'][_0x46d9('0xe')][_0x46d9('0x16')]),'to':_0xff7926['email'],'cc':_0xff7926['cc'],'bcc':_0xff7926['bcc'],'subject':util[_0x46d9('0x17')](_0x46d9('0x1a'),_0x36d74e['name'],_0xff7926[_0x46d9('0x1b')],_0xff7926[_0x46d9('0x1c')])}};var _0x38cac6=path[_0x46d9('0x1d')](__dirname,'../../files/reports');var _0x48d787=_0x36d74e[_0x46d9('0x1e')];var _0x40e6d1=util['format'](_0x46d9('0x1f'),path[_0x46d9('0x20')](_0x36d74e[_0x46d9('0x1e')],path[_0x46d9('0x21')](_0x36d74e[_0x46d9('0x1e')])),_0x46d9('0x22'));var _0x3d6f61=path[_0x46d9('0x1d')](_0x38cac6,_0x48d787);var _0x159d1c=path[_0x46d9('0x1d')](_0x38cac6,_0x40e6d1);if(fs[_0x46d9('0x23')](_0x3d6f61)){_0x36d74e[_0x46d9('0x24')]='Sent';_0x24497d[_0x46d9('0x25')][_0x46d9('0x26')]=[{'filename':_0x48d787,'path':_0x3d6f61}];_0x24497d['message'][_0x46d9('0x27')]=util[_0x46d9('0x17')](_0x46d9('0x28'),JSON['stringify'](_0x36d74e,null,0x2));}else if(fs[_0x46d9('0x23')](_0x159d1c)){_0x36d74e['status']=_0x46d9('0x29');_0x24497d['message'][_0x46d9('0x26')]=[{'filename':_0x40e6d1,'path':_0x159d1c}];}else{_0x24497d['message'][_0x46d9('0x27')]=_0x46d9('0x2a');if(!_0xff7926[_0x46d9('0x2b')]){_0x20018a=![];logger[_0x46d9('0xb')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x20018a){return client[_0x46d9('0x2c')](_0x46d9('0x2d'),_0x24497d)[_0x46d9('0x2e')](function(_0xbd6349){if(_0xbd6349[_0x46d9('0x2f')]){return logger[_0x46d9('0x2f')]('error\x20mail',JSON[_0x46d9('0x30')](_0xbd6349));}return logger[_0x46d9('0xb')](_0x46d9('0x31'));})[_0x46d9('0x32')](function(_0x559a82){return logger[_0x46d9('0x2f')]('error\x20mail',JSON[_0x46d9('0x30')](_0x559a82));});}};}function handleError(){return function(_0x2bd975){return logger[_0x46d9('0x2f')](JSON[_0x46d9('0x30')](_0x2bd975));};}function handleResult(_0x1b36c9){return function(_0x19dd67){logger[_0x46d9('0xb')](_0x46d9('0x33'),JSON[_0x46d9('0x30')](_0x19dd67));if(_0x1b36c9['MailAccount']&&_0x1b36c9[_0x46d9('0x11')]['Smtp']&&!_[_0x46d9('0x34')](_0x1b36c9[_0x46d9('0xd')])){setTimeout(handleSendEmail(_0x1b36c9,_0x19dd67),0x3c*0x3e8);}};}function handleJob(_0x420135){return function(){try{if(_['isNil'](_0x420135[_0x46d9('0x1b')])){return logger[_0x46d9('0xb')](_0x46d9('0x35'));}if(_[_0x46d9('0x34')](_0x420135[_0x46d9('0x1c')])){return logger[_0x46d9('0xb')](_0x46d9('0x36'));}var _0x3f8182={'startDate':moment()['subtract'](_0x420135[_0x46d9('0x1b')],_0x420135['subtractUnit'])[_0x46d9('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x46d9('0x17')](_0x46d9('0x37')),'type':'scheduled','output':_0x420135[_0x46d9('0x38')],'name':_0x420135['name']};if(!_['isNil'](_0x420135[_0x46d9('0x39')])){logger[_0x46d9('0xb')](_0x46d9('0x3a'),_0x420135[_0x46d9('0x39')]);return analyticDefaultReportController['runReport']({'id':_0x420135[_0x46d9('0x39')]},_0x3f8182)['then'](handleResult(_0x420135))[_0x46d9('0x32')](handleError());}if(!_[_0x46d9('0x34')](_0x420135[_0x46d9('0x3b')])){logger[_0x46d9('0xb')]('exec\x20custom\x20report\x20id:%s',_0x420135[_0x46d9('0x3b')]);return analyticCustomReportController[_0x46d9('0x3c')]({'id':_0x420135['CustomReportId']},_0x3f8182)['then'](handleResult(_0x420135))[_0x46d9('0x32')](handleError());}}catch(_0x3dcb02){logger[_0x46d9('0x2f')](JSON[_0x46d9('0x30')](_0x3dcb02));}return logger[_0x46d9('0xb')](_0x46d9('0x3d'));};}function getJobs(_0xaf5fd3){var _0x3141cb={};if(_0xaf5fd3){_0x3141cb['id']=_0xaf5fd3;}return db[_0x46d9('0x3e')]['findAll']({'where':_0x3141cb,'include':[{'model':db[_0x46d9('0x11')],'attributes':['id',_0x46d9('0x19'),'email'],'include':[{'model':db[_0x46d9('0x3f')],'as':_0x46d9('0xe')}]}]})[_0x46d9('0x2e')](function(_0x498b5e){var _0x27215d=_[_0x46d9('0x40')](manager[_0x46d9('0x41')]);var _0x1d8fe5=_[_0x46d9('0x42')](_0x498b5e,function(_0x39d1dc){return _0x39d1dc['id'][_0x46d9('0x43')]();});var _0x1b8242=_[_0x46d9('0x44')](_0x498b5e,function(_0x32770f){return _0x32770f['id'][_0x46d9('0x43')]();});var _0x1b161a=_0xaf5fd3?_0x1d8fe5:_[_0x46d9('0x45')](_0x1d8fe5,_0x27215d);var _0x58d722=_[_0x46d9('0x46')](_0x1d8fe5,_0x27215d);var _0x15b593=_[_0x46d9('0x45')](_0x27215d,_0x1d8fe5);var _0x3c496f;var _0x46da43;for(_0x3c496f=0x0;_0x3c496f<_0x15b593[_0x46d9('0x47')]&&!_0xaf5fd3;_0x3c496f+=0x1){_0x46da43=_0x15b593[_0x3c496f]['toString']();if(manager[_0x46d9('0x48')](_0x46da43)){manager[_0x46d9('0x49')](_0x46da43);manager[_0x46d9('0x4a')](_0x46da43);logger[_0x46d9('0xb')](_0x46d9('0x4b'),_0x46da43);}}logger[_0x46d9('0xb')](_0x46d9('0x4c'),JSON[_0x46d9('0x30')](_0x1b161a));for(_0x3c496f=0x0;_0x3c496f<_0x1b161a[_0x46d9('0x47')];_0x3c496f+=0x1){_0x46da43=_0x1b161a[_0x3c496f]['toString']();logger[_0x46d9('0xb')](_0x46d9('0x4d'),_0x46da43);if(_0xaf5fd3){logger[_0x46d9('0xb')](_0x46d9('0x4e'),_0xaf5fd3);logger[_0x46d9('0xb')](JSON['stringify'](_0x1b8242[_0x46da43]));BPromise['resolve']()[_0x46d9('0x2e')](handleJob(_0x1b8242[_0x46da43]));logger[_0x46d9('0xb')](_0x46d9('0x4f'),_0x1b8242[_0x46da43]['name'],_0x1b8242[_0x46da43][_0x46d9('0x50')]);}else if(_0x1b8242[_0x46da43][_0x46d9('0x50')]&&_0x1b8242[_0x46da43]['active']&&moment()['isBetween'](_0x1b8242[_0x46da43]['startAt'],_0x1b8242[_0x46da43][_0x46d9('0x51')])){manager['add'](_0x46da43,_0x1b8242[_0x46da43][_0x46d9('0x50')],handleJob(_0x1b8242[_0x46da43]));manager['start'](_0x46da43);logger[_0x46d9('0xb')](_0x46d9('0x52'),_0x1b8242[_0x46da43][_0x46d9('0x19')],_0x1b8242[_0x46da43][_0x46d9('0x50')]);}else if(manager[_0x46d9('0x48')](_0x46da43)){manager[_0x46d9('0x49')](_0x46da43);manager['deleteJob'](_0x46da43);logger[_0x46d9('0xb')](_0x46d9('0x53'),_0x1b8242[_0x46da43][_0x46d9('0x19')],_0x1b8242[_0x46da43][_0x46d9('0x50')]);}}for(_0x3c496f=0x0,_0x46da43;_0x3c496f<_0x58d722[_0x46d9('0x47')]&&!_0xaf5fd3;_0x3c496f+=0x1){_0x46da43=_0x58d722[_0x3c496f][_0x46d9('0x43')]();if(manager[_0x46d9('0x48')](_0x46da43)){if(_0x1b8242[_0x46da43][_0x46d9('0x50')]&&_0x1b8242[_0x46da43][_0x46d9('0x54')]&&moment()[_0x46d9('0x55')](_0x1b8242[_0x46da43][_0x46d9('0x56')],_0x1b8242[_0x46da43][_0x46d9('0x51')])){manager[_0x46d9('0x57')](_0x46da43,_0x1b8242[_0x46da43][_0x46d9('0x50')],handleJob(_0x1b8242[_0x46da43]));logger['info'](_0x46d9('0x58'),_0x1b8242[_0x46da43]['name'],_0x1b8242[_0x46da43][_0x46d9('0x50')]);}else{manager[_0x46d9('0x49')](_0x46da43);manager[_0x46d9('0x4a')](_0x46da43);logger['info'](_0x46d9('0x53'),_0x1b8242[_0x46da43][_0x46d9('0x19')],_0x1b8242[_0x46da43][_0x46d9('0x50')]);}}}})[_0x46d9('0x32')](function(_0x16efee){logger[_0x46d9('0x2f')](JSON[_0x46d9('0x30')](_0x16efee));});}exports['run']=function(_0x37d87c){return getJobs(_0x37d87c);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 6fdf484..739289c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a2a=['[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','findOne','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribeAccountId','push','all','start','lodash','aws-sdk','request-promise','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','results','transcripts','length','transcript','update','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','language','Sentiment','SentimentScore','Negative','Neutral'];(function(_0x3e4a8b,_0x26fbb8){var _0x226fa7=function(_0x42a0ce){while(--_0x42a0ce){_0x3e4a8b['push'](_0x3e4a8b['shift']());}};_0x226fa7(++_0x26fbb8);}(_0x9a2a,0xa7));var _0xa9a2=function(_0x5e54ea,_0x27a035){_0x5e54ea=_0x5e54ea-0x0;var _0x5ebbfb=_0x9a2a[_0x5e54ea];return _0x5ebbfb;};var _=require(_0xa9a2('0x0'));var AWS=require(_0xa9a2('0x1'));var rp=require(_0xa9a2('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0xa9a2('0x3'))(_0xa9a2('0x4'));function getTranscriptionJob(_0x196f84,_0xc11eab,_0x108b7a,_0x1ecee0){return new Promise(function(_0x4d5f04,_0x5c5e56){var _0x388689=new AWS[(_0xa9a2('0x5'))]({'accessKeyId':_0xc11eab,'secretAccessKey':_0x196f84,'region':_0x108b7a});_0x388689[_0xa9a2('0x6')]({'TranscriptionJobName':_0x1ecee0},function(_0x287343,_0xcd2750){if(_0x287343){return _0x5c5e56(_0x287343);}else{return _0x4d5f04(_0xcd2750);}});});}function sentiment(_0x3e7e51,_0x2169d4,_0x26f1ce,_0x302220,_0x54a150){return new Promise(function(_0x2ce6f7,_0xcc833c){var _0x3f0bce=new AWS[(_0xa9a2('0x7'))]({'accessKeyId':_0x2169d4,'secretAccessKey':_0x3e7e51,'region':_0x26f1ce});_0x3f0bce[_0xa9a2('0x8')]({'Text':_0x302220,'LanguageCode':_0x54a150[_0xa9a2('0x9')](0x0,0x2)},function(_0x10c35e,_0x212033){if(_0x10c35e){return _0xcc833c(_0x10c35e);}else{return _0x2ce6f7(_0x212033);}});});}function checkTranscribeJob(_0x451dab,_0x23ecb0,_0x4f8625){var _0x236659;return new BPromise(function(_0x3d7d7f,_0x2abbda){logger[_0xa9a2('0xa')](util[_0xa9a2('0xb')](_0xa9a2('0xc'),_0x451dab['id'],_0x451dab[_0xa9a2('0xd')]));return getTranscriptionJob(_0x4f8625[_0xa9a2('0xe')],_0x4f8625[_0xa9a2('0xf')],_0x23ecb0[_0xa9a2('0x10')],_0x451dab[_0xa9a2('0xd')])[_0xa9a2('0x11')](function(_0x1c2ae9){logger['info'](util[_0xa9a2('0xb')](_0xa9a2('0x12'),_0x451dab['id'],_0x451dab[_0xa9a2('0xd')],_0x1c2ae9[_0xa9a2('0x13')][_0xa9a2('0x14')]));if(!_0x451dab[_0xa9a2('0x15')]){switch(_0x1c2ae9['TranscriptionJob'][_0xa9a2('0x14')]){case _0xa9a2('0x16'):var _0x3f4337={'transcribeStatus':_0x1c2ae9[_0xa9a2('0x13')][_0xa9a2('0x14')],'fileUri':_0x1c2ae9[_0xa9a2('0x13')][_0xa9a2('0x17')][_0xa9a2('0x18')]};logger[_0xa9a2('0xa')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x451dab['id']));return rp({'uri':_0x1c2ae9['TranscriptionJob'][_0xa9a2('0x17')][_0xa9a2('0x18')],'json':!![]})[_0xa9a2('0x11')](function(_0x590e82){logger[_0xa9a2('0xa')](util['format']('[RECORDING:%d]\x20Transcript\x20downloaded',_0x451dab['id']));if(_0x590e82&&_0x590e82[_0xa9a2('0x19')]&&_0x590e82['results'][_0xa9a2('0x1a')]&&_0x590e82[_0xa9a2('0x19')]['transcripts'][_0xa9a2('0x1b')]){_0x3f4337[_0xa9a2('0x15')]='';for(var _0x1bb911=0x0;_0x1bb911<_0x590e82[_0xa9a2('0x19')][_0xa9a2('0x1a')]['length'];_0x1bb911++){_0x3f4337[_0xa9a2('0x15')]+=_0x590e82[_0xa9a2('0x19')]['transcripts'][_0x1bb911][_0xa9a2('0x1c')]+'';}}return _0x451dab[_0xa9a2('0x1d')](_0x3f4337);})[_0xa9a2('0x11')](function(){logger[_0xa9a2('0xa')](util[_0xa9a2('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x451dab['id']));if(!_0x451dab[_0xa9a2('0x1e')]){throw new db['Sequelize'][(_0xa9a2('0x1f'))](_0xa9a2('0x20'));}if(!_0x23ecb0['sentiment']||!_0x23ecb0['sentimentAccountId']||!_0x23ecb0['sentimentRegion']||!_0x23ecb0['language']||!_0x23ecb0[_0xa9a2('0x21')]){throw new db[(_0xa9a2('0x22'))][(_0xa9a2('0x1f'))](_0xa9a2('0x23'));}if(!_0x3f4337[_0xa9a2('0x15')]){throw new Error(_0xa9a2('0x24'));}if(_0x23ecb0[_0xa9a2('0x25')]===_0x4f8625['id']){return _0x4f8625;}else{return db[_0xa9a2('0x26')]['findOne']({'where':{'id':_settings[_0xa9a2('0x25')]}});}})[_0xa9a2('0x11')](function(_0x41ca6e){if(!_0x41ca6e){throw new db[(_0xa9a2('0x22'))][(_0xa9a2('0x1f'))](_0xa9a2('0x27'));}if(!_0x41ca6e[_0xa9a2('0xe')]||!_0x41ca6e['data2']){throw new db[(_0xa9a2('0x22'))][(_0xa9a2('0x1f'))](_0xa9a2('0x28'));}_0x236659=_0x41ca6e;logger[_0xa9a2('0xa')](util[_0xa9a2('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x451dab['id']));return sentiment(_0x236659[_0xa9a2('0xe')],_0x236659[_0xa9a2('0xf')],_0x23ecb0['sentimentRegion'],_0x3f4337['fileText'],_0x23ecb0[_0xa9a2('0x29')]);})[_0xa9a2('0x11')](function(_0x41b4a7){logger[_0xa9a2('0xa')](util[_0xa9a2('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x451dab['id']));return _0x451dab[_0xa9a2('0x1d')]({'sentiment':_0x41b4a7[_0xa9a2('0x2a')],'sPositive':_0x41b4a7[_0xa9a2('0x2b')]['Positive'],'sNegative':_0x41b4a7[_0xa9a2('0x2b')][_0xa9a2('0x2c')],'sMixed':_0x41b4a7[_0xa9a2('0x2b')]['Mixed'],'sNeutral':_0x41b4a7[_0xa9a2('0x2b')][_0xa9a2('0x2d')]});})[_0xa9a2('0x11')](function(){logger[_0xa9a2('0xa')](util[_0xa9a2('0xb')](_0xa9a2('0x2e'),_0x451dab['id']));_0x3d7d7f();});case _0xa9a2('0x2f'):return _0x451dab[_0xa9a2('0x1d')]({'transcribeStatus':_0xa9a2('0x2f'),'failureReason':_0x1c2ae9[_0xa9a2('0x13')][_0xa9a2('0x30')]})[_0xa9a2('0x11')](function(){logger[_0xa9a2('0xa')](util[_0xa9a2('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x451dab['id']));_0x3d7d7f();});default:logger['info'](util[_0xa9a2('0xb')](_0xa9a2('0x31'),_0x451dab['id']));break;}}else{return BPromise[_0xa9a2('0x32')]()[_0xa9a2('0x11')](function(){if(!_0x451dab['tempSentiment']){throw new db[(_0xa9a2('0x22'))][(_0xa9a2('0x1f'))](_0xa9a2('0x20'));}if(!_0x23ecb0[_0xa9a2('0x33')]||!_0x23ecb0[_0xa9a2('0x25')]||!_0x23ecb0['sentimentRegion']||!_0x23ecb0[_0xa9a2('0x29')]||!_0x23ecb0[_0xa9a2('0x21')]){throw new db[(_0xa9a2('0x22'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x451dab[_0xa9a2('0x15')]){throw new Error('Transcript\x20not\x20available');}if(_0x23ecb0[_0xa9a2('0x25')]===_0x4f8625['id']){return _0x4f8625;}else{return db[_0xa9a2('0x26')][_0xa9a2('0x34')]({'where':{'id':_settings[_0xa9a2('0x25')]}});}})[_0xa9a2('0x11')](function(_0x12bc01){if(!_0x12bc01){throw new db[(_0xa9a2('0x22'))][(_0xa9a2('0x1f'))](_0xa9a2('0x27'));}if(!_0x12bc01[_0xa9a2('0xe')]||!_0x12bc01[_0xa9a2('0xf')]){throw new db['Sequelize'][(_0xa9a2('0x1f'))](_0xa9a2('0x28'));}_0x236659=_0x12bc01;logger[_0xa9a2('0xa')](util[_0xa9a2('0xb')](_0xa9a2('0x35'),_0x451dab['id']));return sentiment(_0x236659[_0xa9a2('0xe')],_0x236659[_0xa9a2('0xf')],_0x23ecb0[_0xa9a2('0x36')],_0x451dab[_0xa9a2('0x15')],_0x23ecb0[_0xa9a2('0x29')]);})['then'](function(_0x6bd4a8){logger[_0xa9a2('0xa')](util['format'](_0xa9a2('0x37'),_0x451dab['id']));return _0x451dab[_0xa9a2('0x1d')]({'sentiment':_0x6bd4a8['Sentiment'],'sPositive':_0x6bd4a8[_0xa9a2('0x2b')][_0xa9a2('0x38')],'sNegative':_0x6bd4a8['SentimentScore'][_0xa9a2('0x2c')],'sMixed':_0x6bd4a8['SentimentScore']['Mixed'],'sNeutral':_0x6bd4a8[_0xa9a2('0x2b')][_0xa9a2('0x2d')],'transcribeStatus':_0xa9a2('0x16')});})[_0xa9a2('0x11')](function(){logger[_0xa9a2('0xa')](util[_0xa9a2('0xb')](_0xa9a2('0x2e'),_0x451dab['id']));_0x3d7d7f();});}})[_0xa9a2('0x39')](function(_0x3a0934){if(_0x3a0934){if(!_0x3a0934[_0xa9a2('0x3a')]||_0x3a0934['name']!==_0xa9a2('0x3b')){logger[_0xa9a2('0x3c')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x451dab['id']),util[_0xa9a2('0x3d')](_0x3a0934,{'showHidden':![],'depth':null}));}}_0x3d7d7f();});});}function checkTranscribe(){var _0x5857f9;var _0x4dcc70;var _0x1ffff1;return db[_0xa9a2('0x3e')][_0xa9a2('0x3f')]({'where':{'transcribeStatus':_0xa9a2('0x40')}})[_0xa9a2('0x11')](function(_0x10d7c1){if(!_0x10d7c1||!_0x10d7c1[_0xa9a2('0x1b')]){throw new db['Sequelize'][(_0xa9a2('0x1f'))](_0xa9a2('0x41'));}_0x5857f9=_0x10d7c1;return db['Setting'][_0xa9a2('0x34')]({'where':{'id':0x1}});})[_0xa9a2('0x11')](function(_0x49e5de){if(!_0x49e5de){throw new db[(_0xa9a2('0x22'))][(_0xa9a2('0x1f'))](_0xa9a2('0x42'));}_0x4dcc70=_0x49e5de;if(!_0x4dcc70['transcribe']||!_0x4dcc70[_0xa9a2('0x43')]||!_0x4dcc70['transcribeRegion']||!_0x4dcc70['language']||!_0x4dcc70[_0xa9a2('0x21')]){throw new db[(_0xa9a2('0x22'))][(_0xa9a2('0x1f'))]('Transcribe\x20not\x20configured');}return db[_0xa9a2('0x26')][_0xa9a2('0x34')]({'where':{'id':_0x4dcc70[_0xa9a2('0x43')]}});})[_0xa9a2('0x11')](function(_0x5c5d6f){if(!_0x5c5d6f){throw new db[(_0xa9a2('0x22'))]['ValidationError'](_0xa9a2('0x27'));}if(!_0x5c5d6f[_0xa9a2('0xe')]||!_0x5c5d6f['data2']){throw new db['Sequelize']['ValidationError'](_0xa9a2('0x28'));}_0x1ffff1=_0x5c5d6f;var _0x3fcf76=[];_0x5857f9['forEach'](function(_0x1c53e6){_0x3fcf76[_0xa9a2('0x44')](checkTranscribeJob(_0x1c53e6,_0x4dcc70,_0x1ffff1));});return BPromise[_0xa9a2('0x45')](_0x3fcf76);})[_0xa9a2('0x39')](function(_0x40b6c1){if(_0x40b6c1){if(!_0x40b6c1[_0xa9a2('0x3a')]||_0x40b6c1[_0xa9a2('0x3a')]!==_0xa9a2('0x3b')){logger[_0xa9a2('0x3c')](util[_0xa9a2('0x3d')](_0x40b6c1,{'showHidden':![],'depth':null}));}}});}exports[_0xa9a2('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x3c1a=['getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','Positive','SentimentScore','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','COMPLETED','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','findOne','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','push','all','catch','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger'];(function(_0x31ae8c,_0x43e96a){var _0x38d150=function(_0x3c7ba9){while(--_0x3c7ba9){_0x31ae8c['push'](_0x31ae8c['shift']());}};_0x38d150(++_0x43e96a);}(_0x3c1a,0xda));var _0xa3c1=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0x3c1a[_0x4f4d19];return _0x27a258;};var _=require(_0xa3c1('0x0'));var AWS=require(_0xa3c1('0x1'));var rp=require(_0xa3c1('0x2'));var util=require(_0xa3c1('0x3'));var BPromise=require(_0xa3c1('0x4'));var db=require(_0xa3c1('0x5'))['db'];var logger=require(_0xa3c1('0x6'))('transcribe');function getTranscriptionJob(_0x3db9f5,_0x49c688,_0x28713f,_0x8e2873){return new Promise(function(_0x3f6cab,_0x2da4d2){var _0x546253=new AWS['TranscribeService']({'accessKeyId':_0x49c688,'secretAccessKey':_0x3db9f5,'region':_0x28713f});_0x546253[_0xa3c1('0x7')]({'TranscriptionJobName':_0x8e2873},function(_0x1aa471,_0x3a4718){if(_0x1aa471){return _0x2da4d2(_0x1aa471);}else{return _0x3f6cab(_0x3a4718);}});});}function sentiment(_0x1e45c6,_0x37d41f,_0x4fac66,_0x131819,_0x562038){return new Promise(function(_0x58c6f5,_0x5155ee){var _0x57590c=new AWS[(_0xa3c1('0x8'))]({'accessKeyId':_0x37d41f,'secretAccessKey':_0x1e45c6,'region':_0x4fac66});_0x57590c[_0xa3c1('0x9')]({'Text':_0x131819,'LanguageCode':_0x562038[_0xa3c1('0xa')](0x0,0x2)},function(_0x183039,_0x8d232d){if(_0x183039){return _0x5155ee(_0x183039);}else{return _0x58c6f5(_0x8d232d);}});});}function checkTranscribeJob(_0x1ce473,_0x1ece52,_0x52adac){var _0x2d2499;return new BPromise(function(_0x3b86be,_0x26cab0){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0xd'),_0x1ce473['id'],_0x1ce473[_0xa3c1('0xe')]));return getTranscriptionJob(_0x52adac['data1'],_0x52adac[_0xa3c1('0xf')],_0x1ece52[_0xa3c1('0x10')],_0x1ce473['transcribeName'])[_0xa3c1('0x11')](function(_0x19d4d1){logger['info'](util['format'](_0xa3c1('0x12'),_0x1ce473['id'],_0x1ce473['transcribeName'],_0x19d4d1[_0xa3c1('0x13')]['TranscriptionJobStatus']));if(!_0x1ce473['fileText']){switch(_0x19d4d1[_0xa3c1('0x13')]['TranscriptionJobStatus']){case'COMPLETED':var _0x3655c7={'transcribeStatus':_0x19d4d1[_0xa3c1('0x13')]['TranscriptionJobStatus'],'fileUri':_0x19d4d1['TranscriptionJob']['Transcript'][_0xa3c1('0x14')]};logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x15'),_0x1ce473['id']));return rp({'uri':_0x19d4d1[_0xa3c1('0x13')]['Transcript'][_0xa3c1('0x14')],'json':!![]})['then'](function(_0x5b8a54){logger['info'](util['format'](_0xa3c1('0x16'),_0x1ce473['id']));if(_0x5b8a54&&_0x5b8a54[_0xa3c1('0x17')]&&_0x5b8a54[_0xa3c1('0x17')][_0xa3c1('0x18')]&&_0x5b8a54['results'][_0xa3c1('0x18')][_0xa3c1('0x19')]){_0x3655c7[_0xa3c1('0x1a')]='';for(var _0xe77418=0x0;_0xe77418<_0x5b8a54['results']['transcripts'][_0xa3c1('0x19')];_0xe77418++){_0x3655c7['fileText']+=_0x5b8a54[_0xa3c1('0x17')][_0xa3c1('0x18')][_0xe77418][_0xa3c1('0x1b')]+'';}}return _0x1ce473[_0xa3c1('0x1c')](_0x3655c7);})[_0xa3c1('0x11')](function(){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x1d'),_0x1ce473['id']));if(!_0x1ce473['tempSentiment']){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x20'));}if(!_0x1ece52[_0xa3c1('0x21')]||!_0x1ece52[_0xa3c1('0x22')]||!_0x1ece52[_0xa3c1('0x23')]||!_0x1ece52[_0xa3c1('0x24')]||!_0x1ece52[_0xa3c1('0x25')]){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x26'));}if(!_0x3655c7[_0xa3c1('0x1a')]){throw new Error(_0xa3c1('0x27'));}if(_0x1ece52[_0xa3c1('0x22')]===_0x52adac['id']){return _0x52adac;}else{return db[_0xa3c1('0x28')]['findOne']({'where':{'id':_settings[_0xa3c1('0x22')]}});}})[_0xa3c1('0x11')](function(_0x15a8f3){if(!_0x15a8f3){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x29'));}if(!_0x15a8f3[_0xa3c1('0x2a')]||!_0x15a8f3[_0xa3c1('0xf')]){throw new db[(_0xa3c1('0x1e'))]['ValidationError'](_0xa3c1('0x2b'));}_0x2d2499=_0x15a8f3;logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x2c'),_0x1ce473['id']));return sentiment(_0x2d2499[_0xa3c1('0x2a')],_0x2d2499[_0xa3c1('0xf')],_0x1ece52[_0xa3c1('0x23')],_0x3655c7[_0xa3c1('0x1a')],_0x1ece52[_0xa3c1('0x24')]);})[_0xa3c1('0x11')](function(_0x14e798){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x1ce473['id']));return _0x1ce473[_0xa3c1('0x1c')]({'sentiment':_0x14e798[_0xa3c1('0x2d')],'sPositive':_0x14e798['SentimentScore'][_0xa3c1('0x2e')],'sNegative':_0x14e798['SentimentScore']['Negative'],'sMixed':_0x14e798[_0xa3c1('0x2f')][_0xa3c1('0x30')],'sNeutral':_0x14e798['SentimentScore'][_0xa3c1('0x31')]});})['then'](function(){logger['info'](util['format'](_0xa3c1('0x1d'),_0x1ce473['id']));_0x3b86be();});case'FAILED':return _0x1ce473[_0xa3c1('0x1c')]({'transcribeStatus':_0xa3c1('0x32'),'failureReason':_0x19d4d1['TranscriptionJob']['FailureReason']})[_0xa3c1('0x11')](function(){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1ce473['id']));_0x3b86be();});default:logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x33'),_0x1ce473['id']));break;}}else{return BPromise[_0xa3c1('0x34')]()['then'](function(){if(!_0x1ce473[_0xa3c1('0x35')]){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x20'));}if(!_0x1ece52[_0xa3c1('0x21')]||!_0x1ece52[_0xa3c1('0x22')]||!_0x1ece52['sentimentRegion']||!_0x1ece52[_0xa3c1('0x24')]||!_0x1ece52['bucket']){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x26'));}if(!_0x1ce473[_0xa3c1('0x1a')]){throw new Error(_0xa3c1('0x27'));}if(_0x1ece52[_0xa3c1('0x22')]===_0x52adac['id']){return _0x52adac;}else{return db[_0xa3c1('0x28')]['findOne']({'where':{'id':_settings[_0xa3c1('0x22')]}});}})[_0xa3c1('0x11')](function(_0x29178d){if(!_0x29178d){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x29'));}if(!_0x29178d[_0xa3c1('0x2a')]||!_0x29178d[_0xa3c1('0xf')]){throw new db['Sequelize']['ValidationError'](_0xa3c1('0x2b'));}_0x2d2499=_0x29178d;logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x2c'),_0x1ce473['id']));return sentiment(_0x2d2499[_0xa3c1('0x2a')],_0x2d2499[_0xa3c1('0xf')],_0x1ece52['sentimentRegion'],_0x1ce473[_0xa3c1('0x1a')],_0x1ece52[_0xa3c1('0x24')]);})[_0xa3c1('0x11')](function(_0x2f99a1){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')](_0xa3c1('0x36'),_0x1ce473['id']));return _0x1ce473[_0xa3c1('0x1c')]({'sentiment':_0x2f99a1[_0xa3c1('0x2d')],'sPositive':_0x2f99a1[_0xa3c1('0x2f')][_0xa3c1('0x2e')],'sNegative':_0x2f99a1[_0xa3c1('0x2f')][_0xa3c1('0x37')],'sMixed':_0x2f99a1[_0xa3c1('0x2f')]['Mixed'],'sNeutral':_0x2f99a1[_0xa3c1('0x2f')][_0xa3c1('0x31')],'transcribeStatus':_0xa3c1('0x38')});})[_0xa3c1('0x11')](function(){logger[_0xa3c1('0xb')](util[_0xa3c1('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1ce473['id']));_0x3b86be();});}})['catch'](function(_0x521364){if(_0x521364){if(!_0x521364['name']||_0x521364[_0xa3c1('0x39')]!==_0xa3c1('0x3a')){logger[_0xa3c1('0x3b')](util[_0xa3c1('0xc')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x1ce473['id']),util[_0xa3c1('0x3c')](_0x521364,{'showHidden':![],'depth':null}));}}_0x3b86be();});});}function checkTranscribe(){var _0x37c682;var _0x406268;var _0x3c068e;return db[_0xa3c1('0x3d')][_0xa3c1('0x3e')]({'where':{'transcribeStatus':_0xa3c1('0x3f')}})[_0xa3c1('0x11')](function(_0x39129f){if(!_0x39129f||!_0x39129f[_0xa3c1('0x19')]){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x40'));}_0x37c682=_0x39129f;return db[_0xa3c1('0x41')][_0xa3c1('0x42')]({'where':{'id':0x1}});})[_0xa3c1('0x11')](function(_0x5d78ef){if(!_0x5d78ef){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x43'));}_0x406268=_0x5d78ef;if(!_0x406268[_0xa3c1('0x44')]||!_0x406268[_0xa3c1('0x45')]||!_0x406268[_0xa3c1('0x10')]||!_0x406268[_0xa3c1('0x24')]||!_0x406268['bucket']){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x46'));}return db[_0xa3c1('0x28')][_0xa3c1('0x42')]({'where':{'id':_0x406268[_0xa3c1('0x45')]}});})['then'](function(_0x1e8a29){if(!_0x1e8a29){throw new db['Sequelize']['ValidationError'](_0xa3c1('0x29'));}if(!_0x1e8a29[_0xa3c1('0x2a')]||!_0x1e8a29[_0xa3c1('0xf')]){throw new db[(_0xa3c1('0x1e'))][(_0xa3c1('0x1f'))](_0xa3c1('0x2b'));}_0x3c068e=_0x1e8a29;var _0x1a062f=[];_0x37c682['forEach'](function(_0x2a7153){_0x1a062f[_0xa3c1('0x47')](checkTranscribeJob(_0x2a7153,_0x406268,_0x3c068e));});return BPromise[_0xa3c1('0x48')](_0x1a062f);})[_0xa3c1('0x49')](function(_0x3ebc72){if(_0x3ebc72){if(!_0x3ebc72[_0xa3c1('0x39')]||_0x3ebc72[_0xa3c1('0x39')]!==_0xa3c1('0x3a')){logger['error'](util[_0xa3c1('0x3c')](_0x3ebc72,{'showHidden':![],'depth':null}));}}});}exports[_0xa3c1('0x4a')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index 8f93001..1364743 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff1c=['localhost','socket.io-emitter','WhatsappInteraction','subtract','hours','length','map','info','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults'];(function(_0x15fc3c,_0x35665b){var _0x94c5c8=function(_0xbab268){while(--_0xbab268){_0x15fc3c['push'](_0x15fc3c['shift']());}};_0x94c5c8(++_0x35665b);}(_0xff1c,0xdf));var _0xcff1=function(_0x3e9ec1,_0x30d2c8){_0x3e9ec1=_0x3e9ec1-0x0;var _0x251191=_0xff1c[_0x3e9ec1];return _0x251191;};'use strict';var _=require(_0xcff1('0x0'));var moment=require('moment');var Redis=require(_0xcff1('0x1'));var util=require(_0xcff1('0x2'));var config=require(_0xcff1('0x3'));var db=require(_0xcff1('0x4'))['db'];var logger=require(_0xcff1('0x5'))(_0xcff1('0x6'));config[_0xcff1('0x7')]=_[_0xcff1('0x8')](config[_0xcff1('0x7')],{'host':_0xcff1('0x9'),'port':0x18eb});var io=require(_0xcff1('0xa'))(new Redis(config[_0xcff1('0x7')]));function closeInteractions(){var _0x4cae2a=[];return db[_0xcff1('0xb')]['findAll']({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xcff1('0xc')](0x18,_0xcff1('0xd'))}}})['then'](function(_0x4c20a3){if(_0x4c20a3&&_0x4c20a3[_0xcff1('0xe')]){_0x4cae2a=_[_0xcff1('0xf')](_0x4c20a3||[],'id');logger[_0xcff1('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x4cae2a['join']());return db[_0xcff1('0xb')][_0xcff1('0x11')]({'closeReason':_0xcff1('0x12'),'disposition':_0xcff1('0x13'),'closed':!![],'closedAt':moment()[_0xcff1('0x14')](_0xcff1('0x15'))},{'where':{'id':_0x4cae2a}});}})[_0xcff1('0x16')](function(){if(_0x4cae2a&&_0x4cae2a[_0xcff1('0xe')]){logger[_0xcff1('0x10')](_0xcff1('0x17'),_0x4cae2a['join']());for(var _0x4e310d=0x0;_0x4e310d<_0x4cae2a[_0xcff1('0xe')];_0x4e310d++){io[_0xcff1('0x18')]('whatsappInteraction:update',{'id':_0x4cae2a[_0x4e310d],'closed':!![]});}}})[_0xcff1('0x19')](function(_0x45d7ef){logger[_0xcff1('0x1a')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x45d7ef?util[_0xcff1('0x1b')](_0x45d7ef,{'showHidden':![],'depth':null}):'');});}exports[_0xcff1('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xf9b2=['info','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','whatsappInteraction:update','error','inspect','start','lodash','ioredis','../../config/environment','../../mysqldb','schedule','redis','defaults','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','map'];(function(_0x3fbcb6,_0x1c44fe){var _0x1a9d88=function(_0x373800){while(--_0x373800){_0x3fbcb6['push'](_0x3fbcb6['shift']());}};_0x1a9d88(++_0x1c44fe);}(_0xf9b2,0x99));var _0x2f9b=function(_0x2703ab,_0x759063){_0x2703ab=_0x2703ab-0x0;var _0x5e21dd=_0xf9b2[_0x2703ab];return _0x5e21dd;};'use strict';var _=require(_0x2f9b('0x0'));var moment=require('moment');var Redis=require(_0x2f9b('0x1'));var util=require('util');var config=require(_0x2f9b('0x2'));var db=require(_0x2f9b('0x3'))['db'];var logger=require('../logger')(_0x2f9b('0x4'));config[_0x2f9b('0x5')]=_[_0x2f9b('0x6')](config[_0x2f9b('0x5')],{'host':_0x2f9b('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2f9b('0x5')]));function closeInteractions(){var _0x6262e=[];return db[_0x2f9b('0x8')][_0x2f9b('0x9')]({'raw':!![],'attributes':['id',_0x2f9b('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x2f9b('0xb')](0x18,'hours')}}})[_0x2f9b('0xc')](function(_0x192828){if(_0x192828&&_0x192828[_0x2f9b('0xd')]){_0x6262e=_[_0x2f9b('0xe')](_0x192828||[],'id');logger[_0x2f9b('0xf')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x6262e['join']());return db[_0x2f9b('0x8')][_0x2f9b('0x10')]({'closeReason':_0x2f9b('0x11'),'disposition':_0x2f9b('0x12'),'closed':!![],'closedAt':moment()[_0x2f9b('0x13')](_0x2f9b('0x14'))},{'where':{'id':_0x6262e}});}})[_0x2f9b('0xc')](function(){if(_0x6262e&&_0x6262e[_0x2f9b('0xd')]){logger[_0x2f9b('0xf')](_0x2f9b('0x15'),_0x6262e[_0x2f9b('0x16')]());for(var _0x577207=0x0;_0x577207<_0x6262e[_0x2f9b('0xd')];_0x577207++){io[_0x2f9b('0x17')](_0x2f9b('0x18'),{'id':_0x6262e[_0x577207],'closed':!![]});}}})['catch'](function(_0xe7bdd){logger[_0x2f9b('0x19')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0xe7bdd?util[_0x2f9b('0x1a')](_0xe7bdd,{'showHidden':![],'depth':null}):'');});}exports[_0x2f9b('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 2e65f7f..b0b5344 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x00d9=['bulkCreate','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','log','contacts1','then','CmHopper','finished\x20populating','hopper1'];(function(_0x1ba150,_0x26fc23){var _0x2dc092=function(_0x3efe52){while(--_0x3efe52){_0x1ba150['push'](_0x1ba150['shift']());}};_0x2dc092(++_0x26fc23);}(_0x00d9,0x10d));var _0x900d=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x00d9[_0xd1d19a];return _0x52a79d;};'use strict';var util=require(_0x900d('0x0'));var db=require(_0x900d('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x900d('0x2')]({'id':i,'firstName':_0x900d('0x3')+i,'lastName':_0x900d('0x4')+i,'phone':0xf879fb460+i,'email':_0x900d('0x5')+i+_0x900d('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x900d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x900d('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x900d('0x7')](),'updatedAt':Date[_0x900d('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x900d('0x2')]({'id':i,'firstName':_0x900d('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x900d('0x5')+i+_0x900d('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x900d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x900d('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x900d('0x7')]()});}db[_0x900d('0x8')][_0x900d('0x9')]({'where':{}})['then'](function(){return db[_0x900d('0x8')]['bulkCreate'](contacts);})['then'](function(){console[_0x900d('0xa')]('finished\x20populating',_0x900d('0xb'));return db['CmHopper'][_0x900d('0x9')]({'where':{}});})[_0x900d('0xc')](function(){return db[_0x900d('0xd')]['bulkCreate'](hopper);})['then'](function(){console['log'](_0x900d('0xe'),_0x900d('0xf'));return db[_0x900d('0x8')][_0x900d('0x10')](contacts2);})['then'](function(){console['log'](_0x900d('0xe'),'contacts2');return db['CmHopper']['bulkCreate'](hopper2);})[_0x900d('0xc')](function(){console[_0x900d('0xa')](_0x900d('0xe'),_0x900d('0x11'));})[_0x900d('0x12')](function(_0x35f9f2){console['log'](_0x35f9f2);});
\ No newline at end of file
+var _0x6d36=['../mysqldb','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','push','CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper','contacts2','finished\x20populating','hopper2','catch','util'];(function(_0x2b7d41,_0x2844d7){var _0x356360=function(_0x10adc5){while(--_0x10adc5){_0x2b7d41['push'](_0x2b7d41['shift']());}};_0x356360(++_0x2844d7);}(_0x6d36,0x1ed));var _0x66d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6d36[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x66d3('0x0'));var db=require(_0x66d3('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x66d3('0x2')+i,'phone':0xf879fb460+i,'email':_0x66d3('0x3')+i+_0x66d3('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x66d3('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x66d3('0x5')](),'updatedAt':Date[_0x66d3('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x66d3('0x6')+i,'lastName':_0x66d3('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x66d3('0x7')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x66d3('0x5')](),'updatedAt':Date[_0x66d3('0x5')]()});}db[_0x66d3('0x8')][_0x66d3('0x9')]({'where':{}})[_0x66d3('0xa')](function(){return db[_0x66d3('0x8')][_0x66d3('0xb')](contacts);})['then'](function(){console[_0x66d3('0xc')]('finished\x20populating',_0x66d3('0xd'));return db['CmHopper'][_0x66d3('0x9')]({'where':{}});})['then'](function(){return db[_0x66d3('0xe')][_0x66d3('0xb')](hopper);})[_0x66d3('0xa')](function(){console[_0x66d3('0xc')]('finished\x20populating','hopper1');return db['CmContact']['bulkCreate'](contacts2);})[_0x66d3('0xa')](function(){console['log']('finished\x20populating',_0x66d3('0xf'));return db['CmHopper']['bulkCreate'](hopper2);})['then'](function(){console[_0x66d3('0xc')](_0x66d3('0x10'),_0x66d3('0x11'));})[_0x66d3('0x12')](function(_0x304a7a){console[_0x66d3('0xc')](_0x304a7a);});
\ No newline at end of file
index 8e85523..7d3e704 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e42=['friend','udp','wss','all','ulaw','yes','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user','catch','format','%s%s','agent','password'];(function(_0x29ae80,_0x3579f1){var _0x5d6d71=function(_0xfaffe2){while(--_0xfaffe2){_0x29ae80['push'](_0x29ae80['shift']());}};_0x5d6d71(++_0x3579f1);}(_0x7e42,0x1b6));var _0x27e4=function(_0x12e7a6,_0x5d16c4){_0x12e7a6=_0x12e7a6-0x0;var _0x283d43=_0x7e42[_0x12e7a6];return _0x283d43;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x27e4('0x0')](_0x27e4('0x1'),_0x27e4('0x2'),i),'fullname':util[_0x27e4('0x0')](_0x27e4('0x1'),_0x27e4('0x2'),i),'email':util[_0x27e4('0x0')]('%s%s@xcally.com',_0x27e4('0x2'),i),'role':'agent','password':_0x27e4('0x3'),'internal':0xfa0+i,'type':_0x27e4('0x4'),'transport':[_0x27e4('0x5'),'ws',_0x27e4('0x6')],'disallow':[_0x27e4('0x7')],'allow':[_0x27e4('0x8')],'defaultuser':util[_0x27e4('0x0')](_0x27e4('0x1'),_0x27e4('0x2'),i),'encryption':'yes','avpf':_0x27e4('0x9'),'force_avp':'yes','icesupport':_0x27e4('0x9'),'dtlsenable':_0x27e4('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x27e4('0xa'),'callerid':util['format'](_0x27e4('0xb'),util[_0x27e4('0x0')](_0x27e4('0x1'),'agent',i),0xfa0+i)});}db[_0x27e4('0xc')][_0x27e4('0xd')](users)[_0x27e4('0xe')](function(){console['log'](_0x27e4('0xf'));})[_0x27e4('0x10')](function(_0xce0a90){console['log'](_0xce0a90);});
\ No newline at end of file
+var _0x0fca=['then','log','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','User'];(function(_0x4c9f6a,_0xcb2cb2){var _0x5df5b9=function(_0x303cf2){while(--_0x303cf2){_0x4c9f6a['push'](_0x4c9f6a['shift']());}};_0x5df5b9(++_0xcb2cb2);}(_0x0fca,0x1cd));var _0xa0fc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0fca[_0x2641f9];return _0x585741;};'use strict';var util=require('util');var db=require(_0xa0fc('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xa0fc('0x1')]({'name':util[_0xa0fc('0x2')](_0xa0fc('0x3'),_0xa0fc('0x4'),i),'fullname':util[_0xa0fc('0x2')](_0xa0fc('0x3'),_0xa0fc('0x4'),i),'email':util['format'](_0xa0fc('0x5'),_0xa0fc('0x4'),i),'role':_0xa0fc('0x4'),'password':_0xa0fc('0x6'),'internal':0xfa0+i,'type':_0xa0fc('0x7'),'transport':[_0xa0fc('0x8'),'ws',_0xa0fc('0x9')],'disallow':[_0xa0fc('0xa')],'allow':['ulaw'],'defaultuser':util[_0xa0fc('0x2')]('%s%s',_0xa0fc('0x4'),i),'encryption':_0xa0fc('0xb'),'avpf':'yes','force_avp':_0xa0fc('0xb'),'icesupport':_0xa0fc('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xa0fc('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0xa0fc('0x2')](_0xa0fc('0xd'),util[_0xa0fc('0x2')](_0xa0fc('0x3'),_0xa0fc('0x4'),i),0xfa0+i)});}db[_0xa0fc('0xe')]['bulkCreate'](users)[_0xa0fc('0xf')](function(){console['log']('add\x20user');})['catch'](function(_0x188d47){console[_0xa0fc('0x10')](_0x188d47);});
\ No newline at end of file
index 12d2736..1cb96cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe928=['removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','Agents','User','name','role','agent','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','telephone','Campaign','type','length','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','SmsInteraction','OpenchannelInteraction','WhatsappInteraction','admin','voice:inbound','hasOwnProperty','include','push','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','voice:outbound','SmsQueues','WhatsappQueue','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove'];(function(_0x37f8e8,_0xe8c722){var _0x446da5=function(_0x56d0db){while(--_0x56d0db){_0x37f8e8['push'](_0x37f8e8['shift']());}};_0x446da5(++_0xe8c722);}(_0xe928,0x145));var _0x8e92=function(_0x417d30,_0x443740){_0x417d30=_0x417d30-0x0;var _0x69a793=_0xe928[_0x417d30];return _0x69a793;};'use strict';var _=require(_0x8e92('0x0'));var util=require(_0x8e92('0x1'));var BPromise=require(_0x8e92('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x8e92('0x3'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x8e92('0x4'),'model':db[_0x8e92('0x5')],'attributes':['id',_0x8e92('0x6'),_0x8e92('0x7')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x8e92('0x6')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x8e92('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x8e92('0x6')],'where':{'role':_0x8e92('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x8e92('0x6'),'type'],'where':{'type':_0x8e92('0x9')}};function getAssociatedResources(_0x594b63,_0x439990,_0x8cc27a){return db[_0x8e92('0xa')][_0x8e92('0xb')]({'where':{'name':_0x594b63,'userProfileId':_0x439990},'raw':!![]})[_0x8e92('0xc')](function(_0x79e446){if(_0x79e446){if(_0x79e446['autoAssociation']){switch(_0x594b63){case _0x8e92('0xd'):case _0x8e92('0xe'):case _0x8e92('0xf'):case'SmsQueues':case _0x8e92('0x10'):case _0x8e92('0x11'):case _0x8e92('0x12'):return db[_0x8cc27a][_0x8e92('0x13')](queryQueues);case _0x8e92('0x14'):return db[_0x8cc27a][_0x8e92('0x13')](queryTelephones);case _0x8e92('0x15'):return db[_0x8cc27a]['findAll'](queryTrunks);case _0x8e92('0x16'):return db[_0x8cc27a]['findAll'](queryCampaigns);}}else{return db[_0x8e92('0x17')][_0x8e92('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x79e446['id']},'raw':!![]})[_0x8e92('0xc')](function(_0x57ff38){if(_0x57ff38){var _0x1d866f={'where':{'id':_[_0x8e92('0x18')](_0x57ff38,_0x8e92('0x19'))},'raw':!![]};switch(_0x8cc27a){case _0x8e92('0x5'):_0x1d866f[_0x8e92('0x1a')][_0x8e92('0x7')]=_0x8e92('0x1b');break;case _0x8e92('0x1c'):_0x1d866f['where'][_0x8e92('0x1d')]=_0x8e92('0x9');break;}return db[_0x8cc27a][_0x8e92('0x13')](_0x1d866f);}else{return[];}});}}else{return[];}})[_0x8e92('0xc')](function(_0x250988){return _0x250988;});}function joinOrLeaveQueues(_0x5ab67b,_0x261b07,_0x263f05,_0x5355a4){_0x5ab67b[_0x261b07](util['format']('%s:queue:%s',_0x263f05,_0x5355a4[_0x8e92('0x6')]));if(_0x5355a4['Agents']){for(var _0x3d23f1=0x0;_0x3d23f1<_0x5355a4[_0x8e92('0x4')][_0x8e92('0x1e')];_0x3d23f1+=0x1){_0x5ab67b[_0x261b07](util[_0x8e92('0x1f')](_0x8e92('0x20'),_0x5355a4[_0x8e92('0x4')][_0x3d23f1]['name']));}}}function joinOrLeave(_0x51499f,_0x53b5aa,_0x5b5ea2){var _0x322765;if(_0x51499f[_0x8e92('0x21')][_0x8e92('0x22')]['id']){db[_0x8e92('0x5')][_0x8e92('0x23')]({'attributes':['id',_0x8e92('0x6'),'role',_0x8e92('0x24')],'where':{'id':_0x51499f[_0x8e92('0x21')][_0x8e92('0x22')]['id']},'include':[{'model':db[_0x8e92('0x25')],'as':_0x8e92('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x8e92('0x27')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8e92('0x28')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8e92('0x29')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x8e92('0x2a')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0x8e92('0xc')](function(_0x57c4de){if(_0x57c4de){_0x322765=_0x57c4de;_0x51499f[_0x53b5aa](util[_0x8e92('0x1f')](_0x8e92('0x20'),_0x57c4de[_0x8e92('0x6')]));var _0x115789=[];switch(_0x57c4de['role']){case _0x8e92('0x2b'):_0x51499f[_0x53b5aa](_0x8e92('0x2c'));_0x51499f[_0x53b5aa]('voice:outbound');if(queryQueues[_0x8e92('0x2d')]('include')){delete queryQueues[_0x8e92('0x2e')];}_0x115789[_0x8e92('0x2f')](db['VoiceQueue'][_0x8e92('0x13')](queryQueues));_0x115789[_0x8e92('0x2f')](db[_0x8e92('0x30')][_0x8e92('0x13')](queryQueues));_0x115789[_0x8e92('0x2f')](db[_0x8e92('0x31')][_0x8e92('0x13')](queryQueues));_0x115789[_0x8e92('0x2f')](db[_0x8e92('0x32')]['findAll'](queryQueues));_0x115789['push'](db[_0x8e92('0x33')]['findAll'](queryQueues));_0x115789['push'](db[_0x8e92('0x34')][_0x8e92('0x13')](queryQueues));_0x115789[_0x8e92('0x2f')](db['WhatsappQueue'][_0x8e92('0x13')](queryQueues));_0x115789[_0x8e92('0x2f')](db[_0x8e92('0x5')]['findAll'](queryTelephones));_0x115789['push'](db[_0x8e92('0x35')]['findAll'](queryTrunks));_0x115789[_0x8e92('0x2f')](db[_0x8e92('0x1c')][_0x8e92('0x13')](queryCampaigns));_0x115789[_0x8e92('0x2f')](db[_0x8e92('0x5')]['findAll'](queryAgents));break;case _0x8e92('0x36'):_0x51499f[_0x53b5aa](_0x8e92('0x2c'));_0x51499f[_0x53b5aa](_0x8e92('0x37'));_0x115789['push'](getAssociatedResources('VoiceQueues',_0x57c4de[_0x8e92('0x24')],'VoiceQueue'));_0x115789[_0x8e92('0x2f')](getAssociatedResources(_0x8e92('0xe'),_0x57c4de[_0x8e92('0x24')],_0x8e92('0x30')));_0x115789['push'](getAssociatedResources('FaxQueues',_0x57c4de['userProfileId'],_0x8e92('0x31')));_0x115789['push'](getAssociatedResources(_0x8e92('0x38'),_0x57c4de['userProfileId'],'SmsQueue'));_0x115789['push'](getAssociatedResources(_0x8e92('0x10'),_0x57c4de[_0x8e92('0x24')],_0x8e92('0x33')));_0x115789[_0x8e92('0x2f')](getAssociatedResources(_0x8e92('0x11'),_0x57c4de[_0x8e92('0x24')],'OpenchannelQueue'));_0x115789[_0x8e92('0x2f')](getAssociatedResources(_0x8e92('0x12'),_0x57c4de[_0x8e92('0x24')],_0x8e92('0x39')));_0x115789['push'](getAssociatedResources(_0x8e92('0x14'),_0x57c4de[_0x8e92('0x24')],'User'));_0x115789[_0x8e92('0x2f')](getAssociatedResources(_0x8e92('0x15'),_0x57c4de['userProfileId'],'Trunk'));_0x115789[_0x8e92('0x2f')](getAssociatedResources('IvrCampaigns',_0x57c4de['userProfileId'],_0x8e92('0x1c')));_0x115789[_0x8e92('0x2f')](db[_0x8e92('0x5')]['findAll'](queryAgents));break;case _0x8e92('0x8'):_0x51499f[_0x53b5aa](_0x8e92('0x2c'));_0x51499f[_0x53b5aa](_0x8e92('0x37'));_0x115789[_0x8e92('0x2f')](_0x57c4de['getVoiceQueues']({'attributes':['id',_0x8e92('0x6')]}));_0x115789['push'](_0x57c4de[_0x8e92('0x3a')]({'attributes':['id',_0x8e92('0x6')]}));_0x115789['push'](_0x57c4de[_0x8e92('0x3b')]({'attributes':['id',_0x8e92('0x6')]}));_0x115789[_0x8e92('0x2f')](_0x57c4de[_0x8e92('0x3c')]({'attributes':['id',_0x8e92('0x6')]}));_0x115789[_0x8e92('0x2f')](_0x57c4de[_0x8e92('0x3d')]({'attributes':['id',_0x8e92('0x6')]}));_0x115789[_0x8e92('0x2f')](_0x57c4de[_0x8e92('0x3e')]({'attributes':['id',_0x8e92('0x6')]}));_0x115789[_0x8e92('0x2f')](_0x57c4de['getWhatsappQueues']({'attributes':['id',_0x8e92('0x6')]}));break;}return BPromise[_0x8e92('0x3f')](_0x115789);}})[_0x8e92('0xc')](function(_0x2a4600){if(_0x2a4600&&_0x2a4600['length']){for(var _0x3dbfd9=0x0;_0x3dbfd9<_0x2a4600[_0x8e92('0x1e')];_0x3dbfd9+=0x1){for(var _0x3a1003=0x0;_0x3a1003<_0x2a4600[_0x3dbfd9]['length'];_0x3a1003+=0x1){switch(_0x3dbfd9){case 0x0:joinOrLeaveQueues(_0x51499f,_0x53b5aa,_0x8e92('0x40'),_0x2a4600[_0x3dbfd9][_0x3a1003]);break;case 0x1:joinOrLeaveQueues(_0x51499f,_0x53b5aa,_0x8e92('0x41'),_0x2a4600[_0x3dbfd9][_0x3a1003]);break;case 0x2:joinOrLeaveQueues(_0x51499f,_0x53b5aa,_0x8e92('0x42'),_0x2a4600[_0x3dbfd9][_0x3a1003]);break;case 0x3:joinOrLeaveQueues(_0x51499f,_0x53b5aa,_0x8e92('0x43'),_0x2a4600[_0x3dbfd9][_0x3a1003]);break;case 0x4:joinOrLeaveQueues(_0x51499f,_0x53b5aa,_0x8e92('0x44'),_0x2a4600[_0x3dbfd9][_0x3a1003]);break;case 0x5:joinOrLeaveQueues(_0x51499f,_0x53b5aa,_0x8e92('0x45'),_0x2a4600[_0x3dbfd9][_0x3a1003]);break;case 0x6:joinOrLeaveQueues(_0x51499f,_0x53b5aa,_0x8e92('0x46'),_0x2a4600[_0x3dbfd9][_0x3a1003]);break;case 0x7:if(_0x322765[_0x8e92('0x7')]!==_0x8e92('0x8'))_0x51499f[_0x53b5aa](util[_0x8e92('0x1f')](_0x8e92('0x47'),_0x2a4600[_0x3dbfd9][_0x3a1003][_0x8e92('0x6')]));break;case 0x8:if(_0x322765['role']!==_0x8e92('0x8'))_0x51499f[_0x53b5aa](util[_0x8e92('0x1f')](_0x8e92('0x48'),_0x2a4600[_0x3dbfd9][_0x3a1003][_0x8e92('0x6')]));break;case 0x9:if(_0x322765[_0x8e92('0x7')]!==_0x8e92('0x8'))_0x51499f[_0x53b5aa](util['format'](_0x8e92('0x49'),_0x2a4600[_0x3dbfd9][_0x3a1003][_0x8e92('0x1d')],_0x2a4600[_0x3dbfd9][_0x3a1003][_0x8e92('0x6')]));break;case 0xa:_0x51499f[_0x53b5aa](util[_0x8e92('0x1f')](_0x8e92('0x20'),_0x2a4600[_0x3dbfd9][_0x3a1003][_0x8e92('0x6')]));break;}}}}})[_0x8e92('0xc')](function(){if(_0x53b5aa===_0x8e92('0x4a')){var _0xe37dfe=_[_0x8e92('0x18')](_0x322765[_0x8e92('0x26')],'id');return _0x322765[_0x8e92('0x4b')](_0xe37dfe)[_0x8e92('0xc')](function(){for(var _0x3dbef2=0x0;_0x3dbef2<_0xe37dfe['length'];_0x3dbef2+=0x1){_0x5b5ea2[_0x8e92('0x4c')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xe37dfe[_0x3dbef2]),'UserId':Number(_0x322765['id'])});}});}})['then'](function(){if(_0x53b5aa===_0x8e92('0x4a')){var _0xacc272=_['map'](_0x322765['MailInteractions'],'id');return _0x322765[_0x8e92('0x4d')](_0xacc272)[_0x8e92('0xc')](function(){for(var _0x2abe1f=0x0;_0x2abe1f<_0xacc272[_0x8e92('0x1e')];_0x2abe1f+=0x1){_0x5b5ea2[_0x8e92('0x4c')](_0x8e92('0x4e'),{'MailInteractionId':Number(_0xacc272[_0x2abe1f]),'UserId':Number(_0x322765['id'])});}});}})[_0x8e92('0xc')](function(){if(_0x53b5aa===_0x8e92('0x4a')){var _0xc3da5f=_[_0x8e92('0x18')](_0x322765[_0x8e92('0x4f')],'id');return _0x322765[_0x8e92('0x50')](_0xc3da5f)[_0x8e92('0xc')](function(){for(var _0x3e726d=0x0;_0x3e726d<_0xc3da5f[_0x8e92('0x1e')];_0x3e726d+=0x1){_0x5b5ea2[_0x8e92('0x4c')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0xc3da5f[_0x3e726d]),'UserId':Number(_0x322765['id'])});}});}})[_0x8e92('0xc')](function(){if(_0x53b5aa===_0x8e92('0x4a')){var _0x5cf8c2=_['map'](_0x322765[_0x8e92('0x51')],'id');return _0x322765[_0x8e92('0x52')](_0x5cf8c2)[_0x8e92('0xc')](function(){for(var _0x37a56b=0x0;_0x37a56b<_0x5cf8c2[_0x8e92('0x1e')];_0x37a56b+=0x1){_0x5b5ea2['emit'](_0x8e92('0x53'),{'SmsInteractionId':Number(_0x5cf8c2[_0x37a56b]),'UserId':Number(_0x322765['id'])});}});}})['then'](function(){if(_0x53b5aa===_0x8e92('0x4a')){var _0x5d7685=_[_0x8e92('0x18')](_0x322765[_0x8e92('0x54')],'id');return _0x322765[_0x8e92('0x55')](_0x5d7685)[_0x8e92('0xc')](function(){for(var _0x124493=0x0;_0x124493<_0x5d7685[_0x8e92('0x1e')];_0x124493+=0x1){_0x5b5ea2[_0x8e92('0x4c')](_0x8e92('0x56'),{'OpenchannelInteractionId':Number(_0x5d7685[_0x124493]),'UserId':Number(_0x322765['id'])});}});}})['then'](function(){if(_0x53b5aa===_0x8e92('0x4a')){var _0x11bd42=_[_0x8e92('0x18')](_0x322765['WhatsappInteractions'],'id');return _0x322765[_0x8e92('0x57')](_0x11bd42)[_0x8e92('0xc')](function(){for(var _0x3a8880=0x0;_0x3a8880<_0x11bd42[_0x8e92('0x1e')];_0x3a8880+=0x1){_0x5b5ea2[_0x8e92('0x4c')](_0x8e92('0x58'),{'WhatsappInteractionId':Number(_0x11bd42[_0x3a8880]),'UserId':Number(_0x322765['id'])});}});}})[_0x8e92('0x59')](function(_0x5a72d9){_0x51499f[_0x8e92('0x5a')](_0x5a72d9);});}}function onDisconnect(_0x279e78,_0x341374){joinOrLeave(_0x279e78,'leave',_0x341374);}function onConnect(_0x4b1ce6){joinOrLeave(_0x4b1ce6,'join');}exports[_0x8e92('0x5b')]=function(_0x1d9ee5){_0x1d9ee5['on'](_0x8e92('0x5c'),function(_0xa100b8){_0xa100b8[_0x8e92('0x5d')](0x0);_0xa100b8[_0x8e92('0x5e')]=_0xa100b8[_0x8e92('0x5f')]['connection'][_0x8e92('0x60')]+':'+_0xa100b8[_0x8e92('0x5f')][_0x8e92('0x5c')][_0x8e92('0x61')];_0xa100b8[_0x8e92('0x62')]=new Date();_0xa100b8[_0x8e92('0x5a')]=function(_0x4dfe73){console[_0x8e92('0x5a')](_0x8e92('0x63')+_0xa100b8['nsp'][_0x8e92('0x6')]+'['+_0xa100b8['address']+']',_0x4dfe73);};_0xa100b8['on'](_0x8e92('0x64'),function(){onDisconnect(_0xa100b8,_0x1d9ee5);_0xa100b8[_0x8e92('0x5a')](_0x8e92('0x65'));});onConnect(_0xa100b8);_0xa100b8['log'](_0x8e92('0x66'));});};
\ No newline at end of file
+var _0xcbb1=['MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','admin','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:inbound','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','fax','sms','mail','openchannel','whatsapp','telephone:%s','trunk:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','address','disconnect','DISCONNECTED','CONNECTED','util','./environment','name','Agents','User','role','agent','type','ivr','UserProfileSection','findOne','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','then','map','resourceId','Campaign','format','length','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions'];(function(_0x4b9a1c,_0x76006b){var _0x4f0c6c=function(_0x4c6dfc){while(--_0x4c6dfc){_0x4b9a1c['push'](_0x4b9a1c['shift']());}};_0x4f0c6c(++_0x76006b);}(_0xcbb1,0x1d2));var _0x1cbb=function(_0x1b7dc1,_0x2547eb){_0x1b7dc1=_0x1b7dc1-0x0;var _0xe64dd9=_0xcbb1[_0x1b7dc1];return _0xe64dd9;};'use strict';var _=require('lodash');var util=require(_0x1cbb('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var config=require(_0x1cbb('0x1'));var queryQueues={'attributes':['id',_0x1cbb('0x2')],'include':[{'as':_0x1cbb('0x3'),'model':db[_0x1cbb('0x4')],'attributes':['id','name',_0x1cbb('0x5')],'raw':!![],'where':{'role':_0x1cbb('0x6')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x1cbb('0x2')]};var queryAgents={'raw':!![],'attributes':['id',_0x1cbb('0x2')],'where':{'role':_0x1cbb('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x1cbb('0x7')],'where':{'type':_0x1cbb('0x8')}};function getAssociatedResources(_0x22c25b,_0x428eb3,_0x571bcc){return db[_0x1cbb('0x9')][_0x1cbb('0xa')]({'where':{'name':_0x22c25b,'userProfileId':_0x428eb3},'raw':!![]})['then'](function(_0x5709c0){if(_0x5709c0){if(_0x5709c0['autoAssociation']){switch(_0x22c25b){case _0x1cbb('0xb'):case _0x1cbb('0xc'):case _0x1cbb('0xd'):case _0x1cbb('0xe'):case _0x1cbb('0xf'):case _0x1cbb('0x10'):case'WhatsappQueues':return db[_0x571bcc][_0x1cbb('0x11')](queryQueues);case _0x1cbb('0x12'):return db[_0x571bcc][_0x1cbb('0x11')](queryTelephones);case _0x1cbb('0x13'):return db[_0x571bcc][_0x1cbb('0x11')](queryTrunks);case _0x1cbb('0x14'):return db[_0x571bcc]['findAll'](queryCampaigns);}}else{return db[_0x1cbb('0x15')][_0x1cbb('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x5709c0['id']},'raw':!![]})[_0x1cbb('0x16')](function(_0x4a9173){if(_0x4a9173){var _0x300cda={'where':{'id':_[_0x1cbb('0x17')](_0x4a9173,_0x1cbb('0x18'))},'raw':!![]};switch(_0x571bcc){case _0x1cbb('0x4'):_0x300cda['where'][_0x1cbb('0x5')]='telephone';break;case _0x1cbb('0x19'):_0x300cda['where'][_0x1cbb('0x7')]=_0x1cbb('0x8');break;}return db[_0x571bcc][_0x1cbb('0x11')](_0x300cda);}else{return[];}});}}else{return[];}})['then'](function(_0x591ca9){return _0x591ca9;});}function joinOrLeaveQueues(_0x1d7ca0,_0x2ac983,_0x246774,_0x4a8815){_0x1d7ca0[_0x2ac983](util[_0x1cbb('0x1a')]('%s:queue:%s',_0x246774,_0x4a8815[_0x1cbb('0x2')]));if(_0x4a8815[_0x1cbb('0x3')]){for(var _0x335d1e=0x0;_0x335d1e<_0x4a8815[_0x1cbb('0x3')][_0x1cbb('0x1b')];_0x335d1e+=0x1){_0x1d7ca0[_0x2ac983](util[_0x1cbb('0x1a')]('user:%s',_0x4a8815[_0x1cbb('0x3')][_0x335d1e][_0x1cbb('0x2')]));}}}function joinOrLeave(_0x16f8fc,_0x2aa724,_0x306bda){var _0x2048ce;if(_0x16f8fc[_0x1cbb('0x1c')][_0x1cbb('0x1d')]['id']){db['User'][_0x1cbb('0x1e')]({'attributes':['id',_0x1cbb('0x2'),_0x1cbb('0x5'),_0x1cbb('0x1f')],'where':{'id':_0x16f8fc['handshake'][_0x1cbb('0x1d')]['id']},'include':[{'model':db[_0x1cbb('0x20')],'as':_0x1cbb('0x21'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x1cbb('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x1cbb('0x23')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1cbb('0x24')],'as':_0x1cbb('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x1cbb('0x26')],'as':_0x1cbb('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x1cbb('0x28')],'as':_0x1cbb('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x450145){if(_0x450145){_0x2048ce=_0x450145;_0x16f8fc[_0x2aa724](util[_0x1cbb('0x1a')](_0x1cbb('0x2a'),_0x450145[_0x1cbb('0x2')]));var _0x18e858=[];switch(_0x450145[_0x1cbb('0x5')]){case _0x1cbb('0x2b'):_0x16f8fc[_0x2aa724]('voice:inbound');_0x16f8fc[_0x2aa724](_0x1cbb('0x2c'));if(queryQueues[_0x1cbb('0x2d')](_0x1cbb('0x2e'))){delete queryQueues[_0x1cbb('0x2e')];}_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x30')][_0x1cbb('0x11')](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x31')]['findAll'](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x32')][_0x1cbb('0x11')](queryQueues));_0x18e858['push'](db[_0x1cbb('0x33')]['findAll'](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x34')][_0x1cbb('0x11')](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x35')][_0x1cbb('0x11')](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x36')][_0x1cbb('0x11')](queryQueues));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x4')][_0x1cbb('0x11')](queryTelephones));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x37')]['findAll'](queryTrunks));_0x18e858[_0x1cbb('0x2f')](db[_0x1cbb('0x19')]['findAll'](queryCampaigns));_0x18e858[_0x1cbb('0x2f')](db['User'][_0x1cbb('0x11')](queryAgents));break;case'user':_0x16f8fc[_0x2aa724](_0x1cbb('0x38'));_0x16f8fc[_0x2aa724](_0x1cbb('0x2c'));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0xb'),_0x450145[_0x1cbb('0x1f')],_0x1cbb('0x30')));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0xc'),_0x450145[_0x1cbb('0x1f')],_0x1cbb('0x31')));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0xd'),_0x450145[_0x1cbb('0x1f')],_0x1cbb('0x32')));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0xe'),_0x450145[_0x1cbb('0x1f')],'SmsQueue'));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0xf'),_0x450145['userProfileId'],'MailQueue'));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources('OpenchannelQueues',_0x450145[_0x1cbb('0x1f')],_0x1cbb('0x35')));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources('WhatsappQueues',_0x450145[_0x1cbb('0x1f')],_0x1cbb('0x36')));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0x12'),_0x450145[_0x1cbb('0x1f')],'User'));_0x18e858[_0x1cbb('0x2f')](getAssociatedResources(_0x1cbb('0x13'),_0x450145[_0x1cbb('0x1f')],'Trunk'));_0x18e858['push'](getAssociatedResources(_0x1cbb('0x14'),_0x450145[_0x1cbb('0x1f')],'Campaign'));_0x18e858[_0x1cbb('0x2f')](db['User'][_0x1cbb('0x11')](queryAgents));break;case _0x1cbb('0x6'):_0x16f8fc[_0x2aa724](_0x1cbb('0x38'));_0x16f8fc[_0x2aa724](_0x1cbb('0x2c'));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x39')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x3a')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x3b')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x3c')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858['push'](_0x450145[_0x1cbb('0x3d')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x3e')]({'attributes':['id',_0x1cbb('0x2')]}));_0x18e858[_0x1cbb('0x2f')](_0x450145[_0x1cbb('0x3f')]({'attributes':['id',_0x1cbb('0x2')]}));break;}return BPromise[_0x1cbb('0x40')](_0x18e858);}})[_0x1cbb('0x16')](function(_0xcf9ae4){if(_0xcf9ae4&&_0xcf9ae4[_0x1cbb('0x1b')]){for(var _0x2bf8fb=0x0;_0x2bf8fb<_0xcf9ae4['length'];_0x2bf8fb+=0x1){for(var _0x4a32af=0x0;_0x4a32af<_0xcf9ae4[_0x2bf8fb][_0x1cbb('0x1b')];_0x4a32af+=0x1){switch(_0x2bf8fb){case 0x0:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x41'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x1:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,'chat',_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x2:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x42'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x3:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x43'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x4:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x44'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x5:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x45'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x6:joinOrLeaveQueues(_0x16f8fc,_0x2aa724,_0x1cbb('0x46'),_0xcf9ae4[_0x2bf8fb][_0x4a32af]);break;case 0x7:if(_0x2048ce[_0x1cbb('0x5')]!=='agent')_0x16f8fc[_0x2aa724](util[_0x1cbb('0x1a')](_0x1cbb('0x47'),_0xcf9ae4[_0x2bf8fb][_0x4a32af][_0x1cbb('0x2')]));break;case 0x8:if(_0x2048ce[_0x1cbb('0x5')]!==_0x1cbb('0x6'))_0x16f8fc[_0x2aa724](util['format'](_0x1cbb('0x48'),_0xcf9ae4[_0x2bf8fb][_0x4a32af][_0x1cbb('0x2')]));break;case 0x9:if(_0x2048ce[_0x1cbb('0x5')]!=='agent')_0x16f8fc[_0x2aa724](util[_0x1cbb('0x1a')]('campaign:%s:%s',_0xcf9ae4[_0x2bf8fb][_0x4a32af][_0x1cbb('0x7')],_0xcf9ae4[_0x2bf8fb][_0x4a32af]['name']));break;case 0xa:_0x16f8fc[_0x2aa724](util[_0x1cbb('0x1a')](_0x1cbb('0x2a'),_0xcf9ae4[_0x2bf8fb][_0x4a32af][_0x1cbb('0x2')]));break;}}}}})[_0x1cbb('0x16')](function(){if(_0x2aa724===_0x1cbb('0x49')){var _0x526a2c=_[_0x1cbb('0x17')](_0x2048ce['ChatInteractions'],'id');return _0x2048ce[_0x1cbb('0x4a')](_0x526a2c)[_0x1cbb('0x16')](function(){for(var _0x229a2f=0x0;_0x229a2f<_0x526a2c[_0x1cbb('0x1b')];_0x229a2f+=0x1){_0x306bda['emit'](_0x1cbb('0x4b'),{'ChatInteractionId':Number(_0x526a2c[_0x229a2f]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x16')](function(){if(_0x2aa724===_0x1cbb('0x49')){var _0x40ea94=_[_0x1cbb('0x17')](_0x2048ce[_0x1cbb('0x22')],'id');return _0x2048ce[_0x1cbb('0x4c')](_0x40ea94)[_0x1cbb('0x16')](function(){for(var _0x5406e8=0x0;_0x5406e8<_0x40ea94['length'];_0x5406e8+=0x1){_0x306bda[_0x1cbb('0x4d')](_0x1cbb('0x4e'),{'MailInteractionId':Number(_0x40ea94[_0x5406e8]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x16')](function(){if(_0x2aa724===_0x1cbb('0x49')){var _0x10de3a=_['map'](_0x2048ce['FaxInteractions'],'id');return _0x2048ce[_0x1cbb('0x4f')](_0x10de3a)[_0x1cbb('0x16')](function(){for(var _0x2653b5=0x0;_0x2653b5<_0x10de3a[_0x1cbb('0x1b')];_0x2653b5+=0x1){_0x306bda[_0x1cbb('0x4d')](_0x1cbb('0x50'),{'FaxInteractionId':Number(_0x10de3a[_0x2653b5]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x16')](function(){if(_0x2aa724===_0x1cbb('0x49')){var _0x4004b0=_[_0x1cbb('0x17')](_0x2048ce[_0x1cbb('0x25')],'id');return _0x2048ce[_0x1cbb('0x51')](_0x4004b0)['then'](function(){for(var _0x390092=0x0;_0x390092<_0x4004b0[_0x1cbb('0x1b')];_0x390092+=0x1){_0x306bda[_0x1cbb('0x4d')](_0x1cbb('0x52'),{'SmsInteractionId':Number(_0x4004b0[_0x390092]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x16')](function(){if(_0x2aa724==='leave'){var _0x6f250b=_[_0x1cbb('0x17')](_0x2048ce[_0x1cbb('0x27')],'id');return _0x2048ce[_0x1cbb('0x53')](_0x6f250b)[_0x1cbb('0x16')](function(){for(var _0x3a33c3=0x0;_0x3a33c3<_0x6f250b[_0x1cbb('0x1b')];_0x3a33c3+=0x1){_0x306bda['emit'](_0x1cbb('0x54'),{'OpenchannelInteractionId':Number(_0x6f250b[_0x3a33c3]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x16')](function(){if(_0x2aa724===_0x1cbb('0x49')){var _0x1f4176=_[_0x1cbb('0x17')](_0x2048ce[_0x1cbb('0x29')],'id');return _0x2048ce[_0x1cbb('0x55')](_0x1f4176)[_0x1cbb('0x16')](function(){for(var _0x29278f=0x0;_0x29278f<_0x1f4176['length'];_0x29278f+=0x1){_0x306bda['emit'](_0x1cbb('0x56'),{'WhatsappInteractionId':Number(_0x1f4176[_0x29278f]),'UserId':Number(_0x2048ce['id'])});}});}})[_0x1cbb('0x57')](function(_0x3b8bab){_0x16f8fc[_0x1cbb('0x58')](_0x3b8bab);});}}function onDisconnect(_0x3577bb,_0x3006fb){joinOrLeave(_0x3577bb,_0x1cbb('0x49'),_0x3006fb);}function onConnect(_0x549b08){joinOrLeave(_0x549b08,_0x1cbb('0x59'));}exports['default']=function(_0x2ee199){_0x2ee199['on']('connection',function(_0x44d7ff){_0x44d7ff['setMaxListeners'](0x0);_0x44d7ff['address']=_0x44d7ff['request'][_0x1cbb('0x5a')][_0x1cbb('0x5b')]+':'+_0x44d7ff['request'][_0x1cbb('0x5a')][_0x1cbb('0x5c')];_0x44d7ff[_0x1cbb('0x5d')]=new Date();_0x44d7ff['log']=function(_0x1210fd){console['log'](_0x1cbb('0x5e')+_0x44d7ff[_0x1cbb('0x5f')][_0x1cbb('0x2')]+'['+_0x44d7ff[_0x1cbb('0x60')]+']',_0x1210fd);};_0x44d7ff['on'](_0x1cbb('0x61'),function(){onDisconnect(_0x44d7ff,_0x2ee199);_0x44d7ff[_0x1cbb('0x58')](_0x1cbb('0x62'));});onConnect(_0x44d7ff);_0x44d7ff[_0x1cbb('0x58')](_0x1cbb('0x63'));});};
\ No newline at end of file
index ab5c4ab..086fb31 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec5a=['jayson/promise','../logger','triggers','client','http','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','SmsInteraction','Sms','WhatsappInteraction','Whatsapp','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','Trigger,\x20%s','error','code','catch','get','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','QueryTypes','SELECT','then','contact','User','fullname','email','interface','format','SIP/%s','name','channel','incomingmessage','opened','closed','Sequelize','UserId','find','internal','agent','default','length','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb'];(function(_0x37a439,_0x3ca73f){var _0x159307=function(_0x3522f6){while(--_0x3522f6){_0x37a439['push'](_0x37a439['shift']());}};_0x159307(++_0x3ca73f);}(_0xec5a,0x80));var _0xaec5=function(_0x2dcb87,_0x37ed24){_0x2dcb87=_0x2dcb87-0x0;var _0x74396a=_0xec5a[_0x2dcb87];return _0x74396a;};'use strict';var util=require(_0xaec5('0x0'));var db=require(_0xaec5('0x1'))['db'];var jayson=require(_0xaec5('0x2'));var logger=require(_0xaec5('0x3'))(_0xaec5('0x4'));var _=require('lodash');var client=jayson[_0xaec5('0x5')][_0xaec5('0x6')]({'port':0x232a});var triggers=[{'channel':'Chat','model':_0xaec5('0x7'),'event':_0xaec5('0x8'),'condition':_0xaec5('0x9'),'callback':afterCreate},{'channel':'Chat','model':_0xaec5('0x7'),'event':_0xaec5('0xa'),'condition':_0xaec5('0xb'),'callback':afterUpdate},{'channel':'Chat','model':_0xaec5('0xc'),'event':_0xaec5('0x8'),'condition':_0xaec5('0xd'),'callback':afterCreateMessage},{'channel':'Sms','model':_0xaec5('0xe'),'event':'afterCreate','condition':_0xaec5('0x9'),'callback':afterCreate},{'channel':_0xaec5('0xf'),'model':_0xaec5('0xe'),'event':_0xaec5('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xaec5('0xf'),'model':'SmsMessage','event':_0xaec5('0x8'),'condition':_0xaec5('0xd'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xaec5('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':_0xaec5('0x10'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0xaec5('0x11'),'model':'WhatsappMessage','event':'afterCreate','condition':_0xaec5('0xd'),'callback':afterCreateMessage},{'channel':_0xaec5('0x12'),'model':_0xaec5('0x13'),'event':_0xaec5('0x8'),'condition':_0xaec5('0x9'),'callback':afterCreate},{'channel':_0xaec5('0x12'),'model':_0xaec5('0x13'),'event':_0xaec5('0xa'),'condition':_0xaec5('0xb'),'callback':afterUpdate},{'channel':_0xaec5('0x12'),'model':_0xaec5('0x14'),'event':_0xaec5('0x8'),'condition':_0xaec5('0xd'),'callback':afterCreateMessage},{'channel':_0xaec5('0x15'),'model':_0xaec5('0x16'),'event':_0xaec5('0x8'),'condition':_0xaec5('0x9'),'callback':afterCreate},{'channel':_0xaec5('0x15'),'model':_0xaec5('0x16'),'event':_0xaec5('0xa'),'condition':_0xaec5('0xb'),'callback':afterUpdate},{'channel':'Mail','model':'MailMessage','event':_0xaec5('0x8'),'condition':_0xaec5('0xd'),'callback':afterCreateMessage},{'channel':_0xaec5('0x17'),'model':'OpenchannelInteraction','event':_0xaec5('0x8'),'condition':_0xaec5('0x9'),'callback':afterCreate},{'channel':_0xaec5('0x17'),'model':_0xaec5('0x18'),'event':_0xaec5('0xa'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xaec5('0x17'),'model':_0xaec5('0x19'),'event':_0xaec5('0x8'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x3a3aa8){return client[_0xaec5('0x1a')](_0xaec5('0x1b'),_0x3a3aa8)['then'](function(_0xe1a98e){logger['info'](_0xaec5('0x1c'),_0xaec5('0x1b'),_0xe1a98e);if(_0xe1a98e[_0xaec5('0x1d')]){if(_0xe1a98e['error'][_0xaec5('0x1e')]===0x1f4){logger[_0xaec5('0x1d')]('Trigger,\x20%s',_0xaec5('0x1b'),_0xe1a98e[_0xaec5('0x1d')]);}}})[_0xaec5('0x1f')](function(_0xac8d86){logger[_0xaec5('0x1d')](_0xaec5('0x1c'),_0xaec5('0x1b'),_0xac8d86);});}function afterCreateMessage(_0x225d65,_0x43e873){return function(_0x56510f,_0x13f908){_0x56510f=_0x56510f[_0xaec5('0x20')]({'plain':!![]});_0x56510f['channel']=_0x225d65;_0x56510f[_0xaec5('0x21')]=_0x56510f['direction'];var _0x4a8ec2=_0xaec5('0x22')+_0x56510f[_0xaec5('0x23')];return db[_0xaec5('0x24')][_0xaec5('0x25')](_0x4a8ec2,{'type':db['Sequelize'][_0xaec5('0x26')][_0xaec5('0x27')],'raw':!![]})['then'](function(_0x2ab5ba){return _0x2ab5ba;})[_0xaec5('0x28')](function(_0x57f013){if(_0x57f013){_0x56510f[_0xaec5('0x29')]=_0x57f013[0x0];}if(_0x56510f['UserId']){return db[_0xaec5('0x2a')]['find']({'where':{'id':_0x56510f['UserId']},'attributes':['id','name',_0xaec5('0x2b'),_0xaec5('0x2c'),'internal'],'raw':!![]})[_0xaec5('0x28')](function(_0x45443e){_0x56510f[_0xaec5('0x2d')]=util[_0xaec5('0x2e')](_0xaec5('0x2f'),_0x45443e[_0xaec5('0x30')]);_0x56510f[_0xaec5('0x31')]=_0x225d65;_0x56510f['agent']=_0x45443e;return request({'event':_0xaec5('0x32'),'message':_0x56510f});})[_0xaec5('0x1f')](function(_0x182c5c){console[_0xaec5('0x1d')](_0x182c5c);});}else{return request({'event':'outgoingmessage','message':_0x56510f});}});};}function afterCreate(_0xc4bdb4,_0x2f7b47){return function(_0x487096,_0x238d7b){_0x487096=_0x487096[_0xaec5('0x20')]({'plain':!![]});_0x487096['channel']=_0xc4bdb4;_0x487096['event']=_0xaec5('0x33');var _0x494b2c=_0xaec5('0x22')+_0x487096[_0xaec5('0x23')];return db['sequelize']['query'](_0x494b2c,{'type':db['Sequelize'][_0xaec5('0x26')]['SELECT'],'raw':!![]})[_0xaec5('0x28')](function(_0x5eda02){return _0x5eda02;})['then'](function(_0x359035){if(_0x359035){_0x487096[_0xaec5('0x29')]=_0x359035[0x0];}return request({'event':_0x2f7b47,'message':_0x487096});});};}function afterUpdate(_0x31b572,_0x3610b4){return function(_0x173bef,_0x123f26){if(_0x173bef['changed'](_0xaec5('0x34'))&&_0x173bef['closed']){_0x173bef=_0x173bef['get']({'plain':!![]});_0x173bef['channel']=_0x31b572;_0x173bef[_0xaec5('0x21')]=_0xaec5('0x34');var _0x1c83d2=_0xaec5('0x22')+_0x173bef['ContactId'];return db['sequelize'][_0xaec5('0x25')](_0x1c83d2,{'type':db[_0xaec5('0x35')][_0xaec5('0x26')][_0xaec5('0x27')],'raw':!![]})[_0xaec5('0x28')](function(_0x26d09b){return _0x26d09b;})[_0xaec5('0x28')](function(_0x2df63b){if(_0x2df63b){_0x173bef[_0xaec5('0x29')]=_0x2df63b[0x0];}if(_0x173bef[_0xaec5('0x36')]){return db[_0xaec5('0x2a')][_0xaec5('0x37')]({'where':{'id':_0x173bef['UserId']},'attributes':['id','name',_0xaec5('0x2b'),_0xaec5('0x2c'),_0xaec5('0x38')],'raw':!![]})['then'](function(_0x168d54){_0x173bef['interface']=util['format'](_0xaec5('0x2f'),_0x168d54[_0xaec5('0x30')]);_0x173bef[_0xaec5('0x39')]=_0x168d54;return request({'event':_0x3610b4,'message':_0x173bef});})[_0xaec5('0x1f')](function(_0x52ab24){console[_0xaec5('0x1d')](_0x52ab24);});}else{return request({'event':_0x3610b4,'message':_0x173bef});}});}};}exports[_0xaec5('0x3a')]=function(){for(var _0xf528da=0x0;_0xf528da<triggers[_0xaec5('0x3b')];_0xf528da+=0x1){if(db[_0xaec5('0x3c')](triggers[_0xf528da][_0xaec5('0x3d')])){db[triggers[_0xf528da]['model']][_0xaec5('0x3e')](triggers[_0xf528da]['event'],triggers[_0xf528da][_0xaec5('0x3f')](triggers[_0xf528da]['channel']['toLowerCase'](),triggers[_0xf528da][_0xaec5('0x40')]));}}};
\ No newline at end of file
+var _0xa2e0=['name','agent','outgoingmessage','opened','query','changed','closed','fullname','email','length','hasOwnProperty','model','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','lodash','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','UserId','User','internal','interface','format','SIP/%s'];(function(_0x4c8522,_0x5655da){var _0x25c4ff=function(_0x48e58b){while(--_0x48e58b){_0x4c8522['push'](_0x4c8522['shift']());}};_0x25c4ff(++_0x5655da);}(_0xa2e0,0x9b));var _0x0a2e=function(_0x61e409,_0x587fef){_0x61e409=_0x61e409-0x0;var _0x3af983=_0xa2e0[_0x61e409];return _0x3af983;};'use strict';var util=require(_0x0a2e('0x0'));var db=require(_0x0a2e('0x1'))['db'];var jayson=require(_0x0a2e('0x2'));var logger=require(_0x0a2e('0x3'))(_0x0a2e('0x4'));var _=require(_0x0a2e('0x5'));var client=jayson[_0x0a2e('0x6')][_0x0a2e('0x7')]({'port':0x232a});var triggers=[{'channel':_0x0a2e('0x8'),'model':_0x0a2e('0x9'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xb'),'callback':afterCreate},{'channel':_0x0a2e('0x8'),'model':'ChatInteraction','event':_0x0a2e('0xc'),'condition':_0x0a2e('0xd'),'callback':afterUpdate},{'channel':_0x0a2e('0x8'),'model':_0x0a2e('0xe'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xf'),'callback':afterCreateMessage},{'channel':_0x0a2e('0x10'),'model':_0x0a2e('0x11'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xb'),'callback':afterCreate},{'channel':_0x0a2e('0x10'),'model':_0x0a2e('0x11'),'event':'afterUpdate','condition':_0x0a2e('0xd'),'callback':afterUpdate},{'channel':_0x0a2e('0x10'),'model':_0x0a2e('0x12'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xf'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x0a2e('0x13'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xb'),'callback':afterCreate},{'channel':_0x0a2e('0x14'),'model':_0x0a2e('0x13'),'event':_0x0a2e('0xc'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0a2e('0x14'),'model':_0x0a2e('0x15'),'event':'afterCreate','condition':_0x0a2e('0xf'),'callback':afterCreateMessage},{'channel':_0x0a2e('0x16'),'model':_0x0a2e('0x17'),'event':_0x0a2e('0xa'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0a2e('0x16'),'model':_0x0a2e('0x17'),'event':_0x0a2e('0xc'),'condition':_0x0a2e('0xd'),'callback':afterUpdate},{'channel':'Fax','model':_0x0a2e('0x18'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xf'),'callback':afterCreateMessage},{'channel':_0x0a2e('0x19'),'model':_0x0a2e('0x1a'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xb'),'callback':afterCreate},{'channel':_0x0a2e('0x19'),'model':_0x0a2e('0x1a'),'event':_0x0a2e('0xc'),'condition':_0x0a2e('0xd'),'callback':afterUpdate},{'channel':_0x0a2e('0x19'),'model':_0x0a2e('0x1b'),'event':_0x0a2e('0xa'),'condition':_0x0a2e('0xf'),'callback':afterCreateMessage},{'channel':_0x0a2e('0x1c'),'model':_0x0a2e('0x1d'),'event':'afterCreate','condition':_0x0a2e('0xb'),'callback':afterCreate},{'channel':_0x0a2e('0x1c'),'model':_0x0a2e('0x1d'),'event':_0x0a2e('0xc'),'condition':_0x0a2e('0xd'),'callback':afterUpdate},{'channel':_0x0a2e('0x1c'),'model':_0x0a2e('0x1e'),'event':_0x0a2e('0xa'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x55ba99){return client[_0x0a2e('0x1f')](_0x0a2e('0x20'),_0x55ba99)[_0x0a2e('0x21')](function(_0x56c10c){logger['info'](_0x0a2e('0x22'),_0x0a2e('0x20'),_0x56c10c);if(_0x56c10c[_0x0a2e('0x23')]){if(_0x56c10c['error'][_0x0a2e('0x24')]===0x1f4){logger[_0x0a2e('0x23')]('Trigger,\x20%s',_0x0a2e('0x20'),_0x56c10c[_0x0a2e('0x23')]);}}})[_0x0a2e('0x25')](function(_0x5d20f2){logger[_0x0a2e('0x23')](_0x0a2e('0x22'),_0x0a2e('0x20'),_0x5d20f2);});}function afterCreateMessage(_0x228490,_0x2e6761){return function(_0x1aea69,_0x35de75){_0x1aea69=_0x1aea69[_0x0a2e('0x26')]({'plain':!![]});_0x1aea69[_0x0a2e('0x27')]=_0x228490;_0x1aea69[_0x0a2e('0x28')]=_0x1aea69[_0x0a2e('0x29')];var _0x10e145=_0x0a2e('0x2a')+_0x1aea69[_0x0a2e('0x2b')];return db[_0x0a2e('0x2c')]['query'](_0x10e145,{'type':db[_0x0a2e('0x2d')][_0x0a2e('0x2e')][_0x0a2e('0x2f')],'raw':!![]})['then'](function(_0x2a3077){return _0x2a3077;})['then'](function(_0x419fc4){if(_0x419fc4){_0x1aea69[_0x0a2e('0x30')]=_0x419fc4[0x0];}if(_0x1aea69[_0x0a2e('0x31')]){return db[_0x0a2e('0x32')]['find']({'where':{'id':_0x1aea69[_0x0a2e('0x31')]},'attributes':['id','name','fullname','email',_0x0a2e('0x33')],'raw':!![]})[_0x0a2e('0x21')](function(_0x2084dc){_0x1aea69[_0x0a2e('0x34')]=util[_0x0a2e('0x35')](_0x0a2e('0x36'),_0x2084dc[_0x0a2e('0x37')]);_0x1aea69[_0x0a2e('0x27')]=_0x228490;_0x1aea69[_0x0a2e('0x38')]=_0x2084dc;return request({'event':'incomingmessage','message':_0x1aea69});})[_0x0a2e('0x25')](function(_0x34f76a){console[_0x0a2e('0x23')](_0x34f76a);});}else{return request({'event':_0x0a2e('0x39'),'message':_0x1aea69});}});};}function afterCreate(_0x28cbec,_0x3767d9){return function(_0x1c8863,_0x1aea94){_0x1c8863=_0x1c8863[_0x0a2e('0x26')]({'plain':!![]});_0x1c8863['channel']=_0x28cbec;_0x1c8863['event']=_0x0a2e('0x3a');var _0x533504=_0x0a2e('0x2a')+_0x1c8863[_0x0a2e('0x2b')];return db[_0x0a2e('0x2c')][_0x0a2e('0x3b')](_0x533504,{'type':db['Sequelize'][_0x0a2e('0x2e')]['SELECT'],'raw':!![]})['then'](function(_0x5721f2){return _0x5721f2;})['then'](function(_0x23de34){if(_0x23de34){_0x1c8863[_0x0a2e('0x30')]=_0x23de34[0x0];}return request({'event':_0x3767d9,'message':_0x1c8863});});};}function afterUpdate(_0x39d2ec,_0x250615){return function(_0x12948d,_0x5c2a11){if(_0x12948d[_0x0a2e('0x3c')](_0x0a2e('0x3d'))&&_0x12948d[_0x0a2e('0x3d')]){_0x12948d=_0x12948d[_0x0a2e('0x26')]({'plain':!![]});_0x12948d['channel']=_0x39d2ec;_0x12948d[_0x0a2e('0x28')]=_0x0a2e('0x3d');var _0x40adb9=_0x0a2e('0x2a')+_0x12948d[_0x0a2e('0x2b')];return db[_0x0a2e('0x2c')][_0x0a2e('0x3b')](_0x40adb9,{'type':db[_0x0a2e('0x2d')]['QueryTypes']['SELECT'],'raw':!![]})[_0x0a2e('0x21')](function(_0x239c57){return _0x239c57;})[_0x0a2e('0x21')](function(_0xc684c6){if(_0xc684c6){_0x12948d[_0x0a2e('0x30')]=_0xc684c6[0x0];}if(_0x12948d[_0x0a2e('0x31')]){return db[_0x0a2e('0x32')]['find']({'where':{'id':_0x12948d['UserId']},'attributes':['id','name',_0x0a2e('0x3e'),_0x0a2e('0x3f'),_0x0a2e('0x33')],'raw':!![]})[_0x0a2e('0x21')](function(_0x3259af){_0x12948d[_0x0a2e('0x34')]=util[_0x0a2e('0x35')](_0x0a2e('0x36'),_0x3259af[_0x0a2e('0x37')]);_0x12948d[_0x0a2e('0x38')]=_0x3259af;return request({'event':_0x250615,'message':_0x12948d});})[_0x0a2e('0x25')](function(_0x414ce9){console['error'](_0x414ce9);});}else{return request({'event':_0x250615,'message':_0x12948d});}});}};}exports['default']=function(){for(var _0x53d09e=0x0;_0x53d09e<triggers[_0x0a2e('0x40')];_0x53d09e+=0x1){if(db[_0x0a2e('0x41')](triggers[_0x53d09e][_0x0a2e('0x42')])){db[triggers[_0x53d09e][_0x0a2e('0x42')]]['hook'](triggers[_0x53d09e][_0x0a2e('0x28')],triggers[_0x53d09e][_0x0a2e('0x43')](triggers[_0x53d09e][_0x0a2e('0x27')][_0x0a2e('0x44')](),triggers[_0x53d09e][_0x0a2e('0x45')]));}}};
\ No newline at end of file
index 704b8a2..06792e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3293=['updateAttributes','getLicense','role','User','count','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','./license/util','voice','mail','chat','fax','sms','getChannels','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt'];(function(_0x1414b0,_0x38c5b5){var _0x5b6bd5=function(_0x4a6803){while(--_0x4a6803){_0x1414b0['push'](_0x1414b0['shift']());}};_0x5b6bd5(++_0x38c5b5);}(_0x3293,0x94));var _0x3329=function(_0x1cd925,_0x1701ff){_0x1cd925=_0x1cd925-0x0;var _0xf97e02=_0x3293[_0x1cd925];return _0xf97e02;};'use strict';var _=require(_0x3329('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0x3329('0x1'));var channels=[_0x3329('0x2'),_0x3329('0x3'),_0x3329('0x4'),_0x3329('0x5'),_0x3329('0x6'),'whatsapp','openchannel'];exports[_0x3329('0x7')]=function(){return channels;};exports['isValidChannel']=function(_0x5babbe){_0x5babbe=_0x5babbe[_0x3329('0x8')]();return _[_0x3329('0x9')](channels,_0x5babbe);};exports[_0x3329('0xa')]=function(_0x3288c0,_0x25f21f,_0x570c7a,_0x37b1a7){var _0x3c3900={'loginAttempts':_0x25f21f,'blocked':_0x570c7a};if(!_[_0x3329('0xb')](_0x37b1a7)){_0x3c3900[_0x3329('0xc')]=_0x37b1a7;}return _0x3288c0[_0x3329('0xd')](_0x3c3900);};exports[_0x3329('0xe')]=function(_0x1633dd){return new BPromise(function(_0x72fc49,_0x159238){var _0x182776=0x0;if(_0x1633dd[_0x3329('0xf')]!=='agent'){_0x72fc49(_0x1633dd);}db[_0x3329('0x10')][_0x3329('0x11')]({'where':{'role':_0x3329('0x12'),'online':!![],'id':{'$ne':_0x1633dd['id']}}})[_0x3329('0x13')](function(_0x192713){_0x182776=_0x192713;return util[_0x3329('0xe')]();})['then'](function(_0x5d6c8c){if(_0x5d6c8c&&_0x5d6c8c['agents']&&_0x182776>=_0x5d6c8c[_0x3329('0x14')]){throw Error(_0x3329('0x15'));}_0x72fc49(_0x1633dd);})[_0x3329('0x16')](function(_0x491f4b){_0x159238(_0x491f4b);});});};
\ No newline at end of file
+var _0x6926=['toLowerCase','includes','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','./license/util','voice','mail','chat','fax','sms','whatsapp','getChannels','isValidChannel'];(function(_0x261421,_0x4f083f){var _0x5a63ba=function(_0x5c67a7){while(--_0x5c67a7){_0x261421['push'](_0x261421['shift']());}};_0x5a63ba(++_0x4f083f);}(_0x6926,0x193));var _0x6692=function(_0x29203d,_0x40821c){_0x29203d=_0x29203d-0x0;var _0x35b5c7=_0x6926[_0x29203d];return _0x35b5c7;};'use strict';var _=require(_0x6692('0x0'));var BPromise=require(_0x6692('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x6692('0x2'));var channels=[_0x6692('0x3'),_0x6692('0x4'),_0x6692('0x5'),_0x6692('0x6'),_0x6692('0x7'),_0x6692('0x8'),'openchannel'];exports[_0x6692('0x9')]=function(){return channels;};exports[_0x6692('0xa')]=function(_0x3bc00f){_0x3bc00f=_0x3bc00f[_0x6692('0xb')]();return _[_0x6692('0xc')](channels,_0x3bc00f);};exports['clearBlockUser']=function(_0x47be10,_0x5aeabc,_0x397102,_0x440d11){var _0x1202af={'loginAttempts':_0x5aeabc,'blocked':_0x397102};if(!_['isUndefined'](_0x440d11)){_0x1202af['blockedAt']=_0x440d11;}return _0x47be10[_0x6692('0xd')](_0x1202af);};exports[_0x6692('0xe')]=function(_0x1c8e8e){return new BPromise(function(_0x5ec141,_0x38260f){var _0x4600a2=0x0;if(_0x1c8e8e[_0x6692('0xf')]!==_0x6692('0x10')){_0x5ec141(_0x1c8e8e);}db[_0x6692('0x11')][_0x6692('0x12')]({'where':{'role':_0x6692('0x10'),'online':!![],'id':{'$ne':_0x1c8e8e['id']}}})[_0x6692('0x13')](function(_0x5ae0c1){_0x4600a2=_0x5ae0c1;return util[_0x6692('0xe')]();})[_0x6692('0x13')](function(_0x47df01){if(_0x47df01&&_0x47df01['agents']&&_0x4600a2>=_0x47df01[_0x6692('0x14')]){throw Error(_0x6692('0x15'));}_0x5ec141(_0x1c8e8e);})[_0x6692('0x16')](function(_0x3f85a8){_0x38260f(_0x3f85a8);});});};
\ No newline at end of file
index 625c44c..aa57792 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ab7=['send','exports','404','status','render'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x2ab7,0xe7));var _0x72ab=function(_0x392fa7,_0x46b1eb){_0x392fa7=_0x392fa7-0x0;var _0x1b8d51=_0x2ab7[_0x392fa7];return _0x1b8d51;};'use strict';module[_0x72ab('0x0')][0x194]=function pageNotFound(_0xd56b8b,_0x439a2b){var _0x400c11=_0x72ab('0x1');var _0x44d854=0x194;var _0x486a17={'status':_0x44d854};_0x439a2b[_0x72ab('0x2')](_0x486a17[_0x72ab('0x2')]);_0x439a2b[_0x72ab('0x3')](_0x400c11,{},function(_0x21dd94,_0x4fed76){if(_0x21dd94){return _0x439a2b[_0x72ab('0x2')](_0x486a17['status'])['json'](_0x486a17);}_0x439a2b[_0x72ab('0x4')](_0x4fed76);});};
\ No newline at end of file
+var _0xf8aa=['exports','status','render','json','send'];(function(_0x29f9af,_0x4f3d10){var _0x56e4a8=function(_0x2e2554){while(--_0x2e2554){_0x29f9af['push'](_0x29f9af['shift']());}};_0x56e4a8(++_0x4f3d10);}(_0xf8aa,0x13b));var _0xaf8a=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xf8aa[_0x5f3f88];return _0xd08119;};'use strict';module[_0xaf8a('0x0')][0x194]=function pageNotFound(_0x4c2810,_0x525e2e){var _0x3b77fb='404';var _0x2534bb=0x194;var _0x3abeb3={'status':_0x2534bb};_0x525e2e[_0xaf8a('0x1')](_0x3abeb3[_0xaf8a('0x1')]);_0x525e2e[_0xaf8a('0x2')](_0x3b77fb,{},function(_0x4309d2,_0x33862d){if(_0x4309d2){return _0x525e2e[_0xaf8a('0x1')](_0x3abeb3[_0xaf8a('0x1')])[_0xaf8a('0x3')](_0x3abeb3);}_0x525e2e[_0xaf8a('0x4')](_0x33862d);});};
\ No newline at end of file
index 11f4f7e..928fcc8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfba2=['../api/teamVoiceQueue/teamVoiceQueue.model','User','hasMany','Recordings','UserId','VoiceQueuesRt','Extensions','cascade','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteraction','WhatsappInteractions','UserNotifications','SenderId','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','belongsToMany','CmList','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','MailQueue','UserMailQueue','ChatQueue','UserChatQueue','OpenchannelQueues','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','JscriptySessions','belongsTo','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','Messages','mailboxuser','VoiceMailMessage','mailbox','QueueCalls','AgentReports','uniqueid','Contact','ContactId','MailAccountId','hasOne','Imap','Smtp','Disposition','Dispositions','Interactions','List','ListId','TemplateId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachment','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','FaxAccountId','Applications','Exntensions','FaxMessage','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','Answers','SmsMessage','SmsInteractionId','Interaction','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','team_has_chat_queues','ChatInternalMessage','ChatGroupId','CompanyId','MailInteractions','Company','cm_contact_has_tags','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','Actions','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','sms_interaction_has_tags','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','CustomReportId','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','Field','VariableId','DeskAccount','DescriptionId','ZohoAccount','ZohoField','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerField','ServicenowField','Dynamics365Configuration','Dynamics365Field','Dynamics365Account','FromId','ToId','SessionId','ProjectId','team_has_mail_queues','MailQueues','ChatQueues','FaxQueues','SmsQueues','team_has_openchannel_queues','Hoppers','HopperHistories','HopperBlacks','TrunkId','TrunkBackup','TrunkBackupId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','userProfileId','UserProfileSection','Resources','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','exports','sequelize','lodash','jstz','determine','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8_general_ci','defaultsDeep','sequelizeHistory','utf8','database','username','password','options','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','MailApplication','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.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','DeskConfiguration','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue'];(function(_0xd881aa,_0x3801a8){var _0x28403e=function(_0x4fce59){while(--_0x4fce59){_0xd881aa['push'](_0xd881aa['shift']());}};_0x28403e(++_0x3801a8);}(_0xfba2,0xe9));var _0x2fba=function(_0x9e4629,_0x8174d4){_0x9e4629=_0x9e4629-0x0;var _0x351158=_0xfba2[_0x9e4629];return _0x351158;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x2fba('0x0'));var _=require(_0x2fba('0x1'));var jstz=require(_0x2fba('0x2'));var timezone=jstz[_0x2fba('0x3')]();config[_0x2fba('0x0')]=_['defaultsDeep'](config[_0x2fba('0x0')],{'database':'motion2','username':_0x2fba('0x4'),'password':_0x2fba('0x5'),'options':{'host':_0x2fba('0x6'),'port':0xcea,'dialect':_0x2fba('0x7'),'dialectOptions':{'charset':_0x2fba('0x8')},'logging':![],'timezone':timezone[_0x2fba('0x9')](),'define':{'charset':'utf8','collate':_0x2fba('0xa')}}});config['sequelizeHistory']=_[_0x2fba('0xb')](config[_0x2fba('0xc')],{'database':'motion2','username':_0x2fba('0x4'),'password':_0x2fba('0x5'),'options':{'host':_0x2fba('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x2fba('0x8')},'logging':![],'timezone':timezone[_0x2fba('0x9')](),'define':{'charset':_0x2fba('0xd'),'collate':_0x2fba('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2fba('0x0')][_0x2fba('0xe')],config[_0x2fba('0x0')][_0x2fba('0xf')],config[_0x2fba('0x0')][_0x2fba('0x10')],config[_0x2fba('0x0')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2fba('0xc')][_0x2fba('0xe')],config[_0x2fba('0xc')][_0x2fba('0xf')],config[_0x2fba('0xc')][_0x2fba('0x10')],config[_0x2fba('0xc')][_0x2fba('0x11')])};db['User']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x13'));db[_0x2fba('0x14')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x15'));db[_0x2fba('0x16')]=db[_0x2fba('0x0')]['import'](_0x2fba('0x17'));db[_0x2fba('0x18')]=db[_0x2fba('0x0')]['import']('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db[_0x2fba('0x0')]['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x2fba('0x19')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x1a'));db[_0x2fba('0x1b')]=db[_0x2fba('0x0')]['import'](_0x2fba('0x1c'));db[_0x2fba('0x1d')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/screenRecording/screenRecording.model');db[_0x2fba('0x1e')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x1f'));db['VoiceMailMessage']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x20'));db[_0x2fba('0x21')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x22'));db['VoiceDialReport']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x23'));db[_0x2fba('0x24')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x25'));db[_0x2fba('0x26')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x27'));db['MemberReport']=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/memberReport/memberReport.model');db[_0x2fba('0x28')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x29'));db['VoiceTransferReport']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x2a'));db[_0x2fba('0x2b')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x2c'));db[_0x2fba('0x2d')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/userVoiceQueue/userVoiceQueue.model');db['UserChatQueue']=db['sequelize'][_0x2fba('0x12')](_0x2fba('0x2e'));db['UserMailQueue']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x2f'));db[_0x2fba('0x30')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x31'));db[_0x2fba('0x32')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x33'));db[_0x2fba('0x34')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x35'));db[_0x2fba('0x36')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x2fba('0x37')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x38'));db[_0x2fba('0x39')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x3a'));db[_0x2fba('0x3b')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/mailAccount/mailAccount.model');db['MailQueue']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x3c'));db['MailSubstatus']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x3d'));db['MailInteraction']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x3e'));db[_0x2fba('0x3f')]=db[_0x2fba('0x0')]['import']('../api/mailMessage/mailMessage.model');db[_0x2fba('0x40')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/mailApplication/mailApplication.model');db[_0x2fba('0x41')]=db[_0x2fba('0x0')]['import'](_0x2fba('0x42'));db[_0x2fba('0x43')]=db[_0x2fba('0x0')]['import'](_0x2fba('0x44'));db[_0x2fba('0x45')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x46'));db[_0x2fba('0x47')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x48'));db[_0x2fba('0x49')]=db['sequelize']['import'](_0x2fba('0x4a'));db[_0x2fba('0x4b')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db['sequelize'][_0x2fba('0x12')](_0x2fba('0x4c'));db[_0x2fba('0x4d')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/faxQueue/faxQueue.model');db[_0x2fba('0x4e')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x4f'));db['SmsAccount']=db[_0x2fba('0x0')]['import'](_0x2fba('0x50'));db[_0x2fba('0x51')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/smsApplication/smsApplication.model');db[_0x2fba('0x52')]=db['sequelize'][_0x2fba('0x12')](_0x2fba('0x53'));db['SmsMessage']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x54'));db[_0x2fba('0x55')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x56'));db[_0x2fba('0x57')]=db['sequelize'][_0x2fba('0x12')]('../api/openchannelAccount/openchannelAccount.model');db[_0x2fba('0x58')]=db[_0x2fba('0x0')]['import'](_0x2fba('0x59'));db[_0x2fba('0x5a')]=db['sequelize'][_0x2fba('0x12')](_0x2fba('0x5b'));db[_0x2fba('0x5c')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/openchannelMessage/openchannelMessage.model');db[_0x2fba('0x5d')]=db[_0x2fba('0x0')]['import'](_0x2fba('0x5e'));db[_0x2fba('0x5f')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x60'));db[_0x2fba('0x61')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x62'));db[_0x2fba('0x63')]=db['sequelize']['import']('../api/chatApplication/chatApplication.model');db[_0x2fba('0x64')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x65'));db[_0x2fba('0x66')]=db['sequelize'][_0x2fba('0x12')](_0x2fba('0x67'));db['ChatOfflineMessage']=db['sequelize'][_0x2fba('0x12')](_0x2fba('0x68'));db['ChatQueue']=db['sequelize'][_0x2fba('0x12')]('../api/chatQueue/chatQueue.model');db[_0x2fba('0x69')]=db[_0x2fba('0x0')]['import'](_0x2fba('0x6a'));db[_0x2fba('0x6b')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x6c'));db[_0x2fba('0x6d')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x6e'));db['CmContact']=db[_0x2fba('0x0')]['import'](_0x2fba('0x6f'));db[_0x2fba('0x70')]=db['sequelize'][_0x2fba('0x12')](_0x2fba('0x71'));db[_0x2fba('0x72')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x73'));db[_0x2fba('0x74')]=db[_0x2fba('0x0')]['import']('../api/cmHopperFinal/cmHopperFinal.model');db[_0x2fba('0x75')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x76'));db[_0x2fba('0x77')]=db['sequelize'][_0x2fba('0x12')](_0x2fba('0x78'));db[_0x2fba('0x79')]=db[_0x2fba('0x0')]['import']('../api/cmCustomField/cmCustomField.model');db[_0x2fba('0x7a')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x7b'));db[_0x2fba('0x7c')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x7d'));db[_0x2fba('0x7e')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x7f'));db['Disposition']=db['sequelize'][_0x2fba('0x12')]('../api/disposition/disposition.model');db[_0x2fba('0x80')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x81'));db['Interval']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x82'));db[_0x2fba('0x83')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/pause/pause.model');db['Cdr']=db[_0x2fba('0x0')]['import'](_0x2fba('0x84'));db['VoiceQueuesLog']=db['sequelize']['import'](_0x2fba('0x85'));db[_0x2fba('0x86')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x87'));db[_0x2fba('0x88')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/sound/sound.model');db[_0x2fba('0x89')]=db[_0x2fba('0x0')]['import'](_0x2fba('0x8a'));db[_0x2fba('0x8b')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x8c'));db[_0x2fba('0x8d')]=db['sequelize'][_0x2fba('0x12')](_0x2fba('0x8e'));db[_0x2fba('0x8f')]=db[_0x2fba('0x0')]['import'](_0x2fba('0x90'));db['Integration']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x91'));db[_0x2fba('0x92')]=db[_0x2fba('0x0')]['import'](_0x2fba('0x93'));db['AnalyticCustomReport']=db['sequelize'][_0x2fba('0x12')](_0x2fba('0x94'));db[_0x2fba('0x95')]=db[_0x2fba('0x0')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x2fba('0x96')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x97'));db[_0x2fba('0x98')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x99'));db[_0x2fba('0x9a')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x9b'));db[_0x2fba('0x9c')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x9d'));db[_0x2fba('0x9e')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x9f'));db[_0x2fba('0xa0')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xa1'));db[_0x2fba('0xa2')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xa3'));db[_0x2fba('0xa4')]=db['sequelize'][_0x2fba('0x12')](_0x2fba('0xa5'));db[_0x2fba('0xa6')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xa7'));db[_0x2fba('0xa8')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xa9'));db['DeskAccount']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xaa'));db[_0x2fba('0xab')]=db[_0x2fba('0x0')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x2fba('0xac')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xad'));db['ZohoAccount']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xae'));db[_0x2fba('0xaf')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xb0'));db['ZohoField']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xb1'));db[_0x2fba('0xb2')]=db['sequelize'][_0x2fba('0x12')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x2fba('0xb3')]=db['sequelize'][_0x2fba('0x12')](_0x2fba('0xb4'));db[_0x2fba('0xb5')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xb6'));db[_0x2fba('0xb7')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xb8'));db['FreshdeskConfiguration']=db['sequelize'][_0x2fba('0x12')](_0x2fba('0xb9'));db[_0x2fba('0xba')]=db[_0x2fba('0x0')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db[_0x2fba('0xbb')]=db['sequelize'][_0x2fba('0x12')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x2fba('0xbc')]=db[_0x2fba('0x0')]['import'](_0x2fba('0xbd'));db['VtigerField']=db['sequelize'][_0x2fba('0x12')](_0x2fba('0xbe'));db[_0x2fba('0xbf')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xc0'));db[_0x2fba('0xc1')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xc2'));db['ServicenowField']=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db['sequelize'][_0x2fba('0x12')]('../api/intDynamics365Account/intDynamics365Account.model');db['Dynamics365Configuration']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xc3'));db['Dynamics365Field']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xc4'));db[_0x2fba('0xc5')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xc6'));db[_0x2fba('0xc7')]=db['sequelize'][_0x2fba('0x12')](_0x2fba('0xc8'));db[_0x2fba('0xc9')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xca'));db[_0x2fba('0xcb')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x91'));db[_0x2fba('0xcc')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xcd'));db[_0x2fba('0xce')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xcf'));db['ChatInternalMessage']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xd0'));db[_0x2fba('0xd1')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xd2'));db[_0x2fba('0xd3')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xd4'));db[_0x2fba('0xd5')]=db[_0x2fba('0x0')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x2fba('0xd6')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xd7'));db[_0x2fba('0xd8')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xd9'));db[_0x2fba('0xda')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/squareReportDetail/squareReportDetail.model');db[_0x2fba('0xdb')]=db['sequelize'][_0x2fba('0x12')]('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xdc'));db[_0x2fba('0xdd')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/squareOdbc/squareOdbc.model');db[_0x2fba('0xde')]=db[_0x2fba('0x0')]['import'](_0x2fba('0xdf'));db[_0x2fba('0xe0')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xe1'));db['SquareMessage']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xe2'));db[_0x2fba('0xe3')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/team/team.model');db[_0x2fba('0xe4')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/license/license.model');db[_0x2fba('0xe5')]=db['sequelize'][_0x2fba('0x12')](_0x2fba('0xe6'));db[_0x2fba('0xe7')]=db[_0x2fba('0x0')]['import'](_0x2fba('0xe8'));db['Attachment']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xe9'));db[_0x2fba('0xea')]=db['sequelize'][_0x2fba('0x12')](_0x2fba('0xeb'));db[_0x2fba('0xec')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xed'));db['ChatTransferReport']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xee'));db[_0x2fba('0xef')]=db[_0x2fba('0x0')]['import'](_0x2fba('0xf0'));db['OpenchannelTransferReport']=db['sequelize'][_0x2fba('0x12')](_0x2fba('0xf1'));db['SmsTransferReport']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xf2'));db['CmList']=db['sequelize'][_0x2fba('0x12')](_0x2fba('0xf3'));db[_0x2fba('0xf4')]=db[_0x2fba('0x0')]['import'](_0x2fba('0xf5'));db[_0x2fba('0xf6')]=db[_0x2fba('0x0')]['import'](_0x2fba('0xf7'));db['UserProfileSection']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xf8'));db[_0x2fba('0xf9')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xfa'));db[_0x2fba('0xfb')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xfc'));db[_0x2fba('0xfd')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/whatsappAccount/whatsappAccount.model');db[_0x2fba('0xfe')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0xff'));db[_0x2fba('0x100')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x101'));db['WhatsappMessage']=db['sequelize'][_0x2fba('0x12')](_0x2fba('0x102'));db['WhatsappQueueReport']=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x103'));db[_0x2fba('0x104')]=db['sequelize']['import'](_0x2fba('0x105'));db[_0x2fba('0x106')]=db[_0x2fba('0x0')][_0x2fba('0x12')]('../api/whatsappQueue/whatsappQueue.model');db[_0x2fba('0x107')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x108'));db[_0x2fba('0x109')]=db[_0x2fba('0x0')][_0x2fba('0x12')](_0x2fba('0x10a'));db[_0x2fba('0x10b')]['hasOne'](db[_0x2fba('0x1e')],{'as':_0x2fba('0x1e'),'onDelete':'cascade','foreignKey':'UserId'});db['User'][_0x2fba('0x10c')](db[_0x2fba('0x1b')],{'as':_0x2fba('0x10d'),'foreignKey':_0x2fba('0x10e')});db['User'][_0x2fba('0x10c')](db['UserVoiceQueueRt'],{'as':_0x2fba('0x10f'),'foreignKey':'UserId'});db['User'][_0x2fba('0x10c')](db[_0x2fba('0x18')],{'as':_0x2fba('0x110'),'onDelete':_0x2fba('0x111'),'hooks':!![]});db[_0x2fba('0x10b')][_0x2fba('0x10c')](db['CmHopperFinal'],{'as':_0x2fba('0x112'),'foreignKey':_0x2fba('0x10e')});db[_0x2fba('0x10b')][_0x2fba('0x10c')](db[_0x2fba('0x75')],{'as':_0x2fba('0x113'),'foreignKey':_0x2fba('0x10e')});db['User']['hasMany'](db[_0x2fba('0x77')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x2fba('0x10b')][_0x2fba('0x10c')](db['OpenchannelInteraction'],{'as':_0x2fba('0x114'),'foreignKey':_0x2fba('0x10e')});db[_0x2fba('0x10b')]['hasMany'](db[_0x2fba('0x64')],{'as':'ChatInteractions','foreignKey':_0x2fba('0x10e')});db[_0x2fba('0x10b')][_0x2fba('0x10c')](db[_0x2fba('0x52')],{'as':_0x2fba('0x115'),'foreignKey':'UserId'});db[_0x2fba('0x10b')]['hasMany'](db[_0x2fba('0x4b')],{'as':_0x2fba('0x116'),'foreignKey':'UserId'});db[_0x2fba('0x10b')][_0x2fba('0x10c')](db[_0x2fba('0x117')],{'as':'MailInteractions','foreignKey':_0x2fba('0x10e')});db[_0x2fba('0x10b')][_0x2fba('0x10c')](db[_0x2fba('0x100')],{'as':_0x2fba('0x118'),'foreignKey':_0x2fba('0x10e')});db['User']['hasMany'](db[_0x2fba('0xfb')],{'as':_0x2fba('0x119'),'foreignKey':_0x2fba('0x11a')});db['User']['belongsTo'](db[_0x2fba('0xf6')],{'as':_0x2fba('0xf6'),'foreignKey':'userProfileId'});db[_0x2fba('0x10b')]['belongsToMany'](db[_0x2fba('0x69')],{'as':_0x2fba('0x11b'),'through':_0x2fba('0x11c')});db[_0x2fba('0x10b')]['belongsToMany'](db[_0x2fba('0x11d')],{'as':_0x2fba('0x11e'),'through':_0x2fba('0x11f')});db['User'][_0x2fba('0x120')](db[_0x2fba('0x121')],{'as':'Lists','through':_0x2fba('0x122')});db[_0x2fba('0x10b')][_0x2fba('0x120')](db[_0x2fba('0xe3')],{'through':_0x2fba('0x123')});db[_0x2fba('0x10b')][_0x2fba('0x120')](db[_0x2fba('0x117')],{'as':'MailInteractions','through':_0x2fba('0x124')});db[_0x2fba('0x10b')][_0x2fba('0x120')](db[_0x2fba('0x64')],{'as':_0x2fba('0x125'),'through':_0x2fba('0x126')});db[_0x2fba('0x10b')][_0x2fba('0x120')](db[_0x2fba('0x4b')],{'as':_0x2fba('0x116'),'through':_0x2fba('0x127')});db[_0x2fba('0x10b')][_0x2fba('0x120')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0x2fba('0x128')});db[_0x2fba('0x10b')][_0x2fba('0x120')](db[_0x2fba('0x5a')],{'as':_0x2fba('0x114'),'through':_0x2fba('0x129')});db[_0x2fba('0x10b')][_0x2fba('0x120')](db['WhatsappInteraction'],{'as':_0x2fba('0x118'),'through':_0x2fba('0x12a')});db[_0x2fba('0x10b')][_0x2fba('0x120')](db[_0x2fba('0x19')],{'as':_0x2fba('0x12b'),'through':'UserVoiceQueue','required':![]});db[_0x2fba('0x10b')][_0x2fba('0x120')](db[_0x2fba('0x12c')],{'as':'MailQueues','through':_0x2fba('0x12d'),'required':![]});db[_0x2fba('0x10b')]['belongsToMany'](db[_0x2fba('0x12e')],{'as':'ChatQueues','through':_0x2fba('0x12f'),'required':![],'hooks':!![]});db[_0x2fba('0x10b')]['belongsToMany'](db['FaxQueue'],{'as':'FaxQueues','through':_0x2fba('0x30'),'required':![]});db['User'][_0x2fba('0x120')](db[_0x2fba('0x55')],{'as':'SmsQueues','through':_0x2fba('0x32'),'required':![]});db['User'][_0x2fba('0x120')](db['OpenchannelQueue'],{'as':_0x2fba('0x130'),'through':_0x2fba('0x34'),'required':![]});db['User'][_0x2fba('0x120')](db['WhatsappQueue'],{'as':'WhatsappQueues','through':_0x2fba('0x36'),'required':![]});db[_0x2fba('0x10b')][_0x2fba('0x120')](db['CmList'],{'through':'cm_user_has_lists'});db[_0x2fba('0x10b')][_0x2fba('0x120')](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0x2fba('0x131'),'required':![]});db[_0x2fba('0x10b')][_0x2fba('0x120')](db[_0x2fba('0x5f')],{'as':_0x2fba('0x132'),'through':_0x2fba('0x133')});db[_0x2fba('0x10b')][_0x2fba('0x120')](db[_0x2fba('0x47')],{'as':'FaxAccounts','through':_0x2fba('0x134')});db['User']['belongsToMany'](db[_0x2fba('0x3b')],{'as':_0x2fba('0x135'),'through':_0x2fba('0x136')});db[_0x2fba('0x10b')]['belongsToMany'](db[_0x2fba('0x57')],{'as':'OpenchannelAccounts','through':_0x2fba('0x137')});db[_0x2fba('0x10b')][_0x2fba('0x120')](db[_0x2fba('0x138')],{'as':_0x2fba('0x139'),'through':_0x2fba('0x13a')});db['User'][_0x2fba('0x120')](db[_0x2fba('0xfd')],{'as':'WhatsappAccounts','through':_0x2fba('0x13b')});db['User'][_0x2fba('0x120')](db[_0x2fba('0xde')],{'as':_0x2fba('0x13c'),'through':_0x2fba('0x13d')});db[_0x2fba('0x14')][_0x2fba('0x10c')](db[_0x2fba('0x18')],{'as':_0x2fba('0x13e'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x13f')});db[_0x2fba('0x16')][_0x2fba('0x10c')](db['VoiceExtension'],{'onDelete':_0x2fba('0x111')});db[_0x2fba('0x18')]['hasMany'](db['VoiceExtension'],{'as':'Applications','onDelete':_0x2fba('0x111')});db[_0x2fba('0x140')][_0x2fba('0x120')](db[_0x2fba('0x88')],{'as':_0x2fba('0x141'),'through':_0x2fba('0x142')});db[_0x2fba('0x19')][_0x2fba('0x10c')](db[_0x2fba('0x2b')],{'as':_0x2fba('0x143'),'foreignKey':_0x2fba('0x144')});db['VoiceQueue']['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x2fba('0x144')});db[_0x2fba('0x19')][_0x2fba('0x10c')](db['CmHopperFinal'],{'as':_0x2fba('0x112'),'foreignKey':_0x2fba('0x144')});db[_0x2fba('0x19')][_0x2fba('0x10c')](db[_0x2fba('0x75')],{'as':'HopperHistories','foreignKey':_0x2fba('0x144')});db['VoiceQueue'][_0x2fba('0x10c')](db['ReportAgentPreview'],{'as':_0x2fba('0x77'),'foreignKey':_0x2fba('0x144')});db[_0x2fba('0x19')][_0x2fba('0x10c')](db[_0x2fba('0x72')],{'as':'HopperBlacks','foreignKey':_0x2fba('0x144')});db[_0x2fba('0x19')][_0x2fba('0x10c')](db['JscriptySessionReport'],{'as':_0x2fba('0x145'),'foreignKey':_0x2fba('0x144')});db[_0x2fba('0x19')][_0x2fba('0x146')](db['Trunk'],{'as':_0x2fba('0x28'),'foreignKey':'TrunkId'});db[_0x2fba('0x19')][_0x2fba('0x146')](db[_0x2fba('0x28')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x2fba('0x19')][_0x2fba('0x146')](db[_0x2fba('0x147')],{'as':'Interval','foreignKey':_0x2fba('0x148')});db[_0x2fba('0x19')]['belongsTo'](db['Pause'],{'as':_0x2fba('0x149'),'foreignKey':_0x2fba('0x14a')});db[_0x2fba('0x19')][_0x2fba('0x120')](db[_0x2fba('0x121')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0x2fba('0x19')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x14b'),'through':_0x2fba('0x2d')});db[_0x2fba('0x19')]['belongsToMany'](db['Team'],{'as':_0x2fba('0x14c'),'through':_0x2fba('0x109')});db['VoiceQueue'][_0x2fba('0x120')](db[_0x2fba('0x121')],{'as':_0x2fba('0x14d'),'through':'voice_queues_has_cm_blacklists'});db[_0x2fba('0x1b')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'as':'User','foreignKey':_0x2fba('0x10e')});db[_0x2fba('0x1d')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x10b'),'foreignKey':_0x2fba('0x10e')});db[_0x2fba('0x1e')][_0x2fba('0x10c')](db['VoiceMailMessage'],{'as':_0x2fba('0x14e'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x14f'),'sourceKey':'mailbox'});db[_0x2fba('0x150')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0x2fba('0x14f'),'targetKey':_0x2fba('0x151')});db[_0x2fba('0x21')]['hasMany'](db[_0x2fba('0x26')],{'as':_0x2fba('0x152'),'foreignKey':'uniqueid','constraints':![]});db[_0x2fba('0x21')][_0x2fba('0x10c')](db['VoiceAgentReport'],{'as':_0x2fba('0x153'),'foreignKey':_0x2fba('0x154'),'constraints':![]});db['VoiceCallReport'][_0x2fba('0x146')](db['User'],{'as':_0x2fba('0x10b'),'foreignKey':_0x2fba('0x10e')});db[_0x2fba('0x21')][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'as':_0x2fba('0x155'),'foreignKey':_0x2fba('0x156')});db[_0x2fba('0x37')]['belongsTo'](db[_0x2fba('0x3b')],{'as':_0x2fba('0x3b'),'foreignKey':_0x2fba('0x157')});db[_0x2fba('0x39')]['belongsTo'](db['MailAccount'],{'as':_0x2fba('0x3b'),'foreignKey':'MailAccountId'});db[_0x2fba('0x3b')][_0x2fba('0x158')](db['MailServerIn'],{'as':_0x2fba('0x159'),'onDelete':'cascade'});db[_0x2fba('0x3b')][_0x2fba('0x158')](db[_0x2fba('0x39')],{'as':_0x2fba('0x15a'),'onDelete':'cascade'});db[_0x2fba('0x3b')][_0x2fba('0x10c')](db[_0x2fba('0x15b')],{'as':_0x2fba('0x15c'),'foreignKey':_0x2fba('0x157'),'onDelete':'cascade'});db[_0x2fba('0x3b')]['hasMany'](db[_0x2fba('0x7e')],{'as':'Answers','foreignKey':_0x2fba('0x157')});db[_0x2fba('0x3b')][_0x2fba('0x10c')](db[_0x2fba('0x3f')],{'as':_0x2fba('0x14e'),'foreignKey':'MailAccountId'});db[_0x2fba('0x3b')][_0x2fba('0x10c')](db[_0x2fba('0x117')],{'as':_0x2fba('0x15d')});db[_0x2fba('0x3b')][_0x2fba('0x10c')](db[_0x2fba('0x40')],{'as':'Applications'});db['MailAccount'][_0x2fba('0x146')](db[_0x2fba('0x121')],{'as':_0x2fba('0x15e'),'foreignKey':_0x2fba('0x15f')});db[_0x2fba('0x3b')]['belongsTo'](db[_0x2fba('0x8b')],{'as':_0x2fba('0x8b'),'foreignKey':_0x2fba('0x160')});db[_0x2fba('0x3b')][_0x2fba('0x146')](db['Pause'],{'as':_0x2fba('0x149'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2fba('0x3b')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x14b'),'through':_0x2fba('0x136')});db[_0x2fba('0x12c')]['belongsToMany'](db[_0x2fba('0x10b')],{'as':'Agents','through':_0x2fba('0x12d')});db['MailQueue']['belongsToMany'](db['Team'],{'through':'team_has_mail_queues','as':_0x2fba('0x14c')});db['MailInteraction'][_0x2fba('0x10c')](db[_0x2fba('0x3f')],{'as':'Messages','onDelete':'cascade','foreignKey':'MailInteractionId'});db[_0x2fba('0x117')][_0x2fba('0x146')](db[_0x2fba('0x3b')],{'as':_0x2fba('0x161'),'foreignKey':_0x2fba('0x157')});db[_0x2fba('0x117')][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'as':'Contact','foreignKey':_0x2fba('0x156')});db[_0x2fba('0x117')]['belongsTo'](db[_0x2fba('0x10b')],{'as':_0x2fba('0x162'),'foreignKey':'UserId'});db[_0x2fba('0x117')][_0x2fba('0x120')](db[_0x2fba('0x89')],{'through':_0x2fba('0x163'),'as':_0x2fba('0x164')});db[_0x2fba('0x117')][_0x2fba('0x120')](db['Tag'],{'through':_0x2fba('0x163'),'as':_0x2fba('0x165')});db[_0x2fba('0x117')][_0x2fba('0x120')](db['User'],{'as':_0x2fba('0x166'),'through':_0x2fba('0x124'),'foreignKey':_0x2fba('0x167')});db['MailMessage'][_0x2fba('0x10c')](db[_0x2fba('0x168')],{'as':'Attachments','onDelete':_0x2fba('0x111')});db[_0x2fba('0x3f')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'as':'User'});db[_0x2fba('0x3f')][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'onDelete':'cascade','as':_0x2fba('0x155')});db[_0x2fba('0x3f')][_0x2fba('0x146')](db[_0x2fba('0x117')],{'as':'Interaction','foreignKey':_0x2fba('0x167')});db[_0x2fba('0x3f')][_0x2fba('0x146')](db[_0x2fba('0x3b')],{'as':_0x2fba('0x161'),'foreignKey':_0x2fba('0x157')});db[_0x2fba('0x3f')]['belongsTo'](db['ChatWebsite'],{'as':'ChatWebsite','foreignKey':_0x2fba('0x169')});db[_0x2fba('0x3f')]['belongsTo'](db[_0x2fba('0x16a')],{'as':_0x2fba('0x16a'),'foreignKey':_0x2fba('0x16b')});db[_0x2fba('0x40')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x40')]['belongsTo'](db[_0x2fba('0x12c')],{'onDelete':_0x2fba('0x16c')});db['MailApplication'][_0x2fba('0x146')](db[_0x2fba('0x3b')],{'onDelete':'restrict'});db[_0x2fba('0x40')][_0x2fba('0x146')](db[_0x2fba('0x147')],{'onDelete':_0x2fba('0x16c'),'foreignKey':_0x2fba('0x148')});db[_0x2fba('0x40')][_0x2fba('0x146')](db[_0x2fba('0x89')],{'onDelete':_0x2fba('0x16c'),'foreignKey':_0x2fba('0x16d')});db[_0x2fba('0x41')]['belongsTo'](db[_0x2fba('0x3b')],{});db[_0x2fba('0x41')][_0x2fba('0x146')](db[_0x2fba('0x121')],{'as':_0x2fba('0x15e'),'foreignKey':_0x2fba('0x15f')});db['MailQueueReport'][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'as':_0x2fba('0x155'),'foreignKey':_0x2fba('0x156')});db['MailQueueReport']['belongsTo'](db['MailInteraction'],{});db[_0x2fba('0x41')][_0x2fba('0x146')](db[_0x2fba('0x3f')],{});db[_0x2fba('0x41')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{});db[_0x2fba('0x41')][_0x2fba('0x146')](db[_0x2fba('0x12c')],{});db[_0x2fba('0x43')][_0x2fba('0x10c')](db[_0x2fba('0x45')],{'as':'Items','onDelete':_0x2fba('0x111')});db[_0x2fba('0x47')][_0x2fba('0x10c')](db[_0x2fba('0x15b')],{'as':_0x2fba('0x15c'),'foreignKey':_0x2fba('0x16e'),'onDelete':_0x2fba('0x111')});db['FaxAccount']['hasMany'](db[_0x2fba('0x7e')],{'as':'Answers','foreignKey':_0x2fba('0x16e')});db[_0x2fba('0x47')][_0x2fba('0x10c')](db[_0x2fba('0x4b')],{'as':_0x2fba('0x15d')});db[_0x2fba('0x47')][_0x2fba('0x10c')](db[_0x2fba('0x49')],{'as':_0x2fba('0x16f')});db[_0x2fba('0x47')]['hasMany'](db[_0x2fba('0x18')],{'as':_0x2fba('0x170'),'onDelete':_0x2fba('0x111')});db['FaxAccount'][_0x2fba('0x10c')](db[_0x2fba('0x171')],{'as':_0x2fba('0x14e')});db[_0x2fba('0x47')]['belongsTo'](db[_0x2fba('0x28')],{'as':_0x2fba('0x28')});db['FaxAccount']['belongsTo'](db[_0x2fba('0x121')],{'as':_0x2fba('0x15e'),'foreignKey':_0x2fba('0x15f')});db[_0x2fba('0x47')][_0x2fba('0x146')](db[_0x2fba('0x83')],{'as':_0x2fba('0x149'),'foreignKey':_0x2fba('0x14a')});db[_0x2fba('0x47')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':'Agents','through':'user_has_fax_accounts'});db['FaxApplication']['belongsTo'](db['User'],{'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x49')][_0x2fba('0x146')](db[_0x2fba('0x4d')],{'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x49')][_0x2fba('0x146')](db['FaxAccount'],{'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x49')]['belongsTo'](db[_0x2fba('0x89')],{'onDelete':'restrict','foreignKey':_0x2fba('0x16d')});db[_0x2fba('0x4b')][_0x2fba('0x10c')](db['FaxMessage'],{'as':_0x2fba('0x14e'),'onDelete':_0x2fba('0x111'),'foreignKey':'FaxInteractionId'});db[_0x2fba('0x4b')][_0x2fba('0x146')](db['FaxAccount'],{'as':_0x2fba('0x161'),'foreignKey':_0x2fba('0x16e')});db['FaxInteraction'][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'as':_0x2fba('0x155'),'foreignKey':_0x2fba('0x156')});db[_0x2fba('0x4b')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'as':'Owner','foreignKey':_0x2fba('0x10e')});db[_0x2fba('0x4b')][_0x2fba('0x120')](db[_0x2fba('0x89')],{'through':_0x2fba('0x172'),'as':_0x2fba('0x164')});db['FaxInteraction'][_0x2fba('0x120')](db[_0x2fba('0x89')],{'through':_0x2fba('0x172'),'as':_0x2fba('0x165')});db[_0x2fba('0x4b')]['belongsToMany'](db[_0x2fba('0x10b')],{'as':_0x2fba('0x166'),'through':_0x2fba('0x127'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'onDelete':_0x2fba('0x111'),'as':_0x2fba('0x10b')});db[_0x2fba('0x171')][_0x2fba('0x146')](db[_0x2fba('0x4b')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0x2fba('0x171')][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'onDelete':'cascade','as':'Contact'});db[_0x2fba('0x171')]['belongsTo'](db[_0x2fba('0x168')],{'as':'Attachment','foreignKey':_0x2fba('0x173')});db[_0x2fba('0x171')][_0x2fba('0x146')](db[_0x2fba('0x47')],{'as':_0x2fba('0x161'),'foreignKey':'FaxAccountId'});db[_0x2fba('0x4d')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':'Agents','through':_0x2fba('0x30')});db['FaxQueue'][_0x2fba('0x120')](db['Team'],{'through':_0x2fba('0x174'),'as':_0x2fba('0x14c')});db[_0x2fba('0x4e')][_0x2fba('0x146')](db[_0x2fba('0x47')],{});db[_0x2fba('0x4e')][_0x2fba('0x146')](db['CmList'],{'as':_0x2fba('0x15e'),'foreignKey':_0x2fba('0x15f')});db[_0x2fba('0x4e')][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'as':_0x2fba('0x155'),'foreignKey':_0x2fba('0x156')});db['FaxQueueReport'][_0x2fba('0x146')](db[_0x2fba('0x4b')],{});db[_0x2fba('0x4e')][_0x2fba('0x146')](db[_0x2fba('0x171')],{});db[_0x2fba('0x4e')][_0x2fba('0x146')](db['User'],{});db[_0x2fba('0x4e')][_0x2fba('0x146')](db[_0x2fba('0x4d')],{});db[_0x2fba('0x138')]['hasMany'](db['Disposition'],{'as':_0x2fba('0x15c'),'foreignKey':_0x2fba('0x175'),'onDelete':'cascade'});db['SmsAccount']['hasMany'](db['CannedAnswer'],{'as':_0x2fba('0x176'),'foreignKey':'SmsAccountId'});db[_0x2fba('0x138')]['hasMany'](db[_0x2fba('0x177')],{'as':_0x2fba('0x14e'),'foreignKey':_0x2fba('0x175')});db[_0x2fba('0x138')][_0x2fba('0x10c')](db['SmsInteraction'],{'as':_0x2fba('0x15d')});db[_0x2fba('0x138')][_0x2fba('0x10c')](db[_0x2fba('0x51')],{'as':_0x2fba('0x16f')});db[_0x2fba('0x138')][_0x2fba('0x146')](db[_0x2fba('0x121')],{'as':'List','foreignKey':_0x2fba('0x15f')});db['SmsAccount'][_0x2fba('0x146')](db[_0x2fba('0x83')],{'as':'mandatoryDispositionPause','foreignKey':_0x2fba('0x14a')});db[_0x2fba('0x138')][_0x2fba('0x120')](db['User'],{'as':_0x2fba('0x14b'),'through':'user_has_sms_accounts'});db[_0x2fba('0x51')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'onDelete':_0x2fba('0x16c')});db['SmsApplication'][_0x2fba('0x146')](db[_0x2fba('0x55')],{'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x51')][_0x2fba('0x146')](db[_0x2fba('0x138')],{'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x51')][_0x2fba('0x146')](db[_0x2fba('0x147')],{'onDelete':_0x2fba('0x16c'),'foreignKey':_0x2fba('0x148')});db[_0x2fba('0x51')][_0x2fba('0x146')](db[_0x2fba('0x89')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x2fba('0x52')][_0x2fba('0x10c')](db[_0x2fba('0x177')],{'as':_0x2fba('0x14e'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x178')});db[_0x2fba('0x52')]['belongsTo'](db[_0x2fba('0x138')],{'as':_0x2fba('0x161'),'foreignKey':'SmsAccountId'});db['SmsInteraction']['belongsTo'](db[_0x2fba('0x11d')],{'as':_0x2fba('0x155'),'foreignKey':_0x2fba('0x156')});db['SmsInteraction'][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'as':'Owner','foreignKey':_0x2fba('0x10e')});db['SmsInteraction'][_0x2fba('0x120')](db[_0x2fba('0x89')],{'through':'sms_interaction_has_tags','as':_0x2fba('0x164')});db[_0x2fba('0x52')]['belongsToMany'](db[_0x2fba('0x89')],{'through':'sms_interaction_has_tags','as':_0x2fba('0x165')});db[_0x2fba('0x52')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x166'),'through':_0x2fba('0x128'),'foreignKey':_0x2fba('0x178')});db[_0x2fba('0x177')][_0x2fba('0x146')](db['User'],{'as':'User'});db[_0x2fba('0x177')]['belongsTo'](db[_0x2fba('0x11d')],{'onDelete':'cascade','as':_0x2fba('0x155')});db['SmsMessage']['belongsTo'](db[_0x2fba('0x52')],{'onDelete':_0x2fba('0x111'),'as':_0x2fba('0x179'),'foreignKey':_0x2fba('0x178')});db[_0x2fba('0x177')][_0x2fba('0x146')](db[_0x2fba('0x138')],{'as':_0x2fba('0x161'),'foreignKey':_0x2fba('0x175')});db['SmsQueue'][_0x2fba('0x120')](db['User'],{'as':'Agents','through':_0x2fba('0x32'),'foreignKey':_0x2fba('0x17a')});db[_0x2fba('0x55')]['belongsToMany'](db['Team'],{'through':_0x2fba('0x17b'),'as':_0x2fba('0x14c')});db[_0x2fba('0x57')][_0x2fba('0x10c')](db[_0x2fba('0x15b')],{'as':_0x2fba('0x15c'),'foreignKey':_0x2fba('0x17c'),'onDelete':_0x2fba('0x111')});db[_0x2fba('0x57')][_0x2fba('0x10c')](db[_0x2fba('0x7e')],{'as':_0x2fba('0x176'),'foreignKey':_0x2fba('0x17c')});db[_0x2fba('0x57')]['hasMany'](db[_0x2fba('0x5a')],{'as':_0x2fba('0x15d'),'foreignKey':_0x2fba('0x17c')});db[_0x2fba('0x57')][_0x2fba('0x10c')](db[_0x2fba('0x5c')],{'as':'Messages','foreignKey':_0x2fba('0x17c')});db[_0x2fba('0x57')]['hasMany'](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0x2fba('0x17c')});db[_0x2fba('0x57')][_0x2fba('0x146')](db[_0x2fba('0x121')],{'as':'List','foreignKey':_0x2fba('0x15f')});db['OpenchannelAccount'][_0x2fba('0x146')](db[_0x2fba('0x83')],{'as':_0x2fba('0x149'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2fba('0x57')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x14b'),'through':_0x2fba('0x137')});db[_0x2fba('0x58')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x58')][_0x2fba('0x146')](db[_0x2fba('0x5d')],{'onDelete':'restrict','foreignKey':_0x2fba('0x17d')});db[_0x2fba('0x58')][_0x2fba('0x146')](db[_0x2fba('0x57')],{'onDelete':_0x2fba('0x16c'),'foreignKey':_0x2fba('0x17c')});db['OpenchannelApplication'][_0x2fba('0x146')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x2fba('0x148')});db['OpenchannelApplication'][_0x2fba('0x146')](db['Tag'],{'onDelete':_0x2fba('0x16c'),'foreignKey':_0x2fba('0x16d')});db['OpenchannelInteraction'][_0x2fba('0x10c')](db['OpenchannelMessage'],{'as':_0x2fba('0x14e'),'onDelete':'cascade','foreignKey':_0x2fba('0x17e')});db['OpenchannelInteraction'][_0x2fba('0x146')](db[_0x2fba('0x57')],{'as':_0x2fba('0x161'),'foreignKey':_0x2fba('0x17c')});db[_0x2fba('0x5a')][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'as':'Contact','foreignKey':_0x2fba('0x156')});db[_0x2fba('0x5a')][_0x2fba('0x146')](db['User'],{'as':_0x2fba('0x162'),'foreignKey':'UserId'});db[_0x2fba('0x5a')][_0x2fba('0x120')](db[_0x2fba('0x89')],{'through':_0x2fba('0x17f'),'as':_0x2fba('0x164')});db[_0x2fba('0x5a')][_0x2fba('0x120')](db[_0x2fba('0x89')],{'through':'openchannel_interaction_has_tags','as':_0x2fba('0x165')});db[_0x2fba('0x5a')]['belongsToMany'](db[_0x2fba('0x10b')],{'as':_0x2fba('0x166'),'through':_0x2fba('0x129'),'foreignKey':'OpenchannelInteractionId'});db[_0x2fba('0x5c')][_0x2fba('0x146')](db['User'],{'onDelete':'cascade','as':_0x2fba('0x10b')});db['OpenchannelMessage'][_0x2fba('0x146')](db['CmContact'],{'onDelete':_0x2fba('0x111'),'as':_0x2fba('0x155')});db[_0x2fba('0x5c')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':'cascade','as':_0x2fba('0x179'),'foreignKey':_0x2fba('0x17e')});db['OpenchannelMessage'][_0x2fba('0x146')](db[_0x2fba('0x168')],{'as':_0x2fba('0x168'),'foreignKey':_0x2fba('0x173')});db['OpenchannelMessage'][_0x2fba('0x146')](db['OpenchannelAccount'],{'as':_0x2fba('0x161'),'foreignKey':'OpenchannelAccountId'});db[_0x2fba('0x5d')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x14b'),'through':_0x2fba('0x34'),'foreignKey':_0x2fba('0x17d')});db[_0x2fba('0x5d')][_0x2fba('0x120')](db[_0x2fba('0xe3')],{'through':'team_has_openchannel_queues','as':'Teams'});db['ChatWebsite'][_0x2fba('0x10c')](db[_0x2fba('0x15b')],{'as':_0x2fba('0x15c'),'foreignKey':_0x2fba('0x169'),'onDelete':_0x2fba('0x111')});db[_0x2fba('0x5f')][_0x2fba('0x10c')](db['CannedAnswer'],{'as':_0x2fba('0x176'),'foreignKey':'ChatWebsiteId'});db[_0x2fba('0x5f')][_0x2fba('0x10c')](db[_0x2fba('0x6b')],{'as':_0x2fba('0x180')});db[_0x2fba('0x5f')][_0x2fba('0x10c')](db[_0x2fba('0x64')],{'as':_0x2fba('0x15d')});db[_0x2fba('0x5f')][_0x2fba('0x10c')](db[_0x2fba('0x63')],{'as':_0x2fba('0x16f')});db[_0x2fba('0x5f')]['hasMany'](db[_0x2fba('0x66')],{'as':_0x2fba('0x14e')});db[_0x2fba('0x5f')][_0x2fba('0x146')](db['CmList'],{'as':_0x2fba('0x15e'),'foreignKey':_0x2fba('0x15f')});db[_0x2fba('0x5f')][_0x2fba('0x146')](db[_0x2fba('0x147')],{'as':_0x2fba('0x147'),'foreignKey':'IntervalId'});db[_0x2fba('0x5f')][_0x2fba('0x146')](db['MailAccount'],{'as':_0x2fba('0x3b'),'foreignKey':'MailAccountId'});db[_0x2fba('0x5f')][_0x2fba('0x146')](db[_0x2fba('0x83')],{'as':_0x2fba('0x149'),'foreignKey':_0x2fba('0x14a')});db['ChatWebsite'][_0x2fba('0x120')](db['User'],{'as':'Agents','through':'user_has_chat_websites'});db[_0x2fba('0x61')][_0x2fba('0x146')](db[_0x2fba('0x57')],{});db[_0x2fba('0x61')]['belongsTo'](db[_0x2fba('0x121')],{'as':_0x2fba('0x15e'),'foreignKey':_0x2fba('0x15f')});db[_0x2fba('0x61')][_0x2fba('0x146')](db['CmContact'],{'as':_0x2fba('0x155'),'foreignKey':'ContactId'});db[_0x2fba('0x61')][_0x2fba('0x146')](db[_0x2fba('0x5a')],{});db[_0x2fba('0x61')][_0x2fba('0x146')](db[_0x2fba('0x5c')],{});db[_0x2fba('0x61')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{});db[_0x2fba('0x61')]['belongsTo'](db[_0x2fba('0x5d')],{});db['ChatApplication'][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x181'),'foreignKey':_0x2fba('0x10e'),'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x63')][_0x2fba('0x146')](db[_0x2fba('0x12e')],{'as':_0x2fba('0x182'),'foreignKey':_0x2fba('0x183'),'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x63')][_0x2fba('0x146')](db[_0x2fba('0x5f')],{'as':_0x2fba('0x184'),'foreignKey':'ChatWebsiteId','onDelete':_0x2fba('0x16c')});db['ChatApplication']['belongsTo'](db['Tag'],{'onDelete':_0x2fba('0x16c'),'foreignKey':_0x2fba('0x16d')});db[_0x2fba('0x64')][_0x2fba('0x10c')](db[_0x2fba('0x66')],{'as':_0x2fba('0x14e'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x185')});db[_0x2fba('0x64')][_0x2fba('0x146')](db[_0x2fba('0x5f')],{'as':_0x2fba('0x161'),'foreignKey':_0x2fba('0x169')});db['ChatInteraction'][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'as':_0x2fba('0x155'),'foreignKey':_0x2fba('0x156')});db[_0x2fba('0x64')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x162'),'foreignKey':_0x2fba('0x10e')});db[_0x2fba('0x64')][_0x2fba('0x120')](db[_0x2fba('0x89')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0x2fba('0x64')]['belongsToMany'](db[_0x2fba('0x89')],{'through':_0x2fba('0x186'),'as':_0x2fba('0x165')});db[_0x2fba('0x64')]['belongsToMany'](db[_0x2fba('0x10b')],{'as':_0x2fba('0x166'),'through':'user_has_chat_interactions','foreignKey':_0x2fba('0x185')});db[_0x2fba('0x66')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'onDelete':_0x2fba('0x111'),'as':_0x2fba('0x10b')});db['ChatMessage'][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'onDelete':'cascade','as':_0x2fba('0x155'),'foreignKey':'ContactId'});db[_0x2fba('0x66')]['belongsTo'](db[_0x2fba('0x64')],{'onDelete':_0x2fba('0x111'),'as':_0x2fba('0x179'),'foreignKey':_0x2fba('0x185')});db[_0x2fba('0x66')][_0x2fba('0x146')](db['Attachment'],{'as':_0x2fba('0x168'),'foreignKey':_0x2fba('0x173')});db[_0x2fba('0x66')][_0x2fba('0x146')](db[_0x2fba('0x5f')],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0x2fba('0x10c')](db[_0x2fba('0x168')],{'as':_0x2fba('0x187'),'foreignKey':_0x2fba('0x16b'),'onDelete':_0x2fba('0x111'),'hooks':!![]});db[_0x2fba('0x16a')][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'onDelete':_0x2fba('0x111'),'as':_0x2fba('0x155'),'foreignKey':_0x2fba('0x156')});db['ChatOfflineMessage'][_0x2fba('0x146')](db[_0x2fba('0x5f')],{'as':_0x2fba('0x161'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x14b'),'through':'UserChatQueue','hooks':!![]});db[_0x2fba('0x12e')][_0x2fba('0x120')](db[_0x2fba('0xe3')],{'through':_0x2fba('0x188'),'as':_0x2fba('0x14c')});db['ChatGroup']['hasMany'](db[_0x2fba('0x189')],{'as':_0x2fba('0x14e'),'foreignKey':_0x2fba('0x18a'),'onDelete':_0x2fba('0x111')});db[_0x2fba('0x69')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x143'),'through':_0x2fba('0x11c')});db[_0x2fba('0x6b')][_0x2fba('0x146')](db[_0x2fba('0x5f')],{'as':_0x2fba('0x184'),'foreignKey':_0x2fba('0x169')});db[_0x2fba('0x6d')][_0x2fba('0x10c')](db['CmContact'],{'as':'Contacts','foreignKey':_0x2fba('0x18b')});db[_0x2fba('0x11d')][_0x2fba('0x10c')](db[_0x2fba('0x70')],{'as':'Hoppers','foreignKey':_0x2fba('0x156')});db[_0x2fba('0x11d')][_0x2fba('0x10c')](db[_0x2fba('0x74')],{'as':_0x2fba('0x112'),'foreignKey':_0x2fba('0x156')});db[_0x2fba('0x11d')]['hasMany'](db[_0x2fba('0x75')],{'as':'HopperHistories','foreignKey':_0x2fba('0x156')});db[_0x2fba('0x11d')][_0x2fba('0x10c')](db[_0x2fba('0x77')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0x2fba('0x11d')][_0x2fba('0x10c')](db['JscriptySessionReport'],{'as':_0x2fba('0x145'),'foreignKey':'ContactId'});db[_0x2fba('0x11d')][_0x2fba('0x10c')](db[_0x2fba('0x5a')],{'as':'OpenchannelInteractions','foreignKey':_0x2fba('0x156'),'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x11d')][_0x2fba('0x10c')](db[_0x2fba('0x64')],{'as':_0x2fba('0x125'),'foreignKey':_0x2fba('0x156'),'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x11d')][_0x2fba('0x10c')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x2fba('0x11d')][_0x2fba('0x10c')](db['FaxInteraction'],{'as':_0x2fba('0x116'),'foreignKey':_0x2fba('0x156'),'onDelete':_0x2fba('0x16c')});db[_0x2fba('0x11d')]['hasMany'](db['MailInteraction'],{'as':_0x2fba('0x18c'),'foreignKey':_0x2fba('0x156'),'onDelete':_0x2fba('0x16c')});db['CmContact'][_0x2fba('0x146')](db[_0x2fba('0x6d')],{'as':_0x2fba('0x18d'),'foreignKey':_0x2fba('0x18b')});db[_0x2fba('0x11d')][_0x2fba('0x146')](db[_0x2fba('0x121')],{'as':_0x2fba('0x15e'),'foreignKey':_0x2fba('0x15f'),'onDelete':'cascade'});db[_0x2fba('0x11d')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x166'),'through':_0x2fba('0x11f')});db['CmContact'][_0x2fba('0x120')](db[_0x2fba('0x89')],{'as':_0x2fba('0x164'),'through':_0x2fba('0x18e')});db[_0x2fba('0x11d')][_0x2fba('0x120')](db['Tag'],{'through':_0x2fba('0x18e'),'as':_0x2fba('0x165')});db[_0x2fba('0x70')]['belongsTo'](db['CmContact'],{'as':_0x2fba('0x155'),'foreignKey':_0x2fba('0x156'),'onDelete':_0x2fba('0x111')});db[_0x2fba('0x70')]['belongsTo'](db[_0x2fba('0x121')],{'as':'List','foreignKey':_0x2fba('0x15f'),'onDelete':'cascade'});db[_0x2fba('0x70')]['belongsTo'](db[_0x2fba('0x10b')],{'as':_0x2fba('0x181'),'foreignKey':_0x2fba('0x10e')});db[_0x2fba('0x70')][_0x2fba('0x146')](db[_0x2fba('0x19')],{'as':_0x2fba('0x182'),'foreignKey':_0x2fba('0x144'),'onDelete':'cascade'});db['CmHopper'][_0x2fba('0x146')](db['Campaign'],{'as':_0x2fba('0xe5'),'foreignKey':_0x2fba('0x18f'),'onDelete':_0x2fba('0x111')});db['CmHopper'][_0x2fba('0x146')](db['User'],{'as':_0x2fba('0x162'),'foreignKey':'OwnerId'});db['CmHopperBlack'][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'as':'Contact','foreignKey':_0x2fba('0x156'),'onDelete':'cascade'});db[_0x2fba('0x72')]['belongsTo'](db[_0x2fba('0x121')],{'as':_0x2fba('0x15e'),'foreignKey':'ListId','onDelete':_0x2fba('0x111')});db[_0x2fba('0x72')][_0x2fba('0x146')](db['VoiceQueue'],{'as':_0x2fba('0x182'),'foreignKey':_0x2fba('0x144'),'onDelete':_0x2fba('0x111')});db[_0x2fba('0x72')][_0x2fba('0x146')](db['Campaign'],{'as':_0x2fba('0xe5'),'foreignKey':_0x2fba('0x18f'),'onDelete':'cascade'});db[_0x2fba('0x7c')]['hasMany'](db[_0x2fba('0x80')],{'as':{'plural':_0x2fba('0x190'),'singular':_0x2fba('0x191')},'foreignKey':_0x2fba('0x192'),'onDelete':_0x2fba('0x111'),'hooks':!![]});db[_0x2fba('0x7c')][_0x2fba('0x10c')](db['Condition'],{'as':{'plural':_0x2fba('0x193'),'singular':_0x2fba('0x194')},'foreignKey':'AutomationAnyId','onDelete':_0x2fba('0x111'),'hooks':!![]});db[_0x2fba('0x7c')][_0x2fba('0x10c')](db['Action'],{'as':_0x2fba('0x195'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db['Disposition'][_0x2fba('0x10c')](db[_0x2fba('0x15b')],{'as':'Dispositions','foreignKey':'ParentId','onDelete':_0x2fba('0x111')});db[_0x2fba('0x147')][_0x2fba('0x10c')](db[_0x2fba('0x147')],{'as':_0x2fba('0x196'),'foreignKey':_0x2fba('0x148'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x2fba('0x147')][_0x2fba('0x10c')](db[_0x2fba('0x18')],{'as':'Extensions','foreignKey':_0x2fba('0x148'),'onDelete':_0x2fba('0x16c')});db['Interval']['hasMany'](db[_0x2fba('0x40')],{'as':_0x2fba('0x197'),'foreignKey':_0x2fba('0x148')});db[_0x2fba('0x147')]['hasMany'](db[_0x2fba('0x63')],{'as':_0x2fba('0x198'),'foreignKey':_0x2fba('0x148')});db[_0x2fba('0x147')][_0x2fba('0x10c')](db[_0x2fba('0x49')],{'as':_0x2fba('0x199'),'foreignKey':'IntervalId'});db[_0x2fba('0x147')]['hasMany'](db['SmsApplication'],{'as':_0x2fba('0x19a'),'foreignKey':_0x2fba('0x148')});db[_0x2fba('0x86')][_0x2fba('0x146')](db[_0x2fba('0x3b')],{});db[_0x2fba('0x86')][_0x2fba('0x146')](db[_0x2fba('0x95')],{'foreignKey':_0x2fba('0x19b')});db['Schedule']['belongsTo'](db[_0x2fba('0x19c')],{'foreignKey':'CustomReportId'});db[_0x2fba('0x88')]['belongsToMany'](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0x2fba('0x142'),'onDelete':'restrict'});db[_0x2fba('0x89')][_0x2fba('0x120')](db['CmContact'],{'through':_0x2fba('0x18e')});db[_0x2fba('0x89')][_0x2fba('0x120')](db['ChatInteraction'],{'through':_0x2fba('0x186')});db[_0x2fba('0x89')][_0x2fba('0x120')](db[_0x2fba('0x117')],{'through':'mail_interaction_has_tags'});db[_0x2fba('0x89')]['belongsToMany'](db[_0x2fba('0x52')],{'through':_0x2fba('0x19d')});db[_0x2fba('0x89')]['belongsToMany'](db[_0x2fba('0x4b')],{'through':'fax_interaction_has_tags'});db[_0x2fba('0x89')][_0x2fba('0x120')](db[_0x2fba('0x5a')],{'through':_0x2fba('0x17f')});db[_0x2fba('0x89')]['belongsToMany'](db[_0x2fba('0x100')],{'through':_0x2fba('0x19e')});db['Trigger'][_0x2fba('0x10c')](db[_0x2fba('0x80')],{'as':{'plural':'AllConditions','singular':_0x2fba('0x19f')},'foreignKey':_0x2fba('0x1a0'),'onDelete':_0x2fba('0x111'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x2fba('0x80')],{'as':{'plural':_0x2fba('0x1a1'),'singular':_0x2fba('0x1a2')},'foreignKey':_0x2fba('0x1a3'),'onDelete':'cascade','hooks':!![]});db['Trigger'][_0x2fba('0x10c')](db[_0x2fba('0x7a')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0x2fba('0x111'),'hooks':!![]});db[_0x2fba('0x19c')][_0x2fba('0x10c')](db[_0x2fba('0x9a')],{'as':_0x2fba('0x1a4'),'onDelete':'cascade','foreignKey':_0x2fba('0x1a5'),'hooks':!![]});db[_0x2fba('0x95')][_0x2fba('0x10c')](db[_0x2fba('0x9a')],{'as':'Fields','onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x19b')});db[_0x2fba('0x98')]['hasMany'](db[_0x2fba('0x9a')],{'as':_0x2fba('0x1a4'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1a6')});db[_0x2fba('0x9a')][_0x2fba('0x146')](db[_0x2fba('0x98')],{'foreignKey':'MetricId'});db[_0x2fba('0x9e')][_0x2fba('0x10c')](db['SalesforceConfiguration'],{'as':_0x2fba('0x1a7'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1a8')});db[_0x2fba('0xa0')][_0x2fba('0x10c')](db[_0x2fba('0xa2')],{'as':_0x2fba('0x1a9'),'onDelete':'cascade','foreignKey':_0x2fba('0x1aa')});db[_0x2fba('0xa0')][_0x2fba('0x10c')](db['SalesforceField'],{'as':_0x2fba('0x1ab'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x2fba('0xa0')][_0x2fba('0x10c')](db[_0x2fba('0xa2')],{'as':'Fields','onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0xa0')][_0x2fba('0x146')](db[_0x2fba('0x9e')],{'as':'Account','foreignKey':_0x2fba('0x1a8')});db['SalesforceField'][_0x2fba('0x10c')](db['SalesforceField'],{'as':_0x2fba('0x1ad'),'foreignKey':_0x2fba('0x1aa')});db['SalesforceField'][_0x2fba('0x10c')](db[_0x2fba('0xa2')],{'as':_0x2fba('0x1ae'),'foreignKey':'DescriptionId'});db[_0x2fba('0xa2')]['hasMany'](db['SalesforceField'],{'as':_0x2fba('0x1af'),'foreignKey':_0x2fba('0x1ac')});db['SalesforceField']['belongsTo'](db[_0x2fba('0x8f')],{'as':_0x2fba('0x8f'),'foreignKey':_0x2fba('0x1b0')});db[_0x2fba('0xa4')][_0x2fba('0x10c')](db[_0x2fba('0xa6')],{'as':_0x2fba('0x1a7'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1a8')});db[_0x2fba('0xa6')][_0x2fba('0x10c')](db['SugarcrmField'],{'as':_0x2fba('0x1a9'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1aa')});db[_0x2fba('0xa6')][_0x2fba('0x10c')](db['SugarcrmField'],{'as':_0x2fba('0x1ab'),'onDelete':_0x2fba('0x111'),'foreignKey':'DescriptionId'});db[_0x2fba('0xa6')][_0x2fba('0x10c')](db[_0x2fba('0xa8')],{'as':'Fields','onDelete':_0x2fba('0x111'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0x2fba('0x146')](db['SugarcrmAccount'],{'as':_0x2fba('0x161'),'foreignKey':'AccountId'});db['SugarcrmField']['hasMany'](db['SugarcrmField'],{'as':_0x2fba('0x1ad'),'foreignKey':_0x2fba('0x1aa')});db[_0x2fba('0xa8')][_0x2fba('0x10c')](db[_0x2fba('0xa8')],{'as':_0x2fba('0x1ae'),'foreignKey':'DescriptionId'});db['SugarcrmField'][_0x2fba('0x10c')](db['SugarcrmField'],{'as':_0x2fba('0x1af'),'foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0xa8')][_0x2fba('0x146')](db[_0x2fba('0x8f')],{'as':_0x2fba('0x8f'),'foreignKey':'VariableId'});db[_0x2fba('0x1b1')][_0x2fba('0x10c')](db[_0x2fba('0xab')],{'as':_0x2fba('0x1a7'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1a8')});db[_0x2fba('0xab')][_0x2fba('0x10c')](db[_0x2fba('0xac')],{'as':_0x2fba('0x1a9'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1aa')});db['DeskConfiguration']['hasMany'](db[_0x2fba('0xac')],{'as':_0x2fba('0x1ab'),'onDelete':_0x2fba('0x111'),'foreignKey':'DescriptionId'});db[_0x2fba('0xab')][_0x2fba('0x10c')](db[_0x2fba('0xac')],{'as':_0x2fba('0x1a4'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0xab')][_0x2fba('0x146')](db[_0x2fba('0x1b1')],{'as':_0x2fba('0x161'),'foreignKey':_0x2fba('0x1a8')});db[_0x2fba('0xab')][_0x2fba('0x120')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db[_0x2fba('0xac')]['hasMany'](db[_0x2fba('0xac')],{'as':_0x2fba('0x1ad'),'foreignKey':_0x2fba('0x1aa')});db['DeskField']['hasMany'](db[_0x2fba('0xac')],{'as':_0x2fba('0x1ae'),'foreignKey':_0x2fba('0x1b2')});db[_0x2fba('0xac')][_0x2fba('0x10c')](db[_0x2fba('0xac')],{'as':'Field','foreignKey':'FieldId'});db[_0x2fba('0xac')][_0x2fba('0x146')](db[_0x2fba('0x8f')],{'as':_0x2fba('0x8f'),'foreignKey':'VariableId'});db[_0x2fba('0x1b3')]['hasMany'](db[_0x2fba('0xaf')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x2fba('0x1a8')});db[_0x2fba('0xaf')]['hasMany'](db['ZohoField'],{'as':_0x2fba('0x1a9'),'onDelete':'cascade','foreignKey':_0x2fba('0x1aa')});db[_0x2fba('0xaf')][_0x2fba('0x10c')](db[_0x2fba('0x1b4')],{'as':_0x2fba('0x1ab'),'onDelete':'cascade','foreignKey':_0x2fba('0x1b2')});db[_0x2fba('0xaf')][_0x2fba('0x10c')](db[_0x2fba('0x1b4')],{'as':_0x2fba('0x1a4'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0xaf')]['belongsTo'](db['ZohoAccount'],{'as':_0x2fba('0x161'),'foreignKey':_0x2fba('0x1a8')});db[_0x2fba('0x1b4')][_0x2fba('0x10c')](db[_0x2fba('0x1b4')],{'as':_0x2fba('0x1ad'),'foreignKey':_0x2fba('0x1aa')});db[_0x2fba('0x1b4')][_0x2fba('0x10c')](db['ZohoField'],{'as':_0x2fba('0x1ae'),'foreignKey':'DescriptionId'});db[_0x2fba('0x1b4')][_0x2fba('0x10c')](db['ZohoField'],{'as':_0x2fba('0x1af'),'foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0x1b4')][_0x2fba('0x146')](db[_0x2fba('0x8f')],{'as':_0x2fba('0x8f'),'foreignKey':_0x2fba('0x1b0')});db[_0x2fba('0xb2')][_0x2fba('0x10c')](db['ZendeskConfiguration'],{'as':_0x2fba('0x1a7'),'onDelete':_0x2fba('0x111'),'foreignKey':'AccountId'});db[_0x2fba('0xb3')][_0x2fba('0x10c')](db[_0x2fba('0xb5')],{'as':'Subjects','foreignKey':_0x2fba('0x1aa')});db[_0x2fba('0xb3')]['hasMany'](db[_0x2fba('0xb5')],{'as':'Descriptions','foreignKey':_0x2fba('0x1b2')});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':'Fields','foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0xb3')]['belongsTo'](db['ZendeskAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x2fba('0xb3')][_0x2fba('0x120')](db[_0x2fba('0x89')],{'through':_0x2fba('0x1b5')});db[_0x2fba('0xb5')][_0x2fba('0x10c')](db[_0x2fba('0xb5')],{'as':'Subject','foreignKey':_0x2fba('0x1aa')});db[_0x2fba('0xb5')]['hasMany'](db[_0x2fba('0xb5')],{'as':'Description','foreignKey':_0x2fba('0x1b2')});db[_0x2fba('0xb5')][_0x2fba('0x10c')](db[_0x2fba('0xb5')],{'as':_0x2fba('0x1af'),'foreignKey':_0x2fba('0x1ac')});db['ZendeskField'][_0x2fba('0x146')](db[_0x2fba('0x8f')],{'as':_0x2fba('0x8f'),'foreignKey':_0x2fba('0x1b0')});db[_0x2fba('0xb7')][_0x2fba('0x10c')](db[_0x2fba('0x1b6')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x2fba('0x10c')](db[_0x2fba('0xba')],{'as':_0x2fba('0x1a9'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x2fba('0x1b6')][_0x2fba('0x10c')](db[_0x2fba('0xba')],{'as':_0x2fba('0x1ab'),'onDelete':_0x2fba('0x111'),'foreignKey':'DescriptionId'});db[_0x2fba('0x1b6')]['hasMany'](db[_0x2fba('0xba')],{'as':_0x2fba('0x1a4'),'onDelete':_0x2fba('0x111'),'foreignKey':'FieldId'});db[_0x2fba('0x1b6')][_0x2fba('0x146')](db[_0x2fba('0xb7')],{'as':'Account','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x2fba('0x120')](db[_0x2fba('0x89')],{'through':_0x2fba('0x1b7')});db[_0x2fba('0xba')][_0x2fba('0x10c')](db[_0x2fba('0xba')],{'as':_0x2fba('0x1ad'),'foreignKey':_0x2fba('0x1aa')});db[_0x2fba('0xba')]['hasMany'](db['FreshdeskField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x2fba('0xba')][_0x2fba('0x10c')](db['FreshdeskField'],{'as':_0x2fba('0x1af'),'foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0xba')]['belongsTo'](db['Variable'],{'as':_0x2fba('0x8f'),'foreignKey':_0x2fba('0x1b0')});db['VtigerAccount'][_0x2fba('0x10c')](db[_0x2fba('0xbc')],{'as':_0x2fba('0x1a7'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1a8')});db[_0x2fba('0xbc')]['hasMany'](db[_0x2fba('0x1b8')],{'as':_0x2fba('0x1a9'),'foreignKey':_0x2fba('0x1aa')});db[_0x2fba('0xbc')][_0x2fba('0x10c')](db['VtigerField'],{'as':_0x2fba('0x1ab'),'foreignKey':_0x2fba('0x1b2')});db[_0x2fba('0xbc')]['hasMany'](db[_0x2fba('0x1b8')],{'as':_0x2fba('0x1a4'),'foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0xbc')][_0x2fba('0x146')](db[_0x2fba('0xbb')],{'as':_0x2fba('0x161'),'foreignKey':_0x2fba('0x1a8')});db[_0x2fba('0x1b8')][_0x2fba('0x10c')](db[_0x2fba('0x1b8')],{'as':_0x2fba('0x1ad'),'foreignKey':'SubjectId'});db[_0x2fba('0x1b8')][_0x2fba('0x10c')](db[_0x2fba('0x1b8')],{'as':_0x2fba('0x1ae'),'foreignKey':_0x2fba('0x1b2')});db['VtigerField'][_0x2fba('0x10c')](db[_0x2fba('0x1b8')],{'as':_0x2fba('0x1af'),'foreignKey':'FieldId'});db['VtigerField'][_0x2fba('0x146')](db[_0x2fba('0x8f')],{'as':_0x2fba('0x8f'),'foreignKey':'VariableId'});db[_0x2fba('0xbf')][_0x2fba('0x10c')](db[_0x2fba('0xc1')],{'as':_0x2fba('0x1a7'),'onDelete':'cascade','foreignKey':_0x2fba('0x1a8')});db[_0x2fba('0xc1')][_0x2fba('0x10c')](db[_0x2fba('0x1b9')],{'as':_0x2fba('0x1a9'),'foreignKey':_0x2fba('0x1aa')});db[_0x2fba('0xc1')][_0x2fba('0x10c')](db[_0x2fba('0x1b9')],{'as':_0x2fba('0x1ab'),'foreignKey':_0x2fba('0x1b2')});db[_0x2fba('0xc1')][_0x2fba('0x10c')](db[_0x2fba('0x1b9')],{'as':'Fields','foreignKey':'FieldId'});db[_0x2fba('0xc1')][_0x2fba('0x146')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x2fba('0x1a8')});db[_0x2fba('0x1b9')][_0x2fba('0x10c')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x2fba('0x1aa')});db['ServicenowField'][_0x2fba('0x10c')](db[_0x2fba('0x1b9')],{'as':_0x2fba('0x1ae'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0x2fba('0x10c')](db[_0x2fba('0x1b9')],{'as':_0x2fba('0x1af'),'foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0x1b9')]['belongsTo'](db[_0x2fba('0x8f')],{'as':_0x2fba('0x8f'),'foreignKey':_0x2fba('0x1b0')});db['Dynamics365Account'][_0x2fba('0x10c')](db[_0x2fba('0x1ba')],{'as':_0x2fba('0x1a7'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1a8')});db['Dynamics365Configuration'][_0x2fba('0x10c')](db['Dynamics365Field'],{'as':_0x2fba('0x1a9'),'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1aa')});db[_0x2fba('0x1ba')][_0x2fba('0x10c')](db[_0x2fba('0x1bb')],{'as':_0x2fba('0x1ab'),'onDelete':'cascade','foreignKey':_0x2fba('0x1b2')});db['Dynamics365Configuration'][_0x2fba('0x10c')](db[_0x2fba('0x1bb')],{'as':_0x2fba('0x1a4'),'onDelete':'cascade','foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0x1ba')][_0x2fba('0x146')](db[_0x2fba('0x1bc')],{'as':_0x2fba('0x161'),'foreignKey':_0x2fba('0x1a8')});db['Dynamics365Field'][_0x2fba('0x10c')](db[_0x2fba('0x1bb')],{'as':_0x2fba('0x1ad'),'foreignKey':'SubjectId'});db[_0x2fba('0x1bb')][_0x2fba('0x10c')](db[_0x2fba('0x1bb')],{'as':_0x2fba('0x1ae'),'foreignKey':_0x2fba('0x1b2')});db[_0x2fba('0x1bb')]['hasMany'](db[_0x2fba('0x1bb')],{'as':_0x2fba('0x1af'),'foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0x1bb')]['belongsTo'](db[_0x2fba('0x8f')],{'as':'Variable','foreignKey':_0x2fba('0x1b0')});db['FreshsalesAccount'][_0x2fba('0x10c')](db[_0x2fba('0xc7')],{'as':_0x2fba('0x1a7'),'onDelete':'cascade','foreignKey':_0x2fba('0x1a8')});db[_0x2fba('0xc7')][_0x2fba('0x10c')](db[_0x2fba('0xc9')],{'as':'Subjects','foreignKey':_0x2fba('0x1aa')});db['FreshsalesConfiguration'][_0x2fba('0x10c')](db[_0x2fba('0xc9')],{'as':_0x2fba('0x1ab'),'foreignKey':'DescriptionId'});db[_0x2fba('0xc7')]['hasMany'](db['FreshsalesField'],{'as':_0x2fba('0x1a4'),'foreignKey':_0x2fba('0x1ac')});db['FreshsalesConfiguration']['belongsTo'](db[_0x2fba('0xc5')],{'as':_0x2fba('0x161'),'foreignKey':'AccountId'});db['FreshsalesField'][_0x2fba('0x10c')](db[_0x2fba('0xc9')],{'as':_0x2fba('0x1ad'),'foreignKey':'SubjectId'});db[_0x2fba('0xc9')]['hasMany'](db[_0x2fba('0xc9')],{'as':_0x2fba('0x1ae'),'foreignKey':_0x2fba('0x1b2')});db[_0x2fba('0xc9')][_0x2fba('0x10c')](db[_0x2fba('0xc9')],{'as':'Field','foreignKey':_0x2fba('0x1ac')});db[_0x2fba('0xc9')][_0x2fba('0x146')](db[_0x2fba('0x8f')],{'as':_0x2fba('0x8f'),'foreignKey':_0x2fba('0x1b0')});db[_0x2fba('0xce')][_0x2fba('0x146')](db[_0x2fba('0x5f')],{});db[_0x2fba('0xce')][_0x2fba('0x146')](db['CmList'],{'as':_0x2fba('0x15e'),'foreignKey':_0x2fba('0x15f')});db[_0x2fba('0xce')][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'as':_0x2fba('0x155'),'foreignKey':_0x2fba('0x156')});db[_0x2fba('0xce')]['belongsTo'](db[_0x2fba('0x64')],{});db[_0x2fba('0xce')][_0x2fba('0x146')](db[_0x2fba('0x66')],{});db['ChatQueueReport']['belongsTo'](db[_0x2fba('0x10b')],{});db[_0x2fba('0xce')][_0x2fba('0x146')](db[_0x2fba('0x12e')],{});db[_0x2fba('0x189')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'onDelete':'cascade','foreignKey':_0x2fba('0x1bd')});db[_0x2fba('0x189')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'onDelete':_0x2fba('0x111'),'foreignKey':_0x2fba('0x1be')});db[_0x2fba('0xd5')]['hasMany'](db[_0x2fba('0xd3')],{'foreignKey':_0x2fba('0x1bf'),'onDelete':'cascade'});db['JscriptySessionReport']['hasMany'](db[_0x2fba('0xd1')],{'foreignKey':_0x2fba('0x1bf'),'onDelete':_0x2fba('0x111')});db[_0x2fba('0xd6')][_0x2fba('0x146')](db['SmsAccount'],{});db[_0x2fba('0xd6')]['belongsTo'](db[_0x2fba('0x121')],{'as':_0x2fba('0x15e'),'foreignKey':_0x2fba('0x15f')});db[_0x2fba('0xd6')]['belongsTo'](db[_0x2fba('0x11d')],{'as':_0x2fba('0x155'),'foreignKey':_0x2fba('0x156')});db[_0x2fba('0xd6')]['belongsTo'](db['SmsInteraction'],{});db['SmsQueueReport'][_0x2fba('0x146')](db[_0x2fba('0x177')],{});db[_0x2fba('0xd6')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{});db['SmsQueueReport']['belongsTo'](db[_0x2fba('0x55')],{});db[_0x2fba('0xdb')]['hasMany'](db[_0x2fba('0xd5')],{'foreignKey':'ProjectId'});db[_0x2fba('0xdb')]['hasMany'](db[_0x2fba('0xd3')],{'foreignKey':'ProjectId'});db[_0x2fba('0xdb')]['hasMany'](db[_0x2fba('0xd1')],{'foreignKey':_0x2fba('0x1c0')});db[_0x2fba('0xde')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x166'),'through':_0x2fba('0x13d')});db['Team'][_0x2fba('0x120')](db['User'],{'as':'Agents','through':'user_has_teams'});db[_0x2fba('0xe3')][_0x2fba('0x120')](db[_0x2fba('0x19')],{'through':_0x2fba('0x109'),'as':_0x2fba('0x12b')});db[_0x2fba('0xe3')][_0x2fba('0x120')](db[_0x2fba('0x12c')],{'through':_0x2fba('0x1c1'),'as':_0x2fba('0x1c2')});db[_0x2fba('0xe3')][_0x2fba('0x120')](db['ChatQueue'],{'through':_0x2fba('0x188'),'as':_0x2fba('0x1c3')});db['Team']['belongsToMany'](db[_0x2fba('0x4d')],{'through':_0x2fba('0x174'),'as':_0x2fba('0x1c4')});db[_0x2fba('0xe3')][_0x2fba('0x120')](db[_0x2fba('0x55')],{'through':'team_has_sms_queues','as':_0x2fba('0x1c5')});db[_0x2fba('0xe3')][_0x2fba('0x120')](db['OpenchannelQueue'],{'through':_0x2fba('0x1c6'),'as':_0x2fba('0x130')});db['Team'][_0x2fba('0x120')](db[_0x2fba('0x106')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0x2fba('0xe5')][_0x2fba('0x10c')](db[_0x2fba('0x70')],{'as':_0x2fba('0x1c7'),'foreignKey':_0x2fba('0x18f')});db[_0x2fba('0xe5')][_0x2fba('0x10c')](db[_0x2fba('0x74')],{'as':_0x2fba('0x112'),'foreignKey':_0x2fba('0x18f')});db[_0x2fba('0xe5')][_0x2fba('0x10c')](db[_0x2fba('0x75')],{'as':_0x2fba('0x1c8'),'foreignKey':_0x2fba('0x18f')});db[_0x2fba('0xe5')][_0x2fba('0x10c')](db[_0x2fba('0x72')],{'as':_0x2fba('0x1c9'),'foreignKey':_0x2fba('0x18f')});db[_0x2fba('0xe5')][_0x2fba('0x146')](db[_0x2fba('0x28')],{'as':_0x2fba('0x28'),'foreignKey':_0x2fba('0x1ca')});db[_0x2fba('0xe5')][_0x2fba('0x146')](db[_0x2fba('0x28')],{'as':_0x2fba('0x1cb'),'foreignKey':_0x2fba('0x1cc')});db[_0x2fba('0xe5')][_0x2fba('0x146')](db[_0x2fba('0x147')],{'as':_0x2fba('0x147'),'foreignKey':_0x2fba('0x148')});db['Campaign'][_0x2fba('0x146')](db[_0x2fba('0xde')],{'as':_0x2fba('0xde'),'foreignKey':'SquareProjectId'});db[_0x2fba('0xe5')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0x2fba('0x1cd')});db['Campaign'][_0x2fba('0x120')](db[_0x2fba('0x121')],{'as':_0x2fba('0x14d'),'through':_0x2fba('0x1ce')});db['Attachment'][_0x2fba('0x146')](db[_0x2fba('0x16a')],{'as':_0x2fba('0x16a'),'foreignKey':_0x2fba('0x16b')});db[_0x2fba('0xec')][_0x2fba('0x146')](db['MailMessage'],{});db[_0x2fba('0xec')][_0x2fba('0x146')](db['MailInteraction'],{});db['MailTransferReport'][_0x2fba('0x146')](db[_0x2fba('0x3b')],{'foreignKey':_0x2fba('0x1cf'),'as':_0x2fba('0x1d0')});db[_0x2fba('0xec')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'foreignKey':_0x2fba('0x1d1'),'as':_0x2fba('0x1d2')});db['MailTransferReport'][_0x2fba('0x146')](db['User'],{'foreignKey':_0x2fba('0x1d3'),'as':_0x2fba('0x1d4')});db[_0x2fba('0xec')][_0x2fba('0x146')](db[_0x2fba('0x12c')],{'foreignKey':'ToMailQueueId','as':_0x2fba('0x1d5')});db[_0x2fba('0xec')][_0x2fba('0x146')](db[_0x2fba('0x3b')],{'foreignKey':_0x2fba('0x1d6'),'as':_0x2fba('0x1d7')});db[_0x2fba('0x1d8')][_0x2fba('0x146')](db[_0x2fba('0x66')],{});db[_0x2fba('0x1d8')][_0x2fba('0x146')](db['ChatInteraction'],{});db[_0x2fba('0x1d8')][_0x2fba('0x146')](db[_0x2fba('0x5f')],{'foreignKey':_0x2fba('0x1d9'),'as':_0x2fba('0x1d0')});db[_0x2fba('0x1d8')]['belongsTo'](db['User'],{'foreignKey':_0x2fba('0x1d1'),'as':_0x2fba('0x1d2')});db['ChatTransferReport'][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'foreignKey':_0x2fba('0x1d3'),'as':'ToAgent'});db[_0x2fba('0x1d8')][_0x2fba('0x146')](db['ChatQueue'],{'foreignKey':_0x2fba('0x1da'),'as':_0x2fba('0x1d5')});db['ChatTransferReport'][_0x2fba('0x146')](db['ChatWebsite'],{'foreignKey':_0x2fba('0x1db'),'as':_0x2fba('0x1d7')});db[_0x2fba('0xef')][_0x2fba('0x146')](db['FaxMessage'],{});db['FaxTransferReport']['belongsTo'](db[_0x2fba('0x4b')],{});db[_0x2fba('0xef')][_0x2fba('0x146')](db[_0x2fba('0x47')],{'foreignKey':_0x2fba('0x1dc'),'as':_0x2fba('0x1d0')});db['FaxTransferReport'][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'foreignKey':_0x2fba('0x1d1'),'as':'FromAgent'});db[_0x2fba('0xef')]['belongsTo'](db['User'],{'foreignKey':_0x2fba('0x1d3'),'as':'ToAgent'});db[_0x2fba('0xef')][_0x2fba('0x146')](db[_0x2fba('0x4d')],{'foreignKey':'ToFaxQueueId','as':_0x2fba('0x1d5')});db[_0x2fba('0xef')][_0x2fba('0x146')](db[_0x2fba('0x47')],{'foreignKey':_0x2fba('0x1dd'),'as':'ToAccount'});db[_0x2fba('0x1de')][_0x2fba('0x146')](db[_0x2fba('0x5c')],{});db[_0x2fba('0x1de')][_0x2fba('0x146')](db[_0x2fba('0x5a')],{});db['OpenchannelTransferReport'][_0x2fba('0x146')](db[_0x2fba('0x57')],{'foreignKey':_0x2fba('0x1df'),'as':_0x2fba('0x1d0')});db[_0x2fba('0x1de')]['belongsTo'](db[_0x2fba('0x10b')],{'foreignKey':_0x2fba('0x1d1'),'as':_0x2fba('0x1d2')});db['OpenchannelTransferReport']['belongsTo'](db[_0x2fba('0x10b')],{'foreignKey':_0x2fba('0x1d3'),'as':'ToAgent'});db[_0x2fba('0x1de')][_0x2fba('0x146')](db[_0x2fba('0x5d')],{'foreignKey':_0x2fba('0x1e0'),'as':_0x2fba('0x1d5')});db[_0x2fba('0x1de')][_0x2fba('0x146')](db[_0x2fba('0x57')],{'foreignKey':_0x2fba('0x1e1'),'as':'ToAccount'});db['SmsTransferReport'][_0x2fba('0x146')](db[_0x2fba('0x177')],{});db[_0x2fba('0x1e2')]['belongsTo'](db[_0x2fba('0x52')],{});db[_0x2fba('0x1e2')][_0x2fba('0x146')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0x2fba('0x1e2')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'foreignKey':_0x2fba('0x1d1'),'as':'FromAgent'});db['SmsTransferReport'][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'foreignKey':_0x2fba('0x1d3'),'as':_0x2fba('0x1d4')});db[_0x2fba('0x1e2')][_0x2fba('0x146')](db[_0x2fba('0x55')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0x2fba('0x1e2')][_0x2fba('0x146')](db['SmsAccount'],{'foreignKey':_0x2fba('0x1e3'),'as':_0x2fba('0x1d7')});db[_0x2fba('0x121')][_0x2fba('0x10c')](db[_0x2fba('0x15b')],{'as':_0x2fba('0x15c'),'foreignKey':_0x2fba('0x15f'),'onDelete':_0x2fba('0x111')});db[_0x2fba('0x121')]['hasMany'](db[_0x2fba('0x79')],{'as':_0x2fba('0x1e4'),'foreignKey':_0x2fba('0x15f')});db[_0x2fba('0x121')][_0x2fba('0x10c')](db[_0x2fba('0x11d')],{'as':_0x2fba('0x11e'),'onDelete':'cascade','foreignKey':_0x2fba('0x15f')});db[_0x2fba('0x121')][_0x2fba('0x10c')](db[_0x2fba('0x74')],{'as':_0x2fba('0x112'),'foreignKey':_0x2fba('0x15f')});db[_0x2fba('0x121')][_0x2fba('0x10c')](db[_0x2fba('0x75')],{'as':'HopperHistory','foreignKey':'ListId'});db[_0x2fba('0x121')]['hasMany'](db[_0x2fba('0x77')],{'as':_0x2fba('0x77'),'foreignKey':_0x2fba('0x15f')});db['CmList'][_0x2fba('0x120')](db[_0x2fba('0x19')],{'as':_0x2fba('0x1e5'),'through':_0x2fba('0x1e6')});db[_0x2fba('0x121')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x14b'),'through':_0x2fba('0x122')});db[_0x2fba('0xf4')][_0x2fba('0x10c')](db[_0x2fba('0x18')],{'as':_0x2fba('0x110'),'onDelete':_0x2fba('0x111')});db[_0x2fba('0xf4')][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x14b'),'through':_0x2fba('0x131')});db[_0x2fba('0xf6')][_0x2fba('0x10c')](db['User'],{'as':_0x2fba('0x166'),'foreignKey':_0x2fba('0x1e7')});db[_0x2fba('0xf6')][_0x2fba('0x10c')](db[_0x2fba('0x1e8')],{'as':'UserProfileSections','foreignKey':_0x2fba('0x1e7'),'onDelete':_0x2fba('0x111')});db[_0x2fba('0x1e8')]['hasMany'](db[_0x2fba('0xf9')],{'as':_0x2fba('0x1e9'),'foreignKey':_0x2fba('0x1ea'),'onDelete':_0x2fba('0x111')});db['WhatsappAccount'][_0x2fba('0x10c')](db[_0x2fba('0x15b')],{'as':_0x2fba('0x15c'),'foreignKey':_0x2fba('0x1eb'),'onDelete':_0x2fba('0x111')});db['WhatsappAccount']['hasMany'](db[_0x2fba('0x7e')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0x2fba('0xfd')][_0x2fba('0x10c')](db[_0x2fba('0x1ec')],{'as':_0x2fba('0x14e'),'foreignKey':'WhatsappAccountId'});db[_0x2fba('0xfd')]['hasMany'](db['WhatsappInteraction'],{'as':_0x2fba('0x15d')});db[_0x2fba('0xfd')]['hasMany'](db[_0x2fba('0xfe')],{'as':_0x2fba('0x16f')});db[_0x2fba('0xfd')][_0x2fba('0x146')](db[_0x2fba('0x121')],{'as':_0x2fba('0x15e'),'foreignKey':_0x2fba('0x15f')});db[_0x2fba('0xfd')]['belongsTo'](db[_0x2fba('0x83')],{'as':_0x2fba('0x149'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0x2fba('0x120')](db['User'],{'as':_0x2fba('0x14b'),'through':_0x2fba('0x13b')});db['WhatsappApplication'][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'onDelete':_0x2fba('0x16c')});db[_0x2fba('0xfe')][_0x2fba('0x146')](db[_0x2fba('0x106')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x2fba('0x146')](db['WhatsappAccount'],{'onDelete':_0x2fba('0x16c')});db[_0x2fba('0xfe')][_0x2fba('0x146')](db['Interval'],{'onDelete':_0x2fba('0x16c'),'foreignKey':_0x2fba('0x148')});db['WhatsappApplication']['belongsTo'](db[_0x2fba('0x89')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x2fba('0x100')]['hasMany'](db['WhatsappMessage'],{'as':_0x2fba('0x14e'),'onDelete':'cascade','foreignKey':_0x2fba('0x1ed')});db[_0x2fba('0x100')][_0x2fba('0x146')](db[_0x2fba('0xfd')],{'as':_0x2fba('0x161'),'foreignKey':'WhatsappAccountId'});db['WhatsappInteraction'][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'as':_0x2fba('0x155'),'foreignKey':'ContactId'});db[_0x2fba('0x100')]['belongsTo'](db[_0x2fba('0x10b')],{'as':_0x2fba('0x162'),'foreignKey':'UserId'});db[_0x2fba('0x100')][_0x2fba('0x120')](db[_0x2fba('0x89')],{'through':'whatsapp_interaction_has_tags','as':_0x2fba('0x164')});db['WhatsappInteraction']['belongsToMany'](db[_0x2fba('0x89')],{'through':'whatsapp_interaction_has_tags','as':_0x2fba('0x165')});db['WhatsappInteraction'][_0x2fba('0x120')](db[_0x2fba('0x10b')],{'as':_0x2fba('0x166'),'through':_0x2fba('0x12a'),'foreignKey':_0x2fba('0x1ed')});db[_0x2fba('0x1ec')][_0x2fba('0x146')](db['User'],{'as':'User'});db['WhatsappMessage'][_0x2fba('0x146')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x2fba('0x1ec')]['belongsTo'](db[_0x2fba('0x100')],{'onDelete':_0x2fba('0x111'),'as':_0x2fba('0x179'),'foreignKey':'WhatsappInteractionId'});db[_0x2fba('0x1ec')][_0x2fba('0x146')](db[_0x2fba('0xfd')],{'as':_0x2fba('0x161'),'foreignKey':_0x2fba('0x1eb')});db['WhatsappQueueReport']['belongsTo'](db[_0x2fba('0xfd')],{});db[_0x2fba('0x1ee')][_0x2fba('0x146')](db[_0x2fba('0x121')],{'as':'List','foreignKey':_0x2fba('0x15f')});db['WhatsappQueueReport'][_0x2fba('0x146')](db[_0x2fba('0x11d')],{'as':_0x2fba('0x155'),'foreignKey':_0x2fba('0x156')});db[_0x2fba('0x1ee')][_0x2fba('0x146')](db[_0x2fba('0x100')],{});db[_0x2fba('0x1ee')][_0x2fba('0x146')](db[_0x2fba('0x106')],{});db[_0x2fba('0x1ee')][_0x2fba('0x146')](db[_0x2fba('0x1ec')],{});db[_0x2fba('0x1ee')][_0x2fba('0x146')](db[_0x2fba('0x10b')],{});db[_0x2fba('0x104')][_0x2fba('0x146')](db[_0x2fba('0x1ec')],{});db[_0x2fba('0x104')][_0x2fba('0x146')](db[_0x2fba('0x100')],{});db['WhatsappTransferReport'][_0x2fba('0x146')](db[_0x2fba('0xfd')],{'foreignKey':_0x2fba('0x1ef'),'as':'FromAccount'});db[_0x2fba('0x104')][_0x2fba('0x146')](db['WhatsappAccount'],{'foreignKey':_0x2fba('0x1f0'),'as':'ToAccount'});db[_0x2fba('0x104')][_0x2fba('0x146')](db[_0x2fba('0x106')],{'foreignKey':_0x2fba('0x1f1'),'as':_0x2fba('0x1d5')});db['WhatsappTransferReport'][_0x2fba('0x146')](db[_0x2fba('0x10b')],{'foreignKey':_0x2fba('0x1d1'),'as':'FromAgent'});db[_0x2fba('0x104')]['belongsTo'](db[_0x2fba('0x10b')],{'foreignKey':_0x2fba('0x1d3'),'as':_0x2fba('0x1d4')});db[_0x2fba('0x106')]['belongsToMany'](db[_0x2fba('0x10b')],{'as':_0x2fba('0x14b'),'through':_0x2fba('0x36'),'foreignKey':'WhatsappQueueId'});db[_0x2fba('0x106')]['belongsToMany'](db[_0x2fba('0xe3')],{'through':'team_has_whatsapp_queues','as':_0x2fba('0x14c')});module[_0x2fba('0x1f2')]={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xbcdc=['SmsInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','userProfileId','belongsToMany','CmList','Lists','cm_user_has_lists','user_has_teams','FaxInteraction','user_has_sms_interactions','user_has_openchannel_interactions','MailQueues','UserMailQueue','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsite','ChatWebsites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperBlacks','JscriptySessions','TrunkId','belongsTo','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Team','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','VoiceQueueReport','uniqueid','AgentReports','ContactId','MailAccountId','MailServerOut','MailServerIn','Imap','Dispositions','CannedAnswer','Interactions','MailApplication','ListId','Template','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','ChatOfflineMessage','ChatOfflineMessageId','restrict','IntervalId','TagId','List','Contact','Dashboard','FaxAccountId','fax_interaction_has_tags','ThroughTags','user_has_fax_interactions','FaxInteractionId','AttachmentId','team_has_fax_queues','SmsAccountId','Answers','SmsMessage','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','chat_group_has_users','Company','cm_user_has_contacts','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','Any','OneAny','Actions','AutomationId','ParentId','Intervals','ChatApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','AnalyticCustomReport','CustomReportId','whatsapp_interaction_has_tags','AllCondition','Trigger','TriggerAnyId','TriggerId','Fields','MetricId','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Variable','VariableId','SugarcrmField','Descriptions','Field','int_desk_configuration_has_tags','Configurations','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Configuration','FreshsalesConfiguration','FreshsalesField','ChatQueueReport','ToId','SessionId','ProjectId','VoiceQueues','team_has_openchannel_queues','HopperHistories','TrunkBackup','TrunkBackupId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToUserId','ToQueue','ToMailAccountId','ChatTransferReport','FromChatWebsiteId','FromUserId','ToAgent','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToAccount','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CmCustomField','CustomFields','Contacts','Queues','UserProfileSection','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','user_has_whatsapp_interactions','WhatsappMessage','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','sequelize','lodash','xcall','xC@LL1234','utf8mb4','name','utf8_general_ci','sequelizeHistory','defaultsDeep','127.0.0.1','database','username','password','options','../api/user/user.model','VoiceChanSpy','import','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','OpenchannelAccount','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','Action','../api/action/action.model','Automation','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','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','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','User','hasOne','cascade','UserId','Recordings','hasMany','UserVoiceQueueRt','Extensions','CmHopperFinal','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions'];(function(_0x3fe139,_0x34ddcd){var _0x9b11ca=function(_0x3a328c){while(--_0x3a328c){_0x3fe139['push'](_0x3fe139['shift']());}};_0x9b11ca(++_0x34ddcd);}(_0xbcdc,0xde));var _0xcbcd=function(_0x4e29a6,_0x552027){_0x4e29a6=_0x4e29a6-0x0;var _0x142411=_0xbcdc[_0x4e29a6];return _0x142411;};'use strict';var config=require(_0xcbcd('0x0'));var Sequelize=require(_0xcbcd('0x1'));var _=require(_0xcbcd('0x2'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0xcbcd('0x1')]=_['defaultsDeep'](config['sequelize'],{'database':'motion2','username':_0xcbcd('0x3'),'password':_0xcbcd('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xcbcd('0x5')},'logging':![],'timezone':timezone[_0xcbcd('0x6')](),'define':{'charset':'utf8','collate':_0xcbcd('0x7')}}});config[_0xcbcd('0x8')]=_[_0xcbcd('0x9')](config[_0xcbcd('0x8')],{'database':'motion2','username':_0xcbcd('0x3'),'password':_0xcbcd('0x4'),'options':{'host':_0xcbcd('0xa'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xcbcd('0x5')},'logging':![],'timezone':timezone[_0xcbcd('0x6')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcbcd('0x1')][_0xcbcd('0xb')],config[_0xcbcd('0x1')][_0xcbcd('0xc')],config[_0xcbcd('0x1')][_0xcbcd('0xd')],config[_0xcbcd('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xcbcd('0x8')][_0xcbcd('0xb')],config[_0xcbcd('0x8')][_0xcbcd('0xc')],config[_0xcbcd('0x8')][_0xcbcd('0xd')],config[_0xcbcd('0x8')][_0xcbcd('0xe')])};db['User']=db['sequelize']['import'](_0xcbcd('0xf'));db[_0xcbcd('0x10')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xcbcd('0x12')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x13'));db[_0xcbcd('0x14')]=db[_0xcbcd('0x1')]['import']('../api/voiceExtension/voiceExtension.model');db[_0xcbcd('0x15')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x16'));db[_0xcbcd('0x17')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x18'));db[_0xcbcd('0x19')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x1a'));db['ScreenRecording']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x1b'));db[_0xcbcd('0x1c')]=db['sequelize']['import'](_0xcbcd('0x1d'));db[_0xcbcd('0x1e')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x1f'));db[_0xcbcd('0x20')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x21'));db[_0xcbcd('0x22')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x23'));db['VoiceAgentReport']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x24'));db['VoiceQueueReport']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x25'));db[_0xcbcd('0x26')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x27'));db[_0xcbcd('0x28')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x29'));db['VoiceTransferReport']=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/voiceTransferReport/voiceTransferReport.model');db['UserVoiceQueueRt']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x2a'));db[_0xcbcd('0x2b')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xcbcd('0x2c')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x2d'));db['UserMailQueue']=db['sequelize']['import'](_0xcbcd('0x2e'));db[_0xcbcd('0x2f')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x30'));db[_0xcbcd('0x31')]=db['sequelize'][_0xcbcd('0x11')]('../api/userSmsQueue/userSmsQueue.model');db[_0xcbcd('0x32')]=db['sequelize']['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xcbcd('0x33')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x34'));db['MailServerIn']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x35'));db['MailServerOut']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x36'));db['MailAccount']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x37'));db[_0xcbcd('0x38')]=db[_0xcbcd('0x1')]['import']('../api/mailQueue/mailQueue.model');db[_0xcbcd('0x39')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x3a'));db[_0xcbcd('0x3b')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x3c'));db[_0xcbcd('0x3d')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x3e'));db['MailApplication']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x3f'));db[_0xcbcd('0x40')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x41'));db['Dashboard']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x42'));db[_0xcbcd('0x43')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x44'));db['FaxAccount']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x45'));db[_0xcbcd('0x46')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/faxApplication/faxApplication.model');db['FaxInteraction']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x47'));db[_0xcbcd('0x48')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x49'));db[_0xcbcd('0x4a')]=db['sequelize'][_0xcbcd('0x11')]('../api/faxQueue/faxQueue.model');db[_0xcbcd('0x4b')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x4c'));db[_0xcbcd('0x4d')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x4e'));db[_0xcbcd('0x4f')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x50'));db['SmsInteraction']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x51'));db['SmsMessage']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x52'));db[_0xcbcd('0x53')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/smsQueue/smsQueue.model');db[_0xcbcd('0x54')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/openchannelAccount/openchannelAccount.model');db[_0xcbcd('0x55')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/openchannelApplication/openchannelApplication.model');db[_0xcbcd('0x56')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x57'));db[_0xcbcd('0x58')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x59'));db[_0xcbcd('0x5a')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x5b'));db['ChatWebsite']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x5c'));db['OpenchannelQueueReport']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x5d'));db[_0xcbcd('0x5e')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x5f'));db[_0xcbcd('0x60')]=db['sequelize']['import'](_0xcbcd('0x61'));db[_0xcbcd('0x62')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x63'));db['ChatQueue']=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/chatQueue/chatQueue.model');db[_0xcbcd('0x64')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x65'));db[_0xcbcd('0x66')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x67'));db[_0xcbcd('0x68')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x69'));db[_0xcbcd('0x6a')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x6b'));db[_0xcbcd('0x6c')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/cmHopper/cmHopper.model');db[_0xcbcd('0x6d')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x6e'));db['CmHopperFinal']=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/cmHopperFinal/cmHopperFinal.model');db[_0xcbcd('0x6f')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x70'));db['ReportAgentPreview']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x71'));db['CmCustomField']=db['sequelize']['import']('../api/cmCustomField/cmCustomField.model');db[_0xcbcd('0x72')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x73'));db[_0xcbcd('0x74')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/automation/automation.model');db['CannedAnswer']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x75'));db[_0xcbcd('0x76')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x77'));db[_0xcbcd('0x78')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x79'));db[_0xcbcd('0x7a')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x7b'));db[_0xcbcd('0x7c')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x7d'));db[_0xcbcd('0x7e')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x7f'));db['VoiceQueuesLog']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x80'));db['Schedule']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x81'));db[_0xcbcd('0x82')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x83'));db[_0xcbcd('0x84')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x85'));db['Template']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x86'));db['Trigger']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x87'));db['Variable']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x88'));db[_0xcbcd('0x89')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x8a'));db[_0xcbcd('0x8b')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x8c'));db['AnalyticDefaultReport']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x8d'));db[_0xcbcd('0x8e')]=db['sequelize'][_0xcbcd('0x11')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xcbcd('0x8f')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x90'));db[_0xcbcd('0x91')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x92'));db[_0xcbcd('0x93')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x94'));db[_0xcbcd('0x95')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x96'));db[_0xcbcd('0x97')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x98'));db[_0xcbcd('0x99')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x9a'));db[_0xcbcd('0x9b')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x9c'));db[_0xcbcd('0x9d')]=db[_0xcbcd('0x1')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x9e'));db[_0xcbcd('0x9f')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xa0'));db[_0xcbcd('0xa1')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xa2'));db[_0xcbcd('0xa3')]=db[_0xcbcd('0x1')]['import']('../api/intDeskField/intDeskField.model');db[_0xcbcd('0xa4')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xa5'));db[_0xcbcd('0xa6')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xa7'));db[_0xcbcd('0xa8')]=db['sequelize'][_0xcbcd('0x11')]('../api/intZohoField/intZohoField.model');db[_0xcbcd('0xa9')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xaa'));db[_0xcbcd('0xab')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xac'));db[_0xcbcd('0xad')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xae'));db[_0xcbcd('0xaf')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xb0'));db[_0xcbcd('0xb1')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xb2'));db[_0xcbcd('0xb3')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xb4'));db[_0xcbcd('0xb5')]=db[_0xcbcd('0x1')]['import']('../api/intVtigerAccount/intVtigerAccount.model');db[_0xcbcd('0xb6')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xcbcd('0xb7')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xb8'));db[_0xcbcd('0xb9')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xba'));db[_0xcbcd('0xbb')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xbc'));db[_0xcbcd('0xbd')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xbe'));db[_0xcbcd('0xbf')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xc0'));db['Dynamics365Configuration']=db['sequelize']['import'](_0xcbcd('0xc1'));db[_0xcbcd('0xc2')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xcbcd('0xc3')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xc4'));db['FreshsalesConfiguration']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xc5'));db['FreshsalesField']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xc6'));db[_0xcbcd('0x89')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/integration/integration.model');db[_0xcbcd('0xc7')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xc8'));db['ChatQueueReport']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xc9'));db[_0xcbcd('0xca')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xcb'));db[_0xcbcd('0xcc')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xcd'));db[_0xcbcd('0xce')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xcf'));db[_0xcbcd('0xd0')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xd1'));db[_0xcbcd('0xd2')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xd3'));db[_0xcbcd('0xd4')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')]('../api/squareReport/squareReport.model');db[_0xcbcd('0xd5')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xd6'));db[_0xcbcd('0xd7')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xd8'));db[_0xcbcd('0xd9')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xda'));db[_0xcbcd('0xdb')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xdc'));db[_0xcbcd('0xdd')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xde'));db[_0xcbcd('0xdf')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xe0'));db[_0xcbcd('0xe1')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xe2'));db['Team']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xe3'));db['License']=db[_0xcbcd('0x1')]['import']('../api/license/license.model');db[_0xcbcd('0xe4')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xe5'));db[_0xcbcd('0xe6')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xe7'));db[_0xcbcd('0xe8')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xe9'));db[_0xcbcd('0xea')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xeb'));db[_0xcbcd('0xec')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xed'));db['ChatTransferReport']=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xee'));db[_0xcbcd('0xef')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf0'));db[_0xcbcd('0xf1')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf2'));db['SmsTransferReport']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf3'));db['CmList']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xf4'));db[_0xcbcd('0xf5')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf6'));db[_0xcbcd('0xf7')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf8'));db['UserProfileSection']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xf9'));db[_0xcbcd('0xfa')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0xfb'));db[_0xcbcd('0xfc')]=db[_0xcbcd('0x1')]['import'](_0xcbcd('0xfd'));db['WhatsappAccount']=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0xfe'));db[_0xcbcd('0xff')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x100'));db[_0xcbcd('0x101')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x102'));db['WhatsappMessage']=db[_0xcbcd('0x1')]['import'](_0xcbcd('0x103'));db[_0xcbcd('0x104')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x105'));db[_0xcbcd('0x106')]=db['sequelize'][_0xcbcd('0x11')](_0xcbcd('0x107'));db[_0xcbcd('0x108')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x109'));db[_0xcbcd('0x10a')]=db['sequelize'][_0xcbcd('0x11')]('../api/cloudProvider/cloudProvider.model');db[_0xcbcd('0x10b')]=db[_0xcbcd('0x1')][_0xcbcd('0x11')](_0xcbcd('0x10c'));db[_0xcbcd('0x10d')][_0xcbcd('0x10e')](db[_0xcbcd('0x1c')],{'as':'VoiceMail','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')]['hasMany'](db[_0xcbcd('0x19')],{'as':_0xcbcd('0x111'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')][_0xcbcd('0x112')](db[_0xcbcd('0x113')],{'as':'VoiceQueuesRt','foreignKey':_0xcbcd('0x110')});db['User'][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'as':_0xcbcd('0x114'),'onDelete':_0xcbcd('0x10f'),'hooks':!![]});db['User'][_0xcbcd('0x112')](db[_0xcbcd('0x115')],{'as':'HopperFinals','foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')]['hasMany'](db[_0xcbcd('0x6f')],{'as':_0xcbcd('0x116'),'foreignKey':_0xcbcd('0x110')});db['User'][_0xcbcd('0x112')](db[_0xcbcd('0x117')],{'as':_0xcbcd('0x117'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')][_0xcbcd('0x112')](db[_0xcbcd('0x56')],{'as':_0xcbcd('0x118'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')][_0xcbcd('0x112')](db[_0xcbcd('0x60')],{'as':_0xcbcd('0x119'),'foreignKey':_0xcbcd('0x110')});db['User'][_0xcbcd('0x112')](db[_0xcbcd('0x11a')],{'as':_0xcbcd('0x11b'),'foreignKey':_0xcbcd('0x110')});db['User'][_0xcbcd('0x112')](db['FaxInteraction'],{'as':_0xcbcd('0x11c'),'foreignKey':_0xcbcd('0x110')});db['User']['hasMany'](db['MailInteraction'],{'as':_0xcbcd('0x11d'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')][_0xcbcd('0x112')](db[_0xcbcd('0x101')],{'as':_0xcbcd('0x11e'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x10d')][_0xcbcd('0x112')](db['UserNotification'],{'as':_0xcbcd('0x11f'),'foreignKey':_0xcbcd('0x120')});db[_0xcbcd('0x10d')]['belongsTo'](db['UserProfile'],{'as':'UserProfile','foreignKey':_0xcbcd('0x121')});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x64')],{'as':'Groups','through':'chat_group_has_users'});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x6a')],{'as':'Contacts','through':'cm_user_has_contacts'});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x124'),'through':_0xcbcd('0x125')});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db['Team'],{'through':_0xcbcd('0x126')});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x3b')],{'as':_0xcbcd('0x11d'),'through':'user_has_mail_interactions'});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db['ChatInteraction'],{'as':_0xcbcd('0x119'),'through':'user_has_chat_interactions'});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x127')],{'as':_0xcbcd('0x11c'),'through':'user_has_fax_interactions'});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x11a')],{'as':_0xcbcd('0x11b'),'through':_0xcbcd('0x128')});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x56')],{'as':_0xcbcd('0x118'),'through':_0xcbcd('0x129')});db[_0xcbcd('0x10d')]['belongsToMany'](db[_0xcbcd('0x101')],{'as':_0xcbcd('0x11e'),'through':'user_has_whatsapp_interactions'});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x17')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db[_0xcbcd('0x10d')]['belongsToMany'](db[_0xcbcd('0x38')],{'as':_0xcbcd('0x12a'),'through':_0xcbcd('0x12b'),'required':![]});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x12c')],{'as':_0xcbcd('0x12d'),'through':_0xcbcd('0x2c'),'required':![],'hooks':!![]});db[_0xcbcd('0x10d')]['belongsToMany'](db[_0xcbcd('0x4a')],{'as':_0xcbcd('0x12e'),'through':_0xcbcd('0x2f'),'required':![]});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x53')],{'as':_0xcbcd('0x12f'),'through':_0xcbcd('0x31'),'required':![]});db['User'][_0xcbcd('0x122')](db['OpenchannelQueue'],{'as':_0xcbcd('0x130'),'through':'UserOpenchannelQueue','required':![]});db['User'][_0xcbcd('0x122')](db['WhatsappQueue'],{'as':_0xcbcd('0x131'),'through':_0xcbcd('0x33'),'required':![]});db[_0xcbcd('0x10d')]['belongsToMany'](db[_0xcbcd('0x123')],{'through':_0xcbcd('0x125')});db['User'][_0xcbcd('0x122')](db['VoicePrefix'],{'as':_0xcbcd('0x132'),'through':_0xcbcd('0x133'),'required':![]});db[_0xcbcd('0x10d')]['belongsToMany'](db[_0xcbcd('0x134')],{'as':_0xcbcd('0x135'),'through':'user_has_chat_websites'});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x136')],{'as':_0xcbcd('0x137'),'through':_0xcbcd('0x138')});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x139')],{'as':_0xcbcd('0x13a'),'through':_0xcbcd('0x13b')});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x54')],{'as':_0xcbcd('0x13c'),'through':_0xcbcd('0x13d')});db[_0xcbcd('0x10d')][_0xcbcd('0x122')](db[_0xcbcd('0x4d')],{'as':_0xcbcd('0x13e'),'through':_0xcbcd('0x13f')});db['User'][_0xcbcd('0x122')](db[_0xcbcd('0x140')],{'as':_0xcbcd('0x141'),'through':'user_has_whatsapp_accounts'});db['User']['belongsToMany'](db[_0xcbcd('0xdd')],{'as':'SquareProjects','through':_0xcbcd('0x142')});db[_0xcbcd('0x10')][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'as':_0xcbcd('0x143'),'onDelete':'cascade','foreignKey':_0xcbcd('0x144')});db[_0xcbcd('0x12')][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'onDelete':_0xcbcd('0x10f')});db['VoiceExtension'][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'as':_0xcbcd('0x145'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x15')]['belongsToMany'](db[_0xcbcd('0x82')],{'as':_0xcbcd('0x146'),'through':_0xcbcd('0x147')});db['VoiceQueue'][_0xcbcd('0x112')](db[_0xcbcd('0x113')],{'as':_0xcbcd('0x148'),'foreignKey':_0xcbcd('0x149')});db[_0xcbcd('0x17')][_0xcbcd('0x112')](db['CmHopper'],{'as':_0xcbcd('0x14a'),'foreignKey':_0xcbcd('0x149')});db[_0xcbcd('0x17')][_0xcbcd('0x112')](db[_0xcbcd('0x115')],{'as':_0xcbcd('0x14b'),'foreignKey':'VoiceQueueId'});db[_0xcbcd('0x17')][_0xcbcd('0x112')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xcbcd('0x149')});db['VoiceQueue']['hasMany'](db[_0xcbcd('0x117')],{'as':'ReportAgentPreview','foreignKey':_0xcbcd('0x149')});db['VoiceQueue']['hasMany'](db[_0xcbcd('0x6d')],{'as':_0xcbcd('0x14c'),'foreignKey':_0xcbcd('0x149')});db['VoiceQueue']['hasMany'](db[_0xcbcd('0xd0')],{'as':_0xcbcd('0x14d'),'foreignKey':_0xcbcd('0x149')});db[_0xcbcd('0x17')]['belongsTo'](db[_0xcbcd('0x28')],{'as':_0xcbcd('0x28'),'foreignKey':_0xcbcd('0x14e')});db[_0xcbcd('0x17')][_0xcbcd('0x14f')](db['Trunk'],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xcbcd('0x17')][_0xcbcd('0x14f')](db['Interval'],{'as':_0xcbcd('0x7a'),'foreignKey':'IntervalId'});db[_0xcbcd('0x17')][_0xcbcd('0x14f')](db[_0xcbcd('0x7c')],{'as':'mandatoryDispositionPause','foreignKey':_0xcbcd('0x150')});db['VoiceQueue'][_0xcbcd('0x122')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x124'),'through':_0xcbcd('0x151')});db[_0xcbcd('0x17')][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x152'),'through':'UserVoiceQueue'});db[_0xcbcd('0x17')][_0xcbcd('0x122')](db[_0xcbcd('0x153')],{'as':_0xcbcd('0x154'),'through':_0xcbcd('0x10b')});db['VoiceQueue'][_0xcbcd('0x122')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x155'),'through':_0xcbcd('0x156')});db[_0xcbcd('0x19')][_0xcbcd('0x14f')](db['User'],{'as':_0xcbcd('0x10d'),'foreignKey':_0xcbcd('0x110')});db['ScreenRecording'][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x10d'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x1c')]['hasMany'](db[_0xcbcd('0x1e')],{'as':_0xcbcd('0x157'),'onDelete':_0xcbcd('0x10f'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0xcbcd('0x1e')][_0xcbcd('0x14f')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0xcbcd('0x158')});db[_0xcbcd('0x20')][_0xcbcd('0x112')](db[_0xcbcd('0x159')],{'as':'QueueCalls','foreignKey':_0xcbcd('0x15a'),'constraints':![]});db[_0xcbcd('0x20')][_0xcbcd('0x112')](db['VoiceAgentReport'],{'as':_0xcbcd('0x15b'),'foreignKey':_0xcbcd('0x15a'),'constraints':![]});db[_0xcbcd('0x20')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x10d'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x20')]['belongsTo'](db['CmContact'],{'as':'Contact','foreignKey':_0xcbcd('0x15c')});db['MailServerIn'][_0xcbcd('0x14f')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xcbcd('0x15d')});db[_0xcbcd('0x15e')][_0xcbcd('0x14f')](db[_0xcbcd('0x139')],{'as':'MailAccount','foreignKey':_0xcbcd('0x15d')});db[_0xcbcd('0x139')][_0xcbcd('0x10e')](db[_0xcbcd('0x15f')],{'as':_0xcbcd('0x160'),'onDelete':'cascade'});db[_0xcbcd('0x139')][_0xcbcd('0x10e')](db[_0xcbcd('0x15e')],{'as':'Smtp','onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x139')][_0xcbcd('0x112')](db['Disposition'],{'as':_0xcbcd('0x161'),'foreignKey':_0xcbcd('0x15d'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x139')][_0xcbcd('0x112')](db[_0xcbcd('0x162')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0xcbcd('0x139')]['hasMany'](db['MailMessage'],{'as':_0xcbcd('0x157'),'foreignKey':_0xcbcd('0x15d')});db[_0xcbcd('0x139')][_0xcbcd('0x112')](db[_0xcbcd('0x3b')],{'as':_0xcbcd('0x163')});db[_0xcbcd('0x139')][_0xcbcd('0x112')](db[_0xcbcd('0x164')],{'as':'Applications'});db[_0xcbcd('0x139')]['belongsTo'](db[_0xcbcd('0x123')],{'as':'List','foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x139')][_0xcbcd('0x14f')](db[_0xcbcd('0x166')],{'as':'Template','foreignKey':'TemplateId'});db['MailAccount'][_0xcbcd('0x14f')](db['Pause'],{'as':_0xcbcd('0x167'),'foreignKey':_0xcbcd('0x150')});db['MailAccount']['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x13b')});db[_0xcbcd('0x38')][_0xcbcd('0x122')](db['User'],{'as':'Agents','through':'UserMailQueue'});db[_0xcbcd('0x38')]['belongsToMany'](db['Team'],{'through':_0xcbcd('0x168'),'as':'Teams'});db['MailInteraction'][_0xcbcd('0x112')](db[_0xcbcd('0x3d')],{'as':'Messages','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x169')});db[_0xcbcd('0x3b')]['belongsTo'](db[_0xcbcd('0x139')],{'as':_0xcbcd('0x16a'),'foreignKey':'MailAccountId'});db[_0xcbcd('0x3b')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':'Contact','foreignKey':'ContactId'});db[_0xcbcd('0x3b')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db['MailInteraction']['belongsToMany'](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x16c'),'as':_0xcbcd('0x16d')});db[_0xcbcd('0x3b')]['belongsToMany'](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x16c'),'as':'ThroughTags'});db[_0xcbcd('0x3b')]['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':'user_has_mail_interactions','foreignKey':_0xcbcd('0x169')});db[_0xcbcd('0x3d')][_0xcbcd('0x112')](db[_0xcbcd('0xe8')],{'as':_0xcbcd('0x16f'),'onDelete':'cascade'});db[_0xcbcd('0x3d')]['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x10d')});db['MailMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':'cascade','as':'Contact'});db[_0xcbcd('0x3d')]['belongsTo'](db[_0xcbcd('0x3b')],{'as':_0xcbcd('0x170'),'foreignKey':'MailInteractionId'});db[_0xcbcd('0x3d')]['belongsTo'](db[_0xcbcd('0x139')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x15d')});db['MailMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':'ChatWebsite','foreignKey':'ChatWebsiteId'});db['MailMessage']['belongsTo'](db[_0xcbcd('0x171')],{'as':_0xcbcd('0x171'),'foreignKey':_0xcbcd('0x172')});db[_0xcbcd('0x164')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x164')][_0xcbcd('0x14f')](db['MailQueue'],{'onDelete':'restrict'});db[_0xcbcd('0x164')][_0xcbcd('0x14f')](db['MailAccount'],{'onDelete':_0xcbcd('0x173')});db['MailApplication'][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'onDelete':_0xcbcd('0x173'),'foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0x164')][_0xcbcd('0x14f')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xcbcd('0x175')});db[_0xcbcd('0x40')][_0xcbcd('0x14f')](db[_0xcbcd('0x139')],{});db[_0xcbcd('0x40')][_0xcbcd('0x14f')](db['CmList'],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db['MailQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x40')][_0xcbcd('0x14f')](db[_0xcbcd('0x3b')],{});db[_0xcbcd('0x40')][_0xcbcd('0x14f')](db[_0xcbcd('0x3d')],{});db[_0xcbcd('0x40')][_0xcbcd('0x14f')](db['User'],{});db['MailQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x38')],{});db[_0xcbcd('0x178')][_0xcbcd('0x112')](db['DashboardItem'],{'as':'Items','onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x136')]['hasMany'](db[_0xcbcd('0x76')],{'as':'Dispositions','foreignKey':_0xcbcd('0x179'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x136')]['hasMany'](db[_0xcbcd('0x162')],{'as':'Answers','foreignKey':_0xcbcd('0x179')});db[_0xcbcd('0x136')][_0xcbcd('0x112')](db['FaxInteraction'],{'as':_0xcbcd('0x163')});db['FaxAccount'][_0xcbcd('0x112')](db[_0xcbcd('0x46')],{'as':_0xcbcd('0x145')});db[_0xcbcd('0x136')][_0xcbcd('0x112')](db['VoiceExtension'],{'as':'Exntensions','onDelete':'cascade'});db['FaxAccount']['hasMany'](db['FaxMessage'],{'as':_0xcbcd('0x157')});db['FaxAccount'][_0xcbcd('0x14f')](db[_0xcbcd('0x28')],{'as':'Trunk'});db[_0xcbcd('0x136')]['belongsTo'](db[_0xcbcd('0x123')],{'as':'List','foreignKey':_0xcbcd('0x165')});db['FaxAccount'][_0xcbcd('0x14f')](db['Pause'],{'as':_0xcbcd('0x167'),'foreignKey':_0xcbcd('0x150')});db[_0xcbcd('0x136')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':'Agents','through':_0xcbcd('0x138')});db[_0xcbcd('0x46')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':'restrict'});db[_0xcbcd('0x46')]['belongsTo'](db[_0xcbcd('0x4a')],{'onDelete':_0xcbcd('0x173')});db['FaxApplication'][_0xcbcd('0x14f')](db[_0xcbcd('0x136')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x46')][_0xcbcd('0x14f')](db['Tag'],{'onDelete':_0xcbcd('0x173'),'foreignKey':'TagId'});db[_0xcbcd('0x127')]['hasMany'](db[_0xcbcd('0x48')],{'as':_0xcbcd('0x157'),'onDelete':_0xcbcd('0x10f'),'foreignKey':'FaxInteractionId'});db[_0xcbcd('0x127')]['belongsTo'](db[_0xcbcd('0x136')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x179')});db[_0xcbcd('0x127')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x127')]['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x127')][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x17a'),'as':_0xcbcd('0x16d')});db[_0xcbcd('0x127')][_0xcbcd('0x122')](db['Tag'],{'through':_0xcbcd('0x17a'),'as':_0xcbcd('0x17b')});db[_0xcbcd('0x127')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x17c'),'foreignKey':_0xcbcd('0x17d')});db[_0xcbcd('0x48')]['belongsTo'](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x10f'),'as':'User'});db[_0xcbcd('0x48')]['belongsTo'](db[_0xcbcd('0x127')],{'as':_0xcbcd('0x170'),'foreignKey':_0xcbcd('0x17d')});db['FaxMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':'cascade','as':_0xcbcd('0x177')});db[_0xcbcd('0x48')][_0xcbcd('0x14f')](db[_0xcbcd('0xe8')],{'as':_0xcbcd('0xe8'),'foreignKey':_0xcbcd('0x17e')});db['FaxMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x136')],{'as':_0xcbcd('0x16a'),'foreignKey':'FaxAccountId'});db[_0xcbcd('0x4a')]['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':'UserFaxQueue'});db[_0xcbcd('0x4a')][_0xcbcd('0x122')](db[_0xcbcd('0x153')],{'through':_0xcbcd('0x17f'),'as':'Teams'});db['FaxQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x136')],{});db['FaxQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x4b')]['belongsTo'](db['CmContact'],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db['FaxQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x127')],{});db[_0xcbcd('0x4b')][_0xcbcd('0x14f')](db['FaxMessage'],{});db[_0xcbcd('0x4b')]['belongsTo'](db[_0xcbcd('0x10d')],{});db[_0xcbcd('0x4b')][_0xcbcd('0x14f')](db[_0xcbcd('0x4a')],{});db[_0xcbcd('0x4d')][_0xcbcd('0x112')](db[_0xcbcd('0x76')],{'as':_0xcbcd('0x161'),'foreignKey':_0xcbcd('0x180'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x4d')][_0xcbcd('0x112')](db[_0xcbcd('0x162')],{'as':_0xcbcd('0x181'),'foreignKey':_0xcbcd('0x180')});db['SmsAccount']['hasMany'](db[_0xcbcd('0x182')],{'as':_0xcbcd('0x157'),'foreignKey':_0xcbcd('0x180')});db['SmsAccount']['hasMany'](db[_0xcbcd('0x11a')],{'as':_0xcbcd('0x163')});db[_0xcbcd('0x4d')][_0xcbcd('0x112')](db[_0xcbcd('0x4f')],{'as':_0xcbcd('0x145')});db['SmsAccount'][_0xcbcd('0x14f')](db['CmList'],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db['SmsAccount'][_0xcbcd('0x14f')](db[_0xcbcd('0x7c')],{'as':_0xcbcd('0x167'),'foreignKey':_0xcbcd('0x150')});db[_0xcbcd('0x4d')]['belongsToMany'](db['User'],{'as':'Agents','through':_0xcbcd('0x13f')});db[_0xcbcd('0x4f')][_0xcbcd('0x14f')](db['User'],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x4f')]['belongsTo'](db[_0xcbcd('0x53')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x4f')][_0xcbcd('0x14f')](db[_0xcbcd('0x4d')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x4f')][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['SmsApplication'][_0xcbcd('0x14f')](db[_0xcbcd('0x84')],{'onDelete':_0xcbcd('0x173'),'foreignKey':_0xcbcd('0x175')});db[_0xcbcd('0x11a')][_0xcbcd('0x112')](db[_0xcbcd('0x182')],{'as':'Messages','onDelete':'cascade','foreignKey':_0xcbcd('0x183')});db[_0xcbcd('0x11a')][_0xcbcd('0x14f')](db[_0xcbcd('0x4d')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x180')});db[_0xcbcd('0x11a')][_0xcbcd('0x14f')](db['CmContact'],{'as':'Contact','foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x11a')]['belongsTo'](db['User'],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x11a')][_0xcbcd('0x122')](db['Tag'],{'through':_0xcbcd('0x184'),'as':_0xcbcd('0x16d')});db[_0xcbcd('0x11a')][_0xcbcd('0x122')](db['Tag'],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0xcbcd('0x11a')]['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x128'),'foreignKey':_0xcbcd('0x183')});db[_0xcbcd('0x182')]['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x10d')});db[_0xcbcd('0x182')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x177')});db[_0xcbcd('0x182')][_0xcbcd('0x14f')](db[_0xcbcd('0x11a')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x170'),'foreignKey':'SmsInteractionId'});db[_0xcbcd('0x182')][_0xcbcd('0x14f')](db[_0xcbcd('0x4d')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x180')});db[_0xcbcd('0x53')][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x152'),'through':'UserSmsQueue','foreignKey':_0xcbcd('0x185')});db['SmsQueue'][_0xcbcd('0x122')](db[_0xcbcd('0x153')],{'through':_0xcbcd('0x186'),'as':_0xcbcd('0x154')});db['OpenchannelAccount'][_0xcbcd('0x112')](db[_0xcbcd('0x76')],{'as':'Dispositions','foreignKey':_0xcbcd('0x187'),'onDelete':'cascade'});db['OpenchannelAccount']['hasMany'](db[_0xcbcd('0x162')],{'as':'Answers','foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x54')][_0xcbcd('0x112')](db[_0xcbcd('0x56')],{'as':'Interactions','foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x54')]['hasMany'](db[_0xcbcd('0x58')],{'as':_0xcbcd('0x157'),'foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x54')][_0xcbcd('0x112')](db[_0xcbcd('0x55')],{'as':_0xcbcd('0x145'),'foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x54')]['belongsTo'](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x54')][_0xcbcd('0x14f')](db['Pause'],{'as':_0xcbcd('0x167'),'foreignKey':_0xcbcd('0x150')});db['OpenchannelAccount'][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':'Agents','through':_0xcbcd('0x13d')});db['OpenchannelApplication'][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x55')][_0xcbcd('0x14f')](db[_0xcbcd('0x5a')],{'onDelete':'restrict','foreignKey':_0xcbcd('0x188')});db['OpenchannelApplication']['belongsTo'](db[_0xcbcd('0x54')],{'onDelete':_0xcbcd('0x173'),'foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x55')][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'onDelete':_0xcbcd('0x173'),'foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0x55')]['belongsTo'](db[_0xcbcd('0x84')],{'onDelete':_0xcbcd('0x173'),'foreignKey':_0xcbcd('0x175')});db[_0xcbcd('0x56')][_0xcbcd('0x112')](db[_0xcbcd('0x58')],{'as':'Messages','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x189')});db[_0xcbcd('0x56')][_0xcbcd('0x14f')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xcbcd('0x187')});db[_0xcbcd('0x56')]['belongsTo'](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x56')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x56')][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x18a'),'as':'Tags'});db[_0xcbcd('0x56')][_0xcbcd('0x122')](db['Tag'],{'through':_0xcbcd('0x18a'),'as':_0xcbcd('0x17b')});db[_0xcbcd('0x56')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x129'),'foreignKey':_0xcbcd('0x189')});db[_0xcbcd('0x58')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x10f'),'as':'User'});db[_0xcbcd('0x58')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x177')});db[_0xcbcd('0x58')][_0xcbcd('0x14f')](db['OpenchannelInteraction'],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x170'),'foreignKey':'OpenchannelInteractionId'});db[_0xcbcd('0x58')][_0xcbcd('0x14f')](db[_0xcbcd('0xe8')],{'as':_0xcbcd('0xe8'),'foreignKey':_0xcbcd('0x17e')});db[_0xcbcd('0x58')][_0xcbcd('0x14f')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xcbcd('0x187')});db['OpenchannelQueue'][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x32'),'foreignKey':'OpenchannelQueueId'});db[_0xcbcd('0x5a')][_0xcbcd('0x122')](db[_0xcbcd('0x153')],{'through':'team_has_openchannel_queues','as':_0xcbcd('0x154')});db['ChatWebsite'][_0xcbcd('0x112')](db[_0xcbcd('0x76')],{'as':_0xcbcd('0x161'),'foreignKey':_0xcbcd('0x18b'),'onDelete':_0xcbcd('0x10f')});db['ChatWebsite'][_0xcbcd('0x112')](db[_0xcbcd('0x162')],{'as':'Answers','foreignKey':_0xcbcd('0x18b')});db[_0xcbcd('0x134')]['hasMany'](db['ChatProactiveAction'],{'as':_0xcbcd('0x18c')});db[_0xcbcd('0x134')][_0xcbcd('0x112')](db[_0xcbcd('0x60')],{'as':_0xcbcd('0x163')});db[_0xcbcd('0x134')]['hasMany'](db[_0xcbcd('0x5e')],{'as':_0xcbcd('0x145')});db['ChatWebsite'][_0xcbcd('0x112')](db['ChatMessage'],{'as':_0xcbcd('0x157')});db[_0xcbcd('0x134')][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x134')][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'as':_0xcbcd('0x7a'),'foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0x134')][_0xcbcd('0x14f')](db[_0xcbcd('0x139')],{'as':'MailAccount','foreignKey':'MailAccountId'});db['ChatWebsite'][_0xcbcd('0x14f')](db['Pause'],{'as':_0xcbcd('0x167'),'foreignKey':_0xcbcd('0x150')});db['ChatWebsite']['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x18d')});db[_0xcbcd('0x18e')][_0xcbcd('0x14f')](db[_0xcbcd('0x54')],{});db['OpenchannelQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x18e')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':'Contact','foreignKey':'ContactId'});db[_0xcbcd('0x18e')]['belongsTo'](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x58')],{});db[_0xcbcd('0x18e')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{});db[_0xcbcd('0x18e')][_0xcbcd('0x14f')](db['OpenchannelQueue'],{});db['ChatApplication']['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x18f'),'foreignKey':_0xcbcd('0x110'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x5e')][_0xcbcd('0x14f')](db['ChatQueue'],{'as':_0xcbcd('0x190'),'foreignKey':_0xcbcd('0x191'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x5e')][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':_0xcbcd('0x192'),'foreignKey':_0xcbcd('0x18b'),'onDelete':_0xcbcd('0x173')});db['ChatApplication'][_0xcbcd('0x14f')](db[_0xcbcd('0x84')],{'onDelete':_0xcbcd('0x173'),'foreignKey':'TagId'});db[_0xcbcd('0x60')][_0xcbcd('0x112')](db[_0xcbcd('0x62')],{'as':'Messages','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x193')});db[_0xcbcd('0x60')][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':'Account','foreignKey':_0xcbcd('0x18b')});db[_0xcbcd('0x60')]['belongsTo'](db[_0xcbcd('0x6a')],{'as':'Contact','foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x60')][_0xcbcd('0x14f')](db['User'],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db['ChatInteraction'][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x194'),'as':_0xcbcd('0x16d')});db[_0xcbcd('0x60')][_0xcbcd('0x122')](db['Tag'],{'through':_0xcbcd('0x194'),'as':_0xcbcd('0x17b')});db[_0xcbcd('0x60')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x195'),'foreignKey':_0xcbcd('0x193')});db[_0xcbcd('0x62')]['belongsTo'](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x10d')});db['ChatMessage'][_0xcbcd('0x14f')](db['CmContact'],{'onDelete':'cascade','as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db['ChatMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x60')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x170'),'foreignKey':_0xcbcd('0x193')});db[_0xcbcd('0x62')]['belongsTo'](db[_0xcbcd('0xe8')],{'as':_0xcbcd('0xe8'),'foreignKey':'AttachmentId'});db[_0xcbcd('0x62')][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':_0xcbcd('0x16a'),'foreignKey':'ChatWebsiteId'});db[_0xcbcd('0x171')]['hasMany'](db[_0xcbcd('0xe8')],{'as':'Attachments','foreignKey':_0xcbcd('0x172'),'onDelete':_0xcbcd('0x10f'),'hooks':!![]});db['ChatOfflineMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':_0xcbcd('0x10f'),'as':'Contact','foreignKey':_0xcbcd('0x15c')});db['ChatOfflineMessage'][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x18b')});db[_0xcbcd('0x12c')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x2c'),'hooks':!![]});db[_0xcbcd('0x12c')][_0xcbcd('0x122')](db[_0xcbcd('0x153')],{'through':_0xcbcd('0x196'),'as':'Teams'});db[_0xcbcd('0x64')]['hasMany'](db[_0xcbcd('0xca')],{'as':_0xcbcd('0x157'),'foreignKey':_0xcbcd('0x197'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x64')][_0xcbcd('0x122')](db['User'],{'as':'Members','through':_0xcbcd('0x198')});db['ChatProactiveAction'][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'as':_0xcbcd('0x192'),'foreignKey':'ChatWebsiteId'});db['CmCompany']['hasMany'](db[_0xcbcd('0x6a')],{'as':'Contacts','foreignKey':'CompanyId'});db['CmContact'][_0xcbcd('0x112')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db['CmHopperFinal'],{'as':_0xcbcd('0x14b'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x6f')],{'as':'HopperHistories','foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x117')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db['CmContact'][_0xcbcd('0x112')](db[_0xcbcd('0xd0')],{'as':_0xcbcd('0x14d'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x6a')]['hasMany'](db[_0xcbcd('0x56')],{'as':_0xcbcd('0x118'),'foreignKey':_0xcbcd('0x15c'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x60')],{'as':_0xcbcd('0x119'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x11a')],{'as':_0xcbcd('0x11b'),'foreignKey':_0xcbcd('0x15c'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x127')],{'as':_0xcbcd('0x11c'),'foreignKey':_0xcbcd('0x15c'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x6a')][_0xcbcd('0x112')](db[_0xcbcd('0x3b')],{'as':_0xcbcd('0x11d'),'foreignKey':_0xcbcd('0x15c'),'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x6a')]['belongsTo'](db[_0xcbcd('0x68')],{'as':_0xcbcd('0x199'),'foreignKey':'CompanyId'});db[_0xcbcd('0x6a')][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x6a')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x19a')});db['CmContact'][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'as':_0xcbcd('0x16d'),'through':_0xcbcd('0x19b')});db['CmContact']['belongsToMany'](db[_0xcbcd('0x84')],{'through':'cm_contact_has_tags','as':_0xcbcd('0x17b')});db['CmHopper'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':'ContactId','onDelete':_0xcbcd('0x10f')});db['CmHopper']['belongsTo'](db[_0xcbcd('0x123')],{'as':'List','foreignKey':'ListId','onDelete':'cascade'});db[_0xcbcd('0x6c')]['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x18f'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x6c')][_0xcbcd('0x14f')](db['VoiceQueue'],{'as':_0xcbcd('0x190'),'foreignKey':_0xcbcd('0x149'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x6c')]['belongsTo'](db[_0xcbcd('0xe4')],{'as':'Campaign','foreignKey':_0xcbcd('0x19c'),'onDelete':_0xcbcd('0x10f')});db['CmHopper'][_0xcbcd('0x14f')](db['User'],{'as':'Owner','foreignKey':_0xcbcd('0x19d')});db[_0xcbcd('0x6d')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':'ContactId','onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x6d')][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x6d')][_0xcbcd('0x14f')](db['VoiceQueue'],{'as':_0xcbcd('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x6d')][_0xcbcd('0x14f')](db[_0xcbcd('0xe4')],{'as':_0xcbcd('0xe4'),'foreignKey':_0xcbcd('0x19c'),'onDelete':_0xcbcd('0x10f')});db['Automation']['hasMany'](db[_0xcbcd('0x78')],{'as':{'plural':_0xcbcd('0x19e'),'singular':_0xcbcd('0x19f')},'foreignKey':'AutomationAllId','onDelete':_0xcbcd('0x10f'),'hooks':!![]});db[_0xcbcd('0x74')][_0xcbcd('0x112')](db[_0xcbcd('0x78')],{'as':{'plural':_0xcbcd('0x1a0'),'singular':_0xcbcd('0x1a1')},'foreignKey':'AutomationAnyId','onDelete':_0xcbcd('0x10f'),'hooks':!![]});db['Automation'][_0xcbcd('0x112')](db[_0xcbcd('0x72')],{'as':_0xcbcd('0x1a2'),'foreignKey':_0xcbcd('0x1a3'),'onDelete':_0xcbcd('0x10f'),'hooks':!![]});db[_0xcbcd('0x76')][_0xcbcd('0x112')](db[_0xcbcd('0x76')],{'as':_0xcbcd('0x161'),'foreignKey':_0xcbcd('0x1a4'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x7a')][_0xcbcd('0x112')](db[_0xcbcd('0x7a')],{'as':_0xcbcd('0x1a5'),'foreignKey':_0xcbcd('0x174'),'onDelete':_0xcbcd('0x10f'),'hooks':!![],'required':![]});db[_0xcbcd('0x7a')][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'as':_0xcbcd('0x114'),'foreignKey':'IntervalId','onDelete':_0xcbcd('0x173')});db[_0xcbcd('0x7a')]['hasMany'](db[_0xcbcd('0x164')],{'as':'MailApplications','foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0x7a')]['hasMany'](db[_0xcbcd('0x5e')],{'as':_0xcbcd('0x1a6'),'foreignKey':_0xcbcd('0x174')});db['Interval'][_0xcbcd('0x112')](db[_0xcbcd('0x46')],{'as':'FaxApplications','foreignKey':'IntervalId'});db['Interval'][_0xcbcd('0x112')](db[_0xcbcd('0x4f')],{'as':_0xcbcd('0x1a7'),'foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0x1a8')][_0xcbcd('0x14f')](db['MailAccount'],{});db[_0xcbcd('0x1a8')][_0xcbcd('0x14f')](db[_0xcbcd('0x1a9')],{'foreignKey':_0xcbcd('0x1aa')});db['Schedule'][_0xcbcd('0x14f')](db[_0xcbcd('0x1ab')],{'foreignKey':_0xcbcd('0x1ac')});db[_0xcbcd('0x82')][_0xcbcd('0x122')](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0xcbcd('0x147'),'onDelete':'restrict'});db[_0xcbcd('0x84')][_0xcbcd('0x122')](db[_0xcbcd('0x6a')],{'through':_0xcbcd('0x19b')});db['Tag'][_0xcbcd('0x122')](db['ChatInteraction'],{'through':_0xcbcd('0x194')});db['Tag'][_0xcbcd('0x122')](db[_0xcbcd('0x3b')],{'through':_0xcbcd('0x16c')});db['Tag'][_0xcbcd('0x122')](db[_0xcbcd('0x11a')],{'through':'sms_interaction_has_tags'});db[_0xcbcd('0x84')][_0xcbcd('0x122')](db[_0xcbcd('0x127')],{'through':_0xcbcd('0x17a')});db[_0xcbcd('0x84')][_0xcbcd('0x122')](db[_0xcbcd('0x56')],{'through':_0xcbcd('0x18a')});db[_0xcbcd('0x84')][_0xcbcd('0x122')](db['WhatsappInteraction'],{'through':_0xcbcd('0x1ad')});db['Trigger'][_0xcbcd('0x112')](db[_0xcbcd('0x78')],{'as':{'plural':'AllConditions','singular':_0xcbcd('0x1ae')},'foreignKey':'TriggerAllId','onDelete':_0xcbcd('0x10f'),'hooks':!![]});db[_0xcbcd('0x1af')][_0xcbcd('0x112')](db[_0xcbcd('0x78')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0xcbcd('0x1b0'),'onDelete':_0xcbcd('0x10f'),'hooks':!![]});db['Trigger'][_0xcbcd('0x112')](db['Action'],{'as':_0xcbcd('0x1a2'),'foreignKey':_0xcbcd('0x1b1'),'onDelete':_0xcbcd('0x10f'),'hooks':!![]});db[_0xcbcd('0x1ab')]['hasMany'](db[_0xcbcd('0x91')],{'as':_0xcbcd('0x1b2'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1ac'),'hooks':!![]});db[_0xcbcd('0x1a9')]['hasMany'](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1aa')});db[_0xcbcd('0x8f')][_0xcbcd('0x112')](db[_0xcbcd('0x91')],{'as':'Fields','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b3')});db['AnalyticFieldReport']['belongsTo'](db[_0xcbcd('0x8f')],{'foreignKey':_0xcbcd('0x1b3')});db[_0xcbcd('0x95')][_0xcbcd('0x112')](db[_0xcbcd('0x97')],{'as':'Configurations','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0x97')]['hasMany'](db[_0xcbcd('0x99')],{'as':_0xcbcd('0x1b5'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0x97')][_0xcbcd('0x112')](db[_0xcbcd('0x99')],{'as':'Descriptions','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b7')});db['SalesforceConfiguration']['hasMany'](db[_0xcbcd('0x99')],{'as':_0xcbcd('0x1b2'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0x97')][_0xcbcd('0x14f')](db['SalesforceAccount'],{'as':_0xcbcd('0x16a'),'foreignKey':'AccountId'});db[_0xcbcd('0x99')][_0xcbcd('0x112')](db[_0xcbcd('0x99')],{'as':_0xcbcd('0x1b9'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0x99')][_0xcbcd('0x112')](db['SalesforceField'],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0x99')][_0xcbcd('0x112')](db[_0xcbcd('0x99')],{'as':'Field','foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0x99')][_0xcbcd('0x14f')](db[_0xcbcd('0x1bb')],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0x9b')][_0xcbcd('0x112')](db[_0xcbcd('0x9d')],{'as':'Configurations','onDelete':_0xcbcd('0x10f'),'foreignKey':'AccountId'});db[_0xcbcd('0x9d')][_0xcbcd('0x112')](db[_0xcbcd('0x1bd')],{'as':_0xcbcd('0x1b5'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0x9d')]['hasMany'](db[_0xcbcd('0x1bd')],{'as':_0xcbcd('0x1be'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0x9d')][_0xcbcd('0x112')](db[_0xcbcd('0x1bd')],{'as':_0xcbcd('0x1b2'),'onDelete':'cascade','foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0x9d')]['belongsTo'](db[_0xcbcd('0x9b')],{'as':_0xcbcd('0x16a'),'foreignKey':'AccountId'});db[_0xcbcd('0x1bd')][_0xcbcd('0x112')](db[_0xcbcd('0x1bd')],{'as':_0xcbcd('0x1b9'),'foreignKey':'SubjectId'});db[_0xcbcd('0x1bd')][_0xcbcd('0x112')](db['SugarcrmField'],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0x1bd')][_0xcbcd('0x112')](db[_0xcbcd('0x1bd')],{'as':_0xcbcd('0x1bf'),'foreignKey':'FieldId'});db['SugarcrmField'][_0xcbcd('0x14f')](db[_0xcbcd('0x1bb')],{'as':'Variable','foreignKey':'VariableId'});db['DeskAccount'][_0xcbcd('0x112')](db[_0xcbcd('0xa1')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xa1')]['hasMany'](db[_0xcbcd('0xa3')],{'as':_0xcbcd('0x1b5'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xa1')][_0xcbcd('0x112')](db[_0xcbcd('0xa3')],{'as':_0xcbcd('0x1be'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xcbcd('0xa1')][_0xcbcd('0x112')](db[_0xcbcd('0xa3')],{'as':_0xcbcd('0x1b2'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xa1')][_0xcbcd('0x14f')](db[_0xcbcd('0x9f')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xa1')]['belongsToMany'](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x1c0')});db['DeskField'][_0xcbcd('0x112')](db[_0xcbcd('0xa3')],{'as':'Subject','foreignKey':_0xcbcd('0x1b6')});db['DeskField'][_0xcbcd('0x112')](db[_0xcbcd('0xa3')],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xa3')]['hasMany'](db['DeskField'],{'as':'Field','foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xa3')][_0xcbcd('0x14f')](db['Variable'],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0xa4')][_0xcbcd('0x112')](db[_0xcbcd('0xa6')],{'as':_0xcbcd('0x1c1'),'onDelete':'cascade','foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xa6')]['hasMany'](db['ZohoField'],{'as':_0xcbcd('0x1b5'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xa6')][_0xcbcd('0x112')](db[_0xcbcd('0xa8')],{'as':_0xcbcd('0x1be'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xa6')][_0xcbcd('0x112')](db['ZohoField'],{'as':_0xcbcd('0x1b2'),'onDelete':_0xcbcd('0x10f'),'foreignKey':'FieldId'});db[_0xcbcd('0xa6')]['belongsTo'](db[_0xcbcd('0xa4')],{'as':_0xcbcd('0x16a'),'foreignKey':'AccountId'});db[_0xcbcd('0xa8')][_0xcbcd('0x112')](db['ZohoField'],{'as':_0xcbcd('0x1b9'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xa8')][_0xcbcd('0x112')](db[_0xcbcd('0xa8')],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xa8')][_0xcbcd('0x112')](db[_0xcbcd('0xa8')],{'as':_0xcbcd('0x1bf'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xa8')][_0xcbcd('0x14f')](db['Variable'],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0xa9')]['hasMany'](db['ZendeskConfiguration'],{'as':_0xcbcd('0x1c1'),'onDelete':'cascade','foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xab')][_0xcbcd('0x112')](db[_0xcbcd('0xad')],{'as':_0xcbcd('0x1b5'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xab')]['hasMany'](db['ZendeskField'],{'as':_0xcbcd('0x1be'),'foreignKey':_0xcbcd('0x1b7')});db['ZendeskConfiguration'][_0xcbcd('0x112')](db['ZendeskField'],{'as':_0xcbcd('0x1b2'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xab')]['belongsTo'](db[_0xcbcd('0xa9')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xab')][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x1c2')});db[_0xcbcd('0xad')]['hasMany'](db[_0xcbcd('0xad')],{'as':_0xcbcd('0x1b9'),'foreignKey':_0xcbcd('0x1b6')});db['ZendeskField'][_0xcbcd('0x112')](db[_0xcbcd('0xad')],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xad')][_0xcbcd('0x112')](db[_0xcbcd('0xad')],{'as':'Field','foreignKey':'FieldId'});db[_0xcbcd('0xad')][_0xcbcd('0x14f')](db[_0xcbcd('0x1bb')],{'as':'Variable','foreignKey':_0xcbcd('0x1bc')});db['FreshdeskAccount'][_0xcbcd('0x112')](db[_0xcbcd('0xb1')],{'as':_0xcbcd('0x1c1'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xb1')]['hasMany'](db[_0xcbcd('0xb3')],{'as':_0xcbcd('0x1b5'),'onDelete':_0xcbcd('0x10f'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0xcbcd('0x112')](db[_0xcbcd('0xb3')],{'as':_0xcbcd('0x1be'),'onDelete':_0xcbcd('0x10f'),'foreignKey':'DescriptionId'});db[_0xcbcd('0xb1')]['hasMany'](db[_0xcbcd('0xb3')],{'as':_0xcbcd('0x1b2'),'onDelete':'cascade','foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xb1')][_0xcbcd('0x14f')](db[_0xcbcd('0xaf')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x1b4')});db['FreshdeskConfiguration'][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':_0xcbcd('0x1c3')});db[_0xcbcd('0xb3')][_0xcbcd('0x112')](db[_0xcbcd('0xb3')],{'as':'Subject','foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xb3')][_0xcbcd('0x112')](db[_0xcbcd('0xb3')],{'as':_0xcbcd('0x1ba'),'foreignKey':'DescriptionId'});db[_0xcbcd('0xb3')]['hasMany'](db[_0xcbcd('0xb3')],{'as':_0xcbcd('0x1bf'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xb3')]['belongsTo'](db['Variable'],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db['VtigerAccount'][_0xcbcd('0x112')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xb6')][_0xcbcd('0x112')](db['VtigerField'],{'as':'Subjects','foreignKey':_0xcbcd('0x1b6')});db['VtigerConfiguration'][_0xcbcd('0x112')](db[_0xcbcd('0xb7')],{'as':_0xcbcd('0x1be'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xb6')][_0xcbcd('0x112')](db[_0xcbcd('0xb7')],{'as':_0xcbcd('0x1b2'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xb6')][_0xcbcd('0x14f')](db[_0xcbcd('0xb5')],{'as':'Account','foreignKey':'AccountId'});db[_0xcbcd('0xb7')][_0xcbcd('0x112')](db['VtigerField'],{'as':_0xcbcd('0x1b9'),'foreignKey':'SubjectId'});db[_0xcbcd('0xb7')][_0xcbcd('0x112')](db[_0xcbcd('0xb7')],{'as':_0xcbcd('0x1ba'),'foreignKey':'DescriptionId'});db[_0xcbcd('0xb7')]['hasMany'](db[_0xcbcd('0xb7')],{'as':'Field','foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0xb7')][_0xcbcd('0x14f')](db[_0xcbcd('0x1bb')],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0xb9')]['hasMany'](db[_0xcbcd('0xbb')],{'as':'Configurations','onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b4')});db['ServicenowConfiguration'][_0xcbcd('0x112')](db[_0xcbcd('0xbd')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0xcbcd('0xbb')]['hasMany'](db[_0xcbcd('0xbd')],{'as':_0xcbcd('0x1be'),'foreignKey':'DescriptionId'});db['ServicenowConfiguration']['hasMany'](db[_0xcbcd('0xbd')],{'as':'Fields','foreignKey':'FieldId'});db[_0xcbcd('0xbb')][_0xcbcd('0x14f')](db['ServicenowAccount'],{'as':_0xcbcd('0x16a'),'foreignKey':'AccountId'});db[_0xcbcd('0xbd')][_0xcbcd('0x112')](db[_0xcbcd('0xbd')],{'as':_0xcbcd('0x1b9'),'foreignKey':'SubjectId'});db[_0xcbcd('0xbd')][_0xcbcd('0x112')](db[_0xcbcd('0xbd')],{'as':_0xcbcd('0x1ba'),'foreignKey':'DescriptionId'});db[_0xcbcd('0xbd')][_0xcbcd('0x112')](db[_0xcbcd('0xbd')],{'as':_0xcbcd('0x1bf'),'foreignKey':'FieldId'});db['ServicenowField'][_0xcbcd('0x14f')](db['Variable'],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0xbf')][_0xcbcd('0x112')](db['Dynamics365Configuration'],{'as':_0xcbcd('0x1c1'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xcbcd('0x1c4')][_0xcbcd('0x112')](db[_0xcbcd('0xc2')],{'as':_0xcbcd('0x1b5'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xcbcd('0x1c4')]['hasMany'](db[_0xcbcd('0xc2')],{'as':_0xcbcd('0x1be'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b7')});db['Dynamics365Configuration'][_0xcbcd('0x112')](db[_0xcbcd('0xc2')],{'as':_0xcbcd('0x1b2'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0x1c4')][_0xcbcd('0x14f')](db[_0xcbcd('0xbf')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0xc2')][_0xcbcd('0x112')](db[_0xcbcd('0xc2')],{'as':_0xcbcd('0x1b9'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0xc2')][_0xcbcd('0x112')](db[_0xcbcd('0xc2')],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0xc2')][_0xcbcd('0x112')](db[_0xcbcd('0xc2')],{'as':'Field','foreignKey':_0xcbcd('0x1b8')});db['Dynamics365Field'][_0xcbcd('0x14f')](db[_0xcbcd('0x1bb')],{'as':_0xcbcd('0x1bb'),'foreignKey':'VariableId'});db[_0xcbcd('0xc3')][_0xcbcd('0x112')](db[_0xcbcd('0x1c5')],{'as':_0xcbcd('0x1c1'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0x1c5')]['hasMany'](db[_0xcbcd('0x1c6')],{'as':_0xcbcd('0x1b5'),'foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0x1c5')][_0xcbcd('0x112')](db[_0xcbcd('0x1c6')],{'as':'Descriptions','foreignKey':_0xcbcd('0x1b7')});db['FreshsalesConfiguration']['hasMany'](db[_0xcbcd('0x1c6')],{'as':_0xcbcd('0x1b2'),'foreignKey':'FieldId'});db['FreshsalesConfiguration']['belongsTo'](db[_0xcbcd('0xc3')],{'as':_0xcbcd('0x16a'),'foreignKey':_0xcbcd('0x1b4')});db[_0xcbcd('0x1c6')]['hasMany'](db[_0xcbcd('0x1c6')],{'as':'Subject','foreignKey':_0xcbcd('0x1b6')});db[_0xcbcd('0x1c6')]['hasMany'](db['FreshsalesField'],{'as':_0xcbcd('0x1ba'),'foreignKey':_0xcbcd('0x1b7')});db[_0xcbcd('0x1c6')][_0xcbcd('0x112')](db['FreshsalesField'],{'as':_0xcbcd('0x1bf'),'foreignKey':_0xcbcd('0x1b8')});db[_0xcbcd('0x1c6')]['belongsTo'](db[_0xcbcd('0x1bb')],{'as':_0xcbcd('0x1bb'),'foreignKey':_0xcbcd('0x1bc')});db[_0xcbcd('0x1c7')][_0xcbcd('0x14f')](db['ChatWebsite'],{});db[_0xcbcd('0x1c7')]['belongsTo'](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x176'),'foreignKey':'ListId'});db[_0xcbcd('0x1c7')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x1c7')][_0xcbcd('0x14f')](db[_0xcbcd('0x60')],{});db[_0xcbcd('0x1c7')][_0xcbcd('0x14f')](db[_0xcbcd('0x62')],{});db[_0xcbcd('0x1c7')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{});db['ChatQueueReport']['belongsTo'](db[_0xcbcd('0x12c')],{});db[_0xcbcd('0xca')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0xcbcd('0xca')]['belongsTo'](db['User'],{'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1c8')});db[_0xcbcd('0xd0')][_0xcbcd('0x112')](db[_0xcbcd('0xce')],{'foreignKey':_0xcbcd('0x1c9'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0xd0')]['hasMany'](db[_0xcbcd('0xcc')],{'foreignKey':_0xcbcd('0x1c9'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0xd2')][_0xcbcd('0x14f')](db[_0xcbcd('0x4d')],{});db[_0xcbcd('0xd2')]['belongsTo'](db['CmList'],{'as':_0xcbcd('0x176'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0xd2')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0xd2')][_0xcbcd('0x14f')](db['SmsInteraction'],{});db[_0xcbcd('0xd2')]['belongsTo'](db[_0xcbcd('0x182')],{});db[_0xcbcd('0xd2')]['belongsTo'](db[_0xcbcd('0x10d')],{});db['SmsQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x53')],{});db[_0xcbcd('0xd7')]['hasMany'](db[_0xcbcd('0xd0')],{'foreignKey':'ProjectId'});db[_0xcbcd('0xd7')]['hasMany'](db[_0xcbcd('0xce')],{'foreignKey':_0xcbcd('0x1ca')});db[_0xcbcd('0xd7')][_0xcbcd('0x112')](db['JscriptyAnswerReport'],{'foreignKey':'ProjectId'});db[_0xcbcd('0xdd')]['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x142')});db[_0xcbcd('0x153')][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x126')});db[_0xcbcd('0x153')]['belongsToMany'](db[_0xcbcd('0x17')],{'through':_0xcbcd('0x10b'),'as':_0xcbcd('0x1cb')});db[_0xcbcd('0x153')][_0xcbcd('0x122')](db[_0xcbcd('0x38')],{'through':_0xcbcd('0x168'),'as':'MailQueues'});db[_0xcbcd('0x153')][_0xcbcd('0x122')](db['ChatQueue'],{'through':_0xcbcd('0x196'),'as':'ChatQueues'});db[_0xcbcd('0x153')]['belongsToMany'](db['FaxQueue'],{'through':_0xcbcd('0x17f'),'as':'FaxQueues'});db[_0xcbcd('0x153')][_0xcbcd('0x122')](db[_0xcbcd('0x53')],{'through':_0xcbcd('0x186'),'as':_0xcbcd('0x12f')});db['Team'][_0xcbcd('0x122')](db[_0xcbcd('0x5a')],{'through':_0xcbcd('0x1cc'),'as':'OpenchannelQueues'});db[_0xcbcd('0x153')][_0xcbcd('0x122')](db[_0xcbcd('0x108')],{'through':'team_has_whatsapp_queues','as':_0xcbcd('0x131')});db[_0xcbcd('0xe4')]['hasMany'](db[_0xcbcd('0x6c')],{'as':_0xcbcd('0x14a'),'foreignKey':'CampaignId'});db['Campaign'][_0xcbcd('0x112')](db[_0xcbcd('0x115')],{'as':_0xcbcd('0x14b'),'foreignKey':_0xcbcd('0x19c')});db[_0xcbcd('0xe4')][_0xcbcd('0x112')](db[_0xcbcd('0x6f')],{'as':_0xcbcd('0x1cd'),'foreignKey':_0xcbcd('0x19c')});db[_0xcbcd('0xe4')][_0xcbcd('0x112')](db[_0xcbcd('0x6d')],{'as':_0xcbcd('0x14c'),'foreignKey':_0xcbcd('0x19c')});db[_0xcbcd('0xe4')]['belongsTo'](db['Trunk'],{'as':_0xcbcd('0x28'),'foreignKey':_0xcbcd('0x14e')});db[_0xcbcd('0xe4')][_0xcbcd('0x14f')](db['Trunk'],{'as':_0xcbcd('0x1ce'),'foreignKey':_0xcbcd('0x1cf')});db[_0xcbcd('0xe4')][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'as':_0xcbcd('0x7a'),'foreignKey':_0xcbcd('0x174')});db[_0xcbcd('0xe4')][_0xcbcd('0x14f')](db[_0xcbcd('0xdd')],{'as':'SquareProject','foreignKey':'SquareProjectId'});db[_0xcbcd('0xe4')][_0xcbcd('0x122')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x124'),'through':'campaigns_has_cm_lists'});db[_0xcbcd('0xe4')][_0xcbcd('0x122')](db[_0xcbcd('0x123')],{'as':_0xcbcd('0x155'),'through':_0xcbcd('0x1d0')});db['Attachment'][_0xcbcd('0x14f')](db[_0xcbcd('0x171')],{'as':_0xcbcd('0x171'),'foreignKey':_0xcbcd('0x172')});db[_0xcbcd('0xec')]['belongsTo'](db[_0xcbcd('0x3d')],{});db[_0xcbcd('0xec')][_0xcbcd('0x14f')](db[_0xcbcd('0x3b')],{});db['MailTransferReport']['belongsTo'](db[_0xcbcd('0x139')],{'foreignKey':_0xcbcd('0x1d1'),'as':_0xcbcd('0x1d2')});db[_0xcbcd('0xec')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0xcbcd('0x1d3')});db[_0xcbcd('0xec')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d4'),'as':'ToAgent'});db[_0xcbcd('0xec')]['belongsTo'](db[_0xcbcd('0x38')],{'foreignKey':'ToMailQueueId','as':_0xcbcd('0x1d5')});db['MailTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x139')],{'foreignKey':_0xcbcd('0x1d6'),'as':'ToAccount'});db[_0xcbcd('0x1d7')][_0xcbcd('0x14f')](db[_0xcbcd('0x62')],{});db['ChatTransferReport']['belongsTo'](db[_0xcbcd('0x60')],{});db['ChatTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x134')],{'foreignKey':_0xcbcd('0x1d8'),'as':'FromAccount'});db[_0xcbcd('0x1d7')]['belongsTo'](db['User'],{'foreignKey':_0xcbcd('0x1d9'),'as':_0xcbcd('0x1d3')});db['ChatTransferReport']['belongsTo'](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d4'),'as':_0xcbcd('0x1da')});db['ChatTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x12c')],{'foreignKey':_0xcbcd('0x1db'),'as':_0xcbcd('0x1d5')});db['ChatTransferReport'][_0xcbcd('0x14f')](db['ChatWebsite'],{'foreignKey':_0xcbcd('0x1dc'),'as':'ToAccount'});db[_0xcbcd('0xef')][_0xcbcd('0x14f')](db[_0xcbcd('0x48')],{});db['FaxTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x127')],{});db[_0xcbcd('0xef')][_0xcbcd('0x14f')](db['FaxAccount'],{'foreignKey':_0xcbcd('0x1dd'),'as':_0xcbcd('0x1d2')});db[_0xcbcd('0xef')]['belongsTo'](db['User'],{'foreignKey':_0xcbcd('0x1d9'),'as':_0xcbcd('0x1d3')});db[_0xcbcd('0xef')]['belongsTo'](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d4'),'as':_0xcbcd('0x1da')});db[_0xcbcd('0xef')]['belongsTo'](db[_0xcbcd('0x4a')],{'foreignKey':_0xcbcd('0x1de'),'as':_0xcbcd('0x1d5')});db['FaxTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x136')],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0xcbcd('0xf1')]['belongsTo'](db[_0xcbcd('0x58')],{});db['OpenchannelTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x56')],{});db[_0xcbcd('0xf1')][_0xcbcd('0x14f')](db[_0xcbcd('0x54')],{'foreignKey':_0xcbcd('0x1df'),'as':_0xcbcd('0x1d2')});db['OpenchannelTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d9'),'as':'FromAgent'});db[_0xcbcd('0xf1')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d4'),'as':_0xcbcd('0x1da')});db['OpenchannelTransferReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x5a')],{'foreignKey':_0xcbcd('0x1e0'),'as':'ToQueue'});db[_0xcbcd('0xf1')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0xcbcd('0x1e1'),'as':_0xcbcd('0x1e2')});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db['SmsMessage'],{});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db[_0xcbcd('0x11a')],{});db['SmsTransferReport']['belongsTo'](db[_0xcbcd('0x4d')],{'foreignKey':_0xcbcd('0x1e4'),'as':_0xcbcd('0x1d2')});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d9'),'as':_0xcbcd('0x1d3')});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':'ToUserId','as':_0xcbcd('0x1da')});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db[_0xcbcd('0x53')],{'foreignKey':_0xcbcd('0x1e5'),'as':_0xcbcd('0x1d5')});db[_0xcbcd('0x1e3')][_0xcbcd('0x14f')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db[_0xcbcd('0x123')]['hasMany'](db[_0xcbcd('0x76')],{'as':'Dispositions','foreignKey':_0xcbcd('0x165'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x123')][_0xcbcd('0x112')](db[_0xcbcd('0x1e6')],{'as':_0xcbcd('0x1e7'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x123')]['hasMany'](db['CmContact'],{'as':_0xcbcd('0x1e8'),'onDelete':'cascade','foreignKey':'ListId'});db[_0xcbcd('0x123')][_0xcbcd('0x112')](db[_0xcbcd('0x115')],{'as':_0xcbcd('0x14b'),'foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x123')]['hasMany'](db[_0xcbcd('0x6f')],{'as':'HopperHistory','foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x123')][_0xcbcd('0x112')](db[_0xcbcd('0x117')],{'as':'ReportAgentPreview','foreignKey':_0xcbcd('0x165')});db[_0xcbcd('0x123')][_0xcbcd('0x122')](db[_0xcbcd('0x17')],{'as':_0xcbcd('0x1e9'),'through':_0xcbcd('0x151')});db[_0xcbcd('0x123')][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x125')});db['VoicePrefix'][_0xcbcd('0x112')](db[_0xcbcd('0x14')],{'as':_0xcbcd('0x114'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0xf5')]['belongsToMany'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x133')});db[_0xcbcd('0xf7')][_0xcbcd('0x112')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16e'),'foreignKey':'userProfileId'});db[_0xcbcd('0xf7')][_0xcbcd('0x112')](db[_0xcbcd('0x1ea')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x1ea')][_0xcbcd('0x112')](db['UserProfileResource'],{'as':_0xcbcd('0x1eb'),'foreignKey':_0xcbcd('0x1ec'),'onDelete':_0xcbcd('0x10f')});db['WhatsappAccount'][_0xcbcd('0x112')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xcbcd('0x1ed'),'onDelete':_0xcbcd('0x10f')});db[_0xcbcd('0x140')]['hasMany'](db['CannedAnswer'],{'as':_0xcbcd('0x181'),'foreignKey':_0xcbcd('0x1ed')});db['WhatsappAccount']['hasMany'](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0xcbcd('0x1ed')});db[_0xcbcd('0x140')][_0xcbcd('0x112')](db[_0xcbcd('0x101')],{'as':_0xcbcd('0x163')});db[_0xcbcd('0x140')][_0xcbcd('0x112')](db[_0xcbcd('0xff')],{'as':_0xcbcd('0x145')});db[_0xcbcd('0x140')][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':'List','foreignKey':'ListId'});db[_0xcbcd('0x140')][_0xcbcd('0x14f')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xcbcd('0x150')});db[_0xcbcd('0x140')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x1ee')});db[_0xcbcd('0xff')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0xff')][_0xcbcd('0x14f')](db[_0xcbcd('0x108')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0xff')][_0xcbcd('0x14f')](db[_0xcbcd('0x140')],{'onDelete':_0xcbcd('0x173')});db[_0xcbcd('0xff')][_0xcbcd('0x14f')](db[_0xcbcd('0x7a')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0xcbcd('0xff')][_0xcbcd('0x14f')](db[_0xcbcd('0x84')],{'onDelete':'restrict','foreignKey':_0xcbcd('0x175')});db[_0xcbcd('0x101')]['hasMany'](db['WhatsappMessage'],{'as':_0xcbcd('0x157'),'onDelete':_0xcbcd('0x10f'),'foreignKey':_0xcbcd('0x1ef')});db[_0xcbcd('0x101')][_0xcbcd('0x14f')](db['WhatsappAccount'],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0xcbcd('0x101')][_0xcbcd('0x14f')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xcbcd('0x101')]['belongsTo'](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x16b'),'foreignKey':_0xcbcd('0x110')});db[_0xcbcd('0x101')]['belongsToMany'](db['Tag'],{'through':_0xcbcd('0x1ad'),'as':_0xcbcd('0x16d')});db[_0xcbcd('0x101')][_0xcbcd('0x122')](db[_0xcbcd('0x84')],{'through':'whatsapp_interaction_has_tags','as':_0xcbcd('0x17b')});db[_0xcbcd('0x101')][_0xcbcd('0x122')](db['User'],{'as':_0xcbcd('0x16e'),'through':_0xcbcd('0x1f0'),'foreignKey':_0xcbcd('0x1ef')});db[_0xcbcd('0x1f1')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x10d')});db[_0xcbcd('0x1f1')][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'onDelete':'cascade','as':'Contact'});db[_0xcbcd('0x1f1')][_0xcbcd('0x14f')](db[_0xcbcd('0x101')],{'onDelete':_0xcbcd('0x10f'),'as':_0xcbcd('0x170'),'foreignKey':_0xcbcd('0x1ef')});db[_0xcbcd('0x1f1')][_0xcbcd('0x14f')](db[_0xcbcd('0x140')],{'as':_0xcbcd('0x16a'),'foreignKey':'WhatsappAccountId'});db[_0xcbcd('0x104')][_0xcbcd('0x14f')](db[_0xcbcd('0x140')],{});db[_0xcbcd('0x104')][_0xcbcd('0x14f')](db[_0xcbcd('0x123')],{'as':'List','foreignKey':_0xcbcd('0x165')});db['WhatsappQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x6a')],{'as':_0xcbcd('0x177'),'foreignKey':_0xcbcd('0x15c')});db[_0xcbcd('0x104')][_0xcbcd('0x14f')](db['WhatsappInteraction'],{});db[_0xcbcd('0x104')][_0xcbcd('0x14f')](db['WhatsappQueue'],{});db[_0xcbcd('0x104')][_0xcbcd('0x14f')](db[_0xcbcd('0x1f1')],{});db['WhatsappQueueReport'][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x1f1')],{});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x101')],{});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x140')],{'foreignKey':_0xcbcd('0x1f2'),'as':'FromAccount'});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x140')],{'foreignKey':_0xcbcd('0x1f3'),'as':'ToAccount'});db[_0xcbcd('0x106')]['belongsTo'](db[_0xcbcd('0x108')],{'foreignKey':_0xcbcd('0x1f4'),'as':_0xcbcd('0x1d5')});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':_0xcbcd('0x1d9'),'as':_0xcbcd('0x1d3')});db[_0xcbcd('0x106')][_0xcbcd('0x14f')](db[_0xcbcd('0x10d')],{'foreignKey':'ToUserId','as':_0xcbcd('0x1da')});db[_0xcbcd('0x108')][_0xcbcd('0x122')](db[_0xcbcd('0x10d')],{'as':_0xcbcd('0x152'),'through':_0xcbcd('0x33'),'foreignKey':_0xcbcd('0x1f5')});db['WhatsappQueue'][_0xcbcd('0x122')](db['Team'],{'through':_0xcbcd('0x1f6'),'as':_0xcbcd('0x154')});module[_0xcbcd('0x1f7')]={'db':db,'dbH':dbH};
\ No newline at end of file
index 42b6654..2a7d366 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb298=['route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','password','apiKey','firstName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','channelSecret','accessToken','consumerKey','consumerSecret','membername','calleridname','exten','clientEmail','privateKey','secretaccesskey','key','pass','secret','oldPassword','isPlainObject','isArray','length','isString','@@{','}@@','replace','includes','lodash','path','express','util','./errors','./config/logger','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','headers','x-forwarded-for','remoteAddress','url','statusCode','user','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','method','connection','responseTime','name','agent_name','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/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/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','/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/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','./api/realtime','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','/www','root','/snippet','3.0.0','/plugins','/server/files/plugins'];(function(_0x2b68de,_0x386e6a){var _0x3ef6e2=function(_0xfd5d9f){while(--_0xfd5d9f){_0x2b68de['push'](_0x2b68de['shift']());}};_0x3ef6e2(++_0x386e6a);}(_0xb298,0x17b));var _0x8b29=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb298[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8b29('0x0'));var path=require(_0x8b29('0x1'));var express=require(_0x8b29('0x2'));var ewinston=require('express-winston');var util=require(_0x8b29('0x3'));var errors=require(_0x8b29('0x4'));var config=require('./config/environment');var logger=require(_0x8b29('0x5'))('api');var authLogger=require(_0x8b29('0x5'))(_0x8b29('0x6'));exports[_0x8b29('0x7')]=function(_0x505a9a){_0x505a9a[_0x8b29('0x8')](ewinston[_0x8b29('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x46e9ac,_0x311deb){var _0x338b2f=_0x8b29('0xa');if(!_[_0x8b29('0xb')](_0x46e9ac['body'])){_0x338b2f+=_0x8b29('0xc');var _0x331e58=_0x46e9ac['body'];maskSensitiveData(_0x331e58);}return util['format'](_0x338b2f,_0x46e9ac['method'],_0x46e9ac[_0x8b29('0xd')][_0x8b29('0xe')]?_0x46e9ac[_0x8b29('0xd')][_0x8b29('0xe')]:_0x46e9ac['connection'][_0x8b29('0xf')]||_0x46e9ac['ip'],_0x46e9ac[_0x8b29('0x10')],_0x311deb[_0x8b29('0x11')],_0x311deb['responseTime'],_0x46e9ac[_0x8b29('0x12')]?_0x46e9ac[_0x8b29('0x12')]['id']:null,_0x46e9ac[_0x8b29('0x12')]?_0x46e9ac[_0x8b29('0x12')]['name']:null,_0x46e9ac[_0x8b29('0x12')]?_0x46e9ac[_0x8b29('0x12')][_0x8b29('0x13')]:null,_0x331e58?util[_0x8b29('0x14')](_0x331e58,![],null):'');}}));_0x505a9a[_0x8b29('0x8')](ewinston[_0x8b29('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x30d570,_0x29e4d6){var _0xb5c778=_0x8b29('0x15');if(_0x30d570[_0x8b29('0x16')]&&_0x30d570[_0x8b29('0x16')][_0x8b29('0x17')]&&_0x30d570[_0x8b29('0x16')][_0x8b29('0x18')]){_0xb5c778=_0x8b29('0x19');}return util[_0x8b29('0x1a')](_0xb5c778,_0x30d570[_0x8b29('0x1b')],_0x30d570[_0x8b29('0xd')][_0x8b29('0xe')]?_0x30d570[_0x8b29('0xd')][_0x8b29('0xe')]:_0x30d570[_0x8b29('0x1c')]['remoteAddress']||_0x30d570['ip'],_0x30d570[_0x8b29('0x10')],_0x29e4d6['statusCode'],_0x29e4d6[_0x8b29('0x1d')],_0x30d570[_0x8b29('0x12')]?_0x30d570[_0x8b29('0x12')]['id']:null,_0x30d570['user']?_0x30d570['user'][_0x8b29('0x1e')]:null,_0x30d570[_0x8b29('0x12')]?_0x30d570[_0x8b29('0x12')][_0x8b29('0x13')]:null,_0x30d570['body']&&_0x30d570[_0x8b29('0x16')]['device']?_0x30d570['body']['device']:'other',_0x30d570[_0x8b29('0x16')]&&_0x30d570[_0x8b29('0x16')][_0x8b29('0x18')]?_0x30d570[_0x8b29('0x16')][_0x8b29('0x18')]:'',_0x30d570['body']&&_0x30d570[_0x8b29('0x16')][_0x8b29('0x1f')]?_0x30d570[_0x8b29('0x16')][_0x8b29('0x1f')]:'');},'ignoreRoute':function(_0xfac1a6){var _0xb16875=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xb16875['test'](_0xfac1a6[_0x8b29('0x10')]);}}));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x20'),require(_0x8b29('0x21')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x22'),require('./api/voiceChanSpy'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x23'),require(_0x8b29('0x24')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x25'),require(_0x8b29('0x26')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x27'),require(_0x8b29('0x28')));_0x505a9a[_0x8b29('0x8')]('/api/voice/queues',require(_0x8b29('0x29')));_0x505a9a['use'](_0x8b29('0x2a'),require('./api/voiceRecording'));_0x505a9a[_0x8b29('0x8')]('/api/screen/recordings',require('./api/screenRecording'));_0x505a9a['use'](_0x8b29('0x2b'),require(_0x8b29('0x2c')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x2d'),require(_0x8b29('0x2e')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x2f'),require('./api/voiceCallReport'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x30'),require(_0x8b29('0x31')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x32'),require('./api/voiceAgentReport'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x33'),require(_0x8b29('0x34')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x35'),require(_0x8b29('0x36')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x37'),require(_0x8b29('0x38')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x39'),require(_0x8b29('0x3a')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x3b'),require(_0x8b29('0x3c')));_0x505a9a['use'](_0x8b29('0x3d'),require(_0x8b29('0x3e')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x3f'),require(_0x8b29('0x40')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x41'),require('./api/mailSubstatus'));_0x505a9a['use'](_0x8b29('0x42'),require(_0x8b29('0x43')));_0x505a9a[_0x8b29('0x8')]('/api/mail/messages',require('./api/mailMessage'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x44'),require(_0x8b29('0x45')));_0x505a9a['use'](_0x8b29('0x46'),require(_0x8b29('0x47')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x48'),require(_0x8b29('0x49')));_0x505a9a['use'](_0x8b29('0x4a'),require(_0x8b29('0x4b')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x4c'),require(_0x8b29('0x4d')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x4e'),require(_0x8b29('0x4f')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x50'),require(_0x8b29('0x51')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x52'),require('./api/faxMessage'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x53'),require(_0x8b29('0x54')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x55'),require(_0x8b29('0x56')));_0x505a9a['use'](_0x8b29('0x57'),require(_0x8b29('0x58')));_0x505a9a['use'](_0x8b29('0x59'),require(_0x8b29('0x5a')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x5b'),require(_0x8b29('0x5c')));_0x505a9a['use']('/api/sms/messages',require(_0x8b29('0x5d')));_0x505a9a['use'](_0x8b29('0x5e'),require(_0x8b29('0x5f')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x60'),require('./api/openchannelAccount'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x61'),require(_0x8b29('0x62')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x63'),require(_0x8b29('0x64')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x65'),require(_0x8b29('0x66')));_0x505a9a['use'](_0x8b29('0x67'),require(_0x8b29('0x68')));_0x505a9a['use']('/api/chat/websites',require(_0x8b29('0x69')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x6a'),require(_0x8b29('0x6b')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x6c'),require(_0x8b29('0x6d')));_0x505a9a[_0x8b29('0x8')]('/api/chat/interactions',require(_0x8b29('0x6e')));_0x505a9a['use']('/api/chat/messages',require(_0x8b29('0x6f')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x70'),require(_0x8b29('0x71')));_0x505a9a['use'](_0x8b29('0x72'),require(_0x8b29('0x73')));_0x505a9a['use'](_0x8b29('0x74'),require(_0x8b29('0x75')));_0x505a9a[_0x8b29('0x8')]('/api/chat/proactive_actions',require(_0x8b29('0x76')));_0x505a9a['use']('/api/cm/companies',require(_0x8b29('0x77')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x78'),require('./api/cmContact'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x79'),require(_0x8b29('0x7a')));_0x505a9a[_0x8b29('0x8')]('/api/cm/hopper_black',require(_0x8b29('0x7b')));_0x505a9a['use'](_0x8b29('0x7c'),require(_0x8b29('0x7d')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x7e'),require(_0x8b29('0x7f')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x80'),require(_0x8b29('0x81')));_0x505a9a['use'](_0x8b29('0x82'),require(_0x8b29('0x83')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x84'),require('./api/automation'));_0x505a9a[_0x8b29('0x8')]('/api/canned_answers',require(_0x8b29('0x85')));_0x505a9a['use'](_0x8b29('0x86'),require('./api/disposition'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x87'),require(_0x8b29('0x88')));_0x505a9a[_0x8b29('0x8')]('/api/intervals',require(_0x8b29('0x89')));_0x505a9a['use'](_0x8b29('0x8a'),require(_0x8b29('0x8b')));_0x505a9a['use']('/api/cdr',require('./api/cdr'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x8c'),require(_0x8b29('0x8d')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x8e'),require(_0x8b29('0x8f')));_0x505a9a[_0x8b29('0x8')]('/api/sounds',require(_0x8b29('0x90')));_0x505a9a[_0x8b29('0x8')]('/api/tags',require(_0x8b29('0x91')));_0x505a9a['use'](_0x8b29('0x92'),require('./api/template'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x93'),require(_0x8b29('0x94')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x95'),require('./api/variable'));_0x505a9a[_0x8b29('0x8')]('/api/integrations',require(_0x8b29('0x96')));_0x505a9a['use'](_0x8b29('0x97'),require('./api/integrationReport'));_0x505a9a['use'](_0x8b29('0x98'),require(_0x8b29('0x99')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x9a'),require(_0x8b29('0x9b')));_0x505a9a['use'](_0x8b29('0x9c'),require(_0x8b29('0x9d')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x9e'),require(_0x8b29('0x9f')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xa0'),require(_0x8b29('0xa1')));_0x505a9a[_0x8b29('0x8')]('/api/analytics/tree_reports',require(_0x8b29('0xa2')));_0x505a9a[_0x8b29('0x8')]('/api/integrations/salesforce/accounts',require(_0x8b29('0xa3')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xa4'),require(_0x8b29('0xa5')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xa6'),require(_0x8b29('0xa7')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xa8'),require(_0x8b29('0xa9')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xaa'),require(_0x8b29('0xab')));_0x505a9a['use'](_0x8b29('0xac'),require('./api/intSugarcrmField'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xad'),require('./api/intDeskAccount'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xae'),require(_0x8b29('0xaf')));_0x505a9a[_0x8b29('0x8')]('/api/integrations/desk/fields',require(_0x8b29('0xb0')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xb1'),require(_0x8b29('0xb2')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xb3'),require(_0x8b29('0xb4')));_0x505a9a[_0x8b29('0x8')]('/api/integrations/zoho/fields',require(_0x8b29('0xb5')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xb6'),require(_0x8b29('0xb7')));_0x505a9a['use']('/api/integrations/zendesk/configurations',require(_0x8b29('0xb8')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xb9'),require('./api/intZendeskField'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xba'),require(_0x8b29('0xbb')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xbc'),require(_0x8b29('0xbd')));_0x505a9a['use'](_0x8b29('0xbe'),require(_0x8b29('0xbf')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xc0'),require(_0x8b29('0xc1')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xc2'),require(_0x8b29('0xc3')));_0x505a9a['use'](_0x8b29('0xc4'),require(_0x8b29('0xc5')));_0x505a9a[_0x8b29('0x8')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x505a9a[_0x8b29('0x8')]('/api/integrations/servicenow/configurations',require(_0x8b29('0xc6')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xc7'),require(_0x8b29('0xc8')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xc9'),require(_0x8b29('0xca')));_0x505a9a['use'](_0x8b29('0xcb'),require(_0x8b29('0xcc')));_0x505a9a['use'](_0x8b29('0xcd'),require(_0x8b29('0xce')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xcf'),require('./api/intFreshsalesAccount'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xd0'),require(_0x8b29('0xd1')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xd2'),require(_0x8b29('0xd3')));_0x505a9a['use'](_0x8b29('0xd4'),require('./api/network'));_0x505a9a[_0x8b29('0x8')]('/api/chat/reports/queue',require(_0x8b29('0xd5')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xd6'),require(_0x8b29('0xd7')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xd8'),require(_0x8b29('0xd9')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xda'),require(_0x8b29('0xdb')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xdc'),require(_0x8b29('0xdd')));_0x505a9a[_0x8b29('0x8')]('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xde'),require(_0x8b29('0xdf')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xe0'),require(_0x8b29('0xe1')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xe2'),require(_0x8b29('0xe3')));_0x505a9a[_0x8b29('0x8')]('/api/settings',require('./api/setting'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xe4'),require(_0x8b29('0xe5')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xe6'),require(_0x8b29('0xe7')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xe8'),require('./api/squareRecording'));_0x505a9a['use'](_0x8b29('0xe9'),require(_0x8b29('0xea')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xeb'),require(_0x8b29('0xec')));_0x505a9a['use'](_0x8b29('0xed'),require(_0x8b29('0xee')));_0x505a9a[_0x8b29('0x8')]('/api/campaigns',require(_0x8b29('0xef')));_0x505a9a['use'](_0x8b29('0xf0'),require(_0x8b29('0xf1')));_0x505a9a['use'](_0x8b29('0xf2'),require(_0x8b29('0xf3')));_0x505a9a[_0x8b29('0x8')]('/api/plugins',require(_0x8b29('0xf4')));_0x505a9a['use'](_0x8b29('0xf5'),require(_0x8b29('0xf6')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xf7'),require(_0x8b29('0xf8')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xf9'),require('./api/faxTransferReport'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xfa'),require(_0x8b29('0xfb')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xfc'),require('./api/smsTransferReport'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xfd'),require(_0x8b29('0xfe')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0xff'),require(_0x8b29('0x100')));_0x505a9a['use'](_0x8b29('0x101'),require(_0x8b29('0x102')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x103'),require(_0x8b29('0x104')));_0x505a9a['use']('/api/userProfile/resources',require(_0x8b29('0x105')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x106'),require('./api/userNotification'));_0x505a9a['use']('/api/whatsapp/accounts',require(_0x8b29('0x107')));_0x505a9a['use'](_0x8b29('0x108'),require(_0x8b29('0x109')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x10a'),require(_0x8b29('0x10b')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x10c'),require(_0x8b29('0x10d')));_0x505a9a[_0x8b29('0x8')]('/api/whatsapp/reports/queue',require(_0x8b29('0x10e')));_0x505a9a[_0x8b29('0x8')]('/api/whatsapp/reports/transfer',require(_0x8b29('0x10f')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x110'),require(_0x8b29('0x111')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x112'),require(_0x8b29('0x113')));_0x505a9a[_0x8b29('0x8')]('/api/realtime',require(_0x8b29('0x114')));_0x505a9a[_0x8b29('0x8')]('/api/auth/local',require(_0x8b29('0x115')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x116'),require('./api/authGoogle'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x117'),require(_0x8b29('0x118')));_0x505a9a['use'](_0x8b29('0x119'),require(_0x8b29('0x11a')));_0x505a9a['use'](_0x8b29('0x11b'),require('./api/version'));_0x505a9a[_0x8b29('0x8')]('/api/system',require('./api/system'));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x11c'),require(_0x8b29('0x11d')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x11e'),require(_0x8b29('0x11f')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x120'),express[_0x8b29('0x121')](path[_0x8b29('0x122')](config['root'],_0x8b29('0x120'))));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x123'),express[_0x8b29('0x121')](path[_0x8b29('0x122')](config[_0x8b29('0x124')],_0x8b29('0x123'))));_0x505a9a[_0x8b29('0x8')]('/demo',express['static'](path[_0x8b29('0x122')](config[_0x8b29('0x124')],'/demo')));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x125'),express['static'](path[_0x8b29('0x122')](config[_0x8b29('0x124')],'snippet',_0x8b29('0x126'))));_0x505a9a[_0x8b29('0x8')](_0x8b29('0x127'),express['static'](path['join'](config[_0x8b29('0x124')],_0x8b29('0x128'))));_0x505a9a[_0x8b29('0x129')](_0x8b29('0x12a'))[_0x8b29('0x12b')](errors[0x194]);_0x505a9a[_0x8b29('0x129')]('/*')['get'](function(_0x5a8cf5,_0x4385d7){_0x4385d7[_0x8b29('0x12c')](path['resolve'](_0x505a9a['get'](_0x8b29('0x12d'))+_0x8b29('0x12e')));});};var sensitiveFields=['username',_0x8b29('0x12f'),'newPassword',_0x8b29('0x130'),_0x8b29('0x131'),'lastName',_0x8b29('0x132'),_0x8b29('0x133'),_0x8b29('0x134'),_0x8b29('0x135'),_0x8b29('0x136'),_0x8b29('0x137'),_0x8b29('0x138'),_0x8b29('0x139'),_0x8b29('0x13a'),_0x8b29('0x13b'),'tenantId','token',_0x8b29('0x13c'),_0x8b29('0x13d'),'accessTokenSecret','authToken',_0x8b29('0x13e'),_0x8b29('0x13f'),_0x8b29('0x140'),_0x8b29('0x141'),'calleridnum',_0x8b29('0x142'),'vidaooApiKey',_0x8b29('0x143'),_0x8b29('0x144'),'accesskeyid',_0x8b29('0x145'),_0x8b29('0x146'),_0x8b29('0x12'),_0x8b29('0x147'),'accountSid','localstationid','dsn',_0x8b29('0x148'),'registry',_0x8b29('0x149')];function maskSensitiveData(_0x386df8){var _0x159133=/(?!^)[\s\S](?!$)/g;if(!_[_0x8b29('0x14a')](_0x386df8))return;for(var _0x314a1d in _0x386df8){if(_[_0x8b29('0x14b')](_0x386df8[_0x314a1d])){for(var _0x21fe26=0x0;_0x21fe26<_0x386df8[_0x314a1d][_0x8b29('0x14c')];_0x21fe26++){maskSensitiveData(_0x386df8[_0x314a1d][_0x21fe26]);}}else if(_[_0x8b29('0x14a')](_0x386df8[_0x314a1d])){maskSensitiveData(_0x386df8[_0x314a1d]);}else if(_[_0x8b29('0x14d')](_0x386df8[_0x314a1d])){_0x386df8[_0x314a1d]=_0x386df8[_0x314a1d]['replace'](/{{{/g,_0x8b29('0x14e'))['replace'](/}}}/g,_0x8b29('0x14f'))[_0x8b29('0x150')](/{{/g,'@{')[_0x8b29('0x150')](/}}/g,'}@');if(_[_0x8b29('0x151')](sensitiveFields,_0x314a1d)){_0x386df8[_0x314a1d]=_0x386df8[_0x314a1d]['replace'](_0x159133,'*');}}}}
\ No newline at end of file
+var _0x6ceb=['/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','./api/campaign','/api/migrations','/api/attachments','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/resources','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','/api/auth/local','/api/auth/google','/api/jira','./api/rpc','./api/version','/api/pm2','./api/pm2','/api/webbar','./api/webbar','static','join','root','/apidoc','/www','/demo','/snippet','snippet','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','username','password','newPassword','firstName','street','mobile','fax','email','clientId','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridnum','exten','vidaooApiKey','privateKey','accesskeyid','key','pass','accountSid','localstationid','secret','oldPassword','isPlainObject','isArray','length','isString','replace','}@@','includes','lodash','path','express','express-winston','util','./config/environment','./config/logger','api','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','format','headers','x-forwarded-for','connection','url','statusCode','user','name','inspect','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','responseTime','agent_name','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/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/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/offline_messages','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmCustomField','/api/actions','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration'];(function(_0xcc6ce4,_0x2979cf){var _0x29566e=function(_0x4811bd){while(--_0x4811bd){_0xcc6ce4['push'](_0xcc6ce4['shift']());}};_0x29566e(++_0x2979cf);}(_0x6ceb,0x96));var _0xb6ce=function(_0x143979,_0x448c8c){_0x143979=_0x143979-0x0;var _0x39b818=_0x6ceb[_0x143979];return _0x39b818;};'use strict';var _=require(_0xb6ce('0x0'));var path=require(_0xb6ce('0x1'));var express=require(_0xb6ce('0x2'));var ewinston=require(_0xb6ce('0x3'));var util=require(_0xb6ce('0x4'));var errors=require('./errors');var config=require(_0xb6ce('0x5'));var logger=require(_0xb6ce('0x6'))(_0xb6ce('0x7'));var authLogger=require(_0xb6ce('0x6'))('auth');exports[_0xb6ce('0x8')]=function(_0x4e0726){_0x4e0726['use'](ewinston[_0xb6ce('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x421cae,_0x387f1a){var _0x146b52=_0xb6ce('0xa');if(!_[_0xb6ce('0xb')](_0x421cae[_0xb6ce('0xc')])){_0x146b52+='\x20body=%s';var _0x8978bc=_0x421cae[_0xb6ce('0xc')];maskSensitiveData(_0x8978bc);}return util[_0xb6ce('0xd')](_0x146b52,_0x421cae['method'],_0x421cae[_0xb6ce('0xe')][_0xb6ce('0xf')]?_0x421cae[_0xb6ce('0xe')][_0xb6ce('0xf')]:_0x421cae[_0xb6ce('0x10')]['remoteAddress']||_0x421cae['ip'],_0x421cae[_0xb6ce('0x11')],_0x387f1a[_0xb6ce('0x12')],_0x387f1a['responseTime'],_0x421cae[_0xb6ce('0x13')]?_0x421cae[_0xb6ce('0x13')]['id']:null,_0x421cae[_0xb6ce('0x13')]?_0x421cae['user'][_0xb6ce('0x14')]:null,_0x421cae['user']?_0x421cae[_0xb6ce('0x13')]['role']:null,_0x8978bc?util[_0xb6ce('0x15')](_0x8978bc,![],null):'');}}));_0x4e0726[_0xb6ce('0x16')](ewinston[_0xb6ce('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3dc91f,_0x2ab504){var _0x52adb9=_0xb6ce('0x17');if(_0x3dc91f['body']&&_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x18')]&&_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x19')]){_0x52adb9=_0xb6ce('0x1a');}return util[_0xb6ce('0xd')](_0x52adb9,_0x3dc91f['method'],_0x3dc91f[_0xb6ce('0xe')][_0xb6ce('0xf')]?_0x3dc91f['headers'][_0xb6ce('0xf')]:_0x3dc91f[_0xb6ce('0x10')]['remoteAddress']||_0x3dc91f['ip'],_0x3dc91f[_0xb6ce('0x11')],_0x2ab504[_0xb6ce('0x12')],_0x2ab504[_0xb6ce('0x1b')],_0x3dc91f[_0xb6ce('0x13')]?_0x3dc91f['user']['id']:null,_0x3dc91f[_0xb6ce('0x13')]?_0x3dc91f[_0xb6ce('0x13')][_0xb6ce('0x14')]:null,_0x3dc91f[_0xb6ce('0x13')]?_0x3dc91f['user']['role']:null,_0x3dc91f['body']&&_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x18')]?_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x18')]:'other',_0x3dc91f[_0xb6ce('0xc')]&&_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x19')]?_0x3dc91f[_0xb6ce('0xc')]['agent_id']:'',_0x3dc91f[_0xb6ce('0xc')]&&_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x1c')]?_0x3dc91f[_0xb6ce('0xc')][_0xb6ce('0x1c')]:'');},'ignoreRoute':function(_0x1630cc){var _0x4dd1cc=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x4dd1cc['test'](_0x1630cc['url']);}}));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x1d'),require(_0xb6ce('0x1e')));_0x4e0726[_0xb6ce('0x16')]('/api/voice/chanspy',require(_0xb6ce('0x1f')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x20'),require('./api/voiceContext'));_0x4e0726[_0xb6ce('0x16')]('/api/voice/extensions',require(_0xb6ce('0x21')));_0x4e0726['use'](_0xb6ce('0x22'),require(_0xb6ce('0x23')));_0x4e0726[_0xb6ce('0x16')]('/api/voice/queues',require('./api/voiceQueue'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x24'),require(_0xb6ce('0x25')));_0x4e0726[_0xb6ce('0x16')]('/api/screen/recordings',require(_0xb6ce('0x26')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x27'),require('./api/voiceMail'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x28'),require(_0xb6ce('0x29')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x2a'),require(_0xb6ce('0x2b')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x2c'),require(_0xb6ce('0x2d')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x2e'),require(_0xb6ce('0x2f')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x30'),require(_0xb6ce('0x31')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x32'),require('./api/memberReport'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x33'),require('./api/trunk'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x34'),require(_0xb6ce('0x35')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x36'),require('./api/mailServerOut'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x37'),require(_0xb6ce('0x38')));_0x4e0726['use'](_0xb6ce('0x39'),require(_0xb6ce('0x3a')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x3b'),require(_0xb6ce('0x3c')));_0x4e0726['use'](_0xb6ce('0x3d'),require(_0xb6ce('0x3e')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x3f'),require(_0xb6ce('0x40')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x41'),require(_0xb6ce('0x42')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x43'),require('./api/mailQueueReport'));_0x4e0726[_0xb6ce('0x16')]('/api/dashboards',require('./api/dashboard'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x44'),require('./api/dashboardItem'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x45'),require(_0xb6ce('0x46')));_0x4e0726['use'](_0xb6ce('0x47'),require(_0xb6ce('0x48')));_0x4e0726['use']('/api/fax/interactions',require(_0xb6ce('0x49')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x4a'),require('./api/faxMessage'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x4b'),require('./api/faxQueue'));_0x4e0726['use']('/api/fax/reports/queue',require('./api/faxQueueReport'));_0x4e0726[_0xb6ce('0x16')]('/api/sms/accounts',require(_0xb6ce('0x4c')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x4d'),require(_0xb6ce('0x4e')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x4f'),require(_0xb6ce('0x50')));_0x4e0726['use'](_0xb6ce('0x51'),require('./api/smsMessage'));_0x4e0726['use'](_0xb6ce('0x52'),require(_0xb6ce('0x53')));_0x4e0726[_0xb6ce('0x16')]('/api/openchannel/accounts',require(_0xb6ce('0x54')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x55'),require(_0xb6ce('0x56')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x57'),require(_0xb6ce('0x58')));_0x4e0726[_0xb6ce('0x16')]('/api/openchannel/messages',require(_0xb6ce('0x59')));_0x4e0726['use']('/api/openchannel/queues',require(_0xb6ce('0x5a')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x5b'),require(_0xb6ce('0x5c')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x5d'),require(_0xb6ce('0x5e')));_0x4e0726[_0xb6ce('0x16')]('/api/chat/applications',require(_0xb6ce('0x5f')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x60'),require(_0xb6ce('0x61')));_0x4e0726[_0xb6ce('0x16')]('/api/chat/messages',require('./api/chatMessage'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x62'),require('./api/chatOfflineMessage'));_0x4e0726['use']('/api/chat/queues',require(_0xb6ce('0x63')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x64'),require(_0xb6ce('0x65')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x66'),require(_0xb6ce('0x67')));_0x4e0726[_0xb6ce('0x16')]('/api/cm/companies',require(_0xb6ce('0x68')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x69'),require(_0xb6ce('0x6a')));_0x4e0726['use'](_0xb6ce('0x6b'),require(_0xb6ce('0x6c')));_0x4e0726[_0xb6ce('0x16')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x4e0726[_0xb6ce('0x16')]('/api/cm/hopper_final',require(_0xb6ce('0x6d')));_0x4e0726['use'](_0xb6ce('0x6e'),require('./api/cmHopperHistory'));_0x4e0726[_0xb6ce('0x16')]('/api/cm/custom_fields',require(_0xb6ce('0x6f')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x70'),require('./api/action'));_0x4e0726[_0xb6ce('0x16')]('/api/automations',require(_0xb6ce('0x71')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x72'),require(_0xb6ce('0x73')));_0x4e0726['use'](_0xb6ce('0x74'),require(_0xb6ce('0x75')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x76'),require(_0xb6ce('0x77')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x78'),require(_0xb6ce('0x79')));_0x4e0726[_0xb6ce('0x16')]('/api/pauses',require(_0xb6ce('0x7a')));_0x4e0726['use'](_0xb6ce('0x7b'),require('./api/cdr'));_0x4e0726['use'](_0xb6ce('0x7c'),require(_0xb6ce('0x7d')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x7e'),require('./api/schedule'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x7f'),require(_0xb6ce('0x80')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x81'),require(_0xb6ce('0x82')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x83'),require('./api/template'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x84'),require('./api/trigger'));_0x4e0726['use']('/api/variables',require(_0xb6ce('0x85')));_0x4e0726[_0xb6ce('0x16')]('/api/integrations',require(_0xb6ce('0x86')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x87'),require('./api/integrationReport'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x88'),require(_0xb6ce('0x89')));_0x4e0726[_0xb6ce('0x16')]('/api/analytics/default_reports',require(_0xb6ce('0x8a')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x8b'),require(_0xb6ce('0x8c')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x8d'),require('./api/analyticMetric'));_0x4e0726[_0xb6ce('0x16')]('/api/analytics/field_reports',require('./api/analyticFieldReport'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x8e'),require(_0xb6ce('0x8f')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x90'),require(_0xb6ce('0x91')));_0x4e0726[_0xb6ce('0x16')]('/api/integrations/salesforce/configurations',require(_0xb6ce('0x92')));_0x4e0726['use']('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x4e0726[_0xb6ce('0x16')]('/api/integrations/sugarcrm/accounts',require(_0xb6ce('0x93')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x94'),require(_0xb6ce('0x95')));_0x4e0726[_0xb6ce('0x16')]('/api/integrations/sugarcrm/fields',require(_0xb6ce('0x96')));_0x4e0726[_0xb6ce('0x16')]('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x4e0726['use'](_0xb6ce('0x97'),require(_0xb6ce('0x98')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x99'),require(_0xb6ce('0x9a')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x9b'),require(_0xb6ce('0x9c')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x9d'),require(_0xb6ce('0x9e')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x9f'),require(_0xb6ce('0xa0')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xa1'),require(_0xb6ce('0xa2')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xa3'),require(_0xb6ce('0xa4')));_0x4e0726['use']('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xa5'),require('./api/intFreshdeskAccount'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xa6'),require(_0xb6ce('0xa7')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xa8'),require(_0xb6ce('0xa9')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xaa'),require(_0xb6ce('0xab')));_0x4e0726['use'](_0xb6ce('0xac'),require(_0xb6ce('0xad')));_0x4e0726[_0xb6ce('0x16')]('/api/integrations/vtiger/fields',require(_0xb6ce('0xae')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xaf'),require(_0xb6ce('0xb0')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xb1'),require(_0xb6ce('0xb2')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xb3'),require('./api/intServicenowField'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xb4'),require('./api/intDynamics365Account'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xb5'),require(_0xb6ce('0xb6')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xb7'),require(_0xb6ce('0xb8')));_0x4e0726['use'](_0xb6ce('0xb9'),require(_0xb6ce('0xba')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xbb'),require('./api/intFreshsalesConfiguration'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xbc'),require(_0xb6ce('0xbd')));_0x4e0726['use'](_0xb6ce('0xbe'),require('./api/network'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xbf'),require(_0xb6ce('0xc0')));_0x4e0726['use']('/api/chat/internal/messages',require('./api/chatInternalMessage'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xc1'),require(_0xb6ce('0xc2')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xc3'),require(_0xb6ce('0xc4')));_0x4e0726['use'](_0xb6ce('0xc5'),require(_0xb6ce('0xc6')));_0x4e0726['use'](_0xb6ce('0xc7'),require('./api/smsQueueReport'));_0x4e0726['use'](_0xb6ce('0xc8'),require(_0xb6ce('0xc9')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xca'),require(_0xb6ce('0xcb')));_0x4e0726['use'](_0xb6ce('0xcc'),require(_0xb6ce('0xcd')));_0x4e0726['use'](_0xb6ce('0xce'),require(_0xb6ce('0xcf')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xd0'),require('./api/squareOdbc'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xd1'),require(_0xb6ce('0xd2')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xd3'),require(_0xb6ce('0xd4')));_0x4e0726['use'](_0xb6ce('0xd5'),require(_0xb6ce('0xd6')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xd7'),require(_0xb6ce('0xd8')));_0x4e0726['use']('/api/license',require(_0xb6ce('0xd9')));_0x4e0726[_0xb6ce('0x16')]('/api/campaigns',require(_0xb6ce('0xda')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xdb'),require('./api/migration'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xdc'),require(_0xb6ce('0xdd')));_0x4e0726['use'](_0xb6ce('0xde'),require('./api/plugin'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xdf'),require(_0xb6ce('0xe0')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xe1'),require(_0xb6ce('0xe2')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xe3'),require(_0xb6ce('0xe4')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xe5'),require(_0xb6ce('0xe6')));_0x4e0726[_0xb6ce('0x16')]('/api/sms/reports/transfer',require(_0xb6ce('0xe7')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xe8'),require(_0xb6ce('0xe9')));_0x4e0726[_0xb6ce('0x16')]('/api/voice/prefixes',require(_0xb6ce('0xea')));_0x4e0726['use'](_0xb6ce('0xeb'),require('./api/userProfile'));_0x4e0726[_0xb6ce('0x16')]('/api/userProfile/sections',require('./api/userProfileSection'));_0x4e0726['use'](_0xb6ce('0xec'),require('./api/userProfileResource'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xed'),require(_0xb6ce('0xee')));_0x4e0726['use'](_0xb6ce('0xef'),require(_0xb6ce('0xf0')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xf1'),require('./api/whatsappApplication'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xf2'),require(_0xb6ce('0xf3')));_0x4e0726[_0xb6ce('0x16')]('/api/whatsapp/messages',require(_0xb6ce('0xf4')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xf5'),require(_0xb6ce('0xf6')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xf7'),require(_0xb6ce('0xf8')));_0x4e0726['use'](_0xb6ce('0xf9'),require(_0xb6ce('0xfa')));_0x4e0726[_0xb6ce('0x16')]('/api/cloudProviders',require(_0xb6ce('0xfb')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xfc'),require('./api/realtime'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xfd'),require('./api/authLocal'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xfe'),require('./api/authGoogle'));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0xff'),require('./api/jira'));_0x4e0726[_0xb6ce('0x16')]('/api/rpc',require(_0xb6ce('0x100')));_0x4e0726['use']('/api/version',require(_0xb6ce('0x101')));_0x4e0726[_0xb6ce('0x16')]('/api/system',require('./api/system'));_0x4e0726['use'](_0xb6ce('0x102'),require(_0xb6ce('0x103')));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x104'),require(_0xb6ce('0x105')));_0x4e0726[_0xb6ce('0x16')]('/apidoc',express[_0xb6ce('0x106')](path[_0xb6ce('0x107')](config[_0xb6ce('0x108')],_0xb6ce('0x109'))));_0x4e0726['use'](_0xb6ce('0x10a'),express[_0xb6ce('0x106')](path[_0xb6ce('0x107')](config[_0xb6ce('0x108')],_0xb6ce('0x10a'))));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x10b'),express[_0xb6ce('0x106')](path[_0xb6ce('0x107')](config['root'],_0xb6ce('0x10b'))));_0x4e0726[_0xb6ce('0x16')](_0xb6ce('0x10c'),express[_0xb6ce('0x106')](path[_0xb6ce('0x107')](config[_0xb6ce('0x108')],_0xb6ce('0x10d'),'3.0.0')));_0x4e0726[_0xb6ce('0x16')]('/plugins',express[_0xb6ce('0x106')](path[_0xb6ce('0x107')](config[_0xb6ce('0x108')],_0xb6ce('0x10e'))));_0x4e0726[_0xb6ce('0x10f')](_0xb6ce('0x110'))[_0xb6ce('0x111')](errors[0x194]);_0x4e0726['route']('/*')[_0xb6ce('0x111')](function(_0x3a1cbb,_0x554c3b){_0x554c3b['sendFile'](path[_0xb6ce('0x112')](_0x4e0726[_0xb6ce('0x111')](_0xb6ce('0x113'))+'/index.html'));});};var sensitiveFields=[_0xb6ce('0x114'),_0xb6ce('0x115'),_0xb6ce('0x116'),'apiKey',_0xb6ce('0x117'),'lastName',_0xb6ce('0x118'),'phone',_0xb6ce('0x119'),_0xb6ce('0x11a'),_0xb6ce('0x11b'),_0xb6ce('0x11c'),'clientSecret',_0xb6ce('0x11d'),_0xb6ce('0x11e'),_0xb6ce('0x11f'),_0xb6ce('0x120'),_0xb6ce('0x121'),_0xb6ce('0x122'),_0xb6ce('0x123'),_0xb6ce('0x124'),_0xb6ce('0x125'),_0xb6ce('0x126'),_0xb6ce('0x127'),_0xb6ce('0x128'),'calleridname',_0xb6ce('0x129'),_0xb6ce('0x12a'),_0xb6ce('0x12b'),'clientEmail',_0xb6ce('0x12c'),_0xb6ce('0x12d'),'secretaccesskey',_0xb6ce('0x12e'),'user',_0xb6ce('0x12f'),_0xb6ce('0x130'),_0xb6ce('0x131'),'dsn',_0xb6ce('0x132'),'registry',_0xb6ce('0x133')];function maskSensitiveData(_0x516100){var _0x471bb0=/(?!^)[\s\S](?!$)/g;if(!_[_0xb6ce('0x134')](_0x516100))return;for(var _0x564703 in _0x516100){if(_[_0xb6ce('0x135')](_0x516100[_0x564703])){for(var _0x288093=0x0;_0x288093<_0x516100[_0x564703][_0xb6ce('0x136')];_0x288093++){maskSensitiveData(_0x516100[_0x564703][_0x288093]);}}else if(_[_0xb6ce('0x134')](_0x516100[_0x564703])){maskSensitiveData(_0x516100[_0x564703]);}else if(_[_0xb6ce('0x137')](_0x516100[_0x564703])){_0x516100[_0x564703]=_0x516100[_0x564703][_0xb6ce('0x138')](/{{{/g,'@@{')[_0xb6ce('0x138')](/}}}/g,_0xb6ce('0x139'))['replace'](/{{/g,'@{')[_0xb6ce('0x138')](/}}/g,'}@');if(_[_0xb6ce('0x13a')](sensitiveFields,_0x564703)){_0x516100[_0x564703]=_0x516100[_0x564703][_0xb6ce('0x138')](_0x471bb0,'*');}}}}
\ No newline at end of file
index 1ab00a0..8d342aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa21b=['listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment'];(function(_0x420a7c,_0x3ef0bc){var _0x311c52=function(_0x217b82){while(--_0x217b82){_0x420a7c['push'](_0x420a7c['shift']());}};_0x311c52(++_0x3ef0bc);}(_0xa21b,0xf6));var _0xba21=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0xa21b[_0x4bb145];return _0x4db596;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0xba21('0x0'));var config=require(_0xba21('0x1'));exports[_0xba21('0x2')]=function(){return new BPromise(function(_0xcb2c18,_0x5c34eb){var _0x5ec915={};_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x4')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x5')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/voiceQueue/voiceQueue.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/voiceRecording/voiceRecording.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x6')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x7')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/memberReport/memberReport.rpc'));_0x5ec915=_['merge'](_0x5ec915,require('../api/trunk/trunk.rpc'));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x8')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x9')));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0xa')));_0x5ec915=_['merge'](_0x5ec915,require('../api/mailAccount/mailAccount.rpc'));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0xb')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0xc')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/mailMessage/mailMessage.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0xd')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0xe')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/faxAccount/faxAccount.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/faxApplication/faxApplication.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0xf')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x10')));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x11')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x12')));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x13')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x14')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x15')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/smsQueue/smsQueue.rpc'));_0x5ec915=_['merge'](_0x5ec915,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x16')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x17')));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x18')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/chatMessage/chatMessage.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x19')));_0x5ec915=_['merge'](_0x5ec915,require('../api/cmContact/cmContact.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x1a')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x1b')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x1c')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/interval/interval.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x1d')));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x1e')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/template/template.rpc'));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x1f')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x20')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x21')));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x22')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x23')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x24')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x25')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x26')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x27')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x28')));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x29')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x2a')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x2b')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x2c')));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x2d')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/squareRecording/squareRecording.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x2e')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/campaign/campaign.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require('../api/attachment/attachment.rpc'));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x2f')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x30')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x31')));_0x5ec915=_[_0xba21('0x3')](_0x5ec915,require(_0xba21('0x32')));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x33')));_0x5ec915=_['merge'](_0x5ec915,require(_0xba21('0x34')));var _0x37436d=jayson[_0xba21('0x35')](_0x5ec915)[_0xba21('0x36')]();var _0x251eea=config[_0xba21('0x37')][_0xba21('0x38')]||config[_0xba21('0x38')]+0x1;var _0x50b2f9=config[_0xba21('0x37')]['ip']||'localhost';_0x37436d['on'](_0xba21('0x39'),function(_0x2d4bb7){return _0x5c34eb(_0x2d4bb7);});_0x37436d[_0xba21('0x2')](_0x251eea,_0x50b2f9,function(){console['log'](_0xba21('0x3a'),_0x50b2f9,_0x251eea);require(_0xba21('0x3b'))[_0xba21('0x3c')]();return _0xcb2c18(_0xba21('0x3d')+_0x50b2f9+':'+_0x251eea);});});};
\ No newline at end of file
+var _0xef1b=['../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.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/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0xef1b,0xae));var _0xbef1=function(_0x1f909d,_0x15f987){_0x1f909d=_0x1f909d-0x0;var _0x163242=_0xef1b[_0x1f909d];return _0x163242;};'use strict';var jayson=require(_0xbef1('0x0'));var BPromise=require(_0xbef1('0x1'));var _=require(_0xbef1('0x2'));var config=require('../config/environment');exports[_0xbef1('0x3')]=function(){return new BPromise(function(_0x358218,_0x3583ee){var _0x131017={};_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x5')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x6')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x7')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x8')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x9')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/memberReport/memberReport.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xa')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xb')));_0x131017=_['merge'](_0x131017,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xc')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xd')));_0x131017=_['merge'](_0x131017,require('../api/mailQueue/mailQueue.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xe')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0xf')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x10')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x11')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x12')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x13')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x14')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x15')));_0x131017=_['merge'](_0x131017,require('../api/faxQueue/faxQueue.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x16')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x17')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x18')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x19')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x1a')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x1b')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x1c')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x1d')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x1e')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/chatQueue/chatQueue.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x1f')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x20')));_0x131017=_['merge'](_0x131017,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x21')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x22')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x23')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/interval/interval.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/pause/pause.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x24')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x25')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x26')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x27')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x28')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x29')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x2a')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x2b')));_0x131017=_['merge'](_0x131017,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x2c')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x2d')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x2e')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x2f')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x30')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x31')));_0x131017=_['merge'](_0x131017,require('../api/squareReport/squareReport.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x32')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x33')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x34')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x35')));_0x131017=_[_0xbef1('0x4')](_0x131017,require('../api/squareRecording/squareRecording.rpc'));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x36')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x37')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x38')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x39')));_0x131017=_['merge'](_0x131017,require(_0xbef1('0x3a')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x3b')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x3c')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x3d')));_0x131017=_[_0xbef1('0x4')](_0x131017,require(_0xbef1('0x3e')));var _0x2536d2=jayson[_0xbef1('0x3f')](_0x131017)['http']();var _0x2f9791=config[_0xbef1('0x40')][_0xbef1('0x41')]||config[_0xbef1('0x41')]+0x1;var _0x34194e=config['rpc']['ip']||_0xbef1('0x42');_0x2536d2['on']('error',function(_0xf194be){return _0x3583ee(_0xf194be);});_0x2536d2[_0xbef1('0x3')](_0x2f9791,_0x34194e,function(){console[_0xbef1('0x43')](_0xbef1('0x44'),_0x34194e,_0x2f9791);require(_0xbef1('0x45'))['default']();return _0x358218(_0xbef1('0x46')+_0x34194e+':'+_0x2f9791);});});};
\ No newline at end of file
index 8bb1b7a..7532e85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd03=['destroy','command','write','inherits','prototype','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','exec','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20PRIORITY\x20%s','setVariable','isBoolean','isNumber','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setPriority','noop','getVariable','GET\x20VARIABLE\x20\x22%s\x22','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','AGI','WAIT','label','exports','util','events','./reply','./error','call','setEncoding','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','520-Invalid','search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','indexOf','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout'];(function(_0x1c824f,_0x150473){var _0x366b8f=function(_0x4b3c30){while(--_0x4b3c30){_0x1c824f['push'](_0x1c824f['shift']());}};_0x366b8f(++_0x150473);}(_0xcd03,0x14f));var _0x3cd0=function(_0xca953c,_0x30bfec){_0xca953c=_0xca953c-0x0;var _0xd61229=_0xcd03[_0xca953c];return _0xd61229;};'use strict';var util=require(_0x3cd0('0x0'));var _=require('lodash');var EventEmitter=require(_0x3cd0('0x1'))['EventEmitter'];var AGIReply=require(_0x3cd0('0x2'));var AGIError=require(_0x3cd0('0x3'));function AGIChannel(_0x437594){var _0x943d62=this,_0x10841e=new AGIReply(),_0x4fdf59=![],_0x2ef9a3={};EventEmitter[_0x3cd0('0x4')](_0x943d62);_0x437594[_0x3cd0('0x5')](_0x3cd0('0x6'));_0x437594[_0x3cd0('0x7')](0x8*0x3c*0x3c*0x3e8);_0x10841e[_0x3cd0('0x5')](_0x3cd0('0x6'));_0x10841e['on']('headers',function(_0x506fab){for(var _0x4da35a in _0x506fab){_0x943d62[_0x4da35a]=_0x506fab[_0x4da35a];}_0x943d62[_0x3cd0('0x8')](_0x3cd0('0x9'));});_0x10841e['on'](_0x3cd0('0xa'),function(_0x173a3d){if(_0x173a3d[_0x3cd0('0xb')]()==_0x3cd0('0xc')){_0x943d62['emit'](_0x3cd0('0xc'));return;}if(_0x173a3d['substring'](0x0,0xb)==_0x3cd0('0xd')){_0x4fdf59=!![];}if(_0x4fdf59){_0x2ef9a3['rx']+=_0x173a3d+'\x0a';if(_0x173a3d[_0x3cd0('0xe')](_0x3cd0('0xf'))!=-0x1){_0x4fdf59=![];}}else{_0x2ef9a3['rx']=_0x173a3d;}if(_0x4fdf59){return;}if(typeof _0x2ef9a3['cb']==_0x3cd0('0x10')){var _0x24dd2b=_0x2ef9a3['rx'][_0x3cd0('0x11')](0x0,0x3),_0x41151f=null,_0xc90cc=null;_0x24dd2b=parseInt(_0x24dd2b);if(isNaN(_0x24dd2b)){_0x2ef9a3['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x3cd0('0x12')});return;}if(_0x24dd2b!=0xc8){_0x2ef9a3['cb'](null,{'code':_0x24dd2b,'result':-0x1,'extra':'KO'});return;}_0x41151f=_0x2ef9a3['rx']['substring'](0x4)[_0x3cd0('0x13')]('result=','');if(_0x41151f[_0x3cd0('0x14')]('\x20')!=-0x1){_0x41151f=_0x41151f['substr'](0x0,_0x41151f[_0x3cd0('0x14')]('\x20'));}if(_['startsWith'](_0x41151f,'-1')){_0x41151f=parseInt(_0x41151f);}_0xc90cc=_0x2ef9a3['rx'][_0x3cd0('0x15')]('\x20');if(_0xc90cc[_0x3cd0('0x16')]==0x3){_0xc90cc=_0xc90cc[0x2]['substring'](0x1,_0xc90cc[0x2][_0x3cd0('0x16')]-0x1);}else if(_0xc90cc['length']>0x3){var _0x265d44=/\((.+)\)/;var _0x39fc63=_0x2ef9a3['rx'][_0x3cd0('0x17')](_0x265d44);if(_0x39fc63){_0xc90cc=_0x39fc63[0x1];}else{_0xc90cc=null;}}else{_0xc90cc=null;}_0x2ef9a3['cb'](null,{'code':_0x24dd2b,'result':_0x41151f,'extra':_0xc90cc});}});_0x437594['on'](_0x3cd0('0x18'),function(_0x3f6b70){_0x943d62[_0x3cd0('0x8')](_0x3cd0('0x18'),new AGIError(_0x3cd0('0x19'),_0x3f6b70[_0x3cd0('0x1a')]));});_0x437594['on'](_0x3cd0('0x1b'),function(){_0x943d62[_0x3cd0('0x8')](_0x3cd0('0x1b'),new AGIError(_0x3cd0('0x1c')));});_0x437594['on'](_0x3cd0('0x1d'),function(){_0x943d62[_0x3cd0('0x8')](_0x3cd0('0x1d'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x437594[_0x3cd0('0x1e')]();});_0x437594['pipe'](_0x10841e);this[_0x3cd0('0x1f')]=function(_0x375705,_0x129551){var _0x375705=_0x375705||'',_0x129551=typeof _0x129551==_0x3cd0('0x10')?_0x129551:new Function();_0x2ef9a3={'tx':_0x375705,'rx':'','cb':_0x129551};_0x437594[_0x3cd0('0x20')](_0x375705+'\x0a');},this[_0x3cd0('0x1b')]=function(){_0x437594[_0x3cd0('0x1e')]();};}util[_0x3cd0('0x21')](AGIChannel,EventEmitter);AGIChannel[_0x3cd0('0x22')][_0x3cd0('0x23')]=function(_0x51ec5a){return this[_0x3cd0('0x1f')]['sync'](this,_0x51ec5a);};AGIChannel[_0x3cd0('0x22')]['answer']=function(){return this[_0x3cd0('0x23')](_0x3cd0('0x24'));};AGIChannel['prototype'][_0x3cd0('0x25')]=function(_0x989651,_0x39d0cc,_0x1a98a9){_0x989651=_0x989651===undefined?_0x3cd0('0x26'):_0x989651;_0x39d0cc=_0x39d0cc===undefined?'5':_0x39d0cc;_0x1a98a9=_0x1a98a9===undefined?'1':_0x1a98a9;return this[_0x3cd0('0x23')](util[_0x3cd0('0x27')](_0x3cd0('0x28'),_0x989651,_0x39d0cc*0x3e8,_0x1a98a9));};AGIChannel['prototype']['noop']=function(_0x335196){_0x335196=_0x335196||_0x3cd0('0x29');return this[_0x3cd0('0x23')](util[_0x3cd0('0x27')]('VERBOSE\x20\x22%s\x22',_0x335196));};AGIChannel[_0x3cd0('0x22')][_0x3cd0('0x2a')]=function(_0x3ea3ca,_0x2fcefe){if(_['isArray'](_0x2fcefe)){return this['sendRequest'](util[_0x3cd0('0x27')](_0x3cd0('0x2b'),_0x3ea3ca,_0x2fcefe[_0x3cd0('0x2c')](',')));}return this[_0x3cd0('0x23')](util[_0x3cd0('0x27')](_0x3cd0('0x2b'),_0x3ea3ca,_0x2fcefe));};AGIChannel['prototype'][_0x3cd0('0x2d')]=function(_0x56e119){return this['sendRequest'](util[_0x3cd0('0x27')](_0x3cd0('0x2e'),_0x56e119));};AGIChannel[_0x3cd0('0x22')][_0x3cd0('0x2f')]=function(_0x7015b5){return this[_0x3cd0('0x23')](util[_0x3cd0('0x27')]('SET\x20EXTENSION\x20%s',_0x7015b5));};AGIChannel[_0x3cd0('0x22')]['setPriority']=function(_0x256348){return this[_0x3cd0('0x23')](util[_0x3cd0('0x27')](_0x3cd0('0x30'),_0x256348));};AGIChannel['prototype'][_0x3cd0('0xc')]=function(){return this[_0x3cd0('0x23')]('HANGUP');};AGIChannel[_0x3cd0('0x22')][_0x3cd0('0x31')]=function(_0x3dd59e,_0x427c86){var _0x26087d=_[_0x3cd0('0x32')](_0x427c86)||_[_0x3cd0('0x33')](_0x427c86)?_0x427c86[_0x3cd0('0x34')]():_0x427c86;return this['sendRequest'](util[_0x3cd0('0x27')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3dd59e,_0x26087d?_0x26087d[_0x3cd0('0x34')]()[_0x3cd0('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3cd0('0x22')]['sayNumber']=function(_0x52200a,_0x239925){return this[_0x3cd0('0x23')](util[_0x3cd0('0x27')](_0x3cd0('0x35'),_0x52200a,_0x239925));};AGIChannel['prototype'][_0x3cd0('0x36')]=function(_0x4da9fc,_0x42a572){return this[_0x3cd0('0x23')](util['format'](_0x3cd0('0x37'),_0x4da9fc,_0x42a572));};AGIChannel[_0x3cd0('0x22')]['sayPhonetic']=function(_0x4455ff,_0x57865b){return this[_0x3cd0('0x23')](util[_0x3cd0('0x27')](_0x3cd0('0x38'),_0x4455ff,_0x57865b));};AGIChannel[_0x3cd0('0x22')][_0x3cd0('0x39')]=function(_0x19cbca,_0x193916,_0x244040){_0x193916=_0x193916||this[_0x3cd0('0x3a')];_0x244040=_0x244040||0x1;this['setContext'](_0x19cbca);this[_0x3cd0('0x2f')](_0x193916);this[_0x3cd0('0x3b')](_0x244040);return this[_0x3cd0('0x3c')](util[_0x3cd0('0x27')]('GOTO\x20%s\x20%s\x20%s',_0x19cbca,_0x193916,_0x244040));};AGIChannel[_0x3cd0('0x22')][_0x3cd0('0x3d')]=function(_0x5c4593){return this['sendRequest'](util[_0x3cd0('0x27')](_0x3cd0('0x3e'),_0x5c4593));};AGIChannel[_0x3cd0('0x22')]['recordFile']=function(_0x187afa,_0x7c7182,_0x41b7f5,_0x73b305,_0x1953d3,_0x21827e){_0x7c7182=_0x7c7182||_0x3cd0('0x3f');_0x41b7f5=_0x41b7f5||'';_0x73b305=_0x73b305===undefined?-0x1:_0x73b305==='-1'?-0x1:_0x73b305*0x3e8;_0x1953d3=_0x1953d3===undefined?'':'s='+_0x1953d3;_0x21827e=_0x21827e?_0x3cd0('0x40'):'';return this['sendRequest'](util[_0x3cd0('0x27')](_0x3cd0('0x41'),_0x187afa,_0x7c7182,_0x41b7f5,_0x73b305,_0x21827e,_0x1953d3));};AGIChannel['prototype'][_0x3cd0('0x42')]=function(_0x11675c,_0x4b7877){_0x4b7877=_0x4b7877||'';return this[_0x3cd0('0x23')](util['format'](_0x3cd0('0x43'),_0x11675c,_0x4b7877));};AGIChannel[_0x3cd0('0x22')][_0x3cd0('0x44')]=function(_0x5328ac){return this[_0x3cd0('0x2a')](_0x3cd0('0x45'),_0x5328ac);};AGIChannel[_0x3cd0('0x22')]['wait']=function(_0x217209){return this[_0x3cd0('0x2a')](_0x3cd0('0x46'),_0x217209);};AGIChannel[_0x3cd0('0x22')]['error']=function(_0x583c40,_0x5bf2d4){this[_0x3cd0('0x3c')](util['format']('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x583c40['id'],_0x583c40[_0x3cd0('0x47')],_0x5bf2d4));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3cd0('0x48')]=AGIChannel;
\ No newline at end of file
+var _0x917f=['beep','format','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','setVariable','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','GOTO\x20%s\x20%s\x20%s','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','noop','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','events','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','split','match','error','code','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','close','prototype','sendRequest','sync','answer','ANSWER','getData'];(function(_0x234e1a,_0x500d79){var _0x55aad2=function(_0x272396){while(--_0x272396){_0x234e1a['push'](_0x234e1a['shift']());}};_0x55aad2(++_0x500d79);}(_0x917f,0x110));var _0xf917=function(_0x1c7f45,_0x3a7036){_0x1c7f45=_0x1c7f45-0x0;var _0x4f1931=_0x917f[_0x1c7f45];return _0x4f1931;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0xf917('0x0'))[_0xf917('0x1')];var AGIReply=require(_0xf917('0x2'));var AGIError=require('./error');function AGIChannel(_0x2c7c46){var _0x25df66=this,_0x5070ff=new AGIReply(),_0x1ef89d=![],_0x29300b={};EventEmitter[_0xf917('0x3')](_0x25df66);_0x2c7c46[_0xf917('0x4')](_0xf917('0x5'));_0x2c7c46[_0xf917('0x6')](0x8*0x3c*0x3c*0x3e8);_0x5070ff[_0xf917('0x4')](_0xf917('0x5'));_0x5070ff['on'](_0xf917('0x7'),function(_0x39cd61){for(var _0x4f307d in _0x39cd61){_0x25df66[_0x4f307d]=_0x39cd61[_0x4f307d];}_0x25df66[_0xf917('0x8')](_0xf917('0x9'));});_0x5070ff['on'](_0xf917('0xa'),function(_0x191e3d){if(_0x191e3d[_0xf917('0xb')]()==_0xf917('0xc')){_0x25df66['emit'](_0xf917('0xc'));return;}if(_0x191e3d[_0xf917('0xd')](0x0,0xb)=='520-Invalid'){_0x1ef89d=!![];}if(_0x1ef89d){_0x29300b['rx']+=_0x191e3d+'\x0a';if(_0x191e3d[_0xf917('0xe')](_0xf917('0xf'))!=-0x1){_0x1ef89d=![];}}else{_0x29300b['rx']=_0x191e3d;}if(_0x1ef89d){return;}if(typeof _0x29300b['cb']==_0xf917('0x10')){var _0x13b74b=_0x29300b['rx'][_0xf917('0xd')](0x0,0x3),_0x3b7d5c=null,_0x6f1ca1=null;_0x13b74b=parseInt(_0x13b74b);if(isNaN(_0x13b74b)){_0x29300b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf917('0x11')});return;}if(_0x13b74b!=0xc8){_0x29300b['cb'](null,{'code':_0x13b74b,'result':-0x1,'extra':'KO'});return;}_0x3b7d5c=_0x29300b['rx'][_0xf917('0xd')](0x4)[_0xf917('0x12')](_0xf917('0x13'),'');if(_0x3b7d5c[_0xf917('0x14')]('\x20')!=-0x1){_0x3b7d5c=_0x3b7d5c[_0xf917('0x15')](0x0,_0x3b7d5c[_0xf917('0x14')]('\x20'));}if(_[_0xf917('0x16')](_0x3b7d5c,'-1')){_0x3b7d5c=parseInt(_0x3b7d5c);}_0x6f1ca1=_0x29300b['rx'][_0xf917('0x17')]('\x20');if(_0x6f1ca1['length']==0x3){_0x6f1ca1=_0x6f1ca1[0x2][_0xf917('0xd')](0x1,_0x6f1ca1[0x2]['length']-0x1);}else if(_0x6f1ca1['length']>0x3){var _0x2fd619=/\((.+)\)/;var _0x158aae=_0x29300b['rx'][_0xf917('0x18')](_0x2fd619);if(_0x158aae){_0x6f1ca1=_0x158aae[0x1];}else{_0x6f1ca1=null;}}else{_0x6f1ca1=null;}_0x29300b['cb'](null,{'code':_0x13b74b,'result':_0x3b7d5c,'extra':_0x6f1ca1});}});_0x2c7c46['on'](_0xf917('0x19'),function(_0x543f7f){_0x25df66[_0xf917('0x8')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x543f7f[_0xf917('0x1a')]));});_0x2c7c46['on']('close',function(){_0x25df66[_0xf917('0x8')]('close',new AGIError(_0xf917('0x1b')));});_0x2c7c46['on'](_0xf917('0x1c'),function(){_0x25df66[_0xf917('0x8')]('timeout',new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x2c7c46[_0xf917('0x1d')]();});_0x2c7c46[_0xf917('0x1e')](_0x5070ff);this[_0xf917('0x1f')]=function(_0xa48f6c,_0x3b44f0){var _0xa48f6c=_0xa48f6c||'',_0x3b44f0=typeof _0x3b44f0==_0xf917('0x10')?_0x3b44f0:new Function();_0x29300b={'tx':_0xa48f6c,'rx':'','cb':_0x3b44f0};_0x2c7c46[_0xf917('0x20')](_0xa48f6c+'\x0a');},this[_0xf917('0x21')]=function(){_0x2c7c46[_0xf917('0x1d')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0xf917('0x22')][_0xf917('0x23')]=function(_0x19d572){return this[_0xf917('0x1f')][_0xf917('0x24')](this,_0x19d572);};AGIChannel['prototype'][_0xf917('0x25')]=function(){return this[_0xf917('0x23')](_0xf917('0x26'));};AGIChannel[_0xf917('0x22')][_0xf917('0x27')]=function(_0x3bf471,_0x4cc68b,_0xf78314){_0x3bf471=_0x3bf471===undefined?_0xf917('0x28'):_0x3bf471;_0x4cc68b=_0x4cc68b===undefined?'5':_0x4cc68b;_0xf78314=_0xf78314===undefined?'1':_0xf78314;return this['sendRequest'](util[_0xf917('0x29')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x3bf471,_0x4cc68b*0x3e8,_0xf78314));};AGIChannel['prototype']['noop']=function(_0x3353c4){_0x3353c4=_0x3353c4||_0xf917('0x2a');return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x2b'),_0x3353c4));};AGIChannel['prototype'][_0xf917('0x2c')]=function(_0x28b4fa,_0x38e4e5){if(_[_0xf917('0x2d')](_0x38e4e5)){return this[_0xf917('0x23')](util[_0xf917('0x29')]('EXEC\x20%s\x20%s',_0x28b4fa,_0x38e4e5[_0xf917('0x2e')](',')));}return this['sendRequest'](util[_0xf917('0x29')](_0xf917('0x2f'),_0x28b4fa,_0x38e4e5));};AGIChannel['prototype'][_0xf917('0x30')]=function(_0x4fe92f){return this[_0xf917('0x23')](util['format']('SET\x20CONTEXT\x20%s',_0x4fe92f));};AGIChannel['prototype'][_0xf917('0x31')]=function(_0x522f1c){return this['sendRequest'](util['format'](_0xf917('0x32'),_0x522f1c));};AGIChannel[_0xf917('0x22')][_0xf917('0x33')]=function(_0x317232){return this[_0xf917('0x23')](util[_0xf917('0x29')]('SET\x20PRIORITY\x20%s',_0x317232));};AGIChannel['prototype'][_0xf917('0xc')]=function(){return this[_0xf917('0x23')]('HANGUP');};AGIChannel[_0xf917('0x22')][_0xf917('0x34')]=function(_0xbd36e1,_0x22b90e){var _0x208b8e=_[_0xf917('0x35')](_0x22b90e)||_[_0xf917('0x36')](_0x22b90e)?_0x22b90e['toString']():_0x22b90e;return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x37'),_0xbd36e1,_0x208b8e?_0x208b8e['toString']()[_0xf917('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xf917('0x22')][_0xf917('0x38')]=function(_0xb0f39f,_0x1a90f2){return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x39'),_0xb0f39f,_0x1a90f2));};AGIChannel[_0xf917('0x22')][_0xf917('0x3a')]=function(_0xe81a2a,_0x233f6c){return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x3b'),_0xe81a2a,_0x233f6c));};AGIChannel[_0xf917('0x22')][_0xf917('0x3c')]=function(_0x3ac58e,_0x1575f2){return this[_0xf917('0x23')](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x3ac58e,_0x1575f2));};AGIChannel[_0xf917('0x22')][_0xf917('0x3d')]=function(_0x2936fa,_0x1ba0a8,_0x1cc1e8){_0x1ba0a8=_0x1ba0a8||this[_0xf917('0x3e')];_0x1cc1e8=_0x1cc1e8||0x1;this[_0xf917('0x30')](_0x2936fa);this[_0xf917('0x31')](_0x1ba0a8);this[_0xf917('0x33')](_0x1cc1e8);return this['noop'](util[_0xf917('0x29')](_0xf917('0x3f'),_0x2936fa,_0x1ba0a8,_0x1cc1e8));};AGIChannel[_0xf917('0x22')][_0xf917('0x40')]=function(_0x2c162){return this['sendRequest'](util[_0xf917('0x29')](_0xf917('0x41'),_0x2c162));};AGIChannel[_0xf917('0x22')][_0xf917('0x42')]=function(_0x496098,_0x3f7733,_0x3f33ab,_0x3e570a,_0x31f6ee,_0x4640ec){_0x3f7733=_0x3f7733||_0xf917('0x43');_0x3f33ab=_0x3f33ab||'';_0x3e570a=_0x3e570a===undefined?-0x1:_0x3e570a==='-1'?-0x1:_0x3e570a*0x3e8;_0x31f6ee=_0x31f6ee===undefined?'':'s='+_0x31f6ee;_0x4640ec=_0x4640ec?_0xf917('0x44'):'';return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x45'),_0x496098,_0x3f7733,_0x3f33ab,_0x3e570a,_0x4640ec,_0x31f6ee));};AGIChannel[_0xf917('0x22')][_0xf917('0x46')]=function(_0x15c131,_0x6dfbb2){_0x6dfbb2=_0x6dfbb2||'';return this[_0xf917('0x23')](util[_0xf917('0x29')](_0xf917('0x47'),_0x15c131,_0x6dfbb2));};AGIChannel[_0xf917('0x22')][_0xf917('0x48')]=function(_0xcb4ccc){return this[_0xf917('0x2c')]('AGI',_0xcb4ccc);};AGIChannel[_0xf917('0x22')][_0xf917('0x49')]=function(_0x12b60c){return this['exec']('WAIT',_0x12b60c);};AGIChannel[_0xf917('0x22')][_0xf917('0x19')]=function(_0x5f2551,_0xca5b8d){this[_0xf917('0x4a')](util[_0xf917('0x29')](_0xf917('0x4b'),_0x5f2551['id'],_0x5f2551[_0xf917('0x4c')],_0xca5b8d));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf917('0x4d')]=AGIChannel;
\ No newline at end of file
index c92e4a8..f4510b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe041=['push','format','message','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.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x47365d,_0x4e292b){var _0x7cfe27=function(_0x3e7b0b){while(--_0x3e7b0b){_0x47365d['push'](_0x47365d['shift']());}};_0x7cfe27(++_0x4e292b);}(_0xe041,0x191));var _0x1e04=function(_0xacf6f0,_0x15c178){_0xacf6f0=_0xacf6f0-0x0;var _0x2c83b4=_0xe041[_0xacf6f0];return _0x2c83b4;};'use strict';var util=require(_0x1e04('0x0'));var error={'E_AGI_UNDEFINED':_0x1e04('0x1'),'E_AGI_ARGUMENT_PORT':_0x1e04('0x2'),'E_AGI_SERVER_ERROR':_0x1e04('0x3'),'E_AGI_SERVER_CLOSE':_0x1e04('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x1e04('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x1e04('0x6'),'E_AGI_SOCKET_ERROR':_0x1e04('0x7'),'E_AGI_SOCKET_CLOSE':_0x1e04('0x8'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x1e04('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x1e04('0xa'),'E_AGI_IVR_ENTRY':_0x1e04('0xb')};function AGIError(_0xd7e45c){var _0xd7e45c=_0xd7e45c||null,_0x12d85e=_0x12d85e||[],_0x32c3ac=0x1,_0x1fc029='';if(!error[_0xd7e45c]){_0xd7e45c=_0x1e04('0xc');}_0x12d85e[_0x1e04('0xd')](error[_0xd7e45c]);while(arguments[_0x32c3ac]){_0x12d85e[_0x1e04('0xd')](arguments[_0x32c3ac]);_0x32c3ac++;}_0x1fc029=util[_0x1e04('0xe')]['apply'](util,_0x12d85e);this[_0x1e04('0xf')]=_0x1fc029;this[_0x1e04('0x10')]=_0xd7e45c;}module[_0x1e04('0x11')]=AGIError;
\ No newline at end of file
+var _0x9d78=['message','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\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply'];(function(_0x186335,_0x389e69){var _0x335d80=function(_0xd9e18f){while(--_0xd9e18f){_0x186335['push'](_0x186335['shift']());}};_0x335d80(++_0x389e69);}(_0x9d78,0x135));var _0x89d7=function(_0x3396cd,_0x4047f0){_0x3396cd=_0x3396cd-0x0;var _0x2d6b4a=_0x9d78[_0x3396cd];return _0x2d6b4a;};'use strict';var util=require(_0x89d7('0x0'));var error={'E_AGI_UNDEFINED':_0x89d7('0x1'),'E_AGI_ARGUMENT_PORT':_0x89d7('0x2'),'E_AGI_SERVER_ERROR':_0x89d7('0x3'),'E_AGI_SERVER_CLOSE':_0x89d7('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x89d7('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x89d7('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x89d7('0x7'),'E_AGI_COMMAND_EMPTY':_0x89d7('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x89d7('0x9'),'E_AGI_IVR_ENTRY':_0x89d7('0xa')};function AGIError(_0x23ce12){var _0x23ce12=_0x23ce12||null,_0x43fa22=_0x43fa22||[],_0x51998d=0x1,_0x253484='';if(!error[_0x23ce12]){_0x23ce12=_0x89d7('0xb');}_0x43fa22[_0x89d7('0xc')](error[_0x23ce12]);while(arguments[_0x51998d]){_0x43fa22['push'](arguments[_0x51998d]);_0x51998d++;}_0x253484=util['format'][_0x89d7('0xd')](util,_0x43fa22);this[_0x89d7('0xe')]=_0x253484;this[_0x89d7('0xf')]=_0x23ce12;}module[_0x89d7('0x10')]=AGIError;
\ No newline at end of file
index 81c7f91..4f4523a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23a3=['addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','no\x20edge/s\x20available','condition','split','default','target','agicommand','vswitch','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','menu','getsecretdigits','vertices','edges','numberOfEdges','prototype','addVertex'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x23a3,0x131));var _0x323a=function(_0x40dc22,_0x21aa75){_0x40dc22=_0x40dc22-0x0;var _0x413c19=_0x23a3[_0x40dc22];return _0x413c19;};'use strict';var _=require('lodash');var logger=require('../../../config/logger')('agi');var verticesWithRetry=[_0x323a('0x0'),'getdigits',_0x323a('0x1')];var Graph=function(){this[_0x323a('0x2')]={};this[_0x323a('0x3')]={};this[_0x323a('0x4')]=0x0;};Graph[_0x323a('0x5')][_0x323a('0x6')]=function(_0x42593b){this[_0x323a('0x2')][_0x42593b['id']]=_0x42593b;this[_0x323a('0x3')][_0x42593b['id']]=[];};Graph['prototype'][_0x323a('0x7')]=function(_0x3544bd,_0x568996,_0x385a54){this[_0x323a('0x3')][_0x3544bd][_0x323a('0x8')]({'target':_0x568996,'condition':_0x385a54});this['numberOfEdges']+=0x1;};Graph[_0x323a('0x5')][_0x323a('0x9')]=function(){return _[_0x323a('0x9')](this[_0x323a('0x2')]);};Graph[_0x323a('0x5')][_0x323a('0xa')]=function(){return this[_0x323a('0x4')];};Graph[_0x323a('0x5')][_0x323a('0xb')]=function(_0x21ddac){return this[_0x323a('0x2')][_0x21ddac];};Graph[_0x323a('0x5')][_0x323a('0xc')]=function(_0x1ae315,_0x5c9b94){if(!this[_0x323a('0x2')][_0x1ae315]){return logger['info'](_0x323a('0xd'));}var _0x4ccd19=_0x5c9b94(this['vertices'][_0x1ae315]);if(!_0x4ccd19){return logger[_0x323a('0xe')]('stop\x20traverse');}if(this[_0x323a('0x3')][_0x1ae315]['length']===0x0){return logger[_0x323a('0xe')](_0x323a('0xf'));}for(var _0x54cda9=0x0,_0x271b85=[],_0x32674f=![];_0x54cda9<this['edges'][_0x1ae315]['length'];_0x54cda9+=0x1){if(this[_0x323a('0x3')][_0x1ae315][_0x54cda9][_0x323a('0x10')]){_0x271b85=this[_0x323a('0x3')][_0x1ae315][_0x54cda9][_0x323a('0x10')][_0x323a('0x11')](',');for(var _0x2cad9b=0x0;_0x2cad9b<_0x271b85['length'];_0x2cad9b+=0x1){if(this['vertices'][_0x1ae315]['agicommand']==='vswitch'&&_0x271b85[_0x2cad9b]==='-'){_0x32674f=this[_0x323a('0x3')][_0x1ae315][_0x54cda9]['target'];logger[_0x323a('0xe')](_0x323a('0x12'),_0x271b85[_0x2cad9b],this[_0x323a('0x3')][_0x1ae315][_0x54cda9][_0x323a('0x13')]);}else if(this['vertices'][_0x1ae315][_0x323a('0x14')]==='menu'&&_0x271b85[_0x2cad9b]==='i'){_0x32674f=this[_0x323a('0x3')][_0x1ae315][_0x54cda9][_0x323a('0x13')];logger[_0x323a('0xe')]('invalid',_0x271b85[_0x2cad9b],this[_0x323a('0x3')][_0x1ae315][_0x54cda9][_0x323a('0x13')]);}if(_0x271b85[_0x2cad9b]===_0x4ccd19){return this[_0x323a('0xc')](this[_0x323a('0x3')][_0x1ae315][_0x54cda9][_0x323a('0x13')],_0x5c9b94);}}}else{return this[_0x323a('0xc')](this['edges'][_0x1ae315][_0x54cda9][_0x323a('0x13')],_0x5c9b94);}}if(_0x271b85['length']){if(this[_0x323a('0x2')][_0x1ae315][_0x323a('0x14')]===_0x323a('0x15')){if(_0x32674f){return this[_0x323a('0xc')](_0x32674f,_0x5c9b94);}return logger[_0x323a('0xe')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0x323a('0x16')](verticesWithRetry,this[_0x323a('0x2')][_0x1ae315][_0x323a('0x14')])){if(_0x4ccd19==='-'){return logger[_0x323a('0xe')](_0x323a('0x17'));}if(_0x32674f&&_0x4ccd19!=='t'){return this['traverseBFS'](_0x32674f,_0x5c9b94);}return this[_0x323a('0xc')](_0x1ae315,_0x5c9b94);}return logger['info'](_0x323a('0x18'));}};module[_0x323a('0x19')]=Graph;
\ No newline at end of file
+var _0xd563=['prototype','addVertex','addEdge','push','numberOfEdges','size','relations','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','includes','condition\x20not\x20found','exports','lodash','../../../config/logger','menu','getdigits','getsecretdigits','vertices','edges'];(function(_0x21eb15,_0x34eaf7){var _0x3de130=function(_0x4ab108){while(--_0x4ab108){_0x21eb15['push'](_0x21eb15['shift']());}};_0x3de130(++_0x34eaf7);}(_0xd563,0x107));var _0x3d56=function(_0x46f97d,_0x653a62){_0x46f97d=_0x46f97d-0x0;var _0x5a29a4=_0xd563[_0x46f97d];return _0x5a29a4;};'use strict';var _=require(_0x3d56('0x0'));var logger=require(_0x3d56('0x1'))('agi');var verticesWithRetry=[_0x3d56('0x2'),_0x3d56('0x3'),_0x3d56('0x4')];var Graph=function(){this[_0x3d56('0x5')]={};this[_0x3d56('0x6')]={};this['numberOfEdges']=0x0;};Graph[_0x3d56('0x7')][_0x3d56('0x8')]=function(_0x406631){this[_0x3d56('0x5')][_0x406631['id']]=_0x406631;this['edges'][_0x406631['id']]=[];};Graph['prototype'][_0x3d56('0x9')]=function(_0x2c9650,_0x13494e,_0x17857a){this[_0x3d56('0x6')][_0x2c9650][_0x3d56('0xa')]({'target':_0x13494e,'condition':_0x17857a});this[_0x3d56('0xb')]+=0x1;};Graph[_0x3d56('0x7')]['size']=function(){return _[_0x3d56('0xc')](this[_0x3d56('0x5')]);};Graph['prototype'][_0x3d56('0xd')]=function(){return this[_0x3d56('0xb')];};Graph[_0x3d56('0x7')]['getVertex']=function(_0x534c30){return this[_0x3d56('0x5')][_0x534c30];};Graph[_0x3d56('0x7')][_0x3d56('0xe')]=function(_0x3cef1e,_0x5a5a27){if(!this[_0x3d56('0x5')][_0x3cef1e]){return logger['info'](_0x3d56('0xf'));}var _0x56cf87=_0x5a5a27(this['vertices'][_0x3cef1e]);if(!_0x56cf87){return logger[_0x3d56('0x10')](_0x3d56('0x11'));}if(this[_0x3d56('0x6')][_0x3cef1e][_0x3d56('0x12')]===0x0){return logger['info'](_0x3d56('0x13'));}for(var _0x504f1b=0x0,_0x1acc8f=[],_0x216d3d=![];_0x504f1b<this[_0x3d56('0x6')][_0x3cef1e]['length'];_0x504f1b+=0x1){if(this[_0x3d56('0x6')][_0x3cef1e][_0x504f1b]['condition']){_0x1acc8f=this['edges'][_0x3cef1e][_0x504f1b][_0x3d56('0x14')][_0x3d56('0x15')](',');for(var _0x37befc=0x0;_0x37befc<_0x1acc8f[_0x3d56('0x12')];_0x37befc+=0x1){if(this['vertices'][_0x3cef1e][_0x3d56('0x16')]===_0x3d56('0x17')&&_0x1acc8f[_0x37befc]==='-'){_0x216d3d=this['edges'][_0x3cef1e][_0x504f1b][_0x3d56('0x18')];logger[_0x3d56('0x10')]('default',_0x1acc8f[_0x37befc],this[_0x3d56('0x6')][_0x3cef1e][_0x504f1b][_0x3d56('0x18')]);}else if(this[_0x3d56('0x5')][_0x3cef1e][_0x3d56('0x16')]===_0x3d56('0x2')&&_0x1acc8f[_0x37befc]==='i'){_0x216d3d=this['edges'][_0x3cef1e][_0x504f1b]['target'];logger['info'](_0x3d56('0x19'),_0x1acc8f[_0x37befc],this[_0x3d56('0x6')][_0x3cef1e][_0x504f1b][_0x3d56('0x18')]);}if(_0x1acc8f[_0x37befc]===_0x56cf87){return this[_0x3d56('0xe')](this['edges'][_0x3cef1e][_0x504f1b]['target'],_0x5a5a27);}}}else{return this[_0x3d56('0xe')](this[_0x3d56('0x6')][_0x3cef1e][_0x504f1b][_0x3d56('0x18')],_0x5a5a27);}}if(_0x1acc8f[_0x3d56('0x12')]){if(this[_0x3d56('0x5')][_0x3cef1e][_0x3d56('0x16')]===_0x3d56('0x17')){if(_0x216d3d){return this[_0x3d56('0xe')](_0x216d3d,_0x5a5a27);}return logger[_0x3d56('0x10')](_0x3d56('0x1a'));}else if(_[_0x3d56('0x1b')](verticesWithRetry,this['vertices'][_0x3cef1e][_0x3d56('0x16')])){if(_0x56cf87==='-'){return logger[_0x3d56('0x10')]('max\x20retry\x20reach');}if(_0x216d3d&&_0x56cf87!=='t'){return this[_0x3d56('0xe')](_0x216d3d,_0x5a5a27);}return this[_0x3d56('0xe')](_0x3cef1e,_0x5a5a27);}return logger[_0x3d56('0x10')](_0x3d56('0x1c'));}};module[_0x3d56('0x1d')]=Graph;
\ No newline at end of file
index 0e64ebc..d527e43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b13=['../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','[%s]\x20%s','name','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','addVertex','omit','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','agi_','substring','debug','close','timeout','sync','production','start','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','agicommand\x20not\x20found','finally','traverseBFS','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]','./server','port','connection','xml2json','lodash','syncho','util','../../config/environment'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7b13,0x167));var _0x37b1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x7b13[_0x167cc1];return _0x10bc4b;};'use strict';var parser=require(_0x37b1('0x0'));var _=require(_0x37b1('0x1'));var syncho=require(_0x37b1('0x2'));var util=require(_0x37b1('0x3'));var moment=require('moment');var config=require(_0x37b1('0x4'));var logger=require(_0x37b1('0x5'))(_0x37b1('0x6'));var utilLicense=require(_0x37b1('0x7'));var rpc=require(_0x37b1('0x8'));var mailRpc=require(_0x37b1('0x9'));var Graph=require(_0x37b1('0xa'));var Vertices=require(_0x37b1('0xb'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x37b1('0x6')]=_[_0x37b1('0xc')](config[_0x37b1('0x6')],{'ip':_0x37b1('0xd'),'port':0x11dd});function connectionHandler(_0x5bfa61){process[_0x37b1('0xe')](function(){syncho(function(){try{setChannelVariables(_0x5bfa61);agiHandler(_0x5bfa61);}catch(_0x515ac2){logger[_0x37b1('0xf')](_0x515ac2[_0x37b1('0x10')]);}});});}function listeningHandler(){console[_0x37b1('0x11')](_0x37b1('0x12'),config[_0x37b1('0x6')]['port']);logger[_0x37b1('0x13')](util[_0x37b1('0x14')](_0x37b1('0x15'),config[_0x37b1('0x6')]['ip'],config[_0x37b1('0x6')]['port']));}function errorHandler(_0x595b6f){if(_0x595b6f&&_0x595b6f['name']&&_0x595b6f[_0x37b1('0x16')]){logger[_0x37b1('0xf')](util[_0x37b1('0x14')](_0x37b1('0x17'),_0x595b6f[_0x37b1('0x18')],_0x595b6f[_0x37b1('0x16')]));}else{logger[_0x37b1('0xf')](util['format'](_0x37b1('0x19'),_0x595b6f[_0x37b1('0x10')]));}}function closeHandler(){logger[_0x37b1('0x13')](util[_0x37b1('0x14')](_0x37b1('0x1a'),this[_0x37b1('0x1b')],this[_0x37b1('0x1c')],this[_0x37b1('0x1d')],this[_0x37b1('0x1e')],this[_0x37b1('0x1f')]));try{createSquareReport(this);}catch(_0x4295ce){logger[_0x37b1('0xf')](_0x4295ce['stack']);}}function timeoutHandler(){logger[_0x37b1('0x13')](util[_0x37b1('0x14')](_0x37b1('0x20'),this[_0x37b1('0x1b')],this[_0x37b1('0x1c')],this[_0x37b1('0x1d')],this['dnid'],this[_0x37b1('0x1f')]));}function hangupHandler(){logger[_0x37b1('0x13')](util[_0x37b1('0x14')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x37b1('0x1b')],this[_0x37b1('0x1c')],this[_0x37b1('0x1d')],this['dnid'],this[_0x37b1('0x1f')]));this[_0x37b1('0x21')]=!![];}function getRoot(_0x5e2806){return parser['toJson'](_0x5e2806,{'object':!![]})[_0x37b1('0x22')][_0x37b1('0x23')];}function addVertex(_0xdacb66,_0x14dfc8,_0x5e66d1){_0x14dfc8[_0x37b1('0x24')]=_0x5e66d1;if(_0x14dfc8[_0x37b1('0x25')]('retry')){_0x14dfc8[_0x37b1('0x26')]=parseInt(_0x14dfc8['retry'],0xa);}_0xdacb66[_0x37b1('0x27')](_[_0x37b1('0x28')](_0x14dfc8,'mxCell'));}function initGraph(_0x3234c1,_0x1bd557){var _0x5d513a=new Graph();for(var _0xec49bf in _0x3234c1){if(_0x3234c1[_0x37b1('0x25')](_0xec49bf)){if(_[_0x37b1('0x29')](_0x3234c1[_0xec49bf])){for(var _0x5298f1=0x0;_0x5298f1<_0x3234c1[_0xec49bf][_0x37b1('0x2a')];_0x5298f1+=0x1){addVertex(_0x5d513a,_0x3234c1[_0xec49bf][_0x5298f1],_0xec49bf);}}else{addVertex(_0x5d513a,_0x3234c1[_0xec49bf],_0xec49bf);}}}for(var _0x187f9d=0x0;_0x187f9d<_0x1bd557[_0x37b1('0x2a')];_0x187f9d+=0x1){if(_0x1bd557[_0x187f9d][_0x37b1('0x2b')]&&_0x1bd557[_0x187f9d][_0x37b1('0x2c')]){_0x5d513a[_0x37b1('0x2d')](_0x1bd557[_0x187f9d][_0x37b1('0x2b')],_0x1bd557[_0x187f9d][_0x37b1('0x2c')],_0x1bd557[_0x187f9d][_0x37b1('0x2e')]);}}return _0x5d513a;}function getSquareProject(_0xcd1df7,_0x31f331){rpc[_0x37b1('0x2f')](_0xcd1df7)[_0x37b1('0x30')](function(_0x2155e3){_0x31f331(null,_0x2155e3);})[_0x37b1('0x31')](function(_0x16d53b){_0x31f331(null,_0x16d53b);});}function createSquareReport(_0x1d8bb4,_0x5d6283){rpc[_0x37b1('0x32')](_0x1d8bb4)[_0x37b1('0x30')](function(_0x4971f8){if(_0x5d6283){_0x5d6283(null,_0x4971f8);}})['catch'](function(_0x50ed4f){if(_0x5d6283){_0x5d6283(null,_0x50ed4f);}});}function setChannelVariables(_0x159b47){for(var _0x5334d4 in _0x159b47){if(_0x159b47[_0x37b1('0x25')](_0x5334d4)){if(_0x5334d4['indexOf'](_0x37b1('0x33'))===0x0){_0x159b47[_0x5334d4[_0x37b1('0x34')](0x4)]=_0x159b47[_0x5334d4];delete _0x159b47[_0x5334d4];}}}}function getLogFromObject(_0x4328c1){return util['inspect'](_0x4328c1,{'showHidden':![],'depth':null});}function agiHandler(_0x3265d9){var _0x1a9054,_0x19a4a2,_0x5692d2,_0x1e024f,_0x3ac380;logger[_0x37b1('0x35')]('variables',JSON['stringify'](_0x3265d9,null,0x2));logger[_0x37b1('0x13')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3265d9[_0x37b1('0x1b')],_0x3265d9[_0x37b1('0x1c')],_0x3265d9['callerid'],_0x3265d9[_0x37b1('0x1e')],_0x3265d9['uniqueid']));_0x3265d9['on']('error',errorHandler);_0x3265d9['on'](_0x37b1('0x36'),closeHandler);_0x3265d9['on'](_0x37b1('0x37'),timeoutHandler);_0x3265d9[_0x37b1('0x21')]=![];_0x3265d9['on']('hangup',hangupHandler);var _0x49b315=getSquareProject[_0x37b1('0x38')](null,_0x3265d9['arg_1']);if(_0x49b315){if(_0x49b315[_0x37b1('0x39')]){_0x1a9054=getRoot(_0x49b315[_0x37b1('0x39')]);if(_0x1a9054&&_0x1a9054[_0x37b1('0x3a')]){logger['debug']('root',JSON[_0x37b1('0x3b')](_0x1a9054,null,0x2));_0x3265d9[_0x37b1('0x3c')]=moment()[_0x37b1('0x14')](_0x37b1('0x3d'));_0x19a4a2=initGraph(_[_0x37b1('0x28')](_0x1a9054,_0x37b1('0x3e')),_0x1a9054[_0x37b1('0x3e')]);_0x5692d2=new Vertices(_0x3265d9,rpc,mailRpc);logger[_0x37b1('0x13')](util['format'](_0x37b1('0x3f'),_0x3265d9['arg_1'],_0x3265d9[_0x37b1('0x1c')],_0x3265d9['callerid'],_0x3265d9[_0x37b1('0x1e')],_0x3265d9['uniqueid']));_0x19a4a2['traverseBFS'](_0x1a9054[_0x37b1('0x3a')]['id'],function(_0x402168){try{_0x402168=_0x5692d2['clear'](_0x402168);logger[_0x37b1('0x35')](_0x37b1('0x40'),JSON[_0x37b1('0x3b')](_0x402168,null,0x2));if(_0x402168[_0x37b1('0x24')]===_0x37b1('0x41')){logger[_0x37b1('0x13')](_0x37b1('0x42'));_0x3265d9[_0x37b1('0x43')]=_0x402168[_0x37b1('0x43')]||_0x3265d9[_0x37b1('0x43')];_0x3265d9[_0x37b1('0x44')]=_0x402168['extension'];_0x3265d9[_0x37b1('0x45')]=_0x402168['priority']?_0x402168['priority']-0x1:0x1;return null;}else if(_0x402168&&_0x5692d2[_0x402168[_0x37b1('0x24')]]){_0x3ac380=_0x5692d2[_0x402168[_0x37b1('0x24')]](_0x402168);logger[_0x37b1('0x13')](_0x37b1('0x46'),JSON[_0x37b1('0x3b')](_0x3ac380,null,0x2));if(_0x3ac380&&_0x3ac380[_0x37b1('0x47')]===AGI_CODE_SUCCESS&&_0x3ac380[_0x37b1('0x48')]!==AGI_RESULT_ERROR&&!_0x3265d9[_0x37b1('0x21')]){logger[_0x37b1('0x35')](_0x37b1('0x46'),getLogFromObject(_0x3ac380));return _['isUndefined'](_0x3ac380['result'])?null:_0x3ac380[_0x37b1('0x48')][_0x37b1('0x49')]();}else{logger[_0x37b1('0xf')]('response',getLogFromObject(_0x3ac380));return null;}}else{logger[_0x37b1('0xf')](_0x37b1('0x4a'));return null;}}catch(_0x24087a){logger[_0x37b1('0xf')](_0x24087a[_0x37b1('0x10')]);return null;}});if(_0x1a9054[_0x37b1('0x4b')]){logger[_0x37b1('0x13')](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3265d9[_0x37b1('0x1b')],_0x3265d9[_0x37b1('0x1c')],_0x3265d9[_0x37b1('0x1d')],_0x3265d9[_0x37b1('0x1e')],_0x3265d9['uniqueid']));_0x19a4a2[_0x37b1('0x4c')](_0x1a9054[_0x37b1('0x4b')]['id'],function(_0x388f88){try{_0x388f88=_0x5692d2[_0x37b1('0x4d')](_0x388f88);logger[_0x37b1('0x35')]('vertex',JSON[_0x37b1('0x3b')](_0x388f88,null,0x2));if(_0x388f88&&_0x5692d2[_0x388f88[_0x37b1('0x24')]]){_0x3ac380=_0x5692d2[_0x388f88[_0x37b1('0x24')]](_0x388f88);if(_0x3ac380){logger[_0x37b1('0x35')](_0x37b1('0x46'),getLogFromObject(_0x3ac380));return _['isUndefined'](_0x3ac380[_0x37b1('0x48')])?null:_0x3ac380[_0x37b1('0x48')][_0x37b1('0x49')]();}else{logger[_0x37b1('0xf')](_0x37b1('0x46'),getLogFromObject(_0x3ac380));return null;}}else{logger[_0x37b1('0xf')]('agicommand\x20not\x20found');return null;}}catch(_0xc9707b){logger['error'](_0xc9707b[_0x37b1('0x10')]);return null;}});}logger[_0x37b1('0x13')](util[_0x37b1('0x14')](_0x37b1('0x4e'),_0x3265d9[_0x37b1('0x1b')],_0x3265d9['calleridname'],_0x3265d9[_0x37b1('0x1d')],_0x3265d9[_0x37b1('0x1e')],_0x3265d9['uniqueid']));logger[_0x37b1('0x13')](util[_0x37b1('0x14')](_0x37b1('0x4f'),_0x3265d9['context'],_0x3265d9[_0x37b1('0x44')],parseInt(_0x3265d9[_0x37b1('0x45')],0xa)+0x1));_0x3265d9[_0x37b1('0x50')](_0x3265d9['context'],_0x3265d9['extension'],parseInt(_0x3265d9[_0x37b1('0x45')],0xa)+0x1);_0x3265d9[_0x37b1('0x36')]();}}else{logger[_0x37b1('0xf')](util[_0x37b1('0x14')](_0x37b1('0x51'),_0x3265d9[_0x37b1('0x1b')]));_0x3265d9[_0x37b1('0x50')](_0x3265d9[_0x37b1('0x43')],_0x3265d9['extension'],parseInt(_0x3265d9['priority'],0xa)+0x1);_0x3265d9['close']();}}else{logger[_0x37b1('0xf')](util['format'](_0x37b1('0x52'),_0x3265d9[_0x37b1('0x1b')]));_0x3265d9[_0x37b1('0x50')](_0x3265d9[_0x37b1('0x43')],_0x3265d9['extension'],parseInt(_0x3265d9[_0x37b1('0x45')],0xa)+0x1);_0x3265d9[_0x37b1('0x36')]();}}function main(){var _0x569a6e;return utilLicense[_0x37b1('0x53')]()[_0x37b1('0x30')](function(_0x5128b4){if(_0x5128b4){if(_0x5128b4[_0x37b1('0x54')]){if(_0x5128b4[_0x37b1('0x55')]&&_0x5128b4[_0x37b1('0x55')]>0x0){logger[_0x37b1('0x13')](util[_0x37b1('0x14')](_0x37b1('0x56'),_0x5128b4['callysquare']));_0x569a6e=_0x5128b4[_0x37b1('0x55')];}else{logger[_0x37b1('0x13')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x37b1('0x13')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x569a6e=-0x1;}}})[_0x37b1('0x31')](function(_0x28e858){logger[_0x37b1('0xf')](_0x37b1('0x57'),_0x28e858[_0x37b1('0x10')]);})[_0x37b1('0x4b')](function(){var _0x50cc17=require(_0x37b1('0x58'))(config[_0x37b1('0x6')][_0x37b1('0x59')],config[_0x37b1('0x6')]['ip'],_0x569a6e);_0x50cc17['on'](_0x37b1('0xf'),errorHandler);_0x50cc17['on']('listening',listeningHandler);_0x50cc17['on'](_0x37b1('0x5a'),connectionHandler);_0x50cc17['on'](_0x37b1('0x36'),closeHandler);});}main();
\ No newline at end of file
+var _0x7728=['isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','lodash','syncho','../../config/logger','agi','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','format','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','mxGraphModel','root','agicommand','hasOwnProperty','maxRetry','retry','omit','mxCell','isArray','length','target','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','substring','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','close','timeout','evtHangup','hangup','sync','production','start','debug','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','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response'];(function(_0x2fb8d3,_0x2ec153){var _0x278bec=function(_0x2bfd19){while(--_0x2bfd19){_0x2fb8d3['push'](_0x2fb8d3['shift']());}};_0x278bec(++_0x2ec153);}(_0x7728,0x1e4));var _0x8772=function(_0x4a232c,_0x4db76b){_0x4a232c=_0x4a232c-0x0;var _0xb5807f=_0x7728[_0x4a232c];return _0xb5807f;};'use strict';var parser=require(_0x8772('0x0'));var _=require(_0x8772('0x1'));var syncho=require(_0x8772('0x2'));var util=require('util');var moment=require('moment');var config=require('../../config/environment');var logger=require(_0x8772('0x3'))(_0x8772('0x4'));var utilLicense=require('../../config/license/util');var rpc=require(_0x8772('0x5'));var mailRpc=require(_0x8772('0x6'));var Graph=require('./graph');var Vertices=require(_0x8772('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x8772('0x4')]=_[_0x8772('0x8')](config[_0x8772('0x4')],{'ip':_0x8772('0x9'),'port':0x11dd});function connectionHandler(_0x16504d){process[_0x8772('0xa')](function(){syncho(function(){try{setChannelVariables(_0x16504d);agiHandler(_0x16504d);}catch(_0x1d5210){logger[_0x8772('0xb')](_0x1d5210[_0x8772('0xc')]);}});});}function listeningHandler(){console[_0x8772('0xd')](_0x8772('0xe'),config['agi']['port']);logger[_0x8772('0xf')](util['format'](_0x8772('0x10'),config[_0x8772('0x4')]['ip'],config['agi'][_0x8772('0x11')]));}function errorHandler(_0x42ad2b){if(_0x42ad2b&&_0x42ad2b[_0x8772('0x12')]&&_0x42ad2b[_0x8772('0x13')]){logger['error'](util[_0x8772('0x14')](_0x8772('0x15'),_0x42ad2b[_0x8772('0x12')],_0x42ad2b['message']));}else{logger[_0x8772('0xb')](util['format'](_0x8772('0x16'),_0x42ad2b[_0x8772('0xc')]));}}function closeHandler(){logger[_0x8772('0xf')](util[_0x8772('0x14')](_0x8772('0x17'),this[_0x8772('0x18')],this[_0x8772('0x19')],this[_0x8772('0x1a')],this['dnid'],this[_0x8772('0x1b')]));try{createSquareReport(this);}catch(_0x15d898){logger[_0x8772('0xb')](_0x15d898[_0x8772('0xc')]);}}function timeoutHandler(){logger[_0x8772('0xf')](util['format']('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x8772('0x19')],this[_0x8772('0x1a')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x8772('0xf')](util[_0x8772('0x14')](_0x8772('0x1c'),this[_0x8772('0x18')],this['calleridname'],this[_0x8772('0x1a')],this['dnid'],this[_0x8772('0x1b')]));this['evtHangup']=!![];}function getRoot(_0x4cf3d6){return parser['toJson'](_0x4cf3d6,{'object':!![]})[_0x8772('0x1d')][_0x8772('0x1e')];}function addVertex(_0x255b25,_0x5b6502,_0x414517){_0x5b6502[_0x8772('0x1f')]=_0x414517;if(_0x5b6502[_0x8772('0x20')]('retry')){_0x5b6502[_0x8772('0x21')]=parseInt(_0x5b6502[_0x8772('0x22')],0xa);}_0x255b25['addVertex'](_[_0x8772('0x23')](_0x5b6502,_0x8772('0x24')));}function initGraph(_0x1ed06c,_0x59681b){var _0xc70b28=new Graph();for(var _0x3b0371 in _0x1ed06c){if(_0x1ed06c['hasOwnProperty'](_0x3b0371)){if(_[_0x8772('0x25')](_0x1ed06c[_0x3b0371])){for(var _0x4821f6=0x0;_0x4821f6<_0x1ed06c[_0x3b0371][_0x8772('0x26')];_0x4821f6+=0x1){addVertex(_0xc70b28,_0x1ed06c[_0x3b0371][_0x4821f6],_0x3b0371);}}else{addVertex(_0xc70b28,_0x1ed06c[_0x3b0371],_0x3b0371);}}}for(var _0xe4908a=0x0;_0xe4908a<_0x59681b[_0x8772('0x26')];_0xe4908a+=0x1){if(_0x59681b[_0xe4908a]['source']&&_0x59681b[_0xe4908a][_0x8772('0x27')]){_0xc70b28['addEdge'](_0x59681b[_0xe4908a]['source'],_0x59681b[_0xe4908a]['target'],_0x59681b[_0xe4908a][_0x8772('0x28')]);}}return _0xc70b28;}function getSquareProject(_0x2cbfa4,_0x207fdc){rpc[_0x8772('0x29')](_0x2cbfa4)[_0x8772('0x2a')](function(_0x271d7e){_0x207fdc(null,_0x271d7e);})['catch'](function(_0x2b2548){_0x207fdc(null,_0x2b2548);});}function createSquareReport(_0xbe9a60,_0x170406){rpc[_0x8772('0x2b')](_0xbe9a60)[_0x8772('0x2a')](function(_0x100442){if(_0x170406){_0x170406(null,_0x100442);}})[_0x8772('0x2c')](function(_0x19be0d){if(_0x170406){_0x170406(null,_0x19be0d);}});}function setChannelVariables(_0x1e11b1){for(var _0x2512d7 in _0x1e11b1){if(_0x1e11b1['hasOwnProperty'](_0x2512d7)){if(_0x2512d7[_0x8772('0x2d')](_0x8772('0x2e'))===0x0){_0x1e11b1[_0x2512d7[_0x8772('0x2f')](0x4)]=_0x1e11b1[_0x2512d7];delete _0x1e11b1[_0x2512d7];}}}}function getLogFromObject(_0x3182d2){return util['inspect'](_0x3182d2,{'showHidden':![],'depth':null});}function agiHandler(_0x5628ca){var _0x21596c,_0x56e6ac,_0x25af21,_0x211989,_0x1f65c1;logger['debug'](_0x8772('0x30'),JSON[_0x8772('0x31')](_0x5628ca,null,0x2));logger[_0x8772('0xf')](util[_0x8772('0x14')](_0x8772('0x32'),_0x5628ca[_0x8772('0x18')],_0x5628ca[_0x8772('0x19')],_0x5628ca['callerid'],_0x5628ca[_0x8772('0x33')],_0x5628ca['uniqueid']));_0x5628ca['on'](_0x8772('0xb'),errorHandler);_0x5628ca['on'](_0x8772('0x34'),closeHandler);_0x5628ca['on'](_0x8772('0x35'),timeoutHandler);_0x5628ca[_0x8772('0x36')]=![];_0x5628ca['on'](_0x8772('0x37'),hangupHandler);var _0x43db15=getSquareProject[_0x8772('0x38')](null,_0x5628ca[_0x8772('0x18')]);if(_0x43db15){if(_0x43db15[_0x8772('0x39')]){_0x21596c=getRoot(_0x43db15[_0x8772('0x39')]);if(_0x21596c&&_0x21596c[_0x8772('0x3a')]){logger[_0x8772('0x3b')](_0x8772('0x1e'),JSON[_0x8772('0x31')](_0x21596c,null,0x2));_0x5628ca[_0x8772('0x3c')]=moment()[_0x8772('0x14')](_0x8772('0x3d'));_0x56e6ac=initGraph(_[_0x8772('0x23')](_0x21596c,_0x8772('0x24')),_0x21596c[_0x8772('0x24')]);_0x25af21=new Vertices(_0x5628ca,rpc,mailRpc);logger['info'](util['format'](_0x8772('0x3e'),_0x5628ca['arg_1'],_0x5628ca['calleridname'],_0x5628ca[_0x8772('0x1a')],_0x5628ca[_0x8772('0x33')],_0x5628ca[_0x8772('0x1b')]));_0x56e6ac[_0x8772('0x3f')](_0x21596c['start']['id'],function(_0x1c91c1){try{_0x1c91c1=_0x25af21[_0x8772('0x40')](_0x1c91c1);logger[_0x8772('0x3b')](_0x8772('0x41'),JSON[_0x8772('0x31')](_0x1c91c1,null,0x2));if(_0x1c91c1['agicommand']===_0x8772('0x42')){logger[_0x8772('0xf')](_0x8772('0x43'));_0x5628ca[_0x8772('0x44')]=_0x1c91c1[_0x8772('0x44')]||_0x5628ca[_0x8772('0x44')];_0x5628ca[_0x8772('0x45')]=_0x1c91c1['extension'];_0x5628ca[_0x8772('0x46')]=_0x1c91c1[_0x8772('0x46')]?_0x1c91c1[_0x8772('0x46')]-0x1:0x1;return null;}else if(_0x1c91c1&&_0x25af21[_0x1c91c1[_0x8772('0x1f')]]){_0x1f65c1=_0x25af21[_0x1c91c1[_0x8772('0x1f')]](_0x1c91c1);logger[_0x8772('0xf')]('response',JSON[_0x8772('0x31')](_0x1f65c1,null,0x2));if(_0x1f65c1&&_0x1f65c1[_0x8772('0x47')]===AGI_CODE_SUCCESS&&_0x1f65c1[_0x8772('0x48')]!==AGI_RESULT_ERROR&&!_0x5628ca[_0x8772('0x36')]){logger[_0x8772('0x3b')](_0x8772('0x49'),getLogFromObject(_0x1f65c1));return _[_0x8772('0x4a')](_0x1f65c1[_0x8772('0x48')])?null:_0x1f65c1['result'][_0x8772('0x4b')]();}else{logger[_0x8772('0xb')](_0x8772('0x49'),getLogFromObject(_0x1f65c1));return null;}}else{logger['error'](_0x8772('0x4c'));return null;}}catch(_0xc22d2e){logger[_0x8772('0xb')](_0xc22d2e[_0x8772('0xc')]);return null;}});if(_0x21596c[_0x8772('0x4d')]){logger[_0x8772('0xf')](util[_0x8772('0x14')](_0x8772('0x4e'),_0x5628ca['arg_1'],_0x5628ca[_0x8772('0x19')],_0x5628ca[_0x8772('0x1a')],_0x5628ca[_0x8772('0x33')],_0x5628ca[_0x8772('0x1b')]));_0x56e6ac[_0x8772('0x3f')](_0x21596c[_0x8772('0x4d')]['id'],function(_0x1cfecf){try{_0x1cfecf=_0x25af21[_0x8772('0x40')](_0x1cfecf);logger['debug'](_0x8772('0x41'),JSON[_0x8772('0x31')](_0x1cfecf,null,0x2));if(_0x1cfecf&&_0x25af21[_0x1cfecf['agicommand']]){_0x1f65c1=_0x25af21[_0x1cfecf[_0x8772('0x1f')]](_0x1cfecf);if(_0x1f65c1){logger[_0x8772('0x3b')](_0x8772('0x49'),getLogFromObject(_0x1f65c1));return _['isUndefined'](_0x1f65c1[_0x8772('0x48')])?null:_0x1f65c1[_0x8772('0x48')][_0x8772('0x4b')]();}else{logger[_0x8772('0xb')](_0x8772('0x49'),getLogFromObject(_0x1f65c1));return null;}}else{logger[_0x8772('0xb')](_0x8772('0x4c'));return null;}}catch(_0xd5d962){logger[_0x8772('0xb')](_0xd5d962[_0x8772('0xc')]);return null;}});}logger[_0x8772('0xf')](util['format'](_0x8772('0x4f'),_0x5628ca[_0x8772('0x18')],_0x5628ca['calleridname'],_0x5628ca[_0x8772('0x1a')],_0x5628ca[_0x8772('0x33')],_0x5628ca[_0x8772('0x1b')]));logger[_0x8772('0xf')](util[_0x8772('0x14')](_0x8772('0x50'),_0x5628ca[_0x8772('0x44')],_0x5628ca['extension'],parseInt(_0x5628ca['priority'],0xa)+0x1));_0x5628ca[_0x8772('0x51')](_0x5628ca[_0x8772('0x44')],_0x5628ca[_0x8772('0x45')],parseInt(_0x5628ca[_0x8772('0x46')],0xa)+0x1);_0x5628ca[_0x8772('0x34')]();}}else{logger[_0x8772('0xb')](util['format'](_0x8772('0x52'),_0x5628ca[_0x8772('0x18')]));_0x5628ca[_0x8772('0x51')](_0x5628ca[_0x8772('0x44')],_0x5628ca[_0x8772('0x45')],parseInt(_0x5628ca[_0x8772('0x46')],0xa)+0x1);_0x5628ca[_0x8772('0x34')]();}}else{logger[_0x8772('0xb')](util[_0x8772('0x14')](_0x8772('0x53'),_0x5628ca[_0x8772('0x18')]));_0x5628ca[_0x8772('0x51')](_0x5628ca[_0x8772('0x44')],_0x5628ca['extension'],parseInt(_0x5628ca[_0x8772('0x46')],0xa)+0x1);_0x5628ca[_0x8772('0x34')]();}}function main(){var _0x2e11e4;return utilLicense[_0x8772('0x54')]()[_0x8772('0x2a')](function(_0x5ac02a){if(_0x5ac02a){if(_0x5ac02a[_0x8772('0x55')]){if(_0x5ac02a[_0x8772('0x56')]&&_0x5ac02a[_0x8772('0x56')]>0x0){logger['info'](util[_0x8772('0x14')](_0x8772('0x57'),_0x5ac02a[_0x8772('0x56')]));_0x2e11e4=_0x5ac02a['callysquare'];}else{logger[_0x8772('0xf')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x8772('0xf')](_0x8772('0x58'));_0x2e11e4=-0x1;}}})[_0x8772('0x2c')](function(_0x198b31){logger[_0x8772('0xb')](_0x8772('0x59'),_0x198b31[_0x8772('0xc')]);})[_0x8772('0x4d')](function(){var _0x174d89=require(_0x8772('0x5a'))(config[_0x8772('0x4')]['port'],config[_0x8772('0x4')]['ip'],_0x2e11e4);_0x174d89['on']('error',errorHandler);_0x174d89['on'](_0x8772('0x5b'),listeningHandler);_0x174d89['on'](_0x8772('0x5c'),connectionHandler);_0x174d89['on']('close',closeHandler);});}main();
\ No newline at end of file
index 940c1d0..3623e73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd709=['http','then','error','message','catch','sendMailMessage','SendMail','jayson/promise','client'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd709,0x103));var _0x9d70=function(_0x4797b2,_0x1d8913){_0x4797b2=_0x4797b2-0x0;var _0x2599bc=_0xd709[_0x4797b2];return _0x2599bc;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x9d70('0x0'));var client=jayson[_0x9d70('0x1')][_0x9d70('0x2')]({'port':0x232b});function request(_0x5dcef7,_0x3f49a0){return new BPromise(function(_0x17d332,_0x39c53f){return client['request'](_0x5dcef7,_0x3f49a0)[_0x9d70('0x3')](function(_0x338ebc){if(_0x338ebc[_0x9d70('0x4')]){return _0x39c53f(_0x338ebc[_0x9d70('0x4')][_0x9d70('0x5')]);}else{return _0x17d332(_0x338ebc['result']);}})[_0x9d70('0x6')](function(_0x3cf5dc){return _0x39c53f(_0x3cf5dc);});});}exports[_0x9d70('0x7')]=function(_0x306206,_0x5d8afa){return request(_0x9d70('0x8'),{'account':_0x306206,'message':_0x5d8afa});};
\ No newline at end of file
+var _0xf646=['result','catch','sendMailMessage','bluebird','jayson/promise','client','then','error','message'];(function(_0x3d3041,_0x54f5fd){var _0x2e7ef5=function(_0x5037b5){while(--_0x5037b5){_0x3d3041['push'](_0x3d3041['shift']());}};_0x2e7ef5(++_0x54f5fd);}(_0xf646,0x1e9));var _0x6f64=function(_0x314208,_0x5f4be3){_0x314208=_0x314208-0x0;var _0x588fde=_0xf646[_0x314208];return _0x588fde;};'use strict';var BPromise=require(_0x6f64('0x0'));var jayson=require(_0x6f64('0x1'));var client=jayson[_0x6f64('0x2')]['http']({'port':0x232b});function request(_0x2a5a99,_0x416ba4){return new BPromise(function(_0x5d6f17,_0x265068){return client['request'](_0x2a5a99,_0x416ba4)[_0x6f64('0x3')](function(_0xdbc41f){if(_0xdbc41f['error']){return _0x265068(_0xdbc41f[_0x6f64('0x4')][_0x6f64('0x5')]);}else{return _0x5d6f17(_0xdbc41f[_0x6f64('0x6')]);}})[_0x6f64('0x7')](function(_0x5e022e){return _0x265068(_0x5e022e);});});}exports[_0x6f64('0x8')]=function(_0x7613b5,_0x4b8382){return request('SendMail',{'account':_0x7613b5,'message':_0x4b8382});};
\ No newline at end of file
index 44453f9..94a564f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5566=['headers','line','exports','util','Transform','call','_inBody','inherits','_transform','toString','_localBuffer','indexOf','substring','length','slice','trim','emit'];(function(_0x3f85af,_0x319e55){var _0x1c4626=function(_0x12009c){while(--_0x12009c){_0x3f85af['push'](_0x3f85af['shift']());}};_0x1c4626(++_0x319e55);}(_0x5566,0x179));var _0x6556=function(_0x42ff73,_0x3ef2a1){_0x42ff73=_0x42ff73-0x0;var _0x11d984=_0x5566[_0x42ff73];return _0x11d984;};'use strict';var util=require(_0x6556('0x0'));var Transform=require('stream')[_0x6556('0x1')];function AGIReply(_0x2231d3){Transform[_0x6556('0x2')](this,_0x2231d3);this['_localBuffer']='';this[_0x6556('0x3')]=![];}util[_0x6556('0x4')](AGIReply,Transform);AGIReply['prototype'][_0x6556('0x5')]=function(_0x220753,_0x4a397d,_0x379718){var _0xc7ab6='\x0a',_0xfd376a=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x55c99d=-0x1,_0x2d5063=-0x1,_0x35d991='',_0x51659b=0x0,_0x45bed5='',_0xb90c8f='';this['_localBuffer']+=_0x220753[_0x6556('0x6')]();_0x45bed5=this[_0x6556('0x7')];if(!this[_0x6556('0x3')]){_0x51659b=0x0;while(_0xfd376a[_0x51659b]){while((_0x2d5063=_0x45bed5[_0x6556('0x8')](_0xfd376a[_0x51659b]))!=-0x1){_0x35d991=_0xfd376a[_0x51659b];_0xb90c8f=_0x45bed5[_0x6556('0x9')](0x0,_0x2d5063);_0x45bed5=_0x45bed5[_0x6556('0x9')](_0x2d5063+_0x35d991[_0x6556('0xa')]);var _0x412e21=_0xb90c8f['split'](_0xc7ab6),_0x1170ac=0x0,_0x22fb7b={},_0x22a42f='',_0x4bf2d2='',_0x1585f3=-0x1;while(_0x412e21[_0x1170ac]){_0x1585f3=_0x412e21[_0x1170ac][_0x6556('0x8')](':');if(_0x1585f3!=-0x1){_0x22a42f=_0x412e21[_0x1170ac][_0x6556('0xb')](0x0,_0x1585f3)[_0x6556('0xc')]();_0x4bf2d2=_0x412e21[_0x1170ac][_0x6556('0xb')](_0x1585f3+0x1)[_0x6556('0xc')]();if(_0x22a42f['length']>0x0){_0x22fb7b[_0x22a42f]=_0x4bf2d2;}}else{}_0x1170ac++;}this[_0x6556('0xd')](_0x6556('0xe'),_0x22fb7b);this[_0x6556('0x3')]=!![];}_0x51659b++;}this['_localBuffer']=_0x45bed5;}else{while((_0x55c99d=_0x45bed5['indexOf'](_0xc7ab6))!=-0x1){_0xb90c8f=_0x45bed5[_0x6556('0x9')](0x0,_0x55c99d);this[_0x6556('0xd')](_0x6556('0xf'),_0xb90c8f);_0x45bed5=_0x45bed5[_0x6556('0x9')](_0x55c99d+_0xc7ab6[_0x6556('0xa')]);}this[_0x6556('0x7')]=_0x45bed5;}_0x379718();};module[_0x6556('0x10')]=AGIReply;
\ No newline at end of file
+var _0x01e4=['_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','_localBuffer','indexOf','substring','length','slice','trim','emit','line','Transform','call'];(function(_0x5eb409,_0x29d7bf){var _0x37d59b=function(_0x4426a5){while(--_0x4426a5){_0x5eb409['push'](_0x5eb409['shift']());}};_0x37d59b(++_0x29d7bf);}(_0x01e4,0xc2));var _0x401e=function(_0x174e9e,_0x4ece54){_0x174e9e=_0x174e9e-0x0;var _0x524f3f=_0x01e4[_0x174e9e];return _0x524f3f;};'use strict';var util=require('util');var Transform=require('stream')[_0x401e('0x0')];function AGIReply(_0x182943){Transform[_0x401e('0x1')](this,_0x182943);this['_localBuffer']='';this[_0x401e('0x2')]=![];}util[_0x401e('0x3')](AGIReply,Transform);AGIReply[_0x401e('0x4')]['_transform']=function(_0x34684f,_0x23bcba,_0x5ebe33){var _0x3646da='\x0a',_0x9e93fc=['\x0a\x0a',_0x401e('0x5')],_0x53dd09=-0x1,_0x5ed374=-0x1,_0x466098='',_0x248852=0x0,_0x275564='',_0x2d4ba7='';this['_localBuffer']+=_0x34684f['toString']();_0x275564=this[_0x401e('0x6')];if(!this[_0x401e('0x2')]){_0x248852=0x0;while(_0x9e93fc[_0x248852]){while((_0x5ed374=_0x275564[_0x401e('0x7')](_0x9e93fc[_0x248852]))!=-0x1){_0x466098=_0x9e93fc[_0x248852];_0x2d4ba7=_0x275564[_0x401e('0x8')](0x0,_0x5ed374);_0x275564=_0x275564[_0x401e('0x8')](_0x5ed374+_0x466098[_0x401e('0x9')]);var _0x25bd3b=_0x2d4ba7['split'](_0x3646da),_0x1c3915=0x0,_0x648d1c={},_0x29b3b1='',_0x44925f='',_0x435778=-0x1;while(_0x25bd3b[_0x1c3915]){_0x435778=_0x25bd3b[_0x1c3915][_0x401e('0x7')](':');if(_0x435778!=-0x1){_0x29b3b1=_0x25bd3b[_0x1c3915][_0x401e('0xa')](0x0,_0x435778)[_0x401e('0xb')]();_0x44925f=_0x25bd3b[_0x1c3915][_0x401e('0xa')](_0x435778+0x1)['trim']();if(_0x29b3b1['length']>0x0){_0x648d1c[_0x29b3b1]=_0x44925f;}}else{}_0x1c3915++;}this[_0x401e('0xc')]('headers',_0x648d1c);this[_0x401e('0x2')]=!![];}_0x248852++;}this[_0x401e('0x6')]=_0x275564;}else{while((_0x53dd09=_0x275564[_0x401e('0x7')](_0x3646da))!=-0x1){_0x2d4ba7=_0x275564['substring'](0x0,_0x53dd09);this[_0x401e('0xc')](_0x401e('0xd'),_0x2d4ba7);_0x275564=_0x275564[_0x401e('0x8')](_0x53dd09+_0x3646da['length']);}this[_0x401e('0x6')]=_0x275564;}_0x5ebe33();};module['exports']=AGIReply;
\ No newline at end of file
index 3eeb683..cb720f9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd55=['arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','ShowPause','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','jayson/promise','http','request','error','message','result','catch','production','Smtp','name','email','getSquareProjectById','ShowSquareProject','ShowVoiceQueue','ShowSquareOdbc','dsn','getUserById','getTrunkById','getSoundById','ShowSound','save_name','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','arg_1'];(function(_0x5db142,_0xa0ee32){var _0x10ba09=function(_0x310964){while(--_0x310964){_0x5db142['push'](_0x5db142['shift']());}};_0x10ba09(++_0xa0ee32);}(_0xcd55,0x1de));var _0x5cd5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xcd55[_0x2be8c2];return _0x97f531;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require('lodash');var util=require('util');var jayson=require(_0x5cd5('0x0'));var client=jayson['client'][_0x5cd5('0x1')]({'port':0x2329});function request(_0x5a3296,_0x3c9cd4){return new BPromise(function(_0x57fc0d,_0x4074ca){return client[_0x5cd5('0x2')](_0x5a3296,_0x3c9cd4)['then'](function(_0xf5f5b1){if(_0xf5f5b1[_0x5cd5('0x3')]){return _0x4074ca(_0xf5f5b1[_0x5cd5('0x3')][_0x5cd5('0x4')]);}else{return _0x57fc0d(_0xf5f5b1[_0x5cd5('0x5')]);}})[_0x5cd5('0x6')](function(_0x1db19c){return _0x4074ca(_0x1db19c);});});}exports['getSquareProject']=function(_0x27ef62){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x27ef62},'attributes':[_0x5cd5('0x7')]}});};exports['getMailAccountById']=function(_0x4b8d3c){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x4b8d3c},'include':[{'model':'MailServerOut','as':_0x5cd5('0x8')}],'attributes':['id',_0x5cd5('0x9'),_0x5cd5('0xa')]}});};exports[_0x5cd5('0xb')]=function(_0x3b9eb1){return request(_0x5cd5('0xc'),{'options':{'where':{'id':_0x3b9eb1},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x518152){return request(_0x5cd5('0xd'),{'options':{'where':{'id':_0x518152},'attributes':[_0x5cd5('0x9')]}});};exports['getVariableById']=function(_0xad528){return request('ShowVariable',{'options':{'where':{'id':_0xad528},'attributes':[_0x5cd5('0x9')]}});};exports['getSquareOdbcById']=function(_0xfc044b){return request(_0x5cd5('0xe'),{'options':{'where':{'id':_0xfc044b},'attributes':[_0x5cd5('0xf')]}});};exports[_0x5cd5('0x10')]=function(_0x32bec7){return request('ShowUser',{'options':{'where':{'id':_0x32bec7},'attributes':[_0x5cd5('0x9')]}});};exports[_0x5cd5('0x11')]=function(_0x52c37a){return request('ShowTrunk',{'options':{'where':{'id':_0x52c37a},'attributes':['name']}});};exports[_0x5cd5('0x12')]=function(_0x54d6c7){return request(_0x5cd5('0x13'),{'options':{'where':{'id':_0x54d6c7},'attributes':[_0x5cd5('0x14')]}});};exports['getIntervalById']=function(_0x161f7e){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x161f7e},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0x5cd5('0x15')]=function(_0x2ae554){return request(_0x5cd5('0x16'),{'options':{'where':{'id':_0x2ae554},'attributes':['id','name']}});};exports['createSmsMessage']=function(_0x16c0ad){return request(_0x5cd5('0x17'),{'body':_0x16c0ad});};exports[_0x5cd5('0x18')]=function(_0x4090fb){return request(_0x5cd5('0x19'),{'body':_0x4090fb});};exports[_0x5cd5('0x1a')]=function(_0x4591aa){return request('CreateSquareReport',{'body':_['merge'](_0x4591aa,{'project_name':_0x4591aa[_0x5cd5('0x1b')],'prev_project_name':_0x4591aa[_0x5cd5('0x1c')]||'','is_subproject':_0x4591aa['arg_2']?!![]:![],'leaveAt':moment()[_0x5cd5('0x1d')](_0x5cd5('0x1e'))})});};exports[_0x5cd5('0x1f')]=function(_0x2423e1){return request(_0x5cd5('0x20'),{'body':_0x2423e1});};exports['createSquareMessage']=function(_0x2c24a9){return request(_0x5cd5('0x21'),{'body':_0x2c24a9});};exports[_0x5cd5('0x22')]=function(_0x2002bf){return request(_0x5cd5('0x23'),{'options':{'raw':![],'where':{'phone':_0x2002bf['phone'],'ListId':_0x2002bf[_0x5cd5('0x24')]}}})[_0x5cd5('0x25')](function(_0x35ac5e){if(_0x35ac5e){return _0x35ac5e;}return request(_0x5cd5('0x26'),{'body':_0x2002bf});});};exports['getPauseById']=function(_0x343d09){return request(_0x5cd5('0x27'),{'options':{'where':{'id':_0x343d09},'attributes':[_0x5cd5('0x9')]}});};exports['agentLogin']=function(_0x59dd40,_0x441a5f){return request(_0x5cd5('0x28'),{'body':{'interface':_0x441a5f},'options':{'where':_0x59dd40}});};exports[_0x5cd5('0x29')]=function(_0x4167a9,_0x33784f,_0x5efba1){return request(_0x5cd5('0x2a'),{'body':{'type':_0x33784f,'uniqueid':_0x5efba1},'options':{'where':_0x4167a9}});};exports['agentUnpause']=function(_0x3536c1){return request(_0x5cd5('0x2b'),{'body':{},'options':{'where':_0x3536c1}});};exports[_0x5cd5('0x2c')]=function(_0x50c708){return request(_0x5cd5('0x2d'),{'body':{},'options':{'where':_0x50c708}});};
\ No newline at end of file
+var _0x4fb2=['message','result','getSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','ShowSquareProject','ShowVoiceQueue','getVariableById','getSquareOdbcById','dsn','ShowUser','getTrunkById','getSoundById','ShowSound','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','client','request','then','error'];(function(_0x50e4f5,_0x33e06b){var _0x258bbc=function(_0x54f902){while(--_0x54f902){_0x50e4f5['push'](_0x50e4f5['shift']());}};_0x258bbc(++_0x33e06b);}(_0x4fb2,0x149));var _0x24fb=function(_0x58722c,_0x4f3eca){_0x58722c=_0x58722c-0x0;var _0x7fab8e=_0x4fb2[_0x58722c];return _0x7fab8e;};'use strict';var BPromise=require(_0x24fb('0x0'));var moment=require(_0x24fb('0x1'));var _=require(_0x24fb('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x24fb('0x3')]['http']({'port':0x2329});function request(_0x3a5301,_0x1fa159){return new BPromise(function(_0x3b530c,_0x35315b){return client[_0x24fb('0x4')](_0x3a5301,_0x1fa159)[_0x24fb('0x5')](function(_0x33d0bb){if(_0x33d0bb['error']){return _0x35315b(_0x33d0bb[_0x24fb('0x6')][_0x24fb('0x7')]);}else{return _0x3b530c(_0x33d0bb[_0x24fb('0x8')]);}})['catch'](function(_0x17f8b7){return _0x35315b(_0x17f8b7);});});}exports[_0x24fb('0x9')]=function(_0x2513e9){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x2513e9},'attributes':[_0x24fb('0xa')]}});};exports[_0x24fb('0xb')]=function(_0x21ecbb){return request(_0x24fb('0xc'),{'options':{'raw':![],'where':{'id':_0x21ecbb},'include':[{'model':'MailServerOut','as':_0x24fb('0xd')}],'attributes':['id',_0x24fb('0xe'),_0x24fb('0xf')]}});};exports[_0x24fb('0x10')]=function(_0x358cf9){return request(_0x24fb('0x11'),{'options':{'where':{'id':_0x358cf9},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x179315){return request(_0x24fb('0x12'),{'options':{'where':{'id':_0x179315},'attributes':[_0x24fb('0xe')]}});};exports[_0x24fb('0x13')]=function(_0x2a0cde){return request('ShowVariable',{'options':{'where':{'id':_0x2a0cde},'attributes':[_0x24fb('0xe')]}});};exports[_0x24fb('0x14')]=function(_0x130129){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x130129},'attributes':[_0x24fb('0x15')]}});};exports['getUserById']=function(_0xcb8302){return request(_0x24fb('0x16'),{'options':{'where':{'id':_0xcb8302},'attributes':[_0x24fb('0xe')]}});};exports[_0x24fb('0x17')]=function(_0x47a7ce){return request('ShowTrunk',{'options':{'where':{'id':_0x47a7ce},'attributes':['name']}});};exports[_0x24fb('0x18')]=function(_0x29ef2a){return request(_0x24fb('0x19'),{'options':{'where':{'id':_0x29ef2a},'attributes':[_0x24fb('0x1a')]}});};exports[_0x24fb('0x1b')]=function(_0x7658df){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x7658df},'include':[{'model':_0x24fb('0x1c'),'as':_0x24fb('0x1d')}]}});};exports[_0x24fb('0x1e')]=function(_0x5953d0){return request(_0x24fb('0x1f'),{'options':{'where':{'id':_0x5953d0},'attributes':['id','name']}});};exports[_0x24fb('0x20')]=function(_0x2bc39d){return request(_0x24fb('0x21'),{'body':_0x2bc39d});};exports[_0x24fb('0x22')]=function(_0x19a496){return request(_0x24fb('0x23'),{'body':_0x19a496});};exports['createSquareReport']=function(_0x6ff141){return request('CreateSquareReport',{'body':_[_0x24fb('0x24')](_0x6ff141,{'project_name':_0x6ff141[_0x24fb('0x25')],'prev_project_name':_0x6ff141[_0x24fb('0x26')]||'','is_subproject':_0x6ff141[_0x24fb('0x26')]?!![]:![],'leaveAt':moment()['format'](_0x24fb('0x27'))})});};exports[_0x24fb('0x28')]=function(_0x3276dc){return request('CreateSquareRecording',{'body':_0x3276dc});};exports['createSquareMessage']=function(_0x31b359){return request(_0x24fb('0x29'),{'body':_0x31b359});};exports[_0x24fb('0x2a')]=function(_0x228a90){return request(_0x24fb('0x2b'),{'options':{'raw':![],'where':{'phone':_0x228a90[_0x24fb('0x2c')],'ListId':_0x228a90[_0x24fb('0x2d')]}}})[_0x24fb('0x5')](function(_0x3556c5){if(_0x3556c5){return _0x3556c5;}return request(_0x24fb('0x2e'),{'body':_0x228a90});});};exports[_0x24fb('0x2f')]=function(_0x5d3523){return request(_0x24fb('0x30'),{'options':{'where':{'id':_0x5d3523},'attributes':[_0x24fb('0xe')]}});};exports['agentLogin']=function(_0x1e5409,_0x587e60){return request(_0x24fb('0x31'),{'body':{'interface':_0x587e60},'options':{'where':_0x1e5409}});};exports[_0x24fb('0x32')]=function(_0x4ca4bd,_0x7720a5,_0x2ca857){return request(_0x24fb('0x33'),{'body':{'type':_0x7720a5,'uniqueid':_0x2ca857},'options':{'where':_0x4ca4bd}});};exports[_0x24fb('0x34')]=function(_0x1771d0){return request(_0x24fb('0x35'),{'body':{},'options':{'where':_0x1771d0}});};exports[_0x24fb('0x36')]=function(_0x2ffbf9){return request(_0x24fb('0x37'),{'body':{},'options':{'where':_0x2ffbf9}});};
\ No newline at end of file
index 34051f3..a395975 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefce=['./lex'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xefce,0x1e8));var _0xeefc=function(_0x570496,_0x26a150){_0x570496=_0x570496-0x0;var _0x1d4204=_0xefce[_0x570496];return _0x1d4204;};var polly=require('./polly');var lex=require(_0xeefc('0x0'));module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x5bd7=['./lex','exports'];(function(_0x1d147b,_0x3eccc3){var _0x2ff52d=function(_0x46056b){while(--_0x46056b){_0x1d147b['push'](_0x1d147b['shift']());}};_0x2ff52d(++_0x3eccc3);}(_0x5bd7,0x12a));var _0x75bd=function(_0xd37e85,_0x439d6f){_0xd37e85=_0xd37e85-0x0;var _0x12a91b=_0x5bd7[_0xd37e85];return _0x12a91b;};var polly=require('./polly');var lex=require(_0x75bd('0x0'));module[_0x75bd('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
index fada295..7fe5b9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa571=['exports','./lib/api'];(function(_0x485f53,_0x104081){var _0x480f1e=function(_0x2d61d2){while(--_0x2d61d2){_0x485f53['push'](_0x485f53['shift']());}};_0x480f1e(++_0x104081);}(_0xa571,0x107));var _0x1a57=function(_0x579d4c,_0x14f152){_0x579d4c=_0x579d4c-0x0;var _0xaee5f5=_0xa571[_0x579d4c];return _0xaee5f5;};'use strict';var lex=require(_0x1a57('0x0'));module[_0x1a57('0x1')]=function(_0x206f1b,_0x1067d9,_0x48485e,_0x1a071f,_0x2eebaa,_0x4d5f7a){return lex(_0x206f1b,_0x1067d9,_0x48485e,_0x1a071f,_0x2eebaa,_0x4d5f7a);};
\ No newline at end of file
+var _0x96cc=['./lib/api'];(function(_0x56267b,_0x45e859){var _0x286b65=function(_0x10d097){while(--_0x10d097){_0x56267b['push'](_0x56267b['shift']());}};_0x286b65(++_0x45e859);}(_0x96cc,0x16c));var _0xc96c=function(_0x585e84,_0x1d8489){_0x585e84=_0x585e84-0x0;var _0x39f3c4=_0x96cc[_0x585e84];return _0x39f3c4;};'use strict';var lex=require(_0xc96c('0x0'));module['exports']=function(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701){return lex(_0x15025f,_0x5f11f2,_0x30bf8a,_0x3e7a95,_0x107043,_0x421701);};
\ No newline at end of file
index 56a171f..d438fe4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x265619,_0x209019){var _0x20eb39=function(_0x253581){while(--_0x253581){_0x265619['push'](_0x265619['shift']());}};_0x20eb39(++_0x209019);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
+var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x48b22a,_0x5d8b8c){var _0x18b0a9=function(_0x4b0a4c){while(--_0x4b0a4c){_0x48b22a['push'](_0x48b22a['shift']());}};_0x18b0a9(++_0x5d8b8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);};
\ No newline at end of file
index 161596a..cf28420 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fe4=['exports'];(function(_0x146b96,_0x43e568){var _0x224691=function(_0xe883cb){while(--_0xe883cb){_0x146b96['push'](_0x146b96['shift']());}};_0x224691(++_0x43e568);}(_0x2fe4,0x199));var _0x42fe=function(_0xc87f7d,_0x2ea9ad){_0xc87f7d=_0xc87f7d-0x0;var _0x347854=_0x2fe4[_0xc87f7d];return _0x347854;};'use strict';var polly=require('./lib/api');module[_0x42fe('0x0')]=function(_0x57cb61,_0x468475,_0x1dc60a,_0x37d219,_0x2bb49f,_0x1a5bac,_0x475a7e){return polly(_0x57cb61,_0x468475,_0x1dc60a,_0x37d219,_0x2bb49f,_0x1a5bac,_0x475a7e);};
\ No newline at end of file
+var _0x09dd=['exports'];(function(_0x36a4c7,_0x5ba0ba){var _0x52d62b=function(_0xd2655d){while(--_0xd2655d){_0x36a4c7['push'](_0x36a4c7['shift']());}};_0x52d62b(++_0x5ba0ba);}(_0x09dd,0x177));var _0xd09d=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x09dd[_0x6131cd];return _0x47e916;};'use strict';var polly=require('./lib/api');module[_0xd09d('0x0')]=function(_0x2324cf,_0x8889,_0x4f6943,_0x4ce946,_0x3f4a48,_0x5c93a8,_0x12b0d1){return polly(_0x2324cf,_0x8889,_0x4f6943,_0x4ce946,_0x3f4a48,_0x5c93a8,_0x12b0d1);};
\ No newline at end of file
index 3bf181d..0e02f6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1915=['randomstring','aws-sdk','AudioStream','writeFile','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path'];(function(_0x401216,_0x54c510){var _0x17bf57=function(_0xb0049c){while(--_0xb0049c){_0x401216['push'](_0x401216['shift']());}};_0x17bf57(++_0x54c510);}(_0x1915,0x153));var _0x5191=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1915[_0x19950b];return _0x3c6b41;};'use strict';var fs=require('fs');var path=require(_0x5191('0x0'));var BPromise=require('bluebird');var rs=require(_0x5191('0x1'));var AWS=require(_0x5191('0x2'));function pollyResult(_0x4e87bf,_0x2bb233,_0x322d08){return new BPromise(function(_0x1b5be1,_0x3e6b2b){_0x4e87bf['synthesizeSpeech'](_0x2bb233,function(_0x5d5b5f,_0x19be92){if(_0x5d5b5f){_0x3e6b2b(_0x5d5b5f);}else if(_0x19be92){if(_0x19be92[_0x5191('0x3')]instanceof Buffer){fs[_0x5191('0x4')](_0x322d08,_0x19be92[_0x5191('0x3')],function(_0x4a9917){if(_0x4a9917){_0x3e6b2b(_0x4a9917);}else{_0x1b5be1();}});}else{_0x3e6b2b(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x3e6b2b(new Error(_0x5191('0x5')));}});});}module[_0x5191('0x6')]=function(_0x22f422,_0x1a63eb,_0x5e6931,_0x32c953,_0x3112e2,_0x3cb148,_0x3ddab1){var _0x55b2b9=new AWS[(_0x5191('0x7'))]({'accessKeyId':_0x22f422,'secretAccessKey':_0x1a63eb,'region':_0x5e6931});var _0x370bec={'Text':_0x3112e2,'TextType':_0x3cb148||_0x5191('0x8'),'OutputFormat':_0x5191('0x9'),'VoiceId':_0x32c953};return pollyResult(_0x55b2b9,_0x370bec,_0x3ddab1);};
\ No newline at end of file
+var _0x01ca=['path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x01ca,0xdc));var _0xa01c=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0x01ca[_0x19b3f9];return _0x18c3f6;};'use strict';var fs=require('fs');var path=require(_0xa01c('0x0'));var BPromise=require(_0xa01c('0x1'));var rs=require(_0xa01c('0x2'));var AWS=require(_0xa01c('0x3'));function pollyResult(_0x504128,_0x5d506a,_0x343043){return new BPromise(function(_0x408950,_0x4cc528){_0x504128[_0xa01c('0x4')](_0x5d506a,function(_0x5b098b,_0x388567){if(_0x5b098b){_0x4cc528(_0x5b098b);}else if(_0x388567){if(_0x388567[_0xa01c('0x5')]instanceof Buffer){fs['writeFile'](_0x343043,_0x388567[_0xa01c('0x5')],function(_0x23668b){if(_0x23668b){_0x4cc528(_0x23668b);}else{_0x408950();}});}else{_0x4cc528(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x4cc528(new Error(_0xa01c('0x6')));}});});}module[_0xa01c('0x7')]=function(_0x335e05,_0xed3a36,_0x4f47ec,_0x113d92,_0x22e357,_0x47ca44,_0x233320){var _0x486265=new AWS[(_0xa01c('0x8'))]({'accessKeyId':_0x335e05,'secretAccessKey':_0xed3a36,'region':_0x4f47ec});var _0x3c0f2c={'Text':_0x22e357,'TextType':_0x47ca44||_0xa01c('0x9'),'OutputFormat':'mp3','VoiceId':_0x113d92};return pollyResult(_0x486265,_0x3c0f2c,_0x233320);};
\ No newline at end of file
index afd5983..b5a7faf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1477=['exports'];(function(_0x38921c,_0x33c424){var _0x47b6b8=function(_0x486208){while(--_0x486208){_0x38921c['push'](_0x38921c['shift']());}};_0x47b6b8(++_0x33c424);}(_0x1477,0xce));var _0x7147=function(_0x486b82,_0x15f479){_0x486b82=_0x486b82-0x0;var _0x392c6a=_0x1477[_0x486b82];return _0x392c6a;};'use strict';var asr=require('./lib/api');module[_0x7147('0x0')]=function(_0x4202d0,_0x2c3938,_0x239fae,_0x23f952){return asr(_0x4202d0,_0x2c3938,_0x239fae);};
\ No newline at end of file
+var _0x7ab3=['exports','./lib/api'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x7ab3,0x12f));var _0x37ab=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0x7ab3[_0x10dbf6];return _0x452147;};'use strict';var asr=require(_0x37ab('0x0'));module[_0x37ab('0x1')]=function(_0x57e687,_0x814a10,_0x1aef5,_0xb6c13a){return asr(_0x57e687,_0x814a10,_0x1aef5);};
\ No newline at end of file
index 820a33e..78ecc2d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc73=['POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64'];(function(_0x26798a,_0x4dfc9f){var _0x1fd85a=function(_0x37a1d0){while(--_0x37a1d0){_0x26798a['push'](_0x26798a['shift']());}};_0x1fd85a(++_0x4dfc9f);}(_0xcc73,0x1cb));var _0x3cc7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xcc73[_0x1facfa];return _0x9ec701;};'use strict';var url=require('url');var BPromise=require(_0x3cc7('0x0'));var fs=require('fs');var host=_0x3cc7('0x1');module['exports']=function(_0x5055f9,_0x11b326,_0x571514){return new BPromise(function(_0x445dce,_0x5054fb){var _0x5de4be;if(typeof _0x5055f9!==_0x3cc7('0x2')||_0x5055f9[_0x3cc7('0x3')]===0x0){return _0x5054fb(_0x3cc7('0x4'));}if(typeof _0x11b326!==_0x3cc7('0x2')||_0x11b326[_0x3cc7('0x3')]===0x0){return _0x5054fb('key\x20should\x20be\x20a\x20string');}if(typeof _0x571514!==_0x3cc7('0x5')&&(typeof _0x571514!==_0x3cc7('0x2')||_0x571514[_0x3cc7('0x3')]===0x0)){return _0x5054fb(_0x3cc7('0x6'));}try{_0x5de4be=fs['readFileSync'](_0x5055f9)[_0x3cc7('0x7')](_0x3cc7('0x8'));}catch(_0xafd349){return _0x5054fb(_0xafd349);}return _0x445dce({'method':_0x3cc7('0x9'),'uri':host+_0x3cc7('0xa')+_0x11b326,'body':{'config':{'encoding':_0x3cc7('0xb'),'sampleRateHertz':_0x3cc7('0xc'),'languageCode':_0x571514},'audio':{'content':_0x5de4be}},'json':!![]});});};
\ No newline at end of file
+var _0x765e=['toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync'];(function(_0x58b900,_0x4067f4){var _0x142565=function(_0x475ac2){while(--_0x475ac2){_0x58b900['push'](_0x58b900['shift']());}};_0x142565(++_0x4067f4);}(_0x765e,0x131));var _0xe765=function(_0x3c53b5,_0x33b46c){_0x3c53b5=_0x3c53b5-0x0;var _0xdc615a=_0x765e[_0x3c53b5];return _0xdc615a;};'use strict';var url=require(_0xe765('0x0'));var BPromise=require(_0xe765('0x1'));var fs=require('fs');var host=_0xe765('0x2');module[_0xe765('0x3')]=function(_0x375719,_0x5edaf8,_0x25f437){return new BPromise(function(_0x38d6d2,_0x30703f){var _0xd2e232;if(typeof _0x375719!==_0xe765('0x4')||_0x375719[_0xe765('0x5')]===0x0){return _0x30703f(_0xe765('0x6'));}if(typeof _0x5edaf8!==_0xe765('0x4')||_0x5edaf8[_0xe765('0x5')]===0x0){return _0x30703f('key\x20should\x20be\x20a\x20string');}if(typeof _0x25f437!==_0xe765('0x7')&&(typeof _0x25f437!==_0xe765('0x4')||_0x25f437[_0xe765('0x5')]===0x0)){return _0x30703f(_0xe765('0x8'));}try{_0xd2e232=fs[_0xe765('0x9')](_0x375719)[_0xe765('0xa')](_0xe765('0xb'));}catch(_0x53b110){return _0x30703f(_0x53b110);}return _0x38d6d2({'method':_0xe765('0xc'),'uri':host+_0xe765('0xd')+_0x5edaf8,'body':{'config':{'encoding':_0xe765('0xe'),'sampleRateHertz':'8000','languageCode':_0x25f437},'audio':{'content':_0xd2e232}},'json':!![]});});};
\ No newline at end of file
index f02edc5..76dbde7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81cd=['exports'];(function(_0x19b037,_0xeb8c37){var _0x40594f=function(_0x4252b3){while(--_0x4252b3){_0x19b037['push'](_0x19b037['shift']());}};_0x40594f(++_0xeb8c37);}(_0x81cd,0x180));var _0xd81c=function(_0x5ef76a,_0x199737){_0x5ef76a=_0x5ef76a-0x0;var _0x58cc56=_0x81cd[_0x5ef76a];return _0x58cc56;};var asr=require('./asr');module[_0xd81c('0x0')]={'asr':asr};
\ No newline at end of file
+var _0x8a97=['./asr','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a97,0x1a8));var _0x78a9=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x8a97[_0x49ca18];return _0x145d54;};var asr=require(_0x78a9('0x0'));module[_0x78a9('0x1')]={'asr':asr};
\ No newline at end of file
index e7aef0c..9604a90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20f5=['googleDialogflowV2','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','tildeASR','asr','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsLex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','channelData','CustomActionData','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','querystring','request-promise','randomstring','sox','parse','./aws','./google','./sestek','../../../config/logger','protocol','https:','host','path','WHAT_EVER','get','statusCode','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','data','wav','resolve','tmp','then','chmodSync','777','readFileSync','toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','generate','.wav','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','lang\x20\x22','writeFileSync','info','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','googleDialogflow','textRequest','result','source','resolvedQuery','action','fulfillment','score','status','code','metadata','endConversation','isFallbackIntent'];(function(_0x4103d6,_0x42e4f6){var _0x565ccb=function(_0x1c7ef9){while(--_0x1c7ef9){_0x4103d6['push'](_0x4103d6['shift']());}};_0x565ccb(++_0x42e4f6);}(_0x20f5,0x129));var _0x520f=function(_0x117451,_0x4257af){_0x117451=_0x117451-0x0;var _0x256fd8=_0x20f5[_0x117451];return _0x256fd8;};'use strict';var apiai=require(_0x520f('0x0'));var BPromise=require(_0x520f('0x1'));var dialogflow=require(_0x520f('0x2'));var fs=require('fs');var http=require(_0x520f('0x3'));var https=require(_0x520f('0x4'));var md5=require(_0x520f('0x5'));var path=require('path');var querystring=require(_0x520f('0x6'));var rp=require(_0x520f('0x7'));var rs=require(_0x520f('0x8'));var sox=require(_0x520f('0x9'));var tts=require('google-tts-api');var urlParse=require('url')[_0x520f('0xa')];var util=require('util');var aws=require(_0x520f('0xb'));var google=require(_0x520f('0xc'));var sestek=require(_0x520f('0xd'));var tilde=require('./tilde');var logger=require(_0x520f('0xe'))('agi');var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x34693b,_0x5ee5ce){return new BPromise(function(_0x5aafbd,_0xdea9e){var _0x103644=urlParse(_0x34693b);var _0x17b3c8=_0x103644[_0x520f('0xf')]===_0x520f('0x10')?https:http;var _0x659354={'host':_0x103644[_0x520f('0x11')],'path':_0x103644[_0x520f('0x12')],'headers':{'user-agent':_0x520f('0x13')}};_0x17b3c8[_0x520f('0x14')](_0x659354,function(_0x4a262b){if(_0x4a262b[_0x520f('0x15')]!==0xc8){logger['error'](_0x520f('0x16')+_0x34693b+'\x20failed,\x20status\x20code\x20=\x20'+_0x4a262b[_0x520f('0x15')]+'\x20('+_0x4a262b[_0x520f('0x17')]+')');_0xdea9e(new Error(_0x520f('0x16')+_0x34693b+_0x520f('0x18')+_0x4a262b[_0x520f('0x15')]+'\x20('+_0x4a262b[_0x520f('0x17')]+')'));return;}var _0x4a0c4d=fs[_0x520f('0x19')](_0x5ee5ce);_0x4a0c4d['on'](_0x520f('0x1a'),function(){logger['info'](_0x520f('0x1b'));_0x4a0c4d[_0x520f('0x1c')](_0x5aafbd);});_0x4a0c4d['on'](_0x520f('0x1d'),function(_0x19d80f){fs[_0x520f('0x1e')](_0x5ee5ce);logger[_0x520f('0x1d')](_0x520f('0x1f'),_0x19d80f);_0xdea9e(_0x19d80f);});_0x4a262b[_0x520f('0x20')](_0x4a0c4d);})['on']('error',function(_0x55343a){logger[_0x520f('0x1d')](_0x55343a);_0xdea9e(_0x55343a);})[_0x520f('0x21')]();});}function uploadFile(_0x5e0de7){return new BPromise(function(_0x12f565,_0x4d9d93){var _0x3b5de3=urlParse(_0x5e0de7);var _0x5193b1=_0x3b5de3['protocol']===_0x520f('0x10')?https:http;var _0x452d47={'host':_0x3b5de3[_0x520f('0x11')],'path':_0x3b5de3[_0x520f('0x12')],'headers':{'user-agent':'WHAT_EVER'}};_0x5193b1['get'](_0x452d47,function(_0x1d5afa){if(_0x1d5afa[_0x520f('0x15')]!==0xc8){_0x4d9d93(new Error(_0x520f('0x16')+_0x5e0de7+_0x520f('0x18')+_0x1d5afa[_0x520f('0x15')]+'\x20('+_0x1d5afa[_0x520f('0x17')]+')'));return;}var _0x1a00e0='';_0x1d5afa['on'](_0x520f('0x22'),function(_0x3e83ca){_0x1a00e0+=_0x3e83ca;});_0x1d5afa['on'](_0x520f('0x21'),function(){_0x12f565(_0x1a00e0);});})['on']('error',function(_0x1f703e){_0x4d9d93(_0x1f703e);})[_0x520f('0x21')]();});}function convertFile(_0x52bded,_0x5eaa54){return new BPromise(function(_0xaab846,_0x3108a6){var _0x1021da=sox['transcode'](_0x52bded,_0x5eaa54,{'sampleRate':0x1f40,'format':_0x520f('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1021da['on'](_0x520f('0x1d'),function(_0x30b162){logger['error']('error\x20convert',_0x30b162);_0x3108a6(_0x30b162);});_0x1021da['on'](_0x520f('0x21'),function(){logger['info']('finish\x20to\x20convert');_0xaab846();});_0x1021da['start']();});}function base64Decode(_0x4381c5,_0x52c73e){var _0x3360cd=path[_0x520f('0x24')](__dirname,_0x520f('0x25'),rs['generate'](0x4)+'.wav');fs['writeFileSync'](_0x3360cd,_0x4381c5,'base64');return convertFile(_0x3360cd,_0x52c73e)[_0x520f('0x26')](function(){try{fs[_0x520f('0x1e')](_0x3360cd);fs[_0x520f('0x27')](_0x52c73e,_0x520f('0x28'));}catch(_0x51b3da){logger[_0x520f('0x1d')](_0x51b3da);}return _0x52c73e['split']('.')[0x0];});}function base64Encode(_0x569abb){var _0x47410f=fs[_0x520f('0x29')](_0x569abb);return new Buffer(_0x47410f)[_0x520f('0x2a')](_0x520f('0x2b'));}exports[_0x520f('0x2c')]=function(_0x4eb360,_0x4cddae,_0x15d273,_0xf2f328,_0x1d8322,_0x20b80a){var _0x1255ac,_0xd3d374;var _0x138ff3=_0x520f('0x2d');var _0x256f7b=_0x520f('0x2e')+_0x4eb360;var _0x2f9c96={};if(_0x4cddae===_0x520f('0x2f')){_0x2f9c96[_0x520f('0x30')]={'ssml':_0x15d273};}else{_0x2f9c96[_0x520f('0x30')]={'text':_0x15d273};};_0x2f9c96[_0x520f('0x31')]={'languageCode':_0xf2f328,'ssmlGender':_0x1d8322};_0x2f9c96[_0x520f('0x32')]={'audioEncoding':_0x520f('0x33'),'sampleRateHertz':0x1f40};var _0x4e3281={'url':_0x138ff3+_0x520f('0x34')+_0x256f7b,'method':_0x520f('0x35'),'json':!![],'body':_0x2f9c96};return rp(_0x4e3281)['then'](function(_0x42aa73){return new BPromise(function(_0x497486,_0x2c6042){_0x1255ac=path[_0x520f('0x24')](__dirname,'tmp',rs['generate'](0x4)+_0x520f('0x36'));var _0x42ff42=Buffer[_0x520f('0x37')](_0x42aa73[_0x520f('0x38')],_0x520f('0x2b'));return fs[_0x520f('0x39')](_0x1255ac,_0x42ff42,function(_0x367612){_0x2c6042(_0x367612);},function(_0xf1f5cc){fs[_0x520f('0x27')](_0x1255ac,_0x520f('0x28'));_0x497486(_0xf1f5cc);});});})[_0x520f('0x26')](function(_0x22311b){_0xd3d374=path[_0x520f('0x24')](__dirname,_0x520f('0x25'),rs[_0x520f('0x3a')](0x4)+_0x520f('0x3b'));return convertFile(_0x1255ac,_0xd3d374);})[_0x520f('0x26')](function(){try{fs[_0x520f('0x1e')](_0x1255ac);fs['chmodSync'](_0xd3d374,_0x520f('0x28'));}catch(_0x3314ee){logger['error'](_0x3314ee);}logger['info'](_0x520f('0x3c'),_0xd3d374[_0x520f('0x3d')]('.')[0x0]);return _0xd3d374[_0x520f('0x3d')]('.')[0x0];});};exports[_0x520f('0x3e')]=function(_0x4d3ed6,_0x306ad5){var _0x1d5d7d=_0x520f('0x3f');var _0x196e6f,_0xa68b3b;var _0x59fd53;var _0x47306c={'encoding':_0x520f('0x40'),'method':_0x520f('0x35'),'timeout':0x2710,'url':_0x1d5d7d,'headers':{'Content-Type':_0x520f('0x41')},'body':_0x520f('0x42')+encodeURIComponent(JSON[_0x520f('0x43')]([[['jQ1olc',JSON['stringify']([_0x4d3ed6,_0x306ad5||'en',![],_0x520f('0x44')]),null,_0x520f('0x45')]]]))};return rp(_0x47306c)[_0x520f('0x26')](function(_0x2dcd47){try{_0x59fd53=eval(_0x2dcd47[_0x520f('0x46')](0x5))[0x0][0x2];}catch(_0x2704ec){throw new Error(_0x520f('0x47')+_0x2dcd47[_0x520f('0x22')]);}if(!_0x59fd53){if(_0x4d3ed6['length']>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x520f('0x48')+_0x306ad5+'\x22\x20might\x20not\x20exist');}}try{_0x59fd53=eval(_0x59fd53)[0x0];}catch(_0x38c6f9){throw new Error(_0x520f('0x47')+res[_0x520f('0x22')]);}const _0x3e9fa6=_0x59fd53;_0x196e6f=path['resolve'](__dirname,'tmp',rs[_0x520f('0x3a')](0x4)+'.mp3');fs[_0x520f('0x49')](_0x196e6f,_0x59fd53,{'encoding':'base64'});_0xa68b3b=path['resolve'](__dirname,_0x520f('0x25'),rs[_0x520f('0x3a')](0x4)+'.wav');return convertFile(_0x196e6f,_0xa68b3b);})[_0x520f('0x26')](function(){try{fs[_0x520f('0x1e')](_0x196e6f);fs[_0x520f('0x27')](_0xa68b3b,_0x520f('0x28'));}catch(_0x4c6da6){logger[_0x520f('0x1d')](_0x4c6da6);}logger[_0x520f('0x4a')](_0x520f('0x4b'),_0xa68b3b[_0x520f('0x3d')]('.')[0x0]);return _0xa68b3b[_0x520f('0x3d')]('.')[0x0];});};exports[_0x520f('0x4c')]=function(_0xc503d1,_0x9d9499,_0x4d72e1){return google['asr'](_0xc503d1,_0x9d9499,_0x4d72e1)[_0x520f('0x26')](function(_0x11484f){logger[_0x520f('0x4a')](_0x11484f[_0x520f('0x4d')]);return rp(_0x11484f);})[_0x520f('0x26')](function(_0x2a794c){var _0x5d6dda='';var _0xcaf484=0x0;try{fs[_0x520f('0x1e')](_0xc503d1);}catch(_0x5686a1){logger[_0x520f('0x1d')](_0x5686a1);}if(_0x2a794c&&_0x2a794c[_0x520f('0x4e')]){_0x5d6dda=_0x2a794c[_0x520f('0x4e')][_0x520f('0x4f')](function(_0x2d1025){return _0x2d1025&&_0x2d1025[_0x520f('0x50')][0x0]&&_0x2d1025[_0x520f('0x50')][0x0][_0x520f('0x51')]?_0x2d1025['alternatives'][0x0][_0x520f('0x51')]:'';})['join']('\x0a');_0xcaf484=_0x2a794c['results'][_0x520f('0x4f')](function(_0x5358ec){return _0x5358ec&&_0x5358ec[_0x520f('0x50')][0x0]&&_0x5358ec[_0x520f('0x50')][0x0][_0x520f('0x52')]?_0x5358ec[_0x520f('0x50')][0x0][_0x520f('0x52')]:0x0;})['join']('\x0a');}logger['info']('googleASR\x20transcription',_0x5d6dda);logger[_0x520f('0x4a')](_0x520f('0x53'),_0xcaf484);return{'transcript':_0x5d6dda,'confidence':_0xcaf484};})[_0x520f('0x54')](function(_0x1c5ec4){logger[_0x520f('0x1d')](_0x520f('0x55'),_0x1c5ec4[_0x520f('0x15')],_0x1c5ec4['name'],_0x1c5ec4['message']);});};exports[_0x520f('0x56')]=function(_0x5d8aa8,_0x23526e,_0x52a6a0,_0x575a94){var _0xcf52d7=apiai(_0x23526e,{'language':_0x575a94||'en'});return _0xcf52d7[_0x520f('0x57')](_0x52a6a0,{'sessionId':md5(_0x5d8aa8)})['then'](function(_0xa9b56b){logger['info'](JSON[_0x520f('0x43')](_0xa9b56b));return{'source':_0xa9b56b[_0x520f('0x58')][_0x520f('0x59')],'resolvedQuery':_0xa9b56b['result'][_0x520f('0x5a')],'action':_0xa9b56b[_0x520f('0x58')][_0x520f('0x5b')],'actionIncomplete':_0xa9b56b[_0x520f('0x58')]['actionIncomplete'],'speech':_0xa9b56b[_0x520f('0x58')][_0x520f('0x5c')]['speech'],'score':_0xa9b56b[_0x520f('0x58')][_0x520f('0x5d')],'statusCode':_0xa9b56b[_0x520f('0x5e')][_0x520f('0x5f')],'endConversation':_0xa9b56b[_0x520f('0x58')][_0x520f('0x60')][_0x520f('0x61')]||![],'isFallbackIntent':_0xa9b56b[_0x520f('0x58')][_0x520f('0x60')][_0x520f('0x62')]};});};exports[_0x520f('0x63')]=function(_0x20845c,_0x40c344,_0x5122b1,_0x4230eb,_0x51760a,_0x598bd8){var _0x5a06b7=_0x4230eb['replace'](/\\n/g,'\x0a');var _0x1d3699={'credentials':{'private_key':_0x5a06b7,'client_email':_0x5122b1}};var _0x270f33=new dialogflow['SessionsClient'](_0x1d3699);var _0x43c27d=_0x270f33[_0x520f('0x64')](_0x40c344,md5(_0x20845c));var _0x23fa9c={'session':_0x43c27d,'queryInput':{'text':{'text':_0x51760a,'languageCode':_0x598bd8}}};return _0x270f33['detectIntent'](_0x23fa9c)['then'](function(_0x3e8de6){if(_0x3e8de6&&_0x3e8de6['length']){logger[_0x520f('0x4a')](_0x520f('0x65'),JSON[_0x520f('0x43')](_0x3e8de6));var _0x545481=_0x3e8de6[0x0];if(_0x545481){var _0x2fe142={'action':_0x545481[_0x520f('0x66')][_0x520f('0x5b')],'allRequiredParamsPresent':_0x545481[_0x520f('0x66')][_0x520f('0x67')],'endConversation':_0x545481[_0x520f('0x66')][_0x520f('0x68')]&&_0x545481[_0x520f('0x66')][_0x520f('0x68')][_0x520f('0x69')]?_0x545481['queryResult'][_0x520f('0x68')][_0x520f('0x69')]['end_conversation'][_0x520f('0x6a')]:![],'fulfillmentText':_0x545481['queryResult'][_0x520f('0x6b')],'intentName':_0x545481[_0x520f('0x66')][_0x520f('0x6c')]['name'],'intentDisplayName':_0x545481[_0x520f('0x66')]['intent'][_0x520f('0x6d')],'isFallbackIntent':_0x545481[_0x520f('0x66')]['intent'][_0x520f('0x6e')],'languageCode':_0x545481[_0x520f('0x66')][_0x520f('0x6f')],'queryText':_0x545481[_0x520f('0x66')][_0x520f('0x70')],'responseId':_0x545481[_0x520f('0x71')],'score':_0x545481[_0x520f('0x66')]['intentDetectionConfidence'],'speech':_0x545481[_0x520f('0x66')][_0x520f('0x6b')],'providerResponse':JSON[_0x520f('0x43')](_0x3e8de6)};return _0x2fe142;}}});};exports[_0x520f('0x72')]=function(_0x2a4aa5,_0x246530,_0x15c314,_0x1e4087){return tilde[_0x520f('0x73')](_0x2a4aa5,_0x246530,_0x15c314,_0x1e4087)[_0x520f('0x26')](function(_0x16b56c){try{fs[_0x520f('0x1e')](_0x2a4aa5);}catch(_0xf3db1d){logger[_0x520f('0x1d')](_0xf3db1d);}logger[_0x520f('0x4a')](_0x520f('0x74'),_0x16b56c[_0x520f('0x51')]);logger[_0x520f('0x4a')](_0x520f('0x75'),_0x16b56c[_0x520f('0x52')]);return _0x16b56c;});};exports['awsPolly']=function(_0x13e0bc,_0x34c78f,_0x582663,_0x3799f7,_0x59c609,_0x24ad30){var _0x536a23=path[_0x520f('0x24')](__dirname,_0x520f('0x25'),rs['generate'](0x4)+'.mp3');var _0x265cb3;return aws['polly'](_0x13e0bc,_0x34c78f,_0x582663,_0x3799f7,_0x59c609,_0x24ad30,_0x536a23)['then'](function(){_0x265cb3=path[_0x520f('0x24')](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x536a23,_0x265cb3);})[_0x520f('0x26')](function(){try{fs[_0x520f('0x1e')](_0x536a23);fs[_0x520f('0x27')](_0x265cb3,_0x520f('0x28'));}catch(_0x4c2523){logger[_0x520f('0x1d')](_0x4c2523);}return _0x265cb3[_0x520f('0x3d')]('.')[0x0];});};exports[_0x520f('0x76')]=function(_0x183fe9,_0x35944a,_0x21fecf,_0xae186b,_0x6daa44,_0x59a178){return aws['lex'](_0x183fe9,_0x35944a,_0x21fecf,_0xae186b,_0x6daa44,_0x59a178)[_0x520f('0x26')](function(_0x3cf52d){logger[_0x520f('0x4a')](JSON['stringify'](_0x3cf52d));return _0x3cf52d;});};exports[_0x520f('0x77')]=function(_0x175424,_0x134888,_0x1c71fc,_0x225a53){var _0x5a4ca9=util[_0x520f('0x78')](_0x520f('0x79'),ISPEECH_API,_0x175424,encodeURIComponent(_0x134888),_0x1c71fc,_0x225a53);var _0xdf2854=path[_0x520f('0x24')](__dirname,_0x520f('0x25'),rs[_0x520f('0x3a')](0x4)+'.mp3');var _0x114475;return downloadFile(_0x5a4ca9,_0xdf2854)[_0x520f('0x26')](function(){_0x114475=path[_0x520f('0x24')](__dirname,_0x520f('0x25'),rs['generate'](0x4)+_0x520f('0x3b'));return convertFile(_0xdf2854,_0x114475);})['then'](function(){try{fs[_0x520f('0x1e')](_0xdf2854);fs[_0x520f('0x27')](_0x114475,_0x520f('0x28'));}catch(_0x1ee169){logger[_0x520f('0x1d')](_0x1ee169);}return _0x114475[_0x520f('0x3d')]('.')[0x0];});};exports[_0x520f('0x7a')]=function(_0x5a0219,_0x3f7249,_0x4e2073,_0x5d9b88){var _0x491513=util[_0x520f('0x78')](_0x520f('0x7b'),ISPEECH_API,_0x3f7249,_0x4e2073,base64Encode(_0x5a0219),_0x5d9b88?util['format'](_0x520f('0x7c'),encodeURIComponent(_0x5d9b88)):'freeform=3');return uploadFile(_0x491513)['then'](function(_0x13df06){return querystring['parse'](_0x13df06);});};exports[_0x520f('0x7d')]=function(_0x703cd0,_0x2241d8){return sestek[_0x520f('0x7e')](_0x703cd0,_0x2241d8)[_0x520f('0x26')](function(_0x4be2c7){logger[_0x520f('0x4a')](JSON[_0x520f('0x43')](_0x4be2c7));var _0x35ce92={'speech':_0x4be2c7['text'],'action':_0x4be2c7[_0x520f('0x7f')]?_0x4be2c7[_0x520f('0x7f')]['CustomAction']:undefined,'actiondata':_0x4be2c7[_0x520f('0x7f')]?_0x4be2c7[_0x520f('0x7f')][_0x520f('0x80')]:undefined};if(_0x4be2c7['channelData']&&_0x4be2c7['channelData'][_0x520f('0x81')]){return base64Decode(_0x4be2c7[_0x520f('0x7f')][_0x520f('0x81')]['Data'],path[_0x520f('0x24')](__dirname,'tmp',rs[_0x520f('0x3a')](0x4)+_0x520f('0x3b')))[_0x520f('0x26')](function(_0x3fa70f){_0x35ce92[_0x520f('0x82')]=_0x3fa70f;return _0x35ce92;});}return _0x35ce92;});};exports[_0x520f('0x83')]=function(){return __dirname;};
\ No newline at end of file
+var _0x381f=['dialogflow','https','path','randomstring','sox','google-tts-api','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','request\x20to\x20','statusMessage','createWriteStream','finish','finish\x20download\x20file','close','unlink','pipe','end','WHAT_EVER','get','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','writeFileSync','base64','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','MP3','generate','.mp3','from','audioContent','writeFile','chmodSync','.wav','then','googleCloudTTS\x20path','POST','f.req=','stringify','jQ1olc','null','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','info','uri','results','map','alternatives','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','message','googleDialogflow','textRequest','result','resolvedQuery','action','actionIncomplete','fulfillment','status','metadata','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','transcript','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','audiofile'];(function(_0x146516,_0x469a16){var _0x20fe8a=function(_0x7b5b3f){while(--_0x7b5b3f){_0x146516['push'](_0x146516['shift']());}};_0x20fe8a(++_0x469a16);}(_0x381f,0x83));var _0xf381=function(_0x5ff6ad,_0x499e67){_0x5ff6ad=_0x5ff6ad-0x0;var _0x41afeb=_0x381f[_0x5ff6ad];return _0x41afeb;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require(_0xf381('0x0'));var fs=require('fs');var http=require('http');var https=require(_0xf381('0x1'));var md5=require('md5');var path=require(_0xf381('0x2'));var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0xf381('0x3'));var sox=require(_0xf381('0x4'));var tts=require(_0xf381('0x5'));var urlParse=require('url')[_0xf381('0x6')];var util=require(_0xf381('0x7'));var aws=require(_0xf381('0x8'));var google=require(_0xf381('0x9'));var sestek=require(_0xf381('0xa'));var tilde=require(_0xf381('0xb'));var logger=require(_0xf381('0xc'))('agi');var ISPEECH_API=_0xf381('0xd');function downloadFile(_0x95317b,_0x195e79){return new BPromise(function(_0x4d23da,_0x4a1513){var _0xcfebd5=urlParse(_0x95317b);var _0x292b79=_0xcfebd5[_0xf381('0xe')]===_0xf381('0xf')?https:http;var _0x4f6a61={'host':_0xcfebd5[_0xf381('0x10')],'path':_0xcfebd5[_0xf381('0x2')],'headers':{'user-agent':'WHAT_EVER'}};_0x292b79['get'](_0x4f6a61,function(_0x465d27){if(_0x465d27[_0xf381('0x11')]!==0xc8){logger[_0xf381('0x12')]('request\x20to\x20'+_0x95317b+_0xf381('0x13')+_0x465d27[_0xf381('0x11')]+'\x20('+_0x465d27['statusMessage']+')');_0x4a1513(new Error(_0xf381('0x14')+_0x95317b+_0xf381('0x13')+_0x465d27[_0xf381('0x11')]+'\x20('+_0x465d27[_0xf381('0x15')]+')'));return;}var _0xa8aadc=fs[_0xf381('0x16')](_0x195e79);_0xa8aadc['on'](_0xf381('0x17'),function(){logger['info'](_0xf381('0x18'));_0xa8aadc[_0xf381('0x19')](_0x4d23da);});_0xa8aadc['on'](_0xf381('0x12'),function(_0x2564b3){fs[_0xf381('0x1a')](_0x195e79);logger[_0xf381('0x12')]('download\x20error',_0x2564b3);_0x4a1513(_0x2564b3);});_0x465d27[_0xf381('0x1b')](_0xa8aadc);})['on'](_0xf381('0x12'),function(_0x34f198){logger['error'](_0x34f198);_0x4a1513(_0x34f198);})[_0xf381('0x1c')]();});}function uploadFile(_0x37efcf){return new BPromise(function(_0x4da020,_0x4617fb){var _0x18d477=urlParse(_0x37efcf);var _0x4d4f82=_0x18d477[_0xf381('0xe')]===_0xf381('0xf')?https:http;var _0x5bbdbf={'host':_0x18d477[_0xf381('0x10')],'path':_0x18d477[_0xf381('0x2')],'headers':{'user-agent':_0xf381('0x1d')}};_0x4d4f82[_0xf381('0x1e')](_0x5bbdbf,function(_0x1a420){if(_0x1a420['statusCode']!==0xc8){_0x4617fb(new Error(_0xf381('0x14')+_0x37efcf+'\x20failed,\x20status\x20code\x20=\x20'+_0x1a420['statusCode']+'\x20('+_0x1a420[_0xf381('0x15')]+')'));return;}var _0xd8e311='';_0x1a420['on'](_0xf381('0x1f'),function(_0xd5a99){_0xd8e311+=_0xd5a99;});_0x1a420['on'](_0xf381('0x1c'),function(){_0x4da020(_0xd8e311);});})['on'](_0xf381('0x12'),function(_0x3584c6){_0x4617fb(_0x3584c6);})[_0xf381('0x1c')]();});}function convertFile(_0x417588,_0x24a904){return new BPromise(function(_0x4202dd,_0x522139){var _0x2e294f=sox[_0xf381('0x20')](_0x417588,_0x24a904,{'sampleRate':0x1f40,'format':_0xf381('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2e294f['on'](_0xf381('0x12'),function(_0x4b430e){logger[_0xf381('0x12')](_0xf381('0x22'),_0x4b430e);_0x522139(_0x4b430e);});_0x2e294f['on'](_0xf381('0x1c'),function(){logger['info'](_0xf381('0x23'));_0x4202dd();});_0x2e294f[_0xf381('0x24')]();});}function base64Decode(_0x55cf82,_0xa647b9){var _0x407e92=path[_0xf381('0x25')](__dirname,_0xf381('0x26'),rs['generate'](0x4)+'.wav');fs[_0xf381('0x27')](_0x407e92,_0x55cf82,_0xf381('0x28'));return convertFile(_0x407e92,_0xa647b9)['then'](function(){try{fs[_0xf381('0x1a')](_0x407e92);fs['chmodSync'](_0xa647b9,_0xf381('0x29'));}catch(_0x20bf04){logger[_0xf381('0x12')](_0x20bf04);}return _0xa647b9[_0xf381('0x2a')]('.')[0x0];});}function base64Encode(_0x50e8c7){var _0x2e5b3a=fs[_0xf381('0x2b')](_0x50e8c7);return new Buffer(_0x2e5b3a)[_0xf381('0x2c')](_0xf381('0x28'));}exports[_0xf381('0x2d')]=function(_0x7e6ead,_0x599564,_0x3190b5,_0x25d51a,_0x160820,_0x48bdf1){var _0x62d71,_0x11b2b0;var _0x4021c0=_0xf381('0x2e');var _0x55049f=_0xf381('0x2f')+_0x7e6ead;var _0x8fd772={};if(_0x599564===_0xf381('0x30')){_0x8fd772[_0xf381('0x31')]={'ssml':_0x3190b5};}else{_0x8fd772[_0xf381('0x31')]={'text':_0x3190b5};};_0x8fd772['voice']={'languageCode':_0x25d51a,'ssmlGender':_0x160820};_0x8fd772['audioConfig']={'audioEncoding':_0xf381('0x32'),'sampleRateHertz':0x1f40};var _0x17d4f8={'url':_0x4021c0+'text:synthesize'+_0x55049f,'method':'POST','json':!![],'body':_0x8fd772};return rp(_0x17d4f8)['then'](function(_0x388e95){return new BPromise(function(_0x34656d,_0xb42d43){_0x62d71=path[_0xf381('0x25')](__dirname,'tmp',rs[_0xf381('0x33')](0x4)+_0xf381('0x34'));var _0x25feeb=Buffer[_0xf381('0x35')](_0x388e95[_0xf381('0x36')],_0xf381('0x28'));return fs[_0xf381('0x37')](_0x62d71,_0x25feeb,function(_0x2210c0){_0xb42d43(_0x2210c0);},function(_0x2a8195){fs[_0xf381('0x38')](_0x62d71,_0xf381('0x29'));_0x34656d(_0x2a8195);});});})['then'](function(_0x3887eb){_0x11b2b0=path[_0xf381('0x25')](__dirname,_0xf381('0x26'),rs[_0xf381('0x33')](0x4)+_0xf381('0x39'));return convertFile(_0x62d71,_0x11b2b0);})[_0xf381('0x3a')](function(){try{fs[_0xf381('0x1a')](_0x62d71);fs[_0xf381('0x38')](_0x11b2b0,'777');}catch(_0x1cf17b){logger[_0xf381('0x12')](_0x1cf17b);}logger['info'](_0xf381('0x3b'),_0x11b2b0['split']('.')[0x0]);return _0x11b2b0['split']('.')[0x0];});};exports['googleTTS']=function(_0x14d398,_0x5d20a9){var _0x36f145='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x39f7a7,_0x3f7974;var _0x40d617;var _0x34db0e={'encoding':'utf8','method':_0xf381('0x3c'),'timeout':0x2710,'url':_0x36f145,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xf381('0x3d')+encodeURIComponent(JSON[_0xf381('0x3e')]([[[_0xf381('0x3f'),JSON[_0xf381('0x3e')]([_0x14d398,_0x5d20a9||'en',![],_0xf381('0x40')]),null,_0xf381('0x41')]]]))};return rp(_0x34db0e)['then'](function(_0x4723cc){try{_0x40d617=eval(_0x4723cc['slice'](0x5))[0x0][0x2];}catch(_0xd646ce){throw new Error(_0xf381('0x42')+_0x4723cc['data']);}if(!_0x40d617){if(_0x14d398[_0xf381('0x43')]>0xc8){throw new Error(_0xf381('0x44'));}else{throw new Error(_0xf381('0x45')+_0x5d20a9+_0xf381('0x46'));}}try{_0x40d617=eval(_0x40d617)[0x0];}catch(_0x4f3d81){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xf381('0x1f')]);}const _0x1ba658=_0x40d617;_0x39f7a7=path[_0xf381('0x25')](__dirname,'tmp',rs[_0xf381('0x33')](0x4)+'.mp3');fs[_0xf381('0x27')](_0x39f7a7,_0x40d617,{'encoding':_0xf381('0x28')});_0x3f7974=path['resolve'](__dirname,_0xf381('0x26'),rs[_0xf381('0x33')](0x4)+'.wav');return convertFile(_0x39f7a7,_0x3f7974);})[_0xf381('0x3a')](function(){try{fs[_0xf381('0x1a')](_0x39f7a7);fs[_0xf381('0x38')](_0x3f7974,_0xf381('0x29'));}catch(_0x403199){logger[_0xf381('0x12')](_0x403199);}logger['info'](_0xf381('0x47'),_0x3f7974[_0xf381('0x2a')]('.')[0x0]);return _0x3f7974[_0xf381('0x2a')]('.')[0x0];});};exports[_0xf381('0x48')]=function(_0x4550e2,_0x14f7b1,_0x7b377c){return google['asr'](_0x4550e2,_0x14f7b1,_0x7b377c)[_0xf381('0x3a')](function(_0x4d8276){logger[_0xf381('0x49')](_0x4d8276[_0xf381('0x4a')]);return rp(_0x4d8276);})[_0xf381('0x3a')](function(_0x313d55){var _0x56be36='';var _0x1cff5b=0x0;try{fs['unlink'](_0x4550e2);}catch(_0x924aee){logger[_0xf381('0x12')](_0x924aee);}if(_0x313d55&&_0x313d55[_0xf381('0x4b')]){_0x56be36=_0x313d55['results'][_0xf381('0x4c')](function(_0x3d19f1){return _0x3d19f1&&_0x3d19f1['alternatives'][0x0]&&_0x3d19f1[_0xf381('0x4d')][0x0]['transcript']?_0x3d19f1[_0xf381('0x4d')][0x0]['transcript']:'';})['join']('\x0a');_0x1cff5b=_0x313d55[_0xf381('0x4b')]['map'](function(_0x396695){return _0x396695&&_0x396695[_0xf381('0x4d')][0x0]&&_0x396695[_0xf381('0x4d')][0x0][_0xf381('0x4e')]?_0x396695[_0xf381('0x4d')][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0xf381('0x49')](_0xf381('0x4f'),_0x56be36);logger[_0xf381('0x49')](_0xf381('0x50'),_0x1cff5b);return{'transcript':_0x56be36,'confidence':_0x1cff5b};})[_0xf381('0x51')](function(_0x58c9bd){logger['error']('[%s]\x20%s:%s',_0x58c9bd[_0xf381('0x11')],_0x58c9bd['name'],_0x58c9bd[_0xf381('0x52')]);});};exports[_0xf381('0x53')]=function(_0x40d664,_0x18891a,_0x374263,_0x15426a){var _0x2fa8a7=apiai(_0x18891a,{'language':_0x15426a||'en'});return _0x2fa8a7[_0xf381('0x54')](_0x374263,{'sessionId':md5(_0x40d664)})[_0xf381('0x3a')](function(_0x3d28fb){logger[_0xf381('0x49')](JSON[_0xf381('0x3e')](_0x3d28fb));return{'source':_0x3d28fb[_0xf381('0x55')]['source'],'resolvedQuery':_0x3d28fb[_0xf381('0x55')][_0xf381('0x56')],'action':_0x3d28fb[_0xf381('0x55')][_0xf381('0x57')],'actionIncomplete':_0x3d28fb['result'][_0xf381('0x58')],'speech':_0x3d28fb[_0xf381('0x55')][_0xf381('0x59')]['speech'],'score':_0x3d28fb['result']['score'],'statusCode':_0x3d28fb[_0xf381('0x5a')]['code'],'endConversation':_0x3d28fb[_0xf381('0x55')][_0xf381('0x5b')]['endConversation']||![],'isFallbackIntent':_0x3d28fb['result'][_0xf381('0x5b')]['isFallbackIntent']};});};exports[_0xf381('0x5c')]=function(_0x12f7ec,_0x4d22dc,_0x3a65f7,_0x409f61,_0x2f1aff,_0xbf4b8a){var _0x53a475=_0x409f61[_0xf381('0x5d')](/\\n/g,'\x0a');var _0xa41390={'credentials':{'private_key':_0x53a475,'client_email':_0x3a65f7}};var _0x15a2b8=new dialogflow[(_0xf381('0x5e'))](_0xa41390);var _0x1fe3bb=_0x15a2b8[_0xf381('0x5f')](_0x4d22dc,md5(_0x12f7ec));var _0x2d8f0b={'session':_0x1fe3bb,'queryInput':{'text':{'text':_0x2f1aff,'languageCode':_0xbf4b8a}}};return _0x15a2b8['detectIntent'](_0x2d8f0b)['then'](function(_0x2a03df){if(_0x2a03df&&_0x2a03df[_0xf381('0x43')]){logger[_0xf381('0x49')](_0xf381('0x60'),JSON[_0xf381('0x3e')](_0x2a03df));var _0x3431a5=_0x2a03df[0x0];if(_0x3431a5){var _0x45e3c2={'action':_0x3431a5['queryResult']['action'],'allRequiredParamsPresent':_0x3431a5[_0xf381('0x61')][_0xf381('0x62')],'endConversation':_0x3431a5[_0xf381('0x61')]['diagnosticInfo']&&_0x3431a5['queryResult'][_0xf381('0x63')][_0xf381('0x64')]?_0x3431a5[_0xf381('0x61')]['diagnosticInfo'][_0xf381('0x64')][_0xf381('0x65')][_0xf381('0x66')]:![],'fulfillmentText':_0x3431a5[_0xf381('0x61')][_0xf381('0x67')],'intentName':_0x3431a5[_0xf381('0x61')][_0xf381('0x68')][_0xf381('0x69')],'intentDisplayName':_0x3431a5[_0xf381('0x61')]['intent'][_0xf381('0x6a')],'isFallbackIntent':_0x3431a5[_0xf381('0x61')][_0xf381('0x68')][_0xf381('0x6b')],'languageCode':_0x3431a5[_0xf381('0x61')][_0xf381('0x6c')],'queryText':_0x3431a5['queryResult'][_0xf381('0x6d')],'responseId':_0x3431a5[_0xf381('0x6e')],'score':_0x3431a5[_0xf381('0x61')][_0xf381('0x6f')],'speech':_0x3431a5['queryResult'][_0xf381('0x67')],'providerResponse':JSON[_0xf381('0x3e')](_0x2a03df)};return _0x45e3c2;}}});};exports['tildeASR']=function(_0xf44688,_0x23d0d4,_0xbd1f90,_0x4c253f){return tilde['asr'](_0xf44688,_0x23d0d4,_0xbd1f90,_0x4c253f)[_0xf381('0x3a')](function(_0x32b346){try{fs[_0xf381('0x1a')](_0xf44688);}catch(_0x5e5bce){logger[_0xf381('0x12')](_0x5e5bce);}logger[_0xf381('0x49')]('Tilde\x20ASR\x20transcription',_0x32b346[_0xf381('0x70')]);logger[_0xf381('0x49')]('Tilde\x20ASR\x20confidence',_0x32b346['confidence']);return _0x32b346;});};exports[_0xf381('0x71')]=function(_0x2cd9de,_0x5ce31c,_0x4347e,_0x555c9c,_0x5a49e2,_0xcd2078){var _0x5287a7=path[_0xf381('0x25')](__dirname,'tmp',rs['generate'](0x4)+'.mp3');var _0x5537f2;return aws[_0xf381('0x72')](_0x2cd9de,_0x5ce31c,_0x4347e,_0x555c9c,_0x5a49e2,_0xcd2078,_0x5287a7)['then'](function(){_0x5537f2=path['resolve'](__dirname,'tmp',rs[_0xf381('0x33')](0x4)+'.wav');return convertFile(_0x5287a7,_0x5537f2);})[_0xf381('0x3a')](function(){try{fs[_0xf381('0x1a')](_0x5287a7);fs[_0xf381('0x38')](_0x5537f2,_0xf381('0x29'));}catch(_0x24facf){logger[_0xf381('0x12')](_0x24facf);}return _0x5537f2[_0xf381('0x2a')]('.')[0x0];});};exports[_0xf381('0x73')]=function(_0x1bc89d,_0x1356e1,_0x5a0b54,_0x4fceb8,_0x2cf08f,_0xeb103e){return aws[_0xf381('0x74')](_0x1bc89d,_0x1356e1,_0x5a0b54,_0x4fceb8,_0x2cf08f,_0xeb103e)['then'](function(_0x51f198){logger[_0xf381('0x49')](JSON[_0xf381('0x3e')](_0x51f198));return _0x51f198;});};exports[_0xf381('0x75')]=function(_0x63e9bf,_0x545682,_0x11c474,_0x14baf6){var _0x586fd5=util[_0xf381('0x76')](_0xf381('0x77'),ISPEECH_API,_0x63e9bf,encodeURIComponent(_0x545682),_0x11c474,_0x14baf6);var _0x38bef3=path['resolve'](__dirname,_0xf381('0x26'),rs[_0xf381('0x33')](0x4)+_0xf381('0x34'));var _0xb3d64f;return downloadFile(_0x586fd5,_0x38bef3)[_0xf381('0x3a')](function(){_0xb3d64f=path['resolve'](__dirname,_0xf381('0x26'),rs[_0xf381('0x33')](0x4)+_0xf381('0x39'));return convertFile(_0x38bef3,_0xb3d64f);})[_0xf381('0x3a')](function(){try{fs[_0xf381('0x1a')](_0x38bef3);fs[_0xf381('0x38')](_0xb3d64f,_0xf381('0x29'));}catch(_0x3b0804){logger[_0xf381('0x12')](_0x3b0804);}return _0xb3d64f[_0xf381('0x2a')]('.')[0x0];});};exports[_0xf381('0x78')]=function(_0x380c39,_0x115ccf,_0x1a0158,_0x6ef598){var _0x29cbd8=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x115ccf,_0x1a0158,base64Encode(_0x380c39),_0x6ef598?util['format'](_0xf381('0x79'),encodeURIComponent(_0x6ef598)):_0xf381('0x7a'));return uploadFile(_0x29cbd8)[_0xf381('0x3a')](function(_0x400c3c){return querystring[_0xf381('0x6')](_0x400c3c);});};exports[_0xf381('0x7b')]=function(_0x4db252,_0x122343){return sestek[_0xf381('0x7c')](_0x4db252,_0x122343)[_0xf381('0x3a')](function(_0x9e6e3a){logger[_0xf381('0x49')](JSON['stringify'](_0x9e6e3a));var _0x8ea6ae={'speech':_0x9e6e3a[_0xf381('0x7d')],'action':_0x9e6e3a[_0xf381('0x7e')]?_0x9e6e3a['channelData'][_0xf381('0x7f')]:undefined,'actiondata':_0x9e6e3a[_0xf381('0x7e')]?_0x9e6e3a['channelData'][_0xf381('0x80')]:undefined};if(_0x9e6e3a['channelData']&&_0x9e6e3a[_0xf381('0x7e')][_0xf381('0x81')]){return base64Decode(_0x9e6e3a[_0xf381('0x7e')]['AudioFromTts']['Data'],path[_0xf381('0x25')](__dirname,_0xf381('0x26'),rs[_0xf381('0x33')](0x4)+_0xf381('0x39')))['then'](function(_0x4f5eb6){_0x8ea6ae[_0xf381('0x82')]=_0x4f5eb6;return _0x8ea6ae;});}return _0x8ea6ae;});};exports['dirName']=function(){return __dirname;};
\ No newline at end of file
index 78223ad..f34544b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02ca=['exports','./nda'];(function(_0x16d3b6,_0x2205ce){var _0x371784=function(_0xb5493){while(--_0xb5493){_0x16d3b6['push'](_0x16d3b6['shift']());}};_0x371784(++_0x2205ce);}(_0x02ca,0x14d));var _0xa02c=function(_0x5b2e80,_0x47c872){_0x5b2e80=_0x5b2e80-0x0;var _0xdd14c=_0x02ca[_0x5b2e80];return _0xdd14c;};var nda=require(_0xa02c('0x0'));module[_0xa02c('0x1')]={'nda':nda};
\ No newline at end of file
+var _0x2bef=['./nda','exports'];(function(_0x2e5385,_0x174b1a){var _0x5c5f30=function(_0x51a3c8){while(--_0x51a3c8){_0x2e5385['push'](_0x2e5385['shift']());}};_0x5c5f30(++_0x174b1a);}(_0x2bef,0x194));var _0xf2be=function(_0x54f060,_0x1de751){_0x54f060=_0x54f060-0x0;var _0xb2b587=_0x2bef[_0x54f060];return _0xb2b587;};var nda=require(_0xf2be('0x0'));module[_0xf2be('0x1')]={'nda':nda};
\ No newline at end of file
index 1b2baf2..1364383 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bc5=['/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','access_token','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5bc5,0xb2));var _0x55bc=function(_0x484cac,_0x30ad3a){_0x484cac=_0x484cac-0x0;var _0x1d6e77=_0x5bc5[_0x484cac];return _0x1d6e77;};'use strict';var rp=require(_0x55bc('0x0'));var url=require(_0x55bc('0x1'));var logger=require(_0x55bc('0x2'))(_0x55bc('0x3'));module[_0x55bc('0x4')]=function(_0x2e077d,_0x2ebc5a){var _0x121201={'method':_0x55bc('0x5'),'uri':url[_0x55bc('0x6')](_0x2ebc5a[_0x55bc('0x7')],_0x55bc('0x8')),'form':{'grant_type':_0x55bc('0x9'),'username':_0x2ebc5a['username'],'password':_0x2ebc5a[_0x55bc('0x9')]},'json':!![]};return rp(_0x121201)[_0x55bc('0xa')](function(_0x2a612b){var _0x38839e={'method':'POST','uri':url[_0x55bc('0x6')](_0x2ebc5a[_0x55bc('0xb')],_0x55bc('0xc')),'body':{'type':_0x2ebc5a[_0x55bc('0xd')]||_0x55bc('0xe'),'channelId':_0x55bc('0xf'),'conversation':{'id':_0x2e077d[_0x55bc('0x10')]},'from':{'id':_0x2e077d[_0x55bc('0x11')],'name':_0x2e077d['calleridname']},'recipient':{'id':_0x2e077d[_0x55bc('0x12')],'name':_0x2e077d[_0x55bc('0x13')]},'text':_0x2ebc5a[_0x55bc('0x14')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x2a612b[_0x55bc('0x15')]},'json':!![]};if(_0x2ebc5a['project']){_0x38839e[_0x55bc('0x16')][_0x55bc('0x17')][_0x55bc('0x18')]=_0x2ebc5a['project'];}if(_0x2ebc5a[_0x55bc('0x19')]=='1'){_0x38839e['body'][_0x55bc('0x17')][_0x55bc('0x1a')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x55bc('0x1b')};}if(_0x2ebc5a['custom_action']){_0x38839e[_0x55bc('0x16')][_0x55bc('0x17')]['CustomAction']=_0x2ebc5a['custom_action'];if(_0x2ebc5a[_0x55bc('0x1c')]){_0x38839e['body']['channelData'][_0x55bc('0x1d')]=_0x2ebc5a[_0x55bc('0x1c')];}}logger[_0x55bc('0x1e')](JSON['stringify'](_0x38839e));return rp(_0x38839e);});};
\ No newline at end of file
+var _0x1a9e=['ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','exports','POST','ndauth_url','/token','password','username','then','resolve'];(function(_0x152449,_0x49f41d){var _0x5b58b2=function(_0x226c30){while(--_0x226c30){_0x152449['push'](_0x152449['shift']());}};_0x5b58b2(++_0x49f41d);}(_0x1a9e,0x122));var _0xe1a9=function(_0x13ac41,_0x110fa5){_0x13ac41=_0x13ac41-0x0;var _0x3c2fbd=_0x1a9e[_0x13ac41];return _0x3c2fbd;};'use strict';var rp=require(_0xe1a9('0x0'));var url=require('url');var logger=require(_0xe1a9('0x1'))('agi');module[_0xe1a9('0x2')]=function(_0x33969,_0x1f9a25){var _0x1a374c={'method':_0xe1a9('0x3'),'uri':url['resolve'](_0x1f9a25[_0xe1a9('0x4')],_0xe1a9('0x5')),'form':{'grant_type':_0xe1a9('0x6'),'username':_0x1f9a25[_0xe1a9('0x7')],'password':_0x1f9a25[_0xe1a9('0x6')]},'json':!![]};return rp(_0x1a374c)[_0xe1a9('0x8')](function(_0x56f64c){var _0x1337f8={'method':_0xe1a9('0x3'),'uri':url[_0xe1a9('0x9')](_0x1f9a25[_0xe1a9('0xa')],_0xe1a9('0xb')),'body':{'type':_0x1f9a25[_0xe1a9('0xc')]||'message','channelId':'Nda','conversation':{'id':_0x33969['uniqueid']},'from':{'id':_0x33969['callerid'],'name':_0x33969[_0xe1a9('0xd')]},'recipient':{'id':_0x33969[_0xe1a9('0xe')],'name':_0x33969[_0xe1a9('0xf')]},'text':_0x1f9a25[_0xe1a9('0x10')],'channelData':{}},'headers':{'Authorization':_0xe1a9('0x11')+_0x56f64c[_0xe1a9('0x12')]},'json':!![]};if(_0x1f9a25[_0xe1a9('0x13')]){_0x1337f8[_0xe1a9('0x14')][_0xe1a9('0x15')]['ProjectName']=_0x1f9a25[_0xe1a9('0x13')];}if(_0x1f9a25[_0xe1a9('0x16')]=='1'){_0x1337f8[_0xe1a9('0x14')]['channelData']['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe1a9('0x17')};}if(_0x1f9a25['custom_action']){_0x1337f8['body']['channelData'][_0xe1a9('0x18')]=_0x1f9a25[_0xe1a9('0x19')];if(_0x1f9a25[_0xe1a9('0x1a')]){_0x1337f8[_0xe1a9('0x14')][_0xe1a9('0x15')][_0xe1a9('0x1b')]=_0x1f9a25['custom_action_data'];}}logger[_0xe1a9('0x1c')](JSON[_0xe1a9('0x1d')](_0x1337f8));return rp(_0x1337f8);});};
\ No newline at end of file
index d0f6a34..8cebd5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-'use strict';var asr=require('./lib/api');module['exports']=function(_0x39512d,_0x37376a,_0x5bc111,_0x142840){return asr(_0x39512d,_0x37376a,_0x5bc111,_0x142840);};
\ No newline at end of file
+var _0x459f=['exports','./lib/api'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0x459f,0x1af));var _0xf459=function(_0x592787,_0x42a78a){_0x592787=_0x592787-0x0;var _0x16a846=_0x459f[_0x592787];return _0x16a846;};'use strict';var asr=require(_0xf459('0x0'));module[_0xf459('0x1')]=function(_0x19d451,_0x1f130a,_0x5e9da9,_0x25fb20){return asr(_0x19d451,_0x1f130a,_0x5e9da9,_0x25fb20);};
\ No newline at end of file
index 6c84557..5daa9c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8257=['transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','hypotheses'];(function(_0x4dbc3c,_0x15926d){var _0x106bfd=function(_0x386ea9){while(--_0x386ea9){_0x4dbc3c['push'](_0x4dbc3c['shift']());}};_0x106bfd(++_0x15926d);}(_0x8257,0x194));var _0x7825=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x8257[_0x5ecadc];return _0x565037;};'use strict';var BPromise=require(_0x7825('0x0'));var _=require(_0x7825('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7825('0x2'));var crypto=require(_0x7825('0x3'));var logger=require('../../../../../../config/logger')(_0x7825('0x4'));module[_0x7825('0x5')]=function(_0xce343c,_0xa0d858,_0x25cf31,_0x396be7){return new BPromise(function(_0x36cc7a,_0x4e38db){logger[_0x7825('0x6')](_0x7825('0x7'),_0x396be7||_0x7825('0x8'));var _0xcf0b7a=new WebSocket(_0x396be7||_0x7825('0x8'),{'perMessageDeflate':![]});var _0x2eb872='';var _0x50cda9='0';var _0x1b2b55='1';var _0x4ede4a='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x2c4653(_0x350911){var _0x11a228=crypto[_0x7825('0x9')](_0x7825('0xa'));_0x11a228[_0x7825('0xb')](_0x350911);return _0x11a228[_0x7825('0xc')]('hex');}function _0x211f03(){try{logger[_0x7825('0x6')](_0x7825('0xd'));var _0x17c175=moment()[_0x7825('0xe')]();var _0x4f5753=_0x2c4653(_0x17c175+_0xa0d858+_0x25cf31);_0xcf0b7a[_0x7825('0xf')](JSON[_0x7825('0x10')]({'appID':_0xa0d858,'timestamp':_0x17c175,'appKey':_0x4f5753}));var _0x138be7=fs['createReadStream'](_0xce343c);_0x138be7['on']('data',function(_0x3635ed){_0xcf0b7a[_0x7825('0xf')](_0x3635ed);});_0x138be7['on'](_0x7825('0x11'),function(){_0xcf0b7a['send'](_0x7825('0x12'));});}catch(_0x3167c4){logger[_0x7825('0x13')](_0x7825('0x14'),JSON[_0x7825('0x10')](_0x3167c4));_0xcf0b7a[_0x7825('0x15')]();}}function _0x340719(_0x402e86){try{if(_0x402e86){var _0xae7d36=JSON[_0x7825('0x16')](_0x402e86);switch(_0xae7d36['status']){case 0x0:if(_0xae7d36[_0x7825('0x17')]){if(_0xae7d36[_0x7825('0x17')]['final']){logger[_0x7825('0x6')]('Tilde\x20ASR\x20hypoteses',JSON['stringify'](_0xae7d36[_0x7825('0x17')][_0x7825('0x18')]));_0x2eb872=_0xae7d36[_0x7825('0x17')][_0x7825('0x18')][0x0][_0x7825('0x19')];_0x50cda9=_0xae7d36['result'][_0x7825('0x18')][0x0][_0x7825('0x1a')];_0x1b2b55='0';_0x4ede4a=_0x7825('0x1b');_0xcf0b7a[_0x7825('0x15')]();}}break;case 0x1:logger[_0x7825('0x6')](_0x7825('0x1c'));_0x1b2b55='1';_0x4ede4a=_0x7825('0x1c');break;case 0x2:logger['info'](_0x7825('0x1d'));_0x1b2b55='2';_0x4ede4a=_0x7825('0x1d');break;case 0x9:logger[_0x7825('0x6')](_0x7825('0x1e'));_0x1b2b55='9';_0x4ede4a='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info']('Authentication\x20failed.');_0x1b2b55='10';_0x4ede4a=_0x7825('0x1f');break;case 0xb:logger[_0x7825('0x6')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x1b2b55='11';_0x4ede4a=_0x7825('0x20');}}}catch(_0x34a022){logger[_0x7825('0x13')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x7825('0x10')](_0x34a022));_0xcf0b7a['terminate']();}}function _0xb95643(){logger['info'](_0x7825('0x21'));_0x36cc7a({'transcript':_0x2eb872,'confidence':_0x50cda9,'status':_0x1b2b55,'status_message':_0x4ede4a});}function _0x55a019(_0x56b985){logger[_0x7825('0x13')](_0x7825('0x22'));if(!_[_0x7825('0x23')](_0x56b985)){logger[_0x7825('0x13')](_[_0x7825('0x24')](_0x56b985)?JSON[_0x7825('0x10')](_0x56b985):_0x56b985);}}_0xcf0b7a['on'](_0x7825('0x25'),_0x211f03);_0xcf0b7a['on'](_0x7825('0x26'),_0x340719);_0xcf0b7a['on'](_0x7825('0x11'),_0xb95643);_0xcf0b7a['on']('error',_0x55a019);});};
\ No newline at end of file
+var _0xa6fd=['No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','result','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','bluebird','lodash','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE'];(function(_0x293a77,_0x3186da){var _0x3b4df=function(_0x1c2628){while(--_0x1c2628){_0x293a77['push'](_0x293a77['shift']());}};_0x3b4df(++_0x3186da);}(_0xa6fd,0x183));var _0xda6f=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0xa6fd[_0x3ee55a];return _0x581800;};'use strict';var BPromise=require(_0xda6f('0x0'));var _=require(_0xda6f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xda6f('0x2'));var crypto=require(_0xda6f('0x3'));var logger=require(_0xda6f('0x4'))('agi');module[_0xda6f('0x5')]=function(_0x5ac479,_0x4e86ec,_0x4ad349,_0x15e103){return new BPromise(function(_0x3169d4,_0x1c28e8){logger[_0xda6f('0x6')](_0xda6f('0x7'),_0x15e103||_0xda6f('0x8'));var _0x3c1a70=new WebSocket(_0x15e103||_0xda6f('0x8'),{'perMessageDeflate':![]});var _0xd9a6a7='';var _0x239869='0';var _0x531c7e='1';var _0x11c374=_0xda6f('0x9');function _0x53fc44(_0x2130bb){var _0x1b1586=crypto[_0xda6f('0xa')](_0xda6f('0xb'));_0x1b1586[_0xda6f('0xc')](_0x2130bb);return _0x1b1586[_0xda6f('0xd')]('hex');}function _0xfb4d3c(){try{logger['info'](_0xda6f('0xe'));var _0xcaac01=moment()[_0xda6f('0xf')]();var _0x46929d=_0x53fc44(_0xcaac01+_0x4e86ec+_0x4ad349);_0x3c1a70[_0xda6f('0x10')](JSON[_0xda6f('0x11')]({'appID':_0x4e86ec,'timestamp':_0xcaac01,'appKey':_0x46929d}));var _0x5d020e=fs['createReadStream'](_0x5ac479);_0x5d020e['on']('data',function(_0x20f8fb){_0x3c1a70['send'](_0x20f8fb);});_0x5d020e['on'](_0xda6f('0x12'),function(){_0x3c1a70['send'](_0xda6f('0x13'));});}catch(_0x4d1721){logger[_0xda6f('0x14')](_0xda6f('0x15'),JSON['stringify'](_0x4d1721));_0x3c1a70['terminate']();}}function _0x1787aa(_0x589613){try{if(_0x589613){var _0x28a504=JSON[_0xda6f('0x16')](_0x589613);switch(_0x28a504['status']){case 0x0:if(_0x28a504[_0xda6f('0x17')]){if(_0x28a504[_0xda6f('0x17')]['final']){logger[_0xda6f('0x6')](_0xda6f('0x18'),JSON[_0xda6f('0x11')](_0x28a504[_0xda6f('0x17')][_0xda6f('0x19')]));_0xd9a6a7=_0x28a504['result']['hypotheses'][0x0]['transcript'];_0x239869=_0x28a504[_0xda6f('0x17')][_0xda6f('0x19')][0x0]['likelihood'];_0x531c7e='0';_0x11c374=_0xda6f('0x1a');_0x3c1a70[_0xda6f('0x1b')]();}}break;case 0x1:logger['info'](_0xda6f('0x9'));_0x531c7e='1';_0x11c374='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xda6f('0x6')](_0xda6f('0x1c'));_0x531c7e='2';_0x11c374=_0xda6f('0x1c');break;case 0x9:logger[_0xda6f('0x6')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x531c7e='9';_0x11c374=_0xda6f('0x1d');break;case 0xa:logger['info'](_0xda6f('0x1e'));_0x531c7e='10';_0x11c374=_0xda6f('0x1e');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x531c7e='11';_0x11c374='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0xe00d67){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON[_0xda6f('0x11')](_0xe00d67));_0x3c1a70['terminate']();}}function _0x297351(){logger[_0xda6f('0x6')](_0xda6f('0x1f'));_0x3169d4({'transcript':_0xd9a6a7,'confidence':_0x239869,'status':_0x531c7e,'status_message':_0x11c374});}function _0x2b917b(_0x3818fb){logger[_0xda6f('0x14')](_0xda6f('0x20'));if(!_['isNil'](_0x3818fb)){logger[_0xda6f('0x14')](_[_0xda6f('0x21')](_0x3818fb)?JSON['stringify'](_0x3818fb):_0x3818fb);}}_0x3c1a70['on'](_0xda6f('0x22'),_0xfb4d3c);_0x3c1a70['on'](_0xda6f('0x23'),_0x1787aa);_0x3c1a70['on'](_0xda6f('0x12'),_0x297351);_0x3c1a70['on'](_0xda6f('0x14'),_0x2b917b);});};
\ No newline at end of file
index d201b75..7011f02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa01d=['./asr','exports'];(function(_0x3153c9,_0x3ce2de){var _0x4c445f=function(_0x46f0f0){while(--_0x46f0f0){_0x3153c9['push'](_0x3153c9['shift']());}};_0x4c445f(++_0x3ce2de);}(_0xa01d,0x1ec));var _0xda01=function(_0x1f608f,_0x4adb5f){_0x1f608f=_0x1f608f-0x0;var _0x4854b1=_0xa01d[_0x1f608f];return _0x4854b1;};var asr=require(_0xda01('0x0'));module[_0xda01('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x6cb9=['./asr'];(function(_0x2c60ca,_0x34b828){var _0x5ade9c=function(_0x3a71e9){while(--_0x3a71e9){_0x2c60ca['push'](_0x2c60ca['shift']());}};_0x5ade9c(++_0x34b828);}(_0x6cb9,0x74));var _0x96cb=function(_0x17655c,_0x418ca6){_0x17655c=_0x17655c-0x0;var _0x5aa4d0=_0x6cb9[_0x17655c];return _0x5aa4d0;};var asr=require(_0x96cb('0x0'));module['exports']={'asr':asr};
\ No newline at end of file
index 1d5ae9a..44e3aad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3ee6=['./channel','127.0.0.1','call','error','createServer','emit','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','code','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','EventEmitter','./error'];(function(_0x8745ff,_0xea4330){var _0x56c64f=function(_0x262814){while(--_0x262814){_0x8745ff['push'](_0x8745ff['shift']());}};_0x56c64f(++_0xea4330);}(_0x3ee6,0x9c));var _0x63ee=function(_0x4eae32,_0x4e210f){_0x4eae32=_0x4eae32-0x0;var _0x35a83c=_0x3ee6[_0x4eae32];return _0x35a83c;};'use strict';var util=require(_0x63ee('0x0'));var net=require(_0x63ee('0x1'));var EventEmitter=require(_0x63ee('0x2'))[_0x63ee('0x3')];var AGIError=require(_0x63ee('0x4'));var AGIChannel=require(_0x63ee('0x5'));var AGIServer=function(_0xb7260f,_0x4ae861,_0x2f3183){var _0x4baaab=this,_0xb7260f=_0xb7260f||0x11dd,_0x4ae861=_0x4ae861||_0x63ee('0x6'),_0x4489bf=null,_0x43be79=0x0;EventEmitter[_0x63ee('0x7')](_0x4baaab);function _0x98eec8(){if(!_0xb7260f){_0x4baaab['emit'](_0x63ee('0x8'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x4489bf=net[_0x63ee('0x9')]();_0x4489bf['listen'](_0xb7260f,_0x4ae861);_0x4489bf['on']('listening',function(){_0x4baaab[_0x63ee('0xa')]('listening');});_0x4489bf['on']('connection',function(_0x25d2f5){_0x4489bf[_0x63ee('0xb')](function(_0x2b93ea,_0x104e28){if(_0x2b93ea){_0x4baaab[_0x63ee('0xa')]('error',new AGIError(_0x63ee('0xc'),_0x2b93ea));}else if(_0x2f3183&&_0x2f3183<0x0){_0x4baaab['emit'](_0x63ee('0x8'),new AGIError(_0x63ee('0xd')));_0x25d2f5[_0x63ee('0xe')]();}else if(_0x2f3183&&_0x2f3183>0x0&&_0x2f3183<_0x104e28){_0x43be79+=0x1;_0x4baaab[_0x63ee('0xa')](_0x63ee('0x8'),new AGIError(_0x63ee('0xf'),_0x43be79));_0x25d2f5[_0x63ee('0xe')]();}else{var _0x484230=new AGIChannel(_0x25d2f5);_0x484230['on'](_0x63ee('0x10'),function(){_0x4baaab[_0x63ee('0xa')](_0x63ee('0x11'),_0x484230);});}});});_0x4489bf['on'](_0x63ee('0x8'),function(_0xdc4db1){_0x4baaab[_0x63ee('0xa')]('error',new AGIError('E_AGI_SERVER_ERROR',_0xdc4db1[_0x63ee('0x12')]));});_0x4489bf['on']('close',function(){_0x4baaab['emit'](_0x63ee('0x13'),new AGIError(_0x63ee('0x14')));});}process['nextTick'](function(){_0x98eec8();});};util[_0x63ee('0x15')](AGIServer,EventEmitter);module[_0x63ee('0x16')]=function(_0x6a2035,_0x2d1a61,_0x5539df){return new AGIServer(_0x6a2035,_0x2d1a61,_0x5539df);};
\ No newline at end of file
+var _0xc794=['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','E_AGI_SERVER_MAXCONNECTION','destroy','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./channel'];(function(_0x523315,_0x11b8f5){var _0x2715ac=function(_0x38dc0e){while(--_0x38dc0e){_0x523315['push'](_0x523315['shift']());}};_0x2715ac(++_0x11b8f5);}(_0xc794,0x91));var _0x4c79=function(_0x1f8d0c,_0x2ecdf6){_0x1f8d0c=_0x1f8d0c-0x0;var _0x4af449=_0xc794[_0x1f8d0c];return _0x4af449;};'use strict';var util=require(_0x4c79('0x0'));var net=require(_0x4c79('0x1'));var EventEmitter=require(_0x4c79('0x2'))[_0x4c79('0x3')];var AGIError=require('./error');var AGIChannel=require(_0x4c79('0x4'));var AGIServer=function(_0x554c13,_0x25c90a,_0x254bff){var _0x23afb5=this,_0x554c13=_0x554c13||0x11dd,_0x25c90a=_0x25c90a||_0x4c79('0x5'),_0x355d64=null,_0x693f6e=0x0;EventEmitter[_0x4c79('0x6')](_0x23afb5);function _0x4bede9(){if(!_0x554c13){_0x23afb5[_0x4c79('0x7')](_0x4c79('0x8'),new AGIError(_0x4c79('0x9')));return![];}_0x355d64=net[_0x4c79('0xa')]();_0x355d64[_0x4c79('0xb')](_0x554c13,_0x25c90a);_0x355d64['on'](_0x4c79('0xc'),function(){_0x23afb5[_0x4c79('0x7')](_0x4c79('0xc'));});_0x355d64['on'](_0x4c79('0xd'),function(_0x4a3eeb){_0x355d64[_0x4c79('0xe')](function(_0x253b56,_0x4eaf7e){if(_0x253b56){_0x23afb5['emit'](_0x4c79('0x8'),new AGIError(_0x4c79('0xf'),_0x253b56));}else if(_0x254bff&&_0x254bff<0x0){_0x23afb5[_0x4c79('0x7')]('error',new AGIError(_0x4c79('0x10')));_0x4a3eeb['destroy']();}else if(_0x254bff&&_0x254bff>0x0&&_0x254bff<_0x4eaf7e){_0x693f6e+=0x1;_0x23afb5[_0x4c79('0x7')](_0x4c79('0x8'),new AGIError(_0x4c79('0x11'),_0x693f6e));_0x4a3eeb[_0x4c79('0x12')]();}else{var _0x255ede=new AGIChannel(_0x4a3eeb);_0x255ede['on'](_0x4c79('0x13'),function(){_0x23afb5[_0x4c79('0x7')](_0x4c79('0xd'),_0x255ede);});}});});_0x355d64['on'](_0x4c79('0x8'),function(_0x4a9690){_0x23afb5[_0x4c79('0x7')](_0x4c79('0x8'),new AGIError(_0x4c79('0xf'),_0x4a9690['code']));});_0x355d64['on'](_0x4c79('0x14'),function(){_0x23afb5[_0x4c79('0x7')](_0x4c79('0x14'),new AGIError(_0x4c79('0x15')));});}process[_0x4c79('0x16')](function(){_0x4bede9();});};util[_0x4c79('0x17')](AGIServer,EventEmitter);module[_0x4c79('0x18')]=function(_0x321c57,_0x265da6,_0x415c29){return new AGIServer(_0x321c57,_0x265da6,_0x415c29);};
\ No newline at end of file
index 8757563..57f8e55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d3d=['%s.%s','setVariable','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','list_id','no\x20list\x20selected','add','delay','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','createSquareMessage','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','private_key','dialogflowV2_language','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','sestekNDA','SESTEK_NDA_%s','out','sesteknda','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','NOBEEP','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','beep','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','menu','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','digit','output','no\x20find\x20by\x20configured','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','gosub','Executed\x20command\x20%s\x20%s','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','sayDigits','digits','replace','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','bcc','subject','service','host','port','authentication','auth','user','sendMail\x20message','account_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','debug','Trying\x20SendSMS\x20with\x20account\x20%s','createSmsMessage','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','127.0.0.1','AGI','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','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','path','util','lodash','odbc','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getMailAccount','getMailAccountById','sendMailMessage','interval','Intervals','getSoundPath','format','%s/sounds/converted/%s','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','error','getSmsAccount','getSmsAccountById','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','context','extension','priority','accountcode','dnid','file','createCmContact','callback_','random','isEmpty','lastName','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','getPause','getPauseById','agent','agentPause','isNil','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','toUpperCase','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','body','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','googleASR','google_asr_language','tildeASR','clear','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','saveRestApiResult'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6d3d,0x12e));var _0xd6d3=function(_0x14b22d,_0x3a2533){_0x14b22d=_0x14b22d-0x0;var _0x2fc88f=_0x6d3d[_0x14b22d];return _0x2fc88f;};'use strict';var fs=require('fs');var path=require(_0xd6d3('0x0'));var util=require(_0xd6d3('0x1'));var _=require(_0xd6d3('0x2'));var sh=require('shelljs');var odbc=require(_0xd6d3('0x3'))();var rs=require('randomstring');var moment=require(_0xd6d3('0x4'));var Mustache=require(_0xd6d3('0x5'));var rp=require(_0xd6d3('0x6'));var logger=require(_0xd6d3('0x7'))(_0xd6d3('0x8'));var config=require(_0xd6d3('0x9'));var scripts=require(_0xd6d3('0xa'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xd6d3('0xb'),_0xd6d3('0xc')];var verticesWithRetry=['menu',_0xd6d3('0xd'),_0xd6d3('0xe')];var AGIVertices=function(_0x420833,_0x44f44a,_0x39e089){this[_0xd6d3('0xf')]=_0x420833;this[_0xd6d3('0x10')]=_0x44f44a;this[_0xd6d3('0x11')]=_0x39e089;};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x13')]=function(_0x510cca,_0x256479){this[_0xd6d3('0x10')][_0xd6d3('0x14')](_0x510cca)[_0xd6d3('0x15')](function(_0x17022e){_0x256479(null,_0x17022e?_0x17022e[_0xd6d3('0x16')]:![]);})[_0xd6d3('0x17')](function(_0x5f3d19){_0x256479(_0x5f3d19);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x18')]=function(_0x588656,_0x387169){this[_0xd6d3('0x10')][_0xd6d3('0x19')](_0x588656)['then'](function(_0x4d384){_0x387169(null,_0x4d384?_0x4d384[_0xd6d3('0x16')]:![]);})[_0xd6d3('0x17')](function(_0x5985f4){_0x387169(_0x5985f4);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x1a')]=function(_0x4f09eb,_0x4d40ac){this[_0xd6d3('0x10')]['getSquareProjectById'](_0x4f09eb)[_0xd6d3('0x15')](function(_0x3f2689){_0x4d40ac(null,_0x3f2689?_0x3f2689['name']:![]);})[_0xd6d3('0x17')](function(_0x4e1306){_0x4d40ac(_0x4e1306);});};AGIVertices['prototype'][_0xd6d3('0x1b')]=function(_0x1fe531,_0x297107){this[_0xd6d3('0x10')][_0xd6d3('0x1c')](_0x1fe531)[_0xd6d3('0x15')](function(_0x1b7790){_0x297107(null,_0x1b7790?_0x1b7790[_0xd6d3('0x1d')]:![]);})[_0xd6d3('0x17')](function(_0x29ea2f){_0x297107(_0x29ea2f);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x1e')]=function(_0x548cce,_0x3b7d3d){this['rpc'][_0xd6d3('0x1f')](_0x548cce)[_0xd6d3('0x15')](function(_0x17fdc9){_0x3b7d3d(null,_0x17fdc9?_0x17fdc9[_0xd6d3('0x16')]:![]);})[_0xd6d3('0x17')](function(_0x1baf32){_0x3b7d3d(_0x1baf32);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x20')]=function(_0x150804,_0x5f016f){this[_0xd6d3('0x10')][_0xd6d3('0x21')](_0x150804)[_0xd6d3('0x15')](function(_0x13b03e){_0x5f016f(null,_0x13b03e?_0x13b03e[_0xd6d3('0x16')]:![]);})[_0xd6d3('0x17')](function(_0x10b574){_0x5f016f(_0x10b574);});};AGIVertices['prototype'][_0xd6d3('0x22')]=function(_0x8dce69,_0x590987){var _0x1aee22=this;this[_0xd6d3('0x10')][_0xd6d3('0x23')](_0x8dce69)[_0xd6d3('0x15')](function(_0xe454ef){_0x590987(null,_0xe454ef?_0x1aee22['getSoundPath'](_0xe454ef['save_name']):![]);})[_0xd6d3('0x17')](function(_0x933863){_0x590987(_0x933863);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x24')]=function(_0x5ca20c,_0x2b209e){this['rpc'][_0xd6d3('0x25')](_0x5ca20c)[_0xd6d3('0x15')](function(_0x583ed1){_0x2b209e(null,_0x583ed1?_0x583ed1:![]);})[_0xd6d3('0x17')](function(_0x4b0e76){_0x2b209e(_0x4b0e76);});};AGIVertices[_0xd6d3('0x12')]['sendMailMessage']=function(_0x535592,_0x3f9396,_0x27f298){this[_0xd6d3('0x11')][_0xd6d3('0x26')](_0x535592,_0x3f9396)[_0xd6d3('0x15')](function(){_0x27f298(null);})[_0xd6d3('0x17')](function(_0x338908){_0x27f298(_0x338908);});};AGIVertices[_0xd6d3('0x12')]['getIntervals']=function(_0x1a00f5,_0x3e39f3){this['rpc']['getIntervalById'](_0x1a00f5)['then'](function(_0x4531ea){if(_0x4531ea){if(_0x4531ea['IntervalId']){_0x3e39f3(null,[_0x4531ea[_0xd6d3('0x27')]]);}else{_0x3e39f3(null,_['map'](_0x4531ea[_0xd6d3('0x28')],_0xd6d3('0x27')));}}else{_0x3e39f3(null,![]);}})['catch'](function(_0xdb9cec){_0x3e39f3(_0xdb9cec);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x29')]=function(_0x3e0269){return util[_0xd6d3('0x2a')](_0xd6d3('0x2b'),FILES_PATH,_0x3e0269);};AGIVertices[_0xd6d3('0x12')]['getQueryOdbc']=function(_0x513219,_0x58517d,_0x41dc4a){odbc['open'](_0x513219,function(_0x12ca2e){if(_0x12ca2e){logger['error'](_0xd6d3('0x2c'),_0x12ca2e);_0x41dc4a(_0x12ca2e);}else{logger[_0xd6d3('0x2d')](_0xd6d3('0x2e'));odbc[_0xd6d3('0x2f')](_0x58517d,function(_0x1b27fb,_0x49cb6e){if(_0x1b27fb){logger[_0xd6d3('0x2d')](_0xd6d3('0x30'),_0x58517d);_0x41dc4a(_0x1b27fb);}else{logger[_0xd6d3('0x2d')](_0xd6d3('0x31'),_0x58517d);odbc[_0xd6d3('0x32')](function(_0x3eafc1){if(_0x3eafc1){logger[_0xd6d3('0x33')]('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x3eafc1);}_0x41dc4a(null,_0x49cb6e);});}});}});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x34')]=function(_0x866ee7,_0xc4d0d3){this[_0xd6d3('0x10')][_0xd6d3('0x35')](_0x866ee7)[_0xd6d3('0x15')](function(_0x33c671){_0xc4d0d3(null,_0x33c671?_0x33c671:![]);})[_0xd6d3('0x17')](function(_0x1a5796){_0xc4d0d3(_0x1a5796);});};AGIVertices['prototype']['createSmsMessage']=function(_0x23648,_0x517240){this[_0xd6d3('0x10')]['createSmsMessage'](_0x23648)[_0xd6d3('0x15')](function(_0x524136){_0x517240(null,_0x524136);})[_0xd6d3('0x17')](function(_0x30334a){_0x517240(_0x30334a);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x36')]=function(_0x5b1911,_0x4e676a,_0x4c2140){this[_0xd6d3('0x10')][_0xd6d3('0x36')]({'uniqueid':this['channel']['uniqueid'],'node':_0x5b1911[_0xd6d3('0x37')],'application':_0x5b1911[_0xd6d3('0x38')],'data':_0x4e676a||null,'project_name':this['channel'][_0xd6d3('0x39')],'callerid':this['channel'][_0xd6d3('0x3a')]})[_0xd6d3('0x15')](function(_0x390459){if(_0x4c2140){_0x4c2140(null,_0x390459);}})[_0xd6d3('0x17')](function(_0x2dec49){if(_0x4c2140){_0x4c2140(_0x2dec49);}});};AGIVertices['prototype'][_0xd6d3('0x3b')]=function(_0x5e18c6,_0x25dd7c,_0x297da5,_0x1f9fda){this[_0xd6d3('0x10')][_0xd6d3('0x3b')]({'uniqueid':this[_0xd6d3('0xf')][_0xd6d3('0x3c')],'callerid':this[_0xd6d3('0xf')][_0xd6d3('0x3a')],'calleridname':this[_0xd6d3('0xf')]['calleridname'],'context':this[_0xd6d3('0xf')][_0xd6d3('0x3d')],'extension':this[_0xd6d3('0xf')][_0xd6d3('0x3e')],'priority':this[_0xd6d3('0xf')][_0xd6d3('0x3f')],'accountcode':this['channel'][_0xd6d3('0x40')],'dnid':this[_0xd6d3('0xf')][_0xd6d3('0x41')],'projectName':this['channel'][_0xd6d3('0x39')],'saveName':_0x25dd7c,'filename':_0x5e18c6[_0xd6d3('0x42')]||_0x25dd7c,'savePath':_0x297da5})[_0xd6d3('0x15')](function(_0x2e9a38){_0x1f9fda(null,_0x2e9a38);})[_0xd6d3('0x17')](function(_0x278659){_0x1f9fda(_0x278659);});};AGIVertices[_0xd6d3('0x12')]['createSquareMessage']=function(_0x38c4de,_0x1b8388,_0x29d1c7,_0x27e7d5,_0x548d07){this[_0xd6d3('0x10')]['createSquareMessage']({'uniqueid':this[_0xd6d3('0xf')][_0xd6d3('0x3c')],'body':_0x38c4de,'direction':_0x1b8388,'providerName':_0x29d1c7,'providerResponse':_0x27e7d5})[_0xd6d3('0x15')](function(_0x170cad){if(_0x548d07){_0x548d07(null,_0x170cad);}})[_0xd6d3('0x17')](function(_0x4edde4){if(_0x548d07){_0x548d07(_0x4edde4);}});};AGIVertices[_0xd6d3('0x12')]['createCmContact']=function(_0x56d14a,_0x1acb95){this[_0xd6d3('0x10')][_0xd6d3('0x43')]({'firstName':_['isEmpty'](_0x56d14a[_0xd6d3('0x16')])||_['isNil'](_0x56d14a['name'])?_0xd6d3('0x44')+Math[_0xd6d3('0x45')]():_0x56d14a['name'],'lastName':_[_0xd6d3('0x46')](_0x56d14a[_0xd6d3('0x47')])||_['isNil'](_0x56d14a['lastName'])?null:_0x56d14a['lastName'],'phone':_0x56d14a['phone'],'ListId':_0x56d14a['list_id'],'scheduledat':_0x56d14a[_0xd6d3('0x48')],'callbackUniqueid':this['channel'][_0xd6d3('0x3c')],'tags':_0xd6d3('0x49'),'description':_0xd6d3('0x4a')+_0x56d14a[_0xd6d3('0x48')][_0xd6d3('0x4b')](),'priority':_0x56d14a['callback_priority']})['then'](function(_0x3f2c9d){_0x1acb95(null,_0x3f2c9d);})[_0xd6d3('0x17')](function(_0x187506){_0x1acb95(_0x187506);});};AGIVertices['prototype'][_0xd6d3('0x4c')]=function(_0x555013,_0x5182ff){this[_0xd6d3('0x10')][_0xd6d3('0x4d')](_0x555013)['then'](function(_0x4896a0){_0x5182ff(null,_0x4896a0?_0x4896a0[_0xd6d3('0x16')]:![]);})[_0xd6d3('0x17')](function(_0x3146cd){_0x5182ff(_0x3146cd);});};AGIVertices[_0xd6d3('0x12')]['agentPause']=function(_0x11be4f,_0x1604a0,_0x3338f5){var _0x124317={'role':_0xd6d3('0x4e')};_0x124317[_0x11be4f]=this[_0xd6d3('0xf')][_0xd6d3('0x3a')];this[_0xd6d3('0x10')][_0xd6d3('0x4f')](_0x124317,_0x1604a0,this['channel'][_0xd6d3('0x3c')])[_0xd6d3('0x15')](function(_0x568ea2){_0x3338f5(null,_[_0xd6d3('0x50')](_0x568ea2)?![]:!![]);})[_0xd6d3('0x17')](function(_0x5bf49a){logger[_0xd6d3('0x33')](_0x5bf49a);_0x3338f5(null,![]);});};AGIVertices[_0xd6d3('0x12')]['agentUnpause']=function(_0x160934,_0x150a71){var _0x1199c7={'role':'agent'};_0x1199c7[_0x160934]=this[_0xd6d3('0xf')][_0xd6d3('0x3a')];this[_0xd6d3('0x10')][_0xd6d3('0x51')](_0x1199c7)[_0xd6d3('0x15')](function(_0x74afe6){_0x150a71(null,_[_0xd6d3('0x50')](_0x74afe6)?![]:!![]);})['catch'](function(_0x4a2c31){logger[_0xd6d3('0x33')](_0x4a2c31);_0x150a71(null,![]);});};AGIVertices['prototype'][_0xd6d3('0x52')]=function(_0x4d86fd,_0x54d418){var _0x246dce={'role':'agent'};_0x246dce[_0x4d86fd]=this[_0xd6d3('0xf')][_0xd6d3('0x3a')];this[_0xd6d3('0x10')]['agentLogout'](_0x246dce)['then'](function(_0x14348b){_0x54d418(null,_[_0xd6d3('0x50')](_0x14348b)?![]:!![]);})[_0xd6d3('0x17')](function(_0x2c27c7){logger['error'](_0x2c27c7);_0x54d418(null,![]);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x53')]=function(_0x1d51ac,_0x2cdd25){var _0x33286d={'role':_0xd6d3('0x4e')};_0x33286d[_0x1d51ac]=this[_0xd6d3('0xf')][_0xd6d3('0x3a')];var _0x231511=_0x1d51ac!=_0xd6d3('0x54')?util[_0xd6d3('0x2a')](_0xd6d3('0x55'),_0xd6d3('0x56'),this['channel'][_0xd6d3('0x3a')]):undefined;this[_0xd6d3('0x10')][_0xd6d3('0x53')](_0x33286d,_0x231511)['then'](function(_0x577fb9){_0x2cdd25(null,_[_0xd6d3('0x50')](_0x577fb9)?![]:!![]);})['catch'](function(_0x1f49ce){logger[_0xd6d3('0x33')](_0x1f49ce);_0x2cdd25(null,![]);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x57')]=function(_0x2b95a6,_0x34808d){sh[_0xd6d3('0x58')](_[_0xd6d3('0x59')](_0x2b95a6),function(_0x55a142,_0x28b180){var _0x24f86e=_0x28b180['replace'](/(\r\n|\n|\r)/gm,'');_0x34808d(null,_0x24f86e);});};AGIVertices['prototype'][_0xd6d3('0x5a')]=function(_0x245a0d,_0x48fdfb){scripts[_0xd6d3('0x5a')](_0x245a0d[_0xd6d3('0x5b')],_0x245a0d[_0xd6d3('0x5c')]||_0xd6d3('0x5d'),_0x245a0d[_0xd6d3('0x5d')],_0x245a0d[_0xd6d3('0x5e')]||_0xd6d3('0x5f'),_0x245a0d[_0xd6d3('0x60')]||_0xd6d3('0x61'),_0x245a0d[_0xd6d3('0x62')]||_0xd6d3('0x63'))[_0xd6d3('0x15')](function(_0x4b1506){_0x48fdfb(null,_0x4b1506);})[_0xd6d3('0x17')](function(_0x2b8f12){_0x48fdfb(_0x2b8f12);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x64')]=function(_0x4816f6,_0x3acda7){scripts[_0xd6d3('0x64')](_0x4816f6[_0xd6d3('0x5d')],_0x4816f6[_0xd6d3('0x65')]||'en',0x1)['then'](function(_0x30f0bc){_0x3acda7(null,_0x30f0bc);})[_0xd6d3('0x17')](function(_0x445740){_0x3acda7(_0x445740);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x66')]=function(_0x3ff6c9,_0x565ca9){var _0x5bbd0e={'uri':_0x3ff6c9[_0xd6d3('0x67')],'method':_0x3ff6c9[_0xd6d3('0x68')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3ff6c9[_0xd6d3('0x69')])===_0xd6d3('0x6a')&&parseInt(_0x3ff6c9[_0xd6d3('0x69')])>=0x1?parseInt(_0x3ff6c9[_0xd6d3('0x69')])*0x3e8:0x5*0x3e8};if(_[_0xd6d3('0x6b')]([_0xd6d3('0x6c'),'PUT'],_0x5bbd0e['method'][_0xd6d3('0x6d')]())){try{_0x5bbd0e['body']=_0x3ff6c9['rawBody']?JSON[_0xd6d3('0x6e')](_0x3ff6c9['rawBody']):{};}catch(_0x2adefe){logger[_0xd6d3('0x33')](_0xd6d3('0x6f'),_0x2adefe);}}try{_0x5bbd0e[_0xd6d3('0x70')]=_0x3ff6c9[_0xd6d3('0xb')]?JSON[_0xd6d3('0x6e')](_0x3ff6c9[_0xd6d3('0xb')]):{};}catch(_0x343c76){logger[_0xd6d3('0x33')](_0xd6d3('0x71'),_0x343c76);}if(_0x3ff6c9[_0xd6d3('0x72')]){try{var _0x731ca6=require(_0x3ff6c9[_0xd6d3('0x72')])[_0xd6d3('0x73')](this,_0x5bbd0e);_0x5bbd0e[_0xd6d3('0x74')]=Mustache[_0xd6d3('0x75')](_0x3ff6c9[_0xd6d3('0x67')],_0x731ca6,{},['$$','$$']);if(_0x5bbd0e[_0xd6d3('0x70')]){_0x5bbd0e['headers']=JSON[_0xd6d3('0x6e')](Mustache[_0xd6d3('0x75')](JSON[_0xd6d3('0x76')](_0x5bbd0e[_0xd6d3('0x70')]),_0x731ca6,{},['$$','$$']));}if(_0x5bbd0e['body']){_0x5bbd0e[_0xd6d3('0x77')]=JSON[_0xd6d3('0x6e')](Mustache[_0xd6d3('0x75')](JSON[_0xd6d3('0x76')](_0x5bbd0e[_0xd6d3('0x77')]),_0x731ca6,{},['$$','$$']));}}catch(_0x153d3e){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x153d3e);}}rp(_0x5bbd0e)[_0xd6d3('0x15')](function(_0x3fc2aa){var _0x4f10fd={'statusCode':_0x3fc2aa[_0xd6d3('0x78')]||0xc8,'statusMessage':_0x3fc2aa[_0xd6d3('0x79')]||'OK','headers':_0x3fc2aa['headers']||{},'body':_0x3fc2aa[_0xd6d3('0x77')]||{}};_0x565ca9(null,_0x4f10fd);})[_0xd6d3('0x17')](function(_0x2cee93){var _0x5c9d97={'statusCode':_0x2cee93[_0xd6d3('0x78')]||0x1f4,'statusMessage':_0x2cee93[_0xd6d3('0x7a')]||_0xd6d3('0x7b'),'headers':_0x2cee93[_0xd6d3('0x7c')]['headers']||{},'body':_0x2cee93[_0xd6d3('0x7c')][_0xd6d3('0x77')]||{}};_0x565ca9(null,_0x5c9d97);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x7d')]=function(_0x100d45,_0x2c1673){scripts['googleDialogflow'](this['channel'][_0xd6d3('0x3c')],_0x100d45[_0xd6d3('0x7e')],_0x100d45['text'],_0x100d45[_0xd6d3('0x7f')]||'en')[_0xd6d3('0x15')](function(_0x1e93ba){_0x2c1673(null,_0x1e93ba);})[_0xd6d3('0x17')](function(_0x31500e){_0x2c1673(_0x31500e);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x80')]=function(_0x53ad20,_0x240e85){scripts['googleDialogflowV2'](this['channel'][_0xd6d3('0x3c')],_0x53ad20[_0xd6d3('0x81')],_0x53ad20[_0xd6d3('0x82')],_0x53ad20['private_key'],_0x53ad20['text'],_0x53ad20['dialogflowV2_language']||'en')[_0xd6d3('0x15')](function(_0x194ade){_0x240e85(null,_0x194ade);})[_0xd6d3('0x17')](function(_0x5a0678){_0x240e85(_0x5a0678);});};AGIVertices[_0xd6d3('0x12')]['sestekNDA']=function(_0x3f09da,_0x4e3f12){scripts['sestekNDA'](this[_0xd6d3('0xf')],_0x3f09da)[_0xd6d3('0x15')](function(_0x277923){_0x4e3f12(null,_0x277923);})[_0xd6d3('0x17')](function(_0x9f35e2){_0x4e3f12(_0x9f35e2);});};AGIVertices['prototype'][_0xd6d3('0x83')]=function(_0x2d4b76,_0x2bed76){scripts[_0xd6d3('0x83')](_0x2d4b76[_0xd6d3('0x7e')],_0x2d4b76[_0xd6d3('0x5d')],_0x2d4b76[_0xd6d3('0x84')]||_0xd6d3('0x5f'),_0x2d4b76['speed'])[_0xd6d3('0x15')](function(_0x533ad2){_0x2bed76(null,_0x533ad2);})[_0xd6d3('0x17')](function(_0x361c9a){_0x2bed76(_0x361c9a);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x85')]=function(_0x26d925,_0x57a6d2,_0x1cccd1){scripts['ispeechASR'](_0x57a6d2,_0x26d925[_0xd6d3('0x7e')],_0x26d925[_0xd6d3('0x86')]||_0xd6d3('0x5f'),this[_0xd6d3('0x87')](_0x26d925['model'])?_0x26d925[_0xd6d3('0x88')]:undefined)[_0xd6d3('0x15')](function(_0xeaefef){_0x1cccd1(null,_0xeaefef);})[_0xd6d3('0x17')](function(_0x264e79){_0x1cccd1(_0x264e79);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x89')]=function(_0x23032f,_0x1f7bee){scripts[_0xd6d3('0x89')](_0x23032f['aws_access_key_id'],_0x23032f[_0xd6d3('0x8a')],_0x23032f[_0xd6d3('0x8b')],_0x23032f['aws_polly_voice']||_0xd6d3('0x8c'),_0x23032f[_0xd6d3('0x5d')],_0x23032f[_0xd6d3('0x8d')]||_0xd6d3('0x5d'))[_0xd6d3('0x15')](function(_0x1d3b25){_0x1f7bee(null,_0x1d3b25);})[_0xd6d3('0x17')](function(_0x517ba6){_0x1f7bee(_0x517ba6);});};AGIVertices[_0xd6d3('0x12')]['awsLex']=function(_0x207883,_0x1f64ac){scripts[_0xd6d3('0x8e')](this[_0xd6d3('0xf')]['uniqueid'],_0x207883[_0xd6d3('0x8f')],_0x207883[_0xd6d3('0x8a')],_0x207883[_0xd6d3('0x90')],_0x207883[_0xd6d3('0x5d')],_0x207883['aws_bot_name'])['then'](function(_0x3553cd){_0x1f64ac(null,_0x3553cd);})[_0xd6d3('0x17')](function(_0x31701e){_0x1f64ac(_0x31701e);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x91')]=function(_0x5071ce,_0x50f730,_0x183d50){scripts[_0xd6d3('0x91')](_0x50f730,_0x5071ce[_0xd6d3('0x7e')],_0x5071ce[_0xd6d3('0x92')]||_0xd6d3('0x5f'))[_0xd6d3('0x15')](function(_0x1745ae){_0x183d50(null,_0x1745ae);})['catch'](function(_0x49c8cb){_0x183d50(_0x49c8cb);});};AGIVertices['prototype']['tildeASR']=function(_0x3bf4e8,_0x3d2579,_0x13bd8b){scripts[_0xd6d3('0x93')](_0x3d2579,_0x3bf4e8['appid'],_0x3bf4e8['appsecret'],_0x3bf4e8[_0xd6d3('0x74')])['then'](function(_0x1b920f){_0x13bd8b(null,_0x1b920f);})[_0xd6d3('0x17')](function(_0x5234da){_0x13bd8b(_0x5234da);});};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x94')]=function(_0x484827){var _0x494431=_[_0xd6d3('0x6b')](verticesWithRetry,_0x484827[_0xd6d3('0x38')])?_0x484827:_[_0xd6d3('0x95')](_0x484827);for(var _0x585257 in _0x494431){if(_0x494431[_0xd6d3('0x96')](_0x585257)){if(_0x494431[_0x585257]&&_['isString'](_0x494431[_0x585257])){if(_[_0xd6d3('0x6b')](recursiveMapAttributes,_0x585257)){_0x494431[_0x585257]=this[_0xd6d3('0x97')](_0x494431[_0x585257]);}else{_0x494431[_0x585257]=this[_0xd6d3('0x98')](_0x494431[_0x585257]);}}}}return _0x494431;};AGIVertices['prototype'][_0xd6d3('0x99')]=function(_0x46d939){for(var _0x41f713 in _0x46d939){if(_0x46d939[_0xd6d3('0x96')](_0x41f713)){if(_[_0xd6d3('0x9a')](_0x46d939[_0x41f713])){this['recursiveNodeIndex'](_0x46d939[_0x41f713]);}else if(_[_0xd6d3('0x9b')](_0x46d939[_0x41f713])){for(var _0x3c0f68=0x0;_0x3c0f68<_0x46d939[_0x41f713][_0xd6d3('0x9c')];_0x3c0f68++){this[_0xd6d3('0x99')](_0x46d939[_0x41f713][_0x3c0f68]);}}else if(_[_0xd6d3('0x9d')](_0x46d939[_0x41f713])){_0x46d939[_0x41f713]=this[_0xd6d3('0x98')](_0x46d939[_0x41f713]);}}}};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x9e')]=function(_0x36587f,_0x2b2005){for(var _0x10d44e in _0x36587f){if(_0x36587f[_0xd6d3('0x96')](_0x10d44e)){if(_[_0xd6d3('0x9a')](_0x36587f[_0x10d44e])){if(!_[_0xd6d3('0x46')](_0x36587f[_0x10d44e])){this[_0xd6d3('0x9e')](_0x36587f[_0x10d44e],util[_0xd6d3('0x2a')](_0xd6d3('0x9f'),_0x2b2005,_0x10d44e));}}else if(_[_0xd6d3('0x9b')](_0x36587f[_0x10d44e])){for(var _0x3be5d2=0x0;_0x3be5d2<_0x36587f[_0x10d44e][_0xd6d3('0x9c')];_0x3be5d2++){this[_0xd6d3('0x9e')](_0x36587f[_0x10d44e][_0x3be5d2],util[_0xd6d3('0x2a')]('%s.%s',_0x2b2005,_0x10d44e+'['+_0x3be5d2+']'));}}else{if(!_[_0xd6d3('0x50')](_0x36587f[_0x10d44e])){this[_0xd6d3('0xf')][_0xd6d3('0xa0')](util[_0xd6d3('0x2a')]('%s.%s',_0x2b2005,_0x10d44e),_0x36587f[_0x10d44e]);}}}}};AGIVertices[_0xd6d3('0x12')]['replaceObjectAllVariables']=function(_0x28d9b7){try{var _0x59f18d=JSON['parse'](_0x28d9b7);this[_0xd6d3('0x99')](_0x59f18d);return JSON['stringify'](_0x59f18d);}catch(_0x416c3f){return this[_0xd6d3('0x98')](_0x28d9b7);}};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x98')]=function(_0x343ef9){var _0x24cc43=_0x343ef9[_0xd6d3('0xa1')]('{');for(var _0x50ecf1=0x1;_0x50ecf1<_0x24cc43['length'];_0x50ecf1+=0x1){var _0x2a19ab=_0x24cc43[_0x50ecf1][_0xd6d3('0xa1')]('}');if(_0x2a19ab['length']>0x1){_0x343ef9=_0x343ef9[_0xd6d3('0xa2')]('{'+_0x2a19ab[0x0]+'}',this['channel'][_0xd6d3('0x13')](_0x2a19ab[0x0])['extra']||_0x2a19ab[0x0]);}}if(_0x24cc43[_0xd6d3('0x9c')]===0x1){return _0x343ef9['toString']();}return this[_0xd6d3('0x98')](_0x343ef9);};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xa3')]=function(_0x452324,_0x14f8d8){var _0x2cbfcb=this[_0xd6d3('0xf')]['getVariable'](_0x452324);if(_0x2cbfcb[_0xd6d3('0xa4')]===-0x1){return _0x2cbfcb;}logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0xa5'),_0x14f8d8,_0x2cbfcb[_0xd6d3('0xa6')]));return this['channel'][_0xd6d3('0xa0')](_0x14f8d8,_0x2cbfcb[_0xd6d3('0xa6')]);};AGIVertices['prototype'][_0xd6d3('0x87')]=function(_0x41afa7){return _0x41afa7&&_0x41afa7!=='0'&&_0x41afa7!=='-1'&&_0x41afa7!=='';};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xa7')]=function(_0x262405){this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x262405,'-');_0x262405['retry']=_0x262405[_0xd6d3('0xa7')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd6d3('0x12')]['mrcpsynth']=function(_0x594504){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0xa8'),_0x594504['label']));if(!this['isConfigured'](_0x594504[_0xd6d3('0x5d')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xaa'));}var _0x53a5ff='\x22'+_0x594504[_0xd6d3('0x5d')]+'\x22';if(this[_0xd6d3('0x87')](_0x594504[_0xd6d3('0x7c')])){_0x53a5ff+=','+_0x594504['options'];}var _0x8196f1=this[_0xd6d3('0xf')]['exec'](_0xd6d3('0xab'),_0x53a5ff);if(_0x8196f1[_0xd6d3('0xa4')]===-0x1){return _0x8196f1;}return this['channel'][_0xd6d3('0xa9')](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x53a5ff));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xac')]=function(_0x1a2d0e){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0xad'),_0x1a2d0e[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x1a2d0e[_0xd6d3('0xae')])){return this[_0xd6d3('0xf')]['noop']('no\x20grammar\x20configured');}var _0x46766d=_0x1a2d0e['grammar'];if(this[_0xd6d3('0x87')](_0x1a2d0e[_0xd6d3('0x7c')])){_0x46766d+=','+_0x1a2d0e[_0xd6d3('0x7c')];}var _0x5ab866=this[_0xd6d3('0xf')][_0xd6d3('0x58')](_0xd6d3('0xaf'),_0x46766d);if(_0x5ab866['result']===-0x1){return _0x5ab866;}var _0x11e07d=this[_0xd6d3('0xa3')]('RECOG_CONFIDENCE()',_0xd6d3('0xb0'));if(_0x11e07d[_0xd6d3('0xa4')]===-0x1){return _0x11e07d;}var _0x1a3f48=this[_0xd6d3('0xa3')](_0xd6d3('0xb1'),_0xd6d3('0xb2'));if(_0x1a3f48[_0xd6d3('0xa4')]===-0x1){return _0x1a3f48;}var _0x5ae0b2=this[_0xd6d3('0xa3')](_0xd6d3('0xb3'),_0xd6d3('0xb4'));if(_0x5ae0b2[_0xd6d3('0xa4')]===-0x1){return _0x5ae0b2;}return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x46766d));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x8')]=function(_0x4128b8){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0xb5'),_0x4128b8[_0xd6d3('0x37')]));return this['channel'][_0xd6d3('0x8')]([_0x4128b8[_0xd6d3('0xb6')],_0x4128b8[_0xd6d3('0xb7')]]);};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xb8')]=function(_0x25effe){logger[_0xd6d3('0x2d')](util['format'](_0xd6d3('0xb9'),_0x25effe[_0xd6d3('0x37')]));if(this[_0xd6d3('0x87')](_0x25effe[_0xd6d3('0x69')])){logger['info'](util[_0xd6d3('0x2a')](_0xd6d3('0xba'),_0x25effe[_0xd6d3('0x69')]));var _0x11ff0d=this[_0xd6d3('0xf')][_0xd6d3('0xbb')](_0x25effe[_0xd6d3('0x69')]);if(_0x11ff0d['result']===-0x1){return _0x11ff0d;}}return this[_0xd6d3('0xf')][_0xd6d3('0xb8')]();};AGIVertices[_0xd6d3('0x12')]['callback']=function(_0x405af3){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x405af3[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x405af3[_0xd6d3('0xbc')])){return this['channel'][_0xd6d3('0x33')](_0x405af3,_0xd6d3('0xbd'));}_0x405af3[_0xd6d3('0x48')]=moment();if(this[_0xd6d3('0x87')](_0x405af3['delay'])){_0x405af3[_0xd6d3('0x48')]=moment()[_0xd6d3('0xbe')](_0x405af3[_0xd6d3('0xbf')],'minutes');}if(!this[_0xd6d3('0x87')](_0x405af3[_0xd6d3('0xc0')])){_0x405af3[_0xd6d3('0xc0')]=0x2;}this[_0xd6d3('0x43')][_0xd6d3('0x73')](this,_0x405af3);return this['channel'][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0xc1'),_0x405af3[_0xd6d3('0xc2')],_0x405af3[_0xd6d3('0xbc')],_0x405af3[_0xd6d3('0x48')]));};AGIVertices['prototype']['custom_app']=function(_0x39c0e9){logger[_0xd6d3('0x2d')](util['format'](_0xd6d3('0xc3'),_0x39c0e9[_0xd6d3('0x37')]));var _0xbc521e=this['channel'][_0xd6d3('0x58')](_0x39c0e9['application'],_0x39c0e9[_0xd6d3('0x7c')]);if(_0xbc521e[_0xd6d3('0xa4')]===-0x1){return _0xbc521e;}return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')]('Executed\x20command\x20%s\x20%s',_0x39c0e9[_0xd6d3('0xc4')],_0x39c0e9[_0xd6d3('0x7c')]));};AGIVertices[_0xd6d3('0x12')]['lumenvoxtts']=function(_0x3d7998){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x3d7998[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x3d7998[_0xd6d3('0x5d')])){return this[_0xd6d3('0xf')]['noop'](_0xd6d3('0xaa'));}var _0x21ea10='\x22'+_0x3d7998[_0xd6d3('0x5d')]+'\x22';if(this['isConfigured'](_0x3d7998[_0xd6d3('0x7c')])){_0x21ea10+=','+_0x3d7998['options'];}var _0xa43db0=this[_0xd6d3('0xf')]['exec'](_0xd6d3('0xab'),_0x21ea10);if(_0xa43db0[_0xd6d3('0xa4')]===-0x1){return _0xa43db0;}return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x21ea10));};AGIVertices['prototype'][_0xd6d3('0xc5')]=function(_0x2d2cd0){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0xc6'),_0x2d2cd0[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x2d2cd0[_0xd6d3('0x5d')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xaa'));}var _0x5850ac='\x22'+_0x2d2cd0['text']+'\x22';if(this[_0xd6d3('0x87')](_0x2d2cd0['options'])){_0x5850ac+=','+_0x2d2cd0[_0xd6d3('0x7c')];}var _0x2123bd=this[_0xd6d3('0xf')]['exec'](_0xd6d3('0xab'),_0x5850ac);if(_0x2123bd[_0xd6d3('0xa4')]===-0x1){return _0x2123bd;}return this[_0xd6d3('0xf')]['noop'](util[_0xd6d3('0x2a')](_0xd6d3('0xc7'),_0x5850ac));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xc8')]=function(_0x57bd53){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0xc9'),_0x57bd53[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x57bd53[_0xd6d3('0xae')])){return this[_0xd6d3('0xf')]['noop']('no\x20grammar\x20configured');}var _0x23803b=_0x57bd53[_0xd6d3('0xae')];if(this[_0xd6d3('0x87')](_0x57bd53[_0xd6d3('0x7c')])){_0x23803b+=','+_0x57bd53['options'];}var _0x39a622=this[_0xd6d3('0xf')]['exec']('MRCPRecog',_0x23803b);if(_0x39a622[_0xd6d3('0xa4')]===-0x1){return _0x39a622;}var _0x3b9b17=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0xd6d3('0xca'));if(_0x3b9b17[_0xd6d3('0xa4')]===-0x1){return _0x3b9b17;}var _0x4a14f4=this[_0xd6d3('0xa3')]('RECOG_INPUT()',_0xd6d3('0xcb'));if(_0x4a14f4[_0xd6d3('0xa4')]===-0x1){return _0x4a14f4;}var _0xdcb6d0=this[_0xd6d3('0xa3')](_0xd6d3('0xb3'),'LUMENVOX_ASR_INSTANCE');if(_0xdcb6d0[_0xd6d3('0xa4')]===-0x1){return _0xdcb6d0;}return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util['format'](_0xd6d3('0xcc'),_0x23803b));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xcd')]=function(_0x45fe6a){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0xce'),_0x45fe6a[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x45fe6a[_0xd6d3('0xae')])){return this[_0xd6d3('0xf')]['noop']('no\x20grammar\x20configured');}var _0x3b2c0b=_0x45fe6a[_0xd6d3('0xae')];if(this[_0xd6d3('0x87')](_0x45fe6a[_0xd6d3('0x7c')])){_0x3b2c0b+=','+_0x45fe6a[_0xd6d3('0x7c')];}var _0x2c8277=this[_0xd6d3('0xf')][_0xd6d3('0x58')](_0xd6d3('0xaf'),_0x3b2c0b);if(_0x2c8277[_0xd6d3('0xa4')]===-0x1){return _0x2c8277;}var _0x3dc62b=this['getAndSetVariable']('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0x3dc62b[_0xd6d3('0xa4')]===-0x1){return _0x3dc62b;}var _0x5ce638=this[_0xd6d3('0xa3')](_0xd6d3('0xb1'),_0xd6d3('0xcf'));if(_0x5ce638[_0xd6d3('0xa4')]===-0x1){return _0x5ce638;}var _0x146434=this[_0xd6d3('0xa3')]('RECOG_INSTANCE()',_0xd6d3('0xd0'));if(_0x146434[_0xd6d3('0xa4')]===-0x1){return _0x146434;}return this['channel'][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0xcc'),_0x3b2c0b));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xd1')]=function(_0x2ee547){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x2ee547[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x2ee547['odbc_id'])){return this['channel'][_0xd6d3('0x33')](_0x2ee547,_0xd6d3('0xd2'));}var _0x16a8e9=this[_0xd6d3('0x1b')]['sync'](this,_0x2ee547[_0xd6d3('0xd3')]);if(!_0x16a8e9){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x2ee547,_0xd6d3('0xd4'));}if(!this[_0xd6d3('0x87')](_0x2ee547[_0xd6d3('0x2f')])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x2ee547,_0xd6d3('0xd5'));}var _0x2dd18a=_0x2ee547[_0xd6d3('0x2f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this['channel']['noop'](util[_0xd6d3('0x2a')]('query:\x20%s',_0x2dd18a));var _0x556a48=this['getQueryOdbc']['sync'](this,_0x16a8e9,_0x2dd18a);this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x2ee547,_0x2dd18a);if(!this[_0xd6d3('0x87')](_0x2ee547[_0xd6d3('0xd6')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xd7'));}var _0x45ba85=this[_0xd6d3('0x13')][_0xd6d3('0x73')](this,_0x2ee547['variable_id']);if(!_0x45ba85){return this['channel'][_0xd6d3('0x33')](_0x2ee547,_0xd6d3('0xd8'));}var _0x22d422=this;_0x556a48[_0xd6d3('0xd9')](function(_0x9bfbd,_0x41e3f3){Object[_0xd6d3('0xda')](_0x9bfbd)[_0xd6d3('0xd9')](function(_0xd2e75f){_0x22d422[_0xd6d3('0xf')][_0xd6d3('0xa0')](util[_0xd6d3('0x2a')](_0xd6d3('0xdb'),_0x45ba85,_0x41e3f3,_0xd2e75f),_0x9bfbd[_0xd2e75f]);});});this[_0xd6d3('0xf')][_0xd6d3('0xa0')](util[_0xd6d3('0x2a')]('%s_ROWS_COUNT',_0x45ba85),_0x556a48['length']);return this['channel']['noop'](util[_0xd6d3('0x2a')](_0xd6d3('0xdc'),_0x45ba85));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xdd')]=function(_0x37672a){logger['debug'](util[_0xd6d3('0x2a')](_0xd6d3('0xde'),_0x37672a[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x37672a[_0xd6d3('0xdf')])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x37672a,_0xd6d3('0xe0'));}var _0x437287=this[_0xd6d3('0x1e')]['sync'](this,_0x37672a[_0xd6d3('0xdf')]);if(!_0x437287){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x37672a,'no\x20user\x20found');}var _0x175b75=this[_0xd6d3('0xf')][_0xd6d3('0x58')](_0xd6d3('0xe1'),[util[_0xd6d3('0x2a')](_0xd6d3('0xe2'),_0x437287),_0x37672a['timeout'],_0x37672a['opts'],_0x37672a[_0xd6d3('0x67')]]);if(_0x175b75[_0xd6d3('0xa4')]===-0x1){return _0x175b75;}return this[_0xd6d3('0xf')]['noop'](util[_0xd6d3('0x2a')]('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xe3')]=function(_0x1b5ca8){logger['info'](util[_0xd6d3('0x2a')](_0xd6d3('0xe4'),_0x1b5ca8[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x1b5ca8[_0xd6d3('0x7e')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xe5'));}if(!this[_0xd6d3('0x87')](_0x1b5ca8['text'])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')]('no\x20text\x20configured');}this[_0xd6d3('0xf')]['bot']=!![];this[_0xd6d3('0x36')](_0x1b5ca8);this[_0xd6d3('0xe6')](_0x1b5ca8[_0xd6d3('0x5d')],'in','','');this['channel']['noop'](util[_0xd6d3('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x1b5ca8['text']));var _0x3aed44=this['googleDialogflow'][_0xd6d3('0x73')](this,_0x1b5ca8);if(_0x3aed44){for(var _0x39af53 in _0x3aed44){if(_0x3aed44[_0xd6d3('0x96')](_0x39af53)){this[_0xd6d3('0xf')]['setVariable'](util[_0xd6d3('0x2a')](_0xd6d3('0xe7'),_0x39af53[_0xd6d3('0x6d')]()),_0x3aed44[_0x39af53]);}}this['createSquareMessage'](_0x3aed44[_0xd6d3('0xe8')],'out',_0xd6d3('0xe3'),'');return this[_0xd6d3('0xf')]['noop'](util['format'](_0xd6d3('0xe9'),_0x3aed44[_0xd6d3('0xe8')]));}return this[_0xd6d3('0xf')]['error'](_0x1b5ca8,_0xd6d3('0xea'));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xeb')]=function(_0x2c8be9){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x2c8be9[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x2c8be9[_0xd6d3('0x81')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x2c8be9[_0xd6d3('0x82')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xec'));}if(!this[_0xd6d3('0x87')](_0x2c8be9[_0xd6d3('0xed')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')]('no\x20private_key\x20configured');}if(!this[_0xd6d3('0x87')](_0x2c8be9[_0xd6d3('0xee')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xef'));}if(!this[_0xd6d3('0x87')](_0x2c8be9['text'])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xaa'));}this[_0xd6d3('0xf')][_0xd6d3('0xf0')]=!![];this['createSquareDetailsReport'](_0x2c8be9);this[_0xd6d3('0xe6')](_0x2c8be9[_0xd6d3('0x5d')],'in','','');this['channel'][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0xf1'),_0x2c8be9[_0xd6d3('0x5d')]));var _0x34ff8d=this[_0xd6d3('0x80')][_0xd6d3('0x73')](this,_0x2c8be9);if(_0x34ff8d){for(var _0x1043dc in _0x34ff8d){if(_0x34ff8d[_0xd6d3('0x96')](_0x1043dc)){if(_0x1043dc!==_0xd6d3('0xf2')){this[_0xd6d3('0xf')][_0xd6d3('0xa0')](util[_0xd6d3('0x2a')]('DIALOGFLOW_%s',_0x1043dc[_0xd6d3('0x6d')]()),_0x34ff8d[_0x1043dc]);}}}this[_0xd6d3('0xe6')](_0x34ff8d[_0xd6d3('0xe8')],'out','dialogflowV2',_0x34ff8d[_0xd6d3('0xf2')]);return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util['format'](_0xd6d3('0xf3'),_0x34ff8d[_0xd6d3('0xe8')]));}return this[_0xd6d3('0xf')]['error'](_0x2c8be9,_0xd6d3('0xf4'));};AGIVertices['prototype']['sesteknda']=function(_0x3dee85){logger[_0xd6d3('0x2d')](util['format'](_0xd6d3('0xf5'),_0x3dee85[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x3dee85['ndauth_url'])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xf6'));}if(!this[_0xd6d3('0x87')](_0x3dee85['username'])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xf7'));}if(!this['isConfigured'](_0x3dee85['password'])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xf8'));}if(!this[_0xd6d3('0x87')](_0x3dee85[_0xd6d3('0xf9')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xaa'));}this[_0xd6d3('0xf')][_0xd6d3('0xf0')]=!![];this[_0xd6d3('0x36')](_0x3dee85);this[_0xd6d3('0xe6')](_0x3dee85[_0xd6d3('0x5d')],'in','','');this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')]('Trying\x20SestekNDA:\x20%s',_0x3dee85['text']));var _0xb66807=this[_0xd6d3('0xfa')][_0xd6d3('0x73')](this,_0x3dee85);if(_0xb66807){for(var _0x593077 in _0xb66807){if(_0xb66807['hasOwnProperty'](_0x593077)){this[_0xd6d3('0xf')][_0xd6d3('0xa0')](util[_0xd6d3('0x2a')](_0xd6d3('0xfb'),_0x593077['toUpperCase']()),_0xb66807[_0x593077]);}}this['createSquareMessage'](_0xb66807['speech'],_0xd6d3('0xfc'),_0xd6d3('0xfd'),'');if(_0xb66807[_0xd6d3('0xfe')]){this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0xff'),_0xb66807[_0xd6d3('0xfe')]));var _0x319198=this[_0xd6d3('0xf')][_0xd6d3('0x100')](_0xb66807['audiofile']);try{fs['unlink'](_0xb66807[_0xd6d3('0xfe')]+_0xd6d3('0x101'));}catch(_0x723a59){logger['error'](_0x723a59);}return _0x319198;}else{return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x102'),_0xb66807[_0xd6d3('0xe8')]));}}return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x3dee85,_0xd6d3('0x103'));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x104')]=function(_0x4f9c05){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x105'),_0x4f9c05[_0xd6d3('0x37')]));return this[_0xd6d3('0xf')][_0xd6d3('0xa9')]('end');};AGIVertices['prototype'][_0xd6d3('0x106')]=function(_0x2d00f1){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x107'),_0x2d00f1['label']));var _0x74a044='';if(_0x2d00f1[_0xd6d3('0x108')]){if(!this[_0xd6d3('0x87')](_0x2d00f1['trunk_id'])){return this['channel'][_0xd6d3('0x33')](_0x2d00f1,'no\x20trunk\x20selected');}else{var _0x2fe348=parseInt(_0x2d00f1[_0xd6d3('0x108')],0xa);if(isNaN(_0x2fe348)){_0x74a044=_0x2d00f1[_0xd6d3('0x108')];}else{_0x74a044=this[_0xd6d3('0x20')][_0xd6d3('0x73')](this,_0x2d00f1['trunk_id']);if(!_0x74a044){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x2d00f1,'no\x20trunk\x20found');}}}}else if(_0x2d00f1[_0xd6d3('0x109')]){_0x74a044=_0x2d00f1[_0xd6d3('0x109')];}else{return this[_0xd6d3('0xf')]['error'](_0x2d00f1,_0xd6d3('0x10a'));}var _0x3be8a2=this[_0xd6d3('0xf')][_0xd6d3('0x58')](_0xd6d3('0xe1'),[util[_0xd6d3('0x2a')]('SIP/%s/%s',_0x74a044,_0x2d00f1[_0xd6d3('0xc2')]),_0x2d00f1[_0xd6d3('0x69')],_0x2d00f1['opts'],_0x2d00f1[_0xd6d3('0x67')]]);if(_0x3be8a2[_0xd6d3('0xa4')]===-0x1){return _0x3be8a2;}return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x10b'),'DIAL'));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x10c')]=function(_0xfc9c9){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0xfc9c9[_0xd6d3('0x37')]));return this['channel']['noop'](_0xd6d3('0x10c'));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xd')]=function(_0x58d0ee){logger['info'](util[_0xd6d3('0x2a')](_0xd6d3('0x10d'),_0x58d0ee[_0xd6d3('0x37')]));if(_0x58d0ee['retry']===0x0){return this[_0xd6d3('0xa7')](_0x58d0ee);}_0x58d0ee[_0xd6d3('0x10e')]-=0x1;if(!this[_0xd6d3('0x87')](_0x58d0ee[_0xd6d3('0x10f')])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x58d0ee,'no\x20file\x20audio\x20selected');}var _0x373938=this[_0xd6d3('0x22')]['sync'](this,_0x58d0ee[_0xd6d3('0x10f')]);if(!_0x373938){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x58d0ee,'no\x20file\x20audio\x20found');}if(!this['isConfigured'](_0x58d0ee[_0xd6d3('0xd6')])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3c2b95=this['channel'][_0xd6d3('0x110')](_0x373938,_0x58d0ee[_0xd6d3('0x111')],_0x58d0ee[_0xd6d3('0x112')]);var _0x194229=_0x3c2b95[_0xd6d3('0xa4')]?_0x3c2b95[_0xd6d3('0xa4')]['toString']():'';logger['info'](_0xd6d3('0x113'),JSON[_0xd6d3('0x76')](_0x3c2b95));if(_0x3c2b95[_0xd6d3('0xa4')]===-0x1){this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x58d0ee,_0x194229);return _0x3c2b95;}else if(_0x3c2b95[_0xd6d3('0xa6')]===_0xd6d3('0x69')){_0x3c2b95[_0xd6d3('0xa4')]=_0x194229[_0xd6d3('0x9c')]>=parseInt(_0x58d0ee[_0xd6d3('0x114')])?'x':'i';}else{_0x3c2b95[_0xd6d3('0xa4')]=_0x194229[_0xd6d3('0x9c')]>=parseInt(_0x58d0ee[_0xd6d3('0x114')])&&_0x194229[_0xd6d3('0x9c')]<=parseInt(_0x58d0ee['maxdigit'])?'x':'i';}var _0x4d266f=this['getVariable'][_0xd6d3('0x73')](this,_0x58d0ee[_0xd6d3('0xd6')]);if(!_0x4d266f){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x58d0ee,_0xd6d3('0xd8'));}this['channel'][_0xd6d3('0xa0')](_0x4d266f,_0x194229);if(this['isConfigured'](_0x58d0ee['hiddendigitsnum'])){var _0x5f31c7=parseInt(_0x58d0ee[_0xd6d3('0x115')],0xa);var _0x55eee3=rs[_0xd6d3('0x116')]({'charset':'*','length':_0x5f31c7});var _0x3287f1=_0x194229[_0xd6d3('0x9c')];if(_0x3287f1>0x0){if(_0x3287f1>_0x5f31c7){this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x58d0ee,_0x58d0ee[_0xd6d3('0x117')]==='first'?_0x55eee3+_0x194229['substr'](_0x5f31c7):_0x194229[_0xd6d3('0x118')](0x0,_0x3287f1-_0x5f31c7)+_0x55eee3);}else{this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x58d0ee,rs[_0xd6d3('0x116')]({'charset':'*','length':_0x3287f1}));}}else{this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x58d0ee,'');}}else{this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x58d0ee,_0x194229);}return _0x3c2b95;};AGIVertices[_0xd6d3('0x12')]['getsecretdigits']=function(_0x536119){logger[_0xd6d3('0x2d')](util['format'](_0xd6d3('0x119'),_0x536119['label']));return this[_0xd6d3('0xd')](_0x536119);};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x11a')]=function(_0x44496d){logger[_0xd6d3('0x2d')](util['format'](_0xd6d3('0x11b'),_0x44496d[_0xd6d3('0x37')]));this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x44496d,_0x44496d[_0xd6d3('0x11c')]);return this[_0xd6d3('0xf')]['noop'](util[_0xd6d3('0x2a')](_0xd6d3('0x11d'),_0x44496d[_0xd6d3('0x11c')]));};AGIVertices[_0xd6d3('0x12')]['awspolly']=function(_0x190627){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x11e'),_0x190627[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x190627[_0xd6d3('0x8f')])||!this[_0xd6d3('0x87')](_0x190627[_0xd6d3('0x8a')])){return this['channel']['noop'](_0xd6d3('0x11f'));}if(!this['isConfigured'](_0x190627['text'])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')]('no\x20text\x20configured');}this['channel'][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x120'),_0x190627[_0xd6d3('0x5d')]));var _0x4a784a=this[_0xd6d3('0x89')][_0xd6d3('0x73')](this,_0x190627);if(_0x4a784a){this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x121'),_0x4a784a));var _0x441d56=this['channel'][_0xd6d3('0x100')](_0x4a784a);try{fs[_0xd6d3('0x122')](_0x4a784a+_0xd6d3('0x101'));}catch(_0x27f32f){logger[_0xd6d3('0x33')](_0x27f32f);}return _0x441d56;}return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x190627,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0xd6d3('0x12')]['awslex']=function(_0x57b5c8){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x123'),_0x57b5c8['label']));if(!this[_0xd6d3('0x87')](_0x57b5c8[_0xd6d3('0x8f')])||!this['isConfigured'](_0x57b5c8[_0xd6d3('0x8a')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0x11f'));}if(!this['isConfigured'](_0x57b5c8['aws_bot_name'])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0x124'));}if(!this['isConfigured'](_0x57b5c8[_0xd6d3('0x5d')])){return this[_0xd6d3('0xf')]['noop'](_0xd6d3('0xaa'));}this[_0xd6d3('0xf')]['bot']=!![];this[_0xd6d3('0x36')](_0x57b5c8);this['createSquareMessage'](_0x57b5c8[_0xd6d3('0x5d')],'in','','');this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x125'),_0x57b5c8[_0xd6d3('0x5d')]));var _0x1d1ddd=this[_0xd6d3('0x8e')]['sync'](this,_0x57b5c8);if(_0x1d1ddd){for(var _0x3208fa in _0x1d1ddd){if(_0x1d1ddd[_0xd6d3('0x96')](_0x3208fa)&&_[_0xd6d3('0x9d')](_0x1d1ddd[_0x3208fa])){this[_0xd6d3('0xf')][_0xd6d3('0xa0')](util[_0xd6d3('0x2a')](_0xd6d3('0x126'),_0x3208fa[_0xd6d3('0x6d')]()),_0x1d1ddd[_0x3208fa]);}}if(_[_0xd6d3('0x50')](_0x1d1ddd[_0xd6d3('0x7a')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xd6d3('0xe6')](_0x1d1ddd[_0xd6d3('0x7a')],_0xd6d3('0xfc'),_0xd6d3('0x127'),'');return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x128'),_0x1d1ddd[_0xd6d3('0x7a')]));}}return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x57b5c8,_0xd6d3('0x129'));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x12a')]=function(_0x18ac0d){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x12b'),_0x18ac0d[_0xd6d3('0x37')],_0x18ac0d[_0xd6d3('0x69')]));if(!this[_0xd6d3('0x87')](_0x18ac0d[_0xd6d3('0x7e')])){return this['channel'][_0xd6d3('0xa9')]('no\x20key\x20configured');}var _0x314275='wav';var _0x193447=util[_0xd6d3('0x2a')](_0xd6d3('0x12c'),FILES_PATH,rs[_0xd6d3('0x116')](0x4));var _0x388d77=util[_0xd6d3('0x2a')]('%s.%s',_0x193447,_0x314275);var _0x111f4e=!![];if(_0x18ac0d['beep']===_0xd6d3('0x12d')){_0x111f4e=![];}var _0x46a318=this['channel'][_0xd6d3('0x12e')](_0x193447,_0x314275,_0x18ac0d['intKey'],_0x18ac0d[_0xd6d3('0x69')],undefined,_0x111f4e);if(_0x46a318['result']!==-0x1){this['channel'][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x12f'),_0x388d77));var _0x10f531=this[_0xd6d3('0x91')]['sync'](this,_0x18ac0d,_0x388d77);if(_0x10f531){for(var _0x351839 in _0x10f531){if(_0x10f531[_0xd6d3('0x96')](_0x351839)){this[_0xd6d3('0xf')][_0xd6d3('0xa0')](util[_0xd6d3('0x2a')](_0xd6d3('0x130'),_0x351839['toUpperCase']()),_0x10f531[_0x351839]);}}return this[_0xd6d3('0xf')]['noop'](util['format'](_0xd6d3('0x131'),JSON[_0xd6d3('0x76')](_0x10f531)));}}return _0x46a318;};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x132')]=function(_0x11acbc){logger['info'](util[_0xd6d3('0x2a')](_0xd6d3('0x133'),_0x11acbc[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x11acbc[_0xd6d3('0x134')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0x135'));}if(!this[_0xd6d3('0x87')](_0x11acbc[_0xd6d3('0x136')])){return this['channel'][_0xd6d3('0xa9')](_0xd6d3('0x137'));}var _0x251cf5=_0xd6d3('0x138');var _0x34fcc5=util[_0xd6d3('0x2a')](_0xd6d3('0x12c'),FILES_PATH,rs[_0xd6d3('0x116')](0x4));var _0x18f865=util[_0xd6d3('0x2a')]('%s.%s',_0x34fcc5,_0x251cf5);var _0x252ade=!![];if(_0x11acbc[_0xd6d3('0x139')]===_0xd6d3('0x12d')){_0x252ade=![];}var _0x2e52a1=this[_0xd6d3('0xf')][_0xd6d3('0x12e')](_0x34fcc5,_0x251cf5,_0x11acbc[_0xd6d3('0x13a')],_0x11acbc['timeout'],undefined,_0x252ade);if(_0x2e52a1['result']!==-0x1){this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util['format'](_0xd6d3('0x13b'),_0x18f865));var _0x442ee3=this['tildeASR'][_0xd6d3('0x73')](this,_0x11acbc,_0x18f865);if(_0x442ee3){for(var _0x3a611c in _0x442ee3){if(_0x442ee3[_0xd6d3('0x96')](_0x3a611c)){this[_0xd6d3('0xf')][_0xd6d3('0xa0')](util[_0xd6d3('0x2a')](_0xd6d3('0x13c'),_0x3a611c[_0xd6d3('0x6d')]()),_0x442ee3[_0x3a611c]);}}return this[_0xd6d3('0xf')]['noop'](util[_0xd6d3('0x2a')](_0xd6d3('0x13d'),JSON[_0xd6d3('0x76')](_0x442ee3)));}}return _0x2e52a1;};AGIVertices['prototype'][_0xd6d3('0x13e')]=function(_0x474258){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x13f'),_0x474258[_0xd6d3('0x37')]));return this[_0xd6d3('0xf')][_0xd6d3('0x140')](_0x474258['context'],_0x474258['extension'],_0x474258[_0xd6d3('0x3f')]);};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x141')]=function(_0x41bcaf){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x41bcaf['label']));if(!this[_0xd6d3('0x87')](_0x41bcaf[_0xd6d3('0x142')])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x41bcaf,_0xd6d3('0x143'));}try{var _0x59c425=eval(_0x41bcaf[_0xd6d3('0x142')])?_0xd6d3('0x144'):_0xd6d3('0x145');this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x146'),_0x41bcaf[_0xd6d3('0x142')],_0x59c425));return{'code':0xc8,'result':_0x59c425};}catch(_0x2cf076){return{'code':0xc8,'result':_0xd6d3('0x145')};}};AGIVertices[_0xd6d3('0x12')]['gotoiftime']=function(_0x493271){logger[_0xd6d3('0x2d')](util['format'](_0xd6d3('0x147'),_0x493271[_0xd6d3('0x37')]));if(!this['isConfigured'](_0x493271[_0xd6d3('0x148')])){return this['channel'][_0xd6d3('0x33')](_0x493271,_0xd6d3('0x149'));}var _0x14c8c5=this[_0xd6d3('0x14a')][_0xd6d3('0x73')](this,_0x493271['interval_id']);if(!_0x14c8c5){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x493271,_0xd6d3('0x14b'));}for(var _0xa18fde=0x0;_0xa18fde<_0x14c8c5['length'];_0xa18fde+=0x1){var _0x1d0eff=this[_0xd6d3('0xf')][_0xd6d3('0x13')](util[_0xd6d3('0x2a')](_0xd6d3('0x14c'),_0x14c8c5[_0xa18fde]));if(_0x1d0eff['result']===-0x1){return _0x1d0eff;}logger['info'](util[_0xd6d3('0x2a')]('IFTIME\x20%s\x20%s',_0x14c8c5[_0xa18fde],_0x1d0eff['extra']));if(_0x1d0eff[_0xd6d3('0xa6')]==='true'){logger['info'](util[_0xd6d3('0x2a')](_0xd6d3('0x14d'),_0x14c8c5[_0xa18fde],_0xd6d3('0x144')));this[_0xd6d3('0xf')]['noop'](util[_0xd6d3('0x2a')](_0xd6d3('0x14d'),_0x14c8c5[_0xa18fde],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0xd6d3('0x2d')](util['format']('IFTIME\x20%s\x20%s',_0x14c8c5[_0xa18fde],'false'));this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util['format'](_0xd6d3('0x14d'),_0x14c8c5[_0xa18fde],_0xd6d3('0x145')));}}return{'code':0xc8,'result':_0xd6d3('0x145')};};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x14e')]=function(_0x4e01a8){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x14f'),_0x4e01a8[_0xd6d3('0x37')]));return this[_0xd6d3('0xf')]['hangup']();};AGIVertices[_0xd6d3('0x12')]['ispeechasr']=function(_0x4fde4d){logger[_0xd6d3('0x2d')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x4fde4d[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x4fde4d[_0xd6d3('0x7e')])){return this[_0xd6d3('0xf')]['noop']('no\x20key\x20configured');}var _0x47e2b8=_0xd6d3('0x138');var _0x41f446=util[_0xd6d3('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0xd6d3('0x116')](0x4));var _0xea7606=util[_0xd6d3('0x2a')](_0xd6d3('0x9f'),_0x41f446,_0x47e2b8);var _0x10fc0e=!![];if(_0x4fde4d[_0xd6d3('0x139')]===_0xd6d3('0x12d')){_0x10fc0e=![];}var _0x20f5e9=this[_0xd6d3('0xf')][_0xd6d3('0x12e')](_0x41f446,_0x47e2b8,_0x4fde4d[_0xd6d3('0x13a')],_0x4fde4d[_0xd6d3('0x69')],undefined,_0x10fc0e);if(_0x20f5e9[_0xd6d3('0xa4')]!==-0x1){this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util['format'](_0xd6d3('0x150'),_0xea7606));var _0x490445=this[_0xd6d3('0x85')][_0xd6d3('0x73')](this,_0x4fde4d,_0xea7606);if(_0x490445){for(var _0xbbb27b in _0x490445){if(_0x490445['hasOwnProperty'](_0xbbb27b)){this[_0xd6d3('0xf')][_0xd6d3('0xa0')](util['format'](_0xd6d3('0x151'),_0xbbb27b['toUpperCase']()),_0x490445[_0xbbb27b]);}}return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0xd6d3('0x76')](_0x490445)));}}return _0x20f5e9;};AGIVertices['prototype'][_0xd6d3('0x152')]=function(_0x340478){logger['info'](util['format'](_0xd6d3('0x153'),_0x340478['label']));if(!this[_0xd6d3('0x87')](_0x340478[_0xd6d3('0x7e')])){return this[_0xd6d3('0xf')]['noop'](_0xd6d3('0xe5'));}if(!this[_0xd6d3('0x87')](_0x340478['text'])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')]('no\x20text\x20configured');}this['channel'][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')]('Trying\x20ispeech\x20TTS\x20%s',_0x340478[_0xd6d3('0x5d')]));var _0x333181=this[_0xd6d3('0x83')][_0xd6d3('0x73')](this,_0x340478);if(_0x333181){this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x150'),_0x333181));var _0x4ad6fc=this[_0xd6d3('0xf')][_0xd6d3('0x100')](_0x333181,_0x340478[_0xd6d3('0x13a')]);try{fs[_0xd6d3('0x122')](_0x333181+_0xd6d3('0x101'));}catch(_0x57b452){logger[_0xd6d3('0x33')](_0x57b452);}return _0x4ad6fc;}return this['channel']['error'](_0x340478,_0xd6d3('0x154'));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x155')]=function(_0x30c1d3){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x156'),_0x30c1d3[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x30c1d3[_0xd6d3('0x157')])){return this['channel']['error'](_0x30c1d3,'no\x20find\x20by\x20configured');}logger['info'](util[_0xd6d3('0x2a')](_0xd6d3('0x158'),this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x30c1d3['findBy']));var _0x179a13=this[_0xd6d3('0x53')][_0xd6d3('0x73')](this,_0x30c1d3[_0xd6d3('0x157')]);if(_0x179a13){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x30c1d3['findBy']));this[_0xd6d3('0xf')]['noop'](util[_0xd6d3('0x2a')](_0xd6d3('0x159'),this[_0xd6d3('0xf')]['callerid'],_0x30c1d3[_0xd6d3('0x157')]));return{'code':0xc8,'result':_0xd6d3('0x15a')};}else{logger['info'](util[_0xd6d3('0x2a')](_0xd6d3('0x15b'),this[_0xd6d3('0xf')]['callerid'],_0x30c1d3[_0xd6d3('0x157')]));this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x30c1d3['findBy']));return{'code':0xc8,'result':_0xd6d3('0x15c')};}};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x15d')]=function(_0x75fd7f){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x15e'),_0x75fd7f[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x75fd7f[_0xd6d3('0x157')])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x75fd7f,'no\x20find\x20by\x20configured');}logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x75fd7f[_0xd6d3('0x157')]));var _0x596d7c=this[_0xd6d3('0x52')][_0xd6d3('0x73')](this,_0x75fd7f[_0xd6d3('0x157')]);if(_0x596d7c){logger['info'](util['format'](_0xd6d3('0x159'),this[_0xd6d3('0xf')]['callerid'],_0x75fd7f[_0xd6d3('0x157')]));this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x75fd7f['findBy']));return{'code':0xc8,'result':_0xd6d3('0x15a')};}else{logger['info'](util[_0xd6d3('0x2a')](_0xd6d3('0x15b'),this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x75fd7f[_0xd6d3('0x157')]));this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util['format'](_0xd6d3('0x15b'),this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x75fd7f[_0xd6d3('0x157')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x15f')]=function(_0xcf31df){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x160'),_0xcf31df[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0xcf31df[_0xd6d3('0x161')])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0xcf31df,'no\x20operation\x20configured');}this['channel']['noop'](util['format'](_0xd6d3('0x162'),_0xcf31df[_0xd6d3('0x161')]));var _0x54047d=eval(_0xcf31df[_0xd6d3('0x161')]);if(!this['isConfigured'](_0xcf31df[_0xd6d3('0xd6')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3248fc=this[_0xd6d3('0x13')]['sync'](this,_0xcf31df[_0xd6d3('0xd6')]);if(!_0x3248fc){return this['channel'][_0xd6d3('0x33')](_0xcf31df,_0xd6d3('0xd8'));}if(_[_0xd6d3('0x9b')](_0x54047d)){var _0x27f909=this;_0x54047d[_0xd6d3('0xd9')](function(_0x53c8e8,_0xef34ab){_0x27f909['channel'][_0xd6d3('0xa0')](util[_0xd6d3('0x2a')](_0xd6d3('0x163'),_0x3248fc,_0xef34ab),_0x53c8e8);});return this[_0xd6d3('0xf')]['noop'](util[_0xd6d3('0x2a')](_0xd6d3('0x164'),_0x3248fc));}else{return this[_0xd6d3('0xf')][_0xd6d3('0xa0')](_0x3248fc,_0x54047d);}};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x165')]=function(_0x529cd3){logger[_0xd6d3('0x2d')](util['format'](_0xd6d3('0x166'),_0x529cd3[_0xd6d3('0x37')]));if(_0x529cd3[_0xd6d3('0x10e')]===0x0){return this[_0xd6d3('0xa7')](_0x529cd3);}_0x529cd3['retry']-=0x1;if(!this[_0xd6d3('0x87')](_0x529cd3[_0xd6d3('0x10f')])){return this[_0xd6d3('0xf')]['error'](_0x529cd3,_0xd6d3('0x167'));}var _0x12a4f1=this[_0xd6d3('0x22')][_0xd6d3('0x73')](this,_0x529cd3[_0xd6d3('0x10f')]);if(!_0x12a4f1){return this[_0xd6d3('0xf')]['error'](_0x529cd3,_0xd6d3('0x168'));}var _0x22878e=this['channel'][_0xd6d3('0x110')](_0x12a4f1,_0x529cd3[_0xd6d3('0x111')],_0x529cd3[_0xd6d3('0x169')]);var _0x54e66b=_0x22878e[_0xd6d3('0xa4')];if(_0x22878e['result']===-0x1){this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x529cd3,'-1');return _0x22878e;}else if(_0x22878e[_0xd6d3('0xa6')]===_0xd6d3('0x69')){_0x22878e[_0xd6d3('0xa4')]=_0x22878e[_0xd6d3('0xa4')][_0xd6d3('0x9c')]>0x0?_0x22878e[_0xd6d3('0xa4')]:'t';}else if(_[_0xd6d3('0x46')](_0x22878e[_0xd6d3('0xa4')])){_0x22878e[_0xd6d3('0xa4')]='#';_0x54e66b='#';}if(!this[_0xd6d3('0x87')](_0x529cd3[_0xd6d3('0xd6')])){this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xd7'));}else{var _0x6a2ec2=this[_0xd6d3('0x13')][_0xd6d3('0x73')](this,_0x529cd3[_0xd6d3('0xd6')]);if(!_0x6a2ec2){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x529cd3,_0xd6d3('0xd8'));}this[_0xd6d3('0xf')][_0xd6d3('0xa0')](_0x6a2ec2,_0x54e66b);}this[_0xd6d3('0x36')]['sync'](this,_0x529cd3,_0x54e66b);return _0x22878e;};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0xa9')]=function(_0x16ef59){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x16ef59[_0xd6d3('0x37')]));return this[_0xd6d3('0xf')]['noop'](_0x16ef59[_0xd6d3('0x16a')]||_0x16ef59[_0xd6d3('0x37')]);};AGIVertices[_0xd6d3('0x12')]['pause']=function(_0x52c4eb){logger[_0xd6d3('0x2d')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x52c4eb[_0xd6d3('0x37')]));if(!this['isConfigured'](_0x52c4eb['findBy'])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x52c4eb,_0xd6d3('0x16b'));}logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x158'),this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x52c4eb[_0xd6d3('0x157')]));var _0x4b7268=this[_0xd6d3('0x4c')][_0xd6d3('0x73')](this,_0x52c4eb[_0xd6d3('0x16c')]);var _0x2a9e26=this[_0xd6d3('0x4f')][_0xd6d3('0x73')](this,_0x52c4eb['findBy'],_0x4b7268);if(_0x2a9e26){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x159'),this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x52c4eb['findBy']));this['channel'][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x52c4eb[_0xd6d3('0x157')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xd6d3('0x2a')](_0xd6d3('0x15b'),this[_0xd6d3('0xf')]['callerid'],_0x52c4eb[_0xd6d3('0x157')]));this['channel'][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x159'),this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x52c4eb[_0xd6d3('0x157')]));return{'code':0xc8,'result':_0xd6d3('0x15c')};}};AGIVertices[_0xd6d3('0x12')]['playback']=function(_0x13a69c){logger['info'](util['format'](_0xd6d3('0x16d'),_0x13a69c[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x13a69c[_0xd6d3('0x10f')])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x13a69c,_0xd6d3('0x167'));}var _0x2f1645=this[_0xd6d3('0x22')]['sync'](this,_0x13a69c[_0xd6d3('0x10f')]);if(!_0x2f1645){return this['channel'][_0xd6d3('0x33')](_0x13a69c,'no\x20file\x20audio\x20found');}var _0x1ce60f=this[_0xd6d3('0xf')][_0xd6d3('0x58')](_0xd6d3('0x16e'),[_0x2f1645,_0x13a69c[_0xd6d3('0x16f')]]);if(_0x1ce60f[_0xd6d3('0xa4')]===-0x1){return _0x1ce60f;}return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')]('Executed\x20command\x20%s\x20%s',_0xd6d3('0x16e'),_0x2f1645));};AGIVertices[_0xd6d3('0x12')]['queue']=function(_0x45acc6){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x170'),_0x45acc6[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x45acc6[_0xd6d3('0x171')])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x45acc6,'no\x20queue\x20selected');}var _0x2335b1='';var _0x3b8c92=parseInt(_0x45acc6[_0xd6d3('0x171')],0xa);if(isNaN(_0x3b8c92)){_0x2335b1=_0x45acc6[_0xd6d3('0x171')];}else{_0x2335b1=this[_0xd6d3('0x18')][_0xd6d3('0x73')](this,_0x45acc6['queue_id']);if(!_0x2335b1){return this['channel'][_0xd6d3('0x33')](_0x45acc6,_0xd6d3('0x172'));}}var _0x194912='';if(this[_0xd6d3('0x87')](_0x45acc6['file_id'])){var _0x404562=this[_0xd6d3('0x22')][_0xd6d3('0x73')](this,_0x45acc6[_0xd6d3('0x10f')]);if(_0x404562){_0x194912=_0x404562;}}this['createSquareDetailsReport'][_0xd6d3('0x73')](this,_0x45acc6,_0x2335b1);if(_0x45acc6['opts'][_0xd6d3('0x173')]('x')<0x0){_0x45acc6[_0xd6d3('0x16f')]+='x';}if(_0x45acc6[_0xd6d3('0x16f')]['indexOf']('X')<0x0){_0x45acc6[_0xd6d3('0x16f')]+='X';}this['channel'][_0xd6d3('0xa0')](_0xd6d3('0x174'),_0x2335b1?_0x2335b1[_0xd6d3('0x175')]():'');var _0x3904fb=this[_0xd6d3('0xf')][_0xd6d3('0x58')]('QUEUE',[_0x2335b1,_0x45acc6[_0xd6d3('0x16f')],_0x45acc6['url'],_0x194912,_0x45acc6[_0xd6d3('0x69')],_0x45acc6[_0xd6d3('0x8')],_0x45acc6['macro'],_0x45acc6[_0xd6d3('0x176')],'',_0x45acc6['position']]);if(_0x3904fb[_0xd6d3('0xa4')]===-0x1){return _0x3904fb;}return this['channel']['noop'](util[_0xd6d3('0x2a')](_0xd6d3('0x177'),_0xd6d3('0x178'),_0x2335b1));};AGIVertices['prototype'][_0xd6d3('0x179')]=function(_0xabb747){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x17a'),_0xabb747['label']));var _0x3a1422=_0xabb747['recordingFormat']||'wav';var _0x38b5d1=util[_0xd6d3('0x2a')]('%s_%s',this[_0xd6d3('0xf')][_0xd6d3('0x3c')],rs[_0xd6d3('0x116')](0x5));var _0x1630a9=util[_0xd6d3('0x2a')](_0xd6d3('0x17b'),FILES_PATH,_0x38b5d1,_0x3a1422);var _0xe580ee=util['format']('%s/recordings/%s',FILES_PATH,_0x38b5d1);this['createSquareRecording'][_0xd6d3('0x73')](this,_0xabb747,_0x38b5d1,_0x1630a9);this[_0xd6d3('0xf')][_0xd6d3('0xa0')](_0xd6d3('0x17c'),_0x38b5d1);logger[_0xd6d3('0x2d')](_0xd6d3('0x17d'),_0xe580ee,_0x3a1422,_0xabb747[_0xd6d3('0x17e')],_0xabb747[_0xd6d3('0x69')]);return this[_0xd6d3('0xf')][_0xd6d3('0x12e')](_0xe580ee,_0x3a1422,_0xabb747[_0xd6d3('0x17e')],_0xabb747['timeout'],undefined,!![]);};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x17f')]=function(_0xe01c80){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x180'),_0xe01c80['label']));if(!this[_0xd6d3('0x87')](_0xe01c80['url'])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0x181'));}var _0x271124=this['restAPI']['sync'](this,_0xe01c80);logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x182'),util[_0xd6d3('0x183')](_0x271124,{'showHidden':![],'depth':null})));if(!this[_0xd6d3('0x87')](_0xe01c80[_0xd6d3('0xd6')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1ee172=this[_0xd6d3('0x13')]['sync'](this,_0xe01c80[_0xd6d3('0xd6')]);if(!_0x1ee172){return this[_0xd6d3('0xf')]['error'](_0xe01c80,'no\x20variable\x20found');}this[_0xd6d3('0xf')][_0xd6d3('0xa0')](util[_0xd6d3('0x2a')](_0xd6d3('0x184'),_0x1ee172),_0x271124[_0xd6d3('0x78')]?_0x271124[_0xd6d3('0x78')]:'200');this[_0xd6d3('0xf')]['setVariable'](util[_0xd6d3('0x2a')](_0xd6d3('0x185'),_0x1ee172),_0x271124[_0xd6d3('0x79')]?_0x271124['statusMessage']:'OK');if(_0x271124[_0xd6d3('0x77')]){try{this['saveRestApiResult'](_0x271124[_0xd6d3('0x77')],_0x1ee172);}catch(_0x9d58eb){logger['error'](util['format'](_0xd6d3('0x186'),_0x1ee172));}}return this['channel']['noop'](util['format'](_0xd6d3('0xdc'),_0x1ee172));};AGIVertices[_0xd6d3('0x12')]['saydigits']=function(_0x9fd83c){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x9fd83c[_0xd6d3('0x37')]));return this[_0xd6d3('0xf')][_0xd6d3('0x187')](_0x9fd83c[_0xd6d3('0x188')][_0xd6d3('0x189')](/\s+/g,''),_0x9fd83c[_0xd6d3('0x17e')]);};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x18a')]=function(_0x2bf3fc){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x18b'),_0x2bf3fc[_0xd6d3('0x37')]));return this[_0xd6d3('0xf')][_0xd6d3('0x18c')](_0x2bf3fc['number'][_0xd6d3('0x189')](/\s+/g,''),_0x2bf3fc['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x14bdfe){logger['info'](util[_0xd6d3('0x2a')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x14bdfe[_0xd6d3('0x37')]));return this[_0xd6d3('0xf')]['sayPhonetic'](_0x14bdfe[_0xd6d3('0x5d')],_0x14bdfe['escape_digits']);};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x18d')]=function(_0x4e95db){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x18e'),_0x4e95db[_0xd6d3('0x37')]));if(!this['isConfigured'](_0x4e95db['account_id'])){return this['channel'][_0xd6d3('0xa9')](_0xd6d3('0x18f'));}var _0x3b03ab=this[_0xd6d3('0x24')][_0xd6d3('0x73')](this,_0x4e95db['account_id']);if(!_0x3b03ab||!_0x3b03ab[_0xd6d3('0x190')]){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x4e95db,_0xd6d3('0x191'));}var _0x2b5008={'from':util['format'](_0xd6d3('0x192'),_0x3b03ab['name'],_0x3b03ab[_0xd6d3('0x193')]||_0x3b03ab['Smtp']['user']),'to':_0x4e95db['to']||'','cc':_0x4e95db['cc']||'','bcc':_0x4e95db[_0xd6d3('0x194')]||'','subject':_0x4e95db[_0xd6d3('0x195')],'html':_0x4e95db['text'],'text':_0x4e95db[_0xd6d3('0x5d')]};var _0x161d11={'tls':{'rejectUnauthorized':![]}};if(_0x3b03ab[_0xd6d3('0x190')][_0xd6d3('0x196')]){_0x161d11['service']=_0x3b03ab[_0xd6d3('0x190')][_0xd6d3('0x196')];}else{_0x161d11[_0xd6d3('0x197')]=_0x3b03ab['Smtp'][_0xd6d3('0x197')];_0x161d11[_0xd6d3('0x198')]=_0x3b03ab['Smtp'][_0xd6d3('0x198')];_0x161d11['secure']=_0x3b03ab[_0xd6d3('0x190')]['secure'];}if(_0x3b03ab[_0xd6d3('0x190')][_0xd6d3('0x199')]){_0x161d11[_0xd6d3('0x19a')]={'user':_0x3b03ab['Smtp'][_0xd6d3('0x19b')],'pass':_0x3b03ab[_0xd6d3('0x190')]['pass']};}if(this['isConfigured'](_0x4e95db['template_id'])){}logger['debug'](_0xd6d3('0x19c'),JSON[_0xd6d3('0x76')](_0x2b5008));this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x4e95db,_0x4e95db[_0xd6d3('0x19d')]);this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util['format'](_0xd6d3('0x19e'),_0x3b03ab[_0xd6d3('0x16')]));this[_0xd6d3('0x26')][_0xd6d3('0x73')](this,_0x161d11,_0x2b5008);return this['channel'][_0xd6d3('0xa9')](_0xd6d3('0x19f'));};AGIVertices[_0xd6d3('0x12')]['sendFax']=function(_0x16442e){logger['info'](util[_0xd6d3('0x2a')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x16442e[_0xd6d3('0x37')]));return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0x1a0'));};AGIVertices[_0xd6d3('0x12')]['sendSMS']=function(_0x57b358){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x57b358[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x57b358[_0xd6d3('0x1a1')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0x1a2'));}var _0x3539d0=this[_0xd6d3('0x34')][_0xd6d3('0x73')](this,_0x57b358[_0xd6d3('0x1a1')]);if(!_0x3539d0){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x57b358,_0xd6d3('0x1a3'));}var _0x349ac4={'body':_0x57b358[_0xd6d3('0x1a4')],'phone':_0x57b358['to']||'','SmsAccountId':_0x3539d0['id']};logger[_0xd6d3('0x1a5')]('sendSMS\x20message',JSON['stringify'](_0x349ac4));this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x57b358,_0x57b358[_0xd6d3('0x1a1')]);this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x1a6'),_0x3539d0[_0xd6d3('0x16')]));this[_0xd6d3('0x1a7')][_0xd6d3('0x73')](this,_0x349ac4);return this[_0xd6d3('0xf')][_0xd6d3('0xa9')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x1a8')]=function(_0x34a895){logger[_0xd6d3('0x2d')](util['format'](_0xd6d3('0x1a9'),_0x34a895['label']));if(!this[_0xd6d3('0x87')](_0x34a895['variable_id'])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x34a895,_0xd6d3('0x1aa'));}var _0x547b11=this[_0xd6d3('0x13')][_0xd6d3('0x73')](this,_0x34a895[_0xd6d3('0xd6')]);if(!_0x547b11){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x34a895,_0xd6d3('0xd8'));}return this['channel'][_0xd6d3('0xa0')](_0x547b11,_0x34a895[_0xd6d3('0x1ab')]);};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x1ac')]=function(_0x3f1fce){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x1ad'),_0x3f1fce[_0xd6d3('0x37')]));this[_0xd6d3('0xf')][_0xd6d3('0xa9')]('START\x20CALLY\x20SQUARE');if(_0x3f1fce['answer']===_0xd6d3('0x1ae')){this[_0xd6d3('0xf')][_0xd6d3('0xa9')]('Answer');return this[_0xd6d3('0xf')]['answer']();}return this['channel'][_0xd6d3('0xa9')](_0xd6d3('0x1af'));};AGIVertices['prototype'][_0xd6d3('0x1b0')]=function(_0xd09a33){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x1b1'),_0xd09a33[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0xd09a33[_0xd6d3('0x1b2')])){return this['channel'][_0xd6d3('0x33')](_0xd09a33,_0xd6d3('0x1b3'));}var _0x6a1fde=this[_0xd6d3('0x1a')][_0xd6d3('0x73')](this,_0xd09a33[_0xd6d3('0x1b2')]);if(!this['isConfigured'](_0x6a1fde)){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0xd09a33,util[_0xd6d3('0x2a')](_0xd6d3('0x1b4'),_0xd09a33[_0xd6d3('0x1b2')]));}if(_0x6a1fde===this['channel'][_0xd6d3('0x39')]){return this[_0xd6d3('0xf')]['error'](_0xd09a33,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xd6d3('0x36')]['sync'](this,_0xd09a33,_0x6a1fde);var _0x3424ab=this[_0xd6d3('0xf')][_0xd6d3('0x58')]('AGI',util[_0xd6d3('0x2a')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xd6d3('0x8')][_0xd6d3('0x197')]||_0xd6d3('0x1b5'),_0x6a1fde,this['channel']['arg_1']));if(_0x3424ab[_0xd6d3('0xa4')]===-0x1){return _0x3424ab;}return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x177'),_0xd6d3('0x1b6'),_0x6a1fde));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x1b7')]=function(_0x10f8da){logger[_0xd6d3('0x2d')](util['format'](_0xd6d3('0x1b8'),_0x10f8da['label']));var _0x553ca8=this[_0xd6d3('0x57')][_0xd6d3('0x73')](this,_0x10f8da['command']);this[_0xd6d3('0x36')][_0xd6d3('0x73')](this,_0x10f8da,_0x10f8da[_0xd6d3('0xb6')]);if(this['isConfigured'](_0x10f8da[_0xd6d3('0xd6')])){var _0x34936b=this[_0xd6d3('0x13')]['sync'](this,_0x10f8da[_0xd6d3('0xd6')]);if(_0x34936b){this['channel'][_0xd6d3('0xa0')](_0x34936b,_0x553ca8);return this['channel']['noop'](util[_0xd6d3('0x2a')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x10f8da['command'],_0x34936b));}}return this[_0xd6d3('0xf')]['noop'](util[_0xd6d3('0x2a')](_0xd6d3('0x1b9'),_0x10f8da[_0xd6d3('0xb6')]));};AGIVertices['prototype'][_0xd6d3('0x1ba')]=function(_0xc65ab5){logger['info'](util[_0xd6d3('0x2a')](_0xd6d3('0x1bb'),_0xc65ab5[_0xd6d3('0x37')]));_0xc65ab5[_0xd6d3('0x5d')]=_0xc65ab5['text'][_0xd6d3('0x189')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd6d3('0x87')](_0xc65ab5[_0xd6d3('0x5b')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0x1bc'));}if(!this[_0xd6d3('0x87')](_0xc65ab5[_0xd6d3('0x5d')])){return this[_0xd6d3('0xf')]['noop'](_0xd6d3('0xaa'));}this['channel'][_0xd6d3('0xa9')](util['format'](_0xd6d3('0x1bd'),_0xc65ab5['text']));var _0x119f8b=this['googleCloudTTS'][_0xd6d3('0x73')](this,_0xc65ab5);if(_0x119f8b){this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x119f8b));var _0x57ba33=this[_0xd6d3('0xf')]['streamFile'](_0x119f8b);try{fs[_0xd6d3('0x122')](_0x119f8b+'.wav');}catch(_0x75b1f9){logger[_0xd6d3('0x33')](_0x75b1f9);}return _0x57ba33;}return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0xc65ab5,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xd6d3('0x1be')]=function(_0x247166){logger['info'](util['format'](_0xd6d3('0x1bf'),_0x247166[_0xd6d3('0x37')]));_0x247166['text']=_0x247166[_0xd6d3('0x5d')][_0xd6d3('0x189')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd6d3('0x87')](_0x247166[_0xd6d3('0x5d')])){return this[_0xd6d3('0xf')][_0xd6d3('0xa9')](_0xd6d3('0xaa'));}this[_0xd6d3('0xf')]['noop'](util[_0xd6d3('0x2a')](_0xd6d3('0x1c0'),_0x247166[_0xd6d3('0x5d')]));var _0x2d34ab=this[_0xd6d3('0x64')][_0xd6d3('0x73')](this,_0x247166);if(_0x2d34ab){this['channel'][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x1c1'),_0x2d34ab));var _0x461e4b=this['channel']['streamFile'](_0x2d34ab);try{fs[_0xd6d3('0x122')](_0x2d34ab+_0xd6d3('0x101'));}catch(_0x429424){logger[_0xd6d3('0x33')](_0x429424);}return _0x461e4b;}return this['channel'][_0xd6d3('0x33')](_0x247166,_0xd6d3('0x1c2'));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x1c3')]=function(_0x56e28a){logger[_0xd6d3('0x2d')](util['format'](_0xd6d3('0x1c4'),_0x56e28a[_0xd6d3('0x37')]));if(!this[_0xd6d3('0x87')](_0x56e28a['findBy'])){return this[_0xd6d3('0xf')]['error'](_0x56e28a,'no\x20find\x20by\x20configured');}logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x158'),this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x56e28a[_0xd6d3('0x157')]));var _0x590135=this['agentUnpause'][_0xd6d3('0x73')](this,_0x56e28a[_0xd6d3('0x157')]);if(_0x590135){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x56e28a['findBy']));this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x159'),this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x56e28a[_0xd6d3('0x157')]));return{'code':0xc8,'result':_0xd6d3('0x15a')};}else{logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x15b'),this[_0xd6d3('0xf')][_0xd6d3('0x3a')],_0x56e28a['findBy']));this[_0xd6d3('0xf')][_0xd6d3('0xa9')](util[_0xd6d3('0x2a')](_0xd6d3('0x15b'),this['channel'][_0xd6d3('0x3a')],_0x56e28a['findBy']));return{'code':0xc8,'result':_0xd6d3('0x15c')};}};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x1c5')]=function(_0x55516c){logger['info'](util[_0xd6d3('0x2a')](_0xd6d3('0x1c6'),_0x55516c[_0xd6d3('0x37')]));var _0x295927=this[_0xd6d3('0xf')][_0xd6d3('0x58')](_0xd6d3('0x1c7'),[_0x55516c[_0xd6d3('0x1c8')],_0x55516c[_0xd6d3('0x7c')]]);if(_0x295927[_0xd6d3('0xa4')]===-0x1){return _0x295927;}return this[_0xd6d3('0xf')]['noop'](util[_0xd6d3('0x2a')](_0xd6d3('0x177'),_0xd6d3('0x1c7'),_0x55516c[_0xd6d3('0x1c8')]));};AGIVertices[_0xd6d3('0x12')][_0xd6d3('0x1c9')]=function(_0x1602ff){logger[_0xd6d3('0x2d')](util[_0xd6d3('0x2a')](_0xd6d3('0x1ca'),_0x1602ff[_0xd6d3('0x37')]));if(!this['isConfigured'](_0x1602ff['variable_id'])){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x1602ff,'no\x20variable\x20selected');}var _0x73d8b=this[_0xd6d3('0x13')][_0xd6d3('0x73')](this,_0x1602ff[_0xd6d3('0xd6')]);if(!_0x73d8b){return this[_0xd6d3('0xf')][_0xd6d3('0x33')](_0x1602ff,_0xd6d3('0xd8'));}var _0x50c704=this[_0xd6d3('0xf')]['getVariable'](_0x73d8b);return{'code':0xc8,'result':_0x50c704[_0xd6d3('0xa6')]?_0x50c704[_0xd6d3('0xa6')]:'-'};};String[_0xd6d3('0x12')]['replaceAll']=function(_0x20211b,_0x46e439){return this['split'](_0x20211b)[_0xd6d3('0x1cb')](_0x46e439);};module[_0xd6d3('0x1cc')]=AGIVertices;
\ No newline at end of file
+var _0x088d=['delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','providerResponse','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','%s/recordings/%s','beep','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','EVAL\x20CONDITION\x20%s\x20%s','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','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','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','%s[%s]','menu','no\x20file\x20audio\x20selected','getData','response','digit','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','macro','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','digits','saynumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','service','host','secure','authentication','auth','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','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','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','getdigits','getsecretdigits','channel','rpc','mailRpc','getVariable','then','name','getVoiceQueue','catch','getSquareProject','getSquareProjectById','prototype','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','map','Intervals','format','%s/sounds/converted/%s','open','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','label','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','url','timeout','number','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','sestekNDA','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_bot_name','googleASR','google_asr_language','tildeASR','clear','includes','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','isPlainObject','recursiveNodeIndex','length','saveRestApiResult','%s.%s','isArray','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','setVariable','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','agi','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','list_id','no\x20list\x20selected','add'];(function(_0x42d7a4,_0x196443){var _0x310ee7=function(_0x2430f9){while(--_0x2430f9){_0x42d7a4['push'](_0x42d7a4['shift']());}};_0x310ee7(++_0x196443);}(_0x088d,0x10a));var _0xd088=function(_0x443224,_0x3fc45a){_0x443224=_0x443224-0x0;var _0x1accd6=_0x088d[_0x443224];return _0x1accd6;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xd088('0x0'));var _=require(_0xd088('0x1'));var sh=require(_0xd088('0x2'));var odbc=require(_0xd088('0x3'))();var rs=require(_0xd088('0x4'));var moment=require(_0xd088('0x5'));var Mustache=require(_0xd088('0x6'));var rp=require('request-promise');var logger=require('../../config/logger')('agi');var config=require(_0xd088('0x7'));var scripts=require(_0xd088('0x8'));var FILES_PATH=_0xd088('0x9');var recursiveMapAttributes=[_0xd088('0xa'),_0xd088('0xb')];var verticesWithRetry=['menu',_0xd088('0xc'),_0xd088('0xd')];var AGIVertices=function(_0x121823,_0x27a18f,_0x45c05f){this[_0xd088('0xe')]=_0x121823;this[_0xd088('0xf')]=_0x27a18f;this[_0xd088('0x10')]=_0x45c05f;};AGIVertices['prototype'][_0xd088('0x11')]=function(_0x29af66,_0x432dc5){this['rpc']['getVariableById'](_0x29af66)[_0xd088('0x12')](function(_0x3c9df1){_0x432dc5(null,_0x3c9df1?_0x3c9df1[_0xd088('0x13')]:![]);})['catch'](function(_0xf63b13){_0x432dc5(_0xf63b13);});};AGIVertices['prototype'][_0xd088('0x14')]=function(_0x555df4,_0x2beb76){this[_0xd088('0xf')]['getVoiceQueueById'](_0x555df4)[_0xd088('0x12')](function(_0x158282){_0x2beb76(null,_0x158282?_0x158282[_0xd088('0x13')]:![]);})[_0xd088('0x15')](function(_0x4d0929){_0x2beb76(_0x4d0929);});};AGIVertices['prototype'][_0xd088('0x16')]=function(_0x334467,_0x1732e2){this[_0xd088('0xf')][_0xd088('0x17')](_0x334467)[_0xd088('0x12')](function(_0x18100f){_0x1732e2(null,_0x18100f?_0x18100f['name']:![]);})[_0xd088('0x15')](function(_0x22a3f5){_0x1732e2(_0x22a3f5);});};AGIVertices[_0xd088('0x18')][_0xd088('0x19')]=function(_0x5a49e2,_0x4efc1e){this[_0xd088('0xf')][_0xd088('0x1a')](_0x5a49e2)[_0xd088('0x12')](function(_0x1f887d){_0x4efc1e(null,_0x1f887d?_0x1f887d[_0xd088('0x1b')]:![]);})[_0xd088('0x15')](function(_0x3e754b){_0x4efc1e(_0x3e754b);});};AGIVertices[_0xd088('0x18')][_0xd088('0x1c')]=function(_0x254cad,_0x33d144){this[_0xd088('0xf')][_0xd088('0x1d')](_0x254cad)[_0xd088('0x12')](function(_0x293964){_0x33d144(null,_0x293964?_0x293964[_0xd088('0x13')]:![]);})['catch'](function(_0x4f6819){_0x33d144(_0x4f6819);});};AGIVertices[_0xd088('0x18')][_0xd088('0x1e')]=function(_0x5b9ee7,_0x724e73){this[_0xd088('0xf')][_0xd088('0x1f')](_0x5b9ee7)[_0xd088('0x12')](function(_0x569cd){_0x724e73(null,_0x569cd?_0x569cd[_0xd088('0x13')]:![]);})[_0xd088('0x15')](function(_0x287259){_0x724e73(_0x287259);});};AGIVertices[_0xd088('0x18')][_0xd088('0x20')]=function(_0x13ac32,_0x19d49f){var _0x10d432=this;this['rpc']['getSoundById'](_0x13ac32)[_0xd088('0x12')](function(_0x5212f4){_0x19d49f(null,_0x5212f4?_0x10d432[_0xd088('0x21')](_0x5212f4[_0xd088('0x22')]):![]);})['catch'](function(_0x320e93){_0x19d49f(_0x320e93);});};AGIVertices[_0xd088('0x18')][_0xd088('0x23')]=function(_0x1c7b31,_0x509d9e){this[_0xd088('0xf')][_0xd088('0x24')](_0x1c7b31)[_0xd088('0x12')](function(_0xec7e75){_0x509d9e(null,_0xec7e75?_0xec7e75:![]);})[_0xd088('0x15')](function(_0x5c74ac){_0x509d9e(_0x5c74ac);});};AGIVertices['prototype'][_0xd088('0x25')]=function(_0x38d387,_0x32e240,_0xc986){this['mailRpc'][_0xd088('0x25')](_0x38d387,_0x32e240)[_0xd088('0x12')](function(){_0xc986(null);})[_0xd088('0x15')](function(_0x254df7){_0xc986(_0x254df7);});};AGIVertices[_0xd088('0x18')][_0xd088('0x26')]=function(_0xb2d55c,_0x39df57){this[_0xd088('0xf')][_0xd088('0x27')](_0xb2d55c)[_0xd088('0x12')](function(_0x2d8be2){if(_0x2d8be2){if(_0x2d8be2['IntervalId']){_0x39df57(null,[_0x2d8be2['interval']]);}else{_0x39df57(null,_[_0xd088('0x28')](_0x2d8be2[_0xd088('0x29')],'interval'));}}else{_0x39df57(null,![]);}})['catch'](function(_0x3c1c8f){_0x39df57(_0x3c1c8f);});};AGIVertices[_0xd088('0x18')][_0xd088('0x21')]=function(_0x55a12a){return util[_0xd088('0x2a')](_0xd088('0x2b'),FILES_PATH,_0x55a12a);};AGIVertices['prototype']['getQueryOdbc']=function(_0x29339b,_0x3b8420,_0x3e6753){odbc[_0xd088('0x2c')](_0x29339b,function(_0x2f0aff){if(_0x2f0aff){logger['error']('Error\x20getting\x20ODBC\x20connection\x20%s',_0x2f0aff);_0x3e6753(_0x2f0aff);}else{logger['info']('ODBC\x20connection\x20successfully');odbc['query'](_0x3b8420,function(_0x3d7ebb,_0x43daea){if(_0x3d7ebb){logger['info'](_0xd088('0x2d'),_0x3b8420);_0x3e6753(_0x3d7ebb);}else{logger[_0xd088('0x2e')](_0xd088('0x2f'),_0x3b8420);odbc[_0xd088('0x30')](function(_0x575e85){if(_0x575e85){logger[_0xd088('0x31')](_0xd088('0x32'),_0x575e85);}_0x3e6753(null,_0x43daea);});}});}});};AGIVertices[_0xd088('0x18')][_0xd088('0x33')]=function(_0x1c0e4f,_0x1ef100){this[_0xd088('0xf')][_0xd088('0x34')](_0x1c0e4f)['then'](function(_0x156e41){_0x1ef100(null,_0x156e41?_0x156e41:![]);})['catch'](function(_0x1f5d6e){_0x1ef100(_0x1f5d6e);});};AGIVertices[_0xd088('0x18')][_0xd088('0x35')]=function(_0x3320bf,_0xccc785){this[_0xd088('0xf')][_0xd088('0x35')](_0x3320bf)[_0xd088('0x12')](function(_0x2b3587){_0xccc785(null,_0x2b3587);})['catch'](function(_0x16e8d9){_0xccc785(_0x16e8d9);});};AGIVertices['prototype']['createSquareDetailsReport']=function(_0x2f1ae4,_0x4649a7,_0x336f7c){this[_0xd088('0xf')][_0xd088('0x36')]({'uniqueid':this[_0xd088('0xe')]['uniqueid'],'node':_0x2f1ae4[_0xd088('0x37')],'application':_0x2f1ae4[_0xd088('0x38')],'data':_0x4649a7||null,'project_name':this[_0xd088('0xe')][_0xd088('0x39')],'callerid':this[_0xd088('0xe')][_0xd088('0x3a')]})[_0xd088('0x12')](function(_0x176267){if(_0x336f7c){_0x336f7c(null,_0x176267);}})[_0xd088('0x15')](function(_0x3e53f7){if(_0x336f7c){_0x336f7c(_0x3e53f7);}});};AGIVertices[_0xd088('0x18')]['createSquareRecording']=function(_0x546af7,_0x2e600b,_0x7eca17,_0x83dae6){this['rpc'][_0xd088('0x3b')]({'uniqueid':this[_0xd088('0xe')][_0xd088('0x3c')],'callerid':this[_0xd088('0xe')][_0xd088('0x3a')],'calleridname':this[_0xd088('0xe')][_0xd088('0x3d')],'context':this[_0xd088('0xe')]['context'],'extension':this[_0xd088('0xe')][_0xd088('0x3e')],'priority':this[_0xd088('0xe')][_0xd088('0x3f')],'accountcode':this[_0xd088('0xe')][_0xd088('0x40')],'dnid':this[_0xd088('0xe')][_0xd088('0x41')],'projectName':this['channel'][_0xd088('0x39')],'saveName':_0x2e600b,'filename':_0x546af7[_0xd088('0x42')]||_0x2e600b,'savePath':_0x7eca17})[_0xd088('0x12')](function(_0xd1cca2){_0x83dae6(null,_0xd1cca2);})[_0xd088('0x15')](function(_0xccf33c){_0x83dae6(_0xccf33c);});};AGIVertices[_0xd088('0x18')][_0xd088('0x43')]=function(_0x35a09f,_0x381bea,_0x17d165,_0x2a8f99,_0x45fb3e){this['rpc'][_0xd088('0x43')]({'uniqueid':this['channel']['uniqueid'],'body':_0x35a09f,'direction':_0x381bea,'providerName':_0x17d165,'providerResponse':_0x2a8f99})[_0xd088('0x12')](function(_0x4b1267){if(_0x45fb3e){_0x45fb3e(null,_0x4b1267);}})[_0xd088('0x15')](function(_0x8f5b06){if(_0x45fb3e){_0x45fb3e(_0x8f5b06);}});};AGIVertices['prototype'][_0xd088('0x44')]=function(_0x43681a,_0x37cb43){this[_0xd088('0xf')][_0xd088('0x44')]({'firstName':_[_0xd088('0x45')](_0x43681a[_0xd088('0x13')])||_[_0xd088('0x46')](_0x43681a['name'])?'callback_'+Math[_0xd088('0x47')]():_0x43681a[_0xd088('0x13')],'lastName':_['isEmpty'](_0x43681a['lastName'])||_['isNil'](_0x43681a[_0xd088('0x48')])?null:_0x43681a['lastName'],'phone':_0x43681a[_0xd088('0x49')],'ListId':_0x43681a['list_id'],'scheduledat':_0x43681a[_0xd088('0x4a')],'callbackUniqueid':this['channel'][_0xd088('0x3c')],'tags':_0xd088('0x4b'),'description':_0xd088('0x4c')+_0x43681a['scheduledAt'][_0xd088('0x4d')](),'priority':_0x43681a[_0xd088('0x4e')]})[_0xd088('0x12')](function(_0x2922e6){_0x37cb43(null,_0x2922e6);})[_0xd088('0x15')](function(_0x237526){_0x37cb43(_0x237526);});};AGIVertices[_0xd088('0x18')][_0xd088('0x4f')]=function(_0x81c6,_0x19f1f4){this['rpc'][_0xd088('0x50')](_0x81c6)[_0xd088('0x12')](function(_0x1bd22b){_0x19f1f4(null,_0x1bd22b?_0x1bd22b[_0xd088('0x13')]:![]);})[_0xd088('0x15')](function(_0xc82a73){_0x19f1f4(_0xc82a73);});};AGIVertices[_0xd088('0x18')][_0xd088('0x51')]=function(_0xb00c0c,_0x1fcf86,_0x1f82f0){var _0x2bc191={'role':_0xd088('0x52')};_0x2bc191[_0xb00c0c]=this[_0xd088('0xe')][_0xd088('0x3a')];this[_0xd088('0xf')][_0xd088('0x51')](_0x2bc191,_0x1fcf86,this['channel'][_0xd088('0x3c')])[_0xd088('0x12')](function(_0x374faf){_0x1f82f0(null,_['isNil'](_0x374faf)?![]:!![]);})[_0xd088('0x15')](function(_0x3a1965){logger[_0xd088('0x31')](_0x3a1965);_0x1f82f0(null,![]);});};AGIVertices[_0xd088('0x18')]['agentUnpause']=function(_0x328d3d,_0x523f2b){var _0x195b1c={'role':_0xd088('0x52')};_0x195b1c[_0x328d3d]=this[_0xd088('0xe')]['callerid'];this[_0xd088('0xf')][_0xd088('0x53')](_0x195b1c)[_0xd088('0x12')](function(_0x104867){_0x523f2b(null,_[_0xd088('0x46')](_0x104867)?![]:!![]);})[_0xd088('0x15')](function(_0x307ed9){logger[_0xd088('0x31')](_0x307ed9);_0x523f2b(null,![]);});};AGIVertices['prototype'][_0xd088('0x54')]=function(_0x16d3d8,_0x1a5ba1){var _0x142e30={'role':_0xd088('0x52')};_0x142e30[_0x16d3d8]=this[_0xd088('0xe')]['callerid'];this[_0xd088('0xf')]['agentLogout'](_0x142e30)['then'](function(_0x534b5){_0x1a5ba1(null,_[_0xd088('0x46')](_0x534b5)?![]:!![]);})[_0xd088('0x15')](function(_0x2b0cfd){logger[_0xd088('0x31')](_0x2b0cfd);_0x1a5ba1(null,![]);});};AGIVertices['prototype'][_0xd088('0x55')]=function(_0x3c0373,_0x146a78){var _0x5a7c80={'role':_0xd088('0x52')};_0x5a7c80[_0x3c0373]=this[_0xd088('0xe')][_0xd088('0x3a')];var _0x3ff9cb=_0x3c0373!=_0xd088('0x56')?util['format'](_0xd088('0x57'),_0xd088('0x58'),this[_0xd088('0xe')][_0xd088('0x3a')]):undefined;this['rpc'][_0xd088('0x55')](_0x5a7c80,_0x3ff9cb)[_0xd088('0x12')](function(_0x478011){_0x146a78(null,_[_0xd088('0x46')](_0x478011)?![]:!![]);})[_0xd088('0x15')](function(_0xf645d6){logger[_0xd088('0x31')](_0xf645d6);_0x146a78(null,![]);});};AGIVertices[_0xd088('0x18')]['shellCommand']=function(_0x36a228,_0x453eed){sh[_0xd088('0x59')](_[_0xd088('0x5a')](_0x36a228),function(_0x28e3f5,_0x14d3ef){var _0x3e03a8=_0x14d3ef[_0xd088('0x5b')](/(\r\n|\n|\r)/gm,'');_0x453eed(null,_0x3e03a8);});};AGIVertices['prototype'][_0xd088('0x5c')]=function(_0x4694f5,_0x18be7d){scripts['googleCloudTTS'](_0x4694f5[_0xd088('0x5d')],_0x4694f5[_0xd088('0x5e')]||_0xd088('0x5f'),_0x4694f5[_0xd088('0x5f')],_0x4694f5[_0xd088('0x60')]||_0xd088('0x61'),_0x4694f5[_0xd088('0x62')]||_0xd088('0x63'),_0x4694f5['audioEncoding']||_0xd088('0x64'))[_0xd088('0x12')](function(_0x27c945){_0x18be7d(null,_0x27c945);})[_0xd088('0x15')](function(_0x180c45){_0x18be7d(_0x180c45);});};AGIVertices[_0xd088('0x18')][_0xd088('0x65')]=function(_0x4b593c,_0x4013ce){scripts[_0xd088('0x65')](_0x4b593c[_0xd088('0x5f')],_0x4b593c[_0xd088('0x66')]||'en',0x1)[_0xd088('0x12')](function(_0x46097f){_0x4013ce(null,_0x46097f);})[_0xd088('0x15')](function(_0x2a9ab8){_0x4013ce(_0x2a9ab8);});};AGIVertices[_0xd088('0x18')]['restAPI']=function(_0x19c5d1,_0x3fcc68){var _0x2b4865={'uri':_0x19c5d1[_0xd088('0x67')],'method':_0x19c5d1['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x19c5d1[_0xd088('0x68')])===_0xd088('0x69')&&parseInt(_0x19c5d1[_0xd088('0x68')])>=0x1?parseInt(_0x19c5d1[_0xd088('0x68')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST','PUT'],_0x2b4865[_0xd088('0x6a')][_0xd088('0x6b')]())){try{_0x2b4865[_0xd088('0x6c')]=_0x19c5d1[_0xd088('0xb')]?JSON[_0xd088('0x6d')](_0x19c5d1[_0xd088('0xb')]):{};}catch(_0x5f320e){logger[_0xd088('0x31')](_0xd088('0x6e'),_0x5f320e);}}try{_0x2b4865['headers']=_0x19c5d1[_0xd088('0xa')]?JSON[_0xd088('0x6d')](_0x19c5d1['rawHeaders']):{};}catch(_0x2fbdf6){logger[_0xd088('0x31')](_0xd088('0x6f'),_0x2fbdf6);}if(_0x19c5d1[_0xd088('0x70')]){try{var _0x3a98fb=require(_0x19c5d1[_0xd088('0x70')])[_0xd088('0x71')](this,_0x2b4865);_0x2b4865['uri']=Mustache[_0xd088('0x72')](_0x19c5d1[_0xd088('0x67')],_0x3a98fb,{},['$$','$$']);if(_0x2b4865[_0xd088('0x73')]){_0x2b4865[_0xd088('0x73')]=JSON[_0xd088('0x6d')](Mustache[_0xd088('0x72')](JSON[_0xd088('0x74')](_0x2b4865[_0xd088('0x73')]),_0x3a98fb,{},['$$','$$']));}if(_0x2b4865['body']){_0x2b4865[_0xd088('0x6c')]=JSON[_0xd088('0x6d')](Mustache[_0xd088('0x72')](JSON['stringify'](_0x2b4865[_0xd088('0x6c')]),_0x3a98fb,{},['$$','$$']));}}catch(_0x2e6898){logger['error'](_0xd088('0x75'),_0x2e6898);}}rp(_0x2b4865)[_0xd088('0x12')](function(_0xe7da0c){var _0xf7d20a={'statusCode':_0xe7da0c['statusCode']||0xc8,'statusMessage':_0xe7da0c[_0xd088('0x76')]||'OK','headers':_0xe7da0c[_0xd088('0x73')]||{},'body':_0xe7da0c[_0xd088('0x6c')]||{}};_0x3fcc68(null,_0xf7d20a);})[_0xd088('0x15')](function(_0x276fa8){var _0x5b317f={'statusCode':_0x276fa8[_0xd088('0x77')]||0x1f4,'statusMessage':_0x276fa8[_0xd088('0x78')]||_0xd088('0x79'),'headers':_0x276fa8[_0xd088('0x7a')][_0xd088('0x73')]||{},'body':_0x276fa8['options'][_0xd088('0x6c')]||{}};_0x3fcc68(null,_0x5b317f);});};AGIVertices[_0xd088('0x18')][_0xd088('0x7b')]=function(_0x2a61bf,_0x1a24e0){scripts['googleDialogflow'](this['channel'][_0xd088('0x3c')],_0x2a61bf['key'],_0x2a61bf[_0xd088('0x5f')],_0x2a61bf['dialogflow_language']||'en')['then'](function(_0x5c75a6){_0x1a24e0(null,_0x5c75a6);})[_0xd088('0x15')](function(_0x581e52){_0x1a24e0(_0x581e52);});};AGIVertices[_0xd088('0x18')][_0xd088('0x7c')]=function(_0xa13df8,_0x1022ad){scripts[_0xd088('0x7c')](this['channel']['uniqueid'],_0xa13df8[_0xd088('0x7d')],_0xa13df8[_0xd088('0x7e')],_0xa13df8[_0xd088('0x7f')],_0xa13df8[_0xd088('0x5f')],_0xa13df8['dialogflowV2_language']||'en')[_0xd088('0x12')](function(_0x56a468){_0x1022ad(null,_0x56a468);})[_0xd088('0x15')](function(_0x5a94d6){_0x1022ad(_0x5a94d6);});};AGIVertices[_0xd088('0x18')][_0xd088('0x80')]=function(_0xac8de2,_0x21a476){scripts[_0xd088('0x80')](this[_0xd088('0xe')],_0xac8de2)[_0xd088('0x12')](function(_0x5f19e5){_0x21a476(null,_0x5f19e5);})[_0xd088('0x15')](function(_0x1152c9){_0x21a476(_0x1152c9);});};AGIVertices['prototype']['ispeechTTS']=function(_0xf494e8,_0xb4ab1c){scripts['ispeechTTS'](_0xf494e8[_0xd088('0x81')],_0xf494e8[_0xd088('0x5f')],_0xf494e8[_0xd088('0x82')]||_0xd088('0x61'),_0xf494e8[_0xd088('0x83')])[_0xd088('0x12')](function(_0x1a01bb){_0xb4ab1c(null,_0x1a01bb);})[_0xd088('0x15')](function(_0x190089){_0xb4ab1c(_0x190089);});};AGIVertices[_0xd088('0x18')][_0xd088('0x84')]=function(_0x1fb319,_0x11899a,_0x18c7af){scripts[_0xd088('0x84')](_0x11899a,_0x1fb319[_0xd088('0x81')],_0x1fb319[_0xd088('0x85')]||_0xd088('0x61'),this[_0xd088('0x86')](_0x1fb319[_0xd088('0x87')])?_0x1fb319[_0xd088('0x87')]:undefined)['then'](function(_0xdb8a1b){_0x18c7af(null,_0xdb8a1b);})[_0xd088('0x15')](function(_0x22ae45){_0x18c7af(_0x22ae45);});};AGIVertices['prototype']['awsPolly']=function(_0xb92fdd,_0x99265f){scripts[_0xd088('0x88')](_0xb92fdd['aws_access_key_id'],_0xb92fdd[_0xd088('0x89')],_0xb92fdd[_0xd088('0x8a')],_0xb92fdd[_0xd088('0x8b')]||'Amy',_0xb92fdd[_0xd088('0x5f')],_0xb92fdd[_0xd088('0x8c')]||_0xd088('0x5f'))['then'](function(_0xa295eb){_0x99265f(null,_0xa295eb);})[_0xd088('0x15')](function(_0x3c0f98){_0x99265f(_0x3c0f98);});};AGIVertices['prototype'][_0xd088('0x8d')]=function(_0x20c91f,_0x570bcd){scripts['awsLex'](this[_0xd088('0xe')][_0xd088('0x3c')],_0x20c91f[_0xd088('0x8e')],_0x20c91f[_0xd088('0x89')],_0x20c91f['aws_lex_region'],_0x20c91f[_0xd088('0x5f')],_0x20c91f[_0xd088('0x8f')])[_0xd088('0x12')](function(_0x11158a){_0x570bcd(null,_0x11158a);})[_0xd088('0x15')](function(_0x27f834){_0x570bcd(_0x27f834);});};AGIVertices[_0xd088('0x18')][_0xd088('0x90')]=function(_0x1d4b8d,_0x2e5b87,_0xe6c68a){scripts[_0xd088('0x90')](_0x2e5b87,_0x1d4b8d['key'],_0x1d4b8d[_0xd088('0x91')]||_0xd088('0x61'))['then'](function(_0x1b34d7){_0xe6c68a(null,_0x1b34d7);})[_0xd088('0x15')](function(_0x33a78f){_0xe6c68a(_0x33a78f);});};AGIVertices[_0xd088('0x18')][_0xd088('0x92')]=function(_0x437dd0,_0x5bbe26,_0x457bff){scripts[_0xd088('0x92')](_0x5bbe26,_0x437dd0['appid'],_0x437dd0['appsecret'],_0x437dd0['uri'])[_0xd088('0x12')](function(_0x14cd2d){_0x457bff(null,_0x14cd2d);})['catch'](function(_0x413288){_0x457bff(_0x413288);});};AGIVertices[_0xd088('0x18')][_0xd088('0x93')]=function(_0x470a34){var _0x46aed8=_[_0xd088('0x94')](verticesWithRetry,_0x470a34[_0xd088('0x38')])?_0x470a34:_[_0xd088('0x95')](_0x470a34);for(var _0x2ab927 in _0x46aed8){if(_0x46aed8[_0xd088('0x96')](_0x2ab927)){if(_0x46aed8[_0x2ab927]&&_[_0xd088('0x97')](_0x46aed8[_0x2ab927])){if(_[_0xd088('0x94')](recursiveMapAttributes,_0x2ab927)){_0x46aed8[_0x2ab927]=this[_0xd088('0x98')](_0x46aed8[_0x2ab927]);}else{_0x46aed8[_0x2ab927]=this[_0xd088('0x99')](_0x46aed8[_0x2ab927]);}}}}return _0x46aed8;};AGIVertices[_0xd088('0x18')]['recursiveNodeIndex']=function(_0x523b25){for(var _0x3ade79 in _0x523b25){if(_0x523b25[_0xd088('0x96')](_0x3ade79)){if(_[_0xd088('0x9a')](_0x523b25[_0x3ade79])){this[_0xd088('0x9b')](_0x523b25[_0x3ade79]);}else if(_['isArray'](_0x523b25[_0x3ade79])){for(var _0x334a43=0x0;_0x334a43<_0x523b25[_0x3ade79][_0xd088('0x9c')];_0x334a43++){this[_0xd088('0x9b')](_0x523b25[_0x3ade79][_0x334a43]);}}else if(_[_0xd088('0x97')](_0x523b25[_0x3ade79])){_0x523b25[_0x3ade79]=this['replaceAllVariables'](_0x523b25[_0x3ade79]);}}}};AGIVertices['prototype'][_0xd088('0x9d')]=function(_0x45ada6,_0x5738b8){for(var _0x428ddc in _0x45ada6){if(_0x45ada6[_0xd088('0x96')](_0x428ddc)){if(_[_0xd088('0x9a')](_0x45ada6[_0x428ddc])){if(!_[_0xd088('0x45')](_0x45ada6[_0x428ddc])){this['saveRestApiResult'](_0x45ada6[_0x428ddc],util['format'](_0xd088('0x9e'),_0x5738b8,_0x428ddc));}}else if(_[_0xd088('0x9f')](_0x45ada6[_0x428ddc])){for(var _0x1184ce=0x0;_0x1184ce<_0x45ada6[_0x428ddc]['length'];_0x1184ce++){this[_0xd088('0x9d')](_0x45ada6[_0x428ddc][_0x1184ce],util[_0xd088('0x2a')](_0xd088('0x9e'),_0x5738b8,_0x428ddc+'['+_0x1184ce+']'));}}else{if(!_[_0xd088('0x46')](_0x45ada6[_0x428ddc])){this['channel']['setVariable'](util[_0xd088('0x2a')](_0xd088('0x9e'),_0x5738b8,_0x428ddc),_0x45ada6[_0x428ddc]);}}}}};AGIVertices[_0xd088('0x18')][_0xd088('0x98')]=function(_0x5dd05b){try{var _0x4b43b0=JSON[_0xd088('0x6d')](_0x5dd05b);this['recursiveNodeIndex'](_0x4b43b0);return JSON[_0xd088('0x74')](_0x4b43b0);}catch(_0x45789b){return this['replaceAllVariables'](_0x5dd05b);}};AGIVertices['prototype'][_0xd088('0x99')]=function(_0x174ac9){var _0x9e6733=_0x174ac9[_0xd088('0xa0')]('{');for(var _0x4a2c28=0x1;_0x4a2c28<_0x9e6733[_0xd088('0x9c')];_0x4a2c28+=0x1){var _0x1a6273=_0x9e6733[_0x4a2c28][_0xd088('0xa0')]('}');if(_0x1a6273[_0xd088('0x9c')]>0x1){_0x174ac9=_0x174ac9[_0xd088('0xa1')]('{'+_0x1a6273[0x0]+'}',this[_0xd088('0xe')]['getVariable'](_0x1a6273[0x0])['extra']||_0x1a6273[0x0]);}}if(_0x9e6733[_0xd088('0x9c')]===0x1){return _0x174ac9['toString']();}return this[_0xd088('0x99')](_0x174ac9);};AGIVertices[_0xd088('0x18')][_0xd088('0xa2')]=function(_0x539dd3,_0x371143){var _0xbee2dd=this[_0xd088('0xe')][_0xd088('0x11')](_0x539dd3);if(_0xbee2dd[_0xd088('0xa3')]===-0x1){return _0xbee2dd;}logger['info'](util[_0xd088('0x2a')](_0xd088('0xa4'),_0x371143,_0xbee2dd[_0xd088('0xa5')]));return this[_0xd088('0xe')][_0xd088('0xa6')](_0x371143,_0xbee2dd[_0xd088('0xa5')]);};AGIVertices[_0xd088('0x18')][_0xd088('0x86')]=function(_0x5c6a0b){return _0x5c6a0b&&_0x5c6a0b!=='0'&&_0x5c6a0b!=='-1'&&_0x5c6a0b!=='';};AGIVertices['prototype']['maxRetry']=function(_0x92e69c){this[_0xd088('0x36')]['sync'](this,_0x92e69c,'-');_0x92e69c[_0xd088('0xa7')]=_0x92e69c[_0xd088('0xa8')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xd088('0x18')][_0xd088('0xa9')]=function(_0x35d02d){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xaa'),_0x35d02d[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x35d02d[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}var _0x27e5bf='\x22'+_0x35d02d[_0xd088('0x5f')]+'\x22';if(this[_0xd088('0x86')](_0x35d02d[_0xd088('0x7a')])){_0x27e5bf+=','+_0x35d02d[_0xd088('0x7a')];}var _0x22e3db=this['channel'][_0xd088('0x59')](_0xd088('0xad'),_0x27e5bf);if(_0x22e3db[_0xd088('0xa3')]===-0x1){return _0x22e3db;}return this['channel']['noop'](util['format'](_0xd088('0xae'),_0x27e5bf));};AGIVertices['prototype'][_0xd088('0xaf')]=function(_0x42ad34){logger[_0xd088('0x2e')](util['format'](_0xd088('0xb0'),_0x42ad34['label']));if(!this['isConfigured'](_0x42ad34[_0xd088('0xb1')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xb2'));}var _0x2eda42=_0x42ad34[_0xd088('0xb1')];if(this[_0xd088('0x86')](_0x42ad34[_0xd088('0x7a')])){_0x2eda42+=','+_0x42ad34[_0xd088('0x7a')];}var _0x21d481=this[_0xd088('0xe')][_0xd088('0x59')](_0xd088('0xb3'),_0x2eda42);if(_0x21d481['result']===-0x1){return _0x21d481;}var _0x1fedf4=this[_0xd088('0xa2')](_0xd088('0xb4'),'MRCP_RECOG_CONFIDENCE');if(_0x1fedf4[_0xd088('0xa3')]===-0x1){return _0x1fedf4;}var _0x17517c=this[_0xd088('0xa2')](_0xd088('0xb5'),'MRCP_RECOG_TRANSCRIPT');if(_0x17517c['result']===-0x1){return _0x17517c;}var _0xa7327=this[_0xd088('0xa2')](_0xd088('0xb6'),_0xd088('0xb7'));if(_0xa7327[_0xd088('0xa3')]===-0x1){return _0xa7327;}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('Executed\x20command\x20MRCPRecog\x20%s',_0x2eda42));};AGIVertices[_0xd088('0x18')][_0xd088('0xb8')]=function(_0x19a292){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xb9'),_0x19a292[_0xd088('0x37')]));return this[_0xd088('0xe')]['agi']([_0x19a292[_0xd088('0xba')],_0x19a292[_0xd088('0xbb')]]);};AGIVertices[_0xd088('0x18')][_0xd088('0xbc')]=function(_0x2d83b6){logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2d83b6[_0xd088('0x37')]));if(this['isConfigured'](_0x2d83b6[_0xd088('0x68')])){logger[_0xd088('0x2e')](util['format'](_0xd088('0xbd'),_0x2d83b6['timeout']));var _0x281f73=this[_0xd088('0xe')][_0xd088('0xbe')](_0x2d83b6['timeout']);if(_0x281f73['result']===-0x1){return _0x281f73;}}return this[_0xd088('0xe')][_0xd088('0xbc')]();};AGIVertices['prototype'][_0xd088('0x4b')]=function(_0x5a8791){logger[_0xd088('0x2e')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x5a8791[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x5a8791[_0xd088('0xbf')])){return this['channel']['error'](_0x5a8791,_0xd088('0xc0'));}_0x5a8791[_0xd088('0x4a')]=moment();if(this['isConfigured'](_0x5a8791['delay'])){_0x5a8791[_0xd088('0x4a')]=moment()[_0xd088('0xc1')](_0x5a8791[_0xd088('0xc2')],_0xd088('0xc3'));}if(!this['isConfigured'](_0x5a8791[_0xd088('0x4e')])){_0x5a8791[_0xd088('0x4e')]=0x2;}this[_0xd088('0x44')]['sync'](this,_0x5a8791);return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x5a8791[_0xd088('0x49')],_0x5a8791[_0xd088('0xbf')],_0x5a8791['scheduledAt']));};AGIVertices[_0xd088('0x18')][_0xd088('0xc4')]=function(_0x308aca){logger['info'](util[_0xd088('0x2a')](_0xd088('0xc5'),_0x308aca[_0xd088('0x37')]));var _0x4ce2b4=this[_0xd088('0xe')][_0xd088('0x59')](_0x308aca[_0xd088('0xc6')],_0x308aca['options']);if(_0x4ce2b4[_0xd088('0xa3')]===-0x1){return _0x4ce2b4;}return this['channel']['noop'](util['format'](_0xd088('0xc7'),_0x308aca[_0xd088('0xc6')],_0x308aca['options']));};AGIVertices['prototype'][_0xd088('0xc8')]=function(_0x248f0b){logger['info'](util['format'](_0xd088('0xc9'),_0x248f0b[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x248f0b[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}var _0x970aaa='\x22'+_0x248f0b[_0xd088('0x5f')]+'\x22';if(this['isConfigured'](_0x248f0b[_0xd088('0x7a')])){_0x970aaa+=','+_0x248f0b['options'];}var _0x13b85c=this[_0xd088('0xe')][_0xd088('0x59')](_0xd088('0xad'),_0x970aaa);if(_0x13b85c[_0xd088('0xa3')]===-0x1){return _0x13b85c;}return this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x970aaa));};AGIVertices[_0xd088('0x18')][_0xd088('0xca')]=function(_0x8d9a74){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xcb'),_0x8d9a74[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x8d9a74[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}var _0x83aba6='\x22'+_0x8d9a74[_0xd088('0x5f')]+'\x22';if(this[_0xd088('0x86')](_0x8d9a74[_0xd088('0x7a')])){_0x83aba6+=','+_0x8d9a74[_0xd088('0x7a')];}var _0x58e313=this['channel']['exec'](_0xd088('0xad'),_0x83aba6);if(_0x58e313[_0xd088('0xa3')]===-0x1){return _0x58e313;}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xae'),_0x83aba6));};AGIVertices[_0xd088('0x18')][_0xd088('0xcc')]=function(_0x3c1b69){logger[_0xd088('0x2e')](util['format'](_0xd088('0xcd'),_0x3c1b69[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x3c1b69['grammar'])){return this[_0xd088('0xe')][_0xd088('0xab')]('no\x20grammar\x20configured');}var _0x52672e=_0x3c1b69[_0xd088('0xb1')];if(this[_0xd088('0x86')](_0x3c1b69[_0xd088('0x7a')])){_0x52672e+=','+_0x3c1b69[_0xd088('0x7a')];}var _0x433221=this[_0xd088('0xe')][_0xd088('0x59')](_0xd088('0xb3'),_0x52672e);if(_0x433221[_0xd088('0xa3')]===-0x1){return _0x433221;}var _0xea6b66=this[_0xd088('0xa2')](_0xd088('0xb4'),_0xd088('0xce'));if(_0xea6b66[_0xd088('0xa3')]===-0x1){return _0xea6b66;}var _0x179e2f=this[_0xd088('0xa2')]('RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT');if(_0x179e2f[_0xd088('0xa3')]===-0x1){return _0x179e2f;}var _0x1f49e6=this[_0xd088('0xa2')](_0xd088('0xb6'),_0xd088('0xcf'));if(_0x1f49e6['result']===-0x1){return _0x1f49e6;}return this['channel']['noop'](util[_0xd088('0x2a')](_0xd088('0xd0'),_0x52672e));};AGIVertices[_0xd088('0x18')][_0xd088('0xd1')]=function(_0x2c46a0){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xd2'),_0x2c46a0[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x2c46a0['grammar'])){return this[_0xd088('0xe')]['noop'](_0xd088('0xb2'));}var _0x16f7d4=_0x2c46a0[_0xd088('0xb1')];if(this[_0xd088('0x86')](_0x2c46a0[_0xd088('0x7a')])){_0x16f7d4+=','+_0x2c46a0['options'];}var _0x1b44af=this[_0xd088('0xe')][_0xd088('0x59')](_0xd088('0xb3'),_0x16f7d4);if(_0x1b44af[_0xd088('0xa3')]===-0x1){return _0x1b44af;}var _0xdfede=this[_0xd088('0xa2')]('RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE');if(_0xdfede[_0xd088('0xa3')]===-0x1){return _0xdfede;}var _0x123464=this[_0xd088('0xa2')](_0xd088('0xb5'),_0xd088('0xd3'));if(_0x123464[_0xd088('0xa3')]===-0x1){return _0x123464;}var _0x224c64=this[_0xd088('0xa2')](_0xd088('0xb6'),_0xd088('0xd4'));if(_0x224c64[_0xd088('0xa3')]===-0x1){return _0x224c64;}return this[_0xd088('0xe')]['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x16f7d4));};AGIVertices['prototype']['database']=function(_0x4b3f8f){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xd5'),_0x4b3f8f[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x4b3f8f[_0xd088('0xd6')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x4b3f8f,_0xd088('0xd7'));}var _0x276d41=this[_0xd088('0x19')]['sync'](this,_0x4b3f8f[_0xd088('0xd6')]);if(!_0x276d41){return this[_0xd088('0xe')]['error'](_0x4b3f8f,_0xd088('0xd8'));}if(!this['isConfigured'](_0x4b3f8f[_0xd088('0xd9')])){return this[_0xd088('0xe')]['error'](_0x4b3f8f,'no\x20query\x20configured');}var _0x337ab4=_0x4b3f8f[_0xd088('0xd9')][_0xd088('0x5b')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xda'),_0x337ab4));var _0xb20c62=this[_0xd088('0xdb')][_0xd088('0x71')](this,_0x276d41,_0x337ab4);this['createSquareDetailsReport']['sync'](this,_0x4b3f8f,_0x337ab4);if(!this['isConfigured'](_0x4b3f8f[_0xd088('0xdc')])){return this['channel'][_0xd088('0xab')](_0xd088('0xdd'));}var _0x4a098a=this[_0xd088('0x11')][_0xd088('0x71')](this,_0x4b3f8f[_0xd088('0xdc')]);if(!_0x4a098a){return this[_0xd088('0xe')][_0xd088('0x31')](_0x4b3f8f,_0xd088('0xde'));}var _0x3bb4b0=this;_0xb20c62[_0xd088('0xdf')](function(_0x1ec3df,_0x3f2140){Object[_0xd088('0xe0')](_0x1ec3df)['forEach'](function(_0x502020){_0x3bb4b0[_0xd088('0xe')][_0xd088('0xa6')](util['format'](_0xd088('0xe1'),_0x4a098a,_0x3f2140,_0x502020),_0x1ec3df[_0x502020]);});});this[_0xd088('0xe')][_0xd088('0xa6')](util['format'](_0xd088('0xe2'),_0x4a098a),_0xb20c62[_0xd088('0x9c')]);return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xe3'),_0x4a098a));};AGIVertices[_0xd088('0x18')][_0xd088('0xe4')]=function(_0x647925){logger['debug'](util[_0xd088('0x2a')](_0xd088('0xe5'),_0x647925[_0xd088('0x37')]));if(!this['isConfigured'](_0x647925['sip_id'])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x647925,_0xd088('0xe6'));}var _0x533cf9=this[_0xd088('0x1c')][_0xd088('0x71')](this,_0x647925[_0xd088('0xe7')]);if(!_0x533cf9){return this[_0xd088('0xe')][_0xd088('0x31')](_0x647925,_0xd088('0xe8'));}var _0x1893f3=this['channel'][_0xd088('0x59')](_0xd088('0xe9'),[util[_0xd088('0x2a')](_0xd088('0xea'),_0x533cf9),_0x647925[_0xd088('0x68')],_0x647925[_0xd088('0xeb')],_0x647925[_0xd088('0x67')]]);if(_0x1893f3['result']===-0x1){return _0x1893f3;}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xec'),_0xd088('0xe9')));};AGIVertices[_0xd088('0x18')][_0xd088('0xed')]=function(_0x517412){logger[_0xd088('0x2e')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x517412[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x517412[_0xd088('0x81')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xee'));}if(!this['isConfigured'](_0x517412['text'])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}this[_0xd088('0xe')][_0xd088('0xef')]=!![];this[_0xd088('0x36')](_0x517412);this[_0xd088('0x43')](_0x517412[_0xd088('0x5f')],'in','','');this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x517412[_0xd088('0x5f')]));var _0x54197f=this[_0xd088('0x7b')][_0xd088('0x71')](this,_0x517412);if(_0x54197f){for(var _0x107910 in _0x54197f){if(_0x54197f[_0xd088('0x96')](_0x107910)){this[_0xd088('0xe')][_0xd088('0xa6')](util[_0xd088('0x2a')](_0xd088('0xf0'),_0x107910[_0xd088('0x6b')]()),_0x54197f[_0x107910]);}}this['createSquareMessage'](_0x54197f[_0xd088('0xf1')],'out','dialogflow','');return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xf2'),_0x54197f[_0xd088('0xf1')]));}return this['channel'][_0xd088('0x31')](_0x517412,_0xd088('0xf3'));};AGIVertices[_0xd088('0x18')][_0xd088('0xf4')]=function(_0x947153){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0xf5'),_0x947153[_0xd088('0x37')]));if(!this['isConfigured'](_0x947153[_0xd088('0x7d')])){return this[_0xd088('0xe')]['noop']('no\x20project_id\x20configured');}if(!this[_0xd088('0x86')](_0x947153[_0xd088('0x7e')])){return this['channel']['noop'](_0xd088('0xf6'));}if(!this[_0xd088('0x86')](_0x947153[_0xd088('0x7f')])){return this[_0xd088('0xe')]['noop'](_0xd088('0xf7'));}if(!this[_0xd088('0x86')](_0x947153['dialogflowV2_language'])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xf8'));}if(!this[_0xd088('0x86')](_0x947153[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')]('no\x20text\x20configured');}this[_0xd088('0xe')][_0xd088('0xef')]=!![];this[_0xd088('0x36')](_0x947153);this[_0xd088('0x43')](_0x947153[_0xd088('0x5f')],'in','','');this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')]('Trying\x20DialogflowV2:\x20%s',_0x947153[_0xd088('0x5f')]));var _0x1568b5=this[_0xd088('0x7c')][_0xd088('0x71')](this,_0x947153);if(_0x1568b5){for(var _0x35326d in _0x1568b5){if(_0x1568b5[_0xd088('0x96')](_0x35326d)){if(_0x35326d!==_0xd088('0xf9')){this['channel'][_0xd088('0xa6')](util[_0xd088('0x2a')](_0xd088('0xf0'),_0x35326d[_0xd088('0x6b')]()),_0x1568b5[_0x35326d]);}}}this['createSquareMessage'](_0x1568b5[_0xd088('0xf1')],'out','dialogflowV2',_0x1568b5['providerResponse']);return this[_0xd088('0xe')][_0xd088('0xab')](util['format']('DialogflowV2\x20Result\x20%s',_0x1568b5[_0xd088('0xf1')]));}return this[_0xd088('0xe')][_0xd088('0x31')](_0x947153,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0xd088('0x18')][_0xd088('0xfa')]=function(_0x41a9c){logger['info'](util['format'](_0xd088('0xfb'),_0x41a9c[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x41a9c[_0xd088('0xfc')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xfd'));}if(!this[_0xd088('0x86')](_0x41a9c[_0xd088('0xfe')])){return this['channel']['noop'](_0xd088('0xff'));}if(!this['isConfigured'](_0x41a9c[_0xd088('0x100')])){return this['channel']['noop'](_0xd088('0x101'));}if(!this[_0xd088('0x86')](_0x41a9c['ndassistant_url'])){return this[_0xd088('0xe')]['noop']('no\x20text\x20configured');}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x41a9c);this['createSquareMessage'](_0x41a9c[_0xd088('0x5f')],'in','','');this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x102'),_0x41a9c['text']));var _0xca11a0=this[_0xd088('0x80')][_0xd088('0x71')](this,_0x41a9c);if(_0xca11a0){for(var _0x30ce74 in _0xca11a0){if(_0xca11a0[_0xd088('0x96')](_0x30ce74)){this[_0xd088('0xe')][_0xd088('0xa6')](util[_0xd088('0x2a')]('SESTEK_NDA_%s',_0x30ce74[_0xd088('0x6b')]()),_0xca11a0[_0x30ce74]);}}this[_0xd088('0x43')](_0xca11a0[_0xd088('0xf1')],_0xd088('0x103'),_0xd088('0xfa'),'');if(_0xca11a0[_0xd088('0x104')]){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x105'),_0xca11a0[_0xd088('0x104')]));var _0x19c267=this[_0xd088('0xe')][_0xd088('0x106')](_0xca11a0[_0xd088('0x104')]);try{fs[_0xd088('0x107')](_0xca11a0['audiofile']+_0xd088('0x108'));}catch(_0xf165a5){logger[_0xd088('0x31')](_0xf165a5);}return _0x19c267;}else{return this[_0xd088('0xe')][_0xd088('0xab')](util['format'](_0xd088('0x109'),_0xca11a0[_0xd088('0xf1')]));}}return this[_0xd088('0xe')][_0xd088('0x31')](_0x41a9c,_0xd088('0x10a'));};AGIVertices[_0xd088('0x18')][_0xd088('0x10b')]=function(_0x49a56a){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x10c'),_0x49a56a[_0xd088('0x37')]));return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x10b'));};AGIVertices['prototype'][_0xd088('0x10d')]=function(_0x1afecb){logger['info'](util[_0xd088('0x2a')](_0xd088('0x10e'),_0x1afecb[_0xd088('0x37')]));var _0x216932='';if(_0x1afecb[_0xd088('0x10f')]){if(!this['isConfigured'](_0x1afecb[_0xd088('0x10f')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1afecb,_0xd088('0x110'));}else{var _0x4aaa47=parseInt(_0x1afecb[_0xd088('0x10f')],0xa);if(isNaN(_0x4aaa47)){_0x216932=_0x1afecb[_0xd088('0x10f')];}else{_0x216932=this['getTrunk']['sync'](this,_0x1afecb[_0xd088('0x10f')]);if(!_0x216932){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1afecb,'no\x20trunk\x20found');}}}}else if(_0x1afecb['trunk_name']){_0x216932=_0x1afecb[_0xd088('0x111')];}else{return this['channel'][_0xd088('0x31')](_0x1afecb,'no\x20trunk\x20selected');}var _0x445bd6=this[_0xd088('0xe')]['exec'](_0xd088('0xe9'),[util[_0xd088('0x2a')](_0xd088('0x112'),_0x216932,_0x1afecb[_0xd088('0x49')]),_0x1afecb[_0xd088('0x68')],_0x1afecb[_0xd088('0xeb')],_0x1afecb[_0xd088('0x67')]]);if(_0x445bd6[_0xd088('0xa3')]===-0x1){return _0x445bd6;}return this[_0xd088('0xe')]['noop'](util['format'](_0xd088('0xec'),_0xd088('0xe9')));};AGIVertices['prototype'][_0xd088('0x113')]=function(_0x313072){logger['info'](util['format'](_0xd088('0x114'),_0x313072['label']));return this[_0xd088('0xe')][_0xd088('0xab')]('finally');};AGIVertices[_0xd088('0x18')][_0xd088('0xc')]=function(_0x254a20){logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x254a20[_0xd088('0x37')]));if(_0x254a20[_0xd088('0xa7')]===0x0){return this[_0xd088('0xa8')](_0x254a20);}_0x254a20['retry']-=0x1;if(!this['isConfigured'](_0x254a20['file_id'])){return this[_0xd088('0xe')]['error'](_0x254a20,'no\x20file\x20audio\x20selected');}var _0x58a24e=this[_0xd088('0x20')]['sync'](this,_0x254a20[_0xd088('0x115')]);if(!_0x58a24e){return this[_0xd088('0xe')]['error'](_0x254a20,_0xd088('0x116'));}if(!this[_0xd088('0x86')](_0x254a20[_0xd088('0xdc')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0xd088('0xdd'));}var _0x29d64e=this[_0xd088('0xe')]['getData'](_0x58a24e,_0x254a20['response'],_0x254a20[_0xd088('0x117')]);var _0x135341=_0x29d64e[_0xd088('0xa3')]?_0x29d64e[_0xd088('0xa3')][_0xd088('0x4d')]():'';logger[_0xd088('0x2e')]('test',JSON[_0xd088('0x74')](_0x29d64e));if(_0x29d64e['result']===-0x1){this['createSquareDetailsReport'][_0xd088('0x71')](this,_0x254a20,_0x135341);return _0x29d64e;}else if(_0x29d64e[_0xd088('0xa5')]===_0xd088('0x68')){_0x29d64e['result']=_0x135341[_0xd088('0x9c')]>=parseInt(_0x254a20['mindigit'])?'x':'i';}else{_0x29d64e[_0xd088('0xa3')]=_0x135341['length']>=parseInt(_0x254a20[_0xd088('0x118')])&&_0x135341[_0xd088('0x9c')]<=parseInt(_0x254a20[_0xd088('0x117')])?'x':'i';}var _0x33388d=this[_0xd088('0x11')][_0xd088('0x71')](this,_0x254a20[_0xd088('0xdc')]);if(!_0x33388d){return this['channel'][_0xd088('0x31')](_0x254a20,_0xd088('0xde'));}this[_0xd088('0xe')][_0xd088('0xa6')](_0x33388d,_0x135341);if(this[_0xd088('0x86')](_0x254a20[_0xd088('0x119')])){var _0x4e0d3c=parseInt(_0x254a20[_0xd088('0x119')],0xa);var _0x2b3a76=rs[_0xd088('0x11a')]({'charset':'*','length':_0x4e0d3c});var _0x6f1b6b=_0x135341['length'];if(_0x6f1b6b>0x0){if(_0x6f1b6b>_0x4e0d3c){this[_0xd088('0x36')][_0xd088('0x71')](this,_0x254a20,_0x254a20[_0xd088('0x11b')]==='first'?_0x2b3a76+_0x135341['substr'](_0x4e0d3c):_0x135341[_0xd088('0x11c')](0x0,_0x6f1b6b-_0x4e0d3c)+_0x2b3a76);}else{this[_0xd088('0x36')][_0xd088('0x71')](this,_0x254a20,rs[_0xd088('0x11a')]({'charset':'*','length':_0x6f1b6b}));}}else{this[_0xd088('0x36')][_0xd088('0x71')](this,_0x254a20,'');}}else{this[_0xd088('0x36')][_0xd088('0x71')](this,_0x254a20,_0x135341);}return _0x29d64e;};AGIVertices[_0xd088('0x18')]['getsecretdigits']=function(_0x4dab55){logger['info'](util[_0xd088('0x2a')](_0xd088('0x11d'),_0x4dab55[_0xd088('0x37')]));return this[_0xd088('0xc')](_0x4dab55);};AGIVertices[_0xd088('0x18')][_0xd088('0x11e')]=function(_0x44f2cd){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x11f'),_0x44f2cd[_0xd088('0x37')]));this[_0xd088('0x36')][_0xd088('0x71')](this,_0x44f2cd,_0x44f2cd[_0xd088('0x120')]);return this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')](_0xd088('0x121'),_0x44f2cd[_0xd088('0x120')]));};AGIVertices[_0xd088('0x18')]['awspolly']=function(_0x5bb1ff){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x122'),_0x5bb1ff[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x5bb1ff['aws_access_key_id'])||!this['isConfigured'](_0x5bb1ff[_0xd088('0x89')])){return this['channel']['noop'](_0xd088('0x123'));}if(!this[_0xd088('0x86')](_0x5bb1ff['text'])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')](_0xd088('0x124'),_0x5bb1ff[_0xd088('0x5f')]));var _0x1181eb=this[_0xd088('0x88')][_0xd088('0x71')](this,_0x5bb1ff);if(_0x1181eb){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x125'),_0x1181eb));var _0x46b684=this[_0xd088('0xe')][_0xd088('0x106')](_0x1181eb);try{fs[_0xd088('0x107')](_0x1181eb+_0xd088('0x108'));}catch(_0x539ed6){logger[_0xd088('0x31')](_0x539ed6);}return _0x46b684;}return this['channel']['error'](_0x5bb1ff,_0xd088('0x126'));};AGIVertices[_0xd088('0x18')][_0xd088('0x127')]=function(_0x3a1771){logger['info'](util['format'](_0xd088('0x128'),_0x3a1771[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x3a1771[_0xd088('0x8e')])||!this[_0xd088('0x86')](_0x3a1771[_0xd088('0x89')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x123'));}if(!this[_0xd088('0x86')](_0x3a1771[_0xd088('0x8f')])){return this[_0xd088('0xe')]['noop'](_0xd088('0x129'));}if(!this[_0xd088('0x86')](_0x3a1771[_0xd088('0x5f')])){return this['channel']['noop'](_0xd088('0xac'));}this[_0xd088('0xe')][_0xd088('0xef')]=!![];this[_0xd088('0x36')](_0x3a1771);this[_0xd088('0x43')](_0x3a1771['text'],'in','','');this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')]('Trying\x20Amazon\x20Lex:\x20%s',_0x3a1771[_0xd088('0x5f')]));var _0x455a9d=this[_0xd088('0x8d')][_0xd088('0x71')](this,_0x3a1771);if(_0x455a9d){for(var _0x1d4e1a in _0x455a9d){if(_0x455a9d[_0xd088('0x96')](_0x1d4e1a)&&_['isString'](_0x455a9d[_0x1d4e1a])){this[_0xd088('0xe')][_0xd088('0xa6')](util[_0xd088('0x2a')]('AWS_LEX_%s',_0x1d4e1a[_0xd088('0x6b')]()),_0x455a9d[_0x1d4e1a]);}}if(_[_0xd088('0x46')](_0x455a9d[_0xd088('0x78')])){return this[_0xd088('0xe')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xd088('0x43')](_0x455a9d[_0xd088('0x78')],_0xd088('0x103'),_0xd088('0x12a'),'');return this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')](_0xd088('0x12b'),_0x455a9d[_0xd088('0x78')]));}}return this['channel']['error'](_0x3a1771,_0xd088('0x12c'));};AGIVertices[_0xd088('0x18')][_0xd088('0x12d')]=function(_0x1d9401){logger['info'](util['format'](_0xd088('0x12e'),_0x1d9401[_0xd088('0x37')],_0x1d9401[_0xd088('0x68')]));if(!this[_0xd088('0x86')](_0x1d9401[_0xd088('0x81')])){return this[_0xd088('0xe')][_0xd088('0xab')]('no\x20key\x20configured');}var _0x120440=_0xd088('0x12f');var _0x5d0970=util[_0xd088('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0xd088('0x11a')](0x4));var _0x96dc97=util[_0xd088('0x2a')](_0xd088('0x9e'),_0x5d0970,_0x120440);var _0x24b592=!![];if(_0x1d9401['beep']===_0xd088('0x130')){_0x24b592=![];}var _0x1d7157=this[_0xd088('0xe')][_0xd088('0x131')](_0x5d0970,_0x120440,_0x1d9401[_0xd088('0x132')],_0x1d9401['timeout'],undefined,_0x24b592);if(_0x1d7157[_0xd088('0xa3')]!==-0x1){this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x133'),_0x96dc97));var _0x3ecb69=this[_0xd088('0x90')][_0xd088('0x71')](this,_0x1d9401,_0x96dc97);if(_0x3ecb69){for(var _0x4cd4e8 in _0x3ecb69){if(_0x3ecb69[_0xd088('0x96')](_0x4cd4e8)){this[_0xd088('0xe')]['setVariable'](util['format'](_0xd088('0x134'),_0x4cd4e8['toUpperCase']()),_0x3ecb69[_0x4cd4e8]);}}return this[_0xd088('0xe')][_0xd088('0xab')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0xd088('0x74')](_0x3ecb69)));}}return _0x1d7157;};AGIVertices['prototype'][_0xd088('0x135')]=function(_0x1bb588){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x136'),_0x1bb588['label']));if(!this[_0xd088('0x86')](_0x1bb588[_0xd088('0x137')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x138'));}if(!this['isConfigured'](_0x1bb588[_0xd088('0x139')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x13a'));}var _0xe3bd98=_0xd088('0x12f');var _0x57fd84=util[_0xd088('0x2a')](_0xd088('0x13b'),FILES_PATH,rs[_0xd088('0x11a')](0x4));var _0x4f77e4=util[_0xd088('0x2a')](_0xd088('0x9e'),_0x57fd84,_0xe3bd98);var _0x208049=!![];if(_0x1bb588[_0xd088('0x13c')]==='NOBEEP'){_0x208049=![];}var _0x2cd7bc=this[_0xd088('0xe')][_0xd088('0x131')](_0x57fd84,_0xe3bd98,_0x1bb588[_0xd088('0x132')],_0x1bb588[_0xd088('0x68')],undefined,_0x208049);if(_0x2cd7bc['result']!==-0x1){this[_0xd088('0xe')][_0xd088('0xab')](util['format']('tilde\x20%s\x20file\x20created',_0x4f77e4));var _0xebd5e6=this[_0xd088('0x92')][_0xd088('0x71')](this,_0x1bb588,_0x4f77e4);if(_0xebd5e6){for(var _0x5d3932 in _0xebd5e6){if(_0xebd5e6[_0xd088('0x96')](_0x5d3932)){this[_0xd088('0xe')]['setVariable'](util[_0xd088('0x2a')]('TILDE_ASR_%s',_0x5d3932[_0xd088('0x6b')]()),_0xebd5e6[_0x5d3932]);}}return this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x13d'),JSON[_0xd088('0x74')](_0xebd5e6)));}}return _0x2cd7bc;};AGIVertices[_0xd088('0x18')]['gotoc']=function(_0x1fe147){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x13e'),_0x1fe147['label']));return this[_0xd088('0xe')][_0xd088('0x13f')](_0x1fe147[_0xd088('0x140')],_0x1fe147[_0xd088('0x3e')],_0x1fe147[_0xd088('0x3f')]);};AGIVertices[_0xd088('0x18')][_0xd088('0x141')]=function(_0x43c851){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x142'),_0x43c851['label']));if(!this['isConfigured'](_0x43c851[_0xd088('0x143')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x43c851,'no\x20condition\x20configured');}try{var _0x3dd7b1=eval(_0x43c851['condition'])?_0xd088('0x144'):'false';this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x145'),_0x43c851[_0xd088('0x143')],_0x3dd7b1));return{'code':0xc8,'result':_0x3dd7b1};}catch(_0x5bdf9b){return{'code':0xc8,'result':_0xd088('0x146')};}};AGIVertices['prototype'][_0xd088('0x147')]=function(_0x21af47){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x148'),_0x21af47[_0xd088('0x37')]));if(!this['isConfigured'](_0x21af47['interval_id'])){return this['channel'][_0xd088('0x31')](_0x21af47,'no\x20interval\x20configured');}var _0x20c47e=this['getIntervals']['sync'](this,_0x21af47['interval_id']);if(!_0x20c47e){return this['channel'][_0xd088('0x31')](_0x21af47,_0xd088('0x149'));}for(var _0x4f4629=0x0;_0x4f4629<_0x20c47e[_0xd088('0x9c')];_0x4f4629+=0x1){var _0xb53501=this['channel'][_0xd088('0x11')](util[_0xd088('0x2a')](_0xd088('0x14a'),_0x20c47e[_0x4f4629]));if(_0xb53501[_0xd088('0xa3')]===-0x1){return _0xb53501;}logger[_0xd088('0x2e')](util['format'](_0xd088('0x14b'),_0x20c47e[_0x4f4629],_0xb53501[_0xd088('0xa5')]));if(_0xb53501[_0xd088('0xa5')]==='true'){logger[_0xd088('0x2e')](util['format']('IFTIME\x20%s\x20%s',_0x20c47e[_0x4f4629],'true'));this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')](_0xd088('0x14b'),_0x20c47e[_0x4f4629],'true'));return{'code':0xc8,'result':_0xd088('0x144')};}else{logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('IFTIME\x20%s\x20%s',_0x20c47e[_0x4f4629],_0xd088('0x146')));this[_0xd088('0xe')]['noop'](util['format'](_0xd088('0x14b'),_0x20c47e[_0x4f4629],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xd088('0x18')][_0xd088('0x14c')]=function(_0x2ca92c){logger['info'](util[_0xd088('0x2a')](_0xd088('0x14d'),_0x2ca92c[_0xd088('0x37')]));return this['channel'][_0xd088('0x14c')]();};AGIVertices[_0xd088('0x18')][_0xd088('0x14e')]=function(_0x59ff50){logger['info'](util[_0xd088('0x2a')](_0xd088('0x14f'),_0x59ff50['label']));if(!this[_0xd088('0x86')](_0x59ff50[_0xd088('0x81')])){return this['channel'][_0xd088('0xab')](_0xd088('0xee'));}var _0x7d602e='wav';var _0x414506=util[_0xd088('0x2a')](_0xd088('0x13b'),FILES_PATH,rs[_0xd088('0x11a')](0x4));var _0x50ed9e=util['format'](_0xd088('0x9e'),_0x414506,_0x7d602e);var _0x4be8ae=!![];if(_0x59ff50[_0xd088('0x13c')]===_0xd088('0x130')){_0x4be8ae=![];}var _0x3b798b=this['channel'][_0xd088('0x131')](_0x414506,_0x7d602e,_0x59ff50[_0xd088('0x132')],_0x59ff50[_0xd088('0x68')],undefined,_0x4be8ae);if(_0x3b798b[_0xd088('0xa3')]!==-0x1){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x150'),_0x50ed9e));var _0x30c0fe=this[_0xd088('0x84')][_0xd088('0x71')](this,_0x59ff50,_0x50ed9e);if(_0x30c0fe){for(var _0x527c87 in _0x30c0fe){if(_0x30c0fe['hasOwnProperty'](_0x527c87)){this['channel']['setVariable'](util['format'](_0xd088('0x151'),_0x527c87[_0xd088('0x6b')]()),_0x30c0fe[_0x527c87]);}}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x152'),JSON[_0xd088('0x74')](_0x30c0fe)));}}return _0x3b798b;};AGIVertices['prototype'][_0xd088('0x153')]=function(_0x1e2f9e){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x154'),_0x1e2f9e[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x1e2f9e['key'])){return this['channel'][_0xd088('0xab')](_0xd088('0xee'));}if(!this[_0xd088('0x86')](_0x1e2f9e[_0xd088('0x5f')])){return this['channel'][_0xd088('0xab')](_0xd088('0xac'));}this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x155'),_0x1e2f9e[_0xd088('0x5f')]));var _0x1dc845=this['ispeechTTS'][_0xd088('0x71')](this,_0x1e2f9e);if(_0x1dc845){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('ispeech\x20%s\x20file\x20created',_0x1dc845));var _0x5d04c4=this[_0xd088('0xe')][_0xd088('0x106')](_0x1dc845,_0x1e2f9e['intKey']);try{fs[_0xd088('0x107')](_0x1dc845+'.wav');}catch(_0x22be15){logger[_0xd088('0x31')](_0x22be15);}return _0x5d04c4;}return this[_0xd088('0xe')][_0xd088('0x31')](_0x1e2f9e,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd088('0x18')][_0xd088('0x156')]=function(_0x1b375f){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x157'),_0x1b375f['label']));if(!this['isConfigured'](_0x1b375f[_0xd088('0x158')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1b375f,_0xd088('0x159'));}logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x15a'),this['channel'][_0xd088('0x3a')],_0x1b375f[_0xd088('0x158')]));var _0x2b31ff=this[_0xd088('0x55')][_0xd088('0x71')](this,_0x1b375f[_0xd088('0x158')]);if(_0x2b31ff){logger[_0xd088('0x2e')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xd088('0xe')][_0xd088('0x3a')],_0x1b375f[_0xd088('0x158')]));this['channel'][_0xd088('0xab')](util['format'](_0xd088('0x15b'),this[_0xd088('0xe')][_0xd088('0x3a')],_0x1b375f[_0xd088('0x158')]));return{'code':0xc8,'result':_0xd088('0x15c')};}else{logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xd088('0x3a')],_0x1b375f['findBy']));this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd088('0xe')][_0xd088('0x3a')],_0x1b375f['findBy']));return{'code':0xc8,'result':_0xd088('0x15d')};}};AGIVertices[_0xd088('0x18')][_0xd088('0x15e')]=function(_0x4fb800){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x15f'),_0x4fb800['label']));if(!this['isConfigured'](_0x4fb800[_0xd088('0x158')])){return this[_0xd088('0xe')]['error'](_0x4fb800,_0xd088('0x159'));}logger[_0xd088('0x2e')](util['format'](_0xd088('0x15a'),this[_0xd088('0xe')][_0xd088('0x3a')],_0x4fb800[_0xd088('0x158')]));var _0x28534e=this['agentLogout'][_0xd088('0x71')](this,_0x4fb800[_0xd088('0x158')]);if(_0x28534e){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x15b'),this['channel'][_0xd088('0x3a')],_0x4fb800[_0xd088('0x158')]));this['channel'][_0xd088('0xab')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd088('0x3a')],_0x4fb800[_0xd088('0x158')]));return{'code':0xc8,'result':_0xd088('0x15c')};}else{logger['info'](util[_0xd088('0x2a')](_0xd088('0x160'),this['channel'][_0xd088('0x3a')],_0x4fb800[_0xd088('0x158')]));this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x160'),this[_0xd088('0xe')]['callerid'],_0x4fb800[_0xd088('0x158')]));return{'code':0xc8,'result':_0xd088('0x15d')};}};AGIVertices[_0xd088('0x18')]['math']=function(_0x5244f5){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x161'),_0x5244f5[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x5244f5['operation'])){return this['channel'][_0xd088('0x31')](_0x5244f5,_0xd088('0x162'));}this[_0xd088('0xe')][_0xd088('0xab')](util['format'](_0xd088('0x163'),_0x5244f5['operation']));var _0x3ef93c=eval(_0x5244f5[_0xd088('0x164')]);if(!this[_0xd088('0x86')](_0x5244f5['variable_id'])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xdd'));}var _0x4b83b1=this[_0xd088('0x11')][_0xd088('0x71')](this,_0x5244f5[_0xd088('0xdc')]);if(!_0x4b83b1){return this['channel'][_0xd088('0x31')](_0x5244f5,_0xd088('0xde'));}if(_[_0xd088('0x9f')](_0x3ef93c)){var _0x1ed4d5=this;_0x3ef93c[_0xd088('0xdf')](function(_0x27d683,_0x14c6bd){_0x1ed4d5[_0xd088('0xe')][_0xd088('0xa6')](util['format'](_0xd088('0x165'),_0x4b83b1,_0x14c6bd),_0x27d683);});return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('variable\x20%s[key]\x20set',_0x4b83b1));}else{return this['channel'][_0xd088('0xa6')](_0x4b83b1,_0x3ef93c);}};AGIVertices[_0xd088('0x18')][_0xd088('0x166')]=function(_0x414dbe){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x414dbe[_0xd088('0x37')]));if(_0x414dbe[_0xd088('0xa7')]===0x0){return this[_0xd088('0xa8')](_0x414dbe);}_0x414dbe[_0xd088('0xa7')]-=0x1;if(!this[_0xd088('0x86')](_0x414dbe[_0xd088('0x115')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x414dbe,_0xd088('0x167'));}var _0x1823e3=this[_0xd088('0x20')][_0xd088('0x71')](this,_0x414dbe[_0xd088('0x115')]);if(!_0x1823e3){return this[_0xd088('0xe')][_0xd088('0x31')](_0x414dbe,_0xd088('0x116'));}var _0x3527d6=this[_0xd088('0xe')][_0xd088('0x168')](_0x1823e3,_0x414dbe[_0xd088('0x169')],_0x414dbe[_0xd088('0x16a')]);var _0x3658a1=_0x3527d6[_0xd088('0xa3')];if(_0x3527d6[_0xd088('0xa3')]===-0x1){this['createSquareDetailsReport']['sync'](this,_0x414dbe,'-1');return _0x3527d6;}else if(_0x3527d6[_0xd088('0xa5')]==='timeout'){_0x3527d6[_0xd088('0xa3')]=_0x3527d6[_0xd088('0xa3')]['length']>0x0?_0x3527d6[_0xd088('0xa3')]:'t';}else if(_[_0xd088('0x45')](_0x3527d6[_0xd088('0xa3')])){_0x3527d6[_0xd088('0xa3')]='#';_0x3658a1='#';}if(!this[_0xd088('0x86')](_0x414dbe[_0xd088('0xdc')])){this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xdd'));}else{var _0x4f7fba=this['getVariable']['sync'](this,_0x414dbe['variable_id']);if(!_0x4f7fba){return this['channel']['error'](_0x414dbe,_0xd088('0xde'));}this[_0xd088('0xe')][_0xd088('0xa6')](_0x4f7fba,_0x3658a1);}this[_0xd088('0x36')]['sync'](this,_0x414dbe,_0x3658a1);return _0x3527d6;};AGIVertices[_0xd088('0x18')][_0xd088('0xab')]=function(_0x54b731){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x54b731[_0xd088('0x37')]));return this[_0xd088('0xe')][_0xd088('0xab')](_0x54b731[_0xd088('0x16b')]||_0x54b731['label']);};AGIVertices[_0xd088('0x18')][_0xd088('0x16c')]=function(_0x23ff0e){logger['info'](util[_0xd088('0x2a')](_0xd088('0x16d'),_0x23ff0e[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x23ff0e[_0xd088('0x158')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x23ff0e,'no\x20find\x20by\x20configured');}logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x15a'),this['channel'][_0xd088('0x3a')],_0x23ff0e[_0xd088('0x158')]));var _0xc6a40a=this[_0xd088('0x4f')][_0xd088('0x71')](this,_0x23ff0e[_0xd088('0x16e')]);var _0x2ab364=this[_0xd088('0x51')]['sync'](this,_0x23ff0e[_0xd088('0x158')],_0xc6a40a);if(_0x2ab364){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x15b'),this[_0xd088('0xe')]['callerid'],_0x23ff0e[_0xd088('0x158')]));this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x15b'),this[_0xd088('0xe')][_0xd088('0x3a')],_0x23ff0e[_0xd088('0x158')]));return{'code':0xc8,'result':_0xd088('0x15c')};}else{logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x160'),this['channel'][_0xd088('0x3a')],_0x23ff0e[_0xd088('0x158')]));this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x15b'),this['channel'][_0xd088('0x3a')],_0x23ff0e[_0xd088('0x158')]));return{'code':0xc8,'result':_0xd088('0x15d')};}};AGIVertices['prototype'][_0xd088('0x16f')]=function(_0xba89c8){logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0xba89c8[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0xba89c8[_0xd088('0x115')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0xba89c8,'no\x20file\x20audio\x20selected');}var _0x5dc6b6=this['getSound']['sync'](this,_0xba89c8[_0xd088('0x115')]);if(!_0x5dc6b6){return this[_0xd088('0xe')][_0xd088('0x31')](_0xba89c8,_0xd088('0x116'));}var _0xc1d3c1=this[_0xd088('0xe')][_0xd088('0x59')]('PLAYBACK',[_0x5dc6b6,_0xba89c8[_0xd088('0xeb')]]);if(_0xc1d3c1[_0xd088('0xa3')]===-0x1){return _0xc1d3c1;}return this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xc7'),_0xd088('0x170'),_0x5dc6b6));};AGIVertices['prototype'][_0xd088('0x171')]=function(_0x2edfbb){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x2edfbb[_0xd088('0x37')]));if(!this['isConfigured'](_0x2edfbb[_0xd088('0x172')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x2edfbb,_0xd088('0x173'));}var _0x382548='';var _0x203f8d=parseInt(_0x2edfbb[_0xd088('0x172')],0xa);if(isNaN(_0x203f8d)){_0x382548=_0x2edfbb[_0xd088('0x172')];}else{_0x382548=this[_0xd088('0x14')][_0xd088('0x71')](this,_0x2edfbb[_0xd088('0x172')]);if(!_0x382548){return this['channel'][_0xd088('0x31')](_0x2edfbb,_0xd088('0x174'));}}var _0x344bb1='';if(this[_0xd088('0x86')](_0x2edfbb['file_id'])){var _0x263dde=this[_0xd088('0x20')]['sync'](this,_0x2edfbb[_0xd088('0x115')]);if(_0x263dde){_0x344bb1=_0x263dde;}}this[_0xd088('0x36')]['sync'](this,_0x2edfbb,_0x382548);if(_0x2edfbb[_0xd088('0xeb')][_0xd088('0x175')]('x')<0x0){_0x2edfbb[_0xd088('0xeb')]+='x';}if(_0x2edfbb[_0xd088('0xeb')][_0xd088('0x175')]('X')<0x0){_0x2edfbb[_0xd088('0xeb')]+='X';}this[_0xd088('0xe')][_0xd088('0xa6')]('XMCS-QUEUE',_0x382548?_0x382548['toLowerCase']():'');var _0x367cd6=this[_0xd088('0xe')]['exec']('QUEUE',[_0x382548,_0x2edfbb['opts'],_0x2edfbb['url'],_0x344bb1,_0x2edfbb[_0xd088('0x68')],_0x2edfbb[_0xd088('0xb8')],_0x2edfbb[_0xd088('0x176')],_0x2edfbb['gosub'],'',_0x2edfbb[_0xd088('0x177')]]);if(_0x367cd6[_0xd088('0xa3')]===-0x1){return _0x367cd6;}return this[_0xd088('0xe')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0xd088('0x178'),_0x382548));};AGIVertices[_0xd088('0x18')][_0xd088('0x179')]=function(_0x6dfb30){logger[_0xd088('0x2e')](util['format'](_0xd088('0x17a'),_0x6dfb30['label']));var _0x459d1a=_0x6dfb30['recordingFormat']||_0xd088('0x12f');var _0x228216=util[_0xd088('0x2a')](_0xd088('0x17b'),this['channel'][_0xd088('0x3c')],rs[_0xd088('0x11a')](0x5));var _0x3a519e=util[_0xd088('0x2a')]('%s/recordings/%s.%s',FILES_PATH,_0x228216,_0x459d1a);var _0x50c195=util[_0xd088('0x2a')]('%s/recordings/%s',FILES_PATH,_0x228216);this[_0xd088('0x3b')][_0xd088('0x71')](this,_0x6dfb30,_0x228216,_0x3a519e);this[_0xd088('0xe')][_0xd088('0xa6')](_0xd088('0x17c'),_0x228216);logger['info'](_0xd088('0x17d'),_0x50c195,_0x459d1a,_0x6dfb30['escape_digits'],_0x6dfb30[_0xd088('0x68')]);return this['channel'][_0xd088('0x131')](_0x50c195,_0x459d1a,_0x6dfb30[_0xd088('0x17e')],_0x6dfb30[_0xd088('0x68')],undefined,!![]);};AGIVertices[_0xd088('0x18')]['restapi']=function(_0x1529e0){logger[_0xd088('0x2e')](util['format'](_0xd088('0x17f'),_0x1529e0[_0xd088('0x37')]));if(!this['isConfigured'](_0x1529e0['url'])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x180'));}var _0x485e96=this[_0xd088('0x181')][_0xd088('0x71')](this,_0x1529e0);logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('Response:',util[_0xd088('0x182')](_0x485e96,{'showHidden':![],'depth':null})));if(!this[_0xd088('0x86')](_0x1529e0[_0xd088('0xdc')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x183'));}var _0x4d33ba=this['getVariable']['sync'](this,_0x1529e0['variable_id']);if(!_0x4d33ba){return this[_0xd088('0xe')]['error'](_0x1529e0,'no\x20variable\x20found');}this[_0xd088('0xe')][_0xd088('0xa6')](util[_0xd088('0x2a')]('%s_STATUS_CODE',_0x4d33ba),_0x485e96[_0xd088('0x77')]?_0x485e96[_0xd088('0x77')]:'200');this[_0xd088('0xe')][_0xd088('0xa6')](util['format'](_0xd088('0x184'),_0x4d33ba),_0x485e96[_0xd088('0x76')]?_0x485e96[_0xd088('0x76')]:'OK');if(_0x485e96[_0xd088('0x6c')]){try{this[_0xd088('0x9d')](_0x485e96[_0xd088('0x6c')],_0x4d33ba);}catch(_0x25db8e){logger[_0xd088('0x31')](util[_0xd088('0x2a')](_0xd088('0x185'),_0x4d33ba));}}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('variable\x20%s\x20set',_0x4d33ba));};AGIVertices[_0xd088('0x18')][_0xd088('0x186')]=function(_0x976592){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x976592[_0xd088('0x37')]));return this['channel'][_0xd088('0x187')](_0x976592[_0xd088('0x188')][_0xd088('0x5b')](/\s+/g,''),_0x976592[_0xd088('0x17e')]);};AGIVertices[_0xd088('0x18')][_0xd088('0x189')]=function(_0x3a7bba){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x3a7bba['label']));return this[_0xd088('0xe')]['sayNumber'](_0x3a7bba[_0xd088('0x69')][_0xd088('0x5b')](/\s+/g,''),_0x3a7bba[_0xd088('0x17e')]);};AGIVertices[_0xd088('0x18')][_0xd088('0x18a')]=function(_0x5eab1f){logger[_0xd088('0x2e')](util['format'](_0xd088('0x18b'),_0x5eab1f[_0xd088('0x37')]));return this['channel'][_0xd088('0x18c')](_0x5eab1f[_0xd088('0x5f')],_0x5eab1f[_0xd088('0x17e')]);};AGIVertices[_0xd088('0x18')]['sendMail']=function(_0x2e4672){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x18d'),_0x2e4672[_0xd088('0x37')]));if(!this['isConfigured'](_0x2e4672[_0xd088('0x18e')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x18f'));}var _0x43c66a=this[_0xd088('0x23')]['sync'](this,_0x2e4672[_0xd088('0x18e')]);if(!_0x43c66a||!_0x43c66a['Smtp']){return this['channel'][_0xd088('0x31')](_0x2e4672,_0xd088('0x190'));}var _0x4be14f={'from':util[_0xd088('0x2a')](_0xd088('0x191'),_0x43c66a[_0xd088('0x13')],_0x43c66a[_0xd088('0x192')]||_0x43c66a[_0xd088('0x193')][_0xd088('0x194')]),'to':_0x2e4672['to']||'','cc':_0x2e4672['cc']||'','bcc':_0x2e4672[_0xd088('0x195')]||'','subject':_0x2e4672['subject'],'html':_0x2e4672[_0xd088('0x5f')],'text':_0x2e4672['text']};var _0x15faa9={'tls':{'rejectUnauthorized':![]}};if(_0x43c66a[_0xd088('0x193')][_0xd088('0x196')]){_0x15faa9[_0xd088('0x196')]=_0x43c66a[_0xd088('0x193')][_0xd088('0x196')];}else{_0x15faa9[_0xd088('0x197')]=_0x43c66a['Smtp']['host'];_0x15faa9['port']=_0x43c66a[_0xd088('0x193')]['port'];_0x15faa9['secure']=_0x43c66a[_0xd088('0x193')][_0xd088('0x198')];}if(_0x43c66a[_0xd088('0x193')][_0xd088('0x199')]){_0x15faa9[_0xd088('0x19a')]={'user':_0x43c66a[_0xd088('0x193')][_0xd088('0x194')],'pass':_0x43c66a[_0xd088('0x193')]['pass']};}if(this[_0xd088('0x86')](_0x2e4672[_0xd088('0x19b')])){}logger[_0xd088('0x19c')](_0xd088('0x19d'),JSON[_0xd088('0x74')](_0x4be14f));this[_0xd088('0x36')]['sync'](this,_0x2e4672,_0x2e4672[_0xd088('0x18e')]);this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x19e'),_0x43c66a[_0xd088('0x13')]));this[_0xd088('0x25')][_0xd088('0x71')](this,_0x15faa9,_0x4be14f);return this[_0xd088('0xe')]['noop'](_0xd088('0x19f'));};AGIVertices[_0xd088('0x18')]['sendFax']=function(_0x252d0c){logger['info'](util[_0xd088('0x2a')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x252d0c[_0xd088('0x37')]));return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x1a0'));};AGIVertices['prototype'][_0xd088('0x1a1')]=function(_0x14f663){logger['info'](util[_0xd088('0x2a')](_0xd088('0x1a2'),_0x14f663[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x14f663['sms_account_id'])){return this[_0xd088('0xe')]['noop']('no\x20sms\x20account\x20configured');}var _0x278f5c=this[_0xd088('0x33')]['sync'](this,_0x14f663[_0xd088('0x1a3')]);if(!_0x278f5c){return this[_0xd088('0xe')]['error'](_0x14f663,_0xd088('0x1a4'));}var _0x87451f={'body':_0x14f663[_0xd088('0x1a5')],'phone':_0x14f663['to']||'','SmsAccountId':_0x278f5c['id']};logger[_0xd088('0x19c')](_0xd088('0x1a6'),JSON[_0xd088('0x74')](_0x87451f));this['createSquareDetailsReport'][_0xd088('0x71')](this,_0x14f663,_0x14f663[_0xd088('0x1a3')]);this[_0xd088('0xe')]['noop'](util[_0xd088('0x2a')](_0xd088('0x1a7'),_0x278f5c[_0xd088('0x13')]));this[_0xd088('0x35')][_0xd088('0x71')](this,_0x87451f);return this[_0xd088('0xe')]['noop'](_0xd088('0x1a8'));};AGIVertices[_0xd088('0x18')][_0xd088('0x1a9')]=function(_0x3ae21){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1aa'),_0x3ae21[_0xd088('0x37')]));if(!this[_0xd088('0x86')](_0x3ae21[_0xd088('0xdc')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x3ae21,_0xd088('0x1ab'));}var _0xddf4ab=this[_0xd088('0x11')][_0xd088('0x71')](this,_0x3ae21['variable_id']);if(!_0xddf4ab){return this[_0xd088('0xe')][_0xd088('0x31')](_0x3ae21,'no\x20variable\x20found');}return this[_0xd088('0xe')][_0xd088('0xa6')](_0xddf4ab,_0x3ae21[_0xd088('0x1ac')]);};AGIVertices[_0xd088('0x18')][_0xd088('0x1ad')]=function(_0x1e5adf){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1ae'),_0x1e5adf['label']));this[_0xd088('0xe')]['noop'](_0xd088('0x1af'));if(_0x1e5adf[_0xd088('0xbc')]==='yes'){this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0x1b0'));return this[_0xd088('0xe')][_0xd088('0xbc')]();}return this[_0xd088('0xe')]['noop'](_0xd088('0x1b1'));};AGIVertices['prototype'][_0xd088('0x1b2')]=function(_0x1944e1){logger[_0xd088('0x2e')](util['format']('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x1944e1['label']));if(!this[_0xd088('0x86')](_0x1944e1[_0xd088('0x1b3')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1944e1,_0xd088('0x1b4'));}var _0x4457a3=this[_0xd088('0x16')][_0xd088('0x71')](this,_0x1944e1[_0xd088('0x1b3')]);if(!this[_0xd088('0x86')](_0x4457a3)){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1944e1,util[_0xd088('0x2a')](_0xd088('0x1b5'),_0x1944e1[_0xd088('0x1b3')]));}if(_0x4457a3===this[_0xd088('0xe')][_0xd088('0x39')]){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1944e1,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0xd088('0x36')][_0xd088('0x71')](this,_0x1944e1,_0x4457a3);var _0x464311=this['channel'][_0xd088('0x59')]('AGI',util[_0xd088('0x2a')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0xd088('0xb8')][_0xd088('0x197')]||'127.0.0.1',_0x4457a3,this[_0xd088('0xe')][_0xd088('0x39')]));if(_0x464311[_0xd088('0xa3')]===-0x1){return _0x464311;}return this['channel'][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xc7'),_0xd088('0x1b6'),_0x4457a3));};AGIVertices[_0xd088('0x18')][_0xd088('0x1b7')]=function(_0x23a5c1){logger[_0xd088('0x2e')](util['format'](_0xd088('0x1b8'),_0x23a5c1[_0xd088('0x37')]));var _0x55124a=this['shellCommand'][_0xd088('0x71')](this,_0x23a5c1['command']);this[_0xd088('0x36')][_0xd088('0x71')](this,_0x23a5c1,_0x23a5c1[_0xd088('0xba')]);if(this['isConfigured'](_0x23a5c1[_0xd088('0xdc')])){var _0x41c946=this[_0xd088('0x11')]['sync'](this,_0x23a5c1[_0xd088('0xdc')]);if(_0x41c946){this[_0xd088('0xe')][_0xd088('0xa6')](_0x41c946,_0x55124a);return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x1b9'),_0x23a5c1['command'],_0x41c946));}}return this['channel']['noop'](util[_0xd088('0x2a')](_0xd088('0x1ba'),_0x23a5c1['command']));};AGIVertices[_0xd088('0x18')][_0xd088('0x1bb')]=function(_0x49f75d){logger[_0xd088('0x2e')](util['format'](_0xd088('0x1bc'),_0x49f75d[_0xd088('0x37')]));_0x49f75d[_0xd088('0x5f')]=_0x49f75d[_0xd088('0x5f')][_0xd088('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd088('0x86')](_0x49f75d['apiKey'])){return this[_0xd088('0xe')]['noop'](_0xd088('0x1bd'));}if(!this['isConfigured'](_0x49f75d[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')]('no\x20text\x20configured');}this[_0xd088('0xe')][_0xd088('0xab')](util['format'](_0xd088('0x1be'),_0x49f75d[_0xd088('0x5f')]));var _0x14a2c5=this[_0xd088('0x5c')][_0xd088('0x71')](this,_0x49f75d);if(_0x14a2c5){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x14a2c5));var _0x2a9b59=this[_0xd088('0xe')][_0xd088('0x106')](_0x14a2c5);try{fs['unlink'](_0x14a2c5+_0xd088('0x108'));}catch(_0x1d65dd){logger['error'](_0x1d65dd);}return _0x2a9b59;}return this[_0xd088('0xe')]['error'](_0x49f75d,_0xd088('0x1bf'));};AGIVertices['prototype']['tts']=function(_0x519070){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1c0'),_0x519070['label']));_0x519070[_0xd088('0x5f')]=_0x519070[_0xd088('0x5f')][_0xd088('0x5b')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xd088('0x86')](_0x519070[_0xd088('0x5f')])){return this[_0xd088('0xe')][_0xd088('0xab')](_0xd088('0xac'));}this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x1c1'),_0x519070[_0xd088('0x5f')]));var _0x5d87ee=this[_0xd088('0x65')][_0xd088('0x71')](this,_0x519070);if(_0x5d87ee){this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0x1c2'),_0x5d87ee));var _0x1ac2a2=this[_0xd088('0xe')][_0xd088('0x106')](_0x5d87ee);try{fs[_0xd088('0x107')](_0x5d87ee+'.wav');}catch(_0x24d3dd){logger[_0xd088('0x31')](_0x24d3dd);}return _0x1ac2a2;}return this[_0xd088('0xe')]['error'](_0x519070,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0xd088('0x18')][_0xd088('0x1c3')]=function(_0x486f37){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1c4'),_0x486f37[_0xd088('0x37')]));if(!this['isConfigured'](_0x486f37[_0xd088('0x158')])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x486f37,_0xd088('0x159'));}logger['info'](util[_0xd088('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xd088('0xe')]['callerid'],_0x486f37['findBy']));var _0xbe273=this[_0xd088('0x53')]['sync'](this,_0x486f37[_0xd088('0x158')]);if(_0xbe273){logger[_0xd088('0x2e')](util[_0xd088('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd088('0x3a')],_0x486f37[_0xd088('0x158')]));this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xd088('0x3a')],_0x486f37[_0xd088('0x158')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xd088('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xd088('0xe')]['callerid'],_0x486f37[_0xd088('0x158')]));this['channel']['noop'](util['format'](_0xd088('0x160'),this[_0xd088('0xe')]['callerid'],_0x486f37['findBy']));return{'code':0xc8,'result':_0xd088('0x15d')};}};AGIVertices[_0xd088('0x18')][_0xd088('0x1c5')]=function(_0x29567d){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1c6'),_0x29567d[_0xd088('0x37')]));var _0x194be1=this['channel'][_0xd088('0x59')](_0xd088('0x1c7'),[_0x29567d[_0xd088('0x1c8')],_0x29567d['options']]);if(_0x194be1[_0xd088('0xa3')]===-0x1){return _0x194be1;}return this[_0xd088('0xe')][_0xd088('0xab')](util[_0xd088('0x2a')](_0xd088('0xc7'),'VOICEMAIL',_0x29567d['mailbox']));};AGIVertices['prototype'][_0xd088('0x1c9')]=function(_0x1217e6){logger[_0xd088('0x2e')](util[_0xd088('0x2a')](_0xd088('0x1ca'),_0x1217e6[_0xd088('0x37')]));if(!this['isConfigured'](_0x1217e6['variable_id'])){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1217e6,'no\x20variable\x20selected');}var _0x188306=this['getVariable'][_0xd088('0x71')](this,_0x1217e6['variable_id']);if(!_0x188306){return this[_0xd088('0xe')][_0xd088('0x31')](_0x1217e6,_0xd088('0xde'));}var _0x4bc1a3=this['channel']['getVariable'](_0x188306);return{'code':0xc8,'result':_0x4bc1a3['extra']?_0x4bc1a3[_0xd088('0xa5')]:'-'};};String[_0xd088('0x18')]['replaceAll']=function(_0x5583c6,_0x4daf1c){return this['split'](_0x5583c6)['join'](_0x4daf1c);};module[_0xd088('0x1cb')]=AGIVertices;
\ No newline at end of file
index 79792c2..86e832e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e63=['transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','savePause','exports','lodash','moment','../ami','../../../config/logger','voiceQueues','agents','timers','syncAgentConnect','hanguprequest','syncHangupRequest','bind','hangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','prototype','startAcw','channels','interface','queue','ACW','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','acw','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','origtransfereruniqueid'];(function(_0x4f096e,_0x30d3c3){var _0x4a33ce=function(_0x107ba6){while(--_0x107ba6){_0x4f096e['push'](_0x4f096e['shift']());}};_0x4a33ce(++_0x30d3c3);}(_0x2e63,0x18d));var _0x32e6=function(_0x4c9ad2,_0x3bb687){_0x4c9ad2=_0x4c9ad2-0x0;var _0x507886=_0x2e63[_0x4c9ad2];return _0x507886;};'use strict';var util=require('util');var _=require(_0x32e6('0x0'));var moment=require(_0x32e6('0x1'));var ami=require(_0x32e6('0x2'));var logger=require(_0x32e6('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x4d02b1){this[_0x32e6('0x4')]=_0x4d02b1['voiceQueues'];this['agents']=_0x4d02b1[_0x32e6('0x5')];this[_0x32e6('0x6')]=_0x4d02b1[_0x32e6('0x6')];this['channels']={};ami['on']('agentconnect',this[_0x32e6('0x7')]['bind'](this));ami['on'](_0x32e6('0x8'),this[_0x32e6('0x9')][_0x32e6('0xa')](this));ami['on'](_0x32e6('0xb'),this['syncHangup'][_0x32e6('0xa')](this));ami['on']('agentringnoanswer',this[_0x32e6('0xc')]['bind'](this));ami['on'](_0x32e6('0xd'),this[_0x32e6('0xe')]['bind'](this));ami['on'](_0x32e6('0xf'),this[_0x32e6('0x10')][_0x32e6('0xa')](this));ami['on'](_0x32e6('0x11'),this[_0x32e6('0x12')][_0x32e6('0xa')](this));}function getDiff(_0x27142f){var _0x1ea016=moment()['milliseconds'](0x0);var _0x48318d=moment(_0x27142f)['milliseconds'](0x0);return _0x1ea016[_0x32e6('0x13')](_0x48318d,'seconds');}Acw[_0x32e6('0x14')][_0x32e6('0x15')]=function(_0x2dff67){try{var _0x163bdf=this;var _0x3dfbe0=this[_0x32e6('0x16')][_0x2dff67][_0x32e6('0x17')];var _0x5aa41e=this['channels'][_0x2dff67][_0x32e6('0x18')];var _0x2f74f7=this[_0x32e6('0x4')][_0x5aa41e];var _0xbc9724=![];var _0x29b6fa=_0x32e6('0x19');if(_0x2f74f7['mandatoryDisposition']){if(_0x2f74f7[_0x32e6('0x1a')][_0x32e6('0x1b')]){_0xbc9724=!![];_0x29b6fa=_0x2f74f7['mandatoryDispositionPause']['name'];}}ami[_0x32e6('0x1c')]({'action':_0x32e6('0x1d'),'interface':_0x3dfbe0,'paused':!![],'reason':_0x29b6fa})['then'](function(_0x336e72){if(_0x163bdf[_0x32e6('0x5')][_0x3dfbe0]){return RpcUser[_0x32e6('0x1e')](_0x163bdf['agents'][_0x3dfbe0]['id'])[_0x32e6('0x1f')](function(_0x25c4da){if(_0x25c4da&&!_0x25c4da[_0x32e6('0x20')]){logger[_0x32e6('0x21')](_0x32e6('0x22'),_0x2dff67,_0x3dfbe0,_0x5aa41e);var _0x498167=_0x163bdf[_0x32e6('0x16')][_0x2dff67][_0x32e6('0x23')]&&_0x163bdf[_0x32e6('0x16')][_0x2dff67][_0x32e6('0x24')]?_0x163bdf[_0x32e6('0x16')][_0x2dff67]['destlinkedid']:_0x2dff67;return RpcUser['savePause'](_0x163bdf[_0x32e6('0x5')][_0x3dfbe0],_0x29b6fa,_0x498167)[_0x32e6('0x1f')](function(_0x5dfe24){if(!_0xbc9724){_0x163bdf[_0x32e6('0x6')][_0x3dfbe0]={};logger[_0x32e6('0x21')](_0x32e6('0x25'),_0x2dff67,_0x163bdf[_0x32e6('0x4')][_0x5aa41e][_0x32e6('0x26')],_0x3dfbe0,_0x5aa41e);_0x163bdf['timers'][_0x3dfbe0][_0x32e6('0x27')]=setTimeout(_0x163bdf[_0x32e6('0x28')][_0x32e6('0xa')](_0x163bdf,_0x3dfbe0),_0x163bdf[_0x32e6('0x4')][_0x5aa41e]['acwTimeout']*0x3e8);_0x163bdf[_0x32e6('0x6')][_0x3dfbe0][_0x32e6('0x29')]=moment()[_0x32e6('0x2a')](_0x32e6('0x2b'));_0x163bdf[_0x32e6('0x6')][_0x3dfbe0][_0x32e6('0x2c')]=_0x2dff67;_0x163bdf['timers'][_0x3dfbe0][_0x32e6('0x18')]=_0x5aa41e;_0x163bdf[_0x32e6('0x6')][_0x3dfbe0]['updateAcw']=function(){var _0x29e0c6=getDiff(_0x163bdf['timers'][_0x3dfbe0][_0x32e6('0x29')]);clearTimeout(_0x163bdf[_0x32e6('0x6')][_0x3dfbe0][_0x32e6('0x27')]);_0x163bdf[_0x32e6('0x6')][_0x3dfbe0][_0x32e6('0x27')]=![];RpcVoiceAgentReport[_0x32e6('0x2d')]({'acwtime':_0x29e0c6},_0x163bdf['timers'][_0x3dfbe0][_0x32e6('0x2c')],_0x3dfbe0)[_0x32e6('0x1f')](function(_0x217588){logger[_0x32e6('0x21')](_0x32e6('0x2e'),_0x2dff67,_0x29e0c6,_0x217588);})[_0x32e6('0x2f')](function(_0x2dd5f1){logger[_0x32e6('0x30')](_0x32e6('0x31'),_0x2dff67,_0x2dd5f1);});delete _0x163bdf[_0x32e6('0x6')][_0x3dfbe0];};}});}else{logger[_0x32e6('0x21')](_0x32e6('0x32'),_0x2dff67,_0x3dfbe0,_0x5aa41e);}});}})['catch'](function(_0x4c8948){logger['error'](_0x32e6('0x25'),_0x2dff67,_0x163bdf[_0x32e6('0x4')][_0x5aa41e]['acwTimeout'],_0x3dfbe0,_0x5aa41e);})[_0x32e6('0x33')](function(){delete _0x163bdf[_0x32e6('0x16')][_0x2dff67];});}catch(_0x4aa7e5){logger['error']('[ACW][START]\x20%s',_0x4aa7e5[_0x32e6('0x34')]);}};Acw[_0x32e6('0x14')][_0x32e6('0x28')]=function(_0x1e4faa){try{var _0x45a01a=this;if(_0x45a01a[_0x32e6('0x6')][_0x1e4faa]){_0x45a01a[_0x32e6('0x6')][_0x1e4faa][_0x32e6('0x27')]=![];var _0x1408fd=_0x45a01a[_0x32e6('0x6')][_0x1e4faa]['uniqueid'];var _0x4eb502=_0x45a01a[_0x32e6('0x6')][_0x1e4faa][_0x32e6('0x18')];var _0x33726f=_0x45a01a[_0x32e6('0x4')][_0x4eb502]['acwTimeout'];logger['info'](_0x32e6('0x35'),_0x1408fd,_0x1e4faa);RpcUser[_0x32e6('0x36')](this[_0x32e6('0x5')][_0x1e4faa]);RpcVoiceAgentReport['update']({'acwtime':_0x33726f,'agentacw':!![]},_0x1408fd,_0x1e4faa)[_0x32e6('0x1f')](function(_0x5b54ab){logger[_0x32e6('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x1408fd,_0x33726f,_0x5b54ab);})[_0x32e6('0x2f')](function(_0x197f10){logger['error'](_0x32e6('0x31'),_0x1408fd,_0x197f10);});}else{logger[_0x32e6('0x30')](_0x32e6('0x37'),_0x1e4faa);if(_0x45a01a[_0x32e6('0x6')]){logger[_0x32e6('0x21')](_0x32e6('0x38'),JSON[_0x32e6('0x39')](_0x45a01a[_0x32e6('0x6')]));}}}catch(_0x57786b){logger[_0x32e6('0x30')]('[ACW][STOP]\x20%s',_0x57786b[_0x32e6('0x34')]);}};Acw[_0x32e6('0x14')]['syncAgentConnect']=function(_0x3461cd){try{if(this[_0x32e6('0x4')][_0x3461cd[_0x32e6('0x18')]]&&(this['voiceQueues'][_0x3461cd[_0x32e6('0x18')]][_0x32e6('0x3a')]||this[_0x32e6('0x4')][_0x3461cd['queue']][_0x32e6('0x3b')])){if(this[_0x32e6('0x5')][_0x3461cd['interface']]){this[_0x32e6('0x16')][_0x3461cd['uniqueid']]={'queue':_0x3461cd[_0x32e6('0x18')],'interface':_0x3461cd[_0x32e6('0x17')],'destlinkedid':_0x3461cd[_0x32e6('0x24')]};}}}catch(_0x14e3d4){logger[_0x32e6('0x30')](_0x32e6('0x3c'),_0x14e3d4[_0x32e6('0x34')]);}};Acw[_0x32e6('0x14')][_0x32e6('0x12')]=function(_0x538c61){try{if(this['voiceQueues'][_0x538c61[_0x32e6('0x18')]]&&(this[_0x32e6('0x4')][_0x538c61[_0x32e6('0x18')]]['acw']||this['voiceQueues'][_0x538c61[_0x32e6('0x18')]]['mandatoryDisposition'])){if(this[_0x32e6('0x5')][_0x538c61[_0x32e6('0x17')]]){this[_0x32e6('0x16')][_0x538c61[_0x32e6('0x2c')]]={'queue':_0x538c61[_0x32e6('0x18')],'interface':_0x538c61['interface']};}}}catch(_0xacd28c){logger[_0x32e6('0x30')](_0x32e6('0x3d'),_0xacd28c[_0x32e6('0x34')]);}};Acw['prototype'][_0x32e6('0x9')]=function(_0x4f0fca){try{if(this[_0x32e6('0x16')][_0x4f0fca[_0x32e6('0x2c')]]&&_[_0x32e6('0x3e')](this[_0x32e6('0x16')][_0x4f0fca[_0x32e6('0x2c')]][_0x32e6('0x23')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x4f0fca[_0x32e6('0x2c')]);this[_0x32e6('0x15')](_0x4f0fca[_0x32e6('0x2c')]);}else if(this['channels'][_0x4f0fca[_0x32e6('0x3f')]]&&_['isUndefined'](this[_0x32e6('0x16')][_0x4f0fca[_0x32e6('0x3f')]][_0x32e6('0x23')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x4f0fca['linkedid']);this[_0x32e6('0x15')](_0x4f0fca[_0x32e6('0x3f')]);}}catch(_0x4b9712){logger[_0x32e6('0x30')](_0x32e6('0x40'),_0x4b9712[_0x32e6('0x34')]);}};Acw[_0x32e6('0x14')][_0x32e6('0x41')]=function(_0x3ec1a1){try{if(this['channels'][_0x3ec1a1[_0x32e6('0x2c')]]&&this[_0x32e6('0x16')][_0x3ec1a1[_0x32e6('0x2c')]][_0x32e6('0x23')]){logger['info'](_0x32e6('0x42'),_0x3ec1a1[_0x32e6('0x2c')]);this[_0x32e6('0x15')](_0x3ec1a1[_0x32e6('0x2c')]);}else if(this[_0x32e6('0x16')][_0x3ec1a1[_0x32e6('0x3f')]]&&this[_0x32e6('0x16')][_0x3ec1a1['linkedid']][_0x32e6('0x23')]){logger[_0x32e6('0x21')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x3ec1a1['linkedid']);this['startAcw'](_0x3ec1a1[_0x32e6('0x3f')]);}}catch(_0xfe3749){logger[_0x32e6('0x30')]('[ACW][syncHangup]\x20%s',_0xfe3749[_0x32e6('0x34')]);}};Acw[_0x32e6('0x14')]['syncAttendedTransfer']=function(_0x45f131){try{if(!_[_0x32e6('0x43')](this[_0x32e6('0x16')][_0x45f131[_0x32e6('0x44')]])){this[_0x32e6('0x15')](_0x45f131[_0x32e6('0x44')]);if(this[_0x32e6('0x16')][_0x45f131[_0x32e6('0x45')]]){this[_0x32e6('0x16')][_0x45f131['secondtransfereruniqueid']]['attended']=!![];this['channels'][_0x45f131['transfertargetuniqueid']]=this[_0x32e6('0x16')][_0x45f131[_0x32e6('0x45')]];delete this[_0x32e6('0x16')][_0x45f131[_0x32e6('0x45')]];}}else if(!_[_0x32e6('0x43')](this[_0x32e6('0x16')][_0x45f131['transfertargetuniqueid']])){this[_0x32e6('0x15')](_0x45f131['transfertargetuniqueid']);if(this['channels'][_0x45f131[_0x32e6('0x46')]]){this[_0x32e6('0x16')][_0x45f131[_0x32e6('0x46')]][_0x32e6('0x23')]=!![];this[_0x32e6('0x16')][_0x45f131[_0x32e6('0x44')]]=this['channels'][_0x45f131[_0x32e6('0x46')]];delete this[_0x32e6('0x16')][_0x45f131['origtransfereruniqueid']];}}}catch(_0x5d5c2f){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x5d5c2f[_0x32e6('0x34')]);}};Acw['prototype'][_0x32e6('0x10')]=function(_0x2d2758){try{if(this['channels'][_0x2d2758['transfereruniqueid']]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x32e6('0x39')](_0x2d2758[_0x32e6('0x47')]));this[_0x32e6('0x15')](_0x2d2758[_0x32e6('0x47')]);}else if(this[_0x32e6('0x16')][_0x2d2758[_0x32e6('0x48')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON['stringify'](_0x2d2758[_0x32e6('0x48')]));this[_0x32e6('0x15')](_0x2d2758[_0x32e6('0x48')]);}}catch(_0x4455ad){logger['error'](_0x32e6('0x49'),_0x4455ad[_0x32e6('0x34')]);}};Acw['prototype'][_0x32e6('0xc')]=function(_0x56fe68){try{if(this[_0x32e6('0x4')][_0x56fe68['queue']]&&this[_0x32e6('0x4')][_0x56fe68[_0x32e6('0x18')]][_0x32e6('0x4a')]===_0x32e6('0x4b')){if(this[_0x32e6('0x5')][_0x56fe68[_0x32e6('0x17')]]){logger[_0x32e6('0x21')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x56fe68['uniqueid'],_0x56fe68[_0x32e6('0x17')],_0x56fe68['queue']);return RpcUser[_0x32e6('0x4c')](this['agents'][_0x56fe68[_0x32e6('0x17')]],'Auto-Pause',_0x56fe68['uniqueid']);}}}catch(_0x271c2d){logger[_0x32e6('0x30')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x271c2d[_0x32e6('0x34')]);}};module[_0x32e6('0x4d')]=Acw;
\ No newline at end of file
+var _0xccc9=['milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','updateAcw','uniqueid','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','error','[ACW][START]\x20%s','message','prototype','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','stringify','transfererlinkedid','syncAgentRingNoAnswer','autopause','all','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','syncHangupRequest','syncHangup','agentringnoanswer','syncAttendedTransfer','syncAgentConnectPreview'];(function(_0x568ae7,_0x2b5fa3){var _0x257050=function(_0x43e8df){while(--_0x43e8df){_0x568ae7['push'](_0x568ae7['shift']());}};_0x257050(++_0x2b5fa3);}(_0xccc9,0x12c));var _0x9ccc=function(_0x44bb2f,_0x1f184c){_0x44bb2f=_0x44bb2f-0x0;var _0x4df9ad=_0xccc9[_0x44bb2f];return _0x4df9ad;};'use strict';var util=require(_0x9ccc('0x0'));var _=require(_0x9ccc('0x1'));var moment=require(_0x9ccc('0x2'));var ami=require(_0x9ccc('0x3'));var logger=require(_0x9ccc('0x4'))(_0x9ccc('0x5'));var RpcUser=require(_0x9ccc('0x6'));var RpcVoiceAgentReport=require(_0x9ccc('0x7'));function Acw(_0x41fd35){this['voiceQueues']=_0x41fd35[_0x9ccc('0x8')];this[_0x9ccc('0x9')]=_0x41fd35[_0x9ccc('0x9')];this[_0x9ccc('0xa')]=_0x41fd35[_0x9ccc('0xa')];this[_0x9ccc('0xb')]={};ami['on'](_0x9ccc('0xc'),this[_0x9ccc('0xd')][_0x9ccc('0xe')](this));ami['on']('hanguprequest',this[_0x9ccc('0xf')][_0x9ccc('0xe')](this));ami['on']('hangup',this[_0x9ccc('0x10')][_0x9ccc('0xe')](this));ami['on'](_0x9ccc('0x11'),this['syncAgentRingNoAnswer'][_0x9ccc('0xe')](this));ami['on']('attendedtransfer',this[_0x9ccc('0x12')][_0x9ccc('0xe')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x9ccc('0xe')](this));ami['on']('custom:agentConnectPreview',this[_0x9ccc('0x13')][_0x9ccc('0xe')](this));}function getDiff(_0x2a9eb3){var _0x5a75e3=moment()['milliseconds'](0x0);var _0x547a76=moment(_0x2a9eb3)[_0x9ccc('0x14')](0x0);return _0x5a75e3[_0x9ccc('0x15')](_0x547a76,_0x9ccc('0x16'));}Acw['prototype'][_0x9ccc('0x17')]=function(_0x34b81f){try{var _0x30e11c=this;var _0x3f96b6=this[_0x9ccc('0xb')][_0x34b81f][_0x9ccc('0x18')];var _0x3eaf6e=this[_0x9ccc('0xb')][_0x34b81f][_0x9ccc('0x19')];var _0x290d57=this[_0x9ccc('0x8')][_0x3eaf6e];var _0x88a51=![];var _0x12e54f=_0x9ccc('0x1a');if(_0x290d57[_0x9ccc('0x1b')]){if(_0x290d57['mandatoryDispositionPause'][_0x9ccc('0x1c')]){_0x88a51=!![];_0x12e54f=_0x290d57['mandatoryDispositionPause'][_0x9ccc('0x1c')];}}ami['Action']({'action':_0x9ccc('0x1d'),'interface':_0x3f96b6,'paused':!![],'reason':_0x12e54f})[_0x9ccc('0x1e')](function(_0x109741){if(_0x30e11c['agents'][_0x3f96b6]){return RpcUser[_0x9ccc('0x1f')](_0x30e11c['agents'][_0x3f96b6]['id'])[_0x9ccc('0x1e')](function(_0x290f4c){if(_0x290f4c&&!_0x290f4c[_0x9ccc('0x20')]){logger[_0x9ccc('0x21')](_0x9ccc('0x22'),_0x34b81f,_0x3f96b6,_0x3eaf6e);var _0x3e2400=_0x30e11c['channels'][_0x34b81f][_0x9ccc('0x23')]&&_0x30e11c[_0x9ccc('0xb')][_0x34b81f][_0x9ccc('0x24')]?_0x30e11c[_0x9ccc('0xb')][_0x34b81f][_0x9ccc('0x24')]:_0x34b81f;return RpcUser['savePause'](_0x30e11c[_0x9ccc('0x9')][_0x3f96b6],_0x12e54f,_0x3e2400)[_0x9ccc('0x1e')](function(_0xb4aa94){if(!_0x88a51){_0x30e11c['timers'][_0x3f96b6]={};logger['info'](_0x9ccc('0x25'),_0x34b81f,_0x30e11c[_0x9ccc('0x8')][_0x3eaf6e][_0x9ccc('0x26')],_0x3f96b6,_0x3eaf6e);_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x27')]=setTimeout(_0x30e11c[_0x9ccc('0x28')]['bind'](_0x30e11c,_0x3f96b6),_0x30e11c[_0x9ccc('0x8')][_0x3eaf6e][_0x9ccc('0x26')]*0x3e8);_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x29')]=moment()[_0x9ccc('0x2a')](_0x9ccc('0x2b'));_0x30e11c['timers'][_0x3f96b6]['uniqueid']=_0x34b81f;_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x19')]=_0x3eaf6e;_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x2c')]=function(){var _0x31e671=getDiff(_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x29')]);clearTimeout(_0x30e11c[_0x9ccc('0xa')][_0x3f96b6]['timer']);_0x30e11c['timers'][_0x3f96b6]['timer']=![];RpcVoiceAgentReport['update']({'acwtime':_0x31e671},_0x30e11c[_0x9ccc('0xa')][_0x3f96b6][_0x9ccc('0x2d')],_0x3f96b6)['then'](function(_0xec75d3){logger[_0x9ccc('0x21')](_0x9ccc('0x2e'),_0x34b81f,_0x31e671,_0xec75d3);})[_0x9ccc('0x2f')](function(_0x152555){logger['error'](_0x9ccc('0x30'),_0x34b81f,_0x152555);});delete _0x30e11c[_0x9ccc('0xa')][_0x3f96b6];};}});}else{logger['info'](_0x9ccc('0x31'),_0x34b81f,_0x3f96b6,_0x3eaf6e);}});}})[_0x9ccc('0x2f')](function(_0x40827d){logger['error'](_0x9ccc('0x25'),_0x34b81f,_0x30e11c[_0x9ccc('0x8')][_0x3eaf6e][_0x9ccc('0x26')],_0x3f96b6,_0x3eaf6e);})[_0x9ccc('0x32')](function(){delete _0x30e11c[_0x9ccc('0xb')][_0x34b81f];});}catch(_0x167377){logger[_0x9ccc('0x33')](_0x9ccc('0x34'),_0x167377[_0x9ccc('0x35')]);}};Acw[_0x9ccc('0x36')][_0x9ccc('0x28')]=function(_0x78aa2e){try{var _0x1a6824=this;if(_0x1a6824[_0x9ccc('0xa')][_0x78aa2e]){_0x1a6824[_0x9ccc('0xa')][_0x78aa2e][_0x9ccc('0x27')]=![];var _0x17490c=_0x1a6824['timers'][_0x78aa2e]['uniqueid'];var _0x195b2e=_0x1a6824['timers'][_0x78aa2e][_0x9ccc('0x19')];var _0x40e4e2=_0x1a6824[_0x9ccc('0x8')][_0x195b2e]['acwTimeout'];logger[_0x9ccc('0x21')](_0x9ccc('0x37'),_0x17490c,_0x78aa2e);RpcUser[_0x9ccc('0x38')](this[_0x9ccc('0x9')][_0x78aa2e]);RpcVoiceAgentReport[_0x9ccc('0x39')]({'acwtime':_0x40e4e2,'agentacw':!![]},_0x17490c,_0x78aa2e)[_0x9ccc('0x1e')](function(_0x322c68){logger['info'](_0x9ccc('0x2e'),_0x17490c,_0x40e4e2,_0x322c68);})[_0x9ccc('0x2f')](function(_0x2e9fba){logger[_0x9ccc('0x33')](_0x9ccc('0x30'),_0x17490c,_0x2e9fba);});}else{logger[_0x9ccc('0x33')](_0x9ccc('0x3a'),_0x78aa2e);if(_0x1a6824[_0x9ccc('0xa')]){logger[_0x9ccc('0x21')]('[ACW][TIMERS]',JSON['stringify'](_0x1a6824[_0x9ccc('0xa')]));}}}catch(_0x58e194){logger[_0x9ccc('0x33')]('[ACW][STOP]\x20%s',_0x58e194[_0x9ccc('0x35')]);}};Acw['prototype'][_0x9ccc('0xd')]=function(_0x52857b){try{if(this[_0x9ccc('0x8')][_0x52857b[_0x9ccc('0x19')]]&&(this[_0x9ccc('0x8')][_0x52857b[_0x9ccc('0x19')]][_0x9ccc('0x5')]||this[_0x9ccc('0x8')][_0x52857b['queue']][_0x9ccc('0x1b')])){if(this[_0x9ccc('0x9')][_0x52857b['interface']]){this[_0x9ccc('0xb')][_0x52857b['uniqueid']]={'queue':_0x52857b['queue'],'interface':_0x52857b[_0x9ccc('0x18')],'destlinkedid':_0x52857b[_0x9ccc('0x24')]};}}}catch(_0x2f2f6e){logger[_0x9ccc('0x33')]('[ACW][syncAgentConnect]\x20%s',_0x2f2f6e['message']);}};Acw[_0x9ccc('0x36')]['syncAgentConnectPreview']=function(_0x39432c){try{if(this[_0x9ccc('0x8')][_0x39432c[_0x9ccc('0x19')]]&&(this['voiceQueues'][_0x39432c['queue']][_0x9ccc('0x5')]||this['voiceQueues'][_0x39432c[_0x9ccc('0x19')]]['mandatoryDisposition'])){if(this['agents'][_0x39432c[_0x9ccc('0x18')]]){this[_0x9ccc('0xb')][_0x39432c['uniqueid']]={'queue':_0x39432c[_0x9ccc('0x19')],'interface':_0x39432c[_0x9ccc('0x18')]};}}}catch(_0x246403){logger[_0x9ccc('0x33')](_0x9ccc('0x3b'),_0x246403['message']);}};Acw[_0x9ccc('0x36')][_0x9ccc('0xf')]=function(_0x45f233){try{if(this[_0x9ccc('0xb')][_0x45f233['uniqueid']]&&_['isUndefined'](this[_0x9ccc('0xb')][_0x45f233[_0x9ccc('0x2d')]][_0x9ccc('0x23')])){logger[_0x9ccc('0x21')](_0x9ccc('0x3c'),_0x45f233[_0x9ccc('0x2d')]);this['startAcw'](_0x45f233[_0x9ccc('0x2d')]);}else if(this[_0x9ccc('0xb')][_0x45f233[_0x9ccc('0x3d')]]&&_[_0x9ccc('0x3e')](this[_0x9ccc('0xb')][_0x45f233[_0x9ccc('0x3d')]][_0x9ccc('0x23')])){logger[_0x9ccc('0x21')]('[%s][HANGUP:LINKEDID]',_0x45f233[_0x9ccc('0x3d')]);this[_0x9ccc('0x17')](_0x45f233['linkedid']);}}catch(_0x12a9ac){logger[_0x9ccc('0x33')]('[ACW][syncHangupRequest]\x20%s',_0x12a9ac[_0x9ccc('0x35')]);}};Acw['prototype'][_0x9ccc('0x10')]=function(_0x108762){try{if(this[_0x9ccc('0xb')][_0x108762[_0x9ccc('0x2d')]]&&this[_0x9ccc('0xb')][_0x108762[_0x9ccc('0x2d')]][_0x9ccc('0x23')]){logger['info'](_0x9ccc('0x3f'),_0x108762['uniqueid']);this[_0x9ccc('0x17')](_0x108762[_0x9ccc('0x2d')]);}else if(this[_0x9ccc('0xb')][_0x108762['linkedid']]&&this[_0x9ccc('0xb')][_0x108762[_0x9ccc('0x3d')]][_0x9ccc('0x23')]){logger['info'](_0x9ccc('0x40'),_0x108762['linkedid']);this[_0x9ccc('0x17')](_0x108762[_0x9ccc('0x3d')]);}}catch(_0x44b355){logger[_0x9ccc('0x33')]('[ACW][syncHangup]\x20%s',_0x44b355['message']);}};Acw['prototype'][_0x9ccc('0x12')]=function(_0xf18f29){try{if(!_['isNil'](this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x41')]])){this[_0x9ccc('0x17')](_0xf18f29[_0x9ccc('0x41')]);if(this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x42')]]){this[_0x9ccc('0xb')][_0xf18f29['secondtransfereruniqueid']][_0x9ccc('0x23')]=!![];this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x43')]]=this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x42')]];delete this['channels'][_0xf18f29[_0x9ccc('0x42')]];}}else if(!_['isNil'](this[_0x9ccc('0xb')][_0xf18f29['transfertargetuniqueid']])){this[_0x9ccc('0x17')](_0xf18f29[_0x9ccc('0x43')]);if(this[_0x9ccc('0xb')][_0xf18f29['origtransfereruniqueid']]){this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x44')]][_0x9ccc('0x23')]=!![];this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x41')]]=this[_0x9ccc('0xb')][_0xf18f29['origtransfereruniqueid']];delete this[_0x9ccc('0xb')][_0xf18f29[_0x9ccc('0x44')]];}}}catch(_0x442882){logger['error'](_0x9ccc('0x45'),_0x442882[_0x9ccc('0x35')]);}};Acw[_0x9ccc('0x36')][_0x9ccc('0x46')]=function(_0x55aa84){try{if(this[_0x9ccc('0xb')][_0x55aa84['transfereruniqueid']]){logger[_0x9ccc('0x21')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x55aa84[_0x9ccc('0x47')]));this['startAcw'](_0x55aa84['transfereruniqueid']);}else if(this['channels'][_0x55aa84['transfererlinkedid']]){logger[_0x9ccc('0x21')](_0x9ccc('0x48'),JSON[_0x9ccc('0x49')](_0x55aa84[_0x9ccc('0x4a')]));this['startAcw'](_0x55aa84[_0x9ccc('0x4a')]);}}catch(_0x31a946){logger[_0x9ccc('0x33')]('[ACW][syncBlindTransfer]\x20%s',_0x31a946[_0x9ccc('0x35')]);}};Acw[_0x9ccc('0x36')][_0x9ccc('0x4b')]=function(_0x166468){try{if(this[_0x9ccc('0x8')][_0x166468[_0x9ccc('0x19')]]&&this[_0x9ccc('0x8')][_0x166468[_0x9ccc('0x19')]][_0x9ccc('0x4c')]===_0x9ccc('0x4d')){if(this[_0x9ccc('0x9')][_0x166468['interface']]){logger[_0x9ccc('0x21')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x166468[_0x9ccc('0x2d')],_0x166468[_0x9ccc('0x18')],_0x166468[_0x9ccc('0x19')]);return RpcUser[_0x9ccc('0x4e')](this[_0x9ccc('0x9')][_0x166468['interface']],'Auto-Pause',_0x166468[_0x9ccc('0x2d')]);}}}catch(_0xcc8673){logger[_0x9ccc('0x33')](_0x9ccc('0x4f'),_0xcc8673[_0x9ccc('0x35')]);}};module['exports']=Acw;
\ No newline at end of file
index 8ce0f6a..ffcc183 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e0a=['password','Action','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','once','close','shutdown','info','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','catch','log','exports','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk','username'];(function(_0x3760f1,_0x498373){var _0x14d886=function(_0x104123){while(--_0x104123){_0x3760f1['push'](_0x3760f1['shift']());}};_0x14d886(++_0x498373);}(_0x9e0a,0x96));var _0xa9e0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9e0a[_0x14add3];return _0x4a174f;};'use strict';var Manager=require(_0xa9e0('0x0'));var BPromise=require(_0xa9e0('0x1'));var moment=require(_0xa9e0('0x2'));var util=require(_0xa9e0('0x3'));var _=require(_0xa9e0('0x4'));var logger=require(_0xa9e0('0x5'))(_0xa9e0('0x6'));var config=require(_0xa9e0('0x7'));var ami=new Manager(config[_0xa9e0('0x8')]['port'],config[_0xa9e0('0x8')]['ip'],config[_0xa9e0('0x8')][_0xa9e0('0x9')],config[_0xa9e0('0x8')][_0xa9e0('0xa')],!![]);ami['keepConnected']();ami[_0xa9e0('0xb')]=BPromise['promisify'](ami[_0xa9e0('0xc')]);function error(_0x4255a4){logger[_0xa9e0('0xd')](util[_0xa9e0('0xe')](_0xa9e0('0xf'),config['asterisk'][_0xa9e0('0x9')],config[_0xa9e0('0x8')]['ip'],config[_0xa9e0('0x8')][_0xa9e0('0x10')],util['inspect'](_0x4255a4,![],null)));}function close(){logger[_0xa9e0('0xd')](util[_0xa9e0('0xe')](_0xa9e0('0x11'),config[_0xa9e0('0x8')]['username'],config[_0xa9e0('0x8')]['ip'],config[_0xa9e0('0x8')][_0xa9e0('0x10')]));}ami[_0xa9e0('0x12')]=function(){return function(){return ami[_0xa9e0('0xb')]({'action':_0xa9e0('0x13')});};};ami[_0xa9e0('0x14')]=function(){return function(){return ami['Action']({'action':_0xa9e0('0x15')});};};ami[_0xa9e0('0x16')]=function(){return function(){return ami[_0xa9e0('0xb')]({'action':_0xa9e0('0x17')});};};ami[_0xa9e0('0x18')]=function(){return function(){return ami['Action']({'action':_0xa9e0('0x19')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xa9e0('0xb')]({'action':_0xa9e0('0x1a')});};};function connect(_0x4f3707){logger['info'](util[_0xa9e0('0xe')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa9e0('0x8')][_0xa9e0('0x9')],config[_0xa9e0('0x8')]['ip'],config[_0xa9e0('0x8')][_0xa9e0('0x10')]));ami[_0xa9e0('0x1b')](_0xa9e0('0xd'),error);ami[_0xa9e0('0x1b')](_0xa9e0('0x1c'),close);}ami['on']('connect',connect);ami['on'](_0xa9e0('0x1d'),function(_0x5a9f58){logger[_0xa9e0('0x1e')](util[_0xa9e0('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa9e0('0x8')][_0xa9e0('0x9')],config[_0xa9e0('0x8')]['ip'],config['asterisk'][_0xa9e0('0x10')],util[_0xa9e0('0x1f')](_0x5a9f58,![],null)));});ami['on'](_0xa9e0('0x20'),function(_0x488b67){logger[_0xa9e0('0x1e')](util[_0xa9e0('0xe')](_0xa9e0('0x21'),config[_0xa9e0('0x8')][_0xa9e0('0x9')],config['asterisk']['ip'],config[_0xa9e0('0x8')]['port']));return BPromise[_0xa9e0('0x22')]()[_0xa9e0('0x23')](ami[_0xa9e0('0x12')]())[_0xa9e0('0x23')](ami[_0xa9e0('0x14')]())[_0xa9e0('0x23')](ami[_0xa9e0('0x16')]())[_0xa9e0('0x23')](ami[_0xa9e0('0x18')]())[_0xa9e0('0x23')](ami[_0xa9e0('0x24')]())[_0xa9e0('0x25')](function(_0x490fb3){console[_0xa9e0('0x26')](_0x490fb3);});});ami['once'](_0xa9e0('0xd'),error);ami[_0xa9e0('0x1b')](_0xa9e0('0x1c'),close);module[_0xa9e0('0x27')]=ami;
\ No newline at end of file
+var _0x815e=['coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionSipShowRegistry','actionSipPeerStatus','catch','log','asterisk-manager','bluebird','moment','util','lodash','../../config/logger','../../config/environment','asterisk','port','username','keepConnected','Action','promisify','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','error','sipshowregistry','actionDeviceStateList','devicestatelist','actionQueueSummary','queuesummary','actionCoreShowChannels'];(function(_0x45ee52,_0x28c470){var _0xd4fdd2=function(_0x4f99d){while(--_0x4f99d){_0x45ee52['push'](_0x45ee52['shift']());}};_0xd4fdd2(++_0x28c470);}(_0x815e,0x7e));var _0xe815=function(_0x5611e5,_0x45495e){_0x5611e5=_0x5611e5-0x0;var _0x202aa6=_0x815e[_0x5611e5];return _0x202aa6;};'use strict';var Manager=require(_0xe815('0x0'));var BPromise=require(_0xe815('0x1'));var moment=require(_0xe815('0x2'));var util=require(_0xe815('0x3'));var _=require(_0xe815('0x4'));var logger=require(_0xe815('0x5'))('ami');var config=require(_0xe815('0x6'));var ami=new Manager(config[_0xe815('0x7')][_0xe815('0x8')],config[_0xe815('0x7')]['ip'],config[_0xe815('0x7')][_0xe815('0x9')],config[_0xe815('0x7')]['password'],!![]);ami[_0xe815('0xa')]();ami[_0xe815('0xb')]=BPromise[_0xe815('0xc')](ami['action']);function error(_0x27a572){logger['error'](util[_0xe815('0xd')](_0xe815('0xe'),config[_0xe815('0x7')][_0xe815('0x9')],config[_0xe815('0x7')]['ip'],config[_0xe815('0x7')][_0xe815('0x8')],util['inspect'](_0x27a572,![],null)));}function close(){logger[_0xe815('0xf')](util[_0xe815('0xd')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xe815('0x7')][_0xe815('0x9')],config['asterisk']['ip'],config['asterisk'][_0xe815('0x8')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0xe815('0xb')]({'action':_0xe815('0x10')});};};ami[_0xe815('0x11')]=function(){return function(){return ami[_0xe815('0xb')]({'action':_0xe815('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':'sippeerstatus'});};};ami[_0xe815('0x13')]=function(){return function(){return ami[_0xe815('0xb')]({'action':_0xe815('0x14')});};};ami[_0xe815('0x15')]=function(){return function(){return ami['Action']({'action':_0xe815('0x16')});};};function connect(_0x5aa687){logger[_0xe815('0x17')](util[_0xe815('0xd')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xe815('0x7')][_0xe815('0x9')],config['asterisk']['ip'],config[_0xe815('0x7')][_0xe815('0x8')]));ami['once'](_0xe815('0xf'),error);ami[_0xe815('0x18')](_0xe815('0x19'),close);}ami['on'](_0xe815('0x1a'),connect);ami['on'](_0xe815('0x1b'),function(_0x132aa7){logger[_0xe815('0x17')](util[_0xe815('0xd')](_0xe815('0x1c'),config[_0xe815('0x7')][_0xe815('0x9')],config['asterisk']['ip'],config[_0xe815('0x7')][_0xe815('0x8')],util[_0xe815('0x1d')](_0x132aa7,![],null)));});ami['on'](_0xe815('0x1e'),function(_0x3a7121){logger['info'](util[_0xe815('0xd')](_0xe815('0x1f'),config[_0xe815('0x7')][_0xe815('0x9')],config[_0xe815('0x7')]['ip'],config[_0xe815('0x7')]['port']));return BPromise['resolve']()[_0xe815('0x20')](ami[_0xe815('0x21')]())[_0xe815('0x20')](ami[_0xe815('0x11')]())['then'](ami[_0xe815('0x22')]())[_0xe815('0x20')](ami[_0xe815('0x13')]())[_0xe815('0x20')](ami['actionCoreShowChannels']())[_0xe815('0x23')](function(_0x2f5e31){console[_0xe815('0x24')](_0x2f5e31);});});ami[_0xe815('0x18')](_0xe815('0xf'),error);ami[_0xe815('0x18')](_0xe815('0x19'),close);module['exports']=ami;
\ No newline at end of file
index cec92a3..fd65169 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x1f120c,_0x22cd8f){var _0x3f43f5=function(_0x2e6eef){while(--_0x2e6eef){_0x1f120c['push'](_0x1f120c['shift']());}};_0x3f43f5(++_0x22cd8f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x26f0b7,_0x3197cd){_0x26f0b7=_0x26f0b7-0x0;var _0xcac05e=_0xb43b[_0x26f0b7];return _0xcac05e;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client;
\ No newline at end of file
+var _0x9bde=['message','result','catch','exports','bluebird','ami','http','Request','request','debug','rpc','memberReport','error'];(function(_0x4d3a9b,_0x20b47d){var _0x1b5471=function(_0x51bf57){while(--_0x51bf57){_0x4d3a9b['push'](_0x4d3a9b['shift']());}};_0x1b5471(++_0x20b47d);}(_0x9bde,0xe1));var _0xe9bd=function(_0x5b2f84,_0x55ff7f){_0x5b2f84=_0x5b2f84-0x0;var _0x51e12c=_0x9bde[_0x5b2f84];return _0x51e12c;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var client=jayson['client'][_0xe9bd('0x2')]({'port':0x2329});client[_0xe9bd('0x3')]=function(_0x131f6a,_0x1c1b34){return new BPromise(function(_0x10822d,_0x1a4d14){return client[_0xe9bd('0x4')](_0x131f6a,_0x1c1b34)['then'](function(_0x4763e9){logger[_0xe9bd('0x5')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x1c1b34,_0x4763e9);if(_0x4763e9[_0xe9bd('0x8')]){logger[_0xe9bd('0x8')](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x4763e9[_0xe9bd('0x8')][_0xe9bd('0x9')],_0x1c1b34);return _0x1a4d14(_0x4763e9['error']['message']);}else{return _0x10822d(_0x4763e9[_0xe9bd('0xa')]);}})[_0xe9bd('0xb')](function(_0x2601ac){logger['error'](_0xe9bd('0x6'),_0xe9bd('0x7'),_0x131f6a,_0x2601ac,_0x1c1b34);return _0x1a4d14(_0x2601ac);});});};module[_0xe9bd('0xc')]=client;
\ No newline at end of file
index cd604df..5b3f554 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ec2=['name','Contact','phone','firstName','queue','active','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','substring','dialCutDigit','prototype','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue'];(function(_0x134d1d,_0x22b473){var _0x30b003=function(_0x5930dc){while(--_0x5930dc){_0x134d1d['push'](_0x134d1d['shift']());}};_0x30b003(++_0x22b473);}(_0x4ec2,0x12e));var _0x24ec=function(_0x9e670a,_0x51a058){_0x9e670a=_0x9e670a-0x0;var _0x2b4add=_0x4ec2[_0x9e670a];return _0x2b4add;};'use strict';var util=require(_0x24ec('0x0'));var _=require(_0x24ec('0x1'));var moment=require(_0x24ec('0x2'));function checkNameSurname(_0x3b627a,_0x366ee6,_0x3d84ee){var _0x25b93a='';if(!_[_0x24ec('0x3')](_0x366ee6)&&_0x24ec('0x4')===typeof _0x366ee6){_0x25b93a+=_0x366ee6;}if(!_[_0x24ec('0x3')](_0x3d84ee)&&_0x24ec('0x4')===typeof _0x3d84ee){_0x25b93a+='\x20'+_0x3d84ee;}if(_0x25b93a!==''){return _0x25b93a;}return _0x3b627a;}function Action(_0x3c2e6d,_0x2f30a7,_0x55e345){this[_0x24ec('0x5')]=_0x3c2e6d;this['uniqueid']=_0x55e345||undefined;this[_0x24ec('0x6')]=checkNameSurname(_0x2f30a7[_0x24ec('0x7')][_0x24ec('0x8')],_0x2f30a7[_0x24ec('0x7')][_0x24ec('0x9')],_0x2f30a7[_0x24ec('0x7')]['lastName']);this['number']=_0x2f30a7[_0x24ec('0x7')][_0x24ec('0x8')];this[_0x24ec('0xa')]=_0x3c2e6d['name'];this['active']=_0x2f30a7[_0x24ec('0xb')]||![];this['type']=_0x3c2e6d['type'];this['dialQueueTimeout']=_0x3c2e6d[_0x24ec('0xc')]||0x3;this[_0x24ec('0xd')]=_0x2f30a7[_0x24ec('0xd')];this['countbusyretry']=_0x2f30a7[_0x24ec('0xe')];this[_0x24ec('0xf')]=_0x2f30a7['countcongestionretry'];this[_0x24ec('0x10')]=_0x2f30a7[_0x24ec('0x10')];this[_0x24ec('0x11')]=_0x2f30a7[_0x24ec('0x11')];this[_0x24ec('0x12')]=_0x2f30a7[_0x24ec('0x12')];this[_0x24ec('0x13')]=_0x2f30a7[_0x24ec('0x13')];this[_0x24ec('0x14')]=_0x2f30a7['countmachineretry'];this[_0x24ec('0x15')]=_0x2f30a7['countagentrejectretry'];this[_0x24ec('0x16')]=_0x2f30a7[_0x24ec('0x16')];this['ListId']=_0x2f30a7['ListId'];this['UserId']=_0x2f30a7[_0x24ec('0x17')];this[_0x24ec('0x18')]=_0x2f30a7[_0x24ec('0x18')];this[_0x24ec('0x19')]=_0x2f30a7[_0x24ec('0x19')];this[_0x24ec('0x1a')]=_0x2f30a7['id'];this[_0x24ec('0x1b')]=_0x2f30a7['Contact']['firstName']||'';this[_0x24ec('0x1c')]=moment()[_0x24ec('0x1d')](_0x24ec('0x1e'));this[_0x24ec('0x1f')]=_0x2f30a7[_0x24ec('0x1f')];this[_0x24ec('0x20')]=_0x2f30a7['callbackuniqueid'];this['callbackat']=_0x2f30a7['callbackat'];this[_0x24ec('0x21')]=_0x2f30a7[_0x24ec('0x21')];this[_0x24ec('0x22')]='';this[_0x24ec('0x23')]='';}Action['prototype'][_0x24ec('0x24')]=function(){return util['format'](_0x24ec('0x25'),this[_0x24ec('0x6')],this[_0x24ec('0x5')]['dialCutDigit']>0x0?this[_0x24ec('0x26')][_0x24ec('0x27')](this['voiceQueue'][_0x24ec('0x28')]):this[_0x24ec('0x26')]);};Action[_0x24ec('0x29')][_0x24ec('0x2a')]=function(){return this[_0x24ec('0xa')];};module[_0x24ec('0x2b')]=Action;
\ No newline at end of file
+var _0x9420=['number','dialCutDigit','exports','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>'];(function(_0x251887,_0x291ef6){var _0x5cf278=function(_0x2cd082){while(--_0x2cd082){_0x251887['push'](_0x251887['shift']());}};_0x5cf278(++_0x291ef6);}(_0x9420,0x1dc));var _0x0942=function(_0x257642,_0x270a80){_0x257642=_0x257642-0x0;var _0x3d813b=_0x9420[_0x257642];return _0x3d813b;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0942('0x0'));function checkNameSurname(_0x42a2cf,_0x526911,_0x16c51a){var _0xc5767c='';if(!_[_0x0942('0x1')](_0x526911)&&_0x0942('0x2')===typeof _0x526911){_0xc5767c+=_0x526911;}if(!_['isNil'](_0x16c51a)&&_0x0942('0x2')===typeof _0x16c51a){_0xc5767c+='\x20'+_0x16c51a;}if(_0xc5767c!==''){return _0xc5767c;}return _0x42a2cf;}function Action(_0x1698f2,_0x3a22b2,_0x106ca5){this[_0x0942('0x3')]=_0x1698f2;this[_0x0942('0x4')]=_0x106ca5||undefined;this[_0x0942('0x5')]=checkNameSurname(_0x3a22b2[_0x0942('0x6')][_0x0942('0x7')],_0x3a22b2[_0x0942('0x6')][_0x0942('0x8')],_0x3a22b2['Contact']['lastName']);this['number']=_0x3a22b2['Contact'][_0x0942('0x7')];this[_0x0942('0x9')]=_0x1698f2['name'];this['active']=_0x3a22b2[_0x0942('0xa')]||![];this[_0x0942('0xb')]=_0x1698f2[_0x0942('0xb')];this[_0x0942('0xc')]=_0x1698f2[_0x0942('0xc')]||0x3;this[_0x0942('0xd')]=_0x3a22b2['scheduledat'];this[_0x0942('0xe')]=_0x3a22b2[_0x0942('0xe')];this[_0x0942('0xf')]=_0x3a22b2[_0x0942('0xf')];this['countnoanswerretry']=_0x3a22b2[_0x0942('0x10')];this[_0x0942('0x11')]=_0x3a22b2[_0x0942('0x11')];this[_0x0942('0x12')]=_0x3a22b2[_0x0942('0x12')];this[_0x0942('0x13')]=_0x3a22b2[_0x0942('0x13')];this['countmachineretry']=_0x3a22b2[_0x0942('0x14')];this[_0x0942('0x15')]=_0x3a22b2[_0x0942('0x15')];this[_0x0942('0x16')]=_0x3a22b2['ContactId'];this[_0x0942('0x17')]=_0x3a22b2[_0x0942('0x17')];this[_0x0942('0x18')]=_0x3a22b2[_0x0942('0x18')];this[_0x0942('0x19')]=_0x3a22b2[_0x0942('0x19')];this[_0x0942('0x1a')]=_0x3a22b2[_0x0942('0x1a')];this['idHopper']=_0x3a22b2['id'];this[_0x0942('0x1b')]=_0x3a22b2[_0x0942('0x6')][_0x0942('0x8')]||'';this[_0x0942('0x1c')]=moment()[_0x0942('0x1d')](_0x0942('0x1e'));this[_0x0942('0x1f')]=_0x3a22b2[_0x0942('0x1f')];this['callbackuniqueid']=_0x3a22b2[_0x0942('0x20')];this[_0x0942('0x21')]=_0x3a22b2[_0x0942('0x21')];this[_0x0942('0x22')]=_0x3a22b2[_0x0942('0x22')];this[_0x0942('0x23')]='';this[_0x0942('0x24')]='';}Action[_0x0942('0x25')][_0x0942('0x26')]=function(){return util[_0x0942('0x1d')](_0x0942('0x27'),this[_0x0942('0x5')],this[_0x0942('0x3')]['dialCutDigit']>0x0?this[_0x0942('0x28')]['substring'](this['voiceQueue'][_0x0942('0x29')]):this[_0x0942('0x28')]);};Action[_0x0942('0x25')]['getQueue']=function(){return this['queue'];};module[_0x0942('0x2a')]=Action;
\ No newline at end of file
index 1e7a8fe..eb65e89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c79=['countnosuchnumberretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','answertime','format','ringtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','state','statedesc','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countagentrejectretry'];(function(_0x3dbae0,_0x2844b0){var _0xd7bebe=function(_0x16537a){while(--_0x16537a){_0x3dbae0['push'](_0x3dbae0['shift']());}};_0xd7bebe(++_0x2844b0);}(_0x2c79,0x1dd));var _0x92c7=function(_0x152316,_0x12b3f8){_0x152316=_0x152316-0x0;var _0x1eeda5=_0x2c79[_0x152316];return _0x1eeda5;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x92c7('0x0'));function getSeconds(_0x32dca7,_0x5f0e6d){var _0x3bf0f4=moment(_0x32dca7)[_0x92c7('0x1')](0x0);var _0x279d21=moment(_0x5f0e6d)[_0x92c7('0x1')](0x0);return _0x3bf0f4['diff'](_0x279d21,'seconds');}function AgentComplete(_0x5e1dd2,_0x2ed261){this[_0x92c7('0x2')]=0x4;this[_0x92c7('0x3')]='Answer';this['scheduledat']=_0x5e1dd2['scheduledat'];this['type']=_0x5e1dd2[_0x92c7('0x4')];this[_0x92c7('0x5')]=_0x5e1dd2[_0x92c7('0x4')]===_0x92c7('0x6')?_0x92c7('0x7'):_0x5e1dd2[_0x92c7('0x4')];this[_0x92c7('0x8')]=_0x5e1dd2[_0x92c7('0x8')];this[_0x92c7('0x9')]=_0x5e1dd2[_0x92c7('0x9')];this[_0x92c7('0xa')]=_0x5e1dd2[_0x92c7('0xa')];this[_0x92c7('0xb')]=_0x5e1dd2[_0x92c7('0x8')]+_0x5e1dd2[_0x92c7('0x9')]+_0x5e1dd2[_0x92c7('0xa')]+_0x5e1dd2['countnosuchnumberretry']+_0x5e1dd2[_0x92c7('0xc')]+_0x5e1dd2[_0x92c7('0xd')]+_0x5e1dd2['countmachineretry']+_0x5e1dd2[_0x92c7('0xe')];this[_0x92c7('0xf')]=_0x5e1dd2[_0x92c7('0xf')];this[_0x92c7('0xc')]=_0x5e1dd2[_0x92c7('0xc')];this[_0x92c7('0xd')]=_0x5e1dd2[_0x92c7('0xd')];this[_0x92c7('0x10')]=_0x5e1dd2[_0x92c7('0x10')];this[_0x92c7('0xe')]=_0x5e1dd2[_0x92c7('0xe')];this[_0x92c7('0x11')]=_0x2ed261[_0x92c7('0x11')];this['calleridname']=_0x5e1dd2[_0x92c7('0x12')];this[_0x92c7('0x13')]=_0x5e1dd2[_0x92c7('0x14')];this[_0x92c7('0x15')]=_0x5e1dd2[_0x92c7('0x15')];this['responsetime']=_0x5e1dd2[_0x92c7('0x16')];this[_0x92c7('0x17')]=_0x5e1dd2[_0x92c7('0x17')];this['endtime']=moment()[_0x92c7('0x18')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x92c7('0x19')]=getSeconds(_0x5e1dd2[_0x92c7('0x16')],_0x5e1dd2[_0x92c7('0x15')]);this['holdtime']=getSeconds(_0x5e1dd2[_0x92c7('0x17')],_0x5e1dd2[_0x92c7('0x16')]);this[_0x92c7('0x1a')]=getSeconds(this[_0x92c7('0x1b')],_0x5e1dd2['answertime']);this['queue']=_0x2ed261['queue'];this[_0x92c7('0x1c')]=_0x2ed261[_0x92c7('0x1c')];this[_0x92c7('0x1d')]=_0x2ed261[_0x92c7('0x1d')];this[_0x92c7('0x1e')]=_0x5e1dd2[_0x92c7('0x1e')];this['callbackuniqueid']=_0x5e1dd2[_0x92c7('0x1f')];this[_0x92c7('0x20')]=_0x5e1dd2['callbackat'];this[_0x92c7('0x21')]=_0x5e1dd2['recallme'];this[_0x92c7('0x22')]=_0x5e1dd2[_0x92c7('0x22')];this[_0x92c7('0x23')]=_0x5e1dd2[_0x92c7('0x23')];this['UserId']=_0x5e1dd2['UserId'];this[_0x92c7('0x24')]=_0x5e1dd2[_0x92c7('0x24')];this[_0x92c7('0x25')]=_0x5e1dd2[_0x92c7('0x25')];this[_0x92c7('0x26')]=_0x5e1dd2[_0x92c7('0x26')]||'';this[_0x92c7('0x27')]=_0x5e1dd2[_0x92c7('0x27')]||'';}module[_0x92c7('0x28')]=AgentComplete;
\ No newline at end of file
+var _0x9bbf=['diff','seconds','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment'];(function(_0x1c6d4f,_0x37e880){var _0x2598af=function(_0x4e9104){while(--_0x4e9104){_0x1c6d4f['push'](_0x1c6d4f['shift']());}};_0x2598af(++_0x37e880);}(_0x9bbf,0x15d));var _0xf9bb=function(_0x4f14ac,_0x44126a){_0x4f14ac=_0x4f14ac-0x0;var _0x544cec=_0x9bbf[_0x4f14ac];return _0x544cec;};'use strict';var util=require(_0xf9bb('0x0'));var _=require(_0xf9bb('0x1'));var moment=require(_0xf9bb('0x2'));function getSeconds(_0x24a686,_0x4b0927){var _0x216620=moment(_0x24a686)['milliseconds'](0x0);var _0x870b88=moment(_0x4b0927)['milliseconds'](0x0);return _0x216620[_0xf9bb('0x3')](_0x870b88,_0xf9bb('0x4'));}function AgentComplete(_0x7ca62d,_0x1a30ee){this['state']=0x4;this[_0xf9bb('0x5')]='Answer';this[_0xf9bb('0x6')]=_0x7ca62d[_0xf9bb('0x6')];this[_0xf9bb('0x7')]=_0x7ca62d[_0xf9bb('0x7')];this[_0xf9bb('0x8')]=_0x7ca62d[_0xf9bb('0x7')]===_0xf9bb('0x9')?_0xf9bb('0xa'):_0x7ca62d['type'];this[_0xf9bb('0xb')]=_0x7ca62d[_0xf9bb('0xb')];this[_0xf9bb('0xc')]=_0x7ca62d['countcongestionretry'];this[_0xf9bb('0xd')]=_0x7ca62d[_0xf9bb('0xd')];this['countglobal']=_0x7ca62d[_0xf9bb('0xb')]+_0x7ca62d['countcongestionretry']+_0x7ca62d['countnoanswerretry']+_0x7ca62d[_0xf9bb('0xe')]+_0x7ca62d['countdropretry']+_0x7ca62d[_0xf9bb('0xf')]+_0x7ca62d[_0xf9bb('0x10')]+_0x7ca62d[_0xf9bb('0x11')];this[_0xf9bb('0xe')]=_0x7ca62d[_0xf9bb('0xe')];this[_0xf9bb('0x12')]=_0x7ca62d[_0xf9bb('0x12')];this[_0xf9bb('0xf')]=_0x7ca62d[_0xf9bb('0xf')];this[_0xf9bb('0x10')]=_0x7ca62d[_0xf9bb('0x10')];this['countagentrejectretry']=_0x7ca62d[_0xf9bb('0x11')];this[_0xf9bb('0x13')]=_0x1a30ee[_0xf9bb('0x13')];this[_0xf9bb('0x14')]=_0x7ca62d[_0xf9bb('0x15')];this[_0xf9bb('0x16')]=_0x7ca62d['number'];this[_0xf9bb('0x17')]=_0x7ca62d[_0xf9bb('0x17')];this[_0xf9bb('0x18')]=_0x7ca62d[_0xf9bb('0x18')];this[_0xf9bb('0x19')]=_0x7ca62d[_0xf9bb('0x19')];this['endtime']=moment()['format'](_0xf9bb('0x1a'));this[_0xf9bb('0x1b')]=getSeconds(_0x7ca62d[_0xf9bb('0x18')],_0x7ca62d[_0xf9bb('0x17')]);this[_0xf9bb('0x1c')]=getSeconds(_0x7ca62d['answertime'],_0x7ca62d[_0xf9bb('0x18')]);this[_0xf9bb('0x1d')]=getSeconds(this[_0xf9bb('0x1e')],_0x7ca62d[_0xf9bb('0x19')]);this[_0xf9bb('0xa')]=_0x1a30ee[_0xf9bb('0xa')];this[_0xf9bb('0x1f')]=_0x1a30ee[_0xf9bb('0x1f')];this[_0xf9bb('0x20')]=_0x1a30ee[_0xf9bb('0x20')];this[_0xf9bb('0x21')]=_0x7ca62d['callback'];this[_0xf9bb('0x22')]=_0x7ca62d[_0xf9bb('0x22')];this[_0xf9bb('0x23')]=_0x7ca62d[_0xf9bb('0x23')];this[_0xf9bb('0x24')]=_0x7ca62d['recallme'];this[_0xf9bb('0x25')]=_0x7ca62d[_0xf9bb('0x25')];this[_0xf9bb('0x26')]=_0x7ca62d[_0xf9bb('0x26')];this[_0xf9bb('0x27')]=_0x7ca62d[_0xf9bb('0x27')];this[_0xf9bb('0x28')]=_0x7ca62d[_0xf9bb('0x28')];this['CampaignId']=_0x7ca62d[_0xf9bb('0x29')];this[_0xf9bb('0x2a')]=_0x7ca62d[_0xf9bb('0x2a')]||'';this['originatecalleridname']=_0x7ca62d['originatecalleridname']||'';}module[_0xf9bb('0x2b')]=AgentComplete;
\ No newline at end of file
index 1b6168f..f4ade1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','scheduledat','type'];(function(_0x34bc76,_0x1964b1){var _0x2be986=function(_0x26325d){while(--_0x26325d){_0x34bc76['push'](_0x34bc76['shift']());}};_0x2be986(++_0x1964b1);}(_0x5fc3,0xa8));var _0x35fc=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0x5fc3[_0x478c8a];return _0x3b6b3e;};'use strict';var util=require(_0x35fc('0x0'));var _=require(_0x35fc('0x1'));var moment=require('moment');function getSeconds(_0x253d6e,_0x2ac6da){var _0x196bc2=moment(_0x253d6e)[_0x35fc('0x2')](0x0);var _0xb4f9ce=moment(_0x2ac6da)['milliseconds'](0x0);return _0x196bc2[_0x35fc('0x3')](_0xb4f9ce,_0x35fc('0x4'));}function Final(_0x186a06){this['uniqueid']=_0x186a06['uniqueid'];this[_0x35fc('0x5')]=_0x186a06['scheduledat'];this[_0x35fc('0x6')]=_0x186a06[_0x35fc('0x6')];this[_0x35fc('0x7')]=_0x186a06[_0x35fc('0x6')]===_0x35fc('0x8')?_0x35fc('0x9'):_0x186a06[_0x35fc('0x6')];this['countbusyretry']=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]=_0x186a06['countcongestionretry'];this[_0x35fc('0xc')]=_0x186a06[_0x35fc('0xc')];this['countglobal']=_0x186a06[_0x35fc('0xa')]+_0x186a06[_0x35fc('0xb')]+_0x186a06['countnoanswerretry']+_0x186a06['countnosuchnumberretry']+_0x186a06[_0x35fc('0xd')]+_0x186a06['countabandonedretry']+_0x186a06[_0x35fc('0xe')]+_0x186a06[_0x35fc('0xf')];this[_0x35fc('0x10')]=_0x186a06[_0x35fc('0x10')];this[_0x35fc('0xd')]=_0x186a06['countdropretry'];this['countabandonedretry']=_0x186a06['countabandonedretry'];this['countmachineretry']=_0x186a06[_0x35fc('0xe')];this[_0x35fc('0xf')]=_0x186a06[_0x35fc('0xf')];this[_0x35fc('0x9')]=_0x186a06[_0x35fc('0x9')];this[_0x35fc('0x11')]=_0x186a06['calleridname'];this[_0x35fc('0x12')]=_0x186a06[_0x35fc('0x12')];this['starttime']=_0x186a06[_0x35fc('0x13')];this[_0x35fc('0x14')]=_0x186a06[_0x35fc('0x14')];this['endtime']=_0x186a06[_0x35fc('0x14')];this[_0x35fc('0x15')]=_0x186a06[_0x35fc('0x15')]||0x0;this['holdtime']=_0x186a06[_0x35fc('0x16')]||0x0;this[_0x35fc('0x17')]=_0x186a06[_0x35fc('0x17')]||0x0;this[_0x35fc('0x18')]=_0x186a06[_0x35fc('0x18')];this[_0x35fc('0x19')]=_0x186a06[_0x35fc('0x19')];this[_0x35fc('0x1a')]=_0x186a06[_0x35fc('0x1a')];this[_0x35fc('0x1b')]=_0x186a06['recallme'];this[_0x35fc('0x1c')]=_0x186a06[_0x35fc('0x1c')];this[_0x35fc('0x1d')]=_0x186a06[_0x35fc('0x1d')];this[_0x35fc('0x1e')]=_0x186a06['UserId'];this[_0x35fc('0x1f')]=_0x186a06[_0x35fc('0x1f')];this['CampaignId']=_0x186a06[_0x35fc('0x20')];this[_0x35fc('0x21')]=_0x186a06[_0x35fc('0x21')]||'';this['originatecalleridname']=_0x186a06[_0x35fc('0x22')]||'';}module['exports']=Final;
\ No newline at end of file
+var _0x84e7=['scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid'];(function(_0x52064a,_0x13d634){var _0x2ceef4=function(_0x5c37c0){while(--_0x5c37c0){_0x52064a['push'](_0x52064a['shift']());}};_0x2ceef4(++_0x13d634);}(_0x84e7,0x122));var _0x784e=function(_0xf07fce,_0x10757c){_0xf07fce=_0xf07fce-0x0;var _0x31f124=_0x84e7[_0xf07fce];return _0x31f124;};'use strict';var util=require('util');var _=require(_0x784e('0x0'));var moment=require(_0x784e('0x1'));function getSeconds(_0x5861e2,_0x3548d2){var _0x2c1d96=moment(_0x5861e2)['milliseconds'](0x0);var _0x45e3ad=moment(_0x3548d2)[_0x784e('0x2')](0x0);return _0x2c1d96[_0x784e('0x3')](_0x45e3ad,_0x784e('0x4'));}function Final(_0x42993b){this[_0x784e('0x5')]=_0x42993b['uniqueid'];this[_0x784e('0x6')]=_0x42993b['scheduledat'];this[_0x784e('0x7')]=_0x42993b[_0x784e('0x7')];this['campaigntype']=_0x42993b[_0x784e('0x7')]===_0x784e('0x8')?_0x784e('0x9'):_0x42993b[_0x784e('0x7')];this['countbusyretry']=_0x42993b['countbusyretry'];this[_0x784e('0xa')]=_0x42993b[_0x784e('0xa')];this[_0x784e('0xb')]=_0x42993b[_0x784e('0xb')];this['countglobal']=_0x42993b[_0x784e('0xc')]+_0x42993b[_0x784e('0xa')]+_0x42993b[_0x784e('0xb')]+_0x42993b[_0x784e('0xd')]+_0x42993b[_0x784e('0xe')]+_0x42993b[_0x784e('0xf')]+_0x42993b['countmachineretry']+_0x42993b[_0x784e('0x10')];this['countnosuchnumberretry']=_0x42993b[_0x784e('0xd')];this[_0x784e('0xe')]=_0x42993b[_0x784e('0xe')];this[_0x784e('0xf')]=_0x42993b[_0x784e('0xf')];this[_0x784e('0x11')]=_0x42993b[_0x784e('0x11')];this[_0x784e('0x10')]=_0x42993b[_0x784e('0x10')];this['queue']=_0x42993b['queue'];this[_0x784e('0x12')]=_0x42993b[_0x784e('0x12')];this[_0x784e('0x13')]=_0x42993b[_0x784e('0x13')];this[_0x784e('0x14')]=_0x42993b[_0x784e('0x14')];this[_0x784e('0x15')]=_0x42993b['responsetime'];this[_0x784e('0x16')]=_0x42993b[_0x784e('0x15')];this[_0x784e('0x17')]=_0x42993b[_0x784e('0x17')]||0x0;this[_0x784e('0x18')]=_0x42993b[_0x784e('0x18')]||0x0;this[_0x784e('0x19')]=_0x42993b['talktime']||0x0;this['callback']=_0x42993b[_0x784e('0x1a')];this['callbackuniqueid']=_0x42993b[_0x784e('0x1b')];this[_0x784e('0x1c')]=_0x42993b['callbackat'];this['recallme']=_0x42993b[_0x784e('0x1d')];this[_0x784e('0x1e')]=_0x42993b[_0x784e('0x1e')];this[_0x784e('0x1f')]=_0x42993b['ListId'];this['UserId']=_0x42993b['UserId'];this[_0x784e('0x20')]=_0x42993b[_0x784e('0x20')];this['CampaignId']=_0x42993b[_0x784e('0x21')];this['originatecalleridnum']=_0x42993b[_0x784e('0x22')]||'';this['originatecalleridname']=_0x42993b[_0x784e('0x23')]||'';}module[_0x784e('0x24')]=Final;
\ No newline at end of file
index d2f926d..6c9a291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33d4=['cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','lodash','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','IVR','reason'];(function(_0x495e9f,_0x1b1d80){var _0xb249d2=function(_0x3db4e4){while(--_0x3db4e4){_0x495e9f['push'](_0x495e9f['shift']());}};_0xb249d2(++_0x1b1d80);}(_0x33d4,0x94));var _0x433d=function(_0x21177e,_0x53d48f){_0x21177e=_0x21177e-0x0;var _0x20e6bd=_0x33d4[_0x21177e];return _0x20e6bd;};'use strict';var util=require(_0x433d('0x0'));var _=require(_0x433d('0x1'));var moment=require('moment');function getSeconds(_0x9c9b5e,_0x52c6ac){var _0x148692=moment(_0x9c9b5e)[_0x433d('0x2')](0x0);var _0x834bfd=moment(_0x52c6ac)[_0x433d('0x2')](0x0);return _0x148692[_0x433d('0x3')](_0x834bfd,_0x433d('0x4'));}function Hangup(_0x249ad5,_0xb1a4c8){this[_0x433d('0x5')]=0x4;this['statedesc']=_0x433d('0x6');this[_0x433d('0x7')]=_0x249ad5['scheduledat'];this[_0x433d('0x8')]=_0x249ad5['type'];this[_0x433d('0x9')]=_0x249ad5[_0x433d('0x8')]===_0x433d('0xa')?_0x433d('0xb'):_0x249ad5['type'];this['countbusyretry']=_0x249ad5[_0x433d('0xc')];this[_0x433d('0xd')]=_0x249ad5[_0x433d('0xd')];this['countnoanswerretry']=_0x249ad5['countnoanswerretry'];this[_0x433d('0xe')]=_0x249ad5[_0x433d('0xc')]+_0x249ad5['countcongestionretry']+_0x249ad5[_0x433d('0xf')]+_0x249ad5[_0x433d('0x10')]+_0x249ad5[_0x433d('0x11')]+_0x249ad5[_0x433d('0x12')]+_0x249ad5[_0x433d('0x13')]+_0x249ad5['countagentrejectretry'];this[_0x433d('0x10')]=_0x249ad5[_0x433d('0x10')];this[_0x433d('0x11')]=_0x249ad5[_0x433d('0x11')];this[_0x433d('0x12')]=_0x249ad5[_0x433d('0x12')];this[_0x433d('0x13')]=_0x249ad5[_0x433d('0x13')];this[_0x433d('0x14')]=_0x249ad5[_0x433d('0x14')];this[_0x433d('0x15')]=_0xb1a4c8[_0x433d('0x15')];this[_0x433d('0x16')]=_0x249ad5[_0x433d('0x17')];this[_0x433d('0x18')]=_0x249ad5[_0x433d('0x19')];this[_0x433d('0x1a')]=_0x249ad5[_0x433d('0x1a')];this[_0x433d('0x1b')]=_0x249ad5['responsetime'];this[_0x433d('0x1c')]=moment()[_0x433d('0x1d')](_0x433d('0x1e'));this[_0x433d('0x1f')]=getSeconds(_0x249ad5[_0x433d('0x1b')],_0x249ad5['starttime']);this['holdtime']=0x0;this[_0x433d('0x20')]=getSeconds(this['endtime'],_0x249ad5[_0x433d('0x1b')]);this[_0x433d('0xb')]=_0x249ad5[_0x433d('0xb')];this[_0x433d('0x21')]=_0x433d('0x22');this[_0x433d('0x23')]=_0xb1a4c8[_0x433d('0x24')];this[_0x433d('0x25')]=_0x249ad5['callback'];this[_0x433d('0x26')]=_0x249ad5['callbackuniqueid'];this[_0x433d('0x27')]=_0x249ad5['callbackat'];this[_0x433d('0x28')]=_0x249ad5[_0x433d('0x28')];this[_0x433d('0x29')]=_0x249ad5[_0x433d('0x29')];this[_0x433d('0x2a')]=_0x249ad5['ListId'];this[_0x433d('0x2b')]=_0x249ad5['UserId'];this[_0x433d('0x2c')]=_0x249ad5[_0x433d('0x2c')];this['CampaignId']=_0x249ad5[_0x433d('0x2d')];}module['exports']=Hangup;
\ No newline at end of file
+var _0x0e1d=['callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','queue','membername','IVR','cause-txt','callback','callbackuniqueid'];(function(_0xd0f42d,_0x5beaab){var _0x26534c=function(_0x281ccb){while(--_0x281ccb){_0xd0f42d['push'](_0xd0f42d['shift']());}};_0x26534c(++_0x5beaab);}(_0x0e1d,0xb7));var _0xd0e1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0e1d[_0x321bb2];return _0x9c12ed;};'use strict';var util=require(_0xd0e1('0x0'));var _=require(_0xd0e1('0x1'));var moment=require(_0xd0e1('0x2'));function getSeconds(_0x4895e5,_0x35e02a){var _0x5c5f31=moment(_0x4895e5)['milliseconds'](0x0);var _0x1ae4ed=moment(_0x35e02a)[_0xd0e1('0x3')](0x0);return _0x5c5f31[_0xd0e1('0x4')](_0x1ae4ed,_0xd0e1('0x5'));}function Hangup(_0x3a090d,_0x423634){this['state']=0x4;this[_0xd0e1('0x6')]=_0xd0e1('0x7');this[_0xd0e1('0x8')]=_0x3a090d['scheduledat'];this['type']=_0x3a090d[_0xd0e1('0x9')];this['campaigntype']=_0x3a090d['type']==='outbound'?'queue':_0x3a090d['type'];this[_0xd0e1('0xa')]=_0x3a090d[_0xd0e1('0xa')];this['countcongestionretry']=_0x3a090d['countcongestionretry'];this[_0xd0e1('0xb')]=_0x3a090d['countnoanswerretry'];this[_0xd0e1('0xc')]=_0x3a090d[_0xd0e1('0xa')]+_0x3a090d[_0xd0e1('0xd')]+_0x3a090d['countnoanswerretry']+_0x3a090d[_0xd0e1('0xe')]+_0x3a090d['countdropretry']+_0x3a090d[_0xd0e1('0xf')]+_0x3a090d[_0xd0e1('0x10')]+_0x3a090d['countagentrejectretry'];this[_0xd0e1('0xe')]=_0x3a090d[_0xd0e1('0xe')];this[_0xd0e1('0x11')]=_0x3a090d[_0xd0e1('0x11')];this[_0xd0e1('0xf')]=_0x3a090d[_0xd0e1('0xf')];this[_0xd0e1('0x10')]=_0x3a090d[_0xd0e1('0x10')];this[_0xd0e1('0x12')]=_0x3a090d[_0xd0e1('0x12')];this[_0xd0e1('0x13')]=_0x423634[_0xd0e1('0x13')];this[_0xd0e1('0x14')]=_0x3a090d['name'];this[_0xd0e1('0x15')]=_0x3a090d[_0xd0e1('0x16')];this['starttime']=_0x3a090d[_0xd0e1('0x17')];this[_0xd0e1('0x18')]=_0x3a090d[_0xd0e1('0x18')];this[_0xd0e1('0x19')]=moment()[_0xd0e1('0x1a')](_0xd0e1('0x1b'));this[_0xd0e1('0x1c')]=getSeconds(_0x3a090d['responsetime'],_0x3a090d['starttime']);this[_0xd0e1('0x1d')]=0x0;this[_0xd0e1('0x1e')]=getSeconds(this[_0xd0e1('0x19')],_0x3a090d['responsetime']);this[_0xd0e1('0x1f')]=_0x3a090d['queue'];this[_0xd0e1('0x20')]=_0xd0e1('0x21');this['reason']=_0x423634[_0xd0e1('0x22')];this[_0xd0e1('0x23')]=_0x3a090d[_0xd0e1('0x23')];this['callbackuniqueid']=_0x3a090d[_0xd0e1('0x24')];this[_0xd0e1('0x25')]=_0x3a090d[_0xd0e1('0x25')];this['recallme']=_0x3a090d[_0xd0e1('0x26')];this['ContactId']=_0x3a090d['ContactId'];this[_0xd0e1('0x27')]=_0x3a090d[_0xd0e1('0x27')];this['UserId']=_0x3a090d[_0xd0e1('0x28')];this[_0xd0e1('0x29')]=_0x3a090d[_0xd0e1('0x29')];this[_0xd0e1('0x2a')]=_0x3a090d[_0xd0e1('0x2a')];}module[_0xd0e1('0x2b')]=Hangup;
\ No newline at end of file
index b106f52..775606c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f5c=['countmachineretry','countdropretry','countagentrejectretry','calleridname','name','starttime','responsetime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry'];(function(_0x306b53,_0x29d3f8){var _0x167f24=function(_0x30beae){while(--_0x30beae){_0x306b53['push'](_0x306b53['shift']());}};_0x167f24(++_0x29d3f8);}(_0x2f5c,0x1c4));var _0xc2f5=function(_0x1f7f86,_0x202d06){_0x1f7f86=_0x1f7f86-0x0;var _0x5f0e45=_0x2f5c[_0x1f7f86];return _0x5f0e45;};'use strict';var util=require(_0xc2f5('0x0'));var _=require(_0xc2f5('0x1'));var moment=require(_0xc2f5('0x2'));function getSeconds(_0x594918,_0x3653a4){var _0x291167=moment(_0x594918)['milliseconds'](0x0);var _0x16776b=moment(_0x3653a4)['milliseconds'](0x0);return _0x291167[_0xc2f5('0x3')](_0x16776b,_0xc2f5('0x4'));}function History(_0x44d3b9){this[_0xc2f5('0x5')]=_0x44d3b9[_0xc2f5('0x5')];this[_0xc2f5('0x6')]=_0x44d3b9[_0xc2f5('0x6')]||undefined;this[_0xc2f5('0x7')]=_0x44d3b9['type'];this[_0xc2f5('0x8')]=_0x44d3b9[_0xc2f5('0x7')]===_0xc2f5('0x9')?_0xc2f5('0xa'):_0x44d3b9['type'];this['countbusyretry']=_0x44d3b9['countbusyretry'];this[_0xc2f5('0xb')]=_0x44d3b9['countcongestionretry'];this['countnoanswerretry']=_0x44d3b9[_0xc2f5('0xc')];this[_0xc2f5('0xd')]=_0x44d3b9['countbusyretry']+_0x44d3b9[_0xc2f5('0xb')]+_0x44d3b9[_0xc2f5('0xc')]+_0x44d3b9[_0xc2f5('0xe')]+_0x44d3b9['countdropretry']+_0x44d3b9[_0xc2f5('0xf')]+_0x44d3b9[_0xc2f5('0x10')]+_0x44d3b9['countagentrejectretry'];this[_0xc2f5('0xe')]=_0x44d3b9['countnosuchnumberretry'];this[_0xc2f5('0x11')]=_0x44d3b9[_0xc2f5('0x11')];this[_0xc2f5('0xf')]=_0x44d3b9[_0xc2f5('0xf')];this['countmachineretry']=_0x44d3b9[_0xc2f5('0x10')];this[_0xc2f5('0x12')]=_0x44d3b9[_0xc2f5('0x12')];this[_0xc2f5('0xa')]=_0x44d3b9[_0xc2f5('0xa')];this[_0xc2f5('0x13')]=_0x44d3b9[_0xc2f5('0x14')];this['calleridnum']=_0x44d3b9['number'];this[_0xc2f5('0x15')]=_0x44d3b9[_0xc2f5('0x15')];this[_0xc2f5('0x16')]=_0x44d3b9[_0xc2f5('0x16')];this['endtime']=_0x44d3b9[_0xc2f5('0x16')];this['ringtime']=getSeconds(_0x44d3b9['responsetime'],_0x44d3b9['starttime']);this['holdtime']=0x0;this[_0xc2f5('0x17')]=0x0;this[_0xc2f5('0x18')]=_0x44d3b9[_0xc2f5('0x18')];this[_0xc2f5('0x19')]=_0x44d3b9[_0xc2f5('0x19')];this['callbackat']=_0x44d3b9[_0xc2f5('0x1a')];this[_0xc2f5('0x1b')]=_0x44d3b9['recallme'];this[_0xc2f5('0x1c')]=_0x44d3b9['ContactId'];this[_0xc2f5('0x1d')]=_0x44d3b9[_0xc2f5('0x1d')];this[_0xc2f5('0x1e')]=_0x44d3b9[_0xc2f5('0x1e')];this[_0xc2f5('0x1f')]=_0x44d3b9[_0xc2f5('0x1f')];this[_0xc2f5('0x20')]=_0x44d3b9[_0xc2f5('0x20')];this['originatecalleridnum']=_0x44d3b9[_0xc2f5('0x21')]||'';this[_0xc2f5('0x22')]=_0x44d3b9['originatecalleridname']||'';}module[_0xc2f5('0x23')]=History;
\ No newline at end of file
+var _0x0035=['VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId'];(function(_0xe57964,_0x36993a){var _0x3dde68=function(_0x1d6422){while(--_0x1d6422){_0xe57964['push'](_0xe57964['shift']());}};_0x3dde68(++_0x36993a);}(_0x0035,0x18a));var _0x5003=function(_0x2e5a8c,_0x35f4bf){_0x2e5a8c=_0x2e5a8c-0x0;var _0x5816ec=_0x0035[_0x2e5a8c];return _0x5816ec;};'use strict';var util=require(_0x5003('0x0'));var _=require(_0x5003('0x1'));var moment=require(_0x5003('0x2'));function getSeconds(_0x207905,_0x1232e0){var _0x58075c=moment(_0x207905)[_0x5003('0x3')](0x0);var _0x4680c7=moment(_0x1232e0)[_0x5003('0x3')](0x0);return _0x58075c[_0x5003('0x4')](_0x4680c7,_0x5003('0x5'));}function History(_0x5c27d4){this[_0x5003('0x6')]=_0x5c27d4[_0x5003('0x6')];this[_0x5003('0x7')]=_0x5c27d4['scheduledat']||undefined;this[_0x5003('0x8')]=_0x5c27d4[_0x5003('0x8')];this[_0x5003('0x9')]=_0x5c27d4[_0x5003('0x8')]===_0x5003('0xa')?_0x5003('0xb'):_0x5c27d4[_0x5003('0x8')];this['countbusyretry']=_0x5c27d4[_0x5003('0xc')];this[_0x5003('0xd')]=_0x5c27d4[_0x5003('0xd')];this[_0x5003('0xe')]=_0x5c27d4['countnoanswerretry'];this[_0x5003('0xf')]=_0x5c27d4[_0x5003('0xc')]+_0x5c27d4[_0x5003('0xd')]+_0x5c27d4[_0x5003('0xe')]+_0x5c27d4[_0x5003('0x10')]+_0x5c27d4[_0x5003('0x11')]+_0x5c27d4[_0x5003('0x12')]+_0x5c27d4[_0x5003('0x13')]+_0x5c27d4[_0x5003('0x14')];this[_0x5003('0x10')]=_0x5c27d4[_0x5003('0x10')];this[_0x5003('0x11')]=_0x5c27d4['countdropretry'];this['countabandonedretry']=_0x5c27d4['countabandonedretry'];this[_0x5003('0x13')]=_0x5c27d4[_0x5003('0x13')];this[_0x5003('0x14')]=_0x5c27d4[_0x5003('0x14')];this[_0x5003('0xb')]=_0x5c27d4['queue'];this[_0x5003('0x15')]=_0x5c27d4[_0x5003('0x16')];this[_0x5003('0x17')]=_0x5c27d4[_0x5003('0x18')];this[_0x5003('0x19')]=_0x5c27d4[_0x5003('0x19')];this[_0x5003('0x1a')]=_0x5c27d4[_0x5003('0x1a')];this['endtime']=_0x5c27d4[_0x5003('0x1a')];this['ringtime']=getSeconds(_0x5c27d4[_0x5003('0x1a')],_0x5c27d4[_0x5003('0x19')]);this[_0x5003('0x1b')]=0x0;this['talktime']=0x0;this[_0x5003('0x1c')]=_0x5c27d4[_0x5003('0x1c')];this[_0x5003('0x1d')]=_0x5c27d4[_0x5003('0x1d')];this[_0x5003('0x1e')]=_0x5c27d4[_0x5003('0x1e')];this[_0x5003('0x1f')]=_0x5c27d4[_0x5003('0x1f')];this[_0x5003('0x20')]=_0x5c27d4[_0x5003('0x20')];this[_0x5003('0x21')]=_0x5c27d4[_0x5003('0x21')];this['UserId']=_0x5c27d4[_0x5003('0x22')];this['VoiceQueueId']=_0x5c27d4[_0x5003('0x23')];this[_0x5003('0x24')]=_0x5c27d4[_0x5003('0x24')];this['originatecalleridnum']=_0x5c27d4['originatecalleridnum']||'';this[_0x5003('0x25')]=_0x5c27d4[_0x5003('0x25')]||'';}module[_0x5003('0x26')]=History;
\ No newline at end of file
index 37f2fa3..5ec9d98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa75b=['state','statedesc','starttime','[uniqueid]','clearZombieChannels','actions','[actions]','Action','status','channel','catch','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','merge','pick','ContactId','UserId','VoiceQueueId','[emptyContact][createHistory]','Success','isTrunkReachable','active','SIP/%s','reachable','unmonitored','syncVarSet','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countglobal','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','reason19\x20machine....','countmachineretry','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','ListId','CampaignId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','[syncAgentComplete][createHistory][0]','countcongestionretry','stateGlobal','minutes','YYYY-MM-DD\x20HH:mm:ss','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','outboundUnknownCallsDay','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','agiafterat','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','actionid','locked','paused','stateinterface','queueBooked','idHopper','queueStatusComplete','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','[booked][RR]','Agent:\x20','unlockRR','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','length','push','iftime\x20%s,%s','interval','content','indexOf','command','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','handleIvr','dialTimezone','checkDialMethod','[syncQueueSummary]','dialGlobalInterval','launchHandleIvr','[syncCampaigns]','pow','replace','random','match','voiceQueue\x20is\x20undefine','Contact','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialCutDigit','phone','substring','trim','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','reason','NoSuchNumber','custom:agentnosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','noanswer','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','busyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','Agent','outboundReCallsDay','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','RUNNING','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\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','[busyFactor]','m\x20=\x20','exports','util','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','syncQueueSummary','defaults','localhost','socket.io-emitter','redis','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','Interval','message','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','callerid','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\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','erlangBusyFactor','seconds','clearing\x20variable\x20start\x20predictive','handlePredictive','ivr','string','\x22%s\x22\x20<%s>','error','inspect','stack','undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','[getContactDialer2][Empty]','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20'];(function(_0x2b1f79,_0x8cfab1){var _0x40079e=function(_0x94ddef){while(--_0x94ddef){_0x2b1f79['push'](_0x2b1f79['shift']());}};_0x40079e(++_0x8cfab1);}(_0xa75b,0x170));var _0xba75=function(_0x2be580,_0x2b734e){_0x2be580=_0x2be580-0x0;var _0x4ef940=_0xa75b[_0x2be580];return _0x4ef940;};'use strict';var util=require(_0xba75('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0xba75('0x1'));var moment=require(_0xba75('0x2'));var rr=require('rr');var md5=require(_0xba75('0x3'));var Redis=require(_0xba75('0x4'));var ut=require(_0xba75('0x5'));var config=require(_0xba75('0x6'));var logger=require(_0xba75('0x7'))(_0xba75('0x8'));var loggerBooked=require(_0xba75('0x7'))(_0xba75('0x9'));var loggerPredictive=require(_0xba75('0x7'))(_0xba75('0xa'));var loggerPredictiveCalls=require(_0xba75('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0xba75('0xb'));var ami=require('../ami');config['redis']=_[_0xba75('0xc')](config['redis'],{'host':_0xba75('0xd'),'port':0x18eb});var io=require(_0xba75('0xe'))(new Redis(config[_0xba75('0xf')]));var cmHopper=require(_0xba75('0x10'));var cmHopperHistory=require(_0xba75('0x11'));var cmHopperBlack=require(_0xba75('0x12'));var voiceQueueRt=require(_0xba75('0x13'));var Action=require(_0xba75('0x14'));var History=require(_0xba75('0x15'));var Final=require(_0xba75('0x16'));var AgentComplete=require(_0xba75('0x17'));var QueueCallerAbandon=require(_0xba75('0x18'));var Hangup=require('./hangup');var ipAgi=process['env'][_0xba75('0x19')]||'127.0.0.1';var strategy={'rrmemory':_0xba75('0x1a'),'roundrobin':_0xba75('0x1b')};var Sequence=function(){};Sequence[_0xba75('0x1c')][_0xba75('0x1d')]=function(_0x4c4a0b){this[_0xba75('0x1e')]=this[_0xba75('0x1e')]?this[_0xba75('0x1e')][_0xba75('0x1f')](_0x4c4a0b):_0x4c4a0b();};function Dialer(_0x41c9e5,_0x51112b){this[_0xba75('0x20')]=new Sequence();this[_0xba75('0x21')]=_0x51112b;this[_0xba75('0x22')]=_0x41c9e5['voiceQueues'];this[_0xba75('0x23')]=_0x41c9e5[_0xba75('0x23')];this[_0xba75('0x24')]=_0x41c9e5[_0xba75('0x24')];this[_0xba75('0x25')]=_0x41c9e5[_0xba75('0x25')];this['maxNumberOriginate']=config[_0xba75('0x26')]||0x2;this[_0xba75('0x27')]={};this['actions']={};this['contactsId']={};this[_0xba75('0x28')]={};this[_0xba75('0x29')]={};this['startPredictive']={};this['startProgressive']={};this[_0xba75('0x2a')]={};this['queueBooked']={};this[_0xba75('0x2b')]={};ami['on'](_0xba75('0x2c'),this[_0xba75('0x2d')]['bind'](this));ami['on'](_0xba75('0x2e'),this[_0xba75('0x2f')][_0xba75('0x30')](this));ami['on'](_0xba75('0x31'),this[_0xba75('0x32')][_0xba75('0x30')](this));ami['on']('agentcomplete',this[_0xba75('0x33')][_0xba75('0x30')](this));ami['on'](_0xba75('0x34'),this[_0xba75('0xb')][_0xba75('0x30')](this));ami['on'](_0xba75('0x35'),this[_0xba75('0x36')][_0xba75('0x30')](this));ami['on'](_0xba75('0x37'),this[_0xba75('0x38')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0xba75('0x30')](this));ami['on']('queuemember',this[_0xba75('0x39')]['bind'](this));ami['on'](_0xba75('0x3a'),this[_0xba75('0x3b')][_0xba75('0x30')](this));this['loopCampaigns']();this[_0xba75('0x3c')]();}function isNotNull(_0x62cf49){return _0x62cf49!==null&&!_[_0xba75('0x3d')](_0x62cf49);}function checkIsLoggedIn(_0x2808f0,_0x5d9f78){return function(){if(_0x5d9f78<=0x0){_0x2808f0['message']=_0xba75('0x3e');throw _0x2808f0['name']+_0xba75('0x3f');}};}function isActive(_0x3061ac){return _0x3061ac;}function checkIsActive(_0x325bbd,_0x32166a){return function(){if(!isActive(_0x32166a)){_0x325bbd['message']=_0xba75('0x40');throw _0x325bbd[_0xba75('0x41')]+'\x20NOT\x20Active';}};}function checkInterval(_0x33a732){return function(){if(!isNotNull(_0x33a732[_0xba75('0x42')])){_0x33a732[_0xba75('0x43')]=_0xba75('0x44');throw _0x33a732['name']+_0xba75('0x45');}if(!isNotNull(_0x33a732[_0xba75('0x42')]['Intervals'])){_0x33a732[_0xba75('0x43')]=_0xba75('0x44');throw _0x33a732[_0xba75('0x41')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xba75('0x46')](_0x33a732[_0xba75('0x42')][_0xba75('0x47')]))){_0x33a732[_0xba75('0x43')]=_0xba75('0x44');throw _0x33a732[_0xba75('0x41')]+_0xba75('0x45');}};}function msgResponse(_0x4c9fb2,_0x55e9ed,_0x80e933){return{'action':_0x4c9fb2,'response':_0x55e9ed,'message':_0x80e933,'stack':_0x80e933};}function myreject(_0x39ab01){return function(_0x169e2a){return _0x39ab01(msgResponse('[ifTime][Action]',_0xba75('0x48'),JSON[_0xba75('0x49')](_0x169e2a)));};}function getSeconds(_0x5a7b1e,_0x49d0c3){var _0x2cab07=moment(_0x5a7b1e)[_0xba75('0x4a')](0x0);var _0x379c78=moment(_0x49d0c3)[_0xba75('0x4a')](0x0);return _0x2cab07[_0xba75('0x4b')](_0x379c78,'seconds');}function emit(_0x491953,_0x39c8c6,_0x22b335){io['to'](_0x491953)[_0xba75('0x4c')](_0x39c8c6,_0x22b335);}function emitVoiceQueueSummary(_0x68526f){if(_0x68526f[_0xba75('0x4d')]===_0xba75('0x4e')){var _0x987cc1={'id':_0x68526f['id'],'name':_0x68526f['name'],'strategy':_0x68526f[_0xba75('0x4f')],'answered':_0x68526f[_0xba75('0x50')],'available':_0x68526f['available'],'loggedIn':_0x68526f[_0xba75('0x51')],'pTalking':_0x68526f[_0xba75('0x52')],'sumBillable':_0x68526f[_0xba75('0x53')],'sumDuration':_0x68526f[_0xba75('0x54')],'sumHoldTime':_0x68526f[_0xba75('0x55')]||0x0,'talking':_0x68526f[_0xba75('0x56')],'total':_0x68526f[_0xba75('0x57')],'type':_0x68526f['type'],'unmanaged':_0x68526f[_0xba75('0x58')],'abandoned':_0x68526f['abandoned'],'waiting':_0x68526f[_0xba75('0x59')],'loggedInDb':_0x68526f['loggedInDb'],'dialActive':_0x68526f[_0xba75('0x5a')],'dialMethod':_0x68526f[_0xba75('0x5b')],'dialOriginateCallerIdName':_0x68526f[_0xba75('0x5c')],'dialOriginateCallerIdNumber':_0x68526f[_0xba75('0x5d')],'dialOriginateTimeout':_0x68526f[_0xba75('0x5e')],'dialPrefix':_0x68526f[_0xba75('0x5f')],'outboundAnswerAgiCallsDay':_0x68526f[_0xba75('0x60')],'outboundAnswerCallsDay':_0x68526f[_0xba75('0x61')],'outboundBlacklistCallsDay':_0x68526f[_0xba75('0x62')],'outboundBusyCallsDay':_0x68526f['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x68526f[_0xba75('0x63')],'outboundDropCallsDayACS':_0x68526f[_0xba75('0x64')],'outboundDropCallsDayCallersExit':_0x68526f['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x68526f[_0xba75('0x65')],'outboundNoAnswerCallsDay':_0x68526f[_0xba75('0x66')],'outboundNoSuchCallsDay':_0x68526f[_0xba75('0x67')],'outboundOriginateFailureCallsDay':_0x68526f['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x68526f['outboundReCallsDay'],'outboundRejectCallsDay':_0x68526f['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x68526f['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x68526f[_0xba75('0x68')],'predictiveIntervalAvgHoldtime':_0x68526f['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x68526f[_0xba75('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x68526f[_0xba75('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x68526f[_0xba75('0x6b')],'predictiveIntervalErlangCalls':_0x68526f[_0xba75('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x68526f[_0xba75('0x6d')],'predictiveIntervalHitRate':_0x68526f['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x68526f['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x68526f[_0xba75('0x6e')],'predictiveIntervalAvailable':_0x68526f['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x68526f[_0xba75('0x6f')],'message':_0x68526f['message'],'originated':_0x68526f[_0xba75('0x70')],'erlangCalls':_0x68526f[_0xba75('0x71')],'erlangCallToSecond':_0x68526f[_0xba75('0x72')],'erlangAbandonmentRate':_0x68526f[_0xba75('0x73')],'erlangBusyFactor':_0x68526f['erlangBusyFactor'],'startPredictive':_0x68526f[_0xba75('0x74')],'startProgressive':_0x68526f[_0xba75('0x75')]};if(_0x68526f[_0xba75('0x76')]){_0x987cc1[_0xba75('0x76')]={'id':_0x68526f[_0xba75('0x76')]['id'],'name':_0x68526f[_0xba75('0x76')][_0xba75('0x41')],'active':_0x68526f[_0xba75('0x76')]['active'],'callerid':_0x68526f[_0xba75('0x76')][_0xba75('0x77')]};}if(_0x68526f[_0xba75('0x42')]){_0x987cc1[_0xba75('0x42')]={'id':_0x68526f[_0xba75('0x42')]['id'],'name':_0x68526f['Interval'][_0xba75('0x41')]};}var _0x25ae33=md5(JSON[_0xba75('0x49')](_0x987cc1));if(_0x68526f[_0xba75('0x3')]!==_0x25ae33){_0x68526f[_0xba75('0x3')]=_0x25ae33;emit(util[_0xba75('0x78')](_0xba75('0x79'),_0x987cc1['name']),_0xba75('0x7a'),_0x987cc1);}}}function emitCampaignSummary(_0x888e18){if(_0x888e18[_0xba75('0x4d')]==='ivr'){emit(util[_0xba75('0x78')](_0xba75('0x7b'),_0x888e18['name']),'campaign:save',_0x888e18);}}function checkGetDataPredictive(_0x2d7f85){if(isNotNull(_0x2d7f85)&&!_['isEmpty'](_0x2d7f85)){loggerPredictive['info'](_0xba75('0x7c'));loggerPredictive['info'](_0xba75('0x7d'),_0x2d7f85[_0xba75('0x6f')]);loggerPredictive[_0xba75('0x7e')](_0xba75('0x7f'),_0x2d7f85[_0xba75('0x68')]);loggerPredictive['info'](_0xba75('0x80'),_0x2d7f85[_0xba75('0x6b')]);loggerPredictive['info'](_0xba75('0x81'),_0x2d7f85[_0xba75('0x6a')]);loggerPredictive[_0xba75('0x7e')](_0xba75('0x82'),_0x2d7f85[_0xba75('0x83')]);loggerPredictive['info'](_0xba75('0x84'),_0x2d7f85[_0xba75('0x69')]);loggerPredictive['info'](_0xba75('0x85'));if(_0x2d7f85[_0xba75('0x6f')]>0x0){if(!_[_0xba75('0x3d')](_0x2d7f85[_0xba75('0x69')])&&_0x2d7f85[_0xba75('0x69')]>0x0){return!![];}loggerPredictive[_0xba75('0x7e')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0xba75('0x3d')](_0x2d7f85[_0xba75('0x83')])&&_0x2d7f85[_0xba75('0x83')]>0x0){return!![];}loggerPredictive[_0xba75('0x7e')](_0xba75('0x86'));}else{loggerPredictive[_0xba75('0x7e')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x4cda26){return function(_0x200be0){loggerPredictive[_0xba75('0x7e')](_0xba75('0x87'));loggerPredictive[_0xba75('0x7e')](_0xba75('0x88'),_0x200be0[_0xba75('0x71')]);loggerPredictive[_0xba75('0x7e')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x200be0[_0xba75('0x72')]);loggerPredictive[_0xba75('0x7e')](_0xba75('0x89'),_0x200be0[_0xba75('0x73')]);loggerPredictive['info'](_0xba75('0x8a'),_0x200be0[_0xba75('0x8b')]);loggerPredictive['info'](_0xba75('0x89'),_0x200be0['erlangAbandonmentRate']);loggerPredictive[_0xba75('0x7e')](_0xba75('0x85'));_['merge'](_0x4cda26,_0x200be0);};}function getDiff(_0x276757){var _0x3d5ff9=moment()['milliseconds'](0x0);var _0x59da3c=moment(_0x276757)[_0xba75('0x4a')](0x0);return _0x3d5ff9['diff'](_0x59da3c,_0xba75('0x8c'));}function ifInterval(_0x5d5ef5,_0x2225fb){if(_[_0xba75('0x3d')](_0x2225fb)){return![];}return getDiff(_0x2225fb)<_0x5d5ef5*0x3c;}function freeVariablesPredictive(_0x46c43c){if(isNotNull(_0x46c43c)){if(!_[_0xba75('0x3d')](_0x46c43c[_0xba75('0x75')])){_0x46c43c['startProgressive']=undefined;loggerPredictive[_0xba75('0x7e')](_0x46c43c[_0xba75('0x41')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xba75('0x3d')](_0x46c43c[_0xba75('0x74')])){_0x46c43c[_0xba75('0x74')]=undefined;loggerPredictive[_0xba75('0x7e')](_0x46c43c[_0xba75('0x41')],_0xba75('0x8d'));}if(!_[_0xba75('0x3d')](_0x46c43c[_0xba75('0x8e')])){clearInterval(_0x46c43c[_0xba75('0x8e')]);_0x46c43c[_0xba75('0x8e')]=undefined;loggerPredictive[_0xba75('0x7e')](_0x46c43c[_0xba75('0x41')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x5c2a2a,_0x46c05c){if(_0x46c05c===0x0){return 0x0;}var _0x31e3b6=0x1;for(var _0x46f3ed=0x1;_0x46f3ed<=_0x46c05c;_0x46f3ed+=0x1){_0x31e3b6=0x1+_0x31e3b6*_0x46f3ed/_0x5c2a2a;}return 0x1/_0x31e3b6;}function isVoiceQueueOutbound(_0x441462){return _0x441462===_0xba75('0x4e');}function isNotPreview(_0x33dda1){return _0x33dda1!==_0xba75('0x21');}function isCampaignIvr(_0x115798){return _0x115798===_0xba75('0x8f');}function getCallerId(_0x259f40,_0x2b686e,_0x5dace4){if(!_[_0xba75('0x3d')](_0x5dace4)&&typeof _0x5dace4==='string'&&!_[_0xba75('0x46')](_0x5dace4)){if(!_[_0xba75('0x3d')](_0x2b686e)&&typeof _0x2b686e===_0xba75('0x90')&&!_[_0xba75('0x46')](_0x2b686e)){return util[_0xba75('0x78')](_0xba75('0x91'),_0x2b686e,_0x5dace4);}return util['format'](_0xba75('0x91'),_0x5dace4,_0x5dace4);}if(!_['isUndefined'](_0x259f40)&&typeof _0x259f40===_0xba75('0x90')&&!_[_0xba75('0x46')](_0x259f40)){return _0x259f40;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x5127ba,_0x168b55){return function(_0x31b19d){freeVariablesPredictive(_0x168b55);emitVoiceQueueSummary(_0x168b55);emitCampaignSummary(_0x168b55);loggerSyncQueueSummary[_0xba75('0x92')](_0x5127ba,util[_0xba75('0x93')](_0x31b19d,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x7cf469,_0xdac989){return function(_0x57f65e){loggerPredictive[_0xba75('0x92')](_0xdac989[_0xba75('0x41')],_0x7cf469);loggerPredictive['error'](_0x57f65e[_0xba75('0x94')]);freeVariablesPredictive(_0xdac989);};}function loggerCatch(_0x450211){return function(_0x281499){logger[_0xba75('0x92')](_0x450211,util[_0xba75('0x93')](_0x281499,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x47f47b){return _0x47f47b&&!_[_0xba75('0x3d')](_0x47f47b)&&_0x47f47b['length']>0x0;}function decremetOriginate(_0xaaeef1){if(!_[_0xba75('0x3d')](_0xaaeef1)&&_0xaaeef1!==null){if(typeof _0xaaeef1[_0xba75('0x70')]!==_0xba75('0x95')){if(_0xaaeef1[_0xba75('0x70')]>0x0){_0xaaeef1[_0xba75('0x70')]-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xba75('0x92')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x42aa26,_0x4707ef,_0x5187a0){if(_0x4707ef>_0x5187a0){for(var _0x123c4d=0x0;_0x123c4d<_0x4707ef-_0x5187a0;_0x123c4d+=0x1){decremetOriginate(_0x42aa26);}}}function loggerGetContactDialer(_0x178cb3,_0x859f12,_0x4c6aa8){return function(_0x5456d1){checkContactLowerLimitOriginate(_0x859f12,_0x4c6aa8,0x0);logger['error'](_0x178cb3,util['inspect'](_0x5456d1,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x58e3bb){return function(_0xce1b93){if(isNotNull(_0xce1b93)&&isNotNull(_0xce1b93[0x0])){if(_0xce1b93[0x0]['contactsRescheduled']>0x0){_0x58e3bb[_0xba75('0x43')]=_0xba75('0x96');logger[_0xba75('0x7e')](_0xba75('0x97')+_0x58e3bb[_0xba75('0x41')],_0xce1b93[0x0][_0xba75('0x98')],_0xba75('0x99'));}else{_0x58e3bb['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0xba75('0x7e')](_0xba75('0x9a')+_0x58e3bb['name']);}}};}function notSendMessagesQueue(_0x489233){if(_0x489233['sendMessageOneNotActive']){freeVariablesPredictive(_0x489233);if(_0x489233[_0xba75('0x70')]===0x0&&_0x489233[_0xba75('0x56')]===0x0&&_0x489233['waiting']===0x0&&(_0x489233[_0xba75('0x52')]||0x0)===0x0){_0x489233['sendMessageOneNotActive']=![];_0x489233[_0xba75('0x9b')]=0x0;_0x489233[_0xba75('0x43')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xba75('0x92')](_0xba75('0x9c'),_0x489233[_0xba75('0x41')],_0xba75('0x9d'));}else{_0x489233[_0xba75('0x43')]=_0xba75('0x9e');loggerSyncQueueSummary[_0xba75('0x92')](_0xba75('0x9c'),_0x489233['name'],_0xba75('0x9f'));}emitVoiceQueueSummary(_0x489233);}}function notSendMessagesCampaign(_0x23faa7){if(_0x23faa7['sendMessageOneNotActive']){if(_0x23faa7['originated']===0x0){_0x23faa7['sendMessageOneNotActive']=![];_0x23faa7[_0xba75('0x43')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xba75('0x92')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x23faa7[_0xba75('0x41')],'is\x20not\x20active');}else{_0x23faa7['message']=_0xba75('0x9e');loggerSyncQueueSummary['error'](_0xba75('0xa0'),_0x23faa7['name'],'is\x20disactive');}emitCampaignSummary(_0x23faa7);}}function createObjHistory(_0x1b4c76,_0x4aa672,_0x3edf13,_0x58d618,_0x2087d4){_0x1b4c76[_0xba75('0x43')]=_0x3edf13;var _0x21fa25=new Action(_0x1b4c76,_0x4aa672);var _0x595962=new History(_0x21fa25);_0x595962[_0xba75('0xa1')]=_0x58d618;_0x595962[_0xba75('0xa2')]=_0x2087d4;_0x595962['endtime']=_0x21fa25[_0xba75('0xa3')];return _0x595962;}Dialer['prototype']['loopClearZombieChannels']=function(){var _0x3791c4=this;setInterval(function(){_0x3791c4['clearZombieChannels'](_0x3791c4[_0xba75('0x28')],_0xba75('0xa4'));_0x3791c4[_0xba75('0xa5')](_0x3791c4[_0xba75('0xa6')],_0xba75('0xa7'));},0x32c8);};Dialer[_0xba75('0x1c')][_0xba75('0xa5')]=function(_0x3c14e2,_0x3094c7){var _0x2babfe=this;for(var _0x28171f in _0x3c14e2){if(typeof _0x3c14e2[_0x28171f]!=='undefined'){this['sequence'][_0xba75('0x1d')](function(){if(!_['isNil'](_0x3c14e2[_0x28171f])){return ami[_0xba75('0xa8')]({'action':_0xba75('0xa9'),'channel':_0x3c14e2[_0x28171f][_0xba75('0xaa')]})[_0xba75('0xab')](function(_0x1713ec){if(_0x1713ec[_0xba75('0x43')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3c14e2[_0x28171f]&&_0x3c14e2[_0x28171f]['type']!==_0xba75('0x8f')){_0x2babfe['updateOriginated'](_0x2babfe[_0xba75('0x22')][_0x3c14e2[_0x28171f][_0xba75('0xac')]]);logger[_0xba75('0x92')](_0xba75('0xad'),_0x3094c7,_0x28171f,_0x3c14e2[_0x28171f][_0xba75('0xac')]);delete _0x3c14e2[_0x28171f];}if(_0x3c14e2[_0x28171f]&&_0x3c14e2[_0x28171f]['type']===_0xba75('0x8f')){_0x2babfe[_0xba75('0xae')](_0x2babfe[_0xba75('0x23')][_0x3c14e2[_0x28171f][_0xba75('0xac')]]);logger[_0xba75('0x92')](_0xba75('0xaf'),_0x3094c7,_0x28171f,_0x3c14e2[_0x28171f][_0xba75('0xac')]);delete _0x3c14e2[_0x28171f];}},0x2328);}});}});}}};Dialer[_0xba75('0x1c')][_0xba75('0xb0')]=function(_0x4d0a19){return BPromise[_0xba75('0xb1')]()[_0xba75('0xb2')](cmHopper[_0xba75('0xb0')](_0x4d0a19))[_0xba75('0xab')](loggerCatch(_0xba75('0xb3')));};Dialer[_0xba75('0x1c')][_0xba75('0xb4')]=function(_0x423d44){return BPromise['resolve']()[_0xba75('0xb2')](cmHopperBlack[_0xba75('0xb4')](_0x423d44))[_0xba75('0xab')](loggerCatch(_0xba75('0xb5')));};Dialer[_0xba75('0x1c')][_0xba75('0xb6')]=function(_0x4f9f48){return BPromise[_0xba75('0xb1')]()['then'](cmHopperBlack[_0xba75('0xb6')](_0x4f9f48))['catch'](loggerCatch(_0xba75('0xb7')));};Dialer[_0xba75('0x1c')][_0xba75('0xb8')]=function(_0x4b9e30){return BPromise['resolve']()['then'](cmHopperHistory[_0xba75('0xb9')](_0x4b9e30))[_0xba75('0xab')](loggerCatch(_0xba75('0xba')));};Dialer[_0xba75('0x1c')]['rescheduleContact']=function(_0x43821d){return BPromise[_0xba75('0xb1')]()[_0xba75('0xb2')](cmHopper[_0xba75('0xbb')](_0x43821d))[_0xba75('0xab')](loggerCatch(_0xba75('0xbc')));};Dialer[_0xba75('0x1c')][_0xba75('0xbd')]=function(_0x425c79,_0x30452b,_0x479646){return BPromise[_0xba75('0xb1')]()[_0xba75('0xb2')](cmHopper[_0xba75('0xbd')](_0x425c79,_0x30452b,_0x479646))['catch'](loggerCatch(_0xba75('0xbe')));};Dialer[_0xba75('0x1c')][_0xba75('0xbf')]=function(_0x3b1333,_0x5ed316,_0x40d09f,_0x46ef3f,_0x5187a4){return BPromise[_0xba75('0xb1')]()[_0xba75('0xb2')](cmHopper[_0xba75('0xbf')](_0x3b1333,_0x5ed316,_0x40d09f,_0x46ef3f))[_0xba75('0xab')](function(_0x362e88){_0x5187a4['temp']-=_0x40d09f;_0x5187a4['temp']=_0x5187a4[_0xba75('0xc0')]>0x0?_0x5187a4['temp']:0x0;loggerCatch(_0xba75('0xc1'))(_0x362e88);});};Dialer[_0xba75('0x1c')][_0xba75('0xc2')]=function(_0x52f188,_0x3057a5,_0x1cb703,_0x2c87c7){return BPromise[_0xba75('0xb1')]()[_0xba75('0xb2')](cmHopper['getContactDialerIvr'](_0x52f188,_0x3057a5,_0x1cb703))['catch'](function(_0x563564){_0x2c87c7[_0xba75('0xc0')]-=_0x3057a5;_0x2c87c7['temp']=_0x2c87c7[_0xba75('0xc0')]>0x0?_0x2c87c7['temp']:0x0;loggerCatch(_0xba75('0xc3'))(_0x563564);});};Dialer['prototype'][_0xba75('0xc4')]=function(_0x224290){return BPromise[_0xba75('0xb1')]()[_0xba75('0xb2')](voiceQueueRt[_0xba75('0xc4')](_0x224290))[_0xba75('0xab')](loggerCatch(_0xba75('0xc5')));};Dialer[_0xba75('0x1c')]['moveContactManagedDialer']=function(_0x25d9fa){return BPromise[_0xba75('0xb1')]()[_0xba75('0xb2')](cmHopper[_0xba75('0xc6')](_0x25d9fa))[_0xba75('0xab')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xba75('0x1c')][_0xba75('0xc7')]=function(_0x321bff){return BPromise['resolve']()[_0xba75('0xb2')](cmHopperHistory['createHistory'](_0x321bff))['catch'](loggerCatch(_0xba75('0xc8')));};Dialer[_0xba75('0x1c')][_0xba75('0xae')]=function(_0x3ff88c){if(!_[_0xba75('0x3d')](_0x3ff88c)&&_0x3ff88c!==null){if(typeof _0x3ff88c[_0xba75('0x70')]!==_0xba75('0x95')){if(_0x3ff88c['originated']>0x0){_0x3ff88c[_0xba75('0x70')]-=0x1;}else{logger['error'](_0xba75('0xc9'));}}}else{logger[_0xba75('0x92')](_0xba75('0xca'));}};Dialer[_0xba75('0x1c')][_0xba75('0xcb')]=function(_0xf232ed,_0x52da77){var _0x9d937f=this;return function(_0x110537){_0x9d937f[_0xba75('0xae')](_0x52da77);logger['error'](_0xf232ed,util[_0xba75('0x93')](_0x110537,{'showHidden':![],'depth':null}));};};Dialer[_0xba75('0x1c')][_0xba75('0xcc')]=function(_0x2f570d,_0x219b24,_0x2d4ab2){var _0x2a39f7={'state':0x19,'statedesc':_0xba75('0xcd')};this[_0xba75('0xae')](_0x219b24);this[_0xba75('0xce')](_[_0xba75('0xcf')](_0x2a39f7,_[_0xba75('0xd0')](_0x2d4ab2,[_0xba75('0xd1'),'ListId',_0xba75('0xd2'),_0xba75('0xd3'),'CampaignId'])),_0xba75('0xd4'),'[emptyContact]');logger[_0xba75('0x92')](_0x2f570d);};Dialer[_0xba75('0x1c')]['isSuccess']=function(_0x3765a0){return _0x3765a0===_0xba75('0xd5');};Dialer[_0xba75('0x1c')][_0xba75('0xd6')]=function(_0x47e8a2){return!_[_0xba75('0x3d')](_0x47e8a2)&&_0x47e8a2&&!_[_0xba75('0x3d')](_0x47e8a2['name'])&&!_['isUndefined'](_0x47e8a2['active'])&&_0x47e8a2[_0xba75('0xd7')]&&(this[_0xba75('0x25')][util['format'](_0xba75('0xd8'),_0x47e8a2[_0xba75('0x41')])][_0xba75('0xa9')]===_0xba75('0xd9')||this['trunks'][util['format'](_0xba75('0xd8'),_0x47e8a2['name'])][_0xba75('0xa9')]===_0xba75('0xda'));};Dialer[_0xba75('0x1c')]['saveInDb']=function(_0xf96795,_0x527747,_0x1ba635){this[_0xba75('0xc7')](_0xf96795)[_0xba75('0xab')](loggerCatch(_0x527747));this[_0xba75('0xc6')](_0xf96795)[_0xba75('0xab')](loggerCatch(_0x1ba635));};Dialer[_0xba75('0x1c')][_0xba75('0xdb')]=function(_0x39f3bf){var _0x147b18=this[_0xba75('0x28')][_0x39f3bf[_0xba75('0xdc')]];var _0x1cf736;if(!_[_0xba75('0xdd')](_0x39f3bf)&&!_[_0xba75('0xdd')](_0x39f3bf[_0xba75('0xde')])&&!_[_0xba75('0xdd')](_0x39f3bf[_0xba75('0xde')][_0xba75('0xdf')])&&_0x39f3bf[_0xba75('0xe0')]===_0xba75('0xe1')&&_0x147b18){if(_0x147b18['type']!==_0xba75('0x8f')&&this[_0xba75('0x22')][_0x147b18[_0xba75('0xac')]][_0xba75('0xe2')]&&_0x39f3bf[_0xba75('0xe3')]===_0xba75('0xe4')){delete this['uniqueId'][_0x39f3bf[_0xba75('0xdc')]];this[_0xba75('0xae')](this[_0xba75('0x22')][_0x147b18[_0xba75('0xac')]]);this[_0xba75('0x22')][_0x147b18['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xba75('0x22')][_0x147b18[_0xba75('0xac')]][_0xba75('0x60')]+=0x1;_0x1cf736=new Hangup(_0x147b18,_0x39f3bf);_0x1cf736[_0xba75('0xa1')]=0x12;_0x1cf736[_0xba75('0xa2')]=_0xba75('0xe5');_0x1cf736[_0xba75('0xe6')]=_0xba75('0xe7');ami[_0xba75('0x4c')](_0xba75('0xe8'),ut[_0xba75('0xe9')](_0x1cf736,_0xba75('0xea')));this['saveInDb'](_0x1cf736,_0xba75('0xeb'),_0xba75('0xec'));}if(_0x147b18['type']!==_0xba75('0x8f')&&this['voiceQueues'][_0x147b18[_0xba75('0xac')]][_0xba75('0xe2')]&&_0x39f3bf[_0xba75('0xe3')]===_0xba75('0xed')){var _0x4b339b=this;return new BPromise(function(_0xc23785,_0x511e49){delete _0x4b339b[_0xba75('0x28')][_0x39f3bf[_0xba75('0xdc')]];_0x4b339b['updateOriginated'](_0x4b339b[_0xba75('0x22')][_0x147b18['queue']]);_0x4b339b[_0xba75('0x22')][_0x147b18[_0xba75('0xac')]]['outboundAnswerCallsDay']+=0x1;_0x4b339b['voiceQueues'][_0x147b18[_0xba75('0xac')]][_0xba75('0x60')]+=0x1;var _0x3164f9=_0x4b339b[_0xba75('0x22')][_0x147b18[_0xba75('0xac')]];var _0x5132e1=new Hangup(_0x147b18,_0x39f3bf);_0x5132e1[_0xba75('0xa1')]=0x13;_0x5132e1[_0xba75('0xa2')]=_0xba75('0xee');_0x5132e1[_0xba75('0xe6')]=_0xba75('0xe7');_0x5132e1['countmachineretry']+=0x1;_0x5132e1[_0xba75('0xef')]+=0x1;_0x5132e1['amd']=!![];ami[_0xba75('0x4c')](_0xba75('0xe8'),ut[_0xba75('0xe9')](_0x5132e1,_0xba75('0xea')));_0x4b339b['createHistory'](_0x5132e1)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x5132e1[_0xba75('0xf0')]+_0x5132e1['countcongestionretry']+_0x5132e1[_0xba75('0xf1')]+_0x5132e1[_0xba75('0xf2')]+_0x5132e1[_0xba75('0xf3')]+_0x5132e1[_0xba75('0xf4')]+_0x5132e1['countmachineretry']+_0x5132e1[_0xba75('0xf5')]>=_0x3164f9[_0xba75('0xf6')]){_0x4b339b['stateGlobal'](_0x5132e1,_0xc23785,_0x511e49,_0xba75('0xf7'));}else{if(_0x5132e1[_0xba75('0xf8')]>=_0x3164f9[_0xba75('0xf9')]){_0x4b339b[_0xba75('0xfa')](_0x5132e1,_0xc23785,_0x511e49,'reason\x2019\x20machine....');}else{_0x4b339b[_0xba75('0xbb')]({'active':![],'countmachineretry':_0x5132e1['countmachineretry'],'scheduledat':moment()[_0xba75('0xfb')](_0x3164f9[_0xba75('0xfc')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5132e1['ContactId'],'ListId':_0x5132e1[_0xba75('0xfd')],'VoiceQueueId':_0x5132e1['VoiceQueueId']||undefined,'CampaignId':_0x5132e1[_0xba75('0xfe')]||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0xff')));_0xc23785({'reschedule':0x1});}}});}if(_0x147b18[_0xba75('0x4d')]==='ivr'&&this['campaigns'][_0x147b18[_0xba75('0xac')]]['dialAMDActive']&&_0x39f3bf[_0xba75('0xe3')]==='HANGUP'){delete this[_0xba75('0x28')][_0x39f3bf[_0xba75('0xdc')]];this[_0xba75('0xae')](this[_0xba75('0x23')][_0x147b18[_0xba75('0xac')]]);_0x1cf736=new Hangup(_0x147b18,_0x39f3bf);_0x1cf736[_0xba75('0xa1')]=0x12;_0x1cf736[_0xba75('0xa2')]=_0xba75('0xe5');_0x1cf736[_0xba75('0xe6')]='AMD';ami[_0xba75('0x4c')](_0xba75('0xe8'),ut[_0xba75('0xe9')](_0x1cf736,_0xba75('0xea')));this['saveInDb'](_0x1cf736,_0xba75('0x100'),_0xba75('0x101'));}if(_0x147b18[_0xba75('0x4d')]==='ivr'&&this[_0xba75('0x23')][_0x147b18[_0xba75('0xac')]]['dialAMDActive']&&_0x39f3bf[_0xba75('0xe3')]===_0xba75('0xed')){var _0x4b339b=this;return new BPromise(function(_0x4f4510,_0x20a51a){delete _0x4b339b[_0xba75('0x28')][_0x39f3bf['uniqueid']];_0x4b339b[_0xba75('0xae')](_0x4b339b[_0xba75('0x23')][_0x147b18['queue']]);_0x4b339b[_0xba75('0x23')][_0x147b18[_0xba75('0xac')]][_0xba75('0x61')]+=0x1;_0x4b339b[_0xba75('0x23')][_0x147b18[_0xba75('0xac')]][_0xba75('0x60')]+=0x1;var _0x1bb9f3=_0x4b339b[_0xba75('0x23')][_0x147b18['queue']];var _0x13f87d=new Hangup(_0x147b18,_0x39f3bf);_0x13f87d[_0xba75('0xa1')]=0x13;_0x13f87d['statedesc']='Machine';_0x13f87d[_0xba75('0xe6')]='AMD';_0x13f87d[_0xba75('0xf8')]+=0x1;_0x13f87d['countglobal']+=0x1;_0x13f87d[_0xba75('0xea')]=!![];ami[_0xba75('0x4c')](_0xba75('0xe8'),ut[_0xba75('0xe9')](_0x13f87d,_0xba75('0xea')));_0x4b339b['createHistory'](_0x13f87d)[_0xba75('0xab')](loggerCatch(_0xba75('0x102')));if(_0x13f87d[_0xba75('0xf0')]+_0x13f87d[_0xba75('0x103')]+_0x13f87d[_0xba75('0xf1')]+_0x13f87d['countnosuchnumberretry']+_0x13f87d[_0xba75('0xf3')]+_0x13f87d[_0xba75('0xf4')]+_0x13f87d[_0xba75('0xf8')]+_0x13f87d[_0xba75('0xf5')]>=_0x1bb9f3['dialGlobalMaxRetry']){_0x4b339b[_0xba75('0x104')](_0x13f87d,_0x4f4510,_0x20a51a,'reason19\x20machine....');}else{if(_0x13f87d['countmachineretry']>=_0x1bb9f3[_0xba75('0xf9')]){_0x4b339b['createStateFinal'](_0x13f87d,_0x4f4510,_0x20a51a,'reason\x2019\x20machine....');}else{_0x4b339b[_0xba75('0xbb')]({'active':![],'countmachineretry':_0x13f87d[_0xba75('0xf8')],'scheduledat':moment()[_0xba75('0xfb')](_0x1bb9f3['dialMachineRetryFrequency'],_0xba75('0x105'))['format'](_0xba75('0x106')),'ContactId':_0x13f87d[_0xba75('0xd1')],'ListId':_0x13f87d['ListId'],'VoiceQueueId':_0x13f87d['VoiceQueueId']||undefined,'CampaignId':_0x13f87d[_0xba75('0xfe')]||undefined})['catch'](loggerCatch(_0xba75('0xff')));_0x4f4510({'reschedule':0x1});}}});}}};Dialer[_0xba75('0x1c')][_0xba75('0x36')]=function(_0x51bc7d){var _0x42c124=this['uniqueId'][_0x51bc7d[_0xba75('0xdc')]];var _0x510fb6=this;var _0xb3d05f;if(_0x42c124&&_0x42c124['type']===_0xba75('0x8f')){delete this[_0xba75('0x28')][_0x51bc7d[_0xba75('0xdc')]];this[_0xba75('0xae')](this[_0xba75('0x23')][_0x42c124[_0xba75('0xac')]]);this['campaigns'][_0x42c124['queue']][_0xba75('0x107')]+=0x1;_0xb3d05f=new Hangup(_0x42c124,_0x51bc7d);this[_0xba75('0xc7')](_0xb3d05f)[_0xba75('0xab')](loggerCatch(_0xba75('0x108')));this[_0xba75('0xc6')](_0xb3d05f)['catch'](loggerCatch(_0xba75('0x109')));}if(_0x42c124&&_0x42c124[_0xba75('0x4d')]!==_0xba75('0x8f')&&isNotNull(this[_0xba75('0x22')][_0x42c124['queue']]['dialQueueProject'])){delete this[_0xba75('0x28')][_0x51bc7d[_0xba75('0xdc')]];this[_0xba75('0xae')](this[_0xba75('0x22')][_0x42c124[_0xba75('0xac')]]);this[_0xba75('0x22')][_0x42c124[_0xba75('0xac')]][_0xba75('0x61')]+=0x1;this[_0xba75('0x22')][_0x42c124['queue']][_0xba75('0x60')]+=0x1;_0xb3d05f=new Hangup(_0x42c124,_0x51bc7d);_0xb3d05f['state']=0x10;_0xb3d05f[_0xba75('0xa2')]=_0xba75('0x10a');_0xb3d05f[_0xba75('0xe6')]=_0xba75('0x10b');this['createHistory'](_0xb3d05f)[_0xba75('0xab')](loggerCatch(_0xba75('0x108')));this[_0xba75('0xc6')](_0xb3d05f)['catch'](loggerCatch(_0xba75('0x109')));}if(_0x42c124&&_0x42c124[_0xba75('0x4d')]!==_0xba75('0x8f')&&!isNotNull(this[_0xba75('0x22')][_0x42c124[_0xba75('0xac')]][_0xba75('0x10c')])){delete this[_0xba75('0x28')][_0x51bc7d[_0xba75('0xdc')]];this[_0xba75('0xae')](this[_0xba75('0x22')][_0x42c124['queue']]);this[_0xba75('0x22')][_0x42c124[_0xba75('0xac')]][_0xba75('0x10d')]+=0x1;_0xb3d05f=new Hangup(_0x42c124,_0x51bc7d);_0xb3d05f[_0xba75('0xa1')]=0xc;_0xb3d05f[_0xba75('0xa2')]=_0x51bc7d['cause-txt'];_0xb3d05f[_0xba75('0xe6')]='Unknow';this[_0xba75('0xc7')](_0xb3d05f)['catch'](loggerCatch(_0xba75('0x108')));this[_0xba75('0xc6')](_0xb3d05f)[_0xba75('0xab')](loggerCatch(_0xba75('0x109')));}};Dialer[_0xba75('0x1c')]['syncAgentComplete']=function(_0x13f5da){var _0xf883ba=this[_0xba75('0x28')][_0x13f5da['uniqueid']];var _0x3044d3=this;if(this[_0xba75('0x22')][_0x13f5da[_0xba75('0xac')]]){if(_0xf883ba&&_0xf883ba[_0xba75('0x4d')]!=='ivr'){delete this[_0xba75('0x28')][_0x13f5da[_0xba75('0xdc')]];this['voiceQueues'][_0x13f5da[_0xba75('0xac')]]['outboundAnswerCallsDay']+=0x1;var _0x305b8a=new AgentComplete(_0xf883ba,_0x13f5da);if(_0x13f5da['reason']===_0xba75('0x10e')){_0x305b8a['agiafterat']=this[_0xba75('0x22')][_0x13f5da['queue']][_0xba75('0x10f')]&&this[_0xba75('0x22')][_0x13f5da[_0xba75('0xac')]][_0xba75('0x110')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0xba75('0xc7')](_0x305b8a)[_0xba75('0xab')](loggerCatch(_0xba75('0x111')));this['moveContactManagedDialer'](_0x305b8a)[_0xba75('0xab')](loggerCatch(_0xba75('0x112')));}}};Dialer['prototype'][_0xba75('0x2d')]=function(_0x4d6716){if(this[_0xba75('0x22')][_0x4d6716['queue']]){if(this[_0xba75('0x28')][_0x4d6716[_0xba75('0xdc')]]&&this[_0xba75('0x28')][_0x4d6716[_0xba75('0xdc')]][_0xba75('0x4d')]!==_0xba75('0x8f')){this['updateOriginated'](this[_0xba75('0x22')][_0x4d6716[_0xba75('0xac')]]);this[_0xba75('0x28')][_0x4d6716['uniqueid']][_0xba75('0x113')]=moment()[_0xba75('0x78')](_0xba75('0x106'));}}};Dialer[_0xba75('0x1c')][_0xba75('0x114')]=function(_0x51fdd2){this[_0xba75('0xc7')](_0x51fdd2)[_0xba75('0xab')](loggerCatch(_0xba75('0x111')));this[_0xba75('0xc6')](_0x51fdd2)[_0xba75('0xab')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0xba75('0x2f')]=function(_0x48b93a){var _0x2f8367=this[_0xba75('0x28')][_0x48b93a[_0xba75('0xdc')]];var _0x42d0c7=this;if(this[_0xba75('0x22')][_0x48b93a[_0xba75('0xac')]]){if(_0x2f8367&&_0x2f8367['type']!==_0xba75('0x8f')){delete this[_0xba75('0x28')][_0x48b93a['uniqueid']];this[_0xba75('0xae')](this[_0xba75('0x22')][_0x48b93a[_0xba75('0xac')]]);_0x2f8367[_0xba75('0x115')]=moment()[_0xba75('0x78')](_0xba75('0x106'));var _0x1f7af9=new QueueCallerAbandon(_0x2f8367,_0x48b93a);if(getSeconds(_0x2f8367[_0xba75('0x115')],_0x2f8367[_0xba75('0x116')])>=_0x2f8367[_0xba75('0x117')]){this[_0xba75('0x22')][_0x48b93a['queue']][_0xba75('0x6b')]+=0x1;this['voiceQueues'][_0x48b93a[_0xba75('0xac')]][_0xba75('0x65')]+=0x1;this['voiceQueues'][_0x48b93a[_0xba75('0xac')]][_0xba75('0x6d')]+=0x1;_0x1f7af9[_0xba75('0xa1')]=0xa;_0x1f7af9[_0xba75('0xa2')]=_0xba75('0x118');_0x1f7af9['dropreason']=_0xba75('0x119');_0x1f7af9[_0xba75('0x11a')]=this[_0xba75('0x22')][_0x48b93a[_0xba75('0xac')]][_0xba75('0x10f')]?moment()[_0xba75('0x78')](_0xba75('0x106')):undefined;_0x1f7af9[_0xba75('0xf3')]+=0x1;_0x1f7af9['countglobal']+=0x1;if(_0x1f7af9[_0xba75('0xf3')]>=this[_0xba75('0x22')][_0x48b93a[_0xba75('0xac')]][_0xba75('0x11b')]){this[_0xba75('0x114')](_0x1f7af9);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x1f7af9[_0xba75('0xf3')],'scheduledat':moment()[_0xba75('0xfb')](this['voiceQueues'][_0x48b93a[_0xba75('0xac')]][_0xba75('0x11c')],'minutes')[_0xba75('0x78')](_0xba75('0x106')),'ContactId':_0x2f8367['ContactId'],'ListId':_0x2f8367[_0xba75('0xfd')],'VoiceQueueId':_0x2f8367['VoiceQueueId']||undefined,'CampaignId':_0x2f8367[_0xba75('0xfe')]||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0x11d')));var _0x5cb2d8=new History(_0x1f7af9);_0x5cb2d8['state']=0xa;_0x5cb2d8['statedesc']=_0xba75('0x118');_0x5cb2d8[_0xba75('0xa3')]=moment()[_0xba75('0x78')]('YYYY-MM-DD\x20HH:mm:ss');_0x5cb2d8[_0xba75('0x11e')]=_0x5cb2d8[_0xba75('0xa3')];_0x5cb2d8[_0xba75('0x11f')]=_0x1f7af9['calleridname'];_0x5cb2d8[_0xba75('0x120')]=_0x1f7af9[_0xba75('0x120')];this[_0xba75('0xc7')](_0x5cb2d8)[_0xba75('0xab')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0xba75('0x22')][_0x48b93a['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xba75('0x22')][_0x48b93a['queue']][_0xba75('0x121')]+=0x1;_0x1f7af9[_0xba75('0xa1')]=0xb;_0x1f7af9[_0xba75('0xa2')]=_0xba75('0x122');_0x1f7af9['dropreason']=_0xba75('0x123');_0x1f7af9[_0xba75('0xf4')]+=0x1;_0x1f7af9['countglobal']+=0x1;if(_0x1f7af9[_0xba75('0xf4')]>=this[_0xba75('0x22')][_0x48b93a['queue']][_0xba75('0x124')]){this[_0xba75('0x114')](_0x1f7af9);}else{this[_0xba75('0xbb')]({'active':![],'countabandonedretry':_0x1f7af9[_0xba75('0xf4')],'scheduledat':moment()[_0xba75('0xfb')](this[_0xba75('0x22')][_0x48b93a[_0xba75('0xac')]][_0xba75('0x125')],_0xba75('0x105'))[_0xba75('0x78')](_0xba75('0x106')),'ContactId':_0x2f8367[_0xba75('0xd1')],'ListId':_0x2f8367[_0xba75('0xfd')],'VoiceQueueId':_0x2f8367[_0xba75('0xd3')]||undefined,'CampaignId':_0x2f8367[_0xba75('0xfe')]||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0x126')));var _0x5cb2d8=new History(_0x1f7af9);_0x5cb2d8[_0xba75('0xa1')]=0xb;_0x5cb2d8[_0xba75('0xa2')]=_0xba75('0x122');_0x5cb2d8['starttime']=moment()[_0xba75('0x78')](_0xba75('0x106'));_0x5cb2d8[_0xba75('0x11e')]=_0x5cb2d8[_0xba75('0xa3')];_0x5cb2d8[_0xba75('0x11f')]=_0x1f7af9[_0xba75('0x11f')];_0x5cb2d8[_0xba75('0x120')]=_0x1f7af9[_0xba75('0x120')];this['createHistory'](_0x5cb2d8)[_0xba75('0xab')](loggerCatch(_0xba75('0x127')));}}}}};Dialer[_0xba75('0x1c')][_0xba75('0x38')]=function(_0x472948){if(this['actions'][_0x472948[_0xba75('0xdc')]]){this[_0xba75('0xa6')][_0x472948[_0xba75('0xdc')]][_0xba75('0xaa')]=_0x472948[_0xba75('0xaa')];}if(this['uniqueId'][_0x472948[_0xba75('0xdc')]]){this[_0xba75('0x28')][_0x472948[_0xba75('0xdc')]][_0xba75('0xaa')]=_0x472948['channel'];}};Dialer['prototype'][_0xba75('0x39')]=function(_0x16bee4){if(strategy[this[_0xba75('0x22')][this[_0xba75('0xa6')][_0x16bee4[_0xba75('0x128')]]['queue']]['strategy']]===_0xba75('0x1b')){if(this[_0xba75('0xa6')][_0x16bee4[_0xba75('0x128')]]&&_['isNil'](this[_0xba75('0xa6')][_0x16bee4[_0xba75('0x128')]][_0xba75('0x129')])&&_0x16bee4[_0xba75('0xa9')]==='1'&&_0x16bee4[_0xba75('0x12a')]==='0'){if(this[_0xba75('0x24')][_0x16bee4['stateinterface']]){if(!this[_0xba75('0x24')][_0x16bee4[_0xba75('0x12b')]][_0xba75('0x129')]){this[_0xba75('0x24')][_0x16bee4[_0xba75('0x12b')]]['locked']=!![];this[_0xba75('0xa6')][_0x16bee4['actionid']]['locked']=!![];this[_0xba75('0xa6')][_0x16bee4[_0xba75('0x128')]][_0xba75('0x12b')]=_0x16bee4['stateinterface'];}}}}else if((strategy[this['voiceQueues'][this[_0xba75('0xa6')][_0x16bee4[_0xba75('0x128')]][_0xba75('0xac')]][_0xba75('0x4f')]]||_0xba75('0x1a'))===_0xba75('0x1a')){if(this[_0xba75('0xa6')][_0x16bee4[_0xba75('0x128')]]){if(this[_0xba75('0x24')][_0x16bee4[_0xba75('0x12b')]]){this[_0xba75('0xa6')][_0x16bee4[_0xba75('0x128')]][_0xba75('0x12b')]=_0x16bee4[_0xba75('0x12b')];if(_[_0xba75('0xdd')](this['queueBooked'][this[_0xba75('0xa6')][_0x16bee4[_0xba75('0x128')]][_0xba75('0xac')]])){this[_0xba75('0x12c')][this[_0xba75('0xa6')][_0x16bee4[_0xba75('0x128')]][_0xba75('0xac')]]=[];}this[_0xba75('0x12c')][this[_0xba75('0xa6')][_0x16bee4[_0xba75('0x128')]]['queue']]['push'](_[_0xba75('0xcf')](_[_0xba75('0xd0')](this[_0xba75('0xa6')][_0x16bee4[_0xba75('0x128')]],[_0xba75('0x12d'),_0xba75('0x12b')]),{'status':_0x16bee4[_0xba75('0xa9')],'paused':_0x16bee4[_0xba75('0x12a')]}));}}}};function unlockQueueStatus(_0x5ef5e2,_0x391b6f){setTimeout(function(){if(_[_0xba75('0x3d')](_0x5ef5e2[_0xba75('0x12e')])){loggerBooked[_0xba75('0x92')]('[unlockQueueStatus][undefined]',_0x391b6f);}_0x5ef5e2[_0xba75('0x12e')]=!![];loggerBooked['info'](_0xba75('0x12f'),_0x391b6f,JSON[_0xba75('0x49')](_[_0xba75('0xd0')](_0x5ef5e2,[_0xba75('0x41'),_0xba75('0x12e')])));},0x1f3);}Dialer[_0xba75('0x1c')][_0xba75('0x3b')]=function(_0x279097){var _0x5e0de6=this;var _0x44693f=_0x5e0de6[_0xba75('0x22')][_0x5e0de6[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]];if(strategy[this[_0xba75('0x22')][this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]][_0xba75('0x4f')]]===_0xba75('0x1b')){if(this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]]&&this[_0xba75('0xa6')][_0x279097['actionid']][_0xba75('0x12b')]){this[_0xba75('0x21')][_0xba75('0x130')](this['actions'][_0x279097[_0xba75('0x128')]][_0xba75('0x12d')],this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0x12b')])[_0xba75('0xab')](function(_0x120b52){logger[_0xba75('0x92')](_0xba75('0x131'),util[_0xba75('0x93')](_0x120b52,{'showHidden':![],'depth':null}));})[_0xba75('0x1f')](function(){_0x5e0de6[_0xba75('0xae')](_0x5e0de6[_0xba75('0x22')][_0x5e0de6[_0xba75('0xa6')][_0x279097['actionid']]['queue']]);_0x5e0de6[_0xba75('0x24')][_0x5e0de6[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0x12b')]]['locked']=![];delete _0x5e0de6[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]];unlockQueueStatus(_0x44693f);});}else{this[_0xba75('0xae')](this[_0xba75('0x22')][this[_0xba75('0xa6')][_0x279097['actionid']]['queue']]);this[_0xba75('0xbb')]({'active':![],'ContactId':this['actions'][_0x279097['actionid']]['ContactId'],'ListId':this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xfd')],'VoiceQueueId':this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xd3')]||undefined,'CampaignId':this[_0xba75('0xa6')][_0x279097['actionid']][_0xba75('0xfe')]||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0x132')));delete this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]];unlockQueueStatus(_0x44693f);}}else if((strategy[this[_0xba75('0x22')][this['actions'][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]][_0xba75('0x4f')]]||_0xba75('0x1a'))===_0xba75('0x1a')){var _0x4249b6;if(this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]]&&!_['isEmpty'](this[_0xba75('0x12c')][this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]])){if(this[_0xba75('0x2b')][_0x5e0de6[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]]['queue']]){this[_0xba75('0x2b')][_0x5e0de6[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]]=this[_0xba75('0x2b')][this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]]?this[_0xba75('0x2b')][this['actions'][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]]:this['queueBooked'][this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]]['queue']]?this['queueBooked'][this['actions'][_0x279097['actionid']][_0xba75('0xac')]][_0xba75('0x133')]||0x0:0x0;}this['queueBooked'][this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]]['_rr']=this[_0xba75('0x2b')][this['actions'][_0x279097['actionid']][_0xba75('0xac')]];for(var _0x3f1673=0x0;_0x3f1673<this[_0xba75('0x12c')][this['actions'][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]]['length'];_0x3f1673+=0x1){_0x4249b6=rr(this['queueBooked'][this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]]['queue']]);this[_0xba75('0x2b')][_0x5e0de6['actions'][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]]=this[_0xba75('0x12c')][this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]][_0xba75('0x133')];if(_0x4249b6[_0xba75('0xa9')]==='1'&&_0x4249b6[_0xba75('0x12a')]==='0'){break;}}if(!_[_0xba75('0xdd')](_0x4249b6)){this[_0xba75('0x24')][_0x4249b6[_0xba75('0x12b')]]['unlockRR']=_[_0xba75('0x3d')](this['agents'][_0x4249b6[_0xba75('0x12b')]]['unlockRR'])?!![]:this[_0xba75('0x24')][_0x4249b6[_0xba75('0x12b')]]['unlockRR'];}loggerBooked[_0xba75('0x7e')](_0xba75('0x134'),_0x279097[_0xba75('0x128')],_0xba75('0x135'),JSON[_0xba75('0x49')](_['pick'](this['agents'][_0x4249b6['stateinterface']],[_0xba75('0x41'),_0xba75('0x136')])),_0xba75('0x137'),JSON[_0xba75('0x49')](_0x4249b6[_0xba75('0x12d')]));if(!_[_0xba75('0xdd')](_0x4249b6)&&_0x4249b6[_0xba75('0xa9')]==='1'&&_0x4249b6[_0xba75('0x12a')]==='0'&&this[_0xba75('0x24')][_0x4249b6['stateinterface']]['unlockRR']){this[_0xba75('0x24')][_0x4249b6[_0xba75('0x12b')]]['unlockRR']=![];this[_0xba75('0x12c')][_0x5e0de6[_0xba75('0xa6')][_0x279097['actionid']][_0xba75('0xac')]]=[];this[_0xba75('0x21')][_0xba75('0x130')](_0x4249b6[_0xba75('0x12d')],_0x4249b6[_0xba75('0x12b')])[_0xba75('0xab')](function(_0x1a617b){logger['error'](_0xba75('0x131'),util['inspect'](_0x1a617b,{'showHidden':![],'depth':null}));})['finally'](function(){_0x5e0de6[_0xba75('0xae')](_0x5e0de6[_0xba75('0x22')][_0x5e0de6[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]]['queue']]);setTimeout(function(){_0x5e0de6[_0xba75('0x24')][_0x4249b6[_0xba75('0x12b')]][_0xba75('0x136')]=!![];loggerBooked[_0xba75('0x7e')](_0xba75('0x138'),_0x279097[_0xba75('0x128')],_0xba75('0x135'),JSON[_0xba75('0x49')](_[_0xba75('0xd0')](_0x5e0de6[_0xba75('0x24')][_0x4249b6[_0xba75('0x12b')]],['name',_0xba75('0x136')])),_0xba75('0x137'),JSON['stringify'](_0x4249b6[_0xba75('0x12d')]));},0xc7);delete _0x5e0de6[_0xba75('0xa6')][_0x279097['actionid']];unlockQueueStatus(_0x44693f,_0x279097['actionid']);});}else{loggerBooked[_0xba75('0x7e')](_0xba75('0x139'));this[_0xba75('0xae')](this[_0xba75('0x22')][this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]]);this[_0xba75('0xbb')]({'active':![],'ContactId':this[_0xba75('0xa6')][_0x279097['actionid']][_0xba75('0xd1')],'ListId':this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]]['ListId'],'VoiceQueueId':this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0x279097['actionid']]['CampaignId']||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0x132')));delete this['actions'][_0x279097[_0xba75('0x128')]];unlockQueueStatus(_0x44693f);}}else{loggerBooked['info']('[booked][unlock2]');this['updateOriginated'](this['voiceQueues'][this['actions'][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xd1')],'ListId':this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xfd')],'VoiceQueueId':this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]][_0xba75('0xd3')]||undefined,'CampaignId':this['actions'][_0x279097['actionid']][_0xba75('0xfe')]||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0x13a')));delete this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]];unlockQueueStatus(_0x44693f);}}else{loggerBooked[_0xba75('0x7e')](_0xba75('0x13b'));this['updateOriginated'](this[_0xba75('0x22')][this['actions'][_0x279097[_0xba75('0x128')]][_0xba75('0xac')]]);this[_0xba75('0xbb')]({'active':![],'ContactId':this[_0xba75('0xa6')][_0x279097['actionid']][_0xba75('0xd1')],'ListId':this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]]['ListId'],'VoiceQueueId':this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]]['VoiceQueueId']||undefined,'CampaignId':this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]]['CampaignId']||undefined})['catch'](loggerCatch(_0xba75('0x13c')));delete this[_0xba75('0xa6')][_0x279097[_0xba75('0x128')]];unlockQueueStatus(_0x44693f);}};Dialer[_0xba75('0x1c')]['loopCampaigns']=function(){var _0x1f0a74=this;setInterval(function(){_0x1f0a74[_0xba75('0x13d')]();},0x3e8);};Dialer[_0xba75('0x1c')][_0xba75('0x13e')]=function(_0x888a10){var _0x3b10a6=this;return function(){if(!_0x3b10a6['isTrunkReachable'](_0x888a10[_0xba75('0x76')])){if(!_0x3b10a6[_0xba75('0xd6')](_0x888a10[_0xba75('0x13f')])){_0x888a10['message']=_0xba75('0x140');throw _0x888a10[_0xba75('0x41')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0xba75('0x141')]=function(_0x36a4a0,_0x3beee4,_0x135175,_0x39a5db){var _0x51ae24=this;return function(){var _0x3efbf3=!![];return _0x51ae24[_0xba75('0x142')](_0x36a4a0,_0x3beee4,_0x135175,_0x39a5db,_0x3efbf3);};};Dialer[_0xba75('0x1c')][_0xba75('0x143')]=function(_0x88ea42,_0x3d6f0f,_0x50e0c8,_0x72e0e6){var _0x434f35=this;return function(){var _0x35e700=![];return _0x434f35[_0xba75('0x142')](_0x88ea42[_0xba75('0x47')],_0x3d6f0f,_0x50e0c8,_0x72e0e6,_0x35e700);};};Dialer[_0xba75('0x1c')][_0xba75('0x142')]=function(_0x555e9c,_0x15fe77,_0x481ed6,_0x25051e,_0x163505){var _0x27c971=[];return new BPromise(function(_0x250549,_0x522a3c){if(!isNotNull(_0x555e9c)){_0x25051e[_0xba75('0x43')]='INTERVAL_IS_NULL';return _0x522a3c(msgResponse(_0xba75('0x142'),_0xba75('0x144'),_0x481ed6+_0xba75('0x145')));}if(_['isEmpty'](_0x555e9c)){_0x25051e[_0xba75('0x43')]='INTERVAL_IS_EMPTY';return _0x522a3c(msgResponse(_0xba75('0x142'),_0xba75('0x144'),_0x481ed6+'\x20Intervals\x20is\x20empty\x20'));}if(_0x15fe77&&_['isUndefined'](config[_0xba75('0x146')][_0x15fe77])){_0x25051e[_0xba75('0x43')]=_0xba75('0x147');return _0x522a3c(msgResponse(_0xba75('0x142'),_0xba75('0x144'),_0x481ed6+_0xba75('0x148')+_0x15fe77));}if(_[_0xba75('0x149')](_0x555e9c)){for(var _0x1c1391=0x0;_0x1c1391<_0x555e9c[_0xba75('0x14a')];_0x1c1391+=0x1){_0x27c971[_0xba75('0x14b')](ami[_0xba75('0xa8')]({'action':'command','command':util[_0xba75('0x78')](_0xba75('0x14c'),_0x555e9c[_0x1c1391][_0xba75('0x14d')],!_[_0xba75('0x3d')](config[_0xba75('0x146')][_0x15fe77])?_0x15fe77:'')})[_0xba75('0xb2')](function(_0x4c79ff){return _0x4c79ff[_0xba75('0x14e')][_0xba75('0x14f')]('true')>=0x0;})[_0xba75('0xab')](myreject(_0x522a3c)));}}else{_0x27c971[_0xba75('0x14b')](ami[_0xba75('0xa8')]({'action':_0xba75('0x150'),'command':util['format'](_0xba75('0x14c'),_0x555e9c,!_[_0xba75('0x3d')](config[_0xba75('0x146')][_0x15fe77])?_0x15fe77:'')})['then'](function(_0x49a8a3){return _0x49a8a3[_0xba75('0x14e')][_0xba75('0x14f')](_0xba75('0x151'))>=0x0;})[_0xba75('0xab')](myreject(_0x522a3c)));}BPromise[_0xba75('0x152')](_0x27c971)[_0xba75('0xb2')](function(_0x35ca7f){var _0x376cac=_[_0xba75('0x153')](_0x35ca7f);if(_0x376cac){return _0x250549(_0x376cac);}else{_0x25051e[_0xba75('0x43')]=_0x163505?_0xba75('0x154'):_0xba75('0x155');return _0x522a3c(msgResponse(_0xba75('0x156'),'Failure','Global:\x20'+_0x163505+'\x20'+_0x481ed6+_0xba75('0x157')+util['inspect'](_0x555e9c,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x15fe77));}})[_0xba75('0xab')](function(_0x2e07d1){return _0x522a3c(msgResponse('ifTime',_0xba75('0x144'),JSON[_0xba75('0x49')](_0x2e07d1)));});});};Dialer[_0xba75('0x1c')]['checkDialMethod']=function(_0x26cf1e){var _0x3a1c45=this;return function(){switch(_0x26cf1e[_0xba75('0x5b')]){case'progressive':freeVariablesPredictive(_0x26cf1e);_0x3a1c45[_0xba75('0x158')](_0x26cf1e,0x1);break;case _0xba75('0x159'):freeVariablesPredictive(_0x26cf1e);_0x3a1c45['handlePower'](_0x26cf1e,_0x26cf1e[_0xba75('0x15a')]);break;case _0xba75('0xa'):_0x3a1c45['predictive'](_0x26cf1e);break;case _0xba75('0x9'):freeVariablesPredictive(_0x26cf1e);_0x3a1c45['handlePower'](_0x26cf1e,0x1);break;default:freeVariablesPredictive(_0x26cf1e);logger[_0xba75('0x92')](_0xba75('0x15b'),_0x26cf1e[_0xba75('0x41')],_0xba75('0x15c'));}};};Dialer[_0xba75('0x1c')]['launchHandleIvr']=function(_0x3da2d7){var _0x31c977=this;return function(){_0x31c977[_0xba75('0x15d')](_0x3da2d7);};};Dialer[_0xba75('0x1c')]['syncQueueSummary']=function(_0xfbac67){var _0x5137c0=this;if(isNotPreview(_0xfbac67['dialMethod'])){if(isVoiceQueueOutbound(_0xfbac67[_0xba75('0x4d')])&&isActive(_0xfbac67['dialActive'])){_0xfbac67['sendMessageOneNotActive']=!![];BPromise[_0xba75('0xb1')]()['then'](checkIsLoggedIn(_0xfbac67,_0xfbac67[_0xba75('0x51')]))[_0xba75('0xb2')](checkIsActive(_0xfbac67,_0xfbac67[_0xba75('0x5a')]))[_0xba75('0xb2')](checkInterval(_0xfbac67))[_0xba75('0xb2')](_0x5137c0['checkIsTrunkReachable'](_0xfbac67))[_0xba75('0xb2')](_0x5137c0[_0xba75('0x141')](_0xfbac67['dialGlobalInterval'],_0xfbac67[_0xba75('0x15e')],_0xfbac67[_0xba75('0x41')],_0xfbac67))[_0xba75('0xb2')](_0x5137c0[_0xba75('0x143')](_0xfbac67[_0xba75('0x42')],_0xfbac67[_0xba75('0x15e')],_0xfbac67['name'],_0xfbac67))['then'](_0x5137c0[_0xba75('0x15f')](_0xfbac67))[_0xba75('0xab')](loggerCatchQueueSummary(_0xba75('0x160'),_0xfbac67));}else{notSendMessagesQueue(_0xfbac67);}}else{freeVariablesPredictive(_0xfbac67);}};Dialer[_0xba75('0x1c')][_0xba75('0x13d')]=function(){var _0x2b68d2=this;var _0x136278;for(var _0x15aa43 in this[_0xba75('0x23')]){if(typeof this['campaigns'][_0x15aa43]!==_0xba75('0x95')){_0x136278=this['campaigns'][_0x15aa43];if(isCampaignIvr(_0x136278[_0xba75('0x4d')])&&isActive(_0x136278[_0xba75('0xd7')])){_0x136278['sendMessageOneNotActive']=!![];BPromise[_0xba75('0xb1')]()['then'](checkIsActive(_0x136278,_0x136278[_0xba75('0xd7')]))[_0xba75('0xb2')](checkInterval(_0x136278))[_0xba75('0xb2')](_0x2b68d2[_0xba75('0x13e')](_0x136278))[_0xba75('0xb2')](_0x2b68d2[_0xba75('0x141')](_0x136278[_0xba75('0x161')],_0x136278[_0xba75('0x15e')],_0x136278[_0xba75('0x41')],_0x136278))[_0xba75('0xb2')](_0x2b68d2[_0xba75('0x143')](_0x136278[_0xba75('0x42')],_0x136278[_0xba75('0x15e')],_0x136278[_0xba75('0x41')],_0x136278))[_0xba75('0xb2')](_0x2b68d2[_0xba75('0x162')](_0x136278))[_0xba75('0xab')](loggerCatchQueueSummary(_0xba75('0x163'),_0x136278));}else{notSendMessagesCampaign(_0x136278);}}}};function getCallerIdRandom(_0x426388,_0x4ced3b){var _0x563b1c;var _0x2f0857;var _0x430ac3;if(_0x4ced3b<=0x0){_0x4ced3b=0x1;}_0x563b1c=new RegExp('\x5cw{0,'+_0x4ced3b+'}$');_0x2f0857=Math[_0xba75('0x164')](0xa,_0x4ced3b-0x1);_0x430ac3=Math[_0xba75('0x164')](0xa,_0x4ced3b)-0x1;return util['format']('%s',_[_0xba75('0x165')](_0x426388,_0x563b1c,_[_0xba75('0x166')](_0x2f0857,_0x430ac3)));}function extractCalleridName(_0x1a8bde){var _0x1ea583=_0x1a8bde[_0xba75('0x167')](/"(.*?)"/);return _0x1ea583?_0x1ea583[0x1]:_0x1a8bde;}function extractCalleridNumber(_0x2728ca){var _0x34dde1=_0x2728ca[_0xba75('0x167')](/<(.*?)>/);return _0x34dde1?_0x34dde1[0x1]:_0x2728ca;}Dialer[_0xba75('0x1c')]['actionOriginate']=function(_0x1396b6,_0x25ecd1){var _0x5d8a7b=this;var _0x47b9a5=uuid['v4']();this['actions'][_0x47b9a5]=new Action(_0x1396b6,_0x25ecd1,_0x47b9a5);return new BPromise(function(_0x3b8911,_0x1553df){if(_[_0xba75('0x3d')](_0x1396b6)&&typeof _0x1396b6!=='object'){return _0x1553df(msgResponse('originate',_0xba75('0x144'),_0xba75('0x168')));}if(_['isUndefined'](_0x25ecd1[_0xba75('0x169')]['phone'])||_0x25ecd1[_0xba75('0x169')]['phone']===null){return _0x1553df(msgResponse(_0xba75('0x16a'),_0xba75('0x144'),_0xba75('0x16b')));}var _0x4f7435={'XMD-CALLERID':_0x5d8a7b[_0xba75('0xa6')][_0x47b9a5][_0xba75('0x16c')](),'XMD-AGI':_0x1396b6[_0xba75('0x10c')]?util[_0xba75('0x78')](_0xba75('0x16d'),ipAgi,_0x1396b6[_0xba75('0x10c')]):_0xba75('0x16e'),'XMD-AGIAFTER':_0x1396b6[_0xba75('0x10f')]?util[_0xba75('0x78')](_0xba75('0x16d'),ipAgi,_0x1396b6[_0xba75('0x10f')]):_0xba75('0x16e'),'XMD-QUEUE':_0x1396b6['type']===_0xba75('0x4e')?util[_0xba75('0x78')](_0xba75('0x16f'),_0x1396b6['name'],_0x1396b6['dialQueueOptions']||'',_0x1396b6['dialAgiAfterHangupAgent']?'c':'',_0x1396b6[_0xba75('0x117')]||0x3):'NONE','XMD-CONTACTID':_0x25ecd1[_0xba75('0xd1')],'XMD-CDRTYPE':_0xba75('0x8'),'CALLERID(all)':_0x5d8a7b['actions'][_0x47b9a5]['getCaller'](),'XMD-AMD':_0x1396b6[_0xba75('0xe2')]?_0xba75('0x170'):'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x1396b6[_0xba75('0xe2')]){_0x4f7435[_0xba75('0x171')]=_0x1396b6['dialAMDInitialSilence']||0x9c4;_0x4f7435[_0xba75('0x172')]=_0x1396b6['dialAMDGreeting']||0x5dc;_0x4f7435[_0xba75('0x173')]=_0x1396b6['dialAMDAfterGreetingSilence']||0x320;_0x4f7435['XMD-AMDTOTALANALYSISTIME']=_0x1396b6[_0xba75('0x174')]||0x1388;_0x4f7435[_0xba75('0x175')]=_0x1396b6[_0xba75('0x176')]||0x64;_0x4f7435[_0xba75('0x177')]=_0x1396b6[_0xba75('0x178')]||0x32;_0x4f7435[_0xba75('0x179')]=_0x1396b6['dialAMDMaximumNumberOfWords']||0x3;_0x4f7435[_0xba75('0x17a')]=_0x1396b6[_0xba75('0x17b')]||0x100;_0x4f7435['XMD-AMDMAXIMUMWORDLENGTH']=_0x1396b6[_0xba75('0x17c')]||0x1388;}if(_0x1396b6['type']==='outbound'){_0x4f7435[_0xba75('0x17d')]=_0x25ecd1[_0xba75('0xd3')];}else{_0x4f7435[_0xba75('0x17e')]=_0x25ecd1['CampaignId'];}for(var _0x449d53 in _0x25ecd1[_0xba75('0x169')]){if(typeof _0x25ecd1[_0xba75('0x169')][_0x449d53]!==_0xba75('0x95')){if(isNotNull(_0x25ecd1[_0xba75('0x169')][_0x449d53])&&_0x449d53!=='id'&&_0x449d53!==_0xba75('0x17f')&&_0x449d53!==_0xba75('0x180')&&_0x449d53!==_0xba75('0x181')){_0x4f7435[util[_0xba75('0x78')](_0xba75('0x182'),_0xba75('0x183'),_[_0xba75('0x184')](_0x449d53))]=_0x25ecd1['Contact'][_0x449d53];}}}var _0x123148=_0x5d8a7b[_0xba75('0xd6')](_0x1396b6[_0xba75('0x76')])?getCallerId(_0x1396b6[_0xba75('0x76')][_0xba75('0x77')],_0x1396b6['dialOriginateCallerIdName'],_0x1396b6[_0xba75('0x185')]>0x0?getCallerIdRandom(_0x1396b6[_0xba75('0x5d')],_0x1396b6[_0xba75('0x185')]):_0x1396b6[_0xba75('0x5d')]):getCallerId(_['isNil'](_0x1396b6['TrunkBackup'])?_0x1396b6[_0xba75('0x76')][_0xba75('0x77')]:_0x1396b6['TrunkBackup'][_0xba75('0x77')],_0x1396b6[_0xba75('0x5c')],_0x1396b6[_0xba75('0x185')]>0x0?getCallerIdRandom(_0x1396b6['dialOriginateCallerIdNumber'],_0x1396b6[_0xba75('0x185')]):_0x1396b6[_0xba75('0x5d')]);if(_0x123148){_0x4f7435['XMD-ORIGINATECALLERIDNAME']=_0x5d8a7b['actions'][_0x47b9a5][_0xba75('0x186')]=extractCalleridName(_0x123148);_0x4f7435[_0xba75('0x187')]=_0x5d8a7b[_0xba75('0xa6')][_0x47b9a5]['originatecalleridnum']=extractCalleridNumber(_0x123148);}return ami[_0xba75('0xa8')]({'actionid':_0x47b9a5,'action':_0xba75('0x16a'),'channel':_0x5d8a7b[_0xba75('0xd6')](_0x1396b6[_0xba75('0x76')])?util[_0xba75('0x78')](_0xba75('0x188'),_0x1396b6[_0xba75('0x76')][_0xba75('0x41')],isNotNull(_0x1396b6['dialPrefix'])?_0x1396b6[_0xba75('0x5f')]['trim']()||'':'',_0x1396b6[_0xba75('0x189')]>0x0?_0x25ecd1['Contact'][_0xba75('0x18a')][_0xba75('0x18b')](_0x1396b6[_0xba75('0x189')]):_0x25ecd1[_0xba75('0x169')][_0xba75('0x18a')]):util['format'](_0xba75('0x188'),_[_0xba75('0xdd')](_0x1396b6[_0xba75('0x13f')])?_0x1396b6[_0xba75('0x76')][_0xba75('0x41')]:_0x1396b6[_0xba75('0x13f')]['name'],isNotNull(_0x1396b6['dialPrefix'])?_0x1396b6[_0xba75('0x5f')][_0xba75('0x18c')]()||'':'',_0x1396b6['dialCutDigit']>0x0?_0x25ecd1[_0xba75('0x169')][_0xba75('0x18a')][_0xba75('0x18b')](_0x1396b6['dialCutDigit']):_0x25ecd1[_0xba75('0x169')][_0xba75('0x18a')]),'callerid':_0x123148,'Exten':_0xba75('0xe1'),'Context':_0xba75('0x18d'),'Priority':'1','variable':_0x4f7435,'timeout':(_0x1396b6['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x47b9a5})[_0xba75('0xb2')](function(_0xbf980c){return _0x3b8911(_0xbf980c);})[_0xba75('0xab')](function(_0xd2c8a7){_0x1396b6[_0xba75('0x18e')]+=0x1;var _0x7eda5e=new History(_0x5d8a7b['actions'][_0x47b9a5]);logger[_0xba75('0x92')](util[_0xba75('0x78')](_0xba75('0x18f'),JSON['stringify'](_0xd2c8a7)));_0x7eda5e[_0xba75('0xa1')]=0xe;_0x7eda5e[_0xba75('0xa2')]=_0xba75('0x190');_0x7eda5e[_0xba75('0xa3')]=moment()[_0xba75('0x78')]('YYYY-MM-DD\x20HH:mm:ss');_0x7eda5e[_0xba75('0x11e')]=_0x7eda5e[_0xba75('0xa3')];_0x5d8a7b['createHistory'](_0x7eda5e)[_0xba75('0xab')](loggerCatch(_0xba75('0x191')));_0x5d8a7b[_0xba75('0xc6')](_0x7eda5e)[_0xba75('0xab')](loggerCatch('[originate][error]'))[_0xba75('0x1f')](function(){delete _0x5d8a7b[_0xba75('0xa6')][_0x47b9a5];return _0x1553df(msgResponse('originate',_0xba75('0x48'),'originate\x20action\x20Error'));});});});};Dialer[_0xba75('0x1c')][_0xba75('0x32')]=function(_0x1e0233){var _0xa5e4f8=this[_0xba75('0xa6')][_0x1e0233[_0xba75('0x128')]];if(_0xa5e4f8){delete this[_0xba75('0xa6')][_0x1e0233[_0xba75('0x128')]];_0xa5e4f8[_0xba75('0x116')]=moment()['format'](_0xba75('0x106'));var _0x26ceb5=_0xa5e4f8['type']===_0xba75('0x8f')?this[_0xba75('0x23')][_0xa5e4f8[_0xba75('0xac')]]:this[_0xba75('0x22')][_0xa5e4f8[_0xba75('0x192')]()];if(!this[_0xba75('0x193')](_0x1e0233[_0xba75('0x194')])){this[_0xba75('0xae')](_0x26ceb5);return this[_0xba75('0x195')](_0xa5e4f8,_0x26ceb5,_0x1e0233)['catch'](loggerCatch(_0xba75('0x196')));}this[_0xba75('0x28')][_0x1e0233[_0xba75('0xdc')]]=_0xa5e4f8;}};Dialer[_0xba75('0x1c')][_0xba75('0x197')]=function(_0x20233b,_0x234dc5,_0x91b5a8){var _0xc76c20=new History(_0x234dc5);if(_0xc76c20['countbusyretry']+_0xc76c20[_0xba75('0x103')]+_0xc76c20[_0xba75('0xf1')]+_0xc76c20[_0xba75('0xf2')]+_0xc76c20['countdropretry']+_0xc76c20[_0xba75('0xf4')]+_0xc76c20[_0xba75('0xf8')]+_0xc76c20[_0xba75('0xf5')]>=_0x91b5a8[_0xba75('0xf6')]-0x1){return!![];}switch(_0x20233b){case 0x3:if(_0xc76c20[_0xba75('0xf1')]>=_0x91b5a8['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0xc76c20['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xba75('0xfb')](_0x91b5a8['dialNoAnswerRetryFrequency'],_0xba75('0x105'))[_0xba75('0x78')](_0xba75('0x106')),'ContactId':_0xc76c20['ContactId'],'ListId':_0xc76c20[_0xba75('0xfd')],'VoiceQueueId':_0xc76c20['VoiceQueueId']||undefined,'CampaignId':_0xc76c20[_0xba75('0xfe')]||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0x198')));break;case 0x5:if(_0xc76c20['countbusyretry']>=_0x91b5a8[_0xba75('0x199')]-0x1){return!![];}this[_0xba75('0xbb')]({'active':![],'countbusyretry':_0xc76c20[_0xba75('0xf0')]+=0x1,'scheduledat':moment()[_0xba75('0xfb')](_0x91b5a8[_0xba75('0x19a')],'minutes')[_0xba75('0x78')](_0xba75('0x106')),'ContactId':_0xc76c20[_0xba75('0xd1')],'ListId':_0xc76c20[_0xba75('0xfd')],'VoiceQueueId':_0xc76c20[_0xba75('0xd3')]||undefined,'CampaignId':_0xc76c20[_0xba75('0xfe')]||undefined})['catch'](loggerCatch(_0xba75('0x19b')));break;case 0x8:if(_0xc76c20[_0xba75('0x103')]>=_0x91b5a8[_0xba75('0x19c')]-0x1){return!![];}this[_0xba75('0xbb')]({'active':![],'countcongestionretry':_0xc76c20['countcongestionretry']+=0x1,'scheduledat':moment()[_0xba75('0xfb')](_0x91b5a8[_0xba75('0x19d')],_0xba75('0x105'))[_0xba75('0x78')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xc76c20[_0xba75('0xd1')],'ListId':_0xc76c20[_0xba75('0xfd')],'VoiceQueueId':_0xc76c20['VoiceQueueId']||undefined,'CampaignId':_0xc76c20['CampaignId']||undefined})[_0xba75('0xab')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0xc76c20[_0xba75('0xf2')]>=_0x91b5a8['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xba75('0xbb')]({'active':![],'countnosuchnumberretry':_0xc76c20[_0xba75('0xf2')]+=0x1,'scheduledat':moment()[_0xba75('0xfb')](_0x91b5a8[_0xba75('0x19e')],_0xba75('0x105'))[_0xba75('0x78')](_0xba75('0x106')),'ContactId':_0xc76c20['ContactId'],'ListId':_0xc76c20[_0xba75('0xfd')],'VoiceQueueId':_0xc76c20[_0xba75('0xd3')]||undefined,'CampaignId':_0xc76c20[_0xba75('0xfe')]||undefined})['catch'](loggerCatch(_0xba75('0x19f')));}break;case 0xa:if(_0xc76c20[_0xba75('0xf3')]>=_0x91b5a8['dialDropMaxRetry']-0x1){return!![];}this[_0xba75('0xbb')]({'active':![],'countdropretry':_0xc76c20[_0xba75('0xf3')]+=0x1,'scheduledat':moment()[_0xba75('0xfb')](_0x91b5a8[_0xba75('0x11c')],_0xba75('0x105'))[_0xba75('0x78')](_0xba75('0x106')),'ContactId':_0xc76c20[_0xba75('0xd1')],'ListId':_0xc76c20['ListId'],'VoiceQueueId':_0xc76c20['VoiceQueueId']||undefined,'CampaignId':_0xc76c20['CampaignId']||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0x11d')));break;case 0xb:if(_0xc76c20['countabandonedretry']>=_0x91b5a8[_0xba75('0x124')]-0x1){return!![];}this[_0xba75('0xbb')]({'active':![],'countabandonedretry':_0xc76c20['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x91b5a8[_0xba75('0x125')],'minutes')[_0xba75('0x78')](_0xba75('0x106')),'ContactId':_0xc76c20[_0xba75('0xd1')],'ListId':_0xc76c20[_0xba75('0xfd')],'VoiceQueueId':_0xc76c20[_0xba75('0xd3')]||undefined,'CampaignId':_0xc76c20[_0xba75('0xfe')]||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0x126')));break;case 0x13:if(_0xc76c20[_0xba75('0xf8')]>=_0x91b5a8[_0xba75('0xf9')]-0x1){return!![];}this[_0xba75('0xbb')]({'active':![],'countmachineretry':_0xc76c20[_0xba75('0xf8')]+=0x1,'scheduledat':moment()[_0xba75('0xfb')](_0x91b5a8[_0xba75('0xfc')],'minutes')[_0xba75('0x78')](_0xba75('0x106')),'ContactId':_0xc76c20[_0xba75('0xd1')],'ListId':_0xc76c20[_0xba75('0xfd')],'VoiceQueueId':_0xc76c20[_0xba75('0xd3')]||undefined,'CampaignId':_0xc76c20['CampaignId']||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0xff')));break;case 0x14:if(_0xc76c20[_0xba75('0xf5')]>=_0x91b5a8[_0xba75('0x1a0')]-0x1){return!![];}this[_0xba75('0xbb')]({'active':![],'countagentrejectretry':_0xc76c20[_0xba75('0xf5')]+=0x1,'scheduledat':moment()[_0xba75('0xfb')](_0x91b5a8['dialAgentRejectRetryFrequency'],_0xba75('0x105'))['format'](_0xba75('0x106')),'ContactId':_0xc76c20['ContactId'],'ListId':_0xc76c20[_0xba75('0xfd')],'VoiceQueueId':_0xc76c20['VoiceQueueId']||undefined,'CampaignId':_0xc76c20[_0xba75('0xfe')]||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0x1a1')));break;default:return!![];}};Dialer[_0xba75('0x1c')][_0xba75('0x195')]=function(_0xa4e914,_0x2de9aa,_0x20a895){var _0x215ef5=this;var _0x555ec7=new History(_0xa4e914);return new BPromise(function(_0x55205d,_0x325b2f){if(_[_0xba75('0x3d')](_0x2de9aa)&&typeof _0x2de9aa!==_0xba75('0x1a2')){return _0x325b2f(msgResponse(_0xba75('0x1a3'),_0xba75('0x144'),'entity\x20is\x20undefine'));}if(_[_0xba75('0x3d')](_0x20a895)&&typeof _0x20a895!==_0xba75('0x1a2')){return _0x325b2f(msgResponse(_0xba75('0x1a3'),'Failure','evt\x20is\x20undefine'));}switch(_0x20a895[_0xba75('0x1a4')]){case'0':_0x2de9aa[_0xba75('0x67')]+=0x1;_0x555ec7[_0xba75('0xa1')]=0x0;_0x555ec7[_0xba75('0xa2')]=_0xba75('0x1a5');_0x555ec7['countnosuchnumberretry']+=0x1;_0x555ec7[_0xba75('0xef')]+=0x1;ami[_0xba75('0x4c')](_0xba75('0x1a6'),ut[_0xba75('0xe9')](_0xa4e914,'nosuchnumber'));_0x215ef5['createHistory'](_0x555ec7)[_0xba75('0xab')](loggerCatch(_0xba75('0x102')));if(_0x215ef5[_0xba75('0x197')](0x0,_0xa4e914,_0x2de9aa)){if(_0x555ec7[_0xba75('0xf2')]>=_0x2de9aa[_0xba75('0x1a7')]){_0x215ef5[_0xba75('0xfa')](_0x555ec7,_0x55205d,_0x325b2f,_0xba75('0x1a8'));}else{_0x215ef5[_0xba75('0x104')](_0x555ec7,_0x55205d,_0x325b2f,_0xba75('0x1a8'));}}break;case'3':_0x2de9aa['outboundNoAnswerCallsDay']+=0x1;_0x555ec7[_0xba75('0xa1')]=0x3;_0x555ec7[_0xba75('0xa2')]='NoAnswer';_0x555ec7['countnoanswerretry']+=0x1;_0x555ec7['countglobal']+=0x1;ami['emit']('custom:agentnoanswer',ut[_0xba75('0xe9')](_0xa4e914,_0xba75('0x1a9')));_0x215ef5[_0xba75('0xc7')](_0x555ec7)[_0xba75('0xab')](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x215ef5['checkRetriveMax'](0x3,_0xa4e914,_0x2de9aa)){if(_0x555ec7[_0xba75('0xf1')]>=_0x2de9aa[_0xba75('0x1aa')]){_0x215ef5[_0xba75('0xfa')](_0x555ec7,_0x55205d,_0x325b2f,_0xba75('0x1ab'));}else{_0x215ef5[_0xba75('0x104')](_0x555ec7,_0x55205d,_0x325b2f,_0xba75('0x1ab'));}}break;case'5':_0x2de9aa[_0xba75('0x1ac')]+=0x1;_0x555ec7[_0xba75('0xa1')]=0x5;_0x555ec7[_0xba75('0xa2')]='Busy';_0x555ec7[_0xba75('0xf0')]+=0x1;_0x555ec7['countglobal']+=0x1;ami[_0xba75('0x4c')](_0xba75('0x1ad'),ut['buildObj'](_0xa4e914,_0xba75('0x1ae')));_0x215ef5[_0xba75('0xc7')](_0x555ec7)[_0xba75('0xab')](loggerCatch(_0xba75('0x1af')));if(_0x215ef5[_0xba75('0x197')](0x5,_0xa4e914,_0x2de9aa)){if(_0x555ec7['countbusyretry']>=_0x2de9aa[_0xba75('0x199')]){_0x215ef5[_0xba75('0xfa')](_0x555ec7,_0x55205d,_0x325b2f,_0xba75('0x1b0'));}else{_0x215ef5[_0xba75('0x104')](_0x555ec7,_0x55205d,_0x325b2f,_0xba75('0x1b0'));}}break;case'8':_0x2de9aa[_0xba75('0x63')]+=0x1;_0x555ec7[_0xba75('0xa1')]=0x8;_0x555ec7[_0xba75('0xa2')]='Congestion';_0x555ec7['countcongestionretry']+=0x1;_0x555ec7[_0xba75('0xef')]+=0x1;ami[_0xba75('0x4c')]('custom:agentcongestion',ut['buildObj'](_0xa4e914,'congestion'));_0x215ef5[_0xba75('0xc7')](_0x555ec7)[_0xba75('0xab')](loggerCatch(_0xba75('0x1b1')));if(_0x215ef5['checkRetriveMax'](0x8,_0xa4e914,_0x2de9aa)){if(_0x555ec7[_0xba75('0x103')]>=_0x2de9aa[_0xba75('0x19c')]){_0x215ef5['createStateFinal'](_0x555ec7,_0x55205d,_0x325b2f,_0xba75('0x1b2'));}else{_0x215ef5[_0xba75('0x104')](_0x555ec7,_0x55205d,_0x325b2f,_0xba75('0x1b2'));}}break;case'11':_0x2de9aa['outboundAbandonedCallsDay']+=0x1;_0x555ec7[_0xba75('0xa1')]=0xb;_0x555ec7[_0xba75('0xa2')]=_0xba75('0x122');_0x555ec7[_0xba75('0xf4')]+=0x1;_0x555ec7[_0xba75('0xef')]+=0x1;_0x215ef5[_0xba75('0xc7')](_0x555ec7)['catch'](loggerCatch(_0xba75('0x127')));if(_0x215ef5['checkRetriveMax'](0xb,_0xa4e914,_0x2de9aa)){if(_0x555ec7[_0xba75('0xf4')]>=_0x2de9aa[_0xba75('0x124')]){_0x215ef5[_0xba75('0xfa')](_0x555ec7,_0x55205d,_0x325b2f,_0xba75('0x1b3'));}else{_0x215ef5[_0xba75('0x104')](_0x555ec7,_0x55205d,_0x325b2f,_0xba75('0x1b3'));}}break;case'20':_0x2de9aa[_0xba75('0x1b4')]+=0x1;_0x555ec7[_0xba75('0xa1')]=0x14;_0x555ec7[_0xba75('0xa2')]='AgentReject';_0x555ec7[_0xba75('0xf5')]+=0x1;_0x555ec7['countglobal']+=0x1;ami['emit'](_0xba75('0x1b5'),ut[_0xba75('0xe9')](_0xa4e914,_0xba75('0x1b6')));_0x215ef5[_0xba75('0xc7')](_0x555ec7)['catch'](loggerCatch(_0xba75('0x1b7')));if(_0x215ef5[_0xba75('0x197')](0x14,_0xa4e914,_0x2de9aa)){if(_0x555ec7['countagentrejectretry']>=_0x2de9aa[_0xba75('0x1a0')]){_0x215ef5[_0xba75('0xfa')](_0x555ec7,_0x55205d,_0x325b2f,_0xba75('0x1b8'));}else{_0x215ef5['stateGlobal'](_0x555ec7,_0x55205d,_0x325b2f,'reason\x2020\x20agentreject');}}break;default:_0x2de9aa[_0xba75('0x10d')]+=0x1;_0x555ec7[_0xba75('0xa1')]=0xc;_0x555ec7[_0xba75('0xa2')]=_0x20a895[_0xba75('0x1a4')];_0x215ef5[_0xba75('0xc7')](_0x555ec7)['catch'](loggerCatch(_0xba75('0x1b9')));if(_0x215ef5['checkRetriveMax'](_0x20a895['reason'],_0xa4e914,_0x2de9aa)){if(_0x555ec7[_0xba75('0xf0')]+_0x555ec7[_0xba75('0x103')]+_0x555ec7['countnoanswerretry']+_0x555ec7[_0xba75('0xf2')]+_0x555ec7[_0xba75('0xf3')]+_0x555ec7['countabandonedretry']+_0x555ec7['countmachineretry']+_0x555ec7[_0xba75('0xf5')]>=_0x2de9aa[_0xba75('0xf6')]){_0x215ef5['stateGlobal'](_0x555ec7,_0x55205d,_0x325b2f,_0x20a895[_0xba75('0x1a4')]);}else{_0x215ef5[_0xba75('0xfa')](_0x555ec7,_0x55205d,_0x325b2f,_0x20a895[_0xba75('0x1a4')]);}}}});};Dialer[_0xba75('0x1c')][_0xba75('0x104')]=function(_0x4556ad,_0x21bcb0,_0x1798a5,_0x3a0126){var _0x3cd9d1=new Final(_0x4556ad);_0x3cd9d1[_0xba75('0xa1')]=0xf;_0x3cd9d1['statedesc']='Global';this[_0xba75('0xfa')](_0x3cd9d1,_0x21bcb0,_0x1798a5,_0x3a0126);};Dialer[_0xba75('0x1c')]['createStateFinal']=function(_0xa41630,_0x3a7ace,_0x12c2c9,_0x5bc386){this[_0xba75('0xc6')](_0xa41630)['then'](function(){return _0x3a7ace(msgResponse(_0xba75('0x1a3'),_0xba75('0xd5'),_0x5bc386));})[_0xba75('0xab')](function(){return _0x12c2c9(msgResponse(_0xba75('0x1ba'),_0xba75('0x144'),_0xba75('0x1bb')));});};Dialer[_0xba75('0x1c')][_0xba75('0xa')]=function(_0x4c1f63){var _0x2e9622=_0x4c1f63[_0xba75('0x1bc')]/0x64;var _0x56bafa=_0x4c1f63[_0xba75('0x65')]/(_0x4c1f63['outboundDropCallsDayTimeout']+_0x4c1f63[_0xba75('0x61')]);var _0x34d95d=Math['round'](_0x4c1f63[_0xba75('0x1bd')]*(_0x4c1f63['predictiveIntervalMaxThreshold']/0x64));var _0x3465a5=Math['round'](_0x4c1f63['predictiveIntervalAvailable']*(_0x4c1f63[_0xba75('0x1be')]/0x64));var _0x3965d9=_0x4c1f63[_0xba75('0x9b')]+_0x4c1f63[_0xba75('0x56')];var _0x17d947=Math[_0xba75('0x1bf')](_0x4c1f63[_0xba75('0x71')]*_0x4c1f63[_0xba75('0x73')]*_0x4c1f63[_0xba75('0x1c0')]*_0x4c1f63[_0xba75('0x1c1')]);if(_[_0xba75('0x3d')](_0x4c1f63[_0xba75('0x75')])){if(!_[_0xba75('0x3d')](_0x4c1f63[_0xba75('0x74')])){_0x4c1f63[_0xba75('0x74')]=undefined;loggerPredictive[_0xba75('0x92')](_0xba75('0x1c2'),_0xba75('0x1c3'));}if(!_[_0xba75('0x3d')](_0x4c1f63[_0xba75('0x8e')])){loggerPredictive[_0xba75('0x92')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4c1f63[_0xba75('0x8e')]);_0x4c1f63['handlePredictive']=undefined;}_0x4c1f63[_0xba75('0x75')]=moment()[_0xba75('0x78')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xba75('0x7e')](_0x4c1f63[_0xba75('0x41')],_0xba75('0x1c4'),_0x4c1f63[_0xba75('0x75')]);this[_0xba75('0x158')](_0x4c1f63,0x1);}else if(ifInterval(_0x4c1f63[_0xba75('0x1c5')],_0x4c1f63[_0xba75('0x75')])){this['handlePower'](_0x4c1f63,0x1);loggerPredictiveCalls['info'](_0xba75('0x1c6'),_0x4c1f63[_0xba75('0x75')],_0x4c1f63[_0xba75('0x41')]);_0x4c1f63[_0xba75('0x71')]=0x0;_0x4c1f63['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x2e9622<_0x56bafa&&_0x4c1f63[_0xba75('0x1c7')]===_0xba75('0x1c8')){freeVariablesPredictive(_0x4c1f63);loggerPredictive[_0xba75('0x7e')](_0xba75('0x1c9'),_0xba75('0x1ca'),_0x56bafa,_0xba75('0x75'),_0x4c1f63['name']);}else if(_0x17d947<_0x4c1f63[_0xba75('0x6d')]&&_0x4c1f63[_0xba75('0x1c7')]===_0xba75('0x1c8')){freeVariablesPredictive(_0x4c1f63);loggerPredictive[_0xba75('0x7e')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xba75('0x1cb'),_0x17d947,_0xba75('0x1cc'),_0x4c1f63[_0xba75('0x6d')],_0xba75('0x75'),_0x4c1f63[_0xba75('0x41')]);}else if(!ifInterval(_0x4c1f63[_0xba75('0x1c5')],_0x4c1f63[_0xba75('0x75')])&&_[_0xba75('0x3d')](_0x4c1f63[_0xba75('0x74')])&&!_[_0xba75('0x3d')](_0x4c1f63[_0xba75('0x75')])){_0x4c1f63[_0xba75('0x74')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xba75('0x7e')](_0x4c1f63[_0xba75('0x41')],_0xba75('0x1cd'),_0x4c1f63[_0xba75('0x74')]);this[_0xba75('0xb8')](_0x4c1f63[_0xba75('0x1c5')])[_0xba75('0xb2')](this[_0xba75('0x1ce')](_0x4c1f63))[_0xba75('0xb2')](mergeDataErlangB(_0x4c1f63))['then'](this[_0xba75('0x1cf')](_0x4c1f63))[_0xba75('0xab')](loggerCatchPredictive(_0xba75('0x1d0'),_0x4c1f63));}else if(!ifInterval(_0x4c1f63[_0xba75('0x1c5')],_0x4c1f63['startPredictive'])){_0x4c1f63[_0xba75('0x6d')]=0x0;_0x4c1f63[_0xba75('0x74')]=moment()['format'](_0xba75('0x106'));loggerPredictive[_0xba75('0x7e')](_0x4c1f63[_0xba75('0x41')],_0xba75('0x1d1'),_0x4c1f63['startPredictive']);clearInterval(_0x4c1f63[_0xba75('0x8e')]);_0x4c1f63[_0xba75('0x8e')]=undefined;this[_0xba75('0xb8')](_0x4c1f63[_0xba75('0x1c5')])[_0xba75('0xb2')](this['getDataPredictive'](_0x4c1f63))[_0xba75('0xb2')](mergeDataErlangB(_0x4c1f63))[_0xba75('0xb2')](this[_0xba75('0x1cf')](_0x4c1f63))[_0xba75('0xab')](loggerCatchPredictive(_0xba75('0x1d2'),_0x4c1f63));}else if(_0x4c1f63[_0xba75('0x1bd')]&&_0x3965d9<_0x4c1f63[_0xba75('0x1bd')]-_0x3465a5){freeVariablesPredictive(_0x4c1f63);loggerPredictive[_0xba75('0x7e')](_0x4c1f63[_0xba75('0x41')],_0xba75('0x1d3'),_0x3965d9,')\x20are\x20less\x20than\x20threshold\x20(',_0x4c1f63[_0xba75('0x1bd')],'-',_0x3465a5,'=',_0x4c1f63[_0xba75('0x1bd')]-_0x3465a5,')');}else if(_0x4c1f63[_0xba75('0x1bd')]&&_0x3965d9>_0x4c1f63[_0xba75('0x1bd')]+_0x34d95d){freeVariablesPredictive(_0x4c1f63);loggerPredictive[_0xba75('0x7e')](_0x4c1f63['name'],_0xba75('0x1d3'),_0x3965d9,_0xba75('0x1d4'),_0x4c1f63['predictiveIntervalAvailable'],'+',_0x34d95d,'=',_0x4c1f63['predictiveIntervalAvailable']+_0x34d95d,')');}};Dialer[_0xba75('0x1c')][_0xba75('0x1ce')]=function(_0x584186){var _0x164cb1=this;return function(_0x2f6de0){return new BPromise(function(_0x52feed,_0x4fdcf2){_[_0xba75('0xcf')](_0x584186,_0x2f6de0[0x0]);if(checkGetDataPredictive(_0x2f6de0[0x0])){var _0x14e2c3=_0x584186[_0xba75('0x1bd')]=_0x584186[_0xba75('0x56')]+_0x584186['available'];var _0x8b28f2=_0x584186[_0xba75('0x1c5')]*0x3c;var _0x34ad90=_0x2f6de0[0x0][_0xba75('0x69')]+_0x2f6de0[0x0][_0xba75('0x83')];var _0x1f62a0=(_0x2f6de0[0x0]['predictiveIntervalAnsweredCalls']+_0x2f6de0[0x0][_0xba75('0x6b')]+_0x2f6de0[0x0][_0xba75('0x6a')])/_0x2f6de0[0x0][_0xba75('0x6f')];_0x584186[_0xba75('0x1c0')]=_0x1f62a0>0x0?_0x1f62a0:0x1;switch(_0x584186[_0xba75('0x1c7')]){case _0xba75('0x1c8'):var _0x38c7ef=_0x584186['dialPredictiveOptimizationPercentage']/0x64;return _0x164cb1['abandonmentRate'](_0x14e2c3,_0x8b28f2,_0x34ad90,_0x1f62a0,_0x38c7ef)[_0xba75('0xb2')](function(_0x217a86){return _0x52feed(_0x217a86);});case'agentBusyFactor':var _0xca96d9=_0x584186[_0xba75('0x1bc')]/0x64;return _0x164cb1[_0xba75('0x1d5')](_0x14e2c3,_0x8b28f2,_0x34ad90,_0x1f62a0,_0xca96d9)[_0xba75('0xb2')](function(_0x1af924){return _0x52feed(_0x1af924);});default:return _0x4fdcf2(msgResponse('[getDataPredictive]',_0xba75('0x144'),'Unknown\x20Predictive'));}}else{return _0x4fdcf2(msgResponse(_0xba75('0x1d6'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0xba75('0x1d7')]=function(_0x1f0e5d){var _0x23cdb8=this;return function(_0x3f55c0){return new BPromise(function(_0x1c0535,_0x5ffd92){_[_0xba75('0xcf')](_0x1f0e5d,_0x3f55c0[0x0]);if(checkGetDataPredictive(_0x3f55c0[0x0])){loggerPredictive[_0xba75('0x7e')](JSON['stringify'](_0x3f55c0[0x0]));if(_0x1f0e5d[_0xba75('0x1c7')]==='dropRate'){return _0x23cdb8['getVoiceQueueRtPauses'](_0x1f0e5d['id'])[_0xba75('0xb2')](function(_0x892cdc){var _0x165443=_0x1f0e5d[_0xba75('0x51')]-_0x892cdc[0x0][_0xba75('0x1d8')];var _0x3175e5=_0x1f0e5d[_0xba75('0x1c5')]*0x3c;var _0x14dbd5=_0x3f55c0[0x0][_0xba75('0x69')]+_0x3f55c0[0x0][_0xba75('0x83')];var _0x2b7050=(_0x3f55c0[0x0]['predictiveIntervalAnsweredCalls']+_0x3f55c0[0x0][_0xba75('0x6b')]+_0x3f55c0[0x0][_0xba75('0x6a')])/_0x3f55c0[0x0]['predictiveIntervalTotalCalls'];var _0x305a92=_0x1f0e5d[_0xba75('0x1bc')]/0x64;_0x1f0e5d[_0xba75('0x6e')]=_0x892cdc[0x0]['outboundQueuePauses']||0x0;_0x1f0e5d['predictiveIntervalHitRate']=_0x2b7050>0x0?_0x2b7050:0x1;return _0x23cdb8[_0xba75('0x1d9')](_0x165443,_0x3175e5,_0x14dbd5,_0x2b7050,_0x305a92);})[_0xba75('0xb2')](function(_0x5223ca){return _0x1c0535(_0x5223ca);})['catch'](function(_0x2065e7){return _0x5ffd92(msgResponse('[CatchErlangB]',_0xba75('0x144'),JSON[_0xba75('0x49')](_0x2065e7)));});}if(_0x1f0e5d['dialPredictiveOptimization']==='agentBusyFactor'){return _0x23cdb8[_0xba75('0xc4')](_0x1f0e5d['id'])[_0xba75('0xb2')](function(_0x4dfe3b){var _0x516a45=_0x1f0e5d['loggedIn']-_0x4dfe3b[0x0]['outboundQueuePauses'];var _0x13503a=_0x1f0e5d[_0xba75('0x1c5')]*0x3c;var _0x560173=_0x3f55c0[0x0][_0xba75('0x69')]+_0x3f55c0[0x0][_0xba75('0x83')];var _0x3e99b4=(_0x3f55c0[0x0]['predictiveIntervalAnsweredCalls']+_0x3f55c0[0x0][_0xba75('0x6b')]+_0x3f55c0[0x0][_0xba75('0x6a')])/_0x3f55c0[0x0][_0xba75('0x6f')];var _0x3e7416=_0x1f0e5d[_0xba75('0x1bc')]/0x64;_0x1f0e5d['predictiveIntervalPauses']=_0x4dfe3b[0x0][_0xba75('0x1d8')]||0x0;_0x1f0e5d[_0xba75('0x1c0')]=_0x3e99b4>0x0?_0x3e99b4:0x1;return _0x23cdb8['busyFactor'](_0x516a45,_0x13503a,_0x560173,_0x3e99b4,_0x3e7416);})[_0xba75('0xb2')](function(_0x3cedb1){return _0x1c0535(_0x3cedb1);})['catch'](function(_0x588029){return _0x5ffd92(msgResponse(_0xba75('0x1da'),_0xba75('0x144'),JSON[_0xba75('0x49')](_0x588029)));});}}else{return _0x5ffd92(msgResponse(_0xba75('0x1d6'),_0xba75('0x144'),_0xba75('0x1db')));}});};};Dialer[_0xba75('0x1c')][_0xba75('0x1cf')]=function(_0x540c52){var _0x52070b=this;return function(){var _0x31de47=0x0;var _0x51838c=Math[_0xba75('0x1bf')](_0x540c52[_0xba75('0x72')]*0x3e8);if(_0x51838c>0x0){_0x51838c=_0x51838c<0x64?0x64:_0x51838c;loggerPredictive[_0xba75('0x7e')](_0x540c52[_0xba75('0x41')],_0xba75('0x1dc'),_0x51838c,_0xba75('0x4a'));_0x540c52[_0xba75('0x8e')]=setInterval(function(){_0x52070b[_0xba75('0x8e')](_0x540c52);loggerPredictiveCalls[_0xba75('0x7e')](_0xba75('0x1dd'),_0x31de47+=0x1);},_0x51838c);}else{loggerPredictive[_0xba75('0x7e')](_0x540c52[_0xba75('0x41')],_0xba75('0x1de'));}};};Dialer['prototype'][_0xba75('0x1df')]=function(_0x46e478,_0x59e66e){var _0x3eb63c=this;return function(_0x359928){if(_[_0xba75('0x46')](_0x359928)){if(_[_0xba75('0xdd')](_0x59e66e[_0xba75('0xd2')])||!_0x59e66e['recallme']){if(_0x46e478[_0xba75('0x5b')]==='booked'){_0x46e478[_0xba75('0x12e')]=_['isUndefined'](_0x46e478[_0xba75('0x12e')])?!![]:_0x46e478[_0xba75('0x12e')];var _0x36682e=uuid['v4']();_0x3eb63c[_0xba75('0xa6')][_0x36682e]=new Action(_0x46e478,_0x59e66e,_0x36682e);loggerBooked['info'](_0xba75('0x1e0'),_0x36682e,_0xba75('0x1e1'),JSON['stringify'](_0x46e478['queueStatusComplete']),_0xba75('0x1e2'),_0x46e478[_0xba75('0x41')]);if(_0x46e478['queueStatusComplete']){_0x46e478[_0xba75('0x12e')]=![];_0x3eb63c[_0xba75('0x12c')][_0x3eb63c[_0xba75('0xa6')][_0x36682e]['queue']]=[];ami[_0xba75('0xa8')]({'actionid':_0x36682e,'action':_0xba75('0x1e3'),'queue':_0x46e478[_0xba75('0x41')]})[_0xba75('0xab')](function(){_0x3eb63c['updateOriginated'](_0x46e478);_0x3eb63c[_0xba75('0xbb')]({'active':![],'ContactId':_0x3eb63c[_0xba75('0xa6')][_0x36682e]['ContactId'],'ListId':_0x3eb63c[_0xba75('0xa6')][_0x36682e]['ListId'],'VoiceQueueId':_0x3eb63c['actions'][_0x36682e][_0xba75('0xd3')]||undefined,'CampaignId':_0x3eb63c['actions'][_0x36682e][_0xba75('0xfe')]||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0x1e4')));delete _0x3eb63c['actions'][_0x36682e];});}else{loggerBooked[_0xba75('0x7e')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x46e478[_0xba75('0x12e')]),'Queue:\x20',_0x46e478[_0xba75('0x41')]);_0x3eb63c[_0xba75('0xae')](_0x46e478);_0x3eb63c[_0xba75('0xbb')]({'active':![],'ContactId':_0x3eb63c[_0xba75('0xa6')][_0x36682e]['ContactId'],'ListId':_0x3eb63c['actions'][_0x36682e][_0xba75('0xfd')],'VoiceQueueId':_0x3eb63c[_0xba75('0xa6')][_0x36682e][_0xba75('0xd3')]||undefined,'CampaignId':_0x3eb63c[_0xba75('0xa6')][_0x36682e][_0xba75('0xfe')]||undefined})[_0xba75('0xab')](loggerCatch(_0xba75('0x1e4')));delete _0x3eb63c[_0xba75('0xa6')][_0x36682e];}}else{return _0x3eb63c[_0xba75('0x1e5')](_0x46e478,_0x59e66e);}}else{if(getDiff(_0x59e66e[_0xba75('0x1e6')])<_0x46e478['dialRecallMeTimeout']*0x3c){if(_0x59e66e[_0xba75('0x1e7')]&&!_0x59e66e[_0xba75('0x1e7')]['voicePause']){_0x3eb63c[_0xba75('0x21')][_0xba75('0x130')](_0x59e66e['id'])[_0xba75('0x1f')](function(){_0x3eb63c[_0xba75('0xae')](_0x46e478);});}else{_0x3eb63c['unlockContact']({'active':![]},_0x59e66e['id'],0x1)[_0xba75('0x1f')](function(){_0x3eb63c[_0xba75('0xae')](_0x46e478);});}}else{_0x46e478[_0xba75('0x1e8')]+=0x1;_0x3eb63c[_0xba75('0xae')](_0x46e478);if(_0x46e478['dialRecallInQueue']){_0x3eb63c[_0xba75('0xbb')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x59e66e[_0xba75('0xd1')],'ListId':_0x59e66e[_0xba75('0xfd')],'VoiceQueueId':_0x59e66e[_0xba75('0xd3')]||undefined,'CampaignId':_0x59e66e[_0xba75('0xfe')]||undefined})[_0xba75('0xab')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3eb63c[_0xba75('0xc7')](createObjHistory(_0x46e478,_0x59e66e,_0xba75('0x1e9'),0x17,'RecallInQueue'))[_0xba75('0xab')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x3eb63c[_0xba75('0xce')](createObjHistory(_0x46e478,_0x59e66e,_0xba75('0x1ea'),0x16,_0xba75('0x1eb')),_0xba75('0x1ec'),_0xba75('0x1ed'));}}}}else{_0x46e478[_0xba75('0x62')]+=0x1;_0x3eb63c['saveInDb'](createObjHistory(_0x46e478,_0x59e66e,_0xba75('0x1ee'),0xd,_0xba75('0x1ef')),_0xba75('0x1f0'),_0xba75('0x1f1'));throw _0xba75('0x1f2');}};};Dialer[_0xba75('0x1c')][_0xba75('0x15d')]=function(_0x5bb4fa){var _0x25e8da=this;var _0x472a26=_0x5bb4fa[_0xba75('0x1f3')]-_0x5bb4fa['originated']-_0x5bb4fa[_0xba75('0xc0')];emitCampaignSummary(_0x5bb4fa);if(_0x472a26>0x0){if(_0x472a26>this[_0xba75('0x26')]){_0x472a26=this[_0xba75('0x26')];}_0x5bb4fa[_0xba75('0xc0')]+=_0x472a26;this[_0xba75('0xc2')](_0x5bb4fa['id'],_0x472a26,_0x5bb4fa[_0xba75('0x1f4')],_0x5bb4fa)['then'](function(_0x133008){_0x5bb4fa[_0xba75('0xc0')]-=_0x472a26;_0x5bb4fa['temp']=_0x5bb4fa[_0xba75('0xc0')]>0x0?_0x5bb4fa[_0xba75('0xc0')]:0x0;if(!checkContactEmpty(_0x133008)){_0x5bb4fa[_0xba75('0x43')]=_0xba75('0x1f5');logger[_0xba75('0x7e')]('[getContactCampaign2][Empty]'+_0x5bb4fa['name']);}else{_0x5bb4fa[_0xba75('0x70')]+=_0x133008[_0xba75('0x14a')];_0x5bb4fa[_0xba75('0x43')]='RUNNING';for(var _0x42b6ae=0x0;_0x42b6ae<_0x133008[_0xba75('0x14a')];_0x42b6ae+=0x1){_0x5bb4fa[_0xba75('0x1f6')]+=0x1;if(_[_0xba75('0xdd')](_0x133008[_0x42b6ae])||_[_0xba75('0xdd')](_0x133008[_0x42b6ae][_0xba75('0x169')])||_[_0xba75('0xdd')](_0x133008[_0x42b6ae][_0xba75('0x169')][_0xba75('0x18a')])){_0x25e8da[_0xba75('0xcc')](_0xba75('0x1f7'),_0x5bb4fa,_0x133008[_0x42b6ae]);}else{_0x25e8da['checkIsBlackListIvr'](_['pick'](_0x133008[_0x42b6ae],['CampaignId',_0xba75('0x1f8')]))[_0xba75('0xb2')](_0x25e8da[_0xba75('0x1df')](_0x5bb4fa,_0x133008[_0x42b6ae]))[_0xba75('0xab')](_0x25e8da['loggerHandler'](_0xba75('0x1f9'),_0x5bb4fa));}}}})['catch'](loggerGetContactDialer(_0xba75('0x1fa'),_0x5bb4fa,_0x472a26));}};Dialer[_0xba75('0x1c')][_0xba75('0x158')]=function(_0x4f8a1e,_0x1d6e27){var _0x5e0b72=this;var _0x3e048e=[];var _0x2131e1=_0x1d6e27>=0x1?_0x1d6e27:0x1;if(_0x4f8a1e[_0xba75('0x5b')]===_0xba75('0x9')){_0x2131e1=0x1;}var _0x3c1ff8=Math[_0xba75('0x1bf')](_0x4f8a1e[_0xba75('0x9b')]*_0x2131e1)-_0x4f8a1e[_0xba75('0x70')]-_0x4f8a1e[_0xba75('0xc0')];emitVoiceQueueSummary(_0x4f8a1e);if(_0x4f8a1e[_0xba75('0x1fb')]>0x0){var _0x573a95=_0x4f8a1e[_0xba75('0x1fb')]-_0x4f8a1e[_0xba75('0x70')]-_0x4f8a1e[_0xba75('0x56')]-_0x4f8a1e['temp']-_0x4f8a1e['pTalking'];if(_0x3c1ff8>_0x573a95){_0x3c1ff8=_0x573a95;}}if(_0x3c1ff8>0x0){if(_0x4f8a1e[_0xba75('0x5b')]===_0xba75('0x9')){_0x3c1ff8=0x1;}if(_0x3c1ff8>this[_0xba75('0x26')]){_0x3c1ff8=this['maxNumberOriginate'];}_0x4f8a1e[_0xba75('0xc0')]+=_0x3c1ff8;for(var _0x3c730b in this[_0xba75('0x24')]){if(typeof this[_0xba75('0x24')][_0x3c730b]!==_0xba75('0x95')){if(this[_0xba75('0x24')][_0x3c730b][_0xba75('0xa1')]==='not_inuse'&&this[_0xba75('0x24')][_0x3c730b][_0xba75('0xa9')]==='reachable'){_0x3e048e[_0xba75('0x14b')](this[_0xba75('0x24')][_0x3c730b]['id']);}}}this[_0xba75('0xbf')](_0x4f8a1e['id'],_0x3e048e,_0x3c1ff8,_0x4f8a1e['dialOrderByScheduledAt'],_0x4f8a1e)[_0xba75('0xb2')](function(_0x3ff02b){_0x4f8a1e['temp']-=_0x3c1ff8;_0x4f8a1e[_0xba75('0xc0')]=_0x4f8a1e[_0xba75('0xc0')]>0x0?_0x4f8a1e['temp']:0x0;if(!checkContactEmpty(_0x3ff02b)){_0x5e0b72['countReScheduled'](_0x4f8a1e)[_0xba75('0xb2')](sendMessageReschedule(_0x4f8a1e))[_0xba75('0xab')](loggerCatch(_0xba75('0xb3')));}else{_0x4f8a1e[_0xba75('0x70')]+=_0x3ff02b[_0xba75('0x14a')];_0x4f8a1e[_0xba75('0x43')]=_0x4f8a1e['dialMethod']===_0xba75('0x9')?_0xba75('0x170'):'RUNNING';for(var _0x5a0f89=0x0;_0x5a0f89<_0x3ff02b[_0xba75('0x14a')];_0x5a0f89+=0x1){if(_[_0xba75('0xdd')](_0x3ff02b[_0x5a0f89])||_[_0xba75('0xdd')](_0x3ff02b[_0x5a0f89][_0xba75('0x169')])||_['isNil'](_0x3ff02b[_0x5a0f89][_0xba75('0x169')][_0xba75('0x18a')])){_0x5e0b72[_0xba75('0xcc')](_0xba75('0x1f7'),_0x4f8a1e,_0x3ff02b[_0x5a0f89]);}else{_0x5e0b72[_0xba75('0xb4')](_[_0xba75('0xd0')](_0x3ff02b[_0x5a0f89],[_0xba75('0xd3'),_0xba75('0x1f8')]))[_0xba75('0xb2')](_0x5e0b72[_0xba75('0x1df')](_0x4f8a1e,_0x3ff02b[_0x5a0f89]))[_0xba75('0xab')](_0x5e0b72[_0xba75('0xcb')](_0xba75('0x1f7'),_0x4f8a1e));}}}})[_0xba75('0xab')](loggerGetContactDialer(_0xba75('0x1fc'),_0x4f8a1e,_0x3c1ff8));}};Dialer[_0xba75('0x1c')]['handlePredictive']=function(_0x4a9a6e){if(_0x4a9a6e[_0xba75('0x1fb')]>0x0){var _0x2531f6=_0x4a9a6e[_0xba75('0x1fb')]-_0x4a9a6e[_0xba75('0x70')]-_0x4a9a6e[_0xba75('0x56')];if(_0x2531f6>0x0){this[_0xba75('0x1fd')](_0x4a9a6e);}else{loggerPredictiveCalls[_0xba75('0x7e')](_0xba75('0x1fe'));}}else{this[_0xba75('0x1fd')](_0x4a9a6e);}};Dialer[_0xba75('0x1c')][_0xba75('0x1fd')]=function(_0x4a8f1d){var _0x31357b=this;var _0x204cc8=[];_0x4a8f1d[_0xba75('0x70')]+=0x1;for(var _0x2227b2 in this['agents']){if(typeof this['agents'][_0x2227b2]!==_0xba75('0x95')){if(this['agents'][_0x2227b2][_0xba75('0xa1')]==='not_inuse'&&this[_0xba75('0x24')][_0x2227b2]['status']==='reachable'){_0x204cc8[_0xba75('0x14b')](this[_0xba75('0x24')][_0x2227b2]['id']);}}}this[_0xba75('0xbf')](_0x4a8f1d['id'],_0x204cc8,0x1,_0x4a8f1d[_0xba75('0x1f4')],_0x4a8f1d)['then'](function(_0x11c3df){if(!checkContactEmpty(_0x11c3df)){checkContactLowerLimitOriginate(_0x4a8f1d,0x1,0x0);_0x31357b[_0xba75('0xb0')](_0x4a8f1d)['then'](sendMessageReschedule(_0x4a8f1d))[_0xba75('0xab')](loggerCatch(_0xba75('0xb3')));}else{_0x4a8f1d[_0xba75('0x43')]=_0xba75('0x1ff');if(_[_0xba75('0xdd')](_0x11c3df[0x0])||_[_0xba75('0xdd')](_0x11c3df[0x0][_0xba75('0x169')])||_[_0xba75('0xdd')](_0x11c3df[0x0][_0xba75('0x169')][_0xba75('0x18a')])){_0x31357b[_0xba75('0xcc')]('[actionOriginate]\x20',_0x4a8f1d,_0x11c3df[0x0]);}else{_0x31357b[_0xba75('0xb4')](_[_0xba75('0xd0')](_0x11c3df[0x0],[_0xba75('0xd3'),_0xba75('0x1f8')]))[_0xba75('0xb2')](_0x31357b[_0xba75('0x1df')](_0x4a8f1d,_0x11c3df[0x0]))['catch'](_0x31357b[_0xba75('0xcb')](_0xba75('0x200'),_0x4a8f1d));}}})['catch'](loggerGetContactDialer(_0xba75('0x201'),_0x4a8f1d,0x1));emitVoiceQueueSummary(_0x4a8f1d);};Dialer[_0xba75('0x1c')][_0xba75('0x1d9')]=function(_0x2a3d79,_0x212e70,_0x44194f,_0x43fbe2,_0x11d188,_0x466cd1){loggerPredictive['info'](_0xba75('0x202'));loggerPredictive[_0xba75('0x7e')](_0xba75('0x203'),_0x2a3d79);loggerPredictive['info'](_0xba75('0x204'),_0x212e70);loggerPredictive[_0xba75('0x7e')]('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',_0x44194f);loggerPredictive[_0xba75('0x7e')](_0xba75('0x205'),_0x43fbe2);loggerPredictive[_0xba75('0x7e')](_0xba75('0x206'),_0x11d188);loggerPredictive[_0xba75('0x7e')](_0xba75('0x85'));return new BPromise(function(_0x39b5bb,_0x2d280e){if(_0x2a3d79<=0x0||isNaN(_0x2a3d79)){return _0x2d280e(msgResponse(_0xba75('0x207'),_0xba75('0x48'),'m\x20=\x20'+_0x2a3d79));}if(_0x44194f<=0x0||isNaN(_0x44194f)){return _0x2d280e(msgResponse(_0xba75('0x207'),_0xba75('0x48'),_0xba75('0x208')+_0x44194f));}if(_0x43fbe2<=0x0||isNaN(_0x43fbe2)){return _0x2d280e(msgResponse(_0xba75('0x207'),'Error',_0xba75('0x209')+_0x43fbe2));}if(_0x212e70<=0x0||isNaN(_0x212e70)){return _0x2d280e(msgResponse(_0xba75('0x207'),_0xba75('0x48'),_0xba75('0x20a')+_0x212e70));}if(_0x11d188<=0x0||isNaN(_0x11d188)){return _0x2d280e(msgResponse(_0xba75('0x207'),'Error',_0xba75('0x20b')+_0x11d188));}_0x466cd1=_0x466cd1||0x0;var _0x530adb=0x1/_0x44194f;var _0x198b0f=0x0;var _0x7fb65b=0x0;var _0x3f370a=0x0;var _0x5e46a4=0x0;for(var _0x1b6895=0x0;_0x3f370a<_0x11d188;_0x1b6895+=0x1){_0x7fb65b=_0x1b6895/_0x212e70;_0x198b0f=(_0x43fbe2*_0x7fb65b+_0x466cd1)/_0x530adb;_0x3f370a=erlangb(_0x198b0f,_0x2a3d79);_0x5e46a4=_0x198b0f/_0x2a3d79*(0x1-erlangb(_0x198b0f,_0x2a3d79));}return _0x39b5bb({'erlangCalls':_0x1b6895,'erlangCallToSecond':_0x212e70/_0x1b6895,'erlangAbandonmentRate':_0x3f370a,'erlangBusyFactor':_0x5e46a4});});};Dialer[_0xba75('0x1c')][_0xba75('0x1d5')]=function(_0x120b9b,_0x4cab21,_0x51bc2e,_0x1c754b,_0x348dec,_0x239dc3){loggerPredictive[_0xba75('0x7e')](_0xba75('0x20c'));loggerPredictive[_0xba75('0x7e')](_0xba75('0x203'),_0x120b9b);loggerPredictive['info'](_0xba75('0x204'),_0x4cab21);loggerPredictive[_0xba75('0x7e')](_0xba75('0x20d'),_0x51bc2e);loggerPredictive[_0xba75('0x7e')](_0xba75('0x205'),_0x1c754b);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x348dec);loggerPredictive[_0xba75('0x7e')](_0xba75('0x85'));return new BPromise(function(_0x383341,_0x34e062){if(_0x120b9b<=0x0||isNaN(_0x120b9b)){return _0x34e062(msgResponse(_0xba75('0x20e'),_0xba75('0x48'),_0xba75('0x20f')+_0x120b9b));}if(_0x51bc2e<=0x0||isNaN(_0x51bc2e)){return _0x34e062(msgResponse(_0xba75('0x20e'),_0xba75('0x48'),_0xba75('0x208')+_0x51bc2e));}if(_0x1c754b<=0x0||isNaN(_0x1c754b)){return _0x34e062(msgResponse(_0xba75('0x20e'),_0xba75('0x48'),_0xba75('0x209')+_0x1c754b));}if(_0x4cab21<=0x0||isNaN(_0x4cab21)){return _0x34e062(msgResponse('[busyFactor]',_0xba75('0x48'),_0xba75('0x20a')+_0x4cab21));}if(_0x348dec<=0x0||isNaN(_0x348dec)){return _0x34e062(msgResponse(_0xba75('0x20e'),'Error','Umin\x20=\x20'+_0x348dec));}_0x239dc3=_0x239dc3||0x0;var _0x592eb2=0x1/_0x51bc2e;var _0x52eaaa=0x0;var _0x4112bc=0x0;var _0x423ad1=0x0;var _0x86ff3=0x0;for(var _0x23efee=0x0;_0x86ff3<_0x348dec;_0x23efee+=0x1){_0x4112bc=_0x23efee/_0x4cab21;_0x52eaaa=(_0x1c754b*_0x4112bc+_0x239dc3)/_0x592eb2;_0x423ad1=erlangb(_0x52eaaa,_0x120b9b);_0x86ff3=_0x52eaaa/_0x120b9b*(0x1-erlangb(_0x52eaaa,_0x120b9b));}return _0x383341({'erlangCalls':_0x23efee,'erlangCallToSecond':_0x4cab21/_0x23efee,'erlangAbandonmentRate':_0x423ad1,'erlangBusyFactor':_0x86ff3});});};module[_0xba75('0x210')]=Dialer;
\ No newline at end of file
+var _0xb903=['\x22%s\x22\x20<%s>','inspect','error','stack','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','NOT_ACTIVE','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','[uniqueid]','clearZombieChannels','actions','[actions]','enqueue','isNil','Action','status','channel','catch','No\x20such\x20channel','ivr','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','uniqueid','variable','amdstatus','xcally-motion-dialer','dialAMDActive','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','Machine','countmachineretry','countglobal','buildObj','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','value','HANGUP','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countcongestionretry','dialGlobalMaxRetry','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','[syncHangupIvr][createHistory]','moveContactManagedDialer','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','syncAgentComplete','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridname','actionid','locked','stateinterface','rrmemory','push','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','indexOf','true','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','predictive','booked','method\x20not\x20recognized','launchHandleIvr','handleIvr','loggedIn','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','syncCampaigns','\x5cw{0,','pow','replace','random','match','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-CAMPAIGNID','tags','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','stateGlobal','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','reason\x2020\x20agentreject','Global','[callProgressDetecting]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','dialPredictiveInterval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','[booked][checkContactBlack]','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','floor','dialLimitQueue','not_inuse','getContactDialer','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\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','Umin\x20=\x20','util','lodash','bluebird','uuid','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictiveCalls','syncQueueSummary','../ami','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./final','./agentComplete','./queueCallerAbandon','XCALLY_IP_AGI','roundrobin','prototype','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','syncQueueCallerAbandon','bind','originateresponse','syncOriginateResponse','custom:queuesummary','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','\x20AGENTS\x20NOT\x20LOGGED','name','\x20NOT\x20Active','\x20INTERVAL_IS_NULL','Interval','INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','answered','available','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','isEmpty'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xb903,0x185));var _0x3b90=function(_0x5295cd,_0x1e144d){_0x5295cd=_0x5295cd-0x0;var _0x449640=_0xb903[_0x5295cd];return _0x449640;};'use strict';var util=require(_0x3b90('0x0'));var _=require(_0x3b90('0x1'));var BPromise=require(_0x3b90('0x2'));var uuid=require(_0x3b90('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x3b90('0x4'));var Redis=require(_0x3b90('0x5'));var ut=require(_0x3b90('0x6'));var config=require(_0x3b90('0x7'));var logger=require(_0x3b90('0x8'))(_0x3b90('0x9'));var loggerBooked=require(_0x3b90('0x8'))('booked');var loggerPredictive=require(_0x3b90('0x8'))('predictive');var loggerPredictiveCalls=require('../../../config/logger')(_0x3b90('0xa'));var loggerSyncQueueSummary=require(_0x3b90('0x8'))(_0x3b90('0xb'));var ami=require(_0x3b90('0xc'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var cmHopper=require(_0x3b90('0xd'));var cmHopperHistory=require(_0x3b90('0xe'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x3b90('0xf'));var Action=require(_0x3b90('0x10'));var History=require('./history');var Final=require(_0x3b90('0x11'));var AgentComplete=require(_0x3b90('0x12'));var QueueCallerAbandon=require(_0x3b90('0x13'));var Hangup=require('./hangup');var ipAgi=process['env'][_0x3b90('0x14')]||'127.0.0.1';var strategy={'rrmemory':'rrmemory','roundrobin':_0x3b90('0x15')};var Sequence=function(){};Sequence[_0x3b90('0x16')]['enqueue']=function(_0x51fb66){this[_0x3b90('0x17')]=this[_0x3b90('0x17')]?this[_0x3b90('0x17')][_0x3b90('0x18')](_0x51fb66):_0x51fb66();};function Dialer(_0x1efe01,_0x529421){this['sequence']=new Sequence();this[_0x3b90('0x19')]=_0x529421;this[_0x3b90('0x1a')]=_0x1efe01['voiceQueues'];this[_0x3b90('0x1b')]=_0x1efe01[_0x3b90('0x1b')];this[_0x3b90('0x1c')]=_0x1efe01[_0x3b90('0x1c')];this['trunks']=_0x1efe01[_0x3b90('0x1d')];this['maxNumberOriginate']=config[_0x3b90('0x1e')]||0x2;this[_0x3b90('0x1f')]={};this['actions']={};this[_0x3b90('0x20')]={};this[_0x3b90('0x21')]={};this[_0x3b90('0x22')]={};this[_0x3b90('0x23')]={};this[_0x3b90('0x24')]={};this[_0x3b90('0x25')]={};this[_0x3b90('0x26')]={};this[_0x3b90('0x27')]={};ami['on'](_0x3b90('0x28'),this[_0x3b90('0x29')]['bind'](this));ami['on'](_0x3b90('0x2a'),this[_0x3b90('0x2b')][_0x3b90('0x2c')](this));ami['on'](_0x3b90('0x2d'),this[_0x3b90('0x2e')][_0x3b90('0x2c')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x3b90('0x2c')](this));ami['on'](_0x3b90('0x2f'),this[_0x3b90('0xb')][_0x3b90('0x2c')](this));ami['on']('hangup',this[_0x3b90('0x30')][_0x3b90('0x2c')](this));ami['on'](_0x3b90('0x31'),this['syncNewExten'][_0x3b90('0x2c')](this));ami['on'](_0x3b90('0x32'),this[_0x3b90('0x33')][_0x3b90('0x2c')](this));ami['on'](_0x3b90('0x34'),this[_0x3b90('0x35')]['bind'](this));ami['on'](_0x3b90('0x36'),this['syncQueueStatusComplete'][_0x3b90('0x2c')](this));this[_0x3b90('0x37')]();this[_0x3b90('0x38')]();}function isNotNull(_0x38eed0){return _0x38eed0!==null&&!_[_0x3b90('0x39')](_0x38eed0);}function checkIsLoggedIn(_0x6704f,_0x290283){return function(){if(_0x290283<=0x0){_0x6704f[_0x3b90('0x3a')]='AGENTS_NOT_LOGGED';throw _0x6704f['name']+_0x3b90('0x3b');}};}function isActive(_0x199f73){return _0x199f73;}function checkIsActive(_0x23484a,_0x1c2e84){return function(){if(!isActive(_0x1c2e84)){_0x23484a['message']='NOT_ACTIVE';throw _0x23484a[_0x3b90('0x3c')]+_0x3b90('0x3d');}};}function checkInterval(_0x24d5c9){return function(){if(!isNotNull(_0x24d5c9['Interval'])){_0x24d5c9[_0x3b90('0x3a')]='INTERVAL_IS_NULL';throw _0x24d5c9['name']+_0x3b90('0x3e');}if(!isNotNull(_0x24d5c9[_0x3b90('0x3f')]['Intervals'])){_0x24d5c9[_0x3b90('0x3a')]=_0x3b90('0x40');throw _0x24d5c9[_0x3b90('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x24d5c9[_0x3b90('0x3f')][_0x3b90('0x41')]))){_0x24d5c9[_0x3b90('0x3a')]=_0x3b90('0x40');throw _0x24d5c9['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x25ff34,_0x6fd698,_0x524691){return{'action':_0x25ff34,'response':_0x6fd698,'message':_0x524691,'stack':_0x524691};}function myreject(_0x57946d){return function(_0x201712){return _0x57946d(msgResponse(_0x3b90('0x42'),_0x3b90('0x43'),JSON[_0x3b90('0x44')](_0x201712)));};}function getSeconds(_0x5a3266,_0x2154e2){var _0x583842=moment(_0x5a3266)[_0x3b90('0x45')](0x0);var _0x43bae5=moment(_0x2154e2)[_0x3b90('0x45')](0x0);return _0x583842[_0x3b90('0x46')](_0x43bae5,_0x3b90('0x47'));}function emit(_0x3bf148,_0x96f7f3,_0x534bea){io['to'](_0x3bf148)[_0x3b90('0x48')](_0x96f7f3,_0x534bea);}function emitVoiceQueueSummary(_0x2b0a5b){if(_0x2b0a5b[_0x3b90('0x49')]===_0x3b90('0x4a')){var _0x3d6040={'id':_0x2b0a5b['id'],'name':_0x2b0a5b[_0x3b90('0x3c')],'strategy':_0x2b0a5b[_0x3b90('0x4b')],'answered':_0x2b0a5b[_0x3b90('0x4c')],'available':_0x2b0a5b[_0x3b90('0x4d')],'loggedIn':_0x2b0a5b['loggedIn'],'pTalking':_0x2b0a5b[_0x3b90('0x4e')],'sumBillable':_0x2b0a5b[_0x3b90('0x4f')],'sumDuration':_0x2b0a5b[_0x3b90('0x50')],'sumHoldTime':_0x2b0a5b[_0x3b90('0x51')]||0x0,'talking':_0x2b0a5b[_0x3b90('0x52')],'total':_0x2b0a5b[_0x3b90('0x53')],'type':_0x2b0a5b[_0x3b90('0x49')],'unmanaged':_0x2b0a5b[_0x3b90('0x54')],'abandoned':_0x2b0a5b[_0x3b90('0x55')],'waiting':_0x2b0a5b[_0x3b90('0x56')],'loggedInDb':_0x2b0a5b[_0x3b90('0x57')],'dialActive':_0x2b0a5b[_0x3b90('0x58')],'dialMethod':_0x2b0a5b[_0x3b90('0x59')],'dialOriginateCallerIdName':_0x2b0a5b[_0x3b90('0x5a')],'dialOriginateCallerIdNumber':_0x2b0a5b[_0x3b90('0x5b')],'dialOriginateTimeout':_0x2b0a5b[_0x3b90('0x5c')],'dialPrefix':_0x2b0a5b[_0x3b90('0x5d')],'outboundAnswerAgiCallsDay':_0x2b0a5b[_0x3b90('0x5e')],'outboundAnswerCallsDay':_0x2b0a5b[_0x3b90('0x5f')],'outboundBlacklistCallsDay':_0x2b0a5b[_0x3b90('0x60')],'outboundBusyCallsDay':_0x2b0a5b[_0x3b90('0x61')],'outboundCongestionCallsDay':_0x2b0a5b['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2b0a5b[_0x3b90('0x62')],'outboundDropCallsDayCallersExit':_0x2b0a5b[_0x3b90('0x63')],'outboundDropCallsDayTimeout':_0x2b0a5b[_0x3b90('0x64')],'outboundNoAnswerCallsDay':_0x2b0a5b[_0x3b90('0x65')],'outboundNoSuchCallsDay':_0x2b0a5b['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x2b0a5b[_0x3b90('0x66')],'outboundReCallsDay':_0x2b0a5b['outboundReCallsDay'],'outboundRejectCallsDay':_0x2b0a5b['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x2b0a5b[_0x3b90('0x67')],'predictiveIntervalAnsweredCalls':_0x2b0a5b[_0x3b90('0x68')],'predictiveIntervalAvgHoldtime':_0x2b0a5b['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x2b0a5b[_0x3b90('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x2b0a5b[_0x3b90('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x2b0a5b[_0x3b90('0x6b')],'predictiveIntervalErlangCalls':_0x2b0a5b[_0x3b90('0x6c')],'predictiveIntervalErlangCallsDroppedCalls':_0x2b0a5b[_0x3b90('0x6d')],'predictiveIntervalHitRate':_0x2b0a5b[_0x3b90('0x6e')],'predictiveIntervalMultiplicativeFactor':_0x2b0a5b[_0x3b90('0x6f')],'predictiveIntervalPauses':_0x2b0a5b[_0x3b90('0x70')],'predictiveIntervalAvailable':_0x2b0a5b[_0x3b90('0x71')],'predictiveIntervalTotalCalls':_0x2b0a5b['predictiveIntervalTotalCalls'],'message':_0x2b0a5b[_0x3b90('0x3a')],'originated':_0x2b0a5b[_0x3b90('0x72')],'erlangCalls':_0x2b0a5b['erlangCalls'],'erlangCallToSecond':_0x2b0a5b[_0x3b90('0x73')],'erlangAbandonmentRate':_0x2b0a5b[_0x3b90('0x74')],'erlangBusyFactor':_0x2b0a5b[_0x3b90('0x75')],'startPredictive':_0x2b0a5b[_0x3b90('0x23')],'startProgressive':_0x2b0a5b[_0x3b90('0x24')]};if(_0x2b0a5b['Trunk']){_0x3d6040['Trunk']={'id':_0x2b0a5b[_0x3b90('0x76')]['id'],'name':_0x2b0a5b['Trunk'][_0x3b90('0x3c')],'active':_0x2b0a5b[_0x3b90('0x76')][_0x3b90('0x77')],'callerid':_0x2b0a5b[_0x3b90('0x76')][_0x3b90('0x78')]};}if(_0x2b0a5b['Interval']){_0x3d6040['Interval']={'id':_0x2b0a5b[_0x3b90('0x3f')]['id'],'name':_0x2b0a5b[_0x3b90('0x3f')][_0x3b90('0x3c')]};}var _0x5d7333=md5(JSON[_0x3b90('0x44')](_0x3d6040));if(_0x2b0a5b[_0x3b90('0x4')]!==_0x5d7333){_0x2b0a5b[_0x3b90('0x4')]=_0x5d7333;emit(util[_0x3b90('0x79')](_0x3b90('0x7a'),_0x3d6040[_0x3b90('0x3c')]),_0x3b90('0x7b'),_0x3d6040);}}}function emitCampaignSummary(_0x13b364){if(_0x13b364[_0x3b90('0x49')]==='ivr'){emit(util[_0x3b90('0x79')](_0x3b90('0x7c'),_0x13b364[_0x3b90('0x3c')]),'campaign:save',_0x13b364);}}function checkGetDataPredictive(_0x1e803e){if(isNotNull(_0x1e803e)&&!_['isEmpty'](_0x1e803e)){loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x7e'));loggerPredictive[_0x3b90('0x7d')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e803e[_0x3b90('0x7f')]);loggerPredictive[_0x3b90('0x7d')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e803e['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x80'),_0x1e803e[_0x3b90('0x6b')]);loggerPredictive[_0x3b90('0x7d')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1e803e['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x81'),_0x1e803e[_0x3b90('0x82')]);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x83'),_0x1e803e[_0x3b90('0x69')]);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x84'));if(_0x1e803e[_0x3b90('0x7f')]>0x0){if(!_['isUndefined'](_0x1e803e[_0x3b90('0x69')])&&_0x1e803e[_0x3b90('0x69')]>0x0){return!![];}loggerPredictive['info'](_0x3b90('0x85'));if(!_[_0x3b90('0x39')](_0x1e803e['predictiveIntervalAvgHoldtime'])&&_0x1e803e[_0x3b90('0x82')]>0x0){return!![];}loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x86'));}else{loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x87'));}}else{loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x88'));}return![];}function mergeDataErlangB(_0x47c9d1){return function(_0x1c6e45){loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x89'));loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x8a'),_0x1c6e45[_0x3b90('0x8b')]);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x8c'),_0x1c6e45[_0x3b90('0x73')]);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x8d'),_0x1c6e45[_0x3b90('0x74')]);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x8e'),_0x1c6e45[_0x3b90('0x75')]);loggerPredictive['info'](_0x3b90('0x8d'),_0x1c6e45['erlangAbandonmentRate']);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x84'));_[_0x3b90('0x8f')](_0x47c9d1,_0x1c6e45);};}function getDiff(_0x1bce2a){var _0x3e2245=moment()[_0x3b90('0x45')](0x0);var _0x55c14c=moment(_0x1bce2a)[_0x3b90('0x45')](0x0);return _0x3e2245[_0x3b90('0x46')](_0x55c14c,_0x3b90('0x47'));}function ifInterval(_0x8e1229,_0x3d41c8){if(_[_0x3b90('0x39')](_0x3d41c8)){return![];}return getDiff(_0x3d41c8)<_0x8e1229*0x3c;}function freeVariablesPredictive(_0x5c7605){if(isNotNull(_0x5c7605)){if(!_[_0x3b90('0x39')](_0x5c7605[_0x3b90('0x24')])){_0x5c7605[_0x3b90('0x24')]=undefined;loggerPredictive['info'](_0x5c7605[_0x3b90('0x3c')],_0x3b90('0x90'));}if(!_[_0x3b90('0x39')](_0x5c7605[_0x3b90('0x23')])){_0x5c7605[_0x3b90('0x23')]=undefined;loggerPredictive[_0x3b90('0x7d')](_0x5c7605[_0x3b90('0x3c')],_0x3b90('0x91'));}if(!_[_0x3b90('0x39')](_0x5c7605['handlePredictive'])){clearInterval(_0x5c7605[_0x3b90('0x92')]);_0x5c7605['handlePredictive']=undefined;loggerPredictive['info'](_0x5c7605[_0x3b90('0x3c')],_0x3b90('0x93'));}}}function erlangb(_0x52c099,_0x13dd30){if(_0x13dd30===0x0){return 0x0;}var _0x1a2592=0x1;for(var _0x287be4=0x1;_0x287be4<=_0x13dd30;_0x287be4+=0x1){_0x1a2592=0x1+_0x1a2592*_0x287be4/_0x52c099;}return 0x1/_0x1a2592;}function isVoiceQueueOutbound(_0x1842f9){return _0x1842f9===_0x3b90('0x4a');}function isNotPreview(_0x260de4){return _0x260de4!==_0x3b90('0x19');}function isCampaignIvr(_0x5441c4){return _0x5441c4==='ivr';}function getCallerId(_0x3e5532,_0x5e5efa,_0x2bdd3d){if(!_['isUndefined'](_0x2bdd3d)&&typeof _0x2bdd3d===_0x3b90('0x94')&&!_['isEmpty'](_0x2bdd3d)){if(!_['isUndefined'](_0x5e5efa)&&typeof _0x5e5efa==='string'&&!_[_0x3b90('0x95')](_0x5e5efa)){return util[_0x3b90('0x79')](_0x3b90('0x96'),_0x5e5efa,_0x2bdd3d);}return util[_0x3b90('0x79')](_0x3b90('0x96'),_0x2bdd3d,_0x2bdd3d);}if(!_[_0x3b90('0x39')](_0x3e5532)&&typeof _0x3e5532===_0x3b90('0x94')&&!_['isEmpty'](_0x3e5532)){return _0x3e5532;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x5aead0,_0x3c1632){return function(_0x2827eb){freeVariablesPredictive(_0x3c1632);emitVoiceQueueSummary(_0x3c1632);emitCampaignSummary(_0x3c1632);loggerSyncQueueSummary['error'](_0x5aead0,util[_0x3b90('0x97')](_0x2827eb,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x398301,_0x3eba02){return function(_0x3b109f){loggerPredictive[_0x3b90('0x98')](_0x3eba02[_0x3b90('0x3c')],_0x398301);loggerPredictive[_0x3b90('0x98')](_0x3b109f[_0x3b90('0x99')]);freeVariablesPredictive(_0x3eba02);};}function loggerCatch(_0x29548f){return function(_0x5ec095){logger[_0x3b90('0x98')](_0x29548f,util['inspect'](_0x5ec095,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2bbbac){return _0x2bbbac&&!_[_0x3b90('0x39')](_0x2bbbac)&&_0x2bbbac['length']>0x0;}function decremetOriginate(_0x5b34f5){if(!_[_0x3b90('0x39')](_0x5b34f5)&&_0x5b34f5!==null){if(typeof _0x5b34f5[_0x3b90('0x72')]!==_0x3b90('0x9a')){if(_0x5b34f5[_0x3b90('0x72')]>0x0){_0x5b34f5[_0x3b90('0x72')]-=0x1;}else{logger[_0x3b90('0x98')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x3b90('0x98')](_0x3b90('0x9b'));}}function checkContactLowerLimitOriginate(_0x261840,_0x5b7b79,_0x38c985){if(_0x5b7b79>_0x38c985){for(var _0x5e7c59=0x0;_0x5e7c59<_0x5b7b79-_0x38c985;_0x5e7c59+=0x1){decremetOriginate(_0x261840);}}}function loggerGetContactDialer(_0xaec524,_0x34c02f,_0x391568){return function(_0x333a1b){checkContactLowerLimitOriginate(_0x34c02f,_0x391568,0x0);logger[_0x3b90('0x98')](_0xaec524,util[_0x3b90('0x97')](_0x333a1b,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x507d53){return function(_0x21e95d){if(isNotNull(_0x21e95d)&&isNotNull(_0x21e95d[0x0])){if(_0x21e95d[0x0][_0x3b90('0x9c')]>0x0){_0x507d53[_0x3b90('0x3a')]=_0x3b90('0x9d');logger[_0x3b90('0x7d')](_0x3b90('0x9e')+_0x507d53[_0x3b90('0x3c')],_0x21e95d[0x0][_0x3b90('0x9c')],'contacts');}else{_0x507d53[_0x3b90('0x3a')]=_0x3b90('0x9f');logger[_0x3b90('0x7d')](_0x3b90('0xa0')+_0x507d53[_0x3b90('0x3c')]);}}};}function notSendMessagesQueue(_0x2ba788){if(_0x2ba788[_0x3b90('0xa1')]){freeVariablesPredictive(_0x2ba788);if(_0x2ba788[_0x3b90('0x72')]===0x0&&_0x2ba788['talking']===0x0&&_0x2ba788['waiting']===0x0&&(_0x2ba788[_0x3b90('0x4e')]||0x0)===0x0){_0x2ba788[_0x3b90('0xa1')]=![];_0x2ba788[_0x3b90('0x4d')]=0x0;_0x2ba788['message']=_0x3b90('0xa2');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2ba788[_0x3b90('0x3c')],_0x3b90('0xa3'));}else{_0x2ba788[_0x3b90('0x3a')]=_0x3b90('0xa4');loggerSyncQueueSummary[_0x3b90('0x98')](_0x3b90('0xa5'),_0x2ba788[_0x3b90('0x3c')],_0x3b90('0xa6'));}emitVoiceQueueSummary(_0x2ba788);}}function notSendMessagesCampaign(_0x3a8f80){if(_0x3a8f80[_0x3b90('0xa1')]){if(_0x3a8f80[_0x3b90('0x72')]===0x0){_0x3a8f80[_0x3b90('0xa1')]=![];_0x3a8f80[_0x3b90('0x3a')]=_0x3b90('0xa2');loggerSyncQueueSummary[_0x3b90('0x98')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3a8f80[_0x3b90('0x3c')],_0x3b90('0xa3'));}else{_0x3a8f80['message']=_0x3b90('0xa4');loggerSyncQueueSummary['error'](_0x3b90('0xa7'),_0x3a8f80[_0x3b90('0x3c')],_0x3b90('0xa6'));}emitCampaignSummary(_0x3a8f80);}}function createObjHistory(_0x4c3156,_0xdcf95a,_0x1d7f2e,_0x10dfdf,_0x137a08){_0x4c3156[_0x3b90('0x3a')]=_0x1d7f2e;var _0x15befb=new Action(_0x4c3156,_0xdcf95a);var _0x4a167d=new History(_0x15befb);_0x4a167d[_0x3b90('0xa8')]=_0x10dfdf;_0x4a167d[_0x3b90('0xa9')]=_0x137a08;_0x4a167d[_0x3b90('0xaa')]=_0x15befb[_0x3b90('0xab')];return _0x4a167d;}Dialer[_0x3b90('0x16')]['loopClearZombieChannels']=function(){var _0x5546af=this;setInterval(function(){_0x5546af['clearZombieChannels'](_0x5546af[_0x3b90('0x21')],_0x3b90('0xac'));_0x5546af[_0x3b90('0xad')](_0x5546af[_0x3b90('0xae')],_0x3b90('0xaf'));},0x32c8);};Dialer[_0x3b90('0x16')][_0x3b90('0xad')]=function(_0x3472c8,_0x2dd72e){var _0x157f24=this;for(var _0x235048 in _0x3472c8){if(typeof _0x3472c8[_0x235048]!=='undefined'){this['sequence'][_0x3b90('0xb0')](function(){if(!_[_0x3b90('0xb1')](_0x3472c8[_0x235048])){return ami[_0x3b90('0xb2')]({'action':_0x3b90('0xb3'),'channel':_0x3472c8[_0x235048][_0x3b90('0xb4')]})[_0x3b90('0xb5')](function(_0x150510){if(_0x150510[_0x3b90('0x3a')]===_0x3b90('0xb6')){setTimeout(function(){if(_0x3472c8[_0x235048]&&_0x3472c8[_0x235048][_0x3b90('0x49')]!==_0x3b90('0xb7')){_0x157f24[_0x3b90('0xb8')](_0x157f24[_0x3b90('0x1a')][_0x3472c8[_0x235048][_0x3b90('0xb9')]]);logger[_0x3b90('0x98')](_0x3b90('0xba'),_0x2dd72e,_0x235048,_0x3472c8[_0x235048][_0x3b90('0xb9')]);delete _0x3472c8[_0x235048];}if(_0x3472c8[_0x235048]&&_0x3472c8[_0x235048][_0x3b90('0x49')]==='ivr'){_0x157f24[_0x3b90('0xb8')](_0x157f24[_0x3b90('0x1b')][_0x3472c8[_0x235048][_0x3b90('0xb9')]]);logger[_0x3b90('0x98')](_0x3b90('0xbb'),_0x2dd72e,_0x235048,_0x3472c8[_0x235048]['queue']);delete _0x3472c8[_0x235048];}},0x2328);}});}});}}};Dialer[_0x3b90('0x16')][_0x3b90('0xbc')]=function(_0x320fc2){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopper[_0x3b90('0xbc')](_0x320fc2))['catch'](loggerCatch(_0x3b90('0xbf')));};Dialer['prototype']['checkIsBlackList']=function(_0x25b369){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopperBlack[_0x3b90('0xc0')](_0x25b369))[_0x3b90('0xb5')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x3b90('0x16')][_0x3b90('0xc1')]=function(_0x429cd0){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopperBlack[_0x3b90('0xc1')](_0x429cd0))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xc2')));};Dialer[_0x3b90('0x16')][_0x3b90('0xc3')]=function(_0x4fbbe9){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopperHistory[_0x3b90('0xc4')](_0x4fbbe9))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xc5')));};Dialer['prototype'][_0x3b90('0xc6')]=function(_0x9fcc2){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopper[_0x3b90('0xc6')](_0x9fcc2))[_0x3b90('0xb5')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x3b90('0x16')][_0x3b90('0xc7')]=function(_0x36cb77,_0x306259,_0x1ae34b){return BPromise['resolve']()[_0x3b90('0xbe')](cmHopper[_0x3b90('0xc7')](_0x36cb77,_0x306259,_0x1ae34b))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xc8')));};Dialer['prototype']['getContactDialer']=function(_0x2b949c,_0x5c2e1f,_0x1325e2,_0x65a749,_0x13b9e4){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopper['getContactDialer'](_0x2b949c,_0x5c2e1f,_0x1325e2,_0x65a749))[_0x3b90('0xb5')](function(_0x4ed025){_0x13b9e4[_0x3b90('0xc9')]-=_0x1325e2;_0x13b9e4[_0x3b90('0xc9')]=_0x13b9e4[_0x3b90('0xc9')]>0x0?_0x13b9e4['temp']:0x0;loggerCatch(_0x3b90('0xca'))(_0x4ed025);});};Dialer[_0x3b90('0x16')][_0x3b90('0xcb')]=function(_0x5e0bad,_0x1aa2f1,_0x1dbc3d,_0x290a14){return BPromise['resolve']()[_0x3b90('0xbe')](cmHopper[_0x3b90('0xcb')](_0x5e0bad,_0x1aa2f1,_0x1dbc3d))[_0x3b90('0xb5')](function(_0x3c1c3f){_0x290a14[_0x3b90('0xc9')]-=_0x1aa2f1;_0x290a14[_0x3b90('0xc9')]=_0x290a14['temp']>0x0?_0x290a14['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x3c1c3f);});};Dialer[_0x3b90('0x16')]['getVoiceQueueRtPauses']=function(_0x88a9f3){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](voiceQueueRt[_0x3b90('0xcc')](_0x88a9f3))[_0x3b90('0xb5')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x3b90('0x16')]['moveContactManagedDialer']=function(_0x74241a){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopper['moveContactManagedDialer'](_0x74241a))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xcd')));};Dialer[_0x3b90('0x16')][_0x3b90('0xce')]=function(_0x1be56f){return BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](cmHopperHistory[_0x3b90('0xce')](_0x1be56f))['catch'](loggerCatch(_0x3b90('0xcf')));};Dialer['prototype'][_0x3b90('0xb8')]=function(_0x171ac6){if(!_[_0x3b90('0x39')](_0x171ac6)&&_0x171ac6!==null){if(typeof _0x171ac6[_0x3b90('0x72')]!==_0x3b90('0x9a')){if(_0x171ac6[_0x3b90('0x72')]>0x0){_0x171ac6[_0x3b90('0x72')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x3b90('0x98')](_0x3b90('0xd0'));}};Dialer[_0x3b90('0x16')][_0x3b90('0xd1')]=function(_0x4c70bb,_0x5d62ce){var _0x216e68=this;return function(_0x41c061){_0x216e68['updateOriginated'](_0x5d62ce);logger[_0x3b90('0x98')](_0x4c70bb,util[_0x3b90('0x97')](_0x41c061,{'showHidden':![],'depth':null}));};};Dialer[_0x3b90('0x16')][_0x3b90('0xd2')]=function(_0x2cef2f,_0x4490da,_0x57cca1){var _0x2b6599={'state':0x19,'statedesc':_0x3b90('0xd3')};this[_0x3b90('0xb8')](_0x4490da);this[_0x3b90('0xd4')](_[_0x3b90('0x8f')](_0x2b6599,_[_0x3b90('0xd5')](_0x57cca1,[_0x3b90('0xd6'),_0x3b90('0xd7'),_0x3b90('0xd8'),_0x3b90('0xd9'),_0x3b90('0xda')])),'[emptyContact][createHistory]','[emptyContact]');logger['error'](_0x2cef2f);};Dialer['prototype'][_0x3b90('0xdb')]=function(_0x184743){return _0x184743===_0x3b90('0xdc');};Dialer[_0x3b90('0x16')][_0x3b90('0xdd')]=function(_0x398407){return!_[_0x3b90('0x39')](_0x398407)&&_0x398407&&!_[_0x3b90('0x39')](_0x398407[_0x3b90('0x3c')])&&!_['isUndefined'](_0x398407[_0x3b90('0x77')])&&_0x398407['active']&&(this['trunks'][util[_0x3b90('0x79')](_0x3b90('0xde'),_0x398407[_0x3b90('0x3c')])][_0x3b90('0xb3')]===_0x3b90('0xdf')||this['trunks'][util[_0x3b90('0x79')]('SIP/%s',_0x398407[_0x3b90('0x3c')])][_0x3b90('0xb3')]===_0x3b90('0xe0'));};Dialer[_0x3b90('0x16')][_0x3b90('0xd4')]=function(_0x123cde,_0x144f06,_0x455c81){this[_0x3b90('0xce')](_0x123cde)[_0x3b90('0xb5')](loggerCatch(_0x144f06));this['moveContactManagedDialer'](_0x123cde)[_0x3b90('0xb5')](loggerCatch(_0x455c81));};Dialer[_0x3b90('0x16')][_0x3b90('0x33')]=function(_0x24ca95){var _0x5cfd5f=this[_0x3b90('0x21')][_0x24ca95[_0x3b90('0xe1')]];var _0x22ecb9;if(!_[_0x3b90('0xb1')](_0x24ca95)&&!_[_0x3b90('0xb1')](_0x24ca95[_0x3b90('0xe2')])&&!_['isNil'](_0x24ca95[_0x3b90('0xe2')][_0x3b90('0xe3')])&&_0x24ca95['exten']===_0x3b90('0xe4')&&_0x5cfd5f){if(_0x5cfd5f[_0x3b90('0x49')]!==_0x3b90('0xb7')&&this[_0x3b90('0x1a')][_0x5cfd5f['queue']][_0x3b90('0xe5')]&&_0x24ca95['value']==='HANGUP'){delete this['uniqueId'][_0x24ca95['uniqueid']];this[_0x3b90('0xb8')](this[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]]);this[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]][_0x3b90('0x5f')]+=0x1;this[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;_0x22ecb9=new Hangup(_0x5cfd5f,_0x24ca95);_0x22ecb9[_0x3b90('0xa8')]=0x12;_0x22ecb9[_0x3b90('0xa9')]='HangupInAMD';_0x22ecb9[_0x3b90('0xe6')]=_0x3b90('0xe7');ami['emit'](_0x3b90('0xe8'),ut['buildObj'](_0x22ecb9,_0x3b90('0xe9')));this['saveInDb'](_0x22ecb9,_0x3b90('0xea'),_0x3b90('0xeb'));}if(_0x5cfd5f['type']!=='ivr'&&this[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]][_0x3b90('0xe5')]&&_0x24ca95['value']===_0x3b90('0xec')){var _0x20154c=this;return new BPromise(function(_0x2aded6,_0x5c2902){delete _0x20154c[_0x3b90('0x21')][_0x24ca95[_0x3b90('0xe1')]];_0x20154c[_0x3b90('0xb8')](_0x20154c[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]]);_0x20154c[_0x3b90('0x1a')][_0x5cfd5f['queue']][_0x3b90('0x5f')]+=0x1;_0x20154c[_0x3b90('0x1a')][_0x5cfd5f['queue']][_0x3b90('0x5e')]+=0x1;var _0x379031=_0x20154c[_0x3b90('0x1a')][_0x5cfd5f[_0x3b90('0xb9')]];var _0x5573de=new Hangup(_0x5cfd5f,_0x24ca95);_0x5573de['state']=0x13;_0x5573de[_0x3b90('0xa9')]=_0x3b90('0xed');_0x5573de['membername']='AMD';_0x5573de[_0x3b90('0xee')]+=0x1;_0x5573de[_0x3b90('0xef')]+=0x1;_0x5573de[_0x3b90('0xe9')]=!![];ami['emit'](_0x3b90('0xe8'),ut[_0x3b90('0xf0')](_0x5573de,_0x3b90('0xe9')));_0x20154c[_0x3b90('0xce')](_0x5573de)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xf1')));if(_0x5573de[_0x3b90('0xf2')]+_0x5573de['countcongestionretry']+_0x5573de[_0x3b90('0xf3')]+_0x5573de[_0x3b90('0xf4')]+_0x5573de[_0x3b90('0xf5')]+_0x5573de[_0x3b90('0xf6')]+_0x5573de[_0x3b90('0xee')]+_0x5573de[_0x3b90('0xf7')]>=_0x379031['dialGlobalMaxRetry']){_0x20154c['stateGlobal'](_0x5573de,_0x2aded6,_0x5c2902,_0x3b90('0xf8'));}else{if(_0x5573de[_0x3b90('0xee')]>=_0x379031[_0x3b90('0xf9')]){_0x20154c[_0x3b90('0xfa')](_0x5573de,_0x2aded6,_0x5c2902,_0x3b90('0xfb'));}else{_0x20154c['rescheduleContact']({'active':![],'countmachineretry':_0x5573de[_0x3b90('0xee')],'scheduledat':moment()[_0x3b90('0xfc')](_0x379031['dialMachineRetryFrequency'],_0x3b90('0xfd'))[_0x3b90('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x5573de[_0x3b90('0xd6')],'ListId':_0x5573de[_0x3b90('0xd7')],'VoiceQueueId':_0x5573de['VoiceQueueId']||undefined,'CampaignId':_0x5573de['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x2aded6({'reschedule':0x1});}}});}if(_0x5cfd5f[_0x3b90('0x49')]===_0x3b90('0xb7')&&this[_0x3b90('0x1b')][_0x5cfd5f['queue']][_0x3b90('0xe5')]&&_0x24ca95[_0x3b90('0xfe')]===_0x3b90('0xff')){delete this[_0x3b90('0x21')][_0x24ca95[_0x3b90('0xe1')]];this[_0x3b90('0xb8')](this['campaigns'][_0x5cfd5f[_0x3b90('0xb9')]]);_0x22ecb9=new Hangup(_0x5cfd5f,_0x24ca95);_0x22ecb9['state']=0x12;_0x22ecb9[_0x3b90('0xa9')]=_0x3b90('0x100');_0x22ecb9['membername']='AMD';ami[_0x3b90('0x48')](_0x3b90('0xe8'),ut[_0x3b90('0xf0')](_0x22ecb9,_0x3b90('0xe9')));this[_0x3b90('0xd4')](_0x22ecb9,_0x3b90('0x101'),_0x3b90('0x102'));}if(_0x5cfd5f[_0x3b90('0x49')]===_0x3b90('0xb7')&&this[_0x3b90('0x1b')][_0x5cfd5f[_0x3b90('0xb9')]][_0x3b90('0xe5')]&&_0x24ca95['value']===_0x3b90('0xec')){var _0x20154c=this;return new BPromise(function(_0x318679,_0x462a16){delete _0x20154c[_0x3b90('0x21')][_0x24ca95[_0x3b90('0xe1')]];_0x20154c['updateOriginated'](_0x20154c[_0x3b90('0x1b')][_0x5cfd5f[_0x3b90('0xb9')]]);_0x20154c[_0x3b90('0x1b')][_0x5cfd5f['queue']][_0x3b90('0x5f')]+=0x1;_0x20154c[_0x3b90('0x1b')][_0x5cfd5f['queue']][_0x3b90('0x5e')]+=0x1;var _0x120d0b=_0x20154c[_0x3b90('0x1b')][_0x5cfd5f[_0x3b90('0xb9')]];var _0x51ca31=new Hangup(_0x5cfd5f,_0x24ca95);_0x51ca31[_0x3b90('0xa8')]=0x13;_0x51ca31[_0x3b90('0xa9')]=_0x3b90('0xed');_0x51ca31[_0x3b90('0xe6')]='AMD';_0x51ca31[_0x3b90('0xee')]+=0x1;_0x51ca31[_0x3b90('0xef')]+=0x1;_0x51ca31[_0x3b90('0xe9')]=!![];ami[_0x3b90('0x48')](_0x3b90('0xe8'),ut[_0x3b90('0xf0')](_0x51ca31,_0x3b90('0xe9')));_0x20154c[_0x3b90('0xce')](_0x51ca31)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xf1')));if(_0x51ca31[_0x3b90('0xf2')]+_0x51ca31[_0x3b90('0x103')]+_0x51ca31[_0x3b90('0xf3')]+_0x51ca31[_0x3b90('0xf4')]+_0x51ca31[_0x3b90('0xf5')]+_0x51ca31[_0x3b90('0xf6')]+_0x51ca31[_0x3b90('0xee')]+_0x51ca31['countagentrejectretry']>=_0x120d0b[_0x3b90('0x104')]){_0x20154c['stateGlobal'](_0x51ca31,_0x318679,_0x462a16,_0x3b90('0xf8'));}else{if(_0x51ca31[_0x3b90('0xee')]>=_0x120d0b[_0x3b90('0xf9')]){_0x20154c[_0x3b90('0xfa')](_0x51ca31,_0x318679,_0x462a16,_0x3b90('0xfb'));}else{_0x20154c[_0x3b90('0xc6')]({'active':![],'countmachineretry':_0x51ca31[_0x3b90('0xee')],'scheduledat':moment()[_0x3b90('0xfc')](_0x120d0b[_0x3b90('0x105')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x51ca31['ContactId'],'ListId':_0x51ca31['ListId'],'VoiceQueueId':_0x51ca31[_0x3b90('0xd9')]||undefined,'CampaignId':_0x51ca31['CampaignId']||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x107')));_0x318679({'reschedule':0x1});}}});}}};Dialer[_0x3b90('0x16')][_0x3b90('0x30')]=function(_0x43ddbc){var _0x28b84b=this['uniqueId'][_0x43ddbc[_0x3b90('0xe1')]];var _0xa9ddfb=this;var _0x33b794;if(_0x28b84b&&_0x28b84b[_0x3b90('0x49')]===_0x3b90('0xb7')){delete this[_0x3b90('0x21')][_0x43ddbc[_0x3b90('0xe1')]];this['updateOriginated'](this['campaigns'][_0x28b84b[_0x3b90('0xb9')]]);this[_0x3b90('0x1b')][_0x28b84b[_0x3b90('0xb9')]]['ivrAnswerCallsDay']+=0x1;_0x33b794=new Hangup(_0x28b84b,_0x43ddbc);this[_0x3b90('0xce')](_0x33b794)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x108')));this[_0x3b90('0x109')](_0x33b794)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x10a')));}if(_0x28b84b&&_0x28b84b[_0x3b90('0x49')]!=='ivr'&&isNotNull(this['voiceQueues'][_0x28b84b[_0x3b90('0xb9')]][_0x3b90('0x10b')])){delete this[_0x3b90('0x21')][_0x43ddbc[_0x3b90('0xe1')]];this[_0x3b90('0xb8')](this[_0x3b90('0x1a')][_0x28b84b[_0x3b90('0xb9')]]);this['voiceQueues'][_0x28b84b[_0x3b90('0xb9')]]['outboundAnswerCallsDay']+=0x1;this[_0x3b90('0x1a')][_0x28b84b[_0x3b90('0xb9')]][_0x3b90('0x5e')]+=0x1;_0x33b794=new Hangup(_0x28b84b,_0x43ddbc);_0x33b794['state']=0x10;_0x33b794[_0x3b90('0xa9')]='AnswerAGI';_0x33b794[_0x3b90('0xe6')]=_0x3b90('0x10c');this[_0x3b90('0xce')](_0x33b794)[_0x3b90('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x3b90('0x109')](_0x33b794)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x10a')));}if(_0x28b84b&&_0x28b84b['type']!==_0x3b90('0xb7')&&!isNotNull(this[_0x3b90('0x1a')][_0x28b84b[_0x3b90('0xb9')]][_0x3b90('0x10b')])){delete this[_0x3b90('0x21')][_0x43ddbc[_0x3b90('0xe1')]];this[_0x3b90('0xb8')](this['voiceQueues'][_0x28b84b['queue']]);this[_0x3b90('0x1a')][_0x28b84b[_0x3b90('0xb9')]][_0x3b90('0x67')]+=0x1;_0x33b794=new Hangup(_0x28b84b,_0x43ddbc);_0x33b794['state']=0xc;_0x33b794[_0x3b90('0xa9')]=_0x43ddbc[_0x3b90('0x10d')];_0x33b794[_0x3b90('0xe6')]='Unknow';this[_0x3b90('0xce')](_0x33b794)[_0x3b90('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x3b90('0x109')](_0x33b794)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x10a')));}};Dialer[_0x3b90('0x16')][_0x3b90('0x10e')]=function(_0x13dff3){var _0x4ecc08=this[_0x3b90('0x21')][_0x13dff3['uniqueid']];var _0x226293=this;if(this[_0x3b90('0x1a')][_0x13dff3['queue']]){if(_0x4ecc08&&_0x4ecc08[_0x3b90('0x49')]!=='ivr'){delete this[_0x3b90('0x21')][_0x13dff3[_0x3b90('0xe1')]];this[_0x3b90('0x1a')][_0x13dff3[_0x3b90('0xb9')]][_0x3b90('0x5f')]+=0x1;var _0x4f8201=new AgentComplete(_0x4ecc08,_0x13dff3);if(_0x13dff3[_0x3b90('0x10f')]==='agent'){_0x4f8201[_0x3b90('0x110')]=this['voiceQueues'][_0x13dff3[_0x3b90('0xb9')]][_0x3b90('0x111')]&&this[_0x3b90('0x1a')][_0x13dff3[_0x3b90('0xb9')]][_0x3b90('0x112')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x3b90('0xce')](_0x4f8201)['catch'](loggerCatch(_0x3b90('0x113')));this[_0x3b90('0x109')](_0x4f8201)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x114')));}}};Dialer[_0x3b90('0x16')][_0x3b90('0x29')]=function(_0x128990){if(this[_0x3b90('0x1a')][_0x128990[_0x3b90('0xb9')]]){if(this[_0x3b90('0x21')][_0x128990[_0x3b90('0xe1')]]&&this[_0x3b90('0x21')][_0x128990[_0x3b90('0xe1')]][_0x3b90('0x49')]!=='ivr'){this[_0x3b90('0xb8')](this[_0x3b90('0x1a')][_0x128990[_0x3b90('0xb9')]]);this[_0x3b90('0x21')][_0x128990[_0x3b90('0xe1')]]['answertime']=moment()[_0x3b90('0x79')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x3b90('0x16')]['queueCallerAbandonCreateState']=function(_0x830544){this[_0x3b90('0xce')](_0x830544)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x113')));this[_0x3b90('0x109')](_0x830544)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x115')));};Dialer[_0x3b90('0x16')][_0x3b90('0x2b')]=function(_0xeb49f3){var _0x22af83=this[_0x3b90('0x21')][_0xeb49f3['uniqueid']];var _0x16172c=this;if(this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]]){if(_0x22af83&&_0x22af83[_0x3b90('0x49')]!==_0x3b90('0xb7')){delete this[_0x3b90('0x21')][_0xeb49f3['uniqueid']];this[_0x3b90('0xb8')](this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]]);_0x22af83[_0x3b90('0x116')]=moment()[_0x3b90('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0x34f649=new QueueCallerAbandon(_0x22af83,_0xeb49f3);if(getSeconds(_0x22af83[_0x3b90('0x116')],_0x22af83[_0x3b90('0x117')])>=_0x22af83['dialQueueTimeout']){this['voiceQueues'][_0xeb49f3['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x64')]+=0x1;this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x6d')]+=0x1;_0x34f649['state']=0xa;_0x34f649[_0x3b90('0xa9')]=_0x3b90('0x118');_0x34f649[_0x3b90('0x119')]=_0x3b90('0x11a');_0x34f649[_0x3b90('0x110')]=this['voiceQueues'][_0xeb49f3['queue']][_0x3b90('0x111')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x34f649[_0x3b90('0xf5')]+=0x1;_0x34f649[_0x3b90('0xef')]+=0x1;if(_0x34f649['countdropretry']>=this['voiceQueues'][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x11b')]){this[_0x3b90('0x11c')](_0x34f649);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x34f649[_0x3b90('0xf5')],'scheduledat':moment()['add'](this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x11d')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x22af83[_0x3b90('0xd6')],'ListId':_0x22af83['ListId'],'VoiceQueueId':_0x22af83[_0x3b90('0xd9')]||undefined,'CampaignId':_0x22af83[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x11e')));var _0x4deff2=new History(_0x34f649);_0x4deff2[_0x3b90('0xa8')]=0xa;_0x4deff2['statedesc']=_0x3b90('0x118');_0x4deff2[_0x3b90('0xab')]=moment()[_0x3b90('0x79')](_0x3b90('0x106'));_0x4deff2[_0x3b90('0xaa')]=_0x4deff2[_0x3b90('0xab')];_0x4deff2['calleridname']=_0x34f649['calleridname'];_0x4deff2[_0x3b90('0x11f')]=_0x34f649[_0x3b90('0x11f')];this[_0x3b90('0xce')](_0x4deff2)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x120')));}}else{this['voiceQueues'][_0xeb49f3['queue']][_0x3b90('0x6a')]+=0x1;this[_0x3b90('0x1a')][_0xeb49f3['queue']][_0x3b90('0x63')]+=0x1;_0x34f649[_0x3b90('0xa8')]=0xb;_0x34f649[_0x3b90('0xa9')]=_0x3b90('0x121');_0x34f649['dropreason']='CALLEREXIT';_0x34f649['countabandonedretry']+=0x1;_0x34f649[_0x3b90('0xef')]+=0x1;if(_0x34f649[_0x3b90('0xf6')]>=this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x122')]){this[_0x3b90('0x11c')](_0x34f649);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x34f649[_0x3b90('0xf6')],'scheduledat':moment()[_0x3b90('0xfc')](this[_0x3b90('0x1a')][_0xeb49f3[_0x3b90('0xb9')]][_0x3b90('0x123')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x22af83[_0x3b90('0xd6')],'ListId':_0x22af83[_0x3b90('0xd7')],'VoiceQueueId':_0x22af83['VoiceQueueId']||undefined,'CampaignId':_0x22af83[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x124')));var _0x4deff2=new History(_0x34f649);_0x4deff2['state']=0xb;_0x4deff2[_0x3b90('0xa9')]=_0x3b90('0x121');_0x4deff2[_0x3b90('0xab')]=moment()[_0x3b90('0x79')](_0x3b90('0x106'));_0x4deff2['endtime']=_0x4deff2[_0x3b90('0xab')];_0x4deff2[_0x3b90('0x125')]=_0x34f649[_0x3b90('0x125')];_0x4deff2[_0x3b90('0x11f')]=_0x34f649[_0x3b90('0x11f')];this[_0x3b90('0xce')](_0x4deff2)[_0x3b90('0xb5')](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x3b90('0x16')]['syncNewExten']=function(_0x18e6b3){if(this['actions'][_0x18e6b3[_0x3b90('0xe1')]]){this[_0x3b90('0xae')][_0x18e6b3[_0x3b90('0xe1')]][_0x3b90('0xb4')]=_0x18e6b3[_0x3b90('0xb4')];}if(this['uniqueId'][_0x18e6b3[_0x3b90('0xe1')]]){this[_0x3b90('0x21')][_0x18e6b3['uniqueid']][_0x3b90('0xb4')]=_0x18e6b3[_0x3b90('0xb4')];}};Dialer['prototype'][_0x3b90('0x35')]=function(_0x75317){if(strategy[this[_0x3b90('0x1a')][this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]][_0x3b90('0xb9')]]['strategy']]===_0x3b90('0x15')){if(this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]]&&_[_0x3b90('0xb1')](this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]][_0x3b90('0x127')])&&_0x75317[_0x3b90('0xb3')]==='1'&&_0x75317['paused']==='0'){if(this[_0x3b90('0x1c')][_0x75317[_0x3b90('0x128')]]){if(!this['agents'][_0x75317['stateinterface']][_0x3b90('0x127')]){this[_0x3b90('0x1c')][_0x75317[_0x3b90('0x128')]][_0x3b90('0x127')]=!![];this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]]['locked']=!![];this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]][_0x3b90('0x128')]=_0x75317[_0x3b90('0x128')];}}}}else if((strategy[this[_0x3b90('0x1a')][this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]][_0x3b90('0xb9')]]['strategy']]||'rrmemory')===_0x3b90('0x129')){if(this['actions'][_0x75317['actionid']]){if(this[_0x3b90('0x1c')][_0x75317[_0x3b90('0x128')]]){this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]]['stateinterface']=_0x75317[_0x3b90('0x128')];if(_[_0x3b90('0xb1')](this[_0x3b90('0x26')][this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]]['queue']])){this[_0x3b90('0x26')][this[_0x3b90('0xae')][_0x75317['actionid']][_0x3b90('0xb9')]]=[];}this[_0x3b90('0x26')][this[_0x3b90('0xae')][_0x75317[_0x3b90('0x126')]]['queue']][_0x3b90('0x12a')](_[_0x3b90('0x8f')](_['pick'](this['actions'][_0x75317[_0x3b90('0x126')]],['idHopper',_0x3b90('0x128')]),{'status':_0x75317[_0x3b90('0xb3')],'paused':_0x75317[_0x3b90('0x12b')]}));}}}};function unlockQueueStatus(_0x32f360,_0x36c28d){setTimeout(function(){if(_[_0x3b90('0x39')](_0x32f360[_0x3b90('0x12c')])){loggerBooked['error'](_0x3b90('0x12d'),_0x36c28d);}_0x32f360[_0x3b90('0x12c')]=!![];loggerBooked[_0x3b90('0x7d')](_0x3b90('0x12e'),_0x36c28d,JSON['stringify'](_['pick'](_0x32f360,['name','queueStatusComplete'])));},0x1f3);}Dialer[_0x3b90('0x16')][_0x3b90('0x12f')]=function(_0x398543){var _0x4f9f83=this;var _0x1cc644=_0x4f9f83[_0x3b90('0x1a')][_0x4f9f83[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]]['queue']];if(strategy[this[_0x3b90('0x1a')][this[_0x3b90('0xae')][_0x398543['actionid']][_0x3b90('0xb9')]][_0x3b90('0x4b')]]===_0x3b90('0x15')){if(this[_0x3b90('0xae')][_0x398543['actionid']]&&this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0x128')]){this[_0x3b90('0x19')][_0x3b90('0x130')](this[_0x3b90('0xae')][_0x398543['actionid']][_0x3b90('0x131')],this['actions'][_0x398543[_0x3b90('0x126')]][_0x3b90('0x128')])[_0x3b90('0xb5')](function(_0x446f73){logger['error'](_0x3b90('0x132'),util['inspect'](_0x446f73,{'showHidden':![],'depth':null}));})[_0x3b90('0x18')](function(){_0x4f9f83[_0x3b90('0xb8')](_0x4f9f83[_0x3b90('0x1a')][_0x4f9f83['actions'][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]);_0x4f9f83[_0x3b90('0x1c')][_0x4f9f83['actions'][_0x398543['actionid']][_0x3b90('0x128')]][_0x3b90('0x127')]=![];delete _0x4f9f83[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]];unlockQueueStatus(_0x1cc644);});}else{this[_0x3b90('0xb8')](this['voiceQueues'][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]);this[_0x3b90('0xc6')]({'active':![],'ContactId':this[_0x3b90('0xae')][_0x398543['actionid']]['ContactId'],'ListId':this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xd7')],'VoiceQueueId':this[_0x3b90('0xae')][_0x398543['actionid']][_0x3b90('0xd9')]||undefined,'CampaignId':this[_0x3b90('0xae')][_0x398543['actionid']][_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x133')));delete this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]];unlockQueueStatus(_0x1cc644);}}else if((strategy[this[_0x3b90('0x1a')][this['actions'][_0x398543[_0x3b90('0x126')]]['queue']]['strategy']]||'rrmemory')===_0x3b90('0x129')){var _0x3be8c3;if(this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]]&&!_['isEmpty'](this[_0x3b90('0x26')][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]])){if(this['queueBookedRR'][_0x4f9f83[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]){this[_0x3b90('0x27')][_0x4f9f83[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]=this['queueBookedRR'][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]?this[_0x3b90('0x27')][this['actions'][_0x398543[_0x3b90('0x126')]]['queue']]:this[_0x3b90('0x26')][this['actions'][_0x398543['actionid']][_0x3b90('0xb9')]]?this['queueBooked'][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]][_0x3b90('0x134')]||0x0:0x0;}this[_0x3b90('0x26')][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]]['queue']][_0x3b90('0x134')]=this[_0x3b90('0x27')][this['actions'][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]];for(var _0x512237=0x0;_0x512237<this['queueBooked'][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]][_0x3b90('0x135')];_0x512237+=0x1){_0x3be8c3=rr(this[_0x3b90('0x26')][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]);this[_0x3b90('0x27')][_0x4f9f83['actions'][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]=this['queueBooked'][this[_0x3b90('0xae')][_0x398543['actionid']]['queue']][_0x3b90('0x134')];if(_0x3be8c3['status']==='1'&&_0x3be8c3[_0x3b90('0x12b')]==='0'){break;}}if(!_[_0x3b90('0xb1')](_0x3be8c3)){this[_0x3b90('0x1c')][_0x3be8c3[_0x3b90('0x128')]][_0x3b90('0x136')]=_['isUndefined'](this[_0x3b90('0x1c')][_0x3be8c3[_0x3b90('0x128')]][_0x3b90('0x136')])?!![]:this['agents'][_0x3be8c3[_0x3b90('0x128')]][_0x3b90('0x136')];}loggerBooked['info']('[booked][RR]',_0x398543['actionid'],_0x3b90('0x137'),JSON['stringify'](_[_0x3b90('0xd5')](this['agents'][_0x3be8c3[_0x3b90('0x128')]],['name',_0x3b90('0x136')])),_0x3b90('0x138'),JSON[_0x3b90('0x44')](_0x3be8c3[_0x3b90('0x131')]));if(!_[_0x3b90('0xb1')](_0x3be8c3)&&_0x3be8c3['status']==='1'&&_0x3be8c3[_0x3b90('0x12b')]==='0'&&this[_0x3b90('0x1c')][_0x3be8c3[_0x3b90('0x128')]][_0x3b90('0x136')]){this[_0x3b90('0x1c')][_0x3be8c3['stateinterface']][_0x3b90('0x136')]=![];this[_0x3b90('0x26')][_0x4f9f83[_0x3b90('0xae')][_0x398543['actionid']][_0x3b90('0xb9')]]=[];this[_0x3b90('0x19')][_0x3b90('0x130')](_0x3be8c3[_0x3b90('0x131')],_0x3be8c3[_0x3b90('0x128')])[_0x3b90('0xb5')](function(_0x8ee800){logger[_0x3b90('0x98')](_0x3b90('0x132'),util[_0x3b90('0x97')](_0x8ee800,{'showHidden':![],'depth':null}));})[_0x3b90('0x18')](function(){_0x4f9f83[_0x3b90('0xb8')](_0x4f9f83['voiceQueues'][_0x4f9f83['actions'][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]);setTimeout(function(){_0x4f9f83[_0x3b90('0x1c')][_0x3be8c3[_0x3b90('0x128')]][_0x3b90('0x136')]=!![];loggerBooked[_0x3b90('0x7d')](_0x3b90('0x139'),_0x398543[_0x3b90('0x126')],_0x3b90('0x137'),JSON[_0x3b90('0x44')](_[_0x3b90('0xd5')](_0x4f9f83[_0x3b90('0x1c')][_0x3be8c3[_0x3b90('0x128')]],[_0x3b90('0x3c'),_0x3b90('0x136')])),'contactAgent-idHopper:\x20',JSON[_0x3b90('0x44')](_0x3be8c3[_0x3b90('0x131')]));},0xc7);delete _0x4f9f83[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]];unlockQueueStatus(_0x1cc644,_0x398543[_0x3b90('0x126')]);});}else{loggerBooked['info']('[booked][unlock]');this[_0x3b90('0xb8')](this['voiceQueues'][this[_0x3b90('0xae')][_0x398543['actionid']]['queue']]);this[_0x3b90('0xc6')]({'active':![],'ContactId':this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xd6')],'ListId':this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xd7')],'VoiceQueueId':this['actions'][_0x398543['actionid']][_0x3b90('0xd9')]||undefined,'CampaignId':this[_0x3b90('0xae')][_0x398543['actionid']]['CampaignId']||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x133')));delete this[_0x3b90('0xae')][_0x398543['actionid']];unlockQueueStatus(_0x1cc644);}}else{loggerBooked[_0x3b90('0x7d')](_0x3b90('0x13a'));this[_0x3b90('0xb8')](this[_0x3b90('0x1a')][this['actions'][_0x398543[_0x3b90('0x126')]][_0x3b90('0xb9')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xd6')],'ListId':this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xd7')],'VoiceQueueId':this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xd9')]||undefined,'CampaignId':this['actions'][_0x398543['actionid']][_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch('[unlock2][syncQueueStatusComplete]'));delete this['actions'][_0x398543[_0x3b90('0x126')]];unlockQueueStatus(_0x1cc644);}}else{loggerBooked[_0x3b90('0x7d')](_0x3b90('0x13b'));this[_0x3b90('0xb8')](this[_0x3b90('0x1a')][this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]]['queue']]);this[_0x3b90('0xc6')]({'active':![],'ContactId':this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]][_0x3b90('0xd6')],'ListId':this[_0x3b90('0xae')][_0x398543['actionid']][_0x3b90('0xd7')],'VoiceQueueId':this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x3b90('0xae')][_0x398543['actionid']][_0x3b90('0xda')]||undefined})['catch'](loggerCatch(_0x3b90('0x13c')));delete this[_0x3b90('0xae')][_0x398543[_0x3b90('0x126')]];unlockQueueStatus(_0x1cc644);}};Dialer[_0x3b90('0x16')][_0x3b90('0x37')]=function(){var _0x5ae497=this;setInterval(function(){_0x5ae497['syncCampaigns']();},0x3e8);};Dialer[_0x3b90('0x16')][_0x3b90('0x13d')]=function(_0x13832c){var _0xb8b991=this;return function(){if(!_0xb8b991[_0x3b90('0xdd')](_0x13832c[_0x3b90('0x76')])){if(!_0xb8b991[_0x3b90('0xdd')](_0x13832c[_0x3b90('0x13e')])){_0x13832c[_0x3b90('0x3a')]=_0x3b90('0x13f');throw _0x13832c[_0x3b90('0x3c')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x3b90('0x16')][_0x3b90('0x140')]=function(_0x5eda18,_0x2df1fe,_0x21e986,_0x19f737){var _0x331203=this;return function(){var _0x524648=!![];return _0x331203[_0x3b90('0x141')](_0x5eda18,_0x2df1fe,_0x21e986,_0x19f737,_0x524648);};};Dialer[_0x3b90('0x16')]['checkIfTimeIntervals']=function(_0x36c5b4,_0x46b560,_0x4475d4,_0x282148){var _0x3c3287=this;return function(){var _0x4948e3=![];return _0x3c3287[_0x3b90('0x141')](_0x36c5b4[_0x3b90('0x41')],_0x46b560,_0x4475d4,_0x282148,_0x4948e3);};};Dialer[_0x3b90('0x16')][_0x3b90('0x141')]=function(_0x4f4e1a,_0x2379b0,_0x19c2b9,_0x5e69e9,_0xc31b3a){var _0x2fc745=[];return new BPromise(function(_0x1c9e3d,_0x19b08c){if(!isNotNull(_0x4f4e1a)){_0x5e69e9[_0x3b90('0x3a')]='INTERVAL_IS_NULL';return _0x19b08c(msgResponse(_0x3b90('0x141'),_0x3b90('0x142'),_0x19c2b9+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x4f4e1a)){_0x5e69e9['message']=_0x3b90('0x143');return _0x19b08c(msgResponse(_0x3b90('0x141'),_0x3b90('0x142'),_0x19c2b9+_0x3b90('0x144')));}if(_0x2379b0&&_[_0x3b90('0x39')](config[_0x3b90('0x145')][_0x2379b0])){_0x5e69e9[_0x3b90('0x3a')]='TIMEZONE_UNKNOW';return _0x19b08c(msgResponse(_0x3b90('0x141'),_0x3b90('0x142'),_0x19c2b9+_0x3b90('0x146')+_0x2379b0));}if(_[_0x3b90('0x147')](_0x4f4e1a)){for(var _0x1fe59a=0x0;_0x1fe59a<_0x4f4e1a[_0x3b90('0x135')];_0x1fe59a+=0x1){_0x2fc745[_0x3b90('0x12a')](ami[_0x3b90('0xb2')]({'action':_0x3b90('0x148'),'command':util['format'](_0x3b90('0x149'),_0x4f4e1a[_0x1fe59a][_0x3b90('0x14a')],!_['isUndefined'](config[_0x3b90('0x145')][_0x2379b0])?_0x2379b0:'')})[_0x3b90('0xbe')](function(_0x2d2c28){return _0x2d2c28['content'][_0x3b90('0x14b')](_0x3b90('0x14c'))>=0x0;})[_0x3b90('0xb5')](myreject(_0x19b08c)));}}else{_0x2fc745['push'](ami[_0x3b90('0xb2')]({'action':_0x3b90('0x148'),'command':util[_0x3b90('0x79')](_0x3b90('0x149'),_0x4f4e1a,!_[_0x3b90('0x39')](config['timezones'][_0x2379b0])?_0x2379b0:'')})[_0x3b90('0xbe')](function(_0x3b1ba8){return _0x3b1ba8[_0x3b90('0x14d')][_0x3b90('0x14b')](_0x3b90('0x14c'))>=0x0;})[_0x3b90('0xb5')](myreject(_0x19b08c)));}BPromise[_0x3b90('0x14e')](_0x2fc745)['then'](function(_0x138961){var _0x586ed1=_[_0x3b90('0x14f')](_0x138961);if(_0x586ed1){return _0x1c9e3d(_0x586ed1);}else{_0x5e69e9['message']=_0xc31b3a?_0x3b90('0x150'):_0x3b90('0x151');return _0x19b08c(msgResponse(_0x3b90('0x152'),_0x3b90('0x142'),_0x3b90('0x153')+_0xc31b3a+'\x20'+_0x19c2b9+'\x20Interval\x20is\x20overtime:\x20'+util[_0x3b90('0x97')](_0x4f4e1a,{'showHidden':![],'depth':null})+_0x3b90('0x154')+_0x2379b0));}})['catch'](function(_0x4b6f7d){return _0x19b08c(msgResponse('ifTime','Failure',JSON[_0x3b90('0x44')](_0x4b6f7d)));});});};Dialer[_0x3b90('0x16')][_0x3b90('0x155')]=function(_0x59b261){var _0x5deb87=this;return function(){switch(_0x59b261[_0x3b90('0x59')]){case _0x3b90('0x156'):freeVariablesPredictive(_0x59b261);_0x5deb87[_0x3b90('0x157')](_0x59b261,0x1);break;case'power':freeVariablesPredictive(_0x59b261);_0x5deb87[_0x3b90('0x157')](_0x59b261,_0x59b261['dialPowerLevel']);break;case _0x3b90('0x158'):_0x5deb87[_0x3b90('0x158')](_0x59b261);break;case _0x3b90('0x159'):freeVariablesPredictive(_0x59b261);_0x5deb87[_0x3b90('0x157')](_0x59b261,0x1);break;default:freeVariablesPredictive(_0x59b261);logger[_0x3b90('0x98')]('Queue',_0x59b261[_0x3b90('0x3c')],_0x3b90('0x15a'));}};};Dialer[_0x3b90('0x16')][_0x3b90('0x15b')]=function(_0x114dd0){var _0x31f047=this;return function(){_0x31f047[_0x3b90('0x15c')](_0x114dd0);};};Dialer[_0x3b90('0x16')]['syncQueueSummary']=function(_0x2704ff){var _0x41327b=this;if(isNotPreview(_0x2704ff[_0x3b90('0x59')])){if(isVoiceQueueOutbound(_0x2704ff[_0x3b90('0x49')])&&isActive(_0x2704ff[_0x3b90('0x58')])){_0x2704ff[_0x3b90('0xa1')]=!![];BPromise[_0x3b90('0xbd')]()[_0x3b90('0xbe')](checkIsLoggedIn(_0x2704ff,_0x2704ff[_0x3b90('0x15d')]))[_0x3b90('0xbe')](checkIsActive(_0x2704ff,_0x2704ff[_0x3b90('0x58')]))['then'](checkInterval(_0x2704ff))[_0x3b90('0xbe')](_0x41327b['checkIsTrunkReachable'](_0x2704ff))[_0x3b90('0xbe')](_0x41327b[_0x3b90('0x140')](_0x2704ff[_0x3b90('0x15e')],_0x2704ff[_0x3b90('0x15f')],_0x2704ff[_0x3b90('0x3c')],_0x2704ff))['then'](_0x41327b[_0x3b90('0x160')](_0x2704ff[_0x3b90('0x3f')],_0x2704ff[_0x3b90('0x15f')],_0x2704ff[_0x3b90('0x3c')],_0x2704ff))[_0x3b90('0xbe')](_0x41327b[_0x3b90('0x155')](_0x2704ff))[_0x3b90('0xb5')](loggerCatchQueueSummary(_0x3b90('0x161'),_0x2704ff));}else{notSendMessagesQueue(_0x2704ff);}}else{freeVariablesPredictive(_0x2704ff);}};Dialer['prototype'][_0x3b90('0x162')]=function(){var _0x239b4d=this;var _0x2dd479;for(var _0x404eab in this['campaigns']){if(typeof this['campaigns'][_0x404eab]!==_0x3b90('0x9a')){_0x2dd479=this[_0x3b90('0x1b')][_0x404eab];if(isCampaignIvr(_0x2dd479[_0x3b90('0x49')])&&isActive(_0x2dd479['active'])){_0x2dd479[_0x3b90('0xa1')]=!![];BPromise['resolve']()[_0x3b90('0xbe')](checkIsActive(_0x2dd479,_0x2dd479[_0x3b90('0x77')]))[_0x3b90('0xbe')](checkInterval(_0x2dd479))[_0x3b90('0xbe')](_0x239b4d[_0x3b90('0x13d')](_0x2dd479))[_0x3b90('0xbe')](_0x239b4d['checkIfTime'](_0x2dd479[_0x3b90('0x15e')],_0x2dd479[_0x3b90('0x15f')],_0x2dd479[_0x3b90('0x3c')],_0x2dd479))[_0x3b90('0xbe')](_0x239b4d[_0x3b90('0x160')](_0x2dd479['Interval'],_0x2dd479[_0x3b90('0x15f')],_0x2dd479[_0x3b90('0x3c')],_0x2dd479))[_0x3b90('0xbe')](_0x239b4d[_0x3b90('0x15b')](_0x2dd479))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x2dd479));}else{notSendMessagesCampaign(_0x2dd479);}}}};function getCallerIdRandom(_0x58831d,_0xfc122b){var _0x414c1a;var _0x47ee55;var _0x5b7ecd;if(_0xfc122b<=0x0){_0xfc122b=0x1;}_0x414c1a=new RegExp(_0x3b90('0x163')+_0xfc122b+'}$');_0x47ee55=Math[_0x3b90('0x164')](0xa,_0xfc122b-0x1);_0x5b7ecd=Math[_0x3b90('0x164')](0xa,_0xfc122b)-0x1;return util[_0x3b90('0x79')]('%s',_[_0x3b90('0x165')](_0x58831d,_0x414c1a,_[_0x3b90('0x166')](_0x47ee55,_0x5b7ecd)));}function extractCalleridName(_0x554674){var _0x34f95c=_0x554674[_0x3b90('0x167')](/"(.*?)"/);return _0x34f95c?_0x34f95c[0x1]:_0x554674;}function extractCalleridNumber(_0x1f8d1c){var _0x421108=_0x1f8d1c[_0x3b90('0x167')](/<(.*?)>/);return _0x421108?_0x421108[0x1]:_0x1f8d1c;}Dialer[_0x3b90('0x16')]['actionOriginate']=function(_0x4abe4c,_0x1b61df){var _0x32d2e8=this;var _0x240aeb=uuid['v4']();this[_0x3b90('0xae')][_0x240aeb]=new Action(_0x4abe4c,_0x1b61df,_0x240aeb);return new BPromise(function(_0x5eb94d,_0x354bdb){if(_['isUndefined'](_0x4abe4c)&&typeof _0x4abe4c!==_0x3b90('0x168')){return _0x354bdb(msgResponse(_0x3b90('0x169'),_0x3b90('0x142'),_0x3b90('0x16a')));}if(_[_0x3b90('0x39')](_0x1b61df[_0x3b90('0x16b')][_0x3b90('0x16c')])||_0x1b61df['Contact']['phone']===null){return _0x354bdb(msgResponse(_0x3b90('0x169'),_0x3b90('0x142'),'contact\x20is\x20undefine'));}var _0x1621b2={'XMD-CALLERID':_0x32d2e8['actions'][_0x240aeb][_0x3b90('0x16d')](),'XMD-AGI':_0x4abe4c[_0x3b90('0x10b')]?util[_0x3b90('0x79')](_0x3b90('0x16e'),ipAgi,_0x4abe4c['dialQueueProject']):_0x3b90('0x16f'),'XMD-AGIAFTER':_0x4abe4c[_0x3b90('0x111')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x4abe4c[_0x3b90('0x111')]):'NONE','XMD-QUEUE':_0x4abe4c['type']==='outbound'?util['format'](_0x3b90('0x170'),_0x4abe4c[_0x3b90('0x3c')],_0x4abe4c[_0x3b90('0x171')]||'',_0x4abe4c[_0x3b90('0x112')]?'c':'',_0x4abe4c[_0x3b90('0x172')]||0x3):'NONE','XMD-CONTACTID':_0x1b61df[_0x3b90('0xd6')],'XMD-CDRTYPE':_0x3b90('0x9'),'CALLERID(all)':_0x32d2e8[_0x3b90('0xae')][_0x240aeb][_0x3b90('0x16d')](),'XMD-AMD':_0x4abe4c[_0x3b90('0xe5')]?_0x3b90('0x173'):_0x3b90('0x16f'),'XMD-DESTINATION':_0x3b90('0xe4')};if(_0x4abe4c['dialAMDActive']){_0x1621b2['XMD-AMDINITIALSILENCE']=_0x4abe4c['dialAMDInitialSilence']||0x9c4;_0x1621b2[_0x3b90('0x174')]=_0x4abe4c[_0x3b90('0x175')]||0x5dc;_0x1621b2[_0x3b90('0x176')]=_0x4abe4c[_0x3b90('0x177')]||0x320;_0x1621b2[_0x3b90('0x178')]=_0x4abe4c[_0x3b90('0x179')]||0x1388;_0x1621b2[_0x3b90('0x17a')]=_0x4abe4c[_0x3b90('0x17b')]||0x64;_0x1621b2[_0x3b90('0x17c')]=_0x4abe4c[_0x3b90('0x17d')]||0x32;_0x1621b2[_0x3b90('0x17e')]=_0x4abe4c[_0x3b90('0x17f')]||0x3;_0x1621b2[_0x3b90('0x180')]=_0x4abe4c[_0x3b90('0x181')]||0x100;_0x1621b2[_0x3b90('0x182')]=_0x4abe4c['dialAMDMaximumWordLength']||0x1388;}if(_0x4abe4c[_0x3b90('0x49')]===_0x3b90('0x4a')){_0x1621b2['XMD-VOICEQUEUEID']=_0x1b61df[_0x3b90('0xd9')];}else{_0x1621b2[_0x3b90('0x183')]=_0x1b61df[_0x3b90('0xda')];}for(var _0x1ebbde in _0x1b61df[_0x3b90('0x16b')]){if(typeof _0x1b61df[_0x3b90('0x16b')][_0x1ebbde]!=='undefined'){if(isNotNull(_0x1b61df[_0x3b90('0x16b')][_0x1ebbde])&&_0x1ebbde!=='id'&&_0x1ebbde!==_0x3b90('0x184')&&_0x1ebbde!=='createdAt'&&_0x1ebbde!==_0x3b90('0x185')){_0x1621b2[util[_0x3b90('0x79')]('%s%s',_0x3b90('0x186'),_[_0x3b90('0x187')](_0x1ebbde))]=_0x1b61df['Contact'][_0x1ebbde];}}}var _0x52a2d1=_0x32d2e8[_0x3b90('0xdd')](_0x4abe4c[_0x3b90('0x76')])?getCallerId(_0x4abe4c['Trunk']['callerid'],_0x4abe4c[_0x3b90('0x5a')],_0x4abe4c['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x4abe4c[_0x3b90('0x5b')],_0x4abe4c['dialRandomLastDigitCallerIdNumber']):_0x4abe4c['dialOriginateCallerIdNumber']):getCallerId(_[_0x3b90('0xb1')](_0x4abe4c['TrunkBackup'])?_0x4abe4c[_0x3b90('0x76')]['callerid']:_0x4abe4c[_0x3b90('0x13e')][_0x3b90('0x78')],_0x4abe4c[_0x3b90('0x5a')],_0x4abe4c[_0x3b90('0x188')]>0x0?getCallerIdRandom(_0x4abe4c[_0x3b90('0x5b')],_0x4abe4c['dialRandomLastDigitCallerIdNumber']):_0x4abe4c[_0x3b90('0x5b')]);if(_0x52a2d1){_0x1621b2[_0x3b90('0x189')]=_0x32d2e8[_0x3b90('0xae')][_0x240aeb][_0x3b90('0x18a')]=extractCalleridName(_0x52a2d1);_0x1621b2[_0x3b90('0x18b')]=_0x32d2e8['actions'][_0x240aeb][_0x3b90('0x18c')]=extractCalleridNumber(_0x52a2d1);}return ami[_0x3b90('0xb2')]({'actionid':_0x240aeb,'action':_0x3b90('0x169'),'channel':_0x32d2e8[_0x3b90('0xdd')](_0x4abe4c[_0x3b90('0x76')])?util['format'](_0x3b90('0x18d'),_0x4abe4c[_0x3b90('0x76')][_0x3b90('0x3c')],isNotNull(_0x4abe4c[_0x3b90('0x5d')])?_0x4abe4c[_0x3b90('0x5d')][_0x3b90('0x18e')]()||'':'',_0x4abe4c[_0x3b90('0x18f')]>0x0?_0x1b61df[_0x3b90('0x16b')][_0x3b90('0x16c')][_0x3b90('0x190')](_0x4abe4c[_0x3b90('0x18f')]):_0x1b61df[_0x3b90('0x16b')]['phone']):util['format'](_0x3b90('0x18d'),_[_0x3b90('0xb1')](_0x4abe4c[_0x3b90('0x13e')])?_0x4abe4c['Trunk'][_0x3b90('0x3c')]:_0x4abe4c[_0x3b90('0x13e')][_0x3b90('0x3c')],isNotNull(_0x4abe4c[_0x3b90('0x5d')])?_0x4abe4c[_0x3b90('0x5d')][_0x3b90('0x18e')]()||'':'',_0x4abe4c[_0x3b90('0x18f')]>0x0?_0x1b61df[_0x3b90('0x16b')]['phone']['substring'](_0x4abe4c[_0x3b90('0x18f')]):_0x1b61df['Contact'][_0x3b90('0x16c')]),'callerid':_0x52a2d1,'Exten':_0x3b90('0xe4'),'Context':_0x3b90('0x191'),'Priority':'1','variable':_0x1621b2,'timeout':(_0x4abe4c[_0x3b90('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x240aeb})[_0x3b90('0xbe')](function(_0x1b35a0){return _0x5eb94d(_0x1b35a0);})[_0x3b90('0xb5')](function(_0x76b7ae){_0x4abe4c[_0x3b90('0x66')]+=0x1;var _0xadce26=new History(_0x32d2e8[_0x3b90('0xae')][_0x240aeb]);logger[_0x3b90('0x98')](util[_0x3b90('0x79')](_0x3b90('0x192'),JSON[_0x3b90('0x44')](_0x76b7ae)));_0xadce26[_0x3b90('0xa8')]=0xe;_0xadce26['statedesc']=_0x3b90('0x193');_0xadce26[_0x3b90('0xab')]=moment()[_0x3b90('0x79')](_0x3b90('0x106'));_0xadce26[_0x3b90('0xaa')]=_0xadce26[_0x3b90('0xab')];_0x32d2e8[_0x3b90('0xce')](_0xadce26)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x194')));_0x32d2e8[_0x3b90('0x109')](_0xadce26)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x194')))[_0x3b90('0x18')](function(){delete _0x32d2e8[_0x3b90('0xae')][_0x240aeb];return _0x354bdb(msgResponse(_0x3b90('0x169'),_0x3b90('0x43'),_0x3b90('0x195')));});});});};Dialer[_0x3b90('0x16')][_0x3b90('0x2e')]=function(_0x1e0d53){var _0x47d7db=this[_0x3b90('0xae')][_0x1e0d53['actionid']];if(_0x47d7db){delete this[_0x3b90('0xae')][_0x1e0d53['actionid']];_0x47d7db[_0x3b90('0x117')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x596c4e=_0x47d7db[_0x3b90('0x49')]===_0x3b90('0xb7')?this['campaigns'][_0x47d7db[_0x3b90('0xb9')]]:this[_0x3b90('0x1a')][_0x47d7db[_0x3b90('0x196')]()];if(!this['isSuccess'](_0x1e0d53[_0x3b90('0x197')])){this['updateOriginated'](_0x596c4e);return this[_0x3b90('0x198')](_0x47d7db,_0x596c4e,_0x1e0d53)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x199')));}this[_0x3b90('0x21')][_0x1e0d53[_0x3b90('0xe1')]]=_0x47d7db;}};Dialer[_0x3b90('0x16')][_0x3b90('0x19a')]=function(_0x2219e3,_0x57ac38,_0x14f171){var _0x169ff9=new History(_0x57ac38);if(_0x169ff9['countbusyretry']+_0x169ff9['countcongestionretry']+_0x169ff9[_0x3b90('0xf3')]+_0x169ff9[_0x3b90('0xf4')]+_0x169ff9[_0x3b90('0xf5')]+_0x169ff9[_0x3b90('0xf6')]+_0x169ff9[_0x3b90('0xee')]+_0x169ff9[_0x3b90('0xf7')]>=_0x14f171[_0x3b90('0x104')]-0x1){return!![];}switch(_0x2219e3){case 0x3:if(_0x169ff9[_0x3b90('0xf3')]>=_0x14f171['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x3b90('0xc6')]({'active':![],'countnoanswerretry':_0x169ff9[_0x3b90('0xf3')]+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171['dialNoAnswerRetryFrequency'],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9['ContactId'],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9['VoiceQueueId']||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x19b')));break;case 0x5:if(_0x169ff9[_0x3b90('0xf2')]>=_0x14f171[_0x3b90('0x19c')]-0x1){return!![];}this[_0x3b90('0xc6')]({'active':![],'countbusyretry':_0x169ff9[_0x3b90('0xf2')]+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171[_0x3b90('0x19d')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x19e')));break;case 0x8:if(_0x169ff9[_0x3b90('0x103')]>=_0x14f171[_0x3b90('0x19f')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x169ff9['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x14f171[_0x3b90('0x1a0')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x1a1')));break;case 0x0:if(_0x169ff9[_0x3b90('0xf4')]>=_0x14f171['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x3b90('0xc6')]({'active':![],'countnosuchnumberretry':_0x169ff9[_0x3b90('0xf4')]+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171[_0x3b90('0x1a2')],_0x3b90('0xfd'))[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9['ListId'],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})['catch'](loggerCatch(_0x3b90('0x1a3')));}break;case 0xa:if(_0x169ff9[_0x3b90('0xf5')]>=_0x14f171['dialDropMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x169ff9[_0x3b90('0xf5')]+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171[_0x3b90('0x11d')],'minutes')[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x11e')));break;case 0xb:if(_0x169ff9[_0x3b90('0xf6')]>=_0x14f171[_0x3b90('0x122')]-0x1){return!![];}this[_0x3b90('0xc6')]({'active':![],'countabandonedretry':_0x169ff9[_0x3b90('0xf6')]+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171[_0x3b90('0x123')],_0x3b90('0xfd'))['format'](_0x3b90('0x106')),'ContactId':_0x169ff9['ContactId'],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x124')));break;case 0x13:if(_0x169ff9['countmachineretry']>=_0x14f171[_0x3b90('0xf9')]-0x1){return!![];}this[_0x3b90('0xc6')]({'active':![],'countmachineretry':_0x169ff9[_0x3b90('0xee')]+=0x1,'scheduledat':moment()['add'](_0x14f171[_0x3b90('0x105')],'minutes')['format'](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9[_0x3b90('0xd7')],'VoiceQueueId':_0x169ff9[_0x3b90('0xd9')]||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x107')));break;case 0x14:if(_0x169ff9[_0x3b90('0xf7')]>=_0x14f171[_0x3b90('0x1a4')]-0x1){return!![];}this[_0x3b90('0xc6')]({'active':![],'countagentrejectretry':_0x169ff9['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x3b90('0xfc')](_0x14f171[_0x3b90('0x1a5')],'minutes')[_0x3b90('0x79')](_0x3b90('0x106')),'ContactId':_0x169ff9[_0x3b90('0xd6')],'ListId':_0x169ff9['ListId'],'VoiceQueueId':_0x169ff9['VoiceQueueId']||undefined,'CampaignId':_0x169ff9[_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer['prototype'][_0x3b90('0x198')]=function(_0x3dfaba,_0x335d59,_0x17331b){var _0x300e01=this;var _0x539a06=new History(_0x3dfaba);return new BPromise(function(_0xe330a1,_0x5aa167){if(_['isUndefined'](_0x335d59)&&typeof _0x335d59!==_0x3b90('0x168')){return _0x5aa167(msgResponse('[callProgressDetecting]',_0x3b90('0x142'),'entity\x20is\x20undefine'));}if(_[_0x3b90('0x39')](_0x17331b)&&typeof _0x17331b!==_0x3b90('0x168')){return _0x5aa167(msgResponse('[callProgressDetecting]',_0x3b90('0x142'),_0x3b90('0x1a6')));}switch(_0x17331b['reason']){case'0':_0x335d59[_0x3b90('0x1a7')]+=0x1;_0x539a06[_0x3b90('0xa8')]=0x0;_0x539a06['statedesc']=_0x3b90('0x1a8');_0x539a06['countnosuchnumberretry']+=0x1;_0x539a06[_0x3b90('0xef')]+=0x1;ami[_0x3b90('0x48')](_0x3b90('0x1a9'),ut[_0x3b90('0xf0')](_0x3dfaba,_0x3b90('0x1aa')));_0x300e01[_0x3b90('0xce')](_0x539a06)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xf1')));if(_0x300e01[_0x3b90('0x19a')](0x0,_0x3dfaba,_0x335d59)){if(_0x539a06[_0x3b90('0xf4')]>=_0x335d59[_0x3b90('0x1ab')]){_0x300e01['createStateFinal'](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1ac'));}else{_0x300e01['stateGlobal'](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1ac'));}}break;case'3':_0x335d59['outboundNoAnswerCallsDay']+=0x1;_0x539a06[_0x3b90('0xa8')]=0x3;_0x539a06[_0x3b90('0xa9')]=_0x3b90('0x1ad');_0x539a06['countnoanswerretry']+=0x1;_0x539a06[_0x3b90('0xef')]+=0x1;ami[_0x3b90('0x48')](_0x3b90('0x1ae'),ut['buildObj'](_0x3dfaba,_0x3b90('0x1af')));_0x300e01[_0x3b90('0xce')](_0x539a06)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x1b0')));if(_0x300e01[_0x3b90('0x19a')](0x3,_0x3dfaba,_0x335d59)){if(_0x539a06['countnoanswerretry']>=_0x335d59[_0x3b90('0x1b1')]){_0x300e01[_0x3b90('0xfa')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1b2'));}else{_0x300e01['stateGlobal'](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1b2'));}}break;case'5':_0x335d59[_0x3b90('0x61')]+=0x1;_0x539a06[_0x3b90('0xa8')]=0x5;_0x539a06['statedesc']=_0x3b90('0x1b3');_0x539a06[_0x3b90('0xf2')]+=0x1;_0x539a06[_0x3b90('0xef')]+=0x1;ami[_0x3b90('0x48')](_0x3b90('0x1b4'),ut[_0x3b90('0xf0')](_0x3dfaba,_0x3b90('0x1b5')));_0x300e01[_0x3b90('0xce')](_0x539a06)['catch'](loggerCatch(_0x3b90('0x1b6')));if(_0x300e01[_0x3b90('0x19a')](0x5,_0x3dfaba,_0x335d59)){if(_0x539a06[_0x3b90('0xf2')]>=_0x335d59[_0x3b90('0x19c')]){_0x300e01['createStateFinal'](_0x539a06,_0xe330a1,_0x5aa167,'reason\x205\x20busy');}else{_0x300e01[_0x3b90('0x1b7')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1b8'));}}break;case'8':_0x335d59[_0x3b90('0x1b9')]+=0x1;_0x539a06[_0x3b90('0xa8')]=0x8;_0x539a06[_0x3b90('0xa9')]=_0x3b90('0x1ba');_0x539a06[_0x3b90('0x103')]+=0x1;_0x539a06[_0x3b90('0xef')]+=0x1;ami['emit'](_0x3b90('0x1bb'),ut['buildObj'](_0x3dfaba,'congestion'));_0x300e01[_0x3b90('0xce')](_0x539a06)[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x1bc')));if(_0x300e01[_0x3b90('0x19a')](0x8,_0x3dfaba,_0x335d59)){if(_0x539a06[_0x3b90('0x103')]>=_0x335d59[_0x3b90('0x19f')]){_0x300e01[_0x3b90('0xfa')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1bd'));}else{_0x300e01[_0x3b90('0x1b7')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1bd'));}}break;case'11':_0x335d59[_0x3b90('0x1be')]+=0x1;_0x539a06[_0x3b90('0xa8')]=0xb;_0x539a06[_0x3b90('0xa9')]='Abandoned';_0x539a06[_0x3b90('0xf6')]+=0x1;_0x539a06[_0x3b90('0xef')]+=0x1;_0x300e01[_0x3b90('0xce')](_0x539a06)['catch'](loggerCatch(_0x3b90('0x1bf')));if(_0x300e01[_0x3b90('0x19a')](0xb,_0x3dfaba,_0x335d59)){if(_0x539a06['countabandonedretry']>=_0x335d59[_0x3b90('0x122')]){_0x300e01['createStateFinal'](_0x539a06,_0xe330a1,_0x5aa167,'reason\x2011\x20abandoned');}else{_0x300e01[_0x3b90('0x1b7')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1c0'));}}break;case'20':_0x335d59[_0x3b90('0x1c1')]+=0x1;_0x539a06['state']=0x14;_0x539a06['statedesc']=_0x3b90('0x1c2');_0x539a06[_0x3b90('0xf7')]+=0x1;_0x539a06['countglobal']+=0x1;ami[_0x3b90('0x48')](_0x3b90('0x1c3'),ut[_0x3b90('0xf0')](_0x3dfaba,'agentreject'));_0x300e01[_0x3b90('0xce')](_0x539a06)['catch'](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x300e01[_0x3b90('0x19a')](0x14,_0x3dfaba,_0x335d59)){if(_0x539a06[_0x3b90('0xf7')]>=_0x335d59[_0x3b90('0x1a4')]){_0x300e01['createStateFinal'](_0x539a06,_0xe330a1,_0x5aa167,'reason\x2020\x20agentreject');}else{_0x300e01[_0x3b90('0x1b7')](_0x539a06,_0xe330a1,_0x5aa167,_0x3b90('0x1c4'));}}break;default:_0x335d59[_0x3b90('0x67')]+=0x1;_0x539a06[_0x3b90('0xa8')]=0xc;_0x539a06[_0x3b90('0xa9')]=_0x17331b[_0x3b90('0x10f')];_0x300e01[_0x3b90('0xce')](_0x539a06)[_0x3b90('0xb5')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x300e01[_0x3b90('0x19a')](_0x17331b[_0x3b90('0x10f')],_0x3dfaba,_0x335d59)){if(_0x539a06['countbusyretry']+_0x539a06[_0x3b90('0x103')]+_0x539a06[_0x3b90('0xf3')]+_0x539a06[_0x3b90('0xf4')]+_0x539a06[_0x3b90('0xf5')]+_0x539a06[_0x3b90('0xf6')]+_0x539a06['countmachineretry']+_0x539a06[_0x3b90('0xf7')]>=_0x335d59[_0x3b90('0x104')]){_0x300e01[_0x3b90('0x1b7')](_0x539a06,_0xe330a1,_0x5aa167,_0x17331b['reason']);}else{_0x300e01['createStateFinal'](_0x539a06,_0xe330a1,_0x5aa167,_0x17331b[_0x3b90('0x10f')]);}}}});};Dialer[_0x3b90('0x16')][_0x3b90('0x1b7')]=function(_0x1d86b7,_0x815983,_0xae6a4d,_0x565f64){var _0x5647b2=new Final(_0x1d86b7);_0x5647b2[_0x3b90('0xa8')]=0xf;_0x5647b2[_0x3b90('0xa9')]=_0x3b90('0x1c5');this['createStateFinal'](_0x5647b2,_0x815983,_0xae6a4d,_0x565f64);};Dialer[_0x3b90('0x16')][_0x3b90('0xfa')]=function(_0x520b6c,_0x3b40bf,_0x35fafd,_0x507c37){this['moveContactManagedDialer'](_0x520b6c)[_0x3b90('0xbe')](function(){return _0x3b40bf(msgResponse(_0x3b90('0x1c6'),_0x3b90('0xdc'),_0x507c37));})['catch'](function(){return _0x35fafd(msgResponse('[moveContactManagedDialer][0]',_0x3b90('0x142'),_0x3b90('0x1c7')));});};Dialer[_0x3b90('0x16')]['predictive']=function(_0x40c91a){var _0x53621b=_0x40c91a[_0x3b90('0x1c8')]/0x64;var _0x1fe49a=_0x40c91a['outboundDropCallsDayTimeout']/(_0x40c91a[_0x3b90('0x64')]+_0x40c91a[_0x3b90('0x5f')]);var _0x1f95b9=Math['round'](_0x40c91a[_0x3b90('0x71')]*(_0x40c91a['predictiveIntervalMaxThreshold']/0x64));var _0x30c32d=Math['round'](_0x40c91a[_0x3b90('0x71')]*(_0x40c91a[_0x3b90('0x1c9')]/0x64));var _0xab49a8=_0x40c91a['available']+_0x40c91a['talking'];var _0x274673=Math['floor'](_0x40c91a[_0x3b90('0x8b')]*_0x40c91a[_0x3b90('0x74')]*_0x40c91a[_0x3b90('0x6e')]*_0x40c91a[_0x3b90('0x6f')]);if(_['isUndefined'](_0x40c91a[_0x3b90('0x24')])){if(!_['isUndefined'](_0x40c91a[_0x3b90('0x23')])){_0x40c91a[_0x3b90('0x23')]=undefined;loggerPredictive[_0x3b90('0x98')](_0x3b90('0x1ca'),_0x3b90('0x1cb'));}if(!_[_0x3b90('0x39')](_0x40c91a[_0x3b90('0x92')])){loggerPredictive[_0x3b90('0x98')](_0x3b90('0x1ca'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x40c91a[_0x3b90('0x92')]);_0x40c91a[_0x3b90('0x92')]=undefined;}_0x40c91a[_0x3b90('0x24')]=moment()[_0x3b90('0x79')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x3b90('0x7d')](_0x40c91a['name'],'collection\x20data\x20in\x20progressive\x20at',_0x40c91a[_0x3b90('0x24')]);this[_0x3b90('0x157')](_0x40c91a,0x1);}else if(ifInterval(_0x40c91a['dialPredictiveInterval'],_0x40c91a[_0x3b90('0x24')])){this[_0x3b90('0x157')](_0x40c91a,0x1);loggerPredictiveCalls['info'](_0x3b90('0x1cc'),_0x40c91a[_0x3b90('0x24')],_0x40c91a['name']);_0x40c91a['erlangCalls']=0x0;_0x40c91a[_0x3b90('0x6d')]=0x0;}else if(_0x53621b<_0x1fe49a&&_0x40c91a[_0x3b90('0x1cd')]===_0x3b90('0x1ce')){freeVariablesPredictive(_0x40c91a);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x1cf'),_0x3b90('0x1d0'),_0x1fe49a,_0x3b90('0x24'),_0x40c91a[_0x3b90('0x3c')]);}else if(_0x274673<_0x40c91a[_0x3b90('0x6d')]&&_0x40c91a[_0x3b90('0x1cd')]===_0x3b90('0x1ce')){freeVariablesPredictive(_0x40c91a);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x1d1'),_0x3b90('0x1d2'),_0x274673,'Drop\x20in\x20this\x20interval',_0x40c91a['predictiveIntervalErlangCallsDroppedCalls'],_0x3b90('0x24'),_0x40c91a[_0x3b90('0x3c')]);}else if(!ifInterval(_0x40c91a[_0x3b90('0x1d3')],_0x40c91a[_0x3b90('0x24')])&&_['isUndefined'](_0x40c91a[_0x3b90('0x23')])&&!_['isUndefined'](_0x40c91a[_0x3b90('0x24')])){_0x40c91a[_0x3b90('0x23')]=moment()['format'](_0x3b90('0x106'));loggerPredictive[_0x3b90('0x7d')](_0x40c91a[_0x3b90('0x3c')],_0x3b90('0x1d4'),_0x40c91a['startPredictive']);this['averageHandleTime'](_0x40c91a[_0x3b90('0x1d3')])['then'](this[_0x3b90('0x1d5')](_0x40c91a))[_0x3b90('0xbe')](mergeDataErlangB(_0x40c91a))[_0x3b90('0xbe')](this[_0x3b90('0x1d6')](_0x40c91a))[_0x3b90('0xb5')](loggerCatchPredictive(_0x3b90('0x1d7'),_0x40c91a));}else if(!ifInterval(_0x40c91a[_0x3b90('0x1d3')],_0x40c91a[_0x3b90('0x23')])){_0x40c91a[_0x3b90('0x6d')]=0x0;_0x40c91a[_0x3b90('0x23')]=moment()[_0x3b90('0x79')](_0x3b90('0x106'));loggerPredictive[_0x3b90('0x7d')](_0x40c91a['name'],_0x3b90('0x1d8'),_0x40c91a['startPredictive']);clearInterval(_0x40c91a[_0x3b90('0x92')]);_0x40c91a[_0x3b90('0x92')]=undefined;this[_0x3b90('0xc3')](_0x40c91a[_0x3b90('0x1d3')])[_0x3b90('0xbe')](this[_0x3b90('0x1d5')](_0x40c91a))['then'](mergeDataErlangB(_0x40c91a))[_0x3b90('0xbe')](this['startMethodPredictive'](_0x40c91a))['catch'](loggerCatchPredictive(_0x3b90('0x1d9'),_0x40c91a));}else if(_0x40c91a['predictiveIntervalAvailable']&&_0xab49a8<_0x40c91a['predictiveIntervalAvailable']-_0x30c32d){freeVariablesPredictive(_0x40c91a);loggerPredictive[_0x3b90('0x7d')](_0x40c91a[_0x3b90('0x3c')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0xab49a8,_0x3b90('0x1da'),_0x40c91a[_0x3b90('0x71')],'-',_0x30c32d,'=',_0x40c91a[_0x3b90('0x71')]-_0x30c32d,')');}else if(_0x40c91a[_0x3b90('0x71')]&&_0xab49a8>_0x40c91a[_0x3b90('0x71')]+_0x1f95b9){freeVariablesPredictive(_0x40c91a);loggerPredictive[_0x3b90('0x7d')](_0x40c91a[_0x3b90('0x3c')],_0x3b90('0x1db'),_0xab49a8,_0x3b90('0x1dc'),_0x40c91a[_0x3b90('0x71')],'+',_0x1f95b9,'=',_0x40c91a[_0x3b90('0x71')]+_0x1f95b9,')');}};Dialer['prototype'][_0x3b90('0x1d5')]=function(_0x5bc62c){var _0x27b904=this;return function(_0x3c5b33){return new BPromise(function(_0x34b1a6,_0x5496a7){_['merge'](_0x5bc62c,_0x3c5b33[0x0]);if(checkGetDataPredictive(_0x3c5b33[0x0])){var _0x2a7b4b=_0x5bc62c['predictiveIntervalAvailable']=_0x5bc62c['talking']+_0x5bc62c[_0x3b90('0x4d')];var _0x1f16f9=_0x5bc62c[_0x3b90('0x1d3')]*0x3c;var _0x25c230=_0x3c5b33[0x0][_0x3b90('0x69')]+_0x3c5b33[0x0]['predictiveIntervalAvgHoldtime'];var _0x3d7c4d=(_0x3c5b33[0x0][_0x3b90('0x68')]+_0x3c5b33[0x0][_0x3b90('0x6b')]+_0x3c5b33[0x0][_0x3b90('0x6a')])/_0x3c5b33[0x0]['predictiveIntervalTotalCalls'];_0x5bc62c[_0x3b90('0x6e')]=_0x3d7c4d>0x0?_0x3d7c4d:0x1;switch(_0x5bc62c[_0x3b90('0x1cd')]){case _0x3b90('0x1ce'):var _0x10d1da=_0x5bc62c[_0x3b90('0x1c8')]/0x64;return _0x27b904[_0x3b90('0x1dd')](_0x2a7b4b,_0x1f16f9,_0x25c230,_0x3d7c4d,_0x10d1da)[_0x3b90('0xbe')](function(_0x466c81){return _0x34b1a6(_0x466c81);});case _0x3b90('0x1de'):var _0x443c75=_0x5bc62c[_0x3b90('0x1c8')]/0x64;return _0x27b904[_0x3b90('0x1df')](_0x2a7b4b,_0x1f16f9,_0x25c230,_0x3d7c4d,_0x443c75)[_0x3b90('0xbe')](function(_0x382f6b){return _0x34b1a6(_0x382f6b);});default:return _0x5496a7(msgResponse('[getDataPredictive]',_0x3b90('0x142'),'Unknown\x20Predictive'));}}else{return _0x5496a7(msgResponse(_0x3b90('0x1e0'),_0x3b90('0x142'),_0x3b90('0x1e1')));}});};};Dialer['prototype'][_0x3b90('0x1e2')]=function(_0x5213fa){var _0xe5e454=this;return function(_0x2c92f4){return new BPromise(function(_0x536c87,_0x399013){_['merge'](_0x5213fa,_0x2c92f4[0x0]);if(checkGetDataPredictive(_0x2c92f4[0x0])){loggerPredictive[_0x3b90('0x7d')](JSON[_0x3b90('0x44')](_0x2c92f4[0x0]));if(_0x5213fa[_0x3b90('0x1cd')]===_0x3b90('0x1ce')){return _0xe5e454['getVoiceQueueRtPauses'](_0x5213fa['id'])[_0x3b90('0xbe')](function(_0x2a6eaa){var _0x2c287d=_0x5213fa[_0x3b90('0x15d')]-_0x2a6eaa[0x0]['outboundQueuePauses'];var _0x13065f=_0x5213fa['dialPredictiveInterval']*0x3c;var _0x51b20c=_0x2c92f4[0x0]['predictiveIntervalAvgTalktime']+_0x2c92f4[0x0][_0x3b90('0x82')];var _0x35ee29=(_0x2c92f4[0x0][_0x3b90('0x68')]+_0x2c92f4[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2c92f4[0x0][_0x3b90('0x6a')])/_0x2c92f4[0x0][_0x3b90('0x7f')];var _0x1e7498=_0x5213fa[_0x3b90('0x1c8')]/0x64;_0x5213fa[_0x3b90('0x70')]=_0x2a6eaa[0x0][_0x3b90('0x1e3')]||0x0;_0x5213fa[_0x3b90('0x6e')]=_0x35ee29>0x0?_0x35ee29:0x1;return _0xe5e454['abandonmentRate'](_0x2c287d,_0x13065f,_0x51b20c,_0x35ee29,_0x1e7498);})[_0x3b90('0xbe')](function(_0x52f0ea){return _0x536c87(_0x52f0ea);})['catch'](function(_0x2708b4){return _0x399013(msgResponse(_0x3b90('0x1e4'),_0x3b90('0x142'),JSON[_0x3b90('0x44')](_0x2708b4)));});}if(_0x5213fa[_0x3b90('0x1cd')]===_0x3b90('0x1de')){return _0xe5e454[_0x3b90('0xcc')](_0x5213fa['id'])[_0x3b90('0xbe')](function(_0x411e8d){var _0x231660=_0x5213fa['loggedIn']-_0x411e8d[0x0][_0x3b90('0x1e3')];var _0x241cb0=_0x5213fa['dialPredictiveInterval']*0x3c;var _0x18cbad=_0x2c92f4[0x0][_0x3b90('0x69')]+_0x2c92f4[0x0][_0x3b90('0x82')];var _0x2914f1=(_0x2c92f4[0x0][_0x3b90('0x68')]+_0x2c92f4[0x0][_0x3b90('0x6b')]+_0x2c92f4[0x0][_0x3b90('0x6a')])/_0x2c92f4[0x0][_0x3b90('0x7f')];var _0x2c3ebc=_0x5213fa['dialPredictiveOptimizationPercentage']/0x64;_0x5213fa[_0x3b90('0x70')]=_0x411e8d[0x0][_0x3b90('0x1e3')]||0x0;_0x5213fa[_0x3b90('0x6e')]=_0x2914f1>0x0?_0x2914f1:0x1;return _0xe5e454[_0x3b90('0x1df')](_0x231660,_0x241cb0,_0x18cbad,_0x2914f1,_0x2c3ebc);})['then'](function(_0x5601c0){return _0x536c87(_0x5601c0);})[_0x3b90('0xb5')](function(_0x16f494){return _0x399013(msgResponse(_0x3b90('0x1e4'),'Failure',JSON[_0x3b90('0x44')](_0x16f494)));});}}else{return _0x399013(msgResponse(_0x3b90('0x1e0'),_0x3b90('0x142'),_0x3b90('0x1e1')));}});};};Dialer['prototype'][_0x3b90('0x1d6')]=function(_0x1b8c6c){var _0x472ec8=this;return function(){var _0x3d703f=0x0;var _0x22a1a8=Math['floor'](_0x1b8c6c[_0x3b90('0x73')]*0x3e8);if(_0x22a1a8>0x0){_0x22a1a8=_0x22a1a8<0x64?0x64:_0x22a1a8;loggerPredictive[_0x3b90('0x7d')](_0x1b8c6c[_0x3b90('0x3c')],_0x3b90('0x1e5'),_0x22a1a8,_0x3b90('0x45'));_0x1b8c6c[_0x3b90('0x92')]=setInterval(function(){_0x472ec8[_0x3b90('0x92')](_0x1b8c6c);loggerPredictiveCalls['info'](_0x3b90('0x1e6'),_0x3d703f+=0x1);},_0x22a1a8);}else{loggerPredictive['info'](_0x1b8c6c[_0x3b90('0x3c')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x3b90('0x16')]['checkContactBlack']=function(_0x469e2d,_0x44bd1e){var _0x222160=this;return function(_0x1ec8a5){if(_[_0x3b90('0x95')](_0x1ec8a5)){if(_[_0x3b90('0xb1')](_0x44bd1e['UserId'])||!_0x44bd1e['recallme']){if(_0x469e2d[_0x3b90('0x59')]===_0x3b90('0x159')){_0x469e2d['queueStatusComplete']=_['isUndefined'](_0x469e2d[_0x3b90('0x12c')])?!![]:_0x469e2d[_0x3b90('0x12c')];var _0x4c44a5=uuid['v4']();_0x222160['actions'][_0x4c44a5]=new Action(_0x469e2d,_0x44bd1e,_0x4c44a5);loggerBooked[_0x3b90('0x7d')](_0x3b90('0x1e7'),_0x4c44a5,'queueStatusComplete:\x20',JSON[_0x3b90('0x44')](_0x469e2d['queueStatusComplete']),_0x3b90('0x1e8'),_0x469e2d[_0x3b90('0x3c')]);if(_0x469e2d[_0x3b90('0x12c')]){_0x469e2d[_0x3b90('0x12c')]=![];_0x222160[_0x3b90('0x26')][_0x222160[_0x3b90('0xae')][_0x4c44a5]['queue']]=[];ami[_0x3b90('0xb2')]({'actionid':_0x4c44a5,'action':_0x3b90('0x1e9'),'queue':_0x469e2d[_0x3b90('0x3c')]})[_0x3b90('0xb5')](function(){_0x222160[_0x3b90('0xb8')](_0x469e2d);_0x222160[_0x3b90('0xc6')]({'active':![],'ContactId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xd6')],'ListId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xd7')],'VoiceQueueId':_0x222160['actions'][_0x4c44a5][_0x3b90('0xd9')]||undefined,'CampaignId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x1ea')));delete _0x222160[_0x3b90('0xae')][_0x4c44a5];});}else{loggerBooked[_0x3b90('0x7d')]('[booked][checkContactBlack][else]',JSON[_0x3b90('0x44')](_0x469e2d[_0x3b90('0x12c')]),_0x3b90('0x1e8'),_0x469e2d[_0x3b90('0x3c')]);_0x222160['updateOriginated'](_0x469e2d);_0x222160[_0x3b90('0xc6')]({'active':![],'ContactId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xd6')],'ListId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xd7')],'VoiceQueueId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xd9')]||undefined,'CampaignId':_0x222160[_0x3b90('0xae')][_0x4c44a5][_0x3b90('0xda')]||undefined})[_0x3b90('0xb5')](loggerCatch(_0x3b90('0x1ea')));delete _0x222160[_0x3b90('0xae')][_0x4c44a5];}}else{return _0x222160[_0x3b90('0x1eb')](_0x469e2d,_0x44bd1e);}}else{if(getDiff(_0x44bd1e[_0x3b90('0x1ec')])<_0x469e2d['dialRecallMeTimeout']*0x3c){if(_0x44bd1e[_0x3b90('0x1ed')]&&!_0x44bd1e['Agent'][_0x3b90('0x1ee')]){_0x222160[_0x3b90('0x19')][_0x3b90('0x130')](_0x44bd1e['id'])[_0x3b90('0x18')](function(){_0x222160[_0x3b90('0xb8')](_0x469e2d);});}else{_0x222160[_0x3b90('0xc7')]({'active':![]},_0x44bd1e['id'],0x1)['finally'](function(){_0x222160['updateOriginated'](_0x469e2d);});}}else{_0x469e2d['outboundReCallsDay']+=0x1;_0x222160[_0x3b90('0xb8')](_0x469e2d);if(_0x469e2d[_0x3b90('0x1ef')]){_0x222160[_0x3b90('0xc6')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x44bd1e[_0x3b90('0xd6')],'ListId':_0x44bd1e[_0x3b90('0xd7')],'VoiceQueueId':_0x44bd1e[_0x3b90('0xd9')]||undefined,'CampaignId':_0x44bd1e[_0x3b90('0xda')]||undefined})['catch'](loggerCatch(_0x3b90('0x1f0')));_0x222160[_0x3b90('0xce')](createObjHistory(_0x469e2d,_0x44bd1e,_0x3b90('0x1f1'),0x17,_0x3b90('0x1f2')))[_0x3b90('0xb5')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x222160['saveInDb'](createObjHistory(_0x469e2d,_0x44bd1e,_0x3b90('0x1f3'),0x16,_0x3b90('0x1f4')),_0x3b90('0x1f5'),_0x3b90('0x1f6'));}}}}else{_0x469e2d[_0x3b90('0x60')]+=0x1;_0x222160[_0x3b90('0xd4')](createObjHistory(_0x469e2d,_0x44bd1e,_0x3b90('0x1f7'),0xd,'Blacklist'),'[Originate][historyBlacklist]',_0x3b90('0x1f8'));throw _0x3b90('0x1f9');}};};Dialer[_0x3b90('0x16')]['handleIvr']=function(_0x1948e6){var _0x3bd369=this;var _0x569844=_0x1948e6[_0x3b90('0x1fa')]-_0x1948e6[_0x3b90('0x72')]-_0x1948e6[_0x3b90('0xc9')];emitCampaignSummary(_0x1948e6);if(_0x569844>0x0){if(_0x569844>this[_0x3b90('0x1e')]){_0x569844=this['maxNumberOriginate'];}_0x1948e6['temp']+=_0x569844;this[_0x3b90('0xcb')](_0x1948e6['id'],_0x569844,_0x1948e6[_0x3b90('0x1fb')],_0x1948e6)['then'](function(_0x5b8387){_0x1948e6['temp']-=_0x569844;_0x1948e6[_0x3b90('0xc9')]=_0x1948e6[_0x3b90('0xc9')]>0x0?_0x1948e6[_0x3b90('0xc9')]:0x0;if(!checkContactEmpty(_0x5b8387)){_0x1948e6['message']=_0x3b90('0x9f');logger['info'](_0x3b90('0x1fc')+_0x1948e6[_0x3b90('0x3c')]);}else{_0x1948e6['originated']+=_0x5b8387[_0x3b90('0x135')];_0x1948e6[_0x3b90('0x3a')]=_0x3b90('0x1fd');for(var _0x273472=0x0;_0x273472<_0x5b8387[_0x3b90('0x135')];_0x273472+=0x1){_0x1948e6[_0x3b90('0x1fe')]+=0x1;if(_[_0x3b90('0xb1')](_0x5b8387[_0x273472])||_['isNil'](_0x5b8387[_0x273472][_0x3b90('0x16b')])||_[_0x3b90('0xb1')](_0x5b8387[_0x273472]['Contact']['phone'])){_0x3bd369[_0x3b90('0xd2')](_0x3b90('0x1ff'),_0x1948e6,_0x5b8387[_0x273472]);}else{_0x3bd369[_0x3b90('0xc1')](_[_0x3b90('0xd5')](_0x5b8387[_0x273472],[_0x3b90('0xda'),_0x3b90('0x200')]))[_0x3b90('0xbe')](_0x3bd369[_0x3b90('0x201')](_0x1948e6,_0x5b8387[_0x273472]))[_0x3b90('0xb5')](_0x3bd369['loggerHandler'](_0x3b90('0x202'),_0x1948e6));}}}})[_0x3b90('0xb5')](loggerGetContactDialer(_0x3b90('0x203'),_0x1948e6,_0x569844));}};Dialer[_0x3b90('0x16')]['handlePower']=function(_0x3a494d,_0x18db1f){var _0x529d0f=this;var _0x25214e=[];var _0x43da81=_0x18db1f>=0x1?_0x18db1f:0x1;if(_0x3a494d[_0x3b90('0x59')]===_0x3b90('0x159')){_0x43da81=0x1;}var _0x9daf74=Math[_0x3b90('0x204')](_0x3a494d['available']*_0x43da81)-_0x3a494d['originated']-_0x3a494d[_0x3b90('0xc9')];emitVoiceQueueSummary(_0x3a494d);if(_0x3a494d[_0x3b90('0x205')]>0x0){var _0xcb79a5=_0x3a494d[_0x3b90('0x205')]-_0x3a494d[_0x3b90('0x72')]-_0x3a494d[_0x3b90('0x52')]-_0x3a494d[_0x3b90('0xc9')]-_0x3a494d[_0x3b90('0x4e')];if(_0x9daf74>_0xcb79a5){_0x9daf74=_0xcb79a5;}}if(_0x9daf74>0x0){if(_0x3a494d[_0x3b90('0x59')]===_0x3b90('0x159')){_0x9daf74=0x1;}if(_0x9daf74>this['maxNumberOriginate']){_0x9daf74=this[_0x3b90('0x1e')];}_0x3a494d[_0x3b90('0xc9')]+=_0x9daf74;for(var _0x4668f3 in this[_0x3b90('0x1c')]){if(typeof this['agents'][_0x4668f3]!==_0x3b90('0x9a')){if(this['agents'][_0x4668f3][_0x3b90('0xa8')]===_0x3b90('0x206')&&this['agents'][_0x4668f3][_0x3b90('0xb3')]===_0x3b90('0xdf')){_0x25214e[_0x3b90('0x12a')](this['agents'][_0x4668f3]['id']);}}}this[_0x3b90('0x207')](_0x3a494d['id'],_0x25214e,_0x9daf74,_0x3a494d[_0x3b90('0x1fb')],_0x3a494d)[_0x3b90('0xbe')](function(_0x5d6644){_0x3a494d[_0x3b90('0xc9')]-=_0x9daf74;_0x3a494d[_0x3b90('0xc9')]=_0x3a494d['temp']>0x0?_0x3a494d['temp']:0x0;if(!checkContactEmpty(_0x5d6644)){_0x529d0f[_0x3b90('0xbc')](_0x3a494d)['then'](sendMessageReschedule(_0x3a494d))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xbf')));}else{_0x3a494d[_0x3b90('0x72')]+=_0x5d6644[_0x3b90('0x135')];_0x3a494d['message']=_0x3a494d[_0x3b90('0x59')]==='booked'?_0x3b90('0x173'):'RUNNING';for(var _0x16ca53=0x0;_0x16ca53<_0x5d6644[_0x3b90('0x135')];_0x16ca53+=0x1){if(_[_0x3b90('0xb1')](_0x5d6644[_0x16ca53])||_[_0x3b90('0xb1')](_0x5d6644[_0x16ca53][_0x3b90('0x16b')])||_[_0x3b90('0xb1')](_0x5d6644[_0x16ca53][_0x3b90('0x16b')][_0x3b90('0x16c')])){_0x529d0f['emptyContact'](_0x3b90('0x1ff'),_0x3a494d,_0x5d6644[_0x16ca53]);}else{_0x529d0f['checkIsBlackList'](_[_0x3b90('0xd5')](_0x5d6644[_0x16ca53],[_0x3b90('0xd9'),_0x3b90('0x200')]))[_0x3b90('0xbe')](_0x529d0f['checkContactBlack'](_0x3a494d,_0x5d6644[_0x16ca53]))['catch'](_0x529d0f[_0x3b90('0xd1')](_0x3b90('0x1ff'),_0x3a494d));}}}})[_0x3b90('0xb5')](loggerGetContactDialer(_0x3b90('0x208'),_0x3a494d,_0x9daf74));}};Dialer[_0x3b90('0x16')]['handlePredictive']=function(_0x586087){if(_0x586087[_0x3b90('0x205')]>0x0){var _0x221f4d=_0x586087[_0x3b90('0x205')]-_0x586087[_0x3b90('0x72')]-_0x586087[_0x3b90('0x52')];if(_0x221f4d>0x0){this['tryOriginatePredictive'](_0x586087);}else{loggerPredictiveCalls[_0x3b90('0x7d')](_0x3b90('0x209'));}}else{this[_0x3b90('0x20a')](_0x586087);}};Dialer['prototype'][_0x3b90('0x20a')]=function(_0x4a2c97){var _0x491e0c=this;var _0x36c03e=[];_0x4a2c97[_0x3b90('0x72')]+=0x1;for(var _0x288a16 in this[_0x3b90('0x1c')]){if(typeof this['agents'][_0x288a16]!=='undefined'){if(this[_0x3b90('0x1c')][_0x288a16][_0x3b90('0xa8')]===_0x3b90('0x206')&&this[_0x3b90('0x1c')][_0x288a16][_0x3b90('0xb3')]===_0x3b90('0xdf')){_0x36c03e[_0x3b90('0x12a')](this[_0x3b90('0x1c')][_0x288a16]['id']);}}}this['getContactDialer'](_0x4a2c97['id'],_0x36c03e,0x1,_0x4a2c97[_0x3b90('0x1fb')],_0x4a2c97)[_0x3b90('0xbe')](function(_0x2524e3){if(!checkContactEmpty(_0x2524e3)){checkContactLowerLimitOriginate(_0x4a2c97,0x1,0x0);_0x491e0c[_0x3b90('0xbc')](_0x4a2c97)['then'](sendMessageReschedule(_0x4a2c97))[_0x3b90('0xb5')](loggerCatch(_0x3b90('0xbf')));}else{_0x4a2c97[_0x3b90('0x3a')]='RUNNING';if(_[_0x3b90('0xb1')](_0x2524e3[0x0])||_[_0x3b90('0xb1')](_0x2524e3[0x0][_0x3b90('0x16b')])||_[_0x3b90('0xb1')](_0x2524e3[0x0][_0x3b90('0x16b')][_0x3b90('0x16c')])){_0x491e0c[_0x3b90('0xd2')]('[actionOriginate]\x20',_0x4a2c97,_0x2524e3[0x0]);}else{_0x491e0c['checkIsBlackList'](_['pick'](_0x2524e3[0x0],['VoiceQueueId',_0x3b90('0x200')]))[_0x3b90('0xbe')](_0x491e0c[_0x3b90('0x201')](_0x4a2c97,_0x2524e3[0x0]))[_0x3b90('0xb5')](_0x491e0c[_0x3b90('0xd1')](_0x3b90('0x20b'),_0x4a2c97));}}})[_0x3b90('0xb5')](loggerGetContactDialer(_0x3b90('0x20c'),_0x4a2c97,0x1));emitVoiceQueueSummary(_0x4a2c97);};Dialer[_0x3b90('0x16')]['abandonmentRate']=function(_0x31792f,_0x5118b0,_0x5e69a6,_0x31fcf0,_0x3eb54f,_0x332109){loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x20d'));loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x20e'),_0x31792f);loggerPredictive[_0x3b90('0x7d')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5118b0);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x20f'),_0x5e69a6);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x210'),_0x31fcf0);loggerPredictive[_0x3b90('0x7d')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3eb54f);loggerPredictive['info'](_0x3b90('0x84'));return new BPromise(function(_0x5f49bf,_0x5ad8de){if(_0x31792f<=0x0||isNaN(_0x31792f)){return _0x5ad8de(msgResponse(_0x3b90('0x211'),_0x3b90('0x43'),_0x3b90('0x212')+_0x31792f));}if(_0x5e69a6<=0x0||isNaN(_0x5e69a6)){return _0x5ad8de(msgResponse('[abandonmentRate]',_0x3b90('0x43'),_0x3b90('0x213')+_0x5e69a6));}if(_0x31fcf0<=0x0||isNaN(_0x31fcf0)){return _0x5ad8de(msgResponse('[abandonmentRate]',_0x3b90('0x43'),'p\x20=\x20'+_0x31fcf0));}if(_0x5118b0<=0x0||isNaN(_0x5118b0)){return _0x5ad8de(msgResponse('[abandonmentRate]',_0x3b90('0x43'),'interval\x20=\x20'+_0x5118b0));}if(_0x3eb54f<=0x0||isNaN(_0x3eb54f)){return _0x5ad8de(msgResponse(_0x3b90('0x211'),'Error',_0x3b90('0x214')+_0x3eb54f));}_0x332109=_0x332109||0x0;var _0x54e483=0x1/_0x5e69a6;var _0x4f5aed=0x0;var _0x5aad49=0x0;var _0x17f4ab=0x0;var _0x340db5=0x0;for(var _0x1c1ca6=0x0;_0x17f4ab<_0x3eb54f;_0x1c1ca6+=0x1){_0x5aad49=_0x1c1ca6/_0x5118b0;_0x4f5aed=(_0x31fcf0*_0x5aad49+_0x332109)/_0x54e483;_0x17f4ab=erlangb(_0x4f5aed,_0x31792f);_0x340db5=_0x4f5aed/_0x31792f*(0x1-erlangb(_0x4f5aed,_0x31792f));}return _0x5f49bf({'erlangCalls':_0x1c1ca6,'erlangCallToSecond':_0x5118b0/_0x1c1ca6,'erlangAbandonmentRate':_0x17f4ab,'erlangBusyFactor':_0x340db5});});};Dialer[_0x3b90('0x16')][_0x3b90('0x1df')]=function(_0x57d399,_0x2ca8d3,_0x30f87d,_0x1e7c02,_0x5ea4d4,_0x20eb3f){loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x215'));loggerPredictive[_0x3b90('0x7d')]('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',_0x57d399);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x216'),_0x2ca8d3);loggerPredictive['info'](_0x3b90('0x20f'),_0x30f87d);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x210'),_0x1e7c02);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x217'),_0x5ea4d4);loggerPredictive[_0x3b90('0x7d')](_0x3b90('0x84'));return new BPromise(function(_0x11ba7e,_0x559b62){if(_0x57d399<=0x0||isNaN(_0x57d399)){return _0x559b62(msgResponse(_0x3b90('0x218'),_0x3b90('0x43'),_0x3b90('0x212')+_0x57d399));}if(_0x30f87d<=0x0||isNaN(_0x30f87d)){return _0x559b62(msgResponse(_0x3b90('0x218'),'Error','Ts\x20=\x20'+_0x30f87d));}if(_0x1e7c02<=0x0||isNaN(_0x1e7c02)){return _0x559b62(msgResponse(_0x3b90('0x218'),_0x3b90('0x43'),_0x3b90('0x219')+_0x1e7c02));}if(_0x2ca8d3<=0x0||isNaN(_0x2ca8d3)){return _0x559b62(msgResponse(_0x3b90('0x218'),_0x3b90('0x43'),'interval\x20=\x20'+_0x2ca8d3));}if(_0x5ea4d4<=0x0||isNaN(_0x5ea4d4)){return _0x559b62(msgResponse(_0x3b90('0x218'),_0x3b90('0x43'),_0x3b90('0x21a')+_0x5ea4d4));}_0x20eb3f=_0x20eb3f||0x0;var _0x18ab90=0x1/_0x30f87d;var _0x1d288d=0x0;var _0x2da409=0x0;var _0x2922ca=0x0;var _0x3ac020=0x0;for(var _0x438c37=0x0;_0x3ac020<_0x5ea4d4;_0x438c37+=0x1){_0x2da409=_0x438c37/_0x2ca8d3;_0x1d288d=(_0x1e7c02*_0x2da409+_0x20eb3f)/_0x18ab90;_0x2922ca=erlangb(_0x1d288d,_0x57d399);_0x3ac020=_0x1d288d/_0x57d399*(0x1-erlangb(_0x1d288d,_0x57d399));}return _0x11ba7e({'erlangCalls':_0x438c37,'erlangCallToSecond':_0x2ca8d3/_0x438c37,'erlangAbandonmentRate':_0x2922ca,'erlangBusyFactor':_0x3ac020});});};module['exports']=Dialer;
\ No newline at end of file
index 61aecbf..91a18c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d2c=['countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','name','number','responsetime','droptime','starttime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x391863,_0xf5ba73){var _0x4fb1ac=function(_0x362985){while(--_0x362985){_0x391863['push'](_0x391863['shift']());}};_0x4fb1ac(++_0xf5ba73);}(_0x5d2c,0xbb));var _0xc5d2=function(_0x35829f,_0x3f8cbb){_0x35829f=_0x35829f-0x0;var _0x4eb68b=_0x5d2c[_0x35829f];return _0x4eb68b;};'use strict';var util=require(_0xc5d2('0x0'));var _=require(_0xc5d2('0x1'));var moment=require(_0xc5d2('0x2'));function getSeconds(_0xd1b1b7,_0x4dde78){var _0x2e2c0a=moment(_0xd1b1b7)[_0xc5d2('0x3')](0x0);var _0x1b0aa0=moment(_0x4dde78)[_0xc5d2('0x3')](0x0);return _0x2e2c0a[_0xc5d2('0x4')](_0x1b0aa0,_0xc5d2('0x5'));}function QueueCallerAbandon(_0x2355d9,_0x3de1f5){this[_0xc5d2('0x6')]=_0x2355d9[_0xc5d2('0x6')];this['type']=_0x2355d9['type'];this[_0xc5d2('0x7')]=_0x2355d9[_0xc5d2('0x8')]===_0xc5d2('0x9')?_0xc5d2('0xa'):_0x2355d9[_0xc5d2('0x8')];this[_0xc5d2('0xb')]=_0x2355d9[_0xc5d2('0xb')];this[_0xc5d2('0xc')]=_0x2355d9[_0xc5d2('0xc')];this[_0xc5d2('0xd')]=_0x2355d9[_0xc5d2('0xd')];this[_0xc5d2('0xe')]=_0x2355d9['countbusyretry']+_0x2355d9[_0xc5d2('0xc')]+_0x2355d9[_0xc5d2('0xd')]+_0x2355d9[_0xc5d2('0xf')]+_0x2355d9['countdropretry']+_0x2355d9[_0xc5d2('0x10')]+_0x2355d9[_0xc5d2('0x11')]+_0x2355d9[_0xc5d2('0x12')];this['countnosuchnumberretry']=_0x2355d9[_0xc5d2('0xf')];this[_0xc5d2('0x13')]=_0x2355d9[_0xc5d2('0x13')];this[_0xc5d2('0x10')]=_0x2355d9[_0xc5d2('0x10')];this['countmachineretry']=_0x2355d9[_0xc5d2('0x11')];this[_0xc5d2('0x12')]=_0x2355d9['countagentrejectretry'];this[_0xc5d2('0x14')]=_0x3de1f5[_0xc5d2('0x14')];this['calleridname']=_0x2355d9[_0xc5d2('0x15')];this['calleridnum']=_0x2355d9[_0xc5d2('0x16')];this['starttime']=_0x2355d9['starttime'];this[_0xc5d2('0x17')]=_0x2355d9[_0xc5d2('0x17')];this['droptime']=_0x2355d9[_0xc5d2('0x18')];this['endtime']=this[_0xc5d2('0x18')];this['ringtime']=getSeconds(_0x2355d9[_0xc5d2('0x17')],_0x2355d9[_0xc5d2('0x19')]);this['holdtime']=getSeconds(this['droptime'],_0x2355d9[_0xc5d2('0x17')]);this[_0xc5d2('0x1a')]=0x0;this[_0xc5d2('0xa')]=_0x3de1f5['queue'];this[_0xc5d2('0x1b')]=_0x3de1f5['connectedlinename'];this[_0xc5d2('0x1c')]=_0x3de1f5['reason'];this['callback']=_0x2355d9[_0xc5d2('0x1d')];this[_0xc5d2('0x1e')]=_0x2355d9[_0xc5d2('0x1e')];this[_0xc5d2('0x1f')]=_0x2355d9[_0xc5d2('0x1f')];this[_0xc5d2('0x20')]=_0x2355d9[_0xc5d2('0x20')];this['ContactId']=_0x2355d9[_0xc5d2('0x21')];this[_0xc5d2('0x22')]=_0x2355d9[_0xc5d2('0x22')];this['UserId']=_0x2355d9['UserId'];this[_0xc5d2('0x23')]=_0x2355d9[_0xc5d2('0x23')];this['CampaignId']=_0x2355d9[_0xc5d2('0x24')];this[_0xc5d2('0x25')]=_0x2355d9[_0xc5d2('0x25')]||'';this['originatecalleridname']=_0x2355d9[_0xc5d2('0x26')]||'';}module[_0xc5d2('0x27')]=QueueCallerAbandon;
\ No newline at end of file
+var _0xaa00=['recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','name','calleridnum','starttime','responsetime','droptime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat'];(function(_0x51cabf,_0x2828db){var _0x517538=function(_0x24a966){while(--_0x24a966){_0x51cabf['push'](_0x51cabf['shift']());}};_0x517538(++_0x2828db);}(_0xaa00,0x1f4));var _0x0aa0=function(_0x2d7f7b,_0x15f9a9){_0x2d7f7b=_0x2d7f7b-0x0;var _0x5eec22=_0xaa00[_0x2d7f7b];return _0x5eec22;};'use strict';var util=require(_0x0aa0('0x0'));var _=require(_0x0aa0('0x1'));var moment=require(_0x0aa0('0x2'));function getSeconds(_0xa1c3ad,_0x265751){var _0x29252f=moment(_0xa1c3ad)[_0x0aa0('0x3')](0x0);var _0x59cb5c=moment(_0x265751)[_0x0aa0('0x3')](0x0);return _0x29252f[_0x0aa0('0x4')](_0x59cb5c,_0x0aa0('0x5'));}function QueueCallerAbandon(_0x58d326,_0x484708){this[_0x0aa0('0x6')]=_0x58d326[_0x0aa0('0x6')];this['type']=_0x58d326[_0x0aa0('0x7')];this[_0x0aa0('0x8')]=_0x58d326['type']===_0x0aa0('0x9')?_0x0aa0('0xa'):_0x58d326[_0x0aa0('0x7')];this['countbusyretry']=_0x58d326[_0x0aa0('0xb')];this[_0x0aa0('0xc')]=_0x58d326['countcongestionretry'];this['countnoanswerretry']=_0x58d326['countnoanswerretry'];this[_0x0aa0('0xd')]=_0x58d326['countbusyretry']+_0x58d326['countcongestionretry']+_0x58d326['countnoanswerretry']+_0x58d326['countnosuchnumberretry']+_0x58d326[_0x0aa0('0xe')]+_0x58d326[_0x0aa0('0xf')]+_0x58d326[_0x0aa0('0x10')]+_0x58d326[_0x0aa0('0x11')];this[_0x0aa0('0x12')]=_0x58d326[_0x0aa0('0x12')];this[_0x0aa0('0xe')]=_0x58d326[_0x0aa0('0xe')];this[_0x0aa0('0xf')]=_0x58d326['countabandonedretry'];this[_0x0aa0('0x10')]=_0x58d326[_0x0aa0('0x10')];this['countagentrejectretry']=_0x58d326['countagentrejectretry'];this['uniqueid']=_0x484708['uniqueid'];this['calleridname']=_0x58d326[_0x0aa0('0x13')];this[_0x0aa0('0x14')]=_0x58d326['number'];this[_0x0aa0('0x15')]=_0x58d326['starttime'];this[_0x0aa0('0x16')]=_0x58d326['responsetime'];this[_0x0aa0('0x17')]=_0x58d326['droptime'];this['endtime']=this['droptime'];this[_0x0aa0('0x18')]=getSeconds(_0x58d326['responsetime'],_0x58d326[_0x0aa0('0x15')]);this[_0x0aa0('0x19')]=getSeconds(this[_0x0aa0('0x17')],_0x58d326[_0x0aa0('0x16')]);this[_0x0aa0('0x1a')]=0x0;this[_0x0aa0('0xa')]=_0x484708[_0x0aa0('0xa')];this[_0x0aa0('0x1b')]=_0x484708[_0x0aa0('0x1c')];this['reason']=_0x484708[_0x0aa0('0x1d')];this['callback']=_0x58d326[_0x0aa0('0x1e')];this[_0x0aa0('0x1f')]=_0x58d326['callbackuniqueid'];this[_0x0aa0('0x20')]=_0x58d326[_0x0aa0('0x20')];this[_0x0aa0('0x21')]=_0x58d326[_0x0aa0('0x21')];this[_0x0aa0('0x22')]=_0x58d326[_0x0aa0('0x22')];this['ListId']=_0x58d326[_0x0aa0('0x23')];this[_0x0aa0('0x24')]=_0x58d326[_0x0aa0('0x24')];this['VoiceQueueId']=_0x58d326['VoiceQueueId'];this[_0x0aa0('0x25')]=_0x58d326['CampaignId'];this['originatecalleridnum']=_0x58d326[_0x0aa0('0x26')]||'';this[_0x0aa0('0x27')]=_0x58d326[_0x0aa0('0x27')]||'';}module[_0x0aa0('0x28')]=QueueCallerAbandon;
\ No newline at end of file
index a218061..50ad1d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x3c6d18,_0x158a6c){var _0x33d96c=function(_0x2a1a5b){while(--_0x2a1a5b){_0x3c6d18['push'](_0x3c6d18['shift']());}};_0x33d96c(++_0x158a6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
+var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x29e557,_0xea567e){var _0x52c524=function(_0x3e5126){while(--_0x3e5126){_0x29e557['push'](_0x29e557['shift']());}};_0x52c524(++_0xea567e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
index 6b4ea62..2477084 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dfe=['\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','variablesAction','addVariables','ext','isNil','active','SIP/%s','reachable','unmonitored','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','exports','util','bluebird','path','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','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','then','notify','\x20notify\x20','stringify','catch','\x20receiveFax\x20','syncOriginateResponse','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','finally'];(function(_0x2de39f,_0x3e5696){var _0x55b81b=function(_0x50b827){while(--_0x50b827){_0x2de39f['push'](_0x2de39f['shift']());}};_0x55b81b(++_0x3e5696);}(_0x3dfe,0x178));var _0xe3df=function(_0x441c03,_0x5a4e89){_0x441c03=_0x441c03-0x0;var _0x1000d8=_0x3dfe[_0x441c03];return _0x1000d8;};'use strict';var util=require(_0xe3df('0x0'));var _=require('lodash');var BPromise=require(_0xe3df('0x1'));var uuid=require('uuid');var moment=require('moment');var path=require(_0xe3df('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xe3df('0x3'));var logger=require('../../../config/logger')(_0xe3df('0x4'));var ami=require(_0xe3df('0x5'));var rpcDb=require(_0xe3df('0x6'));var Channel=require(_0xe3df('0x7'));var ut=require(_0xe3df('0x8'));var Action=require(_0xe3df('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xe3df('0xa'));var faxMessage=require(_0xe3df('0xb'));function Fax(_0x4c40f9){this[_0xe3df('0xc')]={};this['faxAccounts']=_0x4c40f9[_0xe3df('0xd')];this[_0xe3df('0xe')]=_0x4c40f9[_0xe3df('0xe')];this[_0xe3df('0xf')]={};ami['on'](_0xe3df('0x10'),this[_0xe3df('0x11')][_0xe3df('0x12')](this));ami['on'](_0xe3df('0x13'),this[_0xe3df('0x14')][_0xe3df('0x12')](this));ami['on'](_0xe3df('0x15'),this[_0xe3df('0x16')][_0xe3df('0x12')](this));ami['on'](_0xe3df('0x17'),this['syncNewExten'][_0xe3df('0x12')](this));ami['on'](_0xe3df('0x18'),this[_0xe3df('0x19')][_0xe3df('0x12')](this));ami['on'](_0xe3df('0x1a'),this[_0xe3df('0x1b')][_0xe3df('0x12')](this));ami['on'](_0xe3df('0x1c'),this[_0xe3df('0x1d')]['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xe3df('0x12')](this));}Fax[_0xe3df('0x1e')][_0xe3df('0x11')]=function(_0x1c4d2b){if(_0x1c4d2b['context']===_0xe3df('0x1f')){for(var _0x3bf4f1 in this[_0xe3df('0xd')]){if(this['faxAccounts'][_0xe3df('0x20')](_0x3bf4f1)){if(_0x1c4d2b[_0xe3df('0x21')]===this[_0xe3df('0xd')][_0x3bf4f1][_0xe3df('0x22')]){this[_0xe3df('0xc')][_0x1c4d2b[_0xe3df('0x23')]]={};this[_0xe3df('0xc')][_0x1c4d2b[_0xe3df('0x23')]][_0xe3df('0x24')]=_0x1c4d2b[_0xe3df('0x24')];this[_0xe3df('0xc')][_0x1c4d2b['uniqueid']]['id']=this[_0xe3df('0xd')][_0x3bf4f1]['id'];this[_0xe3df('0xc')][_0x1c4d2b[_0xe3df('0x23')]][_0xe3df('0x25')]=this['faxAccounts'][_0x3bf4f1][_0xe3df('0x25')];logger[_0xe3df('0x26')](_0x1c4d2b['uniqueid'],_0xe3df('0x27'));}}}}if(this[_0xe3df('0xf')][_0x1c4d2b[_0xe3df('0x23')]]){this[_0xe3df('0xc')][_0x1c4d2b['uniqueid']]={};this['channels'][_0x1c4d2b[_0xe3df('0x23')]]['channel']=_0x1c4d2b[_0xe3df('0x24')];logger[_0xe3df('0x26')](_0x1c4d2b[_0xe3df('0x23')],_0xe3df('0x27'));}};Fax[_0xe3df('0x1e')]['syncVarSet']=function(_0x2587a1){if(this[_0xe3df('0xc')][_0x2587a1[_0xe3df('0x23')]]){for(var _0x2d6de6 in _0x2587a1[_0xe3df('0x28')]){if(_0x2587a1[_0xe3df('0x28')]['hasOwnProperty'](_0x2d6de6)){this[_0xe3df('0xc')][_0x2587a1[_0xe3df('0x23')]][_0x2d6de6]=_0x2587a1[_0xe3df('0x29')];}}}};Fax[_0xe3df('0x1e')][_0xe3df('0x16')]=function(_0x71bb93){if(this['channels'][_0x71bb93[_0xe3df('0x23')]]){this[_0xe3df('0xc')][_0x71bb93[_0xe3df('0x23')]][_0xe3df('0x2a')]=_0x71bb93['channelstate'];this[_0xe3df('0xc')][_0x71bb93['uniqueid']]['channelstatedesc']=_0x71bb93[_0xe3df('0x2b')];}};Fax[_0xe3df('0x1e')]['syncNewExten']=function(_0x4424f5){if(this[_0xe3df('0xc')][_0x4424f5['uniqueid']]){for(var _0x8661fe in _0x4424f5[_0xe3df('0x28')]){if(_0x4424f5[_0xe3df('0x28')]['hasOwnProperty'](_0x8661fe)){this[_0xe3df('0xc')][_0x4424f5[_0xe3df('0x23')]][_0x8661fe]=_0x4424f5['value'];}}}};Fax[_0xe3df('0x1e')][_0xe3df('0x19')]=function(_0x251bd5){if(this[_0xe3df('0xc')][_0x251bd5[_0xe3df('0x23')]]){this[_0xe3df('0xc')][_0x251bd5['uniqueid']][_0xe3df('0x2c')]=_0x251bd5[_0xe3df('0x2c')];this['channels'][_0x251bd5[_0xe3df('0x23')]]['status']=_0x251bd5[_0xe3df('0x2d')];this[_0xe3df('0xc')][_0x251bd5[_0xe3df('0x23')]][_0xe3df('0x22')]=_0x251bd5['localstationid'];this[_0xe3df('0xc')][_0x251bd5[_0xe3df('0x23')]][_0xe3df('0x2e')]=_0x251bd5[_0xe3df('0x2e')];logger[_0xe3df('0x26')](_0x251bd5['uniqueid'],_0xe3df('0x2f'));}};Fax[_0xe3df('0x1e')]['syncReceiveFax']=function(_0x38b8a2){var _0x56f61a=this;if(this[_0xe3df('0xc')][_0x38b8a2['uniqueid']]){var _0x369d75=this[_0xe3df('0xc')][_0x38b8a2[_0xe3df('0x23')]]['id'];this[_0xe3df('0xc')][_0x38b8a2[_0xe3df('0x23')]]['remotestationid']=_0x38b8a2[_0xe3df('0x30')];this['channels'][_0x38b8a2[_0xe3df('0x23')]][_0xe3df('0x31')]=_0x38b8a2['pagestransferred'];this[_0xe3df('0xc')][_0x38b8a2[_0xe3df('0x23')]][_0xe3df('0x22')]=_0x38b8a2[_0xe3df('0x22')];this['channels'][_0x38b8a2[_0xe3df('0x23')]][_0xe3df('0x32')]=_0x38b8a2[_0xe3df('0x32')];this[_0xe3df('0xc')][_0x38b8a2['uniqueid']]['transferrate']=_0x38b8a2[_0xe3df('0x33')];this[_0xe3df('0xc')][_0x38b8a2[_0xe3df('0x23')]][_0xe3df('0x2e')]=_0x38b8a2[_0xe3df('0x2e')];this[_0xe3df('0xc')][_0x38b8a2[_0xe3df('0x23')]][_0xe3df('0x34')]=_0x38b8a2[_0xe3df('0x34')];if(this[_0xe3df('0xc')][_0x38b8a2['uniqueid']][_0xe3df('0x31')]>0x0){tiff2pdf(_0x38b8a2[_0xe3df('0x2e')],_0xe3df('0x35'),function(_0x3f09b8){logger[_0xe3df('0x26')](_0x38b8a2['uniqueid'],_0xe3df('0x36'),_0x3f09b8[_0xe3df('0x37')]);attachment[_0xe3df('0x38')]({'name':path['parse'](_0x38b8a2['filename'])[_0xe3df('0x25')],'basename':path[_0xe3df('0x39')](_0x38b8a2[_0xe3df('0x2e')])['name']+_0xe3df('0x3a'),'type':_0xe3df('0x3b')})[_0xe3df('0x3c')](function(_0x17fee4){faxAccount[_0xe3df('0x3d')](_0x369d75,{'from':_0x38b8a2['calleridnum'],'mapKey':_0xe3df('0x4'),'body':path['parse'](_0x38b8a2['filename'])['name']+_0xe3df('0x3a'),'AttachmentId':_0x17fee4['id']})['catch'](function(_0x2736c8){logger['error'](_0x38b8a2[_0xe3df('0x23')],_0xe3df('0x3e'),JSON[_0xe3df('0x3f')](_0x2736c8));});})[_0xe3df('0x40')](function(_0x50b58b){logger['error'](_0x38b8a2[_0xe3df('0x23')],_0xe3df('0x41'),JSON[_0xe3df('0x3f')](_0x50b58b));});});}logger[_0xe3df('0x26')](_0x38b8a2[_0xe3df('0x23')],_0xe3df('0x41'));}};Fax[_0xe3df('0x1e')][_0xe3df('0x42')]=function(_0x274152){if(this[_0xe3df('0xf')][_0x274152[_0xe3df('0x23')]]){_[_0xe3df('0x43')](this['channels'][_0x274152[_0xe3df('0x23')]],_['pick'](_0x274152,[_0xe3df('0x44'),_0xe3df('0x45')]));}};function updateStatus(_0x47ebf0){if(_0x47ebf0[_0xe3df('0x46')]){faxMessage[_0xe3df('0x47')](_0x47ebf0[_0xe3df('0x46')],{'failMessage':_0xe3df('0x48')})[_0xe3df('0x3c')](function(_0x2e22a6){ut[_0xe3df('0x49')](_0xe3df('0x4a'),_0x2e22a6);})['catch'](function(_0x5ec8b5){ut[_0xe3df('0x49')](_0xe3df('0x4b'),_0x5ec8b5);});}else{ut[_0xe3df('0x49')](_0xe3df('0x4c'));}}Fax[_0xe3df('0x1e')][_0xe3df('0x4d')]=function(_0xa80b04,_0x3f2a2d,_0x261a61){var _0x408ffe=this;var _0x4fc6f6={};if(_0x3f2a2d){_0x4fc6f6={'read':_0x3f2a2d};}else{_0x4fc6f6={'failMessage':_0x261a61};}if(this[_0xe3df('0xf')][_0xa80b04][_0xe3df('0x46')]){faxMessage[_0xe3df('0x47')](this[_0xe3df('0xf')][_0xa80b04][_0xe3df('0x46')],_0x4fc6f6)[_0xe3df('0x3c')](function(_0x2f6972){ut['logger'](_0xe3df('0x4e'),_0x2f6972);})['catch'](function(_0x45caec){ut[_0xe3df('0x49')]('[Fax][Message][NoUpdate1]',_0x45caec);})[_0xe3df('0x4f')](function(){delete _0x408ffe[_0xe3df('0xc')][_0xa80b04];delete _0x408ffe[_0xe3df('0xf')][_0xa80b04];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this[_0xe3df('0xc')][_0xa80b04];delete this[_0xe3df('0xf')][_0xa80b04];}};Fax['prototype'][_0xe3df('0x1d')]=function(_0xe623d5){var _0x13f405=this;if(this[_0xe3df('0xc')][_0xe623d5[_0xe3df('0x23')]]){if(this[_0xe3df('0xf')][_0xe623d5[_0xe3df('0x23')]]){this[_0xe3df('0xc')][_0xe623d5[_0xe3df('0x23')]]['id']=this['actions'][_0xe623d5[_0xe3df('0x23')]]['id'];this[_0xe3df('0xc')][_0xe623d5['uniqueid']]['name']=this[_0xe3df('0xf')][_0xe623d5[_0xe3df('0x23')]][_0xe3df('0x25')];}logger[_0xe3df('0x26')](_0xe623d5[_0xe3df('0x23')],this['actions'][_0xe623d5[_0xe3df('0x23')]]?_0xe3df('0x50'):_0xe3df('0x51'),JSON[_0xe3df('0x3f')](this[_0xe3df('0xc')][_0xe623d5[_0xe3df('0x23')]]));if(this[_0xe3df('0xf')][_0xe623d5[_0xe3df('0x23')]]){if(this[_0xe3df('0xc')][_0xe623d5[_0xe3df('0x23')]][_0xe3df('0x52')]>0x0&&this[_0xe3df('0xc')][_0xe623d5[_0xe3df('0x23')]]['faxstatus']===_0xe3df('0x53')){this[_0xe3df('0x4d')](_0xe623d5[_0xe3df('0x23')],!![]);}else{this['updateStatus'](_0xe623d5[_0xe3df('0x23')],![],this[_0xe3df('0xc')][_0xe623d5[_0xe3df('0x23')]][_0xe3df('0x54')]?_0xe3df('0x55')+this['channels'][_0xe623d5[_0xe3df('0x23')]][_0xe3df('0x54')]:_0xe3df('0x56'));}}}};Fax[_0xe3df('0x1e')][_0xe3df('0x57')]=function(_0x2a2de6){var _0x338c01=this;return new BPromise(function(_0x3a70e4,_0x206ec4){_0x338c01[_0xe3df('0x58')](_0x2a2de6,_0x338c01['faxAccounts'][_0x2a2de6['FaxAccountId']])[_0xe3df('0x3c')](function(_0x1e67bf){ut['logger'](_0xe3df('0x59'),_0x1e67bf);_0x3a70e4(ut[_0xe3df('0x37')](_0xe3df('0x5a')));})[_0xe3df('0x40')](function(_0x5eb144){ut[_0xe3df('0x49')](_0xe3df('0x5b'),_0x5eb144);updateStatus(_0x2a2de6);_0x206ec4(ut['message'](_0xe3df('0x5c')));});});};Fax[_0xe3df('0x1e')][_0xe3df('0x5d')]=function(_0x1fff86){var _0x366dea=this;return new BPromise(function(_0x555cf4,_0x19986c){var _0x38bba2=_0x366dea[_0xe3df('0x5e')](_0x366dea[_0xe3df('0xd')][_0x1fff86[_0xe3df('0x5f')]]['Trunk'],_0x1fff86);if(_0x38bba2['isValid']){_0x555cf4(ut[_0xe3df('0x37')](_0xe3df('0x60')));}else{_0x19986c(ut['message'](_0x38bba2[_0xe3df('0x37')]));}});};function originate(_0x1264c8,_0x35b0c0,_0x102e77){return new BPromise(function(_0x8cbea3,_0x3e9ca4){if(_0x102e77){var _0x525108=util[_0xe3df('0x61')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x1264c8['path'])[_0xe3df('0x25')],_0x1264c8[_0xe3df('0x2')]);gs[_0xe3df('0x62')](_0x525108)[_0xe3df('0x3c')](function(){_0x1264c8['path']=util['format'](_0xe3df('0x63'),path[_0xe3df('0x39')](_0x1264c8['path'])[_0xe3df('0x64')],path[_0xe3df('0x39')](_0x1264c8[_0xe3df('0x2')])[_0xe3df('0x25')]);_0x35b0c0[_0xe3df('0x65')]=_0x1264c8[_0xe3df('0x2')];ut[_0xe3df('0x49')]('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut[_0xe3df('0x66')](_0x1264c8,_0x35b0c0))[_0xe3df('0x3c')](function(_0x452acc){_0x8cbea3(_0x452acc);})[_0xe3df('0x40')](function(_0x21083e){_0x3e9ca4(_0x21083e);});})[_0xe3df('0x40')](function(_0xf7b612){_0x3e9ca4(_0xf7b612);});}else{ami['Action'](ut[_0xe3df('0x66')](_0x1264c8,_0x35b0c0))[_0xe3df('0x3c')](function(_0x47a940){_0x8cbea3(_0x47a940);})[_0xe3df('0x40')](function(_0x2669c1){_0x3e9ca4(_0x2669c1);});}});}Fax['prototype'][_0xe3df('0x58')]=function(_0x3d05b9,_0x46689d){var _0x316129=this;return new BPromise(function(_0x39be71,_0x26ee91){var _0x588562=uuid['v4']();var _0xded14f=ut[_0xe3df('0x67')](_0x3d05b9,_0x46689d);_0x316129[_0xe3df('0xf')][_0x588562]=new Action(_0x588562,_0x46689d,_0x3d05b9);var _0x49a9cb=_0x316129[_0xe3df('0xf')][_0x588562];if(path[_0xe3df('0x39')](_0x3d05b9['path'])[_0xe3df('0x68')]==='.pdf'){originate(_0x49a9cb,_0xded14f,!![])[_0xe3df('0x3c')](function(_0x149f33){_0x39be71(_0x149f33);})[_0xe3df('0x40')](function(_0x152012){_0x26ee91(_0x152012);});}else{originate(_0x49a9cb,_0xded14f,![])['then'](function(_0x38014e){_0x39be71(_0x38014e);})['catch'](function(_0x59ccf8){_0x26ee91(_0x59ccf8);});}});};Fax['prototype']['isTrunkReachable']=function(_0x48185a){return!_['isNil'](_0x48185a)&&!_[_0xe3df('0x69')](_0x48185a['name'])&&!_[_0xe3df('0x69')](_0x48185a[_0xe3df('0x6a')])&&_0x48185a[_0xe3df('0x6a')]&&!_[_0xe3df('0x69')](this[_0xe3df('0xe')][util[_0xe3df('0x61')](_0xe3df('0x6b'),_0x48185a[_0xe3df('0x25')])])&&!_[_0xe3df('0x69')](this['trunks'][util[_0xe3df('0x61')](_0xe3df('0x6b'),_0x48185a['name'])][_0xe3df('0x2d')])&&(this[_0xe3df('0xe')][util[_0xe3df('0x61')](_0xe3df('0x6b'),_0x48185a[_0xe3df('0x25')])][_0xe3df('0x2d')]===_0xe3df('0x6c')||this[_0xe3df('0xe')][util[_0xe3df('0x61')]('SIP/%s',_0x48185a[_0xe3df('0x25')])]['status']===_0xe3df('0x6d'));};Fax[_0xe3df('0x1e')][_0xe3df('0x5e')]=function(_0x3adfb9,_0x416840){if(!this['isTrunkReachable'](_0x3adfb9)){ut[_0xe3df('0x49')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xe3df('0x69')](_0x3adfb9)?'':_0x3adfb9[_0xe3df('0x25')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xe3df('0x6e')};}if(_[_0xe3df('0x69')](_0x416840['fax'])){ut[_0xe3df('0x49')](_0xe3df('0x6f'),JSON['stringify'](_0x416840));return{'isValid':![],'message':_0xe3df('0x70')};}if(_[_0xe3df('0x69')](_0x416840[_0xe3df('0x2')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0xe3df('0x3f')](_0x416840));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0xe3df('0x71')]=Fax;
\ No newline at end of file
+var _0xda56=['uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewExten','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','logger','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','FaxAccountId','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','exports','util','lodash','bluebird'];(function(_0x4da356,_0x5235e1){var _0x321b07=function(_0x2bc6f4){while(--_0x2bc6f4){_0x4da356['push'](_0x4da356['shift']());}};_0x321b07(++_0x5235e1);}(_0xda56,0x74));var _0x6da5=function(_0x1e354d,_0x4cdd11){_0x1e354d=_0x1e354d-0x0;var _0x25445d=_0xda56[_0x1e354d];return _0x25445d;};'use strict';var util=require(_0x6da5('0x0'));var _=require(_0x6da5('0x1'));var BPromise=require(_0x6da5('0x2'));var uuid=require(_0x6da5('0x3'));var moment=require(_0x6da5('0x4'));var path=require(_0x6da5('0x5'));var tiff2pdf=require(_0x6da5('0x6'));var gs=require(_0x6da5('0x7'));var logger=require(_0x6da5('0x8'))('fax');var ami=require(_0x6da5('0x9'));var rpcDb=require(_0x6da5('0xa'));var Channel=require(_0x6da5('0xb'));var ut=require(_0x6da5('0xc'));var Action=require(_0x6da5('0xd'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x6da5('0xe'));var faxMessage=require(_0x6da5('0xf'));function Fax(_0x1cff5d){this[_0x6da5('0x10')]={};this[_0x6da5('0x11')]=_0x1cff5d[_0x6da5('0x11')];this[_0x6da5('0x12')]=_0x1cff5d['trunks'];this[_0x6da5('0x13')]={};ami['on'](_0x6da5('0x14'),this[_0x6da5('0x15')][_0x6da5('0x16')](this));ami['on'](_0x6da5('0x17'),this['syncVarSet'][_0x6da5('0x16')](this));ami['on'](_0x6da5('0x18'),this['syncNewState'][_0x6da5('0x16')](this));ami['on']('newexten',this[_0x6da5('0x19')][_0x6da5('0x16')](this));ami['on']('faxstatus',this[_0x6da5('0x1a')]['bind'](this));ami['on'](_0x6da5('0x1b'),this['syncReceiveFax']['bind'](this));ami['on'](_0x6da5('0x1c'),this[_0x6da5('0x1d')][_0x6da5('0x16')](this));ami['on'](_0x6da5('0x1e'),this[_0x6da5('0x1f')][_0x6da5('0x16')](this));}Fax[_0x6da5('0x20')][_0x6da5('0x15')]=function(_0x3e59e1){if(_0x3e59e1['context']==='from-voip-provider'){for(var _0x349ca4 in this[_0x6da5('0x11')]){if(this[_0x6da5('0x11')][_0x6da5('0x21')](_0x349ca4)){if(_0x3e59e1[_0x6da5('0x22')]===this[_0x6da5('0x11')][_0x349ca4][_0x6da5('0x23')]){this[_0x6da5('0x10')][_0x3e59e1[_0x6da5('0x24')]]={};this[_0x6da5('0x10')][_0x3e59e1[_0x6da5('0x24')]][_0x6da5('0x25')]=_0x3e59e1[_0x6da5('0x25')];this[_0x6da5('0x10')][_0x3e59e1[_0x6da5('0x24')]]['id']=this[_0x6da5('0x11')][_0x349ca4]['id'];this[_0x6da5('0x10')][_0x3e59e1[_0x6da5('0x24')]][_0x6da5('0x26')]=this[_0x6da5('0x11')][_0x349ca4]['name'];logger['info'](_0x3e59e1['uniqueid'],_0x6da5('0x27'));}}}}if(this[_0x6da5('0x13')][_0x3e59e1[_0x6da5('0x24')]]){this[_0x6da5('0x10')][_0x3e59e1[_0x6da5('0x24')]]={};this[_0x6da5('0x10')][_0x3e59e1['uniqueid']][_0x6da5('0x25')]=_0x3e59e1[_0x6da5('0x25')];logger[_0x6da5('0x28')](_0x3e59e1[_0x6da5('0x24')],'\x20syncNewchannel\x20');}};Fax['prototype']['syncVarSet']=function(_0x34d332){if(this[_0x6da5('0x10')][_0x34d332[_0x6da5('0x24')]]){for(var _0x40371e in _0x34d332[_0x6da5('0x29')]){if(_0x34d332[_0x6da5('0x29')]['hasOwnProperty'](_0x40371e)){this[_0x6da5('0x10')][_0x34d332[_0x6da5('0x24')]][_0x40371e]=_0x34d332[_0x6da5('0x2a')];}}}};Fax[_0x6da5('0x20')]['syncNewState']=function(_0x18bf05){if(this[_0x6da5('0x10')][_0x18bf05['uniqueid']]){this['channels'][_0x18bf05['uniqueid']][_0x6da5('0x2b')]=_0x18bf05['channelstate'];this['channels'][_0x18bf05[_0x6da5('0x24')]][_0x6da5('0x2c')]=_0x18bf05['channelstatedesc'];}};Fax[_0x6da5('0x20')]['syncNewExten']=function(_0x57c47c){if(this['channels'][_0x57c47c[_0x6da5('0x24')]]){for(var _0x1100ec in _0x57c47c[_0x6da5('0x29')]){if(_0x57c47c[_0x6da5('0x29')]['hasOwnProperty'](_0x1100ec)){this[_0x6da5('0x10')][_0x57c47c['uniqueid']][_0x1100ec]=_0x57c47c[_0x6da5('0x2a')];}}}};Fax['prototype'][_0x6da5('0x1a')]=function(_0x118019){if(this[_0x6da5('0x10')][_0x118019[_0x6da5('0x24')]]){this['channels'][_0x118019[_0x6da5('0x24')]][_0x6da5('0x2d')]=_0x118019[_0x6da5('0x2d')];this['channels'][_0x118019[_0x6da5('0x24')]]['status']=_0x118019[_0x6da5('0x2e')];this[_0x6da5('0x10')][_0x118019[_0x6da5('0x24')]][_0x6da5('0x23')]=_0x118019[_0x6da5('0x23')];this[_0x6da5('0x10')][_0x118019[_0x6da5('0x24')]][_0x6da5('0x2f')]=_0x118019[_0x6da5('0x2f')];logger['info'](_0x118019[_0x6da5('0x24')],_0x6da5('0x30'));}};Fax[_0x6da5('0x20')][_0x6da5('0x31')]=function(_0x3e7c4f){var _0x17a9fb=this;if(this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]]){var _0x4d724e=this['channels'][_0x3e7c4f[_0x6da5('0x24')]]['id'];this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]]['remotestationid']=_0x3e7c4f[_0x6da5('0x32')];this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]]['pagestransferred']=_0x3e7c4f[_0x6da5('0x33')];this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]][_0x6da5('0x23')]=_0x3e7c4f[_0x6da5('0x23')];this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]][_0x6da5('0x34')]=_0x3e7c4f['resolution'];this['channels'][_0x3e7c4f[_0x6da5('0x24')]][_0x6da5('0x35')]=_0x3e7c4f['transferrate'];this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]][_0x6da5('0x2f')]=_0x3e7c4f['filename'];this[_0x6da5('0x10')][_0x3e7c4f['uniqueid']][_0x6da5('0x36')]=_0x3e7c4f['calleridnum'];if(this[_0x6da5('0x10')][_0x3e7c4f[_0x6da5('0x24')]]['pagestransferred']>0x0){tiff2pdf(_0x3e7c4f['filename'],_0x6da5('0x37'),function(_0x582f55){logger[_0x6da5('0x28')](_0x3e7c4f[_0x6da5('0x24')],_0x6da5('0x38'),_0x582f55[_0x6da5('0x39')]);attachment[_0x6da5('0x3a')]({'name':path['parse'](_0x3e7c4f[_0x6da5('0x2f')])['name'],'basename':path[_0x6da5('0x3b')](_0x3e7c4f['filename'])[_0x6da5('0x26')]+_0x6da5('0x3c'),'type':_0x6da5('0x3d')})[_0x6da5('0x3e')](function(_0x58e1b7){faxAccount[_0x6da5('0x3f')](_0x4d724e,{'from':_0x3e7c4f[_0x6da5('0x36')],'mapKey':_0x6da5('0x40'),'body':path[_0x6da5('0x3b')](_0x3e7c4f[_0x6da5('0x2f')])[_0x6da5('0x26')]+_0x6da5('0x3c'),'AttachmentId':_0x58e1b7['id']})[_0x6da5('0x41')](function(_0x1d8713){logger[_0x6da5('0x42')](_0x3e7c4f[_0x6da5('0x24')],_0x6da5('0x43'),JSON[_0x6da5('0x44')](_0x1d8713));});})[_0x6da5('0x41')](function(_0x1857d7){logger[_0x6da5('0x42')](_0x3e7c4f[_0x6da5('0x24')],_0x6da5('0x45'),JSON['stringify'](_0x1857d7));});});}logger[_0x6da5('0x28')](_0x3e7c4f['uniqueid'],'\x20receiveFax\x20');}};Fax[_0x6da5('0x20')][_0x6da5('0x1f')]=function(_0x46a2d9){if(this[_0x6da5('0x13')][_0x46a2d9[_0x6da5('0x24')]]){_[_0x6da5('0x46')](this['channels'][_0x46a2d9[_0x6da5('0x24')]],_['pick'](_0x46a2d9,[_0x6da5('0x47'),_0x6da5('0x48')]));}};function updateStatus(_0x33d5c3){if(_0x33d5c3[_0x6da5('0x49')]){faxMessage[_0x6da5('0x4a')](_0x33d5c3['AttachmentId'],{'failMessage':_0x6da5('0x4b')})[_0x6da5('0x3e')](function(_0x717e3d){ut['logger'](_0x6da5('0x4c'),_0x717e3d);})[_0x6da5('0x41')](function(_0x1aacb4){ut['logger'](_0x6da5('0x4d'),_0x1aacb4);});}else{ut[_0x6da5('0x4e')](_0x6da5('0x4f'));}}Fax[_0x6da5('0x20')]['updateStatus']=function(_0x5a58ba,_0x3b7b58,_0x909000){var _0x3b6374=this;var _0x512094={};if(_0x3b7b58){_0x512094={'read':_0x3b7b58};}else{_0x512094={'failMessage':_0x909000};}if(this[_0x6da5('0x13')][_0x5a58ba][_0x6da5('0x49')]){faxMessage[_0x6da5('0x4a')](this['actions'][_0x5a58ba]['AttachmentId'],_0x512094)[_0x6da5('0x3e')](function(_0x528742){ut['logger']('[Fax][Message][Updated]',_0x528742);})['catch'](function(_0x51ce3d){ut[_0x6da5('0x4e')](_0x6da5('0x50'),_0x51ce3d);})['finally'](function(){delete _0x3b6374[_0x6da5('0x10')][_0x5a58ba];delete _0x3b6374[_0x6da5('0x13')][_0x5a58ba];});}else{ut[_0x6da5('0x4e')](_0x6da5('0x51'));delete this[_0x6da5('0x10')][_0x5a58ba];delete this[_0x6da5('0x13')][_0x5a58ba];}};Fax[_0x6da5('0x20')]['syncHangup']=function(_0x59b389){var _0x2eb2d9=this;if(this['channels'][_0x59b389[_0x6da5('0x24')]]){if(this[_0x6da5('0x13')][_0x59b389[_0x6da5('0x24')]]){this['channels'][_0x59b389[_0x6da5('0x24')]]['id']=this[_0x6da5('0x13')][_0x59b389[_0x6da5('0x24')]]['id'];this[_0x6da5('0x10')][_0x59b389[_0x6da5('0x24')]][_0x6da5('0x26')]=this['actions'][_0x59b389[_0x6da5('0x24')]]['name'];}logger[_0x6da5('0x28')](_0x59b389[_0x6da5('0x24')],this[_0x6da5('0x13')][_0x59b389[_0x6da5('0x24')]]?_0x6da5('0x52'):_0x6da5('0x53'),JSON[_0x6da5('0x44')](this[_0x6da5('0x10')][_0x59b389[_0x6da5('0x24')]]));if(this[_0x6da5('0x13')][_0x59b389[_0x6da5('0x24')]]){if(this[_0x6da5('0x10')][_0x59b389[_0x6da5('0x24')]]['faxpages']>0x0&&this[_0x6da5('0x10')][_0x59b389[_0x6da5('0x24')]][_0x6da5('0x54')]===_0x6da5('0x55')){this[_0x6da5('0x56')](_0x59b389['uniqueid'],!![]);}else{this[_0x6da5('0x56')](_0x59b389[_0x6da5('0x24')],![],this[_0x6da5('0x10')][_0x59b389[_0x6da5('0x24')]][_0x6da5('0x57')]?_0x6da5('0x58')+this[_0x6da5('0x10')][_0x59b389['uniqueid']][_0x6da5('0x57')]:_0x6da5('0x59'));}}}};Fax[_0x6da5('0x20')]['send']=function(_0xb98ae2){var _0x2aa528=this;return new BPromise(function(_0x48c582,_0x3e74ce){_0x2aa528[_0x6da5('0x5a')](_0xb98ae2,_0x2aa528[_0x6da5('0x11')][_0xb98ae2['FaxAccountId']])['then'](function(_0x58ee7d){ut[_0x6da5('0x4e')]('[Fax][execOriginate][success]',_0x58ee7d);_0x48c582(ut[_0x6da5('0x39')]('Fax\x20received'));})[_0x6da5('0x41')](function(_0x503f0f){ut[_0x6da5('0x4e')](_0x6da5('0x5b'),_0x503f0f);updateStatus(_0xb98ae2);_0x3e74ce(ut[_0x6da5('0x39')](_0x6da5('0x5c')));});});};Fax['prototype']['checkAfterSend']=function(_0x7c4d69){var _0x59b471=this;return new BPromise(function(_0x382873,_0x3316e3){var _0x115545=_0x59b471[_0x6da5('0x5d')](_0x59b471[_0x6da5('0x11')][_0x7c4d69[_0x6da5('0x5e')]]['Trunk'],_0x7c4d69);if(_0x115545[_0x6da5('0x5f')]){_0x382873(ut[_0x6da5('0x39')](_0x6da5('0x60')));}else{_0x3316e3(ut[_0x6da5('0x39')](_0x115545[_0x6da5('0x39')]));}});};function originate(_0x4cad1b,_0x252523,_0x466bf8){return new BPromise(function(_0x3fd69b,_0x19daf5){if(_0x466bf8){var _0x3bbbd3=util[_0x6da5('0x61')](_0x6da5('0x62'),path[_0x6da5('0x3b')](_0x4cad1b[_0x6da5('0x5')])['name'],_0x4cad1b['path']);gs['execute'](_0x3bbbd3)[_0x6da5('0x3e')](function(){_0x4cad1b[_0x6da5('0x5')]=util['format'](_0x6da5('0x63'),path[_0x6da5('0x3b')](_0x4cad1b['path'])[_0x6da5('0x64')],path[_0x6da5('0x3b')](_0x4cad1b[_0x6da5('0x5')])[_0x6da5('0x26')]);_0x252523[_0x6da5('0x65')]=_0x4cad1b[_0x6da5('0x5')];ut[_0x6da5('0x4e')](_0x6da5('0x66'),'');ami[_0x6da5('0x67')](ut['variablesAction'](_0x4cad1b,_0x252523))[_0x6da5('0x3e')](function(_0x2c9d37){_0x3fd69b(_0x2c9d37);})[_0x6da5('0x41')](function(_0x5a6b04){_0x19daf5(_0x5a6b04);});})[_0x6da5('0x41')](function(_0x1dfe1f){_0x19daf5(_0x1dfe1f);});}else{ami[_0x6da5('0x67')](ut[_0x6da5('0x68')](_0x4cad1b,_0x252523))['then'](function(_0x1bce99){_0x3fd69b(_0x1bce99);})[_0x6da5('0x41')](function(_0x570b6e){_0x19daf5(_0x570b6e);});}});}Fax['prototype']['execOriginate']=function(_0x2cc49f,_0x124adc){var _0x42fce9=this;return new BPromise(function(_0x134705,_0x4532b9){var _0x534e1a=uuid['v4']();var _0x405e70=ut[_0x6da5('0x69')](_0x2cc49f,_0x124adc);_0x42fce9[_0x6da5('0x13')][_0x534e1a]=new Action(_0x534e1a,_0x124adc,_0x2cc49f);var _0x3f8bcc=_0x42fce9[_0x6da5('0x13')][_0x534e1a];if(path['parse'](_0x2cc49f[_0x6da5('0x5')])[_0x6da5('0x6a')]==='.pdf'){originate(_0x3f8bcc,_0x405e70,!![])[_0x6da5('0x3e')](function(_0x14af39){_0x134705(_0x14af39);})[_0x6da5('0x41')](function(_0x15715e){_0x4532b9(_0x15715e);});}else{originate(_0x3f8bcc,_0x405e70,![])['then'](function(_0x2e593f){_0x134705(_0x2e593f);})[_0x6da5('0x41')](function(_0x67a5f1){_0x4532b9(_0x67a5f1);});}});};Fax[_0x6da5('0x20')][_0x6da5('0x6b')]=function(_0xae2807){return!_[_0x6da5('0x6c')](_0xae2807)&&!_[_0x6da5('0x6c')](_0xae2807[_0x6da5('0x26')])&&!_[_0x6da5('0x6c')](_0xae2807[_0x6da5('0x6d')])&&_0xae2807['active']&&!_['isNil'](this[_0x6da5('0x12')][util['format'](_0x6da5('0x6e'),_0xae2807['name'])])&&!_[_0x6da5('0x6c')](this[_0x6da5('0x12')][util[_0x6da5('0x61')](_0x6da5('0x6e'),_0xae2807['name'])][_0x6da5('0x2e')])&&(this['trunks'][util[_0x6da5('0x61')](_0x6da5('0x6e'),_0xae2807[_0x6da5('0x26')])][_0x6da5('0x2e')]===_0x6da5('0x6f')||this[_0x6da5('0x12')][util['format'](_0x6da5('0x6e'),_0xae2807[_0x6da5('0x26')])][_0x6da5('0x2e')]===_0x6da5('0x70'));};Fax['prototype']['checkTrunk']=function(_0x4ff6b5,_0x24ed9d){if(!this['isTrunkReachable'](_0x4ff6b5)){ut[_0x6da5('0x4e')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_['isNil'](_0x4ff6b5)?'':_0x4ff6b5[_0x6da5('0x26')]+_0x6da5('0x71'));return{'isValid':![],'message':_0x6da5('0x72')};}if(_[_0x6da5('0x6c')](_0x24ed9d[_0x6da5('0x40')])){ut[_0x6da5('0x4e')]('[Fax][checkTrunk][Empty\x20Fax]',JSON['stringify'](_0x24ed9d));return{'isValid':![],'message':_0x6da5('0x73')};}if(_[_0x6da5('0x6c')](_0x24ed9d[_0x6da5('0x5')])){ut[_0x6da5('0x4e')](_0x6da5('0x74'),JSON[_0x6da5('0x44')](_0x24ed9d));return{'isValid':![],'message':_0x6da5('0x75')};}return{'isValid':!![],'message':'Is\x20Valid'};};module[_0x6da5('0x76')]=Fax;
\ No newline at end of file
index 82ef3e6..3cda24c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8433=['then','catch','util','bluebird','preview','lodash','../rpc/faxAccount','inspect','notify','resolve'];(function(_0x221923,_0x14f781){var _0x4eadfb=function(_0x498be6){while(--_0x498be6){_0x221923['push'](_0x221923['shift']());}};_0x4eadfb(++_0x14f781);}(_0x8433,0x138));var _0x3843=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x8433[_0x4d1ee9];return _0x9a5456;};'use strict';var util=require(_0x3843('0x0'));var BPromise=require(_0x3843('0x1'));var logger=require('../../../config/logger')(_0x3843('0x2'));var _=require(_0x3843('0x3'));var faxAccount=require(_0x3843('0x4'));function loggerCatch(_0x242521){return function(_0x2b0746){logger['error'](_0x242521,util[_0x3843('0x5')](_0x2b0746,{'showHidden':![],'depth':null}));};}exports[_0x3843('0x6')]=function(_0x51d638,_0x5b6e1c){return BPromise[_0x3843('0x7')]()[_0x3843('0x8')](faxAccount['notify'](_0x51d638,_0x5b6e1c))[_0x3843('0x9')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
+var _0xe3d0=['[Notify]\x20','bluebird','preview','../rpc/faxAccount','error','inspect','notify','resolve','then','catch'];(function(_0x29bdfe,_0x251370){var _0x32309a=function(_0x387e29){while(--_0x387e29){_0x29bdfe['push'](_0x29bdfe['shift']());}};_0x32309a(++_0x251370);}(_0xe3d0,0x187));var _0x0e3d=function(_0x423535,_0x1c65ab){_0x423535=_0x423535-0x0;var _0x4ea58a=_0xe3d0[_0x423535];return _0x4ea58a;};'use strict';var util=require('util');var BPromise=require(_0x0e3d('0x0'));var logger=require('../../../config/logger')(_0x0e3d('0x1'));var _=require('lodash');var faxAccount=require(_0x0e3d('0x2'));function loggerCatch(_0x14c759){return function(_0xb7a9d5){logger[_0x0e3d('0x3')](_0x14c759,util[_0x0e3d('0x4')](_0xb7a9d5,{'showHidden':![],'depth':null}));};}exports[_0x0e3d('0x5')]=function(_0x3f51ae,_0x3419dd){return BPromise[_0x0e3d('0x6')]()[_0x0e3d('0x7')](faxAccount[_0x0e3d('0x5')](_0x3f51ae,_0x3419dd))[_0x0e3d('0x8')](loggerCatch(_0x0e3d('0x9')));};
\ No newline at end of file
index 6c6f413..c5da46c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f47=['Exec\x20gs','\x20Error\x20:','inspect','bluebird','info'];(function(_0x5ede0b,_0x1cd45c){var _0x5d689c=function(_0x3157bd){while(--_0x3157bd){_0x5ede0b['push'](_0x5ede0b['shift']());}};_0x5d689c(++_0x1cd45c);}(_0x0f47,0x12f));var _0x70f4=function(_0x5768ed,_0x53134c){_0x5768ed=_0x5768ed-0x0;var _0x255215=_0x0f47[_0x5768ed];return _0x255215;};'use strict';var util=require('util');var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x70f4('0x0'));var exec=require('child_process')['exec'];exports['execute']=function(_0x23834f){return new BPromise(function(_0x3d1c64,_0x64f568){exec(_0x23834f,function(_0x286632,_0x530b62,_0x1a4fb3){logger[_0x70f4('0x1')](_0x70f4('0x2'),_0x530b62);if(_0x286632){logger['info']('Exec\x20gs',_0x70f4('0x3'),util[_0x70f4('0x4')](_0x286632,{'showHidden':![],'depth':null}),_0x530b62,_0x1a4fb3);_0x64f568(_0x286632);}_0x3d1c64(_0x530b62);});});};
\ No newline at end of file
+var _0x2bca=['bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax'];(function(_0x16c33f,_0xd2ad80){var _0x104036=function(_0x2b86b7){while(--_0x2b86b7){_0x16c33f['push'](_0x16c33f['shift']());}};_0x104036(++_0xd2ad80);}(_0x2bca,0xb1));var _0xa2bc=function(_0x23ddca,_0x483401){_0x23ddca=_0x23ddca-0x0;var _0x2dc135=_0x2bca[_0x23ddca];return _0x2dc135;};'use strict';var util=require(_0xa2bc('0x0'));var logger=require(_0xa2bc('0x1'))(_0xa2bc('0x2'));var BPromise=require(_0xa2bc('0x3'));var exec=require('child_process')[_0xa2bc('0x4')];exports[_0xa2bc('0x5')]=function(_0x2a3c4d){return new BPromise(function(_0xc3e493,_0x1c64c6){exec(_0x2a3c4d,function(_0x22ed8b,_0x56c9a9,_0x1c76d0){logger[_0xa2bc('0x6')](_0xa2bc('0x7'),_0x56c9a9);if(_0x22ed8b){logger[_0xa2bc('0x6')](_0xa2bc('0x7'),_0xa2bc('0x8'),util['inspect'](_0x22ed8b,{'showHidden':![],'depth':null}),_0x56c9a9,_0x1c76d0);_0x1c64c6(_0x22ed8b);}_0xc3e493(_0x56c9a9);});});};
\ No newline at end of file
index b592d60..4876658 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49ea=['localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','headerinfo','util','lodash','moment','../../../../config/logger','fax','message','logger','info','addVariables','ecm','maxrate','modem','gateway','faxdetect','t38timeout'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x49ea,0x1b9));var _0xa49e=function(_0x5ef2fc,_0x1b8016){_0x5ef2fc=_0x5ef2fc-0x0;var _0x2ec96b=_0x49ea[_0x5ef2fc];return _0x2ec96b;};'use strict';var util=require(_0xa49e('0x0'));var _=require(_0xa49e('0x1'));var moment=require(_0xa49e('0x2'));var logger=require(_0xa49e('0x3'))(_0xa49e('0x4'));exports[_0xa49e('0x5')]=function(_0x2b64f4){return{'message':_0x2b64f4};};exports[_0xa49e('0x6')]=function(_0x3ac3e3,_0x4b799e){logger[_0xa49e('0x7')](_0x3ac3e3,util['inspect'](_0x4b799e,{'showHidden':![],'depth':null}));};exports[_0xa49e('0x8')]=function(_0x487237,_0x398e61){var _0x1faba5={'XMF-ECM':_0x398e61[_0xa49e('0x9')],'XMF-HEADERINFO':_0x398e61['headerinfo'],'XMF-MINRATE':_0x398e61['minrate'],'XMF-MAXRATE':_0x398e61[_0xa49e('0xa')],'XMF-MODEM':util['format']('\x22%s\x22',_0x398e61[_0xa49e('0xb')]),'XMF-GATEWAY':_0x398e61[_0xa49e('0xc')],'XMF-FAXDETECT':_0x398e61[_0xa49e('0xd')],'XMF-T38TIMEOUT':_0x398e61[_0xa49e('0xe')],'XMF-LOCALSTATIONID':_0x398e61[_0xa49e('0xf')],'XMF-PATH':_0x487237['path']};return _0x1faba5;};exports[_0xa49e('0x10')]=function(_0x230748,_0x418a9b){return{'actionid':_0x230748[_0xa49e('0x11')],'action':_0xa49e('0x12'),'channel':_0x230748[_0xa49e('0x13')],'Exten':_0xa49e('0x14'),'Context':_0xa49e('0x15'),'Priority':'1','callerid':util[_0xa49e('0x16')]('\x22%s\x22\x20<%s>',_0x230748[_0xa49e('0x17')]?_0x230748[_0xa49e('0x17')]:'',_0x230748[_0xa49e('0xf')]),'variable':_0x418a9b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x230748['uniqueid']};};
\ No newline at end of file
+var _0x716b=['format','headerinfo','uniqueid','util','lodash','moment','message','inspect','ecm','minrate','maxrate','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','originate','xcally-motion-fax','from-sip'];(function(_0x49e643,_0x36f759){var _0x3774cd=function(_0x1c515b){while(--_0x1c515b){_0x49e643['push'](_0x49e643['shift']());}};_0x3774cd(++_0x36f759);}(_0x716b,0x1a5));var _0xb716=function(_0x3ce937,_0x568d7d){_0x3ce937=_0x3ce937-0x0;var _0x41d2fa=_0x716b[_0x3ce937];return _0x41d2fa;};'use strict';var util=require(_0xb716('0x0'));var _=require(_0xb716('0x1'));var moment=require(_0xb716('0x2'));var logger=require('../../../../config/logger')('fax');exports[_0xb716('0x3')]=function(_0x249bd7){return{'message':_0x249bd7};};exports['logger']=function(_0x23a677,_0x6f181a){logger['info'](_0x23a677,util[_0xb716('0x4')](_0x6f181a,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x533d07,_0x10c704){var _0x5da4ed={'XMF-ECM':_0x10c704[_0xb716('0x5')],'XMF-HEADERINFO':_0x10c704['headerinfo'],'XMF-MINRATE':_0x10c704[_0xb716('0x6')],'XMF-MAXRATE':_0x10c704[_0xb716('0x7')],'XMF-MODEM':util['format'](_0xb716('0x8'),_0x10c704['modem']),'XMF-GATEWAY':_0x10c704[_0xb716('0x9')],'XMF-FAXDETECT':_0x10c704[_0xb716('0xa')],'XMF-T38TIMEOUT':_0x10c704[_0xb716('0xb')],'XMF-LOCALSTATIONID':_0x10c704[_0xb716('0xc')],'XMF-PATH':_0x533d07['path']};return _0x5da4ed;};exports['variablesAction']=function(_0xf25bdc,_0x116f4a){return{'actionid':_0xf25bdc['uniqueid'],'action':_0xb716('0xd'),'channel':_0xf25bdc['channel'],'Exten':_0xb716('0xe'),'Context':_0xb716('0xf'),'Priority':'1','callerid':util[_0xb716('0x10')]('\x22%s\x22\x20<%s>',_0xf25bdc[_0xb716('0x11')]?_0xf25bdc[_0xb716('0x11')]:'',_0xf25bdc['localstationid']),'variable':_0x116f4a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0xf25bdc[_0xb716('0x12')]};};
\ No newline at end of file
index 0666fe0..f5c81d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3338=['listen','bluebird','util','moment','./server','./realtime','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x3338,0xf5));var _0x8333=function(_0x2bf258,_0x5e0bb2){_0x2bf258=_0x2bf258-0x0;var _0x3b43af=_0x3338[_0x2bf258];return _0x3b43af;};'use strict';var BPromise=require(_0x8333('0x0'));var util=require(_0x8333('0x1'));var moment=require(_0x8333('0x2'));var server=require(_0x8333('0x3'));var Realtime=require(_0x8333('0x4'));var Report=require('./report');var Acw=require(_0x8333('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x8333('0x6'));var Preview=require(_0x8333('0x7'));var Fax=require(_0x8333('0x8'));var user=require(_0x8333('0x9'));var voiceQueue=require(_0x8333('0xa'));var voiceQueueReport=require(_0x8333('0xb'));var voiceCallReport=require(_0x8333('0xc'));var trunk=require(_0x8333('0xd'));var trigger=require(_0x8333('0xe'));var template=require('./rpc/template');var cmHopperHistory=require(_0x8333('0xf'));var campaign=require(_0x8333('0x10'));var voiceExtension=require(_0x8333('0x11'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x8333('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x8333('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x8333('0x14'));var freshsales=require(_0x8333('0x15'));var servicenow=require(_0x8333('0x16'));var dynamics365=require(_0x8333('0x17'));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()[_0x8333('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x8333('0x18')](_0x8333('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x8333('0x1a')](user[_0x8333('0x1b')]())[_0x8333('0x1a')](realtime[_0x8333('0x1c')]())[_0x8333('0x1a')](user[_0x8333('0x1d')]())[_0x8333('0x1a')](realtime[_0x8333('0x1e')]())[_0x8333('0x1a')](trunk['getTrunks']())[_0x8333('0x1a')](realtime[_0x8333('0x1f')]())[_0x8333('0x1a')](voiceQueue[_0x8333('0x20')]())[_0x8333('0x1a')](realtime['initVoiceQueues']())[_0x8333('0x1a')](trigger[_0x8333('0x21')]())['then'](realtime['initTriggers']())[_0x8333('0x1a')](template['getTemplates']())[_0x8333('0x1a')](realtime[_0x8333('0x22')]())['then'](zendesk[_0x8333('0x23')]())[_0x8333('0x1a')](realtime[_0x8333('0x24')]())[_0x8333('0x1a')](salesforce['getSalesforceAccounts']())[_0x8333('0x1a')](realtime[_0x8333('0x25')]())['then'](sugarcrm['getSugarcrmAccounts']())[_0x8333('0x1a')](realtime[_0x8333('0x26')]())[_0x8333('0x1a')](freshdesk[_0x8333('0x27')]())[_0x8333('0x1a')](realtime['initFreshdeskAccounts']())['then'](desk[_0x8333('0x28')]())[_0x8333('0x1a')](realtime[_0x8333('0x29')]())[_0x8333('0x1a')](zoho[_0x8333('0x2a')]())['then'](realtime[_0x8333('0x2b')]())[_0x8333('0x1a')](vtiger[_0x8333('0x2c')]())[_0x8333('0x1a')](realtime[_0x8333('0x2d')]())[_0x8333('0x1a')](freshsales[_0x8333('0x2e')]())[_0x8333('0x1a')](realtime[_0x8333('0x2f')]())['then'](servicenow['getServicenowAccounts']())['then'](realtime['initServicenowAccounts']())[_0x8333('0x1a')](dynamics365[_0x8333('0x30')]())['then'](realtime['initDynamics365Accounts']())[_0x8333('0x1a')](campaign[_0x8333('0x31')]())['then'](realtime['initCampaigns']())['then'](voiceExtension[_0x8333('0x32')]())['then'](realtime['initVoiceExtensions']())[_0x8333('0x1a')](faxAccount[_0x8333('0x33')]())[_0x8333('0x1a')](realtime['initFaxAccounts']())[_0x8333('0x1a')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x8333('0x1a')](voiceQueueReport[_0x8333('0x34')]())[_0x8333('0x1a')](realtime[_0x8333('0x35')]())[_0x8333('0x1a')](cmHopperHistory[_0x8333('0x36')]())[_0x8333('0x1a')](realtime[_0x8333('0x37')]())[_0x8333('0x1a')](cmHopperHistory['getCampaignHopperHistory']())[_0x8333('0x1a')](realtime[_0x8333('0x38')]())[_0x8333('0x1a')](voiceCallReport[_0x8333('0x39')]())[_0x8333('0x1a')](realtime['initVoiceCallReports']())[_0x8333('0x1a')](function(_0x3c913c){})[_0x8333('0x3a')](function(_0x36f7d8){console[_0x8333('0x3b')](_0x36f7d8);});}function main(){return server[_0x8333('0x3c')](realtime,preview,fax)[_0x8333('0x1a')](function(_0x1e967c){return initRealtime();})[_0x8333('0x1a')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x18dbf3){console[_0x8333('0x3b')](_0x18dbf3);});}main();
\ No newline at end of file
+var _0xbf81=['getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','sync','util','moment','./server','./realtime','./report','./acw','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceCallReport','./rpc/trunk','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbf81,0x194));var _0x1bf8=function(_0x333b8c,_0x8c792d){_0x333b8c=_0x333b8c-0x0;var _0x3af725=_0xbf81[_0x333b8c];return _0x3af725;};'use strict';var BPromise=require('bluebird');var util=require(_0x1bf8('0x0'));var moment=require(_0x1bf8('0x1'));var server=require(_0x1bf8('0x2'));var Realtime=require(_0x1bf8('0x3'));var Report=require(_0x1bf8('0x4'));var Acw=require(_0x1bf8('0x5'));var Trigger=require('./trigger');var Dialer=require(_0x1bf8('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x1bf8('0x7'));var voiceQueue=require(_0x1bf8('0x8'));var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x1bf8('0x9'));var trunk=require(_0x1bf8('0xa'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x1bf8('0xb'));var faxAccount=require(_0x1bf8('0xc'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x1bf8('0xd'));var sugarcrm=require(_0x1bf8('0xe'));var freshdesk=require(_0x1bf8('0xf'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x1bf8('0x10'));var vtiger=require(_0x1bf8('0x11'));var freshsales=require(_0x1bf8('0x12'));var servicenow=require(_0x1bf8('0x13'));var dynamics365=require(_0x1bf8('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x1bf8('0x15')](_0x1bf8('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1bf8('0x15')](_0x1bf8('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x1bf8('0x17')]()['then'](user['getAgents']())[_0x1bf8('0x18')](realtime['initAgents']())[_0x1bf8('0x18')](user[_0x1bf8('0x19')]())['then'](realtime[_0x1bf8('0x1a')]())[_0x1bf8('0x18')](trunk[_0x1bf8('0x1b')]())['then'](realtime[_0x1bf8('0x1c')]())[_0x1bf8('0x18')](voiceQueue['getVoiceQueues']())[_0x1bf8('0x18')](realtime[_0x1bf8('0x1d')]())['then'](trigger[_0x1bf8('0x1e')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x1f')]())[_0x1bf8('0x18')](template[_0x1bf8('0x20')]())[_0x1bf8('0x18')](realtime['initTemplates']())[_0x1bf8('0x18')](zendesk[_0x1bf8('0x21')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x22')]())[_0x1bf8('0x18')](salesforce[_0x1bf8('0x23')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x24')]())['then'](sugarcrm[_0x1bf8('0x25')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x26')]())[_0x1bf8('0x18')](freshdesk[_0x1bf8('0x27')]())['then'](realtime[_0x1bf8('0x28')]())['then'](desk[_0x1bf8('0x29')]())['then'](realtime[_0x1bf8('0x2a')]())['then'](zoho['getZohoAccounts']())[_0x1bf8('0x18')](realtime['initZohoAccounts']())[_0x1bf8('0x18')](vtiger[_0x1bf8('0x2b')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x2c')]())['then'](freshsales[_0x1bf8('0x2d')]())['then'](realtime[_0x1bf8('0x2e')]())[_0x1bf8('0x18')](servicenow[_0x1bf8('0x2f')]())['then'](realtime[_0x1bf8('0x30')]())[_0x1bf8('0x18')](dynamics365[_0x1bf8('0x31')]())[_0x1bf8('0x18')](realtime['initDynamics365Accounts']())[_0x1bf8('0x18')](campaign[_0x1bf8('0x32')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x33')]())['then'](voiceExtension[_0x1bf8('0x34')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x35')]())[_0x1bf8('0x18')](faxAccount[_0x1bf8('0x36')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x37')]())[_0x1bf8('0x18')](function(){return realtime;});}function initParams(){return BPromise['resolve']()['then'](voiceQueueReport[_0x1bf8('0x38')]())[_0x1bf8('0x18')](realtime['initVoiceQueueReports']())[_0x1bf8('0x18')](cmHopperHistory[_0x1bf8('0x39')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x3a')]())[_0x1bf8('0x18')](cmHopperHistory['getCampaignHopperHistory']())[_0x1bf8('0x18')](realtime['initCampaignHopperHistory']())[_0x1bf8('0x18')](voiceCallReport[_0x1bf8('0x3b')]())[_0x1bf8('0x18')](realtime[_0x1bf8('0x3c')]())['then'](function(_0x237fb7){})[_0x1bf8('0x3d')](function(_0x2f250b){console['log'](_0x2f250b);});}function main(){return server['listen'](realtime,preview,fax)[_0x1bf8('0x18')](function(_0x57f856){return initRealtime();})['then'](function(){return initParams();})[_0x1bf8('0x18')](function(){report[_0x1bf8('0x3e')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x2d9249){console['log'](_0x2d9249);});}main();
\ No newline at end of file
index a25bd11..8cc0225 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x54e65b,_0x10d042){var _0x3224ef=function(_0x46f277){while(--_0x46f277){_0x54e65b['push'](_0x54e65b['shift']());}};_0x3224ef(++_0x10d042);}(_0xe706,0xa3));var _0x6e70=function(_0xe1bdfa,_0x5371ce){_0xe1bdfa=_0xe1bdfa-0x0;var _0x28daee=_0xe706[_0xe1bdfa];return _0x28daee;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent;
\ No newline at end of file
+var _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0xedd9,0xfc));var _0x9edd=function(_0x45b9f4,_0x31ebdc){_0x45b9f4=_0x45b9f4-0x0;var _0x55d30e=_0xedd9[_0x45b9f4];return _0x55d30e;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent;
\ No newline at end of file
index e5796ca..db94b08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a4b=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName'];(function(_0x339815,_0x2e59c4){var _0x5dcf62=function(_0x250029){while(--_0x250029){_0x339815['push'](_0x339815['shift']());}};_0x5dcf62(++_0x2e59c4);}(_0x9a4b,0x1d5));var _0xb9a4=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0x9a4b[_0x16539a];return _0x200796;};'use strict';function Campaign(_0x49d634){this['id']=_0x49d634['id']||0x0;this['name']=_0x49d634[_0xb9a4('0x0')]||'';this['type']=_0x49d634[_0xb9a4('0x1')]||'campaign';this[_0xb9a4('0x2')]=0x0;this['temp']=0x0;this[_0xb9a4('0x3')]=0x0;this[_0xb9a4('0x4')]=0x0;this['message']='';this[_0xb9a4('0x5')]=!![];this[_0xb9a4('0x6')]=_0x49d634[_0xb9a4('0x6')];this['limitCalls']=_0x49d634[_0xb9a4('0x7')];this[_0xb9a4('0x8')]=_0x49d634[_0xb9a4('0x8')]||null;this[_0xb9a4('0x9')]=_0x49d634[_0xb9a4('0x9')]?_0x49d634[_0xb9a4('0x9')]:null;this[_0xb9a4('0xa')]=_0x49d634[_0xb9a4('0xa')];this[_0xb9a4('0xb')]=_0x49d634[_0xb9a4('0xb')];this[_0xb9a4('0xc')]=_0x49d634['dialOriginateTimeout']||0x1e;this[_0xb9a4('0xd')]=_0x49d634[_0xb9a4('0xd')];this[_0xb9a4('0xe')]=_0x49d634[_0xb9a4('0xe')];this[_0xb9a4('0xf')]=_0x49d634[_0xb9a4('0xf')];this['dialBusyRetryFrequency']=_0x49d634[_0xb9a4('0x10')];this[_0xb9a4('0x11')]=_0x49d634['dialNoAnswerMaxRetry'];this[_0xb9a4('0x12')]=_0x49d634[_0xb9a4('0x12')];this[_0xb9a4('0x13')]=_0x49d634['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x49d634[_0xb9a4('0x14')]||0x3;this[_0xb9a4('0x15')]=_0x49d634[_0xb9a4('0x15')]||0x96;this[_0xb9a4('0x16')]=_0x49d634[_0xb9a4('0x16')]||0x3;this[_0xb9a4('0x17')]=_0x49d634[_0xb9a4('0x17')]||0x96;this[_0xb9a4('0x18')]=_0x49d634[_0xb9a4('0x18')]||0x3;this[_0xb9a4('0x19')]=_0x49d634['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x49d634['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x49d634['dialMachineRetryFrequency']||0x96;this[_0xb9a4('0x1a')]=_0x49d634[_0xb9a4('0x1a')]||0x3;this[_0xb9a4('0x1b')]=_0x49d634[_0xb9a4('0x1b')]||0x96;this[_0xb9a4('0x1c')]=_0x49d634[_0xb9a4('0x1c')]||_0xb9a4('0x1d');this[_0xb9a4('0x1e')]=_0x49d634[_0xb9a4('0x1e')]||undefined;this[_0xb9a4('0x1f')]=_0x49d634[_0xb9a4('0x1f')]||undefined;this[_0xb9a4('0x20')]=_0x49d634['dialCutDigit']||undefined;this['TrunkBackup']=_0x49d634['TrunkBackup']?_0x49d634[_0xb9a4('0x21')]:undefined;this[_0xb9a4('0x22')]=_0x49d634[_0xb9a4('0x22')]?_0x49d634[_0xb9a4('0x22')]:undefined;this['Interval']=_0x49d634[_0xb9a4('0x23')]?_0x49d634[_0xb9a4('0x23')]:undefined;this[_0xb9a4('0x24')]=_0x49d634[_0xb9a4('0x24')]?_0x49d634[_0xb9a4('0x24')]:undefined;this[_0xb9a4('0x25')]=_0x49d634['SquareProject']?_0x49d634[_0xb9a4('0x24')][_0xb9a4('0x0')]:undefined;this[_0xb9a4('0x26')]=_0x49d634[_0xb9a4('0x26')]||![];this[_0xb9a4('0x27')]=_0x49d634[_0xb9a4('0x27')];this['dialAMDGreeting']=_0x49d634[_0xb9a4('0x28')];this[_0xb9a4('0x29')]=_0x49d634[_0xb9a4('0x29')];this[_0xb9a4('0x2a')]=_0x49d634[_0xb9a4('0x2a')];this['dialAMDMinWordLength']=_0x49d634[_0xb9a4('0x2b')];this[_0xb9a4('0x2c')]=_0x49d634[_0xb9a4('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x49d634['dialAMDMaximumNumberOfWords'];this[_0xb9a4('0x2d')]=_0x49d634[_0xb9a4('0x2d')];this[_0xb9a4('0x2e')]=_0x49d634[_0xb9a4('0x2e')];}module[_0xb9a4('0x2f')]=Campaign;
\ No newline at end of file
+var _0x1fe7=['dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','temp','ivrAnswerCallsDay','sendMessageOneNotActive','active','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x1fe7,0x11f));var _0x71fe=function(_0x4bffdd,_0x2da849){_0x4bffdd=_0x4bffdd-0x0;var _0x2d17a6=_0x1fe7[_0x4bffdd];return _0x2d17a6;};'use strict';function Campaign(_0x212edd){this['id']=_0x212edd['id']||0x0;this[_0x71fe('0x0')]=_0x212edd[_0x71fe('0x0')]||'';this[_0x71fe('0x1')]=_0x212edd[_0x71fe('0x1')]||'campaign';this[_0x71fe('0x2')]=0x0;this[_0x71fe('0x3')]=0x0;this[_0x71fe('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this[_0x71fe('0x5')]=!![];this[_0x71fe('0x6')]=_0x212edd['active'];this['limitCalls']=_0x212edd[_0x71fe('0x7')];this['dialTimezone']=_0x212edd['dialTimezone']||null;this['dialGlobalInterval']=_0x212edd[_0x71fe('0x8')]?_0x212edd[_0x71fe('0x8')]:null;this[_0x71fe('0x9')]=_0x212edd[_0x71fe('0x9')];this[_0x71fe('0xa')]=_0x212edd[_0x71fe('0xa')];this[_0x71fe('0xb')]=_0x212edd[_0x71fe('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0x212edd[_0x71fe('0xc')];this[_0x71fe('0xd')]=_0x212edd[_0x71fe('0xd')];this[_0x71fe('0xe')]=_0x212edd['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x212edd[_0x71fe('0xf')];this[_0x71fe('0x10')]=_0x212edd[_0x71fe('0x10')];this[_0x71fe('0x11')]=_0x212edd[_0x71fe('0x11')];this['dialGlobalMaxRetry']=_0x212edd[_0x71fe('0x12')];this[_0x71fe('0x13')]=_0x212edd[_0x71fe('0x13')]||0x3;this[_0x71fe('0x14')]=_0x212edd[_0x71fe('0x14')]||0x96;this[_0x71fe('0x15')]=_0x212edd['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x212edd[_0x71fe('0x16')]||0x96;this[_0x71fe('0x17')]=_0x212edd[_0x71fe('0x17')]||0x3;this[_0x71fe('0x18')]=_0x212edd[_0x71fe('0x18')]||0x96;this[_0x71fe('0x19')]=_0x212edd[_0x71fe('0x19')]||0x3;this[_0x71fe('0x1a')]=_0x212edd[_0x71fe('0x1a')]||0x96;this[_0x71fe('0x1b')]=_0x212edd['dialAgentRejectMaxRetry']||0x3;this[_0x71fe('0x1c')]=_0x212edd[_0x71fe('0x1c')]||0x96;this[_0x71fe('0x1d')]=_0x212edd[_0x71fe('0x1d')]||'DESC';this['dialPrefix']=_0x212edd[_0x71fe('0x1e')]||undefined;this[_0x71fe('0x1f')]=_0x212edd[_0x71fe('0x1f')]||undefined;this[_0x71fe('0x20')]=_0x212edd[_0x71fe('0x20')]||undefined;this[_0x71fe('0x21')]=_0x212edd[_0x71fe('0x21')]?_0x212edd[_0x71fe('0x21')]:undefined;this[_0x71fe('0x22')]=_0x212edd[_0x71fe('0x22')]?_0x212edd[_0x71fe('0x22')]:undefined;this[_0x71fe('0x23')]=_0x212edd[_0x71fe('0x23')]?_0x212edd['Interval']:undefined;this['SquareProject']=_0x212edd[_0x71fe('0x24')]?_0x212edd[_0x71fe('0x24')]:undefined;this[_0x71fe('0x25')]=_0x212edd[_0x71fe('0x24')]?_0x212edd[_0x71fe('0x24')][_0x71fe('0x0')]:undefined;this[_0x71fe('0x26')]=_0x212edd['dialAMDActive']||![];this[_0x71fe('0x27')]=_0x212edd['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x212edd[_0x71fe('0x28')];this[_0x71fe('0x29')]=_0x212edd['dialAMDAfterGreetingSilence'];this[_0x71fe('0x2a')]=_0x212edd[_0x71fe('0x2a')];this['dialAMDMinWordLength']=_0x212edd['dialAMDMinWordLength'];this[_0x71fe('0x2b')]=_0x212edd[_0x71fe('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x212edd[_0x71fe('0x2c')];this[_0x71fe('0x2d')]=_0x212edd[_0x71fe('0x2d')];this[_0x71fe('0x2e')]=_0x212edd['dialAMDMaximumWordLength'];}module['exports']=Campaign;
\ No newline at end of file
index 81797ec..67d4616 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dfd=['disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','tag'];(function(_0x4868d9,_0x9c5ecf){var _0x597b7a=function(_0x26a9b3){while(--_0x26a9b3){_0x4868d9['push'](_0x4868d9['shift']());}};_0x597b7a(++_0x9c5ecf);}(_0x4dfd,0x148));var _0xd4df=function(_0x231756,_0x24653a){_0x231756=_0x231756-0x0;var _0x4e3007=_0x4dfd[_0x231756];return _0x4e3007;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0xd4df('0x0')]='';this[_0xd4df('0x1')]=0x0;this[_0xd4df('0x2')]='';this[_0xd4df('0x3')]=undefined;this[_0xd4df('0x4')]=undefined;this[_0xd4df('0x5')]=0x0;this[_0xd4df('0x6')]='';this[_0xd4df('0x7')]=0x0;this[_0xd4df('0x8')]=0x0;this[_0xd4df('0x9')]=0x0;this[_0xd4df('0xa')]=![];this[_0xd4df('0xb')]=null;this['endtime']=null;this[_0xd4df('0xc')]=![];this[_0xd4df('0xd')]=![];this[_0xd4df('0xe')]='';this[_0xd4df('0xf')]='';this[_0xd4df('0x10')]=0x0;this[_0xd4df('0x11')]=0x0;this[_0xd4df('0x12')]=0x0;this['type']=null;this[_0xd4df('0x13')]=null;this[_0xd4df('0x14')]=null;this[_0xd4df('0x15')]=![];this[_0xd4df('0x16')]=null;this[_0xd4df('0x17')]=null;this[_0xd4df('0x18')]=[];this['transfercalleridnum']=undefined;this[_0xd4df('0x19')]=undefined;this[_0xd4df('0x1a')]=undefined;this[_0xd4df('0x1b')]=0x0;}module[_0xd4df('0x1c')]=Channel;
\ No newline at end of file
+var _0xbaf7=['channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','context','uniqueid','linkedid','exten','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','holdtime','tag','monitorFilename','queue','monitors','transferconnectedlinenum','transferType','mohtime','exports','starttime'];(function(_0x36ad21,_0x3644e6){var _0x478b85=function(_0x53a705){while(--_0x53a705){_0x36ad21['push'](_0x36ad21['shift']());}};_0x478b85(++_0x3644e6);}(_0xbaf7,0x137));var _0x7baf=function(_0x3e6484,_0x2d172c){_0x3e6484=_0x3e6484-0x0;var _0x513624=_0xbaf7[_0x3e6484];return _0x513624;};'use strict';function Channel(){this[_0x7baf('0x0')]=null;this[_0x7baf('0x1')]='';this[_0x7baf('0x2')]='';this[_0x7baf('0x3')]=0x0;this[_0x7baf('0x4')]='';this['connectedlinenum']=undefined;this[_0x7baf('0x5')]=undefined;this[_0x7baf('0x6')]=0x0;this[_0x7baf('0x7')]='';this[_0x7baf('0x8')]=0x0;this[_0x7baf('0x9')]=0x0;this[_0x7baf('0xa')]=0x0;this[_0x7baf('0xb')]=![];this['answertime']=null;this[_0x7baf('0xc')]=null;this[_0x7baf('0xd')]=![];this[_0x7baf('0xe')]=![];this[_0x7baf('0xf')]='';this[_0x7baf('0x10')]='';this['duration']=0x0;this['billableseconds']=0x0;this[_0x7baf('0x11')]=0x0;this['type']=null;this[_0x7baf('0x12')]=null;this['disposition']=null;this['monitor']=![];this[_0x7baf('0x13')]=null;this[_0x7baf('0x14')]=null;this[_0x7baf('0x15')]=[];this['transfercalleridnum']=undefined;this[_0x7baf('0x16')]=undefined;this[_0x7baf('0x17')]=undefined;this[_0x7baf('0x18')]=0x0;}module[_0x7baf('0x19')]=Channel;
\ No newline at end of file
index dd36413..6f2d06f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3fa=['consumerKey','tokenSecret','serverUrl','Configurations','exports','name','username','remoteUri','authType'];(function(_0x56e32e,_0x9eb2f6){var _0x2a757b=function(_0x50b7bc){while(--_0x50b7bc){_0x56e32e['push'](_0x56e32e['shift']());}};_0x2a757b(++_0x9eb2f6);}(_0xa3fa,0x152));var _0xaa3f=function(_0x4036b6,_0x26955a){_0x4036b6=_0x4036b6-0x0;var _0x586277=_0xa3fa[_0x4036b6];return _0x586277;};'use strict';function DeskAccount(_0x15c919){this['id']=_0x15c919['id']||0x0;this['name']=_0x15c919[_0xaa3f('0x0')]||'';this[_0xaa3f('0x1')]=_0x15c919[_0xaa3f('0x1')]||'';this['remoteUri']=_0x15c919[_0xaa3f('0x2')]||'';this[_0xaa3f('0x3')]=_0x15c919[_0xaa3f('0x3')]||'';this['password']=_0x15c919['password']||'';this[_0xaa3f('0x4')]=_0x15c919[_0xaa3f('0x4')]||'';this['consumerSecret']=_0x15c919['consumerSecret']||'';this['token']=_0x15c919['token']||'';this[_0xaa3f('0x5')]=_0x15c919[_0xaa3f('0x5')]||'';this['type']=_0x15c919['type']||'';this[_0xaa3f('0x6')]=_0x15c919[_0xaa3f('0x6')]||'';this[_0xaa3f('0x7')]=_0x15c919['Configurations']||{};}module[_0xaa3f('0x8')]=DeskAccount;
\ No newline at end of file
+var _0x0b85=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x72c71e,_0x3ef857){var _0x92512e=function(_0xdc0310){while(--_0xdc0310){_0x72c71e['push'](_0x72c71e['shift']());}};_0x92512e(++_0x3ef857);}(_0x0b85,0x169));var _0x50b8=function(_0x153671,_0x41a0d4){_0x153671=_0x153671-0x0;var _0x4e98ca=_0x0b85[_0x153671];return _0x4e98ca;};'use strict';function DeskAccount(_0x26ace7){this['id']=_0x26ace7['id']||0x0;this[_0x50b8('0x0')]=_0x26ace7['name']||'';this[_0x50b8('0x1')]=_0x26ace7['username']||'';this[_0x50b8('0x2')]=_0x26ace7[_0x50b8('0x2')]||'';this['authType']=_0x26ace7[_0x50b8('0x3')]||'';this[_0x50b8('0x4')]=_0x26ace7['password']||'';this['consumerKey']=_0x26ace7[_0x50b8('0x5')]||'';this[_0x50b8('0x6')]=_0x26ace7[_0x50b8('0x6')]||'';this[_0x50b8('0x7')]=_0x26ace7[_0x50b8('0x7')]||'';this[_0x50b8('0x8')]=_0x26ace7['tokenSecret']||'';this['type']=_0x26ace7[_0x50b8('0x9')]||'';this['serverUrl']=_0x26ace7[_0x50b8('0xa')]||'';this[_0x50b8('0xb')]=_0x26ace7[_0x50b8('0xb')]||{};}module[_0x50b8('0xc')]=DeskAccount;
\ No newline at end of file
index 0d289ed..72a9842 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee5b=['clientId','clientSecret','name','username','password','remoteUri'];(function(_0x475923,_0x25d9ec){var _0x374030=function(_0x3f256b){while(--_0x3f256b){_0x475923['push'](_0x475923['shift']());}};_0x374030(++_0x25d9ec);}(_0xee5b,0x1f4));var _0xbee5=function(_0x1ca7a7,_0x31fe6f){_0x1ca7a7=_0x1ca7a7-0x0;var _0x4e44a9=_0xee5b[_0x1ca7a7];return _0x4e44a9;};'use strict';function Dynamics365Account(_0x5384bd){this['id']=_0x5384bd['id']||0x0;this['name']=_0x5384bd[_0xbee5('0x0')]||'';this[_0xbee5('0x1')]=_0x5384bd['username']||'';this[_0xbee5('0x2')]=_0x5384bd[_0xbee5('0x2')]||'';this[_0xbee5('0x3')]=_0x5384bd[_0xbee5('0x3')]||'';this['tenantId']=_0x5384bd['tenantId']||'';this[_0xbee5('0x4')]=_0x5384bd[_0xbee5('0x4')]||'';this[_0xbee5('0x5')]=_0x5384bd[_0xbee5('0x5')]||{};this['serverUrl']=_0x5384bd['serverUrl']||'';this['Configurations']=_0x5384bd['Configurations']||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
+var _0x0bb5=['clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId'];(function(_0x32e663,_0x1ca66c){var _0x54fa0e=function(_0x4cf486){while(--_0x4cf486){_0x32e663['push'](_0x32e663['shift']());}};_0x54fa0e(++_0x1ca66c);}(_0x0bb5,0x148));var _0x50bb=function(_0x1b93a9,_0x3cdf00){_0x1b93a9=_0x1b93a9-0x0;var _0x38bee2=_0x0bb5[_0x1b93a9];return _0x38bee2;};'use strict';function Dynamics365Account(_0x4878e5){this['id']=_0x4878e5['id']||0x0;this[_0x50bb('0x0')]=_0x4878e5['name']||'';this['username']=_0x4878e5[_0x50bb('0x1')]||'';this[_0x50bb('0x2')]=_0x4878e5[_0x50bb('0x2')]||'';this[_0x50bb('0x3')]=_0x4878e5[_0x50bb('0x3')]||'';this[_0x50bb('0x4')]=_0x4878e5[_0x50bb('0x4')]||'';this[_0x50bb('0x5')]=_0x4878e5['clientId']||'';this['clientSecret']=_0x4878e5[_0x50bb('0x6')]||{};this[_0x50bb('0x7')]=_0x4878e5[_0x50bb('0x7')]||'';this[_0x50bb('0x8')]=_0x4878e5['Configurations']||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
index 35e85e5..3684fd2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3e9=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','tech','SIP','ListId','key','exports'];(function(_0xe05fd1,_0x576db5){var _0x58f2e7=function(_0x5c875a){while(--_0x5c875a){_0xe05fd1['push'](_0xe05fd1['shift']());}};_0x58f2e7(++_0x576db5);}(_0xe3e9,0x1ef));var _0x9e3e=function(_0x474ce,_0x1a0188){_0x474ce=_0x474ce-0x0;var _0x4b1350=_0xe3e9[_0x474ce];return _0x4b1350;};'use strict';function FaxAccount(_0x5ec249){this['id']=_0x5ec249['id']||0x0;this[_0x9e3e('0x0')]=_0x5ec249[_0x9e3e('0x0')]||'';this['description']=_0x5ec249[_0x9e3e('0x1')];this[_0x9e3e('0x2')]=_0x5ec249['ecm'];this[_0x9e3e('0x3')]=_0x5ec249['headerinfo'];this['localstationid']=_0x5ec249[_0x9e3e('0x4')];this[_0x9e3e('0x5')]=_0x5ec249['minrate']||0x960;this[_0x9e3e('0x6')]=_0x5ec249[_0x9e3e('0x6')]||0x3840;this[_0x9e3e('0x7')]=_0x5ec249[_0x9e3e('0x7')]||'v17,v27,v29';this[_0x9e3e('0x8')]=_0x5ec249['gateway']||'no';this['faxdetect']=_0x5ec249[_0x9e3e('0x9')]||'no';this['t38timeout']=_0x5ec249['t38timeout']||0x1388;this[_0x9e3e('0xa')]=_0x5ec249[_0x9e3e('0xa')]||_0x9e3e('0xb');this['Trunk']=_0x5ec249['Trunk']?_0x5ec249['Trunk']:undefined;this[_0x9e3e('0xc')]=_0x5ec249[_0x9e3e('0xc')];this[_0x9e3e('0xd')]=_0x5ec249[_0x9e3e('0xd')];}module[_0x9e3e('0xe')]=FaxAccount;
\ No newline at end of file
+var _0x1415=['ecm','localstationid','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description'];(function(_0x2c1b91,_0xe2cd22){var _0x46aa23=function(_0x145e70){while(--_0x145e70){_0x2c1b91['push'](_0x2c1b91['shift']());}};_0x46aa23(++_0xe2cd22);}(_0x1415,0x11e));var _0x5141=function(_0x480148,_0x1c3026){_0x480148=_0x480148-0x0;var _0x3b875f=_0x1415[_0x480148];return _0x3b875f;};'use strict';function FaxAccount(_0x217f93){this['id']=_0x217f93['id']||0x0;this[_0x5141('0x0')]=_0x217f93[_0x5141('0x0')]||'';this[_0x5141('0x1')]=_0x217f93[_0x5141('0x1')];this[_0x5141('0x2')]=_0x217f93[_0x5141('0x2')];this['headerinfo']=_0x217f93['headerinfo'];this[_0x5141('0x3')]=_0x217f93[_0x5141('0x3')];this['minrate']=_0x217f93['minrate']||0x960;this[_0x5141('0x4')]=_0x217f93[_0x5141('0x4')]||0x3840;this[_0x5141('0x5')]=_0x217f93[_0x5141('0x5')]||_0x5141('0x6');this[_0x5141('0x7')]=_0x217f93['gateway']||'no';this['faxdetect']=_0x217f93[_0x5141('0x8')]||'no';this[_0x5141('0x9')]=_0x217f93['t38timeout']||0x1388;this[_0x5141('0xa')]=_0x217f93[_0x5141('0xa')]||_0x5141('0xb');this['Trunk']=_0x217f93[_0x5141('0xc')]?_0x217f93[_0x5141('0xc')]:undefined;this[_0x5141('0xd')]=_0x217f93[_0x5141('0xd')];this[_0x5141('0xe')]=_0x217f93[_0x5141('0xe')];}module[_0x5141('0xf')]=FaxAccount;
\ No newline at end of file
index ec2bbd0..641c4e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f41=['serverUrl','Configurations','username','apiKey','token','remoteUri'];(function(_0x3d540d,_0x6a414d){var _0x3b3449=function(_0x48d7b0){while(--_0x48d7b0){_0x3d540d['push'](_0x3d540d['shift']());}};_0x3b3449(++_0x6a414d);}(_0x1f41,0xbc));var _0x11f4=function(_0x5c6e32,_0x3654cb){_0x5c6e32=_0x5c6e32-0x0;var _0x2e0bb6=_0x1f41[_0x5c6e32];return _0x2e0bb6;};'use strict';function FreshdeskAccount(_0x2136ee){this['id']=_0x2136ee['id']||0x0;this['name']=_0x2136ee['name']||'';this[_0x11f4('0x0')]=_0x2136ee[_0x11f4('0x0')]||'';this[_0x11f4('0x1')]=_0x2136ee[_0x11f4('0x2')]||'';this[_0x11f4('0x3')]=_0x2136ee[_0x11f4('0x3')]||'';this[_0x11f4('0x4')]=_0x2136ee[_0x11f4('0x4')]||'';this[_0x11f4('0x5')]=_0x2136ee[_0x11f4('0x5')]||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
+var _0x947e=['serverUrl','Configurations','name','username','apiKey','token','remoteUri'];(function(_0x34b7b2,_0xd63986){var _0x10ee09=function(_0x5b677a){while(--_0x5b677a){_0x34b7b2['push'](_0x34b7b2['shift']());}};_0x10ee09(++_0xd63986);}(_0x947e,0xb1));var _0xe947=function(_0x2f0385,_0x30c3a3){_0x2f0385=_0x2f0385-0x0;var _0x181ea4=_0x947e[_0x2f0385];return _0x181ea4;};'use strict';function FreshdeskAccount(_0x206b5c){this['id']=_0x206b5c['id']||0x0;this[_0xe947('0x0')]=_0x206b5c[_0xe947('0x0')]||'';this['username']=_0x206b5c[_0xe947('0x1')]||'';this[_0xe947('0x2')]=_0x206b5c[_0xe947('0x3')]||'';this[_0xe947('0x4')]=_0x206b5c[_0xe947('0x4')]||'';this['serverUrl']=_0x206b5c[_0xe947('0x5')]||'';this[_0xe947('0x6')]=_0x206b5c[_0xe947('0x6')]||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
index 6703b5d..ca7dbfe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bde=['name','username','apiKey','token','remoteUri','serverUrl','Configurations','exports'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0x0bde,0x110));var _0xe0bd=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0bde[_0x321bb2];return _0x9c12ed;};'use strict';function FreshsalesAccount(_0x3ee8c6){this['id']=_0x3ee8c6['id']||0x0;this['name']=_0x3ee8c6[_0xe0bd('0x0')]||'';this[_0xe0bd('0x1')]=_0x3ee8c6['username']||'';this[_0xe0bd('0x2')]=_0x3ee8c6[_0xe0bd('0x3')]||'';this[_0xe0bd('0x4')]=_0x3ee8c6['remoteUri']||'';this[_0xe0bd('0x5')]=_0x3ee8c6[_0xe0bd('0x5')]||'';this[_0xe0bd('0x6')]=_0x3ee8c6[_0xe0bd('0x6')]||{};}module[_0xe0bd('0x7')]=FreshsalesAccount;
\ No newline at end of file
+var _0x600f=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x5277af,_0x16a6d2){var _0x205762=function(_0x2e4e19){while(--_0x2e4e19){_0x5277af['push'](_0x5277af['shift']());}};_0x205762(++_0x16a6d2);}(_0x600f,0xb4));var _0xf600=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0x600f[_0xf44d98];return _0x5ebb04;};'use strict';function FreshsalesAccount(_0x3cfdf7){this['id']=_0x3cfdf7['id']||0x0;this[_0xf600('0x0')]=_0x3cfdf7[_0xf600('0x0')]||'';this['username']=_0x3cfdf7[_0xf600('0x1')]||'';this['apiKey']=_0x3cfdf7[_0xf600('0x2')]||'';this[_0xf600('0x3')]=_0x3cfdf7[_0xf600('0x3')]||'';this[_0xf600('0x4')]=_0x3cfdf7[_0xf600('0x4')]||'';this[_0xf600('0x5')]=_0x3cfdf7[_0xf600('0x5')]||{};}module[_0xf600('0x6')]=FreshsalesAccount;
\ No newline at end of file
index c0b712c..204c4d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc70e=['queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','variables','type','inbound','calleridnum','calleridname','queue','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x38429b,_0x2fb162){var _0x114ed8=function(_0x527b8e){while(--_0x527b8e){_0x38429b['push'](_0x38429b['shift']());}};_0x114ed8(++_0x2fb162);}(_0xc70e,0x16c));var _0xec70=function(_0x1db9c9,_0x358fb5){_0x1db9c9=_0x1db9c9-0x0;var _0x2e02ef=_0xc70e[_0x1db9c9];return _0x2e02ef;};'use strict';function QueueReport(){this[_0xec70('0x0')]=_0xec70('0x1');this['uniqueid']='';this[_0xec70('0x2')]='';this[_0xec70('0x3')]='';this[_0xec70('0x4')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0xec70('0x5')]=0x1;this[_0xec70('0x6')]=0x1;this['queuecallerabandon']=![];this[_0xec70('0x7')]=null;this[_0xec70('0x8')]=![];this[_0xec70('0x9')]=null;this['queuecallerexit']=![];this[_0xec70('0xa')]=null;this[_0xec70('0xb')]=0x1;this[_0xec70('0xc')]='';this[_0xec70('0xd')]='';this[_0xec70('0xe')]='';this[_0xec70('0xf')]='';this[_0xec70('0x10')]='';this[_0xec70('0x11')]='';this['priority']='';this[_0xec70('0x12')]=0x0;this[_0xec70('0x13')]=![];this[_0xec70('0x14')]='';this['mohtime']=0x0;this[_0xec70('0x15')]={};}module['exports']=QueueReport;
\ No newline at end of file
+var _0xb46e=['queuecallerexitAt','channel','accountcode','context','priority','holdtime','assigned','lastAssignedTo','variables','exports','type','inbound','calleridnum','queue','queuecallerleaveAt','position','count','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit'];(function(_0x941156,_0x49036d){var _0x29a815=function(_0x541af4){while(--_0x541af4){_0x941156['push'](_0x941156['shift']());}};_0x29a815(++_0x49036d);}(_0xb46e,0xdc));var _0xeb46=function(_0x34b0d3,_0x55b139){_0x34b0d3=_0x34b0d3-0x0;var _0x37c298=_0xb46e[_0x34b0d3];return _0x37c298;};'use strict';function QueueReport(){this[_0xeb46('0x0')]=_0xeb46('0x1');this['uniqueid']='';this[_0xeb46('0x2')]='';this['calleridname']='';this[_0xeb46('0x3')]='';this['queuecallerjoinAt']=null;this[_0xeb46('0x4')]=null;this[_0xeb46('0x5')]=0x1;this[_0xeb46('0x6')]=0x1;this['queuecallerabandon']=![];this[_0xeb46('0x7')]=null;this[_0xeb46('0x8')]=![];this[_0xeb46('0x9')]=null;this[_0xeb46('0xa')]=![];this[_0xeb46('0xb')]=null;this['originalposition']=0x1;this[_0xeb46('0xc')]='';this['connectedlinenum']='';this['connectedlinename']='';this[_0xeb46('0xd')]='';this[_0xeb46('0xe')]='';this['exten']='';this[_0xeb46('0xf')]='';this[_0xeb46('0x10')]=0x0;this[_0xeb46('0x11')]=![];this[_0xeb46('0x12')]='';this['mohtime']=0x0;this[_0xeb46('0x13')]={};}module[_0xeb46('0x14')]=QueueReport;
\ No newline at end of file
index 0a9c2d4..9d9f5e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb07=['password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x44d9ab,_0x76bc69){var _0x31485e=function(_0x1e44ce){while(--_0x1e44ce){_0x44d9ab['push'](_0x44d9ab['shift']());}};_0x31485e(++_0x76bc69);}(_0xeb07,0x17e));var _0x7eb0=function(_0x436431,_0x40531c){_0x436431=_0x436431-0x0;var _0x3d53a5=_0xeb07[_0x436431];return _0x3d53a5;};'use strict';function SalesforceAccount(_0xb14a29){this['id']=_0xb14a29['id']||0x0;this[_0x7eb0('0x0')]=_0xb14a29[_0x7eb0('0x0')]||'';this[_0x7eb0('0x1')]=_0xb14a29['username']||'';this[_0x7eb0('0x2')]=_0xb14a29['remoteUri']||'';this['password']=_0xb14a29[_0x7eb0('0x3')]||'';this[_0x7eb0('0x4')]=_0xb14a29[_0x7eb0('0x4')]||'';this[_0x7eb0('0x5')]=_0xb14a29[_0x7eb0('0x5')]||'';this[_0x7eb0('0x6')]=_0xb14a29['securityToken']||'';this['type']=_0xb14a29[_0x7eb0('0x7')]||'integrationTab';this[_0x7eb0('0x8')]=_0xb14a29[_0x7eb0('0x8')]||'';this[_0x7eb0('0x9')]=_0xb14a29[_0x7eb0('0x9')]||{};}module[_0x7eb0('0xa')]=SalesforceAccount;
\ No newline at end of file
+var _0x9c06=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x4b1bb0,_0x7dc32b){var _0x549407=function(_0xa08deb){while(--_0xa08deb){_0x4b1bb0['push'](_0x4b1bb0['shift']());}};_0x549407(++_0x7dc32b);}(_0x9c06,0x68));var _0x69c0=function(_0x31413c,_0x32c65b){_0x31413c=_0x31413c-0x0;var _0x2bd974=_0x9c06[_0x31413c];return _0x2bd974;};'use strict';function SalesforceAccount(_0x11375a){this['id']=_0x11375a['id']||0x0;this[_0x69c0('0x0')]=_0x11375a['name']||'';this[_0x69c0('0x1')]=_0x11375a['username']||'';this[_0x69c0('0x2')]=_0x11375a[_0x69c0('0x2')]||'';this['password']=_0x11375a[_0x69c0('0x3')]||'';this[_0x69c0('0x4')]=_0x11375a['clientId']||'';this['clientSecret']=_0x11375a[_0x69c0('0x5')]||'';this[_0x69c0('0x6')]=_0x11375a[_0x69c0('0x6')]||'';this[_0x69c0('0x7')]=_0x11375a[_0x69c0('0x7')]||_0x69c0('0x8');this['serverUrl']=_0x11375a[_0x69c0('0x9')]||'';this[_0x69c0('0xa')]=_0x11375a[_0x69c0('0xa')]||{};}module[_0x69c0('0xb')]=SalesforceAccount;
\ No newline at end of file
index 44c7328..e3ca879 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1415=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x203eb7,_0x252f34){var _0x504110=function(_0x20051e){while(--_0x20051e){_0x203eb7['push'](_0x203eb7['shift']());}};_0x504110(++_0x252f34);}(_0x1415,0x138));var _0x5141=function(_0x1babb3,_0x4fe096){_0x1babb3=_0x1babb3-0x0;var _0x4f71ff=_0x1415[_0x1babb3];return _0x4f71ff;};'use strict';function ServicenowAccount(_0x4c6758){this['id']=_0x4c6758['id']||0x0;this['name']=_0x4c6758[_0x5141('0x0')]||'';this[_0x5141('0x1')]=_0x4c6758[_0x5141('0x1')]||'';this[_0x5141('0x2')]=_0x4c6758[_0x5141('0x2')]||'';this[_0x5141('0x3')]=_0x4c6758['remoteUri']||'';this[_0x5141('0x4')]=_0x4c6758[_0x5141('0x4')]||'';this[_0x5141('0x5')]=_0x4c6758['Configurations']||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
+var _0xed8a=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3043c7,_0x284e50){var _0x7c4fd7=function(_0x4a5782){while(--_0x4a5782){_0x3043c7['push'](_0x3043c7['shift']());}};_0x7c4fd7(++_0x284e50);}(_0xed8a,0xfb));var _0xaed8=function(_0x495588,_0x2ee5af){_0x495588=_0x495588-0x0;var _0x27cd6e=_0xed8a[_0x495588];return _0x27cd6e;};'use strict';function ServicenowAccount(_0x335608){this['id']=_0x335608['id']||0x0;this[_0xaed8('0x0')]=_0x335608['name']||'';this[_0xaed8('0x1')]=_0x335608[_0xaed8('0x1')]||'';this[_0xaed8('0x2')]=_0x335608[_0xaed8('0x2')]||'';this[_0xaed8('0x3')]=_0x335608[_0xaed8('0x3')]||'';this[_0xaed8('0x4')]=_0x335608[_0xaed8('0x4')]||'';this[_0xaed8('0x5')]=_0x335608[_0xaed8('0x5')]||{};}module[_0xaed8('0x6')]=ServicenowAccount;
\ No newline at end of file
index 8679609..88aea54 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa58=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x5f216b,_0xbcbd76){var _0x3b9dc6=function(_0xa2d13c){while(--_0xa2d13c){_0x5f216b['push'](_0x5f216b['shift']());}};_0x3b9dc6(++_0xbcbd76);}(_0xfa58,0x157));var _0x8fa5=function(_0x4c630b,_0x25f8ef){_0x4c630b=_0x4c630b-0x0;var _0x181259=_0xfa58[_0x4c630b];return _0x181259;};'use strict';function SugarcrmAccount(_0xfa7d5b){this['id']=_0xfa7d5b['id']||0x0;this[_0x8fa5('0x0')]=_0xfa7d5b[_0x8fa5('0x0')]||'';this['username']=_0xfa7d5b[_0x8fa5('0x1')]||'';this['password']=_0xfa7d5b[_0x8fa5('0x2')]||'';this[_0x8fa5('0x3')]=_0xfa7d5b[_0x8fa5('0x3')]||'';this[_0x8fa5('0x4')]=_0xfa7d5b['serverUrl']||'';this[_0x8fa5('0x5')]=_0xfa7d5b[_0x8fa5('0x5')]||{};}module[_0x8fa5('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0xf902=['remoteUri','serverUrl','Configurations','exports','name','username','password'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0xf902,0x162));var _0x2f90=function(_0x46b822,_0x5eb37f){_0x46b822=_0x46b822-0x0;var _0x3350e2=_0xf902[_0x46b822];return _0x3350e2;};'use strict';function SugarcrmAccount(_0x5b12cf){this['id']=_0x5b12cf['id']||0x0;this[_0x2f90('0x0')]=_0x5b12cf['name']||'';this[_0x2f90('0x1')]=_0x5b12cf[_0x2f90('0x1')]||'';this[_0x2f90('0x2')]=_0x5b12cf[_0x2f90('0x2')]||'';this[_0x2f90('0x3')]=_0x5b12cf[_0x2f90('0x3')]||'';this[_0x2f90('0x4')]=_0x5b12cf[_0x2f90('0x4')]||'';this[_0x2f90('0x5')]=_0x5b12cf[_0x2f90('0x5')]||{};}module[_0x2f90('0x6')]=SugarcrmAccount;
\ No newline at end of file
index cd15fd1..6ab5360 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae9e=['unknown','stateTime','status','address','exports','name','accountcode','state'];(function(_0x52ef8d,_0x3a2c64){var _0x4eef27=function(_0x550d0b){while(--_0x550d0b){_0x52ef8d['push'](_0x52ef8d['shift']());}};_0x4eef27(++_0x3a2c64);}(_0xae9e,0xbd));var _0xeae9=function(_0x1569fc,_0x59ba82){_0x1569fc=_0x1569fc-0x0;var _0xbe3391=_0xae9e[_0x1569fc];return _0xbe3391;};'use strict';function Telephone(_0x4a1d39){this['id']=_0x4a1d39['id']||0x0;this[_0xeae9('0x0')]=_0x4a1d39[_0xeae9('0x0')]||'';this[_0xeae9('0x1')]=_0x4a1d39['accountcode']||'';this[_0xeae9('0x2')]=_0xeae9('0x3');this[_0xeae9('0x4')]=0x0;this[_0xeae9('0x5')]=_0xeae9('0x3');this[_0xeae9('0x6')]='';}module[_0xeae9('0x7')]=Telephone;
\ No newline at end of file
+var _0xcf2d=['state','unknown','address','exports','name','accountcode'];(function(_0x466e57,_0x21b819){var _0x34df42=function(_0x3e9758){while(--_0x3e9758){_0x466e57['push'](_0x466e57['shift']());}};_0x34df42(++_0x21b819);}(_0xcf2d,0x1ea));var _0xdcf2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcf2d[_0x3dd15e];return _0x231fd0;};'use strict';function Telephone(_0x2a7018){this['id']=_0x2a7018['id']||0x0;this[_0xdcf2('0x0')]=_0x2a7018[_0xdcf2('0x0')]||'';this[_0xdcf2('0x1')]=_0x2a7018[_0xdcf2('0x1')]||'';this[_0xdcf2('0x2')]='unknown';this['stateTime']=0x0;this['status']=_0xdcf2('0x3');this[_0xdcf2('0x4')]='';}module[_0xdcf2('0x5')]=Telephone;
\ No newline at end of file
index 21864a8..150acce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x3df9a4,_0x4b3924){var _0x1ce42f=function(_0x40a49f){while(--_0x40a49f){_0x3df9a4['push'](_0x3df9a4['shift']());}};_0x1ce42f(++_0x4b3924);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
+var _0xa9e0=['exports','name'];(function(_0x3f623c,_0x2b3139){var _0x31fc82=function(_0x49389b){while(--_0x49389b){_0x3f623c['push'](_0x3f623c['shift']());}};_0x31fc82(++_0x2b3139);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
index 525f549..dd31c62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x720571,_0xc07be4){var _0x4a5e0f=function(_0x36e090){while(--_0x36e090){_0x720571['push'](_0x720571['shift']());}};_0x4a5e0f(++_0xc07be4);}(_0xda3f,0xec));var _0xfda3=function(_0x1f1976,_0x4eb858){_0x1f1976=_0x1f1976-0x0;var _0x26dee4=_0xda3f[_0x1f1976];return _0x26dee4;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger;
\ No newline at end of file
+var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x5a595c,_0x341579){var _0x4f9722=function(_0x35b9e8){while(--_0x35b9e8){_0x5a595c['push'](_0x5a595c['shift']());}};_0x4f9722(++_0x341579);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1bc111,_0x2d0daa){_0x1bc111=_0x1bc111-0x0;var _0xe6eea5=_0x9ffd[_0x1bc111];return _0xe6eea5;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger;
\ No newline at end of file
index 3f0bf33..ef38e20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdee2=['split','port','domain','domainport','stateRegistry','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf'];(function(_0x6d97b2,_0x3c1332){var _0x514465=function(_0x13c3ce){while(--_0x13c3ce){_0x6d97b2['push'](_0x6d97b2['shift']());}};_0x514465(++_0x3c1332);}(_0xdee2,0x78));var _0x2dee=function(_0x4e4c65,_0xcad7ac){_0x4e4c65=_0x4e4c65-0x0;var _0x38162e=_0xdee2[_0x4e4c65];return _0x38162e;};'use strict';function Trunk(_0x5c049c){this['id']=_0x5c049c['id']||0x0;this[_0x2dee('0x0')]=_0x5c049c[_0x2dee('0x0')]||![];this[_0x2dee('0x1')]=_0x5c049c[_0x2dee('0x1')]||'';this[_0x2dee('0x2')]=_0x2dee('0x3');this[_0x2dee('0x4')]=0x0;this[_0x2dee('0x5')]='unknown';this['registry']=_0x5c049c[_0x2dee('0x6')]&&_0x5c049c['registry'][_0x2dee('0x7')](':')?_0x5c049c['registry'][_0x2dee('0x8')](':')[0x0]:'';this['host']='';this[_0x2dee('0x9')]='';this[_0x2dee('0xa')]='';this[_0x2dee('0xb')]='';this['refresh']='';this[_0x2dee('0xc')]=_0x2dee('0x3');this['registrationtime']='';this[_0x2dee('0xd')]='';this[_0x2dee('0xe')]=_0x5c049c[_0x2dee('0xe')]||'';}module[_0x2dee('0xf')]=Trunk;
\ No newline at end of file
+var _0xf6e9=['unknown','stateTime','registry','indexOf','split','host','refresh','registrationtime','address','defaultuser','active','name','state'];(function(_0x10cb7a,_0x771352){var _0x1dd469=function(_0x39ea1d){while(--_0x39ea1d){_0x10cb7a['push'](_0x10cb7a['shift']());}};_0x1dd469(++_0x771352);}(_0xf6e9,0x1d1));var _0x9f6e=function(_0x500032,_0xb364ed){_0x500032=_0x500032-0x0;var _0x387187=_0xf6e9[_0x500032];return _0x387187;};'use strict';function Trunk(_0x3c9c0a){this['id']=_0x3c9c0a['id']||0x0;this[_0x9f6e('0x0')]=_0x3c9c0a['active']||![];this[_0x9f6e('0x1')]=_0x3c9c0a[_0x9f6e('0x1')]||'';this[_0x9f6e('0x2')]=_0x9f6e('0x3');this[_0x9f6e('0x4')]=0x0;this['status']=_0x9f6e('0x3');this[_0x9f6e('0x5')]=_0x3c9c0a[_0x9f6e('0x5')]&&_0x3c9c0a[_0x9f6e('0x5')][_0x9f6e('0x6')](':')?_0x3c9c0a[_0x9f6e('0x5')][_0x9f6e('0x7')](':')[0x0]:'';this[_0x9f6e('0x8')]='';this['port']='';this['domain']='';this['domainport']='';this[_0x9f6e('0x9')]='';this['stateRegistry']=_0x9f6e('0x3');this[_0x9f6e('0xa')]='';this[_0x9f6e('0xb')]='';this[_0x9f6e('0xc')]=_0x3c9c0a[_0x9f6e('0xc')]||'';}module['exports']=Trunk;
\ No newline at end of file
index 658c394..65a6955 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa09a=['mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x107bbf,_0xa1745){var _0x3aeb1b=function(_0x46d0af){while(--_0x46d0af){_0x107bbf['push'](_0x107bbf['shift']());}};_0x3aeb1b(++_0xa1745);}(_0xa09a,0x1e6));var _0xaa09=function(_0x5af586,_0x25a624){_0x5af586=_0x5af586-0x0;var _0xa91408=_0xa09a[_0x5af586];return _0xa91408;};'use strict';function voiceExtension(_0x473987){this['id']=_0x473987['id']||0x0;this['exten']=_0x473987[_0xaa09('0x0')]||'';this[_0xaa09('0x1')]=_0x473987[_0xaa09('0x1')]||'none';this['mandatoryDisposition']=_0x473987[_0xaa09('0x2')]||![];}module[_0xaa09('0x3')]=voiceExtension;
\ No newline at end of file
+var _0x7e56=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x5e1abe,_0x35aed5){var _0x309095=function(_0xd50668){while(--_0xd50668){_0x5e1abe['push'](_0x5e1abe['shift']());}};_0x309095(++_0x35aed5);}(_0x7e56,0x167));var _0x67e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e56[_0x3dd15e];return _0x231fd0;};'use strict';function voiceExtension(_0x59f5bc){this['id']=_0x59f5bc['id']||0x0;this[_0x67e5('0x0')]=_0x59f5bc['exten']||'';this[_0x67e5('0x1')]=_0x59f5bc['recordingFormat']||_0x67e5('0x2');this[_0x67e5('0x3')]=_0x59f5bc[_0x67e5('0x3')]||![];}module[_0x67e5('0x4')]=voiceExtension;
\ No newline at end of file
index 859ed52..8de0287 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cef=['dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','busy','unavailable','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','sumHoldTime','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5cef,0x130));var _0xf5ce=function(_0x3f52e1,_0x12177e){_0x3f52e1=_0x3f52e1-0x0;var _0x3cd8b6=_0x5cef[_0x3f52e1];return _0x3cd8b6;};'use strict';var statusDesc=[_0xf5ce('0x0'),_0xf5ce('0x1'),'inuse',_0xf5ce('0x2'),'invalid',_0xf5ce('0x3'),_0xf5ce('0x4'),_0xf5ce('0x5'),_0xf5ce('0x6')];var monitorFormat={'wav':_0xf5ce('0x7'),'wav49':_0xf5ce('0x8'),'gsm':_0xf5ce('0x9')};var strategy={'rrmemory':_0xf5ce('0xa'),'roundrobin':_0xf5ce('0xb')};function VoiceQueue(_0x564327){this['id']=_0x564327['id']||0x0;this['name']=_0x564327[_0xf5ce('0xc')]||'';this[_0xf5ce('0xd')]=_0x564327[_0xf5ce('0xd')]||'';this[_0xf5ce('0xe')]=_0x564327[_0xf5ce('0xe')]||_0xf5ce('0xf');this[_0xf5ce('0x10')]=0x0;this[_0xf5ce('0x11')]=0x0;this['total']=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0xf5ce('0x12')]=0x0;this[_0xf5ce('0x13')]=0x0;this[_0xf5ce('0x14')]=0x0;this[_0xf5ce('0x15')]=0x0;this['loggedIn']=0x0;this[_0xf5ce('0x16')]=0x0;this['acw']=_0x564327[_0xf5ce('0x17')]||![];this[_0xf5ce('0x18')]=_0x564327[_0xf5ce('0x18')]||0xa;this['autopause']=_0x564327['autopause']||'no';this[_0xf5ce('0x19')]=!![];this[_0xf5ce('0x1a')]='';this['originated']=0x0;this[_0xf5ce('0x1b')]=0x0;this['dialTimezone']=_0x564327[_0xf5ce('0x1c')]||null;this[_0xf5ce('0x1d')]=_0x564327[_0xf5ce('0x1d')]?_0x564327[_0xf5ce('0x1d')]:null;this[_0xf5ce('0x1e')]=_0x564327['dialActive'];this[_0xf5ce('0x1f')]=_0x564327['dialMethod']||_0xf5ce('0x20');this[_0xf5ce('0x21')]=_0x564327[_0xf5ce('0x21')]||0x0;this['dialLimitQueue']=_0x564327[_0xf5ce('0x22')]||0x0;this[_0xf5ce('0x23')]=_0x564327[_0xf5ce('0x23')]||0x1;this[_0xf5ce('0x24')]=_0x564327[_0xf5ce('0x24')]||_0xf5ce('0x25');this[_0xf5ce('0x26')]=_0x564327[_0xf5ce('0x26')]||0.03;this[_0xf5ce('0x27')]=_0x564327[_0xf5ce('0x27')]||0x258;this[_0xf5ce('0x28')]=_0x564327['dialOriginateCallerIdName']||'anonymous';this['dialOriginateCallerIdNumber']=_0x564327[_0xf5ce('0x29')]||_0xf5ce('0x2a');this[_0xf5ce('0x2b')]=_0x564327['dialOriginateTimeout']||0x1e;this[_0xf5ce('0x2c')]=_0x564327[_0xf5ce('0x2c')]||_0xf5ce('0x2d');this[_0xf5ce('0x2e')]=_0x564327['dialQueueTimeout']||0x3;this[_0xf5ce('0x2f')]=_0x564327[_0xf5ce('0x2f')]||undefined;this[_0xf5ce('0x30')]=_0x564327[_0xf5ce('0x30')]||0x3;this[_0xf5ce('0x31')]=_0x564327['dialCongestionRetryFrequency']||0x96;this[_0xf5ce('0x32')]=_0x564327['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x564327[_0xf5ce('0x33')]||0x96;this['dialNoAnswerMaxRetry']=_0x564327[_0xf5ce('0x34')]||0x3;this[_0xf5ce('0x35')]=_0x564327[_0xf5ce('0x35')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x564327['dialNoSuchNumberMaxRetry']||0x3;this[_0xf5ce('0x36')]=_0x564327[_0xf5ce('0x36')]||0x96;this[_0xf5ce('0x37')]=_0x564327[_0xf5ce('0x37')]||0x3;this[_0xf5ce('0x38')]=_0x564327[_0xf5ce('0x38')]||0x96;this[_0xf5ce('0x39')]=_0x564327['dialAbandonedMaxRetry']||0x3;this[_0xf5ce('0x3a')]=_0x564327[_0xf5ce('0x3a')]||0x96;this[_0xf5ce('0x3b')]=_0x564327['dialMachineMaxRetry']||0x3;this[_0xf5ce('0x3c')]=_0x564327[_0xf5ce('0x3c')]||0x96;this['dialAgentRejectMaxRetry']=_0x564327[_0xf5ce('0x3d')]||0x3;this[_0xf5ce('0x3e')]=_0x564327[_0xf5ce('0x3e')]||0x96;this['dialGlobalMaxRetry']=_0x564327['dialGlobalMaxRetry']||0x4;this[_0xf5ce('0x3f')]=_0x564327['Trunk']?_0x564327['Trunk']:undefined;this[_0xf5ce('0x40')]=_0x564327[_0xf5ce('0x40')]?_0x564327['TrunkBackup']:undefined;this['dialPrefix']=_0x564327[_0xf5ce('0x41')]||undefined;this[_0xf5ce('0x42')]=_0x564327['Interval']?_0x564327[_0xf5ce('0x42')]:undefined;this[_0xf5ce('0x43')]=_0x564327[_0xf5ce('0x43')]||_0xf5ce('0x44');this[_0xf5ce('0x45')]=_0x564327[_0xf5ce('0x45')]||undefined;this[_0xf5ce('0x46')]=_0x564327[_0xf5ce('0x46')]||undefined;this[_0xf5ce('0x47')]=strategy[_0x564327['strategy']]||_0xf5ce('0xa');this['queueStatusComplete']=!![];this['dialAMDActive']=_0x564327[_0xf5ce('0x48')]||![];this[_0xf5ce('0x49')]=_0x564327[_0xf5ce('0x49')];this[_0xf5ce('0x4a')]=_0x564327[_0xf5ce('0x4a')];this[_0xf5ce('0x4b')]=_0x564327[_0xf5ce('0x4b')];this[_0xf5ce('0x4c')]=_0x564327[_0xf5ce('0x4c')];this[_0xf5ce('0x4d')]=_0x564327[_0xf5ce('0x4d')];this[_0xf5ce('0x4e')]=_0x564327['dialAMDBetweenWordsSilence'];this[_0xf5ce('0x4f')]=_0x564327['dialAMDMaximumNumberOfWords'];this[_0xf5ce('0x50')]=_0x564327[_0xf5ce('0x50')];this[_0xf5ce('0x51')]=_0x564327['dialAMDMaximumWordLength'];this[_0xf5ce('0x52')]=0x0;this[_0xf5ce('0x53')]=0x0;this[_0xf5ce('0x54')]=_0x564327[_0xf5ce('0x54')];this['outboundAnswerCallsDay']=0x0;this[_0xf5ce('0x55')]=0x0;this[_0xf5ce('0x56')]=0x0;this[_0xf5ce('0x57')]=0x0;this[_0xf5ce('0x58')]=0x0;this[_0xf5ce('0x59')]=0x0;this[_0xf5ce('0x5a')]=0x0;this[_0xf5ce('0x5b')]=0x0;this[_0xf5ce('0x5c')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xf5ce('0x5d')]=0x0;this[_0xf5ce('0x5e')]=0x0;this[_0xf5ce('0x5f')]=0x0;this[_0xf5ce('0x60')]=0x0;this[_0xf5ce('0x61')]=undefined;this['startPredictive']=undefined;this[_0xf5ce('0x62')]=undefined;this[_0xf5ce('0x63')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xf5ce('0x64')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xf5ce('0x65')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0xf5ce('0x66')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x564327['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xf5ce('0x67')]=_0x564327['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xf5ce('0x68')]=0x0;this[_0xf5ce('0x69')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0xf5ce('0x6a')]=0x0;this[_0xf5ce('0x6b')]=0x0;this[_0xf5ce('0x6c')]=0x0;this[_0xf5ce('0x6d')]=0x0;this[_0xf5ce('0x6e')]=_0x564327['dialRecallMeTimeout']||0x1e;this[_0xf5ce('0x6f')]=_0x564327[_0xf5ce('0x6f')]||![];this[_0xf5ce('0x70')]=_0x564327[_0xf5ce('0x70')]||undefined;this['dialAgiAfterHangupClient']=_0x564327[_0xf5ce('0x71')]||![];this[_0xf5ce('0x72')]=_0x564327['dialAgiAfterHangupAgent']||![];this[_0xf5ce('0xd')]=monitorFormat[_0x564327[_0xf5ce('0xd')]]?monitorFormat[_0x564327[_0xf5ce('0xd')]]:undefined;this[_0xf5ce('0x73')]=_0x564327[_0xf5ce('0x73')]||![];this[_0xf5ce('0x74')]=_0x564327[_0xf5ce('0x74')]?_0x564327['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
+var _0xbf6c=['dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav','wav49','name','monitor_format','type','inbound','total','answered','sumBillable','unmanaged','abandoned','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueOptions','tTxX','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf6c,0x1a6));var _0xcbf6=function(_0x54ff4a,_0x20b9a8){_0x54ff4a=_0x54ff4a-0x0;var _0x3368cd=_0xbf6c[_0x54ff4a];return _0x3368cd;};'use strict';var statusDesc=[_0xcbf6('0x0'),_0xcbf6('0x1'),'inuse',_0xcbf6('0x2'),_0xcbf6('0x3'),_0xcbf6('0x4'),_0xcbf6('0x5'),_0xcbf6('0x6'),_0xcbf6('0x7')];var monitorFormat={'wav':_0xcbf6('0x8'),'wav49':_0xcbf6('0x9'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};function VoiceQueue(_0x568a89){this['id']=_0x568a89['id']||0x0;this[_0xcbf6('0xa')]=_0x568a89[_0xcbf6('0xa')]||'';this[_0xcbf6('0xb')]=_0x568a89[_0xcbf6('0xb')]||'';this[_0xcbf6('0xc')]=_0x568a89['type']||_0xcbf6('0xd');this['waiting']=0x0;this['talking']=0x0;this[_0xcbf6('0xe')]=0x0;this[_0xcbf6('0xf')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0xcbf6('0x10')]=0x0;this[_0xcbf6('0x11')]=0x0;this[_0xcbf6('0x12')]=0x0;this['loggedIn']=0x0;this[_0xcbf6('0x13')]=0x0;this['acw']=_0x568a89[_0xcbf6('0x14')]||![];this[_0xcbf6('0x15')]=_0x568a89[_0xcbf6('0x15')]||0xa;this['autopause']=_0x568a89[_0xcbf6('0x16')]||'no';this['sendMessageOneNotActive']=!![];this[_0xcbf6('0x17')]='';this[_0xcbf6('0x18')]=0x0;this[_0xcbf6('0x19')]=0x0;this[_0xcbf6('0x1a')]=_0x568a89['dialTimezone']||null;this[_0xcbf6('0x1b')]=_0x568a89[_0xcbf6('0x1b')]?_0x568a89['dialGlobalInterval']:null;this['dialActive']=_0x568a89[_0xcbf6('0x1c')];this[_0xcbf6('0x1d')]=_0x568a89[_0xcbf6('0x1d')]||_0xcbf6('0x1e');this[_0xcbf6('0x1f')]=_0x568a89['dialLimitChannel']||0x0;this[_0xcbf6('0x20')]=_0x568a89[_0xcbf6('0x20')]||0x0;this['dialPowerLevel']=_0x568a89[_0xcbf6('0x21')]||0x1;this[_0xcbf6('0x22')]=_0x568a89[_0xcbf6('0x22')]||'dropRate';this[_0xcbf6('0x23')]=_0x568a89[_0xcbf6('0x23')]||0.03;this[_0xcbf6('0x24')]=_0x568a89[_0xcbf6('0x24')]||0x258;this[_0xcbf6('0x25')]=_0x568a89[_0xcbf6('0x25')]||_0xcbf6('0x26');this[_0xcbf6('0x27')]=_0x568a89[_0xcbf6('0x27')]||_0xcbf6('0x26');this['dialOriginateTimeout']=_0x568a89['dialOriginateTimeout']||0x1e;this[_0xcbf6('0x28')]=_0x568a89['dialQueueOptions']||_0xcbf6('0x29');this[_0xcbf6('0x2a')]=_0x568a89[_0xcbf6('0x2a')]||0x3;this['dialQueueProject']=_0x568a89['dialQueueProject']||undefined;this[_0xcbf6('0x2b')]=_0x568a89['dialCongestionMaxRetry']||0x3;this[_0xcbf6('0x2c')]=_0x568a89[_0xcbf6('0x2c')]||0x96;this[_0xcbf6('0x2d')]=_0x568a89[_0xcbf6('0x2d')]||0x3;this[_0xcbf6('0x2e')]=_0x568a89[_0xcbf6('0x2e')]||0x96;this[_0xcbf6('0x2f')]=_0x568a89[_0xcbf6('0x2f')]||0x3;this[_0xcbf6('0x30')]=_0x568a89[_0xcbf6('0x30')]||0x96;this[_0xcbf6('0x31')]=_0x568a89[_0xcbf6('0x31')]||0x3;this[_0xcbf6('0x32')]=_0x568a89[_0xcbf6('0x32')]||0x96;this[_0xcbf6('0x33')]=_0x568a89[_0xcbf6('0x33')]||0x3;this['dialDropRetryFrequency']=_0x568a89[_0xcbf6('0x34')]||0x96;this['dialAbandonedMaxRetry']=_0x568a89[_0xcbf6('0x35')]||0x3;this[_0xcbf6('0x36')]=_0x568a89['dialAbandonedRetryFrequency']||0x96;this[_0xcbf6('0x37')]=_0x568a89[_0xcbf6('0x37')]||0x3;this[_0xcbf6('0x38')]=_0x568a89['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x568a89['dialAgentRejectMaxRetry']||0x3;this[_0xcbf6('0x39')]=_0x568a89[_0xcbf6('0x39')]||0x96;this['dialGlobalMaxRetry']=_0x568a89[_0xcbf6('0x3a')]||0x4;this[_0xcbf6('0x3b')]=_0x568a89['Trunk']?_0x568a89[_0xcbf6('0x3b')]:undefined;this['TrunkBackup']=_0x568a89[_0xcbf6('0x3c')]?_0x568a89[_0xcbf6('0x3c')]:undefined;this['dialPrefix']=_0x568a89['dialPrefix']||undefined;this[_0xcbf6('0x3d')]=_0x568a89[_0xcbf6('0x3d')]?_0x568a89[_0xcbf6('0x3d')]:undefined;this[_0xcbf6('0x3e')]=_0x568a89[_0xcbf6('0x3e')]||_0xcbf6('0x3f');this[_0xcbf6('0x40')]=_0x568a89['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xcbf6('0x41')]=_0x568a89[_0xcbf6('0x41')]||undefined;this['strategy']=strategy[_0x568a89[_0xcbf6('0x42')]]||'rrmemory';this[_0xcbf6('0x43')]=!![];this[_0xcbf6('0x44')]=_0x568a89['dialAMDActive']||![];this[_0xcbf6('0x45')]=_0x568a89[_0xcbf6('0x45')];this['dialAMDGreeting']=_0x568a89[_0xcbf6('0x46')];this[_0xcbf6('0x47')]=_0x568a89['dialAMDAfterGreetingSilence'];this[_0xcbf6('0x48')]=_0x568a89['dialAMDTotalAnalysisTime'];this[_0xcbf6('0x49')]=_0x568a89[_0xcbf6('0x49')];this[_0xcbf6('0x4a')]=_0x568a89['dialAMDBetweenWordsSilence'];this[_0xcbf6('0x4b')]=_0x568a89[_0xcbf6('0x4b')];this[_0xcbf6('0x4c')]=_0x568a89[_0xcbf6('0x4c')];this['dialAMDMaximumWordLength']=_0x568a89[_0xcbf6('0x4d')];this[_0xcbf6('0x4e')]=0x0;this[_0xcbf6('0x4f')]=0x0;this['timeout']=_0x568a89[_0xcbf6('0x50')];this[_0xcbf6('0x51')]=0x0;this[_0xcbf6('0x52')]=0x0;this[_0xcbf6('0x53')]=0x0;this[_0xcbf6('0x54')]=0x0;this[_0xcbf6('0x55')]=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0xcbf6('0x56')]=0x0;this[_0xcbf6('0x57')]=0x0;this[_0xcbf6('0x58')]=0x0;this[_0xcbf6('0x59')]=0x0;this[_0xcbf6('0x5a')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xcbf6('0x5b')]=0x0;this[_0xcbf6('0x5c')]=0x0;this[_0xcbf6('0x5d')]=undefined;this['startPredictive']=undefined;this[_0xcbf6('0x5e')]=undefined;this[_0xcbf6('0x5f')]=1.05;this[_0xcbf6('0x60')]=0x0;this[_0xcbf6('0x61')]=0x0;this[_0xcbf6('0x62')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xcbf6('0x63')]=0x0;this[_0xcbf6('0x64')]=0x0;this[_0xcbf6('0x65')]=0x0;this[_0xcbf6('0x66')]=_0x568a89['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xcbf6('0x67')]=_0x568a89[_0xcbf6('0x68')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xcbf6('0x69')]=0x0;this[_0xcbf6('0x6a')]=0x1;this[_0xcbf6('0x6b')]=0x0;this[_0xcbf6('0x6c')]=0x0;this[_0xcbf6('0x6d')]=0x0;this[_0xcbf6('0x6e')]=0x0;this[_0xcbf6('0x6f')]=_0x568a89['dialRecallMeTimeout']||0x1e;this[_0xcbf6('0x70')]=_0x568a89[_0xcbf6('0x70')]||![];this[_0xcbf6('0x71')]=_0x568a89[_0xcbf6('0x71')]||undefined;this[_0xcbf6('0x72')]=_0x568a89[_0xcbf6('0x72')]||![];this['dialAgiAfterHangupAgent']=_0x568a89['dialAgiAfterHangupAgent']||![];this[_0xcbf6('0xb')]=monitorFormat[_0x568a89[_0xcbf6('0xb')]]?monitorFormat[_0x568a89[_0xcbf6('0xb')]]:undefined;this[_0xcbf6('0x73')]=_0x568a89[_0xcbf6('0x73')]||![];this[_0xcbf6('0x74')]=_0x568a89['mandatoryDispositionPause']?_0x568a89['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
index 3c50933..163da04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd14=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0xbd14,0x8b));var _0x4bd1=function(_0x1eb591,_0xaf40de){_0x1eb591=_0x1eb591-0x0;var _0x156077=_0xbd14[_0x1eb591];return _0x156077;};'use strict';function VtigerAccount(_0x3d9e8f){this['id']=_0x3d9e8f['id']||0x0;this[_0x4bd1('0x0')]=_0x3d9e8f['name']||'';this[_0x4bd1('0x1')]=_0x3d9e8f[_0x4bd1('0x1')]||'';this[_0x4bd1('0x2')]=_0x3d9e8f[_0x4bd1('0x2')]||'';this['remoteUri']=_0x3d9e8f[_0x4bd1('0x3')]||'';this[_0x4bd1('0x4')]=_0x3d9e8f[_0x4bd1('0x4')]||'';this[_0x4bd1('0x5')]=_0x3d9e8f[_0x4bd1('0x5')]||{};}module[_0x4bd1('0x6')]=VtigerAccount;
\ No newline at end of file
+var _0x1574=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x182c41,_0x58ac89){var _0x32e955=function(_0x1869e1){while(--_0x1869e1){_0x182c41['push'](_0x182c41['shift']());}};_0x32e955(++_0x58ac89);}(_0x1574,0x148));var _0x4157=function(_0x4c9720,_0x3c6e9d){_0x4c9720=_0x4c9720-0x0;var _0x4d49b1=_0x1574[_0x4c9720];return _0x4d49b1;};'use strict';function VtigerAccount(_0x2aa1d7){this['id']=_0x2aa1d7['id']||0x0;this[_0x4157('0x0')]=_0x2aa1d7[_0x4157('0x0')]||'';this[_0x4157('0x1')]=_0x2aa1d7['username']||'';this[_0x4157('0x2')]=_0x2aa1d7[_0x4157('0x2')]||'';this[_0x4157('0x3')]=_0x2aa1d7[_0x4157('0x3')]||'';this[_0x4157('0x4')]=_0x2aa1d7[_0x4157('0x4')]||'';this[_0x4157('0x5')]=_0x2aa1d7[_0x4157('0x5')]||{};}module[_0x4157('0x6')]=VtigerAccount;
\ No newline at end of file
index c7ac542..92d5e5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5b3=['remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x934605,_0x1773c5){var _0x3594b4=function(_0xaf130e){while(--_0xaf130e){_0x934605['push'](_0x934605['shift']());}};_0x3594b4(++_0x1773c5);}(_0xc5b3,0xcd));var _0x3c5b=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xc5b3[_0x2c1dcd];return _0x158ce5;};'use strict';function ZendeskAccount(_0x302f1b){this['id']=_0x302f1b['id']||0x0;this['name']=_0x302f1b[_0x3c5b('0x0')]||'';this[_0x3c5b('0x1')]=_0x302f1b[_0x3c5b('0x1')]||'';this[_0x3c5b('0x2')]=_0x302f1b[_0x3c5b('0x2')]||'';this[_0x3c5b('0x3')]=_0x302f1b[_0x3c5b('0x3')]||'';this['remoteUri']=_0x302f1b[_0x3c5b('0x4')]||'';this[_0x3c5b('0x5')]=_0x302f1b['authType']||'';this[_0x3c5b('0x6')]=_0x302f1b[_0x3c5b('0x6')]||_0x3c5b('0x7');this['serverUrl']=_0x302f1b[_0x3c5b('0x8')]||'';this[_0x3c5b('0x9')]=_0x302f1b[_0x3c5b('0x9')]||{};}module[_0x3c5b('0xa')]=ZendeskAccount;
\ No newline at end of file
+var _0xbef9=['name','username','password','token','remoteUri','authType','integrationTab','serverUrl','Configurations','exports'];(function(_0x5a42d8,_0x1c5f8b){var _0x4fccdf=function(_0x26bf95){while(--_0x26bf95){_0x5a42d8['push'](_0x5a42d8['shift']());}};_0x4fccdf(++_0x1c5f8b);}(_0xbef9,0x186));var _0x9bef=function(_0x429f05,_0x131a65){_0x429f05=_0x429f05-0x0;var _0x549c1c=_0xbef9[_0x429f05];return _0x549c1c;};'use strict';function ZendeskAccount(_0xe4f21f){this['id']=_0xe4f21f['id']||0x0;this[_0x9bef('0x0')]=_0xe4f21f[_0x9bef('0x0')]||'';this['username']=_0xe4f21f[_0x9bef('0x1')]||'';this[_0x9bef('0x2')]=_0xe4f21f[_0x9bef('0x2')]||'';this[_0x9bef('0x3')]=_0xe4f21f[_0x9bef('0x3')]||'';this['remoteUri']=_0xe4f21f[_0x9bef('0x4')]||'';this[_0x9bef('0x5')]=_0xe4f21f[_0x9bef('0x5')]||'';this['type']=_0xe4f21f['type']||_0x9bef('0x6');this[_0x9bef('0x7')]=_0xe4f21f[_0x9bef('0x7')]||'';this['Configurations']=_0xe4f21f[_0x9bef('0x8')]||{};}module[_0x9bef('0x9')]=ZendeskAccount;
\ No newline at end of file
index 029e757..61d278c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ed7=['zone','clientId','clientSecret','code','refreshToken','Configurations','name','description','host'];(function(_0xe6e78c,_0x582369){var _0x2a09c8=function(_0x470ccc){while(--_0x470ccc){_0xe6e78c['push'](_0xe6e78c['shift']());}};_0x2a09c8(++_0x582369);}(_0x2ed7,0x72));var _0x72ed=function(_0x13af40,_0x284854){_0x13af40=_0x13af40-0x0;var _0x8ff8ad=_0x2ed7[_0x13af40];return _0x8ff8ad;};'use strict';function ZohoAccount(_0x2a3605){this['id']=_0x2a3605['id']||0x0;this[_0x72ed('0x0')]=_0x2a3605[_0x72ed('0x0')]||'';this[_0x72ed('0x1')]=_0x2a3605[_0x72ed('0x1')]||'';this[_0x72ed('0x2')]=_0x2a3605['host']||'';this[_0x72ed('0x3')]=_0x2a3605[_0x72ed('0x3')]||'';this[_0x72ed('0x4')]=_0x2a3605[_0x72ed('0x4')]||'';this[_0x72ed('0x5')]=_0x2a3605[_0x72ed('0x5')]||'';this['serverUrl']=_0x2a3605['serverUrl']||'';this['code']=_0x2a3605[_0x72ed('0x6')]||'';this[_0x72ed('0x7')]=_0x2a3605[_0x72ed('0x7')]||'';this['Configurations']=_0x2a3605[_0x72ed('0x8')]||{};}module['exports']=ZohoAccount;
\ No newline at end of file
+var _0xb987=['refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl','code'];(function(_0x1b81ec,_0x2e45f3){var _0xfc6a7a=function(_0x13976c){while(--_0x13976c){_0x1b81ec['push'](_0x1b81ec['shift']());}};_0xfc6a7a(++_0x2e45f3);}(_0xb987,0x179));var _0x7b98=function(_0x33fdf2,_0x3e6437){_0x33fdf2=_0x33fdf2-0x0;var _0x50012c=_0xb987[_0x33fdf2];return _0x50012c;};'use strict';function ZohoAccount(_0x24d852){this['id']=_0x24d852['id']||0x0;this[_0x7b98('0x0')]=_0x24d852['name']||'';this[_0x7b98('0x1')]=_0x24d852[_0x7b98('0x1')]||'';this[_0x7b98('0x2')]=_0x24d852[_0x7b98('0x2')]||'';this[_0x7b98('0x3')]=_0x24d852[_0x7b98('0x3')]||'';this[_0x7b98('0x4')]=_0x24d852[_0x7b98('0x4')]||'';this[_0x7b98('0x5')]=_0x24d852[_0x7b98('0x5')]||'';this[_0x7b98('0x6')]=_0x24d852[_0x7b98('0x6')]||'';this[_0x7b98('0x7')]=_0x24d852[_0x7b98('0x7')]||'';this[_0x7b98('0x8')]=_0x24d852[_0x7b98('0x8')]||'';this[_0x7b98('0x9')]=_0x24d852[_0x7b98('0x9')]||{};}module[_0x7b98('0xa')]=ZohoAccount;
\ No newline at end of file
index b20bbae..8fa927f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf039=['countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry'];(function(_0x1fad02,_0x504de7){var _0x530015=function(_0x2ca77b){while(--_0x2ca77b){_0x1fad02['push'](_0x1fad02['shift']());}};_0x530015(++_0x504de7);}(_0xf039,0xa0));var _0x9f03=function(_0x389b98,_0x58b439){_0x389b98=_0x389b98-0x0;var _0x65b7c6=_0xf039[_0x389b98];return _0x65b7c6;};'use strict';var util=require(_0x9f03('0x0'));var _=require('lodash');var moment=require(_0x9f03('0x1'));function checkNameSurname(_0x47031f,_0x2a39e1,_0xc125ec){var _0x4b3e7f='';if(!_[_0x9f03('0x2')](_0x2a39e1)&&_0x9f03('0x3')===typeof _0x2a39e1){_0x4b3e7f+=_0x2a39e1;}if(!_[_0x9f03('0x2')](_0xc125ec)&&'string'===typeof _0xc125ec){_0x4b3e7f+='\x20'+_0xc125ec;}if(_0x4b3e7f!==''){return _0x4b3e7f;}return _0x47031f;}function Action(_0x289f8c,_0x485ed8,_0x1cf6da,_0x4608da,_0x5b3c9c){this[_0x9f03('0x4')]=_0x1cf6da||undefined;this[_0x9f03('0x5')]=_0x289f8c['id'];this[_0x9f03('0x6')]=_0x485ed8[_0x9f03('0x7')];this[_0x9f03('0x8')]=_0x485ed8['type'];this[_0x9f03('0x9')]='queue';this[_0x9f03('0xa')]=![];this[_0x9f03('0xb')]=_[_0x9f03('0x2')](_0x289f8c[_0x9f03('0xc')])?undefined:_0x289f8c['Agent'][_0x9f03('0x7')];this[_0x9f03('0xd')]=this['membername']?util['format'](_0x9f03('0xe'),this[_0x9f03('0xb')]):_0x4608da||undefined;this[_0x9f03('0xf')]=checkNameSurname(_0x289f8c[_0x9f03('0x10')][_0x9f03('0x11')],_0x289f8c[_0x9f03('0x10')][_0x9f03('0x12')],_0x289f8c[_0x9f03('0x10')][_0x9f03('0x13')]);this[_0x9f03('0x14')]=_0x289f8c[_0x9f03('0x14')]||![];this[_0x9f03('0x15')]=_0x289f8c[_0x9f03('0x10')][_0x9f03('0x11')];this[_0x9f03('0x16')]=_0x289f8c['scheduledat'];this[_0x9f03('0x17')]=_0x289f8c['countbusyretry']||0x0;this[_0x9f03('0x18')]=_0x289f8c[_0x9f03('0x18')]||0x0;this[_0x9f03('0x19')]=_0x289f8c[_0x9f03('0x19')]||0x0;this['countglobal']=(_0x289f8c['countbusyretry']||0x0)+(_0x289f8c[_0x9f03('0x18')]||0x0)+(_0x289f8c[_0x9f03('0x19')]||0x0)+(_0x289f8c[_0x9f03('0x1a')]||0x0)+(_0x289f8c[_0x9f03('0x1b')]||0x0)+(_0x289f8c[_0x9f03('0x1c')]||0x0)+(_0x289f8c['countmachineretry']||0x0)+(_0x289f8c[_0x9f03('0x1d')]||0x0);this[_0x9f03('0x1a')]=_0x289f8c[_0x9f03('0x1a')]||0x0;this[_0x9f03('0x1b')]=_0x289f8c[_0x9f03('0x1b')]||0x0;this[_0x9f03('0x1c')]=_0x289f8c[_0x9f03('0x1c')]||0x0;this[_0x9f03('0x1e')]=_0x289f8c[_0x9f03('0x1e')]||0x0;this[_0x9f03('0x1d')]=_0x289f8c[_0x9f03('0x1d')]||0x0;this[_0x9f03('0x1f')]=_0x289f8c[_0x9f03('0x1f')];this[_0x9f03('0x20')]=_0x289f8c[_0x9f03('0x20')];this[_0x9f03('0x21')]=_0x289f8c[_0x9f03('0x21')];this[_0x9f03('0x22')]=_0x289f8c['recallme'];this['ContactId']=_0x289f8c[_0x9f03('0x23')];this[_0x9f03('0x24')]=_0x289f8c['ListId'];this['UserId']=_[_0x9f03('0x2')](_0x289f8c[_0x9f03('0xc')])?_0x289f8c['UserId']:_0x289f8c['Agent']['id'];this[_0x9f03('0x25')]=_0x289f8c[_0x9f03('0x25')];this[_0x9f03('0x26')]='';this[_0x9f03('0x27')]='';}Action[_0x9f03('0x28')][_0x9f03('0x29')]=function(){return util[_0x9f03('0x2a')](_0x9f03('0x2b'),this['calleridname'],this[_0x9f03('0x2c')]);};module[_0x9f03('0x2d')]=Action;
\ No newline at end of file
+var _0x14fc=['moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','phone','Contact','lastName','active','calleridnum','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','util','lodash'];(function(_0x26454c,_0x25e3a2){var _0x367457=function(_0xc01d9){while(--_0xc01d9){_0x26454c['push'](_0x26454c['shift']());}};_0x367457(++_0x25e3a2);}(_0x14fc,0xda));var _0xc14f=function(_0x248dc8,_0x10c027){_0x248dc8=_0x248dc8-0x0;var _0x15aaee=_0x14fc[_0x248dc8];return _0x15aaee;};'use strict';var util=require(_0xc14f('0x0'));var _=require(_0xc14f('0x1'));var moment=require(_0xc14f('0x2'));function checkNameSurname(_0x1be194,_0x4c7050,_0x1a8383){var _0x3bf9b4='';if(!_[_0xc14f('0x3')](_0x4c7050)&&_0xc14f('0x4')===typeof _0x4c7050){_0x3bf9b4+=_0x4c7050;}if(!_[_0xc14f('0x3')](_0x1a8383)&&_0xc14f('0x4')===typeof _0x1a8383){_0x3bf9b4+='\x20'+_0x1a8383;}if(_0x3bf9b4!==''){return _0x3bf9b4;}return _0x1be194;}function Action(_0x1e1931,_0x5a0850,_0x27f063,_0x28babf,_0xc1aa88){this[_0xc14f('0x5')]=_0x27f063||undefined;this[_0xc14f('0x6')]=_0x1e1931['id'];this['queue']=_0x5a0850[_0xc14f('0x7')];this['type']=_0x5a0850[_0xc14f('0x8')];this[_0xc14f('0x9')]=_0xc14f('0xa');this[_0xc14f('0xb')]=![];this[_0xc14f('0xc')]=_[_0xc14f('0x3')](_0x1e1931[_0xc14f('0xd')])?undefined:_0x1e1931[_0xc14f('0xd')][_0xc14f('0x7')];this[_0xc14f('0xe')]=this['membername']?util[_0xc14f('0xf')](_0xc14f('0x10'),this[_0xc14f('0xc')]):_0x28babf||undefined;this[_0xc14f('0x11')]=checkNameSurname(_0x1e1931['Contact'][_0xc14f('0x12')],_0x1e1931[_0xc14f('0x13')]['firstName'],_0x1e1931[_0xc14f('0x13')][_0xc14f('0x14')]);this[_0xc14f('0x15')]=_0x1e1931[_0xc14f('0x15')]||![];this[_0xc14f('0x16')]=_0x1e1931[_0xc14f('0x13')][_0xc14f('0x12')];this['scheduledat']=_0x1e1931['scheduledat'];this[_0xc14f('0x17')]=_0x1e1931['countbusyretry']||0x0;this[_0xc14f('0x18')]=_0x1e1931[_0xc14f('0x18')]||0x0;this['countnoanswerretry']=_0x1e1931['countnoanswerretry']||0x0;this[_0xc14f('0x19')]=(_0x1e1931['countbusyretry']||0x0)+(_0x1e1931[_0xc14f('0x18')]||0x0)+(_0x1e1931[_0xc14f('0x1a')]||0x0)+(_0x1e1931[_0xc14f('0x1b')]||0x0)+(_0x1e1931[_0xc14f('0x1c')]||0x0)+(_0x1e1931[_0xc14f('0x1d')]||0x0)+(_0x1e1931[_0xc14f('0x1e')]||0x0)+(_0x1e1931[_0xc14f('0x1f')]||0x0);this[_0xc14f('0x1b')]=_0x1e1931[_0xc14f('0x1b')]||0x0;this[_0xc14f('0x1c')]=_0x1e1931[_0xc14f('0x1c')]||0x0;this[_0xc14f('0x1d')]=_0x1e1931[_0xc14f('0x1d')]||0x0;this[_0xc14f('0x1e')]=_0x1e1931[_0xc14f('0x1e')]||0x0;this[_0xc14f('0x1f')]=_0x1e1931['countagentrejectretry']||0x0;this[_0xc14f('0x20')]=_0x1e1931[_0xc14f('0x20')];this[_0xc14f('0x21')]=_0x1e1931['callbackuniqueid'];this[_0xc14f('0x22')]=_0x1e1931[_0xc14f('0x22')];this['recallme']=_0x1e1931[_0xc14f('0x23')];this[_0xc14f('0x24')]=_0x1e1931[_0xc14f('0x24')];this[_0xc14f('0x25')]=_0x1e1931['ListId'];this[_0xc14f('0x26')]=_[_0xc14f('0x3')](_0x1e1931[_0xc14f('0xd')])?_0x1e1931['UserId']:_0x1e1931[_0xc14f('0xd')]['id'];this['VoiceQueueId']=_0x1e1931['VoiceQueueId'];this[_0xc14f('0x27')]='';this[_0xc14f('0x28')]='';}Action['prototype'][_0xc14f('0x29')]=function(){return util[_0xc14f('0xf')](_0xc14f('0x2a'),this['calleridname'],this[_0xc14f('0x2b')]);};module['exports']=Action;
\ No newline at end of file
index 7b4fa70..2498093 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa66a=['[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','amd','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','[callProgressDetectingAgent][logNoSuch]','logAgent','createAgentHistory','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','idContact','custom:agentcalled','called','Calling','logBlacklist','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','run','unlock','unlockContact','disableContact','pick','execRun','getContactPreview','recallme','validateContact','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridNumber','toLowerVariables','starttime','variablesAction','destconnectedlinenum','user:%s','user:agentconnect','accountcode','calleridnum','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','actionid','logLookAgent','clone','isFailure','response','rejected','callProgressDetectingAgent','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','addVariable','variables','filterKey','variable','keys','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','voiceQueues','trunks','agents','syncOriginateResponse','hangup','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','voice_queue_presence:remove','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','dialMethod','booked','clearZombieChannels','hasOwnProperty','setMessage','recallMe','clearZombieChannel','isNil','actions','[clearZombieChannels][talking]','Queue','originated:\x20','queue','pTalking:\x20','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','then','getDiff','scheduledat','Agent','voicePause','logger2','[RecallMe]','catch','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','[HistoryRecallClose]','sendMessageOneNotActive','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','responsetime','dialAnswer','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','\x20Queue','Busy','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','countbusyretry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','countagentrejectretry','AgentReject','custom:agentreject','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry'];(function(_0xcc9fc0,_0x3ba0c7){var _0x42ad36=function(_0x532427){while(--_0x532427){_0xcc9fc0['push'](_0xcc9fc0['shift']());}};_0x42ad36(++_0x3ba0c7);}(_0xa66a,0x72));var _0xaa66=function(_0x4da82f,_0xa47f2c){_0x4da82f=_0x4da82f-0x0;var _0x40497b=_0xa66a[_0x4da82f];return _0x40497b;};'use strict';var util=require(_0xaa66('0x0'));var _=require(_0xaa66('0x1'));var BPromise=require(_0xaa66('0x2'));var uuid=require(_0xaa66('0x3'));var moment=require(_0xaa66('0x4'));var md5=require(_0xaa66('0x5'));var Redis=require(_0xaa66('0x6'));var config=require(_0xaa66('0x7'));var logger=require(_0xaa66('0x8'))(_0xaa66('0x9'));var loggerAction=require(_0xaa66('0x8'))(_0xaa66('0xa'));var ami=require('../ami');var rpcDb=require(_0xaa66('0xb'));var Action=require(_0xaa66('0xc'));var ut=require(_0xaa66('0xd'));config[_0xaa66('0xe')]=_[_0xaa66('0xf')](config[_0xaa66('0xe')],{'host':_0xaa66('0x10'),'port':0x18eb});var io=require(_0xaa66('0x11'))(new Redis(config[_0xaa66('0xe')]));var Sequence=function(){};Sequence[_0xaa66('0x12')][_0xaa66('0x13')]=function(_0x52b3e1){this[_0xaa66('0x14')]=this[_0xaa66('0x14')]?this[_0xaa66('0x14')]['finally'](_0x52b3e1):_0x52b3e1();};function Preview(_0x3b3514){this[_0xaa66('0x15')]=new Sequence();this['campaignsPreview']=_0x3b3514[_0xaa66('0x16')];this[_0xaa66('0x17')]=_0x3b3514[_0xaa66('0x17')];this['actions']={};this[_0xaa66('0x18')]=_0x3b3514[_0xaa66('0x18')];this['clockClearZombieChannels']=0x0;ami['on']('originateresponse',this[_0xaa66('0x19')]['bind'](this));ami['on'](_0xaa66('0x1a'),this[_0xaa66('0x1b')][_0xaa66('0x1c')](this));ami['on'](_0xaa66('0x1d'),this[_0xaa66('0x1e')]['bind'](this));ami['on']('dialend',this[_0xaa66('0x1f')]['bind'](this));ami['on'](_0xaa66('0x20'),this['syncNewExten'][_0xaa66('0x1c')](this));ami['on'](_0xaa66('0x21'),this[_0xaa66('0x22')][_0xaa66('0x1c')](this));ami['on'](_0xaa66('0x23'),this[_0xaa66('0x24')]['bind'](this));ami['on'](_0xaa66('0x25'),this[_0xaa66('0x26')][_0xaa66('0x1c')](this));this[_0xaa66('0x27')](this[_0xaa66('0x28')]);}function emit(_0x32ab5b,_0x17104c,_0x423719){io['to'](_0x32ab5b)[_0xaa66('0x29')](_0x17104c,_0x423719);}function emitCampaignPreview(_0x5927c1){if(_0x5927c1[_0xaa66('0x2a')]===_0xaa66('0x2b')){var _0x35eb8c={'id':_0x5927c1['id'],'name':_0x5927c1[_0xaa66('0x2c')],'strategy':_0x5927c1[_0xaa66('0x2d')],'answered':_0x5927c1[_0xaa66('0x2e')],'available':_0x5927c1[_0xaa66('0x2f')],'loggedIn':_0x5927c1[_0xaa66('0x30')],'pTalking':_0x5927c1[_0xaa66('0x31')],'sumBillable':_0x5927c1[_0xaa66('0x32')],'sumDuration':_0x5927c1[_0xaa66('0x33')],'sumHoldTime':_0x5927c1['sumHoldTime']||0x0,'talking':_0x5927c1['talking'],'total':_0x5927c1[_0xaa66('0x34')],'type':_0x5927c1[_0xaa66('0x2a')],'unmanaged':_0x5927c1[_0xaa66('0x35')],'abandoned':_0x5927c1[_0xaa66('0x36')],'waiting':_0x5927c1[_0xaa66('0x37')],'loggedInDb':_0x5927c1[_0xaa66('0x38')],'dialActive':_0x5927c1[_0xaa66('0x39')],'dialMethod':_0x5927c1['dialMethod'],'dialOriginateCallerIdName':_0x5927c1[_0xaa66('0x3a')],'dialOriginateCallerIdNumber':_0x5927c1['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x5927c1[_0xaa66('0x3b')],'dialPrefix':_0x5927c1[_0xaa66('0x3c')],'outboundAnswerAgiCallsDay':_0x5927c1[_0xaa66('0x3d')],'outboundAnswerCallsDay':_0x5927c1[_0xaa66('0x3e')],'outboundBlacklistCallsDay':_0x5927c1[_0xaa66('0x3f')],'outboundBusyCallsDay':_0x5927c1[_0xaa66('0x40')],'outboundCongestionCallsDay':_0x5927c1[_0xaa66('0x41')],'outboundDropCallsDayACS':_0x5927c1[_0xaa66('0x42')],'outboundDropCallsDayCallersExit':_0x5927c1[_0xaa66('0x43')],'outboundDropCallsDayTimeout':_0x5927c1[_0xaa66('0x44')],'outboundNoAnswerCallsDay':_0x5927c1[_0xaa66('0x45')],'outboundNoSuchCallsDay':_0x5927c1['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x5927c1[_0xaa66('0x46')],'outboundReCallsDay':_0x5927c1[_0xaa66('0x47')],'outboundRejectCallsDay':_0x5927c1[_0xaa66('0x48')],'outboundUnknownCallsDay':_0x5927c1[_0xaa66('0x49')],'outboundAbandonedCallsDay':_0x5927c1[_0xaa66('0x4a')],'predictiveIntervalAnsweredCalls':_0x5927c1[_0xaa66('0x4b')],'predictiveIntervalAvgHoldtime':_0x5927c1[_0xaa66('0x4c')],'predictiveIntervalAvgTalktime':_0x5927c1['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x5927c1['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x5927c1['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5927c1['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5927c1[_0xaa66('0x4d')],'predictiveIntervalHitRate':_0x5927c1[_0xaa66('0x4e')],'predictiveIntervalMultiplicativeFactor':_0x5927c1[_0xaa66('0x4f')],'predictiveIntervalPauses':_0x5927c1[_0xaa66('0x50')],'predictiveIntervalAvailable':_0x5927c1[_0xaa66('0x51')],'predictiveIntervalTotalCalls':_0x5927c1[_0xaa66('0x52')],'message':_0x5927c1[_0xaa66('0x53')],'originated':_0x5927c1[_0xaa66('0x54')],'erlangCalls':_0x5927c1[_0xaa66('0x55')],'erlangCallToSecond':_0x5927c1['erlangCallToSecond'],'erlangAbandonmentRate':_0x5927c1[_0xaa66('0x56')],'erlangBusyFactor':_0x5927c1[_0xaa66('0x57')],'startPredictive':_0x5927c1[_0xaa66('0x58')],'startProgressive':_0x5927c1['startProgressive']};if(_0x5927c1[_0xaa66('0x59')]){_0x35eb8c[_0xaa66('0x59')]={'id':_0x5927c1[_0xaa66('0x59')]['id'],'name':_0x5927c1['Trunk'][_0xaa66('0x2c')],'active':_0x5927c1[_0xaa66('0x59')][_0xaa66('0x5a')],'callerid':_0x5927c1[_0xaa66('0x59')][_0xaa66('0x5b')]};}if(_0x5927c1[_0xaa66('0x5c')]){_0x35eb8c[_0xaa66('0x5c')]={'id':_0x5927c1[_0xaa66('0x5c')]['id'],'name':_0x5927c1[_0xaa66('0x5c')][_0xaa66('0x2c')]};}var _0x5d9278=md5(JSON['stringify'](_0x35eb8c));if(_0x5927c1[_0xaa66('0x5')]!==_0x5d9278){_0x5927c1[_0xaa66('0x5')]=_0x5d9278;emit(util[_0xaa66('0x5d')](_0xaa66('0x5e'),_0x35eb8c[_0xaa66('0x2c')]),_0xaa66('0x5f'),_0x35eb8c);}}}function emitVoiceQueueChannelRemove(_0x19c49a){logger[_0xaa66('0x60')](_0xaa66('0x61'),JSON[_0xaa66('0x62')](_0x19c49a));emit(util[_0xaa66('0x5d')](_0xaa66('0x5e'),_0x19c49a[_0xaa66('0x2c')]),_0xaa66('0x63'),_0x19c49a);io[_0xaa66('0x29')](_0xaa66('0x64'),_0x19c49a);}function notSendMessagesQueue(_0x353649){if(_0x353649['sendMessageOneNotActive']){if(_0x353649[_0xaa66('0x54')]===0x0&&_0x353649['pTalking']===0x0){_0x353649['sendMessageOneNotActive']=![];_0x353649[_0xaa66('0x2f')]=0x0;_0x353649[_0xaa66('0x65')]=0x0;_0x353649['message']=_0xaa66('0x66');ut[_0xaa66('0x67')](_0xaa66('0x68'),_0x353649[_0xaa66('0x2c')]+_0xaa66('0x69'));}else{_0x353649[_0xaa66('0x53')]=_0xaa66('0x6a');ut[_0xaa66('0x67')](_0xaa66('0x68'),_0x353649[_0xaa66('0x2c')]+_0xaa66('0x6b'));}emitCampaignPreview(_0x353649);}}Preview[_0xaa66('0x12')][_0xaa66('0x27')]=function(){var _0x1dc3a7=this;setInterval(function(){_0x1dc3a7[_0xaa66('0x6c')]();},0x7cf);};Preview[_0xaa66('0x12')][_0xaa66('0x6c')]=function(){var _0x582edf=this[_0xaa66('0x28')];this[_0xaa66('0x6d')]+=0x1;for(var _0x2c7495 in _0x582edf){if(_0x582edf['hasOwnProperty'](_0x2c7495)&&(_0x582edf[_0x2c7495][_0xaa66('0x6e')]===_0xaa66('0x9')||_0x582edf[_0x2c7495][_0xaa66('0x6e')]===_0xaa66('0x6f'))&&_0x582edf[_0x2c7495][_0xaa66('0x2a')]===_0xaa66('0x2b')){if(this[_0xaa66('0x6d')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xaa66('0x70')]();}}if(_0x582edf[_0xaa66('0x71')](_0x2c7495)&&_0x582edf[_0x2c7495]['dialMethod']===_0xaa66('0x9')&&_0x582edf[_0x2c7495][_0xaa66('0x2a')]===_0xaa66('0x2b')){if(_0x582edf[_0x2c7495][_0xaa66('0x39')]){this[_0xaa66('0x72')](_0x582edf[_0x2c7495]);this[_0xaa66('0x73')](_0x582edf[_0x2c7495]);}else{notSendMessagesQueue(_0x582edf[_0x2c7495]);}}}};Preview[_0xaa66('0x12')][_0xaa66('0x74')]=function(_0x4f9cca){var _0x36a947=this;this[_0xaa66('0x15')][_0xaa66('0x13')](function(){if(!_[_0xaa66('0x75')](_0x36a947[_0xaa66('0x76')][_0x4f9cca])){loggerAction[_0xaa66('0x60')](_0xaa66('0x77'),_0x4f9cca,_0xaa66('0x78'),_0x36a947[_0xaa66('0x76')][_0x4f9cca]['queue'],_0xaa66('0x79'),JSON[_0xaa66('0x62')](_0x36a947[_0xaa66('0x28')][_0x36a947['actions'][_0x4f9cca][_0xaa66('0x7a')]]['originated']),_0xaa66('0x7b'),JSON[_0xaa66('0x62')](_0x36a947[_0xaa66('0x28')][_0x36a947[_0xaa66('0x76')][_0x4f9cca][_0xaa66('0x7a')]][_0xaa66('0x31')]),JSON[_0xaa66('0x62')](_0x36a947['actions'][_0x4f9cca]['dialAnswer']),JSON[_0xaa66('0x62')](_['pick'](_0x36a947[_0xaa66('0x76')][_0x4f9cca],[_0xaa66('0x7c'),_0xaa66('0x7d'),_0xaa66('0x7e'),_0xaa66('0x7f')])));return ami[_0xaa66('0x80')]({'action':_0xaa66('0x81'),'channel':_0x36a947[_0xaa66('0x76')][_0x4f9cca][_0xaa66('0x82')]})['catch'](function(_0x39d95d){if(_0x39d95d[_0xaa66('0x53')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x36a947[_0xaa66('0x76')][_0x4f9cca]){ut[_0xaa66('0x83')](_0x36a947[_0xaa66('0x28')][_0x36a947['actions'][_0x4f9cca][_0xaa66('0x7a')]],_0xaa66('0x84'));if(_0x36a947['actions'][_0x4f9cca]['dialAnswer']===!![]){ut[_0xaa66('0x85')](_0x36a947[_0xaa66('0x28')][_0x36a947[_0xaa66('0x76')][_0x4f9cca][_0xaa66('0x7a')]],'[clearZombieChannel]');ut[_0xaa66('0x86')](_0xaa66('0x87')+_0x4f9cca,_0x36a947[_0xaa66('0x76')][_0x4f9cca][_0xaa66('0x7a')]);}ut[_0xaa66('0x86')]('[Dialer][checkChannel][Preview]'+_0x4f9cca,_0x36a947[_0xaa66('0x76')][_0x4f9cca]['queue']);delete _0x36a947[_0xaa66('0x76')][_0x4f9cca];}},0x2328);}});}});};Preview[_0xaa66('0x12')][_0xaa66('0x70')]=function(){var _0x4aa5cd=this;loggerAction[_0xaa66('0x60')](_0xaa66('0x88'),_[_0xaa66('0x89')](this[_0xaa66('0x76')]));for(var _0x240ace in this[_0xaa66('0x76')]){if(_0x4aa5cd[_0xaa66('0x76')][_0xaa66('0x71')](_0x240ace)){_0x4aa5cd['clearZombieChannel'](_0x240ace);}}};Preview['prototype'][_0xaa66('0x73')]=function(_0x1c97cb){var _0x272f61=this;rpcDb['getContactRecallMe'](_0x1c97cb['id'],ut['agentReadyId'](this[_0xaa66('0x18')]))[_0xaa66('0x8a')](function(_0x1a1ed3){if(!_[_0xaa66('0x75')](_0x1a1ed3)){for(var _0x2b0543=0x0;_0x2b0543<_0x1a1ed3['length'];_0x2b0543+=0x1){if(ut[_0xaa66('0x8b')](_0x1a1ed3[_0x2b0543][_0xaa66('0x8c')])<_0x1c97cb['dialRecallMeTimeout']*0x3c){if(_0x1a1ed3[_0x2b0543][_0xaa66('0x8d')]&&!_0x1a1ed3[_0x2b0543]['Agent'][_0xaa66('0x8e')]){_0x272f61['run'](_0x1a1ed3[_0x2b0543]['id'])['then'](ut[_0xaa66('0x8f')](_0xaa66('0x90')))[_0xaa66('0x91')](ut[_0xaa66('0x8f')](_0xaa66('0x90')));}else{rpcDb['disableContact'](_0x1a1ed3[_0x2b0543]['id']);}}else{var _0x49f325=new Action(_0x1a1ed3[_0x2b0543],_0x1c97cb);_0x49f325['starttime']=moment()[_0xaa66('0x5d')](_0xaa66('0x92'));_0x1c97cb[_0xaa66('0x47')]+=0x1;ut[_0xaa66('0x93')](_0x49f325,0x17,_0xaa66('0x94'));if(_0x1c97cb['dialRecallInQueue']){rpcDb[_0xaa66('0x95')](ut[_0xaa66('0x96')](_0x1a1ed3[_0x2b0543]));rpcDb[_0xaa66('0x97')](_0x49f325,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xaa66('0x93')](_0x49f325,0x16,_0xaa66('0x98'));rpcDb['createCustomerHistory'](_0x49f325,_0xaa66('0x99'));rpcDb['createCustomerFinal'](_0x49f325,'[HistoryRecallClose]');}}}}})['catch'](ut[_0xaa66('0x8f')]('[getContactRecallMe]'));};Preview[_0xaa66('0x12')][_0xaa66('0x72')]=function(_0x227705){_0x227705[_0xaa66('0x9a')]=!![];if(ut[_0xaa66('0x9b')](_0x227705['loggedIn'])){_0x227705[_0xaa66('0x53')]=_0xaa66('0x9c');}else if(!ut['isActive'](_0x227705[_0xaa66('0x39')])){_0x227705['message']='NOT_ACTIVE';}else if(!this[_0xaa66('0x9d')](_0x227705[_0xaa66('0x59')])){if(!this[_0xaa66('0x9d')](_0x227705[_0xaa66('0x9e')])){_0x227705[_0xaa66('0x53')]='TRUNK_IS_NOT_REACHABLE';}else{_0x227705[_0xaa66('0x53')]=_0xaa66('0x9f');}}else{_0x227705['message']='ACTIVE';}emitCampaignPreview(_0x227705);};Preview[_0xaa66('0x12')]['callProgressDetectingCustomer']=function(_0x540004,_0x458b8e,_0x2a0be2){var _0x396ea6=this;var _0x4acc83=this['actions'][_0x458b8e];var _0x328ef0=this['campaignsPreview'][_0x4acc83[_0xaa66('0x7a')]];var _0x46dab8;if(_0x328ef0){switch(_0x2a0be2){case'1':_0x328ef0[_0xaa66('0xa0')]+=0x1;_0x4acc83[_0xaa66('0xa1')]+=0x1;_0x4acc83[_0xaa66('0xa2')]=ut[_0xaa66('0xa3')](_0x4acc83);ut[_0xaa66('0x93')](_0x4acc83,0x0,_0xaa66('0xa4'));ami['emit'](_0xaa66('0xa5'),ut[_0xaa66('0xa6')](_0x4acc83,_0xaa66('0xa7')));rpcDb[_0xaa66('0x97')](_0x4acc83,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xaa66('0xa3')](_0x4acc83)>=_0x328ef0[_0xaa66('0xa8')]){_0x46dab8=ut[_0xaa66('0xa9')](_0x4acc83,0xf,_0xaa66('0xaa'));rpcDb[_0xaa66('0xab')](_0x46dab8,_0xaa66('0xac'));}else{if(_0x4acc83[_0xaa66('0xa1')]>=_0x328ef0['dialNoSuchNumberMaxRetry']){rpcDb[_0xaa66('0xab')](_0x4acc83,_0xaa66('0xac'));}else{rpcDb[_0xaa66('0xad')](ut[_0xaa66('0xae')](_0x4acc83,_0xaa66('0xa1'),_0x328ef0['dialNoSuchNumberRetryFrequency']),_0x4acc83[_0xaa66('0xaf')],_0x4acc83[_0xaa66('0xb0')]);}}delete this[_0xaa66('0x76')][_0x540004[_0xaa66('0xb1')]];break;case'ANSWER':var _0x32f204=moment()[_0xaa66('0x5d')](_0xaa66('0x92'));_0x4acc83[_0xaa66('0xb2')]=_0x32f204;_0x4acc83['answertime']=_0x32f204;_0x4acc83[_0xaa66('0xb3')]=!![];_0x328ef0[_0xaa66('0x31')]+=0x1;logger[_0xaa66('0x60')](_0xaa66('0xb4'),_0x4acc83[_0xaa66('0xb5')],'\x20Queue',_0x328ef0['name'],'pTalking:\x20',_0x328ef0[_0xaa66('0x31')]);ami[_0xaa66('0x29')](_0xaa66('0xb6'),ut[_0xaa66('0xa6')](_0x4acc83,_0xaa66('0xb7'),this[_0xaa66('0x28')][_0x4acc83[_0xaa66('0x7a')]]));if(_0x328ef0[_0xaa66('0xb8')]){ami[_0xaa66('0x29')](_0xaa66('0xb9'),ut[_0xaa66('0xba')](_0x4acc83));}break;case'16':ami[_0xaa66('0x29')](_0xaa66('0xbb'),ut[_0xaa66('0xa6')](_0x4acc83,'complete',this[_0xaa66('0x28')][_0x4acc83['queue']]));emitVoiceQueueChannelRemove(ut[_0xaa66('0xa6')](_0x4acc83,_0xaa66('0xbc')));_0x328ef0[_0xaa66('0x3e')]+=0x1;_0x328ef0['total']+=0x1;_0x328ef0[_0xaa66('0x2e')]+=0x1;ut[_0xaa66('0x85')](_0x328ef0,_0xaa66('0xbd'));_0x4acc83[_0xaa66('0xa2')]=ut[_0xaa66('0xa3')](_0x4acc83);ut['logCustomer'](_0x4acc83,0x4,_0xaa66('0xbe'));rpcDb[_0xaa66('0x97')](_0x4acc83,_0xaa66('0xbf'));rpcDb[_0xaa66('0xab')](_0x4acc83,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xaa66('0xc0')](_0x4acc83);_0x328ef0[_0xaa66('0x33')]+=_0x4acc83[_0xaa66('0xc1')];_0x328ef0[_0xaa66('0x32')]+=_0x4acc83[_0xaa66('0xc1')];logger['info']('[syncHangup][talking][decrement]',_0x4acc83['uniqueid'],_0xaa66('0xc2'),_0x328ef0[_0xaa66('0x2c')],_0xaa66('0x7b'),_0x328ef0[_0xaa66('0x31')]);delete this[_0xaa66('0x76')][_0x540004['linkedid']];break;case'BUSY':_0x328ef0[_0xaa66('0x40')]+=0x1;_0x4acc83['countbusyretry']+=0x1;_0x4acc83['countglobal']=ut[_0xaa66('0xa3')](_0x4acc83);ut['logCustomer'](_0x4acc83,0x5,_0xaa66('0xc3'));ami[_0xaa66('0x29')](_0xaa66('0xc4'),ut['buildObj'](_0x4acc83,'busy'));rpcDb[_0xaa66('0x97')](_0x4acc83,_0xaa66('0xc5'));if(ut[_0xaa66('0xa3')](_0x4acc83)>=_0x328ef0[_0xaa66('0xa8')]){_0x46dab8=ut[_0xaa66('0xa9')](_0x4acc83,0xf,_0xaa66('0xaa'));rpcDb[_0xaa66('0xab')](_0x46dab8,_0xaa66('0xc6'));}else{if(_0x4acc83['countbusyretry']>=_0x328ef0[_0xaa66('0xc7')]){rpcDb[_0xaa66('0xab')](_0x4acc83,_0xaa66('0xc5'));}else{rpcDb['rescheduleContact'](ut[_0xaa66('0xae')](_0x4acc83,_0xaa66('0xc8'),_0x328ef0[_0xaa66('0xc9')]),_0x4acc83['unlockAgent'],_0x4acc83[_0xaa66('0xb0')]);}}break;case _0xaa66('0xca'):_0x328ef0[_0xaa66('0x45')]+=0x1;_0x4acc83[_0xaa66('0xcb')]+=0x1;_0x4acc83['countglobal']=ut[_0xaa66('0xa3')](_0x4acc83);ut[_0xaa66('0x93')](_0x4acc83,0x3,_0xaa66('0xcc'));ami[_0xaa66('0x29')]('custom:agentnoanswer',ut[_0xaa66('0xa6')](_0x4acc83,_0xaa66('0xcd')));rpcDb['createCustomerHistory'](_0x4acc83,_0xaa66('0xce'));if(ut[_0xaa66('0xa3')](_0x4acc83)>=_0x328ef0['dialGlobalMaxRetry']){_0x46dab8=ut[_0xaa66('0xa9')](_0x4acc83,0xf,_0xaa66('0xaa'));rpcDb[_0xaa66('0xab')](_0x46dab8,_0xaa66('0xcf'));}else{if(_0x4acc83[_0xaa66('0xcb')]>=_0x328ef0[_0xaa66('0xd0')]){rpcDb[_0xaa66('0xab')](_0x4acc83,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xaa66('0xad')](ut[_0xaa66('0xae')](_0x4acc83,_0xaa66('0xcb'),_0x328ef0[_0xaa66('0xd1')]),_0x4acc83[_0xaa66('0xaf')],_0x4acc83['activeContact']);}}break;case _0xaa66('0xd2'):_0x328ef0['outboundCongestionCallsDay']+=0x1;_0x4acc83[_0xaa66('0xd3')]+=0x1;_0x4acc83[_0xaa66('0xa2')]=ut['totalGlobal'](_0x4acc83);ut[_0xaa66('0x93')](_0x4acc83,0x8,_0xaa66('0xd4'));ami['emit'](_0xaa66('0xd5'),ut[_0xaa66('0xa6')](_0x4acc83,_0xaa66('0xd6')));rpcDb[_0xaa66('0x97')](_0x4acc83,_0xaa66('0xd7'));if(ut['totalGlobal'](_0x4acc83)>=_0x328ef0[_0xaa66('0xa8')]){_0x46dab8=ut['cloneAction'](_0x4acc83,0xf,_0xaa66('0xaa'));rpcDb['createCustomerFinal'](_0x46dab8,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x4acc83[_0xaa66('0xd3')]>=_0x328ef0[_0xaa66('0xd8')]){rpcDb[_0xaa66('0xab')](_0x4acc83,_0xaa66('0xd7'));}else{rpcDb[_0xaa66('0xad')](ut[_0xaa66('0xae')](_0x4acc83,_0xaa66('0xd3'),_0x328ef0[_0xaa66('0xc9')]),_0x4acc83[_0xaa66('0xaf')],_0x4acc83[_0xaa66('0xb0')]);}}break;case'CANCEL':_0x328ef0[_0xaa66('0x48')]+=0x1;_0x4acc83[_0xaa66('0xd9')]+=0x1;_0x4acc83[_0xaa66('0xa2')]=ut[_0xaa66('0xa3')](_0x4acc83);ut[_0xaa66('0x93')](_0x4acc83,0x14,_0xaa66('0xda'));ami['emit'](_0xaa66('0xdb'),ut[_0xaa66('0xa6')](_0x4acc83,'agentreject'));rpcDb[_0xaa66('0x97')](_0x4acc83,'[syncHangupRequest][logAgentReject]');if(ut[_0xaa66('0xa3')](_0x4acc83)>=_0x328ef0[_0xaa66('0xa8')]){_0x46dab8=ut[_0xaa66('0xa9')](_0x4acc83,0x14,'AgentReject');rpcDb[_0xaa66('0xab')](_0x46dab8,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x4acc83[_0xaa66('0xd9')]>=_0x328ef0[_0xaa66('0xdc')]){rpcDb[_0xaa66('0xab')](_0x4acc83,_0xaa66('0xdd'));}else{rpcDb[_0xaa66('0xad')](ut[_0xaa66('0xae')](_0x4acc83,_0xaa66('0xd9'),_0x328ef0['dialAgentRejectRetryFrequency']),_0x4acc83[_0xaa66('0xaf')],_0x4acc83[_0xaa66('0xb0')]);}}break;case'ABANDONED':_0x328ef0[_0xaa66('0x4a')]+=0x1;_0x4acc83[_0xaa66('0xde')]+=0x1;_0x4acc83[_0xaa66('0xa2')]=ut[_0xaa66('0xa3')](_0x4acc83);ut[_0xaa66('0x93')](_0x4acc83,0xb,'Abandoned');rpcDb[_0xaa66('0x97')](_0x4acc83,_0xaa66('0xdf'));if(ut[_0xaa66('0xa3')](_0x4acc83)>=_0x328ef0['dialGlobalMaxRetry']){_0x46dab8=ut['cloneAction'](_0x4acc83,0xf,_0xaa66('0xaa'));rpcDb['createCustomerFinal'](_0x46dab8,_0xaa66('0xdf'));}else{if(_0x4acc83[_0xaa66('0xe0')]>=_0x328ef0['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x4acc83,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xaa66('0xad')](ut[_0xaa66('0xae')](_0x4acc83,_0xaa66('0xde'),_0x328ef0[_0xaa66('0xe1')]),_0x4acc83[_0xaa66('0xaf')],_0x4acc83[_0xaa66('0xb0')]);}}break;case'18':_0x328ef0[_0xaa66('0x49')]+=0x1;_0x4acc83[_0xaa66('0xe2')]+=0x1;_0x4acc83[_0xaa66('0xa2')]=ut[_0xaa66('0xa3')](_0x4acc83);ut['logCustomer'](_0x4acc83,0x12,_0x540004[_0xaa66('0xe3')]||_0x540004[_0xaa66('0xe4')]);ami[_0xaa66('0x29')](_0xaa66('0xe5'),ut[_0xaa66('0xa6')](_0x4acc83,'amd'));rpcDb['createCustomerHistory'](_0x4acc83,_0xaa66('0xe6'));if(ut[_0xaa66('0xa3')](_0x4acc83)>=_0x328ef0[_0xaa66('0xa8')]){_0x46dab8=ut['cloneAction'](_0x4acc83,0xf,_0xaa66('0xaa'));rpcDb[_0xaa66('0xab')](_0x46dab8,_0xaa66('0xe6'));}else{rpcDb[_0xaa66('0xab')](_0x4acc83,_0xaa66('0xe6'));}delete this[_0xaa66('0x76')][_0x540004['linkedid']];break;case'19':_0x328ef0[_0xaa66('0x49')]+=0x1;_0x4acc83['countglobal']=ut[_0xaa66('0xa3')](_0x4acc83);ut[_0xaa66('0x93')](_0x4acc83,0x13,_0x540004[_0xaa66('0xe3')]||_0x540004[_0xaa66('0xe4')]);ami['emit'](_0xaa66('0xe5'),ut[_0xaa66('0xa6')](_0x4acc83,_0xaa66('0xe7')));rpcDb[_0xaa66('0x97')](_0x4acc83,_0xaa66('0xe8'));if(ut[_0xaa66('0xa3')](_0x4acc83)>=_0x328ef0[_0xaa66('0xa8')]){_0x46dab8=ut[_0xaa66('0xa9')](_0x4acc83,0xf,_0xaa66('0xaa'));rpcDb[_0xaa66('0xab')](_0x46dab8,'[callProgressDetectingCustomer][machine]');}else{rpcDb['createCustomerFinal'](_0x4acc83,_0xaa66('0xe8'));}delete this[_0xaa66('0x76')][_0x540004[_0xaa66('0xb1')]];break;default:if(_0x4acc83['dialAnswer']){ut[_0xaa66('0x85')](_0x328ef0,_0xaa66('0xe9'));ut[_0xaa66('0x86')](_0xaa66('0xea')+_0x328ef0[_0xaa66('0x2c')],_0x540004);}_0x328ef0[_0xaa66('0x49')]+=0x1;_0x4acc83[_0xaa66('0xa2')]=ut[_0xaa66('0xa3')](_0x4acc83);ut['logCustomer'](_0x4acc83,0xc,_0x540004[_0xaa66('0xe3')]||_0x540004['dialstatus']);rpcDb[_0xaa66('0x97')](_0x4acc83,_0xaa66('0xeb'));if(ut[_0xaa66('0xa3')](_0x4acc83)>=_0x328ef0['dialGlobalMaxRetry']){_0x46dab8=ut['cloneAction'](_0x4acc83,0xf,_0xaa66('0xaa'));rpcDb[_0xaa66('0xab')](_0x46dab8,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xaa66('0xab')](_0x4acc83,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xaa66('0x76')][_0x540004[_0xaa66('0xb1')]];}if(!(_0x4acc83[_0xaa66('0xb3')]&&_0x2a0be2==='16')){ut[_0xaa66('0x83')](_0x328ef0,'[callProgressDetectingCustomer]');logger[_0xaa66('0x60')](_0xaa66('0xec'),_0x4acc83[_0xaa66('0xb5')],_0xaa66('0xc2'),_0x328ef0[_0xaa66('0x2c')],_0xaa66('0x79'),_0x328ef0[_0xaa66('0x54')]);}if(_0x2a0be2!=='ANSWER'){delete this[_0xaa66('0x76')][_0x540004[_0xaa66('0xb1')]];delete this['actions'][_0x540004['destlinkedid']];}}};Preview[_0xaa66('0x12')]['callProgressDetectingAgent']=function(_0x1fc473,_0x38b4b3,_0x28b3a1){if(_[_0xaa66('0xed')](_0x38b4b3)&&_0xaa66('0xee')!==typeof _0x38b4b3){return;}if(_['isUndefined'](_0x28b3a1)&&_0xaa66('0xee')!==typeof _0x28b3a1){return;}switch(_0x28b3a1[_0xaa66('0xef')]){case'0':ut['logAgent'](_0x1fc473,0x0,_0xaa66('0xa4'));rpcDb['createAgentHistory'](_0x1fc473,_0xaa66('0xf0'));break;case'3':ut[_0xaa66('0xf1')](_0x1fc473,0x3,_0xaa66('0xcc'));rpcDb['createAgentHistory'](_0x1fc473,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x1fc473,0x5,_0xaa66('0xc3'));rpcDb[_0xaa66('0xf2')](_0x1fc473,'[callProgressDetectingAgent][logBusy]');break;case'8':ut[_0xaa66('0xf1')](_0x1fc473,0x8,_0xaa66('0xd4'));rpcDb[_0xaa66('0xf2')](_0x1fc473,_0xaa66('0xf3'));break;case'22':ut['logAgent'](_0x1fc473,0x16,'AnswerAGI');rpcDb[_0xaa66('0xf2')](_0x1fc473,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x1fc473,0xc,_0x28b3a1['reason']);rpcDb[_0xaa66('0xf2')](_0x1fc473,_0xaa66('0xf3'));}ut['updateOriginated'](_0x38b4b3,_0xaa66('0xf4'));logger[_0xaa66('0x60')](_0xaa66('0xf5'),_0x1fc473[_0xaa66('0xb5')],_0xaa66('0xc2'),_0x38b4b3[_0xaa66('0x2c')],_0xaa66('0x79'),_0x38b4b3[_0xaa66('0x54')]);delete this[_0xaa66('0x76')][_0x1fc473[_0xaa66('0xb5')]];};Preview['prototype'][_0xaa66('0xf6')]=function(_0x1fc3df,_0xd9259f,_0x4c1140,_0x5a3640,_0x58143c){var _0x16bcec=this;return new BPromise(function(_0x330bae,_0x49c63d){if(_[_0xaa66('0x75')](_0xd9259f)||_[_0xaa66('0x75')](_0xd9259f['Contact'])||_[_0xaa66('0x75')](_0xd9259f[_0xaa66('0xf7')][_0xaa66('0xf8')])||_[_0xaa66('0x75')](_0xd9259f[_0xaa66('0x7e')])){_0x49c63d(ut[_0xaa66('0x53')](_0xaa66('0xf9'),_0x5a3640,_0x58143c));return;}var _0x1f0241=uuid['v4']();var _0x56189c=_0x16bcec[_0xaa66('0x28')][_0xd9259f[_0xaa66('0x78')][_0xaa66('0x2c')]];var _0x1cb1db=_0x4c1140?_0x16bcec[_0xaa66('0x18')][_0x4c1140]['id']:undefined;_0x16bcec['actions'][_0x1f0241]=new Action(_0xd9259f,_0x56189c,_0x1f0241,_0x4c1140,_0x1cb1db);var _0x191080=_0x16bcec['actions'][_0x1f0241];_0x191080['unlockAgent']=_0x5a3640;_0x191080['activeContact']=_0x58143c;_0x191080[_0xaa66('0xfa')]=_0x4c1140;if(_[_0xaa66('0xfb')](_0x1fc3df)){_0x16bcec[_0xaa66('0xfc')](_0x191080,_0x56189c,_0xd9259f,_0x4c1140)[_0xaa66('0x8a')](function(_0x32afef){logger[_0xaa66('0x60')](_0xaa66('0xfd'),'Queue:\x20'+_0x191080[_0xaa66('0x7a')]+'\x20IdHopper:\x20'+_0x191080[_0xaa66('0xfe')],JSON[_0xaa66('0x62')](_0x32afef));ami[_0xaa66('0x29')](_0xaa66('0xff'),ut[_0xaa66('0xa6')](_0x191080,_0xaa66('0x100'),_0x16bcec[_0xaa66('0x28')][_0x191080[_0xaa66('0x7a')]]));_0x330bae(ut['message'](_0xaa66('0x101')));})['catch'](function(_0x41c207){ut['logger']('[Preview][execCall][failure]',_0x41c207);_0x49c63d(ut[_0xaa66('0x53')]('Call\x20failed',_0x5a3640,_0x58143c));});}else{_0x56189c[_0xaa66('0x3f')]+=0x1;ut[_0xaa66('0x102')](_0x191080);rpcDb['createHistory'](_0x191080,'[Blacklist][error]');delete _0x16bcec['actions'][_0x1f0241];_0x49c63d(ut[_0xaa66('0x53')](_0xaa66('0x103'),_0x5a3640,_0x58143c));}});};Preview[_0xaa66('0x12')]['isTrunkReachable']=function(_0x57f413){return!_[_0xaa66('0x75')](_0x57f413)&&!_[_0xaa66('0x75')](_0x57f413[_0xaa66('0x2c')])&&!_[_0xaa66('0x75')](_0x57f413[_0xaa66('0x5a')])&&_0x57f413[_0xaa66('0x5a')]&&!_[_0xaa66('0x75')](this[_0xaa66('0x17')][util['format'](_0xaa66('0x104'),_0x57f413[_0xaa66('0x2c')])])&&!_[_0xaa66('0x75')](this['trunks'][util[_0xaa66('0x5d')](_0xaa66('0x104'),_0x57f413['name'])][_0xaa66('0x81')])&&(this[_0xaa66('0x17')][util[_0xaa66('0x5d')]('SIP/%s',_0x57f413['name'])][_0xaa66('0x81')]==='reachable'||this[_0xaa66('0x17')][util[_0xaa66('0x5d')](_0xaa66('0x104'),_0x57f413[_0xaa66('0x2c')])]['status']===_0xaa66('0x105'));};Preview[_0xaa66('0x12')][_0xaa66('0x106')]=function(_0x1abbc9,_0x11a7a5){var _0x3021e9=this;return new BPromise(function(_0x50b74b,_0x4929c2){_0x3021e9['execRun'](_0x1abbc9,_0x11a7a5)[_0xaa66('0x8a')](function(_0x2536f4){_0x50b74b(_['pick'](_0x2536f4,[_0xaa66('0x53')]));})[_0xaa66('0x91')](function(_0x5375f2){if(_0x5375f2[_0xaa66('0x107')]){rpcDb[_0xaa66('0x108')](_0x1abbc9);}if(_0x5375f2[_0xaa66('0x5a')]){rpcDb[_0xaa66('0x109')](_0x1abbc9);}_0x4929c2(_[_0xaa66('0x10a')](_0x5375f2,['message']));});});};Preview[_0xaa66('0x12')][_0xaa66('0x10b')]=function(_0x3afc4c,_0x1849da){var _0x1aa0c1=this;return new BPromise(function(_0x833c34,_0x331c55){var _0x5f03ca,_0x134929;rpcDb[_0xaa66('0x10c')](_0x3afc4c)[_0xaa66('0x8a')](function(_0x2c6f20){if(!_['isNil'](_0x2c6f20[0x0])){_0x134929=_0x2c6f20[0x0][_0xaa66('0x10d')]?![]:!![];_0x5f03ca=_0x2c6f20[0x0]['recallme']?!![]:![];_0x5f03ca=_0x1849da?!![]:_0x5f03ca;}var _0x38d3ce=_0x1aa0c1[_0xaa66('0x10e')](_0x2c6f20);if(_0x38d3ce['isValid']){rpcDb['checkIsBlackList'](_[_0xaa66('0x10a')](_0x2c6f20[0x0],[_0xaa66('0x7e'),_0xaa66('0x10f')]))[_0xaa66('0x8a')](function(_0x58e6c4){_0x1aa0c1[_0xaa66('0xf6')](_0x58e6c4,_0x2c6f20[0x0],_0x1849da,_0x134929,_0x5f03ca)[_0xaa66('0x8a')](function(_0x13f810){_0x833c34(_0x13f810);})[_0xaa66('0x91')](function(_0x4366fb){_0x331c55(_0x4366fb);});})[_0xaa66('0x91')](function(_0x44ae50){ut[_0xaa66('0x67')](_0xaa66('0x110'),_0x44ae50);_0x331c55(ut[_0xaa66('0x53')](_0xaa66('0x111'),_0x134929,_0x5f03ca));});}else{_0x331c55(ut[_0xaa66('0x53')](_0x38d3ce[_0xaa66('0x53')],_0x134929,_0x5f03ca));}})[_0xaa66('0x91')](function(_0x1b930e){ut[_0xaa66('0x67')](_0xaa66('0x112'),_0x1b930e);_0x331c55(ut[_0xaa66('0x53')](_0xaa66('0x111'),![],!![]));});});};Preview[_0xaa66('0x12')][_0xaa66('0x10e')]=function(_0x9462dd){if(_[_0xaa66('0x75')](_0x9462dd)||_[_0xaa66('0xfb')](_0x9462dd)||!_[_0xaa66('0x75')](_0x9462dd[0x0][_0xaa66('0x8d')])&&_[_0xaa66('0x75')](_0x9462dd[0x0]['Agent'][_0xaa66('0x2c')])){ut[_0xaa66('0x67')]('[Preview][validateContact][Empty\x20Contact]',_0x9462dd);return{'isValid':![],'message':_0xaa66('0x113')};}var _0x95d989=this[_0xaa66('0x28')][_0x9462dd[0x0]['Queue'][_0xaa66('0x2c')]];_0x95d989[_0xaa66('0x53')]=_0xaa66('0x9f');if(_[_0xaa66('0x75')](_0x95d989)){ut[_0xaa66('0x67')](_0xaa66('0x114'),_0x95d989);return{'isValid':![],'message':_0xaa66('0x115')};}if(!this[_0xaa66('0x9d')](_0x95d989[_0xaa66('0x59')])){ut['logger'](_0xaa66('0x116'),_0xaa66('0x117')+_0x95d989[_0xaa66('0x2c')]+_0xaa66('0x118'));if(!this[_0xaa66('0x9d')](_0x95d989[_0xaa66('0x9e')])){ut[_0xaa66('0x67')](_0xaa66('0x116'),_0x95d989['name']+_0xaa66('0x119'));return{'isValid':![],'message':_0xaa66('0x11a')};}}if(!ut[_0xaa66('0x11b')](_0x95d989[_0xaa66('0x39')])){ut[_0xaa66('0x67')]('[Preview][validateContact][Campaign\x20Active]',_0x95d989['name']+_0xaa66('0x11c'));return{'isValid':![],'message':_0xaa66('0x117')+_0x95d989[_0xaa66('0x2c')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xaa66('0x11d')};};Preview[_0xaa66('0x12')][_0xaa66('0xfc')]=function(_0x31a898,_0x58be2c,_0x1969c4,_0x43fc04){var _0x4f4bb4=this;return new BPromise(function(_0x71b74b,_0x26c6ad){var _0xfdc43a=_0x31a898[_0xaa66('0xb5')];var _0x1b03ea=_0x4f4bb4[_0xaa66('0x9d')](_0x58be2c['Trunk'])?util[_0xaa66('0x5d')](_0xaa66('0x11e'),_0x58be2c[_0xaa66('0x59')][_0xaa66('0x2c')],_['isNil'](_0x58be2c[_0xaa66('0x3c')])?'':_0x58be2c[_0xaa66('0x3c')][_0xaa66('0x11f')]()||'',_0x58be2c[_0xaa66('0x120')]>0x0?_0x1969c4['Contact'][_0xaa66('0xf8')]['substring'](_0x58be2c[_0xaa66('0x120')]):_0x1969c4[_0xaa66('0xf7')][_0xaa66('0xf8')]):util[_0xaa66('0x5d')](_0xaa66('0x11e'),_[_0xaa66('0x75')](_0x58be2c['TrunkBackup'])?_0x58be2c[_0xaa66('0x59')][_0xaa66('0x2c')]:_0x58be2c['TrunkBackup'][_0xaa66('0x2c')],_[_0xaa66('0x75')](_0x58be2c[_0xaa66('0x3c')])?'':_0x58be2c[_0xaa66('0x3c')][_0xaa66('0x11f')]()||'',_0x58be2c[_0xaa66('0x120')]>0x0?_0x1969c4['Contact']['phone'][_0xaa66('0x121')](_0x58be2c['dialCutDigit']):_0x1969c4[_0xaa66('0xf7')]['phone']);var _0x1f2afe=_0x4f4bb4[_0xaa66('0x9d')](_0x58be2c[_0xaa66('0x59')])?ut[_0xaa66('0x122')](_0x58be2c[_0xaa66('0x59')][_0xaa66('0x5b')],_0x58be2c['dialOriginateCallerIdName'],_0x58be2c[_0xaa66('0x123')]>0x0?ut[_0xaa66('0x124')](_0x58be2c[_0xaa66('0x125')],_0x58be2c['dialRandomLastDigitCallerIdNumber']):_0x58be2c['dialOriginateCallerIdNumber']):ut[_0xaa66('0x122')](_[_0xaa66('0x75')](_0x58be2c[_0xaa66('0x9e')])?_0x58be2c['Trunk'][_0xaa66('0x5b')]:_0x58be2c[_0xaa66('0x9e')][_0xaa66('0x5b')],_0x58be2c[_0xaa66('0x3a')],_0x58be2c['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xaa66('0x124')](_0x58be2c[_0xaa66('0x125')],_0x58be2c[_0xaa66('0x123')]):_0x58be2c['dialOriginateCallerIdNumber']);if(_0x1f2afe){_0x31a898[_0xaa66('0x126')]=ut['extractCalleridName'](_0x1f2afe);_0x31a898['originatecalleridnum']=ut[_0xaa66('0x127')](_0x1f2afe);}var _0x2db12e=ut['addVariables'](_0x58be2c,_0x1969c4,_0x1b03ea,_0x1f2afe,_0xfdc43a,_0x31a898);_['merge'](_0x31a898,ut[_0xaa66('0x128')](_0x2db12e));_0x31a898[_0xaa66('0x129')]=moment()[_0xaa66('0x5d')](_0xaa66('0x92'));ami[_0xaa66('0x80')](ut[_0xaa66('0x12a')](_0x31a898,_0x58be2c,_0x2db12e,_0x31a898[_0xaa66('0xb0')],_0x43fc04))['then'](function(_0x1fb367){var _0x5622c9=_0x31a898['channelAgent'];if(!_['isNil'](_0x5622c9)){if(!_['isNil'](_0x4f4bb4[_0xaa66('0x18')][_0x5622c9])){_0x4f4bb4[_0xaa66('0x18')][_0x5622c9][_0xaa66('0x12b')]=_0x31a898['calleridnum'];emit(util[_0xaa66('0x5d')](_0xaa66('0x12c'),_0x4f4bb4[_0xaa66('0x18')][_0x5622c9]['name']),_0xaa66('0x12d'),{'destaccountcode':_0x4f4bb4[_0xaa66('0x18')][_0x5622c9][_0xaa66('0x12e')],'destconnectedlinenum':_0x31a898[_0xaa66('0x12f')]});}}_0x58be2c[_0xaa66('0x54')]+=0x1;logger['info'](_0xaa66('0x130'),_0xfdc43a,'\x20Queue',_0x58be2c[_0xaa66('0x2c')],_0xaa66('0x79'),_0x58be2c[_0xaa66('0x54')]);_0x71b74b(_0x1fb367);})['catch'](function(_0x1cfd39){ut[_0xaa66('0xf1')](_0x31a898,0xe,_0xaa66('0x131'));rpcDb[_0xaa66('0xf2')](_0x31a898,_0xaa66('0x132'));_0x26c6ad(_0x1cfd39);});});};Preview[_0xaa66('0x12')][_0xaa66('0x133')]=function(_0x275ecc){if(this['actions'][_0x275ecc[_0xaa66('0xb1')]]){this['actions'][_0x275ecc[_0xaa66('0xb1')]][_0xaa66('0x82')]=_0x275ecc[_0xaa66('0x82')];}};Preview['prototype'][_0xaa66('0x19')]=function(_0x12f3c4){var _0x3b0c9d=this;var _0x1ad270=this[_0xaa66('0x76')][_0x12f3c4[_0xaa66('0x134')]];if(_0x1ad270){if(_0x1ad270[_0xaa66('0xfa')]&&this[_0xaa66('0x18')][_0x1ad270[_0xaa66('0xfa')]]){ut[_0xaa66('0x135')](_0x1ad270,this[_0xaa66('0x18')][_0x1ad270[_0xaa66('0xfa')]][_0xaa66('0x2c')],this['agents'][_0x1ad270['lookAgent']]['id']);}var _0xccfec7=_[_0xaa66('0x136')](_0x1ad270);_0xccfec7[_0xaa66('0xb2')]=moment()[_0xaa66('0x5d')]('YYYY-MM-DD\x20HH:mm:ss');var _0x14960d=_0x3b0c9d[_0xaa66('0x28')][_0x1ad270['queue']];if(ut[_0xaa66('0x137')](_0x12f3c4[_0xaa66('0x138')])){if(_0x1ad270[_0xaa66('0xaf')]){rpcDb[_0xaa66('0x108')](_0x1ad270[_0xaa66('0xfe')]);}if(_0x1ad270[_0xaa66('0xb0')]){rpcDb['disableContact'](_0x1ad270['idContact']);}ami['emit']('custom:agentringnoanswer',ut[_0xaa66('0xa6')](_0x1ad270,_0xaa66('0x139'),this[_0xaa66('0x28')][_0x1ad270[_0xaa66('0x7a')]]));this[_0xaa66('0x13a')](_0xccfec7,_0x14960d,_0x12f3c4);}else{_0x1ad270[_0xaa66('0x129')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');ut[_0xaa66('0xf1')](_0xccfec7,0x4,_0xaa66('0xbe'));rpcDb[_0xaa66('0xf2')](_0xccfec7,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xaa66('0x12')][_0xaa66('0x1b')]=function(_0x4064e4){var _0x97674d=this;var _0xbdbfdd=this['actions'][_0x4064e4[_0xaa66('0xb1')]];var _0x24d8c1;if(_0xbdbfdd){_0x24d8c1=this[_0xaa66('0x28')][_0xbdbfdd['queue']];logger[_0xaa66('0x60')](_0xaa66('0x13b'),_0x4064e4[_0xaa66('0xb1')],_0xaa66('0xc2'),_0x24d8c1[_0xaa66('0x2c')],_0xaa66('0x7b'),_0x24d8c1['pTalking']);}if(this[_0xaa66('0x76')][_0x4064e4[_0xaa66('0xb1')]]&&_0x4064e4[_0xaa66('0xb1')]!==_0x4064e4['uniqueid']){if(_0x4064e4[_0xaa66('0x13c')]==='16'&&this[_0xaa66('0x76')][_0x4064e4[_0xaa66('0xb1')]][_0xaa66('0xb3')]){this[_0xaa66('0x13d')](_0x4064e4,_0x4064e4[_0xaa66('0xb1')],_0x4064e4[_0xaa66('0x13c')]);}else if(this[_0xaa66('0x76')][_0x4064e4[_0xaa66('0xb1')]][_0xaa66('0xb3')]){logger[_0xaa66('0x60')](_0xaa66('0x13e'),_0x4064e4[_0xaa66('0xb1')],_0x4064e4[_0xaa66('0x13c')],_0xaa66('0xc2'),_0x24d8c1['name'],_0xaa66('0x7b'),_0x24d8c1['pTalking']);this[_0xaa66('0x13d')](_0x4064e4,_0x4064e4[_0xaa66('0xb1')],_0x4064e4[_0xaa66('0x13c')]);}}else if(_0xbdbfdd&&_[_0xaa66('0x75')](_0xbdbfdd[_0xaa66('0x13f')])&&_0x24d8c1[_0xaa66('0x140')]&&_0x4064e4[_0xaa66('0xb1')]===_0x4064e4[_0xaa66('0xb5')]&&_[_0xaa66('0x75')](_0x4064e4[_0xaa66('0xef')])&&_0x4064e4[_0xaa66('0x13c')]==='16'&&_0x4064e4[_0xaa66('0x141')]==='6'&&_[_0xaa66('0xed')](_0xbdbfdd[_0xaa66('0x142')])){if(_0xbdbfdd[_0xaa66('0xaf')]){rpcDb[_0xaa66('0x108')](_0xbdbfdd[_0xaa66('0xfe')]);}if(_0xbdbfdd[_0xaa66('0xb0')]){rpcDb[_0xaa66('0x109')](_0xbdbfdd['idContact']);}_0x4064e4['reason']='22';this[_0xaa66('0x13a')](_0xbdbfdd,_0x24d8c1,_0x4064e4);}else if(_0xbdbfdd&&_0xbdbfdd['transfer']){if(_0x4064e4[_0xaa66('0x13c')]==='16'&&this[_0xaa66('0x76')][_0x4064e4[_0xaa66('0xb1')]][_0xaa66('0xb3')]){logger[_0xaa66('0x60')](_0xaa66('0x143'),_0x4064e4[_0xaa66('0xb1')],_0x4064e4[_0xaa66('0x13c')],_0xaa66('0xc2'),_0x24d8c1['name'],_0xaa66('0x7b'),_0x24d8c1['pTalking']);this[_0xaa66('0x13d')](_0x4064e4,_0x4064e4[_0xaa66('0xb1')],_0x4064e4['cause']);}else if(this[_0xaa66('0x76')][_0x4064e4[_0xaa66('0xb1')]][_0xaa66('0xb3')]){logger[_0xaa66('0x60')]('[syncHangup][talking][cause]',_0x4064e4[_0xaa66('0xb1')],_0x4064e4['cause'],_0xaa66('0xc2'),_0x24d8c1[_0xaa66('0x2c')],_0xaa66('0x7b'),_0x24d8c1['pTalking']);this['callProgressDetectingCustomer'](_0x4064e4,_0x4064e4[_0xaa66('0xb1')],_0x4064e4[_0xaa66('0x13c')]);}}};Preview[_0xaa66('0x12')]['syncDialEnd']=function(_0x50821b){if(this[_0xaa66('0x76')][_0x50821b[_0xaa66('0x144')]]&&_0x50821b[_0xaa66('0x144')]!==_0x50821b[_0xaa66('0x145')]){this['callProgressDetectingCustomer'](_0x50821b,_0x50821b[_0xaa66('0x144')],_0x50821b[_0xaa66('0xe4')]);}};Preview['prototype'][_0xaa66('0x1e')]=function(_0x2e94a7){if(this[_0xaa66('0x76')][_0x2e94a7[_0xaa66('0xb1')]]&&_0x2e94a7[_0xaa66('0xb1')]!==_0x2e94a7[_0xaa66('0xb5')]&&!this[_0xaa66('0x76')][_0x2e94a7['linkedid']]['dialAnswer']){if(_0x2e94a7[_0xaa66('0x13c')]==='1'){this[_0xaa66('0x13d')](_0x2e94a7,_0x2e94a7['linkedid'],_0x2e94a7[_0xaa66('0x13c')]);}}};Preview['prototype'][_0xaa66('0x146')]=function(_0x1a692b,_0x3b2e28,_0x5dc0b2){if(this[_0xaa66('0x76')][_0x1a692b]){if(_[_0xaa66('0x75')](this[_0xaa66('0x76')][_0x1a692b]['variables'])){this['actions'][_0x1a692b][_0xaa66('0x147')]={};}this[_0xaa66('0x76')][_0x1a692b][_0xaa66('0x147')][_0x3b2e28]=_0x5dc0b2;}};Preview[_0xaa66('0x12')][_0xaa66('0x22')]=function(_0x40369d){try{if(!_['isNil'](_0x40369d)){if(ut[_0xaa66('0x148')](_['keys'](_0x40369d[_0xaa66('0x149')])[0x0])){this[_0xaa66('0x146')](_0x40369d[_0xaa66('0xb5')],_[_0xaa66('0x14a')](_0x40369d['variable'])[0x0],_0x40369d[_0xaa66('0x14b')]);}}}catch(_0x1f1ce6){logger[_0xaa66('0x14c')]('[syncVarSet][Preview]',util[_0xaa66('0x14d')](_0x1f1ce6,{'showHidden':![],'depth':null}));}};Preview[_0xaa66('0x12')][_0xaa66('0x24')]=function(_0x3a9b74){if(_0x3a9b74){if(this[_0xaa66('0x76')][_0x3a9b74[_0xaa66('0x14e')]]){this[_0xaa66('0x76')][_0x3a9b74[_0xaa66('0x14e')]][_0xaa66('0x142')]=!![];}}};Preview[_0xaa66('0x12')][_0xaa66('0x26')]=function(_0x54d975){if(_0x54d975){if(this[_0xaa66('0x76')][_0x54d975[_0xaa66('0x14f')]]){this[_0xaa66('0x76')][_0x54d975['transfererlinkedid']][_0xaa66('0x142')]=!![];}}};module[_0xaa66('0x150')]=Preview;
\ No newline at end of file
+var _0x8d48=['logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','dialGlobalMaxRetry','cloneAction','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','unlockAgent','linkedid','ANSWER','responsetime','answertime','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','BUSY','countbusyretry','Busy','custom:agentbusy','busy','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','outboundAbandonedCallsDay','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','isEmpty','execCall','Queue:\x20','\x20IdHopper:\x20','idContact','called','Calling','[Preview][execCall][failure]','outboundBlacklistCallsDay','createHistory','[Blacklist][error]','SIP/%s','reachable','unlock','unlockContact','execRun','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','trim','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','getCallerId','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','channelAgent','destconnectedlinenum','user:agentconnect','calleridnum','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','isFailure','response','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','destuniqueid','variables','filterKey','keys','variable','addVariable','value','error','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','moment','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','md5','format','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','actions','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','then','length','getDiff','dialRecallMeTimeout','Agent','run'];(function(_0xa020bb,_0x204738){var _0x7829c1=function(_0x150fc3){while(--_0x150fc3){_0xa020bb['push'](_0xa020bb['shift']());}};_0x7829c1(++_0x204738);}(_0x8d48,0xc6));var _0x88d4=function(_0x311909,_0x414bf7){_0x311909=_0x311909-0x0;var _0x8d3163=_0x8d48[_0x311909];return _0x8d3163;};'use strict';var util=require(_0x88d4('0x0'));var _=require('lodash');var BPromise=require(_0x88d4('0x1'));var uuid=require('uuid');var moment=require(_0x88d4('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x88d4('0x3'));var logger=require(_0x88d4('0x4'))(_0x88d4('0x5'));var loggerAction=require(_0x88d4('0x4'))(_0x88d4('0x6'));var ami=require(_0x88d4('0x7'));var rpcDb=require(_0x88d4('0x8'));var Action=require(_0x88d4('0x9'));var ut=require(_0x88d4('0xa'));config[_0x88d4('0xb')]=_[_0x88d4('0xc')](config[_0x88d4('0xb')],{'host':_0x88d4('0xd'),'port':0x18eb});var io=require(_0x88d4('0xe'))(new Redis(config[_0x88d4('0xb')]));var Sequence=function(){};Sequence['prototype'][_0x88d4('0xf')]=function(_0x390193){this[_0x88d4('0x10')]=this[_0x88d4('0x10')]?this[_0x88d4('0x10')][_0x88d4('0x11')](_0x390193):_0x390193();};function Preview(_0xff6cf3){this[_0x88d4('0x12')]=new Sequence();this[_0x88d4('0x13')]=_0xff6cf3[_0x88d4('0x14')];this[_0x88d4('0x15')]=_0xff6cf3[_0x88d4('0x15')];this['actions']={};this[_0x88d4('0x16')]=_0xff6cf3[_0x88d4('0x16')];this[_0x88d4('0x17')]=0x0;ami['on'](_0x88d4('0x18'),this[_0x88d4('0x19')][_0x88d4('0x1a')](this));ami['on']('hangup',this[_0x88d4('0x1b')][_0x88d4('0x1a')](this));ami['on'](_0x88d4('0x1c'),this[_0x88d4('0x1d')][_0x88d4('0x1a')](this));ami['on'](_0x88d4('0x1e'),this[_0x88d4('0x1f')]['bind'](this));ami['on'](_0x88d4('0x20'),this['syncNewExten']['bind'](this));ami['on'](_0x88d4('0x21'),this[_0x88d4('0x22')]['bind'](this));ami['on'](_0x88d4('0x23'),this[_0x88d4('0x24')][_0x88d4('0x1a')](this));ami['on'](_0x88d4('0x25'),this[_0x88d4('0x26')][_0x88d4('0x1a')](this));this[_0x88d4('0x27')](this[_0x88d4('0x13')]);}function emit(_0x4526b7,_0x1d679a,_0x223e9a){io['to'](_0x4526b7)[_0x88d4('0x28')](_0x1d679a,_0x223e9a);}function emitCampaignPreview(_0xa6f36){if(_0xa6f36[_0x88d4('0x29')]===_0x88d4('0x2a')){var _0x57096a={'id':_0xa6f36['id'],'name':_0xa6f36[_0x88d4('0x2b')],'strategy':_0xa6f36[_0x88d4('0x2c')],'answered':_0xa6f36[_0x88d4('0x2d')],'available':_0xa6f36[_0x88d4('0x2e')],'loggedIn':_0xa6f36[_0x88d4('0x2f')],'pTalking':_0xa6f36[_0x88d4('0x30')],'sumBillable':_0xa6f36[_0x88d4('0x31')],'sumDuration':_0xa6f36[_0x88d4('0x32')],'sumHoldTime':_0xa6f36[_0x88d4('0x33')]||0x0,'talking':_0xa6f36[_0x88d4('0x34')],'total':_0xa6f36[_0x88d4('0x35')],'type':_0xa6f36['type'],'unmanaged':_0xa6f36['unmanaged'],'abandoned':_0xa6f36['abandoned'],'waiting':_0xa6f36['waiting'],'loggedInDb':_0xa6f36[_0x88d4('0x36')],'dialActive':_0xa6f36[_0x88d4('0x37')],'dialMethod':_0xa6f36[_0x88d4('0x38')],'dialOriginateCallerIdName':_0xa6f36['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0xa6f36[_0x88d4('0x39')],'dialOriginateTimeout':_0xa6f36['dialOriginateTimeout'],'dialPrefix':_0xa6f36['dialPrefix'],'outboundAnswerAgiCallsDay':_0xa6f36[_0x88d4('0x3a')],'outboundAnswerCallsDay':_0xa6f36[_0x88d4('0x3b')],'outboundBlacklistCallsDay':_0xa6f36['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0xa6f36[_0x88d4('0x3c')],'outboundCongestionCallsDay':_0xa6f36[_0x88d4('0x3d')],'outboundDropCallsDayACS':_0xa6f36[_0x88d4('0x3e')],'outboundDropCallsDayCallersExit':_0xa6f36['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0xa6f36['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0xa6f36[_0x88d4('0x3f')],'outboundNoSuchCallsDay':_0xa6f36[_0x88d4('0x40')],'outboundOriginateFailureCallsDay':_0xa6f36[_0x88d4('0x41')],'outboundReCallsDay':_0xa6f36[_0x88d4('0x42')],'outboundRejectCallsDay':_0xa6f36[_0x88d4('0x43')],'outboundUnknownCallsDay':_0xa6f36[_0x88d4('0x44')],'outboundAbandonedCallsDay':_0xa6f36['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0xa6f36[_0x88d4('0x45')],'predictiveIntervalAvgHoldtime':_0xa6f36['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0xa6f36[_0x88d4('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0xa6f36[_0x88d4('0x47')],'predictiveIntervalDroppedCallsTimeout':_0xa6f36[_0x88d4('0x48')],'predictiveIntervalErlangCalls':_0xa6f36[_0x88d4('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0xa6f36[_0x88d4('0x4a')],'predictiveIntervalHitRate':_0xa6f36['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0xa6f36[_0x88d4('0x4b')],'predictiveIntervalPauses':_0xa6f36[_0x88d4('0x4c')],'predictiveIntervalAvailable':_0xa6f36[_0x88d4('0x4d')],'predictiveIntervalTotalCalls':_0xa6f36['predictiveIntervalTotalCalls'],'message':_0xa6f36[_0x88d4('0x4e')],'originated':_0xa6f36['originated'],'erlangCalls':_0xa6f36[_0x88d4('0x4f')],'erlangCallToSecond':_0xa6f36[_0x88d4('0x50')],'erlangAbandonmentRate':_0xa6f36[_0x88d4('0x51')],'erlangBusyFactor':_0xa6f36[_0x88d4('0x52')],'startPredictive':_0xa6f36[_0x88d4('0x53')],'startProgressive':_0xa6f36[_0x88d4('0x54')]};if(_0xa6f36[_0x88d4('0x55')]){_0x57096a['Trunk']={'id':_0xa6f36['Trunk']['id'],'name':_0xa6f36['Trunk'][_0x88d4('0x2b')],'active':_0xa6f36['Trunk'][_0x88d4('0x56')],'callerid':_0xa6f36[_0x88d4('0x55')][_0x88d4('0x57')]};}if(_0xa6f36[_0x88d4('0x58')]){_0x57096a[_0x88d4('0x58')]={'id':_0xa6f36['Interval']['id'],'name':_0xa6f36[_0x88d4('0x58')][_0x88d4('0x2b')]};}var _0x2e370f=md5(JSON[_0x88d4('0x59')](_0x57096a));if(_0xa6f36[_0x88d4('0x5a')]!==_0x2e370f){_0xa6f36[_0x88d4('0x5a')]=_0x2e370f;emit(util[_0x88d4('0x5b')]('voice:queue:%s',_0x57096a['name']),_0x88d4('0x5c'),_0x57096a);}}}function emitVoiceQueueChannelRemove(_0x4e8948){logger[_0x88d4('0x5d')](_0x88d4('0x5e'),JSON[_0x88d4('0x59')](_0x4e8948));emit(util[_0x88d4('0x5b')](_0x88d4('0x5f'),_0x4e8948['name']),_0x88d4('0x60'),_0x4e8948);io['emit'](_0x88d4('0x61'),_0x4e8948);}function notSendMessagesQueue(_0x7f0082){if(_0x7f0082[_0x88d4('0x62')]){if(_0x7f0082[_0x88d4('0x63')]===0x0&&_0x7f0082[_0x88d4('0x30')]===0x0){_0x7f0082[_0x88d4('0x62')]=![];_0x7f0082['available']=0x0;_0x7f0082[_0x88d4('0x64')]=0x0;_0x7f0082[_0x88d4('0x4e')]=_0x88d4('0x65');ut[_0x88d4('0x66')](_0x88d4('0x67'),_0x7f0082[_0x88d4('0x2b')]+_0x88d4('0x68'));}else{_0x7f0082['message']=_0x88d4('0x69');ut[_0x88d4('0x66')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x7f0082[_0x88d4('0x2b')]+_0x88d4('0x6a'));}emitCampaignPreview(_0x7f0082);}}Preview[_0x88d4('0x6b')][_0x88d4('0x27')]=function(){var _0x14fd27=this;setInterval(function(){_0x14fd27['syncCampaigns']();},0x7cf);};Preview[_0x88d4('0x6b')][_0x88d4('0x6c')]=function(){var _0x5dca88=this[_0x88d4('0x13')];this[_0x88d4('0x17')]+=0x1;for(var _0x547c13 in _0x5dca88){if(_0x5dca88[_0x88d4('0x6d')](_0x547c13)&&(_0x5dca88[_0x547c13][_0x88d4('0x38')]===_0x88d4('0x5')||_0x5dca88[_0x547c13][_0x88d4('0x38')]==='booked')&&_0x5dca88[_0x547c13][_0x88d4('0x29')]===_0x88d4('0x2a')){if(this['clockClearZombieChannels']>0x7){this[_0x88d4('0x17')]=0x0;this[_0x88d4('0x6e')]();}}if(_0x5dca88[_0x88d4('0x6d')](_0x547c13)&&_0x5dca88[_0x547c13][_0x88d4('0x38')]===_0x88d4('0x5')&&_0x5dca88[_0x547c13][_0x88d4('0x29')]===_0x88d4('0x2a')){if(_0x5dca88[_0x547c13][_0x88d4('0x37')]){this[_0x88d4('0x6f')](_0x5dca88[_0x547c13]);this[_0x88d4('0x70')](_0x5dca88[_0x547c13]);}else{notSendMessagesQueue(_0x5dca88[_0x547c13]);}}}};Preview['prototype'][_0x88d4('0x71')]=function(_0x2e7e4d){var _0x3d6d72=this;this[_0x88d4('0x12')][_0x88d4('0xf')](function(){if(!_[_0x88d4('0x72')](_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d])){loggerAction[_0x88d4('0x5d')](_0x88d4('0x74'),_0x2e7e4d,_0x88d4('0x75'),_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x76')],_0x88d4('0x77'),JSON[_0x88d4('0x59')](_0x3d6d72[_0x88d4('0x13')][_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d]['queue']][_0x88d4('0x63')]),_0x88d4('0x78'),JSON[_0x88d4('0x59')](_0x3d6d72[_0x88d4('0x13')][_0x3d6d72['actions'][_0x2e7e4d][_0x88d4('0x76')]][_0x88d4('0x30')]),JSON[_0x88d4('0x59')](_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x79')]),JSON['stringify'](_[_0x88d4('0x7a')](_0x3d6d72['actions'][_0x2e7e4d],[_0x88d4('0x7b'),_0x88d4('0x7c'),_0x88d4('0x7d'),_0x88d4('0x7e')])));return ami[_0x88d4('0x7f')]({'action':_0x88d4('0x80'),'channel':_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x81')]})[_0x88d4('0x82')](function(_0x2c87d1){if(_0x2c87d1[_0x88d4('0x4e')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d]){ut['updateOriginated'](_0x3d6d72[_0x88d4('0x13')][_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x76')]],'[clearZombieChannel]');if(_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d]['dialAnswer']===!![]){ut[_0x88d4('0x83')](_0x3d6d72['campaignsPreview'][_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d]['queue']],_0x88d4('0x84'));ut[_0x88d4('0x85')]('[Dialer][checkChannel][pTalking][Preview]'+_0x2e7e4d,_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x76')]);}ut[_0x88d4('0x85')](_0x88d4('0x86')+_0x2e7e4d,_0x3d6d72[_0x88d4('0x73')][_0x2e7e4d][_0x88d4('0x76')]);delete _0x3d6d72['actions'][_0x2e7e4d];}},0x2328);}});}});};Preview['prototype'][_0x88d4('0x6e')]=function(){var _0x24c44f=this;loggerAction['info'](_0x88d4('0x87'),_[_0x88d4('0x88')](this[_0x88d4('0x73')]));for(var _0x9032d in this[_0x88d4('0x73')]){if(_0x24c44f['actions'][_0x88d4('0x6d')](_0x9032d)){_0x24c44f[_0x88d4('0x71')](_0x9032d);}}};Preview[_0x88d4('0x6b')][_0x88d4('0x70')]=function(_0x4b7596){var _0x57e4fc=this;rpcDb['getContactRecallMe'](_0x4b7596['id'],ut['agentReadyId'](this[_0x88d4('0x16')]))[_0x88d4('0x89')](function(_0x3f812f){if(!_[_0x88d4('0x72')](_0x3f812f)){for(var _0xa45dae=0x0;_0xa45dae<_0x3f812f[_0x88d4('0x8a')];_0xa45dae+=0x1){if(ut[_0x88d4('0x8b')](_0x3f812f[_0xa45dae]['scheduledat'])<_0x4b7596[_0x88d4('0x8c')]*0x3c){if(_0x3f812f[_0xa45dae][_0x88d4('0x8d')]&&!_0x3f812f[_0xa45dae][_0x88d4('0x8d')]['voicePause']){_0x57e4fc[_0x88d4('0x8e')](_0x3f812f[_0xa45dae]['id'])['then'](ut[_0x88d4('0x8f')](_0x88d4('0x90')))[_0x88d4('0x82')](ut[_0x88d4('0x8f')]('[RecallMe]'));}else{rpcDb[_0x88d4('0x91')](_0x3f812f[_0xa45dae]['id']);}}else{var _0x36e780=new Action(_0x3f812f[_0xa45dae],_0x4b7596);_0x36e780[_0x88d4('0x92')]=moment()[_0x88d4('0x5b')](_0x88d4('0x93'));_0x4b7596[_0x88d4('0x42')]+=0x1;ut[_0x88d4('0x94')](_0x36e780,0x17,_0x88d4('0x95'));if(_0x4b7596['dialRecallInQueue']){rpcDb[_0x88d4('0x96')](ut[_0x88d4('0x97')](_0x3f812f[_0xa45dae]));rpcDb[_0x88d4('0x98')](_0x36e780,_0x88d4('0x99'));}else{ut[_0x88d4('0x94')](_0x36e780,0x16,'RecallFailedTimeout');rpcDb[_0x88d4('0x98')](_0x36e780,_0x88d4('0x9a'));rpcDb[_0x88d4('0x9b')](_0x36e780,_0x88d4('0x9a'));}}}}})[_0x88d4('0x82')](ut[_0x88d4('0x8f')](_0x88d4('0x9c')));};Preview[_0x88d4('0x6b')][_0x88d4('0x6f')]=function(_0x3c6729){_0x3c6729[_0x88d4('0x62')]=!![];if(ut[_0x88d4('0x9d')](_0x3c6729['loggedIn'])){_0x3c6729['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0x88d4('0x9e')](_0x3c6729[_0x88d4('0x37')])){_0x3c6729[_0x88d4('0x4e')]=_0x88d4('0x65');}else if(!this[_0x88d4('0x9f')](_0x3c6729['Trunk'])){if(!this[_0x88d4('0x9f')](_0x3c6729[_0x88d4('0xa0')])){_0x3c6729[_0x88d4('0x4e')]=_0x88d4('0xa1');}else{_0x3c6729['message']='ACTIVE';}}else{_0x3c6729[_0x88d4('0x4e')]=_0x88d4('0xa2');}emitCampaignPreview(_0x3c6729);};Preview[_0x88d4('0x6b')][_0x88d4('0xa3')]=function(_0x42018b,_0x58553e,_0xaeb081){var _0x11f613=this;var _0x2a0e00=this[_0x88d4('0x73')][_0x58553e];var _0x2b3607=this[_0x88d4('0x13')][_0x2a0e00[_0x88d4('0x76')]];var _0x4f0354;if(_0x2b3607){switch(_0xaeb081){case'1':_0x2b3607[_0x88d4('0x40')]+=0x1;_0x2a0e00[_0x88d4('0xa4')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x0,_0x88d4('0xa7'));ami[_0x88d4('0x28')](_0x88d4('0xa8'),ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xaa')));rpcDb[_0x88d4('0x98')](_0x2a0e00,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0xf,'Global');rpcDb['createCustomerFinal'](_0x4f0354,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x2a0e00[_0x88d4('0xa4')]>=_0x2b3607[_0x88d4('0xad')]){rpcDb[_0x88d4('0x9b')](_0x2a0e00,_0x88d4('0xae'));}else{rpcDb['rescheduleContact'](ut[_0x88d4('0xaf')](_0x2a0e00,'countnosuchnumberretry',_0x2b3607['dialNoSuchNumberRetryFrequency']),_0x2a0e00[_0x88d4('0xb0')],_0x2a0e00['activeContact']);}}delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xb1')]];break;case _0x88d4('0xb2'):var _0x6bb40e=moment()[_0x88d4('0x5b')](_0x88d4('0x93'));_0x2a0e00[_0x88d4('0xb3')]=_0x6bb40e;_0x2a0e00[_0x88d4('0xb4')]=_0x6bb40e;_0x2a0e00[_0x88d4('0x79')]=!![];_0x2b3607[_0x88d4('0x30')]+=0x1;logger[_0x88d4('0x5d')]('[syncHangup][talking][increment]',_0x2a0e00[_0x88d4('0xb5')],_0x88d4('0xb6'),_0x2b3607[_0x88d4('0x2b')],'pTalking:\x20',_0x2b3607[_0x88d4('0x30')]);ami[_0x88d4('0x28')](_0x88d4('0xb7'),ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xb8'),this['campaignsPreview'][_0x2a0e00[_0x88d4('0x76')]]));if(_0x2b3607[_0x88d4('0xb9')]){ami[_0x88d4('0x28')](_0x88d4('0xba'),ut[_0x88d4('0xbb')](_0x2a0e00));}break;case'16':ami[_0x88d4('0x28')](_0x88d4('0xbc'),ut['buildObj'](_0x2a0e00,_0x88d4('0xbd'),this[_0x88d4('0x13')][_0x2a0e00['queue']]));emitVoiceQueueChannelRemove(ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xbd')));_0x2b3607[_0x88d4('0x3b')]+=0x1;_0x2b3607[_0x88d4('0x35')]+=0x1;_0x2b3607[_0x88d4('0x2d')]+=0x1;ut[_0x88d4('0x83')](_0x2b3607,'[16]');_0x2a0e00['countglobal']=ut['totalGlobal'](_0x2a0e00);ut['logCustomer'](_0x2a0e00,0x4,'Answer');rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xbe'));rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x88d4('0xbf')](_0x2a0e00);_0x2b3607['sumDuration']+=_0x2a0e00['talktime'];_0x2b3607[_0x88d4('0x31')]+=_0x2a0e00[_0x88d4('0xc0')];logger[_0x88d4('0x5d')]('[syncHangup][talking][decrement]',_0x2a0e00[_0x88d4('0xb5')],_0x88d4('0xb6'),_0x2b3607[_0x88d4('0x2b')],_0x88d4('0x78'),_0x2b3607[_0x88d4('0x30')]);delete this['actions'][_0x42018b[_0x88d4('0xb1')]];break;case _0x88d4('0xc1'):_0x2b3607[_0x88d4('0x3c')]+=0x1;_0x2a0e00[_0x88d4('0xc2')]+=0x1;_0x2a0e00['countglobal']=ut['totalGlobal'](_0x2a0e00);ut['logCustomer'](_0x2a0e00,0x5,_0x88d4('0xc3'));ami[_0x88d4('0x28')](_0x88d4('0xc4'),ut['buildObj'](_0x2a0e00,_0x88d4('0xc5')));rpcDb[_0x88d4('0x98')](_0x2a0e00,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xc7'));}else{if(_0x2a0e00[_0x88d4('0xc2')]>=_0x2b3607[_0x88d4('0xc8')]){rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x88d4('0xc9')](ut[_0x88d4('0xaf')](_0x2a0e00,_0x88d4('0xc2'),_0x2b3607[_0x88d4('0xca')]),_0x2a0e00['unlockAgent'],_0x2a0e00[_0x88d4('0xcb')]);}}break;case _0x88d4('0xcc'):_0x2b3607[_0x88d4('0x3f')]+=0x1;_0x2a0e00[_0x88d4('0xcd')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut['totalGlobal'](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x3,_0x88d4('0xce'));ami[_0x88d4('0x28')](_0x88d4('0xcf'),ut[_0x88d4('0xa9')](_0x2a0e00,'noanswer'));rpcDb[_0x88d4('0x98')](_0x2a0e00,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut['cloneAction'](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xd0'));}else{if(_0x2a0e00['countnoanswerretry']>=_0x2b3607['dialNoAnswerMaxRetry']){rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x88d4('0xc9')](ut['scheduledAt'](_0x2a0e00,_0x88d4('0xcd'),_0x2b3607[_0x88d4('0xd1')]),_0x2a0e00['unlockAgent'],_0x2a0e00['activeContact']);}}break;case _0x88d4('0xd2'):_0x2b3607[_0x88d4('0x3d')]+=0x1;_0x2a0e00[_0x88d4('0xd3')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x8,_0x88d4('0xd4'));ami[_0x88d4('0x28')]('custom:agentcongestion',ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xd5')));rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xd6'));if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xd7'));}else{if(_0x2a0e00['countcongestionretry']>=_0x2b3607[_0x88d4('0xd8')]){rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb['rescheduleContact'](ut[_0x88d4('0xaf')](_0x2a0e00,_0x88d4('0xd3'),_0x2b3607[_0x88d4('0xca')]),_0x2a0e00[_0x88d4('0xb0')],_0x2a0e00[_0x88d4('0xcb')]);}}break;case _0x88d4('0xd9'):_0x2b3607[_0x88d4('0x43')]+=0x1;_0x2a0e00[_0x88d4('0xda')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x14,'AgentReject');ami[_0x88d4('0x28')]('custom:agentreject',ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xdb')));rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xdc'));if(ut['totalGlobal'](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0x14,_0x88d4('0xdd'));rpcDb['createCustomerFinal'](_0x4f0354,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x2a0e00[_0x88d4('0xda')]>=_0x2b3607[_0x88d4('0xde')]){rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x88d4('0xc9')](ut[_0x88d4('0xaf')](_0x2a0e00,_0x88d4('0xda'),_0x2b3607[_0x88d4('0xdf')]),_0x2a0e00[_0x88d4('0xb0')],_0x2a0e00['activeContact']);}}break;case _0x88d4('0xe0'):_0x2b3607[_0x88d4('0xe1')]+=0x1;_0x2a0e00[_0x88d4('0xe2')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut['logCustomer'](_0x2a0e00,0xb,_0x88d4('0xe3'));rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xe4'));if(ut['totalGlobal'](_0x2a0e00)>=_0x2b3607['dialGlobalMaxRetry']){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xe4'));}else{if(_0x2a0e00[_0x88d4('0xe5')]>=_0x2b3607[_0x88d4('0xe6')]){rpcDb[_0x88d4('0x9b')](_0x2a0e00,_0x88d4('0xe4'));}else{rpcDb[_0x88d4('0xc9')](ut[_0x88d4('0xaf')](_0x2a0e00,_0x88d4('0xe2'),_0x2b3607[_0x88d4('0xe7')]),_0x2a0e00[_0x88d4('0xb0')],_0x2a0e00[_0x88d4('0xcb')]);}}break;case'18':_0x2b3607[_0x88d4('0x44')]+=0x1;_0x2a0e00[_0x88d4('0xe8')]+=0x1;_0x2a0e00['countglobal']=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x12,_0x42018b[_0x88d4('0xe9')]||_0x42018b[_0x88d4('0xea')]);ami['emit'](_0x88d4('0xeb'),ut[_0x88d4('0xa9')](_0x2a0e00,_0x88d4('0xec')));rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xed'));if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607['dialGlobalMaxRetry']){_0x4f0354=ut['cloneAction'](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xed'));}else{rpcDb[_0x88d4('0x9b')](_0x2a0e00,_0x88d4('0xed'));}delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xb1')]];break;case'19':_0x2b3607[_0x88d4('0x44')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0x13,_0x42018b[_0x88d4('0xe9')]||_0x42018b['dialstatus']);ami[_0x88d4('0x28')](_0x88d4('0xeb'),ut['buildObj'](_0x2a0e00,'amd'));rpcDb['createCustomerHistory'](_0x2a0e00,_0x88d4('0xee'));if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut['cloneAction'](_0x2a0e00,0xf,_0x88d4('0xc6'));rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xee'));}else{rpcDb[_0x88d4('0x9b')](_0x2a0e00,'[callProgressDetectingCustomer][machine]');}delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xb1')]];break;default:if(_0x2a0e00[_0x88d4('0x79')]){ut['decrementTalkink'](_0x2b3607,_0x88d4('0xef'));ut[_0x88d4('0x85')](_0x88d4('0xf0')+_0x2b3607[_0x88d4('0x2b')],_0x42018b);}_0x2b3607[_0x88d4('0x44')]+=0x1;_0x2a0e00[_0x88d4('0xa5')]=ut[_0x88d4('0xa6')](_0x2a0e00);ut[_0x88d4('0x94')](_0x2a0e00,0xc,_0x42018b[_0x88d4('0xe9')]||_0x42018b[_0x88d4('0xea')]);rpcDb[_0x88d4('0x98')](_0x2a0e00,_0x88d4('0xf1'));if(ut[_0x88d4('0xa6')](_0x2a0e00)>=_0x2b3607[_0x88d4('0xab')]){_0x4f0354=ut[_0x88d4('0xac')](_0x2a0e00,0xf,'Global');rpcDb[_0x88d4('0x9b')](_0x4f0354,_0x88d4('0xf2'));}else{rpcDb['createCustomerFinal'](_0x2a0e00,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xb1')]];}if(!(_0x2a0e00[_0x88d4('0x79')]&&_0xaeb081==='16')){ut[_0x88d4('0xf3')](_0x2b3607,_0x88d4('0xf4'));logger[_0x88d4('0x5d')](_0x88d4('0xf5'),_0x2a0e00[_0x88d4('0xb5')],_0x88d4('0xb6'),_0x2b3607['name'],_0x88d4('0x77'),_0x2b3607[_0x88d4('0x63')]);}if(_0xaeb081!==_0x88d4('0xb2')){delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xb1')]];delete this[_0x88d4('0x73')][_0x42018b[_0x88d4('0xf6')]];}}};Preview[_0x88d4('0x6b')][_0x88d4('0xf7')]=function(_0x35d408,_0xc00d78,_0x521a3c){if(_[_0x88d4('0xf8')](_0xc00d78)&&_0x88d4('0xf9')!==typeof _0xc00d78){return;}if(_[_0x88d4('0xf8')](_0x521a3c)&&_0x88d4('0xf9')!==typeof _0x521a3c){return;}switch(_0x521a3c[_0x88d4('0xfa')]){case'0':ut['logAgent'](_0x35d408,0x0,_0x88d4('0xa7'));rpcDb[_0x88d4('0xfb')](_0x35d408,_0x88d4('0xfc'));break;case'3':ut['logAgent'](_0x35d408,0x3,'NoAnswer');rpcDb['createAgentHistory'](_0x35d408,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x88d4('0xfd')](_0x35d408,0x5,'Busy');rpcDb['createAgentHistory'](_0x35d408,_0x88d4('0xfe'));break;case'8':ut['logAgent'](_0x35d408,0x8,_0x88d4('0xd4'));rpcDb['createAgentHistory'](_0x35d408,_0x88d4('0xff'));break;case'22':ut['logAgent'](_0x35d408,0x16,'AnswerAGI');rpcDb[_0x88d4('0xfb')](_0x35d408,_0x88d4('0x100'));break;default:ut[_0x88d4('0xfd')](_0x35d408,0xc,_0x521a3c[_0x88d4('0xfa')]);rpcDb[_0x88d4('0xfb')](_0x35d408,'[callProgressDetectingAgent][logCongestion]');}ut[_0x88d4('0xf3')](_0xc00d78,_0x88d4('0x101'));logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x35d408[_0x88d4('0xb5')],'\x20Queue',_0xc00d78['name'],_0x88d4('0x77'),_0xc00d78[_0x88d4('0x63')]);delete this[_0x88d4('0x73')][_0x35d408[_0x88d4('0xb5')]];};Preview['prototype'][_0x88d4('0x102')]=function(_0x35edd3,_0x4335da,_0x40363b,_0x15d101,_0x526735){var _0x274eba=this;return new BPromise(function(_0x45368c,_0x47c45e){if(_[_0x88d4('0x72')](_0x4335da)||_['isNil'](_0x4335da['Contact'])||_[_0x88d4('0x72')](_0x4335da[_0x88d4('0x103')][_0x88d4('0x104')])||_[_0x88d4('0x72')](_0x4335da[_0x88d4('0x7d')])){_0x47c45e(ut['message']('Contact\x20is\x20undefined',_0x15d101,_0x526735));return;}var _0x21991d=uuid['v4']();var _0x393bfc=_0x274eba[_0x88d4('0x13')][_0x4335da[_0x88d4('0x75')][_0x88d4('0x2b')]];var _0x202a68=_0x40363b?_0x274eba[_0x88d4('0x16')][_0x40363b]['id']:undefined;_0x274eba[_0x88d4('0x73')][_0x21991d]=new Action(_0x4335da,_0x393bfc,_0x21991d,_0x40363b,_0x202a68);var _0x295d4e=_0x274eba['actions'][_0x21991d];_0x295d4e['unlockAgent']=_0x15d101;_0x295d4e[_0x88d4('0xcb')]=_0x526735;_0x295d4e[_0x88d4('0x105')]=_0x40363b;if(_[_0x88d4('0x106')](_0x35edd3)){_0x274eba[_0x88d4('0x107')](_0x295d4e,_0x393bfc,_0x4335da,_0x40363b)[_0x88d4('0x89')](function(_0xf3feef){logger[_0x88d4('0x5d')]('[Preview][execCall][success]',_0x88d4('0x108')+_0x295d4e[_0x88d4('0x76')]+_0x88d4('0x109')+_0x295d4e[_0x88d4('0x10a')],JSON['stringify'](_0xf3feef));ami['emit']('custom:agentcalled',ut[_0x88d4('0xa9')](_0x295d4e,_0x88d4('0x10b'),_0x274eba['campaignsPreview'][_0x295d4e[_0x88d4('0x76')]]));_0x45368c(ut[_0x88d4('0x4e')](_0x88d4('0x10c')));})['catch'](function(_0x4beb9b){ut[_0x88d4('0x66')](_0x88d4('0x10d'),_0x4beb9b);_0x47c45e(ut[_0x88d4('0x4e')]('Call\x20failed',_0x15d101,_0x526735));});}else{_0x393bfc[_0x88d4('0x10e')]+=0x1;ut['logBlacklist'](_0x295d4e);rpcDb[_0x88d4('0x10f')](_0x295d4e,_0x88d4('0x110'));delete _0x274eba[_0x88d4('0x73')][_0x21991d];_0x47c45e(ut[_0x88d4('0x4e')]('Contact\x20in\x20black\x20List',_0x15d101,_0x526735));}});};Preview[_0x88d4('0x6b')][_0x88d4('0x9f')]=function(_0x371710){return!_[_0x88d4('0x72')](_0x371710)&&!_[_0x88d4('0x72')](_0x371710[_0x88d4('0x2b')])&&!_[_0x88d4('0x72')](_0x371710[_0x88d4('0x56')])&&_0x371710['active']&&!_[_0x88d4('0x72')](this[_0x88d4('0x15')][util[_0x88d4('0x5b')](_0x88d4('0x111'),_0x371710[_0x88d4('0x2b')])])&&!_[_0x88d4('0x72')](this['trunks'][util[_0x88d4('0x5b')]('SIP/%s',_0x371710[_0x88d4('0x2b')])][_0x88d4('0x80')])&&(this[_0x88d4('0x15')][util[_0x88d4('0x5b')](_0x88d4('0x111'),_0x371710[_0x88d4('0x2b')])]['status']===_0x88d4('0x112')||this[_0x88d4('0x15')][util['format'](_0x88d4('0x111'),_0x371710['name'])]['status']==='unmonitored');};Preview[_0x88d4('0x6b')]['run']=function(_0x2bbfbe,_0x20ffda){var _0x5b1798=this;return new BPromise(function(_0x2b2a8c,_0x17f3b2){_0x5b1798['execRun'](_0x2bbfbe,_0x20ffda)[_0x88d4('0x89')](function(_0x22f1ab){_0x2b2a8c(_[_0x88d4('0x7a')](_0x22f1ab,[_0x88d4('0x4e')]));})[_0x88d4('0x82')](function(_0x59cef7){if(_0x59cef7[_0x88d4('0x113')]){rpcDb[_0x88d4('0x114')](_0x2bbfbe);}if(_0x59cef7[_0x88d4('0x56')]){rpcDb[_0x88d4('0x91')](_0x2bbfbe);}_0x17f3b2(_[_0x88d4('0x7a')](_0x59cef7,[_0x88d4('0x4e')]));});});};Preview[_0x88d4('0x6b')][_0x88d4('0x115')]=function(_0x5edbbb,_0x3ab0ed){var _0x18ce0b=this;return new BPromise(function(_0xb7d754,_0x2023a4){var _0x15c1a4,_0x5efb73;rpcDb[_0x88d4('0x116')](_0x5edbbb)[_0x88d4('0x89')](function(_0x4d8bdc){if(!_['isNil'](_0x4d8bdc[0x0])){_0x5efb73=_0x4d8bdc[0x0][_0x88d4('0x117')]?![]:!![];_0x15c1a4=_0x4d8bdc[0x0][_0x88d4('0x117')]?!![]:![];_0x15c1a4=_0x3ab0ed?!![]:_0x15c1a4;}var _0x501e53=_0x18ce0b[_0x88d4('0x118')](_0x4d8bdc);if(_0x501e53[_0x88d4('0x119')]){rpcDb['checkIsBlackList'](_[_0x88d4('0x7a')](_0x4d8bdc[0x0],[_0x88d4('0x7d'),_0x88d4('0x11a')]))['then'](function(_0x29b706){_0x18ce0b[_0x88d4('0x102')](_0x29b706,_0x4d8bdc[0x0],_0x3ab0ed,_0x5efb73,_0x15c1a4)['then'](function(_0x48ac4a){_0xb7d754(_0x48ac4a);})['catch'](function(_0x190ce0){_0x2023a4(_0x190ce0);});})[_0x88d4('0x82')](function(_0x232071){ut[_0x88d4('0x66')](_0x88d4('0x11b'),_0x232071);_0x2023a4(ut[_0x88d4('0x4e')](_0x88d4('0x11c'),_0x5efb73,_0x15c1a4));});}else{_0x2023a4(ut[_0x88d4('0x4e')](_0x501e53['message'],_0x5efb73,_0x15c1a4));}})[_0x88d4('0x82')](function(_0x2fe9ce){ut[_0x88d4('0x66')]('[Preview][getContactPreview]',_0x2fe9ce);_0x2023a4(ut['message'](_0x88d4('0x11c'),![],!![]));});});};Preview['prototype'][_0x88d4('0x118')]=function(_0x2a78bc){if(_[_0x88d4('0x72')](_0x2a78bc)||_[_0x88d4('0x106')](_0x2a78bc)||!_[_0x88d4('0x72')](_0x2a78bc[0x0][_0x88d4('0x8d')])&&_[_0x88d4('0x72')](_0x2a78bc[0x0]['Agent']['name'])){ut[_0x88d4('0x66')](_0x88d4('0x11d'),_0x2a78bc);return{'isValid':![],'message':_0x88d4('0x11e')};}var _0x18ad46=this[_0x88d4('0x13')][_0x2a78bc[0x0]['Queue']['name']];_0x18ad46['message']=_0x88d4('0xa2');if(_[_0x88d4('0x72')](_0x18ad46)){ut[_0x88d4('0x66')](_0x88d4('0x11f'),_0x18ad46);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x88d4('0x9f')](_0x18ad46[_0x88d4('0x55')])){ut[_0x88d4('0x66')](_0x88d4('0x120'),_0x88d4('0x121')+_0x18ad46['name']+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x88d4('0x9f')](_0x18ad46['TrunkBackup'])){ut[_0x88d4('0x66')](_0x88d4('0x120'),_0x18ad46[_0x88d4('0x2b')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x88d4('0x122')};}}if(!ut[_0x88d4('0x9e')](_0x18ad46[_0x88d4('0x37')])){ut[_0x88d4('0x66')](_0x88d4('0x123'),_0x18ad46[_0x88d4('0x2b')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x88d4('0x121')+_0x18ad46['name']+_0x88d4('0x124')};}return{'isValid':!![],'message':_0x88d4('0x125')};};Preview[_0x88d4('0x6b')][_0x88d4('0x107')]=function(_0x2082a7,_0x1ecc98,_0x113136,_0x21c89c){var _0x3f7042=this;return new BPromise(function(_0x524d79,_0x24dcf2){var _0x429e23=_0x2082a7[_0x88d4('0xb5')];var _0x5f1c5d=_0x3f7042['isTrunkReachable'](_0x1ecc98[_0x88d4('0x55')])?util[_0x88d4('0x5b')](_0x88d4('0x126'),_0x1ecc98[_0x88d4('0x55')][_0x88d4('0x2b')],_['isNil'](_0x1ecc98[_0x88d4('0x127')])?'':_0x1ecc98['dialPrefix']['trim']()||'',_0x1ecc98[_0x88d4('0x128')]>0x0?_0x113136['Contact']['phone'][_0x88d4('0x129')](_0x1ecc98[_0x88d4('0x128')]):_0x113136[_0x88d4('0x103')][_0x88d4('0x104')]):util['format'](_0x88d4('0x126'),_[_0x88d4('0x72')](_0x1ecc98[_0x88d4('0xa0')])?_0x1ecc98[_0x88d4('0x55')][_0x88d4('0x2b')]:_0x1ecc98[_0x88d4('0xa0')][_0x88d4('0x2b')],_[_0x88d4('0x72')](_0x1ecc98[_0x88d4('0x127')])?'':_0x1ecc98['dialPrefix'][_0x88d4('0x12a')]()||'',_0x1ecc98['dialCutDigit']>0x0?_0x113136[_0x88d4('0x103')][_0x88d4('0x104')][_0x88d4('0x129')](_0x1ecc98[_0x88d4('0x128')]):_0x113136[_0x88d4('0x103')][_0x88d4('0x104')]);var _0x2a7002=_0x3f7042[_0x88d4('0x9f')](_0x1ecc98[_0x88d4('0x55')])?ut['getCallerId'](_0x1ecc98[_0x88d4('0x55')][_0x88d4('0x57')],_0x1ecc98['dialOriginateCallerIdName'],_0x1ecc98[_0x88d4('0x12b')]>0x0?ut[_0x88d4('0x12c')](_0x1ecc98['dialOriginateCallerIdNumber'],_0x1ecc98['dialRandomLastDigitCallerIdNumber']):_0x1ecc98[_0x88d4('0x39')]):ut[_0x88d4('0x12d')](_[_0x88d4('0x72')](_0x1ecc98[_0x88d4('0xa0')])?_0x1ecc98[_0x88d4('0x55')][_0x88d4('0x57')]:_0x1ecc98[_0x88d4('0xa0')][_0x88d4('0x57')],_0x1ecc98[_0x88d4('0x12e')],_0x1ecc98['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x1ecc98[_0x88d4('0x39')],_0x1ecc98[_0x88d4('0x12b')]):_0x1ecc98[_0x88d4('0x39')]);if(_0x2a7002){_0x2082a7[_0x88d4('0x12f')]=ut[_0x88d4('0x130')](_0x2a7002);_0x2082a7[_0x88d4('0x131')]=ut[_0x88d4('0x132')](_0x2a7002);}var _0x3d7561=ut['addVariables'](_0x1ecc98,_0x113136,_0x5f1c5d,_0x2a7002,_0x429e23,_0x2082a7);_[_0x88d4('0x133')](_0x2082a7,ut[_0x88d4('0x134')](_0x3d7561));_0x2082a7[_0x88d4('0x92')]=moment()[_0x88d4('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x88d4('0x7f')](ut['variablesAction'](_0x2082a7,_0x1ecc98,_0x3d7561,_0x2082a7[_0x88d4('0xcb')],_0x21c89c))[_0x88d4('0x89')](function(_0x469633){var _0x5157f0=_0x2082a7[_0x88d4('0x135')];if(!_[_0x88d4('0x72')](_0x5157f0)){if(!_['isNil'](_0x3f7042[_0x88d4('0x16')][_0x5157f0])){_0x3f7042[_0x88d4('0x16')][_0x5157f0][_0x88d4('0x136')]=_0x2082a7['calleridnum'];emit(util[_0x88d4('0x5b')]('user:%s',_0x3f7042[_0x88d4('0x16')][_0x5157f0][_0x88d4('0x2b')]),_0x88d4('0x137'),{'destaccountcode':_0x3f7042[_0x88d4('0x16')][_0x5157f0]['accountcode'],'destconnectedlinenum':_0x2082a7[_0x88d4('0x138')]});}}_0x1ecc98[_0x88d4('0x63')]+=0x1;logger['info'](_0x88d4('0x139'),_0x429e23,'\x20Queue',_0x1ecc98[_0x88d4('0x2b')],_0x88d4('0x77'),_0x1ecc98['originated']);_0x524d79(_0x469633);})[_0x88d4('0x82')](function(_0x2d0f76){ut[_0x88d4('0xfd')](_0x2082a7,0xe,_0x88d4('0x13a'));rpcDb['createAgentHistory'](_0x2082a7,_0x88d4('0x13b'));_0x24dcf2(_0x2d0f76);});});};Preview[_0x88d4('0x6b')]['syncNewExten']=function(_0x179afe){if(this['actions'][_0x179afe[_0x88d4('0xb1')]]){this[_0x88d4('0x73')][_0x179afe[_0x88d4('0xb1')]][_0x88d4('0x81')]=_0x179afe['channel'];}};Preview[_0x88d4('0x6b')]['syncOriginateResponse']=function(_0x48cbc4){var _0x160ace=this;var _0x30abb3=this[_0x88d4('0x73')][_0x48cbc4[_0x88d4('0x13c')]];if(_0x30abb3){if(_0x30abb3[_0x88d4('0x105')]&&this[_0x88d4('0x16')][_0x30abb3[_0x88d4('0x105')]]){ut[_0x88d4('0x13d')](_0x30abb3,this['agents'][_0x30abb3[_0x88d4('0x105')]][_0x88d4('0x2b')],this[_0x88d4('0x16')][_0x30abb3[_0x88d4('0x105')]]['id']);}var _0x56b3c5=_['clone'](_0x30abb3);_0x56b3c5['responsetime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x5d2fdb=_0x160ace[_0x88d4('0x13')][_0x30abb3[_0x88d4('0x76')]];if(ut[_0x88d4('0x13e')](_0x48cbc4[_0x88d4('0x13f')])){if(_0x30abb3[_0x88d4('0xb0')]){rpcDb[_0x88d4('0x114')](_0x30abb3[_0x88d4('0x10a')]);}if(_0x30abb3[_0x88d4('0xcb')]){rpcDb['disableContact'](_0x30abb3['idContact']);}ami['emit']('custom:agentringnoanswer',ut[_0x88d4('0xa9')](_0x30abb3,'rejected',this['campaignsPreview'][_0x30abb3[_0x88d4('0x76')]]));this[_0x88d4('0xf7')](_0x56b3c5,_0x5d2fdb,_0x48cbc4);}else{_0x30abb3[_0x88d4('0x92')]=moment()[_0x88d4('0x5b')](_0x88d4('0x93'));ut[_0x88d4('0xfd')](_0x56b3c5,0x4,_0x88d4('0x140'));rpcDb[_0x88d4('0xfb')](_0x56b3c5,_0x88d4('0x141'));}}};Preview['prototype']['syncHangup']=function(_0xbea116){var _0x3d2402=this;var _0x3fa752=this[_0x88d4('0x73')][_0xbea116[_0x88d4('0xb1')]];var _0x5e7a37;if(_0x3fa752){_0x5e7a37=this['campaignsPreview'][_0x3fa752[_0x88d4('0x76')]];logger[_0x88d4('0x5d')](_0x88d4('0x142'),_0xbea116[_0x88d4('0xb1')],_0x88d4('0xb6'),_0x5e7a37[_0x88d4('0x2b')],_0x88d4('0x78'),_0x5e7a37[_0x88d4('0x30')]);}if(this[_0x88d4('0x73')][_0xbea116['linkedid']]&&_0xbea116['linkedid']!==_0xbea116['uniqueid']){if(_0xbea116[_0x88d4('0x143')]==='16'&&this['actions'][_0xbea116['linkedid']]['dialAnswer']){this['callProgressDetectingCustomer'](_0xbea116,_0xbea116[_0x88d4('0xb1')],_0xbea116['cause']);}else if(this[_0x88d4('0x73')][_0xbea116[_0x88d4('0xb1')]]['dialAnswer']){logger[_0x88d4('0x5d')](_0x88d4('0x144'),_0xbea116[_0x88d4('0xb1')],_0xbea116['cause'],_0x88d4('0xb6'),_0x5e7a37['name'],'pTalking:\x20',_0x5e7a37['pTalking']);this[_0x88d4('0xa3')](_0xbea116,_0xbea116[_0x88d4('0xb1')],_0xbea116[_0x88d4('0x143')]);}}else if(_0x3fa752&&_[_0x88d4('0x72')](_0x3fa752['statedesc'])&&_0x5e7a37[_0x88d4('0x145')]&&_0xbea116[_0x88d4('0xb1')]===_0xbea116[_0x88d4('0xb5')]&&_['isNil'](_0xbea116[_0x88d4('0xfa')])&&_0xbea116['cause']==='16'&&_0xbea116[_0x88d4('0x146')]==='6'&&_[_0x88d4('0xf8')](_0x3fa752[_0x88d4('0x147')])){if(_0x3fa752[_0x88d4('0xb0')]){rpcDb['unlockContact'](_0x3fa752[_0x88d4('0x10a')]);}if(_0x3fa752['activeContact']){rpcDb['disableContact'](_0x3fa752['idContact']);}_0xbea116[_0x88d4('0xfa')]='22';this[_0x88d4('0xf7')](_0x3fa752,_0x5e7a37,_0xbea116);}else if(_0x3fa752&&_0x3fa752[_0x88d4('0x147')]){if(_0xbea116['cause']==='16'&&this['actions'][_0xbea116[_0x88d4('0xb1')]]['dialAnswer']){logger[_0x88d4('0x5d')](_0x88d4('0x148'),_0xbea116[_0x88d4('0xb1')],_0xbea116[_0x88d4('0x143')],_0x88d4('0xb6'),_0x5e7a37['name'],_0x88d4('0x78'),_0x5e7a37[_0x88d4('0x30')]);this[_0x88d4('0xa3')](_0xbea116,_0xbea116[_0x88d4('0xb1')],_0xbea116[_0x88d4('0x143')]);}else if(this[_0x88d4('0x73')][_0xbea116[_0x88d4('0xb1')]][_0x88d4('0x79')]){logger[_0x88d4('0x5d')](_0x88d4('0x144'),_0xbea116[_0x88d4('0xb1')],_0xbea116[_0x88d4('0x143')],'\x20Queue',_0x5e7a37[_0x88d4('0x2b')],_0x88d4('0x78'),_0x5e7a37[_0x88d4('0x30')]);this[_0x88d4('0xa3')](_0xbea116,_0xbea116['linkedid'],_0xbea116[_0x88d4('0x143')]);}}};Preview[_0x88d4('0x6b')][_0x88d4('0x1f')]=function(_0xbeab44){if(this[_0x88d4('0x73')][_0xbeab44[_0x88d4('0xf6')]]&&_0xbeab44[_0x88d4('0xf6')]!==_0xbeab44[_0x88d4('0x149')]){this['callProgressDetectingCustomer'](_0xbeab44,_0xbeab44['destlinkedid'],_0xbeab44[_0x88d4('0xea')]);}};Preview[_0x88d4('0x6b')][_0x88d4('0x1d')]=function(_0x4247a6){if(this[_0x88d4('0x73')][_0x4247a6[_0x88d4('0xb1')]]&&_0x4247a6[_0x88d4('0xb1')]!==_0x4247a6[_0x88d4('0xb5')]&&!this[_0x88d4('0x73')][_0x4247a6[_0x88d4('0xb1')]]['dialAnswer']){if(_0x4247a6[_0x88d4('0x143')]==='1'){this[_0x88d4('0xa3')](_0x4247a6,_0x4247a6['linkedid'],_0x4247a6[_0x88d4('0x143')]);}}};Preview[_0x88d4('0x6b')]['addVariable']=function(_0x356fee,_0x1b4f2e,_0x4f6225){if(this[_0x88d4('0x73')][_0x356fee]){if(_[_0x88d4('0x72')](this[_0x88d4('0x73')][_0x356fee][_0x88d4('0x14a')])){this[_0x88d4('0x73')][_0x356fee][_0x88d4('0x14a')]={};}this[_0x88d4('0x73')][_0x356fee][_0x88d4('0x14a')][_0x1b4f2e]=_0x4f6225;}};Preview['prototype'][_0x88d4('0x22')]=function(_0x59064a){try{if(!_[_0x88d4('0x72')](_0x59064a)){if(ut[_0x88d4('0x14b')](_[_0x88d4('0x14c')](_0x59064a[_0x88d4('0x14d')])[0x0])){this[_0x88d4('0x14e')](_0x59064a[_0x88d4('0xb5')],_['keys'](_0x59064a[_0x88d4('0x14d')])[0x0],_0x59064a[_0x88d4('0x14f')]);}}}catch(_0x3928de){logger[_0x88d4('0x150')](_0x88d4('0x151'),util['inspect'](_0x3928de,{'showHidden':![],'depth':null}));}};Preview[_0x88d4('0x6b')][_0x88d4('0x24')]=function(_0x402e86){if(_0x402e86){if(this[_0x88d4('0x73')][_0x402e86['transfertargetlinkedid']]){this[_0x88d4('0x73')][_0x402e86[_0x88d4('0x152')]][_0x88d4('0x147')]=!![];}}};Preview['prototype'][_0x88d4('0x26')]=function(_0x17a672){if(_0x17a672){if(this[_0x88d4('0x73')][_0x17a672[_0x88d4('0x153')]]){this[_0x88d4('0x73')][_0x17a672[_0x88d4('0x153')]][_0x88d4('0x147')]=!![];}}};module[_0x88d4('0x154')]=Preview;
\ No newline at end of file
index d3329e9..625c26b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3f2=['../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','catch','[createHistory]\x20','then','createHistory','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','rescheduleContact','active','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal'];(function(_0x1770ac,_0x105b88){var _0x47c21b=function(_0x10bd23){while(--_0x10bd23){_0x1770ac['push'](_0x1770ac['shift']());}};_0x47c21b(++_0x105b88);}(_0xa3f2,0x95));var _0x2a3f=function(_0x4cf088,_0x8590f9){_0x4cf088=_0x4cf088-0x0;var _0x3c7552=_0xa3f2[_0x4cf088];return _0x3c7552;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x2a3f('0x0'))('preview');var _=require(_0x2a3f('0x1'));var cmHopper=require(_0x2a3f('0x2'));var cmHopperFinal=require(_0x2a3f('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x2a3f('0x4'));var agentReportPreview=require(_0x2a3f('0x5'));var voiceQueueReport=require(_0x2a3f('0x6'));function loggerCatch(_0x5af569){return function(_0x5e1c25){logger[_0x2a3f('0x7')](_0x5af569,util[_0x2a3f('0x8')](_0x5e1c25,{'showHidden':![],'depth':null}));};}function create(_0x385d78){return BPromise[_0x2a3f('0x9')]()['then'](cmHopperHistory['createHistory'](_0x385d78))[_0x2a3f('0xa')](loggerCatch(_0x2a3f('0xb')));}function createAgent(_0x126d72){return BPromise['resolve']()[_0x2a3f('0xc')](agentReportPreview[_0x2a3f('0xd')](_0x126d72))[_0x2a3f('0xa')](loggerCatch(_0x2a3f('0xb')));}function moveContact(_0x4944b5){return BPromise[_0x2a3f('0x9')]()[_0x2a3f('0xc')](cmHopper['moveContactManagedDialer'](_0x4944b5,!![]))[_0x2a3f('0xa')](loggerCatch(_0x2a3f('0xe')));}exports['checkIsBlackList']=function(_0x1ab5a2){return BPromise[_0x2a3f('0x9')]()[_0x2a3f('0xc')](cmHopperBlack[_0x2a3f('0xf')](_0x1ab5a2))[_0x2a3f('0xa')](loggerCatch(_0x2a3f('0x10')));};exports[_0x2a3f('0x11')]=function(_0x32519a){return BPromise[_0x2a3f('0x9')]()['then'](cmHopper[_0x2a3f('0x11')](_0x32519a))[_0x2a3f('0xa')](loggerCatch(_0x2a3f('0x12')));};exports[_0x2a3f('0xd')]=function(_0x416df9,_0x129bf1){create(_0x416df9)['catch'](loggerCatch(_0x129bf1));moveContact(_0x416df9)[_0x2a3f('0xa')](loggerCatch(_0x129bf1));};exports['createAgentHistory']=function(_0x1e53f0,_0x48f268){createAgent(_0x1e53f0)[_0x2a3f('0xa')](loggerCatch(_0x48f268));};exports[_0x2a3f('0x13')]=function(_0xf913b4,_0x530acb){create(_0xf913b4)[_0x2a3f('0xa')](loggerCatch(_0x530acb));};exports['createCustomerFinal']=function(_0x2600e5,_0x4dbc55){moveContact(_0x2600e5)[_0x2a3f('0xa')](loggerCatch(_0x4dbc55));};exports[_0x2a3f('0x14')]=function(_0x22c9c5,_0xb06895,_0x5bc651){if(_0xb06895){_0x22c9c5['UserId']=null;}if(_0x5bc651){_0x22c9c5[_0x2a3f('0x15')]=![];}return BPromise[_0x2a3f('0x9')]()[_0x2a3f('0xc')](cmHopper[_0x2a3f('0x14')](_0x22c9c5))[_0x2a3f('0xa')](loggerCatch(_0x2a3f('0x16')));};exports[_0x2a3f('0x17')]=function(_0x203911){return BPromise[_0x2a3f('0x9')]()[_0x2a3f('0xc')](cmHopper[_0x2a3f('0x17')](_0x203911))['catch'](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x399a00){return BPromise[_0x2a3f('0x9')]()[_0x2a3f('0xc')](cmHopper[_0x2a3f('0x18')]({'UserId':null},_0x399a00,0x1))['catch'](loggerCatch(_0x2a3f('0x19')));};exports[_0x2a3f('0x1a')]=function(_0x12c6a8){return BPromise[_0x2a3f('0x9')]()[_0x2a3f('0xc')](cmHopper[_0x2a3f('0x18')]({'active':![]},_0x12c6a8,0x1))[_0x2a3f('0xa')](loggerCatch(_0x2a3f('0x1b')));};exports[_0x2a3f('0x1c')]=function(_0x48651c){var _0x3e189b={};_0x3e189b[_0x2a3f('0x1d')]=_0x48651c['type'];_0x3e189b[_0x2a3f('0x1e')]=_0x48651c[_0x2a3f('0x1e')];_0x3e189b[_0x2a3f('0x1f')]=_0x48651c[_0x2a3f('0x1f')];_0x3e189b[_0x2a3f('0x20')]=_0x48651c[_0x2a3f('0x20')];_0x3e189b[_0x2a3f('0x21')]=_0x48651c['queue'];_0x3e189b[_0x2a3f('0x22')]=_0x48651c[_0x2a3f('0x23')];_0x3e189b[_0x2a3f('0x24')]=_0x48651c['answertime'];_0x3e189b[_0x2a3f('0x25')]=0x1;_0x3e189b[_0x2a3f('0x26')]=_0x48651c[_0x2a3f('0x27')];_0x3e189b[_0x2a3f('0x28')]=_0x48651c[_0x2a3f('0x29')];_0x3e189b[_0x2a3f('0x2a')]='from-sip';_0x3e189b[_0x2a3f('0x2b')]=_0x2a3f('0x2c');_0x3e189b[_0x2a3f('0x2d')]=0x0;_0x3e189b['assigned']=0x1;_0x3e189b['lastAssignedTo']=_0x48651c['membername'];_0x3e189b[_0x2a3f('0x2e')]=_0x2a3f('0x2f');return BPromise[_0x2a3f('0x9')]()[_0x2a3f('0xc')](voiceQueueReport['create'](_0x3e189b))[_0x2a3f('0xa')](loggerCatch(_0x2a3f('0x30')));};exports[_0x2a3f('0x31')]=function(_0x52a083,_0x10a163){return BPromise[_0x2a3f('0x9')]()[_0x2a3f('0xc')](cmHopper[_0x2a3f('0x31')](_0x52a083,_0x10a163))[_0x2a3f('0xa')](loggerCatch(_0x2a3f('0x32')));};exports['rescheduleContactInQueue']=function(_0x41803e){return BPromise['resolve']()[_0x2a3f('0xc')](cmHopper[_0x2a3f('0x14')](_0x41803e,!![],!![]))[_0x2a3f('0xa')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
+var _0xe24a=['from-sip','exten','xcally-motion-preview','holdtime','queuecallerexitreason','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/agentReportPreview','../rpc/voiceQueueReport','createHistory','catch','[createHistory]\x20','resolve','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context'];(function(_0x5031f1,_0x5ece37){var _0x35b214=function(_0x490d11){while(--_0x490d11){_0x5031f1['push'](_0x5031f1['shift']());}};_0x35b214(++_0x5ece37);}(_0xe24a,0xe8));var _0xae24=function(_0x3f5d61,_0xcc8fb3){_0x3f5d61=_0x3f5d61-0x0;var _0x4ab83c=_0xe24a[_0x3f5d61];return _0x4ab83c;};'use strict';var util=require(_0xae24('0x0'));var BPromise=require(_0xae24('0x1'));var logger=require(_0xae24('0x2'))(_0xae24('0x3'));var _=require(_0xae24('0x4'));var cmHopper=require(_0xae24('0x5'));var cmHopperFinal=require(_0xae24('0x6'));var cmHopperHistory=require(_0xae24('0x7'));var cmHopperBlack=require(_0xae24('0x8'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0xae24('0x9'));var voiceQueueReport=require(_0xae24('0xa'));function loggerCatch(_0x23ac02){return function(_0x4d268f){logger['error'](_0x23ac02,util['inspect'](_0x4d268f,{'showHidden':![],'depth':null}));};}function create(_0x27cfa7){return BPromise['resolve']()['then'](cmHopperHistory[_0xae24('0xb')](_0x27cfa7))[_0xae24('0xc')](loggerCatch(_0xae24('0xd')));}function createAgent(_0x3668e8){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](agentReportPreview[_0xae24('0xb')](_0x3668e8))[_0xae24('0xc')](loggerCatch(_0xae24('0xd')));}function moveContact(_0xd643d9){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper[_0xae24('0x10')](_0xd643d9,!![]))[_0xae24('0xc')](loggerCatch(_0xae24('0x11')));}exports['checkIsBlackList']=function(_0x385617){return BPromise[_0xae24('0xe')]()['then'](cmHopperBlack[_0xae24('0x12')](_0x385617))[_0xae24('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xae24('0x13')]=function(_0x137fd4){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper[_0xae24('0x13')](_0x137fd4))['catch'](loggerCatch(_0xae24('0x14')));};exports['createHistory']=function(_0x3178a2,_0x68706a){create(_0x3178a2)[_0xae24('0xc')](loggerCatch(_0x68706a));moveContact(_0x3178a2)[_0xae24('0xc')](loggerCatch(_0x68706a));};exports[_0xae24('0x15')]=function(_0x3e683e,_0x207cd5){createAgent(_0x3e683e)[_0xae24('0xc')](loggerCatch(_0x207cd5));};exports[_0xae24('0x16')]=function(_0x38c229,_0x28c74f){create(_0x38c229)[_0xae24('0xc')](loggerCatch(_0x28c74f));};exports['createCustomerFinal']=function(_0x518638,_0x34787c){moveContact(_0x518638)[_0xae24('0xc')](loggerCatch(_0x34787c));};exports[_0xae24('0x17')]=function(_0x14cb04,_0x418871,_0x2baa4c){if(_0x418871){_0x14cb04['UserId']=null;}if(_0x2baa4c){_0x14cb04['active']=![];}return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper[_0xae24('0x17')](_0x14cb04))[_0xae24('0xc')](loggerCatch(_0xae24('0x18')));};exports['countReScheduled']=function(_0x5bc25e){return BPromise['resolve']()['then'](cmHopper[_0xae24('0x19')](_0x5bc25e))[_0xae24('0xc')](loggerCatch(_0xae24('0x1a')));};exports[_0xae24('0x1b')]=function(_0x49e586){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper[_0xae24('0x1b')]({'UserId':null},_0x49e586,0x1))['catch'](loggerCatch(_0xae24('0x1c')));};exports['disableContact']=function(_0x4407d0){return BPromise[_0xae24('0xe')]()['then'](cmHopper['unlockContact']({'active':![]},_0x4407d0,0x1))[_0xae24('0xc')](loggerCatch(_0xae24('0x1d')));};exports[_0xae24('0x1e')]=function(_0x64ef69){var _0x5060eb={};_0x5060eb[_0xae24('0x1f')]=_0x64ef69[_0xae24('0x1f')];_0x5060eb['uniqueid']=_0x64ef69['uniqueid'];_0x5060eb['calleridnum']=_0x64ef69[_0xae24('0x20')];_0x5060eb['calleridname']=_0x64ef69[_0xae24('0x21')];_0x5060eb['queue']=_0x64ef69[_0xae24('0x22')];_0x5060eb[_0xae24('0x23')]=_0x64ef69[_0xae24('0x24')];_0x5060eb[_0xae24('0x25')]=_0x64ef69[_0xae24('0x24')];_0x5060eb[_0xae24('0x26')]=0x1;_0x5060eb['queuecallercompleteAt']=_0x64ef69[_0xae24('0x27')];_0x5060eb[_0xae24('0x28')]=_0x64ef69[_0xae24('0x29')];_0x5060eb[_0xae24('0x2a')]=_0xae24('0x2b');_0x5060eb[_0xae24('0x2c')]=_0xae24('0x2d');_0x5060eb[_0xae24('0x2e')]=0x0;_0x5060eb['assigned']=0x1;_0x5060eb['lastAssignedTo']=_0x64ef69[_0xae24('0x29')];_0x5060eb[_0xae24('0x2f')]=_0xae24('0x30');return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](voiceQueueReport[_0xae24('0x31')](_0x5060eb))[_0xae24('0xc')](loggerCatch(_0xae24('0x32')));};exports[_0xae24('0x33')]=function(_0x4a2446,_0x236a3b){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper['getContactRecallMe'](_0x4a2446,_0x236a3b))[_0xae24('0xc')](loggerCatch(_0xae24('0x34')));};exports[_0xae24('0x35')]=function(_0x5d3e3f){return BPromise[_0xae24('0xe')]()[_0xae24('0xf')](cmHopper[_0xae24('0x17')](_0x5d3e3f,!![],!![]))[_0xae24('0xc')](loggerCatch(_0xae24('0x36')));};
\ No newline at end of file
index 115ba86..7749497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d16=['CampaignId','idContact','type','campaigntype','membername','countnoanswerretry','countglobal','callbackat','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','info','loggerError','message','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','tags','createdAt','%s%s','toUpper','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','ringtime','logLookAgent','UserId','talktime','answertime','isFailure','Failure','variablesAction','RECALL','calleridname','uniqueid','originate','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','buildObj','lastevent','queue','interface','channelAgent','mandatoryDisposition','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','createBody'];(function(_0x13add9,_0x40bc73){var _0x4eb2e1=function(_0xa5d508){while(--_0xa5d508){_0x13add9['push'](_0x13add9['shift']());}};_0x4eb2e1(++_0x40bc73);}(_0x9d16,0x1cf));var _0x69d1=function(_0x12e073,_0x4d43db){_0x12e073=_0x12e073-0x0;var _0x267748=_0x9d16[_0x12e073];return _0x267748;};'use strict';var util=require(_0x69d1('0x0'));var _=require(_0x69d1('0x1'));var moment=require(_0x69d1('0x2'));var logger=require(_0x69d1('0x3'))(_0x69d1('0x4'));var ipAgi=process[_0x69d1('0x5')][_0x69d1('0x6')]||_0x69d1('0x7');function getSeconds(_0x3916c0,_0x271dc8){var _0xa1e765=moment(_0x3916c0)[_0x69d1('0x8')](0x0);var _0x100778=moment(_0x271dc8)['milliseconds'](0x0);return _0xa1e765[_0x69d1('0x9')](_0x100778,_0x69d1('0xa'));}exports[_0x69d1('0xb')]=function(_0x4d6df9){return function(_0x13808b){logger[_0x69d1('0xc')](_0x4d6df9,util[_0x69d1('0xd')](_0x13808b,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x3d53b6,_0x2c151b){logger[_0x69d1('0xe')](_0x3d53b6,util[_0x69d1('0xd')](_0x2c151b,{'showHidden':![],'depth':null}));};exports[_0x69d1('0xf')]=function(_0x16ef80,_0x1dc0ab){logger[_0x69d1('0xc')](_0x16ef80,util[_0x69d1('0xd')](_0x1dc0ab,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x47544b){return function(_0x225a73){logger['info'](_0x47544b,util[_0x69d1('0xd')](_0x225a73,{'showHidden':![],'depth':null}));};};exports[_0x69d1('0x10')]=function(_0x16ae9e,_0x5cb25a,_0x4ff5e9){return{'message':_0x16ae9e,'unlock':_0x5cb25a,'active':_0x4ff5e9};};exports[_0x69d1('0x11')]=function(_0x1b26a9,_0xc4ff4c,_0xc9e2c9){if(!_[_0x69d1('0x12')](_0xc9e2c9)&&'string'===typeof _0xc9e2c9&&!_[_0x69d1('0x13')](_0xc9e2c9)){if(!_['isUndefined'](_0xc4ff4c)&&_0x69d1('0x14')===typeof _0xc4ff4c&&!_[_0x69d1('0x13')](_0xc4ff4c)){return util[_0x69d1('0x15')](_0x69d1('0x16'),_0xc4ff4c,_0xc9e2c9);}return util[_0x69d1('0x15')](_0x69d1('0x16'),_0xc9e2c9,_0xc9e2c9);}if(!_[_0x69d1('0x12')](_0x1b26a9)&&_0x69d1('0x14')===typeof _0x1b26a9&&!_[_0x69d1('0x13')](_0x1b26a9)){return _0x1b26a9;}return _0x69d1('0x17');};exports['isActive']=function(_0x50d9b6){if(_[_0x69d1('0x18')](_0x50d9b6)){return![];}return _0x50d9b6;};exports['addVariables']=function(_0x600257,_0x2bd92f,_0x3cb1e5,_0x20ca41,_0x347d07,_0x533f44){var _0x45431b={'XMD-QUEUE':_0x2bd92f[_0x69d1('0x19')]?_0x2bd92f[_0x69d1('0x19')][_0x69d1('0x1a')]:'','XMD-CALLERID':_0x20ca41,'XMD-CALLERID-PREVIEW':_0x533f44?util[_0x69d1('0x15')](_0x69d1('0x16'),_0x533f44['calleridname'],_0x533f44[_0x69d1('0x1b')]):_0x20ca41,'XMD-DIALID':_0x347d07,'XMD-CONTACTID':_0x2bd92f[_0x69d1('0x1c')],'XMD-CDRTYPE':_0x69d1('0x1d'),'CALLERID(all)':_0x20ca41,'XMD-VOICEQUEUEID':_0x2bd92f[_0x69d1('0x1e')],'XMD-DIALCHANNEL':_0x3cb1e5,'XMD-DIALTIMEOUT':_0x600257[_0x69d1('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x69d1('0x15')]('\x22rtTxX%s%s\x22',_0x600257[_0x69d1('0x20')]?'g':'',_['isEmpty'](_0x600257['monitor_format'])?'':_0x69d1('0x21')),'XMD-DIALURL':_0x600257[_0x69d1('0x22')]||'','XMD-AGI':_0x600257['dialQueueProject']?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x600257[_0x69d1('0x23')]):'NONE','XMD-AGIAFTER':_0x600257[_0x69d1('0x20')]?util[_0x69d1('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0x600257[_0x69d1('0x20')]):_0x69d1('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x533f44?_0x533f44[_0x69d1('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x533f44?_0x533f44[_0x69d1('0x26')]:'','XMD-DESTINATION':_0x69d1('0x27')};if(!_['isEmpty'](_0x600257[_0x69d1('0x28')])){_0x45431b[util[_0x69d1('0x15')]('%s',_0x69d1('0x29'))]=_0x600257['monitor_format'];_0x45431b[util[_0x69d1('0x15')]('%s',_0x69d1('0x2a'))]=_0x347d07;}if(_0x2bd92f&&_0x2bd92f[_0x69d1('0x2b')]){for(var _0x331136 in _0x2bd92f[_0x69d1('0x2b')]){if(_0x2bd92f['Contact']['hasOwnProperty'](_0x331136)){if(!_[_0x69d1('0x18')](_0x2bd92f['Contact'][_0x331136])&&_0x331136!=='id'&&_0x331136!==_0x69d1('0x2c')&&_0x331136!==_0x69d1('0x2d')&&_0x331136!=='updatedAt'){_0x45431b[util[_0x69d1('0x15')](_0x69d1('0x2e'),'XMD-',_[_0x69d1('0x2f')](_0x331136))]=_0x2bd92f[_0x69d1('0x2b')][_0x331136];}}}}return _0x45431b;};exports['toLowerVariables']=function(_0x4699a8){var _0x340c33={};for(var _0x2a40b1 in _0x4699a8){if(_0x4699a8[_0x69d1('0x30')](_0x2a40b1)){_0x340c33[util[_0x69d1('0x15')]('%s',_[_0x69d1('0x31')](_0x2a40b1))]=_0x4699a8[_0x2a40b1];}}return{'variables':_0x340c33};};exports[_0x69d1('0x32')]=function(_0x12206d,_0x5d285a){if(!_[_0x69d1('0x18')](_0x12206d)){if(_0x12206d['hasOwnProperty'](_0x69d1('0x33'))){if(_0x12206d[_0x69d1('0x33')]>0x0){_0x12206d[_0x69d1('0x33')]-=0x1;}else{logger[_0x69d1('0xc')](_0x69d1('0x34'),_0x5d285a);}}}else{logger['error'](_0x69d1('0x35'),_0x5d285a);}};exports[_0x69d1('0x36')]=function(_0x2ad01c){var _0xad4a62=moment()[_0x69d1('0x15')](_0x69d1('0x37'));_0x2ad01c[_0x69d1('0x38')]=0xd;_0x2ad01c[_0x69d1('0x39')]=_0x69d1('0x3a');_0x2ad01c[_0x69d1('0x3b')]=_0xad4a62;_0x2ad01c[_0x69d1('0x3c')]=_0xad4a62;_0x2ad01c[_0x69d1('0x3d')]=_0xad4a62;};exports['logAgent']=function(_0x2ba90f,_0x1298c2,_0x45a189){var _0x1967ec=moment()[_0x69d1('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x2ba90f[_0x69d1('0x38')]=_0x1298c2;_0x2ba90f[_0x69d1('0x39')]=_0x45a189;_0x2ba90f[_0x69d1('0x3c')]=_0x1967ec;_0x2ba90f[_0x69d1('0x3e')]=getSeconds(_0x2ba90f['responsetime'],_0x2ba90f[_0x69d1('0x3b')]);};exports[_0x69d1('0x3f')]=function(_0x424b21,_0x453c82,_0x3a8201){_0x424b21['membername']=_0x453c82;_0x424b21[_0x69d1('0x40')]=_0x3a8201;};exports['logCustomer']=function(_0x4f74d8,_0x3c3fa9,_0x27b584){var _0x2b63f1=moment()[_0x69d1('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x4f74d8[_0x69d1('0x38')]=_0x3c3fa9;_0x4f74d8[_0x69d1('0x39')]=_0x27b584;_0x4f74d8[_0x69d1('0x3c')]=_0x4f74d8[_0x69d1('0x3c')]?_0x4f74d8[_0x69d1('0x3c')]:_0x2b63f1;_0x4f74d8[_0x69d1('0x3d')]=_0x4f74d8[_0x69d1('0x3d')]?_0x4f74d8[_0x69d1('0x3d')]:_0x2b63f1;_0x4f74d8[_0x69d1('0x3e')]=getSeconds(_0x4f74d8[_0x69d1('0x3c')]||0x0,_0x4f74d8['starttime']||0x0);_0x4f74d8[_0x69d1('0x41')]=_0x4f74d8[_0x69d1('0x42')]?getSeconds(_0x4f74d8[_0x69d1('0x3d')],_0x4f74d8['answertime']):0x0;};exports[_0x69d1('0x43')]=function(_0x1db37b){return _0x1db37b===_0x69d1('0x44');};exports[_0x69d1('0x45')]=function(_0x38fe41,_0x1caf1e,_0x6c52a5,_0xfc9f09,_0x4e3fb4){var _0xce6942=_0xfc9f09?_0x69d1('0x46'):_0x38fe41[_0x69d1('0x47')];_0xce6942=_0x4e3fb4?'BOOKED':_0xce6942;return{'actionid':_0x38fe41[_0x69d1('0x48')],'action':_0x69d1('0x49'),'channel':_0x38fe41['channelAgent'],'callerid':util['format'](_0x69d1('0x16'),_0xce6942,_0x38fe41['calleridnum']),'Exten':'xcally-motion-preview','Context':_0x69d1('0x4a'),'Priority':'1','variable':_0x6c52a5,'timeout':(_0x1caf1e[_0x69d1('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x38fe41[_0x69d1('0x48')]};};exports[_0x69d1('0x4c')]=function(_0x291603){return _0x291603[_0x69d1('0x4d')]+_0x291603[_0x69d1('0x4e')]+_0x291603['countnoanswerretry']+_0x291603[_0x69d1('0x4f')]+_0x291603[_0x69d1('0x50')];};exports[_0x69d1('0x51')]=function(_0x56674c){var _0x4401e3=_[_0x69d1('0x52')](_0x56674c);_0x4401e3['state']=0xf;_0x4401e3[_0x69d1('0x39')]=_0x69d1('0x53');return _0x4401e3;};exports['scheduledAt']=function(_0x42ce69,_0x55591f,_0x237bc4){var _0x50c838={};_0x50c838[_0x55591f]=_0x42ce69[_0x55591f];_0x50c838['active']=![];_0x50c838[_0x69d1('0x54')]=moment()[_0x69d1('0x55')](_0x237bc4,_0x69d1('0x56'))[_0x69d1('0x15')](_0x69d1('0x37'));_0x50c838[_0x69d1('0x1c')]=_0x42ce69[_0x69d1('0x1c')];_0x50c838[_0x69d1('0x57')]=_0x42ce69[_0x69d1('0x57')];_0x50c838[_0x69d1('0x1e')]=_0x42ce69[_0x69d1('0x1e')]||undefined;return _0x50c838;};exports[_0x69d1('0x58')]=function(_0x185dda,_0x54591c){if(!_['isNil'](_0x185dda)){if(_0x185dda[_0x69d1('0x59')]>0x0){_0x185dda[_0x69d1('0x59')]-=0x1;}else{logger[_0x69d1('0xc')](_0x54591c,_0x69d1('0x5a'));}}else{logger[_0x69d1('0xc')](_0x54591c,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x69d1('0x5b')]=function(_0x167e50){if(_0x167e50<=0x0){return!![];}return![];};exports[_0x69d1('0x5c')]=function(_0x5d12b,_0x540386,_0x201998){_0x5d12b[_0x69d1('0x5d')]=_0x540386;_0x5d12b[_0x69d1('0x1a')]=_0x5d12b[_0x69d1('0x5e')];_0x5d12b[_0x69d1('0x5f')]=_0x5d12b[_0x69d1('0x60')];if(_0x201998){_0x5d12b[_0x69d1('0x61')]=_0x201998[_0x69d1('0x61')];}return _0x5d12b;};exports[_0x69d1('0x62')]=function(_0x209e2d){var _0x38aaed={};_0x38aaed[_0x69d1('0x5e')]=_0x209e2d[_0x69d1('0x5e')];_0x38aaed[_0x69d1('0x5f')]=_0x209e2d['channelAgent'];_0x38aaed[_0x69d1('0x48')]=_0x209e2d[_0x69d1('0x48')];return _0x38aaed;};exports[_0x69d1('0x63')]=function(_0x239d55){var _0x5637dd=[];for(var _0x526814 in _0x239d55){if(_0x239d55[_0x69d1('0x30')](_0x526814)){if(!_[_0x69d1('0x18')](_0x239d55[_0x526814])&&_0x239d55[_0x526814][_0x69d1('0x38')]===_0x69d1('0x64')&&_0x239d55[_0x526814]['status']===_0x69d1('0x65')){_0x5637dd[_0x69d1('0x66')](_0x239d55[_0x526814]['id']);}}}return _0x5637dd;};exports[_0x69d1('0x67')]=function(_0x1d17ca){var _0x3fda25=moment()['milliseconds'](0x0);var _0x1bfed6=moment(_0x1d17ca)[_0x69d1('0x8')](0x0);return _0x3fda25['diff'](_0x1bfed6,'seconds');};exports[_0x69d1('0x68')]=function(_0x6e8811){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x6e8811['ContactId'],'ListId':_0x6e8811[_0x69d1('0x57')],'VoiceQueueId':_0x6e8811[_0x69d1('0x1e')]||undefined,'CampaignId':_0x6e8811[_0x69d1('0x69')]||undefined};};exports['filterKey']=function(_0x4c5dad){if(_0x4c5dad==='uniqueid'||_0x4c5dad===_0x69d1('0x6a')||_0x4c5dad===_0x69d1('0x5e')||_0x4c5dad===_0x69d1('0x6b')||_0x4c5dad===_0x69d1('0x6c')||_0x4c5dad==='dialAnswer'||_0x4c5dad===_0x69d1('0x6d')||_0x4c5dad===_0x69d1('0x60')||_0x4c5dad===_0x69d1('0x47')||_0x4c5dad==='active'||_0x4c5dad===_0x69d1('0x1b')||_0x4c5dad===_0x69d1('0x54')||_0x4c5dad===_0x69d1('0x4d')||_0x4c5dad===_0x69d1('0x4e')||_0x4c5dad===_0x69d1('0x6e')||_0x4c5dad===_0x69d1('0x6f')||_0x4c5dad==='callback'||_0x4c5dad==='callbackuniqueid'||_0x4c5dad===_0x69d1('0x70')||_0x4c5dad==='recallme'||_0x4c5dad===_0x69d1('0x1c')||_0x4c5dad===_0x69d1('0x57')||_0x4c5dad===_0x69d1('0x40')||_0x4c5dad===_0x69d1('0x1e')||_0x4c5dad==='sipcallid'||_0x4c5dad===_0x69d1('0x71')||_0x4c5dad===_0x69d1('0x72')||_0x4c5dad===_0x69d1('0x73')||_0x4c5dad===_0x69d1('0x74')||_0x4c5dad===_0x69d1('0x75')||_0x4c5dad===_0x69d1('0x76')||_0x4c5dad===_0x69d1('0x77')||_0x4c5dad===_0x69d1('0x78')||_0x4c5dad===_0x69d1('0x79')||_0x4c5dad==='xmd-contactid'||_0x4c5dad===_0x69d1('0x7a')||_0x4c5dad===_0x69d1('0x7b')||_0x4c5dad===_0x69d1('0x7c')||_0x4c5dad==='xmd-agi'||_0x4c5dad===_0x69d1('0x7d')||_0x4c5dad===_0x69d1('0x7e')||_0x4c5dad===_0x69d1('0x7f')||_0x4c5dad===_0x69d1('0x80')||_0x4c5dad===_0x69d1('0x81')||_0x4c5dad===_0x69d1('0x82')||_0x4c5dad==='rtpaudioqosrtt'||_0x4c5dad==='rtpaudioqosrttbridged'||_0x4c5dad==='rtpaudioqos'||_0x4c5dad===_0x69d1('0x7e')||_0x4c5dad==='rtpaudioqosjitter'||_0x4c5dad===_0x69d1('0x80')||_0x4c5dad===_0x69d1('0x81')||_0x4c5dad==='rtpaudioqoslossbridged'||_0x4c5dad===_0x69d1('0x83')||_0x4c5dad===_0x69d1('0x84')||_0x4c5dad===_0x69d1('0x85')||_0x4c5dad===_0x69d1('0x86')||_0x4c5dad===_0x69d1('0x38')||_0x4c5dad===_0x69d1('0x39')){return![];}return!![];};exports[_0x69d1('0x87')]=function(_0x4f0018,_0x3bcbbf){var _0x31d88b,_0x28bdbc,_0x1efb7b;if(_0x3bcbbf<=0x0){_0x3bcbbf=0x1;}_0x31d88b=new RegExp(_0x69d1('0x88')+_0x3bcbbf+'}$');_0x28bdbc=Math[_0x69d1('0x89')](0xa,_0x3bcbbf-0x1);_0x1efb7b=Math['pow'](0xa,_0x3bcbbf)-0x1;return util[_0x69d1('0x15')]('%s',_[_0x69d1('0x8a')](_0x4f0018,_0x31d88b,_[_0x69d1('0x8b')](_0x28bdbc,_0x1efb7b)));};exports[_0x69d1('0x8c')]=function(_0x5a88b2){var _0x4b00a0=_0x5a88b2[_0x69d1('0x8d')](/"(.*?)"/);return _0x4b00a0?_0x4b00a0[0x1]:_0x5a88b2;};exports['extractCalleridNumber']=function(_0x427ca3){var _0x31f323=_0x427ca3['match'](/<(.*?)>/);return _0x31f323?_0x31f323[0x1]:_0x427ca3;};
\ No newline at end of file
+var _0x46af=['match','extractCalleridNumber','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','milliseconds','diff','loggerCatch','error','logger','info','inspect','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isNil','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','starttime','responsetime','endtime','logAgent','statedesc','ringtime','logLookAgent','membername','logCustomer','answertime','isFailure','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','mandatoryDisposition','buildAcw','agentReadyId','status','reachable','push','getDiff','seconds','createBody','filterKey','idContact','type','campaigntype','dialAnswer','callback','callbackat','UserId','sipcallid','xmd-voicequeueid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-cdrtype','xmd-callerid','xmd-agi','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqosjitter','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName'];(function(_0x3aeeed,_0x4e1be5){var _0x3d8c5f=function(_0x16e66b){while(--_0x16e66b){_0x3aeeed['push'](_0x3aeeed['shift']());}};_0x3d8c5f(++_0x4e1be5);}(_0x46af,0x1a9));var _0xf46a=function(_0x1e9edb,_0x2e224b){_0x1e9edb=_0x1e9edb-0x0;var _0x56a40e=_0x46af[_0x1e9edb];return _0x56a40e;};'use strict';var util=require(_0xf46a('0x0'));var _=require(_0xf46a('0x1'));var moment=require('moment');var logger=require(_0xf46a('0x2'))(_0xf46a('0x3'));var ipAgi=process['env'][_0xf46a('0x4')]||'127.0.0.1';function getSeconds(_0x114681,_0x1ec760){var _0x1b310b=moment(_0x114681)[_0xf46a('0x5')](0x0);var _0x4c72a8=moment(_0x1ec760)[_0xf46a('0x5')](0x0);return _0x1b310b[_0xf46a('0x6')](_0x4c72a8,'seconds');}exports[_0xf46a('0x7')]=function(_0x1f1a29){return function(_0x2ca35a){logger[_0xf46a('0x8')](_0x1f1a29,util['inspect'](_0x2ca35a,{'showHidden':![],'depth':null}));};};exports[_0xf46a('0x9')]=function(_0x11f094,_0x5af47c){logger[_0xf46a('0xa')](_0x11f094,util[_0xf46a('0xb')](_0x5af47c,{'showHidden':![],'depth':null}));};exports[_0xf46a('0xc')]=function(_0x25a562,_0x36299f){logger[_0xf46a('0x8')](_0x25a562,util[_0xf46a('0xb')](_0x36299f,{'showHidden':![],'depth':null}));};exports[_0xf46a('0xd')]=function(_0x38ae8c){return function(_0x512580){logger['info'](_0x38ae8c,util[_0xf46a('0xb')](_0x512580,{'showHidden':![],'depth':null}));};};exports[_0xf46a('0xe')]=function(_0x528cbe,_0x1dbf11,_0x94207a){return{'message':_0x528cbe,'unlock':_0x1dbf11,'active':_0x94207a};};exports[_0xf46a('0xf')]=function(_0x19db24,_0x136003,_0x208efa){if(!_[_0xf46a('0x10')](_0x208efa)&&_0xf46a('0x11')===typeof _0x208efa&&!_['isEmpty'](_0x208efa)){if(!_[_0xf46a('0x10')](_0x136003)&&_0xf46a('0x11')===typeof _0x136003&&!_[_0xf46a('0x12')](_0x136003)){return util[_0xf46a('0x13')](_0xf46a('0x14'),_0x136003,_0x208efa);}return util[_0xf46a('0x13')]('\x22%s\x22\x20<%s>',_0x208efa,_0x208efa);}if(!_[_0xf46a('0x10')](_0x19db24)&&_0xf46a('0x11')===typeof _0x19db24&&!_[_0xf46a('0x12')](_0x19db24)){return _0x19db24;}return _0xf46a('0x15');};exports['isActive']=function(_0x1d33e1){if(_[_0xf46a('0x16')](_0x1d33e1)){return![];}return _0x1d33e1;};exports['addVariables']=function(_0x2a5d4d,_0x4016b4,_0x405b9b,_0x1191fb,_0x41e647,_0x143e33){var _0x43a693={'XMD-QUEUE':_0x4016b4[_0xf46a('0x17')]?_0x4016b4['Queue'][_0xf46a('0x18')]:'','XMD-CALLERID':_0x1191fb,'XMD-CALLERID-PREVIEW':_0x143e33?util[_0xf46a('0x13')](_0xf46a('0x14'),_0x143e33[_0xf46a('0x19')],_0x143e33[_0xf46a('0x1a')]):_0x1191fb,'XMD-DIALID':_0x41e647,'XMD-CONTACTID':_0x4016b4[_0xf46a('0x1b')],'XMD-CDRTYPE':_0xf46a('0x1c'),'CALLERID(all)':_0x1191fb,'XMD-VOICEQUEUEID':_0x4016b4[_0xf46a('0x1d')],'XMD-DIALCHANNEL':_0x405b9b,'XMD-DIALTIMEOUT':_0x2a5d4d[_0xf46a('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0xf46a('0x13')](_0xf46a('0x1f'),_0x2a5d4d[_0xf46a('0x20')]?'g':'',_['isEmpty'](_0x2a5d4d[_0xf46a('0x21')])?'':_0xf46a('0x22')),'XMD-DIALURL':_0x2a5d4d[_0xf46a('0x23')]||'','XMD-AGI':_0x2a5d4d[_0xf46a('0x24')]?util['format'](_0xf46a('0x25'),ipAgi,_0x2a5d4d[_0xf46a('0x24')]):_0xf46a('0x26'),'XMD-AGIAFTER':_0x2a5d4d[_0xf46a('0x20')]?util[_0xf46a('0x13')](_0xf46a('0x25'),ipAgi,_0x2a5d4d[_0xf46a('0x20')]):_0xf46a('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x143e33?_0x143e33[_0xf46a('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x143e33?_0x143e33[_0xf46a('0x28')]:'','XMD-DESTINATION':_0xf46a('0x29')};if(!_[_0xf46a('0x12')](_0x2a5d4d[_0xf46a('0x21')])){_0x43a693[util['format']('%s',_0xf46a('0x2a'))]=_0x2a5d4d[_0xf46a('0x21')];_0x43a693[util[_0xf46a('0x13')]('%s',_0xf46a('0x2b'))]=_0x41e647;}if(_0x4016b4&&_0x4016b4[_0xf46a('0x2c')]){for(var _0x4e2a9c in _0x4016b4[_0xf46a('0x2c')]){if(_0x4016b4[_0xf46a('0x2c')][_0xf46a('0x2d')](_0x4e2a9c)){if(!_[_0xf46a('0x16')](_0x4016b4['Contact'][_0x4e2a9c])&&_0x4e2a9c!=='id'&&_0x4e2a9c!==_0xf46a('0x2e')&&_0x4e2a9c!==_0xf46a('0x2f')&&_0x4e2a9c!==_0xf46a('0x30')){_0x43a693[util[_0xf46a('0x13')](_0xf46a('0x31'),_0xf46a('0x32'),_[_0xf46a('0x33')](_0x4e2a9c))]=_0x4016b4['Contact'][_0x4e2a9c];}}}}return _0x43a693;};exports[_0xf46a('0x34')]=function(_0x36623e){var _0x315e80={};for(var _0x2bdf0e in _0x36623e){if(_0x36623e[_0xf46a('0x2d')](_0x2bdf0e)){_0x315e80[util[_0xf46a('0x13')]('%s',_[_0xf46a('0x35')](_0x2bdf0e))]=_0x36623e[_0x2bdf0e];}}return{'variables':_0x315e80};};exports['updateOriginated']=function(_0x5577a1,_0x3981d6){if(!_[_0xf46a('0x16')](_0x5577a1)){if(_0x5577a1[_0xf46a('0x2d')](_0xf46a('0x36'))){if(_0x5577a1[_0xf46a('0x36')]>0x0){_0x5577a1['originated']-=0x1;}else{logger[_0xf46a('0x8')](_0xf46a('0x37'),_0x3981d6);}}}else{logger[_0xf46a('0x8')](_0xf46a('0x38'),_0x3981d6);}};exports['logBlacklist']=function(_0x25328c){var _0x3c400f=moment()[_0xf46a('0x13')](_0xf46a('0x39'));_0x25328c[_0xf46a('0x3a')]=0xd;_0x25328c['statedesc']='Blacklist';_0x25328c[_0xf46a('0x3b')]=_0x3c400f;_0x25328c[_0xf46a('0x3c')]=_0x3c400f;_0x25328c[_0xf46a('0x3d')]=_0x3c400f;};exports[_0xf46a('0x3e')]=function(_0x265520,_0x4076a6,_0xc16d49){var _0x58bf22=moment()[_0xf46a('0x13')](_0xf46a('0x39'));_0x265520[_0xf46a('0x3a')]=_0x4076a6;_0x265520[_0xf46a('0x3f')]=_0xc16d49;_0x265520[_0xf46a('0x3c')]=_0x58bf22;_0x265520[_0xf46a('0x40')]=getSeconds(_0x265520['responsetime'],_0x265520[_0xf46a('0x3b')]);};exports[_0xf46a('0x41')]=function(_0x43426a,_0x418bdb,_0x5bd8a9){_0x43426a[_0xf46a('0x42')]=_0x418bdb;_0x43426a['UserId']=_0x5bd8a9;};exports[_0xf46a('0x43')]=function(_0x291bd0,_0x32444a,_0x5834a4){var _0x8117fd=moment()[_0xf46a('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x291bd0[_0xf46a('0x3a')]=_0x32444a;_0x291bd0['statedesc']=_0x5834a4;_0x291bd0[_0xf46a('0x3c')]=_0x291bd0['responsetime']?_0x291bd0[_0xf46a('0x3c')]:_0x8117fd;_0x291bd0['endtime']=_0x291bd0[_0xf46a('0x3d')]?_0x291bd0[_0xf46a('0x3d')]:_0x8117fd;_0x291bd0[_0xf46a('0x40')]=getSeconds(_0x291bd0['responsetime']||0x0,_0x291bd0['starttime']||0x0);_0x291bd0['talktime']=_0x291bd0[_0xf46a('0x44')]?getSeconds(_0x291bd0[_0xf46a('0x3d')],_0x291bd0[_0xf46a('0x44')]):0x0;};exports[_0xf46a('0x45')]=function(_0x2d5301){return _0x2d5301===_0xf46a('0x46');};exports[_0xf46a('0x47')]=function(_0x19e14e,_0xb2b1e5,_0x512d26,_0x40178b,_0x4aa683){var _0x500cfe=_0x40178b?_0xf46a('0x48'):_0x19e14e[_0xf46a('0x19')];_0x500cfe=_0x4aa683?'BOOKED':_0x500cfe;return{'actionid':_0x19e14e[_0xf46a('0x49')],'action':_0xf46a('0x4a'),'channel':_0x19e14e[_0xf46a('0x4b')],'callerid':util['format']('\x22%s\x22\x20<%s>',_0x500cfe,_0x19e14e[_0xf46a('0x1a')]),'Exten':_0xf46a('0x29'),'Context':_0xf46a('0x4c'),'Priority':'1','variable':_0x512d26,'timeout':(_0xb2b1e5[_0xf46a('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x19e14e['uniqueid']};};exports[_0xf46a('0x4e')]=function(_0x5c6cc7){return _0x5c6cc7[_0xf46a('0x4f')]+_0x5c6cc7[_0xf46a('0x50')]+_0x5c6cc7['countnoanswerretry']+_0x5c6cc7['countagentrejectretry']+_0x5c6cc7['countnosuchnumberretry'];};exports[_0xf46a('0x51')]=function(_0x2592dc){var _0x9befaa=_[_0xf46a('0x52')](_0x2592dc);_0x9befaa['state']=0xf;_0x9befaa[_0xf46a('0x3f')]=_0xf46a('0x53');return _0x9befaa;};exports[_0xf46a('0x54')]=function(_0x36bf2a,_0x2a6766,_0x39985e){var _0x1afe87={};_0x1afe87[_0x2a6766]=_0x36bf2a[_0x2a6766];_0x1afe87[_0xf46a('0x55')]=![];_0x1afe87[_0xf46a('0x56')]=moment()[_0xf46a('0x57')](_0x39985e,'minutes')[_0xf46a('0x13')](_0xf46a('0x39'));_0x1afe87['ContactId']=_0x36bf2a[_0xf46a('0x1b')];_0x1afe87['ListId']=_0x36bf2a[_0xf46a('0x58')];_0x1afe87['VoiceQueueId']=_0x36bf2a[_0xf46a('0x1d')]||undefined;return _0x1afe87;};exports[_0xf46a('0x59')]=function(_0x176f7f,_0x429b31){if(!_[_0xf46a('0x16')](_0x176f7f)){if(_0x176f7f[_0xf46a('0x5a')]>0x0){_0x176f7f[_0xf46a('0x5a')]-=0x1;}else{logger[_0xf46a('0x8')](_0x429b31,_0xf46a('0x5b'));}}else{logger[_0xf46a('0x8')](_0x429b31,_0xf46a('0x5c'));}};exports[_0xf46a('0x5d')]=function(_0x1fb166){if(_0x1fb166<=0x0){return!![];}return![];};exports[_0xf46a('0x5e')]=function(_0x3c5697,_0x3ccb6f,_0x2f8d43){_0x3c5697[_0xf46a('0x5f')]=_0x3ccb6f;_0x3c5697[_0xf46a('0x18')]=_0x3c5697[_0xf46a('0x60')];_0x3c5697[_0xf46a('0x61')]=_0x3c5697[_0xf46a('0x4b')];if(_0x2f8d43){_0x3c5697[_0xf46a('0x62')]=_0x2f8d43['mandatoryDisposition'];}return _0x3c5697;};exports[_0xf46a('0x63')]=function(_0x15b18d){var _0x6b7d1d={};_0x6b7d1d[_0xf46a('0x60')]=_0x15b18d[_0xf46a('0x60')];_0x6b7d1d[_0xf46a('0x61')]=_0x15b18d[_0xf46a('0x4b')];_0x6b7d1d['uniqueid']=_0x15b18d[_0xf46a('0x49')];return _0x6b7d1d;};exports[_0xf46a('0x64')]=function(_0x1b2b36){var _0x2991bc=[];for(var _0x3a71e0 in _0x1b2b36){if(_0x1b2b36[_0xf46a('0x2d')](_0x3a71e0)){if(!_[_0xf46a('0x16')](_0x1b2b36[_0x3a71e0])&&_0x1b2b36[_0x3a71e0]['state']==='not_inuse'&&_0x1b2b36[_0x3a71e0][_0xf46a('0x65')]===_0xf46a('0x66')){_0x2991bc[_0xf46a('0x67')](_0x1b2b36[_0x3a71e0]['id']);}}}return _0x2991bc;};exports[_0xf46a('0x68')]=function(_0x20d11b){var _0x26b4fb=moment()[_0xf46a('0x5')](0x0);var _0x482c0a=moment(_0x20d11b)[_0xf46a('0x5')](0x0);return _0x26b4fb[_0xf46a('0x6')](_0x482c0a,_0xf46a('0x69'));};exports[_0xf46a('0x6a')]=function(_0x3b9395){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3b9395[_0xf46a('0x1b')],'ListId':_0x3b9395[_0xf46a('0x58')],'VoiceQueueId':_0x3b9395[_0xf46a('0x1d')]||undefined,'CampaignId':_0x3b9395['CampaignId']||undefined};};exports[_0xf46a('0x6b')]=function(_0xa5e46){if(_0xa5e46==='uniqueid'||_0xa5e46===_0xf46a('0x6c')||_0xa5e46==='queue'||_0xa5e46===_0xf46a('0x6d')||_0xa5e46===_0xf46a('0x6e')||_0xa5e46===_0xf46a('0x6f')||_0xa5e46===_0xf46a('0x42')||_0xa5e46===_0xf46a('0x4b')||_0xa5e46===_0xf46a('0x19')||_0xa5e46===_0xf46a('0x55')||_0xa5e46===_0xf46a('0x1a')||_0xa5e46===_0xf46a('0x56')||_0xa5e46===_0xf46a('0x4f')||_0xa5e46===_0xf46a('0x50')||_0xa5e46==='countnoanswerretry'||_0xa5e46==='countglobal'||_0xa5e46===_0xf46a('0x70')||_0xa5e46==='callbackuniqueid'||_0xa5e46===_0xf46a('0x71')||_0xa5e46==='recallme'||_0xa5e46===_0xf46a('0x1b')||_0xa5e46===_0xf46a('0x58')||_0xa5e46===_0xf46a('0x72')||_0xa5e46===_0xf46a('0x1d')||_0xa5e46===_0xf46a('0x73')||_0xa5e46===_0xf46a('0x74')||_0xa5e46==='xmd-queue'||_0xa5e46==='xmd-phone'||_0xa5e46==='xmd-listid'||_0xa5e46===_0xf46a('0x75')||_0xa5e46===_0xf46a('0x76')||_0xa5e46===_0xf46a('0x77')||_0xa5e46===_0xf46a('0x78')||_0xa5e46==='xmd-dialchannel'||_0xa5e46==='xmd-contactid'||_0xa5e46===_0xf46a('0x79')||_0xa5e46===_0xf46a('0x7a')||_0xa5e46==='xmd-agiafter'||_0xa5e46===_0xf46a('0x7b')||_0xa5e46==='rtpaudioqos'||_0xa5e46==='rtpaudioqosbridged'||_0xa5e46==='rtpaudioqosjitter'||_0xa5e46===_0xf46a('0x7c')||_0xa5e46===_0xf46a('0x7d')||_0xa5e46===_0xf46a('0x7e')||_0xa5e46===_0xf46a('0x7f')||_0xa5e46===_0xf46a('0x80')||_0xa5e46==='rtpaudioqos'||_0xa5e46===_0xf46a('0x81')||_0xa5e46===_0xf46a('0x82')||_0xa5e46===_0xf46a('0x7c')||_0xa5e46===_0xf46a('0x7d')||_0xa5e46===_0xf46a('0x7e')||_0xa5e46===_0xf46a('0x7f')||_0xa5e46===_0xf46a('0x80')||_0xa5e46===_0xf46a('0x83')||_0xa5e46===_0xf46a('0x84')||_0xa5e46==='state'||_0xa5e46===_0xf46a('0x3f')){return![];}return!![];};exports[_0xf46a('0x85')]=function(_0x481f0d,_0x3d08ba){var _0x1165d6,_0x5b01fb,_0x33cd3d;if(_0x3d08ba<=0x0){_0x3d08ba=0x1;}_0x1165d6=new RegExp(_0xf46a('0x86')+_0x3d08ba+'}$');_0x5b01fb=Math['pow'](0xa,_0x3d08ba-0x1);_0x33cd3d=Math[_0xf46a('0x87')](0xa,_0x3d08ba)-0x1;return util[_0xf46a('0x13')]('%s',_[_0xf46a('0x88')](_0x481f0d,_0x1165d6,_[_0xf46a('0x89')](_0x5b01fb,_0x33cd3d)));};exports[_0xf46a('0x8a')]=function(_0x4b4810){var _0x20c5ea=_0x4b4810[_0xf46a('0x8b')](/"(.*?)"/);return _0x20c5ea?_0x20c5ea[0x1]:_0x4b4810;};exports[_0xf46a('0x8c')]=function(_0x4d3301){var _0x2d8a13=_0x4d3301['match'](/<(.*?)>/);return _0x2d8a13?_0x2d8a13[0x1]:_0x4d3301;};
\ No newline at end of file
index 9d8c3cc..f3c303b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0239=['voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','queueremove','queuepause','reload'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x0239,0x1cf));var _0x9023=function(_0x2c39bb,_0x2753c4){_0x2c39bb=_0x2c39bb-0x0;var _0x53d038=_0x0239[_0x2c39bb];return _0x53d038;};'use strict';exports['queueadd']={'queue':{'type':_0x9023('0x0'),'required':!![]},'interface':{'type':_0x9023('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x9023('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x9023('0x2')]={'queue':{'type':_0x9023('0x0'),'required':!![]},'interface':{'type':_0x9023('0x0'),'required':!![]}};exports[_0x9023('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x9023('0x0'),'required':![]}};exports[_0x9023('0x4')]={'module':{'type':_0x9023('0x0'),'required':![]}};exports[_0x9023('0x5')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x9023('0x6')]={'uniqueid':{'type':_0x9023('0x0'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x9023('0x0')},'mixmonitorid':{'type':_0x9023('0x0')}};exports[_0x9023('0x7')]={'uniqueid':{'type':_0x9023('0x0'),'required':!![]}};exports[_0x9023('0x8')]={'uniqueid':{'type':_0x9023('0x0'),'required':!![]},'exten':{'type':_0x9023('0x0'),'required':!![]},'context':{'type':_0x9023('0x0')}};
\ No newline at end of file
+var _0x84cd=['voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string','boolean','queueremove','queuepause','reload'];(function(_0x3e1ae5,_0x223886){var _0x4c7662=function(_0xc5a60){while(--_0xc5a60){_0x3e1ae5['push'](_0x3e1ae5['shift']());}};_0x4c7662(++_0x223886);}(_0x84cd,0x16b));var _0xd84c=function(_0x5e1ad3,_0xea6ae){_0x5e1ad3=_0x5e1ad3-0x0;var _0x3124ac=_0x84cd[_0x5e1ad3];return _0x3124ac;};'use strict';exports[_0xd84c('0x0')]={'queue':{'type':_0xd84c('0x1'),'required':!![]},'interface':{'type':_0xd84c('0x1'),'required':!![]},'membername':{'type':_0xd84c('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0xd84c('0x2'),'required':![]}};exports[_0xd84c('0x3')]={'queue':{'type':_0xd84c('0x1'),'required':!![]},'interface':{'type':_0xd84c('0x1'),'required':!![]}};exports[_0xd84c('0x4')]={'interface':{'type':_0xd84c('0x1'),'required':!![]},'paused':{'type':_0xd84c('0x2')},'reason':{'type':_0xd84c('0x1'),'required':![]}};exports[_0xd84c('0x5')]={'module':{'type':_0xd84c('0x1'),'required':![]}};exports[_0xd84c('0x6')]={'uniqueid':{'type':_0xd84c('0x1'),'required':!![]}};exports[_0xd84c('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xd84c('0x1')},'format':{'type':_0xd84c('0x1')},'mixmonitorid':{'type':_0xd84c('0x1')}};exports[_0xd84c('0x8')]={'uniqueid':{'type':_0xd84c('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xd84c('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xd84c('0x1')}};
\ No newline at end of file
index 6d67b5c..48fddde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5217=['length','mergeFromDatabase','initTelephones','isUndefined','initVoiceQueues','initTriggers','initTemplates','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','uniqueid','queue','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallerjoinAt','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','campaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','templates','outbound','voiceExtensions','channels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundReCallsDay','queueStatusComplete','prototype','agents'];(function(_0x38d030,_0x40a241){var _0x46b16f=function(_0x457352){while(--_0x457352){_0x38d030['push'](_0x38d030['shift']());}};_0x46b16f(++_0x40a241);}(_0x5217,0xf9));var _0x7521=function(_0x3b4eeb,_0x47273a){_0x3b4eeb=_0x3b4eeb-0x0;var _0x13619a=_0x5217[_0x3b4eeb];return _0x13619a;};'use strict';var BPromise=require('bluebird');var util=require(_0x7521('0x0'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x7521('0x1'));var Telephone=require(_0x7521('0x2'));var Trunk=require(_0x7521('0x3'));var VoiceQueue=require(_0x7521('0x4'));var Trigger=require('../model/trigger');var Template=require(_0x7521('0x5'));var Campaign=require(_0x7521('0x6'));var VoiceExtension=require(_0x7521('0x7'));var ZendeskAccount=require(_0x7521('0x8'));var SalesforceAccount=require(_0x7521('0x9'));var FreshdeskAccount=require(_0x7521('0xa'));var SugarcrmAccount=require(_0x7521('0xb'));var ZohoAccount=require(_0x7521('0xc'));var DeskAccount=require(_0x7521('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x7521('0xe'));var FreshsalesAccount=require(_0x7521('0xf'));var FaxAccount=require(_0x7521('0x10'));var Realtime=function(){this['agents']={};this[_0x7521('0x11')]={};this[_0x7521('0x12')]={};this[_0x7521('0x13')]={};this[_0x7521('0x14')]={};this['campaigns']={};this[_0x7521('0x15')]={};this[_0x7521('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x7521('0x17')]={};this[_0x7521('0x18')]={};this['queueChannels']={};this[_0x7521('0x19')]={};this[_0x7521('0x1a')]={};this['settings']={};this[_0x7521('0x1b')]={};this[_0x7521('0x1c')]={};this[_0x7521('0x1d')]={};this[_0x7521('0x1e')]={};this[_0x7521('0x1f')]={};this[_0x7521('0x20')]={};this['vtigerAccounts']={};this[_0x7521('0x21')]={};this['dynamics365Accounts']={};this[_0x7521('0x22')]={};this['faxAccounts']={};};function freeIsNotKey(_0x403149,_0x53dc8d,_0x57fed5){var _0x65bc77=_[_0x7521('0x23')](_0x403149,function(_0x3ededd,_0x1f733b){return _0x3ededd[_0x57fed5];});for(var _0x31a1c6 in _0x53dc8d){if(_0x53dc8d[_0x7521('0x24')](_0x31a1c6)){if(!_0x65bc77[_0x31a1c6]){delete _0x53dc8d[_0x31a1c6];}}}}function freeIsNotKeySip(_0x58783f,_0x1496a9){var _0x154f08=_[_0x7521('0x23')](_0x58783f,function(_0x2320f1,_0x1ae32b){return util[_0x7521('0x25')]('SIP/%s',_0x2320f1[_0x7521('0x26')]);});for(var _0xa1557f in _0x1496a9){if(_0x1496a9[_0x7521('0x24')](_0xa1557f)){if(!_0x154f08[_0xa1557f]){delete _0x1496a9[_0xa1557f];}}}}function freeIsNotKeyAgent(_0x39ae4b,_0x3bb6a9){var _0x467888=_[_0x7521('0x23')](_0x39ae4b,function(_0x486aff,_0x50e1d4){var _0x271560=_[_0x7521('0x27')](_0x486aff[_0x7521('0x28')])?util[_0x7521('0x25')](_0x7521('0x29'),_0x486aff['name']):_0x486aff[_0x7521('0x28')];return _0x271560;});for(var _0x40578e in _0x3bb6a9){if(_0x3bb6a9[_0x7521('0x24')](_0x40578e)){if(!_0x467888[_0x40578e]){delete _0x3bb6a9[_0x40578e];}}}}function clearVoiceCallReports(_0x185328){_0x185328[_0x7521('0x2a')]=0x0;_0x185328[_0x7521('0x2b')]=0x0;_0x185328[_0x7521('0x2c')]=0x0;_0x185328[_0x7521('0x2d')]=0x0;_0x185328[_0x7521('0x2e')]=0x0;}function clearCampaigns(_0x396e02){if(!_[_0x7521('0x2f')](_0x396e02)){for(var _0x4b1cdf in _0x396e02){if(_0x396e02[_0x7521('0x24')](_0x4b1cdf)){_0x396e02[_0x4b1cdf][_0x7521('0x30')]=0x0;_0x396e02[_0x4b1cdf][_0x7521('0x31')]=0x0;}}}}function clearVoiceQueues(_0x10f545){if(!_[_0x7521('0x2f')](_0x10f545)){for(var _0x7a9d94 in _0x10f545){if(_0x10f545[_0x7521('0x24')](_0x7a9d94)){_0x10f545[_0x7a9d94][_0x7521('0x2a')]=0x0;_0x10f545[_0x7a9d94][_0x7521('0x2b')]=0x0;_0x10f545[_0x7a9d94][_0x7521('0x32')]=0x0;_0x10f545[_0x7a9d94][_0x7521('0x33')]=0x0;_0x10f545[_0x7a9d94][_0x7521('0x2c')]=0x0;_0x10f545[_0x7a9d94][_0x7521('0x2d')]=0x0;_0x10f545[_0x7a9d94][_0x7521('0x2e')]=0x0;_0x10f545[_0x7a9d94][_0x7521('0x34')]=0x0;_0x10f545[_0x7a9d94][_0x7521('0x35')]=0x0;_0x10f545[_0x7a9d94][_0x7521('0x36')]=0x0;_0x10f545[_0x7a9d94]['outboundCongestionCallsDay']=0x0;_0x10f545[_0x7a9d94][_0x7521('0x37')]=0x0;_0x10f545[_0x7a9d94]['outboundUnknownCallsDay']=0x0;_0x10f545[_0x7a9d94][_0x7521('0x38')]=0x0;_0x10f545[_0x7a9d94][_0x7521('0x39')]=0x0;_0x10f545[_0x7a9d94]['outboundBlacklistCallsDay']=0x0;_0x10f545[_0x7a9d94][_0x7521('0x3a')]=0x0;_0x10f545[_0x7a9d94]['outboundRejectCallsDay']=0x0;_0x10f545[_0x7a9d94][_0x7521('0x3b')]=0x0;_0x10f545[_0x7a9d94]['outboundAnswerAgiCallsDay']=0x0;_0x10f545[_0x7a9d94]['outboundAnswerCallsDay']=0x0;_0x10f545[_0x7a9d94][_0x7521('0x3c')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x5bbea0,_0x6f72bd){for(var _0x580e5b in _0x6f72bd){if(_0x5bbea0['hasOwnProperty'](_0x580e5b)){_0x5bbea0[_0x580e5b]=_0x6f72bd[_0x580e5b];}}};Realtime[_0x7521('0x3d')]['initAgents']=function(){var _0xb9aece=this;return function(_0x232f10){if(_0x232f10){freeIsNotKeyAgent(_0x232f10,_0xb9aece[_0x7521('0x3e')]);for(var _0x47a8ee=0x0,_0x26c6f3={},_0x978df0={};_0x47a8ee<_0x232f10[_0x7521('0x3f')];_0x47a8ee+=0x1){_0x26c6f3=_0x232f10[_0x47a8ee];var _0x1d3078=_[_0x7521('0x27')](_0x26c6f3[_0x7521('0x28')])?util[_0x7521('0x25')](_0x7521('0x29'),_0x26c6f3[_0x7521('0x26')]):_0x26c6f3[_0x7521('0x28')];if(_['isUndefined'](_0xb9aece[_0x7521('0x3e')][_0x1d3078])){_0xb9aece[_0x7521('0x3e')][_0x1d3078]=new Agent(_0x26c6f3);}else{_0xb9aece[_0x7521('0x40')](_0xb9aece[_0x7521('0x3e')][_0x1d3078],_0x26c6f3);}}}return _0xb9aece['agents'];};};Realtime[_0x7521('0x3d')][_0x7521('0x41')]=function(){var _0x1d8043=this;return function(_0x341fe3){if(_0x341fe3){freeIsNotKeySip(_0x341fe3,_0x1d8043[_0x7521('0x11')]);for(var _0x37a56c=0x0,_0x5d239c={},_0x4a5279={};_0x37a56c<_0x341fe3['length'];_0x37a56c+=0x1){_0x5d239c=_0x341fe3[_0x37a56c];if(_[_0x7521('0x42')](_0x1d8043['telephones'][util['format']('SIP/%s',_0x5d239c['name'])])){_0x1d8043[_0x7521('0x11')][util[_0x7521('0x25')](_0x7521('0x29'),_0x5d239c[_0x7521('0x26')])]=new Telephone(_0x5d239c);}else{_0x1d8043[_0x7521('0x40')](_0x1d8043[_0x7521('0x11')][util['format'](_0x7521('0x29'),_0x5d239c[_0x7521('0x26')])],_0x5d239c);}}}return _0x1d8043[_0x7521('0x11')];};};Realtime['prototype']['initTrunks']=function(){var _0x468133=this;return function(_0x5bb7b3){if(_0x5bb7b3){freeIsNotKeySip(_0x5bb7b3,_0x468133[_0x7521('0x12')]);for(var _0x18e9cd=0x0,_0x112d20={},_0xabe43={};_0x18e9cd<_0x5bb7b3[_0x7521('0x3f')];_0x18e9cd+=0x1){_0x112d20=_0x5bb7b3[_0x18e9cd];if(_[_0x7521('0x42')](_0x468133[_0x7521('0x12')][util[_0x7521('0x25')](_0x7521('0x29'),_0x112d20[_0x7521('0x26')])])){_0x468133[_0x7521('0x12')][util['format'](_0x7521('0x29'),_0x112d20[_0x7521('0x26')])]=new Trunk(_0x112d20);}else{_0x468133['mergeFromDatabase'](_0x468133[_0x7521('0x12')][util[_0x7521('0x25')]('SIP/%s',_0x112d20[_0x7521('0x26')])],_0x112d20);}}}return _0x468133['trunks'];};};Realtime[_0x7521('0x3d')][_0x7521('0x43')]=function(){var _0x4d43d8=this;return function(_0xa478e4){if(_0xa478e4){freeIsNotKey(_0xa478e4,_0x4d43d8[_0x7521('0x13')],_0x7521('0x26'));for(var _0x2fee43=0x0,_0x42b9c9={},_0x507b37={};_0x2fee43<_0xa478e4[_0x7521('0x3f')];_0x2fee43+=0x1){_0x42b9c9=_0xa478e4[_0x2fee43];if(_[_0x7521('0x42')](_0x4d43d8['voiceQueues'][_0x42b9c9[_0x7521('0x26')]])){_0x4d43d8[_0x7521('0x13')][_0x42b9c9[_0x7521('0x26')]]=new VoiceQueue(_0x42b9c9);}else{_0x4d43d8[_0x7521('0x40')](_0x4d43d8[_0x7521('0x13')][_0x42b9c9[_0x7521('0x26')]],_0x42b9c9);}}}return _0x4d43d8[_0x7521('0x13')];};};Realtime['prototype'][_0x7521('0x44')]=function(){var _0x2e840f=this;return function(_0x464166){if(_0x464166){freeIsNotKey(_0x464166,_0x2e840f[_0x7521('0x14')],'id');for(var _0x5e002=0x0,_0x32267d={},_0x34090d={};_0x5e002<_0x464166[_0x7521('0x3f')];_0x5e002+=0x1){_0x32267d=_0x464166[_0x5e002];if(_[_0x7521('0x42')](_0x2e840f[_0x7521('0x14')][_0x32267d['id']])){_0x2e840f['triggers'][_0x32267d['id']]=new Trigger(_0x32267d);}else{_0x2e840f[_0x7521('0x40')](_0x2e840f['triggers'][_0x32267d['id']],_0x32267d);}}}return _0x2e840f[_0x7521('0x14')];};};Realtime[_0x7521('0x3d')][_0x7521('0x45')]=function(){var _0xa3a6a9=this;return function(_0x43fb5b){if(_0x43fb5b){freeIsNotKey(_0x43fb5b,_0xa3a6a9['templates'],'id');for(var _0x2ed974=0x0,_0x3f5f1a={},_0x156ad={};_0x2ed974<_0x43fb5b[_0x7521('0x3f')];_0x2ed974+=0x1){_0x3f5f1a=_0x43fb5b[_0x2ed974];if(_[_0x7521('0x42')](_0xa3a6a9[_0x7521('0x15')][_0x3f5f1a['id']])){_0xa3a6a9['templates'][_0x3f5f1a['id']]=new Template(_0x3f5f1a);}else{_0xa3a6a9[_0x7521('0x40')](_0xa3a6a9['templates'][_0x3f5f1a['id']],_0x3f5f1a);}}}return _0xa3a6a9[_0x7521('0x15')];};};Realtime[_0x7521('0x3d')]['initZendeskAccounts']=function(){var _0x1a93e3=this;return function(_0x9e2737){if(_0x9e2737){freeIsNotKey(_0x9e2737,_0x1a93e3[_0x7521('0x1b')],'id');for(var _0x1a6961=0x0,_0x517a2f={},_0x4d257b={};_0x1a6961<_0x9e2737[_0x7521('0x3f')];_0x1a6961+=0x1){_0x517a2f=_0x9e2737[_0x1a6961];if(_[_0x7521('0x42')](_0x1a93e3[_0x7521('0x1b')][_0x517a2f['id']])){_0x1a93e3[_0x7521('0x1b')][_0x517a2f['id']]=new ZendeskAccount(_0x517a2f);}else{_0x1a93e3[_0x7521('0x40')](_0x1a93e3[_0x7521('0x1b')][_0x517a2f['id']],_0x517a2f);}}}return _0x1a93e3[_0x7521('0x1b')];};};Realtime[_0x7521('0x3d')][_0x7521('0x46')]=function(){var _0x1f36c8=this;return function(_0x164340){if(_0x164340){freeIsNotKey(_0x164340,_0x1f36c8['salesforceAccounts'],'id');for(var _0x3b4a4a=0x0,_0xb432be={},_0x2dc7e7={};_0x3b4a4a<_0x164340[_0x7521('0x3f')];_0x3b4a4a+=0x1){_0xb432be=_0x164340[_0x3b4a4a];if(_[_0x7521('0x42')](_0x1f36c8[_0x7521('0x1c')][_0xb432be['id']])){_0x1f36c8['salesforceAccounts'][_0xb432be['id']]=new SalesforceAccount(_0xb432be);}else{_0x1f36c8[_0x7521('0x40')](_0x1f36c8[_0x7521('0x1c')][_0xb432be['id']],_0xb432be);}}}return _0x1f36c8[_0x7521('0x1c')];};};Realtime[_0x7521('0x3d')][_0x7521('0x47')]=function(){var _0x4d3c9c=this;return function(_0x3e777a){if(_0x3e777a){freeIsNotKey(_0x3e777a,_0x4d3c9c[_0x7521('0x1e')],'id');for(var _0xae1f71=0x0,_0x3b3a92={},_0x4c7401={};_0xae1f71<_0x3e777a[_0x7521('0x3f')];_0xae1f71+=0x1){_0x3b3a92=_0x3e777a[_0xae1f71];if(_[_0x7521('0x42')](_0x4d3c9c['freshdeskAccounts'][_0x3b3a92['id']])){_0x4d3c9c['freshdeskAccounts'][_0x3b3a92['id']]=new FreshdeskAccount(_0x3b3a92);}else{_0x4d3c9c[_0x7521('0x40')](_0x4d3c9c[_0x7521('0x1e')][_0x3b3a92['id']],_0x3b3a92);}}}return _0x4d3c9c[_0x7521('0x1e')];};};Realtime['prototype'][_0x7521('0x48')]=function(){var _0x5de443=this;return function(_0x3f1103){if(_0x3f1103){freeIsNotKey(_0x3f1103,_0x5de443['zohoAccounts'],'id');for(var _0x56b276=0x0,_0x2ebf29={},_0x500cb8={};_0x56b276<_0x3f1103[_0x7521('0x3f')];_0x56b276+=0x1){_0x2ebf29=_0x3f1103[_0x56b276];if(_['isUndefined'](_0x5de443[_0x7521('0x1f')][_0x2ebf29['id']])){_0x5de443['zohoAccounts'][_0x2ebf29['id']]=new ZohoAccount(_0x2ebf29);}else{_0x5de443[_0x7521('0x40')](_0x5de443[_0x7521('0x1f')][_0x2ebf29['id']],_0x2ebf29);}}}return _0x5de443['zohoAccounts'];};};Realtime[_0x7521('0x3d')][_0x7521('0x49')]=function(){var _0x28363a=this;return function(_0x4017ef){if(_0x4017ef){freeIsNotKey(_0x4017ef,_0x28363a['deskAccounts'],'id');for(var _0x33361a=0x0,_0x4c81a7={},_0x3e9b83={};_0x33361a<_0x4017ef[_0x7521('0x3f')];_0x33361a+=0x1){_0x4c81a7=_0x4017ef[_0x33361a];if(_[_0x7521('0x42')](_0x28363a[_0x7521('0x20')][_0x4c81a7['id']])){_0x28363a[_0x7521('0x20')][_0x4c81a7['id']]=new DeskAccount(_0x4c81a7);}else{_0x28363a[_0x7521('0x40')](_0x28363a[_0x7521('0x20')][_0x4c81a7['id']],_0x4c81a7);}}}return _0x28363a[_0x7521('0x20')];};};Realtime[_0x7521('0x3d')]['initSugarcrmAccounts']=function(){var _0x37d91f=this;return function(_0x4054fe){if(_0x4054fe){freeIsNotKey(_0x4054fe,_0x37d91f[_0x7521('0x1d')],'id');for(var _0xaeca94=0x0,_0x211bec={},_0x133892={};_0xaeca94<_0x4054fe[_0x7521('0x3f')];_0xaeca94+=0x1){_0x211bec=_0x4054fe[_0xaeca94];if(_[_0x7521('0x42')](_0x37d91f['sugarcrmAccounts'][_0x211bec['id']])){_0x37d91f[_0x7521('0x1d')][_0x211bec['id']]=new SugarcrmAccount(_0x211bec);}else{_0x37d91f[_0x7521('0x40')](_0x37d91f[_0x7521('0x1d')][_0x211bec['id']],_0x211bec);}}}return _0x37d91f[_0x7521('0x1d')];};};Realtime[_0x7521('0x3d')][_0x7521('0x4a')]=function(){var _0x35f9d4=this;return function(_0x3a785c){if(_0x3a785c){freeIsNotKey(_0x3a785c,_0x35f9d4[_0x7521('0x4b')],'id');for(var _0x3b04c0=0x0,_0x3be704={},_0x5c2fc6={};_0x3b04c0<_0x3a785c[_0x7521('0x3f')];_0x3b04c0+=0x1){_0x3be704=_0x3a785c[_0x3b04c0];if(_[_0x7521('0x42')](_0x35f9d4['vtigerAccounts'][_0x3be704['id']])){_0x35f9d4[_0x7521('0x4b')][_0x3be704['id']]=new VtigerAccount(_0x3be704);}else{_0x35f9d4[_0x7521('0x40')](_0x35f9d4[_0x7521('0x4b')][_0x3be704['id']],_0x3be704);}}}return _0x35f9d4[_0x7521('0x4b')];};};Realtime[_0x7521('0x3d')][_0x7521('0x4c')]=function(){var _0x5df884=this;return function(_0x4c43ea){if(_0x4c43ea){freeIsNotKey(_0x4c43ea,_0x5df884['servicenowAccounts'],'id');for(var _0x3233b5=0x0,_0x1e38cb={},_0x17491f={};_0x3233b5<_0x4c43ea[_0x7521('0x3f')];_0x3233b5+=0x1){_0x1e38cb=_0x4c43ea[_0x3233b5];if(_[_0x7521('0x42')](_0x5df884[_0x7521('0x21')][_0x1e38cb['id']])){_0x5df884[_0x7521('0x21')][_0x1e38cb['id']]=new ServicenowAccount(_0x1e38cb);}else{_0x5df884[_0x7521('0x40')](_0x5df884[_0x7521('0x21')][_0x1e38cb['id']],_0x1e38cb);}}}return _0x5df884[_0x7521('0x21')];};};Realtime[_0x7521('0x3d')][_0x7521('0x4d')]=function(){var _0x4ebb65=this;return function(_0x275153){if(_0x275153){freeIsNotKey(_0x275153,_0x4ebb65[_0x7521('0x4e')],'id');for(var _0x1e88e2=0x0,_0x5a0d2a={},_0x1acc59={};_0x1e88e2<_0x275153['length'];_0x1e88e2+=0x1){_0x5a0d2a=_0x275153[_0x1e88e2];if(_[_0x7521('0x42')](_0x4ebb65['dynamics365Accounts'][_0x5a0d2a['id']])){_0x4ebb65[_0x7521('0x4e')][_0x5a0d2a['id']]=new Dynamics365Account(_0x5a0d2a);}else{_0x4ebb65[_0x7521('0x40')](_0x4ebb65['dynamics365Accounts'][_0x5a0d2a['id']],_0x5a0d2a);}}}return _0x4ebb65[_0x7521('0x4e')];};};Realtime[_0x7521('0x3d')][_0x7521('0x4f')]=function(){var _0x44bd43=this;return function(_0x1c0d96){if(_0x1c0d96){freeIsNotKey(_0x1c0d96,_0x44bd43['freshsalesAccounts'],'id');for(var _0x2cd0e9=0x0,_0x4d79c3={},_0x25350d={};_0x2cd0e9<_0x1c0d96[_0x7521('0x3f')];_0x2cd0e9+=0x1){_0x4d79c3=_0x1c0d96[_0x2cd0e9];if(_[_0x7521('0x42')](_0x44bd43[_0x7521('0x22')][_0x4d79c3['id']])){_0x44bd43['freshsalesAccounts'][_0x4d79c3['id']]=new FreshsalesAccount(_0x4d79c3);}else{_0x44bd43[_0x7521('0x40')](_0x44bd43[_0x7521('0x22')][_0x4d79c3['id']],_0x4d79c3);}}}return _0x44bd43[_0x7521('0x22')];};};Realtime[_0x7521('0x3d')][_0x7521('0x50')]=function(){var _0x3ca2f2=this;return function(_0x23ed80){for(var _0x3da8ef=0x0;_0x3da8ef<_0x23ed80[_0x7521('0x3f')];_0x3da8ef+=0x1){_[_0x7521('0x51')](_0x3ca2f2[_0x7521('0x13')][_0x23ed80[_0x3da8ef][_0x7521('0x26')]],_0x23ed80[_0x3da8ef]);}return _0x3ca2f2[_0x7521('0x13')];};};Realtime[_0x7521('0x3d')]['initVoiceQueueReports']=function(){var _0x25b176=this;return function(_0x10e07e){clearVoiceQueues(_0x25b176[_0x7521('0x13')]);if(_0x10e07e){_0x10e07e=_['groupBy'](_0x10e07e,_0x7521('0x52'));for(var _0x268f46 in _0x10e07e){if(_0x10e07e[_0x7521('0x24')](_0x268f46)){var _0x56c32a={};for(var _0x277382=0x0;_0x277382<_0x10e07e[_0x268f46]['length'];_0x277382+=0x1){var _0xd8d5f6=_0x10e07e[_0x268f46][_0x277382][_0x7521('0x53')];if(_0x25b176[_0x7521('0x13')][_0xd8d5f6]){if(_0x10e07e[_0x268f46][_0x277382]['queuecallerexit']){_0x25b176[_0x7521('0x13')][_0xd8d5f6][_0x7521('0x32')]+=0x1;}if(_0x10e07e[_0x268f46][_0x277382][_0x7521('0x54')]){_0x25b176[_0x7521('0x13')][_0xd8d5f6][_0x7521('0x33')]+=0x1;}_0x25b176[_0x7521('0x13')][_0xd8d5f6][_0x7521('0x2c')]+=moment(_0x10e07e[_0x268f46][_0x277382][_0x7521('0x55')])[_0x7521('0x56')](moment(_0x10e07e[_0x268f46][_0x277382]['queuecallerjoinAt']),_0x7521('0x57'))||0x0;if(_0x277382===_0x10e07e[_0x268f46]['length']-0x1){_0x25b176[_0x7521('0x13')][_0xd8d5f6]['sumDuration']+=moment(_0x10e07e[_0x268f46][_0x277382][_0x7521('0x58')]||_0x10e07e[_0x268f46][_0x277382]['queuecallerabandonAt']||_0x10e07e[_0x268f46][_0x277382][_0x7521('0x59')])[_0x7521('0x56')](moment(_0x10e07e[_0x268f46][_0x277382][_0x7521('0x5a')]),_0x7521('0x57'))||0x0;_0x25b176[_0x7521('0x13')][_0xd8d5f6][_0x7521('0x2a')]+=0x1;if(_0x10e07e[_0x268f46][_0x277382]['queuecallercomplete']){_0x25b176[_0x7521('0x13')][_0xd8d5f6][_0x7521('0x2b')]+=0x1;_0x25b176[_0x7521('0x13')][_0xd8d5f6][_0x7521('0x2e')]+=moment(_0x10e07e[_0x268f46][_0x277382][_0x7521('0x58')])[_0x7521('0x56')](moment(_0x10e07e[_0x268f46][_0x277382][_0x7521('0x55')]),_0x7521('0x57'))||0x0;}}else{_0x25b176[_0x7521('0x13')][_0xd8d5f6][_0x7521('0x2d')]+=_0x25b176[_0x7521('0x13')][_0xd8d5f6]['sumHoldTime']||0x0;}}}}}}return _0x25b176['voiceQueues'];};};Realtime[_0x7521('0x3d')][_0x7521('0x5b')]=function(){var _0x22e25b=this;return function(_0x373162){clearVoiceCallReports(_0x22e25b[_0x7521('0x16')]);if(_0x373162){for(var _0x27d31e=0x0;_0x27d31e<_0x373162[_0x7521('0x3f')];_0x27d31e+=0x1){_0x22e25b[_0x7521('0x16')][_0x7521('0x2a')]+=0x1;_0x22e25b[_0x7521('0x16')][_0x7521('0x2d')]+=_0x373162[_0x27d31e]['duration'];if(_0x373162[_0x27d31e][_0x7521('0x5c')]===_0x7521('0x5d')){_0x22e25b[_0x7521('0x16')][_0x7521('0x2b')]+=0x1;_0x22e25b[_0x7521('0x16')][_0x7521('0x2c')]+=_0x373162[_0x27d31e][_0x7521('0x5e')]-_0x373162[_0x27d31e][_0x7521('0x5f')]||0x0;_0x22e25b[_0x7521('0x16')]['sumBillable']+=_0x373162[_0x27d31e][_0x7521('0x5f')];}}}return _0x22e25b[_0x7521('0x16')];};};Realtime[_0x7521('0x3d')][_0x7521('0x60')]=function(){var _0x324139=this;return function(_0x433cca){if(_0x433cca){freeIsNotKey(_0x433cca,_0x324139['campaigns'],_0x7521('0x26'));for(var _0x4aa651=0x0,_0x39f629={};_0x4aa651<_0x433cca['length'];_0x4aa651+=0x1){_0x39f629=_0x433cca[_0x4aa651];if(_[_0x7521('0x42')](_0x324139[_0x7521('0x61')][_0x39f629[_0x7521('0x26')]])){_0x324139[_0x7521('0x61')][_0x39f629[_0x7521('0x26')]]=new Campaign(_0x39f629);}else{_0x324139[_0x7521('0x40')](_0x324139[_0x7521('0x61')][_0x39f629[_0x7521('0x26')]],_0x39f629);_0x324139[_0x7521('0x61')][_0x39f629['name']]['dialQueueProject']=_0x39f629[_0x7521('0x62')]?_0x39f629[_0x7521('0x62')]['name']:undefined;}}}return _0x324139[_0x7521('0x61')];};};Realtime[_0x7521('0x3d')][_0x7521('0x63')]=function(){var _0x88057f=this;return function(_0x33a1f8){if(_0x33a1f8){freeIsNotKey(_0x33a1f8,_0x88057f[_0x7521('0x17')],'id');for(var _0x554b7b=0x0,_0x2f6c73={};_0x554b7b<_0x33a1f8[_0x7521('0x3f')];_0x554b7b+=0x1){_0x2f6c73=_0x33a1f8[_0x554b7b];if(_[_0x7521('0x42')](_0x88057f[_0x7521('0x17')][_0x2f6c73['id']])){_0x88057f['voiceExtensions'][_0x2f6c73['id']]=new VoiceExtension(_0x2f6c73);}else{_0x88057f[_0x7521('0x40')](_0x88057f[_0x7521('0x17')][_0x2f6c73['id']],_0x2f6c73);}}}return _0x88057f['voiceExtensions'];};};Realtime[_0x7521('0x3d')][_0x7521('0x64')]=function(){var _0x57fbda=this;return function(_0x435baf){clearCampaigns(_0x57fbda[_0x7521('0x61')]);for(var _0x4b0c00=0x0;_0x4b0c00<_0x435baf[_0x7521('0x3f')];_0x4b0c00+=0x1){_[_0x7521('0x51')](_0x57fbda[_0x7521('0x61')][_0x435baf[_0x4b0c00][_0x7521('0x26')]],_0x435baf[_0x4b0c00]);}return _0x57fbda[_0x7521('0x61')];};};Realtime[_0x7521('0x3d')][_0x7521('0x65')]=function(){var _0x196f03=this;return function(_0x46052e){if(_0x46052e){freeIsNotKey(_0x46052e,_0x196f03[_0x7521('0x66')],'id');for(var _0x2af9cb=0x0,_0x21ebfd={},_0xdd9c16={};_0x2af9cb<_0x46052e[_0x7521('0x3f')];_0x2af9cb+=0x1){_0x21ebfd=_0x46052e[_0x2af9cb];if(_[_0x7521('0x42')](_0x196f03[_0x7521('0x66')][_0x21ebfd['id']])){_0x196f03['faxAccounts'][_0x21ebfd['id']]=new FaxAccount(_0x21ebfd);}else{_0x196f03[_0x7521('0x40')](_0x196f03[_0x7521('0x66')][_0x21ebfd['id']],_0x21ebfd);}}}return _0x196f03[_0x7521('0x66')];};};module[_0x7521('0x67')]=Realtime;
\ No newline at end of file
+var _0xc3da=['deskAccounts','vtigerAccounts','servicenowAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','answered','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','isUndefined','telephones','length','initVoiceQueues','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initVtigerAccounts','initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','queuecallercompleteAt','diff','initVoiceCallReports','duration','disposition','ANSWERED','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','trunks','voiceQueues','triggers','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts'];(function(_0x28ddc5,_0x39a28c){var _0xa2ebf2=function(_0x373456){while(--_0x373456){_0x28ddc5['push'](_0x28ddc5['shift']());}};_0xa2ebf2(++_0x39a28c);}(_0xc3da,0x122));var _0xac3d=function(_0x53cc16,_0x1c0870){_0x53cc16=_0x53cc16-0x0;var _0x282f65=_0xc3da[_0x53cc16];return _0x282f65;};'use strict';var BPromise=require('bluebird');var util=require(_0xac3d('0x0'));var _=require(_0xac3d('0x1'));var moment=require(_0xac3d('0x2'));var Agent=require(_0xac3d('0x3'));var Telephone=require(_0xac3d('0x4'));var Trunk=require(_0xac3d('0x5'));var VoiceQueue=require(_0xac3d('0x6'));var Trigger=require(_0xac3d('0x7'));var Template=require('../model/template');var Campaign=require(_0xac3d('0x8'));var VoiceExtension=require(_0xac3d('0x9'));var ZendeskAccount=require(_0xac3d('0xa'));var SalesforceAccount=require(_0xac3d('0xb'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0xac3d('0xc'));var ZohoAccount=require(_0xac3d('0xd'));var DeskAccount=require(_0xac3d('0xe'));var VtigerAccount=require(_0xac3d('0xf'));var ServicenowAccount=require(_0xac3d('0x10'));var Dynamics365Account=require(_0xac3d('0x11'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xac3d('0x12'));var Realtime=function(){this[_0xac3d('0x13')]={};this['telephones']={};this[_0xac3d('0x14')]={};this[_0xac3d('0x15')]={};this[_0xac3d('0x16')]={};this['campaigns']={};this['templates']={};this[_0xac3d('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xac3d('0x18')]={};this[_0xac3d('0x19')]={};this[_0xac3d('0x1a')]={};this[_0xac3d('0x1b')]={};this[_0xac3d('0x1c')]={};this['settings']={};this[_0xac3d('0x1d')]={};this[_0xac3d('0x1e')]={};this[_0xac3d('0x1f')]={};this[_0xac3d('0x20')]={};this[_0xac3d('0x21')]={};this[_0xac3d('0x22')]={};this[_0xac3d('0x23')]={};this[_0xac3d('0x24')]={};this['dynamics365Accounts']={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x22ba28,_0x56caa4,_0x2913f6){var _0x459581=_['mapKeys'](_0x22ba28,function(_0x2c9de3,_0x3a2a4d){return _0x2c9de3[_0x2913f6];});for(var _0x3da7d6 in _0x56caa4){if(_0x56caa4['hasOwnProperty'](_0x3da7d6)){if(!_0x459581[_0x3da7d6]){delete _0x56caa4[_0x3da7d6];}}}}function freeIsNotKeySip(_0x80c892,_0x23c433){var _0x39ae34=_[_0xac3d('0x25')](_0x80c892,function(_0x3a31b2,_0x1c1632){return util[_0xac3d('0x26')](_0xac3d('0x27'),_0x3a31b2[_0xac3d('0x28')]);});for(var _0x54a4f2 in _0x23c433){if(_0x23c433[_0xac3d('0x29')](_0x54a4f2)){if(!_0x39ae34[_0x54a4f2]){delete _0x23c433[_0x54a4f2];}}}}function freeIsNotKeyAgent(_0x1f6d5c,_0x1c5cb2){var _0x288f6f=_[_0xac3d('0x25')](_0x1f6d5c,function(_0x5c6d6c,_0x32dde6){var _0x5ed1dd=_[_0xac3d('0x2a')](_0x5c6d6c['interface'])?util['format'](_0xac3d('0x27'),_0x5c6d6c[_0xac3d('0x28')]):_0x5c6d6c[_0xac3d('0x2b')];return _0x5ed1dd;});for(var _0x2640a6 in _0x1c5cb2){if(_0x1c5cb2[_0xac3d('0x29')](_0x2640a6)){if(!_0x288f6f[_0x2640a6]){delete _0x1c5cb2[_0x2640a6];}}}}function clearVoiceCallReports(_0x557ae6){_0x557ae6[_0xac3d('0x2c')]=0x0;_0x557ae6['answered']=0x0;_0x557ae6[_0xac3d('0x2d')]=0x0;_0x557ae6[_0xac3d('0x2e')]=0x0;_0x557ae6[_0xac3d('0x2f')]=0x0;}function clearCampaigns(_0xf75ca9){if(!_[_0xac3d('0x30')](_0xf75ca9)){for(var _0x1b6237 in _0xf75ca9){if(_0xf75ca9[_0xac3d('0x29')](_0x1b6237)){_0xf75ca9[_0x1b6237][_0xac3d('0x31')]=0x0;_0xf75ca9[_0x1b6237][_0xac3d('0x32')]=0x0;}}}}function clearVoiceQueues(_0x12a40c){if(!_[_0xac3d('0x30')](_0x12a40c)){for(var _0xc411cf in _0x12a40c){if(_0x12a40c['hasOwnProperty'](_0xc411cf)){_0x12a40c[_0xc411cf]['total']=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x33')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x34')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x35')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x2d')]=0x0;_0x12a40c[_0xc411cf]['sumDuration']=0x0;_0x12a40c[_0xc411cf]['sumBillable']=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x36')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x37')]=0x0;_0x12a40c[_0xc411cf]['outboundBusyCallsDay']=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x38')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x39')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3a')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3b')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3c')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3d')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3e')]=0x0;_0x12a40c[_0xc411cf]['outboundRejectCallsDay']=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x3f')]=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x36')]=0x0;_0x12a40c[_0xc411cf]['outboundAnswerCallsDay']=0x0;_0x12a40c[_0xc411cf][_0xac3d('0x40')]=!![];}}}}Realtime[_0xac3d('0x41')][_0xac3d('0x42')]=function(_0x28c41d,_0x398eaa){for(var _0x503bbb in _0x398eaa){if(_0x28c41d[_0xac3d('0x29')](_0x503bbb)){_0x28c41d[_0x503bbb]=_0x398eaa[_0x503bbb];}}};Realtime[_0xac3d('0x41')][_0xac3d('0x43')]=function(){var _0xb0a614=this;return function(_0x588edd){if(_0x588edd){freeIsNotKeyAgent(_0x588edd,_0xb0a614[_0xac3d('0x13')]);for(var _0x50c3dd=0x0,_0xca096a={},_0x3b9072={};_0x50c3dd<_0x588edd['length'];_0x50c3dd+=0x1){_0xca096a=_0x588edd[_0x50c3dd];var _0x165409=_[_0xac3d('0x2a')](_0xca096a[_0xac3d('0x2b')])?util['format'](_0xac3d('0x27'),_0xca096a[_0xac3d('0x28')]):_0xca096a[_0xac3d('0x2b')];if(_[_0xac3d('0x44')](_0xb0a614[_0xac3d('0x13')][_0x165409])){_0xb0a614[_0xac3d('0x13')][_0x165409]=new Agent(_0xca096a);}else{_0xb0a614[_0xac3d('0x42')](_0xb0a614[_0xac3d('0x13')][_0x165409],_0xca096a);}}}return _0xb0a614[_0xac3d('0x13')];};};Realtime[_0xac3d('0x41')]['initTelephones']=function(){var _0x3ed5d9=this;return function(_0x45c695){if(_0x45c695){freeIsNotKeySip(_0x45c695,_0x3ed5d9[_0xac3d('0x45')]);for(var _0x5de230=0x0,_0xe8820e={},_0x5d6ae5={};_0x5de230<_0x45c695[_0xac3d('0x46')];_0x5de230+=0x1){_0xe8820e=_0x45c695[_0x5de230];if(_['isUndefined'](_0x3ed5d9[_0xac3d('0x45')][util[_0xac3d('0x26')]('SIP/%s',_0xe8820e['name'])])){_0x3ed5d9[_0xac3d('0x45')][util[_0xac3d('0x26')](_0xac3d('0x27'),_0xe8820e[_0xac3d('0x28')])]=new Telephone(_0xe8820e);}else{_0x3ed5d9[_0xac3d('0x42')](_0x3ed5d9[_0xac3d('0x45')][util[_0xac3d('0x26')](_0xac3d('0x27'),_0xe8820e[_0xac3d('0x28')])],_0xe8820e);}}}return _0x3ed5d9[_0xac3d('0x45')];};};Realtime[_0xac3d('0x41')]['initTrunks']=function(){var _0x63700b=this;return function(_0x2aaff8){if(_0x2aaff8){freeIsNotKeySip(_0x2aaff8,_0x63700b[_0xac3d('0x14')]);for(var _0xdd1994=0x0,_0x1ba900={},_0x18eb21={};_0xdd1994<_0x2aaff8[_0xac3d('0x46')];_0xdd1994+=0x1){_0x1ba900=_0x2aaff8[_0xdd1994];if(_[_0xac3d('0x44')](_0x63700b[_0xac3d('0x14')][util[_0xac3d('0x26')](_0xac3d('0x27'),_0x1ba900['name'])])){_0x63700b[_0xac3d('0x14')][util['format']('SIP/%s',_0x1ba900[_0xac3d('0x28')])]=new Trunk(_0x1ba900);}else{_0x63700b['mergeFromDatabase'](_0x63700b['trunks'][util['format'](_0xac3d('0x27'),_0x1ba900[_0xac3d('0x28')])],_0x1ba900);}}}return _0x63700b['trunks'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x47')]=function(){var _0x1b117f=this;return function(_0x1c6ed4){if(_0x1c6ed4){freeIsNotKey(_0x1c6ed4,_0x1b117f[_0xac3d('0x15')],_0xac3d('0x28'));for(var _0x45df18=0x0,_0x30dab1={},_0x5d093c={};_0x45df18<_0x1c6ed4[_0xac3d('0x46')];_0x45df18+=0x1){_0x30dab1=_0x1c6ed4[_0x45df18];if(_[_0xac3d('0x44')](_0x1b117f[_0xac3d('0x15')][_0x30dab1[_0xac3d('0x28')]])){_0x1b117f[_0xac3d('0x15')][_0x30dab1[_0xac3d('0x28')]]=new VoiceQueue(_0x30dab1);}else{_0x1b117f[_0xac3d('0x42')](_0x1b117f[_0xac3d('0x15')][_0x30dab1[_0xac3d('0x28')]],_0x30dab1);}}}return _0x1b117f[_0xac3d('0x15')];};};Realtime[_0xac3d('0x41')]['initTriggers']=function(){var _0x547802=this;return function(_0x48cdd9){if(_0x48cdd9){freeIsNotKey(_0x48cdd9,_0x547802['triggers'],'id');for(var _0x1ec962=0x0,_0x5c902d={},_0x1dcae2={};_0x1ec962<_0x48cdd9[_0xac3d('0x46')];_0x1ec962+=0x1){_0x5c902d=_0x48cdd9[_0x1ec962];if(_[_0xac3d('0x44')](_0x547802[_0xac3d('0x16')][_0x5c902d['id']])){_0x547802[_0xac3d('0x16')][_0x5c902d['id']]=new Trigger(_0x5c902d);}else{_0x547802['mergeFromDatabase'](_0x547802[_0xac3d('0x16')][_0x5c902d['id']],_0x5c902d);}}}return _0x547802[_0xac3d('0x16')];};};Realtime[_0xac3d('0x41')][_0xac3d('0x48')]=function(){var _0xdb67e0=this;return function(_0xa34f1b){if(_0xa34f1b){freeIsNotKey(_0xa34f1b,_0xdb67e0[_0xac3d('0x49')],'id');for(var _0x486903=0x0,_0x5b8c3e={},_0x25e190={};_0x486903<_0xa34f1b[_0xac3d('0x46')];_0x486903+=0x1){_0x5b8c3e=_0xa34f1b[_0x486903];if(_[_0xac3d('0x44')](_0xdb67e0[_0xac3d('0x49')][_0x5b8c3e['id']])){_0xdb67e0[_0xac3d('0x49')][_0x5b8c3e['id']]=new Template(_0x5b8c3e);}else{_0xdb67e0[_0xac3d('0x42')](_0xdb67e0['templates'][_0x5b8c3e['id']],_0x5b8c3e);}}}return _0xdb67e0[_0xac3d('0x49')];};};Realtime['prototype'][_0xac3d('0x4a')]=function(){var _0x134015=this;return function(_0x2ccd9a){if(_0x2ccd9a){freeIsNotKey(_0x2ccd9a,_0x134015['zendeskAccounts'],'id');for(var _0x507133=0x0,_0x582928={},_0x2459fe={};_0x507133<_0x2ccd9a[_0xac3d('0x46')];_0x507133+=0x1){_0x582928=_0x2ccd9a[_0x507133];if(_[_0xac3d('0x44')](_0x134015[_0xac3d('0x1d')][_0x582928['id']])){_0x134015[_0xac3d('0x1d')][_0x582928['id']]=new ZendeskAccount(_0x582928);}else{_0x134015[_0xac3d('0x42')](_0x134015['zendeskAccounts'][_0x582928['id']],_0x582928);}}}return _0x134015[_0xac3d('0x1d')];};};Realtime['prototype'][_0xac3d('0x4b')]=function(){var _0x4809fd=this;return function(_0xc6e54a){if(_0xc6e54a){freeIsNotKey(_0xc6e54a,_0x4809fd[_0xac3d('0x1e')],'id');for(var _0x460101=0x0,_0x53a0b3={},_0x2feb83={};_0x460101<_0xc6e54a[_0xac3d('0x46')];_0x460101+=0x1){_0x53a0b3=_0xc6e54a[_0x460101];if(_[_0xac3d('0x44')](_0x4809fd[_0xac3d('0x1e')][_0x53a0b3['id']])){_0x4809fd[_0xac3d('0x1e')][_0x53a0b3['id']]=new SalesforceAccount(_0x53a0b3);}else{_0x4809fd[_0xac3d('0x42')](_0x4809fd[_0xac3d('0x1e')][_0x53a0b3['id']],_0x53a0b3);}}}return _0x4809fd[_0xac3d('0x1e')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x1a8091=this;return function(_0x2898b9){if(_0x2898b9){freeIsNotKey(_0x2898b9,_0x1a8091[_0xac3d('0x20')],'id');for(var _0x266d89=0x0,_0x5cb9fa={},_0x8084cb={};_0x266d89<_0x2898b9[_0xac3d('0x46')];_0x266d89+=0x1){_0x5cb9fa=_0x2898b9[_0x266d89];if(_[_0xac3d('0x44')](_0x1a8091[_0xac3d('0x20')][_0x5cb9fa['id']])){_0x1a8091[_0xac3d('0x20')][_0x5cb9fa['id']]=new FreshdeskAccount(_0x5cb9fa);}else{_0x1a8091[_0xac3d('0x42')](_0x1a8091[_0xac3d('0x20')][_0x5cb9fa['id']],_0x5cb9fa);}}}return _0x1a8091['freshdeskAccounts'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x4c')]=function(){var _0x57efb1=this;return function(_0x2b5cc0){if(_0x2b5cc0){freeIsNotKey(_0x2b5cc0,_0x57efb1[_0xac3d('0x21')],'id');for(var _0x456203=0x0,_0x4a969b={},_0x237d2f={};_0x456203<_0x2b5cc0[_0xac3d('0x46')];_0x456203+=0x1){_0x4a969b=_0x2b5cc0[_0x456203];if(_['isUndefined'](_0x57efb1[_0xac3d('0x21')][_0x4a969b['id']])){_0x57efb1['zohoAccounts'][_0x4a969b['id']]=new ZohoAccount(_0x4a969b);}else{_0x57efb1['mergeFromDatabase'](_0x57efb1[_0xac3d('0x21')][_0x4a969b['id']],_0x4a969b);}}}return _0x57efb1[_0xac3d('0x21')];};};Realtime['prototype'][_0xac3d('0x4d')]=function(){var _0xf236ef=this;return function(_0x48d9f7){if(_0x48d9f7){freeIsNotKey(_0x48d9f7,_0xf236ef['deskAccounts'],'id');for(var _0x591a68=0x0,_0x4feb40={},_0x12cd2d={};_0x591a68<_0x48d9f7['length'];_0x591a68+=0x1){_0x4feb40=_0x48d9f7[_0x591a68];if(_[_0xac3d('0x44')](_0xf236ef[_0xac3d('0x22')][_0x4feb40['id']])){_0xf236ef[_0xac3d('0x22')][_0x4feb40['id']]=new DeskAccount(_0x4feb40);}else{_0xf236ef[_0xac3d('0x42')](_0xf236ef[_0xac3d('0x22')][_0x4feb40['id']],_0x4feb40);}}}return _0xf236ef[_0xac3d('0x22')];};};Realtime[_0xac3d('0x41')]['initSugarcrmAccounts']=function(){var _0x2537ff=this;return function(_0x27a5ad){if(_0x27a5ad){freeIsNotKey(_0x27a5ad,_0x2537ff[_0xac3d('0x1f')],'id');for(var _0x505754=0x0,_0x21addf={},_0x23baef={};_0x505754<_0x27a5ad['length'];_0x505754+=0x1){_0x21addf=_0x27a5ad[_0x505754];if(_[_0xac3d('0x44')](_0x2537ff[_0xac3d('0x1f')][_0x21addf['id']])){_0x2537ff['sugarcrmAccounts'][_0x21addf['id']]=new SugarcrmAccount(_0x21addf);}else{_0x2537ff[_0xac3d('0x42')](_0x2537ff[_0xac3d('0x1f')][_0x21addf['id']],_0x21addf);}}}return _0x2537ff['sugarcrmAccounts'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x4e')]=function(){var _0xdad036=this;return function(_0x39d958){if(_0x39d958){freeIsNotKey(_0x39d958,_0xdad036[_0xac3d('0x23')],'id');for(var _0x15494f=0x0,_0x15cfbe={},_0x181465={};_0x15494f<_0x39d958[_0xac3d('0x46')];_0x15494f+=0x1){_0x15cfbe=_0x39d958[_0x15494f];if(_[_0xac3d('0x44')](_0xdad036[_0xac3d('0x23')][_0x15cfbe['id']])){_0xdad036[_0xac3d('0x23')][_0x15cfbe['id']]=new VtigerAccount(_0x15cfbe);}else{_0xdad036[_0xac3d('0x42')](_0xdad036[_0xac3d('0x23')][_0x15cfbe['id']],_0x15cfbe);}}}return _0xdad036[_0xac3d('0x23')];};};Realtime[_0xac3d('0x41')]['initServicenowAccounts']=function(){var _0x5abe7d=this;return function(_0x11eba1){if(_0x11eba1){freeIsNotKey(_0x11eba1,_0x5abe7d[_0xac3d('0x24')],'id');for(var _0x1cc6ee=0x0,_0x367f36={},_0x19d7fd={};_0x1cc6ee<_0x11eba1[_0xac3d('0x46')];_0x1cc6ee+=0x1){_0x367f36=_0x11eba1[_0x1cc6ee];if(_[_0xac3d('0x44')](_0x5abe7d['servicenowAccounts'][_0x367f36['id']])){_0x5abe7d[_0xac3d('0x24')][_0x367f36['id']]=new ServicenowAccount(_0x367f36);}else{_0x5abe7d[_0xac3d('0x42')](_0x5abe7d[_0xac3d('0x24')][_0x367f36['id']],_0x367f36);}}}return _0x5abe7d[_0xac3d('0x24')];};};Realtime['prototype'][_0xac3d('0x4f')]=function(){var _0x183675=this;return function(_0x5879da){if(_0x5879da){freeIsNotKey(_0x5879da,_0x183675[_0xac3d('0x50')],'id');for(var _0x25e970=0x0,_0x3d71ec={},_0x3c66bb={};_0x25e970<_0x5879da[_0xac3d('0x46')];_0x25e970+=0x1){_0x3d71ec=_0x5879da[_0x25e970];if(_[_0xac3d('0x44')](_0x183675['dynamics365Accounts'][_0x3d71ec['id']])){_0x183675['dynamics365Accounts'][_0x3d71ec['id']]=new Dynamics365Account(_0x3d71ec);}else{_0x183675[_0xac3d('0x42')](_0x183675[_0xac3d('0x50')][_0x3d71ec['id']],_0x3d71ec);}}}return _0x183675[_0xac3d('0x50')];};};Realtime[_0xac3d('0x41')][_0xac3d('0x51')]=function(){var _0xdc7f9e=this;return function(_0x23694c){if(_0x23694c){freeIsNotKey(_0x23694c,_0xdc7f9e[_0xac3d('0x52')],'id');for(var _0x4cf3ca=0x0,_0x4b3f7f={},_0x9b4c34={};_0x4cf3ca<_0x23694c[_0xac3d('0x46')];_0x4cf3ca+=0x1){_0x4b3f7f=_0x23694c[_0x4cf3ca];if(_[_0xac3d('0x44')](_0xdc7f9e[_0xac3d('0x52')][_0x4b3f7f['id']])){_0xdc7f9e[_0xac3d('0x52')][_0x4b3f7f['id']]=new FreshsalesAccount(_0x4b3f7f);}else{_0xdc7f9e['mergeFromDatabase'](_0xdc7f9e[_0xac3d('0x52')][_0x4b3f7f['id']],_0x4b3f7f);}}}return _0xdc7f9e[_0xac3d('0x52')];};};Realtime[_0xac3d('0x41')][_0xac3d('0x53')]=function(){var _0x56d4fd=this;return function(_0x2adb5e){for(var _0xd01360=0x0;_0xd01360<_0x2adb5e[_0xac3d('0x46')];_0xd01360+=0x1){_[_0xac3d('0x54')](_0x56d4fd[_0xac3d('0x15')][_0x2adb5e[_0xd01360][_0xac3d('0x28')]],_0x2adb5e[_0xd01360]);}return _0x56d4fd['voiceQueues'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x55')]=function(){var _0x61f8c=this;return function(_0x37c12d){clearVoiceQueues(_0x61f8c[_0xac3d('0x15')]);if(_0x37c12d){_0x37c12d=_['groupBy'](_0x37c12d,'uniqueid');for(var _0x4e3767 in _0x37c12d){if(_0x37c12d[_0xac3d('0x29')](_0x4e3767)){var _0x3d35f7={};for(var _0x3e59c9=0x0;_0x3e59c9<_0x37c12d[_0x4e3767][_0xac3d('0x46')];_0x3e59c9+=0x1){var _0x4981d9=_0x37c12d[_0x4e3767][_0x3e59c9]['queue'];if(_0x61f8c['voiceQueues'][_0x4981d9]){if(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x56')]){_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x34')]+=0x1;}if(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x57')]){_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x35')]+=0x1;}_0x61f8c['voiceQueues'][_0x4981d9][_0xac3d('0x2d')]+=moment(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x58')])['diff'](moment(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x59')]),_0xac3d('0x5a'))||0x0;if(_0x3e59c9===_0x37c12d[_0x4e3767][_0xac3d('0x46')]-0x1){_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x2e')]+=moment(_0x37c12d[_0x4e3767][_0x3e59c9]['queuecallercompleteAt']||_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x5b')]||_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x5c')])['diff'](moment(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x59')]),_0xac3d('0x5a'))||0x0;_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x2c')]+=0x1;if(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x5d')]){_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x33')]+=0x1;_0x61f8c[_0xac3d('0x15')][_0x4981d9]['sumBillable']+=moment(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x5e')])[_0xac3d('0x5f')](moment(_0x37c12d[_0x4e3767][_0x3e59c9][_0xac3d('0x58')]),_0xac3d('0x5a'))||0x0;}}else{_0x61f8c['voiceQueues'][_0x4981d9][_0xac3d('0x2e')]+=_0x61f8c[_0xac3d('0x15')][_0x4981d9][_0xac3d('0x2d')]||0x0;}}}}}}return _0x61f8c['voiceQueues'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x60')]=function(){var _0x4c6a52=this;return function(_0x8010b0){clearVoiceCallReports(_0x4c6a52[_0xac3d('0x17')]);if(_0x8010b0){for(var _0xfb7338=0x0;_0xfb7338<_0x8010b0[_0xac3d('0x46')];_0xfb7338+=0x1){_0x4c6a52[_0xac3d('0x17')][_0xac3d('0x2c')]+=0x1;_0x4c6a52['outbound'][_0xac3d('0x2e')]+=_0x8010b0[_0xfb7338][_0xac3d('0x61')];if(_0x8010b0[_0xfb7338][_0xac3d('0x62')]===_0xac3d('0x63')){_0x4c6a52['outbound'][_0xac3d('0x33')]+=0x1;_0x4c6a52[_0xac3d('0x17')]['sumHoldTime']+=_0x8010b0[_0xfb7338][_0xac3d('0x61')]-_0x8010b0[_0xfb7338]['billableseconds']||0x0;_0x4c6a52[_0xac3d('0x17')]['sumBillable']+=_0x8010b0[_0xfb7338]['billableseconds'];}}}return _0x4c6a52[_0xac3d('0x17')];};};Realtime['prototype'][_0xac3d('0x64')]=function(){var _0x412987=this;return function(_0x5bb4fe){if(_0x5bb4fe){freeIsNotKey(_0x5bb4fe,_0x412987[_0xac3d('0x65')],_0xac3d('0x28'));for(var _0x25df7b=0x0,_0x23ac15={};_0x25df7b<_0x5bb4fe['length'];_0x25df7b+=0x1){_0x23ac15=_0x5bb4fe[_0x25df7b];if(_[_0xac3d('0x44')](_0x412987[_0xac3d('0x65')][_0x23ac15[_0xac3d('0x28')]])){_0x412987[_0xac3d('0x65')][_0x23ac15[_0xac3d('0x28')]]=new Campaign(_0x23ac15);}else{_0x412987[_0xac3d('0x42')](_0x412987[_0xac3d('0x65')][_0x23ac15[_0xac3d('0x28')]],_0x23ac15);_0x412987[_0xac3d('0x65')][_0x23ac15[_0xac3d('0x28')]][_0xac3d('0x66')]=_0x23ac15[_0xac3d('0x67')]?_0x23ac15[_0xac3d('0x67')][_0xac3d('0x28')]:undefined;}}}return _0x412987[_0xac3d('0x65')];};};Realtime[_0xac3d('0x41')][_0xac3d('0x68')]=function(){var _0x2d5922=this;return function(_0x5839de){if(_0x5839de){freeIsNotKey(_0x5839de,_0x2d5922[_0xac3d('0x18')],'id');for(var _0x2e6bfd=0x0,_0x55d5ff={};_0x2e6bfd<_0x5839de[_0xac3d('0x46')];_0x2e6bfd+=0x1){_0x55d5ff=_0x5839de[_0x2e6bfd];if(_[_0xac3d('0x44')](_0x2d5922[_0xac3d('0x18')][_0x55d5ff['id']])){_0x2d5922['voiceExtensions'][_0x55d5ff['id']]=new VoiceExtension(_0x55d5ff);}else{_0x2d5922[_0xac3d('0x42')](_0x2d5922['voiceExtensions'][_0x55d5ff['id']],_0x55d5ff);}}}return _0x2d5922['voiceExtensions'];};};Realtime[_0xac3d('0x41')][_0xac3d('0x69')]=function(){var _0x1c706c=this;return function(_0x1313b6){clearCampaigns(_0x1c706c[_0xac3d('0x65')]);for(var _0xe6f00b=0x0;_0xe6f00b<_0x1313b6[_0xac3d('0x46')];_0xe6f00b+=0x1){_[_0xac3d('0x54')](_0x1c706c[_0xac3d('0x65')][_0x1313b6[_0xe6f00b][_0xac3d('0x28')]],_0x1313b6[_0xe6f00b]);}return _0x1c706c[_0xac3d('0x65')];};};Realtime[_0xac3d('0x41')]['initFaxAccounts']=function(){var _0xe73e29=this;return function(_0x2da814){if(_0x2da814){freeIsNotKey(_0x2da814,_0xe73e29[_0xac3d('0x6a')],'id');for(var _0x248fbb=0x0,_0x29302e={},_0x556a70={};_0x248fbb<_0x2da814[_0xac3d('0x46')];_0x248fbb+=0x1){_0x29302e=_0x2da814[_0x248fbb];if(_[_0xac3d('0x44')](_0xe73e29[_0xac3d('0x6a')][_0x29302e['id']])){_0xe73e29[_0xac3d('0x6a')][_0x29302e['id']]=new FaxAccount(_0x29302e);}else{_0xe73e29['mergeFromDatabase'](_0xe73e29[_0xac3d('0x6a')][_0x29302e['id']],_0x29302e);}}}return _0xe73e29[_0xac3d('0x6a')];};};module[_0xac3d('0x6b')]=Realtime;
\ No newline at end of file
index 0b211c2..d9cd724 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x401e=['destination','type','dialer','lastdata','queue','context','from-voip-provider','callerid','calleridnum','destinationchannel','channel','calleridpreview','originatecalleridnum','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','transfers','linkedid','monitor','monitors','length','filename','createdAt','exten','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','forEach','startsWith','indexOf','mobile','membername','exports','lodash','moment','util','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','find','accountcode','name','interface','SIP/%s','findAgent','assigned','lastAssignedTo','isNil','queuecallercomplete','format','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','match','voiceCallReport'];(function(_0x1becbc,_0x236529){var _0x4f4b45=function(_0x3ae864){while(--_0x3ae864){_0x1becbc['push'](_0x1becbc['shift']());}};_0x4f4b45(++_0x236529);}(_0x401e,0x157));var _0xe401=function(_0x5787ea,_0x4fb0c9){_0x5787ea=_0x5787ea-0x0;var _0x38b974=_0x401e[_0x5787ea];return _0x38b974;};'use strict';var _=require(_0xe401('0x0'));var moment=require(_0xe401('0x1'));var util=require(_0xe401('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xe401('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xe401('0x4'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xe401('0x5'));var RpcVoiceTransferReport=require(_0xe401('0x6'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xe401('0x7'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xe401('0x8'));var UserReport=require(_0xe401('0x9'));function Report(_0x481448){this[_0xe401('0xa')]=_0x481448;this[_0xe401('0xb')]=_0x481448[_0xe401('0xb')];this[_0xe401('0xc')]=_0x481448['telephones'];}Report['prototype']['sync']=function(_0x190951){var _0x88d3ad=new VoiceQueueReport(this['realtime']);var _0x44c70d=new VoiceAgentReport(this[_0xe401('0xa')]);var _0x52e65a=new VoiceDialReport(this[_0xe401('0xa')]);var _0x71d70f=new VoiceCallReport(this[_0xe401('0xa')]);var _0x595359=new UserReport(this['realtime']);if(config['xdr']&&config['xdr'][_0xe401('0xd')]){ami['on'](_0xe401('0xe'),this[_0xe401('0xf')][_0xe401('0x10')](this));ami['on'](_0xe401('0x11'),this['voiceCallReport'][_0xe401('0x10')](this));ami['on']('custom:voiceAgentReport',this[_0xe401('0x12')][_0xe401('0x10')](this));ami['on'](_0xe401('0x13'),this[_0xe401('0x14')][_0xe401('0x10')](this));ami['on'](_0xe401('0x15'),this[_0xe401('0x16')][_0xe401('0x10')](this));ami['on'](_0xe401('0x17'),this[_0xe401('0x18')]['bind'](this));}};Report[_0xe401('0x19')]['findAgent']=function(_0x5117d5){var _0x929890;_0x929890=_[_0xe401('0x1a')](this['agents'],function(_0xaa565){return _0xaa565[_0xe401('0x1b')]==_0x5117d5||_0xaa565['name']==_0x5117d5;});if(_['isNil'](_0x929890)){var _0x25f413=_['find'](this[_0xe401('0xc')],function(_0x1fa8a9){return _0x1fa8a9[_0xe401('0x1b')]==_0x5117d5||_0x1fa8a9[_0xe401('0x1c')]==_0x5117d5;});if(_0x25f413){_0x929890=_[_0xe401('0x1a')](this[_0xe401('0xb')],function(_0x4dfa34){return _0x4dfa34[_0xe401('0x1d')]==util['format'](_0xe401('0x1e'),_0x25f413[_0xe401('0x1c')]);});}}return _0x929890;};Report[_0xe401('0x19')][_0xe401('0xf')]=function(_0x359b8b){for(var _0x594e78=0x0;_0x594e78<_0x359b8b['length'];_0x594e78+=0x1){var _0x2e4692=this[_0xe401('0x1f')](_0x359b8b[_0x594e78]['connectedlinenum']);if(_0x2e4692){_0x359b8b[_0x594e78][_0xe401('0x1b')]=_0x2e4692[_0xe401('0x1b')];_0x359b8b[_0x594e78][_0xe401('0x20')]=!![];_0x359b8b[_0x594e78][_0xe401('0x21')]=_0x2e4692[_0xe401('0x1c')];_0x359b8b[_0x594e78][_0xe401('0x1d')]=_[_0xe401('0x22')](_0x2e4692[_0xe401('0x1d')])?util['format'](_0xe401('0x1e'),_0x2e4692[_0xe401('0x1c')]):_0x2e4692[_0xe401('0x1d')];if(_0x359b8b[_0x594e78][_0xe401('0x23')]){_0x359b8b[_0x594e78]['queuecallercompleteAt']=moment()[_0xe401('0x24')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x359b8b[_0x594e78]['queuecallerexit']){_0x359b8b[_0x594e78][_0xe401('0x25')]=moment()[_0xe401('0x24')](_0xe401('0x26'));}RpcMemberReport['voiceQueueReport'](_0x359b8b[_0x594e78]);}RpcVoiceQueueReport[_0xe401('0x27')](_0x359b8b[_0x594e78]);}};function extractCalleridNumber(_0x59c877){var _0x3ee5e3=_0x59c877[_0xe401('0x28')](/<(.*?)>/);return _0x3ee5e3?_0x3ee5e3[0x1]:_0x59c877;}Report['prototype'][_0xe401('0x29')]=function(_0x40e841){_0x40e841[_0xe401('0x2a')]=_0x40e841[_0xe401('0x2a')]||_0x40e841['exten'];if(_0x40e841[_0xe401('0x2b')]==_0xe401('0x2c')){_0x40e841['lastapplication']='queue';_0x40e841[_0xe401('0x2d')]=_0x40e841[_0xe401('0x2e')];if(_0x40e841[_0xe401('0x2f')]==_0xe401('0x30')){_0x40e841[_0xe401('0x1b')]='';_0x40e841[_0xe401('0x2a')]=extractCalleridNumber(_0x40e841[_0xe401('0x31')]);}else if(_0x40e841[_0xe401('0x2f')]=='from-sip'){if(_0x40e841[_0xe401('0x2a')]=='xcally-motion-preview'){_0x40e841['destination']=extractCalleridNumber(_0x40e841['calleridpreview']);_0x40e841[_0xe401('0x32')]=_0x40e841['originatecalleridnum'];_0x40e841[_0xe401('0x33')]=[_0x40e841[_0xe401('0x34')],_0x40e841[_0xe401('0x34')]=_0x40e841[_0xe401('0x33')]][0x0];_0x40e841['callerid']=_0x40e841[_0xe401('0x35')];}else{_0x40e841[_0xe401('0x2a')]=_0x40e841[_0xe401('0x32')];_0x40e841[_0xe401('0x32')]=_0x40e841[_0xe401('0x36')];if(_0x40e841[_0xe401('0x37')]==_0xe401('0x38')){_0x40e841[_0xe401('0x1b')]=_0x40e841[_0xe401('0x39')];}else{_0x40e841[_0xe401('0x1b')]='';}}}}else{_0x40e841[_0xe401('0x31')]=util[_0xe401('0x24')](_0xe401('0x3a'),_0x40e841['calleridname'],_0x40e841[_0xe401('0x32')]);}if(RpcVoiceTransferReport[_0xe401('0x3b')][_0x40e841['linkedid']]){var _0x17a32a=RpcVoiceTransferReport[_0xe401('0x3b')][_0x40e841[_0xe401('0x3c')]];_0x17a32a['transfereelinkedid']=_0x40e841['uniqueid'];RpcVoiceTransferReport[_0xe401('0x16')](_0x17a32a);delete RpcVoiceTransferReport[_0xe401('0x3b')][_0x40e841['linkedid']];}RpcVoiceCallReport[_0xe401('0x27')](_0x40e841);if(_0x40e841[_0xe401('0x3d')]){for(var _0x282a94=0x0;_0x282a94<_0x40e841[_0xe401('0x3e')][_0xe401('0x3f')];_0x282a94+=0x1){_0x40e841['monitorFilename']=_0x40e841[_0xe401('0x3e')][_0x282a94][_0xe401('0x40')];_0x40e841[_0xe401('0x41')]=_0x40e841[_0xe401('0x3e')][_0x282a94][_0xe401('0x41')];if(_0x40e841[_0xe401('0x42')]==_0xe401('0x43')){_0x40e841[_0xe401('0x32')]=_0x40e841[_0xe401('0x39')];_0x40e841['calleridname']=_0x40e841[_0xe401('0x44')];_0x40e841[_0xe401('0x39')]=_0x40e841[_0xe401('0x1b')];_0x40e841[_0xe401('0x44')]=_0x40e841['membername'];_0x40e841[_0xe401('0x42')]=_0x40e841[_0xe401('0x36')];}else if(_0x40e841[_0xe401('0x42')]==_0xe401('0x45')){_0x40e841[_0xe401('0x32')]=_0x40e841[_0xe401('0x2a')];_0x40e841['exten']=_0x40e841[_0xe401('0x36')];}RpcVoiceRecording[_0xe401('0x27')](_0x40e841);}}};Report[_0xe401('0x19')][_0xe401('0x12')]=function(_0x2d0484){if(_[_0xe401('0x46')](_0x2d0484)){_0x2d0484[_0xe401('0x47')](function(_0x8e39be){RpcVoiceAgentReport['create'](_0x8e39be);});}else{RpcVoiceAgentReport[_0xe401('0x27')](_0x2d0484);}};Report[_0xe401('0x19')]['voiceDialReport']=function(_0x11ae5d){RpcVoiceDialReport['create'](_0x11ae5d);var _0x465e8b;var _0x5a4239;var _0x2be190=_0x11ae5d[_0xe401('0x34')];if(_[_0xe401('0x48')](_0x2be190,'Local')){_0x5a4239=_0x2be190['substring'](_0x2be190['indexOf']('/')+0x1,_0x2be190[_0xe401('0x49')]('@'));_0x465e8b=_['find'](this[_0xe401('0xb')],function(_0x8434e){return _0x8434e[_0xe401('0x4a')]==_0x5a4239||_0x8434e['phone']==_0x5a4239||_0x8434e[_0xe401('0x1b')]==_0x5a4239;});}else{_0x5a4239=_0x2be190['substring'](_0x2be190[_0xe401('0x49')]('/')+0x1,_0x2be190['lastIndexOf']('-'));_0x465e8b=this['findAgent'](_0x5a4239);}if(_0x465e8b){_0x11ae5d[_0xe401('0x1d')]=_[_0xe401('0x22')](_0x465e8b['interface'])?util['format'](_0xe401('0x1e'),_0x465e8b[_0xe401('0x1c')]):_0x465e8b['interface'];_0x11ae5d[_0xe401('0x4b')]=_0x465e8b['name'];_0x11ae5d['accountcode']=_0x465e8b[_0xe401('0x1b')];RpcMemberReport[_0xe401('0x14')](_0x11ae5d);}};Report[_0xe401('0x19')]['blindTransfer']=function(_0x33caea){RpcVoiceTransferReport['transfers'][_0x33caea['transfererlinkedid']]=_0x33caea;};Report[_0xe401('0x19')][_0xe401('0x18')]=function(_0x439985){RpcVoiceTransferReport[_0xe401('0x18')](_0x439985);};module[_0xe401('0x4c')]=Report;
\ No newline at end of file
+var _0x59a7=['SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','linkedid','transfers','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','membername','xcally-motion-dialer','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','attendedTransfer','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','findAgent','find','name','isNil','accountcode','interface','format'];(function(_0x5d268f,_0x2ad284){var _0x120b94=function(_0x2c604f){while(--_0x2c604f){_0x5d268f['push'](_0x5d268f['shift']());}};_0x120b94(++_0x2ad284);}(_0x59a7,0x1e0));var _0x759a=function(_0x56d64b,_0x1f961a){_0x56d64b=_0x56d64b-0x0;var _0x41ef0d=_0x59a7[_0x56d64b];return _0x41ef0d;};'use strict';var _=require(_0x759a('0x0'));var moment=require(_0x759a('0x1'));var util=require(_0x759a('0x2'));var config=require(_0x759a('0x3'));var ami=require(_0x759a('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x759a('0x5'));var RpcMemberReport=require(_0x759a('0x6'));var RpcVoiceQueueReport=require(_0x759a('0x7'));var RpcVoiceRecording=require(_0x759a('0x8'));var RpcVoiceTransferReport=require(_0x759a('0x9'));var VoiceQueueReport=require(_0x759a('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x759a('0xb'));var VoiceDialReport=require(_0x759a('0xc'));var UserReport=require(_0x759a('0xd'));function Report(_0x56ebc6){this['realtime']=_0x56ebc6;this[_0x759a('0xe')]=_0x56ebc6[_0x759a('0xe')];this[_0x759a('0xf')]=_0x56ebc6[_0x759a('0xf')];}Report[_0x759a('0x10')][_0x759a('0x11')]=function(_0xdb84aa){var _0x114652=new VoiceQueueReport(this['realtime']);var _0x4e9492=new VoiceAgentReport(this['realtime']);var _0x245ec9=new VoiceDialReport(this['realtime']);var _0x3ee1c2=new VoiceCallReport(this['realtime']);var _0x27f561=new UserReport(this['realtime']);if(config[_0x759a('0x12')]&&config[_0x759a('0x12')][_0x759a('0x13')]){ami['on']('custom:voiceQueueReport',this[_0x759a('0x14')][_0x759a('0x15')](this));ami['on'](_0x759a('0x16'),this[_0x759a('0x17')][_0x759a('0x15')](this));ami['on'](_0x759a('0x18'),this[_0x759a('0x19')][_0x759a('0x15')](this));ami['on'](_0x759a('0x1a'),this[_0x759a('0x1b')][_0x759a('0x15')](this));ami['on']('blindtransfer',this[_0x759a('0x1c')][_0x759a('0x15')](this));ami['on']('attendedtransfer',this['attendedTransfer'][_0x759a('0x15')](this));}};Report[_0x759a('0x10')][_0x759a('0x1d')]=function(_0x57110e){var _0x3587c5;_0x3587c5=_[_0x759a('0x1e')](this[_0x759a('0xe')],function(_0x35348e){return _0x35348e['accountcode']==_0x57110e||_0x35348e[_0x759a('0x1f')]==_0x57110e;});if(_[_0x759a('0x20')](_0x3587c5)){var _0x3e6e53=_['find'](this['telephones'],function(_0x5c31e9){return _0x5c31e9[_0x759a('0x21')]==_0x57110e||_0x5c31e9[_0x759a('0x1f')]==_0x57110e;});if(_0x3e6e53){_0x3587c5=_[_0x759a('0x1e')](this[_0x759a('0xe')],function(_0x38f1da){return _0x38f1da[_0x759a('0x22')]==util[_0x759a('0x23')](_0x759a('0x24'),_0x3e6e53[_0x759a('0x1f')]);});}}return _0x3587c5;};Report[_0x759a('0x10')][_0x759a('0x14')]=function(_0x5e5a4c){for(var _0x521329=0x0;_0x521329<_0x5e5a4c[_0x759a('0x25')];_0x521329+=0x1){var _0x4788bf=this['findAgent'](_0x5e5a4c[_0x521329][_0x759a('0x26')]);if(_0x4788bf){_0x5e5a4c[_0x521329][_0x759a('0x21')]=_0x4788bf[_0x759a('0x21')];_0x5e5a4c[_0x521329][_0x759a('0x27')]=!![];_0x5e5a4c[_0x521329][_0x759a('0x28')]=_0x4788bf[_0x759a('0x1f')];_0x5e5a4c[_0x521329]['interface']=_[_0x759a('0x20')](_0x4788bf['interface'])?util[_0x759a('0x23')](_0x759a('0x24'),_0x4788bf[_0x759a('0x1f')]):_0x4788bf[_0x759a('0x22')];if(_0x5e5a4c[_0x521329][_0x759a('0x29')]){_0x5e5a4c[_0x521329][_0x759a('0x2a')]=moment()[_0x759a('0x23')](_0x759a('0x2b'));}if(_0x5e5a4c[_0x521329][_0x759a('0x2c')]){_0x5e5a4c[_0x521329][_0x759a('0x2d')]=moment()[_0x759a('0x23')](_0x759a('0x2b'));}RpcMemberReport[_0x759a('0x14')](_0x5e5a4c[_0x521329]);}RpcVoiceQueueReport[_0x759a('0x2e')](_0x5e5a4c[_0x521329]);}};function extractCalleridNumber(_0x18213d){var _0x2d1326=_0x18213d[_0x759a('0x2f')](/<(.*?)>/);return _0x2d1326?_0x2d1326[0x1]:_0x18213d;}Report[_0x759a('0x10')][_0x759a('0x17')]=function(_0xba5889){_0xba5889[_0x759a('0x30')]=_0xba5889[_0x759a('0x30')]||_0xba5889[_0x759a('0x31')];if(_0xba5889[_0x759a('0x32')]=='dialer'){_0xba5889[_0x759a('0x33')]=_0x759a('0x34');_0xba5889[_0x759a('0x35')]=_0xba5889[_0x759a('0x34')];if(_0xba5889['context']==_0x759a('0x36')){_0xba5889[_0x759a('0x21')]='';_0xba5889[_0x759a('0x30')]=extractCalleridNumber(_0xba5889[_0x759a('0x37')]);}else if(_0xba5889[_0x759a('0x38')]==_0x759a('0x39')){if(_0xba5889[_0x759a('0x30')]=='xcally-motion-preview'){_0xba5889['destination']=extractCalleridNumber(_0xba5889[_0x759a('0x3a')]);_0xba5889['calleridnum']=_0xba5889[_0x759a('0x3b')];_0xba5889[_0x759a('0x3c')]=[_0xba5889[_0x759a('0x3d')],_0xba5889[_0x759a('0x3d')]=_0xba5889['destinationchannel']][0x0];_0xba5889[_0x759a('0x37')]=_0xba5889[_0x759a('0x3a')];}else{_0xba5889[_0x759a('0x30')]=_0xba5889[_0x759a('0x3e')];_0xba5889[_0x759a('0x3e')]=_0xba5889['originatecalleridnum'];if(_0xba5889[_0x759a('0x3f')]=='ANSWERED'){_0xba5889[_0x759a('0x21')]=_0xba5889[_0x759a('0x26')];}else{_0xba5889[_0x759a('0x21')]='';}}}}else{_0xba5889[_0x759a('0x37')]=util[_0x759a('0x23')]('\x22%s\x22\x20<%s>',_0xba5889['calleridname'],_0xba5889['calleridnum']);}if(RpcVoiceTransferReport['transfers'][_0xba5889[_0x759a('0x40')]]){var _0x18cdd1=RpcVoiceTransferReport[_0x759a('0x41')][_0xba5889[_0x759a('0x40')]];_0x18cdd1[_0x759a('0x42')]=_0xba5889[_0x759a('0x43')];RpcVoiceTransferReport[_0x759a('0x1c')](_0x18cdd1);delete RpcVoiceTransferReport[_0x759a('0x41')][_0xba5889['linkedid']];}RpcVoiceCallReport['create'](_0xba5889);if(_0xba5889[_0x759a('0x44')]){for(var _0x7bcfed=0x0;_0x7bcfed<_0xba5889[_0x759a('0x45')][_0x759a('0x25')];_0x7bcfed+=0x1){_0xba5889[_0x759a('0x46')]=_0xba5889[_0x759a('0x45')][_0x7bcfed][_0x759a('0x47')];_0xba5889[_0x759a('0x48')]=_0xba5889[_0x759a('0x45')][_0x7bcfed][_0x759a('0x48')];if(_0xba5889[_0x759a('0x31')]=='xcally-motion-preview'){_0xba5889[_0x759a('0x3e')]=_0xba5889['connectedlinenum'];_0xba5889[_0x759a('0x49')]=_0xba5889[_0x759a('0x4a')];_0xba5889[_0x759a('0x26')]=_0xba5889[_0x759a('0x21')];_0xba5889['connectedlinename']=_0xba5889[_0x759a('0x4b')];_0xba5889[_0x759a('0x31')]=_0xba5889['originatecalleridnum'];}else if(_0xba5889[_0x759a('0x31')]==_0x759a('0x4c')){_0xba5889[_0x759a('0x3e')]=_0xba5889[_0x759a('0x30')];_0xba5889['exten']=_0xba5889[_0x759a('0x3b')];}RpcVoiceRecording[_0x759a('0x2e')](_0xba5889);}}};Report[_0x759a('0x10')][_0x759a('0x19')]=function(_0x10f308){if(_['isArray'](_0x10f308)){_0x10f308[_0x759a('0x4d')](function(_0x439284){RpcVoiceAgentReport[_0x759a('0x2e')](_0x439284);});}else{RpcVoiceAgentReport[_0x759a('0x2e')](_0x10f308);}};Report[_0x759a('0x10')]['voiceDialReport']=function(_0x4ab396){RpcVoiceDialReport['create'](_0x4ab396);var _0x440776;var _0x43e391;var _0x3c8663=_0x4ab396[_0x759a('0x3d')];if(_[_0x759a('0x4e')](_0x3c8663,'Local')){_0x43e391=_0x3c8663[_0x759a('0x4f')](_0x3c8663[_0x759a('0x50')]('/')+0x1,_0x3c8663[_0x759a('0x50')]('@'));_0x440776=_[_0x759a('0x1e')](this[_0x759a('0xe')],function(_0x348f52){return _0x348f52[_0x759a('0x51')]==_0x43e391||_0x348f52[_0x759a('0x52')]==_0x43e391||_0x348f52[_0x759a('0x21')]==_0x43e391;});}else{_0x43e391=_0x3c8663[_0x759a('0x4f')](_0x3c8663[_0x759a('0x50')]('/')+0x1,_0x3c8663[_0x759a('0x53')]('-'));_0x440776=this['findAgent'](_0x43e391);}if(_0x440776){_0x4ab396['interface']=_[_0x759a('0x20')](_0x440776['interface'])?util['format'](_0x759a('0x24'),_0x440776['name']):_0x440776[_0x759a('0x22')];_0x4ab396['membername']=_0x440776['name'];_0x4ab396[_0x759a('0x21')]=_0x440776[_0x759a('0x21')];RpcMemberReport[_0x759a('0x1b')](_0x4ab396);}};Report['prototype']['blindTransfer']=function(_0x577540){RpcVoiceTransferReport[_0x759a('0x41')][_0x577540[_0x759a('0x54')]]=_0x577540;};Report[_0x759a('0x10')][_0x759a('0x55')]=function(_0x32fbda){RpcVoiceTransferReport[_0x759a('0x55')](_0x32fbda);};module['exports']=Report;
\ No newline at end of file
index 056ec28..c0ddd2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcb7=['merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','format','trunk:%s','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','debug','[userReport][devicestatechange]','local','toLowerCase','inuse','toNumber','updateStatusRealtime','stateTime','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','substring','indexOf','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','../../../config/logger','../ami','redis','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','devicestatechange','syncDeviceState','bind','peerstatus','syncRealtimeShow','resolve','then','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','catch','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','find'];(function(_0x50b826,_0x13ed81){var _0x1f30ce=function(_0x51e294){while(--_0x51e294){_0x50b826['push'](_0x50b826['shift']());}};_0x1f30ce(++_0x13ed81);}(_0xdcb7,0x198));var _0x7dcb=function(_0x44cdf5,_0x979db8){_0x44cdf5=_0x44cdf5-0x0;var _0x31c53b=_0xdcb7[_0x44cdf5];return _0x31c53b;};'use strict';var _=require(_0x7dcb('0x0'));var moment=require(_0x7dcb('0x1'));var util=require(_0x7dcb('0x2'));var Redis=require(_0x7dcb('0x3'));var BPromise=require('bluebird');var config=require('../../../config/environment');var logger=require(_0x7dcb('0x4'))('ami');var ami=require(_0x7dcb('0x5'));config[_0x7dcb('0x6')]=_['defaults'](config[_0x7dcb('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x7dcb('0x7'))(new Redis(config['redis']));function UserReport(_0x4f93ee){this[_0x7dcb('0x8')]=_0x4f93ee[_0x7dcb('0x8')];this[_0x7dcb('0x9')]=_0x4f93ee[_0x7dcb('0x9')];this[_0x7dcb('0xa')]=_0x4f93ee[_0x7dcb('0xa')];ami['on'](_0x7dcb('0xb'),this[_0x7dcb('0xc')]['bind'](this));ami['on'](_0x7dcb('0xd'),this[_0x7dcb('0xc')]['bind'](this));ami['on'](_0x7dcb('0xe'),this[_0x7dcb('0xf')][_0x7dcb('0x10')](this));ami['on'](_0x7dcb('0x11'),this['syncPeerStatus'][_0x7dcb('0x10')](this));return this[_0x7dcb('0x12')]();}function showSipRegistrations(){Promise[_0x7dcb('0x13')]()[_0x7dcb('0x14')](ami['actionSipShowRegistry']())['catch'](function(_0x59ff53){logger[_0x7dcb('0x15')](_0x7dcb('0x16'),util[_0x7dcb('0x17')](_0x59ff53,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x7dcb('0x13')]()[_0x7dcb('0x14')](ami[_0x7dcb('0x18')]())[_0x7dcb('0x19')](function(_0x11f0a1){logger['error']('[userReport][devicestatelist]',util[_0x7dcb('0x17')](_0x11f0a1,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise['resolve']()[_0x7dcb('0x14')](ami[_0x7dcb('0x1a')]())[_0x7dcb('0x19')](function(_0x421045){logger['error'](_0x7dcb('0x1b'),util[_0x7dcb('0x17')](_0x421045,{'showHidden':![],'depth':null}));});}UserReport[_0x7dcb('0x1c')][_0x7dcb('0x12')]=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0x7dcb('0x14')](listDeviceStates())[_0x7dcb('0x14')](showPeersStatus());},0x32c8);};UserReport[_0x7dcb('0x1c')][_0x7dcb('0x1d')]=function(_0x497cc9){return _0x497cc9!==null&&!_['isUndefined'](_0x497cc9);};UserReport[_0x7dcb('0x1c')][_0x7dcb('0x1e')]=function(_0x135e0e,_0xc11f04,_0x20ae05){io['to'](_0x135e0e)['emit'](_0xc11f04,_0x20ae05);};UserReport[_0x7dcb('0x1c')][_0x7dcb('0xc')]=function(_0x14c8e5){try{if(this[_0x7dcb('0x1d')](_0x14c8e5)){logger[_0x7dcb('0x1f')](_0x7dcb('0x20'),_0x14c8e5[_0x7dcb('0x21')],_0x14c8e5[_0x7dcb('0x22')]);logger['debug']('[userReport][registry]',util['inspect'](_0x14c8e5,{'showHidden':![],'depth':null}));var _0x1f5b79=_[_0x7dcb('0x23')](this[_0x7dcb('0x8')],{'defaultuser':_0x14c8e5[_0x7dcb('0x21')]});if(_0x1f5b79){_0x14c8e5['stateRegistry']=_0x14c8e5['state'];_[_0x7dcb('0x24')](_0x1f5b79,_[_0x7dcb('0x25')](_0x14c8e5,[_0x7dcb('0x26'),_0x7dcb('0x27'),_0x7dcb('0x21'),_0x7dcb('0x22')]));logger['debug'](_0x7dcb('0x28'),util['inspect'](_0x1f5b79,{'showHidden':![],'depth':null}));this[_0x7dcb('0x1e')](util[_0x7dcb('0x29')](_0x7dcb('0x2a'),_0x1f5b79[_0x7dcb('0x2b')]),_0x7dcb('0x2c'),_0x1f5b79);}}}catch(_0x35413b){logger['error'](_0x7dcb('0x2d'),util[_0x7dcb('0x17')](_0x35413b,{'showHidden':![],'depth':null}));}};UserReport[_0x7dcb('0x1c')][_0x7dcb('0xf')]=function(_0x561f4d){try{if(this[_0x7dcb('0x1d')](_0x561f4d)){logger[_0x7dcb('0x1f')](_0x7dcb('0x2e'),_0x561f4d[_0x7dcb('0x2f')],_0x561f4d[_0x7dcb('0x22')]);logger[_0x7dcb('0x30')](_0x7dcb('0x31'),util[_0x7dcb('0x17')](_0x561f4d,{'showHidden':![],'depth':null}));if(this[_0x7dcb('0x9')][_0x561f4d['device']]){if(!this[_0x7dcb('0x9')][_0x561f4d[_0x7dcb('0x2f')]][_0x7dcb('0x32')]||_0x561f4d[_0x7dcb('0x22')][_0x7dcb('0x33')]()==_0x7dcb('0x34')){this[_0x7dcb('0x9')][_0x561f4d['device']]['local']=![];if(this[_0x7dcb('0x9')][_0x561f4d[_0x7dcb('0x2f')]][_0x7dcb('0x22')]!==_0x561f4d['state']['toLowerCase']()){this[_0x7dcb('0x9')][_0x561f4d['device']]['stateTime']=_[_0x7dcb('0x35')](moment()[_0x7dcb('0x29')]('x'));}this[_0x7dcb('0x9')][_0x561f4d[_0x7dcb('0x2f')]][_0x7dcb('0x22')]=_0x561f4d[_0x7dcb('0x22')]['toLowerCase']();this[_0x7dcb('0x9')][_0x561f4d['device']][_0x7dcb('0x36')](_0x561f4d);}}else if(this[_0x7dcb('0xa')][_0x561f4d[_0x7dcb('0x2f')]]){if(this[_0x7dcb('0xa')][_0x561f4d['device']][_0x7dcb('0x22')]!==_0x561f4d['state'][_0x7dcb('0x33')]()){this['telephones'][_0x561f4d[_0x7dcb('0x2f')]][_0x7dcb('0x37')]=_[_0x7dcb('0x35')](moment()['format']('x'));}this[_0x7dcb('0xa')][_0x561f4d[_0x7dcb('0x2f')]][_0x7dcb('0x22')]=_0x561f4d[_0x7dcb('0x22')]['toLowerCase']();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x7dcb('0x17')](this['telephones'][_0x561f4d[_0x7dcb('0x2f')]],{'showHidden':![],'depth':null}));this[_0x7dcb('0x1e')](util[_0x7dcb('0x29')](_0x7dcb('0x38'),this[_0x7dcb('0xa')][_0x561f4d[_0x7dcb('0x2f')]][_0x7dcb('0x2b')]),_0x7dcb('0x39'),this['telephones'][_0x561f4d['device']]);}else if(this['trunks'][_0x561f4d['device']]){if(this[_0x7dcb('0x8')][_0x561f4d[_0x7dcb('0x2f')]][_0x7dcb('0x22')]!==_0x561f4d[_0x7dcb('0x22')]['toLowerCase']()){this[_0x7dcb('0x8')][_0x561f4d['device']]['stateTime']=_[_0x7dcb('0x35')](moment()['format']('x'));}this[_0x7dcb('0x8')][_0x561f4d[_0x7dcb('0x2f')]][_0x7dcb('0x22')]=_0x561f4d[_0x7dcb('0x22')]['toLowerCase']();logger[_0x7dcb('0x30')](_0x7dcb('0x3a'),util[_0x7dcb('0x17')](this[_0x7dcb('0x8')][_0x561f4d['device']],{'showHidden':![],'depth':null}));this[_0x7dcb('0x1e')](util[_0x7dcb('0x29')]('trunk:%s',this['trunks'][_0x561f4d[_0x7dcb('0x2f')]][_0x7dcb('0x2b')]),'trunk:save',this[_0x7dcb('0x8')][_0x561f4d[_0x7dcb('0x2f')]]);}else if(_[_0x7dcb('0x3b')](_0x561f4d['device'],_0x7dcb('0x3c'))){var _0x49a4de=_0x561f4d[_0x7dcb('0x2f')];var _0x285ef9=_0x49a4de[_0x7dcb('0x3d')](_0x49a4de[_0x7dcb('0x3e')]('/')+0x1,_0x49a4de[_0x7dcb('0x3e')]('@'));var _0x4b8a72=_['find'](this[_0x7dcb('0x9')],function(_0x242bb5){return _0x242bb5[_0x7dcb('0x3f')]==_0x285ef9||_0x242bb5[_0x7dcb('0x40')]==_0x285ef9||_0x242bb5[_0x7dcb('0x41')]==_0x285ef9;});if(_0x4b8a72){if(_0x4b8a72[_0x7dcb('0x22')]!==_0x561f4d[_0x7dcb('0x22')][_0x7dcb('0x33')]()){_0x4b8a72[_0x7dcb('0x37')]=_['toNumber'](moment()['format']('x'));}_0x4b8a72[_0x7dcb('0x22')]=_0x561f4d[_0x7dcb('0x22')][_0x7dcb('0x33')]();_0x4b8a72[_0x7dcb('0x32')]=!![];_0x4b8a72[_0x7dcb('0x36')](_0x561f4d);}}}}catch(_0xc16304){logger[_0x7dcb('0x15')]('[userReport][devicestatechange]',util[_0x7dcb('0x17')](_0xc16304,{'showHidden':![],'depth':null}));}};UserReport[_0x7dcb('0x1c')]['syncPeerStatus']=function(_0x5cddd3){try{if(this['isNotNull'](_0x5cddd3)&&this['isNotNull'](_0x5cddd3['peerstatus'])){logger[_0x7dcb('0x1f')](_0x7dcb('0x42'),_0x5cddd3[_0x7dcb('0x43')],_0x5cddd3[_0x7dcb('0x44')],_0x5cddd3[_0x7dcb('0x11')]);logger[_0x7dcb('0x30')](_0x7dcb('0x45'),util['inspect'](_0x5cddd3,{'showHidden':![],'depth':null}));if(this[_0x7dcb('0x9')][_0x5cddd3[_0x7dcb('0x43')]]){if(!this['agents'][_0x5cddd3['peer']][_0x7dcb('0x32')]||_0x5cddd3[_0x7dcb('0x11')][_0x7dcb('0x33')]()=='registered'){this[_0x7dcb('0x9')][_0x5cddd3[_0x7dcb('0x43')]][_0x7dcb('0x32')]=![];this[_0x7dcb('0x9')][_0x5cddd3['peer']][_0x7dcb('0x46')]=_0x5cddd3[_0x7dcb('0x11')]['toLowerCase']();this[_0x7dcb('0x9')][_0x5cddd3['peer']][_0x7dcb('0x44')]=_0x5cddd3['address'];this[_0x7dcb('0x9')][_0x5cddd3[_0x7dcb('0x43')]][_0x7dcb('0x36')](_0x5cddd3);}}else if(this[_0x7dcb('0xa')][_0x5cddd3[_0x7dcb('0x43')]]){this[_0x7dcb('0xa')][_0x5cddd3['peer']][_0x7dcb('0x46')]=_0x5cddd3[_0x7dcb('0x11')][_0x7dcb('0x33')]();this[_0x7dcb('0xa')][_0x5cddd3[_0x7dcb('0x43')]][_0x7dcb('0x44')]=_0x5cddd3[_0x7dcb('0x44')];logger[_0x7dcb('0x30')](_0x7dcb('0x47'),util[_0x7dcb('0x17')](this[_0x7dcb('0xa')][_0x5cddd3[_0x7dcb('0x43')]],{'showHidden':![],'depth':null}));this[_0x7dcb('0x1e')](util[_0x7dcb('0x29')]('telephone:%s',this[_0x7dcb('0xa')][_0x5cddd3[_0x7dcb('0x43')]][_0x7dcb('0x2b')]),_0x7dcb('0x39'),this[_0x7dcb('0xa')][_0x5cddd3[_0x7dcb('0x43')]]);}else if(this[_0x7dcb('0x8')][_0x5cddd3['peer']]){this[_0x7dcb('0x8')][_0x5cddd3[_0x7dcb('0x43')]][_0x7dcb('0x46')]=_0x5cddd3[_0x7dcb('0x11')]['toLowerCase']();this[_0x7dcb('0x8')][_0x5cddd3[_0x7dcb('0x43')]][_0x7dcb('0x44')]=_0x5cddd3[_0x7dcb('0x44')];logger[_0x7dcb('0x30')](_0x7dcb('0x48'),util['inspect'](this['trunks'][_0x5cddd3['peer']],{'showHidden':![],'depth':null}));this['emit'](util[_0x7dcb('0x29')](_0x7dcb('0x2a'),this[_0x7dcb('0x8')][_0x5cddd3['peer']]['name']),_0x7dcb('0x2c'),this['trunks'][_0x5cddd3[_0x7dcb('0x43')]]);}}}catch(_0x3d6e15){logger[_0x7dcb('0x15')]('[userReport][peerstatus]',util[_0x7dcb('0x17')](_0x3d6e15,{'showHidden':![],'depth':null}));}};module[_0x7dcb('0x49')]=UserReport;
\ No newline at end of file
+var _0xb4db=['format','trunk:%s','trunk:save','device','[userReport][devicestatechange]','local','toLowerCase','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','name','telephone:save','startsWith','Local','substring','indexOf','mobile','phone','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','updateStatusRealtime','telephone:%s','exports','lodash','moment','util','ioredis','bluebird','../../../config/logger','ami','../ami','defaults','redis','localhost','trunks','agents','telephones','bind','syncRegistry','devicestatechange','syncDeviceState','syncPeerStatus','syncRealtimeShow','resolve','then','[userReport][sipshowregistry]','inspect','actionDeviceStateList','catch','error','[userReport][devicestatelist]','[userReport][sippeerstatus]','prototype','isUndefined','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','state','find','username','stateRegistry','omit','event','actionid','debug','[userReport][registry]\x20sending\x20trunk:save\x20event:'];(function(_0x188832,_0x49101d){var _0x2b990f=function(_0x231635){while(--_0x231635){_0x188832['push'](_0x188832['shift']());}};_0x2b990f(++_0x49101d);}(_0xb4db,0x17e));var _0xbb4d=function(_0x16ce67,_0x49b4a6){_0x16ce67=_0x16ce67-0x0;var _0x505405=_0xb4db[_0x16ce67];return _0x505405;};'use strict';var _=require(_0xbb4d('0x0'));var moment=require(_0xbb4d('0x1'));var util=require(_0xbb4d('0x2'));var Redis=require(_0xbb4d('0x3'));var BPromise=require(_0xbb4d('0x4'));var config=require('../../../config/environment');var logger=require(_0xbb4d('0x5'))(_0xbb4d('0x6'));var ami=require(_0xbb4d('0x7'));config['redis']=_[_0xbb4d('0x8')](config[_0xbb4d('0x9')],{'host':_0xbb4d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbb4d('0x9')]));function UserReport(_0x3e9662){this[_0xbb4d('0xb')]=_0x3e9662['trunks'];this[_0xbb4d('0xc')]=_0x3e9662[_0xbb4d('0xc')];this[_0xbb4d('0xd')]=_0x3e9662['telephones'];ami['on']('registryentry',this['syncRegistry'][_0xbb4d('0xe')](this));ami['on']('registry',this[_0xbb4d('0xf')][_0xbb4d('0xe')](this));ami['on'](_0xbb4d('0x10'),this[_0xbb4d('0x11')][_0xbb4d('0xe')](this));ami['on']('peerstatus',this[_0xbb4d('0x12')][_0xbb4d('0xe')](this));return this[_0xbb4d('0x13')]();}function showSipRegistrations(){Promise[_0xbb4d('0x14')]()[_0xbb4d('0x15')](ami['actionSipShowRegistry']())['catch'](function(_0x13c0a8){logger['error'](_0xbb4d('0x16'),util[_0xbb4d('0x17')](_0x13c0a8,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xbb4d('0x15')](ami[_0xbb4d('0x18')]())[_0xbb4d('0x19')](function(_0x3de31c){logger[_0xbb4d('0x1a')](_0xbb4d('0x1b'),util[_0xbb4d('0x17')](_0x3de31c,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xbb4d('0x14')]()[_0xbb4d('0x15')](ami['actionSipPeerStatus']())[_0xbb4d('0x19')](function(_0xe898d8){logger[_0xbb4d('0x1a')](_0xbb4d('0x1c'),util[_0xbb4d('0x17')](_0xe898d8,{'showHidden':![],'depth':null}));});}UserReport[_0xbb4d('0x1d')]['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xbb4d('0x14')]()[_0xbb4d('0x15')](showSipRegistrations())[_0xbb4d('0x15')](listDeviceStates())[_0xbb4d('0x15')](showPeersStatus());},0x32c8);};UserReport[_0xbb4d('0x1d')]['isNotNull']=function(_0x1d40d2){return _0x1d40d2!==null&&!_[_0xbb4d('0x1e')](_0x1d40d2);};UserReport['prototype'][_0xbb4d('0x1f')]=function(_0x1d409c,_0x3ed290,_0x686c3f){io['to'](_0x1d409c)[_0xbb4d('0x1f')](_0x3ed290,_0x686c3f);};UserReport['prototype'][_0xbb4d('0xf')]=function(_0x225275){try{if(this[_0xbb4d('0x20')](_0x225275)){logger[_0xbb4d('0x21')](_0xbb4d('0x22'),_0x225275['username'],_0x225275[_0xbb4d('0x23')]);logger['debug']('[userReport][registry]',util[_0xbb4d('0x17')](_0x225275,{'showHidden':![],'depth':null}));var _0x3ce1b7=_[_0xbb4d('0x24')](this[_0xbb4d('0xb')],{'defaultuser':_0x225275[_0xbb4d('0x25')]});if(_0x3ce1b7){_0x225275[_0xbb4d('0x26')]=_0x225275['state'];_['merge'](_0x3ce1b7,_[_0xbb4d('0x27')](_0x225275,[_0xbb4d('0x28'),_0xbb4d('0x29'),'username','state']));logger[_0xbb4d('0x2a')](_0xbb4d('0x2b'),util[_0xbb4d('0x17')](_0x3ce1b7,{'showHidden':![],'depth':null}));this[_0xbb4d('0x1f')](util[_0xbb4d('0x2c')](_0xbb4d('0x2d'),_0x3ce1b7['name']),_0xbb4d('0x2e'),_0x3ce1b7);}}}catch(_0x5736d1){logger[_0xbb4d('0x1a')]('[userReport][registry]',util['inspect'](_0x5736d1,{'showHidden':![],'depth':null}));}};UserReport[_0xbb4d('0x1d')][_0xbb4d('0x11')]=function(_0x21782b){try{if(this[_0xbb4d('0x20')](_0x21782b)){logger[_0xbb4d('0x21')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x21782b[_0xbb4d('0x2f')],_0x21782b[_0xbb4d('0x23')]);logger[_0xbb4d('0x2a')](_0xbb4d('0x30'),util[_0xbb4d('0x17')](_0x21782b,{'showHidden':![],'depth':null}));if(this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]]){if(!this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x31')]||_0x21782b[_0xbb4d('0x23')]['toLowerCase']()=='inuse'){this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x31')]=![];if(this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x23')]!==_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]()){this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x33')]=_[_0xbb4d('0x34')](moment()['format']('x'));}this[_0xbb4d('0xc')][_0x21782b[_0xbb4d('0x2f')]]['state']=_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]();this[_0xbb4d('0xc')][_0x21782b['device']]['updateStatusRealtime'](_0x21782b);}}else if(this[_0xbb4d('0xd')][_0x21782b[_0xbb4d('0x2f')]]){if(this['telephones'][_0x21782b['device']][_0xbb4d('0x23')]!==_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]()){this['telephones'][_0x21782b[_0xbb4d('0x2f')]]['stateTime']=_['toNumber'](moment()[_0xbb4d('0x2c')]('x'));}this[_0xbb4d('0xd')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x23')]=_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]();logger[_0xbb4d('0x2a')](_0xbb4d('0x35'),util[_0xbb4d('0x17')](this[_0xbb4d('0xd')][_0x21782b[_0xbb4d('0x2f')]],{'showHidden':![],'depth':null}));this[_0xbb4d('0x1f')](util['format']('telephone:%s',this[_0xbb4d('0xd')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x36')]),_0xbb4d('0x37'),this[_0xbb4d('0xd')][_0x21782b[_0xbb4d('0x2f')]]);}else if(this[_0xbb4d('0xb')][_0x21782b[_0xbb4d('0x2f')]]){if(this['trunks'][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x23')]!==_0x21782b['state'][_0xbb4d('0x32')]()){this[_0xbb4d('0xb')][_0x21782b[_0xbb4d('0x2f')]]['stateTime']=_['toNumber'](moment()[_0xbb4d('0x2c')]('x'));}this[_0xbb4d('0xb')][_0x21782b[_0xbb4d('0x2f')]][_0xbb4d('0x23')]=_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]();logger[_0xbb4d('0x2a')]('[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:',util[_0xbb4d('0x17')](this[_0xbb4d('0xb')][_0x21782b['device']],{'showHidden':![],'depth':null}));this[_0xbb4d('0x1f')](util[_0xbb4d('0x2c')](_0xbb4d('0x2d'),this[_0xbb4d('0xb')][_0x21782b[_0xbb4d('0x2f')]]['name']),_0xbb4d('0x2e'),this[_0xbb4d('0xb')][_0x21782b[_0xbb4d('0x2f')]]);}else if(_[_0xbb4d('0x38')](_0x21782b[_0xbb4d('0x2f')],_0xbb4d('0x39'))){var _0x1539f2=_0x21782b[_0xbb4d('0x2f')];var _0x59fce5=_0x1539f2[_0xbb4d('0x3a')](_0x1539f2[_0xbb4d('0x3b')]('/')+0x1,_0x1539f2[_0xbb4d('0x3b')]('@'));var _0x1ed32b=_[_0xbb4d('0x24')](this[_0xbb4d('0xc')],function(_0x27f55d){return _0x27f55d[_0xbb4d('0x3c')]==_0x59fce5||_0x27f55d[_0xbb4d('0x3d')]==_0x59fce5||_0x27f55d['accountcode']==_0x59fce5;});if(_0x1ed32b){if(_0x1ed32b['state']!==_0x21782b['state'][_0xbb4d('0x32')]()){_0x1ed32b[_0xbb4d('0x33')]=_[_0xbb4d('0x34')](moment()['format']('x'));}_0x1ed32b[_0xbb4d('0x23')]=_0x21782b[_0xbb4d('0x23')][_0xbb4d('0x32')]();_0x1ed32b[_0xbb4d('0x31')]=!![];_0x1ed32b['updateStatusRealtime'](_0x21782b);}}}}catch(_0x5a536f){logger[_0xbb4d('0x1a')](_0xbb4d('0x30'),util[_0xbb4d('0x17')](_0x5a536f,{'showHidden':![],'depth':null}));}};UserReport[_0xbb4d('0x1d')][_0xbb4d('0x12')]=function(_0x2023d3){try{if(this['isNotNull'](_0x2023d3)&&this[_0xbb4d('0x20')](_0x2023d3[_0xbb4d('0x3e')])){logger[_0xbb4d('0x21')](_0xbb4d('0x3f'),_0x2023d3[_0xbb4d('0x40')],_0x2023d3[_0xbb4d('0x41')],_0x2023d3[_0xbb4d('0x3e')]);logger[_0xbb4d('0x2a')]('[userReport][peerstatus]',util['inspect'](_0x2023d3,{'showHidden':![],'depth':null}));if(this[_0xbb4d('0xc')][_0x2023d3[_0xbb4d('0x40')]]){if(!this[_0xbb4d('0xc')][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x31')]||_0x2023d3[_0xbb4d('0x3e')][_0xbb4d('0x32')]()==_0xbb4d('0x42')){this[_0xbb4d('0xc')][_0x2023d3[_0xbb4d('0x40')]]['local']=![];this[_0xbb4d('0xc')][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x43')]=_0x2023d3[_0xbb4d('0x3e')][_0xbb4d('0x32')]();this[_0xbb4d('0xc')][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x41')]=_0x2023d3[_0xbb4d('0x41')];this[_0xbb4d('0xc')][_0x2023d3['peer']][_0xbb4d('0x44')](_0x2023d3);}}else if(this[_0xbb4d('0xd')][_0x2023d3[_0xbb4d('0x40')]]){this[_0xbb4d('0xd')][_0x2023d3[_0xbb4d('0x40')]]['status']=_0x2023d3[_0xbb4d('0x3e')]['toLowerCase']();this['telephones'][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x41')]=_0x2023d3[_0xbb4d('0x41')];logger[_0xbb4d('0x2a')]('[userReport][peerstatus]\x20sending\x20telephone:save\x20event:',util[_0xbb4d('0x17')](this[_0xbb4d('0xd')][_0x2023d3[_0xbb4d('0x40')]],{'showHidden':![],'depth':null}));this[_0xbb4d('0x1f')](util[_0xbb4d('0x2c')](_0xbb4d('0x45'),this[_0xbb4d('0xd')][_0x2023d3['peer']][_0xbb4d('0x36')]),_0xbb4d('0x37'),this[_0xbb4d('0xd')][_0x2023d3['peer']]);}else if(this['trunks'][_0x2023d3[_0xbb4d('0x40')]]){this[_0xbb4d('0xb')][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x43')]=_0x2023d3['peerstatus']['toLowerCase']();this[_0xbb4d('0xb')][_0x2023d3['peer']][_0xbb4d('0x41')]=_0x2023d3[_0xbb4d('0x41')];logger[_0xbb4d('0x2a')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util['inspect'](this['trunks'][_0x2023d3[_0xbb4d('0x40')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xbb4d('0x2c')](_0xbb4d('0x2d'),this[_0xbb4d('0xb')][_0x2023d3[_0xbb4d('0x40')]][_0xbb4d('0x36')]),_0xbb4d('0x2e'),this[_0xbb4d('0xb')][_0x2023d3[_0xbb4d('0x40')]]);}}}catch(_0x4b87b8){logger[_0xbb4d('0x1a')]('[userReport][peerstatus]',util[_0xbb4d('0x17')](_0x4b87b8,{'showHidden':![],'depth':null}));}};module[_0xbb4d('0x46')]=UserReport;
\ No newline at end of file
index 21cc9ee..2323b95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x42266a,_0x3ec675){var _0x108d9e=function(_0x24fc82){while(--_0x24fc82){_0x42266a['push'](_0x42266a['shift']());}};_0x108d9e(++_0x3ec675);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
+var _0xa9e0=['redis','defaults','localhost','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','info','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','uniqueid','YYYY-MM-DD\x20HH:mm:ss','queue','mandatoryDisposition','type','inbound','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','voiceChannels','routealias','interface','pick','destconnectedlinenum','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:%s','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answered_elsewhere','[%s][voiceAgentReport][agentconnect]','syncAgentRingNoAnswer','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','error','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','reason','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%s][voiceAgentReport][blindtransfer]','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]','lodash','moment','util','../../../config/logger','../ami'];(function(_0x3e92f3,_0x48d871){var _0x110145=function(_0x5472b3){while(--_0x5472b3){_0x3e92f3['push'](_0x3e92f3['shift']());}};_0x110145(++_0x48d871);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x0a9e('0x3'))('ami');var ami=require(_0x0a9e('0x4'));config[_0x0a9e('0x5')]=_[_0x0a9e('0x6')](config[_0x0a9e('0x5')],{'host':_0x0a9e('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0x5')]));function VoiceAgentReport(_0x441e3a){this[_0x0a9e('0x8')]={};this['voiceChannels']=_0x441e3a['channels'];this[_0x0a9e('0x9')]=_0x441e3a['voiceQueues'];this['agents']=_0x441e3a[_0x0a9e('0xa')];this[_0x0a9e('0xb')]={};ami['on'](_0x0a9e('0xc'),this[_0x0a9e('0xd')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x10'),this[_0x0a9e('0x11')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x12'),this[_0x0a9e('0x13')]['bind'](this));ami['on'](_0x0a9e('0x14'),this[_0x0a9e('0x15')][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0xe')](this));ami['on']('musiconholdstart',this[_0x0a9e('0x18')]['bind'](this));ami['on'](_0x0a9e('0x19'),this['syncMusicOnHoldStop'][_0x0a9e('0xe')](this));ami['on'](_0x0a9e('0x1a'),this['syncAttendedTransfer'][_0x0a9e('0xe')](this));ami['on']('blindtransfer',this[_0x0a9e('0x1b')][_0x0a9e('0xe')](this));}VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1d')]=function(_0x31b1ca,_0x2eb11f,_0x530eb7){io['to'](_0x31b1ca)[_0x0a9e('0x1d')](_0x2eb11f,_0x530eb7);};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1e')]=function(_0x1c696a){return _0x1c696a!==null&&!_[_0x0a9e('0x1f')](_0x1c696a);};VoiceAgentReport['prototype'][_0x0a9e('0xd')]=function(_0x155cce){try{if(this['isNotNull'](_0x155cce)){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x155cce['uniqueid'],_0x155cce[_0x0a9e('0x21')],_0x155cce[_0x0a9e('0x22')]);logger[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x155cce['uniqueid'],util[_0x0a9e('0x25')](_0x155cce,{'showHidden':![],'depth':null}));if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]]={};}if(_[_0x0a9e('0x1f')](this['channels'][_0x155cce['uniqueid']][_0x155cce[_0x0a9e('0x22')]])){this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]={'agentcalledAt':moment()['format'](_0x0a9e('0x27')),'lastevent':'called','mandatoryDisposition':this[_0x0a9e('0x9')][_0x155cce['queue']]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x29')]||![]:![],'type':this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]]?this[_0x0a9e('0x9')][_0x155cce[_0x0a9e('0x28')]][_0x0a9e('0x2a')]||'inbound':_0x0a9e('0x2b'),'variables':this[_0x0a9e('0xb')][_0x155cce[_0x0a9e('0x26')]]};}_[_0x0a9e('0x2c')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],_[_0x0a9e('0x2d')](_0x155cce,[_0x0a9e('0x2e'),_0x0a9e('0x2f')]));logger[_0x0a9e('0x23')](_0x0a9e('0x30'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x155cce[_0x0a9e('0x26')]][_0x155cce['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x31'),this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);logger['debug'](_0x0a9e('0x32'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')]('user:%s',_0x155cce[_0x0a9e('0x21')]),'user:called',this[_0x0a9e('0x8')][_0x155cce[_0x0a9e('0x26')]][_0x155cce[_0x0a9e('0x22')]]);}}catch(_0x3f3d41){logger['error'](_0x0a9e('0x34'),_0x155cce[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3f3d41,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncAgentConnect']=function(_0x54135e){try{if(this[_0x0a9e('0x1e')](_0x54135e)){if(this['channels'][_0x54135e[_0x0a9e('0x26')]]){logger[_0x0a9e('0x23')](_0x0a9e('0x35'),_0x54135e[_0x0a9e('0x26')],util['inspect'](_0x54135e,{'showHidden':![],'depth':null}));for(var _0x31916f in this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]]){if(this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x31916f)){if(_0x54135e[_0x0a9e('0x22')]===_0x31916f){logger['info']('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x54135e[_0x0a9e('0x26')],_0x54135e[_0x0a9e('0x21')],_0x54135e['destuniqueid']);this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x37')]=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x38')]=_0x54135e['connectedlinename'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x39')]=_0x54135e['connectedlinenum'];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3a')]=_0x54135e[_0x0a9e('0x3a')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3b')]=_0x54135e[_0x0a9e('0x3b')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3c')]=_0x54135e[_0x0a9e('0x3c')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3d')]='connect';if(this['voiceChannels'][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]]){var _0x315881=this[_0x0a9e('0x3e')][this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x26')]][_0x0a9e('0x3f')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x3f')]=_0x315881;_0x54135e['routealias']=_0x315881;}_[_0x0a9e('0x2c')](this[_0x0a9e('0xa')][_0x54135e[_0x0a9e('0x40')]],_[_0x0a9e('0x41')](_0x54135e,[_0x0a9e('0x28'),_0x0a9e('0x42'),_0x0a9e('0x3f')]));logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0a9e('0x43'),this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]]);logger[_0x0a9e('0x23')](_0x0a9e('0x44'),_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x54135e[_0x0a9e('0x22')]],{'showHidden':![],'depth':null}));this[_0x0a9e('0x1d')](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x54135e[_0x0a9e('0x21')]),_0x0a9e('0x46'),this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x54135e[_0x0a9e('0x22')]]);}else if(!this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']&&!this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x47'),_0x54135e[_0x0a9e('0x26')],this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x21')],_0x31916f);this['channels'][_0x54135e['uniqueid']][_0x31916f]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f][_0x0a9e('0x48')]=moment()['format'](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['answeredelsewheredestinationuniqueid']=_0x54135e[_0x0a9e('0x22')];this['channels'][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['answeredelsewheremembername']=_0x54135e[_0x0a9e('0x21')];this[_0x0a9e('0x8')][_0x54135e[_0x0a9e('0x26')]][_0x31916f]['lastevent']=_0x0a9e('0x49');this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f]['reason']=_0x0a9e('0x49');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x54135e[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x54135e['uniqueid']][_0x31916f],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentansweredelsewhere',this['channels'][_0x54135e['uniqueid']][_0x31916f]);}}}}}}catch(_0x2da03c){logger['error'](_0x0a9e('0x4a'),_0x54135e[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2da03c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x4b')]=function(_0x272738){try{if(this[_0x0a9e('0x1e')](_0x272738)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x272738[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x272738,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]]&&this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']]){logger[_0x0a9e('0x20')](_0x0a9e('0x4c'),_0x272738['uniqueid'],_0x272738[_0x0a9e('0x21')],_0x272738['destuniqueid']);this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738['destuniqueid']]['agentringnoanswer']=!![];this[_0x0a9e('0x8')][_0x272738['uniqueid']][_0x272738[_0x0a9e('0x22')]][_0x0a9e('0x48')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']][_0x0a9e('0x3d')]='rejected';this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]['reason']=_0x0a9e('0x4d');logger[_0x0a9e('0x23')](_0x0a9e('0x4e'),_0x272738[_0x0a9e('0x26')],util['inspect'](this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x4f'),this[_0x0a9e('0x8')][_0x272738[_0x0a9e('0x26')]][_0x272738[_0x0a9e('0x22')]]);}}}catch(_0x4d4a35){logger[_0x0a9e('0x50')](_0x0a9e('0x51'),_0x272738[_0x0a9e('0x26')],util['inspect'](_0x4d4a35,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncQueueCallerAbandon']=function(_0x5211e3){try{if(this[_0x0a9e('0x1e')](_0x5211e3)){logger[_0x0a9e('0x23')](_0x0a9e('0x52'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x5211e3,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){for(var _0x54a37d in this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x54a37d)&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]&&!this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]['agentcomplete']){logger[_0x0a9e('0x20')](_0x0a9e('0x54'),_0x5211e3[_0x0a9e('0x26')],this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x21')],_0x54a37d);this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x53')]=!![];this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x48')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x3d')]=_0x0a9e('0x55');this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d][_0x0a9e('0x56')]=_0x0a9e('0x55');logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this[_0x0a9e('0x8')][_0x5211e3['uniqueid']][_0x54a37d],{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')]('custom:agentqueuecallerabandon',this[_0x0a9e('0x8')][_0x5211e3[_0x0a9e('0x26')]][_0x54a37d]);}}}}}catch(_0x4c46c1){logger[_0x0a9e('0x50')](_0x0a9e('0x57'),_0x5211e3[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x4c46c1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x13')]=function(_0x2e9552){try{if(this[_0x0a9e('0x1e')](_0x2e9552)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2e9552,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){for(var _0x4abc8f in this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x4abc8f)){if(this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x37')]&&!this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x12')]){logger[_0x0a9e('0x20')](_0x0a9e('0x58'),_0x2e9552[_0x0a9e('0x26')],this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x21')],_0x4abc8f);this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f][_0x0a9e('0x12')]=!![];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x59')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]['lastevent']=_0x0a9e('0x5a');this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x56')]=_0x2e9552['reason']==_0x0a9e('0x5b')?_0x0a9e('0x5c'):_0x2e9552[_0x0a9e('0x56')];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5d')]=_0x2e9552[_0x0a9e('0x5d')];if(this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]&&this[_0x0a9e('0x9')][_0x2e9552[_0x0a9e('0x28')]][_0x0a9e('0x5e')]){this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x5f')]=this['voiceQueues'][_0x2e9552[_0x0a9e('0x28')]]['acwTimeout'];this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f][_0x0a9e('0x60')]=!![];}this[_0x0a9e('0xa')][_0x2e9552['interface']]=_['omit'](this[_0x0a9e('0xa')][_0x2e9552[_0x0a9e('0x40')]],[_0x0a9e('0x28'),'destconnectedlinenum']);logger[_0x0a9e('0x23')](_0x0a9e('0x61'),_0x2e9552['uniqueid'],util['inspect'](this[_0x0a9e('0x8')][_0x2e9552['uniqueid']][_0x4abc8f],{'showHidden':![],'depth':null}));ami['emit']('custom:agentcomplete',this[_0x0a9e('0x8')][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);logger[_0x0a9e('0x23')](_0x0a9e('0x62'),_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f],{'showHidden':![],'depth':null}));this['emit'](util[_0x0a9e('0x33')](_0x0a9e('0x45'),_0x2e9552[_0x0a9e('0x21')]),_0x0a9e('0x63'),this['channels'][_0x2e9552[_0x0a9e('0x26')]][_0x4abc8f]);}}}}}}catch(_0x32f761){logger[_0x0a9e('0x50')]('[%s][voiceAgentReport][agentcomplete]',_0x2e9552[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x32f761,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x15')]=function(_0x255e49){try{if(this[_0x0a9e('0x1e')](_0x255e49)){logger[_0x0a9e('0x23')](_0x0a9e('0x64'),_0x255e49['uniqueid'],util[_0x0a9e('0x25')](_0x255e49,{'showHidden':![],'depth':null}));this[_0x0a9e('0x65')](_0x255e49['uniqueid'],_[_0x0a9e('0x66')](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(this['channels'][_0x255e49[_0x0a9e('0x26')]]){for(var _0x52ec10 in this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]]){if(this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x0a9e('0x36')](_0x52ec10)){logger[_0x0a9e('0x20')](_0x0a9e('0x69'),_0x255e49[_0x0a9e('0x26')],_0x52ec10,_['keys'](_0x255e49[_0x0a9e('0x67')])[0x0],_0x255e49[_0x0a9e('0x68')]);if(_[_0x0a9e('0x1f')](this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')])){this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]={};}this[_0x0a9e('0x8')][_0x255e49[_0x0a9e('0x26')]][_0x52ec10][_0x0a9e('0xb')]=this[_0x0a9e('0xb')][_0x255e49['uniqueid']];}}}}}catch(_0xc81b64){logger[_0x0a9e('0x50')](_0x0a9e('0x6a'),_0x255e49[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xc81b64,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x0a9e('0x65')]=function(_0x1756c7,_0x5ce99d,_0x23b447){var _0x5e725e=[_0x0a9e('0x6b'),_0x0a9e('0x6c'),_0x0a9e('0x6d'),_0x0a9e('0x6e'),'rtpaudioqosloss',_0x0a9e('0x6f'),'rtpaudioqosrtt',_0x0a9e('0x70'),_0x0a9e('0x71'),'sipuri',_0x0a9e('0x72'),_0x0a9e('0x73'),_0x0a9e('0x74'),'memberdynamic','memberinterface',_0x0a9e('0x75'),_0x0a9e('0x21'),_0x0a9e('0x76'),_0x0a9e('0x77')];if(!_[_0x0a9e('0x78')](_0x5ce99d)&&!_[_0x0a9e('0x79')](_0x5e725e,_0x5ce99d)){if(_[_0x0a9e('0x1f')](this[_0x0a9e('0xb')][_0x1756c7])){this[_0x0a9e('0xb')][_0x1756c7]={};}this['variables'][_0x1756c7][_0x5ce99d]=_0x23b447;}};VoiceAgentReport[_0x0a9e('0x1c')]['syncHangup']=function(_0x287324){try{if(this[_0x0a9e('0x1e')](_0x287324)){logger[_0x0a9e('0x23')](_0x0a9e('0x7a'),_0x287324[_0x0a9e('0x26')],util['inspect'](_0x287324,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){for(var _0x2791c5 in this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]){if(this['channels'][_0x287324['uniqueid']][_0x0a9e('0x36')](_0x2791c5)){if(this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x56')]==_0x0a9e('0x5b')&&this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]][_0x2791c5][_0x0a9e('0x12')]){logger['info']('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x287324[_0x0a9e('0x26')],_0x2791c5);this['channels'][_0x287324[_0x0a9e('0x26')]][_0x2791c5]['agentcompleteAt']=moment()[_0x0a9e('0x33')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger['debug'](_0x0a9e('0x7b'),_0x287324[_0x0a9e('0x26')],util['inspect'](_[_0x0a9e('0x7c')](this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]]),{'showHidden':![],'depth':null}));ami[_0x0a9e('0x1d')](_0x0a9e('0x7d'),_['values'](this['channels'][_0x287324[_0x0a9e('0x26')]]));delete this[_0x0a9e('0x8')][_0x287324[_0x0a9e('0x26')]];}if(this[_0x0a9e('0xb')][_0x287324[_0x0a9e('0x26')]]){delete this['variables'][_0x287324[_0x0a9e('0x26')]];}}}catch(_0xadce3d){logger['error'](_0x0a9e('0x7e'),_0x287324[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0xadce3d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x7f')]=function(_0x23b39e){try{if(this[_0x0a9e('0x1e')](_0x23b39e)){logger[_0x0a9e('0x23')](_0x0a9e('0x80'),_0x23b39e[_0x0a9e('0x26')],util['inspect'](_0x23b39e,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){for(var _0x2ada60 in this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]]){if(this['channels'][_0x23b39e['transfereeuniqueid']][_0x0a9e('0x36')](_0x2ada60)){if(_0x23b39e[_0x0a9e('0x82')]===_0x2ada60){logger[_0x0a9e('0x20')](_0x0a9e('0x83'),_0x23b39e[_0x0a9e('0x26')],this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x21')],_0x2ada60);var _0x3450ae=moment();this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x23b39e['transfereeuniqueid']][_0x2ada60][_0x0a9e('0x59')]=moment()[_0x0a9e('0x33')](_0x0a9e('0x27'));this['channels'][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60]['lastevent']=_0x0a9e('0x5a');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x5d')]=_0x3450ae[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]][_0x2ada60][_0x0a9e('0x37')],_0x0a9e('0x85'));}}}}if(this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x86')]]){var _0x248368=this['channels'][_0x23b39e['secondtransfereruniqueid']];this[_0x0a9e('0x8')][_0x23b39e['secondtransfereruniqueid']]=this[_0x0a9e('0x8')][_0x23b39e[_0x0a9e('0x81')]];this['channels'][_0x23b39e[_0x0a9e('0x81')]]=_0x248368;}}}catch(_0xe2b083){logger[_0x0a9e('0x50')](_0x0a9e('0x87'),_0x23b39e['uniqueid'],util[_0x0a9e('0x25')](_0xe2b083,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')][_0x0a9e('0x1b')]=function(_0x34a791){try{if(this['isNotNull'](_0x34a791)){logger[_0x0a9e('0x23')](_0x0a9e('0x88'),_0x34a791[_0x0a9e('0x26')],util['inspect'](_0x34a791,{'showHidden':![],'depth':null}));if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]]){for(var _0x17b29d in this['channels'][_0x34a791[_0x0a9e('0x81')]]){if(this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x0a9e('0x36')](_0x17b29d)){if(_0x34a791[_0x0a9e('0x89')]===_0x17b29d){logger['info'](_0x0a9e('0x8a'),_0x34a791[_0x0a9e('0x26')],this['channels'][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x21')],_0x17b29d);var _0x1f6f1c=moment();this['channels'][_0x34a791['transfereeuniqueid']][_0x17b29d]['agentcomplete']=!![];this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d]['agentcompleteAt']=_0x1f6f1c;this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x3d')]='complete';this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x56')]=_0x0a9e('0x5b');this[_0x0a9e('0x8')][_0x34a791[_0x0a9e('0x81')]][_0x17b29d][_0x0a9e('0x5d')]=_0x1f6f1c[_0x0a9e('0x84')](this[_0x0a9e('0x8')][_0x34a791['transfereeuniqueid']][_0x17b29d][_0x0a9e('0x37')],'seconds');}}}}}}catch(_0x138cf5){logger[_0x0a9e('0x50')](_0x0a9e('0x8b'),_0x34a791[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x138cf5,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStart']=function(_0x1a0314){var _0x33da81='';try{if(this[_0x0a9e('0x1e')](_0x1a0314)){logger[_0x0a9e('0x23')]('[%s][voiceAgentReport][musiconholdstart]\x20event:',_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x1a0314,{'showHidden':![],'depth':null}));if(_0x1a0314[_0x0a9e('0x8c')]){_0x33da81=_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x1a0314[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0x33da81]){logger[_0x0a9e('0x20')](_0x0a9e('0x8f'),_0x1a0314['uniqueid'],_0x33da81);this[_0x0a9e('0xa')][_0x33da81][_0x0a9e('0x90')]=!![];}}}}catch(_0x2ff265){logger[_0x0a9e('0x50')](_0x0a9e('0x91'),_0x1a0314[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x2ff265,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x0a9e('0x1c')]['syncMusicOnHoldStop']=function(_0x3b581c){var _0xd2391='';try{if(this[_0x0a9e('0x1e')](_0x3b581c)){logger['debug'](_0x0a9e('0x92'),_0x3b581c[_0x0a9e('0x26')],util[_0x0a9e('0x25')](_0x3b581c,{'showHidden':![],'depth':null}));if(_0x3b581c[_0x0a9e('0x8c')]){_0xd2391=_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8d')](0x0,_0x3b581c[_0x0a9e('0x8c')][_0x0a9e('0x8e')]('-'));if(this[_0x0a9e('0xa')][_0xd2391]){logger[_0x0a9e('0x20')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x3b581c[_0x0a9e('0x26')],_0xd2391);this[_0x0a9e('0xa')][_0xd2391][_0x0a9e('0x90')]=![];}}}}catch(_0x3db98f){logger[_0x0a9e('0x50')](_0x0a9e('0x93'),_0x3b581c['uniqueid'],util[_0x0a9e('0x25')](_0x3db98f,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport;
\ No newline at end of file
index 39dd9f5..58cc7f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc475=['from-sip','channel','split','xcally-motion-preview','connectedlinenum','format','name','accountcode','[%s][voiceCallReport][newcallerid]','debug','[%s][voiceCallReport][newchannel]\x20event:','linkedid','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','merge','isUndefined','destconnectedlinenum','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','subtract','duration','seconds','lastdata','set','cdr(','error','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','membername','UserId','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','user:%s','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','value','xmd-phone','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','sipcallid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','getSettings','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfererchannel','BLIND','[%s][voiceCallReport][blindtransfer]','isNil','mohstarttime','[%s][voiceCallReport][musiconholdstart]','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','exports','moment','util','path','ioredis','../../../config/environment','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','queue','playback','voicemail','NO\x20ANSWER','FAILED','BUSY','defaults','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','[voiceCallReport][coreshowchannels]','prototype','isNotNull','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','inspect','pick','keys'];(function(_0x587693,_0x27fe90){var _0x510a1a=function(_0x290f71){while(--_0x290f71){_0x587693['push'](_0x587693['shift']());}};_0x510a1a(++_0x27fe90);}(_0xc475,0x158));var _0x5c47=function(_0x1c2d97,_0x2f821a){_0x1c2d97=_0x1c2d97-0x0;var _0xf11a0=_0xc475[_0x1c2d97];return _0xf11a0;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require(_0x5c47('0x0'));var util=require(_0x5c47('0x1'));var path=require(_0x5c47('0x2'));var Redis=require(_0x5c47('0x3'));var config=require(_0x5c47('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x5c47('0x5'));var Channel=require(_0x5c47('0x6'));var RpcSetting=require(_0x5c47('0x7'));var statusDesc=[_0x5c47('0x8'),_0x5c47('0x9'),_0x5c47('0xa'),_0x5c47('0xb'),_0x5c47('0xc'),_0x5c47('0xd'),_0x5c47('0xe'),_0x5c47('0xf'),'onhold'];var applications=['set',_0x5c47('0x10'),'agi','dial',_0x5c47('0x11'),_0x5c47('0x12')];var dispositions=[_0x5c47('0x13'),'FAILED',_0x5c47('0x14'),_0x5c47('0x13'),_0x5c47('0x13'),_0x5c47('0x13'),'ANSWERED',_0x5c47('0x15'),_0x5c47('0x14'),_0x5c47('0x14'),'FAILED'];var actions={};config['redis']=_[_0x5c47('0x16')](config[_0x5c47('0x17')],{'host':_0x5c47('0x18'),'port':0x18eb});var io=require(_0x5c47('0x19'))(new Redis(config[_0x5c47('0x17')]));function VoiceCallReport(_0xfe2df5){this['channels']=_0xfe2df5[_0x5c47('0x1a')];this[_0x5c47('0x1b')]=_0xfe2df5[_0x5c47('0x1b')];this[_0x5c47('0x1c')]={};ami['on'](_0x5c47('0x1d'),this[_0x5c47('0x1e')][_0x5c47('0x1f')](this));ami['on'](_0x5c47('0x20'),this[_0x5c47('0x1e')][_0x5c47('0x1f')](this));ami['on'](_0x5c47('0x21'),this[_0x5c47('0x22')][_0x5c47('0x1f')](this));ami['on'](_0x5c47('0x23'),this[_0x5c47('0x24')][_0x5c47('0x1f')](this));ami['on']('varset',this[_0x5c47('0x25')][_0x5c47('0x1f')](this));ami['on']('hangup',this[_0x5c47('0x26')][_0x5c47('0x1f')](this));ami['on'](_0x5c47('0x27'),this[_0x5c47('0x28')][_0x5c47('0x1f')](this));ami['on'](_0x5c47('0x29'),this[_0x5c47('0x2a')]['bind'](this));ami['on'](_0x5c47('0x2b'),this[_0x5c47('0x2c')][_0x5c47('0x1f')](this));ami['on'](_0x5c47('0x2d'),this[_0x5c47('0x2e')][_0x5c47('0x1f')](this));ami['on']('musiconholdstop',this[_0x5c47('0x2f')][_0x5c47('0x1f')](this));try{logger[_0x5c47('0x30')](_0x5c47('0x31'));ami['actionCoreShowChannels']();}catch(_0x26aa8e){logger['error'](_0x5c47('0x32'),util['inspect'](_0x26aa8e,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x5c47('0x33')][_0x5c47('0x34')]=function(_0x3f8b66){return _0x3f8b66!==null&&!_['isUndefined'](_0x3f8b66);};VoiceCallReport[_0x5c47('0x33')][_0x5c47('0x35')]=function(_0x5d6419,_0xa7aee2,_0x4a1be8){io['to'](_0x5d6419)[_0x5c47('0x35')](_0xa7aee2,_0x4a1be8);};VoiceCallReport[_0x5c47('0x33')]['syncNewCallerId']=function(_0x1f7f75){try{if(this['isNotNull'](_0x1f7f75)){logger[_0x5c47('0x30')](_0x5c47('0x36'),_0x1f7f75[_0x5c47('0x37')],_0x1f7f75[_0x5c47('0x38')],_0x1f7f75[_0x5c47('0x39')]);logger['debug'](_0x5c47('0x3a'),_0x1f7f75['uniqueid'],util[_0x5c47('0x3b')](_0x1f7f75,{'showHidden':![],'depth':null}));if(_0x1f7f75[_0x5c47('0x37')]===_0x1f7f75['linkedid']){if(!_['isUndefined'](this[_0x5c47('0x1a')][_0x1f7f75[_0x5c47('0x37')]])){_['merge'](this[_0x5c47('0x1a')][_0x1f7f75['uniqueid']],_[_0x5c47('0x3c')](_0x1f7f75,_[_0x5c47('0x3d')](this[_0x5c47('0x1a')][_0x1f7f75[_0x5c47('0x37')]])));}}if(_0x1f7f75['context']===_0x5c47('0x3e')){if(this[_0x5c47('0x1b')][_0x1f7f75[_0x5c47('0x3f')][_0x5c47('0x40')]('-')[0x0]]){if(_0x1f7f75['exten']==_0x5c47('0x41')){this[_0x5c47('0x1b')][_0x1f7f75['channel']['split']('-')[0x0]]['destconnectedlinenum']=_0x1f7f75[_0x5c47('0x42')];this[_0x5c47('0x35')](util[_0x5c47('0x43')]('user:%s',this['agents'][_0x1f7f75[_0x5c47('0x3f')]['split']('-')[0x0]][_0x5c47('0x44')]),'user:agentconnect',{'destaccountcode':this['agents'][_0x1f7f75[_0x5c47('0x3f')][_0x5c47('0x40')]('-')[0x0]][_0x5c47('0x45')],'destconnectedlinenum':_0x1f7f75[_0x5c47('0x42')]});}}}}}catch(_0x7696a5){logger['error'](_0x5c47('0x46'),_0x1f7f75[_0x5c47('0x37')],util[_0x5c47('0x3b')](_0x7696a5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5c47('0x22')]=function(_0x1f2e4c){try{if(this[_0x5c47('0x34')](_0x1f2e4c)){logger[_0x5c47('0x47')](_0x5c47('0x48'),_0x1f2e4c[_0x5c47('0x37')],util['inspect'](_0x1f2e4c,{'showHidden':![],'depth':null}));if(_0x1f2e4c[_0x5c47('0x37')]===_0x1f2e4c[_0x5c47('0x49')]&&_0x1f2e4c['channel']!='OutgoingSpoolFailed'){if(_['isUndefined'](this[_0x5c47('0x1a')][_0x1f2e4c[_0x5c47('0x37')]])){logger[_0x5c47('0x30')](_0x5c47('0x4a'),_0x1f2e4c['uniqueid'],_0x1f2e4c[_0x5c47('0x4b')],_0x1f2e4c[_0x5c47('0x4c')]);this[_0x5c47('0x1a')][_0x1f2e4c[_0x5c47('0x37')]]=new Channel();this[_0x5c47('0x1a')][_0x1f2e4c[_0x5c47('0x37')]][_0x5c47('0x4d')]=moment()[_0x5c47('0x43')](_0x5c47('0x4e'));this[_0x5c47('0x1a')][_0x1f2e4c[_0x5c47('0x37')]][_0x5c47('0x4f')]=dispositions[_[_0x5c47('0x50')](_0x1f2e4c[_0x5c47('0x51')])];_[_0x5c47('0x52')](this['channels'][_0x1f2e4c[_0x5c47('0x37')]],_[_0x5c47('0x3c')](_0x1f2e4c,_[_0x5c47('0x3d')](this[_0x5c47('0x1a')][_0x1f2e4c[_0x5c47('0x37')]])));if(_0x1f2e4c['context']===_0x5c47('0x3e')){if(this['agents'][_0x1f2e4c[_0x5c47('0x3f')][_0x5c47('0x40')]('-')[0x0]]){if(_[_0x5c47('0x53')](this[_0x5c47('0x1b')][_0x1f2e4c[_0x5c47('0x3f')][_0x5c47('0x40')]('-')[0x0]][_0x5c47('0x54')])){this[_0x5c47('0x1b')][_0x1f2e4c[_0x5c47('0x3f')][_0x5c47('0x40')]('-')[0x0]]['destconnectedlinenum']=_0x1f2e4c[_0x5c47('0x4c')];logger[_0x5c47('0x47')](_0x5c47('0x55'),_0x1f2e4c[_0x5c47('0x37')],util[_0x5c47('0x3b')]({'destaccountcode':this[_0x5c47('0x1b')][_0x1f2e4c['channel'][_0x5c47('0x40')]('-')[0x0]][_0x5c47('0x45')],'destconnectedlinenum':_0x1f2e4c[_0x5c47('0x4c')]},{'showHidden':![],'depth':null}));this[_0x5c47('0x35')](util['format']('user:%s',this['agents'][_0x1f2e4c['channel'][_0x5c47('0x40')]('-')[0x0]][_0x5c47('0x44')]),_0x5c47('0x56'),{'destaccountcode':this['agents'][_0x1f2e4c['channel'][_0x5c47('0x40')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1f2e4c[_0x5c47('0x4c')]});}}}}}}}catch(_0x2383c9){logger['error'](_0x5c47('0x57'),_0x1f2e4c[_0x5c47('0x37')],util[_0x5c47('0x3b')](_0x2383c9,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c47('0x33')][_0x5c47('0x1e')]=function(_0x4c3243){try{if(this[_0x5c47('0x34')](_0x4c3243)){logger[_0x5c47('0x47')](_0x5c47('0x58'),_0x4c3243['uniqueid'],util['inspect'](_0x4c3243,{'showHidden':![],'depth':null}));if(_0x4c3243['uniqueid']===_0x4c3243[_0x5c47('0x49')]&&_0x4c3243['exten']!='h'&&_0x4c3243['channel']!=_0x5c47('0x59')){_0x4c3243[_0x5c47('0x5a')]=_0x4c3243['application'][_0x5c47('0x5b')]();_0x4c3243[_0x5c47('0x5c')]=_0x4c3243[_0x5c47('0x5d')]&&_0x4c3243[_0x5c47('0x5d')]['startsWith'](_0x5c47('0x5e'))?_0x4c3243[_0x5c47('0x5d')]:(_0x4c3243[_0x5c47('0x5d')]||_0x4c3243[_0x5c47('0x5c')])[_0x5c47('0x5b')]();logger[_0x5c47('0x30')](_0x5c47('0x5f'),_0x4c3243['uniqueid'],_0x4c3243[_0x5c47('0x5a')],_0x4c3243[_0x5c47('0x5c')]);if(_[_0x5c47('0x53')](this['channels'][_0x4c3243[_0x5c47('0x37')]])){this[_0x5c47('0x1a')][_0x4c3243['uniqueid']]=new Channel();this['channels'][_0x4c3243[_0x5c47('0x37')]]['starttime']=_0x4c3243['duration']?moment()[_0x5c47('0x60')](moment[_0x5c47('0x61')](_0x4c3243['duration'])[_0x5c47('0x62')](),_0x5c47('0x62'))[_0x5c47('0x43')](_0x5c47('0x4e')):moment()[_0x5c47('0x43')](_0x5c47('0x4e'));this[_0x5c47('0x1a')][_0x4c3243[_0x5c47('0x37')]][_0x5c47('0x4f')]=_0x5c47('0x13');}_[_0x5c47('0x52')](this[_0x5c47('0x1a')][_0x4c3243[_0x5c47('0x37')]],_[_0x5c47('0x3c')](_0x4c3243,_[_0x5c47('0x3d')](this[_0x5c47('0x1a')][_0x4c3243[_0x5c47('0x37')]])));if(_['includes'](applications,_0x4c3243['application'])){this['channels'][_0x4c3243[_0x5c47('0x37')]]['lastapplication']=_0x4c3243['application'];this[_0x5c47('0x1a')][_0x4c3243[_0x5c47('0x37')]][_0x5c47('0x63')]=_0x4c3243[_0x5c47('0x5c')];if(_0x4c3243['application']===_0x5c47('0x64')&&_['startsWith'](_0x4c3243[_0x5c47('0x5c')]['toLowerCase'](),_0x5c47('0x65'))){var _0x418d33=_0x4c3243[_0x5c47('0x5c')]['split']('=');var _0x422791=_0x418d33[0x0][_0x5c47('0x5b')]()['match'](/cdr\((.*)\)/);if(_0x422791){this[_0x5c47('0x1a')][_0x4c3243[_0x5c47('0x37')]][_0x422791[0x1]]=_0x418d33[0x1];}}else if(_0x4c3243[_0x5c47('0x5a')]==='queue'){this[_0x5c47('0x1a')][_0x4c3243[_0x5c47('0x37')]]['queue']=_0x4c3243[_0x5c47('0x5c')][_0x5c47('0x40')](',')[0x0];}}}}}catch(_0x590886){logger[_0x5c47('0x66')](_0x5c47('0x67'),_0x4c3243[_0x5c47('0x37')],util['inspect'](_0x590886,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c47('0x33')][_0x5c47('0x24')]=function(_0x39fda9){try{if(this[_0x5c47('0x34')](_0x39fda9)){logger[_0x5c47('0x30')](_0x5c47('0x68'),_0x39fda9[_0x5c47('0x37')],_0x39fda9[_0x5c47('0x49')],_0x39fda9['calleridname'],_0x39fda9[_0x5c47('0x39')]);logger[_0x5c47('0x47')](_0x5c47('0x69'),_0x39fda9[_0x5c47('0x37')],util[_0x5c47('0x3b')](_0x39fda9,{'showHidden':![],'depth':null}));if(_0x39fda9[_0x5c47('0x37')]!==_0x39fda9[_0x5c47('0x49')]){if(this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x49')]]){if(_0x39fda9['channelstate']==='6'){if(!this[_0x5c47('0x1a')][_0x39fda9['linkedid']][_0x5c47('0x6a')]){var _0x272dcc=moment();this['channels'][_0x39fda9[_0x5c47('0x49')]][_0x5c47('0x6a')]=!![];this[_0x5c47('0x1a')][_0x39fda9['linkedid']][_0x5c47('0x6b')]=_0x272dcc[_0x5c47('0x43')](_0x5c47('0x4e'));if(this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x49')]][_0x5c47('0x4d')]){this['channels'][_0x39fda9['linkedid']][_0x5c47('0x6c')]=_0x272dcc[_0x5c47('0x6d')](this[_0x5c47('0x1a')][_0x39fda9['linkedid']][_0x5c47('0x4d')],_0x5c47('0x62'));}}this[_0x5c47('0x1a')][_0x39fda9['linkedid']][_0x5c47('0x49')]=_0x39fda9[_0x5c47('0x37')];if(_0x39fda9[_0x5c47('0x39')]!==_0x5c47('0x41')){this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x49')]]['connectedlinenum']=_0x39fda9['calleridnum'];}this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x49')]][_0x5c47('0x6e')]=_0x39fda9['calleridname'];this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x49')]][_0x5c47('0x6f')]=_0x39fda9[_0x5c47('0x3f')];this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x49')]][_0x5c47('0x4f')]=dispositions[_[_0x5c47('0x50')](_0x39fda9[_0x5c47('0x51')])];if(this[_0x5c47('0x1b')][_0x39fda9['channel'][_0x5c47('0x40')]('-')[0x0]]){this[_0x5c47('0x1a')][_0x39fda9['linkedid']]['UserId']=this[_0x5c47('0x1b')][_0x39fda9[_0x5c47('0x3f')][_0x5c47('0x40')]('-')[0x0]]['id'];this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x49')]][_0x5c47('0x70')]=this[_0x5c47('0x1b')][_0x39fda9['channel'][_0x5c47('0x40')]('-')[0x0]][_0x5c47('0x44')];}}}}else{if(this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x37')]]){if(_0x39fda9[_0x5c47('0x51')]==='6'){if(this[_0x5c47('0x1b')][_0x39fda9[_0x5c47('0x3f')]['split']('-')[0x0]]){this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x37')]][_0x5c47('0x71')]=this[_0x5c47('0x1b')][_0x39fda9['channel']['split']('-')[0x0]]['id'];this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x37')]]['membername']=this[_0x5c47('0x1b')][_0x39fda9[_0x5c47('0x3f')]['split']('-')[0x0]][_0x5c47('0x44')];}}}}if(_0x39fda9['channelstate']==='6'&&_0x39fda9[_0x5c47('0x4b')]===_0x5c47('0x3e')){if(this['agents'][_0x39fda9[_0x5c47('0x3f')][_0x5c47('0x40')]('-')[0x0]]){this[_0x5c47('0x1b')][_0x39fda9['channel']['split']('-')[0x0]][_0x5c47('0x54')]=_0x39fda9[_0x5c47('0x4c')];var _0x53dce3;if(this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x37')]])_0x53dce3=this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x37')]][_0x5c47('0x72')];else if(this[_0x5c47('0x1a')][_0x39fda9[_0x5c47('0x49')]])_0x53dce3=this['channels'][_0x39fda9[_0x5c47('0x49')]][_0x5c47('0x72')];logger[_0x5c47('0x47')](_0x5c47('0x73'),_0x39fda9[_0x5c47('0x37')],util[_0x5c47('0x3b')]({'destaccountcode':this[_0x5c47('0x1b')][_0x39fda9['channel']['split']('-')[0x0]][_0x5c47('0x45')],'destconnectedlinenum':_0x39fda9['exten'],'routealias':_0x53dce3},{'showHidden':![],'depth':null}));this[_0x5c47('0x35')](util['format'](_0x5c47('0x74'),this[_0x5c47('0x1b')][_0x39fda9[_0x5c47('0x3f')][_0x5c47('0x40')]('-')[0x0]][_0x5c47('0x44')]),_0x5c47('0x56'),{'destaccountcode':this[_0x5c47('0x1b')][_0x39fda9['channel'][_0x5c47('0x40')]('-')[0x0]][_0x5c47('0x45')],'destconnectedlinenum':_0x39fda9[_0x5c47('0x4c')],'routealias':_0x53dce3});}}}}catch(_0x46835f){logger[_0x5c47('0x66')](_0x5c47('0x75'),_0x39fda9['uniqueid'],util[_0x5c47('0x3b')](_0x46835f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c47('0x33')][_0x5c47('0x76')]=function(_0x218dc1,_0x391d6c){try{if(this[_0x5c47('0x1a')][_0x218dc1]){logger[_0x5c47('0x30')](_0x5c47('0x77'),_0x218dc1,_0x391d6c);this[_0x5c47('0x1a')][_0x218dc1][_0x5c47('0x78')]=!![];if(_[_0x5c47('0x79')](_0x391d6c,_0x5c47('0x7a'))){_0x391d6c=_0x391d6c['replace'](_0x5c47('0x7a'),_0x5c47('0x7b'));}this[_0x5c47('0x1a')][_0x218dc1][_0x5c47('0x7c')]=_0x391d6c;var _0x1434a7=_[_0x5c47('0x7d')](this[_0x5c47('0x1a')][_0x218dc1][_0x5c47('0x7e')],{'filename':_0x391d6c});if(_['isNil'](_0x1434a7)){this[_0x5c47('0x1a')][_0x218dc1][_0x5c47('0x7e')][_0x5c47('0x7f')]({'filename':_0x391d6c,'createdAt':moment()['format'](_0x5c47('0x4e')),'mixmonitorid':'','status':_0x5c47('0x80')});}}}catch(_0x4acf79){logger[_0x5c47('0x66')](_0x5c47('0x81'),_0x218dc1,util[_0x5c47('0x3b')](_0x4acf79,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c47('0x33')][_0x5c47('0x25')]=function(_0x385d36){try{if(this[_0x5c47('0x34')](_0x385d36)){logger[_0x5c47('0x47')](_0x5c47('0x82'),_0x385d36['uniqueid'],util[_0x5c47('0x3b')](_0x385d36,{'showHidden':![],'depth':null}));if(this[_0x5c47('0x1a')][_0x385d36[_0x5c47('0x37')]]&&_0x385d36[_0x5c47('0x3f')]!=_0x5c47('0x59')){if(this['isNotNull'](_0x385d36[_0x5c47('0x83')])){if(this['isNotNull'](_0x385d36[_0x5c47('0x83')]['mixmonitor_filename'])){logger[_0x5c47('0x30')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x385d36[_0x5c47('0x37')],_0x385d36[_0x5c47('0x84')]);this[_0x5c47('0x76')](_0x385d36['uniqueid'],_0x385d36[_0x5c47('0x84')]);}else if(this['isNotNull'](_0x385d36[_0x5c47('0x83')][_0x5c47('0x85')])){logger[_0x5c47('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x385d36[_0x5c47('0x37')],_0x385d36['value']);this[_0x5c47('0x1a')][_0x385d36[_0x5c47('0x37')]]['calleridnum']=_0x385d36[_0x5c47('0x84')];}else if(this[_0x5c47('0x34')](_0x385d36[_0x5c47('0x83')]['xmd-callerid'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x385d36[_0x5c47('0x37')],_0x385d36[_0x5c47('0x84')]);this['channels'][_0x385d36['uniqueid']][_0x5c47('0x86')]=_0x385d36['value'];}else if(this[_0x5c47('0x34')](_0x385d36[_0x5c47('0x83')][_0x5c47('0x87')])){logger[_0x5c47('0x30')](_0x5c47('0x88'),_0x385d36[_0x5c47('0x37')],_0x385d36[_0x5c47('0x84')]);this[_0x5c47('0x1a')][_0x385d36[_0x5c47('0x37')]]['type']=_0x385d36['value'];}else if(this[_0x5c47('0x34')](_0x385d36['variable'][_0x5c47('0x89')])){logger[_0x5c47('0x30')](_0x5c47('0x8a'),_0x385d36[_0x5c47('0x37')],_0x385d36['value'][_0x5c47('0x40')](',')[0x0]);this['channels'][_0x385d36[_0x5c47('0x37')]]['queue']=_0x385d36['value']['split'](',')[0x0];}else if(this[_0x5c47('0x34')](_0x385d36[_0x5c47('0x83')][_0x5c47('0x8b')])){logger['info'](_0x5c47('0x8c'),_0x385d36[_0x5c47('0x37')],_0x385d36[_0x5c47('0x84')]);this['channels'][_0x385d36[_0x5c47('0x37')]][_0x5c47('0x8d')]=_0x385d36[_0x5c47('0x84')];}else if(this[_0x5c47('0x34')](_0x385d36[_0x5c47('0x83')][_0x5c47('0x8e')])){logger[_0x5c47('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x385d36[_0x5c47('0x37')],_0x385d36['value']);this['channels'][_0x385d36['uniqueid']][_0x5c47('0x8f')]=_0x385d36[_0x5c47('0x84')];}else if(this[_0x5c47('0x34')](_0x385d36[_0x5c47('0x83')][_0x5c47('0x90')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x385d36[_0x5c47('0x37')],_0x385d36['value']);this[_0x5c47('0x1a')][_0x385d36['uniqueid']]['calleridpreview']=_0x385d36[_0x5c47('0x84')];}else if(this[_0x5c47('0x34')](_0x385d36[_0x5c47('0x83')][_0x5c47('0x91')])){logger[_0x5c47('0x30')]('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x385d36[_0x5c47('0x37')],_0x385d36[_0x5c47('0x84')]);this[_0x5c47('0x1a')][_0x385d36[_0x5c47('0x37')]][_0x5c47('0x10')]=_0x385d36[_0x5c47('0x84')];}else if(this['isNotNull'](_0x385d36[_0x5c47('0x83')]['sipcallid'])){logger[_0x5c47('0x30')](_0x5c47('0x92'),_0x385d36[_0x5c47('0x37')],_0x385d36['value']);this[_0x5c47('0x1a')][_0x385d36[_0x5c47('0x37')]]['sipcalluniqueid']=_0x385d36['value'];}}}else if(this[_0x5c47('0x34')](_0x385d36[_0x5c47('0x83')][_0x5c47('0x93')])){if(_0x385d36[_0x5c47('0x84')]){var _0x520e1f=path['parse'](_0x385d36[_0x5c47('0x84')])[_0x5c47('0x44')];logger['info'](_0x5c47('0x94'),_0x520e1f,_0x385d36[_0x5c47('0x84')]);this[_0x5c47('0x76')](_0x520e1f,_0x385d36[_0x5c47('0x84')]);}}else if(this[_0x5c47('0x1a')][_0x385d36[_0x5c47('0x49')]]){if(this[_0x5c47('0x34')](_0x385d36[_0x5c47('0x83')])){if(this[_0x5c47('0x34')](_0x385d36[_0x5c47('0x83')][_0x5c47('0x95')])){logger[_0x5c47('0x30')](_0x5c47('0x92'),_0x385d36[_0x5c47('0x49')],_0x385d36[_0x5c47('0x84')]);this[_0x5c47('0x1a')][_0x385d36[_0x5c47('0x49')]][_0x5c47('0x96')]=_0x385d36[_0x5c47('0x84')];}}}}}catch(_0x1c7bca){logger['error'](_0x5c47('0x97'),_0x385d36[_0x5c47('0x37')],util[_0x5c47('0x3b')](_0x1c7bca,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c47('0x33')]['syncHangup']=function(_0x3b4bdb){try{if(this[_0x5c47('0x34')](_0x3b4bdb)){logger[_0x5c47('0x47')](_0x5c47('0x98'),_0x3b4bdb['uniqueid'],util[_0x5c47('0x3b')](_0x3b4bdb,{'showHidden':![],'depth':null}));if(this['channels'][_0x3b4bdb[_0x5c47('0x37')]]){logger[_0x5c47('0x30')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x3b4bdb['uniqueid'],_0x3b4bdb[_0x5c47('0x99')]);var _0x17de60=moment();this[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]][_0x5c47('0x9a')]=_0x17de60[_0x5c47('0x43')](_0x5c47('0x4e'));this[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]][_0x5c47('0x61')]=_0x17de60[_0x5c47('0x6d')](this[_0x5c47('0x1a')][_0x3b4bdb['uniqueid']][_0x5c47('0x4d')],_0x5c47('0x62'));if(this[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]][_0x5c47('0x6a')]){this['channels'][_0x3b4bdb['uniqueid']][_0x5c47('0x9b')]=_0x17de60[_0x5c47('0x6d')](this[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]][_0x5c47('0x6b')],_0x5c47('0x62'));this[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]][_0x5c47('0x6c')]=this[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]][_0x5c47('0x61')]-this[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]]['billableseconds'];}if(_0x3b4bdb[_0x5c47('0x4b')]===_0x5c47('0x3e')){if(this[_0x5c47('0x1b')][_0x3b4bdb[_0x5c47('0x3f')]['split']('-')[0x0]]){this[_0x5c47('0x1b')][_0x3b4bdb[_0x5c47('0x3f')][_0x5c47('0x40')]('-')[0x0]]=_[_0x5c47('0x9c')](this[_0x5c47('0x1b')][_0x3b4bdb[_0x5c47('0x3f')][_0x5c47('0x40')]('-')[0x0]],[_0x5c47('0x54')]);logger[_0x5c47('0x47')](_0x5c47('0x9d'),_0x3b4bdb[_0x5c47('0x37')],util[_0x5c47('0x3b')]({'id':this['agents'][_0x3b4bdb[_0x5c47('0x3f')][_0x5c47('0x40')]('-')[0x0]]['id'],'destaccountcode':this[_0x5c47('0x1b')][_0x3b4bdb[_0x5c47('0x3f')]['split']('-')[0x0]][_0x5c47('0x45')]},{'showHidden':![],'depth':null}));this[_0x5c47('0x35')](util['format']('user:%s',this['agents'][_0x3b4bdb['channel'][_0x5c47('0x40')]('-')[0x0]][_0x5c47('0x44')]),_0x5c47('0x9e'),{'id':this['agents'][_0x3b4bdb['channel'][_0x5c47('0x40')]('-')[0x0]]['id'],'destaccountcode':this[_0x5c47('0x1b')][_0x3b4bdb[_0x5c47('0x3f')]['split']('-')[0x0]][_0x5c47('0x45')]});}}var _0x1ef691=this;Promise[_0x5c47('0x9f')]()[_0x5c47('0xa0')](function(){var _0x41f7f2=_0x1ef691[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]];if(typeof _0x41f7f2[_0x5c47('0xa1')]===_0x5c47('0xa2'))return;if(_[_0x5c47('0xa3')](_0x41f7f2[_0x5c47('0x7e')]))return;return RpcSetting[_0x5c47('0xa4')]()['then'](function(_0x49ffce){if(!_0x49ffce['stopRecordingOnTransfer'])return;return Promise[_0x5c47('0x9f')]()[_0x5c47('0xa0')](function(){return ami[_0x5c47('0xa5')]({'action':_0x5c47('0xa6'),'channel':_0x41f7f2[_0x5c47('0x3f')]})[_0x5c47('0xa7')](function(){});})['then'](function(){return ami[_0x5c47('0xa5')]({'action':'StopMixMonitor','channel':_0x41f7f2[_0x5c47('0x6f')]})[_0x5c47('0xa7')](function(){})[_0x5c47('0xa8')](function(){var _0x1370cf=_0x1ef691[_0x5c47('0x1b')][_0x41f7f2[_0x5c47('0x6f')][_0x5c47('0x40')]('-')[0x0]];if(!_0x1370cf)return;io[_0x5c47('0x35')](_0x5c47('0xa9'),{'agentId':_0x1370cf['id'],'uniqueid':_0x41f7f2[_0x5c47('0x37')]});});});});})['then'](function(){if(_0x3b4bdb[_0x5c47('0xaa')]===_0x5c47('0xab')){_0x1ef691[_0x5c47('0x1c')][_0x3b4bdb[_0x5c47('0x37')]]=_0x1ef691[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]];}else{if(_0x1ef691[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]][_0x5c47('0xac')]===_0x5c47('0xad')&&_0x1ef691[_0x5c47('0x1c')][_0x3b4bdb[_0x5c47('0x37')]]){_0x1ef691[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]][_0x5c47('0x37')]=[_0x1ef691[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]][_0x5c47('0x49')],_0x1ef691['channels'][_0x3b4bdb[_0x5c47('0x37')]][_0x5c47('0x49')]=_0x1ef691['channels'][_0x3b4bdb[_0x5c47('0x37')]][_0x5c47('0x37')]][0x0];delete _0x1ef691[_0x5c47('0x1c')][_0x3b4bdb[_0x5c47('0x37')]];}}logger[_0x5c47('0x47')](_0x5c47('0xae'),_0x3b4bdb['uniqueid'],util['inspect'](_0x1ef691[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]],{'showHidden':![],'depth':null}));ami['emit'](_0x5c47('0xaf'),_0x1ef691[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]]);delete _0x1ef691[_0x5c47('0x1a')][_0x3b4bdb[_0x5c47('0x37')]];});}}}catch(_0x419b18){logger[_0x5c47('0x66')](_0x5c47('0xb0'),_0x3b4bdb[_0x5c47('0x37')],util['inspect'](_0x419b18,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c47('0x33')]['syncAttendedTransfer']=function(_0x57a064){try{if(this['isNotNull'](_0x57a064)){logger[_0x5c47('0x30')](_0x5c47('0xb1'),_0x57a064[_0x5c47('0x37')],_0x57a064[_0x5c47('0xb2')],_0x57a064[_0x5c47('0xb3')]);logger['debug'](_0x5c47('0xb4'),_0x57a064[_0x5c47('0x37')],util['inspect'](_0x57a064,{'showHidden':![],'depth':null}));if(this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xb5')]]){this[_0x5c47('0x1a')][_0x57a064['transfereeuniqueid']][_0x5c47('0xb6')]=_0x57a064[_0x5c47('0xb2')];this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xb5')]][_0x5c47('0xb7')]=_0x57a064[_0x5c47('0xb3')];if(this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xb8')]]){var _0x51f928=this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xb8')]];this['channels'][_0x57a064[_0x5c47('0xb8')]]=this[_0x5c47('0x1a')][_0x57a064['transfereeuniqueid']];this['channels'][_0x57a064[_0x5c47('0xb5')]]=_0x51f928;}}else if(this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xb9')]]){this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xb9')]]['transfercalleridnum']=_0x57a064[_0x5c47('0xb2')];this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xb9')]][_0x5c47('0xb7')]=_0x57a064[_0x5c47('0xb3')];if(this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xba')]]){var _0x51f928=this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xba')]];this['channels'][_0x57a064[_0x5c47('0xba')]]=this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xb9')]];this['channels'][_0x57a064[_0x5c47('0xb9')]]=_0x51f928;}}if((this[_0x5c47('0x1a')][_0x57a064['origtransfereruniqueid']]||this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xbb')]])&&this[_0x5c47('0x1a')][_0x57a064['secondtransfereruniqueid']]){var _0x3efa3d=_[_0x5c47('0xbc')]([this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xba')]],this[_0x5c47('0x1a')][_0x57a064['origtransfererlinkedid']],this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xb8')]]],function(_0x272047){return _0x272047&&_0x272047[_0x5c47('0xac')]==='outbound'&&_0x272047['routeid'];});if(_0x3efa3d){if(this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xba')]])this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xba')]][_0x5c47('0xa1')]=_0x5c47('0xbd');if(this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xbb')]])this[_0x5c47('0x1a')][_0x57a064[_0x5c47('0xbb')]][_0x5c47('0xa1')]='ATTENDED';this[_0x5c47('0x1a')][_0x57a064['secondtransfereruniqueid']][_0x5c47('0xa1')]='ATTENDED';}}}}catch(_0x5e3059){logger[_0x5c47('0x66')](_0x5c47('0xbe'),_0x57a064[_0x5c47('0x37')],util[_0x5c47('0x3b')](_0x5e3059,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c47('0x33')][_0x5c47('0x2c')]=function(_0x354aad){try{if(this['isNotNull'](_0x354aad)){logger['info']('[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x354aad[_0x5c47('0x37')],_0x354aad[_0x5c47('0xbf')],_0x354aad[_0x5c47('0xc0')]);logger[_0x5c47('0x47')](_0x5c47('0xc1'),_0x354aad[_0x5c47('0x37')],util[_0x5c47('0x3b')](_0x354aad,{'showHidden':![],'depth':null}));if(this[_0x5c47('0x1a')][_0x354aad[_0x5c47('0xb5')]]){this[_0x5c47('0x1a')][_0x354aad[_0x5c47('0xb5')]][_0x5c47('0xb6')]=_0x354aad[_0x5c47('0xbf')];this['channels'][_0x354aad[_0x5c47('0xb5')]][_0x5c47('0xb7')]=_0x354aad[_0x5c47('0xc0')];this[_0x5c47('0x1a')][_0x354aad[_0x5c47('0xb5')]]['transferType']='BLIND';this[_0x5c47('0x26')]({'event':_0x5c47('0xab'),'uniqueid':_0x354aad[_0x5c47('0xb5')],'context':_0x354aad['context'],'channel':_0x354aad[_0x5c47('0xc2')]});}else{this[_0x5c47('0x1a')][_0x354aad['transfereruniqueid']]['transferType']=_0x5c47('0xc3');}}}catch(_0x35955f){logger['error'](_0x5c47('0xc4'),_0x354aad['uniqueid'],util['inspect'](_0x35955f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x5c47('0x33')]['syncMusicOnHoldStart']=function(_0xf61189){try{if(this[_0x5c47('0x34')](_0xf61189)){logger[_0x5c47('0x47')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0xf61189[_0x5c47('0x37')],util['inspect'](_0xf61189,{'showHidden':![],'depth':null}));if(this[_0x5c47('0x1a')][_0xf61189[_0x5c47('0x37')]]){if(!_[_0x5c47('0xc5')](this[_0x5c47('0x1a')][_0xf61189['uniqueid']]['answertime'])){this[_0x5c47('0x1a')][_0xf61189[_0x5c47('0x37')]][_0x5c47('0xc6')]=moment()[_0x5c47('0x43')](_0x5c47('0x4e'));logger[_0x5c47('0x30')]('[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s',_0xf61189[_0x5c47('0x37')],this[_0x5c47('0x1a')][_0xf61189[_0x5c47('0x37')]][_0x5c47('0xc6')]);}}}}catch(_0xcd4a48){logger[_0x5c47('0x66')](_0x5c47('0xc7'),_0xf61189['uniqueid'],util['inspect'](_0xcd4a48,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x5c47('0x2f')]=function(_0x485308){try{if(this[_0x5c47('0x34')](_0x485308)){logger[_0x5c47('0x47')]('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x485308[_0x5c47('0x37')],util[_0x5c47('0x3b')](_0x485308,{'showHidden':![],'depth':null}));if(this['channels'][_0x485308[_0x5c47('0x37')]]){if(!_[_0x5c47('0xc5')](this[_0x5c47('0x1a')][_0x485308[_0x5c47('0x37')]][_0x5c47('0xc6')])){this['channels'][_0x485308[_0x5c47('0x37')]][_0x5c47('0xc8')]+=moment()['milliseconds'](0x0)[_0x5c47('0x6d')](this[_0x5c47('0x1a')][_0x485308['uniqueid']][_0x5c47('0xc6')],_0x5c47('0x62'));logger[_0x5c47('0x30')](_0x5c47('0xc9'),_0x485308[_0x5c47('0x37')],this[_0x5c47('0x1a')][_0x485308[_0x5c47('0x37')]][_0x5c47('0xc8')]);delete this[_0x5c47('0x1a')][_0x485308[_0x5c47('0x37')]][_0x5c47('0xc6')];}}}}catch(_0x42d331){logger[_0x5c47('0x66')]('[%s][voiceCallReport][musiconholdstop]',_0x485308[_0x5c47('0x37')],util['inspect'](_0x42d331,{'showHidden':![],'depth':null}));}};module[_0x5c47('0xca')]=VoiceCallReport;
\ No newline at end of file
+var _0x8bff=['ringing','ringinuse','onhold','set','queue','dial','playback','voicemail','FAILED','NO\x20ANSWER','ANSWERED','redis','defaults','localhost','socket.io-emitter','channels','blindTransfers','coreshowchannel','syncNewExten','newexten','bind','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','emit','calleridname','[%s][voiceCallReport][newcallerid]\x20event:','uniqueid','linkedid','isUndefined','merge','pick','keys','from-sip','agents','channel','split','exten','destconnectedlinenum','format','user:%s','name','user:agentconnect','connectedlinenum','[%s][voiceCallReport][newcallerid]','syncNewChannel','debug','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','context','starttime','disposition','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','calleridnum','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','holdtime','diff','xcally-motion-preview','connectedlinename','destinationchannel','toNumber','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','.wav49','.WAV','monitorFilename','find','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','xmd-cdrtype','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','duration','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','StopMixMonitor','catch','finally','webbar:stopmonitors','event','BlindTransfer','type','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','transferconnectedlinenum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohstarttime','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','invalid','unavailable'];(function(_0x2352ba,_0x17df46){var _0x349bdb=function(_0x40dc92){while(--_0x40dc92){_0x2352ba['push'](_0x2352ba['shift']());}};_0x349bdb(++_0x17df46);}(_0x8bff,0xc8));var _0xf8bf=function(_0x39d24a,_0x5c0963){_0x39d24a=_0x39d24a-0x0;var _0x1eb6db=_0x8bff[_0x39d24a];return _0x1eb6db;};'use strict';var BPromise=require('bluebird');var _=require(_0xf8bf('0x0'));var moment=require(_0xf8bf('0x1'));var util=require(_0xf8bf('0x2'));var path=require(_0xf8bf('0x3'));var Redis=require(_0xf8bf('0x4'));var config=require(_0xf8bf('0x5'));var logger=require(_0xf8bf('0x6'))('ami');var ami=require(_0xf8bf('0x7'));var Channel=require(_0xf8bf('0x8'));var RpcSetting=require(_0xf8bf('0x9'));var statusDesc=[_0xf8bf('0xa'),_0xf8bf('0xb'),_0xf8bf('0xc'),'busy',_0xf8bf('0xd'),_0xf8bf('0xe'),_0xf8bf('0xf'),_0xf8bf('0x10'),_0xf8bf('0x11')];var applications=[_0xf8bf('0x12'),_0xf8bf('0x13'),'agi',_0xf8bf('0x14'),_0xf8bf('0x15'),_0xf8bf('0x16')];var dispositions=['NO\x20ANSWER',_0xf8bf('0x17'),_0xf8bf('0x17'),_0xf8bf('0x18'),_0xf8bf('0x18'),'NO\x20ANSWER',_0xf8bf('0x19'),'BUSY',_0xf8bf('0x17'),_0xf8bf('0x17'),'FAILED'];var actions={};config[_0xf8bf('0x1a')]=_[_0xf8bf('0x1b')](config[_0xf8bf('0x1a')],{'host':_0xf8bf('0x1c'),'port':0x18eb});var io=require(_0xf8bf('0x1d'))(new Redis(config[_0xf8bf('0x1a')]));function VoiceCallReport(_0x2fcc16){this[_0xf8bf('0x1e')]=_0x2fcc16['channels'];this['agents']=_0x2fcc16['agents'];this[_0xf8bf('0x1f')]={};ami['on'](_0xf8bf('0x20'),this[_0xf8bf('0x21')]['bind'](this));ami['on'](_0xf8bf('0x22'),this[_0xf8bf('0x21')][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x24'),this['syncNewChannel'][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x25'),this[_0xf8bf('0x26')][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x27'),this[_0xf8bf('0x28')][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x29'),this[_0xf8bf('0x2a')][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x2b'),this[_0xf8bf('0x2c')][_0xf8bf('0x23')](this));ami['on']('attendedtransfer',this[_0xf8bf('0x2d')][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x2e'),this['syncBlindTransfer'][_0xf8bf('0x23')](this));ami['on'](_0xf8bf('0x2f'),this['syncMusicOnHoldStart'][_0xf8bf('0x23')](this));ami['on']('musiconholdstop',this[_0xf8bf('0x30')][_0xf8bf('0x23')](this));try{logger[_0xf8bf('0x31')](_0xf8bf('0x32'));ami[_0xf8bf('0x33')]();}catch(_0x238c37){logger[_0xf8bf('0x34')](_0xf8bf('0x35'),util[_0xf8bf('0x36')](_0x238c37,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x38')]=function(_0x4fdcb4){return _0x4fdcb4!==null&&!_['isUndefined'](_0x4fdcb4);};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x39')]=function(_0x3934d9,_0xc33f8d,_0xf0841c){io['to'](_0x3934d9)[_0xf8bf('0x39')](_0xc33f8d,_0xf0841c);};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x2c')]=function(_0x2cabe1){try{if(this[_0xf8bf('0x38')](_0x2cabe1)){logger[_0xf8bf('0x31')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x2cabe1['uniqueid'],_0x2cabe1[_0xf8bf('0x3a')],_0x2cabe1['calleridnum']);logger['debug'](_0xf8bf('0x3b'),_0x2cabe1[_0xf8bf('0x3c')],util['inspect'](_0x2cabe1,{'showHidden':![],'depth':null}));if(_0x2cabe1[_0xf8bf('0x3c')]===_0x2cabe1[_0xf8bf('0x3d')]){if(!_[_0xf8bf('0x3e')](this[_0xf8bf('0x1e')][_0x2cabe1[_0xf8bf('0x3c')]])){_[_0xf8bf('0x3f')](this[_0xf8bf('0x1e')][_0x2cabe1['uniqueid']],_[_0xf8bf('0x40')](_0x2cabe1,_[_0xf8bf('0x41')](this[_0xf8bf('0x1e')][_0x2cabe1[_0xf8bf('0x3c')]])));}}if(_0x2cabe1['context']===_0xf8bf('0x42')){if(this[_0xf8bf('0x43')][_0x2cabe1[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]){if(_0x2cabe1[_0xf8bf('0x46')]=='xcally-motion-preview'){this['agents'][_0x2cabe1[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x47')]=_0x2cabe1['connectedlinenum'];this[_0xf8bf('0x39')](util[_0xf8bf('0x48')](_0xf8bf('0x49'),this[_0xf8bf('0x43')][_0x2cabe1['channel'][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x4a')]),_0xf8bf('0x4b'),{'destaccountcode':this[_0xf8bf('0x43')][_0x2cabe1[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x2cabe1[_0xf8bf('0x4c')]});}}}}}catch(_0x51be97){logger['error'](_0xf8bf('0x4d'),_0x2cabe1[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x51be97,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x4e')]=function(_0x3daaa0){try{if(this[_0xf8bf('0x38')](_0x3daaa0)){logger[_0xf8bf('0x4f')](_0xf8bf('0x50'),_0x3daaa0[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x3daaa0,{'showHidden':![],'depth':null}));if(_0x3daaa0[_0xf8bf('0x3c')]===_0x3daaa0[_0xf8bf('0x3d')]&&_0x3daaa0[_0xf8bf('0x44')]!=_0xf8bf('0x51')){if(_['isUndefined'](this[_0xf8bf('0x1e')][_0x3daaa0[_0xf8bf('0x3c')]])){logger[_0xf8bf('0x31')](_0xf8bf('0x52'),_0x3daaa0[_0xf8bf('0x3c')],_0x3daaa0[_0xf8bf('0x53')],_0x3daaa0[_0xf8bf('0x46')]);this[_0xf8bf('0x1e')][_0x3daaa0[_0xf8bf('0x3c')]]=new Channel();this[_0xf8bf('0x1e')][_0x3daaa0[_0xf8bf('0x3c')]][_0xf8bf('0x54')]=moment()[_0xf8bf('0x48')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf8bf('0x1e')][_0x3daaa0['uniqueid']][_0xf8bf('0x55')]=dispositions[_['toNumber'](_0x3daaa0['channelstate'])];_[_0xf8bf('0x3f')](this[_0xf8bf('0x1e')][_0x3daaa0['uniqueid']],_[_0xf8bf('0x40')](_0x3daaa0,_[_0xf8bf('0x41')](this[_0xf8bf('0x1e')][_0x3daaa0[_0xf8bf('0x3c')]])));if(_0x3daaa0[_0xf8bf('0x53')]==='from-sip'){if(this[_0xf8bf('0x43')][_0x3daaa0[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]){if(_[_0xf8bf('0x3e')](this[_0xf8bf('0x43')][_0x3daaa0[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x47')])){this['agents'][_0x3daaa0[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x47')]=_0x3daaa0['exten'];logger[_0xf8bf('0x4f')](_0xf8bf('0x56'),_0x3daaa0['uniqueid'],util[_0xf8bf('0x36')]({'destaccountcode':this[_0xf8bf('0x43')][_0x3daaa0[_0xf8bf('0x44')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3daaa0[_0xf8bf('0x46')]},{'showHidden':![],'depth':null}));this[_0xf8bf('0x39')](util[_0xf8bf('0x48')](_0xf8bf('0x49'),this[_0xf8bf('0x43')][_0x3daaa0[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x4a')]),_0xf8bf('0x4b'),{'destaccountcode':this[_0xf8bf('0x43')][_0x3daaa0['channel']['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x3daaa0[_0xf8bf('0x46')]});}}}}}}}catch(_0x1df571){logger[_0xf8bf('0x34')](_0xf8bf('0x57'),_0x3daaa0[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x1df571,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x21')]=function(_0x50a257){try{if(this['isNotNull'](_0x50a257)){logger[_0xf8bf('0x4f')](_0xf8bf('0x58'),_0x50a257[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x50a257,{'showHidden':![],'depth':null}));if(_0x50a257[_0xf8bf('0x3c')]===_0x50a257['linkedid']&&_0x50a257['exten']!='h'&&_0x50a257[_0xf8bf('0x44')]!=_0xf8bf('0x51')){_0x50a257[_0xf8bf('0x59')]=_0x50a257[_0xf8bf('0x59')][_0xf8bf('0x5a')]();_0x50a257[_0xf8bf('0x5b')]=_0x50a257[_0xf8bf('0x5c')]&&_0x50a257[_0xf8bf('0x5c')][_0xf8bf('0x5d')](_0xf8bf('0x5e'))?_0x50a257[_0xf8bf('0x5c')]:(_0x50a257[_0xf8bf('0x5c')]||_0x50a257[_0xf8bf('0x5b')])[_0xf8bf('0x5a')]();logger[_0xf8bf('0x31')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x50a257[_0xf8bf('0x3c')],_0x50a257[_0xf8bf('0x59')],_0x50a257[_0xf8bf('0x5b')]);if(_[_0xf8bf('0x3e')](this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]])){this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]]=new Channel();this[_0xf8bf('0x1e')][_0x50a257['uniqueid']][_0xf8bf('0x54')]=_0x50a257['duration']?moment()['subtract'](moment['duration'](_0x50a257['duration'])[_0xf8bf('0x5f')](),_0xf8bf('0x5f'))[_0xf8bf('0x48')](_0xf8bf('0x60')):moment()[_0xf8bf('0x48')](_0xf8bf('0x60'));this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]][_0xf8bf('0x55')]=_0xf8bf('0x18');}_[_0xf8bf('0x3f')](this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]],_[_0xf8bf('0x40')](_0x50a257,_[_0xf8bf('0x41')](this['channels'][_0x50a257[_0xf8bf('0x3c')]])));if(_[_0xf8bf('0x61')](applications,_0x50a257[_0xf8bf('0x59')])){this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]][_0xf8bf('0x62')]=_0x50a257[_0xf8bf('0x59')];this['channels'][_0x50a257['uniqueid']][_0xf8bf('0x63')]=_0x50a257[_0xf8bf('0x5b')];if(_0x50a257[_0xf8bf('0x59')]===_0xf8bf('0x12')&&_[_0xf8bf('0x5d')](_0x50a257[_0xf8bf('0x5b')][_0xf8bf('0x5a')](),'cdr(')){var _0x381bf0=_0x50a257['applicationdata'][_0xf8bf('0x45')]('=');var _0x1ebd29=_0x381bf0[0x0][_0xf8bf('0x5a')]()['match'](/cdr\((.*)\)/);if(_0x1ebd29){this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]][_0x1ebd29[0x1]]=_0x381bf0[0x1];}}else if(_0x50a257['application']===_0xf8bf('0x13')){this[_0xf8bf('0x1e')][_0x50a257[_0xf8bf('0x3c')]][_0xf8bf('0x13')]=_0x50a257[_0xf8bf('0x5b')][_0xf8bf('0x45')](',')[0x0];}}}}}catch(_0x671a1f){logger[_0xf8bf('0x34')]('[%s][voiceCallReport][newexten]',_0x50a257[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x671a1f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x26')]=function(_0x217a92){try{if(this['isNotNull'](_0x217a92)){logger[_0xf8bf('0x31')](_0xf8bf('0x64'),_0x217a92['uniqueid'],_0x217a92['linkedid'],_0x217a92[_0xf8bf('0x3a')],_0x217a92[_0xf8bf('0x65')]);logger[_0xf8bf('0x4f')](_0xf8bf('0x66'),_0x217a92[_0xf8bf('0x3c')],util['inspect'](_0x217a92,{'showHidden':![],'depth':null}));if(_0x217a92['uniqueid']!==_0x217a92[_0xf8bf('0x3d')]){if(this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]]){if(_0x217a92[_0xf8bf('0x67')]==='6'){if(!this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]]['answered']){var _0x436436=moment();this[_0xf8bf('0x1e')][_0x217a92['linkedid']][_0xf8bf('0x68')]=!![];this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]]['answertime']=_0x436436[_0xf8bf('0x48')](_0xf8bf('0x60'));if(this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x54')]){this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x69')]=_0x436436[_0xf8bf('0x6a')](this['channels'][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x54')],_0xf8bf('0x5f'));}}this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x3d')]=_0x217a92['uniqueid'];if(_0x217a92[_0xf8bf('0x65')]!==_0xf8bf('0x6b')){this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x4c')]=_0x217a92[_0xf8bf('0x65')];}this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x6c')]=_0x217a92['calleridname'];this['channels'][_0x217a92['linkedid']][_0xf8bf('0x6d')]=_0x217a92['channel'];this['channels'][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x55')]=dispositions[_[_0xf8bf('0x6e')](_0x217a92['channelstate'])];if(this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]){this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x6f')]=this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')]['split']('-')[0x0]]['id'];this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]][_0xf8bf('0x70')]=this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')]['split']('-')[0x0]][_0xf8bf('0x4a')];}}}}else{if(this[_0xf8bf('0x1e')][_0x217a92['uniqueid']]){if(_0x217a92['channelstate']==='6'){if(this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]){this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3c')]][_0xf8bf('0x6f')]=this[_0xf8bf('0x43')][_0x217a92['channel'][_0xf8bf('0x45')]('-')[0x0]]['id'];this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3c')]]['membername']=this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]['name'];}}}}if(_0x217a92['channelstate']==='6'&&_0x217a92['context']==='from-sip'){if(this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]){this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x47')]=_0x217a92[_0xf8bf('0x46')];var _0x9601e4;if(this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3c')]])_0x9601e4=this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3c')]][_0xf8bf('0x71')];else if(this[_0xf8bf('0x1e')][_0x217a92[_0xf8bf('0x3d')]])_0x9601e4=this[_0xf8bf('0x1e')][_0x217a92['linkedid']][_0xf8bf('0x71')];logger[_0xf8bf('0x4f')](_0xf8bf('0x72'),_0x217a92[_0xf8bf('0x3c')],util[_0xf8bf('0x36')]({'destaccountcode':this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x73')],'destconnectedlinenum':_0x217a92[_0xf8bf('0x46')],'routealias':_0x9601e4},{'showHidden':![],'depth':null}));this['emit'](util[_0xf8bf('0x48')](_0xf8bf('0x49'),this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x4a')]),_0xf8bf('0x4b'),{'destaccountcode':this[_0xf8bf('0x43')][_0x217a92[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x73')],'destconnectedlinenum':_0x217a92[_0xf8bf('0x46')],'routealias':_0x9601e4});}}}}catch(_0x7cc228){logger['error'](_0xf8bf('0x74'),_0x217a92[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x7cc228,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x75')]=function(_0x59cbff,_0x98daac){try{if(this[_0xf8bf('0x1e')][_0x59cbff]){logger[_0xf8bf('0x31')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x59cbff,_0x98daac);this['channels'][_0x59cbff][_0xf8bf('0x76')]=!![];if(_[_0xf8bf('0x77')](_0x98daac,_0xf8bf('0x78'))){_0x98daac=_0x98daac['replace']('.wav49',_0xf8bf('0x79'));}this['channels'][_0x59cbff][_0xf8bf('0x7a')]=_0x98daac;var _0x33b3c4=_[_0xf8bf('0x7b')](this[_0xf8bf('0x1e')][_0x59cbff][_0xf8bf('0x7c')],{'filename':_0x98daac});if(_[_0xf8bf('0x7d')](_0x33b3c4)){this['channels'][_0x59cbff][_0xf8bf('0x7c')]['push']({'filename':_0x98daac,'createdAt':moment()['format'](_0xf8bf('0x60')),'mixmonitorid':'','status':_0xf8bf('0x7e')});}}}catch(_0x51a0b5){logger[_0xf8bf('0x34')](_0xf8bf('0x7f'),_0x59cbff,util['inspect'](_0x51a0b5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf8bf('0x28')]=function(_0x29d8a2){try{if(this['isNotNull'](_0x29d8a2)){logger[_0xf8bf('0x4f')](_0xf8bf('0x80'),_0x29d8a2[_0xf8bf('0x3c')],util['inspect'](_0x29d8a2,{'showHidden':![],'depth':null}));if(this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]]&&_0x29d8a2[_0xf8bf('0x44')]!=_0xf8bf('0x51')){if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')])){if(this['isNotNull'](_0x29d8a2['variable'][_0xf8bf('0x82')])){logger['info'](_0xf8bf('0x83'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x75')](_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);}else if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')][_0xf8bf('0x85')])){logger[_0xf8bf('0x31')](_0xf8bf('0x86'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]]['calleridnum']=_0x29d8a2['value'];}else if(this['isNotNull'](_0x29d8a2['variable'][_0xf8bf('0x87')])){logger[_0xf8bf('0x31')](_0xf8bf('0x88'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2['uniqueid']][_0xf8bf('0x89')]=_0x29d8a2[_0xf8bf('0x84')];}else if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')][_0xf8bf('0x8a')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x29d8a2['uniqueid'],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]]['type']=_0x29d8a2[_0xf8bf('0x84')];}else if(this[_0xf8bf('0x38')](_0x29d8a2['variable'][_0xf8bf('0x8b')])){logger[_0xf8bf('0x31')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')][_0xf8bf('0x45')](',')[0x0]);this['channels'][_0x29d8a2['uniqueid']]['queue']=_0x29d8a2[_0xf8bf('0x84')][_0xf8bf('0x45')](',')[0x0];}else if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')]['xmd-originatecalleridnum'])){logger['info'](_0xf8bf('0x8c'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2['value']);this['channels'][_0x29d8a2[_0xf8bf('0x3c')]][_0xf8bf('0x8d')]=_0x29d8a2[_0xf8bf('0x84')];}else if(this[_0xf8bf('0x38')](_0x29d8a2['variable'][_0xf8bf('0x8e')])){logger[_0xf8bf('0x31')](_0xf8bf('0x8f'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]][_0xf8bf('0x90')]=_0x29d8a2[_0xf8bf('0x84')];}else if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')][_0xf8bf('0x91')])){logger[_0xf8bf('0x31')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s',_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2['value']);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]][_0xf8bf('0x92')]=_0x29d8a2[_0xf8bf('0x84')];}else if(this['isNotNull'](_0x29d8a2[_0xf8bf('0x81')][_0xf8bf('0x93')])){logger[_0xf8bf('0x31')](_0xf8bf('0x94'),_0x29d8a2[_0xf8bf('0x3c')],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2['uniqueid']]['queue']=_0x29d8a2[_0xf8bf('0x84')];}else if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')][_0xf8bf('0x95')])){logger[_0xf8bf('0x31')](_0xf8bf('0x96'),_0x29d8a2['uniqueid'],_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3c')]][_0xf8bf('0x97')]=_0x29d8a2['value'];}}}else if(this[_0xf8bf('0x38')](_0x29d8a2['variable'][_0xf8bf('0x82')])){if(_0x29d8a2[_0xf8bf('0x84')]){var _0x2efbe3=path[_0xf8bf('0x98')](_0x29d8a2['value'])[_0xf8bf('0x4a')];logger[_0xf8bf('0x31')](_0xf8bf('0x83'),_0x2efbe3,_0x29d8a2[_0xf8bf('0x84')]);this[_0xf8bf('0x75')](_0x2efbe3,_0x29d8a2['value']);}}else if(this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3d')]]){if(this[_0xf8bf('0x38')](_0x29d8a2[_0xf8bf('0x81')])){if(this[_0xf8bf('0x38')](_0x29d8a2['variable'][_0xf8bf('0x95')])){logger[_0xf8bf('0x31')](_0xf8bf('0x96'),_0x29d8a2['linkedid'],_0x29d8a2['value']);this[_0xf8bf('0x1e')][_0x29d8a2[_0xf8bf('0x3d')]][_0xf8bf('0x99')]=_0x29d8a2['value'];}}}}}catch(_0x2c5ffa){logger['error'](_0xf8bf('0x9a'),_0x29d8a2[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x2c5ffa,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x2a')]=function(_0x3de85c){try{if(this[_0xf8bf('0x38')](_0x3de85c)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x3de85c[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x3de85c,{'showHidden':![],'depth':null}));if(this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]]){logger[_0xf8bf('0x31')](_0xf8bf('0x9b'),_0x3de85c['uniqueid'],_0x3de85c[_0xf8bf('0x9c')]);var _0x30ec06=moment();this[_0xf8bf('0x1e')][_0x3de85c['uniqueid']][_0xf8bf('0x9d')]=_0x30ec06[_0xf8bf('0x48')](_0xf8bf('0x60'));this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]]['duration']=_0x30ec06[_0xf8bf('0x6a')](this['channels'][_0x3de85c['uniqueid']][_0xf8bf('0x54')],_0xf8bf('0x5f'));if(this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x68')]){this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x9e')]=_0x30ec06[_0xf8bf('0x6a')](this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]]['answertime'],_0xf8bf('0x5f'));this['channels'][_0x3de85c['uniqueid']][_0xf8bf('0x69')]=this[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x9f')]-this[_0xf8bf('0x1e')][_0x3de85c['uniqueid']]['billableseconds'];}if(_0x3de85c[_0xf8bf('0x53')]===_0xf8bf('0x42')){if(this[_0xf8bf('0x43')][_0x3de85c['channel'][_0xf8bf('0x45')]('-')[0x0]]){this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]=_[_0xf8bf('0xa0')](this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]],[_0xf8bf('0x47')]);logger[_0xf8bf('0x4f')](_0xf8bf('0xa1'),_0x3de85c[_0xf8bf('0x3c')],util[_0xf8bf('0x36')]({'id':this[_0xf8bf('0x43')][_0x3de85c['channel'][_0xf8bf('0x45')]('-')[0x0]]['id'],'destaccountcode':this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this['emit'](util[_0xf8bf('0x48')](_0xf8bf('0x49'),this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x4a')]),_0xf8bf('0xa2'),{'id':this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]]['id'],'destaccountcode':this[_0xf8bf('0x43')][_0x3de85c[_0xf8bf('0x44')][_0xf8bf('0x45')]('-')[0x0]][_0xf8bf('0x73')]});}}var _0x25c794=this;Promise[_0xf8bf('0xa3')]()[_0xf8bf('0xa4')](function(){var _0x2053af=_0x25c794['channels'][_0x3de85c[_0xf8bf('0x3c')]];if(typeof _0x2053af[_0xf8bf('0xa5')]===_0xf8bf('0xa6'))return;if(_[_0xf8bf('0xa7')](_0x2053af[_0xf8bf('0x7c')]))return;return RpcSetting[_0xf8bf('0xa8')]()['then'](function(_0x2661d8){if(!_0x2661d8[_0xf8bf('0xa9')])return;return Promise[_0xf8bf('0xa3')]()['then'](function(){return ami[_0xf8bf('0xaa')]({'action':_0xf8bf('0xab'),'channel':_0x2053af[_0xf8bf('0x44')]})['catch'](function(){});})[_0xf8bf('0xa4')](function(){return ami[_0xf8bf('0xaa')]({'action':_0xf8bf('0xab'),'channel':_0x2053af[_0xf8bf('0x6d')]})[_0xf8bf('0xac')](function(){})[_0xf8bf('0xad')](function(){var _0x39ad0b=_0x25c794[_0xf8bf('0x43')][_0x2053af[_0xf8bf('0x6d')][_0xf8bf('0x45')]('-')[0x0]];if(!_0x39ad0b)return;io[_0xf8bf('0x39')](_0xf8bf('0xae'),{'agentId':_0x39ad0b['id'],'uniqueid':_0x2053af[_0xf8bf('0x3c')]});});});});})[_0xf8bf('0xa4')](function(){if(_0x3de85c[_0xf8bf('0xaf')]===_0xf8bf('0xb0')){_0x25c794[_0xf8bf('0x1f')][_0x3de85c[_0xf8bf('0x3c')]]=_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]];}else{if(_0x25c794['channels'][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0xb1')]==='outbound'&&_0x25c794[_0xf8bf('0x1f')][_0x3de85c[_0xf8bf('0x3c')]]){_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x3c')]=[_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x3d')],_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x3d')]=_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]][_0xf8bf('0x3c')]][0x0];delete _0x25c794[_0xf8bf('0x1f')][_0x3de85c[_0xf8bf('0x3c')]];}}logger[_0xf8bf('0x4f')](_0xf8bf('0xb2'),_0x3de85c['uniqueid'],util[_0xf8bf('0x36')](_0x25c794['channels'][_0x3de85c['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0xf8bf('0xb3'),_0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]]);delete _0x25c794[_0xf8bf('0x1e')][_0x3de85c[_0xf8bf('0x3c')]];});}}}catch(_0x4b94ba){logger[_0xf8bf('0x34')](_0xf8bf('0xb4'),_0x3de85c[_0xf8bf('0x3c')],util['inspect'](_0x4b94ba,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')][_0xf8bf('0x2d')]=function(_0x46123f){try{if(this[_0xf8bf('0x38')](_0x46123f)){logger['info'](_0xf8bf('0xb5'),_0x46123f[_0xf8bf('0x3c')],_0x46123f[_0xf8bf('0xb6')],_0x46123f['transfertargetcalleridnum']);logger[_0xf8bf('0x4f')](_0xf8bf('0xb7'),_0x46123f['uniqueid'],util[_0xf8bf('0x36')](_0x46123f,{'showHidden':![],'depth':null}));if(this['channels'][_0x46123f[_0xf8bf('0xb8')]]){this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xb8')]]['transfercalleridnum']=_0x46123f['origtransferercalleridnum'];this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xb8')]]['transferconnectedlinenum']=_0x46123f[_0xf8bf('0xb9')];if(this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xba')]]){var _0x297e48=this[_0xf8bf('0x1e')][_0x46123f['secondtransfereruniqueid']];this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xba')]]=this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xb8')]];this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xb8')]]=_0x297e48;}}else if(this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbb')]]){this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbb')]][_0xf8bf('0xbc')]=_0x46123f[_0xf8bf('0xb6')];this['channels'][_0x46123f[_0xf8bf('0xbb')]][_0xf8bf('0xbd')]=_0x46123f[_0xf8bf('0xb9')];if(this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbe')]]){var _0x297e48=this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbe')]];this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbe')]]=this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbb')]];this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbb')]]=_0x297e48;}}if((this[_0xf8bf('0x1e')][_0x46123f['origtransfereruniqueid']]||this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbf')]])&&this['channels'][_0x46123f[_0xf8bf('0xba')]]){var _0x1f42d9=_[_0xf8bf('0xc0')]([this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbe')]],this[_0xf8bf('0x1e')][_0x46123f['origtransfererlinkedid']],this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xba')]]],function(_0x523c08){return _0x523c08&&_0x523c08['type']==='outbound'&&_0x523c08[_0xf8bf('0xc1')];});if(_0x1f42d9){if(this[_0xf8bf('0x1e')][_0x46123f['origtransfereruniqueid']])this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbe')]]['transferType']=_0xf8bf('0xc2');if(this[_0xf8bf('0x1e')][_0x46123f['origtransfererlinkedid']])this[_0xf8bf('0x1e')][_0x46123f[_0xf8bf('0xbf')]][_0xf8bf('0xa5')]=_0xf8bf('0xc2');this['channels'][_0x46123f['secondtransfereruniqueid']][_0xf8bf('0xa5')]=_0xf8bf('0xc2');}}}}catch(_0x81814c){logger[_0xf8bf('0x34')](_0xf8bf('0xc3'),_0x46123f[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x81814c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xf8bf('0xc4')]=function(_0x246a7e){try{if(this['isNotNull'](_0x246a7e)){logger['info'](_0xf8bf('0xc5'),_0x246a7e['uniqueid'],_0x246a7e[_0xf8bf('0xc6')],_0x246a7e[_0xf8bf('0xc7')]);logger[_0xf8bf('0x4f')](_0xf8bf('0xc8'),_0x246a7e[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x246a7e,{'showHidden':![],'depth':null}));if(this[_0xf8bf('0x1e')][_0x246a7e[_0xf8bf('0xb8')]]){this[_0xf8bf('0x1e')][_0x246a7e[_0xf8bf('0xb8')]]['transfercalleridnum']=_0x246a7e[_0xf8bf('0xc6')];this[_0xf8bf('0x1e')][_0x246a7e[_0xf8bf('0xb8')]][_0xf8bf('0xbd')]=_0x246a7e[_0xf8bf('0xc7')];this[_0xf8bf('0x1e')][_0x246a7e[_0xf8bf('0xb8')]][_0xf8bf('0xa5')]=_0xf8bf('0xc9');this[_0xf8bf('0x2a')]({'event':_0xf8bf('0xb0'),'uniqueid':_0x246a7e['transfereeuniqueid'],'context':_0x246a7e[_0xf8bf('0x53')],'channel':_0x246a7e[_0xf8bf('0xca')]});}else{this[_0xf8bf('0x1e')][_0x246a7e[_0xf8bf('0xcb')]][_0xf8bf('0xa5')]=_0xf8bf('0xc9');}}}catch(_0x4b8d97){logger[_0xf8bf('0x34')](_0xf8bf('0xcc'),_0x246a7e[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x4b8d97,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')]['syncMusicOnHoldStart']=function(_0xc10871){try{if(this[_0xf8bf('0x38')](_0xc10871)){logger[_0xf8bf('0x4f')](_0xf8bf('0xcd'),_0xc10871[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0xc10871,{'showHidden':![],'depth':null}));if(this[_0xf8bf('0x1e')][_0xc10871[_0xf8bf('0x3c')]]){if(!_[_0xf8bf('0x7d')](this[_0xf8bf('0x1e')][_0xc10871['uniqueid']]['answertime'])){this[_0xf8bf('0x1e')][_0xc10871[_0xf8bf('0x3c')]]['mohstarttime']=moment()['format'](_0xf8bf('0x60'));logger[_0xf8bf('0x31')](_0xf8bf('0xce'),_0xc10871[_0xf8bf('0x3c')],this[_0xf8bf('0x1e')][_0xc10871['uniqueid']]['mohstarttime']);}}}}catch(_0x5d7591){logger[_0xf8bf('0x34')](_0xf8bf('0xcf'),_0xc10871[_0xf8bf('0x3c')],util['inspect'](_0x5d7591,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xf8bf('0x37')]['syncMusicOnHoldStop']=function(_0x5e82fd){try{if(this[_0xf8bf('0x38')](_0x5e82fd)){logger[_0xf8bf('0x4f')](_0xf8bf('0xd0'),_0x5e82fd[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x5e82fd,{'showHidden':![],'depth':null}));if(this['channels'][_0x5e82fd['uniqueid']]){if(!_[_0xf8bf('0x7d')](this['channels'][_0x5e82fd['uniqueid']][_0xf8bf('0xd1')])){this[_0xf8bf('0x1e')][_0x5e82fd[_0xf8bf('0x3c')]][_0xf8bf('0xd2')]+=moment()[_0xf8bf('0xd3')](0x0)[_0xf8bf('0x6a')](this[_0xf8bf('0x1e')][_0x5e82fd[_0xf8bf('0x3c')]]['mohstarttime'],_0xf8bf('0x5f'));logger[_0xf8bf('0x31')](_0xf8bf('0xd4'),_0x5e82fd['uniqueid'],this['channels'][_0x5e82fd[_0xf8bf('0x3c')]][_0xf8bf('0xd2')]);delete this[_0xf8bf('0x1e')][_0x5e82fd[_0xf8bf('0x3c')]]['mohstarttime'];}}}}catch(_0x43d9b6){logger[_0xf8bf('0x34')](_0xf8bf('0xd5'),_0x5e82fd[_0xf8bf('0x3c')],util[_0xf8bf('0x36')](_0x43d9b6,{'showHidden':![],'depth':null}));}};module[_0xf8bf('0xd6')]=VoiceCallReport;
\ No newline at end of file
index b80427d..6008814 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94a0=['channel','substring','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','isNil','cause-txt','duration','endtime','diff','total','holdtime','starttime','seconds','billableseconds','sumHoldTime','sumBillable','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','appdata','toLowerCase','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceDialReport][newexten]','lodash','moment','ioredis','../../../config/environment','ami','../ami','redis','defaults','localhost','channels','outbound','applications','variables','dialbegin','syncDialBegin','bind','syncDialEnd','syncVarSet','syncNewExten','hangup','syncHangup','prototype','isNotNull','isUndefined','emit','debug','inspect','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xd6ae40,_0x58f493){var _0x2aae3a=function(_0xd806e6){while(--_0xd806e6){_0xd6ae40['push'](_0xd6ae40['shift']());}};_0x2aae3a(++_0x58f493);}(_0x94a0,0x1a6));var _0x094a=function(_0x4cf104,_0x470834){_0x4cf104=_0x4cf104-0x0;var _0xa32f24=_0x94a0[_0x4cf104];return _0xa32f24;};'use strict';var _=require(_0x094a('0x0'));var moment=require(_0x094a('0x1'));var util=require('util');var Redis=require(_0x094a('0x2'));var config=require(_0x094a('0x3'));var logger=require('../../../config/logger')(_0x094a('0x4'));var ami=require(_0x094a('0x5'));config[_0x094a('0x6')]=_[_0x094a('0x7')](config['redis'],{'host':_0x094a('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x094a('0x6')]));function VoiceDialReport(_0x32298b){this[_0x094a('0x9')]=_0x32298b['outboundChannels'];this[_0x094a('0xa')]=_0x32298b[_0x094a('0xa')];this[_0x094a('0xb')]={};this[_0x094a('0xc')]={};ami['on'](_0x094a('0xd'),this[_0x094a('0xe')][_0x094a('0xf')](this));ami['on']('dialend',this[_0x094a('0x10')][_0x094a('0xf')](this));ami['on']('varset',this[_0x094a('0x11')][_0x094a('0xf')](this));ami['on']('newexten',this[_0x094a('0x12')][_0x094a('0xf')](this));ami['on'](_0x094a('0x13'),this[_0x094a('0x14')][_0x094a('0xf')](this));}VoiceDialReport[_0x094a('0x15')][_0x094a('0x16')]=function(_0x1a1c74){return _0x1a1c74!==null&&!_[_0x094a('0x17')](_0x1a1c74);};VoiceDialReport[_0x094a('0x15')]['emit']=function(_0x593e0d,_0x290994,_0x5f4cb1){io['to'](_0x593e0d)[_0x094a('0x18')](_0x290994,_0x5f4cb1);};VoiceDialReport[_0x094a('0x15')]['syncDialBegin']=function(_0x6c0fae){try{if(this['isNotNull'](_0x6c0fae)){logger[_0x094a('0x19')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x6c0fae['uniqueid'],util[_0x094a('0x1a')](_0x6c0fae,{'showHidden':![],'depth':null}));if(this[_0x094a('0x9')][_0x6c0fae[_0x094a('0x1b')]]){_[_0x094a('0x1c')](this[_0x094a('0x9')][_0x6c0fae[_0x094a('0x1b')]],{'starttime':moment()['format'](_0x094a('0x1d')),'lastevent':'called','interface':_0x6c0fae[_0x094a('0x1e')][_0x094a('0x1f')](0x0,_0x6c0fae[_0x094a('0x1e')]['lastIndexOf']('-')),'membername':_0x6c0fae[_0x094a('0x1e')][_0x094a('0x1f')](_0x6c0fae[_0x094a('0x1e')][_0x094a('0x20')]('/')+0x1,_0x6c0fae[_0x094a('0x1e')][_0x094a('0x20')]('-'))},_[_0x094a('0x21')](_0x6c0fae,[_0x094a('0x22'),_0x094a('0x23')]));logger[_0x094a('0x24')](_0x094a('0x25'),_0x6c0fae[_0x094a('0x1b')],this[_0x094a('0x9')][_0x6c0fae[_0x094a('0x1b')]][_0x094a('0x26')],this[_0x094a('0x9')][_0x6c0fae['uniqueid']][_0x094a('0x27')]);logger[_0x094a('0x19')](_0x094a('0x28'),_0x6c0fae[_0x094a('0x1b')],util[_0x094a('0x1a')](this['channels'][_0x6c0fae[_0x094a('0x1b')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x6c0fae['uniqueid']])_[_0x094a('0x1c')](this[_0x094a('0x9')][_0x6c0fae[_0x094a('0x1b')]],this[_0x094a('0xb')][_0x6c0fae[_0x094a('0x1b')]]);this[_0x094a('0x18')]('voice:outbound','voice_outbound_channel:save',this[_0x094a('0x9')][_0x6c0fae['uniqueid']]);logger[_0x094a('0x19')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x6c0fae[_0x094a('0x1b')],util[_0x094a('0x1a')](this['channels'][_0x6c0fae['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x094a('0x18')](_0x094a('0x29'),this['channels'][_0x6c0fae[_0x094a('0x1b')]]);}}}catch(_0x3b624c){logger[_0x094a('0x2a')](_0x094a('0x2b'),_0x6c0fae[_0x094a('0x1b')],util['inspect'](_0x3b624c,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x094a('0x15')][_0x094a('0x10')]=function(_0x4ff389){try{if(this[_0x094a('0x16')](_0x4ff389)){logger['debug'](_0x094a('0x2c'),_0x4ff389[_0x094a('0x1b')],util[_0x094a('0x1a')](_0x4ff389,{'showHidden':![],'depth':null}));if(this[_0x094a('0x9')][_0x4ff389[_0x094a('0x1b')]]){this[_0x094a('0x9')][_0x4ff389[_0x094a('0x1b')]][_0x094a('0x2d')]=_0x4ff389['dialstatus'];if(_0x4ff389[_0x094a('0x2d')]===_0x094a('0x2e')){this[_0x094a('0x9')][_0x4ff389['uniqueid']][_0x094a('0x2f')]=_0x4ff389[_0x094a('0x2f')];this[_0x094a('0x9')][_0x4ff389['uniqueid']][_0x094a('0x30')]=_0x4ff389['connectedlinename'];this[_0x094a('0x9')][_0x4ff389[_0x094a('0x1b')]][_0x094a('0x31')]=moment()[_0x094a('0x32')](_0x094a('0x1d'));this[_0x094a('0x9')][_0x4ff389[_0x094a('0x1b')]][_0x094a('0x33')]=_0x094a('0x34');logger[_0x094a('0x24')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x4ff389[_0x094a('0x1b')],_0x4ff389['channel'][_0x094a('0x1f')](_0x4ff389[_0x094a('0x1e')][_0x094a('0x20')]('/')+0x1,_0x4ff389[_0x094a('0x1e')][_0x094a('0x20')]('-')));logger['debug'](_0x094a('0x35'),_0x4ff389[_0x094a('0x1b')],util[_0x094a('0x1a')](this['channels'][_0x4ff389['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x094a('0x18')](_0x094a('0x36'),this[_0x094a('0x9')][_0x4ff389['uniqueid']]);}logger['debug'](_0x094a('0x37'),_0x4ff389[_0x094a('0x1b')],util[_0x094a('0x1a')](this[_0x094a('0x9')][_0x4ff389[_0x094a('0x1b')]],{'showHidden':![],'depth':null}));this[_0x094a('0x18')](_0x094a('0x38'),'voice_outbound_channel:save',this[_0x094a('0x9')][_0x4ff389[_0x094a('0x1b')]]);}}}catch(_0x36fc28){logger[_0x094a('0x2a')](_0x094a('0x39'),_0x4ff389['uniqueid'],util[_0x094a('0x1a')](_0x36fc28,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x094a('0x15')]['syncVarSet']=function(_0xdb8a54){try{if(this[_0x094a('0x16')](_0xdb8a54)){logger[_0x094a('0x19')](_0x094a('0x3a'),_0xdb8a54['uniqueid'],util['inspect'](_0xdb8a54,{'showHidden':![],'depth':null}));this[_0x094a('0x3b')](_0xdb8a54[_0x094a('0x1b')],_[_0x094a('0x3c')](_0xdb8a54['variable'])[0x0],_0xdb8a54[_0x094a('0x3d')]);if(this[_0x094a('0x16')](_0xdb8a54[_0x094a('0x3e')])&&this[_0x094a('0x16')](_0xdb8a54['variable']['outboundrouteid'])){if(_[_0x094a('0x17')](this[_0x094a('0x9')][_0xdb8a54[_0x094a('0x1b')]])){this[_0x094a('0x9')][_0xdb8a54[_0x094a('0x1b')]]={'routeId':_0xdb8a54[_0x094a('0x3d')],'variables':this[_0x094a('0xc')][_0xdb8a54[_0x094a('0x1b')]]};logger[_0x094a('0x24')](_0x094a('0x3f'),_0xdb8a54[_0x094a('0x1b')],_0xdb8a54[_0x094a('0x3e')][_0x094a('0x40')],_[_0x094a('0x3c')](_0xdb8a54['variable'])[0x0],_0xdb8a54[_0x094a('0x3d')]);logger[_0x094a('0x19')](_0x094a('0x41'),_0xdb8a54['uniqueid'],util[_0x094a('0x1a')](this[_0x094a('0x9')][_0xdb8a54['uniqueid']],{'showHidden':![],'depth':null}));this[_0x094a('0x18')](_0x094a('0x38'),_0x094a('0x42'),this['channels'][_0xdb8a54[_0x094a('0x1b')]]);}}}}catch(_0x25740b){logger[_0x094a('0x2a')](_0x094a('0x43'),_0xdb8a54[_0x094a('0x1b')],util['inspect'](_0x25740b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x094a('0x15')][_0x094a('0x3b')]=function(_0x596269,_0x227c09,_0xbe8c3b){var _0x2177eb=['rtpaudioqos',_0x094a('0x44'),_0x094a('0x45'),_0x094a('0x46'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x094a('0x47'),_0x094a('0x48'),_0x094a('0x49'),_0x094a('0x4a'),_0x094a('0x4b'),_0x094a('0x4c'),_0x094a('0x4d'),'memberdynamic','memberinterface',_0x094a('0x4e'),_0x094a('0x26'),_0x094a('0x4f'),_0x094a('0x50')];if(!_[_0x094a('0x51')](_0x227c09)&&!_['includes'](_0x2177eb,_0x227c09)){if(_[_0x094a('0x17')](this[_0x094a('0xc')][_0x596269])){this[_0x094a('0xc')][_0x596269]={};}this[_0x094a('0xc')][_0x596269][_0x227c09]=_0xbe8c3b;}};VoiceDialReport[_0x094a('0x15')][_0x094a('0x14')]=function(_0x582307){try{if(this[_0x094a('0x16')](_0x582307)){logger[_0x094a('0x19')]('[%s][voiceDialReport][hangup]\x20event:',_0x582307[_0x094a('0x1b')],util['inspect'](_0x582307,{'showHidden':![],'depth':null}));if(this[_0x094a('0x9')][_0x582307['uniqueid']]){logger[_0x094a('0x24')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x582307[_0x094a('0x1b')],_0x582307[_0x094a('0x52')]);this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]]['endtime']=moment()['format'](_0x094a('0x1d'));this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]][_0x094a('0x53')]=moment(this[_0x094a('0x9')][_0x582307['uniqueid']][_0x094a('0x54')])[_0x094a('0x55')](this[_0x094a('0x9')][_0x582307['uniqueid']]['starttime'],'seconds');this['channels'][_0x582307[_0x094a('0x1b')]]['lastevent']='complete';this[_0x094a('0xa')][_0x094a('0x56')]+=0x1;if(this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]][_0x094a('0x31')]){this['outbound']['answered']+=0x1;this[_0x094a('0x9')][_0x582307['uniqueid']][_0x094a('0x57')]=moment(this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]][_0x094a('0x31')])[_0x094a('0x55')](this[_0x094a('0x9')][_0x582307['uniqueid']][_0x094a('0x58')],_0x094a('0x59'));this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]][_0x094a('0x5a')]=moment(this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]]['endtime'])[_0x094a('0x55')](this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]][_0x094a('0x31')],_0x094a('0x59'));this[_0x094a('0xa')][_0x094a('0x5b')]+=this['channels'][_0x582307[_0x094a('0x1b')]][_0x094a('0x57')]||0x0;this[_0x094a('0xa')][_0x094a('0x5c')]+=this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]][_0x094a('0x5a')];}this['outbound']['sumDuration']+=this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]][_0x094a('0x53')];logger[_0x094a('0x19')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x582307['uniqueid'],util['inspect'](this['channels'][_0x582307[_0x094a('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x094a('0x18')]('custom:voiceDialReport',this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]]);logger[_0x094a('0x19')](_0x094a('0x5d'),_0x582307['uniqueid'],util['inspect'](this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x094a('0x18')](_0x094a('0x5e'),this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]]);logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:',_0x582307[_0x094a('0x1b')],util[_0x094a('0x1a')](this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]],{'showHidden':![],'depth':null}));this[_0x094a('0x18')](_0x094a('0x38'),_0x094a('0x5f'),this[_0x094a('0xa')]);logger[_0x094a('0x24')](_0x094a('0x60'),JSON[_0x094a('0x61')](this['channels'][_0x582307[_0x094a('0x1b')]]));logger[_0x094a('0x19')](_0x094a('0x62'),_0x582307[_0x094a('0x1b')],util[_0x094a('0x1a')](this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]],{'showHidden':![],'depth':null}));this[_0x094a('0x18')](_0x094a('0x38'),_0x094a('0x63'),this[_0x094a('0x9')][_0x582307[_0x094a('0x1b')]]);delete this['channels'][_0x582307[_0x094a('0x1b')]];}else if(this[_0x094a('0x9')][_0x582307[_0x094a('0x64')]]){this[_0x094a('0x9')][_0x582307[_0x094a('0x64')]][_0x094a('0x1b')]=this[_0x094a('0x9')][_0x582307[_0x094a('0x64')]][_0x094a('0x65')];}if(this[_0x094a('0xc')][_0x582307[_0x094a('0x1b')]]){delete this['variables'][_0x582307['uniqueid']];}}}catch(_0x59c0e9){logger[_0x094a('0x2a')](_0x094a('0x66'),_0x582307[_0x094a('0x1b')],util['inspect'](_0x59c0e9,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x094a('0x15')][_0x094a('0x12')]=function(_0x4e5c7c){try{if(this['isNotNull'](_0x4e5c7c)){logger[_0x094a('0x19')](_0x094a('0x67'),_0x4e5c7c['uniqueid'],util[_0x094a('0x1a')](_0x4e5c7c,{'showHidden':![],'depth':null}));if(_0x4e5c7c[_0x094a('0x68')]['toLowerCase']()===_0x094a('0x69')){_0x4e5c7c[_0x094a('0x6a')]=(_0x4e5c7c[_0x094a('0x6b')]||_0x4e5c7c[_0x094a('0x6a')])[_0x094a('0x6c')]();if(_['startsWith'](_0x4e5c7c['applicationdata'],_0x094a('0x6d'))){if(_[_0x094a('0x17')](this[_0x094a('0xb')][_0x4e5c7c[_0x094a('0x1b')]]))this[_0x094a('0xb')][_0x4e5c7c['uniqueid']]={};logger['info'](_0x094a('0x6e'),_0x4e5c7c[_0x094a('0x1b')],_0x4e5c7c[_0x094a('0x68')],_0x4e5c7c[_0x094a('0x6a')]);var _0x9ca661=_0x4e5c7c[_0x094a('0x6a')][_0x094a('0x6f')]('=');var _0x30df42=_0x9ca661[0x0]['match'](/cdr\((.*)\)/);if(_0x30df42)this[_0x094a('0xb')][_0x4e5c7c[_0x094a('0x1b')]][_0x30df42[0x1]]=_0x9ca661[0x1];}}}}catch(_0x4d6daf){logger[_0x094a('0x2a')](_0x094a('0x70'),_0x4e5c7c[_0x094a('0x1b')],util[_0x094a('0x1a')](_0x4d6daf,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport;
\ No newline at end of file
+var _0x81f4=['[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','toLowerCase','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceDialReport][newexten]','exports','util','ioredis','ami','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','syncNewExten','hangup','prototype','isNotNull','emit','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','privilege','info','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','applications','voice:outbound','voice_outbound_channel:save','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','lastevent','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]','addVariable','keys','variable','value','variables','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','error','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','isUndefined','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','seconds','answertime','answered','holdtime','starttime','billableseconds','sumHoldTime','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x81f4,0x16b));var _0x481f=function(_0x495054,_0x41ad4c){_0x495054=_0x495054-0x0;var _0x5776e4=_0x81f4[_0x495054];return _0x5776e4;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x481f('0x0'));var Redis=require(_0x481f('0x1'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x481f('0x2'));var ami=require(_0x481f('0x3'));config[_0x481f('0x4')]=_[_0x481f('0x5')](config['redis'],{'host':_0x481f('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x481f('0x4')]));function VoiceDialReport(_0x22d302){this[_0x481f('0x7')]=_0x22d302[_0x481f('0x8')];this[_0x481f('0x9')]=_0x22d302[_0x481f('0x9')];this['applications']={};this['variables']={};ami['on'](_0x481f('0xa'),this[_0x481f('0xb')][_0x481f('0xc')](this));ami['on'](_0x481f('0xd'),this[_0x481f('0xe')][_0x481f('0xc')](this));ami['on']('varset',this[_0x481f('0xf')][_0x481f('0xc')](this));ami['on']('newexten',this[_0x481f('0x10')][_0x481f('0xc')](this));ami['on'](_0x481f('0x11'),this['syncHangup'][_0x481f('0xc')](this));}VoiceDialReport[_0x481f('0x12')][_0x481f('0x13')]=function(_0x32b3df){return _0x32b3df!==null&&!_['isUndefined'](_0x32b3df);};VoiceDialReport['prototype'][_0x481f('0x14')]=function(_0x159a7b,_0x5a5b2e,_0x4f28d7){io['to'](_0x159a7b)[_0x481f('0x14')](_0x5a5b2e,_0x4f28d7);};VoiceDialReport[_0x481f('0x12')][_0x481f('0xb')]=function(_0x1277f9){try{if(this['isNotNull'](_0x1277f9)){logger['debug'](_0x481f('0x15'),_0x1277f9[_0x481f('0x16')],util[_0x481f('0x17')](_0x1277f9,{'showHidden':![],'depth':null}));if(this[_0x481f('0x7')][_0x1277f9[_0x481f('0x16')]]){_[_0x481f('0x18')](this['channels'][_0x1277f9['uniqueid']],{'starttime':moment()[_0x481f('0x19')](_0x481f('0x1a')),'lastevent':_0x481f('0x1b'),'interface':_0x1277f9[_0x481f('0x1c')][_0x481f('0x1d')](0x0,_0x1277f9[_0x481f('0x1c')][_0x481f('0x1e')]('-')),'membername':_0x1277f9[_0x481f('0x1c')][_0x481f('0x1d')](_0x1277f9[_0x481f('0x1c')][_0x481f('0x1e')]('/')+0x1,_0x1277f9['channel']['lastIndexOf']('-'))},_[_0x481f('0x1f')](_0x1277f9,[_0x481f('0x20'),_0x481f('0x21')]));logger[_0x481f('0x22')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x1277f9[_0x481f('0x16')],this['channels'][_0x1277f9['uniqueid']]['membername'],this[_0x481f('0x7')][_0x1277f9['uniqueid']][_0x481f('0x23')]);logger['debug'](_0x481f('0x24'),_0x1277f9[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x1277f9[_0x481f('0x16')]],{'showHidden':![],'depth':null}));if(this['applications'][_0x1277f9[_0x481f('0x16')]])_[_0x481f('0x18')](this['channels'][_0x1277f9[_0x481f('0x16')]],this[_0x481f('0x25')][_0x1277f9[_0x481f('0x16')]]);this['emit'](_0x481f('0x26'),_0x481f('0x27'),this[_0x481f('0x7')][_0x1277f9[_0x481f('0x16')]]);logger[_0x481f('0x28')](_0x481f('0x29'),_0x1277f9[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x1277f9['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x481f('0x14')]('custom:dialbegin',this[_0x481f('0x7')][_0x1277f9[_0x481f('0x16')]]);}}}catch(_0x72615e){logger['error'](_0x481f('0x2a'),_0x1277f9[_0x481f('0x16')],util['inspect'](_0x72615e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481f('0x12')]['syncDialEnd']=function(_0x3c786a){try{if(this['isNotNull'](_0x3c786a)){logger[_0x481f('0x28')](_0x481f('0x2b'),_0x3c786a['uniqueid'],util[_0x481f('0x17')](_0x3c786a,{'showHidden':![],'depth':null}));if(this['channels'][_0x3c786a['uniqueid']]){this['channels'][_0x3c786a[_0x481f('0x16')]][_0x481f('0x2c')]=_0x3c786a[_0x481f('0x2c')];if(_0x3c786a['dialstatus']==='ANSWER'){this['channels'][_0x3c786a[_0x481f('0x16')]]['connectedlinenum']=_0x3c786a[_0x481f('0x2d')];this[_0x481f('0x7')][_0x3c786a[_0x481f('0x16')]][_0x481f('0x2e')]=_0x3c786a[_0x481f('0x2e')];this[_0x481f('0x7')][_0x3c786a[_0x481f('0x16')]]['answertime']=moment()[_0x481f('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3c786a['uniqueid']][_0x481f('0x2f')]='connect';logger[_0x481f('0x22')](_0x481f('0x30'),_0x3c786a[_0x481f('0x16')],_0x3c786a[_0x481f('0x1c')]['substring'](_0x3c786a['channel'][_0x481f('0x1e')]('/')+0x1,_0x3c786a[_0x481f('0x1c')][_0x481f('0x1e')]('-')));logger[_0x481f('0x28')](_0x481f('0x31'),_0x3c786a[_0x481f('0x16')],util['inspect'](this[_0x481f('0x7')][_0x3c786a[_0x481f('0x16')]],{'showHidden':![],'depth':null}));ami[_0x481f('0x14')]('custom:dialconnect',this[_0x481f('0x7')][_0x3c786a[_0x481f('0x16')]]);}logger[_0x481f('0x28')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x3c786a['uniqueid'],util[_0x481f('0x17')](this['channels'][_0x3c786a[_0x481f('0x16')]],{'showHidden':![],'depth':null}));this[_0x481f('0x14')](_0x481f('0x26'),_0x481f('0x27'),this[_0x481f('0x7')][_0x3c786a[_0x481f('0x16')]]);}}}catch(_0x3a7dc7){logger['error'](_0x481f('0x32'),_0x3c786a[_0x481f('0x16')],util[_0x481f('0x17')](_0x3a7dc7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481f('0x12')][_0x481f('0xf')]=function(_0x2edd20){try{if(this[_0x481f('0x13')](_0x2edd20)){logger['debug']('[%s][voiceDialReport][varset]\x20event:',_0x2edd20[_0x481f('0x16')],util[_0x481f('0x17')](_0x2edd20,{'showHidden':![],'depth':null}));this[_0x481f('0x33')](_0x2edd20[_0x481f('0x16')],_[_0x481f('0x34')](_0x2edd20[_0x481f('0x35')])[0x0],_0x2edd20[_0x481f('0x36')]);if(this[_0x481f('0x13')](_0x2edd20[_0x481f('0x35')])&&this[_0x481f('0x13')](_0x2edd20[_0x481f('0x35')]['outboundrouteid'])){if(_['isUndefined'](this['channels'][_0x2edd20['uniqueid']])){this[_0x481f('0x7')][_0x2edd20[_0x481f('0x16')]]={'routeId':_0x2edd20[_0x481f('0x36')],'variables':this[_0x481f('0x37')][_0x2edd20[_0x481f('0x16')]]};logger['info'](_0x481f('0x38'),_0x2edd20['uniqueid'],_0x2edd20[_0x481f('0x35')][_0x481f('0x39')],_['keys'](_0x2edd20['variable'])[0x0],_0x2edd20[_0x481f('0x36')]);logger[_0x481f('0x28')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x2edd20[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x2edd20[_0x481f('0x16')]],{'showHidden':![],'depth':null}));this[_0x481f('0x14')]('voice:outbound',_0x481f('0x27'),this[_0x481f('0x7')][_0x2edd20[_0x481f('0x16')]]);}}}}catch(_0x1f20c7){logger[_0x481f('0x3a')](_0x481f('0x3b'),_0x2edd20[_0x481f('0x16')],util[_0x481f('0x17')](_0x1f20c7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481f('0x12')]['addVariable']=function(_0x22307b,_0x3a0781,_0xee62a2){var _0x2a7a8e=['rtpaudioqos',_0x481f('0x3c'),_0x481f('0x3d'),'rtpaudioqosjitterbridged',_0x481f('0x3e'),_0x481f('0x3f'),_0x481f('0x40'),_0x481f('0x41'),_0x481f('0x42'),_0x481f('0x43'),_0x481f('0x44'),_0x481f('0x45'),_0x481f('0x46'),'memberdynamic','memberinterface',_0x481f('0x47'),_0x481f('0x48'),_0x481f('0x49'),_0x481f('0x4a')];if(!_[_0x481f('0x4b')](_0x3a0781)&&!_[_0x481f('0x4c')](_0x2a7a8e,_0x3a0781)){if(_[_0x481f('0x4d')](this[_0x481f('0x37')][_0x22307b])){this[_0x481f('0x37')][_0x22307b]={};}this[_0x481f('0x37')][_0x22307b][_0x3a0781]=_0xee62a2;}};VoiceDialReport[_0x481f('0x12')]['syncHangup']=function(_0x561d7d){try{if(this['isNotNull'](_0x561d7d)){logger[_0x481f('0x28')](_0x481f('0x4e'),_0x561d7d[_0x481f('0x16')],util[_0x481f('0x17')](_0x561d7d,{'showHidden':![],'depth':null}));if(this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]]){logger['info'](_0x481f('0x4f'),_0x561d7d[_0x481f('0x16')],_0x561d7d[_0x481f('0x50')]);this[_0x481f('0x7')][_0x561d7d['uniqueid']][_0x481f('0x51')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x52')]=moment(this['channels'][_0x561d7d[_0x481f('0x16')]][_0x481f('0x51')])[_0x481f('0x53')](this[_0x481f('0x7')][_0x561d7d['uniqueid']]['starttime'],_0x481f('0x54'));this['channels'][_0x561d7d[_0x481f('0x16')]][_0x481f('0x2f')]='complete';this[_0x481f('0x9')]['total']+=0x1;if(this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x55')]){this[_0x481f('0x9')][_0x481f('0x56')]+=0x1;this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x57')]=moment(this['channels'][_0x561d7d['uniqueid']]['answertime'])[_0x481f('0x53')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x58')],_0x481f('0x54'));this['channels'][_0x561d7d['uniqueid']][_0x481f('0x59')]=moment(this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x51')])[_0x481f('0x53')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]]['answertime'],_0x481f('0x54'));this[_0x481f('0x9')][_0x481f('0x5a')]+=this[_0x481f('0x7')][_0x561d7d['uniqueid']][_0x481f('0x57')]||0x0;this[_0x481f('0x9')]['sumBillable']+=this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x59')];}this[_0x481f('0x9')][_0x481f('0x5b')]+=this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]][_0x481f('0x52')];logger[_0x481f('0x28')](_0x481f('0x5c'),_0x561d7d[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]],{'showHidden':![],'depth':null}));ami['emit'](_0x481f('0x5d'),this['channels'][_0x561d7d[_0x481f('0x16')]]);logger[_0x481f('0x28')](_0x481f('0x5e'),_0x561d7d[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]],{'showHidden':![],'depth':null}));ami[_0x481f('0x14')](_0x481f('0x5f'),this['channels'][_0x561d7d['uniqueid']]);logger[_0x481f('0x28')](_0x481f('0x60'),_0x561d7d[_0x481f('0x16')],util[_0x481f('0x17')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]],{'showHidden':![],'depth':null}));this['emit'](_0x481f('0x26'),_0x481f('0x61'),this[_0x481f('0x9')]);logger[_0x481f('0x22')](_0x481f('0x62'),JSON[_0x481f('0x63')](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]]));logger[_0x481f('0x28')](_0x481f('0x64'),_0x561d7d[_0x481f('0x16')],util['inspect'](this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]],{'showHidden':![],'depth':null}));this[_0x481f('0x14')](_0x481f('0x26'),_0x481f('0x65'),this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]]);delete this[_0x481f('0x7')][_0x561d7d[_0x481f('0x16')]];}else if(this['channels'][_0x561d7d[_0x481f('0x66')]]){this[_0x481f('0x7')][_0x561d7d[_0x481f('0x66')]][_0x481f('0x16')]=this[_0x481f('0x7')][_0x561d7d[_0x481f('0x66')]][_0x481f('0x67')];}if(this['variables'][_0x561d7d[_0x481f('0x16')]]){delete this['variables'][_0x561d7d[_0x481f('0x16')]];}}}catch(_0x11fc2b){logger[_0x481f('0x3a')](_0x481f('0x68'),_0x561d7d[_0x481f('0x16')],util[_0x481f('0x17')](_0x11fc2b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x481f('0x12')][_0x481f('0x10')]=function(_0x55ef39){try{if(this['isNotNull'](_0x55ef39)){logger[_0x481f('0x28')](_0x481f('0x69'),_0x55ef39['uniqueid'],util[_0x481f('0x17')](_0x55ef39,{'showHidden':![],'depth':null}));if(_0x55ef39[_0x481f('0x6a')]['toLowerCase']()===_0x481f('0x6b')){_0x55ef39[_0x481f('0x6c')]=(_0x55ef39['appdata']||_0x55ef39[_0x481f('0x6c')])[_0x481f('0x6d')]();if(_[_0x481f('0x6e')](_0x55ef39[_0x481f('0x6c')],_0x481f('0x6f'))){if(_[_0x481f('0x4d')](this[_0x481f('0x25')][_0x55ef39[_0x481f('0x16')]]))this[_0x481f('0x25')][_0x55ef39['uniqueid']]={};logger['info'](_0x481f('0x70'),_0x55ef39[_0x481f('0x16')],_0x55ef39[_0x481f('0x6a')],_0x55ef39[_0x481f('0x6c')]);var _0x205124=_0x55ef39[_0x481f('0x6c')][_0x481f('0x71')]('=');var _0x4f1149=_0x205124[0x0][_0x481f('0x72')](/cdr\((.*)\)/);if(_0x4f1149)this['applications'][_0x55ef39[_0x481f('0x16')]][_0x4f1149[0x1]]=_0x205124[0x1];}}}}catch(_0x59bde8){logger['error'](_0x481f('0x73'),_0x55ef39[_0x481f('0x16')],util[_0x481f('0x17')](_0x59bde8,{'showHidden':![],'depth':null}));}};module[_0x481f('0x74')]=VoiceDialReport;
\ No newline at end of file
index 8795fe3..138f2ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6170=['[voiceQueueReport][queues]','flagQueueSummary','then','[voiceQueueReport][queuesummary]','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','toNumber','callers','loggedin','custom:queuesummary','syncQueueSummaryComplete','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','linkedid','seconds','FORWARDTRANSFER','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','toUpperCase','[%s][voiceQueueReport][agentcomplete]','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','memberrealtime','includes','sumHoldTime','diff','length','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','transfertype','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','syncMusicOnHoldStop','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','CDR(routeAlias)','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','lodash','moment','util','md5','../../../config/environment','../../../config/logger','ami','defaults','localhost','socket.io-emitter','redis','prototype','enqueue','tail','finally','queueReports','agents','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','newexten','musiconholdstart','musiconholdstop','attendedtransfer','syncAttendedTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','clearZombieChannels','channels','isNil','Action','status','channel','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','name','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','unmanaged','abandoned','Trunk','active','Interval','stringify',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','loopQueueShow','queues'];(function(_0x1b9cd5,_0x103dc4){var _0x4c74ca=function(_0x460b5e){while(--_0x460b5e){_0x1b9cd5['push'](_0x1b9cd5['shift']());}};_0x4c74ca(++_0x103dc4);}(_0x6170,0x17d));var _0x0617=function(_0x490e04,_0x3eb774){_0x490e04=_0x490e04-0x0;var _0x2edf29=_0x6170[_0x490e04];return _0x2edf29;};'use strict';var _=require(_0x0617('0x0'));var moment=require(_0x0617('0x1'));var util=require(_0x0617('0x2'));var md5=require(_0x0617('0x3'));var Redis=require('ioredis');var config=require(_0x0617('0x4'));var logger=require(_0x0617('0x5'))(_0x0617('0x6'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config['redis']=_[_0x0617('0x7')](config['redis'],{'host':_0x0617('0x8'),'port':0x18eb});var io=require(_0x0617('0x9'))(new Redis(config[_0x0617('0xa')]));var Sequence=function(){};Sequence[_0x0617('0xb')][_0x0617('0xc')]=function(_0x11bfe5){this[_0x0617('0xd')]=this[_0x0617('0xd')]?this[_0x0617('0xd')][_0x0617('0xe')](_0x11bfe5):_0x11bfe5();};function VoiceQueueReport(_0x442e9f){this['sequence']=new Sequence();this[_0x0617('0xf')]={};this[_0x0617('0x10')]=_0x442e9f[_0x0617('0x10')];this['channels']=_0x442e9f[_0x0617('0x11')];this[_0x0617('0x12')]=_0x442e9f[_0x0617('0x12')];this['flagQueueSummary']=!![];this[_0x0617('0x13')]=_0x442e9f[_0x0617('0x13')];this[_0x0617('0x14')]={};ami['on'](_0x0617('0x15'),this[_0x0617('0x16')][_0x0617('0x17')](this));ami['on'](_0x0617('0x18'),this['syncQueueSummaryComplete'][_0x0617('0x17')](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin'][_0x0617('0x17')](this));ami['on'](_0x0617('0x19'),this[_0x0617('0x1a')][_0x0617('0x17')](this));ami['on'](_0x0617('0x1b'),this['syncQueueCallerLeave']['bind'](this));ami['on'](_0x0617('0x1c'),this[_0x0617('0x1d')][_0x0617('0x17')](this));ami['on'](_0x0617('0x1e'),this[_0x0617('0x1f')][_0x0617('0x17')](this));ami['on'](_0x0617('0x20'),this[_0x0617('0x21')][_0x0617('0x17')](this));ami['on']('hangup',this[_0x0617('0x22')][_0x0617('0x17')](this));ami['on'](_0x0617('0x23'),this['syncFullyBooted'][_0x0617('0x17')](this));ami['on'](_0x0617('0x24'),this['syncNewExten'][_0x0617('0x17')](this));ami['on'](_0x0617('0x25'),this['syncMusicOnHoldStart'][_0x0617('0x17')](this));ami['on'](_0x0617('0x26'),this['syncMusicOnHoldStop'][_0x0617('0x17')](this));ami['on'](_0x0617('0x27'),this[_0x0617('0x28')][_0x0617('0x17')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x0617('0x17')](this));this[_0x0617('0x29')]();this['loopQueueShow']();}function clearChannels(_0x193b81){if(!_[_0x0617('0x2a')](_0x193b81)){for(var _0x5bc350 in _0x193b81){if(_0x193b81[_0x0617('0x2b')](_0x5bc350)){delete _0x193b81[_0x5bc350];}}}}function clearCampaigns(_0x485711){if(!_[_0x0617('0x2a')](_0x485711)){for(var _0x45f00d in _0x485711){if(_0x485711[_0x0617('0x2b')](_0x45f00d)){_0x485711[_0x45f00d][_0x0617('0x2c')]=0x0;}}}}function clearVoiceQueues(_0x903c59){if(!_[_0x0617('0x2a')](_0x903c59)){for(var _0x32ef28 in _0x903c59){if(_0x903c59[_0x0617('0x2b')](_0x32ef28)){_0x903c59[_0x32ef28][_0x0617('0x2c')]=0x0;_0x903c59[_0x32ef28][_0x0617('0x2d')]=0x0;_0x903c59[_0x32ef28]['pTalking']=0x0;_0x903c59[_0x32ef28][_0x0617('0x2e')]=0x0;_0x903c59[_0x32ef28][_0x0617('0x2f')]=!![];}}}}function clearAgentBooked(_0x1ff68e){if(!_[_0x0617('0x2a')](_0x1ff68e)){for(var _0x94815c in _0x1ff68e){if(_0x1ff68e[_0x0617('0x2b')](_0x94815c)){_0x1ff68e[_0x94815c]['unlockRR']=!![];}}}}VoiceQueueReport[_0x0617('0xb')][_0x0617('0x30')]=function(){var _0x48db3d=this;for(var _0x58f146 in this[_0x0617('0x31')]){if(this[_0x0617('0x31')][_0x0617('0x2b')](_0x58f146)&&!this[_0x0617('0x31')][_0x58f146]['switch']){this['sequence']['enqueue'](function(){if(!_[_0x0617('0x32')](_0x48db3d[_0x0617('0x31')][_0x58f146])){return ami[_0x0617('0x33')]({'action':_0x0617('0x34'),'channel':_0x48db3d[_0x0617('0x31')][_0x58f146][_0x0617('0x35')]})['catch'](function(_0x22a324){if(_0x22a324[_0x0617('0x36')]===_0x0617('0x37')){setTimeout(function(){if(_0x48db3d[_0x0617('0x31')][_0x58f146]){delete _0x48db3d[_0x0617('0x31')][_0x58f146];logger['error'](_0x0617('0x38'),_0x58f146,util[_0x0617('0x39')](_0x22a324,{'showHidden':![],'depth':null}));}if(_0x48db3d['queueReports'][_0x58f146]){delete _0x48db3d[_0x0617('0xf')][_0x58f146];logger[_0x0617('0x3a')](_0x0617('0x3b'),_0x58f146,util[_0x0617('0x39')](_0x22a324,{'showHidden':![],'depth':null}));}if(_0x48db3d[_0x0617('0x14')][_0x58f146]){delete _0x48db3d[_0x0617('0x14')][_0x58f146];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x58f146,util[_0x0617('0x39')](_0x22a324,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x0617('0xb')][_0x0617('0x3c')]=function(){logger['error'](_0x0617('0x3d'));clearChannels(this[_0x0617('0x31')]);this['clearQueueReport'](this['queueReports']);clearAgentBooked(this[_0x0617('0x10')]);clearVoiceQueues(this[_0x0617('0x12')]);clearCampaigns(this[_0x0617('0x13')]);};VoiceQueueReport['prototype'][_0x0617('0x3e')]=function(_0x5c4e91){var _0x2e6370=this;if(!_[_0x0617('0x2a')](_0x5c4e91)){for(var _0x5b279 in _0x5c4e91){if(_0x5c4e91[_0x0617('0x2b')](_0x5b279)){_0x2e6370[_0x0617('0x3f')](_0x5c4e91[_0x5b279],_0x0617('0x40'));delete _0x5c4e91[_0x5b279];}}}};VoiceQueueReport[_0x0617('0xb')][_0x0617('0x41')]=function(_0x26bff4,_0x4879be,_0x5dbf8f){io['to'](_0x26bff4)[_0x0617('0x41')](_0x4879be,_0x5dbf8f);};VoiceQueueReport[_0x0617('0xb')][_0x0617('0x42')]=function(_0x2c98b2,_0x34354c){logger[_0x0617('0x43')]('[%s][voiceQueueReport]['+_0x34354c+_0x0617('0x44'),_0x2c98b2[_0x0617('0x45')],util['inspect'](_0x2c98b2,{'showHidden':![],'depth':null}));this[_0x0617('0x41')](util[_0x0617('0x46')](_0x0617('0x47'),_0x2c98b2['name']),_0x0617('0x48'),_0x2c98b2);io[_0x0617('0x41')](_0x0617('0x49'),_0x2c98b2);};VoiceQueueReport[_0x0617('0xb')][_0x0617('0x3f')]=function(_0x3a1da1,_0x48ca69){logger[_0x0617('0x43')]('[%s][voiceQueueReport]['+_0x48ca69+_0x0617('0x4a'),_0x3a1da1[_0x0617('0x45')],util[_0x0617('0x39')](_0x3a1da1,{'showHidden':![],'depth':null}));this[_0x0617('0x41')](util['format'](_0x0617('0x47'),_0x3a1da1[_0x0617('0x4b')]),_0x0617('0x4c'),_0x3a1da1);io[_0x0617('0x41')](_0x0617('0x4d'),_0x3a1da1);};VoiceQueueReport[_0x0617('0xb')][_0x0617('0x4e')]=function(_0x4f11bf,_0x32a394){if(_0x4f11bf[_0x0617('0x4f')]===_0x0617('0x50')){var _0x3fc325={'id':_0x4f11bf['id'],'name':_0x4f11bf[_0x0617('0x4b')],'strategy':_0x4f11bf[_0x0617('0x51')],'answered':_0x4f11bf[_0x0617('0x52')],'available':_0x4f11bf[_0x0617('0x53')],'loggedIn':_0x4f11bf[_0x0617('0x54')],'pTalking':_0x4f11bf[_0x0617('0x55')],'sumBillable':_0x4f11bf[_0x0617('0x56')],'sumDuration':_0x4f11bf[_0x0617('0x57')],'sumHoldTime':_0x4f11bf['sumHoldTime']||0x0,'talking':_0x4f11bf[_0x0617('0x2d')],'total':_0x4f11bf[_0x0617('0x58')],'type':_0x4f11bf[_0x0617('0x4f')],'unmanaged':_0x4f11bf[_0x0617('0x59')],'abandoned':_0x4f11bf[_0x0617('0x5a')],'waiting':_0x4f11bf[_0x0617('0x2e')]};if(_0x4f11bf[_0x0617('0x5b')]){_0x3fc325['Trunk']={'id':_0x4f11bf[_0x0617('0x5b')]['id'],'name':_0x4f11bf['Trunk'][_0x0617('0x4b')],'active':_0x4f11bf[_0x0617('0x5b')][_0x0617('0x5c')],'callerid':_0x4f11bf[_0x0617('0x5b')]['callerid']};}if(_0x4f11bf['Interval']){_0x3fc325['Interval']={'id':_0x4f11bf[_0x0617('0x5d')]['id'],'name':_0x4f11bf[_0x0617('0x5d')][_0x0617('0x4b')]};}var _0x169502=md5(JSON[_0x0617('0x5e')](_0x3fc325));if(_0x4f11bf['md5']!==_0x169502){_0x4f11bf[_0x0617('0x3')]=_0x169502;logger[_0x0617('0x43')]('[voiceQueueReport]['+_0x32a394+_0x0617('0x5f'),util[_0x0617('0x39')](_0x3fc325,{'showHidden':![],'depth':null}));this[_0x0617('0x41')](util[_0x0617('0x46')](_0x0617('0x47'),_0x3fc325[_0x0617('0x4b')]),_0x0617('0x60'),_0x3fc325);}}};VoiceQueueReport[_0x0617('0xb')][_0x0617('0x61')]=function(_0x5da9d7){return _0x5da9d7!==null&&!_[_0x0617('0x62')](_0x5da9d7);};VoiceQueueReport['prototype'][_0x0617('0x63')]=function(){var _0x374dde=this;setInterval(function(){_0x374dde[_0x0617('0x30')]();ami[_0x0617('0x33')]({'action':_0x0617('0x64')})['catch'](function(_0x266f91){logger[_0x0617('0x3a')](_0x0617('0x65'),util[_0x0617('0x39')](_0x266f91,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x0617('0x29')]=function(){var _0x52022b=this;setInterval(function(){if(_0x52022b[_0x0617('0x66')]){return ami['Action']({'action':_0x0617('0x15')})[_0x0617('0x67')](function(_0x5376c3){_0x52022b[_0x0617('0x66')]=![];})['catch'](function(_0x46914c){logger['error'](_0x0617('0x68'),util['inspect'](_0x46914c,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x0617('0x16')]=function(_0x25159a){try{if(this[_0x0617('0x61')](_0x25159a)&&this[_0x0617('0x61')](_0x25159a[_0x0617('0x69')])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x25159a,{'showHidden':![],'depth':null}));if(this[_0x0617('0x12')][_0x25159a[_0x0617('0x69')]]){logger[_0x0617('0x6a')](_0x0617('0x6b'),_0x25159a[_0x0617('0x69')]);var _0x115257=_[_0x0617('0x6c')](this[_0x0617('0x31')],_0x0617('0x69'))[_0x25159a[_0x0617('0x69')]]||0x0;var _0x88132a=_0x115257-_0x25159a['callers'];if(this['voiceQueues'][_0x25159a[_0x0617('0x69')]][_0x0617('0x2e')]!==_[_0x0617('0x6d')](_0x25159a[_0x0617('0x6e')])||this['voiceQueues'][_0x25159a['queue']][_0x0617('0x54')]!==_[_0x0617('0x6d')](_0x25159a[_0x0617('0x6f')])||this[_0x0617('0x12')][_0x25159a[_0x0617('0x69')]][_0x0617('0x53')]!==_[_0x0617('0x6d')](_0x25159a[_0x0617('0x53')])||this[_0x0617('0x12')][_0x25159a[_0x0617('0x69')]][_0x0617('0x2d')]!==_0x88132a){this['voiceQueues'][_0x25159a[_0x0617('0x69')]]['waiting']=_[_0x0617('0x6d')](_0x25159a[_0x0617('0x6e')]);this[_0x0617('0x12')][_0x25159a[_0x0617('0x69')]][_0x0617('0x54')]=_[_0x0617('0x6d')](_0x25159a['loggedin']);this[_0x0617('0x12')][_0x25159a['queue']][_0x0617('0x53')]=_[_0x0617('0x6d')](_0x25159a[_0x0617('0x53')]);this[_0x0617('0x12')][_0x25159a[_0x0617('0x69')]][_0x0617('0x2d')]=_0x88132a>0x0?_0x88132a:0x0;this[_0x0617('0x12')][_0x25159a[_0x0617('0x69')]][_0x0617('0x2d')]=this[_0x0617('0x12')][_0x25159a[_0x0617('0x69')]]['talking']>_['toNumber'](_0x25159a[_0x0617('0x6f')])?_[_0x0617('0x6d')](_0x25159a['loggedin']):this[_0x0617('0x12')][_0x25159a[_0x0617('0x69')]][_0x0617('0x2d')];this[_0x0617('0x4e')](this[_0x0617('0x12')][_0x25159a[_0x0617('0x69')]],_0x0617('0x15'));}logger[_0x0617('0x43')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util['inspect'](this['voiceQueues'][_0x25159a[_0x0617('0x69')]],{'showHidden':![],'depth':null}));ami['emit'](_0x0617('0x70'),this[_0x0617('0x12')][_0x25159a['queue']]);}}}catch(_0x15ace8){logger[_0x0617('0x3a')](_0x0617('0x68'),util['inspect'](_0x15ace8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0617('0xb')][_0x0617('0x71')]=function(_0x202567){logger[_0x0617('0x43')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x0617('0x39')](_0x202567,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x0617('0x72')]=function(_0x409673){try{if(this[_0x0617('0x61')](_0x409673)){logger[_0x0617('0x43')](_0x0617('0x73'),_0x409673[_0x0617('0x45')],util[_0x0617('0x39')](_0x409673,{'showHidden':![],'depth':null}));if(_[_0x0617('0x62')](this['queueReports'][_0x409673[_0x0617('0x45')]]))this[_0x0617('0xf')][_0x409673[_0x0617('0x45')]]=[];if(_[_0x0617('0x62')](this[_0x0617('0x31')][_0x409673[_0x0617('0x45')]]))this[_0x0617('0x31')][_0x409673[_0x0617('0x45')]]={};var _0x3b7a1d=new QueueReport();_0x3b7a1d[_0x0617('0x4b')]=_0x409673[_0x0617('0x69')];_0x3b7a1d['type']=this[_0x0617('0x12')][_0x3b7a1d[_0x0617('0x4b')]]&&this['voiceQueues'][_0x3b7a1d[_0x0617('0x4b')]][_0x0617('0x4f')]?this['voiceQueues'][_0x3b7a1d['name']][_0x0617('0x4f')]||'inbound':_0x0617('0x50');_0x3b7a1d[_0x0617('0x69')]=_0x409673[_0x0617('0x69')];_0x3b7a1d[_0x0617('0x74')]=moment()[_0x0617('0x46')](_0x0617('0x75'));_0x3b7a1d[_0x0617('0x76')]=_0x409673[_0x0617('0x76')];_0x3b7a1d[_0x0617('0x77')]=_0x409673[_0x0617('0x77')];_0x3b7a1d[_0x0617('0x45')]=_0x409673[_0x0617('0x45')];_0x3b7a1d['routealias']=this['channels'][_0x409673[_0x0617('0x45')]][_0x0617('0x78')];logger[_0x0617('0x6a')](_0x0617('0x79'),_0x3b7a1d[_0x0617('0x4b')],_0x3b7a1d[_0x0617('0x4f')]);_[_0x0617('0x7a')](_0x3b7a1d,_[_0x0617('0x7b')](_0x409673,_[_0x0617('0x7c')](_0x3b7a1d)));this[_0x0617('0xf')][_0x409673[_0x0617('0x45')]][_0x0617('0x7d')](_0x3b7a1d);this[_0x0617('0x31')][_0x409673['uniqueid']]=_0x3b7a1d;this[_0x0617('0x42')](_0x3b7a1d,_0x0617('0x7e'));}}catch(_0x3feb80){logger['error'](_0x0617('0x73'),_0x409673[_0x0617('0x45')],util[_0x0617('0x39')](_0x3feb80,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0617('0x1a')]=function(_0x12c595){try{if(this[_0x0617('0x61')](_0x12c595)){logger[_0x0617('0x43')](_0x0617('0x7f'),_0x12c595[_0x0617('0x45')],util[_0x0617('0x39')](_0x12c595,{'showHidden':![],'depth':null}));if(this[_0x0617('0xf')][_0x12c595['uniqueid']]){var _0x3c3bd8=_[_0x0617('0x80')](this['queueReports'][_0x12c595[_0x0617('0x45')]]);_0x3c3bd8[_0x0617('0x81')]=![];_0x3c3bd8[_0x0617('0x82')]=null;_0x3c3bd8[_0x0617('0x83')]=_0x12c595[_0x0617('0x83')];_0x3c3bd8[_0x0617('0x84')]=_0x12c595[_0x0617('0x84')];_0x3c3bd8[_0x0617('0x19')]=!![];_0x3c3bd8[_0x0617('0x85')]=moment()[_0x0617('0x46')](_0x0617('0x75'));_0x3c3bd8['queuecallerexitreason']=_0x0617('0x86');_0x3c3bd8[_0x0617('0x87')]=null;logger[_0x0617('0x6a')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x3c3bd8['name'],_0x3c3bd8['type']);this['channels'][_0x12c595[_0x0617('0x45')]]=_0x3c3bd8;this[_0x0617('0x3f')](_0x3c3bd8,_0x0617('0x19'));}}}catch(_0x4f7682){logger[_0x0617('0x3a')](_0x0617('0x7f'),_0x12c595[_0x0617('0x45')],util[_0x0617('0x39')](_0x4f7682,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0617('0xb')][_0x0617('0x88')]=function(_0x105697){try{if(this['isNotNull'](_0x105697)){logger[_0x0617('0x43')](_0x0617('0x89'),_0x105697[_0x0617('0x45')],util[_0x0617('0x39')](_0x105697,{'showHidden':![],'depth':null}));if(this[_0x0617('0xf')][_0x105697[_0x0617('0x45')]]){var _0x4d896c=_[_0x0617('0x80')](this[_0x0617('0xf')][_0x105697[_0x0617('0x45')]]);_0x4d896c[_0x0617('0x8a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4d896c[_0x0617('0x8b')]=_0x105697['connectedlinenum'];_0x4d896c[_0x0617('0x8c')]=_0x105697['connectedlinename'];logger['info'](_0x0617('0x8d'),_0x4d896c[_0x0617('0x4b')],_0x4d896c[_0x0617('0x4f')],_0x105697[_0x0617('0x8b')],_0x105697['connectedlinename']);this['channels'][_0x105697[_0x0617('0x45')]]=_0x4d896c;this[_0x0617('0x42')](_0x4d896c,'queuecallerleave');}}}catch(_0x4160e7){logger[_0x0617('0x3a')](_0x0617('0x89'),_0x105697[_0x0617('0x45')],util[_0x0617('0x39')](_0x4160e7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0617('0xb')]['syncAgentConnect']=function(_0x530d04){try{if(this[_0x0617('0x61')](_0x530d04)){logger[_0x0617('0x43')](_0x0617('0x8e'),_0x530d04[_0x0617('0x45')],util[_0x0617('0x39')](_0x530d04,{'showHidden':![],'depth':null}));if(this[_0x0617('0xf')][_0x530d04[_0x0617('0x45')]]){var _0x13188e=_['last'](this[_0x0617('0xf')][_0x530d04[_0x0617('0x45')]]);_0x13188e[_0x0617('0x81')]=!![];_0x13188e[_0x0617('0x8f')]=_0x0617('0x90');logger[_0x0617('0x6a')](_0x0617('0x91'),_0x13188e[_0x0617('0x4b')],_0x13188e[_0x0617('0x4f')]);}}}catch(_0x30bbb6){logger['error'](_0x0617('0x8e'),_0x530d04[_0x0617('0x45')],util['inspect'](_0x30bbb6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0617('0xb')][_0x0617('0x1d')]=function(_0x3b2b82){try{if(this['isNotNull'](_0x3b2b82)){logger[_0x0617('0x43')]('[%s][voiceQueueReport][agentcomplete]',_0x3b2b82[_0x0617('0x45')],util[_0x0617('0x39')](_0x3b2b82,{'showHidden':![],'depth':null}));if(this[_0x0617('0xf')][_0x3b2b82['uniqueid']]){var _0x19e1f8=_['last'](this['queueReports'][_0x3b2b82['uniqueid']]);_0x19e1f8[_0x0617('0x19')]=![];_0x19e1f8[_0x0617('0x85')]=null;_0x19e1f8['assigned']=!![];_0x19e1f8[_0x0617('0x87')]=_0x3b2b82[_0x0617('0x92')];_0x19e1f8[_0x0617('0x83')]=_0x3b2b82[_0x0617('0x83')];_0x19e1f8[_0x0617('0x81')]=!![];_0x19e1f8[_0x0617('0x93')]=![];_0x19e1f8[_0x0617('0x94')]=null;if(!_0x19e1f8[_0x0617('0x95')]){if(_0x3b2b82[_0x0617('0x96')]=='transfer'){_0x19e1f8[_0x0617('0x8f')]=_0x0617('0x97');logger['info'](_0x0617('0x98'),_0x19e1f8['name'],_0x19e1f8[_0x0617('0x4f')]);}else{if(_[_0x0617('0x99')](_0x3b2b82['channel'][_0x0617('0x9a')](),'local/')){if(this[_0x0617('0xf')][_0x3b2b82[_0x0617('0x9b')]]){var _0x35b8d9=_[_0x0617('0x80')](this[_0x0617('0xf')][_0x3b2b82[_0x0617('0x9b')]]);_0x35b8d9[_0x0617('0x81')]=![];_0x35b8d9[_0x0617('0x93')]=!![];_0x35b8d9[_0x0617('0x94')]=moment(_0x19e1f8[_0x0617('0x74')])['add'](_0x3b2b82[_0x0617('0x83')],_0x0617('0x9c'))[_0x0617('0x46')](_0x0617('0x75'));_0x35b8d9[_0x0617('0x8f')]=_0x0617('0x9d');_0x35b8d9[_0x0617('0x95')]=!![];_0x35b8d9['transfertype']='FORWARD';_0x35b8d9[_0x0617('0x9e')]=_0x3b2b82[_0x0617('0x9f')];_0x35b8d9['transferuniqueid']=_0x3b2b82['uniqueid'];logger['info'](_0x0617('0xa0'),_0x35b8d9['name'],_0x35b8d9[_0x0617('0x4f')]);var _0x5cb22e=this['queueReports'][_0x3b2b82[_0x0617('0x9b')]];this['queueReports'][_0x3b2b82[_0x0617('0x9b')]]=this[_0x0617('0xf')][_0x3b2b82[_0x0617('0x45')]];this[_0x0617('0xf')][_0x3b2b82['uniqueid']]=_0x5cb22e;}}else{_0x19e1f8[_0x0617('0x8f')]='COMPLETEDBY'+_0x3b2b82['reason'][_0x0617('0xa1')]();logger[_0x0617('0x6a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x19e1f8['name'],_0x19e1f8[_0x0617('0x4f')],_0x19e1f8[_0x0617('0x8f')]);}}}this[_0x0617('0x31')][_0x3b2b82[_0x0617('0x45')]]=_0x19e1f8;this[_0x0617('0x3f')](_0x19e1f8,_0x0617('0x1c'));}}}catch(_0x1805cd){logger[_0x0617('0x3a')](_0x0617('0xa2'),_0x3b2b82[_0x0617('0x45')],util[_0x0617('0x39')](_0x1805cd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0617('0x21')]=function(_0x477072){try{if(this[_0x0617('0x61')](_0x477072)){logger['debug']('[%s][voiceQueueReport][varset]',_0x477072[_0x0617('0x45')],util[_0x0617('0x39')](_0x477072,{'showHidden':![],'depth':null}));this['addVariable'](_0x477072[_0x0617('0x45')],_[_0x0617('0x7c')](_0x477072[_0x0617('0xa3')])[0x0],_0x477072[_0x0617('0xa4')]);if(this[_0x0617('0xf')][_0x477072['uniqueid']]){var _0x2de1df=_['last'](this[_0x0617('0xf')][_0x477072[_0x0617('0x45')]]);if(_0x2de1df){if(this[_0x0617('0x61')](_0x477072[_0x0617('0xa3')])&&this['isNotNull'](_0x477072[_0x0617('0xa3')][_0x0617('0xa5')])){switch(_0x477072['value']){case _0x0617('0xa6'):_0x2de1df[_0x0617('0x93')]=![];_0x2de1df[_0x0617('0x94')]=null;break;case _0x0617('0xa7'):_0x2de1df[_0x0617('0xa8')]=_0x0617('0xa9');_0x2de1df['queuecallerexit']=!![];_0x2de1df[_0x0617('0x94')]=moment()[_0x0617('0x46')](_0x0617('0x75'));_0x2de1df[_0x0617('0x8a')]=moment()[_0x0617('0x46')](_0x0617('0x75'));logger[_0x0617('0x43')](_0x0617('0xaa'),_0x477072[_0x0617('0x45')],util[_0x0617('0x39')](_0x2de1df,{'showHidden':![],'depth':null}));ami[_0x0617('0x41')](_0x0617('0xab'),_0x2de1df);break;default:_0x2de1df[_0x0617('0x93')]=!![];_0x2de1df[_0x0617('0x94')]=moment()[_0x0617('0x46')](_0x0617('0x75'));_0x2de1df[_0x0617('0x8a')]=moment()[_0x0617('0x46')](_0x0617('0x75'));}_0x2de1df['queuecallerabandon']=![];_0x2de1df[_0x0617('0x85')]=null;_0x2de1df[_0x0617('0x8f')]=_0x477072[_0x0617('0xa4')];this[_0x0617('0x31')][_0x477072[_0x0617('0x45')]]=_0x2de1df;this[_0x0617('0x3f')](_0x2de1df,_0x0617('0x20'));}else if(this['isNotNull'](_0x477072['variable'])&&this[_0x0617('0x61')](_0x477072['variable']['queueposition'])){if(!_0x2de1df[_0x0617('0x19')]){_0x2de1df[_0x0617('0x93')]=!![];_0x2de1df[_0x0617('0x94')]=moment()['format'](_0x0617('0x75'));_0x2de1df[_0x0617('0x8f')]=_0x0617('0xac');_0x2de1df[_0x0617('0x8a')]=moment()[_0x0617('0x46')](_0x0617('0x75'));this[_0x0617('0x31')][_0x477072['uniqueid']]=_0x2de1df;}}logger[_0x0617('0x6a')](_0x0617('0xad'),_0x477072[_0x0617('0x45')],_0x2de1df[_0x0617('0x4b')],_0x2de1df[_0x0617('0x4f')],_[_0x0617('0x7c')](_0x477072['variable'])[0x0],_0x477072[_0x0617('0xa4')]);_0x2de1df[_0x0617('0x14')]=this['variables'][_0x477072[_0x0617('0x45')]];}}}}catch(_0x114507){logger[_0x0617('0x3a')](_0x0617('0xae'),_0x477072['uniqueid'],util[_0x0617('0x39')](_0x114507,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0617('0xb')]['addVariable']=function(_0x3fefa5,_0x4f754c,_0xb4309b){var _0x1cd87f=[_0x0617('0xaf'),_0x0617('0xb0'),'rtpaudioqosjitter',_0x0617('0xb1'),_0x0617('0xb2'),_0x0617('0xb3'),_0x0617('0xb4'),_0x0617('0xb5'),_0x0617('0xb6'),_0x0617('0xb7'),'bridgepeer',_0x0617('0xb8'),_0x0617('0xb9'),_0x0617('0xba'),'memberinterface','memberlastcall',_0x0617('0x92'),_0x0617('0xbb'),_0x0617('0xbc')];if(!_[_0x0617('0x32')](_0x4f754c)&&!_[_0x0617('0xbd')](_0x1cd87f,_0x4f754c)){if(_[_0x0617('0x62')](this[_0x0617('0x14')][_0x3fefa5])){this[_0x0617('0x14')][_0x3fefa5]={};}this['variables'][_0x3fefa5][_0x4f754c]=_0xb4309b;}};VoiceQueueReport[_0x0617('0xb')]['syncHangup']=function(_0x695fc2){try{if(this[_0x0617('0x61')](_0x695fc2)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x695fc2['uniqueid'],util['inspect'](_0x695fc2,{'showHidden':![],'depth':null}));if(this[_0x0617('0xf')][_0x695fc2[_0x0617('0x45')]]){for(var _0x58203b=0x0,_0x55892a={};_0x58203b<this[_0x0617('0xf')][_0x695fc2[_0x0617('0x45')]]['length'];_0x58203b+=0x1){_0x55892a=this[_0x0617('0xf')][_0x695fc2[_0x0617('0x45')]][_0x58203b];if(this[_0x0617('0x12')][_0x55892a['queue']]){if(_0x55892a[_0x0617('0x93')]&&_0x55892a[_0x0617('0x95')]!=!![]){this[_0x0617('0x12')][_0x55892a[_0x0617('0x69')]][_0x0617('0x59')]+=0x1;}if(_0x55892a[_0x0617('0x19')]){this[_0x0617('0x12')][_0x55892a['queue']]['abandoned']+=0x1;}this[_0x0617('0x12')][_0x55892a[_0x0617('0x69')]][_0x0617('0xbe')]+=moment(_0x55892a['queuecallerleaveAt'])[_0x0617('0xbf')](_0x55892a[_0x0617('0x74')],_0x0617('0x9c'))||0x0;if(_0x58203b===this[_0x0617('0xf')][_0x695fc2['uniqueid']][_0x0617('0xc0')]-0x1){this[_0x0617('0x12')][_0x55892a['queue']][_0x0617('0x57')]+=moment()[_0x0617('0xc1')](0x0)['diff'](_0x55892a[_0x0617('0x74')],_0x0617('0x9c'));this[_0x0617('0x12')][_0x55892a[_0x0617('0x69')]][_0x0617('0x58')]+=0x1;if(_0x55892a[_0x0617('0x81')]){this['voiceQueues'][_0x55892a[_0x0617('0x69')]][_0x0617('0x52')]+=0x1;this['voiceQueues'][_0x55892a[_0x0617('0x69')]][_0x0617('0x56')]+=moment()[_0x0617('0xc1')](0x0)['diff'](_0x55892a[_0x0617('0x8a')],'seconds');_0x55892a[_0x0617('0x82')]=moment()[_0x0617('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x55892a[_0x0617('0x93')]=![];_0x55892a[_0x0617('0x94')]=null;}if(_0x55892a[_0x0617('0x93')]&&_0x55892a[_0x0617('0x95')]!=!![]){_0x55892a['lastevent']='unmanaged';logger[_0x0617('0x43')](_0x0617('0xc2'),_0x695fc2['uniqueid'],util[_0x0617('0x39')](_0x55892a,{'showHidden':![],'depth':null}));ami[_0x0617('0x41')](_0x0617('0xc3'),_0x55892a);}if(_0x55892a['queuecallerabandon']){_0x55892a[_0x0617('0xa8')]=_0x0617('0x5a');logger[_0x0617('0x43')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x695fc2['uniqueid'],util[_0x0617('0x39')](_0x55892a,{'showHidden':![],'depth':null}));ami[_0x0617('0x41')](_0x0617('0xc4'),_0x55892a);}}else{this[_0x0617('0x12')][_0x55892a['queue']][_0x0617('0x57')]+=this['voiceQueues'][_0x55892a['queue']][_0x0617('0xbe')];}logger['info']('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x695fc2[_0x0617('0x45')],_0x55892a['name'],_0x55892a[_0x0617('0x4f')],_0x695fc2['cause-txt']);this[_0x0617('0x31')][_0x695fc2[_0x0617('0x45')]]=_0x55892a;this[_0x0617('0x3f')](_0x55892a,'hangup');this[_0x0617('0x4e')](this[_0x0617('0x12')][_0x55892a['queue']],_0x0617('0xc5'));}}logger[_0x0617('0x43')](_0x0617('0xc6'),_0x695fc2[_0x0617('0x45')],util[_0x0617('0x39')](this[_0x0617('0xf')][_0x695fc2[_0x0617('0x45')]],{'showHidden':![],'depth':null}));ami[_0x0617('0x41')](_0x0617('0xc7'),this[_0x0617('0xf')][_0x695fc2[_0x0617('0x45')]]);delete this[_0x0617('0xf')][_0x695fc2[_0x0617('0x45')]];delete this[_0x0617('0x31')][_0x695fc2[_0x0617('0x45')]];}if(this[_0x0617('0x14')][_0x695fc2['uniqueid']]){delete this[_0x0617('0x14')][_0x695fc2[_0x0617('0x45')]];}}}catch(_0x359a6f){logger[_0x0617('0x3a')](_0x0617('0xc8'),_0x695fc2[_0x0617('0x45')],util[_0x0617('0x39')](_0x359a6f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0617('0xb')][_0x0617('0x28')]=function(_0x492200){try{if(this[_0x0617('0x61')](_0x492200)){logger[_0x0617('0x43')](_0x0617('0xc9'),_0x492200['uniqueid'],util[_0x0617('0x39')](_0x492200,{'showHidden':![],'depth':null}));var _0x4d42a7;if(this[_0x0617('0xf')][_0x492200[_0x0617('0xca')]]){_0x4d42a7=_[_0x0617('0x80')](this[_0x0617('0xf')][_0x492200['transfereeuniqueid']]);_0x4d42a7[_0x0617('0x9e')]=_0x492200[_0x0617('0xcb')];_0x4d42a7[_0x0617('0xcc')]=_0x492200[_0x0617('0xcd')];_0x4d42a7[_0x0617('0x8f')]=_0x0617('0xce');_0x4d42a7[_0x0617('0x95')]=!![];_0x4d42a7['transfertype']=_0x0617('0xcf');if(this[_0x0617('0xf')][_0x492200[_0x0617('0xcd')]]){var _0xbd0ff7=this['queueReports'][_0x492200[_0x0617('0xcd')]];this[_0x0617('0xf')][_0x492200[_0x0617('0xcd')]]=this[_0x0617('0xf')][_0x492200[_0x0617('0xca')]];this[_0x0617('0xf')][_0x492200[_0x0617('0xca')]]=_0xbd0ff7;var _0x26112a=_['last'](this[_0x0617('0xf')][_0x492200['transfereeuniqueid']]);_0x26112a[_0x0617('0xd0')]=!![];}logger[_0x0617('0x6a')](_0x0617('0xd1'),_0x492200[_0x0617('0x45')],_0x4d42a7[_0x0617('0x4b')],_0x4d42a7[_0x0617('0x4f')],_0x4d42a7[_0x0617('0x9e')],_0x4d42a7[_0x0617('0xcc')]);}else if(this['queueReports'][_0x492200[_0x0617('0xd2')]]){_0x4d42a7=_['last'](this[_0x0617('0xf')][_0x492200[_0x0617('0xd2')]]);_0x4d42a7['transferexten']=_0x492200['origtransfererexten'];_0x4d42a7[_0x0617('0xcc')]=_0x492200[_0x0617('0xd3')];_0x4d42a7['queuecallerexitreason']=_0x0617('0xce');_0x4d42a7['transfer']=!![];_0x4d42a7['transfertype']='ATTENDED';if(this['queueReports'][_0x492200[_0x0617('0xd3')]]){var _0xbd0ff7=this[_0x0617('0xf')][_0x492200[_0x0617('0xd3')]];this[_0x0617('0xf')][_0x492200[_0x0617('0xd3')]]=this['queueReports'][_0x492200[_0x0617('0xd2')]];this[_0x0617('0xf')][_0x492200[_0x0617('0xd2')]]=_0xbd0ff7;var _0x26112a=_[_0x0617('0x80')](this[_0x0617('0xf')][_0x492200[_0x0617('0xd2')]]);_0x26112a[_0x0617('0xd0')]=!![];}logger[_0x0617('0x6a')](_0x0617('0xd1'),_0x492200[_0x0617('0x45')],_0x4d42a7[_0x0617('0x4b')],_0x4d42a7[_0x0617('0x4f')],_0x4d42a7[_0x0617('0x9e')],_0x4d42a7[_0x0617('0xcc')]);}}}catch(_0x4b3ba8){logger['error'](_0x0617('0xc9'),_0x492200[_0x0617('0x45')],util[_0x0617('0x39')](_0x4b3ba8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0617('0xb')][_0x0617('0xd4')]=function(_0xa2074){try{if(this[_0x0617('0x61')](_0xa2074)){logger[_0x0617('0x43')](_0x0617('0xd5'),_0xa2074['uniqueid'],util[_0x0617('0x39')](_0xa2074,{'showHidden':![],'depth':null}));if(this[_0x0617('0xf')][_0xa2074[_0x0617('0xca')]]){var _0xe585f1=_[_0x0617('0x80')](this[_0x0617('0xf')][_0xa2074[_0x0617('0xca')]]);_0xe585f1[_0x0617('0x8f')]=_0x0617('0xd6');_0xe585f1[_0x0617('0x95')]=!![];_0xe585f1[_0x0617('0xd7')]=_0x0617('0xd8');_0xe585f1[_0x0617('0x9e')]=_0xa2074[_0x0617('0xd9')];_0xe585f1[_0x0617('0xcc')]=_0xa2074['transfereeuniqueid'];logger[_0x0617('0x6a')](_0x0617('0xda'),_0xa2074[_0x0617('0x45')],_0xe585f1[_0x0617('0x4b')],_0xe585f1['type'],_0xe585f1[_0x0617('0x9e')],_0xe585f1[_0x0617('0xcc')]);this[_0x0617('0x22')]({'event':_0x0617('0xdb'),'uniqueid':_0xa2074[_0x0617('0xca')],'context':_0xa2074[_0x0617('0xdc')],'channel':_0xa2074[_0x0617('0xdd')]});}}}catch(_0x5bf82d){logger[_0x0617('0x3a')]('[%s][voiceQueueReport][blindtransfer]',_0xa2074[_0x0617('0x45')],util[_0x0617('0x39')](_0x5bf82d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0617('0xb')][_0x0617('0xde')]=function(_0x379776){try{if(this[_0x0617('0x61')](_0x379776)){logger['debug'](_0x0617('0xdf'),_0x379776['uniqueid'],util[_0x0617('0x39')](_0x379776,{'showHidden':![],'depth':null}));if(this[_0x0617('0xf')][_0x379776[_0x0617('0x45')]]){var _0x538e4f=_[_0x0617('0x80')](this[_0x0617('0xf')][_0x379776[_0x0617('0x45')]]);if(!_[_0x0617('0x32')](_0x538e4f['queuecallerleaveAt'])){_0x538e4f[_0x0617('0xe0')]=moment()[_0x0617('0x46')](_0x0617('0x75'));logger['info']('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x379776[_0x0617('0x45')],_0x538e4f[_0x0617('0xe0')]);}}}}catch(_0x265cc6){logger['error'](_0x0617('0xdf'),_0x379776['uniqueid'],util['inspect'](_0x265cc6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0617('0xb')][_0x0617('0xe1')]=function(_0x26b554){try{if(this[_0x0617('0x61')](_0x26b554)){logger[_0x0617('0x43')]('[%s][voiceQueueReport][musiconholdstop]',_0x26b554['uniqueid'],util[_0x0617('0x39')](_0x26b554,{'showHidden':![],'depth':null}));if(this[_0x0617('0xf')][_0x26b554[_0x0617('0x45')]]){var _0x496fb2=_[_0x0617('0x80')](this[_0x0617('0xf')][_0x26b554[_0x0617('0x45')]]);if(!_['isNil'](_0x496fb2[_0x0617('0xe0')])){_0x496fb2[_0x0617('0xe2')]+=moment()['milliseconds'](0x0)[_0x0617('0xbf')](_0x496fb2[_0x0617('0xe0')],_0x0617('0x9c'));logger[_0x0617('0x6a')](_0x0617('0xe3'),_0x26b554['uniqueid'],_0x496fb2['mohtime']);delete _0x496fb2[_0x0617('0xe0')];}}}}catch(_0x21021b){logger['error'](_0x0617('0xe4'),_0x26b554[_0x0617('0x45')],util[_0x0617('0x39')](_0x21021b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0617('0xb')][_0x0617('0xe5')]=function(_0xee8476){try{if(this['isNotNull'](_0xee8476)){logger[_0x0617('0x43')](_0x0617('0xe6'),_0xee8476[_0x0617('0x45')],util['inspect'](_0xee8476,{'showHidden':![],'depth':null}));if(_0xee8476[_0x0617('0xe7')][_0x0617('0x9a')]()===_0x0617('0xe8')){_0xee8476[_0x0617('0xe9')]=_0xee8476['appdata']&&_0xee8476['appdata'][_0x0617('0x99')](_0x0617('0xea'))?_0xee8476[_0x0617('0xeb')]:(_0xee8476[_0x0617('0xeb')]||_0xee8476[_0x0617('0xe9')])[_0x0617('0x9a')]();if(_[_0x0617('0x99')](_0xee8476[_0x0617('0xe9')][_0x0617('0x9a')](),_0x0617('0xec'))){logger['info'](_0x0617('0xed'),_0xee8476[_0x0617('0x45')],_0xee8476[_0x0617('0xe7')],_0xee8476[_0x0617('0xe9')]);if(_[_0x0617('0x62')](this[_0x0617('0x31')][_0xee8476['uniqueid']]))this['channels'][_0xee8476['uniqueid']]={};var _0x511299=_0xee8476[_0x0617('0xe9')][_0x0617('0xee')]('=');var _0xda1c19=_0x511299[0x0][_0x0617('0x9a')]()[_0x0617('0xef')](/cdr\((.*)\)/);if(_0xda1c19)this[_0x0617('0x31')][_0xee8476[_0x0617('0x45')]][_0xda1c19[0x1]]=_0x511299[0x1];}}}}catch(_0x4f1f05){logger[_0x0617('0x3a')](_0x0617('0xf0'),_0xee8476['uniqueid'],util[_0x0617('0x39')](_0x4f1f05,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0x81d5=['queueStatusComplete','unlockRR','clearZombieChannels','switch','enqueue','isNil','Action','channel','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','uniqueid','voice_queue_channel:remove','voice_queue_presence:remove','type','answered','sumBillable','sumDuration','sumHoldTime','total','waiting','Trunk','active','callerid','Interval','stringify',']\x20sending\x20voice_queue:save\x20event:','format','voice_queue:save','isNotNull','queues','[voiceQueueReport][queues]','loopQueueSummary','then','catch','[voiceQueueReport][queuesummary]','queue','info','countBy','callers','loggedIn','toNumber','loggedin','available','talking','custom:queuesummary','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','push','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','transfer','COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexitAt','add','seconds','transfertype','FORWARD','transferexten','destexten','transferuniqueid','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][varset]','keys','variable','value','queuestatus','TIMEOUT','lastevent','timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','unmanaged','abandoned','diff','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','emitVoiceQueueSummary','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','socket.io-emitter','prototype','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','queuecallerabandon','bind','queuecallerleave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated'];(function(_0x483d76,_0x2c0f05){var _0x2dbecd=function(_0x4ab398){while(--_0x4ab398){_0x483d76['push'](_0x483d76['shift']());}};_0x2dbecd(++_0x2c0f05);}(_0x81d5,0x1ab));var _0x581d=function(_0xba21d1,_0x5ea074){_0xba21d1=_0xba21d1-0x0;var _0xad42b6=_0x81d5[_0xba21d1];return _0xad42b6;};'use strict';var _=require(_0x581d('0x0'));var moment=require(_0x581d('0x1'));var util=require('util');var md5=require(_0x581d('0x2'));var Redis=require(_0x581d('0x3'));var config=require(_0x581d('0x4'));var logger=require(_0x581d('0x5'))(_0x581d('0x6'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0x581d('0x7')]=_[_0x581d('0x8')](config[_0x581d('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x581d('0x9'))(new Redis(config[_0x581d('0x7')]));var Sequence=function(){};Sequence[_0x581d('0xa')]['enqueue']=function(_0xf1a3b6){this['tail']=this['tail']?this['tail'][_0x581d('0xb')](_0xf1a3b6):_0xf1a3b6();};function VoiceQueueReport(_0x3435a9){this[_0x581d('0xc')]=new Sequence();this[_0x581d('0xd')]={};this[_0x581d('0xe')]=_0x3435a9['agents'];this[_0x581d('0xf')]=_0x3435a9[_0x581d('0x10')];this[_0x581d('0x11')]=_0x3435a9[_0x581d('0x11')];this[_0x581d('0x12')]=!![];this[_0x581d('0x13')]=_0x3435a9[_0x581d('0x13')];this[_0x581d('0x14')]={};ami['on'](_0x581d('0x15'),this[_0x581d('0x16')]['bind'](this));ami['on'](_0x581d('0x17'),this[_0x581d('0x18')]['bind'](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin']['bind'](this));ami['on'](_0x581d('0x19'),this['syncQueueCallerAbandon'][_0x581d('0x1a')](this));ami['on'](_0x581d('0x1b'),this['syncQueueCallerLeave'][_0x581d('0x1a')](this));ami['on']('agentcomplete',this[_0x581d('0x1c')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x1d'),this[_0x581d('0x1e')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x1f'),this[_0x581d('0x20')]['bind'](this));ami['on'](_0x581d('0x21'),this[_0x581d('0x22')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x23'),this[_0x581d('0x24')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x25'),this[_0x581d('0x26')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x27'),this[_0x581d('0x28')][_0x581d('0x1a')](this));ami['on']('musiconholdstop',this[_0x581d('0x29')][_0x581d('0x1a')](this));ami['on'](_0x581d('0x2a'),this[_0x581d('0x2b')][_0x581d('0x1a')](this));ami['on']('blindtransfer',this[_0x581d('0x2c')][_0x581d('0x1a')](this));this['loopQueueSummary']();this[_0x581d('0x2d')]();}function clearChannels(_0x23abda){if(!_[_0x581d('0x2e')](_0x23abda)){for(var _0x5a3fd7 in _0x23abda){if(_0x23abda[_0x581d('0x2f')](_0x5a3fd7)){delete _0x23abda[_0x5a3fd7];}}}}function clearCampaigns(_0xdad92){if(!_[_0x581d('0x2e')](_0xdad92)){for(var _0xc270bc in _0xdad92){if(_0xdad92[_0x581d('0x2f')](_0xc270bc)){_0xdad92[_0xc270bc][_0x581d('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4b9b62){if(!_[_0x581d('0x2e')](_0x4b9b62)){for(var _0x2b75d8 in _0x4b9b62){if(_0x4b9b62[_0x581d('0x2f')](_0x2b75d8)){_0x4b9b62[_0x2b75d8]['originated']=0x0;_0x4b9b62[_0x2b75d8]['talking']=0x0;_0x4b9b62[_0x2b75d8]['pTalking']=0x0;_0x4b9b62[_0x2b75d8]['waiting']=0x0;_0x4b9b62[_0x2b75d8][_0x581d('0x31')]=!![];}}}}function clearAgentBooked(_0x266a2b){if(!_[_0x581d('0x2e')](_0x266a2b)){for(var _0x408cce in _0x266a2b){if(_0x266a2b[_0x581d('0x2f')](_0x408cce)){_0x266a2b[_0x408cce][_0x581d('0x32')]=!![];}}}}VoiceQueueReport[_0x581d('0xa')][_0x581d('0x33')]=function(){var _0x163297=this;for(var _0xda8a98 in this[_0x581d('0xf')]){if(this['channels'][_0x581d('0x2f')](_0xda8a98)&&!this['channels'][_0xda8a98][_0x581d('0x34')]){this[_0x581d('0xc')][_0x581d('0x35')](function(){if(!_[_0x581d('0x36')](_0x163297[_0x581d('0xf')][_0xda8a98])){return ami[_0x581d('0x37')]({'action':'status','channel':_0x163297[_0x581d('0xf')][_0xda8a98][_0x581d('0x38')]})['catch'](function(_0x5b2b1d){if(_0x5b2b1d['message']===_0x581d('0x39')){setTimeout(function(){if(_0x163297[_0x581d('0xf')][_0xda8a98]){delete _0x163297[_0x581d('0xf')][_0xda8a98];logger[_0x581d('0x3a')](_0x581d('0x3b'),_0xda8a98,util[_0x581d('0x3c')](_0x5b2b1d,{'showHidden':![],'depth':null}));}if(_0x163297[_0x581d('0xd')][_0xda8a98]){delete _0x163297['queueReports'][_0xda8a98];logger[_0x581d('0x3a')](_0x581d('0x3d'),_0xda8a98,util['inspect'](_0x5b2b1d,{'showHidden':![],'depth':null}));}if(_0x163297[_0x581d('0x14')][_0xda8a98]){delete _0x163297[_0x581d('0x14')][_0xda8a98];logger[_0x581d('0x3a')](_0x581d('0x3e'),_0xda8a98,util[_0x581d('0x3c')](_0x5b2b1d,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x581d('0x24')]=function(){logger['error'](_0x581d('0x3f'));clearChannels(this[_0x581d('0xf')]);this['clearQueueReport'](this['queueReports']);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x581d('0x13')]);};VoiceQueueReport['prototype'][_0x581d('0x40')]=function(_0x5d029a){var _0x25ee3f=this;if(!_[_0x581d('0x2e')](_0x5d029a)){for(var _0x115e53 in _0x5d029a){if(_0x5d029a[_0x581d('0x2f')](_0x115e53)){_0x25ee3f[_0x581d('0x41')](_0x5d029a[_0x115e53],_0x581d('0x42'));delete _0x5d029a[_0x115e53];}}}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x43')]=function(_0x215671,_0x5e1ed4,_0x5af47c){io['to'](_0x215671)['emit'](_0x5e1ed4,_0x5af47c);};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x44')]=function(_0x109d34,_0x4ca064){logger[_0x581d('0x45')](_0x581d('0x46')+_0x4ca064+_0x581d('0x47'),_0x109d34['uniqueid'],util[_0x581d('0x3c')](_0x109d34,{'showHidden':![],'depth':null}));this[_0x581d('0x43')](util['format'](_0x581d('0x48'),_0x109d34[_0x581d('0x49')]),_0x581d('0x4a'),_0x109d34);io[_0x581d('0x43')](_0x581d('0x4b'),_0x109d34);};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x41')]=function(_0x5550b4,_0x3cadb3){logger[_0x581d('0x45')](_0x581d('0x46')+_0x3cadb3+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x5550b4[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x5550b4,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x581d('0x48'),_0x5550b4[_0x581d('0x49')]),_0x581d('0x4d'),_0x5550b4);io['emit'](_0x581d('0x4e'),_0x5550b4);};VoiceQueueReport[_0x581d('0xa')]['emitVoiceQueueSummary']=function(_0x31a7ce,_0x47cb2c){if(_0x31a7ce[_0x581d('0x4f')]==='inbound'){var _0x27941b={'id':_0x31a7ce['id'],'name':_0x31a7ce['name'],'strategy':_0x31a7ce['strategy'],'answered':_0x31a7ce[_0x581d('0x50')],'available':_0x31a7ce['available'],'loggedIn':_0x31a7ce['loggedIn'],'pTalking':_0x31a7ce['pTalking'],'sumBillable':_0x31a7ce[_0x581d('0x51')],'sumDuration':_0x31a7ce[_0x581d('0x52')],'sumHoldTime':_0x31a7ce[_0x581d('0x53')]||0x0,'talking':_0x31a7ce['talking'],'total':_0x31a7ce[_0x581d('0x54')],'type':_0x31a7ce[_0x581d('0x4f')],'unmanaged':_0x31a7ce['unmanaged'],'abandoned':_0x31a7ce['abandoned'],'waiting':_0x31a7ce[_0x581d('0x55')]};if(_0x31a7ce['Trunk']){_0x27941b[_0x581d('0x56')]={'id':_0x31a7ce['Trunk']['id'],'name':_0x31a7ce[_0x581d('0x56')][_0x581d('0x49')],'active':_0x31a7ce['Trunk'][_0x581d('0x57')],'callerid':_0x31a7ce[_0x581d('0x56')][_0x581d('0x58')]};}if(_0x31a7ce[_0x581d('0x59')]){_0x27941b[_0x581d('0x59')]={'id':_0x31a7ce['Interval']['id'],'name':_0x31a7ce[_0x581d('0x59')][_0x581d('0x49')]};}var _0xa20325=md5(JSON[_0x581d('0x5a')](_0x27941b));if(_0x31a7ce[_0x581d('0x2')]!==_0xa20325){_0x31a7ce[_0x581d('0x2')]=_0xa20325;logger[_0x581d('0x45')]('[voiceQueueReport]['+_0x47cb2c+_0x581d('0x5b'),util[_0x581d('0x3c')](_0x27941b,{'showHidden':![],'depth':null}));this[_0x581d('0x43')](util[_0x581d('0x5c')](_0x581d('0x48'),_0x27941b[_0x581d('0x49')]),_0x581d('0x5d'),_0x27941b);}}};VoiceQueueReport['prototype'][_0x581d('0x5e')]=function(_0x1f2846){return _0x1f2846!==null&&!_['isUndefined'](_0x1f2846);};VoiceQueueReport[_0x581d('0xa')]['loopQueueShow']=function(){var _0x29f36e=this;setInterval(function(){_0x29f36e[_0x581d('0x33')]();ami[_0x581d('0x37')]({'action':_0x581d('0x5f')})['catch'](function(_0x507e1a){logger[_0x581d('0x3a')](_0x581d('0x60'),util['inspect'](_0x507e1a,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x581d('0x61')]=function(){var _0x291907=this;setInterval(function(){if(_0x291907[_0x581d('0x12')]){return ami[_0x581d('0x37')]({'action':'queuesummary'})[_0x581d('0x62')](function(_0x4350c3){_0x291907[_0x581d('0x12')]=![];})[_0x581d('0x63')](function(_0x23a330){logger[_0x581d('0x3a')](_0x581d('0x64'),util[_0x581d('0x3c')](_0x23a330,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x581d('0xa')]['syncQueueSummary']=function(_0x3749a0){try{if(this[_0x581d('0x5e')](_0x3749a0)&&this[_0x581d('0x5e')](_0x3749a0['queue'])){logger[_0x581d('0x45')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x581d('0x3c')](_0x3749a0,{'showHidden':![],'depth':null}));if(this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]]){logger[_0x581d('0x66')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x3749a0['queue']);var _0x2194da=_[_0x581d('0x67')](this[_0x581d('0xf')],_0x581d('0x65'))[_0x3749a0[_0x581d('0x65')]]||0x0;var _0x5dfb06=_0x2194da-_0x3749a0['callers'];if(this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x55')]!==_['toNumber'](_0x3749a0[_0x581d('0x68')])||this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x69')]!==_[_0x581d('0x6a')](_0x3749a0[_0x581d('0x6b')])||this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]]['available']!==_[_0x581d('0x6a')](_0x3749a0[_0x581d('0x6c')])||this['voiceQueues'][_0x3749a0[_0x581d('0x65')]][_0x581d('0x6d')]!==_0x5dfb06){this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x55')]=_[_0x581d('0x6a')](_0x3749a0[_0x581d('0x68')]);this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x69')]=_[_0x581d('0x6a')](_0x3749a0[_0x581d('0x6b')]);this['voiceQueues'][_0x3749a0[_0x581d('0x65')]]['available']=_[_0x581d('0x6a')](_0x3749a0['available']);this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x6d')]=_0x5dfb06>0x0?_0x5dfb06:0x0;this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]]['talking']=this[_0x581d('0x11')][_0x3749a0['queue']][_0x581d('0x6d')]>_['toNumber'](_0x3749a0[_0x581d('0x6b')])?_[_0x581d('0x6a')](_0x3749a0[_0x581d('0x6b')]):this[_0x581d('0x11')][_0x3749a0[_0x581d('0x65')]][_0x581d('0x6d')];this['emitVoiceQueueSummary'](this['voiceQueues'][_0x3749a0[_0x581d('0x65')]],_0x581d('0x15'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x581d('0x3c')](this[_0x581d('0x11')][_0x3749a0['queue']],{'showHidden':![],'depth':null}));ami[_0x581d('0x43')](_0x581d('0x6e'),this[_0x581d('0x11')][_0x3749a0['queue']]);}}}catch(_0x2f5310){logger['error']('[voiceQueueReport][queuesummary]',util[_0x581d('0x3c')](_0x2f5310,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x18')]=function(_0x44cee5){logger[_0x581d('0x45')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x581d('0x3c')](_0x44cee5,{'showHidden':![],'depth':null}));this[_0x581d('0x12')]=!![];};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x6f')]=function(_0x303faf){try{if(this[_0x581d('0x5e')](_0x303faf)){logger[_0x581d('0x45')](_0x581d('0x70'),_0x303faf['uniqueid'],util[_0x581d('0x3c')](_0x303faf,{'showHidden':![],'depth':null}));if(_[_0x581d('0x71')](this[_0x581d('0xd')][_0x303faf[_0x581d('0x4c')]]))this[_0x581d('0xd')][_0x303faf[_0x581d('0x4c')]]=[];if(_[_0x581d('0x71')](this[_0x581d('0xf')][_0x303faf[_0x581d('0x4c')]]))this['channels'][_0x303faf[_0x581d('0x4c')]]={};var _0x40b5e5=new QueueReport();_0x40b5e5[_0x581d('0x49')]=_0x303faf['queue'];_0x40b5e5[_0x581d('0x4f')]=this[_0x581d('0x11')][_0x40b5e5[_0x581d('0x49')]]&&this[_0x581d('0x11')][_0x40b5e5[_0x581d('0x49')]][_0x581d('0x4f')]?this[_0x581d('0x11')][_0x40b5e5[_0x581d('0x49')]][_0x581d('0x4f')]||_0x581d('0x72'):'inbound';_0x40b5e5[_0x581d('0x65')]=_0x303faf[_0x581d('0x65')];_0x40b5e5[_0x581d('0x73')]=moment()[_0x581d('0x5c')](_0x581d('0x74'));_0x40b5e5[_0x581d('0x75')]=_0x303faf[_0x581d('0x75')];_0x40b5e5[_0x581d('0x76')]=_0x303faf[_0x581d('0x76')];_0x40b5e5[_0x581d('0x4c')]=_0x303faf['uniqueid'];_0x40b5e5['routealias']=this[_0x581d('0xf')][_0x303faf[_0x581d('0x4c')]][_0x581d('0x77')];logger[_0x581d('0x66')](_0x581d('0x78'),_0x40b5e5[_0x581d('0x49')],_0x40b5e5[_0x581d('0x4f')]);_['merge'](_0x40b5e5,_[_0x581d('0x79')](_0x303faf,_['keys'](_0x40b5e5)));this[_0x581d('0xd')][_0x303faf[_0x581d('0x4c')]][_0x581d('0x7a')](_0x40b5e5);this[_0x581d('0xf')][_0x303faf[_0x581d('0x4c')]]=_0x40b5e5;this[_0x581d('0x44')](_0x40b5e5,'queuecallerjoin');}}catch(_0x5b1b6d){logger[_0x581d('0x3a')](_0x581d('0x70'),_0x303faf[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x5b1b6d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x7b')]=function(_0x1368f2){try{if(this[_0x581d('0x5e')](_0x1368f2)){logger['debug'](_0x581d('0x7c'),_0x1368f2[_0x581d('0x4c')],util['inspect'](_0x1368f2,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x1368f2[_0x581d('0x4c')]]){var _0x52ca16=_[_0x581d('0x7d')](this['queueReports'][_0x1368f2[_0x581d('0x4c')]]);_0x52ca16[_0x581d('0x7e')]=![];_0x52ca16[_0x581d('0x7f')]=null;_0x52ca16[_0x581d('0x80')]=_0x1368f2[_0x581d('0x80')];_0x52ca16['originalposition']=_0x1368f2[_0x581d('0x81')];_0x52ca16['queuecallerabandon']=!![];_0x52ca16[_0x581d('0x82')]=moment()[_0x581d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x52ca16[_0x581d('0x83')]=_0x581d('0x84');_0x52ca16[_0x581d('0x85')]=null;logger['info'](_0x581d('0x86'),_0x52ca16[_0x581d('0x49')],_0x52ca16[_0x581d('0x4f')]);this['channels'][_0x1368f2[_0x581d('0x4c')]]=_0x52ca16;this['emitVoiceQueueChannelRemove'](_0x52ca16,'queuecallerabandon');}}}catch(_0xb676a8){logger['error'](_0x581d('0x7c'),_0x1368f2[_0x581d('0x4c')],util['inspect'](_0xb676a8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')]['syncQueueCallerLeave']=function(_0x1c5fa4){try{if(this[_0x581d('0x5e')](_0x1c5fa4)){logger[_0x581d('0x45')](_0x581d('0x87'),_0x1c5fa4[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x1c5fa4,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x1c5fa4[_0x581d('0x4c')]]){var _0x545f66=_[_0x581d('0x7d')](this['queueReports'][_0x1c5fa4[_0x581d('0x4c')]]);_0x545f66[_0x581d('0x88')]=moment()['format'](_0x581d('0x74'));_0x545f66['connectedlinenum']=_0x1c5fa4[_0x581d('0x89')];_0x545f66['connectedlinename']=_0x1c5fa4[_0x581d('0x8a')];logger[_0x581d('0x66')](_0x581d('0x8b'),_0x545f66['name'],_0x545f66[_0x581d('0x4f')],_0x1c5fa4['connectedlinenum'],_0x1c5fa4['connectedlinename']);this['channels'][_0x1c5fa4['uniqueid']]=_0x545f66;this[_0x581d('0x44')](_0x545f66,_0x581d('0x1b'));}}}catch(_0x58ce83){logger[_0x581d('0x3a')]('[%s][voiceQueueReport][queuecallerleave]',_0x1c5fa4[_0x581d('0x4c')],util['inspect'](_0x58ce83,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')]['syncAgentConnect']=function(_0x182298){try{if(this['isNotNull'](_0x182298)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x182298[_0x581d('0x4c')],util['inspect'](_0x182298,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x182298['uniqueid']]){var _0x82c39c=_[_0x581d('0x7d')](this[_0x581d('0xd')][_0x182298[_0x581d('0x4c')]]);_0x82c39c[_0x581d('0x7e')]=!![];_0x82c39c[_0x581d('0x83')]='COMPLETEDBYAGENT';logger['info'](_0x581d('0x8c'),_0x82c39c[_0x581d('0x49')],_0x82c39c[_0x581d('0x4f')]);}}}catch(_0x396e26){logger[_0x581d('0x3a')](_0x581d('0x8d'),_0x182298[_0x581d('0x4c')],util['inspect'](_0x396e26,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')]['syncAgentComplete']=function(_0x2e8174){try{if(this[_0x581d('0x5e')](_0x2e8174)){logger[_0x581d('0x45')](_0x581d('0x8e'),_0x2e8174[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x2e8174,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x2e8174[_0x581d('0x4c')]]){var _0x3c0f92=_['last'](this['queueReports'][_0x2e8174[_0x581d('0x4c')]]);_0x3c0f92[_0x581d('0x19')]=![];_0x3c0f92[_0x581d('0x82')]=null;_0x3c0f92[_0x581d('0x8f')]=!![];_0x3c0f92[_0x581d('0x85')]=_0x2e8174[_0x581d('0x90')];_0x3c0f92[_0x581d('0x80')]=_0x2e8174['holdtime'];_0x3c0f92[_0x581d('0x7e')]=!![];_0x3c0f92[_0x581d('0x91')]=![];_0x3c0f92['queuecallerexitAt']=null;if(!_0x3c0f92['transfer']){if(_0x2e8174['reason']==_0x581d('0x92')){_0x3c0f92['queuecallerexitreason']=_0x581d('0x93');logger[_0x581d('0x66')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x3c0f92[_0x581d('0x49')],_0x3c0f92['type']);}else{if(_[_0x581d('0x94')](_0x2e8174[_0x581d('0x38')][_0x581d('0x95')](),_0x581d('0x96'))){if(this[_0x581d('0xd')][_0x2e8174[_0x581d('0x97')]]){var _0x2508b6=_['last'](this['queueReports'][_0x2e8174['linkedid']]);_0x2508b6[_0x581d('0x7e')]=![];_0x2508b6['queuecallerexit']=!![];_0x2508b6[_0x581d('0x98')]=moment(_0x3c0f92[_0x581d('0x73')])[_0x581d('0x99')](_0x2e8174[_0x581d('0x80')],_0x581d('0x9a'))[_0x581d('0x5c')](_0x581d('0x74'));_0x2508b6['queuecallerexitreason']='FORWARDTRANSFER';_0x2508b6[_0x581d('0x92')]=!![];_0x2508b6[_0x581d('0x9b')]=_0x581d('0x9c');_0x2508b6[_0x581d('0x9d')]=_0x2e8174[_0x581d('0x9e')];_0x2508b6[_0x581d('0x9f')]=_0x2e8174['uniqueid'];logger[_0x581d('0x66')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x2508b6[_0x581d('0x49')],_0x2508b6[_0x581d('0x4f')]);var _0x192681=this[_0x581d('0xd')][_0x2e8174[_0x581d('0x97')]];this['queueReports'][_0x2e8174[_0x581d('0x97')]]=this['queueReports'][_0x2e8174[_0x581d('0x4c')]];this[_0x581d('0xd')][_0x2e8174[_0x581d('0x4c')]]=_0x192681;}}else{_0x3c0f92[_0x581d('0x83')]='COMPLETEDBY'+_0x2e8174[_0x581d('0xa0')][_0x581d('0xa1')]();logger[_0x581d('0x66')](_0x581d('0xa2'),_0x3c0f92['name'],_0x3c0f92[_0x581d('0x4f')],_0x3c0f92[_0x581d('0x83')]);}}}this[_0x581d('0xf')][_0x2e8174[_0x581d('0x4c')]]=_0x3c0f92;this[_0x581d('0x41')](_0x3c0f92,_0x581d('0xa3'));}}}catch(_0x53dcb4){logger[_0x581d('0x3a')](_0x581d('0x8e'),_0x2e8174['uniqueid'],util[_0x581d('0x3c')](_0x53dcb4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x20')]=function(_0x30d48d){try{if(this[_0x581d('0x5e')](_0x30d48d)){logger['debug'](_0x581d('0xa4'),_0x30d48d[_0x581d('0x4c')],util['inspect'](_0x30d48d,{'showHidden':![],'depth':null}));this['addVariable'](_0x30d48d['uniqueid'],_[_0x581d('0xa5')](_0x30d48d[_0x581d('0xa6')])[0x0],_0x30d48d[_0x581d('0xa7')]);if(this[_0x581d('0xd')][_0x30d48d['uniqueid']]){var _0x5c7ac9=_[_0x581d('0x7d')](this[_0x581d('0xd')][_0x30d48d[_0x581d('0x4c')]]);if(_0x5c7ac9){if(this[_0x581d('0x5e')](_0x30d48d[_0x581d('0xa6')])&&this[_0x581d('0x5e')](_0x30d48d[_0x581d('0xa6')][_0x581d('0xa8')])){switch(_0x30d48d['value']){case'CONTINUE':_0x5c7ac9[_0x581d('0x91')]=![];_0x5c7ac9[_0x581d('0x98')]=null;break;case _0x581d('0xa9'):_0x5c7ac9[_0x581d('0xaa')]=_0x581d('0xab');_0x5c7ac9[_0x581d('0x91')]=!![];_0x5c7ac9[_0x581d('0x98')]=moment()[_0x581d('0x5c')](_0x581d('0x74'));_0x5c7ac9[_0x581d('0x88')]=moment()['format'](_0x581d('0x74'));logger[_0x581d('0x45')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x30d48d[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x5c7ac9,{'showHidden':![],'depth':null}));ami[_0x581d('0x43')]('custom:timeout',_0x5c7ac9);break;default:_0x5c7ac9[_0x581d('0x91')]=!![];_0x5c7ac9[_0x581d('0x98')]=moment()[_0x581d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c7ac9[_0x581d('0x88')]=moment()[_0x581d('0x5c')](_0x581d('0x74'));}_0x5c7ac9[_0x581d('0x19')]=![];_0x5c7ac9['queuecallerabandonAt']=null;_0x5c7ac9[_0x581d('0x83')]=_0x30d48d[_0x581d('0xa7')];this[_0x581d('0xf')][_0x30d48d[_0x581d('0x4c')]]=_0x5c7ac9;this[_0x581d('0x41')](_0x5c7ac9,'varset');}else if(this['isNotNull'](_0x30d48d['variable'])&&this[_0x581d('0x5e')](_0x30d48d[_0x581d('0xa6')]['queueposition'])){if(!_0x5c7ac9[_0x581d('0x19')]){_0x5c7ac9[_0x581d('0x91')]=!![];_0x5c7ac9['queuecallerexitAt']=moment()[_0x581d('0x5c')](_0x581d('0x74'));_0x5c7ac9['queuecallerexitreason']=_0x581d('0xac');_0x5c7ac9[_0x581d('0x88')]=moment()[_0x581d('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x30d48d['uniqueid']]=_0x5c7ac9;}}logger['info'](_0x581d('0xad'),_0x30d48d[_0x581d('0x4c')],_0x5c7ac9['name'],_0x5c7ac9[_0x581d('0x4f')],_['keys'](_0x30d48d[_0x581d('0xa6')])[0x0],_0x30d48d[_0x581d('0xa7')]);_0x5c7ac9[_0x581d('0x14')]=this[_0x581d('0x14')][_0x30d48d[_0x581d('0x4c')]];}}}}catch(_0x1f5f06){logger[_0x581d('0x3a')]('[%s][voiceQueueReport][varset]',_0x30d48d[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x1f5f06,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0xae')]=function(_0x2744ec,_0x95de2c,_0x51ebd0){var _0xa5afbc=[_0x581d('0xaf'),_0x581d('0xb0'),'rtpaudioqosjitter',_0x581d('0xb1'),_0x581d('0xb2'),_0x581d('0xb3'),_0x581d('0xb4'),_0x581d('0xb5'),'sipcallid',_0x581d('0xb6'),_0x581d('0xb7'),_0x581d('0xb8'),_0x581d('0xb9'),_0x581d('0xba'),'memberinterface',_0x581d('0xbb'),'membername',_0x581d('0xbc'),_0x581d('0xbd')];if(!_[_0x581d('0x36')](_0x95de2c)&&!_[_0x581d('0xbe')](_0xa5afbc,_0x95de2c)){if(_[_0x581d('0x71')](this['variables'][_0x2744ec])){this[_0x581d('0x14')][_0x2744ec]={};}this['variables'][_0x2744ec][_0x95de2c]=_0x51ebd0;}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x22')]=function(_0x214c4a){try{if(this['isNotNull'](_0x214c4a)){logger[_0x581d('0x45')](_0x581d('0xbf'),_0x214c4a[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x214c4a,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x214c4a[_0x581d('0x4c')]]){for(var _0xd27831=0x0,_0x47bc97={};_0xd27831<this[_0x581d('0xd')][_0x214c4a[_0x581d('0x4c')]][_0x581d('0xc0')];_0xd27831+=0x1){_0x47bc97=this['queueReports'][_0x214c4a[_0x581d('0x4c')]][_0xd27831];if(this[_0x581d('0x11')][_0x47bc97[_0x581d('0x65')]]){if(_0x47bc97[_0x581d('0x91')]&&_0x47bc97['transfer']!=!![]){this[_0x581d('0x11')][_0x47bc97[_0x581d('0x65')]][_0x581d('0xc1')]+=0x1;}if(_0x47bc97['queuecallerabandon']){this[_0x581d('0x11')][_0x47bc97[_0x581d('0x65')]][_0x581d('0xc2')]+=0x1;}this[_0x581d('0x11')][_0x47bc97[_0x581d('0x65')]][_0x581d('0x53')]+=moment(_0x47bc97[_0x581d('0x88')])[_0x581d('0xc3')](_0x47bc97[_0x581d('0x73')],_0x581d('0x9a'))||0x0;if(_0xd27831===this[_0x581d('0xd')][_0x214c4a[_0x581d('0x4c')]][_0x581d('0xc0')]-0x1){this[_0x581d('0x11')][_0x47bc97['queue']][_0x581d('0x52')]+=moment()[_0x581d('0xc4')](0x0)[_0x581d('0xc3')](_0x47bc97[_0x581d('0x73')],_0x581d('0x9a'));this['voiceQueues'][_0x47bc97[_0x581d('0x65')]]['total']+=0x1;if(_0x47bc97['queuecallercomplete']){this[_0x581d('0x11')][_0x47bc97[_0x581d('0x65')]][_0x581d('0x50')]+=0x1;this[_0x581d('0x11')][_0x47bc97[_0x581d('0x65')]][_0x581d('0x51')]+=moment()['milliseconds'](0x0)['diff'](_0x47bc97['queuecallerleaveAt'],_0x581d('0x9a'));_0x47bc97[_0x581d('0x7f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x47bc97['queuecallerexit']=![];_0x47bc97[_0x581d('0x98')]=null;}if(_0x47bc97[_0x581d('0x91')]&&_0x47bc97[_0x581d('0x92')]!=!![]){_0x47bc97[_0x581d('0xaa')]=_0x581d('0xc1');logger[_0x581d('0x45')](_0x581d('0xc5'),_0x214c4a[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x47bc97,{'showHidden':![],'depth':null}));ami[_0x581d('0x43')](_0x581d('0xc6'),_0x47bc97);}if(_0x47bc97[_0x581d('0x19')]){_0x47bc97[_0x581d('0xaa')]=_0x581d('0xc2');logger['debug'](_0x581d('0xc7'),_0x214c4a['uniqueid'],util[_0x581d('0x3c')](_0x47bc97,{'showHidden':![],'depth':null}));ami['emit'](_0x581d('0xc8'),_0x47bc97);}}else{this[_0x581d('0x11')][_0x47bc97['queue']][_0x581d('0x52')]+=this['voiceQueues'][_0x47bc97[_0x581d('0x65')]]['sumHoldTime'];}logger['info'](_0x581d('0xc9'),_0x214c4a['uniqueid'],_0x47bc97[_0x581d('0x49')],_0x47bc97['type'],_0x214c4a[_0x581d('0xca')]);this[_0x581d('0xf')][_0x214c4a[_0x581d('0x4c')]]=_0x47bc97;this[_0x581d('0x41')](_0x47bc97,_0x581d('0x21'));this[_0x581d('0xcb')](this[_0x581d('0x11')][_0x47bc97[_0x581d('0x65')]],'hangup');}}logger[_0x581d('0x45')](_0x581d('0xcc'),_0x214c4a['uniqueid'],util[_0x581d('0x3c')](this[_0x581d('0xd')][_0x214c4a[_0x581d('0x4c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x581d('0xcd'),this[_0x581d('0xd')][_0x214c4a[_0x581d('0x4c')]]);delete this[_0x581d('0xd')][_0x214c4a[_0x581d('0x4c')]];delete this[_0x581d('0xf')][_0x214c4a[_0x581d('0x4c')]];}if(this[_0x581d('0x14')][_0x214c4a[_0x581d('0x4c')]]){delete this['variables'][_0x214c4a[_0x581d('0x4c')]];}}}catch(_0x1979c2){logger[_0x581d('0x3a')]('[%s][voiceQueueReport][hangup]',_0x214c4a[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x1979c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAttendedTransfer']=function(_0x33e83a){try{if(this['isNotNull'](_0x33e83a)){logger['debug'](_0x581d('0xce'),_0x33e83a[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x33e83a,{'showHidden':![],'depth':null}));var _0x21fe5c;if(this[_0x581d('0xd')][_0x33e83a[_0x581d('0xcf')]]){_0x21fe5c=_[_0x581d('0x7d')](this[_0x581d('0xd')][_0x33e83a['transfereeuniqueid']]);_0x21fe5c[_0x581d('0x9d')]=_0x33e83a[_0x581d('0xd0')];_0x21fe5c[_0x581d('0x9f')]=_0x33e83a['secondtransfereruniqueid'];_0x21fe5c[_0x581d('0x83')]=_0x581d('0xd1');_0x21fe5c[_0x581d('0x92')]=!![];_0x21fe5c[_0x581d('0x9b')]=_0x581d('0xd2');if(this[_0x581d('0xd')][_0x33e83a[_0x581d('0xd3')]]){var _0x4da3e4=this[_0x581d('0xd')][_0x33e83a[_0x581d('0xd3')]];this[_0x581d('0xd')][_0x33e83a[_0x581d('0xd3')]]=this['queueReports'][_0x33e83a[_0x581d('0xcf')]];this[_0x581d('0xd')][_0x33e83a[_0x581d('0xcf')]]=_0x4da3e4;var _0x17e729=_[_0x581d('0x7d')](this['queueReports'][_0x33e83a[_0x581d('0xcf')]]);_0x17e729[_0x581d('0x34')]=!![];}logger['info'](_0x581d('0xd4'),_0x33e83a[_0x581d('0x4c')],_0x21fe5c[_0x581d('0x49')],_0x21fe5c[_0x581d('0x4f')],_0x21fe5c[_0x581d('0x9d')],_0x21fe5c['transferuniqueid']);}else if(this[_0x581d('0xd')][_0x33e83a[_0x581d('0xd5')]]){_0x21fe5c=_['last'](this[_0x581d('0xd')][_0x33e83a[_0x581d('0xd5')]]);_0x21fe5c[_0x581d('0x9d')]=_0x33e83a[_0x581d('0xd6')];_0x21fe5c[_0x581d('0x9f')]=_0x33e83a[_0x581d('0xd7')];_0x21fe5c[_0x581d('0x83')]='ATTENDEDTRANSFER';_0x21fe5c[_0x581d('0x92')]=!![];_0x21fe5c[_0x581d('0x9b')]=_0x581d('0xd2');if(this[_0x581d('0xd')][_0x33e83a['origtransfereruniqueid']]){var _0x4da3e4=this[_0x581d('0xd')][_0x33e83a['origtransfereruniqueid']];this[_0x581d('0xd')][_0x33e83a[_0x581d('0xd7')]]=this[_0x581d('0xd')][_0x33e83a[_0x581d('0xd5')]];this[_0x581d('0xd')][_0x33e83a[_0x581d('0xd5')]]=_0x4da3e4;var _0x17e729=_['last'](this[_0x581d('0xd')][_0x33e83a[_0x581d('0xd5')]]);_0x17e729[_0x581d('0x34')]=!![];}logger[_0x581d('0x66')](_0x581d('0xd4'),_0x33e83a['uniqueid'],_0x21fe5c[_0x581d('0x49')],_0x21fe5c[_0x581d('0x4f')],_0x21fe5c[_0x581d('0x9d')],_0x21fe5c[_0x581d('0x9f')]);}}}catch(_0x3cf662){logger[_0x581d('0x3a')](_0x581d('0xce'),_0x33e83a[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x3cf662,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')]['syncBlindTransfer']=function(_0x3358aa){try{if(this[_0x581d('0x5e')](_0x3358aa)){logger[_0x581d('0x45')](_0x581d('0xd8'),_0x3358aa[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x3358aa,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x3358aa[_0x581d('0xcf')]]){var _0x4ff2f4=_[_0x581d('0x7d')](this['queueReports'][_0x3358aa[_0x581d('0xcf')]]);_0x4ff2f4[_0x581d('0x83')]=_0x581d('0xd9');_0x4ff2f4[_0x581d('0x92')]=!![];_0x4ff2f4[_0x581d('0x9b')]=_0x581d('0xda');_0x4ff2f4[_0x581d('0x9d')]=_0x3358aa['extension'];_0x4ff2f4['transferuniqueid']=_0x3358aa[_0x581d('0xcf')];logger[_0x581d('0x66')](_0x581d('0xdb'),_0x3358aa[_0x581d('0x4c')],_0x4ff2f4[_0x581d('0x49')],_0x4ff2f4[_0x581d('0x4f')],_0x4ff2f4['transferexten'],_0x4ff2f4[_0x581d('0x9f')]);this[_0x581d('0x22')]({'event':'BlindTransfer','uniqueid':_0x3358aa[_0x581d('0xcf')],'context':_0x3358aa[_0x581d('0xdc')],'channel':_0x3358aa['transfererchannel']});}}}catch(_0x52f396){logger[_0x581d('0x3a')]('[%s][voiceQueueReport][blindtransfer]',_0x3358aa['uniqueid'],util[_0x581d('0x3c')](_0x52f396,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x28')]=function(_0x5a8f2a){try{if(this[_0x581d('0x5e')](_0x5a8f2a)){logger['debug']('[%s][voiceQueueReport][musiconholdstart]',_0x5a8f2a[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x5a8f2a,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x5a8f2a[_0x581d('0x4c')]]){var _0x3e3508=_[_0x581d('0x7d')](this[_0x581d('0xd')][_0x5a8f2a[_0x581d('0x4c')]]);if(!_[_0x581d('0x36')](_0x3e3508[_0x581d('0x88')])){_0x3e3508[_0x581d('0xdd')]=moment()[_0x581d('0x5c')](_0x581d('0x74'));logger[_0x581d('0x66')](_0x581d('0xde'),_0x5a8f2a['uniqueid'],_0x3e3508[_0x581d('0xdd')]);}}}}catch(_0x5799ea){logger[_0x581d('0x3a')](_0x581d('0xdf'),_0x5a8f2a[_0x581d('0x4c')],util['inspect'](_0x5799ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x29')]=function(_0x5655b2){try{if(this[_0x581d('0x5e')](_0x5655b2)){logger[_0x581d('0x45')](_0x581d('0xe0'),_0x5655b2['uniqueid'],util[_0x581d('0x3c')](_0x5655b2,{'showHidden':![],'depth':null}));if(this[_0x581d('0xd')][_0x5655b2[_0x581d('0x4c')]]){var _0x47d65c=_[_0x581d('0x7d')](this[_0x581d('0xd')][_0x5655b2[_0x581d('0x4c')]]);if(!_[_0x581d('0x36')](_0x47d65c[_0x581d('0xdd')])){_0x47d65c[_0x581d('0xe1')]+=moment()[_0x581d('0xc4')](0x0)[_0x581d('0xc3')](_0x47d65c[_0x581d('0xdd')],_0x581d('0x9a'));logger['info'](_0x581d('0xe2'),_0x5655b2[_0x581d('0x4c')],_0x47d65c[_0x581d('0xe1')]);delete _0x47d65c[_0x581d('0xdd')];}}}}catch(_0x19efcb){logger[_0x581d('0x3a')]('[%s][voiceQueueReport][musiconholdstop]',_0x5655b2[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x19efcb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x581d('0xa')][_0x581d('0x26')]=function(_0x152cf4){try{if(this['isNotNull'](_0x152cf4)){logger[_0x581d('0x45')](_0x581d('0xe3'),_0x152cf4[_0x581d('0x4c')],util['inspect'](_0x152cf4,{'showHidden':![],'depth':null}));if(_0x152cf4[_0x581d('0xe4')]['toLowerCase']()===_0x581d('0xe5')){_0x152cf4[_0x581d('0xe6')]=_0x152cf4[_0x581d('0xe7')]&&_0x152cf4[_0x581d('0xe7')][_0x581d('0x94')](_0x581d('0xe8'))?_0x152cf4[_0x581d('0xe7')]:(_0x152cf4[_0x581d('0xe7')]||_0x152cf4[_0x581d('0xe6')])[_0x581d('0x95')]();if(_[_0x581d('0x94')](_0x152cf4['applicationdata']['toLowerCase'](),_0x581d('0xe9'))){logger[_0x581d('0x66')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x152cf4[_0x581d('0x4c')],_0x152cf4[_0x581d('0xe4')],_0x152cf4['applicationdata']);if(_[_0x581d('0x71')](this[_0x581d('0xf')][_0x152cf4[_0x581d('0x4c')]]))this['channels'][_0x152cf4[_0x581d('0x4c')]]={};var _0x440c6d=_0x152cf4[_0x581d('0xe6')][_0x581d('0xea')]('=');var _0x16a2b2=_0x440c6d[0x0][_0x581d('0x95')]()[_0x581d('0xeb')](/cdr\((.*)\)/);if(_0x16a2b2)this[_0x581d('0xf')][_0x152cf4['uniqueid']][_0x16a2b2[0x1]]=_0x440c6d[0x1];}}}}catch(_0x555252){logger['error'](_0x581d('0xec'),_0x152cf4[_0x581d('0x4c')],util[_0x581d('0x3c')](_0x555252,{'showHidden':![],'depth':null}));}};module[_0x581d('0xed')]=VoiceQueueReport;
\ No newline at end of file
index f9f9058..1c451b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63af=['CreateReportAgentPreview','campaign'];(function(_0x13062b,_0x285d7d){var _0x564586=function(_0x3b624d){while(--_0x3b624d){_0x13062b['push'](_0x13062b['shift']());}};_0x564586(++_0x285d7d);}(_0x63af,0x1ab));var _0xf63a=function(_0x1093dc,_0xa31577){_0x1093dc=_0x1093dc-0x0;var _0x53bdb3=_0x63af[_0x1093dc];return _0x53bdb3;};'use strict';var client=require('../client');exports['createHistory']=function(_0xdaa79b){return function(){_0xdaa79b[_0xf63a('0x0')]=_0xdaa79b['queue'];return client['Request'](_0xf63a('0x1'),{'body':_0xdaa79b,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
+var _0x916d=['createHistory','campaign','Request','CreateReportAgentPreview','../client'];(function(_0x2167e3,_0x22b96e){var _0x5006d2=function(_0x42321b){while(--_0x42321b){_0x2167e3['push'](_0x2167e3['shift']());}};_0x5006d2(++_0x22b96e);}(_0x916d,0x1d0));var _0xd916=function(_0x44dbd5,_0x31505c){_0x44dbd5=_0x44dbd5-0x0;var _0x152c32=_0x916d[_0x44dbd5];return _0x152c32;};'use strict';var client=require(_0xd916('0x0'));exports[_0xd916('0x1')]=function(_0x8dfc9f){return function(){_0x8dfc9f[_0xd916('0x2')]=_0x8dfc9f['queue'];return client[_0xd916('0x3')](_0xd916('0x4'),{'body':_0x8dfc9f,'log':_0xd916('0x4')});};};
\ No newline at end of file
index b604469..4a35976 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7560=['Request','CreateAttachment','../client','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7560,0x6e));var _0x0756=function(_0xd3a823,_0x4ad32e){_0xd3a823=_0xd3a823-0x0;var _0x54b98a=_0x7560[_0xd3a823];return _0x54b98a;};'use strict';var client=require(_0x0756('0x0'));exports[_0x0756('0x1')]=function(_0x150eae){return client[_0x0756('0x2')](_0x0756('0x3'),{'body':_0x150eae,'log':_0x0756('0x3')});};
\ No newline at end of file
+var _0x34dc=['../client','create','Request','CreateAttachment'];(function(_0x15ded2,_0x132917){var _0x3b8d71=function(_0x515002){while(--_0x515002){_0x15ded2['push'](_0x15ded2['shift']());}};_0x3b8d71(++_0x132917);}(_0x34dc,0x124));var _0xc34d=function(_0x46d430,_0x16992a){_0x46d430=_0x46d430-0x0;var _0x189702=_0x34dc[_0x46d430];return _0x189702;};'use strict';var client=require(_0xc34d('0x0'));exports[_0xc34d('0x1')]=function(_0x3349e0){return client[_0xc34d('0x2')](_0xc34d('0x3'),{'body':_0x3349e0,'log':_0xc34d('0x3')});};
\ No newline at end of file
index 720fd8b..6fcf457 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialPrefix','Trunk','callerid','TrunkBackup','Interval','Intervals','SquareProject','../client','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName'];(function(_0x10a45f,_0xa8006e){var _0x202e0d=function(_0x1a5bc8){while(--_0x1a5bc8){_0x10a45f['push'](_0x10a45f['shift']());}};_0x202e0d(++_0xa8006e);}(_0x326f,0xd1));var _0xf326=function(_0x12115b,_0x1e1a16){_0x12115b=_0x12115b-0x0;var _0x4fbfc5=_0x326f[_0x12115b];return _0x4fbfc5;};'use strict';var client=require(_0xf326('0x0'));exports['getCampaigns']=function(){return function(){return client['Request'](_0xf326('0x1'),{'options':{'raw':![],'attributes':['id',_0xf326('0x2'),_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9'),_0xf326('0xa'),'dialBusyMaxRetry',_0xf326('0xb'),_0xf326('0xc'),_0xf326('0xd'),_0xf326('0xe'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xf326('0xf'),_0xf326('0x10'),_0xf326('0x11'),_0xf326('0x12'),_0xf326('0x13'),'dialAgentRejectMaxRetry',_0xf326('0x14'),'dialTimezone',_0xf326('0x15'),'dialAMDActive',_0xf326('0x16'),'dialAMDGreeting',_0xf326('0x17'),_0xf326('0x18'),'dialAMDMinWordLength',_0xf326('0x19'),_0xf326('0x1a'),_0xf326('0x1b'),_0xf326('0x1c'),'dialOrderByScheduledAt',_0xf326('0x1d'),'dialRandomLastDigitCallerIdNumber','dialCutDigit'],'include':[{'model':_0xf326('0x1e'),'as':_0xf326('0x1e'),'attributes':['id',_0xf326('0x2'),_0xf326('0x1f'),_0xf326('0x4')]},{'model':_0xf326('0x1e'),'as':_0xf326('0x20'),'attributes':['id',_0xf326('0x2'),'callerid',_0xf326('0x4')]},{'model':_0xf326('0x21'),'as':_0xf326('0x21'),'attributes':['id',_0xf326('0x2')],'include':[{'model':_0xf326('0x21'),'as':_0xf326('0x22'),'attributes':['id','name','interval']}]},{'model':'SquareProject','as':_0xf326('0x23'),'attributes':['id',_0xf326('0x2')]}]},'log':'getCampaign'});};};
\ No newline at end of file
+var _0x7a54=['dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','callerid','active','Interval','Intervals','interval','SquareProject','../client','getCampaigns','Request','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry'];(function(_0x1ea9b1,_0x17403f){var _0x5d3d75=function(_0xca75c8){while(--_0xca75c8){_0x1ea9b1['push'](_0x1ea9b1['shift']());}};_0x5d3d75(++_0x17403f);}(_0x7a54,0x106));var _0x47a5=function(_0x2c0156,_0x3aae66){_0x2c0156=_0x2c0156-0x0;var _0xa0e2ff=_0x7a54[_0x2c0156];return _0xa0e2ff;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(){return function(){return client[_0x47a5('0x2')]('GetCampaign',{'options':{'raw':![],'attributes':['id',_0x47a5('0x3'),_0x47a5('0x4'),'active',_0x47a5('0x5'),_0x47a5('0x6'),_0x47a5('0x7'),_0x47a5('0x8'),_0x47a5('0x9'),'dialCongestionRetryFrequency',_0x47a5('0xa'),'dialBusyRetryFrequency',_0x47a5('0xb'),_0x47a5('0xc'),'dialGlobalMaxRetry',_0x47a5('0xd'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency',_0x47a5('0xe'),_0x47a5('0xf'),'dialMachineMaxRetry',_0x47a5('0x10'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),_0x47a5('0x14'),_0x47a5('0x15'),_0x47a5('0x16'),_0x47a5('0x17'),'dialAMDMinWordLength',_0x47a5('0x18'),_0x47a5('0x19'),_0x47a5('0x1a'),_0x47a5('0x1b'),_0x47a5('0x1c'),_0x47a5('0x1d'),_0x47a5('0x1e'),_0x47a5('0x1f')],'include':[{'model':'Trunk','as':_0x47a5('0x20'),'attributes':['id',_0x47a5('0x3'),_0x47a5('0x21'),_0x47a5('0x22')]},{'model':_0x47a5('0x20'),'as':'TrunkBackup','attributes':['id','name',_0x47a5('0x21'),'active']},{'model':'Interval','as':_0x47a5('0x23'),'attributes':['id',_0x47a5('0x3')],'include':[{'model':_0x47a5('0x23'),'as':_0x47a5('0x24'),'attributes':['id',_0x47a5('0x3'),_0x47a5('0x25')]}]},{'model':_0x47a5('0x26'),'as':_0x47a5('0x26'),'attributes':['id',_0x47a5('0x3')]}]},'log':'getCampaign'});};};
\ No newline at end of file
index df18678..abab900 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0574=['CreateCmContact','getContacts','GetCmContact','../client','createContact','Request'];(function(_0x24aa78,_0x3d1da8){var _0x18a8f9=function(_0xf2b551){while(--_0xf2b551){_0x24aa78['push'](_0x24aa78['shift']());}};_0x18a8f9(++_0x3d1da8);}(_0x0574,0x7b));var _0x4057=function(_0x256521,_0x5c93c2){_0x256521=_0x256521-0x0;var _0x372601=_0x0574[_0x256521];return _0x372601;};'use strict';var client=require(_0x4057('0x0'));exports[_0x4057('0x1')]=function(_0x5a7e90){return function(){return client[_0x4057('0x2')](_0x4057('0x3'),{'body':_0x5a7e90,'log':_0x4057('0x3')});};};exports[_0x4057('0x4')]=function(_0x5b7cf3){return function(){return client[_0x4057('0x2')](_0x4057('0x5'),{'options':_0x5b7cf3,'log':_0x4057('0x5')});};};
\ No newline at end of file
+var _0x2cdf=['getContacts','GetCmContact','../client','createContact','Request','CreateCmContact'];(function(_0x4e3079,_0x2e48ea){var _0x4356fb=function(_0x3f31e0){while(--_0x3f31e0){_0x4e3079['push'](_0x4e3079['shift']());}};_0x4356fb(++_0x2e48ea);}(_0x2cdf,0x122));var _0xf2cd=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x2cdf[_0x5f0089];return _0x193892;};'use strict';var client=require(_0xf2cd('0x0'));exports[_0xf2cd('0x1')]=function(_0x1415c4){return function(){return client[_0xf2cd('0x2')](_0xf2cd('0x3'),{'body':_0x1415c4,'log':_0xf2cd('0x3')});};};exports[_0xf2cd('0x4')]=function(_0x353472){return function(){return client[_0xf2cd('0x2')](_0xf2cd('0x5'),{'options':_0x353472,'log':_0xf2cd('0x5')});};};
\ No newline at end of file
index edec186..9cbf797 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc7ac=['CampaignId','countReScheduled','CountReScheduled','getContactPreview','User','Agent','name','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','Contact','voicePause','db.CmHopper.UserId','moment','lodash','getContacts','Request','GetCmHopper','CmContact','getCmHopper','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','ContactId','ListId','VoiceQueueId','rescheduleContact','getContactDialer','GetContactDialer','DESC','scheduledat','ASC','getContactDialerIvr','priority','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer'];(function(_0x530cca,_0x44bcc9){var _0x2f7832=function(_0x4ebfca){while(--_0x4ebfca){_0x530cca['push'](_0x530cca['shift']());}};_0x2f7832(++_0x44bcc9);}(_0xc7ac,0x86));var _0xcc7a=function(_0x2ce8c5,_0x271741){_0x2ce8c5=_0x2ce8c5-0x0;var _0xf2c55c=_0xc7ac[_0x2ce8c5];return _0xf2c55c;};'use strict';var client=require('../client');var moment=require(_0xcc7a('0x0'));var _=require(_0xcc7a('0x1'));exports[_0xcc7a('0x2')]=function(_0x11f4a1,_0x32d727){return function(){return client[_0xcc7a('0x3')](_0xcc7a('0x4'),{'options':{'where':{'VoiceQueueId':_0x11f4a1},'include':[{'model':_0xcc7a('0x5'),'as':'Contact'}],'limit':_0x32d727,'raw':![]},'log':_0xcc7a('0x6')});};};exports['updateContacts']=function(_0x585bb9,_0xb770e0,_0x39c4e2){return function(){return client[_0xcc7a('0x3')](_0xcc7a('0x7'),{'body':_0x585bb9,'options':{'where':{'VoiceQueueId':_0xb770e0,'scheduledat':{'$lte':moment()[_0xcc7a('0x8')](_0xcc7a('0x9'))}},'limit':_0x39c4e2},'log':_0xcc7a('0x7')});};};exports['rescheduleContact']=function(_0x3049d7){return function(){return client[_0xcc7a('0x3')]('UpdateCmHopper',{'body':_0x3049d7,'options':{'where':{'ContactId':_0x3049d7[_0xcc7a('0xa')],'ListId':_0x3049d7[_0xcc7a('0xb')],'VoiceQueueId':_0x3049d7[_0xcc7a('0xc')],'CampaignId':_0x3049d7['CampaignId']}},'log':_0xcc7a('0xd')});};};exports['destroyContact']=function(_0x3d2580,_0x41e2a7,_0x45e6cc){return function(){return client[_0xcc7a('0x3')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x3d2580,'ListId':_0x41e2a7,'ContactId':_0x45e6cc}},'log':'DestroyCmHopper'});};};exports[_0xcc7a('0xe')]=function(_0x3c2a1e,_0x5e1509,_0x418183,_0x5a8704){return function(){return client[_0xcc7a('0x3')](_0xcc7a('0xf'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3c2a1e,'active':![],'scheduledat':{'$lte':moment()[_0xcc7a('0x8')](_0xcc7a('0x9'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x5e1509}}]},'order':[['priority',_0xcc7a('0x10')],[_0xcc7a('0x11'),_0x5a8704],['id',_0xcc7a('0x12')]],'raw':!![],'limit':_0x418183},'log':_0xcc7a('0xf')});};};exports[_0xcc7a('0x13')]=function(_0x4b1bf0,_0x73b679,_0x2e0323){return function(){return client[_0xcc7a('0x3')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x4b1bf0,'active':![],'scheduledat':{'$lte':moment()[_0xcc7a('0x8')](_0xcc7a('0x9'))}},'include':[{'model':_0xcc7a('0x5'),'as':'Contact'}],'order':[[_0xcc7a('0x14'),_0xcc7a('0x10')],[_0xcc7a('0x11'),_0x2e0323],['id',_0xcc7a('0x12')]],'raw':!![],'limit':_0x73b679},'log':_0xcc7a('0x15')});};};exports[_0xcc7a('0x16')]=function(_0x200e10,_0x22b4c6){return function(){_0x200e10[_0xcc7a('0x17')]=_0x200e10[_0xcc7a('0x18')];return client[_0xcc7a('0x3')](_0xcc7a('0x19'),{'body':_0x200e10,'options':{'where':{'ContactId':_0x200e10[_0xcc7a('0xa')],'ListId':_0x200e10[_0xcc7a('0xb')],'VoiceQueueId':_0x200e10[_0xcc7a('0xc')],'CampaignId':_0x200e10[_0xcc7a('0x1a')],'active':_0x22b4c6?undefined:!![]}},'log':_0xcc7a('0x19')});};};exports[_0xcc7a('0x1b')]=function(_0x9cb87e){return function(){return client[_0xcc7a('0x3')](_0xcc7a('0x1c'),{'options':{'where':{'VoiceQueueId':_0x9cb87e['id']?_0x9cb87e['id']||null:null}},'log':_0xcc7a('0x1b')});};};exports[_0xcc7a('0x1d')]=function(_0xfc55f4){return function(){return client['Request']('GetCmHopperPreview',{'options':{'where':{'id':_0xfc55f4},'include':[{'model':_0xcc7a('0x5'),'as':'Contact'},{'model':_0xcc7a('0x1e'),'as':_0xcc7a('0x1f'),'attributes':['id',_0xcc7a('0x20')]},{'model':'VoiceQueue','as':_0xcc7a('0x21'),'attributes':['id',_0xcc7a('0x20')]}],'raw':!![]},'log':_0xcc7a('0x6')});};};exports[_0xcc7a('0x22')]=function(_0x3064f1,_0x35ecc4,_0x590db9){return function(){return client[_0xcc7a('0x3')](_0xcc7a('0x7'),{'body':_0x3064f1,'options':{'where':{'id':_0x35ecc4},'limit':_0x590db9},'log':_0xcc7a('0x7')});};};exports[_0xcc7a('0x23')]=function(_0x129b38,_0x14386f){return function(){return client[_0xcc7a('0x3')](_0xcc7a('0x24'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x129b38,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0xcc7a('0x8')](_0xcc7a('0x9'))},'UserId':{'$in':_0x14386f}},'order':[['priority',_0xcc7a('0x10')],[_0xcc7a('0x11'),'DESC'],['id',_0xcc7a('0x12')]],'include':[{'model':_0xcc7a('0x5'),'as':_0xcc7a('0x25')},{'model':_0xcc7a('0x1e'),'as':_0xcc7a('0x1f'),'attributes':['id',_0xcc7a('0x20'),_0xcc7a('0x26')]}],'group':_0xcc7a('0x27'),'raw':!![]},'log':_0xcc7a('0xf')});};};
\ No newline at end of file
+var _0x9464=['getContactPreview','User','VoiceQueue','Queue','getCmHopper','getContactRecallMe','name','voicePause','db.CmHopper.UserId','lodash','GetCmHopper','CmContact','Contact','updateContacts','Request','UpdateCmHopper','YYYY-MM-DD\x20HH:mm:ss','rescheduleContact','ContactId','ListId','VoiceQueueId','destroyContact','DestroyCmHopper','getContactDialer','format','priority','DESC','scheduledat','ASC','GetContactDialer','getContactDialerIvr','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9464,0x1d1));var _0x4946=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x9464[_0x4fbb15];return _0x436338;};'use strict';var client=require('../client');var moment=require('moment');var _=require(_0x4946('0x0'));exports['getContacts']=function(_0x376392,_0x3e1247){return function(){return client['Request'](_0x4946('0x1'),{'options':{'where':{'VoiceQueueId':_0x376392},'include':[{'model':_0x4946('0x2'),'as':_0x4946('0x3')}],'limit':_0x3e1247,'raw':![]},'log':'getCmHopper'});};};exports[_0x4946('0x4')]=function(_0x5f1890,_0x55f115,_0x17ac2c){return function(){return client[_0x4946('0x5')](_0x4946('0x6'),{'body':_0x5f1890,'options':{'where':{'VoiceQueueId':_0x55f115,'scheduledat':{'$lte':moment()['format'](_0x4946('0x7'))}},'limit':_0x17ac2c},'log':'UpdateCmHopper'});};};exports[_0x4946('0x8')]=function(_0x141c91){return function(){return client[_0x4946('0x5')](_0x4946('0x6'),{'body':_0x141c91,'options':{'where':{'ContactId':_0x141c91[_0x4946('0x9')],'ListId':_0x141c91[_0x4946('0xa')],'VoiceQueueId':_0x141c91[_0x4946('0xb')],'CampaignId':_0x141c91['CampaignId']}},'log':_0x4946('0x8')});};};exports[_0x4946('0xc')]=function(_0x380d07,_0x243b10,_0x1c72a5){return function(){return client[_0x4946('0x5')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x380d07,'ListId':_0x243b10,'ContactId':_0x1c72a5}},'log':_0x4946('0xd')});};};exports[_0x4946('0xe')]=function(_0x22a16d,_0x571957,_0x259a5a,_0x27e032){return function(){return client[_0x4946('0x5')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x22a16d,'active':![],'scheduledat':{'$lte':moment()[_0x4946('0xf')](_0x4946('0x7'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x571957}}]},'order':[[_0x4946('0x10'),_0x4946('0x11')],[_0x4946('0x12'),_0x27e032],['id',_0x4946('0x13')]],'raw':!![],'limit':_0x259a5a},'log':_0x4946('0x14')});};};exports[_0x4946('0x15')]=function(_0x408f68,_0x3a587e,_0x1d5e57){return function(){return client[_0x4946('0x5')](_0x4946('0x14'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x408f68,'active':![],'scheduledat':{'$lte':moment()[_0x4946('0xf')](_0x4946('0x7'))}},'include':[{'model':_0x4946('0x2'),'as':'Contact'}],'order':[['priority',_0x4946('0x11')],[_0x4946('0x12'),_0x1d5e57],['id',_0x4946('0x13')]],'raw':!![],'limit':_0x3a587e},'log':_0x4946('0x16')});};};exports[_0x4946('0x17')]=function(_0x2bf4d2,_0x320df4){return function(){_0x2bf4d2[_0x4946('0x18')]=_0x2bf4d2[_0x4946('0x19')];return client[_0x4946('0x5')]('MoveContactManagedDialer',{'body':_0x2bf4d2,'options':{'where':{'ContactId':_0x2bf4d2[_0x4946('0x9')],'ListId':_0x2bf4d2[_0x4946('0xa')],'VoiceQueueId':_0x2bf4d2[_0x4946('0xb')],'CampaignId':_0x2bf4d2['CampaignId'],'active':_0x320df4?undefined:!![]}},'log':_0x4946('0x1a')});};};exports[_0x4946('0x1b')]=function(_0x42f355){return function(){return client[_0x4946('0x5')](_0x4946('0x1c'),{'options':{'where':{'VoiceQueueId':_0x42f355['id']?_0x42f355['id']||null:null}},'log':'countReScheduled'});};};exports[_0x4946('0x1d')]=function(_0x2bf373){return function(){return client[_0x4946('0x5')]('GetCmHopperPreview',{'options':{'where':{'id':_0x2bf373},'include':[{'model':'CmContact','as':_0x4946('0x3')},{'model':_0x4946('0x1e'),'as':'Agent','attributes':['id','name']},{'model':_0x4946('0x1f'),'as':_0x4946('0x20'),'attributes':['id','name']}],'raw':!![]},'log':_0x4946('0x21')});};};exports['unlockContact']=function(_0x2db473,_0x24199d,_0x6d7da3){return function(){return client[_0x4946('0x5')](_0x4946('0x6'),{'body':_0x2db473,'options':{'where':{'id':_0x24199d},'limit':_0x6d7da3},'log':_0x4946('0x6')});};};exports[_0x4946('0x22')]=function(_0x3a0a17,_0x2a89f2){return function(){return client[_0x4946('0x5')]('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3a0a17,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()['format'](_0x4946('0x7'))},'UserId':{'$in':_0x2a89f2}},'order':[[_0x4946('0x10'),_0x4946('0x11')],[_0x4946('0x12'),_0x4946('0x11')],['id','ASC']],'include':[{'model':_0x4946('0x2'),'as':_0x4946('0x3')},{'model':_0x4946('0x1e'),'as':'Agent','attributes':['id',_0x4946('0x23'),_0x4946('0x24')]}],'group':_0x4946('0x25'),'raw':!![]},'log':_0x4946('0x14')});};};
\ No newline at end of file
index 3429e38..d751634 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0972=['GetCmHopperBlack','checkIsBlackListIvr','CampaignId','GetCmHopperBlackIvr','checkIsBlackList','Request','VoiceQueueId','Contact'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x0972,0x64));var _0x2097=function(_0x56ca95,_0x5a3d76){_0x56ca95=_0x56ca95-0x0;var _0x1de1a7=_0x0972[_0x56ca95];return _0x1de1a7;};'use strict';var client=require('../client');exports[_0x2097('0x0')]=function(_0x517422){return function(){return client[_0x2097('0x1')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x517422[_0x2097('0x2')],'phone':_0x517422[_0x2097('0x3')]['phone']},'raw':![]},'log':_0x2097('0x4')});};};exports[_0x2097('0x5')]=function(_0xe6fbae){return function(){return client[_0x2097('0x1')](_0x2097('0x4'),{'options':{'where':{'CampaignId':_0xe6fbae[_0x2097('0x6')],'phone':_0xe6fbae[_0x2097('0x3')]['phone']},'raw':![]},'log':_0x2097('0x7')});};};
\ No newline at end of file
+var _0xe820=['GetCmHopperBlack','CampaignId','../client','VoiceQueueId','Contact','phone','checkIsBlackListIvr','Request'];(function(_0x375f62,_0x28bd57){var _0x30f5cd=function(_0x45d531){while(--_0x45d531){_0x375f62['push'](_0x375f62['shift']());}};_0x30f5cd(++_0x28bd57);}(_0xe820,0xd2));var _0x0e82=function(_0x2cf7a3,_0x49190a){_0x2cf7a3=_0x2cf7a3-0x0;var _0xdb9898=_0xe820[_0x2cf7a3];return _0xdb9898;};'use strict';var client=require(_0x0e82('0x0'));exports['checkIsBlackList']=function(_0x908a54){return function(){return client['Request']('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x908a54[_0x0e82('0x1')],'phone':_0x908a54[_0x0e82('0x2')][_0x0e82('0x3')]},'raw':![]},'log':'GetCmHopperBlack'});};};exports[_0x0e82('0x4')]=function(_0x5de50f){return function(){return client[_0x0e82('0x5')](_0x0e82('0x6'),{'options':{'where':{'CampaignId':_0x5de50f[_0x0e82('0x7')],'phone':_0x5de50f[_0x0e82('0x2')][_0x0e82('0x3')]},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
index 8c658e2..76a4bac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2a7b=['campaign','queue','CreateCmHopperFinal','createContact'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x2a7b,0x16f));var _0xb2a7=function(_0x1954a8,_0x651c1c){_0x1954a8=_0x1954a8-0x0;var _0x162b13=_0x2a7b[_0x1954a8];return _0x162b13;};'use strict';var client=require('../client');exports[_0xb2a7('0x0')]=function(_0x31830c){return function(){_0x31830c[_0xb2a7('0x1')]=_0x31830c[_0xb2a7('0x2')];return client['Request'](_0xb2a7('0x3'),{'body':_0x31830c,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
+var _0x1601=['createContact','queue','Request','CreateCmHopperFinal','../client'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x1601,0x6d));var _0x1160=function(_0x2efe86,_0x4b6c3f){_0x2efe86=_0x2efe86-0x0;var _0x48e01c=_0x1601[_0x2efe86];return _0x48e01c;};'use strict';var client=require(_0x1160('0x0'));exports[_0x1160('0x1')]=function(_0x3a6504){return function(){_0x3a6504['campaign']=_0x3a6504[_0x1160('0x2')];return client[_0x1160('0x3')](_0x1160('0x4'),{'body':_0x3a6504,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
index afe9ae6..0016879 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e49=['GetCampaignHopperHistory','ivr','moment','createHistory','campaign','queue','CreateCmHopperHistory','avgHandleTime','Request','AvgHandleTime','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf','getCampaignHopperHistory'];(function(_0x4e8896,_0x179996){var _0x5e0140=function(_0x261ec1){while(--_0x261ec1){_0x4e8896['push'](_0x4e8896['shift']());}};_0x5e0140(++_0x179996);}(_0x6e49,0x192));var _0x96e4=function(_0xb419,_0x11ad8f){_0xb419=_0xb419-0x0;var _0xe096=_0x6e49[_0xb419];return _0xe096;};'use strict';var client=require('../client');var moment=require(_0x96e4('0x0'));exports[_0x96e4('0x1')]=function(_0x554653){return function(){_0x554653[_0x96e4('0x2')]=_0x554653[_0x96e4('0x3')];return client['Request'](_0x96e4('0x4'),{'body':_0x554653,'log':'CreateCmHopperHistory'});};};exports[_0x96e4('0x5')]=function(_0x3675b7){return function(){return client[_0x96e4('0x6')](_0x96e4('0x7'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x3675b7,_0x96e4('0x8'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x96e4('0x9')](_0x96e4('0xa'))]}},'raw':![]},'log':_0x96e4('0xb')});};};exports[_0x96e4('0xc')]=function(_0x1ca68a){return function(){return client[_0x96e4('0x6')](_0x96e4('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x96e4('0xe')](_0x96e4('0xf'))[_0x96e4('0x9')](_0x96e4('0xa')),moment()[_0x96e4('0x10')](_0x96e4('0xf'))['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x96e4('0x3')},'raw':![]},'log':_0x96e4('0xd')});};};exports[_0x96e4('0x11')]=function(_0x59c7ff){return function(){return client['Request'](_0x96e4('0x12'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x96e4('0xe')](_0x96e4('0xf'))[_0x96e4('0x9')](_0x96e4('0xa')),moment()['endOf'](_0x96e4('0xf'))[_0x96e4('0x9')](_0x96e4('0xa'))]},'campaigntype':_0x96e4('0x13')},'raw':![]},'log':_0x96e4('0x12')});};};
\ No newline at end of file
+var _0xd249=['GetVoiceQueueHopperHistory','endOf','day','GetCampaignHopperHistory','../client','moment','createHistory','campaign','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','subtract','minutes','YYYY-MM-DD\x20HH:mm:ss','format','GetCmHopperHistory','getVoiceQueueHopperHistory'];(function(_0x16590d,_0x45c524){var _0x462e1a=function(_0x25d700){while(--_0x25d700){_0x16590d['push'](_0x16590d['shift']());}};_0x462e1a(++_0x45c524);}(_0xd249,0x148));var _0x9d24=function(_0x528575,_0x2e067d){_0x528575=_0x528575-0x0;var _0x3063b7=_0xd249[_0x528575];return _0x3063b7;};'use strict';var client=require(_0x9d24('0x0'));var moment=require(_0x9d24('0x1'));exports[_0x9d24('0x2')]=function(_0x142558){return function(){_0x142558[_0x9d24('0x3')]=_0x142558['queue'];return client[_0x9d24('0x4')](_0x9d24('0x5'),{'body':_0x142558,'log':_0x9d24('0x5')});};};exports[_0x9d24('0x6')]=function(_0x5a43b1){return function(){return client['Request'](_0x9d24('0x7'),{'options':{'where':{'endtime':{'$between':[moment()[_0x9d24('0x8')](_0x5a43b1,_0x9d24('0x9'))['format'](_0x9d24('0xa')),moment()[_0x9d24('0xb')](_0x9d24('0xa'))]}},'raw':![]},'log':_0x9d24('0xc')});};};exports[_0x9d24('0xd')]=function(_0x12da01){return function(){return client[_0x9d24('0x4')](_0x9d24('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf']('day')['format'](_0x9d24('0xa')),moment()[_0x9d24('0xf')](_0x9d24('0x10'))[_0x9d24('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':'queue'},'raw':![]},'log':_0x9d24('0xe')});};};exports['getCampaignHopperHistory']=function(_0x174041){return function(){return client['Request']('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x9d24('0x10'))['format'](_0x9d24('0xa')),moment()[_0x9d24('0xf')](_0x9d24('0x10'))[_0x9d24('0xb')](_0x9d24('0xa'))]},'campaigntype':'ivr'},'raw':![]},'log':_0x9d24('0x11')});};};
\ No newline at end of file
index faf945e..7658ec0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a12=['NotifyFaxAccount','../client','getFaxAccounts','Request','GetFaxAccount','name','description','ecm','headerinfo','minrate','maxrate','modem','gateway','faxdetect','t38timeout','TrunkId','ListId','Trunk','callerid','active','getFaxAccount'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x7a12,0xe8));var _0x27a1=function(_0x4d8e42,_0x4e1c7c){_0x4d8e42=_0x4d8e42-0x0;var _0x4f6244=_0x7a12[_0x4d8e42];return _0x4f6244;};'use strict';var client=require(_0x27a1('0x0'));exports[_0x27a1('0x1')]=function(){return function(){return client[_0x27a1('0x2')](_0x27a1('0x3'),{'options':{'raw':![],'attributes':['id',_0x27a1('0x4'),_0x27a1('0x5'),_0x27a1('0x6'),_0x27a1('0x7'),'localstationid',_0x27a1('0x8'),_0x27a1('0x9'),_0x27a1('0xa'),_0x27a1('0xb'),_0x27a1('0xc'),_0x27a1('0xd'),'tech',_0x27a1('0xe'),_0x27a1('0xf'),'key'],'include':[{'model':_0x27a1('0x10'),'as':_0x27a1('0x10'),'attributes':['id','name',_0x27a1('0x11'),_0x27a1('0x12')]}]},'log':_0x27a1('0x13')});};};exports['notify']=function(_0x2cb05d,_0x455a8f){return client[_0x27a1('0x2')](_0x27a1('0x14'),{'account':{'id':_0x2cb05d},'body':_0x455a8f,'log':_0x27a1('0x14')});};
\ No newline at end of file
+var _0xa413=['Request','name','description','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','TrunkId','ListId','key','Trunk','getFaxAccount','NotifyFaxAccount','../client'];(function(_0x132d12,_0x2c9799){var _0x1c3163=function(_0x7d9136){while(--_0x7d9136){_0x132d12['push'](_0x132d12['shift']());}};_0x1c3163(++_0x2c9799);}(_0xa413,0x1e5));var _0x3a41=function(_0x31db1d,_0x2ef355){_0x31db1d=_0x31db1d-0x0;var _0x3400d2=_0xa413[_0x31db1d];return _0x3400d2;};'use strict';var client=require(_0x3a41('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0x3a41('0x1')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0x3a41('0x2'),_0x3a41('0x3'),'ecm','headerinfo',_0x3a41('0x4'),_0x3a41('0x5'),_0x3a41('0x6'),_0x3a41('0x7'),_0x3a41('0x8'),_0x3a41('0x9'),_0x3a41('0xa'),_0x3a41('0xb'),_0x3a41('0xc'),_0x3a41('0xd'),_0x3a41('0xe')],'include':[{'model':'Trunk','as':_0x3a41('0xf'),'attributes':['id','name','callerid','active']}]},'log':_0x3a41('0x10')});};};exports['notify']=function(_0x1554ab,_0x503009){return client[_0x3a41('0x1')](_0x3a41('0x11'),{'account':{'id':_0x1554ab},'body':_0x503009,'log':'NotifyFaxAccount'});};
\ No newline at end of file
index cef6e67..75170bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d36=['UpdateFaxMessage','update'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2d36,0x131));var _0x62d3=function(_0x4d3168,_0x3bc4d4){_0x4d3168=_0x4d3168-0x0;var _0x1c87dc=_0x2d36[_0x4d3168];return _0x1c87dc;};'use strict';var client=require('../client');exports[_0x62d3('0x0')]=function(_0x28e6f6,_0x11915c){return client['Request'](_0x62d3('0x1'),{'body':_0x11915c,'options':{'where':{'AttachmentId':_0x28e6f6}},'log':_0x62d3('0x1')});};
\ No newline at end of file
+var _0x4107=['Request','UpdateFaxMessage','../client'];(function(_0x3bc82d,_0x59187f){var _0x2cfb3d=function(_0x515ac3){while(--_0x515ac3){_0x3bc82d['push'](_0x3bc82d['shift']());}};_0x2cfb3d(++_0x59187f);}(_0x4107,0x1d3));var _0x7410=function(_0x9edfd5,_0x286486){_0x9edfd5=_0x9edfd5-0x0;var _0x330738=_0x4107[_0x9edfd5];return _0x330738;};'use strict';var client=require(_0x7410('0x0'));exports['update']=function(_0x5089d5,_0x32e0b2){return client[_0x7410('0x1')]('UpdateFaxMessage',{'body':_0x32e0b2,'options':{'where':{'AttachmentId':_0x5089d5}},'log':_0x7410('0x2')});};
\ No newline at end of file
index 6cc05d9..0cc9630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5565=['keyContent','Fields','nameField','customField','Tag','Tags','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','remoteUri','authType','DeskConfiguration','Configurations','DeskField','Subjects','type','variableName','Variable','Descriptions','content','key','keyType'];(function(_0x38d421,_0x1f1d2e){var _0x2c6a60=function(_0x4f9de6){while(--_0x4f9de6){_0x38d421['push'](_0x38d421['shift']());}};_0x2c6a60(++_0x1f1d2e);}(_0x5565,0x1da));var _0x5556=function(_0x450902,_0x3d6920){_0x450902=_0x450902-0x0;var _0x1a0f4a=_0x5565[_0x450902];return _0x1a0f4a;};'use strict';var client=require('../../client');exports[_0x5556('0x0')]=function(){return function(_0x21aa60){return client[_0x5556('0x1')](_0x5556('0x2'),{'options':{'raw':![],'attributes':['id',_0x5556('0x3'),_0x5556('0x4'),_0x5556('0x5'),_0x5556('0x6'),_0x5556('0x7'),_0x5556('0x8'),'type','serverUrl'],'include':[{'model':_0x5556('0x9'),'as':_0x5556('0xa'),'attributes':['id',_0x5556('0x3')],'include':[{'model':_0x5556('0xb'),'as':_0x5556('0xc'),'attributes':['id',_0x5556('0xd'),'content',_0x5556('0xe')],'include':[{'model':_0x5556('0xf'),'as':_0x5556('0xf'),'attributes':['id',_0x5556('0x3')]}]},{'model':_0x5556('0xb'),'as':_0x5556('0x10'),'attributes':['id',_0x5556('0xd'),_0x5556('0x11'),_0x5556('0x12'),_0x5556('0x13'),_0x5556('0x14'),_0x5556('0xe')],'include':[{'model':_0x5556('0xf'),'as':_0x5556('0xf'),'attributes':['id','name']}]},{'model':_0x5556('0xb'),'as':_0x5556('0x15'),'attributes':['id',_0x5556('0xd'),'content','idField',_0x5556('0x16'),_0x5556('0x17'),_0x5556('0xe')],'include':[{'model':_0x5556('0xf'),'as':_0x5556('0xf'),'attributes':['id','name']}]},{'model':_0x5556('0x18'),'as':_0x5556('0x19'),'attributes':['id',_0x5556('0x3')]}]}]},'log':_0x5556('0x2')});};};
\ No newline at end of file
+var _0xb0b4=['DeskField','type','content','variableName','Variable','Descriptions','keyType','nameField','Tag','Tags','../../client','getDeskAccounts','Request','GetDeskAccount','name','username','password','remoteUri','authType','serverUrl','DeskConfiguration','Configurations'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb0b4,0x196));var _0x4b0b=function(_0x3c3cf9,_0x1e27c5){_0x3c3cf9=_0x3c3cf9-0x0;var _0x39c1c7=_0xb0b4[_0x3c3cf9];return _0x39c1c7;};'use strict';var client=require(_0x4b0b('0x0'));exports[_0x4b0b('0x1')]=function(){return function(_0xcb81a8){return client[_0x4b0b('0x2')](_0x4b0b('0x3'),{'options':{'raw':![],'attributes':['id',_0x4b0b('0x4'),'description',_0x4b0b('0x5'),_0x4b0b('0x6'),_0x4b0b('0x7'),_0x4b0b('0x8'),'type',_0x4b0b('0x9')],'include':[{'model':_0x4b0b('0xa'),'as':_0x4b0b('0xb'),'attributes':['id',_0x4b0b('0x4')],'include':[{'model':_0x4b0b('0xc'),'as':'Subjects','attributes':['id',_0x4b0b('0xd'),_0x4b0b('0xe'),_0x4b0b('0xf')],'include':[{'model':_0x4b0b('0x10'),'as':_0x4b0b('0x10'),'attributes':['id',_0x4b0b('0x4')]}]},{'model':_0x4b0b('0xc'),'as':_0x4b0b('0x11'),'attributes':['id','type',_0x4b0b('0xe'),'key',_0x4b0b('0x12'),'keyContent',_0x4b0b('0xf')],'include':[{'model':_0x4b0b('0x10'),'as':_0x4b0b('0x10'),'attributes':['id',_0x4b0b('0x4')]}]},{'model':'DeskField','as':'Fields','attributes':['id',_0x4b0b('0xd'),'content','idField',_0x4b0b('0x13'),'customField',_0x4b0b('0xf')],'include':[{'model':_0x4b0b('0x10'),'as':'Variable','attributes':['id',_0x4b0b('0x4')]}]},{'model':_0x4b0b('0x14'),'as':_0x4b0b('0x15'),'attributes':['id','name']}]}]},'log':_0x4b0b('0x3')});};};
\ No newline at end of file
index b186620..51e77ae 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8625=['idField','nameField','customField','getDynamics365Accounts','GetDynamics365Account','name','username','remoteUri','clientSecret','serverUrl','description','Dynamics365Configuration','Configurations','ticketType','Dynamics365Field','type','Descriptions','content','key','variableName','Variable','Fields'];(function(_0x4dc213,_0x763386){var _0x183612=function(_0x3d7fb1){while(--_0x3d7fb1){_0x4dc213['push'](_0x4dc213['shift']());}};_0x183612(++_0x763386);}(_0x8625,0xb3));var _0x5862=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x8625[_0x56ba92];return _0x8fe94d;};'use strict';var client=require('../../client');exports[_0x5862('0x0')]=function(){return function(_0x2c7129){return client['Request'](_0x5862('0x1'),{'options':{'raw':![],'attributes':['id',_0x5862('0x2'),_0x5862('0x3'),'password',_0x5862('0x4'),'tenantId','clientId',_0x5862('0x5'),_0x5862('0x6'),_0x5862('0x7')],'include':[{'model':_0x5862('0x8'),'as':_0x5862('0x9'),'attributes':['id',_0x5862('0x2'),_0x5862('0xa')],'include':[{'model':_0x5862('0xb'),'as':'Subjects','attributes':['id',_0x5862('0xc'),'content','variableName'],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x5862('0x2')]}]},{'model':_0x5862('0xb'),'as':_0x5862('0xd'),'attributes':['id',_0x5862('0xc'),_0x5862('0xe'),_0x5862('0xf'),'keyType','keyContent',_0x5862('0x10')],'include':[{'model':_0x5862('0x11'),'as':_0x5862('0x11'),'attributes':['id',_0x5862('0x2')]}]},{'model':_0x5862('0xb'),'as':_0x5862('0x12'),'attributes':['id',_0x5862('0xc'),_0x5862('0xe'),_0x5862('0x13'),_0x5862('0x14'),_0x5862('0x15'),_0x5862('0x10')],'include':[{'model':_0x5862('0x11'),'as':'Variable','attributes':['id',_0x5862('0x2')]}]}]}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
+var _0x6bc8=['content','Variable','name','key','keyContent','Fields','idField','nameField','customField','variableName','../../client','Request','GetDynamics365Account','username','tenantId','clientId','clientSecret','serverUrl','description','Dynamics365Configuration','ticketType','Dynamics365Field','Subjects','type'];(function(_0x45bccd,_0x130e52){var _0x561467=function(_0xb653dc){while(--_0xb653dc){_0x45bccd['push'](_0x45bccd['shift']());}};_0x561467(++_0x130e52);}(_0x6bc8,0xe2));var _0x86bc=function(_0x4bfc23,_0x96e3e8){_0x4bfc23=_0x4bfc23-0x0;var _0x432382=_0x6bc8[_0x4bfc23];return _0x432382;};'use strict';var client=require(_0x86bc('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x2e428a){return client[_0x86bc('0x1')](_0x86bc('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x86bc('0x3'),'password','remoteUri',_0x86bc('0x4'),_0x86bc('0x5'),_0x86bc('0x6'),_0x86bc('0x7'),_0x86bc('0x8')],'include':[{'model':_0x86bc('0x9'),'as':'Configurations','attributes':['id','name',_0x86bc('0xa')],'include':[{'model':_0x86bc('0xb'),'as':_0x86bc('0xc'),'attributes':['id',_0x86bc('0xd'),_0x86bc('0xe'),'variableName'],'include':[{'model':'Variable','as':_0x86bc('0xf'),'attributes':['id',_0x86bc('0x10')]}]},{'model':_0x86bc('0xb'),'as':'Descriptions','attributes':['id','type',_0x86bc('0xe'),_0x86bc('0x11'),'keyType',_0x86bc('0x12'),'variableName'],'include':[{'model':_0x86bc('0xf'),'as':_0x86bc('0xf'),'attributes':['id',_0x86bc('0x10')]}]},{'model':_0x86bc('0xb'),'as':_0x86bc('0x13'),'attributes':['id',_0x86bc('0xd'),_0x86bc('0xe'),_0x86bc('0x14'),_0x86bc('0x15'),_0x86bc('0x16'),_0x86bc('0x17')],'include':[{'model':'Variable','as':_0x86bc('0xf'),'attributes':['id',_0x86bc('0x10')]}]}]}]},'log':_0x86bc('0x2')});};};
\ No newline at end of file
index e1dbf04..136fee3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2868=['GetFreshdeskAccount','../../client','Request','name','apiKey','serverUrl','FreshdeskConfiguration','Tag','FreshdeskField','type','content','variableName','Variable','key','keyType','keyContent','Fields','idField','nameField','customField'];(function(_0x162780,_0x47f2e2){var _0x1ea2dc=function(_0x123898){while(--_0x123898){_0x162780['push'](_0x162780['shift']());}};_0x1ea2dc(++_0x47f2e2);}(_0x2868,0x191));var _0x8286=function(_0xd5e4e8,_0x187c3a){_0xd5e4e8=_0xd5e4e8-0x0;var _0x514c6d=_0x2868[_0xd5e4e8];return _0x514c6d;};'use strict';var client=require(_0x8286('0x0'));exports['getFreshdeskAccounts']=function(){return function(_0x3153a7){return client[_0x8286('0x1')]('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id',_0x8286('0x2'),'username',_0x8286('0x3'),'remoteUri',_0x8286('0x4')],'include':[{'model':_0x8286('0x5'),'as':'Configurations','attributes':['id',_0x8286('0x2')],'include':[{'model':_0x8286('0x6'),'attributes':['id',_0x8286('0x2')]},{'model':_0x8286('0x7'),'as':'Subjects','attributes':['id',_0x8286('0x8'),_0x8286('0x9'),_0x8286('0xa')],'include':[{'model':_0x8286('0xb'),'as':_0x8286('0xb'),'attributes':['id',_0x8286('0x2')]}]},{'model':_0x8286('0x7'),'as':'Descriptions','attributes':['id',_0x8286('0x8'),_0x8286('0x9'),_0x8286('0xc'),_0x8286('0xd'),_0x8286('0xe'),_0x8286('0xa')],'include':[{'model':_0x8286('0xb'),'as':_0x8286('0xb'),'attributes':['id',_0x8286('0x2')]}]},{'model':'FreshdeskField','as':_0x8286('0xf'),'attributes':['id',_0x8286('0x8'),_0x8286('0x9'),_0x8286('0x10'),_0x8286('0x11'),_0x8286('0x12'),'variableName'],'include':[{'model':'Variable','as':_0x8286('0xb'),'attributes':['id',_0x8286('0x2')]}]}]}]},'log':_0x8286('0x13')});};};
\ No newline at end of file
+var _0x390a=['keyContent','nameField','GetFreshdeskAccount','../../client','getFreshdeskAccounts','Request','name','username','apiKey','remoteUri','FreshdeskConfiguration','Configurations','FreshdeskField','content','variableName','Variable','type','key'];(function(_0x523212,_0x5968ca){var _0x2c3239=function(_0x24f0fa){while(--_0x24f0fa){_0x523212['push'](_0x523212['shift']());}};_0x2c3239(++_0x5968ca);}(_0x390a,0xc9));var _0xa390=function(_0x394354,_0x14660c){_0x394354=_0x394354-0x0;var _0x459cb4=_0x390a[_0x394354];return _0x459cb4;};'use strict';var client=require(_0xa390('0x0'));exports[_0xa390('0x1')]=function(){return function(_0xde985e){return client[_0xa390('0x2')]('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id',_0xa390('0x3'),_0xa390('0x4'),_0xa390('0x5'),_0xa390('0x6'),'serverUrl'],'include':[{'model':_0xa390('0x7'),'as':_0xa390('0x8'),'attributes':['id',_0xa390('0x3')],'include':[{'model':'Tag','attributes':['id',_0xa390('0x3')]},{'model':_0xa390('0x9'),'as':'Subjects','attributes':['id','type',_0xa390('0xa'),_0xa390('0xb')],'include':[{'model':_0xa390('0xc'),'as':_0xa390('0xc'),'attributes':['id',_0xa390('0x3')]}]},{'model':'FreshdeskField','as':'Descriptions','attributes':['id',_0xa390('0xd'),_0xa390('0xa'),_0xa390('0xe'),'keyType',_0xa390('0xf'),_0xa390('0xb')],'include':[{'model':'Variable','as':_0xa390('0xc'),'attributes':['id',_0xa390('0x3')]}]},{'model':'FreshdeskField','as':'Fields','attributes':['id',_0xa390('0xd'),_0xa390('0xa'),'idField',_0xa390('0x10'),'customField','variableName'],'include':[{'model':'Variable','as':_0xa390('0xc'),'attributes':['id','name']}]}]}]},'log':_0xa390('0x11')});};};
\ No newline at end of file
index f3f907d..0a91726 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6363=['Request','GetFreshsalesAccount','name','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','variableName','Variable','Descriptions','content','key','keyType','keyContent','GetFreshsalesccount','../../client'];(function(_0x243780,_0x340a34){var _0x1fe2dd=function(_0x10d0f4){while(--_0x10d0f4){_0x243780['push'](_0x243780['shift']());}};_0x1fe2dd(++_0x340a34);}(_0x6363,0x13a));var _0x3636=function(_0x2b9716,_0x137ade){_0x2b9716=_0x2b9716-0x0;var _0x2b2bc4=_0x6363[_0x2b9716];return _0x2b2bc4;};'use strict';var client=require(_0x3636('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x225b8a){return client[_0x3636('0x1')](_0x3636('0x2'),{'options':{'raw':![],'attributes':['id',_0x3636('0x3'),_0x3636('0x4'),_0x3636('0x5'),_0x3636('0x6'),_0x3636('0x7')],'include':[{'model':_0x3636('0x8'),'as':_0x3636('0x9'),'attributes':['id',_0x3636('0x3')],'include':[{'model':_0x3636('0xa'),'as':_0x3636('0xb'),'attributes':['id',_0x3636('0xc'),'content',_0x3636('0xd')],'include':[{'model':'Variable','as':_0x3636('0xe'),'attributes':['id',_0x3636('0x3')]}]},{'model':_0x3636('0xa'),'as':_0x3636('0xf'),'attributes':['id',_0x3636('0xc'),_0x3636('0x10'),_0x3636('0x11'),_0x3636('0x12'),_0x3636('0x13'),'variableName'],'include':[{'model':'Variable','as':_0x3636('0xe'),'attributes':['id','name']}]}]}]},'log':_0x3636('0x14')});};};
\ No newline at end of file
+var _0x7ee1=['Subjects','content','Variable','keyType','keyContent','variableName','../../client','GetFreshsalesAccount','name','username','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0x7ee1,0x8d));var _0x17ee=function(_0x180217,_0x25675d){_0x180217=_0x180217-0x0;var _0x41644e=_0x7ee1[_0x180217];return _0x41644e;};'use strict';var client=require(_0x17ee('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x534bb6){return client['Request'](_0x17ee('0x1'),{'options':{'raw':![],'attributes':['id',_0x17ee('0x2'),_0x17ee('0x3'),'apiKey',_0x17ee('0x4'),_0x17ee('0x5')],'include':[{'model':_0x17ee('0x6'),'as':_0x17ee('0x7'),'attributes':['id','name'],'include':[{'model':_0x17ee('0x8'),'as':_0x17ee('0x9'),'attributes':['id','type',_0x17ee('0xa'),'variableName'],'include':[{'model':_0x17ee('0xb'),'as':_0x17ee('0xb'),'attributes':['id',_0x17ee('0x2')]}]},{'model':'FreshsalesField','as':'Descriptions','attributes':['id','type',_0x17ee('0xa'),'key',_0x17ee('0xc'),_0x17ee('0xd'),_0x17ee('0xe')],'include':[{'model':_0x17ee('0xb'),'as':'Variable','attributes':['id',_0x17ee('0x2')]}]}]}]},'log':'GetFreshsalesccount'});};};
\ No newline at end of file
index 72d0cc2..07c943c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5dfe=['Fields','getSalesforceAccounts','Request','GetSalesforceAccount','name','password','clientId','securityToken','serverUrl','type','SalesforceConfiguration','Configurations','moduleCreate','ticketType','leadId','additionalSearchAccount','SalesforceField','Variable'];(function(_0xef8146,_0x459c34){var _0x5a6cb0=function(_0x2f84ec){while(--_0x2f84ec){_0xef8146['push'](_0xef8146['shift']());}};_0x5a6cb0(++_0x459c34);}(_0x5dfe,0x1c3));var _0xe5df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5dfe[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../../client');exports[_0xe5df('0x0')]=function(){return function(_0x831867){return client[_0xe5df('0x1')](_0xe5df('0x2'),{'options':{'raw':![],'attributes':['id',_0xe5df('0x3'),'username',_0xe5df('0x4'),'remoteUri',_0xe5df('0x5'),'clientSecret',_0xe5df('0x6'),_0xe5df('0x7'),_0xe5df('0x8')],'include':[{'model':_0xe5df('0x9'),'as':_0xe5df('0xa'),'attributes':['id',_0xe5df('0x3'),'moduleSearch',_0xe5df('0xb'),_0xe5df('0xc'),_0xe5df('0xd'),_0xe5df('0xe'),'additionalSearchContact','additionalSearchLead'],'include':[{'model':_0xe5df('0xf'),'as':'Subjects','include':[{'model':_0xe5df('0x10'),'as':_0xe5df('0x10'),'attributes':['id',_0xe5df('0x3')]}]},{'model':_0xe5df('0xf'),'as':'Descriptions','include':[{'model':_0xe5df('0x10'),'as':_0xe5df('0x10'),'attributes':['id',_0xe5df('0x3')]}]},{'model':_0xe5df('0xf'),'as':_0xe5df('0x11'),'include':[{'model':_0xe5df('0x10'),'as':_0xe5df('0x10'),'attributes':['id',_0xe5df('0x3')]}]}]}]},'log':_0xe5df('0x2')});};};
\ No newline at end of file
+var _0x8307=['additionalSearchContact','SalesforceField','Variable','Descriptions','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','password','remoteUri','securityToken','type','moduleCreate','ticketType','additionalSearchAccount'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x8307,0xc4));var _0x7830=function(_0x42d474,_0x5a7a68){_0x42d474=_0x42d474-0x0;var _0x133886=_0x8307[_0x42d474];return _0x133886;};'use strict';var client=require(_0x7830('0x0'));exports[_0x7830('0x1')]=function(){return function(_0x4ca359){return client[_0x7830('0x2')](_0x7830('0x3'),{'options':{'raw':![],'attributes':['id',_0x7830('0x4'),'username',_0x7830('0x5'),_0x7830('0x6'),'clientId','clientSecret',_0x7830('0x7'),'serverUrl',_0x7830('0x8')],'include':[{'model':'SalesforceConfiguration','as':'Configurations','attributes':['id',_0x7830('0x4'),'moduleSearch',_0x7830('0x9'),_0x7830('0xa'),'leadId',_0x7830('0xb'),_0x7830('0xc'),'additionalSearchLead'],'include':[{'model':_0x7830('0xd'),'as':'Subjects','include':[{'model':'Variable','as':_0x7830('0xe'),'attributes':['id',_0x7830('0x4')]}]},{'model':_0x7830('0xd'),'as':_0x7830('0xf'),'include':[{'model':_0x7830('0xe'),'as':_0x7830('0xe'),'attributes':['id',_0x7830('0x4')]}]},{'model':_0x7830('0xd'),'as':'Fields','include':[{'model':_0x7830('0xe'),'as':_0x7830('0xe'),'attributes':['id',_0x7830('0x4')]}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
index bfa5ddd..8cef061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['type','variableName','Variable','Descriptions','content','key','keyContent','Fields','nameField','customField','GetServicenowkAccount','getServicenowAccounts','GetServicenowAccount','name','description','username','password','remoteUri','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects'];(function(_0x3f2a90,_0x50baf1){var _0xb46279=function(_0x5e47b5){while(--_0x5e47b5){_0x3f2a90['push'](_0x3f2a90['shift']());}};_0xb46279(++_0x50baf1);}(_0x57ca,0x108));var _0xa57c=function(_0x305479,_0x545a76){_0x305479=_0x305479-0x0;var _0x21c168=_0x57ca[_0x305479];return _0x21c168;};'use strict';var client=require('../../client');exports[_0xa57c('0x0')]=function(){return function(_0x4ad696){return client['Request'](_0xa57c('0x1'),{'options':{'raw':![],'attributes':['id',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),'email',_0xa57c('0x6'),_0xa57c('0x7')],'include':[{'model':_0xa57c('0x8'),'as':_0xa57c('0x9'),'attributes':['id',_0xa57c('0x2')],'include':[{'model':_0xa57c('0xa'),'as':_0xa57c('0xb'),'attributes':['id',_0xa57c('0xc'),'content',_0xa57c('0xd')],'include':[{'model':'Variable','as':_0xa57c('0xe'),'attributes':['id',_0xa57c('0x2')]}]},{'model':'ServicenowField','as':_0xa57c('0xf'),'attributes':['id','type',_0xa57c('0x10'),_0xa57c('0x11'),'keyType',_0xa57c('0x12'),'variableName'],'include':[{'model':_0xa57c('0xe'),'as':_0xa57c('0xe'),'attributes':['id',_0xa57c('0x2')]}]},{'model':_0xa57c('0xa'),'as':_0xa57c('0x13'),'attributes':['id','type',_0xa57c('0x10'),'idField',_0xa57c('0x14'),_0xa57c('0x15'),_0xa57c('0xd')],'include':[{'model':_0xa57c('0xe'),'as':_0xa57c('0xe'),'attributes':['id',_0xa57c('0x2')]}]}]}]},'log':_0xa57c('0x16')});};};
\ No newline at end of file
+var _0x5fab=['../../client','getServicenowAccounts','Request','GetServicenowAccount','name','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','ServicenowField','Subjects','type','variableName','Variable','Descriptions','content','key','keyType','keyContent','Fields','nameField','customField'];(function(_0x5e1236,_0x5d5408){var _0xdd2411=function(_0x5f5526){while(--_0x5f5526){_0x5e1236['push'](_0x5e1236['shift']());}};_0xdd2411(++_0x5d5408);}(_0x5fab,0x177));var _0xb5fa=function(_0x1a48f2,_0x5d2109){_0x1a48f2=_0x1a48f2-0x0;var _0x2b46c6=_0x5fab[_0x1a48f2];return _0x2b46c6;};'use strict';var client=require(_0xb5fa('0x0'));exports[_0xb5fa('0x1')]=function(){return function(_0x4c67f9){return client[_0xb5fa('0x2')](_0xb5fa('0x3'),{'options':{'raw':![],'attributes':['id',_0xb5fa('0x4'),_0xb5fa('0x5'),_0xb5fa('0x6'),_0xb5fa('0x7'),_0xb5fa('0x8'),_0xb5fa('0x9'),_0xb5fa('0xa')],'include':[{'model':_0xb5fa('0xb'),'as':'Configurations','attributes':['id','name'],'include':[{'model':_0xb5fa('0xc'),'as':_0xb5fa('0xd'),'attributes':['id',_0xb5fa('0xe'),'content',_0xb5fa('0xf')],'include':[{'model':_0xb5fa('0x10'),'as':_0xb5fa('0x10'),'attributes':['id','name']}]},{'model':'ServicenowField','as':_0xb5fa('0x11'),'attributes':['id',_0xb5fa('0xe'),_0xb5fa('0x12'),_0xb5fa('0x13'),_0xb5fa('0x14'),_0xb5fa('0x15'),_0xb5fa('0xf')],'include':[{'model':_0xb5fa('0x10'),'as':_0xb5fa('0x10'),'attributes':['id','name']}]},{'model':_0xb5fa('0xc'),'as':_0xb5fa('0x16'),'attributes':['id','type',_0xb5fa('0x12'),'idField',_0xb5fa('0x17'),_0xb5fa('0x18'),_0xb5fa('0xf')],'include':[{'model':_0xb5fa('0x10'),'as':_0xb5fa('0x10'),'attributes':['id','name']}]}]}]},'log':'GetServicenowkAccount'});};};
\ No newline at end of file
index c0f3f18..3fa5a24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda2d=['Subjects','type','content','variableName','Variable','key','keyType','keyContent','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0xda2d,0x102));var _0xdda2=function(_0x46c6fe,_0x5a47a0){_0x46c6fe=_0x46c6fe-0x0;var _0x108603=_0xda2d[_0x46c6fe];return _0x108603;};'use strict';var client=require('../../client');exports[_0xdda2('0x0')]=function(){return function(_0x35f029){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'options':{'raw':![],'attributes':['id',_0xdda2('0x3'),'username','password','remoteUri',_0xdda2('0x4')],'include':[{'model':_0xdda2('0x5'),'as':_0xdda2('0x6'),'attributes':['id',_0xdda2('0x3')],'include':[{'model':_0xdda2('0x7'),'as':_0xdda2('0x8'),'attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]},{'model':_0xdda2('0x7'),'as':'Descriptions','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xd'),_0xdda2('0xe'),_0xdda2('0xf'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':_0xdda2('0xc'),'attributes':['id','name']}]},{'model':'SugarcrmField','as':'Fields','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0x10'),_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]}]}]},'log':'GetSugarcrmAccount'});};};
\ No newline at end of file
+var _0x0295=['remoteUri','serverUrl','SugarcrmConfiguration','Configurations','name','SugarcrmField','Subjects','Variable','Descriptions','content','key','keyType','variableName','Fields','customField','GetSugarcrmAccount','../../client','Request','username','password'];(function(_0x11eeda,_0x4a266f){var _0x385c89=function(_0x1a1ab1){while(--_0x1a1ab1){_0x11eeda['push'](_0x11eeda['shift']());}};_0x385c89(++_0x4a266f);}(_0x0295,0x1f0));var _0x5029=function(_0x5807d4,_0x29306b){_0x5807d4=_0x5807d4-0x0;var _0x5ddf9b=_0x0295[_0x5807d4];return _0x5ddf9b;};'use strict';var client=require(_0x5029('0x0'));exports['getSugarcrmAccounts']=function(){return function(_0x5e71d0){return client[_0x5029('0x1')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id','name',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5')],'include':[{'model':_0x5029('0x6'),'as':_0x5029('0x7'),'attributes':['id',_0x5029('0x8')],'include':[{'model':_0x5029('0x9'),'as':_0x5029('0xa'),'attributes':['id','type','content','variableName'],'include':[{'model':_0x5029('0xb'),'as':'Variable','attributes':['id',_0x5029('0x8')]}]},{'model':'SugarcrmField','as':_0x5029('0xc'),'attributes':['id','type',_0x5029('0xd'),_0x5029('0xe'),_0x5029('0xf'),'keyContent',_0x5029('0x10')],'include':[{'model':_0x5029('0xb'),'as':_0x5029('0xb'),'attributes':['id','name']}]},{'model':_0x5029('0x9'),'as':_0x5029('0x11'),'attributes':['id','type','content','idField','nameField',_0x5029('0x12'),_0x5029('0x10')],'include':[{'model':_0x5029('0xb'),'as':_0x5029('0xb'),'attributes':['id',_0x5029('0x8')]}]}]}]},'log':_0x5029('0x13')});};};
\ No newline at end of file
index 380d849..061f843 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde05=['name','username','VtigerConfiguration','Configurations','VtigerField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','Fields','nameField','customField','getVtigerAccounts','GetVtigerAccount'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xde05,0x19c));var _0x5de0=function(_0x5af189,_0xba4b26){_0x5af189=_0x5af189-0x0;var _0x228393=_0xde05[_0x5af189];return _0x228393;};'use strict';var client=require('../../client');exports[_0x5de0('0x0')]=function(){return function(_0x5cfd46){return client['Request'](_0x5de0('0x1'),{'options':{'raw':![],'attributes':['id',_0x5de0('0x2'),'description',_0x5de0('0x3'),'accessKey','remoteUri','serverUrl'],'include':[{'model':_0x5de0('0x4'),'as':_0x5de0('0x5'),'attributes':['id','name'],'include':[{'model':_0x5de0('0x6'),'as':_0x5de0('0x7'),'attributes':['id',_0x5de0('0x8'),_0x5de0('0x9'),_0x5de0('0xa')],'include':[{'model':_0x5de0('0xb'),'as':_0x5de0('0xb'),'attributes':['id',_0x5de0('0x2')]}]},{'model':_0x5de0('0x6'),'as':_0x5de0('0xc'),'attributes':['id',_0x5de0('0x8'),_0x5de0('0x9'),_0x5de0('0xd'),_0x5de0('0xe'),'keyContent',_0x5de0('0xa')],'include':[{'model':'Variable','as':_0x5de0('0xb'),'attributes':['id','name']}]},{'model':'VtigerField','as':_0x5de0('0xf'),'attributes':['id',_0x5de0('0x8'),'content','idField',_0x5de0('0x10'),_0x5de0('0x11'),_0x5de0('0xa')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]}]}]},'log':_0x5de0('0x1')});};};
\ No newline at end of file
+var _0x069f=['Fields','idField','customField','../../client','GetVtigerAccount','name','description','accessKey','remoteUri','serverUrl','VtigerConfiguration','Configurations','VtigerField','type','content','variableName','Descriptions','keyType','keyContent','Variable'];(function(_0xe51964,_0x433b90){var _0x2c2366=function(_0x1bc95c){while(--_0x1bc95c){_0xe51964['push'](_0xe51964['shift']());}};_0x2c2366(++_0x433b90);}(_0x069f,0x143));var _0xf069=function(_0x48e6c1,_0x2c5211){_0x48e6c1=_0x48e6c1-0x0;var _0x1521e2=_0x069f[_0x48e6c1];return _0x1521e2;};'use strict';var client=require(_0xf069('0x0'));exports['getVtigerAccounts']=function(){return function(_0x12e257){return client['Request'](_0xf069('0x1'),{'options':{'raw':![],'attributes':['id',_0xf069('0x2'),_0xf069('0x3'),'username',_0xf069('0x4'),_0xf069('0x5'),_0xf069('0x6')],'include':[{'model':_0xf069('0x7'),'as':_0xf069('0x8'),'attributes':['id',_0xf069('0x2')],'include':[{'model':_0xf069('0x9'),'as':'Subjects','attributes':['id',_0xf069('0xa'),_0xf069('0xb'),_0xf069('0xc')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xf069('0x2')]}]},{'model':_0xf069('0x9'),'as':_0xf069('0xd'),'attributes':['id','type',_0xf069('0xb'),'key',_0xf069('0xe'),_0xf069('0xf'),'variableName'],'include':[{'model':_0xf069('0x10'),'as':_0xf069('0x10'),'attributes':['id','name']}]},{'model':_0xf069('0x9'),'as':_0xf069('0x11'),'attributes':['id',_0xf069('0xa'),_0xf069('0xb'),_0xf069('0x12'),'nameField',_0xf069('0x13'),_0xf069('0xc')],'include':[{'model':_0xf069('0x10'),'as':_0xf069('0x10'),'attributes':['id','name']}]}]}]},'log':_0xf069('0x1')});};};
\ No newline at end of file
index 297881a..9ce6bb6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ddd=['getZendeskAccounts','GetZendeskAccount','name','password','token','remoteUri','authType','ZendeskConfiguration','Configurations','Tag','ZendeskField','Subjects','type','content','variableName','Variable','Descriptions','key','keyContent','Fields','idField','nameField','customField','../../client'];(function(_0x5acc34,_0x51ab5f){var _0x1790c7=function(_0x53f290){while(--_0x53f290){_0x5acc34['push'](_0x5acc34['shift']());}};_0x1790c7(++_0x51ab5f);}(_0x8ddd,0x11f));var _0xd8dd=function(_0x2199d8,_0x240baa){_0x2199d8=_0x2199d8-0x0;var _0x2f1e0b=_0x8ddd[_0x2199d8];return _0x2f1e0b;};'use strict';var client=require(_0xd8dd('0x0'));exports[_0xd8dd('0x1')]=function(){return function(_0x571439){return client['Request'](_0xd8dd('0x2'),{'options':{'raw':![],'attributes':['id',_0xd8dd('0x3'),'username',_0xd8dd('0x4'),_0xd8dd('0x5'),_0xd8dd('0x6'),_0xd8dd('0x7'),'serverUrl','type'],'include':[{'model':_0xd8dd('0x8'),'as':_0xd8dd('0x9'),'attributes':['id',_0xd8dd('0x3')],'include':[{'model':_0xd8dd('0xa'),'attributes':['id',_0xd8dd('0x3')]},{'model':_0xd8dd('0xb'),'as':_0xd8dd('0xc'),'attributes':['id',_0xd8dd('0xd'),_0xd8dd('0xe'),_0xd8dd('0xf')],'include':[{'model':_0xd8dd('0x10'),'as':'Variable','attributes':['id',_0xd8dd('0x3')]}]},{'model':_0xd8dd('0xb'),'as':_0xd8dd('0x11'),'attributes':['id',_0xd8dd('0xd'),_0xd8dd('0xe'),_0xd8dd('0x12'),'keyType',_0xd8dd('0x13'),'variableName'],'include':[{'model':_0xd8dd('0x10'),'as':_0xd8dd('0x10'),'attributes':['id',_0xd8dd('0x3')]}]},{'model':_0xd8dd('0xb'),'as':_0xd8dd('0x14'),'attributes':['id',_0xd8dd('0xd'),_0xd8dd('0xe'),_0xd8dd('0x15'),_0xd8dd('0x16'),_0xd8dd('0x17'),_0xd8dd('0xf')],'include':[{'model':_0xd8dd('0x10'),'as':_0xd8dd('0x10'),'attributes':['id',_0xd8dd('0x3')]}]}]}]},'log':_0xd8dd('0x2')});};};
\ No newline at end of file
+var _0x4299=['ZendeskField','type','content','Variable','Descriptions','key','keyType','keyContent','variableName','Fields','idField','nameField','customField','getZendeskAccounts','GetZendeskAccount','name','token','authType','serverUrl','Configurations','Tag'];(function(_0x2dfa13,_0x49c6d3){var _0x4ca649=function(_0x3db50c){while(--_0x3db50c){_0x2dfa13['push'](_0x2dfa13['shift']());}};_0x4ca649(++_0x49c6d3);}(_0x4299,0x1f0));var _0x9429=function(_0x276ac1,_0x245b1e){_0x276ac1=_0x276ac1-0x0;var _0x28b3d1=_0x4299[_0x276ac1];return _0x28b3d1;};'use strict';var client=require('../../client');exports[_0x9429('0x0')]=function(){return function(_0x469aec){return client['Request'](_0x9429('0x1'),{'options':{'raw':![],'attributes':['id',_0x9429('0x2'),'username','password',_0x9429('0x3'),'remoteUri',_0x9429('0x4'),_0x9429('0x5'),'type'],'include':[{'model':'ZendeskConfiguration','as':_0x9429('0x6'),'attributes':['id',_0x9429('0x2')],'include':[{'model':_0x9429('0x7'),'attributes':['id',_0x9429('0x2')]},{'model':_0x9429('0x8'),'as':'Subjects','attributes':['id',_0x9429('0x9'),_0x9429('0xa'),'variableName'],'include':[{'model':'Variable','as':_0x9429('0xb'),'attributes':['id','name']}]},{'model':_0x9429('0x8'),'as':_0x9429('0xc'),'attributes':['id',_0x9429('0x9'),_0x9429('0xa'),_0x9429('0xd'),_0x9429('0xe'),_0x9429('0xf'),_0x9429('0x10')],'include':[{'model':_0x9429('0xb'),'as':_0x9429('0xb'),'attributes':['id',_0x9429('0x2')]}]},{'model':_0x9429('0x8'),'as':_0x9429('0x11'),'attributes':['id','type',_0x9429('0xa'),_0x9429('0x12'),_0x9429('0x13'),_0x9429('0x14'),_0x9429('0x10')],'include':[{'model':_0x9429('0xb'),'as':_0x9429('0xb'),'attributes':['id',_0x9429('0x2')]}]}]}]},'log':_0x9429('0x1')});};};
\ No newline at end of file
index 403add5..e6ac19a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd960=['idField','nameField','variableName','../../client','getZohoAccounts','Request','GetZohoAccount','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleSearch','ZohoField','Subjects','type','content','Variable','key','keyType','keyContent','Fields'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xd960,0x1df));var _0x0d96=function(_0x3350f2,_0x462bfe){_0x3350f2=_0x3350f2-0x0;var _0x3e92b0=_0xd960[_0x3350f2];return _0x3e92b0;};'use strict';var client=require(_0x0d96('0x0'));exports[_0x0d96('0x1')]=function(){return function(_0x4119db){return client[_0x0d96('0x2')](_0x0d96('0x3'),{'options':{'raw':![],'attributes':['id',_0x0d96('0x4'),_0x0d96('0x5'),_0x0d96('0x6'),_0x0d96('0x7'),_0x0d96('0x8'),_0x0d96('0x9'),_0x0d96('0xa'),_0x0d96('0xb'),_0x0d96('0xc')],'include':[{'model':_0x0d96('0xd'),'as':_0x0d96('0xe'),'attributes':['id','name','moduleCreate',_0x0d96('0xf'),_0x0d96('0x5')],'include':[{'model':_0x0d96('0x10'),'as':_0x0d96('0x11'),'attributes':['id',_0x0d96('0x12'),_0x0d96('0x13'),'variableName'],'include':[{'model':'Variable','as':_0x0d96('0x14'),'attributes':['id',_0x0d96('0x4')]}]},{'model':_0x0d96('0x10'),'as':'Descriptions','attributes':['id','type','content',_0x0d96('0x15'),_0x0d96('0x16'),_0x0d96('0x17'),'variableName'],'include':[{'model':_0x0d96('0x14'),'as':'Variable','attributes':['id','name']}]},{'model':_0x0d96('0x10'),'as':_0x0d96('0x18'),'attributes':['id',_0x0d96('0x12'),_0x0d96('0x13'),_0x0d96('0x19'),_0x0d96('0x1a'),'customField',_0x0d96('0x1b')],'include':[{'model':_0x0d96('0x14'),'as':'Variable','attributes':['id',_0x0d96('0x4')]}]}]}]},'log':_0x0d96('0x3')});};};
\ No newline at end of file
+var _0xfbab=['name','host','zone','code','refreshToken','ZohoConfiguration','moduleCreate','moduleSearch','description','ZohoField','Subjects','type','content','Variable','Descriptions','keyType','variableName','idField','nameField','customField','getZohoAccounts','Request','GetZohoAccount'];(function(_0x5a5aec,_0x4ad7f8){var _0x4fe293=function(_0x18ae46){while(--_0x18ae46){_0x5a5aec['push'](_0x5a5aec['shift']());}};_0x4fe293(++_0x4ad7f8);}(_0xfbab,0x16d));var _0xbfba=function(_0x586d8e,_0x30305c){_0x586d8e=_0x586d8e-0x0;var _0x5d4c9e=_0xfbab[_0x586d8e];return _0x5d4c9e;};'use strict';var client=require('../../client');exports[_0xbfba('0x0')]=function(){return function(_0x5e0177){return client[_0xbfba('0x1')](_0xbfba('0x2'),{'options':{'raw':![],'attributes':['id',_0xbfba('0x3'),'description',_0xbfba('0x4'),_0xbfba('0x5'),'clientId','clientSecret','serverUrl',_0xbfba('0x6'),_0xbfba('0x7')],'include':[{'model':_0xbfba('0x8'),'as':'Configurations','attributes':['id',_0xbfba('0x3'),_0xbfba('0x9'),_0xbfba('0xa'),_0xbfba('0xb')],'include':[{'model':_0xbfba('0xc'),'as':_0xbfba('0xd'),'attributes':['id',_0xbfba('0xe'),_0xbfba('0xf'),'variableName'],'include':[{'model':_0xbfba('0x10'),'as':_0xbfba('0x10'),'attributes':['id',_0xbfba('0x3')]}]},{'model':_0xbfba('0xc'),'as':_0xbfba('0x11'),'attributes':['id',_0xbfba('0xe'),'content','key',_0xbfba('0x12'),'keyContent',_0xbfba('0x13')],'include':[{'model':'Variable','as':_0xbfba('0x10'),'attributes':['id',_0xbfba('0x3')]}]},{'model':_0xbfba('0xc'),'as':'Fields','attributes':['id',_0xbfba('0xe'),_0xbfba('0xf'),_0xbfba('0x14'),_0xbfba('0x15'),_0xbfba('0x16'),_0xbfba('0x13')],'include':[{'model':_0xbfba('0x10'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0xbfba('0x2')});};};
\ No newline at end of file
index 71288c5..d0a0126 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9b5=['toNumber','moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','voice','lastAssignedTo','isNil','format','interface','TALKING','queuecallerleaveAt','diff','seconds','calleridnum','exten','queue','accountcode','CreateMemberReport','Request','membername','starttime','endtime','outbound','dialstring','agent'];(function(_0x31aa38,_0x941a78){var _0x18d49b=function(_0x29c3bf){while(--_0x29c3bf){_0x31aa38['push'](_0x31aa38['shift']());}};_0x18d49b(++_0x941a78);}(_0xc9b5,0x119));var _0x5c9b=function(_0x4be613,_0x422184){_0x4be613=_0x4be613-0x0;var _0x56f2ba=_0xc9b5[_0x4be613];return _0x56f2ba;};'use strict';var moment=require(_0x5c9b('0x0'));var _=require('lodash');var util=require(_0x5c9b('0x1'));var client=require(_0x5c9b('0x2'));exports[_0x5c9b('0x3')]=function(_0x5940d8){var _0x4308f1=_0x5940d8[_0x5c9b('0x4')]||_0x5940d8[_0x5c9b('0x5')];return client['Request']('CreateMemberReport',{'body':{'channel':_0x5c9b('0x6'),'membername':_0x5940d8[_0x5c9b('0x7')],'interface':_[_0x5c9b('0x8')](_0x5940d8['interface'])?util[_0x5c9b('0x9')]('SIP/%s',_0x5940d8[_0x5c9b('0x7')]):_0x5940d8[_0x5c9b('0xa')],'type':_0x5c9b('0xb'),'enterAt':_0x5940d8[_0x5c9b('0xc')],'exitAt':_0x4308f1,'duration':moment(_0x4308f1)[_0x5c9b('0xd')](_0x5940d8[_0x5c9b('0xc')],_0x5c9b('0xe')),'data1':'inbound','data2':_0x5940d8[_0x5c9b('0xf')],'data3':_0x5940d8[_0x5c9b('0x10')],'data4':null,'data5':_0x5940d8[_0x5c9b('0x11')],'role':'agent','internal':_0x5940d8['accountcode']?_['toNumber'](_0x5940d8[_0x5c9b('0x12')]):undefined,'uniqueid':_0x5940d8['uniqueid']},'log':_0x5c9b('0x13')});};exports['voiceDialReport']=function(_0x15114d){return client[_0x5c9b('0x14')](_0x5c9b('0x13'),{'body':{'channel':'voice','membername':_0x15114d[_0x5c9b('0x15')],'interface':_0x15114d[_0x5c9b('0xa')],'type':'TALKING','enterAt':_0x15114d[_0x5c9b('0x16')],'exitAt':_0x15114d[_0x5c9b('0x17')],'duration':moment(_0x15114d[_0x5c9b('0x17')])[_0x5c9b('0xd')](_0x15114d[_0x5c9b('0x16')],_0x5c9b('0xe'))>=0x0?moment(_0x15114d[_0x5c9b('0x17')])[_0x5c9b('0xd')](_0x15114d[_0x5c9b('0x16')],'seconds'):null,'data1':_0x5c9b('0x18'),'data2':_0x15114d[_0x5c9b('0x12')],'data3':_0x15114d[_0x5c9b('0x10')],'data4':_0x15114d[_0x5c9b('0x19')]||null,'role':_0x5c9b('0x1a'),'internal':_0x15114d[_0x5c9b('0x12')]?_[_0x5c9b('0x1b')](_0x15114d[_0x5c9b('0x12')]):undefined,'uniqueid':_0x15114d['uniqueid']},'log':_0x5c9b('0x13')});};
\ No newline at end of file
+var _0x2a86=['queuecallerleaveAt','diff','seconds','inbound','calleridnum','queue','accountcode','toNumber','uniqueid','voiceDialReport','membername','starttime','endtime','outbound','dialstring','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','voice','isNil','interface','format','SIP/%s','lastAssignedTo','TALKING'];(function(_0x325973,_0x1f8bb2){var _0x582b12=function(_0x7031aa){while(--_0x7031aa){_0x325973['push'](_0x325973['shift']());}};_0x582b12(++_0x1f8bb2);}(_0x2a86,0x1df));var _0x62a8=function(_0x3bd100,_0x141936){_0x3bd100=_0x3bd100-0x0;var _0x28c3ae=_0x2a86[_0x3bd100];return _0x28c3ae;};'use strict';var moment=require('moment');var _=require(_0x62a8('0x0'));var util=require(_0x62a8('0x1'));var client=require(_0x62a8('0x2'));exports[_0x62a8('0x3')]=function(_0x316e7c){var _0x197ab2=_0x316e7c[_0x62a8('0x4')]||_0x316e7c[_0x62a8('0x5')];return client['Request'](_0x62a8('0x6'),{'body':{'channel':_0x62a8('0x7'),'membername':_0x316e7c['lastAssignedTo'],'interface':_[_0x62a8('0x8')](_0x316e7c[_0x62a8('0x9')])?util[_0x62a8('0xa')](_0x62a8('0xb'),_0x316e7c[_0x62a8('0xc')]):_0x316e7c[_0x62a8('0x9')],'type':_0x62a8('0xd'),'enterAt':_0x316e7c[_0x62a8('0xe')],'exitAt':_0x197ab2,'duration':moment(_0x197ab2)[_0x62a8('0xf')](_0x316e7c['queuecallerleaveAt'],_0x62a8('0x10')),'data1':_0x62a8('0x11'),'data2':_0x316e7c[_0x62a8('0x12')],'data3':_0x316e7c['exten'],'data4':null,'data5':_0x316e7c[_0x62a8('0x13')],'role':'agent','internal':_0x316e7c[_0x62a8('0x14')]?_[_0x62a8('0x15')](_0x316e7c['accountcode']):undefined,'uniqueid':_0x316e7c[_0x62a8('0x16')]},'log':_0x62a8('0x6')});};exports[_0x62a8('0x17')]=function(_0x53309f){return client['Request']('CreateMemberReport',{'body':{'channel':_0x62a8('0x7'),'membername':_0x53309f[_0x62a8('0x18')],'interface':_0x53309f[_0x62a8('0x9')],'type':_0x62a8('0xd'),'enterAt':_0x53309f[_0x62a8('0x19')],'exitAt':_0x53309f['endtime'],'duration':moment(_0x53309f['endtime'])['diff'](_0x53309f[_0x62a8('0x19')],_0x62a8('0x10'))>=0x0?moment(_0x53309f[_0x62a8('0x1a')])[_0x62a8('0xf')](_0x53309f[_0x62a8('0x19')],_0x62a8('0x10')):null,'data1':_0x62a8('0x1b'),'data2':_0x53309f[_0x62a8('0x14')],'data3':_0x53309f['exten'],'data4':_0x53309f[_0x62a8('0x1c')]||null,'role':'agent','internal':_0x53309f[_0x62a8('0x14')]?_[_0x62a8('0x15')](_0x53309f[_0x62a8('0x14')]):undefined,'uniqueid':_0x53309f[_0x62a8('0x16')]},'log':_0x62a8('0x6')});};
\ No newline at end of file
index 9aa673f..54ef97f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b8c=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b8c,0x16f));var _0xc9b8=function(_0x5027b1,_0x1409a5){_0x5027b1=_0x5027b1-0x0;var _0x4a46cf=_0x9b8c[_0x5027b1];return _0x4a46cf;};'use strict';var client=require(_0xc9b8('0x0'));exports[_0xc9b8('0x1')]=function(){return client[_0xc9b8('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xc9b8('0x3')]},'log':_0xc9b8('0x4')});};
\ No newline at end of file
+var _0x4849=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','GetSettings'];(function(_0x11579b,_0x47a336){var _0x1ed761=function(_0x2b5353){while(--_0x2b5353){_0x11579b['push'](_0x11579b['shift']());}};_0x1ed761(++_0x47a336);}(_0x4849,0x181));var _0x9484=function(_0x320f6d,_0x38f00f){_0x320f6d=_0x320f6d-0x0;var _0x50effc=_0x4849[_0x320f6d];return _0x50effc;};'use strict';var client=require('../client');exports[_0x9484('0x0')]=function(){return client[_0x9484('0x1')](_0x9484('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x9484('0x3')]},'log':_0x9484('0x4')});};
\ No newline at end of file
index 82ba9d8..a732d61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf534=['getTemplates','Request','name','html','../client'];(function(_0x1c48fa,_0x54eb68){var _0x270146=function(_0x5a3638){while(--_0x5a3638){_0x1c48fa['push'](_0x1c48fa['shift']());}};_0x270146(++_0x54eb68);}(_0xf534,0x9f));var _0x4f53=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf534[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x4f53('0x0'));exports[_0x4f53('0x1')]=function(_0x26045c){return function(_0x218a12){return client[_0x4f53('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x4f53('0x3'),_0x4f53('0x4')]},'log':'GetTemplate'});};};
\ No newline at end of file
+var _0xbd8e=['getTemplates','Request','name','html','GetTemplate','../client'];(function(_0xc06df3,_0x4ebe01){var _0x3b15d9=function(_0x40ce6c){while(--_0x40ce6c){_0xc06df3['push'](_0xc06df3['shift']());}};_0x3b15d9(++_0x4ebe01);}(_0xbd8e,0x1b5));var _0xebd8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xbd8e[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0xebd8('0x0'));exports[_0xebd8('0x1')]=function(_0x49fbe9){return function(_0x5b8459){return client[_0xebd8('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0xebd8('0x3'),_0xebd8('0x4')]},'log':_0xebd8('0x5')});};};
\ No newline at end of file
index ad19208..95df47b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf939=['data7','GetTrigger','../client','getTriggers','Request','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','action','data1','data2','data3','data4','data6'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xf939,0x128));var _0x9f93=function(_0x436dec,_0x52d28c){_0x436dec=_0x436dec-0x0;var _0x1b56ca=_0xf939[_0x436dec];return _0x1b56ca;};'use strict';var client=require(_0x9f93('0x0'));exports[_0x9f93('0x1')]=function(_0x106e41){return function(_0x2d217c){return client[_0x9f93('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x9f93('0x3'),_0x9f93('0x4'),_0x9f93('0x5')],'include':[{'model':_0x9f93('0x6'),'as':_0x9f93('0x7'),'attributes':['id',_0x9f93('0x8'),_0x9f93('0x9'),_0x9f93('0xa')]},{'model':_0x9f93('0x6'),'as':_0x9f93('0xb'),'attributes':['id',_0x9f93('0x8'),_0x9f93('0x9'),_0x9f93('0xa')]},{'model':_0x9f93('0xc'),'as':'Actions','attributes':['id',_0x9f93('0xd'),_0x9f93('0xe'),_0x9f93('0xf'),_0x9f93('0x10'),_0x9f93('0x11'),'data5',_0x9f93('0x12'),_0x9f93('0x13')]}]},'log':_0x9f93('0x14')});};};
\ No newline at end of file
+var _0x0602=['Action','Actions','action','data2','data3','data4','data5','data6','GetTrigger','../client','getTriggers','Request','name','channel','status','field','operator','value','Condition','AnyConditions'];(function(_0x4a96c5,_0xecf580){var _0x5d8dfd=function(_0x27fcd6){while(--_0x27fcd6){_0x4a96c5['push'](_0x4a96c5['shift']());}};_0x5d8dfd(++_0xecf580);}(_0x0602,0xa9));var _0x2060=function(_0x3f7e43,_0x4d3a03){_0x3f7e43=_0x3f7e43-0x0;var _0x2bf962=_0x0602[_0x3f7e43];return _0x2bf962;};'use strict';var client=require(_0x2060('0x0'));exports[_0x2060('0x1')]=function(_0x43b47e){return function(_0x256d18){return client[_0x2060('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x2060('0x3'),_0x2060('0x4'),_0x2060('0x5')],'include':[{'model':'Condition','as':'AllConditions','attributes':['id',_0x2060('0x6'),_0x2060('0x7'),_0x2060('0x8')]},{'model':_0x2060('0x9'),'as':_0x2060('0xa'),'attributes':['id','field',_0x2060('0x7'),_0x2060('0x8')]},{'model':_0x2060('0xb'),'as':_0x2060('0xc'),'attributes':['id',_0x2060('0xd'),'data1',_0x2060('0xe'),_0x2060('0xf'),_0x2060('0x10'),_0x2060('0x11'),_0x2060('0x12'),'data7']}]},'log':_0x2060('0x13')});};};
\ No newline at end of file
index c91e5b6..ef68e24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79c7=['GetTrunk','name','registry','defaultuser','../client','getTrunks','Request'];(function(_0x520bb3,_0x36c30d){var _0x5cfe0c=function(_0x46bbcb){while(--_0x46bbcb){_0x520bb3['push'](_0x520bb3['shift']());}};_0x5cfe0c(++_0x36c30d);}(_0x79c7,0x154));var _0x779c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x79c7[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x779c('0x0'));exports[_0x779c('0x1')]=function(_0x282042){return function(_0x2a6f74){return client[_0x779c('0x2')](_0x779c('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x779c('0x4'),_0x779c('0x5'),_0x779c('0x6')]},'log':'GetTrunk'});};};
\ No newline at end of file
+var _0x37dc=['registry','../client','getTrunks','GetTrunk'];(function(_0x651e0b,_0x26be9d){var _0x1e7a27=function(_0x3c9f87){while(--_0x3c9f87){_0x651e0b['push'](_0x651e0b['shift']());}};_0x1e7a27(++_0x26be9d);}(_0x37dc,0x1e9));var _0xc37d=function(_0x9e025b,_0x182778){_0x9e025b=_0x9e025b-0x0;var _0x540da9=_0x37dc[_0x9e025b];return _0x540da9;};'use strict';var client=require(_0xc37d('0x0'));exports[_0xc37d('0x1')]=function(_0x1d9c50){return function(_0x409805){return client['Request'](_0xc37d('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xc37d('0x3'),'defaultuser']},'log':'GetTrunk'});};};
\ No newline at end of file
index a818ccd..30b8868 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x2d66fd,_0x3c9415){var _0x322f24=function(_0x3aa4cc){while(--_0x3aa4cc){_0x2d66fd['push'](_0x2d66fd['shift']());}};_0x322f24(++_0x3c9415);}(_0x34e8,0x12c));var _0x834e=function(_0x29d90d,_0x48a9d3){_0x29d90d=_0x29d90d-0x0;var _0x5b43c9=_0x34e8[_0x29d90d];return _0x5b43c9;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});};
\ No newline at end of file
+var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x33c939,_0x233816){var _0x377393=function(_0x5edede){while(--_0x5edede){_0x33c939['push'](_0x33c939['shift']());}};_0x377393(++_0x233816);}(_0xedd9,0xfc));var _0x9edd=function(_0x37e775,_0x3bb1c6){_0x37e775=_0x37e775-0x0;var _0x3c1ab5=_0xedd9[_0x37e775];return _0x3c1ab5;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});};
\ No newline at end of file
index 8a2bf7c..9eebd2f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa526=['../client','create','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x114cc5,_0x5e0ef4){var _0x53282d=function(_0x5bf57c){while(--_0x5bf57c){_0x114cc5['push'](_0x114cc5['shift']());}};_0x53282d(++_0x5e0ef4);}(_0xa526,0x122));var _0x6a52=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0xa526[_0x5a19fc];return _0x34b413;};'use strict';var client=require(_0x6a52('0x0'));exports[_0x6a52('0x1')]=function(_0x3a7554){return client['Request'](_0x6a52('0x2'),{'body':_0x3a7554,'log':_0x6a52('0x2')});};exports[_0x6a52('0x3')]=function(_0x49863b,_0x18d583,_0x4a2552){return client['Request'](_0x6a52('0x4'),{'body':_0x49863b,'options':{'where':{'uniqueid':_0x18d583,'interface':_0x4a2552,'agentcomplete':!![]}},'log':_0x6a52('0x4')});};
\ No newline at end of file
+var _0x09b3=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x2c50e4,_0x15cd2f){var _0x474118=function(_0xb0201){while(--_0xb0201){_0x2c50e4['push'](_0x2c50e4['shift']());}};_0x474118(++_0x15cd2f);}(_0x09b3,0x1a4));var _0x309b=function(_0x3f6269,_0x3fd5ea){_0x3f6269=_0x3f6269-0x0;var _0x58f14d=_0x09b3[_0x3f6269];return _0x58f14d;};'use strict';var client=require(_0x309b('0x0'));exports[_0x309b('0x1')]=function(_0x563772){return client[_0x309b('0x2')]('CreateVoiceAgentReport',{'body':_0x563772,'log':_0x309b('0x3')});};exports[_0x309b('0x4')]=function(_0xc3c467,_0x48506d,_0x1c1300){return client[_0x309b('0x2')](_0x309b('0x5'),{'body':_0xc3c467,'options':{'where':{'uniqueid':_0x48506d,'interface':_0x1c1300,'agentcomplete':!![]}},'log':_0x309b('0x5')});};
\ No newline at end of file
index dda1fb0..5ee74c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x608b=['day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','billableseconds','GetVoiceCallReports','util','lodash','create','CreateVoiceCallReport','calleridnum','callerid','DOCUMENTATION','getVoiceCallReports','outbound'];(function(_0x40877c,_0x3cc5c2){var _0x48a986=function(_0x19391c){while(--_0x19391c){_0x40877c['push'](_0x40877c['shift']());}};_0x48a986(++_0x3cc5c2);}(_0x608b,0xf6));var _0xb608=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x608b[_0x3ab9ee];return _0x82ee88;};'use strict';var moment=require('moment');var util=require(_0xb608('0x0'));var _=require(_0xb608('0x1'));var client=require('../client');exports[_0xb608('0x2')]=function(_0x4831e3){return client['Request'](_0xb608('0x3'),{'body':_['merge'](_0x4831e3,{'source':_0x4831e3[_0xb608('0x4')],'destinationcontext':_0x4831e3['context'],'callerid':_0x4831e3[_0xb608('0x5')],'amaflags':_0xb608('0x6')}),'log':_0xb608('0x3')});};exports[_0xb608('0x7')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0xb608('0x8')],'createdAt':{'$between':[moment()['startOf'](_0xb608('0x9'))[_0xb608('0xa')](_0xb608('0xb')),moment()[_0xb608('0xc')](_0xb608('0x9'))[_0xb608('0xa')](_0xb608('0xb'))]}},'attributes':[_0xb608('0xd'),'disposition',_0xb608('0xe'),_0xb608('0xf')]},'log':_0xb608('0x10')});};};
\ No newline at end of file
+var _0xdb4e=['outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','GetVoiceCallReports','moment','util','lodash','../client','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport'];(function(_0x185832,_0x53aeea){var _0x253dda=function(_0x5791c7){while(--_0x5791c7){_0x185832['push'](_0x185832['shift']());}};_0x253dda(++_0x53aeea);}(_0xdb4e,0x1d6));var _0xedb4=function(_0x15a345,_0x2e79b6){_0x15a345=_0x15a345-0x0;var _0x315b49=_0xdb4e[_0x15a345];return _0x315b49;};'use strict';var moment=require(_0xedb4('0x0'));var util=require(_0xedb4('0x1'));var _=require(_0xedb4('0x2'));var client=require(_0xedb4('0x3'));exports['create']=function(_0x374359){return client[_0xedb4('0x4')](_0xedb4('0x5'),{'body':_[_0xedb4('0x6')](_0x374359,{'source':_0x374359[_0xedb4('0x7')],'destinationcontext':_0x374359[_0xedb4('0x8')],'callerid':_0x374359[_0xedb4('0x9')],'amaflags':_0xedb4('0xa')}),'log':_0xedb4('0x5')});};exports[_0xedb4('0xb')]=function(){return function(){return client[_0xedb4('0x4')](_0xedb4('0xc'),{'options':{'where':{'type':[_0xedb4('0xd')],'createdAt':{'$between':[moment()[_0xedb4('0xe')](_0xedb4('0xf'))[_0xedb4('0x10')](_0xedb4('0x11')),moment()[_0xedb4('0x12')]('day')[_0xedb4('0x10')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xedb4('0x13'),_0xedb4('0x14'),_0xedb4('0x15'),'billableseconds']},'log':_0xedb4('0x16')});};};
\ No newline at end of file
index b77f405..b8f89be 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3878=['CreateVoiceDialReport','../client','create'];(function(_0x5182f9,_0x4acf0c){var _0x4c9fad=function(_0x453b0e){while(--_0x453b0e){_0x5182f9['push'](_0x5182f9['shift']());}};_0x4c9fad(++_0x4acf0c);}(_0x3878,0x1a8));var _0x8387=function(_0x4f027d,_0x3f9587){_0x4f027d=_0x4f027d-0x0;var _0xc46890=_0x3878[_0x4f027d];return _0xc46890;};'use strict';var client=require(_0x8387('0x0'));exports[_0x8387('0x1')]=function(_0x4e498f){return client['Request'](_0x8387('0x2'),{'body':_0x4e498f,'log':'CreateVoiceDialReport'});};
\ No newline at end of file
+var _0x2b04=['create','CreateVoiceDialReport','../client'];(function(_0x21eef2,_0x1480ea){var _0x32f106=function(_0x409e7e){while(--_0x409e7e){_0x21eef2['push'](_0x21eef2['shift']());}};_0x32f106(++_0x1480ea);}(_0x2b04,0x9e));var _0x42b0=function(_0x39cc44,_0x416e62){_0x39cc44=_0x39cc44-0x0;var _0x20c8dc=_0x2b04[_0x39cc44];return _0x20c8dc;};'use strict';var client=require(_0x42b0('0x0'));exports[_0x42b0('0x1')]=function(_0x11ece2){return client['Request']('CreateVoiceDialReport',{'body':_0x11ece2,'log':_0x42b0('0x2')});};
\ No newline at end of file
index f9e694e..86552c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd404=['getVoiceExtensions','GetVoiceExtension','exten','../client'];(function(_0x3aab2d,_0xfa013c){var _0xdfd0b7=function(_0x443d61){while(--_0x443d61){_0x3aab2d['push'](_0x3aab2d['shift']());}};_0xdfd0b7(++_0xfa013c);}(_0xd404,0x15b));var _0x4d40=function(_0x25da9d,_0x357693){_0x25da9d=_0x25da9d-0x0;var _0x1307be=_0xd404[_0x25da9d];return _0x1307be;};'use strict';var client=require(_0x4d40('0x0'));exports[_0x4d40('0x1')]=function(){return function(){return client['Request'](_0x4d40('0x2'),{'options':{'raw':!![],'attributes':['id',_0x4d40('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x4d40('0x1')});};};
\ No newline at end of file
+var _0x7d98=['recordingFormat','../client','Request','GetVoiceExtension','exten'];(function(_0x5175d8,_0x3dff89){var _0x59e2ad=function(_0x24c475){while(--_0x24c475){_0x5175d8['push'](_0x5175d8['shift']());}};_0x59e2ad(++_0x3dff89);}(_0x7d98,0xe7));var _0x87d9=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0x7d98[_0x555069];return _0x100af7;};'use strict';var client=require(_0x87d9('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x87d9('0x1')](_0x87d9('0x2'),{'options':{'raw':!![],'attributes':['id',_0x87d9('0x3'),_0x87d9('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};};
\ No newline at end of file
index dfc4a39..acce6aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe148=['dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','Interval','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType'];(function(_0x3b7a0c,_0xf1a4c2){var _0x3bb70f=function(_0x248b52){while(--_0x248b52){_0x3b7a0c['push'](_0x3b7a0c['shift']());}};_0x3bb70f(++_0xf1a4c2);}(_0xe148,0x1c4));var _0x8e14=function(_0x1857c6,_0x48840c){_0x1857c6=_0x1857c6-0x0;var _0x51011c=_0xe148[_0x1857c6];return _0x51011c;};'use strict';var client=require(_0x8e14('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x8e14('0x1')](_0x8e14('0x2'),{'options':{'raw':![],'attributes':['id',_0x8e14('0x3'),_0x8e14('0x4'),_0x8e14('0x5'),_0x8e14('0x6'),_0x8e14('0x7'),'type',_0x8e14('0x8'),_0x8e14('0x9'),'dialLimitChannel',_0x8e14('0xa'),'dialPowerLevel',_0x8e14('0xb'),_0x8e14('0xc'),_0x8e14('0xd'),_0x8e14('0xe'),_0x8e14('0xf'),_0x8e14('0x10'),_0x8e14('0x11'),'dialQueueTimeout',_0x8e14('0x12'),_0x8e14('0x13'),_0x8e14('0x14'),_0x8e14('0x15'),_0x8e14('0x16'),'dialNoAnswerMaxRetry',_0x8e14('0x17'),_0x8e14('0x18'),_0x8e14('0x19'),_0x8e14('0x1a'),'dialPrefix',_0x8e14('0x1b'),_0x8e14('0x1c'),_0x8e14('0x1d'),'dialAMDGreeting',_0x8e14('0x1e'),_0x8e14('0x1f'),_0x8e14('0x20'),_0x8e14('0x21'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x8e14('0x22'),'timeout',_0x8e14('0x23'),_0x8e14('0x24'),'dialOrderByScheduledAt',_0x8e14('0x25'),_0x8e14('0x26'),_0x8e14('0x27'),'monitor_format',_0x8e14('0x28'),_0x8e14('0x29'),_0x8e14('0x2a'),_0x8e14('0x2b'),'dialNoSuchNumberRetryFrequency',_0x8e14('0x2c'),_0x8e14('0x2d'),'dialAbandonedMaxRetry',_0x8e14('0x2e'),_0x8e14('0x2f'),_0x8e14('0x30'),_0x8e14('0x31'),_0x8e14('0x32'),'mandatoryDisposition',_0x8e14('0x33'),_0x8e14('0x34')],'include':[{'model':_0x8e14('0x35'),'as':'Trunk','attributes':['id',_0x8e14('0x3'),_0x8e14('0x36'),_0x8e14('0x37')]},{'model':_0x8e14('0x38'),'as':_0x8e14('0x39'),'attributes':['id','name']},{'model':_0x8e14('0x35'),'as':'TrunkBackup','attributes':['id','name',_0x8e14('0x36'),_0x8e14('0x37')]},{'model':_0x8e14('0x3a'),'as':_0x8e14('0x3a'),'attributes':['id',_0x8e14('0x3')],'include':[{'model':_0x8e14('0x3a'),'as':'Intervals','attributes':['id','name','interval']}]}]},'log':_0x8e14('0x3b')});};};
\ No newline at end of file
+var _0x54d4=['interval','getVoiceQueues','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','active','Pause','TrunkBackup','callerid','Interval','Intervals'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x54d4,0xf5));var _0x454d=function(_0x41acd2,_0x36cc66){_0x41acd2=_0x41acd2-0x0;var _0x4813fe=_0x54d4[_0x41acd2];return _0x4813fe;};'use strict';var client=require('../client');exports[_0x454d('0x0')]=function(){return function(){return client['Request'](_0x454d('0x1'),{'options':{'raw':![],'attributes':['id',_0x454d('0x2'),_0x454d('0x3'),_0x454d('0x4'),_0x454d('0x5'),_0x454d('0x6'),_0x454d('0x7'),'dialActive',_0x454d('0x8'),_0x454d('0x9'),_0x454d('0xa'),_0x454d('0xb'),'dialPredictiveOptimization',_0x454d('0xc'),_0x454d('0xd'),_0x454d('0xe'),'dialOriginateCallerIdNumber',_0x454d('0xf'),_0x454d('0x10'),'dialQueueTimeout',_0x454d('0x11'),'dialCongestionMaxRetry',_0x454d('0x12'),_0x454d('0x13'),_0x454d('0x14'),'dialNoAnswerMaxRetry',_0x454d('0x15'),'dialGlobalMaxRetry',_0x454d('0x16'),_0x454d('0x17'),_0x454d('0x18'),'dialCheckDuplicateType',_0x454d('0x19'),_0x454d('0x1a'),_0x454d('0x1b'),_0x454d('0x1c'),'dialAMDTotalAnalysisTime',_0x454d('0x1d'),'dialAMDBetweenWordsSilence',_0x454d('0x1e'),_0x454d('0x1f'),_0x454d('0x20'),_0x454d('0x21'),_0x454d('0x22'),_0x454d('0x23'),_0x454d('0x24'),_0x454d('0x25'),_0x454d('0x26'),_0x454d('0x27'),_0x454d('0x6'),_0x454d('0x28'),_0x454d('0x29'),_0x454d('0x2a'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency',_0x454d('0x2b'),_0x454d('0x2c'),_0x454d('0x2d'),_0x454d('0x2e'),_0x454d('0x2f'),_0x454d('0x30'),_0x454d('0x31'),_0x454d('0x32'),_0x454d('0x33'),'dialPredictiveIntervalMaxThreshold',_0x454d('0x34')],'include':[{'model':_0x454d('0x35'),'as':'Trunk','attributes':['id',_0x454d('0x2'),'callerid',_0x454d('0x36')]},{'model':_0x454d('0x37'),'as':'mandatoryDispositionPause','attributes':['id','name']},{'model':'Trunk','as':_0x454d('0x38'),'attributes':['id',_0x454d('0x2'),_0x454d('0x39'),_0x454d('0x36')]},{'model':_0x454d('0x3a'),'as':'Interval','attributes':['id',_0x454d('0x2')],'include':[{'model':'Interval','as':_0x454d('0x3b'),'attributes':['id','name',_0x454d('0x3c')]}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
index 9322016..faf3a49 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x2b00ad,_0x410060){var _0x17287c=function(_0x8794a1){while(--_0x8794a1){_0x2b00ad['push'](_0x2b00ad['shift']());}};_0x17287c(++_0x410060);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
+var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x56272b,_0xde68f2){var _0x27e3ef=function(_0x57cbdd){while(--_0x57cbdd){_0x56272b['push'](_0x56272b['shift']());}};_0x27e3ef(++_0xde68f2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};};
\ No newline at end of file
index 1365a41..7c5e51b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f35=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x180d61,_0x53dbe7){var _0x35f30e=function(_0x3e79f0){while(--_0x3e79f0){_0x180d61['push'](_0x180d61['shift']());}};_0x35f30e(++_0x53dbe7);}(_0x8f35,0xa0));var _0x58f3=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x8f35[_0x1a9204];return _0x17ca68;};'use strict';var client=require(_0x58f3('0x0'));exports[_0x58f3('0x1')]=function(_0x3b5d3c){return function(){return client[_0x58f3('0x2')](_0x58f3('0x3'),{'options':{'where':{'VoiceQueueId':_0x3b5d3c,'paused':!![]},'raw':!![]},'log':_0x58f3('0x1')});};};
\ No newline at end of file
+var _0x2e18=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x5f7a5f,_0x2435a6){var _0x46584c=function(_0x50058d){while(--_0x50058d){_0x5f7a5f['push'](_0x5f7a5f['shift']());}};_0x46584c(++_0x2435a6);}(_0x2e18,0x10a));var _0x82e1=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2e18[_0x4a9fb1];return _0x348672;};'use strict';var client=require(_0x82e1('0x0'));exports[_0x82e1('0x1')]=function(_0x4cc072){return function(){return client[_0x82e1('0x2')](_0x82e1('0x3'),{'options':{'where':{'VoiceQueueId':_0x4cc072,'paused':!![]},'raw':!![]},'log':_0x82e1('0x1')});};};
\ No newline at end of file
index 8815c24..e361c4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x110ac9,_0x4ca77f){var _0x42eb02=function(_0x119bc6){while(--_0x119bc6){_0x110ac9['push'](_0x110ac9['shift']());}};_0x42eb02(++_0x4ca77f);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x54b7e6,_0xc0136a){var _0xfe9536=function(_0x1558ca){while(--_0x1558ca){_0x54b7e6['push'](_0x54b7e6['shift']());}};_0xfe9536(++_0xc0136a);}(_0x7a54,0x106));var _0x47a5=function(_0x536542,_0x399275){_0x536542=_0x536542-0x0;var _0x6e7762=_0x7a54[_0x536542];return _0x6e7762;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
index ae60e55..8eb036a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4db=['transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereecontext','transfereeexten','transfereelinkedid','context','extension','blind','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','isexternal','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten'];(function(_0x3a1b90,_0x3c0158){var _0xf6de77=function(_0x396533){while(--_0x396533){_0x3a1b90['push'](_0x3a1b90['shift']());}};_0xf6de77(++_0x3c0158);}(_0xd4db,0xcb));var _0xbd4d=function(_0x2c2147,_0x280c50){_0x2c2147=_0x2c2147-0x0;var _0x4e7dd2=_0xd4db[_0x2c2147];return _0x4e7dd2;};'use strict';var client=require(_0xbd4d('0x0'));exports[_0xbd4d('0x1')]={};exports[_0xbd4d('0x2')]=function(_0x463085){return client['Request'](_0xbd4d('0x3'),{'body':{'result':_0x463085[_0xbd4d('0x4')],'transfererchannel':_0x463085[_0xbd4d('0x5')],'transferercalleridnum':_0x463085['transferercalleridnum'],'transferercalleridname':_0x463085[_0xbd4d('0x6')],'transfererconnectedlinenum':_0x463085[_0xbd4d('0x7')],'transfererconnectedlinename':_0x463085[_0xbd4d('0x8')],'transfereraccountcode':_0x463085[_0xbd4d('0x9')],'transferercontext':_0x463085[_0xbd4d('0xa')],'transfererexten':_0x463085[_0xbd4d('0xb')],'transfererlinkedid':_0x463085[_0xbd4d('0xc')],'transfereechannel':_0x463085[_0xbd4d('0xd')],'transfereecalleridnum':_0x463085[_0xbd4d('0xe')],'transfereecalleridname':_0x463085[_0xbd4d('0xf')],'transfereeconnectedlinenum':_0x463085['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x463085[_0xbd4d('0x10')],'transfereeaccountcode':_0x463085['transfereeaccountcode'],'transfereecontext':_0x463085[_0xbd4d('0x11')],'transfereeexten':_0x463085[_0xbd4d('0x12')],'transfereelinkedid':_0x463085[_0xbd4d('0x13')],'isexternal':_0x463085['isexternal'],'context':_0x463085[_0xbd4d('0x14')],'extension':_0x463085[_0xbd4d('0x15')],'type':_0xbd4d('0x16')},'log':_0xbd4d('0x3')});};exports['attendedTransfer']=function(_0x5f57ad){return client[_0xbd4d('0x17')](_0xbd4d('0x3'),{'body':{'result':_0x5f57ad[_0xbd4d('0x4')],'transfererchannel':_0x5f57ad[_0xbd4d('0x18')],'transferercalleridnum':_0x5f57ad[_0xbd4d('0x19')],'transferercalleridname':_0x5f57ad[_0xbd4d('0x1a')],'transfererconnectedlinenum':_0x5f57ad['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5f57ad[_0xbd4d('0x1b')],'transfereraccountcode':_0x5f57ad[_0xbd4d('0x1c')],'transferercontext':_0x5f57ad['secondtransferercontext'],'transfererexten':_0x5f57ad[_0xbd4d('0x1d')],'transfererlinkedid':_0x5f57ad[_0xbd4d('0x1e')],'transfereechannel':_0x5f57ad[_0xbd4d('0x1f')],'transfereecalleridnum':_0x5f57ad[_0xbd4d('0x20')],'transfereecalleridname':_0x5f57ad[_0xbd4d('0x21')],'transfereeconnectedlinenum':_0x5f57ad[_0xbd4d('0x22')],'transfereeconnectedlinename':_0x5f57ad[_0xbd4d('0x23')],'transfereeaccountcode':_0x5f57ad[_0xbd4d('0x24')],'transfereecontext':_0x5f57ad[_0xbd4d('0x25')],'transfereeexten':_0x5f57ad[_0xbd4d('0x26')],'transfereelinkedid':_0x5f57ad['transfertargetlinkedid'],'isexternal':_0x5f57ad[_0xbd4d('0x27')],'context':_0x5f57ad[_0xbd4d('0x28')],'extension':_0x5f57ad[_0xbd4d('0x29')],'type':_0xbd4d('0x2a')},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
+var _0x669c=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer','Request','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x12f570,_0x2bdad1){var _0x820efc=function(_0xb209d7){while(--_0xb209d7){_0x12f570['push'](_0x12f570['shift']());}};_0x820efc(++_0x2bdad1);}(_0x669c,0x1ec));var _0xc669=function(_0x4d9672,_0x1a6f25){_0x4d9672=_0x4d9672-0x0;var _0x95d0e9=_0x669c[_0x4d9672];return _0x95d0e9;};'use strict';var client=require(_0xc669('0x0'));exports[_0xc669('0x1')]={};exports[_0xc669('0x2')]=function(_0x5104a9){return client['Request'](_0xc669('0x3'),{'body':{'result':_0x5104a9[_0xc669('0x4')],'transfererchannel':_0x5104a9[_0xc669('0x5')],'transferercalleridnum':_0x5104a9[_0xc669('0x6')],'transferercalleridname':_0x5104a9[_0xc669('0x7')],'transfererconnectedlinenum':_0x5104a9[_0xc669('0x8')],'transfererconnectedlinename':_0x5104a9[_0xc669('0x9')],'transfereraccountcode':_0x5104a9[_0xc669('0xa')],'transferercontext':_0x5104a9['transferercontext'],'transfererexten':_0x5104a9[_0xc669('0xb')],'transfererlinkedid':_0x5104a9[_0xc669('0xc')],'transfereechannel':_0x5104a9[_0xc669('0xd')],'transfereecalleridnum':_0x5104a9[_0xc669('0xe')],'transfereecalleridname':_0x5104a9['transfereecalleridname'],'transfereeconnectedlinenum':_0x5104a9['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x5104a9[_0xc669('0xf')],'transfereeaccountcode':_0x5104a9[_0xc669('0x10')],'transfereecontext':_0x5104a9[_0xc669('0x11')],'transfereeexten':_0x5104a9[_0xc669('0x12')],'transfereelinkedid':_0x5104a9[_0xc669('0x13')],'isexternal':_0x5104a9[_0xc669('0x14')],'context':_0x5104a9[_0xc669('0x15')],'extension':_0x5104a9[_0xc669('0x16')],'type':_0xc669('0x17')},'log':_0xc669('0x3')});};exports[_0xc669('0x18')]=function(_0x536817){return client[_0xc669('0x19')](_0xc669('0x3'),{'body':{'result':_0x536817[_0xc669('0x4')],'transfererchannel':_0x536817['origtransfererchannel'],'transferercalleridnum':_0x536817[_0xc669('0x1a')],'transferercalleridname':_0x536817['origtransferercalleridname'],'transfererconnectedlinenum':_0x536817[_0xc669('0x1b')],'transfererconnectedlinename':_0x536817[_0xc669('0x1c')],'transfereraccountcode':_0x536817[_0xc669('0x1d')],'transferercontext':_0x536817[_0xc669('0x1e')],'transfererexten':_0x536817[_0xc669('0x1f')],'transfererlinkedid':_0x536817[_0xc669('0x20')],'transfereechannel':_0x536817[_0xc669('0x21')],'transfereecalleridnum':_0x536817[_0xc669('0x22')],'transfereecalleridname':_0x536817[_0xc669('0x23')],'transfereeconnectedlinenum':_0x536817[_0xc669('0x24')],'transfereeconnectedlinename':_0x536817[_0xc669('0x25')],'transfereeaccountcode':_0x536817[_0xc669('0x26')],'transfereecontext':_0x536817[_0xc669('0x27')],'transfereeexten':_0x536817[_0xc669('0x28')],'transfereelinkedid':_0x536817[_0xc669('0x29')],'isexternal':_0x536817[_0xc669('0x14')],'context':_0x536817[_0xc669('0x2a')],'extension':_0x536817[_0xc669('0x2b')],'type':'attended'},'log':'CreateVoiceTransferReport'});};
\ No newline at end of file
index 03d9dc7..94eb473 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a5a=['callerid','Interval','push','length','find','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','format','wav','MixMonitor','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','status','stop','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','outboundChannels','campaigns','event','custom:','faxAccounts','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','validate','bluebird','moment','../properties','../ami','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','Reload','Action','then','message','catch','command','action','Command','content','error','voiceQueues','answered','available','loggedIn','pTalking','sumBillable','sumDuration','talking','type','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x246e1a,_0x30ee98){_0x246e1a=_0x246e1a-0x0;var _0x19a13c=_0x5a5a[_0x246e1a];return _0x19a13c;};'use strict';var _=require('lodash');var util=require(_0xa5a5('0x0'));var jayson=require(_0xa5a5('0x1'));var schema=require(_0xa5a5('0x2'));var BPromise=require(_0xa5a5('0x3'));var moment=require(_0xa5a5('0x4'));var config=require('../../../config/environment');var properties=require(_0xa5a5('0x5'));var ami=require(_0xa5a5('0x6'));exports[_0xa5a5('0x7')]=function(_0x4ad9b3,_0x4828f5,_0x43943d){return new BPromise(function(_0x1fe96d,_0x5691f1){var _0x3ea00f={'QueuePause':function(_0xf2ea20){return new Promise(function(_0x1234c2,_0x3a23f4){var _0x458bbd=util['format'](_0xa5a5('0x8'),_0xa5a5('0x9'),_0xf2ea20[_0xa5a5('0xa')]);if(_0x4ad9b3[_0xa5a5('0xb')]&&_0x4ad9b3[_0xa5a5('0xb')][_0x458bbd]&&_0x4ad9b3[_0xa5a5('0xb')][_0x458bbd][_0xa5a5('0xc')]){_0x4ad9b3[_0xa5a5('0xb')][_0x458bbd][_0xa5a5('0xd')]();}if(_0x4ad9b3[_0xa5a5('0xe')][_0x458bbd]){_0x4ad9b3[_0xa5a5('0xe')][_0x458bbd][_0xa5a5('0xf')]({'statePause':_0xf2ea20['pause']?!![]:![]});}_0x1234c2({'code':0xc8,'message':_0xa5a5('0x10')});});},'Reload':function(_0x420b1d){var _0x3917b1=this;return new Promise(function(_0x266985,_0x462acd){if(ami[_0xa5a5('0x11')]()==![]){return _0x462acd(_0x3917b1['error'](0x1f4,[config[_0xa5a5('0x12')]['ip'],config[_0xa5a5('0x12')][_0xa5a5('0x13')],_0xa5a5('0x14')][_0xa5a5('0x15')]('\x20')));}_0x420b1d=_[_0xa5a5('0x16')](_0x420b1d,_[_0xa5a5('0x17')](properties[_0xa5a5('0x18')]));_0x420b1d['action']=_0xa5a5('0x19');return ami[_0xa5a5('0x1a')](_0x420b1d)[_0xa5a5('0x1b')](function(_0x184652){_0x266985({'code':0xc8,'message':_0x184652[_0xa5a5('0x1c')]});})[_0xa5a5('0x1d')](function(_0x28c89f){_0x462acd(_0x3917b1['error'](0x1f5,_0x28c89f[_0xa5a5('0x1c')]));});});},'Command':function(_0x47514d){var _0x21488a=this;return new Promise(function(_0x3776cb,_0x5e3412){if(ami[_0xa5a5('0x11')]()==![]){return _0x5e3412(_0x21488a['error'](0x1f4,[config[_0xa5a5('0x12')]['ip'],config[_0xa5a5('0x12')][_0xa5a5('0x13')],_0xa5a5('0x14')]['join']('\x20')));}_0x47514d=_['pick'](_0x47514d,_0xa5a5('0x1e'));_0x47514d[_0xa5a5('0x1f')]=_0xa5a5('0x20');return ami['Action'](_0x47514d)[_0xa5a5('0x1b')](function(_0x4b4613){_0x3776cb({'code':0xc8,'message':_0x4b4613[_0xa5a5('0x21')]});})['catch'](function(_0x4c0ff2){_0x5e3412(_0x21488a[_0xa5a5('0x22')](0x1f5,_0x4c0ff2[_0xa5a5('0x1c')]));});});},'VoiceQueues':function(_0xef9509){return new Promise(function(_0x366787,_0x55ed28){var _0x3583b1=[];for(var _0x54dfdc in _0x4ad9b3[_0xa5a5('0x23')]){if(_0x4ad9b3[_0xa5a5('0x23')]['hasOwnProperty'](_0x54dfdc)){var _0x5ccc1e=_0x4ad9b3[_0xa5a5('0x23')][_0x54dfdc];var _0xdfa813={'id':_0x5ccc1e['id'],'name':_0x5ccc1e['name'],'strategy':_0x5ccc1e['strategy'],'answered':_0x5ccc1e[_0xa5a5('0x24')],'available':_0x5ccc1e[_0xa5a5('0x25')],'loggedIn':_0x5ccc1e[_0xa5a5('0x26')],'pTalking':_0x5ccc1e[_0xa5a5('0x27')],'sumBillable':_0x5ccc1e[_0xa5a5('0x28')],'sumDuration':_0x5ccc1e[_0xa5a5('0x29')],'sumHoldTime':_0x5ccc1e['sumHoldTime']||0x0,'talking':_0x5ccc1e[_0xa5a5('0x2a')],'total':_0x5ccc1e['total'],'type':_0x5ccc1e[_0xa5a5('0x2b')],'unmanaged':_0x5ccc1e['unmanaged'],'abandoned':_0x5ccc1e[_0xa5a5('0x2c')],'waiting':_0x5ccc1e[_0xa5a5('0x2d')],'loggedInDb':_0x5ccc1e['loggedInDb']};if(_0x5ccc1e['type']==='outbound'){_0xdfa813[_0xa5a5('0x2e')]=_0x5ccc1e['dialActive'];_0xdfa813[_0xa5a5('0x2f')]=_0x5ccc1e[_0xa5a5('0x2f')];_0xdfa813['dialOriginateCallerIdName']=_0x5ccc1e[_0xa5a5('0x30')];_0xdfa813[_0xa5a5('0x31')]=_0x5ccc1e['dialOriginateCallerIdNumber'];_0xdfa813[_0xa5a5('0x32')]=_0x5ccc1e[_0xa5a5('0x32')];_0xdfa813[_0xa5a5('0x33')]=_0x5ccc1e[_0xa5a5('0x33')];_0xdfa813[_0xa5a5('0x34')]=_0x5ccc1e[_0xa5a5('0x34')];_0xdfa813[_0xa5a5('0x35')]=_0x5ccc1e['outboundAnswerAgiCallsDay'];_0xdfa813[_0xa5a5('0x36')]=_0x5ccc1e[_0xa5a5('0x36')];_0xdfa813[_0xa5a5('0x37')]=_0x5ccc1e[_0xa5a5('0x37')];_0xdfa813[_0xa5a5('0x38')]=_0x5ccc1e[_0xa5a5('0x38')];_0xdfa813[_0xa5a5('0x39')]=_0x5ccc1e[_0xa5a5('0x39')];_0xdfa813[_0xa5a5('0x3a')]=_0x5ccc1e[_0xa5a5('0x3a')];_0xdfa813[_0xa5a5('0x3b')]=_0x5ccc1e[_0xa5a5('0x3b')];_0xdfa813[_0xa5a5('0x3c')]=_0x5ccc1e[_0xa5a5('0x3c')];_0xdfa813[_0xa5a5('0x3d')]=_0x5ccc1e[_0xa5a5('0x3d')];_0xdfa813[_0xa5a5('0x3e')]=_0x5ccc1e['outboundNoSuchCallsDay'];_0xdfa813[_0xa5a5('0x3f')]=_0x5ccc1e['outboundOriginateFailureCallsDay'];_0xdfa813['outboundReCallsDay']=_0x5ccc1e['outboundReCallsDay'];_0xdfa813[_0xa5a5('0x40')]=_0x5ccc1e['outboundRejectCallsDay'];_0xdfa813[_0xa5a5('0x41')]=_0x5ccc1e[_0xa5a5('0x41')];_0xdfa813[_0xa5a5('0x42')]=_0x5ccc1e['predictiveIntervalAnsweredCalls'];_0xdfa813[_0xa5a5('0x43')]=_0x5ccc1e['predictiveIntervalAvgHoldtime'];_0xdfa813['predictiveIntervalAvgTalktime']=_0x5ccc1e[_0xa5a5('0x44')];_0xdfa813[_0xa5a5('0x45')]=_0x5ccc1e['predictiveIntervalDroppedCallsCallersExit'];_0xdfa813[_0xa5a5('0x46')]=_0x5ccc1e['predictiveIntervalDroppedCallsTimeout'];_0xdfa813['predictiveIntervalErlangCalls']=_0x5ccc1e[_0xa5a5('0x47')];_0xdfa813['predictiveIntervalErlangCallsDroppedCalls']=_0x5ccc1e[_0xa5a5('0x48')];_0xdfa813['predictiveIntervalHitRate']=_0x5ccc1e[_0xa5a5('0x49')];_0xdfa813[_0xa5a5('0x4a')]=_0x5ccc1e[_0xa5a5('0x4a')];_0xdfa813[_0xa5a5('0x4b')]=_0x5ccc1e[_0xa5a5('0x4b')];_0xdfa813[_0xa5a5('0x4c')]=_0x5ccc1e[_0xa5a5('0x4c')];_0xdfa813[_0xa5a5('0x4d')]=_0x5ccc1e[_0xa5a5('0x4d')];_0xdfa813[_0xa5a5('0x1c')]=_0x5ccc1e['message'];_0xdfa813[_0xa5a5('0x4e')]=_0x5ccc1e['originated'];_0xdfa813[_0xa5a5('0x4f')]=_0x5ccc1e[_0xa5a5('0x4f')];_0xdfa813['erlangCallToSecond']=_0x5ccc1e[_0xa5a5('0x50')];_0xdfa813[_0xa5a5('0x51')]=_0x5ccc1e[_0xa5a5('0x51')];_0xdfa813[_0xa5a5('0x52')]=_0x5ccc1e[_0xa5a5('0x52')];_0xdfa813['startPredictive']=_0x5ccc1e[_0xa5a5('0x53')];_0xdfa813[_0xa5a5('0x54')]=_0x5ccc1e['startProgressive'];}if(_0x5ccc1e[_0xa5a5('0x55')]){_0xdfa813[_0xa5a5('0x55')]={'id':_0x5ccc1e[_0xa5a5('0x55')]['id'],'name':_0x5ccc1e[_0xa5a5('0x55')][_0xa5a5('0xa')],'active':_0x5ccc1e[_0xa5a5('0x55')][_0xa5a5('0x56')],'callerid':_0x5ccc1e['Trunk'][_0xa5a5('0x57')]};}if(_0x5ccc1e['Interval']){_0xdfa813[_0xa5a5('0x58')]={'id':_0x5ccc1e['Interval']['id'],'name':_0x5ccc1e['Interval'][_0xa5a5('0xa')]};}_0x3583b1[_0xa5a5('0x59')](_0xdfa813);}}_0x366787({'count':_0x3583b1[_0xa5a5('0x5a')],'rows':_0x3583b1});});},'UpdateVoiceQueue':function(_0x4b4e78){return new Promise(function(_0x1023c2,_0x52acb0){var _0x4c3c87=_[_0xa5a5('0x5b')](_0x4ad9b3[_0xa5a5('0x23')],{'id':parseInt(_0x4b4e78['id'])});var _0x452e08=_['omit'](_0x4b4e78,['id']);if(_0x4c3c87){for(var _0x2aa541 in _0x452e08){if(typeof _0x452e08[_0x2aa541]!=='undefined'&&typeof _0x4c3c87[_0x2aa541]!=='undefined'){_0x4c3c87[_0x2aa541]=_0x452e08[_0x2aa541];}}_0x1023c2(_0x4c3c87);}else{_0x52acb0();}});},'VoiceChannels':function(_0x199eb5){return new Promise(function(_0x236db9,_0x2d96a0){var _0x25091f=_[_0xa5a5('0x5c')](_0x4ad9b3[_0xa5a5('0x5d')]);_0x236db9({'count':_0x25091f[_0xa5a5('0x5a')],'rows':_0x25091f});});},'VoiceChannelMixMonitor':function(_0x39a015){var _0x5c30a3=this;return new Promise(function(_0x2f1b43,_0x16534f){if(ami[_0xa5a5('0x11')]()==![]){return _0x16534f(_0x5c30a3[_0xa5a5('0x22')](0x1f4,[config[_0xa5a5('0x12')]['ip'],config[_0xa5a5('0x12')]['username'],_0xa5a5('0x14')][_0xa5a5('0x15')]('\x20')));}var _0x59181b=schema(properties[_0xa5a5('0x5e')])[_0xa5a5('0x2')](_0x39a015);if(_0x59181b[_0xa5a5('0x5a')]>0x0){return _0x16534f(_0x5c30a3['error'](0x1f4,_[_0xa5a5('0x5f')](_0x59181b,_0xa5a5('0x1c'))[_0xa5a5('0x15')](',\x20')));}var _0x3d0541=_['find'](_0x4ad9b3['channels'],{'uniqueid':_0x39a015[_0xa5a5('0x60')]});if(_0x3d0541&&_0x3d0541[_0xa5a5('0x61')]){var _0x232304=util['format'](_0xa5a5('0x62'),_0x39a015[_0xa5a5('0x63')]||_0x39a015[_0xa5a5('0x60')],_0x39a015[_0xa5a5('0x64')]||_0xa5a5('0x65'));return ami[_0xa5a5('0x1a')]({'action':_0xa5a5('0x66'),'channel':_0x3d0541['channel'],'file':_0x232304,'options':_0xa5a5('0x67')})[_0xa5a5('0x1b')](function(_0x29b0bf){var _0x3199d2=_[_0xa5a5('0x5b')](_0x3d0541[_0xa5a5('0x68')],{'filename':'/var/spool/asterisk/monitor/'+_0x232304[_0xa5a5('0x69')]()});if(_[_0xa5a5('0x6a')](_0x3199d2)){_0x3d0541[_0xa5a5('0x68')]['push']({'filename':_0xa5a5('0x6b')+_0x232304[_0xa5a5('0x69')](),'createdAt':moment()['format'](_0xa5a5('0x6c')),'mixmonitorid':_0x29b0bf[_0xa5a5('0x6d')],'status':_0xa5a5('0x6e')});}else{_0x3199d2[_0xa5a5('0x6d')]=_0x29b0bf['mixmonitorid'];_0x3199d2['status']=_0xa5a5('0x6e');}_0x2f1b43({'code':0xc8,'message':[_0x39a015[_0xa5a5('0x60')],_0xa5a5('0x6f'),_0x29b0bf[_0xa5a5('0x6d')]][_0xa5a5('0x15')]('\x20'),'mixmonitorid':_0x29b0bf[_0xa5a5('0x6d')]});})['catch'](function(_0x49a308){_0x16534f(_0x5c30a3[_0xa5a5('0x22')](0x1f5,[_0x39a015[_0xa5a5('0x60')],_0x49a308[_0xa5a5('0x1c')]['toLowerCase']()]['join']('\x20')));});}else{return _0x16534f(_0x5c30a3['error'](0x1f5,_0xa5a5('0x70')));}});},'VoiceChannelStopMixMonitor':function(_0x21d378){var _0x3c8dc7=this;return new Promise(function(_0x46e42f,_0x1dfe21){if(ami[_0xa5a5('0x11')]()==![]){return _0x1dfe21(_0x3c8dc7[_0xa5a5('0x22')](0x1f4,[config[_0xa5a5('0x12')]['ip'],config[_0xa5a5('0x12')][_0xa5a5('0x13')],'ami\x20disconnected'][_0xa5a5('0x15')]('\x20')));}var _0x5127f2=schema(properties[_0xa5a5('0x5e')])[_0xa5a5('0x2')](_0x21d378);if(_0x5127f2[_0xa5a5('0x5a')]>0x0){return _0x1dfe21(_0x3c8dc7['error'](0x1f4,_[_0xa5a5('0x5f')](_0x5127f2,_0xa5a5('0x1c'))['join'](',\x20')));}var _0x12f534=_[_0xa5a5('0x5b')](_0x4ad9b3[_0xa5a5('0x5d')],{'uniqueid':_0x21d378[_0xa5a5('0x60')]});if(_0x12f534){return BPromise[_0xa5a5('0x71')]()[_0xa5a5('0x1b')](function(){if(_0x12f534[_0xa5a5('0x61')]){return ami[_0xa5a5('0x1a')]({'action':_0xa5a5('0x72'),'channel':_0x12f534[_0xa5a5('0x61')],'mixmonitorid':_0x21d378['mixmonitorid']})[_0xa5a5('0x1d')](function(_0x3eb2b){});}})[_0xa5a5('0x1b')](function(){if(_0x12f534['destinationchannel']){return ami[_0xa5a5('0x1a')]({'action':_0xa5a5('0x72'),'channel':_0x12f534[_0xa5a5('0x73')],'mixmonitorid':_0x21d378[_0xa5a5('0x6d')]})[_0xa5a5('0x1d')](function(_0x2ad297){});}})[_0xa5a5('0x1b')](function(_0x1dc8e4){var _0x111728=_['find'](_0x12f534['monitors'],{'mixmonitorid':_0x21d378[_0xa5a5('0x6d')]});if(_0x111728){_0x111728[_0xa5a5('0x74')]=_0xa5a5('0x75');}})['then'](function(){var _0x1c9e9a=util['format'](_0xa5a5('0x62'),_0x21d378[_0xa5a5('0x63')]||_0x21d378[_0xa5a5('0x60')],_0x21d378[_0xa5a5('0x64')]||'wav');var _0x4b8bf7=_[_0xa5a5('0x5b')](_0x12f534[_0xa5a5('0x68')],{'filename':'/var/spool/asterisk/monitor/'+_0x1c9e9a[_0xa5a5('0x69')]()});if(_0x4b8bf7){_0x4b8bf7[_0xa5a5('0x74')]=_0xa5a5('0x75');}})[_0xa5a5('0x1b')](function(){_0x46e42f({'code':0xc8,'message':[_0x21d378['uniqueid'],'StopMixMonitor\x20Success'][_0xa5a5('0x15')]('\x20')});})['catch'](function(_0x2a5277){_0x1dfe21(_0x3c8dc7[_0xa5a5('0x22')](0x1f5,[_0x21d378[_0xa5a5('0x60')],_0x2a5277[_0xa5a5('0x1c')]['toLowerCase']()][_0xa5a5('0x15')]('\x20')));});}else{return _0x1dfe21(_0x3c8dc7['error'](0x1f5,_0xa5a5('0x70')));}});},'VoiceQueuesChannels':function(_0x339b41){return new Promise(function(_0x304902,_0x243aef){var _0x386147=_[_0xa5a5('0x5c')](_0x4ad9b3[_0xa5a5('0x76')]);_0x304902({'count':_0x386147['length'],'rows':_0x386147});});},'VoiceQueuesChannel':function(_0x41ee9a){var _0x59e1f2=this;return new Promise(function(_0x1ce632,_0x85f8e0){var _0x157ec=schema(properties[_0xa5a5('0x77')])[_0xa5a5('0x2')](_0x41ee9a);if(_0x157ec[_0xa5a5('0x5a')]>0x0){return _0x85f8e0(_0x59e1f2['error'](0x1f4,_[_0xa5a5('0x5f')](_0x157ec,_0xa5a5('0x1c'))['join'](',\x20')));}var _0x44a726=_[_0xa5a5('0x5b')](_0x4ad9b3[_0xa5a5('0x76')],{'uniqueid':_0x41ee9a[_0xa5a5('0x60')]});if(_0x44a726){_0x1ce632(_0x44a726);}else{return _0x85f8e0(_0x59e1f2['error'](0x1f5,_0xa5a5('0x70')));}});},'VoiceQueuesChannelHangup':function(_0x397668){var _0x29fede=this;return new Promise(function(_0x13bf1b,_0x580b2d){if(ami[_0xa5a5('0x11')]()==![]){return _0x580b2d(_0x29fede[_0xa5a5('0x22')](0x1f4,[config['asterisk']['ip'],config[_0xa5a5('0x12')][_0xa5a5('0x13')],'ami\x20disconnected']['join']('\x20')));}var _0x151021=schema(properties['voicequeuechannelhangup'])[_0xa5a5('0x2')](_0x397668);if(_0x151021[_0xa5a5('0x5a')]>0x0){return _0x580b2d(_0x29fede[_0xa5a5('0x22')](0x1f4,_['map'](_0x151021,_0xa5a5('0x1c'))[_0xa5a5('0x15')](',\x20')));}var _0x1a4fa1=_[_0xa5a5('0x5b')](_0x4ad9b3[_0xa5a5('0x76')],{'uniqueid':_0x397668[_0xa5a5('0x60')]});if(_0x1a4fa1&&_0x1a4fa1['channel']){return ami['Action']({'action':_0xa5a5('0x78'),'channel':_0x1a4fa1[_0xa5a5('0x61')]})[_0xa5a5('0x1b')](function(_0x223106){_0x13bf1b({'code':0xc8,'message':[_0x397668['uniqueid'],_0x223106[_0xa5a5('0x1c')][_0xa5a5('0x69')]()]['join']('\x20')});})[_0xa5a5('0x1d')](function(_0x2590b4){_0x580b2d(_0x29fede[_0xa5a5('0x22')](0x1f5,[_0x397668[_0xa5a5('0x60')],_0x2590b4[_0xa5a5('0x1c')]['toLowerCase']()][_0xa5a5('0x15')]('\x20')));});}else{return _0x580b2d(_0x29fede[_0xa5a5('0x22')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x4ee6e9){var _0x397fae=this;return new Promise(function(_0x4832a8,_0x1eac19){if(ami[_0xa5a5('0x11')]()==![]){return _0x1eac19(_0x397fae[_0xa5a5('0x22')](0x1f4,[config[_0xa5a5('0x12')]['ip'],config[_0xa5a5('0x12')][_0xa5a5('0x13')],'ami\x20disconnected'][_0xa5a5('0x15')]('\x20')));}var _0x2ac7a6=schema(properties[_0xa5a5('0x79')])[_0xa5a5('0x2')](_0x4ee6e9);if(_0x2ac7a6[_0xa5a5('0x5a')]>0x0){return _0x1eac19(_0x397fae[_0xa5a5('0x22')](0x1f4,_[_0xa5a5('0x5f')](_0x2ac7a6,_0xa5a5('0x1c'))[_0xa5a5('0x15')](',\x20')));}var _0x103a56=_[_0xa5a5('0x5b')](_0x4ad9b3[_0xa5a5('0x76')],{'uniqueid':_0x4ee6e9['uniqueid']});if(_0x103a56&&_0x103a56['channel']){return ami[_0xa5a5('0x1a')]({'action':_0xa5a5('0x7a'),'channel':_0x103a56[_0xa5a5('0x61')],'exten':_0x4ee6e9[_0xa5a5('0x7b')],'context':_0x4ee6e9[_0xa5a5('0x7c')]||_0x103a56['context'],'priority':0x1})[_0xa5a5('0x1b')](function(_0x4d48d8){_0x4832a8({'code':0xc8,'message':[_0x4ee6e9[_0xa5a5('0x60')],_0x4d48d8[_0xa5a5('0x1c')][_0xa5a5('0x69')]()][_0xa5a5('0x15')]('\x20')});})[_0xa5a5('0x1d')](function(_0x3317b1){_0x1eac19(_0x397fae['error'](0x1f5,[_0x4ee6e9[_0xa5a5('0x60')],_0x3317b1[_0xa5a5('0x1c')][_0xa5a5('0x69')]()][_0xa5a5('0x15')]('\x20')));});}else{return _0x1eac19(_0x397fae[_0xa5a5('0x22')](0x1f5,_0xa5a5('0x70')));}});},'Agents':function(_0x27a667){return new Promise(function(_0x2a94ee,_0x2e56b7){var _0x3d7894=_['values'](_0x4ad9b3['agents']);_0x2a94ee({'count':_0x3d7894[_0xa5a5('0x5a')],'rows':_0x3d7894});});},'Telephones':function(_0x4c3674){return new Promise(function(_0x4d53c5,_0x177908){var _0x359141=_[_0xa5a5('0x5c')](_0x4ad9b3[_0xa5a5('0x7d')]);_0x4d53c5({'count':_0x359141[_0xa5a5('0x5a')],'rows':_0x359141});});},'Trunks':function(_0x328a6e){return new Promise(function(_0x546104,_0x1abc89){var _0x233e29=_[_0xa5a5('0x5c')](_0x4ad9b3['trunks']);_0x546104({'count':_0x233e29[_0xa5a5('0x5a')],'rows':_0x233e29});});},'OutboundChannels':function(_0xf9c151){return new Promise(function(_0xfb0a27,_0x1eaddb){var _0x13ddd7=_[_0xa5a5('0x5c')](_0x4ad9b3[_0xa5a5('0x7e')]);_0xfb0a27({'count':_0x13ddd7[_0xa5a5('0x5a')],'rows':_0x13ddd7});});},'Outbound':function(_0x53ca84){return new Promise(function(_0x3f56b7,_0x45eecb){_0x3f56b7(_0x4ad9b3['outbound']);});},'Campaigns':function(_0x3adec0){return new Promise(function(_0x439287,_0x9b825b){var _0x583b93=_['values'](_0x4ad9b3[_0xa5a5('0x7f')]);_0x439287({'count':_0x583b93['length'],'rows':_0x583b93});});},'VoiceQueuesPreview':function(_0x19367b){var _0x5ea983=this;return new Promise(function(_0x12db3d,_0x47fc64){_0x4828f5['run'](_0x19367b['id'])[_0xa5a5('0x1b')](function(_0x3af9c4){_0x12db3d({'code':0xc8,'message':_0x3af9c4[_0xa5a5('0x1c')]});})[_0xa5a5('0x1d')](function(_0xe846c0){_0x47fc64(_0x5ea983['error'](0x1f4,_0xe846c0['message']));});});},'EventManager':function(_0x4a3f9c){var _0x141fe5=this;return new Promise(function(_0x26bdf4,_0x5a518b){if(!_0x4a3f9c[_0xa5a5('0x80')]){return _0x5a518b(_0x141fe5[_0xa5a5('0x22')](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0xa5a5('0x81')+_0x4a3f9c[_0xa5a5('0x80')],_0x4a3f9c['message']);_0x26bdf4({'code':0xc8,'message':_0x4a3f9c});});},'FaxAccounts':function(_0x41b49e){return new Promise(function(_0x278817,_0x4b77f5){var _0x2ca46f=_[_0xa5a5('0x5c')](_0x4ad9b3[_0xa5a5('0x82')]);_0x278817({'count':_0x2ca46f[_0xa5a5('0x5a')],'rows':_0x2ca46f});});},'SendFax':function(_0xafd5fd){var _0x265e4e=this;return new Promise(function(_0x46fab3,_0x2fdd88){_0x43943d[_0xa5a5('0x83')](_0xafd5fd)[_0xa5a5('0x1b')](function(_0x24fbfc){_0x46fab3({'code':0xc8,'message':_0x24fbfc[_0xa5a5('0x1c')]});})['catch'](function(_0x506db3){_0x2fdd88(_0x265e4e[_0xa5a5('0x22')](0x1f4,_0x506db3[_0xa5a5('0x1c')]));});});},'CheckAfterSend':function(_0xf5f6a8){var _0x1f1a7a=this;return new Promise(function(_0x18fd9b,_0x210f48){_0x43943d[_0xa5a5('0x84')](_0xf5f6a8)[_0xa5a5('0x1b')](function(_0x2bdb88){_0x18fd9b({'code':0xc8,'message':_0x2bdb88[_0xa5a5('0x1c')]});})[_0xa5a5('0x1d')](function(_0x323292){_0x210f48(_0x1f1a7a[_0xa5a5('0x22')](0x1f4,_0x323292[_0xa5a5('0x1c')]));});});}};var _0x574e4a=jayson['server'](_0x3ea00f)[_0xa5a5('0x85')]();_0x574e4a['on']('error',function(_0x59a860){return _0x5691f1(_0x59a860);});_0x574e4a[_0xa5a5('0x7')](0x232a,_0xa5a5('0x86'),function(){console[_0xa5a5('0x87')](_0xa5a5('0x88'),0x232a);return _0x1fe96d(_0xa5a5('0x89')+0x232a);});});};
\ No newline at end of file
+var _0x6050=['error','asterisk','username','ami\x20disconnected','join','module','action','Reload','Action','then','message','catch','pick','command','Command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumDuration','talking','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','find','omit','undefined','values','channels','length','voicechannel','uniqueid','channel','%s.%s','filename','wav','MixMonitor','/var/spool/asterisk/monitor/','isNil','monitors','push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','map','resolve','StopMixMonitor','destinationchannel','status','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelredirect','exten','context','telephones','outboundChannels','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../properties','../ami','listen','format','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected'];(function(_0x4b9a51,_0x20b5f2){var _0x18cae4=function(_0x42dff9){while(--_0x42dff9){_0x4b9a51['push'](_0x4b9a51['shift']());}};_0x18cae4(++_0x20b5f2);}(_0x6050,0x196));var _0x0605=function(_0x3e3cd7,_0x2d1b57){_0x3e3cd7=_0x3e3cd7-0x0;var _0x16b31c=_0x6050[_0x3e3cd7];return _0x16b31c;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var jayson=require(_0x0605('0x2'));var schema=require(_0x0605('0x3'));var BPromise=require(_0x0605('0x4'));var moment=require(_0x0605('0x5'));var config=require('../../../config/environment');var properties=require(_0x0605('0x6'));var ami=require(_0x0605('0x7'));exports[_0x0605('0x8')]=function(_0x5797b0,_0x533b6d,_0x4aca21){return new BPromise(function(_0xd78d96,_0x578623){var _0x58f7d2={'QueuePause':function(_0x5660ad){return new Promise(function(_0x1629bf,_0x11b8b5){var _0xa08eca=util[_0x0605('0x9')](_0x0605('0xa'),'SIP',_0x5660ad[_0x0605('0xb')]);if(_0x5797b0[_0x0605('0xc')]&&_0x5797b0[_0x0605('0xc')][_0xa08eca]&&_0x5797b0[_0x0605('0xc')][_0xa08eca][_0x0605('0xd')]){_0x5797b0[_0x0605('0xc')][_0xa08eca][_0x0605('0xe')]();}if(_0x5797b0[_0x0605('0xf')][_0xa08eca]){_0x5797b0[_0x0605('0xf')][_0xa08eca][_0x0605('0x10')]({'statePause':_0x5660ad[_0x0605('0x11')]?!![]:![]});}_0x1629bf({'code':0xc8,'message':_0x0605('0x12')});});},'Reload':function(_0x34c9e6){var _0x39a115=this;return new Promise(function(_0x22c011,_0x44e793){if(ami[_0x0605('0x13')]()==![]){return _0x44e793(_0x39a115[_0x0605('0x14')](0x1f4,[config[_0x0605('0x15')]['ip'],config['asterisk'][_0x0605('0x16')],_0x0605('0x17')][_0x0605('0x18')]('\x20')));}_0x34c9e6=_['pick'](_0x34c9e6,_['keys'](properties[_0x0605('0x19')]));_0x34c9e6[_0x0605('0x1a')]=_0x0605('0x1b');return ami[_0x0605('0x1c')](_0x34c9e6)[_0x0605('0x1d')](function(_0x351dbd){_0x22c011({'code':0xc8,'message':_0x351dbd[_0x0605('0x1e')]});})[_0x0605('0x1f')](function(_0x193520){_0x44e793(_0x39a115[_0x0605('0x14')](0x1f5,_0x193520[_0x0605('0x1e')]));});});},'Command':function(_0x2fa77e){var _0x2e2204=this;return new Promise(function(_0x103952,_0x59bc87){if(ami[_0x0605('0x13')]()==![]){return _0x59bc87(_0x2e2204[_0x0605('0x14')](0x1f4,[config[_0x0605('0x15')]['ip'],config[_0x0605('0x15')][_0x0605('0x16')],_0x0605('0x17')][_0x0605('0x18')]('\x20')));}_0x2fa77e=_[_0x0605('0x20')](_0x2fa77e,_0x0605('0x21'));_0x2fa77e['action']=_0x0605('0x22');return ami['Action'](_0x2fa77e)[_0x0605('0x1d')](function(_0x118e9c){_0x103952({'code':0xc8,'message':_0x118e9c[_0x0605('0x23')]});})[_0x0605('0x1f')](function(_0x10c575){_0x59bc87(_0x2e2204[_0x0605('0x14')](0x1f5,_0x10c575[_0x0605('0x1e')]));});});},'VoiceQueues':function(_0x1ae3db){return new Promise(function(_0x234231,_0x2896d7){var _0x9f2833=[];for(var _0x1c3722 in _0x5797b0['voiceQueues']){if(_0x5797b0[_0x0605('0x24')][_0x0605('0x25')](_0x1c3722)){var _0x4b1e0c=_0x5797b0['voiceQueues'][_0x1c3722];var _0x55ebd8={'id':_0x4b1e0c['id'],'name':_0x4b1e0c[_0x0605('0xb')],'strategy':_0x4b1e0c[_0x0605('0x26')],'answered':_0x4b1e0c[_0x0605('0x27')],'available':_0x4b1e0c[_0x0605('0x28')],'loggedIn':_0x4b1e0c[_0x0605('0x29')],'pTalking':_0x4b1e0c[_0x0605('0x2a')],'sumBillable':_0x4b1e0c['sumBillable'],'sumDuration':_0x4b1e0c[_0x0605('0x2b')],'sumHoldTime':_0x4b1e0c['sumHoldTime']||0x0,'talking':_0x4b1e0c[_0x0605('0x2c')],'total':_0x4b1e0c[_0x0605('0x2d')],'type':_0x4b1e0c[_0x0605('0x2e')],'unmanaged':_0x4b1e0c[_0x0605('0x2f')],'abandoned':_0x4b1e0c[_0x0605('0x30')],'waiting':_0x4b1e0c[_0x0605('0x31')],'loggedInDb':_0x4b1e0c['loggedInDb']};if(_0x4b1e0c[_0x0605('0x2e')]===_0x0605('0x32')){_0x55ebd8[_0x0605('0x33')]=_0x4b1e0c[_0x0605('0x33')];_0x55ebd8[_0x0605('0x34')]=_0x4b1e0c[_0x0605('0x34')];_0x55ebd8[_0x0605('0x35')]=_0x4b1e0c[_0x0605('0x35')];_0x55ebd8[_0x0605('0x36')]=_0x4b1e0c[_0x0605('0x36')];_0x55ebd8[_0x0605('0x37')]=_0x4b1e0c[_0x0605('0x37')];_0x55ebd8[_0x0605('0x38')]=_0x4b1e0c[_0x0605('0x38')];_0x55ebd8[_0x0605('0x39')]=_0x4b1e0c[_0x0605('0x39')];_0x55ebd8[_0x0605('0x3a')]=_0x4b1e0c[_0x0605('0x3a')];_0x55ebd8[_0x0605('0x3b')]=_0x4b1e0c[_0x0605('0x3b')];_0x55ebd8[_0x0605('0x3c')]=_0x4b1e0c[_0x0605('0x3c')];_0x55ebd8[_0x0605('0x3d')]=_0x4b1e0c[_0x0605('0x3d')];_0x55ebd8[_0x0605('0x3e')]=_0x4b1e0c[_0x0605('0x3e')];_0x55ebd8[_0x0605('0x3f')]=_0x4b1e0c['outboundDropCallsDayACS'];_0x55ebd8[_0x0605('0x40')]=_0x4b1e0c[_0x0605('0x40')];_0x55ebd8['outboundDropCallsDayTimeout']=_0x4b1e0c[_0x0605('0x41')];_0x55ebd8[_0x0605('0x42')]=_0x4b1e0c['outboundNoAnswerCallsDay'];_0x55ebd8[_0x0605('0x43')]=_0x4b1e0c[_0x0605('0x43')];_0x55ebd8[_0x0605('0x44')]=_0x4b1e0c[_0x0605('0x44')];_0x55ebd8[_0x0605('0x45')]=_0x4b1e0c[_0x0605('0x45')];_0x55ebd8['outboundRejectCallsDay']=_0x4b1e0c['outboundRejectCallsDay'];_0x55ebd8[_0x0605('0x46')]=_0x4b1e0c[_0x0605('0x46')];_0x55ebd8[_0x0605('0x47')]=_0x4b1e0c['predictiveIntervalAnsweredCalls'];_0x55ebd8[_0x0605('0x48')]=_0x4b1e0c['predictiveIntervalAvgHoldtime'];_0x55ebd8[_0x0605('0x49')]=_0x4b1e0c[_0x0605('0x49')];_0x55ebd8[_0x0605('0x4a')]=_0x4b1e0c[_0x0605('0x4a')];_0x55ebd8[_0x0605('0x4b')]=_0x4b1e0c[_0x0605('0x4b')];_0x55ebd8[_0x0605('0x4c')]=_0x4b1e0c[_0x0605('0x4c')];_0x55ebd8[_0x0605('0x4d')]=_0x4b1e0c[_0x0605('0x4d')];_0x55ebd8['predictiveIntervalHitRate']=_0x4b1e0c[_0x0605('0x4e')];_0x55ebd8['predictiveIntervalMultiplicativeFactor']=_0x4b1e0c[_0x0605('0x4f')];_0x55ebd8[_0x0605('0x50')]=_0x4b1e0c[_0x0605('0x50')];_0x55ebd8['predictiveIntervalAvailable']=_0x4b1e0c['predictiveIntervalAvailable'];_0x55ebd8[_0x0605('0x51')]=_0x4b1e0c['predictiveIntervalTotalCalls'];_0x55ebd8[_0x0605('0x1e')]=_0x4b1e0c[_0x0605('0x1e')];_0x55ebd8[_0x0605('0x52')]=_0x4b1e0c[_0x0605('0x52')];_0x55ebd8[_0x0605('0x53')]=_0x4b1e0c[_0x0605('0x53')];_0x55ebd8[_0x0605('0x54')]=_0x4b1e0c[_0x0605('0x54')];_0x55ebd8[_0x0605('0x55')]=_0x4b1e0c[_0x0605('0x55')];_0x55ebd8[_0x0605('0x56')]=_0x4b1e0c[_0x0605('0x56')];_0x55ebd8[_0x0605('0x57')]=_0x4b1e0c['startPredictive'];_0x55ebd8['startProgressive']=_0x4b1e0c[_0x0605('0x58')];}if(_0x4b1e0c['Trunk']){_0x55ebd8[_0x0605('0x59')]={'id':_0x4b1e0c[_0x0605('0x59')]['id'],'name':_0x4b1e0c['Trunk'][_0x0605('0xb')],'active':_0x4b1e0c[_0x0605('0x59')]['active'],'callerid':_0x4b1e0c[_0x0605('0x59')][_0x0605('0x5a')]};}if(_0x4b1e0c['Interval']){_0x55ebd8[_0x0605('0x5b')]={'id':_0x4b1e0c[_0x0605('0x5b')]['id'],'name':_0x4b1e0c['Interval'][_0x0605('0xb')]};}_0x9f2833['push'](_0x55ebd8);}}_0x234231({'count':_0x9f2833['length'],'rows':_0x9f2833});});},'UpdateVoiceQueue':function(_0x1fa208){return new Promise(function(_0x468a3e,_0x45b555){var _0xfd711e=_[_0x0605('0x5c')](_0x5797b0[_0x0605('0x24')],{'id':parseInt(_0x1fa208['id'])});var _0x3d7cfc=_[_0x0605('0x5d')](_0x1fa208,['id']);if(_0xfd711e){for(var _0x56190c in _0x3d7cfc){if(typeof _0x3d7cfc[_0x56190c]!==_0x0605('0x5e')&&typeof _0xfd711e[_0x56190c]!==_0x0605('0x5e')){_0xfd711e[_0x56190c]=_0x3d7cfc[_0x56190c];}}_0x468a3e(_0xfd711e);}else{_0x45b555();}});},'VoiceChannels':function(_0xbecbe5){return new Promise(function(_0x483c20,_0x433d4c){var _0x1fb70b=_[_0x0605('0x5f')](_0x5797b0[_0x0605('0x60')]);_0x483c20({'count':_0x1fb70b[_0x0605('0x61')],'rows':_0x1fb70b});});},'VoiceChannelMixMonitor':function(_0x86434d){var _0x20e27d=this;return new Promise(function(_0xc27400,_0x3cc131){if(ami['isConnected']()==![]){return _0x3cc131(_0x20e27d[_0x0605('0x14')](0x1f4,[config[_0x0605('0x15')]['ip'],config[_0x0605('0x15')][_0x0605('0x16')],_0x0605('0x17')][_0x0605('0x18')]('\x20')));}var _0x18995e=schema(properties[_0x0605('0x62')])[_0x0605('0x3')](_0x86434d);if(_0x18995e[_0x0605('0x61')]>0x0){return _0x3cc131(_0x20e27d['error'](0x1f4,_['map'](_0x18995e,'message')[_0x0605('0x18')](',\x20')));}var _0x7daeb7=_[_0x0605('0x5c')](_0x5797b0[_0x0605('0x60')],{'uniqueid':_0x86434d[_0x0605('0x63')]});if(_0x7daeb7&&_0x7daeb7[_0x0605('0x64')]){var _0x539ded=util[_0x0605('0x9')](_0x0605('0x65'),_0x86434d[_0x0605('0x66')]||_0x86434d[_0x0605('0x63')],_0x86434d['format']||_0x0605('0x67'));return ami[_0x0605('0x1c')]({'action':_0x0605('0x68'),'channel':_0x7daeb7['channel'],'file':_0x539ded,'options':'ai(mixmonitorid)'})[_0x0605('0x1d')](function(_0x1a735c){var _0x523e16=_['find'](_0x7daeb7['monitors'],{'filename':_0x0605('0x69')+_0x539ded['toLowerCase']()});if(_[_0x0605('0x6a')](_0x523e16)){_0x7daeb7[_0x0605('0x6b')][_0x0605('0x6c')]({'filename':_0x0605('0x69')+_0x539ded[_0x0605('0x6d')](),'createdAt':moment()[_0x0605('0x9')](_0x0605('0x6e')),'mixmonitorid':_0x1a735c['mixmonitorid'],'status':_0x0605('0x6f')});}else{_0x523e16['mixmonitorid']=_0x1a735c[_0x0605('0x70')];_0x523e16['status']=_0x0605('0x6f');}_0xc27400({'code':0xc8,'message':[_0x86434d[_0x0605('0x63')],_0x0605('0x71'),_0x1a735c[_0x0605('0x70')]]['join']('\x20'),'mixmonitorid':_0x1a735c['mixmonitorid']});})[_0x0605('0x1f')](function(_0xe1a3e7){_0x3cc131(_0x20e27d['error'](0x1f5,[_0x86434d['uniqueid'],_0xe1a3e7['message'][_0x0605('0x6d')]()][_0x0605('0x18')]('\x20')));});}else{return _0x3cc131(_0x20e27d[_0x0605('0x14')](0x1f5,_0x0605('0x72')));}});},'VoiceChannelStopMixMonitor':function(_0x3af2ad){var _0x50220d=this;return new Promise(function(_0x491ff2,_0x34f2e4){if(ami[_0x0605('0x13')]()==![]){return _0x34f2e4(_0x50220d[_0x0605('0x14')](0x1f4,[config[_0x0605('0x15')]['ip'],config[_0x0605('0x15')][_0x0605('0x16')],_0x0605('0x17')][_0x0605('0x18')]('\x20')));}var _0x533a9c=schema(properties['voicechannel'])['validate'](_0x3af2ad);if(_0x533a9c[_0x0605('0x61')]>0x0){return _0x34f2e4(_0x50220d[_0x0605('0x14')](0x1f4,_[_0x0605('0x73')](_0x533a9c,'message')['join'](',\x20')));}var _0x36fb25=_[_0x0605('0x5c')](_0x5797b0[_0x0605('0x60')],{'uniqueid':_0x3af2ad[_0x0605('0x63')]});if(_0x36fb25){return BPromise[_0x0605('0x74')]()[_0x0605('0x1d')](function(){if(_0x36fb25[_0x0605('0x64')]){return ami[_0x0605('0x1c')]({'action':_0x0605('0x75'),'channel':_0x36fb25[_0x0605('0x64')],'mixmonitorid':_0x3af2ad[_0x0605('0x70')]})[_0x0605('0x1f')](function(_0x5d4e9a){});}})[_0x0605('0x1d')](function(){if(_0x36fb25[_0x0605('0x76')]){return ami[_0x0605('0x1c')]({'action':_0x0605('0x75'),'channel':_0x36fb25[_0x0605('0x76')],'mixmonitorid':_0x3af2ad[_0x0605('0x70')]})['catch'](function(_0x2533a1){});}})['then'](function(_0x5f2063){var _0x3d2414=_[_0x0605('0x5c')](_0x36fb25[_0x0605('0x6b')],{'mixmonitorid':_0x3af2ad[_0x0605('0x70')]});if(_0x3d2414){_0x3d2414[_0x0605('0x77')]=_0x0605('0x78');}})[_0x0605('0x1d')](function(){var _0x25d352=util[_0x0605('0x9')](_0x0605('0x65'),_0x3af2ad['filename']||_0x3af2ad['uniqueid'],_0x3af2ad['format']||'wav');var _0x5e0b7a=_[_0x0605('0x5c')](_0x36fb25[_0x0605('0x6b')],{'filename':_0x0605('0x69')+_0x25d352['toLowerCase']()});if(_0x5e0b7a){_0x5e0b7a[_0x0605('0x77')]=_0x0605('0x78');}})[_0x0605('0x1d')](function(){_0x491ff2({'code':0xc8,'message':[_0x3af2ad[_0x0605('0x63')],_0x0605('0x79')][_0x0605('0x18')]('\x20')});})['catch'](function(_0x2afa0f){_0x34f2e4(_0x50220d[_0x0605('0x14')](0x1f5,[_0x3af2ad[_0x0605('0x63')],_0x2afa0f['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x34f2e4(_0x50220d[_0x0605('0x14')](0x1f5,_0x0605('0x72')));}});},'VoiceQueuesChannels':function(_0xfc544f){return new Promise(function(_0x542607,_0x55d375){var _0x4b6d10=_[_0x0605('0x5f')](_0x5797b0[_0x0605('0x7a')]);_0x542607({'count':_0x4b6d10['length'],'rows':_0x4b6d10});});},'VoiceQueuesChannel':function(_0x20dd76){var _0x1ab06c=this;return new Promise(function(_0x29eca2,_0x2409e8){var _0x8f99=schema(properties[_0x0605('0x7b')])[_0x0605('0x3')](_0x20dd76);if(_0x8f99[_0x0605('0x61')]>0x0){return _0x2409e8(_0x1ab06c[_0x0605('0x14')](0x1f4,_[_0x0605('0x73')](_0x8f99,_0x0605('0x1e'))[_0x0605('0x18')](',\x20')));}var _0x34c223=_['find'](_0x5797b0['queueChannels'],{'uniqueid':_0x20dd76[_0x0605('0x63')]});if(_0x34c223){_0x29eca2(_0x34c223);}else{return _0x2409e8(_0x1ab06c[_0x0605('0x14')](0x1f5,_0x0605('0x72')));}});},'VoiceQueuesChannelHangup':function(_0x59ea0f){var _0x5832d6=this;return new Promise(function(_0x3fa92e,_0x5f21b2){if(ami['isConnected']()==![]){return _0x5f21b2(_0x5832d6[_0x0605('0x14')](0x1f4,[config[_0x0605('0x15')]['ip'],config[_0x0605('0x15')]['username'],'ami\x20disconnected']['join']('\x20')));}var _0x2fbd38=schema(properties['voicequeuechannelhangup'])[_0x0605('0x3')](_0x59ea0f);if(_0x2fbd38[_0x0605('0x61')]>0x0){return _0x5f21b2(_0x5832d6[_0x0605('0x14')](0x1f4,_[_0x0605('0x73')](_0x2fbd38,_0x0605('0x1e'))[_0x0605('0x18')](',\x20')));}var _0x24fe36=_[_0x0605('0x5c')](_0x5797b0['queueChannels'],{'uniqueid':_0x59ea0f['uniqueid']});if(_0x24fe36&&_0x24fe36[_0x0605('0x64')]){return ami[_0x0605('0x1c')]({'action':'Hangup','channel':_0x24fe36[_0x0605('0x64')]})['then'](function(_0x1623d5){_0x3fa92e({'code':0xc8,'message':[_0x59ea0f[_0x0605('0x63')],_0x1623d5['message'][_0x0605('0x6d')]()]['join']('\x20')});})[_0x0605('0x1f')](function(_0x21a75d){_0x5f21b2(_0x5832d6[_0x0605('0x14')](0x1f5,[_0x59ea0f[_0x0605('0x63')],_0x21a75d['message'][_0x0605('0x6d')]()][_0x0605('0x18')]('\x20')));});}else{return _0x5f21b2(_0x5832d6['error'](0x1f5,_0x0605('0x72')));}});},'VoiceQueuesChannelRedirect':function(_0x3bbcc1){var _0x1e4659=this;return new Promise(function(_0x53646f,_0x909282){if(ami[_0x0605('0x13')]()==![]){return _0x909282(_0x1e4659['error'](0x1f4,[config['asterisk']['ip'],config[_0x0605('0x15')][_0x0605('0x16')],_0x0605('0x17')][_0x0605('0x18')]('\x20')));}var _0x4de957=schema(properties[_0x0605('0x7c')])[_0x0605('0x3')](_0x3bbcc1);if(_0x4de957[_0x0605('0x61')]>0x0){return _0x909282(_0x1e4659[_0x0605('0x14')](0x1f4,_[_0x0605('0x73')](_0x4de957,_0x0605('0x1e'))[_0x0605('0x18')](',\x20')));}var _0x48871d=_[_0x0605('0x5c')](_0x5797b0[_0x0605('0x7a')],{'uniqueid':_0x3bbcc1[_0x0605('0x63')]});if(_0x48871d&&_0x48871d[_0x0605('0x64')]){return ami['Action']({'action':'Redirect','channel':_0x48871d[_0x0605('0x64')],'exten':_0x3bbcc1[_0x0605('0x7d')],'context':_0x3bbcc1['context']||_0x48871d[_0x0605('0x7e')],'priority':0x1})['then'](function(_0x5de76a){_0x53646f({'code':0xc8,'message':[_0x3bbcc1[_0x0605('0x63')],_0x5de76a[_0x0605('0x1e')][_0x0605('0x6d')]()]['join']('\x20')});})[_0x0605('0x1f')](function(_0xdd449){_0x909282(_0x1e4659[_0x0605('0x14')](0x1f5,[_0x3bbcc1[_0x0605('0x63')],_0xdd449[_0x0605('0x1e')][_0x0605('0x6d')]()][_0x0605('0x18')]('\x20')));});}else{return _0x909282(_0x1e4659[_0x0605('0x14')](0x1f5,_0x0605('0x72')));}});},'Agents':function(_0x1c4216){return new Promise(function(_0x342c2b,_0x1bd3a5){var _0x3760a1=_[_0x0605('0x5f')](_0x5797b0[_0x0605('0xf')]);_0x342c2b({'count':_0x3760a1[_0x0605('0x61')],'rows':_0x3760a1});});},'Telephones':function(_0x51d480){return new Promise(function(_0x14c575,_0x106da4){var _0x2f9235=_[_0x0605('0x5f')](_0x5797b0[_0x0605('0x7f')]);_0x14c575({'count':_0x2f9235['length'],'rows':_0x2f9235});});},'Trunks':function(_0xaa5ee9){return new Promise(function(_0x36159d,_0x2eb03a){var _0x5b7e88=_[_0x0605('0x5f')](_0x5797b0['trunks']);_0x36159d({'count':_0x5b7e88[_0x0605('0x61')],'rows':_0x5b7e88});});},'OutboundChannels':function(_0x479b63){return new Promise(function(_0x52aafc,_0x21e559){var _0x5b88e4=_['values'](_0x5797b0[_0x0605('0x80')]);_0x52aafc({'count':_0x5b88e4[_0x0605('0x61')],'rows':_0x5b88e4});});},'Outbound':function(_0x40f33b){return new Promise(function(_0x1a1e63,_0x13e60a){_0x1a1e63(_0x5797b0[_0x0605('0x32')]);});},'Campaigns':function(_0x23a5d8){return new Promise(function(_0x5e5170,_0x5dd481){var _0xe989d1=_[_0x0605('0x5f')](_0x5797b0['campaigns']);_0x5e5170({'count':_0xe989d1[_0x0605('0x61')],'rows':_0xe989d1});});},'VoiceQueuesPreview':function(_0x4e5858){var _0x1f295b=this;return new Promise(function(_0x297aa6,_0x58278d){_0x533b6d[_0x0605('0x81')](_0x4e5858['id'])['then'](function(_0x5bc86f){_0x297aa6({'code':0xc8,'message':_0x5bc86f[_0x0605('0x1e')]});})[_0x0605('0x1f')](function(_0x1765ae){_0x58278d(_0x1f295b['error'](0x1f4,_0x1765ae[_0x0605('0x1e')]));});});},'EventManager':function(_0x2e47d5){var _0x3b365b=this;return new Promise(function(_0x3c2485,_0x15254c){if(!_0x2e47d5[_0x0605('0x82')]){return _0x15254c(_0x3b365b[_0x0605('0x14')](0x1f4,_0x0605('0x83')));}ami[_0x0605('0x84')](_0x0605('0x85')+_0x2e47d5['event'],_0x2e47d5[_0x0605('0x1e')]);_0x3c2485({'code':0xc8,'message':_0x2e47d5});});},'FaxAccounts':function(_0xd838f6){return new Promise(function(_0xb75eda,_0x23a6ef){var _0x42c1fa=_['values'](_0x5797b0[_0x0605('0x86')]);_0xb75eda({'count':_0x42c1fa['length'],'rows':_0x42c1fa});});},'SendFax':function(_0x2c7cbd){var _0x10e19e=this;return new Promise(function(_0x4fb8ed,_0x2420d2){_0x4aca21[_0x0605('0x87')](_0x2c7cbd)[_0x0605('0x1d')](function(_0x1b305a){_0x4fb8ed({'code':0xc8,'message':_0x1b305a[_0x0605('0x1e')]});})[_0x0605('0x1f')](function(_0x40449c){_0x2420d2(_0x10e19e[_0x0605('0x14')](0x1f4,_0x40449c['message']));});});},'CheckAfterSend':function(_0x2932fd){var _0x5c6822=this;return new Promise(function(_0x1ccdbb,_0x2ad1a5){_0x4aca21[_0x0605('0x88')](_0x2932fd)[_0x0605('0x1d')](function(_0x1d37dd){_0x1ccdbb({'code':0xc8,'message':_0x1d37dd['message']});})[_0x0605('0x1f')](function(_0x1310be){_0x2ad1a5(_0x5c6822[_0x0605('0x14')](0x1f4,_0x1310be[_0x0605('0x1e')]));});});}};var _0x3b7846=jayson[_0x0605('0x89')](_0x58f7d2)['http']();_0x3b7846['on'](_0x0605('0x14'),function(_0x3ca4ff){return _0x578623(_0x3ca4ff);});_0x3b7846[_0x0605('0x8')](0x232a,_0x0605('0x8a'),function(){console[_0x0605('0x8b')](_0x0605('0x8c'),0x232a);return _0xd78d96(_0x0605('0x8d')+0x232a);});});};
\ No newline at end of file
index f335574..94db8c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3bba=['redis','defaults','localhost','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data1','data2','xmd-contactid','ListId','data3','phone','$or','map','routeId','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','info','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','destcalleridnum','calleridname','<unknown>','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','name','format','trigger:%s','toLowerCase','merge','lodash','util','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact'];(function(_0x4e7d99,_0x5065b5){var _0x3b8f0e=function(_0x4e116f){while(--_0x4e116f){_0x4e7d99['push'](_0x4e7d99['shift']());}};_0x3b8f0e(++_0x5065b5);}(_0x3bba,0x174));var _0xa3bb=function(_0x4726e8,_0x31e09c){_0x4726e8=_0x4726e8-0x0;var _0x2c7a7a=_0x3bba[_0x4726e8];return _0x2c7a7a;};'use strict';var _=require(_0xa3bb('0x0'));var BPromise=require('bluebird');var Redis=require('ioredis');var util=require(_0xa3bb('0x1'));var config=require(_0xa3bb('0x2'));var logger=require(_0xa3bb('0x3'))(_0xa3bb('0x4'));var cmContactRpc=require(_0xa3bb('0x5'));config[_0xa3bb('0x6')]=_[_0xa3bb('0x7')](config[_0xa3bb('0x6')],{'host':_0xa3bb('0x8'),'port':0x18eb});var io=require(_0xa3bb('0x9'))(new Redis(config['redis']));function emit(_0x139777,_0x3d0e74,_0x4564bb,_0x56802b,_0x157018){logger['info'](_0xa3bb('0xa'),_0x139777,_0x3d0e74['id'],_0x4564bb,_0x56802b,JSON[_0xa3bb('0xb')](_0x157018));io['to'](_0x4564bb)[_0xa3bb('0xc')](_0x56802b,_0x157018);}exports[_0xa3bb('0xd')]=function(_0x2da995,_0x2ac3af,_0x50d902,_0x400c2e){var _0x1bbaa6,_0x1da092;var _0x4457e1={};var _0x10631b=Number(_0x50d902[_0xa3bb('0xe')]);var _0x5b8890=_0x50d902['data2']?Boolean(Number(_0x50d902[_0xa3bb('0xf')])):![];var _0x15ca8c;if(_0x400c2e[_0xa3bb('0x10')]){_0x4457e1['id']=_0x400c2e['xmd-contactid'];}if(!_0x4457e1['id']){_0x4457e1[_0xa3bb('0x11')]=_0x10631b;_0x15ca8c=_0x50d902[_0xa3bb('0x12')]&&_0x50d902['data3']!=='0'?_0x50d902[_0xa3bb('0x12')]['split'](','):[_0xa3bb('0x13')];_0x4457e1[_0xa3bb('0x14')]=_[_0xa3bb('0x15')](_0x15ca8c,function(_0x18658d){var _0x4366ae={};_0x4366ae[_0x18658d]=_0x400c2e[_0xa3bb('0x16')]?_0x400c2e['destcalleridnum']:_0x400c2e[_0xa3bb('0x17')];return _0x4366ae;});}var _0x69e014=['id',_0xa3bb('0x18'),_0xa3bb('0x19'),'phone',_0xa3bb('0x1a'),_0xa3bb('0x1b'),'ListId',_0xa3bb('0x1c'),_0xa3bb('0x1d'),'updatedAt'];var _0x5c65e9=_['union'](_0x69e014,_0x15ca8c);BPromise['resolve']()[_0xa3bb('0x1e')](cmContactRpc['getContacts']({'attributes':_0x5c65e9,'where':_0x4457e1}))[_0xa3bb('0x1e')](function(_0x6e276b){_0x1da092=_0x6e276b;if(!_[_0xa3bb('0x1f')](_0x1da092)){if(_0x1da092[_0xa3bb('0x20')]===0x1){_0x1bbaa6=_0x1da092[0x0];logger['info'](_0xa3bb('0x21'),_0x400c2e[_0xa3bb('0x22')],_0x2ac3af['id'],_0x1bbaa6['id']);}else{logger[_0xa3bb('0x23')](_0xa3bb('0x24'),_0x400c2e[_0xa3bb('0x22')],_0x2ac3af['id'],_[_0xa3bb('0x15')](_0x1da092,'id')['join'](','));}return;}else{logger[_0xa3bb('0x23')](_0xa3bb('0x25'),_0x400c2e['uniqueid'],_0x2ac3af['id']);var _0xe88217={'ListId':_0x10631b};var _0x4321e2=_0x50d902[_0xa3bb('0x26')]&&_0x50d902[_0xa3bb('0x26')]!=='0'?_0x50d902[_0xa3bb('0x26')]:_0xa3bb('0x13');if(_0x5b8890){logger['info'](_0xa3bb('0x27'),_0x400c2e[_0xa3bb('0x22')],_0x2ac3af['id']);_0xe88217[_0x4321e2]=_[_0xa3bb('0x28')](_0x400c2e[_0xa3bb('0x16')])?_0x400c2e[_0xa3bb('0x17')]:_0x400c2e[_0xa3bb('0x29')];if(_[_0xa3bb('0x28')](_0x400c2e['routeId'])){_0xe88217[_0xa3bb('0x18')]=_0x400c2e[_0xa3bb('0x2a')]&&_0x400c2e['calleridname']!==_0xa3bb('0x2b')?_0x400c2e[_0xa3bb('0x2a')]:_0xa3bb('0x2c');}else{_0xe88217['firstName']=_0x400c2e[_0xa3bb('0x2d')]&&_0x400c2e[_0xa3bb('0x2d')]!==_0xa3bb('0x2b')?_0x400c2e[_0xa3bb('0x2d')]:_0xa3bb('0x2c');}return BPromise['resolve']()[_0xa3bb('0x1e')](cmContactRpc[_0xa3bb('0x2e')](_0xe88217))[_0xa3bb('0x1e')](function(_0x2b5061){_0x1bbaa6=_0x2b5061;_0x1da092[_0xa3bb('0x2f')](_0x2b5061);if(_0x1bbaa6){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x400c2e[_0xa3bb('0x22')],_0x2ac3af['id'],_0x1bbaa6['id']);}return;});}else{logger['info'](_0xa3bb('0x30'),_0x400c2e[_0xa3bb('0x22')],_0x2ac3af['id']);_0xe88217[_0x4321e2]=_[_0xa3bb('0x28')](_0x400c2e[_0xa3bb('0x16')])?_0x400c2e[_0xa3bb('0x17')]:_0x400c2e[_0xa3bb('0x29')];if(_[_0xa3bb('0x28')](_0x400c2e['routeId'])){_0xe88217[_0xa3bb('0x18')]=_0x400c2e[_0xa3bb('0x2a')]&&_0x400c2e[_0xa3bb('0x2a')]!==_0xa3bb('0x2b')?_0x400c2e['calleridname']:_0xa3bb('0x2c');}else{_0xe88217[_0xa3bb('0x18')]=_0x400c2e[_0xa3bb('0x2d')]&&_0x400c2e[_0xa3bb('0x2d')]!=='<unknown>'?_0x400c2e[_0xa3bb('0x2d')]:_0xa3bb('0x2c');}_0x1bbaa6=_0xe88217;_0x1da092['push'](_0xe88217);return;}}})['then'](function(){if(_0x2da995){emit(_0x400c2e['uniqueid'],_0x2ac3af,util['format']('user:%s',_0x2da995[_0xa3bb('0x31')]),util[_0xa3bb('0x32')](_0xa3bb('0x33'),_0x50d902['action'][_0xa3bb('0x34')]()),{'evt':_[_0xa3bb('0x35')](_0x400c2e,{'autoCreate':_0x5b8890}),'contact':_0x1bbaa6===undefined?{}:_0x1bbaa6,'contacts':_0x1da092[_0xa3bb('0x20')]===0x0?undefined:_0x1da092});}});};
\ No newline at end of file
+var _0x90fb=['push','[CM][%s][%s]\x20Contact\x20created:%s','destcalleridnum','format','user:%s','name','toLowerCase','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','localhost','socket.io-emitter','[CM][%s][%s]','stringify','emit','exec','data2','xmd-contactid','ListId','data3','split','phone','$or','map','calleridnum','lastName','mobile','createdAt','updatedAt','union','then','isEmpty','length','info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','isNil','firstName','calleridname','<unknown>','Unknown','destcalleridname','resolve','createContact'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x90fb,0xd7));var _0xb90f=function(_0x31659b,_0x3f07a1){_0x31659b=_0x31659b-0x0;var _0x48b140=_0x90fb[_0x31659b];return _0x48b140;};'use strict';var _=require('lodash');var BPromise=require(_0xb90f('0x0'));var Redis=require(_0xb90f('0x1'));var util=require(_0xb90f('0x2'));var config=require(_0xb90f('0x3'));var logger=require('../../../../config/logger')(_0xb90f('0x4'));var cmContactRpc=require(_0xb90f('0x5'));config[_0xb90f('0x6')]=_['defaults'](config[_0xb90f('0x6')],{'host':_0xb90f('0x7'),'port':0x18eb});var io=require(_0xb90f('0x8'))(new Redis(config[_0xb90f('0x6')]));function emit(_0x2fa396,_0x35b997,_0x5a52dd,_0xc14f25,_0x5b992f){logger['info'](_0xb90f('0x9'),_0x2fa396,_0x35b997['id'],_0x5a52dd,_0xc14f25,JSON[_0xb90f('0xa')](_0x5b992f));io['to'](_0x5a52dd)[_0xb90f('0xb')](_0xc14f25,_0x5b992f);}exports[_0xb90f('0xc')]=function(_0x7b8a1d,_0x15c60b,_0xeae871,_0x2a6ef1){var _0x80ef36,_0xc6abe7;var _0x58c390={};var _0x1da094=Number(_0xeae871['data1']);var _0x2e9c95=_0xeae871['data2']?Boolean(Number(_0xeae871[_0xb90f('0xd')])):![];var _0x12fb33;if(_0x2a6ef1[_0xb90f('0xe')]){_0x58c390['id']=_0x2a6ef1[_0xb90f('0xe')];}if(!_0x58c390['id']){_0x58c390[_0xb90f('0xf')]=_0x1da094;_0x12fb33=_0xeae871[_0xb90f('0x10')]&&_0xeae871[_0xb90f('0x10')]!=='0'?_0xeae871[_0xb90f('0x10')][_0xb90f('0x11')](','):[_0xb90f('0x12')];_0x58c390[_0xb90f('0x13')]=_[_0xb90f('0x14')](_0x12fb33,function(_0x50c0e4){var _0xec49d6={};_0xec49d6[_0x50c0e4]=_0x2a6ef1['routeId']?_0x2a6ef1['destcalleridnum']:_0x2a6ef1[_0xb90f('0x15')];return _0xec49d6;});}var _0x230048=['id','firstName',_0xb90f('0x16'),_0xb90f('0x12'),_0xb90f('0x17'),'fax',_0xb90f('0xf'),_0xb90f('0x18'),'scheduledAt',_0xb90f('0x19')];var _0x1825b3=_[_0xb90f('0x1a')](_0x230048,_0x12fb33);BPromise['resolve']()['then'](cmContactRpc['getContacts']({'attributes':_0x1825b3,'where':_0x58c390}))[_0xb90f('0x1b')](function(_0x5a708e){_0xc6abe7=_0x5a708e;if(!_[_0xb90f('0x1c')](_0xc6abe7)){if(_0xc6abe7[_0xb90f('0x1d')]===0x1){_0x80ef36=_0xc6abe7[0x0];logger[_0xb90f('0x1e')](_0xb90f('0x1f'),_0x2a6ef1[_0xb90f('0x20')],_0x15c60b['id'],_0x80ef36['id']);}else{logger[_0xb90f('0x1e')](_0xb90f('0x21'),_0x2a6ef1['uniqueid'],_0x15c60b['id'],_[_0xb90f('0x14')](_0xc6abe7,'id')[_0xb90f('0x22')](','));}return;}else{logger[_0xb90f('0x1e')](_0xb90f('0x23'),_0x2a6ef1[_0xb90f('0x20')],_0x15c60b['id']);var _0x26b9e1={'ListId':_0x1da094};var _0x2a4b04=_0xeae871[_0xb90f('0x24')]&&_0xeae871[_0xb90f('0x24')]!=='0'?_0xeae871['data4']:_0xb90f('0x12');if(_0x2e9c95){logger[_0xb90f('0x1e')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x2a6ef1[_0xb90f('0x20')],_0x15c60b['id']);_0x26b9e1[_0x2a4b04]=_[_0xb90f('0x25')](_0x2a6ef1['routeId'])?_0x2a6ef1['calleridnum']:_0x2a6ef1['destcalleridnum'];if(_[_0xb90f('0x25')](_0x2a6ef1['routeId'])){_0x26b9e1[_0xb90f('0x26')]=_0x2a6ef1[_0xb90f('0x27')]&&_0x2a6ef1['calleridname']!==_0xb90f('0x28')?_0x2a6ef1[_0xb90f('0x27')]:_0xb90f('0x29');}else{_0x26b9e1[_0xb90f('0x26')]=_0x2a6ef1[_0xb90f('0x2a')]&&_0x2a6ef1['destcalleridname']!==_0xb90f('0x28')?_0x2a6ef1[_0xb90f('0x2a')]:'Unknown';}return BPromise[_0xb90f('0x2b')]()['then'](cmContactRpc[_0xb90f('0x2c')](_0x26b9e1))['then'](function(_0x4ebd38){_0x80ef36=_0x4ebd38;_0xc6abe7[_0xb90f('0x2d')](_0x4ebd38);if(_0x80ef36){logger[_0xb90f('0x1e')](_0xb90f('0x2e'),_0x2a6ef1[_0xb90f('0x20')],_0x15c60b['id'],_0x80ef36['id']);}return;});}else{logger[_0xb90f('0x1e')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x2a6ef1['uniqueid'],_0x15c60b['id']);_0x26b9e1[_0x2a4b04]=_['isNil'](_0x2a6ef1['routeId'])?_0x2a6ef1['calleridnum']:_0x2a6ef1[_0xb90f('0x2f')];if(_[_0xb90f('0x25')](_0x2a6ef1['routeId'])){_0x26b9e1[_0xb90f('0x26')]=_0x2a6ef1[_0xb90f('0x27')]&&_0x2a6ef1['calleridname']!==_0xb90f('0x28')?_0x2a6ef1['calleridname']:'Unknown';}else{_0x26b9e1[_0xb90f('0x26')]=_0x2a6ef1[_0xb90f('0x2a')]&&_0x2a6ef1[_0xb90f('0x2a')]!==_0xb90f('0x28')?_0x2a6ef1[_0xb90f('0x2a')]:_0xb90f('0x29');}_0x80ef36=_0x26b9e1;_0xc6abe7['push'](_0x26b9e1);return;}}})[_0xb90f('0x1b')](function(){if(_0x7b8a1d){emit(_0x2a6ef1[_0xb90f('0x20')],_0x15c60b,util[_0xb90f('0x30')](_0xb90f('0x31'),_0x7b8a1d[_0xb90f('0x32')]),util[_0xb90f('0x30')]('trigger:%s',_0xeae871['action'][_0xb90f('0x33')]()),{'evt':_['merge'](_0x2a6ef1,{'autoCreate':_0x2e9c95}),'contact':_0x80ef36===undefined?{}:_0x80ef36,'contacts':_0xc6abe7['length']===0x0?undefined:_0xc6abe7});}});};
\ No newline at end of file
index fbb4087..7a85619 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3f5=['buildUri','parse','query','replace','log','channel','AllConditions','every','checkConditions','AnyConditions','triggerChannel\x20&&\x20triggerEvery\x20&&\x20triggerSome','field','chat','operator','value','ChatWebsiteId','AccountId','upperFirst','message','event','agent','membername','lastevent','exports','util','lodash','url','ioredis','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','defaults','redis','localhost','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','bind','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','checkTriggers','interface','status','checkTrigger','merge','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data2','html','template\x20not\x20found','uri','isNil','data3','data4','location','windowWidth','data5','800','windowHeight','data6','600','render','format','user:%s','name','data1','jscripty','trigger:%s','exec','queue','voiceExtensions','routeId','urlforward','script'];(function(_0x45fa89,_0x24dc48){var _0x130d9e=function(_0x5b46bb){while(--_0x5b46bb){_0x45fa89['push'](_0x45fa89['shift']());}};_0x130d9e(++_0x24dc48);}(_0xa3f5,0x177));var _0x5a3f=function(_0x5f23a8,_0x1f6a2c){_0x5f23a8=_0x5f23a8-0x0;var _0x50c70a=_0xa3f5[_0x5f23a8];return _0x50c70a;};'use strict';var util=require(_0x5a3f('0x0'));var _=require(_0x5a3f('0x1'));var url=require(_0x5a3f('0x2'));var Mustache=require('mustache');var Redis=require(_0x5a3f('0x3'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0x5a3f('0x4'));var script=require(_0x5a3f('0x5'));var config=require(_0x5a3f('0x6'));var logger=require(_0x5a3f('0x7'))(_0x5a3f('0x8'));var ami=require('../ami');config['redis']=_[_0x5a3f('0x9')](config[_0x5a3f('0xa')],{'host':_0x5a3f('0xb'),'port':0x18eb});var io=require(_0x5a3f('0xc'))(new Redis(config[_0x5a3f('0xa')]));var operators={'equals':function(_0x5c0b6f,_0x4830b9){return _0x5c0b6f==_0x4830b9;},'not_equals':function(_0x4025d6,_0x40cb8f){return _0x4025d6!=_0x40cb8f;}};var barAndWebActions=['popup',_0x5a3f('0x2'),_0x5a3f('0xd')];function Trigger(_0x30b1c0){this[_0x5a3f('0xe')]=_0x30b1c0[_0x5a3f('0xe')];this[_0x5a3f('0xf')]=_0x30b1c0[_0x5a3f('0xf')];this[_0x5a3f('0x10')]=_0x30b1c0['voiceQueues'];this[_0x5a3f('0x11')]=_0x30b1c0[_0x5a3f('0x11')];this['voiceExtensions']=_0x30b1c0['voiceExtensions'];this[_0x5a3f('0x12')]=_0x30b1c0[_0x5a3f('0x12')];this['freshdeskAccounts']=_0x30b1c0[_0x5a3f('0x13')];this[_0x5a3f('0x14')]=_0x30b1c0[_0x5a3f('0x14')];this[_0x5a3f('0x15')]=_0x30b1c0[_0x5a3f('0x15')];this[_0x5a3f('0x16')]=_0x30b1c0['zohoAccounts'];this[_0x5a3f('0x17')]=_0x30b1c0['deskAccounts'];this['vtigerAccounts']=_0x30b1c0[_0x5a3f('0x18')];this[_0x5a3f('0x19')]=_0x30b1c0[_0x5a3f('0x19')];this['dynamics365Accounts']=_0x30b1c0[_0x5a3f('0x1a')];this[_0x5a3f('0x1b')]=_0x30b1c0[_0x5a3f('0x1b')];this['accounts']={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x5a3f('0x14')],'freshdesk':this[_0x5a3f('0x13')],'sugarcrm':this[_0x5a3f('0x15')],'zoho':this['zohoAccounts'],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x5a3f('0x1b')],'servicenow':this[_0x5a3f('0x19')]};ami['on'](_0x5a3f('0x1c'),this['syncCustomEvent'][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x1e'),this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x20'),this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x21'),this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x22'),this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x23'),this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x24'),this['syncCustomEvent']['bind'](this));ami['on'](_0x5a3f('0x25'),this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x26'),this['syncCustomEvent'][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0x5a3f('0x28'),this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x29'),this['syncAgentDial'][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x2a'),this[_0x5a3f('0x2b')][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x2c'),this[_0x5a3f('0x2b')]['bind'](this));ami['on'](_0x5a3f('0x2d'),this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));ami['on']('custom:closedinteraction',this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x2e'),this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x2f'),this['syncCustomEvent']['bind'](this));ami['on']('custom:acceptmessage',this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));ami['on'](_0x5a3f('0x30'),this[_0x5a3f('0x1f')][_0x5a3f('0x1d')](this));}Trigger[_0x5a3f('0x31')][_0x5a3f('0x32')]=function(_0x3f4001,_0xad90fe,_0x29e8ca){logger[_0x5a3f('0x33')](_0x3f4001,_0xad90fe,JSON[_0x5a3f('0x34')](_0x29e8ca));io['to'](_0x3f4001)[_0x5a3f('0x32')](_0xad90fe,_0x29e8ca);};Trigger['prototype']['syncCustomEvent']=function(_0x716007){var _0x6c7389=_[_0x5a3f('0x35')](_0x716007);this[_0x5a3f('0x36')](_0x6c7389);};Trigger[_0x5a3f('0x31')][_0x5a3f('0x2b')]=function(_0x329685){if(this[_0x5a3f('0xf')][_0x329685[_0x5a3f('0x37')]]){this['syncCustomEvent'](_0x329685);}};Trigger['prototype'][_0x5a3f('0x36')]=function(_0xdce0cf){var _0xdebb4d;for(var _0x43484a in this[_0x5a3f('0xe')]){if(this[_0x5a3f('0xe')]['hasOwnProperty'](_0x43484a)){if(this[_0x5a3f('0xe')][_0x43484a][_0x5a3f('0x38')]){_0xdebb4d=this[_0x5a3f('0x39')](this[_0x5a3f('0xe')][_0x43484a],_0xdce0cf);if(_0xdebb4d){_[_0x5a3f('0x3a')](_0xdce0cf,_0xdce0cf['variables']);for(var _0x36e871=0x0,_0x96bd55,_0x562638,_0x5f4c60;_0x36e871<this['triggers'][_0x43484a][_0x5a3f('0x3b')][_0x5a3f('0x3c')];_0x36e871+=0x1){_0x96bd55=this[_0x5a3f('0xe')][_0x43484a][_0x5a3f('0x3b')][_0x36e871];if(this['agents'][_0xdce0cf[_0x5a3f('0x37')]]){switch(_0x96bd55[_0x5a3f('0x3d')][_0x5a3f('0x3e')]()){case _0x5a3f('0x3f'):break;case _0x5a3f('0x40'):case _0x5a3f('0x41'):var _0x209088={};switch(barAndWebActions[_0x96bd55['data1']]){case'popup':_0x209088['TemplateId']=_0x96bd55[_0x5a3f('0x42')];_0x209088[_0x5a3f('0x43')]=this[_0x5a3f('0x11')][_0x96bd55['data2']]?Mustache['render'](this[_0x5a3f('0x11')][_0x96bd55[_0x5a3f('0x42')]][_0x5a3f('0x43')],_0xdce0cf):_0x5a3f('0x44');break;case _0x5a3f('0x2'):_0x209088[_0x5a3f('0x45')]=this['buildUri'](_0x96bd55[_0x5a3f('0x42')],_0xdce0cf,_[_0x5a3f('0x46')](_0x96bd55[_0x5a3f('0x47')])?!![]:parseInt(_0x96bd55[_0x5a3f('0x47')],0xa));if(_[_0x5a3f('0x46')](_0x96bd55[_0x5a3f('0x48')])){_0x209088[_0x5a3f('0x49')]='0';}else{_0x209088['uriLocation']=_0x96bd55[_0x5a3f('0x48')];_0x209088[_0x5a3f('0x4a')]=_['isNil'](_0x96bd55[_0x5a3f('0x4b')])?_0x5a3f('0x4c'):_0x96bd55['data5'];_0x209088[_0x5a3f('0x4d')]=_[_0x5a3f('0x46')](_0x96bd55[_0x5a3f('0x4e')])?_0x5a3f('0x4f'):_0x96bd55[_0x5a3f('0x4e')];}break;case _0x5a3f('0xd'):_0x209088['winApplication']=_0x96bd55[_0x5a3f('0x42')]?Mustache[_0x5a3f('0x50')](_0x96bd55[_0x5a3f('0x42')],_0xdce0cf):'';_0x209088['winArguments']=_0x96bd55[_0x5a3f('0x47')]?Mustache[_0x5a3f('0x50')](_0x96bd55[_0x5a3f('0x47')],_0xdce0cf):'';break;}this[_0x5a3f('0x32')](util[_0x5a3f('0x51')](_0x5a3f('0x52'),this[_0x5a3f('0xf')][_0xdce0cf['interface']][_0x5a3f('0x53')]),util['format']('trigger:%s:%s',_0x96bd55[_0x5a3f('0x3d')][_0x5a3f('0x3e')](),barAndWebActions[_0x96bd55[_0x5a3f('0x54')]]),_[_0x5a3f('0x3a')](_0x209088,_0xdce0cf));break;case _0x5a3f('0x55'):this['emit'](util[_0x5a3f('0x51')](_0x5a3f('0x52'),this[_0x5a3f('0xf')][_0xdce0cf[_0x5a3f('0x37')]][_0x5a3f('0x53')]),util[_0x5a3f('0x51')](_0x5a3f('0x56'),_0x96bd55[_0x5a3f('0x3d')]['toLowerCase']()),_['merge']({'ProjectId':parseInt(_0x96bd55[_0x5a3f('0x54')],0xa)},_0xdce0cf));break;default:this[_0x5a3f('0x32')](util[_0x5a3f('0x51')]('user:%s',this['agents'][_0xdce0cf['interface']]['name']),util[_0x5a3f('0x51')](_0x5a3f('0x56'),_0x96bd55[_0x5a3f('0x3d')][_0x5a3f('0x3e')]()),_[_0x5a3f('0x3a')]({},_0x96bd55,_0xdce0cf));}}switch(_0x96bd55['action'][_0x5a3f('0x3e')]()){case _0x5a3f('0x3f'):cmContact[_0x5a3f('0x57')](this[_0x5a3f('0xf')][_0xdce0cf[_0x5a3f('0x37')]],this[_0x5a3f('0xe')][_0x43484a],_0x96bd55,_0xdce0cf);break;case'integration':integration['exec'](_0x96bd55,_0xdce0cf,this['accounts'],this[_0x5a3f('0xf')][_0xdce0cf[_0x5a3f('0x37')]],this[_0x5a3f('0x10')][_0xdce0cf[_0x5a3f('0x58')]],this[_0x5a3f('0x59')][_0xdce0cf[_0x5a3f('0x5a')]]);break;case _0x5a3f('0x5b'):urlforward[_0x5a3f('0x57')](_0x96bd55,_0xdce0cf);break;case _0x5a3f('0x5c'):script[_0x5a3f('0x57')](_0x96bd55,_0xdce0cf);break;}}}}}}};Trigger[_0x5a3f('0x31')][_0x5a3f('0x5d')]=function(_0x1f7724,_0x2ec000,_0x3c6cd4){var _0x232fac=url[_0x5a3f('0x5e')](Mustache[_0x5a3f('0x50')](_0x1f7724,_0x2ec000),!![]);if(_0x3c6cd4){_[_0x5a3f('0x3a')](_0x232fac[_0x5a3f('0x5f')],_0x2ec000);}delete _0x232fac['search'];var _0x54888d=url[_0x5a3f('0x51')](_0x232fac);_0x54888d=_0x54888d[_0x5a3f('0x60')](/\/\?/g,'?');return _0x54888d;};Trigger[_0x5a3f('0x31')][_0x5a3f('0x39')]=function(_0x37f01b,_0x3dca34){var _0x2c5e23=!![];var _0x388834=!![];var _0x1978af=![];console[_0x5a3f('0x61')]('trigger.channel,\x20evt.channel',_0x37f01b['channel'],_0x3dca34[_0x5a3f('0x62')]);if(_0x37f01b[_0x5a3f('0x62')]===_0x3dca34[_0x5a3f('0x62')]){_0x1978af=!![];}if(_0x37f01b[_0x5a3f('0x63')][_0x5a3f('0x3c')]){_0x2c5e23=_[_0x5a3f('0x64')](_0x37f01b[_0x5a3f('0x63')],this[_0x5a3f('0x65')](_0x3dca34,_0x37f01b[_0x5a3f('0x62')]));}if(_0x37f01b[_0x5a3f('0x66')][_0x5a3f('0x3c')]){_0x388834=_['some'](_0x37f01b[_0x5a3f('0x66')],this[_0x5a3f('0x65')](_0x3dca34,_0x37f01b[_0x5a3f('0x62')]));}console[_0x5a3f('0x61')](_0x5a3f('0x67'),_0x1978af&&_0x2c5e23&&_0x388834);return _0x1978af&&_0x2c5e23&&_0x388834;};Trigger[_0x5a3f('0x31')][_0x5a3f('0x65')]=function(_0x37aa68,_0x54d04b){return function(_0xf8a860){switch(_0xf8a860[_0x5a3f('0x68')]){case'account':if(_0x37aa68['channel']===_0x54d04b){if(_0x54d04b===_0x5a3f('0x69')){return _0x37aa68['ChatWebsiteId']?operators[_0xf8a860[_0x5a3f('0x6a')]](Number(_0xf8a860[_0x5a3f('0x6b')]),_0x37aa68[_0x5a3f('0x6c')]):![];}else{return _0x37aa68[_['upperFirst'](_0x54d04b)+_0x5a3f('0x6d')]?operators[_0xf8a860[_0x5a3f('0x6a')]](Number(_0xf8a860['value']),_0x37aa68[_[_0x5a3f('0x6e')](_0x54d04b)+_0x5a3f('0x6d')]):![];}}break;case'interaction':case _0x5a3f('0x6f'):if(_0x37aa68[_0x5a3f('0x62')]===_0x54d04b){return _0x37aa68[_0x5a3f('0x70')]?operators[_0xf8a860[_0x5a3f('0x6a')]](_0xf8a860[_0x5a3f('0x6b')],_0x37aa68[_0x5a3f('0x70')]):![];}break;case'queue':return _0x37aa68[_0x5a3f('0x58')]?operators[_0xf8a860['operator']](_0xf8a860[_0x5a3f('0x6b')],_0x37aa68[_0x5a3f('0x58')]):![];case _0x5a3f('0x71'):return _0x37aa68[_0x5a3f('0x72')]?operators[_0xf8a860[_0x5a3f('0x6a')]](_0xf8a860[_0x5a3f('0x6b')],_0x37aa68['membername']):![];case _0x5a3f('0x73'):return _0x37aa68[_0x5a3f('0x73')]?operators[_0xf8a860[_0x5a3f('0x6a')]](_0xf8a860[_0x5a3f('0x6b')],_0x37aa68[_0x5a3f('0x73')]):![];case _0x5a3f('0x5a'):return _0x37aa68[_0x5a3f('0x5a')]?operators[_0xf8a860[_0x5a3f('0x6a')]](_0xf8a860[_0x5a3f('0x6b')],_0x37aa68[_0x5a3f('0x5a')]):![];}return![];};};module[_0x5a3f('0x74')]=Trigger;
\ No newline at end of file
+var _0x7bd5=['vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','custom:agentconnect','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','custom:dialend','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','interface','checkTriggers','status','checkTrigger','variables','Actions','length','action','contactmanager','motionbar','data1','TemplateId','data2','html','templates','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','800','data5','windowHeight','data6','winApplication','winArguments','format','user:%s','trigger:%s:%s','merge','name','trigger:%s','toLowerCase','exec','integration','queue','routeId','urlforward','script','parse','query','log','trigger.channel,\x20evt.channel','channel','AllConditions','checkConditions','AnyConditions','triggerChannel\x20&&\x20triggerEvery\x20&&\x20triggerSome','ChatWebsiteId','operator','value','AccountId','upperFirst','interaction','message','event','membername','lastevent','util','lodash','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts'];(function(_0x3276e1,_0x3f65bd){var _0x437fb4=function(_0x232cc2){while(--_0x232cc2){_0x3276e1['push'](_0x3276e1['shift']());}};_0x437fb4(++_0x3f65bd);}(_0x7bd5,0xd4));var _0x57bd=function(_0x36a235,_0x1f306e){_0x36a235=_0x36a235-0x0;var _0x376dba=_0x7bd5[_0x36a235];return _0x376dba;};'use strict';var util=require(_0x57bd('0x0'));var _=require(_0x57bd('0x1'));var url=require(_0x57bd('0x2'));var Mustache=require(_0x57bd('0x3'));var Redis=require('ioredis');var urlforward=require(_0x57bd('0x4'));var integration=require(_0x57bd('0x5'));var cmContact=require(_0x57bd('0x6'));var script=require(_0x57bd('0x7'));var config=require(_0x57bd('0x8'));var logger=require(_0x57bd('0x9'))(_0x57bd('0xa'));var ami=require(_0x57bd('0xb'));config[_0x57bd('0xc')]=_[_0x57bd('0xd')](config[_0x57bd('0xc')],{'host':_0x57bd('0xe'),'port':0x18eb});var io=require(_0x57bd('0xf'))(new Redis(config['redis']));var operators={'equals':function(_0x2865da,_0x145f5e){return _0x2865da==_0x145f5e;},'not_equals':function(_0x4179b1,_0x49dbee){return _0x4179b1!=_0x49dbee;}};var barAndWebActions=[_0x57bd('0x10'),_0x57bd('0x2'),_0x57bd('0x11')];function Trigger(_0x24f2e3){this['triggers']=_0x24f2e3[_0x57bd('0x12')];this[_0x57bd('0x13')]=_0x24f2e3[_0x57bd('0x13')];this[_0x57bd('0x14')]=_0x24f2e3[_0x57bd('0x14')];this['templates']=_0x24f2e3['templates'];this[_0x57bd('0x15')]=_0x24f2e3[_0x57bd('0x15')];this[_0x57bd('0x16')]=_0x24f2e3[_0x57bd('0x16')];this['freshdeskAccounts']=_0x24f2e3[_0x57bd('0x17')];this[_0x57bd('0x18')]=_0x24f2e3['salesforceAccounts'];this[_0x57bd('0x19')]=_0x24f2e3[_0x57bd('0x19')];this[_0x57bd('0x1a')]=_0x24f2e3[_0x57bd('0x1a')];this[_0x57bd('0x1b')]=_0x24f2e3[_0x57bd('0x1b')];this[_0x57bd('0x1c')]=_0x24f2e3[_0x57bd('0x1c')];this[_0x57bd('0x1d')]=_0x24f2e3[_0x57bd('0x1d')];this['dynamics365Accounts']=_0x24f2e3[_0x57bd('0x1e')];this[_0x57bd('0x1f')]=_0x24f2e3['freshsalesAccounts'];this[_0x57bd('0x20')]={'zendesk':this[_0x57bd('0x16')],'salesforce':this[_0x57bd('0x18')],'freshdesk':this[_0x57bd('0x17')],'sugarcrm':this[_0x57bd('0x19')],'zoho':this[_0x57bd('0x1a')],'desk':this[_0x57bd('0x1b')],'vtiger':this[_0x57bd('0x1c')],'dynamics365':this[_0x57bd('0x1e')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x57bd('0x1d')]};ami['on'](_0x57bd('0x21'),this['syncCustomEvent']['bind'](this));ami['on'](_0x57bd('0x22'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x25'),this[_0x57bd('0x23')]['bind'](this));ami['on'](_0x57bd('0x26'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x27'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x28'),this[_0x57bd('0x23')]['bind'](this));ami['on'](_0x57bd('0x29'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on']('custom:agentcongestion',this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on']('custom:agentreject',this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on']('custom:amd',this[_0x57bd('0x23')]['bind'](this));ami['on'](_0x57bd('0x2a'),this['syncCustomEvent'][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x2b'),this[_0x57bd('0x23')]['bind'](this));ami['on'](_0x57bd('0x2c'),this['syncAgentDial'][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x2d'),this['syncAgentDial'][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x2e'),this[_0x57bd('0x2f')]['bind'](this));ami['on'](_0x57bd('0x30'),this[_0x57bd('0x23')]['bind'](this));ami['on'](_0x57bd('0x31'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x32'),this['syncCustomEvent'][_0x57bd('0x24')](this));ami['on']('custom:outgoingmessage',this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x33'),this[_0x57bd('0x23')][_0x57bd('0x24')](this));ami['on'](_0x57bd('0x34'),this[_0x57bd('0x23')]['bind'](this));}Trigger[_0x57bd('0x35')][_0x57bd('0x36')]=function(_0x165416,_0x111a04,_0x2f0572){logger[_0x57bd('0x37')](_0x165416,_0x111a04,JSON[_0x57bd('0x38')](_0x2f0572));io['to'](_0x165416)[_0x57bd('0x36')](_0x111a04,_0x2f0572);};Trigger['prototype'][_0x57bd('0x23')]=function(_0x4650eb){var _0x28e63e=_['clone'](_0x4650eb);this['checkTriggers'](_0x28e63e);};Trigger['prototype'][_0x57bd('0x2f')]=function(_0x4c4a85){if(this['agents'][_0x4c4a85[_0x57bd('0x39')]]){this[_0x57bd('0x23')](_0x4c4a85);}};Trigger['prototype'][_0x57bd('0x3a')]=function(_0x301b13){var _0x3e4a03;for(var _0x26df31 in this[_0x57bd('0x12')]){if(this[_0x57bd('0x12')]['hasOwnProperty'](_0x26df31)){if(this[_0x57bd('0x12')][_0x26df31][_0x57bd('0x3b')]){_0x3e4a03=this[_0x57bd('0x3c')](this[_0x57bd('0x12')][_0x26df31],_0x301b13);if(_0x3e4a03){_['merge'](_0x301b13,_0x301b13[_0x57bd('0x3d')]);for(var _0x57827c=0x0,_0x1fbdc0,_0x4c68a0,_0x1abd9a;_0x57827c<this[_0x57bd('0x12')][_0x26df31][_0x57bd('0x3e')][_0x57bd('0x3f')];_0x57827c+=0x1){_0x1fbdc0=this[_0x57bd('0x12')][_0x26df31][_0x57bd('0x3e')][_0x57827c];if(this[_0x57bd('0x13')][_0x301b13[_0x57bd('0x39')]]){switch(_0x1fbdc0[_0x57bd('0x40')]['toLowerCase']()){case _0x57bd('0x41'):break;case _0x57bd('0x42'):case'browser':var _0x4cd001={};switch(barAndWebActions[_0x1fbdc0[_0x57bd('0x43')]]){case'popup':_0x4cd001[_0x57bd('0x44')]=_0x1fbdc0[_0x57bd('0x45')];_0x4cd001[_0x57bd('0x46')]=this[_0x57bd('0x47')][_0x1fbdc0['data2']]?Mustache[_0x57bd('0x48')](this[_0x57bd('0x47')][_0x1fbdc0[_0x57bd('0x45')]][_0x57bd('0x46')],_0x301b13):_0x57bd('0x49');break;case _0x57bd('0x2'):_0x4cd001[_0x57bd('0x4a')]=this[_0x57bd('0x4b')](_0x1fbdc0[_0x57bd('0x45')],_0x301b13,_[_0x57bd('0x4c')](_0x1fbdc0[_0x57bd('0x4d')])?!![]:parseInt(_0x1fbdc0['data3'],0xa));if(_[_0x57bd('0x4c')](_0x1fbdc0[_0x57bd('0x4e')])){_0x4cd001[_0x57bd('0x4f')]='0';}else{_0x4cd001[_0x57bd('0x50')]=_0x1fbdc0[_0x57bd('0x4e')];_0x4cd001[_0x57bd('0x51')]=_[_0x57bd('0x4c')](_0x1fbdc0['data5'])?_0x57bd('0x52'):_0x1fbdc0[_0x57bd('0x53')];_0x4cd001[_0x57bd('0x54')]=_[_0x57bd('0x4c')](_0x1fbdc0[_0x57bd('0x55')])?'600':_0x1fbdc0['data6'];}break;case _0x57bd('0x11'):_0x4cd001[_0x57bd('0x56')]=_0x1fbdc0['data2']?Mustache[_0x57bd('0x48')](_0x1fbdc0[_0x57bd('0x45')],_0x301b13):'';_0x4cd001[_0x57bd('0x57')]=_0x1fbdc0['data3']?Mustache[_0x57bd('0x48')](_0x1fbdc0[_0x57bd('0x4d')],_0x301b13):'';break;}this[_0x57bd('0x36')](util[_0x57bd('0x58')](_0x57bd('0x59'),this[_0x57bd('0x13')][_0x301b13['interface']]['name']),util[_0x57bd('0x58')](_0x57bd('0x5a'),_0x1fbdc0[_0x57bd('0x40')]['toLowerCase'](),barAndWebActions[_0x1fbdc0[_0x57bd('0x43')]]),_[_0x57bd('0x5b')](_0x4cd001,_0x301b13));break;case'jscripty':this[_0x57bd('0x36')](util[_0x57bd('0x58')](_0x57bd('0x59'),this['agents'][_0x301b13[_0x57bd('0x39')]][_0x57bd('0x5c')]),util[_0x57bd('0x58')](_0x57bd('0x5d'),_0x1fbdc0[_0x57bd('0x40')]['toLowerCase']()),_['merge']({'ProjectId':parseInt(_0x1fbdc0[_0x57bd('0x43')],0xa)},_0x301b13));break;default:this[_0x57bd('0x36')](util[_0x57bd('0x58')]('user:%s',this[_0x57bd('0x13')][_0x301b13[_0x57bd('0x39')]][_0x57bd('0x5c')]),util[_0x57bd('0x58')](_0x57bd('0x5d'),_0x1fbdc0[_0x57bd('0x40')][_0x57bd('0x5e')]()),_[_0x57bd('0x5b')]({},_0x1fbdc0,_0x301b13));}}switch(_0x1fbdc0[_0x57bd('0x40')]['toLowerCase']()){case _0x57bd('0x41'):cmContact[_0x57bd('0x5f')](this['agents'][_0x301b13[_0x57bd('0x39')]],this['triggers'][_0x26df31],_0x1fbdc0,_0x301b13);break;case _0x57bd('0x60'):integration['exec'](_0x1fbdc0,_0x301b13,this[_0x57bd('0x20')],this['agents'][_0x301b13[_0x57bd('0x39')]],this[_0x57bd('0x14')][_0x301b13[_0x57bd('0x61')]],this['voiceExtensions'][_0x301b13[_0x57bd('0x62')]]);break;case _0x57bd('0x63'):urlforward[_0x57bd('0x5f')](_0x1fbdc0,_0x301b13);break;case _0x57bd('0x64'):script[_0x57bd('0x5f')](_0x1fbdc0,_0x301b13);break;}}}}}}};Trigger['prototype'][_0x57bd('0x4b')]=function(_0x3b5f19,_0x3ec62f,_0x83f49a){var _0x643b35=url[_0x57bd('0x65')](Mustache[_0x57bd('0x48')](_0x3b5f19,_0x3ec62f),!![]);if(_0x83f49a){_[_0x57bd('0x5b')](_0x643b35[_0x57bd('0x66')],_0x3ec62f);}delete _0x643b35['search'];var _0x44f762=url[_0x57bd('0x58')](_0x643b35);_0x44f762=_0x44f762['replace'](/\/\?/g,'?');return _0x44f762;};Trigger['prototype'][_0x57bd('0x3c')]=function(_0x126338,_0x37e683){var _0x6b9d71=!![];var _0x305d2f=!![];var _0x15e6f6=![];console[_0x57bd('0x67')](_0x57bd('0x68'),_0x126338[_0x57bd('0x69')],_0x37e683['channel']);if(_0x126338[_0x57bd('0x69')]===_0x37e683['channel']){_0x15e6f6=!![];}if(_0x126338[_0x57bd('0x6a')][_0x57bd('0x3f')]){_0x6b9d71=_['every'](_0x126338['AllConditions'],this[_0x57bd('0x6b')](_0x37e683,_0x126338['channel']));}if(_0x126338['AnyConditions']['length']){_0x305d2f=_['some'](_0x126338[_0x57bd('0x6c')],this[_0x57bd('0x6b')](_0x37e683,_0x126338['channel']));}console[_0x57bd('0x67')](_0x57bd('0x6d'),_0x15e6f6&&_0x6b9d71&&_0x305d2f);return _0x15e6f6&&_0x6b9d71&&_0x305d2f;};Trigger[_0x57bd('0x35')][_0x57bd('0x6b')]=function(_0x17b157,_0x3ccbbe){return function(_0x198a82){switch(_0x198a82['field']){case'account':if(_0x17b157['channel']===_0x3ccbbe){if(_0x3ccbbe==='chat'){return _0x17b157[_0x57bd('0x6e')]?operators[_0x198a82[_0x57bd('0x6f')]](Number(_0x198a82[_0x57bd('0x70')]),_0x17b157['ChatWebsiteId']):![];}else{return _0x17b157[_['upperFirst'](_0x3ccbbe)+_0x57bd('0x71')]?operators[_0x198a82[_0x57bd('0x6f')]](Number(_0x198a82[_0x57bd('0x70')]),_0x17b157[_[_0x57bd('0x72')](_0x3ccbbe)+_0x57bd('0x71')]):![];}}break;case _0x57bd('0x73'):case _0x57bd('0x74'):if(_0x17b157[_0x57bd('0x69')]===_0x3ccbbe){return _0x17b157[_0x57bd('0x75')]?operators[_0x198a82[_0x57bd('0x6f')]](_0x198a82['value'],_0x17b157['event']):![];}break;case'queue':return _0x17b157[_0x57bd('0x61')]?operators[_0x198a82[_0x57bd('0x6f')]](_0x198a82['value'],_0x17b157[_0x57bd('0x61')]):![];case'agent':return _0x17b157[_0x57bd('0x76')]?operators[_0x198a82[_0x57bd('0x6f')]](_0x198a82[_0x57bd('0x70')],_0x17b157[_0x57bd('0x76')]):![];case _0x57bd('0x77'):return _0x17b157[_0x57bd('0x77')]?operators[_0x198a82[_0x57bd('0x6f')]](_0x198a82['value'],_0x17b157[_0x57bd('0x77')]):![];case _0x57bd('0x62'):return _0x17b157[_0x57bd('0x62')]?operators[_0x198a82[_0x57bd('0x6f')]](_0x198a82[_0x57bd('0x70')],_0x17b157[_0x57bd('0x62')]):![];}return![];};};module['exports']=Trigger;
\ No newline at end of file
index b9688e4..122bd8d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Motion','CTI','concat','Tags','/api/v2/users/%d','Descriptions','%s/customers/%d/cases','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','Desk\x20account\x20type\x20not\x20recognized','error','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','integrationTab','newTab','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','The\x20Ticket\x20ID\x20is:','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','desk','defaults','redis','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','[HTTP]','stringify','GET','password','authType','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','includes','string','picklist','type','nameField','customField','content','idField','custom_fields','variable','variableName','customVariable','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY'];(function(_0x1f29c6,_0x18ffeb){var _0x2fc666=function(_0x53af9f){while(--_0x53af9f){_0x1f29c6['push'](_0x1f29c6['shift']());}};_0x2fc666(++_0x18ffeb);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var rp=require(_0x7995('0x1'));var md5=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var Redis=require('ioredis');var intUtil=require(_0x7995('0x4'));var config=require(_0x7995('0x5'));var logger=require(_0x7995('0x6'))(_0x7995('0x7'));config['redis']=_[_0x7995('0x8')](config[_0x7995('0x9')],{'host':_0x7995('0xa'),'port':0x18eb});var io=require(_0x7995('0xb'))(new Redis(config[_0x7995('0x9')]));function emit(_0x326741,_0x4996ca,_0x465276){io['to'](_0x326741)[_0x7995('0xc')](_0x4996ca,_0x465276);}var headers={'Content-Type':'application/json','Accept':_0x7995('0xd')};function getUser(_0x3116fb,_0x18c8a3){if(intUtil[_0x7995('0xe')](_0x18c8a3)===!![]){logger[_0x7995('0xf')](_0x7995('0x10'),_0x18c8a3);return request({'uri':util[_0x7995('0x11')]('%s/users',_0x3116fb[_0x7995('0x12')])})[_0x7995('0x13')](function(_0x581f22){if(_0x581f22[_0x7995('0x14')]){return _[_0x7995('0x15')](_0x581f22[_0x7995('0x16')][_0x7995('0x17')],{'email':_0x18c8a3});}})[_0x7995('0x13')](function(_0x23999f){if(_0x23999f){logger[_0x7995('0xf')]('Agent\x20found!');return _0x23999f;}else{logger['info'](_0x7995('0x18'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb[_0x7995('0x12')])});}});}else{logger[_0x7995('0xf')](_0x7995('0x1a'));return request({'uri':util[_0x7995('0x11')](_0x7995('0x19'),_0x3116fb['remoteUri'])});}}function request(_0x2eeacc){logger['debug'](_0x7995('0x1b'),JSON[_0x7995('0x1c')](_0x2eeacc));return rp(_[_0x7995('0x8')](_0x2eeacc,{'method':_0x7995('0x1d'),'headers':headers,'json':!![]}));}function getAuth(_0x1e1415){var _0x37a7d4;if(_0x1e1415['authType']==='basic'){_0x37a7d4=util[_0x7995('0x11')]('%s:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x1e')]);}else if(_0x1e1415[_0x7995('0x1f')]==='token'){_0x37a7d4=util[_0x7995('0x11')]('%s/token:%s',_0x1e1415['username'],_0x1e1415[_0x7995('0x20')]);}return util[_0x7995('0x11')](_0x7995('0x21'),new Buffer(_0x37a7d4)[_0x7995('0x22')](_0x7995('0x23')));}function getEndUser(_0x1c278a,_0x5d40ae,_0x32a09a){logger[_0x7995('0xf')](_0x7995('0x24'),_0x32a09a);return request({'uri':util[_0x7995('0x11')](_0x7995('0x25'),_0x1c278a[_0x7995('0x12')]),'qs':{'phone':_0x32a09a}})[_0x7995('0x13')](function(_0x472195){if(_0x472195['total_entries']){logger[_0x7995('0xf')](_0x7995('0x26'));return _0x472195[_0x7995('0x16')][_0x7995('0x17')][0x0];}else{logger[_0x7995('0xf')](_0x7995('0x27'));return request({'uri':util['format'](_0x7995('0x28'),_0x1c278a['remoteUri']),'method':_0x7995('0x29'),'body':{'first_name':_0x5d40ae,'title':_0x5d40ae,'phone_numbers':[{'type':_0x7995('0x2a'),'value':_0x32a09a}]}});}});}function getTags(_0xf16cc2,_0x132a42){var _0x11c1eb=[];if(_0xf16cc2&&_0xf16cc2['length']>0x0){_0x11c1eb=_[_0x7995('0x2b')](_0xf16cc2,_0x132a42);}return _0x11c1eb;}function getCustomFields(_0x514445,_0x456a28){var _0x3250e0=[];var _0x4253e5={'custom_fields':{}};if(_0x514445['length']>0x0){_['forEach'](_0x514445,function(_0x48e573){if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x30')]&&!_0x48e573[_0x7995('0x31')]){_0x4253e5[_0x48e573['nameField']['toLowerCase']()]=_0x48e573[_0x7995('0x32')]['toString']();}else if(_[_0x7995('0x2c')]([_0x7995('0x2d'),_0x7995('0x2e')],_0x48e573[_0x7995('0x2f')])&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x48e573['content']['toString']();}else if(_0x48e573['type']===_0x7995('0x35')&&_0x48e573[_0x7995('0x36')]&&_0x48e573['idField']&&_0x48e573[_0x7995('0x31')]){_0x456a28[_0x48e573['variableName']]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573[_0x7995('0x36')]]['toString']());}else if(_0x48e573['type']===_0x7995('0x37')&&_0x48e573['Variable']&&_0x48e573['Variable'][_0x7995('0x38')]&&_0x48e573[_0x7995('0x33')]&&_0x48e573['customField']){_0x456a28[_0x48e573[_0x7995('0x39')][_0x7995('0x38')][_0x7995('0x3a')]()]&&(_0x4253e5[_0x7995('0x34')][_0x48e573[_0x7995('0x33')]]=_0x456a28[_0x48e573['Variable'][_0x7995('0x38')][_0x7995('0x3a')]()][_0x7995('0x22')]());}});}if(_0x4253e5[_0x7995('0x3b')]){_0x4253e5['priority']=Number(_0x4253e5[_0x7995('0x3b')]);}return _0x4253e5;}function getTicket(_0x235df7,_0x3eb04f,_0xe5ea43,_0x1f5bee,_0x1035dc){logger['info'](_0x7995('0x3c'));var _0x3be298=_[_0x7995('0x3d')]({'subject':intUtil[_0x7995('0x3e')](_0x1f5bee[_0x7995('0x3f')],_0x1035dc,'\x20'),'type':_0x7995('0x40'),'status':_0x7995('0x41'),'labels':[_0x7995('0x42'),_0x7995('0x43'),_0x7995('0x44')][_0x7995('0x45')](getTags(_0x1f5bee[_0x7995('0x46')],_0x7995('0x38'))),'description':intUtil['getString'](_0x1f5bee['Descriptions'],_0x1035dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7995('0x11')](_0x7995('0x47'),_0x3eb04f['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x1f5bee[_0x7995('0x48')],_0x1035dc,'\x0a')}},getCustomFields(_0x1f5bee['Fields'],_0x1035dc));return request({'uri':util['format'](_0x7995('0x49'),_0x235df7[_0x7995('0x12')],_0xe5ea43['id']),'method':_0x7995('0x29'),'body':_0x3be298});}exports['queue']=function(_0x46ac4f,_0x5e85b9,_0x3993b5,_0x5a8881,_0x493066,_0x39c5b8){var _0x403f54,_0xc04e5;_0x39c5b8[_0x7995('0x12')]=intUtil['stripTrailingSlash'](_0x39c5b8[_0x7995('0x12')]);_0x39c5b8[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x39c5b8[_0x7995('0x4a')]);if(_0x493066&&_0x493066['monitor_format']){logger['info'](_0x7995('0x4c'),'Recording\x20is\x20enabled!');_0x5e85b9[_0x7995('0x4d')]=util['format'](_0x7995('0x4e'),_0x39c5b8['serverUrl'],_0x5e85b9[_0x7995('0x4f')],md5(_0x5e85b9[_0x7995('0x4f')]));}else{_0x5e85b9['recordingURL']='';}headers[_0x7995('0x50')]=getAuth(_0x39c5b8);return getUser(_0x39c5b8,_0x5a8881[_0x7995('0x51')])[_0x7995('0x13')](function(_0xb70a51){_0x403f54=_0xb70a51;logger['info'](_0x7995('0x52'),_0x403f54['id']);return getEndUser(_0x39c5b8,_0x5e85b9[_0x7995('0x53')],_0x5e85b9[_0x7995('0x54')]);})['then'](function(_0xe228a5){_0xc04e5=_0xe228a5;logger[_0x7995('0xf')](_0x7995('0x55'),_0xc04e5['id']);return getTicket(_0x39c5b8,_0x403f54,_0xc04e5,_0x3993b5,_0x5e85b9);})[_0x7995('0x13')](function(_0x255313){if(_0x255313){logger['info'](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x255313['id']);switch(_0x39c5b8[_0x7995('0x2f')]){case'integrationTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x255313['id']});break;case'newTab':logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x5a'));emit(util['format'](_0x7995('0x58'),_0x5a8881[_0x7995('0x38')]),_0x7995('0x5b'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x255313['id'])});break;default:logger['error'](_0x7995('0x4c'),_0x7995('0x5c'));}}})['catch'](function(_0x1cd85){console[_0x7995('0x5d')](_0x1cd85);logger[_0x7995('0x5d')](_0x7995('0x4c'),JSON[_0x7995('0x1c')](_0x1cd85));});};exports['outbound']=function(_0x29ee32,_0x4ab09f,_0x14fe7f,_0x33c801,_0x206d2a,_0x50c7b5,_0x5e1f34){var _0x54e2b1,_0x563f8e;_0x50c7b5[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x12')]);_0x50c7b5[_0x7995('0x4a')]=intUtil[_0x7995('0x4b')](_0x50c7b5[_0x7995('0x4a')]);if(_0x5e1f34&&_0x5e1f34[_0x7995('0x5e')]&&_0x5e1f34[_0x7995('0x5e')]!==_0x7995('0x5f')){logger[_0x7995('0xf')](_0x7995('0x60'),_0x7995('0x61'));_0x4ab09f[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x50c7b5[_0x7995('0x4a')],_0x4ab09f[_0x7995('0x4f')],md5(_0x4ab09f[_0x7995('0x4f')]));}headers[_0x7995('0x50')]=getAuth(_0x50c7b5);return getUser(_0x50c7b5,_0x33c801['email'])[_0x7995('0x13')](function(_0x630737){_0x54e2b1=_0x630737;logger[_0x7995('0xf')](_0x7995('0x52'),_0x54e2b1['id']);return getEndUser(_0x50c7b5,_0x4ab09f['destcalleridname'],_0x4ab09f['destcalleridnum']);})[_0x7995('0x13')](function(_0x197b52){_0x563f8e=_0x197b52;logger[_0x7995('0xf')](_0x7995('0x55'),_0x563f8e['id']);return getTicket(_0x50c7b5,_0x54e2b1,_0x563f8e,_0x14fe7f,_0x4ab09f);})['then'](function(_0x13cd7b){if(_0x13cd7b){logger[_0x7995('0xf')](_0x7995('0x56'));logger[_0x7995('0xf')]('The\x20Ticket\x20ID\x20is:',_0x13cd7b['id']);switch(_0x50c7b5['type']){case _0x7995('0x62'):logger[_0x7995('0xf')](_0x7995('0x4c'),_0x7995('0x57'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801[_0x7995('0x38')]),_0x7995('0x59'),{'recordId':_0x13cd7b['id']});break;case _0x7995('0x63'):logger['info'](_0x7995('0x4c'),_0x7995('0x5a'));emit(util[_0x7995('0x11')](_0x7995('0x58'),_0x33c801['name']),'trigger:browser:url',{'uri':util[_0x7995('0x11')](_0x7995('0x64'),_0x50c7b5['remoteUri'],_0x13cd7b['id'])});break;default:logger[_0x7995('0x5d')](_0x7995('0x60'),_0x7995('0x5c'));}}})[_0x7995('0x65')](function(_0x32cb04){logger['error'](_0x7995('0x60'),JSON['stringify'](_0x32cb04));});};exports[_0x7995('0x66')]=function(_0xe31dcb,_0x1722e2,_0x25b534,_0x4388c1,_0xeb8920,_0x2b3c1d){var _0x44372a,_0x10f012;_0x2b3c1d[_0x7995('0x12')]=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x12')]);_0x2b3c1d['serverUrl']=intUtil[_0x7995('0x4b')](_0x2b3c1d[_0x7995('0x4a')]);if(_0xeb8920&&_0xeb8920[_0x7995('0x67')]){logger[_0x7995('0xf')]('['+_0x1722e2[_0x7995('0x68')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x1722e2[_0x7995('0x4d')]=util[_0x7995('0x11')](_0x7995('0x4e'),_0x2b3c1d[_0x7995('0x4a')],_0x1722e2['uniqueid'],md5(_0x1722e2[_0x7995('0x4f')]));}else{_0x1722e2['recordingURL']='';}headers['Authorization']=getAuth(_0x2b3c1d);return getUser(_0x2b3c1d)[_0x7995('0x13')](function(_0x36d27d){_0x44372a=_0x36d27d;logger[_0x7995('0xf')](_0x7995('0x52'),_0x44372a['id']);return getEndUser(_0x2b3c1d,_0x1722e2[_0x7995('0x53')],_0x1722e2[_0x7995('0x54')]);})[_0x7995('0x13')](function(_0x13dc73){_0x10f012=_0x13dc73;logger[_0x7995('0xf')](_0x7995('0x55'),_0x10f012['id']);return getTicket(_0x2b3c1d,_0x44372a,_0x10f012,_0x25b534,_0x1722e2);})['then'](function(_0x2dc1f7){if(_0x2dc1f7){logger[_0x7995('0xf')](_0x7995('0x56'));logger['info'](_0x7995('0x69'),_0x2dc1f7['id']);}})[_0x7995('0x65')](function(_0x705f0){logger[_0x7995('0x5d')]('['+_0x1722e2[_0x7995('0x68')][_0x7995('0x6a')]()+']',JSON[_0x7995('0x1c')](_0x705f0));});};
\ No newline at end of file
+var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x2b571a,_0x1640ce){var _0x254474=function(_0x12f18e){while(--_0x12f18e){_0x2b571a['push'](_0x2b571a['shift']());}};_0x254474(++_0x1640ce);}(_0x55ca,0x126));var _0xa55c=function(_0x42e25e,_0x46cfd1){_0x42e25e=_0x42e25e-0x0;var _0x1ed3a6=_0x55ca[_0x42e25e];return _0x1ed3a6;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});};
\ No newline at end of file
index 6f8ce18..9712a78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xca3b=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','validateEmail','userEmail','email','length','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId','catch','calleridnum','contacts','/systemusers(','4.0','then','headers','odata-entityid','lastIndexOf','enduserId','toLowerCase','outbound','destcalleridnum','replace','%2b','telephone1','contactid',']\x20Enduser\x20Created!','string','picklist','nameField','customField','idField','substring','indexOf','content','assign','getString','/contacts(','phonecalls','Subjects','Descriptions','callDirection','queue','Fields','ticketType','ticketId','format','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0xe440c8,_0x15965b){var _0x545ca7=function(_0x39cc26){while(--_0x39cc26){_0xe440c8['push'](_0xe440c8['shift']());}};_0x545ca7(++_0x15965b);}(_0xca3b,0x73));var _0xbca3=function(_0x596867,_0x5d0cdd){_0x596867=_0x596867-0x0;var _0x55c475=_0xca3b[_0x596867];return _0x55c475;};'use strict';var _=require(_0xbca3('0x0'));var BPromise=require(_0xbca3('0x1'));var rp=require(_0xbca3('0x2'));var util=require(_0xbca3('0x3'));var intUtil=require(_0xbca3('0x4'));var md5=require(_0xbca3('0x5'));var Redis=require(_0xbca3('0x6'));var logger=require(_0xbca3('0x7'))(_0xbca3('0x8'));var config=require(_0xbca3('0x9'));config[_0xbca3('0xa')]=_[_0xbca3('0xb')](config[_0xbca3('0xa')],{'host':_0xbca3('0xc'),'port':0x18eb});var io=require(_0xbca3('0xd'))(new Redis(config[_0xbca3('0xa')]));function getAuthToken(_0x58d969,_0x515f8e,_0x4d3d6d){var _0x2735a3={'method':_0xbca3('0xe'),'uri':_0x515f8e,'form':{'client_id':_0x58d969[_0xbca3('0xf')],'resource':_0x58d969[_0xbca3('0x10')],'username':_0x58d969[_0xbca3('0x11')],'password':_0x58d969[_0xbca3('0x12')],'grant_type':_0xbca3('0x12'),'client_secret':_0x58d969[_0xbca3('0x13')]},'json':!![]};return rp(_0x2735a3)['then'](function(_0x4bc8f3){return _0x4bc8f3[_0xbca3('0x14')];})['catch'](function(_0x5bbe36){logger[_0xbca3('0x15')]('['+[_0x4d3d6d[_0xbca3('0x16')]()]+_0xbca3('0x17'));return _0x5bbe36[_0xbca3('0x18')];});}function getUser(_0x3bae1c,_0x3623ee,_0x20fee1,_0x500d62,_0xf35fc9,_0xec5865){return new BPromise(function(_0x5ccee8,_0x32fdbb){return getAuthToken(_0x3623ee,_0x500d62,_0xec5865)['then'](function(_0xaac12){var _0x1e142b={'method':_0xbca3('0x19'),'uri':_0xf35fc9+_0xbca3('0x1a'),'headers':{'Authorization':_0xbca3('0x1b')+_0xaac12,'OData-Version':'4.0'},'json':!![]};return rp(_0x1e142b);})['then'](function(_0x2d7674){var _0x1d8082=_0x2d7674[_0xbca3('0x1c')];var _0x281eda=![];var _0xaef0ae=null;if(!_['isNil'](_0x20fee1)){if(intUtil[_0xbca3('0x1d')](_0x20fee1['email'])){_0x3bae1c[_0xbca3('0x1e')]=_0x20fee1[_0xbca3('0x1f')];for(_0xaef0ae=0x0;_0xaef0ae<_0x1d8082[_0xbca3('0x20')];_0xaef0ae++){if(_0x1d8082[_0xaef0ae][_0xbca3('0x21')]===_0x20fee1[_0xbca3('0x1f')]&&!_0x1d8082[_0xaef0ae]['isdisabled']){_0x281eda=!![];logger[_0xbca3('0x22')]('['+[_0xec5865[_0xbca3('0x16')]()]+_0xbca3('0x23')+_0x1d8082[_0xaef0ae][_0xbca3('0x24')]+'!');_0x3bae1c[_0xbca3('0x25')]=_0x1d8082[_0xaef0ae][_0xbca3('0x24')];}}}}if(!_0x281eda){logger[_0xbca3('0x22')]('['+[_0xec5865[_0xbca3('0x16')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x3bae1c[_0xbca3('0x1e')]=_0x3623ee[_0xbca3('0x11')];for(_0xaef0ae=0x0;_0xaef0ae<_0x1d8082[_0xbca3('0x20')];_0xaef0ae++){if(_0x1d8082[_0xaef0ae][_0xbca3('0x21')]===_0x3623ee[_0xbca3('0x11')]){_0x3bae1c[_0xbca3('0x25')]=_0x1d8082[_0xaef0ae][_0xbca3('0x24')];}}}_0x5ccee8(_0x3bae1c);})[_0xbca3('0x26')](function(_0x30cff5){_0x32fdbb(_0x30cff5[_0xbca3('0x18')]);});});}function createEndUser(_0x5c51e9,_0x4318d5,_0x588341,_0x5ca686,_0x225920,_0x234bde){return new BPromise(function(_0x5235e3,_0x1dbc97){return getAuthToken(_0x4318d5,_0x588341,_0x234bde)['then'](function(_0x1d5526){var _0x1b7b0b=_0x234bde['toLowerCase']()==='outbound'?_0x225920['destcalleridnum']:_0x225920[_0xbca3('0x27')];var _0x29e506={'method':_0xbca3('0xe'),'uri':_0x5ca686+_0xbca3('0x28'),'body':{'telephone1':_0x1b7b0b,'fullname':_0x1b7b0b,'firstname':_0x1b7b0b,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xbca3('0x29')+_0x5c51e9[_0xbca3('0x25')]+')'},'headers':{'Authorization':_0xbca3('0x1b')+_0x1d5526,'OData-Version':_0xbca3('0x2a')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x29e506);})[_0xbca3('0x2b')](function(_0xd9afe8){var _0x1612b4=_0xd9afe8[_0xbca3('0x2c')][_0xbca3('0x2d')];var _0x400c38=_0x1612b4['substring'](_0x1612b4[_0xbca3('0x2e')]('(')+0x1,_0x1612b4[_0xbca3('0x2e')](')'));_0x5c51e9[_0xbca3('0x2f')]=_0x400c38;_0x5235e3(_0x5c51e9);})[_0xbca3('0x26')](function(_0x2046ad){_0x1dbc97(_0x2046ad['message']);});});}function getEndUser(_0x13fe08,_0x38ed03,_0x2c7209,_0xd5978,_0x4246f2,_0x72fda6){return new BPromise(function(_0x34c433,_0x1faedf){var _0x5380e8=_0x72fda6[_0xbca3('0x30')]()===_0xbca3('0x31')?_0x4246f2[_0xbca3('0x32')]:_0x4246f2[_0xbca3('0x27')];return getAuthToken(_0x38ed03,_0x2c7209,_0x72fda6)[_0xbca3('0x2b')](function(_0x26d729){var _0x52712b={'method':_0xbca3('0x19'),'uri':_0xd5978+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x5380e8[_0xbca3('0x33')]('+',_0xbca3('0x34'))+'\x27','headers':{'Authorization':_0xbca3('0x1b')+_0x26d729,'If-None-Match':null,'OData-Version':_0xbca3('0x2a')},'json':!![]};return rp(_0x52712b);})[_0xbca3('0x2b')](function(_0x5a81a9){var _0x3d138c=null;if(_0x5a81a9){var _0x1a5d75=_0x5a81a9[_0xbca3('0x1c')];var _0x7786eb=![];for(_0x3d138c=0x0;_0x3d138c<_0x1a5d75[_0xbca3('0x20')];_0x3d138c++){if(_0x1a5d75[_0x3d138c][_0xbca3('0x35')]===_0x5380e8){_0x7786eb=!![];_0x13fe08['enduserId']=_0x1a5d75[_0x3d138c][_0xbca3('0x36')];}}if(_0x7786eb){_0x34c433(_0x13fe08);}else{return createEndUser(_0x13fe08,_0x38ed03,_0x2c7209,_0xd5978,_0x4246f2,_0x72fda6)['then'](function(_0x3df91e){logger['info']('['+[_0x72fda6[_0xbca3('0x16')]()]+']\x20Enduser\x20created!',_0x3df91e[_0xbca3('0x2f')]);_0x34c433(_0x3df91e);});}}else{return createEndUser(_0x13fe08,_0x38ed03,_0x2c7209,_0xd5978,_0x4246f2,_0x72fda6)['then'](function(_0x59b17d){logger[_0xbca3('0x22')]('['+[_0x72fda6[_0xbca3('0x16')]()]+_0xbca3('0x37'),_0x59b17d[_0xbca3('0x2f')]);_0x34c433(_0x59b17d);});}});});}function getCustomFields(_0x26f25b,_0x1c9dad,_0x189d50){var _0x3fa834={};if(_0x26f25b['length']>0x0){_['forEach'](_0x26f25b,function(_0xee2e83){if(_['includes']([_0xbca3('0x38'),_0xbca3('0x39')],_0xee2e83['type'])&&_0xee2e83[_0xbca3('0x3a')]&&!_0xee2e83[_0xbca3('0x3b')]){var _0x4278b7=_0xee2e83[_0xbca3('0x3c')][_0xbca3('0x30')]();var _0x412bbc=_0x4278b7[_0xbca3('0x3d')](0x0,_0x4278b7[_0xbca3('0x3e')]('_'));var _0x5f0979=_0x4278b7[_0xbca3('0x3d')](_0x4278b7['indexOf']('_')+0x1);if(_0x412bbc===_0x189d50){_0x3fa834[_0x5f0979]=_0xee2e83[_0xbca3('0x3f')];}}});}return _0x3fa834;}function getTicket(_0x4ae0a5,_0x1fc1a9,_0x20f056,_0xed7009,_0x6aece5,_0x3f5497,_0x48a365){return new BPromise(function(_0x1cd438,_0x5d8cbc){var _0x1a0d8d;return getAuthToken(_0x1fc1a9,_0x20f056,_0x48a365)[_0xbca3('0x2b')](function(_0x2e7a18){if(_0x3f5497['ticketType']==='incident'){_0x1a0d8d={'method':'POST','uri':_0xed7009+'incidents','body':Object[_0xbca3('0x40')]({},{'title':intUtil[_0xbca3('0x41')](_0x3f5497['Subjects'],_0x6aece5,'\x20'),'description':intUtil[_0xbca3('0x41')](_0x3f5497['Descriptions'],_0x6aece5,'\x0a'),'customerid_contact@odata.bind':_0xbca3('0x42')+_0x4ae0a5[_0xbca3('0x2f')]+')','ownerid@odata.bind':_0xbca3('0x29')+_0x4ae0a5[_0xbca3('0x25')]+')','caseorigincode':'1'},getCustomFields(_0x3f5497['Fields'],_0x6aece5,_0x3f5497['ticketType'])),'headers':{'Authorization':_0xbca3('0x1b')+_0x2e7a18,'OData-Version':_0xbca3('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3f5497['ticketType']==='phonecall'){_0x1a0d8d={'method':'POST','uri':_0xed7009+_0xbca3('0x43'),'body':Object['assign']({},{'subject':intUtil[_0xbca3('0x41')](_0x3f5497[_0xbca3('0x44')],_0x6aece5,'\x20'),'phonenumber':String(_0x6aece5[_0xbca3('0x27')]),'description':intUtil['getString'](_0x3f5497[_0xbca3('0x45')],_0x6aece5,'\x0a'),'regardingobjectid_contact@odata.bind':_0xbca3('0x42')+_0x4ae0a5[_0xbca3('0x2f')]+')','ownerid@odata.bind':_0xbca3('0x29')+_0x4ae0a5['userId']+')','directioncode':_0x4ae0a5[_0xbca3('0x46')]===_0xbca3('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0xbca3('0x29')+_0x4ae0a5['userId']+')','participationtypemask':_0x4ae0a5[_0xbca3('0x46')]===_0xbca3('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0xbca3('0x42')+_0x4ae0a5['enduserId']+')','participationtypemask':_0x4ae0a5[_0xbca3('0x46')]===_0xbca3('0x47')?0x1:0x2}]},getCustomFields(_0x3f5497[_0xbca3('0x48')],_0x6aece5,_0x3f5497[_0xbca3('0x49')])),'headers':{'Authorization':_0xbca3('0x1b')+_0x2e7a18,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1a0d8d);})[_0xbca3('0x2b')](function(_0x2ebf25){var _0x1a889c=_0x2ebf25['headers']['odata-entityid'];var _0x3d1b8a=_0x1a889c[_0xbca3('0x3d')](_0x1a889c[_0xbca3('0x2e')]('(')+0x1,_0x1a889c['lastIndexOf'](')'));_0x4ae0a5[_0xbca3('0x4a')]=_0x3d1b8a;_0x1cd438(_0x4ae0a5);})[_0xbca3('0x26')](function(_0x1d5b61){_0x5d8cbc(_0x1d5b61[_0xbca3('0x18')]);});});}function emit(_0x19f2da,_0x2572fc,_0x179771,_0x27912b){var _0x3204c2={'uri':util[_0xbca3('0x4b')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x19f2da,_0x179771,_0x27912b)};io['to'](util[_0xbca3('0x4b')](_0xbca3('0x4c'),_0x2572fc))[_0xbca3('0x4d')]('trigger:browser:url',_0x3204c2);}exports['cs']=function(_0x2d69c5,_0x5401cf,_0x599aba,_0x5d4517,_0x405a3c,_0x533dde,_0x550086,_0x2fa4de){var _0x4f8a1d={};_0x533dde['remoteUri']=intUtil[_0xbca3('0x4e')](_0x533dde['remoteUri']);_0x533dde[_0xbca3('0x4f')]=intUtil[_0xbca3('0x4e')](_0x533dde[_0xbca3('0x4f')]);_0x4f8a1d[_0xbca3('0x46')]=_0x2fa4de===_0xbca3('0x47')||_0x2fa4de===_0xbca3('0x50')?_0xbca3('0x47'):_0xbca3('0x31');var _0x284efe=util[_0xbca3('0x4b')](_0xbca3('0x51'),_0x533dde[_0xbca3('0x10')]);var _0x81a9a2=util[_0xbca3('0x4b')]('https://login.microsoftonline.com/%s/oauth2/token',_0x533dde[_0xbca3('0x52')]);var _0x171285=util[_0xbca3('0x4b')](_0xbca3('0x53'),_0x533dde[_0xbca3('0x4f')],_0x5401cf['uniqueid'],md5(_0x5401cf[_0xbca3('0x54')]));if(_0x405a3c&&_0x405a3c[_0xbca3('0x55')]){logger[_0xbca3('0x22')](_0xbca3('0x56'),_0xbca3('0x57'));_0x5401cf[_0xbca3('0x58')]=_0x171285;}else if(_0x550086&&_0x550086[_0xbca3('0x59')]&&_0x550086[_0xbca3('0x59')]!==_0xbca3('0x5a')){logger[_0xbca3('0x22')](_0xbca3('0x5b'),'Recording\x20is\x20enabled!');_0x5401cf[_0xbca3('0x58')]=_0x171285;}else{_0x5401cf['recordingURL']='';}return getUser(_0x4f8a1d,_0x533dde,_0x5d4517,_0x81a9a2,_0x284efe,_0x2fa4de)[_0xbca3('0x2b')](function(_0x249ace){logger[_0xbca3('0x22')]('['+_0x2fa4de[_0xbca3('0x16')]()+_0xbca3('0x5c'),_0x249ace[_0xbca3('0x25')]);logger[_0xbca3('0x22')]('['+_0x2fa4de[_0xbca3('0x16')]()+_0xbca3('0x5d'),_0x249ace['userEmail']);return getEndUser(_0x249ace,_0x533dde,_0x81a9a2,_0x284efe,_0x5401cf,_0x2fa4de);})['then'](function(_0x3395f7){logger[_0xbca3('0x22')]('['+_0x2fa4de[_0xbca3('0x16')]()+_0xbca3('0x5e'),_0x3395f7[_0xbca3('0x2f')]);logger['info']('['+_0x2fa4de['toUpperCase']()+_0xbca3('0x5f'),_0x5401cf['calleridnum']);return getTicket(_0x3395f7,_0x533dde,_0x81a9a2,_0x284efe,_0x5401cf,_0x599aba,_0x2fa4de);})['then'](function(_0x336011){logger['info'](util['format']('['+_0x2fa4de[_0xbca3('0x16')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x599aba['ticketType'],_0x336011[_0xbca3('0x4a')]));logger['info'](util[_0xbca3('0x4b')]('['+_0x2fa4de[_0xbca3('0x16')]()+_0xbca3('0x60'),_0x2fa4de));if(_0x2fa4de!==_0xbca3('0x50')){logger['info']('['+_0x2fa4de[_0xbca3('0x16')]()+']',_0xbca3('0x61'));emit(_0x533dde[_0xbca3('0x10')],_0x5d4517[_0xbca3('0x62')],_0x599aba['ticketType'],_0x336011[_0xbca3('0x4a')]);}})['catch'](function(_0x2ec7dc){logger[_0xbca3('0x15')]('['+_0x2fa4de['toUpperCase']()+_0xbca3('0x63'),util['inspect'](_0x2ec7dc,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x21e5=['ticketId','format','user:%s','emit','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','remoteUri','username','password','then','toUpperCase','message','GET','Bearer\x20','4.0','validateEmail','userEmail','email','length','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','catch','outbound','destcalleridnum','contacts','/systemusers(','headers','enduserId','toLowerCase','calleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','value','telephone1','contactid','info',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','customField','idField','indexOf','substring','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','Fields','phonecalls','callDirection','queue','lastIndexOf'];(function(_0x285af6,_0x5eea8e){var _0x5df459=function(_0x213bd2){while(--_0x213bd2){_0x285af6['push'](_0x285af6['shift']());}};_0x5df459(++_0x5eea8e);}(_0x21e5,0x1a5));var _0x521e=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0x21e5[_0x37b3e5];return _0x207f20;};'use strict';var _=require(_0x521e('0x0'));var BPromise=require(_0x521e('0x1'));var rp=require(_0x521e('0x2'));var util=require(_0x521e('0x3'));var intUtil=require('./util');var md5=require(_0x521e('0x4'));var Redis=require(_0x521e('0x5'));var logger=require('../../../../config/logger')(_0x521e('0x6'));var config=require(_0x521e('0x7'));config[_0x521e('0x8')]=_[_0x521e('0x9')](config[_0x521e('0x8')],{'host':_0x521e('0xa'),'port':0x18eb});var io=require(_0x521e('0xb'))(new Redis(config[_0x521e('0x8')]));function getAuthToken(_0x873fa0,_0x393957,_0x4e9995){var _0x55d4fa={'method':_0x521e('0xc'),'uri':_0x393957,'form':{'client_id':_0x873fa0['clientId'],'resource':_0x873fa0[_0x521e('0xd')],'username':_0x873fa0[_0x521e('0xe')],'password':_0x873fa0[_0x521e('0xf')],'grant_type':'password','client_secret':_0x873fa0['clientSecret']},'json':!![]};return rp(_0x55d4fa)[_0x521e('0x10')](function(_0x295a01){return _0x295a01['access_token'];})['catch'](function(_0x2f0b42){logger['error']('['+[_0x4e9995[_0x521e('0x11')]()]+']\x20Wrong\x20credentials!');return _0x2f0b42[_0x521e('0x12')];});}function getUser(_0x513231,_0x5666e2,_0x2e3e9d,_0x401338,_0x14efd7,_0x24d7e7){return new BPromise(function(_0x27eddb,_0x159d66){return getAuthToken(_0x5666e2,_0x401338,_0x24d7e7)[_0x521e('0x10')](function(_0x58db80){var _0x397c58={'method':_0x521e('0x13'),'uri':_0x14efd7+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x521e('0x14')+_0x58db80,'OData-Version':_0x521e('0x15')},'json':!![]};return rp(_0x397c58);})[_0x521e('0x10')](function(_0x4bd257){var _0x12415e=_0x4bd257['value'];var _0x5a09cf=![];var _0x495da8=null;if(!_['isNil'](_0x2e3e9d)){if(intUtil[_0x521e('0x16')](_0x2e3e9d['email'])){_0x513231[_0x521e('0x17')]=_0x2e3e9d[_0x521e('0x18')];for(_0x495da8=0x0;_0x495da8<_0x12415e[_0x521e('0x19')];_0x495da8++){if(_0x12415e[_0x495da8]['internalemailaddress']===_0x2e3e9d[_0x521e('0x18')]&&!_0x12415e[_0x495da8][_0x521e('0x1a')]){_0x5a09cf=!![];logger['info']('['+[_0x24d7e7[_0x521e('0x11')]()]+_0x521e('0x1b')+_0x12415e[_0x495da8][_0x521e('0x1c')]+'!');_0x513231[_0x521e('0x1d')]=_0x12415e[_0x495da8][_0x521e('0x1c')];}}}}if(!_0x5a09cf){logger['info']('['+[_0x24d7e7[_0x521e('0x11')]()]+_0x521e('0x1e'));_0x513231['userEmail']=_0x5666e2[_0x521e('0xe')];for(_0x495da8=0x0;_0x495da8<_0x12415e[_0x521e('0x19')];_0x495da8++){if(_0x12415e[_0x495da8][_0x521e('0x1f')]===_0x5666e2['username']){_0x513231['userId']=_0x12415e[_0x495da8][_0x521e('0x1c')];}}}_0x27eddb(_0x513231);})[_0x521e('0x20')](function(_0x2b8120){_0x159d66(_0x2b8120['message']);});});}function createEndUser(_0x2258f8,_0x16f7df,_0x377d97,_0x320951,_0x5dc47f,_0x4d2b7d){return new BPromise(function(_0x3632e4,_0x316c85){return getAuthToken(_0x16f7df,_0x377d97,_0x4d2b7d)[_0x521e('0x10')](function(_0x4986af){var _0x9d1c33=_0x4d2b7d['toLowerCase']()===_0x521e('0x21')?_0x5dc47f[_0x521e('0x22')]:_0x5dc47f['calleridnum'];var _0x3d5673={'method':'POST','uri':_0x320951+_0x521e('0x23'),'body':{'telephone1':_0x9d1c33,'fullname':_0x9d1c33,'firstname':_0x9d1c33,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x521e('0x24')+_0x2258f8['userId']+')'},'headers':{'Authorization':_0x521e('0x14')+_0x4986af,'OData-Version':_0x521e('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3d5673);})[_0x521e('0x10')](function(_0x5e51a4){var _0x6e466d=_0x5e51a4[_0x521e('0x25')]['odata-entityid'];var _0xbeee8f=_0x6e466d['substring'](_0x6e466d['lastIndexOf']('(')+0x1,_0x6e466d['lastIndexOf'](')'));_0x2258f8[_0x521e('0x26')]=_0xbeee8f;_0x3632e4(_0x2258f8);})[_0x521e('0x20')](function(_0x2c9dfa){_0x316c85(_0x2c9dfa[_0x521e('0x12')]);});});}function getEndUser(_0x599041,_0x4c9300,_0x24feb8,_0x5c51c9,_0x3b0a39,_0x1cab22){return new BPromise(function(_0x5ee39a,_0x2df43b){var _0xd457d0=_0x1cab22[_0x521e('0x27')]()===_0x521e('0x21')?_0x3b0a39['destcalleridnum']:_0x3b0a39[_0x521e('0x28')];return getAuthToken(_0x4c9300,_0x24feb8,_0x1cab22)[_0x521e('0x10')](function(_0x5db7f0){var _0x282d2c={'method':_0x521e('0x13'),'uri':_0x5c51c9+_0x521e('0x29')+_0xd457d0['replace']('+','%2b')+'\x27','headers':{'Authorization':_0x521e('0x14')+_0x5db7f0,'If-None-Match':null,'OData-Version':_0x521e('0x15')},'json':!![]};return rp(_0x282d2c);})['then'](function(_0x59c41c){var _0x86cd8d=null;if(_0x59c41c){var _0x4d1216=_0x59c41c[_0x521e('0x2a')];var _0x271164=![];for(_0x86cd8d=0x0;_0x86cd8d<_0x4d1216['length'];_0x86cd8d++){if(_0x4d1216[_0x86cd8d][_0x521e('0x2b')]===_0xd457d0){_0x271164=!![];_0x599041[_0x521e('0x26')]=_0x4d1216[_0x86cd8d][_0x521e('0x2c')];}}if(_0x271164){_0x5ee39a(_0x599041);}else{return createEndUser(_0x599041,_0x4c9300,_0x24feb8,_0x5c51c9,_0x3b0a39,_0x1cab22)[_0x521e('0x10')](function(_0x1351ba){logger[_0x521e('0x2d')]('['+[_0x1cab22['toUpperCase']()]+_0x521e('0x2e'),_0x1351ba[_0x521e('0x26')]);_0x5ee39a(_0x1351ba);});}}else{return createEndUser(_0x599041,_0x4c9300,_0x24feb8,_0x5c51c9,_0x3b0a39,_0x1cab22)[_0x521e('0x10')](function(_0x3a77fe){logger[_0x521e('0x2d')]('['+[_0x1cab22['toUpperCase']()]+_0x521e('0x2f'),_0x3a77fe['enduserId']);_0x5ee39a(_0x3a77fe);});}});});}function getCustomFields(_0x83d12d,_0x4887c2,_0x542492){var _0x293c86={};if(_0x83d12d[_0x521e('0x19')]>0x0){_[_0x521e('0x30')](_0x83d12d,function(_0x2b7a36){if(_[_0x521e('0x31')]([_0x521e('0x32'),_0x521e('0x33')],_0x2b7a36[_0x521e('0x34')])&&_0x2b7a36['nameField']&&!_0x2b7a36[_0x521e('0x35')]){var _0x44c2b6=_0x2b7a36[_0x521e('0x36')][_0x521e('0x27')]();var _0x27efda=_0x44c2b6['substring'](0x0,_0x44c2b6[_0x521e('0x37')]('_'));var _0x2c62e3=_0x44c2b6[_0x521e('0x38')](_0x44c2b6[_0x521e('0x37')]('_')+0x1);if(_0x27efda===_0x542492){_0x293c86[_0x2c62e3]=_0x2b7a36['content'];}}});}return _0x293c86;}function getTicket(_0xc893aa,_0x11f54a,_0x47ec21,_0x1120bd,_0x3238d6,_0x284333,_0x91ca28){return new BPromise(function(_0x2a7139,_0xf0456){var _0x1e93a8;return getAuthToken(_0x11f54a,_0x47ec21,_0x91ca28)['then'](function(_0x37e507){if(_0x284333[_0x521e('0x39')]===_0x521e('0x3a')){_0x1e93a8={'method':_0x521e('0xc'),'uri':_0x1120bd+_0x521e('0x3b'),'body':Object[_0x521e('0x3c')]({},{'title':intUtil[_0x521e('0x3d')](_0x284333[_0x521e('0x3e')],_0x3238d6,'\x20'),'description':intUtil[_0x521e('0x3d')](_0x284333[_0x521e('0x3f')],_0x3238d6,'\x0a'),'customerid_contact@odata.bind':'/contacts('+_0xc893aa['enduserId']+')','ownerid@odata.bind':_0x521e('0x24')+_0xc893aa[_0x521e('0x1d')]+')','caseorigincode':'1'},getCustomFields(_0x284333[_0x521e('0x40')],_0x3238d6,_0x284333['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x37e507,'OData-Version':_0x521e('0x15')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x284333[_0x521e('0x39')]==='phonecall'){_0x1e93a8={'method':_0x521e('0xc'),'uri':_0x1120bd+_0x521e('0x41'),'body':Object[_0x521e('0x3c')]({},{'subject':intUtil[_0x521e('0x3d')](_0x284333[_0x521e('0x3e')],_0x3238d6,'\x20'),'phonenumber':String(_0x3238d6[_0x521e('0x28')]),'description':intUtil['getString'](_0x284333[_0x521e('0x3f')],_0x3238d6,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0xc893aa['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0xc893aa[_0x521e('0x1d')]+')','directioncode':_0xc893aa['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x521e('0x24')+_0xc893aa[_0x521e('0x1d')]+')','participationtypemask':_0xc893aa[_0x521e('0x42')]===_0x521e('0x43')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0xc893aa[_0x521e('0x26')]+')','participationtypemask':_0xc893aa[_0x521e('0x42')]===_0x521e('0x43')?0x1:0x2}]},getCustomFields(_0x284333[_0x521e('0x40')],_0x3238d6,_0x284333[_0x521e('0x39')])),'headers':{'Authorization':_0x521e('0x14')+_0x37e507,'OData-Version':_0x521e('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1e93a8);})[_0x521e('0x10')](function(_0x517ade){var _0x230882=_0x517ade[_0x521e('0x25')]['odata-entityid'];var _0x4530b6=_0x230882['substring'](_0x230882[_0x521e('0x44')]('(')+0x1,_0x230882[_0x521e('0x44')](')'));_0xc893aa[_0x521e('0x45')]=_0x4530b6;_0x2a7139(_0xc893aa);})[_0x521e('0x20')](function(_0x4a223d){_0xf0456(_0x4a223d[_0x521e('0x12')]);});});}function emit(_0x378bbe,_0x24673c,_0x4ddd4f,_0x26d73b){var _0xd2686a={'uri':util[_0x521e('0x46')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x378bbe,_0x4ddd4f,_0x26d73b)};io['to'](util[_0x521e('0x46')](_0x521e('0x47'),_0x24673c))[_0x521e('0x48')]('trigger:browser:url',_0xd2686a);}exports['cs']=function(_0x193a8d,_0xd8708b,_0x40a339,_0x58cbdd,_0x19a7fe,_0x4bf6c6,_0x374a60,_0x4eafb1){var _0xf015e4={};_0x4bf6c6[_0x521e('0xd')]=intUtil[_0x521e('0x49')](_0x4bf6c6[_0x521e('0xd')]);_0x4bf6c6[_0x521e('0x4a')]=intUtil[_0x521e('0x49')](_0x4bf6c6[_0x521e('0x4a')]);_0xf015e4[_0x521e('0x42')]=_0x4eafb1==='queue'||_0x4eafb1===_0x521e('0x4b')?_0x521e('0x43'):_0x521e('0x21');var _0x413e3a=util[_0x521e('0x46')](_0x521e('0x4c'),_0x4bf6c6['remoteUri']);var _0xcaeb39=util[_0x521e('0x46')](_0x521e('0x4d'),_0x4bf6c6[_0x521e('0x4e')]);var _0x3095c2=util[_0x521e('0x46')](_0x521e('0x4f'),_0x4bf6c6[_0x521e('0x4a')],_0xd8708b[_0x521e('0x50')],md5(_0xd8708b[_0x521e('0x50')]));if(_0x19a7fe&&_0x19a7fe[_0x521e('0x51')]){logger[_0x521e('0x2d')](_0x521e('0x52'),'Recording\x20is\x20enabled!');_0xd8708b[_0x521e('0x53')]=_0x3095c2;}else if(_0x374a60&&_0x374a60[_0x521e('0x54')]&&_0x374a60['recordingFormat']!==_0x521e('0x55')){logger[_0x521e('0x2d')](_0x521e('0x56'),_0x521e('0x57'));_0xd8708b[_0x521e('0x53')]=_0x3095c2;}else{_0xd8708b[_0x521e('0x53')]='';}return getUser(_0xf015e4,_0x4bf6c6,_0x58cbdd,_0xcaeb39,_0x413e3a,_0x4eafb1)[_0x521e('0x10')](function(_0x49b200){logger[_0x521e('0x2d')]('['+_0x4eafb1[_0x521e('0x11')]()+_0x521e('0x58'),_0x49b200[_0x521e('0x1d')]);logger['info']('['+_0x4eafb1[_0x521e('0x11')]()+_0x521e('0x59'),_0x49b200[_0x521e('0x17')]);return getEndUser(_0x49b200,_0x4bf6c6,_0xcaeb39,_0x413e3a,_0xd8708b,_0x4eafb1);})[_0x521e('0x10')](function(_0x395c49){logger['info']('['+_0x4eafb1[_0x521e('0x11')]()+_0x521e('0x5a'),_0x395c49[_0x521e('0x26')]);logger[_0x521e('0x2d')]('['+_0x4eafb1[_0x521e('0x11')]()+']\x20The\x20Enduser\x20phone\x20is:',_0xd8708b[_0x521e('0x28')]);return getTicket(_0x395c49,_0x4bf6c6,_0xcaeb39,_0x413e3a,_0xd8708b,_0x40a339,_0x4eafb1);})['then'](function(_0x1e777e){logger['info'](util[_0x521e('0x46')]('['+_0x4eafb1['toUpperCase']()+_0x521e('0x5b'),_0x40a339['ticketType'],_0x1e777e[_0x521e('0x45')]));logger[_0x521e('0x2d')](util['format']('['+_0x4eafb1[_0x521e('0x11')]()+_0x521e('0x5c'),_0x4eafb1));if(_0x4eafb1!=='unmanaged'){logger[_0x521e('0x2d')]('['+_0x4eafb1['toUpperCase']()+']',_0x521e('0x5d'));emit(_0x4bf6c6['remoteUri'],_0x58cbdd[_0x521e('0x5e')],_0x40a339['ticketType'],_0x1e777e[_0x521e('0x45')]);}})['catch'](function(_0x15c4fd){logger[_0x521e('0x5f')]('['+_0x4eafb1[_0x521e('0x11')]()+_0x521e('0x60'),util[_0x521e('0x61')](_0x15c4fd,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 2ca9084..de79541 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c49=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','[OUTBOUND]','destcalleridname','unmanaged','monitor_format','lastevent','toUpperCase','request-promise','md5','util','../../../../config/environment','freshdesk','redis','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','Tags','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','format','length','Agent\x20found!','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','defaults','GET','map','includes','string','type','customField','nameField','toLowerCase','picklist','idField','content','variable','variableName','customVariable','Variable','push','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:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:'];(function(_0x8eb7f9,_0x4b6566){var _0x336ce2=function(_0x1762b3){while(--_0x1762b3){_0x8eb7f9['push'](_0x8eb7f9['shift']());}};_0x336ce2(++_0x4b6566);}(_0x1c49,0x6a));var _0x91c4=function(_0x4f167b,_0x47a0e7){_0x4f167b=_0x4f167b-0x0;var _0xf5fc4d=_0x1c49[_0x4f167b];return _0xf5fc4d;};'use strict';var _=require('lodash');var rp=require(_0x91c4('0x0'));var md5=require(_0x91c4('0x1'));var util=require(_0x91c4('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x91c4('0x3'));var logger=require('../../../../config/logger')(_0x91c4('0x4'));config[_0x91c4('0x5')]=_['defaults'](config['redis'],{'host':_0x91c4('0x6'),'port':0x18eb});var io=require(_0x91c4('0x7'))(new Redis(config[_0x91c4('0x5')]));var headers={'Content-Type':_0x91c4('0x8'),'Accept':_0x91c4('0x8')};function emit(_0x3f1155,_0x38995d,_0x2ecce2){io['to'](_0x3f1155)[_0x91c4('0x9')](_0x38995d,_0x2ecce2);}function getTicket(_0x41a7c1,_0x26ba50,_0x4bdfd3,_0x4a8cf7,_0x3658d9){logger[_0x91c4('0xa')](_0x91c4('0xb'));var _0x292cfa=_[_0x91c4('0xc')]({'responder_id':_0x26ba50['id'],'requester_id':_0x4bdfd3['id'],'name':util['format'](_0x91c4('0xd'),_0x3658d9[_0x91c4('0xe')]),'phone':_0x3658d9['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x91c4('0xf')](_0x4a8cf7[_0x91c4('0x10')],_0x3658d9,'\x20'),'description':intUtil[_0x91c4('0xf')](_0x4a8cf7[_0x91c4('0x11')],_0x3658d9,'<br>'),'tags':getTags(_0x4a8cf7[_0x91c4('0x12')],_0x91c4('0x13'))},getCustomFields(_0x4a8cf7[_0x91c4('0x14')],_0x3658d9));_0x292cfa['custom_fields']=_[_0x91c4('0x15')](_[_0x91c4('0x16')](_0x292cfa[_0x91c4('0x17')],'id'),_0x91c4('0x18'));return request({'uri':util['format'](_0x91c4('0x19'),_0x41a7c1[_0x91c4('0x1a')]),'method':_0x91c4('0x1b'),'body':_0x292cfa})[_0x91c4('0x1c')](function(_0x52f7c4){logger['info'](_0x91c4('0x1d'));return _0x52f7c4;});}function getUser(_0x2bd1cc,_0x170ad9){if(intUtil[_0x91c4('0x1e')](_0x170ad9)){return request({'uri':util[_0x91c4('0x1f')]('%s/api/v2/agents',_0x2bd1cc[_0x91c4('0x1a')]),'qs':{'email':_0x170ad9}})[_0x91c4('0x1c')](function(_0x33d628){if(_0x33d628[_0x91c4('0x20')]){logger[_0x91c4('0xa')](_0x91c4('0x21'));return _['find'](_0x33d628,function(_0x5bf63b){return _0x5bf63b[_0x91c4('0x22')]['email']===_0x170ad9;});}else{logger['info'](_0x91c4('0x23'));return request({'uri':util[_0x91c4('0x1f')](_0x91c4('0x24'),_0x2bd1cc[_0x91c4('0x1a')])})[_0x91c4('0x1c')](function(_0x179066){logger[_0x91c4('0xa')](_0x91c4('0x25'));return _0x179066;});}});}else{logger[_0x91c4('0xa')](_0x91c4('0x26'));return request({'uri':util[_0x91c4('0x1f')](_0x91c4('0x24'),_0x2bd1cc[_0x91c4('0x1a')])})['then'](function(_0x2631c3){logger['info'](_0x91c4('0x25'));return _0x2631c3;});}}function getEndUser(_0x494e10,_0xa50c1f,_0x1bf3b6){logger[_0x91c4('0xa')](_0x91c4('0x27'),_0x1bf3b6);return request({'uri':util[_0x91c4('0x1f')](_0x91c4('0x28'),_0x494e10[_0x91c4('0x1a')]),'qs':{'phone':_0x1bf3b6}})[_0x91c4('0x1c')](function(_0xbd0266){if(_0xbd0266['length']){logger['info'](_0x91c4('0x29'));return _['find'](_0xbd0266,{'phone':_0x1bf3b6});}else{logger[_0x91c4('0xa')](_0x91c4('0x2a'));return request({'uri':util[_0x91c4('0x1f')]('%s/api/v2/contacts',_0x494e10[_0x91c4('0x1a')]),'method':_0x91c4('0x1b'),'body':{'name':_0xa50c1f,'phone':_0x1bf3b6}})[_0x91c4('0x1c')](function(_0x163614){logger['info'](_0x91c4('0x2b'));return _0x163614;});}});}function getAuth(_0x44eb45){return util['format'](_0x91c4('0x2c'),new Buffer(_0x44eb45[_0x91c4('0x2d')]+':X')[_0x91c4('0x2e')](_0x91c4('0x2f')));}function request(_0x347cfb){logger[_0x91c4('0x30')]('[HTTP]',JSON[_0x91c4('0x31')](_0x347cfb));return rp(_[_0x91c4('0x32')](_0x347cfb,{'method':_0x91c4('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x5ef456,_0x51a91a){var _0x1ff526=[];if(_0x5ef456&&_0x5ef456[_0x91c4('0x20')]>0x0){_0x1ff526=_[_0x91c4('0x34')](_0x5ef456,_0x51a91a);}return _0x1ff526;}function getCustomFields(_0xc5364c,_0xd875e8){var _0x5e46c4=[];var _0x4012a8={'custom_fields':[]};if(_0xc5364c[_0x91c4('0x20')]>0x0){_['forEach'](_0xc5364c,function(_0x564a08){if(_[_0x91c4('0x35')]([_0x91c4('0x36'),'picklist'],_0x564a08[_0x91c4('0x37')])&&_0x564a08['nameField']&&!_0x564a08[_0x91c4('0x38')]){_0x4012a8[_0x564a08[_0x91c4('0x39')][_0x91c4('0x3a')]()]=_0x564a08['content'][_0x91c4('0x2e')]();}else if(_[_0x91c4('0x35')]([_0x91c4('0x36'),_0x91c4('0x3b')],_0x564a08[_0x91c4('0x37')])&&_0x564a08[_0x91c4('0x3c')]&&_0x564a08[_0x91c4('0x38')]){_0x4012a8[_0x91c4('0x17')]['push']({'id':_0x564a08[_0x91c4('0x3c')],'value':_0x564a08[_0x91c4('0x3d')][_0x91c4('0x2e')]()});}else if(_0x564a08[_0x91c4('0x37')]===_0x91c4('0x3e')&&_0x564a08[_0x91c4('0x3f')]&&_0x564a08[_0x91c4('0x3c')]&&_0x564a08[_0x91c4('0x38')]){_0xd875e8[_0x564a08[_0x91c4('0x3f')]]&&_0x4012a8['custom_fields']['push']({'id':_0x564a08[_0x91c4('0x3c')],'value':_0xd875e8[_0x564a08[_0x91c4('0x3f')]][_0x91c4('0x2e')]()});}else if(_0x564a08['type']===_0x91c4('0x40')&&_0x564a08['Variable']&&_0x564a08[_0x91c4('0x41')][_0x91c4('0x13')]&&_0x564a08[_0x91c4('0x3c')]&&_0x564a08[_0x91c4('0x38')]){_0xd875e8[_0x564a08[_0x91c4('0x41')][_0x91c4('0x13')][_0x91c4('0x3a')]()]&&_0x4012a8[_0x91c4('0x17')][_0x91c4('0x42')]({'id':_0x564a08[_0x91c4('0x3c')],'value':_0xd875e8[_0x564a08[_0x91c4('0x41')][_0x91c4('0x13')][_0x91c4('0x3a')]()][_0x91c4('0x2e')]()});}});}return _0x4012a8;}exports[_0x91c4('0x43')]=function(_0xfb242,_0x568955,_0x4a6961,_0x35a918,_0x4100d3,_0x62fa9e){var _0x31e114,_0x322f48;_0x62fa9e['remoteUri']=intUtil[_0x91c4('0x44')](_0x62fa9e[_0x91c4('0x1a')]);_0x62fa9e[_0x91c4('0x45')]=intUtil[_0x91c4('0x44')](_0x62fa9e[_0x91c4('0x45')]);if(_0x4100d3&&_0x4100d3['monitor_format']){logger[_0x91c4('0xa')](_0x91c4('0x46'),_0x91c4('0x47'));_0x568955[_0x91c4('0x48')]=util[_0x91c4('0x1f')](_0x91c4('0x49'),_0x62fa9e['serverUrl'],_0x568955[_0x91c4('0x4a')],md5(_0x568955[_0x91c4('0x4a')]));}else{_0x568955[_0x91c4('0x48')]='';}headers[_0x91c4('0x4b')]=getAuth(_0x62fa9e);return getUser(_0x62fa9e,_0x35a918[_0x91c4('0x4c')])['then'](function(_0x11f82b){_0x31e114=_0x11f82b;logger[_0x91c4('0xa')](_0x91c4('0x4d'),_0x31e114['id']);return getEndUser(_0x62fa9e,_0x568955[_0x91c4('0xe')],_0x568955['calleridnum']);})[_0x91c4('0x1c')](function(_0x39e1df){_0x322f48=_0x39e1df;logger[_0x91c4('0xa')](_0x91c4('0x4e'),_0x322f48['id']);return getTicket(_0x62fa9e,_0x31e114,_0x322f48,_0x4a6961,_0x568955);})[_0x91c4('0x1c')](function(_0x6d520c){if(_0x6d520c&&_0x6d520c['id']){logger['info'](_0x91c4('0x1d'));logger[_0x91c4('0xa')](_0x91c4('0x4f'),_0x6d520c['id']);logger[_0x91c4('0xa')](_0x91c4('0x46'),_0x91c4('0x50'));emit(util[_0x91c4('0x1f')](_0x91c4('0x51'),_0x35a918['name']),_0x91c4('0x52'),{'uri':util['format'](_0x91c4('0x53'),_0x62fa9e[_0x91c4('0x1a')],_0x6d520c['id'])});}})[_0x91c4('0x54')](function(_0x22db6f){logger[_0x91c4('0x55')](_0x91c4('0x46'),JSON[_0x91c4('0x31')](_0x22db6f));});};exports['outbound']=function(_0x54efcd,_0x224149,_0x13f8be,_0x2a3818,_0x52a9ba,_0x263715,_0x4edb2f){var _0x15ff8e,_0x10d460;_0x263715['remoteUri']=intUtil['stripTrailingSlash'](_0x263715[_0x91c4('0x1a')]);_0x263715[_0x91c4('0x45')]=intUtil[_0x91c4('0x44')](_0x263715[_0x91c4('0x45')]);if(_0x4edb2f&&_0x4edb2f[_0x91c4('0x56')]&&_0x4edb2f[_0x91c4('0x56')]!=='none'){logger[_0x91c4('0xa')](_0x91c4('0x57'),_0x91c4('0x47'));_0x224149['recordingURL']=util['format'](_0x91c4('0x49'),_0x263715[_0x91c4('0x45')],_0x224149[_0x91c4('0x4a')],md5(_0x224149['uniqueid']));}headers[_0x91c4('0x4b')]=getAuth(_0x263715);return getUser(_0x263715,_0x2a3818[_0x91c4('0x4c')])[_0x91c4('0x1c')](function(_0x15a3ce){_0x15ff8e=_0x15a3ce;logger[_0x91c4('0xa')](_0x91c4('0x4d'),_0x15ff8e['id']);return getEndUser(_0x263715,_0x224149[_0x91c4('0x58')],_0x224149['destcalleridnum']);})[_0x91c4('0x1c')](function(_0x1c2ac9){_0x10d460=_0x1c2ac9;logger[_0x91c4('0xa')]('The\x20Enduser\x20ID\x20is:',_0x10d460['id']);return getTicket(_0x263715,_0x15ff8e,_0x10d460,_0x13f8be,_0x224149);})[_0x91c4('0x1c')](function(_0x58ef34){if(_0x58ef34&&_0x58ef34['id']){logger['info'](_0x91c4('0x1d'));logger[_0x91c4('0xa')]('The\x20Ticket\x20ID\x20is:',_0x58ef34['id']);logger[_0x91c4('0xa')](_0x91c4('0x57'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x91c4('0x1f')](_0x91c4('0x51'),_0x2a3818[_0x91c4('0x13')]),_0x91c4('0x52'),{'uri':util[_0x91c4('0x1f')](_0x91c4('0x53'),_0x263715[_0x91c4('0x1a')],_0x58ef34['id'])});}})[_0x91c4('0x54')](function(_0x137eca){logger['error']('[OUTBOUND]',JSON[_0x91c4('0x31')](_0x137eca));});};exports[_0x91c4('0x59')]=function(_0x6f6b3c,_0x29e9b0,_0x49eafe,_0x46dfd5,_0x3c5892,_0x1e3dab){var _0x33c302,_0x489080;_0x1e3dab[_0x91c4('0x1a')]=intUtil[_0x91c4('0x44')](_0x1e3dab[_0x91c4('0x1a')]);_0x1e3dab[_0x91c4('0x45')]=intUtil[_0x91c4('0x44')](_0x1e3dab[_0x91c4('0x45')]);if(_0x3c5892&&_0x3c5892[_0x91c4('0x5a')]){logger[_0x91c4('0xa')]('['+_0x29e9b0[_0x91c4('0x5b')][_0x91c4('0x5c')]()+']','Recording\x20is\x20enabled!');_0x29e9b0['recordingURL']=util[_0x91c4('0x1f')](_0x91c4('0x49'),_0x1e3dab['serverUrl'],_0x29e9b0[_0x91c4('0x4a')],md5(_0x29e9b0[_0x91c4('0x4a')]));}else{_0x29e9b0[_0x91c4('0x48')]='';}headers[_0x91c4('0x4b')]=getAuth(_0x1e3dab);return getUser(_0x1e3dab,'')['then'](function(_0x4e68dd){_0x33c302=_0x4e68dd;logger[_0x91c4('0xa')]('The\x20User\x20ID\x20is:',_0x33c302['id']);return getEndUser(_0x1e3dab,_0x29e9b0[_0x91c4('0xe')],_0x29e9b0['calleridnum']);})[_0x91c4('0x1c')](function(_0x487971){_0x489080=_0x487971;logger[_0x91c4('0xa')](_0x91c4('0x4e'),_0x489080['id']);return getTicket(_0x1e3dab,_0x33c302,_0x489080,_0x49eafe,_0x29e9b0);})[_0x91c4('0x1c')](function(_0x3cdb23){if(_0x3cdb23){logger[_0x91c4('0xa')]('Ticket\x20created!');logger['info'](_0x91c4('0x4f'),_0x3cdb23['id']);}})[_0x91c4('0x54')](function(_0x18342d){logger['error']('['+_0x29e9b0[_0x91c4('0x5b')]['toUpperCase']()+']',JSON[_0x91c4('0x31')](_0x18342d));});};
\ No newline at end of file
+var _0xb28d=['redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','<br>','Tags','Fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','apiKey','debug','[HTTP]','GET','map','forEach','includes','string','picklist','type','nameField','toLowerCase','content','toString','idField','customField','custom_fields','push','variableName','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridnum','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','error','stringify','unmanaged','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','lodash','util','./util','../../../../config/environment','../../../../config/logger'];(function(_0x474cbc,_0xc43570){var _0x3ef6d4=function(_0x17a8da){while(--_0x17a8da){_0x474cbc['push'](_0x474cbc['shift']());}};_0x3ef6d4(++_0xc43570);}(_0xb28d,0x1db));var _0xdb28=function(_0x1c9093,_0x31eb87){_0x1c9093=_0x1c9093-0x0;var _0x32dd36=_0xb28d[_0x1c9093];return _0x32dd36;};'use strict';var _=require(_0xdb28('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0xdb28('0x1'));var Redis=require('ioredis');var intUtil=require(_0xdb28('0x2'));var config=require(_0xdb28('0x3'));var logger=require(_0xdb28('0x4'))('freshdesk');config[_0xdb28('0x5')]=_[_0xdb28('0x6')](config[_0xdb28('0x5')],{'host':_0xdb28('0x7'),'port':0x18eb});var io=require(_0xdb28('0x8'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':_0xdb28('0x9')};function emit(_0x594c27,_0x310d95,_0x4b4102){io['to'](_0x594c27)[_0xdb28('0xa')](_0x310d95,_0x4b4102);}function getTicket(_0x3d63a5,_0x523e1f,_0x3f5a31,_0x3e3dd4,_0x2d6d5f){logger[_0xdb28('0xb')](_0xdb28('0xc'));var _0x88ca6d=_[_0xdb28('0xd')]({'responder_id':_0x523e1f['id'],'requester_id':_0x3f5a31['id'],'name':util[_0xdb28('0xe')](_0xdb28('0xf'),_0x2d6d5f[_0xdb28('0x10')]),'phone':_0x2d6d5f['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xdb28('0x11')](_0x3e3dd4[_0xdb28('0x12')],_0x2d6d5f,'\x20'),'description':intUtil[_0xdb28('0x11')](_0x3e3dd4[_0xdb28('0x13')],_0x2d6d5f,_0xdb28('0x14')),'tags':getTags(_0x3e3dd4[_0xdb28('0x15')],'name')},getCustomFields(_0x3e3dd4[_0xdb28('0x16')],_0x2d6d5f));_0x88ca6d['custom_fields']=_[_0xdb28('0x17')](_[_0xdb28('0x18')](_0x88ca6d['custom_fields'],'id'),_0xdb28('0x19'));return request({'uri':util[_0xdb28('0xe')](_0xdb28('0x1a'),_0x3d63a5[_0xdb28('0x1b')]),'method':_0xdb28('0x1c'),'body':_0x88ca6d})[_0xdb28('0x1d')](function(_0x89cb83){logger[_0xdb28('0xb')](_0xdb28('0x1e'));return _0x89cb83;});}function getUser(_0x406a0a,_0x4a8c2b){if(intUtil[_0xdb28('0x1f')](_0x4a8c2b)){return request({'uri':util[_0xdb28('0xe')](_0xdb28('0x20'),_0x406a0a[_0xdb28('0x1b')]),'qs':{'email':_0x4a8c2b}})[_0xdb28('0x1d')](function(_0x31a0a1){if(_0x31a0a1[_0xdb28('0x21')]){logger[_0xdb28('0xb')](_0xdb28('0x22'));return _[_0xdb28('0x23')](_0x31a0a1,function(_0x271a7c){return _0x271a7c[_0xdb28('0x24')][_0xdb28('0x25')]===_0x4a8c2b;});}else{logger[_0xdb28('0xb')](_0xdb28('0x26'));return request({'uri':util['format'](_0xdb28('0x27'),_0x406a0a['remoteUri'])})[_0xdb28('0x1d')](function(_0x54005d){logger[_0xdb28('0xb')](_0xdb28('0x28'));return _0x54005d;});}});}else{logger[_0xdb28('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xdb28('0x27'),_0x406a0a[_0xdb28('0x1b')])})['then'](function(_0x33f891){logger['info'](_0xdb28('0x28'));return _0x33f891;});}}function getEndUser(_0x2c1622,_0x49a31e,_0x3f398f){logger[_0xdb28('0xb')](_0xdb28('0x29'),_0x3f398f);return request({'uri':util[_0xdb28('0xe')](_0xdb28('0x2a'),_0x2c1622['remoteUri']),'qs':{'phone':_0x3f398f}})[_0xdb28('0x1d')](function(_0x3985da){if(_0x3985da[_0xdb28('0x21')]){logger['info'](_0xdb28('0x2b'));return _[_0xdb28('0x23')](_0x3985da,{'phone':_0x3f398f});}else{logger[_0xdb28('0xb')](_0xdb28('0x2c'));return request({'uri':util[_0xdb28('0xe')](_0xdb28('0x2a'),_0x2c1622[_0xdb28('0x1b')]),'method':_0xdb28('0x1c'),'body':{'name':_0x49a31e,'phone':_0x3f398f}})[_0xdb28('0x1d')](function(_0x11c600){logger[_0xdb28('0xb')](_0xdb28('0x2d'));return _0x11c600;});}});}function getAuth(_0x113b13){return util[_0xdb28('0xe')](_0xdb28('0x2e'),new Buffer(_0x113b13[_0xdb28('0x2f')]+':X')['toString']('base64'));}function request(_0x281a38){logger[_0xdb28('0x30')](_0xdb28('0x31'),JSON['stringify'](_0x281a38));return rp(_[_0xdb28('0x6')](_0x281a38,{'method':_0xdb28('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x2975df,_0x4f7ffa){var _0x7febe5=[];if(_0x2975df&&_0x2975df[_0xdb28('0x21')]>0x0){_0x7febe5=_[_0xdb28('0x33')](_0x2975df,_0x4f7ffa);}return _0x7febe5;}function getCustomFields(_0x55243c,_0x148f25){var _0x3bcbf1=[];var _0x282d8c={'custom_fields':[]};if(_0x55243c['length']>0x0){_[_0xdb28('0x34')](_0x55243c,function(_0x216b5e){if(_[_0xdb28('0x35')]([_0xdb28('0x36'),_0xdb28('0x37')],_0x216b5e[_0xdb28('0x38')])&&_0x216b5e[_0xdb28('0x39')]&&!_0x216b5e['customField']){_0x282d8c[_0x216b5e[_0xdb28('0x39')][_0xdb28('0x3a')]()]=_0x216b5e[_0xdb28('0x3b')][_0xdb28('0x3c')]();}else if(_[_0xdb28('0x35')](['string',_0xdb28('0x37')],_0x216b5e[_0xdb28('0x38')])&&_0x216b5e[_0xdb28('0x3d')]&&_0x216b5e[_0xdb28('0x3e')]){_0x282d8c[_0xdb28('0x3f')][_0xdb28('0x40')]({'id':_0x216b5e[_0xdb28('0x3d')],'value':_0x216b5e[_0xdb28('0x3b')][_0xdb28('0x3c')]()});}else if(_0x216b5e[_0xdb28('0x38')]==='variable'&&_0x216b5e[_0xdb28('0x41')]&&_0x216b5e['idField']&&_0x216b5e[_0xdb28('0x3e')]){_0x148f25[_0x216b5e['variableName']]&&_0x282d8c[_0xdb28('0x3f')][_0xdb28('0x40')]({'id':_0x216b5e[_0xdb28('0x3d')],'value':_0x148f25[_0x216b5e[_0xdb28('0x41')]][_0xdb28('0x3c')]()});}else if(_0x216b5e[_0xdb28('0x38')]==='customVariable'&&_0x216b5e[_0xdb28('0x42')]&&_0x216b5e[_0xdb28('0x42')][_0xdb28('0x43')]&&_0x216b5e['idField']&&_0x216b5e['customField']){_0x148f25[_0x216b5e[_0xdb28('0x42')][_0xdb28('0x43')][_0xdb28('0x3a')]()]&&_0x282d8c[_0xdb28('0x3f')][_0xdb28('0x40')]({'id':_0x216b5e[_0xdb28('0x3d')],'value':_0x148f25[_0x216b5e[_0xdb28('0x42')][_0xdb28('0x43')][_0xdb28('0x3a')]()][_0xdb28('0x3c')]()});}});}return _0x282d8c;}exports[_0xdb28('0x44')]=function(_0x45b425,_0x4db724,_0x362d5e,_0x32e55f,_0x4cd6f9,_0x3430ee){var _0xe9b4e,_0x4a1618;_0x3430ee[_0xdb28('0x1b')]=intUtil[_0xdb28('0x45')](_0x3430ee['remoteUri']);_0x3430ee[_0xdb28('0x46')]=intUtil[_0xdb28('0x45')](_0x3430ee['serverUrl']);if(_0x4cd6f9&&_0x4cd6f9[_0xdb28('0x47')]){logger[_0xdb28('0xb')](_0xdb28('0x48'),_0xdb28('0x49'));_0x4db724[_0xdb28('0x4a')]=util['format'](_0xdb28('0x4b'),_0x3430ee[_0xdb28('0x46')],_0x4db724['uniqueid'],md5(_0x4db724[_0xdb28('0x4c')]));}else{_0x4db724['recordingURL']='';}headers[_0xdb28('0x4d')]=getAuth(_0x3430ee);return getUser(_0x3430ee,_0x32e55f[_0xdb28('0x25')])['then'](function(_0x2ee955){_0xe9b4e=_0x2ee955;logger['info']('The\x20User\x20ID\x20is:',_0xe9b4e['id']);return getEndUser(_0x3430ee,_0x4db724[_0xdb28('0x10')],_0x4db724[_0xdb28('0x4e')]);})['then'](function(_0x332a62){_0x4a1618=_0x332a62;logger['info']('The\x20Enduser\x20ID\x20is:',_0x4a1618['id']);return getTicket(_0x3430ee,_0xe9b4e,_0x4a1618,_0x362d5e,_0x4db724);})['then'](function(_0x3aa9b5){if(_0x3aa9b5&&_0x3aa9b5['id']){logger[_0xdb28('0xb')](_0xdb28('0x1e'));logger[_0xdb28('0xb')](_0xdb28('0x4f'),_0x3aa9b5['id']);logger[_0xdb28('0xb')](_0xdb28('0x48'),_0xdb28('0x50'));emit(util['format'](_0xdb28('0x51'),_0x32e55f[_0xdb28('0x43')]),_0xdb28('0x52'),{'uri':util['format'](_0xdb28('0x53'),_0x3430ee[_0xdb28('0x1b')],_0x3aa9b5['id'])});}})[_0xdb28('0x54')](function(_0x1fdfb1){logger['error'](_0xdb28('0x48'),JSON['stringify'](_0x1fdfb1));});};exports[_0xdb28('0x55')]=function(_0x5599b3,_0x558855,_0x1ff2bb,_0x4c697a,_0x5ee119,_0x3cdcda,_0x15995f){var _0x46388f,_0x3ebb60;_0x3cdcda[_0xdb28('0x1b')]=intUtil[_0xdb28('0x45')](_0x3cdcda[_0xdb28('0x1b')]);_0x3cdcda[_0xdb28('0x46')]=intUtil[_0xdb28('0x45')](_0x3cdcda[_0xdb28('0x46')]);if(_0x15995f&&_0x15995f[_0xdb28('0x56')]&&_0x15995f['recordingFormat']!=='none'){logger[_0xdb28('0xb')](_0xdb28('0x57'),_0xdb28('0x49'));_0x558855[_0xdb28('0x4a')]=util[_0xdb28('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3cdcda[_0xdb28('0x46')],_0x558855[_0xdb28('0x4c')],md5(_0x558855[_0xdb28('0x4c')]));}headers[_0xdb28('0x4d')]=getAuth(_0x3cdcda);return getUser(_0x3cdcda,_0x4c697a[_0xdb28('0x25')])[_0xdb28('0x1d')](function(_0x348688){_0x46388f=_0x348688;logger[_0xdb28('0xb')](_0xdb28('0x58'),_0x46388f['id']);return getEndUser(_0x3cdcda,_0x558855[_0xdb28('0x59')],_0x558855['destcalleridnum']);})[_0xdb28('0x1d')](function(_0x35a49e){_0x3ebb60=_0x35a49e;logger[_0xdb28('0xb')]('The\x20Enduser\x20ID\x20is:',_0x3ebb60['id']);return getTicket(_0x3cdcda,_0x46388f,_0x3ebb60,_0x1ff2bb,_0x558855);})[_0xdb28('0x1d')](function(_0x52b683){if(_0x52b683&&_0x52b683['id']){logger[_0xdb28('0xb')](_0xdb28('0x1e'));logger[_0xdb28('0xb')](_0xdb28('0x4f'),_0x52b683['id']);logger[_0xdb28('0xb')](_0xdb28('0x57'),_0xdb28('0x50'));emit(util[_0xdb28('0xe')](_0xdb28('0x51'),_0x4c697a[_0xdb28('0x43')]),_0xdb28('0x52'),{'uri':util[_0xdb28('0xe')]('%s/helpdesk/tickets/%d',_0x3cdcda[_0xdb28('0x1b')],_0x52b683['id'])});}})[_0xdb28('0x54')](function(_0x36bf06){logger[_0xdb28('0x5a')](_0xdb28('0x57'),JSON[_0xdb28('0x5b')](_0x36bf06));});};exports[_0xdb28('0x5c')]=function(_0x381a03,_0xa17bd5,_0x306700,_0x4493b1,_0x1b7d9d,_0x483059){var _0x312a7c,_0x17c826;_0x483059[_0xdb28('0x1b')]=intUtil[_0xdb28('0x45')](_0x483059['remoteUri']);_0x483059[_0xdb28('0x46')]=intUtil[_0xdb28('0x45')](_0x483059['serverUrl']);if(_0x1b7d9d&&_0x1b7d9d[_0xdb28('0x47')]){logger[_0xdb28('0xb')]('['+_0xa17bd5[_0xdb28('0x5d')][_0xdb28('0x5e')]()+']',_0xdb28('0x49'));_0xa17bd5[_0xdb28('0x4a')]=util[_0xdb28('0xe')](_0xdb28('0x4b'),_0x483059[_0xdb28('0x46')],_0xa17bd5[_0xdb28('0x4c')],md5(_0xa17bd5[_0xdb28('0x4c')]));}else{_0xa17bd5['recordingURL']='';}headers[_0xdb28('0x4d')]=getAuth(_0x483059);return getUser(_0x483059,'')['then'](function(_0x3f4bfe){_0x312a7c=_0x3f4bfe;logger[_0xdb28('0xb')]('The\x20User\x20ID\x20is:',_0x312a7c['id']);return getEndUser(_0x483059,_0xa17bd5[_0xdb28('0x10')],_0xa17bd5[_0xdb28('0x4e')]);})['then'](function(_0x18ab39){_0x17c826=_0x18ab39;logger[_0xdb28('0xb')](_0xdb28('0x5f'),_0x17c826['id']);return getTicket(_0x483059,_0x312a7c,_0x17c826,_0x306700,_0xa17bd5);})['then'](function(_0x5d1a64){if(_0x5d1a64){logger[_0xdb28('0xb')](_0xdb28('0x1e'));logger[_0xdb28('0xb')](_0xdb28('0x4f'),_0x5d1a64['id']);}})['catch'](function(_0x25f6c1){logger['error']('['+_0xa17bd5[_0xdb28('0x5d')]['toUpperCase']()+']',JSON[_0xdb28('0x5b')](_0x25f6c1));});};
\ No newline at end of file
index 9956402..8e0b353 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x066f=['adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','Admin\x20selected','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','format','headers','POST','/api/tasks','getString','Subjects','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','info','Getting\x20admin\x20information','then','email','adminEmail'];(function(_0x10e74e,_0x1603ae){var _0x2198c1=function(_0x4b627c){while(--_0x4b627c){_0x10e74e['push'](_0x10e74e['shift']());}};_0x2198c1(++_0x1603ae);}(_0x066f,0x97));var _0xf066=function(_0x22b3fb,_0x334bf4){_0x22b3fb=_0x22b3fb-0x0;var _0x231feb=_0x066f[_0x22b3fb];return _0x231feb;};'use strict';var _=require('lodash');var rp=require(_0xf066('0x0'));var md5=require(_0xf066('0x1'));var util=require(_0xf066('0x2'));var moment=require(_0xf066('0x3'));var Promise=require(_0xf066('0x4'));var Redis=require(_0xf066('0x5'));var intUtil=require(_0xf066('0x6'));var config=require(_0xf066('0x7'));var logger=require(_0xf066('0x8'))(_0xf066('0x9'));config[_0xf066('0xa')]=_['defaults'](config[_0xf066('0xa')],{'host':_0xf066('0xb'),'port':0x18eb});var io=require(_0xf066('0xc'))(new Redis(config[_0xf066('0xa')]));function getAdminId(_0x29632e,_0xf0e54a,_0x162065,_0x5730f3){return new Promise(function(_0x1d89d9,_0x470d9b){var _0x4d26f7=![];var _0x44232f={'method':_0xf066('0xd'),'uri':_0x5730f3+'/api/selector/owners','json':!![]};_0x44232f['headers']=_0x162065;logger[_0xf066('0xe')](_0xf066('0xf'));return rp(_0x44232f)[_0xf066('0x10')](function(_0x1ac6fa){if(_0x1ac6fa){var _0x372fa4=_0x1ac6fa['users'];var _0xac1483=null;for(_0xac1483=0x0;_0xac1483<_0x372fa4['length'];_0xac1483++){if(_0x372fa4[_0xac1483][_0xf066('0x11')]===_0x29632e[_0xf066('0x12')]){_0x29632e[_0xf066('0x13')]=_0x372fa4[_0xac1483]['id'];_0x4d26f7=!![];}}if(_0x4d26f7){logger[_0xf066('0xe')](_0xf066('0x14'),_0x29632e[_0xf066('0x13')]);_0x1d89d9(_0x29632e);}else{_0x470d9b({'statusCode':0x194,'message':_0xf066('0x15')});}}else{_0x470d9b({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xf066('0x16')](function(_0x5706a5){logger[_0xf066('0x17')]('['+[_0xf0e54a['toUpperCase']()]+']',_0x5706a5[_0xf066('0x18')]);_0x470d9b(_0x5706a5);});});}function getUser(_0x5c56fd,_0x4e2c6a,_0x2050f){return function(_0x25e18c){return new Promise(function(_0x15e874,_0x29f556){var _0x23e36f={'method':'GET','uri':_0x2050f+_0xf066('0x19'),'json':!![]};_0x23e36f['headers']=_0x4e2c6a;logger[_0xf066('0xe')](_0xf066('0x1a'));return rp(_0x23e36f)[_0xf066('0x10')](function(_0x16af73){if(_0x16af73){var _0x3ea5d0=_0x16af73['users'];var _0x4be012=![];var _0x13564f=null;if(_0x25e18c[_0xf066('0x1b')]!==null){logger[_0xf066('0xe')](_0xf066('0x1c'),_0x25e18c[_0xf066('0x1b')]);_0x25e18c[_0xf066('0x1d')]=_0x25e18c[_0xf066('0x1b')];for(_0x13564f=0x0;_0x13564f<_0x3ea5d0[_0xf066('0x1e')];_0x13564f++){if(_0x3ea5d0[_0x13564f][_0xf066('0x11')]===_0x25e18c[_0xf066('0x1b')]){_0x4be012=!![];_0x25e18c[_0xf066('0x1f')]=_0x3ea5d0[_0x13564f]['id'];logger[_0xf066('0xe')](_0xf066('0x20'),_0x25e18c[_0xf066('0x1f')]);}}}if(!_0x4be012){logger['info'](_0xf066('0x21'));_0x25e18c[_0xf066('0x1d')]=_0x25e18c[_0xf066('0x12')];_0x25e18c[_0xf066('0x1f')]=_0x25e18c[_0xf066('0x13')];_0x4be012=!![];}if(_0x4be012){_0x15e874(_0x25e18c);}else{_0x29f556({'statusCode':0x194,'message':_0xf066('0x15')});}}else{_0x29f556({'statusCode':0x194,'message':_0xf066('0x15')});}})['catch'](function(_0xf95311){logger['error']('['+[_0x5c56fd[_0xf066('0x22')]()]+']',_0xf95311['message']);_0x29f556(_0xf95311);});});};}function searchContact(_0x4940e5,_0x584c50,_0x58a349,_0x354fac){return new Promise(function(_0x5aa6ed,_0x224f0c){var _0x4efe3e={'method':_0xf066('0xd'),'headers':_0x584c50,'uri':_0x4940e5+_0xf066('0x23')+_0x354fac+_0xf066('0x24')+_0x58a349+_0xf066('0x25'),'json':!![]};rp(_0x4efe3e)[_0xf066('0x10')](function(_0xa8b455){var _0x5053e2=_[_0xf066('0x26')](_0xa8b455[_0xf066('0x27')][_0xf066('0x27')],[_0x58a349,_0x354fac]);_0x5aa6ed(_0x5053e2);})[_0xf066('0x16')](function(_0x1e7add){_0x224f0c(_0x1e7add);});});}function getEndUser(_0x4de3f9,_0x22d1de,_0x76ead2){return function(_0x3c7253){return new Promise(function(_0x5a1b00,_0x525469){logger[_0xf066('0xe')](util['format'](_0xf066('0x28'),_0x3c7253['contactNumber']));searchContact(_0x76ead2,_0x22d1de,_0xf066('0x29'),_0x3c7253[_0xf066('0x2a')])[_0xf066('0x10')](function(_0x586555){if(_0x586555){_0x3c7253[_0xf066('0x2b')]=_0x586555['id'];logger[_0xf066('0xe')](_0xf066('0x2c'),_0x3c7253[_0xf066('0x2b')]);return _0x5a1b00(_0x3c7253);}searchContact(_0x76ead2,_0x22d1de,_0xf066('0x2d'),_0x3c7253[_0xf066('0x2a')])[_0xf066('0x10')](function(_0x24520f){if(_0x24520f){_0x3c7253[_0xf066('0x2b')]=_0x24520f['id'];logger[_0xf066('0xe')](_0xf066('0x2e'),_0x3c7253[_0xf066('0x2b')]);return _0x5a1b00(_0x3c7253);}createEndUser(_0x3c7253,_0x4de3f9,_0x22d1de,_0x76ead2)[_0xf066('0x10')](function(_0x61ce22){logger[_0xf066('0xe')](_0xf066('0x2f'),_0x61ce22[_0xf066('0x2b')]);return _0x5a1b00(_0x61ce22);});});})[_0xf066('0x16')](function(_0x3241a4){_0x525469(_0x3241a4);});});};}function createEndUser(_0x2d7dc5,_0x58be6f,_0xfaa250,_0x53673f){return new Promise(function(_0x42d972,_0x268f6f){var _0x4b55de=moment();var _0x46b4e0={'method':'POST','uri':_0x53673f+_0xf066('0x30'),'body':{'contact':{'last_name':_0x2d7dc5['contactNumber'],'work_number':_0x2d7dc5[_0xf066('0x2a')],'mobile_number':_0x2d7dc5['contactNumber'],'owner_id':_0x2d7dc5[_0xf066('0x1f')],'created_at':_0x4b55de[_0xf066('0x31')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x46b4e0[_0xf066('0x32')]=_0xfaa250;logger[_0xf066('0xe')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x46b4e0)[_0xf066('0x10')](function(_0x454e99){_0x2d7dc5[_0xf066('0x2b')]=_0x454e99['contact']['id'];_0x42d972(_0x2d7dc5);})['catch'](function(_0x45ea0e){logger[_0xf066('0x17')]('['+[_0x58be6f[_0xf066('0x22')]()]+']',_0x45ea0e[_0xf066('0x18')]);_0x268f6f(_0x45ea0e[_0xf066('0x18')]);});});}function getTicket(_0x1ae142,_0x2bd986,_0x29550a,_0x4622d3,_0x1bf9b3){return function(_0x4eb1ee){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x53ce86,_0x28758d){var _0xa05745=moment();var _0x8c2821={'method':_0xf066('0x33'),'uri':_0x29550a+_0xf066('0x34'),'body':{'title':intUtil[_0xf066('0x35')](_0x4622d3[_0xf066('0x36')],_0x1bf9b3,'\x20'),'description':intUtil[_0xf066('0x35')](_0x4622d3['Descriptions'],_0x1bf9b3,'\x0a'),'owner_id':_0x4eb1ee[_0xf066('0x1f')],'creater_id':_0x4eb1ee[_0xf066('0x13')],'targetable_id':_0x4eb1ee['endUserId'],'targetable_type':'Contact','created_at':_0xa05745[_0xf066('0x31')](_0xf066('0x37')),'due_date':_0xa05745[_0xf066('0x38')](0x1e,'m')[_0xf066('0x31')](_0xf066('0x37'))},'json':!![]};_0x8c2821[_0xf066('0x32')]=_0x2bd986;return rp(_0x8c2821)[_0xf066('0x10')](function(_0x91f5b2){_0x4eb1ee[_0xf066('0x39')]=_0x91f5b2[_0xf066('0x3a')]['id'];logger[_0xf066('0xe')]('Task\x20created:',_0x4eb1ee['ticketId']);_0x53ce86(_0x4eb1ee);})[_0xf066('0x16')](function(_0x587cdf){logger[_0xf066('0x17')]('['+[_0x1ae142[_0xf066('0x22')]()]+']',_0x587cdf[_0xf066('0x18')]);_0x28758d(_0x587cdf[_0xf066('0x18')]);});});};}function emit(_0x5cbed7,_0x4cf12c,_0x597a82){var _0x181bca={'uri':_0x5cbed7+_0xf066('0x3b')+_0x597a82};io['to'](util[_0xf066('0x31')](_0xf066('0x3c'),_0x4cf12c))[_0xf066('0x3d')]('trigger:browser:url',_0x181bca);}exports['cs']=function(_0x3c9d77,_0x1534cb,_0x12f7fb,_0xb4af0e,_0x4521b8,_0x491a32,_0x3026ea,_0x230f41){var _0x1fb198={};var _0x5f3314={'Authorization':_0xf066('0x3e')+_0x491a32[_0xf066('0x3f')]};_0x491a32[_0xf066('0x40')]=intUtil[_0xf066('0x41')](_0x491a32[_0xf066('0x40')]);_0x491a32[_0xf066('0x42')]=intUtil['stripTrailingSlash'](_0x491a32[_0xf066('0x42')]);var _0x112c6d=_0x491a32[_0xf066('0x40')];_0x1fb198[_0xf066('0x12')]=_0x491a32['username'];_0x1fb198[_0xf066('0x2a')]=_0x230f41[_0xf066('0x43')]()==='outbound'?_0x1534cb['destcalleridnum']:_0x1534cb[_0xf066('0x44')];_0x1fb198[_0xf066('0x45')]=_0x230f41===_0xf066('0x46')||_0x230f41==='unmanaged'?_0xf066('0x46'):'outbound';if(_0xb4af0e){_0x1fb198['agentEmail']=_0xb4af0e[_0xf066('0x11')];}var _0x4d0cca=util[_0xf066('0x31')](_0xf066('0x47'),_0x491a32[_0xf066('0x42')],_0x1534cb[_0xf066('0x48')],md5(_0x1534cb[_0xf066('0x48')]));if(_0x4521b8&&_0x4521b8[_0xf066('0x49')]){logger[_0xf066('0xe')](_0xf066('0x4a'),_0xf066('0x4b'));_0x1534cb[_0xf066('0x4c')]=_0x4d0cca;}else if(_0x3026ea&&_0x3026ea[_0xf066('0x4d')]&&_0x3026ea[_0xf066('0x4d')]!==_0xf066('0x4e')){logger[_0xf066('0xe')](_0xf066('0x4f'),_0xf066('0x4b'));_0x1534cb[_0xf066('0x4c')]=_0x4d0cca;}else{_0x1534cb[_0xf066('0x4c')]='';}return getAdminId(_0x1fb198,_0x230f41,_0x5f3314,_0x112c6d)[_0xf066('0x10')](getUser(_0x230f41,_0x5f3314,_0x112c6d))[_0xf066('0x10')](getEndUser(_0x230f41,_0x5f3314,_0x112c6d))[_0xf066('0x10')](getTicket(_0x230f41,_0x5f3314,_0x112c6d,_0x12f7fb,_0x1534cb))[_0xf066('0x10')](function(_0x2f68fc){logger[_0xf066('0xe')](util[_0xf066('0x31')](_0xf066('0x50'),_0x2f68fc['ticketId']));if(_0x230f41!==_0xf066('0x51')){logger[_0xf066('0xe')]('['+[_0x230f41[_0xf066('0x22')]()]+']',_0xf066('0x52'));emit(_0x112c6d,_0xb4af0e[_0xf066('0x53')],_0x2f68fc[_0xf066('0x2b')]);}})['catch'](function(_0x2ecb33){logger[_0xf066('0x17')]('['+[_0x230f41[_0xf066('0x22')]()]+_0xf066('0x54'),util['inspect'](_0x2ecb33,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x03b7=['remoteUri','username','toLowerCase','destcalleridnum','calleridnum','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','md5','util','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','defaults','redis','socket.io-emitter','GET','/api/selector/owners','headers','info','users','length','Requested\x20Resource\x20not\x20Found','error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','User\x20found:','userId','Admin\x20selected','adminEmail','adminId','catch','toUpperCase','/api/lookup?q=','&f=','&entities=contact','then','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','stripTrailingSlash','serverUrl'];(function(_0x2e1c5f,_0x222266){var _0x16679c=function(_0x126379){while(--_0x126379){_0x2e1c5f['push'](_0x2e1c5f['shift']());}};_0x16679c(++_0x222266);}(_0x03b7,0x16e));var _0x703b=function(_0x12fe71,_0x1ed926){_0x12fe71=_0x12fe71-0x0;var _0x4ad7b1=_0x03b7[_0x12fe71];return _0x4ad7b1;};'use strict';var _=require(_0x703b('0x0'));var rp=require('request-promise');var md5=require(_0x703b('0x1'));var util=require(_0x703b('0x2'));var moment=require(_0x703b('0x3'));var Promise=require(_0x703b('0x4'));var Redis=require(_0x703b('0x5'));var intUtil=require('./util');var config=require(_0x703b('0x6'));var logger=require(_0x703b('0x7'))(_0x703b('0x8'));config['redis']=_[_0x703b('0x9')](config[_0x703b('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x703b('0xb'))(new Redis(config[_0x703b('0xa')]));function getAdminId(_0x5f32cb,_0x43b84e,_0x522463,_0x17e432){return new Promise(function(_0x3c87f0,_0x3c0ecc){var _0x53147a=![];var _0xcfe6d4={'method':_0x703b('0xc'),'uri':_0x17e432+_0x703b('0xd'),'json':!![]};_0xcfe6d4[_0x703b('0xe')]=_0x522463;logger[_0x703b('0xf')]('Getting\x20admin\x20information');return rp(_0xcfe6d4)['then'](function(_0x384f0d){if(_0x384f0d){var _0x51c58a=_0x384f0d[_0x703b('0x10')];var _0x58814a=null;for(_0x58814a=0x0;_0x58814a<_0x51c58a[_0x703b('0x11')];_0x58814a++){if(_0x51c58a[_0x58814a]['email']===_0x5f32cb['adminEmail']){_0x5f32cb['adminId']=_0x51c58a[_0x58814a]['id'];_0x53147a=!![];}}if(_0x53147a){logger[_0x703b('0xf')]('Admin\x20found:',_0x5f32cb['adminId']);_0x3c87f0(_0x5f32cb);}else{_0x3c0ecc({'statusCode':0x194,'message':_0x703b('0x12')});}}else{_0x3c0ecc({'statusCode':0x194,'message':_0x703b('0x12')});}})['catch'](function(_0x3bdcc6){logger[_0x703b('0x13')]('['+[_0x43b84e['toUpperCase']()]+']',_0x3bdcc6[_0x703b('0x14')]);_0x3c0ecc(_0x3bdcc6);});});}function getUser(_0x313001,_0x5e8a0b,_0x3a3561){return function(_0x2baac2){return new Promise(function(_0x33a3f2,_0x5d164c){var _0x1e805d={'method':_0x703b('0xc'),'uri':_0x3a3561+_0x703b('0xd'),'json':!![]};_0x1e805d[_0x703b('0xe')]=_0x5e8a0b;logger['info'](_0x703b('0x15'));return rp(_0x1e805d)['then'](function(_0x40c022){if(_0x40c022){var _0x48fe80=_0x40c022[_0x703b('0x10')];var _0x4d706e=![];var _0x1dce08=null;if(_0x2baac2[_0x703b('0x16')]!==null){logger[_0x703b('0xf')](_0x703b('0x17'),_0x2baac2[_0x703b('0x16')]);_0x2baac2[_0x703b('0x18')]=_0x2baac2[_0x703b('0x16')];for(_0x1dce08=0x0;_0x1dce08<_0x48fe80[_0x703b('0x11')];_0x1dce08++){if(_0x48fe80[_0x1dce08][_0x703b('0x19')]===_0x2baac2[_0x703b('0x16')]){_0x4d706e=!![];_0x2baac2['userId']=_0x48fe80[_0x1dce08]['id'];logger[_0x703b('0xf')](_0x703b('0x1a'),_0x2baac2[_0x703b('0x1b')]);}}}if(!_0x4d706e){logger['info'](_0x703b('0x1c'));_0x2baac2[_0x703b('0x18')]=_0x2baac2[_0x703b('0x1d')];_0x2baac2[_0x703b('0x1b')]=_0x2baac2[_0x703b('0x1e')];_0x4d706e=!![];}if(_0x4d706e){_0x33a3f2(_0x2baac2);}else{_0x5d164c({'statusCode':0x194,'message':_0x703b('0x12')});}}else{_0x5d164c({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x703b('0x1f')](function(_0x2e5384){logger[_0x703b('0x13')]('['+[_0x313001[_0x703b('0x20')]()]+']',_0x2e5384[_0x703b('0x14')]);_0x5d164c(_0x2e5384);});});};}function searchContact(_0x3a9a92,_0x3dae63,_0x2b410c,_0x3966eb){return new Promise(function(_0x354ece,_0x390c59){var _0x554bad={'method':'GET','headers':_0x3dae63,'uri':_0x3a9a92+_0x703b('0x21')+_0x3966eb+_0x703b('0x22')+_0x2b410c+_0x703b('0x23'),'json':!![]};rp(_0x554bad)[_0x703b('0x24')](function(_0x10d0b1){var _0x24dc72=_[_0x703b('0x25')](_0x10d0b1[_0x703b('0x26')]['contacts'],[_0x2b410c,_0x3966eb]);_0x354ece(_0x24dc72);})[_0x703b('0x1f')](function(_0x50e8d9){_0x390c59(_0x50e8d9);});});}function getEndUser(_0x48b7b9,_0xd2fc66,_0x220218){return function(_0xa40fd0){return new Promise(function(_0x44c880,_0x1e94bb){logger[_0x703b('0xf')](util[_0x703b('0x27')](_0x703b('0x28'),_0xa40fd0[_0x703b('0x29')]));searchContact(_0x220218,_0xd2fc66,_0x703b('0x2a'),_0xa40fd0[_0x703b('0x29')])[_0x703b('0x24')](function(_0x2608f1){if(_0x2608f1){_0xa40fd0[_0x703b('0x2b')]=_0x2608f1['id'];logger['info'](_0x703b('0x2c'),_0xa40fd0['endUserId']);return _0x44c880(_0xa40fd0);}searchContact(_0x220218,_0xd2fc66,_0x703b('0x2d'),_0xa40fd0[_0x703b('0x29')])[_0x703b('0x24')](function(_0x24b7ff){if(_0x24b7ff){_0xa40fd0[_0x703b('0x2b')]=_0x24b7ff['id'];logger[_0x703b('0xf')](_0x703b('0x2e'),_0xa40fd0['endUserId']);return _0x44c880(_0xa40fd0);}createEndUser(_0xa40fd0,_0x48b7b9,_0xd2fc66,_0x220218)[_0x703b('0x24')](function(_0x6a952b){logger[_0x703b('0xf')](_0x703b('0x2f'),_0x6a952b[_0x703b('0x2b')]);return _0x44c880(_0x6a952b);});});})['catch'](function(_0x4ec8aa){_0x1e94bb(_0x4ec8aa);});});};}function createEndUser(_0x2dcf32,_0x133b61,_0x4aa6af,_0x33c347){return new Promise(function(_0x2e1c04,_0x100058){var _0x2230ee=moment();var _0x5774dd={'method':_0x703b('0x30'),'uri':_0x33c347+_0x703b('0x31'),'body':{'contact':{'last_name':_0x2dcf32['contactNumber'],'work_number':_0x2dcf32[_0x703b('0x29')],'mobile_number':_0x2dcf32[_0x703b('0x29')],'owner_id':_0x2dcf32[_0x703b('0x1b')],'created_at':_0x2230ee[_0x703b('0x27')](_0x703b('0x32'))}},'json':!![]};_0x5774dd[_0x703b('0xe')]=_0x4aa6af;logger[_0x703b('0xf')](_0x703b('0x33'));return rp(_0x5774dd)[_0x703b('0x24')](function(_0x44e218){_0x2dcf32[_0x703b('0x2b')]=_0x44e218[_0x703b('0x34')]['id'];_0x2e1c04(_0x2dcf32);})[_0x703b('0x1f')](function(_0x24b8cd){logger[_0x703b('0x13')]('['+[_0x133b61[_0x703b('0x20')]()]+']',_0x24b8cd['message']);_0x100058(_0x24b8cd[_0x703b('0x14')]);});});}function getTicket(_0x4ffe1a,_0xaeda5c,_0x4e55d4,_0x30ddc2,_0x38ec97){return function(_0x17ccc7){logger[_0x703b('0xf')](_0x703b('0x35'));return new Promise(function(_0xf3bea0,_0x4945c4){var _0x6aee7f=moment();var _0x176297={'method':_0x703b('0x30'),'uri':_0x4e55d4+_0x703b('0x36'),'body':{'title':intUtil[_0x703b('0x37')](_0x30ddc2[_0x703b('0x38')],_0x38ec97,'\x20'),'description':intUtil['getString'](_0x30ddc2[_0x703b('0x39')],_0x38ec97,'\x0a'),'owner_id':_0x17ccc7[_0x703b('0x1b')],'creater_id':_0x17ccc7[_0x703b('0x1e')],'targetable_id':_0x17ccc7[_0x703b('0x2b')],'targetable_type':'Contact','created_at':_0x6aee7f[_0x703b('0x27')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x6aee7f[_0x703b('0x3a')](0x1e,'m')[_0x703b('0x27')](_0x703b('0x32'))},'json':!![]};_0x176297[_0x703b('0xe')]=_0xaeda5c;return rp(_0x176297)['then'](function(_0x1574b4){_0x17ccc7[_0x703b('0x3b')]=_0x1574b4[_0x703b('0x3c')]['id'];logger[_0x703b('0xf')](_0x703b('0x3d'),_0x17ccc7[_0x703b('0x3b')]);_0xf3bea0(_0x17ccc7);})[_0x703b('0x1f')](function(_0x11376b){logger[_0x703b('0x13')]('['+[_0x4ffe1a[_0x703b('0x20')]()]+']',_0x11376b[_0x703b('0x14')]);_0x4945c4(_0x11376b[_0x703b('0x14')]);});});};}function emit(_0x119b6a,_0x16ddcd,_0x229a34){var _0x53906f={'uri':_0x119b6a+'/contacts/'+_0x229a34};io['to'](util['format'](_0x703b('0x3e'),_0x16ddcd))[_0x703b('0x3f')](_0x703b('0x40'),_0x53906f);}exports['cs']=function(_0x339950,_0x201103,_0x5a8b10,_0x4b8309,_0x1ad7b9,_0x1bff96,_0x4644aa,_0x37b97e){var _0x588973={};var _0x3e97bd={'Authorization':_0x703b('0x41')+_0x1bff96[_0x703b('0x42')]};_0x1bff96['remoteUri']=intUtil[_0x703b('0x43')](_0x1bff96['remoteUri']);_0x1bff96['serverUrl']=intUtil['stripTrailingSlash'](_0x1bff96[_0x703b('0x44')]);var _0x245792=_0x1bff96[_0x703b('0x45')];_0x588973['adminEmail']=_0x1bff96[_0x703b('0x46')];_0x588973['contactNumber']=_0x37b97e[_0x703b('0x47')]()==='outbound'?_0x201103[_0x703b('0x48')]:_0x201103[_0x703b('0x49')];_0x588973['callDirection']=_0x37b97e===_0x703b('0x4a')||_0x37b97e===_0x703b('0x4b')?'queue':'outbound';if(_0x4b8309){_0x588973[_0x703b('0x16')]=_0x4b8309[_0x703b('0x19')];}var _0x41c6d1=util[_0x703b('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1bff96[_0x703b('0x44')],_0x201103[_0x703b('0x4c')],md5(_0x201103[_0x703b('0x4c')]));if(_0x1ad7b9&&_0x1ad7b9[_0x703b('0x4d')]){logger[_0x703b('0xf')](_0x703b('0x4e'),'Recording\x20is\x20enabled!');_0x201103[_0x703b('0x4f')]=_0x41c6d1;}else if(_0x4644aa&&_0x4644aa[_0x703b('0x50')]&&_0x4644aa[_0x703b('0x50')]!==_0x703b('0x51')){logger['info']('[OUTBOUND]',_0x703b('0x52'));_0x201103[_0x703b('0x4f')]=_0x41c6d1;}else{_0x201103['recordingURL']='';}return getAdminId(_0x588973,_0x37b97e,_0x3e97bd,_0x245792)[_0x703b('0x24')](getUser(_0x37b97e,_0x3e97bd,_0x245792))[_0x703b('0x24')](getEndUser(_0x37b97e,_0x3e97bd,_0x245792))[_0x703b('0x24')](getTicket(_0x37b97e,_0x3e97bd,_0x245792,_0x5a8b10,_0x201103))[_0x703b('0x24')](function(_0x2ead6c){logger['info'](util[_0x703b('0x27')](_0x703b('0x53'),_0x2ead6c[_0x703b('0x3b')]));if(_0x37b97e!==_0x703b('0x4b')){logger[_0x703b('0xf')]('['+[_0x37b97e[_0x703b('0x20')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x245792,_0x4b8309[_0x703b('0x54')],_0x2ead6c[_0x703b('0x2b')]);}})[_0x703b('0x1f')](function(_0x5dc3b1){logger[_0x703b('0x13')]('['+[_0x37b97e[_0x703b('0x20')]()]+_0x703b('0x55'),util[_0x703b('0x56')](_0x5dc3b1,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 3e1ad58..14fbb62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5120=['zendesk','salesforce','sugarcrm','desk','vtiger','dynamics365','servicenow','exec','includes','data1','toLowerCase','Configurations','data3','queue','outbound','log','unmanaged','freshdesk','freshsales','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data2','util','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./freshsales'];(function(_0x54a855,_0x32ab8c){var _0x4bd7c9=function(_0x180406){while(--_0x180406){_0x54a855['push'](_0x54a855['shift']());}};_0x4bd7c9(++_0x32ab8c);}(_0x5120,0x179));var _0x0512=function(_0x3d0528,_0x21a0b7){_0x3d0528=_0x3d0528-0x0;var _0x4ebb2d=_0x5120[_0x3d0528];return _0x4ebb2d;};'use strict';var _=require('lodash');var util=require(_0x0512('0x0'));var zendesk=require('./zendesk');var salesforce=require(_0x0512('0x1'));var sugarcrm=require(_0x0512('0x2'));var freshdesk=require(_0x0512('0x3'));var zoho=require(_0x0512('0x4'));var desk=require(_0x0512('0x5'));var vtiger=require('./vtiger');var servicenow=require('./servicenow');var dynamics365=require('./dynamics365');var freshsales=require(_0x0512('0x6'));var integrations=[_0x0512('0x7'),_0x0512('0x8'),_0x0512('0x9'),'freshdesk','zoho',_0x0512('0xa'),_0x0512('0xb'),_0x0512('0xc'),'freshsales',_0x0512('0xd')];exports[_0x0512('0xe')]=function(_0x3df4c6,_0x2210b9,_0x175d97,_0x5a8a9a,_0x3b65a1,_0x4fbe7f){if(_0x175d97){if(_[_0x0512('0xf')](integrations,_0x3df4c6[_0x0512('0x10')][_0x0512('0x11')]())){try{var _0x46b3e3=null;var _0x174782='';var _0x531fd5=_0x175d97[_0x3df4c6[_0x0512('0x10')][_0x0512('0x11')]()];if(_0x531fd5){var _0x1f597c=_0x531fd5[_0x3df4c6['data2']];if(_0x1f597c){var _0x1bd761=_['find'](_0x1f597c[_0x0512('0x12')],{'id':parseInt(_0x3df4c6[_0x0512('0x13')],0xa)});if(_0x1bd761){if(_0x5a8a9a){if(_0x3b65a1&&_0x2210b9[_0x0512('0x14')]){_0x174782=_0x0512('0x14');}else if(_0x2210b9['routeId']){_0x174782=_0x0512('0x15');}else{console[_0x0512('0x16')]('EVENT\x20UNKNOWN',_0x2210b9);}}else{_0x174782=_0x0512('0x17');}switch(_0x3df4c6[_0x0512('0x10')][_0x0512('0x11')]()){case'zendesk':zendesk[_0x174782](_0x3df4c6,_0x2210b9,_0x1bd761,_0x5a8a9a,_0x3b65a1,_0x1f597c,_0x4fbe7f);break;case _0x0512('0x8'):salesforce[_0x174782](_0x3df4c6,_0x2210b9,_0x1bd761,_0x5a8a9a,_0x3b65a1,_0x1f597c,_0x4fbe7f);break;case _0x0512('0x9'):sugarcrm[_0x174782](_0x3df4c6,_0x2210b9,_0x1bd761,_0x5a8a9a,_0x3b65a1,_0x1f597c,_0x4fbe7f);break;case _0x0512('0x18'):freshdesk[_0x174782](_0x3df4c6,_0x2210b9,_0x1bd761,_0x5a8a9a,_0x3b65a1,_0x1f597c,_0x4fbe7f);break;case'zoho':zoho[_0x174782](_0x3df4c6,_0x2210b9,_0x1bd761,_0x5a8a9a,_0x3b65a1,_0x1f597c,_0x4fbe7f);break;case'desk':desk[_0x174782](_0x3df4c6,_0x2210b9,_0x1bd761,_0x5a8a9a,_0x3b65a1,_0x1f597c,_0x4fbe7f);break;case _0x0512('0xb'):vtiger[_0x174782](_0x3df4c6,_0x2210b9,_0x1bd761,_0x5a8a9a,_0x3b65a1,_0x1f597c,_0x4fbe7f);break;case _0x0512('0x19'):freshsales['cs'](_0x3df4c6,_0x2210b9,_0x1bd761,_0x5a8a9a,_0x3b65a1,_0x1f597c,_0x4fbe7f,_0x174782);break;case _0x0512('0xd'):servicenow['cs'](_0x3df4c6,_0x2210b9,_0x1bd761,_0x5a8a9a,_0x3b65a1,_0x1f597c,_0x4fbe7f,_0x174782);break;case _0x0512('0xc'):dynamics365['cs'](_0x3df4c6,_0x2210b9,_0x1bd761,_0x5a8a9a,_0x3b65a1,_0x1f597c,_0x4fbe7f,_0x174782);break;default:console[_0x0512('0x16')]('unknown\x20integration');}}else{_0x46b3e3=require(_0x0512('0x1a'))(_0x3df4c6[_0x0512('0x10')][_0x0512('0x11')]());_0x46b3e3[_0x0512('0x1b')](_0x0512('0x1c'),util[_0x0512('0x1d')](_0x0512('0x1e'),_0x3df4c6[_0x0512('0x10')][_0x0512('0x11')](),_0x3df4c6[_0x0512('0x13')]));}}else{_0x46b3e3=require(_0x0512('0x1a'))(_0x3df4c6[_0x0512('0x10')]['toLowerCase']());_0x46b3e3['error'](_0x0512('0x1c'),util[_0x0512('0x1d')]('%s\x20account\x20#%s\x20not\x20found',_0x3df4c6[_0x0512('0x10')][_0x0512('0x11')](),_0x3df4c6[_0x0512('0x1f')]));}}else{}}catch(_0x2689ff){console[_0x0512('0x1b')](_0x2689ff);}}}};
\ No newline at end of file
+var _0x0f07=['./zendesk','./salesforce','./sugarcrm','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','zoho','desk','vtiger','exec','includes','data1','find','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','toLowerCase','freshdesk','servicenow','dynamics365','unknown\x20integration','error','%s\x20configuration\x20#%s\x20not\x20found','data3','format','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util'];(function(_0x3d8ad2,_0x243691){var _0x3b7f9d=function(_0x213a30){while(--_0x213a30){_0x3d8ad2['push'](_0x3d8ad2['shift']());}};_0x3b7f9d(++_0x243691);}(_0x0f07,0x1df));var _0x70f0=function(_0x15e55a,_0x284ab5){_0x15e55a=_0x15e55a-0x0;var _0x5cf240=_0x0f07[_0x15e55a];return _0x5cf240;};'use strict';var _=require(_0x70f0('0x0'));var util=require(_0x70f0('0x1'));var zendesk=require(_0x70f0('0x2'));var salesforce=require(_0x70f0('0x3'));var sugarcrm=require(_0x70f0('0x4'));var freshdesk=require('./freshdesk');var zoho=require(_0x70f0('0x5'));var desk=require(_0x70f0('0x6'));var vtiger=require(_0x70f0('0x7'));var servicenow=require(_0x70f0('0x8'));var dynamics365=require(_0x70f0('0x9'));var freshsales=require(_0x70f0('0xa'));var integrations=[_0x70f0('0xb'),_0x70f0('0xc'),_0x70f0('0xd'),'freshdesk',_0x70f0('0xe'),_0x70f0('0xf'),_0x70f0('0x10'),'dynamics365','freshsales','servicenow'];exports[_0x70f0('0x11')]=function(_0x13e2d8,_0x114c0d,_0x25c0cf,_0x546253,_0x3fb952,_0x2de92f){if(_0x25c0cf){if(_[_0x70f0('0x12')](integrations,_0x13e2d8[_0x70f0('0x13')]['toLowerCase']())){try{var _0x4d17de=null;var _0x107c39='';var _0x21049f=_0x25c0cf[_0x13e2d8[_0x70f0('0x13')]['toLowerCase']()];if(_0x21049f){var _0x3d952b=_0x21049f[_0x13e2d8['data2']];if(_0x3d952b){var _0x4db8f5=_[_0x70f0('0x14')](_0x3d952b['Configurations'],{'id':parseInt(_0x13e2d8['data3'],0xa)});if(_0x4db8f5){if(_0x546253){if(_0x3fb952&&_0x114c0d['queue']){_0x107c39='queue';}else if(_0x114c0d[_0x70f0('0x15')]){_0x107c39=_0x70f0('0x16');}else{console[_0x70f0('0x17')](_0x70f0('0x18'),_0x114c0d);}}else{_0x107c39=_0x70f0('0x19');}switch(_0x13e2d8['data1'][_0x70f0('0x1a')]()){case _0x70f0('0xb'):zendesk[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case'salesforce':salesforce[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case _0x70f0('0xd'):sugarcrm[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case _0x70f0('0x1b'):freshdesk[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case _0x70f0('0xe'):zoho[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case _0x70f0('0xf'):desk[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case'vtiger':vtiger[_0x107c39](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f);break;case'freshsales':freshsales['cs'](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f,_0x107c39);break;case _0x70f0('0x1c'):servicenow['cs'](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f,_0x107c39);break;case _0x70f0('0x1d'):dynamics365['cs'](_0x13e2d8,_0x114c0d,_0x4db8f5,_0x546253,_0x3fb952,_0x3d952b,_0x2de92f,_0x107c39);break;default:console['log'](_0x70f0('0x1e'));}}else{_0x4d17de=require('../../../../config/logger')(_0x13e2d8[_0x70f0('0x13')]['toLowerCase']());_0x4d17de[_0x70f0('0x1f')]('[EXEC]',util['format'](_0x70f0('0x20'),_0x13e2d8['data1']['toLowerCase'](),_0x13e2d8[_0x70f0('0x21')]));}}else{_0x4d17de=require('../../../../config/logger')(_0x13e2d8['data1'][_0x70f0('0x1a')]());_0x4d17de[_0x70f0('0x1f')]('[EXEC]',util[_0x70f0('0x22')](_0x70f0('0x23'),_0x13e2d8['data1']['toLowerCase'](),_0x13e2d8[_0x70f0('0x24')]));}}else{}}catch(_0x190030){console[_0x70f0('0x1f')](_0x190030);}}}};
\ No newline at end of file
index 7ed0b73..5192951 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x671c=['sobject','find','length','Email','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','then','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','Contact','execute','$or','Lead','account_contact_lead','merge','Account','additionalSearchLead','additionalSearchAccount','first','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','<unknown>','format','Caller\x20-\x20%s','Company','upperFirst','includes','string','picklist','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','remoteUri','clientId','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','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','calleridnum',']\x20Ticket\x20%s\x20created.','toUpperCase','lodash','bluebird','md5','jsforce','util','../../../../config/environment','salesforce','redis','defaults','localhost','socket.io-emitter','getString','Subjects','Descriptions','ticketType','Task','IsReminderSet','IsRecurrence','endUserType','contact','WhoId','WhatId','Case','ContactId','account','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','create','isNil'];(function(_0x23ede4,_0x10e9de){var _0x1b8d61=function(_0x15ee33){while(--_0x15ee33){_0x23ede4['push'](_0x23ede4['shift']());}};_0x1b8d61(++_0x10e9de);}(_0x671c,0x1c8));var _0xc671=function(_0x1b7e0c,_0x318d81){_0x1b7e0c=_0x1b7e0c-0x0;var _0x20548d=_0x671c[_0x1b7e0c];return _0x20548d;};'use strict';var _=require(_0xc671('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc671('0x1'));var md5=require(_0xc671('0x2'));var jsforce=require(_0xc671('0x3'));var util=require(_0xc671('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xc671('0x5'));var logger=require('../../../../config/logger')(_0xc671('0x6'));config[_0xc671('0x7')]=_[_0xc671('0x8')](config[_0xc671('0x7')],{'host':_0xc671('0x9'),'port':0x18eb});var io=require(_0xc671('0xa'))(new Redis(config['redis']));function emit(_0x151add,_0x11cb9d,_0x314844){io['to'](_0x151add)['emit'](_0x11cb9d,_0x314844);}function getTicket(_0x3dd70a,_0x227912,_0x5451d8,_0x3f83a9,_0x242544,_0x461253,_0x57872a,_0x481190){var _0x566a07=Object['assign']({},{'OwnerId':_0x227912['id'],'Subject':intUtil[_0xc671('0xb')](_0x3f83a9[_0xc671('0xc')],_0x242544,'\x20'),'Description':intUtil[_0xc671('0xb')](_0x3f83a9[_0xc671('0xd')],_0x242544,'\x0a')},getCustomFields(_0x461253,_0x242544));if(_0x5451d8){if(_0x3f83a9[_0xc671('0xe')]===_0xc671('0xf')){_0x566a07['ActivityDate']=moment['utc']();_0x566a07[_0xc671('0x10')]=![];_0x566a07[_0xc671('0x11')]=![];if(_0x5451d8[_0xc671('0x12')]===_0xc671('0x13')||_0x5451d8[_0xc671('0x12')]==='lead'){_0x566a07[_0xc671('0x14')]=_0x5451d8['id'];}else if(_0x5451d8[_0xc671('0x12')]==='account'){_0x566a07[_0xc671('0x15')]=_0x5451d8['id'];}}else if(_0x3f83a9[_0xc671('0xe')]===_0xc671('0x16')){if(_0x5451d8[_0xc671('0x12')]===_0xc671('0x13')){_0x566a07[_0xc671('0x17')]=_0x5451d8['id'];}else if(_0x5451d8[_0xc671('0x12')]===_0xc671('0x18')){_0x566a07[_0xc671('0x19')]=_0x5451d8['id'];}else if(_0x5451d8[_0xc671('0x12')]===_0xc671('0x1a')&&_0x3f83a9[_0xc671('0x1b')]){_0x566a07[_0x3f83a9[_0xc671('0x1b')]]=_0x5451d8['id'];}else{logger[_0xc671('0x1c')](_0xc671('0x1d'));}}}return _0x57872a['sobject'](_0x3f83a9[_0xc671('0xe')])[_0xc671('0x1e')](_0x566a07);}function getUser(_0x202c9c,_0x127516,_0x401d03){if(!_[_0xc671('0x1f')](_0x127516)&&intUtil['validateEmail'](_0x127516)){var _0x3102f9={'Email':_0x127516};var _0x586f7c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x401d03[_0xc671('0x20')]('User')[_0xc671('0x21')](_0x3102f9,_0x586f7c)['execute']()['then'](function(_0x2352e7){if(_0x2352e7[_0xc671('0x22')]){var _0xaa211f=_['find'](_0x2352e7,function(_0x5f4c70){return _0x5f4c70[_0xc671('0x23')]===_0x127516;});if(_0xaa211f){logger[_0xc671('0x1c')]('Agent\x20%s\x20found.',_0x127516);return BPromise[_0xc671('0x24')]({'id':_0xaa211f['Id'],'name':_0xaa211f[_0xc671('0x25')]});}}else{logger['info'](_0xc671('0x26'),_0x127516);return _0x401d03[_0xc671('0x27')]()['then'](function(_0x2cc71b){return BPromise[_0xc671('0x24')]({'id':_0x2cc71b[_0xc671('0x28')],'name':_0x2cc71b[_0xc671('0x29')]});});}});}else{logger[_0xc671('0x1c')](_0xc671('0x26'),_0x127516);return _0x401d03[_0xc671('0x27')]()[_0xc671('0x2a')](function(_0x4c3a37){return BPromise[_0xc671('0x24')]({'id':_0x4c3a37[_0xc671('0x28')],'name':_0x4c3a37[_0xc671('0x29')]});});}}function getEndUser(_0x15f624,_0x1202b1,_0x3c445e,_0x47a61d,_0x3db413){var _0x4f6672={'$or':{'Phone':_0x47a61d}};var _0x2e18d6={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xc671('0x24')]()[_0xc671('0x2a')](function(){logger['info'](_0xc671('0x2b'),_0x47a61d,_0x1202b1[_0xc671('0x2c')]);switch(_0x1202b1['moduleSearch']){case'contact_lead':var _0xd4352c=_[_0xc671('0x2d')](_0x4f6672);if(_0x1202b1['additionalSearchContact']){var _0xa7b86e={};_0xa7b86e[_0x1202b1[_0xc671('0x2e')]]=_0x47a61d;_['merge'](_0xd4352c['$or'],_0xa7b86e);}return _0x3db413[_0xc671('0x20')](_0xc671('0x2f'))['find'](_0xd4352c,_0x2e18d6)[_0xc671('0x30')]()[_0xc671('0x2a')](function(_0x2cd424){if(_0x2cd424&&_0x2cd424[_0xc671('0x22')]){return _0x2cd424;}else{var _0x3f2cb4=_[_0xc671('0x2d')](_0x4f6672);if(_0x1202b1['additionalSearchLead']){var _0x47b11b={};_0x47b11b[_0x1202b1['additionalSearchLead']]=_0x47a61d;_['merge'](_0x3f2cb4[_0xc671('0x31')],_0x47b11b);}return _0x3db413[_0xc671('0x20')](_0xc671('0x32'))[_0xc671('0x21')](_0x3f2cb4,_0x2e18d6);}});case _0xc671('0x33'):var _0x29b037=_[_0xc671('0x2d')](_0x4f6672);if(_0x1202b1['additionalSearchAccount']){var _0xa7b86e={};_0xa7b86e[_0x1202b1['additionalSearchAccount']]=_0x47a61d;_[_0xc671('0x34')](_0x29b037[_0xc671('0x31')],_0xa7b86e);}return _0x3db413[_0xc671('0x20')](_0xc671('0x35'))[_0xc671('0x21')](_0x29b037,_0x2e18d6)[_0xc671('0x30')]()['then'](function(_0x2b4222){if(_0x2b4222&&_0x2b4222['length']){return _0x2b4222;}else{var _0x3aefd4=_[_0xc671('0x2d')](_0x4f6672);if(_0x1202b1[_0xc671('0x2e')]){var _0x364e72={};_0x364e72[_0x1202b1[_0xc671('0x2e')]]=_0x47a61d;_[_0xc671('0x34')](_0x3aefd4[_0xc671('0x31')],_0x364e72);}return _0x3db413[_0xc671('0x20')](_0xc671('0x2f'))[_0xc671('0x21')](_0x3aefd4,_0x2e18d6)[_0xc671('0x2a')](function(_0x3e0691){if(_0x3e0691&&_0x3e0691['length']){return _0x3e0691;}else{var _0x4a8fca=_['cloneDeep'](_0x4f6672);if(_0x1202b1[_0xc671('0x36')]){var _0x2966de={};_0x2966de[_0x1202b1['additionalSearchLead']]=_0x47a61d;_['merge'](_0x4a8fca[_0xc671('0x31')],_0x2966de);}return _0x3db413['sobject']('Lead')[_0xc671('0x21')](_0x4a8fca,_0x2e18d6);}});}});case _0xc671('0x13'):var _0xd4352c=_[_0xc671('0x2d')](_0x4f6672);if(_0x1202b1[_0xc671('0x2e')]){var _0xa7b86e={};_0xa7b86e[_0x1202b1[_0xc671('0x2e')]]=_0x47a61d;_[_0xc671('0x34')](_0xd4352c[_0xc671('0x31')],_0xa7b86e);}return _0x3db413[_0xc671('0x20')](_0xc671('0x2f'))[_0xc671('0x21')](_0xd4352c,_0x2e18d6)[_0xc671('0x30')]();case _0xc671('0x1a'):var _0xb4577=_[_0xc671('0x2d')](_0x4f6672);if(_0x1202b1[_0xc671('0x36')]){var _0xa7b86e={};_0xa7b86e[_0x1202b1['additionalSearchLead']]=_0x47a61d;_['merge'](_0xb4577[_0xc671('0x31')],_0xa7b86e);}return _0x3db413[_0xc671('0x20')](_0xc671('0x32'))[_0xc671('0x21')](_0xb4577,_0x2e18d6);case _0xc671('0x18'):var _0x29b037=_['cloneDeep'](_0x4f6672);if(_0x1202b1[_0xc671('0x37')]){var _0xa7b86e={};_0xa7b86e[_0x1202b1['additionalSearchAccount']]=_0x47a61d;_['merge'](_0x29b037['$or'],_0xa7b86e);}return _0x3db413[_0xc671('0x20')]('Account')['find'](_0x29b037,_0x2e18d6);default:return null;}})[_0xc671('0x2a')](function(_0x3c3978){if(_0x3c3978&&_0x3c3978[_0xc671('0x22')]){var _0x51e862=_[_0xc671('0x38')](_0x3c3978);if(_0x51e862){return BPromise[_0xc671('0x24')]({'id':_0x51e862['Id'],'name':_0x51e862[_0xc671('0x25')],'phone':_0x51e862['Phone'],'endUserType':_0x51e862[_0xc671('0x39')][_0xc671('0x3a')][_0xc671('0x3b')]()});}}})[_0xc671('0x2a')](function(_0x496062){if(_0x496062){logger['info'](_0xc671('0x3c'),_0x496062[_0xc671('0x12')],_0x47a61d);return BPromise[_0xc671('0x24')](_0x496062);}else{logger[_0xc671('0x1c')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x47a61d);var _0x1efe94={'Phone':_0x47a61d};if(_0x1202b1[_0xc671('0x3d')]){if(_0x1202b1[_0xc671('0x3d')]===_0xc671('0x13')){logger[_0xc671('0x1c')](_0xc671('0x3e'),_0x47a61d,_0x1202b1['moduleCreate']);_0x1efe94[_0xc671('0x3f')]=_0x3c445e!==_0xc671('0x40')?_0x3c445e:util['format']('Caller\x20-\x20%s',_0x47a61d);}else if(_0x1202b1[_0xc671('0x3d')]===_0xc671('0x1a')){logger[_0xc671('0x1c')](_0xc671('0x3e'),_0x47a61d,_0x1202b1['moduleCreate']);_0x1efe94[_0xc671('0x3f')]=_0x3c445e!=='<unknown>'?_0x3c445e:util[_0xc671('0x41')](_0xc671('0x42'),_0x47a61d);_0x1efe94[_0xc671('0x43')]='No\x20Company';}else if(_0x1202b1[_0xc671('0x3d')]==='account'){logger[_0xc671('0x1c')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x47a61d,_0x1202b1['moduleCreate']);_0x1efe94['Name']=_0x3c445e!==_0xc671('0x40')?_0x3c445e:util['format']('Caller\x20-\x20%s',_0x47a61d);}else{return null;}}return _0x3db413[_0xc671('0x20')](_[_0xc671('0x44')](_0x1202b1[_0xc671('0x3d')]))['create'](_0x1efe94)[_0xc671('0x2a')](function(_0x3dfb55){return BPromise[_0xc671('0x24')]({'id':_0x3dfb55['id'],'endUserType':_0x1202b1['moduleCreate']});});}});}function getCustomFields(_0x5e4df4,_0x481df0){var _0x5ab13={};if(_0x5e4df4[_0xc671('0x22')]>0x0){_['forEach'](_0x5e4df4,function(_0x197438){if(_[_0xc671('0x45')]([_0xc671('0x46'),_0xc671('0x47')],_0x197438[_0xc671('0x3a')])&&_0x197438[_0xc671('0x48')]){_0x5ab13[_0x197438[_0xc671('0x48')]]=_0x197438['content'][_0xc671('0x49')]();}else if(_0x197438['type']===_0xc671('0x4a')&&_0x197438[_0xc671('0x4b')]&&_0x197438[_0xc671('0x48')]){_0x481df0[_0x197438[_0xc671('0x4b')]]&&(_0x5ab13[_0x197438[_0xc671('0x48')]]=_0x481df0[_0x197438[_0xc671('0x4b')]][_0xc671('0x49')]());}else if(_0x197438[_0xc671('0x3a')]===_0xc671('0x4c')&&_0x197438[_0xc671('0x4d')]&&_0x197438[_0xc671('0x4d')]['name']&&_0x197438['idField']){_0x481df0[_0x197438[_0xc671('0x4d')]['name'][_0xc671('0x3b')]()]&&(_0x5ab13[_0x197438[_0xc671('0x48')]]=_0x481df0[_0x197438['Variable'][_0xc671('0x4e')][_0xc671('0x3b')]()][_0xc671('0x49')]());}});}return _0x5ab13;}function getConnection(_0x3af5ae){var _0x446c7c=_0x3af5ae[_0xc671('0x4f')][_0xc671('0x50')](_0x3af5ae['securityToken']);var _0x27ebae=new jsforce['Connection']({'oauth2':{'loginUrl':_0x3af5ae[_0xc671('0x51')]||'https://login.salesforce.com','clientId':_0x3af5ae[_0xc671('0x52')],'clientSecret':_0x3af5ae['clientSecret']}});return _0x27ebae['login'](_0x3af5ae[_0xc671('0x53')],_0x446c7c)[_0xc671('0x2a')](function(){logger[_0xc671('0x1c')](_0xc671('0x54'));return _0x27ebae;});}exports[_0xc671('0x55')]=function(_0x44bdb1,_0x410dd5,_0x34581e,_0x3b7188,_0x4db0f0,_0x3ea93b){var _0x33b4f4,_0x10417b,_0x24987f,_0x23471a;_0x3ea93b[_0xc671('0x56')]=intUtil[_0xc671('0x57')](_0x3ea93b['serverUrl']);_0x3ea93b[_0xc671('0x51')]=intUtil[_0xc671('0x57')](_0x3ea93b[_0xc671('0x51')]);if(_0x4db0f0&&_0x4db0f0[_0xc671('0x58')]){logger['info'](_0xc671('0x59'),_0xc671('0x5a'));_0x410dd5[_0xc671('0x5b')]=util[_0xc671('0x41')](_0xc671('0x5c'),_0x3ea93b[_0xc671('0x56')],_0x410dd5[_0xc671('0x5d')],md5(_0x410dd5[_0xc671('0x5d')]));}else{_0x410dd5[_0xc671('0x5b')]='';}return getConnection(_0x3ea93b)[_0xc671('0x2a')](function(_0x3c98fe){_0x23471a=_0x3c98fe;return getUser(_0x3ea93b,_0x3b7188[_0xc671('0x5e')],_0x23471a);})[_0xc671('0x2a')](function(_0x3ddf53){_0x33b4f4=_0x3ddf53;return getEndUser(_0x3ea93b,_0x34581e,_0x410dd5[_0xc671('0x5f')],_0x410dd5['calleridnum'],_0x23471a);})[_0xc671('0x2a')](function(_0x70a14){_0x10417b=_0x70a14;return getTicket(_0x3ea93b,_0x33b4f4,_0x10417b,_0x34581e,_0x410dd5,_0x34581e[_0xc671('0x60')],_0x23471a,_0xc671('0x55'));})[_0xc671('0x2a')](function(_0x3dae1){_0x24987f=_0x3dae1;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x24987f['id']);logger[_0xc671('0x1c')](_0xc671('0x61'),_0x24987f['id'],_0x3b7188[_0xc671('0x4e')],_0x3ea93b['type']);switch(_0x3ea93b[_0xc671('0x3a')]){case'integrationTab':emit(util['format'](_0xc671('0x62'),_0x3b7188['name']),_0xc671('0x63'),{'recordId':_0x24987f['id']});break;case _0xc671('0x64'):emit(util[_0xc671('0x41')](_0xc671('0x62'),_0x3b7188[_0xc671('0x4e')]),'trigger:browser:url',{'uri':util[_0xc671('0x41')](_0xc671('0x65'),_0x23471a[_0xc671('0x66')],_0x24987f['id'])});break;default:logger['error'](_0xc671('0x67'));}})[_0xc671('0x68')](function(_0x56e2ed){logger[_0xc671('0x69')]('[QUEUE]',_0x56e2ed);});};exports[_0xc671('0x6a')]=function(_0x44c43e,_0xf450b6,_0x33083f,_0x37bd0b,_0x57081c,_0x5c9585,_0x345843){var _0x4c3f18,_0x46cfe1,_0x4ad8c0,_0x3dfc7a;_0x5c9585['serverUrl']=intUtil['stripTrailingSlash'](_0x5c9585['serverUrl']);_0x5c9585['remoteUri']=intUtil['stripTrailingSlash'](_0x5c9585[_0xc671('0x51')]);if(_0x345843&&_0x345843[_0xc671('0x6b')]&&_0x345843['recordingFormat']!==_0xc671('0x6c')){logger[_0xc671('0x1c')](_0xc671('0x6d'),_0xc671('0x5a'));_0xf450b6[_0xc671('0x5b')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5c9585[_0xc671('0x56')],_0xf450b6[_0xc671('0x5d')],md5(_0xf450b6[_0xc671('0x5d')]));}return getConnection(_0x5c9585)[_0xc671('0x2a')](function(_0x2f7271){_0x3dfc7a=_0x2f7271;return getUser(_0x5c9585,_0x37bd0b[_0xc671('0x5e')],_0x3dfc7a);})[_0xc671('0x2a')](function(_0x22bba4){_0x4c3f18=_0x22bba4;return getEndUser(_0x5c9585,_0x33083f,_0xf450b6[_0xc671('0x6e')],_0xf450b6[_0xc671('0x6f')],_0x3dfc7a);})[_0xc671('0x2a')](function(_0x5324ff){_0x46cfe1=_0x5324ff;return getTicket(_0x5c9585,_0x4c3f18,_0x46cfe1,_0x33083f,_0xf450b6,_0x33083f[_0xc671('0x60')],_0x3dfc7a,_0xc671('0x6a'));})[_0xc671('0x2a')](function(_0x21cc0d){_0x4ad8c0=_0x21cc0d;logger[_0xc671('0x1c')](_0xc671('0x70'),_0x4ad8c0['id']);logger[_0xc671('0x1c')](_0xc671('0x71'),_0x4ad8c0['id'],_0x37bd0b['name'],_0x5c9585[_0xc671('0x3a')]);switch(_0x5c9585[_0xc671('0x3a')]){case _0xc671('0x72'):emit(util[_0xc671('0x41')](_0xc671('0x62'),_0x37bd0b[_0xc671('0x4e')]),_0xc671('0x63'),{'recordId':_0x4ad8c0['id']});break;case _0xc671('0x64'):emit(util[_0xc671('0x41')](_0xc671('0x62'),_0x37bd0b[_0xc671('0x4e')]),_0xc671('0x73'),{'uri':util[_0xc671('0x41')](_0xc671('0x65'),_0x3dfc7a[_0xc671('0x66')],_0x4ad8c0['id'])});break;default:logger[_0xc671('0x69')](_0xc671('0x6d'),_0xc671('0x74'));}})['catch'](function(_0x4e802c){logger['error']('[OUTBOUND]',_0x4e802c);});};exports[_0xc671('0x75')]=function(_0xc0400e,_0x3ab1da,_0x384550,_0x2fc5a3,_0x2cbcc8,_0x19a503){var _0x38ed30,_0x40175e,_0x35391e,_0x4d376d;_0x19a503[_0xc671('0x56')]=intUtil[_0xc671('0x57')](_0x19a503[_0xc671('0x56')]);_0x19a503[_0xc671('0x51')]=intUtil[_0xc671('0x57')](_0x19a503[_0xc671('0x51')]);if(_0x2cbcc8&&_0x2cbcc8['monitor_format']){logger[_0xc671('0x1c')]('['+_0x3ab1da[_0xc671('0x76')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x3ab1da['recordingURL']=util[_0xc671('0x41')](_0xc671('0x5c'),_0x19a503['serverUrl'],_0x3ab1da['uniqueid'],md5(_0x3ab1da[_0xc671('0x5d')]));}else{_0x3ab1da[_0xc671('0x5b')]='';}return getConnection(_0x19a503)[_0xc671('0x2a')](function(_0x5533a6){_0x4d376d=_0x5533a6;if(!_[_0xc671('0x1f')](_0x2fc5a3)){return getUser(_0x19a503,_0x2fc5a3['name'],_0x4d376d);}else{return getUser(_0x19a503,null,_0x4d376d);}})[_0xc671('0x2a')](function(_0x33c4ec){_0x38ed30=_0x33c4ec;return getEndUser(_0x19a503,_0x384550,_0x3ab1da[_0xc671('0x5f')],_0x3ab1da[_0xc671('0x77')],_0x4d376d);})['then'](function(_0x582d1c){_0x40175e=_0x582d1c;return getTicket(_0x19a503,_0x38ed30,_0x40175e,_0x384550,_0x3ab1da,_0x384550[_0xc671('0x60')],_0x4d376d);})[_0xc671('0x2a')](function(_0x5669cf){_0x35391e=_0x5669cf;logger['info']('['+_0x3ab1da[_0xc671('0x76')]['toUpperCase']()+_0xc671('0x78'),_0x35391e['id']);logger[_0xc671('0x1c')]('['+_0x3ab1da[_0xc671('0x76')][_0xc671('0x79')]()+']\x20Integration\x20account\x20type\x20%s.',_0x19a503['type']);})['catch'](function(_0x2383b0){logger['error']('['+_0x3ab1da[_0xc671('0x76')][_0xc671('0x79')]()+']',_0x2383b0);});};
\ No newline at end of file
+var _0x0c91=['content','toString','variable','variableName','customVariable','Variable','name','password','concat','securityToken','https://login.salesforce.com','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','[OUTBOUND]','Fields','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','isNil',']\x20Ticket\x20%s\x20created.','toUpperCase','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','Subjects','getString','Descriptions','ticketType','Task','utc','IsRecurrence','endUserType','contact','lead','WhoId','WhatId','ContactId','account','AccountId','leadId','info','create','validateEmail','User','find','execute','then','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','user_id','display_name','resolve','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','sobject','Contact','length','$or','Lead','account_contact_lead','additionalSearchAccount','merge','Account','additionalSearchLead','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','LastName','<unknown>','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','includes','string','picklist','idField'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x0c91,0x1a7));var _0x10c9=function(_0x335464,_0x5f21e5){_0x335464=_0x335464-0x0;var _0x37fe91=_0x0c91[_0x335464];return _0x37fe91;};'use strict';var _=require(_0x10c9('0x0'));var rp=require(_0x10c9('0x1'));var moment=require(_0x10c9('0x2'));var BPromise=require(_0x10c9('0x3'));var md5=require(_0x10c9('0x4'));var jsforce=require('jsforce');var util=require(_0x10c9('0x5'));var Redis=require(_0x10c9('0x6'));var intUtil=require(_0x10c9('0x7'));var config=require(_0x10c9('0x8'));var logger=require(_0x10c9('0x9'))(_0x10c9('0xa'));config[_0x10c9('0xb')]=_[_0x10c9('0xc')](config[_0x10c9('0xb')],{'host':_0x10c9('0xd'),'port':0x18eb});var io=require(_0x10c9('0xe'))(new Redis(config[_0x10c9('0xb')]));function emit(_0x3f51f8,_0x4bda55,_0x1866bb){io['to'](_0x3f51f8)[_0x10c9('0xf')](_0x4bda55,_0x1866bb);}function getTicket(_0x4ec901,_0x4edd58,_0x469e2f,_0x158a71,_0x1cf380,_0x55fa02,_0x48fc3f,_0x3ab20c){var _0x16fa07=Object['assign']({},{'OwnerId':_0x4edd58['id'],'Subject':intUtil['getString'](_0x158a71[_0x10c9('0x10')],_0x1cf380,'\x20'),'Description':intUtil[_0x10c9('0x11')](_0x158a71[_0x10c9('0x12')],_0x1cf380,'\x0a')},getCustomFields(_0x55fa02,_0x1cf380));if(_0x469e2f){if(_0x158a71[_0x10c9('0x13')]===_0x10c9('0x14')){_0x16fa07['ActivityDate']=moment[_0x10c9('0x15')]();_0x16fa07['IsReminderSet']=![];_0x16fa07[_0x10c9('0x16')]=![];if(_0x469e2f[_0x10c9('0x17')]===_0x10c9('0x18')||_0x469e2f[_0x10c9('0x17')]===_0x10c9('0x19')){_0x16fa07[_0x10c9('0x1a')]=_0x469e2f['id'];}else if(_0x469e2f[_0x10c9('0x17')]==='account'){_0x16fa07[_0x10c9('0x1b')]=_0x469e2f['id'];}}else if(_0x158a71['ticketType']==='Case'){if(_0x469e2f['endUserType']===_0x10c9('0x18')){_0x16fa07[_0x10c9('0x1c')]=_0x469e2f['id'];}else if(_0x469e2f['endUserType']===_0x10c9('0x1d')){_0x16fa07[_0x10c9('0x1e')]=_0x469e2f['id'];}else if(_0x469e2f[_0x10c9('0x17')]==='lead'&&_0x158a71[_0x10c9('0x1f')]){_0x16fa07[_0x158a71[_0x10c9('0x1f')]]=_0x469e2f['id'];}else{logger[_0x10c9('0x20')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x48fc3f['sobject'](_0x158a71[_0x10c9('0x13')])[_0x10c9('0x21')](_0x16fa07);}function getUser(_0x136b02,_0x1b6441,_0xf041b9){if(!_['isNil'](_0x1b6441)&&intUtil[_0x10c9('0x22')](_0x1b6441)){var _0x37603d={'Email':_0x1b6441};var _0x28efef={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xf041b9['sobject'](_0x10c9('0x23'))[_0x10c9('0x24')](_0x37603d,_0x28efef)[_0x10c9('0x25')]()[_0x10c9('0x26')](function(_0x49b4e9){if(_0x49b4e9['length']){var _0x20a71e=_[_0x10c9('0x24')](_0x49b4e9,function(_0x4db8b1){return _0x4db8b1['Email']===_0x1b6441;});if(_0x20a71e){logger[_0x10c9('0x20')](_0x10c9('0x27'),_0x1b6441);return BPromise['resolve']({'id':_0x20a71e['Id'],'name':_0x20a71e[_0x10c9('0x28')]});}}else{logger[_0x10c9('0x20')](_0x10c9('0x29'),_0x1b6441);return _0xf041b9['identity']()[_0x10c9('0x26')](function(_0x15bf65){return BPromise['resolve']({'id':_0x15bf65[_0x10c9('0x2a')],'name':_0x15bf65[_0x10c9('0x2b')]});});}});}else{logger[_0x10c9('0x20')](_0x10c9('0x29'),_0x1b6441);return _0xf041b9['identity']()[_0x10c9('0x26')](function(_0x4ec0ef){return BPromise[_0x10c9('0x2c')]({'id':_0x4ec0ef['user_id'],'name':_0x4ec0ef[_0x10c9('0x2b')]});});}}function getEndUser(_0x37737d,_0x40e8a0,_0x3f714b,_0x8427d3,_0x562a6b){var _0x576fea={'$or':{'Phone':_0x8427d3}};var _0x29d7ea={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x10c9('0x2c')]()['then'](function(){logger[_0x10c9('0x20')](_0x10c9('0x2d'),_0x8427d3,_0x40e8a0[_0x10c9('0x2e')]);switch(_0x40e8a0[_0x10c9('0x2e')]){case'contact_lead':var _0x485d45=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x30')]){var _0x54c13b={};_0x54c13b[_0x40e8a0['additionalSearchContact']]=_0x8427d3;_['merge'](_0x485d45['$or'],_0x54c13b);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x32'))['find'](_0x485d45,_0x29d7ea)['execute']()[_0x10c9('0x26')](function(_0x46b3f9){if(_0x46b3f9&&_0x46b3f9[_0x10c9('0x33')]){return _0x46b3f9;}else{var _0x4adefe=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0['additionalSearchLead']){var _0xaf53fb={};_0xaf53fb[_0x40e8a0['additionalSearchLead']]=_0x8427d3;_['merge'](_0x4adefe[_0x10c9('0x34')],_0xaf53fb);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x35'))[_0x10c9('0x24')](_0x4adefe,_0x29d7ea);}});case _0x10c9('0x36'):var _0x8b8b54=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x37')]){var _0x54c13b={};_0x54c13b[_0x40e8a0[_0x10c9('0x37')]]=_0x8427d3;_[_0x10c9('0x38')](_0x8b8b54[_0x10c9('0x34')],_0x54c13b);}return _0x562a6b['sobject'](_0x10c9('0x39'))[_0x10c9('0x24')](_0x8b8b54,_0x29d7ea)[_0x10c9('0x25')]()[_0x10c9('0x26')](function(_0x192885){if(_0x192885&&_0x192885['length']){return _0x192885;}else{var _0x57b757=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x30')]){var _0x147263={};_0x147263[_0x40e8a0[_0x10c9('0x30')]]=_0x8427d3;_[_0x10c9('0x38')](_0x57b757['$or'],_0x147263);}return _0x562a6b[_0x10c9('0x31')]('Contact')[_0x10c9('0x24')](_0x57b757,_0x29d7ea)['then'](function(_0xc62661){if(_0xc62661&&_0xc62661[_0x10c9('0x33')]){return _0xc62661;}else{var _0x22847d=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x3a')]){var _0x43f823={};_0x43f823[_0x40e8a0[_0x10c9('0x3a')]]=_0x8427d3;_[_0x10c9('0x38')](_0x22847d['$or'],_0x43f823);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x35'))['find'](_0x22847d,_0x29d7ea);}});}});case _0x10c9('0x18'):var _0x485d45=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x30')]){var _0x54c13b={};_0x54c13b[_0x40e8a0[_0x10c9('0x30')]]=_0x8427d3;_[_0x10c9('0x38')](_0x485d45[_0x10c9('0x34')],_0x54c13b);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x32'))[_0x10c9('0x24')](_0x485d45,_0x29d7ea)[_0x10c9('0x25')]();case _0x10c9('0x19'):var _0x54ce7a=_[_0x10c9('0x2f')](_0x576fea);if(_0x40e8a0[_0x10c9('0x3a')]){var _0x54c13b={};_0x54c13b[_0x40e8a0[_0x10c9('0x3a')]]=_0x8427d3;_['merge'](_0x54ce7a[_0x10c9('0x34')],_0x54c13b);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x35'))[_0x10c9('0x24')](_0x54ce7a,_0x29d7ea);case _0x10c9('0x1d'):var _0x8b8b54=_['cloneDeep'](_0x576fea);if(_0x40e8a0['additionalSearchAccount']){var _0x54c13b={};_0x54c13b[_0x40e8a0[_0x10c9('0x37')]]=_0x8427d3;_[_0x10c9('0x38')](_0x8b8b54['$or'],_0x54c13b);}return _0x562a6b[_0x10c9('0x31')](_0x10c9('0x39'))[_0x10c9('0x24')](_0x8b8b54,_0x29d7ea);default:return null;}})[_0x10c9('0x26')](function(_0x4b7bba){if(_0x4b7bba&&_0x4b7bba[_0x10c9('0x33')]){var _0x11c3f7=_['first'](_0x4b7bba);if(_0x11c3f7){return BPromise['resolve']({'id':_0x11c3f7['Id'],'name':_0x11c3f7['Name'],'phone':_0x11c3f7[_0x10c9('0x3b')],'endUserType':_0x11c3f7[_0x10c9('0x3c')][_0x10c9('0x3d')][_0x10c9('0x3e')]()});}}})[_0x10c9('0x26')](function(_0x581a39){if(_0x581a39){logger[_0x10c9('0x20')](_0x10c9('0x3f'),_0x581a39[_0x10c9('0x17')],_0x8427d3);return BPromise['resolve'](_0x581a39);}else{logger[_0x10c9('0x20')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x8427d3);var _0x345c62={'Phone':_0x8427d3};if(_0x40e8a0[_0x10c9('0x40')]){if(_0x40e8a0[_0x10c9('0x40')]===_0x10c9('0x18')){logger[_0x10c9('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x8427d3,_0x40e8a0[_0x10c9('0x40')]);_0x345c62[_0x10c9('0x41')]=_0x3f714b!==_0x10c9('0x42')?_0x3f714b:util[_0x10c9('0x43')](_0x10c9('0x44'),_0x8427d3);}else if(_0x40e8a0[_0x10c9('0x40')]===_0x10c9('0x19')){logger[_0x10c9('0x20')](_0x10c9('0x45'),_0x8427d3,_0x40e8a0[_0x10c9('0x40')]);_0x345c62[_0x10c9('0x41')]=_0x3f714b!==_0x10c9('0x42')?_0x3f714b:util['format'](_0x10c9('0x44'),_0x8427d3);_0x345c62[_0x10c9('0x46')]=_0x10c9('0x47');}else if(_0x40e8a0[_0x10c9('0x40')]===_0x10c9('0x1d')){logger[_0x10c9('0x20')](_0x10c9('0x45'),_0x8427d3,_0x40e8a0[_0x10c9('0x40')]);_0x345c62['Name']=_0x3f714b!==_0x10c9('0x42')?_0x3f714b:util[_0x10c9('0x43')]('Caller\x20-\x20%s',_0x8427d3);}else{return null;}}return _0x562a6b[_0x10c9('0x31')](_[_0x10c9('0x48')](_0x40e8a0[_0x10c9('0x40')]))['create'](_0x345c62)[_0x10c9('0x26')](function(_0x304605){return BPromise[_0x10c9('0x2c')]({'id':_0x304605['id'],'endUserType':_0x40e8a0[_0x10c9('0x40')]});});}});}function getCustomFields(_0x5caf83,_0x46832f){var _0x40d98d={};if(_0x5caf83[_0x10c9('0x33')]>0x0){_['forEach'](_0x5caf83,function(_0x3d6696){if(_[_0x10c9('0x49')]([_0x10c9('0x4a'),_0x10c9('0x4b')],_0x3d6696[_0x10c9('0x3d')])&&_0x3d6696[_0x10c9('0x4c')]){_0x40d98d[_0x3d6696['idField']]=_0x3d6696[_0x10c9('0x4d')][_0x10c9('0x4e')]();}else if(_0x3d6696['type']===_0x10c9('0x4f')&&_0x3d6696[_0x10c9('0x50')]&&_0x3d6696['idField']){_0x46832f[_0x3d6696[_0x10c9('0x50')]]&&(_0x40d98d[_0x3d6696[_0x10c9('0x4c')]]=_0x46832f[_0x3d6696['variableName']]['toString']());}else if(_0x3d6696[_0x10c9('0x3d')]===_0x10c9('0x51')&&_0x3d6696[_0x10c9('0x52')]&&_0x3d6696['Variable'][_0x10c9('0x53')]&&_0x3d6696[_0x10c9('0x4c')]){_0x46832f[_0x3d6696[_0x10c9('0x52')][_0x10c9('0x53')][_0x10c9('0x3e')]()]&&(_0x40d98d[_0x3d6696[_0x10c9('0x4c')]]=_0x46832f[_0x3d6696[_0x10c9('0x52')]['name']['toLowerCase']()][_0x10c9('0x4e')]());}});}return _0x40d98d;}function getConnection(_0x1ddd5c){var _0x413d0f=_0x1ddd5c[_0x10c9('0x54')][_0x10c9('0x55')](_0x1ddd5c[_0x10c9('0x56')]);var _0x2d796b=new jsforce['Connection']({'oauth2':{'loginUrl':_0x1ddd5c['remoteUri']||_0x10c9('0x57'),'clientId':_0x1ddd5c['clientId'],'clientSecret':_0x1ddd5c[_0x10c9('0x58')]}});return _0x2d796b[_0x10c9('0x59')](_0x1ddd5c[_0x10c9('0x5a')],_0x413d0f)[_0x10c9('0x26')](function(){logger['info']('Connection\x20established.');return _0x2d796b;});}exports[_0x10c9('0x5b')]=function(_0x5719be,_0x29c4de,_0x554127,_0x24fc98,_0x4e8d76,_0x25449d){var _0x537974,_0x2c4956,_0x7b93f6,_0x5a506d;_0x25449d[_0x10c9('0x5c')]=intUtil[_0x10c9('0x5d')](_0x25449d[_0x10c9('0x5c')]);_0x25449d[_0x10c9('0x5e')]=intUtil[_0x10c9('0x5d')](_0x25449d[_0x10c9('0x5e')]);if(_0x4e8d76&&_0x4e8d76[_0x10c9('0x5f')]){logger['info'](_0x10c9('0x60'),_0x10c9('0x61'));_0x29c4de[_0x10c9('0x62')]=util[_0x10c9('0x43')](_0x10c9('0x63'),_0x25449d[_0x10c9('0x5c')],_0x29c4de[_0x10c9('0x64')],md5(_0x29c4de[_0x10c9('0x64')]));}else{_0x29c4de[_0x10c9('0x62')]='';}return getConnection(_0x25449d)[_0x10c9('0x26')](function(_0xfe8dde){_0x5a506d=_0xfe8dde;return getUser(_0x25449d,_0x24fc98[_0x10c9('0x65')],_0x5a506d);})[_0x10c9('0x26')](function(_0x116055){_0x537974=_0x116055;return getEndUser(_0x25449d,_0x554127,_0x29c4de['calleridname'],_0x29c4de[_0x10c9('0x66')],_0x5a506d);})['then'](function(_0x147572){_0x2c4956=_0x147572;return getTicket(_0x25449d,_0x537974,_0x2c4956,_0x554127,_0x29c4de,_0x554127['Fields'],_0x5a506d,_0x10c9('0x5b'));})[_0x10c9('0x26')](function(_0x48ead3){_0x7b93f6=_0x48ead3;logger['info']('[QUEUE]\x20Ticket\x20%s\x20created',_0x7b93f6['id']);logger[_0x10c9('0x20')](_0x10c9('0x67'),_0x7b93f6['id'],_0x24fc98[_0x10c9('0x53')],_0x25449d[_0x10c9('0x3d')]);switch(_0x25449d[_0x10c9('0x3d')]){case _0x10c9('0x68'):emit(util[_0x10c9('0x43')](_0x10c9('0x69'),_0x24fc98[_0x10c9('0x53')]),_0x10c9('0x6a'),{'recordId':_0x7b93f6['id']});break;case _0x10c9('0x6b'):emit(util[_0x10c9('0x43')]('user:%s',_0x24fc98[_0x10c9('0x53')]),'trigger:browser:url',{'uri':util[_0x10c9('0x43')](_0x10c9('0x6c'),_0x5a506d[_0x10c9('0x6d')],_0x7b93f6['id'])});break;default:logger[_0x10c9('0x6e')](_0x10c9('0x6f'));}})[_0x10c9('0x70')](function(_0x17da5e){logger[_0x10c9('0x6e')](_0x10c9('0x60'),_0x17da5e);});};exports['outbound']=function(_0x1103a0,_0x411374,_0x424c89,_0x3b3105,_0x292769,_0x41997c,_0x5475b3){var _0x387c5b,_0xc3b9c9,_0x16fb88,_0x3c8167;_0x41997c[_0x10c9('0x5c')]=intUtil['stripTrailingSlash'](_0x41997c[_0x10c9('0x5c')]);_0x41997c[_0x10c9('0x5e')]=intUtil[_0x10c9('0x5d')](_0x41997c[_0x10c9('0x5e')]);if(_0x5475b3&&_0x5475b3[_0x10c9('0x71')]&&_0x5475b3['recordingFormat']!=='none'){logger[_0x10c9('0x20')](_0x10c9('0x72'),'Recording\x20is\x20enabled!');_0x411374[_0x10c9('0x62')]=util[_0x10c9('0x43')](_0x10c9('0x63'),_0x41997c[_0x10c9('0x5c')],_0x411374['uniqueid'],md5(_0x411374[_0x10c9('0x64')]));}return getConnection(_0x41997c)['then'](function(_0x1e6720){_0x3c8167=_0x1e6720;return getUser(_0x41997c,_0x3b3105[_0x10c9('0x65')],_0x3c8167);})[_0x10c9('0x26')](function(_0x59fb74){_0x387c5b=_0x59fb74;return getEndUser(_0x41997c,_0x424c89,_0x411374['destcalleridname'],_0x411374['destcalleridnum'],_0x3c8167);})[_0x10c9('0x26')](function(_0x5a1b2b){_0xc3b9c9=_0x5a1b2b;return getTicket(_0x41997c,_0x387c5b,_0xc3b9c9,_0x424c89,_0x411374,_0x424c89[_0x10c9('0x73')],_0x3c8167,_0x10c9('0x74'));})[_0x10c9('0x26')](function(_0x2aa358){_0x16fb88=_0x2aa358;logger[_0x10c9('0x20')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x16fb88['id']);logger[_0x10c9('0x20')](_0x10c9('0x75'),_0x16fb88['id'],_0x3b3105['name'],_0x41997c[_0x10c9('0x3d')]);switch(_0x41997c[_0x10c9('0x3d')]){case'integrationTab':emit(util['format'](_0x10c9('0x69'),_0x3b3105[_0x10c9('0x53')]),_0x10c9('0x6a'),{'recordId':_0x16fb88['id']});break;case'newTab':emit(util[_0x10c9('0x43')](_0x10c9('0x69'),_0x3b3105[_0x10c9('0x53')]),_0x10c9('0x76'),{'uri':util[_0x10c9('0x43')]('%s/%s/e',_0x3c8167[_0x10c9('0x6d')],_0x16fb88['id'])});break;default:logger[_0x10c9('0x6e')](_0x10c9('0x72'),_0x10c9('0x77'));}})[_0x10c9('0x70')](function(_0x317b99){logger['error'](_0x10c9('0x72'),_0x317b99);});};exports[_0x10c9('0x78')]=function(_0x404523,_0x470100,_0x3254ee,_0x49390c,_0x47c229,_0x33e7a1){var _0x3197c4,_0x5e62bc,_0x57d28b,_0x627793;_0x33e7a1[_0x10c9('0x5c')]=intUtil[_0x10c9('0x5d')](_0x33e7a1[_0x10c9('0x5c')]);_0x33e7a1[_0x10c9('0x5e')]=intUtil[_0x10c9('0x5d')](_0x33e7a1[_0x10c9('0x5e')]);if(_0x47c229&&_0x47c229[_0x10c9('0x5f')]){logger[_0x10c9('0x20')]('['+_0x470100[_0x10c9('0x79')]['toUpperCase']()+']',_0x10c9('0x61'));_0x470100[_0x10c9('0x62')]=util[_0x10c9('0x43')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x33e7a1[_0x10c9('0x5c')],_0x470100[_0x10c9('0x64')],md5(_0x470100['uniqueid']));}else{_0x470100[_0x10c9('0x62')]='';}return getConnection(_0x33e7a1)[_0x10c9('0x26')](function(_0x47f767){_0x627793=_0x47f767;if(!_[_0x10c9('0x7a')](_0x49390c)){return getUser(_0x33e7a1,_0x49390c[_0x10c9('0x53')],_0x627793);}else{return getUser(_0x33e7a1,null,_0x627793);}})[_0x10c9('0x26')](function(_0x247e1c){_0x3197c4=_0x247e1c;return getEndUser(_0x33e7a1,_0x3254ee,_0x470100['calleridname'],_0x470100[_0x10c9('0x66')],_0x627793);})[_0x10c9('0x26')](function(_0x49d3fa){_0x5e62bc=_0x49d3fa;return getTicket(_0x33e7a1,_0x3197c4,_0x5e62bc,_0x3254ee,_0x470100,_0x3254ee[_0x10c9('0x73')],_0x627793);})[_0x10c9('0x26')](function(_0x338879){_0x57d28b=_0x338879;logger['info']('['+_0x470100[_0x10c9('0x79')]['toUpperCase']()+_0x10c9('0x7b'),_0x57d28b['id']);logger['info']('['+_0x470100['lastevent'][_0x10c9('0x7c')]()+']\x20Integration\x20account\x20type\x20%s.',_0x33e7a1[_0x10c9('0x3d')]);})[_0x10c9('0x70')](function(_0x54b859){logger['error']('['+_0x470100[_0x10c9('0x79')][_0x10c9('0x7c')]()+']',_0x54b859);});};
\ No newline at end of file
index 410108a..9b911c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc8=['sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','active','true','userId','adminId','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','POST','endUserNumber','user','],\x20EndUser\x20schema','endUserId','catch','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','nameField','customField','toLowerCase','toString','type','idField','content','variable','variableName','customVariable','name','Variable',']\x20getTicket\x20input\x20crm','assign','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','serverUrl','isNil','email','calleridnum','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','./util','../../../../config/environment','../../../../config/logger','servicenow','defaults','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length'];(function(_0x40e141,_0x4385ee){var _0x3ce15c=function(_0x4044ee){while(--_0x4044ee){_0x40e141['push'](_0x40e141['shift']());}};_0x3ce15c(++_0x4385ee);}(_0x5fc8,0x136));var _0x85fc=function(_0x321549,_0x60f55d){_0x321549=_0x321549-0x0;var _0x48e197=_0x5fc8[_0x321549];return _0x48e197;};'use strict';var _=require(_0x85fc('0x0'));var Promise=require(_0x85fc('0x1'));var rp=require('request-promise');var util=require(_0x85fc('0x2'));var md5=require(_0x85fc('0x3'));var Redis=require('ioredis');var intUtil=require(_0x85fc('0x4'));var config=require(_0x85fc('0x5'));var logger=require(_0x85fc('0x6'))(_0x85fc('0x7'));config['redis']=_[_0x85fc('0x8')](config[_0x85fc('0x9')],{'host':_0x85fc('0xa'),'port':0x18eb});var io=require(_0x85fc('0xb'))(new Redis(config[_0x85fc('0x9')]));function getAdminUser(_0x5a3d23,_0x3c4977,_0x58f68b,_0x35c970,_0x4929f0,_0x5fe985){return new Promise(function(_0x5c8b7d,_0x5500a9){var _0x48bcb0={'method':_0x85fc('0xc'),'uri':_0x35c970+_0x85fc('0xd')+'&'+_0x4929f0+'&'+_0x5fe985,'auth':_0x3c4977,'json':!![]};return rp(_0x48bcb0)[_0x85fc('0xe')](function(_0x4a74af){if(_0x4a74af[_0x85fc('0xf')][_0x85fc('0x10')]>0x0){_0x58f68b['adminId']=_0x4a74af['result'][0x0][_0x85fc('0x11')];}logger[_0x85fc('0x12')]('['+[_0x5a3d23[_0x85fc('0x13')]()]+_0x85fc('0x14'),_0x58f68b);_0x5c8b7d(_0x58f68b);})['catch'](function(_0x430bc1){logger[_0x85fc('0x15')]('['+[_0x5a3d23['toUpperCase']()]+']',_0x430bc1['message']);_0x5500a9(_0x430bc1[_0x85fc('0x16')]);});});}function getUser(_0x55a5a2,_0x487413,_0x2124a6,_0x53379d,_0x5260a1){return function(_0x411253){logger['info']('['+[_0x55a5a2['toUpperCase']()]+_0x85fc('0x17'),_0x411253);return new Promise(function(_0xcb86ac,_0x18af5b){if(intUtil[_0x85fc('0x18')](_0x411253[_0x85fc('0x19')])){var _0x5093d7={'method':_0x85fc('0xc'),'uri':_0x2124a6+_0x85fc('0x1a')+_0x411253[_0x85fc('0x19')]+'&'+_0x53379d+'&'+_0x5260a1,'auth':_0x487413,'json':!![]};logger[_0x85fc('0x12')]('['+[_0x55a5a2[_0x85fc('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x5093d7);return rp(_0x5093d7)[_0x85fc('0xe')](function(_0x12895b){logger[_0x85fc('0x12')]('['+[_0x55a5a2[_0x85fc('0x13')]()]+'],\x20getUser\x20entity',_0x12895b);if(_0x12895b[_0x85fc('0xf')]['length']>0x0&&String(_0x12895b['result'][0x0][_0x85fc('0x1b')])===_0x85fc('0x1c')){_0x411253[_0x85fc('0x1d')]=_0x12895b[_0x85fc('0xf')][0x0][_0x85fc('0x11')];}else{_0x411253[_0x85fc('0x1d')]=_0x411253[_0x85fc('0x1e')];_0x411253[_0x85fc('0x19')]=_0x411253['adminEmail'];}logger[_0x85fc('0x12')]('['+[_0x55a5a2[_0x85fc('0x13')]()]+_0x85fc('0x1f'),_0x411253);_0xcb86ac(_0x411253);})['catch'](function(_0x4f6a93){logger[_0x85fc('0x15')]('['+[_0x55a5a2[_0x85fc('0x13')]()]+']',_0x4f6a93['message']);_0x18af5b(_0x4f6a93['message']);});}else{logger[_0x85fc('0x12')]('['+[_0x55a5a2[_0x85fc('0x13')]()]+_0x85fc('0x20'));_0x411253[_0x85fc('0x1d')]=_0x411253['adminId'];_0x411253['userEmail']=_0x411253[_0x85fc('0x21')];_0xcb86ac(_0x411253);}});};}function createEndUser(_0x3f6f33,_0x552d2c,_0x3a65bc,_0x2bb68f,_0xf23025){logger['info']('['+[_0x3f6f33['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x3a65bc);return new Promise(function(_0x4d1600,_0x57e8d1){var _0x47a709={'method':_0x85fc('0x22'),'uri':_0x2bb68f+'sys_user?'+_0xf23025,'body':{'user_name':_0x3a65bc[_0x85fc('0x23')],'roles':_0x85fc('0x24'),'first_name':_0x3a65bc['endUserNumber'],'active':_0x85fc('0x1c'),'date_format':'System','phone':_0x3a65bc[_0x85fc('0x23')]},'auth':_0x552d2c,'json':!![]};return rp(_0x47a709)[_0x85fc('0xe')](function(_0x5d6149){logger[_0x85fc('0x12')]('['+[_0x3f6f33[_0x85fc('0x13')]()]+_0x85fc('0x25'),_0x5d6149['result']);_0x3a65bc[_0x85fc('0x26')]=_0x5d6149[_0x85fc('0xf')][_0x85fc('0x11')];_0x4d1600(_0x3a65bc);})[_0x85fc('0x27')](function(_0x1170c3){logger[_0x85fc('0x15')]('['+[_0x3f6f33[_0x85fc('0x13')]()]+']',_0x1170c3['message']);_0x57e8d1(_0x1170c3[_0x85fc('0x16')]);});});}function getEndUser(_0x1d3e7d,_0xfceb58,_0x4ec17c,_0x475684,_0xdde27a){return function(_0x2744b9){logger[_0x85fc('0x12')]('['+[_0x1d3e7d['toUpperCase']()]+_0x85fc('0x28'),_0x2744b9);return new Promise(function(_0x7b6f60,_0x41ead0){var _0xb08fca={'method':'GET','uri':_0x4ec17c+_0x85fc('0x29')+_0x2744b9[_0x85fc('0x23')]+'&'+_0x475684+'&'+_0xdde27a,'auth':_0xfceb58,'json':!![]};return rp(_0xb08fca)[_0x85fc('0xe')](function(_0x200ff0){if(_0x200ff0['result'][_0x85fc('0x10')]>0x0){_0x2744b9['endUserId']=_0x200ff0['result'][0x0][_0x85fc('0x11')];logger['info']('['+[_0x1d3e7d[_0x85fc('0x13')]()]+_0x85fc('0x2a'),_0x2744b9);_0x7b6f60(_0x2744b9);}else{return createEndUser(_0x1d3e7d,_0xfceb58,_0x2744b9,_0x4ec17c,_0x475684)['then'](function(_0x1d7909){logger[_0x85fc('0x12')]('['+[_0x1d3e7d['toUpperCase']()]+_0x85fc('0x2b'),_0x1d7909);_0x7b6f60(_0x1d7909);});}})['catch'](function(_0x53eaee){logger['error']('['+[_0x1d3e7d[_0x85fc('0x13')]()]+']',_0x53eaee[_0x85fc('0x16')]);_0x41ead0(_0x53eaee['message']);});});};}function getCustomFields(_0x1561fd,_0x4ece38){var _0xb84ea7={};if(_0x1561fd[_0x85fc('0x10')]>0x0){_['forEach'](_0x1561fd,function(_0xcc76c5){if(_[_0x85fc('0x2c')]([_0x85fc('0x2d'),_0x85fc('0x2e')],_0xcc76c5['type'])&&_0xcc76c5[_0x85fc('0x2f')]&&!_0xcc76c5[_0x85fc('0x30')]){_0xb84ea7[_0xcc76c5[_0x85fc('0x2f')][_0x85fc('0x31')]()]=_0xcc76c5['content'][_0x85fc('0x32')]();}else if(_[_0x85fc('0x2c')]([_0x85fc('0x2d'),_0x85fc('0x2e')],_0xcc76c5[_0x85fc('0x33')])&&_0xcc76c5[_0x85fc('0x34')]&&_0xcc76c5[_0x85fc('0x30')]){_0xb84ea7[_0xcc76c5[_0x85fc('0x34')][_0x85fc('0x31')]()]=_0xcc76c5[_0x85fc('0x35')]['toString']();}else if(_0xcc76c5[_0x85fc('0x33')]===_0x85fc('0x36')&&_0xcc76c5[_0x85fc('0x37')]&&_0xcc76c5[_0x85fc('0x34')]&&_0xcc76c5[_0x85fc('0x30')]){_0xb84ea7[_0xcc76c5[_0x85fc('0x34')][_0x85fc('0x31')]()]=_0x4ece38[_0xcc76c5[_0x85fc('0x37')]][_0x85fc('0x32')]();}else if(_0xcc76c5[_0x85fc('0x33')]===_0x85fc('0x38')&&_0xcc76c5['Variable']&&_0xcc76c5['Variable'][_0x85fc('0x39')]&&_0xcc76c5[_0x85fc('0x34')]&&_0xcc76c5[_0x85fc('0x30')]){_0xb84ea7[_0xcc76c5[_0x85fc('0x34')][_0x85fc('0x31')]()]=_0x4ece38[_0xcc76c5[_0x85fc('0x3a')][_0x85fc('0x39')][_0x85fc('0x31')]()][_0x85fc('0x32')]();}});}return _0xb84ea7;}function getTicket(_0x5d775b,_0x4ec877,_0x352917,_0x33e4b8,_0x28aae9,_0x5a4b8a){return function(_0xd6d31a){logger[_0x85fc('0x12')]('['+[_0x5d775b['toUpperCase']()]+_0x85fc('0x3b'),_0xd6d31a);return new Promise(function(_0x449bfc,_0x111e16){var _0x5ba4b0=_0x5d775b['toLowerCase']()==='outbound'?_0xd6d31a[_0x85fc('0x1d')]:_0xd6d31a[_0x85fc('0x26')];var _0x4b92ef={'method':_0x85fc('0x22'),'uri':_0x352917+'incident'+'?'+_0x5a4b8a,'body':Object[_0x85fc('0x3c')]({},{'active':_0x85fc('0x1c'),'caller_id':_0x5ba4b0,'assigned_to':_0xd6d31a['userId'],'short_description':intUtil['getString'](_0x33e4b8[_0x85fc('0x3d')],_0x28aae9,'\x20'),'description':intUtil[_0x85fc('0x3e')](_0x33e4b8[_0x85fc('0x3f')],_0x28aae9,'\x0a')},getCustomFields(_0x33e4b8[_0x85fc('0x40')],_0x28aae9)),'auth':_0x4ec877,'json':!![]};return rp(_0x4b92ef)[_0x85fc('0xe')](function(_0x3f577){logger[_0x85fc('0x12')]('['+[_0x5d775b[_0x85fc('0x13')]()]+_0x85fc('0x41'),_0x3f577[_0x85fc('0xf')]);_0xd6d31a[_0x85fc('0x42')]=_0x3f577[_0x85fc('0xf')][_0x85fc('0x11')];_0xd6d31a[_0x85fc('0x43')]=_0x3f577[_0x85fc('0xf')]['number'];logger[_0x85fc('0x12')]('['+[_0x5d775b[_0x85fc('0x13')]()]+_0x85fc('0x44'),_0xd6d31a);_0x449bfc(_0xd6d31a);})[_0x85fc('0x27')](function(_0x4cea97){logger[_0x85fc('0x15')]('['+[_0x5d775b[_0x85fc('0x13')]()]+']',_0x4cea97[_0x85fc('0x16')]);_0x111e16(_0x4cea97[_0x85fc('0x16')]);});});};}function createRemoteTag(_0x3ecdf9,_0x472ed8,_0x31f400,_0xdf07e9){return new Promise(function(_0x419fe9,_0x12737f){var _0x341872={'method':_0x85fc('0x22'),'uri':_0x31f400+_0x85fc('0x45')+'?'+_0xdf07e9,'body':{'short_description':_0x3ecdf9,'global':!![],'active':!![],'name':_0x3ecdf9},'auth':_0x472ed8,'json':!![]};return rp(_0x341872)[_0x85fc('0xe')](function(_0x5edf84){var _0x210027=_0x5edf84[_0x85fc('0xf')][_0x85fc('0x11')];_0x419fe9(_0x210027);});});}function getRemoteTag(_0x3d9764,_0x14c69a,_0x3a2416,_0x4c7d22,_0x1f1c4f){return new Promise(function(_0x2b7b5c,_0x2a71ed){var _0x3544ff={'method':_0x85fc('0xc'),'uri':_0x3a2416+_0x85fc('0x45')+_0x85fc('0x46')+_0x3d9764+'&'+_0x4c7d22,'auth':_0x14c69a,'json':!![]};return rp(_0x3544ff)[_0x85fc('0xe')](function(_0x23667f){if(_0x23667f['result'][_0x85fc('0x10')]>0x0){var _0x3bb642=_0x23667f[_0x85fc('0xf')][0x0]['sys_id'];_0x2b7b5c(_0x3bb642);}else{return createRemoteTag(_0x3d9764,_0x14c69a,_0x3a2416,_0x4c7d22)[_0x85fc('0xe')](function(_0x2a9a18){_0x2b7b5c(_0x2a9a18);});}});});}function assignTagToIncident(_0x498336,_0x46085c,_0x57566d,_0x231a39,_0x32fd5d){return new Promise(function(_0x534fa1,_0x542ca2){var _0x147a88={'method':'POST','uri':_0x57566d+_0x85fc('0x47')+'?'+_0x32fd5d,'body':{'label':_0x498336,'table':'incident','id_type':_0x85fc('0x48'),'table_key':_0x231a39[_0x85fc('0x42')],'title':_0x85fc('0x49')+_0x231a39[_0x85fc('0x43')],'id_display':_0x231a39['ticketNumber']},'auth':_0x46085c,'json':!![]};return rp(_0x147a88)[_0x85fc('0xe')](function(_0x563aeb){_0x534fa1();})[_0x85fc('0x27')](function(){_0x534fa1();});});}function manageTags(_0x119e88,_0x46c87b,_0x545799,_0x3d2ca6,_0x2b1c93,_0x3878e7,_0x8d8020){return new Promise(function(_0x3cf7d0,_0x19f3d2){var _0x20fc08=[];_0x46c87b[_0x85fc('0x4a')](function(_0x365f85){_0x20fc08[_0x85fc('0x4b')](getRemoteTag(_0x365f85,_0x545799,_0x3d2ca6,_0x3878e7,_0x8d8020));});return Promise[_0x85fc('0x4c')](_0x20fc08)['then'](function(_0x52194c){if(_0x52194c[_0x85fc('0x10')]){logger[_0x85fc('0x12')]('['+[_0x119e88[_0x85fc('0x13')]()]+_0x85fc('0x4d'),_0x52194c);var _0x8309be=[];_0x52194c['forEach'](function(_0x413f82){_0x8309be[_0x85fc('0x4b')](assignTagToIncident(_0x413f82,_0x545799,_0x3d2ca6,_0x2b1c93,_0x3878e7));});return Promise['all'](_0x8309be)[_0x85fc('0xe')](function(){_0x3cf7d0();})[_0x85fc('0x27')](function(){_0x3cf7d0();});}else{_0x3cf7d0();}});});}function getTags(_0x560fba,_0xaa3089,_0x823fd4,_0x56b20d,_0x1ada69,_0x1cd2ab){return function(_0x34b351){return new Promise(function(_0x1bafcf,_0x2b164b){var _0x473159=[];var _0x3d6d85=_0x56b20d[_0x85fc('0x4e')];if(_0x3d6d85&&_0x3d6d85[_0x85fc('0x10')]>0x0){_0x473159=_[_0x85fc('0x4f')](_0x3d6d85,_0x85fc('0x39'));}if(_0x473159[_0x85fc('0x10')]>0x0){return manageTags(_0x560fba,_0x473159,_0xaa3089,_0x823fd4,_0x34b351,_0x1ada69,_0x1cd2ab)[_0x85fc('0xe')](function(){_0x1bafcf(_0x34b351);});}else{_0x1bafcf(_0x34b351);}});};}function emit(_0x65c28f,_0x2b0844,_0x5deab0){var _0x56deba='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x85fc('0x50');var _0x5cae07={'uri':_0x65c28f+_0x85fc('0x51')+_0x5deab0+_0x56deba};io['to'](util[_0x85fc('0x52')](_0x85fc('0x53'),_0x2b0844))[_0x85fc('0x54')](_0x85fc('0x55'),_0x5cae07);}exports['cs']=function(_0x23d664,_0x4fda08,_0x2db784,_0x351c69,_0x599589,_0x5ae494,_0x1dc448,_0xb30b30){var _0x16cf13={};var _0x5e2aa5={'user':_0x5ae494['username'],'pass':_0x5ae494[_0x85fc('0x56')]};var _0x468be9=_0x85fc('0x57');var _0x43e2d0=_0x85fc('0x58');_0x5ae494[_0x85fc('0x59')]=intUtil['stripTrailingSlash'](_0x5ae494[_0x85fc('0x59')]);_0x5ae494[_0x85fc('0x5a')]=intUtil['stripTrailingSlash'](_0x5ae494[_0x85fc('0x5a')]);var _0x390163=util[_0x85fc('0x52')]('%s/api/now/table/',_0x5ae494['remoteUri']);_0x16cf13[_0x85fc('0x19')]=!_[_0x85fc('0x5b')](_0x351c69)?_0x351c69['email']:null;_0x16cf13[_0x85fc('0x21')]=_0x5ae494[_0x85fc('0x5c')];_0x16cf13['endUserNumber']=_0xb30b30['toLowerCase']()==='outbound'?_0x4fda08['destcalleridnum']:_0x4fda08[_0x85fc('0x5d')];_0x16cf13['callDirection']=_0xb30b30===_0x85fc('0x5e')||_0xb30b30==='unmanaged'?_0x85fc('0x5e'):_0x85fc('0x5f');var _0xe86c81=util[_0x85fc('0x52')](_0x85fc('0x60'),_0x5ae494[_0x85fc('0x5a')],_0x4fda08[_0x85fc('0x61')],md5(_0x4fda08[_0x85fc('0x61')]));if(_0x599589&&_0x599589['monitor_format']){logger[_0x85fc('0x12')](_0x85fc('0x62'),_0x85fc('0x63'));_0x4fda08['recordingURL']=_0xe86c81;}else if(_0x1dc448&&_0x1dc448[_0x85fc('0x64')]&&_0x1dc448[_0x85fc('0x64')]!==_0x85fc('0x65')){logger[_0x85fc('0x12')](_0x85fc('0x66'),'Recording\x20is\x20enabled!');_0x4fda08[_0x85fc('0x67')]=_0xe86c81;}else{_0x4fda08[_0x85fc('0x67')]='';}return getAdminUser(_0xb30b30,_0x5e2aa5,_0x16cf13,_0x390163,_0x43e2d0,_0x468be9)[_0x85fc('0xe')](getUser(_0xb30b30,_0x5e2aa5,_0x390163,_0x43e2d0,_0x468be9))[_0x85fc('0xe')](getEndUser(_0xb30b30,_0x5e2aa5,_0x390163,_0x43e2d0,_0x468be9))['then'](getTicket(_0xb30b30,_0x5e2aa5,_0x390163,_0x2db784,_0x4fda08,_0x43e2d0))['then'](function(_0x423c63){logger[_0x85fc('0x12')](util[_0x85fc('0x52')](_0x85fc('0x68'),_0x423c63[_0x85fc('0x42')]));logger[_0x85fc('0x12')](util[_0x85fc('0x52')]('call\x20direction:\x20%s',_0xb30b30));if(_0xb30b30!==_0x85fc('0x69')){logger[_0x85fc('0x12')]('['+[_0xb30b30['toUpperCase']()]+']',_0x85fc('0x6a'));emit(_0x5ae494[_0x85fc('0x59')],_0x351c69[_0x85fc('0x39')],_0x423c63[_0x85fc('0x42')]);}})[_0x85fc('0x27')](function(_0x4fc057){logger[_0x85fc('0x15')]('['+[_0xb30b30['toUpperCase']()]+_0x85fc('0x6b'),util[_0x85fc('0x6c')](_0x4fc057,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x16e8=['destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','./util','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm','POST','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','endUserId','sys_id','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','includes','string','type','nameField','customField','toLowerCase','content','toString','picklist','variable','variableName','idField','Variable',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber',']\x20getTicket\x20crm','label','label_entry','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','name','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','password','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email'];(function(_0x24729b,_0x5b5c7a){var _0x37e64d=function(_0x8480db){while(--_0x8480db){_0x24729b['push'](_0x24729b['shift']());}};_0x37e64d(++_0x5b5c7a);}(_0x16e8,0x1c1));var _0x816e=function(_0x33ccd9,_0x55ce6d){_0x33ccd9=_0x33ccd9-0x0;var _0x3241e0=_0x16e8[_0x33ccd9];return _0x3241e0;};'use strict';var _=require(_0x816e('0x0'));var Promise=require(_0x816e('0x1'));var rp=require(_0x816e('0x2'));var util=require(_0x816e('0x3'));var md5=require(_0x816e('0x4'));var Redis=require('ioredis');var intUtil=require(_0x816e('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('servicenow');config[_0x816e('0x6')]=_[_0x816e('0x7')](config[_0x816e('0x6')],{'host':_0x816e('0x8'),'port':0x18eb});var io=require(_0x816e('0x9'))(new Redis(config[_0x816e('0x6')]));function getAdminUser(_0x4327e5,_0x574a85,_0x37e6eb,_0x396f69,_0x5e3ea3,_0x6e8f3d){return new Promise(function(_0x35d378,_0x2a9a3c){var _0xe9f7e3={'method':_0x816e('0xa'),'uri':_0x396f69+_0x816e('0xb')+'&'+_0x5e3ea3+'&'+_0x6e8f3d,'auth':_0x574a85,'json':!![]};return rp(_0xe9f7e3)['then'](function(_0x343a73){if(_0x343a73[_0x816e('0xc')]['length']>0x0){_0x37e6eb[_0x816e('0xd')]=_0x343a73[_0x816e('0xc')][0x0]['sys_id'];}logger[_0x816e('0xe')]('['+[_0x4327e5[_0x816e('0xf')]()]+_0x816e('0x10'),_0x37e6eb);_0x35d378(_0x37e6eb);})[_0x816e('0x11')](function(_0x41c956){logger[_0x816e('0x12')]('['+[_0x4327e5[_0x816e('0xf')]()]+']',_0x41c956[_0x816e('0x13')]);_0x2a9a3c(_0x41c956[_0x816e('0x13')]);});});}function getUser(_0x3a8b85,_0x4427f0,_0x3fbbe3,_0x1eb7b7,_0x2b3e0f){return function(_0xe9de85){logger[_0x816e('0xe')]('['+[_0x3a8b85[_0x816e('0xf')]()]+_0x816e('0x14'),_0xe9de85);return new Promise(function(_0x288768,_0xce5736){if(intUtil[_0x816e('0x15')](_0xe9de85[_0x816e('0x16')])){var _0x2bf540={'method':'GET','uri':_0x3fbbe3+'sys_user?sysparm_query=email%3D'+_0xe9de85['userEmail']+'&'+_0x1eb7b7+'&'+_0x2b3e0f,'auth':_0x4427f0,'json':!![]};logger[_0x816e('0xe')]('['+[_0x3a8b85[_0x816e('0xf')]()]+_0x816e('0x17'),_0x2bf540);return rp(_0x2bf540)[_0x816e('0x18')](function(_0x226baf){logger['info']('['+[_0x3a8b85['toUpperCase']()]+_0x816e('0x19'),_0x226baf);if(_0x226baf[_0x816e('0xc')]['length']>0x0&&String(_0x226baf[_0x816e('0xc')][0x0]['active'])===_0x816e('0x1a')){_0xe9de85[_0x816e('0x1b')]=_0x226baf[_0x816e('0xc')][0x0]['sys_id'];}else{_0xe9de85['userId']=_0xe9de85[_0x816e('0xd')];_0xe9de85[_0x816e('0x16')]=_0xe9de85[_0x816e('0x1c')];}logger[_0x816e('0xe')]('['+[_0x3a8b85[_0x816e('0xf')]()]+_0x816e('0x1d'),_0xe9de85);_0x288768(_0xe9de85);})[_0x816e('0x11')](function(_0x12bcf7){logger['error']('['+[_0x3a8b85[_0x816e('0xf')]()]+']',_0x12bcf7[_0x816e('0x13')]);_0xce5736(_0x12bcf7[_0x816e('0x13')]);});}else{logger[_0x816e('0xe')]('['+[_0x3a8b85[_0x816e('0xf')]()]+']\x20using\x20admin\x20profile');_0xe9de85[_0x816e('0x1b')]=_0xe9de85[_0x816e('0xd')];_0xe9de85[_0x816e('0x16')]=_0xe9de85[_0x816e('0x1c')];_0x288768(_0xe9de85);}});};}function createEndUser(_0x54d288,_0x2f259b,_0x5ae7e,_0x42ed92,_0x3f78c6){logger[_0x816e('0xe')]('['+[_0x54d288[_0x816e('0xf')]()]+'],\x20createEndUser\x20input\x20crm',_0x5ae7e);return new Promise(function(_0x5df25d,_0x4ea040){var _0x5007b9={'method':_0x816e('0x1e'),'uri':_0x42ed92+_0x816e('0x1f')+_0x3f78c6,'body':{'user_name':_0x5ae7e['endUserNumber'],'roles':_0x816e('0x20'),'first_name':_0x5ae7e[_0x816e('0x21')],'active':_0x816e('0x1a'),'date_format':_0x816e('0x22'),'phone':_0x5ae7e['endUserNumber']},'auth':_0x2f259b,'json':!![]};return rp(_0x5007b9)[_0x816e('0x18')](function(_0x48ccc2){logger[_0x816e('0xe')]('['+[_0x54d288['toUpperCase']()]+_0x816e('0x23'),_0x48ccc2[_0x816e('0xc')]);_0x5ae7e[_0x816e('0x24')]=_0x48ccc2[_0x816e('0xc')][_0x816e('0x25')];_0x5df25d(_0x5ae7e);})[_0x816e('0x11')](function(_0x515a94){logger[_0x816e('0x12')]('['+[_0x54d288[_0x816e('0xf')]()]+']',_0x515a94['message']);_0x4ea040(_0x515a94[_0x816e('0x13')]);});});}function getEndUser(_0x515fac,_0x50e472,_0x143351,_0x40b1d5,_0x31688a){return function(_0x16f983){logger['info']('['+[_0x515fac[_0x816e('0xf')]()]+_0x816e('0x26'),_0x16f983);return new Promise(function(_0x9b5e50,_0x4e8ac3){var _0x1851c7={'method':_0x816e('0xa'),'uri':_0x143351+_0x816e('0x27')+_0x16f983['endUserNumber']+'&'+_0x40b1d5+'&'+_0x31688a,'auth':_0x50e472,'json':!![]};return rp(_0x1851c7)[_0x816e('0x18')](function(_0x43f5bc){if(_0x43f5bc[_0x816e('0xc')]['length']>0x0){_0x16f983['endUserId']=_0x43f5bc['result'][0x0][_0x816e('0x25')];logger[_0x816e('0xe')]('['+[_0x515fac[_0x816e('0xf')]()]+_0x816e('0x28'),_0x16f983);_0x9b5e50(_0x16f983);}else{return createEndUser(_0x515fac,_0x50e472,_0x16f983,_0x143351,_0x40b1d5)[_0x816e('0x18')](function(_0x1e471b){logger[_0x816e('0xe')]('['+[_0x515fac['toUpperCase']()]+_0x816e('0x29'),_0x1e471b);_0x9b5e50(_0x1e471b);});}})[_0x816e('0x11')](function(_0xdfbfbf){logger[_0x816e('0x12')]('['+[_0x515fac['toUpperCase']()]+']',_0xdfbfbf['message']);_0x4e8ac3(_0xdfbfbf['message']);});});};}function getCustomFields(_0x185c85,_0xeedbf8){var _0x3a0c58={};if(_0x185c85[_0x816e('0x2a')]>0x0){_[_0x816e('0x2b')](_0x185c85,function(_0x3a9a18){if(_[_0x816e('0x2c')]([_0x816e('0x2d'),'picklist'],_0x3a9a18[_0x816e('0x2e')])&&_0x3a9a18[_0x816e('0x2f')]&&!_0x3a9a18[_0x816e('0x30')]){_0x3a0c58[_0x3a9a18[_0x816e('0x2f')][_0x816e('0x31')]()]=_0x3a9a18[_0x816e('0x32')][_0x816e('0x33')]();}else if(_[_0x816e('0x2c')]([_0x816e('0x2d'),_0x816e('0x34')],_0x3a9a18[_0x816e('0x2e')])&&_0x3a9a18['idField']&&_0x3a9a18['customField']){_0x3a0c58[_0x3a9a18['idField']['toLowerCase']()]=_0x3a9a18[_0x816e('0x32')][_0x816e('0x33')]();}else if(_0x3a9a18['type']===_0x816e('0x35')&&_0x3a9a18[_0x816e('0x36')]&&_0x3a9a18[_0x816e('0x37')]&&_0x3a9a18[_0x816e('0x30')]){_0x3a0c58[_0x3a9a18[_0x816e('0x37')][_0x816e('0x31')]()]=_0xeedbf8[_0x3a9a18[_0x816e('0x36')]][_0x816e('0x33')]();}else if(_0x3a9a18[_0x816e('0x2e')]==='customVariable'&&_0x3a9a18['Variable']&&_0x3a9a18[_0x816e('0x38')]['name']&&_0x3a9a18[_0x816e('0x37')]&&_0x3a9a18[_0x816e('0x30')]){_0x3a0c58[_0x3a9a18[_0x816e('0x37')][_0x816e('0x31')]()]=_0xeedbf8[_0x3a9a18[_0x816e('0x38')]['name']['toLowerCase']()][_0x816e('0x33')]();}});}return _0x3a0c58;}function getTicket(_0x2d5508,_0x5bdfd8,_0x2f4577,_0x1e586c,_0x1b0bf9,_0x46ed68){return function(_0x5e3de5){logger[_0x816e('0xe')]('['+[_0x2d5508[_0x816e('0xf')]()]+_0x816e('0x39'),_0x5e3de5);return new Promise(function(_0x196032,_0x274651){var _0x58c849=_0x2d5508[_0x816e('0x31')]()==='outbound'?_0x5e3de5[_0x816e('0x1b')]:_0x5e3de5[_0x816e('0x24')];var _0x458c03={'method':_0x816e('0x1e'),'uri':_0x2f4577+_0x816e('0x3a')+'?'+_0x46ed68,'body':Object[_0x816e('0x3b')]({},{'active':_0x816e('0x1a'),'caller_id':_0x58c849,'assigned_to':_0x5e3de5['userId'],'short_description':intUtil[_0x816e('0x3c')](_0x1e586c[_0x816e('0x3d')],_0x1b0bf9,'\x20'),'description':intUtil[_0x816e('0x3c')](_0x1e586c[_0x816e('0x3e')],_0x1b0bf9,'\x0a')},getCustomFields(_0x1e586c[_0x816e('0x3f')],_0x1b0bf9)),'auth':_0x5bdfd8,'json':!![]};return rp(_0x458c03)[_0x816e('0x18')](function(_0x47067f){logger[_0x816e('0xe')]('['+[_0x2d5508[_0x816e('0xf')]()]+_0x816e('0x40'),_0x47067f[_0x816e('0xc')]);_0x5e3de5[_0x816e('0x41')]=_0x47067f[_0x816e('0xc')][_0x816e('0x25')];_0x5e3de5[_0x816e('0x42')]=_0x47067f[_0x816e('0xc')]['number'];logger[_0x816e('0xe')]('['+[_0x2d5508[_0x816e('0xf')]()]+_0x816e('0x43'),_0x5e3de5);_0x196032(_0x5e3de5);})[_0x816e('0x11')](function(_0x1d1fea){logger['error']('['+[_0x2d5508[_0x816e('0xf')]()]+']',_0x1d1fea[_0x816e('0x13')]);_0x274651(_0x1d1fea[_0x816e('0x13')]);});});};}function createRemoteTag(_0xc05844,_0xbedf06,_0x38785d,_0x56fbd7){return new Promise(function(_0x1abf2e,_0x288ee1){var _0x565fef={'method':_0x816e('0x1e'),'uri':_0x38785d+_0x816e('0x44')+'?'+_0x56fbd7,'body':{'short_description':_0xc05844,'global':!![],'active':!![],'name':_0xc05844},'auth':_0xbedf06,'json':!![]};return rp(_0x565fef)[_0x816e('0x18')](function(_0x1037e9){var _0xd8a656=_0x1037e9[_0x816e('0xc')][_0x816e('0x25')];_0x1abf2e(_0xd8a656);});});}function getRemoteTag(_0x40b50a,_0x533e1c,_0x25fa71,_0xa4d460,_0x1b4503){return new Promise(function(_0x2c8bd7,_0x10b2f1){var _0x2c9fd9={'method':_0x816e('0xa'),'uri':_0x25fa71+_0x816e('0x44')+'?sysparm_query=name%3D'+_0x40b50a+'&'+_0xa4d460,'auth':_0x533e1c,'json':!![]};return rp(_0x2c9fd9)[_0x816e('0x18')](function(_0x27e516){if(_0x27e516[_0x816e('0xc')][_0x816e('0x2a')]>0x0){var _0x2347ec=_0x27e516[_0x816e('0xc')][0x0][_0x816e('0x25')];_0x2c8bd7(_0x2347ec);}else{return createRemoteTag(_0x40b50a,_0x533e1c,_0x25fa71,_0xa4d460)[_0x816e('0x18')](function(_0x569448){_0x2c8bd7(_0x569448);});}});});}function assignTagToIncident(_0x2c62ab,_0x22c9f0,_0xd7685,_0x676fc3,_0x585e7c){return new Promise(function(_0x2cf0a0,_0x4b2b10){var _0x1c45c0={'method':_0x816e('0x1e'),'uri':_0xd7685+_0x816e('0x45')+'?'+_0x585e7c,'body':{'label':_0x2c62ab,'table':_0x816e('0x3a'),'id_type':_0x816e('0x46'),'table_key':_0x676fc3['ticketId'],'title':_0x816e('0x47')+_0x676fc3[_0x816e('0x42')],'id_display':_0x676fc3[_0x816e('0x42')]},'auth':_0x22c9f0,'json':!![]};return rp(_0x1c45c0)[_0x816e('0x18')](function(_0x3ca9ee){_0x2cf0a0();})[_0x816e('0x11')](function(){_0x2cf0a0();});});}function manageTags(_0x716df3,_0x51656e,_0x4b6cf9,_0x20ecb0,_0x107d43,_0x3f121e,_0x57f46b){return new Promise(function(_0x6ee5c4,_0x7ad1c){var _0x2db56e=[];_0x51656e[_0x816e('0x2b')](function(_0x4eade8){_0x2db56e[_0x816e('0x48')](getRemoteTag(_0x4eade8,_0x4b6cf9,_0x20ecb0,_0x3f121e,_0x57f46b));});return Promise[_0x816e('0x49')](_0x2db56e)[_0x816e('0x18')](function(_0x18b326){if(_0x18b326['length']){logger[_0x816e('0xe')]('['+[_0x716df3['toUpperCase']()]+_0x816e('0x4a'),_0x18b326);var _0x4b7804=[];_0x18b326['forEach'](function(_0x525d40){_0x4b7804['push'](assignTagToIncident(_0x525d40,_0x4b6cf9,_0x20ecb0,_0x107d43,_0x3f121e));});return Promise['all'](_0x4b7804)['then'](function(){_0x6ee5c4();})['catch'](function(){_0x6ee5c4();});}else{_0x6ee5c4();}});});}function getTags(_0x291dd2,_0x43ea29,_0x218a21,_0x30d080,_0x3985e0,_0x1d09da){return function(_0x545949){return new Promise(function(_0x174768,_0xcd12b3){var _0x298356=[];var _0x574f1f=_0x30d080[_0x816e('0x4b')];if(_0x574f1f&&_0x574f1f[_0x816e('0x2a')]>0x0){_0x298356=_['map'](_0x574f1f,_0x816e('0x4c'));}if(_0x298356[_0x816e('0x2a')]>0x0){return manageTags(_0x291dd2,_0x298356,_0x43ea29,_0x218a21,_0x545949,_0x3985e0,_0x1d09da)[_0x816e('0x18')](function(){_0x174768(_0x545949);});}else{_0x174768(_0x545949);}});};}function emit(_0x458917,_0x88c428,_0x1683eb){var _0x4b8972=_0x816e('0x4d')+_0x816e('0x4e')+_0x816e('0x4f')+'%255EORDERBYDESCnumber';var _0x4c9ce9={'uri':_0x458917+_0x816e('0x50')+_0x1683eb+_0x4b8972};io['to'](util[_0x816e('0x51')](_0x816e('0x52'),_0x88c428))['emit'](_0x816e('0x53'),_0x4c9ce9);}exports['cs']=function(_0x152aeb,_0x3e6ec1,_0x1d66c5,_0x580f73,_0x5ec507,_0x980e64,_0x367f33,_0x1af358){var _0x191d2e={};var _0x3647c0={'user':_0x980e64['username'],'pass':_0x980e64[_0x816e('0x54')]};var _0x1a67d8='sysparm_limit=1';var _0x2ec369='sysparm_display_value=true';_0x980e64[_0x816e('0x55')]=intUtil[_0x816e('0x56')](_0x980e64[_0x816e('0x55')]);_0x980e64[_0x816e('0x57')]=intUtil[_0x816e('0x56')](_0x980e64['serverUrl']);var _0x1aa143=util[_0x816e('0x51')](_0x816e('0x58'),_0x980e64[_0x816e('0x55')]);_0x191d2e[_0x816e('0x16')]=!_[_0x816e('0x59')](_0x580f73)?_0x580f73[_0x816e('0x5a')]:null;_0x191d2e['adminEmail']=_0x980e64[_0x816e('0x5a')];_0x191d2e[_0x816e('0x21')]=_0x1af358[_0x816e('0x31')]()==='outbound'?_0x3e6ec1[_0x816e('0x5b')]:_0x3e6ec1[_0x816e('0x5c')];_0x191d2e[_0x816e('0x5d')]=_0x1af358===_0x816e('0x5e')||_0x1af358===_0x816e('0x5f')?'queue':'outbound';var _0x77416=util['format'](_0x816e('0x60'),_0x980e64[_0x816e('0x57')],_0x3e6ec1['uniqueid'],md5(_0x3e6ec1[_0x816e('0x61')]));if(_0x5ec507&&_0x5ec507[_0x816e('0x62')]){logger['info']('[QUEUE]',_0x816e('0x63'));_0x3e6ec1[_0x816e('0x64')]=_0x77416;}else if(_0x367f33&&_0x367f33[_0x816e('0x65')]&&_0x367f33[_0x816e('0x65')]!==_0x816e('0x66')){logger[_0x816e('0xe')](_0x816e('0x67'),_0x816e('0x63'));_0x3e6ec1[_0x816e('0x64')]=_0x77416;}else{_0x3e6ec1[_0x816e('0x64')]='';}return getAdminUser(_0x1af358,_0x3647c0,_0x191d2e,_0x1aa143,_0x2ec369,_0x1a67d8)[_0x816e('0x18')](getUser(_0x1af358,_0x3647c0,_0x1aa143,_0x2ec369,_0x1a67d8))[_0x816e('0x18')](getEndUser(_0x1af358,_0x3647c0,_0x1aa143,_0x2ec369,_0x1a67d8))[_0x816e('0x18')](getTicket(_0x1af358,_0x3647c0,_0x1aa143,_0x1d66c5,_0x3e6ec1,_0x2ec369))[_0x816e('0x18')](function(_0x44f601){logger['info'](util[_0x816e('0x51')](_0x816e('0x68'),_0x44f601[_0x816e('0x41')]));logger[_0x816e('0xe')](util[_0x816e('0x51')](_0x816e('0x69'),_0x1af358));if(_0x1af358!==_0x816e('0x5f')){logger['info']('['+[_0x1af358[_0x816e('0xf')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x980e64[_0x816e('0x55')],_0x580f73[_0x816e('0x4c')],_0x44f601[_0x816e('0x41')]);}})['catch'](function(_0x535873){logger['error']('['+[_0x1af358[_0x816e('0xf')]()]+_0x816e('0x6a'),util[_0x816e('0x6b')](_0x535873,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 453bcd1..ad7091b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4aa=['duration_minutes','parent_type','parent_name','direction','length','forEach','push','idField','variableName','set_entry','JSON','stringify','format','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','Agent\x20found!','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','string','customField','nameField','type','custom_fields','content','toString','variable','customVariable','Variable','toLowerCase','login','username','PLAIN','sessionID','Calls','queue','stripTrailingSlash','remoteUri','serverUrl','%s/service/v4_1/rest.php','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','contacts','version','charAt','[QUEUE]','user:%s','catch','error','outbound','uri','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','users','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','Recording\x20is\x20enabled!','calleridname','Ticket\x20created!','lodash','request-promise','bluebird','md5','util','./util','../../../../config/environment','sugarcrm','redis','defaults','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','created_by','description','Descriptions','toISOString','slice','replace'];(function(_0x7e8305,_0x5c8218){var _0x103fcf=function(_0x3ef997){while(--_0x3ef997){_0x7e8305['push'](_0x7e8305['shift']());}};_0x103fcf(++_0x5c8218);}(_0xb4aa,0x148));var _0xab4a=function(_0x1f17e1,_0x38ffc4){_0x1f17e1=_0x1f17e1-0x0;var _0x33b7b7=_0xb4aa[_0x1f17e1];return _0x33b7b7;};'use strict';var _=require(_0xab4a('0x0'));var rp=require(_0xab4a('0x1'));var BPromise=require(_0xab4a('0x2'));var md5=require(_0xab4a('0x3'));var util=require(_0xab4a('0x4'));var Redis=require('ioredis');var intUtil=require(_0xab4a('0x5'));var config=require(_0xab4a('0x6'));var logger=require('../../../../config/logger')(_0xab4a('0x7'));config[_0xab4a('0x8')]=_[_0xab4a('0x9')](config['redis'],{'host':_0xab4a('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xab4a('0x8')]));var def={'method':_0xab4a('0xb'),'json':!![]};function emit(_0x54c341,_0x1d0021,_0x3734dc){io['to'](_0x54c341)[_0xab4a('0xc')](_0x1d0021,_0x3734dc);}function getTicket(_0x33bfb1,_0xe1cfa0,_0x2f0abe,_0x1fa1a2,_0xe9e63d,_0x18cd1f,_0x42ffe7,_0x546514){logger[_0xab4a('0xd')](_0xab4a('0xe'));var _0x5119e8=new Date();var _0x31d86f=[{'name':_0xab4a('0xf'),'value':intUtil[_0xab4a('0x10')](_0x1fa1a2['Subjects'],_0xe9e63d,'\x20')},{'name':'assigned_user_id','value':_0xe1cfa0['id']},{'name':_0xab4a('0x11'),'value':_0xe1cfa0['id']},{'name':_0xab4a('0x12'),'value':intUtil[_0xab4a('0x10')](_0x1fa1a2[_0xab4a('0x13')],_0xe9e63d,'\x0a')},{'name':'date_start','value':_0x5119e8[_0xab4a('0x14')]()[_0xab4a('0x15')](0x0,0x13)[_0xab4a('0x16')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xab4a('0x17'),'value':'15'},{'name':'parent_id','value':_0x2f0abe['id']},{'name':_0xab4a('0x18'),'value':'Contacts'},{'name':_0xab4a('0x19'),'value':_0x2f0abe[_0xab4a('0xf')]},{'name':_0xab4a('0x1a'),'value':_0x546514}];if(_0x18cd1f[_0xab4a('0x1b')]){_[_0xab4a('0x1c')](_0x18cd1f,function(_0x151c51){if(_0xe9e63d[_0x151c51['variableName']]){_0x31d86f[_0xab4a('0x1d')]({'name':_0x151c51[_0xab4a('0x1e')],'value':_0xe9e63d[_0x151c51[_0xab4a('0x1f')]]});}});}return request({'form':{'method':_0xab4a('0x20'),'input_type':_0xab4a('0x21'),'response_type':_0xab4a('0x21'),'rest_data':JSON[_0xab4a('0x22')]({'session':_0x42ffe7['id'],'module_name':'Calls','name_value_list':_0x31d86f})}});}function getAuth(_0x5619e5){return util[_0xab4a('0x23')]('Basic\x20%s',new Buffer(_0x5619e5[_0xab4a('0x24')]+':X')['toString'](_0xab4a('0x25')));}function getServerInfo(_0x9383a3){return request({'form':{'method':_0xab4a('0x26'),'input_type':_0xab4a('0x21'),'response_type':_0xab4a('0x21'),'rest_data':JSON['stringify']({'session':_0x9383a3['id']})}});}function getUser(_0x11efce,_0x2e8176,_0x3c8bab){if(!_[_0xab4a('0x27')](_0x2e8176)){logger['info'](_0xab4a('0x28'),_0x2e8176);return request({'form':{'method':'get_entry_list','input_type':_0xab4a('0x21'),'response_type':_0xab4a('0x21'),'rest_data':JSON[_0xab4a('0x22')]({'session':_0x3c8bab['id'],'module_name':'Employees','query':util['format'](_0xab4a('0x29'),_0x2e8176),'order_by':'','offset':'0','select_fields':['id',_0xab4a('0xf'),_0xab4a('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xab4a('0x2b')](function(_0x1146ca){if(_0x1146ca[_0xab4a('0x2c')][_0xab4a('0x1b')]){var _0x18ee43=_['find'](_0x1146ca[_0xab4a('0x2c')],function(_0x260b79){return _0x260b79[_0xab4a('0x2d')]['user_name']['value']===_0x2e8176;});if(_0x18ee43){logger[_0xab4a('0xd')](_0xab4a('0x2e'));return BPromise['resolve']({'id':_0x18ee43[_0xab4a('0x2d')]['id'][_0xab4a('0x2f')],'name':_0x18ee43['name_value_list'][_0xab4a('0xf')]['value']});}}logger[_0xab4a('0xd')](_0xab4a('0x30'));return BPromise[_0xab4a('0x31')]({'id':_0x3c8bab[_0xab4a('0x2d')][_0xab4a('0x32')][_0xab4a('0x2f')],'name':_0x3c8bab[_0xab4a('0x2d')]['user_name'][_0xab4a('0x2f')]});});}else{logger[_0xab4a('0xd')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xab4a('0x31')]({'id':_0x3c8bab[_0xab4a('0x2d')][_0xab4a('0x32')]['value'],'name':_0x3c8bab[_0xab4a('0x2d')][_0xab4a('0x2a')][_0xab4a('0x2f')]});}}function getEndUser(_0x40f716,_0x19edad,_0x28f489,_0x5f27d7){logger[_0xab4a('0xd')](_0xab4a('0x33'),_0x28f489);return request({'form':{'method':_0xab4a('0x34'),'input_type':_0xab4a('0x21'),'response_type':_0xab4a('0x21'),'rest_data':JSON[_0xab4a('0x22')]({'session':_0x5f27d7['id'],'module_name':_0xab4a('0x35'),'query':util[_0xab4a('0x23')](_0xab4a('0x36'),_0x28f489),'order_by':'','offset':'0','select_fields':['id',_0xab4a('0xf'),_0xab4a('0x37')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x36b768){if(_0x36b768[_0xab4a('0x2c')]['length']){var _0x2b2e9a=_[_0xab4a('0x38')](_0x36b768['entry_list'],function(_0x437b98){return _0x437b98['name_value_list'][_0xab4a('0x37')][_0xab4a('0x2f')]===_0x28f489;});if(_0x2b2e9a){logger[_0xab4a('0xd')]('Enduser\x20found!');return BPromise[_0xab4a('0x31')]({'id':_0x2b2e9a[_0xab4a('0x2d')]['id'][_0xab4a('0x2f')],'name':_0x2b2e9a[_0xab4a('0x2d')][_0xab4a('0xf')]['value'],'phone':_0x2b2e9a[_0xab4a('0x2d')][_0xab4a('0x37')]['value']});}}else{logger[_0xab4a('0xd')](_0xab4a('0x39'));return request({'form':{'method':_0xab4a('0x20'),'input_type':_0xab4a('0x21'),'response_type':_0xab4a('0x21'),'rest_data':JSON[_0xab4a('0x22')]({'session':_0x5f27d7['id'],'module_name':'Contacts','name_value_list':[{'name':_0xab4a('0x3a'),'value':_0x19edad!=='<unknown>'?_0x19edad:util[_0xab4a('0x23')](_0xab4a('0x3b'),_0x28f489)},{'name':_0xab4a('0x37'),'value':_0x28f489}]})}})['then'](function(_0x472d8b){logger[_0xab4a('0xd')](_0xab4a('0x3c'));return BPromise[_0xab4a('0x31')]({'id':_0x472d8b['id'],'name':_0x472d8b[_0xab4a('0x2c')][_0xab4a('0x3a')][_0xab4a('0x2f')],'phone':_0x472d8b[_0xab4a('0x2c')][_0xab4a('0x37')]['value']});});}});}function request(_0x2a9726){logger[_0xab4a('0x3d')](_0xab4a('0x3e'),JSON[_0xab4a('0x22')](_0x2a9726));return rp(_['merge'](def,_0x2a9726));}function getTags(_0x17f8c5,_0x14650f){var _0x4ed9f1=[];if(_0x17f8c5&&_0x17f8c5[_0xab4a('0x1b')]>0x0){_0x4ed9f1=_['map'](_0x17f8c5,_0x14650f);}return _0x4ed9f1;}function getCustomFields(_0x7ba247,_0x4deb1a){var _0x2340d8=[];var _0x216106={'custom_fields':[]};if(_0x7ba247['length']>0x0){_['forEach'](_0x7ba247,function(_0x16c771){if(_0x16c771['type']===_0xab4a('0x3f')&&_0x16c771['nameField']&&!_0x16c771[_0xab4a('0x40')]){_0x216106[_0x16c771[_0xab4a('0x41')]['toLowerCase']()]=_0x16c771['content']['toString']();}else if(_0x16c771[_0xab4a('0x42')]===_0xab4a('0x3f')&&_0x16c771[_0xab4a('0x1e')]&&_0x16c771['customField']){_0x216106[_0xab4a('0x43')][_0xab4a('0x1d')]({'id':_0x16c771[_0xab4a('0x1e')],'value':_0x16c771[_0xab4a('0x44')][_0xab4a('0x45')]()});}else if(_0x16c771[_0xab4a('0x42')]===_0xab4a('0x46')&&_0x16c771[_0xab4a('0x1f')]&&_0x16c771[_0xab4a('0x1e')]&&_0x16c771['customField']){_0x4deb1a[_0x16c771['variableName']]&&_0x216106[_0xab4a('0x43')][_0xab4a('0x1d')]({'id':_0x16c771['idField'],'value':_0x4deb1a[_0x16c771[_0xab4a('0x1f')]]['toString']()});}else if(_0x16c771[_0xab4a('0x42')]===_0xab4a('0x47')&&_0x16c771[_0xab4a('0x48')]&&_0x16c771['Variable'][_0xab4a('0xf')]&&_0x16c771[_0xab4a('0x1e')]&&_0x16c771[_0xab4a('0x40')]){_0x4deb1a[_0x16c771[_0xab4a('0x48')]['name'][_0xab4a('0x49')]()]&&_0x216106[_0xab4a('0x43')][_0xab4a('0x1d')]({'id':_0x16c771['idField'],'value':_0x4deb1a[_0x16c771['Variable'][_0xab4a('0xf')][_0xab4a('0x49')]()][_0xab4a('0x45')]()});}});}return _0x216106;}function getConnection(_0x12947e){return request({'method':_0xab4a('0xb'),'form':{'method':_0xab4a('0x4a'),'input_type':_0xab4a('0x21'),'response_type':_0xab4a('0x21'),'rest_data':JSON[_0xab4a('0x22')]({'user_auth':{'user_name':_0x12947e[_0xab4a('0x4b')],'password':_0x12947e['password'],'encryption':_0xab4a('0x4c')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xab4a('0x2b')](function(_0x5118a9){var _0x2fc1a5=_0x5118a9;if(_0x2fc1a5['id']){def[_0xab4a('0x4d')]=_0x2fc1a5['id'];return BPromise[_0xab4a('0x31')](_0x2fc1a5);}else{throw new Error(util[_0xab4a('0x23')]('Account\x20%d\x20is\x20not\x20valid',_0x12947e['id']));}});}function setRelationship(_0x16f99f,_0x5b04c6,_0x27f1b2,_0x1e23b0){return request({'form':{'method':'set_relationship','input_type':_0xab4a('0x21'),'response_type':_0xab4a('0x21'),'rest_data':JSON[_0xab4a('0x22')]({'session':_0x16f99f['id'],'module_name':_0xab4a('0x4e'),'module_id':_0x27f1b2['id'],'link_field_name':_0x1e23b0,'related_ids':[_0x5b04c6['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xab4a('0x4f')]=function(_0x1ea0f2,_0x1c6044,_0x32f4a7,_0x579867,_0x4e3fe6,_0x3f3f26){var _0x38de73,_0x3c2029,_0x1be979,_0x263d93;_0x3f3f26['remoteUri']=intUtil[_0xab4a('0x50')](_0x3f3f26[_0xab4a('0x51')]);_0x3f3f26[_0xab4a('0x52')]=intUtil[_0xab4a('0x50')](_0x3f3f26[_0xab4a('0x52')]);def['uri']=util['format'](_0xab4a('0x53'),_0x3f3f26[_0xab4a('0x51')]);if(_0x4e3fe6&&_0x4e3fe6[_0xab4a('0x54')]){logger[_0xab4a('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x1c6044[_0xab4a('0x55')]=util[_0xab4a('0x23')](_0xab4a('0x56'),_0x3f3f26[_0xab4a('0x52')],_0x1c6044[_0xab4a('0x57')],md5(_0x1c6044[_0xab4a('0x57')]));}else{_0x1c6044['recordingURL']='';}return getConnection(_0x3f3f26)[_0xab4a('0x2b')](function(_0x31cf8d){_0x263d93=_0x31cf8d;return getUser(_0x3f3f26,_0x579867[_0xab4a('0xf')],_0x263d93);})['then'](function(_0x4173fc){_0x38de73=_0x4173fc;logger[_0xab4a('0xd')]('The\x20User\x20ID\x20is:',_0x38de73['id']);return getEndUser(_0x3f3f26,_0x1c6044['calleridname'],_0x1c6044[_0xab4a('0x58')],_0x263d93);})[_0xab4a('0x2b')](function(_0x39d006){_0x3c2029=_0x39d006;logger[_0xab4a('0xd')](_0xab4a('0x59'),_0x3c2029['id']);return getTicket(_0x3f3f26,_0x38de73,_0x3c2029,_0x32f4a7,_0x1c6044,_0x32f4a7[_0xab4a('0x5a')],_0x263d93,_0xab4a('0x5b'));})[_0xab4a('0x2b')](function(_0x565e5f){_0x1be979=_0x565e5f;logger[_0xab4a('0xd')]('Ticket\x20created!');logger['info'](_0xab4a('0x5c'),_0x1be979['id']);return setRelationship(_0x263d93,_0x38de73,_0x1be979,'users');})[_0xab4a('0x2b')](function(){return setRelationship(_0x263d93,_0x3c2029,_0x1be979,_0xab4a('0x5d'));})['then'](function(){return getServerInfo(_0x263d93);})[_0xab4a('0x2b')](function(_0x5a6f9a){var _0x107af6=parseInt(_0x5a6f9a[_0xab4a('0x5e')][_0xab4a('0x5f')](0x0));var _0x3e87=util[_0xab4a('0x23')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x3f3f26[_0xab4a('0x51')],_0x1be979['id']);if(_0x107af6>0x6){_0x3e87=util[_0xab4a('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3f3f26[_0xab4a('0x51')],_0x1be979['id']);}logger[_0xab4a('0xd')](_0xab4a('0x60'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xab4a('0x23')](_0xab4a('0x61'),_0x579867['name']),'trigger:browser:url',{'uri':_0x3e87});})[_0xab4a('0x62')](function(_0xf8647){logger[_0xab4a('0x63')](_0xab4a('0x60'),JSON[_0xab4a('0x22')](_0xf8647));});};exports[_0xab4a('0x64')]=function(_0xb211ea,_0x4d4e7f,_0x33a7c9,_0x207450,_0x1dc06d,_0x564171,_0x4b6fdc){var _0x163691,_0x2db394,_0xb94323,_0xa6887d;_0x564171[_0xab4a('0x51')]=intUtil[_0xab4a('0x50')](_0x564171[_0xab4a('0x51')]);_0x564171[_0xab4a('0x52')]=intUtil[_0xab4a('0x50')](_0x564171[_0xab4a('0x52')]);def[_0xab4a('0x65')]=util[_0xab4a('0x23')]('%s/service/v4_1/rest.php',_0x564171[_0xab4a('0x51')]);if(_0x4b6fdc&&_0x4b6fdc[_0xab4a('0x66')]&&_0x4b6fdc['recordingFormat']!==_0xab4a('0x67')){logger['info'](_0xab4a('0x68'),'Recording\x20is\x20enabled!');_0x4d4e7f[_0xab4a('0x55')]=util[_0xab4a('0x23')](_0xab4a('0x56'),_0x564171[_0xab4a('0x52')],_0x4d4e7f[_0xab4a('0x57')],md5(_0x4d4e7f['uniqueid']));}return getConnection(_0x564171)[_0xab4a('0x2b')](function(_0x340b68){_0xa6887d=_0x340b68;return getUser(_0x564171,_0x207450[_0xab4a('0xf')],_0xa6887d);})[_0xab4a('0x2b')](function(_0x17e9d2){_0x163691=_0x17e9d2;logger[_0xab4a('0xd')](_0xab4a('0x69'),_0x163691['id']);return getEndUser(_0x564171,_0x4d4e7f[_0xab4a('0x6a')],_0x4d4e7f[_0xab4a('0x6b')],_0xa6887d);})[_0xab4a('0x2b')](function(_0x5f3776){_0x2db394=_0x5f3776;logger[_0xab4a('0xd')](_0xab4a('0x59'),_0x2db394['id']);return getTicket(_0x564171,_0x163691,_0x2db394,_0x33a7c9,_0x4d4e7f,_0x33a7c9[_0xab4a('0x5a')],_0xa6887d,_0xab4a('0x6c'));})[_0xab4a('0x2b')](function(_0x595199){_0xb94323=_0x595199;logger[_0xab4a('0xd')]('Ticket\x20created!');logger[_0xab4a('0xd')](_0xab4a('0x5c'),_0xb94323['id']);return setRelationship(_0xa6887d,_0x163691,_0xb94323,_0xab4a('0x6d'));})[_0xab4a('0x2b')](function(){return setRelationship(_0xa6887d,_0x2db394,_0xb94323,_0xab4a('0x5d'));})[_0xab4a('0x2b')](function(){return getServerInfo(_0xa6887d);})[_0xab4a('0x2b')](function(_0x34ef7c){var _0x3b910a=parseInt(_0x34ef7c[_0xab4a('0x5e')][_0xab4a('0x5f')](0x0));var _0x5ce3c9=util[_0xab4a('0x23')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x564171[_0xab4a('0x51')],_0xb94323['id']);if(_0x3b910a>0x6){_0x5ce3c9=util[_0xab4a('0x23')](_0xab4a('0x6e'),_0x564171[_0xab4a('0x51')],_0xb94323['id']);}logger[_0xab4a('0xd')](_0xab4a('0x68'),_0xab4a('0x6f'));emit(util[_0xab4a('0x23')](_0xab4a('0x61'),_0x207450[_0xab4a('0xf')]),'trigger:browser:url',{'uri':_0x5ce3c9});})[_0xab4a('0x62')](function(_0x4e5be2){logger[_0xab4a('0x63')]('[OUTBOUND]',JSON[_0xab4a('0x22')](_0x4e5be2));});};exports[_0xab4a('0x70')]=function(_0x531c8a,_0x8f0301,_0x5f433d,_0x5d90f4,_0x299e1d,_0x4ae52f){var _0x53ff3a,_0x4e0557,_0x441a30,_0x5c8c88;_0x4ae52f['remoteUri']=intUtil[_0xab4a('0x50')](_0x4ae52f['remoteUri']);_0x4ae52f[_0xab4a('0x52')]=intUtil[_0xab4a('0x50')](_0x4ae52f['serverUrl']);def[_0xab4a('0x65')]=util[_0xab4a('0x23')](_0xab4a('0x53'),_0x4ae52f['remoteUri']);if(_0x299e1d&&_0x299e1d[_0xab4a('0x54')]){logger[_0xab4a('0xd')]('['+_0x8f0301['lastevent'][_0xab4a('0x71')]()+']',_0xab4a('0x72'));_0x8f0301[_0xab4a('0x55')]=util[_0xab4a('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4ae52f[_0xab4a('0x52')],_0x8f0301['uniqueid'],md5(_0x8f0301[_0xab4a('0x57')]));}else{_0x8f0301['recordingURL']='';}return getConnection(_0x4ae52f)[_0xab4a('0x2b')](function(_0x29ead3){_0x5c8c88=_0x29ead3;if(!_[_0xab4a('0x27')](_0x5d90f4)){return getUser(_0x4ae52f,_0x5d90f4['name'],_0x5c8c88);}else{return getUser(_0x4ae52f,null,_0x5c8c88);}})[_0xab4a('0x2b')](function(_0x2f94e5){_0x53ff3a=_0x2f94e5;logger[_0xab4a('0xd')](_0xab4a('0x69'),_0x53ff3a['id']);return getEndUser(_0x4ae52f,_0x8f0301[_0xab4a('0x73')],_0x8f0301['calleridnum'],_0x5c8c88);})[_0xab4a('0x2b')](function(_0x1c4f2d){_0x4e0557=_0x1c4f2d;logger['info'](_0xab4a('0x59'),_0x4e0557['id']);return getTicket(_0x4ae52f,_0x53ff3a,_0x4e0557,_0x5f433d,_0x8f0301,_0x5f433d[_0xab4a('0x5a')],_0x5c8c88,_0xab4a('0x5b'));})[_0xab4a('0x2b')](function(_0x492baf){_0x441a30=_0x492baf;logger[_0xab4a('0xd')](_0xab4a('0x74'));logger['info'](_0xab4a('0x5c'),_0x441a30['id']);return setRelationship(_0x5c8c88,_0x53ff3a,_0x441a30,_0xab4a('0x6d'));})[_0xab4a('0x2b')](function(){return setRelationship(_0x5c8c88,_0x4e0557,_0x441a30,'contacts');})[_0xab4a('0x2b')](function(){return getServerInfo(_0x5c8c88);})[_0xab4a('0x62')](function(_0x587726){logger[_0xab4a('0x63')]('['+_0x8f0301['lastevent']['toUpperCase']()+']',JSON['stringify'](_0x587726));});};
\ No newline at end of file
+var _0x845a=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Caller\x20-\x20%s','Enduser\x20created.','debug','length','map','type','string','nameField','customField','toLowerCase','toString','custom_fields','content','variable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','remoteUri','stripTrailingSlash','uri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','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','user:%s','trigger:browser:url','catch','error','outbound','serverUrl','%s/service/v4_1/rest.php','recordingFormat','none','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','Outbound','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','unmanaged','toUpperCase','isNil','calleridname','lodash','request-promise','bluebird','md5','util','../../../../config/environment','../../../../config/logger','defaults','localhost','socket.io-emitter','redis','POST','emit','info','name','getString','description','Descriptions','date_start','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','forEach','variableName','push','idField','set_entry','JSON','Calls','format','apiKey','base64','get_server_info','stringify','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','find','name_value_list','user_name','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','get_entry_list','then','phone_home'];(function(_0x141b62,_0x5a537b){var _0x517519=function(_0x53c2ea){while(--_0x53c2ea){_0x141b62['push'](_0x141b62['shift']());}};_0x517519(++_0x5a537b);}(_0x845a,0xb2));var _0xa845=function(_0x429692,_0x13189d){_0x429692=_0x429692-0x0;var _0xc9a0a4=_0x845a[_0x429692];return _0xc9a0a4;};'use strict';var _=require(_0xa845('0x0'));var rp=require(_0xa845('0x1'));var BPromise=require(_0xa845('0x2'));var md5=require(_0xa845('0x3'));var util=require(_0xa845('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xa845('0x5'));var logger=require(_0xa845('0x6'))('sugarcrm');config['redis']=_[_0xa845('0x7')](config['redis'],{'host':_0xa845('0x8'),'port':0x18eb});var io=require(_0xa845('0x9'))(new Redis(config[_0xa845('0xa')]));var def={'method':_0xa845('0xb'),'json':!![]};function emit(_0x452fff,_0x2f270b,_0x54a0ec){io['to'](_0x452fff)[_0xa845('0xc')](_0x2f270b,_0x54a0ec);}function getTicket(_0x1bae6e,_0xf06142,_0x38a3c2,_0x3e89af,_0x1c425d,_0x16f055,_0x3e721b,_0x4c96da){logger[_0xa845('0xd')]('Creating\x20new\x20ticket...');var _0x54e555=new Date();var _0x2cb342=[{'name':_0xa845('0xe'),'value':intUtil[_0xa845('0xf')](_0x3e89af['Subjects'],_0x1c425d,'\x20')},{'name':'assigned_user_id','value':_0xf06142['id']},{'name':'created_by','value':_0xf06142['id']},{'name':_0xa845('0x10'),'value':intUtil['getString'](_0x3e89af[_0xa845('0x11')],_0x1c425d,'\x0a')},{'name':_0xa845('0x12'),'value':_0x54e555['toISOString']()['slice'](0x0,0x13)[_0xa845('0x13')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xa845('0x14'),'value':'15'},{'name':_0xa845('0x15'),'value':_0x38a3c2['id']},{'name':_0xa845('0x16'),'value':_0xa845('0x17')},{'name':_0xa845('0x18'),'value':_0x38a3c2[_0xa845('0xe')]},{'name':_0xa845('0x19'),'value':_0x4c96da}];if(_0x16f055['length']){_[_0xa845('0x1a')](_0x16f055,function(_0xa5dc08){if(_0x1c425d[_0xa5dc08[_0xa845('0x1b')]]){_0x2cb342[_0xa845('0x1c')]({'name':_0xa5dc08[_0xa845('0x1d')],'value':_0x1c425d[_0xa5dc08[_0xa845('0x1b')]]});}});}return request({'form':{'method':_0xa845('0x1e'),'input_type':_0xa845('0x1f'),'response_type':_0xa845('0x1f'),'rest_data':JSON['stringify']({'session':_0x3e721b['id'],'module_name':_0xa845('0x20'),'name_value_list':_0x2cb342})}});}function getAuth(_0x33eec9){return util[_0xa845('0x21')]('Basic\x20%s',new Buffer(_0x33eec9[_0xa845('0x22')]+':X')['toString'](_0xa845('0x23')));}function getServerInfo(_0x34ce92){return request({'form':{'method':_0xa845('0x24'),'input_type':'JSON','response_type':_0xa845('0x1f'),'rest_data':JSON[_0xa845('0x25')]({'session':_0x34ce92['id']})}});}function getUser(_0x2a3958,_0x34c3b5,_0x4e8a14){if(!_['isNil'](_0x34c3b5)){logger[_0xa845('0xd')]('Getting\x20agent\x20with\x20name',_0x34c3b5);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':_0xa845('0x1f'),'rest_data':JSON[_0xa845('0x25')]({'session':_0x4e8a14['id'],'module_name':'Employees','query':util[_0xa845('0x21')](_0xa845('0x26'),_0x34c3b5),'order_by':'','offset':'0','select_fields':['id',_0xa845('0xe'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x53235){if(_0x53235[_0xa845('0x27')]['length']){var _0xea9282=_[_0xa845('0x28')](_0x53235[_0xa845('0x27')],function(_0x37922d){return _0x37922d[_0xa845('0x29')][_0xa845('0x2a')][_0xa845('0x2b')]===_0x34c3b5;});if(_0xea9282){logger[_0xa845('0xd')]('Agent\x20found!');return BPromise[_0xa845('0x2c')]({'id':_0xea9282[_0xa845('0x29')]['id'][_0xa845('0x2b')],'name':_0xea9282[_0xa845('0x29')][_0xa845('0xe')][_0xa845('0x2b')]});}}logger['info'](_0xa845('0x2d'));return BPromise['resolve']({'id':_0x4e8a14[_0xa845('0x29')][_0xa845('0x2e')][_0xa845('0x2b')],'name':_0x4e8a14[_0xa845('0x29')]['user_name'][_0xa845('0x2b')]});});}else{logger[_0xa845('0xd')](_0xa845('0x2f'));return BPromise[_0xa845('0x2c')]({'id':_0x4e8a14[_0xa845('0x29')]['user_id'][_0xa845('0x2b')],'name':_0x4e8a14[_0xa845('0x29')][_0xa845('0x2a')][_0xa845('0x2b')]});}}function getEndUser(_0x319c98,_0x3288fe,_0x2451e6,_0x20c250){logger['info'](_0xa845('0x30'),_0x2451e6);return request({'form':{'method':_0xa845('0x31'),'input_type':_0xa845('0x1f'),'response_type':'JSON','rest_data':JSON[_0xa845('0x25')]({'session':_0x20c250['id'],'module_name':_0xa845('0x17'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x2451e6),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xa845('0x32')](function(_0x1d4801){if(_0x1d4801[_0xa845('0x27')]['length']){var _0x1fee13=_[_0xa845('0x28')](_0x1d4801[_0xa845('0x27')],function(_0x4db8be){return _0x4db8be[_0xa845('0x29')][_0xa845('0x33')][_0xa845('0x2b')]===_0x2451e6;});if(_0x1fee13){logger[_0xa845('0xd')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x1fee13[_0xa845('0x29')]['id'][_0xa845('0x2b')],'name':_0x1fee13[_0xa845('0x29')][_0xa845('0xe')][_0xa845('0x2b')],'phone':_0x1fee13[_0xa845('0x29')][_0xa845('0x33')][_0xa845('0x2b')]});}}else{logger[_0xa845('0xd')](_0xa845('0x34'));return request({'form':{'method':'set_entry','input_type':_0xa845('0x1f'),'response_type':'JSON','rest_data':JSON[_0xa845('0x25')]({'session':_0x20c250['id'],'module_name':_0xa845('0x17'),'name_value_list':[{'name':_0xa845('0x35'),'value':_0x3288fe!==_0xa845('0x36')?_0x3288fe:util[_0xa845('0x21')](_0xa845('0x37'),_0x2451e6)},{'name':_0xa845('0x33'),'value':_0x2451e6}]})}})[_0xa845('0x32')](function(_0xc6d8bf){logger[_0xa845('0xd')](_0xa845('0x38'));return BPromise[_0xa845('0x2c')]({'id':_0xc6d8bf['id'],'name':_0xc6d8bf['entry_list']['first_name']['value'],'phone':_0xc6d8bf['entry_list'][_0xa845('0x33')][_0xa845('0x2b')]});});}});}function request(_0x927cba){logger[_0xa845('0x39')]('[HTTP]',JSON[_0xa845('0x25')](_0x927cba));return rp(_['merge'](def,_0x927cba));}function getTags(_0x498b3a,_0x18bbda){var _0x264a17=[];if(_0x498b3a&&_0x498b3a[_0xa845('0x3a')]>0x0){_0x264a17=_[_0xa845('0x3b')](_0x498b3a,_0x18bbda);}return _0x264a17;}function getCustomFields(_0x1af199,_0x4810de){var _0x29a782=[];var _0x363692={'custom_fields':[]};if(_0x1af199[_0xa845('0x3a')]>0x0){_['forEach'](_0x1af199,function(_0x3f0c7e){if(_0x3f0c7e[_0xa845('0x3c')]===_0xa845('0x3d')&&_0x3f0c7e[_0xa845('0x3e')]&&!_0x3f0c7e[_0xa845('0x3f')]){_0x363692[_0x3f0c7e[_0xa845('0x3e')][_0xa845('0x40')]()]=_0x3f0c7e['content'][_0xa845('0x41')]();}else if(_0x3f0c7e[_0xa845('0x3c')]===_0xa845('0x3d')&&_0x3f0c7e['idField']&&_0x3f0c7e['customField']){_0x363692[_0xa845('0x42')][_0xa845('0x1c')]({'id':_0x3f0c7e[_0xa845('0x1d')],'value':_0x3f0c7e[_0xa845('0x43')][_0xa845('0x41')]()});}else if(_0x3f0c7e[_0xa845('0x3c')]===_0xa845('0x44')&&_0x3f0c7e[_0xa845('0x1b')]&&_0x3f0c7e[_0xa845('0x1d')]&&_0x3f0c7e['customField']){_0x4810de[_0x3f0c7e[_0xa845('0x1b')]]&&_0x363692['custom_fields']['push']({'id':_0x3f0c7e[_0xa845('0x1d')],'value':_0x4810de[_0x3f0c7e['variableName']]['toString']()});}else if(_0x3f0c7e[_0xa845('0x3c')]==='customVariable'&&_0x3f0c7e[_0xa845('0x45')]&&_0x3f0c7e[_0xa845('0x45')][_0xa845('0xe')]&&_0x3f0c7e[_0xa845('0x1d')]&&_0x3f0c7e[_0xa845('0x3f')]){_0x4810de[_0x3f0c7e[_0xa845('0x45')]['name'][_0xa845('0x40')]()]&&_0x363692[_0xa845('0x42')][_0xa845('0x1c')]({'id':_0x3f0c7e[_0xa845('0x1d')],'value':_0x4810de[_0x3f0c7e[_0xa845('0x45')][_0xa845('0xe')]['toLowerCase']()][_0xa845('0x41')]()});}});}return _0x363692;}function getConnection(_0x3cafc4){return request({'method':_0xa845('0xb'),'form':{'method':_0xa845('0x46'),'input_type':'JSON','response_type':_0xa845('0x1f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3cafc4[_0xa845('0x47')],'password':_0x3cafc4['password'],'encryption':_0xa845('0x48')},'application':_0xa845('0x49')})}})[_0xa845('0x32')](function(_0x253309){var _0x1a3614=_0x253309;if(_0x1a3614['id']){def[_0xa845('0x4a')]=_0x1a3614['id'];return BPromise[_0xa845('0x2c')](_0x1a3614);}else{throw new Error(util[_0xa845('0x21')](_0xa845('0x4b'),_0x3cafc4['id']));}});}function setRelationship(_0x33caa6,_0x37310d,_0x5f28af,_0x3ca40a){return request({'form':{'method':'set_relationship','input_type':_0xa845('0x1f'),'response_type':'JSON','rest_data':JSON[_0xa845('0x25')]({'session':_0x33caa6['id'],'module_name':_0xa845('0x20'),'module_id':_0x5f28af['id'],'link_field_name':_0x3ca40a,'related_ids':[_0x37310d['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x198c3f,_0x19544e,_0x5cb2c0,_0x4a72f6,_0x18e072,_0xd17875){var _0x1015b7,_0x1d54be,_0x163d10,_0x24abf1;_0xd17875[_0xa845('0x4c')]=intUtil[_0xa845('0x4d')](_0xd17875['remoteUri']);_0xd17875['serverUrl']=intUtil[_0xa845('0x4d')](_0xd17875['serverUrl']);def[_0xa845('0x4e')]=util[_0xa845('0x21')]('%s/service/v4_1/rest.php',_0xd17875['remoteUri']);if(_0x18e072&&_0x18e072[_0xa845('0x4f')]){logger[_0xa845('0xd')](_0xa845('0x50'),_0xa845('0x51'));_0x19544e[_0xa845('0x52')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd17875['serverUrl'],_0x19544e[_0xa845('0x53')],md5(_0x19544e[_0xa845('0x53')]));}else{_0x19544e[_0xa845('0x52')]='';}return getConnection(_0xd17875)[_0xa845('0x32')](function(_0x365286){_0x24abf1=_0x365286;return getUser(_0xd17875,_0x4a72f6[_0xa845('0xe')],_0x24abf1);})['then'](function(_0xb6a7cc){_0x1015b7=_0xb6a7cc;logger[_0xa845('0xd')](_0xa845('0x54'),_0x1015b7['id']);return getEndUser(_0xd17875,_0x19544e['calleridname'],_0x19544e[_0xa845('0x55')],_0x24abf1);})['then'](function(_0x50423c){_0x1d54be=_0x50423c;logger[_0xa845('0xd')](_0xa845('0x56'),_0x1d54be['id']);return getTicket(_0xd17875,_0x1015b7,_0x1d54be,_0x5cb2c0,_0x19544e,_0x5cb2c0[_0xa845('0x57')],_0x24abf1,_0xa845('0x58'));})[_0xa845('0x32')](function(_0x2ff2fe){_0x163d10=_0x2ff2fe;logger[_0xa845('0xd')](_0xa845('0x59'));logger[_0xa845('0xd')]('The\x20Ticket\x20ID\x20is:',_0x163d10['id']);return setRelationship(_0x24abf1,_0x1015b7,_0x163d10,_0xa845('0x5a'));})[_0xa845('0x32')](function(){return setRelationship(_0x24abf1,_0x1d54be,_0x163d10,_0xa845('0x5b'));})[_0xa845('0x32')](function(){return getServerInfo(_0x24abf1);})[_0xa845('0x32')](function(_0x3e7808){var _0x5da43e=parseInt(_0x3e7808[_0xa845('0x5c')][_0xa845('0x5d')](0x0));var _0x1f8b49=util[_0xa845('0x21')](_0xa845('0x5e'),_0xd17875['remoteUri'],_0x163d10['id']);if(_0x5da43e>0x6){_0x1f8b49=util[_0xa845('0x21')](_0xa845('0x5f'),_0xd17875[_0xa845('0x4c')],_0x163d10['id']);}logger[_0xa845('0xd')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa845('0x21')](_0xa845('0x60'),_0x4a72f6[_0xa845('0xe')]),_0xa845('0x61'),{'uri':_0x1f8b49});})[_0xa845('0x62')](function(_0xecee36){logger[_0xa845('0x63')](_0xa845('0x50'),JSON[_0xa845('0x25')](_0xecee36));});};exports[_0xa845('0x64')]=function(_0x10d813,_0x2c952f,_0x734e4,_0x1cd9bd,_0x3d2b9e,_0xea7d1,_0x99bef2){var _0x3105ed,_0x58489d,_0x2712bc,_0x302202;_0xea7d1[_0xa845('0x4c')]=intUtil[_0xa845('0x4d')](_0xea7d1[_0xa845('0x4c')]);_0xea7d1[_0xa845('0x65')]=intUtil[_0xa845('0x4d')](_0xea7d1[_0xa845('0x65')]);def[_0xa845('0x4e')]=util[_0xa845('0x21')](_0xa845('0x66'),_0xea7d1[_0xa845('0x4c')]);if(_0x99bef2&&_0x99bef2[_0xa845('0x67')]&&_0x99bef2[_0xa845('0x67')]!==_0xa845('0x68')){logger[_0xa845('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x2c952f['recordingURL']=util['format'](_0xa845('0x69'),_0xea7d1['serverUrl'],_0x2c952f[_0xa845('0x53')],md5(_0x2c952f['uniqueid']));}return getConnection(_0xea7d1)[_0xa845('0x32')](function(_0x5a1514){_0x302202=_0x5a1514;return getUser(_0xea7d1,_0x1cd9bd[_0xa845('0xe')],_0x302202);})['then'](function(_0x2fc9aa){_0x3105ed=_0x2fc9aa;logger['info'](_0xa845('0x54'),_0x3105ed['id']);return getEndUser(_0xea7d1,_0x2c952f[_0xa845('0x6a')],_0x2c952f['destcalleridnum'],_0x302202);})[_0xa845('0x32')](function(_0x57b000){_0x58489d=_0x57b000;logger[_0xa845('0xd')](_0xa845('0x56'),_0x58489d['id']);return getTicket(_0xea7d1,_0x3105ed,_0x58489d,_0x734e4,_0x2c952f,_0x734e4[_0xa845('0x57')],_0x302202,_0xa845('0x6b'));})[_0xa845('0x32')](function(_0x5131b6){_0x2712bc=_0x5131b6;logger[_0xa845('0xd')]('Ticket\x20created!');logger[_0xa845('0xd')](_0xa845('0x6c'),_0x2712bc['id']);return setRelationship(_0x302202,_0x3105ed,_0x2712bc,_0xa845('0x5a'));})[_0xa845('0x32')](function(){return setRelationship(_0x302202,_0x58489d,_0x2712bc,_0xa845('0x5b'));})[_0xa845('0x32')](function(){return getServerInfo(_0x302202);})[_0xa845('0x32')](function(_0x4c1538){var _0x5e7aab=parseInt(_0x4c1538[_0xa845('0x5c')][_0xa845('0x5d')](0x0));var _0x29dca6=util[_0xa845('0x21')](_0xa845('0x5e'),_0xea7d1[_0xa845('0x4c')],_0x2712bc['id']);if(_0x5e7aab>0x6){_0x29dca6=util['format'](_0xa845('0x5f'),_0xea7d1[_0xa845('0x4c')],_0x2712bc['id']);}logger[_0xa845('0xd')](_0xa845('0x6d'),_0xa845('0x6e'));emit(util['format'](_0xa845('0x60'),_0x1cd9bd[_0xa845('0xe')]),_0xa845('0x61'),{'uri':_0x29dca6});})[_0xa845('0x62')](function(_0x5b915b){logger[_0xa845('0x63')](_0xa845('0x6d'),JSON[_0xa845('0x25')](_0x5b915b));});};exports[_0xa845('0x6f')]=function(_0x2a5fa5,_0x448ae8,_0x2a11c4,_0x5898cf,_0x594ffa,_0x3d1c73){var _0xa6ce25,_0x455efd,_0x47441e,_0x27cbff;_0x3d1c73[_0xa845('0x4c')]=intUtil[_0xa845('0x4d')](_0x3d1c73[_0xa845('0x4c')]);_0x3d1c73[_0xa845('0x65')]=intUtil[_0xa845('0x4d')](_0x3d1c73[_0xa845('0x65')]);def[_0xa845('0x4e')]=util[_0xa845('0x21')](_0xa845('0x66'),_0x3d1c73[_0xa845('0x4c')]);if(_0x594ffa&&_0x594ffa[_0xa845('0x4f')]){logger[_0xa845('0xd')]('['+_0x448ae8['lastevent'][_0xa845('0x70')]()+']','Recording\x20is\x20enabled!');_0x448ae8[_0xa845('0x52')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3d1c73['serverUrl'],_0x448ae8[_0xa845('0x53')],md5(_0x448ae8[_0xa845('0x53')]));}else{_0x448ae8[_0xa845('0x52')]='';}return getConnection(_0x3d1c73)[_0xa845('0x32')](function(_0x27493f){_0x27cbff=_0x27493f;if(!_[_0xa845('0x71')](_0x5898cf)){return getUser(_0x3d1c73,_0x5898cf[_0xa845('0xe')],_0x27cbff);}else{return getUser(_0x3d1c73,null,_0x27cbff);}})[_0xa845('0x32')](function(_0x852151){_0xa6ce25=_0x852151;logger[_0xa845('0xd')](_0xa845('0x54'),_0xa6ce25['id']);return getEndUser(_0x3d1c73,_0x448ae8[_0xa845('0x72')],_0x448ae8['calleridnum'],_0x27cbff);})[_0xa845('0x32')](function(_0x2a339f){_0x455efd=_0x2a339f;logger[_0xa845('0xd')]('The\x20Enduser\x20ID\x20is:',_0x455efd['id']);return getTicket(_0x3d1c73,_0xa6ce25,_0x455efd,_0x2a11c4,_0x448ae8,_0x2a11c4[_0xa845('0x57')],_0x27cbff,_0xa845('0x58'));})['then'](function(_0x50a2a0){_0x47441e=_0x50a2a0;logger[_0xa845('0xd')]('Ticket\x20created!');logger[_0xa845('0xd')]('The\x20Ticket\x20ID\x20is:',_0x47441e['id']);return setRelationship(_0x27cbff,_0xa6ce25,_0x47441e,_0xa845('0x5a'));})[_0xa845('0x32')](function(){return setRelationship(_0x27cbff,_0x455efd,_0x47441e,_0xa845('0x5b'));})['then'](function(){return getServerInfo(_0x27cbff);})[_0xa845('0x62')](function(_0x549ae5){logger[_0xa845('0x63')]('['+_0x448ae8['lastevent'][_0xa845('0x70')]()+']',JSON[_0xa845('0x25')](_0x549ae5));});};
\ No newline at end of file
index eeb76c8..6adaa8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xde18=['%s:\x20%s','join','stripTrailingSlash','substring','validateEmail','isNil','test','lodash','util','getString','sortBy','length','push','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','string','key','format','keyContent'];(function(_0x2daf28,_0x4dd7db){var _0xc28f4b=function(_0x339219){while(--_0x339219){_0x2daf28['push'](_0x2daf28['shift']());}};_0xc28f4b(++_0x4dd7db);}(_0xde18,0x14b));var _0x8de1=function(_0x3943dd,_0x46c833){_0x3943dd=_0x3943dd-0x0;var _0x82d299=_0xde18[_0x3943dd];return _0x82d299;};'use strict';var _=require(_0x8de1('0x0'));var util=require(_0x8de1('0x1'));exports[_0x8de1('0x2')]=function(_0x2b418c,_0xff3a15,_0x4f3942){var _0x1c39ac=[];if(_0x2b418c['length']>0x0){var _0x338cca=_[_0x8de1('0x3')](_0x2b418c,['id']);for(var _0x37069f=0x0;_0x37069f<_0x338cca[_0x8de1('0x4')];_0x37069f++){var _0x2c1cf2=_0x338cca[_0x37069f];if(_0x2c1cf2['type']==='string'){_0x1c39ac[_0x8de1('0x5')](_0x2c1cf2['content']);}else if(_0x2c1cf2[_0x8de1('0x6')]===_0x8de1('0x7')&&_0x2c1cf2[_0x8de1('0x8')]){_0xff3a15[_0x2c1cf2[_0x8de1('0x8')]]&&_0x1c39ac['push'](_0xff3a15[_0x2c1cf2['variableName']][_0x8de1('0x9')]());}else if(_0x2c1cf2['type']===_0x8de1('0xa')&&_0x2c1cf2[_0x8de1('0xb')]&&_0x2c1cf2[_0x8de1('0xb')]['name']){_0xff3a15[_0x2c1cf2[_0x8de1('0xb')][_0x8de1('0xc')][_0x8de1('0xd')]()]&&_0x1c39ac[_0x8de1('0x5')](_0xff3a15[_0x2c1cf2[_0x8de1('0xb')]['name']['toLowerCase']()][_0x8de1('0x9')]());}else if(_0x2c1cf2['type']===_0x8de1('0xe')){if(_0x2c1cf2[_0x8de1('0xf')]===_0x8de1('0x10')&&_0x2c1cf2[_0x8de1('0x11')]){_0x1c39ac['push'](util[_0x8de1('0x12')]('%s:\x20%s',_0x2c1cf2[_0x8de1('0x11')],_0x2c1cf2[_0x8de1('0x13')]));}else if(_0x2c1cf2[_0x8de1('0xf')]==='variable'&&_0x2c1cf2[_0x8de1('0x8')]&&_0x2c1cf2[_0x8de1('0x11')]){_0xff3a15[_0x2c1cf2[_0x8de1('0x8')]]&&_0x1c39ac[_0x8de1('0x5')](util[_0x8de1('0x12')](_0x8de1('0x14'),_0x2c1cf2[_0x8de1('0x11')],_0xff3a15[_0x2c1cf2[_0x8de1('0x8')]]));}else if(_0x2c1cf2[_0x8de1('0xf')]===_0x8de1('0xa')&&_0x2c1cf2[_0x8de1('0xb')]&&_0x2c1cf2[_0x8de1('0xb')][_0x8de1('0xc')]&&_0x2c1cf2['key']){_0xff3a15[_0x2c1cf2[_0x8de1('0xb')][_0x8de1('0xc')][_0x8de1('0xd')]()]&&_0x1c39ac[_0x8de1('0x5')](util[_0x8de1('0x12')](_0x8de1('0x14'),_0x2c1cf2[_0x8de1('0x11')],_0xff3a15[_0x2c1cf2[_0x8de1('0xb')][_0x8de1('0xc')][_0x8de1('0xd')]()]));}}}}return _0x1c39ac[_0x8de1('0x15')](_0x4f3942);};exports[_0x8de1('0x16')]=function(_0x3b5c8d){var _0x519ee9=_0x3b5c8d['slice'](-0x1);if(_0x519ee9==='/'){_0x3b5c8d=_0x3b5c8d[_0x8de1('0x17')](0x0,_0x3b5c8d['lastIndexOf'](_0x519ee9));}return _0x3b5c8d;};exports[_0x8de1('0x18')]=function(_0x5de3ac){if(!_[_0x8de1('0x19')](_0x5de3ac)&&_0x5de3ac!==''){var _0x2dad54=/^(([^<>()\[\]\\.,;:\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 _0x2dad54[_0x8de1('0x1a')](String(_0x5de3ac)[_0x8de1('0xd')]());}else{return![];}};
\ No newline at end of file
+var _0x2dba=['util','getString','length','sortBy','string','push','content','variable','variableName','toString','type','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2dba,0x1c1));var _0xa2db=function(_0x37bff9,_0x194334){_0x37bff9=_0x37bff9-0x0;var _0x4c57cc=_0x2dba[_0x37bff9];return _0x4c57cc;};'use strict';var _=require(_0xa2db('0x0'));var util=require(_0xa2db('0x1'));exports[_0xa2db('0x2')]=function(_0x391ffb,_0x251775,_0x52ddec){var _0x4be79e=[];if(_0x391ffb[_0xa2db('0x3')]>0x0){var _0x4723a7=_[_0xa2db('0x4')](_0x391ffb,['id']);for(var _0x3ffa30=0x0;_0x3ffa30<_0x4723a7['length'];_0x3ffa30++){var _0x40cab6=_0x4723a7[_0x3ffa30];if(_0x40cab6['type']===_0xa2db('0x5')){_0x4be79e[_0xa2db('0x6')](_0x40cab6[_0xa2db('0x7')]);}else if(_0x40cab6['type']===_0xa2db('0x8')&&_0x40cab6[_0xa2db('0x9')]){_0x251775[_0x40cab6[_0xa2db('0x9')]]&&_0x4be79e[_0xa2db('0x6')](_0x251775[_0x40cab6[_0xa2db('0x9')]][_0xa2db('0xa')]());}else if(_0x40cab6[_0xa2db('0xb')]===_0xa2db('0xc')&&_0x40cab6['Variable']&&_0x40cab6[_0xa2db('0xd')][_0xa2db('0xe')]){_0x251775[_0x40cab6[_0xa2db('0xd')][_0xa2db('0xe')][_0xa2db('0xf')]()]&&_0x4be79e[_0xa2db('0x6')](_0x251775[_0x40cab6['Variable'][_0xa2db('0xe')][_0xa2db('0xf')]()][_0xa2db('0xa')]());}else if(_0x40cab6['type']===_0xa2db('0x10')){if(_0x40cab6[_0xa2db('0x11')]===_0xa2db('0x5')&&_0x40cab6[_0xa2db('0x12')]){_0x4be79e[_0xa2db('0x6')](util[_0xa2db('0x13')](_0xa2db('0x14'),_0x40cab6[_0xa2db('0x12')],_0x40cab6[_0xa2db('0x15')]));}else if(_0x40cab6['keyType']===_0xa2db('0x8')&&_0x40cab6[_0xa2db('0x9')]&&_0x40cab6['key']){_0x251775[_0x40cab6[_0xa2db('0x9')]]&&_0x4be79e[_0xa2db('0x6')](util[_0xa2db('0x13')]('%s:\x20%s',_0x40cab6[_0xa2db('0x12')],_0x251775[_0x40cab6[_0xa2db('0x9')]]));}else if(_0x40cab6[_0xa2db('0x11')]==='customVariable'&&_0x40cab6[_0xa2db('0xd')]&&_0x40cab6['Variable'][_0xa2db('0xe')]&&_0x40cab6[_0xa2db('0x12')]){_0x251775[_0x40cab6['Variable'][_0xa2db('0xe')]['toLowerCase']()]&&_0x4be79e[_0xa2db('0x6')](util[_0xa2db('0x13')](_0xa2db('0x14'),_0x40cab6[_0xa2db('0x12')],_0x251775[_0x40cab6[_0xa2db('0xd')][_0xa2db('0xe')]['toLowerCase']()]));}}}}return _0x4be79e[_0xa2db('0x16')](_0x52ddec);};exports[_0xa2db('0x17')]=function(_0x3290a8){var _0x3dbf2b=_0x3290a8[_0xa2db('0x18')](-0x1);if(_0x3dbf2b==='/'){_0x3290a8=_0x3290a8[_0xa2db('0x19')](0x0,_0x3290a8[_0xa2db('0x1a')](_0x3dbf2b));}return _0x3290a8;};exports[_0xa2db('0x1b')]=function(_0x242df6){if(!_[_0xa2db('0x1c')](_0x242df6)&&_0x242df6!==''){var _0x2fa9d2=/^(([^<>()\[\]\\.,;:\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 _0x2fa9d2[_0xa2db('0x1d')](String(_0x242df6)[_0xa2db('0xf')]());}else{return![];}};
\ No newline at end of file
index bbcde1a..011bfab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x50ee18,_0x59fa4c){var _0x18c3f3=function(_0x4a84d4){while(--_0x4a84d4){_0x50ee18['push'](_0x50ee18['shift']());}};_0x18c3f3(++_0x59fa4c);}(_0x9c44,0x178));var _0x49c4=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x9c44[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});};
\ No newline at end of file
+var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});};
\ No newline at end of file
index 3bb888b..2733e4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e19=['defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','POST','merge','name','getString','Subjects','Descriptions','Fields','then','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','remoteUri','type:user\x20role:end-user\x20phone:%s','filter','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','end-user','Caller\x20-\x20%s','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','stringify','map','forEach','includes','type','nameField','customField','picklist','custom_fields','push','idField','variable','variableName','customVariable','Variable','toLowerCase','queue','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','stripTrailingSlash','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis'];(function(_0x5ba5c0,_0x28d5f0){var _0x3672ad=function(_0x3657c9){while(--_0x3657c9){_0x5ba5c0['push'](_0x5ba5c0['shift']());}};_0x3672ad(++_0x28d5f0);}(_0x3e19,0xdc));var _0x93e1=function(_0xd206ce,_0x3031d2){_0xd206ce=_0xd206ce-0x0;var _0x5b3ec6=_0x3e19[_0xd206ce];return _0x5b3ec6;};'use strict';var _=require(_0x93e1('0x0'));var rp=require(_0x93e1('0x1'));var md5=require('md5');var util=require(_0x93e1('0x2'));var Redis=require(_0x93e1('0x3'));var intUtil=require(_0x93e1('0x4'));var config=require(_0x93e1('0x5'));var logger=require(_0x93e1('0x6'))('zendesk');config[_0x93e1('0x7')]=_[_0x93e1('0x8')](config['redis'],{'host':_0x93e1('0x9'),'port':0x18eb});var io=require(_0x93e1('0xa'))(new Redis(config[_0x93e1('0x7')]));function emit(_0x123b68,_0x5c3483,_0x2bdd44){io['to'](_0x123b68)[_0x93e1('0xb')](_0x5c3483,_0x2bdd44);}var headers={'Content-Type':_0x93e1('0xc'),'Accept':'application/json'};function getTicket(_0x23ee8c,_0xf69d78,_0xae0941,_0x4333c7,_0x1ac824){logger[_0x93e1('0xd')](_0x93e1('0xe'));return request({'uri':util['format'](_0x93e1('0xf'),_0x23ee8c['remoteUri']),'method':_0x93e1('0x10'),'body':{'ticket':_[_0x93e1('0x11')]({'requester_id':_0xae0941['id'],'submitter_id':_0xf69d78?_0xf69d78['id']:undefined,'assignee_id':_0xf69d78?_0xf69d78['id']:undefined,'tags':getTags(_0x4333c7['Tags'],_0x93e1('0x12')),'subject':intUtil[_0x93e1('0x13')](_0x4333c7[_0x93e1('0x14')],_0x1ac824,'\x20'),'description':intUtil[_0x93e1('0x13')](_0x4333c7[_0x93e1('0x15')],_0x1ac824,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x4333c7['Descriptions'],_0x1ac824,'\x0a')}},getCustomFields(_0x4333c7[_0x93e1('0x16')],_0x1ac824))}})[_0x93e1('0x17')](function(_0x29b96c){logger[_0x93e1('0xd')]('Ticket\x20created!');return _0x29b96c[_0x93e1('0x18')];});}function getUser(_0x341849,_0x47fd64){if(intUtil[_0x93e1('0x19')](_0x47fd64)){logger['info'](_0x93e1('0x1a'),_0x47fd64);return request({'uri':util[_0x93e1('0x1b')](_0x93e1('0x1c'),_0x341849['remoteUri']),'qs':{'query':util[_0x93e1('0x1b')](_0x93e1('0x1d'),_0x47fd64)}})['then'](function(_0x47da5d){if(_0x47da5d[_0x93e1('0x1e')]){logger[_0x93e1('0xd')](_0x93e1('0x1f'));return _[_0x93e1('0x20')](_0x47da5d[_0x93e1('0x21')],{'email':_0x47fd64,'role':_0x93e1('0x22')});}else{logger[_0x93e1('0xd')](_0x93e1('0x23'));return request({'uri':util['format'](_0x93e1('0x24'),_0x341849['remoteUri'])})[_0x93e1('0x17')](function(_0x3ad781){logger[_0x93e1('0xd')](_0x93e1('0x25'));return _0x3ad781[_0x93e1('0x26')];});}});}else{logger[_0x93e1('0xd')](_0x93e1('0x23'));return request({'uri':util[_0x93e1('0x1b')](_0x93e1('0x24'),_0x341849['remoteUri'])})[_0x93e1('0x17')](function(_0x4737c0){logger[_0x93e1('0xd')](_0x93e1('0x25'));return _0x4737c0[_0x93e1('0x26')];});}}function getEndUser(_0x1c9bed,_0x4e981d,_0x5a3739){logger['info'](_0x93e1('0x27'),_0x5a3739);return request({'uri':util['format'](_0x93e1('0x1c'),_0x1c9bed[_0x93e1('0x28')]),'qs':{'query':util[_0x93e1('0x1b')](_0x93e1('0x29'),_0x5a3739)}})[_0x93e1('0x17')](function(_0x46a6df){var _0x23d83d;if(_0x46a6df[_0x93e1('0x21')]['length']){_0x46a6df[_0x93e1('0x21')]=_[_0x93e1('0x2a')](_0x46a6df[_0x93e1('0x21')],{'suspended':![],'role':'end-user'});if(_0x46a6df[_0x93e1('0x21')][_0x93e1('0x2b')]){_0x23d83d=_[_0x93e1('0x2c')](_0x46a6df[_0x93e1('0x21')]);}}if(_0x23d83d){logger[_0x93e1('0xd')](_0x93e1('0x2d'));return _0x23d83d;}else{logger[_0x93e1('0xd')](_0x93e1('0x2e'));return request({'uri':util[_0x93e1('0x1b')]('%s/users.json',_0x1c9bed['remoteUri']),'method':_0x93e1('0x10'),'body':{'user':{'role':_0x93e1('0x2f'),'name':util[_0x93e1('0x1b')](_0x93e1('0x30'),_0x4e981d||_0x5a3739),'phone':_0x5a3739}}})[_0x93e1('0x17')](function(_0x3bc965){logger[_0x93e1('0xd')]('Enduser\x20created.');return _0x3bc965[_0x93e1('0x26')];});}});}function getAuth(_0x31ff13){var _0x30050b;if(_0x31ff13[_0x93e1('0x31')]===_0x93e1('0x32')){_0x30050b=util[_0x93e1('0x1b')](_0x93e1('0x33'),_0x31ff13[_0x93e1('0x34')],_0x31ff13[_0x93e1('0x32')]);}else if(_0x31ff13['authType']===_0x93e1('0x35')){_0x30050b=util[_0x93e1('0x1b')]('%s/token:%s',_0x31ff13[_0x93e1('0x34')],_0x31ff13[_0x93e1('0x35')]);}return util[_0x93e1('0x1b')](_0x93e1('0x36'),new Buffer(_0x30050b)[_0x93e1('0x37')](_0x93e1('0x38')));}function request(_0x9d8d8c){logger['debug']('[HTTP]',JSON[_0x93e1('0x39')](_0x9d8d8c));return rp(_['defaults'](_0x9d8d8c,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x9a492f,_0xe8ae65){var _0x1bdedb=[];if(_0x9a492f&&_0x9a492f[_0x93e1('0x2b')]>0x0){_0x1bdedb=_[_0x93e1('0x3a')](_0x9a492f,_0xe8ae65);}return _0x1bdedb;}function getCustomFields(_0x53c79c,_0x36bf57){var _0x40ab36=[];var _0x101ce0={'custom_fields':[]};if(_0x53c79c[_0x93e1('0x2b')]>0x0){_[_0x93e1('0x3b')](_0x53c79c,function(_0x2d8837){if(_[_0x93e1('0x3c')](['string','picklist'],_0x2d8837[_0x93e1('0x3d')])&&_0x2d8837[_0x93e1('0x3e')]&&!_0x2d8837[_0x93e1('0x3f')]){_0x101ce0[_0x2d8837[_0x93e1('0x3e')]['toLowerCase']()]=_0x2d8837['content'][_0x93e1('0x37')]();}else if(_[_0x93e1('0x3c')](['string',_0x93e1('0x40')],_0x2d8837[_0x93e1('0x3d')])&&_0x2d8837['idField']&&_0x2d8837[_0x93e1('0x3f')]){_0x101ce0[_0x93e1('0x41')][_0x93e1('0x42')]({'id':_0x2d8837[_0x93e1('0x43')],'value':_0x2d8837['content'][_0x93e1('0x37')]()});}else if(_0x2d8837['type']===_0x93e1('0x44')&&_0x2d8837['variableName']&&_0x2d8837[_0x93e1('0x43')]&&_0x2d8837[_0x93e1('0x3f')]){_0x36bf57[_0x2d8837['variableName']]&&_0x101ce0['custom_fields'][_0x93e1('0x42')]({'id':_0x2d8837[_0x93e1('0x43')],'value':_0x36bf57[_0x2d8837[_0x93e1('0x45')]][_0x93e1('0x37')]()});}else if(_0x2d8837['type']===_0x93e1('0x46')&&_0x2d8837[_0x93e1('0x47')]&&_0x2d8837[_0x93e1('0x47')][_0x93e1('0x12')]&&_0x2d8837[_0x93e1('0x43')]&&_0x2d8837[_0x93e1('0x3f')]){_0x36bf57[_0x2d8837[_0x93e1('0x47')]['name'][_0x93e1('0x48')]()]&&_0x101ce0[_0x93e1('0x41')][_0x93e1('0x42')]({'id':_0x2d8837['idField'],'value':_0x36bf57[_0x2d8837[_0x93e1('0x47')][_0x93e1('0x12')][_0x93e1('0x48')]()][_0x93e1('0x37')]()});}});}return _0x101ce0;}exports[_0x93e1('0x49')]=function(_0x43bcb2,_0x2a9ee8,_0x32dd1e,_0x20c90b,_0x539069,_0x5722f2){var _0x436afd,_0x50f84c;_0x5722f2[_0x93e1('0x28')]=intUtil['stripTrailingSlash'](_0x5722f2['remoteUri']);_0x5722f2['serverUrl']=intUtil['stripTrailingSlash'](_0x5722f2[_0x93e1('0x4a')]);if(_0x539069&&_0x539069[_0x93e1('0x4b')]){logger[_0x93e1('0xd')](_0x93e1('0x4c'),_0x93e1('0x4d'));_0x2a9ee8[_0x93e1('0x4e')]=util[_0x93e1('0x1b')](_0x93e1('0x4f'),_0x5722f2['serverUrl'],_0x2a9ee8[_0x93e1('0x50')],md5(_0x2a9ee8[_0x93e1('0x50')]));}else{_0x2a9ee8[_0x93e1('0x4e')]='';}headers[_0x93e1('0x51')]=getAuth(_0x5722f2);return getUser(_0x5722f2,_0x20c90b[_0x93e1('0x52')])[_0x93e1('0x17')](function(_0x2eb182){_0x436afd=_0x2eb182;logger[_0x93e1('0xd')](_0x93e1('0x53'),_0x436afd['id']);return getEndUser(_0x5722f2,_0x2a9ee8[_0x93e1('0x54')],_0x2a9ee8[_0x93e1('0x55')]);})[_0x93e1('0x17')](function(_0x922613){_0x50f84c=_0x922613;logger[_0x93e1('0xd')](_0x93e1('0x56'),_0x50f84c['id']);return getTicket(_0x5722f2,_0x436afd,_0x50f84c,_0x32dd1e,_0x2a9ee8);})[_0x93e1('0x17')](function(_0xfa0856){if(_0xfa0856){logger[_0x93e1('0xd')](_0x93e1('0x57'),_0xfa0856['id']);switch(_0x5722f2[_0x93e1('0x3d')]){case _0x93e1('0x58'):logger[_0x93e1('0xd')](_0x93e1('0x4c'),_0x93e1('0x59'));return request({'uri':util[_0x93e1('0x1b')](_0x93e1('0x5a'),_0x5722f2[_0x93e1('0x28')],_0x436afd['id'],_0xfa0856['id']),'method':'POST'});case _0x93e1('0x5b'):logger['info']('[QUEUE]',_0x93e1('0x5c'));emit(util[_0x93e1('0x1b')](_0x93e1('0x5d'),_0x20c90b[_0x93e1('0x12')]),_0x93e1('0x5e'),{'uri':util[_0x93e1('0x1b')](_0x93e1('0x5f'),_0x5722f2[_0x93e1('0x28')][_0x93e1('0x60')](_0x93e1('0x61'),''),_0xfa0856['id'])});break;default:logger[_0x93e1('0x62')](_0x93e1('0x4c'),_0x93e1('0x63'));}}})['catch'](function(_0x26de2a){logger[_0x93e1('0x62')](_0x93e1('0x64'),util[_0x93e1('0x65')](_0x26de2a,{'showHidden':!![],'depth':null}));});};exports[_0x93e1('0x66')]=function(_0x4c5a21,_0x1f1942,_0x1d1b19,_0x522106,_0x6c552b,_0x1652ae,_0x2bd135){var _0x517ca7,_0xf4e54a;_0x1652ae['remoteUri']=intUtil['stripTrailingSlash'](_0x1652ae[_0x93e1('0x28')]);_0x1652ae[_0x93e1('0x4a')]=intUtil[_0x93e1('0x67')](_0x1652ae[_0x93e1('0x4a')]);if(_0x2bd135&&_0x2bd135[_0x93e1('0x68')]&&_0x2bd135['recordingFormat']!==_0x93e1('0x69')){logger[_0x93e1('0xd')]('[OUTBOUND]',_0x93e1('0x4d'));_0x1f1942['recordingURL']=util['format'](_0x93e1('0x4f'),_0x1652ae[_0x93e1('0x4a')],_0x1f1942['uniqueid'],md5(_0x1f1942[_0x93e1('0x50')]));}headers['Authorization']=getAuth(_0x1652ae);return getUser(_0x1652ae,_0x522106[_0x93e1('0x52')])[_0x93e1('0x17')](function(_0x133e31){_0x517ca7=_0x133e31;logger[_0x93e1('0xd')]('The\x20User\x20ID\x20is:',_0x517ca7['id']);return getEndUser(_0x1652ae,_0x1f1942[_0x93e1('0x6a')],_0x1f1942[_0x93e1('0x6b')]);})['then'](function(_0xd1db28){_0xf4e54a=_0xd1db28;logger[_0x93e1('0xd')](_0x93e1('0x56'),_0xf4e54a['id']);return getTicket(_0x1652ae,_0x517ca7,_0xf4e54a,_0x1d1b19,_0x1f1942);})['then'](function(_0xea3051){if(_0xea3051){logger[_0x93e1('0xd')]('The\x20Ticket\x20ID\x20is:',_0xea3051['id']);switch(_0x1652ae[_0x93e1('0x3d')]){case _0x93e1('0x58'):logger[_0x93e1('0xd')](_0x93e1('0x6c'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x93e1('0x1b')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x1652ae[_0x93e1('0x28')],_0x517ca7['id'],_0xea3051['id']),'method':_0x93e1('0x10')});case _0x93e1('0x5b'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x93e1('0x1b')](_0x93e1('0x5d'),_0x522106[_0x93e1('0x12')]),'trigger:browser:url',{'uri':util[_0x93e1('0x1b')](_0x93e1('0x5f'),_0x1652ae[_0x93e1('0x28')]['replace'](_0x93e1('0x61'),''),_0xea3051['id'])});break;default:logger[_0x93e1('0x62')](_0x93e1('0x6c'),_0x93e1('0x63'));}}})[_0x93e1('0x6d')](function(_0x5946d7){logger[_0x93e1('0x62')](_0x93e1('0x6e'),util[_0x93e1('0x65')](_0x5946d7,{'showHidden':!![],'depth':null}));});};exports[_0x93e1('0x6f')]=function(_0x34880,_0x4edb95,_0x2a2506,_0x38ea91,_0x542f3e,_0xf1a150){var _0x5c5f13,_0x380cda;_0xf1a150['remoteUri']=intUtil[_0x93e1('0x67')](_0xf1a150[_0x93e1('0x28')]);_0xf1a150[_0x93e1('0x4a')]=intUtil[_0x93e1('0x67')](_0xf1a150[_0x93e1('0x4a')]);if(_0x542f3e&&_0x542f3e['monitor_format']){logger[_0x93e1('0xd')]('['+_0x4edb95[_0x93e1('0x70')][_0x93e1('0x71')]()+']','Recording\x20is\x20enabled!');_0x4edb95[_0x93e1('0x4e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xf1a150[_0x93e1('0x4a')],_0x4edb95[_0x93e1('0x50')],md5(_0x4edb95[_0x93e1('0x50')]));}else{_0x4edb95[_0x93e1('0x4e')]='';}headers[_0x93e1('0x51')]=getAuth(_0xf1a150);return getUser(_0xf1a150)['then'](function(_0x141ea8){_0x5c5f13=_0x141ea8;logger[_0x93e1('0xd')](_0x93e1('0x53'),_0x5c5f13['id']);return getEndUser(_0xf1a150,_0x4edb95[_0x93e1('0x54')],_0x4edb95[_0x93e1('0x55')]);})['then'](function(_0x13a817){_0x380cda=_0x13a817;logger[_0x93e1('0xd')](_0x93e1('0x56'),_0x380cda['id']);return getTicket(_0xf1a150,_0x5c5f13,_0x380cda,_0x2a2506,_0x4edb95);})[_0x93e1('0x17')](function(_0x44c34e){if(_0x44c34e){logger[_0x93e1('0xd')](_0x93e1('0x57'),_0x44c34e['id']);}})['catch'](function(_0xf9bab6){logger['error']('['+_0x4edb95['lastevent']['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x93e1('0x65')](_0xf9bab6,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x22da=['The\x20Ticket\x20ID\x20is:','integrationTab','%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','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','user:%s','unmanaged','monitor_format','Authorization','catch','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','./util','../../../../config/environment','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','remoteUri','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','%s/search.json','type:user\x20role:end-user\x20phone:%s','results','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','debug','[HTTP]','stringify','GET','forEach','includes','string','type','nameField','customField','content','picklist','idField','custom_fields','variable','variableName','push','Variable','name','toLowerCase','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum'];(function(_0x56a259,_0x3e631e){var _0x4fb824=function(_0x2d11be){while(--_0x2d11be){_0x56a259['push'](_0x56a259['shift']());}};_0x4fb824(++_0x3e631e);}(_0x22da,0x8d));var _0xa22d=function(_0x2e66d8,_0x6343d2){_0x2e66d8=_0x2e66d8-0x0;var _0x33d413=_0x22da[_0x2e66d8];return _0x33d413;};'use strict';var _=require(_0xa22d('0x0'));var rp=require(_0xa22d('0x1'));var md5=require(_0xa22d('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa22d('0x3'));var config=require(_0xa22d('0x4'));var logger=require('../../../../config/logger')(_0xa22d('0x5'));config[_0xa22d('0x6')]=_[_0xa22d('0x7')](config['redis'],{'host':_0xa22d('0x8'),'port':0x18eb});var io=require(_0xa22d('0x9'))(new Redis(config[_0xa22d('0x6')]));function emit(_0x591fa6,_0x248a7b,_0x4e61b4){io['to'](_0x591fa6)[_0xa22d('0xa')](_0x248a7b,_0x4e61b4);}var headers={'Content-Type':'application/json','Accept':_0xa22d('0xb')};function getTicket(_0x351424,_0x298d29,_0x5095ec,_0x19f6d0,_0x5cb49d){logger[_0xa22d('0xc')](_0xa22d('0xd'));return request({'uri':util[_0xa22d('0xe')](_0xa22d('0xf'),_0x351424['remoteUri']),'method':_0xa22d('0x10'),'body':{'ticket':_[_0xa22d('0x11')]({'requester_id':_0x5095ec['id'],'submitter_id':_0x298d29?_0x298d29['id']:undefined,'assignee_id':_0x298d29?_0x298d29['id']:undefined,'tags':getTags(_0x19f6d0[_0xa22d('0x12')],'name'),'subject':intUtil[_0xa22d('0x13')](_0x19f6d0['Subjects'],_0x5cb49d,'\x20'),'description':intUtil['getString'](_0x19f6d0[_0xa22d('0x14')],_0x5cb49d,'\x0a'),'comment':{'public':![],'body':intUtil[_0xa22d('0x13')](_0x19f6d0[_0xa22d('0x14')],_0x5cb49d,'\x0a')}},getCustomFields(_0x19f6d0[_0xa22d('0x15')],_0x5cb49d))}})[_0xa22d('0x16')](function(_0x350a0e){logger[_0xa22d('0xc')](_0xa22d('0x17'));return _0x350a0e[_0xa22d('0x18')];});}function getUser(_0x4d9724,_0x243388){if(intUtil['validateEmail'](_0x243388)){logger[_0xa22d('0xc')]('Getting\x20agent\x20with\x20email',_0x243388);return request({'uri':util[_0xa22d('0xe')]('%s/search.json',_0x4d9724[_0xa22d('0x19')]),'qs':{'query':util['format'](_0xa22d('0x1a'),_0x243388)}})[_0xa22d('0x16')](function(_0x54dc89){if(_0x54dc89[_0xa22d('0x1b')]){logger[_0xa22d('0xc')](_0xa22d('0x1c'));return _[_0xa22d('0x1d')](_0x54dc89['results'],{'email':_0x243388,'role':_0xa22d('0x1e')});}else{logger[_0xa22d('0xc')](_0xa22d('0x1f'));return request({'uri':util[_0xa22d('0xe')](_0xa22d('0x20'),_0x4d9724[_0xa22d('0x19')])})[_0xa22d('0x16')](function(_0x5c0d52){logger[_0xa22d('0xc')](_0xa22d('0x21'));return _0x5c0d52['user'];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format']('%s/users/me.json',_0x4d9724[_0xa22d('0x19')])})['then'](function(_0x276b35){logger[_0xa22d('0xc')](_0xa22d('0x21'));return _0x276b35['user'];});}}function getEndUser(_0x427c2b,_0x3d57e8,_0x547f56){logger[_0xa22d('0xc')]('Searching\x20enduser\x20with\x20phone',_0x547f56);return request({'uri':util[_0xa22d('0xe')](_0xa22d('0x22'),_0x427c2b[_0xa22d('0x19')]),'qs':{'query':util[_0xa22d('0xe')](_0xa22d('0x23'),_0x547f56)}})['then'](function(_0x58face){var _0x2a9223;if(_0x58face[_0xa22d('0x24')][_0xa22d('0x25')]){_0x58face['results']=_[_0xa22d('0x26')](_0x58face[_0xa22d('0x24')],{'suspended':![],'role':_0xa22d('0x27')});if(_0x58face[_0xa22d('0x24')]['length']){_0x2a9223=_[_0xa22d('0x28')](_0x58face[_0xa22d('0x24')]);}}if(_0x2a9223){logger[_0xa22d('0xc')](_0xa22d('0x29'));return _0x2a9223;}else{logger[_0xa22d('0xc')](_0xa22d('0x2a'));return request({'uri':util[_0xa22d('0xe')](_0xa22d('0x2b'),_0x427c2b[_0xa22d('0x19')]),'method':_0xa22d('0x10'),'body':{'user':{'role':_0xa22d('0x27'),'name':util['format']('Caller\x20-\x20%s',_0x3d57e8||_0x547f56),'phone':_0x547f56}}})[_0xa22d('0x16')](function(_0x294f01){logger[_0xa22d('0xc')]('Enduser\x20created.');return _0x294f01['user'];});}});}function getAuth(_0x58d774){var _0x42ee3d;if(_0x58d774[_0xa22d('0x2c')]===_0xa22d('0x2d')){_0x42ee3d=util[_0xa22d('0xe')]('%s:%s',_0x58d774[_0xa22d('0x2e')],_0x58d774[_0xa22d('0x2d')]);}else if(_0x58d774[_0xa22d('0x2c')]===_0xa22d('0x2f')){_0x42ee3d=util['format'](_0xa22d('0x30'),_0x58d774['username'],_0x58d774['token']);}return util[_0xa22d('0xe')](_0xa22d('0x31'),new Buffer(_0x42ee3d)[_0xa22d('0x32')]('base64'));}function request(_0x4c2ac5){logger[_0xa22d('0x33')](_0xa22d('0x34'),JSON[_0xa22d('0x35')](_0x4c2ac5));return rp(_[_0xa22d('0x7')](_0x4c2ac5,{'method':_0xa22d('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x1ef5b9,_0xa87cb7){var _0x15fdae=[];if(_0x1ef5b9&&_0x1ef5b9[_0xa22d('0x25')]>0x0){_0x15fdae=_['map'](_0x1ef5b9,_0xa87cb7);}return _0x15fdae;}function getCustomFields(_0x332183,_0x52cd7e){var _0x3ee93f=[];var _0x5d1e8d={'custom_fields':[]};if(_0x332183[_0xa22d('0x25')]>0x0){_[_0xa22d('0x37')](_0x332183,function(_0x5584b5){if(_[_0xa22d('0x38')]([_0xa22d('0x39'),'picklist'],_0x5584b5[_0xa22d('0x3a')])&&_0x5584b5[_0xa22d('0x3b')]&&!_0x5584b5[_0xa22d('0x3c')]){_0x5d1e8d[_0x5584b5[_0xa22d('0x3b')]['toLowerCase']()]=_0x5584b5[_0xa22d('0x3d')][_0xa22d('0x32')]();}else if(_[_0xa22d('0x38')]([_0xa22d('0x39'),_0xa22d('0x3e')],_0x5584b5[_0xa22d('0x3a')])&&_0x5584b5[_0xa22d('0x3f')]&&_0x5584b5[_0xa22d('0x3c')]){_0x5d1e8d[_0xa22d('0x40')]['push']({'id':_0x5584b5[_0xa22d('0x3f')],'value':_0x5584b5[_0xa22d('0x3d')][_0xa22d('0x32')]()});}else if(_0x5584b5[_0xa22d('0x3a')]===_0xa22d('0x41')&&_0x5584b5[_0xa22d('0x42')]&&_0x5584b5[_0xa22d('0x3f')]&&_0x5584b5[_0xa22d('0x3c')]){_0x52cd7e[_0x5584b5['variableName']]&&_0x5d1e8d[_0xa22d('0x40')][_0xa22d('0x43')]({'id':_0x5584b5[_0xa22d('0x3f')],'value':_0x52cd7e[_0x5584b5[_0xa22d('0x42')]][_0xa22d('0x32')]()});}else if(_0x5584b5[_0xa22d('0x3a')]==='customVariable'&&_0x5584b5[_0xa22d('0x44')]&&_0x5584b5['Variable'][_0xa22d('0x45')]&&_0x5584b5[_0xa22d('0x3f')]&&_0x5584b5[_0xa22d('0x3c')]){_0x52cd7e[_0x5584b5[_0xa22d('0x44')]['name'][_0xa22d('0x46')]()]&&_0x5d1e8d[_0xa22d('0x40')][_0xa22d('0x43')]({'id':_0x5584b5[_0xa22d('0x3f')],'value':_0x52cd7e[_0x5584b5[_0xa22d('0x44')][_0xa22d('0x45')][_0xa22d('0x46')]()][_0xa22d('0x32')]()});}});}return _0x5d1e8d;}exports[_0xa22d('0x47')]=function(_0x35eadd,_0x348512,_0x25a024,_0x34f550,_0x279032,_0x56d39d){var _0x1f7421,_0x15df93;_0x56d39d[_0xa22d('0x19')]=intUtil['stripTrailingSlash'](_0x56d39d[_0xa22d('0x19')]);_0x56d39d[_0xa22d('0x48')]=intUtil[_0xa22d('0x49')](_0x56d39d['serverUrl']);if(_0x279032&&_0x279032['monitor_format']){logger[_0xa22d('0xc')](_0xa22d('0x4a'),_0xa22d('0x4b'));_0x348512[_0xa22d('0x4c')]=util[_0xa22d('0xe')](_0xa22d('0x4d'),_0x56d39d['serverUrl'],_0x348512[_0xa22d('0x4e')],md5(_0x348512[_0xa22d('0x4e')]));}else{_0x348512['recordingURL']='';}headers['Authorization']=getAuth(_0x56d39d);return getUser(_0x56d39d,_0x34f550[_0xa22d('0x4f')])[_0xa22d('0x16')](function(_0x401504){_0x1f7421=_0x401504;logger[_0xa22d('0xc')](_0xa22d('0x50'),_0x1f7421['id']);return getEndUser(_0x56d39d,_0x348512[_0xa22d('0x51')],_0x348512[_0xa22d('0x52')]);})[_0xa22d('0x16')](function(_0x5480b1){_0x15df93=_0x5480b1;logger[_0xa22d('0xc')]('The\x20Enduser\x20ID\x20is:',_0x15df93['id']);return getTicket(_0x56d39d,_0x1f7421,_0x15df93,_0x25a024,_0x348512);})[_0xa22d('0x16')](function(_0x3810d4){if(_0x3810d4){logger[_0xa22d('0xc')](_0xa22d('0x53'),_0x3810d4['id']);switch(_0x56d39d[_0xa22d('0x3a')]){case _0xa22d('0x54'):logger['info'](_0xa22d('0x4a'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xa22d('0xe')](_0xa22d('0x55'),_0x56d39d[_0xa22d('0x19')],_0x1f7421['id'],_0x3810d4['id']),'method':'POST'});case _0xa22d('0x56'):logger['info']('[QUEUE]',_0xa22d('0x57'));emit(util['format']('user:%s',_0x34f550[_0xa22d('0x45')]),_0xa22d('0x58'),{'uri':util[_0xa22d('0xe')](_0xa22d('0x59'),_0x56d39d[_0xa22d('0x19')][_0xa22d('0x5a')](_0xa22d('0x5b'),''),_0x3810d4['id'])});break;default:logger[_0xa22d('0x5c')]('[QUEUE]',_0xa22d('0x5d'));}}})['catch'](function(_0x4c80c6){logger['error'](_0xa22d('0x5e'),util[_0xa22d('0x5f')](_0x4c80c6,{'showHidden':!![],'depth':null}));});};exports[_0xa22d('0x60')]=function(_0x21380b,_0x383898,_0x5e1ab2,_0x1cf0f3,_0x237287,_0x4afadb,_0x118a44){var _0xb010f4,_0x54558a;_0x4afadb[_0xa22d('0x19')]=intUtil[_0xa22d('0x49')](_0x4afadb[_0xa22d('0x19')]);_0x4afadb[_0xa22d('0x48')]=intUtil[_0xa22d('0x49')](_0x4afadb[_0xa22d('0x48')]);if(_0x118a44&&_0x118a44['recordingFormat']&&_0x118a44[_0xa22d('0x61')]!==_0xa22d('0x62')){logger['info'](_0xa22d('0x63'),_0xa22d('0x4b'));_0x383898[_0xa22d('0x4c')]=util[_0xa22d('0xe')](_0xa22d('0x4d'),_0x4afadb['serverUrl'],_0x383898[_0xa22d('0x4e')],md5(_0x383898[_0xa22d('0x4e')]));}headers['Authorization']=getAuth(_0x4afadb);return getUser(_0x4afadb,_0x1cf0f3['email'])['then'](function(_0x2b9730){_0xb010f4=_0x2b9730;logger['info'](_0xa22d('0x50'),_0xb010f4['id']);return getEndUser(_0x4afadb,_0x383898[_0xa22d('0x64')],_0x383898[_0xa22d('0x65')]);})[_0xa22d('0x16')](function(_0x36e663){_0x54558a=_0x36e663;logger[_0xa22d('0xc')](_0xa22d('0x66'),_0x54558a['id']);return getTicket(_0x4afadb,_0xb010f4,_0x54558a,_0x5e1ab2,_0x383898);})[_0xa22d('0x16')](function(_0x5333b8){if(_0x5333b8){logger[_0xa22d('0xc')](_0xa22d('0x53'),_0x5333b8['id']);switch(_0x4afadb['type']){case _0xa22d('0x54'):logger['info'](_0xa22d('0x63'),_0xa22d('0x67'));return request({'uri':util[_0xa22d('0xe')](_0xa22d('0x55'),_0x4afadb['remoteUri'],_0xb010f4['id'],_0x5333b8['id']),'method':_0xa22d('0x10')});case'newTab':logger[_0xa22d('0xc')](_0xa22d('0x63'),_0xa22d('0x57'));emit(util[_0xa22d('0xe')](_0xa22d('0x68'),_0x1cf0f3[_0xa22d('0x45')]),_0xa22d('0x58'),{'uri':util[_0xa22d('0xe')](_0xa22d('0x59'),_0x4afadb[_0xa22d('0x19')][_0xa22d('0x5a')](_0xa22d('0x5b'),''),_0x5333b8['id'])});break;default:logger[_0xa22d('0x5c')]('[OUTBOUND]',_0xa22d('0x5d'));}}})['catch'](function(_0x5bce14){logger[_0xa22d('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xa22d('0x5f')](_0x5bce14,{'showHidden':!![],'depth':null}));});};exports[_0xa22d('0x69')]=function(_0x5d61c0,_0xbd0f16,_0x3e0b94,_0x5d452e,_0x18a3c3,_0x1c888d){var _0x3f056f,_0x494928;_0x1c888d[_0xa22d('0x19')]=intUtil[_0xa22d('0x49')](_0x1c888d[_0xa22d('0x19')]);_0x1c888d['serverUrl']=intUtil[_0xa22d('0x49')](_0x1c888d[_0xa22d('0x48')]);if(_0x18a3c3&&_0x18a3c3[_0xa22d('0x6a')]){logger[_0xa22d('0xc')]('['+_0xbd0f16['lastevent']['toUpperCase']()+']',_0xa22d('0x4b'));_0xbd0f16[_0xa22d('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1c888d[_0xa22d('0x48')],_0xbd0f16[_0xa22d('0x4e')],md5(_0xbd0f16[_0xa22d('0x4e')]));}else{_0xbd0f16[_0xa22d('0x4c')]='';}headers[_0xa22d('0x6b')]=getAuth(_0x1c888d);return getUser(_0x1c888d)[_0xa22d('0x16')](function(_0x114337){_0x3f056f=_0x114337;logger[_0xa22d('0xc')](_0xa22d('0x50'),_0x3f056f['id']);return getEndUser(_0x1c888d,_0xbd0f16[_0xa22d('0x51')],_0xbd0f16['calleridnum']);})[_0xa22d('0x16')](function(_0x2d4238){_0x494928=_0x2d4238;logger[_0xa22d('0xc')]('The\x20Enduser\x20ID\x20is:',_0x494928['id']);return getTicket(_0x1c888d,_0x3f056f,_0x494928,_0x3e0b94,_0xbd0f16);})[_0xa22d('0x16')](function(_0x105195){if(_0x105195){logger[_0xa22d('0xc')](_0xa22d('0x53'),_0x105195['id']);}})[_0xa22d('0x6c')](function(_0x430806){logger[_0xa22d('0x5c')]('['+_0xbd0f16[_0xa22d('0x6d')][_0xa22d('0x6e')]()+']'+_0xa22d('0x6f'),util[_0xa22d('0x5f')](_0x430806,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 7306d2a..e7e7c28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08b8=['/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','enduserType','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','https://www.zohoapis.','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','Leads','Owner','getString','Subjects','Descriptions','Who_Id','First_Name','Last_Name','What_Id','Full_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','starttime','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','details','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','email','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','Outbound','[OUTBOUND]','https://crm.','unmanaged','lastevent','toUpperCase','lodash','request-promise','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','socket.io-emitter','emit','[HTTP]','length','string','type','idField','content','toString','variable','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','POST','refreshToken','clientId','clientSecret','refresh_token','then','catch','error','Failing\x20creating\x20the\x20access_token','stack','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','info','Agent\x20found!','findIndex','profile','Administrator','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x08b8,0xf0));var _0x808b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08b8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x808b('0x0'));var rp=require(_0x808b('0x1'));var md5=require('md5');var util=require(_0x808b('0x2'));var intUtil=require(_0x808b('0x3'));var moment=require(_0x808b('0x4'));var Redis=require(_0x808b('0x5'));var BPromise=require(_0x808b('0x6'));var config=require(_0x808b('0x7'));var logger=require(_0x808b('0x8'))(_0x808b('0x9'));config['redis']=_[_0x808b('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x808b('0xb'))(new Redis(config['redis']));function emit(_0x569296,_0x57b562,_0x2c5deb){io['to'](_0x569296)[_0x808b('0xc')](_0x57b562,_0x2c5deb);}function request(_0x4d2a97){logger['debug'](_0x808b('0xd'),JSON['stringify'](_0x4d2a97));return rp(_0x4d2a97);}function getCustomFields(_0x383b7b,_0x17c735){var _0x1148f3={};if(_0x383b7b[_0x808b('0xe')]>0x0){_['forEach'](_0x383b7b,function(_0x862648){if(_['includes']([_0x808b('0xf'),'picklist'],_0x862648[_0x808b('0x10')])&&_0x862648[_0x808b('0x11')]){_0x1148f3[_0x862648[_0x808b('0x11')]]=_0x862648[_0x808b('0x12')][_0x808b('0x13')]();}else if(_0x862648['type']===_0x808b('0x14')&&_0x862648[_0x808b('0x15')]&&_0x862648['idField']&&_0x17c735[_0x862648[_0x808b('0x15')]]){_0x1148f3[_0x862648[_0x808b('0x11')]]=_0x17c735[_0x862648[_0x808b('0x15')]]['toString']();}else if(_0x862648[_0x808b('0x10')]==='customVariable'&&_0x862648[_0x808b('0x16')]&&_0x862648[_0x808b('0x16')][_0x808b('0x17')]&&_0x862648[_0x808b('0x11')]&&_0x17c735[_0x862648[_0x808b('0x16')][_0x808b('0x17')][_0x808b('0x18')]()]){_0x1148f3[_0x862648[_0x808b('0x11')]]=_0x17c735[_0x862648[_0x808b('0x16')][_0x808b('0x17')][_0x808b('0x18')]()][_0x808b('0x13')]();}});}return _0x1148f3;}function getName(_0x2478a8){if(_0x2478a8[_0x808b('0x19')]('\x20')>0x0){var _0x5e92f6=_0x2478a8[_0x808b('0x1a')](/ (.+)/);if(_0x5e92f6[0x1]){return _0x5e92f6;}}return[_0x2478a8,_0x2478a8];}var accountsTokens={};function getAccessToken(_0x362c96){return new Promise(function(_0x4f5047,_0x149e8e){if(!_[_0x808b('0x1b')](accountsTokens[_0x362c96['id']])&&!_[_0x808b('0x1b')](accountsTokens[_0x362c96['id']][_0x808b('0x1c')])){if(moment()[_0x808b('0x1d')](accountsTokens[_0x362c96['id']][_0x808b('0x1e')])){_0x4f5047(accountsTokens[_0x362c96['id']][_0x808b('0x1c')]);}}var _0x3cd937;switch(_0x362c96[_0x808b('0x1f')]){case'US':_0x3cd937=_0x808b('0x20');break;case'AU':_0x3cd937='https://accounts.zoho.com.au';break;case'EU':_0x3cd937=_0x808b('0x21');break;case'IN':_0x3cd937=_0x808b('0x22');break;case'CN':_0x3cd937='https://accounts.zoho.com.cn';break;default:_0x3cd937=_0x808b('0x21');break;}var _0x424712={'method':_0x808b('0x23'),'uri':_0x3cd937+'/oauth/v2/token','qs':{'refresh_token':_0x362c96[_0x808b('0x24')],'client_id':_0x362c96[_0x808b('0x25')],'client_secret':_0x362c96[_0x808b('0x26')],'grant_type':_0x808b('0x27')},'json':!![]};return rp(_0x424712)[_0x808b('0x28')](function(_0x561627){accountsTokens[_0x362c96['id']]={'access_token':_0x561627[_0x808b('0x1c')],'expires_in':moment()['add'](_0x561627[_0x808b('0x1e')],'seconds')};_0x4f5047(_0x561627[_0x808b('0x1c')]);})[_0x808b('0x29')](function(_0x2e216a){logger[_0x808b('0x2a')](_0x808b('0x2b'),_0x2e216a[_0x808b('0x2c')]);_0x149e8e(_0x2e216a);});});}function getUser(_0x1e61c5,_0xbe77b1,_0x124af4,_0x4696ae){logger['info']('Search\x20user');return request({'method':'GET','uri':util[_0x808b('0x2d')](_0x808b('0x2e'),_0xbe77b1),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x808b('0x2f')+_0x1e61c5},'json':!![]})[_0x808b('0x28')](function(_0x1f56ad){if(_0x1f56ad[_0x808b('0x30')]){var _0xb074=-0x1;if(_[_0x808b('0x31')](_0x1f56ad[_0x808b('0x30')])){if(!_[_0x808b('0x1b')](_0x4696ae)){_0xb074=_['findIndex'](_0x1f56ad[_0x808b('0x30')],function(_0xb95739){return _0xb95739['email']===_0x4696ae;});}if(_0xb074>=0x0){logger[_0x808b('0x32')](_0x808b('0x33'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0xb074=_[_0x808b('0x34')](_0x1f56ad[_0x808b('0x30')],function(_0x175e64){return _0x175e64[_0x808b('0x35')]['name']===_0x808b('0x36');});}return _0x1f56ad['users'][_0xb074];}else{if(_0x1f56ad['user'][_0x808b('0x35')]['name']===_0x808b('0x36')){logger['info'](_0x808b('0x37'));user=_0x1f56ad['user'];return user;}else{logger[_0x808b('0x2a')](_0x808b('0x38'),JSON['stringify'](_0x1f56ad));throw new Error(_0x808b('0x39')+JSON[_0x808b('0x3a')](_0x1f56ad));}}}else{logger['error'](_0x808b('0x38'),JSON[_0x808b('0x3a')](_0x1f56ad));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x1f56ad));}})['catch'](function(_0x2e8528){console[_0x808b('0x2a')](_0x2e8528);});}function getZohoUser(_0x51cf8c,_0x3e496b){return new BPromise(function(_0x1f58b0,_0x27c53a){request(_0x51cf8c)[_0x808b('0x28')](function(_0x18e579){var _0x186991=null;if(_0x18e579){_0x186991=_0x18e579[_0x808b('0x3b')][0x0];_0x186991['enduserType']=_0x3e496b;}_0x1f58b0(_0x186991);})['catch'](function(_0x3caeb9){_0x27c53a(_0x3caeb9);});});}function createEndUser(_0x2463f6,_0x55c95c,_0x50ac1f,_0x2b7660,_0x499bdf,_0x541f14){var _0x50ac1f=getName(_0x50ac1f);return request({'method':_0x808b('0x23'),'uri':'https://www.zohoapis.'+_0x55c95c+_0x808b('0x3c')+_[_0x808b('0x3d')](_0x541f14[_0x808b('0x3e')])+'s','body':{'data':[{'Last_Name':_0x50ac1f[0x1],'First_Name':_0x50ac1f[0x0],'Phone':_0x2b7660,'Owner':{'name':!_[_0x808b('0x1b')](_0x499bdf[_0x808b('0x3f')]['name'])?_0x499bdf[_0x808b('0x3f')][_0x808b('0x17')]:!_[_0x808b('0x1b')](_0x499bdf[_0x808b('0x40')])?_0x499bdf[_0x808b('0x40')]+'\x20'+_0x499bdf[_0x808b('0x41')]:_0x499bdf[_0x808b('0x41')],'id':_0x499bdf['id']}}]},'headers':{'Authorization':_0x808b('0x2f')+_0x2463f6},'json':!![]})[_0x808b('0x28')](function(_0x268e4e){if(_0x268e4e&&_0x268e4e[_0x808b('0x3b')][0x0][_0x808b('0x42')]===_0x808b('0x43')){var _0x11f490=_0x268e4e[_0x808b('0x3b')][0x0]['details'];_0x11f490[_0x808b('0x44')]=_[_0x808b('0x3d')](_0x541f14['moduleCreate'])+'s';return _0x11f490;}logger[_0x808b('0x2a')](_0x808b('0x38'),JSON['stringify'](data));throw new Error(_0x808b('0x45')+JSON[_0x808b('0x3a')](data));})[_0x808b('0x29')](function(_0x4e3580){console[_0x808b('0x46')](_0x808b('0x47'),_0x4e3580);});}function getEndUser(_0x32df31,_0x34d3d9,_0x25f556,_0x38765d,_0x179caf,_0x123d1b,_0x43cbc3){var _0x188a00={'method':'GET','uri':'','headers':{'Authorization':_0x808b('0x2f')+_0x32df31},'json':!![]};switch(_0x43cbc3[_0x808b('0x48')]){case _0x808b('0x49'):_0x188a00[_0x808b('0x4a')]=_0x808b('0x4b')+_0x34d3d9+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x179caf+'))';return getZohoUser(_0x188a00,_0x808b('0x4c'))['then'](function(_0x2d0bc5){if(_0x2d0bc5)return _0x2d0bc5;_0x188a00[_0x808b('0x4a')]=_0x808b('0x4b')+_0x34d3d9+_0x808b('0x4d')+_0x179caf+'))';return getZohoUser(_0x188a00,'Leads')[_0x808b('0x28')](function(_0xa55efd){if(_0xa55efd)return _0xa55efd;if(_0x43cbc3['moduleCreate']!=_0x808b('0x4e')){return createEndUser(_0x32df31,_0x34d3d9,_0x38765d,_0x179caf,_0x123d1b,_0x43cbc3);}else{return{};}});});break;case _0x808b('0x4f'):_0x188a00[_0x808b('0x4a')]=_0x808b('0x4b')+_0x34d3d9+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x179caf+'))';return getZohoUser(_0x188a00,'Contacts')[_0x808b('0x28')](function(_0x36a4ed){if(_0x36a4ed)return _0x36a4ed;if(_0x43cbc3[_0x808b('0x3e')]!=_0x808b('0x4e')){return createEndUser(_0x32df31,_0x34d3d9,_0x38765d,_0x179caf,_0x123d1b,_0x43cbc3);}else{return{};}});break;case _0x808b('0x50'):_0x188a00[_0x808b('0x4a')]='https://www.zohoapis.'+_0x34d3d9+_0x808b('0x4d')+_0x179caf+'))';return getZohoUser(_0x188a00,_0x808b('0x51'))[_0x808b('0x28')](function(_0x19b09a){if(_0x19b09a)return _0x19b09a;if(_0x43cbc3[_0x808b('0x3e')]!=_0x808b('0x4e')){return createEndUser(_0x32df31,_0x34d3d9,_0x38765d,_0x179caf,_0x123d1b,_0x43cbc3);}else{return{};}});break;}}function getCall(_0x4f898f,_0x151eb8,_0x40c486,_0x24beee,_0x3177f7,_0x38ddb6,_0x340f83,_0x38614f){logger[_0x808b('0x32')]('Creating\x20new\x20call...');var _0x5b7de9={};_0x5b7de9[_0x808b('0x52')]={'name':!_[_0x808b('0x1b')](_0x24beee[_0x808b('0x3f')][_0x808b('0x17')])&&!_['isNil'](_0x24beee['profile'][_0x808b('0x17')])&&_0x24beee[_0x808b('0x35')][_0x808b('0x17')]==='administrator'?_0x24beee[_0x808b('0x3f')][_0x808b('0x17')]:!_[_0x808b('0x1b')](_0x24beee[_0x808b('0x40')])?_0x24beee[_0x808b('0x40')]+'\x20'+_0x24beee[_0x808b('0x41')]:_0x24beee[_0x808b('0x41')],'id':_0x24beee['id']};_0x5b7de9['Subject']=intUtil[_0x808b('0x53')](_0x38ddb6[_0x808b('0x54')],_0x340f83,'\x20');_0x5b7de9['Description']=intUtil[_0x808b('0x53')](_0x38ddb6[_0x808b('0x55')],_0x340f83,'\x0a');if(_0x3177f7['enduserType']===_0x808b('0x4c')){_0x5b7de9[_0x808b('0x56')]={'name':!_['isNil'](_0x3177f7['Full_Name'])?_0x3177f7['Full_Name']:!_[_0x808b('0x1b')](_0x3177f7[_0x808b('0x57')])?_0x3177f7[_0x808b('0x57')]+'\x20'+_0x3177f7[_0x808b('0x58')]:_0x3177f7['Last_Name'],'id':_0x3177f7['id']};}if(_0x3177f7[_0x808b('0x44')]===_0x808b('0x51')){_0x5b7de9[_0x808b('0x59')]={'name':!_[_0x808b('0x1b')](_0x3177f7[_0x808b('0x5a')])?_0x3177f7[_0x808b('0x5a')]:!_['isNil'](_0x3177f7['First_Name'])?_0x3177f7[_0x808b('0x57')]+'\x20'+_0x3177f7['Last_Name']:_0x3177f7[_0x808b('0x58')],'id':_0x3177f7['id']};_0x5b7de9[_0x808b('0x5b')]=_[_0x808b('0x3d')](_0x3177f7[_0x808b('0x44')]);}if(_0x340f83[_0x808b('0x5c')]){_0x5b7de9[_0x808b('0x5d')]=moment[_0x808b('0x5e')](parseInt(_0x340f83[_0x808b('0x5c')])*0x3e8)['format'](_0x808b('0x5f'));}else if(_0x340f83[_0x808b('0x60')]&&_0x340f83[_0x808b('0x61')]){_0x5b7de9[_0x808b('0x5d')]=moment[_0x808b('0x5e')](moment(_0x340f83['endtime'],_0x808b('0x62'))['diff'](moment(_0x340f83['starttime'],_0x808b('0x62'))))['format']('mm:ss');}switch(_0x340f83['lastevent']){case _0x808b('0x63'):_0x5b7de9[_0x808b('0x64')]='Called';break;case'complete':case'connect':_0x5b7de9[_0x808b('0x64')]=_0x808b('0x65');break;case _0x808b('0x66'):_0x5b7de9['Call_Result']=_0x808b('0x67');break;case _0x808b('0x68'):_0x5b7de9[_0x808b('0x64')]=_0x808b('0x69');break;case _0x808b('0x6a'):_0x5b7de9[_0x808b('0x64')]=_0x808b('0x6b');default:}_0x5b7de9[_0x808b('0x6c')]=(_0x38614f===_0x808b('0x6d')?moment(_0x340f83[_0x808b('0x6e')])[_0x808b('0x2d')](_0x808b('0x62')):moment(_0x340f83[_0x808b('0x6f')])[_0x808b('0x2d')](_0x808b('0x62')))||moment()['format'](_0x808b('0x62'));_0x5b7de9[_0x808b('0x70')]=_0x38614f||_0x808b('0x71');_0x5b7de9=_[_0x808b('0x72')](_0x5b7de9,getCustomFields(_0x38ddb6[_0x808b('0x73')],_0x340f83));return request({'method':_0x808b('0x23'),'uri':_0x808b('0x4b')+_0x151eb8+_0x808b('0x74'),'headers':{'Authorization':_0x808b('0x2f')+_0x4f898f},'body':{'data':[_0x5b7de9]},'json':!![]})[_0x808b('0x28')](function(_0x20bd52){if(_0x20bd52&&_0x20bd52[_0x808b('0x3b')][0x0]['code']===_0x808b('0x43')){logger['info']('Call\x20created!');return{'id':_0x20bd52[_0x808b('0x3b')][0x0][_0x808b('0x75')]['id']};}})[_0x808b('0x29')](function(_0x38268e){logger[_0x808b('0x32')](_0x808b('0x76'),_0x38268e[_0x808b('0x2c')]);console[_0x808b('0x46')](_0x808b('0x76'),_0x38268e);});}exports[_0x808b('0x77')]=function(_0x798a14,_0x5d9c2a,_0x4f64f2,_0x4b024c,_0x400457,_0x498bbd){var _0x3f1e58,_0x1f74f5,_0x12139e;_0x498bbd['host']=intUtil[_0x808b('0x78')](_0x498bbd[_0x808b('0x79')]);_0x498bbd[_0x808b('0x7a')]=intUtil[_0x808b('0x78')](_0x498bbd[_0x808b('0x7a')]);if(_0x400457&&_0x400457[_0x808b('0x7b')]){logger['info']('[QUEUE]',_0x808b('0x7c'));_0x5d9c2a['recordingURL']=_0x498bbd[_0x808b('0x7a')]+_0x808b('0x7d')+_0x5d9c2a[_0x808b('0x7e')]+_0x808b('0x7f')+md5(_0x5d9c2a[_0x808b('0x7e')]);}else{_0x5d9c2a[_0x808b('0x80')]='';}var _0x5706d2=_0x498bbd[_0x808b('0x79')]===_0x808b('0x81')?'eu':_0x808b('0x82');return getAccessToken(_0x498bbd)[_0x808b('0x28')](function(_0x5dbc6f){_0x12139e=_0x5dbc6f;return getUser(_0x12139e,_0x5706d2,_0x498bbd,_0x4b024c[_0x808b('0x83')]);})[_0x808b('0x28')](function(_0x223f05){_0x3f1e58=_0x223f05;logger[_0x808b('0x32')]('The\x20User\x20ID\x20is:',_0x3f1e58['id']);return getEndUser(_0x12139e,_0x5706d2,_0x498bbd,_0x5d9c2a[_0x808b('0x84')],_0x5d9c2a[_0x808b('0x85')],_0x3f1e58,_0x4f64f2);})['then'](function(_0x5794e7){_0x1f74f5=_0x5794e7;return getCall(_0x12139e,_0x5706d2,_0x498bbd,_0x3f1e58,_0x1f74f5,_0x4f64f2,_0x5d9c2a,'Inbound');})[_0x808b('0x28')](function(_0x126cd0){if(_0x126cd0){logger[_0x808b('0x32')](_0x808b('0x86'),_0x126cd0['id']);logger[_0x808b('0x32')](_0x808b('0x87'),_0x808b('0x88'));emit(util[_0x808b('0x2d')](_0x808b('0x89'),_0x4b024c[_0x808b('0x17')]),_0x808b('0x8a'),{'uri':'https://crm.'+_0x498bbd[_0x808b('0x79')]+_0x808b('0x8b')+_0x126cd0['id']});}})[_0x808b('0x29')](function(_0x3ad925){logger[_0x808b('0x2a')]('[QUEUE]',JSON[_0x808b('0x3a')](_0x3ad925));});};exports[_0x808b('0x6d')]=function(_0x217b05,_0x4a9aa6,_0x35fd81,_0x22154a,_0x10ae99,_0xa18527,_0x5bb881){var _0x5a870a,_0x4b249d,_0x2fa6f4;_0xa18527[_0x808b('0x79')]=intUtil['stripTrailingSlash'](_0xa18527[_0x808b('0x79')]);_0xa18527[_0x808b('0x7a')]=intUtil[_0x808b('0x78')](_0xa18527[_0x808b('0x7a')]);if(_0x5bb881&&_0x5bb881[_0x808b('0x8c')]&&_0x5bb881[_0x808b('0x8c')]!==_0x808b('0x8d')){logger[_0x808b('0x32')]('[OUTBOUND]',_0x808b('0x7c'));_0x4a9aa6[_0x808b('0x80')]=_0xa18527[_0x808b('0x7a')]+_0x808b('0x7d')+_0x4a9aa6['uniqueid']+_0x808b('0x7f')+md5(_0x4a9aa6[_0x808b('0x7e')]);}var _0x5864f6=_0xa18527[_0x808b('0x79')]===_0x808b('0x81')?'eu':_0x808b('0x82');return getAccessToken(_0xa18527)[_0x808b('0x28')](function(_0x58e399){_0x2fa6f4=_0x58e399;return getUser(_0x2fa6f4,_0x5864f6,_0xa18527,_0x22154a[_0x808b('0x83')]);})[_0x808b('0x28')](function(_0x59fdd1){_0x5a870a=_0x59fdd1;logger[_0x808b('0x32')](_0x808b('0x8e'),_0x5a870a['id']);return getEndUser(_0x2fa6f4,_0x5864f6,_0xa18527,_0x4a9aa6[_0x808b('0x8f')],_0x4a9aa6['destcalleridnum'],_0x5a870a,_0x35fd81);})[_0x808b('0x28')](function(_0x340083){_0x4b249d=_0x340083;return getCall(_0x2fa6f4,_0x5864f6,_0xa18527,_0x5a870a,_0x4b249d,_0x35fd81,_0x4a9aa6,_0x808b('0x90'));})['then'](function(_0x524ee5){if(_0x524ee5){logger['info'](_0x808b('0x86'),_0x524ee5['id']);logger[_0x808b('0x32')](_0x808b('0x91'),_0x808b('0x88'));emit(util['format'](_0x808b('0x89'),_0x22154a['name']),_0x808b('0x8a'),{'uri':_0x808b('0x92')+_0xa18527[_0x808b('0x79')]+_0x808b('0x8b')+_0x524ee5['id']});}})[_0x808b('0x29')](function(_0x33af3c){logger[_0x808b('0x2a')](_0x808b('0x91'),JSON[_0x808b('0x3a')](_0x33af3c));});};exports[_0x808b('0x93')]=function(_0x17fe5b,_0x2b6868,_0x1de151,_0x121fcb,_0x314860,_0x551882){var _0x2d68b7,_0xb7864b,_0x218ecd;_0x551882[_0x808b('0x79')]=intUtil['stripTrailingSlash'](_0x551882[_0x808b('0x79')]);_0x551882[_0x808b('0x7a')]=intUtil[_0x808b('0x78')](_0x551882[_0x808b('0x7a')]);if(_0x314860&&_0x314860[_0x808b('0x7b')]){logger['info']('['+_0x2b6868[_0x808b('0x94')][_0x808b('0x95')]()+']',_0x808b('0x7c'));_0x2b6868[_0x808b('0x80')]=_0x551882['serverUrl']+'/api/voice/recordings/'+_0x2b6868['uniqueid']+_0x808b('0x7f')+md5(_0x2b6868[_0x808b('0x7e')]);}else{_0x2b6868[_0x808b('0x80')]='';}var _0x48b3b7=_0x551882[_0x808b('0x79')]===_0x808b('0x81')?'eu':_0x808b('0x82');return getAccessToken(_0x551882)[_0x808b('0x28')](function(_0x421540){_0x218ecd=_0x421540;return getUser(_0x218ecd,_0x48b3b7,_0x551882);})['then'](function(_0x6919d4){_0x2d68b7=_0x6919d4;logger[_0x808b('0x32')]('The\x20User\x20ID\x20is:',_0x2d68b7['id']);return getEndUser(_0x218ecd,_0x48b3b7,_0x551882,_0x2b6868[_0x808b('0x84')],_0x2b6868[_0x808b('0x85')],_0x2d68b7,_0x1de151);})['then'](function(_0x543cf8){_0xb7864b=_0x543cf8;return getCall(_0x218ecd,_0x48b3b7,_0x551882,_0x2d68b7,_0xb7864b,_0x1de151,_0x2b6868,_0x808b('0x71'));})[_0x808b('0x28')](function(_0x382899){if(_0x382899){logger[_0x808b('0x32')](_0x808b('0x86'),_0x382899['id']);}})['catch'](function(_0x42a7a6){logger['error']('['+_0x2b6868[_0x808b('0x94')]['toUpperCase']()+']',JSON[_0x808b('0x3a')](_0x42a7a6));});};
\ No newline at end of file
+var _0x62ee=['toUpperCase','calleridname','lodash','request-promise','md5','util','moment','ioredis','bluebird','zoho','redis','localhost','emit','debug','length','forEach','string','picklist','type','idField','content','variable','variableName','toString','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.in','refreshToken','clientId','clientSecret','refresh_token','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','details','Error:\x20','CREATE\x20ERROR','GET','moduleSearch','contact_lead','uri','Contacts','Leads','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','mm:ss','answertime','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','connect','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','agentcalledAt','Call_Type','Inbound','POST','/crm/v2/Calls','code','SUCCESS','Call\x20created!','err','log','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','zoho.eu','com','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','unmanaged'];(function(_0x37bcdd,_0x4fea5c){var _0x4d32de=function(_0x5064cc){while(--_0x5064cc){_0x37bcdd['push'](_0x37bcdd['shift']());}};_0x4d32de(++_0x4fea5c);}(_0x62ee,0x13a));var _0xe62e=function(_0x642029,_0xb900a){_0x642029=_0x642029-0x0;var _0x22596f=_0x62ee[_0x642029];return _0x22596f;};'use strict';var _=require(_0xe62e('0x0'));var rp=require(_0xe62e('0x1'));var md5=require(_0xe62e('0x2'));var util=require(_0xe62e('0x3'));var intUtil=require('./util');var moment=require(_0xe62e('0x4'));var Redis=require(_0xe62e('0x5'));var BPromise=require(_0xe62e('0x6'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xe62e('0x7'));config[_0xe62e('0x8')]=_['defaults'](config[_0xe62e('0x8')],{'host':_0xe62e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xe62e('0x8')]));function emit(_0x3fb05a,_0x2b9560,_0x2bda18){io['to'](_0x3fb05a)[_0xe62e('0xa')](_0x2b9560,_0x2bda18);}function request(_0x541d18){logger[_0xe62e('0xb')]('[HTTP]',JSON['stringify'](_0x541d18));return rp(_0x541d18);}function getCustomFields(_0x3f554c,_0x356f4a){var _0x453d5={};if(_0x3f554c[_0xe62e('0xc')]>0x0){_[_0xe62e('0xd')](_0x3f554c,function(_0x2d59dd){if(_['includes']([_0xe62e('0xe'),_0xe62e('0xf')],_0x2d59dd[_0xe62e('0x10')])&&_0x2d59dd[_0xe62e('0x11')]){_0x453d5[_0x2d59dd[_0xe62e('0x11')]]=_0x2d59dd[_0xe62e('0x12')]['toString']();}else if(_0x2d59dd['type']===_0xe62e('0x13')&&_0x2d59dd['variableName']&&_0x2d59dd[_0xe62e('0x11')]&&_0x356f4a[_0x2d59dd['variableName']]){_0x453d5[_0x2d59dd[_0xe62e('0x11')]]=_0x356f4a[_0x2d59dd[_0xe62e('0x14')]][_0xe62e('0x15')]();}else if(_0x2d59dd[_0xe62e('0x10')]===_0xe62e('0x16')&&_0x2d59dd[_0xe62e('0x17')]&&_0x2d59dd[_0xe62e('0x17')][_0xe62e('0x18')]&&_0x2d59dd[_0xe62e('0x11')]&&_0x356f4a[_0x2d59dd[_0xe62e('0x17')][_0xe62e('0x18')][_0xe62e('0x19')]()]){_0x453d5[_0x2d59dd[_0xe62e('0x11')]]=_0x356f4a[_0x2d59dd[_0xe62e('0x17')][_0xe62e('0x18')][_0xe62e('0x19')]()]['toString']();}});}return _0x453d5;}function getName(_0x2382d5){if(_0x2382d5[_0xe62e('0x1a')]('\x20')>0x0){var _0x14cd44=_0x2382d5[_0xe62e('0x1b')](/ (.+)/);if(_0x14cd44[0x1]){return _0x14cd44;}}return[_0x2382d5,_0x2382d5];}var accountsTokens={};function getAccessToken(_0x19231e){return new Promise(function(_0x4fbcf8,_0x14f4a5){if(!_['isNil'](accountsTokens[_0x19231e['id']])&&!_[_0xe62e('0x1c')](accountsTokens[_0x19231e['id']][_0xe62e('0x1d')])){if(moment()[_0xe62e('0x1e')](accountsTokens[_0x19231e['id']]['expires_in'])){_0x4fbcf8(accountsTokens[_0x19231e['id']]['access_token']);}}var _0x295159;switch(_0x19231e['zone']){case'US':_0x295159=_0xe62e('0x1f');break;case'AU':_0x295159=_0xe62e('0x20');break;case'EU':_0x295159=_0xe62e('0x21');break;case'IN':_0x295159=_0xe62e('0x22');break;case'CN':_0x295159='https://accounts.zoho.com.cn';break;default:_0x295159=_0xe62e('0x21');break;}var _0x4c8e32={'method':'POST','uri':_0x295159+'/oauth/v2/token','qs':{'refresh_token':_0x19231e[_0xe62e('0x23')],'client_id':_0x19231e[_0xe62e('0x24')],'client_secret':_0x19231e[_0xe62e('0x25')],'grant_type':_0xe62e('0x26')},'json':!![]};return rp(_0x4c8e32)['then'](function(_0x3785a8){accountsTokens[_0x19231e['id']]={'access_token':_0x3785a8[_0xe62e('0x1d')],'expires_in':moment()[_0xe62e('0x27')](_0x3785a8[_0xe62e('0x28')],_0xe62e('0x29'))};_0x4fbcf8(_0x3785a8[_0xe62e('0x1d')]);})[_0xe62e('0x2a')](function(_0xf0fbfb){logger[_0xe62e('0x2b')](_0xe62e('0x2c'),_0xf0fbfb[_0xe62e('0x2d')]);_0x14f4a5(_0xf0fbfb);});});}function getUser(_0x49ae63,_0x179187,_0x498c54,_0x29d1f9){logger['info'](_0xe62e('0x2e'));return request({'method':'GET','uri':util[_0xe62e('0x2f')](_0xe62e('0x30'),_0x179187),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xe62e('0x31')+_0x49ae63},'json':!![]})[_0xe62e('0x32')](function(_0x40b66c){if(_0x40b66c[_0xe62e('0x33')]){var _0x14b7a7=-0x1;if(_[_0xe62e('0x34')](_0x40b66c[_0xe62e('0x33')])){if(!_[_0xe62e('0x1c')](_0x29d1f9)){_0x14b7a7=_[_0xe62e('0x35')](_0x40b66c[_0xe62e('0x33')],function(_0x480a26){return _0x480a26[_0xe62e('0x36')]===_0x29d1f9;});}if(_0x14b7a7>=0x0){logger[_0xe62e('0x37')](_0xe62e('0x38'));}else{logger[_0xe62e('0x37')](_0xe62e('0x39'));_0x14b7a7=_[_0xe62e('0x35')](_0x40b66c[_0xe62e('0x33')],function(_0x3c0f5d){return _0x3c0f5d[_0xe62e('0x3a')][_0xe62e('0x18')]===_0xe62e('0x3b');});}return _0x40b66c[_0xe62e('0x33')][_0x14b7a7];}else{if(_0x40b66c[_0xe62e('0x3c')][_0xe62e('0x3a')][_0xe62e('0x18')]==='Administrator'){logger[_0xe62e('0x37')](_0xe62e('0x39'));user=_0x40b66c[_0xe62e('0x3c')];return user;}else{logger['error'](_0xe62e('0x3d'),JSON[_0xe62e('0x3e')](_0x40b66c));throw new Error(_0xe62e('0x3f')+JSON[_0xe62e('0x3e')](_0x40b66c));}}}else{logger[_0xe62e('0x2b')]('The\x20failing\x20result\x20is',JSON[_0xe62e('0x3e')](_0x40b66c));throw new Error(_0xe62e('0x3f')+JSON[_0xe62e('0x3e')](_0x40b66c));}})[_0xe62e('0x2a')](function(_0x3b6c16){console[_0xe62e('0x2b')](_0x3b6c16);});}function getZohoUser(_0x23bea8,_0x2682af){return new BPromise(function(_0x367a5e,_0x289d6f){request(_0x23bea8)[_0xe62e('0x32')](function(_0xa898fe){var _0x5179bc=null;if(_0xa898fe){_0x5179bc=_0xa898fe[_0xe62e('0x40')][0x0];_0x5179bc[_0xe62e('0x41')]=_0x2682af;}_0x367a5e(_0x5179bc);})[_0xe62e('0x2a')](function(_0x310251){_0x289d6f(_0x310251);});});}function createEndUser(_0x116a6a,_0x2844bf,_0x57a506,_0x900988,_0x4d2d18,_0x5e8e10){var _0x57a506=getName(_0x57a506);return request({'method':'POST','uri':_0xe62e('0x42')+_0x2844bf+_0xe62e('0x43')+_[_0xe62e('0x44')](_0x5e8e10[_0xe62e('0x45')])+'s','body':{'data':[{'Last_Name':_0x57a506[0x1],'First_Name':_0x57a506[0x0],'Phone':_0x900988,'Owner':{'name':!_[_0xe62e('0x1c')](_0x4d2d18[_0xe62e('0x46')][_0xe62e('0x18')])?_0x4d2d18['role'][_0xe62e('0x18')]:!_[_0xe62e('0x1c')](_0x4d2d18['first_name'])?_0x4d2d18[_0xe62e('0x47')]+'\x20'+_0x4d2d18[_0xe62e('0x48')]:_0x4d2d18[_0xe62e('0x48')],'id':_0x4d2d18['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x116a6a},'json':!![]})[_0xe62e('0x32')](function(_0x4623b8){if(_0x4623b8&&_0x4623b8['data'][0x0]['code']==='SUCCESS'){var _0x3fdb50=_0x4623b8[_0xe62e('0x40')][0x0][_0xe62e('0x49')];_0x3fdb50[_0xe62e('0x41')]=_[_0xe62e('0x44')](_0x5e8e10['moduleCreate'])+'s';return _0x3fdb50;}logger['error'](_0xe62e('0x3d'),JSON['stringify'](data));throw new Error(_0xe62e('0x4a')+JSON[_0xe62e('0x3e')](data));})[_0xe62e('0x2a')](function(_0x32368e){console['log'](_0xe62e('0x4b'),_0x32368e);});}function getEndUser(_0x429ef6,_0x3b346c,_0x15d0e2,_0x4df44a,_0xdc0b74,_0x4a1d03,_0x315b99){var _0x59b54d={'method':_0xe62e('0x4c'),'uri':'','headers':{'Authorization':_0xe62e('0x31')+_0x429ef6},'json':!![]};switch(_0x315b99[_0xe62e('0x4d')]){case _0xe62e('0x4e'):_0x59b54d[_0xe62e('0x4f')]=_0xe62e('0x42')+_0x3b346c+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0xdc0b74+'))';return getZohoUser(_0x59b54d,_0xe62e('0x50'))[_0xe62e('0x32')](function(_0x5b18fd){if(_0x5b18fd)return _0x5b18fd;_0x59b54d[_0xe62e('0x4f')]=_0xe62e('0x42')+_0x3b346c+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0xdc0b74+'))';return getZohoUser(_0x59b54d,_0xe62e('0x51'))[_0xe62e('0x32')](function(_0x3a08b0){if(_0x3a08b0)return _0x3a08b0;if(_0x315b99['moduleCreate']!=_0xe62e('0x52')){return createEndUser(_0x429ef6,_0x3b346c,_0x4df44a,_0xdc0b74,_0x4a1d03,_0x315b99);}else{return{};}});});break;case'contact':_0x59b54d['uri']=_0xe62e('0x42')+_0x3b346c+_0xe62e('0x53')+_0xdc0b74+'))';return getZohoUser(_0x59b54d,_0xe62e('0x50'))[_0xe62e('0x32')](function(_0x12e36f){if(_0x12e36f)return _0x12e36f;if(_0x315b99[_0xe62e('0x45')]!=_0xe62e('0x52')){return createEndUser(_0x429ef6,_0x3b346c,_0x4df44a,_0xdc0b74,_0x4a1d03,_0x315b99);}else{return{};}});break;case _0xe62e('0x54'):_0x59b54d['uri']='https://www.zohoapis.'+_0x3b346c+_0xe62e('0x55')+_0xdc0b74+'))';return getZohoUser(_0x59b54d,_0xe62e('0x51'))[_0xe62e('0x32')](function(_0x5bdf13){if(_0x5bdf13)return _0x5bdf13;if(_0x315b99[_0xe62e('0x45')]!='nothing'){return createEndUser(_0x429ef6,_0x3b346c,_0x4df44a,_0xdc0b74,_0x4a1d03,_0x315b99);}else{return{};}});break;}}function getCall(_0x19f9ce,_0x506c2b,_0x49ce20,_0x118ae7,_0x309645,_0xdeed53,_0x83bc2,_0x112853){logger[_0xe62e('0x37')](_0xe62e('0x56'));var _0x6250f3={};_0x6250f3[_0xe62e('0x57')]={'name':!_[_0xe62e('0x1c')](_0x118ae7[_0xe62e('0x46')][_0xe62e('0x18')])&&!_['isNil'](_0x118ae7[_0xe62e('0x3a')]['name'])&&_0x118ae7[_0xe62e('0x3a')][_0xe62e('0x18')]==='administrator'?_0x118ae7[_0xe62e('0x46')]['name']:!_[_0xe62e('0x1c')](_0x118ae7[_0xe62e('0x47')])?_0x118ae7[_0xe62e('0x47')]+'\x20'+_0x118ae7['last_name']:_0x118ae7['last_name'],'id':_0x118ae7['id']};_0x6250f3['Subject']=intUtil[_0xe62e('0x58')](_0xdeed53['Subjects'],_0x83bc2,'\x20');_0x6250f3[_0xe62e('0x59')]=intUtil['getString'](_0xdeed53[_0xe62e('0x5a')],_0x83bc2,'\x0a');if(_0x309645[_0xe62e('0x41')]==='Contacts'){_0x6250f3[_0xe62e('0x5b')]={'name':!_[_0xe62e('0x1c')](_0x309645[_0xe62e('0x5c')])?_0x309645['Full_Name']:!_[_0xe62e('0x1c')](_0x309645[_0xe62e('0x5d')])?_0x309645[_0xe62e('0x5d')]+'\x20'+_0x309645['Last_Name']:_0x309645[_0xe62e('0x5e')],'id':_0x309645['id']};}if(_0x309645[_0xe62e('0x41')]==='Leads'){_0x6250f3['What_Id']={'name':!_[_0xe62e('0x1c')](_0x309645[_0xe62e('0x5c')])?_0x309645[_0xe62e('0x5c')]:!_[_0xe62e('0x1c')](_0x309645[_0xe62e('0x5d')])?_0x309645[_0xe62e('0x5d')]+'\x20'+_0x309645['Last_Name']:_0x309645[_0xe62e('0x5e')],'id':_0x309645['id']};_0x6250f3[_0xe62e('0x5f')]=_[_0xe62e('0x44')](_0x309645[_0xe62e('0x41')]);}if(_0x83bc2[_0xe62e('0x60')]){_0x6250f3[_0xe62e('0x61')]=moment['utc'](parseInt(_0x83bc2['talktime'])*0x3e8)[_0xe62e('0x2f')](_0xe62e('0x62'));}else if(_0x83bc2[_0xe62e('0x63')]&&_0x83bc2['endtime']){_0x6250f3[_0xe62e('0x61')]=moment[_0xe62e('0x64')](moment(_0x83bc2['endtime'],_0xe62e('0x65'))[_0xe62e('0x66')](moment(_0x83bc2[_0xe62e('0x67')],'YYYY-MM-DDTHH:mm:ss')))[_0xe62e('0x2f')](_0xe62e('0x62'));}switch(_0x83bc2[_0xe62e('0x68')]){case _0xe62e('0x69'):_0x6250f3['Call_Result']='Called';break;case'complete':case _0xe62e('0x6a'):_0x6250f3[_0xe62e('0x6b')]=_0xe62e('0x6c');break;case _0xe62e('0x6d'):_0x6250f3[_0xe62e('0x6b')]=_0xe62e('0x6e');break;case _0xe62e('0x6f'):_0x6250f3[_0xe62e('0x6b')]=_0xe62e('0x70');break;case _0xe62e('0x71'):_0x6250f3[_0xe62e('0x6b')]=_0xe62e('0x72');default:}_0x6250f3[_0xe62e('0x73')]=(_0x112853==='outbound'?moment(_0x83bc2[_0xe62e('0x67')])['format'](_0xe62e('0x65')):moment(_0x83bc2[_0xe62e('0x74')])['format'](_0xe62e('0x65')))||moment()[_0xe62e('0x2f')](_0xe62e('0x65'));_0x6250f3[_0xe62e('0x75')]=_0x112853||_0xe62e('0x76');_0x6250f3=_['merge'](_0x6250f3,getCustomFields(_0xdeed53['Fields'],_0x83bc2));return request({'method':_0xe62e('0x77'),'uri':_0xe62e('0x42')+_0x506c2b+_0xe62e('0x78'),'headers':{'Authorization':_0xe62e('0x31')+_0x19f9ce},'body':{'data':[_0x6250f3]},'json':!![]})['then'](function(_0x41f2d2){if(_0x41f2d2&&_0x41f2d2['data'][0x0][_0xe62e('0x79')]===_0xe62e('0x7a')){logger[_0xe62e('0x37')](_0xe62e('0x7b'));return{'id':_0x41f2d2['data'][0x0][_0xe62e('0x49')]['id']};}})[_0xe62e('0x2a')](function(_0x2d3b07){logger['info'](_0xe62e('0x7c'),_0x2d3b07['stack']);console[_0xe62e('0x7d')](_0xe62e('0x7c'),_0x2d3b07);});}exports[_0xe62e('0x7e')]=function(_0x4ac9a9,_0xf0a634,_0x556b98,_0xa221aa,_0x1bb4af,_0x1f2471){var _0x169ee8,_0x49c051,_0x46a4ce;_0x1f2471[_0xe62e('0x7f')]=intUtil[_0xe62e('0x80')](_0x1f2471[_0xe62e('0x7f')]);_0x1f2471[_0xe62e('0x81')]=intUtil[_0xe62e('0x80')](_0x1f2471[_0xe62e('0x81')]);if(_0x1bb4af&&_0x1bb4af[_0xe62e('0x82')]){logger['info'](_0xe62e('0x83'),_0xe62e('0x84'));_0xf0a634['recordingURL']=_0x1f2471[_0xe62e('0x81')]+'/api/voice/recordings/'+_0xf0a634[_0xe62e('0x85')]+'/downloads?type=uniqueid&token='+md5(_0xf0a634[_0xe62e('0x85')]);}else{_0xf0a634['recordingURL']='';}var _0x5253fc=_0x1f2471['host']===_0xe62e('0x86')?'eu':_0xe62e('0x87');return getAccessToken(_0x1f2471)[_0xe62e('0x32')](function(_0x58de68){_0x46a4ce=_0x58de68;return getUser(_0x46a4ce,_0x5253fc,_0x1f2471,_0xa221aa['email']);})['then'](function(_0x73b7b0){_0x169ee8=_0x73b7b0;logger[_0xe62e('0x37')]('The\x20User\x20ID\x20is:',_0x169ee8['id']);return getEndUser(_0x46a4ce,_0x5253fc,_0x1f2471,_0xf0a634['calleridname'],_0xf0a634[_0xe62e('0x88')],_0x169ee8,_0x556b98);})[_0xe62e('0x32')](function(_0x453606){_0x49c051=_0x453606;return getCall(_0x46a4ce,_0x5253fc,_0x1f2471,_0x169ee8,_0x49c051,_0x556b98,_0xf0a634,'Inbound');})['then'](function(_0x240008){if(_0x240008){logger[_0xe62e('0x37')](_0xe62e('0x89'),_0x240008['id']);logger['info']('[QUEUE]',_0xe62e('0x8a'));emit(util['format'](_0xe62e('0x8b'),_0xa221aa[_0xe62e('0x18')]),_0xe62e('0x8c'),{'uri':_0xe62e('0x8d')+_0x1f2471[_0xe62e('0x7f')]+_0xe62e('0x8e')+_0x240008['id']});}})[_0xe62e('0x2a')](function(_0x1b00ae){logger[_0xe62e('0x2b')](_0xe62e('0x83'),JSON[_0xe62e('0x3e')](_0x1b00ae));});};exports['outbound']=function(_0xa3b6ce,_0x53cd44,_0x4251a4,_0x46590a,_0x36928f,_0x14e2c1,_0x36c51d){var _0x3ec6ac,_0x15781e,_0x1a67a4;_0x14e2c1[_0xe62e('0x7f')]=intUtil[_0xe62e('0x80')](_0x14e2c1[_0xe62e('0x7f')]);_0x14e2c1['serverUrl']=intUtil[_0xe62e('0x80')](_0x14e2c1[_0xe62e('0x81')]);if(_0x36c51d&&_0x36c51d[_0xe62e('0x8f')]&&_0x36c51d['recordingFormat']!==_0xe62e('0x90')){logger['info'](_0xe62e('0x91'),'Recording\x20is\x20enabled!');_0x53cd44[_0xe62e('0x92')]=_0x14e2c1['serverUrl']+_0xe62e('0x93')+_0x53cd44[_0xe62e('0x85')]+_0xe62e('0x94')+md5(_0x53cd44[_0xe62e('0x85')]);}var _0x1a4ae5=_0x14e2c1['host']===_0xe62e('0x86')?'eu':_0xe62e('0x87');return getAccessToken(_0x14e2c1)[_0xe62e('0x32')](function(_0x1c2c37){_0x1a67a4=_0x1c2c37;return getUser(_0x1a67a4,_0x1a4ae5,_0x14e2c1,_0x46590a[_0xe62e('0x36')]);})['then'](function(_0x10542f){_0x3ec6ac=_0x10542f;logger['info'](_0xe62e('0x95'),_0x3ec6ac['id']);return getEndUser(_0x1a67a4,_0x1a4ae5,_0x14e2c1,_0x53cd44[_0xe62e('0x96')],_0x53cd44[_0xe62e('0x97')],_0x3ec6ac,_0x4251a4);})[_0xe62e('0x32')](function(_0x2ce90e){_0x15781e=_0x2ce90e;return getCall(_0x1a67a4,_0x1a4ae5,_0x14e2c1,_0x3ec6ac,_0x15781e,_0x4251a4,_0x53cd44,_0xe62e('0x98'));})[_0xe62e('0x32')](function(_0x187271){if(_0x187271){logger[_0xe62e('0x37')](_0xe62e('0x89'),_0x187271['id']);logger[_0xe62e('0x37')](_0xe62e('0x91'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xe62e('0x2f')]('user:%s',_0x46590a[_0xe62e('0x18')]),_0xe62e('0x8c'),{'uri':_0xe62e('0x8d')+_0x14e2c1[_0xe62e('0x7f')]+_0xe62e('0x8e')+_0x187271['id']});}})[_0xe62e('0x2a')](function(_0x297de0){logger[_0xe62e('0x2b')](_0xe62e('0x91'),JSON[_0xe62e('0x3e')](_0x297de0));});};exports[_0xe62e('0x99')]=function(_0x46f6cb,_0x3c25bb,_0x4c7c36,_0x1cb456,_0x4e7374,_0x1bb8e2){var _0x4c9c1f,_0xfac024,_0x3eb4d1;_0x1bb8e2[_0xe62e('0x7f')]=intUtil[_0xe62e('0x80')](_0x1bb8e2[_0xe62e('0x7f')]);_0x1bb8e2['serverUrl']=intUtil[_0xe62e('0x80')](_0x1bb8e2[_0xe62e('0x81')]);if(_0x4e7374&&_0x4e7374[_0xe62e('0x82')]){logger[_0xe62e('0x37')]('['+_0x3c25bb[_0xe62e('0x68')][_0xe62e('0x9a')]()+']',_0xe62e('0x84'));_0x3c25bb[_0xe62e('0x92')]=_0x1bb8e2['serverUrl']+_0xe62e('0x93')+_0x3c25bb[_0xe62e('0x85')]+_0xe62e('0x94')+md5(_0x3c25bb[_0xe62e('0x85')]);}else{_0x3c25bb['recordingURL']='';}var _0x19a172=_0x1bb8e2[_0xe62e('0x7f')]==='zoho.eu'?'eu':_0xe62e('0x87');return getAccessToken(_0x1bb8e2)[_0xe62e('0x32')](function(_0x550699){_0x3eb4d1=_0x550699;return getUser(_0x3eb4d1,_0x19a172,_0x1bb8e2);})['then'](function(_0xbae9e3){_0x4c9c1f=_0xbae9e3;logger['info'](_0xe62e('0x95'),_0x4c9c1f['id']);return getEndUser(_0x3eb4d1,_0x19a172,_0x1bb8e2,_0x3c25bb[_0xe62e('0x9b')],_0x3c25bb[_0xe62e('0x88')],_0x4c9c1f,_0x4c7c36);})[_0xe62e('0x32')](function(_0x3b0860){_0xfac024=_0x3b0860;return getCall(_0x3eb4d1,_0x19a172,_0x1bb8e2,_0x4c9c1f,_0xfac024,_0x4c7c36,_0x3c25bb,_0xe62e('0x76'));})[_0xe62e('0x32')](function(_0x4c998d){if(_0x4c998d){logger[_0xe62e('0x37')](_0xe62e('0x89'),_0x4c998d['id']);}})[_0xe62e('0x2a')](function(_0x42e472){logger[_0xe62e('0x2b')]('['+_0x3c25bb[_0xe62e('0x68')][_0xe62e('0x9a')]()+']',JSON[_0xe62e('0x3e')](_0x42e472));});};
\ No newline at end of file
index f81d5c4..f858b5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff39=['format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','shelljs','trigger','exec','data2','data3','render','error'];(function(_0x5c1ade,_0xaa1212){var _0x4980b4=function(_0x522f89){while(--_0x522f89){_0x5c1ade['push'](_0x5c1ade['shift']());}};_0x4980b4(++_0xaa1212);}(_0xff39,0x111));var _0x9ff3=function(_0x57494e,_0x2c4d3d){_0x57494e=_0x57494e-0x0;var _0x4099da=_0xff39[_0x57494e];return _0x4099da;};'use strict';var util=require('util');var sh=require(_0x9ff3('0x0'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x9ff3('0x1'));exports[_0x9ff3('0x2')]=function(_0x1cac50,_0x582e47){var _0x13bdf6=_0x1cac50['data2']?_0x1cac50[_0x9ff3('0x3')]:'Script';var _0x59f868=_0x1cac50[_0x9ff3('0x4')]?Mustache[_0x9ff3('0x5')](_0x1cac50[_0x9ff3('0x4')],_0x582e47):_0x582e47;sh[_0x9ff3('0x2')](_0x59f868,function(_0x49e458,_0x38856e,_0xacc16f){if(_0x49e458!==0x0){logger[_0x9ff3('0x6')](util[_0x9ff3('0x7')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x13bdf6,_0x59f868,_0x49e458,_0xacc16f));}else{logger[_0x9ff3('0x8')](util[_0x9ff3('0x7')](_0x9ff3('0x9'),_0x13bdf6,_0x59f868,_0x38856e));}});};
\ No newline at end of file
+var _0x7bf6=['trigger','exec','data2','Script','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','mustache'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x7bf6,0xa6));var _0x67bf=function(_0x137586,_0x45152a){_0x137586=_0x137586-0x0;var _0xd4514=_0x7bf6[_0x137586];return _0xd4514;};'use strict';var util=require(_0x67bf('0x0'));var sh=require('shelljs');var Mustache=require(_0x67bf('0x1'));var logger=require('../../../../config/logger')(_0x67bf('0x2'));exports[_0x67bf('0x3')]=function(_0x1a38db,_0x3d2efb){var _0xa952ff=_0x1a38db[_0x67bf('0x4')]?_0x1a38db[_0x67bf('0x4')]:_0x67bf('0x5');var _0x6d40df=_0x1a38db['data3']?Mustache[_0x67bf('0x6')](_0x1a38db[_0x67bf('0x7')],_0x3d2efb):_0x3d2efb;sh[_0x67bf('0x3')](_0x6d40df,function(_0x2aea82,_0x54141e,_0x189bf6){if(_0x2aea82!==0x0){logger[_0x67bf('0x8')](util[_0x67bf('0x9')](_0x67bf('0xa'),_0xa952ff,_0x6d40df,_0x2aea82,_0x189bf6));}else{logger[_0x67bf('0xb')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0xa952ff,_0x6d40df,_0x54141e));}});};
\ No newline at end of file
index d617925..88e9571 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1f6=['util','lodash','trigger','exec','toUpperCase','data2','data5','headers','data6','parse','error','stack','data1','DELETE','POST','PUT','data7','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','body','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise'];(function(_0x5a4081,_0x45cade){var _0x2c58ff=function(_0x22e0b0){while(--_0x22e0b0){_0x5a4081['push'](_0x5a4081['shift']());}};_0x2c58ff(++_0x45cade);}(_0xe1f6,0xf7));var _0x6e1f=function(_0x22a7c5,_0x5e21dd){_0x22a7c5=_0x22a7c5-0x0;var _0x694018=_0xe1f6[_0x22a7c5];return _0x694018;};'use strict';var rp=require(_0x6e1f('0x0'));var util=require(_0x6e1f('0x1'));var _=require(_0x6e1f('0x2'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x6e1f('0x3'));exports[_0x6e1f('0x4')]=function(_0x590d43,_0x8d1c09){var _0x15797d,_0x570d25;var _0x17be64={'method':_0x590d43['data1'][_0x6e1f('0x5')](),'uri':Mustache['render'](_0x590d43[_0x6e1f('0x6')],_0x8d1c09),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x590d43[_0x6e1f('0x7')])==='number'&&parseInt(_0x590d43[_0x6e1f('0x7')])>=0x1&&parseInt(_0x590d43['data5'])<=0xa?parseInt(_0x590d43[_0x6e1f('0x7')])*0x3e8:0x5*0x3e8};try{_0x17be64[_0x6e1f('0x8')]=_0x590d43[_0x6e1f('0x9')]?JSON[_0x6e1f('0xa')](Mustache['render'](_0x590d43['data6'],_0x8d1c09)):{};}catch(_0x599986){logger[_0x6e1f('0xb')](_0x599986[_0x6e1f('0xc')]);}switch(_0x590d43[_0x6e1f('0xd')]['toUpperCase']()){case'GET':case _0x6e1f('0xe'):_0x15797d=null;_0x17be64['qs']=_0x8d1c09;break;case _0x6e1f('0xf'):case _0x6e1f('0x10'):if(_0x590d43[_0x6e1f('0x11')]){try{_0x15797d=JSON['parse'](Mustache['render'](_0x590d43[_0x6e1f('0x11')],_0x8d1c09));_0x17be64['body']=_0x15797d;}catch(_0x1690f7){logger[_0x6e1f('0xb')](_0x1690f7[_0x6e1f('0xc')]);logger['error']('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x15797d=_0x8d1c09;_0x17be64['body']=_0x15797d;}break;}logger[_0x6e1f('0x12')](util['format'](_0x6e1f('0x13'),_0x590d43['data1'],_0x590d43[_0x6e1f('0x6')],JSON[_0x6e1f('0x14')](_0x17be64)));rp(_0x17be64)[_0x6e1f('0x15')](function(_0x31a08b){_0x15797d=!_[_0x6e1f('0x16')](_0x15797d)?_0x6e1f('0x17')+_0x15797d:'';_0x570d25=typeof _0x31a08b[_0x6e1f('0x18')]===_0x6e1f('0x19')?JSON['stringify'](_0x31a08b[_0x6e1f('0x18')]):_0x31a08b[_0x6e1f('0x18')];logger[_0x6e1f('0x12')](util['format'](_0x6e1f('0x1a'),_0x590d43[_0x6e1f('0xd')],_0x590d43[_0x6e1f('0x6')],_0x31a08b[_0x6e1f('0x1b')],_0x570d25));})[_0x6e1f('0x1c')](function(_0x3830d0){logger['error'](util['format'](_0x6e1f('0x1d'),_0x590d43[_0x6e1f('0xd')],_0x590d43['data2'],_0x3830d0['statusCode'],_0x3830d0['name'],_0x3830d0[_0x6e1f('0x1e')]));});};
\ No newline at end of file
+var _0x841c=['data7','render','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','then','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','request-promise','util','lodash','mustache','../../../../config/logger','trigger','data1','toUpperCase','data2','data5','number','headers','data6','parse','error','stack','GET','DELETE','POST','PUT'];(function(_0x5cc84d,_0x5b6a48){var _0x3a60ee=function(_0x5d6eb0){while(--_0x5d6eb0){_0x5cc84d['push'](_0x5cc84d['shift']());}};_0x3a60ee(++_0x5b6a48);}(_0x841c,0xd3));var _0xc841=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x841c[_0x57b54c];return _0x59cc19;};'use strict';var rp=require(_0xc841('0x0'));var util=require(_0xc841('0x1'));var _=require(_0xc841('0x2'));var Mustache=require(_0xc841('0x3'));var logger=require(_0xc841('0x4'))(_0xc841('0x5'));exports['exec']=function(_0x11b16b,_0x540128){var _0x1a09c5,_0x41905d;var _0x88af6b={'method':_0x11b16b[_0xc841('0x6')][_0xc841('0x7')](),'uri':Mustache['render'](_0x11b16b[_0xc841('0x8')],_0x540128),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x11b16b[_0xc841('0x9')])===_0xc841('0xa')&&parseInt(_0x11b16b[_0xc841('0x9')])>=0x1&&parseInt(_0x11b16b[_0xc841('0x9')])<=0xa?parseInt(_0x11b16b[_0xc841('0x9')])*0x3e8:0x5*0x3e8};try{_0x88af6b[_0xc841('0xb')]=_0x11b16b[_0xc841('0xc')]?JSON[_0xc841('0xd')](Mustache['render'](_0x11b16b[_0xc841('0xc')],_0x540128)):{};}catch(_0x2b57f6){logger[_0xc841('0xe')](_0x2b57f6[_0xc841('0xf')]);}switch(_0x11b16b['data1'][_0xc841('0x7')]()){case _0xc841('0x10'):case _0xc841('0x11'):_0x1a09c5=null;_0x88af6b['qs']=_0x540128;break;case _0xc841('0x12'):case _0xc841('0x13'):if(_0x11b16b[_0xc841('0x14')]){try{_0x1a09c5=JSON[_0xc841('0xd')](Mustache[_0xc841('0x15')](_0x11b16b[_0xc841('0x14')],_0x540128));_0x88af6b[_0xc841('0x16')]=_0x1a09c5;}catch(_0x9a413){logger[_0xc841('0xe')](_0x9a413[_0xc841('0xf')]);logger['error'](_0xc841('0x17'));}}else{_0x1a09c5=_0x540128;_0x88af6b['body']=_0x1a09c5;}break;}logger[_0xc841('0x18')](util[_0xc841('0x19')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x11b16b[_0xc841('0x6')],_0x11b16b['data2'],JSON[_0xc841('0x1a')](_0x88af6b)));rp(_0x88af6b)[_0xc841('0x1b')](function(_0x21d774){_0x1a09c5=!_['isNil'](_0x1a09c5)?',\x20request\x20body:\x20'+_0x1a09c5:'';_0x41905d=typeof _0x21d774[_0xc841('0x16')]===_0xc841('0x1c')?JSON[_0xc841('0x1a')](_0x21d774[_0xc841('0x16')]):_0x21d774[_0xc841('0x16')];logger['info'](util[_0xc841('0x19')](_0xc841('0x1d'),_0x11b16b['data1'],_0x11b16b[_0xc841('0x8')],_0x21d774[_0xc841('0x1e')],_0x41905d));})[_0xc841('0x1f')](function(_0x1014c6){logger[_0xc841('0xe')](util['format'](_0xc841('0x20'),_0x11b16b[_0xc841('0x6')],_0x11b16b[_0xc841('0x8')],_0x1014c6['statusCode'],_0x1014c6['name'],_0x1014c6['message']));});};
\ No newline at end of file
index b221ed9..bb48c89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb19e=['rpc','error','message','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request','debug'];(function(_0x2b408b,_0x9ac707){var _0x463b5c=function(_0x1aa66d){while(--_0x1aa66d){_0x2b408b['push'](_0x2b408b['shift']());}};_0x463b5c(++_0x9ac707);}(_0xb19e,0x67));var _0xeb19=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0xb19e[_0x2af053];return _0x4b4001;};'use strict';var jayson=require(_0xeb19('0x0'));var BPromise=require(_0xeb19('0x1'));var logger=require(_0xeb19('0x2'))(_0xeb19('0x3'));var client=jayson[_0xeb19('0x4')]['http']({'port':0x2329});client[_0xeb19('0x5')]=function(_0x516a07,_0x16584a){return new BPromise(function(_0x52d8a9,_0x28d28d){return client['request'](_0x516a07,_0x16584a)['then'](function(_0x3c221b){logger[_0xeb19('0x6')](_0xeb19('0x7'),'routing',_0x516a07,_0x16584a,_0x3c221b);if(_0x3c221b[_0xeb19('0x8')]){logger[_0xeb19('0x8')](_0xeb19('0x7'),_0xeb19('0x3'),_0x516a07,_0x3c221b[_0xeb19('0x8')][_0xeb19('0x9')],_0x16584a);return _0x28d28d(_0x3c221b['error'][_0xeb19('0x9')]);}else{return _0x52d8a9(_0x3c221b['result']);}})['catch'](function(_0xb9c605){logger[_0xeb19('0x8')](_0xeb19('0x7'),_0xeb19('0x3'),_0x516a07,_0xb9c605,_0x16584a);return _0x28d28d(_0xb9c605);});});};module[_0xeb19('0xa')]=client;
\ No newline at end of file
+var _0xa0c0=['then','debug','error','rpc','message','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','http','Request','request'];(function(_0x2cb6d2,_0x23cff5){var _0xaa9190=function(_0x32d608){while(--_0x32d608){_0x2cb6d2['push'](_0x2cb6d2['shift']());}};_0xaa9190(++_0x23cff5);}(_0xa0c0,0x1ab));var _0x0a0c=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa0c0[_0x19950b];return _0x3c6b41;};'use strict';var jayson=require(_0x0a0c('0x0'));var BPromise=require(_0x0a0c('0x1'));var logger=require(_0x0a0c('0x2'))(_0x0a0c('0x3'));var client=jayson[_0x0a0c('0x4')][_0x0a0c('0x5')]({'port':0x2329});client[_0x0a0c('0x6')]=function(_0x15a906,_0x1d2041){return new BPromise(function(_0x1dedca,_0x2261ed){return client[_0x0a0c('0x7')](_0x15a906,_0x1d2041)[_0x0a0c('0x8')](function(_0x3920e7){logger[_0x0a0c('0x9')]('rpc',_0x0a0c('0x3'),_0x15a906,_0x1d2041,_0x3920e7);if(_0x3920e7[_0x0a0c('0xa')]){logger[_0x0a0c('0xa')](_0x0a0c('0xb'),_0x0a0c('0x3'),_0x15a906,_0x3920e7[_0x0a0c('0xa')][_0x0a0c('0xc')],_0x1d2041);return _0x2261ed(_0x3920e7['error']['message']);}else{return _0x1dedca(_0x3920e7['result']);}})[_0x0a0c('0xd')](function(_0x13f5c4){logger[_0x0a0c('0xa')](_0x0a0c('0xb'),_0x0a0c('0x3'),_0x15a906,_0x13f5c4,_0x1d2041);return _0x2261ed(_0x13f5c4);});});};module[_0x0a0c('0xe')]=client;
\ No newline at end of file
index 90a3f43..010f02c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26c6=['bluebird','./server','./rpc/mailAccount','then','initMailAccounts','refresh','mailAccounts','listen','getSettings','catch','log'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x26c6,0x84));var _0x626c=function(_0x7ccba,_0x11728f){_0x7ccba=_0x7ccba-0x0;var _0x46755f=_0x26c6[_0x7ccba];return _0x46755f;};'use strict';var BPromise=require(_0x626c('0x0'));var server=require(_0x626c('0x1'));var Realtime=require('./realtime');var EmailChannel=require('./lib/email');var mailAccount=require(_0x626c('0x2'));var setting=require('./rpc/setting');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise['resolve']()[_0x626c('0x3')](mailAccount['getMailAccounts']())['then'](realtime[_0x626c('0x4')]())[_0x626c('0x3')](function(){email[_0x626c('0x5')](realtime[_0x626c('0x6')]);return realtime;});}function main(){return server[_0x626c('0x7')](realtime,email)[_0x626c('0x3')](function(){return initRealtime();})[_0x626c('0x3')](function(){return setting[_0x626c('0x8')]();})[_0x626c('0x3')](function(_0x3854fe){return setInterval(initRealtime,_0x3854fe['loginMailFrequency']*0x3e8);})[_0x626c('0x9')](function(_0x2bd228){console[_0x626c('0xa')](_0x2bd228);});}main();
\ No newline at end of file
+var _0xc9fd=['getSettings','loginMailFrequency','catch','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','initMailAccounts','refresh','listen'];(function(_0x406cbd,_0x543b81){var _0x1b9e14=function(_0x2b95c0){while(--_0x2b95c0){_0x406cbd['push'](_0x406cbd['shift']());}};_0x1b9e14(++_0x543b81);}(_0xc9fd,0x13b));var _0xdc9f=function(_0x5ce7de,_0x5f4f06){_0x5ce7de=_0x5ce7de-0x0;var _0x70e403=_0xc9fd[_0x5ce7de];return _0x70e403;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0xdc9f('0x0'));var EmailChannel=require(_0xdc9f('0x1'));var mailAccount=require(_0xdc9f('0x2'));var setting=require(_0xdc9f('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xdc9f('0x4')]()[_0xdc9f('0x5')](mailAccount['getMailAccounts']())['then'](realtime[_0xdc9f('0x6')]())['then'](function(){email[_0xdc9f('0x7')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xdc9f('0x8')](realtime,email)['then'](function(){return initRealtime();})[_0xdc9f('0x5')](function(){return setting[_0xdc9f('0x9')]();})[_0xdc9f('0x5')](function(_0x7dbfe1){return setInterval(initRealtime,_0x7dbfe1[_0xdc9f('0xa')]*0x3e8);})[_0xdc9f('0xb')](function(_0x3b252c){console['log'](_0x3b252c);});}main();
\ No newline at end of file
index 914e9fb..1bd785d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf43=['key','active','Imap','status','messageStatus','total','isNil','stringify','emit','refresh','hasOwnProperty','imapAccounts','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','Smtp','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','./imap','./smtp','info','mailAccounts','smtp','prototype'];(function(_0x190610,_0x3b4481){var _0x3743b7=function(_0x430ea0){while(--_0x430ea0){_0x190610['push'](_0x190610['shift']());}};_0x3743b7(++_0x3b4481);}(_0xcf43,0x128));var _0x3cf4=function(_0x2b42dc,_0x2851f5){_0x2b42dc=_0x2b42dc-0x0;var _0x163702=_0xcf43[_0x2b42dc];return _0x163702;};'use strict';var _=require(_0x3cf4('0x0'));var moment=require(_0x3cf4('0x1'));var BPromise=require(_0x3cf4('0x2'));var md5=require(_0x3cf4('0x3'));var Redis=require(_0x3cf4('0x4'));var config=require(_0x3cf4('0x5'));var logger=require(_0x3cf4('0x6'))(_0x3cf4('0x7'));config['redis']=_['defaults'](config[_0x3cf4('0x8')],{'host':_0x3cf4('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3cf4('0x8')]));var EmailImap=require(_0x3cf4('0xa'));var EmailSmtp=require(_0x3cf4('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x362b41){logger[_0x3cf4('0xc')]('start\x20email\x20channel');this['mailAccounts']=_0x362b41[_0x3cf4('0xd')];this['imapAccounts']={};this[_0x3cf4('0xe')]=new EmailSmtp();}EmailChannel[_0x3cf4('0xf')]['emit']=function(_0x104675){var _0x361b61=this['mailAccounts'][_0x104675];var _0x3f1344={'id':_0x361b61['id'],'name':_0x361b61['name'],'key':_0x361b61[_0x3cf4('0x10')],'active':_0x361b61[_0x3cf4('0x11')],'Imap':{'status':_0x361b61[_0x3cf4('0x12')][_0x3cf4('0x13')],'messageStatus':_0x361b61[_0x3cf4('0x12')][_0x3cf4('0x14')],'total':_0x361b61['Imap'][_0x3cf4('0x15')]}};if(_[_0x3cf4('0x16')](md5Accounts[_0x104675])){md5Accounts[_0x104675]={};}var _0x2d0f1f=md5(JSON[_0x3cf4('0x17')](_0x3f1344));if(md5Accounts[_0x104675][_0x3cf4('0x3')]!==_0x2d0f1f){md5Accounts[_0x104675][_0x3cf4('0x3')]=_0x2d0f1f;io[_0x3cf4('0x18')]('mailAccount:update',_0x3f1344);}};EmailChannel[_0x3cf4('0xf')][_0x3cf4('0x19')]=function(_0x10f121){for(var _0x4dc210 in _0x10f121){if(_0x10f121[_0x3cf4('0x1a')](_0x4dc210)){if(_0x10f121[_0x4dc210]['Imap']&&_0x10f121[_0x4dc210][_0x3cf4('0x11')]){var _0x570ec3=_0x10f121[_0x4dc210][_0x3cf4('0x12')];if(!this[_0x3cf4('0x1b')][_0x3cf4('0x1a')](_0x570ec3['id'])){this['imapAccounts'][_0x570ec3['id']]=new EmailImap(_0x570ec3,_0x10f121[_0x4dc210][_0x3cf4('0x7')]);this['imapAccounts'][_0x570ec3['id']]['on'](_0x3cf4('0x1c'),this[_0x3cf4('0x1d')][_0x3cf4('0x1e')](this,_0x4dc210));this[_0x3cf4('0x1b')][_0x570ec3['id']]['on'](_0x3cf4('0x7'),this[_0x3cf4('0x1f')]['bind'](this,_0x4dc210));this['imapAccounts'][_0x570ec3['id']]['on'](_0x3cf4('0x20'),this[_0x3cf4('0x21')][_0x3cf4('0x1e')](this,_0x4dc210));this[_0x3cf4('0x1b')][_0x570ec3['id']]['on'](_0x3cf4('0x22'),this[_0x3cf4('0x23')][_0x3cf4('0x1e')](this,_0x4dc210));}}else{if(_[_0x3cf4('0x16')](this[_0x3cf4('0xd')][_0x4dc210][_0x3cf4('0x12')])){this[_0x3cf4('0xd')][_0x4dc210][_0x3cf4('0x12')]={};}this[_0x3cf4('0xd')][_0x4dc210][_0x3cf4('0x12')]['status']='disabled';this[_0x3cf4('0xd')][_0x4dc210]['Imap'][_0x3cf4('0x14')]='';this[_0x3cf4('0x18')](_0x4dc210);}}}};EmailChannel[_0x3cf4('0xf')][_0x3cf4('0x1d')]=function(_0x5ac67b,_0x2d3bdc){if(this[_0x3cf4('0xd')][_0x5ac67b]){this['mailAccounts'][_0x5ac67b][_0x3cf4('0x12')][_0x3cf4('0x13')]=_0x3cf4('0x24');this[_0x3cf4('0xd')][_0x5ac67b][_0x3cf4('0x12')][_0x3cf4('0x14')]=_0x2d3bdc[_0x3cf4('0x25')];if(_0x2d3bdc[_0x3cf4('0x26')]){this[_0x3cf4('0xd')][_0x5ac67b][_0x3cf4('0x12')][_0x3cf4('0x15')]=_0x2d3bdc['messages']['total'];}return this[_0x3cf4('0x18')](_0x5ac67b);}};EmailChannel['prototype'][_0x3cf4('0x1f')]=function(_0x3c1c07,_0x1c12d9){logger[_0x3cf4('0xc')](_0x3cf4('0x27'),_0x1c12d9[_0x3cf4('0x28')],_0x1c12d9[_0x3cf4('0x29')],_0x1c12d9[_0x3cf4('0x2a')],_0x3c1c07);if(this['mailAccounts'][_0x3c1c07]){return mailAccount['notify'](_0x3c1c07,_0x1c12d9)[_0x3cf4('0x2b')](function(_0x367dc1){if(_0x367dc1){logger['info'](_0x3cf4('0x2c'));}})[_0x3cf4('0x2d')](function(_0x403729){logger['error'](_0x3cf4('0x2e'),JSON[_0x3cf4('0x17')](_0x403729));});}};EmailChannel[_0x3cf4('0xf')][_0x3cf4('0x21')]=function(_0x22a331){if(this[_0x3cf4('0xd')][_0x22a331]&&this[_0x3cf4('0xd')][_0x22a331][_0x3cf4('0x12')]){if(this[_0x3cf4('0x1b')][this['mailAccounts'][_0x22a331][_0x3cf4('0x12')]['id']]){delete this[_0x3cf4('0x1b')][this[_0x3cf4('0xd')][_0x22a331]['Imap']['id']];}this['mailAccounts'][_0x22a331][_0x3cf4('0x12')][_0x3cf4('0x2f')]=moment();this[_0x3cf4('0x18')](_0x22a331);}};EmailChannel[_0x3cf4('0xf')][_0x3cf4('0x23')]=function(_0x37d8e5,_0x31f23c){if(this[_0x3cf4('0xd')][_0x37d8e5]){this[_0x3cf4('0xd')][_0x37d8e5]['Imap']['status']='error';this[_0x3cf4('0xd')][_0x37d8e5][_0x3cf4('0x12')][_0x3cf4('0x14')]=_0x31f23c;return this[_0x3cf4('0x18')](_0x37d8e5);}};EmailChannel[_0x3cf4('0xf')][_0x3cf4('0x30')]=function(_0x3d6c2b,_0x2e91e3){return this[_0x3cf4('0xe')][_0x3cf4('0x31')](_0x3d6c2b,_0x2e91e3);};EmailChannel['prototype']['verifySmtp']=function(_0x4b323c){var _0x3d6eec=this;if(this[_0x3cf4('0xd')][_0x4b323c['id']]){if(_['isNil'](this[_0x3cf4('0xd')][_0x4b323c['id']][_0x3cf4('0x32')])){this[_0x3cf4('0xd')][_0x4b323c['id']]['Smtp']={};}this[_0x3cf4('0xd')][_0x4b323c['id']][_0x3cf4('0x32')][_0x3cf4('0x2f')]=moment();return new BPromise(function(_0x59033e,_0xa4df50){return _0x3d6eec[_0x3cf4('0xe')]['verify'](_0x4b323c)['then'](function(_0x2aea06){_0x3d6eec[_0x3cf4('0xd')][_0x4b323c['id']][_0x3cf4('0x32')][_0x3cf4('0x13')]='verified';_0x3d6eec['mailAccounts'][_0x4b323c['id']][_0x3cf4('0x32')][_0x3cf4('0x14')]='';_0x3d6eec[_0x3cf4('0x18')](_0x4b323c['id']);_0x59033e(_0x2aea06);})['catch'](function(_0x110477){_0x3d6eec[_0x3cf4('0xd')][_0x4b323c['id']][_0x3cf4('0x32')][_0x3cf4('0x13')]='error';_0x3d6eec[_0x3cf4('0xd')][_0x4b323c['id']][_0x3cf4('0x32')][_0x3cf4('0x14')]=_0x110477;_0x3d6eec[_0x3cf4('0x18')](_0x4b323c['id']);_0xa4df50(_0x110477);});});}return this[_0x3cf4('0xe')]['verify'](_0x4b323c);};module[_0x3cf4('0x33')]=EmailChannel;
\ No newline at end of file
+var _0x2971=['disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','notify','then','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','handleImapError','sendMail','smtp','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','localhost','./imap','info','mailAccounts','imapAccounts','emit','name','key','Imap','status','messageStatus','total','isNil','mailAccount:update','prototype','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error'];(function(_0x487613,_0x190716){var _0x30cc0d=function(_0x2db637){while(--_0x2db637){_0x487613['push'](_0x487613['shift']());}};_0x30cc0d(++_0x190716);}(_0x2971,0xe8));var _0x1297=function(_0x2773c5,_0x28a7da){_0x2773c5=_0x2773c5-0x0;var _0x5c5e48=_0x2971[_0x2773c5];return _0x5c5e48;};'use strict';var _=require(_0x1297('0x0'));var moment=require(_0x1297('0x1'));var BPromise=require(_0x1297('0x2'));var md5=require(_0x1297('0x3'));var Redis=require(_0x1297('0x4'));var config=require('../../../config/environment');var logger=require(_0x1297('0x5'))(_0x1297('0x6'));config[_0x1297('0x7')]=_[_0x1297('0x8')](config['redis'],{'host':_0x1297('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1297('0x7')]));var EmailImap=require(_0x1297('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x3e31fa){logger[_0x1297('0xb')]('start\x20email\x20channel');this[_0x1297('0xc')]=_0x3e31fa[_0x1297('0xc')];this[_0x1297('0xd')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype'][_0x1297('0xe')]=function(_0xd46e6a){var _0x5e0053=this[_0x1297('0xc')][_0xd46e6a];var _0x48a917={'id':_0x5e0053['id'],'name':_0x5e0053[_0x1297('0xf')],'key':_0x5e0053[_0x1297('0x10')],'active':_0x5e0053['active'],'Imap':{'status':_0x5e0053[_0x1297('0x11')][_0x1297('0x12')],'messageStatus':_0x5e0053['Imap'][_0x1297('0x13')],'total':_0x5e0053[_0x1297('0x11')][_0x1297('0x14')]}};if(_[_0x1297('0x15')](md5Accounts[_0xd46e6a])){md5Accounts[_0xd46e6a]={};}var _0x21338e=md5(JSON['stringify'](_0x48a917));if(md5Accounts[_0xd46e6a]['md5']!==_0x21338e){md5Accounts[_0xd46e6a][_0x1297('0x3')]=_0x21338e;io[_0x1297('0xe')](_0x1297('0x16'),_0x48a917);}};EmailChannel[_0x1297('0x17')][_0x1297('0x18')]=function(_0x1e1456){for(var _0x3ac34e in _0x1e1456){if(_0x1e1456[_0x1297('0x19')](_0x3ac34e)){if(_0x1e1456[_0x3ac34e]['Imap']&&_0x1e1456[_0x3ac34e]['active']){var _0x52f915=_0x1e1456[_0x3ac34e][_0x1297('0x11')];if(!this[_0x1297('0xd')][_0x1297('0x19')](_0x52f915['id'])){this[_0x1297('0xd')][_0x52f915['id']]=new EmailImap(_0x52f915,_0x1e1456[_0x3ac34e][_0x1297('0x6')]);this[_0x1297('0xd')][_0x52f915['id']]['on'](_0x1297('0x1a'),this[_0x1297('0x1b')][_0x1297('0x1c')](this,_0x3ac34e));this[_0x1297('0xd')][_0x52f915['id']]['on'](_0x1297('0x6'),this[_0x1297('0x1d')]['bind'](this,_0x3ac34e));this[_0x1297('0xd')][_0x52f915['id']]['on'](_0x1297('0x1e'),this[_0x1297('0x1f')][_0x1297('0x1c')](this,_0x3ac34e));this[_0x1297('0xd')][_0x52f915['id']]['on'](_0x1297('0x20'),this['handleImapError'][_0x1297('0x1c')](this,_0x3ac34e));}}else{if(_[_0x1297('0x15')](this[_0x1297('0xc')][_0x3ac34e][_0x1297('0x11')])){this['mailAccounts'][_0x3ac34e][_0x1297('0x11')]={};}this['mailAccounts'][_0x3ac34e][_0x1297('0x11')][_0x1297('0x12')]=_0x1297('0x21');this[_0x1297('0xc')][_0x3ac34e][_0x1297('0x11')][_0x1297('0x13')]='';this[_0x1297('0xe')](_0x3ac34e);}}}};EmailChannel[_0x1297('0x17')][_0x1297('0x1b')]=function(_0x42431d,_0x1a5233){if(this[_0x1297('0xc')][_0x42431d]){this['mailAccounts'][_0x42431d][_0x1297('0x11')]['status']=_0x1297('0x22');this[_0x1297('0xc')][_0x42431d][_0x1297('0x11')][_0x1297('0x13')]=_0x1a5233[_0x1297('0xf')];if(_0x1a5233[_0x1297('0x23')]){this[_0x1297('0xc')][_0x42431d][_0x1297('0x11')][_0x1297('0x14')]=_0x1a5233[_0x1297('0x23')][_0x1297('0x14')];}return this['emit'](_0x42431d);}};EmailChannel['prototype'][_0x1297('0x1d')]=function(_0x5b28f3,_0x32ccaa){logger[_0x1297('0xb')](_0x1297('0x24'),_0x32ccaa[_0x1297('0x25')],_0x32ccaa['lastName'],_0x32ccaa['from'],_0x5b28f3);if(this[_0x1297('0xc')][_0x5b28f3]){return mailAccount[_0x1297('0x26')](_0x5b28f3,_0x32ccaa)[_0x1297('0x27')](function(_0x27e46a){if(_0x27e46a){logger[_0x1297('0xb')](_0x1297('0x28'));}})[_0x1297('0x29')](function(_0x46f78d){logger['error'](_0x1297('0x2a'),JSON[_0x1297('0x2b')](_0x46f78d));});}};EmailChannel['prototype'][_0x1297('0x1f')]=function(_0x56c725){if(this[_0x1297('0xc')][_0x56c725]&&this[_0x1297('0xc')][_0x56c725]['Imap']){if(this[_0x1297('0xd')][this[_0x1297('0xc')][_0x56c725][_0x1297('0x11')]['id']]){delete this[_0x1297('0xd')][this['mailAccounts'][_0x56c725]['Imap']['id']];}this['mailAccounts'][_0x56c725][_0x1297('0x11')][_0x1297('0x2c')]=moment();this[_0x1297('0xe')](_0x56c725);}};EmailChannel[_0x1297('0x17')][_0x1297('0x2d')]=function(_0x224d92,_0x426b55){if(this[_0x1297('0xc')][_0x224d92]){this[_0x1297('0xc')][_0x224d92]['Imap'][_0x1297('0x12')]=_0x1297('0x20');this[_0x1297('0xc')][_0x224d92][_0x1297('0x11')][_0x1297('0x13')]=_0x426b55;return this['emit'](_0x224d92);}};EmailChannel['prototype'][_0x1297('0x2e')]=function(_0xa9ec6e,_0x256062){return this[_0x1297('0x2f')][_0x1297('0x30')](_0xa9ec6e,_0x256062);};EmailChannel[_0x1297('0x17')][_0x1297('0x31')]=function(_0x7aac27){var _0x34127c=this;if(this[_0x1297('0xc')][_0x7aac27['id']]){if(_[_0x1297('0x15')](this[_0x1297('0xc')][_0x7aac27['id']][_0x1297('0x32')])){this['mailAccounts'][_0x7aac27['id']][_0x1297('0x32')]={};}this[_0x1297('0xc')][_0x7aac27['id']][_0x1297('0x32')][_0x1297('0x2c')]=moment();return new BPromise(function(_0x34a658,_0x5789c8){return _0x34127c[_0x1297('0x2f')][_0x1297('0x33')](_0x7aac27)[_0x1297('0x27')](function(_0xac2cb3){_0x34127c[_0x1297('0xc')][_0x7aac27['id']]['Smtp'][_0x1297('0x12')]='verified';_0x34127c[_0x1297('0xc')][_0x7aac27['id']][_0x1297('0x32')]['messageStatus']='';_0x34127c['emit'](_0x7aac27['id']);_0x34a658(_0xac2cb3);})['catch'](function(_0x5614e8){_0x34127c['mailAccounts'][_0x7aac27['id']]['Smtp']['status']=_0x1297('0x20');_0x34127c[_0x1297('0xc')][_0x7aac27['id']][_0x1297('0x32')]['messageStatus']=_0x5614e8;_0x34127c[_0x1297('0xe')](_0x7aac27['id']);_0x5789c8(_0x5614e8);});});}return this[_0x1297('0x2f')][_0x1297('0x33')](_0x7aac27);};module[_0x1297('0x34')]=EmailChannel;
\ No newline at end of file
index 9ca3309..c10585c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89c4=['upperFirst','exports','path','util','lodash','simpleParser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','mailbox','INBOX','imap','once','ready','handleReady','bind','end','error','inherits','getAccount','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','prototype','openBox','handleOpenBox','handleError','box','readUnseen','handleCloseBox','search','UNSEEN','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','email','emit','account','stringify','textCode','hasOwnProperty'];(function(_0x2d4cbf,_0x40a520){var _0x3dbbad=function(_0x4d95f3){while(--_0x4d95f3){_0x2d4cbf['push'](_0x2d4cbf['shift']());}};_0x3dbbad(++_0x40a520);}(_0x89c4,0x82));var _0x489c=function(_0x207524,_0x5b9dd){_0x207524=_0x207524-0x0;var _0x425dff=_0x89c4[_0x207524];return _0x425dff;};'use strict';var fs=require('fs');var path=require(_0x489c('0x0'));var util=require(_0x489c('0x1'));var Imap=require('imap');var _=require(_0x489c('0x2'));var rs=require('randomstring');var simpleParser=require('mailparser')[_0x489c('0x3')];var Iconv=require(_0x489c('0x4'))[_0x489c('0x5')];var EventEmitter=require(_0x489c('0x6'))[_0x489c('0x7')];var utils=require(_0x489c('0x8'));var logger=require(_0x489c('0x9'))('email');function EmailImap(_0xe5e402,_0x476dfe){this[_0x489c('0xa')]=_0x489c('0xb');this['account']=this['getAccount'](_0xe5e402,_0x476dfe);this[_0x489c('0xc')]=new Imap(this['account']);this[_0x489c('0xc')][_0x489c('0xd')](_0x489c('0xe'),this[_0x489c('0xf')][_0x489c('0x10')](this));this[_0x489c('0xc')][_0x489c('0xd')](_0x489c('0x11'),this['handleEnd'][_0x489c('0x10')](this));this['imap']['on'](_0x489c('0x12'),this['handleError']['bind'](this));this[_0x489c('0xc')]['connect']();}util[_0x489c('0x13')](EmailImap,EventEmitter);EmailImap['prototype'][_0x489c('0x14')]=function(_0x45983e,_0x5f0703){var _0x179647={'connTimeout':_0x45983e[_0x489c('0x15')]?_0x45983e['connTimeout']*0x3e8:0x2710,'authTimeout':_0x45983e['authTimeout']?_0x45983e[_0x489c('0x16')]*0x3e8:0x1388};if(_['isNil'](_0x45983e[_0x489c('0x17')])){if(_0x45983e[_0x489c('0x18')]){_0x179647[_0x489c('0x19')]=_0x45983e[_0x489c('0x19')];_0x179647[_0x489c('0x1a')]=_0x45983e[_0x489c('0x1a')];}_0x179647[_0x489c('0x1b')]=_0x45983e[_0x489c('0x1b')];_0x179647[_0x489c('0x1c')]=_0x45983e[_0x489c('0x1c')]||0x3e1;if(_0x45983e[_0x489c('0x1d')]){_0x179647[_0x489c('0x1d')]=!![];}else{_0x179647[_0x489c('0x1d')]=![];_0x179647[_0x489c('0x1e')]=_0x489c('0x1f');}}else{_0x179647[_0x489c('0x19')]=_0x45983e[_0x489c('0x19')];_0x179647[_0x489c('0x1a')]=_0x45983e['password'];_0x179647[_0x489c('0x1b')]=utils[_0x489c('0x20')](_0x45983e[_0x489c('0x17')]);_0x179647[_0x489c('0x1c')]=0x3e1;_0x179647[_0x489c('0x1d')]=!![];}_0x179647['email']=_0x5f0703||_0x45983e[_0x489c('0x19')]||_0x489c('0x21');return _0x179647;};EmailImap[_0x489c('0x22')]['handleReady']=function(){this[_0x489c('0xc')][_0x489c('0x23')](this['mailbox'],![],this[_0x489c('0x24')][_0x489c('0x10')](this));};EmailImap['prototype'][_0x489c('0x24')]=function(_0x4cb1ae,_0x3aab5b){if(_0x4cb1ae){this[_0x489c('0x25')](_0x4cb1ae,!![]);}else{this['emit'](_0x489c('0x26'),_0x3aab5b);this[_0x489c('0x27')]();}};EmailImap[_0x489c('0x22')][_0x489c('0x28')]=function(_0x5285e4){if(_0x5285e4){this[_0x489c('0x25')](_0x5285e4,!![]);}else{this['imap'][_0x489c('0x11')]();}};EmailImap[_0x489c('0x22')][_0x489c('0x27')]=function(){this[_0x489c('0xc')][_0x489c('0x29')]([_0x489c('0x2a')],this['handleReadUnseen'][_0x489c('0x10')](this));};EmailImap[_0x489c('0x22')]['handleReadUnseen']=function(_0x445d7d,_0x299fcf){if(_0x445d7d){this['handleError'](_0x445d7d,!![]);}else{if(_0x299fcf[_0x489c('0x2b')]){try{var _0x21d1ec=this[_0x489c('0xc')][_0x489c('0x2c')](_0x299fcf,{'bodies':'','markSeen':!![]});_0x21d1ec['on']('message',this[_0x489c('0x2d')][_0x489c('0x10')](this));_0x21d1ec['once'](_0x489c('0x12'),this[_0x489c('0x2e')][_0x489c('0x10')](this));_0x21d1ec['once'](_0x489c('0x11'),this[_0x489c('0x2f')][_0x489c('0x10')](this));}catch(_0x157760){logger[_0x489c('0x12')](_0x157760);}}else{this[_0x489c('0xc')][_0x489c('0x30')](!![],this[_0x489c('0x28')]['bind'](this));}}};EmailImap[_0x489c('0x22')][_0x489c('0x2d')]=function(_0x3814af,_0xcab953){_0x3814af['on'](_0x489c('0x31'),this[_0x489c('0x32')][_0x489c('0x10')](this));_0x3814af[_0x489c('0xd')](_0x489c('0x33'),this[_0x489c('0x34')]['bind'](this));_0x3814af[_0x489c('0xd')]('end',this[_0x489c('0x35')][_0x489c('0x10')](this));};EmailImap[_0x489c('0x22')][_0x489c('0x32')]=function(_0x562e23,_0x349f8e){simpleParser(_0x562e23,{'Iconv':Iconv},this[_0x489c('0x36')][_0x489c('0x10')](this));};EmailImap[_0x489c('0x22')][_0x489c('0x34')]=function(_0x2c65a6){};EmailImap[_0x489c('0x22')]['handleMessageEnd']=function(){};EmailImap[_0x489c('0x22')][_0x489c('0x36')]=function(_0x290043,_0x21750e){if(_0x290043){logger[_0x489c('0x12')](_0x290043);}else{var _0x5b508c=this;utils[_0x489c('0x37')](this['account'],_0x21750e,function(_0x21cd87){_0x5b508c['emit'](_0x489c('0x38'),_0x21cd87);});}};EmailImap[_0x489c('0x22')][_0x489c('0x2f')]=function(){this[_0x489c('0xc')][_0x489c('0x30')](!![],this[_0x489c('0x28')][_0x489c('0x10')](this));};EmailImap[_0x489c('0x22')][_0x489c('0x2e')]=function(_0x44bf35){this[_0x489c('0x25')](_0x44bf35);this[_0x489c('0xc')][_0x489c('0x30')](!![],this[_0x489c('0x28')][_0x489c('0x10')](this));};EmailImap['prototype']['handleEnd']=function(){this[_0x489c('0x39')](_0x489c('0x11'));};EmailImap[_0x489c('0x22')][_0x489c('0x25')]=function(_0x583c85,_0xea1236){logger[_0x489c('0x12')]('handleError',this[_0x489c('0x3a')]['email'],JSON[_0x489c('0x3b')](_0x583c85));var _0x5d6692='';if(_0x583c85){if(_0x583c85[_0x489c('0x3c')]){_0x5d6692=_0x583c85[_0x489c('0x3c')];}else{for(var _0xb55670 in _0x583c85){if(_0x583c85[_0x489c('0x3d')](_0xb55670)){_0x5d6692+=_[_0x489c('0x3e')](_0xb55670)+':\x20'+_0x583c85[_0xb55670]+'\x0a';}}}}if(_0xea1236){this[_0x489c('0xc')][_0x489c('0x11')]();}else{this[_0x489c('0x39')](_0x489c('0x12'),_0x5d6692);this[_0x489c('0x39')](_0x489c('0x11'));}};module[_0x489c('0x3f')]=EmailImap;
\ No newline at end of file
+var _0x59ae=['connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','openBox','handleOpenBox','emit','readUnseen','UNSEEN','handleReadUnseen','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','Iconv','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','handleReady','bind','end','handleEnd','error','handleError'];(function(_0x418225,_0x52e214){var _0x4bd3d3=function(_0x4904df){while(--_0x4904df){_0x418225['push'](_0x418225['shift']());}};_0x4bd3d3(++_0x52e214);}(_0x59ae,0xa4));var _0xe59a=function(_0x180ab4,_0xce5eda){_0x180ab4=_0x180ab4-0x0;var _0x2918f6=_0x59ae[_0x180ab4];return _0x2918f6;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xe59a('0x0'));var Imap=require(_0xe59a('0x1'));var _=require(_0xe59a('0x2'));var rs=require(_0xe59a('0x3'));var simpleParser=require(_0xe59a('0x4'))[_0xe59a('0x5')];var Iconv=require(_0xe59a('0x6'))[_0xe59a('0x7')];var EventEmitter=require('events')['EventEmitter'];var utils=require('./utils');var logger=require(_0xe59a('0x8'))(_0xe59a('0x9'));function EmailImap(_0x1f38b8,_0x29edb0){this[_0xe59a('0xa')]=_0xe59a('0xb');this[_0xe59a('0xc')]=this[_0xe59a('0xd')](_0x1f38b8,_0x29edb0);this[_0xe59a('0x1')]=new Imap(this['account']);this['imap'][_0xe59a('0xe')](_0xe59a('0xf'),this[_0xe59a('0x10')][_0xe59a('0x11')](this));this[_0xe59a('0x1')][_0xe59a('0xe')](_0xe59a('0x12'),this[_0xe59a('0x13')][_0xe59a('0x11')](this));this['imap']['on'](_0xe59a('0x14'),this[_0xe59a('0x15')][_0xe59a('0x11')](this));this['imap'][_0xe59a('0x16')]();}util[_0xe59a('0x17')](EmailImap,EventEmitter);EmailImap[_0xe59a('0x18')]['getAccount']=function(_0x3fd724,_0x3f41f8){var _0x2076f1={'connTimeout':_0x3fd724['connTimeout']?_0x3fd724[_0xe59a('0x19')]*0x3e8:0x2710,'authTimeout':_0x3fd724[_0xe59a('0x1a')]?_0x3fd724['authTimeout']*0x3e8:0x1388};if(_[_0xe59a('0x1b')](_0x3fd724[_0xe59a('0x1c')])){if(_0x3fd724[_0xe59a('0x1d')]){_0x2076f1[_0xe59a('0x1e')]=_0x3fd724[_0xe59a('0x1e')];_0x2076f1[_0xe59a('0x1f')]=_0x3fd724[_0xe59a('0x1f')];}_0x2076f1[_0xe59a('0x20')]=_0x3fd724[_0xe59a('0x20')];_0x2076f1[_0xe59a('0x21')]=_0x3fd724[_0xe59a('0x21')]||0x3e1;if(_0x3fd724[_0xe59a('0x22')]){_0x2076f1[_0xe59a('0x22')]=!![];}else{_0x2076f1[_0xe59a('0x22')]=![];_0x2076f1[_0xe59a('0x23')]=_0xe59a('0x24');}}else{_0x2076f1['user']=_0x3fd724[_0xe59a('0x1e')];_0x2076f1[_0xe59a('0x1f')]=_0x3fd724['password'];_0x2076f1[_0xe59a('0x20')]=utils[_0xe59a('0x25')](_0x3fd724[_0xe59a('0x1c')]);_0x2076f1[_0xe59a('0x21')]=0x3e1;_0x2076f1[_0xe59a('0x22')]=!![];}_0x2076f1['email']=_0x3f41f8||_0x3fd724[_0xe59a('0x1e')]||'anonymous@xcally.com';return _0x2076f1;};EmailImap[_0xe59a('0x18')]['handleReady']=function(){this[_0xe59a('0x1')][_0xe59a('0x26')](this[_0xe59a('0xa')],![],this[_0xe59a('0x27')][_0xe59a('0x11')](this));};EmailImap[_0xe59a('0x18')][_0xe59a('0x27')]=function(_0x31c45d,_0x6f4dff){if(_0x31c45d){this[_0xe59a('0x15')](_0x31c45d,!![]);}else{this[_0xe59a('0x28')]('box',_0x6f4dff);this[_0xe59a('0x29')]();}};EmailImap[_0xe59a('0x18')]['handleCloseBox']=function(_0x184bf6){if(_0x184bf6){this[_0xe59a('0x15')](_0x184bf6,!![]);}else{this['imap'][_0xe59a('0x12')]();}};EmailImap[_0xe59a('0x18')][_0xe59a('0x29')]=function(){this['imap']['search']([_0xe59a('0x2a')],this[_0xe59a('0x2b')][_0xe59a('0x11')](this));};EmailImap[_0xe59a('0x18')][_0xe59a('0x2b')]=function(_0x1491d1,_0x4442ea){if(_0x1491d1){this[_0xe59a('0x15')](_0x1491d1,!![]);}else{if(_0x4442ea['length']){try{var _0xb0e3c3=this['imap'][_0xe59a('0x2c')](_0x4442ea,{'bodies':'','markSeen':!![]});_0xb0e3c3['on']('message',this[_0xe59a('0x2d')]['bind'](this));_0xb0e3c3[_0xe59a('0xe')](_0xe59a('0x14'),this[_0xe59a('0x2e')][_0xe59a('0x11')](this));_0xb0e3c3[_0xe59a('0xe')](_0xe59a('0x12'),this[_0xe59a('0x2f')][_0xe59a('0x11')](this));}catch(_0x262221){logger[_0xe59a('0x14')](_0x262221);}}else{this[_0xe59a('0x1')][_0xe59a('0x30')](!![],this[_0xe59a('0x31')][_0xe59a('0x11')](this));}}};EmailImap[_0xe59a('0x18')][_0xe59a('0x2d')]=function(_0x551e5a,_0x5cf38b){_0x551e5a['on'](_0xe59a('0x32'),this[_0xe59a('0x33')][_0xe59a('0x11')](this));_0x551e5a[_0xe59a('0xe')](_0xe59a('0x34'),this[_0xe59a('0x35')][_0xe59a('0x11')](this));_0x551e5a[_0xe59a('0xe')](_0xe59a('0x12'),this[_0xe59a('0x36')][_0xe59a('0x11')](this));};EmailImap[_0xe59a('0x18')]['handleMessageBody']=function(_0x2ff63c,_0xeae95e){simpleParser(_0x2ff63c,{'Iconv':Iconv},this[_0xe59a('0x37')][_0xe59a('0x11')](this));};EmailImap[_0xe59a('0x18')][_0xe59a('0x35')]=function(_0xe117d){};EmailImap[_0xe59a('0x18')][_0xe59a('0x36')]=function(){};EmailImap['prototype'][_0xe59a('0x37')]=function(_0x88ab7b,_0x7e806b){if(_0x88ab7b){logger[_0xe59a('0x14')](_0x88ab7b);}else{var _0x3be2e4=this;utils[_0xe59a('0x38')](this[_0xe59a('0xc')],_0x7e806b,function(_0x395e81){_0x3be2e4[_0xe59a('0x28')]('email',_0x395e81);});}};EmailImap[_0xe59a('0x18')][_0xe59a('0x2f')]=function(){this[_0xe59a('0x1')]['closeBox'](!![],this[_0xe59a('0x31')][_0xe59a('0x11')](this));};EmailImap['prototype']['handleFetchError']=function(_0x3f5f77){this[_0xe59a('0x15')](_0x3f5f77);this[_0xe59a('0x1')][_0xe59a('0x30')](!![],this[_0xe59a('0x31')][_0xe59a('0x11')](this));};EmailImap[_0xe59a('0x18')][_0xe59a('0x13')]=function(){this['emit'](_0xe59a('0x12'));};EmailImap[_0xe59a('0x18')][_0xe59a('0x15')]=function(_0x2f8af6,_0x232afb){logger[_0xe59a('0x14')](_0xe59a('0x15'),this['account'][_0xe59a('0x9')],JSON[_0xe59a('0x39')](_0x2f8af6));var _0x31cf64='';if(_0x2f8af6){if(_0x2f8af6[_0xe59a('0x3a')]){_0x31cf64=_0x2f8af6[_0xe59a('0x3a')];}else{for(var _0x3fe3ef in _0x2f8af6){if(_0x2f8af6[_0xe59a('0x3b')](_0x3fe3ef)){_0x31cf64+=_[_0xe59a('0x3c')](_0x3fe3ef)+':\x20'+_0x2f8af6[_0x3fe3ef]+'\x0a';}}}}if(_0x232afb){this['imap'][_0xe59a('0x12')]();}else{this[_0xe59a('0x28')](_0xe59a('0x14'),_0x31cf64);this[_0xe59a('0x28')]('end');}};module[_0xe59a('0x3d')]=EmailImap;
\ No newline at end of file
index 74e8dcd..002cce0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29d9=['prototype','use','compile','sendMail','toString','createTransport','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64'];(function(_0x3f6e9f,_0x2915fe){var _0x40e8a0=function(_0x1e4bcd){while(--_0x1e4bcd){_0x3f6e9f['push'](_0x3f6e9f['shift']());}};_0x40e8a0(++_0x2915fe);}(_0x29d9,0x8d));var _0x929d=function(_0x54d506,_0xabf5c2){_0x54d506=_0x54d506-0x0;var _0x5d3040=_0x29d9[_0x54d506];return _0x5d3040;};'use strict';var nodemailer=require(_0x929d('0x0'));var BPromise=require(_0x929d('0x1'));var inlineBase64=require(_0x929d('0x2'));function EmailSmtp(){}EmailSmtp[_0x929d('0x3')]['send']=function(_0x10fa42,_0x5b61c4){return new BPromise(function(_0x129e07,_0xbb2d40){var _0x477722=nodemailer['createTransport'](_0x10fa42);_0x477722[_0x929d('0x4')](_0x929d('0x5'),inlineBase64());_0x477722[_0x929d('0x6')](_0x5b61c4,function(_0x412aa6,_0x202d81){if(_0x412aa6){_0xbb2d40(_0x412aa6[_0x929d('0x7')]());}else{_0x129e07(_0x202d81);}});});};EmailSmtp['prototype']['verify']=function(_0x4faeb0){return new BPromise(function(_0x3e3f05,_0x4749a4){var _0x276dfb=nodemailer[_0x929d('0x8')](_0x4faeb0);_0x276dfb[_0x929d('0x9')](function(_0x1bcf82,_0x2e9593){if(_0x1bcf82){_0x4749a4(_0x1bcf82[_0x929d('0x7')]());}else{if(_0x2e9593){_0x3e3f05(_0x2e9593);}else{_0x4749a4(_0x929d('0xa'));}}});});};module[_0x929d('0xb')]=EmailSmtp;
\ No newline at end of file
+var _0x54e5=['exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','send','createTransport','compile','sendMail','toString','prototype','verify','Not\x20verifired'];(function(_0xa24985,_0x1d2c15){var _0x2f7c36=function(_0x28219c){while(--_0x28219c){_0xa24985['push'](_0xa24985['shift']());}};_0x2f7c36(++_0x1d2c15);}(_0x54e5,0xb5));var _0x554e=function(_0x3a508a,_0x358c16){_0x3a508a=_0x3a508a-0x0;var _0x5a8c34=_0x54e5[_0x3a508a];return _0x5a8c34;};'use strict';var nodemailer=require(_0x554e('0x0'));var BPromise=require(_0x554e('0x1'));var inlineBase64=require(_0x554e('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0x554e('0x3')]=function(_0x1904c7,_0x27a8ea){return new BPromise(function(_0x1838c6,_0x359662){var _0x5e967c=nodemailer[_0x554e('0x4')](_0x1904c7);_0x5e967c['use'](_0x554e('0x5'),inlineBase64());_0x5e967c[_0x554e('0x6')](_0x27a8ea,function(_0x194b5b,_0x253591){if(_0x194b5b){_0x359662(_0x194b5b[_0x554e('0x7')]());}else{_0x1838c6(_0x253591);}});});};EmailSmtp[_0x554e('0x8')][_0x554e('0x9')]=function(_0xd016f4){return new BPromise(function(_0x3ccf2b,_0xaa520f){var _0x6796c8=nodemailer[_0x554e('0x4')](_0xd016f4);_0x6796c8[_0x554e('0x9')](function(_0x32725a,_0x2fc5ca){if(_0x32725a){_0xaa520f(_0x32725a[_0x554e('0x7')]());}else{if(_0x2fc5ca){_0x3ccf2b(_0x2fc5ca);}else{_0xaa520f(_0x554e('0xa'));}}});});};module[_0x554e('0xb')]=EmailSmtp;
\ No newline at end of file
index 9e90a1c..487be38 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e54=['substring','indexOf','length','slice','join','Anonymous','head','isEmpty','generate','html','test','replace','includes','<img','attachments','push','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','bcc','attach','type','attachment','attachment-','format','%s-%s','now','root','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','isAutoreply','parser','from','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','<p>Empty\x20message</p>','Attachments','Data','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','node-tnef','../../../config/logger','email','value','anonymous','@xcally.com','name','address'];(function(_0x554142,_0x3e7e89){var _0x5a0ae8=function(_0x4f02e6){while(--_0x4f02e6){_0x554142['push'](_0x554142['shift']());}};_0x5a0ae8(++_0x3e7e89);}(_0x9e54,0x88));var _0x49e5=function(_0x2d8935,_0x2c9d2e){_0x2d8935=_0x2d8935-0x0;var _0x2c5156=_0x9e54[_0x2d8935];return _0x2c5156;};'use strict';var _=require(_0x49e5('0x0'));var moment=require(_0x49e5('0x1'));var random=require('randomstring');var fs=require('fs');var path=require('path');var util=require('util');var tnef=require(_0x49e5('0x2'));var logger=require(_0x49e5('0x3'))(_0x49e5('0x4'));var config=require('../../../config/environment');function getAddress(_0x377300){var _0x31b5c4=_['head'](_0x377300[_0x49e5('0x5')]);return _0x31b5c4&&_0x31b5c4['address']?_0x31b5c4['address']:_0x49e5('0x6')+random['generate'](0x6)+_0x49e5('0x7');}function getFirstName(_0x234dd3){var _0x4302ff=_['head'](_0x234dd3['value']);if(_0x4302ff&&_0x4302ff[_0x49e5('0x8')]){if(_0x4302ff['name']==_0x4302ff[_0x49e5('0x9')]){return _0x4302ff[_0x49e5('0x8')][_0x49e5('0xa')](0x0,_0x4302ff[_0x49e5('0x8')][_0x49e5('0xb')]('@'));}var _0x51cf9b=_0x4302ff[_0x49e5('0x8')]['split'](/\s+/);return _0x51cf9b[_0x49e5('0xc')]>0x1?_0x51cf9b[_0x49e5('0xd')](0x0,-0x1)[_0x49e5('0xe')]('\x20'):_0x4302ff[_0x49e5('0x8')];}return _0x49e5('0xf');}function getLastName(_0x56b341){var _0x5545c1=_[_0x49e5('0x10')](_0x56b341[_0x49e5('0x5')]);if(_0x5545c1&&_0x5545c1['name']){var _0x56ae34=_0x5545c1[_0x49e5('0x8')]['split'](/\s+/);return _0x56ae34[_0x49e5('0xc')]>0x1?_0x56ae34['pop']():'';}return'';}function getMails(_0x2cc353,_0x13bc7f){var _0x375488='';for(var _0x568cfb=0x0;_0x568cfb<_0x13bc7f[_0x49e5('0x5')][_0x49e5('0xc')];_0x568cfb+=0x1){if(_0x13bc7f[_0x49e5('0x5')][_0x568cfb][_0x49e5('0x9')]!==_0x2cc353){if(!_[_0x49e5('0x11')](_0x375488)){_0x375488+=',';}_0x375488+=_0x13bc7f[_0x49e5('0x5')][_0x568cfb][_0x49e5('0x8')]||_0x13bc7f['value'][_0x568cfb][_0x49e5('0x9')]||'';_0x375488+='\x20<';_0x375488+=_0x13bc7f[_0x49e5('0x5')][_0x568cfb]['address']?_0x13bc7f[_0x49e5('0x5')][_0x568cfb]['address']:_0x49e5('0x6')+random[_0x49e5('0x12')](0x6)+'@xcally.com';_0x375488+='>';}}return _0x375488;}function parseEmail(_0x136838,_0x41c6d0,_0x31fddc){if(_0x41c6d0[_0x49e5('0x13')]){var _0xe9a50=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0xe9a50[_0x49e5('0x14')](_0x41c6d0['html'])){_0x41c6d0[_0x49e5('0x13')]=_0x41c6d0['html'][_0x49e5('0x15')](_0xe9a50,'');}if(_0x41c6d0[_0x49e5('0x13')][_0x49e5('0x16')](_0x49e5('0x17'))){var _0x25ecb9=[];_0x41c6d0[_0x49e5('0x18')]['forEach'](_0x4da697=>{_0x25ecb9[_0x49e5('0x19')](_0x4da697[_0x49e5('0x1a')]);});var _0x5531bf=/<img.*? _SRC(.*?)[^>]+>/g;var _0x3a6837=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xba7c12=_0x41c6d0[_0x49e5('0x13')][_0x49e5('0x15')](_0x3a6837,_0x49e5('0x1b'));var _0x21b29a=_0xba7c12['replace'](_0x5531bf,_0x49e5('0x1c'));for(let _0x18db07=0x0;_0x18db07<_0x25ecb9[_0x49e5('0xc')];_0x18db07++){var _0x5d0700=_0x21b29a[_0x49e5('0x15')]('_IMG',_0x49e5('0x1d')+_0x25ecb9[_0x18db07]+_0x49e5('0x1e'));_0x21b29a=_0x5d0700;}_0x41c6d0['html']=_0x21b29a;}_0x31fddc['body']=_0x41c6d0[_0x49e5('0x13')];}else{_0x31fddc[_0x49e5('0x1f')]=_0x41c6d0['textAsHtml'];}if(_0x31fddc[_0x49e5('0x1f')]){_0x31fddc['body']=_0x31fddc[_0x49e5('0x1f')][_0x49e5('0x15')](/<a\s+/gi,_0x49e5('0x20'));}if(_0x41c6d0['to']){_0x31fddc[_0x49e5('0x21')][_0x49e5('0x22')]=getMails(null,_0x41c6d0['to']);var _0x5838fb=getMails(_0x136838[_0x49e5('0x4')],_0x41c6d0['to']);if(!_[_0x49e5('0x11')](_0x5838fb)){_0x31fddc[_0x49e5('0x21')]['cc']+=_0x5838fb;}}if(_0x41c6d0['cc']){_0x31fddc[_0x49e5('0x21')][_0x49e5('0x23')]=getMails(null,_0x41c6d0['cc']);var _0x53c2fc=getMails(_0x136838[_0x49e5('0x4')],_0x41c6d0['cc']);if(!_[_0x49e5('0x11')](_0x53c2fc)){if(!_['isEmpty'](_0x31fddc[_0x49e5('0x21')]['cc'])){_0x31fddc['message']['cc']+=',';}_0x31fddc['message']['cc']+=_0x53c2fc;}}if(!_[_0x49e5('0x16')](_0x31fddc[_0x49e5('0x21')]['originTo'],_0x136838['email'])&&!_[_0x49e5('0x16')](_0x31fddc['message'][_0x49e5('0x23')],_0x136838[_0x49e5('0x4')])){_0x31fddc[_0x49e5('0x21')][_0x49e5('0x24')]=_0x136838[_0x49e5('0x4')];}if(_0x41c6d0[_0x49e5('0x18')]&&_0x41c6d0[_0x49e5('0x18')][_0x49e5('0xc')]){_0x31fddc[_0x49e5('0x21')][_0x49e5('0x25')]=_0x41c6d0['attachments'][_0x49e5('0xc')];for(var _0x4cf7a2=0x0,_0x56cb2d,_0x382b0a,_0x165981;_0x4cf7a2<_0x41c6d0[_0x49e5('0x18')][_0x49e5('0xc')];_0x4cf7a2+=0x1){if(_0x41c6d0[_0x49e5('0x18')][_0x4cf7a2][_0x49e5('0x26')]===_0x49e5('0x27')){_0x165981=_0x41c6d0[_0x49e5('0x18')][_0x4cf7a2][_0x49e5('0x1a')]||_0x49e5('0x28')+_0x4cf7a2;_0x56cb2d=util[_0x49e5('0x29')](_0x49e5('0x2a'),Date[_0x49e5('0x2b')](),_0x165981);_0x382b0a=path[_0x49e5('0xe')](config[_0x49e5('0x2c')],'server/files/attachments/',_0x56cb2d);fs[_0x49e5('0x2d')](_0x382b0a,_0x41c6d0['attachments'][_0x4cf7a2][_0x49e5('0x2e')]);_0x31fddc[_0x49e5('0x21')]['attachments'][_0x49e5('0x19')]({'name':_0x165981,'basename':_0x56cb2d,'type':_0x41c6d0[_0x49e5('0x18')][_0x4cf7a2]['contentType'],'filepath':_0x382b0a});}}}if(_0x41c6d0[_0x49e5('0x2f')]&&_0x41c6d0['headerLines'][_0x49e5('0xc')]>0x0){var _0x394bf8=[_0x49e5('0x30'),'X-Auto-Response-Suppress:\x20All',_0x49e5('0x31')];for(var _0x1fbbcf=0x0;_0x1fbbcf<_0x41c6d0[_0x49e5('0x2f')]['length'];_0x1fbbcf++){var _0x45a3bf=_['indexOf'](_0x394bf8,_0x41c6d0[_0x49e5('0x2f')][_0x1fbbcf]['line']);if(_0x45a3bf>=0x0){_0x31fddc[_0x49e5('0x32')]=!![];}}}return _0x31fddc;}exports[_0x49e5('0x33')]=function(_0x3fbf05,_0x334ad3,_0x95f8f1){var _0x13fbb6={'from':getAddress(_0x334ad3[_0x49e5('0x34')]),'firstName':getFirstName(_0x334ad3[_0x49e5('0x34')]),'lastName':getLastName(_0x334ad3[_0x49e5('0x34')]),'mapKey':_0x49e5('0x4'),'message':{'from':getMails(_0x3fbf05['email'],_0x334ad3[_0x49e5('0x34')]),'to':_0x3fbf05[_0x49e5('0x4')],'cc':'','subject':_0x334ad3['subject']||'','messageId':_0x334ad3[_0x49e5('0x35')],'inReplyTo':_0x334ad3[_0x49e5('0x36')],'sentAt':moment(_0x334ad3[_0x49e5('0x37')])['format'](_0x49e5('0x38')),'attach':![],'attachments':[]}};if(!_0x334ad3[_0x49e5('0x13')]&&!_0x334ad3['textAsHtml']){var _0x2e9024=_[_0x49e5('0x39')](_0x334ad3[_0x49e5('0x18')],{'contentType':'application/ms-tnef'});if(_0x2e9024[_0x49e5('0xc')]){logger[_0x49e5('0x3a')](util[_0x49e5('0x29')](_0x49e5('0x3b'),_0x334ad3[_0x49e5('0x35')]));tnef[_0x49e5('0x3c')](_[_0x49e5('0x3d')](_0x2e9024)[_0x49e5('0x2e')],function(_0x565aad,_0x2422ed){if(_0x2422ed){_0x334ad3[_0x49e5('0x13')]=_0x2422ed[_0x49e5('0x3e')]||_0x49e5('0x3f');if(_0x2422ed[_0x49e5('0x40')]){for(var _0x238f7e=0x0;_0x238f7e<_0x2422ed[_0x49e5('0x40')][_0x49e5('0xc')];_0x238f7e++){var _0x2a47b8=_0x2422ed[_0x49e5('0x40')][_0x238f7e];_0x13fbb6[_0x49e5('0x21')][_0x49e5('0x18')][_0x49e5('0x19')]({'filename':_0x2a47b8['Title'],'content':Buffer[_0x49e5('0x34')](_0x2a47b8[_0x49e5('0x41')])});}}}_0x95f8f1(parseEmail(_0x3fbf05,_0x334ad3,_0x13fbb6));});}else{_0x334ad3[_0x49e5('0x13')]=_0x49e5('0x3f');_0x95f8f1(parseEmail(_0x3fbf05,_0x334ad3,_0x13fbb6));}}else{_0x95f8f1(parseEmail(_0x3fbf05,_0x334ad3,_0x13fbb6));}};exports['getHost']=function(_0x398e33){switch(_0x398e33){case _0x49e5('0x42'):return _0x49e5('0x43');case _0x49e5('0x44'):return'imap.mail.yahoo.com';case _0x49e5('0x45'):return _0x49e5('0x46');case _0x49e5('0x47'):return _0x49e5('0x48');}return'127.0.0.1';};
\ No newline at end of file
+var _0x2da6=['attach','attachment','format','%s-%s','now','server/files/attachments/','writeFileSync','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','parser','from','inReplyTo','date','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','BodyHTML','<p>Empty\x20message</p>','Attachments','Title','Data','getHost','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','pop','html','test','replace','includes','forEach','push','filename','_SRC','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','message','originTo','isEmpty','originCc','bcc','attachments'];(function(_0x4ec3f5,_0xc094e4){var _0x3729f2=function(_0x10f411){while(--_0x10f411){_0x4ec3f5['push'](_0x4ec3f5['shift']());}};_0x3729f2(++_0xc094e4);}(_0x2da6,0x1dd));var _0x62da=function(_0x225b7a,_0x453611){_0x225b7a=_0x225b7a-0x0;var _0x480ea8=_0x2da6[_0x225b7a];return _0x480ea8;};'use strict';var _=require(_0x62da('0x0'));var moment=require(_0x62da('0x1'));var random=require(_0x62da('0x2'));var fs=require('fs');var path=require(_0x62da('0x3'));var util=require(_0x62da('0x4'));var tnef=require(_0x62da('0x5'));var logger=require(_0x62da('0x6'))(_0x62da('0x7'));var config=require('../../../config/environment');function getAddress(_0x4a8428){var _0xe28204=_[_0x62da('0x8')](_0x4a8428[_0x62da('0x9')]);return _0xe28204&&_0xe28204[_0x62da('0xa')]?_0xe28204[_0x62da('0xa')]:_0x62da('0xb')+random[_0x62da('0xc')](0x6)+_0x62da('0xd');}function getFirstName(_0xbfd2b0){var _0x4cfc5d=_[_0x62da('0x8')](_0xbfd2b0[_0x62da('0x9')]);if(_0x4cfc5d&&_0x4cfc5d[_0x62da('0xe')]){if(_0x4cfc5d[_0x62da('0xe')]==_0x4cfc5d['address']){return _0x4cfc5d[_0x62da('0xe')][_0x62da('0xf')](0x0,_0x4cfc5d[_0x62da('0xe')][_0x62da('0x10')]('@'));}var _0x23be32=_0x4cfc5d['name'][_0x62da('0x11')](/\s+/);return _0x23be32[_0x62da('0x12')]>0x1?_0x23be32[_0x62da('0x13')](0x0,-0x1)[_0x62da('0x14')]('\x20'):_0x4cfc5d[_0x62da('0xe')];}return'Anonymous';}function getLastName(_0x47c18e){var _0x3ed16d=_[_0x62da('0x8')](_0x47c18e[_0x62da('0x9')]);if(_0x3ed16d&&_0x3ed16d[_0x62da('0xe')]){var _0x23240e=_0x3ed16d[_0x62da('0xe')][_0x62da('0x11')](/\s+/);return _0x23240e[_0x62da('0x12')]>0x1?_0x23240e[_0x62da('0x15')]():'';}return'';}function getMails(_0xcc1a25,_0x33ec53){var _0x27ab5f='';for(var _0x1f6bc8=0x0;_0x1f6bc8<_0x33ec53[_0x62da('0x9')]['length'];_0x1f6bc8+=0x1){if(_0x33ec53['value'][_0x1f6bc8][_0x62da('0xa')]!==_0xcc1a25){if(!_['isEmpty'](_0x27ab5f)){_0x27ab5f+=',';}_0x27ab5f+=_0x33ec53[_0x62da('0x9')][_0x1f6bc8][_0x62da('0xe')]||_0x33ec53[_0x62da('0x9')][_0x1f6bc8]['address']||'';_0x27ab5f+='\x20<';_0x27ab5f+=_0x33ec53[_0x62da('0x9')][_0x1f6bc8]['address']?_0x33ec53[_0x62da('0x9')][_0x1f6bc8][_0x62da('0xa')]:_0x62da('0xb')+random[_0x62da('0xc')](0x6)+_0x62da('0xd');_0x27ab5f+='>';}}return _0x27ab5f;}function parseEmail(_0x267cef,_0x183033,_0x2f2b66){if(_0x183033[_0x62da('0x16')]){var _0x583fc0=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x583fc0[_0x62da('0x17')](_0x183033[_0x62da('0x16')])){_0x183033[_0x62da('0x16')]=_0x183033[_0x62da('0x16')][_0x62da('0x18')](_0x583fc0,'');}if(_0x183033[_0x62da('0x16')][_0x62da('0x19')]('<img')){var _0x55fd3b=[];_0x183033['attachments'][_0x62da('0x1a')](_0x1d1ef3=>{_0x55fd3b[_0x62da('0x1b')](_0x1d1ef3[_0x62da('0x1c')]);});var _0x4b1237=/<img.*? _SRC(.*?)[^>]+>/g;var _0x2b7daa=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x3b9c06=_0x183033['html'][_0x62da('0x18')](_0x2b7daa,_0x62da('0x1d'));var _0x1775ea=_0x3b9c06['replace'](_0x4b1237,_0x62da('0x1e'));for(let _0x87f92b=0x0;_0x87f92b<_0x55fd3b[_0x62da('0x12')];_0x87f92b++){var _0x54da45=_0x1775ea['replace'](_0x62da('0x1e'),_0x62da('0x1f')+_0x55fd3b[_0x87f92b]+_0x62da('0x20'));_0x1775ea=_0x54da45;}_0x183033['html']=_0x1775ea;}_0x2f2b66[_0x62da('0x21')]=_0x183033[_0x62da('0x16')];}else{_0x2f2b66[_0x62da('0x21')]=_0x183033[_0x62da('0x22')];}if(_0x2f2b66[_0x62da('0x21')]){_0x2f2b66[_0x62da('0x21')]=_0x2f2b66['body'][_0x62da('0x18')](/<a\s+/gi,'<a\x20target=\x22_blank\x22\x20');}if(_0x183033['to']){_0x2f2b66[_0x62da('0x23')][_0x62da('0x24')]=getMails(null,_0x183033['to']);var _0x231a52=getMails(_0x267cef[_0x62da('0x7')],_0x183033['to']);if(!_[_0x62da('0x25')](_0x231a52)){_0x2f2b66[_0x62da('0x23')]['cc']+=_0x231a52;}}if(_0x183033['cc']){_0x2f2b66['message'][_0x62da('0x26')]=getMails(null,_0x183033['cc']);var _0x25dc6d=getMails(_0x267cef[_0x62da('0x7')],_0x183033['cc']);if(!_['isEmpty'](_0x25dc6d)){if(!_[_0x62da('0x25')](_0x2f2b66[_0x62da('0x23')]['cc'])){_0x2f2b66[_0x62da('0x23')]['cc']+=',';}_0x2f2b66['message']['cc']+=_0x25dc6d;}}if(!_[_0x62da('0x19')](_0x2f2b66[_0x62da('0x23')]['originTo'],_0x267cef[_0x62da('0x7')])&&!_[_0x62da('0x19')](_0x2f2b66['message'][_0x62da('0x26')],_0x267cef[_0x62da('0x7')])){_0x2f2b66[_0x62da('0x23')][_0x62da('0x27')]=_0x267cef[_0x62da('0x7')];}if(_0x183033[_0x62da('0x28')]&&_0x183033[_0x62da('0x28')][_0x62da('0x12')]){_0x2f2b66[_0x62da('0x23')][_0x62da('0x29')]=_0x183033[_0x62da('0x28')][_0x62da('0x12')];for(var _0x3057f6=0x0,_0x2b6b56,_0x4bd7b7,_0x2b8487;_0x3057f6<_0x183033[_0x62da('0x28')]['length'];_0x3057f6+=0x1){if(_0x183033[_0x62da('0x28')][_0x3057f6]['type']===_0x62da('0x2a')){_0x2b8487=_0x183033[_0x62da('0x28')][_0x3057f6][_0x62da('0x1c')]||'attachment-'+_0x3057f6;_0x2b6b56=util[_0x62da('0x2b')](_0x62da('0x2c'),Date[_0x62da('0x2d')](),_0x2b8487);_0x4bd7b7=path[_0x62da('0x14')](config['root'],_0x62da('0x2e'),_0x2b6b56);fs[_0x62da('0x2f')](_0x4bd7b7,_0x183033[_0x62da('0x28')][_0x3057f6][_0x62da('0x30')]);_0x2f2b66[_0x62da('0x23')][_0x62da('0x28')][_0x62da('0x1b')]({'name':_0x2b8487,'basename':_0x2b6b56,'type':_0x183033[_0x62da('0x28')][_0x3057f6][_0x62da('0x31')],'filepath':_0x4bd7b7});}}}if(_0x183033['headerLines']&&_0x183033[_0x62da('0x32')][_0x62da('0x12')]>0x0){var _0x584a82=[_0x62da('0x33'),_0x62da('0x34'),_0x62da('0x35')];for(var _0x4387ac=0x0;_0x4387ac<_0x183033[_0x62da('0x32')][_0x62da('0x12')];_0x4387ac++){var _0x473e5c=_[_0x62da('0x10')](_0x584a82,_0x183033['headerLines'][_0x4387ac]['line']);if(_0x473e5c>=0x0){_0x2f2b66['isAutoreply']=!![];}}}return _0x2f2b66;}exports[_0x62da('0x36')]=function(_0x54b49c,_0x86f5a8,_0x4a8fe4){var _0x49d45b={'from':getAddress(_0x86f5a8['from']),'firstName':getFirstName(_0x86f5a8[_0x62da('0x37')]),'lastName':getLastName(_0x86f5a8[_0x62da('0x37')]),'mapKey':'email','message':{'from':getMails(_0x54b49c[_0x62da('0x7')],_0x86f5a8['from']),'to':_0x54b49c[_0x62da('0x7')],'cc':'','subject':_0x86f5a8['subject']||'','messageId':_0x86f5a8['messageId'],'inReplyTo':_0x86f5a8[_0x62da('0x38')],'sentAt':moment(_0x86f5a8[_0x62da('0x39')])[_0x62da('0x2b')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x86f5a8[_0x62da('0x16')]&&!_0x86f5a8[_0x62da('0x22')]){var _0xbe8215=_[_0x62da('0x3a')](_0x86f5a8[_0x62da('0x28')],{'contentType':'application/ms-tnef'});if(_0xbe8215['length']){logger[_0x62da('0x3b')](util[_0x62da('0x2b')](_0x62da('0x3c'),_0x86f5a8[_0x62da('0x3d')]));tnef[_0x62da('0x3e')](_['first'](_0xbe8215)['content'],function(_0x1de958,_0xef94be){if(_0xef94be){_0x86f5a8['html']=_0xef94be[_0x62da('0x3f')]||_0x62da('0x40');if(_0xef94be[_0x62da('0x41')]){for(var _0x29153f=0x0;_0x29153f<_0xef94be[_0x62da('0x41')]['length'];_0x29153f++){var _0x349782=_0xef94be[_0x62da('0x41')][_0x29153f];_0x49d45b[_0x62da('0x23')][_0x62da('0x28')][_0x62da('0x1b')]({'filename':_0x349782[_0x62da('0x42')],'content':Buffer[_0x62da('0x37')](_0x349782[_0x62da('0x43')])});}}}_0x4a8fe4(parseEmail(_0x54b49c,_0x86f5a8,_0x49d45b));});}else{_0x86f5a8[_0x62da('0x16')]='<p>Empty\x20message</p>';_0x4a8fe4(parseEmail(_0x54b49c,_0x86f5a8,_0x49d45b));}}else{_0x4a8fe4(parseEmail(_0x54b49c,_0x86f5a8,_0x49d45b));}};exports[_0x62da('0x44')]=function(_0x169560){switch(_0x169560){case'gmail':return'imap.gmail.com';case'yahoo':return _0x62da('0x45');case _0x62da('0x46'):return _0x62da('0x47');case'outlook365':return _0x62da('0x48');}return _0x62da('0x49');};
\ No newline at end of file
index d790030..610ea24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68bc=['exports','lodash','name','key','SERV','active','Imap','Smtp'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x68bc,0x1a9));var _0xc68b=function(_0x45c1e8,_0x11e7b9){_0x45c1e8=_0x45c1e8-0x0;var _0x22c14e=_0x68bc[_0x45c1e8];return _0x22c14e;};'use strict';var _=require(_0xc68b('0x0'));function MailAccount(_0x4e2523){this['id']=_0x4e2523['id']||0x0;this[_0xc68b('0x1')]=_0x4e2523[_0xc68b('0x1')]||'Service';this['key']=_0x4e2523[_0xc68b('0x2')]||_0xc68b('0x3');this[_0xc68b('0x4')]=_0x4e2523[_0xc68b('0x4')]||![];this['Imap']=_0x4e2523[_0xc68b('0x5')]||[];this[_0xc68b('0x6')]=_0x4e2523[_0xc68b('0x6')]||[];}module[_0xc68b('0x7')]=MailAccount;
\ No newline at end of file
+var _0x176f=['name','Service','key','SERV','active','Smtp','exports','lodash'];(function(_0x57018e,_0x3a8f5d){var _0x5f0e01=function(_0x5afb58){while(--_0x5afb58){_0x57018e['push'](_0x57018e['shift']());}};_0x5f0e01(++_0x3a8f5d);}(_0x176f,0x157));var _0xf176=function(_0x1b82ef,_0x3dd938){_0x1b82ef=_0x1b82ef-0x0;var _0x58c260=_0x176f[_0x1b82ef];return _0x58c260;};'use strict';var _=require(_0xf176('0x0'));function MailAccount(_0x48526c){this['id']=_0x48526c['id']||0x0;this[_0xf176('0x1')]=_0x48526c['name']||_0xf176('0x2');this[_0xf176('0x3')]=_0x48526c[_0xf176('0x3')]||_0xf176('0x4');this[_0xf176('0x5')]=_0x48526c[_0xf176('0x5')]||![];this['Imap']=_0x48526c['Imap']||[];this[_0xf176('0x6')]=_0x48526c[_0xf176('0x6')]||[];}module[_0xf176('0x7')]=MailAccount;
\ No newline at end of file
index 9a79a02..6db3e64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf500=['exports','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','merge'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf500,0x9a));var _0x0f50=function(_0x4e7d25,_0x58285f){_0x4e7d25=_0x4e7d25-0x0;var _0x526fe6=_0xf500[_0x4e7d25];return _0x526fe6;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x0f50('0x0')]={};};function freeIsNotKey(_0xcb7afc,_0x3ef919,_0x27ce55){var _0x422e78=_[_0x0f50('0x1')](_0xcb7afc,function(_0x4bd336,_0x326dc9){return _0x4bd336[_0x27ce55];});for(var _0x15dee9 in _0x3ef919){if(_0x3ef919[_0x0f50('0x2')](_0x15dee9)){if(!_0x422e78[_0x15dee9]){delete _0x3ef919[_0x15dee9];}}}}Realtime[_0x0f50('0x3')][_0x0f50('0x4')]=function(_0x4e0d80,_0x1209aa){for(var _0x56596f in _0x1209aa){if(_0x4e0d80['hasOwnProperty'](_0x56596f)){_0x4e0d80[_0x56596f]=_0x1209aa[_0x56596f];}}};Realtime[_0x0f50('0x3')][_0x0f50('0x5')]=function(){var _0x3e7f27=this;return function(_0x5115ed){if(_0x5115ed){freeIsNotKey(_0x5115ed,_0x3e7f27[_0x0f50('0x0')],'id');for(var _0x6c74f1=0x0,_0x916060={},_0x171558={};_0x6c74f1<_0x5115ed[_0x0f50('0x6')];_0x6c74f1+=0x1){_0x916060=_0x5115ed[_0x6c74f1];if(_['isUndefined'](_0x3e7f27[_0x0f50('0x0')][_0x916060['id']])){_0x3e7f27[_0x0f50('0x0')][_0x916060['id']]=new MailAccount(_0x916060);}else{_[_0x0f50('0x7')](_0x3e7f27[_0x0f50('0x0')][_0x916060['id']],_0x916060);}}}return _0x3e7f27[_0x0f50('0x0')];};};module[_0x0f50('0x8')]=Realtime;
\ No newline at end of file
+var _0x647e=['prototype','mergeFromDatabase','initMailAccounts','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x2aa1d0,_0x32ea52){var _0x1ed689=function(_0x100edb){while(--_0x100edb){_0x2aa1d0['push'](_0x2aa1d0['shift']());}};_0x1ed689(++_0x32ea52);}(_0x647e,0x1ea));var _0xe647=function(_0x3b6945,_0x2704e7){_0x3b6945=_0x3b6945-0x0;var _0x338c99=_0x647e[_0x3b6945];return _0x338c99;};'use strict';var _=require(_0xe647('0x0'));var MailAccount=require(_0xe647('0x1'));var Realtime=function(){this[_0xe647('0x2')]={};};function freeIsNotKey(_0x352c8a,_0x2223f5,_0xdc265f){var _0x21af42=_[_0xe647('0x3')](_0x352c8a,function(_0x26bd04,_0x465176){return _0x26bd04[_0xdc265f];});for(var _0x33a81f in _0x2223f5){if(_0x2223f5[_0xe647('0x4')](_0x33a81f)){if(!_0x21af42[_0x33a81f]){delete _0x2223f5[_0x33a81f];}}}}Realtime[_0xe647('0x5')][_0xe647('0x6')]=function(_0x49e782,_0x3df2f2){for(var _0x184e86 in _0x3df2f2){if(_0x49e782['hasOwnProperty'](_0x184e86)){_0x49e782[_0x184e86]=_0x3df2f2[_0x184e86];}}};Realtime[_0xe647('0x5')][_0xe647('0x7')]=function(){var _0x49c1a5=this;return function(_0x435968){if(_0x435968){freeIsNotKey(_0x435968,_0x49c1a5[_0xe647('0x2')],'id');for(var _0x363f36=0x0,_0x404f24={},_0x5950a8={};_0x363f36<_0x435968['length'];_0x363f36+=0x1){_0x404f24=_0x435968[_0x363f36];if(_['isUndefined'](_0x49c1a5[_0xe647('0x2')][_0x404f24['id']])){_0x49c1a5[_0xe647('0x2')][_0x404f24['id']]=new MailAccount(_0x404f24);}else{_['merge'](_0x49c1a5[_0xe647('0x2')][_0x404f24['id']],_0x404f24);}}}return _0x49c1a5[_0xe647('0x2')];};};module[_0xe647('0x8')]=Realtime;
\ No newline at end of file
index 115f46d..b172ac4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x19c9=['Imap','MailServerOut','getMailAccount','notify','NotifyMailAccount','../client','Request','GetMailAccount','service','email','key','ListId','TemplateId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x19c9,0x1bf));var _0x919c=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x19c9[_0x37c22c];return _0x119d79;};'use strict';var client=require(_0x919c('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x919c('0x1')](_0x919c('0x2'),{'options':{'attributes':['id','name',_0x919c('0x3'),_0x919c('0x4'),'active',_0x919c('0x5'),_0x919c('0x6'),_0x919c('0x7')],'raw':![],'include':[{'model':'MailServerIn','as':_0x919c('0x8')},{'model':_0x919c('0x9'),'as':'Smtp'}]},'log':_0x919c('0xa')});};};exports[_0x919c('0xb')]=function(_0xcfb986,_0x1dd7f1){return client[_0x919c('0x1')](_0x919c('0xc'),{'account':{'id':_0xcfb986},'body':_0x1dd7f1,'log':_0x919c('0xc')});};
\ No newline at end of file
+var _0x7c7f=['key','ListId','Imap','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','name','service','email'];(function(_0x4483c8,_0x21c771){var _0xf5527d=function(_0x1163ca){while(--_0x1163ca){_0x4483c8['push'](_0x4483c8['shift']());}};_0xf5527d(++_0x21c771);}(_0x7c7f,0x163));var _0xf7c7=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x7c7f[_0x2c7618];return _0x5ce3f0;};'use strict';var client=require(_0xf7c7('0x0'));exports[_0xf7c7('0x1')]=function(){return function(){return client['Request']('GetMailAccount',{'options':{'attributes':['id',_0xf7c7('0x2'),_0xf7c7('0x3'),_0xf7c7('0x4'),'active',_0xf7c7('0x5'),_0xf7c7('0x6'),'TemplateId'],'raw':![],'include':[{'model':'MailServerIn','as':_0xf7c7('0x7')},{'model':'MailServerOut','as':'Smtp'}]},'log':_0xf7c7('0x8')});};};exports[_0xf7c7('0x9')]=function(_0x204fa3,_0x1b2bb4){return client[_0xf7c7('0xa')]('NotifyMailAccount',{'account':{'id':_0x204fa3},'body':_0x1b2bb4,'log':_0xf7c7('0xb')});};
\ No newline at end of file
index dffe069..30fbddb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31e2=['../client','getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x31e2,0x14a));var _0x231e=function(_0x2b5b44,_0x17189c){_0x2b5b44=_0x2b5b44-0x0;var _0x32cb66=_0x31e2[_0x2b5b44];return _0x32cb66;};'use strict';var client=require(_0x231e('0x0'));exports[_0x231e('0x1')]=function(){return client[_0x231e('0x2')](_0x231e('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x231e('0x4')]},'log':_0x231e('0x5')});};
\ No newline at end of file
+var _0x34c5=['GetSettings','loginMailFrequency'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x34c5,0x123));var _0x534c=function(_0x1c43c3,_0x121365){_0x1c43c3=_0x1c43c3-0x0;var _0x23be01=_0x34c5[_0x1c43c3];return _0x23be01;};'use strict';var client=require('../client');exports['getSettings']=function(){return client['Request']('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x534c('0x0')]},'log':_0x534c('0x1')});};
\ No newline at end of file
index 36effae..5e07997 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
+var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});};
\ No newline at end of file
index b39fa1a..aeb6b1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddf3=['defaults','localhost','adapter','socket.io-redis','redis','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','express','sticky-session','ioredis','../../config/environment','timeout','listen','socket.io','websocket','polling'];(function(_0x4fd791,_0x180648){var _0x30c89e=function(_0x2b1edd){while(--_0x2b1edd){_0x4fd791['push'](_0x4fd791['shift']());}};_0x30c89e(++_0x180648);}(_0xddf3,0x1b7));var _0x3ddf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xddf3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3ddf('0x0'));var http=require(_0x3ddf('0x1'));var express=require(_0x3ddf('0x2'));var sticky=require(_0x3ddf('0x3'));var Redis=require(_0x3ddf('0x4'));var config=require(_0x3ddf('0x5'));var app=express();var server=http['createServer'](app);server[_0x3ddf('0x6')]=0xdbba0;if(sticky[_0x3ddf('0x7')](server,config['port'])){var socketio=require(_0x3ddf('0x8'))(server,{'transports':[_0x3ddf('0x9'),_0x3ddf('0xa')]});config['redis']=_[_0x3ddf('0xb')](config['redis'],{'host':_0x3ddf('0xc'),'port':0x18eb});socketio[_0x3ddf('0xd')](require(_0x3ddf('0xe'))({'pubClient':new Redis(config[_0x3ddf('0xf')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0x3ddf('0x10')]();require(_0x3ddf('0x11'))['default'](socketio);require(_0x3ddf('0x12'))[_0x3ddf('0x10')](app);require(_0x3ddf('0x13'))['default'](app);}else{server[_0x3ddf('0x14')](_0x3ddf('0x15'),function(){console[_0x3ddf('0x16')](_0x3ddf('0x17'),config['port']);});}exports=module[_0x3ddf('0x18')]=app;
\ No newline at end of file
+var _0x84f0=['../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','redis','defaults','localhost','adapter','../../config/triggers','default','../../config/socketio'];(function(_0x483d8b,_0x526c52){var _0x6500f1=function(_0x372797){while(--_0x372797){_0x483d8b['push'](_0x483d8b['shift']());}};_0x6500f1(++_0x526c52);}(_0x84f0,0xed));var _0x084f=function(_0x10ae40,_0x445780){_0x10ae40=_0x10ae40-0x0;var _0x259ae6=_0x84f0[_0x10ae40];return _0x259ae6;};'use strict';var _=require(_0x084f('0x0'));var http=require(_0x084f('0x1'));var express=require('express');var sticky=require(_0x084f('0x2'));var Redis=require(_0x084f('0x3'));var config=require(_0x084f('0x4'));var app=express();var server=http[_0x084f('0x5')](app);server[_0x084f('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0x084f('0x7')])){var socketio=require(_0x084f('0x8'))(server,{'transports':['websocket','polling']});config[_0x084f('0x9')]=_[_0x084f('0xa')](config[_0x084f('0x9')],{'host':_0x084f('0xb'),'port':0x18eb});socketio[_0x084f('0xc')](require('socket.io-redis')({'pubClient':new Redis(config[_0x084f('0x9')]),'subClient':new Redis(config[_0x084f('0x9')])}));require(_0x084f('0xd'))[_0x084f('0xe')]();require(_0x084f('0xf'))[_0x084f('0xe')](socketio);require(_0x084f('0x10'))['default'](app);require(_0x084f('0x11'))[_0x084f('0xe')](app);}else{server[_0x084f('0x12')](_0x084f('0x13'),function(){console[_0x084f('0x14')](_0x084f('0x15'),config[_0x084f('0x7')]);});}exports=module[_0x084f('0x16')]=app;
\ No newline at end of file
index 25a811e..b447393 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4345=['routing','client','Request','request','then','debug','rpc','error','message','result','catch','exports','bluebird'];(function(_0x1a8417,_0x1d2b16){var _0x3f1616=function(_0x31389){while(--_0x31389){_0x1a8417['push'](_0x1a8417['shift']());}};_0x3f1616(++_0x1d2b16);}(_0x4345,0x74));var _0x5434=function(_0x13aba5,_0x33c4b0){_0x13aba5=_0x13aba5-0x0;var _0x3d8618=_0x4345[_0x13aba5];return _0x3d8618;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x5434('0x0'));var logger=require('../../config/logger')(_0x5434('0x1'));var client=jayson[_0x5434('0x2')]['http']({'port':0x2329});client[_0x5434('0x3')]=function(_0x460cad,_0xba23ce){return new BPromise(function(_0x1037f9,_0x3a7598){return client[_0x5434('0x4')](_0x460cad,_0xba23ce)[_0x5434('0x5')](function(_0x257169){logger[_0x5434('0x6')](_0x5434('0x7'),_0x5434('0x1'),_0x460cad,_0xba23ce,_0x257169);if(_0x257169[_0x5434('0x8')]){logger[_0x5434('0x8')](_0x5434('0x7'),_0x5434('0x1'),_0x460cad,_0x257169[_0x5434('0x8')][_0x5434('0x9')],_0xba23ce);return _0x3a7598(_0x257169[_0x5434('0x8')][_0x5434('0x9')]);}else{return _0x1037f9(_0x257169[_0x5434('0xa')]);}})[_0x5434('0xb')](function(_0x30c7ca){logger['error']('rpc',_0x5434('0x1'),_0x460cad,_0x30c7ca,_0xba23ce);return _0x3a7598(_0x30c7ca);});});};module[_0x5434('0xc')]=client;
\ No newline at end of file
+var _0x4b16=['rpc','error','message','result','catch','exports','bluebird','routing','client','http','Request','request','debug'];(function(_0x36430f,_0x726529){var _0x45b0e7=function(_0x5c525e){while(--_0x5c525e){_0x36430f['push'](_0x36430f['shift']());}};_0x45b0e7(++_0x726529);}(_0x4b16,0x165));var _0x64b1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4b16[_0x14add3];return _0x4a174f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x64b1('0x0'));var logger=require('../../config/logger')(_0x64b1('0x1'));var client=jayson[_0x64b1('0x2')][_0x64b1('0x3')]({'port':0x2329});client[_0x64b1('0x4')]=function(_0x5ba5cc,_0x37a517){return new BPromise(function(_0x25ee29,_0x3f692c){return client[_0x64b1('0x5')](_0x5ba5cc,_0x37a517)['then'](function(_0x4c2ba9){logger[_0x64b1('0x6')](_0x64b1('0x7'),_0x64b1('0x1'),_0x5ba5cc,_0x37a517,_0x4c2ba9);if(_0x4c2ba9[_0x64b1('0x8')]){logger[_0x64b1('0x8')]('rpc',_0x64b1('0x1'),_0x5ba5cc,_0x4c2ba9[_0x64b1('0x8')][_0x64b1('0x9')],_0x37a517);return _0x3f692c(_0x4c2ba9['error']['message']);}else{return _0x25ee29(_0x4c2ba9[_0x64b1('0xa')]);}})[_0x64b1('0xb')](function(_0x175e7d){logger[_0x64b1('0x8')]('rpc',_0x64b1('0x1'),_0x5ba5cc,_0x175e7d,_0x37a517);return _0x3f692c(_0x175e7d);});});};module[_0x64b1('0xc')]=client;
\ No newline at end of file
index 43a4bdc..03189b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2cd=['then','getAgents','initAgents','getIntervals','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','log','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve'];(function(_0x5d6600,_0x9a9e9b){var _0x3c85cc=function(_0x4bb7fa){while(--_0x4bb7fa){_0x5d6600['push'](_0x5d6600['shift']());}};_0x3c85cc(++_0x9a9e9b);}(_0xd2cd,0xf5));var _0xdd2c=function(_0x1bae8b,_0x87c842){_0x1bae8b=_0x1bae8b-0x0;var _0x33d115=_0xd2cd[_0x1bae8b];return _0x33d115;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0xdd2c('0x0'));var user=require(_0xdd2c('0x1'));var interval=require(_0xdd2c('0x2'));var openchannelQueue=require(_0xdd2c('0x3'));var chatQueue=require(_0xdd2c('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xdd2c('0x5'));var whatsappQueue=require(_0xdd2c('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xdd2c('0x7')]()[_0xdd2c('0x8')](user[_0xdd2c('0x9')]())[_0xdd2c('0x8')](realtime[_0xdd2c('0xa')]())[_0xdd2c('0x8')](interval[_0xdd2c('0xb')]())[_0xdd2c('0x8')](realtime['initIntervals']())[_0xdd2c('0x8')](openchannelQueue['getOpenchannelQueues']())['then'](realtime[_0xdd2c('0xc')]())[_0xdd2c('0x8')](chatQueue[_0xdd2c('0xd')]())[_0xdd2c('0x8')](realtime[_0xdd2c('0xe')]())[_0xdd2c('0x8')](smsQueue[_0xdd2c('0xf')]())['then'](realtime['initSmsQueues']())[_0xdd2c('0x8')](mailQueue[_0xdd2c('0x10')]())[_0xdd2c('0x8')](realtime[_0xdd2c('0x11')]())[_0xdd2c('0x8')](faxQueue[_0xdd2c('0x12')]())[_0xdd2c('0x8')](realtime[_0xdd2c('0x13')]())[_0xdd2c('0x8')](whatsappQueue[_0xdd2c('0x14')]())[_0xdd2c('0x8')](realtime['initWhatsappQueues']())[_0xdd2c('0x8')](function(){return realtime;});}function main(){return server[_0xdd2c('0x15')](realtime)[_0xdd2c('0x8')](function(_0x4ee771){return initRealtime();})[_0xdd2c('0x8')](function(_0x5adca0){return setInterval(initRealtime,0x1388);})['catch'](function(_0xbb022e){console[_0xdd2c('0x16')](_0xbb022e);});}main();
\ No newline at end of file
+var _0x4903=['getWhatsappQueues','catch','log','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','initChatQueues','getSmsQueues','initFaxQueues'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x4903,0x1e3));var _0x3490=function(_0x55a42c,_0x5ef7f5){_0x55a42c=_0x55a42c-0x0;var _0x5a8f95=_0x4903[_0x55a42c];return _0x5a8f95;};'use strict';var BPromise=require('bluebird');var server=require(_0x3490('0x0'));var Realtime=require(_0x3490('0x1'));var user=require('./rpc/user');var interval=require(_0x3490('0x2'));var openchannelQueue=require(_0x3490('0x3'));var chatQueue=require(_0x3490('0x4'));var smsQueue=require(_0x3490('0x5'));var mailQueue=require(_0x3490('0x6'));var faxQueue=require(_0x3490('0x7'));var whatsappQueue=require(_0x3490('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x3490('0x9')]()[_0x3490('0xa')](user[_0x3490('0xb')]())[_0x3490('0xa')](realtime[_0x3490('0xc')]())[_0x3490('0xa')](interval['getIntervals']())['then'](realtime[_0x3490('0xd')]())[_0x3490('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x3490('0xa')](realtime['initOpenchannelQueues']())[_0x3490('0xa')](chatQueue['getChatQueues']())[_0x3490('0xa')](realtime[_0x3490('0xe')]())['then'](smsQueue[_0x3490('0xf')]())['then'](realtime['initSmsQueues']())['then'](mailQueue['getMailQueues']())[_0x3490('0xa')](realtime['initMailQueues']())['then'](faxQueue['getFaxQueues']())['then'](realtime[_0x3490('0x10')]())[_0x3490('0xa')](whatsappQueue[_0x3490('0x11')]())[_0x3490('0xa')](realtime['initWhatsappQueues']())['then'](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x3490('0xa')](function(_0x25a563){return initRealtime();})[_0x3490('0xa')](function(_0x3b722c){return setInterval(initRealtime,0x1388);})[_0x3490('0x12')](function(_0x3fd58c){console[_0x3490('0x13')](_0x3fd58c);});}main();
\ No newline at end of file
index 9ae4bec..410af3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['turn','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','exports','lodash','util','events','isNil','register','ignoreFactChanges','inherits','init','rules','activeRules','concat','prototype','sync','filter','orderBy','asc','execute','clone','consequence','ruleRef','name','index_','nextTick','push','call','isEqual','restart','length','condition','matchPath','noop','findRules'];(function(_0x53eee1,_0x2ff338){var _0x28fda5=function(_0x16bc7c){while(--_0x16bc7c){_0x53eee1['push'](_0x53eee1['shift']());}};_0x28fda5(++_0x2ff338);}(_0x7a54,0x106));var _0x47a5=function(_0x1df08f,_0x7a70b3){_0x1df08f=_0x1df08f-0x0;var _0x2098a8=_0x7a54[_0x1df08f];return _0x2098a8;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var EventEmitter=require(_0x47a5('0x2'))['EventEmitter'];function RuleEngine(_0x1d33e,_0x4086cd){this['init']();if(!_[_0x47a5('0x3')](_0x1d33e)){this[_0x47a5('0x4')](_0x1d33e);}if(_0x4086cd){this[_0x47a5('0x5')]=_0x4086cd[_0x47a5('0x5')];}return this;}util[_0x47a5('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x47a5('0x7')]=function(_0x59199c){this[_0x47a5('0x8')]=[];this[_0x47a5('0x9')]=[];};RuleEngine['prototype'][_0x47a5('0x4')]=function(_0x5077f3){if(Array['isArray'](_0x5077f3)){this['rules']=this[_0x47a5('0x8')][_0x47a5('0xa')](_0x5077f3);}else if(_0x5077f3!==null&&_['isObject'](_0x5077f3)){this[_0x47a5('0x8')]['push'](_0x5077f3);}this['sync']();};RuleEngine[_0x47a5('0xb')][_0x47a5('0xc')]=function(){this[_0x47a5('0x9')]=this[_0x47a5('0x8')][_0x47a5('0xd')](function(_0xd308b8){if(_[_0x47a5('0x3')](_0xd308b8['on'])){_0xd308b8['on']=!![];}if(_0xd308b8['on']===!![]){return _0xd308b8;}});this['activeRules']=_[_0x47a5('0xe')](this[_0x47a5('0x9')],['p'],[_0x47a5('0xf')]);};RuleEngine[_0x47a5('0xb')][_0x47a5('0x10')]=function(_0x620ee9,_0x3c6c46){var _0x190faa=![];_0x620ee9['result']=!![];var _0x362359=_[_0x47a5('0x11')](_0x620ee9);var _0x3b001e=_[_0x47a5('0x11')](_0x620ee9);var _0x1ef44c=this['activeRules'];var _0x549de3=[];var _0x138bc0=this['ignoreFactChanges'];(function FnRuleLoop(_0x5247fd){var _0x423a81={'rules':function(){return _0x1ef44c;},'rule':function(){return _0x1ef44c[_0x5247fd];},'when':function(_0xaf70a6){if(_0xaf70a6){var _0x2ce454=_0x1ef44c[_0x5247fd][_0x47a5('0x12')];_0x2ce454[_0x47a5('0x13')]=_0x1ef44c[_0x5247fd]['id']||_0x1ef44c[_0x5247fd][_0x47a5('0x14')]||_0x47a5('0x15')+_0x5247fd;process[_0x47a5('0x16')](function(){_0x549de3[_0x47a5('0x17')](_0x2ce454['ruleRef']);_0x2ce454[_0x47a5('0x18')](_0x362359,_0x423a81);});}else{process[_0x47a5('0x16')](function(){_0x423a81['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190faa=!![];return FnRuleLoop(0x0);},'next':function(_0x2b0360){if(!_0x138bc0&&!_[_0x47a5('0x19')](_0x3b001e,_0x362359)){_0x3b001e=_[_0x47a5('0x11')](_0x362359);process['nextTick'](function(){_0x423a81[_0x47a5('0x1a')]();});}else{process[_0x47a5('0x16')](function(){if(_[_0x47a5('0x3')](_0x2b0360)){return FnRuleLoop(_0x5247fd+0x1);}else{return FnRuleLoop(_0x2b0360);}});}}};if(_0x5247fd<_0x1ef44c[_0x47a5('0x1b')]&&_0x190faa===![]){var _0x5ef1b1=_0x1ef44c[_0x5247fd][_0x47a5('0x1c')];_0x5ef1b1[_0x47a5('0x18')](_0x362359,_0x423a81);}else{process['nextTick'](function(){_0x362359[_0x47a5('0x1d')]=_0x549de3;return _0x3c6c46?_0x3c6c46(_0x362359):_[_0x47a5('0x1e')]();});}}(0x0));};RuleEngine[_0x47a5('0xb')][_0x47a5('0x1f')]=function(_0x3abd6a){if(_['isNil'](_0x3abd6a)){return this['rules'];}else{var _0x136745=_['matches'](_0x3abd6a);return _[_0x47a5('0xd')](this['rules'],_0x136745);}};RuleEngine[_0x47a5('0xb')][_0x47a5('0x20')]=function(_0x36ad34,_0x1dac65){var _0x21f296=_0x36ad34==='on'||_0x36ad34==='ON'?!![]:![];var _0x3ba0b7=this[_0x47a5('0x1f')](_0x1dac65);for(var _0x136b14=0x0,_0x16631f=_0x3ba0b7[_0x47a5('0x1b')];_0x136b14<_0x16631f;_0x136b14+=0x1){_0x3ba0b7[_0x136b14]['on']=_0x21f296;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x21')]=function(_0x528582,_0x243210){_0x528582=parseInt(_0x528582,0xa);var _0x51833b=this[_0x47a5('0x1f')](_0x243210);for(var _0x9ac908=0x0,_0x16901f=_0x51833b['length'];_0x9ac908<_0x16901f;_0x9ac908+=0x1){_0x51833b[_0x9ac908][_0x47a5('0x22')]=_0x528582;}this[_0x47a5('0xc')]();};RuleEngine[_0x47a5('0xb')][_0x47a5('0x23')]=function(){var _0x51cc81=this['rules'];if(_0x51cc81 instanceof Array){_0x51cc81=_0x51cc81[_0x47a5('0x24')](function(_0xfb5ddb){_0xfb5ddb['condition']=_0xfb5ddb['condition'][_0x47a5('0x25')]();_0xfb5ddb[_0x47a5('0x12')]=_0xfb5ddb['consequence'][_0x47a5('0x25')]();return _0xfb5ddb;});}else if(!_['isNil'](_0x51cc81)){_0x51cc81[_0x47a5('0x1c')]=_0x51cc81[_0x47a5('0x1c')]['toString']();_0x51cc81['consequence']=_0x51cc81[_0x47a5('0x12')]['toString']();}return _0x51cc81;};RuleEngine[_0x47a5('0xb')][_0x47a5('0x26')]=function(_0xf269a8){this['init']();if(_[_0x47a5('0x27')](_0xf269a8)){_0xf269a8=JSON['parse'](_0xf269a8);}if(_0xf269a8 instanceof Array){_0xf269a8=_0xf269a8['map'](function(_0x65542e){_0x65542e['condition']=eval('('+_0x65542e[_0x47a5('0x1c')]+')');_0x65542e['consequence']=eval('('+_0x65542e[_0x47a5('0x12')]+')');return _0x65542e;});}else if(_0xf269a8!==null&&typeof _0xf269a8==_0x47a5('0x28')){_0xf269a8[_0x47a5('0x1c')]=eval('('+_0xf269a8[_0x47a5('0x1c')]+')');_0xf269a8[_0x47a5('0x12')]=eval('('+_0xf269a8[_0x47a5('0x12')]+')');}this[_0x47a5('0x4')](_0xf269a8);};module[_0x47a5('0x29')]=RuleEngine;
\ No newline at end of file
+var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_0x507f9e,_0x308d20){_0x507f9e=_0x507f9e-0x0;var _0x250f7e=_0x1261[_0x507f9e];return _0x250f7e;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine;
\ No newline at end of file
index c5b48c1..8b62044 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15db=['request','then','error','message','result','catch','SendMail','bluebird','jayson/promise','client','http'];(function(_0x5dd7a6,_0x47a7ab){var _0x41f9d2=function(_0x36d132){while(--_0x36d132){_0x5dd7a6['push'](_0x5dd7a6['shift']());}};_0x41f9d2(++_0x47a7ab);}(_0x15db,0x193));var _0xb15d=function(_0x5c2161,_0x142d58){_0x5c2161=_0x5c2161-0x0;var _0x1d0195=_0x15db[_0x5c2161];return _0x1d0195;};'use strict';var BPromise=require(_0xb15d('0x0'));var jayson=require(_0xb15d('0x1'));var client=jayson[_0xb15d('0x2')][_0xb15d('0x3')]({'port':0x232b});function request(_0x4fb2b5,_0x3f2e9){return new BPromise(function(_0x144a12,_0x4ef316){return client[_0xb15d('0x4')](_0x4fb2b5,_0x3f2e9)[_0xb15d('0x5')](function(_0x47be1e){if(_0x47be1e[_0xb15d('0x6')]){return _0x4ef316(_0x47be1e[_0xb15d('0x6')][_0xb15d('0x7')]);}else{return _0x144a12(_0x47be1e[_0xb15d('0x8')]);}})[_0xb15d('0x9')](function(_0x4ab2cf){return _0x4ef316(_0x4ab2cf);});});}exports['sendMailMessage']=function(_0x8b67e,_0x2911af){return request(_0xb15d('0xa'),{'account':_0x8b67e,'message':_0x2911af});};
\ No newline at end of file
+var _0xe7c5=['request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client'];(function(_0x1068b6,_0x3eba53){var _0x490f5c=function(_0x18b149){while(--_0x18b149){_0x1068b6['push'](_0x1068b6['shift']());}};_0x490f5c(++_0x3eba53);}(_0xe7c5,0xce));var _0x5e7c=function(_0x305e72,_0x1f2c2a){_0x305e72=_0x305e72-0x0;var _0x18dcf9=_0xe7c5[_0x305e72];return _0x18dcf9;};'use strict';var BPromise=require(_0x5e7c('0x0'));var jayson=require(_0x5e7c('0x1'));var client=jayson[_0x5e7c('0x2')]['http']({'port':0x232b});function request(_0x5eee7e,_0x232c8e){return new BPromise(function(_0x1452bc,_0x5b1660){return client[_0x5e7c('0x3')](_0x5eee7e,_0x232c8e)[_0x5e7c('0x4')](function(_0x1a59a8){if(_0x1a59a8[_0x5e7c('0x5')]){return _0x5b1660(_0x1a59a8['error'][_0x5e7c('0x6')]);}else{return _0x1452bc(_0x1a59a8[_0x5e7c('0x7')]);}})[_0x5e7c('0x8')](function(_0x50b198){return _0x5b1660(_0x50b198);});});}exports[_0x5e7c('0x9')]=function(_0x8e7e38,_0x4e55fe){return request(_0x5e7c('0xa'),{'account':_0x8e7e38,'message':_0x4e55fe});};
\ No newline at end of file
index b2fab14..152e445 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcbe2=['openchannelStatus','stringify','emit','user:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','chatStatus','mailStatusTime','mailCurrentCapacity','smsCurrentCapacity'];(function(_0x39b31b,_0x320f24){var _0x2f9a71=function(_0x165e58){while(--_0x165e58){_0x39b31b['push'](_0x39b31b['shift']());}};_0x2f9a71(++_0x320f24);}(_0xcbe2,0x179));var _0x2cbe=function(_0x3697b6,_0x469684){_0x3697b6=_0x3697b6-0x0;var _0x42b25b=_0xcbe2[_0x3697b6];return _0x42b25b;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x2cbe('0x0'));var Redis=require(_0x2cbe('0x1'));var config=require(_0x2cbe('0x2'));config[_0x2cbe('0x3')]=_[_0x2cbe('0x4')](config[_0x2cbe('0x3')],{'host':_0x2cbe('0x5'),'port':0x18eb});var io=require(_0x2cbe('0x6'))(new Redis(config[_0x2cbe('0x3')]));function Agent(_0x936d0d){this['id']=_0x936d0d['id']||0x0;this[_0x2cbe('0x7')]=_0x936d0d['name']||'';this[_0x2cbe('0x8')]=_0x936d0d[_0x2cbe('0x8')]||!![];this['voicePause']=_0x936d0d[_0x2cbe('0x9')]||![];this[_0x2cbe('0xa')]=_0x936d0d[_0x2cbe('0xa')]||![];this[_0x2cbe('0xb')]=_0x936d0d[_0x2cbe('0xb')]||![];this[_0x2cbe('0xc')]=_0x936d0d[_0x2cbe('0xc')]||![];this[_0x2cbe('0xd')]=_0x936d0d[_0x2cbe('0xd')]||![];this[_0x2cbe('0xe')]=_0x936d0d[_0x2cbe('0xe')]||![];this['chatStatus']=_0x2cbe('0xf');this[_0x2cbe('0x10')]=0x0;this[_0x2cbe('0x11')]=_0x936d0d[_0x2cbe('0x11')]||0x0;this[_0x2cbe('0x12')]=0x0;this[_0x2cbe('0x13')]=_0x2cbe('0xf');this['mailStatusTime']=0x0;this[_0x2cbe('0x14')]=_0x936d0d[_0x2cbe('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x2cbe('0x15')]=_0x2cbe('0xf');this[_0x2cbe('0x16')]=0x0;this[_0x2cbe('0x17')]=_0x936d0d[_0x2cbe('0x17')]||0x0;this[_0x2cbe('0x18')]=0x0;this[_0x2cbe('0x19')]=_0x2cbe('0xf');this[_0x2cbe('0x1a')]=0x0;this['smsCapacity']=_0x936d0d[_0x2cbe('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x2cbe('0x1c')]=_0x2cbe('0xf');this[_0x2cbe('0x1d')]=0x0;this[_0x2cbe('0x1e')]=_0x936d0d[_0x2cbe('0x1e')]||0x0;this[_0x2cbe('0x1f')]=0x0;this['openchannelStatus']=_0x2cbe('0xf');this[_0x2cbe('0x20')]=0x0;this['openchannelCapacity']=_0x936d0d[_0x2cbe('0x21')]||0x0;this[_0x2cbe('0x22')]=0x0;this[_0x2cbe('0x23')]=![];this[_0x2cbe('0x24')]=undefined;this[_0x2cbe('0x0')]='';this['updateRealtime']();}Agent[_0x2cbe('0x25')][_0x2cbe('0x26')]=function(_0x28fa9a){if(this[_0x28fa9a+_0x2cbe('0x27')]>0x0){if(this[_0x28fa9a+_0x2cbe('0x28')]>0x0&&this[_0x28fa9a+_0x2cbe('0x27')]>=this[_0x28fa9a+'Capacity']){return'maxcapacity';}else{return _0x2cbe('0x29');}}else{return _0x2cbe('0x2a');}};Agent['prototype']['updateRealtime']=function(){var _0x1c5cd4=[_0x2cbe('0x2b'),_0x2cbe('0x2c'),_0x2cbe('0x2d'),_0x2cbe('0x2e'),_0x2cbe('0x2f'),_0x2cbe('0x30')];for(var _0x3620f1=0x0;_0x3620f1<_0x1c5cd4[_0x2cbe('0x31')];_0x3620f1+=0x1){var _0x9439=this['getChannelStatus'](_0x1c5cd4[_0x3620f1]);if(this[_0x1c5cd4[_0x3620f1]+_0x2cbe('0x32')]!==_0x9439){this[_0x1c5cd4[_0x3620f1]+_0x2cbe('0x33')]=_[_0x2cbe('0x34')](moment()['format']('x'));}this[_0x1c5cd4[_0x3620f1]+_0x2cbe('0x32')]=_0x9439;}var _0x96615b={'id':this['id'],'name':this['name'],'online':this[_0x2cbe('0x8')],'voicePause':this[_0x2cbe('0x9')],'chatPause':this[_0x2cbe('0xa')],'mailPause':this[_0x2cbe('0xb')],'smsPause':this['smsPause'],'faxPause':this[_0x2cbe('0xc')],'openchannelPause':this[_0x2cbe('0xe')],'chatStatus':this[_0x2cbe('0x35')],'chatStatusTime':this[_0x2cbe('0x10')],'chatCapacity':this[_0x2cbe('0x11')],'chatCurrentCapacity':this[_0x2cbe('0x12')],'mailStatus':this[_0x2cbe('0x13')],'mailStatusTime':this[_0x2cbe('0x36')],'mailCapacity':this[_0x2cbe('0x14')],'mailCurrentCapacity':this[_0x2cbe('0x37')],'faxStatus':this[_0x2cbe('0x15')],'faxStatusTime':this[_0x2cbe('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x2cbe('0x19')],'smsStatusTime':this[_0x2cbe('0x1a')],'smsCapacity':this[_0x2cbe('0x1b')],'smsCurrentCapacity':this[_0x2cbe('0x38')],'whatsappStatus':this[_0x2cbe('0x1c')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x2cbe('0x1f')],'openchannelStatus':this[_0x2cbe('0x39')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x2cbe('0x22')],'busy':this['busy'],'busyQueue':this[_0x2cbe('0x24')]};var _0x417ddb=md5(JSON[_0x2cbe('0x3a')](_0x96615b));if(this[_0x2cbe('0x0')]!==_0x417ddb){this[_0x2cbe('0x0')]=_0x417ddb;io[_0x2cbe('0x3b')](_0x2cbe('0x3c'),_0x96615b);}};module[_0x2cbe('0x3d')]=Agent;
\ No newline at end of file
+var _0x74a2=['openchannelCapacity','updateRealtime','prototype','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','getChannelStatus','Status','StatusTime','toNumber','format','chatStatusTime','faxStatus','smsStatusTime','busy','busyQueue','stringify','emit','user:save','exports','moment','md5','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime'];(function(_0x32d132,_0x7a0a3f){var _0x368635=function(_0x2d4ddb){while(--_0x2d4ddb){_0x32d132['push'](_0x32d132['shift']());}};_0x368635(++_0x7a0a3f);}(_0x74a2,0x1bf));var _0x274a=function(_0x21af3a,_0x386e1d){_0x21af3a=_0x21af3a-0x0;var _0x268a49=_0x74a2[_0x21af3a];return _0x268a49;};'use strict';var _=require('lodash');var moment=require(_0x274a('0x0'));var md5=require(_0x274a('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x274a('0x2')]=_[_0x274a('0x3')](config[_0x274a('0x2')],{'host':_0x274a('0x4'),'port':0x18eb});var io=require(_0x274a('0x5'))(new Redis(config[_0x274a('0x2')]));function Agent(_0xa5be81){this['id']=_0xa5be81['id']||0x0;this[_0x274a('0x6')]=_0xa5be81[_0x274a('0x6')]||'';this[_0x274a('0x7')]=_0xa5be81[_0x274a('0x7')]||!![];this[_0x274a('0x8')]=_0xa5be81[_0x274a('0x8')]||![];this[_0x274a('0x9')]=_0xa5be81[_0x274a('0x9')]||![];this['mailPause']=_0xa5be81[_0x274a('0xa')]||![];this[_0x274a('0xb')]=_0xa5be81['faxPause']||![];this[_0x274a('0xc')]=_0xa5be81[_0x274a('0xc')]||![];this[_0x274a('0xd')]=_0xa5be81['openchannelPause']||![];this[_0x274a('0xe')]=_0x274a('0xf');this['chatStatusTime']=0x0;this[_0x274a('0x10')]=_0xa5be81['chatCapacity']||0x0;this[_0x274a('0x11')]=0x0;this[_0x274a('0x12')]='unknown';this[_0x274a('0x13')]=0x0;this[_0x274a('0x14')]=_0xa5be81['mailCapacity']||0x0;this[_0x274a('0x15')]=0x0;this['faxStatus']='unknown';this[_0x274a('0x16')]=0x0;this['faxCapacity']=_0xa5be81[_0x274a('0x17')]||0x0;this[_0x274a('0x18')]=0x0;this[_0x274a('0x19')]='unknown';this['smsStatusTime']=0x0;this['smsCapacity']=_0xa5be81[_0x274a('0x1a')]||0x0;this[_0x274a('0x1b')]=0x0;this[_0x274a('0x1c')]=_0x274a('0xf');this[_0x274a('0x1d')]=0x0;this[_0x274a('0x1e')]=_0xa5be81[_0x274a('0x1e')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x274a('0x1f')]=_0x274a('0xf');this[_0x274a('0x20')]=0x0;this['openchannelCapacity']=_0xa5be81[_0x274a('0x21')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this['busyQueue']=undefined;this['md5']='';this[_0x274a('0x22')]();}Agent[_0x274a('0x23')]['getChannelStatus']=function(_0xdeee1b){if(this[_0xdeee1b+_0x274a('0x24')]>0x0){if(this[_0xdeee1b+_0x274a('0x25')]>0x0&&this[_0xdeee1b+_0x274a('0x24')]>=this[_0xdeee1b+_0x274a('0x25')]){return _0x274a('0x26');}else{return _0x274a('0x27');}}else{return _0x274a('0x28');}};Agent['prototype'][_0x274a('0x22')]=function(){var _0x44f84e=[_0x274a('0x29'),_0x274a('0x2a'),'openchannel',_0x274a('0x2b'),_0x274a('0x2c'),_0x274a('0x2d')];for(var _0x22e17a=0x0;_0x22e17a<_0x44f84e['length'];_0x22e17a+=0x1){var _0x1788d6=this[_0x274a('0x2e')](_0x44f84e[_0x22e17a]);if(this[_0x44f84e[_0x22e17a]+_0x274a('0x2f')]!==_0x1788d6){this[_0x44f84e[_0x22e17a]+_0x274a('0x30')]=_[_0x274a('0x31')](moment()[_0x274a('0x32')]('x'));}this[_0x44f84e[_0x22e17a]+_0x274a('0x2f')]=_0x1788d6;}var _0x4f1b1c={'id':this['id'],'name':this[_0x274a('0x6')],'online':this['online'],'voicePause':this[_0x274a('0x8')],'chatPause':this[_0x274a('0x9')],'mailPause':this[_0x274a('0xa')],'smsPause':this[_0x274a('0xc')],'faxPause':this[_0x274a('0xb')],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x274a('0x33')],'chatCapacity':this[_0x274a('0x10')],'chatCurrentCapacity':this[_0x274a('0x11')],'mailStatus':this[_0x274a('0x12')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x274a('0x14')],'mailCurrentCapacity':this[_0x274a('0x15')],'faxStatus':this[_0x274a('0x34')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this[_0x274a('0x17')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x274a('0x35')],'smsCapacity':this[_0x274a('0x1a')],'smsCurrentCapacity':this[_0x274a('0x1b')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x274a('0x1d')],'whatsappCapacity':this[_0x274a('0x1e')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x274a('0x1f')],'openchannelStatusTime':this[_0x274a('0x20')],'openchannelCapacity':this[_0x274a('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x274a('0x36')],'busyQueue':this[_0x274a('0x37')]};var _0x3f3839=md5(JSON[_0x274a('0x38')](_0x4f1b1c));if(this[_0x274a('0x1')]!==_0x3f3839){this[_0x274a('0x1')]=_0x3f3839;io[_0x274a('0x39')](_0x274a('0x3a'),_0x4f1b1c);}};module[_0x274a('0x3b')]=Agent;
\ No newline at end of file
index f75cc4d..315c4ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x572d=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','available','format','chat:queue:%s','chat_queue:save','exports','md5','util','ioredis'];(function(_0x2deaee,_0x3de6c9){var _0x306c4b=function(_0x408a99){while(--_0x408a99){_0x2deaee['push'](_0x2deaee['shift']());}};_0x306c4b(++_0x3de6c9);}(_0x572d,0xba));var _0xd572=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x572d[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var md5=require(_0xd572('0x0'));var util=require(_0xd572('0x1'));var Redis=require(_0xd572('0x2'));var config=require(_0xd572('0x3'));config[_0xd572('0x4')]=_['defaults'](config[_0xd572('0x4')],{'host':_0xd572('0x5'),'port':0x18eb});var io=require(_0xd572('0x6'))(new Redis(config[_0xd572('0x4')]));function ChatQueue(_0x51b392){this['id']=_0x51b392['id']||0x0;this[_0xd572('0x7')]=_0x51b392[_0xd572('0x7')]||'';this[_0xd572('0x8')]=_0x51b392[_0xd572('0x8')]||0xa;this[_0xd572('0x9')]=_0x51b392[_0xd572('0x9')]||_0xd572('0xa');this[_0xd572('0xb')]=_0x51b392[_0xd572('0xb')];this[_0xd572('0xc')]={};this[_0xd572('0xd')]=0x0;this[_0xd572('0x0')]='';this[_0xd572('0xe')]();this[_0xd572('0xf')]();}ChatQueue[_0xd572('0x10')][_0xd572('0xe')]=function(){var _0x2e9a57=this[_0xd572('0xc')]['_rr'];this[_0xd572('0xc')]=_[_0xd572('0x11')](this[_0xd572('0xb')],'id');this['mapAgentsId'][_0xd572('0x12')]=_0x2e9a57;};ChatQueue[_0xd572('0x10')]['updateRealtime']=function(){this[_0xd572('0x13')]=0x0;this[_0xd572('0x14')]=0x0;for(var _0x2f51f2=0x0;_0x2f51f2<this[_0xd572('0xb')][_0xd572('0x15')];_0x2f51f2+=0x1){if(this[_0xd572('0xb')][_0x2f51f2]['online']){this[_0xd572('0x13')]+=0x1;}if(this[_0xd572('0xb')][_0x2f51f2]['chatPause']){this[_0xd572('0x14')]+=0x1;}}this['available']=this[_0xd572('0x13')]-this[_0xd572('0x14')];this['available']=this[_0xd572('0x16')]>=0x0?this[_0xd572('0x16')]:0x0;var _0x54ec27={'id':this['id'],'available':this[_0xd572('0x16')],'loggedIn':this[_0xd572('0x13')],'name':this[_0xd572('0x7')],'paused':this[_0xd572('0x14')],'waiting':this[_0xd572('0xd')]};var _0x17cb21=md5(JSON['stringify'](_0x54ec27));if(this[_0xd572('0x0')]!==_0x17cb21){this['md5']=_0x17cb21;io['to'](util[_0xd572('0x17')](_0xd572('0x18'),_0x54ec27[_0xd572('0x7')]))['emit'](_0xd572('0x19'),_0x54ec27);}};module[_0xd572('0x1a')]=ChatQueue;
\ No newline at end of file
+var _0xbcb2=['map','loggedIn','paused','length','online','available','waiting','stringify','format','chat:queue:%s','chat_queue:save','exports','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','beepall','Agents','updateRealtime','prototype','updateRouting','_rr','mapAgentsId'];(function(_0x34b2f5,_0x5ef505){var _0x3637f4=function(_0x1b698b){while(--_0x1b698b){_0x34b2f5['push'](_0x34b2f5['shift']());}};_0x3637f4(++_0x5ef505);}(_0xbcb2,0xf4));var _0x2bcb=function(_0x52ed8e,_0x4bcc46){_0x52ed8e=_0x52ed8e-0x0;var _0x718686=_0xbcb2[_0x52ed8e];return _0x718686;};'use strict';var _=require('lodash');var md5=require(_0x2bcb('0x0'));var util=require(_0x2bcb('0x1'));var Redis=require(_0x2bcb('0x2'));var config=require(_0x2bcb('0x3'));config['redis']=_[_0x2bcb('0x4')](config[_0x2bcb('0x5')],{'host':_0x2bcb('0x6'),'port':0x18eb});var io=require(_0x2bcb('0x7'))(new Redis(config[_0x2bcb('0x5')]));function ChatQueue(_0x2479ed){this['id']=_0x2479ed['id']||0x0;this[_0x2bcb('0x8')]=_0x2479ed[_0x2bcb('0x8')]||'';this[_0x2bcb('0x9')]=_0x2479ed[_0x2bcb('0x9')]||0xa;this['strategy']=_0x2479ed['strategy']||_0x2bcb('0xa');this[_0x2bcb('0xb')]=_0x2479ed['Agents'];this['mapAgentsId']={};this['waiting']=0x0;this[_0x2bcb('0x0')]='';this['updateRouting']();this[_0x2bcb('0xc')]();}ChatQueue[_0x2bcb('0xd')][_0x2bcb('0xe')]=function(){var _0x41b7a7=this['mapAgentsId'][_0x2bcb('0xf')];this[_0x2bcb('0x10')]=_[_0x2bcb('0x11')](this[_0x2bcb('0xb')],'id');this[_0x2bcb('0x10')]['_rr']=_0x41b7a7;};ChatQueue[_0x2bcb('0xd')][_0x2bcb('0xc')]=function(){this[_0x2bcb('0x12')]=0x0;this[_0x2bcb('0x13')]=0x0;for(var _0x4775bc=0x0;_0x4775bc<this[_0x2bcb('0xb')][_0x2bcb('0x14')];_0x4775bc+=0x1){if(this[_0x2bcb('0xb')][_0x4775bc][_0x2bcb('0x15')]){this[_0x2bcb('0x12')]+=0x1;}if(this[_0x2bcb('0xb')][_0x4775bc]['chatPause']){this[_0x2bcb('0x13')]+=0x1;}}this[_0x2bcb('0x16')]=this['loggedIn']-this[_0x2bcb('0x13')];this[_0x2bcb('0x16')]=this[_0x2bcb('0x16')]>=0x0?this['available']:0x0;var _0x3fba61={'id':this['id'],'available':this[_0x2bcb('0x16')],'loggedIn':this[_0x2bcb('0x12')],'name':this[_0x2bcb('0x8')],'paused':this[_0x2bcb('0x13')],'waiting':this[_0x2bcb('0x17')]};var _0x4424a1=md5(JSON[_0x2bcb('0x18')](_0x3fba61));if(this['md5']!==_0x4424a1){this[_0x2bcb('0x0')]=_0x4424a1;io['to'](util[_0x2bcb('0x19')](_0x2bcb('0x1a'),_0x3fba61[_0x2bcb('0x8')]))['emit'](_0x2bcb('0x1b'),_0x3fba61);}};module[_0x2bcb('0x1c')]=ChatQueue;
\ No newline at end of file
index 02c7a6c..dbb0072 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa877=['md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','util','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0x1491d4,_0x534641){var _0x11d12e=function(_0x6515ad){while(--_0x6515ad){_0x1491d4['push'](_0x1491d4['shift']());}};_0x11d12e(++_0x534641);}(_0xa877,0x179));var _0x7a87=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xa877[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x7a87('0x0'));var md5=require('md5');var util=require(_0x7a87('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x7a87('0x2')]=_[_0x7a87('0x3')](config['redis'],{'host':_0x7a87('0x4'),'port':0x18eb});var io=require(_0x7a87('0x5'))(new Redis(config[_0x7a87('0x2')]));function FaxQueue(_0x166485){this['id']=_0x166485['id']||0x0;this['name']=_0x166485[_0x7a87('0x6')]||'';this[_0x7a87('0x7')]=_0x166485[_0x7a87('0x7')]||0xa;this[_0x7a87('0x8')]=_0x166485[_0x7a87('0x8')]||_0x7a87('0x9');this['Agents']=_0x166485[_0x7a87('0xa')];this[_0x7a87('0xb')]={};this[_0x7a87('0xc')]=0x0;this[_0x7a87('0xd')]='';this[_0x7a87('0xe')]();this[_0x7a87('0xf')]();}FaxQueue[_0x7a87('0x10')][_0x7a87('0xe')]=function(){var _0x49d05c=this[_0x7a87('0xb')][_0x7a87('0x11')];this[_0x7a87('0xb')]=_[_0x7a87('0x12')](this[_0x7a87('0xa')],'id');this[_0x7a87('0xb')][_0x7a87('0x11')]=_0x49d05c;};FaxQueue['prototype']['updateRealtime']=function(){this[_0x7a87('0x13')]=0x0;this[_0x7a87('0x14')]=0x0;for(var _0x26c68e=0x0;_0x26c68e<this[_0x7a87('0xa')][_0x7a87('0x15')];_0x26c68e+=0x1){if(this[_0x7a87('0xa')][_0x26c68e][_0x7a87('0x16')]){this['loggedIn']+=0x1;}if(this[_0x7a87('0xa')][_0x26c68e]['faxPause']){this[_0x7a87('0x14')]+=0x1;}}this['available']=this[_0x7a87('0x13')]-this['paused'];this[_0x7a87('0x17')]=this[_0x7a87('0x17')]>=0x0?this[_0x7a87('0x17')]:0x0;var _0x11a6e4={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x7a87('0x6')],'paused':this[_0x7a87('0x14')],'waiting':this['waiting']};var _0x216b49=md5(JSON[_0x7a87('0x18')](_0x11a6e4));if(this[_0x7a87('0xd')]!==_0x216b49){this['md5']=_0x216b49;io['to'](util[_0x7a87('0x19')](_0x7a87('0x1a'),_0x11a6e4[_0x7a87('0x6')]))[_0x7a87('0x1b')](_0x7a87('0x1c'),_0x11a6e4);}};module[_0x7a87('0x1d')]=FaxQueue;
\ No newline at end of file
+var _0x4ab3=['redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','fax_queue:save','exports','lodash','md5','ioredis'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x4ab3,0x183));var _0x34ab=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x4ab3[_0x4ca333];return _0x13b2e1;};'use strict';var _=require(_0x34ab('0x0'));var md5=require(_0x34ab('0x1'));var util=require('util');var Redis=require(_0x34ab('0x2'));var config=require('../../../config/environment');config[_0x34ab('0x3')]=_[_0x34ab('0x4')](config[_0x34ab('0x3')],{'host':_0x34ab('0x5'),'port':0x18eb});var io=require(_0x34ab('0x6'))(new Redis(config[_0x34ab('0x3')]));function FaxQueue(_0x2f914b){this['id']=_0x2f914b['id']||0x0;this[_0x34ab('0x7')]=_0x2f914b[_0x34ab('0x7')]||'';this[_0x34ab('0x8')]=_0x2f914b[_0x34ab('0x8')]||0xa;this[_0x34ab('0x9')]=_0x2f914b[_0x34ab('0x9')]||_0x34ab('0xa');this[_0x34ab('0xb')]=_0x2f914b[_0x34ab('0xb')];this[_0x34ab('0xc')]={};this[_0x34ab('0xd')]=0x0;this[_0x34ab('0x1')]='';this[_0x34ab('0xe')]();this[_0x34ab('0xf')]();}FaxQueue[_0x34ab('0x10')][_0x34ab('0xe')]=function(){var _0x10a5e3=this[_0x34ab('0xc')][_0x34ab('0x11')];this[_0x34ab('0xc')]=_[_0x34ab('0x12')](this[_0x34ab('0xb')],'id');this[_0x34ab('0xc')]['_rr']=_0x10a5e3;};FaxQueue[_0x34ab('0x10')][_0x34ab('0xf')]=function(){this[_0x34ab('0x13')]=0x0;this[_0x34ab('0x14')]=0x0;for(var _0x1b6aea=0x0;_0x1b6aea<this[_0x34ab('0xb')][_0x34ab('0x15')];_0x1b6aea+=0x1){if(this[_0x34ab('0xb')][_0x1b6aea][_0x34ab('0x16')]){this[_0x34ab('0x13')]+=0x1;}if(this[_0x34ab('0xb')][_0x1b6aea][_0x34ab('0x17')]){this[_0x34ab('0x14')]+=0x1;}}this[_0x34ab('0x18')]=this[_0x34ab('0x13')]-this['paused'];this[_0x34ab('0x18')]=this['available']>=0x0?this[_0x34ab('0x18')]:0x0;var _0x96775d={'id':this['id'],'available':this['available'],'loggedIn':this[_0x34ab('0x13')],'name':this[_0x34ab('0x7')],'paused':this[_0x34ab('0x14')],'waiting':this['waiting']};var _0x4eb50b=md5(JSON[_0x34ab('0x19')](_0x96775d));if(this[_0x34ab('0x1')]!==_0x4eb50b){this[_0x34ab('0x1')]=_0x4eb50b;io['to'](util[_0x34ab('0x1a')](_0x34ab('0x1b'),_0x96775d[_0x34ab('0x7')]))['emit'](_0x34ab('0x1c'),_0x96775d);}};module[_0x34ab('0x1d')]=FaxQueue;
\ No newline at end of file
index 6bf032b..523c107 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f0e=['Intervals','exports','name'];(function(_0x24e320,_0x32bd95){var _0x5dfb42=function(_0x3bdc69){while(--_0x3bdc69){_0x24e320['push'](_0x24e320['shift']());}};_0x5dfb42(++_0x32bd95);}(_0x5f0e,0x1d6));var _0xe5f0=function(_0x30edea,_0x21ef1b){_0x30edea=_0x30edea-0x0;var _0x119c20=_0x5f0e[_0x30edea];return _0x119c20;};'use strict';function Interval(_0x1cf00){this['id']=_0x1cf00['id']||0x0;this[_0xe5f0('0x0')]=_0x1cf00[_0xe5f0('0x0')]||'';this['Intervals']=_0x1cf00[_0xe5f0('0x1')]||{};}module[_0xe5f0('0x2')]=Interval;
\ No newline at end of file
+var _0xb234=['Intervals','exports','name'];(function(_0x353766,_0x2ea6ce){var _0x4450e3=function(_0x590862){while(--_0x590862){_0x353766['push'](_0x353766['shift']());}};_0x4450e3(++_0x2ea6ce);}(_0xb234,0x137));var _0x4b23=function(_0x54b4aa,_0x5cca85){_0x54b4aa=_0x54b4aa-0x0;var _0x104a21=_0xb234[_0x54b4aa];return _0x104a21;};'use strict';function Interval(_0x22de15){this['id']=_0x22de15['id']||0x0;this[_0x4b23('0x0')]=_0x22de15['name']||'';this[_0x4b23('0x1')]=_0x22de15[_0x4b23('0x1')]||{};}module[_0x4b23('0x2')]=Interval;
\ No newline at end of file
index e35d42e..e7f2edb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e24=['localhost','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','length','online','mailPause','available','stringify','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','../../../config/environment','redis','defaults'];(function(_0x1f98a2,_0x29f297){var _0x22cb5f=function(_0x415730){while(--_0x415730){_0x1f98a2['push'](_0x1f98a2['shift']());}};_0x22cb5f(++_0x29f297);}(_0x6e24,0xda));var _0x46e2=function(_0x1423cf,_0x623b0){_0x1423cf=_0x1423cf-0x0;var _0x2cd9b7=_0x6e24[_0x1423cf];return _0x2cd9b7;};'use strict';var _=require(_0x46e2('0x0'));var md5=require(_0x46e2('0x1'));var util=require(_0x46e2('0x2'));var Redis=require('ioredis');var config=require(_0x46e2('0x3'));config[_0x46e2('0x4')]=_[_0x46e2('0x5')](config[_0x46e2('0x4')],{'host':_0x46e2('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x46e2('0x4')]));function MailQueue(_0x5b7a81){this['id']=_0x5b7a81['id']||0x0;this[_0x46e2('0x7')]=_0x5b7a81[_0x46e2('0x7')]||'';this['timeout']=_0x5b7a81['timeout']||0xa;this[_0x46e2('0x8')]=_0x5b7a81[_0x46e2('0x8')]||_0x46e2('0x9');this[_0x46e2('0xa')]=_0x5b7a81[_0x46e2('0xa')];this[_0x46e2('0xb')]={};this[_0x46e2('0xc')]=0x0;this[_0x46e2('0x1')]='';this[_0x46e2('0xd')]();this[_0x46e2('0xe')]();}MailQueue['prototype']['updateRouting']=function(){var _0xffed69=this['mapAgentsId'][_0x46e2('0xf')];this[_0x46e2('0xb')]=_[_0x46e2('0x10')](this[_0x46e2('0xa')],'id');this[_0x46e2('0xb')][_0x46e2('0xf')]=_0xffed69;};MailQueue[_0x46e2('0x11')]['updateRealtime']=function(){this[_0x46e2('0x12')]=0x0;this[_0x46e2('0x13')]=0x0;for(var _0x34b99b=0x0;_0x34b99b<this[_0x46e2('0xa')][_0x46e2('0x14')];_0x34b99b+=0x1){if(this[_0x46e2('0xa')][_0x34b99b][_0x46e2('0x15')]){this[_0x46e2('0x12')]+=0x1;}if(this[_0x46e2('0xa')][_0x34b99b][_0x46e2('0x16')]){this[_0x46e2('0x13')]+=0x1;}}this[_0x46e2('0x17')]=this['loggedIn']-this[_0x46e2('0x13')];this[_0x46e2('0x17')]=this[_0x46e2('0x17')]>=0x0?this['available']:0x0;var _0x58d041={'id':this['id'],'available':this['available'],'loggedIn':this[_0x46e2('0x12')],'name':this[_0x46e2('0x7')],'paused':this[_0x46e2('0x13')],'waiting':this[_0x46e2('0xc')]};var _0x428dd9=md5(JSON[_0x46e2('0x18')](_0x58d041));if(this[_0x46e2('0x1')]!==_0x428dd9){this[_0x46e2('0x1')]=_0x428dd9;io['to'](util['format'](_0x46e2('0x19'),_0x58d041[_0x46e2('0x7')]))[_0x46e2('0x1a')](_0x46e2('0x1b'),_0x58d041);}};module['exports']=MailQueue;
\ No newline at end of file
+var _0xef07=['stringify','format','emit','mail_queue:save','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','prototype','map','Agents','_rr','updateRealtime','loggedIn','paused','online','mailPause','available'];(function(_0x325cc3,_0xe3eaf6){var _0x2f4fc4=function(_0x2494ce){while(--_0x2494ce){_0x325cc3['push'](_0x325cc3['shift']());}};_0x2f4fc4(++_0xe3eaf6);}(_0xef07,0xec));var _0x7ef0=function(_0xcfc44,_0x179bc1){_0xcfc44=_0xcfc44-0x0;var _0x307a25=_0xef07[_0xcfc44];return _0x307a25;};'use strict';var _=require(_0x7ef0('0x0'));var md5=require(_0x7ef0('0x1'));var util=require(_0x7ef0('0x2'));var Redis=require(_0x7ef0('0x3'));var config=require('../../../config/environment');config[_0x7ef0('0x4')]=_[_0x7ef0('0x5')](config['redis'],{'host':_0x7ef0('0x6'),'port':0x18eb});var io=require(_0x7ef0('0x7'))(new Redis(config[_0x7ef0('0x4')]));function MailQueue(_0x8acc13){this['id']=_0x8acc13['id']||0x0;this[_0x7ef0('0x8')]=_0x8acc13[_0x7ef0('0x8')]||'';this[_0x7ef0('0x9')]=_0x8acc13[_0x7ef0('0x9')]||0xa;this['strategy']=_0x8acc13[_0x7ef0('0xa')]||_0x7ef0('0xb');this['Agents']=_0x8acc13['Agents'];this[_0x7ef0('0xc')]={};this[_0x7ef0('0xd')]=0x0;this[_0x7ef0('0x1')]='';this[_0x7ef0('0xe')]();this['updateRealtime']();}MailQueue[_0x7ef0('0xf')][_0x7ef0('0xe')]=function(){var _0x1f9a8e=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0x7ef0('0x10')](this[_0x7ef0('0x11')],'id');this[_0x7ef0('0xc')][_0x7ef0('0x12')]=_0x1f9a8e;};MailQueue[_0x7ef0('0xf')][_0x7ef0('0x13')]=function(){this[_0x7ef0('0x14')]=0x0;this[_0x7ef0('0x15')]=0x0;for(var _0x24d290=0x0;_0x24d290<this['Agents']['length'];_0x24d290+=0x1){if(this[_0x7ef0('0x11')][_0x24d290][_0x7ef0('0x16')]){this['loggedIn']+=0x1;}if(this[_0x7ef0('0x11')][_0x24d290][_0x7ef0('0x17')]){this[_0x7ef0('0x15')]+=0x1;}}this[_0x7ef0('0x18')]=this[_0x7ef0('0x14')]-this['paused'];this[_0x7ef0('0x18')]=this[_0x7ef0('0x18')]>=0x0?this[_0x7ef0('0x18')]:0x0;var _0xd303df={'id':this['id'],'available':this[_0x7ef0('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x7ef0('0x8')],'paused':this['paused'],'waiting':this[_0x7ef0('0xd')]};var _0xec39=md5(JSON[_0x7ef0('0x19')](_0xd303df));if(this['md5']!==_0xec39){this[_0x7ef0('0x1')]=_0xec39;io['to'](util[_0x7ef0('0x1a')]('mail:queue:%s',_0xd303df['name']))[_0x7ef0('0x1b')](_0x7ef0('0x1c'),_0xd303df);}};module['exports']=MailQueue;
\ No newline at end of file
index d284e9f..f11c5f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x326f,0xd1));var _0xf326=function(_0x4c6ecf,_0x162211){_0x4c6ecf=_0x4c6ecf-0x0;var _0x5a0e78=_0x326f[_0x4c6ecf];return _0x5a0e78;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483<this[_0xf326('0xf')]['length'];_0x5c8483+=0x1){if(this['Agents'][_0x5c8483][_0xf326('0x13')]){this[_0xf326('0x11')]+=0x1;}if(this[_0xf326('0xf')][_0x5c8483][_0xf326('0x14')]){this[_0xf326('0x12')]+=0x1;}}this[_0xf326('0x15')]=this[_0xf326('0x11')]-this[_0xf326('0x12')];this['available']=this[_0xf326('0x15')]>=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue;
\ No newline at end of file
+var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0x34d3fd,_0x318265){var _0x4730c8=function(_0x5e9006){while(--_0x5e9006){_0x34d3fd['push'](_0x34d3fd['shift']());}};_0x4730c8(++_0x318265);}(_0x5fc3,0xa8));var _0x35fc=function(_0xd9f102,_0x5a0d28){_0xd9f102=_0xd9f102-0x0;var _0x2652e4=_0x5fc3[_0xd9f102];return _0x2652e4;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2<this['Agents']['length'];_0x38d9f2+=0x1){if(this['Agents'][_0x38d9f2]['online']){this[_0x35fc('0x11')]+=0x1;}if(this[_0x35fc('0xa')][_0x38d9f2][_0x35fc('0x13')]){this[_0x35fc('0x12')]+=0x1;}}this[_0x35fc('0x14')]=this[_0x35fc('0x11')]-this['paused'];this[_0x35fc('0x14')]=this[_0x35fc('0x14')]>=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue;
\ No newline at end of file
index 198a017..0c48767 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdace=['sms_queue:save','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','length','online','available','stringify','md5','format','sms:queue:%s','emit'];(function(_0x3f4cd0,_0x303070){var _0x3f9f01=function(_0x6ced93){while(--_0x6ced93){_0x3f4cd0['push'](_0x3f4cd0['shift']());}};_0x3f9f01(++_0x303070);}(_0xdace,0xc5));var _0xedac=function(_0xd13a88,_0x3c5269){_0xd13a88=_0xd13a88-0x0;var _0x1c993c=_0xdace[_0xd13a88];return _0x1c993c;};'use strict';var _=require(_0xedac('0x0'));var md5=require('md5');var util=require(_0xedac('0x1'));var Redis=require(_0xedac('0x2'));var config=require(_0xedac('0x3'));config['redis']=_[_0xedac('0x4')](config[_0xedac('0x5')],{'host':_0xedac('0x6'),'port':0x18eb});var io=require(_0xedac('0x7'))(new Redis(config['redis']));function SmsQueue(_0x32b066){this['id']=_0x32b066['id']||0x0;this[_0xedac('0x8')]=_0x32b066[_0xedac('0x8')]||'';this['timeout']=_0x32b066[_0xedac('0x9')]||0xa;this[_0xedac('0xa')]=_0x32b066[_0xedac('0xa')]||'beepall';this[_0xedac('0xb')]=_0x32b066[_0xedac('0xb')];this[_0xedac('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0xedac('0xd')]();this[_0xedac('0xe')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x4db2ad=this[_0xedac('0xc')]['_rr'];this[_0xedac('0xc')]=_['map'](this[_0xedac('0xb')],'id');this[_0xedac('0xc')][_0xedac('0xf')]=_0x4db2ad;};SmsQueue[_0xedac('0x10')][_0xedac('0xe')]=function(){this[_0xedac('0x11')]=0x0;this[_0xedac('0x12')]=0x0;for(var _0x11f0b0=0x0;_0x11f0b0<this['Agents'][_0xedac('0x13')];_0x11f0b0+=0x1){if(this[_0xedac('0xb')][_0x11f0b0][_0xedac('0x14')]){this[_0xedac('0x11')]+=0x1;}if(this[_0xedac('0xb')][_0x11f0b0]['smsPause']){this[_0xedac('0x12')]+=0x1;}}this['available']=this[_0xedac('0x11')]-this[_0xedac('0x12')];this[_0xedac('0x15')]=this[_0xedac('0x15')]>=0x0?this['available']:0x0;var _0x4b2563={'id':this['id'],'available':this[_0xedac('0x15')],'loggedIn':this[_0xedac('0x11')],'name':this[_0xedac('0x8')],'paused':this[_0xedac('0x12')],'waiting':this['waiting']};var _0x4a699b=md5(JSON[_0xedac('0x16')](_0x4b2563));if(this[_0xedac('0x17')]!==_0x4a699b){this[_0xedac('0x17')]=_0x4a699b;io['to'](util[_0xedac('0x18')](_0xedac('0x19'),_0x4b2563[_0xedac('0x8')]))[_0xedac('0x1a')](_0xedac('0x1b'),_0x4b2563);}};module['exports']=SmsQueue;
\ No newline at end of file
+var _0x6f0d=['waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','smsPause','available','format','sms:queue:%s','emit','sms_queue:save','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId'];(function(_0x262ff6,_0x158799){var _0x4c9b82=function(_0x2d854d){while(--_0x2d854d){_0x262ff6['push'](_0x262ff6['shift']());}};_0x4c9b82(++_0x158799);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x5a8e13,_0x3dad1b){_0x5a8e13=_0x5a8e13-0x0;var _0x407095=_0x6f0d[_0x5a8e13];return _0x407095;};'use strict';var _=require('lodash');var md5=require(_0xd6f0('0x0'));var util=require(_0xd6f0('0x1'));var Redis=require(_0xd6f0('0x2'));var config=require(_0xd6f0('0x3'));config['redis']=_[_0xd6f0('0x4')](config[_0xd6f0('0x5')],{'host':_0xd6f0('0x6'),'port':0x18eb});var io=require(_0xd6f0('0x7'))(new Redis(config[_0xd6f0('0x5')]));function SmsQueue(_0x59f5d2){this['id']=_0x59f5d2['id']||0x0;this[_0xd6f0('0x8')]=_0x59f5d2['name']||'';this[_0xd6f0('0x9')]=_0x59f5d2[_0xd6f0('0x9')]||0xa;this[_0xd6f0('0xa')]=_0x59f5d2[_0xd6f0('0xa')]||'beepall';this['Agents']=_0x59f5d2[_0xd6f0('0xb')];this[_0xd6f0('0xc')]={};this[_0xd6f0('0xd')]=0x0;this[_0xd6f0('0x0')]='';this[_0xd6f0('0xe')]();this['updateRealtime']();}SmsQueue[_0xd6f0('0xf')][_0xd6f0('0xe')]=function(){var _0x329f69=this[_0xd6f0('0xc')]['_rr'];this[_0xd6f0('0xc')]=_[_0xd6f0('0x10')](this[_0xd6f0('0xb')],'id');this[_0xd6f0('0xc')][_0xd6f0('0x11')]=_0x329f69;};SmsQueue[_0xd6f0('0xf')][_0xd6f0('0x12')]=function(){this[_0xd6f0('0x13')]=0x0;this[_0xd6f0('0x14')]=0x0;for(var _0x4ab979=0x0;_0x4ab979<this[_0xd6f0('0xb')][_0xd6f0('0x15')];_0x4ab979+=0x1){if(this['Agents'][_0x4ab979][_0xd6f0('0x16')]){this['loggedIn']+=0x1;}if(this[_0xd6f0('0xb')][_0x4ab979][_0xd6f0('0x17')]){this[_0xd6f0('0x14')]+=0x1;}}this[_0xd6f0('0x18')]=this[_0xd6f0('0x13')]-this[_0xd6f0('0x14')];this[_0xd6f0('0x18')]=this[_0xd6f0('0x18')]>=0x0?this[_0xd6f0('0x18')]:0x0;var _0x1862a9={'id':this['id'],'available':this[_0xd6f0('0x18')],'loggedIn':this[_0xd6f0('0x13')],'name':this[_0xd6f0('0x8')],'paused':this[_0xd6f0('0x14')],'waiting':this[_0xd6f0('0xd')]};var _0xde87d4=md5(JSON['stringify'](_0x1862a9));if(this['md5']!==_0xde87d4){this[_0xd6f0('0x0')]=_0xde87d4;io['to'](util[_0xd6f0('0x19')](_0xd6f0('0x1a'),_0x1862a9['name']))[_0xd6f0('0x1b')](_0xd6f0('0x1c'),_0x1862a9);}};module['exports']=SmsQueue;
\ No newline at end of file
index bf24398..598cc93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf196=['ioredis','../../../config/environment','redis','localhost','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','online','available','stringify','format','whatsapp:queue:%s','emit','exports','md5'];(function(_0x39738a,_0x3f0c86){var _0x54c25c=function(_0x2cb898){while(--_0x2cb898){_0x39738a['push'](_0x39738a['shift']());}};_0x54c25c(++_0x3f0c86);}(_0xf196,0x11d));var _0x6f19=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf196[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var md5=require(_0x6f19('0x0'));var util=require('util');var Redis=require(_0x6f19('0x1'));var config=require(_0x6f19('0x2'));config[_0x6f19('0x3')]=_['defaults'](config[_0x6f19('0x3')],{'host':_0x6f19('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x54f239){this['id']=_0x54f239['id']||0x0;this[_0x6f19('0x5')]=_0x54f239[_0x6f19('0x5')]||'';this['timeout']=_0x54f239['timeout']||0xa;this['strategy']=_0x54f239[_0x6f19('0x6')]||_0x6f19('0x7');this[_0x6f19('0x8')]=_0x54f239[_0x6f19('0x8')];this[_0x6f19('0x9')]={};this[_0x6f19('0xa')]=0x0;this[_0x6f19('0x0')]='';this['updateRouting']();this[_0x6f19('0xb')]();}WhatsappQueue[_0x6f19('0xc')][_0x6f19('0xd')]=function(){var _0x3bfbea=this[_0x6f19('0x9')][_0x6f19('0xe')];this[_0x6f19('0x9')]=_[_0x6f19('0xf')](this[_0x6f19('0x8')],'id');this[_0x6f19('0x9')][_0x6f19('0xe')]=_0x3bfbea;};WhatsappQueue['prototype'][_0x6f19('0xb')]=function(){this[_0x6f19('0x10')]=0x0;this[_0x6f19('0x11')]=0x0;for(var _0x1b4a7a=0x0;_0x1b4a7a<this[_0x6f19('0x8')][_0x6f19('0x12')];_0x1b4a7a+=0x1){if(this[_0x6f19('0x8')][_0x1b4a7a][_0x6f19('0x13')]){this[_0x6f19('0x10')]+=0x1;}if(this[_0x6f19('0x8')][_0x1b4a7a]['whatsappPause']){this[_0x6f19('0x11')]+=0x1;}}this[_0x6f19('0x14')]=this['loggedIn']-this[_0x6f19('0x11')];this[_0x6f19('0x14')]=this['available']>=0x0?this['available']:0x0;var _0x17fa1f={'id':this['id'],'available':this[_0x6f19('0x14')],'loggedIn':this[_0x6f19('0x10')],'name':this[_0x6f19('0x5')],'paused':this[_0x6f19('0x11')],'waiting':this[_0x6f19('0xa')]};var _0x4d9fc4=md5(JSON[_0x6f19('0x15')](_0x17fa1f));if(this[_0x6f19('0x0')]!==_0x4d9fc4){this['md5']=_0x4d9fc4;io['to'](util[_0x6f19('0x16')](_0x6f19('0x17'),_0x17fa1f[_0x6f19('0x5')]))[_0x6f19('0x18')]('whatsapp_queue:save',_0x17fa1f);}};module[_0x6f19('0x19')]=WhatsappQueue;
\ No newline at end of file
+var _0x26a3=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','whatsappPause','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','lodash','md5','util'];(function(_0x551906,_0x569941){var _0x58bfb6=function(_0x1eb6de){while(--_0x1eb6de){_0x551906['push'](_0x551906['shift']());}};_0x58bfb6(++_0x569941);}(_0x26a3,0x115));var _0x326a=function(_0x5c7eff,_0x5a7cba){_0x5c7eff=_0x5c7eff-0x0;var _0x209ee2=_0x26a3[_0x5c7eff];return _0x209ee2;};'use strict';var _=require(_0x326a('0x0'));var md5=require(_0x326a('0x1'));var util=require(_0x326a('0x2'));var Redis=require('ioredis');var config=require(_0x326a('0x3'));config[_0x326a('0x4')]=_[_0x326a('0x5')](config[_0x326a('0x4')],{'host':_0x326a('0x6'),'port':0x18eb});var io=require(_0x326a('0x7'))(new Redis(config[_0x326a('0x4')]));function WhatsappQueue(_0x36ede6){this['id']=_0x36ede6['id']||0x0;this['name']=_0x36ede6[_0x326a('0x8')]||'';this[_0x326a('0x9')]=_0x36ede6[_0x326a('0x9')]||0xa;this[_0x326a('0xa')]=_0x36ede6[_0x326a('0xa')]||'beepall';this[_0x326a('0xb')]=_0x36ede6[_0x326a('0xb')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x326a('0x1')]='';this[_0x326a('0xc')]();this[_0x326a('0xd')]();}WhatsappQueue[_0x326a('0xe')][_0x326a('0xc')]=function(){var _0x47d876=this[_0x326a('0xf')][_0x326a('0x10')];this[_0x326a('0xf')]=_[_0x326a('0x11')](this[_0x326a('0xb')],'id');this[_0x326a('0xf')][_0x326a('0x10')]=_0x47d876;};WhatsappQueue[_0x326a('0xe')][_0x326a('0xd')]=function(){this[_0x326a('0x12')]=0x0;this[_0x326a('0x13')]=0x0;for(var _0x321eee=0x0;_0x321eee<this[_0x326a('0xb')][_0x326a('0x14')];_0x321eee+=0x1){if(this['Agents'][_0x321eee]['online']){this[_0x326a('0x12')]+=0x1;}if(this['Agents'][_0x321eee][_0x326a('0x15')]){this[_0x326a('0x13')]+=0x1;}}this[_0x326a('0x16')]=this['loggedIn']-this[_0x326a('0x13')];this[_0x326a('0x16')]=this['available']>=0x0?this['available']:0x0;var _0x4e2edf={'id':this['id'],'available':this[_0x326a('0x16')],'loggedIn':this[_0x326a('0x12')],'name':this['name'],'paused':this[_0x326a('0x13')],'waiting':this['waiting']};var _0x522f38=md5(JSON[_0x326a('0x17')](_0x4e2edf));if(this[_0x326a('0x1')]!==_0x522f38){this[_0x326a('0x1')]=_0x522f38;io['to'](util[_0x326a('0x18')](_0x326a('0x19'),_0x4e2edf[_0x326a('0x8')]))[_0x326a('0x1a')](_0x326a('0x1b'),_0x4e2edf);}};module['exports']=WhatsappQueue;
\ No newline at end of file
index 5a81728..d65743a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x58fe2e,_0x1fbbf7){var _0x2b93f7=function(_0x61db3b){while(--_0x61db3b){_0x58fe2e['push'](_0x58fe2e['shift']());}};_0x2b93f7(++_0x1fbbf7);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b7711,_0x4bd810){_0x5b7711=_0x5b7711-0x0;var _0x16e558=_0xb10b[_0x5b7711];return _0x16e558;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime;
\ No newline at end of file
+var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
index 020028d..526b4aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd51=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update'];(function(_0x181b30,_0x45868a){var _0xfd358c=function(_0x1854a3){while(--_0x1854a3){_0x181b30['push'](_0x181b30['shift']());}};_0xfd358c(++_0x45868a);}(_0xfd51,0xd6));var _0x1fd5=function(_0x25d65c,_0x223416){_0x25d65c=_0x25d65c-0x0;var _0x4e587f=_0xfd51[_0x25d65c];return _0x4e587f;};'use strict';var client=require(_0x1fd5('0x0'));exports[_0x1fd5('0x1')]=function(_0x16b53d,_0x136258){return client[_0x1fd5('0x2')](_0x1fd5('0x3'),{'body':_0x136258,'options':{'where':{'id':_0x16b53d}},'log':_0x1fd5('0x4')});};exports[_0x1fd5('0x5')]=function(_0x491646,_0x267a38){return client[_0x1fd5('0x2')](_0x1fd5('0x6'),{'body':_0x267a38,'options':{'where':{'id':_0x491646}},'log':_0x1fd5('0x7')});};
\ No newline at end of file
+var _0xb273=['addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction','AddTagsToChatInteraction'];(function(_0x5d82b0,_0x5b550e){var _0x4ec4ce=function(_0x338a23){while(--_0x338a23){_0x5d82b0['push'](_0x5d82b0['shift']());}};_0x4ec4ce(++_0x5b550e);}(_0xb273,0xc5));var _0x3b27=function(_0x4abe18,_0x51f0e4){_0x4abe18=_0x4abe18-0x0;var _0x39c8e7=_0xb273[_0x4abe18];return _0x39c8e7;};'use strict';var client=require(_0x3b27('0x0'));exports[_0x3b27('0x1')]=function(_0x15cd87,_0x1bb6a0){return client[_0x3b27('0x2')](_0x3b27('0x3'),{'body':_0x1bb6a0,'options':{'where':{'id':_0x15cd87}},'log':_0x3b27('0x4')});};exports['addTags']=function(_0x30dcdb,_0x4d88e3){return client['Request'](_0x3b27('0x5'),{'body':_0x4d88e3,'options':{'where':{'id':_0x30dcdb}},'log':_0x3b27('0x6')});};
\ No newline at end of file
index 8284051..43f9422 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e69=['../client','create','Request','createChatMessage'];(function(_0x4b0a5a,_0x49f7ab){var _0x12d259=function(_0x3cc158){while(--_0x3cc158){_0x4b0a5a['push'](_0x4b0a5a['shift']());}};_0x12d259(++_0x49f7ab);}(_0x2e69,0xf8));var _0x92e6=function(_0x2d2fd8,_0x5b86df){_0x2d2fd8=_0x2d2fd8-0x0;var _0x4cb012=_0x2e69[_0x2d2fd8];return _0x4cb012;};'use strict';var client=require(_0x92e6('0x0'));exports[_0x92e6('0x1')]=function(_0x31e378){return client[_0x92e6('0x2')]('CreateChatMessage',{'body':_0x31e378,'log':_0x92e6('0x3')});};
\ No newline at end of file
+var _0xcf77=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x2755a0,_0x4b3247){var _0xd48bf3=function(_0x4db61c){while(--_0x4db61c){_0x2755a0['push'](_0x2755a0['shift']());}};_0xd48bf3(++_0x4b3247);}(_0xcf77,0x14f));var _0x7cf7=function(_0x5b3d35,_0x2d660e){_0x5b3d35=_0x5b3d35-0x0;var _0x286618=_0xcf77[_0x5b3d35];return _0x286618;};'use strict';var client=require(_0x7cf7('0x0'));exports[_0x7cf7('0x1')]=function(_0x16271f){return client[_0x7cf7('0x2')](_0x7cf7('0x3'),{'body':_0x16271f,'log':_0x7cf7('0x4')});};
\ No newline at end of file
index e2f39b4..23413bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4491=['User','Agents','chatPause','../client','Request','name','timeout','strategy'];(function(_0xe67513,_0x40f459){var _0x19fc6c=function(_0x5bd801){while(--_0x5bd801){_0xe67513['push'](_0xe67513['shift']());}};_0x19fc6c(++_0x40f459);}(_0x4491,0x1bb));var _0x1449=function(_0x57e212,_0xb2da96){_0x57e212=_0x57e212-0x0;var _0x1e9cf7=_0x4491[_0x57e212];return _0x1e9cf7;};'use strict';var client=require(_0x1449('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x1449('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x1449('0x2'),_0x1449('0x3'),_0x1449('0x4')],'include':[{'model':_0x1449('0x5'),'as':_0x1449('0x6'),'attributes':['id',_0x1449('0x2'),'online',_0x1449('0x7')]}]},'log':'getChatQueues'});};};
\ No newline at end of file
+var _0xde64=['Agents','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','User'];(function(_0x3d8ca8,_0x1a9764){var _0x517e45=function(_0x641ad9){while(--_0x641ad9){_0x3d8ca8['push'](_0x3d8ca8['shift']());}};_0x517e45(++_0x1a9764);}(_0xde64,0x17c));var _0x4de6=function(_0x2e02a0,_0x4e440a){_0x2e02a0=_0x2e02a0-0x0;var _0x2b2383=_0xde64[_0x2e02a0];return _0x2b2383;};'use strict';var client=require(_0x4de6('0x0'));exports[_0x4de6('0x1')]=function(){return function(){return client[_0x4de6('0x2')](_0x4de6('0x3'),{'options':{'raw':![],'attributes':['id',_0x4de6('0x4'),_0x4de6('0x5'),'strategy'],'include':[{'model':_0x4de6('0x6'),'as':_0x4de6('0x7'),'attributes':['id','name','online',_0x4de6('0x8')]}]},'log':_0x4de6('0x1')});};};
\ No newline at end of file
index 9dc1895..7133302 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b37=['Request','CreateChatQueueReport','update','DESC','UpdateChatQueueReport','../client','create'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x2b37,0x12b));var _0x72b3=function(_0x44ec9c,_0x3fdf61){_0x44ec9c=_0x44ec9c-0x0;var _0x5265e0=_0x2b37[_0x44ec9c];return _0x5265e0;};'use strict';var client=require(_0x72b3('0x0'));exports[_0x72b3('0x1')]=function(_0x3fbc04){return client[_0x72b3('0x2')](_0x72b3('0x3'),{'body':_0x3fbc04,'log':_0x72b3('0x3')});};exports[_0x72b3('0x4')]=function(_0x2c5833,_0x217bcc){return client[_0x72b3('0x2')]('UpdateChatQueueReport',{'body':_0x217bcc,'options':{'where':{'uniqueid':_0x2c5833},'order':[['id',_0x72b3('0x5')]],'limit':0x1},'log':_0x72b3('0x6')});};
\ No newline at end of file
+var _0x1666=['CreateChatQueueReport','update','UpdateChatQueueReport','../client','create','Request'];(function(_0x32f966,_0x2dbb2f){var _0x17534d=function(_0x1de21f){while(--_0x1de21f){_0x32f966['push'](_0x32f966['shift']());}};_0x17534d(++_0x2dbb2f);}(_0x1666,0x75));var _0x6166=function(_0x9c9a2c,_0x2a6bff){_0x9c9a2c=_0x9c9a2c-0x0;var _0x408421=_0x1666[_0x9c9a2c];return _0x408421;};'use strict';var client=require(_0x6166('0x0'));exports[_0x6166('0x1')]=function(_0x4f60ad){return client[_0x6166('0x2')](_0x6166('0x3'),{'body':_0x4f60ad,'log':_0x6166('0x3')});};exports[_0x6166('0x4')]=function(_0x364bba,_0x15afdd){return client[_0x6166('0x2')](_0x6166('0x5'),{'body':_0x15afdd,'options':{'where':{'uniqueid':_0x364bba},'order':[['id','DESC']],'limit':0x1},'log':_0x6166('0x5')});};
\ No newline at end of file
index 1664b2e..ecea2a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x17b692,_0x2197f8){var _0x22a6f9=function(_0x33ff2a){while(--_0x33ff2a){_0x17b692['push'](_0x17b692['shift']());}};_0x22a6f9(++_0x2197f8);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
+var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x1c8b26,_0x2b1211){var _0x52e32b=function(_0x340ebb){while(--_0x340ebb){_0x1c8b26['push'](_0x1c8b26['shift']());}};_0x52e32b(++_0x2b1211);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});};
\ No newline at end of file
index 2c3644d..2e90a63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c73=['Request','createFaxMessage','create'];(function(_0x215764,_0x5c2e52){var _0xdb9697=function(_0xd86c4f){while(--_0xd86c4f){_0x215764['push'](_0x215764['shift']());}};_0xdb9697(++_0x5c2e52);}(_0x1c73,0x65));var _0x31c7=function(_0x4d0a9d,_0x2d1efd){_0x4d0a9d=_0x4d0a9d-0x0;var _0x4ceee7=_0x1c73[_0x4d0a9d];return _0x4ceee7;};'use strict';var client=require('../client');exports[_0x31c7('0x0')]=function(_0xd23e1){return client[_0x31c7('0x1')]('CreateFaxMessage',{'body':_0xd23e1,'log':_0x31c7('0x2')});};
\ No newline at end of file
+var _0x1939=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x4ce8a4,_0x40c3aa){var _0x4200bb=function(_0x225fe9){while(--_0x225fe9){_0x4ce8a4['push'](_0x4ce8a4['shift']());}};_0x4200bb(++_0x40c3aa);}(_0x1939,0x17d));var _0x9193=function(_0x5e3cef,_0x3c57f5){_0x5e3cef=_0x5e3cef-0x0;var _0x34c370=_0x1939[_0x5e3cef];return _0x34c370;};'use strict';var client=require('../client');exports[_0x9193('0x0')]=function(_0x853ca3){return client[_0x9193('0x1')](_0x9193('0x2'),{'body':_0x853ca3,'log':_0x9193('0x3')});};
\ No newline at end of file
index 67089cd..c3fd058 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c1a=['faxPause','../client','getFaxQueues','Request','GetFaxQueue','timeout','strategy','User','name','online'];(function(_0xf65b58,_0x3e7366){var _0x1d1178=function(_0x55ea04){while(--_0x55ea04){_0xf65b58['push'](_0xf65b58['shift']());}};_0x1d1178(++_0x3e7366);}(_0x7c1a,0x97));var _0xa7c1=function(_0x2a0c70,_0x6e3977){_0x2a0c70=_0x2a0c70-0x0;var _0x3e399d=_0x7c1a[_0x2a0c70];return _0x3e399d;};'use strict';var client=require(_0xa7c1('0x0'));exports[_0xa7c1('0x1')]=function(){return function(){return client[_0xa7c1('0x2')](_0xa7c1('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xa7c1('0x4'),_0xa7c1('0x5')],'include':[{'model':_0xa7c1('0x6'),'as':'Agents','attributes':['id',_0xa7c1('0x7'),_0xa7c1('0x8'),_0xa7c1('0x9')]}]},'log':_0xa7c1('0x1')});};};
\ No newline at end of file
+var _0x798a=['name','online','getFaxQueues','../client','timeout','User','Agents'];(function(_0x175488,_0x28aecf){var _0x3d698f=function(_0x415f48){while(--_0x415f48){_0x175488['push'](_0x175488['shift']());}};_0x3d698f(++_0x28aecf);}(_0x798a,0xb2));var _0xa798=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x798a[_0x4565bf];return _0x5610ba;};'use strict';var client=require(_0xa798('0x0'));exports['getFaxQueues']=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id','name',_0xa798('0x1'),'strategy'],'include':[{'model':_0xa798('0x2'),'as':_0xa798('0x3'),'attributes':['id',_0xa798('0x4'),_0xa798('0x5'),'faxPause']}]},'log':_0xa798('0x6')});};};
\ No newline at end of file
index 43d6006..9f4837e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb2f3=['UpdateFaxQueueReport','CreateFaxQueueReport'];(function(_0x573742,_0x59d858){var _0x58b41c=function(_0x175f2c){while(--_0x175f2c){_0x573742['push'](_0x573742['shift']());}};_0x58b41c(++_0x59d858);}(_0xb2f3,0x1b9));var _0x3b2f=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xb2f3[_0x42bdad];return _0x122626;};'use strict';var client=require('../client');exports['create']=function(_0x365fe9){return client['Request']('CreateFaxQueueReport',{'body':_0x365fe9,'log':_0x3b2f('0x0')});};exports['update']=function(_0x41e2b6,_0x2a350d){return client['Request'](_0x3b2f('0x1'),{'body':_0x2a350d,'options':{'where':{'uniqueid':_0x41e2b6},'order':[['id','DESC']],'limit':0x1},'log':_0x3b2f('0x1')});};
\ No newline at end of file
+var _0xe13d=['update','DESC','UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport'];(function(_0x30e05a,_0x23f2c9){var _0x17fffd=function(_0x504831){while(--_0x504831){_0x30e05a['push'](_0x30e05a['shift']());}};_0x17fffd(++_0x23f2c9);}(_0xe13d,0x96));var _0xde13=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xe13d[_0x4fc9e6];return _0x551d28;};'use strict';var client=require(_0xde13('0x0'));exports[_0xde13('0x1')]=function(_0x324f9f){return client[_0xde13('0x2')](_0xde13('0x3'),{'body':_0x324f9f,'log':_0xde13('0x3')});};exports[_0xde13('0x4')]=function(_0x363f9b,_0x1a3943){return client[_0xde13('0x2')]('UpdateFaxQueueReport',{'body':_0x1a3943,'options':{'where':{'uniqueid':_0x363f9b},'order':[['id',_0xde13('0x5')]],'limit':0x1},'log':_0xde13('0x6')});};
\ No newline at end of file
index 56c314b..e76b8e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcf9=['name','Interval','getIntervals','../client','Request','GetInterval'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbcf9,0x87));var _0x9bcf=function(_0x3b25aa,_0x5597a2){_0x3b25aa=_0x3b25aa-0x0;var _0xad0b1e=_0xbcf9[_0x3b25aa];return _0xad0b1e;};'use strict';var client=require(_0x9bcf('0x0'));exports['getIntervals']=function(){return function(){return client[_0x9bcf('0x1')](_0x9bcf('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x9bcf('0x3')],'include':[{'model':_0x9bcf('0x4'),'as':'Intervals','attributes':['id',_0x9bcf('0x3'),'interval']}]},'log':_0x9bcf('0x5')});};};
\ No newline at end of file
+var _0x54eb=['getIntervals','Request','Interval','Intervals','name','interval','../client'];(function(_0x1efa5c,_0x4deafb){var _0x4f8376=function(_0x132a82){while(--_0x132a82){_0x1efa5c['push'](_0x1efa5c['shift']());}};_0x4f8376(++_0x4deafb);}(_0x54eb,0xae));var _0xb54e=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x54eb[_0x50a0c2];return _0x5ebadd;};'use strict';var client=require(_0xb54e('0x0'));exports[_0xb54e('0x1')]=function(){return function(){return client[_0xb54e('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xb54e('0x3'),'as':_0xb54e('0x4'),'attributes':['id',_0xb54e('0x5'),_0xb54e('0x6')]}]},'log':_0xb54e('0x1')});};};
\ No newline at end of file
index a57cdc7..22b2617 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','updateMailInteraction','addTags'];(function(_0x45dbe3,_0xd2bf96){var _0x1e71cf=function(_0x47d46d){while(--_0x47d46d){_0x45dbe3['push'](_0x45dbe3['shift']());}};_0x1e71cf(++_0xd2bf96);}(_0xb016,0x159));var _0x6b01=function(_0x22cc47,_0x35c0c1){_0x22cc47=_0x22cc47-0x0;var _0x4a73b3=_0xb016[_0x22cc47];return _0x4a73b3;};'use strict';var client=require(_0x6b01('0x0'));exports[_0x6b01('0x1')]=function(_0x513ed6,_0x57ecae){return client[_0x6b01('0x2')]('UpdateMailInteraction',{'body':_0x57ecae,'options':{'where':{'id':_0x513ed6}},'log':_0x6b01('0x3')});};exports[_0x6b01('0x4')]=function(_0x161b59,_0x3b9de1){return client['Request'](_0x6b01('0x5'),{'body':_0x3b9de1,'options':{'where':{'id':_0x161b59}},'log':_0x6b01('0x6')});};
\ No newline at end of file
+var _0xbbbc=['addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction','AddTagsToMailInteraction'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xbbbc,0xf6));var _0xcbbb=function(_0xa5aaf9,_0x51c384){_0xa5aaf9=_0xa5aaf9-0x0;var _0x2c05d0=_0xbbbc[_0xa5aaf9];return _0x2c05d0;};'use strict';var client=require(_0xcbbb('0x0'));exports[_0xcbbb('0x1')]=function(_0x4314a8,_0x4538f9){return client[_0xcbbb('0x2')](_0xcbbb('0x3'),{'body':_0x4538f9,'options':{'where':{'id':_0x4314a8}},'log':_0xcbbb('0x4')});};exports['addTags']=function(_0xb1ad23,_0x938376){return client[_0xcbbb('0x2')](_0xcbbb('0x5'),{'body':_0x938376,'options':{'where':{'id':_0xb1ad23}},'log':_0xcbbb('0x6')});};
\ No newline at end of file
index 941d823..37a94c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1662=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x2534a6,_0x14c2c3){var _0x3d9c41=function(_0x4ea84d){while(--_0x4ea84d){_0x2534a6['push'](_0x2534a6['shift']());}};_0x3d9c41(++_0x14c2c3);}(_0x1662,0x155));var _0x2166=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x1662[_0x5608a3];return _0x1ed50a;};'use strict';var client=require(_0x2166('0x0'));exports[_0x2166('0x1')]=function(_0xdb0672){return client[_0x2166('0x2')](_0x2166('0x3'),{'body':_0xdb0672,'log':_0x2166('0x4')});};
\ No newline at end of file
+var _0x5de7=['../client','Request'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5de7,0x10a));var _0x75de=function(_0xe42aa5,_0x4fc95a){_0xe42aa5=_0xe42aa5-0x0;var _0x31b93a=_0x5de7[_0xe42aa5];return _0x31b93a;};'use strict';var client=require(_0x75de('0x0'));exports['create']=function(_0x4b4b72){return client[_0x75de('0x1')]('CreateMailMessage',{'body':_0x4b4b72,'log':'createMailMessage'});};
\ No newline at end of file
index ed04408..4c4b923 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa884=['name','User','online','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x246115,_0x398123){var _0x385878=function(_0x534a9c){while(--_0x534a9c){_0x246115['push'](_0x246115['shift']());}};_0x385878(++_0x398123);}(_0xa884,0x1b4));var _0x4a88=function(_0x3cb3ca,_0x44d697){_0x3cb3ca=_0x3cb3ca-0x0;var _0x214366=_0xa884[_0x3cb3ca];return _0x214366;};'use strict';var client=require(_0x4a88('0x0'));exports[_0x4a88('0x1')]=function(){return function(){return client[_0x4a88('0x2')](_0x4a88('0x3'),{'options':{'raw':![],'attributes':['id',_0x4a88('0x4'),'timeout','strategy'],'include':[{'model':_0x4a88('0x5'),'as':'Agents','attributes':['id','name',_0x4a88('0x6'),_0x4a88('0x7')]}]},'log':_0x4a88('0x1')});};};
\ No newline at end of file
+var _0x6aa1=['User','Agents','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy'];(function(_0x520043,_0x13b217){var _0x455caa=function(_0x1478af){while(--_0x1478af){_0x520043['push'](_0x520043['shift']());}};_0x455caa(++_0x13b217);}(_0x6aa1,0x7b));var _0x16aa=function(_0x3a991e,_0x3c71e8){_0x3a991e=_0x3a991e-0x0;var _0x5acb5d=_0x6aa1[_0x3a991e];return _0x5acb5d;};'use strict';var client=require(_0x16aa('0x0'));exports[_0x16aa('0x1')]=function(){return function(){return client[_0x16aa('0x2')](_0x16aa('0x3'),{'options':{'raw':![],'attributes':['id',_0x16aa('0x4'),_0x16aa('0x5'),_0x16aa('0x6')],'include':[{'model':_0x16aa('0x7'),'as':_0x16aa('0x8'),'attributes':['id','name','online',_0x16aa('0x9')]}]},'log':_0x16aa('0x1')});};};
\ No newline at end of file
index 8e144b9..bfd5e94 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a59=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x2e221e,_0x31a9d3){var _0x2316b3=function(_0x352d9f){while(--_0x352d9f){_0x2e221e['push'](_0x2e221e['shift']());}};_0x2316b3(++_0x31a9d3);}(_0x4a59,0x19a));var _0x94a5=function(_0x1654ef,_0x1ced97){_0x1654ef=_0x1654ef-0x0;var _0x67c8f8=_0x4a59[_0x1654ef];return _0x67c8f8;};'use strict';var client=require(_0x94a5('0x0'));exports[_0x94a5('0x1')]=function(_0x4d2244){return client[_0x94a5('0x2')](_0x94a5('0x3'),{'body':_0x4d2244,'log':_0x94a5('0x3')});};exports[_0x94a5('0x4')]=function(_0x47bd5e,_0x12ae08){return client[_0x94a5('0x2')](_0x94a5('0x5'),{'body':_0x12ae08,'options':{'where':{'uniqueid':_0x47bd5e},'order':[['id',_0x94a5('0x6')]],'limit':0x1},'log':_0x94a5('0x5')});};
\ No newline at end of file
+var _0x3d91=['../client','create','Request','CreateMailQueueReport','update','DESC','UpdateMailQueueReport'];(function(_0x1fed51,_0x59685b){var _0x17b840=function(_0x2a5524){while(--_0x2a5524){_0x1fed51['push'](_0x1fed51['shift']());}};_0x17b840(++_0x59685b);}(_0x3d91,0x157));var _0x13d9=function(_0x561bd8,_0x2458de){_0x561bd8=_0x561bd8-0x0;var _0x355db5=_0x3d91[_0x561bd8];return _0x355db5;};'use strict';var client=require(_0x13d9('0x0'));exports[_0x13d9('0x1')]=function(_0x44850c){return client[_0x13d9('0x2')](_0x13d9('0x3'),{'body':_0x44850c,'log':_0x13d9('0x3')});};exports[_0x13d9('0x4')]=function(_0x441999,_0xfa00a1){return client[_0x13d9('0x2')]('UpdateMailQueueReport',{'body':_0xfa00a1,'options':{'where':{'uniqueid':_0x441999},'order':[['id',_0x13d9('0x5')]],'limit':0x1},'log':_0x13d9('0x6')});};
\ No newline at end of file
index 28a4f05..88202e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x874f=['updateOpenchannelInteraction','addTags','../client','Request'];(function(_0x48d6a3,_0x37c848){var _0x38bfa0=function(_0x3fba2e){while(--_0x3fba2e){_0x48d6a3['push'](_0x48d6a3['shift']());}};_0x38bfa0(++_0x37c848);}(_0x874f,0x1ba));var _0xf874=function(_0x3174d2,_0x4dbb8a){_0x3174d2=_0x3174d2-0x0;var _0x28519a=_0x874f[_0x3174d2];return _0x28519a;};'use strict';var client=require(_0xf874('0x0'));exports['update']=function(_0x266cda,_0x47663b){return client[_0xf874('0x1')]('UpdateOpenchannelInteraction',{'body':_0x47663b,'options':{'where':{'id':_0x266cda}},'log':_0xf874('0x2')});};exports[_0xf874('0x3')]=function(_0x28360d,_0x1e599e){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x1e599e,'options':{'where':{'id':_0x28360d}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
+var _0x50df=['AddTagsToOpenchannelInteraction','../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x50df,0x166));var _0xf50d=function(_0x43b73c,_0x39d0d1){_0x43b73c=_0x43b73c-0x0;var _0x50fe88=_0x50df[_0x43b73c];return _0x50fe88;};'use strict';var client=require(_0xf50d('0x0'));exports[_0xf50d('0x1')]=function(_0x39ecc9,_0x44782a){return client[_0xf50d('0x2')](_0xf50d('0x3'),{'body':_0x44782a,'options':{'where':{'id':_0x39ecc9}},'log':_0xf50d('0x4')});};exports[_0xf50d('0x5')]=function(_0xcaa20f,_0x893196){return client[_0xf50d('0x2')](_0xf50d('0x6'),{'body':_0x893196,'options':{'where':{'id':_0xcaa20f}},'log':'addTagsToChatInteraction'});};
\ No newline at end of file
index 30cf30e..d006d17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4653=['create','Request'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x4653,0x102));var _0x3465=function(_0x4b08ea,_0x49b5a9){_0x4b08ea=_0x4b08ea-0x0;var _0x5c5ee5=_0x4653[_0x4b08ea];return _0x5c5ee5;};'use strict';var client=require('../client');exports[_0x3465('0x0')]=function(_0x3018a9){return client[_0x3465('0x1')]('CreateOpenchannelMessage',{'body':_0x3018a9,'log':'createOpenchannelMessage'});};
\ No newline at end of file
+var _0x7859=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x141abb,_0x1549b9){var _0x160ed0=function(_0x1d5577){while(--_0x1d5577){_0x141abb['push'](_0x141abb['shift']());}};_0x160ed0(++_0x1549b9);}(_0x7859,0x15e));var _0x9785=function(_0xc54d94,_0x2a96fd){_0xc54d94=_0xc54d94-0x0;var _0x333e1c=_0x7859[_0xc54d94];return _0x333e1c;};'use strict';var client=require(_0x9785('0x0'));exports[_0x9785('0x1')]=function(_0x31852c){return client[_0x9785('0x2')](_0x9785('0x3'),{'body':_0x31852c,'log':_0x9785('0x4')});};
\ No newline at end of file
index 4caf10c..c99c100 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e00=['name','timeout','Agents','getOpenchannelQueues','Request'];(function(_0x2cfcc3,_0x105116){var _0x1e5863=function(_0x56c0da){while(--_0x56c0da){_0x2cfcc3['push'](_0x2cfcc3['shift']());}};_0x1e5863(++_0x105116);}(_0x1e00,0x1df));var _0x01e0=function(_0x5287ab,_0x58bcff){_0x5287ab=_0x5287ab-0x0;var _0xce89bb=_0x1e00[_0x5287ab];return _0xce89bb;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0x01e0('0x0')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x01e0('0x1'),_0x01e0('0x2'),'strategy'],'include':[{'model':'User','as':_0x01e0('0x3'),'attributes':['id',_0x01e0('0x1'),'online','openchannelPause']}]},'log':_0x01e0('0x4')});};};
\ No newline at end of file
+var _0xc577=['getOpenchannelQueues','../client','GetOpenchannelQueue','name','timeout','strategy','User','Agents','openchannelPause'];(function(_0x1c42ba,_0xdb48db){var _0x542bd6=function(_0x2d47d6){while(--_0x2d47d6){_0x1c42ba['push'](_0x1c42ba['shift']());}};_0x542bd6(++_0xdb48db);}(_0xc577,0x172));var _0x7c57=function(_0x163691,_0x3d10c4){_0x163691=_0x163691-0x0;var _0x543ae5=_0xc577[_0x163691];return _0x543ae5;};'use strict';var client=require(_0x7c57('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client['Request'](_0x7c57('0x1'),{'options':{'raw':![],'attributes':['id',_0x7c57('0x2'),_0x7c57('0x3'),_0x7c57('0x4')],'include':[{'model':_0x7c57('0x5'),'as':_0x7c57('0x6'),'attributes':['id',_0x7c57('0x2'),'online',_0x7c57('0x7')]}]},'log':_0x7c57('0x8')});};};
\ No newline at end of file
index e0b2180..01f2b73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0145=['DESC','../client','create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport'];(function(_0x9e1d73,_0xcf6479){var _0x1ba603=function(_0x689c74){while(--_0x689c74){_0x9e1d73['push'](_0x9e1d73['shift']());}};_0x1ba603(++_0xcf6479);}(_0x0145,0xc5));var _0x5014=function(_0x2885eb,_0x57cf5b){_0x2885eb=_0x2885eb-0x0;var _0x2a0a8f=_0x0145[_0x2885eb];return _0x2a0a8f;};'use strict';var client=require(_0x5014('0x0'));exports[_0x5014('0x1')]=function(_0x39641d){return client['Request'](_0x5014('0x2'),{'body':_0x39641d,'log':_0x5014('0x2')});};exports[_0x5014('0x3')]=function(_0x28808c,_0x400428){return client[_0x5014('0x4')](_0x5014('0x5'),{'body':_0x400428,'options':{'where':{'uniqueid':_0x28808c},'order':[['id',_0x5014('0x6')]],'limit':0x1},'log':_0x5014('0x5')});};
\ No newline at end of file
+var _0x8ee5=['Request','CreateOpenchannelQueueReport','update','../client','create'];(function(_0x2d2e85,_0x22faa9){var _0x3e9f5e=function(_0x101c22){while(--_0x101c22){_0x2d2e85['push'](_0x2d2e85['shift']());}};_0x3e9f5e(++_0x22faa9);}(_0x8ee5,0xbc));var _0x58ee=function(_0x7cf397,_0x26f1a4){_0x7cf397=_0x7cf397-0x0;var _0x4b5f6c=_0x8ee5[_0x7cf397];return _0x4b5f6c;};'use strict';var client=require(_0x58ee('0x0'));exports[_0x58ee('0x1')]=function(_0x234af7){return client[_0x58ee('0x2')](_0x58ee('0x3'),{'body':_0x234af7,'log':_0x58ee('0x3')});};exports[_0x58ee('0x4')]=function(_0x555b62,_0x203950){return client[_0x58ee('0x2')]('UpdateOpenchannelQueueReport',{'body':_0x203950,'options':{'where':{'uniqueid':_0x555b62},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
index 33f81eb..92aeffd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa19=['AddTagsToSmsInteraction','../client','update','UpdateSmsInteraction','addTags','Request'];(function(_0x17eb11,_0x25d8c6){var _0x559093=function(_0x1bf619){while(--_0x1bf619){_0x17eb11['push'](_0x17eb11['shift']());}};_0x559093(++_0x25d8c6);}(_0xaa19,0x79));var _0x9aa1=function(_0x1c32cd,_0x587fd5){_0x1c32cd=_0x1c32cd-0x0;var _0x214461=_0xaa19[_0x1c32cd];return _0x214461;};'use strict';var client=require(_0x9aa1('0x0'));exports[_0x9aa1('0x1')]=function(_0xa7aed3,_0xbd787f){return client['Request'](_0x9aa1('0x2'),{'body':_0xbd787f,'options':{'where':{'id':_0xa7aed3}},'log':'updateSmsInteraction'});};exports[_0x9aa1('0x3')]=function(_0x58fb46,_0x11fd1b){return client[_0x9aa1('0x4')](_0x9aa1('0x5'),{'body':_0x11fd1b,'options':{'where':{'id':_0x58fb46}},'log':'addTagsToSmsInteraction'});};
\ No newline at end of file
+var _0xaa48=['AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction','updateSmsInteraction','addTags'];(function(_0x12f86a,_0x353c98){var _0x481b4f=function(_0x278587){while(--_0x278587){_0x12f86a['push'](_0x12f86a['shift']());}};_0x481b4f(++_0x353c98);}(_0xaa48,0x15a));var _0x8aa4=function(_0x3c0ac7,_0x5c0bb3){_0x3c0ac7=_0x3c0ac7-0x0;var _0x4fc90a=_0xaa48[_0x3c0ac7];return _0x4fc90a;};'use strict';var client=require(_0x8aa4('0x0'));exports[_0x8aa4('0x1')]=function(_0x2ae309,_0x50d619){return client[_0x8aa4('0x2')](_0x8aa4('0x3'),{'body':_0x50d619,'options':{'where':{'id':_0x2ae309}},'log':_0x8aa4('0x4')});};exports[_0x8aa4('0x5')]=function(_0x229357,_0x1005db){return client[_0x8aa4('0x2')](_0x8aa4('0x6'),{'body':_0x1005db,'options':{'where':{'id':_0x229357}},'log':_0x8aa4('0x7')});};
\ No newline at end of file
index 182a3e9..42889c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd58=['createSmsMessage','../client','create','Request'];(function(_0x10d318,_0x50a7f8){var _0x3b1296=function(_0x42db6d){while(--_0x42db6d){_0x10d318['push'](_0x10d318['shift']());}};_0x3b1296(++_0x50a7f8);}(_0xdd58,0x195));var _0x8dd5=function(_0x2e2ec5,_0x1aeca6){_0x2e2ec5=_0x2e2ec5-0x0;var _0x2111e5=_0xdd58[_0x2e2ec5];return _0x2111e5;};'use strict';var client=require(_0x8dd5('0x0'));exports[_0x8dd5('0x1')]=function(_0x3c9a5){return client[_0x8dd5('0x2')]('CreateSmsMessage',{'body':_0x3c9a5,'log':_0x8dd5('0x3')});};
\ No newline at end of file
+var _0xaa79=['CreateSmsMessage','createSmsMessage','../client','Request'];(function(_0x2e0021,_0x53b876){var _0x35ac07=function(_0x4d6fdf){while(--_0x4d6fdf){_0x2e0021['push'](_0x2e0021['shift']());}};_0x35ac07(++_0x53b876);}(_0xaa79,0x16e));var _0x9aa7=function(_0x5494e8,_0x54c5ed){_0x5494e8=_0x5494e8-0x0;var _0x57b727=_0xaa79[_0x5494e8];return _0x57b727;};'use strict';var client=require(_0x9aa7('0x0'));exports['create']=function(_0xaa8e73){return client[_0x9aa7('0x1')](_0x9aa7('0x2'),{'body':_0xaa8e73,'log':_0x9aa7('0x3')});};
\ No newline at end of file
index 8b8f1ce..1d5de08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x1fc0f9,_0x5147e8){var _0x26e181=function(_0x2d2d4f){while(--_0x2d2d4f){_0x1fc0f9['push'](_0x1fc0f9['shift']());}};_0x26e181(++_0x5147e8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xcb91[_0x51c819];return _0x15c5d2;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};};
\ No newline at end of file
+var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x4b1dcb,_0x13f405){var _0x4b994d=function(_0x14bc0b){while(--_0x14bc0b){_0x4b1dcb['push'](_0x4b1dcb['shift']());}};_0x4b994d(++_0x13f405);}(_0xe706,0xa3));var _0x6e70=function(_0x5ab951,_0x2513ca){_0x5ab951=_0x5ab951-0x0;var _0x1e4abd=_0xe706[_0x5ab951];return _0x1e4abd;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};};
\ No newline at end of file
index 9bc206b..e27f3a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['create','CreateSmsQueueReport','update','UpdateSmsQueueReport','../client'];(function(_0x24f5ad,_0x31ef05){var _0x455039=function(_0x5ae992){while(--_0x5ae992){_0x24f5ad['push'](_0x24f5ad['shift']());}};_0x455039(++_0x31ef05);}(_0x70e0,0x17b));var _0x070e=function(_0x4170cf,_0x9e1576){_0x4170cf=_0x4170cf-0x0;var _0x2d71fa=_0x70e0[_0x4170cf];return _0x2d71fa;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(_0x198c2e){return client['Request']('CreateSmsQueueReport',{'body':_0x198c2e,'log':_0x070e('0x2')});};exports[_0x070e('0x3')]=function(_0x277d32,_0x2593e5){return client['Request'](_0x070e('0x4'),{'body':_0x2593e5,'options':{'where':{'uniqueid':_0x277d32},'order':[['id','DESC']],'limit':0x1},'log':_0x070e('0x4')});};
\ No newline at end of file
+var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0xedd9,0xfc));var _0x9edd=function(_0x1c80b4,_0x183d93){_0x1c80b4=_0x1c80b4-0x0;var _0x2bcc18=_0xedd9[_0x1c80b4];return _0x2bcc18;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});};
\ No newline at end of file
index d12a676..d428032 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x86d714,_0x3a9f9e){var _0x12fdd2=function(_0x353019){while(--_0x353019){_0x86d714['push'](_0x86d714['shift']());}};_0x12fdd2(++_0x3a9f9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
+var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x2d5f34,_0x3be582){var _0x2c234c=function(_0x184b02){while(--_0x184b02){_0x2d5f34['push'](_0x2d5f34['shift']());}};_0x2c234c(++_0x3be582);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};};
\ No newline at end of file
index 4a8a3ac..46d0f42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c63=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','updateWhatsappInteraction'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x9c63,0x1a7));var _0x39c6=function(_0x1fc0d6,_0x7e70d0){_0x1fc0d6=_0x1fc0d6-0x0;var _0xec62f6=_0x9c63[_0x1fc0d6];return _0xec62f6;};'use strict';var client=require(_0x39c6('0x0'));exports[_0x39c6('0x1')]=function(_0x13162f,_0x30f25a){return client[_0x39c6('0x2')]('UpdateWhatsappInteraction',{'body':_0x30f25a,'options':{'where':{'id':_0x13162f}},'log':_0x39c6('0x3')});};exports[_0x39c6('0x4')]=function(_0x521670,_0x59c413){return client[_0x39c6('0x2')](_0x39c6('0x5'),{'body':_0x59c413,'options':{'where':{'id':_0x521670}},'log':_0x39c6('0x6')});};
\ No newline at end of file
+var _0xd046=['update','UpdateWhatsappInteraction','Request'];(function(_0x15e7d8,_0x14b5be){var _0x3be91f=function(_0x287852){while(--_0x287852){_0x15e7d8['push'](_0x15e7d8['shift']());}};_0x3be91f(++_0x14b5be);}(_0xd046,0x129));var _0x6d04=function(_0x22f48f,_0x4dbfa8){_0x22f48f=_0x22f48f-0x0;var _0x5747b0=_0xd046[_0x22f48f];return _0x5747b0;};'use strict';var client=require('../client');exports[_0x6d04('0x0')]=function(_0x1a46d8,_0x32aaa4){return client['Request'](_0x6d04('0x1'),{'body':_0x32aaa4,'options':{'where':{'id':_0x1a46d8}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x33720a,_0x4d2121){return client[_0x6d04('0x2')]('AddTagsToWhatsappInteraction',{'body':_0x4d2121,'options':{'where':{'id':_0x33720a}},'log':'addTagsToWhatsappInteraction'});};
\ No newline at end of file
index 346da87..af60426 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe27b=['Request','CreateWhatsappMessage','createWhatsappMessage','../client','create'];(function(_0x33a5db,_0x408f49){var _0xa168a9=function(_0x611a01){while(--_0x611a01){_0x33a5db['push'](_0x33a5db['shift']());}};_0xa168a9(++_0x408f49);}(_0xe27b,0x193));var _0xbe27=function(_0x580dc1,_0x5a40e6){_0x580dc1=_0x580dc1-0x0;var _0x5c206f=_0xe27b[_0x580dc1];return _0x5c206f;};'use strict';var client=require(_0xbe27('0x0'));exports[_0xbe27('0x1')]=function(_0x53eb0e){return client[_0xbe27('0x2')](_0xbe27('0x3'),{'body':_0x53eb0e,'log':_0xbe27('0x4')});};
\ No newline at end of file
+var _0xb486=['Request','CreateWhatsappMessage','createWhatsappMessage'];(function(_0x52b395,_0x1afa64){var _0x55d9d4=function(_0x35614d){while(--_0x35614d){_0x52b395['push'](_0x52b395['shift']());}};_0x55d9d4(++_0x1afa64);}(_0xb486,0x99));var _0x6b48=function(_0x1c81ea,_0x40e45d){_0x1c81ea=_0x1c81ea-0x0;var _0x309c1e=_0xb486[_0x1c81ea];return _0x309c1e;};'use strict';var client=require('../client');exports['create']=function(_0x40ef8d){return client[_0x6b48('0x0')](_0x6b48('0x1'),{'body':_0x40ef8d,'log':_0x6b48('0x2')});};
\ No newline at end of file
index b8ad929..72f7c57 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x370f=['getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy','User','online','whatsappPause','../client'];(function(_0x192b6f,_0x603378){var _0x30f545=function(_0x190a70){while(--_0x190a70){_0x192b6f['push'](_0x192b6f['shift']());}};_0x30f545(++_0x603378);}(_0x370f,0x194));var _0xf370=function(_0x1351d5,_0x296c46){_0x1351d5=_0x1351d5-0x0;var _0x455b69=_0x370f[_0x1351d5];return _0x455b69;};'use strict';var client=require(_0xf370('0x0'));exports[_0xf370('0x1')]=function(){return function(){return client[_0xf370('0x2')](_0xf370('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xf370('0x4'),_0xf370('0x5')],'include':[{'model':_0xf370('0x6'),'as':'Agents','attributes':['id','name',_0xf370('0x7'),_0xf370('0x8')]}]},'log':_0xf370('0x1')});};};
\ No newline at end of file
+var _0x0f93=['../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout','User','Agents','name','online','whatsappPause'];(function(_0x36de4f,_0x350d30){var _0x1a91c2=function(_0x475034){while(--_0x475034){_0x36de4f['push'](_0x36de4f['shift']());}};_0x1a91c2(++_0x350d30);}(_0x0f93,0x12c));var _0x30f9=function(_0x421e90,_0x40ff82){_0x421e90=_0x421e90-0x0;var _0xde56d0=_0x0f93[_0x421e90];return _0xde56d0;};'use strict';var client=require(_0x30f9('0x0'));exports[_0x30f9('0x1')]=function(){return function(){return client[_0x30f9('0x2')](_0x30f9('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x30f9('0x4'),'strategy'],'include':[{'model':_0x30f9('0x5'),'as':_0x30f9('0x6'),'attributes':['id',_0x30f9('0x7'),_0x30f9('0x8'),_0x30f9('0x9')]}]},'log':_0x30f9('0x1')});};};
\ No newline at end of file
index bce630e..aaefbac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd81=['CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client','create','Request'];(function(_0x3b6541,_0x3e1c12){var _0x2b3c7b=function(_0x20d8cf){while(--_0x20d8cf){_0x3b6541['push'](_0x3b6541['shift']());}};_0x2b3c7b(++_0x3e1c12);}(_0xcd81,0x177));var _0x1cd8=function(_0x3b78c7,_0xb00166){_0x3b78c7=_0x3b78c7-0x0;var _0x25ea89=_0xcd81[_0x3b78c7];return _0x25ea89;};'use strict';var client=require(_0x1cd8('0x0'));exports[_0x1cd8('0x1')]=function(_0x26086c){return client[_0x1cd8('0x2')]('CreateWhatsappQueueReport',{'body':_0x26086c,'log':_0x1cd8('0x3')});};exports[_0x1cd8('0x4')]=function(_0x57b9c4,_0x4b1056){return client[_0x1cd8('0x2')]('UpdateWhatsappQueueReport',{'body':_0x4b1056,'options':{'where':{'uniqueid':_0x57b9c4},'order':[['id',_0x1cd8('0x5')]],'limit':0x1},'log':_0x1cd8('0x6')});};
\ No newline at end of file
+var _0xee9b=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','../client','create'];(function(_0x5e632d,_0x2d3b59){var _0x5253cc=function(_0x45b0cf){while(--_0x45b0cf){_0x5e632d['push'](_0x5e632d['shift']());}};_0x5253cc(++_0x2d3b59);}(_0xee9b,0x12a));var _0xbee9=function(_0x3db0dc,_0x2fb362){_0x3db0dc=_0x3db0dc-0x0;var _0xcdbf0c=_0xee9b[_0x3db0dc];return _0xcdbf0c;};'use strict';var client=require(_0xbee9('0x0'));exports[_0xbee9('0x1')]=function(_0xac4ec2){return client[_0xbee9('0x2')]('CreateWhatsappQueueReport',{'body':_0xac4ec2,'log':_0xbee9('0x3')});};exports[_0xbee9('0x4')]=function(_0x2b7f22,_0x33be4e){return client['Request']('UpdateWhatsappQueueReport',{'body':_0x33be4e,'options':{'where':{'uniqueid':_0x2b7f22},'order':[['id','DESC']],'limit':0x1},'log':_0xbee9('0x5')});};
\ No newline at end of file
index f33741c..61fb8cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x85ae=['name','timeout','createQueue','atimeout','channel','format','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','find'];(function(_0x5246f8,_0xdc45a9){var _0x5c7997=function(_0x15e9e1){while(--_0x15e9e1){_0x5246f8['push'](_0x5246f8['shift']());}};_0x5c7997(++_0xdc45a9);}(_0x85ae,0x1f2));var _0xe85a=function(_0x313d94,_0x2632b9){_0x313d94=_0x313d94-0x0;var _0x3dda0c=_0x85ae[_0x313d94];return _0x3dda0c;};'use strict';var schema=require(_0xe85a('0x0'));var _=require(_0xe85a('0x1'));var util=require(_0xe85a('0x2'));var seqqueue=require('seq-queue');var logger=require(_0xe85a('0x3'))(_0xe85a('0x4'));var strategy=require(_0xe85a('0x5'));var queue=schema({'name':{'type':_0xe85a('0x6'),'required':!![],'message':_0xe85a('0x7')},'timeout':{'type':_0xe85a('0x8'),'message':_0xe85a('0x9')}});function writeLog(_0x49083b,_0x261212,_0x35b4c9){return logger[_0xe85a('0xa')](util['format'](_0xe85a('0xb'),_0x49083b,_0x261212['name'],_0x35b4c9));}function handleFindAgent(_0x5cd71f){return function(_0x457cec){return _0x457cec['name']['toLowerCase']()===_0x5cd71f['toLowerCase']();};}exports[_0xe85a('0xc')]=function(_0x146f28,_0x585664,_0x31d97b,_0x42843a){return function(_0x560f5b){try{var _0x4c0e7f={'name':_0x585664[0x0],'timeout':_0x585664[0x1]};var _0x117c03=queue[_0xe85a('0x0')](_0x4c0e7f,{'typecast':!![]});if(_0x117c03[_0xe85a('0xd')]){logger[_0xe85a('0xe')](_0xe85a('0xf'),_0x146f28,_[_0xe85a('0x10')](_0x117c03,'message')[_0xe85a('0x11')](',\x20'));_0x560f5b[_0xe85a('0x12')]();}else{var _0xa66603=_[_0xe85a('0x13')](_0x31d97b['agents'],handleFindAgent(_0x4c0e7f[_0xe85a('0x14')]));if(_0xa66603){var _0xa108fc=(_0x4c0e7f[_0xe85a('0x15')]||0xa)*0x3e8;var _0x21ceea,_0x5433c2;var _0x14aa92=seqqueue[_0xe85a('0x16')](_0xa108fc);_0x14aa92['id']=_0x146f28;_0x14aa92[_0xe85a('0x17')]=_0xa108fc;_0x14aa92[_0xe85a('0x18')]=_0x42843a[_0xe85a('0x18')];writeLog(_0x146f28,_0xa66603,util[_0xe85a('0x19')](_0xe85a('0x1a'),_0xa108fc));_0x31d97b['rules'][_0x146f28]['on'](_0xe85a('0x1b'),function(){logger[_0xe85a('0xa')](_0xe85a('0x1c'),_0x146f28);clearTimeout(_0x5433c2);_0x5433c2=undefined;_0x14aa92[_0xe85a('0x1d')]();if(_0x31d97b[_0xe85a('0x1e')][_0x146f28]){delete _0x31d97b[_0xe85a('0x1e')][_0x146f28];}_0x560f5b[_0xe85a('0x12')]();});_0x31d97b[_0xe85a('0x1e')][_0x146f28]['on']('complete',function(){if(_0x31d97b['rules'][_0x146f28]){delete _0x31d97b[_0xe85a('0x1e')][_0x146f28];}});_0x5433c2=setTimeout(function(){logger[_0xe85a('0xa')](_0xe85a('0x1f'),_0x146f28);clearTimeout(_0x5433c2);_0x14aa92[_0xe85a('0x1d')]();_0x560f5b[_0xe85a('0x20')]();},_0xa108fc);strategy['agent'](_0x14aa92,_0xa66603,_0x31d97b,_0x42843a);}else{logger['error'](_0xe85a('0x21'),_0x146f28,_0x4c0e7f[_0xe85a('0x14')]);_0x560f5b[_0xe85a('0x12')]();}}}catch(_0x327eb1){console[_0xe85a('0x22')](_0x327eb1);logger[_0xe85a('0xe')](_0xe85a('0x23'),_0x146f28,_0x327eb1[_0xe85a('0x24')]);_0x560f5b['stop']();}};};
\ No newline at end of file
+var _0x751a=['close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stack','validate','util','seq-queue','../../../../config/logger','string','number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','join','stop','timeout','createQueue','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED'];(function(_0x300768,_0x515b0c){var _0x27bb75=function(_0x3b25c7){while(--_0x3b25c7){_0x300768['push'](_0x300768['shift']());}};_0x27bb75(++_0x515b0c);}(_0x751a,0x1e7));var _0xa751=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0x751a[_0x335271];return _0xa9fff8;};'use strict';var schema=require(_0xa751('0x0'));var _=require('lodash');var util=require(_0xa751('0x1'));var seqqueue=require(_0xa751('0x2'));var logger=require(_0xa751('0x3'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0xa751('0x4'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xa751('0x5'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x28ac75,_0x3b415a,_0x21bc55){return logger[_0xa751('0x6')](util[_0xa751('0x7')](_0xa751('0x8'),_0x28ac75,_0x3b415a[_0xa751('0x9')],_0x21bc55));}function handleFindAgent(_0x3c3079){return function(_0x2b2d64){return _0x2b2d64[_0xa751('0x9')][_0xa751('0xa')]()===_0x3c3079[_0xa751('0xa')]();};}exports[_0xa751('0xb')]=function(_0xf0cbc2,_0x167bcc,_0x2b1f63,_0x5e8a4c){return function(_0x2cc0f0){try{var _0x312cbf={'name':_0x167bcc[0x0],'timeout':_0x167bcc[0x1]};var _0x30a127=queue[_0xa751('0x0')](_0x312cbf,{'typecast':!![]});if(_0x30a127[_0xa751('0xc')]){logger[_0xa751('0xd')](_0xa751('0xe'),_0xf0cbc2,_[_0xa751('0xf')](_0x30a127,'message')[_0xa751('0x10')](',\x20'));_0x2cc0f0[_0xa751('0x11')]();}else{var _0x29eb4b=_['find'](_0x2b1f63['agents'],handleFindAgent(_0x312cbf[_0xa751('0x9')]));if(_0x29eb4b){var _0xa6d241=(_0x312cbf[_0xa751('0x12')]||0xa)*0x3e8;var _0x89d597,_0x14ccf7;var _0x485fb4=seqqueue[_0xa751('0x13')](_0xa6d241);_0x485fb4['id']=_0xf0cbc2;_0x485fb4['atimeout']=_0xa6d241;_0x485fb4['channel']=_0x5e8a4c[_0xa751('0x14')];writeLog(_0xf0cbc2,_0x29eb4b,util['format'](_0xa751('0x15'),_0xa6d241));_0x2b1f63[_0xa751('0x16')][_0xf0cbc2]['on'](_0xa751('0x17'),function(){logger[_0xa751('0x6')](_0xa751('0x18'),_0xf0cbc2);clearTimeout(_0x14ccf7);_0x14ccf7=undefined;_0x485fb4[_0xa751('0x19')]();if(_0x2b1f63[_0xa751('0x16')][_0xf0cbc2]){delete _0x2b1f63['rules'][_0xf0cbc2];}_0x2cc0f0[_0xa751('0x11')]();});_0x2b1f63['rules'][_0xf0cbc2]['on'](_0xa751('0x1a'),function(){if(_0x2b1f63[_0xa751('0x16')][_0xf0cbc2]){delete _0x2b1f63['rules'][_0xf0cbc2];}});_0x14ccf7=setTimeout(function(){logger[_0xa751('0x6')](_0xa751('0x1b'),_0xf0cbc2);clearTimeout(_0x14ccf7);_0x485fb4[_0xa751('0x19')]();_0x2cc0f0[_0xa751('0x1c')]();},_0xa6d241);strategy[_0xa751('0x1d')](_0x485fb4,_0x29eb4b,_0x2b1f63,_0x5e8a4c);}else{logger[_0xa751('0xd')](_0xa751('0x1e'),_0xf0cbc2,_0x312cbf['name']);_0x2cc0f0[_0xa751('0x11')]();}}}catch(_0x129a11){console['log'](_0x129a11);logger['error']('[%s][QUEUE]\x20%s',_0xf0cbc2,_0x129a11[_0xa751('0x1f')]);_0x2cc0f0[_0xa751('0x11')]();}};};
\ No newline at end of file
index be48511..05bc1f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9132=['./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','AccountId','upperFirst','created','isEmpty','body','getMustacheRender','Message','create','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','$LATEST','toString','postText','message','next','amazonlex','providerName','dialogState','Failed','stop','lodash','moment','aws-sdk'];(function(_0x32e904,_0x24c845){var _0x47765c=function(_0x15c09d){while(--_0x15c09d){_0x32e904['push'](_0x32e904['shift']());}};_0x47765c(++_0x24c845);}(_0x9132,0x8d));var _0x2913=function(_0x118d1f,_0x2a417e){_0x118d1f=_0x118d1f-0x0;var _0x3088e8=_0x9132[_0x118d1f];return _0x3088e8;};'use strict';var _=require(_0x2913('0x0'));var moment=require(_0x2913('0x1'));var AWS=require(_0x2913('0x2'));var utils=require(_0x2913('0x3'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x2913('0x4')),'openchannelMessage':require(_0x2913('0x5')),'mailMessage':require(_0x2913('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2913('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x405e5d,_0x15f6bd){return function(_0x26a893){try{if(!_[_0x2913('0x8')](this[_0x2913('0x9')][_0x2913('0xa')])){logger[_0x2913('0xb')]('[%s][AMAZONLEX]\x20%s',_0x405e5d,_0x2913('0xc'));return _0x26a893['next']();}var _0x428972={'ContactId':this[_0x2913('0xd')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2913('0xe')};if(this['channel']===_0x2913('0xf')||this[_0x2913('0x10')]===_0x2913('0x11')){_0x428972[_0x2913('0x12')]=this[_0x2913('0x9')][_0x2913('0x12')];}var _0x149952=this[_0x2913('0x10')];if(_0x149952===_0x2913('0x13')){_0x428972[_0x2913('0x14')]=this[_0x2913('0x15')]['id'];}else{_0x428972[_['upperFirst'](_0x149952)+_0x2913('0x16')]=this[_0x2913('0x15')]['id'];}_0x428972[_[_0x2913('0x17')](_0x149952)+'InteractionId']=this[_0x2913('0x9')]['id'];if(this[_0x2913('0x9')][_0x2913('0x18')]){var _0x4387ef=_0x15f6bd[0x4];if(!_[_0x2913('0x19')](_0x4387ef)){_0x428972[_0x2913('0x1a')]=utils[_0x2913('0x1b')](_0x4387ef,this);return rpc[_0x149952+_0x2913('0x1c')][_0x2913('0x1d')](_0x428972)[_0x2913('0x1e')](function(_0x2ed8fa){logger[_0x2913('0xb')](_0x2913('0x1f'),_0x405e5d,_0x428972[_0x2913('0x1a')]);})[_0x2913('0x20')](function(_0x348f4f){logger[_0x2913('0x21')](_0x2913('0x1f'),_0x405e5d,JSON[_0x2913('0x22')](_0x348f4f));})[_0x2913('0x23')](function(){logger[_0x2913('0xb')](_0x2913('0x24'),_0x405e5d);_0x26a893['stop']();});}else{logger[_0x2913('0xb')](_0x2913('0x25'),_0x405e5d);_0x26a893['stop']();}}else{var _0x43ae5c=this;var _0x4227f1=new AWS['LexRuntime']({'accessKeyId':_0x15f6bd[0x0],'secretAccessKey':_0x15f6bd[0x1],'region':_0x15f6bd[0x2]});var _0x5e3ee4={'botAlias':_0x2913('0x26'),'botName':_0x15f6bd[0x3],'inputText':this['message']['body'],'userId':this[_0x2913('0x10')]+':'+this['interaction']['id'][_0x2913('0x27')]()};_0x4227f1[_0x2913('0x28')](_0x5e3ee4,function(_0x43a5e9,_0x4ef24d){if(_0x43a5e9){logger['error'](_0x2913('0x1f'),_0x405e5d,_0x43a5e9[_0x2913('0x29')]);_0x26a893[_0x2913('0x2a')]();}else if(_0x4ef24d&&_0x4ef24d['message']){_0x43ae5c[_0x2913('0x1a')][_0x2913('0x2b')]=_0x4ef24d;_0x428972[_0x2913('0x1a')]=_0x4ef24d[_0x2913('0x29')];_0x428972[_0x2913('0x2c')]=_0x2913('0x2b');_0x428972['providerResponse']=JSON['stringify'](_0x4ef24d);return rpc[_0x149952+_0x2913('0x1c')][_0x2913('0x1d')](_0x428972)[_0x2913('0x1e')](function(_0x417420){logger['info'](_0x2913('0x1f'),_0x405e5d,_0x428972[_0x2913('0x1a')]);if(_0x4ef24d[_0x2913('0x2d')]==_0x2913('0x2e')){_0x26a893[_0x2913('0x2a')]();}else{_0x26a893[_0x2913('0x2f')]();}})[_0x2913('0x20')](function(_0x3e3d57){logger[_0x2913('0x21')](_0x2913('0x1f'),_0x405e5d,JSON[_0x2913('0x22')](_0x3e3d57));_0x26a893[_0x2913('0x2a')]();});}else{_0x26a893[_0x2913('0x2a')]();}});}}catch(_0x30565d){logger[_0x2913('0x21')]('[%s][AMAZONLEX]\x20%s',_0x405e5d,JSON['stringify'](_0x30565d));_0x26a893[_0x2913('0x2f')]();}};};
\ No newline at end of file
+var _0xb232=['catch','lodash','moment','aws-sdk','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','AccountId','created','isEmpty','body','then','[%s][AMAZONLEX]\x20%s','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','error','amazonlex','providerResponse','Message','create','Failed','stop'];(function(_0x1b63b5,_0x1f1294){var _0x561ef5=function(_0x42f9b4){while(--_0x42f9b4){_0x1b63b5['push'](_0x1b63b5['shift']());}};_0x561ef5(++_0x1f1294);}(_0xb232,0x15f));var _0x2b23=function(_0xf6aec0,_0x51ffd6){_0xf6aec0=_0xf6aec0-0x0;var _0x59a51b=_0xb232[_0xf6aec0];return _0x59a51b;};'use strict';var _=require(_0x2b23('0x0'));var moment=require(_0x2b23('0x1'));var AWS=require(_0x2b23('0x2'));var utils=require(_0x2b23('0x3'));var logger=require(_0x2b23('0x4'))(_0x2b23('0x5'));var rpc={'chatMessage':require(_0x2b23('0x6')),'openchannelMessage':require(_0x2b23('0x7')),'mailMessage':require(_0x2b23('0x8')),'smsMessage':require(_0x2b23('0x9')),'faxMessage':require(_0x2b23('0xa')),'whatsappMessage':require(_0x2b23('0xb'))};exports['consequence']=function(_0x3d7e6f,_0xf979f1){return function(_0x4d40d1){try{if(!_[_0x2b23('0xc')](this['interaction'][_0x2b23('0xd')])){logger[_0x2b23('0xe')]('[%s][AMAZONLEX]\x20%s',_0x3d7e6f,_0x2b23('0xf'));return _0x4d40d1[_0x2b23('0x10')]();}var _0x58a320={'ContactId':this[_0x2b23('0x11')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x2b23('0x12')};if(this[_0x2b23('0x13')]==='sms'||this[_0x2b23('0x13')]===_0x2b23('0x14')){_0x58a320[_0x2b23('0x15')]=this[_0x2b23('0x16')][_0x2b23('0x15')];}var _0x4fdf29=this[_0x2b23('0x13')];if(_0x4fdf29===_0x2b23('0x17')){_0x58a320[_0x2b23('0x18')]=this[_0x2b23('0x19')]['id'];}else{_0x58a320[_[_0x2b23('0x1a')](_0x4fdf29)+_0x2b23('0x1b')]=this[_0x2b23('0x19')]['id'];}_0x58a320[_[_0x2b23('0x1a')](_0x4fdf29)+'InteractionId']=this[_0x2b23('0x16')]['id'];if(this[_0x2b23('0x16')][_0x2b23('0x1c')]){var _0x588f48=_0xf979f1[0x4];if(!_[_0x2b23('0x1d')](_0x588f48)){_0x58a320[_0x2b23('0x1e')]=utils['getMustacheRender'](_0x588f48,this);return rpc[_0x4fdf29+'Message']['create'](_0x58a320)[_0x2b23('0x1f')](function(_0x2ca0e2){logger['info']('[%s][AMAZONLEX]\x20%s',_0x3d7e6f,_0x58a320['body']);})['catch'](function(_0x37218d){logger['error'](_0x2b23('0x20'),_0x3d7e6f,JSON[_0x2b23('0x21')](_0x37218d));})[_0x2b23('0x22')](function(){logger['info'](_0x2b23('0x23'),_0x3d7e6f);_0x4d40d1['stop']();});}else{logger[_0x2b23('0xe')](_0x2b23('0x24'),_0x3d7e6f);_0x4d40d1['stop']();}}else{var _0x29e3ad=this;var _0x6d4bd8=new AWS[(_0x2b23('0x25'))]({'accessKeyId':_0xf979f1[0x0],'secretAccessKey':_0xf979f1[0x1],'region':_0xf979f1[0x2]});var _0x162972={'botAlias':_0x2b23('0x26'),'botName':_0xf979f1[0x3],'inputText':this[_0x2b23('0x27')][_0x2b23('0x1e')],'userId':this['channel']+':'+this[_0x2b23('0x16')]['id'][_0x2b23('0x28')]()};_0x6d4bd8[_0x2b23('0x29')](_0x162972,function(_0x1af5c6,_0x5195d1){if(_0x1af5c6){logger[_0x2b23('0x2a')]('[%s][AMAZONLEX]\x20%s',_0x3d7e6f,_0x1af5c6[_0x2b23('0x27')]);_0x4d40d1[_0x2b23('0x10')]();}else if(_0x5195d1&&_0x5195d1[_0x2b23('0x27')]){_0x29e3ad[_0x2b23('0x1e')][_0x2b23('0x2b')]=_0x5195d1;_0x58a320[_0x2b23('0x1e')]=_0x5195d1[_0x2b23('0x27')];_0x58a320['providerName']=_0x2b23('0x2b');_0x58a320[_0x2b23('0x2c')]=JSON[_0x2b23('0x21')](_0x5195d1);return rpc[_0x4fdf29+_0x2b23('0x2d')][_0x2b23('0x2e')](_0x58a320)[_0x2b23('0x1f')](function(_0x23af22){logger[_0x2b23('0xe')]('[%s][AMAZONLEX]\x20%s',_0x3d7e6f,_0x58a320[_0x2b23('0x1e')]);if(_0x5195d1['dialogState']==_0x2b23('0x2f')){_0x4d40d1[_0x2b23('0x10')]();}else{_0x4d40d1[_0x2b23('0x30')]();}})[_0x2b23('0x31')](function(_0x2a8afe){logger[_0x2b23('0x2a')](_0x2b23('0x20'),_0x3d7e6f,JSON[_0x2b23('0x21')](_0x2a8afe));_0x4d40d1[_0x2b23('0x10')]();});}else{_0x4d40d1[_0x2b23('0x10')]();}});}}catch(_0x5e7c33){logger[_0x2b23('0x2a')](_0x2b23('0x20'),_0x3d7e6f,JSON[_0x2b23('0x21')](_0x5e7c33));_0x4d40d1[_0x2b23('0x30')]();}};};
\ No newline at end of file
index fc51957..0b805e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04c9=['<div\x20id=\x22xm-mail-content\x22','<div','</div>','headers','auto-replied','All','auto_reply','sendMailMessage','then','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','moment','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','channel','getMustacheRender','from','message','phone','subject','startsWith','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','Message','Smtp','service','host','port','secure','auth','pass','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace'];(function(_0x1484e,_0x356a69){var _0x20b1d3=function(_0x5988a1){while(--_0x5988a1){_0x1484e['push'](_0x1484e['shift']());}};_0x20b1d3(++_0x356a69);}(_0x04c9,0xf1));var _0x904c=function(_0x41bcc6,_0x52a077){_0x41bcc6=_0x41bcc6-0x0;var _0x23635c=_0x04c9[_0x41bcc6];return _0x23635c;};'use strict';var _=require('lodash');var moment=require(_0x904c('0x0'));var utils=require(_0x904c('0x1'));var logger=require('../../../../config/logger')(_0x904c('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x904c('0x3')),'mailMessage':require(_0x904c('0x4')),'smsMessage':require(_0x904c('0x5')),'faxMessage':require(_0x904c('0x6')),'whatsappMessage':require(_0x904c('0x7')),'chatInteraction':require(_0x904c('0x8')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x904c('0x9')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x904c('0xa'))};var mailRpc=require(_0x904c('0xb'));exports[_0x904c('0xc')]=function(_0x4badb5,_0x54df3c,_0x1f7970,_0x1860ba){return function(_0x2638e0){try{var _0x2f5079=this['channel'];if(_0x2f5079===_0x904c('0xd')&&_0x1860ba[_0x904c('0xe')][_0x904c('0xf')]){logger[_0x904c('0x10')](_0x904c('0x11'),_0x4badb5,_0x904c('0x12'));return _0x2638e0[_0x904c('0x13')]();}if(_0x54df3c[0x0]==='1'&&(_[_0x904c('0x14')](this[_0x904c('0x15')][_0x904c('0x16')])||!this[_0x904c('0x15')][_0x904c('0x16')])){logger[_0x904c('0x10')](_0x904c('0x11'),_0x4badb5,_0x904c('0x17'));return _0x2638e0[_0x904c('0x13')]();}if(_0x54df3c[0x0]==='2'&&this[_0x904c('0x15')][_0x904c('0x18')]){logger[_0x904c('0x10')](_0x904c('0x19'),_0x4badb5,_0x904c('0x1a'));return _0x2638e0['next']();}var _0x3f8cd9={'ContactId':this['contact']['id'],'sentAt':moment()[_0x904c('0x1b')](_0x904c('0x1c')),'direction':'out'};if(this[_0x904c('0x1d')]===_0x904c('0xd')){_0x3f8cd9[_0x904c('0xe')]=utils[_0x904c('0x1e')](_0x54df3c[0x2],this);}else{_0x3f8cd9[_0x904c('0xe')]=utils[_0x904c('0x1e')](_0x54df3c[0x1],this);}if(this['message']){_0x3f8cd9['to']=this['message'][_0x904c('0x1f')]||'';if(this[_0x904c('0x1d')]===_0x904c('0xd')&&_0x54df3c[0x1]==='1'){_0x3f8cd9['cc']=this[_0x904c('0x20')]['cc']||'';}_0x3f8cd9[_0x904c('0x1f')]=this[_0x904c('0x20')]['to']||'';_0x3f8cd9[_0x904c('0x21')]=this[_0x904c('0x20')][_0x904c('0x21')]||'';_0x3f8cd9['read']=!![];if(this[_0x904c('0x20')][_0x904c('0x22')]){_0x3f8cd9[_0x904c('0x22')]='';_0x3f8cd9[_0x904c('0x22')]+=_[_0x904c('0x23')](this[_0x904c('0x20')][_0x904c('0x22')],_0x904c('0x24'))?'':'Re:\x20';_0x3f8cd9[_0x904c('0x22')]+=this[_0x904c('0x20')][_0x904c('0x22')];}}if(this[_0x904c('0x1d')]===_0x904c('0x25')){_0x3f8cd9[_0x904c('0x26')]=this['account']['id'];}else{_0x3f8cd9[_[_0x904c('0x27')](this['channel'])+_0x904c('0x28')]=this[_0x904c('0x29')]['id'];}_0x3f8cd9[_['upperFirst'](this[_0x904c('0x1d')])+_0x904c('0x2a')]=this[_0x904c('0x15')]['id'];var _0x4605b3=this['interaction'];if(rpc[this[_0x904c('0x1d')]+_0x904c('0x2b')]){if(this[_0x904c('0x1d')]===_0x904c('0xd')){var _0x37438a={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x904c('0x2c')][_0x904c('0x2d')]){_0x37438a[_0x904c('0x2d')]=this[_0x904c('0x29')][_0x904c('0x2c')]['service'];}else{_0x37438a[_0x904c('0x2e')]=this[_0x904c('0x29')][_0x904c('0x2c')][_0x904c('0x2e')];_0x37438a[_0x904c('0x2f')]=this[_0x904c('0x29')][_0x904c('0x2c')][_0x904c('0x2f')];_0x37438a[_0x904c('0x30')]=this['account'][_0x904c('0x2c')][_0x904c('0x30')];}if(this[_0x904c('0x29')]['Smtp']['authentication']){_0x37438a[_0x904c('0x31')]={'user':this['account'][_0x904c('0x2c')]['user'],'pass':this['account'][_0x904c('0x2c')][_0x904c('0x32')]};}_0x3f8cd9['inReplyTo']=this[_0x904c('0x20')][_0x904c('0x33')];_0x3f8cd9[_0x904c('0x34')]=_0x904c('0x35')+_[_0x904c('0x36')](_0x3f8cd9[_0x904c('0xe')],_0x904c('0x37'),_0x904c('0x38'))+_0x904c('0x39');_0x3f8cd9[_0x904c('0x3a')]={'Auto-Submitted':_0x904c('0x3b'),'X-Auto-Response-Suppress':_0x904c('0x3c'),'Precedence':_0x904c('0x3d')};return mailRpc[_0x904c('0x3e')](_0x37438a,_0x3f8cd9)[_0x904c('0x3f')](function(_0x29716f){logger[_0x904c('0x10')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x4badb5);_0x3f8cd9[_0x904c('0x33')]=_0x29716f[_0x904c('0x20')][_0x904c('0x33')];return rpc[_0x2f5079+_0x904c('0x2b')][_0x904c('0x40')](_0x3f8cd9);})['then'](function(_0x271601){logger[_0x904c('0x10')](_0x904c('0x11'),_0x4badb5,JSON[_0x904c('0x41')](_0x271601));})[_0x904c('0x42')](function(_0x502e2d){logger[_0x904c('0x43')](_0x904c('0x44'),_0x4badb5,JSON[_0x904c('0x41')](_0x502e2d));})[_0x904c('0x45')](function(){Promise[_0x904c('0x46')]()[_0x904c('0x3f')](function(){if(_0x54df3c[0x0]!=='2'||_0x4605b3['autoreplyExecuted'])return;return rpc[_0x2f5079+'Interaction'][_0x904c('0x47')](_0x4605b3['id'],{'autoreplyExecuted':!![]})[_0x904c('0x3f')](function(_0x3345a7){logger[_0x904c('0x10')](_0x904c('0x19'),_0x4badb5,JSON['stringify'](_0x3345a7));})[_0x904c('0x42')](function(_0x3defec){logger['error'](_0x904c('0x48'),_0x4badb5,JSON['stringify'](_0x3defec));});})[_0x904c('0x3f')](function(){_0x2638e0[_0x904c('0x13')]();});});}else{return rpc[this[_0x904c('0x1d')]+_0x904c('0x2b')][_0x904c('0x40')](_0x3f8cd9)[_0x904c('0x3f')](function(_0xb706b2){logger[_0x904c('0x10')](_0x904c('0x11'),_0x4badb5,_0x3f8cd9[_0x904c('0xe')]);})[_0x904c('0x42')](function(_0x384896){logger[_0x904c('0x43')](_0x904c('0x11'),_0x4badb5,JSON[_0x904c('0x41')](_0x384896));})['finally'](function(){Promise[_0x904c('0x46')]()['then'](function(){if(_0x54df3c[0x0]!=='2'||_0x4605b3[_0x904c('0x18')])return;return rpc[_0x2f5079+'Interaction'][_0x904c('0x47')](_0x4605b3['id'],{'autoreplyExecuted':!![]})['then'](function(_0x3c5e59){logger['info'](_0x904c('0x19'),_0x4badb5,JSON[_0x904c('0x41')](_0x3c5e59));})[_0x904c('0x42')](function(_0x443a47){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x4badb5,JSON[_0x904c('0x41')](_0x443a47));});})[_0x904c('0x3f')](function(){_0x2638e0[_0x904c('0x13')]();});});}}}catch(_0x322cd1){logger[_0x904c('0x43')](_0x904c('0x11'),_0x4badb5,JSON[_0x904c('0x41')](_0x322cd1));_0x2638e0[_0x904c('0x49')]();}};};
\ No newline at end of file
+var _0x8808=['inReplyTo','messageId','html','</div>','headers','auto-replied','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','catch','error','stringify','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','moment','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','body','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','mail','getMustacheRender','message','from','phone','subject','Re:','upperFirst','account','InteractionId','Message','Smtp','service','host','secure','authentication','auth','user'];(function(_0x11f9f2,_0x3b1a7e){var _0x56a2b6=function(_0x4eb565){while(--_0x4eb565){_0x11f9f2['push'](_0x11f9f2['shift']());}};_0x56a2b6(++_0x3b1a7e);}(_0x8808,0x11e));var _0x8880=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8808[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var moment=require(_0x8880('0x0'));var utils=require(_0x8880('0x1'));var logger=require('../../../../config/logger')(_0x8880('0x2'));var rpc={'chatMessage':require(_0x8880('0x3')),'openchannelMessage':require(_0x8880('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x8880('0x5')),'faxMessage':require(_0x8880('0x6')),'whatsappMessage':require(_0x8880('0x7')),'chatInteraction':require(_0x8880('0x8')),'openchannelInteraction':require(_0x8880('0x9')),'mailInteraction':require(_0x8880('0xa')),'smsInteraction':require(_0x8880('0xb')),'faxInteraction':require(_0x8880('0xc')),'whatsappInteraction':require(_0x8880('0xd'))};var mailRpc=require('../../mailRpc');exports[_0x8880('0xe')]=function(_0xc6273,_0x473876,_0x4ee283,_0x3744ac){return function(_0x7bc0cc){try{var _0x52aef0=this['channel'];if(_0x52aef0==='mail'&&_0x3744ac[_0x8880('0xf')]['isAutoreply']){logger['info']('[%s][AUTOREPLY]\x20%s',_0xc6273,_0x8880('0x10'));return _0x7bc0cc[_0x8880('0x11')]();}if(_0x473876[0x0]==='1'&&(_[_0x8880('0x12')](this[_0x8880('0x13')][_0x8880('0x14')])||!this['interaction'][_0x8880('0x14')])){logger['info'](_0x8880('0x15'),_0xc6273,_0x8880('0x16'));return _0x7bc0cc[_0x8880('0x11')]();}if(_0x473876[0x0]==='2'&&this[_0x8880('0x13')][_0x8880('0x17')]){logger[_0x8880('0x18')](_0x8880('0x19'),_0xc6273,'One\x20Time\x20already\x20sent');return _0x7bc0cc[_0x8880('0x11')]();}var _0x49224b={'ContactId':this[_0x8880('0x1a')]['id'],'sentAt':moment()[_0x8880('0x1b')](_0x8880('0x1c')),'direction':_0x8880('0x1d')};if(this[_0x8880('0x1e')]===_0x8880('0x1f')){_0x49224b[_0x8880('0xf')]=utils[_0x8880('0x20')](_0x473876[0x2],this);}else{_0x49224b[_0x8880('0xf')]=utils[_0x8880('0x20')](_0x473876[0x1],this);}if(this[_0x8880('0x21')]){_0x49224b['to']=this['message'][_0x8880('0x22')]||'';if(this[_0x8880('0x1e')]==='mail'&&_0x473876[0x1]==='1'){_0x49224b['cc']=this['message']['cc']||'';}_0x49224b[_0x8880('0x22')]=this[_0x8880('0x21')]['to']||'';_0x49224b[_0x8880('0x23')]=this['message'][_0x8880('0x23')]||'';_0x49224b['read']=!![];if(this['message'][_0x8880('0x24')]){_0x49224b['subject']='';_0x49224b[_0x8880('0x24')]+=_['startsWith'](this['message'][_0x8880('0x24')],_0x8880('0x25'))?'':'Re:\x20';_0x49224b['subject']+=this[_0x8880('0x21')][_0x8880('0x24')];}}if(this[_0x8880('0x1e')]==='chat'){_0x49224b['ChatWebsiteId']=this['account']['id'];}else{_0x49224b[_[_0x8880('0x26')](this[_0x8880('0x1e')])+'AccountId']=this[_0x8880('0x27')]['id'];}_0x49224b[_[_0x8880('0x26')](this[_0x8880('0x1e')])+_0x8880('0x28')]=this[_0x8880('0x13')]['id'];var _0x261606=this[_0x8880('0x13')];if(rpc[this[_0x8880('0x1e')]+_0x8880('0x29')]){if(this[_0x8880('0x1e')]==='mail'){var _0x406def={'tls':{'rejectUnauthorized':![]}};if(this[_0x8880('0x27')][_0x8880('0x2a')][_0x8880('0x2b')]){_0x406def[_0x8880('0x2b')]=this[_0x8880('0x27')][_0x8880('0x2a')]['service'];}else{_0x406def[_0x8880('0x2c')]=this['account'][_0x8880('0x2a')]['host'];_0x406def['port']=this[_0x8880('0x27')][_0x8880('0x2a')]['port'];_0x406def[_0x8880('0x2d')]=this[_0x8880('0x27')]['Smtp']['secure'];}if(this[_0x8880('0x27')][_0x8880('0x2a')][_0x8880('0x2e')]){_0x406def[_0x8880('0x2f')]={'user':this[_0x8880('0x27')][_0x8880('0x2a')][_0x8880('0x30')],'pass':this[_0x8880('0x27')][_0x8880('0x2a')]['pass']};}_0x49224b[_0x8880('0x31')]=this[_0x8880('0x21')][_0x8880('0x32')];_0x49224b[_0x8880('0x33')]='<div\x20id=\x22xm-mail-content\x22>'+_['replace'](_0x49224b[_0x8880('0xf')],'<div\x20id=\x22xm-mail-content\x22','<div')+_0x8880('0x34');_0x49224b[_0x8880('0x35')]={'Auto-Submitted':_0x8880('0x36'),'X-Auto-Response-Suppress':'All','Precedence':'auto_reply'};return mailRpc[_0x8880('0x37')](_0x406def,_0x49224b)[_0x8880('0x38')](function(_0x49a47a){logger[_0x8880('0x18')](_0x8880('0x39'),_0xc6273);_0x49224b['messageId']=_0x49a47a['message'][_0x8880('0x32')];return rpc[_0x52aef0+_0x8880('0x29')][_0x8880('0x3a')](_0x49224b);})[_0x8880('0x38')](function(_0x48c562){logger['info'](_0x8880('0x15'),_0xc6273,JSON['stringify'](_0x48c562));})[_0x8880('0x3b')](function(_0x4e1020){logger[_0x8880('0x3c')]('[RPC][%s][AUTOREPLY]\x20%s',_0xc6273,JSON[_0x8880('0x3d')](_0x4e1020));})[_0x8880('0x3e')](function(){Promise[_0x8880('0x3f')]()[_0x8880('0x38')](function(){if(_0x473876[0x0]!=='2'||_0x261606[_0x8880('0x17')])return;return rpc[_0x52aef0+_0x8880('0x40')][_0x8880('0x41')](_0x261606['id'],{'autoreplyExecuted':!![]})['then'](function(_0x5014bf){logger[_0x8880('0x18')](_0x8880('0x19'),_0xc6273,JSON[_0x8880('0x3d')](_0x5014bf));})[_0x8880('0x3b')](function(_0xfc31a7){logger[_0x8880('0x3c')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xc6273,JSON[_0x8880('0x3d')](_0xfc31a7));});})[_0x8880('0x38')](function(){_0x7bc0cc['next']();});});}else{return rpc[this[_0x8880('0x1e')]+'Message'][_0x8880('0x3a')](_0x49224b)[_0x8880('0x38')](function(_0x2b4545){logger[_0x8880('0x18')](_0x8880('0x15'),_0xc6273,_0x49224b['body']);})[_0x8880('0x3b')](function(_0xad4ea7){logger['error'](_0x8880('0x15'),_0xc6273,JSON[_0x8880('0x3d')](_0xad4ea7));})['finally'](function(){Promise[_0x8880('0x3f')]()[_0x8880('0x38')](function(){if(_0x473876[0x0]!=='2'||_0x261606[_0x8880('0x17')])return;return rpc[_0x52aef0+_0x8880('0x40')]['update'](_0x261606['id'],{'autoreplyExecuted':!![]})[_0x8880('0x38')](function(_0x135dd0){logger[_0x8880('0x18')](_0x8880('0x19'),_0xc6273,JSON['stringify'](_0x135dd0));})[_0x8880('0x3b')](function(_0x1b60c1){logger[_0x8880('0x3c')](_0x8880('0x42'),_0xc6273,JSON[_0x8880('0x3d')](_0x1b60c1));});})[_0x8880('0x38')](function(){_0x7bc0cc[_0x8880('0x11')]();});});}}}catch(_0xdaeabf){logger['error'](_0x8880('0x15'),_0xc6273,JSON[_0x8880('0x3d')](_0xdaeabf));_0x7bc0cc['stop']();}};};
\ No newline at end of file
index 7f48fcd..95ad54d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x982e=['../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','interaction','then','catch','error','[%s][CLOSE]\x20%s','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x5ae63b,_0x2ba5ec){var _0x4676be=function(_0x2f0a2d){while(--_0x2f0a2d){_0x5ae63b['push'](_0x5ae63b['shift']());}};_0x4676be(++_0x2ba5ec);}(_0x982e,0x175));var _0xe982=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x982e[_0x42cae2];return _0x5f256f;};'use strict';var moment=require(_0xe982('0x0'));var logger=require(_0xe982('0x1'))(_0xe982('0x2'));var rpc={'chatInteraction':require(_0xe982('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xe982('0x4')),'mailInteraction':require(_0xe982('0x5')),'faxInteraction':require(_0xe982('0x6')),'whatsappInteraction':require(_0xe982('0x7'))};exports[_0xe982('0x8')]=function(_0x4dc064,_0x1d89de,_0xbdd593,_0xe3249){return function(_0x180874){try{logger['info'](_0xe982('0x9'),_0x4dc064,_0x1d89de[0x0]);var _0x348af6={'closed':0x1,'closedAt':moment()['format'](_0xe982('0xa')),'closeReason':'system','disposition':_0x1d89de[0x0]};if(rpc[_0xe3249[_0xe982('0xb')]+_0xe982('0xc')]){rpc[_0xe3249[_0xe982('0xb')]+_0xe982('0xc')]['update'](_0xe3249[_0xe982('0xd')]['id'],_0x348af6)[_0xe982('0xe')](function(_0x4525d9){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x4dc064,_0xe3249['interaction']['id']);})[_0xe982('0xf')](function(_0x1ae483){logger[_0xe982('0x10')](_0xe982('0x11'),_0x4dc064,JSON['stringify'](_0x1ae483));})[_0xe982('0x12')](function(){_0x180874[_0xe982('0x13')]();});}}catch(_0x9d8ed){logger[_0xe982('0x10')](_0xe982('0x11'),_0x4dc064,JSON['stringify'](_0x9d8ed));_0x180874[_0xe982('0x13')]();}};};
\ No newline at end of file
+var _0xa2d8=['consequence','info','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x2db5b6,_0x3b53b9){var _0x53a212=function(_0x2560fb){while(--_0x2560fb){_0x2db5b6['push'](_0x2db5b6['shift']());}};_0x53a212(++_0x3b53b9);}(_0xa2d8,0x1dd));var _0x8a2d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xa2d8[_0x618414];return _0x21c19a;};'use strict';var moment=require('moment');var logger=require(_0x8a2d('0x0'))(_0x8a2d('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x8a2d('0x2')),'smsInteraction':require(_0x8a2d('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x8a2d('0x4')),'whatsappInteraction':require(_0x8a2d('0x5'))};exports[_0x8a2d('0x6')]=function(_0x14ce90,_0x5e0fb0,_0x23ee1a,_0x30d82c){return function(_0x263fc9){try{logger[_0x8a2d('0x7')]('[%s][CLOSE]\x20reason\x20%s',_0x14ce90,_0x5e0fb0[0x0]);var _0x2a84df={'closed':0x1,'closedAt':moment()['format'](_0x8a2d('0x8')),'closeReason':_0x8a2d('0x9'),'disposition':_0x5e0fb0[0x0]};if(rpc[_0x30d82c[_0x8a2d('0xa')]+_0x8a2d('0xb')]){rpc[_0x30d82c[_0x8a2d('0xa')]+_0x8a2d('0xb')][_0x8a2d('0xc')](_0x30d82c[_0x8a2d('0xd')]['id'],_0x2a84df)[_0x8a2d('0xe')](function(_0x1205ec){logger[_0x8a2d('0x7')](_0x8a2d('0xf'),_0x14ce90,_0x30d82c[_0x8a2d('0xd')]['id']);})[_0x8a2d('0x10')](function(_0x5ab53e){logger[_0x8a2d('0x11')](_0x8a2d('0x12'),_0x14ce90,JSON['stringify'](_0x5ab53e));})[_0x8a2d('0x13')](function(){_0x263fc9[_0x8a2d('0x14')]();});}}catch(_0x1e602f){logger['error'](_0x8a2d('0x12'),_0x14ce90,JSON['stringify'](_0x1e602f));_0x263fc9[_0x8a2d('0x14')]();}};};
\ No newline at end of file
index 110726f..1362e4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x723e=['whatsapp','phone','account','upperFirst','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','info','error','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','speech','providerName','providerResponse','stringify','metadata','catch','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms'];(function(_0x672d1e,_0x25fbb8){var _0x532592=function(_0x1247e1){while(--_0x1247e1){_0x672d1e['push'](_0x672d1e['shift']());}};_0x532592(++_0x25fbb8);}(_0x723e,0x179));var _0xe723=function(_0x172053,_0x379c7e){_0x172053=_0x172053-0x0;var _0x893bba=_0x723e[_0x172053];return _0x893bba;};'use strict';var _=require('lodash');var moment=require(_0xe723('0x0'));var apiai=require(_0xe723('0x1'));var md5=require(_0xe723('0x2'));var utils=require(_0xe723('0x3'));var logger=require(_0xe723('0x4'))(_0xe723('0x5'));var rpc={'chatMessage':require(_0xe723('0x6')),'openchannelMessage':require(_0xe723('0x7')),'mailMessage':require(_0xe723('0x8')),'smsMessage':require(_0xe723('0x9')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xe723('0xa'))};exports[_0xe723('0xb')]=function(_0x1335cd,_0x3bf082){return function(_0x2aebbd){try{if(!_[_0xe723('0xc')](this[_0xe723('0xd')][_0xe723('0xe')])){logger['info'](_0xe723('0xf'),_0x1335cd,_0xe723('0x10'));return _0x2aebbd[_0xe723('0x11')]();}var _0x5a43fb={'ContactId':this[_0xe723('0x12')]['id'],'sentAt':moment()[_0xe723('0x13')](_0xe723('0x14')),'direction':'out'};if(this[_0xe723('0x15')]===_0xe723('0x16')||this[_0xe723('0x15')]===_0xe723('0x17')){_0x5a43fb[_0xe723('0x18')]=this['interaction'][_0xe723('0x18')];}var _0x4bfbc1=this['channel'];if(_0x4bfbc1==='chat'){_0x5a43fb['ChatWebsiteId']=this[_0xe723('0x19')]['id'];}else{_0x5a43fb[_[_0xe723('0x1a')](_0x4bfbc1)+_0xe723('0x1b')]=this[_0xe723('0x19')]['id'];}_0x5a43fb[_[_0xe723('0x1a')](_0x4bfbc1)+'InteractionId']=this[_0xe723('0xd')]['id'];if(this[_0xe723('0xd')][_0xe723('0x1c')]){var _0x2ec702=_0x3bf082[0x2];if(!_[_0xe723('0x1d')](_0x2ec702)){_0x5a43fb[_0xe723('0x1e')]=utils[_0xe723('0x1f')](_0x2ec702,this);return rpc[_0x4bfbc1+_0xe723('0x20')][_0xe723('0x21')](_0x5a43fb)[_0xe723('0x22')](function(_0x2057d7){logger[_0xe723('0x23')](_0xe723('0xf'),_0x1335cd,_0x5a43fb[_0xe723('0x1e')]);})['catch'](function(_0x5b2308){logger[_0xe723('0x24')](_0xe723('0xf'),_0x1335cd,JSON['stringify'](_0x5b2308));})[_0xe723('0x25')](function(){logger[_0xe723('0x23')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1335cd);_0x2aebbd[_0xe723('0x26')]();});}else{logger['info'](_0xe723('0x27'),_0x1335cd);_0x2aebbd[_0xe723('0x26')]();}}else{var _0x3b82b2=this;var _0x1fe43d=apiai(_0x3bf082[0x0],{'language':_0x3bf082[0x1]||'en'});return _0x1fe43d[_0xe723('0x28')](this[_0xe723('0x29')][_0xe723('0x1e')],{'sessionId':md5(this[_0xe723('0xd')]['id'])})[_0xe723('0x22')](function(_0x19bd0c){_0x3b82b2[_0xe723('0x1e')][_0xe723('0x2a')]=_0x19bd0c;_0x5a43fb['body']=_0x19bd0c[_0xe723('0x2b')]['fulfillment'][_0xe723('0x2c')];_0x5a43fb[_0xe723('0x2d')]=_0xe723('0x2a');_0x5a43fb[_0xe723('0x2e')]=JSON[_0xe723('0x2f')](_0x19bd0c);return rpc[_0x4bfbc1+'Message'][_0xe723('0x21')](_0x5a43fb)['then'](function(_0x52f919){logger[_0xe723('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x1335cd,_0x5a43fb[_0xe723('0x1e')]);if(_0x19bd0c[_0xe723('0x2b')][_0xe723('0x30')]['endConversation']){_0x2aebbd[_0xe723('0x11')]();}else{_0x2aebbd[_0xe723('0x26')]();}})['catch'](function(_0x3c8c56){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x1335cd,JSON[_0xe723('0x2f')](_0x3c8c56));_0x2aebbd[_0xe723('0x11')]();});})[_0xe723('0x31')](function(_0x2b0882){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x1335cd,_0x2b0882[_0xe723('0x29')]);_0x2aebbd['next']();});}}catch(_0x3855c7){logger[_0xe723('0x24')](_0xe723('0xf'),_0x1335cd,JSON[_0xe723('0x2f')](_0x3855c7));_0x2aebbd[_0xe723('0x26')]();}};};
\ No newline at end of file
+var _0x07d7=['account','upperFirst','created','isEmpty','body','getMustacheRender','create','then','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','fulfillment','speech','providerName','providerResponse','Message','result','metadata','endConversation','next','message','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','sms','phone','chat'];(function(_0x2505f2,_0x258a35){var _0x393941=function(_0x34ffda){while(--_0x34ffda){_0x2505f2['push'](_0x2505f2['shift']());}};_0x393941(++_0x258a35);}(_0x07d7,0x85));var _0x707d=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x07d7[_0x479160];return _0x47ac6d;};'use strict';var _=require(_0x707d('0x0'));var moment=require(_0x707d('0x1'));var apiai=require(_0x707d('0x2'));var md5=require(_0x707d('0x3'));var utils=require(_0x707d('0x4'));var logger=require(_0x707d('0x5'))(_0x707d('0x6'));var rpc={'chatMessage':require(_0x707d('0x7')),'openchannelMessage':require(_0x707d('0x8')),'mailMessage':require(_0x707d('0x9')),'smsMessage':require(_0x707d('0xa')),'faxMessage':require(_0x707d('0xb')),'whatsappMessage':require(_0x707d('0xc'))};exports[_0x707d('0xd')]=function(_0x1bdf46,_0x13df54){return function(_0x50de20){try{if(!_['isNil'](this[_0x707d('0xe')][_0x707d('0xf')])){logger[_0x707d('0x10')](_0x707d('0x11'),_0x1bdf46,_0x707d('0x12'));return _0x50de20['next']();}var _0x3f45f5={'ContactId':this[_0x707d('0x13')]['id'],'sentAt':moment()[_0x707d('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x707d('0x15')};if(this[_0x707d('0x16')]===_0x707d('0x17')||this['channel']==='whatsapp'){_0x3f45f5['phone']=this[_0x707d('0xe')][_0x707d('0x18')];}var _0x5c4815=this['channel'];if(_0x5c4815===_0x707d('0x19')){_0x3f45f5['ChatWebsiteId']=this[_0x707d('0x1a')]['id'];}else{_0x3f45f5[_[_0x707d('0x1b')](_0x5c4815)+'AccountId']=this['account']['id'];}_0x3f45f5[_[_0x707d('0x1b')](_0x5c4815)+'InteractionId']=this[_0x707d('0xe')]['id'];if(this[_0x707d('0xe')][_0x707d('0x1c')]){var _0x1f4f0e=_0x13df54[0x2];if(!_[_0x707d('0x1d')](_0x1f4f0e)){_0x3f45f5[_0x707d('0x1e')]=utils[_0x707d('0x1f')](_0x1f4f0e,this);return rpc[_0x5c4815+'Message'][_0x707d('0x20')](_0x3f45f5)[_0x707d('0x21')](function(_0x3617c3){logger['info'](_0x707d('0x11'),_0x1bdf46,_0x3f45f5[_0x707d('0x1e')]);})[_0x707d('0x22')](function(_0x8e524c){logger[_0x707d('0x23')](_0x707d('0x11'),_0x1bdf46,JSON[_0x707d('0x24')](_0x8e524c));})[_0x707d('0x25')](function(){logger[_0x707d('0x10')](_0x707d('0x26'),_0x1bdf46);_0x50de20[_0x707d('0x27')]();});}else{logger[_0x707d('0x10')](_0x707d('0x28'),_0x1bdf46);_0x50de20[_0x707d('0x27')]();}}else{var _0xd97d6b=this;var _0x30d175=apiai(_0x13df54[0x0],{'language':_0x13df54[0x1]||'en'});return _0x30d175[_0x707d('0x29')](this['message'][_0x707d('0x1e')],{'sessionId':md5(this['interaction']['id'])})[_0x707d('0x21')](function(_0x139ad5){_0xd97d6b[_0x707d('0x1e')][_0x707d('0x2a')]=_0x139ad5;_0x3f45f5[_0x707d('0x1e')]=_0x139ad5['result'][_0x707d('0x2b')][_0x707d('0x2c')];_0x3f45f5[_0x707d('0x2d')]=_0x707d('0x2a');_0x3f45f5[_0x707d('0x2e')]=JSON[_0x707d('0x24')](_0x139ad5);return rpc[_0x5c4815+_0x707d('0x2f')][_0x707d('0x20')](_0x3f45f5)[_0x707d('0x21')](function(_0x2f03bc){logger[_0x707d('0x10')](_0x707d('0x11'),_0x1bdf46,_0x3f45f5[_0x707d('0x1e')]);if(_0x139ad5[_0x707d('0x30')][_0x707d('0x31')][_0x707d('0x32')]){_0x50de20[_0x707d('0x33')]();}else{_0x50de20[_0x707d('0x27')]();}})['catch'](function(_0x17bb4e){logger[_0x707d('0x23')](_0x707d('0x11'),_0x1bdf46,JSON['stringify'](_0x17bb4e));_0x50de20['next']();});})['catch'](function(_0x18c7e4){logger[_0x707d('0x23')](_0x707d('0x11'),_0x1bdf46,_0x18c7e4[_0x707d('0x34')]);_0x50de20[_0x707d('0x33')]();});}}catch(_0x327623){logger[_0x707d('0x23')](_0x707d('0x11'),_0x1bdf46,JSON[_0x707d('0x24')](_0x327623));_0x50de20[_0x707d('0x27')]();}};};
\ No newline at end of file
index 3515a35..ad3bf8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63a3=['consequence','interaction','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','account','upperFirst','InteractionId','isEmpty','getMustacheRender','Message','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','SessionsClient','sessionPath','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','all','next','message','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','create','then','catch','error','[%s][DIALOGFLOWV2]\x20%s','stringify'];(function(_0x2fb5fb,_0x2bfb1d){var _0x1dba0a=function(_0x28e0aa){while(--_0x28e0aa){_0x2fb5fb['push'](_0x2fb5fb['shift']());}};_0x1dba0a(++_0x2bfb1d);}(_0x63a3,0x15b));var _0x363a=function(_0x1e1965,_0x55785c){_0x1e1965=_0x1e1965-0x0;var _0x1a2e96=_0x63a3[_0x1e1965];return _0x1a2e96;};'use strict';var _=require(_0x363a('0x0'));var dialogflow=require(_0x363a('0x1'));var md5=require(_0x363a('0x2'));var moment=require(_0x363a('0x3'));var Promise=require(_0x363a('0x4'));var logger=require(_0x363a('0x5'))(_0x363a('0x6'));var utils=require('./utils');var rpc={'chatMessage':require(_0x363a('0x7')),'openchannelMessage':require(_0x363a('0x8')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x363a('0x9')),'whatsappMessage':require(_0x363a('0xa'))};function createMessage(_0x12c445,_0x3cc389,_0x39dc5,_0x35662c){return new Promise(function(_0x2baae4,_0x4bb46e){var _0x3c8a6b=_['clone'](_0x39dc5);_0x3c8a6b[_0x363a('0xb')]=_0x35662c;return rpc[_0x3cc389+'Message'][_0x363a('0xc')](_0x3c8a6b)[_0x363a('0xd')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x12c445,_0x3c8a6b['body']);_0x2baae4();})[_0x363a('0xe')](function(_0x3ec6a2){logger[_0x363a('0xf')](_0x363a('0x10'),_0x12c445,JSON[_0x363a('0x11')](_0x3ec6a2));_0x4bb46e(_0x3ec6a2);});});}exports[_0x363a('0x12')]=function(_0x1a34b3,_0x2503f0){return function(_0x7d8bd){try{if(!_['isNil'](this[_0x363a('0x13')]['UserId'])){logger[_0x363a('0x14')](_0x363a('0x10'),_0x1a34b3,_0x363a('0x15'));return _0x7d8bd['next']();}var _0x353ad1={'ContactId':this[_0x363a('0x16')]['id'],'sentAt':moment()[_0x363a('0x17')](_0x363a('0x18')),'direction':_0x363a('0x19')};if(this[_0x363a('0x1a')]===_0x363a('0x1b')||this[_0x363a('0x1a')]===_0x363a('0x1c')){_0x353ad1[_0x363a('0x1d')]=this[_0x363a('0x13')]['phone'];}var _0x3045b2=this['channel'];if(_0x3045b2==='chat'){_0x353ad1['ChatWebsiteId']=this[_0x363a('0x1e')]['id'];}else{_0x353ad1[_[_0x363a('0x1f')](_0x3045b2)+'AccountId']=this[_0x363a('0x1e')]['id'];}_0x353ad1[_[_0x363a('0x1f')](_0x3045b2)+_0x363a('0x20')]=this['interaction']['id'];if(this[_0x363a('0x13')]['created']){var _0x4f4435=_0x2503f0[0x4];if(!_[_0x363a('0x21')](_0x4f4435)){_0x353ad1['body']=utils[_0x363a('0x22')](_0x4f4435,this);return rpc[_0x3045b2+_0x363a('0x23')]['create'](_0x353ad1)['then'](function(_0x139304){logger[_0x363a('0x14')](_0x363a('0x10'),_0x1a34b3,_0x353ad1['body']);})[_0x363a('0xe')](function(_0x11801a){logger[_0x363a('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x1a34b3,JSON['stringify'](_0x11801a));})[_0x363a('0x24')](function(){logger[_0x363a('0x14')](_0x363a('0x25'),_0x1a34b3);_0x7d8bd['stop']();});}else{logger[_0x363a('0x14')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x1a34b3);_0x7d8bd[_0x363a('0x26')]();}}else{var _0xed67a9=this;var _0x2383a8=_0x2503f0[0x2][_0x363a('0x27')](/\\n/g,'\x0a');var _0x1dbae5={'credentials':{'private_key':_0x2383a8,'client_email':_0x2503f0[0x1]}};var _0x3f4532=new dialogflow[(_0x363a('0x28'))](_0x1dbae5);var _0x43820a=_0x3f4532[_0x363a('0x29')](_0x2503f0[0x0],md5(_0xed67a9[_0x363a('0x13')]['id']));var _0x261f07={'session':_0x43820a,'queryInput':{'text':{'text':_0xed67a9['message'][_0x363a('0xb')],'languageCode':_0x2503f0[0x3]||'en'}}};return _0x3f4532[_0x363a('0x2a')](_0x261f07)[_0x363a('0xd')](function(_0x3ece3f){if(_0x3ece3f&&_0x3ece3f[_0x363a('0x2b')]){_0xed67a9['body']['dialogflowV2']=_0x3ece3f;var _0x50cb90=_0x3ece3f[0x0];var _0x401efa=_0x50cb90[_0x363a('0x2c')]['diagnosticInfo']&&_0x50cb90['queryResult'][_0x363a('0x2d')][_0x363a('0x2e')]?_0x50cb90['queryResult']['diagnosticInfo']['fields'][_0x363a('0x2f')][_0x363a('0x30')]:![];_0xed67a9['body'][_0x363a('0x31')]=_0x50cb90[_0x363a('0x2c')][_0x363a('0x32')];_0xed67a9['body'][_0x363a('0x33')]=_0x50cb90[_0x363a('0x2c')][_0x363a('0x34')];_0xed67a9[_0x363a('0xb')][_0x363a('0x35')]=_0x50cb90[_0x363a('0x2c')][_0x363a('0x2d')]&&_0x50cb90['queryResult'][_0x363a('0x2d')][_0x363a('0x2e')]?_0x50cb90['queryResult'][_0x363a('0x2d')][_0x363a('0x2e')][_0x363a('0x2f')][_0x363a('0x30')]:![];_0xed67a9[_0x363a('0xb')][_0x363a('0x36')]=_0x50cb90['queryResult'][_0x363a('0x37')][_0x363a('0x38')];_0xed67a9[_0x363a('0xb')][_0x363a('0x39')]=_0x50cb90[_0x363a('0x2c')][_0x363a('0x37')][_0x363a('0x3a')];_0xed67a9[_0x363a('0xb')][_0x363a('0x3b')]=_0x50cb90[_0x363a('0x2c')]['intent'][_0x363a('0x3c')];_0xed67a9[_0x363a('0xb')][_0x363a('0x3d')]=_0x50cb90[_0x363a('0x2c')]['languageCode'];_0xed67a9['body']['DIALOGFLOWV2_QUERYTEXT']=_0x50cb90[_0x363a('0x2c')][_0x363a('0x3e')];_0xed67a9[_0x363a('0xb')][_0x363a('0x3f')]=_0x50cb90['queryResult'][_0x363a('0x40')];_0x353ad1[_0x363a('0x41')]=_0x363a('0x42');_0x353ad1[_0x363a('0x43')]=JSON['stringify'](_0x3ece3f);var _0x1f80a1=[];for(var _0x5a13b7=0x0;_0x5a13b7<_0x3ece3f[_0x363a('0x2b')];_0x5a13b7++){var _0x3d0e4b=_0x3ece3f[_0x5a13b7];if(_0x3d0e4b&&_0x3d0e4b[_0x363a('0x2c')]&&_0x3d0e4b[_0x363a('0x2c')][_0x363a('0x44')]){_0x1f80a1[_0x363a('0x45')](createMessage(_0x1a34b3,_0x3045b2,_0x353ad1,_0x3d0e4b[_0x363a('0x2c')]['fulfillmentText']));}}return Promise[_0x363a('0x46')](_0x1f80a1)[_0x363a('0xd')](function(){if(_0x401efa){_0x7d8bd['next']();}else{_0x7d8bd[_0x363a('0x26')]();}})[_0x363a('0xe')](function(_0x1c6411){logger[_0x363a('0xf')](_0x363a('0x10'),_0x1a34b3,JSON['stringify'](_0x1c6411));_0x7d8bd[_0x363a('0x47')]();});}})[_0x363a('0xe')](function(_0x51093f){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x1a34b3,_0x51093f[_0x363a('0x48')]);_0x7d8bd[_0x363a('0x47')]();});}}catch(_0x5a5460){logger[_0x363a('0xf')](_0x363a('0x10'),_0x1a34b3,JSON['stringify'](_0x5a5460));_0x7d8bd[_0x363a('0x26')]();}};};
\ No newline at end of file
+var _0x450f=['stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','sessionPath','message','detectIntent','length','diagnosticInfo','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId','info','next','contact','out','channel','sms','whatsapp','phone','interaction','chat','account','upperFirst','AccountId','created','isEmpty','getMustacheRender','finally'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x450f,0x15d));var _0xf450=function(_0x28d025,_0x4eb1f1){_0x28d025=_0x28d025-0x0;var _0x160d9c=_0x450f[_0x28d025];return _0x160d9c;};'use strict';var _=require(_0xf450('0x0'));var dialogflow=require(_0xf450('0x1'));var md5=require(_0xf450('0x2'));var moment=require(_0xf450('0x3'));var Promise=require(_0xf450('0x4'));var logger=require(_0xf450('0x5'))(_0xf450('0x6'));var utils=require(_0xf450('0x7'));var rpc={'chatMessage':require(_0xf450('0x8')),'openchannelMessage':require(_0xf450('0x9')),'mailMessage':require(_0xf450('0xa')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xf450('0xb')),'whatsappMessage':require(_0xf450('0xc'))};function createMessage(_0x181481,_0xe54b6b,_0xd1c751,_0x28fbad){return new Promise(function(_0x424e7d,_0x414561){var _0x147308=_['clone'](_0xd1c751);_0x147308[_0xf450('0xd')]=_0x28fbad;return rpc[_0xe54b6b+_0xf450('0xe')][_0xf450('0xf')](_0x147308)[_0xf450('0x10')](function(){logger['info'](_0xf450('0x11'),_0x181481,_0x147308[_0xf450('0xd')]);_0x424e7d();})[_0xf450('0x12')](function(_0x3adecf){logger[_0xf450('0x13')](_0xf450('0x11'),_0x181481,JSON[_0xf450('0x14')](_0x3adecf));_0x414561(_0x3adecf);});});}exports[_0xf450('0x15')]=function(_0x10b48c,_0x3163ef){return function(_0x1cdb27){try{if(!_[_0xf450('0x16')](this['interaction'][_0xf450('0x17')])){logger[_0xf450('0x18')](_0xf450('0x11'),_0x10b48c,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1cdb27[_0xf450('0x19')]();}var _0x763781={'ContactId':this[_0xf450('0x1a')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xf450('0x1b')};if(this[_0xf450('0x1c')]===_0xf450('0x1d')||this[_0xf450('0x1c')]===_0xf450('0x1e')){_0x763781[_0xf450('0x1f')]=this[_0xf450('0x20')][_0xf450('0x1f')];}var _0x20b3a3=this[_0xf450('0x1c')];if(_0x20b3a3===_0xf450('0x21')){_0x763781['ChatWebsiteId']=this[_0xf450('0x22')]['id'];}else{_0x763781[_[_0xf450('0x23')](_0x20b3a3)+_0xf450('0x24')]=this[_0xf450('0x22')]['id'];}_0x763781[_[_0xf450('0x23')](_0x20b3a3)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0xf450('0x25')]){var _0x1b7f6d=_0x3163ef[0x4];if(!_[_0xf450('0x26')](_0x1b7f6d)){_0x763781[_0xf450('0xd')]=utils[_0xf450('0x27')](_0x1b7f6d,this);return rpc[_0x20b3a3+'Message'][_0xf450('0xf')](_0x763781)[_0xf450('0x10')](function(_0x696fb5){logger[_0xf450('0x18')]('[%s][DIALOGFLOWV2]\x20%s',_0x10b48c,_0x763781[_0xf450('0xd')]);})['catch'](function(_0x36a7e4){logger['error'](_0xf450('0x11'),_0x10b48c,JSON[_0xf450('0x14')](_0x36a7e4));})[_0xf450('0x28')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x10b48c);_0x1cdb27[_0xf450('0x29')]();});}else{logger['info'](_0xf450('0x2a'),_0x10b48c);_0x1cdb27[_0xf450('0x29')]();}}else{var _0x50570f=this;var _0x4e6412=_0x3163ef[0x2]['replace'](/\\n/g,'\x0a');var _0x3aff74={'credentials':{'private_key':_0x4e6412,'client_email':_0x3163ef[0x1]}};var _0x1d5b63=new dialogflow['SessionsClient'](_0x3aff74);var _0x21da2b=_0x1d5b63[_0xf450('0x2b')](_0x3163ef[0x0],md5(_0x50570f[_0xf450('0x20')]['id']));var _0x32e9a7={'session':_0x21da2b,'queryInput':{'text':{'text':_0x50570f[_0xf450('0x2c')][_0xf450('0xd')],'languageCode':_0x3163ef[0x3]||'en'}}};return _0x1d5b63[_0xf450('0x2d')](_0x32e9a7)[_0xf450('0x10')](function(_0xc24042){if(_0xc24042&&_0xc24042[_0xf450('0x2e')]){_0x50570f['body']['dialogflowV2']=_0xc24042;var _0x3a0e88=_0xc24042[0x0];var _0x5c4567=_0x3a0e88['queryResult'][_0xf450('0x2f')]&&_0x3a0e88[_0xf450('0x30')][_0xf450('0x2f')][_0xf450('0x31')]?_0x3a0e88[_0xf450('0x30')]['diagnosticInfo'][_0xf450('0x31')][_0xf450('0x32')][_0xf450('0x33')]:![];_0x50570f[_0xf450('0xd')][_0xf450('0x34')]=_0x3a0e88[_0xf450('0x30')]['action'];_0x50570f['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x3a0e88[_0xf450('0x30')]['allRequiredParamsPresent'];_0x50570f[_0xf450('0xd')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x3a0e88[_0xf450('0x30')][_0xf450('0x2f')]&&_0x3a0e88['queryResult'][_0xf450('0x2f')][_0xf450('0x31')]?_0x3a0e88[_0xf450('0x30')]['diagnosticInfo']['fields'][_0xf450('0x32')][_0xf450('0x33')]:![];_0x50570f[_0xf450('0xd')][_0xf450('0x35')]=_0x3a0e88[_0xf450('0x30')][_0xf450('0x36')][_0xf450('0x37')];_0x50570f[_0xf450('0xd')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x3a0e88[_0xf450('0x30')][_0xf450('0x36')]['displayName'];_0x50570f[_0xf450('0xd')][_0xf450('0x38')]=_0x3a0e88[_0xf450('0x30')][_0xf450('0x36')]['isFallback'];_0x50570f['body'][_0xf450('0x39')]=_0x3a0e88[_0xf450('0x30')]['languageCode'];_0x50570f[_0xf450('0xd')][_0xf450('0x3a')]=_0x3a0e88[_0xf450('0x30')]['queryText'];_0x50570f[_0xf450('0xd')][_0xf450('0x3b')]=_0x3a0e88[_0xf450('0x30')]['intentDetectionConfidence'];_0x763781[_0xf450('0x3c')]='dialogflowV2';_0x763781[_0xf450('0x3d')]=JSON[_0xf450('0x14')](_0xc24042);var _0x150323=[];for(var _0x4d2584=0x0;_0x4d2584<_0xc24042['length'];_0x4d2584++){var _0x18a02e=_0xc24042[_0x4d2584];if(_0x18a02e&&_0x18a02e[_0xf450('0x30')]&&_0x18a02e[_0xf450('0x30')][_0xf450('0x3e')]){_0x150323[_0xf450('0x3f')](createMessage(_0x10b48c,_0x20b3a3,_0x763781,_0x18a02e[_0xf450('0x30')][_0xf450('0x3e')]));}}return Promise[_0xf450('0x40')](_0x150323)[_0xf450('0x10')](function(){if(_0x5c4567){_0x1cdb27['next']();}else{_0x1cdb27[_0xf450('0x29')]();}})[_0xf450('0x12')](function(_0x3002c9){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x10b48c,JSON['stringify'](_0x3002c9));_0x1cdb27[_0xf450('0x19')]();});}})[_0xf450('0x12')](function(_0x1a391e){logger[_0xf450('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x10b48c,_0x1a391e[_0xf450('0x2c')]);_0x1cdb27[_0xf450('0x19')]();});}}catch(_0x1455c5){logger[_0xf450('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x10b48c,JSON['stringify'](_0x1455c5));_0x1cdb27['stop']();}};};
\ No newline at end of file
index 47e5d33..3f5d3ff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc816=['map','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stop','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','getMustacheRender','replace','length','error'];(function(_0x3ae4bf,_0x554978){var _0x27f7dd=function(_0x406997){while(--_0x406997){_0x3ae4bf['push'](_0x3ae4bf['shift']());}};_0x27f7dd(++_0x554978);}(_0xc816,0x152));var _0x6c81=function(_0x558970,_0x1d6cee){_0x558970=_0x558970-0x0;var _0x4df02c=_0xc816[_0x558970];return _0x4df02c;};'use strict';var schema=require(_0x6c81('0x0'));var _=require(_0x6c81('0x1'));var htmlToText=require(_0x6c81('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x6c81('0x3'));var gotoif=schema({'condition':{'type':_0x6c81('0x4'),'required':!![],'message':_0x6c81('0x5')},'priorityTrue':{'type':_0x6c81('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x6c81('0x6'),'message':_0x6c81('0x7')}});exports[_0x6c81('0x8')]=function(_0x425d27,_0x5297bd){return function(_0x279cd2){try{var _0x4da92f={'condition':htmlToText['fromString'](utils[_0x6c81('0x9')](_0x5297bd[0x0],this),{'wordwrap':![]})[_0x6c81('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x5297bd[0x1],'priorityFalse':_0x5297bd[0x2]};var _0x5e88e3=gotoif[_0x6c81('0x0')](_0x4da92f,{'typecast':!![]});if(_0x5e88e3[_0x6c81('0xb')]){logger[_0x6c81('0xc')]('[%s][GOTOIF]\x20%s',_0x425d27,_[_0x6c81('0xd')](_0x5e88e3,'message')['join'](',\x20'));_0x279cd2['stop']();}else{try{var _0x565eb2=eval('('+_0x4da92f[_0x6c81('0xe')]+')');var _0x5cc1f1=_0x565eb2?_0x4da92f[_0x6c81('0xf')]:_0x4da92f[_0x6c81('0x10')];logger[_0x6c81('0x11')](_0x6c81('0x12'),_0x425d27,_0x4da92f[_0x6c81('0xe')],_0x565eb2,_0x5cc1f1||'next');if(_0x5cc1f1){var _0x256902=_['findIndex'](_0x279cd2['rules'](),{'p':_0x5cc1f1});if(_0x256902>=0x0){logger[_0x6c81('0x11')](_0x6c81('0x13'),_0x425d27,_0x5cc1f1||_0x6c81('0x14'),_0x256902);_0x279cd2[_0x6c81('0x14')](_0x256902);}else{logger[_0x6c81('0x11')](_0x6c81('0x15'),_0x425d27,_0x5cc1f1||_0x6c81('0x14'));_0x279cd2['stop']();}}else{_0x279cd2['next']();}}catch(_0x27e55b){logger[_0x6c81('0xc')](_0x6c81('0x16'),_0x425d27,_0x27e55b[_0x6c81('0x17')]);_0x279cd2[_0x6c81('0x18')]();}}}catch(_0x2a23b9){logger[_0x6c81('0xc')](_0x6c81('0x19'),_0x425d27,JSON[_0x6c81('0x1a')](_0x2a23b9));_0x279cd2[_0x6c81('0x18')]();}};};
\ No newline at end of file
+var _0x8671=['validate','lodash','html-to-text','./utils','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','info','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','error'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x8671,0x1ee));var _0x1867=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x8671[_0x5c351c];return _0x26f3b3;};'use strict';var schema=require(_0x1867('0x0'));var _=require(_0x1867('0x1'));var htmlToText=require(_0x1867('0x2'));var utils=require(_0x1867('0x3'));var logger=require('../../../../config/logger')(_0x1867('0x4'));var gotoif=schema({'condition':{'type':_0x1867('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x1867('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x1867('0x6'),'message':_0x1867('0x7')}});exports[_0x1867('0x8')]=function(_0x5f4400,_0x14851d){return function(_0x512350){try{var _0x287e5e={'condition':htmlToText[_0x1867('0x9')](utils[_0x1867('0xa')](_0x14851d[0x0],this),{'wordwrap':![]})[_0x1867('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x14851d[0x1],'priorityFalse':_0x14851d[0x2]};var _0x5bf25f=gotoif[_0x1867('0x0')](_0x287e5e,{'typecast':!![]});if(_0x5bf25f[_0x1867('0xc')]){logger['error'](_0x1867('0xd'),_0x5f4400,_[_0x1867('0xe')](_0x5bf25f,_0x1867('0xf'))[_0x1867('0x10')](',\x20'));_0x512350[_0x1867('0x11')]();}else{try{var _0x23a1d8=eval('('+_0x287e5e[_0x1867('0x12')]+')');var _0x5722e5=_0x23a1d8?_0x287e5e[_0x1867('0x13')]:_0x287e5e['priorityFalse'];logger[_0x1867('0x14')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x5f4400,_0x287e5e[_0x1867('0x12')],_0x23a1d8,_0x5722e5||_0x1867('0x15'));if(_0x5722e5){var _0x3cfab3=_[_0x1867('0x16')](_0x512350[_0x1867('0x17')](),{'p':_0x5722e5});if(_0x3cfab3>=0x0){logger[_0x1867('0x14')](_0x1867('0x18'),_0x5f4400,_0x5722e5||_0x1867('0x15'),_0x3cfab3);_0x512350[_0x1867('0x15')](_0x3cfab3);}else{logger[_0x1867('0x14')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x5f4400,_0x5722e5||_0x1867('0x15'));_0x512350[_0x1867('0x11')]();}}else{_0x512350['next']();}}catch(_0x324410){logger[_0x1867('0x19')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5f4400,_0x324410[_0x1867('0xf')]);_0x512350[_0x1867('0x11')]();}}}catch(_0x1c0f77){logger[_0x1867('0x19')](_0x1867('0xd'),_0x5f4400,JSON['stringify'](_0x1c0f77));_0x512350[_0x1867('0x11')]();}};};
\ No newline at end of file
index ea44a46..c7ec485 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e28=['message','stop','info','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','../../../../config/logger','routing','number','consequence','length','error','[%s][GOTOP]\x20%s','map'];(function(_0x408f2a,_0x310001){var _0x1cdb2a=function(_0x94ddae){while(--_0x94ddae){_0x408f2a['push'](_0x408f2a['shift']());}};_0x1cdb2a(++_0x310001);}(_0x9e28,0x1ef));var _0x89e2=function(_0xeb9e14,_0x2b59d4){_0xeb9e14=_0xeb9e14-0x0;var _0x175b3f=_0x9e28[_0xeb9e14];return _0x175b3f;};'use strict';var schema=require(_0x89e2('0x0'));var _=require('lodash');var logger=require(_0x89e2('0x1'))(_0x89e2('0x2'));var gotop=schema({'priority':{'type':_0x89e2('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x89e2('0x4')]=function(_0x5043a3,_0x4850b1){return function(_0x29bcf0){try{var _0x39879f={'priority':_0x4850b1[0x0]};var _0x39dff3=gotop[_0x89e2('0x0')](_0x39879f,{'typecast':!![]});if(_0x39dff3[_0x89e2('0x5')]){logger[_0x89e2('0x6')](_0x89e2('0x7'),_0x5043a3,_[_0x89e2('0x8')](_0x39dff3,_0x89e2('0x9'))['join'](',\x20'));_0x29bcf0[_0x89e2('0xa')]();}else{logger[_0x89e2('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x5043a3,_0x39879f[_0x89e2('0xc')]);if(_0x39879f[_0x89e2('0xc')]){var _0x409f25=_[_0x89e2('0xd')](_0x29bcf0[_0x89e2('0xe')](),{'p':_0x39879f[_0x89e2('0xc')]});if(_0x409f25>=0x0){logger['info'](_0x89e2('0xf'),_0x5043a3,_0x39879f[_0x89e2('0xc')]||_0x89e2('0x10'),_0x409f25);_0x29bcf0[_0x89e2('0x10')](_0x409f25);}else{logger[_0x89e2('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5043a3,_0x39879f[_0x89e2('0xc')]||_0x89e2('0x10'));_0x29bcf0['stop']();}}else{_0x29bcf0[_0x89e2('0x10')]();}}}catch(_0x46e83a){logger['error']('[%s][GOTOP]\x20%s',_0x5043a3,JSON[_0x89e2('0x11')](_0x46e83a));_0x29bcf0[_0x89e2('0xa')]();}};};
\ No newline at end of file
+var _0xc805=['[%s][GOTOP]\x20%s','map','message','join','stop','info','priority','findIndex','[%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','number','length'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc805,0x6c));var _0x5c80=function(_0x41f96e,_0x333851){_0x41f96e=_0x41f96e-0x0;var _0x48a4ac=_0xc805[_0x41f96e];return _0x48a4ac;};'use strict';var schema=require(_0x5c80('0x0'));var _=require(_0x5c80('0x1'));var logger=require(_0x5c80('0x2'))(_0x5c80('0x3'));var gotop=schema({'priority':{'type':_0x5c80('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x9ced1f,_0x58bc06){return function(_0x4ec8a0){try{var _0x3d89a6={'priority':_0x58bc06[0x0]};var _0xa0d1fa=gotop['validate'](_0x3d89a6,{'typecast':!![]});if(_0xa0d1fa[_0x5c80('0x5')]){logger['error'](_0x5c80('0x6'),_0x9ced1f,_[_0x5c80('0x7')](_0xa0d1fa,_0x5c80('0x8'))[_0x5c80('0x9')](',\x20'));_0x4ec8a0[_0x5c80('0xa')]();}else{logger[_0x5c80('0xb')]('[%s][GOTOP]\x20priority\x20%s',_0x9ced1f,_0x3d89a6[_0x5c80('0xc')]);if(_0x3d89a6['priority']){var _0x40f5ca=_[_0x5c80('0xd')](_0x4ec8a0['rules'](),{'p':_0x3d89a6[_0x5c80('0xc')]});if(_0x40f5ca>=0x0){logger['info'](_0x5c80('0xe'),_0x9ced1f,_0x3d89a6[_0x5c80('0xc')]||_0x5c80('0xf'),_0x40f5ca);_0x4ec8a0['next'](_0x40f5ca);}else{logger[_0x5c80('0xb')](_0x5c80('0x10'),_0x9ced1f,_0x3d89a6[_0x5c80('0xc')]||_0x5c80('0xf'));_0x4ec8a0['stop']();}}else{_0x4ec8a0[_0x5c80('0xf')]();}}}catch(_0x306156){logger[_0x5c80('0x11')]('[%s][GOTOP]\x20%s',_0x9ced1f,JSON[_0x5c80('0x12')](_0x306156));_0x4ec8a0[_0x5c80('0xa')]();}};};
\ No newline at end of file
index ff8ae7a..5e17d05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2922=['account','upperFirst','AccountId','InteractionId','interaction','Message','create','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','lodash','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','ChatWebsiteId'];(function(_0x34f36e,_0x31e000){var _0x1781c7=function(_0x15fdd3){while(--_0x15fdd3){_0x34f36e['push'](_0x34f36e['shift']());}};_0x1781c7(++_0x31e000);}(_0x2922,0x107));var _0x2292=function(_0x1fe346,_0x192894){_0x1fe346=_0x1fe346-0x0;var _0x30227d=_0x2922[_0x1fe346];return _0x30227d;};'use strict';var _=require(_0x2292('0x0'));var utils=require('./utils');var logger=require(_0x2292('0x1'))(_0x2292('0x2'));var rpc={'chatMessage':require(_0x2292('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2292('0x4')),'smsMessage':require(_0x2292('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x2292('0x6'))};exports[_0x2292('0x7')]=function(_0x5f0664,_0x2136bc){return function(_0x5e01b4){try{var _0x3e5d19={'body':utils[_0x2292('0x8')](_0x2136bc[0x0],this),'ContactId':this[_0x2292('0x9')]['id']};if(this[_0x2292('0xa')]==='chat'){_0x3e5d19[_0x2292('0xb')]=this[_0x2292('0xc')]['id'];}else{_0x3e5d19[_[_0x2292('0xd')](this['channel'])+_0x2292('0xe')]=this['account']['id'];}_0x3e5d19[_[_0x2292('0xd')](this['channel'])+_0x2292('0xf')]=this[_0x2292('0x10')]['id'];if(rpc[this[_0x2292('0xa')]+_0x2292('0x11')]){return rpc[this[_0x2292('0xa')]+_0x2292('0x11')][_0x2292('0x12')](_0x3e5d19)['then'](function(_0x387e04){logger['info'](_0x2292('0x13'),_0x5f0664,_0x3e5d19[_0x2292('0x14')]);_0x5e01b4[_0x2292('0x15')]();})[_0x2292('0x16')](function(_0xfad30b){logger[_0x2292('0x17')](_0x2292('0x13'),_0x5f0664,JSON[_0x2292('0x18')](_0xfad30b));_0x5e01b4['stop']();});}}catch(_0x4851bd){logger[_0x2292('0x17')](_0x2292('0x13'),_0x5f0664,JSON[_0x2292('0x18')](_0x4851bd));_0x5e01b4['stop']();}};};
\ No newline at end of file
+var _0xdd1d=['AccountId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','next','catch','error','stringify','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','channel','chat','ChatWebsiteId','account','upperFirst'];(function(_0x504c36,_0x44bbea){var _0x253151=function(_0x47f31c){while(--_0x47f31c){_0x504c36['push'](_0x504c36['shift']());}};_0x253151(++_0x44bbea);}(_0xdd1d,0xb2));var _0xddd1=function(_0x39de58,_0x158a4c){_0x39de58=_0x39de58-0x0;var _0x5ce2d1=_0xdd1d[_0x39de58];return _0x5ce2d1;};'use strict';var _=require(_0xddd1('0x0'));var utils=require(_0xddd1('0x1'));var logger=require(_0xddd1('0x2'))(_0xddd1('0x3'));var rpc={'chatMessage':require(_0xddd1('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xddd1('0x5')),'smsMessage':require(_0xddd1('0x6')),'faxMessage':require(_0xddd1('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xddd1('0x8')]=function(_0x5e7e44,_0x18f5d2){return function(_0x3ba6a9){try{var _0x268896={'body':utils['getMustacheRender'](_0x18f5d2[0x0],this),'ContactId':this['contact']['id']};if(this[_0xddd1('0x9')]===_0xddd1('0xa')){_0x268896[_0xddd1('0xb')]=this[_0xddd1('0xc')]['id'];}else{_0x268896[_[_0xddd1('0xd')](this[_0xddd1('0x9')])+_0xddd1('0xe')]=this[_0xddd1('0xc')]['id'];}_0x268896[_['upperFirst'](this[_0xddd1('0x9')])+'InteractionId']=this[_0xddd1('0xf')]['id'];if(rpc[this['channel']+_0xddd1('0x10')]){return rpc[this['channel']+'Message'][_0xddd1('0x11')](_0x268896)[_0xddd1('0x12')](function(_0x8f310e){logger['info'](_0xddd1('0x13'),_0x5e7e44,_0x268896['body']);_0x3ba6a9[_0xddd1('0x14')]();})[_0xddd1('0x15')](function(_0x322271){logger[_0xddd1('0x16')](_0xddd1('0x13'),_0x5e7e44,JSON[_0xddd1('0x17')](_0x322271));_0x3ba6a9['stop']();});}}catch(_0x105992){logger[_0xddd1('0x16')](_0xddd1('0x13'),_0x5e7e44,JSON[_0xddd1('0x17')](_0x105992));_0x3ba6a9['stop']();}};};
\ No newline at end of file
index 63cead8..9e24253 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa33=['next','stringify','stop','./utils','../../../../config/logger','routing','consequence','[%s][NOOP]\x20%s'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xfa33,0x14b));var _0x3fa3=function(_0x390d3a,_0x5eaf16){_0x390d3a=_0x390d3a-0x0;var _0x294503=_0xfa33[_0x390d3a];return _0x294503;};'use strict';var utils=require(_0x3fa3('0x0'));var logger=require(_0x3fa3('0x1'))(_0x3fa3('0x2'));exports[_0x3fa3('0x3')]=function(_0x2a954f,_0x45acbe){return function(_0x4883cc){try{logger['info'](_0x3fa3('0x4'),_0x2a954f,utils['getMustacheRender'](_0x45acbe[0x0],this));_0x4883cc[_0x3fa3('0x5')]();}catch(_0x397f57){logger['error']('[%s][NOOP]\x20%s',_0x2a954f,JSON[_0x3fa3('0x6')](_0x397f57));_0x4883cc[_0x3fa3('0x7')]();}};};
\ No newline at end of file
+var _0xb598=['consequence','[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','routing'];(function(_0x3a9d05,_0x367e7c){var _0x3b9c5e=function(_0x48df9f){while(--_0x48df9f){_0x3a9d05['push'](_0x3a9d05['shift']());}};_0x3b9c5e(++_0x367e7c);}(_0xb598,0x11e));var _0x8b59=function(_0x5a0cec,_0x3f4d27){_0x5a0cec=_0x5a0cec-0x0;var _0x3b634a=_0xb598[_0x5a0cec];return _0x3b634a;};'use strict';var utils=require(_0x8b59('0x0'));var logger=require('../../../../config/logger')(_0x8b59('0x1'));exports[_0x8b59('0x2')]=function(_0x2e1175,_0x1efa29){return function(_0x8c5bb6){try{logger['info'](_0x8b59('0x3'),_0x2e1175,utils['getMustacheRender'](_0x1efa29[0x0],this));_0x8c5bb6[_0x8b59('0x4')]();}catch(_0x1cfcfd){logger[_0x8b59('0x5')](_0x8b59('0x3'),_0x2e1175,JSON[_0x8b59('0x6')](_0x1cfcfd));_0x8c5bb6[_0x8b59('0x7')]();}};};
\ No newline at end of file
index 5f7e248..92448f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf190=['string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','contact','list','upperFirst','interaction','channel','MessageId','message','chat','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','stop','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport'];(function(_0x3f7598,_0x212e37){var _0x51fb16=function(_0x4a5c0b){while(--_0x4a5c0b){_0x3f7598['push'](_0x3f7598['shift']());}};_0x51fb16(++_0x212e37);}(_0xf190,0xc7));var _0x0f19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf190[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0x0f19('0x0'));var _=require('lodash');var util=require(_0x0f19('0x1'));var seqqueue=require(_0x0f19('0x2'));var moment=require(_0x0f19('0x3'));var Redis=require(_0x0f19('0x4'));var config=require(_0x0f19('0x5'));var logger=require(_0x0f19('0x6'))(_0x0f19('0x7'));var strategy=require(_0x0f19('0x8'));config[_0x0f19('0x9')]=_[_0x0f19('0xa')](config['redis'],{'host':_0x0f19('0xb'),'port':0x18eb});var io=require(_0x0f19('0xc'))(new Redis(config[_0x0f19('0x9')]));var attributes=['id','queue_id',_0x0f19('0xd'),_0x0f19('0xe'),'from',_0x0f19('0xf')];function emit(_0x4e534a,_0xcf063e,_0x1c17cb){io['to'](_0x4e534a)[_0x0f19('0x10')](_0xcf063e,_0x1c17cb);}function emitChannelQueueInteraction(_0xdcea1d,_0x4c14c5,_0x24b6a8,_0x47b0f5,_0x11db82,_0x478aaa,_0x2a4161,_0x23c7ea){var _0x3a2c8c=_[_0x0f19('0x11')](_0x24b6a8);_0x3a2c8c['queue_id']=_0x23c7ea;_0x3a2c8c[_0x0f19('0xe')]=_0x4c14c5;_0x3a2c8c[_0x0f19('0xd')]=_0x47b0f5;_0x3a2c8c['id']=_0x11db82;if(_0x478aaa){_0x2a4161[util[_0x0f19('0x12')](_0x0f19('0x13'),_0xdcea1d)][_0x11db82]=_[_0x0f19('0x14')](_0x3a2c8c,attributes);}else{delete _0x2a4161[util[_0x0f19('0x12')](_0x0f19('0x13'),_0xdcea1d)][_0x11db82];}emit(util[_0x0f19('0x12')](_0x0f19('0x15'),_0xdcea1d,_0x4c14c5),util[_0x0f19('0x12')]('%s_queue_waiting_interaction:%s',_0xdcea1d,_0x478aaa?_0x0f19('0x16'):_0x0f19('0x17')),_[_0x0f19('0x14')](_0x3a2c8c,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x0f19('0x18')),'chatQueueReport':require(_0x0f19('0x19')),'smsQueueReport':require(_0x0f19('0x1a')),'faxQueueReport':require(_0x0f19('0x1b')),'whatsappQueueReport':require(_0x0f19('0x1c'))};var queue=schema({'name':{'type':_0x0f19('0x1d'),'required':!![],'message':_0x0f19('0x1e')},'timeout':{'type':_0x0f19('0x1f'),'message':_0x0f19('0x20')}});function startRouting(_0xb07c63,_0x3a853f,_0x1a9702,_0x3aef41){if(_0xb07c63&&_0x3a853f&&_0x1a9702){_0x3a853f[_0x0f19('0x21')]+=0x1;var _0x2f1e07={'uniqueid':_0xb07c63,'from':_0x1a9702[_0x0f19('0x22')]?_0x1a9702[_0x0f19('0x22')][_0x0f19('0x23')]:'','joinAt':moment()[_0x0f19('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x1a9702[_0x0f19('0x24')]?_0x1a9702[_0x0f19('0x24')]['id']:null,'ListId':_0x1a9702[_0x0f19('0x25')]?_0x1a9702['list']['id']:null};_0x2f1e07[_[_0x0f19('0x26')](_0x1a9702['channel'])+'QueueId']=_0x3a853f['id']||null;_0x2f1e07[_[_0x0f19('0x26')](_0x1a9702['channel'])+'InteractionId']=_0x1a9702[_0x0f19('0x27')]?_0x1a9702[_0x0f19('0x27')]['id']:null;_0x2f1e07[_['upperFirst'](_0x1a9702[_0x0f19('0x28')])+_0x0f19('0x29')]=_0x1a9702[_0x0f19('0x2a')]?_0x1a9702[_0x0f19('0x2a')]['id']:null;_0x2f1e07[_['upperFirst'](_0x1a9702[_0x0f19('0x28')])+(_0x1a9702[_0x0f19('0x28')]!==_0x0f19('0x2b')?'AccountId':'WebsiteId')]=_0x1a9702[_0x0f19('0xd')]?_0x1a9702[_0x0f19('0xd')]['id']:null;logger[_0x0f19('0x2c')](util[_0x0f19('0x12')](_0x0f19('0x2d'),_0xb07c63,_0x3a853f[_0x0f19('0x2e')]));emitChannelQueueInteraction(_0x1a9702[_0x0f19('0x28')],_0x3a853f[_0x0f19('0x2e')],_0x2f1e07,_0x1a9702[_0x0f19('0xd')][_0x0f19('0x2e')],_0x1a9702[_0x0f19('0x2a')]['id'],!![],_0x3aef41,_0x3a853f['id']);if(rpc[_0x1a9702[_0x0f19('0x28')]+_0x0f19('0x2f')]){return rpc[_0x1a9702[_0x0f19('0x28')]+_0x0f19('0x2f')]['create'](_0x2f1e07)[_0x0f19('0x30')](function(_0xa62d16){logger[_0x0f19('0x31')](_0x0f19('0x32'));});}}}function stopRouting(_0x1c8964,_0x2110f4,_0x351700,_0x164845){if(_0x1c8964&&_0x2110f4){_0x2110f4[_0x0f19('0x21')]-=0x1;var _0x16ef78={'leaveAt':moment()[_0x0f19('0x12')](_0x0f19('0x33')),'acceptAt':moment()[_0x0f19('0x12')](_0x0f19('0x33')),'reason':_0x0f19('0x34')};logger[_0x0f19('0x2c')](util[_0x0f19('0x12')](_0x0f19('0x35'),_0x1c8964,_0x2110f4[_0x0f19('0x2e')]));emitChannelQueueInteraction(_0x351700[_0x0f19('0x28')],_0x2110f4[_0x0f19('0x2e')],_0x351700[_0x0f19('0x22')],_0x351700[_0x0f19('0xd')][_0x0f19('0x2e')],_0x351700[_0x0f19('0x2a')]['id'],![],_0x164845,_0x2110f4['id']);if(rpc[_0x351700[_0x0f19('0x28')]+_0x0f19('0x2f')]){return rpc[_0x351700[_0x0f19('0x28')]+_0x0f19('0x2f')][_0x0f19('0x36')](_0x1c8964,_0x16ef78)[_0x0f19('0x30')](function(_0x1c1c21){logger[_0x0f19('0x31')](_0x0f19('0x37'));});}}}function endRouting(_0x22bbd5,_0x4ac4a8,_0x26a694,_0x3bdf75){if(_0x22bbd5&&_0x4ac4a8){_0x4ac4a8[_0x0f19('0x21')]-=0x1;var _0x472132={'leaveAt':moment()[_0x0f19('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x0f19('0x33')),'reason':_0x0f19('0x38')};logger[_0x0f19('0x2c')](util[_0x0f19('0x12')](_0x0f19('0x39'),_0x22bbd5,_0x4ac4a8[_0x0f19('0x2e')]));emitChannelQueueInteraction(_0x26a694[_0x0f19('0x28')],_0x4ac4a8[_0x0f19('0x2e')],_0x26a694[_0x0f19('0x22')],_0x26a694['account'][_0x0f19('0x2e')],_0x26a694['message']['id'],![],_0x3bdf75);if(rpc[_0x26a694[_0x0f19('0x28')]+_0x0f19('0x2f')]){return rpc[_0x26a694['channel']+_0x0f19('0x2f')][_0x0f19('0x36')](_0x22bbd5,_0x472132)[_0x0f19('0x30')](function(_0x37038b){logger[_0x0f19('0x31')](_0x0f19('0x37'));});}}}function handleFindQueue(_0x2befd3){return function(_0x56f8fe){return _0x56f8fe['name'][_0x0f19('0x3a')]()===_0x2befd3[_0x0f19('0x3a')]();};}exports[_0x0f19('0x3b')]=function(_0x1da6de,_0x4ff2df,_0x5d693e,_0xc4f30a){return function(_0x4e3379){try{var _0x1190d7={'name':_0x4ff2df[0x0],'timeout':_0x4ff2df[0x1]};var _0x2a4ae3=queue[_0x0f19('0x0')](_0x1190d7,{'typecast':!![]});if(_0x2a4ae3[_0x0f19('0x3c')]){logger[_0x0f19('0x31')](_0x0f19('0x3d'),_0x1da6de,_[_0x0f19('0x3e')](_0x2a4ae3,'message')['join'](',\x20'));_0x4e3379[_0x0f19('0x3f')]();}else{var _0x1218a4=_[_0x0f19('0x40')](_0x5d693e[_0xc4f30a['channel']+'Queues'],handleFindQueue(_0x1190d7[_0x0f19('0x2e')]));if(_0x1218a4){startRouting(_0x1da6de,_0x1218a4,_0xc4f30a,_0x5d693e);var _0x1cd9dd=(_0x1218a4['timeout']||0xa)*0x3e8;var _0x5b87a1=(_0x1190d7[_0x0f19('0x38')]||0x14)*0x3e8;var _0x472356,_0x427a52;if(_0x1cd9dd>_0x5b87a1){_0x5b87a1=_0x1cd9dd;}var _0x519f84=seqqueue[_0x0f19('0x41')](_0x1cd9dd);_0x519f84['id']=_0x1da6de;_0x519f84[_0x0f19('0x42')]=_0x1cd9dd;_0x519f84[_0x0f19('0x43')]=_0x5b87a1;_0x519f84[_0x0f19('0x28')]=_0xc4f30a[_0x0f19('0x28')];_0x5d693e[_0x0f19('0x44')][_0x1da6de]['on'](_0x0f19('0x45'),function(){logger[_0x0f19('0x2c')](_0x0f19('0x46'),_0x1da6de);stopRouting(_0x1da6de,_0x1218a4,_0xc4f30a,_0x5d693e);clearTimeout(_0x472356);_0x472356=undefined;_0x519f84[_0x0f19('0x47')](!![]);if(_0x5d693e[_0x0f19('0x44')][_0x1da6de]){delete _0x5d693e[_0x0f19('0x44')][_0x1da6de];}_0x4e3379[_0x0f19('0x3f')]();});_0x5d693e[_0x0f19('0x44')][_0x1da6de]['on'](_0x0f19('0x48'),function(){if(_0x5d693e[_0x0f19('0x44')][_0x1da6de]){delete _0x5d693e['rules'][_0x1da6de];}});_0x472356=setTimeout(function(){logger[_0x0f19('0x2c')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x1da6de);endRouting(_0x1da6de,_0x1218a4,_0xc4f30a,_0x5d693e);clearTimeout(_0x472356);_0x519f84['close'](!![]);_0x4e3379['next']();},_0x5b87a1);switch(_0x1218a4['strategy']){case _0x0f19('0x49'):strategy[_0x0f19('0x49')](_0x519f84,_0x1218a4,_0x5d693e,_0xc4f30a);break;default:strategy[_0x0f19('0x4a')](_0x519f84,_0x1218a4,_0x5d693e,_0xc4f30a);}}else{logger[_0x0f19('0x31')](_0x0f19('0x4b'),_0x1da6de,_0x1190d7['name']);_0x4e3379[_0x0f19('0x3f')]();}}}catch(_0x5743c0){console['log'](_0x5743c0);logger[_0x0f19('0x31')](_0x0f19('0x3d'),_0x1da6de,_0x5743c0['stack']);_0x4e3379[_0x0f19('0x3f')]();}};};
\ No newline at end of file
+var _0x989b=['catch','create\x20queue\x20report','accepted','info','update','error','update\x20queue\x20report','timeout','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','Queues','createQueue','atimeout','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','close','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','moment','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','joinAt','clone','format','%sQueuesWaitingInteractions','pick','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','interaction','message','chat','AccountId','WebsiteId','name','QueueReport','create'];(function(_0x4be903,_0x152dc8){var _0x3e79b5=function(_0x8242d0){while(--_0x8242d0){_0x4be903['push'](_0x4be903['shift']());}};_0x3e79b5(++_0x152dc8);}(_0x989b,0x198));var _0xb989=function(_0x3e8b12,_0x418dc8){_0x3e8b12=_0x3e8b12-0x0;var _0x2df443=_0x989b[_0x3e8b12];return _0x2df443;};'use strict';var schema=require(_0xb989('0x0'));var _=require(_0xb989('0x1'));var util=require(_0xb989('0x2'));var seqqueue=require('seq-queue');var moment=require(_0xb989('0x3'));var Redis=require(_0xb989('0x4'));var config=require('../../../../config/environment');var logger=require(_0xb989('0x5'))('routing');var strategy=require('./strategy');config[_0xb989('0x6')]=_[_0xb989('0x7')](config[_0xb989('0x6')],{'host':_0xb989('0x8'),'port':0x18eb});var io=require(_0xb989('0x9'))(new Redis(config[_0xb989('0x6')]));var attributes=['id',_0xb989('0xa'),_0xb989('0xb'),_0xb989('0xc'),'from',_0xb989('0xd')];function emit(_0x1f5b60,_0x2b8f00,_0x2b5beb){io['to'](_0x1f5b60)['emit'](_0x2b8f00,_0x2b5beb);}function emitChannelQueueInteraction(_0x20ca7b,_0x5e0046,_0x48d6d9,_0x833c87,_0x5626e3,_0x43caa1,_0x49136a,_0x83b92){var _0x1ada8c=_[_0xb989('0xe')](_0x48d6d9);_0x1ada8c[_0xb989('0xa')]=_0x83b92;_0x1ada8c[_0xb989('0xc')]=_0x5e0046;_0x1ada8c[_0xb989('0xb')]=_0x833c87;_0x1ada8c['id']=_0x5626e3;if(_0x43caa1){_0x49136a[util[_0xb989('0xf')](_0xb989('0x10'),_0x20ca7b)][_0x5626e3]=_[_0xb989('0x11')](_0x1ada8c,attributes);}else{delete _0x49136a[util[_0xb989('0xf')](_0xb989('0x10'),_0x20ca7b)][_0x5626e3];}emit(util[_0xb989('0xf')]('%s:queue:%s',_0x20ca7b,_0x5e0046),util[_0xb989('0xf')]('%s_queue_waiting_interaction:%s',_0x20ca7b,_0x43caa1?_0xb989('0x12'):_0xb989('0x13')),_[_0xb989('0x11')](_0x1ada8c,attributes));}var rpc={'openchannelQueueReport':require(_0xb989('0x14')),'mailQueueReport':require(_0xb989('0x15')),'chatQueueReport':require(_0xb989('0x16')),'smsQueueReport':require(_0xb989('0x17')),'faxQueueReport':require(_0xb989('0x18')),'whatsappQueueReport':require(_0xb989('0x19'))};var queue=schema({'name':{'type':_0xb989('0x1a'),'required':!![],'message':_0xb989('0x1b')},'timeout':{'type':_0xb989('0x1c'),'message':_0xb989('0x1d')}});function startRouting(_0x396293,_0x125b76,_0x940616,_0x4aa0c5){if(_0x396293&&_0x125b76&&_0x940616){_0x125b76[_0xb989('0x1e')]+=0x1;var _0x290594={'uniqueid':_0x396293,'from':_0x940616[_0xb989('0x1f')]?_0x940616[_0xb989('0x1f')][_0xb989('0x20')]:'','joinAt':moment()['format'](_0xb989('0x21')),'ContactId':_0x940616[_0xb989('0x22')]?_0x940616[_0xb989('0x22')]['id']:null,'ListId':_0x940616[_0xb989('0x23')]?_0x940616['list']['id']:null};_0x290594[_[_0xb989('0x24')](_0x940616[_0xb989('0x25')])+_0xb989('0x26')]=_0x125b76['id']||null;_0x290594[_[_0xb989('0x24')](_0x940616[_0xb989('0x25')])+_0xb989('0x27')]=_0x940616['interaction']?_0x940616[_0xb989('0x28')]['id']:null;_0x290594[_[_0xb989('0x24')](_0x940616['channel'])+'MessageId']=_0x940616[_0xb989('0x29')]?_0x940616[_0xb989('0x29')]['id']:null;_0x290594[_[_0xb989('0x24')](_0x940616[_0xb989('0x25')])+(_0x940616['channel']!==_0xb989('0x2a')?_0xb989('0x2b'):_0xb989('0x2c'))]=_0x940616['account']?_0x940616['account']['id']:null;logger['info'](util[_0xb989('0xf')]('[%s][START:QUEUE][NAME:%s]',_0x396293,_0x125b76['name']));emitChannelQueueInteraction(_0x940616[_0xb989('0x25')],_0x125b76[_0xb989('0x2d')],_0x290594,_0x940616[_0xb989('0xb')]['name'],_0x940616[_0xb989('0x29')]['id'],!![],_0x4aa0c5,_0x125b76['id']);if(rpc[_0x940616[_0xb989('0x25')]+'QueueReport']){return rpc[_0x940616[_0xb989('0x25')]+_0xb989('0x2e')][_0xb989('0x2f')](_0x290594)[_0xb989('0x30')](function(_0x410cb0){logger['error'](_0xb989('0x31'));});}}}function stopRouting(_0xbce251,_0x3c034c,_0x1fa1d8,_0x75f47){if(_0xbce251&&_0x3c034c){_0x3c034c[_0xb989('0x1e')]-=0x1;var _0x5c61aa={'leaveAt':moment()[_0xb989('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xb989('0xf')](_0xb989('0x21')),'reason':_0xb989('0x32')};logger[_0xb989('0x33')](util[_0xb989('0xf')]('[%s][STOP:QUEUE][NAME:%s]',_0xbce251,_0x3c034c[_0xb989('0x2d')]));emitChannelQueueInteraction(_0x1fa1d8['channel'],_0x3c034c[_0xb989('0x2d')],_0x1fa1d8[_0xb989('0x1f')],_0x1fa1d8['account'][_0xb989('0x2d')],_0x1fa1d8[_0xb989('0x29')]['id'],![],_0x75f47,_0x3c034c['id']);if(rpc[_0x1fa1d8['channel']+_0xb989('0x2e')]){return rpc[_0x1fa1d8['channel']+'QueueReport'][_0xb989('0x34')](_0xbce251,_0x5c61aa)[_0xb989('0x30')](function(_0x126edd){logger[_0xb989('0x35')](_0xb989('0x36'));});}}}function endRouting(_0x3a2188,_0xb7a33f,_0x54237d,_0x17d1be){if(_0x3a2188&&_0xb7a33f){_0xb7a33f[_0xb989('0x1e')]-=0x1;var _0x3d0e25={'leaveAt':moment()[_0xb989('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xb989('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xb989('0x37')};logger[_0xb989('0x33')](util[_0xb989('0xf')]('[%s][END:QUEUE][NAME:%s]',_0x3a2188,_0xb7a33f[_0xb989('0x2d')]));emitChannelQueueInteraction(_0x54237d['channel'],_0xb7a33f['name'],_0x54237d[_0xb989('0x1f')],_0x54237d[_0xb989('0xb')][_0xb989('0x2d')],_0x54237d[_0xb989('0x29')]['id'],![],_0x17d1be);if(rpc[_0x54237d['channel']+_0xb989('0x2e')]){return rpc[_0x54237d[_0xb989('0x25')]+_0xb989('0x2e')][_0xb989('0x34')](_0x3a2188,_0x3d0e25)[_0xb989('0x30')](function(_0x268d58){logger[_0xb989('0x35')](_0xb989('0x36'));});}}}function handleFindQueue(_0x1bf548){return function(_0x5f447b){return _0x5f447b[_0xb989('0x2d')][_0xb989('0x38')]()===_0x1bf548['toLowerCase']();};}exports['consequence']=function(_0x26eecb,_0x50d55b,_0x45c480,_0x1950a5){return function(_0x430a88){try{var _0x29c33f={'name':_0x50d55b[0x0],'timeout':_0x50d55b[0x1]};var _0x5e3fab=queue[_0xb989('0x0')](_0x29c33f,{'typecast':!![]});if(_0x5e3fab[_0xb989('0x39')]){logger[_0xb989('0x35')](_0xb989('0x3a'),_0x26eecb,_['map'](_0x5e3fab,_0xb989('0x29'))[_0xb989('0x3b')](',\x20'));_0x430a88[_0xb989('0x3c')]();}else{var _0x3422b4=_['find'](_0x45c480[_0x1950a5['channel']+_0xb989('0x3d')],handleFindQueue(_0x29c33f['name']));if(_0x3422b4){startRouting(_0x26eecb,_0x3422b4,_0x1950a5,_0x45c480);var _0x5c1097=(_0x3422b4[_0xb989('0x37')]||0xa)*0x3e8;var _0x57c071=(_0x29c33f[_0xb989('0x37')]||0x14)*0x3e8;var _0x478baa,_0x3cb025;if(_0x5c1097>_0x57c071){_0x57c071=_0x5c1097;}var _0x2f718e=seqqueue[_0xb989('0x3e')](_0x5c1097);_0x2f718e['id']=_0x26eecb;_0x2f718e[_0xb989('0x3f')]=_0x5c1097;_0x2f718e['qtimeout']=_0x57c071;_0x2f718e[_0xb989('0x25')]=_0x1950a5[_0xb989('0x25')];_0x45c480['rules'][_0x26eecb]['on'](_0xb989('0x40'),function(){logger['info'](_0xb989('0x41'),_0x26eecb);stopRouting(_0x26eecb,_0x3422b4,_0x1950a5,_0x45c480);clearTimeout(_0x478baa);_0x478baa=undefined;_0x2f718e['close'](!![]);if(_0x45c480[_0xb989('0x42')][_0x26eecb]){delete _0x45c480[_0xb989('0x42')][_0x26eecb];}_0x430a88[_0xb989('0x3c')]();});_0x45c480[_0xb989('0x42')][_0x26eecb]['on'](_0xb989('0x43'),function(){if(_0x45c480[_0xb989('0x42')][_0x26eecb]){delete _0x45c480[_0xb989('0x42')][_0x26eecb];}});_0x478baa=setTimeout(function(){logger[_0xb989('0x33')](_0xb989('0x44'),_0x26eecb);endRouting(_0x26eecb,_0x3422b4,_0x1950a5,_0x45c480);clearTimeout(_0x478baa);_0x2f718e[_0xb989('0x45')](!![]);_0x430a88[_0xb989('0x46')]();},_0x57c071);switch(_0x3422b4[_0xb989('0x47')]){case _0xb989('0x48'):strategy[_0xb989('0x48')](_0x2f718e,_0x3422b4,_0x45c480,_0x1950a5);break;default:strategy['beepall'](_0x2f718e,_0x3422b4,_0x45c480,_0x1950a5);}}else{logger[_0xb989('0x35')](_0xb989('0x49'),_0x26eecb,_0x29c33f[_0xb989('0x2d')]);_0x430a88[_0xb989('0x3c')]();}}}catch(_0x5cce57){console[_0xb989('0x4a')](_0x5cce57);logger[_0xb989('0x35')]('[%s][QUEUE]\x20%s',_0x26eecb,_0x5cce57[_0xb989('0x4b')]);_0x430a88['stop']();}};};
\ No newline at end of file
index 615c839..fa84c10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7051=['isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','exports','lodash','uuid','./util','notificationId','squeue','agent','realtime','routing','push','handleTimeout','bind','drained','handleDrained','prototype','handleRun','info'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7051,0x190));var _0x1705=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x7051[_0x5b7788];return _0x573871;};'use strict';var _=require(_0x1705('0x0'));var uuid=require(_0x1705('0x1'));var util=require(_0x1705('0x2'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x43b8b5,_0x5afa0d,_0x5dee7b,_0x11bfef){this[_0x1705('0x3')]=uuid['v4']();this[_0x1705('0x4')]=_0x43b8b5;this[_0x1705('0x5')]=_0x5afa0d;this[_0x1705('0x6')]=_0x5dee7b;this[_0x1705('0x7')]=_0x11bfef;this['squeue'][_0x1705('0x8')](this['handleRun']['bind'](this),this[_0x1705('0x9')][_0x1705('0xa')](this));this[_0x1705('0x4')]['on']('timeout',this['handleTimeout'][_0x1705('0xa')](this));this[_0x1705('0x4')]['on'](_0x1705('0xb'),this[_0x1705('0xc')][_0x1705('0xa')](this));};Agent[_0x1705('0xd')]['push']=function(){this[_0x1705('0x4')][_0x1705('0x8')](this[_0x1705('0xe')][_0x1705('0xa')](this),this['handleTimeout'][_0x1705('0xa')](this));};Agent['prototype'][_0x1705('0xc')]=function(){this[_0x1705('0x9')](!![]);};Agent[_0x1705('0xd')][_0x1705('0xe')]=function(_0x549b3c){logger[_0x1705('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x1705('0x4')]['id'],this['agent']['id']);if(_[_0x1705('0x10')](this['realtime'][_0x1705('0x11')][this[_0x1705('0x5')]['id']])){logger[_0x1705('0xf')](_0x1705('0x12'),this[_0x1705('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x1705('0x8')]['bind'](this),0x3e8);}else{if(this[_0x1705('0x7')]['forcedOwnership']||util[_0x1705('0x13')](this[_0x1705('0x4')]['id'],this[_0x1705('0x6')][_0x1705('0x11')][this['agent']['id']],this[_0x1705('0x4')][_0x1705('0x14')],![])){this[_0x1705('0x6')]['agents'][this[_0x1705('0x5')]['id']][_0x1705('0x15')]=!![];this['realtime']['agents'][this[_0x1705('0x5')]['id']][_0x1705('0x16')]=undefined;util[_0x1705('0x17')](this[_0x1705('0x3')],this[_0x1705('0x4')]['id'],this[_0x1705('0x6')][_0x1705('0x11')][this['agent']['id']],null,this[_0x1705('0x7')]);util[_0x1705('0x18')](this['squeue']['id'],this[_0x1705('0x6')][_0x1705('0x11')][this[_0x1705('0x5')]['id']],_0x1705('0x19')+(this['routing'][_0x1705('0x1a')]?_0x1705('0x1b'):''));}else{logger[_0x1705('0xf')](_0x1705('0x1c'),this[_0x1705('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x1705('0x8')][_0x1705('0xa')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x11dc0e){if(_[_0x1705('0x10')](this[_0x1705('0x6')][_0x1705('0x11')][this[_0x1705('0x5')]['id']])){return logger[_0x1705('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x1705('0x4')]['id'],this[_0x1705('0x5')]['id']);}else{logger[_0x1705('0xf')](_0x1705('0x1d'),this['squeue']['id'],this['agent']['id']);util[_0x1705('0x1e')](this[_0x1705('0x3')],this['squeue']['id'],this[_0x1705('0x6')][_0x1705('0x11')][this[_0x1705('0x5')]['id']],null,this[_0x1705('0x7')]);this[_0x1705('0x6')][_0x1705('0x11')][this[_0x1705('0x5')]['id']][_0x1705('0x15')]=![];this['realtime']['agents'][this[_0x1705('0x5')]['id']][_0x1705('0x16')]=undefined;util[_0x1705('0x18')](this['squeue']['id'],this[_0x1705('0x6')][_0x1705('0x11')][this[_0x1705('0x5')]['id']],_0x11dc0e?'STOP':'TIMEOUT');}if(!_0x11dc0e){setTimeout(this['push'][_0x1705('0xa')](this),0x3e8);}};function agent(_0x2fe42d,_0x13072b,_0x4939eb,_0x56123b){return new Agent(_0x2fe42d,_0x13072b,_0x4939eb,_0x56123b);}module[_0x1705('0x1f')]=agent;
\ No newline at end of file
+var _0x75a7=['info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','busy','STOP','TIMEOUT','exports','lodash','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push'];(function(_0x14885f,_0x43cc2b){var _0x3ded9e=function(_0x422cbb){while(--_0x422cbb){_0x14885f['push'](_0x14885f['shift']());}};_0x3ded9e(++_0x43cc2b);}(_0x75a7,0x91));var _0x775a=function(_0x619a57,_0x4c76b1){_0x619a57=_0x619a57-0x0;var _0x49cdb0=_0x75a7[_0x619a57];return _0x49cdb0;};'use strict';var _=require(_0x775a('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x775a('0x1'))('routing');var Agent=function(_0x1ef2e0,_0x487664,_0x46822e,_0x57e712){this[_0x775a('0x2')]=uuid['v4']();this[_0x775a('0x3')]=_0x1ef2e0;this[_0x775a('0x4')]=_0x487664;this[_0x775a('0x5')]=_0x46822e;this[_0x775a('0x6')]=_0x57e712;this[_0x775a('0x3')]['push'](this[_0x775a('0x7')][_0x775a('0x8')](this),this[_0x775a('0x9')]['bind'](this));this[_0x775a('0x3')]['on'](_0x775a('0xa'),this[_0x775a('0x9')][_0x775a('0x8')](this));this[_0x775a('0x3')]['on'](_0x775a('0xb'),this[_0x775a('0xc')][_0x775a('0x8')](this));};Agent[_0x775a('0xd')][_0x775a('0xe')]=function(){this['squeue'][_0x775a('0xe')](this[_0x775a('0x7')][_0x775a('0x8')](this),this[_0x775a('0x9')][_0x775a('0x8')](this));};Agent[_0x775a('0xd')]['handleDrained']=function(){this[_0x775a('0x9')](!![]);};Agent[_0x775a('0xd')]['handleRun']=function(_0x4e0bcf){logger[_0x775a('0xf')](_0x775a('0x10'),this[_0x775a('0x3')]['id'],this['agent']['id']);if(_[_0x775a('0x11')](this[_0x775a('0x5')][_0x775a('0x12')][this[_0x775a('0x4')]['id']])){logger[_0x775a('0xf')](_0x775a('0x13'),this[_0x775a('0x3')]['id'],this[_0x775a('0x4')]['id']);setTimeout(this[_0x775a('0xe')]['bind'](this),0x3e8);}else{if(this[_0x775a('0x6')][_0x775a('0x14')]||util[_0x775a('0x15')](this[_0x775a('0x3')]['id'],this[_0x775a('0x5')][_0x775a('0x12')][this['agent']['id']],this[_0x775a('0x3')][_0x775a('0x16')],![])){this[_0x775a('0x5')][_0x775a('0x12')][this[_0x775a('0x4')]['id']]['busy']=!![];this[_0x775a('0x5')][_0x775a('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0x775a('0x17')](this[_0x775a('0x2')],this[_0x775a('0x3')]['id'],this[_0x775a('0x5')]['agents'][this[_0x775a('0x4')]['id']],null,this[_0x775a('0x6')]);util[_0x775a('0x18')](this[_0x775a('0x3')]['id'],this['realtime'][_0x775a('0x12')][this[_0x775a('0x4')]['id']],_0x775a('0x19')+(this[_0x775a('0x6')]['forcedOwnership']?_0x775a('0x1a'):''));}else{logger[_0x775a('0xf')](_0x775a('0x1b'),this[_0x775a('0x3')]['id'],this[_0x775a('0x4')]['id']);setTimeout(this[_0x775a('0xe')][_0x775a('0x8')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x4a5b50){if(_[_0x775a('0x11')](this[_0x775a('0x5')][_0x775a('0x12')][this[_0x775a('0x4')]['id']])){return logger[_0x775a('0xf')](_0x775a('0x13'),this['squeue']['id'],this[_0x775a('0x4')]['id']);}else{logger[_0x775a('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this['agent']['id']);util['hideNotification'](this['notificationId'],this[_0x775a('0x3')]['id'],this[_0x775a('0x5')][_0x775a('0x12')][this['agent']['id']],null,this['routing']);this['realtime'][_0x775a('0x12')][this[_0x775a('0x4')]['id']][_0x775a('0x1c')]=![];this[_0x775a('0x5')][_0x775a('0x12')][this[_0x775a('0x4')]['id']]['busyQueue']=undefined;util['writeLog'](this[_0x775a('0x3')]['id'],this[_0x775a('0x5')][_0x775a('0x12')][this[_0x775a('0x4')]['id']],_0x4a5b50?_0x775a('0x1d'):_0x775a('0x1e'));}if(!_0x4a5b50){setTimeout(this['push'][_0x775a('0x8')](this),0x3e8);}};function agent(_0x41618b,_0x4d07ab,_0x548f74,_0x11639c){return new Agent(_0x41618b,_0x4d07ab,_0x548f74,_0x11639c);}module[_0x775a('0x1f')]=agent;
\ No newline at end of file
index c5d0618..f763699 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c42=['handleRun','isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','channel','writeLog','RINGING','busy','busyQueue','name','showNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','push','bind','handleTimeout','timeout','drained','handleDrained','prototype'];(function(_0x495a2d,_0x1c9509){var _0x82500e=function(_0x208563){while(--_0x208563){_0x495a2d['push'](_0x495a2d['shift']());}};_0x82500e(++_0x1c9509);}(_0x0c42,0x191));var _0x20c4=function(_0x2f774f,_0x44473b){_0x2f774f=_0x2f774f-0x0;var _0x11c7dd=_0x0c42[_0x2f774f];return _0x11c7dd;};'use strict';var _=require(_0x20c4('0x0'));var uuid=require(_0x20c4('0x1'));var util=require(_0x20c4('0x2'));var logger=require(_0x20c4('0x3'))(_0x20c4('0x4'));var Beepall=function(_0x5810aa,_0x5d686d,_0x3a3e5b,_0x1296a8){this[_0x20c4('0x5')]=uuid['v4']();this[_0x20c4('0x6')]=_0x5810aa;this[_0x20c4('0x7')]=_0x5d686d;this['realtime']=_0x3a3e5b;this[_0x20c4('0x4')]=_0x1296a8;this['squeue'][_0x20c4('0x8')](this['handleRun'][_0x20c4('0x9')](this),this[_0x20c4('0xa')][_0x20c4('0x9')](this));this['squeue']['on'](_0x20c4('0xb'),this[_0x20c4('0xa')][_0x20c4('0x9')](this));this[_0x20c4('0x6')]['on'](_0x20c4('0xc'),this[_0x20c4('0xd')][_0x20c4('0x9')](this));};Beepall[_0x20c4('0xe')][_0x20c4('0x8')]=function(){this[_0x20c4('0x6')][_0x20c4('0x8')](this[_0x20c4('0xf')][_0x20c4('0x9')](this),this['handleTimeout'][_0x20c4('0x9')](this));};Beepall['prototype'][_0x20c4('0xd')]=function(_0x19af89){this['handleTimeout'](!![]);};Beepall[_0x20c4('0xe')]['handleRun']=function(_0x13213d){var _0x3b1399=!![];if(!_[_0x20c4('0x10')](this['queue'])&&!_[_0x20c4('0x10')](this[_0x20c4('0x7')][_0x20c4('0x11')])&&this[_0x20c4('0x7')][_0x20c4('0x11')][_0x20c4('0x12')]>0x0){for(var _0x2f79a0=0x0,_0x3fd9b7;_0x2f79a0<this[_0x20c4('0x7')][_0x20c4('0x11')][_0x20c4('0x12')];_0x2f79a0+=0x1){_0x3fd9b7=this['queue']['Agents'][_0x2f79a0]['id'];if(_[_0x20c4('0x10')](this['realtime'][_0x20c4('0x13')][_0x3fd9b7])){logger[_0x20c4('0x14')](_0x20c4('0x15'),this[_0x20c4('0x6')]['id'],_0x3fd9b7);}else{if(util[_0x20c4('0x16')](this[_0x20c4('0x6')]['id'],this[_0x20c4('0x17')][_0x20c4('0x13')][_0x3fd9b7],this[_0x20c4('0x6')][_0x20c4('0x18')],!![])){_0x3b1399=![];util[_0x20c4('0x19')](this[_0x20c4('0x6')]['id'],this[_0x20c4('0x17')][_0x20c4('0x13')][_0x3fd9b7],_0x20c4('0x1a'));this[_0x20c4('0x17')][_0x20c4('0x13')][_0x3fd9b7][_0x20c4('0x1b')]=!![];this[_0x20c4('0x17')][_0x20c4('0x13')][_0x3fd9b7][_0x20c4('0x1c')]=this[_0x20c4('0x7')][_0x20c4('0x1d')];util[_0x20c4('0x1e')](this['notificationId'],this['squeue']['id'],this[_0x20c4('0x17')][_0x20c4('0x13')][_0x3fd9b7],this['queue'],this[_0x20c4('0x4')]);}}}if(_0x3b1399){logger[_0x20c4('0x14')]('[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY',this[_0x20c4('0x6')]['id']);setTimeout(this[_0x20c4('0x8')]['bind'](this),0x3e8);}}else{logger[_0x20c4('0x14')]('[%s][QUEUE]\x20EMPTY',this[_0x20c4('0x6')]['id']);setTimeout(this['push'][_0x20c4('0x9')](this),0x3e8);}};Beepall[_0x20c4('0xe')][_0x20c4('0xa')]=function(_0x1cbf3a){if(!_[_0x20c4('0x10')](this[_0x20c4('0x7')])&&!_['isNil'](this['queue'][_0x20c4('0x11')])){for(var _0x1673ff=0x0,_0x2b6f72;_0x1673ff<this[_0x20c4('0x7')][_0x20c4('0x11')]['length'];_0x1673ff+=0x1){_0x2b6f72=this[_0x20c4('0x7')]['Agents'][_0x1673ff]['id'];if(_[_0x20c4('0x10')](this['realtime']['agents'][_0x2b6f72])){logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x20c4('0x6')]['id'],_0x2b6f72);}else{util['hideNotification'](this[_0x20c4('0x5')],this[_0x20c4('0x6')]['id'],this[_0x20c4('0x17')]['agents'][_0x2b6f72],this[_0x20c4('0x7')],this[_0x20c4('0x4')]);util[_0x20c4('0x19')](this[_0x20c4('0x6')]['id'],this[_0x20c4('0x17')]['agents'][_0x2b6f72],_0x1cbf3a?'STOP':'TIMEOUT');this['realtime'][_0x20c4('0x13')][_0x2b6f72][_0x20c4('0x1b')]=![];this[_0x20c4('0x17')][_0x20c4('0x13')][_0x2b6f72][_0x20c4('0x1c')]=undefined;}}}if(!_0x1cbf3a){setTimeout(this['push'][_0x20c4('0x9')](this),0x3e8);}};function beepall(_0x552bea,_0x57af6c,_0x49cdb8,_0x25aca3){return new Beepall(_0x552bea,_0x57af6c,_0x49cdb8,_0x25aca3);}module[_0x20c4('0x1f')]=beepall;
\ No newline at end of file
+var _0x8d0a=['[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','busy','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleDrained','prototype','handleTimeout','isNil','queue','Agents','length','agents','info','isAgentAvailable','channel','writeLog','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY'];(function(_0x3658ca,_0x6061d){var _0x4c2eea=function(_0x47906f){while(--_0x47906f){_0x3658ca['push'](_0x3658ca['shift']());}};_0x4c2eea(++_0x6061d);}(_0x8d0a,0x65));var _0xa8d0=function(_0x44061d,_0x41eda2){_0x44061d=_0x44061d-0x0;var _0x274fb3=_0x8d0a[_0x44061d];return _0x274fb3;};'use strict';var _=require(_0xa8d0('0x0'));var uuid=require('uuid');var util=require(_0xa8d0('0x1'));var logger=require(_0xa8d0('0x2'))(_0xa8d0('0x3'));var Beepall=function(_0x10995c,_0x6ec9e7,_0x477190,_0x528287){this[_0xa8d0('0x4')]=uuid['v4']();this[_0xa8d0('0x5')]=_0x10995c;this['queue']=_0x6ec9e7;this[_0xa8d0('0x6')]=_0x477190;this[_0xa8d0('0x3')]=_0x528287;this[_0xa8d0('0x5')][_0xa8d0('0x7')](this[_0xa8d0('0x8')]['bind'](this),this['handleTimeout'][_0xa8d0('0x9')](this));this[_0xa8d0('0x5')]['on']('timeout',this['handleTimeout']['bind'](this));this[_0xa8d0('0x5')]['on']('drained',this[_0xa8d0('0xa')][_0xa8d0('0x9')](this));};Beepall[_0xa8d0('0xb')][_0xa8d0('0x7')]=function(){this[_0xa8d0('0x5')][_0xa8d0('0x7')](this[_0xa8d0('0x8')][_0xa8d0('0x9')](this),this[_0xa8d0('0xc')][_0xa8d0('0x9')](this));};Beepall[_0xa8d0('0xb')]['handleDrained']=function(_0x757540){this['handleTimeout'](!![]);};Beepall['prototype'][_0xa8d0('0x8')]=function(_0x2816d1){var _0x523ec0=!![];if(!_[_0xa8d0('0xd')](this[_0xa8d0('0xe')])&&!_[_0xa8d0('0xd')](this[_0xa8d0('0xe')][_0xa8d0('0xf')])&&this[_0xa8d0('0xe')]['Agents'][_0xa8d0('0x10')]>0x0){for(var _0x470b4a=0x0,_0x5cf619;_0x470b4a<this[_0xa8d0('0xe')][_0xa8d0('0xf')]['length'];_0x470b4a+=0x1){_0x5cf619=this[_0xa8d0('0xe')][_0xa8d0('0xf')][_0x470b4a]['id'];if(_['isNil'](this['realtime'][_0xa8d0('0x11')][_0x5cf619])){logger[_0xa8d0('0x12')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xa8d0('0x5')]['id'],_0x5cf619);}else{if(util[_0xa8d0('0x13')](this[_0xa8d0('0x5')]['id'],this['realtime'][_0xa8d0('0x11')][_0x5cf619],this['squeue'][_0xa8d0('0x14')],!![])){_0x523ec0=![];util[_0xa8d0('0x15')](this[_0xa8d0('0x5')]['id'],this[_0xa8d0('0x6')][_0xa8d0('0x11')][_0x5cf619],_0xa8d0('0x16'));this[_0xa8d0('0x6')]['agents'][_0x5cf619]['busy']=!![];this[_0xa8d0('0x6')]['agents'][_0x5cf619][_0xa8d0('0x17')]=this[_0xa8d0('0xe')][_0xa8d0('0x18')];util[_0xa8d0('0x19')](this[_0xa8d0('0x4')],this['squeue']['id'],this[_0xa8d0('0x6')][_0xa8d0('0x11')][_0x5cf619],this[_0xa8d0('0xe')],this[_0xa8d0('0x3')]);}}}if(_0x523ec0){logger[_0xa8d0('0x12')](_0xa8d0('0x1a'),this[_0xa8d0('0x5')]['id']);setTimeout(this[_0xa8d0('0x7')]['bind'](this),0x3e8);}}else{logger[_0xa8d0('0x12')](_0xa8d0('0x1b'),this[_0xa8d0('0x5')]['id']);setTimeout(this[_0xa8d0('0x7')][_0xa8d0('0x9')](this),0x3e8);}};Beepall[_0xa8d0('0xb')]['handleTimeout']=function(_0x3b0609){if(!_[_0xa8d0('0xd')](this[_0xa8d0('0xe')])&&!_[_0xa8d0('0xd')](this['queue'][_0xa8d0('0xf')])){for(var _0x385e05=0x0,_0x579d73;_0x385e05<this['queue'][_0xa8d0('0xf')][_0xa8d0('0x10')];_0x385e05+=0x1){_0x579d73=this[_0xa8d0('0xe')][_0xa8d0('0xf')][_0x385e05]['id'];if(_[_0xa8d0('0xd')](this[_0xa8d0('0x6')][_0xa8d0('0x11')][_0x579d73])){logger[_0xa8d0('0x12')](_0xa8d0('0x1c'),this[_0xa8d0('0x5')]['id'],_0x579d73);}else{util[_0xa8d0('0x1d')](this[_0xa8d0('0x4')],this['squeue']['id'],this['realtime'][_0xa8d0('0x11')][_0x579d73],this['queue'],this[_0xa8d0('0x3')]);util[_0xa8d0('0x15')](this[_0xa8d0('0x5')]['id'],this[_0xa8d0('0x6')][_0xa8d0('0x11')][_0x579d73],_0x3b0609?'STOP':'TIMEOUT');this[_0xa8d0('0x6')][_0xa8d0('0x11')][_0x579d73][_0xa8d0('0x1e')]=![];this[_0xa8d0('0x6')][_0xa8d0('0x11')][_0x579d73][_0xa8d0('0x17')]=undefined;}}}if(!_0x3b0609){setTimeout(this['push'][_0xa8d0('0x9')](this),0x3e8);}};function beepall(_0x2a046d,_0x41fc4e,_0x4d175c,_0x13b8f7){return new Beepall(_0x2a046d,_0x41fc4e,_0x4d175c,_0x13b8f7);}module[_0xa8d0('0x1f')]=beepall;
\ No newline at end of file
index 933c0ce..9527c85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb855=['./agent','./rrmemory','./beepall'];(function(_0x57f12a,_0x5b40e3){var _0x1fe002=function(_0x1699af){while(--_0x1699af){_0x57f12a['push'](_0x57f12a['shift']());}};_0x1fe002(++_0x5b40e3);}(_0xb855,0xbb));var _0x5b85=function(_0x5e4759,_0x1f8793){_0x5e4759=_0x5e4759-0x0;var _0x1aefe3=_0xb855[_0x5e4759];return _0x1aefe3;};'use strict';module['exports']={'rrmemory':require(_0x5b85('0x0')),'beepall':require(_0x5b85('0x1')),'agent':require(_0x5b85('0x2'))};
\ No newline at end of file
+var _0xaa27=['./beepall','./agent'];(function(_0x48a4bc,_0x19e9aa){var _0x1a27bd=function(_0xb92e6f){while(--_0xb92e6f){_0x48a4bc['push'](_0x48a4bc['shift']());}};_0x1a27bd(++_0x19e9aa);}(_0xaa27,0xa0));var _0x7aa2=function(_0xcf7ef5,_0x3d6c4f){_0xcf7ef5=_0xcf7ef5-0x0;var _0x120c21=_0xaa27[_0xcf7ef5];return _0x120c21;};'use strict';module['exports']={'rrmemory':require('./rrmemory'),'beepall':require(_0x7aa2('0x0')),'agent':require(_0x7aa2('0x1'))};
\ No newline at end of file
index 236c223..154e0f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b00=['handleRun','handleTimeout','bind','timeout','drained','prototype','handleDrained','isAgentAvailable','agents','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','agentId','done','mapAgentsId','isNil','notificationId','handleCheckReject','[%s][QUEUE]\x20timeout\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','writeLog','TIMEOUT','busyQueue','exports','lodash','../../../../../config/logger','routing','queue','realtime','intervals','squeue','push'];(function(_0x2abf79,_0x24e8f5){var _0x566a1d=function(_0x3cab71){while(--_0x3cab71){_0x2abf79['push'](_0x2abf79['shift']());}};_0x566a1d(++_0x24e8f5);}(_0x3b00,0x9d));var _0x03b0=function(_0x4aded8,_0x347394){_0x4aded8=_0x4aded8-0x0;var _0x39b271=_0x3b00[_0x4aded8];return _0x39b271;};'use strict';var rr=require('rr');var _=require(_0x03b0('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x03b0('0x1'))(_0x03b0('0x2'));var RRMemory=function(_0xef3220,_0x245e84,_0x5b914e,_0x5c6f30){this['notificationId']=uuid['v4']();this['squeue']=_0xef3220;this[_0x03b0('0x3')]=_0x245e84;this[_0x03b0('0x4')]=_0x5b914e;this[_0x03b0('0x2')]=_0x5c6f30;this[_0x03b0('0x5')]={};this[_0x03b0('0x6')][_0x03b0('0x7')](this[_0x03b0('0x8')]['bind'](this),this[_0x03b0('0x9')][_0x03b0('0xa')](this),this['module']);this['squeue']['on'](_0x03b0('0xb'),this[_0x03b0('0x9')][_0x03b0('0xa')](this));this[_0x03b0('0x6')]['on'](_0x03b0('0xc'),this['handleDrained'][_0x03b0('0xa')](this));};RRMemory[_0x03b0('0xd')][_0x03b0('0x7')]=function(){this[_0x03b0('0x6')][_0x03b0('0x7')](this['handleRun']['bind'](this),this['handleTimeout'][_0x03b0('0xa')](this));};RRMemory[_0x03b0('0xd')][_0x03b0('0xe')]=function(_0x3f0318){this[_0x03b0('0x9')](!![]);};RRMemory[_0x03b0('0xd')]['handleCheckReject']=function(_0x41cbaa){if(util[_0x03b0('0xf')](this[_0x03b0('0x6')]['id'],this['realtime'][_0x03b0('0x10')][this['agentId']],this[_0x03b0('0x6')][_0x03b0('0x11')],!![])){logger[_0x03b0('0x12')](_0x03b0('0x13'),this[_0x03b0('0x6')]['id'],this[_0x03b0('0x14')]);clearInterval(this[_0x03b0('0x5')][this[_0x03b0('0x14')]]);_0x41cbaa[_0x03b0('0x15')]();setTimeout(this[_0x03b0('0x7')][_0x03b0('0xa')](this),0x3e8);}};RRMemory['prototype'][_0x03b0('0x8')]=function(_0x3e34e2){this['agentId']=rr(this[_0x03b0('0x3')][_0x03b0('0x16')]);logger[_0x03b0('0x12')]('[%s][QUEUE]\x20try\x20with\x20%s',this[_0x03b0('0x6')]['id'],this[_0x03b0('0x14')]);if(_[_0x03b0('0x17')](this[_0x03b0('0x4')][_0x03b0('0x10')][this[_0x03b0('0x14')]])){logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x03b0('0x6')]['id'],this[_0x03b0('0x14')]);_0x3e34e2[_0x03b0('0x15')]();setTimeout(this[_0x03b0('0x7')][_0x03b0('0xa')](this),0x3e8);}else{if(util[_0x03b0('0xf')](this['squeue']['id'],this[_0x03b0('0x4')][_0x03b0('0x10')][this['agentId']],this[_0x03b0('0x6')][_0x03b0('0x11')],!![])){this[_0x03b0('0x4')][_0x03b0('0x10')][this[_0x03b0('0x14')]]['busy']=!![];this['realtime'][_0x03b0('0x10')][this[_0x03b0('0x14')]]['busyQueue']=this[_0x03b0('0x3')]['name'];util['showNotification'](this[_0x03b0('0x18')],this[_0x03b0('0x6')]['id'],this[_0x03b0('0x4')][_0x03b0('0x10')][this[_0x03b0('0x14')]],this[_0x03b0('0x3')],this['routing']);util['writeLog'](this[_0x03b0('0x6')]['id'],this[_0x03b0('0x4')][_0x03b0('0x10')][this['agentId']],'RINGING');this['intervals'][this[_0x03b0('0x14')]]=setInterval(this[_0x03b0('0x19')][_0x03b0('0xa')](this,_0x3e34e2),0x3e8);}else{logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this[_0x03b0('0x6')]['id'],this[_0x03b0('0x14')]);_0x3e34e2['done']();setTimeout(this[_0x03b0('0x7')][_0x03b0('0xa')](this),0x3e8);}}};RRMemory[_0x03b0('0xd')][_0x03b0('0x9')]=function(_0x98cc88){logger[_0x03b0('0x12')](_0x03b0('0x1a'),this[_0x03b0('0x6')]['id'],this[_0x03b0('0x14')]);if(_[_0x03b0('0x17')](this[_0x03b0('0x4')][_0x03b0('0x10')][this[_0x03b0('0x14')]])){logger[_0x03b0('0x12')](_0x03b0('0x1b'),this['squeue']['id'],this[_0x03b0('0x14')]);}else{clearInterval(this['intervals'][this[_0x03b0('0x14')]]);util[_0x03b0('0x1c')](this[_0x03b0('0x18')],this['squeue']['id'],this[_0x03b0('0x4')][_0x03b0('0x10')][this[_0x03b0('0x14')]],this[_0x03b0('0x3')],this[_0x03b0('0x2')]);util[_0x03b0('0x1d')](this[_0x03b0('0x6')]['id'],this[_0x03b0('0x4')][_0x03b0('0x10')][this[_0x03b0('0x14')]],_0x03b0('0x1e'));this['realtime'][_0x03b0('0x10')][this[_0x03b0('0x14')]]['busy']=![];this[_0x03b0('0x4')][_0x03b0('0x10')][this[_0x03b0('0x14')]][_0x03b0('0x1f')]=undefined;}if(!_0x98cc88){setTimeout(this[_0x03b0('0x7')][_0x03b0('0xa')](this),0x3e8);}};function rrmemory(_0x570828,_0x2fcac8,_0x522f29,_0x50d0c1){return new RRMemory(_0x570828,_0x2fcac8,_0x522f29,_0x50d0c1);}module[_0x03b0('0x20')]=rrmemory;
\ No newline at end of file
+var _0x06d8=['isNil','hideNotification','TIMEOUT','busy','busyQueue','exports','lodash','./util','routing','notificationId','queue','realtime','intervals','squeue','push','handleRun','handleTimeout','bind','drained','prototype','handleDrained','handleCheckReject','isAgentAvailable','agents','channel','agentId','info','[%s][QUEUE]\x20try\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','done','name','writeLog','RINGING','[%s][QUEUE]\x20timeout\x20with\x20%s'];(function(_0x20fb1d,_0x47206a){var _0x143a67=function(_0x3171cb){while(--_0x3171cb){_0x20fb1d['push'](_0x20fb1d['shift']());}};_0x143a67(++_0x47206a);}(_0x06d8,0xb0));var _0x806d=function(_0x4874e8,_0xfe494a){_0x4874e8=_0x4874e8-0x0;var _0x2bda24=_0x06d8[_0x4874e8];return _0x2bda24;};'use strict';var rr=require('rr');var _=require(_0x806d('0x0'));var uuid=require('uuid');var util=require(_0x806d('0x1'));var logger=require('../../../../../config/logger')(_0x806d('0x2'));var RRMemory=function(_0x3ed141,_0x140d70,_0xab7cde,_0x863c85){this[_0x806d('0x3')]=uuid['v4']();this['squeue']=_0x3ed141;this[_0x806d('0x4')]=_0x140d70;this[_0x806d('0x5')]=_0xab7cde;this[_0x806d('0x2')]=_0x863c85;this[_0x806d('0x6')]={};this[_0x806d('0x7')][_0x806d('0x8')](this[_0x806d('0x9')]['bind'](this),this[_0x806d('0xa')]['bind'](this),this['module']);this[_0x806d('0x7')]['on']('timeout',this[_0x806d('0xa')][_0x806d('0xb')](this));this[_0x806d('0x7')]['on'](_0x806d('0xc'),this['handleDrained'][_0x806d('0xb')](this));};RRMemory[_0x806d('0xd')][_0x806d('0x8')]=function(){this[_0x806d('0x7')]['push'](this['handleRun'][_0x806d('0xb')](this),this[_0x806d('0xa')][_0x806d('0xb')](this));};RRMemory[_0x806d('0xd')][_0x806d('0xe')]=function(_0x23fb2a){this['handleTimeout'](!![]);};RRMemory[_0x806d('0xd')][_0x806d('0xf')]=function(_0x52075e){if(util[_0x806d('0x10')](this[_0x806d('0x7')]['id'],this[_0x806d('0x5')][_0x806d('0x11')][this['agentId']],this['squeue'][_0x806d('0x12')],!![])){logger['info']('[%s][QUEUE]\x20available\x20again\x20%s',this['squeue']['id'],this[_0x806d('0x13')]);clearInterval(this[_0x806d('0x6')][this[_0x806d('0x13')]]);_0x52075e['done']();setTimeout(this[_0x806d('0x8')][_0x806d('0xb')](this),0x3e8);}};RRMemory[_0x806d('0xd')]['handleRun']=function(_0x36968){this[_0x806d('0x13')]=rr(this[_0x806d('0x4')]['mapAgentsId']);logger[_0x806d('0x14')](_0x806d('0x15'),this[_0x806d('0x7')]['id'],this[_0x806d('0x13')]);if(_['isNil'](this[_0x806d('0x5')]['agents'][this[_0x806d('0x13')]])){logger[_0x806d('0x14')](_0x806d('0x16'),this[_0x806d('0x7')]['id'],this[_0x806d('0x13')]);_0x36968[_0x806d('0x17')]();setTimeout(this['push'][_0x806d('0xb')](this),0x3e8);}else{if(util[_0x806d('0x10')](this[_0x806d('0x7')]['id'],this[_0x806d('0x5')][_0x806d('0x11')][this['agentId']],this['squeue']['channel'],!![])){this[_0x806d('0x5')][_0x806d('0x11')][this['agentId']]['busy']=!![];this['realtime']['agents'][this[_0x806d('0x13')]]['busyQueue']=this['queue'][_0x806d('0x18')];util['showNotification'](this['notificationId'],this[_0x806d('0x7')]['id'],this[_0x806d('0x5')]['agents'][this[_0x806d('0x13')]],this['queue'],this[_0x806d('0x2')]);util[_0x806d('0x19')](this[_0x806d('0x7')]['id'],this['realtime']['agents'][this[_0x806d('0x13')]],_0x806d('0x1a'));this[_0x806d('0x6')][this[_0x806d('0x13')]]=setInterval(this[_0x806d('0xf')][_0x806d('0xb')](this,_0x36968),0x3e8);}else{logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s',this[_0x806d('0x7')]['id'],this[_0x806d('0x13')]);_0x36968[_0x806d('0x17')]();setTimeout(this['push'][_0x806d('0xb')](this),0x3e8);}}};RRMemory[_0x806d('0xd')][_0x806d('0xa')]=function(_0x5803a7){logger[_0x806d('0x14')](_0x806d('0x1b'),this[_0x806d('0x7')]['id'],this[_0x806d('0x13')]);if(_[_0x806d('0x1c')](this[_0x806d('0x5')][_0x806d('0x11')][this[_0x806d('0x13')]])){logger[_0x806d('0x14')](_0x806d('0x16'),this[_0x806d('0x7')]['id'],this[_0x806d('0x13')]);}else{clearInterval(this[_0x806d('0x6')][this['agentId']]);util[_0x806d('0x1d')](this[_0x806d('0x3')],this[_0x806d('0x7')]['id'],this[_0x806d('0x5')][_0x806d('0x11')][this[_0x806d('0x13')]],this[_0x806d('0x4')],this['routing']);util[_0x806d('0x19')](this[_0x806d('0x7')]['id'],this['realtime']['agents'][this[_0x806d('0x13')]],_0x806d('0x1e'));this[_0x806d('0x5')][_0x806d('0x11')][this[_0x806d('0x13')]][_0x806d('0x1f')]=![];this[_0x806d('0x5')][_0x806d('0x11')][this[_0x806d('0x13')]][_0x806d('0x20')]=undefined;}if(!_0x5803a7){setTimeout(this[_0x806d('0x8')][_0x806d('0xb')](this),0x3e8);}};function rrmemory(_0x499e16,_0x54d0cc,_0x218a66,_0x439b34){return new RRMemory(_0x499e16,_0x54d0cc,_0x218a66,_0x439b34);}module[_0x806d('0x21')]=rrmemory;
\ No newline at end of file
index 2bf6578..36e2fec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda8=['OFFLINE','Pause','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','writeLog','lodash','util','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','emit','format','user:%s','name','user:save','split','\x20interaction','account','notificationSound','body','queue','msg','I\x20can\x27t\x20render\x20your\x20template','error','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY'];(function(_0x28e9b6,_0x11ba36){var _0x58008b=function(_0x3da5e3){while(--_0x3da5e3){_0x28e9b6['push'](_0x28e9b6['shift']());}};_0x58008b(++_0x11ba36);}(_0xeda8,0x104));var _0x8eda=function(_0x5aeef5,_0xd202a4){_0x5aeef5=_0x5aeef5-0x0;var _0x3ba5e6=_0xeda8[_0x5aeef5];return _0x3ba5e6;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var utils=require('../utils');var Mustache=require(_0x8eda('0x2'));var Redis=require(_0x8eda('0x3'));var config=require(_0x8eda('0x4'));var logger=require(_0x8eda('0x5'))(_0x8eda('0x6'));config[_0x8eda('0x7')]=_[_0x8eda('0x8')](config[_0x8eda('0x7')],{'host':_0x8eda('0x9'),'port':0x18eb});var io=require(_0x8eda('0xa'))(new Redis(config[_0x8eda('0x7')]));function emit(_0x32abe8,_0x4e2ebb,_0x28b721){io['to'](_0x32abe8)[_0x8eda('0xb')](_0x4e2ebb,_0x28b721);}function sendNotification(_0x5aa93d,_0x6b544f,_0x4be9df,_0x4f7893,_0x488849,_0x4fbf0a){io['to'](util[_0x8eda('0xc')](_0x8eda('0xd'),_0x4f7893[_0x8eda('0xe')]))['emit'](_0x8eda('0xf'),_0x4f7893);var _0x5a80ca=_0x4fbf0a||{};var _0x3f34c=_0x4be9df[_0x8eda('0x10')]('.');var _0x2fdec0={'uniqueid':_0x6b544f,'channel':_0x3f34c[0x0],'id':_0x3f34c[0x1],'title':_0x3f34c[0x0]+_0x8eda('0x11'),'interactionId':_0x3f34c[0x2],'queue':_0x488849?_0x488849[_0x8eda('0xe')]:null,'sound':_0x5a80ca[_0x8eda('0x12')][_0x8eda('0x13')],'shake':_0x5a80ca[_0x8eda('0x12')]['notificationShake']};try{if(!_0x5a80ca['body']){_0x5a80ca[_0x8eda('0x14')]={};}if(_0x488849){_0x5a80ca[_0x8eda('0x14')]['queue']=_0x488849;}else if(_0x5a80ca[_0x8eda('0x14')][_0x8eda('0x15')]){delete _0x5a80ca[_0x8eda('0x14')]['queue'];}_0x2fdec0[_0x8eda('0x16')]=utils['getMustacheRender'](_0x5a80ca[_0x8eda('0x12')]['notificationTemplate'],_0x5a80ca);}catch(_0x24aed4){_0x2fdec0['msg']=_0x8eda('0x17');logger[_0x8eda('0x18')](util['format']('[%s][QUEUE]\x20%s',_0x6b544f,_0x24aed4[_0x8eda('0x19')]));}io['to'](util[_0x8eda('0xc')](_0x8eda('0xd'),_0x4f7893[_0x8eda('0xe')]))[_0x8eda('0xb')](util[_0x8eda('0xc')](_0x8eda('0x1a'),_0x5aa93d?_0x8eda('0x1b'):_0x8eda('0x1c')),_0x2fdec0);}function writeLog(_0x232786,_0x279ade,_0x57f336){return logger[_0x8eda('0x1d')](util['format'](_0x8eda('0x1e'),_0x232786,_0x279ade['name'],_0x57f336));}exports[_0x8eda('0x1f')]=function(_0x2dab25,_0x4f3e0a,_0x58e54b,_0x56dba4){if(_0x4f3e0a[_0x8eda('0x20')]){writeLog(_0x2dab25,_0x4f3e0a,_0x8eda('0x21'));return![];}if(!_0x4f3e0a['online']){writeLog(_0x2dab25,_0x4f3e0a,_0x8eda('0x22'));return![];}if(_0x4f3e0a[_0x58e54b+_0x8eda('0x23')]){writeLog(_0x2dab25,_0x4f3e0a,'PAUSE');return![];}if(_0x56dba4&&_0x4f3e0a[_0x8eda('0x24')](_0x58e54b+_0x8eda('0x25'))&&_0x4f3e0a[_0x8eda('0x24')](_0x58e54b+_0x8eda('0x26'))){if(_0x4f3e0a[_0x58e54b+_0x8eda('0x25')]>0x0&&_0x4f3e0a[_0x58e54b+'CurrentCapacity']>=_0x4f3e0a[_0x58e54b+_0x8eda('0x25')]){writeLog(_0x2dab25,_0x4f3e0a,_0x58e54b['toUpperCase']()+_0x8eda('0x27'));return![];}}return!![];};exports[_0x8eda('0x28')]=function(_0x8337b4,_0x567f69,_0x23e892,_0x244400,_0x1dd12){return sendNotification(!![],_0x8337b4,_0x567f69,_0x23e892,_0x244400,_0x1dd12);};exports['hideNotification']=function(_0x1616ea,_0x11a999,_0x5dd315,_0x27d2ce,_0x29e6f4){return sendNotification(![],_0x1616ea,_0x11a999,_0x5dd315,_0x27d2ce,_0x29e6f4);};exports[_0x8eda('0x29')]=writeLog;
\ No newline at end of file
+var _0x7046=['showNotification','hideNotification','lodash','util','../utils','mustache','../../../../../config/environment','../../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','format','user:%s','name','emit','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity'];(function(_0x5e8dcc,_0x176f7b){var _0x4a060a=function(_0x191818){while(--_0x191818){_0x5e8dcc['push'](_0x5e8dcc['shift']());}};_0x4a060a(++_0x176f7b);}(_0x7046,0x144));var _0x6704=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x7046[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x6704('0x0'));var util=require(_0x6704('0x1'));var utils=require(_0x6704('0x2'));var Mustache=require(_0x6704('0x3'));var Redis=require('ioredis');var config=require(_0x6704('0x4'));var logger=require(_0x6704('0x5'))(_0x6704('0x6'));config['redis']=_[_0x6704('0x7')](config[_0x6704('0x8')],{'host':_0x6704('0x9'),'port':0x18eb});var io=require(_0x6704('0xa'))(new Redis(config[_0x6704('0x8')]));function emit(_0x4badf8,_0x5ced8,_0x49b8b6){io['to'](_0x4badf8)['emit'](_0x5ced8,_0x49b8b6);}function sendNotification(_0x390ace,_0x510221,_0x578822,_0x3ca599,_0x394ef4,_0x37a1ad){io['to'](util[_0x6704('0xb')](_0x6704('0xc'),_0x3ca599[_0x6704('0xd')]))[_0x6704('0xe')](_0x6704('0xf'),_0x3ca599);var _0x58cc09=_0x37a1ad||{};var _0x2c8b0f=_0x578822[_0x6704('0x10')]('.');var _0x575aa6={'uniqueid':_0x510221,'channel':_0x2c8b0f[0x0],'id':_0x2c8b0f[0x1],'title':_0x2c8b0f[0x0]+_0x6704('0x11'),'interactionId':_0x2c8b0f[0x2],'queue':_0x394ef4?_0x394ef4[_0x6704('0xd')]:null,'sound':_0x58cc09[_0x6704('0x12')][_0x6704('0x13')],'shake':_0x58cc09[_0x6704('0x12')][_0x6704('0x14')]};try{if(!_0x58cc09[_0x6704('0x15')]){_0x58cc09[_0x6704('0x15')]={};}if(_0x394ef4){_0x58cc09[_0x6704('0x15')]['queue']=_0x394ef4;}else if(_0x58cc09[_0x6704('0x15')][_0x6704('0x16')]){delete _0x58cc09[_0x6704('0x15')]['queue'];}_0x575aa6[_0x6704('0x17')]=utils[_0x6704('0x18')](_0x58cc09[_0x6704('0x12')][_0x6704('0x19')],_0x58cc09);}catch(_0x37fa47){_0x575aa6['msg']=_0x6704('0x1a');logger[_0x6704('0x1b')](util[_0x6704('0xb')](_0x6704('0x1c'),_0x510221,_0x37fa47[_0x6704('0x1d')]));}io['to'](util['format'](_0x6704('0xc'),_0x3ca599[_0x6704('0xd')]))[_0x6704('0xe')](util[_0x6704('0xb')](_0x6704('0x1e'),_0x390ace?_0x6704('0x1f'):_0x6704('0x20')),_0x575aa6);}function writeLog(_0x5bb33e,_0x1df6d7,_0xf6d433){return logger[_0x6704('0x21')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x5bb33e,_0x1df6d7[_0x6704('0xd')],_0xf6d433));}exports[_0x6704('0x22')]=function(_0x3cd12e,_0x4ecf4c,_0x41f89e,_0x56d1e1){if(_0x4ecf4c[_0x6704('0x23')]){writeLog(_0x3cd12e,_0x4ecf4c,_0x6704('0x24'));return![];}if(!_0x4ecf4c[_0x6704('0x25')]){writeLog(_0x3cd12e,_0x4ecf4c,_0x6704('0x26'));return![];}if(_0x4ecf4c[_0x41f89e+_0x6704('0x27')]){writeLog(_0x3cd12e,_0x4ecf4c,_0x6704('0x28'));return![];}if(_0x56d1e1&&_0x4ecf4c[_0x6704('0x29')](_0x41f89e+_0x6704('0x2a'))&&_0x4ecf4c[_0x6704('0x29')](_0x41f89e+_0x6704('0x2b'))){if(_0x4ecf4c[_0x41f89e+_0x6704('0x2a')]>0x0&&_0x4ecf4c[_0x41f89e+_0x6704('0x2b')]>=_0x4ecf4c[_0x41f89e+_0x6704('0x2a')]){writeLog(_0x3cd12e,_0x4ecf4c,_0x41f89e['toUpperCase']()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x6704('0x2c')]=function(_0xf875dc,_0x86fc1d,_0x38f9fe,_0x4a9c3e,_0x1def46){return sendNotification(!![],_0xf875dc,_0x86fc1d,_0x38f9fe,_0x4a9c3e,_0x1def46);};exports[_0x6704('0x2d')]=function(_0x5c229d,_0x588814,_0x16e749,_0x5363c9,_0x812ba2){return sendNotification(![],_0x5c229d,_0x588814,_0x16e749,_0x5363c9,_0x812ba2);};exports['writeLog']=writeLog;
\ No newline at end of file
index b294a96..5081099 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfcc=['[%s][SYSTEM]\x20%s','map','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','shelljs','lodash','../../../../config/logger','routing','string','consequence','length','error'];(function(_0x126006,_0x29d087){var _0x4df414=function(_0xf90add){while(--_0xf90add){_0x126006['push'](_0x126006['shift']());}};_0x4df414(++_0x29d087);}(_0xdfcc,0x8d));var _0xcdfc=function(_0x3b3a82,_0x53b5e0){_0x3b3a82=_0x3b3a82-0x0;var _0x267063=_0xdfcc[_0x3b3a82];return _0x267063;};'use strict';var schema=require(_0xcdfc('0x0'));var sh=require(_0xcdfc('0x1'));var _=require(_0xcdfc('0x2'));var utils=require('./utils');var logger=require(_0xcdfc('0x3'))(_0xcdfc('0x4'));var system=schema({'command':{'type':_0xcdfc('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0xcdfc('0x6')]=function(_0x4e9e63,_0x5b1db4){return function(_0x5cf6e7){try{var _0xa928f6={'command':_0x5b1db4[0x0]};var _0x155d4c=system['validate'](_0xa928f6,{'typecast':!![]});if(_0x155d4c[_0xcdfc('0x7')]){logger[_0xcdfc('0x8')](_0xcdfc('0x9'),_0x4e9e63,_[_0xcdfc('0xa')](_0x155d4c,'message')[_0xcdfc('0xb')](',\x20'));logger['info'](_0xcdfc('0xc'),_0x4e9e63);_0x5cf6e7[_0xcdfc('0xd')]();}else{var _0x3a8975=this;var _0x46071b=utils[_0xcdfc('0xe')](_0x5b1db4[0x0],this);logger[_0xcdfc('0xf')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x4e9e63,_0x46071b);sh['exec'](_[_0xcdfc('0x10')](_0x46071b),function(_0x4218f3,_0x59015f){logger[_0xcdfc('0xf')](_0xcdfc('0x11'),_0x4e9e63,_0x4218f3);if(_0x4218f3==0x0){var _0x5b278d=_0x59015f[_0xcdfc('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xcdfc('0x13')](_0x5b1db4[0x1])||_[_0xcdfc('0x14')](_0x5b1db4[0x1])){logger['info'](_0xcdfc('0x15'),_0x4e9e63);_0x3a8975[_0xcdfc('0x16')][_0x5b1db4[0x1]]=_0x5b278d;}else{logger['info'](_0xcdfc('0x17'),_0x4e9e63,_0x5b1db4[0x1],_0x5b278d);_0x3a8975[_0xcdfc('0x16')][_0x5b1db4[0x1]]=_0x5b278d;}}_0x5cf6e7[_0xcdfc('0xd')]();});}}catch(_0x5189bd){logger[_0xcdfc('0x8')](_0xcdfc('0x9'),_0x4e9e63,_['isObject'](_0x5189bd)?JSON[_0xcdfc('0x18')](_0x5189bd):_0x5189bd);logger[_0xcdfc('0xf')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4e9e63);_0x5cf6e7[_0xcdfc('0xd')]();}};};
\ No newline at end of file
+var _0xc688=['validate','shelljs','./utils','../../../../config/logger','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','map','message','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','error','isObject','stringify'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0xc688,0xc0));var _0x8c68=function(_0x3e7d3c,_0x42973c){_0x3e7d3c=_0x3e7d3c-0x0;var _0x5c862e=_0xc688[_0x3e7d3c];return _0x5c862e;};'use strict';var schema=require(_0x8c68('0x0'));var sh=require(_0x8c68('0x1'));var _=require('lodash');var utils=require(_0x8c68('0x2'));var logger=require(_0x8c68('0x3'))('routing');var system=schema({'command':{'type':_0x8c68('0x4'),'required':!![],'message':_0x8c68('0x5')}});exports['consequence']=function(_0x59d028,_0x5302c4){return function(_0x177d30){try{var _0x4d08b8={'command':_0x5302c4[0x0]};var _0x488bd4=system['validate'](_0x4d08b8,{'typecast':!![]});if(_0x488bd4[_0x8c68('0x6')]){logger['error']('[%s][SYSTEM]\x20%s',_0x59d028,_[_0x8c68('0x7')](_0x488bd4,_0x8c68('0x8'))['join'](',\x20'));logger[_0x8c68('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x59d028);_0x177d30[_0x8c68('0xa')]();}else{var _0x150f09=this;var _0xcb9bee=utils[_0x8c68('0xb')](_0x5302c4[0x0],this);logger['info'](_0x8c68('0xc'),_0x59d028,_0xcb9bee);sh[_0x8c68('0xd')](_[_0x8c68('0xe')](_0xcb9bee),function(_0x5bb6ac,_0x1774c4){logger[_0x8c68('0x9')](_0x8c68('0xf'),_0x59d028,_0x5bb6ac);if(_0x5bb6ac==0x0){var _0x2530e5=_0x1774c4[_0x8c68('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x8c68('0x11')](_0x5302c4[0x1])||_[_0x8c68('0x12')](_0x5302c4[0x1])){logger[_0x8c68('0x9')](_0x8c68('0x13'),_0x59d028);_0x150f09['body'][_0x5302c4[0x1]]=_0x2530e5;}else{logger[_0x8c68('0x9')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x59d028,_0x5302c4[0x1],_0x2530e5);_0x150f09[_0x8c68('0x14')][_0x5302c4[0x1]]=_0x2530e5;}}_0x177d30['next']();});}}catch(_0x513d82){logger[_0x8c68('0x15')]('[%s][SYSTEM]\x20%s',_0x59d028,_[_0x8c68('0x16')](_0x513d82)?JSON[_0x8c68('0x17')](_0x513d82):_0x513d82);logger[_0x8c68('0x9')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x59d028);_0x177d30['next']();}};};
\ No newline at end of file
index 0196dc7..e7be501 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b4b=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','stringify','info','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x478967,_0x54e6e1){var _0x1fc5b9=function(_0x31c9cb){while(--_0x31c9cb){_0x478967['push'](_0x478967['shift']());}};_0x1fc5b9(++_0x54e6e1);}(_0x5b4b,0xc3));var _0xb5b4=function(_0x5d43f5,_0x8c9030){_0x5d43f5=_0x5d43f5-0x0;var _0x453144=_0x5b4b[_0x5d43f5];return _0x453144;};'use strict';var schema=require(_0xb5b4('0x0'));var _=require(_0xb5b4('0x1'));var rpc={'chatInteraction':require(_0xb5b4('0x2')),'openchannelInteraction':require(_0xb5b4('0x3')),'smsInteraction':require(_0xb5b4('0x4')),'mailInteraction':require(_0xb5b4('0x5')),'faxInteraction':require(_0xb5b4('0x6')),'whatsappInteraction':require(_0xb5b4('0x7'))};var logger=require('../../../../config/logger')(_0xb5b4('0x8'));var tag=schema({'tag':{'type':_0xb5b4('0x9'),'required':!![],'message':_0xb5b4('0xa')}});exports[_0xb5b4('0xb')]=function(_0x527b11,_0x16ecfc,_0x266534,_0x1e00db){return function(_0x4bf06a){try{var _0x3910d7={'tag':_0x16ecfc[0x0]};var _0x30d600=tag['validate'](_0x3910d7,{'typecast':!![]});if(_0x30d600[_0xb5b4('0xc')]){logger[_0xb5b4('0xd')](_0xb5b4('0xe'),_0x527b11,_[_0xb5b4('0xf')](_0x30d600,_0xb5b4('0x10'))[_0xb5b4('0x11')](',\x20'));logger['info'](_0xb5b4('0x12'),_0x527b11);_0x4bf06a[_0xb5b4('0x13')]();}else{var _0x2f255a={'ids':[_0x16ecfc[0x0]]};if(rpc[_0x1e00db[_0xb5b4('0x14')]+_0xb5b4('0x15')]){rpc[_0x1e00db[_0xb5b4('0x14')]+_0xb5b4('0x15')][_0xb5b4('0x16')](_0x1e00db['interaction']['id'],_0x2f255a)[_0xb5b4('0x17')](function(_0x43bfac){logger['info'](_0xb5b4('0x18'),_0x527b11,_0x16ecfc[0x1],_0x1e00db[_0xb5b4('0x14')],_0x1e00db[_0xb5b4('0x19')]['id']);})['catch'](function(_0x356b83){logger[_0xb5b4('0xd')]('[%s][TAG]\x20%s',_0x527b11,JSON[_0xb5b4('0x1a')](_0x356b83));logger[_0xb5b4('0x1b')](_0xb5b4('0x12'),_0x527b11);})[_0xb5b4('0x1c')](function(){_0x4bf06a[_0xb5b4('0x13')]();});}}}catch(_0x4b192a){logger[_0xb5b4('0xd')](_0xb5b4('0xe'),_0x527b11,_['isObject'](_0x4b192a)?JSON[_0xb5b4('0x1a')](_0x4b192a):_0x4b192a);logger[_0xb5b4('0x1b')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x527b11);_0x4bf06a['next']();}};};
\ No newline at end of file
+var _0xf6a0=['../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','info','catch','stringify','next','isObject','validate','lodash'];(function(_0x309359,_0x8711b6){var _0x9f542f=function(_0x264db3){while(--_0x264db3){_0x309359['push'](_0x309359['shift']());}};_0x9f542f(++_0x8711b6);}(_0xf6a0,0x136));var _0x0f6a=function(_0x3834cc,_0x358c72){_0x3834cc=_0x3834cc-0x0;var _0x4efc32=_0xf6a0[_0x3834cc];return _0x4efc32;};'use strict';var schema=require(_0x0f6a('0x0'));var _=require(_0x0f6a('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x0f6a('0x2')),'faxInteraction':require(_0x0f6a('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x0f6a('0x4'))(_0x0f6a('0x5'));var tag=schema({'tag':{'type':_0x0f6a('0x6'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x129d04,_0x5304d0,_0x114dd6,_0x5e97fb){return function(_0x3e1019){try{var _0x3f29cb={'tag':_0x5304d0[0x0]};var _0x136190=tag[_0x0f6a('0x0')](_0x3f29cb,{'typecast':!![]});if(_0x136190[_0x0f6a('0x7')]){logger[_0x0f6a('0x8')](_0x0f6a('0x9'),_0x129d04,_[_0x0f6a('0xa')](_0x136190,_0x0f6a('0xb'))[_0x0f6a('0xc')](',\x20'));logger['info'](_0x0f6a('0xd'),_0x129d04);_0x3e1019['next']();}else{var _0x4c8d60={'ids':[_0x5304d0[0x0]]};if(rpc[_0x5e97fb[_0x0f6a('0xe')]+_0x0f6a('0xf')]){rpc[_0x5e97fb[_0x0f6a('0xe')]+_0x0f6a('0xf')][_0x0f6a('0x10')](_0x5e97fb[_0x0f6a('0x11')]['id'],_0x4c8d60)[_0x0f6a('0x12')](function(_0x217803){logger[_0x0f6a('0x13')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x129d04,_0x5304d0[0x1],_0x5e97fb['channel'],_0x5e97fb[_0x0f6a('0x11')]['id']);})[_0x0f6a('0x14')](function(_0x500178){logger['error'](_0x0f6a('0x9'),_0x129d04,JSON[_0x0f6a('0x15')](_0x500178));logger[_0x0f6a('0x13')](_0x0f6a('0xd'),_0x129d04);})['finally'](function(){_0x3e1019[_0x0f6a('0x16')]();});}}}catch(_0x114a9e){logger[_0x0f6a('0x8')](_0x0f6a('0x9'),_0x129d04,_[_0x0f6a('0x17')](_0x114a9e)?JSON['stringify'](_0x114a9e):_0x114a9e);logger[_0x0f6a('0x13')](_0x0f6a('0xd'),_0x129d04);_0x3e1019[_0x0f6a('0x16')]();}};};
\ No newline at end of file
index a6dbcee..537f96a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['list','lodash','exports','render','merge','contact','message','account','interaction'];(function(_0x22b1cc,_0xc98297){var _0x3ce3e3=function(_0x38bf3a){while(--_0x38bf3a){_0x22b1cc['push'](_0x22b1cc['shift']());}};_0x3ce3e3(++_0xc98297);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Mustache=require('mustache');var _=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'getMustacheRender':function(_0x1e212d,_0x263f79){return Mustache[_0x0baf('0x2')](_0x1e212d,_[_0x0baf('0x3')](_0x263f79['body'],{'contact':_0x263f79[_0x0baf('0x4')],'message':_0x263f79[_0x0baf('0x5')],'account':_0x263f79[_0x0baf('0x6')],'interaction':_0x263f79[_0x0baf('0x7')],'list':_0x263f79[_0x0baf('0x8')]}))||'';}};
\ No newline at end of file
+var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x5c0902,_0x4cd1a5){var _0xb62a2c=function(_0x4d1bf7){while(--_0x4d1bf7){_0x5c0902['push'](_0x5c0902['shift']());}};_0xb62a2c(++_0x4cd1a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}};
\ No newline at end of file
index 4fc3938..d390deb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb84=['%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','appdata','channel','mail','push','dialogflow','split','slice','dialogflowv2','amazonlex','tag','TagId','%s:%s:%s','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','error','execute','Applications\x20executed','stringify','matchPath','stack','routing\x20is\x20empty','agent','agents','emit','end','QueueReport','UserId','catch','message\x20is\x20empty','hasOwnProperty','capacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','mailQueues','openchannelQueues','smsQueues','waiting','faxQueues','whatsappQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine'];(function(_0x3ec583,_0x4c6be1){var _0xf18ef9=function(_0x32c8f0){while(--_0x32c8f0){_0x3ec583['push'](_0x3ec583['shift']());}};_0xf18ef9(++_0x4c6be1);}(_0xdb84,0xa8));var _0x4db8=function(_0x203675,_0x31d6ef){_0x203675=_0x203675-0x0;var _0x12528b=_0xdb84[_0x203675];return _0x12528b;};'use strict';var _=require('lodash');var util=require(_0x4db8('0x0'));var path=require(_0x4db8('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x4db8('0x2'));var uuid=require(_0x4db8('0x3'));var config=require(_0x4db8('0x4'));var logger=require(_0x4db8('0x5'))(_0x4db8('0x6'));var rpc={'openchannelQueueReport':require(_0x4db8('0x7')),'mailQueueReport':require(_0x4db8('0x8')),'chatQueueReport':require(_0x4db8('0x9')),'smsQueueReport':require(_0x4db8('0xa')),'faxQueueReport':require(_0x4db8('0xb')),'whatsappQueueReport':require(_0x4db8('0xc'))};var RuleEngine=require(_0x4db8('0xd'));function getId(_0x164e6d,_0x16c103,_0x31741d){return util['format'](_0x4db8('0xe'),_0x164e6d,_0x16c103||0x0,_0x31741d||0x0);}function getIntervals(_0x27d1bd,_0x304e80){var _0x2ffcfe=[];if(!_[_0x4db8('0xf')](_0x304e80[_0x4db8('0x10')])&&!_[_0x4db8('0xf')](_0x27d1bd[_0x304e80[_0x4db8('0x10')]])&&!_[_0x4db8('0xf')](_0x27d1bd[_0x304e80['IntervalId']][_0x4db8('0x11')])){_0x2ffcfe=_[_0x4db8('0x12')](_0x27d1bd[_0x304e80[_0x4db8('0x10')]][_0x4db8('0x11')],'interval');}else if(!_[_0x4db8('0xf')](_0x304e80['interval'])){_0x2ffcfe=[_0x304e80[_0x4db8('0x13')]];}return _0x2ffcfe;}exports[_0x4db8('0x14')]=function(_0x2f56fa){_0x2f56fa[_0x4db8('0x15')]={};return new BPromise(function(_0x3c064b,_0x149c2b){var _0x357c4c={'Start':function(_0x3bd16d){var _0x154c9a=this;return new Promise(function(_0x3c55e9,_0x4d4b61){if(_0x3bd16d){try{var _0x5b347f=[];var _0x2fb737=getId(_0x3bd16d['channel'],_0x3bd16d[_0x4db8('0x16')]?_0x3bd16d['message']['id']:0x0,_0x3bd16d[_0x4db8('0x17')]?_0x3bd16d['interaction']['id']:0x0);if(_0x3bd16d[_0x4db8('0x18')]&&_[_0x4db8('0x19')](_0x3bd16d['applications'])&&_0x3bd16d[_0x4db8('0x18')]['length']){for(var _0x268473=0x0;_0x268473<_0x3bd16d[_0x4db8('0x18')][_0x4db8('0x1a')];_0x268473+=0x1){var _0x275b49=_0x3bd16d[_0x4db8('0x18')][_0x268473];if(fs[_0x4db8('0x1b')](path[_0x4db8('0x1c')](__dirname,_0x4db8('0x18'),_0x275b49[_0x4db8('0x1d')]+_0x4db8('0x1e')))){var _0x4bb9e4=[];switch(_0x275b49['app'][_0x4db8('0x1f')]()){case'autoreply':var _0x47b950=_0x275b49[_0x4db8('0x20')]['split'](',');if(_0x3bd16d[_0x4db8('0x21')]===_0x4db8('0x22')){_0x4bb9e4[_0x4db8('0x23')](_0x47b950[0x0]);_0x4bb9e4['push'](_0x47b950[0x1]);_0x4bb9e4[_0x4db8('0x23')](_0x47b950['slice'](0x2,_0x47b950[_0x4db8('0x1a')])['join'](','));}else{_0x4bb9e4[_0x4db8('0x23')](_0x47b950[0x0]);_0x4bb9e4[_0x4db8('0x23')](_0x47b950['slice'](0x1,_0x47b950[_0x4db8('0x1a')])[_0x4db8('0x1c')](','));}break;case _0x4db8('0x24'):var _0x32abb2=_0x275b49[_0x4db8('0x20')][_0x4db8('0x25')](',');_0x4bb9e4[_0x4db8('0x23')](_0x32abb2[0x0]);_0x4bb9e4['push'](_0x32abb2[0x1]);_0x4bb9e4[_0x4db8('0x23')](_0x32abb2[_0x4db8('0x26')](0x2,_0x32abb2[_0x4db8('0x1a')])[_0x4db8('0x1c')](','));break;case _0x4db8('0x27'):var _0x4273ed=_0x275b49[_0x4db8('0x20')][_0x4db8('0x25')](',');_0x4bb9e4[_0x4db8('0x23')](_0x4273ed[0x0]);_0x4bb9e4[_0x4db8('0x23')](_0x4273ed[0x1]);_0x4bb9e4[_0x4db8('0x23')](_0x4273ed[0x2]);_0x4bb9e4['push'](_0x4273ed[0x3]);_0x4bb9e4[_0x4db8('0x23')](_0x4273ed['slice'](0x4,_0x4273ed[_0x4db8('0x1a')])[_0x4db8('0x1c')](','));break;case _0x4db8('0x28'):var _0x1f740b=_0x275b49[_0x4db8('0x20')][_0x4db8('0x25')](',');_0x4bb9e4[_0x4db8('0x23')](_0x1f740b[0x0]);_0x4bb9e4['push'](_0x1f740b[0x1]);_0x4bb9e4[_0x4db8('0x23')](_0x1f740b[0x2]);_0x4bb9e4[_0x4db8('0x23')](_0x1f740b[0x3]);_0x4bb9e4[_0x4db8('0x23')](_0x1f740b['slice'](0x4,_0x1f740b[_0x4db8('0x1a')])['join'](','));break;case'message':_0x4bb9e4[_0x4db8('0x23')](_0x275b49[_0x4db8('0x20')]);break;case _0x4db8('0x29'):_0x4bb9e4[_0x4db8('0x23')](_0x275b49[_0x4db8('0x2a')]);_0x4bb9e4[_0x4db8('0x23')](_0x275b49[_0x4db8('0x20')]);break;default:_0x4bb9e4=_[_0x4db8('0xf')](_0x275b49[_0x4db8('0x20')])?[]:_0x275b49[_0x4db8('0x20')][_0x4db8('0x25')](',');}var _0x6331bc={'id':util['format'](_0x4db8('0x2b'),_0x2fb737,_0x275b49['id'],_0x275b49[_0x4db8('0x1d')]),'condition':require('./interval')['condition'](_0x2fb737,getIntervals(_0x2f56fa[_0x4db8('0x2c')],_0x275b49),_0x2f56fa),'consequence':require(_0x4db8('0x2d')+_0x275b49[_0x4db8('0x1d')])[_0x4db8('0x2e')](_0x2fb737,_0x4bb9e4,_0x2f56fa,_0x3bd16d),'p':_0x275b49[_0x4db8('0x2f')]||0x0};logger[_0x4db8('0x30')](_0x4db8('0x31'),_0x6331bc['id'],'on\x20interval',getIntervals(_0x2f56fa[_0x4db8('0x2c')],_0x275b49)[_0x4db8('0x1c')]('\x20|\x20'));_0x5b347f[_0x4db8('0x23')](_0x6331bc);}else{logger[_0x4db8('0x32')]('Please\x20create\x20a\x20new\x20file\x20under',path['join'](__dirname,_0x4db8('0x18'),_0x275b49[_0x4db8('0x1d')]+_0x4db8('0x1e')));}}_0x2f56fa['rules'][_0x2fb737]=new RuleEngine(_0x5b347f);_0x2f56fa['rules'][_0x2fb737][_0x4db8('0x33')](_0x3bd16d,function(_0x2492f3){logger[_0x4db8('0x30')](_0x4db8('0x34'),JSON[_0x4db8('0x35')](_0x2492f3[_0x4db8('0x36')]));if(_0x2f56fa[_0x4db8('0x15')][_0x2fb737]){_0x2f56fa[_0x4db8('0x15')][_0x2fb737]['emit']('complete');}});return _0x3c55e9({'code':0xc8,'message':_0x3bd16d});}else{logger[_0x4db8('0x30')]('No\x20applications\x20to\x20execute');return _0x3c55e9({'code':0xc8,'message':_0x3bd16d});}}catch(_0x32136){logger[_0x4db8('0x32')](_0x32136[_0x4db8('0x37')]);return _0x4d4b61(_0x154c9a[_0x4db8('0x32')](0x1f4,_0x32136));}}return _0x4d4b61(_0x4db8('0x38'));});},'AcceptMessage':function(_0x558971){var _0x49f2de=this;return new Promise(function(_0x282a9f,_0x32a1ff){if(_0x558971[_0x4db8('0x39')]&&_0x558971[_0x4db8('0x39')]['id']){if(_0x2f56fa[_0x4db8('0x3a')][_0x558971['agent']['id']]){_0x2f56fa['agents'][_0x558971['agent']['id']]['busy']=![];_0x2f56fa[_0x4db8('0x3a')][_0x558971[_0x4db8('0x39')]['id']]['busyQueue']=undefined;}}if(_0x558971[_0x4db8('0x16')]&&_0x558971['message']['id']){try{var _0x2ed6e9=getId(_0x558971[_0x4db8('0x21')],_0x558971[_0x4db8('0x16')]?_0x558971[_0x4db8('0x16')]['id']:0x0,_0x558971[_0x4db8('0x17')]?_0x558971[_0x4db8('0x17')]['id']:0x0);if(_0x2f56fa['rules'][_0x2ed6e9]){_0x2f56fa['rules'][_0x2ed6e9][_0x4db8('0x3b')](_0x4db8('0x3c'));if(rpc[_0x558971[_0x4db8('0x21')]+'QueueReport']){rpc[_0x558971[_0x4db8('0x21')]+_0x4db8('0x3d')]['update'](_0x2ed6e9,{'UserId':_0x558971[_0x4db8('0x16')][_0x4db8('0x3e')]})[_0x4db8('0x3f')](function(_0x3bd715){logger[_0x4db8('0x32')]('error\x20update\x20queue\x20report');});}}return _0x282a9f({'code':0xc8,'message':_0x558971});}catch(_0x580a09){logger[_0x4db8('0x32')](_0x580a09[_0x4db8('0x37')]);return _0x32a1ff(_0x49f2de[_0x4db8('0x32')](0x1f4,_0x580a09));}}logger['error'](_0x4db8('0x40'));return _0x32a1ff(_0x49f2de[_0x4db8('0x32')](0x1f4,_0x4db8('0x40')));});},'RejectMessage':function(_0x1b1c16){var _0x2a94b9=this;return new Promise(function(_0x10fb02,_0x5bbad2){if(_0x1b1c16[_0x4db8('0x39')]&&_0x1b1c16[_0x4db8('0x39')]['id']){try{if(_0x2f56fa[_0x4db8('0x3a')][_0x1b1c16[_0x4db8('0x39')]['id']]){_0x2f56fa[_0x4db8('0x3a')][_0x1b1c16[_0x4db8('0x39')]['id']]['busy']=![];_0x2f56fa[_0x4db8('0x3a')][_0x1b1c16[_0x4db8('0x39')]['id']]['busyQueue']=undefined;}return _0x10fb02({'code':0xc8,'message':_0x1b1c16});}catch(_0x200154){logger[_0x4db8('0x32')](_0x200154[_0x4db8('0x37')]);return _0x5bbad2(_0x2a94b9[_0x4db8('0x32')](0x1f4,_0x200154));}}logger[_0x4db8('0x32')](_0x4db8('0x40'));return _0x5bbad2(_0x2a94b9[_0x4db8('0x32')](0x1f4,_0x4db8('0x40')));});},'AbandonInteraction':function(_0x425f84){var _0x335e2a=this;return new Promise(function(_0x1d8ec5,_0x456cfe){if(_0x425f84[_0x4db8('0x21')]&&_0x425f84[_0x4db8('0x17')]&&_0x425f84['interaction']['id']){try{var _0x3da98d=getId(_0x425f84[_0x4db8('0x21')],_0x425f84['message']?_0x425f84[_0x4db8('0x16')]['id']:0x0,_0x425f84[_0x4db8('0x17')]?_0x425f84[_0x4db8('0x17')]['id']:0x0);if(_0x2f56fa[_0x4db8('0x15')][_0x3da98d]){_0x2f56fa[_0x4db8('0x15')][_0x3da98d][_0x4db8('0x3b')](_0x4db8('0x3c'));}return _0x1d8ec5({'code':0xc8,'message':_0x425f84});}catch(_0x50c7f5){logger[_0x4db8('0x32')](_0x50c7f5[_0x4db8('0x37')]);return _0x456cfe(_0x335e2a['error'](0x1f4,_0x50c7f5));}}logger[_0x4db8('0x32')](_0x4db8('0x40'));return _0x456cfe(_0x335e2a[_0x4db8('0x32')](0x1f4,_0x4db8('0x40')));});},'AgentCapacity':function(_0x3a0ce2){var _0x507437=this;return new Promise(function(_0x49ad54,_0x94cd83){if(_0x2f56fa[_0x4db8('0x3a')][_0x4db8('0x41')](_0x3a0ce2['id'])){for(var _0x105877 in _0x3a0ce2['capacity']){if(_0x3a0ce2['capacity'][_0x4db8('0x41')](_0x105877)){if(_0x2f56fa[_0x4db8('0x3a')][_0x3a0ce2['id']][_0x4db8('0x41')](_0x105877+'CurrentCapacity')){_0x2f56fa[_0x4db8('0x3a')][_0x3a0ce2['id']][_0x105877+'CurrentCapacity']=parseInt(_0x3a0ce2[_0x4db8('0x42')][_0x105877],0xa);}}}_0x2f56fa[_0x4db8('0x3a')][_0x3a0ce2['id']][_0x4db8('0x43')]();return _0x49ad54({'code':0xc8,'message':_0x2f56fa[_0x4db8('0x3a')][_0x3a0ce2['id']]});}else{return _0x94cd83(_0x507437['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x596d46){return new Promise(function(_0x549d7d,_0x27e385){var _0x2bf343=_[_0x4db8('0x44')](_0x2f56fa[_0x4db8('0x3a')]);_0x549d7d({'count':_0x2bf343[_0x4db8('0x1a')],'rows':_0x2bf343});});},'ChatQueues':function(_0x340acb){return new Promise(function(_0x58f338,_0x2dc78c){var _0x451632=[];for(var _0x263213 in _0x2f56fa['chatQueues']){if(_0x2f56fa[_0x4db8('0x45')][_0x4db8('0x41')](_0x263213)){var _0x242ed8=_0x2f56fa[_0x4db8('0x45')][_0x263213];var _0x63dadb={'id':_0x242ed8['id'],'available':_0x242ed8[_0x4db8('0x46')],'loggedIn':_0x242ed8[_0x4db8('0x47')],'name':_0x242ed8[_0x4db8('0x48')],'paused':_0x242ed8[_0x4db8('0x49')],'waiting':_0x242ed8['waiting']};_0x451632[_0x4db8('0x23')](_0x63dadb);}}_0x58f338({'count':_0x451632[_0x4db8('0x1a')],'rows':_0x451632});});},'MailQueues':function(_0x521861){return new Promise(function(_0x23f140,_0x550af5){var _0x2b48a3=[];for(var _0x441830 in _0x2f56fa['mailQueues']){if(_0x2f56fa[_0x4db8('0x4a')][_0x4db8('0x41')](_0x441830)){var _0x198d5b=_0x2f56fa[_0x4db8('0x4a')][_0x441830];var _0x1220c7={'id':_0x198d5b['id'],'available':_0x198d5b[_0x4db8('0x46')],'loggedIn':_0x198d5b['loggedIn'],'name':_0x198d5b[_0x4db8('0x48')],'paused':_0x198d5b[_0x4db8('0x49')],'waiting':_0x198d5b['waiting']};_0x2b48a3[_0x4db8('0x23')](_0x1220c7);}}_0x23f140({'count':_0x2b48a3[_0x4db8('0x1a')],'rows':_0x2b48a3});});},'OpenchannelQueues':function(_0x21445d){return new Promise(function(_0x2097b6,_0x20eea7){var _0x1629c6=[];for(var _0x3dd1d9 in _0x2f56fa[_0x4db8('0x4b')]){if(_0x2f56fa[_0x4db8('0x4b')]['hasOwnProperty'](_0x3dd1d9)){var _0x5461cd=_0x2f56fa['openchannelQueues'][_0x3dd1d9];var _0x435b23={'id':_0x5461cd['id'],'available':_0x5461cd[_0x4db8('0x46')],'loggedIn':_0x5461cd[_0x4db8('0x47')],'name':_0x5461cd[_0x4db8('0x48')],'paused':_0x5461cd[_0x4db8('0x49')],'waiting':_0x5461cd['waiting']};_0x1629c6[_0x4db8('0x23')](_0x435b23);}}_0x2097b6({'count':_0x1629c6[_0x4db8('0x1a')],'rows':_0x1629c6});});},'SmsQueues':function(_0x1e001b){return new Promise(function(_0x78d68e,_0x12be02){var _0xbfaf31=[];for(var _0x19ed10 in _0x2f56fa[_0x4db8('0x4c')]){if(_0x2f56fa['smsQueues'][_0x4db8('0x41')](_0x19ed10)){var _0x547e62=_0x2f56fa[_0x4db8('0x4c')][_0x19ed10];var _0x1cf273={'id':_0x547e62['id'],'available':_0x547e62[_0x4db8('0x46')],'loggedIn':_0x547e62[_0x4db8('0x47')],'name':_0x547e62[_0x4db8('0x48')],'paused':_0x547e62[_0x4db8('0x49')],'waiting':_0x547e62[_0x4db8('0x4d')]};_0xbfaf31[_0x4db8('0x23')](_0x1cf273);}}_0x78d68e({'count':_0xbfaf31[_0x4db8('0x1a')],'rows':_0xbfaf31});});},'FaxQueues':function(_0xa0785d){return new Promise(function(_0x2ccec1,_0x55db64){var _0x33206d=[];for(var _0x18f931 in _0x2f56fa['faxQueues']){if(_0x2f56fa[_0x4db8('0x4e')][_0x4db8('0x41')](_0x18f931)){var _0x2bcde2=_0x2f56fa[_0x4db8('0x4e')][_0x18f931];var _0x126f8d={'id':_0x2bcde2['id'],'available':_0x2bcde2[_0x4db8('0x46')],'loggedIn':_0x2bcde2[_0x4db8('0x47')],'name':_0x2bcde2[_0x4db8('0x48')],'paused':_0x2bcde2[_0x4db8('0x49')],'waiting':_0x2bcde2[_0x4db8('0x4d')]};_0x33206d[_0x4db8('0x23')](_0x126f8d);}}_0x2ccec1({'count':_0x33206d[_0x4db8('0x1a')],'rows':_0x33206d});});},'WhatsappQueues':function(_0x5633b6){return new Promise(function(_0x3063b2,_0x1616bb){var _0x3036dc=[];for(var _0x278b25 in _0x2f56fa[_0x4db8('0x4f')]){if(_0x2f56fa[_0x4db8('0x4f')][_0x4db8('0x41')](_0x278b25)){var _0x3d1712=_0x2f56fa['whatsappQueues'][_0x278b25];var _0x66382={'id':_0x3d1712['id'],'available':_0x3d1712[_0x4db8('0x46')],'loggedIn':_0x3d1712[_0x4db8('0x47')],'name':_0x3d1712[_0x4db8('0x48')],'paused':_0x3d1712[_0x4db8('0x49')],'waiting':_0x3d1712[_0x4db8('0x4d')]};_0x3036dc[_0x4db8('0x23')](_0x66382);}}_0x3063b2({'count':_0x3036dc[_0x4db8('0x1a')],'rows':_0x3036dc});});},'ChatQueuesWaitingInteractions':function(_0x4eb8f6){return new Promise(function(_0x142896,_0xeac85a){var _0x190800=_[_0x4db8('0x44')](_0x2f56fa['chatQueuesWaitingInteractions']);_0x142896({'count':_0x190800[_0x4db8('0x1a')],'rows':_0x190800});});},'MailQueuesWaitingInteractions':function(_0x1f4154){return new Promise(function(_0x17b307,_0x56547c){var _0x5db530=_[_0x4db8('0x44')](_0x2f56fa[_0x4db8('0x50')]);_0x17b307({'count':_0x5db530[_0x4db8('0x1a')],'rows':_0x5db530});});},'OpenchannelQueuesWaitingInteractions':function(_0x36470a){return new Promise(function(_0x5982fc,_0x476fa2){var _0x2d21ff=_[_0x4db8('0x44')](_0x2f56fa[_0x4db8('0x51')]);_0x5982fc({'count':_0x2d21ff[_0x4db8('0x1a')],'rows':_0x2d21ff});});},'SmsQueuesWaitingInteractions':function(_0x11dc46){return new Promise(function(_0x891823,_0x19e4f2){var _0x4a5ca1=_[_0x4db8('0x44')](_0x2f56fa[_0x4db8('0x52')]);_0x891823({'count':_0x4a5ca1[_0x4db8('0x1a')],'rows':_0x4a5ca1});});},'FaxQueuesWaitingInteractions':function(_0x540fec){return new Promise(function(_0x5708df,_0x434a08){var _0x51362d=_[_0x4db8('0x44')](_0x2f56fa[_0x4db8('0x53')]);_0x5708df({'count':_0x51362d[_0x4db8('0x1a')],'rows':_0x51362d});});},'WhatsappQueuesWaitingInteractions':function(_0x27cef7){return new Promise(function(_0x5c0346,_0x1cbcf8){var _0x1d894e=_['values'](_0x2f56fa[_0x4db8('0x54')]);_0x5c0346({'count':_0x1d894e['length'],'rows':_0x1d894e});});}};var _0x21dd23=jayson[_0x4db8('0x55')](_0x357c4c)[_0x4db8('0x56')]();_0x21dd23['on'](_0x4db8('0x32'),function(_0x291f83){logger[_0x4db8('0x32')](JSON[_0x4db8('0x35')](_0x291f83));return _0x149c2b(_0x291f83);});_0x21dd23[_0x4db8('0x14')](0x232c,_0x4db8('0x57'),function(){console[_0x4db8('0x58')](_0x4db8('0x59'),0x232c);return _0x3c064b(_0x4db8('0x5a')+0x232c);});});};
\ No newline at end of file
+var _0x0102=['hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','name','paused','waiting','mailQueues','loggedIn','openchannelQueues','smsQueues','faxQueues','whatsappQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','bluebird','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','push','slice','dialogflow','appdata','split','dialogflowv2','TagId','format','%s:%s:%s','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','stack','message\x20is\x20empty','busyQueue'];(function(_0x559c93,_0x537220){var _0x11a162=function(_0x49fa76){while(--_0x49fa76){_0x559c93['push'](_0x559c93['shift']());}};_0x11a162(++_0x537220);}(_0x0102,0x186));var _0x2010=function(_0x435e35,_0xd784ab){_0x435e35=_0x435e35-0x0;var _0x4723af=_0x0102[_0x435e35];return _0x4723af;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var path=require(_0x2010('0x1'));var fs=require('fs');var jayson=require(_0x2010('0x2'));var BPromise=require(_0x2010('0x3'));var uuid=require('uuid');var config=require('../../../config/environment');var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x2010('0x4')),'chatQueueReport':require(_0x2010('0x5')),'smsQueueReport':require(_0x2010('0x6')),'faxQueueReport':require(_0x2010('0x7')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x2010('0x8'));function getId(_0x495d98,_0x4728c0,_0x160e41){return util['format'](_0x2010('0x9'),_0x495d98,_0x4728c0||0x0,_0x160e41||0x0);}function getIntervals(_0x3c2d98,_0x3d34d4){var _0x3acdbb=[];if(!_[_0x2010('0xa')](_0x3d34d4[_0x2010('0xb')])&&!_[_0x2010('0xa')](_0x3c2d98[_0x3d34d4[_0x2010('0xb')]])&&!_[_0x2010('0xa')](_0x3c2d98[_0x3d34d4[_0x2010('0xb')]][_0x2010('0xc')])){_0x3acdbb=_[_0x2010('0xd')](_0x3c2d98[_0x3d34d4[_0x2010('0xb')]][_0x2010('0xc')],_0x2010('0xe'));}else if(!_[_0x2010('0xa')](_0x3d34d4['interval'])){_0x3acdbb=[_0x3d34d4['interval']];}return _0x3acdbb;}exports[_0x2010('0xf')]=function(_0x385720){_0x385720[_0x2010('0x10')]={};return new BPromise(function(_0x10b587,_0x32d791){var _0x335be4={'Start':function(_0x517ff4){var _0x3195fa=this;return new Promise(function(_0x136418,_0x5ad412){if(_0x517ff4){try{var _0x41e267=[];var _0x11c94b=getId(_0x517ff4[_0x2010('0x11')],_0x517ff4[_0x2010('0x12')]?_0x517ff4[_0x2010('0x12')]['id']:0x0,_0x517ff4[_0x2010('0x13')]?_0x517ff4[_0x2010('0x13')]['id']:0x0);if(_0x517ff4[_0x2010('0x14')]&&_[_0x2010('0x15')](_0x517ff4['applications'])&&_0x517ff4['applications'][_0x2010('0x16')]){for(var _0x38a15a=0x0;_0x38a15a<_0x517ff4[_0x2010('0x14')][_0x2010('0x16')];_0x38a15a+=0x1){var _0x569a79=_0x517ff4['applications'][_0x38a15a];if(fs[_0x2010('0x17')](path[_0x2010('0x18')](__dirname,_0x2010('0x14'),_0x569a79[_0x2010('0x19')]+_0x2010('0x1a')))){var _0x131a26=[];switch(_0x569a79['app'][_0x2010('0x1b')]()){case _0x2010('0x1c'):var _0x58ff30=_0x569a79['appdata']['split'](',');if(_0x517ff4[_0x2010('0x11')]==='mail'){_0x131a26[_0x2010('0x1d')](_0x58ff30[0x0]);_0x131a26['push'](_0x58ff30[0x1]);_0x131a26['push'](_0x58ff30[_0x2010('0x1e')](0x2,_0x58ff30[_0x2010('0x16')])['join'](','));}else{_0x131a26[_0x2010('0x1d')](_0x58ff30[0x0]);_0x131a26['push'](_0x58ff30[_0x2010('0x1e')](0x1,_0x58ff30[_0x2010('0x16')])[_0x2010('0x18')](','));}break;case _0x2010('0x1f'):var _0x3c5862=_0x569a79[_0x2010('0x20')][_0x2010('0x21')](',');_0x131a26[_0x2010('0x1d')](_0x3c5862[0x0]);_0x131a26[_0x2010('0x1d')](_0x3c5862[0x1]);_0x131a26[_0x2010('0x1d')](_0x3c5862[_0x2010('0x1e')](0x2,_0x3c5862[_0x2010('0x16')])['join'](','));break;case _0x2010('0x22'):var _0x52fe5e=_0x569a79[_0x2010('0x20')][_0x2010('0x21')](',');_0x131a26[_0x2010('0x1d')](_0x52fe5e[0x0]);_0x131a26[_0x2010('0x1d')](_0x52fe5e[0x1]);_0x131a26['push'](_0x52fe5e[0x2]);_0x131a26['push'](_0x52fe5e[0x3]);_0x131a26[_0x2010('0x1d')](_0x52fe5e['slice'](0x4,_0x52fe5e[_0x2010('0x16')])[_0x2010('0x18')](','));break;case'amazonlex':var _0xe5fd24=_0x569a79[_0x2010('0x20')][_0x2010('0x21')](',');_0x131a26[_0x2010('0x1d')](_0xe5fd24[0x0]);_0x131a26[_0x2010('0x1d')](_0xe5fd24[0x1]);_0x131a26['push'](_0xe5fd24[0x2]);_0x131a26[_0x2010('0x1d')](_0xe5fd24[0x3]);_0x131a26[_0x2010('0x1d')](_0xe5fd24[_0x2010('0x1e')](0x4,_0xe5fd24['length'])['join'](','));break;case _0x2010('0x12'):_0x131a26[_0x2010('0x1d')](_0x569a79[_0x2010('0x20')]);break;case'tag':_0x131a26['push'](_0x569a79[_0x2010('0x23')]);_0x131a26[_0x2010('0x1d')](_0x569a79[_0x2010('0x20')]);break;default:_0x131a26=_[_0x2010('0xa')](_0x569a79[_0x2010('0x20')])?[]:_0x569a79['appdata']['split'](',');}var _0x554c5e={'id':util[_0x2010('0x24')](_0x2010('0x25'),_0x11c94b,_0x569a79['id'],_0x569a79[_0x2010('0x19')]),'condition':require('./interval')[_0x2010('0x26')](_0x11c94b,getIntervals(_0x385720[_0x2010('0x27')],_0x569a79),_0x385720),'consequence':require(_0x2010('0x28')+_0x569a79[_0x2010('0x19')])['consequence'](_0x11c94b,_0x131a26,_0x385720,_0x517ff4),'p':_0x569a79[_0x2010('0x29')]||0x0};logger[_0x2010('0x2a')](_0x2010('0x2b'),_0x554c5e['id'],'on\x20interval',getIntervals(_0x385720[_0x2010('0x27')],_0x569a79)['join'](_0x2010('0x2c')));_0x41e267[_0x2010('0x1d')](_0x554c5e);}else{logger[_0x2010('0x2d')](_0x2010('0x2e'),path[_0x2010('0x18')](__dirname,_0x2010('0x14'),_0x569a79['app']+_0x2010('0x1a')));}}_0x385720['rules'][_0x11c94b]=new RuleEngine(_0x41e267);_0x385720[_0x2010('0x10')][_0x11c94b][_0x2010('0x2f')](_0x517ff4,function(_0x236a04){logger[_0x2010('0x2a')](_0x2010('0x30'),JSON[_0x2010('0x31')](_0x236a04[_0x2010('0x32')]));if(_0x385720[_0x2010('0x10')][_0x11c94b]){_0x385720[_0x2010('0x10')][_0x11c94b][_0x2010('0x33')](_0x2010('0x34'));}});return _0x136418({'code':0xc8,'message':_0x517ff4});}else{logger[_0x2010('0x2a')](_0x2010('0x35'));return _0x136418({'code':0xc8,'message':_0x517ff4});}}catch(_0x223fd0){logger['error'](_0x223fd0['stack']);return _0x5ad412(_0x3195fa[_0x2010('0x2d')](0x1f4,_0x223fd0));}}return _0x5ad412(_0x2010('0x36'));});},'AcceptMessage':function(_0x31af67){var _0x35d631=this;return new Promise(function(_0x3d5906,_0x5a38ee){if(_0x31af67[_0x2010('0x37')]&&_0x31af67['agent']['id']){if(_0x385720[_0x2010('0x38')][_0x31af67['agent']['id']]){_0x385720[_0x2010('0x38')][_0x31af67[_0x2010('0x37')]['id']][_0x2010('0x39')]=![];_0x385720[_0x2010('0x38')][_0x31af67[_0x2010('0x37')]['id']]['busyQueue']=undefined;}}if(_0x31af67[_0x2010('0x12')]&&_0x31af67[_0x2010('0x12')]['id']){try{var _0x3dd83c=getId(_0x31af67[_0x2010('0x11')],_0x31af67['message']?_0x31af67[_0x2010('0x12')]['id']:0x0,_0x31af67['interaction']?_0x31af67['interaction']['id']:0x0);if(_0x385720['rules'][_0x3dd83c]){_0x385720[_0x2010('0x10')][_0x3dd83c][_0x2010('0x33')](_0x2010('0x3a'));if(rpc[_0x31af67[_0x2010('0x11')]+_0x2010('0x3b')]){rpc[_0x31af67[_0x2010('0x11')]+'QueueReport'][_0x2010('0x3c')](_0x3dd83c,{'UserId':_0x31af67[_0x2010('0x12')][_0x2010('0x3d')]})['catch'](function(_0x5d6e2c){logger[_0x2010('0x2d')]('error\x20update\x20queue\x20report');});}}return _0x3d5906({'code':0xc8,'message':_0x31af67});}catch(_0x31ff4c){logger[_0x2010('0x2d')](_0x31ff4c[_0x2010('0x3e')]);return _0x5a38ee(_0x35d631[_0x2010('0x2d')](0x1f4,_0x31ff4c));}}logger['error'](_0x2010('0x3f'));return _0x5a38ee(_0x35d631[_0x2010('0x2d')](0x1f4,_0x2010('0x3f')));});},'RejectMessage':function(_0x231db7){var _0x3ec24c=this;return new Promise(function(_0x2a53b3,_0x5c1b19){if(_0x231db7[_0x2010('0x37')]&&_0x231db7[_0x2010('0x37')]['id']){try{if(_0x385720[_0x2010('0x38')][_0x231db7['agent']['id']]){_0x385720[_0x2010('0x38')][_0x231db7[_0x2010('0x37')]['id']]['busy']=![];_0x385720[_0x2010('0x38')][_0x231db7[_0x2010('0x37')]['id']][_0x2010('0x40')]=undefined;}return _0x2a53b3({'code':0xc8,'message':_0x231db7});}catch(_0x242274){logger[_0x2010('0x2d')](_0x242274[_0x2010('0x3e')]);return _0x5c1b19(_0x3ec24c[_0x2010('0x2d')](0x1f4,_0x242274));}}logger[_0x2010('0x2d')]('message\x20is\x20empty');return _0x5c1b19(_0x3ec24c['error'](0x1f4,_0x2010('0x3f')));});},'AbandonInteraction':function(_0xe1721f){var _0x5397f4=this;return new Promise(function(_0x422b3c,_0x46776b){if(_0xe1721f[_0x2010('0x11')]&&_0xe1721f[_0x2010('0x13')]&&_0xe1721f[_0x2010('0x13')]['id']){try{var _0x506943=getId(_0xe1721f['channel'],_0xe1721f[_0x2010('0x12')]?_0xe1721f[_0x2010('0x12')]['id']:0x0,_0xe1721f[_0x2010('0x13')]?_0xe1721f[_0x2010('0x13')]['id']:0x0);if(_0x385720[_0x2010('0x10')][_0x506943]){_0x385720[_0x2010('0x10')][_0x506943][_0x2010('0x33')](_0x2010('0x3a'));}return _0x422b3c({'code':0xc8,'message':_0xe1721f});}catch(_0x279c80){logger[_0x2010('0x2d')](_0x279c80[_0x2010('0x3e')]);return _0x46776b(_0x5397f4['error'](0x1f4,_0x279c80));}}logger[_0x2010('0x2d')](_0x2010('0x3f'));return _0x46776b(_0x5397f4['error'](0x1f4,_0x2010('0x3f')));});},'AgentCapacity':function(_0x43d529){var _0x2e5f24=this;return new Promise(function(_0x22e553,_0x778ea6){if(_0x385720[_0x2010('0x38')][_0x2010('0x41')](_0x43d529['id'])){for(var _0x2fba22 in _0x43d529[_0x2010('0x42')]){if(_0x43d529[_0x2010('0x42')][_0x2010('0x41')](_0x2fba22)){if(_0x385720[_0x2010('0x38')][_0x43d529['id']][_0x2010('0x41')](_0x2fba22+_0x2010('0x43'))){_0x385720[_0x2010('0x38')][_0x43d529['id']][_0x2fba22+_0x2010('0x43')]=parseInt(_0x43d529[_0x2010('0x42')][_0x2fba22],0xa);}}}_0x385720[_0x2010('0x38')][_0x43d529['id']][_0x2010('0x44')]();return _0x22e553({'code':0xc8,'message':_0x385720[_0x2010('0x38')][_0x43d529['id']]});}else{return _0x778ea6(_0x2e5f24[_0x2010('0x2d')](0x1f4,_0x2010('0x45')));}});},'Agents':function(_0x656253){return new Promise(function(_0x5a31f7,_0x1a9ed0){var _0x4aaa74=_['values'](_0x385720[_0x2010('0x38')]);_0x5a31f7({'count':_0x4aaa74[_0x2010('0x16')],'rows':_0x4aaa74});});},'ChatQueues':function(_0x4fb5d5){return new Promise(function(_0x4d124e,_0x268543){var _0xf0cfce=[];for(var _0x63ae67 in _0x385720['chatQueues']){if(_0x385720[_0x2010('0x46')][_0x2010('0x41')](_0x63ae67)){var _0x343687=_0x385720[_0x2010('0x46')][_0x63ae67];var _0x4b4145={'id':_0x343687['id'],'available':_0x343687[_0x2010('0x47')],'loggedIn':_0x343687['loggedIn'],'name':_0x343687[_0x2010('0x48')],'paused':_0x343687[_0x2010('0x49')],'waiting':_0x343687[_0x2010('0x4a')]};_0xf0cfce[_0x2010('0x1d')](_0x4b4145);}}_0x4d124e({'count':_0xf0cfce['length'],'rows':_0xf0cfce});});},'MailQueues':function(_0x51e15b){return new Promise(function(_0x444793,_0x126be7){var _0x5e77e2=[];for(var _0x487d13 in _0x385720[_0x2010('0x4b')]){if(_0x385720[_0x2010('0x4b')][_0x2010('0x41')](_0x487d13)){var _0xcce231=_0x385720['mailQueues'][_0x487d13];var _0x5cf608={'id':_0xcce231['id'],'available':_0xcce231['available'],'loggedIn':_0xcce231[_0x2010('0x4c')],'name':_0xcce231[_0x2010('0x48')],'paused':_0xcce231[_0x2010('0x49')],'waiting':_0xcce231[_0x2010('0x4a')]};_0x5e77e2['push'](_0x5cf608);}}_0x444793({'count':_0x5e77e2[_0x2010('0x16')],'rows':_0x5e77e2});});},'OpenchannelQueues':function(_0x31d8be){return new Promise(function(_0x478b8e,_0x3841fa){var _0x3a608e=[];for(var _0x23c7d9 in _0x385720[_0x2010('0x4d')]){if(_0x385720[_0x2010('0x4d')][_0x2010('0x41')](_0x23c7d9)){var _0x548273=_0x385720[_0x2010('0x4d')][_0x23c7d9];var _0x3f60e4={'id':_0x548273['id'],'available':_0x548273[_0x2010('0x47')],'loggedIn':_0x548273[_0x2010('0x4c')],'name':_0x548273[_0x2010('0x48')],'paused':_0x548273['paused'],'waiting':_0x548273[_0x2010('0x4a')]};_0x3a608e[_0x2010('0x1d')](_0x3f60e4);}}_0x478b8e({'count':_0x3a608e[_0x2010('0x16')],'rows':_0x3a608e});});},'SmsQueues':function(_0x5f5230){return new Promise(function(_0x5ca75a,_0x24466f){var _0x16c583=[];for(var _0x38a37b in _0x385720[_0x2010('0x4e')]){if(_0x385720[_0x2010('0x4e')][_0x2010('0x41')](_0x38a37b)){var _0x57c0f7=_0x385720[_0x2010('0x4e')][_0x38a37b];var _0xd6a734={'id':_0x57c0f7['id'],'available':_0x57c0f7[_0x2010('0x47')],'loggedIn':_0x57c0f7['loggedIn'],'name':_0x57c0f7[_0x2010('0x48')],'paused':_0x57c0f7[_0x2010('0x49')],'waiting':_0x57c0f7[_0x2010('0x4a')]};_0x16c583['push'](_0xd6a734);}}_0x5ca75a({'count':_0x16c583[_0x2010('0x16')],'rows':_0x16c583});});},'FaxQueues':function(_0x22f654){return new Promise(function(_0x4adc1c,_0x493c89){var _0x30b13d=[];for(var _0x487d55 in _0x385720['faxQueues']){if(_0x385720[_0x2010('0x4f')][_0x2010('0x41')](_0x487d55)){var _0x1e1fb7=_0x385720[_0x2010('0x4f')][_0x487d55];var _0x3499fa={'id':_0x1e1fb7['id'],'available':_0x1e1fb7[_0x2010('0x47')],'loggedIn':_0x1e1fb7[_0x2010('0x4c')],'name':_0x1e1fb7[_0x2010('0x48')],'paused':_0x1e1fb7[_0x2010('0x49')],'waiting':_0x1e1fb7[_0x2010('0x4a')]};_0x30b13d['push'](_0x3499fa);}}_0x4adc1c({'count':_0x30b13d[_0x2010('0x16')],'rows':_0x30b13d});});},'WhatsappQueues':function(_0x1c1373){return new Promise(function(_0x5a1a8e,_0x449295){var _0x151ced=[];for(var _0xd515c9 in _0x385720[_0x2010('0x50')]){if(_0x385720['whatsappQueues'][_0x2010('0x41')](_0xd515c9)){var _0x2a5cb3=_0x385720['whatsappQueues'][_0xd515c9];var _0x4d22c5={'id':_0x2a5cb3['id'],'available':_0x2a5cb3[_0x2010('0x47')],'loggedIn':_0x2a5cb3['loggedIn'],'name':_0x2a5cb3[_0x2010('0x48')],'paused':_0x2a5cb3[_0x2010('0x49')],'waiting':_0x2a5cb3[_0x2010('0x4a')]};_0x151ced[_0x2010('0x1d')](_0x4d22c5);}}_0x5a1a8e({'count':_0x151ced[_0x2010('0x16')],'rows':_0x151ced});});},'ChatQueuesWaitingInteractions':function(_0x294288){return new Promise(function(_0x381c5c,_0x5dd0d6){var _0x27a23e=_[_0x2010('0x51')](_0x385720[_0x2010('0x52')]);_0x381c5c({'count':_0x27a23e['length'],'rows':_0x27a23e});});},'MailQueuesWaitingInteractions':function(_0x421016){return new Promise(function(_0x340a20,_0x13d7ff){var _0x44604d=_[_0x2010('0x51')](_0x385720[_0x2010('0x53')]);_0x340a20({'count':_0x44604d[_0x2010('0x16')],'rows':_0x44604d});});},'OpenchannelQueuesWaitingInteractions':function(_0x120c26){return new Promise(function(_0x4e3692,_0x459ddf){var _0x42f536=_[_0x2010('0x51')](_0x385720['openchannelQueuesWaitingInteractions']);_0x4e3692({'count':_0x42f536[_0x2010('0x16')],'rows':_0x42f536});});},'SmsQueuesWaitingInteractions':function(_0x9f414d){return new Promise(function(_0x490483,_0x43896e){var _0x10f81c=_[_0x2010('0x51')](_0x385720[_0x2010('0x54')]);_0x490483({'count':_0x10f81c[_0x2010('0x16')],'rows':_0x10f81c});});},'FaxQueuesWaitingInteractions':function(_0x543db2){return new Promise(function(_0xe2c487,_0x31e669){var _0x57201d=_[_0x2010('0x51')](_0x385720[_0x2010('0x55')]);_0xe2c487({'count':_0x57201d['length'],'rows':_0x57201d});});},'WhatsappQueuesWaitingInteractions':function(_0xdc9f3c){return new Promise(function(_0x5781ca,_0x4df54c){var _0x44e47e=_[_0x2010('0x51')](_0x385720[_0x2010('0x56')]);_0x5781ca({'count':_0x44e47e[_0x2010('0x16')],'rows':_0x44e47e});});}};var _0x2d6d50=jayson[_0x2010('0x57')](_0x335be4)['http']();_0x2d6d50['on'](_0x2010('0x2d'),function(_0x881954){logger[_0x2010('0x2d')](JSON[_0x2010('0x31')](_0x881954));return _0x32d791(_0x881954);});_0x2d6d50['listen'](0x232c,_0x2010('0x58'),function(){console['log'](_0x2010('0x59'),0x232c);return _0x10b587(_0x2010('0x5a')+0x232c);});});};
\ No newline at end of file
index e1092ff..8a8bd21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ffd=['stop','util','bluebird','jayson/promise','client','http','request','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log'];(function(_0x35cbbc,_0x43d036){var _0x5970ef=function(_0x5d0cec){while(--_0x5d0cec){_0x35cbbc['push'](_0x35cbbc['shift']());}};_0x5970ef(++_0x43d036);}(_0x2ffd,0x97));var _0xd2ff=function(_0x2bda53,_0x4b351e){_0x2bda53=_0x2bda53-0x0;var _0x265647=_0x2ffd[_0x2bda53];return _0x265647;};'use strict';var util=require(_0xd2ff('0x0'));var BPromise=require(_0xd2ff('0x1'));var jayson=require(_0xd2ff('0x2'));var _=require('lodash');var logger=require('../../../config/logger')('routing');var client=jayson[_0xd2ff('0x3')][_0xd2ff('0x4')]({'port':0x232a});function request(_0x438788,_0x4e6fb6){return new BPromise(function(_0x3e5d3e,_0x38edd8){return client[_0xd2ff('0x5')](_0x438788,_0x4e6fb6)[_0xd2ff('0x6')](function(_0xd331ea){if(_0xd331ea[_0xd2ff('0x7')]){return _0x38edd8(_0xd331ea[_0xd2ff('0x7')][_0xd2ff('0x8')]);}else{return _0x3e5d3e(_0xd331ea[_0xd2ff('0x9')]);}})[_0xd2ff('0xa')](function(_0x33fe7b){return _0x38edd8(_0x33fe7b);});});}exports[_0xd2ff('0xb')]=function(_0x188cc2,_0x23ffb1,_0x365952){return function(_0x4ff74b){if(_0x365952[_0xd2ff('0xc')]&&!_0x365952[_0xd2ff('0xc')][_0x188cc2]){logger[_0xd2ff('0xd')](_0xd2ff('0xe'),_0x188cc2);return _0x4ff74b['stop']();}var _0x43c8ac=[];for(var _0x44f239=0x0;_0x44f239<_0x23ffb1[_0xd2ff('0xf')];_0x44f239+=0x1){_0x43c8ac['push'](request(_0xd2ff('0x10'),{'command':util[_0xd2ff('0x11')](_0xd2ff('0x12'),_0x23ffb1[_0x44f239])})[_0xd2ff('0x6')](function(_0x4c9740){return _0x4c9740&&_0x4c9740[_0xd2ff('0x8')]&&_0x4c9740['message'][_0xd2ff('0x13')](_0xd2ff('0x14'))>=0x0?!![]:![];})['catch'](function(_0x46d535){logger[_0xd2ff('0x7')](_0xd2ff('0x15'),_0x188cc2,_0x23ffb1[_0x44f239]);}));}BPromise[_0xd2ff('0x16')](_0x43c8ac)['then'](function(_0x1f0a88){var _0x53d7c4=_[_0xd2ff('0x17')](_0x1f0a88);logger[_0xd2ff('0xd')](_0xd2ff('0x18'),_0x188cc2,_0x23ffb1[_0xd2ff('0x19')](_0xd2ff('0x1a')),_0x53d7c4);_0x4ff74b[_0xd2ff('0x1b')](_0x53d7c4);})[_0xd2ff('0xa')](function(_0x56d4c0){console[_0xd2ff('0x1c')](_0x56d4c0);logger[_0xd2ff('0x7')](_0xd2ff('0x18'),_0x188cc2,_0x23ffb1[_0xd2ff('0x19')](_0xd2ff('0x1a')),_0x56d4c0['stack']);_0x4ff74b[_0xd2ff('0x1d')]();});};};
\ No newline at end of file
+var _0xe149=['client','http','request','then','error','message','result','catch','condition','rules','info','stop','length','Command','format','iftime\x20%s','indexOf','true','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','util','bluebird','jayson/promise','lodash','routing'];(function(_0x1285c3,_0x428ce9){var _0x5bfce9=function(_0x3b49bd){while(--_0x3b49bd){_0x1285c3['push'](_0x1285c3['shift']());}};_0x5bfce9(++_0x428ce9);}(_0xe149,0x73));var _0x9e14=function(_0x450272,_0x21b29e){_0x450272=_0x450272-0x0;var _0x3819f2=_0xe149[_0x450272];return _0x3819f2;};'use strict';var util=require(_0x9e14('0x0'));var BPromise=require(_0x9e14('0x1'));var jayson=require(_0x9e14('0x2'));var _=require(_0x9e14('0x3'));var logger=require('../../../config/logger')(_0x9e14('0x4'));var client=jayson[_0x9e14('0x5')][_0x9e14('0x6')]({'port':0x232a});function request(_0x5d1e70,_0x177cd9){return new BPromise(function(_0x4308f0,_0xd13e73){return client[_0x9e14('0x7')](_0x5d1e70,_0x177cd9)[_0x9e14('0x8')](function(_0x5b0b96){if(_0x5b0b96['error']){return _0xd13e73(_0x5b0b96[_0x9e14('0x9')][_0x9e14('0xa')]);}else{return _0x4308f0(_0x5b0b96[_0x9e14('0xb')]);}})[_0x9e14('0xc')](function(_0x3aadb3){return _0xd13e73(_0x3aadb3);});});}exports[_0x9e14('0xd')]=function(_0x2de6b2,_0x59841c,_0x5df147){return function(_0x2bcfaf){if(_0x5df147[_0x9e14('0xe')]&&!_0x5df147[_0x9e14('0xe')][_0x2de6b2]){logger[_0x9e14('0xf')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x2de6b2);return _0x2bcfaf[_0x9e14('0x10')]();}var _0x31147a=[];for(var _0x270445=0x0;_0x270445<_0x59841c[_0x9e14('0x11')];_0x270445+=0x1){_0x31147a['push'](request(_0x9e14('0x12'),{'command':util[_0x9e14('0x13')](_0x9e14('0x14'),_0x59841c[_0x270445])})[_0x9e14('0x8')](function(_0x5b20d3){return _0x5b20d3&&_0x5b20d3[_0x9e14('0xa')]&&_0x5b20d3[_0x9e14('0xa')][_0x9e14('0x15')](_0x9e14('0x16'))>=0x0?!![]:![];})['catch'](function(_0xc760bc){logger[_0x9e14('0x9')]('[%s][INTERVAL]\x20%s',_0x2de6b2,_0x59841c[_0x270445]);}));}BPromise[_0x9e14('0x17')](_0x31147a)[_0x9e14('0x8')](function(_0x4cdd4b){var _0x2e789d=_[_0x9e14('0x18')](_0x4cdd4b);logger['info'](_0x9e14('0x19'),_0x2de6b2,_0x59841c[_0x9e14('0x1a')](_0x9e14('0x1b')),_0x2e789d);_0x2bcfaf['when'](_0x2e789d);})[_0x9e14('0xc')](function(_0x2ab2d7){console[_0x9e14('0x1c')](_0x2ab2d7);logger['error'](_0x9e14('0x19'),_0x2de6b2,_0x59841c[_0x9e14('0x1a')]('\x20|\x20'),_0x2ab2d7[_0x9e14('0x1d')]);_0x2bcfaf[_0x9e14('0x10')]();});};};
\ No newline at end of file
index 2a308f3..74d3776 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x80ed=['secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','clone','calleridname','hangup','[%s][agents][hangup]','timeout','cause','rejected','indexOf','splice','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','agent','lodash','./utils','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','[%s][agents][agentcalled]','agentcalledAt','called','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfererexten','transfereeuniqueid','agententerreason'];(function(_0x42f94d,_0x515205){var _0x38e5ff=function(_0x5b3fc5){while(--_0x5b3fc5){_0x42f94d['push'](_0x42f94d['shift']());}};_0x38e5ff(++_0x515205);}(_0x80ed,0x11c));var _0xd80e=function(_0x2b9ccd,_0xffd840){_0x2b9ccd=_0x2b9ccd-0x0;var _0xd017af=_0x80ed[_0x2b9ccd];return _0xd017af;};'use strict';var _=require(_0xd80e('0x0'));var util=require('util');var utils=require(_0xd80e('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x182da3,_0x4329e5){utils['info'](util[_0xd80e('0x2')](_0xd80e('0x3'),_0x182da3[_0xd80e('0x4')],_0x182da3[_0xd80e('0x5')],_0x182da3['queue'],_0x182da3[_0xd80e('0x6')],_0x182da3[_0xd80e('0x7')],_0x182da3[_0xd80e('0x8')],_0x182da3['connectedlinenum'],_0x182da3[_0xd80e('0x9')]));if(_0x182da3[_0xd80e('0xa')]){utils[_0xd80e('0xb')](_0x182da3[_0xd80e('0xa')])[_0xd80e('0xc')](function(_0x298c29){if(_0x298c29){_0x182da3[_0xd80e('0xd')]=_0x298c29[_0xd80e('0xd')];_0x182da3[_0xd80e('0xe')]=_0x182da3[_0xd80e('0xf')]?_0x298c29['acw']:![];_0x182da3[_0xd80e('0x10')]=_0x182da3[_0xd80e('0xe')]?_0x298c29[_0xd80e('0x11')]:0x0;}utils[_0xd80e('0x12')](_0xd80e('0x13'),_0x182da3);});}else{utils[_0xd80e('0x12')](_0xd80e('0x13'),_0x182da3);}if(_0x4329e5){delete transfers[_0x182da3[_0xd80e('0x4')]];}else{delete agents[_0x182da3[_0xd80e('0x14')]];}}exports['agentcalled']=function(_0x5691a1){try{utils['debug'](util['format'](_0xd80e('0x15'),_0x5691a1[_0xd80e('0x4')]),_0x5691a1);agents[_0x5691a1[_0xd80e('0x14')]]=_0x5691a1;agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x16')]=utils['now']();agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x9')]=_0xd80e('0x17');agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x18')]=null;agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x19')]=null;utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x1b'),_0x5691a1[_0xd80e('0x4')],agents[_0x5691a1[_0xd80e('0x14')]][_0xd80e('0x6')],_0x5691a1['destuniqueid']));}catch(_0x39397a){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')]('[%s][agents][agentcalled]',_0x5691a1[_0xd80e('0x4')]),_0x39397a);}};exports[_0xd80e('0x1d')]=function(_0x2765ea){try{if(!_[_0xd80e('0x1e')](agents[_0x2765ea[_0xd80e('0x14')]])){utils['debug'](util['format'](_0xd80e('0x1f'),_0x2765ea[_0xd80e('0x4')]),_0x2765ea);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x20'),_0x2765ea[_0xd80e('0x4')],agents[_0x2765ea[_0xd80e('0x14')]]['membername'],_0x2765ea[_0xd80e('0x14')]));agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x1d')]=!![];agents[_0x2765ea['destuniqueid']][_0xd80e('0x21')]=utils[_0xd80e('0x22')]();agents[_0x2765ea[_0xd80e('0x14')]]['lastevent']='timeout';agents[_0x2765ea['destuniqueid']][_0xd80e('0x23')]='timeout';agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x24')]=_0x2765ea['ringtime']?parseInt(_0x2765ea[_0xd80e('0x25')])/0x3e8:0x0;agents[_0x2765ea[_0xd80e('0x14')]][_0xd80e('0x26')]=0x0;unanswered[_0xd80e('0x27')](_0x2765ea['destuniqueid']);}}catch(_0x15f317){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x1f'),_0x2765ea[_0xd80e('0x4')]),_0x15f317);}};exports[_0xd80e('0x28')]=function(_0x289685){try{_[_0xd80e('0x29')](agents,function(_0x5522dd,_0x54504e){if(_0x5522dd[_0xd80e('0x4')]==_0x289685[_0xd80e('0x4')]&&!_[_0xd80e('0x2a')](unanswered,_0x5522dd[_0xd80e('0x14')])){utils[_0xd80e('0x2b')](util[_0xd80e('0x2')]('[%s][agents][queuecallerabandon]',_0x289685['uniqueid']),_0x289685);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x2c'),_0x289685[_0xd80e('0x4')],_0x5522dd[_0xd80e('0x6')],_0x5522dd[_0xd80e('0x14')]));_0x5522dd[_0xd80e('0x1d')]=!![];_0x5522dd[_0xd80e('0x21')]=utils['now']();_0x5522dd['lastevent']=_0xd80e('0x2d');_0x5522dd[_0xd80e('0x23')]=_0xd80e('0x2d');_0x5522dd[_0xd80e('0x24')]=_0x289685[_0xd80e('0x24')];_0x5522dd[_0xd80e('0x26')]=0x0;writeDB(_0x5522dd);}});}catch(_0x17b8c7){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x2e'),_0x289685['uniqueid']),_0x17b8c7);}};exports[_0xd80e('0x2f')]=function(_0x490432){try{if(agents[_0x490432[_0xd80e('0x14')]]){utils[_0xd80e('0x2b')](util[_0xd80e('0x2')](_0xd80e('0x30'),_0x490432['uniqueid']),_0x490432);utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x31'),_0x490432['uniqueid'],agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x6')],_0x490432['destuniqueid']));agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();agents[_0x490432['destuniqueid']][_0xd80e('0x18')]=_0x490432[_0xd80e('0x18')];agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x19')]=_0x490432[_0xd80e('0x19')];agents[_0x490432[_0xd80e('0x14')]][_0xd80e('0x24')]=_0x490432[_0xd80e('0x25')];agents[_0x490432[_0xd80e('0x14')]]['lastevent']='connect';_['forIn'](agents,function(_0x161455,_0x3ff4b4){if(_0x161455['destuniqueid']!=_0x490432[_0xd80e('0x14')]&&_0x161455['uniqueid']==_0x490432[_0xd80e('0x4')]){_0x161455['talktime']=0x0;_0x161455[_0xd80e('0x24')]=_0x490432[_0xd80e('0x25')];_0x161455['agentringnoanswer']=!![];_0x161455['agentringnoanswerAt']=utils[_0xd80e('0x22')]();_0x161455[_0xd80e('0x9')]=_0xd80e('0x33');_0x161455[_0xd80e('0x23')]=_0xd80e('0x33');_0x161455[_0xd80e('0x34')]=_0x490432[_0xd80e('0x14')];_0x161455[_0xd80e('0x35')]=_0x490432[_0xd80e('0x6')];writeDB(_0x161455);}});}}catch(_0x2da5f5){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x30'),_0x490432[_0xd80e('0x4')]),_0x2da5f5);}};exports[_0xd80e('0xf')]=function(_0x7f80a){try{if(!_['isNil'](agents[_0x7f80a['destuniqueid']])){utils['debug'](util[_0xd80e('0x2')]('[%s][agents][agentcomplete]',_0x7f80a[_0xd80e('0x4')]),_0x7f80a);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x36'),_0x7f80a[_0xd80e('0x4')],agents[_0x7f80a[_0xd80e('0x14')]]['membername'],_0x7f80a['destuniqueid']));agents[_0x7f80a['destuniqueid']][_0xd80e('0xf')]=!![];agents[_0x7f80a['destuniqueid']][_0xd80e('0x37')]=utils[_0xd80e('0x22')]();agents[_0x7f80a[_0xd80e('0x14')]][_0xd80e('0x26')]=utils[_0xd80e('0x38')](agents[_0x7f80a['destuniqueid']][_0xd80e('0x37')],agents[_0x7f80a[_0xd80e('0x14')]][_0xd80e('0x32')]);agents[_0x7f80a['destuniqueid']][_0xd80e('0x23')]=_0x7f80a[_0xd80e('0x23')];agents[_0x7f80a[_0xd80e('0x14')]]['lastevent']=_0xd80e('0x39');writeDB(agents[_0x7f80a[_0xd80e('0x14')]]);}}catch(_0xf0d5aa){utils[_0xd80e('0x1c')](util[_0xd80e('0x2')](_0xd80e('0x3a'),_0x7f80a['uniqueid']),_0xf0d5aa);}};exports['blindtransfer']=function(_0x275985){try{if(!_[_0xd80e('0x1e')](agents[_0x275985[_0xd80e('0x3b')]])){utils['debug'](util['format'](_0xd80e('0x3c'),_0x275985[_0xd80e('0x4')]),_0x275985);utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x3d'),_0x275985['uniqueid'],agents[_0x275985[_0xd80e('0x3b')]]['membername'],agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x4')]));agents[_0x275985['transfereruniqueid']][_0xd80e('0x3e')]=!![];agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x3f')]=_0xd80e('0x40');agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x41')]=_0x275985[_0xd80e('0x42')];agents[_0x275985['transfereruniqueid']][_0xd80e('0x43')]=agents[_0x275985[_0xd80e('0x3b')]][_0xd80e('0x4')];}}catch(_0x4a66ca){utils['error'](util[_0xd80e('0x2')](_0xd80e('0x3c'),_0x275985[_0xd80e('0x4')]),_0x4a66ca);}};exports[_0xd80e('0x44')]=function(_0x2f66eb){try{utils[_0xd80e('0x2b')](util[_0xd80e('0x2')](_0xd80e('0x45'),_0x2f66eb['origtransfereruniqueid']),_0x2f66eb);if(_0x2f66eb[_0xd80e('0x46')]==_0x2f66eb['origtransfererlinkedid']){if(!_[_0xd80e('0x1e')](agents[_0x2f66eb[_0xd80e('0x47')]])){utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x48'),_0x2f66eb[_0xd80e('0x46')],agents[_0x2f66eb['secondtransfereruniqueid']][_0xd80e('0x6')]));agents[_0x2f66eb['secondtransfereruniqueid']][_0xd80e('0x3e')]=!![];agents[_0x2f66eb[_0xd80e('0x47')]]['transfertype']='ATTENDED';agents[_0x2f66eb[_0xd80e('0x47')]][_0xd80e('0x41')]=_0x2f66eb[_0xd80e('0x49')];agents[_0x2f66eb['secondtransfereruniqueid']]['transferuniqueid']=_0x2f66eb[_0xd80e('0x46')];}if(_0x2f66eb[_0xd80e('0x4a')]&&agents[_0x2f66eb['transfereeuniqueid']]){agents[_0x2f66eb[_0xd80e('0x4a')]][_0xd80e('0x4b')]=0x1;transfers[_0x2f66eb[_0xd80e('0x4a')]]=_['clone'](agents[_0x2f66eb[_0xd80e('0x4a')]]);transfers[_0x2f66eb['transfereeuniqueid']][_0xd80e('0x8')]=agents[_0x2f66eb[_0xd80e('0x47')]][_0xd80e('0x8')];transfers[_0x2f66eb[_0xd80e('0x4a')]]['calleridname']=agents[_0x2f66eb[_0xd80e('0x47')]]['calleridname'];transfers[_0x2f66eb[_0xd80e('0x4a')]]['agentcalledAt']=utils[_0xd80e('0x22')]();transfers[_0x2f66eb[_0xd80e('0x4a')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb['transfereeuniqueid']][_0xd80e('0x24')]=0x0;transfers[_0x2f66eb[_0xd80e('0x4a')]]['agententerreason']=0x2;}}else if(_0x2f66eb[_0xd80e('0x47')]==_0x2f66eb[_0xd80e('0x4c')]){if(!_[_0xd80e('0x1e')](agents[_0x2f66eb[_0xd80e('0x46')]])){utils['info'](util[_0xd80e('0x2')](_0xd80e('0x48'),_0x2f66eb['origtransfereruniqueid'],agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x6')]));agents[_0x2f66eb[_0xd80e('0x46')]]['transfer']=!![];agents[_0x2f66eb['origtransfereruniqueid']]['transfertype']='ATTENDED';agents[_0x2f66eb[_0xd80e('0x46')]]['transferexten']=_0x2f66eb[_0xd80e('0x4d')];agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x43')]=_0x2f66eb['secondtransfereruniqueid'];}if(_0x2f66eb[_0xd80e('0x4e')]&&agents[_0x2f66eb[_0xd80e('0x4e')]]){agents[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x4b')]=0x1;transfers[_0x2f66eb[_0xd80e('0x4e')]]=_[_0xd80e('0x4f')](agents[_0x2f66eb[_0xd80e('0x4e')]]);transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x8')]=agents[_0x2f66eb['origtransfereruniqueid']]['calleridnum'];transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x50')]=agents[_0x2f66eb[_0xd80e('0x46')]][_0xd80e('0x50')];transfers[_0x2f66eb['transfertargetuniqueid']][_0xd80e('0x16')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x32')]=utils[_0xd80e('0x22')]();transfers[_0x2f66eb['transfertargetuniqueid']][_0xd80e('0x24')]=0x0;transfers[_0x2f66eb[_0xd80e('0x4e')]][_0xd80e('0x4b')]=0x2;}}}catch(_0x1676c7){utils['error'](util[_0xd80e('0x2')](_0xd80e('0x45'),_0x2f66eb[_0xd80e('0x46')]),_0x1676c7);}};exports[_0xd80e('0x51')]=function(_0x433782){try{utils[_0xd80e('0x2b')](util['format'](_0xd80e('0x52'),_0x433782[_0xd80e('0x4')]),_0x433782);if(agents[_0x433782['uniqueid']]&&agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')]===_0xd80e('0x53')){if(_0x433782[_0xd80e('0x54')]==='21'){agents[_0x433782['uniqueid']][_0xd80e('0x23')]='rejected';agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]=_0xd80e('0x55');}utils[_0xd80e('0x1a')](util[_0xd80e('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x433782[_0xd80e('0x4')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x6')],agents[_0x433782[_0xd80e('0x4')]]['reason'],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(agents[_0x433782['uniqueid']]);var _0x2597a3=unanswered[_0xd80e('0x56')](_0x433782[_0xd80e('0x4')]);if(_0x2597a3>-0x1){unanswered[_0xd80e('0x57')](_0x2597a3,0x1);}}if(transfers[_0x433782[_0xd80e('0x4')]]){transfers[_0x433782[_0xd80e('0x4')]]['agentcomplete']=!![];transfers[_0x433782['uniqueid']][_0xd80e('0x37')]=utils['now']();transfers[_0x433782['uniqueid']][_0xd80e('0x26')]=utils[_0xd80e('0x38')](transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')],transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x32')]);transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')]='agent';transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]=_0xd80e('0x39');utils[_0xd80e('0x1a')](util['format'](_0xd80e('0x58'),_0x433782[_0xd80e('0x4')],transfers[_0x433782['uniqueid']][_0xd80e('0x6')],transfers[_0x433782[_0xd80e('0x4')]]['reason'],transfers[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(transfers[_0x433782[_0xd80e('0x4')]],!![]);}if(agents[_0x433782[_0xd80e('0x4')]]&&agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x32')]){agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0xf')]=!![];agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')]=utils['now']();agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x26')]=utils['diffTime'](agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x37')],agents[_0x433782[_0xd80e('0x4')]]['agentconnectAt']);agents[_0x433782[_0xd80e('0x4')]]['reason']=agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x3e')]?_0xd80e('0x3e'):_0xd80e('0x59');agents[_0x433782[_0xd80e('0x4')]]['lastevent']=_0xd80e('0x39');utils[_0xd80e('0x1a')](util[_0xd80e('0x2')](_0xd80e('0x58'),_0x433782[_0xd80e('0x4')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x6')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x23')],agents[_0x433782[_0xd80e('0x4')]][_0xd80e('0x9')]));writeDB(agents[_0x433782[_0xd80e('0x4')]]);}}catch(_0x31fd22){utils[_0xd80e('0x1c')](util['format'](_0xd80e('0x52'),_0x433782['uniqueid']),_0x31fd22);}};
\ No newline at end of file
+var _0x0713=['cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','complete','./utils','info','format','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','destuniqueid','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','ringtime','talktime','push','forIn','includes','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]'];(function(_0x1e9254,_0x262668){var _0xcfca7d=function(_0x56b929){while(--_0x56b929){_0x1e9254['push'](_0x1e9254['shift']());}};_0xcfca7d(++_0x262668);}(_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 utils=require(_0x3071('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2afa91,_0x27405a){utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x2afa91[_0x3071('0x3')],_0x2afa91[_0x3071('0x4')],_0x2afa91[_0x3071('0x5')],_0x2afa91[_0x3071('0x6')],_0x2afa91[_0x3071('0x7')],_0x2afa91[_0x3071('0x8')],_0x2afa91[_0x3071('0x9')],_0x2afa91[_0x3071('0xa')]));if(_0x2afa91[_0x3071('0x5')]){utils[_0x3071('0xb')](_0x2afa91[_0x3071('0x5')])[_0x3071('0xc')](function(_0x1a868e){if(_0x1a868e){_0x2afa91['type']=_0x1a868e[_0x3071('0xd')];_0x2afa91[_0x3071('0xe')]=_0x2afa91[_0x3071('0xf')]?_0x1a868e[_0x3071('0x10')]:![];_0x2afa91[_0x3071('0x11')]=_0x2afa91['agentacw']?_0x1a868e[_0x3071('0x12')]:0x0;}utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);});}else{utils[_0x3071('0x13')](_0x3071('0x14'),_0x2afa91);}if(_0x27405a){delete transfers[_0x2afa91['uniqueid']];}else{delete agents[_0x2afa91['destuniqueid']];}}exports[_0x3071('0x15')]=function(_0x5dc13b){try{utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][agentcalled]',_0x5dc13b[_0x3071('0x3')]),_0x5dc13b);agents[_0x5dc13b['destuniqueid']]=_0x5dc13b;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x18')]=utils[_0x3071('0x19')]();agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x1a');agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x9')]=null;agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x1b')]=null;utils['info'](util[_0x3071('0x2')](_0x3071('0x1c'),_0x5dc13b[_0x3071('0x3')],agents[_0x5dc13b[_0x3071('0x17')]][_0x3071('0x6')],_0x5dc13b[_0x3071('0x17')]));}catch(_0x105bbb){utils[_0x3071('0x1d')](util['format'](_0x3071('0x1e'),_0x5dc13b[_0x3071('0x3')]),_0x105bbb);}};exports[_0x3071('0x1f')]=function(_0x56c267){try{if(!_[_0x3071('0x20')](agents[_0x56c267['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x56c267);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x22'),_0x56c267[_0x3071('0x3')],agents[_0x56c267['destuniqueid']]['membername'],_0x56c267[_0x3071('0x17')]));agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x1f')]=!![];agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x23')]=utils[_0x3071('0x19')]();agents[_0x56c267[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x24');agents[_0x56c267['destuniqueid']][_0x3071('0x25')]=_0x3071('0x24');agents[_0x56c267[_0x3071('0x17')]]['holdtime']=_0x56c267[_0x3071('0x26')]?parseInt(_0x56c267[_0x3071('0x26')])/0x3e8:0x0;agents[_0x56c267[_0x3071('0x17')]][_0x3071('0x27')]=0x0;unanswered[_0x3071('0x28')](_0x56c267[_0x3071('0x17')]);}}catch(_0x177b5f){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x21'),_0x56c267[_0x3071('0x3')]),_0x177b5f);}};exports['queuecallerabandon']=function(_0x4f1484){try{_[_0x3071('0x29')](agents,function(_0x149e0d,_0x6ddf96){if(_0x149e0d[_0x3071('0x3')]==_0x4f1484[_0x3071('0x3')]&&!_[_0x3071('0x2a')](unanswered,_0x149e0d[_0x3071('0x17')])){utils[_0x3071('0x16')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484['uniqueid']),_0x4f1484);utils[_0x3071('0x1')](util[_0x3071('0x2')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x4f1484[_0x3071('0x3')],_0x149e0d[_0x3071('0x6')],_0x149e0d[_0x3071('0x17')]));_0x149e0d[_0x3071('0x1f')]=!![];_0x149e0d['agentringnoanswerAt']=utils[_0x3071('0x19')]();_0x149e0d[_0x3071('0xa')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x25')]=_0x3071('0x2b');_0x149e0d[_0x3071('0x2c')]=_0x4f1484[_0x3071('0x2c')];_0x149e0d[_0x3071('0x27')]=0x0;writeDB(_0x149e0d);}});}catch(_0x596cc3){utils[_0x3071('0x1d')](util['format']('[%s][agents][queuecallerabandon]',_0x4f1484[_0x3071('0x3')]),_0x596cc3);}};exports[_0x3071('0x2d')]=function(_0x54d9c3){try{if(agents[_0x54d9c3[_0x3071('0x17')]]){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x54d9c3);utils[_0x3071('0x1')](util['format'](_0x3071('0x2f'),_0x54d9c3[_0x3071('0x3')],agents[_0x54d9c3['destuniqueid']][_0x3071('0x6')],_0x54d9c3['destuniqueid']));agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0x30')]=utils['now']();agents[_0x54d9c3['destuniqueid']][_0x3071('0x9')]=_0x54d9c3[_0x3071('0x9')];agents[_0x54d9c3[_0x3071('0x17')]]['connectedlinename']=_0x54d9c3[_0x3071('0x1b')];agents[_0x54d9c3['destuniqueid']][_0x3071('0x2c')]=_0x54d9c3['ringtime'];agents[_0x54d9c3[_0x3071('0x17')]][_0x3071('0xa')]=_0x3071('0x31');_[_0x3071('0x29')](agents,function(_0x30ab68,_0x593c9c){if(_0x30ab68['destuniqueid']!=_0x54d9c3[_0x3071('0x17')]&&_0x30ab68[_0x3071('0x3')]==_0x54d9c3[_0x3071('0x3')]){_0x30ab68[_0x3071('0x27')]=0x0;_0x30ab68['holdtime']=_0x54d9c3[_0x3071('0x26')];_0x30ab68[_0x3071('0x1f')]=!![];_0x30ab68[_0x3071('0x23')]=utils[_0x3071('0x19')]();_0x30ab68[_0x3071('0xa')]=_0x3071('0x32');_0x30ab68['reason']=_0x3071('0x32');_0x30ab68['answeredelsewheredestinationuniqueid']=_0x54d9c3['destuniqueid'];_0x30ab68['answeredelsewheremembername']=_0x54d9c3['membername'];writeDB(_0x30ab68);}});}}catch(_0x2992e6){utils[_0x3071('0x1d')](util[_0x3071('0x2')](_0x3071('0x2e'),_0x54d9c3[_0x3071('0x3')]),_0x2992e6);}};exports[_0x3071('0xf')]=function(_0xa711b5){try{if(!_[_0x3071('0x20')](agents[_0xa711b5['destuniqueid']])){utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x33'),_0xa711b5[_0x3071('0x3')]),_0xa711b5);utils[_0x3071('0x1')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0xa711b5[_0x3071('0x3')],agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x6')],_0xa711b5[_0x3071('0x17')]));agents[_0xa711b5[_0x3071('0x17')]]['agentcomplete']=!![];agents[_0xa711b5[_0x3071('0x17')]]['agentcompleteAt']=utils[_0x3071('0x19')]();agents[_0xa711b5['destuniqueid']]['talktime']=utils[_0x3071('0x34')](agents[_0xa711b5['destuniqueid']][_0x3071('0x35')],agents[_0xa711b5['destuniqueid']][_0x3071('0x30')]);agents[_0xa711b5[_0x3071('0x17')]][_0x3071('0x25')]=_0xa711b5[_0x3071('0x25')];agents[_0xa711b5['destuniqueid']][_0x3071('0xa')]='complete';writeDB(agents[_0xa711b5[_0x3071('0x17')]]);}}catch(_0x4b6bbb){utils[_0x3071('0x1d')](util[_0x3071('0x2')]('[%s][agents][agentcomplete]',_0xa711b5[_0x3071('0x3')]),_0x4b6bbb);}};exports[_0x3071('0x36')]=function(_0x224a70){try{if(!_[_0x3071('0x20')](agents[_0x224a70[_0x3071('0x37')]])){utils[_0x3071('0x16')](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x224a70);utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x38'),_0x224a70['uniqueid'],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x6')],agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')]));agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x39')]=!![];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3a')]=_0x3071('0x3b');agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3c')]=_0x224a70[_0x3071('0x3d')];agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3e')]=agents[_0x224a70[_0x3071('0x37')]][_0x3071('0x3')];}}catch(_0x596cdd){utils['error'](util[_0x3071('0x2')]('[%s][agents][blindtransfer]',_0x224a70[_0x3071('0x3')]),_0x596cdd);}};exports[_0x3071('0x3f')]=function(_0x15c6f8){try{utils['debug'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x15c6f8);if(_0x15c6f8['origtransfereruniqueid']==_0x15c6f8[_0x3071('0x41')]){if(!_[_0x3071('0x20')](agents[_0x15c6f8[_0x3071('0x42')]])){utils[_0x3071('0x1')](util['format'](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x42')]]['transfer']=!![];agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3a')]=_0x3071('0x45');agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x46')];agents[_0x15c6f8[_0x3071('0x42')]]['transferuniqueid']=_0x15c6f8['origtransfereruniqueid'];}if(_0x15c6f8[_0x3071('0x47')]&&agents[_0x15c6f8['transfereeuniqueid']]){agents[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x1;transfers[_0x15c6f8['transfereeuniqueid']]=_[_0x3071('0x49')](agents[_0x15c6f8[_0x3071('0x47')]]);transfers[_0x15c6f8['transfereeuniqueid']][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x42')]][_0x3071('0x8')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x4a')]=agents[_0x15c6f8['secondtransfereruniqueid']][_0x3071('0x4a')];transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x18')]=utils['now']();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x47')]][_0x3071('0x48')]=0x2;}}else if(_0x15c6f8[_0x3071('0x42')]==_0x15c6f8[_0x3071('0x4b')]){if(!_['isNil'](agents[_0x15c6f8[_0x3071('0x44')]])){utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x43'),_0x15c6f8[_0x3071('0x44')],agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x6')]));agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x39')]=!![];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3a')]='ATTENDED';agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3c')]=_0x15c6f8[_0x3071('0x4c')];agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x3e')]=_0x15c6f8[_0x3071('0x42')];}if(_0x15c6f8[_0x3071('0x4d')]&&agents[_0x15c6f8[_0x3071('0x4d')]]){agents[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x48')]=0x1;transfers[_0x15c6f8[_0x3071('0x4d')]]=_['clone'](agents[_0x15c6f8['transfertargetuniqueid']]);transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x8')]=agents[_0x15c6f8[_0x3071('0x44')]][_0x3071('0x8')];transfers[_0x15c6f8['transfertargetuniqueid']]['calleridname']=agents[_0x15c6f8[_0x3071('0x44')]]['calleridname'];transfers[_0x15c6f8['transfertargetuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x30')]=utils[_0x3071('0x19')]();transfers[_0x15c6f8['transfertargetuniqueid']][_0x3071('0x2c')]=0x0;transfers[_0x15c6f8[_0x3071('0x4d')]][_0x3071('0x48')]=0x2;}}}catch(_0x19a03d){utils['error'](util[_0x3071('0x2')](_0x3071('0x40'),_0x15c6f8['origtransfereruniqueid']),_0x19a03d);}};exports[_0x3071('0x4e')]=function(_0x29ee70){try{utils[_0x3071('0x16')](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70[_0x3071('0x3')]),_0x29ee70);if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']]['reason']===_0x3071('0x24')){if(_0x29ee70[_0x3071('0x50')]==='21'){agents[_0x29ee70[_0x3071('0x3')]]['reason']='rejected';agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x51');}utils[_0x3071('0x1')](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]]['membername'],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);var _0x2fbac7=unanswered[_0x3071('0x53')](_0x29ee70[_0x3071('0x3')]);if(_0x2fbac7>-0x1){unanswered[_0x3071('0x54')](_0x2fbac7,0x1);}}if(transfers[_0x29ee70[_0x3071('0x3')]]){transfers[_0x29ee70['uniqueid']][_0x3071('0xf')]=!![];transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils['now']();transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](transfers[_0x29ee70['uniqueid']]['agentcompleteAt'],transfers[_0x29ee70[_0x3071('0x3')]]['agentconnectAt']);transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')]=_0x3071('0x55');transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]=_0x3071('0x56');utils[_0x3071('0x1')](util['format'](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0x25')],transfers[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(transfers[_0x29ee70['uniqueid']],!![]);}if(agents[_0x29ee70[_0x3071('0x3')]]&&agents[_0x29ee70['uniqueid']][_0x3071('0x30')]){agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xf')]=!![];agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x35')]=utils[_0x3071('0x19')]();agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x27')]=utils[_0x3071('0x34')](agents[_0x29ee70[_0x3071('0x3')]]['agentcompleteAt'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x30')]);agents[_0x29ee70['uniqueid']][_0x3071('0x25')]=agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x39')]?_0x3071('0x39'):_0x3071('0x55');agents[_0x29ee70['uniqueid']]['lastevent']=_0x3071('0x56');utils['info'](util[_0x3071('0x2')](_0x3071('0x52'),_0x29ee70[_0x3071('0x3')],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0x6')],agents[_0x29ee70[_0x3071('0x3')]]['reason'],agents[_0x29ee70[_0x3071('0x3')]][_0x3071('0xa')]));writeDB(agents[_0x29ee70[_0x3071('0x3')]]);}}catch(_0x291bb9){utils['error'](util[_0x3071('0x2')](_0x3071('0x4f'),_0x29ee70['uniqueid']),_0x291bb9);}};
\ No newline at end of file
index 04b3adc..92821a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f49=['[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','answertime','disposition','callerid','cause-txt','duration','diffTime','endtime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','secondtransfererchannel','destinationchannel','userfield','_attended','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','cdr','lastIndexOf','includes','hangup','execif','toLowerCase','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','channel','queue','membername','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil'];(function(_0x1cd1fa,_0x1f33b0){var _0xebf1b0=function(_0x338ab6){while(--_0x338ab6){_0x1cd1fa['push'](_0x1cd1fa['shift']());}};_0xebf1b0(++_0x1f33b0);}(_0x9f49,0xb5));var _0x99f4=function(_0x27fa96,_0x5d2366){_0x27fa96=_0x27fa96-0x0;var _0x59dc8b=_0x9f49[_0x27fa96];return _0x59dc8b;};'use strict';var _=require(_0x99f4('0x0'));var util=require(_0x99f4('0x1'));var utils=require(_0x99f4('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x99f4('0x3'),'FAILED',_0x99f4('0x4'),_0x99f4('0x3'),_0x99f4('0x3'),'NO\x20ANSWER',_0x99f4('0x5'),'BUSY',_0x99f4('0x4'),'FAILED',_0x99f4('0x4')];var channels={};function writeDB(_0x20bc4a){var _0x2f1c2d;if(transfers[_0x99f4('0x6')][_0x20bc4a[_0x99f4('0x7')]]){_0x2f1c2d=_0x20bc4a[_0x99f4('0x7')];_0x20bc4a[_0x99f4('0x7')]=transfers[_0x99f4('0x6')][_0x20bc4a[_0x99f4('0x7')]][_0x99f4('0x8')];}utils[_0x99f4('0x9')](util[_0x99f4('0xa')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x20bc4a[_0x99f4('0x7')],_0x20bc4a[_0x99f4('0xb')],_0x20bc4a[_0x99f4('0xc')],_0x20bc4a[_0x99f4('0xd')],_0x20bc4a['interface'],_0x20bc4a[_0x99f4('0xe')],_0x20bc4a[_0x99f4('0xf')],_0x20bc4a[_0x99f4('0x10')]));if(_0x20bc4a[_0x99f4('0x11')]){utils[_0x99f4('0x12')](_0x20bc4a['accountcode'])[_0x99f4('0x13')](function(_0x5b3934){if(_0x5b3934){_0x20bc4a[_0x99f4('0x14')]=_0x5b3934['id'];}utils[_0x99f4('0x15')](_0x99f4('0x16'),_0x20bc4a);});}else{utils['request'](_0x99f4('0x16'),_0x20bc4a);}if(channels[_0x20bc4a[_0x99f4('0x7')]]){delete channels[_0x20bc4a['uniqueid']];}else if(_0x2f1c2d&&channels[_0x2f1c2d]){delete transfers[_0x99f4('0x6')][_0x2f1c2d];delete channels[_0x2f1c2d];}}exports[_0x99f4('0x17')]=function(_0x4b316a){try{utils[_0x99f4('0x18')](util[_0x99f4('0xa')](_0x99f4('0x19'),_0x4b316a[_0x99f4('0x7')]),_0x4b316a);if(_0x4b316a[_0x99f4('0x7')]==_0x4b316a[_0x99f4('0x1a')]&&_0x4b316a['channel']!=_0x99f4('0x1b')){utils[_0x99f4('0x9')](util[_0x99f4('0xa')](_0x99f4('0x1c'),_0x4b316a[_0x99f4('0x7')],_0x4b316a[_0x99f4('0x1d')],_0x4b316a[_0x99f4('0x1e')]));channels[_0x4b316a['uniqueid']]={'uniqueid':_0x4b316a[_0x99f4('0x7')],'accountcode':_0x4b316a['accountcode'],'source':_0x4b316a['calleridnum'],'destination':_0x4b316a['exten'],'destinationcontext':_0x4b316a[_0x99f4('0x1d')],'channel':_0x4b316a['channel'],'starttime':utils[_0x99f4('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x99f4('0x20')};}}catch(_0x3c10d1){utils[_0x99f4('0x21')](util[_0x99f4('0xa')](_0x99f4('0x19'),_0x4b316a['uniqueid']),_0x3c10d1);}};exports[_0x99f4('0x22')]=function(_0x307e24){try{utils['debug'](util['format'](_0x99f4('0x23'),_0x307e24['uniqueid']),_0x307e24);if(!_[_0x99f4('0x24')](channels[_0x307e24['uniqueid']])&&_0x307e24['channelstate']==0x6){utils[_0x99f4('0x9')](util['format'](_0x99f4('0x25'),_0x307e24[_0x99f4('0x7')],_0x307e24[_0x99f4('0x1d')],_0x307e24[_0x99f4('0xb')]));if(_[_0x99f4('0x24')](channels[_0x307e24[_0x99f4('0x7')]][_0x99f4('0x26')])){channels[_0x307e24['uniqueid']][_0x99f4('0x26')]=utils[_0x99f4('0x1f')]();}}else if(!_[_0x99f4('0x24')](channels[_0x307e24[_0x99f4('0x1a')]])&&_0x307e24[_0x99f4('0x27')]==0x6&&_0x307e24['context']!=_0x99f4('0x28')){utils[_0x99f4('0x9')](util[_0x99f4('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x307e24[_0x99f4('0x7')],_0x307e24['linkedid'],_0x307e24[_0x99f4('0x1d')],_0x307e24[_0x99f4('0xb')]));channels[_0x307e24[_0x99f4('0x1a')]]['accountcode']=_0x307e24[_0x99f4('0x11')];channels[_0x307e24[_0x99f4('0x1a')]]['destinationchannel']=_0x307e24[_0x99f4('0xb')];if(_['isNil'](channels[_0x307e24['linkedid']]['answertime'])){channels[_0x307e24[_0x99f4('0x1a')]][_0x99f4('0x29')]=utils['now']();}channels[_0x307e24[_0x99f4('0x1a')]][_0x99f4('0x2a')]=dispositions[_['toNumber'](_0x307e24[_0x99f4('0x27')])]||'ANSWERED';}}catch(_0x468080){utils[_0x99f4('0x21')](util['format']('[%s][calls][newstate]',_0x307e24[_0x99f4('0x7')]),_0x468080);}};exports['hangup']=function(_0x443135){try{if(!_[_0x99f4('0x24')](channels[_0x443135[_0x99f4('0x7')]])){utils[_0x99f4('0x18')](util['format']('[%s][calls][hangup]',_0x443135[_0x99f4('0x7')]),_0x443135);if(_[_0x99f4('0x24')](channels[_0x443135[_0x99f4('0x7')]][_0x99f4('0x2b')])){channels[_0x443135[_0x99f4('0x7')]]['callerid']=_0x443135['calleridname']+'\x20<'+_0x443135[_0x99f4('0xe')]+'>';}utils[_0x99f4('0x9')](util[_0x99f4('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x443135[_0x99f4('0x7')],channels[_0x443135[_0x99f4('0x7')]][_0x99f4('0x2b')],_0x443135[_0x99f4('0x2c')]));channels[_0x443135[_0x99f4('0x7')]]['endtime']=utils['now']();channels[_0x443135[_0x99f4('0x7')]][_0x99f4('0x2d')]=utils[_0x99f4('0x2e')](channels[_0x443135[_0x99f4('0x7')]][_0x99f4('0x2f')],channels[_0x443135['uniqueid']][_0x99f4('0x30')]);channels[_0x443135[_0x99f4('0x7')]][_0x99f4('0x31')]=channels[_0x443135[_0x99f4('0x7')]][_0x99f4('0x29')]?utils['diffTime'](channels[_0x443135['uniqueid']][_0x99f4('0x2f')],channels[_0x443135['uniqueid']][_0x99f4('0x29')]):0x0;writeDB(channels[_0x443135[_0x99f4('0x7')]]);}}catch(_0x137b7a){utils[_0x99f4('0x21')](util['format'](_0x99f4('0x32'),_0x443135['uniqueid']),_0x137b7a);}};exports[_0x99f4('0x33')]=function(_0xc0ae77){try{if(!_[_0x99f4('0x24')](channels[_0xc0ae77[_0x99f4('0x34')]])){utils[_0x99f4('0x18')](util[_0x99f4('0xa')](_0x99f4('0x35'),_0xc0ae77[_0x99f4('0x36')]),_0xc0ae77);if(channels[_0xc0ae77[_0x99f4('0x34')]][_0x99f4('0xb')]==_0xc0ae77[_0x99f4('0x37')]){utils['info'](util[_0x99f4('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0xc0ae77[_0x99f4('0x36')],_0xc0ae77[_0x99f4('0x34')],_0xc0ae77[_0x99f4('0x38')]));channels[_0xc0ae77[_0x99f4('0x34')]][_0x99f4('0x39')]=_0xc0ae77[_0x99f4('0x38')];channels[_0xc0ae77[_0x99f4('0x34')]][_0x99f4('0x3a')]=_0x99f4('0x3b');}else if(channels[_0xc0ae77[_0x99f4('0x34')]][_0x99f4('0xb')]=_0xc0ae77['transfertargetchannel']){utils[_0x99f4('0x9')](util['format'](_0x99f4('0x3c'),_0xc0ae77['origtransfereruniqueid'],_0xc0ae77[_0x99f4('0x34')],_0xc0ae77[_0x99f4('0x3d')]));channels[_0xc0ae77[_0x99f4('0x34')]][_0x99f4('0x39')]=_0xc0ae77[_0x99f4('0x3d')];channels[_0xc0ae77[_0x99f4('0x34')]][_0x99f4('0x3a')]='_attended';}}}catch(_0x4cbc27){utils[_0x99f4('0x21')](util['format'](_0x99f4('0x35'),_0xc0ae77[_0x99f4('0x36')]),_0x4cbc27);}};exports[_0x99f4('0x3e')]=function(_0x226055){try{if(!_[_0x99f4('0x24')](channels[_0x226055['uniqueid']])){utils[_0x99f4('0x18')](util[_0x99f4('0xa')](_0x99f4('0x3f'),_0x226055[_0x99f4('0x7')]),_0x226055);channels[_0x226055['uniqueid']][_0x99f4('0x40')]=utils[_0x99f4('0x1f')]();utils['info'](util[_0x99f4('0xa')](_0x99f4('0x41'),_0x226055[_0x99f4('0x7')],channels[_0x226055[_0x99f4('0x7')]][_0x99f4('0x40')]));}}catch(_0xdc8c61){utils[_0x99f4('0x21')](util[_0x99f4('0xa')]('[%s][calls][musiconholdstart]',_0x226055[_0x99f4('0x7')]),_0xdc8c61);}};exports[_0x99f4('0x42')]=function(_0x5dc0c7){try{if(!_[_0x99f4('0x24')](channels[_0x5dc0c7[_0x99f4('0x7')]])){utils[_0x99f4('0x18')](util[_0x99f4('0xa')](_0x99f4('0x43'),_0x5dc0c7[_0x99f4('0x7')]),_0x5dc0c7);if(!_[_0x99f4('0x24')](channels[_0x5dc0c7[_0x99f4('0x7')]][_0x99f4('0x40')])){channels[_0x5dc0c7['uniqueid']][_0x99f4('0x44')]+=utils[_0x99f4('0x2e')](utils[_0x99f4('0x1f')](),channels[_0x5dc0c7['uniqueid']]['musiconholdstartAt']);utils[_0x99f4('0x9')](util['format']('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x5dc0c7[_0x99f4('0x7')],channels[_0x5dc0c7['uniqueid']][_0x99f4('0x44')]));delete channels[_0x5dc0c7[_0x99f4('0x7')]][_0x99f4('0x40')];}}}catch(_0x363993){utils['error'](util[_0x99f4('0xa')](_0x99f4('0x43'),_0x5dc0c7[_0x99f4('0x7')]),_0x363993);}};exports[_0x99f4('0x45')]=function(_0x4b8063){try{if(!_[_0x99f4('0x24')](channels[_0x4b8063[_0x99f4('0x7')]])){utils[_0x99f4('0x18')](util[_0x99f4('0xa')]('[%s][calls][varset]',_0x4b8063[_0x99f4('0x7')]),_0x4b8063);if(!_['isNil'](_0x4b8063[_0x99f4('0x46')][_0x99f4('0x47')])){utils[_0x99f4('0x9')](util['format'](_0x99f4('0x48'),_0x4b8063[_0x99f4('0x7')],_0x4b8063[_0x99f4('0x49')]));channels[_0x4b8063[_0x99f4('0x7')]][_0x99f4('0x4a')]=_0x4b8063['value'];}if(!_[_0x99f4('0x24')](_0x4b8063['variable'][_0x99f4('0x4b')])){utils[_0x99f4('0x9')](util['format'](_0x99f4('0x4c'),_0x4b8063[_0x99f4('0x7')],_0x4b8063[_0x99f4('0x49')]));channels[_0x4b8063[_0x99f4('0x7')]][_0x99f4('0x4d')]=_0x4b8063[_0x99f4('0x49')];channels[_0x4b8063[_0x99f4('0x7')]][_0x99f4('0x2b')]='\x22'+_0x4b8063['value']+_0x99f4('0x4e')+_0x4b8063['value']+'>';}if(!_[_0x99f4('0x24')](_0x4b8063[_0x99f4('0x46')]['xmd-callerid-preview'])||!_['isNil'](_0x4b8063[_0x99f4('0x46')]['xmd-callerid'])){utils[_0x99f4('0x9')](util[_0x99f4('0xa')](_0x99f4('0x4f'),_0x4b8063[_0x99f4('0x7')],!_['isNil'](_0x4b8063[_0x99f4('0x46')][_0x99f4('0x50')])?'xmd-callerid-preview':_0x99f4('0x51'),_0x4b8063[_0x99f4('0x49')]));channels[_0x4b8063['uniqueid']][_0x99f4('0x2b')]=_0x4b8063[_0x99f4('0x49')];}if(!_[_0x99f4('0x24')](_0x4b8063[_0x99f4('0x46')][_0x99f4('0x52')])||!_[_0x99f4('0x24')](_0x4b8063['variable'][_0x99f4('0x53')])){utils[_0x99f4('0x9')](util['format'](_0x99f4('0x4f'),_0x4b8063[_0x99f4('0x7')],!_[_0x99f4('0x24')](_0x4b8063['variable'][_0x99f4('0x52')])?'xmd-queue':_0x99f4('0x53'),_0x4b8063['value']));channels[_0x4b8063[_0x99f4('0x7')]][_0x99f4('0x54')]=_0x99f4('0x55');channels[_0x4b8063[_0x99f4('0x7')]][_0x99f4('0x56')]=_0x4b8063[_0x99f4('0x49')];channels[_0x4b8063[_0x99f4('0x7')]][_0x99f4('0xc')]=!![];}if(!_[_0x99f4('0x24')](_0x4b8063['variable'][_0x99f4('0x57')])){utils[_0x99f4('0x9')](util['format'](_0x99f4('0x58'),_0x4b8063[_0x99f4('0x7')],_0x4b8063['value']));channels[_0x4b8063[_0x99f4('0x7')]][_0x99f4('0x59')]=_0x4b8063[_0x99f4('0x49')];}if(!_[_0x99f4('0x24')](_0x4b8063['variable'][_0x99f4('0x5a')])){utils[_0x99f4('0x9')](util['format'](_0x99f4('0x5b'),_0x4b8063['uniqueid'],_0x4b8063['value']));channels[_0x4b8063[_0x99f4('0x7')]]['type']=_0x4b8063[_0x99f4('0x49')];}if(!_[_0x99f4('0x24')](_0x4b8063[_0x99f4('0x46')][_0x99f4('0x5c')])){utils[_0x99f4('0x9')](util[_0x99f4('0xa')](_0x99f4('0x5d'),_0x4b8063['uniqueid'],_0x4b8063[_0x99f4('0x49')]));channels[_0x4b8063[_0x99f4('0x7')]]['routeid']=_0x4b8063[_0x99f4('0x49')];}if(!_[_0x99f4('0x24')](_0x4b8063[_0x99f4('0x46')][_0x99f4('0x5e')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x4b8063[_0x99f4('0x7')],_0x4b8063[_0x99f4('0x49')]));channels[_0x4b8063['uniqueid']]['sipcallid']=_0x4b8063[_0x99f4('0x49')];}}}catch(_0x4d26a5){utils[_0x99f4('0x21')](util[_0x99f4('0xa')](_0x99f4('0x5f'),_0x4b8063[_0x99f4('0x7')]),_0x4d26a5);}};exports[_0x99f4('0x60')]=function(_0x3f3bbe){try{if(!_[_0x99f4('0x24')](channels[_0x3f3bbe[_0x99f4('0x7')]])){utils['debug'](util[_0x99f4('0xa')](_0x99f4('0x61'),_0x3f3bbe[_0x99f4('0x7')]),_0x3f3bbe);utils['info'](util[_0x99f4('0xa')](_0x99f4('0x62'),_0x3f3bbe[_0x99f4('0x7')],_0x3f3bbe[_0x99f4('0x63')],_0x3f3bbe[_0x99f4('0x64')]));if(_0x3f3bbe['application']['toLowerCase']()==_0x99f4('0x65')&&_[_0x99f4('0x66')](_0x3f3bbe[_0x99f4('0x64')]['toLowerCase'](),_0x99f4('0x67'))){var _0x3d1041=_0x3f3bbe[_0x99f4('0x64')]['split']('=');var _0x45e86c=_0x3d1041[0x0]['substring'](_0x3d1041[0x0][_0x99f4('0x68')]('(')+0x1,_0x3d1041[0x0][_0x99f4('0x68')](')'));var _0x178fd5=_0x3d1041[0x1];channels[_0x3f3bbe['uniqueid']][_0x45e86c]=_0x178fd5;}if(!_[_0x99f4('0x69')]([_0x99f4('0x6a'),'noop',_0x99f4('0x6b'),'set','gotoif'],_0x3f3bbe['application'][_0x99f4('0x6c')]())){channels[_0x3f3bbe['uniqueid']][_0x99f4('0x54')]=_0x3f3bbe['application'];channels[_0x3f3bbe[_0x99f4('0x7')]][_0x99f4('0x56')]=_0x3f3bbe['appdata'];}}}catch(_0x36316b){utils[_0x99f4('0x21')](util[_0x99f4('0xa')]('[%s][calls][newexten]',_0x3f3bbe[_0x99f4('0x7')]),_0x36316b);}};
\ No newline at end of file
+var _0x5a59=['[%s][calls][newchannel]','[%s][calls][newstate]','isNil','channelstate','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','starttime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','secondtransfererchannel','userfield','transfertargetchannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','origtransfererchannel','_attended','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','variable','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','Queue','lastdata','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','includes','hangup','noop','gotoif','lastapplication','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getUserByInternal','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','linkedid','channel','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x5a59,0x19c));var _0x95a5=function(_0x69383f,_0x2f3815){_0x69383f=_0x69383f-0x0;var _0x22a350=_0x5a59[_0x69383f];return _0x22a350;};'use strict';var _=require(_0x95a5('0x0'));var util=require(_0x95a5('0x1'));var utils=require(_0x95a5('0x2'));var transfers=require(_0x95a5('0x3'));var dispositions=[_0x95a5('0x4'),_0x95a5('0x5'),_0x95a5('0x5'),_0x95a5('0x4'),_0x95a5('0x4'),_0x95a5('0x4'),_0x95a5('0x6'),_0x95a5('0x7'),_0x95a5('0x5'),'FAILED','FAILED'];var channels={};function writeDB(_0x1057ad){var _0x13d332;if(transfers[_0x95a5('0x8')][_0x1057ad[_0x95a5('0x9')]]){_0x13d332=_0x1057ad[_0x95a5('0x9')];_0x1057ad[_0x95a5('0x9')]=transfers[_0x95a5('0x8')][_0x1057ad[_0x95a5('0x9')]][_0x95a5('0xa')];}utils[_0x95a5('0xb')](util[_0x95a5('0xc')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1057ad['uniqueid'],_0x1057ad['channel'],_0x1057ad[_0x95a5('0xd')],_0x1057ad[_0x95a5('0xe')],_0x1057ad[_0x95a5('0xf')],_0x1057ad[_0x95a5('0x10')],_0x1057ad[_0x95a5('0x11')],_0x1057ad[_0x95a5('0x12')]));if(_0x1057ad['accountcode']){utils[_0x95a5('0x13')](_0x1057ad[_0x95a5('0x14')])[_0x95a5('0x15')](function(_0x5a77ba){if(_0x5a77ba){_0x1057ad[_0x95a5('0x16')]=_0x5a77ba['id'];}utils[_0x95a5('0x17')](_0x95a5('0x18'),_0x1057ad);});}else{utils['request'](_0x95a5('0x18'),_0x1057ad);}if(channels[_0x1057ad[_0x95a5('0x9')]]){delete channels[_0x1057ad['uniqueid']];}else if(_0x13d332&&channels[_0x13d332]){delete transfers[_0x95a5('0x8')][_0x13d332];delete channels[_0x13d332];}}exports[_0x95a5('0x19')]=function(_0x437c1c){try{utils[_0x95a5('0x1a')](util['format']('[%s][calls][newchannel]',_0x437c1c['uniqueid']),_0x437c1c);if(_0x437c1c[_0x95a5('0x9')]==_0x437c1c[_0x95a5('0x1b')]&&_0x437c1c[_0x95a5('0x1c')]!=_0x95a5('0x1d')){utils[_0x95a5('0xb')](util['format'](_0x95a5('0x1e'),_0x437c1c[_0x95a5('0x9')],_0x437c1c['context'],_0x437c1c[_0x95a5('0x1f')]));channels[_0x437c1c['uniqueid']]={'uniqueid':_0x437c1c[_0x95a5('0x9')],'accountcode':_0x437c1c['accountcode'],'source':_0x437c1c[_0x95a5('0x10')],'destination':_0x437c1c[_0x95a5('0x1f')],'destinationcontext':_0x437c1c[_0x95a5('0x20')],'channel':_0x437c1c[_0x95a5('0x1c')],'starttime':utils[_0x95a5('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x95a5('0x4'),'amaflags':_0x95a5('0x22')};}}catch(_0x667944){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x24'),_0x437c1c['uniqueid']),_0x667944);}};exports['newstate']=function(_0x1bd9c3){try{utils[_0x95a5('0x1a')](util[_0x95a5('0xc')](_0x95a5('0x25'),_0x1bd9c3[_0x95a5('0x9')]),_0x1bd9c3);if(!_[_0x95a5('0x26')](channels[_0x1bd9c3[_0x95a5('0x9')]])&&_0x1bd9c3[_0x95a5('0x27')]==0x6){utils['info'](util[_0x95a5('0xc')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1bd9c3[_0x95a5('0x9')],_0x1bd9c3[_0x95a5('0x20')],_0x1bd9c3['channel']));if(_[_0x95a5('0x26')](channels[_0x1bd9c3[_0x95a5('0x9')]][_0x95a5('0x28')])){channels[_0x1bd9c3[_0x95a5('0x9')]]['systemanswertime']=utils['now']();}}else if(!_[_0x95a5('0x26')](channels[_0x1bd9c3[_0x95a5('0x1b')]])&&_0x1bd9c3[_0x95a5('0x27')]==0x6&&_0x1bd9c3['context']!=_0x95a5('0x29')){utils['info'](util[_0x95a5('0xc')](_0x95a5('0x2a'),_0x1bd9c3[_0x95a5('0x9')],_0x1bd9c3[_0x95a5('0x1b')],_0x1bd9c3['context'],_0x1bd9c3[_0x95a5('0x1c')]));channels[_0x1bd9c3[_0x95a5('0x1b')]][_0x95a5('0x14')]=_0x1bd9c3[_0x95a5('0x14')];channels[_0x1bd9c3[_0x95a5('0x1b')]][_0x95a5('0x2b')]=_0x1bd9c3[_0x95a5('0x1c')];if(_['isNil'](channels[_0x1bd9c3['linkedid']][_0x95a5('0x2c')])){channels[_0x1bd9c3[_0x95a5('0x1b')]][_0x95a5('0x2c')]=utils[_0x95a5('0x21')]();}channels[_0x1bd9c3[_0x95a5('0x1b')]][_0x95a5('0x2d')]=dispositions[_[_0x95a5('0x2e')](_0x1bd9c3[_0x95a5('0x27')])]||_0x95a5('0x6');}}catch(_0x430cdf){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x25'),_0x1bd9c3[_0x95a5('0x9')]),_0x430cdf);}};exports['hangup']=function(_0x2b6361){try{if(!_[_0x95a5('0x26')](channels[_0x2b6361[_0x95a5('0x9')]])){utils['debug'](util[_0x95a5('0xc')](_0x95a5('0x2f'),_0x2b6361[_0x95a5('0x9')]),_0x2b6361);if(_['isNil'](channels[_0x2b6361[_0x95a5('0x9')]]['callerid'])){channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x30')]=_0x2b6361[_0x95a5('0x31')]+'\x20<'+_0x2b6361[_0x95a5('0x10')]+'>';}utils[_0x95a5('0xb')](util[_0x95a5('0xc')](_0x95a5('0x32'),_0x2b6361['uniqueid'],channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x30')],_0x2b6361[_0x95a5('0x33')]));channels[_0x2b6361['uniqueid']][_0x95a5('0x34')]=utils['now']();channels[_0x2b6361[_0x95a5('0x9')]]['duration']=utils['diffTime'](channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x34')],channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x35')]);channels[_0x2b6361['uniqueid']][_0x95a5('0x36')]=channels[_0x2b6361['uniqueid']]['answertime']?utils[_0x95a5('0x37')](channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x34')],channels[_0x2b6361[_0x95a5('0x9')]][_0x95a5('0x2c')]):0x0;writeDB(channels[_0x2b6361[_0x95a5('0x9')]]);}}catch(_0x4c9b3a){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x2f'),_0x2b6361[_0x95a5('0x9')]),_0x4c9b3a);}};exports[_0x95a5('0x38')]=function(_0x14fbe3){try{if(!_[_0x95a5('0x26')](channels[_0x14fbe3[_0x95a5('0x39')]])){utils['debug'](util[_0x95a5('0xc')]('[%s][calls][attendedtransfer]',_0x14fbe3['origtransfereruniqueid']),_0x14fbe3);if(channels[_0x14fbe3[_0x95a5('0x39')]]['channel']==_0x14fbe3[_0x95a5('0x3a')]){utils[_0x95a5('0xb')](util[_0x95a5('0xc')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x14fbe3['origtransfereruniqueid'],_0x14fbe3['localtwolinkedid'],_0x14fbe3[_0x95a5('0x3b')]));channels[_0x14fbe3[_0x95a5('0x39')]][_0x95a5('0x2b')]=_0x14fbe3[_0x95a5('0x3b')];channels[_0x14fbe3[_0x95a5('0x39')]][_0x95a5('0x3c')]='_attended';}else if(channels[_0x14fbe3['localtwolinkedid']]['channel']=_0x14fbe3[_0x95a5('0x3d')]){utils[_0x95a5('0xb')](util[_0x95a5('0xc')](_0x95a5('0x3e'),_0x14fbe3[_0x95a5('0x3f')],_0x14fbe3['localtwolinkedid'],_0x14fbe3[_0x95a5('0x40')]));channels[_0x14fbe3['localtwolinkedid']][_0x95a5('0x2b')]=_0x14fbe3[_0x95a5('0x40')];channels[_0x14fbe3['localtwolinkedid']][_0x95a5('0x3c')]=_0x95a5('0x41');}}}catch(_0x436ea7){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x42'),_0x14fbe3['origtransfereruniqueid']),_0x436ea7);}};exports['musiconholdstart']=function(_0xbf8fcf){try{if(!_[_0x95a5('0x26')](channels[_0xbf8fcf[_0x95a5('0x9')]])){utils[_0x95a5('0x1a')](util[_0x95a5('0xc')](_0x95a5('0x43'),_0xbf8fcf[_0x95a5('0x9')]),_0xbf8fcf);channels[_0xbf8fcf[_0x95a5('0x9')]][_0x95a5('0x44')]=utils[_0x95a5('0x21')]();utils['info'](util[_0x95a5('0xc')](_0x95a5('0x45'),_0xbf8fcf[_0x95a5('0x9')],channels[_0xbf8fcf[_0x95a5('0x9')]][_0x95a5('0x44')]));}}catch(_0x1b901b){utils['error'](util[_0x95a5('0xc')]('[%s][calls][musiconholdstart]',_0xbf8fcf[_0x95a5('0x9')]),_0x1b901b);}};exports[_0x95a5('0x46')]=function(_0x2df7e9){try{if(!_['isNil'](channels[_0x2df7e9[_0x95a5('0x9')]])){utils['debug'](util['format'](_0x95a5('0x47'),_0x2df7e9[_0x95a5('0x9')]),_0x2df7e9);if(!_[_0x95a5('0x26')](channels[_0x2df7e9[_0x95a5('0x9')]]['musiconholdstartAt'])){channels[_0x2df7e9[_0x95a5('0x9')]][_0x95a5('0x48')]+=utils[_0x95a5('0x37')](utils[_0x95a5('0x21')](),channels[_0x2df7e9[_0x95a5('0x9')]][_0x95a5('0x44')]);utils[_0x95a5('0xb')](util['format'](_0x95a5('0x49'),_0x2df7e9['uniqueid'],channels[_0x2df7e9['uniqueid']][_0x95a5('0x48')]));delete channels[_0x2df7e9[_0x95a5('0x9')]]['musiconholdstartAt'];}}}catch(_0x2ba326){utils[_0x95a5('0x23')](util['format']('[%s][calls][musiconholdstop]',_0x2df7e9['uniqueid']),_0x2ba326);}};exports[_0x95a5('0x4a')]=function(_0x232980){try{if(!_[_0x95a5('0x26')](channels[_0x232980[_0x95a5('0x9')]])){utils['debug'](util[_0x95a5('0xc')](_0x95a5('0x4b'),_0x232980[_0x95a5('0x9')]),_0x232980);if(!_[_0x95a5('0x26')](_0x232980['variable'][_0x95a5('0x4c')])){utils[_0x95a5('0xb')](util[_0x95a5('0xc')](_0x95a5('0x4d'),_0x232980[_0x95a5('0x9')],_0x232980[_0x95a5('0x4e')]));channels[_0x232980[_0x95a5('0x9')]]['source']=_0x232980[_0x95a5('0x4e')];}if(!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')]['xmd-phone'])){utils[_0x95a5('0xb')](util[_0x95a5('0xc')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x232980[_0x95a5('0x9')],_0x232980[_0x95a5('0x4e')]));channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0x50')]=_0x232980['value'];channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0x30')]='\x22'+_0x232980[_0x95a5('0x4e')]+_0x95a5('0x51')+_0x232980[_0x95a5('0x4e')]+'>';}if(!_[_0x95a5('0x26')](_0x232980['variable'][_0x95a5('0x52')])||!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')]['xmd-callerid'])){utils[_0x95a5('0xb')](util['format'](_0x95a5('0x53'),_0x232980[_0x95a5('0x9')],!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')][_0x95a5('0x52')])?_0x95a5('0x52'):_0x95a5('0x54'),_0x232980[_0x95a5('0x4e')]));channels[_0x232980['uniqueid']][_0x95a5('0x30')]=_0x232980[_0x95a5('0x4e')];}if(!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')][_0x95a5('0x55')])||!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')]['xmcs-queue'])){utils[_0x95a5('0xb')](util['format'](_0x95a5('0x53'),_0x232980[_0x95a5('0x9')],!_['isNil'](_0x232980[_0x95a5('0x4f')][_0x95a5('0x55')])?_0x95a5('0x55'):'xmcs-queue',_0x232980[_0x95a5('0x4e')]));channels[_0x232980[_0x95a5('0x9')]]['lastapplication']=_0x95a5('0x56');channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0x57')]=_0x232980[_0x95a5('0x4e')];channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0xd')]=!![];}if(!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')]['xmd-contactid'])){utils['info'](util[_0x95a5('0xc')](_0x95a5('0x58'),_0x232980['uniqueid'],_0x232980['value']));channels[_0x232980['uniqueid']][_0x95a5('0x59')]=_0x232980['value'];}if(!_['isNil'](_0x232980[_0x95a5('0x4f')][_0x95a5('0x5a')])){utils[_0x95a5('0xb')](util['format']('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x232980['uniqueid'],_0x232980[_0x95a5('0x4e')]));channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0x5b')]=_0x232980[_0x95a5('0x4e')];}if(!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')][_0x95a5('0x5c')])){utils[_0x95a5('0xb')](util[_0x95a5('0xc')](_0x95a5('0x5d'),_0x232980['uniqueid'],_0x232980[_0x95a5('0x4e')]));channels[_0x232980[_0x95a5('0x9')]][_0x95a5('0x5e')]=_0x232980[_0x95a5('0x4e')];}if(!_[_0x95a5('0x26')](_0x232980[_0x95a5('0x4f')][_0x95a5('0x5f')])){utils[_0x95a5('0xb')](util['format'](_0x95a5('0x60'),_0x232980['uniqueid'],_0x232980['value']));channels[_0x232980[_0x95a5('0x9')]]['sipcallid']=_0x232980[_0x95a5('0x4e')];}}}catch(_0x5eff92){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x4b'),_0x232980[_0x95a5('0x9')]),_0x5eff92);}};exports[_0x95a5('0x61')]=function(_0x3340a3){try{if(!_[_0x95a5('0x26')](channels[_0x3340a3[_0x95a5('0x9')]])){utils[_0x95a5('0x1a')](util['format']('[%s][calls][newexten]',_0x3340a3[_0x95a5('0x9')]),_0x3340a3);utils[_0x95a5('0xb')](util[_0x95a5('0xc')](_0x95a5('0x62'),_0x3340a3[_0x95a5('0x9')],_0x3340a3[_0x95a5('0x63')],_0x3340a3[_0x95a5('0x64')]));if(_0x3340a3[_0x95a5('0x63')][_0x95a5('0x65')]()==_0x95a5('0x66')&&_[_0x95a5('0x67')](_0x3340a3[_0x95a5('0x64')][_0x95a5('0x65')](),_0x95a5('0x68'))){var _0x128641=_0x3340a3[_0x95a5('0x64')][_0x95a5('0x69')]('=');var _0x252bf5=_0x128641[0x0]['substring'](_0x128641[0x0]['lastIndexOf']('(')+0x1,_0x128641[0x0]['lastIndexOf'](')'));var _0xc88a11=_0x128641[0x1];channels[_0x3340a3[_0x95a5('0x9')]][_0x252bf5]=_0xc88a11;}if(!_[_0x95a5('0x6a')]([_0x95a5('0x6b'),_0x95a5('0x6c'),'execif','set',_0x95a5('0x6d')],_0x3340a3[_0x95a5('0x63')][_0x95a5('0x65')]())){channels[_0x3340a3['uniqueid']][_0x95a5('0x6e')]=_0x3340a3[_0x95a5('0x63')];channels[_0x3340a3['uniqueid']][_0x95a5('0x57')]=_0x3340a3[_0x95a5('0x64')];}}}catch(_0x2f05a0){utils[_0x95a5('0x23')](util[_0x95a5('0xc')](_0x95a5('0x6f'),_0x3340a3[_0x95a5('0x9')]),_0x2f05a0);}};
\ No newline at end of file
index 4da9881..e0e3c61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d54=['./utils','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','info','[core]\x20fullybooted','error','[core]\x20error','close'];(function(_0x5d14d4,_0x259e6b){var _0x12b40f=function(_0x2ca35f){while(--_0x2ca35f){_0x5d14d4['push'](_0x5d14d4['shift']());}};_0x12b40f(++_0x259e6b);}(_0x0d54,0x1c2));var _0x40d5=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x0d54[_0x24f31b];return _0x488401;};'use strict';var utils=require(_0x40d5('0x0'));exports['connect']=function(){utils['info'](_0x40d5('0x1'));};exports[_0x40d5('0x2')]=function(){utils['info'](_0x40d5('0x3'));};exports[_0x40d5('0x4')]=function(){utils[_0x40d5('0x5')](_0x40d5('0x6'));};exports[_0x40d5('0x7')]=function(_0x558dcc){utils['error'](_0x40d5('0x8'),_0x558dcc);};exports[_0x40d5('0x9')]=function(){utils['info']('[core]\x20close');};exports['managerevent']=function(_0xc4a32){};
\ No newline at end of file
+var _0x1701=['managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x1701,0x18d));var _0x1170=function(_0xc7de08,_0x32245a){_0xc7de08=_0xc7de08-0x0;var _0x20275b=_0x1701[_0xc7de08];return _0x20275b;};'use strict';var utils=require(_0x1170('0x0'));exports[_0x1170('0x1')]=function(){utils[_0x1170('0x2')](_0x1170('0x3'));};exports[_0x1170('0x4')]=function(){utils['info'](_0x1170('0x5'));};exports[_0x1170('0x6')]=function(){utils[_0x1170('0x2')](_0x1170('0x7'));};exports['error']=function(_0x1e6bff){utils[_0x1170('0x8')]('[core]\x20error',_0x1e6bff);};exports[_0x1170('0x9')]=function(){utils[_0x1170('0x2')](_0x1170('0xa'));};exports[_0x1170('0xb')]=function(_0x2c18a8){};
\ No newline at end of file
index 129acb0..878670d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4e20=['[%s][dials][dialend]','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','duration','diffTime','holdtime','endtime','billableseconds','[%s][dials][hangup]','lodash','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr(routeid)','error','varset','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','starttime','now','lastevent','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','assign','answertime','[%s][dials][dialend]\x20dialstatus:%s'];(function(_0xc441b5,_0xa58567){var _0x4f5e7c=function(_0x4ea6ea){while(--_0x4ea6ea){_0xc441b5['push'](_0xc441b5['shift']());}};_0x4f5e7c(++_0xa58567);}(_0x4e20,0x98));var _0x04e2=function(_0x2842b4,_0x2b1b7b){_0x2842b4=_0x2842b4-0x0;var _0x2b9521=_0x4e20[_0x2842b4];return _0x2b9521;};'use strict';var _=require(_0x04e2('0x0'));var util=require('util');var utils=require(_0x04e2('0x1'));var dials={};function writeDB(_0x2178bd){utils[_0x04e2('0x2')](util[_0x04e2('0x3')](_0x04e2('0x4'),_0x2178bd[_0x04e2('0x5')],_0x2178bd[_0x04e2('0x6')],_0x2178bd[_0x04e2('0x7')],_0x2178bd[_0x04e2('0x8')],_0x2178bd[_0x04e2('0x9')],_0x2178bd[_0x04e2('0xa')]));utils[_0x04e2('0xb')]('CreateVoiceDialReport',_0x2178bd);delete dials[_0x2178bd[_0x04e2('0x5')]];}exports['newexten']=function(_0x4b6134){try{utils[_0x04e2('0xc')](util[_0x04e2('0x3')](_0x04e2('0xd'),_0x4b6134['uniqueid']),_0x4b6134);utils[_0x04e2('0x2')](util[_0x04e2('0x3')](_0x04e2('0xe'),_0x4b6134[_0x04e2('0x5')],_0x4b6134[_0x04e2('0xf')],_0x4b6134[_0x04e2('0x10')]));if(_0x4b6134[_0x04e2('0xf')][_0x04e2('0x11')]()==_0x04e2('0x12')&&_['startsWith'](_0x4b6134[_0x04e2('0x10')][_0x04e2('0x11')](),_0x04e2('0x13'))){var _0x5007af=_0x4b6134[_0x04e2('0x10')]['split']('=');dials[_0x4b6134[_0x04e2('0x5')]]={'routeId':_0x5007af[0x1]};}}catch(_0xa21f5c){utils[_0x04e2('0x14')](util[_0x04e2('0x3')](_0x04e2('0xd'),_0x4b6134[_0x04e2('0x5')]),_0xa21f5c);}};exports[_0x04e2('0x15')]=function(_0xe8daf){try{utils['debug'](util[_0x04e2('0x3')]('[%s][dials][varset]',_0xe8daf['uniqueid']),_0xe8daf);if(!_[_0x04e2('0x16')](_0xe8daf['variable'][_0x04e2('0x17')])){utils[_0x04e2('0x2')](util[_0x04e2('0x3')](_0x04e2('0x18'),_0xe8daf[_0x04e2('0x5')],_0xe8daf['value']));dials[_0xe8daf[_0x04e2('0x5')]]={'routeId':_0xe8daf['value']};}}catch(_0x14479e){utils['error'](util['format'](_0x04e2('0x19'),_0xe8daf[_0x04e2('0x5')]),_0x14479e);}};exports[_0x04e2('0x1a')]=function(_0x89a3b){try{if(!_[_0x04e2('0x16')](dials[_0x89a3b[_0x04e2('0x5')]])){utils['debug'](util['format'](_0x04e2('0x1b'),_0x89a3b[_0x04e2('0x5')]),_0x89a3b);dials[_0x89a3b[_0x04e2('0x5')]]=_['assign'](dials[_0x89a3b[_0x04e2('0x5')]],_0x89a3b);dials[_0x89a3b[_0x04e2('0x5')]][_0x04e2('0x1c')]=utils[_0x04e2('0x1d')]();dials[_0x89a3b[_0x04e2('0x5')]][_0x04e2('0x1e')]='called';utils[_0x04e2('0x2')](util['format'](_0x04e2('0x1f'),_0x89a3b['uniqueid'],dials[_0x89a3b['uniqueid']][_0x04e2('0x1c')]));}}catch(_0xb45923){utils['error'](util[_0x04e2('0x3')](_0x04e2('0x1b'),_0x89a3b[_0x04e2('0x5')]),_0xb45923);}};exports[_0x04e2('0x20')]=function(_0x3433fa){try{if(!_['isNil'](dials[_0x3433fa['uniqueid']])){utils['debug'](util[_0x04e2('0x3')]('[%s][dials][dialend]',_0x3433fa['uniqueid']),_0x3433fa);dials[_0x3433fa['uniqueid']][_0x04e2('0xa')]=_0x3433fa[_0x04e2('0xa')];if(_0x3433fa[_0x04e2('0xa')]=='ANSWER'){dials[_0x3433fa[_0x04e2('0x5')]]=_[_0x04e2('0x21')](dials[_0x3433fa[_0x04e2('0x5')]],_0x3433fa);dials[_0x3433fa[_0x04e2('0x5')]][_0x04e2('0x22')]=utils['now']();dials[_0x3433fa['uniqueid']]['lastevent']='connect';utils[_0x04e2('0x2')](util[_0x04e2('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x3433fa[_0x04e2('0x5')],_0x3433fa[_0x04e2('0xa')],dials[_0x3433fa[_0x04e2('0x5')]][_0x04e2('0x22')]));}else{utils[_0x04e2('0x2')](util[_0x04e2('0x3')](_0x04e2('0x23'),_0x3433fa[_0x04e2('0x5')],_0x3433fa[_0x04e2('0xa')]));}}}catch(_0x2039c5){utils['error'](util[_0x04e2('0x3')](_0x04e2('0x24'),_0x3433fa['uniqueid']),_0x2039c5);}};exports[_0x04e2('0x25')]=function(_0x4c64c9){try{if(!_[_0x04e2('0x16')](dials[_0x4c64c9[_0x04e2('0x5')]])){utils[_0x04e2('0xc')](util['format']('[%s][dials][hangup]',_0x4c64c9[_0x04e2('0x5')]),_0x4c64c9);utils[_0x04e2('0x2')](util[_0x04e2('0x3')](_0x04e2('0x26'),_0x4c64c9[_0x04e2('0x5')],_0x4c64c9['calleridnum'],_0x4c64c9[_0x04e2('0x27')],_0x4c64c9[_0x04e2('0x28')]));dials[_0x4c64c9['uniqueid']]=_[_0x04e2('0x21')](dials[_0x4c64c9[_0x04e2('0x5')]],{'endtime':utils[_0x04e2('0x1d')](),'lastevent':'complete'});dials[_0x4c64c9['uniqueid']][_0x04e2('0x29')]=utils[_0x04e2('0x2a')](dials[_0x4c64c9[_0x04e2('0x5')]]['endtime'],dials[_0x4c64c9[_0x04e2('0x5')]][_0x04e2('0x1c')]);dials[_0x4c64c9[_0x04e2('0x5')]][_0x04e2('0x2b')]=utils[_0x04e2('0x2a')](dials[_0x4c64c9[_0x04e2('0x5')]][_0x04e2('0x22')]||dials[_0x4c64c9[_0x04e2('0x5')]][_0x04e2('0x2c')],dials[_0x4c64c9[_0x04e2('0x5')]][_0x04e2('0x1c')]);dials[_0x4c64c9[_0x04e2('0x5')]][_0x04e2('0x2d')]=dials[_0x4c64c9[_0x04e2('0x5')]][_0x04e2('0x22')]?utils[_0x04e2('0x2a')](dials[_0x4c64c9[_0x04e2('0x5')]][_0x04e2('0x2c')],dials[_0x4c64c9['uniqueid']][_0x04e2('0x22')]):0x0;writeDB(dials[_0x4c64c9[_0x04e2('0x5')]]);}}catch(_0x2f4e58){utils['error'](util[_0x04e2('0x3')](_0x04e2('0x2e'),_0x4c64c9[_0x04e2('0x5')]),_0x2f4e58);}};
\ No newline at end of file
+var _0x08ca=['newexten','debug','format','[%s][dials][newexten]','info','application','appdata','toLowerCase','cdr(routeid)','split','error','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','isNil','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','duration','endtime','holdtime','diffTime','billableseconds','lodash','./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','channel','calleridnum','dialstatus','request','CreateVoiceDialReport','uniqueid'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0x08ca,0x1e1));var _0xa08c=function(_0x4d2716,_0x11d867){_0x4d2716=_0x4d2716-0x0;var _0x3ea8a1=_0x08ca[_0x4d2716];return _0x3ea8a1;};'use strict';var _=require(_0xa08c('0x0'));var util=require('util');var utils=require(_0xa08c('0x1'));var dials={};function writeDB(_0x428e4f){utils['info'](util['format'](_0xa08c('0x2'),_0x428e4f['uniqueid'],_0x428e4f[_0xa08c('0x3')],_0x428e4f['dialstring'],_0x428e4f[_0xa08c('0x4')],_0x428e4f['connectedlinenum'],_0x428e4f[_0xa08c('0x5')]));utils[_0xa08c('0x6')](_0xa08c('0x7'),_0x428e4f);delete dials[_0x428e4f[_0xa08c('0x8')]];}exports[_0xa08c('0x9')]=function(_0x524d26){try{utils[_0xa08c('0xa')](util[_0xa08c('0xb')](_0xa08c('0xc'),_0x524d26['uniqueid']),_0x524d26);utils[_0xa08c('0xd')](util[_0xa08c('0xb')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x524d26[_0xa08c('0x8')],_0x524d26[_0xa08c('0xe')],_0x524d26[_0xa08c('0xf')]));if(_0x524d26[_0xa08c('0xe')][_0xa08c('0x10')]()=='set'&&_['startsWith'](_0x524d26[_0xa08c('0xf')][_0xa08c('0x10')](),_0xa08c('0x11'))){var _0x24ab3c=_0x524d26[_0xa08c('0xf')][_0xa08c('0x12')]('=');dials[_0x524d26[_0xa08c('0x8')]]={'routeId':_0x24ab3c[0x1]};}}catch(_0x4da7d1){utils[_0xa08c('0x13')](util['format'](_0xa08c('0xc'),_0x524d26[_0xa08c('0x8')]),_0x4da7d1);}};exports[_0xa08c('0x14')]=function(_0x3fbc84){try{utils[_0xa08c('0xa')](util[_0xa08c('0xb')](_0xa08c('0x15'),_0x3fbc84[_0xa08c('0x8')]),_0x3fbc84);if(!_['isNil'](_0x3fbc84[_0xa08c('0x16')][_0xa08c('0x17')])){utils['info'](util['format'](_0xa08c('0x18'),_0x3fbc84[_0xa08c('0x8')],_0x3fbc84['value']));dials[_0x3fbc84[_0xa08c('0x8')]]={'routeId':_0x3fbc84[_0xa08c('0x19')]};}}catch(_0x317cd4){utils[_0xa08c('0x13')](util[_0xa08c('0xb')](_0xa08c('0x15'),_0x3fbc84['uniqueid']),_0x317cd4);}};exports[_0xa08c('0x1a')]=function(_0x394a2b){try{if(!_['isNil'](dials[_0x394a2b[_0xa08c('0x8')]])){utils[_0xa08c('0xa')](util['format']('[%s][dials][dialbegin]',_0x394a2b[_0xa08c('0x8')]),_0x394a2b);dials[_0x394a2b[_0xa08c('0x8')]]=_[_0xa08c('0x1b')](dials[_0x394a2b[_0xa08c('0x8')]],_0x394a2b);dials[_0x394a2b[_0xa08c('0x8')]][_0xa08c('0x1c')]=utils['now']();dials[_0x394a2b[_0xa08c('0x8')]][_0xa08c('0x1d')]=_0xa08c('0x1e');utils[_0xa08c('0xd')](util[_0xa08c('0xb')](_0xa08c('0x1f'),_0x394a2b[_0xa08c('0x8')],dials[_0x394a2b[_0xa08c('0x8')]]['starttime']));}}catch(_0x2bcc0d){utils[_0xa08c('0x13')](util['format'](_0xa08c('0x20'),_0x394a2b[_0xa08c('0x8')]),_0x2bcc0d);}};exports['dialend']=function(_0x4cc22e){try{if(!_['isNil'](dials[_0x4cc22e[_0xa08c('0x8')]])){utils[_0xa08c('0xa')](util[_0xa08c('0xb')]('[%s][dials][dialend]',_0x4cc22e[_0xa08c('0x8')]),_0x4cc22e);dials[_0x4cc22e['uniqueid']]['dialstatus']=_0x4cc22e[_0xa08c('0x5')];if(_0x4cc22e['dialstatus']==_0xa08c('0x21')){dials[_0x4cc22e['uniqueid']]=_[_0xa08c('0x1b')](dials[_0x4cc22e['uniqueid']],_0x4cc22e);dials[_0x4cc22e[_0xa08c('0x8')]][_0xa08c('0x22')]=utils[_0xa08c('0x23')]();dials[_0x4cc22e[_0xa08c('0x8')]][_0xa08c('0x1d')]=_0xa08c('0x24');utils[_0xa08c('0xd')](util[_0xa08c('0xb')](_0xa08c('0x25'),_0x4cc22e[_0xa08c('0x8')],_0x4cc22e['dialstatus'],dials[_0x4cc22e[_0xa08c('0x8')]]['answertime']));}else{utils[_0xa08c('0xd')](util[_0xa08c('0xb')]('[%s][dials][dialend]\x20dialstatus:%s',_0x4cc22e[_0xa08c('0x8')],_0x4cc22e['dialstatus']));}}}catch(_0x13d249){utils[_0xa08c('0x13')](util[_0xa08c('0xb')]('[%s][dials][dialend]',_0x4cc22e[_0xa08c('0x8')]),_0x13d249);}};exports[_0xa08c('0x26')]=function(_0x48ddb1){try{if(!_[_0xa08c('0x27')](dials[_0x48ddb1[_0xa08c('0x8')]])){utils[_0xa08c('0xa')](util[_0xa08c('0xb')](_0xa08c('0x28'),_0x48ddb1['uniqueid']),_0x48ddb1);utils[_0xa08c('0xd')](util[_0xa08c('0xb')](_0xa08c('0x29'),_0x48ddb1[_0xa08c('0x8')],_0x48ddb1[_0xa08c('0x4')],_0x48ddb1[_0xa08c('0x2a')],_0x48ddb1['cause-txt']));dials[_0x48ddb1[_0xa08c('0x8')]]=_[_0xa08c('0x1b')](dials[_0x48ddb1[_0xa08c('0x8')]],{'endtime':utils['now'](),'lastevent':_0xa08c('0x2b')});dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x2c')]=utils['diffTime'](dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x2d')],dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x1c')]);dials[_0x48ddb1['uniqueid']][_0xa08c('0x2e')]=utils[_0xa08c('0x2f')](dials[_0x48ddb1[_0xa08c('0x8')]]['answertime']||dials[_0x48ddb1['uniqueid']][_0xa08c('0x2d')],dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x1c')]);dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x30')]=dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x22')]?utils[_0xa08c('0x2f')](dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x2d')],dials[_0x48ddb1[_0xa08c('0x8')]][_0xa08c('0x22')]):0x0;writeDB(dials[_0x48ddb1[_0xa08c('0x8')]]);}}catch(_0x59e109){utils[_0xa08c('0x13')](util[_0xa08c('0xb')](_0xa08c('0x28'),_0x48ddb1[_0xa08c('0x8')]),_0x59e109);}};
\ No newline at end of file
index f969054..b628111 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf32b=['dialbegin','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][dialbegin]'];(function(_0x4cb093,_0x59a981){var _0x3dabcf=function(_0xee1c71){while(--_0xee1c71){_0x4cb093['push'](_0x4cb093['shift']());}};_0x3dabcf(++_0x59a981);}(_0xf32b,0x158));var _0xbf32=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xf32b[_0xbb091];return _0x467a04;};var AsteriskManager=require(_0xbf32('0x0'));var config=require(_0xbf32('0x1'));var utils=require('./utils');var util=require('util');var ami=new AsteriskManager(config[_0xbf32('0x2')][_0xbf32('0x3')],config[_0xbf32('0x2')]['ip'],config[_0xbf32('0x2')][_0xbf32('0x4')],config['asterisk'][_0xbf32('0x5')],!![]);ami[_0xbf32('0x6')]();if(config[_0xbf32('0x7')]&&config[_0xbf32('0x7')][_0xbf32('0x8')]){utils[_0xbf32('0x9')](_0xbf32('0xa'));}else{var agents=require(_0xbf32('0xb'));var calls=require(_0xbf32('0xc'));var queues=require('./queues.controller');var recordings=require(_0xbf32('0xd'));var members=require(_0xbf32('0xe'));var dials=require(_0xbf32('0xf'));var transfers=require(_0xbf32('0x10'));var core=require(_0xbf32('0x11'));ami['on']('connect',core[_0xbf32('0x12')]);ami['on']('shutdown',core[_0xbf32('0x13')]);ami['on'](_0xbf32('0x14'),core[_0xbf32('0x14')]);ami['on'](_0xbf32('0x15'),core[_0xbf32('0x15')]);ami['on'](_0xbf32('0x16'),core['close']);ami['on']('managerevent',core[_0xbf32('0x17')]);ami['on'](_0xbf32('0x18'),function(_0x45a10e){try{utils['debug'](util[_0xbf32('0x19')](_0xbf32('0x1a'),_0x45a10e[_0xbf32('0x1b')]),_0x45a10e);members[_0xbf32('0x18')](_0x45a10e);}catch(_0x6b43d3){utils[_0xbf32('0x15')](util[_0xbf32('0x19')](_0xbf32('0x1a'),_0x45a10e[_0xbf32('0x1b')]),_0x6b43d3);}});ami['on'](_0xbf32('0x1c'),function(_0x4dfdde){try{utils[_0xbf32('0x1d')](util[_0xbf32('0x19')](_0xbf32('0x1e'),_0x4dfdde['uniqueid']),_0x4dfdde);agents[_0xbf32('0x1c')](_0x4dfdde);}catch(_0x47955c){utils[_0xbf32('0x15')](util[_0xbf32('0x19')]('[%s][index][agentcalled]',_0x4dfdde[_0xbf32('0x1f')]),_0x47955c);}});ami['on'](_0xbf32('0x20'),function(_0x248378){try{utils['debug'](util[_0xbf32('0x19')](_0xbf32('0x21'),_0x248378[_0xbf32('0x1f')]),_0x248378);agents[_0xbf32('0x20')](_0x248378);}catch(_0x38720e){utils[_0xbf32('0x15')](util[_0xbf32('0x19')](_0xbf32('0x21'),_0x248378[_0xbf32('0x1f')]),_0x38720e);}});ami['on'](_0xbf32('0x22'),function(_0x3595cf){try{utils[_0xbf32('0x1d')](util[_0xbf32('0x19')](_0xbf32('0x23'),_0x3595cf[_0xbf32('0x1f')]),_0x3595cf);agents[_0xbf32('0x22')](_0x3595cf);queues[_0xbf32('0x22')](_0x3595cf);}catch(_0x42c81a){utils[_0xbf32('0x15')](util[_0xbf32('0x19')]('[%s][index][agentconnect]',_0x3595cf[_0xbf32('0x1f')]),_0x42c81a);}});ami['on']('agentcomplete',function(_0x2870d6){try{utils[_0xbf32('0x1d')](util[_0xbf32('0x19')]('[%s][index][agentcomplete]',_0x2870d6[_0xbf32('0x1f')]),_0x2870d6);agents[_0xbf32('0x24')](_0x2870d6);queues[_0xbf32('0x24')](_0x2870d6);members['agentcomplete'](_0x2870d6);}catch(_0x2591e5){utils['error'](util[_0xbf32('0x19')]('[%s][index][agentcomplete]',_0x2870d6[_0xbf32('0x1f')]),_0x2591e5);}});ami['on'](_0xbf32('0x25'),function(_0x148c8b){try{utils['debug'](util[_0xbf32('0x19')](_0xbf32('0x26'),_0x148c8b[_0xbf32('0x1f')]),_0x148c8b);agents[_0xbf32('0x25')](_0x148c8b);queues[_0xbf32('0x25')](_0x148c8b);}catch(_0x5dc898){utils[_0xbf32('0x15')](util[_0xbf32('0x19')](_0xbf32('0x26'),_0x148c8b[_0xbf32('0x1f')]),_0x5dc898);}});ami['on']('queuecallerjoin',function(_0x10bffb){try{utils[_0xbf32('0x1d')](util[_0xbf32('0x19')](_0xbf32('0x27'),_0x10bffb['uniqueid']),_0x10bffb);queues[_0xbf32('0x28')](_0x10bffb);recordings[_0xbf32('0x28')](_0x10bffb);}catch(_0x38669b){utils[_0xbf32('0x15')](util['format'](_0xbf32('0x27'),_0x10bffb[_0xbf32('0x1f')]),_0x38669b);}});ami['on']('queuecallerleave',function(_0x1ba4d2){try{utils['debug'](util['format'](_0xbf32('0x29'),_0x1ba4d2[_0xbf32('0x1f')]),_0x1ba4d2);queues[_0xbf32('0x2a')](_0x1ba4d2);}catch(_0x90c7ea){utils[_0xbf32('0x15')](util[_0xbf32('0x19')](_0xbf32('0x29'),_0x1ba4d2[_0xbf32('0x1f')]),_0x90c7ea);}});ami['on'](_0xbf32('0x2b'),function(_0x24c601){try{utils[_0xbf32('0x1d')](util['format'](_0xbf32('0x2c'),_0x24c601[_0xbf32('0x1f')]),_0x24c601);queues[_0xbf32('0x2b')](_0x24c601);calls[_0xbf32('0x2b')](_0x24c601);}catch(_0x1a42d3){utils[_0xbf32('0x15')](util[_0xbf32('0x19')]('[%s][index][musiconholdstart]',_0x24c601[_0xbf32('0x1f')]),_0x1a42d3);}});ami['on'](_0xbf32('0x2d'),function(_0x2d8e26){try{utils[_0xbf32('0x1d')](util[_0xbf32('0x19')](_0xbf32('0x2e'),_0x2d8e26['uniqueid']),_0x2d8e26);queues[_0xbf32('0x2d')](_0x2d8e26);calls['musiconholdstop'](_0x2d8e26);}catch(_0x1177d5){utils['error'](util['format'](_0xbf32('0x2e'),_0x2d8e26[_0xbf32('0x1f')]),_0x1177d5);}});ami['on'](_0xbf32('0x2f'),function(_0x33344e){try{utils[_0xbf32('0x1d')](util[_0xbf32('0x19')](_0xbf32('0x30'),_0x33344e[_0xbf32('0x1f')]),_0x33344e);calls['newstate'](_0x33344e);recordings[_0xbf32('0x2f')](_0x33344e);}catch(_0x364096){utils[_0xbf32('0x15')](util[_0xbf32('0x19')](_0xbf32('0x30'),_0x33344e[_0xbf32('0x1f')]),_0x364096);}});ami['on']('hangup',function(_0x32e3d3){try{utils[_0xbf32('0x1d')](util[_0xbf32('0x19')](_0xbf32('0x31'),_0x32e3d3[_0xbf32('0x1f')]),_0x32e3d3);calls[_0xbf32('0x32')](_0x32e3d3);recordings[_0xbf32('0x32')](_0x32e3d3);dials[_0xbf32('0x32')](_0x32e3d3);agents[_0xbf32('0x32')](_0x32e3d3);queues['hangup'](_0x32e3d3);}catch(_0x4a7d3e){utils[_0xbf32('0x15')](util[_0xbf32('0x19')]('[%s][index][hangup]',_0x32e3d3[_0xbf32('0x1f')]),_0x4a7d3e);}});ami['on'](_0xbf32('0x33'),function(_0x485717){try{utils[_0xbf32('0x1d')](util['format']('[%s][index][cdr]',_0x485717[_0xbf32('0x1f')]),_0x485717);members[_0xbf32('0x33')](_0x485717);}catch(_0x45107b){utils[_0xbf32('0x15')](util[_0xbf32('0x19')](_0xbf32('0x34'),_0x485717['uniqueid']),_0x45107b);}});ami['on']('blindtransfer',function(_0xfcf84f){try{utils[_0xbf32('0x1d')](util[_0xbf32('0x19')](_0xbf32('0x35'),_0xfcf84f[_0xbf32('0x1f')]),_0xfcf84f);queues['blindtransfer'](_0xfcf84f);agents[_0xbf32('0x36')](_0xfcf84f);transfers['blindtransfer'](_0xfcf84f);}catch(_0x2939ce){utils[_0xbf32('0x15')](util[_0xbf32('0x19')]('[%s][index][blindtransfer]',_0xfcf84f['uniqueid']),_0x2939ce);}});ami['on'](_0xbf32('0x37'),function(_0x3f83b9){try{utils['debug'](util['format'](_0xbf32('0x38'),_0x3f83b9[_0xbf32('0x39')]),_0x3f83b9);queues[_0xbf32('0x37')](_0x3f83b9);transfers[_0xbf32('0x37')](_0x3f83b9);agents['attendedtransfer'](_0x3f83b9);calls[_0xbf32('0x37')](_0x3f83b9);}catch(_0x7b7b96){utils['error'](util['format'](_0xbf32('0x38'),_0x3f83b9[_0xbf32('0x39')]),_0x7b7b96);}});ami['on'](_0xbf32('0x3a'),function(_0x2a26bb){try{utils[_0xbf32('0x1d')](util[_0xbf32('0x19')]('[%s][index][varset]',_0x2a26bb['uniqueid']),_0x2a26bb);queues[_0xbf32('0x3a')](_0x2a26bb);recordings['varset'](_0x2a26bb);calls[_0xbf32('0x3a')](_0x2a26bb);dials['varset'](_0x2a26bb);}catch(_0x373e2f){utils[_0xbf32('0x15')](util[_0xbf32('0x19')](_0xbf32('0x3b'),_0x2a26bb[_0xbf32('0x1f')]),_0x373e2f);}});ami['on'](_0xbf32('0x3c'),function(_0x312e90){try{utils[_0xbf32('0x1d')](util[_0xbf32('0x19')](_0xbf32('0x3d'),_0x312e90[_0xbf32('0x1f')]),_0x312e90);calls[_0xbf32('0x3c')](_0x312e90);recordings[_0xbf32('0x3c')](_0x312e90);dials[_0xbf32('0x3c')](_0x312e90);}catch(_0x42fb87){utils[_0xbf32('0x15')](util['format']('[%s][index][newexten]',_0x312e90['uniqueid']),_0x42fb87);}});ami['on'](_0xbf32('0x3e'),function(_0x2e052f){try{utils[_0xbf32('0x1d')](util[_0xbf32('0x19')]('[%s][index][newchannel]',_0x2e052f[_0xbf32('0x1f')]),_0x2e052f);calls['newchannel'](_0x2e052f);recordings['newchannel'](_0x2e052f);}catch(_0x37b6d5){utils[_0xbf32('0x15')](util[_0xbf32('0x19')]('[%s][index][newchannel]',_0x2e052f[_0xbf32('0x1f')]),_0x37b6d5);}});ami['on']('dialbegin',function(_0x4a5337){try{utils['debug'](util['format'](_0xbf32('0x3f'),_0x4a5337['uniqueid']),_0x4a5337);dials[_0xbf32('0x40')](_0x4a5337);}catch(_0x293a94){utils[_0xbf32('0x15')](util[_0xbf32('0x19')](_0xbf32('0x41'),_0x4a5337[_0xbf32('0x1f')]),_0x293a94);}});ami['on']('dialend',function(_0xf0fe58){try{utils['debug'](util[_0xbf32('0x19')](_0xbf32('0x42'),_0xf0fe58['uniqueid']),_0xf0fe58);dials[_0xbf32('0x43')](_0xf0fe58);}catch(_0x479c5c){utils[_0xbf32('0x15')](util[_0xbf32('0x19')](_0xbf32('0x42'),_0xf0fe58[_0xbf32('0x1f')]),_0x479c5c);}});}
\ No newline at end of file
+var _0xb2f9=['[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','asterisk-manager','./utils','port','asterisk','username','password','keepConnected','xdr','info','./queues.controller','./recordings.controller','./members.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','device','[%s][index][devicestatechange]','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][newstate]','newstate','hangup'];(function(_0x279f7e,_0xe593f){var _0x6bc76e=function(_0x3665a9){while(--_0x3665a9){_0x279f7e['push'](_0x279f7e['shift']());}};_0x6bc76e(++_0xe593f);}(_0xb2f9,0xcf));var _0x9b2f=function(_0x35cb5f,_0x108f10){_0x35cb5f=_0x35cb5f-0x0;var _0xdb2122=_0xb2f9[_0x35cb5f];return _0xdb2122;};var AsteriskManager=require(_0x9b2f('0x0'));var config=require('../../config/environment');var utils=require(_0x9b2f('0x1'));var util=require('util');var ami=new AsteriskManager(config['asterisk'][_0x9b2f('0x2')],config[_0x9b2f('0x3')]['ip'],config['asterisk'][_0x9b2f('0x4')],config[_0x9b2f('0x3')][_0x9b2f('0x5')],!![]);ami[_0x9b2f('0x6')]();if(config[_0x9b2f('0x7')]&&config[_0x9b2f('0x7')]['disabled']){utils[_0x9b2f('0x8')]('XDR\x20DISABLED');}else{var agents=require('./agents.controller');var calls=require('./calls.controller');var queues=require(_0x9b2f('0x9'));var recordings=require(_0x9b2f('0xa'));var members=require(_0x9b2f('0xb'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0x9b2f('0xc'));ami['on'](_0x9b2f('0xd'),core[_0x9b2f('0xd')]);ami['on'](_0x9b2f('0xe'),core[_0x9b2f('0xe')]);ami['on'](_0x9b2f('0xf'),core[_0x9b2f('0xf')]);ami['on'](_0x9b2f('0x10'),core[_0x9b2f('0x10')]);ami['on']('close',core[_0x9b2f('0x11')]);ami['on'](_0x9b2f('0x12'),core[_0x9b2f('0x12')]);ami['on'](_0x9b2f('0x13'),function(_0xd7a01){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')]('[%s][index][devicestatechange]',_0xd7a01[_0x9b2f('0x16')]),_0xd7a01);members['devicestatechange'](_0xd7a01);}catch(_0x1e37b2){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')](_0x9b2f('0x17'),_0xd7a01[_0x9b2f('0x16')]),_0x1e37b2);}});ami['on'](_0x9b2f('0x18'),function(_0x4363c9){try{utils[_0x9b2f('0x14')](util['format'](_0x9b2f('0x19'),_0x4363c9[_0x9b2f('0x1a')]),_0x4363c9);agents[_0x9b2f('0x18')](_0x4363c9);}catch(_0x887498){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')]('[%s][index][agentcalled]',_0x4363c9[_0x9b2f('0x1a')]),_0x887498);}});ami['on'](_0x9b2f('0x1b'),function(_0x2241cd){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x1c'),_0x2241cd['uniqueid']),_0x2241cd);agents[_0x9b2f('0x1b')](_0x2241cd);}catch(_0x4a713c){utils[_0x9b2f('0x10')](util['format'](_0x9b2f('0x1c'),_0x2241cd[_0x9b2f('0x1a')]),_0x4a713c);}});ami['on']('agentconnect',function(_0x5cb8f3){try{utils['debug'](util[_0x9b2f('0x15')](_0x9b2f('0x1d'),_0x5cb8f3['uniqueid']),_0x5cb8f3);agents[_0x9b2f('0x1e')](_0x5cb8f3);queues[_0x9b2f('0x1e')](_0x5cb8f3);}catch(_0x44fcae){utils['error'](util[_0x9b2f('0x15')]('[%s][index][agentconnect]',_0x5cb8f3[_0x9b2f('0x1a')]),_0x44fcae);}});ami['on'](_0x9b2f('0x1f'),function(_0x52ff69){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x20'),_0x52ff69[_0x9b2f('0x1a')]),_0x52ff69);agents[_0x9b2f('0x1f')](_0x52ff69);queues['agentcomplete'](_0x52ff69);members[_0x9b2f('0x1f')](_0x52ff69);}catch(_0x2873f3){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')](_0x9b2f('0x20'),_0x52ff69[_0x9b2f('0x1a')]),_0x2873f3);}});ami['on']('queuecallerabandon',function(_0x334f46){try{utils['debug'](util[_0x9b2f('0x15')](_0x9b2f('0x21'),_0x334f46[_0x9b2f('0x1a')]),_0x334f46);agents['queuecallerabandon'](_0x334f46);queues[_0x9b2f('0x22')](_0x334f46);}catch(_0x306a5b){utils[_0x9b2f('0x10')](util['format']('[%s][index][queuecallerabandon]',_0x334f46['uniqueid']),_0x306a5b);}});ami['on']('queuecallerjoin',function(_0x1fe7ea){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x23'),_0x1fe7ea['uniqueid']),_0x1fe7ea);queues[_0x9b2f('0x24')](_0x1fe7ea);recordings[_0x9b2f('0x24')](_0x1fe7ea);}catch(_0x1ee6fc){utils['error'](util[_0x9b2f('0x15')](_0x9b2f('0x23'),_0x1fe7ea[_0x9b2f('0x1a')]),_0x1ee6fc);}});ami['on'](_0x9b2f('0x25'),function(_0x3831dd){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x26'),_0x3831dd[_0x9b2f('0x1a')]),_0x3831dd);queues[_0x9b2f('0x25')](_0x3831dd);}catch(_0x3b7c87){utils['error'](util['format']('[%s][index][queuecallerleave]',_0x3831dd['uniqueid']),_0x3b7c87);}});ami['on'](_0x9b2f('0x27'),function(_0x26a527){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x28'),_0x26a527[_0x9b2f('0x1a')]),_0x26a527);queues['musiconholdstart'](_0x26a527);calls[_0x9b2f('0x27')](_0x26a527);}catch(_0x34cae5){utils['error'](util['format'](_0x9b2f('0x28'),_0x26a527[_0x9b2f('0x1a')]),_0x34cae5);}});ami['on']('musiconholdstop',function(_0x32dbc5){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')]('[%s][index][musiconholdstop]',_0x32dbc5[_0x9b2f('0x1a')]),_0x32dbc5);queues['musiconholdstop'](_0x32dbc5);calls[_0x9b2f('0x29')](_0x32dbc5);}catch(_0x204217){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')]('[%s][index][musiconholdstop]',_0x32dbc5[_0x9b2f('0x1a')]),_0x204217);}});ami['on']('newstate',function(_0xef3f4f){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x2a'),_0xef3f4f[_0x9b2f('0x1a')]),_0xef3f4f);calls[_0x9b2f('0x2b')](_0xef3f4f);recordings[_0x9b2f('0x2b')](_0xef3f4f);}catch(_0x54a711){utils[_0x9b2f('0x10')](util['format'](_0x9b2f('0x2a'),_0xef3f4f['uniqueid']),_0x54a711);}});ami['on'](_0x9b2f('0x2c'),function(_0x125c69){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')]('[%s][index][hangup]',_0x125c69[_0x9b2f('0x1a')]),_0x125c69);calls['hangup'](_0x125c69);recordings['hangup'](_0x125c69);dials[_0x9b2f('0x2c')](_0x125c69);agents[_0x9b2f('0x2c')](_0x125c69);queues[_0x9b2f('0x2c')](_0x125c69);}catch(_0x5bf86c){utils[_0x9b2f('0x10')](util['format'](_0x9b2f('0x2d'),_0x125c69[_0x9b2f('0x1a')]),_0x5bf86c);}});ami['on'](_0x9b2f('0x2e'),function(_0x12fe48){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x2f'),_0x12fe48[_0x9b2f('0x1a')]),_0x12fe48);members[_0x9b2f('0x2e')](_0x12fe48);}catch(_0x19d9d0){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')]('[%s][index][cdr]',_0x12fe48['uniqueid']),_0x19d9d0);}});ami['on'](_0x9b2f('0x30'),function(_0x373fbe){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x31'),_0x373fbe[_0x9b2f('0x1a')]),_0x373fbe);queues[_0x9b2f('0x30')](_0x373fbe);agents['blindtransfer'](_0x373fbe);transfers[_0x9b2f('0x30')](_0x373fbe);}catch(_0x3b1151){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')](_0x9b2f('0x31'),_0x373fbe[_0x9b2f('0x1a')]),_0x3b1151);}});ami['on'](_0x9b2f('0x32'),function(_0x45ff2a){try{utils[_0x9b2f('0x14')](util['format'](_0x9b2f('0x33'),_0x45ff2a[_0x9b2f('0x34')]),_0x45ff2a);queues[_0x9b2f('0x32')](_0x45ff2a);transfers[_0x9b2f('0x32')](_0x45ff2a);agents[_0x9b2f('0x32')](_0x45ff2a);calls[_0x9b2f('0x32')](_0x45ff2a);}catch(_0x535cf2){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')](_0x9b2f('0x33'),_0x45ff2a[_0x9b2f('0x34')]),_0x535cf2);}});ami['on'](_0x9b2f('0x35'),function(_0x53833a){try{utils['debug'](util[_0x9b2f('0x15')]('[%s][index][varset]',_0x53833a[_0x9b2f('0x1a')]),_0x53833a);queues[_0x9b2f('0x35')](_0x53833a);recordings['varset'](_0x53833a);calls[_0x9b2f('0x35')](_0x53833a);dials[_0x9b2f('0x35')](_0x53833a);}catch(_0xb568db){utils['error'](util[_0x9b2f('0x15')](_0x9b2f('0x36'),_0x53833a[_0x9b2f('0x1a')]),_0xb568db);}});ami['on'](_0x9b2f('0x37'),function(_0x5a655a){try{utils[_0x9b2f('0x14')](util['format'](_0x9b2f('0x38'),_0x5a655a['uniqueid']),_0x5a655a);calls[_0x9b2f('0x37')](_0x5a655a);recordings['newexten'](_0x5a655a);dials[_0x9b2f('0x37')](_0x5a655a);}catch(_0x1d61af){utils['error'](util[_0x9b2f('0x15')](_0x9b2f('0x38'),_0x5a655a['uniqueid']),_0x1d61af);}});ami['on'](_0x9b2f('0x39'),function(_0x5d48bc){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')]('[%s][index][newchannel]',_0x5d48bc[_0x9b2f('0x1a')]),_0x5d48bc);calls[_0x9b2f('0x39')](_0x5d48bc);recordings[_0x9b2f('0x39')](_0x5d48bc);}catch(_0x573d6e){utils['error'](util[_0x9b2f('0x15')](_0x9b2f('0x3a'),_0x5d48bc[_0x9b2f('0x1a')]),_0x573d6e);}});ami['on'](_0x9b2f('0x3b'),function(_0x2d9c52){try{utils[_0x9b2f('0x14')](util[_0x9b2f('0x15')](_0x9b2f('0x3c'),_0x2d9c52[_0x9b2f('0x1a')]),_0x2d9c52);dials['dialbegin'](_0x2d9c52);}catch(_0x24966f){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')]('[%s]dialbegin',_0x2d9c52[_0x9b2f('0x1a')]),_0x24966f);}});ami['on'](_0x9b2f('0x3d'),function(_0x4df2c9){try{utils[_0x9b2f('0x14')](util['format'](_0x9b2f('0x3e'),_0x4df2c9[_0x9b2f('0x1a')]),_0x4df2c9);dials[_0x9b2f('0x3d')](_0x4df2c9);}catch(_0x3f1d2e){utils[_0x9b2f('0x10')](util[_0x9b2f('0x15')](_0x9b2f('0x3e'),_0x4df2c9['uniqueid']),_0x3f1d2e);}});}
\ No newline at end of file
index e41f1eb..646e357 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84e1=['then','catch','error','[%s][members][writeDB]','some','devicestatechange','debug','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','now','agent','NOT_INUSE','isNil','diffTime','exitAt','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','type','lodash','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName','split'];(function(_0x36fd1e,_0x561b08){var _0x1f533b=function(_0x322d67){while(--_0x322d67){_0x36fd1e['push'](_0x36fd1e['shift']());}};_0x1f533b(++_0x561b08);}(_0x84e1,0x1dc));var _0x184e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x84e1[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x184e('0x0'));var util=require(_0x184e('0x1'));var utils=require(_0x184e('0x2'));var members={};var exclude=[_0x184e('0x3'),_0x184e('0x4')];function writeDB(_0x4df769){utils['info'](util[_0x184e('0x5')](_0x184e('0x6'),_0x4df769[_0x184e('0x7')],_0x4df769[_0x184e('0x8')],_0x4df769[_0x184e('0x9')],_0x4df769[_0x184e('0xa')],_0x4df769[_0x184e('0xb')],_0x4df769['type']));if(_0x4df769[_0x184e('0x8')]){utils[_0x184e('0xc')](_0x4df769[_0x184e('0x8')])['then'](function(_0x66d238){if(_0x66d238){_0x4df769[_0x184e('0xb')]=_0x66d238[_0x184e('0xd')];_0x4df769[_0x184e('0xe')]=_0x66d238['internal'];utils[_0x184e('0xf')](_0x184e('0x10'),_0x4df769);}else{utils[_0x184e('0x11')](_0x4df769[_0x184e('0x8')][_0x184e('0x12')]('/')[0x1])[_0x184e('0x13')](function(_0x2568f4){if(_0x2568f4){_0x4df769[_0x184e('0xb')]=_0x2568f4[_0x184e('0xd')];_0x4df769[_0x184e('0xe')]=_0x2568f4[_0x184e('0xe')];utils[_0x184e('0xf')]('CreateMemberReport',_0x4df769);}});}})[_0x184e('0x14')](function(_0x50e4a6){utils[_0x184e('0x15')](util[_0x184e('0x5')](_0x184e('0x16'),_0x4df769[_0x184e('0x7')]),_0x50e4a6);});}delete members[_0x4df769[_0x184e('0x8')]];}function startsWith(_0x446813,_0x28047d){return _[_0x184e('0x17')](_0x446813,function(_0x10b179){return _['startsWith'](_0x28047d,_0x10b179);});}exports[_0x184e('0x18')]=function(_0x5d3a36){try{utils[_0x184e('0x19')](util['format']('[%s][members][devicestatechange]',members[_0x5d3a36[_0x184e('0x1a')]]?members[_0x5d3a36[_0x184e('0x1a')]][_0x184e('0x7')]:_0x5d3a36[_0x184e('0x1a')]),_0x5d3a36);utils[_0x184e('0x1b')](util[_0x184e('0x5')](_0x184e('0x1c'),members[_0x5d3a36[_0x184e('0x1a')]]?members[_0x5d3a36['device']]['uniqueid']:_0x5d3a36[_0x184e('0x1a')],_0x5d3a36[_0x184e('0x1d')],_0x5d3a36[_0x184e('0x1a')]));switch(_0x5d3a36[_0x184e('0x1d')]){case _0x184e('0x1e'):case'BUSY':if(!startsWith(exclude,_0x5d3a36[_0x184e('0x1a')])){members[_0x5d3a36[_0x184e('0x1a')]]={'channel':_0x184e('0x1f'),'interface':_0x5d3a36[_0x184e('0x1a')],'type':_0x184e('0x20'),'enterAt':utils[_0x184e('0x21')](),'role':_0x184e('0x22')};}break;case _0x184e('0x23'):if(!_[_0x184e('0x24')](members[_0x5d3a36[_0x184e('0x1a')]])){members[_0x5d3a36[_0x184e('0x1a')]]['exitAt']=utils[_0x184e('0x21')]();members[_0x5d3a36[_0x184e('0x1a')]]['duration']=utils[_0x184e('0x25')](members[_0x5d3a36[_0x184e('0x1a')]][_0x184e('0x26')],members[_0x5d3a36[_0x184e('0x1a')]][_0x184e('0x27')]);if(members[_0x5d3a36['device']][_0x184e('0x7')]){writeDB(members[_0x5d3a36['device']]);}}break;default:break;}}catch(_0x1c5bde){utils[_0x184e('0x15')](util['format'](_0x184e('0x28'),members[_0x5d3a36[_0x184e('0x1a')]]?members[_0x5d3a36[_0x184e('0x1a')]][_0x184e('0x7')]:_0x5d3a36['device']),_0x1c5bde);}};exports[_0x184e('0x29')]=function(_0x17fbcc){try{if(!_[_0x184e('0x24')](members[_0x17fbcc[_0x184e('0x8')]])){utils[_0x184e('0x19')](util[_0x184e('0x5')](_0x184e('0x2a'),_0x17fbcc[_0x184e('0x7')]),_0x17fbcc);utils[_0x184e('0x1b')](util['format'](_0x184e('0x2b'),_0x17fbcc[_0x184e('0x7')],_0x17fbcc['interface'],_0x17fbcc[_0x184e('0x2c')]));members[_0x17fbcc[_0x184e('0x8')]]=_[_0x184e('0x2d')](members[_0x17fbcc['interface']],{'data4':_0x17fbcc[_0x184e('0x2c')],'uniqueid':_0x17fbcc['uniqueid']});}}catch(_0x535fdb){utils[_0x184e('0x15')](util[_0x184e('0x5')]('[%s][members][agentcomplete]',_0x17fbcc[_0x184e('0x7')]),_0x535fdb);}};exports[_0x184e('0x2e')]=function(_0x2bd604){try{utils[_0x184e('0x19')](util[_0x184e('0x5')](_0x184e('0x2f'),_0x2bd604[_0x184e('0x7')]),_0x2bd604);if(_0x2bd604[_0x184e('0x9')]){var _0x3195a8=_0x2bd604['channel'][_0x184e('0x12')]('-')[0x0];if(!_[_0x184e('0x24')](members[_0x3195a8])){members[_0x3195a8]=_[_0x184e('0x2d')](members[_0x3195a8],{'data1':members[_0x3195a8]['data1']||_0x2bd604['type'],'data2':members[_0x3195a8][_0x184e('0xa')]||_0x2bd604[_0x184e('0x30')],'data3':members[_0x3195a8][_0x184e('0x31')]||_0x2bd604[_0x184e('0x32')],'uniqueid':members[_0x3195a8][_0x184e('0x7')]||_0x2bd604[_0x184e('0x7')]});utils['info'](util[_0x184e('0x5')](_0x184e('0x33'),_0x2bd604[_0x184e('0x7')],members[_0x3195a8][_0x184e('0x34')],members[_0x3195a8][_0x184e('0xa')],members[_0x3195a8][_0x184e('0x31')]));if(members[_0x3195a8][_0x184e('0x26')]){writeDB(members[_0x3195a8]);}}}if(_0x2bd604[_0x184e('0x35')]){var _0x48aa23=_0x2bd604[_0x184e('0x35')][_0x184e('0x12')]('-')[0x0];if(!_[_0x184e('0x24')](members[_0x48aa23])){members[_0x48aa23]=_[_0x184e('0x2d')](members[_0x48aa23],{'data1':members[_0x48aa23]['data1']||_0x2bd604[_0x184e('0x36')],'data2':members[_0x48aa23]['data2']||_0x2bd604[_0x184e('0x30')],'data3':members[_0x48aa23][_0x184e('0x31')]||_0x2bd604[_0x184e('0x32')],'uniqueid':members[_0x48aa23][_0x184e('0x7')]||_0x2bd604[_0x184e('0x7')]});utils['info'](util['format'](_0x184e('0x33'),_0x2bd604[_0x184e('0x7')],members[_0x48aa23]['data1'],members[_0x48aa23][_0x184e('0xa')],members[_0x48aa23][_0x184e('0x31')]));if(members[_0x48aa23][_0x184e('0x26')]){writeDB(members[_0x48aa23]);}}}}catch(_0x2f384a){utils[_0x184e('0x15')](util[_0x184e('0x5')]('[%s][members][cdr]',_0x2bd604[_0x184e('0x7')]),_0x2f384a);}};
\ No newline at end of file
+var _0x8135=['[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','membername','type','getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','split','error','[%s][members][writeDB]','some','startsWith','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','cdr','debug','[%s][members][cdr]','channel','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','data1','destinationchannel','util','./utils','Local/_attended@transfer','Queue:','info','format'];(function(_0x22cd98,_0x4af73c){var _0x5ab0f7=function(_0x147635){while(--_0x147635){_0x22cd98['push'](_0x22cd98['shift']());}};_0x5ab0f7(++_0x4af73c);}(_0x8135,0x99));var _0x5813=function(_0x14db00,_0x4ca78d){_0x14db00=_0x14db00-0x0;var _0x1e4be1=_0x8135[_0x14db00];return _0x1e4be1;};'use strict';var _=require('lodash');var util=require(_0x5813('0x0'));var utils=require(_0x5813('0x1'));var members={};var exclude=[_0x5813('0x2'),_0x5813('0x3')];function writeDB(_0x4b43a8){utils[_0x5813('0x4')](util[_0x5813('0x5')](_0x5813('0x6'),_0x4b43a8[_0x5813('0x7')],_0x4b43a8[_0x5813('0x8')],_0x4b43a8['channel'],_0x4b43a8['data2'],_0x4b43a8[_0x5813('0x9')],_0x4b43a8[_0x5813('0xa')]));if(_0x4b43a8[_0x5813('0x8')]){utils[_0x5813('0xb')](_0x4b43a8[_0x5813('0x8')])[_0x5813('0xc')](function(_0xcb7307){if(_0xcb7307){_0x4b43a8[_0x5813('0x9')]=_0xcb7307[_0x5813('0xd')];_0x4b43a8[_0x5813('0xe')]=_0xcb7307[_0x5813('0xe')];utils[_0x5813('0xf')](_0x5813('0x10'),_0x4b43a8);}else{utils[_0x5813('0x11')](_0x4b43a8[_0x5813('0x8')][_0x5813('0x12')]('/')[0x1])[_0x5813('0xc')](function(_0x58f641){if(_0x58f641){_0x4b43a8[_0x5813('0x9')]=_0x58f641[_0x5813('0xd')];_0x4b43a8[_0x5813('0xe')]=_0x58f641['internal'];utils[_0x5813('0xf')](_0x5813('0x10'),_0x4b43a8);}});}})['catch'](function(_0x183445){utils[_0x5813('0x13')](util['format'](_0x5813('0x14'),_0x4b43a8[_0x5813('0x7')]),_0x183445);});}delete members[_0x4b43a8[_0x5813('0x8')]];}function startsWith(_0x5044e9,_0x2bbf85){return _[_0x5813('0x15')](_0x5044e9,function(_0x5d2724){return _[_0x5813('0x16')](_0x2bbf85,_0x5d2724);});}exports['devicestatechange']=function(_0x56ebc0){try{utils['debug'](util['format']('[%s][members][devicestatechange]',members[_0x56ebc0[_0x5813('0x17')]]?members[_0x56ebc0[_0x5813('0x17')]][_0x5813('0x7')]:_0x56ebc0['device']),_0x56ebc0);utils[_0x5813('0x4')](util[_0x5813('0x5')](_0x5813('0x18'),members[_0x56ebc0[_0x5813('0x17')]]?members[_0x56ebc0['device']][_0x5813('0x7')]:_0x56ebc0[_0x5813('0x17')],_0x56ebc0[_0x5813('0x19')],_0x56ebc0[_0x5813('0x17')]));switch(_0x56ebc0['state']){case _0x5813('0x1a'):case _0x5813('0x1b'):if(!startsWith(exclude,_0x56ebc0[_0x5813('0x17')])){members[_0x56ebc0['device']]={'channel':_0x5813('0x1c'),'interface':_0x56ebc0[_0x5813('0x17')],'type':_0x5813('0x1d'),'enterAt':utils[_0x5813('0x1e')](),'role':_0x5813('0x1f')};}break;case _0x5813('0x20'):if(!_[_0x5813('0x21')](members[_0x56ebc0[_0x5813('0x17')]])){members[_0x56ebc0['device']][_0x5813('0x22')]=utils[_0x5813('0x1e')]();members[_0x56ebc0[_0x5813('0x17')]][_0x5813('0x23')]=utils[_0x5813('0x24')](members[_0x56ebc0[_0x5813('0x17')]][_0x5813('0x22')],members[_0x56ebc0['device']][_0x5813('0x25')]);if(members[_0x56ebc0[_0x5813('0x17')]][_0x5813('0x7')]){writeDB(members[_0x56ebc0['device']]);}}break;default:break;}}catch(_0x2051e9){utils[_0x5813('0x13')](util['format']('[%s][members][devicestatechange]',members[_0x56ebc0[_0x5813('0x17')]]?members[_0x56ebc0[_0x5813('0x17')]]['uniqueid']:_0x56ebc0['device']),_0x2051e9);}};exports[_0x5813('0x26')]=function(_0x6c57bd){try{if(!_[_0x5813('0x21')](members[_0x6c57bd[_0x5813('0x8')]])){utils['debug'](util['format'](_0x5813('0x27'),_0x6c57bd[_0x5813('0x7')]),_0x6c57bd);utils[_0x5813('0x4')](util['format'](_0x5813('0x28'),_0x6c57bd[_0x5813('0x7')],_0x6c57bd[_0x5813('0x8')],_0x6c57bd['queue']));members[_0x6c57bd[_0x5813('0x8')]]=_[_0x5813('0x29')](members[_0x6c57bd[_0x5813('0x8')]],{'data4':_0x6c57bd['queue'],'uniqueid':_0x6c57bd[_0x5813('0x7')]});}}catch(_0x7c1a02){utils[_0x5813('0x13')](util[_0x5813('0x5')](_0x5813('0x27'),_0x6c57bd[_0x5813('0x7')]),_0x7c1a02);}};exports[_0x5813('0x2a')]=function(_0x506ba9){try{utils[_0x5813('0x2b')](util[_0x5813('0x5')](_0x5813('0x2c'),_0x506ba9[_0x5813('0x7')]),_0x506ba9);if(_0x506ba9[_0x5813('0x2d')]){var _0x55bcd0=_0x506ba9[_0x5813('0x2d')][_0x5813('0x12')]('-')[0x0];if(!_[_0x5813('0x21')](members[_0x55bcd0])){members[_0x55bcd0]=_[_0x5813('0x29')](members[_0x55bcd0],{'data1':members[_0x55bcd0]['data1']||_0x506ba9['type'],'data2':members[_0x55bcd0][_0x5813('0x2e')]||_0x506ba9[_0x5813('0x2f')],'data3':members[_0x55bcd0][_0x5813('0x30')]||_0x506ba9[_0x5813('0x31')],'uniqueid':members[_0x55bcd0]['uniqueid']||_0x506ba9[_0x5813('0x7')]});utils['info'](util[_0x5813('0x5')](_0x5813('0x32'),_0x506ba9[_0x5813('0x7')],members[_0x55bcd0][_0x5813('0x33')],members[_0x55bcd0][_0x5813('0x2e')],members[_0x55bcd0][_0x5813('0x30')]));if(members[_0x55bcd0][_0x5813('0x22')]){writeDB(members[_0x55bcd0]);}}}if(_0x506ba9['destinationchannel']){var _0x3d7e7f=_0x506ba9[_0x5813('0x34')]['split']('-')[0x0];if(!_[_0x5813('0x21')](members[_0x3d7e7f])){members[_0x3d7e7f]=_[_0x5813('0x29')](members[_0x3d7e7f],{'data1':members[_0x3d7e7f][_0x5813('0x33')]||_0x506ba9[_0x5813('0xa')],'data2':members[_0x3d7e7f][_0x5813('0x2e')]||_0x506ba9[_0x5813('0x2f')],'data3':members[_0x3d7e7f][_0x5813('0x30')]||_0x506ba9['destination'],'uniqueid':members[_0x3d7e7f][_0x5813('0x7')]||_0x506ba9[_0x5813('0x7')]});utils[_0x5813('0x4')](util[_0x5813('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x506ba9[_0x5813('0x7')],members[_0x3d7e7f][_0x5813('0x33')],members[_0x3d7e7f][_0x5813('0x2e')],members[_0x3d7e7f]['data3']));if(members[_0x3d7e7f][_0x5813('0x22')]){writeDB(members[_0x3d7e7f]);}}}}catch(_0xcfe61a){utils['error'](util[_0x5813('0x5')](_0x5813('0x2c'),_0x506ba9[_0x5813('0x7')]),_0xcfe61a);}};
\ No newline at end of file
index 8d579c1..57d8780 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7479=['count','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','queuecallerexitAt','assigned','agentcomplete','queuecallercomplete','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transferexten','transferuniqueid','extension','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','origtransfererexten','transfertype','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','lastAssignedTo','calleridnum','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','[%s][queues][queuecallerjoin]','queue','position','assign','now','error','isNil','debug','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queueposition','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','queuecallerjoinAt'];(function(_0x49f8dd,_0x109e71){var _0x14dcfd=function(_0x138667){while(--_0x138667){_0x49f8dd['push'](_0x49f8dd['shift']());}};_0x14dcfd(++_0x109e71);}(_0x7479,0x8f));var _0x9747=function(_0x635c9b,_0x5b65c2){_0x635c9b=_0x635c9b-0x0;var _0x20afaf=_0x7479[_0x635c9b];return _0x20afaf;};'use strict';var _=require(_0x9747('0x0'));var util=require(_0x9747('0x1'));var utils=require(_0x9747('0x2'));var queues={};function writeDB(_0x28d1f8){utils[_0x9747('0x3')](util[_0x9747('0x4')](_0x9747('0x5'),_0x28d1f8[_0x9747('0x6')],_0x28d1f8[_0x9747('0x7')],_0x28d1f8['queue'],_0x28d1f8[_0x9747('0x8')],_0x28d1f8[_0x9747('0x9')],_0x28d1f8['accountcode'],_0x28d1f8[_0x9747('0xa')]));if(_0x28d1f8['queue']){utils[_0x9747('0xb')](_0x28d1f8['queue'])[_0x9747('0xc')](function(_0x30c067){if(_0x30c067){_0x28d1f8['type']=_0x30c067[_0x9747('0xd')];}utils[_0x9747('0xe')]('CreateVoiceQueueReport',_0x28d1f8);});}else{utils[_0x9747('0xe')](_0x9747('0xf'),_0x28d1f8);}if(_0x28d1f8['transfereduniqueid']){delete queues[_0x28d1f8[_0x9747('0x10')]];}else{delete queues[_0x28d1f8[_0x9747('0x6')]];}}exports[_0x9747('0x11')]=function(_0x2686d1){try{utils['debug'](util['format'](_0x9747('0x12'),_0x2686d1[_0x9747('0x6')]),_0x2686d1);utils[_0x9747('0x3')](util[_0x9747('0x4')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x2686d1['uniqueid'],_0x2686d1[_0x9747('0x13')],_0x2686d1[_0x9747('0x14')]));queues[_0x2686d1['uniqueid']]=_[_0x9747('0x15')](_0x2686d1,{'originalposition':_0x2686d1['position'],'queuecallerjoinAt':utils[_0x9747('0x16')](),'mohtime':0x0});}catch(_0x8b6bf7){utils[_0x9747('0x17')](util['format'](_0x9747('0x12'),_0x2686d1[_0x9747('0x6')]),_0x8b6bf7);}};exports['hangup']=function(_0x353817){try{if(!_[_0x9747('0x18')](queues[_0x353817[_0x9747('0x6')]])){utils[_0x9747('0x19')](util[_0x9747('0x4')](_0x9747('0x1a'),_0x353817['uniqueid']),_0x353817);if(queues[_0x353817[_0x9747('0x6')]][_0x9747('0x1b')]){if(!queues[_0x353817[_0x9747('0x6')]][_0x9747('0x1c')]&&!queues[_0x353817['uniqueid']][_0x9747('0x1d')]){queues[_0x353817[_0x9747('0x6')]]['queuecallercomplete']=!![];queues[_0x353817[_0x9747('0x6')]][_0x9747('0x1e')]=utils[_0x9747('0x16')]();queues[_0x353817[_0x9747('0x6')]][_0x9747('0xa')]=_0x9747('0x1f');}utils[_0x9747('0x3')](util[_0x9747('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x353817[_0x9747('0x6')],queues[_0x353817[_0x9747('0x6')]][_0x9747('0x20')],queues[_0x353817[_0x9747('0x6')]][_0x9747('0xa')]));writeDB(queues[_0x353817[_0x9747('0x6')]]);}else if(queues[_0x353817[_0x9747('0x6')]][_0x9747('0x10')]){utils[_0x9747('0x3')](util[_0x9747('0x4')](_0x9747('0x21'),_0x353817['uniqueid'],queues[_0x353817[_0x9747('0x6')]][_0x9747('0x20')],queues[_0x353817['uniqueid']]['transfereduniqueid']));queues[queues[_0x353817['uniqueid']][_0x9747('0x10')]]=queues[_0x353817['uniqueid']];queues[queues[_0x353817[_0x9747('0x6')]][_0x9747('0x10')]][_0x9747('0x22')]=0x2;delete queues[_0x353817[_0x9747('0x6')]];}}}catch(_0x43b9a3){utils['error'](util[_0x9747('0x4')]('[%s][queues][hangup]',_0x353817['uniqueid']),_0x43b9a3);}};exports[_0x9747('0x23')]=function(_0x5aec9a){try{utils[_0x9747('0x19')](util['format'](_0x9747('0x24'),_0x5aec9a[_0x9747('0x6')]),_0x5aec9a);if(!_['isNil'](_0x5aec9a[_0x9747('0x25')][_0x9747('0x26')])&&_0x5aec9a[_0x9747('0x27')][_0x9747('0x28')]()!==_0x9747('0x29')){if(!_[_0x9747('0x18')](queues[_0x5aec9a[_0x9747('0x6')]])){queues[_0x5aec9a['uniqueid']][_0x9747('0x1c')]=![];queues[_0x5aec9a[_0x9747('0x6')]][_0x9747('0x2a')]=null;queues[_0x5aec9a[_0x9747('0x6')]][_0x9747('0x1d')]=!![];queues[_0x5aec9a[_0x9747('0x6')]]['queuecallerexitAt']=utils[_0x9747('0x16')]();queues[_0x5aec9a['uniqueid']][_0x9747('0xa')]=_0x5aec9a['value'][_0x9747('0x28')]();utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x5aec9a[_0x9747('0x6')],queues[_0x5aec9a[_0x9747('0x6')]][_0x9747('0x20')],_0x5aec9a[_0x9747('0x27')],queues[_0x5aec9a[_0x9747('0x6')]][_0x9747('0xa')]));writeDB(queues[_0x5aec9a[_0x9747('0x6')]]);}}else if(!_['isNil'](_0x5aec9a['variable'][_0x9747('0x2b')])){if(!_[_0x9747('0x18')](queues[_0x5aec9a[_0x9747('0x6')]])&&!queues[_0x5aec9a['uniqueid']][_0x9747('0x1c')]){queues[_0x5aec9a['uniqueid']][_0x9747('0x1c')]=![];queues[_0x5aec9a[_0x9747('0x6')]]['queuecallerabandonAt']=null;queues[_0x5aec9a[_0x9747('0x6')]][_0x9747('0x1d')]=!![];queues[_0x5aec9a['uniqueid']]['queuecallerexitAt']=utils[_0x9747('0x16')]();queues[_0x5aec9a[_0x9747('0x6')]][_0x9747('0xa')]='EXITWITHKEY';utils['info'](util[_0x9747('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x5aec9a['uniqueid'],queues[_0x5aec9a[_0x9747('0x6')]][_0x9747('0x20')],_0x5aec9a[_0x9747('0x27')],queues[_0x5aec9a['uniqueid']][_0x9747('0xa')]));}}}catch(_0x2e3631){utils[_0x9747('0x17')](util[_0x9747('0x4')](_0x9747('0x24'),_0x5aec9a[_0x9747('0x6')]),_0x2e3631);}};exports[_0x9747('0x1c')]=function(_0x47840d){try{if(!_[_0x9747('0x18')](queues[_0x47840d[_0x9747('0x6')]])){utils[_0x9747('0x19')](util[_0x9747('0x4')](_0x9747('0x2c'),_0x47840d[_0x9747('0x6')]),_0x47840d);queues[_0x47840d['uniqueid']][_0x9747('0x1d')]=![];queues[_0x47840d[_0x9747('0x6')]]['queuecallerexitAt']=null;queues[_0x47840d[_0x9747('0x6')]][_0x9747('0x1c')]=!![];queues[_0x47840d[_0x9747('0x6')]]['queuecallerabandonAt']=utils[_0x9747('0x16')]();queues[_0x47840d[_0x9747('0x6')]][_0x9747('0xa')]=_0x9747('0x2d');utils['info'](util[_0x9747('0x4')](_0x9747('0x2e'),_0x47840d[_0x9747('0x6')],queues[_0x47840d['uniqueid']][_0x9747('0x20')],queues[_0x47840d[_0x9747('0x6')]][_0x9747('0xa')]));}}catch(_0x50fd0b){utils['error'](util[_0x9747('0x4')](_0x9747('0x2c'),_0x47840d[_0x9747('0x6')]),_0x50fd0b);}};exports['queuecallerleave']=function(_0x1aa707){try{if(!_['isNil'](queues[_0x1aa707['uniqueid']])){utils[_0x9747('0x19')](util['format'](_0x9747('0x2f'),_0x1aa707[_0x9747('0x6')]),_0x1aa707);utils[_0x9747('0x3')](util[_0x9747('0x4')](_0x9747('0x30'),_0x1aa707['uniqueid'],queues[_0x1aa707[_0x9747('0x6')]]['name'],_0x1aa707[_0x9747('0x31')],_0x1aa707[_0x9747('0x32')]));queues[_0x1aa707[_0x9747('0x6')]][_0x9747('0x33')]=!![];queues[_0x1aa707[_0x9747('0x6')]]['queuecallerleaveAt']=utils[_0x9747('0x16')]();queues[_0x1aa707['uniqueid']][_0x9747('0x34')]=utils[_0x9747('0x35')](queues[_0x1aa707['uniqueid']][_0x9747('0x1b')],queues[_0x1aa707[_0x9747('0x6')]][_0x9747('0x36')]);queues[_0x1aa707[_0x9747('0x6')]][_0x9747('0x14')]=_0x1aa707[_0x9747('0x14')];queues[_0x1aa707[_0x9747('0x6')]][_0x9747('0x37')]=_0x1aa707[_0x9747('0x37')];queues[_0x1aa707[_0x9747('0x6')]]['connectedlinenum']=_0x1aa707[_0x9747('0x31')];queues[_0x1aa707['uniqueid']][_0x9747('0x32')]=_0x1aa707['connectedlinename'];}}catch(_0x5db133){utils[_0x9747('0x17')](util[_0x9747('0x4')](_0x9747('0x2f'),_0x1aa707['uniqueid']),_0x5db133);}};exports[_0x9747('0x38')]=function(_0x41d89d){try{if(!_[_0x9747('0x18')](queues[_0x41d89d['uniqueid']])){utils[_0x9747('0x19')](util[_0x9747('0x4')](_0x9747('0x39'),_0x41d89d[_0x9747('0x6')]),_0x41d89d);utils[_0x9747('0x3')](util[_0x9747('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x41d89d[_0x9747('0x6')],queues[_0x41d89d[_0x9747('0x6')]]['name'],_0x41d89d[_0x9747('0x3a')],_0x41d89d[_0x9747('0x3b')]));queues[_0x41d89d['uniqueid']][_0x9747('0x1c')]=![];queues[_0x41d89d[_0x9747('0x6')]][_0x9747('0x1c')]=![];queues[_0x41d89d[_0x9747('0x6')]][_0x9747('0x2a')]=null;queues[_0x41d89d['uniqueid']][_0x9747('0x1d')]=![];queues[_0x41d89d[_0x9747('0x6')]][_0x9747('0xa')]=null;queues[_0x41d89d[_0x9747('0x6')]][_0x9747('0x3c')]=null;queues[_0x41d89d[_0x9747('0x6')]][_0x9747('0x3d')]=!![];queues[_0x41d89d[_0x9747('0x6')]]['accountcode']=_0x41d89d[_0x9747('0x3b')];queues[_0x41d89d[_0x9747('0x6')]][_0x9747('0x8')]=_0x41d89d['membername'];}}catch(_0x3d32b2){utils[_0x9747('0x17')](util[_0x9747('0x4')](_0x9747('0x39'),_0x41d89d[_0x9747('0x6')]),_0x3d32b2);}};exports[_0x9747('0x3e')]=function(_0x51d1d0){try{if(!_[_0x9747('0x18')](queues[_0x51d1d0[_0x9747('0x6')]])){if(queues[_0x51d1d0[_0x9747('0x6')]]['queuecallerleaveAt']){utils[_0x9747('0x19')](util[_0x9747('0x4')]('[%s][queues][agentcomplete]',_0x51d1d0[_0x9747('0x6')]),_0x51d1d0);queues[_0x51d1d0[_0x9747('0x6')]][_0x9747('0x1c')]=![];queues[_0x51d1d0[_0x9747('0x6')]]['queuecallerabandon']=![];queues[_0x51d1d0['uniqueid']][_0x9747('0x2a')]=null;queues[_0x51d1d0[_0x9747('0x6')]][_0x9747('0x1d')]=![];queues[_0x51d1d0[_0x9747('0x6')]]['queuecallerexitAt']=null;queues[_0x51d1d0[_0x9747('0x6')]][_0x9747('0x3d')]=!![];queues[_0x51d1d0[_0x9747('0x6')]]['lastAssignedTo']=_0x51d1d0[_0x9747('0x3a')];queues[_0x51d1d0[_0x9747('0x6')]][_0x9747('0x3f')]=!![];queues[_0x51d1d0[_0x9747('0x6')]]['queuecallercompleteAt']=utils['now']();if(_0x51d1d0[_0x9747('0x40')]=='transfer'){if(!queues[_0x51d1d0[_0x9747('0x6')]][_0x9747('0x41')]){queues[_0x51d1d0['uniqueid']]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x51d1d0[_0x9747('0x6')]]['queuecallerexitreason']=_0x9747('0x42')+_0x51d1d0[_0x9747('0x40')][_0x9747('0x28')]();}utils[_0x9747('0x3')](util[_0x9747('0x4')](_0x9747('0x43'),_0x51d1d0[_0x9747('0x6')],queues[_0x51d1d0[_0x9747('0x6')]][_0x9747('0x20')],_0x51d1d0[_0x9747('0x3a')],queues[_0x51d1d0['uniqueid']][_0x9747('0xa')]));writeDB(queues[_0x51d1d0['uniqueid']]);}}}catch(_0x3193f5){utils['error'](util[_0x9747('0x4')](_0x9747('0x44'),_0x51d1d0['uniqueid']),_0x3193f5);}};exports[_0x9747('0x45')]=function(_0xadb278){try{if(!_[_0x9747('0x18')](queues[_0xadb278['transfereeuniqueid']])){utils[_0x9747('0x19')](util[_0x9747('0x4')](_0x9747('0x46'),_0xadb278[_0x9747('0x6')]),_0xadb278);queues[_0xadb278['transfereeuniqueid']]['transfer']=!![];queues[_0xadb278['transfereeuniqueid']]['transfertype']='BLIND';queues[_0xadb278[_0x9747('0x47')]][_0x9747('0x48')]=_0xadb278['extension'];queues[_0xadb278[_0x9747('0x47')]][_0x9747('0x49')]=_0xadb278[_0x9747('0x47')];queues[_0xadb278[_0x9747('0x47')]][_0x9747('0xa')]='BLINDTRANSFER';utils[_0x9747('0x3')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0xadb278[_0x9747('0x6')],queues[_0xadb278['transfereeuniqueid']][_0x9747('0x20')],_0xadb278[_0x9747('0x47')],_0xadb278[_0x9747('0x4a')]));}}catch(_0x3cbce1){utils[_0x9747('0x17')](util[_0x9747('0x4')](_0x9747('0x46'),_0xadb278['uniqueid']),_0x3cbce1);}};exports['attendedtransfer']=function(_0x414236){try{utils[_0x9747('0x19')](util[_0x9747('0x4')](_0x9747('0x4b'),_0x414236['origtransfereruniqueid']),_0x414236);if(_0x414236[_0x9747('0x4c')]==_0x414236['origtransfererlinkedid']){if(!_[_0x9747('0x18')](queues[_0x414236[_0x9747('0x4d')]])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x414236['origtransfereruniqueid'],queues[_0x414236[_0x9747('0x4d')]][_0x9747('0x20')],_0x414236[_0x9747('0x4e')]));queues[_0x414236['secondtransfererlinkedid']]['transfer']=!![];queues[_0x414236['secondtransfererlinkedid']][_0x9747('0x4f')]=_0x9747('0x50');queues[_0x414236[_0x9747('0x4d')]]['transferexten']=_0x414236['origtransfererexten'];queues[_0x414236[_0x9747('0x4d')]]['transferuniqueid']=_0x414236[_0x9747('0x4c')];queues[_0x414236[_0x9747('0x4d')]][_0x9747('0xa')]=_0x9747('0x51');}if(!_[_0x9747('0x18')](queues[_0x414236[_0x9747('0x52')]])){if(_0x414236[_0x9747('0x53')]&&queues[_0x414236[_0x9747('0x53')]]){queues[_0x414236[_0x9747('0x53')]][_0x9747('0x22')]=0x1;queues[_0x414236[_0x9747('0x47')]]=_[_0x9747('0x54')](queues[_0x414236['transfereelinkedid']]);queues[_0x414236[_0x9747('0x47')]][_0x9747('0x10')]=_0x414236['transfertargetuniqueid'];queues[_0x414236[_0x9747('0x47')]][_0x9747('0x22')]=0x2;queues[_0x414236[_0x9747('0x47')]][_0x9747('0x9')]=queues[_0x414236[_0x9747('0x4d')]][_0x9747('0x9')];queues[_0x414236[_0x9747('0x47')]][_0x9747('0x55')]=queues[_0x414236[_0x9747('0x4d')]][_0x9747('0x55')];queues[_0x414236[_0x9747('0x47')]][_0x9747('0x36')]=utils['now']();queues[_0x414236[_0x9747('0x47')]]['queuecallerleaveAt']=utils[_0x9747('0x16')]();queues[_0x414236[_0x9747('0x47')]]['holdtime']=0x0;queues[_0x414236[_0x9747('0x47')]]['mohtime']=0x0;utils['info'](util['format'](_0x9747('0x56'),_0x414236['origtransfereruniqueid'],queues[_0x414236[_0x9747('0x47')]][_0x9747('0x20')],queues[_0x414236['transfereeuniqueid']][_0x9747('0x9')],queues[_0x414236[_0x9747('0x47')]][_0x9747('0x55')]));}else{utils[_0x9747('0x3')](util['format'](_0x9747('0x57'),_0x414236[_0x9747('0x4c')],queues[_0x414236[_0x9747('0x52')]][_0x9747('0x20')],_0x414236['secondtransfererlinkedid']));queues[_0x414236['origtransfererlinkedid']][_0x9747('0x10')]=_0x414236[_0x9747('0x4d')];}}}else if(_0x414236[_0x9747('0x58')]==_0x414236[_0x9747('0x4d')]){if(!_[_0x9747('0x18')](queues[_0x414236[_0x9747('0x52')]])){utils[_0x9747('0x3')](util[_0x9747('0x4')](_0x9747('0x59'),_0x414236[_0x9747('0x4c')],queues[_0x414236[_0x9747('0x52')]][_0x9747('0x20')],_0x414236['secondtransfereruniqueid'],_0x414236[_0x9747('0x5a')]));queues[_0x414236[_0x9747('0x52')]][_0x9747('0x41')]=!![];queues[_0x414236[_0x9747('0x52')]][_0x9747('0x4f')]=_0x9747('0x50');queues[_0x414236[_0x9747('0x52')]][_0x9747('0x48')]=_0x414236[_0x9747('0x5a')];queues[_0x414236[_0x9747('0x52')]]['transferuniqueid']=_0x414236[_0x9747('0x58')];queues[_0x414236[_0x9747('0x52')]]['queuecallerexitreason']=_0x9747('0x51');}if(!_[_0x9747('0x18')](queues[_0x414236[_0x9747('0x4d')]])){if(_0x414236[_0x9747('0x5b')]&&queues[_0x414236['transfertargetlinkedid']]){queues[_0x414236[_0x9747('0x5b')]][_0x9747('0x22')]=0x1;queues[_0x414236[_0x9747('0x5c')]]=_[_0x9747('0x54')](queues[_0x414236[_0x9747('0x5b')]]);queues[_0x414236[_0x9747('0x5c')]][_0x9747('0x10')]=_0x414236['transfertargetuniqueid'];queues[_0x414236['transfertargetuniqueid']][_0x9747('0x22')]=0x2;queues[_0x414236[_0x9747('0x5c')]][_0x9747('0x9')]=queues[_0x414236[_0x9747('0x52')]]['calleridnum'];queues[_0x414236[_0x9747('0x5c')]][_0x9747('0x55')]=queues[_0x414236[_0x9747('0x52')]][_0x9747('0x55')];queues[_0x414236['transfertargetuniqueid']][_0x9747('0x36')]=utils[_0x9747('0x16')]();queues[_0x414236['transfertargetuniqueid']]['queuecallerleaveAt']=utils[_0x9747('0x16')]();queues[_0x414236['transfertargetuniqueid']][_0x9747('0x34')]=0x0;queues[_0x414236[_0x9747('0x5c')]]['mohtime']=0x0;utils['info'](util[_0x9747('0x4')](_0x9747('0x5d'),_0x414236['origtransfereruniqueid'],queues[_0x414236['transfertargetuniqueid']][_0x9747('0x20')],queues[_0x414236[_0x9747('0x5c')]][_0x9747('0x10')],queues[_0x414236['transfertargetuniqueid']][_0x9747('0x9')],queues[_0x414236[_0x9747('0x5c')]][_0x9747('0x55')]));}else{utils[_0x9747('0x3')](util[_0x9747('0x4')](_0x9747('0x57'),_0x414236[_0x9747('0x4c')],queues[_0x414236[_0x9747('0x4d')]][_0x9747('0x20')],_0x414236[_0x9747('0x52')]));queues[_0x414236[_0x9747('0x4d')]][_0x9747('0x10')]=_0x414236[_0x9747('0x52')];}}}}catch(_0x4e33ae){utils[_0x9747('0x17')](util[_0x9747('0x4')]('[%s][queues][attendedtransfer]',_0x414236[_0x9747('0x4c')]),_0x4e33ae);}};exports[_0x9747('0x5e')]=function(_0x14b250){try{if(!_[_0x9747('0x18')](queues[_0x14b250[_0x9747('0x6')]])){utils[_0x9747('0x19')](util[_0x9747('0x4')](_0x9747('0x5f'),_0x14b250['uniqueid']),_0x14b250);queues[_0x14b250[_0x9747('0x6')]][_0x9747('0x60')]=utils['now']();utils[_0x9747('0x3')](util[_0x9747('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x14b250[_0x9747('0x6')],queues[_0x14b250[_0x9747('0x6')]][_0x9747('0x20')],queues[_0x14b250['uniqueid']]['musiconholdstartAt']));}}catch(_0x498f6a){utils[_0x9747('0x17')](util[_0x9747('0x4')](_0x9747('0x5f'),_0x14b250[_0x9747('0x6')]),_0x498f6a);}};exports['musiconholdstop']=function(_0x1a92e7){try{if(!_['isNil'](queues[_0x1a92e7['uniqueid']])){if(!_[_0x9747('0x18')](queues[_0x1a92e7[_0x9747('0x6')]]['musiconholdstartAt'])){utils[_0x9747('0x19')](util[_0x9747('0x4')]('[%s][queues][musiconholdstop]',_0x1a92e7[_0x9747('0x6')]),_0x1a92e7);queues[_0x1a92e7[_0x9747('0x6')]][_0x9747('0x61')]+=utils[_0x9747('0x35')](utils[_0x9747('0x16')](),queues[_0x1a92e7[_0x9747('0x6')]][_0x9747('0x60')]);utils[_0x9747('0x3')](util['format'](_0x9747('0x62'),_0x1a92e7[_0x9747('0x6')],queues[_0x1a92e7[_0x9747('0x6')]][_0x9747('0x20')],queues[_0x1a92e7[_0x9747('0x6')]][_0x9747('0x61')]));delete queues[_0x1a92e7[_0x9747('0x6')]][_0x9747('0x60')];}}}catch(_0x1ee3fc){utils[_0x9747('0x17')](util['format']('[%s][queues][musiconholdstop]',_0x1a92e7[_0x9747('0x6')]),_0x1ee3fc);}};
\ No newline at end of file
+var _0x6a42=['secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','calleridnum','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','util','./utils','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','info','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','transfer','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid'];(function(_0x4c6850,_0x4a8d10){var _0x453564=function(_0x79e91){while(--_0x79e91){_0x4c6850['push'](_0x4c6850['shift']());}};_0x453564(++_0x4a8d10);}(_0x6a42,0xe8));var _0x26a4=function(_0x3c84c5,_0x1d6b22){_0x3c84c5=_0x3c84c5-0x0;var _0x4d94a4=_0x6a42[_0x3c84c5];return _0x4d94a4;};'use strict';var _=require('lodash');var util=require(_0x26a4('0x0'));var utils=require(_0x26a4('0x1'));var queues={};function writeDB(_0x418cf1){utils['info'](util['format'](_0x26a4('0x2'),_0x418cf1[_0x26a4('0x3')],_0x418cf1[_0x26a4('0x4')],_0x418cf1[_0x26a4('0x5')],_0x418cf1[_0x26a4('0x6')],_0x418cf1['calleridnum'],_0x418cf1[_0x26a4('0x7')],_0x418cf1[_0x26a4('0x8')]));if(_0x418cf1[_0x26a4('0x5')]){utils[_0x26a4('0x9')](_0x418cf1[_0x26a4('0x5')])[_0x26a4('0xa')](function(_0x483e17){if(_0x483e17){_0x418cf1[_0x26a4('0xb')]=_0x483e17['type'];}utils[_0x26a4('0xc')](_0x26a4('0xd'),_0x418cf1);});}else{utils[_0x26a4('0xc')]('CreateVoiceQueueReport',_0x418cf1);}if(_0x418cf1[_0x26a4('0xe')]){delete queues[_0x418cf1[_0x26a4('0xe')]];}else{delete queues[_0x418cf1['uniqueid']];}}exports[_0x26a4('0xf')]=function(_0x3f77f0){try{utils[_0x26a4('0x10')](util[_0x26a4('0x11')](_0x26a4('0x12'),_0x3f77f0[_0x26a4('0x3')]),_0x3f77f0);utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x14'),_0x3f77f0[_0x26a4('0x3')],_0x3f77f0[_0x26a4('0x5')],_0x3f77f0[_0x26a4('0x15')]));queues[_0x3f77f0[_0x26a4('0x3')]]=_[_0x26a4('0x16')](_0x3f77f0,{'originalposition':_0x3f77f0['position'],'queuecallerjoinAt':utils[_0x26a4('0x17')](),'mohtime':0x0});}catch(_0x1864c9){utils[_0x26a4('0x18')](util[_0x26a4('0x11')](_0x26a4('0x12'),_0x3f77f0['uniqueid']),_0x1864c9);}};exports[_0x26a4('0x19')]=function(_0x1f2813){try{if(!_[_0x26a4('0x1a')](queues[_0x1f2813[_0x26a4('0x3')]])){utils[_0x26a4('0x10')](util[_0x26a4('0x11')](_0x26a4('0x1b'),_0x1f2813['uniqueid']),_0x1f2813);if(queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0x1c')]){if(!queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0x1d')]&&!queues[_0x1f2813['uniqueid']]['queuecallerexit']){queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0x1e')]=!![];queues[_0x1f2813[_0x26a4('0x3')]]['queuecallercompleteAt']=utils[_0x26a4('0x17')]();queues[_0x1f2813['uniqueid']][_0x26a4('0x8')]=_0x26a4('0x1f');}utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x20'),_0x1f2813[_0x26a4('0x3')],queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0x21')],queues[_0x1f2813[_0x26a4('0x3')]]['queuecallerexitreason']));writeDB(queues[_0x1f2813[_0x26a4('0x3')]]);}else if(queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0xe')]){utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x22'),_0x1f2813[_0x26a4('0x3')],queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0x21')],queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0xe')]));queues[queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0xe')]]=queues[_0x1f2813[_0x26a4('0x3')]];queues[queues[_0x1f2813[_0x26a4('0x3')]][_0x26a4('0xe')]][_0x26a4('0x23')]=0x2;delete queues[_0x1f2813['uniqueid']];}}}catch(_0x2b027d){utils['error'](util[_0x26a4('0x11')]('[%s][queues][hangup]',_0x1f2813[_0x26a4('0x3')]),_0x2b027d);}};exports[_0x26a4('0x24')]=function(_0x48b31f){try{utils[_0x26a4('0x10')](util[_0x26a4('0x11')]('[%s][queues][varset]',_0x48b31f[_0x26a4('0x3')]),_0x48b31f);if(!_[_0x26a4('0x1a')](_0x48b31f[_0x26a4('0x25')][_0x26a4('0x26')])&&_0x48b31f[_0x26a4('0x27')][_0x26a4('0x28')]()!=='CONTINUE'){if(!_['isNil'](queues[_0x48b31f[_0x26a4('0x3')]])){queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x29')]=null;queues[_0x48b31f['uniqueid']][_0x26a4('0x2a')]=!![];queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x2b')]=utils[_0x26a4('0x17')]();queues[_0x48b31f['uniqueid']][_0x26a4('0x8')]=_0x48b31f[_0x26a4('0x27')][_0x26a4('0x28')]();utils[_0x26a4('0x13')](util['format'](_0x26a4('0x2c'),_0x48b31f['uniqueid'],queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x21')],_0x48b31f['value'],queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x8')]));writeDB(queues[_0x48b31f[_0x26a4('0x3')]]);}}else if(!_[_0x26a4('0x1a')](_0x48b31f[_0x26a4('0x25')][_0x26a4('0x2d')])){if(!_[_0x26a4('0x1a')](queues[_0x48b31f[_0x26a4('0x3')]])&&!queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x1d')]){queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x29')]=null;queues[_0x48b31f['uniqueid']][_0x26a4('0x2a')]=!![];queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x2b')]=utils[_0x26a4('0x17')]();queues[_0x48b31f[_0x26a4('0x3')]]['queuecallerexitreason']='EXITWITHKEY';utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x2e'),_0x48b31f[_0x26a4('0x3')],queues[_0x48b31f[_0x26a4('0x3')]][_0x26a4('0x21')],_0x48b31f[_0x26a4('0x27')],queues[_0x48b31f['uniqueid']][_0x26a4('0x8')]));}}}catch(_0x25d680){utils[_0x26a4('0x18')](util[_0x26a4('0x11')](_0x26a4('0x2f'),_0x48b31f[_0x26a4('0x3')]),_0x25d680);}};exports[_0x26a4('0x1d')]=function(_0x62618c){try{if(!_[_0x26a4('0x1a')](queues[_0x62618c[_0x26a4('0x3')]])){utils['debug'](util[_0x26a4('0x11')](_0x26a4('0x30'),_0x62618c[_0x26a4('0x3')]),_0x62618c);queues[_0x62618c['uniqueid']][_0x26a4('0x2a')]=![];queues[_0x62618c[_0x26a4('0x3')]][_0x26a4('0x2b')]=null;queues[_0x62618c[_0x26a4('0x3')]][_0x26a4('0x1d')]=!![];queues[_0x62618c['uniqueid']]['queuecallerabandonAt']=utils['now']();queues[_0x62618c[_0x26a4('0x3')]]['queuecallerexitreason']=_0x26a4('0x31');utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x32'),_0x62618c[_0x26a4('0x3')],queues[_0x62618c['uniqueid']][_0x26a4('0x21')],queues[_0x62618c['uniqueid']][_0x26a4('0x8')]));}}catch(_0x5aaf40){utils[_0x26a4('0x18')](util['format']('[%s][queues][queuecallerabandon]',_0x62618c[_0x26a4('0x3')]),_0x5aaf40);}};exports[_0x26a4('0x33')]=function(_0x231076){try{if(!_[_0x26a4('0x1a')](queues[_0x231076[_0x26a4('0x3')]])){utils[_0x26a4('0x10')](util['format'](_0x26a4('0x34'),_0x231076[_0x26a4('0x3')]),_0x231076);utils['info'](util[_0x26a4('0x11')](_0x26a4('0x35'),_0x231076[_0x26a4('0x3')],queues[_0x231076[_0x26a4('0x3')]]['name'],_0x231076[_0x26a4('0x36')],_0x231076[_0x26a4('0x37')]));queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x33')]=!![];queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x1c')]=utils[_0x26a4('0x17')]();queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x38')]=utils['diffTime'](queues[_0x231076['uniqueid']][_0x26a4('0x1c')],queues[_0x231076['uniqueid']]['queuecallerjoinAt']);queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x15')]=_0x231076[_0x26a4('0x15')];queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x39')]=_0x231076[_0x26a4('0x39')];queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x36')]=_0x231076[_0x26a4('0x36')];queues[_0x231076[_0x26a4('0x3')]][_0x26a4('0x37')]=_0x231076[_0x26a4('0x37')];}}catch(_0x5969e2){utils[_0x26a4('0x18')](util[_0x26a4('0x11')]('[%s][queues][queuecallerleave]',_0x231076[_0x26a4('0x3')]),_0x5969e2);}};exports[_0x26a4('0x3a')]=function(_0x5b111f){try{if(!_[_0x26a4('0x1a')](queues[_0x5b111f['uniqueid']])){utils[_0x26a4('0x10')](util[_0x26a4('0x11')](_0x26a4('0x3b'),_0x5b111f[_0x26a4('0x3')]),_0x5b111f);utils[_0x26a4('0x13')](util['format'](_0x26a4('0x3c'),_0x5b111f[_0x26a4('0x3')],queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x21')],_0x5b111f[_0x26a4('0x3d')],_0x5b111f[_0x26a4('0x3e')]));queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x29')]=null;queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x2a')]=![];queues[_0x5b111f['uniqueid']]['queuecallerexitreason']=null;queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x2b')]=null;queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x3f')]=!![];queues[_0x5b111f[_0x26a4('0x3')]]['accountcode']=_0x5b111f[_0x26a4('0x3e')];queues[_0x5b111f[_0x26a4('0x3')]][_0x26a4('0x6')]=_0x5b111f[_0x26a4('0x3d')];}}catch(_0x53dfb7){utils[_0x26a4('0x18')](util[_0x26a4('0x11')](_0x26a4('0x3b'),_0x5b111f['uniqueid']),_0x53dfb7);}};exports['agentcomplete']=function(_0x364f19){try{if(!_[_0x26a4('0x1a')](queues[_0x364f19['uniqueid']])){if(queues[_0x364f19[_0x26a4('0x3')]]['queuecallerleaveAt']){utils[_0x26a4('0x10')](util[_0x26a4('0x11')]('[%s][queues][agentcomplete]',_0x364f19[_0x26a4('0x3')]),_0x364f19);queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x1d')]=![];queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x29')]=null;queues[_0x364f19[_0x26a4('0x3')]]['queuecallerexit']=![];queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x2b')]=null;queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x3f')]=!![];queues[_0x364f19[_0x26a4('0x3')]]['lastAssignedTo']=_0x364f19['membername'];queues[_0x364f19[_0x26a4('0x3')]]['queuecallercomplete']=!![];queues[_0x364f19[_0x26a4('0x3')]]['queuecallercompleteAt']=utils[_0x26a4('0x17')]();if(_0x364f19['reason']==_0x26a4('0x40')){if(!queues[_0x364f19['uniqueid']]['transfer']){queues[_0x364f19['uniqueid']][_0x26a4('0x8')]='TRANSFER';}}else{queues[_0x364f19['uniqueid']][_0x26a4('0x8')]=_0x26a4('0x41')+_0x364f19[_0x26a4('0x42')][_0x26a4('0x28')]();}utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x43'),_0x364f19['uniqueid'],queues[_0x364f19['uniqueid']][_0x26a4('0x21')],_0x364f19[_0x26a4('0x3d')],queues[_0x364f19[_0x26a4('0x3')]][_0x26a4('0x8')]));writeDB(queues[_0x364f19[_0x26a4('0x3')]]);}}}catch(_0x312830){utils[_0x26a4('0x18')](util[_0x26a4('0x11')](_0x26a4('0x44'),_0x364f19[_0x26a4('0x3')]),_0x312830);}};exports[_0x26a4('0x45')]=function(_0x4eeca8){try{if(!_[_0x26a4('0x1a')](queues[_0x4eeca8[_0x26a4('0x46')]])){utils['debug'](util[_0x26a4('0x11')](_0x26a4('0x47'),_0x4eeca8[_0x26a4('0x3')]),_0x4eeca8);queues[_0x4eeca8[_0x26a4('0x46')]][_0x26a4('0x40')]=!![];queues[_0x4eeca8[_0x26a4('0x46')]][_0x26a4('0x48')]=_0x26a4('0x49');queues[_0x4eeca8[_0x26a4('0x46')]][_0x26a4('0x4a')]=_0x4eeca8[_0x26a4('0x4b')];queues[_0x4eeca8[_0x26a4('0x46')]][_0x26a4('0x4c')]=_0x4eeca8[_0x26a4('0x46')];queues[_0x4eeca8[_0x26a4('0x46')]][_0x26a4('0x8')]=_0x26a4('0x4d');utils[_0x26a4('0x13')](util['format']('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x4eeca8[_0x26a4('0x3')],queues[_0x4eeca8['transfereeuniqueid']][_0x26a4('0x21')],_0x4eeca8[_0x26a4('0x46')],_0x4eeca8[_0x26a4('0x4b')]));}}catch(_0x4df4e6){utils['error'](util['format']('[%s][queues][blindtransfer]',_0x4eeca8['uniqueid']),_0x4df4e6);}};exports[_0x26a4('0x4e')]=function(_0x30a30b){try{utils[_0x26a4('0x10')](util[_0x26a4('0x11')]('[%s][queues][attendedtransfer]',_0x30a30b[_0x26a4('0x4f')]),_0x30a30b);if(_0x30a30b[_0x26a4('0x4f')]==_0x30a30b['origtransfererlinkedid']){if(!_[_0x26a4('0x1a')](queues[_0x30a30b['secondtransfererlinkedid']])){utils['info'](util[_0x26a4('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x30a30b[_0x26a4('0x4f')],queues[_0x30a30b[_0x26a4('0x50')]]['name'],_0x30a30b[_0x26a4('0x51')]));queues[_0x30a30b[_0x26a4('0x50')]]['transfer']=!![];queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0x48')]=_0x26a4('0x52');queues[_0x30a30b['secondtransfererlinkedid']][_0x26a4('0x4a')]=_0x30a30b['origtransfererexten'];queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0x4c')]=_0x30a30b[_0x26a4('0x4f')];queues[_0x30a30b['secondtransfererlinkedid']][_0x26a4('0x8')]=_0x26a4('0x53');}if(!_[_0x26a4('0x1a')](queues[_0x30a30b[_0x26a4('0x54')]])){if(_0x30a30b[_0x26a4('0x55')]&&queues[_0x30a30b[_0x26a4('0x55')]]){queues[_0x30a30b[_0x26a4('0x55')]]['queuecallerenterreason']=0x1;queues[_0x30a30b['transfereeuniqueid']]=_[_0x26a4('0x56')](queues[_0x30a30b[_0x26a4('0x55')]]);queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0xe')]=_0x30a30b['transfertargetuniqueid'];queues[_0x30a30b['transfereeuniqueid']][_0x26a4('0x23')]=0x2;queues[_0x30a30b[_0x26a4('0x46')]]['calleridnum']=queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0x57')];queues[_0x30a30b['transfereeuniqueid']][_0x26a4('0x58')]=queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0x58')];queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0x59')]=utils[_0x26a4('0x17')]();queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0x1c')]=utils[_0x26a4('0x17')]();queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0x38')]=0x0;queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0x5a')]=0x0;utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x5b'),_0x30a30b[_0x26a4('0x4f')],queues[_0x30a30b['transfereeuniqueid']][_0x26a4('0x21')],queues[_0x30a30b['transfereeuniqueid']][_0x26a4('0x57')],queues[_0x30a30b[_0x26a4('0x46')]][_0x26a4('0x58')]));}else{utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x5c'),_0x30a30b[_0x26a4('0x4f')],queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x21')],_0x30a30b[_0x26a4('0x50')]));queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0xe')]=_0x30a30b[_0x26a4('0x50')];}}}else if(_0x30a30b[_0x26a4('0x5d')]==_0x30a30b['secondtransfererlinkedid']){if(!_[_0x26a4('0x1a')](queues[_0x30a30b['origtransfererlinkedid']])){utils[_0x26a4('0x13')](util[_0x26a4('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x30a30b['origtransfereruniqueid'],queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x21')],_0x30a30b[_0x26a4('0x5d')],_0x30a30b[_0x26a4('0x5e')]));queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x40')]=!![];queues[_0x30a30b[_0x26a4('0x54')]]['transfertype']=_0x26a4('0x52');queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x4a')]=_0x30a30b[_0x26a4('0x5e')];queues[_0x30a30b['origtransfererlinkedid']][_0x26a4('0x4c')]=_0x30a30b[_0x26a4('0x5d')];queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x8')]=_0x26a4('0x53');}if(!_[_0x26a4('0x1a')](queues[_0x30a30b[_0x26a4('0x50')]])){if(_0x30a30b[_0x26a4('0x5f')]&&queues[_0x30a30b[_0x26a4('0x5f')]]){queues[_0x30a30b[_0x26a4('0x5f')]][_0x26a4('0x23')]=0x1;queues[_0x30a30b[_0x26a4('0x60')]]=_[_0x26a4('0x56')](queues[_0x30a30b[_0x26a4('0x5f')]]);queues[_0x30a30b['transfertargetuniqueid']]['transfereduniqueid']=_0x30a30b[_0x26a4('0x60')];queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x23')]=0x2;queues[_0x30a30b[_0x26a4('0x60')]]['calleridnum']=queues[_0x30a30b[_0x26a4('0x54')]]['calleridnum'];queues[_0x30a30b['transfertargetuniqueid']]['calleridname']=queues[_0x30a30b[_0x26a4('0x54')]][_0x26a4('0x58')];queues[_0x30a30b['transfertargetuniqueid']]['queuecallerjoinAt']=utils[_0x26a4('0x17')]();queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x1c')]=utils['now']();queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x38')]=0x0;queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x5a')]=0x0;utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x61'),_0x30a30b[_0x26a4('0x4f')],queues[_0x30a30b['transfertargetuniqueid']][_0x26a4('0x21')],queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0xe')],queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x57')],queues[_0x30a30b[_0x26a4('0x60')]][_0x26a4('0x58')]));}else{utils[_0x26a4('0x13')](util[_0x26a4('0x11')](_0x26a4('0x5c'),_0x30a30b[_0x26a4('0x4f')],queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0x21')],_0x30a30b[_0x26a4('0x54')]));queues[_0x30a30b[_0x26a4('0x50')]][_0x26a4('0xe')]=_0x30a30b['origtransfererlinkedid'];}}}}catch(_0x12aea7){utils[_0x26a4('0x18')](util['format'](_0x26a4('0x62'),_0x30a30b[_0x26a4('0x4f')]),_0x12aea7);}};exports[_0x26a4('0x63')]=function(_0xbbf4b2){try{if(!_['isNil'](queues[_0xbbf4b2[_0x26a4('0x3')]])){utils['debug'](util[_0x26a4('0x11')](_0x26a4('0x64'),_0xbbf4b2[_0x26a4('0x3')]),_0xbbf4b2);queues[_0xbbf4b2['uniqueid']][_0x26a4('0x65')]=utils['now']();utils[_0x26a4('0x13')](util[_0x26a4('0x11')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0xbbf4b2[_0x26a4('0x3')],queues[_0xbbf4b2['uniqueid']][_0x26a4('0x21')],queues[_0xbbf4b2['uniqueid']]['musiconholdstartAt']));}}catch(_0x439347){utils[_0x26a4('0x18')](util[_0x26a4('0x11')](_0x26a4('0x64'),_0xbbf4b2[_0x26a4('0x3')]),_0x439347);}};exports[_0x26a4('0x66')]=function(_0x71d8d8){try{if(!_[_0x26a4('0x1a')](queues[_0x71d8d8['uniqueid']])){if(!_[_0x26a4('0x1a')](queues[_0x71d8d8[_0x26a4('0x3')]][_0x26a4('0x65')])){utils['debug'](util[_0x26a4('0x11')](_0x26a4('0x67'),_0x71d8d8[_0x26a4('0x3')]),_0x71d8d8);queues[_0x71d8d8[_0x26a4('0x3')]][_0x26a4('0x5a')]+=utils['diffTime'](utils['now'](),queues[_0x71d8d8[_0x26a4('0x3')]][_0x26a4('0x65')]);utils[_0x26a4('0x13')](util[_0x26a4('0x11')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x71d8d8[_0x26a4('0x3')],queues[_0x71d8d8[_0x26a4('0x3')]]['name'],queues[_0x71d8d8['uniqueid']][_0x26a4('0x5a')]));delete queues[_0x71d8d8[_0x26a4('0x3')]]['musiconholdstartAt'];}}}catch(_0x584ea7){utils[_0x26a4('0x18')](util['format'](_0x26a4('0x67'),_0x71d8d8[_0x26a4('0x3')]),_0x584ea7);}};
\ No newline at end of file
index ec75d3b..95a98fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6923=['[%s][recordings][newstate]','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','find','monitors','hangup','[%s][recordings][hangup]','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','cdr','appdata','split','lastIndexOf','[%s][recordings][queuecallerjoin]','queue','lodash','util','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','uniqueid','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','isNil','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s'];(function(_0xa76db3,_0xf8fd0){var _0x47338e=function(_0x3163b6){while(--_0x3163b6){_0xa76db3['push'](_0xa76db3['shift']());}};_0x47338e(++_0xf8fd0);}(_0x6923,0x109));var _0x3692=function(_0x433938,_0x379623){_0x433938=_0x433938-0x0;var _0x54695d=_0x6923[_0x433938];return _0x54695d;};'use strict';var _=require(_0x3692('0x0'));var util=require(_0x3692('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x5c41bf){utils[_0x3692('0x2')](util[_0x3692('0x3')](_0x3692('0x4'),_0x5c41bf['uniqueid']));if(_0x5c41bf[_0x3692('0x5')]){utils[_0x3692('0x6')](_0x5c41bf[_0x3692('0x5')])[_0x3692('0x7')](function(_0x190afd){if(_0x190afd){_0x5c41bf['membername']=_0x190afd['name'];_0x5c41bf[_0x3692('0x8')]=_0x190afd['id'];}utils[_0x3692('0x9')](_0x3692('0xa'),_0x5c41bf);});}else{utils[_0x3692('0x9')](_0x3692('0xa'),_0x5c41bf);}}exports[_0x3692('0xb')]=function(_0x36aa44){try{utils[_0x3692('0xc')](util['format'](_0x3692('0xd'),_0x36aa44[_0x3692('0xe')]),_0x36aa44);if(_0x36aa44[_0x3692('0xe')]==_0x36aa44[_0x3692('0xf')]){utils['info'](util[_0x3692('0x3')](_0x3692('0x10'),_0x36aa44[_0x3692('0xe')],_0x36aa44['context'],_0x36aa44[_0x3692('0x11')]));recordings[_0x36aa44[_0x3692('0xe')]]={'uniqueid':_0x36aa44['uniqueid'],'accountcode':_0x36aa44[_0x3692('0x5')],'exten':_0x36aa44[_0x3692('0x11')],'context':_0x36aa44[_0x3692('0x12')],'channel':_0x36aa44[_0x3692('0x13')],'monitors':[]};}}catch(_0x34cd5f){utils[_0x3692('0x14')](util[_0x3692('0x3')](_0x3692('0xd'),_0x36aa44[_0x3692('0xe')]),_0x34cd5f);}};exports[_0x3692('0x15')]=function(_0x4e50e4){try{utils['debug'](util[_0x3692('0x3')]('[%s][recordings][newstate]',_0x4e50e4['uniqueid']),_0x4e50e4);if(!_[_0x3692('0x16')](recordings[_0x4e50e4[_0x3692('0xe')]])&&_0x4e50e4['channelstate']==0x6){utils['info'](util[_0x3692('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x4e50e4[_0x3692('0xe')],_0x4e50e4['context'],_0x4e50e4[_0x3692('0x13')]));}else if(!_[_0x3692('0x16')](recordings[_0x4e50e4[_0x3692('0xf')]])&&_0x4e50e4[_0x3692('0x17')]==0x6&&_0x4e50e4[_0x3692('0x12')]!='transfer'){utils[_0x3692('0x2')](util[_0x3692('0x3')](_0x3692('0x18'),_0x4e50e4[_0x3692('0xe')],_0x4e50e4[_0x3692('0xf')],_0x4e50e4['context'],_0x4e50e4['channel']));recordings[_0x4e50e4[_0x3692('0xf')]]['accountcode']=_0x4e50e4[_0x3692('0x5')];}}catch(_0x21df1b){utils[_0x3692('0x14')](util[_0x3692('0x3')](_0x3692('0x19'),_0x4e50e4[_0x3692('0xe')]),_0x21df1b);}};exports[_0x3692('0x1a')]=function(_0x5b0204){try{if(!_[_0x3692('0x16')](_0x5b0204[_0x3692('0x1b')])&&!_[_0x3692('0x16')](_0x5b0204[_0x3692('0x1b')][_0x3692('0x1c')])){utils[_0x3692('0xc')](util['format'](_0x3692('0x1d'),_0x5b0204[_0x3692('0xe')]),_0x5b0204);utils[_0x3692('0x2')](util[_0x3692('0x3')](_0x3692('0x1e'),_0x5b0204[_0x3692('0xe')],_0x5b0204[_0x3692('0x1b')],_0x5b0204[_0x3692('0x1f')]));if(_[_0x3692('0x20')](_0x5b0204[_0x3692('0x1f')],_0x3692('0x21'))){_0x5b0204[_0x3692('0x1f')]=_0x5b0204[_0x3692('0x1f')]['replace'](_0x3692('0x21'),'.WAV');}if(recordings[_0x5b0204[_0x3692('0xf')]]){var _0x17ef98=_[_0x3692('0x22')](recordings[_0x5b0204['linkedid']]['monitors'],{'value':_0x5b0204[_0x3692('0x1f')]});if(_[_0x3692('0x16')](_0x17ef98)){recordings[_0x5b0204[_0x3692('0xf')]][_0x3692('0x23')]['push']({'value':_0x5b0204[_0x3692('0x1f')]});}}}}catch(_0x497aa8){utils[_0x3692('0x14')](util[_0x3692('0x3')](_0x3692('0x1d'),_0x5b0204[_0x3692('0xe')]),_0x497aa8);}};exports[_0x3692('0x24')]=function(_0x476c5f){try{if(!_[_0x3692('0x16')](recordings[_0x476c5f['uniqueid']])){utils[_0x3692('0xc')](util[_0x3692('0x3')](_0x3692('0x25'),_0x476c5f['uniqueid']),_0x476c5f);utils['info'](util[_0x3692('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x476c5f[_0x3692('0xe')],_0x476c5f['calleridnum'],_0x476c5f[_0x3692('0x26')],_0x476c5f[_0x3692('0x27')]));recordings[_0x476c5f['uniqueid']][_0x3692('0x28')]=_0x476c5f[_0x3692('0x28')];recordings[_0x476c5f['uniqueid']]['calleridname']=_0x476c5f[_0x3692('0x26')];recordings[_0x476c5f['uniqueid']][_0x3692('0x29')]=_0x476c5f[_0x3692('0x29')];recordings[_0x476c5f[_0x3692('0xe')]][_0x3692('0x2a')]=_0x476c5f[_0x3692('0x2a')];if(recordings[_0x476c5f['uniqueid']]['type']=='outbound'&&recordings[_0x476c5f[_0x3692('0xe')]][_0x3692('0x5')]){recordings[_0x476c5f[_0x3692('0xe')]][_0x3692('0x29')]=recordings[_0x476c5f[_0x3692('0xe')]][_0x3692('0x5')];recordings[_0x476c5f[_0x3692('0xe')]][_0x3692('0x2a')]='';}recordings[_0x476c5f['uniqueid']][_0x3692('0x23')][_0x3692('0x2b')](function(_0x396e41){var _0x1bcc45=_[_0x3692('0x2c')](recordings[_0x476c5f['uniqueid']]);_0x1bcc45[_0x3692('0x1f')]=_0x396e41[_0x3692('0x1f')];writeDB(_0x1bcc45);});delete recordings[_0x476c5f['uniqueid']];}}catch(_0x2b2b6d){utils['error'](util[_0x3692('0x3')]('[%s][recordings][hangup]',_0x476c5f[_0x3692('0xe')]),_0x2b2b6d);}};exports[_0x3692('0x2d')]=function(_0x4d7155){try{if(!_[_0x3692('0x16')](recordings[_0x4d7155[_0x3692('0xe')]])){utils['debug'](util['format'](_0x3692('0x2e'),_0x4d7155[_0x3692('0xe')]),_0x4d7155);utils['info'](util[_0x3692('0x3')](_0x3692('0x2f'),_0x4d7155[_0x3692('0xe')],_0x4d7155[_0x3692('0x30')],_0x4d7155['appdata']));if(_0x4d7155['application'][_0x3692('0x31')]()==_0x3692('0x32')&&_[_0x3692('0x33')](_0x4d7155['appdata']['toLowerCase'](),_0x3692('0x34'))){var _0x2c25e3=_0x4d7155[_0x3692('0x35')][_0x3692('0x36')]('=');var _0xa8cbce=_0x2c25e3[0x0]['substring'](_0x2c25e3[0x0][_0x3692('0x37')]('(')+0x1,_0x2c25e3[0x0][_0x3692('0x37')](')'));var _0xe29889=_0x2c25e3[0x1];recordings[_0x4d7155[_0x3692('0xe')]][_0xa8cbce]=_0xe29889;}}}catch(_0x2d65f6){utils[_0x3692('0x14')](util[_0x3692('0x3')](_0x3692('0x2e'),_0x4d7155[_0x3692('0xe')]),_0x2d65f6);}};exports['queuecallerjoin']=function(_0x1b256a){try{if(!_[_0x3692('0x16')](recordings[_0x1b256a[_0x3692('0xe')]])){utils[_0x3692('0xc')](util[_0x3692('0x3')](_0x3692('0x38'),_0x1b256a[_0x3692('0xe')]),_0x1b256a);utils[_0x3692('0x2')](util[_0x3692('0x3')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x1b256a['uniqueid'],_0x1b256a[_0x3692('0x39')]));recordings[_0x1b256a[_0x3692('0xe')]]['queue']=_0x1b256a['queue'];}}catch(_0x154b64){utils[_0x3692('0x14')](util[_0x3692('0x3')](_0x3692('0x38'),_0x1b256a[_0x3692('0xe')]),_0x154b64);}};
\ No newline at end of file
+var _0xbb25=['set','startsWith','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','name','UserId','CreateVoiceRecording','request','newchannel','debug','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','[%s][recordings][newchannel]','newstate','[%s][recordings][newstate]','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','isNil','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','variable','endsWith','value','replace','.WAV','find','monitors','push','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xbb25,0x13f));var _0x5bb2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbb25[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5bb2('0x0'));var util=require('util');var utils=require(_0x5bb2('0x1'));var recordings={};function writeDB(_0x206821){utils[_0x5bb2('0x2')](util[_0x5bb2('0x3')](_0x5bb2('0x4'),_0x206821[_0x5bb2('0x5')]));if(_0x206821['accountcode']){utils[_0x5bb2('0x6')](_0x206821[_0x5bb2('0x7')])[_0x5bb2('0x8')](function(_0x179d62){if(_0x179d62){_0x206821['membername']=_0x179d62[_0x5bb2('0x9')];_0x206821[_0x5bb2('0xa')]=_0x179d62['id'];}utils['request'](_0x5bb2('0xb'),_0x206821);});}else{utils[_0x5bb2('0xc')](_0x5bb2('0xb'),_0x206821);}}exports[_0x5bb2('0xd')]=function(_0x532085){try{utils[_0x5bb2('0xe')](util['format']('[%s][recordings][newchannel]',_0x532085[_0x5bb2('0x5')]),_0x532085);if(_0x532085[_0x5bb2('0x5')]==_0x532085[_0x5bb2('0xf')]){utils[_0x5bb2('0x2')](util[_0x5bb2('0x3')](_0x5bb2('0x10'),_0x532085[_0x5bb2('0x5')],_0x532085[_0x5bb2('0x11')],_0x532085[_0x5bb2('0x12')]));recordings[_0x532085[_0x5bb2('0x5')]]={'uniqueid':_0x532085[_0x5bb2('0x5')],'accountcode':_0x532085[_0x5bb2('0x7')],'exten':_0x532085[_0x5bb2('0x12')],'context':_0x532085[_0x5bb2('0x11')],'channel':_0x532085[_0x5bb2('0x13')],'monitors':[]};}}catch(_0x5d51eb){utils['error'](util[_0x5bb2('0x3')](_0x5bb2('0x14'),_0x532085['uniqueid']),_0x5d51eb);}};exports[_0x5bb2('0x15')]=function(_0x5a9feb){try{utils['debug'](util['format'](_0x5bb2('0x16'),_0x5a9feb['uniqueid']),_0x5a9feb);if(!_['isNil'](recordings[_0x5a9feb[_0x5bb2('0x5')]])&&_0x5a9feb['channelstate']==0x6){utils[_0x5bb2('0x2')](util[_0x5bb2('0x3')]('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x5a9feb[_0x5bb2('0x5')],_0x5a9feb[_0x5bb2('0x11')],_0x5a9feb[_0x5bb2('0x13')]));}else if(!_['isNil'](recordings[_0x5a9feb[_0x5bb2('0xf')]])&&_0x5a9feb['channelstate']==0x6&&_0x5a9feb[_0x5bb2('0x11')]!='transfer'){utils[_0x5bb2('0x2')](util['format'](_0x5bb2('0x17'),_0x5a9feb['uniqueid'],_0x5a9feb[_0x5bb2('0xf')],_0x5a9feb[_0x5bb2('0x11')],_0x5a9feb[_0x5bb2('0x13')]));recordings[_0x5a9feb[_0x5bb2('0xf')]]['accountcode']=_0x5a9feb[_0x5bb2('0x7')];}}catch(_0x56e74b){utils[_0x5bb2('0x18')](util['format']('[%s][recordings][newstate]',_0x5a9feb['uniqueid']),_0x56e74b);}};exports[_0x5bb2('0x19')]=function(_0x40dd55){try{if(!_['isNil'](_0x40dd55['variable'])&&!_[_0x5bb2('0x1a')](_0x40dd55['variable'][_0x5bb2('0x1b')])){utils[_0x5bb2('0xe')](util[_0x5bb2('0x3')](_0x5bb2('0x1c'),_0x40dd55['uniqueid']),_0x40dd55);utils['info'](util['format'](_0x5bb2('0x1d'),_0x40dd55[_0x5bb2('0x5')],_0x40dd55[_0x5bb2('0x1e')],_0x40dd55['value']));if(_[_0x5bb2('0x1f')](_0x40dd55[_0x5bb2('0x20')],'.wav49')){_0x40dd55[_0x5bb2('0x20')]=_0x40dd55[_0x5bb2('0x20')][_0x5bb2('0x21')]('.wav49',_0x5bb2('0x22'));}if(recordings[_0x40dd55[_0x5bb2('0xf')]]){var _0x14b01a=_[_0x5bb2('0x23')](recordings[_0x40dd55[_0x5bb2('0xf')]][_0x5bb2('0x24')],{'value':_0x40dd55[_0x5bb2('0x20')]});if(_[_0x5bb2('0x1a')](_0x14b01a)){recordings[_0x40dd55[_0x5bb2('0xf')]][_0x5bb2('0x24')][_0x5bb2('0x25')]({'value':_0x40dd55[_0x5bb2('0x20')]});}}}}catch(_0x50dd5a){utils[_0x5bb2('0x18')](util[_0x5bb2('0x3')]('[%s][recordings][varset]',_0x40dd55[_0x5bb2('0x5')]),_0x50dd5a);}};exports['hangup']=function(_0x3230ce){try{if(!_[_0x5bb2('0x1a')](recordings[_0x3230ce['uniqueid']])){utils['debug'](util[_0x5bb2('0x3')]('[%s][recordings][hangup]',_0x3230ce[_0x5bb2('0x5')]),_0x3230ce);utils[_0x5bb2('0x2')](util[_0x5bb2('0x3')](_0x5bb2('0x26'),_0x3230ce[_0x5bb2('0x5')],_0x3230ce['calleridnum'],_0x3230ce[_0x5bb2('0x27')],_0x3230ce['cause-txt']));recordings[_0x3230ce['uniqueid']][_0x5bb2('0x28')]=_0x3230ce[_0x5bb2('0x28')];recordings[_0x3230ce[_0x5bb2('0x5')]][_0x5bb2('0x27')]=_0x3230ce[_0x5bb2('0x27')];recordings[_0x3230ce[_0x5bb2('0x5')]]['connectedlinenum']=_0x3230ce[_0x5bb2('0x29')];recordings[_0x3230ce[_0x5bb2('0x5')]]['connectedlinename']=_0x3230ce[_0x5bb2('0x2a')];if(recordings[_0x3230ce['uniqueid']][_0x5bb2('0x2b')]==_0x5bb2('0x2c')&&recordings[_0x3230ce['uniqueid']][_0x5bb2('0x7')]){recordings[_0x3230ce[_0x5bb2('0x5')]][_0x5bb2('0x29')]=recordings[_0x3230ce[_0x5bb2('0x5')]]['accountcode'];recordings[_0x3230ce[_0x5bb2('0x5')]][_0x5bb2('0x2a')]='';}recordings[_0x3230ce[_0x5bb2('0x5')]][_0x5bb2('0x24')][_0x5bb2('0x2d')](function(_0x10aa4a){var _0x48ae3b=_[_0x5bb2('0x2e')](recordings[_0x3230ce['uniqueid']]);_0x48ae3b[_0x5bb2('0x20')]=_0x10aa4a['value'];writeDB(_0x48ae3b);});delete recordings[_0x3230ce['uniqueid']];}}catch(_0x57e2eb){utils[_0x5bb2('0x18')](util[_0x5bb2('0x3')](_0x5bb2('0x2f'),_0x3230ce['uniqueid']),_0x57e2eb);}};exports[_0x5bb2('0x30')]=function(_0x21d821){try{if(!_['isNil'](recordings[_0x21d821[_0x5bb2('0x5')]])){utils[_0x5bb2('0xe')](util[_0x5bb2('0x3')](_0x5bb2('0x31'),_0x21d821[_0x5bb2('0x5')]),_0x21d821);utils['info'](util[_0x5bb2('0x3')](_0x5bb2('0x32'),_0x21d821[_0x5bb2('0x5')],_0x21d821[_0x5bb2('0x33')],_0x21d821[_0x5bb2('0x34')]));if(_0x21d821['application']['toLowerCase']()==_0x5bb2('0x35')&&_[_0x5bb2('0x36')](_0x21d821[_0x5bb2('0x34')]['toLowerCase'](),'cdr')){var _0x577c8f=_0x21d821[_0x5bb2('0x34')][_0x5bb2('0x37')]('=');var _0x50e220=_0x577c8f[0x0][_0x5bb2('0x38')](_0x577c8f[0x0][_0x5bb2('0x39')]('(')+0x1,_0x577c8f[0x0][_0x5bb2('0x39')](')'));var _0x241aec=_0x577c8f[0x1];recordings[_0x21d821['uniqueid']][_0x50e220]=_0x241aec;}}}catch(_0x8d950d){utils[_0x5bb2('0x18')](util['format'](_0x5bb2('0x31'),_0x21d821[_0x5bb2('0x5')]),_0x8d950d);}};exports[_0x5bb2('0x3a')]=function(_0x5d68b4){try{if(!_[_0x5bb2('0x1a')](recordings[_0x5d68b4[_0x5bb2('0x5')]])){utils[_0x5bb2('0xe')](util[_0x5bb2('0x3')](_0x5bb2('0x3b'),_0x5d68b4[_0x5bb2('0x5')]),_0x5d68b4);utils[_0x5bb2('0x2')](util[_0x5bb2('0x3')](_0x5bb2('0x3c'),_0x5d68b4['uniqueid'],_0x5d68b4[_0x5bb2('0x3d')]));recordings[_0x5d68b4[_0x5bb2('0x5')]][_0x5bb2('0x3d')]=_0x5d68b4['queue'];}}catch(_0x46be80){utils['error'](util[_0x5bb2('0x3')](_0x5bb2('0x3b'),_0x5d68b4[_0x5bb2('0x5')]),_0x46be80);}};
\ No newline at end of file
index 70b660d..2e18a6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x17f4=['attendedtransfer','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','attended','isNil','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','blinds','transfereruniqueid','error'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x17f4,0x11e));var _0x417f=function(_0xa01eea,_0x12e531){_0xa01eea=_0xa01eea-0x0;var _0x47c05e=_0x17f4[_0xa01eea];return _0x47c05e;};'use strict';var _=require(_0x417f('0x0'));var util=require('util');var utils=require(_0x417f('0x1'));function writeDB(_0xdf5ac1){utils[_0x417f('0x2')](util[_0x417f('0x3')](_0x417f('0x4'),_0xdf5ac1[_0x417f('0x5')]==='attended'?_0xdf5ac1[_0x417f('0x6')]:_0xdf5ac1[_0x417f('0x7')],_0xdf5ac1[_0x417f('0x5')]));utils[_0x417f('0x8')](_0x417f('0x9'),_0xdf5ac1);}exports['blinds']={};exports[_0x417f('0xa')]=function(_0x3e508d){try{utils[_0x417f('0xb')](util[_0x417f('0x3')](_0x417f('0xc'),_0x3e508d[_0x417f('0x7')]),_0x3e508d);utils['info'](util[_0x417f('0x3')](_0x417f('0xd'),_0x3e508d['uniqueid'],_0x3e508d[_0x417f('0xe')],_0x3e508d[_0x417f('0xf')],_0x3e508d[_0x417f('0x10')],_0x3e508d[_0x417f('0x11')]));_0x3e508d[_0x417f('0x5')]=_0x417f('0x12');exports[_0x417f('0x13')][_0x3e508d[_0x417f('0x14')]]=_0x3e508d;writeDB(_0x3e508d);}catch(_0x151a04){utils[_0x417f('0x15')](util[_0x417f('0x3')]('[%s][transfers][blindtransfer]',_0x3e508d[_0x417f('0x7')]),_0x151a04);}};exports[_0x417f('0x16')]=function(_0x3e800b){try{utils[_0x417f('0xb')](util['format']('[%s][transfers][attendedtransfer]',_0x3e800b[_0x417f('0x6')]),_0x3e800b);utils[_0x417f('0x2')](util[_0x417f('0x3')](_0x417f('0x17'),_0x3e800b[_0x417f('0x6')],_0x3e800b[_0x417f('0x18')],_0x3e800b[_0x417f('0x19')],_0x3e800b[_0x417f('0x1a')],_0x3e800b[_0x417f('0x1b')]));_0x3e800b=_[_0x417f('0x1c')](_0x3e800b,{'transfererchannel':_0x3e800b[_0x417f('0x1d')],'transferercalleridnum':_0x3e800b[_0x417f('0x18')],'transferercalleridname':_0x3e800b[_0x417f('0x19')],'transfererconnectedlinenum':_0x3e800b[_0x417f('0x1e')],'transfererconnectedlinename':_0x3e800b[_0x417f('0x1f')],'transfereraccountcode':_0x3e800b['origtransfereraccountcode'],'transferercontext':_0x3e800b[_0x417f('0x20')],'transfererexten':_0x3e800b[_0x417f('0x21')],'transfererlinkedid':_0x3e800b['origtransfererlinkedid'],'context':_0x3e800b[_0x417f('0x22')],'extension':_0x3e800b[_0x417f('0x23')],'type':_0x417f('0x24')});if(_[_0x417f('0x25')](_0x3e800b['transfereechannel'])){_0x3e800b=_[_0x417f('0x1c')](_0x3e800b,{'transfereechannel':_0x3e800b[_0x417f('0x26')],'transfereecalleridnum':_0x3e800b[_0x417f('0x1a')],'transfereecalleridname':_0x3e800b[_0x417f('0x1b')],'transfereeconnectedlinenum':_0x3e800b['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x3e800b[_0x417f('0x27')],'transfereeaccountcode':_0x3e800b[_0x417f('0x28')],'transfereecontext':_0x3e800b[_0x417f('0x29')],'transfereeexten':_0x3e800b[_0x417f('0x2a')],'transfereelinkedid':_0x3e800b[_0x417f('0x2b')]});}writeDB(_0x3e800b);}catch(_0xe1ccac){utils['error'](util[_0x417f('0x3')]('[%s][transfers][attendedtransfer]',_0x3e800b['origtransfereruniqueid']),_0xe1ccac);}};
\ No newline at end of file
+var _0x1143=['[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','attended','assign','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','info','format','[%s][transfers][writeDB]\x20type:%s','type','origtransfereruniqueid','request','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]'];(function(_0x55a672,_0x466350){var _0x106178=function(_0x231974){while(--_0x231974){_0x55a672['push'](_0x55a672['shift']());}};_0x106178(++_0x466350);}(_0x1143,0x1c1));var _0x3114=function(_0x377743,_0x584cab){_0x377743=_0x377743-0x0;var _0x30ae30=_0x1143[_0x377743];return _0x30ae30;};'use strict';var _=require(_0x3114('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x33e0df){utils[_0x3114('0x1')](util[_0x3114('0x2')](_0x3114('0x3'),_0x33e0df[_0x3114('0x4')]==='attended'?_0x33e0df[_0x3114('0x5')]:_0x33e0df['uniqueid'],_0x33e0df[_0x3114('0x4')]));utils[_0x3114('0x6')]('CreateVoiceTransferReport',_0x33e0df);}exports[_0x3114('0x7')]={};exports[_0x3114('0x8')]=function(_0x403785){try{utils[_0x3114('0x9')](util[_0x3114('0x2')](_0x3114('0xa'),_0x403785[_0x3114('0xb')]),_0x403785);utils['info'](util[_0x3114('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x403785[_0x3114('0xb')],_0x403785[_0x3114('0xc')],_0x403785[_0x3114('0xd')],_0x403785[_0x3114('0xe')],_0x403785['transfereecalleridname']));_0x403785['type']=_0x3114('0xf');exports[_0x3114('0x7')][_0x403785['transfereruniqueid']]=_0x403785;writeDB(_0x403785);}catch(_0x4c63d4){utils[_0x3114('0x10')](util['format'](_0x3114('0xa'),_0x403785[_0x3114('0xb')]),_0x4c63d4);}};exports[_0x3114('0x11')]=function(_0x4b9319){try{utils[_0x3114('0x9')](util[_0x3114('0x2')](_0x3114('0x12'),_0x4b9319[_0x3114('0x5')]),_0x4b9319);utils[_0x3114('0x1')](util[_0x3114('0x2')](_0x3114('0x13'),_0x4b9319['origtransfereruniqueid'],_0x4b9319[_0x3114('0x14')],_0x4b9319[_0x3114('0x15')],_0x4b9319[_0x3114('0x16')],_0x4b9319[_0x3114('0x17')]));_0x4b9319=_['assign'](_0x4b9319,{'transfererchannel':_0x4b9319[_0x3114('0x18')],'transferercalleridnum':_0x4b9319[_0x3114('0x14')],'transferercalleridname':_0x4b9319[_0x3114('0x15')],'transfererconnectedlinenum':_0x4b9319[_0x3114('0x19')],'transfererconnectedlinename':_0x4b9319[_0x3114('0x1a')],'transfereraccountcode':_0x4b9319[_0x3114('0x1b')],'transferercontext':_0x4b9319[_0x3114('0x1c')],'transfererexten':_0x4b9319['secondtransfererexten'],'transfererlinkedid':_0x4b9319[_0x3114('0x1d')],'context':_0x4b9319[_0x3114('0x1e')],'extension':_0x4b9319['origtransfererexten'],'type':_0x3114('0x1f')});if(_['isNil'](_0x4b9319['transfereechannel'])){_0x4b9319=_[_0x3114('0x20')](_0x4b9319,{'transfereechannel':_0x4b9319['transfertargetchannel'],'transfereecalleridnum':_0x4b9319['transfertargetcalleridnum'],'transfereecalleridname':_0x4b9319[_0x3114('0x17')],'transfereeconnectedlinenum':_0x4b9319[_0x3114('0x21')],'transfereeconnectedlinename':_0x4b9319[_0x3114('0x22')],'transfereeaccountcode':_0x4b9319[_0x3114('0x23')],'transfereecontext':_0x4b9319[_0x3114('0x24')],'transfereeexten':_0x4b9319[_0x3114('0x25')],'transfereelinkedid':_0x4b9319[_0x3114('0x26')]});}writeDB(_0x4b9319);}catch(_0x27ac73){utils[_0x3114('0x10')](util['format'](_0x3114('0x12'),_0x4b9319[_0x3114('0x5')]),_0x27ac73);}};
\ No newline at end of file
index c6ff0af..8287e1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fe7=['[utils][getVoiceQueueByName]','addTime','add','seconds','format','subtractTime','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','isBefore','bluebird','jayson/promise','util','http','../../config/logger','xdr','info','debug','inspect','error','request','then','catch','[utils][request]\x20name:%s','internal','name','interface','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByName','[utils][getUserByName]','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x9fe7,0x1df));var _0x79fe=function(_0x2d1687,_0x65eda3){_0x2d1687=_0x2d1687-0x0;var _0x333e9e=_0x9fe7[_0x2d1687];return _0x333e9e;};'use strict';var BPromise=require(_0x79fe('0x0'));var jayson=require(_0x79fe('0x1'));var moment=require('moment');var util=require(_0x79fe('0x2'));var client=jayson['client'][_0x79fe('0x3')]({'port':0x2329});var logger=require(_0x79fe('0x4'))(_0x79fe('0x5'));exports['info']=function(_0x44c145,_0x627ec4){logger[_0x79fe('0x6')](_0x44c145,_0x627ec4?util['inspect'](_0x627ec4,{'showHidden':![],'depth':null}):'');};exports[_0x79fe('0x7')]=function(_0x2a5aef,_0x2ba246){logger['debug'](_0x2a5aef,_0x2ba246?util[_0x79fe('0x8')](_0x2ba246,{'showHidden':![],'depth':null}):'');};exports[_0x79fe('0x9')]=function(_0x29b317,_0x26d723){logger[_0x79fe('0x9')](_0x29b317,_0x26d723?util['inspect'](_0x26d723,{'showHidden':![],'depth':null}):'');};exports[_0x79fe('0xa')]=function(_0x253f7d,_0x4a3ccf){return client[_0x79fe('0xa')](_0x253f7d,{'body':_0x4a3ccf})[_0x79fe('0xb')](function(_0x33351e){logger[_0x79fe('0x7')]('[utils][request]\x20name:%s',_0x253f7d,_0x33351e?util[_0x79fe('0x8')](_0x33351e,{'showHidden':![],'depth':null}):'');})[_0x79fe('0xc')](function(_0x3e0ad8){logger[_0x79fe('0x9')](_0x79fe('0xd'),_0x253f7d,_0x3e0ad8?util[_0x79fe('0x8')](_0x3e0ad8,{'showHidden':![],'depth':null}):'');});};function getUser(_0x42bbe4){return client[_0x79fe('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0x79fe('0xe'),_0x79fe('0xf'),_0x79fe('0x10')],'where':_0x42bbe4,'limit':0x1}})[_0x79fe('0xb')](function(_0x35fb79){logger[_0x79fe('0x7')]('[utils][getUser]\x20where:%s',JSON[_0x79fe('0x11')](_0x42bbe4),_0x35fb79?util[_0x79fe('0x8')](_0x35fb79,{'showHidden':![],'depth':null}):'');return _0x35fb79[_0x79fe('0x12')][_0x79fe('0x13')]?_0x35fb79['result'][0x0]:null;});}exports[_0x79fe('0x14')]=function(_0x16f93a){return new BPromise(function(_0x39be95,_0x40a549){if(_0x16f93a){return getUser({'internal':_0x16f93a})['then'](function(_0x5e2f0b){logger[_0x79fe('0x6')](_0x79fe('0x15'),_0x16f93a,_0x5e2f0b?_0x79fe('0x16'):'notfound');return _0x39be95(_0x5e2f0b);})[_0x79fe('0xc')](function(_0x4141ec){logger[_0x79fe('0x9')]('[utils][getUserByInternal]',_0x4141ec?util[_0x79fe('0x8')](_0x4141ec,{'showHidden':![],'depth':null}):'');return _0x39be95(null);});}return _0x39be95(null);});};exports['getUserByInterface']=function(_0x15f019){return new BPromise(function(_0xde2451,_0x3f1b15){if(_0x15f019){return getUser({'interface':_0x15f019})[_0x79fe('0xb')](function(_0x1ac8d7){logger[_0x79fe('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x15f019,_0x1ac8d7?'found':_0x79fe('0x17'));return _0xde2451(_0x1ac8d7);})['catch'](function(_0x16aa35){logger[_0x79fe('0x9')]('[utils][getUserByInterface]',_0x16aa35?util['inspect'](_0x16aa35,{'showHidden':![],'depth':null}):'');return _0xde2451(null);});}return _0xde2451(null);});};exports[_0x79fe('0x18')]=function(_0x321778){return new BPromise(function(_0x59339b,_0x46d93d){if(_0x321778){return getUser({'name':_0x321778})[_0x79fe('0xb')](function(_0x5c84e0){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x321778,_0x5c84e0?_0x79fe('0x16'):_0x79fe('0x17'));return _0x59339b(_0x5c84e0);})[_0x79fe('0xc')](function(_0x4ac913){logger[_0x79fe('0x9')](_0x79fe('0x19'),_0x4ac913?util[_0x79fe('0x8')](_0x4ac913,{'showHidden':![],'depth':null}):'');return _0x59339b(null);});}return _0x59339b(null);});};exports['getVoiceQueueByName']=function(_0x4e2740){return new BPromise(function(_0x14e055,_0x51200f){if(_0x4e2740){return client[_0x79fe('0xa')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name','type','acw',_0x79fe('0x1a')],'where':{'name':_0x4e2740},'limit':0x1}})[_0x79fe('0xb')](function(_0x4dff5f){logger[_0x79fe('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x4e2740,_0x4dff5f?util[_0x79fe('0x8')](_0x4dff5f,{'showHidden':![],'depth':null}):'');logger[_0x79fe('0x6')](_0x79fe('0x1b'),_0x4e2740,_0x4dff5f?_0x79fe('0x16'):_0x79fe('0x17'));return _0x14e055(_0x4dff5f['result'][_0x79fe('0x13')]?_0x4dff5f[_0x79fe('0x12')][0x0]:null);})[_0x79fe('0xc')](function(_0x190202){logger[_0x79fe('0x9')](_0x79fe('0x1c'),_0x190202?util['inspect'](_0x190202,{'showHidden':![],'depth':null}):'');return _0x14e055(null);});}return _0x14e055(null);});};exports[_0x79fe('0x1d')]=function(_0x125226,_0x8ddef3){return moment(_0x125226)[_0x79fe('0x1e')](_0x8ddef3,_0x79fe('0x1f'))[_0x79fe('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x79fe('0x21')]=function(_0x5a917f,_0x2bdf83){return moment(_0x5a917f)['subtract'](_0x2bdf83,_0x79fe('0x1f'))['format'](_0x79fe('0x22'));};exports[_0x79fe('0x23')]=function(_0x41177d,_0x4fb6f4){return moment(_0x41177d)[_0x79fe('0x24')](moment(_0x4fb6f4),_0x79fe('0x1f'));};exports[_0x79fe('0x25')]=function(_0x31b9d6,_0x2b203b){return parseInt(_0x31b9d6,0xa)+parseInt(_0x2b203b,0xa);};exports['now']=function(){return moment()['format'](_0x79fe('0x22'));};exports['isAfter']=function(_0x27de50,_0x44d97e){if(_0x44d97e){return moment(_0x27de50)['isAfter'](_0x44d97e);}return!![];};exports[_0x79fe('0x26')]=function(_0x46da71,_0xfa1cc){if(_0xfa1cc){return moment(_0x46da71)[_0x79fe('0x26')](_0xfa1cc);}else if(_0x46da71){return!![];}return![];};
\ No newline at end of file
+var _0xde36=['[utils][getUserByName]','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','util','http','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','GetUser','name','interface','then','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s'];(function(_0x2b06d0,_0xca0d0){var _0x2c2202=function(_0x5e437a){while(--_0x5e437a){_0x2b06d0['push'](_0x2b06d0['shift']());}};_0x2c2202(++_0xca0d0);}(_0xde36,0x1a5));var _0x6de3=function(_0x2d6476,_0x2cdb28){_0x2d6476=_0x2d6476-0x0;var _0x4f096c=_0xde36[_0x2d6476];return _0x4f096c;};'use strict';var BPromise=require(_0x6de3('0x0'));var jayson=require(_0x6de3('0x1'));var moment=require('moment');var util=require(_0x6de3('0x2'));var client=jayson['client'][_0x6de3('0x3')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x6de3('0x4')]=function(_0x15a010,_0x5731c9){logger[_0x6de3('0x4')](_0x15a010,_0x5731c9?util[_0x6de3('0x5')](_0x5731c9,{'showHidden':![],'depth':null}):'');};exports[_0x6de3('0x6')]=function(_0x1fbcbb,_0x19e3ab){logger['debug'](_0x1fbcbb,_0x19e3ab?util[_0x6de3('0x5')](_0x19e3ab,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x19648a,_0x18c838){logger[_0x6de3('0x7')](_0x19648a,_0x18c838?util[_0x6de3('0x5')](_0x18c838,{'showHidden':![],'depth':null}):'');};exports[_0x6de3('0x8')]=function(_0x25b0a5,_0x18b973){return client[_0x6de3('0x8')](_0x25b0a5,{'body':_0x18b973})['then'](function(_0x9d2d92){logger[_0x6de3('0x6')](_0x6de3('0x9'),_0x25b0a5,_0x9d2d92?util[_0x6de3('0x5')](_0x9d2d92,{'showHidden':![],'depth':null}):'');})[_0x6de3('0xa')](function(_0x47ccda){logger[_0x6de3('0x7')](_0x6de3('0x9'),_0x25b0a5,_0x47ccda?util[_0x6de3('0x5')](_0x47ccda,{'showHidden':![],'depth':null}):'');});};function getUser(_0x4732fb){return client[_0x6de3('0x8')](_0x6de3('0xb'),{'options':{'raw':!![],'attributes':['id','internal',_0x6de3('0xc'),_0x6de3('0xd')],'where':_0x4732fb,'limit':0x1}})[_0x6de3('0xe')](function(_0x3e7ce7){logger['debug'](_0x6de3('0xf'),JSON[_0x6de3('0x10')](_0x4732fb),_0x3e7ce7?util[_0x6de3('0x5')](_0x3e7ce7,{'showHidden':![],'depth':null}):'');return _0x3e7ce7[_0x6de3('0x11')][_0x6de3('0x12')]?_0x3e7ce7['result'][0x0]:null;});}exports[_0x6de3('0x13')]=function(_0x268c48){return new BPromise(function(_0x417b8b,_0x47ab50){if(_0x268c48){return getUser({'internal':_0x268c48})[_0x6de3('0xe')](function(_0x1cc286){logger[_0x6de3('0x4')](_0x6de3('0x14'),_0x268c48,_0x1cc286?_0x6de3('0x15'):_0x6de3('0x16'));return _0x417b8b(_0x1cc286);})[_0x6de3('0xa')](function(_0x5580d4){logger[_0x6de3('0x7')](_0x6de3('0x17'),_0x5580d4?util['inspect'](_0x5580d4,{'showHidden':![],'depth':null}):'');return _0x417b8b(null);});}return _0x417b8b(null);});};exports[_0x6de3('0x18')]=function(_0x1a9dda){return new BPromise(function(_0x5488dc,_0x4ee51d){if(_0x1a9dda){return getUser({'interface':_0x1a9dda})['then'](function(_0x10daaf){logger[_0x6de3('0x4')](_0x6de3('0x19'),_0x1a9dda,_0x10daaf?'found':'notfound');return _0x5488dc(_0x10daaf);})[_0x6de3('0xa')](function(_0x3d1a48){logger[_0x6de3('0x7')](_0x6de3('0x1a'),_0x3d1a48?util['inspect'](_0x3d1a48,{'showHidden':![],'depth':null}):'');return _0x5488dc(null);});}return _0x5488dc(null);});};exports[_0x6de3('0x1b')]=function(_0x2bcb5d){return new BPromise(function(_0x56a5a4,_0x2ba4c3){if(_0x2bcb5d){return getUser({'name':_0x2bcb5d})[_0x6de3('0xe')](function(_0x1d08c9){logger[_0x6de3('0x4')](_0x6de3('0x1c'),_0x2bcb5d,_0x1d08c9?_0x6de3('0x15'):_0x6de3('0x16'));return _0x56a5a4(_0x1d08c9);})['catch'](function(_0x90868a){logger['error'](_0x6de3('0x1d'),_0x90868a?util['inspect'](_0x90868a,{'showHidden':![],'depth':null}):'');return _0x56a5a4(null);});}return _0x56a5a4(null);});};exports['getVoiceQueueByName']=function(_0x549139){return new BPromise(function(_0x2e352a,_0x4bff66){if(_0x549139){return client[_0x6de3('0x8')](_0x6de3('0x1e'),{'options':{'raw':!![],'attributes':['id',_0x6de3('0xc'),_0x6de3('0x1f'),_0x6de3('0x20'),_0x6de3('0x21')],'where':{'name':_0x549139},'limit':0x1}})[_0x6de3('0xe')](function(_0x3aa4e1){logger[_0x6de3('0x6')](_0x6de3('0x22'),_0x549139,_0x3aa4e1?util[_0x6de3('0x5')](_0x3aa4e1,{'showHidden':![],'depth':null}):'');logger[_0x6de3('0x4')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x549139,_0x3aa4e1?'found':'notfound');return _0x2e352a(_0x3aa4e1[_0x6de3('0x11')][_0x6de3('0x12')]?_0x3aa4e1[_0x6de3('0x11')][0x0]:null);})['catch'](function(_0x4a96e5){logger[_0x6de3('0x7')](_0x6de3('0x23'),_0x4a96e5?util[_0x6de3('0x5')](_0x4a96e5,{'showHidden':![],'depth':null}):'');return _0x2e352a(null);});}return _0x2e352a(null);});};exports[_0x6de3('0x24')]=function(_0x1b397a,_0xed5a3d){return moment(_0x1b397a)['add'](_0xed5a3d,_0x6de3('0x25'))[_0x6de3('0x26')](_0x6de3('0x27'));};exports[_0x6de3('0x28')]=function(_0x11c2e1,_0x3c88ef){return moment(_0x11c2e1)['subtract'](_0x3c88ef,_0x6de3('0x25'))['format'](_0x6de3('0x27'));};exports['diffTime']=function(_0xba34f,_0x27fbcb){return moment(_0xba34f)[_0x6de3('0x29')](moment(_0x27fbcb),_0x6de3('0x25'));};exports[_0x6de3('0x2a')]=function(_0x31628,_0x57a930){return parseInt(_0x31628,0xa)+parseInt(_0x57a930,0xa);};exports['now']=function(){return moment()['format'](_0x6de3('0x27'));};exports[_0x6de3('0x2b')]=function(_0x519ac9,_0x23efb8){if(_0x23efb8){return moment(_0x519ac9)[_0x6de3('0x2b')](_0x23efb8);}return!![];};exports[_0x6de3('0x2c')]=function(_0xf7d7dd,_0x3b666f){if(_0x3b666f){return moment(_0xf7d7dd)['isBefore'](_0x3b666f);}else if(_0xf7d7dd){return!![];}return![];};
\ No newline at end of file